summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2016-03-07 22:07:50 +0000
committerKirill Volinsky <mataes2007@gmail.com>2016-03-07 22:07:50 +0000
commit90cc15799fe189134d9580c1dc121d0b78df17ba (patch)
tree32ea2068c77c2e224d743479408818315931f64b
parent33f7eca09be79fb9f1d1933f198b5ec60e465cd7 (diff)
tgl.lib first compile version. Only release x86
git-svn-id: http://svn.miranda-ng.org/main/trunk@16445 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/Telegram/tgl/CHANGELOG23
-rw-r--r--protocols/Telegram/tgl/LICENSE175
-rw-r--r--protocols/Telegram/tgl/Makefile.in95
-rw-r--r--protocols/Telegram/tgl/Makefile.tl-parser7
-rw-r--r--protocols/Telegram/tgl/README.md27
-rw-r--r--protocols/Telegram/tgl/auto-static-autocomplete.c63
-rw-r--r--protocols/Telegram/tgl/auto-static-fetch-ds.c0
-rw-r--r--protocols/Telegram/tgl/auto-static-fetch.c106
-rw-r--r--protocols/Telegram/tgl/auto-static-free-ds.c0
-rw-r--r--protocols/Telegram/tgl/auto-static-print-ds.c106
-rw-r--r--protocols/Telegram/tgl/auto-static-print.c461
-rw-r--r--protocols/Telegram/tgl/auto-static-skip.c0
-rw-r--r--protocols/Telegram/tgl/auto-static-store-ds.c0
-rw-r--r--protocols/Telegram/tgl/auto-static-store.c262
-rw-r--r--protocols/Telegram/tgl/auto-static.c328
-rw-r--r--protocols/Telegram/tgl/auto.h62
-rw-r--r--protocols/Telegram/tgl/auto/auto-autocomplete.c29968
-rw-r--r--protocols/Telegram/tgl/auto/auto-autocomplete.h865
-rw-r--r--protocols/Telegram/tgl/auto/auto-fetch-ds.c11877
-rw-r--r--protocols/Telegram/tgl/auto/auto-fetch-ds.h716
-rw-r--r--protocols/Telegram/tgl/auto/auto-fetch.c16330
-rw-r--r--protocols/Telegram/tgl/auto/auto-fetch.h717
-rw-r--r--protocols/Telegram/tgl/auto/auto-free-ds.c9116
-rw-r--r--protocols/Telegram/tgl/auto/auto-free-ds.h569
-rw-r--r--protocols/Telegram/tgl/auto/auto-print-ds.c16382
-rw-r--r--protocols/Telegram/tgl/auto/auto-print-ds.h719
-rw-r--r--protocols/Telegram/tgl/auto/auto-skip.c11302
-rw-r--r--protocols/Telegram/tgl/auto/auto-skip.h714
-rw-r--r--protocols/Telegram/tgl/auto/auto-store-ds.c10208
-rw-r--r--protocols/Telegram/tgl/auto/auto-store-ds.h718
-rw-r--r--protocols/Telegram/tgl/auto/auto-store.c24400
-rw-r--r--protocols/Telegram/tgl/auto/auto-store.h848
-rw-r--r--protocols/Telegram/tgl/auto/auto-types.c1793
-rw-r--r--protocols/Telegram/tgl/auto/auto-types.h1589
-rw-r--r--protocols/Telegram/tgl/auto/constants.h561
-rw-r--r--protocols/Telegram/tgl/auto/scheme.tl829
-rw-r--r--protocols/Telegram/tgl/auto/scheme.tlobin0 -> 85572 bytes
-rw-r--r--protocols/Telegram/tgl/auto/scheme2.tl540
-rw-r--r--protocols/Telegram/tgl/binlog.c1829
-rw-r--r--protocols/Telegram/tgl/binlog.tl102
-rw-r--r--protocols/Telegram/tgl/config.h163
-rw-r--r--protocols/Telegram/tgl/config.h.in163
-rw-r--r--protocols/Telegram/tgl/configure5669
-rw-r--r--protocols/Telegram/tgl/configure.ac79
-rw-r--r--protocols/Telegram/tgl/contrib/vs/config.bat524
-rw-r--r--protocols/Telegram/tgl/contrib/vs/generate.vcxproj188
-rw-r--r--protocols/Telegram/tgl/contrib/vs/generate.vcxproj.filters39
-rw-r--r--protocols/Telegram/tgl/contrib/vs/tgl.sln52
-rw-r--r--protocols/Telegram/tgl/contrib/vs/tgl.vcxproj251
-rw-r--r--protocols/Telegram/tgl/contrib/vs/tgl.vcxproj.filters153
-rw-r--r--protocols/Telegram/tgl/contrib/vs/tgl.vcxproj.user4
-rw-r--r--protocols/Telegram/tgl/contrib/vs/wingetopt.c82
-rw-r--r--protocols/Telegram/tgl/contrib/vs/wingetopt.h32
-rw-r--r--protocols/Telegram/tgl/encrypted_scheme.tl1
-rw-r--r--protocols/Telegram/tgl/encrypted_scheme16.tl22
-rw-r--r--protocols/Telegram/tgl/encrypted_scheme17.tl31
-rw-r--r--protocols/Telegram/tgl/encrypted_scheme18.tl38
-rw-r--r--protocols/Telegram/tgl/encrypted_scheme23.tl29
-rw-r--r--protocols/Telegram/tgl/errors11
-rw-r--r--protocols/Telegram/tgl/event-old.h48
-rw-r--r--protocols/Telegram/tgl/gen_constants_h.awk37
-rw-r--r--protocols/Telegram/tgl/generate.c3218
-rw-r--r--protocols/Telegram/tgl/generate.h173
-rw-r--r--protocols/Telegram/tgl/libevent/.gitignore135
-rw-r--r--protocols/Telegram/tgl/libevent/.travis.yml21
-rw-r--r--protocols/Telegram/tgl/libevent/CMakeLists.txt1428
-rw-r--r--protocols/Telegram/tgl/libevent/ChangeLog1402
-rw-r--r--protocols/Telegram/tgl/libevent/ChangeLog-1.4231
-rw-r--r--protocols/Telegram/tgl/libevent/ChangeLog-2.01280
-rw-r--r--protocols/Telegram/tgl/libevent/Doxyfile257
-rw-r--r--protocols/Telegram/tgl/libevent/LICENSE99
-rw-r--r--protocols/Telegram/tgl/libevent/Makefile.am303
-rw-r--r--protocols/Telegram/tgl/libevent/Makefile.nmake82
-rw-r--r--protocols/Telegram/tgl/libevent/README.md397
-rw-r--r--protocols/Telegram/tgl/libevent/WIN32-Code/getopt.c149
-rw-r--r--protocols/Telegram/tgl/libevent/WIN32-Code/getopt.h33
-rw-r--r--protocols/Telegram/tgl/libevent/WIN32-Code/getopt_long.c233
-rw-r--r--protocols/Telegram/tgl/libevent/WIN32-Code/nmake/evconfig-private.h6
-rw-r--r--protocols/Telegram/tgl/libevent/WIN32-Code/nmake/event2/event-config.h360
-rw-r--r--protocols/Telegram/tgl/libevent/WIN32-Code/tree.h677
-rw-r--r--protocols/Telegram/tgl/libevent/appveyor.yml45
-rw-r--r--protocols/Telegram/tgl/libevent/arc4random.c556
-rw-r--r--protocols/Telegram/tgl/libevent/autogen.sh15
-rw-r--r--protocols/Telegram/tgl/libevent/buffer.c3439
-rw-r--r--protocols/Telegram/tgl/libevent/buffer.objbin0 -> 60982 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/buffer_iocp.c326
-rw-r--r--protocols/Telegram/tgl/libevent/buffer_iocp.objbin0 -> 9403 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/bufferevent-internal.h480
-rw-r--r--protocols/Telegram/tgl/libevent/bufferevent.c1016
-rw-r--r--protocols/Telegram/tgl/libevent/bufferevent.objbin0 -> 15234 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/bufferevent_async.c686
-rw-r--r--protocols/Telegram/tgl/libevent/bufferevent_async.objbin0 -> 15266 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/bufferevent_filter.c555
-rw-r--r--protocols/Telegram/tgl/libevent/bufferevent_filter.objbin0 -> 11273 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/bufferevent_openssl.c1484
-rw-r--r--protocols/Telegram/tgl/libevent/bufferevent_pair.c360
-rw-r--r--protocols/Telegram/tgl/libevent/bufferevent_pair.objbin0 -> 6819 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/bufferevent_ratelim.c1092
-rw-r--r--protocols/Telegram/tgl/libevent/bufferevent_ratelim.objbin0 -> 17746 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/bufferevent_sock.c707
-rw-r--r--protocols/Telegram/tgl/libevent/bufferevent_sock.objbin0 -> 12301 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/changelist-internal.h102
-rw-r--r--protocols/Telegram/tgl/libevent/cmake/AddCompilerFlags.cmake15
-rw-r--r--protocols/Telegram/tgl/libevent/cmake/COPYING-CMAKE-SCRIPTS22
-rw-r--r--protocols/Telegram/tgl/libevent/cmake/CheckFileOffsetBits.c14
-rw-r--r--protocols/Telegram/tgl/libevent/cmake/CheckFileOffsetBits.cmake43
-rw-r--r--protocols/Telegram/tgl/libevent/cmake/CheckFunctionExistsEx.c30
-rw-r--r--protocols/Telegram/tgl/libevent/cmake/CheckFunctionExistsEx.cmake69
-rw-r--r--protocols/Telegram/tgl/libevent/cmake/CheckFunctionKeywords.cmake14
-rw-r--r--protocols/Telegram/tgl/libevent/cmake/CheckPrototypeDefinition.c.in29
-rw-r--r--protocols/Telegram/tgl/libevent/cmake/CheckPrototypeDefinition.cmake84
-rw-r--r--protocols/Telegram/tgl/libevent/cmake/CheckWorkingKqueue.cmake52
-rw-r--r--protocols/Telegram/tgl/libevent/cmake/CodeCoverage.cmake162
-rw-r--r--protocols/Telegram/tgl/libevent/cmake/Copyright.txt57
-rw-r--r--protocols/Telegram/tgl/libevent/cmake/FindGit.cmake45
-rw-r--r--protocols/Telegram/tgl/libevent/cmake/LibeventConfig.cmake.in17
-rw-r--r--protocols/Telegram/tgl/libevent/cmake/LibeventConfigBuildTree.cmake.in17
-rw-r--r--protocols/Telegram/tgl/libevent/cmake/LibeventConfigVersion.cmake.in11
-rw-r--r--protocols/Telegram/tgl/libevent/cmake/VersionViaGit.cmake53
-rw-r--r--protocols/Telegram/tgl/libevent/compat/sys/queue.h488
-rw-r--r--protocols/Telegram/tgl/libevent/configure.ac919
-rw-r--r--protocols/Telegram/tgl/libevent/defer-internal.h70
-rw-r--r--protocols/Telegram/tgl/libevent/devpoll.c311
-rw-r--r--protocols/Telegram/tgl/libevent/epoll.c540
-rw-r--r--protocols/Telegram/tgl/libevent/epoll_sub.c66
-rw-r--r--protocols/Telegram/tgl/libevent/epolltable-internal.h1166
-rw-r--r--protocols/Telegram/tgl/libevent/evbuffer-internal.h351
-rw-r--r--protocols/Telegram/tgl/libevent/evconfig-private.h.cmake35
-rw-r--r--protocols/Telegram/tgl/libevent/evconfig-private.h.in48
-rw-r--r--protocols/Telegram/tgl/libevent/evdns.3322
-rw-r--r--protocols/Telegram/tgl/libevent/evdns.c4761
-rw-r--r--protocols/Telegram/tgl/libevent/evdns.objbin0 -> 114563 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/event-config.h.cmake534
-rw-r--r--protocols/Telegram/tgl/libevent/event-internal.h479
-rw-r--r--protocols/Telegram/tgl/libevent/event.3624
-rw-r--r--protocols/Telegram/tgl/libevent/event.c3940
-rw-r--r--protocols/Telegram/tgl/libevent/event.objbin0 -> 99401 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/event_iocp.c294
-rw-r--r--protocols/Telegram/tgl/libevent/event_iocp.objbin0 -> 4531 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/event_rpcgen.py1728
-rw-r--r--protocols/Telegram/tgl/libevent/event_tagging.c605
-rw-r--r--protocols/Telegram/tgl/libevent/event_tagging.objbin0 -> 7415 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/evmap-internal.h117
-rw-r--r--protocols/Telegram/tgl/libevent/evmap.c1055
-rw-r--r--protocols/Telegram/tgl/libevent/evmap.objbin0 -> 29315 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/evport.c451
-rw-r--r--protocols/Telegram/tgl/libevent/evrpc-internal.h205
-rw-r--r--protocols/Telegram/tgl/libevent/evrpc.c1171
-rw-r--r--protocols/Telegram/tgl/libevent/evrpc.objbin0 -> 26303 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/evsignal-internal.h65
-rw-r--r--protocols/Telegram/tgl/libevent/evthread-internal.h392
-rw-r--r--protocols/Telegram/tgl/libevent/evthread.c509
-rw-r--r--protocols/Telegram/tgl/libevent/evthread.objbin0 -> 18993 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/evthread_pthread.c191
-rw-r--r--protocols/Telegram/tgl/libevent/evthread_win32.c341
-rw-r--r--protocols/Telegram/tgl/libevent/evthread_win32.objbin0 -> 3376 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/evutil.c2667
-rw-r--r--protocols/Telegram/tgl/libevent/evutil.objbin0 -> 35911 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/evutil_rand.c206
-rw-r--r--protocols/Telegram/tgl/libevent/evutil_rand.objbin0 -> 5206 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/evutil_time.c538
-rw-r--r--protocols/Telegram/tgl/libevent/evutil_time.objbin0 -> 3882 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/ht-internal.h487
-rw-r--r--protocols/Telegram/tgl/libevent/http-internal.h200
-rw-r--r--protocols/Telegram/tgl/libevent/http.c4892
-rw-r--r--protocols/Telegram/tgl/libevent/http.objbin0 -> 79042 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/include/evdns.h45
-rw-r--r--protocols/Telegram/tgl/libevent/include/event.h83
-rw-r--r--protocols/Telegram/tgl/libevent/include/event2/buffer.h1076
-rw-r--r--protocols/Telegram/tgl/libevent/include/event2/buffer_compat.h115
-rw-r--r--protocols/Telegram/tgl/libevent/include/event2/bufferevent.h1021
-rw-r--r--protocols/Telegram/tgl/libevent/include/event2/bufferevent_compat.h100
-rw-r--r--protocols/Telegram/tgl/libevent/include/event2/bufferevent_ssl.h134
-rw-r--r--protocols/Telegram/tgl/libevent/include/event2/bufferevent_struct.h116
-rw-r--r--protocols/Telegram/tgl/libevent/include/event2/dns.h717
-rw-r--r--protocols/Telegram/tgl/libevent/include/event2/dns_compat.h336
-rw-r--r--protocols/Telegram/tgl/libevent/include/event2/dns_struct.h80
-rw-r--r--protocols/Telegram/tgl/libevent/include/event2/event.h1675
-rw-r--r--protocols/Telegram/tgl/libevent/include/event2/event_compat.h230
-rw-r--r--protocols/Telegram/tgl/libevent/include/event2/event_struct.h180
-rw-r--r--protocols/Telegram/tgl/libevent/include/event2/http.h1170
-rw-r--r--protocols/Telegram/tgl/libevent/include/event2/http_compat.h90
-rw-r--r--protocols/Telegram/tgl/libevent/include/event2/http_struct.h152
-rw-r--r--protocols/Telegram/tgl/libevent/include/event2/keyvalq_struct.h80
-rw-r--r--protocols/Telegram/tgl/libevent/include/event2/listener.h180
-rw-r--r--protocols/Telegram/tgl/libevent/include/event2/rpc.h596
-rw-r--r--protocols/Telegram/tgl/libevent/include/event2/rpc_compat.h61
-rw-r--r--protocols/Telegram/tgl/libevent/include/event2/rpc_struct.h100
-rw-r--r--protocols/Telegram/tgl/libevent/include/event2/tag.h146
-rw-r--r--protocols/Telegram/tgl/libevent/include/event2/tag_compat.h49
-rw-r--r--protocols/Telegram/tgl/libevent/include/event2/thread.h253
-rw-r--r--protocols/Telegram/tgl/libevent/include/event2/util.h852
-rw-r--r--protocols/Telegram/tgl/libevent/include/event2/visibility.h50
-rw-r--r--protocols/Telegram/tgl/libevent/include/evhttp.h45
-rw-r--r--protocols/Telegram/tgl/libevent/include/evrpc.h45
-rw-r--r--protocols/Telegram/tgl/libevent/include/evutil.h39
-rw-r--r--protocols/Telegram/tgl/libevent/include/include.am46
-rw-r--r--protocols/Telegram/tgl/libevent/iocp-internal.h201
-rw-r--r--protocols/Telegram/tgl/libevent/ipv6-internal.h83
-rw-r--r--protocols/Telegram/tgl/libevent/kqueue-internal.h39
-rw-r--r--protocols/Telegram/tgl/libevent/kqueue.c567
-rw-r--r--protocols/Telegram/tgl/libevent/libevent.libbin0 -> 652848 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/libevent.pc.in16
-rw-r--r--protocols/Telegram/tgl/libevent/libevent_core.libbin0 -> 412906 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/libevent_extras.libbin0 -> 240764 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/libevent_openssl.pc.in16
-rw-r--r--protocols/Telegram/tgl/libevent/libevent_pthreads.pc.in16
-rw-r--r--protocols/Telegram/tgl/libevent/listener.c889
-rw-r--r--protocols/Telegram/tgl/libevent/listener.objbin0 -> 12967 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/log-internal.h83
-rw-r--r--protocols/Telegram/tgl/libevent/log.c253
-rw-r--r--protocols/Telegram/tgl/libevent/log.objbin0 -> 6459 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/m4/ac_backport_259_ssizet.m43
-rw-r--r--protocols/Telegram/tgl/libevent/m4/acx_pthread.m4279
-rw-r--r--protocols/Telegram/tgl/libevent/m4/libevent_openssl.m447
-rw-r--r--protocols/Telegram/tgl/libevent/m4/ntp_pkg_config.m427
-rw-r--r--protocols/Telegram/tgl/libevent/make-event-config.sed23
-rw-r--r--protocols/Telegram/tgl/libevent/make_epoll_table.py63
-rw-r--r--protocols/Telegram/tgl/libevent/minheap-internal.h188
-rw-r--r--protocols/Telegram/tgl/libevent/mm-internal.h87
-rw-r--r--protocols/Telegram/tgl/libevent/poll.c341
-rw-r--r--protocols/Telegram/tgl/libevent/ratelim-internal.h105
-rw-r--r--protocols/Telegram/tgl/libevent/sample/dns-example.c257
-rw-r--r--protocols/Telegram/tgl/libevent/sample/event-read-fifo.c162
-rw-r--r--protocols/Telegram/tgl/libevent/sample/hello-world.c141
-rw-r--r--protocols/Telegram/tgl/libevent/sample/hostcheck.c217
-rw-r--r--protocols/Telegram/tgl/libevent/sample/hostcheck.h30
-rw-r--r--protocols/Telegram/tgl/libevent/sample/http-connect.c119
-rw-r--r--protocols/Telegram/tgl/libevent/sample/http-server.c418
-rw-r--r--protocols/Telegram/tgl/libevent/sample/https-client.c494
-rw-r--r--protocols/Telegram/tgl/libevent/sample/include.am53
-rw-r--r--protocols/Telegram/tgl/libevent/sample/le-proxy.c288
-rw-r--r--protocols/Telegram/tgl/libevent/sample/openssl_hostname_validation.c173
-rw-r--r--protocols/Telegram/tgl/libevent/sample/openssl_hostname_validation.h56
-rw-r--r--protocols/Telegram/tgl/libevent/sample/signal-test.c75
-rw-r--r--protocols/Telegram/tgl/libevent/sample/time-test.c107
-rw-r--r--protocols/Telegram/tgl/libevent/select.c346
-rw-r--r--protocols/Telegram/tgl/libevent/signal.c479
-rw-r--r--protocols/Telegram/tgl/libevent/signal.objbin0 -> 9157 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/strlcpy-internal.h22
-rw-r--r--protocols/Telegram/tgl/libevent/strlcpy.c75
-rw-r--r--protocols/Telegram/tgl/libevent/strlcpy.objbin0 -> 677 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/Makefile.nmake79
-rw-r--r--protocols/Telegram/tgl/libevent/test/bench.c207
-rw-r--r--protocols/Telegram/tgl/libevent/test/bench_cascade.c188
-rw-r--r--protocols/Telegram/tgl/libevent/test/bench_http.c195
-rw-r--r--protocols/Telegram/tgl/libevent/test/bench_httpclient.c239
-rw-r--r--protocols/Telegram/tgl/libevent/test/check-dumpevents.py54
-rw-r--r--protocols/Telegram/tgl/libevent/test/include.am146
-rw-r--r--protocols/Telegram/tgl/libevent/test/print-winsock-errors.c84
-rw-r--r--protocols/Telegram/tgl/libevent/test/print-winsock-errors.exebin0 -> 250368 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/print-winsock-errors.objbin0 -> 6289 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress.c3401
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress.exebin0 -> 1094144 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress.gen.c1
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress.gen.h1
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress.gen.objbin0 -> 411 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress.h144
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress.objbin0 -> 163578 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress.rpc25
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_buffer.c2281
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_buffer.objbin0 -> 321947 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_bufferevent.c1284
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_bufferevent.objbin0 -> 66403 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_dns.c2151
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_dns.objbin0 -> 154118 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_et.c208
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_et.objbin0 -> 11988 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_finalize.c347
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_finalize.objbin0 -> 12620 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_http.c4335
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_http.objbin0 -> 458516 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_iocp.c352
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_iocp.objbin0 -> 34456 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_listener.c214
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_listener.objbin0 -> 13673 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_main.c468
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_main.objbin0 -> 9935 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_minheap.c99
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_minheap.objbin0 -> 7823 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_rpc.c905
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_rpc.objbin0 -> 1031 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_ssl.c781
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_testutils.c229
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_testutils.h67
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_testutils.objbin0 -> 9621 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_thread.c590
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_thread.h48
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_thread.objbin0 -> 20527 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_util.c1413
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_util.objbin0 -> 126463 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/regress_zlib.c348
-rw-r--r--protocols/Telegram/tgl/libevent/test/rpcgen_wrapper.sh52
-rw-r--r--protocols/Telegram/tgl/libevent/test/test-changelist.c224
-rw-r--r--protocols/Telegram/tgl/libevent/test/test-changelist.exebin0 -> 248320 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/test-changelist.objbin0 -> 4723 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/test-closed.c117
-rw-r--r--protocols/Telegram/tgl/libevent/test/test-closed.exebin0 -> 247808 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/test-closed.objbin0 -> 3077 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/test-dumpevents.c179
-rw-r--r--protocols/Telegram/tgl/libevent/test/test-eof.c124
-rw-r--r--protocols/Telegram/tgl/libevent/test/test-eof.exebin0 -> 247808 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/test-eof.objbin0 -> 3282 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/test-fdleak.c249
-rw-r--r--protocols/Telegram/tgl/libevent/test/test-init.c65
-rw-r--r--protocols/Telegram/tgl/libevent/test/test-init.exebin0 -> 247296 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/test-init.objbin0 -> 906 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/test-ratelim.c601
-rw-r--r--protocols/Telegram/tgl/libevent/test/test-ratelim.sh88
-rw-r--r--protocols/Telegram/tgl/libevent/test/test-time.c116
-rw-r--r--protocols/Telegram/tgl/libevent/test/test-time.exebin0 -> 247808 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/test-time.objbin0 -> 3031 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/test-weof.c117
-rw-r--r--protocols/Telegram/tgl/libevent/test/test-weof.exebin0 -> 247808 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/test-weof.objbin0 -> 2971 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/test.sh160
-rw-r--r--protocols/Telegram/tgl/libevent/test/tinytest.c493
-rw-r--r--protocols/Telegram/tgl/libevent/test/tinytest.h100
-rw-r--r--protocols/Telegram/tgl/libevent/test/tinytest.objbin0 -> 10330 bytes
-rw-r--r--protocols/Telegram/tgl/libevent/test/tinytest_demo.c262
-rw-r--r--protocols/Telegram/tgl/libevent/test/tinytest_local.h12
-rw-r--r--protocols/Telegram/tgl/libevent/test/tinytest_macros.h199
-rw-r--r--protocols/Telegram/tgl/libevent/time-internal.h98
-rw-r--r--protocols/Telegram/tgl/libevent/util-internal.h479
-rw-r--r--protocols/Telegram/tgl/libevent/whatsnew-2.0.txt609
-rw-r--r--protocols/Telegram/tgl/libevent/whatsnew-2.1.txt690
-rw-r--r--protocols/Telegram/tgl/libevent/win32select.c388
-rw-r--r--protocols/Telegram/tgl/libevent/win32select.objbin0 -> 6923 bytes
-rw-r--r--protocols/Telegram/tgl/m4-ax_gcc_builtin.m4168
-rw-r--r--protocols/Telegram/tgl/m4_ax_check_openssl.m4124
-rw-r--r--protocols/Telegram/tgl/m4_ax_check_zlib.m4142
-rw-r--r--protocols/Telegram/tgl/mime-types.c4421
-rw-r--r--protocols/Telegram/tgl/mime.types1588
-rw-r--r--protocols/Telegram/tgl/mtproto-client.c1489
-rw-r--r--protocols/Telegram/tgl/mtproto-client.h61
-rw-r--r--protocols/Telegram/tgl/mtproto-common.c474
-rw-r--r--protocols/Telegram/tgl/mtproto-common.h385
-rw-r--r--protocols/Telegram/tgl/mtproto-utils.c178
-rw-r--r--protocols/Telegram/tgl/mtproto-utils.h7
-rw-r--r--protocols/Telegram/tgl/mtproto.tl19
-rw-r--r--protocols/Telegram/tgl/no-preview.h106
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/aes.h149
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/applink.c129
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/asn1.h1419
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/asn1_mac.h579
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/asn1t.h973
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/bio.h879
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/blowfish.h130
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/bn.h939
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/buffer.h119
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/camellia.h132
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/cast.h107
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/cmac.h82
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/cms.h555
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/comp.h79
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/conf.h267
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/conf_api.h89
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/crypto.h661
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/des.h257
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/des_old.h497
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/dh.h392
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/dsa.h332
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/dso.h451
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/dtls1.h272
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/e_os2.h328
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/ebcdic.h26
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/ec.h1282
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/ecdh.h134
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/ecdsa.h335
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/engine.h960
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/err.h389
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/evp.h1534
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/hmac.h109
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/idea.h105
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/krb5_asn.h240
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/kssl.h197
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/lhash.h240
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/md4.h119
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/md5.h119
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/mdc2.h94
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/modes.h163
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/obj_mac.h4194
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/objects.h1143
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/ocsp.h637
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/opensslconf.h259
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/opensslv.h97
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/ossl_typ.h211
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/pem.h615
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/pem2.h70
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/pkcs12.h342
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/pkcs7.h481
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/pqueue.h99
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/rand.h150
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/rc2.h103
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/rc4.h88
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/ripemd.h105
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/rsa.h664
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/safestack.h2672
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/seed.h149
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/sha.h214
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/srp.h169
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/srtp.h147
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/ssl.h3164
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/ssl2.h265
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/ssl23.h84
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/ssl3.h774
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/stack.h107
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/symhacks.h516
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/tls1.h813
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/ts.h862
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/txt_db.h112
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/ui.h415
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/ui_compat.h88
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/whrlpool.h41
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/x509.h1327
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/x509_vfy.h647
-rw-r--r--protocols/Telegram/tgl/openssl/include/openssl/x509v3.h1055
-rw-r--r--protocols/Telegram/tgl/openssl/lib/libeay32.libbin0 -> 12307866 bytes
-rw-r--r--protocols/Telegram/tgl/openssl/lib/ssleay32.libbin0 -> 2223722 bytes
-rw-r--r--protocols/Telegram/tgl/queries-encrypted.c758
-rw-r--r--protocols/Telegram/tgl/queries.c4477
-rw-r--r--protocols/Telegram/tgl/queries.h84
-rw-r--r--protocols/Telegram/tgl/scheme.tl1
-rw-r--r--protocols/Telegram/tgl/scheme12.tl505
-rw-r--r--protocols/Telegram/tgl/scheme15.tl522
-rw-r--r--protocols/Telegram/tgl/scheme16.tl504
-rw-r--r--protocols/Telegram/tgl/scheme17.tl528
-rw-r--r--protocols/Telegram/tgl/scheme18.tl535
-rw-r--r--protocols/Telegram/tgl/scheme19.tl596
-rw-r--r--protocols/Telegram/tgl/scheme22.tl596
-rw-r--r--protocols/Telegram/tgl/scheme25.tl622
-rw-r--r--protocols/Telegram/tgl/scheme28.tl641
-rw-r--r--protocols/Telegram/tgl/scheme30.tl656
-rw-r--r--protocols/Telegram/tgl/scheme31.tl668
-rw-r--r--protocols/Telegram/tgl/structures.c2311
-rw-r--r--protocols/Telegram/tgl/tg-mime-types.c112
-rw-r--r--protocols/Telegram/tgl/tg-mime-types.h3
-rw-r--r--protocols/Telegram/tgl/tgl-binlog.h73
-rw-r--r--protocols/Telegram/tgl/tgl-fetch.h59
-rw-r--r--protocols/Telegram/tgl/tgl-inner.h33
-rw-r--r--protocols/Telegram/tgl/tgl-layout.h539
-rw-r--r--protocols/Telegram/tgl/tgl-methods-in.h50
-rw-r--r--protocols/Telegram/tgl/tgl-net-inner.h93
-rw-r--r--protocols/Telegram/tgl/tgl-net.c674
-rw-r--r--protocols/Telegram/tgl/tgl-net.h24
-rw-r--r--protocols/Telegram/tgl/tgl-structures.h69
-rw-r--r--protocols/Telegram/tgl/tgl-timers.c69
-rw-r--r--protocols/Telegram/tgl/tgl-timers.h27
-rw-r--r--protocols/Telegram/tgl/tgl.c149
-rw-r--r--protocols/Telegram/tgl/tgl.h659
-rw-r--r--protocols/Telegram/tgl/tl-parser/.gitignore12
-rw-r--r--protocols/Telegram/tgl/tl-parser/LICENSE339
-rw-r--r--protocols/Telegram/tgl/tl-parser/Makefile.in48
-rw-r--r--protocols/Telegram/tgl/tl-parser/README.md1
-rw-r--r--protocols/Telegram/tgl/tl-parser/config.h.in96
-rw-r--r--protocols/Telegram/tgl/tl-parser/configure5018
-rw-r--r--protocols/Telegram/tgl/tl-parser/configure.ac33
-rw-r--r--protocols/Telegram/tgl/tl-parser/contrib/vs/config.bat107
-rw-r--r--protocols/Telegram/tgl/tl-parser/contrib/vs/tl-parser.sln28
-rw-r--r--protocols/Telegram/tgl/tl-parser/contrib/vs/tl-parser.vcxproj198
-rw-r--r--protocols/Telegram/tgl/tl-parser/contrib/vs/tl-parser.vcxproj.filters48
-rw-r--r--protocols/Telegram/tgl/tl-parser/contrib/vs/wingetopt.c82
-rw-r--r--protocols/Telegram/tgl/tl-parser/contrib/vs/wingetopt.h32
-rw-r--r--protocols/Telegram/tgl/tl-parser/m4-ax_gcc_builtin.m4168
-rw-r--r--protocols/Telegram/tgl/tl-parser/portable_endian.h124
-rw-r--r--protocols/Telegram/tgl/tl-parser/tl-parser-tree.h178
-rw-r--r--protocols/Telegram/tgl/tl-parser/tl-parser.c3111
-rw-r--r--protocols/Telegram/tgl/tl-parser/tl-parser.h221
-rw-r--r--protocols/Telegram/tgl/tl-parser/tl-tl.h55
-rw-r--r--protocols/Telegram/tgl/tl-parser/tlc.c179
-rw-r--r--protocols/Telegram/tgl/tools.c406
-rw-r--r--protocols/Telegram/tgl/tools.h123
-rw-r--r--protocols/Telegram/tgl/tree.h179
-rw-r--r--protocols/Telegram/tgl/updates.c668
-rw-r--r--protocols/Telegram/tgl/updates.h34
-rw-r--r--protocols/Telegram/tgl/zlib/CMakeLists.txt249
-rw-r--r--protocols/Telegram/tgl/zlib/ChangeLog1472
-rw-r--r--protocols/Telegram/tgl/zlib/FAQ368
-rw-r--r--protocols/Telegram/tgl/zlib/INDEX68
-rw-r--r--protocols/Telegram/tgl/zlib/Makefile5
-rw-r--r--protocols/Telegram/tgl/zlib/Makefile.in288
-rw-r--r--protocols/Telegram/tgl/zlib/README115
-rw-r--r--protocols/Telegram/tgl/zlib/adler32.c179
-rw-r--r--protocols/Telegram/tgl/zlib/amiga/Makefile.pup69
-rw-r--r--protocols/Telegram/tgl/zlib/amiga/Makefile.sas68
-rw-r--r--protocols/Telegram/tgl/zlib/as400/bndsrc215
-rw-r--r--protocols/Telegram/tgl/zlib/as400/compile.clp110
-rw-r--r--protocols/Telegram/tgl/zlib/as400/readme.txt115
-rw-r--r--protocols/Telegram/tgl/zlib/as400/zlib.inc451
-rw-r--r--protocols/Telegram/tgl/zlib/compress.c80
-rw-r--r--protocols/Telegram/tgl/zlib/configure831
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/README.contrib78
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/ada/buffer_demo.adb106
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/ada/mtest.adb156
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/ada/read.adb156
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/ada/readme.txt65
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/ada/test.adb463
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/ada/zlib-streams.adb225
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/ada/zlib-streams.ads114
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/ada/zlib-thin.adb141
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/ada/zlib-thin.ads450
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/ada/zlib.adb701
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/ada/zlib.ads328
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/ada/zlib.gpr20
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/amd64/amd64-match.S452
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/asm686/README.68651
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/asm686/match.S357
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/blast/Makefile8
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/blast/README4
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/blast/blast.c446
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/blast/blast.h75
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/blast/test.pkbin0 -> 8 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/blast/test.txt1
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/delphi/ZLib.pas557
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/delphi/ZLibConst.pas11
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/delphi/readme.txt76
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/delphi/zlibd32.mak99
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib.build33
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib.chmbin0 -> 72726 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib.sln21
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/AssemblyInfo.cs58
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs202
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/CircularBuffer.cs83
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/CodecBase.cs198
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/Deflater.cs106
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/DotZLib.cs288
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/DotZLib.csproj141
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/GZipStream.cs301
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/Inflater.cs105
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/UnitTests.cs274
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/dotzlib/LICENSE_1_0.txt23
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/dotzlib/readme.txt58
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/gcc_gvmat64/gvmat64.S574
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/infback9/README1
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/infback9/infback9.c615
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/infback9/infback9.h37
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/infback9/inffix9.h107
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/infback9/inflate9.h47
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/infback9/inftree9.c324
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/infback9/inftree9.h61
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/inflate86/inffas86.c1157
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/inflate86/inffast.S1368
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/iostream/test.cpp24
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/iostream/zfstream.cpp329
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/iostream/zfstream.h128
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/iostream2/zstream.h307
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/iostream2/zstream_test.cpp25
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/iostream3/README35
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/iostream3/TODO17
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/iostream3/test.cc50
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/iostream3/zfstream.cc479
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/iostream3/zfstream.h466
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/masmx64/bld_ml64.bat2
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/masmx64/gvmat64.asm553
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/masmx64/inffas8664.c186
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/masmx64/inffasx64.asm396
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/masmx64/readme.txt31
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/masmx86/bld_ml32.bat2
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/masmx86/inffas32.asm1080
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/masmx86/match686.asm479
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/masmx86/readme.txt27
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/minizip/Makefile25
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/minizip/Makefile.am45
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/minizip/MiniZip64_Changes.txt6
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/minizip/MiniZip64_info.txt74
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/minizip/configure.ac32
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/minizip/crypt.h131
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/minizip/ioapi.c247
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/minizip/ioapi.h208
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/minizip/iowin32.c461
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/minizip/iowin32.h28
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/minizip/make_vms.com25
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/minizip/miniunz.c660
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/minizip/miniunzip.163
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/minizip/minizip.146
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/minizip/minizip.c520
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/minizip/minizip.pc.in12
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/minizip/mztools.c291
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/minizip/mztools.h37
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/minizip/unzip.c2125
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/minizip/unzip.h437
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/minizip/zip.c2007
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/minizip/zip.h362
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/pascal/example.pas599
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/pascal/readme.txt76
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/pascal/zlibd32.mak99
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/pascal/zlibpas.pas276
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/puff/Makefile42
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/puff/README63
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/puff/puff.c840
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/puff/puff.h35
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/puff/pufftest.c165
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/puff/zeros.rawbin0 -> 2517 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/testzlib/testzlib.c275
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/testzlib/testzlib.txt10
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/untgz/Makefile14
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/untgz/Makefile.msc17
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/untgz/untgz.c674
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/readme.txt65
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/miniunz.vcxproj310
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/miniunz.vcxproj.filters22
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/minizip.vcxproj307
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/minizip.vcxproj.filters22
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/testzlib.vcxproj420
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/testzlib.vcxproj.filters58
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj310
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj.filters22
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/zlib.rc32
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/zlibstat.vcxproj473
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/zlibstat.vcxproj.filters77
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/zlibvc.def143
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/zlibvc.sln135
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/zlibvc.vcxproj657
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/zlibvc.vcxproj.filters118
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/miniunz.vcxproj314
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/minizip.vcxproj311
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/testzlib.vcxproj426
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/testzlibdll.vcxproj314
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/adler32.cod610
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/adler32.objbin0 -> 49576 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/compress.cod214
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/compress.objbin0 -> 46353 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/crc32.cod3150
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/crc32.objbin0 -> 73072 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/deflate.cod6858
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/deflate.objbin0 -> 112701 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzclose.cod87
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzclose.objbin0 -> 113708 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzlib.cod2360
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzlib.objbin0 -> 129376 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzread.cod2216
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzread.objbin0 -> 131934 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzwrite.cod1895
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzwrite.objbin0 -> 128898 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/infback.cod4354
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/infback.objbin0 -> 78037 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/inffast.cod990
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/inffast.objbin0 -> 52409 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/inflate.cod7621
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/inflate.objbin0 -> 108025 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/inftrees.cod1069
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/inftrees.objbin0 -> 51845 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/ioapi.cod882
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/ioapi.objbin0 -> 123214 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/iowin32.cod1691
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/iowin32.objbin0 -> 136327 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/trees.cod5535
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/trees.objbin0 -> 95561 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/uncompr.cod159
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/uncompr.objbin0 -> 45830 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/unzip.cod7065
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/unzip.objbin0 -> 172491 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zip.cod7727
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zip.objbin0 -> 187557 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlib.resbin0 -> 884 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.log25
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/CL.command.1.tlogbin0 -> 19578 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/CL.read.1.tlogbin0 -> 400204 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/CL.write.1.tlogbin0 -> 12154 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/link.command.1.tlogbin0 -> 6952 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/link.read.1.tlogbin0 -> 14136 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/link.write.1.tlogbin0 -> 9290 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/rc.command.1.tlogbin0 -> 440 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/rc.read.1.tlogbin0 -> 2260 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/rc.write.1.tlogbin0 -> 352 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/zlibvc.lastbuildstate2
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/zlibvc.write.1u.tlogbin0 -> 574 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibwapi.Build.CppClean.log31
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zutil.cod259
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zutil.objbin0 -> 123610 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/vc140.pdbbin0 -> 135168 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.dllbin0 -> 94720 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.expbin0 -> 15693 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.iobjbin0 -> 500595 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.ipdbbin0 -> 87216 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.libbin0 -> 26702 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.map861
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.pdbbin0 -> 724992 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/adler32.objbin0 -> 17467 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/compress.objbin0 -> 15252 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/crc32.objbin0 -> 29628 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/deflate.objbin0 -> 59709 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/gzclose.objbin0 -> 13200 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/gzlib.objbin0 -> 34037 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/gzread.objbin0 -> 30696 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/gzwrite.objbin0 -> 30280 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/infback.objbin0 -> 32631 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/inffast.objbin0 -> 18811 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/inflate.objbin0 -> 56907 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/inftrees.objbin0 -> 18722 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/ioapi.objbin0 -> 27602 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/trees.objbin0 -> 52297 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/uncompr.objbin0 -> 13796 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/unzip.objbin0 -> 80632 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zip.objbin0 -> 95280 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlib.resbin0 -> 884 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.Build.CppClean.log30
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.log20
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/CL.command.1.tlogbin0 -> 16478 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/CL.read.1.tlogbin0 -> 379024 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/CL.write.1.tlogbin0 -> 11658 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/Lib-link-cvtres.read.1.tlogbin0 -> 8266 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/Lib-link-cvtres.write.1.tlogbin0 -> 4246 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/lib.command.1.tlogbin0 -> 5884 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/rc.command.1.tlogbin0 -> 422 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/rc.read.1.tlogbin0 -> 2260 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/rc.write.1.tlogbin0 -> 354 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/zlibstat.lastbuildstate2
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zutil.objbin0 -> 16816 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/zlibstat.libbin0 -> 658516 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/zlibstat.pdbbin0 -> 126976 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/zlib.rc32
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/zlibstat.vcxproj465
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/zlibvc.def143
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/zlibvc.sln117
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/zlibvc.vcxproj689
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/miniunz.vcproj565
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/minizip.vcproj562
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/testzlib.vcproj852
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/testzlibdll.vcproj565
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/zlib.rc32
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/zlibstat.vcproj835
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/zlibvc.def143
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/zlibvc.sln144
-rw-r--r--protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/zlibvc.vcproj1156
-rw-r--r--protocols/Telegram/tgl/zlib/crc32.c425
-rw-r--r--protocols/Telegram/tgl/zlib/crc32.h441
-rw-r--r--protocols/Telegram/tgl/zlib/deflate.c1967
-rw-r--r--protocols/Telegram/tgl/zlib/deflate.h346
-rw-r--r--protocols/Telegram/tgl/zlib/doc/algorithm.txt209
-rw-r--r--protocols/Telegram/tgl/zlib/doc/rfc1950.txt619
-rw-r--r--protocols/Telegram/tgl/zlib/doc/rfc1951.txt955
-rw-r--r--protocols/Telegram/tgl/zlib/doc/rfc1952.txt675
-rw-r--r--protocols/Telegram/tgl/zlib/doc/txtvsbin.txt107
-rw-r--r--protocols/Telegram/tgl/zlib/examples/README.examples49
-rw-r--r--protocols/Telegram/tgl/zlib/examples/enough.c572
-rw-r--r--protocols/Telegram/tgl/zlib/examples/fitblk.c233
-rw-r--r--protocols/Telegram/tgl/zlib/examples/gun.c702
-rw-r--r--protocols/Telegram/tgl/zlib/examples/gzappend.c504
-rw-r--r--protocols/Telegram/tgl/zlib/examples/gzjoin.c449
-rw-r--r--protocols/Telegram/tgl/zlib/examples/gzlog.c1059
-rw-r--r--protocols/Telegram/tgl/zlib/examples/gzlog.h91
-rw-r--r--protocols/Telegram/tgl/zlib/examples/zlib_how.html545
-rw-r--r--protocols/Telegram/tgl/zlib/examples/zpipe.c205
-rw-r--r--protocols/Telegram/tgl/zlib/examples/zran.c409
-rw-r--r--protocols/Telegram/tgl/zlib/gzclose.c25
-rw-r--r--protocols/Telegram/tgl/zlib/gzguts.h209
-rw-r--r--protocols/Telegram/tgl/zlib/gzlib.c634
-rw-r--r--protocols/Telegram/tgl/zlib/gzread.c594
-rw-r--r--protocols/Telegram/tgl/zlib/gzwrite.c577
-rw-r--r--protocols/Telegram/tgl/zlib/infback.c640
-rw-r--r--protocols/Telegram/tgl/zlib/inffast.c340
-rw-r--r--protocols/Telegram/tgl/zlib/inffast.h11
-rw-r--r--protocols/Telegram/tgl/zlib/inffixed.h94
-rw-r--r--protocols/Telegram/tgl/zlib/inflate.c1512
-rw-r--r--protocols/Telegram/tgl/zlib/inflate.h122
-rw-r--r--protocols/Telegram/tgl/zlib/inftrees.c306
-rw-r--r--protocols/Telegram/tgl/zlib/inftrees.h62
-rw-r--r--protocols/Telegram/tgl/zlib/make_vms.com867
-rw-r--r--protocols/Telegram/tgl/zlib/msdos/Makefile.bor115
-rw-r--r--protocols/Telegram/tgl/zlib/msdos/Makefile.dj2104
-rw-r--r--protocols/Telegram/tgl/zlib/msdos/Makefile.emx69
-rw-r--r--protocols/Telegram/tgl/zlib/msdos/Makefile.msc112
-rw-r--r--protocols/Telegram/tgl/zlib/msdos/Makefile.tc100
-rw-r--r--protocols/Telegram/tgl/zlib/nintendods/Makefile126
-rw-r--r--protocols/Telegram/tgl/zlib/nintendods/README5
-rw-r--r--protocols/Telegram/tgl/zlib/old/Makefile.emx69
-rw-r--r--protocols/Telegram/tgl/zlib/old/Makefile.riscos151
-rw-r--r--protocols/Telegram/tgl/zlib/old/README3
-rw-r--r--protocols/Telegram/tgl/zlib/old/descrip.mms48
-rw-r--r--protocols/Telegram/tgl/zlib/old/os2/Makefile.os2136
-rw-r--r--protocols/Telegram/tgl/zlib/old/os2/zlib.def51
-rw-r--r--protocols/Telegram/tgl/zlib/old/visual-basic.txt160
-rw-r--r--protocols/Telegram/tgl/zlib/qnx/package.qpg141
-rw-r--r--protocols/Telegram/tgl/zlib/test/example.c601
-rw-r--r--protocols/Telegram/tgl/zlib/test/infcover.c671
-rw-r--r--protocols/Telegram/tgl/zlib/test/minigzip.c651
-rw-r--r--protocols/Telegram/tgl/zlib/treebuild.xml116
-rw-r--r--protocols/Telegram/tgl/zlib/trees.c1226
-rw-r--r--protocols/Telegram/tgl/zlib/trees.h128
-rw-r--r--protocols/Telegram/tgl/zlib/uncompr.c59
-rw-r--r--protocols/Telegram/tgl/zlib/watcom/watcom_f.mak43
-rw-r--r--protocols/Telegram/tgl/zlib/watcom/watcom_l.mak43
-rw-r--r--protocols/Telegram/tgl/zlib/win32/DLL_FAQ.txt397
-rw-r--r--protocols/Telegram/tgl/zlib/win32/Makefile.bor110
-rw-r--r--protocols/Telegram/tgl/zlib/win32/Makefile.gcc182
-rw-r--r--protocols/Telegram/tgl/zlib/win32/Makefile.msc163
-rw-r--r--protocols/Telegram/tgl/zlib/win32/README-WIN32.txt103
-rw-r--r--protocols/Telegram/tgl/zlib/win32/VisualC.txt3
-rw-r--r--protocols/Telegram/tgl/zlib/win32/zlib.def86
-rw-r--r--protocols/Telegram/tgl/zlib/win32/zlib1.rc40
-rw-r--r--protocols/Telegram/tgl/zlib/zconf.h511
-rw-r--r--protocols/Telegram/tgl/zlib/zconf.h.cmakein513
-rw-r--r--protocols/Telegram/tgl/zlib/zconf.h.in511
-rw-r--r--protocols/Telegram/tgl/zlib/zlib.3151
-rw-r--r--protocols/Telegram/tgl/zlib/zlib.3.pdfbin0 -> 8734 bytes
-rw-r--r--protocols/Telegram/tgl/zlib/zlib.h1768
-rw-r--r--protocols/Telegram/tgl/zlib/zlib.map83
-rw-r--r--protocols/Telegram/tgl/zlib/zlib.pc.cmakein13
-rw-r--r--protocols/Telegram/tgl/zlib/zlib.pc.in13
-rw-r--r--protocols/Telegram/tgl/zlib/zlib2ansi152
-rw-r--r--protocols/Telegram/tgl/zlib/zutil.c324
-rw-r--r--protocols/Telegram/tgl/zlib/zutil.h253
803 files changed, 448963 insertions, 0 deletions
diff --git a/protocols/Telegram/tgl/CHANGELOG b/protocols/Telegram/tgl/CHANGELOG
new file mode 100644
index 0000000000..776a1f3037
--- /dev/null
+++ b/protocols/Telegram/tgl/CHANGELOG
@@ -0,0 +1,23 @@
+2.0.3
+* updated to layer 31 (bot support)
+* changed signature of contact_search method
+2.0.2
+* fixed small bugs
+* added block/unblock user method
+2.0.1
+* store error code for last operation in TLS->error/TLS->error_code
+* make interface more consitent
+* deleted outdated *_ex functions
+* fixed bugs
+* support for layer 28:
+* support for new pts system
+* support for new read system
+* support for passwords
+* support replies
+* support photo captions
+* support group links
+1.2.1
+* fixed registration/login problem
+* added extension to downloads
+1.2.0
+* layer 22 support
diff --git a/protocols/Telegram/tgl/LICENSE b/protocols/Telegram/tgl/LICENSE
new file mode 100644
index 0000000000..3c12ac3bef
--- /dev/null
+++ b/protocols/Telegram/tgl/LICENSE
@@ -0,0 +1,175 @@
+GNU LESSER GENERAL PUBLIC LICENSE
+
+Version 2.1, February 1999
+
+Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+Preamble
+
+The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.
+
+This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below.
+
+When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things.
+
+To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it.
+
+For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights.
+
+We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library.
+
+To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others.
+
+Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license.
+
+Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs.
+
+When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library.
+
+We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances.
+
+For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License.
+
+In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system.
+
+Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library.
+
+The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run.
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you".
+
+A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.
+
+The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".)
+
+"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.
+
+Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.
+
+1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.
+
+You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
+
+a) The modified work must itself be a software library.
+b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.
+c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.
+d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.
+(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
+
+3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.
+
+Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.
+
+This option is useful when you wish to copy part of the code of the Library into a program that is not a library.
+
+4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.
+
+If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.
+
+5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.
+
+However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.
+
+When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.
+
+If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)
+
+Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.
+
+6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications.
+
+You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:
+
+a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)
+b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with.
+c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.
+d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.
+e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy.
+For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
+
+It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.
+
+7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:
+
+a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.
+b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
+8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
+
+9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.
+
+10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License.
+
+11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
+
+This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
+
+12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
+
+13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.
+
+14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
+
+NO WARRANTY
+
+15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+END OF TERMS AND CONDITIONS
+
+How to Apply These Terms to Your New Libraries
+
+If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License).
+
+To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
+
+one line to give the library's name and an idea of what it does.
+Copyright (C) year name of author
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names:
+
+Yoyodyne, Inc., hereby disclaims all copyright interest in
+the library `Frob' (a library for tweaking knobs) written
+by James Random Hacker.
+
+signature of Ty Coon, 1 April 1990
+Ty Coon, President of Vice
+That's all there is to it!
+
diff --git a/protocols/Telegram/tgl/Makefile.in b/protocols/Telegram/tgl/Makefile.in
new file mode 100644
index 0000000000..36c6d7ac83
--- /dev/null
+++ b/protocols/Telegram/tgl/Makefile.in
@@ -0,0 +1,95 @@
+srcdir=@srcdir@
+
+CFLAGS=@CFLAGS@
+LDFLAGS=@LDFLAGS@ @OPENSSL_LDFLAGS@
+CPPFLAGS=@CPPFLAGS@ @OPENSSL_INCLUDES@
+DEFS=@DEFS@
+COMPILE_FLAGS=${CFLAGS} ${CPFLAGS} ${CPPFLAGS} ${DEFS} -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC
+
+EXTRA_LIBS=@LIBS@ @EXTRA_LIBS@ @OPENSSL_LIBS@
+LOCAL_LDFLAGS=-rdynamic -ggdb ${EXTRA_LIBS}
+LINK_FLAGS=${LDFLAGS} ${LOCAL_LDFLAGS}
+
+DEP=dep
+AUTO=auto
+OBJ=objs
+LIB=libs
+EXE=bin
+DIR_LIST=${DEP} ${AUTO} ${EXE} ${OBJ} ${LIB} ${DEP}/auto ${OBJ}/auto
+
+LIB_LIST=${LIB}/libtgl.a ${LIB}/libtgl.so
+
+TGL_OBJECTS=${OBJ}/mtproto-common.o ${OBJ}/mtproto-client.o ${OBJ}/queries.o ${OBJ}/structures.o ${OBJ}/binlog.o ${OBJ}/tgl.o ${OBJ}/updates.o ${OBJ}/tg-mime-types.o ${OBJ}/mtproto-utils.o @EXTRA_OBJECTS@
+TGL_OBJECTS_AUTO=${OBJ}/auto/auto-skip.o ${OBJ}/auto/auto-fetch.o ${OBJ}/auto/auto-store.o ${OBJ}/auto/auto-autocomplete.o ${OBJ}/auto/auto-types.o ${OBJ}/auto/auto-fetch-ds.o ${OBJ}/auto/auto-free-ds.o ${OBJ}/auto/auto-store-ds.o ${OBJ}/auto/auto-print-ds.o
+TLD_OBJECTS=${OBJ}/dump-tl-file.o
+GENERATE_OBJECTS=${OBJ}/generate.o
+COMMON_OBJECTS=${OBJ}/tools.o
+OBJ_C=${GENERATE_OBJECTS} ${COMMON_OBJECTS} ${TGL_OBJECTS} ${TLD_OBJECTS}
+
+DEPENDENCE=$(subst ${OBJ}/,${DEP}/,$(patsubst %.o,%.d,${OBJ_C}))
+DEPENDENCE_LIST=${DEPENDENCE}
+
+INCLUDE=-I. -I${srcdir}
+CC=@CC@
+
+.SUFFIXES:
+
+.SUFFIXES: .c .h .o
+
+all: ${LIB_LIST}
+create_dirs_and_headers: ${DIR_LIST} ${AUTO}/auto-skip.h ${AUTO}/auto-fetch.h ${AUTO}/auto-store.h ${AUTO}/auto-autocomplete.h ${AUTO}/auto-types.h
+create_dirs: ${DIR_LIST}
+dump-tl: ${EXE}/dump-tl-file
+
+include ${srcdir}/Makefile.tl-parser
+
+${DIR_LIST}:
+ @test -d $@ || mkdir -p $@
+
+-include ${DEPENDENCE_LIST}
+
+${TGL_OBJECTS}: ${AUTO}/constants.h ${AUTO}/auto-skip.h ${AUTO}/auto-fetch.h ${AUTO}/auto-store.h ${AUTO}/auto-autocomplete.h ${AUTO}/auto-types.h ${AUTO}/auto-fetch-ds.h ${AUTO}/auto-free-ds.h ${AUTO}/auto-store-ds.h ${AUTO}/auto-print-ds.h
+
+${OBJ_C}: ${OBJ}/%.o: ${srcdir}/%.c | create_dirs
+ ${CC} ${INCLUDE} ${COMPILE_FLAGS} -c -MP -MD -MF ${DEP}/$*.d -MQ ${OBJ}/$*.o -o $@ $<
+
+${TGL_OBJECTS_AUTO}: ${OBJ}/auto/%.o: ${AUTO}/%.c | create_dirs
+ ${CC} ${INCLUDE} ${COMPILE_FLAGS} -iquote ${srcdir}/tgl -c -MP -MD -MF ${DEP}/$*.d -MQ ${OBJ}/$*.o -o $@ $<
+
+${LIB}/libtgl.a: ${TGL_OBJECTS} ${COMMON_OBJECTS} ${TGL_OBJECTS_AUTO}
+ rm -f $@ && ar ruv $@ ${TGL_OBJECTS} ${COMMON_OBJECTS}
+
+${LIB}/libtgl.so: ${TGL_OBJECTS} ${COMMON_OBJECTS} ${TGL_OBJECTS_AUTO}
+ ${CC} -shared -o $@ ${TGL_OBJECTS} ${COMMON_OBJECTS} ${LINK_FLAGS}
+
+${EXE}/generate: ${GENERATE_OBJECTS} ${COMMON_OBJECTS}
+ ${CC} ${GENERATE_OBJECTS} ${COMMON_OBJECTS} ${LINK_FLAGS} -o $@
+
+${AUTO}/scheme.tlo: ${AUTO}/scheme.tl ${EXE}/tl-parser
+ ${EXE}/tl-parser -e $@ ${AUTO}/scheme.tl
+
+${AUTO}/scheme.tl: ${srcdir}/scheme.tl ${srcdir}/encrypted_scheme.tl ${srcdir}/binlog.tl ${srcdir}/mtproto.tl ${srcdir}/append.tl | ${AUTO}
+ cat $^ > $@
+
+${AUTO}/scheme2.tl: ${AUTO}/scheme.tl ${EXE}/tl-parser
+ ${EXE}/tl-parser -E ${AUTO}/scheme.tl 2> $@ || ( cat $@ && rm $@ && false )
+
+${AUTO}/auto.c: ${AUTO}/scheme.tlo ${EXE}/generate
+ ${EXE}/generate ${AUTO}/scheme.tlo > $@
+
+${AUTO}/auto-%.c: ${AUTO}/scheme.tlo ${EXE}/generate auto/constants.h ${AUTO}/auto-%.h | create_dirs_and_headers
+ ${EXE}/generate -g $(patsubst ${AUTO}/auto-%.c,%,$@) ${AUTO}/scheme.tlo > $@ || rm $@
+
+${AUTO}/auto-%.h: ${AUTO}/scheme.tlo ${EXE}/generate
+ ${EXE}/generate -g $(patsubst ${AUTO}/auto-%.h,%-header,$@) ${AUTO}/scheme.tlo > $@ || rm $@
+
+
+${AUTO}/constants.h: ${AUTO}/scheme2.tl ${srcdir}/gen_constants_h.awk
+ awk -f ${srcdir}/gen_constants_h.awk < $< > $@
+
+${EXE}/dump-tl-file: ${OBJ}/auto/auto.o ${TLD_OBJECTS}
+ ${CC} ${OBJ}/auto/auto.o ${TLD_OBJECTS} ${LINK_FLAGS} -o $@
+
+clean:
+ rm -rf ${DIR_LIST} config.log config.status > /dev/null || echo "all clean"
+
diff --git a/protocols/Telegram/tgl/Makefile.tl-parser b/protocols/Telegram/tgl/Makefile.tl-parser
new file mode 100644
index 0000000000..9600514661
--- /dev/null
+++ b/protocols/Telegram/tgl/Makefile.tl-parser
@@ -0,0 +1,7 @@
+TL_PARSER_OBJECTS=${OBJ}/tl-parser.o ${OBJ}/tlc.o ${OBJ}/crc32.o
+
+${TL_PARSER_OBJECTS}: ${OBJ}/%.o: ${srcdir}/tl-parser/%.c | create_dirs
+ ${CC} ${INCLUDE} ${COMPILE_FLAGS} -iquote ${srcdir}/tl-parser -c -MP -MD -MF ${DEP}/$*.d -MQ ${OBJ}/$*.o -o $@ $<
+
+${EXE}/tl-parser: ${TL_PARSER_OBJECTS}
+ ${CC} $^ ${LINK_FLAGS} -o $@
diff --git a/protocols/Telegram/tgl/README.md b/protocols/Telegram/tgl/README.md
new file mode 100644
index 0000000000..e9cb491af3
--- /dev/null
+++ b/protocols/Telegram/tgl/README.md
@@ -0,0 +1,27 @@
+This is library that handles telegram api and protocol.
+
+### API, Protocol documentation
+
+Documentation for Telegram API is available here: http://core.telegram.org/api
+
+Documentation for MTproto protocol is available here: http://core.telegram.org/mtproto
+
+### Installation
+
+Clone GitHub Repository
+
+ git clone --recursive https://github.com/vysheng/tgl.git && cd tgl
+
+#### Linux and BSDs
+
+Install libs: openssl, zlib
+if you want to use provided net/timers then install libevent and add --enable-libevent key to configure
+
+Then,
+
+ ./configure
+ make
+
+### Contacts
+If you would like to ask a question, you can write to my telegram or to the github (or both). To contact me via telegram, you should use import_card method with argument 000653bf:0738ca5d:5521fbac:29246815:a27d0cda
+
diff --git a/protocols/Telegram/tgl/auto-static-autocomplete.c b/protocols/Telegram/tgl/auto-static-autocomplete.c
new file mode 100644
index 0000000000..43ec4cc02e
--- /dev/null
+++ b/protocols/Telegram/tgl/auto-static-autocomplete.c
@@ -0,0 +1,63 @@
+#define IN_AUTOCOMPLETE_H
+#include "auto-static-store.c"
+#undef IN_AUTOCOMPLETE_H
+
+static int autocomplete_mode;
+static char *autocomplete_string;
+static int (*autocomplete_fun)(const char *, int, int, char **);
+
+static void set_autocomplete_string (const char *s) {
+ if (autocomplete_string) { free (autocomplete_string); }
+ autocomplete_string = strdup (s);
+ assert (autocomplete_string);
+ autocomplete_mode = 1;
+}
+
+static void set_autocomplete_type (int (*f)(const char *, int, int, char **)) {
+ autocomplete_fun = f;
+ autocomplete_mode = 2;
+}
+
+#define MAX_FVARS 100
+static struct paramed_type *fvars[MAX_FVARS];
+static int fvars_pos;
+
+static void add_var_to_be_freed (struct paramed_type *P) {
+ assert (fvars_pos < MAX_FVARS);
+ fvars[fvars_pos ++] = P;
+}
+
+static void free_vars_to_be_freed (void) {
+ int i;
+ for (i = 0; i < fvars_pos; i++) {
+ tgl_paramed_type_free (fvars[i]);
+ }
+ fvars_pos = 0;
+}
+
+int tglf_extf_autocomplete (struct tgl_state *TLS, const char *text, int text_len, int index, char **R, char *data, int data_len) {
+ if (index == -1) {
+ buffer_pos = data;
+ buffer_end = data + data_len;
+ autocomplete_mode = 0;
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_any ();
+ free_vars_to_be_freed ();
+ if (P) { tgl_paramed_type_free (P); }
+ }
+ if (autocomplete_mode == 0) { return -1; }
+ int len = strlen (text);
+ if (autocomplete_mode == 1) {
+ if (index >= 0) { return -1; }
+ index = 0;
+ if (!strncmp (text, autocomplete_string, len)) {
+ *R = strdup (autocomplete_string);
+ assert (*R);
+ return index;
+ } else {
+ return -1;
+ }
+ } else {
+ return autocomplete_fun (text, len, index, R);
+ }
+}
diff --git a/protocols/Telegram/tgl/auto-static-fetch-ds.c b/protocols/Telegram/tgl/auto-static-fetch-ds.c
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/protocols/Telegram/tgl/auto-static-fetch-ds.c
diff --git a/protocols/Telegram/tgl/auto-static-fetch.c b/protocols/Telegram/tgl/auto-static-fetch.c
new file mode 100644
index 0000000000..4d4e47cc5c
--- /dev/null
+++ b/protocols/Telegram/tgl/auto-static-fetch.c
@@ -0,0 +1,106 @@
+static int multiline_output = 1;
+static int multiline_offset;
+static int multiline_offset_size = 2;
+
+static int disable_field_names;
+
+#define OUT_BUF_SIZE (1 << 25)
+static char out_buf[OUT_BUF_SIZE];
+static int out_buf_pos;
+
+#define eprintf(...) \
+ do { \
+ out_buf_pos += snprintf (out_buf + out_buf_pos, OUT_BUF_SIZE - out_buf_pos, __VA_ARGS__);\
+ assert (out_buf_pos < OUT_BUF_SIZE);\
+ } while (0)\
+
+static int valid_utf8_char (const char *str) {
+ unsigned char c = (unsigned char) *str;
+ int n = 0;
+
+ if ((c & 0x80) == 0x00) {
+ n = 0;
+ } else if ((c & 0xe0) == 0xc0) {
+ n = 1;
+ } else if ((c & 0xf0) == 0xe0) {
+ n = 2;
+ } else if ((c & 0xf8) == 0xf0) {
+ n = 3;
+ } else if ((c & 0xfc) == 0xf8) {
+ n = 4;
+ } else if ((c & 0xfe) == 0xfc) {
+ n = 5;
+ } else {
+ return -1;
+ }
+
+ int i;
+ for (i = 0; i < n; i ++) {
+ if ((((unsigned char)(str[i + 1])) & 0xc0) != 0x80) {
+ return -1;
+ }
+ }
+ return n + 1;
+}
+
+static void print_escaped_string (const char *str, int len) {
+ eprintf ("\"");
+ const char *end = str + len;
+ while (str < end) {
+ int n = valid_utf8_char (str);
+ if (n < 0) {
+ eprintf ("\\x%02x", (int)(unsigned char)*str);
+ str ++;
+ } else if (n >= 2) {
+ int i;
+ for (i = 0; i < n; i++) {
+ eprintf ("%c", *(str ++));
+ }
+ } else if (((unsigned char)*str) >= ' ' && *str != '"' && *str != '\\') {
+ eprintf ("%c", *str);
+ str ++;
+ } else {
+ switch (*str) {
+ case '\n':
+ eprintf("\\n");
+ break;
+ case '\r':
+ eprintf("\\r");
+ break;
+ case '\t':
+ eprintf("\\t");
+ break;
+ case '\b':
+ eprintf("\\b");
+ break;
+ case '\a':
+ eprintf("\\a");
+ break;
+ case '\\':
+ eprintf ("\\\\");
+ break;
+ case '"':
+ eprintf ("\\\"");
+ break;
+ default:
+ eprintf ("\\x%02x", (int)(unsigned char)*str);
+ break;
+ }
+ str ++;
+ }
+ }
+ eprintf ("\"");
+}
+
+static void print_offset (void) {
+ int i;
+ for (i = 0; i < multiline_offset; i++) {
+ eprintf (" ");
+ }
+}
+
+char *tglf_extf_fetch (struct tgl_state *TLS, struct paramed_type *T) {
+ out_buf_pos = 0;
+ if (fetch_type_any (T) < 0) { return 0; }
+ return out_buf;
+}
diff --git a/protocols/Telegram/tgl/auto-static-free-ds.c b/protocols/Telegram/tgl/auto-static-free-ds.c
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/protocols/Telegram/tgl/auto-static-free-ds.c
diff --git a/protocols/Telegram/tgl/auto-static-print-ds.c b/protocols/Telegram/tgl/auto-static-print-ds.c
new file mode 100644
index 0000000000..cfec470fcc
--- /dev/null
+++ b/protocols/Telegram/tgl/auto-static-print-ds.c
@@ -0,0 +1,106 @@
+static int multiline_output = 1;
+static int multiline_offset;
+static int multiline_offset_size = 2;
+
+static int disable_field_names;
+
+#define OUT_BUF_SIZE (1 << 25)
+static char out_buf[OUT_BUF_SIZE];
+static int out_buf_pos;
+
+#define eprintf(...) \
+ do { \
+ out_buf_pos += snprintf (out_buf + out_buf_pos, OUT_BUF_SIZE - out_buf_pos, __VA_ARGS__);\
+ assert (out_buf_pos < OUT_BUF_SIZE);\
+ } while (0)\
+
+static int valid_utf8_char (const char *str) {
+ unsigned char c = (unsigned char) *str;
+ int n = 0;
+
+ if ((c & 0x80) == 0x00) {
+ n = 0;
+ } else if ((c & 0xe0) == 0xc0) {
+ n = 1;
+ } else if ((c & 0xf0) == 0xe0) {
+ n = 2;
+ } else if ((c & 0xf8) == 0xf0) {
+ n = 3;
+ } else if ((c & 0xfc) == 0xf8) {
+ n = 4;
+ } else if ((c & 0xfe) == 0xfc) {
+ n = 5;
+ } else {
+ return -1;
+ }
+
+ int i;
+ for (i = 0; i < n; i ++) {
+ if ((((unsigned char)(str[i + 1])) & 0xc0) != 0x80) {
+ return -1;
+ }
+ }
+ return n + 1;
+}
+
+static void print_escaped_string (const char *str, int len) {
+ eprintf ("\"");
+ const char *end = str + len;
+ while (str < end) {
+ int n = valid_utf8_char (str);
+ if (n < 0) {
+ eprintf ("\\x%02x", (int)(unsigned char)*str);
+ str ++;
+ } else if (n >= 2) {
+ int i;
+ for (i = 0; i < n; i++) {
+ eprintf ("%c", *(str ++));
+ }
+ } else if (((unsigned char)*str) >= ' ' && *str != '"' && *str != '\\') {
+ eprintf ("%c", *str);
+ str ++;
+ } else {
+ switch (*str) {
+ case '\n':
+ eprintf("\\n");
+ break;
+ case '\r':
+ eprintf("\\r");
+ break;
+ case '\t':
+ eprintf("\\t");
+ break;
+ case '\b':
+ eprintf("\\b");
+ break;
+ case '\a':
+ eprintf("\\a");
+ break;
+ case '\\':
+ eprintf ("\\\\");
+ break;
+ case '"':
+ eprintf ("\\\"");
+ break;
+ default:
+ eprintf ("\\x%02x", (int)(unsigned char)*str);
+ break;
+ }
+ str ++;
+ }
+ }
+ eprintf ("\"");
+}
+
+static void print_offset (void) {
+ int i;
+ for (i = 0; i < multiline_offset; i++) {
+ eprintf (" ");
+ }
+}
+
+char *tglf_extf_print_ds (struct tgl_state *TLS, void *DS, struct paramed_type *T) {
+ out_buf_pos = 0;
+ if (print_ds_type_any (DS, T) < 0) { return 0; }
+ return out_buf;
+}
diff --git a/protocols/Telegram/tgl/auto-static-print.c b/protocols/Telegram/tgl/auto-static-print.c
new file mode 100644
index 0000000000..3c4e810fad
--- /dev/null
+++ b/protocols/Telegram/tgl/auto-static-print.c
@@ -0,0 +1,461 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Vitaly Valtman 2014-2015
+*/
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+static int cur_token_len;
+static char *cur_token;
+static int cur_token_real_len;
+static int cur_token_quoted;
+static int multiline_output = 1;
+static int multiline_offset;
+static int multiline_offset_size = 2;
+
+static int *in_ptr, *in_end;
+
+static inline int fetch_int (void) {
+ return *(in_ptr ++);
+}
+
+static inline int fetch_long (void) {
+ long long r = *(long long *)in_ptr;
+ in_ptr += 2;
+ return r;
+}
+
+static inline int fetch_long (void) {
+ long long r = *(long long *)in_ptr;
+ in_ptr += 2;
+ return r;
+}
+
+static inline void out_int (int a) {}
+static inline void out_double (double a) {}
+static inline void out_string (char *s, int l) {}
+static inline void out_long (long long a) {}
+
+static int disable_field_names;
+
+#define expect_token(token,len) \
+ if (len != cur_token_len || memcmp (cur_token, token, cur_token_len)) { return -1; } \
+ local_next_token ();
+
+#define expect_token_ptr(token,len) \
+ if (len != cur_token_len || memcmp (cur_token, token, cur_token_len)) { return 0; } \
+ local_next_token ();
+
+#define expect_token_autocomplete(token,len) \
+ if (cur_token_len == -3 && len >= cur_token_real_len && !memcmp (cur_token, token, cur_token_real_len)) { set_autocomplete_string (token); return -1; }\
+ if (len != cur_token_len || memcmp (cur_token, token, cur_token_len)) { return -1; } \
+ local_next_token ();
+
+#define expect_token_ptr_autocomplete(token,len) \
+ if (cur_token_len == -3 && len >= cur_token_real_len && !memcmp (cur_token, token, cur_token_real_len)) { set_autocomplete_string (token); return 0; }\
+ if (len != cur_token_len || memcmp (cur_token, token, cur_token_len)) { return 0; } \
+ local_next_token ();
+
+
+static int autocomplete_mode;
+static char *autocomplete_string;
+static int (*autocomplete_fun)(const char *, int, int, char **);
+
+static void set_autocomplete_string (const char *s) {
+ if (autocomplete_string) { free (autocomplete_string); }
+ autocomplete_string = strdup (s);
+ assert (autocomplete_string);
+ autocomplete_mode = 1;
+}
+
+static void set_autocomplete_type (int (*f)(const char *, int, int, char **)) {
+ autocomplete_fun = f;
+ autocomplete_mode = 2;
+}
+
+static int is_int (void) {
+ if (cur_token_len <= 0) { return 0; }
+ char c = cur_token[cur_token_len];
+ cur_token[cur_token_len] = 0;
+ char *p = 0;
+
+ if (strtoll (cur_token, &p, 10)) {}
+ cur_token[cur_token_len] = c;
+
+ return p == cur_token + cur_token_len;
+}
+
+static long long get_int (void) {
+ if (cur_token_len <= 0) { return 0; }
+ char c = cur_token[cur_token_len];
+ cur_token[cur_token_len] = 0;
+ char *p = 0;
+
+ long long val = strtoll (cur_token, &p, 0);
+ cur_token[cur_token_len] = c;
+
+ return val;
+}
+
+static int is_double (void) {
+ if (cur_token_len <= 0) { return 0; }
+ char c = cur_token[cur_token_len];
+ cur_token[cur_token_len] = 0;
+ char *p = 0;
+
+ if (strtod (cur_token, &p)) {}
+ cur_token[cur_token_len] = c;
+
+ return p == cur_token + cur_token_len;
+}
+
+static double get_double (void) {
+ if (cur_token_len <= 0) { return 0; }
+ char c = cur_token[cur_token_len];
+ cur_token[cur_token_len] = 0;
+ char *p = 0;
+
+ double val = strtod (cur_token, &p);
+ cur_token[cur_token_len] = c;
+
+ return val;
+}
+
+static struct paramed_type *paramed_type_dup (struct paramed_type *P) {
+ if (ODDP (P)) { return P; }
+ struct paramed_type *R = malloc (sizeof (*R));
+ assert (R);
+ R->type = malloc (sizeof (*R->type));
+ assert (R->type);
+ memcpy (R->type, P->type, sizeof (*P->type));
+ R->type->id = strdup (P->type->id);
+ assert (R->type->id);
+
+ if (P->type->params_num) {
+ R->params = malloc (sizeof (void *) * P->type->params_num);
+ assert (R->params);
+ int i;
+ for (i = 0; i < P->type->params_num; i++) {
+ R->params[i] = paramed_type_dup (P->params[i]);
+ }
+ }
+ return R;
+}
+
+void tgl_paramed_type_free (struct paramed_type *P) {
+ if (ODDP (P)) { return; }
+ if (P->type->params_num) {
+ int i;
+ for (i = 0; i < P->type->params_num; i++) {
+ tgl_paramed_type_free (P->params[i]);
+ }
+ free (P->params);
+ }
+ free (P->type->id);
+ free (P->type);
+ free (P);
+}
+
+static char *buffer_pos, *buffer_end;
+
+static int is_wspc (char c) {
+ return c <= 32 && c > 0;
+}
+
+static void skip_wspc (void) {
+ while (buffer_pos < buffer_end && is_wspc (*buffer_pos)) {
+ buffer_pos ++;
+ }
+}
+
+static int is_letter (char c) {
+ return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '.' || c == '_' || c == '-';
+}
+
+
+static char exp_buffer[1 << 25];;
+static int exp_buffer_pos;
+
+static inline int is_hex (char c) {
+ return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f');
+}
+
+static inline int hex2dec (char c) {
+ if (c >= '0' && c <= '9') { return c - '0'; }
+ else { return c - 'a' + 10; }
+}
+
+static void expand_backslashed (char *s, int len) {
+ int backslashed = 0;
+ exp_buffer_pos = 0;
+ int i = 0;
+ while (i < len) {
+ assert (i + 3 <= (1 << 25));
+ if (backslashed) {
+ backslashed = 0;
+ switch (s[i ++]) {
+ case 'n':
+ exp_buffer[exp_buffer_pos ++] = '\n';
+ break;
+ case 'r':
+ exp_buffer[exp_buffer_pos ++] = '\r';
+ break;
+ case 't':
+ exp_buffer[exp_buffer_pos ++] = '\t';
+ break;
+ case 'b':
+ exp_buffer[exp_buffer_pos ++] = '\b';
+ break;
+ case 'a':
+ exp_buffer[exp_buffer_pos ++] = '\a';
+ break;
+ case '\\':
+ exp_buffer[exp_buffer_pos ++] = '\\';
+ break;
+ case 'x':
+ if (i + 2 > len || !is_hex (s[i]) || !is_hex (s[i + 1])) {
+ exp_buffer_pos = -1;
+ return;
+ }
+ exp_buffer[exp_buffer_pos ++] = hex2dec (s[i]) * 16 + hex2dec (s[i + 1]);
+ i += 2;
+ break;
+ default:
+ break;
+ }
+ } else {
+ if (s[i] == '\\') {
+ backslashed = 1;
+ i ++;
+ } else {
+ exp_buffer[exp_buffer_pos ++] = s[i ++];
+ }
+ }
+ }
+}
+
+static void local_next_token (void) {
+ skip_wspc ();
+ cur_token_quoted = 0;
+ if (buffer_pos >= buffer_end) {
+ cur_token_len = -3;
+ cur_token_real_len = 0;
+ return;
+ }
+ char c = *buffer_pos;
+ if (is_letter (c)) {
+ cur_token = buffer_pos;
+ while (buffer_pos < buffer_end && is_letter (*buffer_pos)) {
+ buffer_pos ++;
+ }
+ if (buffer_pos < buffer_end) {
+ cur_token_len = buffer_pos - cur_token;
+ } else {
+ cur_token_real_len = buffer_pos - cur_token;
+ cur_token_len = -3;
+ }
+ return;
+ } else if (c == '"') {
+ cur_token_quoted = 1;
+ cur_token = buffer_pos ++;
+ int backslashed = 0;
+ while (buffer_pos < buffer_end && (*buffer_pos != '"' || backslashed)) {
+ if (*buffer_pos == '\\') {
+ backslashed ^= 1;
+ } else {
+ backslashed = 0;
+ }
+ buffer_pos ++;
+ }
+ if (*buffer_pos == '"') {
+ buffer_pos ++;
+ expand_backslashed (cur_token + 1, buffer_pos - cur_token - 2);
+ if (exp_buffer_pos < 0) {
+ cur_token_len = -2;
+ } else {
+ cur_token_len = exp_buffer_pos;
+ cur_token = exp_buffer;
+ }
+ } else {
+ cur_token_len = -2;
+ }
+ return;
+ } else {
+ if (c) {
+ cur_token = buffer_pos ++;
+ cur_token_len = 1;
+ } else {
+ cur_token_len = -3;
+ cur_token_real_len = 0;
+ }
+ }
+}
+
+#define MAX_FVARS 100
+static struct paramed_type *fvars[MAX_FVARS];
+static int fvars_pos;
+
+static void add_var_to_be_freed (struct paramed_type *P) {
+ assert (fvars_pos < MAX_FVARS);
+ fvars[fvars_pos ++] = P;
+}
+
+static void free_vars_to_be_freed (void) {
+ int i;
+ for (i = 0; i < fvars_pos; i++) {
+ tgl_paramed_type_free (fvars[i]);
+ }
+ fvars_pos = 0;
+}
+
+int tglf_extf_autocomplete (const char *text, int text_len, int index, char **R, char *data, int data_len) {
+ if (index == -1) {
+ buffer_pos = data;
+ buffer_end = data + data_len;
+ autocomplete_mode = 0;
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_any ();
+ free_vars_to_be_freed ();
+ if (P) { tgl_paramed_type_free (P); }
+ }
+ if (autocomplete_mode == 0) { return -1; }
+ int len = strlen (text);
+ if (autocomplete_mode == 1) {
+ if (index >= 0) { return -1; }
+ index = 0;
+ if (!strncmp (text, autocomplete_string, len)) {
+ *R = strdup (autocomplete_string);
+ assert (*R);
+ return index;
+ } else {
+ return -1;
+ }
+ } else {
+ return autocomplete_fun (text, len, index, R);
+ }
+}
+
+struct paramed_type *tglf_extf_store (const char *data, int data_len) {
+ buffer_pos = (char *)data;
+ buffer_end = (char *)(data + data_len);
+ local_next_token ();
+ return store_function_any ();
+}
+
+#define OUT_BUF_SIZE (1 << 25)
+static char out_buf[OUT_BUF_SIZE];
+static int out_buf_pos;
+
+#define eprintf(...) \
+ do { \
+ out_buf_pos += snprintf (out_buf + out_buf_pos, OUT_BUF_SIZE - out_buf_pos, __VA_ARGS__);\
+ assert (out_buf_pos < OUT_BUF_SIZE);\
+ } while (0)\
+
+static int valid_utf8_char (const char *str) {
+ unsigned char c = (unsigned char) *str;
+ int n = 0;
+
+ if ((c & 0x80) == 0x00) {
+ n = 0;
+ } else if ((c & 0xe0) == 0xc0) {
+ n = 1;
+ } else if ((c & 0xf0) == 0xe0) {
+ n = 2;
+ } else if ((c & 0xf8) == 0xf0) {
+ n = 3;
+ } else if ((c & 0xfc) == 0xf8) {
+ n = 4;
+ } else if ((c & 0xfe) == 0xfc) {
+ n = 5;
+ } else {
+ return -1;
+ }
+
+ int i;
+ for (i = 0; i < n; i ++) {
+ if ((((unsigned char)(str[i + 1])) & 0xc0) != 0x80) {
+ return -1;
+ }
+ }
+ return n + 1;
+}
+
+static void print_escaped_string (const char *str, int len) {
+ eprintf ("\"");
+ const char *end = str + len;
+ while (str < end) {
+ int n = valid_utf8_char (str);
+ if (n < 0) {
+ eprintf ("\\x%02x", (int)(unsigned char)*str);
+ str ++;
+ } else if (n >= 2) {
+ int i;
+ for (i = 0; i < n; i++) {
+ eprintf ("%c", *(str ++));
+ }
+ } else if (((unsigned char)*str) >= ' ' && *str != '"' && *str != '\\') {
+ eprintf ("%c", *str);
+ str ++;
+ } else {
+ switch (*str) {
+ case '\n':
+ eprintf("\\n");
+ break;
+ case '\r':
+ eprintf("\\r");
+ break;
+ case '\t':
+ eprintf("\\t");
+ break;
+ case '\b':
+ eprintf("\\b");
+ break;
+ case '\a':
+ eprintf("\\a");
+ break;
+ case '\\':
+ eprintf ("\\\\");
+ break;
+ case '"':
+ eprintf ("\\\"");
+ break;
+ default:
+ eprintf ("\\x%02x", (int)(unsigned char)*str);
+ break;
+ }
+ str ++;
+ }
+ }
+ eprintf ("\"");
+}
+
+static void print_offset (void) {
+ int i;
+ for (i = 0; i < multiline_offset; i++) {
+ eprintf (" ");
+ }
+}
+
+char *tglf_extf_fetch (struct paramed_type *T) {
+ out_buf_pos = 0;
+ fetch_type_any (T);
+ return out_buf;
+}
diff --git a/protocols/Telegram/tgl/auto-static-skip.c b/protocols/Telegram/tgl/auto-static-skip.c
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/protocols/Telegram/tgl/auto-static-skip.c
diff --git a/protocols/Telegram/tgl/auto-static-store-ds.c b/protocols/Telegram/tgl/auto-static-store-ds.c
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/protocols/Telegram/tgl/auto-static-store-ds.c
diff --git a/protocols/Telegram/tgl/auto-static-store.c b/protocols/Telegram/tgl/auto-static-store.c
new file mode 100644
index 0000000000..bff0cb5f84
--- /dev/null
+++ b/protocols/Telegram/tgl/auto-static-store.c
@@ -0,0 +1,262 @@
+static int cur_token_len;
+static char *cur_token;
+static int cur_token_real_len;
+static int cur_token_quoted;
+
+#define expect_token(token,len) \
+ if (len != cur_token_len || memcmp (cur_token, token, cur_token_len)) { return -1; } \
+ local_next_token ();
+
+#define expect_token_ptr(token,len) \
+ if (len != cur_token_len || memcmp (cur_token, token, cur_token_len)) { return 0; } \
+ local_next_token ();
+
+#define expect_token_autocomplete(token,len) \
+ if (cur_token_len == -3 && len >= cur_token_real_len && !memcmp (cur_token, token, cur_token_real_len)) { set_autocomplete_string (token); return -1; }\
+ if (len != cur_token_len || memcmp (cur_token, token, cur_token_len)) { return -1; } \
+ local_next_token ();
+
+#define expect_token_ptr_autocomplete(token,len) \
+ if (cur_token_len == -3 && len >= cur_token_real_len && !memcmp (cur_token, token, cur_token_real_len)) { set_autocomplete_string (token); return 0; }\
+ if (len != cur_token_len || memcmp (cur_token, token, cur_token_len)) { return 0; } \
+ local_next_token ();
+
+static int is_int (void) {
+ if (cur_token_len <= 0) { return 0; }
+ char c = cur_token[cur_token_len];
+ cur_token[cur_token_len] = 0;
+ char *p = 0;
+
+ if (strtoll (cur_token, &p, 10)) {}
+ cur_token[cur_token_len] = c;
+
+ return p == cur_token + cur_token_len;
+}
+
+static long long get_int (void) {
+ if (cur_token_len <= 0) { return 0; }
+ char c = cur_token[cur_token_len];
+ cur_token[cur_token_len] = 0;
+ char *p = 0;
+
+ long long val = strtoll (cur_token, &p, 0);
+ cur_token[cur_token_len] = c;
+
+ return val;
+}
+
+static int is_double (void) {
+ if (cur_token_len <= 0) { return 0; }
+ char c = cur_token[cur_token_len];
+ cur_token[cur_token_len] = 0;
+ char *p = 0;
+
+ if (strtod (cur_token, &p)) {}
+ cur_token[cur_token_len] = c;
+
+ return p == cur_token + cur_token_len;
+}
+
+#ifndef IN_AUTOCOMPLETE_H
+static double get_double (void) {
+ if (cur_token_len <= 0) { return 0; }
+ char c = cur_token[cur_token_len];
+ cur_token[cur_token_len] = 0;
+ char *p = 0;
+
+ double val = strtod (cur_token, &p);
+ cur_token[cur_token_len] = c;
+
+ return val;
+}
+#endif
+
+static char *buffer_pos, *buffer_end;
+
+static int is_wspc (char c) {
+ return c <= 32 && c > 0;
+}
+
+static void skip_wspc (void) {
+ while (buffer_pos < buffer_end && is_wspc (*buffer_pos)) {
+ buffer_pos ++;
+ }
+}
+
+static int is_letter (char c) {
+ return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '.' || c == '_' || c == '-';
+}
+
+
+static char exp_buffer[1 << 25];;
+static int exp_buffer_pos;
+
+static inline int is_hex (char c) {
+ return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f');
+}
+
+static inline int hex2dec (char c) {
+ if (c >= '0' && c <= '9') { return c - '0'; }
+ else { return c - 'a' + 10; }
+}
+
+static void expand_backslashed (char *s, int len) {
+ int backslashed = 0;
+ exp_buffer_pos = 0;
+ int i = 0;
+ while (i < len) {
+ assert (i + 3 <= (1 << 25));
+ if (backslashed) {
+ backslashed = 0;
+ switch (s[i ++]) {
+ case 'n':
+ exp_buffer[exp_buffer_pos ++] = '\n';
+ break;
+ case 'r':
+ exp_buffer[exp_buffer_pos ++] = '\r';
+ break;
+ case 't':
+ exp_buffer[exp_buffer_pos ++] = '\t';
+ break;
+ case 'b':
+ exp_buffer[exp_buffer_pos ++] = '\b';
+ break;
+ case 'a':
+ exp_buffer[exp_buffer_pos ++] = '\a';
+ break;
+ case '\\':
+ exp_buffer[exp_buffer_pos ++] = '\\';
+ break;
+ case 'x':
+ if (i + 2 > len || !is_hex (s[i]) || !is_hex (s[i + 1])) {
+ exp_buffer_pos = -1;
+ return;
+ }
+ exp_buffer[exp_buffer_pos ++] = hex2dec (s[i]) * 16 + hex2dec (s[i + 1]);
+ i += 2;
+ break;
+ default:
+ break;
+ }
+ } else {
+ if (s[i] == '\\') {
+ backslashed = 1;
+ i ++;
+ } else {
+ exp_buffer[exp_buffer_pos ++] = s[i ++];
+ }
+ }
+ }
+}
+
+static void local_next_token (void) {
+ skip_wspc ();
+ cur_token_quoted = 0;
+ if (buffer_pos >= buffer_end) {
+ cur_token_len = -3;
+ cur_token_real_len = 0;
+ return;
+ }
+ char c = *buffer_pos;
+ if (is_letter (c)) {
+ cur_token = buffer_pos;
+ while (buffer_pos < buffer_end && is_letter (*buffer_pos)) {
+ buffer_pos ++;
+ }
+ if (buffer_pos < buffer_end) {
+ cur_token_len = buffer_pos - cur_token;
+ } else {
+ cur_token_real_len = buffer_pos - cur_token;
+ cur_token_len = -3;
+ }
+ return;
+ } else if (c == '"') {
+ cur_token_quoted = 1;
+ cur_token = buffer_pos ++;
+ int backslashed = 0;
+ while (buffer_pos < buffer_end && (*buffer_pos != '"' || backslashed)) {
+ if (*buffer_pos == '\\') {
+ backslashed ^= 1;
+ } else {
+ backslashed = 0;
+ }
+ buffer_pos ++;
+ }
+ if (*buffer_pos == '"') {
+ buffer_pos ++;
+ expand_backslashed (cur_token + 1, buffer_pos - cur_token - 2);
+ if (exp_buffer_pos < 0) {
+ cur_token_len = -2;
+ } else {
+ cur_token_len = exp_buffer_pos;
+ cur_token = exp_buffer;
+ }
+ } else {
+ cur_token_len = -2;
+ }
+ return;
+ } else {
+ if (c) {
+ cur_token = buffer_pos ++;
+ cur_token_len = 1;
+ } else {
+ cur_token_len = -3;
+ cur_token_real_len = 0;
+ }
+ }
+}
+
+static struct paramed_type *paramed_type_dup (struct paramed_type *P) {
+ if (ODDP (P)) { return P; }
+ struct paramed_type *R = malloc (sizeof (*R));
+ assert (R);
+ R->type = malloc (sizeof (*R->type));
+ assert (R->type);
+ memcpy (R->type, P->type, sizeof (*P->type));
+ R->type->id = strdup (P->type->id);
+ assert (R->type->id);
+
+ if (P->type->params_num) {
+ R->params = malloc (sizeof (void *) * P->type->params_num);
+ assert (R->params);
+ int i;
+ for (i = 0; i < P->type->params_num; i++) {
+ R->params[i] = paramed_type_dup (P->params[i]);
+ }
+ }
+ return R;
+}
+
+#ifndef IN_AUTOCOMPLETE_H
+void tgl_paramed_type_free (struct paramed_type *P) {
+ if (ODDP (P)) { return; }
+ if (P->type->params_num) {
+ int i;
+ for (i = 0; i < P->type->params_num; i++) {
+ tgl_paramed_type_free (P->params[i]);
+ }
+ free (P->params);
+ }
+ free (P->type->id);
+ free (P->type);
+ free (P);
+}
+#else
+void tgl_paramed_type_free (struct paramed_type *P);
+#endif
+
+#ifndef IN_AUTOCOMPLETE_H
+struct paramed_type *tglf_extf_store (struct tgl_state *TLS, const char *data, int data_len) {
+ buffer_pos = (char *)data;
+ buffer_end = (char *)(data + data_len);
+ local_next_token ();
+ return store_function_any ();
+}
+
+int tglf_store_type (struct tgl_state *TLS, const char *data, int data_len, struct paramed_type *P) {
+ buffer_pos = (char *)data;
+ buffer_end = (char *)(data + data_len);
+ local_next_token ();
+ return store_type_any (P);
+}
+#endif
diff --git a/protocols/Telegram/tgl/auto-static.c b/protocols/Telegram/tgl/auto-static.c
new file mode 100644
index 0000000000..89a0a176bf
--- /dev/null
+++ b/protocols/Telegram/tgl/auto-static.c
@@ -0,0 +1,328 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Vitaly Valtman 2014-2015
+*/
+
+#include "mtproto-common.h"
+#include "config.h"
+#include <string.h>
+
+#ifndef DISABLE_EXTF
+static int cur_token_len;
+static char *cur_token;
+static int cur_token_real_len;
+static int cur_token_quoted;
+
+#define expect_token(token,len) \
+ if (len != cur_token_len || memcmp (cur_token, token, cur_token_len)) { return -1; } \
+ local_next_token ();
+
+#define expect_token_ptr(token,len) \
+ if (len != cur_token_len || memcmp (cur_token, token, cur_token_len)) { return 0; } \
+ local_next_token ();
+
+#define expect_token_autocomplete(token,len) \
+ if (cur_token_len == -3 && len >= cur_token_real_len && !memcmp (cur_token, token, cur_token_real_len)) { set_autocomplete_string (token); return -1; }\
+ if (len != cur_token_len || memcmp (cur_token, token, cur_token_len)) { return -1; } \
+ local_next_token ();
+
+#define expect_token_ptr_autocomplete(token,len) \
+ if (cur_token_len == -3 && len >= cur_token_real_len && !memcmp (cur_token, token, cur_token_real_len)) { set_autocomplete_string (token); return 0; }\
+ if (len != cur_token_len || memcmp (cur_token, token, cur_token_len)) { return 0; } \
+ local_next_token ();
+
+
+static int autocomplete_mode;
+static char *autocomplete_string;
+static int (*autocomplete_fun)(const char *, int, int, char **);
+
+static void set_autocomplete_string (const char *s) {
+ if (autocomplete_string) { free (autocomplete_string); }
+ autocomplete_string = strdup (s);
+ assert (autocomplete_string);
+ autocomplete_mode = 1;
+}
+
+static void set_autocomplete_type (int (*f)(const char *, int, int, char **)) {
+ autocomplete_fun = f;
+ autocomplete_mode = 2;
+}
+
+static int is_int (void) {
+ if (cur_token_len <= 0) { return 0; }
+ char c = cur_token[cur_token_len];
+ cur_token[cur_token_len] = 0;
+ char *p = 0;
+
+ if (strtoll (cur_token, &p, 10)) {}
+ cur_token[cur_token_len] = c;
+
+ return p == cur_token + cur_token_len;
+}
+
+static long long get_int (void) {
+ if (cur_token_len <= 0) { return 0; }
+ char c = cur_token[cur_token_len];
+ cur_token[cur_token_len] = 0;
+ char *p = 0;
+
+ long long val = strtoll (cur_token, &p, 0);
+ cur_token[cur_token_len] = c;
+
+ return val;
+}
+
+static int is_double (void) {
+ if (cur_token_len <= 0) { return 0; }
+ char c = cur_token[cur_token_len];
+ cur_token[cur_token_len] = 0;
+ char *p = 0;
+
+ if (strtod (cur_token, &p)) {}
+ cur_token[cur_token_len] = c;
+
+ return p == cur_token + cur_token_len;
+}
+
+static double get_double (void) {
+ if (cur_token_len <= 0) { return 0; }
+ char c = cur_token[cur_token_len];
+ cur_token[cur_token_len] = 0;
+ char *p = 0;
+
+ double val = strtod (cur_token, &p);
+ cur_token[cur_token_len] = c;
+
+ return val;
+}
+
+static struct paramed_type *paramed_type_dup (struct paramed_type *P) {
+ if (ODDP (P)) { return P; }
+ struct paramed_type *R = malloc (sizeof (*R));
+ assert (R);
+ R->type = malloc (sizeof (*R->type));
+ assert (R->type);
+ memcpy (R->type, P->type, sizeof (*P->type));
+ R->type->id = strdup (P->type->id);
+ assert (R->type->id);
+
+ if (P->type->params_num) {
+ R->params = malloc (sizeof (void *) * P->type->params_num);
+ assert (R->params);
+ int i;
+ for (i = 0; i < P->type->params_num; i++) {
+ R->params[i] = paramed_type_dup (P->params[i]);
+ }
+ }
+ return R;
+}
+
+void tgl_paramed_type_free (struct paramed_type *P) {
+ if (ODDP (P)) { return; }
+ if (P->type->params_num) {
+ int i;
+ for (i = 0; i < P->type->params_num; i++) {
+ tgl_paramed_type_free (P->params[i]);
+ }
+ free (P->params);
+ }
+ free (P->type->id);
+ free (P->type);
+ free (P);
+}
+
+static char *buffer_pos, *buffer_end;
+
+static int is_wspc (char c) {
+ return c <= 32 && c > 0;
+}
+
+static void skip_wspc (void) {
+ while (buffer_pos < buffer_end && is_wspc (*buffer_pos)) {
+ buffer_pos ++;
+ }
+}
+
+static int is_letter (char c) {
+ return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '.' || c == '_' || c == '-';
+}
+
+
+static char exp_buffer[1 << 25];;
+static int exp_buffer_pos;
+
+static inline int is_hex (char c) {
+ return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f');
+}
+
+static inline int hex2dec (char c) {
+ if (c >= '0' && c <= '9') { return c - '0'; }
+ else { return c - 'a' + 10; }
+}
+
+static void expand_backslashed (char *s, int len) {
+ int backslashed = 0;
+ exp_buffer_pos = 0;
+ int i = 0;
+ while (i < len) {
+ assert (i + 3 <= (1 << 25));
+ if (backslashed) {
+ backslashed = 0;
+ switch (s[i ++]) {
+ case 'n':
+ exp_buffer[exp_buffer_pos ++] = '\n';
+ break;
+ case 'r':
+ exp_buffer[exp_buffer_pos ++] = '\r';
+ break;
+ case 't':
+ exp_buffer[exp_buffer_pos ++] = '\t';
+ break;
+ case 'b':
+ exp_buffer[exp_buffer_pos ++] = '\b';
+ break;
+ case 'a':
+ exp_buffer[exp_buffer_pos ++] = '\a';
+ break;
+ case '\\':
+ exp_buffer[exp_buffer_pos ++] = '\\';
+ break;
+ case 'x':
+ if (i + 2 > len || !is_hex (s[i]) || !is_hex (s[i + 1])) {
+ exp_buffer_pos = -1;
+ return;
+ }
+ exp_buffer[exp_buffer_pos ++] = hex2dec (s[i]) * 16 + hex2dec (s[i + 1]);
+ i += 2;
+ break;
+ default:
+ break;
+ }
+ } else {
+ if (s[i] == '\\') {
+ backslashed = 1;
+ i ++;
+ } else {
+ exp_buffer[exp_buffer_pos ++] = s[i ++];
+ }
+ }
+ }
+}
+
+static void local_next_token (void) {
+ skip_wspc ();
+ cur_token_quoted = 0;
+ if (buffer_pos >= buffer_end) {
+ cur_token_len = -3;
+ cur_token_real_len = 0;
+ return;
+ }
+ char c = *buffer_pos;
+ if (is_letter (c)) {
+ cur_token = buffer_pos;
+ while (buffer_pos < buffer_end && is_letter (*buffer_pos)) {
+ buffer_pos ++;
+ }
+ if (buffer_pos < buffer_end) {
+ cur_token_len = buffer_pos - cur_token;
+ } else {
+ cur_token_real_len = buffer_pos - cur_token;
+ cur_token_len = -3;
+ }
+ return;
+ } else if (c == '"') {
+ cur_token_quoted = 1;
+ cur_token = buffer_pos ++;
+ int backslashed = 0;
+ while (buffer_pos < buffer_end && (*buffer_pos != '"' || backslashed)) {
+ if (*buffer_pos == '\\') {
+ backslashed ^= 1;
+ } else {
+ backslashed = 0;
+ }
+ buffer_pos ++;
+ }
+ if (*buffer_pos == '"') {
+ buffer_pos ++;
+ expand_backslashed (cur_token + 1, buffer_pos - cur_token - 2);
+ if (exp_buffer_pos < 0) {
+ cur_token_len = -2;
+ } else {
+ cur_token_len = exp_buffer_pos;
+ cur_token = exp_buffer;
+ }
+ } else {
+ cur_token_len = -2;
+ }
+ return;
+ } else {
+ if (c) {
+ cur_token = buffer_pos ++;
+ cur_token_len = 1;
+ } else {
+ cur_token_len = -3;
+ cur_token_real_len = 0;
+ }
+ }
+}
+
+#define MAX_FVARS 100
+static struct paramed_type *fvars[MAX_FVARS];
+static int fvars_pos;
+
+static void add_var_to_be_freed (struct paramed_type *P) {
+ assert (fvars_pos < MAX_FVARS);
+ fvars[fvars_pos ++] = P;
+}
+
+static void free_vars_to_be_freed (void) {
+ int i;
+ for (i = 0; i < fvars_pos; i++) {
+ tgl_paramed_type_free (fvars[i]);
+ }
+ fvars_pos = 0;
+}
+
+int tglf_extf_autocomplete (struct tgl_state *TLS, const char *text, int text_len, int index, char **R, char *data, int data_len) {
+ if (index == -1) {
+ buffer_pos = data;
+ buffer_end = data + data_len;
+ autocomplete_mode = 0;
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_any ();
+ free_vars_to_be_freed ();
+ if (P) { tgl_paramed_type_free (P); }
+ }
+ if (autocomplete_mode == 0) { return -1; }
+ int len = strlen (text);
+ if (autocomplete_mode == 1) {
+ if (index >= 0) { return -1; }
+ index = 0;
+ if (!strncmp (text, autocomplete_string, len)) {
+ *R = strdup (autocomplete_string);
+ assert (*R);
+ return index;
+ } else {
+ return -1;
+ }
+ } else {
+ return autocomplete_fun (text, len, index, R);
+ }
+}
+
+#endif
diff --git a/protocols/Telegram/tgl/auto.h b/protocols/Telegram/tgl/auto.h
new file mode 100644
index 0000000000..b2e216aff3
--- /dev/null
+++ b/protocols/Telegram/tgl/auto.h
@@ -0,0 +1,62 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Vitaly Valtman 2014-2015
+*/
+#ifndef __AUTO_H__
+#define __AUTO_H__
+
+#include "tools.h"
+
+struct tl_type_descr {
+ unsigned name;
+ char *id;
+ int params_num;
+ long long params_types;
+};
+
+struct paramed_type {
+ struct tl_type_descr *type;
+ struct paramed_type **params;
+};
+
+#define NAME_ARRAY 0x89932ad9
+
+#define TYPE_TO_PARAM(NAME) (&(struct paramed_type) {.type = &tl_type_## NAME, .params=0})
+#define TYPE_TO_PARAM_1(NAME,PARAM1) (&(struct paramed_type) {.type = &tl_type_## NAME, .params=(struct paramed_type *[1]){PARAM1}})
+#define ODDP(x) (((long)(x)) & 1)
+#define EVENP(x) (!ODDP(x))
+#define INT2PTR(x) (void *)(long)(((long)x) * 2 + 1)
+#define PTR2INT(x) ((((long)x) - 1) / 2)
+
+static inline void *memdup (const void *d, int len) {
+ assert (d || !len);
+ if (!d) { return NULL; }
+ void *r = talloc (len);
+ memcpy (r, d, len);
+ return r;
+}
+
+#define DS_LVAL(x) ((x) ? *(x) : 0)
+#define DS_STR(x) ((x) ? (x)->data : NULL), ((x) ? (x)->len : 0)
+#define DS_RSTR(x) ((x) ? (x)->len : 0), ((x) ? (x)->data : NULL)
+#define DS_STR_DUP(x) memdup(((x) ? (x)->data : NULL), ((x) ? (x)->len + 1: 0))
+#define DS_BVAL(x) ((x) && ((x)->magic == CODE_bool_true))
+
+void tgl_paramed_type_free (struct paramed_type *P);
+
+#endif
diff --git a/protocols/Telegram/tgl/auto/auto-autocomplete.c b/protocols/Telegram/tgl/auto/auto-autocomplete.c
new file mode 100644
index 0000000000..e0f5d4a990
--- /dev/null
+++ b/protocols/Telegram/tgl/auto/auto-autocomplete.c
@@ -0,0 +1,29968 @@
+#ifdef _MSC_VER
+#include "..\auto.h"
+#include "..\mtproto-common.h"
+#include "auto-autocomplete.h"
+#include "..\auto-static-autocomplete.c"
+#else
+#include "auto.h"
+#include "mtproto-common.h"
+#include "auto/auto-autocomplete.h"
+#include "auto-static-autocomplete.c"
+#endif
+#include <assert.h>
+int autocomplete_constructor_account_days_t_t_l (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb8d0afdf && T->type->name != 0x472f5020)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_audio_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fc5ec4e && T->type->name != 0x603a13b1)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fc5ec4e && T->type->name != 0x603a13b1)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "duration", cur_token_real_len)) {
+ set_autocomplete_string ("duration");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "duration", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "mime_type", cur_token_real_len)) {
+ set_autocomplete_string ("mime_type");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "mime_type", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field6) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "size", cur_token_real_len)) {
+ set_autocomplete_string ("size");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "size", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field7) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "dc_id", cur_token_real_len)) {
+ set_autocomplete_string ("dc_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "dc_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field8) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_authorization (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bf2e6f6 && T->type->name != 0x840d1909)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "hash", cur_token_real_len)) {
+ set_autocomplete_string ("hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_real_len)) {
+ set_autocomplete_string ("flags");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "device_model", cur_token_real_len)) {
+ set_autocomplete_string ("device_model");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "device_model", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "platform", cur_token_real_len)) {
+ set_autocomplete_string ("platform");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "platform", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 14 && !cur_token_quoted && !memcmp (cur_token, "system_version", cur_token_real_len)) {
+ set_autocomplete_string ("system_version");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 14 && !memcmp (cur_token, "system_version", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "api_id", cur_token_real_len)) {
+ set_autocomplete_string ("api_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "api_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field6) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "app_name", cur_token_real_len)) {
+ set_autocomplete_string ("app_name");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "app_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field7) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "app_version", cur_token_real_len)) {
+ set_autocomplete_string ("app_version");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "app_version", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field8) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "date_created", cur_token_real_len)) {
+ set_autocomplete_string ("date_created");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "date_created", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field9) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "date_active", cur_token_real_len)) {
+ set_autocomplete_string ("date_active");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "date_active", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field10) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "ip", cur_token_real_len)) {
+ set_autocomplete_string ("ip");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "ip", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field11) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "country", cur_token_real_len)) {
+ set_autocomplete_string ("country");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "country", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field12) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "region", cur_token_real_len)) {
+ set_autocomplete_string ("region");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "region", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field13) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_bool_false (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x250be282 && T->type->name != 0xdaf41d7d)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_bool_true (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x250be282 && T->type->name != 0xdaf41d7d)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_bot_command (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x75e7ea6c && T->type->name != 0x8a181593)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "command", cur_token_real_len)) {
+ set_autocomplete_string ("command");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "command", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "description", cur_token_real_len)) {
+ set_autocomplete_string ("description");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "description", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_bot_command_old (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x75e7ea6c && T->type->name != 0x8a181593)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "command", cur_token_real_len)) {
+ set_autocomplete_string ("command");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "command", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "params", cur_token_real_len)) {
+ set_autocomplete_string ("params");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "params", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "description", cur_token_real_len)) {
+ set_autocomplete_string ("description");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "description", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_bot_info_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb2e16f93 && T->type->name != 0x4d1e906c)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_bot_info (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb2e16f93 && T->type->name != 0x4d1e906c)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "version", cur_token_real_len)) {
+ set_autocomplete_string ("version");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "version", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "share_text", cur_token_real_len)) {
+ set_autocomplete_string ("share_text");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "share_text", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "description", cur_token_real_len)) {
+ set_autocomplete_string ("description");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "description", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "commands", cur_token_real_len)) {
+ set_autocomplete_string ("commands");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "commands", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x75e7ea6c, .id = "BotCommand", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field5) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_bytes (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0ee1379f && T->type->name != 0xf11ec860)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_chat_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_real_len)) {
+ set_autocomplete_string ("title");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "photo", cur_token_real_len)) {
+ set_autocomplete_string ("photo");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x56922676, .id = "ChatPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_chat_photo (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 18 && !cur_token_quoted && !memcmp (cur_token, "participants_count", cur_token_real_len)) {
+ set_autocomplete_string ("participants_count");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 18 && !memcmp (cur_token, "participants_count", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "left", cur_token_real_len)) {
+ set_autocomplete_string ("left");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "left", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bool (field6) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "version", cur_token_real_len)) {
+ set_autocomplete_string ("version");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "version", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field7) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_chat_forbidden (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_real_len)) {
+ set_autocomplete_string ("title");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_geo_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_real_len)) {
+ set_autocomplete_string ("title");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "address", cur_token_real_len)) {
+ set_autocomplete_string ("address");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "address", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "venue", cur_token_real_len)) {
+ set_autocomplete_string ("venue");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "venue", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "geo", cur_token_real_len)) {
+ set_autocomplete_string ("geo");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "geo", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_geo_point (field6) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "photo", cur_token_real_len)) {
+ set_autocomplete_string ("photo");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x56922676, .id = "ChatPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_chat_photo (field7) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 18 && !cur_token_quoted && !memcmp (cur_token, "participants_count", cur_token_real_len)) {
+ set_autocomplete_string ("participants_count");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 18 && !memcmp (cur_token, "participants_count", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field8) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field9) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "checked_in", cur_token_real_len)) {
+ set_autocomplete_string ("checked_in");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "checked_in", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bool (field10) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "version", cur_token_real_len)) {
+ set_autocomplete_string ("version");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "version", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field11) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_chat_full (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02a614 && T->type->name != 0xd1fd59eb)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "participants", cur_token_real_len)) {
+ set_autocomplete_string ("participants");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "participants", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x77930f9f, .id = "ChatParticipants", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_chat_participants (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "chat_photo", cur_token_real_len)) {
+ set_autocomplete_string ("chat_photo");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "chat_photo", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_photo (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "notify_settings", cur_token_real_len)) {
+ set_autocomplete_string ("notify_settings");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "notify_settings", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_peer_notify_settings (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "exported_invite", cur_token_real_len)) {
+ set_autocomplete_string ("exported_invite");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "exported_invite", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f132d5, .id = "ExportedChatInvite", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_exported_chat_invite (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "bot_info", cur_token_real_len)) {
+ set_autocomplete_string ("bot_info");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "bot_info", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb2e16f93, .id = "BotInfo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field6) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_chat_invite_already (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x94f910b1 && T->type->name != 0x6b06ef4e)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "chat", cur_token_real_len)) {
+ set_autocomplete_string ("chat");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "chat", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_chat (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_chat_invite (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x94f910b1 && T->type->name != 0x6b06ef4e)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_real_len)) {
+ set_autocomplete_string ("title");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_chat_located (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3631cf4c && T->type->name != 0xc9ce30b3)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_real_len)) {
+ set_autocomplete_string ("chat_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "distance", cur_token_real_len)) {
+ set_autocomplete_string ("distance");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "distance", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_chat_participant (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc8d7493e && T->type->name != 0x3728b6c1)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "inviter_id", cur_token_real_len)) {
+ set_autocomplete_string ("inviter_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "inviter_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_chat_participants_forbidden (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x77930f9f && T->type->name != 0x886cf060)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_real_len)) {
+ set_autocomplete_string ("chat_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_chat_participants (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x77930f9f && T->type->name != 0x886cf060)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_real_len)) {
+ set_autocomplete_string ("chat_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "admin_id", cur_token_real_len)) {
+ set_autocomplete_string ("admin_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "admin_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "participants", cur_token_real_len)) {
+ set_autocomplete_string ("participants");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "participants", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc8d7493e, .id = "ChatParticipant", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "version", cur_token_real_len)) {
+ set_autocomplete_string ("version");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "version", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_chat_photo_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x56922676 && T->type->name != 0xa96dd989)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_chat_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x56922676 && T->type->name != 0xa96dd989)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "photo_small", cur_token_real_len)) {
+ set_autocomplete_string ("photo_small");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "photo_small", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_file_location (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "photo_big", cur_token_real_len)) {
+ set_autocomplete_string ("photo_big");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "photo_big", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_file_location (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_client_d_h_inner_data (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6643b654 && T->type->name != 0x99bc49ab)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "nonce", cur_token_real_len)) {
+ set_autocomplete_string ("nonce");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "server_nonce", cur_token_real_len)) {
+ set_autocomplete_string ("server_nonce");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "server_nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "retry_id", cur_token_real_len)) {
+ set_autocomplete_string ("retry_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "retry_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "g_b", cur_token_real_len)) {
+ set_autocomplete_string ("g_b");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "g_b", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_config (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e32b894 && T->type->name != 0xb1cd476b)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "expires", cur_token_real_len)) {
+ set_autocomplete_string ("expires");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "expires", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "test_mode", cur_token_real_len)) {
+ set_autocomplete_string ("test_mode");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "test_mode", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bool (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "this_dc", cur_token_real_len)) {
+ set_autocomplete_string ("this_dc");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "this_dc", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "dc_options", cur_token_real_len)) {
+ set_autocomplete_string ("dc_options");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "dc_options", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2b1a62f0, .id = "DcOption", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 13 && !cur_token_quoted && !memcmp (cur_token, "chat_size_max", cur_token_real_len)) {
+ set_autocomplete_string ("chat_size_max");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 13 && !memcmp (cur_token, "chat_size_max", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field6) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 18 && !cur_token_quoted && !memcmp (cur_token, "broadcast_size_max", cur_token_real_len)) {
+ set_autocomplete_string ("broadcast_size_max");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 18 && !memcmp (cur_token, "broadcast_size_max", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field7) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 19 && !cur_token_quoted && !memcmp (cur_token, "forwarded_count_max", cur_token_real_len)) {
+ set_autocomplete_string ("forwarded_count_max");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 19 && !memcmp (cur_token, "forwarded_count_max", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field8) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 23 && !cur_token_quoted && !memcmp (cur_token, "online_update_period_ms", cur_token_real_len)) {
+ set_autocomplete_string ("online_update_period_ms");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 23 && !memcmp (cur_token, "online_update_period_ms", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field9) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 23 && !cur_token_quoted && !memcmp (cur_token, "offline_blur_timeout_ms", cur_token_real_len)) {
+ set_autocomplete_string ("offline_blur_timeout_ms");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 23 && !memcmp (cur_token, "offline_blur_timeout_ms", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field10) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 23 && !cur_token_quoted && !memcmp (cur_token, "offline_idle_timeout_ms", cur_token_real_len)) {
+ set_autocomplete_string ("offline_idle_timeout_ms");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 23 && !memcmp (cur_token, "offline_idle_timeout_ms", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field11) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 23 && !cur_token_quoted && !memcmp (cur_token, "online_cloud_timeout_ms", cur_token_real_len)) {
+ set_autocomplete_string ("online_cloud_timeout_ms");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 23 && !memcmp (cur_token, "online_cloud_timeout_ms", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field12) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 21 && !cur_token_quoted && !memcmp (cur_token, "notify_cloud_delay_ms", cur_token_real_len)) {
+ set_autocomplete_string ("notify_cloud_delay_ms");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 21 && !memcmp (cur_token, "notify_cloud_delay_ms", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field13) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 23 && !cur_token_quoted && !memcmp (cur_token, "notify_default_delay_ms", cur_token_real_len)) {
+ set_autocomplete_string ("notify_default_delay_ms");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 23 && !memcmp (cur_token, "notify_default_delay_ms", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field14) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 13 && !cur_token_quoted && !memcmp (cur_token, "chat_big_size", cur_token_real_len)) {
+ set_autocomplete_string ("chat_big_size");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 13 && !memcmp (cur_token, "chat_big_size", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field15 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field15) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 19 && !cur_token_quoted && !memcmp (cur_token, "push_chat_period_ms", cur_token_real_len)) {
+ set_autocomplete_string ("push_chat_period_ms");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 19 && !memcmp (cur_token, "push_chat_period_ms", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field16 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field16) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "push_chat_limit", cur_token_real_len)) {
+ set_autocomplete_string ("push_chat_limit");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "push_chat_limit", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field17 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field17) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 17 && !cur_token_quoted && !memcmp (cur_token, "disabled_features", cur_token_real_len)) {
+ set_autocomplete_string ("disabled_features");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 17 && !memcmp (cur_token, "disabled_features", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field18 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xae636f24, .id = "DisabledFeature", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field18) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf911c994 && T->type->name != 0x06ee366b)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "mutual", cur_token_real_len)) {
+ set_autocomplete_string ("mutual");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "mutual", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bool (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_contact_blocked (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x561bc879 && T->type->name != 0xa9e43786)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_contact_found (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xea879f95 && T->type->name != 0x1578606a)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_contact_link_unknown (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_contact_link_none (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_contact_link_has_phone (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_contact_link_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_contact_status (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd3680c61 && T->type->name != 0x2c97f39e)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "status", cur_token_real_len)) {
+ set_autocomplete_string ("status");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "status", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x76de9570, .id = "UserStatus", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_user_status (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_contact_suggested (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3de191a1 && T->type->name != 0xc21e6e5e)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "mutual_contacts", cur_token_real_len)) {
+ set_autocomplete_string ("mutual_contacts");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "mutual_contacts", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_dc_option_l28 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2b1a62f0 && T->type->name != 0xd4e59d0f)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "hostname", cur_token_real_len)) {
+ set_autocomplete_string ("hostname");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "hostname", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "ip_address", cur_token_real_len)) {
+ set_autocomplete_string ("ip_address");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "ip_address", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "port", cur_token_real_len)) {
+ set_autocomplete_string ("port");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "port", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_dc_option (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2b1a62f0 && T->type->name != 0xd4e59d0f)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_real_len)) {
+ set_autocomplete_string ("flags");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "ip_address", cur_token_real_len)) {
+ set_autocomplete_string ("ip_address");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "ip_address", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "port", cur_token_real_len)) {
+ set_autocomplete_string ("port");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "port", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_decrypted_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x535b7918 && T->type->name != 0xaca486e7)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_real_len)) {
+ set_autocomplete_string ("random_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "ttl", cur_token_real_len)) {
+ set_autocomplete_string ("ttl");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "ttl", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_real_len)) {
+ set_autocomplete_string ("message");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "media", cur_token_real_len)) {
+ set_autocomplete_string ("media");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "media", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x34e0d674, .id = "DecryptedMessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_decrypted_message_media (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_decrypted_message_service (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x535b7918 && T->type->name != 0xaca486e7)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_real_len)) {
+ set_autocomplete_string ("random_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "action", cur_token_real_len)) {
+ set_autocomplete_string ("action");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "action", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4e0eefde, .id = "DecryptedMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_decrypted_message_action (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_decrypted_message_action_set_message_t_t_l (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "ttl_seconds", cur_token_real_len)) {
+ set_autocomplete_string ("ttl_seconds");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "ttl_seconds", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_decrypted_message_action_read_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "random_ids", cur_token_real_len)) {
+ set_autocomplete_string ("random_ids");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "random_ids", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_decrypted_message_action_delete_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "random_ids", cur_token_real_len)) {
+ set_autocomplete_string ("random_ids");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "random_ids", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_decrypted_message_action_screenshot_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "random_ids", cur_token_real_len)) {
+ set_autocomplete_string ("random_ids");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "random_ids", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_decrypted_message_action_flush_history (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_decrypted_message_action_resend (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "start_seq_no", cur_token_real_len)) {
+ set_autocomplete_string ("start_seq_no");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "start_seq_no", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "end_seq_no", cur_token_real_len)) {
+ set_autocomplete_string ("end_seq_no");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "end_seq_no", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_decrypted_message_action_notify_layer (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "layer", cur_token_real_len)) {
+ set_autocomplete_string ("layer");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "layer", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_decrypted_message_action_typing (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "action", cur_token_real_len)) {
+ set_autocomplete_string ("action");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "action", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x70541c7e, .id = "SendMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_send_message_action (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_decrypted_message_action_request_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "exchange_id", cur_token_real_len)) {
+ set_autocomplete_string ("exchange_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "exchange_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "g_a", cur_token_real_len)) {
+ set_autocomplete_string ("g_a");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "g_a", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_decrypted_message_action_accept_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "exchange_id", cur_token_real_len)) {
+ set_autocomplete_string ("exchange_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "exchange_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "g_b", cur_token_real_len)) {
+ set_autocomplete_string ("g_b");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "g_b", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "key_fingerprint", cur_token_real_len)) {
+ set_autocomplete_string ("key_fingerprint");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "key_fingerprint", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_decrypted_message_action_abort_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "exchange_id", cur_token_real_len)) {
+ set_autocomplete_string ("exchange_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "exchange_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_decrypted_message_action_commit_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "exchange_id", cur_token_real_len)) {
+ set_autocomplete_string ("exchange_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "exchange_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "key_fingerprint", cur_token_real_len)) {
+ set_autocomplete_string ("key_fingerprint");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "key_fingerprint", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_decrypted_message_action_noop (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_decrypted_message_layer (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1be31789 && T->type->name != 0xe41ce876)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "random_bytes", cur_token_real_len)) {
+ set_autocomplete_string ("random_bytes");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "random_bytes", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "layer", cur_token_real_len)) {
+ set_autocomplete_string ("layer");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "layer", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "in_seq_no", cur_token_real_len)) {
+ set_autocomplete_string ("in_seq_no");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "in_seq_no", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "out_seq_no", cur_token_real_len)) {
+ set_autocomplete_string ("out_seq_no");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "out_seq_no", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_real_len)) {
+ set_autocomplete_string ("message");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x535b7918, .id = "DecryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_decrypted_message (field5) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_decrypted_message_media_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_decrypted_message_media_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "str_thumb", cur_token_real_len)) {
+ set_autocomplete_string ("str_thumb");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "str_thumb", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "thumb_w", cur_token_real_len)) {
+ set_autocomplete_string ("thumb_w");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "thumb_w", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "thumb_h", cur_token_real_len)) {
+ set_autocomplete_string ("thumb_h");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "thumb_h", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "w", cur_token_real_len)) {
+ set_autocomplete_string ("w");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "w", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "h", cur_token_real_len)) {
+ set_autocomplete_string ("h");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "h", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "size", cur_token_real_len)) {
+ set_autocomplete_string ("size");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "size", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field6) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "key", cur_token_real_len)) {
+ set_autocomplete_string ("key");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "key", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field7) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "iv", cur_token_real_len)) {
+ set_autocomplete_string ("iv");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "iv", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field8) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_decrypted_message_media_geo_point (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "latitude", cur_token_real_len)) {
+ set_autocomplete_string ("latitude");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "latitude", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_double (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "longitude", cur_token_real_len)) {
+ set_autocomplete_string ("longitude");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "longitude", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_double (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_decrypted_message_media_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "phone_number", cur_token_real_len)) {
+ set_autocomplete_string ("phone_number");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "phone_number", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "first_name", cur_token_real_len)) {
+ set_autocomplete_string ("first_name");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "first_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "last_name", cur_token_real_len)) {
+ set_autocomplete_string ("last_name");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "last_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_decrypted_message_media_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "str_thumb", cur_token_real_len)) {
+ set_autocomplete_string ("str_thumb");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "str_thumb", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "thumb_w", cur_token_real_len)) {
+ set_autocomplete_string ("thumb_w");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "thumb_w", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "thumb_h", cur_token_real_len)) {
+ set_autocomplete_string ("thumb_h");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "thumb_h", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "file_name", cur_token_real_len)) {
+ set_autocomplete_string ("file_name");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "file_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "mime_type", cur_token_real_len)) {
+ set_autocomplete_string ("mime_type");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "mime_type", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "size", cur_token_real_len)) {
+ set_autocomplete_string ("size");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "size", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field6) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "key", cur_token_real_len)) {
+ set_autocomplete_string ("key");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "key", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field7) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "iv", cur_token_real_len)) {
+ set_autocomplete_string ("iv");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "iv", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field8) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_decrypted_message_media_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "str_thumb", cur_token_real_len)) {
+ set_autocomplete_string ("str_thumb");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "str_thumb", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "thumb_w", cur_token_real_len)) {
+ set_autocomplete_string ("thumb_w");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "thumb_w", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "thumb_h", cur_token_real_len)) {
+ set_autocomplete_string ("thumb_h");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "thumb_h", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "duration", cur_token_real_len)) {
+ set_autocomplete_string ("duration");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "duration", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "mime_type", cur_token_real_len)) {
+ set_autocomplete_string ("mime_type");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "mime_type", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "w", cur_token_real_len)) {
+ set_autocomplete_string ("w");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "w", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field6) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "h", cur_token_real_len)) {
+ set_autocomplete_string ("h");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "h", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field7) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "size", cur_token_real_len)) {
+ set_autocomplete_string ("size");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "size", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field8) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "key", cur_token_real_len)) {
+ set_autocomplete_string ("key");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "key", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field9) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "iv", cur_token_real_len)) {
+ set_autocomplete_string ("iv");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "iv", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field10) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_decrypted_message_media_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "duration", cur_token_real_len)) {
+ set_autocomplete_string ("duration");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "duration", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "mime_type", cur_token_real_len)) {
+ set_autocomplete_string ("mime_type");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "mime_type", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "size", cur_token_real_len)) {
+ set_autocomplete_string ("size");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "size", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "key", cur_token_real_len)) {
+ set_autocomplete_string ("key");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "key", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "iv", cur_token_real_len)) {
+ set_autocomplete_string ("iv");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "iv", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field5) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_decrypted_message_media_external_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "mime_type", cur_token_real_len)) {
+ set_autocomplete_string ("mime_type");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "mime_type", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "size", cur_token_real_len)) {
+ set_autocomplete_string ("size");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "size", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "thumb", cur_token_real_len)) {
+ set_autocomplete_string ("thumb");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "thumb", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_photo_size (field6) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "dc_id", cur_token_real_len)) {
+ set_autocomplete_string ("dc_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "dc_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field7) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "attributes", cur_token_real_len)) {
+ set_autocomplete_string ("attributes");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "attributes", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field8) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_decrypted_message_media_video_l12 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "str_thumb", cur_token_real_len)) {
+ set_autocomplete_string ("str_thumb");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "str_thumb", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "thumb_w", cur_token_real_len)) {
+ set_autocomplete_string ("thumb_w");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "thumb_w", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "thumb_h", cur_token_real_len)) {
+ set_autocomplete_string ("thumb_h");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "thumb_h", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "duration", cur_token_real_len)) {
+ set_autocomplete_string ("duration");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "duration", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "w", cur_token_real_len)) {
+ set_autocomplete_string ("w");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "w", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "h", cur_token_real_len)) {
+ set_autocomplete_string ("h");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "h", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field6) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "size", cur_token_real_len)) {
+ set_autocomplete_string ("size");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "size", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field7) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "key", cur_token_real_len)) {
+ set_autocomplete_string ("key");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "key", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field8) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "iv", cur_token_real_len)) {
+ set_autocomplete_string ("iv");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "iv", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field9) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_decrypted_message_media_audio_l12 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "duration", cur_token_real_len)) {
+ set_autocomplete_string ("duration");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "duration", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "size", cur_token_real_len)) {
+ set_autocomplete_string ("size");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "size", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "key", cur_token_real_len)) {
+ set_autocomplete_string ("key");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "key", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "iv", cur_token_real_len)) {
+ set_autocomplete_string ("iv");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "iv", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_dialog (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc1dd804a && T->type->name != 0x3e227fb5)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_peer (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "top_message", cur_token_real_len)) {
+ set_autocomplete_string ("top_message");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "top_message", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 17 && !cur_token_quoted && !memcmp (cur_token, "read_inbox_max_id", cur_token_real_len)) {
+ set_autocomplete_string ("read_inbox_max_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 17 && !memcmp (cur_token, "read_inbox_max_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "unread_count", cur_token_real_len)) {
+ set_autocomplete_string ("unread_count");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "unread_count", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "notify_settings", cur_token_real_len)) {
+ set_autocomplete_string ("notify_settings");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "notify_settings", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_peer_notify_settings (field5) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_disabled_feature (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xae636f24 && T->type->name != 0x519c90db)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "feature", cur_token_real_len)) {
+ set_autocomplete_string ("feature");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "feature", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "description", cur_token_real_len)) {
+ set_autocomplete_string ("description");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "description", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_document_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x51a73418 && T->type->name != 0xae58cbe7)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x51a73418 && T->type->name != 0xae58cbe7)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "mime_type", cur_token_real_len)) {
+ set_autocomplete_string ("mime_type");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "mime_type", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "size", cur_token_real_len)) {
+ set_autocomplete_string ("size");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "size", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "thumb", cur_token_real_len)) {
+ set_autocomplete_string ("thumb");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "thumb", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_photo_size (field6) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "dc_id", cur_token_real_len)) {
+ set_autocomplete_string ("dc_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "dc_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field7) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "attributes", cur_token_real_len)) {
+ set_autocomplete_string ("attributes");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "attributes", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field8) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_document_l19 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x51a73418 && T->type->name != 0xae58cbe7)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "file_name", cur_token_real_len)) {
+ set_autocomplete_string ("file_name");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "file_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "mime_type", cur_token_real_len)) {
+ set_autocomplete_string ("mime_type");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "mime_type", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field6) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "size", cur_token_real_len)) {
+ set_autocomplete_string ("size");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "size", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field7) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "thumb", cur_token_real_len)) {
+ set_autocomplete_string ("thumb");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "thumb", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_photo_size (field8) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "dc_id", cur_token_real_len)) {
+ set_autocomplete_string ("dc_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "dc_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field9) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_document_attribute_image_size (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "w", cur_token_real_len)) {
+ set_autocomplete_string ("w");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "w", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "h", cur_token_real_len)) {
+ set_autocomplete_string ("h");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "h", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_document_attribute_animated (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_document_attribute_sticker_l28 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "alt", cur_token_real_len)) {
+ set_autocomplete_string ("alt");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "alt", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_document_attribute_sticker (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "alt", cur_token_real_len)) {
+ set_autocomplete_string ("alt");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "alt", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "stickerset", cur_token_real_len)) {
+ set_autocomplete_string ("stickerset");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "stickerset", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe44d415c, .id = "InputStickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_sticker_set (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_document_attribute_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "duration", cur_token_real_len)) {
+ set_autocomplete_string ("duration");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "duration", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "w", cur_token_real_len)) {
+ set_autocomplete_string ("w");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "w", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "h", cur_token_real_len)) {
+ set_autocomplete_string ("h");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "h", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_document_attribute_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "duration", cur_token_real_len)) {
+ set_autocomplete_string ("duration");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "duration", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_document_attribute_filename (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "file_name", cur_token_real_len)) {
+ set_autocomplete_string ("file_name");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "file_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_double (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2210c154 && T->type->name != 0xddef3eab)) { return -1; }
+ if (is_double ()) {
+ local_next_token ();
+ return 0;
+ } else {
+ return -1;
+ }
+}
+int autocomplete_constructor_encrypted_chat_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_encrypted_chat_waiting (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "admin_id", cur_token_real_len)) {
+ set_autocomplete_string ("admin_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "admin_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 14 && !cur_token_quoted && !memcmp (cur_token, "participant_id", cur_token_real_len)) {
+ set_autocomplete_string ("participant_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 14 && !memcmp (cur_token, "participant_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_encrypted_chat_requested (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "admin_id", cur_token_real_len)) {
+ set_autocomplete_string ("admin_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "admin_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 14 && !cur_token_quoted && !memcmp (cur_token, "participant_id", cur_token_real_len)) {
+ set_autocomplete_string ("participant_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 14 && !memcmp (cur_token, "participant_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "g_a", cur_token_real_len)) {
+ set_autocomplete_string ("g_a");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "g_a", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field6) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_encrypted_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "admin_id", cur_token_real_len)) {
+ set_autocomplete_string ("admin_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "admin_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 14 && !cur_token_quoted && !memcmp (cur_token, "participant_id", cur_token_real_len)) {
+ set_autocomplete_string ("participant_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 14 && !memcmp (cur_token, "participant_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "g_a_or_b", cur_token_real_len)) {
+ set_autocomplete_string ("g_a_or_b");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "g_a_or_b", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field6) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "key_fingerprint", cur_token_real_len)) {
+ set_autocomplete_string ("key_fingerprint");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "key_fingerprint", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field7) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_encrypted_chat_discarded (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_encrypted_file_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x886fd032 && T->type->name != 0x77902fcd)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_encrypted_file (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x886fd032 && T->type->name != 0x77902fcd)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "size", cur_token_real_len)) {
+ set_autocomplete_string ("size");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "size", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "dc_id", cur_token_real_len)) {
+ set_autocomplete_string ("dc_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "dc_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "key_fingerprint", cur_token_real_len)) {
+ set_autocomplete_string ("key_fingerprint");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "key_fingerprint", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_encrypted_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xce6b8a1e && T->type->name != 0x319475e1)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_real_len)) {
+ set_autocomplete_string ("random_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_real_len)) {
+ set_autocomplete_string ("chat_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "bytes", cur_token_real_len)) {
+ set_autocomplete_string ("bytes");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "bytes", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "file", cur_token_real_len)) {
+ set_autocomplete_string ("file");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "file", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x886fd032, .id = "EncryptedFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_encrypted_file (field5) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_encrypted_message_service (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xce6b8a1e && T->type->name != 0x319475e1)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_real_len)) {
+ set_autocomplete_string ("random_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_real_len)) {
+ set_autocomplete_string ("chat_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "bytes", cur_token_real_len)) {
+ set_autocomplete_string ("bytes");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "bytes", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_error (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc4b9f9bb && T->type->name != 0x3b460644)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "code", cur_token_real_len)) {
+ set_autocomplete_string ("code");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "code", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "text", cur_token_real_len)) {
+ set_autocomplete_string ("text");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "text", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_chat_invite_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f132d5 && T->type->name != 0x6a0ecd2a)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_chat_invite_exported (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f132d5 && T->type->name != 0x6a0ecd2a)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "link", cur_token_real_len)) {
+ set_autocomplete_string ("link");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "link", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_file_location_unavailable (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2f8ffb30 && T->type->name != 0xd07004cf)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "volume_id", cur_token_real_len)) {
+ set_autocomplete_string ("volume_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "volume_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "local_id", cur_token_real_len)) {
+ set_autocomplete_string ("local_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "local_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "secret", cur_token_real_len)) {
+ set_autocomplete_string ("secret");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "secret", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2f8ffb30 && T->type->name != 0xd07004cf)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "dc_id", cur_token_real_len)) {
+ set_autocomplete_string ("dc_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "dc_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "volume_id", cur_token_real_len)) {
+ set_autocomplete_string ("volume_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "volume_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "local_id", cur_token_real_len)) {
+ set_autocomplete_string ("local_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "local_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "secret", cur_token_real_len)) {
+ set_autocomplete_string ("secret");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "secret", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_geo_chat_message_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf67b4034 && T->type->name != 0x0984bfcb)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_real_len)) {
+ set_autocomplete_string ("chat_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_geo_chat_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf67b4034 && T->type->name != 0x0984bfcb)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_real_len)) {
+ set_autocomplete_string ("chat_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "from_id", cur_token_real_len)) {
+ set_autocomplete_string ("from_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "from_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_real_len)) {
+ set_autocomplete_string ("message");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "media", cur_token_real_len)) {
+ set_autocomplete_string ("media");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "media", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_message_media (field6) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_geo_chat_message_service (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf67b4034 && T->type->name != 0x0984bfcb)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_real_len)) {
+ set_autocomplete_string ("chat_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "from_id", cur_token_real_len)) {
+ set_autocomplete_string ("from_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "from_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "action", cur_token_real_len)) {
+ set_autocomplete_string ("action");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "action", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x383415fa, .id = "MessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_message_action (field5) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_geo_point_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x315e0a53 && T->type->name != 0xcea1f5ac)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_geo_point (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x315e0a53 && T->type->name != 0xcea1f5ac)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "longitude", cur_token_real_len)) {
+ set_autocomplete_string ("longitude");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "longitude", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_double (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "latitude", cur_token_real_len)) {
+ set_autocomplete_string ("latitude");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "latitude", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_double (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_imported_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd0028438 && T->type->name != 0x2ffd7bc7)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "client_id", cur_token_real_len)) {
+ set_autocomplete_string ("client_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "client_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_app_event (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x770656a8 && T->type->name != 0x88f9a957)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "time", cur_token_real_len)) {
+ set_autocomplete_string ("time");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "time", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_double (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "type", cur_token_real_len)) {
+ set_autocomplete_string ("type");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "type", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "data", cur_token_real_len)) {
+ set_autocomplete_string ("data");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "data", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_audio_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xae8e9c7b && T->type->name != 0x51716384)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xae8e9c7b && T->type->name != 0x51716384)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_chat_photo_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3a60776d && T->type->name != 0xc59f8892)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_chat_uploaded_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3a60776d && T->type->name != 0xc59f8892)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "file", cur_token_real_len)) {
+ set_autocomplete_string ("file");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "file", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_file (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "crop", cur_token_real_len)) {
+ set_autocomplete_string ("crop");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "crop", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7477e321, .id = "InputPhotoCrop", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_photo_crop (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_chat_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3a60776d && T->type->name != 0xc59f8892)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe74279c9, .id = "InputPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_photo (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "crop", cur_token_real_len)) {
+ set_autocomplete_string ("crop");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "crop", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7477e321, .id = "InputPhotoCrop", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_photo_crop (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_phone_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf392b7f4 && T->type->name != 0x0c6d480b)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "client_id", cur_token_real_len)) {
+ set_autocomplete_string ("client_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "client_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "phone", cur_token_real_len)) {
+ set_autocomplete_string ("phone");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "phone", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "first_name", cur_token_real_len)) {
+ set_autocomplete_string ("first_name");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "first_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "last_name", cur_token_real_len)) {
+ set_autocomplete_string ("last_name");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "last_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_document_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6a8963fc && T->type->name != 0x95769c03)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6a8963fc && T->type->name != 0x95769c03)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_encrypted_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf141b5e1 && T->type->name != 0x0ebe4a1e)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_real_len)) {
+ set_autocomplete_string ("chat_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_encrypted_file_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_encrypted_file_uploaded (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "parts", cur_token_real_len)) {
+ set_autocomplete_string ("parts");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "parts", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "md5_checksum", cur_token_real_len)) {
+ set_autocomplete_string ("md5_checksum");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "md5_checksum", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "key_fingerprint", cur_token_real_len)) {
+ set_autocomplete_string ("key_fingerprint");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "key_fingerprint", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_encrypted_file (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_encrypted_file_big_uploaded (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "parts", cur_token_real_len)) {
+ set_autocomplete_string ("parts");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "parts", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "key_fingerprint", cur_token_real_len)) {
+ set_autocomplete_string ("key_fingerprint");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "key_fingerprint", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_file (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0f60f9ca && T->type->name != 0xf09f0635)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "parts", cur_token_real_len)) {
+ set_autocomplete_string ("parts");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "parts", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "name", cur_token_real_len)) {
+ set_autocomplete_string ("name");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "name", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "md5_checksum", cur_token_real_len)) {
+ set_autocomplete_string ("md5_checksum");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "md5_checksum", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_file_big (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0f60f9ca && T->type->name != 0xf09f0635)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "parts", cur_token_real_len)) {
+ set_autocomplete_string ("parts");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "parts", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "name", cur_token_real_len)) {
+ set_autocomplete_string ("name");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "name", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "volume_id", cur_token_real_len)) {
+ set_autocomplete_string ("volume_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "volume_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "local_id", cur_token_real_len)) {
+ set_autocomplete_string ("local_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "local_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "secret", cur_token_real_len)) {
+ set_autocomplete_string ("secret");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "secret", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_video_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_encrypted_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_audio_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_document_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_geo_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x74d456fa && T->type->name != 0x8b2ba905)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_real_len)) {
+ set_autocomplete_string ("chat_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_geo_point_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17768f1f && T->type->name != 0xe88970e0)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_geo_point (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17768f1f && T->type->name != 0xe88970e0)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "latitude", cur_token_real_len)) {
+ set_autocomplete_string ("latitude");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "latitude", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_double (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "longitude", cur_token_real_len)) {
+ set_autocomplete_string ("longitude");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "longitude", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_double (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_media_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_media_uploaded_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "file", cur_token_real_len)) {
+ set_autocomplete_string ("file");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "file", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_file (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "caption", cur_token_real_len)) {
+ set_autocomplete_string ("caption");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "caption", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_media_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe74279c9, .id = "InputPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_photo (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "caption", cur_token_real_len)) {
+ set_autocomplete_string ("caption");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "caption", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_media_geo_point (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "geo_point", cur_token_real_len)) {
+ set_autocomplete_string ("geo_point");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "geo_point", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17768f1f, .id = "InputGeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_geo_point (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_media_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "phone_number", cur_token_real_len)) {
+ set_autocomplete_string ("phone_number");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "phone_number", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "first_name", cur_token_real_len)) {
+ set_autocomplete_string ("first_name");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "first_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "last_name", cur_token_real_len)) {
+ set_autocomplete_string ("last_name");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "last_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_media_uploaded_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "file", cur_token_real_len)) {
+ set_autocomplete_string ("file");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "file", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_file (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "duration", cur_token_real_len)) {
+ set_autocomplete_string ("duration");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "duration", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "w", cur_token_real_len)) {
+ set_autocomplete_string ("w");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "w", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "h", cur_token_real_len)) {
+ set_autocomplete_string ("h");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "h", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "caption", cur_token_real_len)) {
+ set_autocomplete_string ("caption");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "caption", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field5) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_media_uploaded_thumb_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "file", cur_token_real_len)) {
+ set_autocomplete_string ("file");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "file", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_file (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "thumb", cur_token_real_len)) {
+ set_autocomplete_string ("thumb");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "thumb", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_file (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "duration", cur_token_real_len)) {
+ set_autocomplete_string ("duration");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "duration", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "w", cur_token_real_len)) {
+ set_autocomplete_string ("w");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "w", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "h", cur_token_real_len)) {
+ set_autocomplete_string ("h");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "h", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "caption", cur_token_real_len)) {
+ set_autocomplete_string ("caption");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "caption", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field6) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_media_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "video_id", cur_token_real_len)) {
+ set_autocomplete_string ("video_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "video_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xbb5f7a27, .id = "InputVideo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_video (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "caption", cur_token_real_len)) {
+ set_autocomplete_string ("caption");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "caption", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_media_uploaded_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "file", cur_token_real_len)) {
+ set_autocomplete_string ("file");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "file", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_file (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "duration", cur_token_real_len)) {
+ set_autocomplete_string ("duration");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "duration", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "mime_type", cur_token_real_len)) {
+ set_autocomplete_string ("mime_type");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "mime_type", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_media_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "audio_id", cur_token_real_len)) {
+ set_autocomplete_string ("audio_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "audio_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xae8e9c7b, .id = "InputAudio", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_audio (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_media_uploaded_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "file", cur_token_real_len)) {
+ set_autocomplete_string ("file");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "file", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_file (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "mime_type", cur_token_real_len)) {
+ set_autocomplete_string ("mime_type");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "mime_type", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "attributes", cur_token_real_len)) {
+ set_autocomplete_string ("attributes");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "attributes", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_media_uploaded_thumb_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "file", cur_token_real_len)) {
+ set_autocomplete_string ("file");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "file", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_file (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "thumb", cur_token_real_len)) {
+ set_autocomplete_string ("thumb");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "thumb", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_file (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "mime_type", cur_token_real_len)) {
+ set_autocomplete_string ("mime_type");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "mime_type", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "attributes", cur_token_real_len)) {
+ set_autocomplete_string ("attributes");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "attributes", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_media_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "document_id", cur_token_real_len)) {
+ set_autocomplete_string ("document_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "document_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x6a8963fc, .id = "InputDocument", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_document (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_media_venue (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "geo_point", cur_token_real_len)) {
+ set_autocomplete_string ("geo_point");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "geo_point", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17768f1f, .id = "InputGeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_geo_point (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_real_len)) {
+ set_autocomplete_string ("title");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "address", cur_token_real_len)) {
+ set_autocomplete_string ("address");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "address", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "provider", cur_token_real_len)) {
+ set_autocomplete_string ("provider");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "provider", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "venue_id", cur_token_real_len)) {
+ set_autocomplete_string ("venue_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "venue_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field5) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_notify_peer (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9e67268d, .id = "InputPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_peer (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_notify_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_notify_chats (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_notify_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_notify_geo_chat_peer (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "geo_peer", cur_token_real_len)) {
+ set_autocomplete_string ("geo_peer");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "geo_peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x74d456fa, .id = "InputGeoChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_geo_chat (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_peer_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_peer_self (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_peer_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_peer_foreign (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_peer_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_real_len)) {
+ set_autocomplete_string ("chat_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_peer_notify_events_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x185a48ac && T->type->name != 0xe7a5b753)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_peer_notify_events_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x185a48ac && T->type->name != 0xe7a5b753)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_peer_notify_settings (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x46a2ce98 && T->type->name != 0xb95d3167)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "mute_until", cur_token_real_len)) {
+ set_autocomplete_string ("mute_until");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "mute_until", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "sound", cur_token_real_len)) {
+ set_autocomplete_string ("sound");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "sound", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 13 && !cur_token_quoted && !memcmp (cur_token, "show_previews", cur_token_real_len)) {
+ set_autocomplete_string ("show_previews");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 13 && !memcmp (cur_token, "show_previews", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bool (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "events_mask", cur_token_real_len)) {
+ set_autocomplete_string ("events_mask");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "events_mask", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_photo_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe74279c9 && T->type->name != 0x18bd8636)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe74279c9 && T->type->name != 0x18bd8636)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_photo_crop_auto (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7477e321 && T->type->name != 0x8b881cde)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_photo_crop (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7477e321 && T->type->name != 0x8b881cde)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "crop_left", cur_token_real_len)) {
+ set_autocomplete_string ("crop_left");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "crop_left", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_double (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "crop_top", cur_token_real_len)) {
+ set_autocomplete_string ("crop_top");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "crop_top", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_double (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "crop_width", cur_token_real_len)) {
+ set_autocomplete_string ("crop_width");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "crop_width", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_double (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_privacy_key_status_timestamp (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4f96cb18 && T->type->name != 0xb06934e7)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_privacy_value_allow_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_privacy_value_allow_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_privacy_value_allow_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_privacy_value_disallow_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_privacy_value_disallow_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_privacy_value_disallow_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_sticker_set_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe44d415c && T->type->name != 0x1bb2bea3)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_sticker_set_i_d (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe44d415c && T->type->name != 0x1bb2bea3)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_sticker_set_short_name (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe44d415c && T->type->name != 0x1bb2bea3)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "short_name", cur_token_real_len)) {
+ set_autocomplete_string ("short_name");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "short_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_user_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_user_self (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_user_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_user_foreign (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_video_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbb5f7a27 && T->type->name != 0x44a085d8)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbb5f7a27 && T->type->name != 0x44a085d8)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_int (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8509bda && T->type->name != 0x57af6425)) { return -1; }
+ if (is_int ()) {
+ local_next_token ();
+ return 0;
+ } else {
+ return -1;
+ }
+}
+int autocomplete_constructor_int128 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7d36c439 && T->type->name != 0x82c93bc6)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_int256 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf2c798b3 && T->type->name != 0x0d38674c)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_keyboard_button (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa2fa4880 && T->type->name != 0x5d05b77f)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_keyboard_button_row (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x77608b83 && T->type->name != 0x889f747c)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa2fa4880, .id = "KeyboardButton", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_long (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22076cba && T->type->name != 0xddf89345)) { return -1; }
+ if (is_int ()) {
+ local_next_token ();
+ return 0;
+ } else {
+ return -1;
+ }
+}
+int autocomplete_constructor_message_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5d652a7f && T->type->name != 0xa29ad580)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5d652a7f && T->type->name != 0xa29ad580)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_real_len)) {
+ set_autocomplete_string ("flags");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ if (cur_token_len < 0) { return -1; }
+ if (!is_int ()) { return -1;}
+ struct paramed_type *var0 = INT2PTR (get_int ());
+ assert (var0);
+ local_next_token ();
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "from_id", cur_token_real_len)) {
+ set_autocomplete_string ("from_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "from_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "to_id", cur_token_real_len)) {
+ set_autocomplete_string ("to_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "to_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_peer (field4) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "fwd_from_id", cur_token_real_len)) {
+ set_autocomplete_string ("fwd_from_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "fwd_from_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "fwd_date", cur_token_real_len)) {
+ set_autocomplete_string ("fwd_date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "fwd_date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field6) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "reply_to_msg_id", cur_token_real_len)) {
+ set_autocomplete_string ("reply_to_msg_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "reply_to_msg_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field7) < 0) { return -1;}
+ }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field8) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_real_len)) {
+ set_autocomplete_string ("message");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field9) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "media", cur_token_real_len)) {
+ set_autocomplete_string ("media");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "media", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_message_media (field10) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 6)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "reply_markup", cur_token_real_len)) {
+ set_autocomplete_string ("reply_markup");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "reply_markup", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x612ca4a9, .id = "ReplyMarkup", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_reply_markup (field11) < 0) { return -1;}
+ }
+ return 0;
+}
+int autocomplete_constructor_message_service (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5d652a7f && T->type->name != 0xa29ad580)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_real_len)) {
+ set_autocomplete_string ("flags");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "from_id", cur_token_real_len)) {
+ set_autocomplete_string ("from_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "from_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "to_id", cur_token_real_len)) {
+ set_autocomplete_string ("to_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "to_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_peer (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "action", cur_token_real_len)) {
+ set_autocomplete_string ("action");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "action", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x383415fa, .id = "MessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_message_action (field6) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_message_action_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_message_action_chat_create (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_real_len)) {
+ set_autocomplete_string ("title");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_message_action_chat_edit_title (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_real_len)) {
+ set_autocomplete_string ("title");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_message_action_chat_edit_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "photo", cur_token_real_len)) {
+ set_autocomplete_string ("photo");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_photo (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_message_action_chat_delete_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_message_action_chat_add_user (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_message_action_chat_delete_user (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_message_action_geo_chat_create (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_real_len)) {
+ set_autocomplete_string ("title");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "address", cur_token_real_len)) {
+ set_autocomplete_string ("address");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "address", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_message_action_geo_chat_checkin (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_message_action_chat_joined_by_link (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "inviter_id", cur_token_real_len)) {
+ set_autocomplete_string ("inviter_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "inviter_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_message_media_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_message_media_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "photo", cur_token_real_len)) {
+ set_autocomplete_string ("photo");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_photo (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "caption", cur_token_real_len)) {
+ set_autocomplete_string ("caption");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "caption", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_message_media_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "video", cur_token_real_len)) {
+ set_autocomplete_string ("video");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "video", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1716b174, .id = "Video", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_video (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "caption", cur_token_real_len)) {
+ set_autocomplete_string ("caption");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "caption", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_message_media_geo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "geo", cur_token_real_len)) {
+ set_autocomplete_string ("geo");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "geo", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_geo_point (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_message_media_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "phone_number", cur_token_real_len)) {
+ set_autocomplete_string ("phone_number");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "phone_number", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "first_name", cur_token_real_len)) {
+ set_autocomplete_string ("first_name");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "first_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "last_name", cur_token_real_len)) {
+ set_autocomplete_string ("last_name");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "last_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_message_media_unsupported (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_message_media_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "document", cur_token_real_len)) {
+ set_autocomplete_string ("document");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "document", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_document (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_message_media_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "audio", cur_token_real_len)) {
+ set_autocomplete_string ("audio");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "audio", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9fc5ec4e, .id = "Audio", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_audio (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_message_media_web_page (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "webpage", cur_token_real_len)) {
+ set_autocomplete_string ("webpage");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "webpage", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x8d8c0d41, .id = "WebPage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_web_page (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_message_media_venue (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "geo", cur_token_real_len)) {
+ set_autocomplete_string ("geo");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "geo", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_geo_point (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_real_len)) {
+ set_autocomplete_string ("title");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "address", cur_token_real_len)) {
+ set_autocomplete_string ("address");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "address", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "provider", cur_token_real_len)) {
+ set_autocomplete_string ("provider");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "provider", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "venue_id", cur_token_real_len)) {
+ set_autocomplete_string ("venue_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "venue_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field5) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_message_media_photo_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "photo", cur_token_real_len)) {
+ set_autocomplete_string ("photo");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_photo (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_message_media_video_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "video", cur_token_real_len)) {
+ set_autocomplete_string ("video");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "video", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1716b174, .id = "Video", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_video (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_input_messages_filter_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_messages_filter_photos (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_messages_filter_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_messages_filter_photo_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_messages_filter_photo_video_documents (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_messages_filter_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_input_messages_filter_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_nearest_dc (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8e1a1775 && T->type->name != 0x71e5e88a)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "country", cur_token_real_len)) {
+ set_autocomplete_string ("country");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "country", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "this_dc", cur_token_real_len)) {
+ set_autocomplete_string ("this_dc");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "this_dc", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "nearest_dc", cur_token_real_len)) {
+ set_autocomplete_string ("nearest_dc");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "nearest_dc", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_notify_peer (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_peer (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_notify_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_notify_chats (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_notify_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_null (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x56730bcc && T->type->name != 0xa98cf433)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_p_q_inner_data (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbfa3de38 && T->type->name != 0x405c21c7)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "pq", cur_token_real_len)) {
+ set_autocomplete_string ("pq");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "pq", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "p", cur_token_real_len)) {
+ set_autocomplete_string ("p");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "p", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "q", cur_token_real_len)) {
+ set_autocomplete_string ("q");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "q", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "nonce", cur_token_real_len)) {
+ set_autocomplete_string ("nonce");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "server_nonce", cur_token_real_len)) {
+ set_autocomplete_string ("server_nonce");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "server_nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "new_nonce", cur_token_real_len)) {
+ set_autocomplete_string ("new_nonce");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "new_nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0d38674c, .id = "Bare_Int256", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int256 (field6) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_p_q_inner_data_temp (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbfa3de38 && T->type->name != 0x405c21c7)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "pq", cur_token_real_len)) {
+ set_autocomplete_string ("pq");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "pq", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "p", cur_token_real_len)) {
+ set_autocomplete_string ("p");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "p", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "q", cur_token_real_len)) {
+ set_autocomplete_string ("q");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "q", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "nonce", cur_token_real_len)) {
+ set_autocomplete_string ("nonce");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "server_nonce", cur_token_real_len)) {
+ set_autocomplete_string ("server_nonce");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "server_nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "new_nonce", cur_token_real_len)) {
+ set_autocomplete_string ("new_nonce");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "new_nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0d38674c, .id = "Bare_Int256", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int256 (field6) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "expires_in", cur_token_real_len)) {
+ set_autocomplete_string ("expires_in");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "expires_in", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field7) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_peer_user (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x276159d6 && T->type->name != 0xd89ea629)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_peer_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x276159d6 && T->type->name != 0xd89ea629)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_real_len)) {
+ set_autocomplete_string ("chat_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_peer_notify_events_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc0c8d13b && T->type->name != 0x3f372ec4)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_peer_notify_events_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc0c8d13b && T->type->name != 0x3f372ec4)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_peer_notify_settings_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xfdf894fc && T->type->name != 0x02076b03)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_peer_notify_settings (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xfdf894fc && T->type->name != 0x02076b03)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "mute_until", cur_token_real_len)) {
+ set_autocomplete_string ("mute_until");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "mute_until", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "sound", cur_token_real_len)) {
+ set_autocomplete_string ("sound");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "sound", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 13 && !cur_token_quoted && !memcmp (cur_token, "show_previews", cur_token_real_len)) {
+ set_autocomplete_string ("show_previews");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 13 && !memcmp (cur_token, "show_previews", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bool (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "events_mask", cur_token_real_len)) {
+ set_autocomplete_string ("events_mask");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "events_mask", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_photo_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc207550a && T->type->name != 0x3df8aaf5)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc207550a && T->type->name != 0x3df8aaf5)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "geo", cur_token_real_len)) {
+ set_autocomplete_string ("geo");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "geo", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_geo_point (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "sizes", cur_token_real_len)) {
+ set_autocomplete_string ("sizes");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "sizes", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field6) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_photo_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc207550a && T->type->name != 0x3df8aaf5)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "caption", cur_token_real_len)) {
+ set_autocomplete_string ("caption");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "caption", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "geo", cur_token_real_len)) {
+ set_autocomplete_string ("geo");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "geo", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_geo_point (field6) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "sizes", cur_token_real_len)) {
+ set_autocomplete_string ("sizes");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "sizes", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field7) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_photo_size_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x900f60dd && T->type->name != 0x6ff09f22)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "type", cur_token_real_len)) {
+ set_autocomplete_string ("type");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "type", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_photo_size (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x900f60dd && T->type->name != 0x6ff09f22)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "type", cur_token_real_len)) {
+ set_autocomplete_string ("type");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "type", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "location", cur_token_real_len)) {
+ set_autocomplete_string ("location");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "location", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_file_location (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "w", cur_token_real_len)) {
+ set_autocomplete_string ("w");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "w", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "h", cur_token_real_len)) {
+ set_autocomplete_string ("h");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "h", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "size", cur_token_real_len)) {
+ set_autocomplete_string ("size");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "size", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_photo_cached_size (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x900f60dd && T->type->name != 0x6ff09f22)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "type", cur_token_real_len)) {
+ set_autocomplete_string ("type");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "type", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "location", cur_token_real_len)) {
+ set_autocomplete_string ("location");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "location", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_file_location (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "w", cur_token_real_len)) {
+ set_autocomplete_string ("w");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "w", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "h", cur_token_real_len)) {
+ set_autocomplete_string ("h");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "h", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "bytes", cur_token_real_len)) {
+ set_autocomplete_string ("bytes");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "bytes", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field5) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_privacy_key_status_timestamp (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbc2eab30 && T->type->name != 0x43d154cf)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_privacy_value_allow_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_privacy_value_allow_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_privacy_value_allow_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_privacy_value_disallow_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_privacy_value_disallow_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_privacy_value_disallow_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_received_notify_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa384b779 && T->type->name != 0x5c7b4886)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_real_len)) {
+ set_autocomplete_string ("flags");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_reply_keyboard_hide (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x612ca4a9 && T->type->name != 0x9ed35b56)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_real_len)) {
+ set_autocomplete_string ("flags");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_reply_keyboard_force_reply (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x612ca4a9 && T->type->name != 0x9ed35b56)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_real_len)) {
+ set_autocomplete_string ("flags");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_reply_keyboard_markup (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x612ca4a9 && T->type->name != 0x9ed35b56)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_real_len)) {
+ set_autocomplete_string ("flags");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "rows", cur_token_real_len)) {
+ set_autocomplete_string ("rows");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "rows", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x77608b83, .id = "KeyboardButtonRow", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_res_p_q (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x05162463 && T->type->name != 0xfae9db9c)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "nonce", cur_token_real_len)) {
+ set_autocomplete_string ("nonce");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "server_nonce", cur_token_real_len)) {
+ set_autocomplete_string ("server_nonce");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "server_nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "pq", cur_token_real_len)) {
+ set_autocomplete_string ("pq");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "pq", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 30 && !cur_token_quoted && !memcmp (cur_token, "server_public_key_fingerprints", cur_token_real_len)) {
+ set_autocomplete_string ("server_public_key_fingerprints");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 30 && !memcmp (cur_token, "server_public_key_fingerprints", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_send_message_typing_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_send_message_cancel_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_send_message_record_video_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_send_message_upload_video_action_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_send_message_upload_video_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "progress", cur_token_real_len)) {
+ set_autocomplete_string ("progress");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "progress", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_send_message_record_audio_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_send_message_upload_audio_action_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_send_message_upload_audio_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "progress", cur_token_real_len)) {
+ set_autocomplete_string ("progress");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "progress", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_send_message_upload_photo_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "progress", cur_token_real_len)) {
+ set_autocomplete_string ("progress");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "progress", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_send_message_upload_document_action_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_send_message_upload_document_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "progress", cur_token_real_len)) {
+ set_autocomplete_string ("progress");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "progress", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_send_message_geo_location_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_send_message_choose_contact_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_server_d_h_params_fail (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa9230301 && T->type->name != 0x56dcfcfe)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "nonce", cur_token_real_len)) {
+ set_autocomplete_string ("nonce");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "server_nonce", cur_token_real_len)) {
+ set_autocomplete_string ("server_nonce");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "server_nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 14 && !cur_token_quoted && !memcmp (cur_token, "new_nonce_hash", cur_token_real_len)) {
+ set_autocomplete_string ("new_nonce_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 14 && !memcmp (cur_token, "new_nonce_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_server_d_h_params_ok (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa9230301 && T->type->name != 0x56dcfcfe)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "nonce", cur_token_real_len)) {
+ set_autocomplete_string ("nonce");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "server_nonce", cur_token_real_len)) {
+ set_autocomplete_string ("server_nonce");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "server_nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 16 && !cur_token_quoted && !memcmp (cur_token, "encrypted_answer", cur_token_real_len)) {
+ set_autocomplete_string ("encrypted_answer");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 16 && !memcmp (cur_token, "encrypted_answer", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_server_d_h_inner_data (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb5890dba && T->type->name != 0x4a76f245)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "nonce", cur_token_real_len)) {
+ set_autocomplete_string ("nonce");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "server_nonce", cur_token_real_len)) {
+ set_autocomplete_string ("server_nonce");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "server_nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "g", cur_token_real_len)) {
+ set_autocomplete_string ("g");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "g", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "dh_prime", cur_token_real_len)) {
+ set_autocomplete_string ("dh_prime");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "dh_prime", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "g_a", cur_token_real_len)) {
+ set_autocomplete_string ("g_a");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "g_a", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "server_time", cur_token_real_len)) {
+ set_autocomplete_string ("server_time");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "server_time", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field6) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_dh_gen_ok (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdb8a468f && T->type->name != 0x2475b970)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "nonce", cur_token_real_len)) {
+ set_autocomplete_string ("nonce");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "server_nonce", cur_token_real_len)) {
+ set_autocomplete_string ("server_nonce");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "server_nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "new_nonce_hash1", cur_token_real_len)) {
+ set_autocomplete_string ("new_nonce_hash1");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "new_nonce_hash1", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_dh_gen_retry (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdb8a468f && T->type->name != 0x2475b970)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "nonce", cur_token_real_len)) {
+ set_autocomplete_string ("nonce");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "server_nonce", cur_token_real_len)) {
+ set_autocomplete_string ("server_nonce");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "server_nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "new_nonce_hash2", cur_token_real_len)) {
+ set_autocomplete_string ("new_nonce_hash2");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "new_nonce_hash2", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_dh_gen_fail (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdb8a468f && T->type->name != 0x2475b970)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "nonce", cur_token_real_len)) {
+ set_autocomplete_string ("nonce");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "server_nonce", cur_token_real_len)) {
+ set_autocomplete_string ("server_nonce");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "server_nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "new_nonce_hash3", cur_token_real_len)) {
+ set_autocomplete_string ("new_nonce_hash3");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "new_nonce_hash3", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_sticker_pack (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x12b299d4 && T->type->name != 0xed4d662b)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "emoticon", cur_token_real_len)) {
+ set_autocomplete_string ("emoticon");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "emoticon", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "documents", cur_token_real_len)) {
+ set_autocomplete_string ("documents");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "documents", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_sticker_set (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa7a43b17 && T->type->name != 0x585bc4e8)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_real_len)) {
+ set_autocomplete_string ("title");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "short_name", cur_token_real_len)) {
+ set_autocomplete_string ("short_name");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "short_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_string (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb5286e24 && T->type->name != 0x4ad791db)) { return -1; }
+ if (cur_token_len >= 0) {
+ local_next_token ();
+ return 0;
+ } else {
+ return -1;
+ }
+}
+int autocomplete_constructor_update_new_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_real_len)) {
+ set_autocomplete_string ("message");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_message (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_real_len)) {
+ set_autocomplete_string ("pts");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "pts_count", cur_token_real_len)) {
+ set_autocomplete_string ("pts_count");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "pts_count", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_message_i_d (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_real_len)) {
+ set_autocomplete_string ("random_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_delete_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "messages", cur_token_real_len)) {
+ set_autocomplete_string ("messages");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "messages", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_real_len)) {
+ set_autocomplete_string ("pts");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "pts_count", cur_token_real_len)) {
+ set_autocomplete_string ("pts_count");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "pts_count", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_user_typing (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "action", cur_token_real_len)) {
+ set_autocomplete_string ("action");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "action", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x70541c7e, .id = "SendMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_send_message_action (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_chat_user_typing (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_real_len)) {
+ set_autocomplete_string ("chat_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "action", cur_token_real_len)) {
+ set_autocomplete_string ("action");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "action", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x70541c7e, .id = "SendMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_send_message_action (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_chat_participants (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "participants", cur_token_real_len)) {
+ set_autocomplete_string ("participants");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "participants", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x77930f9f, .id = "ChatParticipants", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_chat_participants (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_user_status (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "status", cur_token_real_len)) {
+ set_autocomplete_string ("status");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "status", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x76de9570, .id = "UserStatus", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_user_status (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_user_name (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "first_name", cur_token_real_len)) {
+ set_autocomplete_string ("first_name");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "first_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "last_name", cur_token_real_len)) {
+ set_autocomplete_string ("last_name");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "last_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "username", cur_token_real_len)) {
+ set_autocomplete_string ("username");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "username", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_user_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "photo", cur_token_real_len)) {
+ set_autocomplete_string ("photo");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9a486229, .id = "UserProfilePhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_user_profile_photo (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "previous", cur_token_real_len)) {
+ set_autocomplete_string ("previous");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "previous", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bool (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_contact_registered (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_contact_link (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "my_link", cur_token_real_len)) {
+ set_autocomplete_string ("my_link");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "my_link", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_contact_link (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "foreign_link", cur_token_real_len)) {
+ set_autocomplete_string ("foreign_link");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "foreign_link", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_contact_link (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_new_authorization (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "auth_key_id", cur_token_real_len)) {
+ set_autocomplete_string ("auth_key_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "auth_key_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "device", cur_token_real_len)) {
+ set_autocomplete_string ("device");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "device", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "location", cur_token_real_len)) {
+ set_autocomplete_string ("location");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "location", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_new_geo_chat_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "geo_message", cur_token_real_len)) {
+ set_autocomplete_string ("geo_message");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "geo_message", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_geo_chat_message (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_new_encrypted_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "encr_message", cur_token_real_len)) {
+ set_autocomplete_string ("encr_message");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "encr_message", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xce6b8a1e, .id = "EncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_encrypted_message (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "qts", cur_token_real_len)) {
+ set_autocomplete_string ("qts");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "qts", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_encrypted_chat_typing (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_real_len)) {
+ set_autocomplete_string ("chat_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_encryption (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "encr_chat", cur_token_real_len)) {
+ set_autocomplete_string ("encr_chat");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "encr_chat", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb1718213, .id = "EncryptedChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_encrypted_chat (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_encrypted_messages_read (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_real_len)) {
+ set_autocomplete_string ("chat_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "max_date", cur_token_real_len)) {
+ set_autocomplete_string ("max_date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "max_date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_chat_participant_add (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_real_len)) {
+ set_autocomplete_string ("chat_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "inviter_id", cur_token_real_len)) {
+ set_autocomplete_string ("inviter_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "inviter_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "version", cur_token_real_len)) {
+ set_autocomplete_string ("version");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "version", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_chat_participant_delete (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_real_len)) {
+ set_autocomplete_string ("chat_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "version", cur_token_real_len)) {
+ set_autocomplete_string ("version");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "version", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_dc_options (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "dc_options", cur_token_real_len)) {
+ set_autocomplete_string ("dc_options");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "dc_options", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2b1a62f0, .id = "DcOption", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_user_blocked (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "blocked", cur_token_real_len)) {
+ set_autocomplete_string ("blocked");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "blocked", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bool (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_notify_settings (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "notify_peer", cur_token_real_len)) {
+ set_autocomplete_string ("notify_peer");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "notify_peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9fcb8237, .id = "NotifyPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_notify_peer (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "notify_settings", cur_token_real_len)) {
+ set_autocomplete_string ("notify_settings");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "notify_settings", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_peer_notify_settings (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_service_notification (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "type", cur_token_real_len)) {
+ set_autocomplete_string ("type");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "type", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "message_text", cur_token_real_len)) {
+ set_autocomplete_string ("message_text");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "message_text", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "media", cur_token_real_len)) {
+ set_autocomplete_string ("media");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "media", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_message_media (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "popup", cur_token_real_len)) {
+ set_autocomplete_string ("popup");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "popup", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bool (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_privacy (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "key", cur_token_real_len)) {
+ set_autocomplete_string ("key");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "key", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xbc2eab30, .id = "PrivacyKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_privacy_key (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "rules", cur_token_real_len)) {
+ set_autocomplete_string ("rules");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "rules", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa8638aec, .id = "PrivacyRule", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_user_phone (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "phone", cur_token_real_len)) {
+ set_autocomplete_string ("phone");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "phone", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_read_history_inbox (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_peer (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "max_id", cur_token_real_len)) {
+ set_autocomplete_string ("max_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "max_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_real_len)) {
+ set_autocomplete_string ("pts");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "pts_count", cur_token_real_len)) {
+ set_autocomplete_string ("pts_count");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "pts_count", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_read_history_outbox (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_peer (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "max_id", cur_token_real_len)) {
+ set_autocomplete_string ("max_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "max_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_real_len)) {
+ set_autocomplete_string ("pts");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "pts_count", cur_token_real_len)) {
+ set_autocomplete_string ("pts_count");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "pts_count", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_web_page (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "webpage", cur_token_real_len)) {
+ set_autocomplete_string ("webpage");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "webpage", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x8d8c0d41, .id = "WebPage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_web_page (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_read_messages_contents (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "messages", cur_token_real_len)) {
+ set_autocomplete_string ("messages");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "messages", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_real_len)) {
+ set_autocomplete_string ("pts");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "pts_count", cur_token_real_len)) {
+ set_autocomplete_string ("pts_count");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "pts_count", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_update_msg_update (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_real_len)) {
+ set_autocomplete_string ("pts");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "pts_count", cur_token_real_len)) {
+ set_autocomplete_string ("pts_count");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "pts_count", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_updates_too_long (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_update_short_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_real_len)) {
+ set_autocomplete_string ("flags");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ if (cur_token_len < 0) { return -1; }
+ if (!is_int ()) { return -1;}
+ struct paramed_type *var0 = INT2PTR (get_int ());
+ assert (var0);
+ local_next_token ();
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_real_len)) {
+ set_autocomplete_string ("message");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_real_len)) {
+ set_autocomplete_string ("pts");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "pts_count", cur_token_real_len)) {
+ set_autocomplete_string ("pts_count");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "pts_count", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field6) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field7) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "fwd_from_id", cur_token_real_len)) {
+ set_autocomplete_string ("fwd_from_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "fwd_from_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field8) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "fwd_date", cur_token_real_len)) {
+ set_autocomplete_string ("fwd_date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "fwd_date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field9) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "reply_to_msg_id", cur_token_real_len)) {
+ set_autocomplete_string ("reply_to_msg_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "reply_to_msg_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field10) < 0) { return -1;}
+ }
+ return 0;
+}
+int autocomplete_constructor_update_short_chat_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_real_len)) {
+ set_autocomplete_string ("flags");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ if (cur_token_len < 0) { return -1; }
+ if (!is_int ()) { return -1;}
+ struct paramed_type *var0 = INT2PTR (get_int ());
+ assert (var0);
+ local_next_token ();
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "from_id", cur_token_real_len)) {
+ set_autocomplete_string ("from_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "from_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_real_len)) {
+ set_autocomplete_string ("chat_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_real_len)) {
+ set_autocomplete_string ("message");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_real_len)) {
+ set_autocomplete_string ("pts");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field6) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "pts_count", cur_token_real_len)) {
+ set_autocomplete_string ("pts_count");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "pts_count", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field7) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field8) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "fwd_from_id", cur_token_real_len)) {
+ set_autocomplete_string ("fwd_from_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "fwd_from_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field9) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "fwd_date", cur_token_real_len)) {
+ set_autocomplete_string ("fwd_date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "fwd_date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field10) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "reply_to_msg_id", cur_token_real_len)) {
+ set_autocomplete_string ("reply_to_msg_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "reply_to_msg_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field11) < 0) { return -1;}
+ }
+ return 0;
+}
+int autocomplete_constructor_update_short (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "update", cur_token_real_len)) {
+ set_autocomplete_string ("update");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "update", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_update (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_updates_combined (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "updates", cur_token_real_len)) {
+ set_autocomplete_string ("updates");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "updates", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "chats", cur_token_real_len)) {
+ set_autocomplete_string ("chats");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "chats", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "seq_start", cur_token_real_len)) {
+ set_autocomplete_string ("seq_start");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "seq_start", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "seq", cur_token_real_len)) {
+ set_autocomplete_string ("seq");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "seq", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field6) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_updates (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "updates", cur_token_real_len)) {
+ set_autocomplete_string ("updates");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "updates", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "chats", cur_token_real_len)) {
+ set_autocomplete_string ("chats");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "chats", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "seq", cur_token_real_len)) {
+ set_autocomplete_string ("seq");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "seq", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_user_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02e6c0c8 && T->type->name != 0xfd193f37)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_user (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02e6c0c8 && T->type->name != 0xfd193f37)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_real_len)) {
+ set_autocomplete_string ("flags");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ if (cur_token_len < 0) { return -1; }
+ if (!is_int ()) { return -1;}
+ struct paramed_type *var0 = INT2PTR (get_int ());
+ assert (var0);
+ local_next_token ();
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 0)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field3) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 1)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "first_name", cur_token_real_len)) {
+ set_autocomplete_string ("first_name");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "first_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "last_name", cur_token_real_len)) {
+ set_autocomplete_string ("last_name");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "last_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field5) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "username", cur_token_real_len)) {
+ set_autocomplete_string ("username");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "username", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field6) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 4)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "phone", cur_token_real_len)) {
+ set_autocomplete_string ("phone");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "phone", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field7) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 5)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "photo", cur_token_real_len)) {
+ set_autocomplete_string ("photo");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9a486229, .id = "UserProfilePhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_user_profile_photo (field8) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 6)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "status", cur_token_real_len)) {
+ set_autocomplete_string ("status");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "status", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x76de9570, .id = "UserStatus", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_user_status (field9) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 14)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 16 && !cur_token_quoted && !memcmp (cur_token, "bot_info_version", cur_token_real_len)) {
+ set_autocomplete_string ("bot_info_version");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 16 && !memcmp (cur_token, "bot_info_version", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field10) < 0) { return -1;}
+ }
+ return 0;
+}
+int autocomplete_constructor_user_full (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5a89ac5b && T->type->name != 0xa57653a4)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "user", cur_token_real_len)) {
+ set_autocomplete_string ("user");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "user", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_user (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "link", cur_token_real_len)) {
+ set_autocomplete_string ("link");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "link", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3ace484c, .id = "contacts.Link", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_contacts_link (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 13 && !cur_token_quoted && !memcmp (cur_token, "profile_photo", cur_token_real_len)) {
+ set_autocomplete_string ("profile_photo");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 13 && !memcmp (cur_token, "profile_photo", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_photo (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "notify_settings", cur_token_real_len)) {
+ set_autocomplete_string ("notify_settings");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "notify_settings", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_peer_notify_settings (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "blocked", cur_token_real_len)) {
+ set_autocomplete_string ("blocked");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "blocked", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bool (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "bot_info", cur_token_real_len)) {
+ set_autocomplete_string ("bot_info");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "bot_info", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb2e16f93, .id = "BotInfo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bot_info (field6) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_user_profile_photo_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9a486229 && T->type->name != 0x65b79dd6)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_user_profile_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9a486229 && T->type->name != 0x65b79dd6)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "photo_id", cur_token_real_len)) {
+ set_autocomplete_string ("photo_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "photo_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "photo_small", cur_token_real_len)) {
+ set_autocomplete_string ("photo_small");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "photo_small", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_file_location (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "photo_big", cur_token_real_len)) {
+ set_autocomplete_string ("photo_big");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "photo_big", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_file_location (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_user_status_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_user_status_online (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "expires", cur_token_real_len)) {
+ set_autocomplete_string ("expires");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "expires", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_user_status_offline (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "was_online", cur_token_real_len)) {
+ set_autocomplete_string ("was_online");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "was_online", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_user_status_recently (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_user_status_last_week (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_user_status_last_month (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_vector (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1cb5c415 && T->type->name != 0xe34a3bea)) { return -1; }
+ if (ODDP(T->params[0])) { return -1; }
+ struct paramed_type *var0 = T->params[0]; assert (var0);
+ if (cur_token_len < 0) { return -1; }
+ if (!is_int ()) { return -1;}
+ struct paramed_type *var1 = INT2PTR (get_int ());
+ assert (var1);
+ local_next_token ();
+ expect_token_autocomplete ("[", 1);
+ int multiplicity3 = PTR2INT (
+ ((void *)var1) + 0 );
+ struct paramed_type *field3 =
+ var0;
+ while (multiplicity3 -- > 0) {
+ if (autocomplete_type_any (field3) < 0) { return -1;}
+ }
+ expect_token_autocomplete ("]", 1);
+ return 0;
+}
+int autocomplete_constructor_video_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1716b174 && T->type->name != 0xe8e94e8b)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1716b174 && T->type->name != 0xe8e94e8b)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "duration", cur_token_real_len)) {
+ set_autocomplete_string ("duration");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "duration", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "size", cur_token_real_len)) {
+ set_autocomplete_string ("size");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "size", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field6) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "thumb", cur_token_real_len)) {
+ set_autocomplete_string ("thumb");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "thumb", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_photo_size (field7) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "dc_id", cur_token_real_len)) {
+ set_autocomplete_string ("dc_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "dc_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field8) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "w", cur_token_real_len)) {
+ set_autocomplete_string ("w");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "w", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field9) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "h", cur_token_real_len)) {
+ set_autocomplete_string ("h");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "h", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field10) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_video_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1716b174 && T->type->name != 0xe8e94e8b)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "caption", cur_token_real_len)) {
+ set_autocomplete_string ("caption");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "caption", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "duration", cur_token_real_len)) {
+ set_autocomplete_string ("duration");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "duration", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field6) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "mime_type", cur_token_real_len)) {
+ set_autocomplete_string ("mime_type");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "mime_type", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field7) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "size", cur_token_real_len)) {
+ set_autocomplete_string ("size");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "size", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field8) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "thumb", cur_token_real_len)) {
+ set_autocomplete_string ("thumb");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "thumb", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_photo_size (field9) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "dc_id", cur_token_real_len)) {
+ set_autocomplete_string ("dc_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "dc_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field10) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "w", cur_token_real_len)) {
+ set_autocomplete_string ("w");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "w", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field11) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "h", cur_token_real_len)) {
+ set_autocomplete_string ("h");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "h", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field12) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_wall_paper (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xafa14973 && T->type->name != 0x505eb68c)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_real_len)) {
+ set_autocomplete_string ("title");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "sizes", cur_token_real_len)) {
+ set_autocomplete_string ("sizes");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "sizes", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "color", cur_token_real_len)) {
+ set_autocomplete_string ("color");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "color", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_wall_paper_solid (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xafa14973 && T->type->name != 0x505eb68c)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_real_len)) {
+ set_autocomplete_string ("title");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "bg_color", cur_token_real_len)) {
+ set_autocomplete_string ("bg_color");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "bg_color", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "color", cur_token_real_len)) {
+ set_autocomplete_string ("color");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "color", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_web_page_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8d8c0d41 && T->type->name != 0x7273f2be)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_web_page_pending (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8d8c0d41 && T->type->name != 0x7273f2be)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_web_page (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8d8c0d41 && T->type->name != 0x7273f2be)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_real_len)) {
+ set_autocomplete_string ("flags");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ if (cur_token_len < 0) { return -1; }
+ if (!is_int ()) { return -1;}
+ struct paramed_type *var0 = INT2PTR (get_int ());
+ assert (var0);
+ local_next_token ();
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "url", cur_token_real_len)) {
+ set_autocomplete_string ("url");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "url", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "display_url", cur_token_real_len)) {
+ set_autocomplete_string ("display_url");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "display_url", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 0)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "type", cur_token_real_len)) {
+ set_autocomplete_string ("type");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "type", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field5) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 1)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "site_name", cur_token_real_len)) {
+ set_autocomplete_string ("site_name");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "site_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field6) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_real_len)) {
+ set_autocomplete_string ("title");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field7) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "description", cur_token_real_len)) {
+ set_autocomplete_string ("description");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "description", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field8) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 4)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "photo", cur_token_real_len)) {
+ set_autocomplete_string ("photo");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_photo (field9) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 5)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "embed_url", cur_token_real_len)) {
+ set_autocomplete_string ("embed_url");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "embed_url", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field10) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 5)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "embed_type", cur_token_real_len)) {
+ set_autocomplete_string ("embed_type");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "embed_type", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field11) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 6)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "embed_width", cur_token_real_len)) {
+ set_autocomplete_string ("embed_width");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "embed_width", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field12) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 6)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "embed_height", cur_token_real_len)) {
+ set_autocomplete_string ("embed_height");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "embed_height", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field13) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 7)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "duration", cur_token_real_len)) {
+ set_autocomplete_string ("duration");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "duration", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field14) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 8)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "author", cur_token_real_len)) {
+ set_autocomplete_string ("author");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "author", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field15 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field15) < 0) { return -1;}
+ }
+ return 0;
+}
+int autocomplete_constructor_account_authorizations (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1250abde && T->type->name != 0xedaf5421)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bf2e6f6, .id = "Authorization", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_account_no_password (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xeac2a804 && T->type->name != 0x153d57fb)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "new_salt", cur_token_real_len)) {
+ set_autocomplete_string ("new_salt");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "new_salt", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 25 && !cur_token_quoted && !memcmp (cur_token, "email_unconfirmed_pattern", cur_token_real_len)) {
+ set_autocomplete_string ("email_unconfirmed_pattern");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 25 && !memcmp (cur_token, "email_unconfirmed_pattern", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_account_password (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xeac2a804 && T->type->name != 0x153d57fb)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "current_salt", cur_token_real_len)) {
+ set_autocomplete_string ("current_salt");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "current_salt", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "new_salt", cur_token_real_len)) {
+ set_autocomplete_string ("new_salt");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "new_salt", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "hint", cur_token_real_len)) {
+ set_autocomplete_string ("hint");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "hint", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "has_recovery", cur_token_real_len)) {
+ set_autocomplete_string ("has_recovery");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "has_recovery", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bool (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 25 && !cur_token_quoted && !memcmp (cur_token, "email_unconfirmed_pattern", cur_token_real_len)) {
+ set_autocomplete_string ("email_unconfirmed_pattern");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 25 && !memcmp (cur_token, "email_unconfirmed_pattern", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field5) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_account_password_input_settings (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbcfc532c && T->type->name != 0x4303acd3)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_real_len)) {
+ set_autocomplete_string ("flags");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ if (cur_token_len < 0) { return -1; }
+ if (!is_int ()) { return -1;}
+ struct paramed_type *var0 = INT2PTR (get_int ());
+ assert (var0);
+ local_next_token ();
+ if (PTR2INT (var0) & (1 << 0)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "new_salt", cur_token_real_len)) {
+ set_autocomplete_string ("new_salt");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "new_salt", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field2) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 0)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 17 && !cur_token_quoted && !memcmp (cur_token, "new_password_hash", cur_token_real_len)) {
+ set_autocomplete_string ("new_password_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 17 && !memcmp (cur_token, "new_password_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field3) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 0)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "hint", cur_token_real_len)) {
+ set_autocomplete_string ("hint");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "hint", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 1)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "email", cur_token_real_len)) {
+ set_autocomplete_string ("email");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "email", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field5) < 0) { return -1;}
+ }
+ return 0;
+}
+int autocomplete_constructor_account_password_settings (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb7b72ab3 && T->type->name != 0x4848d54c)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_account_privacy_rules (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x554abb6f && T->type->name != 0xaab54490)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "rules", cur_token_real_len)) {
+ set_autocomplete_string ("rules");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "rules", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa8638aec, .id = "PrivacyRule", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_account_sent_change_phone_code (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa4f58c4c && T->type->name != 0x5b0a73b3)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "phone_code_hash", cur_token_real_len)) {
+ set_autocomplete_string ("phone_code_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "phone_code_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 17 && !cur_token_quoted && !memcmp (cur_token, "send_call_timeout", cur_token_real_len)) {
+ set_autocomplete_string ("send_call_timeout");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 17 && !memcmp (cur_token, "send_call_timeout", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_auth_authorization (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xff036af1 && T->type->name != 0x00fc950e)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_user (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_auth_checked_phone (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x811ea28e && T->type->name != 0x7ee15d71)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bool (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_auth_exported_authorization (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdf969c2d && T->type->name != 0x206963d2)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "bytes", cur_token_real_len)) {
+ set_autocomplete_string ("bytes");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "bytes", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_auth_password_recovery (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x137948a5 && T->type->name != 0xec86b75a)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_auth_sent_code (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0cc8bc16 && T->type->name != 0xf33743e9)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 16 && !cur_token_quoted && !memcmp (cur_token, "phone_registered", cur_token_real_len)) {
+ set_autocomplete_string ("phone_registered");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 16 && !memcmp (cur_token, "phone_registered", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bool (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "phone_code_hash", cur_token_real_len)) {
+ set_autocomplete_string ("phone_code_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "phone_code_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 17 && !cur_token_quoted && !memcmp (cur_token, "send_call_timeout", cur_token_real_len)) {
+ set_autocomplete_string ("send_call_timeout");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 17 && !memcmp (cur_token, "send_call_timeout", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "is_password", cur_token_real_len)) {
+ set_autocomplete_string ("is_password");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "is_password", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bool (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_auth_sent_app_code (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0cc8bc16 && T->type->name != 0xf33743e9)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 16 && !cur_token_quoted && !memcmp (cur_token, "phone_registered", cur_token_real_len)) {
+ set_autocomplete_string ("phone_registered");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 16 && !memcmp (cur_token, "phone_registered", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bool (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "phone_code_hash", cur_token_real_len)) {
+ set_autocomplete_string ("phone_code_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "phone_code_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 17 && !cur_token_quoted && !memcmp (cur_token, "send_call_timeout", cur_token_real_len)) {
+ set_autocomplete_string ("send_call_timeout");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 17 && !memcmp (cur_token, "send_call_timeout", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "is_password", cur_token_real_len)) {
+ set_autocomplete_string ("is_password");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "is_password", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bool (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_binlog_encr_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0377168f && T->type->name != 0xfc88e970)) { return -1; }
+ expect_token_autocomplete ("[", 1);
+ int multiplicity1 = PTR2INT (
+ INT2PTR (64) );
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ while (multiplicity1 -- > 0) {
+ if (autocomplete_type_any (field1) < 0) { return -1;}
+ }
+ expect_token_autocomplete ("]", 1);
+ return 0;
+}
+int autocomplete_constructor_binlog_start (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_binlog_dc_option (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "dc", cur_token_real_len)) {
+ set_autocomplete_string ("dc");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "dc", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "name", cur_token_real_len)) {
+ set_autocomplete_string ("name");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "name", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "ip", cur_token_real_len)) {
+ set_autocomplete_string ("ip");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "ip", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "port", cur_token_real_len)) {
+ set_autocomplete_string ("port");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "port", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_binlog_dc_option_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_real_len)) {
+ set_autocomplete_string ("flags");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "dc", cur_token_real_len)) {
+ set_autocomplete_string ("dc");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "dc", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "name", cur_token_real_len)) {
+ set_autocomplete_string ("name");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "name", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "ip", cur_token_real_len)) {
+ set_autocomplete_string ("ip");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "ip", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "port", cur_token_real_len)) {
+ set_autocomplete_string ("port");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "port", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_binlog_auth_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "dc", cur_token_real_len)) {
+ set_autocomplete_string ("dc");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "dc", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "key", cur_token_real_len)) {
+ set_autocomplete_string ("key");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "key", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_binlog_encr_key (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_binlog_default_dc (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "dc", cur_token_real_len)) {
+ set_autocomplete_string ("dc");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "dc", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_binlog_dc_signed (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "dc", cur_token_real_len)) {
+ set_autocomplete_string ("dc");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "dc", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_binlog_our_id (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_binlog_set_dh_params (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "root", cur_token_real_len)) {
+ set_autocomplete_string ("root");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "root", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "prime", cur_token_real_len)) {
+ set_autocomplete_string ("prime");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "prime", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_binlog_encr_key (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "version", cur_token_real_len)) {
+ set_autocomplete_string ("version");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "version", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_binlog_set_pts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_real_len)) {
+ set_autocomplete_string ("pts");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_binlog_set_qts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "qts", cur_token_real_len)) {
+ set_autocomplete_string ("qts");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "qts", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_binlog_set_date (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_binlog_set_seq (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "seq", cur_token_real_len)) {
+ set_autocomplete_string ("seq");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "seq", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_binlog_encr_chat_delete (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_binlog_encr_chat_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_real_len)) {
+ set_autocomplete_string ("flags");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ if (cur_token_len < 0) { return -1; }
+ if (!is_int ()) { return -1;}
+ struct paramed_type *var0 = INT2PTR (get_int ());
+ assert (var0);
+ local_next_token ();
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field3) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "admin", cur_token_real_len)) {
+ set_autocomplete_string ("admin");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "admin", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field6) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "key", cur_token_real_len)) {
+ set_autocomplete_string ("key");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "key", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_binlog_encr_key (field7) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "g_key", cur_token_real_len)) {
+ set_autocomplete_string ("g_key");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "g_key", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_binlog_encr_key (field8) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "state", cur_token_real_len)) {
+ set_autocomplete_string ("state");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "state", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field9) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "ttl", cur_token_real_len)) {
+ set_autocomplete_string ("ttl");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "ttl", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field10) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 25)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "layer", cur_token_real_len)) {
+ set_autocomplete_string ("layer");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "layer", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field11) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "in_seq_no", cur_token_real_len)) {
+ set_autocomplete_string ("in_seq_no");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "in_seq_no", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field12) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 14 && !cur_token_quoted && !memcmp (cur_token, "last_in_seq_no", cur_token_real_len)) {
+ set_autocomplete_string ("last_in_seq_no");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 14 && !memcmp (cur_token, "last_in_seq_no", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field13) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "out_seq_no", cur_token_real_len)) {
+ set_autocomplete_string ("out_seq_no");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "out_seq_no", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field14) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 27)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "key_fingerprint", cur_token_real_len)) {
+ set_autocomplete_string ("key_fingerprint");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "key_fingerprint", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field15 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field15) < 0) { return -1;}
+ }
+ return 0;
+}
+int autocomplete_constructor_binlog_encr_chat_exchange_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_real_len)) {
+ set_autocomplete_string ("flags");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ if (cur_token_len < 0) { return -1; }
+ if (!is_int ()) { return -1;}
+ struct paramed_type *var0 = INT2PTR (get_int ());
+ assert (var0);
+ local_next_token ();
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "exchange_id", cur_token_real_len)) {
+ set_autocomplete_string ("exchange_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "exchange_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field3) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "key", cur_token_real_len)) {
+ set_autocomplete_string ("key");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "key", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_binlog_encr_key (field4) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "state", cur_token_real_len)) {
+ set_autocomplete_string ("state");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "state", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return -1;}
+ }
+ return 0;
+}
+int autocomplete_constructor_binlog_user_delete (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_binlog_user_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_real_len)) {
+ set_autocomplete_string ("flags");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ if (cur_token_len < 0) { return -1; }
+ if (!is_int ()) { return -1;}
+ struct paramed_type *var0 = INT2PTR (get_int ());
+ assert (var0);
+ local_next_token ();
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_real_len)) {
+ set_autocomplete_string ("access_hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field3) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "first_name", cur_token_real_len)) {
+ set_autocomplete_string ("first_name");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "first_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "last_name", cur_token_real_len)) {
+ set_autocomplete_string ("last_name");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "last_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field5) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "phone", cur_token_real_len)) {
+ set_autocomplete_string ("phone");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "phone", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field6) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "username", cur_token_real_len)) {
+ set_autocomplete_string ("username");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "username", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field7) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "photo", cur_token_real_len)) {
+ set_autocomplete_string ("photo");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_photo (field8) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "real_first_name", cur_token_real_len)) {
+ set_autocomplete_string ("real_first_name");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "real_first_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field9) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 14 && !cur_token_quoted && !memcmp (cur_token, "real_last_name", cur_token_real_len)) {
+ set_autocomplete_string ("real_last_name");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 14 && !memcmp (cur_token, "real_last_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field10) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "user_photo", cur_token_real_len)) {
+ set_autocomplete_string ("user_photo");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "user_photo", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9a486229, .id = "UserProfilePhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_user_profile_photo (field11) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "last_read_in", cur_token_real_len)) {
+ set_autocomplete_string ("last_read_in");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "last_read_in", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field12) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 25)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 13 && !cur_token_quoted && !memcmp (cur_token, "last_read_out", cur_token_real_len)) {
+ set_autocomplete_string ("last_read_out");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 13 && !memcmp (cur_token, "last_read_out", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field13) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "bot_info", cur_token_real_len)) {
+ set_autocomplete_string ("bot_info");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "bot_info", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb2e16f93, .id = "BotInfo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bot_info (field14) < 0) { return -1;}
+ }
+ return 0;
+}
+int autocomplete_constructor_binlog_chat_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_real_len)) {
+ set_autocomplete_string ("flags");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ if (cur_token_len < 0) { return -1; }
+ if (!is_int ()) { return -1;}
+ struct paramed_type *var0 = INT2PTR (get_int ());
+ assert (var0);
+ local_next_token ();
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_real_len)) {
+ set_autocomplete_string ("title");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "user_num", cur_token_real_len)) {
+ set_autocomplete_string ("user_num");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "user_num", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "version", cur_token_real_len)) {
+ set_autocomplete_string ("version");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "version", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field6) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "participants", cur_token_real_len)) {
+ set_autocomplete_string ("participants");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "participants", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc8d7493e, .id = "ChatParticipant", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field7) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "chat_photo", cur_token_real_len)) {
+ set_autocomplete_string ("chat_photo");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "chat_photo", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x56922676, .id = "ChatPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_chat_photo (field8) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "photo", cur_token_real_len)) {
+ set_autocomplete_string ("photo");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_photo (field9) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "admin", cur_token_real_len)) {
+ set_autocomplete_string ("admin");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "admin", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field10) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "last_read_in", cur_token_real_len)) {
+ set_autocomplete_string ("last_read_in");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "last_read_in", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field11) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 25)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 13 && !cur_token_quoted && !memcmp (cur_token, "last_read_out", cur_token_real_len)) {
+ set_autocomplete_string ("last_read_out");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 13 && !memcmp (cur_token, "last_read_out", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field12) < 0) { return -1;}
+ }
+ return 0;
+}
+int autocomplete_constructor_binlog_chat_add_participant (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "version", cur_token_real_len)) {
+ set_autocomplete_string ("version");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "version", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "inviter_id", cur_token_real_len)) {
+ set_autocomplete_string ("inviter_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "inviter_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_binlog_chat_del_participant (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "version", cur_token_real_len)) {
+ set_autocomplete_string ("version");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "version", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_binlog_set_msg_id (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "old_id", cur_token_real_len)) {
+ set_autocomplete_string ("old_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "old_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "new_id", cur_token_real_len)) {
+ set_autocomplete_string ("new_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "new_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_binlog_message_delete (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "lid", cur_token_real_len)) {
+ set_autocomplete_string ("lid");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "lid", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_binlog_message_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_real_len)) {
+ set_autocomplete_string ("flags");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ if (cur_token_len < 0) { return -1; }
+ if (!is_int ()) { return -1;}
+ struct paramed_type *var0 = INT2PTR (get_int ());
+ assert (var0);
+ local_next_token ();
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "lid", cur_token_real_len)) {
+ set_autocomplete_string ("lid");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "lid", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "from_id", cur_token_real_len)) {
+ set_autocomplete_string ("from_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "from_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "to_type", cur_token_real_len)) {
+ set_autocomplete_string ("to_type");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "to_type", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "to_id", cur_token_real_len)) {
+ set_autocomplete_string ("to_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "to_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "fwd_from_id", cur_token_real_len)) {
+ set_autocomplete_string ("fwd_from_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "fwd_from_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field6) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "fwd_date", cur_token_real_len)) {
+ set_autocomplete_string ("fwd_date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "fwd_date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field7) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field8) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_real_len)) {
+ set_autocomplete_string ("message");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field9) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "media", cur_token_real_len)) {
+ set_autocomplete_string ("media");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "media", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_message_media (field10) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "action", cur_token_real_len)) {
+ set_autocomplete_string ("action");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "action", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x383415fa, .id = "MessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_message_action (field11) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "reply_id", cur_token_real_len)) {
+ set_autocomplete_string ("reply_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "reply_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field12) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "reply_markup", cur_token_real_len)) {
+ set_autocomplete_string ("reply_markup");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "reply_markup", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x612ca4a9, .id = "ReplyMarkup", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_reply_markup (field13) < 0) { return -1;}
+ }
+ return 0;
+}
+int autocomplete_constructor_binlog_message_encr_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_real_len)) {
+ set_autocomplete_string ("flags");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ if (cur_token_len < 0) { return -1; }
+ if (!is_int ()) { return -1;}
+ struct paramed_type *var0 = INT2PTR (get_int ());
+ assert (var0);
+ local_next_token ();
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "lid", cur_token_real_len)) {
+ set_autocomplete_string ("lid");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "lid", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "from_id", cur_token_real_len)) {
+ set_autocomplete_string ("from_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "from_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "to_type", cur_token_real_len)) {
+ set_autocomplete_string ("to_type");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "to_type", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "to_id", cur_token_real_len)) {
+ set_autocomplete_string ("to_id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "to_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field6) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_real_len)) {
+ set_autocomplete_string ("message");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field7) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "encr_media", cur_token_real_len)) {
+ set_autocomplete_string ("encr_media");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "encr_media", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x34e0d674, .id = "DecryptedMessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_decrypted_message_media (field8) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "encr_action", cur_token_real_len)) {
+ set_autocomplete_string ("encr_action");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "encr_action", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4e0eefde, .id = "DecryptedMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_decrypted_message_action (field9) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "file", cur_token_real_len)) {
+ set_autocomplete_string ("file");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "file", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x886fd032, .id = "EncryptedFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_encrypted_file (field10) < 0) { return -1;}
+ }
+ return 0;
+}
+int autocomplete_constructor_binlog_msg_update (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "lid", cur_token_real_len)) {
+ set_autocomplete_string ("lid");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "lid", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_binlog_reset_authorization (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_contacts_blocked (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8c1b8fb4 && T->type->name != 0x73e4704b)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "blocked", cur_token_real_len)) {
+ set_autocomplete_string ("blocked");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "blocked", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x561bc879, .id = "ContactBlocked", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_contacts_blocked_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8c1b8fb4 && T->type->name != 0x73e4704b)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "count", cur_token_real_len)) {
+ set_autocomplete_string ("count");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "count", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "blocked", cur_token_real_len)) {
+ set_autocomplete_string ("blocked");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "blocked", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x561bc879, .id = "ContactBlocked", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_contacts_contacts_not_modified (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd8c02560 && T->type->name != 0x273fda9f)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_contacts_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd8c02560 && T->type->name != 0x273fda9f)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "contacts", cur_token_real_len)) {
+ set_autocomplete_string ("contacts");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "contacts", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf911c994, .id = "Contact", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_contacts_found (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0566000e && T->type->name != 0xfa99fff1)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "results", cur_token_real_len)) {
+ set_autocomplete_string ("results");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "results", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xea879f95, .id = "ContactFound", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_contacts_imported_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xad524315 && T->type->name != 0x52adbcea)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "imported", cur_token_real_len)) {
+ set_autocomplete_string ("imported");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "imported", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xd0028438, .id = "ImportedContact", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 14 && !cur_token_quoted && !memcmp (cur_token, "retry_contacts", cur_token_real_len)) {
+ set_autocomplete_string ("retry_contacts");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 14 && !memcmp (cur_token, "retry_contacts", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_contacts_link (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3ace484c && T->type->name != 0xc531b7b3)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "my_link", cur_token_real_len)) {
+ set_autocomplete_string ("my_link");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "my_link", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_contact_link (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "foreign_link", cur_token_real_len)) {
+ set_autocomplete_string ("foreign_link");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "foreign_link", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_contact_link (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "user", cur_token_real_len)) {
+ set_autocomplete_string ("user");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "user", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_user (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_contacts_suggested (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5649dcc5 && T->type->name != 0xa9b6233a)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "results", cur_token_real_len)) {
+ set_autocomplete_string ("results");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "results", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3de191a1, .id = "ContactSuggested", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_geochats_located (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x48feb267 && T->type->name != 0xb7014d98)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "results", cur_token_real_len)) {
+ set_autocomplete_string ("results");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "results", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3631cf4c, .id = "ChatLocated", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "messages", cur_token_real_len)) {
+ set_autocomplete_string ("messages");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "messages", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "chats", cur_token_real_len)) {
+ set_autocomplete_string ("chats");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "chats", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_geochats_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6d0a0e59 && T->type->name != 0x92f5f1a6)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "messages", cur_token_real_len)) {
+ set_autocomplete_string ("messages");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "messages", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "chats", cur_token_real_len)) {
+ set_autocomplete_string ("chats");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "chats", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_geochats_messages_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6d0a0e59 && T->type->name != 0x92f5f1a6)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "count", cur_token_real_len)) {
+ set_autocomplete_string ("count");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "count", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "messages", cur_token_real_len)) {
+ set_autocomplete_string ("messages");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "messages", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "chats", cur_token_real_len)) {
+ set_autocomplete_string ("chats");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "chats", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_geochats_stated_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17b1578b && T->type->name != 0xe84ea874)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_real_len)) {
+ set_autocomplete_string ("message");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_geo_chat_message (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "chats", cur_token_real_len)) {
+ set_autocomplete_string ("chats");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "chats", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "seq", cur_token_real_len)) {
+ set_autocomplete_string ("seq");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "seq", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_help_app_update (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4ddd9627 && T->type->name != 0xb22269d8)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "critical", cur_token_real_len)) {
+ set_autocomplete_string ("critical");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "critical", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bool (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "url", cur_token_real_len)) {
+ set_autocomplete_string ("url");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "url", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "text", cur_token_real_len)) {
+ set_autocomplete_string ("text");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "text", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_help_no_app_update (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4ddd9627 && T->type->name != 0xb22269d8)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_help_invite_text (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x18cb9f78 && T->type->name != 0xe7346087)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_help_support (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17c6b5f6 && T->type->name != 0xe8394a09)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "phone_number", cur_token_real_len)) {
+ set_autocomplete_string ("phone_number");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "phone_number", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "user", cur_token_real_len)) {
+ set_autocomplete_string ("user");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "user", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_user (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_messages_affected_history (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb45c69d1 && T->type->name != 0x4ba3962e)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_real_len)) {
+ set_autocomplete_string ("pts");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "pts_count", cur_token_real_len)) {
+ set_autocomplete_string ("pts_count");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "pts_count", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "offset", cur_token_real_len)) {
+ set_autocomplete_string ("offset");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "offset", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_messages_affected_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x84d19185 && T->type->name != 0x7b2e6e7a)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_real_len)) {
+ set_autocomplete_string ("pts");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "pts_count", cur_token_real_len)) {
+ set_autocomplete_string ("pts_count");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "pts_count", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_messages_all_stickers_not_modified (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb485502f && T->type->name != 0x4b7aafd0)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_messages_all_stickers (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb485502f && T->type->name != 0x4b7aafd0)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "hash", cur_token_real_len)) {
+ set_autocomplete_string ("hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "packs", cur_token_real_len)) {
+ set_autocomplete_string ("packs");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "packs", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x12b299d4, .id = "StickerPack", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "sets", cur_token_real_len)) {
+ set_autocomplete_string ("sets");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "sets", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa7a43b17, .id = "StickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "documents", cur_token_real_len)) {
+ set_autocomplete_string ("documents");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "documents", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_messages_chat_full (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe5d7d19c && T->type->name != 0x1a282e63)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "full_chat", cur_token_real_len)) {
+ set_autocomplete_string ("full_chat");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "full_chat", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02a614, .id = "ChatFull", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_chat_full (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "chats", cur_token_real_len)) {
+ set_autocomplete_string ("chats");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "chats", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_messages_chats (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x64ff9fd5 && T->type->name != 0x9b00602a)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_messages_dh_config_not_modified (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xecc058e8 && T->type->name != 0x133fa717)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "random", cur_token_real_len)) {
+ set_autocomplete_string ("random");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "random", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_messages_dh_config (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xecc058e8 && T->type->name != 0x133fa717)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "g", cur_token_real_len)) {
+ set_autocomplete_string ("g");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "g", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "p", cur_token_real_len)) {
+ set_autocomplete_string ("p");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "p", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "version", cur_token_real_len)) {
+ set_autocomplete_string ("version");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "version", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "random", cur_token_real_len)) {
+ set_autocomplete_string ("random");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "random", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_messages_dialogs (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x645af8b3 && T->type->name != 0x9ba5074c)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "dialogs", cur_token_real_len)) {
+ set_autocomplete_string ("dialogs");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "dialogs", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc1dd804a, .id = "Dialog", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "messages", cur_token_real_len)) {
+ set_autocomplete_string ("messages");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "messages", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "chats", cur_token_real_len)) {
+ set_autocomplete_string ("chats");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "chats", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_messages_dialogs_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x645af8b3 && T->type->name != 0x9ba5074c)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "count", cur_token_real_len)) {
+ set_autocomplete_string ("count");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "count", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "dialogs", cur_token_real_len)) {
+ set_autocomplete_string ("dialogs");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "dialogs", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc1dd804a, .id = "Dialog", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "messages", cur_token_real_len)) {
+ set_autocomplete_string ("messages");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "messages", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "chats", cur_token_real_len)) {
+ set_autocomplete_string ("chats");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "chats", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field5) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_messages_message_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3f4e0648 && T->type->name != 0xc0b1f9b7)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_messages_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8735e464 && T->type->name != 0x78ca1b9b)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "messages", cur_token_real_len)) {
+ set_autocomplete_string ("messages");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "messages", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "chats", cur_token_real_len)) {
+ set_autocomplete_string ("chats");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "chats", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_messages_messages_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8735e464 && T->type->name != 0x78ca1b9b)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "count", cur_token_real_len)) {
+ set_autocomplete_string ("count");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "count", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "messages", cur_token_real_len)) {
+ set_autocomplete_string ("messages");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "messages", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "chats", cur_token_real_len)) {
+ set_autocomplete_string ("chats");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "chats", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field4) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_messages_sent_encrypted_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc29c7607 && T->type->name != 0x3d6389f8)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_messages_sent_encrypted_file (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc29c7607 && T->type->name != 0x3d6389f8)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "file", cur_token_real_len)) {
+ set_autocomplete_string ("file");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "file", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x886fd032, .id = "EncryptedFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_encrypted_file (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_messages_sent_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x799ce190 && T->type->name != 0x86631e6f)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "media", cur_token_real_len)) {
+ set_autocomplete_string ("media");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "media", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_message_media (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_real_len)) {
+ set_autocomplete_string ("pts");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "pts_count", cur_token_real_len)) {
+ set_autocomplete_string ("pts_count");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "pts_count", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_messages_sent_message_link (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x799ce190 && T->type->name != 0x86631e6f)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "media", cur_token_real_len)) {
+ set_autocomplete_string ("media");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "media", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_message_media (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_real_len)) {
+ set_autocomplete_string ("pts");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "pts_count", cur_token_real_len)) {
+ set_autocomplete_string ("pts_count");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "pts_count", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "links", cur_token_real_len)) {
+ set_autocomplete_string ("links");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "links", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3ace484c, .id = "contacts.Link", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field6) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "seq", cur_token_real_len)) {
+ set_autocomplete_string ("seq");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "seq", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field7) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_messages_sticker_set (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb60a24a6 && T->type->name != 0x49f5db59)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "set", cur_token_real_len)) {
+ set_autocomplete_string ("set");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "set", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa7a43b17, .id = "StickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_sticker_set (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "packs", cur_token_real_len)) {
+ set_autocomplete_string ("packs");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "packs", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x12b299d4, .id = "StickerPack", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "documents", cur_token_real_len)) {
+ set_autocomplete_string ("documents");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "documents", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_messages_stickers_not_modified (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bfa5710 && T->type->name != 0x8405a8ef)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_messages_stickers (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bfa5710 && T->type->name != 0x8405a8ef)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "hash", cur_token_real_len)) {
+ set_autocomplete_string ("hash");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "stickers", cur_token_real_len)) {
+ set_autocomplete_string ("stickers");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "stickers", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_photos_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x20212ca8 && T->type->name != 0xdfded357)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "photo", cur_token_real_len)) {
+ set_autocomplete_string ("photo");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_photo (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_photos_photos (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x98cf75f1 && T->type->name != 0x67308a0e)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "photos", cur_token_real_len)) {
+ set_autocomplete_string ("photos");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "photos", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_photos_photos_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x98cf75f1 && T->type->name != 0x67308a0e)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "count", cur_token_real_len)) {
+ set_autocomplete_string ("count");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "count", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "photos", cur_token_real_len)) {
+ set_autocomplete_string ("photos");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "photos", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_storage_file_unknown (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_storage_file_jpeg (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_storage_file_gif (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_storage_file_png (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_storage_file_pdf (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_storage_file_mp3 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_storage_file_mov (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_storage_file_partial (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_storage_file_mp4 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_storage_file_webp (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int autocomplete_constructor_updates_difference_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf57a2419 && T->type->name != 0x0a85dbe6)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "seq", cur_token_real_len)) {
+ set_autocomplete_string ("seq");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "seq", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_updates_difference (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf57a2419 && T->type->name != 0x0a85dbe6)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "new_messages", cur_token_real_len)) {
+ set_autocomplete_string ("new_messages");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "new_messages", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 22 && !cur_token_quoted && !memcmp (cur_token, "new_encrypted_messages", cur_token_real_len)) {
+ set_autocomplete_string ("new_encrypted_messages");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 22 && !memcmp (cur_token, "new_encrypted_messages", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xce6b8a1e, .id = "EncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 13 && !cur_token_quoted && !memcmp (cur_token, "other_updates", cur_token_real_len)) {
+ set_autocomplete_string ("other_updates");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 13 && !memcmp (cur_token, "other_updates", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "chats", cur_token_real_len)) {
+ set_autocomplete_string ("chats");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "chats", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "state", cur_token_real_len)) {
+ set_autocomplete_string ("state");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "state", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa56c2a3e, .id = "updates.State", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_updates_state (field6) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_updates_difference_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf57a2419 && T->type->name != 0x0a85dbe6)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "new_messages", cur_token_real_len)) {
+ set_autocomplete_string ("new_messages");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "new_messages", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 22 && !cur_token_quoted && !memcmp (cur_token, "new_encrypted_messages", cur_token_real_len)) {
+ set_autocomplete_string ("new_encrypted_messages");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 22 && !memcmp (cur_token, "new_encrypted_messages", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xce6b8a1e, .id = "EncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 13 && !cur_token_quoted && !memcmp (cur_token, "other_updates", cur_token_real_len)) {
+ set_autocomplete_string ("other_updates");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 13 && !memcmp (cur_token, "other_updates", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "chats", cur_token_real_len)) {
+ set_autocomplete_string ("chats");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "chats", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field5) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 18 && !cur_token_quoted && !memcmp (cur_token, "intermediate_state", cur_token_real_len)) {
+ set_autocomplete_string ("intermediate_state");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 18 && !memcmp (cur_token, "intermediate_state", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa56c2a3e, .id = "updates.State", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_updates_state (field6) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_updates_state (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa56c2a3e && T->type->name != 0x5a93d5c1)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_real_len)) {
+ set_autocomplete_string ("pts");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "qts", cur_token_real_len)) {
+ set_autocomplete_string ("qts");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "qts", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "seq", cur_token_real_len)) {
+ set_autocomplete_string ("seq");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "seq", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "unread_count", cur_token_real_len)) {
+ set_autocomplete_string ("unread_count");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "unread_count", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_constructor_upload_file (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x096a18d5 && T->type->name != 0xf695e72a)) { return -1; }
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "type", cur_token_real_len)) {
+ set_autocomplete_string ("type");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "type", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3e2838a8, .id = "storage.FileType", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_storage_file_type (field1) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "mtime", cur_token_real_len)) {
+ set_autocomplete_string ("mtime");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "mtime", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "bytes", cur_token_real_len)) {
+ set_autocomplete_string ("bytes");
+ return -1;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "bytes", cur_token_len)) {
+ local_next_token ();
+ expect_token_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field3) < 0) { return -1;}
+ return 0;
+}
+int autocomplete_type_account_days_t_t_l (struct paramed_type *T) {
+ if (autocomplete_constructor_account_days_t_t_l (T) < 0) { return -1; }
+ return 0;
+}
+int autocomplete_type_bare_account_days_t_t_l (struct paramed_type *T) {
+ if (autocomplete_constructor_account_days_t_t_l (T) < 0) { return -1; }
+ return 0;
+}
+int do_autocomplete_type_account_days_t_t_l (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "accountDaysTTL", text_len)) { *R = tstrdup ("accountDaysTTL"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_audio (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_audio); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 10 && !memcmp (cur_token, "audioEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_audio_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 5 && !memcmp (cur_token, "audio", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_audio (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_audio (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_audio); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 10 && !memcmp (cur_token, "audioEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_audio_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 5 && !memcmp (cur_token, "audio", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_audio (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_audio (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "audioEmpty", text_len)) { *R = tstrdup ("audioEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "audio", text_len)) { *R = tstrdup ("audio"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_authorization (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_authorization); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "authorization", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_authorization (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_authorization (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_authorization); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "authorization", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_authorization (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_authorization (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "authorization", text_len)) { *R = tstrdup ("authorization"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_bool (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_bool); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 9 && !memcmp (cur_token, "boolFalse", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_bool_false (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 8 && !memcmp (cur_token, "boolTrue", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_bool_true (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_bool (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_bool); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 9 && !memcmp (cur_token, "boolFalse", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_bool_false (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 8 && !memcmp (cur_token, "boolTrue", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_bool_true (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_bool (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "boolFalse", text_len)) { *R = tstrdup ("boolFalse"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "boolTrue", text_len)) { *R = tstrdup ("boolTrue"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_bot_command (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_bot_command); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 10 && !memcmp (cur_token, "botCommand", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_bot_command (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "botCommandOld", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_bot_command_old (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_bot_command (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_bot_command); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 10 && !memcmp (cur_token, "botCommand", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_bot_command (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "botCommandOld", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_bot_command_old (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_bot_command (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "botCommand", text_len)) { *R = tstrdup ("botCommand"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "botCommandOld", text_len)) { *R = tstrdup ("botCommandOld"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_bot_info (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_bot_info); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 12 && !memcmp (cur_token, "botInfoEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_bot_info_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 7 && !memcmp (cur_token, "botInfo", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_bot_info (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_bot_info (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_bot_info); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 12 && !memcmp (cur_token, "botInfoEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_bot_info_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 7 && !memcmp (cur_token, "botInfo", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_bot_info (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_bot_info (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "botInfoEmpty", text_len)) { *R = tstrdup ("botInfoEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "botInfo", text_len)) { *R = tstrdup ("botInfo"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_bytes (struct paramed_type *T) {
+ if (autocomplete_constructor_bytes (T) < 0) { return -1; }
+ return 0;
+}
+int autocomplete_type_bare_bytes (struct paramed_type *T) {
+ if (autocomplete_constructor_bytes (T) < 0) { return -1; }
+ return 0;
+}
+int do_autocomplete_type_bytes (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "bytes", text_len)) { *R = tstrdup ("bytes"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_chat (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_chat); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 9 && !memcmp (cur_token, "chatEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_chat_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 4 && !memcmp (cur_token, "chat", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_chat (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "chatForbidden", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_chat_forbidden (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 7 && !memcmp (cur_token, "geoChat", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_geo_chat (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_chat (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_chat); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 9 && !memcmp (cur_token, "chatEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_chat_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 4 && !memcmp (cur_token, "chat", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_chat (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "chatForbidden", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_chat_forbidden (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 7 && !memcmp (cur_token, "geoChat", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_geo_chat (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_chat (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "chatEmpty", text_len)) { *R = tstrdup ("chatEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "chat", text_len)) { *R = tstrdup ("chat"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "chatForbidden", text_len)) { *R = tstrdup ("chatForbidden"); return index; } else { index ++; }}
+ if (index == 3) { if (!strncmp (text, "geoChat", text_len)) { *R = tstrdup ("geoChat"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_chat_full (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_chat_full); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 8 && !memcmp (cur_token, "chatFull", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_chat_full (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_chat_full (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_chat_full); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 8 && !memcmp (cur_token, "chatFull", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_chat_full (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_chat_full (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "chatFull", text_len)) { *R = tstrdup ("chatFull"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_chat_invite (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_chat_invite); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "chatInviteAlready", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_chat_invite_already (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 10 && !memcmp (cur_token, "chatInvite", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_chat_invite (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_chat_invite (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_chat_invite); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "chatInviteAlready", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_chat_invite_already (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 10 && !memcmp (cur_token, "chatInvite", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_chat_invite (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_chat_invite (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "chatInviteAlready", text_len)) { *R = tstrdup ("chatInviteAlready"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "chatInvite", text_len)) { *R = tstrdup ("chatInvite"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_chat_located (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_chat_located); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 11 && !memcmp (cur_token, "chatLocated", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_chat_located (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_chat_located (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_chat_located); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 11 && !memcmp (cur_token, "chatLocated", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_chat_located (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_chat_located (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "chatLocated", text_len)) { *R = tstrdup ("chatLocated"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_chat_participant (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_chat_participant); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "chatParticipant", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_chat_participant (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_chat_participant (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_chat_participant); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "chatParticipant", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_chat_participant (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_chat_participant (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "chatParticipant", text_len)) { *R = tstrdup ("chatParticipant"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_chat_participants (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_chat_participants); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 25 && !memcmp (cur_token, "chatParticipantsForbidden", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_chat_participants_forbidden (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "chatParticipants", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_chat_participants (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_chat_participants (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_chat_participants); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 25 && !memcmp (cur_token, "chatParticipantsForbidden", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_chat_participants_forbidden (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "chatParticipants", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_chat_participants (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_chat_participants (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "chatParticipantsForbidden", text_len)) { *R = tstrdup ("chatParticipantsForbidden"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "chatParticipants", text_len)) { *R = tstrdup ("chatParticipants"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_chat_photo (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_chat_photo); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "chatPhotoEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_chat_photo_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 9 && !memcmp (cur_token, "chatPhoto", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_chat_photo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_chat_photo (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_chat_photo); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "chatPhotoEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_chat_photo_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 9 && !memcmp (cur_token, "chatPhoto", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_chat_photo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_chat_photo (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "chatPhotoEmpty", text_len)) { *R = tstrdup ("chatPhotoEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "chatPhoto", text_len)) { *R = tstrdup ("chatPhoto"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_client_d_h_inner_data (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_client_d_h_inner_data); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 20 && !memcmp (cur_token, "client_DH_inner_data", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_client_d_h_inner_data (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_client_d_h_inner_data (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_client_d_h_inner_data); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 20 && !memcmp (cur_token, "client_DH_inner_data", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_client_d_h_inner_data (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_client_d_h_inner_data (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "client_DH_inner_data", text_len)) { *R = tstrdup ("client_DH_inner_data"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_config (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_config); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 6 && !memcmp (cur_token, "config", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_config (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_config (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_config); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 6 && !memcmp (cur_token, "config", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_config (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_config (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "config", text_len)) { *R = tstrdup ("config"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_contact (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_contact); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 7 && !memcmp (cur_token, "contact", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contact (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_contact (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_contact); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 7 && !memcmp (cur_token, "contact", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contact (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_contact (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "contact", text_len)) { *R = tstrdup ("contact"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_contact_blocked (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_contact_blocked); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "contactBlocked", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contact_blocked (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_contact_blocked (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_contact_blocked); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "contactBlocked", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contact_blocked (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_contact_blocked (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "contactBlocked", text_len)) { *R = tstrdup ("contactBlocked"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_contact_found (struct paramed_type *T) {
+ if (autocomplete_constructor_contact_found (T) < 0) { return -1; }
+ return 0;
+}
+int autocomplete_type_bare_contact_found (struct paramed_type *T) {
+ if (autocomplete_constructor_contact_found (T) < 0) { return -1; }
+ return 0;
+}
+int do_autocomplete_type_contact_found (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "contactFound", text_len)) { *R = tstrdup ("contactFound"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_contact_link (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_contact_link); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "contactLinkUnknown", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contact_link_unknown (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "contactLinkNone", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contact_link_none (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "contactLinkHasPhone", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contact_link_has_phone (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "contactLinkContact", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contact_link_contact (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_contact_link (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_contact_link); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "contactLinkUnknown", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contact_link_unknown (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "contactLinkNone", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contact_link_none (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "contactLinkHasPhone", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contact_link_has_phone (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "contactLinkContact", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contact_link_contact (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_contact_link (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "contactLinkUnknown", text_len)) { *R = tstrdup ("contactLinkUnknown"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "contactLinkNone", text_len)) { *R = tstrdup ("contactLinkNone"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "contactLinkHasPhone", text_len)) { *R = tstrdup ("contactLinkHasPhone"); return index; } else { index ++; }}
+ if (index == 3) { if (!strncmp (text, "contactLinkContact", text_len)) { *R = tstrdup ("contactLinkContact"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_contact_status (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_contact_status); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "contactStatus", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contact_status (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_contact_status (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_contact_status); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "contactStatus", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contact_status (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_contact_status (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "contactStatus", text_len)) { *R = tstrdup ("contactStatus"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_contact_suggested (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_contact_suggested); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 16 && !memcmp (cur_token, "contactSuggested", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contact_suggested (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_contact_suggested (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_contact_suggested); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 16 && !memcmp (cur_token, "contactSuggested", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contact_suggested (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_contact_suggested (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "contactSuggested", text_len)) { *R = tstrdup ("contactSuggested"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_dc_option (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_dc_option); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 11 && !memcmp (cur_token, "dcOptionL28", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_dc_option_l28 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 8 && !memcmp (cur_token, "dcOption", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_dc_option (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_dc_option (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_dc_option); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 11 && !memcmp (cur_token, "dcOptionL28", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_dc_option_l28 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 8 && !memcmp (cur_token, "dcOption", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_dc_option (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_dc_option (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "dcOptionL28", text_len)) { *R = tstrdup ("dcOptionL28"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "dcOption", text_len)) { *R = tstrdup ("dcOption"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_decrypted_message (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_decrypted_message); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 16 && !memcmp (cur_token, "decryptedMessage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "decryptedMessageService", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_service (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_decrypted_message (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_decrypted_message); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 16 && !memcmp (cur_token, "decryptedMessage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "decryptedMessageService", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_service (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_decrypted_message (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "decryptedMessage", text_len)) { *R = tstrdup ("decryptedMessage"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "decryptedMessageService", text_len)) { *R = tstrdup ("decryptedMessageService"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_decrypted_message_action (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_decrypted_message_action); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 35 && !memcmp (cur_token, "decryptedMessageActionSetMessageTTL", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_action_set_message_t_t_l (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 34 && !memcmp (cur_token, "decryptedMessageActionReadMessages", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_action_read_messages (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 36 && !memcmp (cur_token, "decryptedMessageActionDeleteMessages", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_action_delete_messages (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 40 && !memcmp (cur_token, "decryptedMessageActionScreenshotMessages", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_action_screenshot_messages (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 34 && !memcmp (cur_token, "decryptedMessageActionFlushHistory", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_action_flush_history (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "decryptedMessageActionResend", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_action_resend (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 33 && !memcmp (cur_token, "decryptedMessageActionNotifyLayer", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_action_notify_layer (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "decryptedMessageActionTyping", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_action_typing (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 32 && !memcmp (cur_token, "decryptedMessageActionRequestKey", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_action_request_key (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 31 && !memcmp (cur_token, "decryptedMessageActionAcceptKey", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_action_accept_key (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 30 && !memcmp (cur_token, "decryptedMessageActionAbortKey", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_action_abort_key (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 31 && !memcmp (cur_token, "decryptedMessageActionCommitKey", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_action_commit_key (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "decryptedMessageActionNoop", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_action_noop (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_decrypted_message_action (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_decrypted_message_action); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 35 && !memcmp (cur_token, "decryptedMessageActionSetMessageTTL", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_action_set_message_t_t_l (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 34 && !memcmp (cur_token, "decryptedMessageActionReadMessages", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_action_read_messages (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 36 && !memcmp (cur_token, "decryptedMessageActionDeleteMessages", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_action_delete_messages (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 40 && !memcmp (cur_token, "decryptedMessageActionScreenshotMessages", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_action_screenshot_messages (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 34 && !memcmp (cur_token, "decryptedMessageActionFlushHistory", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_action_flush_history (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "decryptedMessageActionResend", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_action_resend (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 33 && !memcmp (cur_token, "decryptedMessageActionNotifyLayer", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_action_notify_layer (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "decryptedMessageActionTyping", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_action_typing (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 32 && !memcmp (cur_token, "decryptedMessageActionRequestKey", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_action_request_key (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 31 && !memcmp (cur_token, "decryptedMessageActionAcceptKey", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_action_accept_key (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 30 && !memcmp (cur_token, "decryptedMessageActionAbortKey", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_action_abort_key (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 31 && !memcmp (cur_token, "decryptedMessageActionCommitKey", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_action_commit_key (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "decryptedMessageActionNoop", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_action_noop (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_decrypted_message_action (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "decryptedMessageActionSetMessageTTL", text_len)) { *R = tstrdup ("decryptedMessageActionSetMessageTTL"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "decryptedMessageActionReadMessages", text_len)) { *R = tstrdup ("decryptedMessageActionReadMessages"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "decryptedMessageActionDeleteMessages", text_len)) { *R = tstrdup ("decryptedMessageActionDeleteMessages"); return index; } else { index ++; }}
+ if (index == 3) { if (!strncmp (text, "decryptedMessageActionScreenshotMessages", text_len)) { *R = tstrdup ("decryptedMessageActionScreenshotMessages"); return index; } else { index ++; }}
+ if (index == 4) { if (!strncmp (text, "decryptedMessageActionFlushHistory", text_len)) { *R = tstrdup ("decryptedMessageActionFlushHistory"); return index; } else { index ++; }}
+ if (index == 5) { if (!strncmp (text, "decryptedMessageActionResend", text_len)) { *R = tstrdup ("decryptedMessageActionResend"); return index; } else { index ++; }}
+ if (index == 6) { if (!strncmp (text, "decryptedMessageActionNotifyLayer", text_len)) { *R = tstrdup ("decryptedMessageActionNotifyLayer"); return index; } else { index ++; }}
+ if (index == 7) { if (!strncmp (text, "decryptedMessageActionTyping", text_len)) { *R = tstrdup ("decryptedMessageActionTyping"); return index; } else { index ++; }}
+ if (index == 8) { if (!strncmp (text, "decryptedMessageActionRequestKey", text_len)) { *R = tstrdup ("decryptedMessageActionRequestKey"); return index; } else { index ++; }}
+ if (index == 9) { if (!strncmp (text, "decryptedMessageActionAcceptKey", text_len)) { *R = tstrdup ("decryptedMessageActionAcceptKey"); return index; } else { index ++; }}
+ if (index == 10) { if (!strncmp (text, "decryptedMessageActionAbortKey", text_len)) { *R = tstrdup ("decryptedMessageActionAbortKey"); return index; } else { index ++; }}
+ if (index == 11) { if (!strncmp (text, "decryptedMessageActionCommitKey", text_len)) { *R = tstrdup ("decryptedMessageActionCommitKey"); return index; } else { index ++; }}
+ if (index == 12) { if (!strncmp (text, "decryptedMessageActionNoop", text_len)) { *R = tstrdup ("decryptedMessageActionNoop"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_decrypted_message_layer (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_decrypted_message_layer); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 21 && !memcmp (cur_token, "decryptedMessageLayer", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_layer (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_decrypted_message_layer (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_decrypted_message_layer); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 21 && !memcmp (cur_token, "decryptedMessageLayer", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_layer (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_decrypted_message_layer (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "decryptedMessageLayer", text_len)) { *R = tstrdup ("decryptedMessageLayer"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_decrypted_message_media (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_decrypted_message_media); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 26 && !memcmp (cur_token, "decryptedMessageMediaEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_media_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "decryptedMessageMediaPhoto", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_media_photo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "decryptedMessageMediaGeoPoint", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_media_geo_point (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "decryptedMessageMediaContact", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_media_contact (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "decryptedMessageMediaDocument", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_media_document (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "decryptedMessageMediaVideo", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_media_video (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "decryptedMessageMediaAudio", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_media_audio (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 37 && !memcmp (cur_token, "decryptedMessageMediaExternalDocument", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_media_external_document (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "decryptedMessageMediaVideoL12", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_media_video_l12 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "decryptedMessageMediaAudioL12", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_media_audio_l12 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_decrypted_message_media (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_decrypted_message_media); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 26 && !memcmp (cur_token, "decryptedMessageMediaEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_media_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "decryptedMessageMediaPhoto", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_media_photo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "decryptedMessageMediaGeoPoint", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_media_geo_point (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "decryptedMessageMediaContact", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_media_contact (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "decryptedMessageMediaDocument", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_media_document (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "decryptedMessageMediaVideo", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_media_video (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "decryptedMessageMediaAudio", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_media_audio (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 37 && !memcmp (cur_token, "decryptedMessageMediaExternalDocument", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_media_external_document (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "decryptedMessageMediaVideoL12", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_media_video_l12 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "decryptedMessageMediaAudioL12", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_decrypted_message_media_audio_l12 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_decrypted_message_media (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "decryptedMessageMediaEmpty", text_len)) { *R = tstrdup ("decryptedMessageMediaEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "decryptedMessageMediaPhoto", text_len)) { *R = tstrdup ("decryptedMessageMediaPhoto"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "decryptedMessageMediaGeoPoint", text_len)) { *R = tstrdup ("decryptedMessageMediaGeoPoint"); return index; } else { index ++; }}
+ if (index == 3) { if (!strncmp (text, "decryptedMessageMediaContact", text_len)) { *R = tstrdup ("decryptedMessageMediaContact"); return index; } else { index ++; }}
+ if (index == 4) { if (!strncmp (text, "decryptedMessageMediaDocument", text_len)) { *R = tstrdup ("decryptedMessageMediaDocument"); return index; } else { index ++; }}
+ if (index == 5) { if (!strncmp (text, "decryptedMessageMediaVideo", text_len)) { *R = tstrdup ("decryptedMessageMediaVideo"); return index; } else { index ++; }}
+ if (index == 6) { if (!strncmp (text, "decryptedMessageMediaAudio", text_len)) { *R = tstrdup ("decryptedMessageMediaAudio"); return index; } else { index ++; }}
+ if (index == 7) { if (!strncmp (text, "decryptedMessageMediaExternalDocument", text_len)) { *R = tstrdup ("decryptedMessageMediaExternalDocument"); return index; } else { index ++; }}
+ if (index == 8) { if (!strncmp (text, "decryptedMessageMediaVideoL12", text_len)) { *R = tstrdup ("decryptedMessageMediaVideoL12"); return index; } else { index ++; }}
+ if (index == 9) { if (!strncmp (text, "decryptedMessageMediaAudioL12", text_len)) { *R = tstrdup ("decryptedMessageMediaAudioL12"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_dialog (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_dialog); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 6 && !memcmp (cur_token, "dialog", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_dialog (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_dialog (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_dialog); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 6 && !memcmp (cur_token, "dialog", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_dialog (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_dialog (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "dialog", text_len)) { *R = tstrdup ("dialog"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_disabled_feature (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_disabled_feature); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "disabledFeature", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_disabled_feature (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_disabled_feature (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_disabled_feature); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "disabledFeature", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_disabled_feature (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_disabled_feature (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "disabledFeature", text_len)) { *R = tstrdup ("disabledFeature"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_document (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_document); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "documentEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_document_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 8 && !memcmp (cur_token, "document", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_document (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 12 && !memcmp (cur_token, "document_l19", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_document_l19 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_document (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_document); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "documentEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_document_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 8 && !memcmp (cur_token, "document", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_document (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 12 && !memcmp (cur_token, "document_l19", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_document_l19 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_document (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "documentEmpty", text_len)) { *R = tstrdup ("documentEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "document", text_len)) { *R = tstrdup ("document"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "document_l19", text_len)) { *R = tstrdup ("document_l19"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_document_attribute (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_document_attribute); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 26 && !memcmp (cur_token, "documentAttributeImageSize", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_document_attribute_image_size (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "documentAttributeAnimated", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_document_attribute_animated (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "documentAttributeStickerL28", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_document_attribute_sticker_l28 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "documentAttributeSticker", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_document_attribute_sticker (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "documentAttributeVideo", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_document_attribute_video (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "documentAttributeAudio", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_document_attribute_audio (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "documentAttributeFilename", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_document_attribute_filename (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_document_attribute (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_document_attribute); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 26 && !memcmp (cur_token, "documentAttributeImageSize", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_document_attribute_image_size (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "documentAttributeAnimated", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_document_attribute_animated (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "documentAttributeStickerL28", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_document_attribute_sticker_l28 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "documentAttributeSticker", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_document_attribute_sticker (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "documentAttributeVideo", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_document_attribute_video (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "documentAttributeAudio", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_document_attribute_audio (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "documentAttributeFilename", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_document_attribute_filename (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_document_attribute (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "documentAttributeImageSize", text_len)) { *R = tstrdup ("documentAttributeImageSize"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "documentAttributeAnimated", text_len)) { *R = tstrdup ("documentAttributeAnimated"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "documentAttributeStickerL28", text_len)) { *R = tstrdup ("documentAttributeStickerL28"); return index; } else { index ++; }}
+ if (index == 3) { if (!strncmp (text, "documentAttributeSticker", text_len)) { *R = tstrdup ("documentAttributeSticker"); return index; } else { index ++; }}
+ if (index == 4) { if (!strncmp (text, "documentAttributeVideo", text_len)) { *R = tstrdup ("documentAttributeVideo"); return index; } else { index ++; }}
+ if (index == 5) { if (!strncmp (text, "documentAttributeAudio", text_len)) { *R = tstrdup ("documentAttributeAudio"); return index; } else { index ++; }}
+ if (index == 6) { if (!strncmp (text, "documentAttributeFilename", text_len)) { *R = tstrdup ("documentAttributeFilename"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_double (struct paramed_type *T) {
+ if (autocomplete_constructor_double (T) < 0) { return -1; }
+ return 0;
+}
+int autocomplete_type_bare_double (struct paramed_type *T) {
+ if (autocomplete_constructor_double (T) < 0) { return -1; }
+ return 0;
+}
+int do_autocomplete_type_double (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "double", text_len)) { *R = tstrdup ("double"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_encrypted_chat (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_encrypted_chat); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "encryptedChatEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_encrypted_chat_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "encryptedChatWaiting", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_encrypted_chat_waiting (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "encryptedChatRequested", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_encrypted_chat_requested (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "encryptedChat", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_encrypted_chat (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "encryptedChatDiscarded", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_encrypted_chat_discarded (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_encrypted_chat (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_encrypted_chat); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "encryptedChatEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_encrypted_chat_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "encryptedChatWaiting", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_encrypted_chat_waiting (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "encryptedChatRequested", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_encrypted_chat_requested (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "encryptedChat", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_encrypted_chat (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "encryptedChatDiscarded", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_encrypted_chat_discarded (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_encrypted_chat (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "encryptedChatEmpty", text_len)) { *R = tstrdup ("encryptedChatEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "encryptedChatWaiting", text_len)) { *R = tstrdup ("encryptedChatWaiting"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "encryptedChatRequested", text_len)) { *R = tstrdup ("encryptedChatRequested"); return index; } else { index ++; }}
+ if (index == 3) { if (!strncmp (text, "encryptedChat", text_len)) { *R = tstrdup ("encryptedChat"); return index; } else { index ++; }}
+ if (index == 4) { if (!strncmp (text, "encryptedChatDiscarded", text_len)) { *R = tstrdup ("encryptedChatDiscarded"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_encrypted_file (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_encrypted_file); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "encryptedFileEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_encrypted_file_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "encryptedFile", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_encrypted_file (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_encrypted_file (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_encrypted_file); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "encryptedFileEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_encrypted_file_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "encryptedFile", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_encrypted_file (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_encrypted_file (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "encryptedFileEmpty", text_len)) { *R = tstrdup ("encryptedFileEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "encryptedFile", text_len)) { *R = tstrdup ("encryptedFile"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_encrypted_message (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_encrypted_message); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 16 && !memcmp (cur_token, "encryptedMessage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_encrypted_message (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "encryptedMessageService", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_encrypted_message_service (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_encrypted_message (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_encrypted_message); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 16 && !memcmp (cur_token, "encryptedMessage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_encrypted_message (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "encryptedMessageService", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_encrypted_message_service (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_encrypted_message (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "encryptedMessage", text_len)) { *R = tstrdup ("encryptedMessage"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "encryptedMessageService", text_len)) { *R = tstrdup ("encryptedMessageService"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_error (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_error); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 5 && !memcmp (cur_token, "error", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_error (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_error (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_error); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 5 && !memcmp (cur_token, "error", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_error (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_error (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "error", text_len)) { *R = tstrdup ("error"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_exported_chat_invite (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_exported_chat_invite); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "chatInviteEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_chat_invite_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "chatInviteExported", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_chat_invite_exported (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_exported_chat_invite (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_exported_chat_invite); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "chatInviteEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_chat_invite_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "chatInviteExported", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_chat_invite_exported (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_exported_chat_invite (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "chatInviteEmpty", text_len)) { *R = tstrdup ("chatInviteEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "chatInviteExported", text_len)) { *R = tstrdup ("chatInviteExported"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_file_location (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_file_location); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 23 && !memcmp (cur_token, "fileLocationUnavailable", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_file_location_unavailable (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 12 && !memcmp (cur_token, "fileLocation", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_file_location (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_file_location (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_file_location); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 23 && !memcmp (cur_token, "fileLocationUnavailable", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_file_location_unavailable (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 12 && !memcmp (cur_token, "fileLocation", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_file_location (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_file_location (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "fileLocationUnavailable", text_len)) { *R = tstrdup ("fileLocationUnavailable"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "fileLocation", text_len)) { *R = tstrdup ("fileLocation"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_geo_chat_message (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_geo_chat_message); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 19 && !memcmp (cur_token, "geoChatMessageEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_geo_chat_message_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "geoChatMessage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_geo_chat_message (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "geoChatMessageService", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_geo_chat_message_service (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_geo_chat_message (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_geo_chat_message); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 19 && !memcmp (cur_token, "geoChatMessageEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_geo_chat_message_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "geoChatMessage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_geo_chat_message (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "geoChatMessageService", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_geo_chat_message_service (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_geo_chat_message (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "geoChatMessageEmpty", text_len)) { *R = tstrdup ("geoChatMessageEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "geoChatMessage", text_len)) { *R = tstrdup ("geoChatMessage"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "geoChatMessageService", text_len)) { *R = tstrdup ("geoChatMessageService"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_geo_point (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_geo_point); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "geoPointEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_geo_point_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 8 && !memcmp (cur_token, "geoPoint", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_geo_point (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_geo_point (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_geo_point); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "geoPointEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_geo_point_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 8 && !memcmp (cur_token, "geoPoint", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_geo_point (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_geo_point (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "geoPointEmpty", text_len)) { *R = tstrdup ("geoPointEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "geoPoint", text_len)) { *R = tstrdup ("geoPoint"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_imported_contact (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_imported_contact); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "importedContact", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_imported_contact (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_imported_contact (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_imported_contact); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "importedContact", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_imported_contact (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_imported_contact (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "importedContact", text_len)) { *R = tstrdup ("importedContact"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_input_app_event (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_app_event); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "inputAppEvent", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_app_event (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_input_app_event (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_app_event); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "inputAppEvent", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_app_event (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_input_app_event (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "inputAppEvent", text_len)) { *R = tstrdup ("inputAppEvent"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_input_audio (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_audio); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputAudioEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_audio_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 10 && !memcmp (cur_token, "inputAudio", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_audio (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_input_audio (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_audio); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputAudioEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_audio_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 10 && !memcmp (cur_token, "inputAudio", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_audio (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_input_audio (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "inputAudioEmpty", text_len)) { *R = tstrdup ("inputAudioEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "inputAudio", text_len)) { *R = tstrdup ("inputAudio"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_input_chat_photo (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_chat_photo); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 19 && !memcmp (cur_token, "inputChatPhotoEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_chat_photo_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "inputChatUploadedPhoto", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_chat_uploaded_photo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "inputChatPhoto", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_chat_photo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_input_chat_photo (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_chat_photo); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 19 && !memcmp (cur_token, "inputChatPhotoEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_chat_photo_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "inputChatUploadedPhoto", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_chat_uploaded_photo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "inputChatPhoto", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_chat_photo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_input_chat_photo (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "inputChatPhotoEmpty", text_len)) { *R = tstrdup ("inputChatPhotoEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "inputChatUploadedPhoto", text_len)) { *R = tstrdup ("inputChatUploadedPhoto"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "inputChatPhoto", text_len)) { *R = tstrdup ("inputChatPhoto"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_input_contact (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_contact); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "inputPhoneContact", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_phone_contact (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_input_contact (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_contact); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "inputPhoneContact", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_phone_contact (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_input_contact (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "inputPhoneContact", text_len)) { *R = tstrdup ("inputPhoneContact"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_input_document (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_document); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "inputDocumentEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_document_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "inputDocument", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_document (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_input_document (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_document); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "inputDocumentEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_document_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "inputDocument", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_document (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_input_document (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "inputDocumentEmpty", text_len)) { *R = tstrdup ("inputDocumentEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "inputDocument", text_len)) { *R = tstrdup ("inputDocument"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_input_encrypted_chat (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_encrypted_chat); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "inputEncryptedChat", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_encrypted_chat (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_input_encrypted_chat (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_encrypted_chat); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "inputEncryptedChat", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_encrypted_chat (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_input_encrypted_chat (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "inputEncryptedChat", text_len)) { *R = tstrdup ("inputEncryptedChat"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_input_encrypted_file (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_encrypted_file); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 23 && !memcmp (cur_token, "inputEncryptedFileEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_encrypted_file_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "inputEncryptedFileUploaded", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_encrypted_file_uploaded (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "inputEncryptedFile", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_encrypted_file (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "inputEncryptedFileBigUploaded", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_encrypted_file_big_uploaded (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_input_encrypted_file (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_encrypted_file); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 23 && !memcmp (cur_token, "inputEncryptedFileEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_encrypted_file_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "inputEncryptedFileUploaded", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_encrypted_file_uploaded (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "inputEncryptedFile", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_encrypted_file (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "inputEncryptedFileBigUploaded", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_encrypted_file_big_uploaded (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_input_encrypted_file (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "inputEncryptedFileEmpty", text_len)) { *R = tstrdup ("inputEncryptedFileEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "inputEncryptedFileUploaded", text_len)) { *R = tstrdup ("inputEncryptedFileUploaded"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "inputEncryptedFile", text_len)) { *R = tstrdup ("inputEncryptedFile"); return index; } else { index ++; }}
+ if (index == 3) { if (!strncmp (text, "inputEncryptedFileBigUploaded", text_len)) { *R = tstrdup ("inputEncryptedFileBigUploaded"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_input_file (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_file); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 9 && !memcmp (cur_token, "inputFile", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_file (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 12 && !memcmp (cur_token, "inputFileBig", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_file_big (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_input_file (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_file); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 9 && !memcmp (cur_token, "inputFile", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_file (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 12 && !memcmp (cur_token, "inputFileBig", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_file_big (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_input_file (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "inputFile", text_len)) { *R = tstrdup ("inputFile"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "inputFileBig", text_len)) { *R = tstrdup ("inputFileBig"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_input_file_location (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_file_location); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "inputFileLocation", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_file_location (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "inputVideoFileLocation", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_video_file_location (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "inputEncryptedFileLocation", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_encrypted_file_location (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "inputAudioFileLocation", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_audio_file_location (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "inputDocumentFileLocation", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_document_file_location (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_input_file_location (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_file_location); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "inputFileLocation", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_file_location (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "inputVideoFileLocation", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_video_file_location (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "inputEncryptedFileLocation", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_encrypted_file_location (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "inputAudioFileLocation", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_audio_file_location (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "inputDocumentFileLocation", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_document_file_location (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_input_file_location (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "inputFileLocation", text_len)) { *R = tstrdup ("inputFileLocation"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "inputVideoFileLocation", text_len)) { *R = tstrdup ("inputVideoFileLocation"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "inputEncryptedFileLocation", text_len)) { *R = tstrdup ("inputEncryptedFileLocation"); return index; } else { index ++; }}
+ if (index == 3) { if (!strncmp (text, "inputAudioFileLocation", text_len)) { *R = tstrdup ("inputAudioFileLocation"); return index; } else { index ++; }}
+ if (index == 4) { if (!strncmp (text, "inputDocumentFileLocation", text_len)) { *R = tstrdup ("inputDocumentFileLocation"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_input_geo_chat (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_geo_chat); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 12 && !memcmp (cur_token, "inputGeoChat", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_geo_chat (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_input_geo_chat (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_geo_chat); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 12 && !memcmp (cur_token, "inputGeoChat", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_geo_chat (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_input_geo_chat (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "inputGeoChat", text_len)) { *R = tstrdup ("inputGeoChat"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_input_geo_point (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_geo_point); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "inputGeoPointEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_geo_point_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "inputGeoPoint", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_geo_point (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_input_geo_point (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_geo_point); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "inputGeoPointEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_geo_point_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "inputGeoPoint", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_geo_point (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_input_geo_point (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "inputGeoPointEmpty", text_len)) { *R = tstrdup ("inputGeoPointEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "inputGeoPoint", text_len)) { *R = tstrdup ("inputGeoPoint"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_input_media (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_media); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputMediaEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_media_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "inputMediaUploadedPhoto", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_media_uploaded_photo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputMediaPhoto", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_media_photo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "inputMediaGeoPoint", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_media_geo_point (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "inputMediaContact", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_media_contact (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "inputMediaUploadedVideo", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_media_uploaded_video (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "inputMediaUploadedThumbVideo", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_media_uploaded_thumb_video (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputMediaVideo", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_media_video (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "inputMediaUploadedAudio", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_media_uploaded_audio (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputMediaAudio", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_media_audio (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "inputMediaUploadedDocument", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_media_uploaded_document (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 31 && !memcmp (cur_token, "inputMediaUploadedThumbDocument", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_media_uploaded_thumb_document (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "inputMediaDocument", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_media_document (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputMediaVenue", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_media_venue (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_input_media (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_media); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputMediaEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_media_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "inputMediaUploadedPhoto", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_media_uploaded_photo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputMediaPhoto", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_media_photo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "inputMediaGeoPoint", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_media_geo_point (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "inputMediaContact", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_media_contact (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "inputMediaUploadedVideo", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_media_uploaded_video (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "inputMediaUploadedThumbVideo", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_media_uploaded_thumb_video (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputMediaVideo", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_media_video (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "inputMediaUploadedAudio", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_media_uploaded_audio (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputMediaAudio", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_media_audio (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "inputMediaUploadedDocument", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_media_uploaded_document (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 31 && !memcmp (cur_token, "inputMediaUploadedThumbDocument", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_media_uploaded_thumb_document (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "inputMediaDocument", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_media_document (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputMediaVenue", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_media_venue (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_input_media (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "inputMediaEmpty", text_len)) { *R = tstrdup ("inputMediaEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "inputMediaUploadedPhoto", text_len)) { *R = tstrdup ("inputMediaUploadedPhoto"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "inputMediaPhoto", text_len)) { *R = tstrdup ("inputMediaPhoto"); return index; } else { index ++; }}
+ if (index == 3) { if (!strncmp (text, "inputMediaGeoPoint", text_len)) { *R = tstrdup ("inputMediaGeoPoint"); return index; } else { index ++; }}
+ if (index == 4) { if (!strncmp (text, "inputMediaContact", text_len)) { *R = tstrdup ("inputMediaContact"); return index; } else { index ++; }}
+ if (index == 5) { if (!strncmp (text, "inputMediaUploadedVideo", text_len)) { *R = tstrdup ("inputMediaUploadedVideo"); return index; } else { index ++; }}
+ if (index == 6) { if (!strncmp (text, "inputMediaUploadedThumbVideo", text_len)) { *R = tstrdup ("inputMediaUploadedThumbVideo"); return index; } else { index ++; }}
+ if (index == 7) { if (!strncmp (text, "inputMediaVideo", text_len)) { *R = tstrdup ("inputMediaVideo"); return index; } else { index ++; }}
+ if (index == 8) { if (!strncmp (text, "inputMediaUploadedAudio", text_len)) { *R = tstrdup ("inputMediaUploadedAudio"); return index; } else { index ++; }}
+ if (index == 9) { if (!strncmp (text, "inputMediaAudio", text_len)) { *R = tstrdup ("inputMediaAudio"); return index; } else { index ++; }}
+ if (index == 10) { if (!strncmp (text, "inputMediaUploadedDocument", text_len)) { *R = tstrdup ("inputMediaUploadedDocument"); return index; } else { index ++; }}
+ if (index == 11) { if (!strncmp (text, "inputMediaUploadedThumbDocument", text_len)) { *R = tstrdup ("inputMediaUploadedThumbDocument"); return index; } else { index ++; }}
+ if (index == 12) { if (!strncmp (text, "inputMediaDocument", text_len)) { *R = tstrdup ("inputMediaDocument"); return index; } else { index ++; }}
+ if (index == 13) { if (!strncmp (text, "inputMediaVenue", text_len)) { *R = tstrdup ("inputMediaVenue"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_input_notify_peer (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_notify_peer); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputNotifyPeer", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_notify_peer (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "inputNotifyUsers", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_notify_users (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "inputNotifyChats", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_notify_chats (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "inputNotifyAll", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_notify_all (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "inputNotifyGeoChatPeer", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_notify_geo_chat_peer (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_input_notify_peer (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_notify_peer); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputNotifyPeer", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_notify_peer (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "inputNotifyUsers", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_notify_users (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "inputNotifyChats", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_notify_chats (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "inputNotifyAll", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_notify_all (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "inputNotifyGeoChatPeer", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_notify_geo_chat_peer (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_input_notify_peer (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "inputNotifyPeer", text_len)) { *R = tstrdup ("inputNotifyPeer"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "inputNotifyUsers", text_len)) { *R = tstrdup ("inputNotifyUsers"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "inputNotifyChats", text_len)) { *R = tstrdup ("inputNotifyChats"); return index; } else { index ++; }}
+ if (index == 3) { if (!strncmp (text, "inputNotifyAll", text_len)) { *R = tstrdup ("inputNotifyAll"); return index; } else { index ++; }}
+ if (index == 4) { if (!strncmp (text, "inputNotifyGeoChatPeer", text_len)) { *R = tstrdup ("inputNotifyGeoChatPeer"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_input_peer (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_peer); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "inputPeerEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_peer_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "inputPeerSelf", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_peer_self (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "inputPeerContact", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_peer_contact (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "inputPeerForeign", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_peer_foreign (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "inputPeerChat", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_peer_chat (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_input_peer (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_peer); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "inputPeerEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_peer_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "inputPeerSelf", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_peer_self (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "inputPeerContact", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_peer_contact (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "inputPeerForeign", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_peer_foreign (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "inputPeerChat", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_peer_chat (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_input_peer (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "inputPeerEmpty", text_len)) { *R = tstrdup ("inputPeerEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "inputPeerSelf", text_len)) { *R = tstrdup ("inputPeerSelf"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "inputPeerContact", text_len)) { *R = tstrdup ("inputPeerContact"); return index; } else { index ++; }}
+ if (index == 3) { if (!strncmp (text, "inputPeerForeign", text_len)) { *R = tstrdup ("inputPeerForeign"); return index; } else { index ++; }}
+ if (index == 4) { if (!strncmp (text, "inputPeerChat", text_len)) { *R = tstrdup ("inputPeerChat"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_input_peer_notify_events (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_peer_notify_events); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 26 && !memcmp (cur_token, "inputPeerNotifyEventsEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_peer_notify_events_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "inputPeerNotifyEventsAll", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_peer_notify_events_all (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_input_peer_notify_events (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_peer_notify_events); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 26 && !memcmp (cur_token, "inputPeerNotifyEventsEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_peer_notify_events_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "inputPeerNotifyEventsAll", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_peer_notify_events_all (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_input_peer_notify_events (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "inputPeerNotifyEventsEmpty", text_len)) { *R = tstrdup ("inputPeerNotifyEventsEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "inputPeerNotifyEventsAll", text_len)) { *R = tstrdup ("inputPeerNotifyEventsAll"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_input_peer_notify_settings (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_peer_notify_settings); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 23 && !memcmp (cur_token, "inputPeerNotifySettings", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_peer_notify_settings (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_input_peer_notify_settings (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_peer_notify_settings); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 23 && !memcmp (cur_token, "inputPeerNotifySettings", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_peer_notify_settings (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_input_peer_notify_settings (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "inputPeerNotifySettings", text_len)) { *R = tstrdup ("inputPeerNotifySettings"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_input_photo (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_photo); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputPhotoEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_photo_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 10 && !memcmp (cur_token, "inputPhoto", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_photo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_input_photo (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_photo); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputPhotoEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_photo_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 10 && !memcmp (cur_token, "inputPhoto", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_photo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_input_photo (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "inputPhotoEmpty", text_len)) { *R = tstrdup ("inputPhotoEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "inputPhoto", text_len)) { *R = tstrdup ("inputPhoto"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_input_photo_crop (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_photo_crop); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "inputPhotoCropAuto", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_photo_crop_auto (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "inputPhotoCrop", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_photo_crop (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_input_photo_crop (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_photo_crop); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "inputPhotoCropAuto", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_photo_crop_auto (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "inputPhotoCrop", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_photo_crop (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_input_photo_crop (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "inputPhotoCropAuto", text_len)) { *R = tstrdup ("inputPhotoCropAuto"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "inputPhotoCrop", text_len)) { *R = tstrdup ("inputPhotoCrop"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_input_privacy_key (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_privacy_key); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 30 && !memcmp (cur_token, "inputPrivacyKeyStatusTimestamp", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_privacy_key_status_timestamp (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_input_privacy_key (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_privacy_key); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 30 && !memcmp (cur_token, "inputPrivacyKeyStatusTimestamp", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_privacy_key_status_timestamp (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_input_privacy_key (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "inputPrivacyKeyStatusTimestamp", text_len)) { *R = tstrdup ("inputPrivacyKeyStatusTimestamp"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_input_privacy_rule (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_privacy_rule); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 30 && !memcmp (cur_token, "inputPrivacyValueAllowContacts", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_privacy_value_allow_contacts (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "inputPrivacyValueAllowAll", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_privacy_value_allow_all (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "inputPrivacyValueAllowUsers", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_privacy_value_allow_users (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 33 && !memcmp (cur_token, "inputPrivacyValueDisallowContacts", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_privacy_value_disallow_contacts (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "inputPrivacyValueDisallowAll", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_privacy_value_disallow_all (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 30 && !memcmp (cur_token, "inputPrivacyValueDisallowUsers", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_privacy_value_disallow_users (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_input_privacy_rule (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_privacy_rule); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 30 && !memcmp (cur_token, "inputPrivacyValueAllowContacts", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_privacy_value_allow_contacts (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "inputPrivacyValueAllowAll", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_privacy_value_allow_all (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "inputPrivacyValueAllowUsers", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_privacy_value_allow_users (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 33 && !memcmp (cur_token, "inputPrivacyValueDisallowContacts", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_privacy_value_disallow_contacts (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "inputPrivacyValueDisallowAll", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_privacy_value_disallow_all (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 30 && !memcmp (cur_token, "inputPrivacyValueDisallowUsers", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_privacy_value_disallow_users (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_input_privacy_rule (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "inputPrivacyValueAllowContacts", text_len)) { *R = tstrdup ("inputPrivacyValueAllowContacts"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "inputPrivacyValueAllowAll", text_len)) { *R = tstrdup ("inputPrivacyValueAllowAll"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "inputPrivacyValueAllowUsers", text_len)) { *R = tstrdup ("inputPrivacyValueAllowUsers"); return index; } else { index ++; }}
+ if (index == 3) { if (!strncmp (text, "inputPrivacyValueDisallowContacts", text_len)) { *R = tstrdup ("inputPrivacyValueDisallowContacts"); return index; } else { index ++; }}
+ if (index == 4) { if (!strncmp (text, "inputPrivacyValueDisallowAll", text_len)) { *R = tstrdup ("inputPrivacyValueDisallowAll"); return index; } else { index ++; }}
+ if (index == 5) { if (!strncmp (text, "inputPrivacyValueDisallowUsers", text_len)) { *R = tstrdup ("inputPrivacyValueDisallowUsers"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_input_sticker_set (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_sticker_set); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 20 && !memcmp (cur_token, "inputStickerSetEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_sticker_set_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "inputStickerSetID", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_sticker_set_i_d (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "inputStickerSetShortName", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_sticker_set_short_name (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_input_sticker_set (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_sticker_set); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 20 && !memcmp (cur_token, "inputStickerSetEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_sticker_set_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "inputStickerSetID", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_sticker_set_i_d (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "inputStickerSetShortName", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_sticker_set_short_name (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_input_sticker_set (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "inputStickerSetEmpty", text_len)) { *R = tstrdup ("inputStickerSetEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "inputStickerSetID", text_len)) { *R = tstrdup ("inputStickerSetID"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "inputStickerSetShortName", text_len)) { *R = tstrdup ("inputStickerSetShortName"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_input_user (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_user); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "inputUserEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_user_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "inputUserSelf", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_user_self (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "inputUserContact", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_user_contact (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "inputUserForeign", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_user_foreign (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_input_user (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_user); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "inputUserEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_user_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "inputUserSelf", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_user_self (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "inputUserContact", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_user_contact (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "inputUserForeign", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_user_foreign (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_input_user (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "inputUserEmpty", text_len)) { *R = tstrdup ("inputUserEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "inputUserSelf", text_len)) { *R = tstrdup ("inputUserSelf"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "inputUserContact", text_len)) { *R = tstrdup ("inputUserContact"); return index; } else { index ++; }}
+ if (index == 3) { if (!strncmp (text, "inputUserForeign", text_len)) { *R = tstrdup ("inputUserForeign"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_input_video (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_video); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputVideoEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_video_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 10 && !memcmp (cur_token, "inputVideo", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_video (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_input_video (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_input_video); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputVideoEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_video_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 10 && !memcmp (cur_token, "inputVideo", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_video (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_input_video (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "inputVideoEmpty", text_len)) { *R = tstrdup ("inputVideoEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "inputVideo", text_len)) { *R = tstrdup ("inputVideo"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_int (struct paramed_type *T) {
+ if (autocomplete_constructor_int (T) < 0) { return -1; }
+ return 0;
+}
+int autocomplete_type_bare_int (struct paramed_type *T) {
+ if (autocomplete_constructor_int (T) < 0) { return -1; }
+ return 0;
+}
+int do_autocomplete_type_int (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "int", text_len)) { *R = tstrdup ("int"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_int128 (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_int128); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 6 && !memcmp (cur_token, "int128", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_int128 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_int128 (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_int128); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 6 && !memcmp (cur_token, "int128", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_int128 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_int128 (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "int128", text_len)) { *R = tstrdup ("int128"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_int256 (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_int256); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 6 && !memcmp (cur_token, "int256", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_int256 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_int256 (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_int256); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 6 && !memcmp (cur_token, "int256", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_int256 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_int256 (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "int256", text_len)) { *R = tstrdup ("int256"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_keyboard_button (struct paramed_type *T) {
+ if (autocomplete_constructor_keyboard_button (T) < 0) { return -1; }
+ return 0;
+}
+int autocomplete_type_bare_keyboard_button (struct paramed_type *T) {
+ if (autocomplete_constructor_keyboard_button (T) < 0) { return -1; }
+ return 0;
+}
+int do_autocomplete_type_keyboard_button (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "keyboardButton", text_len)) { *R = tstrdup ("keyboardButton"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_keyboard_button_row (struct paramed_type *T) {
+ if (autocomplete_constructor_keyboard_button_row (T) < 0) { return -1; }
+ return 0;
+}
+int autocomplete_type_bare_keyboard_button_row (struct paramed_type *T) {
+ if (autocomplete_constructor_keyboard_button_row (T) < 0) { return -1; }
+ return 0;
+}
+int do_autocomplete_type_keyboard_button_row (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "keyboardButtonRow", text_len)) { *R = tstrdup ("keyboardButtonRow"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_long (struct paramed_type *T) {
+ if (autocomplete_constructor_long (T) < 0) { return -1; }
+ return 0;
+}
+int autocomplete_type_bare_long (struct paramed_type *T) {
+ if (autocomplete_constructor_long (T) < 0) { return -1; }
+ return 0;
+}
+int do_autocomplete_type_long (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "long", text_len)) { *R = tstrdup ("long"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_message (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_message); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 12 && !memcmp (cur_token, "messageEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 7 && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "messageService", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_service (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_message (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_message); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 12 && !memcmp (cur_token, "messageEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 7 && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "messageService", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_service (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_message (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "messageEmpty", text_len)) { *R = tstrdup ("messageEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "message", text_len)) { *R = tstrdup ("message"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "messageService", text_len)) { *R = tstrdup ("messageService"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_message_action (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_message_action); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "messageActionEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_action_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "messageActionChatCreate", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_action_chat_create (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "messageActionChatEditTitle", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_action_chat_edit_title (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "messageActionChatEditPhoto", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_action_chat_edit_photo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "messageActionChatDeletePhoto", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_action_chat_delete_photo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "messageActionChatAddUser", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_action_chat_add_user (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "messageActionChatDeleteUser", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_action_chat_delete_user (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "messageActionGeoChatCreate", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_action_geo_chat_create (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "messageActionGeoChatCheckin", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_action_geo_chat_checkin (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "messageActionChatJoinedByLink", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_action_chat_joined_by_link (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_message_action (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_message_action); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "messageActionEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_action_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "messageActionChatCreate", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_action_chat_create (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "messageActionChatEditTitle", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_action_chat_edit_title (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "messageActionChatEditPhoto", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_action_chat_edit_photo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "messageActionChatDeletePhoto", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_action_chat_delete_photo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "messageActionChatAddUser", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_action_chat_add_user (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "messageActionChatDeleteUser", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_action_chat_delete_user (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "messageActionGeoChatCreate", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_action_geo_chat_create (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "messageActionGeoChatCheckin", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_action_geo_chat_checkin (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "messageActionChatJoinedByLink", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_action_chat_joined_by_link (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_message_action (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "messageActionEmpty", text_len)) { *R = tstrdup ("messageActionEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "messageActionChatCreate", text_len)) { *R = tstrdup ("messageActionChatCreate"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "messageActionChatEditTitle", text_len)) { *R = tstrdup ("messageActionChatEditTitle"); return index; } else { index ++; }}
+ if (index == 3) { if (!strncmp (text, "messageActionChatEditPhoto", text_len)) { *R = tstrdup ("messageActionChatEditPhoto"); return index; } else { index ++; }}
+ if (index == 4) { if (!strncmp (text, "messageActionChatDeletePhoto", text_len)) { *R = tstrdup ("messageActionChatDeletePhoto"); return index; } else { index ++; }}
+ if (index == 5) { if (!strncmp (text, "messageActionChatAddUser", text_len)) { *R = tstrdup ("messageActionChatAddUser"); return index; } else { index ++; }}
+ if (index == 6) { if (!strncmp (text, "messageActionChatDeleteUser", text_len)) { *R = tstrdup ("messageActionChatDeleteUser"); return index; } else { index ++; }}
+ if (index == 7) { if (!strncmp (text, "messageActionGeoChatCreate", text_len)) { *R = tstrdup ("messageActionGeoChatCreate"); return index; } else { index ++; }}
+ if (index == 8) { if (!strncmp (text, "messageActionGeoChatCheckin", text_len)) { *R = tstrdup ("messageActionGeoChatCheckin"); return index; } else { index ++; }}
+ if (index == 9) { if (!strncmp (text, "messageActionChatJoinedByLink", text_len)) { *R = tstrdup ("messageActionChatJoinedByLink"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_message_media (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_message_media); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messageMediaEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_media_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messageMediaPhoto", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_media_photo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messageMediaVideo", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_media_video (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "messageMediaGeo", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_media_geo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "messageMediaContact", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_media_contact (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "messageMediaUnsupported", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_media_unsupported (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messageMediaDocument", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_media_document (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messageMediaAudio", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_media_audio (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "messageMediaWebPage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_media_web_page (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messageMediaVenue", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_media_venue (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messageMediaPhotoL27", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_media_photo_l27 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messageMediaVideoL27", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_media_video_l27 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_message_media (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_message_media); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messageMediaEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_media_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messageMediaPhoto", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_media_photo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messageMediaVideo", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_media_video (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "messageMediaGeo", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_media_geo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "messageMediaContact", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_media_contact (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "messageMediaUnsupported", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_media_unsupported (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messageMediaDocument", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_media_document (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messageMediaAudio", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_media_audio (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "messageMediaWebPage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_media_web_page (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messageMediaVenue", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_media_venue (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messageMediaPhotoL27", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_media_photo_l27 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messageMediaVideoL27", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_message_media_video_l27 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_message_media (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "messageMediaEmpty", text_len)) { *R = tstrdup ("messageMediaEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "messageMediaPhoto", text_len)) { *R = tstrdup ("messageMediaPhoto"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "messageMediaVideo", text_len)) { *R = tstrdup ("messageMediaVideo"); return index; } else { index ++; }}
+ if (index == 3) { if (!strncmp (text, "messageMediaGeo", text_len)) { *R = tstrdup ("messageMediaGeo"); return index; } else { index ++; }}
+ if (index == 4) { if (!strncmp (text, "messageMediaContact", text_len)) { *R = tstrdup ("messageMediaContact"); return index; } else { index ++; }}
+ if (index == 5) { if (!strncmp (text, "messageMediaUnsupported", text_len)) { *R = tstrdup ("messageMediaUnsupported"); return index; } else { index ++; }}
+ if (index == 6) { if (!strncmp (text, "messageMediaDocument", text_len)) { *R = tstrdup ("messageMediaDocument"); return index; } else { index ++; }}
+ if (index == 7) { if (!strncmp (text, "messageMediaAudio", text_len)) { *R = tstrdup ("messageMediaAudio"); return index; } else { index ++; }}
+ if (index == 8) { if (!strncmp (text, "messageMediaWebPage", text_len)) { *R = tstrdup ("messageMediaWebPage"); return index; } else { index ++; }}
+ if (index == 9) { if (!strncmp (text, "messageMediaVenue", text_len)) { *R = tstrdup ("messageMediaVenue"); return index; } else { index ++; }}
+ if (index == 10) { if (!strncmp (text, "messageMediaPhotoL27", text_len)) { *R = tstrdup ("messageMediaPhotoL27"); return index; } else { index ++; }}
+ if (index == 11) { if (!strncmp (text, "messageMediaVideoL27", text_len)) { *R = tstrdup ("messageMediaVideoL27"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_messages_filter (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_messages_filter); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 24 && !memcmp (cur_token, "inputMessagesFilterEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_messages_filter_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "inputMessagesFilterPhotos", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_messages_filter_photos (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "inputMessagesFilterVideo", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_messages_filter_video (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "inputMessagesFilterPhotoVideo", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_messages_filter_photo_video (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 38 && !memcmp (cur_token, "inputMessagesFilterPhotoVideoDocuments", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_messages_filter_photo_video_documents (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "inputMessagesFilterDocument", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_messages_filter_document (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "inputMessagesFilterAudio", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_messages_filter_audio (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_messages_filter (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_messages_filter); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 24 && !memcmp (cur_token, "inputMessagesFilterEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_messages_filter_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "inputMessagesFilterPhotos", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_messages_filter_photos (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "inputMessagesFilterVideo", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_messages_filter_video (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "inputMessagesFilterPhotoVideo", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_messages_filter_photo_video (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 38 && !memcmp (cur_token, "inputMessagesFilterPhotoVideoDocuments", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_messages_filter_photo_video_documents (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "inputMessagesFilterDocument", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_messages_filter_document (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "inputMessagesFilterAudio", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_input_messages_filter_audio (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_messages_filter (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "inputMessagesFilterEmpty", text_len)) { *R = tstrdup ("inputMessagesFilterEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "inputMessagesFilterPhotos", text_len)) { *R = tstrdup ("inputMessagesFilterPhotos"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "inputMessagesFilterVideo", text_len)) { *R = tstrdup ("inputMessagesFilterVideo"); return index; } else { index ++; }}
+ if (index == 3) { if (!strncmp (text, "inputMessagesFilterPhotoVideo", text_len)) { *R = tstrdup ("inputMessagesFilterPhotoVideo"); return index; } else { index ++; }}
+ if (index == 4) { if (!strncmp (text, "inputMessagesFilterPhotoVideoDocuments", text_len)) { *R = tstrdup ("inputMessagesFilterPhotoVideoDocuments"); return index; } else { index ++; }}
+ if (index == 5) { if (!strncmp (text, "inputMessagesFilterDocument", text_len)) { *R = tstrdup ("inputMessagesFilterDocument"); return index; } else { index ++; }}
+ if (index == 6) { if (!strncmp (text, "inputMessagesFilterAudio", text_len)) { *R = tstrdup ("inputMessagesFilterAudio"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_nearest_dc (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_nearest_dc); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 9 && !memcmp (cur_token, "nearestDc", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_nearest_dc (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_nearest_dc (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_nearest_dc); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 9 && !memcmp (cur_token, "nearestDc", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_nearest_dc (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_nearest_dc (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "nearestDc", text_len)) { *R = tstrdup ("nearestDc"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_notify_peer (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_notify_peer); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 10 && !memcmp (cur_token, "notifyPeer", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_notify_peer (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 11 && !memcmp (cur_token, "notifyUsers", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_notify_users (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 11 && !memcmp (cur_token, "notifyChats", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_notify_chats (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 9 && !memcmp (cur_token, "notifyAll", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_notify_all (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_notify_peer (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_notify_peer); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 10 && !memcmp (cur_token, "notifyPeer", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_notify_peer (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 11 && !memcmp (cur_token, "notifyUsers", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_notify_users (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 11 && !memcmp (cur_token, "notifyChats", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_notify_chats (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 9 && !memcmp (cur_token, "notifyAll", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_notify_all (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_notify_peer (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "notifyPeer", text_len)) { *R = tstrdup ("notifyPeer"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "notifyUsers", text_len)) { *R = tstrdup ("notifyUsers"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "notifyChats", text_len)) { *R = tstrdup ("notifyChats"); return index; } else { index ++; }}
+ if (index == 3) { if (!strncmp (text, "notifyAll", text_len)) { *R = tstrdup ("notifyAll"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_null (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_null); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 4 && !memcmp (cur_token, "null", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_null (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_null (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_null); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 4 && !memcmp (cur_token, "null", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_null (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_null (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "null", text_len)) { *R = tstrdup ("null"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_p_q_inner_data (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_p_q_inner_data); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "p_q_inner_data", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_p_q_inner_data (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "p_q_inner_data_temp", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_p_q_inner_data_temp (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_p_q_inner_data (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_p_q_inner_data); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "p_q_inner_data", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_p_q_inner_data (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "p_q_inner_data_temp", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_p_q_inner_data_temp (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_p_q_inner_data (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "p_q_inner_data", text_len)) { *R = tstrdup ("p_q_inner_data"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "p_q_inner_data_temp", text_len)) { *R = tstrdup ("p_q_inner_data_temp"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_peer (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_peer); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 8 && !memcmp (cur_token, "peerUser", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_peer_user (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 8 && !memcmp (cur_token, "peerChat", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_peer_chat (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_peer (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_peer); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 8 && !memcmp (cur_token, "peerUser", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_peer_user (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 8 && !memcmp (cur_token, "peerChat", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_peer_chat (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_peer (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "peerUser", text_len)) { *R = tstrdup ("peerUser"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "peerChat", text_len)) { *R = tstrdup ("peerChat"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_peer_notify_events (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_peer_notify_events); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 21 && !memcmp (cur_token, "peerNotifyEventsEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_peer_notify_events_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "peerNotifyEventsAll", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_peer_notify_events_all (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_peer_notify_events (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_peer_notify_events); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 21 && !memcmp (cur_token, "peerNotifyEventsEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_peer_notify_events_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "peerNotifyEventsAll", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_peer_notify_events_all (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_peer_notify_events (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "peerNotifyEventsEmpty", text_len)) { *R = tstrdup ("peerNotifyEventsEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "peerNotifyEventsAll", text_len)) { *R = tstrdup ("peerNotifyEventsAll"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_peer_notify_settings (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_peer_notify_settings); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 23 && !memcmp (cur_token, "peerNotifySettingsEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_peer_notify_settings_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "peerNotifySettings", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_peer_notify_settings (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_peer_notify_settings (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_peer_notify_settings); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 23 && !memcmp (cur_token, "peerNotifySettingsEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_peer_notify_settings_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "peerNotifySettings", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_peer_notify_settings (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_peer_notify_settings (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "peerNotifySettingsEmpty", text_len)) { *R = tstrdup ("peerNotifySettingsEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "peerNotifySettings", text_len)) { *R = tstrdup ("peerNotifySettings"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_photo (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_photo); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 10 && !memcmp (cur_token, "photoEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_photo_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 5 && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_photo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 8 && !memcmp (cur_token, "photoL27", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_photo_l27 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_photo (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_photo); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 10 && !memcmp (cur_token, "photoEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_photo_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 5 && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_photo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 8 && !memcmp (cur_token, "photoL27", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_photo_l27 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_photo (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "photoEmpty", text_len)) { *R = tstrdup ("photoEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "photo", text_len)) { *R = tstrdup ("photo"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "photoL27", text_len)) { *R = tstrdup ("photoL27"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_photo_size (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_photo_size); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "photoSizeEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_photo_size_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 9 && !memcmp (cur_token, "photoSize", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_photo_size (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "photoCachedSize", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_photo_cached_size (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_photo_size (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_photo_size); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "photoSizeEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_photo_size_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 9 && !memcmp (cur_token, "photoSize", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_photo_size (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "photoCachedSize", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_photo_cached_size (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_photo_size (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "photoSizeEmpty", text_len)) { *R = tstrdup ("photoSizeEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "photoSize", text_len)) { *R = tstrdup ("photoSize"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "photoCachedSize", text_len)) { *R = tstrdup ("photoCachedSize"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_privacy_key (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_privacy_key); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 25 && !memcmp (cur_token, "privacyKeyStatusTimestamp", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_privacy_key_status_timestamp (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_privacy_key (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_privacy_key); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 25 && !memcmp (cur_token, "privacyKeyStatusTimestamp", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_privacy_key_status_timestamp (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_privacy_key (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "privacyKeyStatusTimestamp", text_len)) { *R = tstrdup ("privacyKeyStatusTimestamp"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_privacy_rule (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_privacy_rule); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 25 && !memcmp (cur_token, "privacyValueAllowContacts", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_privacy_value_allow_contacts (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "privacyValueAllowAll", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_privacy_value_allow_all (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "privacyValueAllowUsers", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_privacy_value_allow_users (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "privacyValueDisallowContacts", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_privacy_value_disallow_contacts (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "privacyValueDisallowAll", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_privacy_value_disallow_all (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "privacyValueDisallowUsers", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_privacy_value_disallow_users (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_privacy_rule (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_privacy_rule); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 25 && !memcmp (cur_token, "privacyValueAllowContacts", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_privacy_value_allow_contacts (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "privacyValueAllowAll", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_privacy_value_allow_all (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "privacyValueAllowUsers", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_privacy_value_allow_users (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "privacyValueDisallowContacts", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_privacy_value_disallow_contacts (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "privacyValueDisallowAll", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_privacy_value_disallow_all (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "privacyValueDisallowUsers", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_privacy_value_disallow_users (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_privacy_rule (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "privacyValueAllowContacts", text_len)) { *R = tstrdup ("privacyValueAllowContacts"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "privacyValueAllowAll", text_len)) { *R = tstrdup ("privacyValueAllowAll"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "privacyValueAllowUsers", text_len)) { *R = tstrdup ("privacyValueAllowUsers"); return index; } else { index ++; }}
+ if (index == 3) { if (!strncmp (text, "privacyValueDisallowContacts", text_len)) { *R = tstrdup ("privacyValueDisallowContacts"); return index; } else { index ++; }}
+ if (index == 4) { if (!strncmp (text, "privacyValueDisallowAll", text_len)) { *R = tstrdup ("privacyValueDisallowAll"); return index; } else { index ++; }}
+ if (index == 5) { if (!strncmp (text, "privacyValueDisallowUsers", text_len)) { *R = tstrdup ("privacyValueDisallowUsers"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_received_notify_message (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_received_notify_message); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 21 && !memcmp (cur_token, "receivedNotifyMessage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_received_notify_message (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_received_notify_message (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_received_notify_message); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 21 && !memcmp (cur_token, "receivedNotifyMessage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_received_notify_message (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_received_notify_message (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "receivedNotifyMessage", text_len)) { *R = tstrdup ("receivedNotifyMessage"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_reply_markup (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_reply_markup); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "replyKeyboardHide", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_reply_keyboard_hide (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "replyKeyboardForceReply", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_reply_keyboard_force_reply (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "replyKeyboardMarkup", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_reply_keyboard_markup (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_reply_markup (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_reply_markup); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "replyKeyboardHide", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_reply_keyboard_hide (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "replyKeyboardForceReply", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_reply_keyboard_force_reply (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "replyKeyboardMarkup", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_reply_keyboard_markup (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_reply_markup (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "replyKeyboardHide", text_len)) { *R = tstrdup ("replyKeyboardHide"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "replyKeyboardForceReply", text_len)) { *R = tstrdup ("replyKeyboardForceReply"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "replyKeyboardMarkup", text_len)) { *R = tstrdup ("replyKeyboardMarkup"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_res_p_q (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_res_p_q); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 5 && !memcmp (cur_token, "resPQ", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_res_p_q (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_res_p_q (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_res_p_q); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 5 && !memcmp (cur_token, "resPQ", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_res_p_q (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_res_p_q (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "resPQ", text_len)) { *R = tstrdup ("resPQ"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_send_message_action (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_send_message_action); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 23 && !memcmp (cur_token, "sendMessageTypingAction", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_send_message_typing_action (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "sendMessageCancelAction", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_send_message_cancel_action (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "sendMessageRecordVideoAction", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_send_message_record_video_action (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 31 && !memcmp (cur_token, "sendMessageUploadVideoActionL27", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_send_message_upload_video_action_l27 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "sendMessageUploadVideoAction", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_send_message_upload_video_action (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "sendMessageRecordAudioAction", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_send_message_record_audio_action (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 31 && !memcmp (cur_token, "sendMessageUploadAudioActionL27", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_send_message_upload_audio_action_l27 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "sendMessageUploadAudioAction", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_send_message_upload_audio_action (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "sendMessageUploadPhotoAction", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_send_message_upload_photo_action (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 34 && !memcmp (cur_token, "sendMessageUploadDocumentActionL27", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_send_message_upload_document_action_l27 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 31 && !memcmp (cur_token, "sendMessageUploadDocumentAction", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_send_message_upload_document_action (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "sendMessageGeoLocationAction", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_send_message_geo_location_action (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 30 && !memcmp (cur_token, "sendMessageChooseContactAction", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_send_message_choose_contact_action (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_send_message_action (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_send_message_action); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 23 && !memcmp (cur_token, "sendMessageTypingAction", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_send_message_typing_action (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "sendMessageCancelAction", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_send_message_cancel_action (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "sendMessageRecordVideoAction", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_send_message_record_video_action (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 31 && !memcmp (cur_token, "sendMessageUploadVideoActionL27", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_send_message_upload_video_action_l27 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "sendMessageUploadVideoAction", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_send_message_upload_video_action (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "sendMessageRecordAudioAction", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_send_message_record_audio_action (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 31 && !memcmp (cur_token, "sendMessageUploadAudioActionL27", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_send_message_upload_audio_action_l27 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "sendMessageUploadAudioAction", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_send_message_upload_audio_action (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "sendMessageUploadPhotoAction", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_send_message_upload_photo_action (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 34 && !memcmp (cur_token, "sendMessageUploadDocumentActionL27", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_send_message_upload_document_action_l27 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 31 && !memcmp (cur_token, "sendMessageUploadDocumentAction", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_send_message_upload_document_action (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "sendMessageGeoLocationAction", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_send_message_geo_location_action (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 30 && !memcmp (cur_token, "sendMessageChooseContactAction", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_send_message_choose_contact_action (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_send_message_action (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "sendMessageTypingAction", text_len)) { *R = tstrdup ("sendMessageTypingAction"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "sendMessageCancelAction", text_len)) { *R = tstrdup ("sendMessageCancelAction"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "sendMessageRecordVideoAction", text_len)) { *R = tstrdup ("sendMessageRecordVideoAction"); return index; } else { index ++; }}
+ if (index == 3) { if (!strncmp (text, "sendMessageUploadVideoActionL27", text_len)) { *R = tstrdup ("sendMessageUploadVideoActionL27"); return index; } else { index ++; }}
+ if (index == 4) { if (!strncmp (text, "sendMessageUploadVideoAction", text_len)) { *R = tstrdup ("sendMessageUploadVideoAction"); return index; } else { index ++; }}
+ if (index == 5) { if (!strncmp (text, "sendMessageRecordAudioAction", text_len)) { *R = tstrdup ("sendMessageRecordAudioAction"); return index; } else { index ++; }}
+ if (index == 6) { if (!strncmp (text, "sendMessageUploadAudioActionL27", text_len)) { *R = tstrdup ("sendMessageUploadAudioActionL27"); return index; } else { index ++; }}
+ if (index == 7) { if (!strncmp (text, "sendMessageUploadAudioAction", text_len)) { *R = tstrdup ("sendMessageUploadAudioAction"); return index; } else { index ++; }}
+ if (index == 8) { if (!strncmp (text, "sendMessageUploadPhotoAction", text_len)) { *R = tstrdup ("sendMessageUploadPhotoAction"); return index; } else { index ++; }}
+ if (index == 9) { if (!strncmp (text, "sendMessageUploadDocumentActionL27", text_len)) { *R = tstrdup ("sendMessageUploadDocumentActionL27"); return index; } else { index ++; }}
+ if (index == 10) { if (!strncmp (text, "sendMessageUploadDocumentAction", text_len)) { *R = tstrdup ("sendMessageUploadDocumentAction"); return index; } else { index ++; }}
+ if (index == 11) { if (!strncmp (text, "sendMessageGeoLocationAction", text_len)) { *R = tstrdup ("sendMessageGeoLocationAction"); return index; } else { index ++; }}
+ if (index == 12) { if (!strncmp (text, "sendMessageChooseContactAction", text_len)) { *R = tstrdup ("sendMessageChooseContactAction"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_server_d_h_params (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_server_d_h_params); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 21 && !memcmp (cur_token, "server_DH_params_fail", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_server_d_h_params_fail (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "server_DH_params_ok", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_server_d_h_params_ok (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_server_d_h_params (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_server_d_h_params); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 21 && !memcmp (cur_token, "server_DH_params_fail", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_server_d_h_params_fail (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "server_DH_params_ok", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_server_d_h_params_ok (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_server_d_h_params (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "server_DH_params_fail", text_len)) { *R = tstrdup ("server_DH_params_fail"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "server_DH_params_ok", text_len)) { *R = tstrdup ("server_DH_params_ok"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_server_d_h_inner_data (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_server_d_h_inner_data); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 20 && !memcmp (cur_token, "server_DH_inner_data", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_server_d_h_inner_data (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_server_d_h_inner_data (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_server_d_h_inner_data); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 20 && !memcmp (cur_token, "server_DH_inner_data", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_server_d_h_inner_data (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_server_d_h_inner_data (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "server_DH_inner_data", text_len)) { *R = tstrdup ("server_DH_inner_data"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_set_client_d_h_params_answer (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_set_client_d_h_params_answer); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 9 && !memcmp (cur_token, "dh_gen_ok", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_dh_gen_ok (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 12 && !memcmp (cur_token, "dh_gen_retry", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_dh_gen_retry (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 11 && !memcmp (cur_token, "dh_gen_fail", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_dh_gen_fail (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_set_client_d_h_params_answer (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_set_client_d_h_params_answer); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 9 && !memcmp (cur_token, "dh_gen_ok", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_dh_gen_ok (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 12 && !memcmp (cur_token, "dh_gen_retry", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_dh_gen_retry (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 11 && !memcmp (cur_token, "dh_gen_fail", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_dh_gen_fail (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_set_client_d_h_params_answer (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "dh_gen_ok", text_len)) { *R = tstrdup ("dh_gen_ok"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "dh_gen_retry", text_len)) { *R = tstrdup ("dh_gen_retry"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "dh_gen_fail", text_len)) { *R = tstrdup ("dh_gen_fail"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_sticker_pack (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_sticker_pack); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 11 && !memcmp (cur_token, "stickerPack", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_sticker_pack (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_sticker_pack (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_sticker_pack); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 11 && !memcmp (cur_token, "stickerPack", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_sticker_pack (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_sticker_pack (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "stickerPack", text_len)) { *R = tstrdup ("stickerPack"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_sticker_set (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_sticker_set); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 10 && !memcmp (cur_token, "stickerSet", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_sticker_set (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_sticker_set (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_sticker_set); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 10 && !memcmp (cur_token, "stickerSet", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_sticker_set (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_sticker_set (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "stickerSet", text_len)) { *R = tstrdup ("stickerSet"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_string (struct paramed_type *T) {
+ if (autocomplete_constructor_string (T) < 0) { return -1; }
+ return 0;
+}
+int autocomplete_type_bare_string (struct paramed_type *T) {
+ if (autocomplete_constructor_string (T) < 0) { return -1; }
+ return 0;
+}
+int do_autocomplete_type_string (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "string", text_len)) { *R = tstrdup ("string"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_update (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_update); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 16 && !memcmp (cur_token, "updateNewMessage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_new_message (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "updateMessageID", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_message_i_d (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "updateDeleteMessages", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_delete_messages (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "updateUserTyping", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_user_typing (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "updateChatUserTyping", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_chat_user_typing (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "updateChatParticipants", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_chat_participants (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "updateUserStatus", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_user_status (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "updateUserName", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_user_name (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "updateUserPhoto", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_user_photo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "updateContactRegistered", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_contact_registered (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "updateContactLink", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_contact_link (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "updateNewAuthorization", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_new_authorization (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "updateNewGeoChatMessage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_new_geo_chat_message (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "updateNewEncryptedMessage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_new_encrypted_message (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "updateEncryptedChatTyping", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_encrypted_chat_typing (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "updateEncryption", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_encryption (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "updateEncryptedMessagesRead", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_encrypted_messages_read (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "updateChatParticipantAdd", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_chat_participant_add (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "updateChatParticipantDelete", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_chat_participant_delete (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "updateDcOptions", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_dc_options (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "updateUserBlocked", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_user_blocked (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "updateNotifySettings", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_notify_settings (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "updateServiceNotification", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_service_notification (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "updatePrivacy", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_privacy (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "updateUserPhone", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_user_phone (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "updateReadHistoryInbox", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_read_history_inbox (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "updateReadHistoryOutbox", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_read_history_outbox (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "updateWebPage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_web_page (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "updateReadMessagesContents", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_read_messages_contents (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "updateMsgUpdate", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_msg_update (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_update (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_update); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 16 && !memcmp (cur_token, "updateNewMessage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_new_message (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "updateMessageID", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_message_i_d (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "updateDeleteMessages", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_delete_messages (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "updateUserTyping", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_user_typing (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "updateChatUserTyping", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_chat_user_typing (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "updateChatParticipants", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_chat_participants (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "updateUserStatus", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_user_status (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "updateUserName", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_user_name (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "updateUserPhoto", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_user_photo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "updateContactRegistered", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_contact_registered (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "updateContactLink", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_contact_link (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "updateNewAuthorization", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_new_authorization (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "updateNewGeoChatMessage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_new_geo_chat_message (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "updateNewEncryptedMessage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_new_encrypted_message (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "updateEncryptedChatTyping", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_encrypted_chat_typing (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "updateEncryption", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_encryption (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "updateEncryptedMessagesRead", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_encrypted_messages_read (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "updateChatParticipantAdd", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_chat_participant_add (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "updateChatParticipantDelete", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_chat_participant_delete (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "updateDcOptions", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_dc_options (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "updateUserBlocked", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_user_blocked (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "updateNotifySettings", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_notify_settings (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "updateServiceNotification", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_service_notification (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "updatePrivacy", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_privacy (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "updateUserPhone", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_user_phone (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "updateReadHistoryInbox", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_read_history_inbox (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "updateReadHistoryOutbox", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_read_history_outbox (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "updateWebPage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_web_page (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "updateReadMessagesContents", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_read_messages_contents (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "updateMsgUpdate", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_msg_update (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_update (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "updateNewMessage", text_len)) { *R = tstrdup ("updateNewMessage"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "updateMessageID", text_len)) { *R = tstrdup ("updateMessageID"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "updateDeleteMessages", text_len)) { *R = tstrdup ("updateDeleteMessages"); return index; } else { index ++; }}
+ if (index == 3) { if (!strncmp (text, "updateUserTyping", text_len)) { *R = tstrdup ("updateUserTyping"); return index; } else { index ++; }}
+ if (index == 4) { if (!strncmp (text, "updateChatUserTyping", text_len)) { *R = tstrdup ("updateChatUserTyping"); return index; } else { index ++; }}
+ if (index == 5) { if (!strncmp (text, "updateChatParticipants", text_len)) { *R = tstrdup ("updateChatParticipants"); return index; } else { index ++; }}
+ if (index == 6) { if (!strncmp (text, "updateUserStatus", text_len)) { *R = tstrdup ("updateUserStatus"); return index; } else { index ++; }}
+ if (index == 7) { if (!strncmp (text, "updateUserName", text_len)) { *R = tstrdup ("updateUserName"); return index; } else { index ++; }}
+ if (index == 8) { if (!strncmp (text, "updateUserPhoto", text_len)) { *R = tstrdup ("updateUserPhoto"); return index; } else { index ++; }}
+ if (index == 9) { if (!strncmp (text, "updateContactRegistered", text_len)) { *R = tstrdup ("updateContactRegistered"); return index; } else { index ++; }}
+ if (index == 10) { if (!strncmp (text, "updateContactLink", text_len)) { *R = tstrdup ("updateContactLink"); return index; } else { index ++; }}
+ if (index == 11) { if (!strncmp (text, "updateNewAuthorization", text_len)) { *R = tstrdup ("updateNewAuthorization"); return index; } else { index ++; }}
+ if (index == 12) { if (!strncmp (text, "updateNewGeoChatMessage", text_len)) { *R = tstrdup ("updateNewGeoChatMessage"); return index; } else { index ++; }}
+ if (index == 13) { if (!strncmp (text, "updateNewEncryptedMessage", text_len)) { *R = tstrdup ("updateNewEncryptedMessage"); return index; } else { index ++; }}
+ if (index == 14) { if (!strncmp (text, "updateEncryptedChatTyping", text_len)) { *R = tstrdup ("updateEncryptedChatTyping"); return index; } else { index ++; }}
+ if (index == 15) { if (!strncmp (text, "updateEncryption", text_len)) { *R = tstrdup ("updateEncryption"); return index; } else { index ++; }}
+ if (index == 16) { if (!strncmp (text, "updateEncryptedMessagesRead", text_len)) { *R = tstrdup ("updateEncryptedMessagesRead"); return index; } else { index ++; }}
+ if (index == 17) { if (!strncmp (text, "updateChatParticipantAdd", text_len)) { *R = tstrdup ("updateChatParticipantAdd"); return index; } else { index ++; }}
+ if (index == 18) { if (!strncmp (text, "updateChatParticipantDelete", text_len)) { *R = tstrdup ("updateChatParticipantDelete"); return index; } else { index ++; }}
+ if (index == 19) { if (!strncmp (text, "updateDcOptions", text_len)) { *R = tstrdup ("updateDcOptions"); return index; } else { index ++; }}
+ if (index == 20) { if (!strncmp (text, "updateUserBlocked", text_len)) { *R = tstrdup ("updateUserBlocked"); return index; } else { index ++; }}
+ if (index == 21) { if (!strncmp (text, "updateNotifySettings", text_len)) { *R = tstrdup ("updateNotifySettings"); return index; } else { index ++; }}
+ if (index == 22) { if (!strncmp (text, "updateServiceNotification", text_len)) { *R = tstrdup ("updateServiceNotification"); return index; } else { index ++; }}
+ if (index == 23) { if (!strncmp (text, "updatePrivacy", text_len)) { *R = tstrdup ("updatePrivacy"); return index; } else { index ++; }}
+ if (index == 24) { if (!strncmp (text, "updateUserPhone", text_len)) { *R = tstrdup ("updateUserPhone"); return index; } else { index ++; }}
+ if (index == 25) { if (!strncmp (text, "updateReadHistoryInbox", text_len)) { *R = tstrdup ("updateReadHistoryInbox"); return index; } else { index ++; }}
+ if (index == 26) { if (!strncmp (text, "updateReadHistoryOutbox", text_len)) { *R = tstrdup ("updateReadHistoryOutbox"); return index; } else { index ++; }}
+ if (index == 27) { if (!strncmp (text, "updateWebPage", text_len)) { *R = tstrdup ("updateWebPage"); return index; } else { index ++; }}
+ if (index == 28) { if (!strncmp (text, "updateReadMessagesContents", text_len)) { *R = tstrdup ("updateReadMessagesContents"); return index; } else { index ++; }}
+ if (index == 29) { if (!strncmp (text, "updateMsgUpdate", text_len)) { *R = tstrdup ("updateMsgUpdate"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_updates (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_updates); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "updatesTooLong", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_updates_too_long (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "updateShortMessage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_short_message (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "updateShortChatMessage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_short_chat_message (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 11 && !memcmp (cur_token, "updateShort", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_short (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "updatesCombined", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_updates_combined (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 7 && !memcmp (cur_token, "updates", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_updates (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_updates (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_updates); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "updatesTooLong", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_updates_too_long (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "updateShortMessage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_short_message (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "updateShortChatMessage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_short_chat_message (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 11 && !memcmp (cur_token, "updateShort", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_update_short (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "updatesCombined", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_updates_combined (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 7 && !memcmp (cur_token, "updates", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_updates (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_updates (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "updatesTooLong", text_len)) { *R = tstrdup ("updatesTooLong"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "updateShortMessage", text_len)) { *R = tstrdup ("updateShortMessage"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "updateShortChatMessage", text_len)) { *R = tstrdup ("updateShortChatMessage"); return index; } else { index ++; }}
+ if (index == 3) { if (!strncmp (text, "updateShort", text_len)) { *R = tstrdup ("updateShort"); return index; } else { index ++; }}
+ if (index == 4) { if (!strncmp (text, "updatesCombined", text_len)) { *R = tstrdup ("updatesCombined"); return index; } else { index ++; }}
+ if (index == 5) { if (!strncmp (text, "updates", text_len)) { *R = tstrdup ("updates"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_user (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_user); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 9 && !memcmp (cur_token, "userEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_user_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 4 && !memcmp (cur_token, "user", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_user (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_user (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_user); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 9 && !memcmp (cur_token, "userEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_user_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 4 && !memcmp (cur_token, "user", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_user (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_user (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "userEmpty", text_len)) { *R = tstrdup ("userEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "user", text_len)) { *R = tstrdup ("user"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_user_full (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_user_full); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 8 && !memcmp (cur_token, "userFull", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_user_full (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_user_full (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_user_full); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 8 && !memcmp (cur_token, "userFull", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_user_full (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_user_full (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "userFull", text_len)) { *R = tstrdup ("userFull"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_user_profile_photo (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_user_profile_photo); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 21 && !memcmp (cur_token, "userProfilePhotoEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_user_profile_photo_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "userProfilePhoto", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_user_profile_photo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_user_profile_photo (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_user_profile_photo); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 21 && !memcmp (cur_token, "userProfilePhotoEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_user_profile_photo_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "userProfilePhoto", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_user_profile_photo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_user_profile_photo (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "userProfilePhotoEmpty", text_len)) { *R = tstrdup ("userProfilePhotoEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "userProfilePhoto", text_len)) { *R = tstrdup ("userProfilePhoto"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_user_status (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_user_status); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "userStatusEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_user_status_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "userStatusOnline", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_user_status_online (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "userStatusOffline", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_user_status_offline (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "userStatusRecently", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_user_status_recently (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "userStatusLastWeek", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_user_status_last_week (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "userStatusLastMonth", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_user_status_last_month (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_user_status (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_user_status); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "userStatusEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_user_status_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "userStatusOnline", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_user_status_online (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "userStatusOffline", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_user_status_offline (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "userStatusRecently", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_user_status_recently (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "userStatusLastWeek", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_user_status_last_week (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "userStatusLastMonth", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_user_status_last_month (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_user_status (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "userStatusEmpty", text_len)) { *R = tstrdup ("userStatusEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "userStatusOnline", text_len)) { *R = tstrdup ("userStatusOnline"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "userStatusOffline", text_len)) { *R = tstrdup ("userStatusOffline"); return index; } else { index ++; }}
+ if (index == 3) { if (!strncmp (text, "userStatusRecently", text_len)) { *R = tstrdup ("userStatusRecently"); return index; } else { index ++; }}
+ if (index == 4) { if (!strncmp (text, "userStatusLastWeek", text_len)) { *R = tstrdup ("userStatusLastWeek"); return index; } else { index ++; }}
+ if (index == 5) { if (!strncmp (text, "userStatusLastMonth", text_len)) { *R = tstrdup ("userStatusLastMonth"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_vector (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_vector); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 6 && !memcmp (cur_token, "vector", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_vector (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_vector (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_vector); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 6 && !memcmp (cur_token, "vector", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_vector (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_vector (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "vector", text_len)) { *R = tstrdup ("vector"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_video (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_video); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 10 && !memcmp (cur_token, "videoEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_video_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 5 && !memcmp (cur_token, "video", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_video (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 8 && !memcmp (cur_token, "videoL27", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_video_l27 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_video (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_video); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 10 && !memcmp (cur_token, "videoEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_video_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 5 && !memcmp (cur_token, "video", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_video (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 8 && !memcmp (cur_token, "videoL27", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_video_l27 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_video (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "videoEmpty", text_len)) { *R = tstrdup ("videoEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "video", text_len)) { *R = tstrdup ("video"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "videoL27", text_len)) { *R = tstrdup ("videoL27"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_wall_paper (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_wall_paper); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 9 && !memcmp (cur_token, "wallPaper", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_wall_paper (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "wallPaperSolid", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_wall_paper_solid (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_wall_paper (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_wall_paper); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 9 && !memcmp (cur_token, "wallPaper", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_wall_paper (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "wallPaperSolid", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_wall_paper_solid (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_wall_paper (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "wallPaper", text_len)) { *R = tstrdup ("wallPaper"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "wallPaperSolid", text_len)) { *R = tstrdup ("wallPaperSolid"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_web_page (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_web_page); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 12 && !memcmp (cur_token, "webPageEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_web_page_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "webPagePending", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_web_page_pending (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 7 && !memcmp (cur_token, "webPage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_web_page (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_web_page (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_web_page); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 12 && !memcmp (cur_token, "webPageEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_web_page_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "webPagePending", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_web_page_pending (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 7 && !memcmp (cur_token, "webPage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_web_page (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_web_page (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "webPageEmpty", text_len)) { *R = tstrdup ("webPageEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "webPagePending", text_len)) { *R = tstrdup ("webPagePending"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "webPage", text_len)) { *R = tstrdup ("webPage"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_account_authorizations (struct paramed_type *T) {
+ if (autocomplete_constructor_account_authorizations (T) < 0) { return -1; }
+ return 0;
+}
+int autocomplete_type_bare_account_authorizations (struct paramed_type *T) {
+ if (autocomplete_constructor_account_authorizations (T) < 0) { return -1; }
+ return 0;
+}
+int do_autocomplete_type_account_authorizations (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "account.authorizations", text_len)) { *R = tstrdup ("account.authorizations"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_account_password (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_account_password); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "account.noPassword", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_account_no_password (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "account.password", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_account_password (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_account_password (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_account_password); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "account.noPassword", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_account_no_password (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "account.password", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_account_password (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_account_password (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "account.noPassword", text_len)) { *R = tstrdup ("account.noPassword"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "account.password", text_len)) { *R = tstrdup ("account.password"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_account_password_input_settings (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_account_password_input_settings); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 29 && !memcmp (cur_token, "account.passwordInputSettings", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_account_password_input_settings (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_account_password_input_settings (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_account_password_input_settings); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 29 && !memcmp (cur_token, "account.passwordInputSettings", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_account_password_input_settings (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_account_password_input_settings (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "account.passwordInputSettings", text_len)) { *R = tstrdup ("account.passwordInputSettings"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_account_password_settings (struct paramed_type *T) {
+ if (autocomplete_constructor_account_password_settings (T) < 0) { return -1; }
+ return 0;
+}
+int autocomplete_type_bare_account_password_settings (struct paramed_type *T) {
+ if (autocomplete_constructor_account_password_settings (T) < 0) { return -1; }
+ return 0;
+}
+int do_autocomplete_type_account_password_settings (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "account.passwordSettings", text_len)) { *R = tstrdup ("account.passwordSettings"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_account_privacy_rules (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_account_privacy_rules); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 20 && !memcmp (cur_token, "account.privacyRules", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_account_privacy_rules (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_account_privacy_rules (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_account_privacy_rules); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 20 && !memcmp (cur_token, "account.privacyRules", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_account_privacy_rules (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_account_privacy_rules (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "account.privacyRules", text_len)) { *R = tstrdup ("account.privacyRules"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_account_sent_change_phone_code (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_account_sent_change_phone_code); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 27 && !memcmp (cur_token, "account.sentChangePhoneCode", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_account_sent_change_phone_code (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_account_sent_change_phone_code (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_account_sent_change_phone_code); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 27 && !memcmp (cur_token, "account.sentChangePhoneCode", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_account_sent_change_phone_code (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_account_sent_change_phone_code (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "account.sentChangePhoneCode", text_len)) { *R = tstrdup ("account.sentChangePhoneCode"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_auth_authorization (struct paramed_type *T) {
+ if (autocomplete_constructor_auth_authorization (T) < 0) { return -1; }
+ return 0;
+}
+int autocomplete_type_bare_auth_authorization (struct paramed_type *T) {
+ if (autocomplete_constructor_auth_authorization (T) < 0) { return -1; }
+ return 0;
+}
+int do_autocomplete_type_auth_authorization (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "auth.authorization", text_len)) { *R = tstrdup ("auth.authorization"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_auth_checked_phone (struct paramed_type *T) {
+ if (autocomplete_constructor_auth_checked_phone (T) < 0) { return -1; }
+ return 0;
+}
+int autocomplete_type_bare_auth_checked_phone (struct paramed_type *T) {
+ if (autocomplete_constructor_auth_checked_phone (T) < 0) { return -1; }
+ return 0;
+}
+int do_autocomplete_type_auth_checked_phone (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "auth.checkedPhone", text_len)) { *R = tstrdup ("auth.checkedPhone"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_auth_exported_authorization (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_auth_exported_authorization); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 26 && !memcmp (cur_token, "auth.exportedAuthorization", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_auth_exported_authorization (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_auth_exported_authorization (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_auth_exported_authorization); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 26 && !memcmp (cur_token, "auth.exportedAuthorization", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_auth_exported_authorization (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_auth_exported_authorization (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "auth.exportedAuthorization", text_len)) { *R = tstrdup ("auth.exportedAuthorization"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_auth_password_recovery (struct paramed_type *T) {
+ if (autocomplete_constructor_auth_password_recovery (T) < 0) { return -1; }
+ return 0;
+}
+int autocomplete_type_bare_auth_password_recovery (struct paramed_type *T) {
+ if (autocomplete_constructor_auth_password_recovery (T) < 0) { return -1; }
+ return 0;
+}
+int do_autocomplete_type_auth_password_recovery (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "auth.passwordRecovery", text_len)) { *R = tstrdup ("auth.passwordRecovery"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_auth_sent_code (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_auth_sent_code); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "auth.sentCode", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_auth_sent_code (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "auth.sentAppCode", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_auth_sent_app_code (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_auth_sent_code (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_auth_sent_code); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "auth.sentCode", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_auth_sent_code (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "auth.sentAppCode", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_auth_sent_app_code (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_auth_sent_code (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "auth.sentCode", text_len)) { *R = tstrdup ("auth.sentCode"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "auth.sentAppCode", text_len)) { *R = tstrdup ("auth.sentAppCode"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_binlog_encr_key (struct paramed_type *T) {
+ if (autocomplete_constructor_binlog_encr_key (T) < 0) { return -1; }
+ return 0;
+}
+int autocomplete_type_bare_binlog_encr_key (struct paramed_type *T) {
+ if (autocomplete_constructor_binlog_encr_key (T) < 0) { return -1; }
+ return 0;
+}
+int do_autocomplete_type_binlog_encr_key (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "binlog.encrKey", text_len)) { *R = tstrdup ("binlog.encrKey"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_binlog_update (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_binlog_update); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 12 && !memcmp (cur_token, "binlog.start", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_start (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "binlog.dcOption", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_dc_option (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "binlog.dcOptionNew", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_dc_option_new (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "binlog.authKey", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_auth_key (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "binlog.defaultDc", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_default_dc (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "binlog.dcSigned", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_dc_signed (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 12 && !memcmp (cur_token, "binlog.ourId", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_our_id (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "binlog.setDhParams", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_set_dh_params (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "binlog.setPts", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_set_pts (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "binlog.setQts", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_set_qts (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "binlog.setDate", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_set_date (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "binlog.setSeq", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_set_seq (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "binlog.encrChatDelete", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_encr_chat_delete (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "binlog.encrChatNew", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_encr_chat_new (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "binlog.encrChatExchangeNew", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_encr_chat_exchange_new (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "binlog.userDelete", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_user_delete (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "binlog.userNew", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_user_new (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "binlog.chatNew", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_chat_new (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "binlog.chatAddParticipant", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_chat_add_participant (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "binlog.chatDelParticipant", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_chat_del_participant (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "binlog.setMsgId", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_set_msg_id (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "binlog.messageDelete", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_message_delete (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "binlog.messageNew", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_message_new (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "binlog.messageEncrNew", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_message_encr_new (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "binlog.msgUpdate", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_msg_update (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "binlog.resetAuthorization", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_reset_authorization (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_binlog_update (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_binlog_update); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 12 && !memcmp (cur_token, "binlog.start", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_start (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "binlog.dcOption", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_dc_option (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "binlog.dcOptionNew", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_dc_option_new (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "binlog.authKey", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_auth_key (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "binlog.defaultDc", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_default_dc (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "binlog.dcSigned", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_dc_signed (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 12 && !memcmp (cur_token, "binlog.ourId", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_our_id (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "binlog.setDhParams", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_set_dh_params (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "binlog.setPts", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_set_pts (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "binlog.setQts", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_set_qts (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "binlog.setDate", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_set_date (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "binlog.setSeq", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_set_seq (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "binlog.encrChatDelete", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_encr_chat_delete (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "binlog.encrChatNew", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_encr_chat_new (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "binlog.encrChatExchangeNew", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_encr_chat_exchange_new (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "binlog.userDelete", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_user_delete (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "binlog.userNew", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_user_new (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "binlog.chatNew", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_chat_new (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "binlog.chatAddParticipant", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_chat_add_participant (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "binlog.chatDelParticipant", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_chat_del_participant (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "binlog.setMsgId", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_set_msg_id (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "binlog.messageDelete", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_message_delete (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "binlog.messageNew", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_message_new (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "binlog.messageEncrNew", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_message_encr_new (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "binlog.msgUpdate", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_msg_update (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "binlog.resetAuthorization", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_binlog_reset_authorization (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_binlog_update (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "binlog.start", text_len)) { *R = tstrdup ("binlog.start"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "binlog.dcOption", text_len)) { *R = tstrdup ("binlog.dcOption"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "binlog.dcOptionNew", text_len)) { *R = tstrdup ("binlog.dcOptionNew"); return index; } else { index ++; }}
+ if (index == 3) { if (!strncmp (text, "binlog.authKey", text_len)) { *R = tstrdup ("binlog.authKey"); return index; } else { index ++; }}
+ if (index == 4) { if (!strncmp (text, "binlog.defaultDc", text_len)) { *R = tstrdup ("binlog.defaultDc"); return index; } else { index ++; }}
+ if (index == 5) { if (!strncmp (text, "binlog.dcSigned", text_len)) { *R = tstrdup ("binlog.dcSigned"); return index; } else { index ++; }}
+ if (index == 6) { if (!strncmp (text, "binlog.ourId", text_len)) { *R = tstrdup ("binlog.ourId"); return index; } else { index ++; }}
+ if (index == 7) { if (!strncmp (text, "binlog.setDhParams", text_len)) { *R = tstrdup ("binlog.setDhParams"); return index; } else { index ++; }}
+ if (index == 8) { if (!strncmp (text, "binlog.setPts", text_len)) { *R = tstrdup ("binlog.setPts"); return index; } else { index ++; }}
+ if (index == 9) { if (!strncmp (text, "binlog.setQts", text_len)) { *R = tstrdup ("binlog.setQts"); return index; } else { index ++; }}
+ if (index == 10) { if (!strncmp (text, "binlog.setDate", text_len)) { *R = tstrdup ("binlog.setDate"); return index; } else { index ++; }}
+ if (index == 11) { if (!strncmp (text, "binlog.setSeq", text_len)) { *R = tstrdup ("binlog.setSeq"); return index; } else { index ++; }}
+ if (index == 12) { if (!strncmp (text, "binlog.encrChatDelete", text_len)) { *R = tstrdup ("binlog.encrChatDelete"); return index; } else { index ++; }}
+ if (index == 13) { if (!strncmp (text, "binlog.encrChatNew", text_len)) { *R = tstrdup ("binlog.encrChatNew"); return index; } else { index ++; }}
+ if (index == 14) { if (!strncmp (text, "binlog.encrChatExchangeNew", text_len)) { *R = tstrdup ("binlog.encrChatExchangeNew"); return index; } else { index ++; }}
+ if (index == 15) { if (!strncmp (text, "binlog.userDelete", text_len)) { *R = tstrdup ("binlog.userDelete"); return index; } else { index ++; }}
+ if (index == 16) { if (!strncmp (text, "binlog.userNew", text_len)) { *R = tstrdup ("binlog.userNew"); return index; } else { index ++; }}
+ if (index == 17) { if (!strncmp (text, "binlog.chatNew", text_len)) { *R = tstrdup ("binlog.chatNew"); return index; } else { index ++; }}
+ if (index == 18) { if (!strncmp (text, "binlog.chatAddParticipant", text_len)) { *R = tstrdup ("binlog.chatAddParticipant"); return index; } else { index ++; }}
+ if (index == 19) { if (!strncmp (text, "binlog.chatDelParticipant", text_len)) { *R = tstrdup ("binlog.chatDelParticipant"); return index; } else { index ++; }}
+ if (index == 20) { if (!strncmp (text, "binlog.setMsgId", text_len)) { *R = tstrdup ("binlog.setMsgId"); return index; } else { index ++; }}
+ if (index == 21) { if (!strncmp (text, "binlog.messageDelete", text_len)) { *R = tstrdup ("binlog.messageDelete"); return index; } else { index ++; }}
+ if (index == 22) { if (!strncmp (text, "binlog.messageNew", text_len)) { *R = tstrdup ("binlog.messageNew"); return index; } else { index ++; }}
+ if (index == 23) { if (!strncmp (text, "binlog.messageEncrNew", text_len)) { *R = tstrdup ("binlog.messageEncrNew"); return index; } else { index ++; }}
+ if (index == 24) { if (!strncmp (text, "binlog.msgUpdate", text_len)) { *R = tstrdup ("binlog.msgUpdate"); return index; } else { index ++; }}
+ if (index == 25) { if (!strncmp (text, "binlog.resetAuthorization", text_len)) { *R = tstrdup ("binlog.resetAuthorization"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_contacts_blocked (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_contacts_blocked); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 16 && !memcmp (cur_token, "contacts.blocked", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contacts_blocked (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "contacts.blockedSlice", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contacts_blocked_slice (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_contacts_blocked (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_contacts_blocked); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 16 && !memcmp (cur_token, "contacts.blocked", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contacts_blocked (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "contacts.blockedSlice", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contacts_blocked_slice (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_contacts_blocked (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "contacts.blocked", text_len)) { *R = tstrdup ("contacts.blocked"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "contacts.blockedSlice", text_len)) { *R = tstrdup ("contacts.blockedSlice"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_contacts_contacts (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_contacts_contacts); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 28 && !memcmp (cur_token, "contacts.contactsNotModified", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contacts_contacts_not_modified (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "contacts.contacts", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contacts_contacts (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_contacts_contacts (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_contacts_contacts); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 28 && !memcmp (cur_token, "contacts.contactsNotModified", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contacts_contacts_not_modified (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "contacts.contacts", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contacts_contacts (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_contacts_contacts (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "contacts.contactsNotModified", text_len)) { *R = tstrdup ("contacts.contactsNotModified"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "contacts.contacts", text_len)) { *R = tstrdup ("contacts.contacts"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_contacts_found (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_contacts_found); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "contacts.found", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contacts_found (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_contacts_found (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_contacts_found); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "contacts.found", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contacts_found (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_contacts_found (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "contacts.found", text_len)) { *R = tstrdup ("contacts.found"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_contacts_imported_contacts (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_contacts_imported_contacts); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 25 && !memcmp (cur_token, "contacts.importedContacts", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contacts_imported_contacts (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_contacts_imported_contacts (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_contacts_imported_contacts); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 25 && !memcmp (cur_token, "contacts.importedContacts", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contacts_imported_contacts (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_contacts_imported_contacts (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "contacts.importedContacts", text_len)) { *R = tstrdup ("contacts.importedContacts"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_contacts_link (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_contacts_link); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "contacts.link", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contacts_link (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_contacts_link (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_contacts_link); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "contacts.link", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contacts_link (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_contacts_link (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "contacts.link", text_len)) { *R = tstrdup ("contacts.link"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_contacts_suggested (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_contacts_suggested); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "contacts.suggested", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contacts_suggested (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_contacts_suggested (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_contacts_suggested); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "contacts.suggested", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_contacts_suggested (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_contacts_suggested (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "contacts.suggested", text_len)) { *R = tstrdup ("contacts.suggested"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_geochats_located (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_geochats_located); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 16 && !memcmp (cur_token, "geochats.located", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_geochats_located (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_geochats_located (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_geochats_located); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 16 && !memcmp (cur_token, "geochats.located", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_geochats_located (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_geochats_located (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "geochats.located", text_len)) { *R = tstrdup ("geochats.located"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_geochats_messages (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_geochats_messages); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "geochats.messages", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_geochats_messages (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "geochats.messagesSlice", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_geochats_messages_slice (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_geochats_messages (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_geochats_messages); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "geochats.messages", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_geochats_messages (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "geochats.messagesSlice", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_geochats_messages_slice (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_geochats_messages (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "geochats.messages", text_len)) { *R = tstrdup ("geochats.messages"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "geochats.messagesSlice", text_len)) { *R = tstrdup ("geochats.messagesSlice"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_geochats_stated_message (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_geochats_stated_message); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 22 && !memcmp (cur_token, "geochats.statedMessage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_geochats_stated_message (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_geochats_stated_message (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_geochats_stated_message); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 22 && !memcmp (cur_token, "geochats.statedMessage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_geochats_stated_message (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_geochats_stated_message (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "geochats.statedMessage", text_len)) { *R = tstrdup ("geochats.statedMessage"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_help_app_update (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_help_app_update); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "help.appUpdate", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_help_app_update (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "help.noAppUpdate", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_help_no_app_update (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_help_app_update (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_help_app_update); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "help.appUpdate", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_help_app_update (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "help.noAppUpdate", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_help_no_app_update (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_help_app_update (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "help.appUpdate", text_len)) { *R = tstrdup ("help.appUpdate"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "help.noAppUpdate", text_len)) { *R = tstrdup ("help.noAppUpdate"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_help_invite_text (struct paramed_type *T) {
+ if (autocomplete_constructor_help_invite_text (T) < 0) { return -1; }
+ return 0;
+}
+int autocomplete_type_bare_help_invite_text (struct paramed_type *T) {
+ if (autocomplete_constructor_help_invite_text (T) < 0) { return -1; }
+ return 0;
+}
+int do_autocomplete_type_help_invite_text (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "help.inviteText", text_len)) { *R = tstrdup ("help.inviteText"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_help_support (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_help_support); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 12 && !memcmp (cur_token, "help.support", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_help_support (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_help_support (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_help_support); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 12 && !memcmp (cur_token, "help.support", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_help_support (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_help_support (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "help.support", text_len)) { *R = tstrdup ("help.support"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_messages_affected_history (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_messages_affected_history); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 24 && !memcmp (cur_token, "messages.affectedHistory", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_affected_history (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_messages_affected_history (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_messages_affected_history); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 24 && !memcmp (cur_token, "messages.affectedHistory", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_affected_history (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_messages_affected_history (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "messages.affectedHistory", text_len)) { *R = tstrdup ("messages.affectedHistory"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_messages_affected_messages (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_messages_affected_messages); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 25 && !memcmp (cur_token, "messages.affectedMessages", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_affected_messages (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_messages_affected_messages (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_messages_affected_messages); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 25 && !memcmp (cur_token, "messages.affectedMessages", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_affected_messages (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_messages_affected_messages (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "messages.affectedMessages", text_len)) { *R = tstrdup ("messages.affectedMessages"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_messages_all_stickers (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_messages_all_stickers); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 31 && !memcmp (cur_token, "messages.allStickersNotModified", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_all_stickers_not_modified (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messages.allStickers", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_all_stickers (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_messages_all_stickers (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_messages_all_stickers); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 31 && !memcmp (cur_token, "messages.allStickersNotModified", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_all_stickers_not_modified (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messages.allStickers", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_all_stickers (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_messages_all_stickers (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "messages.allStickersNotModified", text_len)) { *R = tstrdup ("messages.allStickersNotModified"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "messages.allStickers", text_len)) { *R = tstrdup ("messages.allStickers"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_messages_chat_full (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_messages_chat_full); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messages.chatFull", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_chat_full (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_messages_chat_full (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_messages_chat_full); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messages.chatFull", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_chat_full (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_messages_chat_full (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "messages.chatFull", text_len)) { *R = tstrdup ("messages.chatFull"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_messages_chats (struct paramed_type *T) {
+ if (autocomplete_constructor_messages_chats (T) < 0) { return -1; }
+ return 0;
+}
+int autocomplete_type_bare_messages_chats (struct paramed_type *T) {
+ if (autocomplete_constructor_messages_chats (T) < 0) { return -1; }
+ return 0;
+}
+int do_autocomplete_type_messages_chats (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "messages.chats", text_len)) { *R = tstrdup ("messages.chats"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_messages_dh_config (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_messages_dh_config); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 28 && !memcmp (cur_token, "messages.dhConfigNotModified", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_dh_config_not_modified (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messages.dhConfig", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_dh_config (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_messages_dh_config (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_messages_dh_config); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 28 && !memcmp (cur_token, "messages.dhConfigNotModified", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_dh_config_not_modified (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messages.dhConfig", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_dh_config (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_messages_dh_config (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "messages.dhConfigNotModified", text_len)) { *R = tstrdup ("messages.dhConfigNotModified"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "messages.dhConfig", text_len)) { *R = tstrdup ("messages.dhConfig"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_messages_dialogs (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_messages_dialogs); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 16 && !memcmp (cur_token, "messages.dialogs", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_dialogs (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "messages.dialogsSlice", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_dialogs_slice (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_messages_dialogs (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_messages_dialogs); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 16 && !memcmp (cur_token, "messages.dialogs", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_dialogs (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "messages.dialogsSlice", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_dialogs_slice (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_messages_dialogs (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "messages.dialogs", text_len)) { *R = tstrdup ("messages.dialogs"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "messages.dialogsSlice", text_len)) { *R = tstrdup ("messages.dialogsSlice"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_messages_message (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_messages_message); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 21 && !memcmp (cur_token, "messages.messageEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_message_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_messages_message (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_messages_message); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 21 && !memcmp (cur_token, "messages.messageEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_message_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_messages_message (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "messages.messageEmpty", text_len)) { *R = tstrdup ("messages.messageEmpty"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_messages_messages (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_messages_messages); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messages.messages", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_messages (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "messages.messagesSlice", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_messages_slice (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_messages_messages (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_messages_messages); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messages.messages", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_messages (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "messages.messagesSlice", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_messages_slice (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_messages_messages (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "messages.messages", text_len)) { *R = tstrdup ("messages.messages"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "messages.messagesSlice", text_len)) { *R = tstrdup ("messages.messagesSlice"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_messages_sent_encrypted_message (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_messages_sent_encrypted_message); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 29 && !memcmp (cur_token, "messages.sentEncryptedMessage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_sent_encrypted_message (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "messages.sentEncryptedFile", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_sent_encrypted_file (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_messages_sent_encrypted_message (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_messages_sent_encrypted_message); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 29 && !memcmp (cur_token, "messages.sentEncryptedMessage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_sent_encrypted_message (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "messages.sentEncryptedFile", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_sent_encrypted_file (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_messages_sent_encrypted_message (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "messages.sentEncryptedMessage", text_len)) { *R = tstrdup ("messages.sentEncryptedMessage"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "messages.sentEncryptedFile", text_len)) { *R = tstrdup ("messages.sentEncryptedFile"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_messages_sent_message (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_messages_sent_message); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messages.sentMessage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_sent_message (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "messages.sentMessageLink", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_sent_message_link (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_messages_sent_message (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_messages_sent_message); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messages.sentMessage", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_sent_message (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "messages.sentMessageLink", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_sent_message_link (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_messages_sent_message (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "messages.sentMessage", text_len)) { *R = tstrdup ("messages.sentMessage"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "messages.sentMessageLink", text_len)) { *R = tstrdup ("messages.sentMessageLink"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_messages_sticker_set (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_messages_sticker_set); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 19 && !memcmp (cur_token, "messages.stickerSet", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_sticker_set (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_messages_sticker_set (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_messages_sticker_set); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 19 && !memcmp (cur_token, "messages.stickerSet", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_sticker_set (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_messages_sticker_set (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "messages.stickerSet", text_len)) { *R = tstrdup ("messages.stickerSet"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_messages_stickers (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_messages_stickers); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 28 && !memcmp (cur_token, "messages.stickersNotModified", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_stickers_not_modified (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messages.stickers", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_stickers (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_messages_stickers (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_messages_stickers); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 28 && !memcmp (cur_token, "messages.stickersNotModified", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_stickers_not_modified (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messages.stickers", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_messages_stickers (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_messages_stickers (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "messages.stickersNotModified", text_len)) { *R = tstrdup ("messages.stickersNotModified"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "messages.stickers", text_len)) { *R = tstrdup ("messages.stickers"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_photos_photo (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_photos_photo); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 12 && !memcmp (cur_token, "photos.photo", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_photos_photo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_photos_photo (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_photos_photo); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 12 && !memcmp (cur_token, "photos.photo", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_photos_photo (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_photos_photo (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "photos.photo", text_len)) { *R = tstrdup ("photos.photo"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_photos_photos (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_photos_photos); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "photos.photos", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_photos_photos (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "photos.photosSlice", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_photos_photos_slice (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_photos_photos (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_photos_photos); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "photos.photos", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_photos_photos (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "photos.photosSlice", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_photos_photos_slice (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_photos_photos (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "photos.photos", text_len)) { *R = tstrdup ("photos.photos"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "photos.photosSlice", text_len)) { *R = tstrdup ("photos.photosSlice"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_storage_file_type (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_storage_file_type); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 19 && !memcmp (cur_token, "storage.fileUnknown", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_storage_file_unknown (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "storage.fileJpeg", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_storage_file_jpeg (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "storage.fileGif", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_storage_file_gif (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "storage.filePng", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_storage_file_png (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "storage.filePdf", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_storage_file_pdf (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "storage.fileMp3", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_storage_file_mp3 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "storage.fileMov", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_storage_file_mov (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "storage.filePartial", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_storage_file_partial (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "storage.fileMp4", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_storage_file_mp4 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "storage.fileWebp", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_storage_file_webp (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_storage_file_type (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_storage_file_type); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 19 && !memcmp (cur_token, "storage.fileUnknown", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_storage_file_unknown (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "storage.fileJpeg", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_storage_file_jpeg (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "storage.fileGif", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_storage_file_gif (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "storage.filePng", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_storage_file_png (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "storage.filePdf", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_storage_file_pdf (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "storage.fileMp3", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_storage_file_mp3 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "storage.fileMov", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_storage_file_mov (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "storage.filePartial", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_storage_file_partial (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "storage.fileMp4", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_storage_file_mp4 (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "storage.fileWebp", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_storage_file_webp (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_storage_file_type (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "storage.fileUnknown", text_len)) { *R = tstrdup ("storage.fileUnknown"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "storage.fileJpeg", text_len)) { *R = tstrdup ("storage.fileJpeg"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "storage.fileGif", text_len)) { *R = tstrdup ("storage.fileGif"); return index; } else { index ++; }}
+ if (index == 3) { if (!strncmp (text, "storage.filePng", text_len)) { *R = tstrdup ("storage.filePng"); return index; } else { index ++; }}
+ if (index == 4) { if (!strncmp (text, "storage.filePdf", text_len)) { *R = tstrdup ("storage.filePdf"); return index; } else { index ++; }}
+ if (index == 5) { if (!strncmp (text, "storage.fileMp3", text_len)) { *R = tstrdup ("storage.fileMp3"); return index; } else { index ++; }}
+ if (index == 6) { if (!strncmp (text, "storage.fileMov", text_len)) { *R = tstrdup ("storage.fileMov"); return index; } else { index ++; }}
+ if (index == 7) { if (!strncmp (text, "storage.filePartial", text_len)) { *R = tstrdup ("storage.filePartial"); return index; } else { index ++; }}
+ if (index == 8) { if (!strncmp (text, "storage.fileMp4", text_len)) { *R = tstrdup ("storage.fileMp4"); return index; } else { index ++; }}
+ if (index == 9) { if (!strncmp (text, "storage.fileWebp", text_len)) { *R = tstrdup ("storage.fileWebp"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_updates_difference (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_updates_difference); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 23 && !memcmp (cur_token, "updates.differenceEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_updates_difference_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "updates.difference", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_updates_difference (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "updates.differenceSlice", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_updates_difference_slice (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_updates_difference (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_updates_difference); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 23 && !memcmp (cur_token, "updates.differenceEmpty", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_updates_difference_empty (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "updates.difference", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_updates_difference (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "updates.differenceSlice", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_updates_difference_slice (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_updates_difference (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "updates.differenceEmpty", text_len)) { *R = tstrdup ("updates.differenceEmpty"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "updates.difference", text_len)) { *R = tstrdup ("updates.difference"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "updates.differenceSlice", text_len)) { *R = tstrdup ("updates.differenceSlice"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_updates_state (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_updates_state); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "updates.state", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_updates_state (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_updates_state (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_updates_state); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "updates.state", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_updates_state (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_updates_state (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "updates.state", text_len)) { *R = tstrdup ("updates.state"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+int autocomplete_type_upload_file (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_upload_file); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 11 && !memcmp (cur_token, "upload.file", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_upload_file (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int autocomplete_type_bare_upload_file (struct paramed_type *T) {
+ expect_token_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_upload_file); return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 11 && !memcmp (cur_token, "upload.file", cur_token_len)) {
+ local_next_token ();
+ if (autocomplete_constructor_upload_file (T) < 0) { return -1; }
+ expect_token_autocomplete (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int do_autocomplete_type_upload_file (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "upload.file", text_len)) { *R = tstrdup ("upload.file"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+struct paramed_type *autocomplete_function_account_change_phone (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "phone_number", cur_token_real_len)) {
+ set_autocomplete_string ("phone_number");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "phone_number", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "phone_code_hash", cur_token_real_len)) {
+ set_autocomplete_string ("phone_code_hash");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "phone_code_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "phone_code", cur_token_real_len)) {
+ set_autocomplete_string ("phone_code");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "phone_code", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_account_check_username (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "username", cur_token_real_len)) {
+ set_autocomplete_string ("username");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "username", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_account_delete_account (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "reason", cur_token_real_len)) {
+ set_autocomplete_string ("reason");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "reason", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_account_get_account_t_t_l (void) {
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb8d0afdf, .id = "AccountDaysTTL", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_account_get_authorizations (void) {
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1250abde, .id = "account.Authorizations", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_account_get_notify_settings (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02b6911b, .id = "InputNotifyPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_notify_peer (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_account_get_password (void) {
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xeac2a804, .id = "account.Password", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_account_get_password_settings (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 21 && !cur_token_quoted && !memcmp (cur_token, "current_password_hash", cur_token_real_len)) {
+ set_autocomplete_string ("current_password_hash");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 21 && !memcmp (cur_token, "current_password_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb7b72ab3, .id = "account.PasswordSettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_account_get_privacy (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "key", cur_token_real_len)) {
+ set_autocomplete_string ("key");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "key", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4f96cb18, .id = "InputPrivacyKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_privacy_key (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x554abb6f, .id = "account.PrivacyRules", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_account_get_wall_papers (void) {
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xafa14973, .id = "WallPaper", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_account_register_device (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "token_type", cur_token_real_len)) {
+ set_autocomplete_string ("token_type");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "token_type", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "token", cur_token_real_len)) {
+ set_autocomplete_string ("token");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "token", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "device_model", cur_token_real_len)) {
+ set_autocomplete_string ("device_model");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "device_model", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 14 && !cur_token_quoted && !memcmp (cur_token, "system_version", cur_token_real_len)) {
+ set_autocomplete_string ("system_version");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 14 && !memcmp (cur_token, "system_version", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "app_version", cur_token_real_len)) {
+ set_autocomplete_string ("app_version");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "app_version", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field5) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "app_sandbox", cur_token_real_len)) {
+ set_autocomplete_string ("app_sandbox");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "app_sandbox", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bool (field6) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "lang_code", cur_token_real_len)) {
+ set_autocomplete_string ("lang_code");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "lang_code", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field7) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_account_reset_authorization (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "hash", cur_token_real_len)) {
+ set_autocomplete_string ("hash");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_account_reset_notify_settings (void) {
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_account_send_change_phone_code (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "phone_number", cur_token_real_len)) {
+ set_autocomplete_string ("phone_number");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "phone_number", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa4f58c4c, .id = "account.SentChangePhoneCode", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_account_set_account_t_t_l (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "ttl", cur_token_real_len)) {
+ set_autocomplete_string ("ttl");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "ttl", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb8d0afdf, .id = "AccountDaysTTL", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_account_days_t_t_l (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_account_set_privacy (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "key", cur_token_real_len)) {
+ set_autocomplete_string ("key");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "key", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4f96cb18, .id = "InputPrivacyKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_privacy_key (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "rules", cur_token_real_len)) {
+ set_autocomplete_string ("rules");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "rules", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4b815163, .id = "InputPrivacyRule", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x554abb6f, .id = "account.PrivacyRules", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_account_unregister_device (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "token_type", cur_token_real_len)) {
+ set_autocomplete_string ("token_type");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "token_type", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "token", cur_token_real_len)) {
+ set_autocomplete_string ("token");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "token", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_account_update_device_locked (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "period", cur_token_real_len)) {
+ set_autocomplete_string ("period");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "period", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_account_update_notify_settings (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02b6911b, .id = "InputNotifyPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_notify_peer (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "settings", cur_token_real_len)) {
+ set_autocomplete_string ("settings");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "settings", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x46a2ce98, .id = "InputPeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_peer_notify_settings (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_account_update_password_settings (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 21 && !cur_token_quoted && !memcmp (cur_token, "current_password_hash", cur_token_real_len)) {
+ set_autocomplete_string ("current_password_hash");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 21 && !memcmp (cur_token, "current_password_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "new_settings", cur_token_real_len)) {
+ set_autocomplete_string ("new_settings");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "new_settings", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xbcfc532c, .id = "account.PasswordInputSettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_account_password_input_settings (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_account_update_profile (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "first_name", cur_token_real_len)) {
+ set_autocomplete_string ("first_name");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "first_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "last_name", cur_token_real_len)) {
+ set_autocomplete_string ("last_name");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "last_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_account_update_status (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "offline", cur_token_real_len)) {
+ set_autocomplete_string ("offline");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "offline", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bool (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_account_update_username (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "username", cur_token_real_len)) {
+ set_autocomplete_string ("username");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "username", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_auth_bind_temp_auth_key (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 16 && !cur_token_quoted && !memcmp (cur_token, "perm_auth_key_id", cur_token_real_len)) {
+ set_autocomplete_string ("perm_auth_key_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 16 && !memcmp (cur_token, "perm_auth_key_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "nonce", cur_token_real_len)) {
+ set_autocomplete_string ("nonce");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "expires_at", cur_token_real_len)) {
+ set_autocomplete_string ("expires_at");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "expires_at", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 17 && !cur_token_quoted && !memcmp (cur_token, "encrypted_message", cur_token_real_len)) {
+ set_autocomplete_string ("encrypted_message");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 17 && !memcmp (cur_token, "encrypted_message", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field4) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_auth_check_password (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 13 && !cur_token_quoted && !memcmp (cur_token, "password_hash", cur_token_real_len)) {
+ set_autocomplete_string ("password_hash");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 13 && !memcmp (cur_token, "password_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xff036af1, .id = "auth.Authorization", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_auth_check_phone (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "phone_number", cur_token_real_len)) {
+ set_autocomplete_string ("phone_number");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "phone_number", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x811ea28e, .id = "auth.CheckedPhone", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_auth_export_authorization (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "dc_id", cur_token_real_len)) {
+ set_autocomplete_string ("dc_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "dc_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xdf969c2d, .id = "auth.ExportedAuthorization", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_auth_import_authorization (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "bytes", cur_token_real_len)) {
+ set_autocomplete_string ("bytes");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "bytes", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xff036af1, .id = "auth.Authorization", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_auth_import_bot_authorization (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_real_len)) {
+ set_autocomplete_string ("flags");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "api_id", cur_token_real_len)) {
+ set_autocomplete_string ("api_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "api_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "api_hash", cur_token_real_len)) {
+ set_autocomplete_string ("api_hash");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "api_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 14 && !cur_token_quoted && !memcmp (cur_token, "bot_auth_token", cur_token_real_len)) {
+ set_autocomplete_string ("bot_auth_token");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 14 && !memcmp (cur_token, "bot_auth_token", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xff036af1, .id = "auth.Authorization", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_auth_log_out (void) {
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_auth_recover_password (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "code", cur_token_real_len)) {
+ set_autocomplete_string ("code");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "code", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xff036af1, .id = "auth.Authorization", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_auth_request_password_recovery (void) {
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x137948a5, .id = "auth.PasswordRecovery", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_auth_reset_authorizations (void) {
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_auth_send_call (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "phone_number", cur_token_real_len)) {
+ set_autocomplete_string ("phone_number");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "phone_number", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "phone_code_hash", cur_token_real_len)) {
+ set_autocomplete_string ("phone_code_hash");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "phone_code_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_auth_send_code (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "phone_number", cur_token_real_len)) {
+ set_autocomplete_string ("phone_number");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "phone_number", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "sms_type", cur_token_real_len)) {
+ set_autocomplete_string ("sms_type");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "sms_type", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "api_id", cur_token_real_len)) {
+ set_autocomplete_string ("api_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "api_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "api_hash", cur_token_real_len)) {
+ set_autocomplete_string ("api_hash");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "api_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "lang_code", cur_token_real_len)) {
+ set_autocomplete_string ("lang_code");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "lang_code", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field5) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0cc8bc16, .id = "auth.SentCode", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_auth_send_invites (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 13 && !cur_token_quoted && !memcmp (cur_token, "phone_numbers", cur_token_real_len)) {
+ set_autocomplete_string ("phone_numbers");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 13 && !memcmp (cur_token, "phone_numbers", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_real_len)) {
+ set_autocomplete_string ("message");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_auth_send_sms (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "phone_number", cur_token_real_len)) {
+ set_autocomplete_string ("phone_number");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "phone_number", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "phone_code_hash", cur_token_real_len)) {
+ set_autocomplete_string ("phone_code_hash");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "phone_code_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_auth_sign_in (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "phone_number", cur_token_real_len)) {
+ set_autocomplete_string ("phone_number");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "phone_number", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "phone_code_hash", cur_token_real_len)) {
+ set_autocomplete_string ("phone_code_hash");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "phone_code_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "phone_code", cur_token_real_len)) {
+ set_autocomplete_string ("phone_code");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "phone_code", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xff036af1, .id = "auth.Authorization", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_auth_sign_up (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "phone_number", cur_token_real_len)) {
+ set_autocomplete_string ("phone_number");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "phone_number", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "phone_code_hash", cur_token_real_len)) {
+ set_autocomplete_string ("phone_code_hash");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "phone_code_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "phone_code", cur_token_real_len)) {
+ set_autocomplete_string ("phone_code");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "phone_code", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "first_name", cur_token_real_len)) {
+ set_autocomplete_string ("first_name");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "first_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "last_name", cur_token_real_len)) {
+ set_autocomplete_string ("last_name");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "last_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field5) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xff036af1, .id = "auth.Authorization", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_contacts_block (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_user (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_contacts_delete_contact (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_user (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3ace484c, .id = "contacts.Link", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_contacts_delete_contacts (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_contacts_export_card (void) {
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_contacts_get_blocked (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "offset", cur_token_real_len)) {
+ set_autocomplete_string ("offset");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "offset", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "limit", cur_token_real_len)) {
+ set_autocomplete_string ("limit");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "limit", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x8c1b8fb4, .id = "contacts.Blocked", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_contacts_get_contacts (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "hash", cur_token_real_len)) {
+ set_autocomplete_string ("hash");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xd8c02560, .id = "contacts.Contacts", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_contacts_get_statuses (void) {
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xd3680c61, .id = "ContactStatus", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_contacts_get_suggested (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "limit", cur_token_real_len)) {
+ set_autocomplete_string ("limit");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "limit", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5649dcc5, .id = "contacts.Suggested", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_contacts_import_card (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "export_card", cur_token_real_len)) {
+ set_autocomplete_string ("export_card");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "export_card", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_contacts_import_contacts (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "contacts", cur_token_real_len)) {
+ set_autocomplete_string ("contacts");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "contacts", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf392b7f4, .id = "InputContact", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "replace", cur_token_real_len)) {
+ set_autocomplete_string ("replace");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "replace", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bool (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xad524315, .id = "contacts.ImportedContacts", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_contacts_resolve_username (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "username", cur_token_real_len)) {
+ set_autocomplete_string ("username");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "username", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_contacts_search (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "q", cur_token_real_len)) {
+ set_autocomplete_string ("q");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "q", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "limit", cur_token_real_len)) {
+ set_autocomplete_string ("limit");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "limit", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0566000e, .id = "contacts.Found", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_contacts_unblock (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_user (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_geochats_checkin (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x74d456fa, .id = "InputGeoChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_geo_chat (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17b1578b, .id = "geochats.StatedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_geochats_create_geo_chat (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_real_len)) {
+ set_autocomplete_string ("title");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "geo_point", cur_token_real_len)) {
+ set_autocomplete_string ("geo_point");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "geo_point", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17768f1f, .id = "InputGeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_geo_point (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "address", cur_token_real_len)) {
+ set_autocomplete_string ("address");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "address", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "venue", cur_token_real_len)) {
+ set_autocomplete_string ("venue");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "venue", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17b1578b, .id = "geochats.StatedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_geochats_edit_chat_photo (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x74d456fa, .id = "InputGeoChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_geo_chat (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "photo", cur_token_real_len)) {
+ set_autocomplete_string ("photo");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3a60776d, .id = "InputChatPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_chat_photo (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17b1578b, .id = "geochats.StatedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_geochats_edit_chat_title (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x74d456fa, .id = "InputGeoChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_geo_chat (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_real_len)) {
+ set_autocomplete_string ("title");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "address", cur_token_real_len)) {
+ set_autocomplete_string ("address");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "address", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17b1578b, .id = "geochats.StatedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_geochats_get_full_chat (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x74d456fa, .id = "InputGeoChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_geo_chat (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe5d7d19c, .id = "messages.ChatFull", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_geochats_get_history (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x74d456fa, .id = "InputGeoChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_geo_chat (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "offset", cur_token_real_len)) {
+ set_autocomplete_string ("offset");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "offset", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "max_id", cur_token_real_len)) {
+ set_autocomplete_string ("max_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "max_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "limit", cur_token_real_len)) {
+ set_autocomplete_string ("limit");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "limit", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x6d0a0e59, .id = "geochats.Messages", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_geochats_get_located (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "geo_point", cur_token_real_len)) {
+ set_autocomplete_string ("geo_point");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "geo_point", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17768f1f, .id = "InputGeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_geo_point (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "radius", cur_token_real_len)) {
+ set_autocomplete_string ("radius");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "radius", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "limit", cur_token_real_len)) {
+ set_autocomplete_string ("limit");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "limit", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x48feb267, .id = "geochats.Located", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_geochats_get_recents (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "offset", cur_token_real_len)) {
+ set_autocomplete_string ("offset");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "offset", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "limit", cur_token_real_len)) {
+ set_autocomplete_string ("limit");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "limit", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x6d0a0e59, .id = "geochats.Messages", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_geochats_search (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x74d456fa, .id = "InputGeoChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_geo_chat (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "q", cur_token_real_len)) {
+ set_autocomplete_string ("q");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "q", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "filter", cur_token_real_len)) {
+ set_autocomplete_string ("filter");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "filter", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x80895ae0, .id = "MessagesFilter", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_messages_filter (field3) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "min_date", cur_token_real_len)) {
+ set_autocomplete_string ("min_date");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "min_date", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "max_date", cur_token_real_len)) {
+ set_autocomplete_string ("max_date");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "max_date", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "offset", cur_token_real_len)) {
+ set_autocomplete_string ("offset");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "offset", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field6) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "max_id", cur_token_real_len)) {
+ set_autocomplete_string ("max_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "max_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field7) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "limit", cur_token_real_len)) {
+ set_autocomplete_string ("limit");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "limit", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field8) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x6d0a0e59, .id = "geochats.Messages", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_geochats_send_media (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x74d456fa, .id = "InputGeoChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_geo_chat (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "media", cur_token_real_len)) {
+ set_autocomplete_string ("media");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "media", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb32c91dd, .id = "InputMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_media (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_real_len)) {
+ set_autocomplete_string ("random_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17b1578b, .id = "geochats.StatedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_geochats_send_message (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x74d456fa, .id = "InputGeoChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_geo_chat (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_real_len)) {
+ set_autocomplete_string ("message");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_real_len)) {
+ set_autocomplete_string ("random_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17b1578b, .id = "geochats.StatedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_geochats_set_typing (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x74d456fa, .id = "InputGeoChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_geo_chat (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "typing", cur_token_real_len)) {
+ set_autocomplete_string ("typing");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "typing", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bool (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_help_get_app_update (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "device_model", cur_token_real_len)) {
+ set_autocomplete_string ("device_model");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "device_model", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 14 && !cur_token_quoted && !memcmp (cur_token, "system_version", cur_token_real_len)) {
+ set_autocomplete_string ("system_version");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 14 && !memcmp (cur_token, "system_version", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "app_version", cur_token_real_len)) {
+ set_autocomplete_string ("app_version");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "app_version", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "lang_code", cur_token_real_len)) {
+ set_autocomplete_string ("lang_code");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "lang_code", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ddd9627, .id = "help.AppUpdate", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_help_get_config (void) {
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4e32b894, .id = "Config", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_help_get_invite_text (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "lang_code", cur_token_real_len)) {
+ set_autocomplete_string ("lang_code");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "lang_code", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x18cb9f78, .id = "help.InviteText", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_help_get_nearest_dc (void) {
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x8e1a1775, .id = "NearestDc", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_help_get_support (void) {
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17c6b5f6, .id = "help.Support", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_help_save_app_log (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "events", cur_token_real_len)) {
+ set_autocomplete_string ("events");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "events", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x770656a8, .id = "InputAppEvent", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_init_connection (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "api_id", cur_token_real_len)) {
+ set_autocomplete_string ("api_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "api_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "device_model", cur_token_real_len)) {
+ set_autocomplete_string ("device_model");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "device_model", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 14 && !cur_token_quoted && !memcmp (cur_token, "system_version", cur_token_real_len)) {
+ set_autocomplete_string ("system_version");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 14 && !memcmp (cur_token, "system_version", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "app_version", cur_token_real_len)) {
+ set_autocomplete_string ("app_version");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "app_version", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field5) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "lang_code", cur_token_real_len)) {
+ set_autocomplete_string ("lang_code");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "lang_code", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field6) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "query", cur_token_real_len)) {
+ set_autocomplete_string ("query");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "query", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 = autocomplete_function_any ();
+ if (!field7) { return 0; }
+ add_var_to_be_freed (field7);
+ if (ODDP(field7)) { return 0; }
+ struct paramed_type *var0 = field7; assert (var0);
+ struct paramed_type *R =
+ var0;
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_invoke_after_msg (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "msg_id", cur_token_real_len)) {
+ set_autocomplete_string ("msg_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "msg_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "query", cur_token_real_len)) {
+ set_autocomplete_string ("query");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "query", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 = autocomplete_function_any ();
+ if (!field3) { return 0; }
+ add_var_to_be_freed (field3);
+ if (ODDP(field3)) { return 0; }
+ struct paramed_type *var0 = field3; assert (var0);
+ struct paramed_type *R =
+ var0;
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_invoke_after_msgs (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "msg_ids", cur_token_real_len)) {
+ set_autocomplete_string ("msg_ids");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "msg_ids", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "query", cur_token_real_len)) {
+ set_autocomplete_string ("query");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "query", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 = autocomplete_function_any ();
+ if (!field3) { return 0; }
+ add_var_to_be_freed (field3);
+ if (ODDP(field3)) { return 0; }
+ struct paramed_type *var0 = field3; assert (var0);
+ struct paramed_type *R =
+ var0;
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_invoke_with_layer (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "layer", cur_token_real_len)) {
+ set_autocomplete_string ("layer");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "layer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "query", cur_token_real_len)) {
+ set_autocomplete_string ("query");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "query", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 = autocomplete_function_any ();
+ if (!field3) { return 0; }
+ add_var_to_be_freed (field3);
+ if (ODDP(field3)) { return 0; }
+ struct paramed_type *var0 = field3; assert (var0);
+ struct paramed_type *R =
+ var0;
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_invoke_without_updates (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "query", cur_token_real_len)) {
+ set_autocomplete_string ("query");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "query", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 = autocomplete_function_any ();
+ if (!field2) { return 0; }
+ add_var_to_be_freed (field2);
+ if (ODDP(field2)) { return 0; }
+ struct paramed_type *var0 = field2; assert (var0);
+ struct paramed_type *R =
+ var0;
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_accept_encryption (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf141b5e1, .id = "InputEncryptedChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_encrypted_chat (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "g_b", cur_token_real_len)) {
+ set_autocomplete_string ("g_b");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "g_b", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "key_fingerprint", cur_token_real_len)) {
+ set_autocomplete_string ("key_fingerprint");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "key_fingerprint", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb1718213, .id = "EncryptedChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_add_chat_user (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_real_len)) {
+ set_autocomplete_string ("chat_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_user (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "fwd_limit", cur_token_real_len)) {
+ set_autocomplete_string ("fwd_limit");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "fwd_limit", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x22499d27, .id = "Updates", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_check_chat_invite (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "hash", cur_token_real_len)) {
+ set_autocomplete_string ("hash");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x94f910b1, .id = "ChatInvite", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_create_chat (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_real_len)) {
+ set_autocomplete_string ("users");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_real_len)) {
+ set_autocomplete_string ("title");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x22499d27, .id = "Updates", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_delete_chat_user (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_real_len)) {
+ set_autocomplete_string ("chat_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_user (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x22499d27, .id = "Updates", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_delete_history (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9e67268d, .id = "InputPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_peer (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "offset", cur_token_real_len)) {
+ set_autocomplete_string ("offset");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "offset", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb45c69d1, .id = "messages.AffectedHistory", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_delete_messages (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x84d19185, .id = "messages.AffectedMessages", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_discard_encryption (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_real_len)) {
+ set_autocomplete_string ("chat_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_edit_chat_photo (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_real_len)) {
+ set_autocomplete_string ("chat_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "photo", cur_token_real_len)) {
+ set_autocomplete_string ("photo");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3a60776d, .id = "InputChatPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_chat_photo (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x22499d27, .id = "Updates", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_edit_chat_title (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_real_len)) {
+ set_autocomplete_string ("chat_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_real_len)) {
+ set_autocomplete_string ("title");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x22499d27, .id = "Updates", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_export_chat_invite (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_real_len)) {
+ set_autocomplete_string ("chat_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f132d5, .id = "ExportedChatInvite", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_forward_message (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9e67268d, .id = "InputPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_peer (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_real_len)) {
+ set_autocomplete_string ("random_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x22499d27, .id = "Updates", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_forward_messages (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9e67268d, .id = "InputPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_peer (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_real_len)) {
+ set_autocomplete_string ("random_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x22499d27, .id = "Updates", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_get_all_stickers (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "hash", cur_token_real_len)) {
+ set_autocomplete_string ("hash");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb485502f, .id = "messages.AllStickers", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_get_chats (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x64ff9fd5, .id = "messages.Chats", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_get_dh_config (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "version", cur_token_real_len)) {
+ set_autocomplete_string ("version");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "version", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 13 && !cur_token_quoted && !memcmp (cur_token, "random_length", cur_token_real_len)) {
+ set_autocomplete_string ("random_length");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 13 && !memcmp (cur_token, "random_length", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xecc058e8, .id = "messages.DhConfig", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_get_dialogs (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "offset", cur_token_real_len)) {
+ set_autocomplete_string ("offset");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "offset", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "max_id", cur_token_real_len)) {
+ set_autocomplete_string ("max_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "max_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "limit", cur_token_real_len)) {
+ set_autocomplete_string ("limit");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "limit", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x645af8b3, .id = "messages.Dialogs", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_get_full_chat (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_real_len)) {
+ set_autocomplete_string ("chat_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe5d7d19c, .id = "messages.ChatFull", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_get_history (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9e67268d, .id = "InputPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_peer (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "offset", cur_token_real_len)) {
+ set_autocomplete_string ("offset");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "offset", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "max_id", cur_token_real_len)) {
+ set_autocomplete_string ("max_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "max_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "limit", cur_token_real_len)) {
+ set_autocomplete_string ("limit");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "limit", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x8735e464, .id = "messages.Messages", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_get_messages (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x8735e464, .id = "messages.Messages", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_get_sticker_set (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "stickerset", cur_token_real_len)) {
+ set_autocomplete_string ("stickerset");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "stickerset", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe44d415c, .id = "InputStickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_sticker_set (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb60a24a6, .id = "messages.StickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_get_stickers (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "emoticon", cur_token_real_len)) {
+ set_autocomplete_string ("emoticon");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "emoticon", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "hash", cur_token_real_len)) {
+ set_autocomplete_string ("hash");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bfa5710, .id = "messages.Stickers", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_get_web_page_preview (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_real_len)) {
+ set_autocomplete_string ("message");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_import_chat_invite (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "hash", cur_token_real_len)) {
+ set_autocomplete_string ("hash");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x22499d27, .id = "Updates", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_install_sticker_set (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "stickerset", cur_token_real_len)) {
+ set_autocomplete_string ("stickerset");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "stickerset", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe44d415c, .id = "InputStickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_sticker_set (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_read_encrypted_history (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf141b5e1, .id = "InputEncryptedChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_encrypted_chat (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "max_date", cur_token_real_len)) {
+ set_autocomplete_string ("max_date");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "max_date", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_read_history (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9e67268d, .id = "InputPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_peer (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "max_id", cur_token_real_len)) {
+ set_autocomplete_string ("max_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "max_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "offset", cur_token_real_len)) {
+ set_autocomplete_string ("offset");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "offset", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb45c69d1, .id = "messages.AffectedHistory", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_read_message_contents (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x84d19185, .id = "messages.AffectedMessages", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_received_messages (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "max_id", cur_token_real_len)) {
+ set_autocomplete_string ("max_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "max_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa384b779, .id = "ReceivedNotifyMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_received_queue (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "max_qts", cur_token_real_len)) {
+ set_autocomplete_string ("max_qts");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "max_qts", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_request_encryption (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_user (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_real_len)) {
+ set_autocomplete_string ("random_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "g_a", cur_token_real_len)) {
+ set_autocomplete_string ("g_a");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "g_a", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb1718213, .id = "EncryptedChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_search (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9e67268d, .id = "InputPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_peer (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "q", cur_token_real_len)) {
+ set_autocomplete_string ("q");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "q", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "filter", cur_token_real_len)) {
+ set_autocomplete_string ("filter");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "filter", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x80895ae0, .id = "MessagesFilter", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_messages_filter (field3) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "min_date", cur_token_real_len)) {
+ set_autocomplete_string ("min_date");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "min_date", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "max_date", cur_token_real_len)) {
+ set_autocomplete_string ("max_date");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "max_date", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field5) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "offset", cur_token_real_len)) {
+ set_autocomplete_string ("offset");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "offset", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field6) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "max_id", cur_token_real_len)) {
+ set_autocomplete_string ("max_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "max_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field7) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "limit", cur_token_real_len)) {
+ set_autocomplete_string ("limit");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "limit", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field8) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x8735e464, .id = "messages.Messages", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_send_broadcast (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "contacts", cur_token_real_len)) {
+ set_autocomplete_string ("contacts");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "contacts", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_real_len)) {
+ set_autocomplete_string ("random_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_real_len)) {
+ set_autocomplete_string ("message");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "media", cur_token_real_len)) {
+ set_autocomplete_string ("media");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "media", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb32c91dd, .id = "InputMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_media (field4) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x22499d27, .id = "Updates", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_send_encrypted (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf141b5e1, .id = "InputEncryptedChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_encrypted_chat (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_real_len)) {
+ set_autocomplete_string ("random_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "data", cur_token_real_len)) {
+ set_autocomplete_string ("data");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "data", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc29c7607, .id = "messages.SentEncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_send_encrypted_file (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf141b5e1, .id = "InputEncryptedChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_encrypted_chat (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_real_len)) {
+ set_autocomplete_string ("random_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "data", cur_token_real_len)) {
+ set_autocomplete_string ("data");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "data", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field3) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "file", cur_token_real_len)) {
+ set_autocomplete_string ("file");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "file", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0b5c064f, .id = "InputEncryptedFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_encrypted_file (field4) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc29c7607, .id = "messages.SentEncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_send_encrypted_service (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf141b5e1, .id = "InputEncryptedChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_encrypted_chat (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_real_len)) {
+ set_autocomplete_string ("random_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "data", cur_token_real_len)) {
+ set_autocomplete_string ("data");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "data", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc29c7607, .id = "messages.SentEncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_send_media (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_real_len)) {
+ set_autocomplete_string ("flags");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ if (cur_token_len < 0) { return 0; }
+ if (!is_int ()) { return 0;}
+ struct paramed_type *var0 = INT2PTR (get_int ());
+ assert (var0);
+ local_next_token ();
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9e67268d, .id = "InputPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_peer (field2) < 0) { return 0;}
+ if (PTR2INT (var0) & (1 << 0)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "reply_to_msg_id", cur_token_real_len)) {
+ set_autocomplete_string ("reply_to_msg_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "reply_to_msg_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return 0;}
+ }
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "media", cur_token_real_len)) {
+ set_autocomplete_string ("media");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "media", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb32c91dd, .id = "InputMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_media (field4) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_real_len)) {
+ set_autocomplete_string ("random_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field5) < 0) { return 0;}
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "reply_markup", cur_token_real_len)) {
+ set_autocomplete_string ("reply_markup");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "reply_markup", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x612ca4a9, .id = "ReplyMarkup", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_reply_markup (field6) < 0) { return 0;}
+ }
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x22499d27, .id = "Updates", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_send_message (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_real_len)) {
+ set_autocomplete_string ("flags");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ if (cur_token_len < 0) { return 0; }
+ if (!is_int ()) { return 0;}
+ struct paramed_type *var0 = INT2PTR (get_int ());
+ assert (var0);
+ local_next_token ();
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9e67268d, .id = "InputPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_peer (field2) < 0) { return 0;}
+ if (PTR2INT (var0) & (1 << 0)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 15 && !cur_token_quoted && !memcmp (cur_token, "reply_to_msg_id", cur_token_real_len)) {
+ set_autocomplete_string ("reply_to_msg_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !memcmp (cur_token, "reply_to_msg_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return 0;}
+ }
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_real_len)) {
+ set_autocomplete_string ("message");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_real_len)) {
+ set_autocomplete_string ("random_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field5) < 0) { return 0;}
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "reply_markup", cur_token_real_len)) {
+ set_autocomplete_string ("reply_markup");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "reply_markup", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x612ca4a9, .id = "ReplyMarkup", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_reply_markup (field6) < 0) { return 0;}
+ }
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x799ce190, .id = "messages.SentMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_set_encrypted_typing (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf141b5e1, .id = "InputEncryptedChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_encrypted_chat (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "typing", cur_token_real_len)) {
+ set_autocomplete_string ("typing");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "typing", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bool (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_set_typing (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_real_len)) {
+ set_autocomplete_string ("peer");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9e67268d, .id = "InputPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_peer (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "action", cur_token_real_len)) {
+ set_autocomplete_string ("action");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "action", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x70541c7e, .id = "SendMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_send_message_action (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_start_bot (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "bot", cur_token_real_len)) {
+ set_autocomplete_string ("bot");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "bot", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_user (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_real_len)) {
+ set_autocomplete_string ("chat_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_real_len)) {
+ set_autocomplete_string ("random_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field3) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 11 && !cur_token_quoted && !memcmp (cur_token, "start_param", cur_token_real_len)) {
+ set_autocomplete_string ("start_param");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !memcmp (cur_token, "start_param", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x22499d27, .id = "Updates", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_messages_uninstall_sticker_set (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 10 && !cur_token_quoted && !memcmp (cur_token, "stickerset", cur_token_real_len)) {
+ set_autocomplete_string ("stickerset");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !memcmp (cur_token, "stickerset", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe44d415c, .id = "InputStickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_sticker_set (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_photos_delete_photos (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe74279c9, .id = "InputPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_photos_get_user_photos (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_real_len)) {
+ set_autocomplete_string ("user_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_user (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "offset", cur_token_real_len)) {
+ set_autocomplete_string ("offset");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "offset", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "max_id", cur_token_real_len)) {
+ set_autocomplete_string ("max_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "max_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "limit", cur_token_real_len)) {
+ set_autocomplete_string ("limit");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "limit", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field4) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x98cf75f1, .id = "photos.Photos", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_photos_update_profile_photo (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe74279c9, .id = "InputPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_photo (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "crop", cur_token_real_len)) {
+ set_autocomplete_string ("crop");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "crop", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7477e321, .id = "InputPhotoCrop", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_photo_crop (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9a486229, .id = "UserProfilePhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_photos_upload_profile_photo (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "file", cur_token_real_len)) {
+ set_autocomplete_string ("file");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "file", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_file (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "caption", cur_token_real_len)) {
+ set_autocomplete_string ("caption");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "caption", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "geo_point", cur_token_real_len)) {
+ set_autocomplete_string ("geo_point");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "geo_point", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17768f1f, .id = "InputGeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_geo_point (field3) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "crop", cur_token_real_len)) {
+ set_autocomplete_string ("crop");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "crop", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7477e321, .id = "InputPhotoCrop", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_photo_crop (field4) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x20212ca8, .id = "photos.Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_req_d_h_params (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "nonce", cur_token_real_len)) {
+ set_autocomplete_string ("nonce");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "server_nonce", cur_token_real_len)) {
+ set_autocomplete_string ("server_nonce");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "server_nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "p", cur_token_real_len)) {
+ set_autocomplete_string ("p");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "p", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 1 && !cur_token_quoted && !memcmp (cur_token, "q", cur_token_real_len)) {
+ set_autocomplete_string ("q");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !memcmp (cur_token, "q", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field4) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 22 && !cur_token_quoted && !memcmp (cur_token, "public_key_fingerprint", cur_token_real_len)) {
+ set_autocomplete_string ("public_key_fingerprint");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 22 && !memcmp (cur_token, "public_key_fingerprint", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field5) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 14 && !cur_token_quoted && !memcmp (cur_token, "encrypted_data", cur_token_real_len)) {
+ set_autocomplete_string ("encrypted_data");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 14 && !memcmp (cur_token, "encrypted_data", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field6) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa9230301, .id = "Server_DH_Params", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_req_pq (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "nonce", cur_token_real_len)) {
+ set_autocomplete_string ("nonce");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x05162463, .id = "ResPQ", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_set_client_d_h_params (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "nonce", cur_token_real_len)) {
+ set_autocomplete_string ("nonce");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 12 && !cur_token_quoted && !memcmp (cur_token, "server_nonce", cur_token_real_len)) {
+ set_autocomplete_string ("server_nonce");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !memcmp (cur_token, "server_nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int128 (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 14 && !cur_token_quoted && !memcmp (cur_token, "encrypted_data", cur_token_real_len)) {
+ set_autocomplete_string ("encrypted_data");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 14 && !memcmp (cur_token, "encrypted_data", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_string (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xdb8a468f, .id = "Set_client_DH_params_answer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_updates_get_difference (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_real_len)) {
+ set_autocomplete_string ("pts");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_real_len)) {
+ set_autocomplete_string ("date");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 3 && !cur_token_quoted && !memcmp (cur_token, "qts", cur_token_real_len)) {
+ set_autocomplete_string ("qts");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !memcmp (cur_token, "qts", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf57a2419, .id = "updates.Difference", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_updates_get_state (void) {
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa56c2a3e, .id = "updates.State", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_upload_get_file (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 8 && !cur_token_quoted && !memcmp (cur_token, "location", cur_token_real_len)) {
+ set_autocomplete_string ("location");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !memcmp (cur_token, "location", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe6daa38b, .id = "InputFileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_file_location (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 6 && !cur_token_quoted && !memcmp (cur_token, "offset", cur_token_real_len)) {
+ set_autocomplete_string ("offset");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !memcmp (cur_token, "offset", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "limit", cur_token_real_len)) {
+ set_autocomplete_string ("limit");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "limit", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x096a18d5, .id = "upload.File", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_upload_save_big_file_part (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "file_id", cur_token_real_len)) {
+ set_autocomplete_string ("file_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "file_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "file_part", cur_token_real_len)) {
+ set_autocomplete_string ("file_part");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "file_part", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 16 && !cur_token_quoted && !memcmp (cur_token, "file_total_parts", cur_token_real_len)) {
+ set_autocomplete_string ("file_total_parts");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 16 && !memcmp (cur_token, "file_total_parts", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field3) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "bytes", cur_token_real_len)) {
+ set_autocomplete_string ("bytes");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "bytes", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field4) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_upload_save_file_part (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 7 && !cur_token_quoted && !memcmp (cur_token, "file_id", cur_token_real_len)) {
+ set_autocomplete_string ("file_id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !memcmp (cur_token, "file_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_long (field1) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 9 && !cur_token_quoted && !memcmp (cur_token, "file_part", cur_token_real_len)) {
+ set_autocomplete_string ("file_part");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !memcmp (cur_token, "file_part", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len == -3 && cur_token_real_len <= 5 && !cur_token_quoted && !memcmp (cur_token, "bytes", cur_token_real_len)) {
+ set_autocomplete_string ("bytes");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !memcmp (cur_token, "bytes", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_bare_bytes (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_users_get_full_user (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (autocomplete_type_input_user (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5a89ac5b, .id = "UserFull", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *autocomplete_function_users_get_users (void) {
+ if (cur_token_len == -3 && cur_token_real_len <= 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_real_len)) {
+ set_autocomplete_string ("id");
+ return 0;
+ }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr_autocomplete (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (autocomplete_type_vector (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ return paramed_type_dup (R);
+}
+int autocomplete_type_any (struct paramed_type *T) {
+ switch (T->type->name) {
+ case 0xb8d0afdf: return autocomplete_type_account_days_t_t_l (T);
+ case 0x472f5020: return autocomplete_type_bare_account_days_t_t_l (T);
+ case 0x9fc5ec4e: return autocomplete_type_audio (T);
+ case 0x603a13b1: return autocomplete_type_bare_audio (T);
+ case 0x7bf2e6f6: return autocomplete_type_authorization (T);
+ case 0x840d1909: return autocomplete_type_bare_authorization (T);
+ case 0x250be282: return autocomplete_type_bool (T);
+ case 0xdaf41d7d: return autocomplete_type_bare_bool (T);
+ case 0x75e7ea6c: return autocomplete_type_bot_command (T);
+ case 0x8a181593: return autocomplete_type_bare_bot_command (T);
+ case 0xb2e16f93: return autocomplete_type_bot_info (T);
+ case 0x4d1e906c: return autocomplete_type_bare_bot_info (T);
+ case 0x0ee1379f: return autocomplete_type_bytes (T);
+ case 0xf11ec860: return autocomplete_type_bare_bytes (T);
+ case 0x7bd865dc: return autocomplete_type_chat (T);
+ case 0x84279a23: return autocomplete_type_bare_chat (T);
+ case 0x2e02a614: return autocomplete_type_chat_full (T);
+ case 0xd1fd59eb: return autocomplete_type_bare_chat_full (T);
+ case 0x94f910b1: return autocomplete_type_chat_invite (T);
+ case 0x6b06ef4e: return autocomplete_type_bare_chat_invite (T);
+ case 0x3631cf4c: return autocomplete_type_chat_located (T);
+ case 0xc9ce30b3: return autocomplete_type_bare_chat_located (T);
+ case 0xc8d7493e: return autocomplete_type_chat_participant (T);
+ case 0x3728b6c1: return autocomplete_type_bare_chat_participant (T);
+ case 0x77930f9f: return autocomplete_type_chat_participants (T);
+ case 0x886cf060: return autocomplete_type_bare_chat_participants (T);
+ case 0x56922676: return autocomplete_type_chat_photo (T);
+ case 0xa96dd989: return autocomplete_type_bare_chat_photo (T);
+ case 0x6643b654: return autocomplete_type_client_d_h_inner_data (T);
+ case 0x99bc49ab: return autocomplete_type_bare_client_d_h_inner_data (T);
+ case 0x4e32b894: return autocomplete_type_config (T);
+ case 0xb1cd476b: return autocomplete_type_bare_config (T);
+ case 0xf911c994: return autocomplete_type_contact (T);
+ case 0x06ee366b: return autocomplete_type_bare_contact (T);
+ case 0x561bc879: return autocomplete_type_contact_blocked (T);
+ case 0xa9e43786: return autocomplete_type_bare_contact_blocked (T);
+ case 0xea879f95: return autocomplete_type_contact_found (T);
+ case 0x1578606a: return autocomplete_type_bare_contact_found (T);
+ case 0x522fbc63: return autocomplete_type_contact_link (T);
+ case 0xadd0439c: return autocomplete_type_bare_contact_link (T);
+ case 0xd3680c61: return autocomplete_type_contact_status (T);
+ case 0x2c97f39e: return autocomplete_type_bare_contact_status (T);
+ case 0x3de191a1: return autocomplete_type_contact_suggested (T);
+ case 0xc21e6e5e: return autocomplete_type_bare_contact_suggested (T);
+ case 0x2b1a62f0: return autocomplete_type_dc_option (T);
+ case 0xd4e59d0f: return autocomplete_type_bare_dc_option (T);
+ case 0x535b7918: return autocomplete_type_decrypted_message (T);
+ case 0xaca486e7: return autocomplete_type_bare_decrypted_message (T);
+ case 0x4e0eefde: return autocomplete_type_decrypted_message_action (T);
+ case 0xb1f11021: return autocomplete_type_bare_decrypted_message_action (T);
+ case 0x1be31789: return autocomplete_type_decrypted_message_layer (T);
+ case 0xe41ce876: return autocomplete_type_bare_decrypted_message_layer (T);
+ case 0x34e0d674: return autocomplete_type_decrypted_message_media (T);
+ case 0xcb1f298b: return autocomplete_type_bare_decrypted_message_media (T);
+ case 0xc1dd804a: return autocomplete_type_dialog (T);
+ case 0x3e227fb5: return autocomplete_type_bare_dialog (T);
+ case 0xae636f24: return autocomplete_type_disabled_feature (T);
+ case 0x519c90db: return autocomplete_type_bare_disabled_feature (T);
+ case 0x51a73418: return autocomplete_type_document (T);
+ case 0xae58cbe7: return autocomplete_type_bare_document (T);
+ case 0x97c637a3: return autocomplete_type_document_attribute (T);
+ case 0x6839c85c: return autocomplete_type_bare_document_attribute (T);
+ case 0x2210c154: return autocomplete_type_double (T);
+ case 0xddef3eab: return autocomplete_type_bare_double (T);
+ case 0xb1718213: return autocomplete_type_encrypted_chat (T);
+ case 0x4e8e7dec: return autocomplete_type_bare_encrypted_chat (T);
+ case 0x886fd032: return autocomplete_type_encrypted_file (T);
+ case 0x77902fcd: return autocomplete_type_bare_encrypted_file (T);
+ case 0xce6b8a1e: return autocomplete_type_encrypted_message (T);
+ case 0x319475e1: return autocomplete_type_bare_encrypted_message (T);
+ case 0xc4b9f9bb: return autocomplete_type_error (T);
+ case 0x3b460644: return autocomplete_type_bare_error (T);
+ case 0x95f132d5: return autocomplete_type_exported_chat_invite (T);
+ case 0x6a0ecd2a: return autocomplete_type_bare_exported_chat_invite (T);
+ case 0x2f8ffb30: return autocomplete_type_file_location (T);
+ case 0xd07004cf: return autocomplete_type_bare_file_location (T);
+ case 0xf67b4034: return autocomplete_type_geo_chat_message (T);
+ case 0x0984bfcb: return autocomplete_type_bare_geo_chat_message (T);
+ case 0x315e0a53: return autocomplete_type_geo_point (T);
+ case 0xcea1f5ac: return autocomplete_type_bare_geo_point (T);
+ case 0xd0028438: return autocomplete_type_imported_contact (T);
+ case 0x2ffd7bc7: return autocomplete_type_bare_imported_contact (T);
+ case 0x770656a8: return autocomplete_type_input_app_event (T);
+ case 0x88f9a957: return autocomplete_type_bare_input_app_event (T);
+ case 0xae8e9c7b: return autocomplete_type_input_audio (T);
+ case 0x51716384: return autocomplete_type_bare_input_audio (T);
+ case 0x3a60776d: return autocomplete_type_input_chat_photo (T);
+ case 0xc59f8892: return autocomplete_type_bare_input_chat_photo (T);
+ case 0xf392b7f4: return autocomplete_type_input_contact (T);
+ case 0x0c6d480b: return autocomplete_type_bare_input_contact (T);
+ case 0x6a8963fc: return autocomplete_type_input_document (T);
+ case 0x95769c03: return autocomplete_type_bare_input_document (T);
+ case 0xf141b5e1: return autocomplete_type_input_encrypted_chat (T);
+ case 0x0ebe4a1e: return autocomplete_type_bare_input_encrypted_chat (T);
+ case 0x0b5c064f: return autocomplete_type_input_encrypted_file (T);
+ case 0xf4a3f9b0: return autocomplete_type_bare_input_encrypted_file (T);
+ case 0x0f60f9ca: return autocomplete_type_input_file (T);
+ case 0xf09f0635: return autocomplete_type_bare_input_file (T);
+ case 0xe6daa38b: return autocomplete_type_input_file_location (T);
+ case 0x19255c74: return autocomplete_type_bare_input_file_location (T);
+ case 0x74d456fa: return autocomplete_type_input_geo_chat (T);
+ case 0x8b2ba905: return autocomplete_type_bare_input_geo_chat (T);
+ case 0x17768f1f: return autocomplete_type_input_geo_point (T);
+ case 0xe88970e0: return autocomplete_type_bare_input_geo_point (T);
+ case 0xb32c91dd: return autocomplete_type_input_media (T);
+ case 0x4cd36e22: return autocomplete_type_bare_input_media (T);
+ case 0x02b6911b: return autocomplete_type_input_notify_peer (T);
+ case 0xfd496ee4: return autocomplete_type_bare_input_notify_peer (T);
+ case 0x9e67268d: return autocomplete_type_input_peer (T);
+ case 0x6198d972: return autocomplete_type_bare_input_peer (T);
+ case 0x185a48ac: return autocomplete_type_input_peer_notify_events (T);
+ case 0xe7a5b753: return autocomplete_type_bare_input_peer_notify_events (T);
+ case 0x46a2ce98: return autocomplete_type_input_peer_notify_settings (T);
+ case 0xb95d3167: return autocomplete_type_bare_input_peer_notify_settings (T);
+ case 0xe74279c9: return autocomplete_type_input_photo (T);
+ case 0x18bd8636: return autocomplete_type_bare_input_photo (T);
+ case 0x7477e321: return autocomplete_type_input_photo_crop (T);
+ case 0x8b881cde: return autocomplete_type_bare_input_photo_crop (T);
+ case 0x4f96cb18: return autocomplete_type_input_privacy_key (T);
+ case 0xb06934e7: return autocomplete_type_bare_input_privacy_key (T);
+ case 0x4b815163: return autocomplete_type_input_privacy_rule (T);
+ case 0xb47eae9c: return autocomplete_type_bare_input_privacy_rule (T);
+ case 0xe44d415c: return autocomplete_type_input_sticker_set (T);
+ case 0x1bb2bea3: return autocomplete_type_bare_input_sticker_set (T);
+ case 0xadfe0c6a: return autocomplete_type_input_user (T);
+ case 0x5201f395: return autocomplete_type_bare_input_user (T);
+ case 0xbb5f7a27: return autocomplete_type_input_video (T);
+ case 0x44a085d8: return autocomplete_type_bare_input_video (T);
+ case 0xa8509bda: return autocomplete_type_int (T);
+ case 0x57af6425: return autocomplete_type_bare_int (T);
+ case 0x7d36c439: return autocomplete_type_int128 (T);
+ case 0x82c93bc6: return autocomplete_type_bare_int128 (T);
+ case 0xf2c798b3: return autocomplete_type_int256 (T);
+ case 0x0d38674c: return autocomplete_type_bare_int256 (T);
+ case 0xa2fa4880: return autocomplete_type_keyboard_button (T);
+ case 0x5d05b77f: return autocomplete_type_bare_keyboard_button (T);
+ case 0x77608b83: return autocomplete_type_keyboard_button_row (T);
+ case 0x889f747c: return autocomplete_type_bare_keyboard_button_row (T);
+ case 0x22076cba: return autocomplete_type_long (T);
+ case 0xddf89345: return autocomplete_type_bare_long (T);
+ case 0x5d652a7f: return autocomplete_type_message (T);
+ case 0xa29ad580: return autocomplete_type_bare_message (T);
+ case 0x383415fa: return autocomplete_type_message_action (T);
+ case 0xc7cbea05: return autocomplete_type_bare_message_action (T);
+ case 0x95f2471a: return autocomplete_type_message_media (T);
+ case 0x6a0db8e5: return autocomplete_type_bare_message_media (T);
+ case 0x80895ae0: return autocomplete_type_messages_filter (T);
+ case 0x7f76a51f: return autocomplete_type_bare_messages_filter (T);
+ case 0x8e1a1775: return autocomplete_type_nearest_dc (T);
+ case 0x71e5e88a: return autocomplete_type_bare_nearest_dc (T);
+ case 0x9fcb8237: return autocomplete_type_notify_peer (T);
+ case 0x60347dc8: return autocomplete_type_bare_notify_peer (T);
+ case 0x56730bcc: return autocomplete_type_null (T);
+ case 0xa98cf433: return autocomplete_type_bare_null (T);
+ case 0xbfa3de38: return autocomplete_type_p_q_inner_data (T);
+ case 0x405c21c7: return autocomplete_type_bare_p_q_inner_data (T);
+ case 0x276159d6: return autocomplete_type_peer (T);
+ case 0xd89ea629: return autocomplete_type_bare_peer (T);
+ case 0xc0c8d13b: return autocomplete_type_peer_notify_events (T);
+ case 0x3f372ec4: return autocomplete_type_bare_peer_notify_events (T);
+ case 0xfdf894fc: return autocomplete_type_peer_notify_settings (T);
+ case 0x02076b03: return autocomplete_type_bare_peer_notify_settings (T);
+ case 0xc207550a: return autocomplete_type_photo (T);
+ case 0x3df8aaf5: return autocomplete_type_bare_photo (T);
+ case 0x900f60dd: return autocomplete_type_photo_size (T);
+ case 0x6ff09f22: return autocomplete_type_bare_photo_size (T);
+ case 0xbc2eab30: return autocomplete_type_privacy_key (T);
+ case 0x43d154cf: return autocomplete_type_bare_privacy_key (T);
+ case 0xa8638aec: return autocomplete_type_privacy_rule (T);
+ case 0x579c7513: return autocomplete_type_bare_privacy_rule (T);
+ case 0xa384b779: return autocomplete_type_received_notify_message (T);
+ case 0x5c7b4886: return autocomplete_type_bare_received_notify_message (T);
+ case 0x612ca4a9: return autocomplete_type_reply_markup (T);
+ case 0x9ed35b56: return autocomplete_type_bare_reply_markup (T);
+ case 0x05162463: return autocomplete_type_res_p_q (T);
+ case 0xfae9db9c: return autocomplete_type_bare_res_p_q (T);
+ case 0x70541c7e: return autocomplete_type_send_message_action (T);
+ case 0x8fabe381: return autocomplete_type_bare_send_message_action (T);
+ case 0xa9230301: return autocomplete_type_server_d_h_params (T);
+ case 0x56dcfcfe: return autocomplete_type_bare_server_d_h_params (T);
+ case 0xb5890dba: return autocomplete_type_server_d_h_inner_data (T);
+ case 0x4a76f245: return autocomplete_type_bare_server_d_h_inner_data (T);
+ case 0xdb8a468f: return autocomplete_type_set_client_d_h_params_answer (T);
+ case 0x2475b970: return autocomplete_type_bare_set_client_d_h_params_answer (T);
+ case 0x12b299d4: return autocomplete_type_sticker_pack (T);
+ case 0xed4d662b: return autocomplete_type_bare_sticker_pack (T);
+ case 0xa7a43b17: return autocomplete_type_sticker_set (T);
+ case 0x585bc4e8: return autocomplete_type_bare_sticker_set (T);
+ case 0xb5286e24: return autocomplete_type_string (T);
+ case 0x4ad791db: return autocomplete_type_bare_string (T);
+ case 0x2e02b27e: return autocomplete_type_update (T);
+ case 0xd1fd4d81: return autocomplete_type_bare_update (T);
+ case 0x22499d27: return autocomplete_type_updates (T);
+ case 0xddb662d8: return autocomplete_type_bare_updates (T);
+ case 0x02e6c0c8: return autocomplete_type_user (T);
+ case 0xfd193f37: return autocomplete_type_bare_user (T);
+ case 0x5a89ac5b: return autocomplete_type_user_full (T);
+ case 0xa57653a4: return autocomplete_type_bare_user_full (T);
+ case 0x9a486229: return autocomplete_type_user_profile_photo (T);
+ case 0x65b79dd6: return autocomplete_type_bare_user_profile_photo (T);
+ case 0x76de9570: return autocomplete_type_user_status (T);
+ case 0x89216a8f: return autocomplete_type_bare_user_status (T);
+ case 0x1cb5c415: return autocomplete_type_vector (T);
+ case 0xe34a3bea: return autocomplete_type_bare_vector (T);
+ case 0x1716b174: return autocomplete_type_video (T);
+ case 0xe8e94e8b: return autocomplete_type_bare_video (T);
+ case 0xafa14973: return autocomplete_type_wall_paper (T);
+ case 0x505eb68c: return autocomplete_type_bare_wall_paper (T);
+ case 0x8d8c0d41: return autocomplete_type_web_page (T);
+ case 0x7273f2be: return autocomplete_type_bare_web_page (T);
+ case 0x1250abde: return autocomplete_type_account_authorizations (T);
+ case 0xedaf5421: return autocomplete_type_bare_account_authorizations (T);
+ case 0xeac2a804: return autocomplete_type_account_password (T);
+ case 0x153d57fb: return autocomplete_type_bare_account_password (T);
+ case 0xbcfc532c: return autocomplete_type_account_password_input_settings (T);
+ case 0x4303acd3: return autocomplete_type_bare_account_password_input_settings (T);
+ case 0xb7b72ab3: return autocomplete_type_account_password_settings (T);
+ case 0x4848d54c: return autocomplete_type_bare_account_password_settings (T);
+ case 0x554abb6f: return autocomplete_type_account_privacy_rules (T);
+ case 0xaab54490: return autocomplete_type_bare_account_privacy_rules (T);
+ case 0xa4f58c4c: return autocomplete_type_account_sent_change_phone_code (T);
+ case 0x5b0a73b3: return autocomplete_type_bare_account_sent_change_phone_code (T);
+ case 0xff036af1: return autocomplete_type_auth_authorization (T);
+ case 0x00fc950e: return autocomplete_type_bare_auth_authorization (T);
+ case 0x811ea28e: return autocomplete_type_auth_checked_phone (T);
+ case 0x7ee15d71: return autocomplete_type_bare_auth_checked_phone (T);
+ case 0xdf969c2d: return autocomplete_type_auth_exported_authorization (T);
+ case 0x206963d2: return autocomplete_type_bare_auth_exported_authorization (T);
+ case 0x137948a5: return autocomplete_type_auth_password_recovery (T);
+ case 0xec86b75a: return autocomplete_type_bare_auth_password_recovery (T);
+ case 0x0cc8bc16: return autocomplete_type_auth_sent_code (T);
+ case 0xf33743e9: return autocomplete_type_bare_auth_sent_code (T);
+ case 0x0377168f: return autocomplete_type_binlog_encr_key (T);
+ case 0xfc88e970: return autocomplete_type_bare_binlog_encr_key (T);
+ case 0x66ff03a6: return autocomplete_type_binlog_update (T);
+ case 0x9900fc59: return autocomplete_type_bare_binlog_update (T);
+ case 0x8c1b8fb4: return autocomplete_type_contacts_blocked (T);
+ case 0x73e4704b: return autocomplete_type_bare_contacts_blocked (T);
+ case 0xd8c02560: return autocomplete_type_contacts_contacts (T);
+ case 0x273fda9f: return autocomplete_type_bare_contacts_contacts (T);
+ case 0x0566000e: return autocomplete_type_contacts_found (T);
+ case 0xfa99fff1: return autocomplete_type_bare_contacts_found (T);
+ case 0xad524315: return autocomplete_type_contacts_imported_contacts (T);
+ case 0x52adbcea: return autocomplete_type_bare_contacts_imported_contacts (T);
+ case 0x3ace484c: return autocomplete_type_contacts_link (T);
+ case 0xc531b7b3: return autocomplete_type_bare_contacts_link (T);
+ case 0x5649dcc5: return autocomplete_type_contacts_suggested (T);
+ case 0xa9b6233a: return autocomplete_type_bare_contacts_suggested (T);
+ case 0x48feb267: return autocomplete_type_geochats_located (T);
+ case 0xb7014d98: return autocomplete_type_bare_geochats_located (T);
+ case 0x6d0a0e59: return autocomplete_type_geochats_messages (T);
+ case 0x92f5f1a6: return autocomplete_type_bare_geochats_messages (T);
+ case 0x17b1578b: return autocomplete_type_geochats_stated_message (T);
+ case 0xe84ea874: return autocomplete_type_bare_geochats_stated_message (T);
+ case 0x4ddd9627: return autocomplete_type_help_app_update (T);
+ case 0xb22269d8: return autocomplete_type_bare_help_app_update (T);
+ case 0x18cb9f78: return autocomplete_type_help_invite_text (T);
+ case 0xe7346087: return autocomplete_type_bare_help_invite_text (T);
+ case 0x17c6b5f6: return autocomplete_type_help_support (T);
+ case 0xe8394a09: return autocomplete_type_bare_help_support (T);
+ case 0xb45c69d1: return autocomplete_type_messages_affected_history (T);
+ case 0x4ba3962e: return autocomplete_type_bare_messages_affected_history (T);
+ case 0x84d19185: return autocomplete_type_messages_affected_messages (T);
+ case 0x7b2e6e7a: return autocomplete_type_bare_messages_affected_messages (T);
+ case 0xb485502f: return autocomplete_type_messages_all_stickers (T);
+ case 0x4b7aafd0: return autocomplete_type_bare_messages_all_stickers (T);
+ case 0xe5d7d19c: return autocomplete_type_messages_chat_full (T);
+ case 0x1a282e63: return autocomplete_type_bare_messages_chat_full (T);
+ case 0x64ff9fd5: return autocomplete_type_messages_chats (T);
+ case 0x9b00602a: return autocomplete_type_bare_messages_chats (T);
+ case 0xecc058e8: return autocomplete_type_messages_dh_config (T);
+ case 0x133fa717: return autocomplete_type_bare_messages_dh_config (T);
+ case 0x645af8b3: return autocomplete_type_messages_dialogs (T);
+ case 0x9ba5074c: return autocomplete_type_bare_messages_dialogs (T);
+ case 0x3f4e0648: return autocomplete_type_messages_message (T);
+ case 0xc0b1f9b7: return autocomplete_type_bare_messages_message (T);
+ case 0x8735e464: return autocomplete_type_messages_messages (T);
+ case 0x78ca1b9b: return autocomplete_type_bare_messages_messages (T);
+ case 0xc29c7607: return autocomplete_type_messages_sent_encrypted_message (T);
+ case 0x3d6389f8: return autocomplete_type_bare_messages_sent_encrypted_message (T);
+ case 0x799ce190: return autocomplete_type_messages_sent_message (T);
+ case 0x86631e6f: return autocomplete_type_bare_messages_sent_message (T);
+ case 0xb60a24a6: return autocomplete_type_messages_sticker_set (T);
+ case 0x49f5db59: return autocomplete_type_bare_messages_sticker_set (T);
+ case 0x7bfa5710: return autocomplete_type_messages_stickers (T);
+ case 0x8405a8ef: return autocomplete_type_bare_messages_stickers (T);
+ case 0x20212ca8: return autocomplete_type_photos_photo (T);
+ case 0xdfded357: return autocomplete_type_bare_photos_photo (T);
+ case 0x98cf75f1: return autocomplete_type_photos_photos (T);
+ case 0x67308a0e: return autocomplete_type_bare_photos_photos (T);
+ case 0x3e2838a8: return autocomplete_type_storage_file_type (T);
+ case 0xc1d7c757: return autocomplete_type_bare_storage_file_type (T);
+ case 0xf57a2419: return autocomplete_type_updates_difference (T);
+ case 0x0a85dbe6: return autocomplete_type_bare_updates_difference (T);
+ case 0xa56c2a3e: return autocomplete_type_updates_state (T);
+ case 0x5a93d5c1: return autocomplete_type_bare_updates_state (T);
+ case 0x096a18d5: return autocomplete_type_upload_file (T);
+ case 0xf695e72a: return autocomplete_type_bare_upload_file (T);
+ default: return -1; }
+}
+int do_autocomplete_function (const char *text, int text_len, int index, char **R) {
+ index ++;
+ if (index == 0) { if (!strncmp (text, "account.changePhone", text_len)) { *R = tstrdup ("account.changePhone"); return index; } else { index ++; }}
+ if (index == 1) { if (!strncmp (text, "account.checkUsername", text_len)) { *R = tstrdup ("account.checkUsername"); return index; } else { index ++; }}
+ if (index == 2) { if (!strncmp (text, "account.deleteAccount", text_len)) { *R = tstrdup ("account.deleteAccount"); return index; } else { index ++; }}
+ if (index == 3) { if (!strncmp (text, "account.getAccountTTL", text_len)) { *R = tstrdup ("account.getAccountTTL"); return index; } else { index ++; }}
+ if (index == 4) { if (!strncmp (text, "account.getAuthorizations", text_len)) { *R = tstrdup ("account.getAuthorizations"); return index; } else { index ++; }}
+ if (index == 5) { if (!strncmp (text, "account.getNotifySettings", text_len)) { *R = tstrdup ("account.getNotifySettings"); return index; } else { index ++; }}
+ if (index == 6) { if (!strncmp (text, "account.getPassword", text_len)) { *R = tstrdup ("account.getPassword"); return index; } else { index ++; }}
+ if (index == 7) { if (!strncmp (text, "account.getPasswordSettings", text_len)) { *R = tstrdup ("account.getPasswordSettings"); return index; } else { index ++; }}
+ if (index == 8) { if (!strncmp (text, "account.getPrivacy", text_len)) { *R = tstrdup ("account.getPrivacy"); return index; } else { index ++; }}
+ if (index == 9) { if (!strncmp (text, "account.getWallPapers", text_len)) { *R = tstrdup ("account.getWallPapers"); return index; } else { index ++; }}
+ if (index == 10) { if (!strncmp (text, "account.registerDevice", text_len)) { *R = tstrdup ("account.registerDevice"); return index; } else { index ++; }}
+ if (index == 11) { if (!strncmp (text, "account.resetAuthorization", text_len)) { *R = tstrdup ("account.resetAuthorization"); return index; } else { index ++; }}
+ if (index == 12) { if (!strncmp (text, "account.resetNotifySettings", text_len)) { *R = tstrdup ("account.resetNotifySettings"); return index; } else { index ++; }}
+ if (index == 13) { if (!strncmp (text, "account.sendChangePhoneCode", text_len)) { *R = tstrdup ("account.sendChangePhoneCode"); return index; } else { index ++; }}
+ if (index == 14) { if (!strncmp (text, "account.setAccountTTL", text_len)) { *R = tstrdup ("account.setAccountTTL"); return index; } else { index ++; }}
+ if (index == 15) { if (!strncmp (text, "account.setPrivacy", text_len)) { *R = tstrdup ("account.setPrivacy"); return index; } else { index ++; }}
+ if (index == 16) { if (!strncmp (text, "account.unregisterDevice", text_len)) { *R = tstrdup ("account.unregisterDevice"); return index; } else { index ++; }}
+ if (index == 17) { if (!strncmp (text, "account.updateDeviceLocked", text_len)) { *R = tstrdup ("account.updateDeviceLocked"); return index; } else { index ++; }}
+ if (index == 18) { if (!strncmp (text, "account.updateNotifySettings", text_len)) { *R = tstrdup ("account.updateNotifySettings"); return index; } else { index ++; }}
+ if (index == 19) { if (!strncmp (text, "account.updatePasswordSettings", text_len)) { *R = tstrdup ("account.updatePasswordSettings"); return index; } else { index ++; }}
+ if (index == 20) { if (!strncmp (text, "account.updateProfile", text_len)) { *R = tstrdup ("account.updateProfile"); return index; } else { index ++; }}
+ if (index == 21) { if (!strncmp (text, "account.updateStatus", text_len)) { *R = tstrdup ("account.updateStatus"); return index; } else { index ++; }}
+ if (index == 22) { if (!strncmp (text, "account.updateUsername", text_len)) { *R = tstrdup ("account.updateUsername"); return index; } else { index ++; }}
+ if (index == 23) { if (!strncmp (text, "auth.bindTempAuthKey", text_len)) { *R = tstrdup ("auth.bindTempAuthKey"); return index; } else { index ++; }}
+ if (index == 24) { if (!strncmp (text, "auth.checkPassword", text_len)) { *R = tstrdup ("auth.checkPassword"); return index; } else { index ++; }}
+ if (index == 25) { if (!strncmp (text, "auth.checkPhone", text_len)) { *R = tstrdup ("auth.checkPhone"); return index; } else { index ++; }}
+ if (index == 26) { if (!strncmp (text, "auth.exportAuthorization", text_len)) { *R = tstrdup ("auth.exportAuthorization"); return index; } else { index ++; }}
+ if (index == 27) { if (!strncmp (text, "auth.importAuthorization", text_len)) { *R = tstrdup ("auth.importAuthorization"); return index; } else { index ++; }}
+ if (index == 28) { if (!strncmp (text, "auth.importBotAuthorization", text_len)) { *R = tstrdup ("auth.importBotAuthorization"); return index; } else { index ++; }}
+ if (index == 29) { if (!strncmp (text, "auth.logOut", text_len)) { *R = tstrdup ("auth.logOut"); return index; } else { index ++; }}
+ if (index == 30) { if (!strncmp (text, "auth.recoverPassword", text_len)) { *R = tstrdup ("auth.recoverPassword"); return index; } else { index ++; }}
+ if (index == 31) { if (!strncmp (text, "auth.requestPasswordRecovery", text_len)) { *R = tstrdup ("auth.requestPasswordRecovery"); return index; } else { index ++; }}
+ if (index == 32) { if (!strncmp (text, "auth.resetAuthorizations", text_len)) { *R = tstrdup ("auth.resetAuthorizations"); return index; } else { index ++; }}
+ if (index == 33) { if (!strncmp (text, "auth.sendCall", text_len)) { *R = tstrdup ("auth.sendCall"); return index; } else { index ++; }}
+ if (index == 34) { if (!strncmp (text, "auth.sendCode", text_len)) { *R = tstrdup ("auth.sendCode"); return index; } else { index ++; }}
+ if (index == 35) { if (!strncmp (text, "auth.sendInvites", text_len)) { *R = tstrdup ("auth.sendInvites"); return index; } else { index ++; }}
+ if (index == 36) { if (!strncmp (text, "auth.sendSms", text_len)) { *R = tstrdup ("auth.sendSms"); return index; } else { index ++; }}
+ if (index == 37) { if (!strncmp (text, "auth.signIn", text_len)) { *R = tstrdup ("auth.signIn"); return index; } else { index ++; }}
+ if (index == 38) { if (!strncmp (text, "auth.signUp", text_len)) { *R = tstrdup ("auth.signUp"); return index; } else { index ++; }}
+ if (index == 39) { if (!strncmp (text, "contacts.block", text_len)) { *R = tstrdup ("contacts.block"); return index; } else { index ++; }}
+ if (index == 40) { if (!strncmp (text, "contacts.deleteContact", text_len)) { *R = tstrdup ("contacts.deleteContact"); return index; } else { index ++; }}
+ if (index == 41) { if (!strncmp (text, "contacts.deleteContacts", text_len)) { *R = tstrdup ("contacts.deleteContacts"); return index; } else { index ++; }}
+ if (index == 42) { if (!strncmp (text, "contacts.exportCard", text_len)) { *R = tstrdup ("contacts.exportCard"); return index; } else { index ++; }}
+ if (index == 43) { if (!strncmp (text, "contacts.getBlocked", text_len)) { *R = tstrdup ("contacts.getBlocked"); return index; } else { index ++; }}
+ if (index == 44) { if (!strncmp (text, "contacts.getContacts", text_len)) { *R = tstrdup ("contacts.getContacts"); return index; } else { index ++; }}
+ if (index == 45) { if (!strncmp (text, "contacts.getStatuses", text_len)) { *R = tstrdup ("contacts.getStatuses"); return index; } else { index ++; }}
+ if (index == 46) { if (!strncmp (text, "contacts.getSuggested", text_len)) { *R = tstrdup ("contacts.getSuggested"); return index; } else { index ++; }}
+ if (index == 47) { if (!strncmp (text, "contacts.importCard", text_len)) { *R = tstrdup ("contacts.importCard"); return index; } else { index ++; }}
+ if (index == 48) { if (!strncmp (text, "contacts.importContacts", text_len)) { *R = tstrdup ("contacts.importContacts"); return index; } else { index ++; }}
+ if (index == 49) { if (!strncmp (text, "contacts.resolveUsername", text_len)) { *R = tstrdup ("contacts.resolveUsername"); return index; } else { index ++; }}
+ if (index == 50) { if (!strncmp (text, "contacts.search", text_len)) { *R = tstrdup ("contacts.search"); return index; } else { index ++; }}
+ if (index == 51) { if (!strncmp (text, "contacts.unblock", text_len)) { *R = tstrdup ("contacts.unblock"); return index; } else { index ++; }}
+ if (index == 52) { if (!strncmp (text, "geochats.checkin", text_len)) { *R = tstrdup ("geochats.checkin"); return index; } else { index ++; }}
+ if (index == 53) { if (!strncmp (text, "geochats.createGeoChat", text_len)) { *R = tstrdup ("geochats.createGeoChat"); return index; } else { index ++; }}
+ if (index == 54) { if (!strncmp (text, "geochats.editChatPhoto", text_len)) { *R = tstrdup ("geochats.editChatPhoto"); return index; } else { index ++; }}
+ if (index == 55) { if (!strncmp (text, "geochats.editChatTitle", text_len)) { *R = tstrdup ("geochats.editChatTitle"); return index; } else { index ++; }}
+ if (index == 56) { if (!strncmp (text, "geochats.getFullChat", text_len)) { *R = tstrdup ("geochats.getFullChat"); return index; } else { index ++; }}
+ if (index == 57) { if (!strncmp (text, "geochats.getHistory", text_len)) { *R = tstrdup ("geochats.getHistory"); return index; } else { index ++; }}
+ if (index == 58) { if (!strncmp (text, "geochats.getLocated", text_len)) { *R = tstrdup ("geochats.getLocated"); return index; } else { index ++; }}
+ if (index == 59) { if (!strncmp (text, "geochats.getRecents", text_len)) { *R = tstrdup ("geochats.getRecents"); return index; } else { index ++; }}
+ if (index == 60) { if (!strncmp (text, "geochats.search", text_len)) { *R = tstrdup ("geochats.search"); return index; } else { index ++; }}
+ if (index == 61) { if (!strncmp (text, "geochats.sendMedia", text_len)) { *R = tstrdup ("geochats.sendMedia"); return index; } else { index ++; }}
+ if (index == 62) { if (!strncmp (text, "geochats.sendMessage", text_len)) { *R = tstrdup ("geochats.sendMessage"); return index; } else { index ++; }}
+ if (index == 63) { if (!strncmp (text, "geochats.setTyping", text_len)) { *R = tstrdup ("geochats.setTyping"); return index; } else { index ++; }}
+ if (index == 64) { if (!strncmp (text, "help.getAppUpdate", text_len)) { *R = tstrdup ("help.getAppUpdate"); return index; } else { index ++; }}
+ if (index == 65) { if (!strncmp (text, "help.getConfig", text_len)) { *R = tstrdup ("help.getConfig"); return index; } else { index ++; }}
+ if (index == 66) { if (!strncmp (text, "help.getInviteText", text_len)) { *R = tstrdup ("help.getInviteText"); return index; } else { index ++; }}
+ if (index == 67) { if (!strncmp (text, "help.getNearestDc", text_len)) { *R = tstrdup ("help.getNearestDc"); return index; } else { index ++; }}
+ if (index == 68) { if (!strncmp (text, "help.getSupport", text_len)) { *R = tstrdup ("help.getSupport"); return index; } else { index ++; }}
+ if (index == 69) { if (!strncmp (text, "help.saveAppLog", text_len)) { *R = tstrdup ("help.saveAppLog"); return index; } else { index ++; }}
+ if (index == 70) { if (!strncmp (text, "initConnection", text_len)) { *R = tstrdup ("initConnection"); return index; } else { index ++; }}
+ if (index == 71) { if (!strncmp (text, "invokeAfterMsg", text_len)) { *R = tstrdup ("invokeAfterMsg"); return index; } else { index ++; }}
+ if (index == 72) { if (!strncmp (text, "invokeAfterMsgs", text_len)) { *R = tstrdup ("invokeAfterMsgs"); return index; } else { index ++; }}
+ if (index == 73) { if (!strncmp (text, "invokeWithLayer", text_len)) { *R = tstrdup ("invokeWithLayer"); return index; } else { index ++; }}
+ if (index == 74) { if (!strncmp (text, "invokeWithoutUpdates", text_len)) { *R = tstrdup ("invokeWithoutUpdates"); return index; } else { index ++; }}
+ if (index == 75) { if (!strncmp (text, "messages.acceptEncryption", text_len)) { *R = tstrdup ("messages.acceptEncryption"); return index; } else { index ++; }}
+ if (index == 76) { if (!strncmp (text, "messages.addChatUser", text_len)) { *R = tstrdup ("messages.addChatUser"); return index; } else { index ++; }}
+ if (index == 77) { if (!strncmp (text, "messages.checkChatInvite", text_len)) { *R = tstrdup ("messages.checkChatInvite"); return index; } else { index ++; }}
+ if (index == 78) { if (!strncmp (text, "messages.createChat", text_len)) { *R = tstrdup ("messages.createChat"); return index; } else { index ++; }}
+ if (index == 79) { if (!strncmp (text, "messages.deleteChatUser", text_len)) { *R = tstrdup ("messages.deleteChatUser"); return index; } else { index ++; }}
+ if (index == 80) { if (!strncmp (text, "messages.deleteHistory", text_len)) { *R = tstrdup ("messages.deleteHistory"); return index; } else { index ++; }}
+ if (index == 81) { if (!strncmp (text, "messages.deleteMessages", text_len)) { *R = tstrdup ("messages.deleteMessages"); return index; } else { index ++; }}
+ if (index == 82) { if (!strncmp (text, "messages.discardEncryption", text_len)) { *R = tstrdup ("messages.discardEncryption"); return index; } else { index ++; }}
+ if (index == 83) { if (!strncmp (text, "messages.editChatPhoto", text_len)) { *R = tstrdup ("messages.editChatPhoto"); return index; } else { index ++; }}
+ if (index == 84) { if (!strncmp (text, "messages.editChatTitle", text_len)) { *R = tstrdup ("messages.editChatTitle"); return index; } else { index ++; }}
+ if (index == 85) { if (!strncmp (text, "messages.exportChatInvite", text_len)) { *R = tstrdup ("messages.exportChatInvite"); return index; } else { index ++; }}
+ if (index == 86) { if (!strncmp (text, "messages.forwardMessage", text_len)) { *R = tstrdup ("messages.forwardMessage"); return index; } else { index ++; }}
+ if (index == 87) { if (!strncmp (text, "messages.forwardMessages", text_len)) { *R = tstrdup ("messages.forwardMessages"); return index; } else { index ++; }}
+ if (index == 88) { if (!strncmp (text, "messages.getAllStickers", text_len)) { *R = tstrdup ("messages.getAllStickers"); return index; } else { index ++; }}
+ if (index == 89) { if (!strncmp (text, "messages.getChats", text_len)) { *R = tstrdup ("messages.getChats"); return index; } else { index ++; }}
+ if (index == 90) { if (!strncmp (text, "messages.getDhConfig", text_len)) { *R = tstrdup ("messages.getDhConfig"); return index; } else { index ++; }}
+ if (index == 91) { if (!strncmp (text, "messages.getDialogs", text_len)) { *R = tstrdup ("messages.getDialogs"); return index; } else { index ++; }}
+ if (index == 92) { if (!strncmp (text, "messages.getFullChat", text_len)) { *R = tstrdup ("messages.getFullChat"); return index; } else { index ++; }}
+ if (index == 93) { if (!strncmp (text, "messages.getHistory", text_len)) { *R = tstrdup ("messages.getHistory"); return index; } else { index ++; }}
+ if (index == 94) { if (!strncmp (text, "messages.getMessages", text_len)) { *R = tstrdup ("messages.getMessages"); return index; } else { index ++; }}
+ if (index == 95) { if (!strncmp (text, "messages.getStickerSet", text_len)) { *R = tstrdup ("messages.getStickerSet"); return index; } else { index ++; }}
+ if (index == 96) { if (!strncmp (text, "messages.getStickers", text_len)) { *R = tstrdup ("messages.getStickers"); return index; } else { index ++; }}
+ if (index == 97) { if (!strncmp (text, "messages.getWebPagePreview", text_len)) { *R = tstrdup ("messages.getWebPagePreview"); return index; } else { index ++; }}
+ if (index == 98) { if (!strncmp (text, "messages.importChatInvite", text_len)) { *R = tstrdup ("messages.importChatInvite"); return index; } else { index ++; }}
+ if (index == 99) { if (!strncmp (text, "messages.installStickerSet", text_len)) { *R = tstrdup ("messages.installStickerSet"); return index; } else { index ++; }}
+ if (index == 100) { if (!strncmp (text, "messages.readEncryptedHistory", text_len)) { *R = tstrdup ("messages.readEncryptedHistory"); return index; } else { index ++; }}
+ if (index == 101) { if (!strncmp (text, "messages.readHistory", text_len)) { *R = tstrdup ("messages.readHistory"); return index; } else { index ++; }}
+ if (index == 102) { if (!strncmp (text, "messages.readMessageContents", text_len)) { *R = tstrdup ("messages.readMessageContents"); return index; } else { index ++; }}
+ if (index == 103) { if (!strncmp (text, "messages.receivedMessages", text_len)) { *R = tstrdup ("messages.receivedMessages"); return index; } else { index ++; }}
+ if (index == 104) { if (!strncmp (text, "messages.receivedQueue", text_len)) { *R = tstrdup ("messages.receivedQueue"); return index; } else { index ++; }}
+ if (index == 105) { if (!strncmp (text, "messages.requestEncryption", text_len)) { *R = tstrdup ("messages.requestEncryption"); return index; } else { index ++; }}
+ if (index == 106) { if (!strncmp (text, "messages.search", text_len)) { *R = tstrdup ("messages.search"); return index; } else { index ++; }}
+ if (index == 107) { if (!strncmp (text, "messages.sendBroadcast", text_len)) { *R = tstrdup ("messages.sendBroadcast"); return index; } else { index ++; }}
+ if (index == 108) { if (!strncmp (text, "messages.sendEncrypted", text_len)) { *R = tstrdup ("messages.sendEncrypted"); return index; } else { index ++; }}
+ if (index == 109) { if (!strncmp (text, "messages.sendEncryptedFile", text_len)) { *R = tstrdup ("messages.sendEncryptedFile"); return index; } else { index ++; }}
+ if (index == 110) { if (!strncmp (text, "messages.sendEncryptedService", text_len)) { *R = tstrdup ("messages.sendEncryptedService"); return index; } else { index ++; }}
+ if (index == 111) { if (!strncmp (text, "messages.sendMedia", text_len)) { *R = tstrdup ("messages.sendMedia"); return index; } else { index ++; }}
+ if (index == 112) { if (!strncmp (text, "messages.sendMessage", text_len)) { *R = tstrdup ("messages.sendMessage"); return index; } else { index ++; }}
+ if (index == 113) { if (!strncmp (text, "messages.setEncryptedTyping", text_len)) { *R = tstrdup ("messages.setEncryptedTyping"); return index; } else { index ++; }}
+ if (index == 114) { if (!strncmp (text, "messages.setTyping", text_len)) { *R = tstrdup ("messages.setTyping"); return index; } else { index ++; }}
+ if (index == 115) { if (!strncmp (text, "messages.startBot", text_len)) { *R = tstrdup ("messages.startBot"); return index; } else { index ++; }}
+ if (index == 116) { if (!strncmp (text, "messages.uninstallStickerSet", text_len)) { *R = tstrdup ("messages.uninstallStickerSet"); return index; } else { index ++; }}
+ if (index == 117) { if (!strncmp (text, "photos.deletePhotos", text_len)) { *R = tstrdup ("photos.deletePhotos"); return index; } else { index ++; }}
+ if (index == 118) { if (!strncmp (text, "photos.getUserPhotos", text_len)) { *R = tstrdup ("photos.getUserPhotos"); return index; } else { index ++; }}
+ if (index == 119) { if (!strncmp (text, "photos.updateProfilePhoto", text_len)) { *R = tstrdup ("photos.updateProfilePhoto"); return index; } else { index ++; }}
+ if (index == 120) { if (!strncmp (text, "photos.uploadProfilePhoto", text_len)) { *R = tstrdup ("photos.uploadProfilePhoto"); return index; } else { index ++; }}
+ if (index == 121) { if (!strncmp (text, "req_DH_params", text_len)) { *R = tstrdup ("req_DH_params"); return index; } else { index ++; }}
+ if (index == 122) { if (!strncmp (text, "req_pq", text_len)) { *R = tstrdup ("req_pq"); return index; } else { index ++; }}
+ if (index == 123) { if (!strncmp (text, "set_client_DH_params", text_len)) { *R = tstrdup ("set_client_DH_params"); return index; } else { index ++; }}
+ if (index == 124) { if (!strncmp (text, "updates.getDifference", text_len)) { *R = tstrdup ("updates.getDifference"); return index; } else { index ++; }}
+ if (index == 125) { if (!strncmp (text, "updates.getState", text_len)) { *R = tstrdup ("updates.getState"); return index; } else { index ++; }}
+ if (index == 126) { if (!strncmp (text, "upload.getFile", text_len)) { *R = tstrdup ("upload.getFile"); return index; } else { index ++; }}
+ if (index == 127) { if (!strncmp (text, "upload.saveBigFilePart", text_len)) { *R = tstrdup ("upload.saveBigFilePart"); return index; } else { index ++; }}
+ if (index == 128) { if (!strncmp (text, "upload.saveFilePart", text_len)) { *R = tstrdup ("upload.saveFilePart"); return index; } else { index ++; }}
+ if (index == 129) { if (!strncmp (text, "users.getFullUser", text_len)) { *R = tstrdup ("users.getFullUser"); return index; } else { index ++; }}
+ if (index == 130) { if (!strncmp (text, "users.getUsers", text_len)) { *R = tstrdup ("users.getUsers"); return index; } else { index ++; }}
+ *R = 0;
+ return 0;
+}
+struct paramed_type *autocomplete_function_any (void) {
+ expect_token_ptr_autocomplete ("(", 1);
+ if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_function); }
+ if (cur_token_len < 0) { return 0; }
+ if (cur_token_len == 19 && !memcmp (cur_token, "account.changePhone", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_account_change_phone ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "account.checkUsername", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_account_check_username ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "account.deleteAccount", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_account_delete_account ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "account.getAccountTTL", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_account_get_account_t_t_l ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "account.getAuthorizations", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_account_get_authorizations ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "account.getNotifySettings", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_account_get_notify_settings ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "account.getPassword", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_account_get_password ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "account.getPasswordSettings", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_account_get_password_settings ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "account.getPrivacy", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_account_get_privacy ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "account.getWallPapers", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_account_get_wall_papers ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "account.registerDevice", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_account_register_device ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "account.resetAuthorization", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_account_reset_authorization ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "account.resetNotifySettings", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_account_reset_notify_settings ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "account.sendChangePhoneCode", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_account_send_change_phone_code ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "account.setAccountTTL", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_account_set_account_t_t_l ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "account.setPrivacy", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_account_set_privacy ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "account.unregisterDevice", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_account_unregister_device ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "account.updateDeviceLocked", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_account_update_device_locked ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "account.updateNotifySettings", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_account_update_notify_settings ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 30 && !memcmp (cur_token, "account.updatePasswordSettings", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_account_update_password_settings ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "account.updateProfile", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_account_update_profile ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "account.updateStatus", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_account_update_status ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "account.updateUsername", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_account_update_username ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "auth.bindTempAuthKey", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_auth_bind_temp_auth_key ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "auth.checkPassword", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_auth_check_password ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "auth.checkPhone", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_auth_check_phone ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "auth.exportAuthorization", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_auth_export_authorization ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "auth.importAuthorization", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_auth_import_authorization ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "auth.importBotAuthorization", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_auth_import_bot_authorization ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 11 && !memcmp (cur_token, "auth.logOut", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_auth_log_out ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "auth.recoverPassword", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_auth_recover_password ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "auth.requestPasswordRecovery", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_auth_request_password_recovery ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "auth.resetAuthorizations", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_auth_reset_authorizations ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "auth.sendCall", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_auth_send_call ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "auth.sendCode", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_auth_send_code ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "auth.sendInvites", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_auth_send_invites ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 12 && !memcmp (cur_token, "auth.sendSms", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_auth_send_sms ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 11 && !memcmp (cur_token, "auth.signIn", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_auth_sign_in ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 11 && !memcmp (cur_token, "auth.signUp", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_auth_sign_up ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "contacts.block", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_contacts_block ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "contacts.deleteContact", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_contacts_delete_contact ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "contacts.deleteContacts", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_contacts_delete_contacts ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "contacts.exportCard", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_contacts_export_card ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "contacts.getBlocked", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_contacts_get_blocked ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "contacts.getContacts", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_contacts_get_contacts ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "contacts.getStatuses", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_contacts_get_statuses ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "contacts.getSuggested", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_contacts_get_suggested ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "contacts.importCard", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_contacts_import_card ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "contacts.importContacts", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_contacts_import_contacts ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "contacts.resolveUsername", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_contacts_resolve_username ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "contacts.search", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_contacts_search ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "contacts.unblock", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_contacts_unblock ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "geochats.checkin", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_geochats_checkin ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "geochats.createGeoChat", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_geochats_create_geo_chat ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "geochats.editChatPhoto", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_geochats_edit_chat_photo ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "geochats.editChatTitle", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_geochats_edit_chat_title ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "geochats.getFullChat", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_geochats_get_full_chat ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "geochats.getHistory", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_geochats_get_history ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "geochats.getLocated", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_geochats_get_located ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "geochats.getRecents", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_geochats_get_recents ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "geochats.search", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_geochats_search ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "geochats.sendMedia", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_geochats_send_media ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "geochats.sendMessage", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_geochats_send_message ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "geochats.setTyping", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_geochats_set_typing ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "help.getAppUpdate", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_help_get_app_update ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "help.getConfig", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_help_get_config ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "help.getInviteText", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_help_get_invite_text ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "help.getNearestDc", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_help_get_nearest_dc ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "help.getSupport", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_help_get_support ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "help.saveAppLog", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_help_save_app_log ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "initConnection", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_init_connection ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "invokeAfterMsg", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_invoke_after_msg ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "invokeAfterMsgs", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_invoke_after_msgs ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "invokeWithLayer", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_invoke_with_layer ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "invokeWithoutUpdates", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_invoke_without_updates ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "messages.acceptEncryption", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_accept_encryption ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messages.addChatUser", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_add_chat_user ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "messages.checkChatInvite", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_check_chat_invite ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "messages.createChat", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_create_chat ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "messages.deleteChatUser", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_delete_chat_user ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "messages.deleteHistory", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_delete_history ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "messages.deleteMessages", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_delete_messages ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "messages.discardEncryption", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_discard_encryption ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "messages.editChatPhoto", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_edit_chat_photo ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "messages.editChatTitle", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_edit_chat_title ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "messages.exportChatInvite", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_export_chat_invite ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "messages.forwardMessage", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_forward_message ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "messages.forwardMessages", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_forward_messages ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "messages.getAllStickers", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_get_all_stickers ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messages.getChats", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_get_chats ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messages.getDhConfig", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_get_dh_config ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "messages.getDialogs", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_get_dialogs ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messages.getFullChat", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_get_full_chat ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "messages.getHistory", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_get_history ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messages.getMessages", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_get_messages ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "messages.getStickerSet", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_get_sticker_set ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messages.getStickers", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_get_stickers ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "messages.getWebPagePreview", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_get_web_page_preview ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "messages.importChatInvite", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_import_chat_invite ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "messages.installStickerSet", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_install_sticker_set ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "messages.readEncryptedHistory", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_read_encrypted_history ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messages.readHistory", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_read_history ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "messages.readMessageContents", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_read_message_contents ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "messages.receivedMessages", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_received_messages ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "messages.receivedQueue", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_received_queue ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "messages.requestEncryption", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_request_encryption ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "messages.search", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_search ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "messages.sendBroadcast", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_send_broadcast ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "messages.sendEncrypted", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_send_encrypted ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "messages.sendEncryptedFile", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_send_encrypted_file ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "messages.sendEncryptedService", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_send_encrypted_service ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "messages.sendMedia", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_send_media ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messages.sendMessage", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_send_message ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "messages.setEncryptedTyping", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_set_encrypted_typing ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "messages.setTyping", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_set_typing ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messages.startBot", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_start_bot ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "messages.uninstallStickerSet", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_messages_uninstall_sticker_set ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "photos.deletePhotos", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_photos_delete_photos ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "photos.getUserPhotos", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_photos_get_user_photos ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "photos.updateProfilePhoto", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_photos_update_profile_photo ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "photos.uploadProfilePhoto", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_photos_upload_profile_photo ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "req_DH_params", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_req_d_h_params ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 6 && !memcmp (cur_token, "req_pq", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_req_pq ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "set_client_DH_params", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_set_client_d_h_params ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "updates.getDifference", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_updates_get_difference ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "updates.getState", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_updates_get_state ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "upload.getFile", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_upload_get_file ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "upload.saveBigFilePart", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_upload_save_big_file_part ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "upload.saveFilePart", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_upload_save_file_part ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "users.getFullUser", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_users_get_full_user ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "users.getUsers", cur_token_len)) {
+ local_next_token ();
+ struct paramed_type *P = autocomplete_function_users_get_users ();
+ if (!P) { return 0; }
+ expect_token_ptr_autocomplete (")", 1);
+ return P;
+ }
+ return 0;
+}
diff --git a/protocols/Telegram/tgl/auto/auto-autocomplete.h b/protocols/Telegram/tgl/auto/auto-autocomplete.h
new file mode 100644
index 0000000000..1e58313e55
--- /dev/null
+++ b/protocols/Telegram/tgl/auto/auto-autocomplete.h
@@ -0,0 +1,865 @@
+#ifdef _MSC_VER
+#include "..\auto.h"
+#else
+#include "auto.h"
+#endif
+#include <assert.h>
+int tglf_extf_autocomplete (struct tgl_state *TLS, const char *text, int text_len, int index, char **R, char *data, int data_len);
+int autocomplete_constructor_account_days_t_t_l (struct paramed_type *T);
+int autocomplete_constructor_audio_empty (struct paramed_type *T);
+int autocomplete_constructor_audio (struct paramed_type *T);
+int autocomplete_constructor_authorization (struct paramed_type *T);
+int autocomplete_constructor_bool_false (struct paramed_type *T);
+int autocomplete_constructor_bool_true (struct paramed_type *T);
+int autocomplete_constructor_bot_command (struct paramed_type *T);
+int autocomplete_constructor_bot_command_old (struct paramed_type *T);
+int autocomplete_constructor_bot_info_empty (struct paramed_type *T);
+int autocomplete_constructor_bot_info (struct paramed_type *T);
+int autocomplete_constructor_bytes (struct paramed_type *T);
+int autocomplete_constructor_chat_empty (struct paramed_type *T);
+int autocomplete_constructor_chat (struct paramed_type *T);
+int autocomplete_constructor_chat_forbidden (struct paramed_type *T);
+int autocomplete_constructor_geo_chat (struct paramed_type *T);
+int autocomplete_constructor_chat_full (struct paramed_type *T);
+int autocomplete_constructor_chat_invite_already (struct paramed_type *T);
+int autocomplete_constructor_chat_invite (struct paramed_type *T);
+int autocomplete_constructor_chat_located (struct paramed_type *T);
+int autocomplete_constructor_chat_participant (struct paramed_type *T);
+int autocomplete_constructor_chat_participants_forbidden (struct paramed_type *T);
+int autocomplete_constructor_chat_participants (struct paramed_type *T);
+int autocomplete_constructor_chat_photo_empty (struct paramed_type *T);
+int autocomplete_constructor_chat_photo (struct paramed_type *T);
+int autocomplete_constructor_client_d_h_inner_data (struct paramed_type *T);
+int autocomplete_constructor_config (struct paramed_type *T);
+int autocomplete_constructor_contact (struct paramed_type *T);
+int autocomplete_constructor_contact_blocked (struct paramed_type *T);
+int autocomplete_constructor_contact_found (struct paramed_type *T);
+int autocomplete_constructor_contact_link_unknown (struct paramed_type *T);
+int autocomplete_constructor_contact_link_none (struct paramed_type *T);
+int autocomplete_constructor_contact_link_has_phone (struct paramed_type *T);
+int autocomplete_constructor_contact_link_contact (struct paramed_type *T);
+int autocomplete_constructor_contact_status (struct paramed_type *T);
+int autocomplete_constructor_contact_suggested (struct paramed_type *T);
+int autocomplete_constructor_dc_option_l28 (struct paramed_type *T);
+int autocomplete_constructor_dc_option (struct paramed_type *T);
+int autocomplete_constructor_decrypted_message (struct paramed_type *T);
+int autocomplete_constructor_decrypted_message_service (struct paramed_type *T);
+int autocomplete_constructor_decrypted_message_action_set_message_t_t_l (struct paramed_type *T);
+int autocomplete_constructor_decrypted_message_action_read_messages (struct paramed_type *T);
+int autocomplete_constructor_decrypted_message_action_delete_messages (struct paramed_type *T);
+int autocomplete_constructor_decrypted_message_action_screenshot_messages (struct paramed_type *T);
+int autocomplete_constructor_decrypted_message_action_flush_history (struct paramed_type *T);
+int autocomplete_constructor_decrypted_message_action_resend (struct paramed_type *T);
+int autocomplete_constructor_decrypted_message_action_notify_layer (struct paramed_type *T);
+int autocomplete_constructor_decrypted_message_action_typing (struct paramed_type *T);
+int autocomplete_constructor_decrypted_message_action_request_key (struct paramed_type *T);
+int autocomplete_constructor_decrypted_message_action_accept_key (struct paramed_type *T);
+int autocomplete_constructor_decrypted_message_action_abort_key (struct paramed_type *T);
+int autocomplete_constructor_decrypted_message_action_commit_key (struct paramed_type *T);
+int autocomplete_constructor_decrypted_message_action_noop (struct paramed_type *T);
+int autocomplete_constructor_decrypted_message_layer (struct paramed_type *T);
+int autocomplete_constructor_decrypted_message_media_empty (struct paramed_type *T);
+int autocomplete_constructor_decrypted_message_media_photo (struct paramed_type *T);
+int autocomplete_constructor_decrypted_message_media_geo_point (struct paramed_type *T);
+int autocomplete_constructor_decrypted_message_media_contact (struct paramed_type *T);
+int autocomplete_constructor_decrypted_message_media_document (struct paramed_type *T);
+int autocomplete_constructor_decrypted_message_media_video (struct paramed_type *T);
+int autocomplete_constructor_decrypted_message_media_audio (struct paramed_type *T);
+int autocomplete_constructor_decrypted_message_media_external_document (struct paramed_type *T);
+int autocomplete_constructor_decrypted_message_media_video_l12 (struct paramed_type *T);
+int autocomplete_constructor_decrypted_message_media_audio_l12 (struct paramed_type *T);
+int autocomplete_constructor_dialog (struct paramed_type *T);
+int autocomplete_constructor_disabled_feature (struct paramed_type *T);
+int autocomplete_constructor_document_empty (struct paramed_type *T);
+int autocomplete_constructor_document (struct paramed_type *T);
+int autocomplete_constructor_document_l19 (struct paramed_type *T);
+int autocomplete_constructor_document_attribute_image_size (struct paramed_type *T);
+int autocomplete_constructor_document_attribute_animated (struct paramed_type *T);
+int autocomplete_constructor_document_attribute_sticker_l28 (struct paramed_type *T);
+int autocomplete_constructor_document_attribute_sticker (struct paramed_type *T);
+int autocomplete_constructor_document_attribute_video (struct paramed_type *T);
+int autocomplete_constructor_document_attribute_audio (struct paramed_type *T);
+int autocomplete_constructor_document_attribute_filename (struct paramed_type *T);
+int autocomplete_constructor_double (struct paramed_type *T);
+int autocomplete_constructor_encrypted_chat_empty (struct paramed_type *T);
+int autocomplete_constructor_encrypted_chat_waiting (struct paramed_type *T);
+int autocomplete_constructor_encrypted_chat_requested (struct paramed_type *T);
+int autocomplete_constructor_encrypted_chat (struct paramed_type *T);
+int autocomplete_constructor_encrypted_chat_discarded (struct paramed_type *T);
+int autocomplete_constructor_encrypted_file_empty (struct paramed_type *T);
+int autocomplete_constructor_encrypted_file (struct paramed_type *T);
+int autocomplete_constructor_encrypted_message (struct paramed_type *T);
+int autocomplete_constructor_encrypted_message_service (struct paramed_type *T);
+int autocomplete_constructor_error (struct paramed_type *T);
+int autocomplete_constructor_chat_invite_empty (struct paramed_type *T);
+int autocomplete_constructor_chat_invite_exported (struct paramed_type *T);
+int autocomplete_constructor_file_location_unavailable (struct paramed_type *T);
+int autocomplete_constructor_file_location (struct paramed_type *T);
+int autocomplete_constructor_geo_chat_message_empty (struct paramed_type *T);
+int autocomplete_constructor_geo_chat_message (struct paramed_type *T);
+int autocomplete_constructor_geo_chat_message_service (struct paramed_type *T);
+int autocomplete_constructor_geo_point_empty (struct paramed_type *T);
+int autocomplete_constructor_geo_point (struct paramed_type *T);
+int autocomplete_constructor_imported_contact (struct paramed_type *T);
+int autocomplete_constructor_input_app_event (struct paramed_type *T);
+int autocomplete_constructor_input_audio_empty (struct paramed_type *T);
+int autocomplete_constructor_input_audio (struct paramed_type *T);
+int autocomplete_constructor_input_chat_photo_empty (struct paramed_type *T);
+int autocomplete_constructor_input_chat_uploaded_photo (struct paramed_type *T);
+int autocomplete_constructor_input_chat_photo (struct paramed_type *T);
+int autocomplete_constructor_input_phone_contact (struct paramed_type *T);
+int autocomplete_constructor_input_document_empty (struct paramed_type *T);
+int autocomplete_constructor_input_document (struct paramed_type *T);
+int autocomplete_constructor_input_encrypted_chat (struct paramed_type *T);
+int autocomplete_constructor_input_encrypted_file_empty (struct paramed_type *T);
+int autocomplete_constructor_input_encrypted_file_uploaded (struct paramed_type *T);
+int autocomplete_constructor_input_encrypted_file (struct paramed_type *T);
+int autocomplete_constructor_input_encrypted_file_big_uploaded (struct paramed_type *T);
+int autocomplete_constructor_input_file (struct paramed_type *T);
+int autocomplete_constructor_input_file_big (struct paramed_type *T);
+int autocomplete_constructor_input_file_location (struct paramed_type *T);
+int autocomplete_constructor_input_video_file_location (struct paramed_type *T);
+int autocomplete_constructor_input_encrypted_file_location (struct paramed_type *T);
+int autocomplete_constructor_input_audio_file_location (struct paramed_type *T);
+int autocomplete_constructor_input_document_file_location (struct paramed_type *T);
+int autocomplete_constructor_input_geo_chat (struct paramed_type *T);
+int autocomplete_constructor_input_geo_point_empty (struct paramed_type *T);
+int autocomplete_constructor_input_geo_point (struct paramed_type *T);
+int autocomplete_constructor_input_media_empty (struct paramed_type *T);
+int autocomplete_constructor_input_media_uploaded_photo (struct paramed_type *T);
+int autocomplete_constructor_input_media_photo (struct paramed_type *T);
+int autocomplete_constructor_input_media_geo_point (struct paramed_type *T);
+int autocomplete_constructor_input_media_contact (struct paramed_type *T);
+int autocomplete_constructor_input_media_uploaded_video (struct paramed_type *T);
+int autocomplete_constructor_input_media_uploaded_thumb_video (struct paramed_type *T);
+int autocomplete_constructor_input_media_video (struct paramed_type *T);
+int autocomplete_constructor_input_media_uploaded_audio (struct paramed_type *T);
+int autocomplete_constructor_input_media_audio (struct paramed_type *T);
+int autocomplete_constructor_input_media_uploaded_document (struct paramed_type *T);
+int autocomplete_constructor_input_media_uploaded_thumb_document (struct paramed_type *T);
+int autocomplete_constructor_input_media_document (struct paramed_type *T);
+int autocomplete_constructor_input_media_venue (struct paramed_type *T);
+int autocomplete_constructor_input_notify_peer (struct paramed_type *T);
+int autocomplete_constructor_input_notify_users (struct paramed_type *T);
+int autocomplete_constructor_input_notify_chats (struct paramed_type *T);
+int autocomplete_constructor_input_notify_all (struct paramed_type *T);
+int autocomplete_constructor_input_notify_geo_chat_peer (struct paramed_type *T);
+int autocomplete_constructor_input_peer_empty (struct paramed_type *T);
+int autocomplete_constructor_input_peer_self (struct paramed_type *T);
+int autocomplete_constructor_input_peer_contact (struct paramed_type *T);
+int autocomplete_constructor_input_peer_foreign (struct paramed_type *T);
+int autocomplete_constructor_input_peer_chat (struct paramed_type *T);
+int autocomplete_constructor_input_peer_notify_events_empty (struct paramed_type *T);
+int autocomplete_constructor_input_peer_notify_events_all (struct paramed_type *T);
+int autocomplete_constructor_input_peer_notify_settings (struct paramed_type *T);
+int autocomplete_constructor_input_photo_empty (struct paramed_type *T);
+int autocomplete_constructor_input_photo (struct paramed_type *T);
+int autocomplete_constructor_input_photo_crop_auto (struct paramed_type *T);
+int autocomplete_constructor_input_photo_crop (struct paramed_type *T);
+int autocomplete_constructor_input_privacy_key_status_timestamp (struct paramed_type *T);
+int autocomplete_constructor_input_privacy_value_allow_contacts (struct paramed_type *T);
+int autocomplete_constructor_input_privacy_value_allow_all (struct paramed_type *T);
+int autocomplete_constructor_input_privacy_value_allow_users (struct paramed_type *T);
+int autocomplete_constructor_input_privacy_value_disallow_contacts (struct paramed_type *T);
+int autocomplete_constructor_input_privacy_value_disallow_all (struct paramed_type *T);
+int autocomplete_constructor_input_privacy_value_disallow_users (struct paramed_type *T);
+int autocomplete_constructor_input_sticker_set_empty (struct paramed_type *T);
+int autocomplete_constructor_input_sticker_set_i_d (struct paramed_type *T);
+int autocomplete_constructor_input_sticker_set_short_name (struct paramed_type *T);
+int autocomplete_constructor_input_user_empty (struct paramed_type *T);
+int autocomplete_constructor_input_user_self (struct paramed_type *T);
+int autocomplete_constructor_input_user_contact (struct paramed_type *T);
+int autocomplete_constructor_input_user_foreign (struct paramed_type *T);
+int autocomplete_constructor_input_video_empty (struct paramed_type *T);
+int autocomplete_constructor_input_video (struct paramed_type *T);
+int autocomplete_constructor_int (struct paramed_type *T);
+int autocomplete_constructor_int128 (struct paramed_type *T);
+int autocomplete_constructor_int256 (struct paramed_type *T);
+int autocomplete_constructor_keyboard_button (struct paramed_type *T);
+int autocomplete_constructor_keyboard_button_row (struct paramed_type *T);
+int autocomplete_constructor_long (struct paramed_type *T);
+int autocomplete_constructor_message_empty (struct paramed_type *T);
+int autocomplete_constructor_message (struct paramed_type *T);
+int autocomplete_constructor_message_service (struct paramed_type *T);
+int autocomplete_constructor_message_action_empty (struct paramed_type *T);
+int autocomplete_constructor_message_action_chat_create (struct paramed_type *T);
+int autocomplete_constructor_message_action_chat_edit_title (struct paramed_type *T);
+int autocomplete_constructor_message_action_chat_edit_photo (struct paramed_type *T);
+int autocomplete_constructor_message_action_chat_delete_photo (struct paramed_type *T);
+int autocomplete_constructor_message_action_chat_add_user (struct paramed_type *T);
+int autocomplete_constructor_message_action_chat_delete_user (struct paramed_type *T);
+int autocomplete_constructor_message_action_geo_chat_create (struct paramed_type *T);
+int autocomplete_constructor_message_action_geo_chat_checkin (struct paramed_type *T);
+int autocomplete_constructor_message_action_chat_joined_by_link (struct paramed_type *T);
+int autocomplete_constructor_message_media_empty (struct paramed_type *T);
+int autocomplete_constructor_message_media_photo (struct paramed_type *T);
+int autocomplete_constructor_message_media_video (struct paramed_type *T);
+int autocomplete_constructor_message_media_geo (struct paramed_type *T);
+int autocomplete_constructor_message_media_contact (struct paramed_type *T);
+int autocomplete_constructor_message_media_unsupported (struct paramed_type *T);
+int autocomplete_constructor_message_media_document (struct paramed_type *T);
+int autocomplete_constructor_message_media_audio (struct paramed_type *T);
+int autocomplete_constructor_message_media_web_page (struct paramed_type *T);
+int autocomplete_constructor_message_media_venue (struct paramed_type *T);
+int autocomplete_constructor_message_media_photo_l27 (struct paramed_type *T);
+int autocomplete_constructor_message_media_video_l27 (struct paramed_type *T);
+int autocomplete_constructor_input_messages_filter_empty (struct paramed_type *T);
+int autocomplete_constructor_input_messages_filter_photos (struct paramed_type *T);
+int autocomplete_constructor_input_messages_filter_video (struct paramed_type *T);
+int autocomplete_constructor_input_messages_filter_photo_video (struct paramed_type *T);
+int autocomplete_constructor_input_messages_filter_photo_video_documents (struct paramed_type *T);
+int autocomplete_constructor_input_messages_filter_document (struct paramed_type *T);
+int autocomplete_constructor_input_messages_filter_audio (struct paramed_type *T);
+int autocomplete_constructor_nearest_dc (struct paramed_type *T);
+int autocomplete_constructor_notify_peer (struct paramed_type *T);
+int autocomplete_constructor_notify_users (struct paramed_type *T);
+int autocomplete_constructor_notify_chats (struct paramed_type *T);
+int autocomplete_constructor_notify_all (struct paramed_type *T);
+int autocomplete_constructor_null (struct paramed_type *T);
+int autocomplete_constructor_p_q_inner_data (struct paramed_type *T);
+int autocomplete_constructor_p_q_inner_data_temp (struct paramed_type *T);
+int autocomplete_constructor_peer_user (struct paramed_type *T);
+int autocomplete_constructor_peer_chat (struct paramed_type *T);
+int autocomplete_constructor_peer_notify_events_empty (struct paramed_type *T);
+int autocomplete_constructor_peer_notify_events_all (struct paramed_type *T);
+int autocomplete_constructor_peer_notify_settings_empty (struct paramed_type *T);
+int autocomplete_constructor_peer_notify_settings (struct paramed_type *T);
+int autocomplete_constructor_photo_empty (struct paramed_type *T);
+int autocomplete_constructor_photo (struct paramed_type *T);
+int autocomplete_constructor_photo_l27 (struct paramed_type *T);
+int autocomplete_constructor_photo_size_empty (struct paramed_type *T);
+int autocomplete_constructor_photo_size (struct paramed_type *T);
+int autocomplete_constructor_photo_cached_size (struct paramed_type *T);
+int autocomplete_constructor_privacy_key_status_timestamp (struct paramed_type *T);
+int autocomplete_constructor_privacy_value_allow_contacts (struct paramed_type *T);
+int autocomplete_constructor_privacy_value_allow_all (struct paramed_type *T);
+int autocomplete_constructor_privacy_value_allow_users (struct paramed_type *T);
+int autocomplete_constructor_privacy_value_disallow_contacts (struct paramed_type *T);
+int autocomplete_constructor_privacy_value_disallow_all (struct paramed_type *T);
+int autocomplete_constructor_privacy_value_disallow_users (struct paramed_type *T);
+int autocomplete_constructor_received_notify_message (struct paramed_type *T);
+int autocomplete_constructor_reply_keyboard_hide (struct paramed_type *T);
+int autocomplete_constructor_reply_keyboard_force_reply (struct paramed_type *T);
+int autocomplete_constructor_reply_keyboard_markup (struct paramed_type *T);
+int autocomplete_constructor_res_p_q (struct paramed_type *T);
+int autocomplete_constructor_send_message_typing_action (struct paramed_type *T);
+int autocomplete_constructor_send_message_cancel_action (struct paramed_type *T);
+int autocomplete_constructor_send_message_record_video_action (struct paramed_type *T);
+int autocomplete_constructor_send_message_upload_video_action_l27 (struct paramed_type *T);
+int autocomplete_constructor_send_message_upload_video_action (struct paramed_type *T);
+int autocomplete_constructor_send_message_record_audio_action (struct paramed_type *T);
+int autocomplete_constructor_send_message_upload_audio_action_l27 (struct paramed_type *T);
+int autocomplete_constructor_send_message_upload_audio_action (struct paramed_type *T);
+int autocomplete_constructor_send_message_upload_photo_action (struct paramed_type *T);
+int autocomplete_constructor_send_message_upload_document_action_l27 (struct paramed_type *T);
+int autocomplete_constructor_send_message_upload_document_action (struct paramed_type *T);
+int autocomplete_constructor_send_message_geo_location_action (struct paramed_type *T);
+int autocomplete_constructor_send_message_choose_contact_action (struct paramed_type *T);
+int autocomplete_constructor_server_d_h_params_fail (struct paramed_type *T);
+int autocomplete_constructor_server_d_h_params_ok (struct paramed_type *T);
+int autocomplete_constructor_server_d_h_inner_data (struct paramed_type *T);
+int autocomplete_constructor_dh_gen_ok (struct paramed_type *T);
+int autocomplete_constructor_dh_gen_retry (struct paramed_type *T);
+int autocomplete_constructor_dh_gen_fail (struct paramed_type *T);
+int autocomplete_constructor_sticker_pack (struct paramed_type *T);
+int autocomplete_constructor_sticker_set (struct paramed_type *T);
+int autocomplete_constructor_string (struct paramed_type *T);
+int autocomplete_constructor_update_new_message (struct paramed_type *T);
+int autocomplete_constructor_update_message_i_d (struct paramed_type *T);
+int autocomplete_constructor_update_delete_messages (struct paramed_type *T);
+int autocomplete_constructor_update_user_typing (struct paramed_type *T);
+int autocomplete_constructor_update_chat_user_typing (struct paramed_type *T);
+int autocomplete_constructor_update_chat_participants (struct paramed_type *T);
+int autocomplete_constructor_update_user_status (struct paramed_type *T);
+int autocomplete_constructor_update_user_name (struct paramed_type *T);
+int autocomplete_constructor_update_user_photo (struct paramed_type *T);
+int autocomplete_constructor_update_contact_registered (struct paramed_type *T);
+int autocomplete_constructor_update_contact_link (struct paramed_type *T);
+int autocomplete_constructor_update_new_authorization (struct paramed_type *T);
+int autocomplete_constructor_update_new_geo_chat_message (struct paramed_type *T);
+int autocomplete_constructor_update_new_encrypted_message (struct paramed_type *T);
+int autocomplete_constructor_update_encrypted_chat_typing (struct paramed_type *T);
+int autocomplete_constructor_update_encryption (struct paramed_type *T);
+int autocomplete_constructor_update_encrypted_messages_read (struct paramed_type *T);
+int autocomplete_constructor_update_chat_participant_add (struct paramed_type *T);
+int autocomplete_constructor_update_chat_participant_delete (struct paramed_type *T);
+int autocomplete_constructor_update_dc_options (struct paramed_type *T);
+int autocomplete_constructor_update_user_blocked (struct paramed_type *T);
+int autocomplete_constructor_update_notify_settings (struct paramed_type *T);
+int autocomplete_constructor_update_service_notification (struct paramed_type *T);
+int autocomplete_constructor_update_privacy (struct paramed_type *T);
+int autocomplete_constructor_update_user_phone (struct paramed_type *T);
+int autocomplete_constructor_update_read_history_inbox (struct paramed_type *T);
+int autocomplete_constructor_update_read_history_outbox (struct paramed_type *T);
+int autocomplete_constructor_update_web_page (struct paramed_type *T);
+int autocomplete_constructor_update_read_messages_contents (struct paramed_type *T);
+int autocomplete_constructor_update_msg_update (struct paramed_type *T);
+int autocomplete_constructor_updates_too_long (struct paramed_type *T);
+int autocomplete_constructor_update_short_message (struct paramed_type *T);
+int autocomplete_constructor_update_short_chat_message (struct paramed_type *T);
+int autocomplete_constructor_update_short (struct paramed_type *T);
+int autocomplete_constructor_updates_combined (struct paramed_type *T);
+int autocomplete_constructor_updates (struct paramed_type *T);
+int autocomplete_constructor_user_empty (struct paramed_type *T);
+int autocomplete_constructor_user (struct paramed_type *T);
+int autocomplete_constructor_user_full (struct paramed_type *T);
+int autocomplete_constructor_user_profile_photo_empty (struct paramed_type *T);
+int autocomplete_constructor_user_profile_photo (struct paramed_type *T);
+int autocomplete_constructor_user_status_empty (struct paramed_type *T);
+int autocomplete_constructor_user_status_online (struct paramed_type *T);
+int autocomplete_constructor_user_status_offline (struct paramed_type *T);
+int autocomplete_constructor_user_status_recently (struct paramed_type *T);
+int autocomplete_constructor_user_status_last_week (struct paramed_type *T);
+int autocomplete_constructor_user_status_last_month (struct paramed_type *T);
+int autocomplete_constructor_vector (struct paramed_type *T);
+int autocomplete_constructor_video_empty (struct paramed_type *T);
+int autocomplete_constructor_video (struct paramed_type *T);
+int autocomplete_constructor_video_l27 (struct paramed_type *T);
+int autocomplete_constructor_wall_paper (struct paramed_type *T);
+int autocomplete_constructor_wall_paper_solid (struct paramed_type *T);
+int autocomplete_constructor_web_page_empty (struct paramed_type *T);
+int autocomplete_constructor_web_page_pending (struct paramed_type *T);
+int autocomplete_constructor_web_page (struct paramed_type *T);
+int autocomplete_constructor_account_authorizations (struct paramed_type *T);
+int autocomplete_constructor_account_no_password (struct paramed_type *T);
+int autocomplete_constructor_account_password (struct paramed_type *T);
+int autocomplete_constructor_account_password_input_settings (struct paramed_type *T);
+int autocomplete_constructor_account_password_settings (struct paramed_type *T);
+int autocomplete_constructor_account_privacy_rules (struct paramed_type *T);
+int autocomplete_constructor_account_sent_change_phone_code (struct paramed_type *T);
+int autocomplete_constructor_auth_authorization (struct paramed_type *T);
+int autocomplete_constructor_auth_checked_phone (struct paramed_type *T);
+int autocomplete_constructor_auth_exported_authorization (struct paramed_type *T);
+int autocomplete_constructor_auth_password_recovery (struct paramed_type *T);
+int autocomplete_constructor_auth_sent_code (struct paramed_type *T);
+int autocomplete_constructor_auth_sent_app_code (struct paramed_type *T);
+int autocomplete_constructor_binlog_encr_key (struct paramed_type *T);
+int autocomplete_constructor_binlog_start (struct paramed_type *T);
+int autocomplete_constructor_binlog_dc_option (struct paramed_type *T);
+int autocomplete_constructor_binlog_dc_option_new (struct paramed_type *T);
+int autocomplete_constructor_binlog_auth_key (struct paramed_type *T);
+int autocomplete_constructor_binlog_default_dc (struct paramed_type *T);
+int autocomplete_constructor_binlog_dc_signed (struct paramed_type *T);
+int autocomplete_constructor_binlog_our_id (struct paramed_type *T);
+int autocomplete_constructor_binlog_set_dh_params (struct paramed_type *T);
+int autocomplete_constructor_binlog_set_pts (struct paramed_type *T);
+int autocomplete_constructor_binlog_set_qts (struct paramed_type *T);
+int autocomplete_constructor_binlog_set_date (struct paramed_type *T);
+int autocomplete_constructor_binlog_set_seq (struct paramed_type *T);
+int autocomplete_constructor_binlog_encr_chat_delete (struct paramed_type *T);
+int autocomplete_constructor_binlog_encr_chat_new (struct paramed_type *T);
+int autocomplete_constructor_binlog_encr_chat_exchange_new (struct paramed_type *T);
+int autocomplete_constructor_binlog_user_delete (struct paramed_type *T);
+int autocomplete_constructor_binlog_user_new (struct paramed_type *T);
+int autocomplete_constructor_binlog_chat_new (struct paramed_type *T);
+int autocomplete_constructor_binlog_chat_add_participant (struct paramed_type *T);
+int autocomplete_constructor_binlog_chat_del_participant (struct paramed_type *T);
+int autocomplete_constructor_binlog_set_msg_id (struct paramed_type *T);
+int autocomplete_constructor_binlog_message_delete (struct paramed_type *T);
+int autocomplete_constructor_binlog_message_new (struct paramed_type *T);
+int autocomplete_constructor_binlog_message_encr_new (struct paramed_type *T);
+int autocomplete_constructor_binlog_msg_update (struct paramed_type *T);
+int autocomplete_constructor_binlog_reset_authorization (struct paramed_type *T);
+int autocomplete_constructor_contacts_blocked (struct paramed_type *T);
+int autocomplete_constructor_contacts_blocked_slice (struct paramed_type *T);
+int autocomplete_constructor_contacts_contacts_not_modified (struct paramed_type *T);
+int autocomplete_constructor_contacts_contacts (struct paramed_type *T);
+int autocomplete_constructor_contacts_found (struct paramed_type *T);
+int autocomplete_constructor_contacts_imported_contacts (struct paramed_type *T);
+int autocomplete_constructor_contacts_link (struct paramed_type *T);
+int autocomplete_constructor_contacts_suggested (struct paramed_type *T);
+int autocomplete_constructor_geochats_located (struct paramed_type *T);
+int autocomplete_constructor_geochats_messages (struct paramed_type *T);
+int autocomplete_constructor_geochats_messages_slice (struct paramed_type *T);
+int autocomplete_constructor_geochats_stated_message (struct paramed_type *T);
+int autocomplete_constructor_help_app_update (struct paramed_type *T);
+int autocomplete_constructor_help_no_app_update (struct paramed_type *T);
+int autocomplete_constructor_help_invite_text (struct paramed_type *T);
+int autocomplete_constructor_help_support (struct paramed_type *T);
+int autocomplete_constructor_messages_affected_history (struct paramed_type *T);
+int autocomplete_constructor_messages_affected_messages (struct paramed_type *T);
+int autocomplete_constructor_messages_all_stickers_not_modified (struct paramed_type *T);
+int autocomplete_constructor_messages_all_stickers (struct paramed_type *T);
+int autocomplete_constructor_messages_chat_full (struct paramed_type *T);
+int autocomplete_constructor_messages_chats (struct paramed_type *T);
+int autocomplete_constructor_messages_dh_config_not_modified (struct paramed_type *T);
+int autocomplete_constructor_messages_dh_config (struct paramed_type *T);
+int autocomplete_constructor_messages_dialogs (struct paramed_type *T);
+int autocomplete_constructor_messages_dialogs_slice (struct paramed_type *T);
+int autocomplete_constructor_messages_message_empty (struct paramed_type *T);
+int autocomplete_constructor_messages_messages (struct paramed_type *T);
+int autocomplete_constructor_messages_messages_slice (struct paramed_type *T);
+int autocomplete_constructor_messages_sent_encrypted_message (struct paramed_type *T);
+int autocomplete_constructor_messages_sent_encrypted_file (struct paramed_type *T);
+int autocomplete_constructor_messages_sent_message (struct paramed_type *T);
+int autocomplete_constructor_messages_sent_message_link (struct paramed_type *T);
+int autocomplete_constructor_messages_sticker_set (struct paramed_type *T);
+int autocomplete_constructor_messages_stickers_not_modified (struct paramed_type *T);
+int autocomplete_constructor_messages_stickers (struct paramed_type *T);
+int autocomplete_constructor_photos_photo (struct paramed_type *T);
+int autocomplete_constructor_photos_photos (struct paramed_type *T);
+int autocomplete_constructor_photos_photos_slice (struct paramed_type *T);
+int autocomplete_constructor_storage_file_unknown (struct paramed_type *T);
+int autocomplete_constructor_storage_file_jpeg (struct paramed_type *T);
+int autocomplete_constructor_storage_file_gif (struct paramed_type *T);
+int autocomplete_constructor_storage_file_png (struct paramed_type *T);
+int autocomplete_constructor_storage_file_pdf (struct paramed_type *T);
+int autocomplete_constructor_storage_file_mp3 (struct paramed_type *T);
+int autocomplete_constructor_storage_file_mov (struct paramed_type *T);
+int autocomplete_constructor_storage_file_partial (struct paramed_type *T);
+int autocomplete_constructor_storage_file_mp4 (struct paramed_type *T);
+int autocomplete_constructor_storage_file_webp (struct paramed_type *T);
+int autocomplete_constructor_updates_difference_empty (struct paramed_type *T);
+int autocomplete_constructor_updates_difference (struct paramed_type *T);
+int autocomplete_constructor_updates_difference_slice (struct paramed_type *T);
+int autocomplete_constructor_updates_state (struct paramed_type *T);
+int autocomplete_constructor_upload_file (struct paramed_type *T);
+int autocomplete_type_account_days_t_t_l (struct paramed_type *T);
+int do_autocomplete_type_account_days_t_t_l (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_account_days_t_t_l (struct paramed_type *T);
+int autocomplete_type_audio (struct paramed_type *T);
+int do_autocomplete_type_audio (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_audio (struct paramed_type *T);
+int autocomplete_type_authorization (struct paramed_type *T);
+int do_autocomplete_type_authorization (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_authorization (struct paramed_type *T);
+int autocomplete_type_bool (struct paramed_type *T);
+int do_autocomplete_type_bool (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_bool (struct paramed_type *T);
+int autocomplete_type_bot_command (struct paramed_type *T);
+int do_autocomplete_type_bot_command (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_bot_command (struct paramed_type *T);
+int autocomplete_type_bot_info (struct paramed_type *T);
+int do_autocomplete_type_bot_info (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_bot_info (struct paramed_type *T);
+int autocomplete_type_bytes (struct paramed_type *T);
+int do_autocomplete_type_bytes (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_bytes (struct paramed_type *T);
+int autocomplete_type_chat (struct paramed_type *T);
+int do_autocomplete_type_chat (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_chat (struct paramed_type *T);
+int autocomplete_type_chat_full (struct paramed_type *T);
+int do_autocomplete_type_chat_full (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_chat_full (struct paramed_type *T);
+int autocomplete_type_chat_invite (struct paramed_type *T);
+int do_autocomplete_type_chat_invite (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_chat_invite (struct paramed_type *T);
+int autocomplete_type_chat_located (struct paramed_type *T);
+int do_autocomplete_type_chat_located (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_chat_located (struct paramed_type *T);
+int autocomplete_type_chat_participant (struct paramed_type *T);
+int do_autocomplete_type_chat_participant (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_chat_participant (struct paramed_type *T);
+int autocomplete_type_chat_participants (struct paramed_type *T);
+int do_autocomplete_type_chat_participants (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_chat_participants (struct paramed_type *T);
+int autocomplete_type_chat_photo (struct paramed_type *T);
+int do_autocomplete_type_chat_photo (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_chat_photo (struct paramed_type *T);
+int autocomplete_type_client_d_h_inner_data (struct paramed_type *T);
+int do_autocomplete_type_client_d_h_inner_data (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_client_d_h_inner_data (struct paramed_type *T);
+int autocomplete_type_config (struct paramed_type *T);
+int do_autocomplete_type_config (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_config (struct paramed_type *T);
+int autocomplete_type_contact (struct paramed_type *T);
+int do_autocomplete_type_contact (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_contact (struct paramed_type *T);
+int autocomplete_type_contact_blocked (struct paramed_type *T);
+int do_autocomplete_type_contact_blocked (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_contact_blocked (struct paramed_type *T);
+int autocomplete_type_contact_found (struct paramed_type *T);
+int do_autocomplete_type_contact_found (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_contact_found (struct paramed_type *T);
+int autocomplete_type_contact_link (struct paramed_type *T);
+int do_autocomplete_type_contact_link (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_contact_link (struct paramed_type *T);
+int autocomplete_type_contact_status (struct paramed_type *T);
+int do_autocomplete_type_contact_status (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_contact_status (struct paramed_type *T);
+int autocomplete_type_contact_suggested (struct paramed_type *T);
+int do_autocomplete_type_contact_suggested (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_contact_suggested (struct paramed_type *T);
+int autocomplete_type_dc_option (struct paramed_type *T);
+int do_autocomplete_type_dc_option (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_dc_option (struct paramed_type *T);
+int autocomplete_type_decrypted_message (struct paramed_type *T);
+int do_autocomplete_type_decrypted_message (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_decrypted_message (struct paramed_type *T);
+int autocomplete_type_decrypted_message_action (struct paramed_type *T);
+int do_autocomplete_type_decrypted_message_action (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_decrypted_message_action (struct paramed_type *T);
+int autocomplete_type_decrypted_message_layer (struct paramed_type *T);
+int do_autocomplete_type_decrypted_message_layer (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_decrypted_message_layer (struct paramed_type *T);
+int autocomplete_type_decrypted_message_media (struct paramed_type *T);
+int do_autocomplete_type_decrypted_message_media (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_decrypted_message_media (struct paramed_type *T);
+int autocomplete_type_dialog (struct paramed_type *T);
+int do_autocomplete_type_dialog (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_dialog (struct paramed_type *T);
+int autocomplete_type_disabled_feature (struct paramed_type *T);
+int do_autocomplete_type_disabled_feature (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_disabled_feature (struct paramed_type *T);
+int autocomplete_type_document (struct paramed_type *T);
+int do_autocomplete_type_document (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_document (struct paramed_type *T);
+int autocomplete_type_document_attribute (struct paramed_type *T);
+int do_autocomplete_type_document_attribute (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_document_attribute (struct paramed_type *T);
+int autocomplete_type_double (struct paramed_type *T);
+int do_autocomplete_type_double (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_double (struct paramed_type *T);
+int autocomplete_type_encrypted_chat (struct paramed_type *T);
+int do_autocomplete_type_encrypted_chat (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_encrypted_chat (struct paramed_type *T);
+int autocomplete_type_encrypted_file (struct paramed_type *T);
+int do_autocomplete_type_encrypted_file (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_encrypted_file (struct paramed_type *T);
+int autocomplete_type_encrypted_message (struct paramed_type *T);
+int do_autocomplete_type_encrypted_message (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_encrypted_message (struct paramed_type *T);
+int autocomplete_type_error (struct paramed_type *T);
+int do_autocomplete_type_error (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_error (struct paramed_type *T);
+int autocomplete_type_exported_chat_invite (struct paramed_type *T);
+int do_autocomplete_type_exported_chat_invite (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_exported_chat_invite (struct paramed_type *T);
+int autocomplete_type_file_location (struct paramed_type *T);
+int do_autocomplete_type_file_location (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_file_location (struct paramed_type *T);
+int autocomplete_type_geo_chat_message (struct paramed_type *T);
+int do_autocomplete_type_geo_chat_message (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_geo_chat_message (struct paramed_type *T);
+int autocomplete_type_geo_point (struct paramed_type *T);
+int do_autocomplete_type_geo_point (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_geo_point (struct paramed_type *T);
+int autocomplete_type_imported_contact (struct paramed_type *T);
+int do_autocomplete_type_imported_contact (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_imported_contact (struct paramed_type *T);
+int autocomplete_type_input_app_event (struct paramed_type *T);
+int do_autocomplete_type_input_app_event (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_input_app_event (struct paramed_type *T);
+int autocomplete_type_input_audio (struct paramed_type *T);
+int do_autocomplete_type_input_audio (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_input_audio (struct paramed_type *T);
+int autocomplete_type_input_chat_photo (struct paramed_type *T);
+int do_autocomplete_type_input_chat_photo (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_input_chat_photo (struct paramed_type *T);
+int autocomplete_type_input_contact (struct paramed_type *T);
+int do_autocomplete_type_input_contact (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_input_contact (struct paramed_type *T);
+int autocomplete_type_input_document (struct paramed_type *T);
+int do_autocomplete_type_input_document (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_input_document (struct paramed_type *T);
+int autocomplete_type_input_encrypted_chat (struct paramed_type *T);
+int do_autocomplete_type_input_encrypted_chat (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_input_encrypted_chat (struct paramed_type *T);
+int autocomplete_type_input_encrypted_file (struct paramed_type *T);
+int do_autocomplete_type_input_encrypted_file (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_input_encrypted_file (struct paramed_type *T);
+int autocomplete_type_input_file (struct paramed_type *T);
+int do_autocomplete_type_input_file (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_input_file (struct paramed_type *T);
+int autocomplete_type_input_file_location (struct paramed_type *T);
+int do_autocomplete_type_input_file_location (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_input_file_location (struct paramed_type *T);
+int autocomplete_type_input_geo_chat (struct paramed_type *T);
+int do_autocomplete_type_input_geo_chat (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_input_geo_chat (struct paramed_type *T);
+int autocomplete_type_input_geo_point (struct paramed_type *T);
+int do_autocomplete_type_input_geo_point (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_input_geo_point (struct paramed_type *T);
+int autocomplete_type_input_media (struct paramed_type *T);
+int do_autocomplete_type_input_media (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_input_media (struct paramed_type *T);
+int autocomplete_type_input_notify_peer (struct paramed_type *T);
+int do_autocomplete_type_input_notify_peer (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_input_notify_peer (struct paramed_type *T);
+int autocomplete_type_input_peer (struct paramed_type *T);
+int do_autocomplete_type_input_peer (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_input_peer (struct paramed_type *T);
+int autocomplete_type_input_peer_notify_events (struct paramed_type *T);
+int do_autocomplete_type_input_peer_notify_events (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_input_peer_notify_events (struct paramed_type *T);
+int autocomplete_type_input_peer_notify_settings (struct paramed_type *T);
+int do_autocomplete_type_input_peer_notify_settings (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_input_peer_notify_settings (struct paramed_type *T);
+int autocomplete_type_input_photo (struct paramed_type *T);
+int do_autocomplete_type_input_photo (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_input_photo (struct paramed_type *T);
+int autocomplete_type_input_photo_crop (struct paramed_type *T);
+int do_autocomplete_type_input_photo_crop (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_input_photo_crop (struct paramed_type *T);
+int autocomplete_type_input_privacy_key (struct paramed_type *T);
+int do_autocomplete_type_input_privacy_key (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_input_privacy_key (struct paramed_type *T);
+int autocomplete_type_input_privacy_rule (struct paramed_type *T);
+int do_autocomplete_type_input_privacy_rule (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_input_privacy_rule (struct paramed_type *T);
+int autocomplete_type_input_sticker_set (struct paramed_type *T);
+int do_autocomplete_type_input_sticker_set (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_input_sticker_set (struct paramed_type *T);
+int autocomplete_type_input_user (struct paramed_type *T);
+int do_autocomplete_type_input_user (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_input_user (struct paramed_type *T);
+int autocomplete_type_input_video (struct paramed_type *T);
+int do_autocomplete_type_input_video (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_input_video (struct paramed_type *T);
+int autocomplete_type_int (struct paramed_type *T);
+int do_autocomplete_type_int (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_int (struct paramed_type *T);
+int autocomplete_type_int128 (struct paramed_type *T);
+int do_autocomplete_type_int128 (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_int128 (struct paramed_type *T);
+int autocomplete_type_int256 (struct paramed_type *T);
+int do_autocomplete_type_int256 (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_int256 (struct paramed_type *T);
+int autocomplete_type_keyboard_button (struct paramed_type *T);
+int do_autocomplete_type_keyboard_button (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_keyboard_button (struct paramed_type *T);
+int autocomplete_type_keyboard_button_row (struct paramed_type *T);
+int do_autocomplete_type_keyboard_button_row (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_keyboard_button_row (struct paramed_type *T);
+int autocomplete_type_long (struct paramed_type *T);
+int do_autocomplete_type_long (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_long (struct paramed_type *T);
+int autocomplete_type_message (struct paramed_type *T);
+int do_autocomplete_type_message (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_message (struct paramed_type *T);
+int autocomplete_type_message_action (struct paramed_type *T);
+int do_autocomplete_type_message_action (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_message_action (struct paramed_type *T);
+int autocomplete_type_message_media (struct paramed_type *T);
+int do_autocomplete_type_message_media (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_message_media (struct paramed_type *T);
+int autocomplete_type_messages_filter (struct paramed_type *T);
+int do_autocomplete_type_messages_filter (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_messages_filter (struct paramed_type *T);
+int autocomplete_type_nearest_dc (struct paramed_type *T);
+int do_autocomplete_type_nearest_dc (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_nearest_dc (struct paramed_type *T);
+int autocomplete_type_notify_peer (struct paramed_type *T);
+int do_autocomplete_type_notify_peer (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_notify_peer (struct paramed_type *T);
+int autocomplete_type_null (struct paramed_type *T);
+int do_autocomplete_type_null (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_null (struct paramed_type *T);
+int autocomplete_type_p_q_inner_data (struct paramed_type *T);
+int do_autocomplete_type_p_q_inner_data (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_p_q_inner_data (struct paramed_type *T);
+int autocomplete_type_peer (struct paramed_type *T);
+int do_autocomplete_type_peer (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_peer (struct paramed_type *T);
+int autocomplete_type_peer_notify_events (struct paramed_type *T);
+int do_autocomplete_type_peer_notify_events (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_peer_notify_events (struct paramed_type *T);
+int autocomplete_type_peer_notify_settings (struct paramed_type *T);
+int do_autocomplete_type_peer_notify_settings (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_peer_notify_settings (struct paramed_type *T);
+int autocomplete_type_photo (struct paramed_type *T);
+int do_autocomplete_type_photo (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_photo (struct paramed_type *T);
+int autocomplete_type_photo_size (struct paramed_type *T);
+int do_autocomplete_type_photo_size (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_photo_size (struct paramed_type *T);
+int autocomplete_type_privacy_key (struct paramed_type *T);
+int do_autocomplete_type_privacy_key (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_privacy_key (struct paramed_type *T);
+int autocomplete_type_privacy_rule (struct paramed_type *T);
+int do_autocomplete_type_privacy_rule (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_privacy_rule (struct paramed_type *T);
+int autocomplete_type_received_notify_message (struct paramed_type *T);
+int do_autocomplete_type_received_notify_message (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_received_notify_message (struct paramed_type *T);
+int autocomplete_type_reply_markup (struct paramed_type *T);
+int do_autocomplete_type_reply_markup (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_reply_markup (struct paramed_type *T);
+int autocomplete_type_res_p_q (struct paramed_type *T);
+int do_autocomplete_type_res_p_q (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_res_p_q (struct paramed_type *T);
+int autocomplete_type_send_message_action (struct paramed_type *T);
+int do_autocomplete_type_send_message_action (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_send_message_action (struct paramed_type *T);
+int autocomplete_type_server_d_h_params (struct paramed_type *T);
+int do_autocomplete_type_server_d_h_params (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_server_d_h_params (struct paramed_type *T);
+int autocomplete_type_server_d_h_inner_data (struct paramed_type *T);
+int do_autocomplete_type_server_d_h_inner_data (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_server_d_h_inner_data (struct paramed_type *T);
+int autocomplete_type_set_client_d_h_params_answer (struct paramed_type *T);
+int do_autocomplete_type_set_client_d_h_params_answer (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_set_client_d_h_params_answer (struct paramed_type *T);
+int autocomplete_type_sticker_pack (struct paramed_type *T);
+int do_autocomplete_type_sticker_pack (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_sticker_pack (struct paramed_type *T);
+int autocomplete_type_sticker_set (struct paramed_type *T);
+int do_autocomplete_type_sticker_set (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_sticker_set (struct paramed_type *T);
+int autocomplete_type_string (struct paramed_type *T);
+int do_autocomplete_type_string (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_string (struct paramed_type *T);
+int autocomplete_type_update (struct paramed_type *T);
+int do_autocomplete_type_update (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_update (struct paramed_type *T);
+int autocomplete_type_updates (struct paramed_type *T);
+int do_autocomplete_type_updates (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_updates (struct paramed_type *T);
+int autocomplete_type_user (struct paramed_type *T);
+int do_autocomplete_type_user (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_user (struct paramed_type *T);
+int autocomplete_type_user_full (struct paramed_type *T);
+int do_autocomplete_type_user_full (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_user_full (struct paramed_type *T);
+int autocomplete_type_user_profile_photo (struct paramed_type *T);
+int do_autocomplete_type_user_profile_photo (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_user_profile_photo (struct paramed_type *T);
+int autocomplete_type_user_status (struct paramed_type *T);
+int do_autocomplete_type_user_status (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_user_status (struct paramed_type *T);
+int autocomplete_type_vector (struct paramed_type *T);
+int do_autocomplete_type_vector (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_vector (struct paramed_type *T);
+int autocomplete_type_video (struct paramed_type *T);
+int do_autocomplete_type_video (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_video (struct paramed_type *T);
+int autocomplete_type_wall_paper (struct paramed_type *T);
+int do_autocomplete_type_wall_paper (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_wall_paper (struct paramed_type *T);
+int autocomplete_type_web_page (struct paramed_type *T);
+int do_autocomplete_type_web_page (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_web_page (struct paramed_type *T);
+int autocomplete_type_account_authorizations (struct paramed_type *T);
+int do_autocomplete_type_account_authorizations (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_account_authorizations (struct paramed_type *T);
+int autocomplete_type_account_password (struct paramed_type *T);
+int do_autocomplete_type_account_password (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_account_password (struct paramed_type *T);
+int autocomplete_type_account_password_input_settings (struct paramed_type *T);
+int do_autocomplete_type_account_password_input_settings (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_account_password_input_settings (struct paramed_type *T);
+int autocomplete_type_account_password_settings (struct paramed_type *T);
+int do_autocomplete_type_account_password_settings (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_account_password_settings (struct paramed_type *T);
+int autocomplete_type_account_privacy_rules (struct paramed_type *T);
+int do_autocomplete_type_account_privacy_rules (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_account_privacy_rules (struct paramed_type *T);
+int autocomplete_type_account_sent_change_phone_code (struct paramed_type *T);
+int do_autocomplete_type_account_sent_change_phone_code (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_account_sent_change_phone_code (struct paramed_type *T);
+int autocomplete_type_auth_authorization (struct paramed_type *T);
+int do_autocomplete_type_auth_authorization (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_auth_authorization (struct paramed_type *T);
+int autocomplete_type_auth_checked_phone (struct paramed_type *T);
+int do_autocomplete_type_auth_checked_phone (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_auth_checked_phone (struct paramed_type *T);
+int autocomplete_type_auth_exported_authorization (struct paramed_type *T);
+int do_autocomplete_type_auth_exported_authorization (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_auth_exported_authorization (struct paramed_type *T);
+int autocomplete_type_auth_password_recovery (struct paramed_type *T);
+int do_autocomplete_type_auth_password_recovery (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_auth_password_recovery (struct paramed_type *T);
+int autocomplete_type_auth_sent_code (struct paramed_type *T);
+int do_autocomplete_type_auth_sent_code (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_auth_sent_code (struct paramed_type *T);
+int autocomplete_type_binlog_encr_key (struct paramed_type *T);
+int do_autocomplete_type_binlog_encr_key (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_binlog_encr_key (struct paramed_type *T);
+int autocomplete_type_binlog_update (struct paramed_type *T);
+int do_autocomplete_type_binlog_update (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_binlog_update (struct paramed_type *T);
+int autocomplete_type_contacts_blocked (struct paramed_type *T);
+int do_autocomplete_type_contacts_blocked (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_contacts_blocked (struct paramed_type *T);
+int autocomplete_type_contacts_contacts (struct paramed_type *T);
+int do_autocomplete_type_contacts_contacts (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_contacts_contacts (struct paramed_type *T);
+int autocomplete_type_contacts_found (struct paramed_type *T);
+int do_autocomplete_type_contacts_found (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_contacts_found (struct paramed_type *T);
+int autocomplete_type_contacts_imported_contacts (struct paramed_type *T);
+int do_autocomplete_type_contacts_imported_contacts (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_contacts_imported_contacts (struct paramed_type *T);
+int autocomplete_type_contacts_link (struct paramed_type *T);
+int do_autocomplete_type_contacts_link (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_contacts_link (struct paramed_type *T);
+int autocomplete_type_contacts_suggested (struct paramed_type *T);
+int do_autocomplete_type_contacts_suggested (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_contacts_suggested (struct paramed_type *T);
+int autocomplete_type_geochats_located (struct paramed_type *T);
+int do_autocomplete_type_geochats_located (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_geochats_located (struct paramed_type *T);
+int autocomplete_type_geochats_messages (struct paramed_type *T);
+int do_autocomplete_type_geochats_messages (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_geochats_messages (struct paramed_type *T);
+int autocomplete_type_geochats_stated_message (struct paramed_type *T);
+int do_autocomplete_type_geochats_stated_message (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_geochats_stated_message (struct paramed_type *T);
+int autocomplete_type_help_app_update (struct paramed_type *T);
+int do_autocomplete_type_help_app_update (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_help_app_update (struct paramed_type *T);
+int autocomplete_type_help_invite_text (struct paramed_type *T);
+int do_autocomplete_type_help_invite_text (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_help_invite_text (struct paramed_type *T);
+int autocomplete_type_help_support (struct paramed_type *T);
+int do_autocomplete_type_help_support (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_help_support (struct paramed_type *T);
+int autocomplete_type_messages_affected_history (struct paramed_type *T);
+int do_autocomplete_type_messages_affected_history (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_messages_affected_history (struct paramed_type *T);
+int autocomplete_type_messages_affected_messages (struct paramed_type *T);
+int do_autocomplete_type_messages_affected_messages (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_messages_affected_messages (struct paramed_type *T);
+int autocomplete_type_messages_all_stickers (struct paramed_type *T);
+int do_autocomplete_type_messages_all_stickers (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_messages_all_stickers (struct paramed_type *T);
+int autocomplete_type_messages_chat_full (struct paramed_type *T);
+int do_autocomplete_type_messages_chat_full (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_messages_chat_full (struct paramed_type *T);
+int autocomplete_type_messages_chats (struct paramed_type *T);
+int do_autocomplete_type_messages_chats (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_messages_chats (struct paramed_type *T);
+int autocomplete_type_messages_dh_config (struct paramed_type *T);
+int do_autocomplete_type_messages_dh_config (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_messages_dh_config (struct paramed_type *T);
+int autocomplete_type_messages_dialogs (struct paramed_type *T);
+int do_autocomplete_type_messages_dialogs (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_messages_dialogs (struct paramed_type *T);
+int autocomplete_type_messages_message (struct paramed_type *T);
+int do_autocomplete_type_messages_message (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_messages_message (struct paramed_type *T);
+int autocomplete_type_messages_messages (struct paramed_type *T);
+int do_autocomplete_type_messages_messages (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_messages_messages (struct paramed_type *T);
+int autocomplete_type_messages_sent_encrypted_message (struct paramed_type *T);
+int do_autocomplete_type_messages_sent_encrypted_message (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_messages_sent_encrypted_message (struct paramed_type *T);
+int autocomplete_type_messages_sent_message (struct paramed_type *T);
+int do_autocomplete_type_messages_sent_message (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_messages_sent_message (struct paramed_type *T);
+int autocomplete_type_messages_sticker_set (struct paramed_type *T);
+int do_autocomplete_type_messages_sticker_set (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_messages_sticker_set (struct paramed_type *T);
+int autocomplete_type_messages_stickers (struct paramed_type *T);
+int do_autocomplete_type_messages_stickers (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_messages_stickers (struct paramed_type *T);
+int autocomplete_type_photos_photo (struct paramed_type *T);
+int do_autocomplete_type_photos_photo (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_photos_photo (struct paramed_type *T);
+int autocomplete_type_photos_photos (struct paramed_type *T);
+int do_autocomplete_type_photos_photos (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_photos_photos (struct paramed_type *T);
+int autocomplete_type_storage_file_type (struct paramed_type *T);
+int do_autocomplete_type_storage_file_type (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_storage_file_type (struct paramed_type *T);
+int autocomplete_type_updates_difference (struct paramed_type *T);
+int do_autocomplete_type_updates_difference (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_updates_difference (struct paramed_type *T);
+int autocomplete_type_updates_state (struct paramed_type *T);
+int do_autocomplete_type_updates_state (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_updates_state (struct paramed_type *T);
+int autocomplete_type_upload_file (struct paramed_type *T);
+int do_autocomplete_type_upload_file (const char *text, int len, int index, char **R);
+int autocomplete_type_bare_upload_file (struct paramed_type *T);
+int autocomplete_type_any (struct paramed_type *T);
+struct paramed_type *autocomplete_function_any (void);
diff --git a/protocols/Telegram/tgl/auto/auto-fetch-ds.c b/protocols/Telegram/tgl/auto/auto-fetch-ds.c
new file mode 100644
index 0000000000..da360323a0
--- /dev/null
+++ b/protocols/Telegram/tgl/auto/auto-fetch-ds.c
@@ -0,0 +1,11877 @@
+#ifdef _MSC_VER
+#include "..\auto.h"
+#include "auto-fetch-ds.h"
+#include "auto-skip.h"
+#include "auto-types.h"
+#include "..\auto-static-fetch-ds.c"
+#include "..\mtproto-common.h"
+#else
+#include "auto.h"
+#include "auto/auto-fetch-ds.h"
+#include "auto/auto-skip.h"
+#include "auto/auto-types.h"
+#include "auto-static-fetch-ds.c"
+#include "mtproto-common.h"
+#endif
+#include <assert.h>
+struct tl_ds_account_days_t_t_l *fetch_ds_constructor_account_days_t_t_l (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb8d0afdf && T->type->name != 0x472f5020)) { return 0; }
+ struct tl_ds_account_days_t_t_l * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->days = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_audio *fetch_ds_constructor_audio_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fc5ec4e && T->type->name != 0x603a13b1)) { return 0; }
+ struct tl_ds_audio * result = talloc0 (sizeof (*result));
+ result->magic = 0x586988d8;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ return result;
+}
+struct tl_ds_audio *fetch_ds_constructor_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fc5ec4e && T->type->name != 0x603a13b1)) { return 0; }
+ struct tl_ds_audio * result = talloc0 (sizeof (*result));
+ result->magic = 0xc7ac6496;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->duration = fetch_ds_type_bare_int (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->mime_type = fetch_ds_type_bare_string (field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->size = fetch_ds_type_bare_int (field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->dc_id = fetch_ds_type_bare_int (field8);
+ return result;
+}
+struct tl_ds_authorization *fetch_ds_constructor_authorization (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bf2e6f6 && T->type->name != 0x840d1909)) { return 0; }
+ struct tl_ds_authorization * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->hash = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->flags = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->device_model = fetch_ds_type_bare_string (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->platform = fetch_ds_type_bare_string (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->system_version = fetch_ds_type_bare_string (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->api_id = fetch_ds_type_bare_int (field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->app_name = fetch_ds_type_bare_string (field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->app_version = fetch_ds_type_bare_string (field8);
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date_created = fetch_ds_type_bare_int (field9);
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date_active = fetch_ds_type_bare_int (field10);
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->ip = fetch_ds_type_bare_string (field11);
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->country = fetch_ds_type_bare_string (field12);
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->region = fetch_ds_type_bare_string (field13);
+ return result;
+}
+struct tl_ds_bool *fetch_ds_constructor_bool_false (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x250be282 && T->type->name != 0xdaf41d7d)) { return 0; }
+ struct tl_ds_bool * result = talloc0 (sizeof (*result));
+ result->magic = 0xbc799737;
+ return result;
+}
+struct tl_ds_bool *fetch_ds_constructor_bool_true (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x250be282 && T->type->name != 0xdaf41d7d)) { return 0; }
+ struct tl_ds_bool * result = talloc0 (sizeof (*result));
+ result->magic = 0x997275b5;
+ return result;
+}
+struct tl_ds_bot_command *fetch_ds_constructor_bot_command (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x75e7ea6c && T->type->name != 0x8a181593)) { return 0; }
+ struct tl_ds_bot_command * result = talloc0 (sizeof (*result));
+ result->magic = 0xc27ac8c7;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->command = fetch_ds_type_bare_string (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->description = fetch_ds_type_bare_string (field2);
+ return result;
+}
+struct tl_ds_bot_command *fetch_ds_constructor_bot_command_old (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x75e7ea6c && T->type->name != 0x8a181593)) { return 0; }
+ struct tl_ds_bot_command * result = talloc0 (sizeof (*result));
+ result->magic = 0xb79d22ab;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->command = fetch_ds_type_bare_string (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->params = fetch_ds_type_bare_string (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->description = fetch_ds_type_bare_string (field3);
+ return result;
+}
+struct tl_ds_bot_info *fetch_ds_constructor_bot_info_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb2e16f93 && T->type->name != 0x4d1e906c)) { return 0; }
+ struct tl_ds_bot_info * result = talloc0 (sizeof (*result));
+ result->magic = 0xbb2e37ce;
+ return result;
+}
+struct tl_ds_bot_info *fetch_ds_constructor_bot_info (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb2e16f93 && T->type->name != 0x4d1e906c)) { return 0; }
+ struct tl_ds_bot_info * result = talloc0 (sizeof (*result));
+ result->magic = 0x09cf585d;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->version = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->share_text = fetch_ds_type_bare_string (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->description = fetch_ds_type_bare_string (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x75e7ea6c, .id = "BotCommand", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->commands = (void *)fetch_ds_type_vector (field5);
+ return result;
+}
+struct tl_ds_string *fetch_ds_constructor_bytes (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0ee1379f && T->type->name != 0xf11ec860)) { return 0; }
+ struct tl_ds_string * result = talloc0 (sizeof (*result));
+ assert (in_remaining () >= 4);
+ int l = prefetch_strlen ();
+ assert (l >= 0);
+ result->len = l;
+ result->data = talloc (l + 1);
+ result->data[l] = 0;
+ memcpy (result->data, fetch_str (l), l);
+ return result;
+}
+struct tl_ds_chat *fetch_ds_constructor_chat_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return 0; }
+ struct tl_ds_chat * result = talloc0 (sizeof (*result));
+ result->magic = 0x9ba2d800;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_chat *fetch_ds_constructor_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return 0; }
+ struct tl_ds_chat * result = talloc0 (sizeof (*result));
+ result->magic = 0x6e9c9bc7;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->title = fetch_ds_type_bare_string (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x56922676, .id = "ChatPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->photo = fetch_ds_type_chat_photo (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->participants_count = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->left = fetch_ds_type_bool (field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->version = fetch_ds_type_bare_int (field7);
+ return result;
+}
+struct tl_ds_chat *fetch_ds_constructor_chat_forbidden (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return 0; }
+ struct tl_ds_chat * result = talloc0 (sizeof (*result));
+ result->magic = 0xfb0ccc41;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->title = fetch_ds_type_bare_string (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field3);
+ return result;
+}
+struct tl_ds_chat *fetch_ds_constructor_geo_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return 0; }
+ struct tl_ds_chat * result = talloc0 (sizeof (*result));
+ result->magic = 0x75eaea5a;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->title = fetch_ds_type_bare_string (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->address = fetch_ds_type_bare_string (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->venue = fetch_ds_type_bare_string (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->geo = fetch_ds_type_geo_point (field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x56922676, .id = "ChatPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->photo = fetch_ds_type_chat_photo (field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->participants_count = fetch_ds_type_bare_int (field8);
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field9);
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->checked_in = fetch_ds_type_bool (field10);
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->version = fetch_ds_type_bare_int (field11);
+ return result;
+}
+struct tl_ds_chat_full *fetch_ds_constructor_chat_full (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02a614 && T->type->name != 0xd1fd59eb)) { return 0; }
+ struct tl_ds_chat_full * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x77930f9f, .id = "ChatParticipants", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->participants = fetch_ds_type_chat_participants (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->chat_photo = fetch_ds_type_photo (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->notify_settings = fetch_ds_type_peer_notify_settings (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f132d5, .id = "ExportedChatInvite", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->exported_invite = fetch_ds_type_exported_chat_invite (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb2e16f93, .id = "BotInfo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->bot_info = (void *)fetch_ds_type_vector (field6);
+ return result;
+}
+struct tl_ds_chat_invite *fetch_ds_constructor_chat_invite_already (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x94f910b1 && T->type->name != 0x6b06ef4e)) { return 0; }
+ struct tl_ds_chat_invite * result = talloc0 (sizeof (*result));
+ result->magic = 0x5a686d7c;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->chat = fetch_ds_type_chat (field1);
+ return result;
+}
+struct tl_ds_chat_invite *fetch_ds_constructor_chat_invite (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x94f910b1 && T->type->name != 0x6b06ef4e)) { return 0; }
+ struct tl_ds_chat_invite * result = talloc0 (sizeof (*result));
+ result->magic = 0xce917dcd;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->title = fetch_ds_type_bare_string (field1);
+ return result;
+}
+struct tl_ds_chat_located *fetch_ds_constructor_chat_located (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3631cf4c && T->type->name != 0xc9ce30b3)) { return 0; }
+ struct tl_ds_chat_located * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->chat_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->distance = fetch_ds_type_bare_int (field2);
+ return result;
+}
+struct tl_ds_chat_participant *fetch_ds_constructor_chat_participant (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc8d7493e && T->type->name != 0x3728b6c1)) { return 0; }
+ struct tl_ds_chat_participant * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->inviter_id = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field3);
+ return result;
+}
+struct tl_ds_chat_participants *fetch_ds_constructor_chat_participants_forbidden (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x77930f9f && T->type->name != 0x886cf060)) { return 0; }
+ struct tl_ds_chat_participants * result = talloc0 (sizeof (*result));
+ result->magic = 0x0fd2bb8a;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->chat_id = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_chat_participants *fetch_ds_constructor_chat_participants (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x77930f9f && T->type->name != 0x886cf060)) { return 0; }
+ struct tl_ds_chat_participants * result = talloc0 (sizeof (*result));
+ result->magic = 0x7841b415;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->chat_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->admin_id = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc8d7493e, .id = "ChatParticipant", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->participants = (void *)fetch_ds_type_vector (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->version = fetch_ds_type_bare_int (field4);
+ return result;
+}
+struct tl_ds_chat_photo *fetch_ds_constructor_chat_photo_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x56922676 && T->type->name != 0xa96dd989)) { return 0; }
+ struct tl_ds_chat_photo * result = talloc0 (sizeof (*result));
+ result->magic = 0x37c1011c;
+ return result;
+}
+struct tl_ds_chat_photo *fetch_ds_constructor_chat_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x56922676 && T->type->name != 0xa96dd989)) { return 0; }
+ struct tl_ds_chat_photo * result = talloc0 (sizeof (*result));
+ result->magic = 0x6153276a;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->photo_small = fetch_ds_type_file_location (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->photo_big = fetch_ds_type_file_location (field2);
+ return result;
+}
+struct tl_ds_client_d_h_inner_data *fetch_ds_constructor_client_d_h_inner_data (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6643b654 && T->type->name != 0x99bc49ab)) { return 0; }
+ struct tl_ds_client_d_h_inner_data * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->nonce = fetch_ds_type_bare_int128 (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->server_nonce = fetch_ds_type_bare_int128 (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->retry_id = fetch_ds_type_bare_long (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->g_b = fetch_ds_type_bare_string (field4);
+ return result;
+}
+struct tl_ds_config *fetch_ds_constructor_config (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e32b894 && T->type->name != 0xb1cd476b)) { return 0; }
+ struct tl_ds_config * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->expires = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->test_mode = fetch_ds_type_bool (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->this_dc = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2b1a62f0, .id = "DcOption", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->dc_options = (void *)fetch_ds_type_vector (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->chat_size_max = fetch_ds_type_bare_int (field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->broadcast_size_max = fetch_ds_type_bare_int (field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->forwarded_count_max = fetch_ds_type_bare_int (field8);
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->online_update_period_ms = fetch_ds_type_bare_int (field9);
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->offline_blur_timeout_ms = fetch_ds_type_bare_int (field10);
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->offline_idle_timeout_ms = fetch_ds_type_bare_int (field11);
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->online_cloud_timeout_ms = fetch_ds_type_bare_int (field12);
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->notify_cloud_delay_ms = fetch_ds_type_bare_int (field13);
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->notify_default_delay_ms = fetch_ds_type_bare_int (field14);
+ struct paramed_type *field15 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->chat_big_size = fetch_ds_type_bare_int (field15);
+ struct paramed_type *field16 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->push_chat_period_ms = fetch_ds_type_bare_int (field16);
+ struct paramed_type *field17 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->push_chat_limit = fetch_ds_type_bare_int (field17);
+ struct paramed_type *field18 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xae636f24, .id = "DisabledFeature", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->disabled_features = (void *)fetch_ds_type_vector (field18);
+ return result;
+}
+struct tl_ds_contact *fetch_ds_constructor_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf911c994 && T->type->name != 0x06ee366b)) { return 0; }
+ struct tl_ds_contact * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->mutual = fetch_ds_type_bool (field2);
+ return result;
+}
+struct tl_ds_contact_blocked *fetch_ds_constructor_contact_blocked (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x561bc879 && T->type->name != 0xa9e43786)) { return 0; }
+ struct tl_ds_contact_blocked * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field2);
+ return result;
+}
+struct tl_ds_contact_found *fetch_ds_constructor_contact_found (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xea879f95 && T->type->name != 0x1578606a)) { return 0; }
+ struct tl_ds_contact_found * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_contact_link *fetch_ds_constructor_contact_link_unknown (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return 0; }
+ struct tl_ds_contact_link * result = talloc0 (sizeof (*result));
+ result->magic = 0x5f4f9247;
+ return result;
+}
+struct tl_ds_contact_link *fetch_ds_constructor_contact_link_none (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return 0; }
+ struct tl_ds_contact_link * result = talloc0 (sizeof (*result));
+ result->magic = 0xfeedd3ad;
+ return result;
+}
+struct tl_ds_contact_link *fetch_ds_constructor_contact_link_has_phone (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return 0; }
+ struct tl_ds_contact_link * result = talloc0 (sizeof (*result));
+ result->magic = 0x268f3f59;
+ return result;
+}
+struct tl_ds_contact_link *fetch_ds_constructor_contact_link_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return 0; }
+ struct tl_ds_contact_link * result = talloc0 (sizeof (*result));
+ result->magic = 0xd502c2d0;
+ return result;
+}
+struct tl_ds_contact_status *fetch_ds_constructor_contact_status (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd3680c61 && T->type->name != 0x2c97f39e)) { return 0; }
+ struct tl_ds_contact_status * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x76de9570, .id = "UserStatus", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->status = fetch_ds_type_user_status (field2);
+ return result;
+}
+struct tl_ds_contact_suggested *fetch_ds_constructor_contact_suggested (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3de191a1 && T->type->name != 0xc21e6e5e)) { return 0; }
+ struct tl_ds_contact_suggested * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->mutual_contacts = fetch_ds_type_bare_int (field2);
+ return result;
+}
+struct tl_ds_dc_option *fetch_ds_constructor_dc_option_l28 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2b1a62f0 && T->type->name != 0xd4e59d0f)) { return 0; }
+ struct tl_ds_dc_option * result = talloc0 (sizeof (*result));
+ result->magic = 0x2ec2a43c;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->hostname = fetch_ds_type_bare_string (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->ip_address = fetch_ds_type_bare_string (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->port = fetch_ds_type_bare_int (field4);
+ return result;
+}
+struct tl_ds_dc_option *fetch_ds_constructor_dc_option (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2b1a62f0 && T->type->name != 0xd4e59d0f)) { return 0; }
+ struct tl_ds_dc_option * result = talloc0 (sizeof (*result));
+ result->magic = 0x05d8c6cc;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->flags = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->ip_address = fetch_ds_type_bare_string (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->port = fetch_ds_type_bare_int (field4);
+ return result;
+}
+struct tl_ds_decrypted_message *fetch_ds_constructor_decrypted_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x535b7918 && T->type->name != 0xaca486e7)) { return 0; }
+ struct tl_ds_decrypted_message * result = talloc0 (sizeof (*result));
+ result->magic = 0x204d3878;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->random_id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->ttl = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->message = fetch_ds_type_bare_string (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x34e0d674, .id = "DecryptedMessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->media = fetch_ds_type_decrypted_message_media (field4);
+ return result;
+}
+struct tl_ds_decrypted_message *fetch_ds_constructor_decrypted_message_service (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x535b7918 && T->type->name != 0xaca486e7)) { return 0; }
+ struct tl_ds_decrypted_message * result = talloc0 (sizeof (*result));
+ result->magic = 0x73164160;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->random_id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4e0eefde, .id = "DecryptedMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->action = fetch_ds_type_decrypted_message_action (field2);
+ return result;
+}
+struct tl_ds_decrypted_message_action *fetch_ds_constructor_decrypted_message_action_set_message_t_t_l (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return 0; }
+ struct tl_ds_decrypted_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0xa1733aec;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->ttl_seconds = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_decrypted_message_action *fetch_ds_constructor_decrypted_message_action_read_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return 0; }
+ struct tl_ds_decrypted_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0x0c4f40be;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->random_ids = (void *)fetch_ds_type_vector (field1);
+ return result;
+}
+struct tl_ds_decrypted_message_action *fetch_ds_constructor_decrypted_message_action_delete_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return 0; }
+ struct tl_ds_decrypted_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0x65614304;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->random_ids = (void *)fetch_ds_type_vector (field1);
+ return result;
+}
+struct tl_ds_decrypted_message_action *fetch_ds_constructor_decrypted_message_action_screenshot_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return 0; }
+ struct tl_ds_decrypted_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0x8ac1f475;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->random_ids = (void *)fetch_ds_type_vector (field1);
+ return result;
+}
+struct tl_ds_decrypted_message_action *fetch_ds_constructor_decrypted_message_action_flush_history (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return 0; }
+ struct tl_ds_decrypted_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0x6719e45c;
+ return result;
+}
+struct tl_ds_decrypted_message_action *fetch_ds_constructor_decrypted_message_action_resend (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return 0; }
+ struct tl_ds_decrypted_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0x511110b0;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->start_seq_no = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->end_seq_no = fetch_ds_type_bare_int (field2);
+ return result;
+}
+struct tl_ds_decrypted_message_action *fetch_ds_constructor_decrypted_message_action_notify_layer (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return 0; }
+ struct tl_ds_decrypted_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0xf3048883;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->layer = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_decrypted_message_action *fetch_ds_constructor_decrypted_message_action_typing (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return 0; }
+ struct tl_ds_decrypted_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0xccb27641;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x70541c7e, .id = "SendMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->action = fetch_ds_type_send_message_action (field1);
+ return result;
+}
+struct tl_ds_decrypted_message_action *fetch_ds_constructor_decrypted_message_action_request_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return 0; }
+ struct tl_ds_decrypted_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0xf3c9611b;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->exchange_id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->g_a = fetch_ds_type_bare_bytes (field2);
+ return result;
+}
+struct tl_ds_decrypted_message_action *fetch_ds_constructor_decrypted_message_action_accept_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return 0; }
+ struct tl_ds_decrypted_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0x6fe1735b;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->exchange_id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->g_b = fetch_ds_type_bare_bytes (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->key_fingerprint = fetch_ds_type_bare_long (field3);
+ return result;
+}
+struct tl_ds_decrypted_message_action *fetch_ds_constructor_decrypted_message_action_abort_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return 0; }
+ struct tl_ds_decrypted_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0xdd05ec6b;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->exchange_id = fetch_ds_type_bare_long (field1);
+ return result;
+}
+struct tl_ds_decrypted_message_action *fetch_ds_constructor_decrypted_message_action_commit_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return 0; }
+ struct tl_ds_decrypted_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0xec2e0b9b;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->exchange_id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->key_fingerprint = fetch_ds_type_bare_long (field2);
+ return result;
+}
+struct tl_ds_decrypted_message_action *fetch_ds_constructor_decrypted_message_action_noop (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return 0; }
+ struct tl_ds_decrypted_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0xa82fdd63;
+ return result;
+}
+struct tl_ds_decrypted_message_layer *fetch_ds_constructor_decrypted_message_layer (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1be31789 && T->type->name != 0xe41ce876)) { return 0; }
+ struct tl_ds_decrypted_message_layer * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->random_bytes = fetch_ds_type_bare_bytes (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->layer = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->in_seq_no = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->out_seq_no = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x535b7918, .id = "DecryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->message = fetch_ds_type_decrypted_message (field5);
+ return result;
+}
+struct tl_ds_decrypted_message_media *fetch_ds_constructor_decrypted_message_media_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return 0; }
+ struct tl_ds_decrypted_message_media * result = talloc0 (sizeof (*result));
+ result->magic = 0x089f5c4a;
+ return result;
+}
+struct tl_ds_decrypted_message_media *fetch_ds_constructor_decrypted_message_media_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return 0; }
+ struct tl_ds_decrypted_message_media * result = talloc0 (sizeof (*result));
+ result->magic = 0x32798a8c;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->str_thumb = fetch_ds_type_bare_bytes (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->thumb_w = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->thumb_h = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->w = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->h = fetch_ds_type_bare_int (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->size = fetch_ds_type_bare_int (field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->key = fetch_ds_type_bare_bytes (field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->iv = fetch_ds_type_bare_bytes (field8);
+ return result;
+}
+struct tl_ds_decrypted_message_media *fetch_ds_constructor_decrypted_message_media_geo_point (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return 0; }
+ struct tl_ds_decrypted_message_media * result = talloc0 (sizeof (*result));
+ result->magic = 0x35480a59;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->latitude = fetch_ds_type_bare_double (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->longitude = fetch_ds_type_bare_double (field2);
+ return result;
+}
+struct tl_ds_decrypted_message_media *fetch_ds_constructor_decrypted_message_media_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return 0; }
+ struct tl_ds_decrypted_message_media * result = talloc0 (sizeof (*result));
+ result->magic = 0x588a0a97;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->phone_number = fetch_ds_type_bare_string (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->first_name = fetch_ds_type_bare_string (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->last_name = fetch_ds_type_bare_string (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field4);
+ return result;
+}
+struct tl_ds_decrypted_message_media *fetch_ds_constructor_decrypted_message_media_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return 0; }
+ struct tl_ds_decrypted_message_media * result = talloc0 (sizeof (*result));
+ result->magic = 0xb095434b;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->str_thumb = fetch_ds_type_bare_bytes (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->thumb_w = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->thumb_h = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->file_name = fetch_ds_type_bare_string (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->mime_type = fetch_ds_type_bare_string (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->size = fetch_ds_type_bare_int (field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->key = fetch_ds_type_bare_bytes (field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->iv = fetch_ds_type_bare_bytes (field8);
+ return result;
+}
+struct tl_ds_decrypted_message_media *fetch_ds_constructor_decrypted_message_media_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return 0; }
+ struct tl_ds_decrypted_message_media * result = talloc0 (sizeof (*result));
+ result->magic = 0x524a415d;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->str_thumb = fetch_ds_type_bare_bytes (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->thumb_w = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->thumb_h = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->duration = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->mime_type = fetch_ds_type_bare_string (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->w = fetch_ds_type_bare_int (field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->h = fetch_ds_type_bare_int (field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->size = fetch_ds_type_bare_int (field8);
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->key = fetch_ds_type_bare_bytes (field9);
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->iv = fetch_ds_type_bare_bytes (field10);
+ return result;
+}
+struct tl_ds_decrypted_message_media *fetch_ds_constructor_decrypted_message_media_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return 0; }
+ struct tl_ds_decrypted_message_media * result = talloc0 (sizeof (*result));
+ result->magic = 0x57e0a9cb;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->duration = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->mime_type = fetch_ds_type_bare_string (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->size = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->key = fetch_ds_type_bare_bytes (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->iv = fetch_ds_type_bare_bytes (field5);
+ return result;
+}
+struct tl_ds_decrypted_message_media *fetch_ds_constructor_decrypted_message_media_external_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return 0; }
+ struct tl_ds_decrypted_message_media * result = talloc0 (sizeof (*result));
+ result->magic = 0xfa95b0dd;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->mime_type = fetch_ds_type_bare_string (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->size = fetch_ds_type_bare_int (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->thumb = fetch_ds_type_photo_size (field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->dc_id = fetch_ds_type_bare_int (field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->attributes = (void *)fetch_ds_type_vector (field8);
+ return result;
+}
+struct tl_ds_decrypted_message_media *fetch_ds_constructor_decrypted_message_media_video_l12 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return 0; }
+ struct tl_ds_decrypted_message_media * result = talloc0 (sizeof (*result));
+ result->magic = 0x4cee6ef3;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->str_thumb = fetch_ds_type_bare_bytes (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->thumb_w = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->thumb_h = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->duration = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->w = fetch_ds_type_bare_int (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->h = fetch_ds_type_bare_int (field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->size = fetch_ds_type_bare_int (field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->key = fetch_ds_type_bare_bytes (field8);
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->iv = fetch_ds_type_bare_bytes (field9);
+ return result;
+}
+struct tl_ds_decrypted_message_media *fetch_ds_constructor_decrypted_message_media_audio_l12 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return 0; }
+ struct tl_ds_decrypted_message_media * result = talloc0 (sizeof (*result));
+ result->magic = 0x6080758f;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->duration = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->size = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->key = fetch_ds_type_bare_bytes (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->iv = fetch_ds_type_bare_bytes (field4);
+ return result;
+}
+struct tl_ds_dialog *fetch_ds_constructor_dialog (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc1dd804a && T->type->name != 0x3e227fb5)) { return 0; }
+ struct tl_ds_dialog * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->peer = fetch_ds_type_peer (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->top_message = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->read_inbox_max_id = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->unread_count = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->notify_settings = fetch_ds_type_peer_notify_settings (field5);
+ return result;
+}
+struct tl_ds_disabled_feature *fetch_ds_constructor_disabled_feature (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xae636f24 && T->type->name != 0x519c90db)) { return 0; }
+ struct tl_ds_disabled_feature * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->feature = fetch_ds_type_bare_string (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->description = fetch_ds_type_bare_string (field2);
+ return result;
+}
+struct tl_ds_document *fetch_ds_constructor_document_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x51a73418 && T->type->name != 0xae58cbe7)) { return 0; }
+ struct tl_ds_document * result = talloc0 (sizeof (*result));
+ result->magic = 0x36f8c871;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ return result;
+}
+struct tl_ds_document *fetch_ds_constructor_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x51a73418 && T->type->name != 0xae58cbe7)) { return 0; }
+ struct tl_ds_document * result = talloc0 (sizeof (*result));
+ result->magic = 0xf9a39f4f;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->mime_type = fetch_ds_type_bare_string (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->size = fetch_ds_type_bare_int (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->thumb = fetch_ds_type_photo_size (field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->dc_id = fetch_ds_type_bare_int (field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->attributes = (void *)fetch_ds_type_vector (field8);
+ return result;
+}
+struct tl_ds_document *fetch_ds_constructor_document_l19 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x51a73418 && T->type->name != 0xae58cbe7)) { return 0; }
+ struct tl_ds_document * result = talloc0 (sizeof (*result));
+ result->magic = 0x9efc6326;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->file_name = fetch_ds_type_bare_string (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->mime_type = fetch_ds_type_bare_string (field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->size = fetch_ds_type_bare_int (field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->thumb = fetch_ds_type_photo_size (field8);
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->dc_id = fetch_ds_type_bare_int (field9);
+ return result;
+}
+struct tl_ds_document_attribute *fetch_ds_constructor_document_attribute_image_size (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return 0; }
+ struct tl_ds_document_attribute * result = talloc0 (sizeof (*result));
+ result->magic = 0x6c37c15c;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->w = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->h = fetch_ds_type_bare_int (field2);
+ return result;
+}
+struct tl_ds_document_attribute *fetch_ds_constructor_document_attribute_animated (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return 0; }
+ struct tl_ds_document_attribute * result = talloc0 (sizeof (*result));
+ result->magic = 0x11b58939;
+ return result;
+}
+struct tl_ds_document_attribute *fetch_ds_constructor_document_attribute_sticker_l28 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return 0; }
+ struct tl_ds_document_attribute * result = talloc0 (sizeof (*result));
+ result->magic = 0x994c9882;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->alt = fetch_ds_type_bare_string (field1);
+ return result;
+}
+struct tl_ds_document_attribute *fetch_ds_constructor_document_attribute_sticker (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return 0; }
+ struct tl_ds_document_attribute * result = talloc0 (sizeof (*result));
+ result->magic = 0x3a556302;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->alt = fetch_ds_type_bare_string (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe44d415c, .id = "InputStickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->stickerset = fetch_ds_type_input_sticker_set (field2);
+ return result;
+}
+struct tl_ds_document_attribute *fetch_ds_constructor_document_attribute_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return 0; }
+ struct tl_ds_document_attribute * result = talloc0 (sizeof (*result));
+ result->magic = 0x5910cccb;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->duration = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->w = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->h = fetch_ds_type_bare_int (field3);
+ return result;
+}
+struct tl_ds_document_attribute *fetch_ds_constructor_document_attribute_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return 0; }
+ struct tl_ds_document_attribute * result = talloc0 (sizeof (*result));
+ result->magic = 0x051448e5;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->duration = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_document_attribute *fetch_ds_constructor_document_attribute_filename (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return 0; }
+ struct tl_ds_document_attribute * result = talloc0 (sizeof (*result));
+ result->magic = 0x15590068;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->file_name = fetch_ds_type_bare_string (field1);
+ return result;
+}
+double *fetch_ds_constructor_double (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2210c154 && T->type->name != 0xddef3eab)) { return 0; }
+ double * result = talloc0 (sizeof (*result));
+ assert (in_remaining () >= 8);
+ *result = fetch_double ();
+ return result;
+}
+struct tl_ds_encrypted_chat *fetch_ds_constructor_encrypted_chat_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return 0; }
+ struct tl_ds_encrypted_chat * result = talloc0 (sizeof (*result));
+ result->magic = 0xab7ec0a0;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_encrypted_chat *fetch_ds_constructor_encrypted_chat_waiting (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return 0; }
+ struct tl_ds_encrypted_chat * result = talloc0 (sizeof (*result));
+ result->magic = 0x3bf703dc;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->admin_id = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->participant_id = fetch_ds_type_bare_int (field5);
+ return result;
+}
+struct tl_ds_encrypted_chat *fetch_ds_constructor_encrypted_chat_requested (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return 0; }
+ struct tl_ds_encrypted_chat * result = talloc0 (sizeof (*result));
+ result->magic = 0xc878527e;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->admin_id = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->participant_id = fetch_ds_type_bare_int (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->g_a = fetch_ds_type_bare_bytes (field6);
+ return result;
+}
+struct tl_ds_encrypted_chat *fetch_ds_constructor_encrypted_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return 0; }
+ struct tl_ds_encrypted_chat * result = talloc0 (sizeof (*result));
+ result->magic = 0xfa56ce36;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->admin_id = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->participant_id = fetch_ds_type_bare_int (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->g_a_or_b = fetch_ds_type_bare_bytes (field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->key_fingerprint = fetch_ds_type_bare_long (field7);
+ return result;
+}
+struct tl_ds_encrypted_chat *fetch_ds_constructor_encrypted_chat_discarded (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return 0; }
+ struct tl_ds_encrypted_chat * result = talloc0 (sizeof (*result));
+ result->magic = 0x13d6dd27;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_encrypted_file *fetch_ds_constructor_encrypted_file_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x886fd032 && T->type->name != 0x77902fcd)) { return 0; }
+ struct tl_ds_encrypted_file * result = talloc0 (sizeof (*result));
+ result->magic = 0xc21f497e;
+ return result;
+}
+struct tl_ds_encrypted_file *fetch_ds_constructor_encrypted_file (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x886fd032 && T->type->name != 0x77902fcd)) { return 0; }
+ struct tl_ds_encrypted_file * result = talloc0 (sizeof (*result));
+ result->magic = 0x4a70994c;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->size = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->dc_id = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->key_fingerprint = fetch_ds_type_bare_int (field5);
+ return result;
+}
+struct tl_ds_encrypted_message *fetch_ds_constructor_encrypted_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xce6b8a1e && T->type->name != 0x319475e1)) { return 0; }
+ struct tl_ds_encrypted_message * result = talloc0 (sizeof (*result));
+ result->magic = 0xed18c118;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->random_id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->chat_id = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->bytes = fetch_ds_type_bare_bytes (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x886fd032, .id = "EncryptedFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->file = fetch_ds_type_encrypted_file (field5);
+ return result;
+}
+struct tl_ds_encrypted_message *fetch_ds_constructor_encrypted_message_service (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xce6b8a1e && T->type->name != 0x319475e1)) { return 0; }
+ struct tl_ds_encrypted_message * result = talloc0 (sizeof (*result));
+ result->magic = 0x23734b06;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->random_id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->chat_id = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->bytes = fetch_ds_type_bare_bytes (field4);
+ return result;
+}
+struct tl_ds_error *fetch_ds_constructor_error (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc4b9f9bb && T->type->name != 0x3b460644)) { return 0; }
+ struct tl_ds_error * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->code = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->text = fetch_ds_type_bare_string (field2);
+ return result;
+}
+struct tl_ds_exported_chat_invite *fetch_ds_constructor_chat_invite_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f132d5 && T->type->name != 0x6a0ecd2a)) { return 0; }
+ struct tl_ds_exported_chat_invite * result = talloc0 (sizeof (*result));
+ result->magic = 0x69df3769;
+ return result;
+}
+struct tl_ds_exported_chat_invite *fetch_ds_constructor_chat_invite_exported (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f132d5 && T->type->name != 0x6a0ecd2a)) { return 0; }
+ struct tl_ds_exported_chat_invite * result = talloc0 (sizeof (*result));
+ result->magic = 0xfc2e05bc;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->link = fetch_ds_type_bare_string (field1);
+ return result;
+}
+struct tl_ds_file_location *fetch_ds_constructor_file_location_unavailable (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2f8ffb30 && T->type->name != 0xd07004cf)) { return 0; }
+ struct tl_ds_file_location * result = talloc0 (sizeof (*result));
+ result->magic = 0x7c596b46;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->volume_id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->local_id = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->secret = fetch_ds_type_bare_long (field3);
+ return result;
+}
+struct tl_ds_file_location *fetch_ds_constructor_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2f8ffb30 && T->type->name != 0xd07004cf)) { return 0; }
+ struct tl_ds_file_location * result = talloc0 (sizeof (*result));
+ result->magic = 0x53d69076;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->dc_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->volume_id = fetch_ds_type_bare_long (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->local_id = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->secret = fetch_ds_type_bare_long (field4);
+ return result;
+}
+struct tl_ds_geo_chat_message *fetch_ds_constructor_geo_chat_message_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf67b4034 && T->type->name != 0x0984bfcb)) { return 0; }
+ struct tl_ds_geo_chat_message * result = talloc0 (sizeof (*result));
+ result->magic = 0x60311a9b;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->chat_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field2);
+ return result;
+}
+struct tl_ds_geo_chat_message *fetch_ds_constructor_geo_chat_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf67b4034 && T->type->name != 0x0984bfcb)) { return 0; }
+ struct tl_ds_geo_chat_message * result = talloc0 (sizeof (*result));
+ result->magic = 0x4505f8e1;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->chat_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->from_id = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->message = fetch_ds_type_bare_string (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->media = fetch_ds_type_message_media (field6);
+ return result;
+}
+struct tl_ds_geo_chat_message *fetch_ds_constructor_geo_chat_message_service (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf67b4034 && T->type->name != 0x0984bfcb)) { return 0; }
+ struct tl_ds_geo_chat_message * result = talloc0 (sizeof (*result));
+ result->magic = 0xd34fa24e;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->chat_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->from_id = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x383415fa, .id = "MessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->action = fetch_ds_type_message_action (field5);
+ return result;
+}
+struct tl_ds_geo_point *fetch_ds_constructor_geo_point_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x315e0a53 && T->type->name != 0xcea1f5ac)) { return 0; }
+ struct tl_ds_geo_point * result = talloc0 (sizeof (*result));
+ result->magic = 0x1117dd5f;
+ return result;
+}
+struct tl_ds_geo_point *fetch_ds_constructor_geo_point (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x315e0a53 && T->type->name != 0xcea1f5ac)) { return 0; }
+ struct tl_ds_geo_point * result = talloc0 (sizeof (*result));
+ result->magic = 0x2049d70c;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->longitude = fetch_ds_type_bare_double (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->latitude = fetch_ds_type_bare_double (field2);
+ return result;
+}
+struct tl_ds_imported_contact *fetch_ds_constructor_imported_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd0028438 && T->type->name != 0x2ffd7bc7)) { return 0; }
+ struct tl_ds_imported_contact * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->client_id = fetch_ds_type_bare_long (field2);
+ return result;
+}
+struct tl_ds_input_app_event *fetch_ds_constructor_input_app_event (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x770656a8 && T->type->name != 0x88f9a957)) { return 0; }
+ struct tl_ds_input_app_event * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->time = fetch_ds_type_bare_double (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->type = fetch_ds_type_bare_string (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->peer = fetch_ds_type_bare_long (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->data = fetch_ds_type_bare_string (field4);
+ return result;
+}
+struct tl_ds_input_audio *fetch_ds_constructor_input_audio_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xae8e9c7b && T->type->name != 0x51716384)) { return 0; }
+ struct tl_ds_input_audio * result = talloc0 (sizeof (*result));
+ result->magic = 0xd95adc84;
+ return result;
+}
+struct tl_ds_input_audio *fetch_ds_constructor_input_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xae8e9c7b && T->type->name != 0x51716384)) { return 0; }
+ struct tl_ds_input_audio * result = talloc0 (sizeof (*result));
+ result->magic = 0x77d440ff;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field2);
+ return result;
+}
+struct tl_ds_input_chat_photo *fetch_ds_constructor_input_chat_photo_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3a60776d && T->type->name != 0xc59f8892)) { return 0; }
+ struct tl_ds_input_chat_photo * result = talloc0 (sizeof (*result));
+ result->magic = 0x1ca48f57;
+ return result;
+}
+struct tl_ds_input_chat_photo *fetch_ds_constructor_input_chat_uploaded_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3a60776d && T->type->name != 0xc59f8892)) { return 0; }
+ struct tl_ds_input_chat_photo * result = talloc0 (sizeof (*result));
+ result->magic = 0x94254732;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->file = fetch_ds_type_input_file (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7477e321, .id = "InputPhotoCrop", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->crop = fetch_ds_type_input_photo_crop (field2);
+ return result;
+}
+struct tl_ds_input_chat_photo *fetch_ds_constructor_input_chat_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3a60776d && T->type->name != 0xc59f8892)) { return 0; }
+ struct tl_ds_input_chat_photo * result = talloc0 (sizeof (*result));
+ result->magic = 0xb2e1bf08;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe74279c9, .id = "InputPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_input_photo (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7477e321, .id = "InputPhotoCrop", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->crop = fetch_ds_type_input_photo_crop (field2);
+ return result;
+}
+struct tl_ds_input_contact *fetch_ds_constructor_input_phone_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf392b7f4 && T->type->name != 0x0c6d480b)) { return 0; }
+ struct tl_ds_input_contact * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->client_id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->phone = fetch_ds_type_bare_string (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->first_name = fetch_ds_type_bare_string (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->last_name = fetch_ds_type_bare_string (field4);
+ return result;
+}
+struct tl_ds_input_document *fetch_ds_constructor_input_document_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6a8963fc && T->type->name != 0x95769c03)) { return 0; }
+ struct tl_ds_input_document * result = talloc0 (sizeof (*result));
+ result->magic = 0x72f0eaae;
+ return result;
+}
+struct tl_ds_input_document *fetch_ds_constructor_input_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6a8963fc && T->type->name != 0x95769c03)) { return 0; }
+ struct tl_ds_input_document * result = talloc0 (sizeof (*result));
+ result->magic = 0x18798952;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field2);
+ return result;
+}
+struct tl_ds_input_encrypted_chat *fetch_ds_constructor_input_encrypted_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf141b5e1 && T->type->name != 0x0ebe4a1e)) { return 0; }
+ struct tl_ds_input_encrypted_chat * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->chat_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field2);
+ return result;
+}
+struct tl_ds_input_encrypted_file *fetch_ds_constructor_input_encrypted_file_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return 0; }
+ struct tl_ds_input_encrypted_file * result = talloc0 (sizeof (*result));
+ result->magic = 0x1837c364;
+ return result;
+}
+struct tl_ds_input_encrypted_file *fetch_ds_constructor_input_encrypted_file_uploaded (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return 0; }
+ struct tl_ds_input_encrypted_file * result = talloc0 (sizeof (*result));
+ result->magic = 0x64bd0306;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->parts = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->md5_checksum = fetch_ds_type_bare_string (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->key_fingerprint = fetch_ds_type_bare_int (field4);
+ return result;
+}
+struct tl_ds_input_encrypted_file *fetch_ds_constructor_input_encrypted_file (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return 0; }
+ struct tl_ds_input_encrypted_file * result = talloc0 (sizeof (*result));
+ result->magic = 0x5a17b5e5;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field2);
+ return result;
+}
+struct tl_ds_input_encrypted_file *fetch_ds_constructor_input_encrypted_file_big_uploaded (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return 0; }
+ struct tl_ds_input_encrypted_file * result = talloc0 (sizeof (*result));
+ result->magic = 0x2dc173c8;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->parts = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->key_fingerprint = fetch_ds_type_bare_int (field3);
+ return result;
+}
+struct tl_ds_input_file *fetch_ds_constructor_input_file (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0f60f9ca && T->type->name != 0xf09f0635)) { return 0; }
+ struct tl_ds_input_file * result = talloc0 (sizeof (*result));
+ result->magic = 0xf52ff27f;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->parts = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->name = fetch_ds_type_bare_string (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->md5_checksum = fetch_ds_type_bare_string (field4);
+ return result;
+}
+struct tl_ds_input_file *fetch_ds_constructor_input_file_big (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0f60f9ca && T->type->name != 0xf09f0635)) { return 0; }
+ struct tl_ds_input_file * result = talloc0 (sizeof (*result));
+ result->magic = 0xfa4f0bb5;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->parts = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->name = fetch_ds_type_bare_string (field3);
+ return result;
+}
+struct tl_ds_input_file_location *fetch_ds_constructor_input_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return 0; }
+ struct tl_ds_input_file_location * result = talloc0 (sizeof (*result));
+ result->magic = 0x14637196;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->volume_id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->local_id = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->secret = fetch_ds_type_bare_long (field3);
+ return result;
+}
+struct tl_ds_input_file_location *fetch_ds_constructor_input_video_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return 0; }
+ struct tl_ds_input_file_location * result = talloc0 (sizeof (*result));
+ result->magic = 0x3d0364ec;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field2);
+ return result;
+}
+struct tl_ds_input_file_location *fetch_ds_constructor_input_encrypted_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return 0; }
+ struct tl_ds_input_file_location * result = talloc0 (sizeof (*result));
+ result->magic = 0xf5235d55;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field2);
+ return result;
+}
+struct tl_ds_input_file_location *fetch_ds_constructor_input_audio_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return 0; }
+ struct tl_ds_input_file_location * result = talloc0 (sizeof (*result));
+ result->magic = 0x74dc404d;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field2);
+ return result;
+}
+struct tl_ds_input_file_location *fetch_ds_constructor_input_document_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return 0; }
+ struct tl_ds_input_file_location * result = talloc0 (sizeof (*result));
+ result->magic = 0x4e45abe9;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field2);
+ return result;
+}
+struct tl_ds_input_geo_chat *fetch_ds_constructor_input_geo_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x74d456fa && T->type->name != 0x8b2ba905)) { return 0; }
+ struct tl_ds_input_geo_chat * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->chat_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field2);
+ return result;
+}
+struct tl_ds_input_geo_point *fetch_ds_constructor_input_geo_point_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17768f1f && T->type->name != 0xe88970e0)) { return 0; }
+ struct tl_ds_input_geo_point * result = talloc0 (sizeof (*result));
+ result->magic = 0xe4c123d6;
+ return result;
+}
+struct tl_ds_input_geo_point *fetch_ds_constructor_input_geo_point (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17768f1f && T->type->name != 0xe88970e0)) { return 0; }
+ struct tl_ds_input_geo_point * result = talloc0 (sizeof (*result));
+ result->magic = 0xf3b7acc9;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->latitude = fetch_ds_type_bare_double (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->longitude = fetch_ds_type_bare_double (field2);
+ return result;
+}
+struct tl_ds_input_media *fetch_ds_constructor_input_media_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return 0; }
+ struct tl_ds_input_media * result = talloc0 (sizeof (*result));
+ result->magic = 0x9664f57f;
+ return result;
+}
+struct tl_ds_input_media *fetch_ds_constructor_input_media_uploaded_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return 0; }
+ struct tl_ds_input_media * result = talloc0 (sizeof (*result));
+ result->magic = 0xf7aff1c0;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->file = fetch_ds_type_input_file (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->caption = fetch_ds_type_bare_string (field2);
+ return result;
+}
+struct tl_ds_input_media *fetch_ds_constructor_input_media_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return 0; }
+ struct tl_ds_input_media * result = talloc0 (sizeof (*result));
+ result->magic = 0xe9bfb4f3;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe74279c9, .id = "InputPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_input_photo (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->caption = fetch_ds_type_bare_string (field2);
+ return result;
+}
+struct tl_ds_input_media *fetch_ds_constructor_input_media_geo_point (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return 0; }
+ struct tl_ds_input_media * result = talloc0 (sizeof (*result));
+ result->magic = 0xf9c44144;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17768f1f, .id = "InputGeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->geo_point = fetch_ds_type_input_geo_point (field1);
+ return result;
+}
+struct tl_ds_input_media *fetch_ds_constructor_input_media_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return 0; }
+ struct tl_ds_input_media * result = talloc0 (sizeof (*result));
+ result->magic = 0xa6e45987;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->phone_number = fetch_ds_type_bare_string (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->first_name = fetch_ds_type_bare_string (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->last_name = fetch_ds_type_bare_string (field3);
+ return result;
+}
+struct tl_ds_input_media *fetch_ds_constructor_input_media_uploaded_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return 0; }
+ struct tl_ds_input_media * result = talloc0 (sizeof (*result));
+ result->magic = 0xe13fd4bc;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->file = fetch_ds_type_input_file (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->duration = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->w = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->h = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->caption = fetch_ds_type_bare_string (field5);
+ return result;
+}
+struct tl_ds_input_media *fetch_ds_constructor_input_media_uploaded_thumb_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return 0; }
+ struct tl_ds_input_media * result = talloc0 (sizeof (*result));
+ result->magic = 0x96fb97dc;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->file = fetch_ds_type_input_file (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->thumb = fetch_ds_type_input_file (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->duration = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->w = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->h = fetch_ds_type_bare_int (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->caption = fetch_ds_type_bare_string (field6);
+ return result;
+}
+struct tl_ds_input_media *fetch_ds_constructor_input_media_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return 0; }
+ struct tl_ds_input_media * result = talloc0 (sizeof (*result));
+ result->magic = 0x936a4ebd;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xbb5f7a27, .id = "InputVideo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->video_id = fetch_ds_type_input_video (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->caption = fetch_ds_type_bare_string (field2);
+ return result;
+}
+struct tl_ds_input_media *fetch_ds_constructor_input_media_uploaded_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return 0; }
+ struct tl_ds_input_media * result = talloc0 (sizeof (*result));
+ result->magic = 0x4e498cab;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->file = fetch_ds_type_input_file (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->duration = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->mime_type = fetch_ds_type_bare_string (field3);
+ return result;
+}
+struct tl_ds_input_media *fetch_ds_constructor_input_media_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return 0; }
+ struct tl_ds_input_media * result = talloc0 (sizeof (*result));
+ result->magic = 0x89938781;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xae8e9c7b, .id = "InputAudio", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->audio_id = fetch_ds_type_input_audio (field1);
+ return result;
+}
+struct tl_ds_input_media *fetch_ds_constructor_input_media_uploaded_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return 0; }
+ struct tl_ds_input_media * result = talloc0 (sizeof (*result));
+ result->magic = 0xffe76b78;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->file = fetch_ds_type_input_file (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->mime_type = fetch_ds_type_bare_string (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->attributes = (void *)fetch_ds_type_vector (field3);
+ return result;
+}
+struct tl_ds_input_media *fetch_ds_constructor_input_media_uploaded_thumb_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return 0; }
+ struct tl_ds_input_media * result = talloc0 (sizeof (*result));
+ result->magic = 0x41481486;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->file = fetch_ds_type_input_file (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->thumb = fetch_ds_type_input_file (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->mime_type = fetch_ds_type_bare_string (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->attributes = (void *)fetch_ds_type_vector (field4);
+ return result;
+}
+struct tl_ds_input_media *fetch_ds_constructor_input_media_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return 0; }
+ struct tl_ds_input_media * result = talloc0 (sizeof (*result));
+ result->magic = 0xd184e841;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x6a8963fc, .id = "InputDocument", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->document_id = fetch_ds_type_input_document (field1);
+ return result;
+}
+struct tl_ds_input_media *fetch_ds_constructor_input_media_venue (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return 0; }
+ struct tl_ds_input_media * result = talloc0 (sizeof (*result));
+ result->magic = 0x2827a81a;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17768f1f, .id = "InputGeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->geo_point = fetch_ds_type_input_geo_point (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->title = fetch_ds_type_bare_string (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->address = fetch_ds_type_bare_string (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->provider = fetch_ds_type_bare_string (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->venue_id = fetch_ds_type_bare_string (field5);
+ return result;
+}
+struct tl_ds_input_notify_peer *fetch_ds_constructor_input_notify_peer (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return 0; }
+ struct tl_ds_input_notify_peer * result = talloc0 (sizeof (*result));
+ result->magic = 0xb8bc5b0c;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9e67268d, .id = "InputPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->peer = fetch_ds_type_input_peer (field1);
+ return result;
+}
+struct tl_ds_input_notify_peer *fetch_ds_constructor_input_notify_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return 0; }
+ struct tl_ds_input_notify_peer * result = talloc0 (sizeof (*result));
+ result->magic = 0x193b4417;
+ return result;
+}
+struct tl_ds_input_notify_peer *fetch_ds_constructor_input_notify_chats (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return 0; }
+ struct tl_ds_input_notify_peer * result = talloc0 (sizeof (*result));
+ result->magic = 0x4a95e84e;
+ return result;
+}
+struct tl_ds_input_notify_peer *fetch_ds_constructor_input_notify_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return 0; }
+ struct tl_ds_input_notify_peer * result = talloc0 (sizeof (*result));
+ result->magic = 0xa429b886;
+ return result;
+}
+struct tl_ds_input_notify_peer *fetch_ds_constructor_input_notify_geo_chat_peer (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return 0; }
+ struct tl_ds_input_notify_peer * result = talloc0 (sizeof (*result));
+ result->magic = 0x4d8ddec8;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x74d456fa, .id = "InputGeoChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->geo_peer = fetch_ds_type_input_geo_chat (field1);
+ return result;
+}
+struct tl_ds_input_peer *fetch_ds_constructor_input_peer_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return 0; }
+ struct tl_ds_input_peer * result = talloc0 (sizeof (*result));
+ result->magic = 0x7f3b18ea;
+ return result;
+}
+struct tl_ds_input_peer *fetch_ds_constructor_input_peer_self (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return 0; }
+ struct tl_ds_input_peer * result = talloc0 (sizeof (*result));
+ result->magic = 0x7da07ec9;
+ return result;
+}
+struct tl_ds_input_peer *fetch_ds_constructor_input_peer_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return 0; }
+ struct tl_ds_input_peer * result = talloc0 (sizeof (*result));
+ result->magic = 0x1023dbe8;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_input_peer *fetch_ds_constructor_input_peer_foreign (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return 0; }
+ struct tl_ds_input_peer * result = talloc0 (sizeof (*result));
+ result->magic = 0x9b447325;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field2);
+ return result;
+}
+struct tl_ds_input_peer *fetch_ds_constructor_input_peer_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return 0; }
+ struct tl_ds_input_peer * result = talloc0 (sizeof (*result));
+ result->magic = 0x179be863;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->chat_id = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_input_peer_notify_events *fetch_ds_constructor_input_peer_notify_events_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x185a48ac && T->type->name != 0xe7a5b753)) { return 0; }
+ struct tl_ds_input_peer_notify_events * result = talloc0 (sizeof (*result));
+ result->magic = 0xf03064d8;
+ return result;
+}
+struct tl_ds_input_peer_notify_events *fetch_ds_constructor_input_peer_notify_events_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x185a48ac && T->type->name != 0xe7a5b753)) { return 0; }
+ struct tl_ds_input_peer_notify_events * result = talloc0 (sizeof (*result));
+ result->magic = 0xe86a2c74;
+ return result;
+}
+struct tl_ds_input_peer_notify_settings *fetch_ds_constructor_input_peer_notify_settings (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x46a2ce98 && T->type->name != 0xb95d3167)) { return 0; }
+ struct tl_ds_input_peer_notify_settings * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->mute_until = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->sound = fetch_ds_type_bare_string (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->show_previews = fetch_ds_type_bool (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->events_mask = fetch_ds_type_bare_int (field4);
+ return result;
+}
+struct tl_ds_input_photo *fetch_ds_constructor_input_photo_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe74279c9 && T->type->name != 0x18bd8636)) { return 0; }
+ struct tl_ds_input_photo * result = talloc0 (sizeof (*result));
+ result->magic = 0x1cd7bf0d;
+ return result;
+}
+struct tl_ds_input_photo *fetch_ds_constructor_input_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe74279c9 && T->type->name != 0x18bd8636)) { return 0; }
+ struct tl_ds_input_photo * result = talloc0 (sizeof (*result));
+ result->magic = 0xfb95c6c4;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field2);
+ return result;
+}
+struct tl_ds_input_photo_crop *fetch_ds_constructor_input_photo_crop_auto (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7477e321 && T->type->name != 0x8b881cde)) { return 0; }
+ struct tl_ds_input_photo_crop * result = talloc0 (sizeof (*result));
+ result->magic = 0xade6b004;
+ return result;
+}
+struct tl_ds_input_photo_crop *fetch_ds_constructor_input_photo_crop (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7477e321 && T->type->name != 0x8b881cde)) { return 0; }
+ struct tl_ds_input_photo_crop * result = talloc0 (sizeof (*result));
+ result->magic = 0xd9915325;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->crop_left = fetch_ds_type_bare_double (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->crop_top = fetch_ds_type_bare_double (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->crop_width = fetch_ds_type_bare_double (field3);
+ return result;
+}
+struct tl_ds_input_privacy_key *fetch_ds_constructor_input_privacy_key_status_timestamp (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4f96cb18 && T->type->name != 0xb06934e7)) { return 0; }
+ struct tl_ds_input_privacy_key * result = talloc0 (sizeof (*result));
+ return result;
+}
+struct tl_ds_input_privacy_rule *fetch_ds_constructor_input_privacy_value_allow_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return 0; }
+ struct tl_ds_input_privacy_rule * result = talloc0 (sizeof (*result));
+ result->magic = 0x0d09e07b;
+ return result;
+}
+struct tl_ds_input_privacy_rule *fetch_ds_constructor_input_privacy_value_allow_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return 0; }
+ struct tl_ds_input_privacy_rule * result = talloc0 (sizeof (*result));
+ result->magic = 0x184b35ce;
+ return result;
+}
+struct tl_ds_input_privacy_rule *fetch_ds_constructor_input_privacy_value_allow_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return 0; }
+ struct tl_ds_input_privacy_rule * result = talloc0 (sizeof (*result));
+ result->magic = 0x131cc67f;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->users = (void *)fetch_ds_type_vector (field1);
+ return result;
+}
+struct tl_ds_input_privacy_rule *fetch_ds_constructor_input_privacy_value_disallow_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return 0; }
+ struct tl_ds_input_privacy_rule * result = talloc0 (sizeof (*result));
+ result->magic = 0x0ba52007;
+ return result;
+}
+struct tl_ds_input_privacy_rule *fetch_ds_constructor_input_privacy_value_disallow_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return 0; }
+ struct tl_ds_input_privacy_rule * result = talloc0 (sizeof (*result));
+ result->magic = 0xd66b66c9;
+ return result;
+}
+struct tl_ds_input_privacy_rule *fetch_ds_constructor_input_privacy_value_disallow_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return 0; }
+ struct tl_ds_input_privacy_rule * result = talloc0 (sizeof (*result));
+ result->magic = 0x90110467;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->users = (void *)fetch_ds_type_vector (field1);
+ return result;
+}
+struct tl_ds_input_sticker_set *fetch_ds_constructor_input_sticker_set_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe44d415c && T->type->name != 0x1bb2bea3)) { return 0; }
+ struct tl_ds_input_sticker_set * result = talloc0 (sizeof (*result));
+ result->magic = 0xffb62b95;
+ return result;
+}
+struct tl_ds_input_sticker_set *fetch_ds_constructor_input_sticker_set_i_d (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe44d415c && T->type->name != 0x1bb2bea3)) { return 0; }
+ struct tl_ds_input_sticker_set * result = talloc0 (sizeof (*result));
+ result->magic = 0x9de7a269;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field2);
+ return result;
+}
+struct tl_ds_input_sticker_set *fetch_ds_constructor_input_sticker_set_short_name (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe44d415c && T->type->name != 0x1bb2bea3)) { return 0; }
+ struct tl_ds_input_sticker_set * result = talloc0 (sizeof (*result));
+ result->magic = 0x861cc8a0;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->short_name = fetch_ds_type_bare_string (field1);
+ return result;
+}
+struct tl_ds_input_user *fetch_ds_constructor_input_user_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return 0; }
+ struct tl_ds_input_user * result = talloc0 (sizeof (*result));
+ result->magic = 0xb98886cf;
+ return result;
+}
+struct tl_ds_input_user *fetch_ds_constructor_input_user_self (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return 0; }
+ struct tl_ds_input_user * result = talloc0 (sizeof (*result));
+ result->magic = 0xf7c1b13f;
+ return result;
+}
+struct tl_ds_input_user *fetch_ds_constructor_input_user_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return 0; }
+ struct tl_ds_input_user * result = talloc0 (sizeof (*result));
+ result->magic = 0x86e94f65;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_input_user *fetch_ds_constructor_input_user_foreign (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return 0; }
+ struct tl_ds_input_user * result = talloc0 (sizeof (*result));
+ result->magic = 0x655e74ff;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field2);
+ return result;
+}
+struct tl_ds_input_video *fetch_ds_constructor_input_video_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbb5f7a27 && T->type->name != 0x44a085d8)) { return 0; }
+ struct tl_ds_input_video * result = talloc0 (sizeof (*result));
+ result->magic = 0x5508ec75;
+ return result;
+}
+struct tl_ds_input_video *fetch_ds_constructor_input_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbb5f7a27 && T->type->name != 0x44a085d8)) { return 0; }
+ struct tl_ds_input_video * result = talloc0 (sizeof (*result));
+ result->magic = 0xee579652;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field2);
+ return result;
+}
+int *fetch_ds_constructor_int (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8509bda && T->type->name != 0x57af6425)) { return 0; }
+ int * result = talloc0 (sizeof (*result));
+ assert (in_remaining () >= 4);
+ *result = fetch_int ();
+ return result;
+}
+struct tl_ds_int128 *fetch_ds_constructor_int128 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7d36c439 && T->type->name != 0x82c93bc6)) { return 0; }
+ struct tl_ds_int128 * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->f0 = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->f1 = fetch_ds_type_bare_long (field2);
+ return result;
+}
+struct tl_ds_int256 *fetch_ds_constructor_int256 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf2c798b3 && T->type->name != 0x0d38674c)) { return 0; }
+ struct tl_ds_int256 * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->f0 = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->f1 = fetch_ds_type_bare_long (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->f2 = fetch_ds_type_bare_long (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->f3 = fetch_ds_type_bare_long (field4);
+ return result;
+}
+struct tl_ds_keyboard_button *fetch_ds_constructor_keyboard_button (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa2fa4880 && T->type->name != 0x5d05b77f)) { return 0; }
+ struct tl_ds_keyboard_button * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->text = fetch_ds_type_bare_string (field1);
+ return result;
+}
+struct tl_ds_keyboard_button_row *fetch_ds_constructor_keyboard_button_row (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x77608b83 && T->type->name != 0x889f747c)) { return 0; }
+ struct tl_ds_keyboard_button_row * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa2fa4880, .id = "KeyboardButton", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->buttons = (void *)fetch_ds_type_vector (field1);
+ return result;
+}
+long long *fetch_ds_constructor_long (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22076cba && T->type->name != 0xddf89345)) { return 0; }
+ long long * result = talloc0 (sizeof (*result));
+ assert (in_remaining () >= 8);
+ *result = fetch_long ();
+ return result;
+}
+struct tl_ds_message *fetch_ds_constructor_message_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5d652a7f && T->type->name != 0xa29ad580)) { return 0; }
+ struct tl_ds_message * result = talloc0 (sizeof (*result));
+ result->magic = 0x83e5de54;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_message *fetch_ds_constructor_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5d652a7f && T->type->name != 0xa29ad580)) { return 0; }
+ struct tl_ds_message * result = talloc0 (sizeof (*result));
+ result->magic = 0xc3060325;
+ assert (in_remaining () >= 4);
+ result->flags = talloc (4); *result->flags = prefetch_int (); struct paramed_type *var0 = INT2PTR (fetch_int ());
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->from_id = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->to_id = fetch_ds_type_peer (field4);
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->fwd_from_id = fetch_ds_type_bare_int (field5);
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->fwd_date = fetch_ds_type_bare_int (field6);
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->reply_to_msg_id = fetch_ds_type_bare_int (field7);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field8);
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->message = fetch_ds_type_bare_string (field9);
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->media = fetch_ds_type_message_media (field10);
+ if (PTR2INT (var0) & (1 << 6)) {
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x612ca4a9, .id = "ReplyMarkup", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->reply_markup = fetch_ds_type_reply_markup (field11);
+ }
+ return result;
+}
+struct tl_ds_message *fetch_ds_constructor_message_service (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5d652a7f && T->type->name != 0xa29ad580)) { return 0; }
+ struct tl_ds_message * result = talloc0 (sizeof (*result));
+ result->magic = 0x1d86f70e;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->flags = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->from_id = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->to_id = fetch_ds_type_peer (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x383415fa, .id = "MessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->action = fetch_ds_type_message_action (field6);
+ return result;
+}
+struct tl_ds_message_action *fetch_ds_constructor_message_action_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return 0; }
+ struct tl_ds_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0xb6aef7b0;
+ return result;
+}
+struct tl_ds_message_action *fetch_ds_constructor_message_action_chat_create (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return 0; }
+ struct tl_ds_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0xa6638b9a;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->title = fetch_ds_type_bare_string (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->users = (void *)fetch_ds_type_vector (field2);
+ return result;
+}
+struct tl_ds_message_action *fetch_ds_constructor_message_action_chat_edit_title (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return 0; }
+ struct tl_ds_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0xb5a1ce5a;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->title = fetch_ds_type_bare_string (field1);
+ return result;
+}
+struct tl_ds_message_action *fetch_ds_constructor_message_action_chat_edit_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return 0; }
+ struct tl_ds_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0x7fcb13a8;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->photo = fetch_ds_type_photo (field1);
+ return result;
+}
+struct tl_ds_message_action *fetch_ds_constructor_message_action_chat_delete_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return 0; }
+ struct tl_ds_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0x95e3fbef;
+ return result;
+}
+struct tl_ds_message_action *fetch_ds_constructor_message_action_chat_add_user (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return 0; }
+ struct tl_ds_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0x5e3cfc4b;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_message_action *fetch_ds_constructor_message_action_chat_delete_user (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return 0; }
+ struct tl_ds_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0xb2ae9b0c;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_message_action *fetch_ds_constructor_message_action_geo_chat_create (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return 0; }
+ struct tl_ds_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0x6f038ebc;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->title = fetch_ds_type_bare_string (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->address = fetch_ds_type_bare_string (field2);
+ return result;
+}
+struct tl_ds_message_action *fetch_ds_constructor_message_action_geo_chat_checkin (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return 0; }
+ struct tl_ds_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0x0c7d53de;
+ return result;
+}
+struct tl_ds_message_action *fetch_ds_constructor_message_action_chat_joined_by_link (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return 0; }
+ struct tl_ds_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0xf89cf5e8;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->inviter_id = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_message_media *fetch_ds_constructor_message_media_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return 0; }
+ struct tl_ds_message_media * result = talloc0 (sizeof (*result));
+ result->magic = 0x3ded6320;
+ return result;
+}
+struct tl_ds_message_media *fetch_ds_constructor_message_media_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return 0; }
+ struct tl_ds_message_media * result = talloc0 (sizeof (*result));
+ result->magic = 0x3d8ce53d;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->photo = fetch_ds_type_photo (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->caption = fetch_ds_type_bare_string (field2);
+ return result;
+}
+struct tl_ds_message_media *fetch_ds_constructor_message_media_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return 0; }
+ struct tl_ds_message_media * result = talloc0 (sizeof (*result));
+ result->magic = 0x5bcf1675;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1716b174, .id = "Video", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->video = fetch_ds_type_video (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->caption = fetch_ds_type_bare_string (field2);
+ return result;
+}
+struct tl_ds_message_media *fetch_ds_constructor_message_media_geo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return 0; }
+ struct tl_ds_message_media * result = talloc0 (sizeof (*result));
+ result->magic = 0x56e0d474;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->geo = fetch_ds_type_geo_point (field1);
+ return result;
+}
+struct tl_ds_message_media *fetch_ds_constructor_message_media_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return 0; }
+ struct tl_ds_message_media * result = talloc0 (sizeof (*result));
+ result->magic = 0x5e7d2f39;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->phone_number = fetch_ds_type_bare_string (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->first_name = fetch_ds_type_bare_string (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->last_name = fetch_ds_type_bare_string (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field4);
+ return result;
+}
+struct tl_ds_message_media *fetch_ds_constructor_message_media_unsupported (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return 0; }
+ struct tl_ds_message_media * result = talloc0 (sizeof (*result));
+ result->magic = 0x9f84f49e;
+ return result;
+}
+struct tl_ds_message_media *fetch_ds_constructor_message_media_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return 0; }
+ struct tl_ds_message_media * result = talloc0 (sizeof (*result));
+ result->magic = 0x2fda2204;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->document = fetch_ds_type_document (field1);
+ return result;
+}
+struct tl_ds_message_media *fetch_ds_constructor_message_media_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return 0; }
+ struct tl_ds_message_media * result = talloc0 (sizeof (*result));
+ result->magic = 0xc6b68300;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9fc5ec4e, .id = "Audio", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->audio = fetch_ds_type_audio (field1);
+ return result;
+}
+struct tl_ds_message_media *fetch_ds_constructor_message_media_web_page (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return 0; }
+ struct tl_ds_message_media * result = talloc0 (sizeof (*result));
+ result->magic = 0xa32dd600;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x8d8c0d41, .id = "WebPage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->webpage = fetch_ds_type_web_page (field1);
+ return result;
+}
+struct tl_ds_message_media *fetch_ds_constructor_message_media_venue (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return 0; }
+ struct tl_ds_message_media * result = talloc0 (sizeof (*result));
+ result->magic = 0x7912b71f;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->geo = fetch_ds_type_geo_point (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->title = fetch_ds_type_bare_string (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->address = fetch_ds_type_bare_string (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->provider = fetch_ds_type_bare_string (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->venue_id = fetch_ds_type_bare_string (field5);
+ return result;
+}
+struct tl_ds_message_media *fetch_ds_constructor_message_media_photo_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return 0; }
+ struct tl_ds_message_media * result = talloc0 (sizeof (*result));
+ result->magic = 0xc8c45a2a;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->photo = fetch_ds_type_photo (field1);
+ return result;
+}
+struct tl_ds_message_media *fetch_ds_constructor_message_media_video_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return 0; }
+ struct tl_ds_message_media * result = talloc0 (sizeof (*result));
+ result->magic = 0xa2d24290;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1716b174, .id = "Video", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->video = fetch_ds_type_video (field1);
+ return result;
+}
+struct tl_ds_messages_filter *fetch_ds_constructor_input_messages_filter_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return 0; }
+ struct tl_ds_messages_filter * result = talloc0 (sizeof (*result));
+ result->magic = 0x57e2f66c;
+ return result;
+}
+struct tl_ds_messages_filter *fetch_ds_constructor_input_messages_filter_photos (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return 0; }
+ struct tl_ds_messages_filter * result = talloc0 (sizeof (*result));
+ result->magic = 0x9609a51c;
+ return result;
+}
+struct tl_ds_messages_filter *fetch_ds_constructor_input_messages_filter_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return 0; }
+ struct tl_ds_messages_filter * result = talloc0 (sizeof (*result));
+ result->magic = 0x9fc00e65;
+ return result;
+}
+struct tl_ds_messages_filter *fetch_ds_constructor_input_messages_filter_photo_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return 0; }
+ struct tl_ds_messages_filter * result = talloc0 (sizeof (*result));
+ result->magic = 0x56e9f0e4;
+ return result;
+}
+struct tl_ds_messages_filter *fetch_ds_constructor_input_messages_filter_photo_video_documents (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return 0; }
+ struct tl_ds_messages_filter * result = talloc0 (sizeof (*result));
+ result->magic = 0xd95e73bb;
+ return result;
+}
+struct tl_ds_messages_filter *fetch_ds_constructor_input_messages_filter_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return 0; }
+ struct tl_ds_messages_filter * result = talloc0 (sizeof (*result));
+ result->magic = 0x9eddf188;
+ return result;
+}
+struct tl_ds_messages_filter *fetch_ds_constructor_input_messages_filter_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return 0; }
+ struct tl_ds_messages_filter * result = talloc0 (sizeof (*result));
+ result->magic = 0xcfc87522;
+ return result;
+}
+struct tl_ds_nearest_dc *fetch_ds_constructor_nearest_dc (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8e1a1775 && T->type->name != 0x71e5e88a)) { return 0; }
+ struct tl_ds_nearest_dc * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->country = fetch_ds_type_bare_string (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->this_dc = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->nearest_dc = fetch_ds_type_bare_int (field3);
+ return result;
+}
+struct tl_ds_notify_peer *fetch_ds_constructor_notify_peer (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return 0; }
+ struct tl_ds_notify_peer * result = talloc0 (sizeof (*result));
+ result->magic = 0x9fd40bd8;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->peer = fetch_ds_type_peer (field1);
+ return result;
+}
+struct tl_ds_notify_peer *fetch_ds_constructor_notify_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return 0; }
+ struct tl_ds_notify_peer * result = talloc0 (sizeof (*result));
+ result->magic = 0xb4c83b4c;
+ return result;
+}
+struct tl_ds_notify_peer *fetch_ds_constructor_notify_chats (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return 0; }
+ struct tl_ds_notify_peer * result = talloc0 (sizeof (*result));
+ result->magic = 0xc007cec3;
+ return result;
+}
+struct tl_ds_notify_peer *fetch_ds_constructor_notify_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return 0; }
+ struct tl_ds_notify_peer * result = talloc0 (sizeof (*result));
+ result->magic = 0x74d07c60;
+ return result;
+}
+struct tl_ds_null *fetch_ds_constructor_null (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x56730bcc && T->type->name != 0xa98cf433)) { return 0; }
+ struct tl_ds_null * result = talloc0 (sizeof (*result));
+ return result;
+}
+struct tl_ds_p_q_inner_data *fetch_ds_constructor_p_q_inner_data (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbfa3de38 && T->type->name != 0x405c21c7)) { return 0; }
+ struct tl_ds_p_q_inner_data * result = talloc0 (sizeof (*result));
+ result->magic = 0x83c95aec;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pq = fetch_ds_type_bare_string (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->p = fetch_ds_type_bare_string (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->q = fetch_ds_type_bare_string (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->nonce = fetch_ds_type_bare_int128 (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->server_nonce = fetch_ds_type_bare_int128 (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0d38674c, .id = "Bare_Int256", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->new_nonce = fetch_ds_type_bare_int256 (field6);
+ return result;
+}
+struct tl_ds_p_q_inner_data *fetch_ds_constructor_p_q_inner_data_temp (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbfa3de38 && T->type->name != 0x405c21c7)) { return 0; }
+ struct tl_ds_p_q_inner_data * result = talloc0 (sizeof (*result));
+ result->magic = 0x3c6a84d4;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pq = fetch_ds_type_bare_string (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->p = fetch_ds_type_bare_string (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->q = fetch_ds_type_bare_string (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->nonce = fetch_ds_type_bare_int128 (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->server_nonce = fetch_ds_type_bare_int128 (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0d38674c, .id = "Bare_Int256", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->new_nonce = fetch_ds_type_bare_int256 (field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->expires_in = fetch_ds_type_bare_int (field7);
+ return result;
+}
+struct tl_ds_peer *fetch_ds_constructor_peer_user (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x276159d6 && T->type->name != 0xd89ea629)) { return 0; }
+ struct tl_ds_peer * result = talloc0 (sizeof (*result));
+ result->magic = 0x9db1bc6d;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_peer *fetch_ds_constructor_peer_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x276159d6 && T->type->name != 0xd89ea629)) { return 0; }
+ struct tl_ds_peer * result = talloc0 (sizeof (*result));
+ result->magic = 0xbad0e5bb;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->chat_id = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_peer_notify_events *fetch_ds_constructor_peer_notify_events_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc0c8d13b && T->type->name != 0x3f372ec4)) { return 0; }
+ struct tl_ds_peer_notify_events * result = talloc0 (sizeof (*result));
+ result->magic = 0xadd53cb3;
+ return result;
+}
+struct tl_ds_peer_notify_events *fetch_ds_constructor_peer_notify_events_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc0c8d13b && T->type->name != 0x3f372ec4)) { return 0; }
+ struct tl_ds_peer_notify_events * result = talloc0 (sizeof (*result));
+ result->magic = 0x6d1ded88;
+ return result;
+}
+struct tl_ds_peer_notify_settings *fetch_ds_constructor_peer_notify_settings_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xfdf894fc && T->type->name != 0x02076b03)) { return 0; }
+ struct tl_ds_peer_notify_settings * result = talloc0 (sizeof (*result));
+ result->magic = 0x70a68512;
+ return result;
+}
+struct tl_ds_peer_notify_settings *fetch_ds_constructor_peer_notify_settings (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xfdf894fc && T->type->name != 0x02076b03)) { return 0; }
+ struct tl_ds_peer_notify_settings * result = talloc0 (sizeof (*result));
+ result->magic = 0x8d5e11ee;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->mute_until = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->sound = fetch_ds_type_bare_string (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->show_previews = fetch_ds_type_bool (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->events_mask = fetch_ds_type_bare_int (field4);
+ return result;
+}
+struct tl_ds_photo *fetch_ds_constructor_photo_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc207550a && T->type->name != 0x3df8aaf5)) { return 0; }
+ struct tl_ds_photo * result = talloc0 (sizeof (*result));
+ result->magic = 0x2331b22d;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ return result;
+}
+struct tl_ds_photo *fetch_ds_constructor_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc207550a && T->type->name != 0x3df8aaf5)) { return 0; }
+ struct tl_ds_photo * result = talloc0 (sizeof (*result));
+ result->magic = 0xc3838076;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->geo = fetch_ds_type_geo_point (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->sizes = (void *)fetch_ds_type_vector (field6);
+ return result;
+}
+struct tl_ds_photo *fetch_ds_constructor_photo_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc207550a && T->type->name != 0x3df8aaf5)) { return 0; }
+ struct tl_ds_photo * result = talloc0 (sizeof (*result));
+ result->magic = 0x22b56751;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->caption = fetch_ds_type_bare_string (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->geo = fetch_ds_type_geo_point (field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->sizes = (void *)fetch_ds_type_vector (field7);
+ return result;
+}
+struct tl_ds_photo_size *fetch_ds_constructor_photo_size_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x900f60dd && T->type->name != 0x6ff09f22)) { return 0; }
+ struct tl_ds_photo_size * result = talloc0 (sizeof (*result));
+ result->magic = 0x0e17e23c;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->type = fetch_ds_type_bare_string (field1);
+ return result;
+}
+struct tl_ds_photo_size *fetch_ds_constructor_photo_size (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x900f60dd && T->type->name != 0x6ff09f22)) { return 0; }
+ struct tl_ds_photo_size * result = talloc0 (sizeof (*result));
+ result->magic = 0x77bfb61b;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->type = fetch_ds_type_bare_string (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->location = fetch_ds_type_file_location (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->w = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->h = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->size = fetch_ds_type_bare_int (field5);
+ return result;
+}
+struct tl_ds_photo_size *fetch_ds_constructor_photo_cached_size (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x900f60dd && T->type->name != 0x6ff09f22)) { return 0; }
+ struct tl_ds_photo_size * result = talloc0 (sizeof (*result));
+ result->magic = 0xe9a734fa;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->type = fetch_ds_type_bare_string (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->location = fetch_ds_type_file_location (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->w = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->h = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->bytes = fetch_ds_type_bare_bytes (field5);
+ return result;
+}
+struct tl_ds_privacy_key *fetch_ds_constructor_privacy_key_status_timestamp (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbc2eab30 && T->type->name != 0x43d154cf)) { return 0; }
+ struct tl_ds_privacy_key * result = talloc0 (sizeof (*result));
+ return result;
+}
+struct tl_ds_privacy_rule *fetch_ds_constructor_privacy_value_allow_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return 0; }
+ struct tl_ds_privacy_rule * result = talloc0 (sizeof (*result));
+ result->magic = 0xfffe1bac;
+ return result;
+}
+struct tl_ds_privacy_rule *fetch_ds_constructor_privacy_value_allow_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return 0; }
+ struct tl_ds_privacy_rule * result = talloc0 (sizeof (*result));
+ result->magic = 0x65427b82;
+ return result;
+}
+struct tl_ds_privacy_rule *fetch_ds_constructor_privacy_value_allow_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return 0; }
+ struct tl_ds_privacy_rule * result = talloc0 (sizeof (*result));
+ result->magic = 0x4d5bbe0c;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->users = (void *)fetch_ds_type_vector (field1);
+ return result;
+}
+struct tl_ds_privacy_rule *fetch_ds_constructor_privacy_value_disallow_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return 0; }
+ struct tl_ds_privacy_rule * result = talloc0 (sizeof (*result));
+ result->magic = 0xf888fa1a;
+ return result;
+}
+struct tl_ds_privacy_rule *fetch_ds_constructor_privacy_value_disallow_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return 0; }
+ struct tl_ds_privacy_rule * result = talloc0 (sizeof (*result));
+ result->magic = 0x8b73e763;
+ return result;
+}
+struct tl_ds_privacy_rule *fetch_ds_constructor_privacy_value_disallow_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return 0; }
+ struct tl_ds_privacy_rule * result = talloc0 (sizeof (*result));
+ result->magic = 0x0c7f49b7;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->users = (void *)fetch_ds_type_vector (field1);
+ return result;
+}
+struct tl_ds_received_notify_message *fetch_ds_constructor_received_notify_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa384b779 && T->type->name != 0x5c7b4886)) { return 0; }
+ struct tl_ds_received_notify_message * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->flags = fetch_ds_type_bare_int (field2);
+ return result;
+}
+struct tl_ds_reply_markup *fetch_ds_constructor_reply_keyboard_hide (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x612ca4a9 && T->type->name != 0x9ed35b56)) { return 0; }
+ struct tl_ds_reply_markup * result = talloc0 (sizeof (*result));
+ result->magic = 0xa03e5b85;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->flags = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_reply_markup *fetch_ds_constructor_reply_keyboard_force_reply (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x612ca4a9 && T->type->name != 0x9ed35b56)) { return 0; }
+ struct tl_ds_reply_markup * result = talloc0 (sizeof (*result));
+ result->magic = 0xf4108aa0;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->flags = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_reply_markup *fetch_ds_constructor_reply_keyboard_markup (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x612ca4a9 && T->type->name != 0x9ed35b56)) { return 0; }
+ struct tl_ds_reply_markup * result = talloc0 (sizeof (*result));
+ result->magic = 0x3502758c;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->flags = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x77608b83, .id = "KeyboardButtonRow", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->rows = (void *)fetch_ds_type_vector (field2);
+ return result;
+}
+struct tl_ds_res_p_q *fetch_ds_constructor_res_p_q (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x05162463 && T->type->name != 0xfae9db9c)) { return 0; }
+ struct tl_ds_res_p_q * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->nonce = fetch_ds_type_bare_int128 (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->server_nonce = fetch_ds_type_bare_int128 (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pq = fetch_ds_type_bare_string (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->server_public_key_fingerprints = (void *)fetch_ds_type_vector (field4);
+ return result;
+}
+struct tl_ds_send_message_action *fetch_ds_constructor_send_message_typing_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return 0; }
+ struct tl_ds_send_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0x16bf744e;
+ return result;
+}
+struct tl_ds_send_message_action *fetch_ds_constructor_send_message_cancel_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return 0; }
+ struct tl_ds_send_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0xfd5ec8f5;
+ return result;
+}
+struct tl_ds_send_message_action *fetch_ds_constructor_send_message_record_video_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return 0; }
+ struct tl_ds_send_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0xa187d66f;
+ return result;
+}
+struct tl_ds_send_message_action *fetch_ds_constructor_send_message_upload_video_action_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return 0; }
+ struct tl_ds_send_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0x92042ff7;
+ return result;
+}
+struct tl_ds_send_message_action *fetch_ds_constructor_send_message_upload_video_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return 0; }
+ struct tl_ds_send_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0xe9763aec;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->progress = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_send_message_action *fetch_ds_constructor_send_message_record_audio_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return 0; }
+ struct tl_ds_send_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0xd52f73f7;
+ return result;
+}
+struct tl_ds_send_message_action *fetch_ds_constructor_send_message_upload_audio_action_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return 0; }
+ struct tl_ds_send_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0xe6ac8a6f;
+ return result;
+}
+struct tl_ds_send_message_action *fetch_ds_constructor_send_message_upload_audio_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return 0; }
+ struct tl_ds_send_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0xf351d7ab;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->progress = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_send_message_action *fetch_ds_constructor_send_message_upload_photo_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return 0; }
+ struct tl_ds_send_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0xd1d34a26;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->progress = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_send_message_action *fetch_ds_constructor_send_message_upload_document_action_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return 0; }
+ struct tl_ds_send_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0x8faee98e;
+ return result;
+}
+struct tl_ds_send_message_action *fetch_ds_constructor_send_message_upload_document_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return 0; }
+ struct tl_ds_send_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0xaa0cd9e4;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->progress = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_send_message_action *fetch_ds_constructor_send_message_geo_location_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return 0; }
+ struct tl_ds_send_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0x176f8ba1;
+ return result;
+}
+struct tl_ds_send_message_action *fetch_ds_constructor_send_message_choose_contact_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return 0; }
+ struct tl_ds_send_message_action * result = talloc0 (sizeof (*result));
+ result->magic = 0x628cbc6f;
+ return result;
+}
+struct tl_ds_server_d_h_params *fetch_ds_constructor_server_d_h_params_fail (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa9230301 && T->type->name != 0x56dcfcfe)) { return 0; }
+ struct tl_ds_server_d_h_params * result = talloc0 (sizeof (*result));
+ result->magic = 0x79cb045d;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->nonce = fetch_ds_type_bare_int128 (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->server_nonce = fetch_ds_type_bare_int128 (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->new_nonce_hash = fetch_ds_type_bare_int128 (field3);
+ return result;
+}
+struct tl_ds_server_d_h_params *fetch_ds_constructor_server_d_h_params_ok (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa9230301 && T->type->name != 0x56dcfcfe)) { return 0; }
+ struct tl_ds_server_d_h_params * result = talloc0 (sizeof (*result));
+ result->magic = 0xd0e8075c;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->nonce = fetch_ds_type_bare_int128 (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->server_nonce = fetch_ds_type_bare_int128 (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->encrypted_answer = fetch_ds_type_bare_string (field3);
+ return result;
+}
+struct tl_ds_server_d_h_inner_data *fetch_ds_constructor_server_d_h_inner_data (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb5890dba && T->type->name != 0x4a76f245)) { return 0; }
+ struct tl_ds_server_d_h_inner_data * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->nonce = fetch_ds_type_bare_int128 (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->server_nonce = fetch_ds_type_bare_int128 (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->g = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->dh_prime = fetch_ds_type_bare_string (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->g_a = fetch_ds_type_bare_string (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->server_time = fetch_ds_type_bare_int (field6);
+ return result;
+}
+struct tl_ds_set_client_d_h_params_answer *fetch_ds_constructor_dh_gen_ok (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdb8a468f && T->type->name != 0x2475b970)) { return 0; }
+ struct tl_ds_set_client_d_h_params_answer * result = talloc0 (sizeof (*result));
+ result->magic = 0x3bcbf734;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->nonce = fetch_ds_type_bare_int128 (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->server_nonce = fetch_ds_type_bare_int128 (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->new_nonce_hash1 = fetch_ds_type_bare_int128 (field3);
+ return result;
+}
+struct tl_ds_set_client_d_h_params_answer *fetch_ds_constructor_dh_gen_retry (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdb8a468f && T->type->name != 0x2475b970)) { return 0; }
+ struct tl_ds_set_client_d_h_params_answer * result = talloc0 (sizeof (*result));
+ result->magic = 0x46dc1fb9;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->nonce = fetch_ds_type_bare_int128 (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->server_nonce = fetch_ds_type_bare_int128 (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->new_nonce_hash2 = fetch_ds_type_bare_int128 (field3);
+ return result;
+}
+struct tl_ds_set_client_d_h_params_answer *fetch_ds_constructor_dh_gen_fail (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdb8a468f && T->type->name != 0x2475b970)) { return 0; }
+ struct tl_ds_set_client_d_h_params_answer * result = talloc0 (sizeof (*result));
+ result->magic = 0xa69dae02;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->nonce = fetch_ds_type_bare_int128 (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->server_nonce = fetch_ds_type_bare_int128 (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->new_nonce_hash3 = fetch_ds_type_bare_int128 (field3);
+ return result;
+}
+struct tl_ds_sticker_pack *fetch_ds_constructor_sticker_pack (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x12b299d4 && T->type->name != 0xed4d662b)) { return 0; }
+ struct tl_ds_sticker_pack * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->emoticon = fetch_ds_type_bare_string (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->documents = (void *)fetch_ds_type_vector (field2);
+ return result;
+}
+struct tl_ds_sticker_set *fetch_ds_constructor_sticker_set (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa7a43b17 && T->type->name != 0x585bc4e8)) { return 0; }
+ struct tl_ds_sticker_set * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->title = fetch_ds_type_bare_string (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->short_name = fetch_ds_type_bare_string (field4);
+ return result;
+}
+struct tl_ds_string *fetch_ds_constructor_string (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb5286e24 && T->type->name != 0x4ad791db)) { return 0; }
+ struct tl_ds_string * result = talloc0 (sizeof (*result));
+ assert (in_remaining () >= 4);
+ int l = prefetch_strlen ();
+ assert (l >= 0);
+ result->len = l;
+ result->data = talloc (l + 1);
+ result->data[l] = 0;
+ memcpy (result->data, fetch_str (l), l);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_new_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x1f2b0afd;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->message = fetch_ds_type_message (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pts = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pts_count = fetch_ds_type_bare_int (field3);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_message_i_d (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x4e90bfd6;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->random_id = fetch_ds_type_bare_long (field2);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_delete_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0xa20db0e5;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->messages = (void *)fetch_ds_type_vector (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pts = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pts_count = fetch_ds_type_bare_int (field3);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_user_typing (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x5c486927;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x70541c7e, .id = "SendMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->action = fetch_ds_type_send_message_action (field2);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_chat_user_typing (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x9a65ea1f;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->chat_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x70541c7e, .id = "SendMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->action = fetch_ds_type_send_message_action (field3);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_chat_participants (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x07761198;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x77930f9f, .id = "ChatParticipants", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->participants = fetch_ds_type_chat_participants (field1);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_user_status (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x1bfbd823;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x76de9570, .id = "UserStatus", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->status = fetch_ds_type_user_status (field2);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_user_name (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0xa7332b73;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->first_name = fetch_ds_type_bare_string (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->last_name = fetch_ds_type_bare_string (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->username = fetch_ds_type_bare_string (field4);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_user_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x95313b0c;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9a486229, .id = "UserProfilePhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->photo = fetch_ds_type_user_profile_photo (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->previous = fetch_ds_type_bool (field4);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_contact_registered (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x2575bbb9;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field2);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_contact_link (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x9d2e67c5;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->my_link = fetch_ds_type_contact_link (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->foreign_link = fetch_ds_type_contact_link (field3);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_new_authorization (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x8f06529a;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->auth_key_id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->device = fetch_ds_type_bare_string (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->location = fetch_ds_type_bare_string (field4);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_new_geo_chat_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x5a68e3f7;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->geo_message = fetch_ds_type_geo_chat_message (field1);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_new_encrypted_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x12bcbd9a;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xce6b8a1e, .id = "EncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->encr_message = fetch_ds_type_encrypted_message (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->qts = fetch_ds_type_bare_int (field2);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_encrypted_chat_typing (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x1710f156;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->chat_id = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_encryption (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0xb4a2e88d;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb1718213, .id = "EncryptedChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->encr_chat = fetch_ds_type_encrypted_chat (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field2);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_encrypted_messages_read (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x38fe25b7;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->chat_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->max_date = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field3);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_chat_participant_add (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x3a0eeb22;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->chat_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->inviter_id = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->version = fetch_ds_type_bare_int (field4);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_chat_participant_delete (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x6e5f8c22;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->chat_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->version = fetch_ds_type_bare_int (field3);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_dc_options (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x8e5e9873;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2b1a62f0, .id = "DcOption", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->dc_options = (void *)fetch_ds_type_vector (field1);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_user_blocked (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x80ece81a;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->blocked = fetch_ds_type_bool (field2);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_notify_settings (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0xbec268ef;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9fcb8237, .id = "NotifyPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->notify_peer = fetch_ds_type_notify_peer (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->notify_settings = fetch_ds_type_peer_notify_settings (field2);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_service_notification (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x382dd3e4;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->type = fetch_ds_type_bare_string (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->message_text = fetch_ds_type_bare_string (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->media = fetch_ds_type_message_media (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->popup = fetch_ds_type_bool (field4);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_privacy (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0xee3b272a;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xbc2eab30, .id = "PrivacyKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->key = fetch_ds_type_privacy_key (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa8638aec, .id = "PrivacyRule", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->rules = (void *)fetch_ds_type_vector (field2);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_user_phone (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x12b9417b;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->phone = fetch_ds_type_bare_string (field2);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_read_history_inbox (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x9961fd5c;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->peer = fetch_ds_type_peer (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->max_id = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pts = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pts_count = fetch_ds_type_bare_int (field4);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_read_history_outbox (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x2f2f21bf;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->peer = fetch_ds_type_peer (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->max_id = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pts = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pts_count = fetch_ds_type_bare_int (field4);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_web_page (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x2cc36971;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x8d8c0d41, .id = "WebPage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->webpage = fetch_ds_type_web_page (field1);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_read_messages_contents (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x68c13933;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->messages = (void *)fetch_ds_type_vector (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pts = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pts_count = fetch_ds_type_bare_int (field3);
+ return result;
+}
+struct tl_ds_update *fetch_ds_constructor_update_msg_update (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return 0; }
+ struct tl_ds_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x03114739;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pts = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pts_count = fetch_ds_type_bare_int (field3);
+ return result;
+}
+struct tl_ds_updates *fetch_ds_constructor_updates_too_long (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return 0; }
+ struct tl_ds_updates * result = talloc0 (sizeof (*result));
+ result->magic = 0xe317af7e;
+ return result;
+}
+struct tl_ds_updates *fetch_ds_constructor_update_short_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return 0; }
+ struct tl_ds_updates * result = talloc0 (sizeof (*result));
+ result->magic = 0xed5c2127;
+ assert (in_remaining () >= 4);
+ result->flags = talloc (4); *result->flags = prefetch_int (); struct paramed_type *var0 = INT2PTR (fetch_int ());
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->message = fetch_ds_type_bare_string (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pts = fetch_ds_type_bare_int (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pts_count = fetch_ds_type_bare_int (field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field7);
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->fwd_from_id = fetch_ds_type_bare_int (field8);
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->fwd_date = fetch_ds_type_bare_int (field9);
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->reply_to_msg_id = fetch_ds_type_bare_int (field10);
+ }
+ return result;
+}
+struct tl_ds_updates *fetch_ds_constructor_update_short_chat_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return 0; }
+ struct tl_ds_updates * result = talloc0 (sizeof (*result));
+ result->magic = 0x52238b3c;
+ assert (in_remaining () >= 4);
+ result->flags = talloc (4); *result->flags = prefetch_int (); struct paramed_type *var0 = INT2PTR (fetch_int ());
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->from_id = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->chat_id = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->message = fetch_ds_type_bare_string (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pts = fetch_ds_type_bare_int (field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pts_count = fetch_ds_type_bare_int (field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field8);
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->fwd_from_id = fetch_ds_type_bare_int (field9);
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->fwd_date = fetch_ds_type_bare_int (field10);
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->reply_to_msg_id = fetch_ds_type_bare_int (field11);
+ }
+ return result;
+}
+struct tl_ds_updates *fetch_ds_constructor_update_short (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return 0; }
+ struct tl_ds_updates * result = talloc0 (sizeof (*result));
+ result->magic = 0x78d4dec1;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->update = fetch_ds_type_update (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field2);
+ return result;
+}
+struct tl_ds_updates *fetch_ds_constructor_updates_combined (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return 0; }
+ struct tl_ds_updates * result = talloc0 (sizeof (*result));
+ result->magic = 0x725b04c3;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->updates = (void *)fetch_ds_type_vector (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->users = (void *)fetch_ds_type_vector (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->chats = (void *)fetch_ds_type_vector (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->seq_start = fetch_ds_type_bare_int (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->seq = fetch_ds_type_bare_int (field6);
+ return result;
+}
+struct tl_ds_updates *fetch_ds_constructor_updates (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return 0; }
+ struct tl_ds_updates * result = talloc0 (sizeof (*result));
+ result->magic = 0x74ae4240;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->updates = (void *)fetch_ds_type_vector (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->users = (void *)fetch_ds_type_vector (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->chats = (void *)fetch_ds_type_vector (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->seq = fetch_ds_type_bare_int (field5);
+ return result;
+}
+struct tl_ds_user *fetch_ds_constructor_user_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02e6c0c8 && T->type->name != 0xfd193f37)) { return 0; }
+ struct tl_ds_user * result = talloc0 (sizeof (*result));
+ result->magic = 0x200250ba;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_user *fetch_ds_constructor_user (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02e6c0c8 && T->type->name != 0xfd193f37)) { return 0; }
+ struct tl_ds_user * result = talloc0 (sizeof (*result));
+ result->magic = 0x22e49072;
+ assert (in_remaining () >= 4);
+ result->flags = talloc (4); *result->flags = prefetch_int (); struct paramed_type *var0 = INT2PTR (fetch_int ());
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field2);
+ if (PTR2INT (var0) & (1 << 0)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field3);
+ }
+ if (PTR2INT (var0) & (1 << 1)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->first_name = fetch_ds_type_bare_string (field4);
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->last_name = fetch_ds_type_bare_string (field5);
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->username = fetch_ds_type_bare_string (field6);
+ }
+ if (PTR2INT (var0) & (1 << 4)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->phone = fetch_ds_type_bare_string (field7);
+ }
+ if (PTR2INT (var0) & (1 << 5)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9a486229, .id = "UserProfilePhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->photo = fetch_ds_type_user_profile_photo (field8);
+ }
+ if (PTR2INT (var0) & (1 << 6)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x76de9570, .id = "UserStatus", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->status = fetch_ds_type_user_status (field9);
+ }
+ if (PTR2INT (var0) & (1 << 14)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->bot_info_version = fetch_ds_type_bare_int (field10);
+ }
+ return result;
+}
+struct tl_ds_user_full *fetch_ds_constructor_user_full (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5a89ac5b && T->type->name != 0xa57653a4)) { return 0; }
+ struct tl_ds_user_full * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user = fetch_ds_type_user (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3ace484c, .id = "contacts.Link", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->link = fetch_ds_type_contacts_link (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->profile_photo = fetch_ds_type_photo (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->notify_settings = fetch_ds_type_peer_notify_settings (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->blocked = fetch_ds_type_bool (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb2e16f93, .id = "BotInfo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->bot_info = fetch_ds_type_bot_info (field6);
+ return result;
+}
+struct tl_ds_user_profile_photo *fetch_ds_constructor_user_profile_photo_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9a486229 && T->type->name != 0x65b79dd6)) { return 0; }
+ struct tl_ds_user_profile_photo * result = talloc0 (sizeof (*result));
+ result->magic = 0x4f11bae1;
+ return result;
+}
+struct tl_ds_user_profile_photo *fetch_ds_constructor_user_profile_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9a486229 && T->type->name != 0x65b79dd6)) { return 0; }
+ struct tl_ds_user_profile_photo * result = talloc0 (sizeof (*result));
+ result->magic = 0xd559d8c8;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->photo_id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->photo_small = fetch_ds_type_file_location (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->photo_big = fetch_ds_type_file_location (field3);
+ return result;
+}
+struct tl_ds_user_status *fetch_ds_constructor_user_status_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return 0; }
+ struct tl_ds_user_status * result = talloc0 (sizeof (*result));
+ result->magic = 0x09d05049;
+ return result;
+}
+struct tl_ds_user_status *fetch_ds_constructor_user_status_online (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return 0; }
+ struct tl_ds_user_status * result = talloc0 (sizeof (*result));
+ result->magic = 0xedb93949;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->expires = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_user_status *fetch_ds_constructor_user_status_offline (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return 0; }
+ struct tl_ds_user_status * result = talloc0 (sizeof (*result));
+ result->magic = 0x008c703f;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->was_online = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_user_status *fetch_ds_constructor_user_status_recently (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return 0; }
+ struct tl_ds_user_status * result = talloc0 (sizeof (*result));
+ result->magic = 0xe26f42f1;
+ return result;
+}
+struct tl_ds_user_status *fetch_ds_constructor_user_status_last_week (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return 0; }
+ struct tl_ds_user_status * result = talloc0 (sizeof (*result));
+ result->magic = 0x07bf09fc;
+ return result;
+}
+struct tl_ds_user_status *fetch_ds_constructor_user_status_last_month (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return 0; }
+ struct tl_ds_user_status * result = talloc0 (sizeof (*result));
+ result->magic = 0x77ebc742;
+ return result;
+}
+struct tl_ds_vector *fetch_ds_constructor_vector (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1cb5c415 && T->type->name != 0xe34a3bea)) { return 0; }
+ if (ODDP(T->params[0])) { return 0; }
+ struct paramed_type *var0 = T->params[0]; assert (var0);
+ struct tl_ds_vector * result = talloc0 (sizeof (*result));
+ assert (in_remaining () >= 4);
+ result->f1 = talloc (4); *result->f1 = prefetch_int (); struct paramed_type *var1 = INT2PTR (fetch_int ());
+ int multiplicity3 = PTR2INT (
+ ((void *)var1) + 0 );
+ struct paramed_type *field3 =
+ var0;
+ result->f2 = talloc0 (multiplicity3 * sizeof (void *));
+ {
+ int i = 0;
+ while (i < multiplicity3) {
+ result->f2[i ++] = fetch_ds_type_any (field3);
+ }
+ }
+ return result;
+}
+struct tl_ds_video *fetch_ds_constructor_video_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1716b174 && T->type->name != 0xe8e94e8b)) { return 0; }
+ struct tl_ds_video * result = talloc0 (sizeof (*result));
+ result->magic = 0xc10658a8;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ return result;
+}
+struct tl_ds_video *fetch_ds_constructor_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1716b174 && T->type->name != 0xe8e94e8b)) { return 0; }
+ struct tl_ds_video * result = talloc0 (sizeof (*result));
+ result->magic = 0xee9f4a4d;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->duration = fetch_ds_type_bare_int (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->size = fetch_ds_type_bare_int (field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->thumb = fetch_ds_type_photo_size (field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->dc_id = fetch_ds_type_bare_int (field8);
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->w = fetch_ds_type_bare_int (field9);
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->h = fetch_ds_type_bare_int (field10);
+ return result;
+}
+struct tl_ds_video *fetch_ds_constructor_video_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1716b174 && T->type->name != 0xe8e94e8b)) { return 0; }
+ struct tl_ds_video * result = talloc0 (sizeof (*result));
+ result->magic = 0x388fa391;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->caption = fetch_ds_type_bare_string (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->duration = fetch_ds_type_bare_int (field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->mime_type = fetch_ds_type_bare_string (field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->size = fetch_ds_type_bare_int (field8);
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->thumb = fetch_ds_type_photo_size (field9);
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->dc_id = fetch_ds_type_bare_int (field10);
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->w = fetch_ds_type_bare_int (field11);
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->h = fetch_ds_type_bare_int (field12);
+ return result;
+}
+struct tl_ds_wall_paper *fetch_ds_constructor_wall_paper (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xafa14973 && T->type->name != 0x505eb68c)) { return 0; }
+ struct tl_ds_wall_paper * result = talloc0 (sizeof (*result));
+ result->magic = 0xccb03657;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->title = fetch_ds_type_bare_string (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->sizes = (void *)fetch_ds_type_vector (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->color = fetch_ds_type_bare_int (field4);
+ return result;
+}
+struct tl_ds_wall_paper *fetch_ds_constructor_wall_paper_solid (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xafa14973 && T->type->name != 0x505eb68c)) { return 0; }
+ struct tl_ds_wall_paper * result = talloc0 (sizeof (*result));
+ result->magic = 0x63117f24;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->title = fetch_ds_type_bare_string (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->bg_color = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->color = fetch_ds_type_bare_int (field4);
+ return result;
+}
+struct tl_ds_web_page *fetch_ds_constructor_web_page_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8d8c0d41 && T->type->name != 0x7273f2be)) { return 0; }
+ struct tl_ds_web_page * result = talloc0 (sizeof (*result));
+ result->magic = 0xeb1477e8;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ return result;
+}
+struct tl_ds_web_page *fetch_ds_constructor_web_page_pending (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8d8c0d41 && T->type->name != 0x7273f2be)) { return 0; }
+ struct tl_ds_web_page * result = talloc0 (sizeof (*result));
+ result->magic = 0xc586da1c;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field2);
+ return result;
+}
+struct tl_ds_web_page *fetch_ds_constructor_web_page (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8d8c0d41 && T->type->name != 0x7273f2be)) { return 0; }
+ struct tl_ds_web_page * result = talloc0 (sizeof (*result));
+ result->magic = 0xa31ea0b5;
+ assert (in_remaining () >= 4);
+ result->flags = talloc (4); *result->flags = prefetch_int (); struct paramed_type *var0 = INT2PTR (fetch_int ());
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_long (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->url = fetch_ds_type_bare_string (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->display_url = fetch_ds_type_bare_string (field4);
+ if (PTR2INT (var0) & (1 << 0)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->type = fetch_ds_type_bare_string (field5);
+ }
+ if (PTR2INT (var0) & (1 << 1)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->site_name = fetch_ds_type_bare_string (field6);
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->title = fetch_ds_type_bare_string (field7);
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->description = fetch_ds_type_bare_string (field8);
+ }
+ if (PTR2INT (var0) & (1 << 4)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->photo = fetch_ds_type_photo (field9);
+ }
+ if (PTR2INT (var0) & (1 << 5)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->embed_url = fetch_ds_type_bare_string (field10);
+ }
+ if (PTR2INT (var0) & (1 << 5)) {
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->embed_type = fetch_ds_type_bare_string (field11);
+ }
+ if (PTR2INT (var0) & (1 << 6)) {
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->embed_width = fetch_ds_type_bare_int (field12);
+ }
+ if (PTR2INT (var0) & (1 << 6)) {
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->embed_height = fetch_ds_type_bare_int (field13);
+ }
+ if (PTR2INT (var0) & (1 << 7)) {
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->duration = fetch_ds_type_bare_int (field14);
+ }
+ if (PTR2INT (var0) & (1 << 8)) {
+ struct paramed_type *field15 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->author = fetch_ds_type_bare_string (field15);
+ }
+ return result;
+}
+struct tl_ds_account_authorizations *fetch_ds_constructor_account_authorizations (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1250abde && T->type->name != 0xedaf5421)) { return 0; }
+ struct tl_ds_account_authorizations * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bf2e6f6, .id = "Authorization", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->authorizations = (void *)fetch_ds_type_vector (field1);
+ return result;
+}
+struct tl_ds_account_password *fetch_ds_constructor_account_no_password (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xeac2a804 && T->type->name != 0x153d57fb)) { return 0; }
+ struct tl_ds_account_password * result = talloc0 (sizeof (*result));
+ result->magic = 0x96dabc18;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->new_salt = fetch_ds_type_bare_bytes (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->email_unconfirmed_pattern = fetch_ds_type_bare_string (field2);
+ return result;
+}
+struct tl_ds_account_password *fetch_ds_constructor_account_password (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xeac2a804 && T->type->name != 0x153d57fb)) { return 0; }
+ struct tl_ds_account_password * result = talloc0 (sizeof (*result));
+ result->magic = 0x7c18141c;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->current_salt = fetch_ds_type_bare_bytes (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->new_salt = fetch_ds_type_bare_bytes (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->hint = fetch_ds_type_bare_string (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->has_recovery = fetch_ds_type_bool (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->email_unconfirmed_pattern = fetch_ds_type_bare_string (field5);
+ return result;
+}
+struct tl_ds_account_password_input_settings *fetch_ds_constructor_account_password_input_settings (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbcfc532c && T->type->name != 0x4303acd3)) { return 0; }
+ struct tl_ds_account_password_input_settings * result = talloc0 (sizeof (*result));
+ assert (in_remaining () >= 4);
+ result->flags = talloc (4); *result->flags = prefetch_int (); struct paramed_type *var0 = INT2PTR (fetch_int ());
+ if (PTR2INT (var0) & (1 << 0)) {
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->new_salt = fetch_ds_type_bare_bytes (field2);
+ }
+ if (PTR2INT (var0) & (1 << 0)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->new_password_hash = fetch_ds_type_bare_bytes (field3);
+ }
+ if (PTR2INT (var0) & (1 << 0)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->hint = fetch_ds_type_bare_string (field4);
+ }
+ if (PTR2INT (var0) & (1 << 1)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->email = fetch_ds_type_bare_string (field5);
+ }
+ return result;
+}
+struct tl_ds_account_password_settings *fetch_ds_constructor_account_password_settings (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb7b72ab3 && T->type->name != 0x4848d54c)) { return 0; }
+ struct tl_ds_account_password_settings * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->email = fetch_ds_type_bare_string (field1);
+ return result;
+}
+struct tl_ds_account_privacy_rules *fetch_ds_constructor_account_privacy_rules (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x554abb6f && T->type->name != 0xaab54490)) { return 0; }
+ struct tl_ds_account_privacy_rules * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa8638aec, .id = "PrivacyRule", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->rules = (void *)fetch_ds_type_vector (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->users = (void *)fetch_ds_type_vector (field2);
+ return result;
+}
+struct tl_ds_account_sent_change_phone_code *fetch_ds_constructor_account_sent_change_phone_code (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa4f58c4c && T->type->name != 0x5b0a73b3)) { return 0; }
+ struct tl_ds_account_sent_change_phone_code * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->phone_code_hash = fetch_ds_type_bare_string (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->send_call_timeout = fetch_ds_type_bare_int (field2);
+ return result;
+}
+struct tl_ds_auth_authorization *fetch_ds_constructor_auth_authorization (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xff036af1 && T->type->name != 0x00fc950e)) { return 0; }
+ struct tl_ds_auth_authorization * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user = fetch_ds_type_user (field1);
+ return result;
+}
+struct tl_ds_auth_checked_phone *fetch_ds_constructor_auth_checked_phone (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x811ea28e && T->type->name != 0x7ee15d71)) { return 0; }
+ struct tl_ds_auth_checked_phone * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->phone_registered = fetch_ds_type_bool (field1);
+ return result;
+}
+struct tl_ds_auth_exported_authorization *fetch_ds_constructor_auth_exported_authorization (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdf969c2d && T->type->name != 0x206963d2)) { return 0; }
+ struct tl_ds_auth_exported_authorization * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->bytes = fetch_ds_type_bare_bytes (field2);
+ return result;
+}
+struct tl_ds_auth_password_recovery *fetch_ds_constructor_auth_password_recovery (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x137948a5 && T->type->name != 0xec86b75a)) { return 0; }
+ struct tl_ds_auth_password_recovery * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->email_pattern = fetch_ds_type_bare_string (field1);
+ return result;
+}
+struct tl_ds_auth_sent_code *fetch_ds_constructor_auth_sent_code (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0cc8bc16 && T->type->name != 0xf33743e9)) { return 0; }
+ struct tl_ds_auth_sent_code * result = talloc0 (sizeof (*result));
+ result->magic = 0xefed51d9;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->phone_registered = fetch_ds_type_bool (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->phone_code_hash = fetch_ds_type_bare_string (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->send_call_timeout = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->is_password = fetch_ds_type_bool (field4);
+ return result;
+}
+struct tl_ds_auth_sent_code *fetch_ds_constructor_auth_sent_app_code (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0cc8bc16 && T->type->name != 0xf33743e9)) { return 0; }
+ struct tl_ds_auth_sent_code * result = talloc0 (sizeof (*result));
+ result->magic = 0xe325edcf;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->phone_registered = fetch_ds_type_bool (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->phone_code_hash = fetch_ds_type_bare_string (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->send_call_timeout = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->is_password = fetch_ds_type_bool (field4);
+ return result;
+}
+struct tl_ds_binlog_encr_key *fetch_ds_constructor_binlog_encr_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0377168f && T->type->name != 0xfc88e970)) { return 0; }
+ struct tl_ds_binlog_encr_key * result = talloc0 (sizeof (*result));
+ int multiplicity1 = PTR2INT (
+ INT2PTR (64) );
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->key = talloc0 (multiplicity1 * sizeof (void *));
+ {
+ int i = 0;
+ while (i < multiplicity1) {
+ result->key[i ++] =fetch_ds_type_any (field1);
+ }
+ }
+ return result;
+}
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_start (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return 0; }
+ struct tl_ds_binlog_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x3b06de69;
+ return result;
+}
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_dc_option (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return 0; }
+ struct tl_ds_binlog_update * result = talloc0 (sizeof (*result));
+ result->magic = 0xf96feb32;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->dc = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->name = fetch_ds_type_bare_string (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->ip = fetch_ds_type_bare_string (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->port = fetch_ds_type_bare_int (field4);
+ return result;
+}
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_dc_option_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return 0; }
+ struct tl_ds_binlog_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x7c0d22d8;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->flags = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->dc = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->name = fetch_ds_type_bare_string (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->ip = fetch_ds_type_bare_string (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->port = fetch_ds_type_bare_int (field5);
+ return result;
+}
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_auth_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return 0; }
+ struct tl_ds_binlog_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x71e8c156;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->dc = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->key = fetch_ds_type_bare_binlog_encr_key (field2);
+ return result;
+}
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_default_dc (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return 0; }
+ struct tl_ds_binlog_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x9e83dbdc;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->dc = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_dc_signed (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return 0; }
+ struct tl_ds_binlog_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x26451bb5;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->dc = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_our_id (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return 0; }
+ struct tl_ds_binlog_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x68a870e8;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_set_dh_params (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return 0; }
+ struct tl_ds_binlog_update * result = talloc0 (sizeof (*result));
+ result->magic = 0xeaeb7826;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->root = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->prime = fetch_ds_type_bare_binlog_encr_key (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->version = fetch_ds_type_bare_int (field3);
+ return result;
+}
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_set_pts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return 0; }
+ struct tl_ds_binlog_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x2ca8c939;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pts = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_set_qts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return 0; }
+ struct tl_ds_binlog_update * result = talloc0 (sizeof (*result));
+ result->magic = 0xd95738ac;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->qts = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_set_date (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return 0; }
+ struct tl_ds_binlog_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x1d0f4b52;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_set_seq (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return 0; }
+ struct tl_ds_binlog_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x6eeb2989;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->seq = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_encr_chat_delete (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return 0; }
+ struct tl_ds_binlog_update * result = talloc0 (sizeof (*result));
+ result->magic = 0xee1b38e8;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_encr_chat_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return 0; }
+ struct tl_ds_binlog_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x84977251;
+ assert (in_remaining () >= 4);
+ result->flags = talloc (4); *result->flags = prefetch_int (); struct paramed_type *var0 = INT2PTR (fetch_int ());
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field2);
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field3);
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field4);
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->admin = fetch_ds_type_bare_int (field5);
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field6);
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->key = fetch_ds_type_bare_binlog_encr_key (field7);
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->g_key = fetch_ds_type_bare_binlog_encr_key (field8);
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->state = fetch_ds_type_bare_int (field9);
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->ttl = fetch_ds_type_bare_int (field10);
+ }
+ if (PTR2INT (var0) & (1 << 25)) {
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->layer = fetch_ds_type_bare_int (field11);
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->in_seq_no = fetch_ds_type_bare_int (field12);
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->last_in_seq_no = fetch_ds_type_bare_int (field13);
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->out_seq_no = fetch_ds_type_bare_int (field14);
+ }
+ if (PTR2INT (var0) & (1 << 27)) {
+ struct paramed_type *field15 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->key_fingerprint = fetch_ds_type_bare_long (field15);
+ }
+ return result;
+}
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_encr_chat_exchange_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return 0; }
+ struct tl_ds_binlog_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x9d49488d;
+ assert (in_remaining () >= 4);
+ result->flags = talloc (4); *result->flags = prefetch_int (); struct paramed_type *var0 = INT2PTR (fetch_int ());
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field2);
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->exchange_id = fetch_ds_type_bare_long (field3);
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->key = fetch_ds_type_bare_binlog_encr_key (field4);
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->state = fetch_ds_type_bare_int (field5);
+ }
+ return result;
+}
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_user_delete (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return 0; }
+ struct tl_ds_binlog_update * result = talloc0 (sizeof (*result));
+ result->magic = 0xac55d447;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_user_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return 0; }
+ struct tl_ds_binlog_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x127cf2f9;
+ assert (in_remaining () >= 4);
+ result->flags = talloc (4); *result->flags = prefetch_int (); struct paramed_type *var0 = INT2PTR (fetch_int ());
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field2);
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->access_hash = fetch_ds_type_bare_long (field3);
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->first_name = fetch_ds_type_bare_string (field4);
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->last_name = fetch_ds_type_bare_string (field5);
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->phone = fetch_ds_type_bare_string (field6);
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->username = fetch_ds_type_bare_string (field7);
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->photo = fetch_ds_type_photo (field8);
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->real_first_name = fetch_ds_type_bare_string (field9);
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->real_last_name = fetch_ds_type_bare_string (field10);
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9a486229, .id = "UserProfilePhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_photo = fetch_ds_type_user_profile_photo (field11);
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->last_read_in = fetch_ds_type_bare_int (field12);
+ }
+ if (PTR2INT (var0) & (1 << 25)) {
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->last_read_out = fetch_ds_type_bare_int (field13);
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb2e16f93, .id = "BotInfo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->bot_info = fetch_ds_type_bot_info (field14);
+ }
+ return result;
+}
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_chat_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return 0; }
+ struct tl_ds_binlog_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x0a10aa92;
+ assert (in_remaining () >= 4);
+ result->flags = talloc (4); *result->flags = prefetch_int (); struct paramed_type *var0 = INT2PTR (fetch_int ());
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field2);
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->title = fetch_ds_type_bare_string (field3);
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_num = fetch_ds_type_bare_int (field4);
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field5);
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->version = fetch_ds_type_bare_int (field6);
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc8d7493e, .id = "ChatParticipant", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->participants = (void *)fetch_ds_type_vector (field7);
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x56922676, .id = "ChatPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->chat_photo = fetch_ds_type_chat_photo (field8);
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->photo = fetch_ds_type_photo (field9);
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->admin = fetch_ds_type_bare_int (field10);
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->last_read_in = fetch_ds_type_bare_int (field11);
+ }
+ if (PTR2INT (var0) & (1 << 25)) {
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->last_read_out = fetch_ds_type_bare_int (field12);
+ }
+ return result;
+}
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_chat_add_participant (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return 0; }
+ struct tl_ds_binlog_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x535475ea;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->version = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->inviter_id = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field5);
+ return result;
+}
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_chat_del_participant (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return 0; }
+ struct tl_ds_binlog_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x7dd1a1a2;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->version = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user_id = fetch_ds_type_bare_int (field3);
+ return result;
+}
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_set_msg_id (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return 0; }
+ struct tl_ds_binlog_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x3c873416;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->old_id = fetch_ds_type_bare_long (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->new_id = fetch_ds_type_bare_int (field2);
+ return result;
+}
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_message_delete (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return 0; }
+ struct tl_ds_binlog_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x847e77b1;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->lid = fetch_ds_type_bare_long (field1);
+ return result;
+}
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_message_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return 0; }
+ struct tl_ds_binlog_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x427cfcdb;
+ assert (in_remaining () >= 4);
+ result->flags = talloc (4); *result->flags = prefetch_int (); struct paramed_type *var0 = INT2PTR (fetch_int ());
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->lid = fetch_ds_type_bare_long (field2);
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->from_id = fetch_ds_type_bare_int (field3);
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->to_type = fetch_ds_type_bare_int (field4);
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->to_id = fetch_ds_type_bare_int (field5);
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->fwd_from_id = fetch_ds_type_bare_int (field6);
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->fwd_date = fetch_ds_type_bare_int (field7);
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field8);
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->message = fetch_ds_type_bare_string (field9);
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->media = fetch_ds_type_message_media (field10);
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x383415fa, .id = "MessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->action = fetch_ds_type_message_action (field11);
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->reply_id = fetch_ds_type_bare_int (field12);
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x612ca4a9, .id = "ReplyMarkup", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->reply_markup = fetch_ds_type_reply_markup (field13);
+ }
+ return result;
+}
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_message_encr_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return 0; }
+ struct tl_ds_binlog_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x6cf7cabc;
+ assert (in_remaining () >= 4);
+ result->flags = talloc (4); *result->flags = prefetch_int (); struct paramed_type *var0 = INT2PTR (fetch_int ());
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->lid = fetch_ds_type_bare_long (field2);
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->from_id = fetch_ds_type_bare_int (field3);
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->to_type = fetch_ds_type_bare_int (field4);
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->to_id = fetch_ds_type_bare_int (field5);
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field6);
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->message = fetch_ds_type_bare_string (field7);
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x34e0d674, .id = "DecryptedMessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->encr_media = fetch_ds_type_decrypted_message_media (field8);
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4e0eefde, .id = "DecryptedMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->encr_action = fetch_ds_type_decrypted_message_action (field9);
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x886fd032, .id = "EncryptedFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->file = fetch_ds_type_encrypted_file (field10);
+ }
+ return result;
+}
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_msg_update (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return 0; }
+ struct tl_ds_binlog_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x6dd4d85f;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->lid = fetch_ds_type_bare_long (field1);
+ return result;
+}
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_reset_authorization (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return 0; }
+ struct tl_ds_binlog_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x83327955;
+ return result;
+}
+struct tl_ds_contacts_blocked *fetch_ds_constructor_contacts_blocked (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8c1b8fb4 && T->type->name != 0x73e4704b)) { return 0; }
+ struct tl_ds_contacts_blocked * result = talloc0 (sizeof (*result));
+ result->magic = 0x1c138d15;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x561bc879, .id = "ContactBlocked", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->blocked = (void *)fetch_ds_type_vector (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->users = (void *)fetch_ds_type_vector (field2);
+ return result;
+}
+struct tl_ds_contacts_blocked *fetch_ds_constructor_contacts_blocked_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8c1b8fb4 && T->type->name != 0x73e4704b)) { return 0; }
+ struct tl_ds_contacts_blocked * result = talloc0 (sizeof (*result));
+ result->magic = 0x900802a1;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->count = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x561bc879, .id = "ContactBlocked", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->blocked = (void *)fetch_ds_type_vector (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->users = (void *)fetch_ds_type_vector (field3);
+ return result;
+}
+struct tl_ds_contacts_contacts *fetch_ds_constructor_contacts_contacts_not_modified (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd8c02560 && T->type->name != 0x273fda9f)) { return 0; }
+ struct tl_ds_contacts_contacts * result = talloc0 (sizeof (*result));
+ result->magic = 0xb74ba9d2;
+ return result;
+}
+struct tl_ds_contacts_contacts *fetch_ds_constructor_contacts_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd8c02560 && T->type->name != 0x273fda9f)) { return 0; }
+ struct tl_ds_contacts_contacts * result = talloc0 (sizeof (*result));
+ result->magic = 0x6f8b8cb2;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf911c994, .id = "Contact", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->contacts = (void *)fetch_ds_type_vector (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->users = (void *)fetch_ds_type_vector (field2);
+ return result;
+}
+struct tl_ds_contacts_found *fetch_ds_constructor_contacts_found (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0566000e && T->type->name != 0xfa99fff1)) { return 0; }
+ struct tl_ds_contacts_found * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xea879f95, .id = "ContactFound", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->results = (void *)fetch_ds_type_vector (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->users = (void *)fetch_ds_type_vector (field2);
+ return result;
+}
+struct tl_ds_contacts_imported_contacts *fetch_ds_constructor_contacts_imported_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xad524315 && T->type->name != 0x52adbcea)) { return 0; }
+ struct tl_ds_contacts_imported_contacts * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xd0028438, .id = "ImportedContact", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->imported = (void *)fetch_ds_type_vector (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->retry_contacts = (void *)fetch_ds_type_vector (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->users = (void *)fetch_ds_type_vector (field3);
+ return result;
+}
+struct tl_ds_contacts_link *fetch_ds_constructor_contacts_link (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3ace484c && T->type->name != 0xc531b7b3)) { return 0; }
+ struct tl_ds_contacts_link * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->my_link = fetch_ds_type_contact_link (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->foreign_link = fetch_ds_type_contact_link (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user = fetch_ds_type_user (field3);
+ return result;
+}
+struct tl_ds_contacts_suggested *fetch_ds_constructor_contacts_suggested (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5649dcc5 && T->type->name != 0xa9b6233a)) { return 0; }
+ struct tl_ds_contacts_suggested * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3de191a1, .id = "ContactSuggested", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->results = (void *)fetch_ds_type_vector (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->users = (void *)fetch_ds_type_vector (field2);
+ return result;
+}
+struct tl_ds_geochats_located *fetch_ds_constructor_geochats_located (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x48feb267 && T->type->name != 0xb7014d98)) { return 0; }
+ struct tl_ds_geochats_located * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3631cf4c, .id = "ChatLocated", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->results = (void *)fetch_ds_type_vector (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->messages = (void *)fetch_ds_type_vector (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->chats = (void *)fetch_ds_type_vector (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->users = (void *)fetch_ds_type_vector (field4);
+ return result;
+}
+struct tl_ds_geochats_messages *fetch_ds_constructor_geochats_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6d0a0e59 && T->type->name != 0x92f5f1a6)) { return 0; }
+ struct tl_ds_geochats_messages * result = talloc0 (sizeof (*result));
+ result->magic = 0xd1526db1;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->messages = (void *)fetch_ds_type_vector (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->chats = (void *)fetch_ds_type_vector (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->users = (void *)fetch_ds_type_vector (field3);
+ return result;
+}
+struct tl_ds_geochats_messages *fetch_ds_constructor_geochats_messages_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6d0a0e59 && T->type->name != 0x92f5f1a6)) { return 0; }
+ struct tl_ds_geochats_messages * result = talloc0 (sizeof (*result));
+ result->magic = 0xbc5863e8;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->count = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->messages = (void *)fetch_ds_type_vector (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->chats = (void *)fetch_ds_type_vector (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->users = (void *)fetch_ds_type_vector (field4);
+ return result;
+}
+struct tl_ds_geochats_stated_message *fetch_ds_constructor_geochats_stated_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17b1578b && T->type->name != 0xe84ea874)) { return 0; }
+ struct tl_ds_geochats_stated_message * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->message = fetch_ds_type_geo_chat_message (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->chats = (void *)fetch_ds_type_vector (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->users = (void *)fetch_ds_type_vector (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->seq = fetch_ds_type_bare_int (field4);
+ return result;
+}
+struct tl_ds_help_app_update *fetch_ds_constructor_help_app_update (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4ddd9627 && T->type->name != 0xb22269d8)) { return 0; }
+ struct tl_ds_help_app_update * result = talloc0 (sizeof (*result));
+ result->magic = 0x8987f311;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->critical = fetch_ds_type_bool (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->url = fetch_ds_type_bare_string (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->text = fetch_ds_type_bare_string (field4);
+ return result;
+}
+struct tl_ds_help_app_update *fetch_ds_constructor_help_no_app_update (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4ddd9627 && T->type->name != 0xb22269d8)) { return 0; }
+ struct tl_ds_help_app_update * result = talloc0 (sizeof (*result));
+ result->magic = 0xc45a6536;
+ return result;
+}
+struct tl_ds_help_invite_text *fetch_ds_constructor_help_invite_text (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x18cb9f78 && T->type->name != 0xe7346087)) { return 0; }
+ struct tl_ds_help_invite_text * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->message = fetch_ds_type_bare_string (field1);
+ return result;
+}
+struct tl_ds_help_support *fetch_ds_constructor_help_support (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17c6b5f6 && T->type->name != 0xe8394a09)) { return 0; }
+ struct tl_ds_help_support * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->phone_number = fetch_ds_type_bare_string (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->user = fetch_ds_type_user (field2);
+ return result;
+}
+struct tl_ds_messages_affected_history *fetch_ds_constructor_messages_affected_history (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb45c69d1 && T->type->name != 0x4ba3962e)) { return 0; }
+ struct tl_ds_messages_affected_history * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pts = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pts_count = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->offset = fetch_ds_type_bare_int (field3);
+ return result;
+}
+struct tl_ds_messages_affected_messages *fetch_ds_constructor_messages_affected_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x84d19185 && T->type->name != 0x7b2e6e7a)) { return 0; }
+ struct tl_ds_messages_affected_messages * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pts = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pts_count = fetch_ds_type_bare_int (field2);
+ return result;
+}
+struct tl_ds_messages_all_stickers *fetch_ds_constructor_messages_all_stickers_not_modified (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb485502f && T->type->name != 0x4b7aafd0)) { return 0; }
+ struct tl_ds_messages_all_stickers * result = talloc0 (sizeof (*result));
+ result->magic = 0xe86602c3;
+ return result;
+}
+struct tl_ds_messages_all_stickers *fetch_ds_constructor_messages_all_stickers (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb485502f && T->type->name != 0x4b7aafd0)) { return 0; }
+ struct tl_ds_messages_all_stickers * result = talloc0 (sizeof (*result));
+ result->magic = 0x5ce352ec;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->hash = fetch_ds_type_bare_string (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x12b299d4, .id = "StickerPack", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->packs = (void *)fetch_ds_type_vector (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa7a43b17, .id = "StickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->sets = (void *)fetch_ds_type_vector (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->documents = (void *)fetch_ds_type_vector (field4);
+ return result;
+}
+struct tl_ds_messages_chat_full *fetch_ds_constructor_messages_chat_full (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe5d7d19c && T->type->name != 0x1a282e63)) { return 0; }
+ struct tl_ds_messages_chat_full * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02a614, .id = "ChatFull", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->full_chat = fetch_ds_type_chat_full (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->chats = (void *)fetch_ds_type_vector (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->users = (void *)fetch_ds_type_vector (field3);
+ return result;
+}
+struct tl_ds_messages_chats *fetch_ds_constructor_messages_chats (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x64ff9fd5 && T->type->name != 0x9b00602a)) { return 0; }
+ struct tl_ds_messages_chats * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->chats = (void *)fetch_ds_type_vector (field1);
+ return result;
+}
+struct tl_ds_messages_dh_config *fetch_ds_constructor_messages_dh_config_not_modified (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xecc058e8 && T->type->name != 0x133fa717)) { return 0; }
+ struct tl_ds_messages_dh_config * result = talloc0 (sizeof (*result));
+ result->magic = 0xc0e24635;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->random = fetch_ds_type_bare_bytes (field1);
+ return result;
+}
+struct tl_ds_messages_dh_config *fetch_ds_constructor_messages_dh_config (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xecc058e8 && T->type->name != 0x133fa717)) { return 0; }
+ struct tl_ds_messages_dh_config * result = talloc0 (sizeof (*result));
+ result->magic = 0x2c221edd;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->g = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->p = fetch_ds_type_bare_bytes (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->version = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->random = fetch_ds_type_bare_bytes (field4);
+ return result;
+}
+struct tl_ds_messages_dialogs *fetch_ds_constructor_messages_dialogs (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x645af8b3 && T->type->name != 0x9ba5074c)) { return 0; }
+ struct tl_ds_messages_dialogs * result = talloc0 (sizeof (*result));
+ result->magic = 0x15ba6c40;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc1dd804a, .id = "Dialog", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->dialogs = (void *)fetch_ds_type_vector (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->messages = (void *)fetch_ds_type_vector (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->chats = (void *)fetch_ds_type_vector (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->users = (void *)fetch_ds_type_vector (field4);
+ return result;
+}
+struct tl_ds_messages_dialogs *fetch_ds_constructor_messages_dialogs_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x645af8b3 && T->type->name != 0x9ba5074c)) { return 0; }
+ struct tl_ds_messages_dialogs * result = talloc0 (sizeof (*result));
+ result->magic = 0x71e094f3;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->count = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc1dd804a, .id = "Dialog", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->dialogs = (void *)fetch_ds_type_vector (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->messages = (void *)fetch_ds_type_vector (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->chats = (void *)fetch_ds_type_vector (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->users = (void *)fetch_ds_type_vector (field5);
+ return result;
+}
+struct tl_ds_messages_message *fetch_ds_constructor_messages_message_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3f4e0648 && T->type->name != 0xc0b1f9b7)) { return 0; }
+ struct tl_ds_messages_message * result = talloc0 (sizeof (*result));
+ return result;
+}
+struct tl_ds_messages_messages *fetch_ds_constructor_messages_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8735e464 && T->type->name != 0x78ca1b9b)) { return 0; }
+ struct tl_ds_messages_messages * result = talloc0 (sizeof (*result));
+ result->magic = 0x8c718e87;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->messages = (void *)fetch_ds_type_vector (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->chats = (void *)fetch_ds_type_vector (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->users = (void *)fetch_ds_type_vector (field3);
+ return result;
+}
+struct tl_ds_messages_messages *fetch_ds_constructor_messages_messages_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8735e464 && T->type->name != 0x78ca1b9b)) { return 0; }
+ struct tl_ds_messages_messages * result = talloc0 (sizeof (*result));
+ result->magic = 0x0b446ae3;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->count = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->messages = (void *)fetch_ds_type_vector (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->chats = (void *)fetch_ds_type_vector (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->users = (void *)fetch_ds_type_vector (field4);
+ return result;
+}
+struct tl_ds_messages_sent_encrypted_message *fetch_ds_constructor_messages_sent_encrypted_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc29c7607 && T->type->name != 0x3d6389f8)) { return 0; }
+ struct tl_ds_messages_sent_encrypted_message * result = talloc0 (sizeof (*result));
+ result->magic = 0x560f8935;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field1);
+ return result;
+}
+struct tl_ds_messages_sent_encrypted_message *fetch_ds_constructor_messages_sent_encrypted_file (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc29c7607 && T->type->name != 0x3d6389f8)) { return 0; }
+ struct tl_ds_messages_sent_encrypted_message * result = talloc0 (sizeof (*result));
+ result->magic = 0x9493ff32;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x886fd032, .id = "EncryptedFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->file = fetch_ds_type_encrypted_file (field2);
+ return result;
+}
+struct tl_ds_messages_sent_message *fetch_ds_constructor_messages_sent_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x799ce190 && T->type->name != 0x86631e6f)) { return 0; }
+ struct tl_ds_messages_sent_message * result = talloc0 (sizeof (*result));
+ result->magic = 0x4c3d47f3;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->media = fetch_ds_type_message_media (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pts = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pts_count = fetch_ds_type_bare_int (field5);
+ return result;
+}
+struct tl_ds_messages_sent_message *fetch_ds_constructor_messages_sent_message_link (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x799ce190 && T->type->name != 0x86631e6f)) { return 0; }
+ struct tl_ds_messages_sent_message * result = talloc0 (sizeof (*result));
+ result->magic = 0x35a1a663;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->id = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->media = fetch_ds_type_message_media (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pts = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pts_count = fetch_ds_type_bare_int (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3ace484c, .id = "contacts.Link", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->links = (void *)fetch_ds_type_vector (field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->seq = fetch_ds_type_bare_int (field7);
+ return result;
+}
+struct tl_ds_messages_sticker_set *fetch_ds_constructor_messages_sticker_set (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb60a24a6 && T->type->name != 0x49f5db59)) { return 0; }
+ struct tl_ds_messages_sticker_set * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa7a43b17, .id = "StickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->set = fetch_ds_type_sticker_set (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x12b299d4, .id = "StickerPack", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->packs = (void *)fetch_ds_type_vector (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->documents = (void *)fetch_ds_type_vector (field3);
+ return result;
+}
+struct tl_ds_messages_stickers *fetch_ds_constructor_messages_stickers_not_modified (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bfa5710 && T->type->name != 0x8405a8ef)) { return 0; }
+ struct tl_ds_messages_stickers * result = talloc0 (sizeof (*result));
+ result->magic = 0xf1749a22;
+ return result;
+}
+struct tl_ds_messages_stickers *fetch_ds_constructor_messages_stickers (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bfa5710 && T->type->name != 0x8405a8ef)) { return 0; }
+ struct tl_ds_messages_stickers * result = talloc0 (sizeof (*result));
+ result->magic = 0x8a8ecd32;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->hash = fetch_ds_type_bare_string (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->stickers = (void *)fetch_ds_type_vector (field2);
+ return result;
+}
+struct tl_ds_photos_photo *fetch_ds_constructor_photos_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x20212ca8 && T->type->name != 0xdfded357)) { return 0; }
+ struct tl_ds_photos_photo * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->photo = fetch_ds_type_photo (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->users = (void *)fetch_ds_type_vector (field2);
+ return result;
+}
+struct tl_ds_photos_photos *fetch_ds_constructor_photos_photos (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x98cf75f1 && T->type->name != 0x67308a0e)) { return 0; }
+ struct tl_ds_photos_photos * result = talloc0 (sizeof (*result));
+ result->magic = 0x8dca6aa5;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->photos = (void *)fetch_ds_type_vector (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->users = (void *)fetch_ds_type_vector (field2);
+ return result;
+}
+struct tl_ds_photos_photos *fetch_ds_constructor_photos_photos_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x98cf75f1 && T->type->name != 0x67308a0e)) { return 0; }
+ struct tl_ds_photos_photos * result = talloc0 (sizeof (*result));
+ result->magic = 0x15051f54;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->count = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->photos = (void *)fetch_ds_type_vector (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->users = (void *)fetch_ds_type_vector (field3);
+ return result;
+}
+struct tl_ds_storage_file_type *fetch_ds_constructor_storage_file_unknown (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return 0; }
+ struct tl_ds_storage_file_type * result = talloc0 (sizeof (*result));
+ result->magic = 0xaa963b05;
+ return result;
+}
+struct tl_ds_storage_file_type *fetch_ds_constructor_storage_file_jpeg (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return 0; }
+ struct tl_ds_storage_file_type * result = talloc0 (sizeof (*result));
+ result->magic = 0x007efe0e;
+ return result;
+}
+struct tl_ds_storage_file_type *fetch_ds_constructor_storage_file_gif (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return 0; }
+ struct tl_ds_storage_file_type * result = talloc0 (sizeof (*result));
+ result->magic = 0xcae1aadf;
+ return result;
+}
+struct tl_ds_storage_file_type *fetch_ds_constructor_storage_file_png (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return 0; }
+ struct tl_ds_storage_file_type * result = talloc0 (sizeof (*result));
+ result->magic = 0x0a4f63c0;
+ return result;
+}
+struct tl_ds_storage_file_type *fetch_ds_constructor_storage_file_pdf (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return 0; }
+ struct tl_ds_storage_file_type * result = talloc0 (sizeof (*result));
+ result->magic = 0xae1e508d;
+ return result;
+}
+struct tl_ds_storage_file_type *fetch_ds_constructor_storage_file_mp3 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return 0; }
+ struct tl_ds_storage_file_type * result = talloc0 (sizeof (*result));
+ result->magic = 0x528a0677;
+ return result;
+}
+struct tl_ds_storage_file_type *fetch_ds_constructor_storage_file_mov (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return 0; }
+ struct tl_ds_storage_file_type * result = talloc0 (sizeof (*result));
+ result->magic = 0x4b09ebbc;
+ return result;
+}
+struct tl_ds_storage_file_type *fetch_ds_constructor_storage_file_partial (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return 0; }
+ struct tl_ds_storage_file_type * result = talloc0 (sizeof (*result));
+ result->magic = 0x40bc6f52;
+ return result;
+}
+struct tl_ds_storage_file_type *fetch_ds_constructor_storage_file_mp4 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return 0; }
+ struct tl_ds_storage_file_type * result = talloc0 (sizeof (*result));
+ result->magic = 0xb3cea0e4;
+ return result;
+}
+struct tl_ds_storage_file_type *fetch_ds_constructor_storage_file_webp (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return 0; }
+ struct tl_ds_storage_file_type * result = talloc0 (sizeof (*result));
+ result->magic = 0x1081464c;
+ return result;
+}
+struct tl_ds_updates_difference *fetch_ds_constructor_updates_difference_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf57a2419 && T->type->name != 0x0a85dbe6)) { return 0; }
+ struct tl_ds_updates_difference * result = talloc0 (sizeof (*result));
+ result->magic = 0x5d75a138;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->seq = fetch_ds_type_bare_int (field2);
+ return result;
+}
+struct tl_ds_updates_difference *fetch_ds_constructor_updates_difference (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf57a2419 && T->type->name != 0x0a85dbe6)) { return 0; }
+ struct tl_ds_updates_difference * result = talloc0 (sizeof (*result));
+ result->magic = 0x00f49ca0;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->new_messages = (void *)fetch_ds_type_vector (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xce6b8a1e, .id = "EncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->new_encrypted_messages = (void *)fetch_ds_type_vector (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->other_updates = (void *)fetch_ds_type_vector (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->chats = (void *)fetch_ds_type_vector (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->users = (void *)fetch_ds_type_vector (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa56c2a3e, .id = "updates.State", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->state = fetch_ds_type_updates_state (field6);
+ return result;
+}
+struct tl_ds_updates_difference *fetch_ds_constructor_updates_difference_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf57a2419 && T->type->name != 0x0a85dbe6)) { return 0; }
+ struct tl_ds_updates_difference * result = talloc0 (sizeof (*result));
+ result->magic = 0xa8fb1981;
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->new_messages = (void *)fetch_ds_type_vector (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xce6b8a1e, .id = "EncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->new_encrypted_messages = (void *)fetch_ds_type_vector (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->other_updates = (void *)fetch_ds_type_vector (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->chats = (void *)fetch_ds_type_vector (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ result->users = (void *)fetch_ds_type_vector (field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa56c2a3e, .id = "updates.State", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->intermediate_state = fetch_ds_type_updates_state (field6);
+ return result;
+}
+struct tl_ds_updates_state *fetch_ds_constructor_updates_state (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa56c2a3e && T->type->name != 0x5a93d5c1)) { return 0; }
+ struct tl_ds_updates_state * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->pts = fetch_ds_type_bare_int (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->qts = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->date = fetch_ds_type_bare_int (field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->seq = fetch_ds_type_bare_int (field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->unread_count = fetch_ds_type_bare_int (field5);
+ return result;
+}
+struct tl_ds_upload_file *fetch_ds_constructor_upload_file (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x096a18d5 && T->type->name != 0xf695e72a)) { return 0; }
+ struct tl_ds_upload_file * result = talloc0 (sizeof (*result));
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3e2838a8, .id = "storage.FileType", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->type = fetch_ds_type_storage_file_type (field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->mtime = fetch_ds_type_bare_int (field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ result->bytes = fetch_ds_type_bare_bytes (field3);
+ return result;
+}
+struct tl_ds_account_days_t_t_l *fetch_ds_type_account_days_t_t_l (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xb8d0afdf: return fetch_ds_constructor_account_days_t_t_l (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_account_days_t_t_l *fetch_ds_type_bare_account_days_t_t_l (struct paramed_type *T) {
+ return fetch_ds_constructor_account_days_t_t_l (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_audio *fetch_ds_type_audio (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x586988d8: return fetch_ds_constructor_audio_empty (T); break;
+ case 0xc7ac6496: return fetch_ds_constructor_audio (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_audio *fetch_ds_type_bare_audio (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_audio_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_audio_empty (T); }
+ if (skip_constructor_audio (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_audio (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_authorization *fetch_ds_type_authorization (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x7bf2e6f6: return fetch_ds_constructor_authorization (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_authorization *fetch_ds_type_bare_authorization (struct paramed_type *T) {
+ return fetch_ds_constructor_authorization (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_bool *fetch_ds_type_bool (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xbc799737: return fetch_ds_constructor_bool_false (T); break;
+ case 0x997275b5: return fetch_ds_constructor_bool_true (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_bool *fetch_ds_type_bare_bool (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_bool_false (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_bool_false (T); }
+ if (skip_constructor_bool_true (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_bool_true (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_bot_command *fetch_ds_type_bot_command (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xc27ac8c7: return fetch_ds_constructor_bot_command (T); break;
+ case 0xb79d22ab: return fetch_ds_constructor_bot_command_old (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_bot_command *fetch_ds_type_bare_bot_command (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_bot_command (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_bot_command (T); }
+ if (skip_constructor_bot_command_old (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_bot_command_old (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_bot_info *fetch_ds_type_bot_info (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xbb2e37ce: return fetch_ds_constructor_bot_info_empty (T); break;
+ case 0x09cf585d: return fetch_ds_constructor_bot_info (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_bot_info *fetch_ds_type_bare_bot_info (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_bot_info_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_bot_info_empty (T); }
+ if (skip_constructor_bot_info (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_bot_info (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_string *fetch_ds_type_bytes (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x0ee1379f: return fetch_ds_constructor_bytes (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_string *fetch_ds_type_bare_bytes (struct paramed_type *T) {
+ return fetch_ds_constructor_bytes (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_chat *fetch_ds_type_chat (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x9ba2d800: return fetch_ds_constructor_chat_empty (T); break;
+ case 0x6e9c9bc7: return fetch_ds_constructor_chat (T); break;
+ case 0xfb0ccc41: return fetch_ds_constructor_chat_forbidden (T); break;
+ case 0x75eaea5a: return fetch_ds_constructor_geo_chat (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_chat *fetch_ds_type_bare_chat (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_chat_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_chat_empty (T); }
+ if (skip_constructor_chat (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_chat (T); }
+ if (skip_constructor_chat_forbidden (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_chat_forbidden (T); }
+ if (skip_constructor_geo_chat (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_geo_chat (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_chat_full *fetch_ds_type_chat_full (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x2e02a614: return fetch_ds_constructor_chat_full (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_chat_full *fetch_ds_type_bare_chat_full (struct paramed_type *T) {
+ return fetch_ds_constructor_chat_full (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_chat_invite *fetch_ds_type_chat_invite (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x5a686d7c: return fetch_ds_constructor_chat_invite_already (T); break;
+ case 0xce917dcd: return fetch_ds_constructor_chat_invite (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_chat_invite *fetch_ds_type_bare_chat_invite (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_chat_invite_already (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_chat_invite_already (T); }
+ if (skip_constructor_chat_invite (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_chat_invite (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_chat_located *fetch_ds_type_chat_located (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x3631cf4c: return fetch_ds_constructor_chat_located (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_chat_located *fetch_ds_type_bare_chat_located (struct paramed_type *T) {
+ return fetch_ds_constructor_chat_located (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_chat_participant *fetch_ds_type_chat_participant (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xc8d7493e: return fetch_ds_constructor_chat_participant (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_chat_participant *fetch_ds_type_bare_chat_participant (struct paramed_type *T) {
+ return fetch_ds_constructor_chat_participant (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_chat_participants *fetch_ds_type_chat_participants (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x0fd2bb8a: return fetch_ds_constructor_chat_participants_forbidden (T); break;
+ case 0x7841b415: return fetch_ds_constructor_chat_participants (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_chat_participants *fetch_ds_type_bare_chat_participants (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_chat_participants_forbidden (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_chat_participants_forbidden (T); }
+ if (skip_constructor_chat_participants (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_chat_participants (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_chat_photo *fetch_ds_type_chat_photo (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x37c1011c: return fetch_ds_constructor_chat_photo_empty (T); break;
+ case 0x6153276a: return fetch_ds_constructor_chat_photo (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_chat_photo *fetch_ds_type_bare_chat_photo (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_chat_photo_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_chat_photo_empty (T); }
+ if (skip_constructor_chat_photo (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_chat_photo (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_client_d_h_inner_data *fetch_ds_type_client_d_h_inner_data (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x6643b654: return fetch_ds_constructor_client_d_h_inner_data (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_client_d_h_inner_data *fetch_ds_type_bare_client_d_h_inner_data (struct paramed_type *T) {
+ return fetch_ds_constructor_client_d_h_inner_data (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_config *fetch_ds_type_config (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x4e32b894: return fetch_ds_constructor_config (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_config *fetch_ds_type_bare_config (struct paramed_type *T) {
+ return fetch_ds_constructor_config (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_contact *fetch_ds_type_contact (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xf911c994: return fetch_ds_constructor_contact (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_contact *fetch_ds_type_bare_contact (struct paramed_type *T) {
+ return fetch_ds_constructor_contact (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_contact_blocked *fetch_ds_type_contact_blocked (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x561bc879: return fetch_ds_constructor_contact_blocked (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_contact_blocked *fetch_ds_type_bare_contact_blocked (struct paramed_type *T) {
+ return fetch_ds_constructor_contact_blocked (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_contact_found *fetch_ds_type_contact_found (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xea879f95: return fetch_ds_constructor_contact_found (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_contact_found *fetch_ds_type_bare_contact_found (struct paramed_type *T) {
+ return fetch_ds_constructor_contact_found (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_contact_link *fetch_ds_type_contact_link (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x5f4f9247: return fetch_ds_constructor_contact_link_unknown (T); break;
+ case 0xfeedd3ad: return fetch_ds_constructor_contact_link_none (T); break;
+ case 0x268f3f59: return fetch_ds_constructor_contact_link_has_phone (T); break;
+ case 0xd502c2d0: return fetch_ds_constructor_contact_link_contact (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_contact_link *fetch_ds_type_bare_contact_link (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_contact_link_unknown (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_contact_link_unknown (T); }
+ if (skip_constructor_contact_link_none (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_contact_link_none (T); }
+ if (skip_constructor_contact_link_has_phone (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_contact_link_has_phone (T); }
+ if (skip_constructor_contact_link_contact (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_contact_link_contact (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_contact_status *fetch_ds_type_contact_status (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xd3680c61: return fetch_ds_constructor_contact_status (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_contact_status *fetch_ds_type_bare_contact_status (struct paramed_type *T) {
+ return fetch_ds_constructor_contact_status (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_contact_suggested *fetch_ds_type_contact_suggested (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x3de191a1: return fetch_ds_constructor_contact_suggested (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_contact_suggested *fetch_ds_type_bare_contact_suggested (struct paramed_type *T) {
+ return fetch_ds_constructor_contact_suggested (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_dc_option *fetch_ds_type_dc_option (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x2ec2a43c: return fetch_ds_constructor_dc_option_l28 (T); break;
+ case 0x05d8c6cc: return fetch_ds_constructor_dc_option (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_dc_option *fetch_ds_type_bare_dc_option (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_dc_option_l28 (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_dc_option_l28 (T); }
+ if (skip_constructor_dc_option (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_dc_option (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_decrypted_message *fetch_ds_type_decrypted_message (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x204d3878: return fetch_ds_constructor_decrypted_message (T); break;
+ case 0x73164160: return fetch_ds_constructor_decrypted_message_service (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_decrypted_message *fetch_ds_type_bare_decrypted_message (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_decrypted_message (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_decrypted_message (T); }
+ if (skip_constructor_decrypted_message_service (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_decrypted_message_service (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_decrypted_message_action *fetch_ds_type_decrypted_message_action (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xa1733aec: return fetch_ds_constructor_decrypted_message_action_set_message_t_t_l (T); break;
+ case 0x0c4f40be: return fetch_ds_constructor_decrypted_message_action_read_messages (T); break;
+ case 0x65614304: return fetch_ds_constructor_decrypted_message_action_delete_messages (T); break;
+ case 0x8ac1f475: return fetch_ds_constructor_decrypted_message_action_screenshot_messages (T); break;
+ case 0x6719e45c: return fetch_ds_constructor_decrypted_message_action_flush_history (T); break;
+ case 0x511110b0: return fetch_ds_constructor_decrypted_message_action_resend (T); break;
+ case 0xf3048883: return fetch_ds_constructor_decrypted_message_action_notify_layer (T); break;
+ case 0xccb27641: return fetch_ds_constructor_decrypted_message_action_typing (T); break;
+ case 0xf3c9611b: return fetch_ds_constructor_decrypted_message_action_request_key (T); break;
+ case 0x6fe1735b: return fetch_ds_constructor_decrypted_message_action_accept_key (T); break;
+ case 0xdd05ec6b: return fetch_ds_constructor_decrypted_message_action_abort_key (T); break;
+ case 0xec2e0b9b: return fetch_ds_constructor_decrypted_message_action_commit_key (T); break;
+ case 0xa82fdd63: return fetch_ds_constructor_decrypted_message_action_noop (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_decrypted_message_action *fetch_ds_type_bare_decrypted_message_action (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_decrypted_message_action_set_message_t_t_l (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_decrypted_message_action_set_message_t_t_l (T); }
+ if (skip_constructor_decrypted_message_action_read_messages (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_decrypted_message_action_read_messages (T); }
+ if (skip_constructor_decrypted_message_action_delete_messages (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_decrypted_message_action_delete_messages (T); }
+ if (skip_constructor_decrypted_message_action_screenshot_messages (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_decrypted_message_action_screenshot_messages (T); }
+ if (skip_constructor_decrypted_message_action_flush_history (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_decrypted_message_action_flush_history (T); }
+ if (skip_constructor_decrypted_message_action_resend (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_decrypted_message_action_resend (T); }
+ if (skip_constructor_decrypted_message_action_notify_layer (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_decrypted_message_action_notify_layer (T); }
+ if (skip_constructor_decrypted_message_action_typing (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_decrypted_message_action_typing (T); }
+ if (skip_constructor_decrypted_message_action_request_key (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_decrypted_message_action_request_key (T); }
+ if (skip_constructor_decrypted_message_action_accept_key (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_decrypted_message_action_accept_key (T); }
+ if (skip_constructor_decrypted_message_action_abort_key (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_decrypted_message_action_abort_key (T); }
+ if (skip_constructor_decrypted_message_action_commit_key (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_decrypted_message_action_commit_key (T); }
+ if (skip_constructor_decrypted_message_action_noop (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_decrypted_message_action_noop (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_decrypted_message_layer *fetch_ds_type_decrypted_message_layer (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x1be31789: return fetch_ds_constructor_decrypted_message_layer (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_decrypted_message_layer *fetch_ds_type_bare_decrypted_message_layer (struct paramed_type *T) {
+ return fetch_ds_constructor_decrypted_message_layer (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_decrypted_message_media *fetch_ds_type_decrypted_message_media (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x089f5c4a: return fetch_ds_constructor_decrypted_message_media_empty (T); break;
+ case 0x32798a8c: return fetch_ds_constructor_decrypted_message_media_photo (T); break;
+ case 0x35480a59: return fetch_ds_constructor_decrypted_message_media_geo_point (T); break;
+ case 0x588a0a97: return fetch_ds_constructor_decrypted_message_media_contact (T); break;
+ case 0xb095434b: return fetch_ds_constructor_decrypted_message_media_document (T); break;
+ case 0x524a415d: return fetch_ds_constructor_decrypted_message_media_video (T); break;
+ case 0x57e0a9cb: return fetch_ds_constructor_decrypted_message_media_audio (T); break;
+ case 0xfa95b0dd: return fetch_ds_constructor_decrypted_message_media_external_document (T); break;
+ case 0x4cee6ef3: return fetch_ds_constructor_decrypted_message_media_video_l12 (T); break;
+ case 0x6080758f: return fetch_ds_constructor_decrypted_message_media_audio_l12 (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_decrypted_message_media *fetch_ds_type_bare_decrypted_message_media (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_decrypted_message_media_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_decrypted_message_media_empty (T); }
+ if (skip_constructor_decrypted_message_media_photo (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_decrypted_message_media_photo (T); }
+ if (skip_constructor_decrypted_message_media_geo_point (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_decrypted_message_media_geo_point (T); }
+ if (skip_constructor_decrypted_message_media_contact (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_decrypted_message_media_contact (T); }
+ if (skip_constructor_decrypted_message_media_document (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_decrypted_message_media_document (T); }
+ if (skip_constructor_decrypted_message_media_video (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_decrypted_message_media_video (T); }
+ if (skip_constructor_decrypted_message_media_audio (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_decrypted_message_media_audio (T); }
+ if (skip_constructor_decrypted_message_media_external_document (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_decrypted_message_media_external_document (T); }
+ if (skip_constructor_decrypted_message_media_video_l12 (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_decrypted_message_media_video_l12 (T); }
+ if (skip_constructor_decrypted_message_media_audio_l12 (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_decrypted_message_media_audio_l12 (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_dialog *fetch_ds_type_dialog (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xc1dd804a: return fetch_ds_constructor_dialog (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_dialog *fetch_ds_type_bare_dialog (struct paramed_type *T) {
+ return fetch_ds_constructor_dialog (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_disabled_feature *fetch_ds_type_disabled_feature (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xae636f24: return fetch_ds_constructor_disabled_feature (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_disabled_feature *fetch_ds_type_bare_disabled_feature (struct paramed_type *T) {
+ return fetch_ds_constructor_disabled_feature (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_document *fetch_ds_type_document (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x36f8c871: return fetch_ds_constructor_document_empty (T); break;
+ case 0xf9a39f4f: return fetch_ds_constructor_document (T); break;
+ case 0x9efc6326: return fetch_ds_constructor_document_l19 (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_document *fetch_ds_type_bare_document (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_document_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_document_empty (T); }
+ if (skip_constructor_document (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_document (T); }
+ if (skip_constructor_document_l19 (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_document_l19 (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_document_attribute *fetch_ds_type_document_attribute (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x6c37c15c: return fetch_ds_constructor_document_attribute_image_size (T); break;
+ case 0x11b58939: return fetch_ds_constructor_document_attribute_animated (T); break;
+ case 0x994c9882: return fetch_ds_constructor_document_attribute_sticker_l28 (T); break;
+ case 0x3a556302: return fetch_ds_constructor_document_attribute_sticker (T); break;
+ case 0x5910cccb: return fetch_ds_constructor_document_attribute_video (T); break;
+ case 0x051448e5: return fetch_ds_constructor_document_attribute_audio (T); break;
+ case 0x15590068: return fetch_ds_constructor_document_attribute_filename (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_document_attribute *fetch_ds_type_bare_document_attribute (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_document_attribute_image_size (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_document_attribute_image_size (T); }
+ if (skip_constructor_document_attribute_animated (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_document_attribute_animated (T); }
+ if (skip_constructor_document_attribute_sticker_l28 (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_document_attribute_sticker_l28 (T); }
+ if (skip_constructor_document_attribute_sticker (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_document_attribute_sticker (T); }
+ if (skip_constructor_document_attribute_video (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_document_attribute_video (T); }
+ if (skip_constructor_document_attribute_audio (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_document_attribute_audio (T); }
+ if (skip_constructor_document_attribute_filename (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_document_attribute_filename (T); }
+ assert (0);
+ return NULL;
+}
+double *fetch_ds_type_double (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x2210c154: return fetch_ds_constructor_double (T); break;
+ default: assert (0); return NULL;
+ }
+}
+double *fetch_ds_type_bare_double (struct paramed_type *T) {
+ return fetch_ds_constructor_double (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_encrypted_chat *fetch_ds_type_encrypted_chat (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xab7ec0a0: return fetch_ds_constructor_encrypted_chat_empty (T); break;
+ case 0x3bf703dc: return fetch_ds_constructor_encrypted_chat_waiting (T); break;
+ case 0xc878527e: return fetch_ds_constructor_encrypted_chat_requested (T); break;
+ case 0xfa56ce36: return fetch_ds_constructor_encrypted_chat (T); break;
+ case 0x13d6dd27: return fetch_ds_constructor_encrypted_chat_discarded (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_encrypted_chat *fetch_ds_type_bare_encrypted_chat (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_encrypted_chat_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_encrypted_chat_empty (T); }
+ if (skip_constructor_encrypted_chat_waiting (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_encrypted_chat_waiting (T); }
+ if (skip_constructor_encrypted_chat_requested (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_encrypted_chat_requested (T); }
+ if (skip_constructor_encrypted_chat (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_encrypted_chat (T); }
+ if (skip_constructor_encrypted_chat_discarded (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_encrypted_chat_discarded (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_encrypted_file *fetch_ds_type_encrypted_file (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xc21f497e: return fetch_ds_constructor_encrypted_file_empty (T); break;
+ case 0x4a70994c: return fetch_ds_constructor_encrypted_file (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_encrypted_file *fetch_ds_type_bare_encrypted_file (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_encrypted_file_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_encrypted_file_empty (T); }
+ if (skip_constructor_encrypted_file (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_encrypted_file (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_encrypted_message *fetch_ds_type_encrypted_message (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xed18c118: return fetch_ds_constructor_encrypted_message (T); break;
+ case 0x23734b06: return fetch_ds_constructor_encrypted_message_service (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_encrypted_message *fetch_ds_type_bare_encrypted_message (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_encrypted_message (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_encrypted_message (T); }
+ if (skip_constructor_encrypted_message_service (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_encrypted_message_service (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_error *fetch_ds_type_error (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xc4b9f9bb: return fetch_ds_constructor_error (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_error *fetch_ds_type_bare_error (struct paramed_type *T) {
+ return fetch_ds_constructor_error (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_exported_chat_invite *fetch_ds_type_exported_chat_invite (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x69df3769: return fetch_ds_constructor_chat_invite_empty (T); break;
+ case 0xfc2e05bc: return fetch_ds_constructor_chat_invite_exported (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_exported_chat_invite *fetch_ds_type_bare_exported_chat_invite (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_chat_invite_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_chat_invite_empty (T); }
+ if (skip_constructor_chat_invite_exported (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_chat_invite_exported (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_file_location *fetch_ds_type_file_location (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x7c596b46: return fetch_ds_constructor_file_location_unavailable (T); break;
+ case 0x53d69076: return fetch_ds_constructor_file_location (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_file_location *fetch_ds_type_bare_file_location (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_file_location_unavailable (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_file_location_unavailable (T); }
+ if (skip_constructor_file_location (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_file_location (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_geo_chat_message *fetch_ds_type_geo_chat_message (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x60311a9b: return fetch_ds_constructor_geo_chat_message_empty (T); break;
+ case 0x4505f8e1: return fetch_ds_constructor_geo_chat_message (T); break;
+ case 0xd34fa24e: return fetch_ds_constructor_geo_chat_message_service (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_geo_chat_message *fetch_ds_type_bare_geo_chat_message (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_geo_chat_message_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_geo_chat_message_empty (T); }
+ if (skip_constructor_geo_chat_message (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_geo_chat_message (T); }
+ if (skip_constructor_geo_chat_message_service (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_geo_chat_message_service (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_geo_point *fetch_ds_type_geo_point (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x1117dd5f: return fetch_ds_constructor_geo_point_empty (T); break;
+ case 0x2049d70c: return fetch_ds_constructor_geo_point (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_geo_point *fetch_ds_type_bare_geo_point (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_geo_point_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_geo_point_empty (T); }
+ if (skip_constructor_geo_point (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_geo_point (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_imported_contact *fetch_ds_type_imported_contact (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xd0028438: return fetch_ds_constructor_imported_contact (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_imported_contact *fetch_ds_type_bare_imported_contact (struct paramed_type *T) {
+ return fetch_ds_constructor_imported_contact (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_input_app_event *fetch_ds_type_input_app_event (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x770656a8: return fetch_ds_constructor_input_app_event (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_input_app_event *fetch_ds_type_bare_input_app_event (struct paramed_type *T) {
+ return fetch_ds_constructor_input_app_event (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_input_audio *fetch_ds_type_input_audio (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xd95adc84: return fetch_ds_constructor_input_audio_empty (T); break;
+ case 0x77d440ff: return fetch_ds_constructor_input_audio (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_input_audio *fetch_ds_type_bare_input_audio (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_audio_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_audio_empty (T); }
+ if (skip_constructor_input_audio (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_audio (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_input_chat_photo *fetch_ds_type_input_chat_photo (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x1ca48f57: return fetch_ds_constructor_input_chat_photo_empty (T); break;
+ case 0x94254732: return fetch_ds_constructor_input_chat_uploaded_photo (T); break;
+ case 0xb2e1bf08: return fetch_ds_constructor_input_chat_photo (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_input_chat_photo *fetch_ds_type_bare_input_chat_photo (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_chat_photo_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_chat_photo_empty (T); }
+ if (skip_constructor_input_chat_uploaded_photo (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_chat_uploaded_photo (T); }
+ if (skip_constructor_input_chat_photo (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_chat_photo (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_input_contact *fetch_ds_type_input_contact (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xf392b7f4: return fetch_ds_constructor_input_phone_contact (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_input_contact *fetch_ds_type_bare_input_contact (struct paramed_type *T) {
+ return fetch_ds_constructor_input_phone_contact (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_input_document *fetch_ds_type_input_document (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x72f0eaae: return fetch_ds_constructor_input_document_empty (T); break;
+ case 0x18798952: return fetch_ds_constructor_input_document (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_input_document *fetch_ds_type_bare_input_document (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_document_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_document_empty (T); }
+ if (skip_constructor_input_document (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_document (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_input_encrypted_chat *fetch_ds_type_input_encrypted_chat (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xf141b5e1: return fetch_ds_constructor_input_encrypted_chat (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_input_encrypted_chat *fetch_ds_type_bare_input_encrypted_chat (struct paramed_type *T) {
+ return fetch_ds_constructor_input_encrypted_chat (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_input_encrypted_file *fetch_ds_type_input_encrypted_file (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x1837c364: return fetch_ds_constructor_input_encrypted_file_empty (T); break;
+ case 0x64bd0306: return fetch_ds_constructor_input_encrypted_file_uploaded (T); break;
+ case 0x5a17b5e5: return fetch_ds_constructor_input_encrypted_file (T); break;
+ case 0x2dc173c8: return fetch_ds_constructor_input_encrypted_file_big_uploaded (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_input_encrypted_file *fetch_ds_type_bare_input_encrypted_file (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_encrypted_file_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_encrypted_file_empty (T); }
+ if (skip_constructor_input_encrypted_file_uploaded (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_encrypted_file_uploaded (T); }
+ if (skip_constructor_input_encrypted_file (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_encrypted_file (T); }
+ if (skip_constructor_input_encrypted_file_big_uploaded (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_encrypted_file_big_uploaded (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_input_file *fetch_ds_type_input_file (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xf52ff27f: return fetch_ds_constructor_input_file (T); break;
+ case 0xfa4f0bb5: return fetch_ds_constructor_input_file_big (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_input_file *fetch_ds_type_bare_input_file (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_file (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_file (T); }
+ if (skip_constructor_input_file_big (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_file_big (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_input_file_location *fetch_ds_type_input_file_location (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x14637196: return fetch_ds_constructor_input_file_location (T); break;
+ case 0x3d0364ec: return fetch_ds_constructor_input_video_file_location (T); break;
+ case 0xf5235d55: return fetch_ds_constructor_input_encrypted_file_location (T); break;
+ case 0x74dc404d: return fetch_ds_constructor_input_audio_file_location (T); break;
+ case 0x4e45abe9: return fetch_ds_constructor_input_document_file_location (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_input_file_location *fetch_ds_type_bare_input_file_location (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_file_location (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_file_location (T); }
+ if (skip_constructor_input_video_file_location (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_video_file_location (T); }
+ if (skip_constructor_input_encrypted_file_location (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_encrypted_file_location (T); }
+ if (skip_constructor_input_audio_file_location (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_audio_file_location (T); }
+ if (skip_constructor_input_document_file_location (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_document_file_location (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_input_geo_chat *fetch_ds_type_input_geo_chat (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x74d456fa: return fetch_ds_constructor_input_geo_chat (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_input_geo_chat *fetch_ds_type_bare_input_geo_chat (struct paramed_type *T) {
+ return fetch_ds_constructor_input_geo_chat (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_input_geo_point *fetch_ds_type_input_geo_point (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xe4c123d6: return fetch_ds_constructor_input_geo_point_empty (T); break;
+ case 0xf3b7acc9: return fetch_ds_constructor_input_geo_point (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_input_geo_point *fetch_ds_type_bare_input_geo_point (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_geo_point_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_geo_point_empty (T); }
+ if (skip_constructor_input_geo_point (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_geo_point (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_input_media *fetch_ds_type_input_media (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x9664f57f: return fetch_ds_constructor_input_media_empty (T); break;
+ case 0xf7aff1c0: return fetch_ds_constructor_input_media_uploaded_photo (T); break;
+ case 0xe9bfb4f3: return fetch_ds_constructor_input_media_photo (T); break;
+ case 0xf9c44144: return fetch_ds_constructor_input_media_geo_point (T); break;
+ case 0xa6e45987: return fetch_ds_constructor_input_media_contact (T); break;
+ case 0xe13fd4bc: return fetch_ds_constructor_input_media_uploaded_video (T); break;
+ case 0x96fb97dc: return fetch_ds_constructor_input_media_uploaded_thumb_video (T); break;
+ case 0x936a4ebd: return fetch_ds_constructor_input_media_video (T); break;
+ case 0x4e498cab: return fetch_ds_constructor_input_media_uploaded_audio (T); break;
+ case 0x89938781: return fetch_ds_constructor_input_media_audio (T); break;
+ case 0xffe76b78: return fetch_ds_constructor_input_media_uploaded_document (T); break;
+ case 0x41481486: return fetch_ds_constructor_input_media_uploaded_thumb_document (T); break;
+ case 0xd184e841: return fetch_ds_constructor_input_media_document (T); break;
+ case 0x2827a81a: return fetch_ds_constructor_input_media_venue (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_input_media *fetch_ds_type_bare_input_media (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_media_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_media_empty (T); }
+ if (skip_constructor_input_media_uploaded_photo (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_media_uploaded_photo (T); }
+ if (skip_constructor_input_media_photo (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_media_photo (T); }
+ if (skip_constructor_input_media_geo_point (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_media_geo_point (T); }
+ if (skip_constructor_input_media_contact (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_media_contact (T); }
+ if (skip_constructor_input_media_uploaded_video (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_media_uploaded_video (T); }
+ if (skip_constructor_input_media_uploaded_thumb_video (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_media_uploaded_thumb_video (T); }
+ if (skip_constructor_input_media_video (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_media_video (T); }
+ if (skip_constructor_input_media_uploaded_audio (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_media_uploaded_audio (T); }
+ if (skip_constructor_input_media_audio (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_media_audio (T); }
+ if (skip_constructor_input_media_uploaded_document (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_media_uploaded_document (T); }
+ if (skip_constructor_input_media_uploaded_thumb_document (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_media_uploaded_thumb_document (T); }
+ if (skip_constructor_input_media_document (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_media_document (T); }
+ if (skip_constructor_input_media_venue (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_media_venue (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_input_notify_peer *fetch_ds_type_input_notify_peer (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xb8bc5b0c: return fetch_ds_constructor_input_notify_peer (T); break;
+ case 0x193b4417: return fetch_ds_constructor_input_notify_users (T); break;
+ case 0x4a95e84e: return fetch_ds_constructor_input_notify_chats (T); break;
+ case 0xa429b886: return fetch_ds_constructor_input_notify_all (T); break;
+ case 0x4d8ddec8: return fetch_ds_constructor_input_notify_geo_chat_peer (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_input_notify_peer *fetch_ds_type_bare_input_notify_peer (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_notify_peer (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_notify_peer (T); }
+ if (skip_constructor_input_notify_users (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_notify_users (T); }
+ if (skip_constructor_input_notify_chats (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_notify_chats (T); }
+ if (skip_constructor_input_notify_all (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_notify_all (T); }
+ if (skip_constructor_input_notify_geo_chat_peer (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_notify_geo_chat_peer (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_input_peer *fetch_ds_type_input_peer (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x7f3b18ea: return fetch_ds_constructor_input_peer_empty (T); break;
+ case 0x7da07ec9: return fetch_ds_constructor_input_peer_self (T); break;
+ case 0x1023dbe8: return fetch_ds_constructor_input_peer_contact (T); break;
+ case 0x9b447325: return fetch_ds_constructor_input_peer_foreign (T); break;
+ case 0x179be863: return fetch_ds_constructor_input_peer_chat (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_input_peer *fetch_ds_type_bare_input_peer (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_peer_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_peer_empty (T); }
+ if (skip_constructor_input_peer_self (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_peer_self (T); }
+ if (skip_constructor_input_peer_contact (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_peer_contact (T); }
+ if (skip_constructor_input_peer_foreign (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_peer_foreign (T); }
+ if (skip_constructor_input_peer_chat (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_peer_chat (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_input_peer_notify_events *fetch_ds_type_input_peer_notify_events (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xf03064d8: return fetch_ds_constructor_input_peer_notify_events_empty (T); break;
+ case 0xe86a2c74: return fetch_ds_constructor_input_peer_notify_events_all (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_input_peer_notify_events *fetch_ds_type_bare_input_peer_notify_events (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_peer_notify_events_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_peer_notify_events_empty (T); }
+ if (skip_constructor_input_peer_notify_events_all (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_peer_notify_events_all (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_input_peer_notify_settings *fetch_ds_type_input_peer_notify_settings (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x46a2ce98: return fetch_ds_constructor_input_peer_notify_settings (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_input_peer_notify_settings *fetch_ds_type_bare_input_peer_notify_settings (struct paramed_type *T) {
+ return fetch_ds_constructor_input_peer_notify_settings (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_input_photo *fetch_ds_type_input_photo (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x1cd7bf0d: return fetch_ds_constructor_input_photo_empty (T); break;
+ case 0xfb95c6c4: return fetch_ds_constructor_input_photo (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_input_photo *fetch_ds_type_bare_input_photo (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_photo_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_photo_empty (T); }
+ if (skip_constructor_input_photo (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_photo (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_input_photo_crop *fetch_ds_type_input_photo_crop (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xade6b004: return fetch_ds_constructor_input_photo_crop_auto (T); break;
+ case 0xd9915325: return fetch_ds_constructor_input_photo_crop (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_input_photo_crop *fetch_ds_type_bare_input_photo_crop (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_photo_crop_auto (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_photo_crop_auto (T); }
+ if (skip_constructor_input_photo_crop (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_photo_crop (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_input_privacy_key *fetch_ds_type_input_privacy_key (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x4f96cb18: return fetch_ds_constructor_input_privacy_key_status_timestamp (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_input_privacy_key *fetch_ds_type_bare_input_privacy_key (struct paramed_type *T) {
+ return fetch_ds_constructor_input_privacy_key_status_timestamp (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_input_privacy_rule *fetch_ds_type_input_privacy_rule (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x0d09e07b: return fetch_ds_constructor_input_privacy_value_allow_contacts (T); break;
+ case 0x184b35ce: return fetch_ds_constructor_input_privacy_value_allow_all (T); break;
+ case 0x131cc67f: return fetch_ds_constructor_input_privacy_value_allow_users (T); break;
+ case 0x0ba52007: return fetch_ds_constructor_input_privacy_value_disallow_contacts (T); break;
+ case 0xd66b66c9: return fetch_ds_constructor_input_privacy_value_disallow_all (T); break;
+ case 0x90110467: return fetch_ds_constructor_input_privacy_value_disallow_users (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_input_privacy_rule *fetch_ds_type_bare_input_privacy_rule (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_privacy_value_allow_contacts (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_privacy_value_allow_contacts (T); }
+ if (skip_constructor_input_privacy_value_allow_all (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_privacy_value_allow_all (T); }
+ if (skip_constructor_input_privacy_value_allow_users (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_privacy_value_allow_users (T); }
+ if (skip_constructor_input_privacy_value_disallow_contacts (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_privacy_value_disallow_contacts (T); }
+ if (skip_constructor_input_privacy_value_disallow_all (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_privacy_value_disallow_all (T); }
+ if (skip_constructor_input_privacy_value_disallow_users (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_privacy_value_disallow_users (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_input_sticker_set *fetch_ds_type_input_sticker_set (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xffb62b95: return fetch_ds_constructor_input_sticker_set_empty (T); break;
+ case 0x9de7a269: return fetch_ds_constructor_input_sticker_set_i_d (T); break;
+ case 0x861cc8a0: return fetch_ds_constructor_input_sticker_set_short_name (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_input_sticker_set *fetch_ds_type_bare_input_sticker_set (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_sticker_set_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_sticker_set_empty (T); }
+ if (skip_constructor_input_sticker_set_i_d (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_sticker_set_i_d (T); }
+ if (skip_constructor_input_sticker_set_short_name (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_sticker_set_short_name (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_input_user *fetch_ds_type_input_user (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xb98886cf: return fetch_ds_constructor_input_user_empty (T); break;
+ case 0xf7c1b13f: return fetch_ds_constructor_input_user_self (T); break;
+ case 0x86e94f65: return fetch_ds_constructor_input_user_contact (T); break;
+ case 0x655e74ff: return fetch_ds_constructor_input_user_foreign (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_input_user *fetch_ds_type_bare_input_user (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_user_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_user_empty (T); }
+ if (skip_constructor_input_user_self (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_user_self (T); }
+ if (skip_constructor_input_user_contact (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_user_contact (T); }
+ if (skip_constructor_input_user_foreign (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_user_foreign (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_input_video *fetch_ds_type_input_video (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x5508ec75: return fetch_ds_constructor_input_video_empty (T); break;
+ case 0xee579652: return fetch_ds_constructor_input_video (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_input_video *fetch_ds_type_bare_input_video (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_video_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_video_empty (T); }
+ if (skip_constructor_input_video (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_video (T); }
+ assert (0);
+ return NULL;
+}
+int *fetch_ds_type_int (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xa8509bda: return fetch_ds_constructor_int (T); break;
+ default: assert (0); return NULL;
+ }
+}
+int *fetch_ds_type_bare_int (struct paramed_type *T) {
+ return fetch_ds_constructor_int (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_int128 *fetch_ds_type_int128 (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x7d36c439: return fetch_ds_constructor_int128 (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_int128 *fetch_ds_type_bare_int128 (struct paramed_type *T) {
+ return fetch_ds_constructor_int128 (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_int256 *fetch_ds_type_int256 (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xf2c798b3: return fetch_ds_constructor_int256 (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_int256 *fetch_ds_type_bare_int256 (struct paramed_type *T) {
+ return fetch_ds_constructor_int256 (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_keyboard_button *fetch_ds_type_keyboard_button (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xa2fa4880: return fetch_ds_constructor_keyboard_button (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_keyboard_button *fetch_ds_type_bare_keyboard_button (struct paramed_type *T) {
+ return fetch_ds_constructor_keyboard_button (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_keyboard_button_row *fetch_ds_type_keyboard_button_row (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x77608b83: return fetch_ds_constructor_keyboard_button_row (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_keyboard_button_row *fetch_ds_type_bare_keyboard_button_row (struct paramed_type *T) {
+ return fetch_ds_constructor_keyboard_button_row (T);
+ assert (0);
+ return NULL;
+}
+long long *fetch_ds_type_long (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x22076cba: return fetch_ds_constructor_long (T); break;
+ default: assert (0); return NULL;
+ }
+}
+long long *fetch_ds_type_bare_long (struct paramed_type *T) {
+ return fetch_ds_constructor_long (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_message *fetch_ds_type_message (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x83e5de54: return fetch_ds_constructor_message_empty (T); break;
+ case 0xc3060325: return fetch_ds_constructor_message (T); break;
+ case 0x1d86f70e: return fetch_ds_constructor_message_service (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_message *fetch_ds_type_bare_message (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_message_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_message_empty (T); }
+ if (skip_constructor_message (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_message (T); }
+ if (skip_constructor_message_service (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_message_service (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_message_action *fetch_ds_type_message_action (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xb6aef7b0: return fetch_ds_constructor_message_action_empty (T); break;
+ case 0xa6638b9a: return fetch_ds_constructor_message_action_chat_create (T); break;
+ case 0xb5a1ce5a: return fetch_ds_constructor_message_action_chat_edit_title (T); break;
+ case 0x7fcb13a8: return fetch_ds_constructor_message_action_chat_edit_photo (T); break;
+ case 0x95e3fbef: return fetch_ds_constructor_message_action_chat_delete_photo (T); break;
+ case 0x5e3cfc4b: return fetch_ds_constructor_message_action_chat_add_user (T); break;
+ case 0xb2ae9b0c: return fetch_ds_constructor_message_action_chat_delete_user (T); break;
+ case 0x6f038ebc: return fetch_ds_constructor_message_action_geo_chat_create (T); break;
+ case 0x0c7d53de: return fetch_ds_constructor_message_action_geo_chat_checkin (T); break;
+ case 0xf89cf5e8: return fetch_ds_constructor_message_action_chat_joined_by_link (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_message_action *fetch_ds_type_bare_message_action (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_message_action_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_message_action_empty (T); }
+ if (skip_constructor_message_action_chat_create (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_message_action_chat_create (T); }
+ if (skip_constructor_message_action_chat_edit_title (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_message_action_chat_edit_title (T); }
+ if (skip_constructor_message_action_chat_edit_photo (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_message_action_chat_edit_photo (T); }
+ if (skip_constructor_message_action_chat_delete_photo (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_message_action_chat_delete_photo (T); }
+ if (skip_constructor_message_action_chat_add_user (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_message_action_chat_add_user (T); }
+ if (skip_constructor_message_action_chat_delete_user (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_message_action_chat_delete_user (T); }
+ if (skip_constructor_message_action_geo_chat_create (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_message_action_geo_chat_create (T); }
+ if (skip_constructor_message_action_geo_chat_checkin (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_message_action_geo_chat_checkin (T); }
+ if (skip_constructor_message_action_chat_joined_by_link (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_message_action_chat_joined_by_link (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_message_media *fetch_ds_type_message_media (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x3ded6320: return fetch_ds_constructor_message_media_empty (T); break;
+ case 0x3d8ce53d: return fetch_ds_constructor_message_media_photo (T); break;
+ case 0x5bcf1675: return fetch_ds_constructor_message_media_video (T); break;
+ case 0x56e0d474: return fetch_ds_constructor_message_media_geo (T); break;
+ case 0x5e7d2f39: return fetch_ds_constructor_message_media_contact (T); break;
+ case 0x9f84f49e: return fetch_ds_constructor_message_media_unsupported (T); break;
+ case 0x2fda2204: return fetch_ds_constructor_message_media_document (T); break;
+ case 0xc6b68300: return fetch_ds_constructor_message_media_audio (T); break;
+ case 0xa32dd600: return fetch_ds_constructor_message_media_web_page (T); break;
+ case 0x7912b71f: return fetch_ds_constructor_message_media_venue (T); break;
+ case 0xc8c45a2a: return fetch_ds_constructor_message_media_photo_l27 (T); break;
+ case 0xa2d24290: return fetch_ds_constructor_message_media_video_l27 (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_message_media *fetch_ds_type_bare_message_media (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_message_media_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_message_media_empty (T); }
+ if (skip_constructor_message_media_photo (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_message_media_photo (T); }
+ if (skip_constructor_message_media_video (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_message_media_video (T); }
+ if (skip_constructor_message_media_geo (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_message_media_geo (T); }
+ if (skip_constructor_message_media_contact (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_message_media_contact (T); }
+ if (skip_constructor_message_media_unsupported (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_message_media_unsupported (T); }
+ if (skip_constructor_message_media_document (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_message_media_document (T); }
+ if (skip_constructor_message_media_audio (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_message_media_audio (T); }
+ if (skip_constructor_message_media_web_page (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_message_media_web_page (T); }
+ if (skip_constructor_message_media_venue (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_message_media_venue (T); }
+ if (skip_constructor_message_media_photo_l27 (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_message_media_photo_l27 (T); }
+ if (skip_constructor_message_media_video_l27 (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_message_media_video_l27 (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_messages_filter *fetch_ds_type_messages_filter (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x57e2f66c: return fetch_ds_constructor_input_messages_filter_empty (T); break;
+ case 0x9609a51c: return fetch_ds_constructor_input_messages_filter_photos (T); break;
+ case 0x9fc00e65: return fetch_ds_constructor_input_messages_filter_video (T); break;
+ case 0x56e9f0e4: return fetch_ds_constructor_input_messages_filter_photo_video (T); break;
+ case 0xd95e73bb: return fetch_ds_constructor_input_messages_filter_photo_video_documents (T); break;
+ case 0x9eddf188: return fetch_ds_constructor_input_messages_filter_document (T); break;
+ case 0xcfc87522: return fetch_ds_constructor_input_messages_filter_audio (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_messages_filter *fetch_ds_type_bare_messages_filter (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_messages_filter_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_messages_filter_empty (T); }
+ if (skip_constructor_input_messages_filter_photos (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_messages_filter_photos (T); }
+ if (skip_constructor_input_messages_filter_video (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_messages_filter_video (T); }
+ if (skip_constructor_input_messages_filter_photo_video (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_messages_filter_photo_video (T); }
+ if (skip_constructor_input_messages_filter_photo_video_documents (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_messages_filter_photo_video_documents (T); }
+ if (skip_constructor_input_messages_filter_document (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_messages_filter_document (T); }
+ if (skip_constructor_input_messages_filter_audio (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_input_messages_filter_audio (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_nearest_dc *fetch_ds_type_nearest_dc (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x8e1a1775: return fetch_ds_constructor_nearest_dc (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_nearest_dc *fetch_ds_type_bare_nearest_dc (struct paramed_type *T) {
+ return fetch_ds_constructor_nearest_dc (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_notify_peer *fetch_ds_type_notify_peer (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x9fd40bd8: return fetch_ds_constructor_notify_peer (T); break;
+ case 0xb4c83b4c: return fetch_ds_constructor_notify_users (T); break;
+ case 0xc007cec3: return fetch_ds_constructor_notify_chats (T); break;
+ case 0x74d07c60: return fetch_ds_constructor_notify_all (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_notify_peer *fetch_ds_type_bare_notify_peer (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_notify_peer (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_notify_peer (T); }
+ if (skip_constructor_notify_users (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_notify_users (T); }
+ if (skip_constructor_notify_chats (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_notify_chats (T); }
+ if (skip_constructor_notify_all (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_notify_all (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_null *fetch_ds_type_null (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x56730bcc: return fetch_ds_constructor_null (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_null *fetch_ds_type_bare_null (struct paramed_type *T) {
+ return fetch_ds_constructor_null (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_p_q_inner_data *fetch_ds_type_p_q_inner_data (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x83c95aec: return fetch_ds_constructor_p_q_inner_data (T); break;
+ case 0x3c6a84d4: return fetch_ds_constructor_p_q_inner_data_temp (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_p_q_inner_data *fetch_ds_type_bare_p_q_inner_data (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_p_q_inner_data (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_p_q_inner_data (T); }
+ if (skip_constructor_p_q_inner_data_temp (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_p_q_inner_data_temp (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_peer *fetch_ds_type_peer (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x9db1bc6d: return fetch_ds_constructor_peer_user (T); break;
+ case 0xbad0e5bb: return fetch_ds_constructor_peer_chat (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_peer *fetch_ds_type_bare_peer (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_peer_user (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_peer_user (T); }
+ if (skip_constructor_peer_chat (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_peer_chat (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_peer_notify_events *fetch_ds_type_peer_notify_events (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xadd53cb3: return fetch_ds_constructor_peer_notify_events_empty (T); break;
+ case 0x6d1ded88: return fetch_ds_constructor_peer_notify_events_all (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_peer_notify_events *fetch_ds_type_bare_peer_notify_events (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_peer_notify_events_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_peer_notify_events_empty (T); }
+ if (skip_constructor_peer_notify_events_all (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_peer_notify_events_all (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_peer_notify_settings *fetch_ds_type_peer_notify_settings (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x70a68512: return fetch_ds_constructor_peer_notify_settings_empty (T); break;
+ case 0x8d5e11ee: return fetch_ds_constructor_peer_notify_settings (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_peer_notify_settings *fetch_ds_type_bare_peer_notify_settings (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_peer_notify_settings_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_peer_notify_settings_empty (T); }
+ if (skip_constructor_peer_notify_settings (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_peer_notify_settings (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_photo *fetch_ds_type_photo (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x2331b22d: return fetch_ds_constructor_photo_empty (T); break;
+ case 0xc3838076: return fetch_ds_constructor_photo (T); break;
+ case 0x22b56751: return fetch_ds_constructor_photo_l27 (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_photo *fetch_ds_type_bare_photo (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_photo_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_photo_empty (T); }
+ if (skip_constructor_photo (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_photo (T); }
+ if (skip_constructor_photo_l27 (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_photo_l27 (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_photo_size *fetch_ds_type_photo_size (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x0e17e23c: return fetch_ds_constructor_photo_size_empty (T); break;
+ case 0x77bfb61b: return fetch_ds_constructor_photo_size (T); break;
+ case 0xe9a734fa: return fetch_ds_constructor_photo_cached_size (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_photo_size *fetch_ds_type_bare_photo_size (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_photo_size_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_photo_size_empty (T); }
+ if (skip_constructor_photo_size (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_photo_size (T); }
+ if (skip_constructor_photo_cached_size (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_photo_cached_size (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_privacy_key *fetch_ds_type_privacy_key (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xbc2eab30: return fetch_ds_constructor_privacy_key_status_timestamp (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_privacy_key *fetch_ds_type_bare_privacy_key (struct paramed_type *T) {
+ return fetch_ds_constructor_privacy_key_status_timestamp (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_privacy_rule *fetch_ds_type_privacy_rule (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xfffe1bac: return fetch_ds_constructor_privacy_value_allow_contacts (T); break;
+ case 0x65427b82: return fetch_ds_constructor_privacy_value_allow_all (T); break;
+ case 0x4d5bbe0c: return fetch_ds_constructor_privacy_value_allow_users (T); break;
+ case 0xf888fa1a: return fetch_ds_constructor_privacy_value_disallow_contacts (T); break;
+ case 0x8b73e763: return fetch_ds_constructor_privacy_value_disallow_all (T); break;
+ case 0x0c7f49b7: return fetch_ds_constructor_privacy_value_disallow_users (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_privacy_rule *fetch_ds_type_bare_privacy_rule (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_privacy_value_allow_contacts (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_privacy_value_allow_contacts (T); }
+ if (skip_constructor_privacy_value_allow_all (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_privacy_value_allow_all (T); }
+ if (skip_constructor_privacy_value_allow_users (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_privacy_value_allow_users (T); }
+ if (skip_constructor_privacy_value_disallow_contacts (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_privacy_value_disallow_contacts (T); }
+ if (skip_constructor_privacy_value_disallow_all (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_privacy_value_disallow_all (T); }
+ if (skip_constructor_privacy_value_disallow_users (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_privacy_value_disallow_users (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_received_notify_message *fetch_ds_type_received_notify_message (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xa384b779: return fetch_ds_constructor_received_notify_message (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_received_notify_message *fetch_ds_type_bare_received_notify_message (struct paramed_type *T) {
+ return fetch_ds_constructor_received_notify_message (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_reply_markup *fetch_ds_type_reply_markup (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xa03e5b85: return fetch_ds_constructor_reply_keyboard_hide (T); break;
+ case 0xf4108aa0: return fetch_ds_constructor_reply_keyboard_force_reply (T); break;
+ case 0x3502758c: return fetch_ds_constructor_reply_keyboard_markup (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_reply_markup *fetch_ds_type_bare_reply_markup (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_reply_keyboard_hide (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_reply_keyboard_hide (T); }
+ if (skip_constructor_reply_keyboard_force_reply (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_reply_keyboard_force_reply (T); }
+ if (skip_constructor_reply_keyboard_markup (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_reply_keyboard_markup (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_res_p_q *fetch_ds_type_res_p_q (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x05162463: return fetch_ds_constructor_res_p_q (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_res_p_q *fetch_ds_type_bare_res_p_q (struct paramed_type *T) {
+ return fetch_ds_constructor_res_p_q (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_send_message_action *fetch_ds_type_send_message_action (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x16bf744e: return fetch_ds_constructor_send_message_typing_action (T); break;
+ case 0xfd5ec8f5: return fetch_ds_constructor_send_message_cancel_action (T); break;
+ case 0xa187d66f: return fetch_ds_constructor_send_message_record_video_action (T); break;
+ case 0x92042ff7: return fetch_ds_constructor_send_message_upload_video_action_l27 (T); break;
+ case 0xe9763aec: return fetch_ds_constructor_send_message_upload_video_action (T); break;
+ case 0xd52f73f7: return fetch_ds_constructor_send_message_record_audio_action (T); break;
+ case 0xe6ac8a6f: return fetch_ds_constructor_send_message_upload_audio_action_l27 (T); break;
+ case 0xf351d7ab: return fetch_ds_constructor_send_message_upload_audio_action (T); break;
+ case 0xd1d34a26: return fetch_ds_constructor_send_message_upload_photo_action (T); break;
+ case 0x8faee98e: return fetch_ds_constructor_send_message_upload_document_action_l27 (T); break;
+ case 0xaa0cd9e4: return fetch_ds_constructor_send_message_upload_document_action (T); break;
+ case 0x176f8ba1: return fetch_ds_constructor_send_message_geo_location_action (T); break;
+ case 0x628cbc6f: return fetch_ds_constructor_send_message_choose_contact_action (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_send_message_action *fetch_ds_type_bare_send_message_action (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_send_message_typing_action (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_send_message_typing_action (T); }
+ if (skip_constructor_send_message_cancel_action (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_send_message_cancel_action (T); }
+ if (skip_constructor_send_message_record_video_action (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_send_message_record_video_action (T); }
+ if (skip_constructor_send_message_upload_video_action_l27 (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_send_message_upload_video_action_l27 (T); }
+ if (skip_constructor_send_message_upload_video_action (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_send_message_upload_video_action (T); }
+ if (skip_constructor_send_message_record_audio_action (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_send_message_record_audio_action (T); }
+ if (skip_constructor_send_message_upload_audio_action_l27 (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_send_message_upload_audio_action_l27 (T); }
+ if (skip_constructor_send_message_upload_audio_action (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_send_message_upload_audio_action (T); }
+ if (skip_constructor_send_message_upload_photo_action (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_send_message_upload_photo_action (T); }
+ if (skip_constructor_send_message_upload_document_action_l27 (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_send_message_upload_document_action_l27 (T); }
+ if (skip_constructor_send_message_upload_document_action (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_send_message_upload_document_action (T); }
+ if (skip_constructor_send_message_geo_location_action (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_send_message_geo_location_action (T); }
+ if (skip_constructor_send_message_choose_contact_action (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_send_message_choose_contact_action (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_server_d_h_params *fetch_ds_type_server_d_h_params (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x79cb045d: return fetch_ds_constructor_server_d_h_params_fail (T); break;
+ case 0xd0e8075c: return fetch_ds_constructor_server_d_h_params_ok (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_server_d_h_params *fetch_ds_type_bare_server_d_h_params (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_server_d_h_params_fail (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_server_d_h_params_fail (T); }
+ if (skip_constructor_server_d_h_params_ok (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_server_d_h_params_ok (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_server_d_h_inner_data *fetch_ds_type_server_d_h_inner_data (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xb5890dba: return fetch_ds_constructor_server_d_h_inner_data (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_server_d_h_inner_data *fetch_ds_type_bare_server_d_h_inner_data (struct paramed_type *T) {
+ return fetch_ds_constructor_server_d_h_inner_data (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_set_client_d_h_params_answer *fetch_ds_type_set_client_d_h_params_answer (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x3bcbf734: return fetch_ds_constructor_dh_gen_ok (T); break;
+ case 0x46dc1fb9: return fetch_ds_constructor_dh_gen_retry (T); break;
+ case 0xa69dae02: return fetch_ds_constructor_dh_gen_fail (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_set_client_d_h_params_answer *fetch_ds_type_bare_set_client_d_h_params_answer (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_dh_gen_ok (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_dh_gen_ok (T); }
+ if (skip_constructor_dh_gen_retry (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_dh_gen_retry (T); }
+ if (skip_constructor_dh_gen_fail (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_dh_gen_fail (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_sticker_pack *fetch_ds_type_sticker_pack (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x12b299d4: return fetch_ds_constructor_sticker_pack (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_sticker_pack *fetch_ds_type_bare_sticker_pack (struct paramed_type *T) {
+ return fetch_ds_constructor_sticker_pack (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_sticker_set *fetch_ds_type_sticker_set (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xa7a43b17: return fetch_ds_constructor_sticker_set (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_sticker_set *fetch_ds_type_bare_sticker_set (struct paramed_type *T) {
+ return fetch_ds_constructor_sticker_set (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_string *fetch_ds_type_string (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xb5286e24: return fetch_ds_constructor_string (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_string *fetch_ds_type_bare_string (struct paramed_type *T) {
+ return fetch_ds_constructor_string (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_update *fetch_ds_type_update (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x1f2b0afd: return fetch_ds_constructor_update_new_message (T); break;
+ case 0x4e90bfd6: return fetch_ds_constructor_update_message_i_d (T); break;
+ case 0xa20db0e5: return fetch_ds_constructor_update_delete_messages (T); break;
+ case 0x5c486927: return fetch_ds_constructor_update_user_typing (T); break;
+ case 0x9a65ea1f: return fetch_ds_constructor_update_chat_user_typing (T); break;
+ case 0x07761198: return fetch_ds_constructor_update_chat_participants (T); break;
+ case 0x1bfbd823: return fetch_ds_constructor_update_user_status (T); break;
+ case 0xa7332b73: return fetch_ds_constructor_update_user_name (T); break;
+ case 0x95313b0c: return fetch_ds_constructor_update_user_photo (T); break;
+ case 0x2575bbb9: return fetch_ds_constructor_update_contact_registered (T); break;
+ case 0x9d2e67c5: return fetch_ds_constructor_update_contact_link (T); break;
+ case 0x8f06529a: return fetch_ds_constructor_update_new_authorization (T); break;
+ case 0x5a68e3f7: return fetch_ds_constructor_update_new_geo_chat_message (T); break;
+ case 0x12bcbd9a: return fetch_ds_constructor_update_new_encrypted_message (T); break;
+ case 0x1710f156: return fetch_ds_constructor_update_encrypted_chat_typing (T); break;
+ case 0xb4a2e88d: return fetch_ds_constructor_update_encryption (T); break;
+ case 0x38fe25b7: return fetch_ds_constructor_update_encrypted_messages_read (T); break;
+ case 0x3a0eeb22: return fetch_ds_constructor_update_chat_participant_add (T); break;
+ case 0x6e5f8c22: return fetch_ds_constructor_update_chat_participant_delete (T); break;
+ case 0x8e5e9873: return fetch_ds_constructor_update_dc_options (T); break;
+ case 0x80ece81a: return fetch_ds_constructor_update_user_blocked (T); break;
+ case 0xbec268ef: return fetch_ds_constructor_update_notify_settings (T); break;
+ case 0x382dd3e4: return fetch_ds_constructor_update_service_notification (T); break;
+ case 0xee3b272a: return fetch_ds_constructor_update_privacy (T); break;
+ case 0x12b9417b: return fetch_ds_constructor_update_user_phone (T); break;
+ case 0x9961fd5c: return fetch_ds_constructor_update_read_history_inbox (T); break;
+ case 0x2f2f21bf: return fetch_ds_constructor_update_read_history_outbox (T); break;
+ case 0x2cc36971: return fetch_ds_constructor_update_web_page (T); break;
+ case 0x68c13933: return fetch_ds_constructor_update_read_messages_contents (T); break;
+ case 0x03114739: return fetch_ds_constructor_update_msg_update (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_update *fetch_ds_type_bare_update (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_update_new_message (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_new_message (T); }
+ if (skip_constructor_update_message_i_d (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_message_i_d (T); }
+ if (skip_constructor_update_delete_messages (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_delete_messages (T); }
+ if (skip_constructor_update_user_typing (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_user_typing (T); }
+ if (skip_constructor_update_chat_user_typing (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_chat_user_typing (T); }
+ if (skip_constructor_update_chat_participants (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_chat_participants (T); }
+ if (skip_constructor_update_user_status (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_user_status (T); }
+ if (skip_constructor_update_user_name (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_user_name (T); }
+ if (skip_constructor_update_user_photo (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_user_photo (T); }
+ if (skip_constructor_update_contact_registered (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_contact_registered (T); }
+ if (skip_constructor_update_contact_link (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_contact_link (T); }
+ if (skip_constructor_update_new_authorization (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_new_authorization (T); }
+ if (skip_constructor_update_new_geo_chat_message (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_new_geo_chat_message (T); }
+ if (skip_constructor_update_new_encrypted_message (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_new_encrypted_message (T); }
+ if (skip_constructor_update_encrypted_chat_typing (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_encrypted_chat_typing (T); }
+ if (skip_constructor_update_encryption (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_encryption (T); }
+ if (skip_constructor_update_encrypted_messages_read (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_encrypted_messages_read (T); }
+ if (skip_constructor_update_chat_participant_add (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_chat_participant_add (T); }
+ if (skip_constructor_update_chat_participant_delete (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_chat_participant_delete (T); }
+ if (skip_constructor_update_dc_options (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_dc_options (T); }
+ if (skip_constructor_update_user_blocked (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_user_blocked (T); }
+ if (skip_constructor_update_notify_settings (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_notify_settings (T); }
+ if (skip_constructor_update_service_notification (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_service_notification (T); }
+ if (skip_constructor_update_privacy (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_privacy (T); }
+ if (skip_constructor_update_user_phone (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_user_phone (T); }
+ if (skip_constructor_update_read_history_inbox (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_read_history_inbox (T); }
+ if (skip_constructor_update_read_history_outbox (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_read_history_outbox (T); }
+ if (skip_constructor_update_web_page (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_web_page (T); }
+ if (skip_constructor_update_read_messages_contents (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_read_messages_contents (T); }
+ if (skip_constructor_update_msg_update (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_msg_update (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_updates *fetch_ds_type_updates (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xe317af7e: return fetch_ds_constructor_updates_too_long (T); break;
+ case 0xed5c2127: return fetch_ds_constructor_update_short_message (T); break;
+ case 0x52238b3c: return fetch_ds_constructor_update_short_chat_message (T); break;
+ case 0x78d4dec1: return fetch_ds_constructor_update_short (T); break;
+ case 0x725b04c3: return fetch_ds_constructor_updates_combined (T); break;
+ case 0x74ae4240: return fetch_ds_constructor_updates (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_updates *fetch_ds_type_bare_updates (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_updates_too_long (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_updates_too_long (T); }
+ if (skip_constructor_update_short_message (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_short_message (T); }
+ if (skip_constructor_update_short_chat_message (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_short_chat_message (T); }
+ if (skip_constructor_update_short (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_update_short (T); }
+ if (skip_constructor_updates_combined (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_updates_combined (T); }
+ if (skip_constructor_updates (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_updates (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_user *fetch_ds_type_user (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x200250ba: return fetch_ds_constructor_user_empty (T); break;
+ case 0x22e49072: return fetch_ds_constructor_user (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_user *fetch_ds_type_bare_user (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_user_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_user_empty (T); }
+ if (skip_constructor_user (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_user (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_user_full *fetch_ds_type_user_full (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x5a89ac5b: return fetch_ds_constructor_user_full (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_user_full *fetch_ds_type_bare_user_full (struct paramed_type *T) {
+ return fetch_ds_constructor_user_full (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_user_profile_photo *fetch_ds_type_user_profile_photo (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x4f11bae1: return fetch_ds_constructor_user_profile_photo_empty (T); break;
+ case 0xd559d8c8: return fetch_ds_constructor_user_profile_photo (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_user_profile_photo *fetch_ds_type_bare_user_profile_photo (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_user_profile_photo_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_user_profile_photo_empty (T); }
+ if (skip_constructor_user_profile_photo (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_user_profile_photo (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_user_status *fetch_ds_type_user_status (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x09d05049: return fetch_ds_constructor_user_status_empty (T); break;
+ case 0xedb93949: return fetch_ds_constructor_user_status_online (T); break;
+ case 0x008c703f: return fetch_ds_constructor_user_status_offline (T); break;
+ case 0xe26f42f1: return fetch_ds_constructor_user_status_recently (T); break;
+ case 0x07bf09fc: return fetch_ds_constructor_user_status_last_week (T); break;
+ case 0x77ebc742: return fetch_ds_constructor_user_status_last_month (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_user_status *fetch_ds_type_bare_user_status (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_user_status_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_user_status_empty (T); }
+ if (skip_constructor_user_status_online (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_user_status_online (T); }
+ if (skip_constructor_user_status_offline (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_user_status_offline (T); }
+ if (skip_constructor_user_status_recently (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_user_status_recently (T); }
+ if (skip_constructor_user_status_last_week (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_user_status_last_week (T); }
+ if (skip_constructor_user_status_last_month (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_user_status_last_month (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_vector *fetch_ds_type_vector (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x1cb5c415: return fetch_ds_constructor_vector (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_vector *fetch_ds_type_bare_vector (struct paramed_type *T) {
+ return fetch_ds_constructor_vector (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_video *fetch_ds_type_video (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xc10658a8: return fetch_ds_constructor_video_empty (T); break;
+ case 0xee9f4a4d: return fetch_ds_constructor_video (T); break;
+ case 0x388fa391: return fetch_ds_constructor_video_l27 (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_video *fetch_ds_type_bare_video (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_video_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_video_empty (T); }
+ if (skip_constructor_video (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_video (T); }
+ if (skip_constructor_video_l27 (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_video_l27 (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_wall_paper *fetch_ds_type_wall_paper (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xccb03657: return fetch_ds_constructor_wall_paper (T); break;
+ case 0x63117f24: return fetch_ds_constructor_wall_paper_solid (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_wall_paper *fetch_ds_type_bare_wall_paper (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_wall_paper (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_wall_paper (T); }
+ if (skip_constructor_wall_paper_solid (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_wall_paper_solid (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_web_page *fetch_ds_type_web_page (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xeb1477e8: return fetch_ds_constructor_web_page_empty (T); break;
+ case 0xc586da1c: return fetch_ds_constructor_web_page_pending (T); break;
+ case 0xa31ea0b5: return fetch_ds_constructor_web_page (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_web_page *fetch_ds_type_bare_web_page (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_web_page_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_web_page_empty (T); }
+ if (skip_constructor_web_page_pending (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_web_page_pending (T); }
+ if (skip_constructor_web_page (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_web_page (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_account_authorizations *fetch_ds_type_account_authorizations (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x1250abde: return fetch_ds_constructor_account_authorizations (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_account_authorizations *fetch_ds_type_bare_account_authorizations (struct paramed_type *T) {
+ return fetch_ds_constructor_account_authorizations (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_account_password *fetch_ds_type_account_password (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x96dabc18: return fetch_ds_constructor_account_no_password (T); break;
+ case 0x7c18141c: return fetch_ds_constructor_account_password (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_account_password *fetch_ds_type_bare_account_password (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_account_no_password (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_account_no_password (T); }
+ if (skip_constructor_account_password (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_account_password (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_account_password_input_settings *fetch_ds_type_account_password_input_settings (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xbcfc532c: return fetch_ds_constructor_account_password_input_settings (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_account_password_input_settings *fetch_ds_type_bare_account_password_input_settings (struct paramed_type *T) {
+ return fetch_ds_constructor_account_password_input_settings (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_account_password_settings *fetch_ds_type_account_password_settings (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xb7b72ab3: return fetch_ds_constructor_account_password_settings (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_account_password_settings *fetch_ds_type_bare_account_password_settings (struct paramed_type *T) {
+ return fetch_ds_constructor_account_password_settings (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_account_privacy_rules *fetch_ds_type_account_privacy_rules (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x554abb6f: return fetch_ds_constructor_account_privacy_rules (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_account_privacy_rules *fetch_ds_type_bare_account_privacy_rules (struct paramed_type *T) {
+ return fetch_ds_constructor_account_privacy_rules (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_account_sent_change_phone_code *fetch_ds_type_account_sent_change_phone_code (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xa4f58c4c: return fetch_ds_constructor_account_sent_change_phone_code (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_account_sent_change_phone_code *fetch_ds_type_bare_account_sent_change_phone_code (struct paramed_type *T) {
+ return fetch_ds_constructor_account_sent_change_phone_code (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_auth_authorization *fetch_ds_type_auth_authorization (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xff036af1: return fetch_ds_constructor_auth_authorization (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_auth_authorization *fetch_ds_type_bare_auth_authorization (struct paramed_type *T) {
+ return fetch_ds_constructor_auth_authorization (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_auth_checked_phone *fetch_ds_type_auth_checked_phone (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x811ea28e: return fetch_ds_constructor_auth_checked_phone (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_auth_checked_phone *fetch_ds_type_bare_auth_checked_phone (struct paramed_type *T) {
+ return fetch_ds_constructor_auth_checked_phone (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_auth_exported_authorization *fetch_ds_type_auth_exported_authorization (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xdf969c2d: return fetch_ds_constructor_auth_exported_authorization (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_auth_exported_authorization *fetch_ds_type_bare_auth_exported_authorization (struct paramed_type *T) {
+ return fetch_ds_constructor_auth_exported_authorization (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_auth_password_recovery *fetch_ds_type_auth_password_recovery (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x137948a5: return fetch_ds_constructor_auth_password_recovery (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_auth_password_recovery *fetch_ds_type_bare_auth_password_recovery (struct paramed_type *T) {
+ return fetch_ds_constructor_auth_password_recovery (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_auth_sent_code *fetch_ds_type_auth_sent_code (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xefed51d9: return fetch_ds_constructor_auth_sent_code (T); break;
+ case 0xe325edcf: return fetch_ds_constructor_auth_sent_app_code (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_auth_sent_code *fetch_ds_type_bare_auth_sent_code (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_auth_sent_code (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_auth_sent_code (T); }
+ if (skip_constructor_auth_sent_app_code (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_auth_sent_app_code (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_binlog_encr_key *fetch_ds_type_binlog_encr_key (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x0377168f: return fetch_ds_constructor_binlog_encr_key (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_binlog_encr_key *fetch_ds_type_bare_binlog_encr_key (struct paramed_type *T) {
+ return fetch_ds_constructor_binlog_encr_key (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_binlog_update *fetch_ds_type_binlog_update (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x3b06de69: return fetch_ds_constructor_binlog_start (T); break;
+ case 0xf96feb32: return fetch_ds_constructor_binlog_dc_option (T); break;
+ case 0x7c0d22d8: return fetch_ds_constructor_binlog_dc_option_new (T); break;
+ case 0x71e8c156: return fetch_ds_constructor_binlog_auth_key (T); break;
+ case 0x9e83dbdc: return fetch_ds_constructor_binlog_default_dc (T); break;
+ case 0x26451bb5: return fetch_ds_constructor_binlog_dc_signed (T); break;
+ case 0x68a870e8: return fetch_ds_constructor_binlog_our_id (T); break;
+ case 0xeaeb7826: return fetch_ds_constructor_binlog_set_dh_params (T); break;
+ case 0x2ca8c939: return fetch_ds_constructor_binlog_set_pts (T); break;
+ case 0xd95738ac: return fetch_ds_constructor_binlog_set_qts (T); break;
+ case 0x1d0f4b52: return fetch_ds_constructor_binlog_set_date (T); break;
+ case 0x6eeb2989: return fetch_ds_constructor_binlog_set_seq (T); break;
+ case 0xee1b38e8: return fetch_ds_constructor_binlog_encr_chat_delete (T); break;
+ case 0x84977251: return fetch_ds_constructor_binlog_encr_chat_new (T); break;
+ case 0x9d49488d: return fetch_ds_constructor_binlog_encr_chat_exchange_new (T); break;
+ case 0xac55d447: return fetch_ds_constructor_binlog_user_delete (T); break;
+ case 0x127cf2f9: return fetch_ds_constructor_binlog_user_new (T); break;
+ case 0x0a10aa92: return fetch_ds_constructor_binlog_chat_new (T); break;
+ case 0x535475ea: return fetch_ds_constructor_binlog_chat_add_participant (T); break;
+ case 0x7dd1a1a2: return fetch_ds_constructor_binlog_chat_del_participant (T); break;
+ case 0x3c873416: return fetch_ds_constructor_binlog_set_msg_id (T); break;
+ case 0x847e77b1: return fetch_ds_constructor_binlog_message_delete (T); break;
+ case 0x427cfcdb: return fetch_ds_constructor_binlog_message_new (T); break;
+ case 0x6cf7cabc: return fetch_ds_constructor_binlog_message_encr_new (T); break;
+ case 0x6dd4d85f: return fetch_ds_constructor_binlog_msg_update (T); break;
+ case 0x83327955: return fetch_ds_constructor_binlog_reset_authorization (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_binlog_update *fetch_ds_type_bare_binlog_update (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_binlog_start (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_binlog_start (T); }
+ if (skip_constructor_binlog_dc_option (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_binlog_dc_option (T); }
+ if (skip_constructor_binlog_dc_option_new (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_binlog_dc_option_new (T); }
+ if (skip_constructor_binlog_auth_key (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_binlog_auth_key (T); }
+ if (skip_constructor_binlog_default_dc (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_binlog_default_dc (T); }
+ if (skip_constructor_binlog_dc_signed (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_binlog_dc_signed (T); }
+ if (skip_constructor_binlog_our_id (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_binlog_our_id (T); }
+ if (skip_constructor_binlog_set_dh_params (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_binlog_set_dh_params (T); }
+ if (skip_constructor_binlog_set_pts (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_binlog_set_pts (T); }
+ if (skip_constructor_binlog_set_qts (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_binlog_set_qts (T); }
+ if (skip_constructor_binlog_set_date (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_binlog_set_date (T); }
+ if (skip_constructor_binlog_set_seq (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_binlog_set_seq (T); }
+ if (skip_constructor_binlog_encr_chat_delete (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_binlog_encr_chat_delete (T); }
+ if (skip_constructor_binlog_encr_chat_new (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_binlog_encr_chat_new (T); }
+ if (skip_constructor_binlog_encr_chat_exchange_new (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_binlog_encr_chat_exchange_new (T); }
+ if (skip_constructor_binlog_user_delete (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_binlog_user_delete (T); }
+ if (skip_constructor_binlog_user_new (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_binlog_user_new (T); }
+ if (skip_constructor_binlog_chat_new (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_binlog_chat_new (T); }
+ if (skip_constructor_binlog_chat_add_participant (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_binlog_chat_add_participant (T); }
+ if (skip_constructor_binlog_chat_del_participant (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_binlog_chat_del_participant (T); }
+ if (skip_constructor_binlog_set_msg_id (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_binlog_set_msg_id (T); }
+ if (skip_constructor_binlog_message_delete (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_binlog_message_delete (T); }
+ if (skip_constructor_binlog_message_new (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_binlog_message_new (T); }
+ if (skip_constructor_binlog_message_encr_new (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_binlog_message_encr_new (T); }
+ if (skip_constructor_binlog_msg_update (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_binlog_msg_update (T); }
+ if (skip_constructor_binlog_reset_authorization (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_binlog_reset_authorization (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_contacts_blocked *fetch_ds_type_contacts_blocked (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x1c138d15: return fetch_ds_constructor_contacts_blocked (T); break;
+ case 0x900802a1: return fetch_ds_constructor_contacts_blocked_slice (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_contacts_blocked *fetch_ds_type_bare_contacts_blocked (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_contacts_blocked (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_contacts_blocked (T); }
+ if (skip_constructor_contacts_blocked_slice (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_contacts_blocked_slice (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_contacts_contacts *fetch_ds_type_contacts_contacts (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xb74ba9d2: return fetch_ds_constructor_contacts_contacts_not_modified (T); break;
+ case 0x6f8b8cb2: return fetch_ds_constructor_contacts_contacts (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_contacts_contacts *fetch_ds_type_bare_contacts_contacts (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_contacts_contacts_not_modified (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_contacts_contacts_not_modified (T); }
+ if (skip_constructor_contacts_contacts (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_contacts_contacts (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_contacts_found *fetch_ds_type_contacts_found (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x0566000e: return fetch_ds_constructor_contacts_found (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_contacts_found *fetch_ds_type_bare_contacts_found (struct paramed_type *T) {
+ return fetch_ds_constructor_contacts_found (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_contacts_imported_contacts *fetch_ds_type_contacts_imported_contacts (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xad524315: return fetch_ds_constructor_contacts_imported_contacts (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_contacts_imported_contacts *fetch_ds_type_bare_contacts_imported_contacts (struct paramed_type *T) {
+ return fetch_ds_constructor_contacts_imported_contacts (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_contacts_link *fetch_ds_type_contacts_link (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x3ace484c: return fetch_ds_constructor_contacts_link (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_contacts_link *fetch_ds_type_bare_contacts_link (struct paramed_type *T) {
+ return fetch_ds_constructor_contacts_link (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_contacts_suggested *fetch_ds_type_contacts_suggested (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x5649dcc5: return fetch_ds_constructor_contacts_suggested (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_contacts_suggested *fetch_ds_type_bare_contacts_suggested (struct paramed_type *T) {
+ return fetch_ds_constructor_contacts_suggested (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_geochats_located *fetch_ds_type_geochats_located (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x48feb267: return fetch_ds_constructor_geochats_located (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_geochats_located *fetch_ds_type_bare_geochats_located (struct paramed_type *T) {
+ return fetch_ds_constructor_geochats_located (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_geochats_messages *fetch_ds_type_geochats_messages (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xd1526db1: return fetch_ds_constructor_geochats_messages (T); break;
+ case 0xbc5863e8: return fetch_ds_constructor_geochats_messages_slice (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_geochats_messages *fetch_ds_type_bare_geochats_messages (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_geochats_messages (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_geochats_messages (T); }
+ if (skip_constructor_geochats_messages_slice (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_geochats_messages_slice (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_geochats_stated_message *fetch_ds_type_geochats_stated_message (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x17b1578b: return fetch_ds_constructor_geochats_stated_message (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_geochats_stated_message *fetch_ds_type_bare_geochats_stated_message (struct paramed_type *T) {
+ return fetch_ds_constructor_geochats_stated_message (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_help_app_update *fetch_ds_type_help_app_update (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x8987f311: return fetch_ds_constructor_help_app_update (T); break;
+ case 0xc45a6536: return fetch_ds_constructor_help_no_app_update (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_help_app_update *fetch_ds_type_bare_help_app_update (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_help_app_update (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_help_app_update (T); }
+ if (skip_constructor_help_no_app_update (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_help_no_app_update (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_help_invite_text *fetch_ds_type_help_invite_text (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x18cb9f78: return fetch_ds_constructor_help_invite_text (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_help_invite_text *fetch_ds_type_bare_help_invite_text (struct paramed_type *T) {
+ return fetch_ds_constructor_help_invite_text (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_help_support *fetch_ds_type_help_support (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x17c6b5f6: return fetch_ds_constructor_help_support (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_help_support *fetch_ds_type_bare_help_support (struct paramed_type *T) {
+ return fetch_ds_constructor_help_support (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_messages_affected_history *fetch_ds_type_messages_affected_history (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xb45c69d1: return fetch_ds_constructor_messages_affected_history (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_messages_affected_history *fetch_ds_type_bare_messages_affected_history (struct paramed_type *T) {
+ return fetch_ds_constructor_messages_affected_history (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_messages_affected_messages *fetch_ds_type_messages_affected_messages (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x84d19185: return fetch_ds_constructor_messages_affected_messages (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_messages_affected_messages *fetch_ds_type_bare_messages_affected_messages (struct paramed_type *T) {
+ return fetch_ds_constructor_messages_affected_messages (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_messages_all_stickers *fetch_ds_type_messages_all_stickers (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xe86602c3: return fetch_ds_constructor_messages_all_stickers_not_modified (T); break;
+ case 0x5ce352ec: return fetch_ds_constructor_messages_all_stickers (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_messages_all_stickers *fetch_ds_type_bare_messages_all_stickers (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_messages_all_stickers_not_modified (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_messages_all_stickers_not_modified (T); }
+ if (skip_constructor_messages_all_stickers (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_messages_all_stickers (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_messages_chat_full *fetch_ds_type_messages_chat_full (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xe5d7d19c: return fetch_ds_constructor_messages_chat_full (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_messages_chat_full *fetch_ds_type_bare_messages_chat_full (struct paramed_type *T) {
+ return fetch_ds_constructor_messages_chat_full (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_messages_chats *fetch_ds_type_messages_chats (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x64ff9fd5: return fetch_ds_constructor_messages_chats (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_messages_chats *fetch_ds_type_bare_messages_chats (struct paramed_type *T) {
+ return fetch_ds_constructor_messages_chats (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_messages_dh_config *fetch_ds_type_messages_dh_config (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xc0e24635: return fetch_ds_constructor_messages_dh_config_not_modified (T); break;
+ case 0x2c221edd: return fetch_ds_constructor_messages_dh_config (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_messages_dh_config *fetch_ds_type_bare_messages_dh_config (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_messages_dh_config_not_modified (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_messages_dh_config_not_modified (T); }
+ if (skip_constructor_messages_dh_config (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_messages_dh_config (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_messages_dialogs *fetch_ds_type_messages_dialogs (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x15ba6c40: return fetch_ds_constructor_messages_dialogs (T); break;
+ case 0x71e094f3: return fetch_ds_constructor_messages_dialogs_slice (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_messages_dialogs *fetch_ds_type_bare_messages_dialogs (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_messages_dialogs (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_messages_dialogs (T); }
+ if (skip_constructor_messages_dialogs_slice (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_messages_dialogs_slice (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_messages_message *fetch_ds_type_messages_message (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x3f4e0648: return fetch_ds_constructor_messages_message_empty (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_messages_message *fetch_ds_type_bare_messages_message (struct paramed_type *T) {
+ return fetch_ds_constructor_messages_message_empty (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_messages_messages *fetch_ds_type_messages_messages (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x8c718e87: return fetch_ds_constructor_messages_messages (T); break;
+ case 0x0b446ae3: return fetch_ds_constructor_messages_messages_slice (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_messages_messages *fetch_ds_type_bare_messages_messages (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_messages_messages (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_messages_messages (T); }
+ if (skip_constructor_messages_messages_slice (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_messages_messages_slice (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_messages_sent_encrypted_message *fetch_ds_type_messages_sent_encrypted_message (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x560f8935: return fetch_ds_constructor_messages_sent_encrypted_message (T); break;
+ case 0x9493ff32: return fetch_ds_constructor_messages_sent_encrypted_file (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_messages_sent_encrypted_message *fetch_ds_type_bare_messages_sent_encrypted_message (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_messages_sent_encrypted_message (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_messages_sent_encrypted_message (T); }
+ if (skip_constructor_messages_sent_encrypted_file (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_messages_sent_encrypted_file (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_messages_sent_message *fetch_ds_type_messages_sent_message (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x4c3d47f3: return fetch_ds_constructor_messages_sent_message (T); break;
+ case 0x35a1a663: return fetch_ds_constructor_messages_sent_message_link (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_messages_sent_message *fetch_ds_type_bare_messages_sent_message (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_messages_sent_message (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_messages_sent_message (T); }
+ if (skip_constructor_messages_sent_message_link (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_messages_sent_message_link (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_messages_sticker_set *fetch_ds_type_messages_sticker_set (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xb60a24a6: return fetch_ds_constructor_messages_sticker_set (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_messages_sticker_set *fetch_ds_type_bare_messages_sticker_set (struct paramed_type *T) {
+ return fetch_ds_constructor_messages_sticker_set (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_messages_stickers *fetch_ds_type_messages_stickers (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xf1749a22: return fetch_ds_constructor_messages_stickers_not_modified (T); break;
+ case 0x8a8ecd32: return fetch_ds_constructor_messages_stickers (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_messages_stickers *fetch_ds_type_bare_messages_stickers (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_messages_stickers_not_modified (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_messages_stickers_not_modified (T); }
+ if (skip_constructor_messages_stickers (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_messages_stickers (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_photos_photo *fetch_ds_type_photos_photo (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x20212ca8: return fetch_ds_constructor_photos_photo (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_photos_photo *fetch_ds_type_bare_photos_photo (struct paramed_type *T) {
+ return fetch_ds_constructor_photos_photo (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_photos_photos *fetch_ds_type_photos_photos (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x8dca6aa5: return fetch_ds_constructor_photos_photos (T); break;
+ case 0x15051f54: return fetch_ds_constructor_photos_photos_slice (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_photos_photos *fetch_ds_type_bare_photos_photos (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_photos_photos (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_photos_photos (T); }
+ if (skip_constructor_photos_photos_slice (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_photos_photos_slice (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_storage_file_type *fetch_ds_type_storage_file_type (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xaa963b05: return fetch_ds_constructor_storage_file_unknown (T); break;
+ case 0x007efe0e: return fetch_ds_constructor_storage_file_jpeg (T); break;
+ case 0xcae1aadf: return fetch_ds_constructor_storage_file_gif (T); break;
+ case 0x0a4f63c0: return fetch_ds_constructor_storage_file_png (T); break;
+ case 0xae1e508d: return fetch_ds_constructor_storage_file_pdf (T); break;
+ case 0x528a0677: return fetch_ds_constructor_storage_file_mp3 (T); break;
+ case 0x4b09ebbc: return fetch_ds_constructor_storage_file_mov (T); break;
+ case 0x40bc6f52: return fetch_ds_constructor_storage_file_partial (T); break;
+ case 0xb3cea0e4: return fetch_ds_constructor_storage_file_mp4 (T); break;
+ case 0x1081464c: return fetch_ds_constructor_storage_file_webp (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_storage_file_type *fetch_ds_type_bare_storage_file_type (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_storage_file_unknown (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_storage_file_unknown (T); }
+ if (skip_constructor_storage_file_jpeg (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_storage_file_jpeg (T); }
+ if (skip_constructor_storage_file_gif (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_storage_file_gif (T); }
+ if (skip_constructor_storage_file_png (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_storage_file_png (T); }
+ if (skip_constructor_storage_file_pdf (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_storage_file_pdf (T); }
+ if (skip_constructor_storage_file_mp3 (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_storage_file_mp3 (T); }
+ if (skip_constructor_storage_file_mov (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_storage_file_mov (T); }
+ if (skip_constructor_storage_file_partial (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_storage_file_partial (T); }
+ if (skip_constructor_storage_file_mp4 (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_storage_file_mp4 (T); }
+ if (skip_constructor_storage_file_webp (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_storage_file_webp (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_updates_difference *fetch_ds_type_updates_difference (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x5d75a138: return fetch_ds_constructor_updates_difference_empty (T); break;
+ case 0x00f49ca0: return fetch_ds_constructor_updates_difference (T); break;
+ case 0xa8fb1981: return fetch_ds_constructor_updates_difference_slice (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_updates_difference *fetch_ds_type_bare_updates_difference (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_updates_difference_empty (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_updates_difference_empty (T); }
+ if (skip_constructor_updates_difference (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_updates_difference (T); }
+ if (skip_constructor_updates_difference_slice (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_updates_difference_slice (T); }
+ assert (0);
+ return NULL;
+}
+struct tl_ds_updates_state *fetch_ds_type_updates_state (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xa56c2a3e: return fetch_ds_constructor_updates_state (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_updates_state *fetch_ds_type_bare_updates_state (struct paramed_type *T) {
+ return fetch_ds_constructor_updates_state (T);
+ assert (0);
+ return NULL;
+}
+struct tl_ds_upload_file *fetch_ds_type_upload_file (struct paramed_type *T) {
+ assert (in_remaining () >= 4);
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x096a18d5: return fetch_ds_constructor_upload_file (T); break;
+ default: assert (0); return NULL;
+ }
+}
+struct tl_ds_upload_file *fetch_ds_type_bare_upload_file (struct paramed_type *T) {
+ return fetch_ds_constructor_upload_file (T);
+ assert (0);
+ return NULL;
+}
+void *fetch_ds_type_any (struct paramed_type *T) {
+ switch (T->type->name) {
+ case 0xb8d0afdf: return fetch_ds_type_account_days_t_t_l (T);
+ case 0x472f5020: return fetch_ds_type_bare_account_days_t_t_l (T);
+ case 0x9fc5ec4e: return fetch_ds_type_audio (T);
+ case 0x603a13b1: return fetch_ds_type_bare_audio (T);
+ case 0x7bf2e6f6: return fetch_ds_type_authorization (T);
+ case 0x840d1909: return fetch_ds_type_bare_authorization (T);
+ case 0x250be282: return fetch_ds_type_bool (T);
+ case 0xdaf41d7d: return fetch_ds_type_bare_bool (T);
+ case 0x75e7ea6c: return fetch_ds_type_bot_command (T);
+ case 0x8a181593: return fetch_ds_type_bare_bot_command (T);
+ case 0xb2e16f93: return fetch_ds_type_bot_info (T);
+ case 0x4d1e906c: return fetch_ds_type_bare_bot_info (T);
+ case 0x0ee1379f: return fetch_ds_type_bytes (T);
+ case 0xf11ec860: return fetch_ds_type_bare_bytes (T);
+ case 0x7bd865dc: return fetch_ds_type_chat (T);
+ case 0x84279a23: return fetch_ds_type_bare_chat (T);
+ case 0x2e02a614: return fetch_ds_type_chat_full (T);
+ case 0xd1fd59eb: return fetch_ds_type_bare_chat_full (T);
+ case 0x94f910b1: return fetch_ds_type_chat_invite (T);
+ case 0x6b06ef4e: return fetch_ds_type_bare_chat_invite (T);
+ case 0x3631cf4c: return fetch_ds_type_chat_located (T);
+ case 0xc9ce30b3: return fetch_ds_type_bare_chat_located (T);
+ case 0xc8d7493e: return fetch_ds_type_chat_participant (T);
+ case 0x3728b6c1: return fetch_ds_type_bare_chat_participant (T);
+ case 0x77930f9f: return fetch_ds_type_chat_participants (T);
+ case 0x886cf060: return fetch_ds_type_bare_chat_participants (T);
+ case 0x56922676: return fetch_ds_type_chat_photo (T);
+ case 0xa96dd989: return fetch_ds_type_bare_chat_photo (T);
+ case 0x6643b654: return fetch_ds_type_client_d_h_inner_data (T);
+ case 0x99bc49ab: return fetch_ds_type_bare_client_d_h_inner_data (T);
+ case 0x4e32b894: return fetch_ds_type_config (T);
+ case 0xb1cd476b: return fetch_ds_type_bare_config (T);
+ case 0xf911c994: return fetch_ds_type_contact (T);
+ case 0x06ee366b: return fetch_ds_type_bare_contact (T);
+ case 0x561bc879: return fetch_ds_type_contact_blocked (T);
+ case 0xa9e43786: return fetch_ds_type_bare_contact_blocked (T);
+ case 0xea879f95: return fetch_ds_type_contact_found (T);
+ case 0x1578606a: return fetch_ds_type_bare_contact_found (T);
+ case 0x522fbc63: return fetch_ds_type_contact_link (T);
+ case 0xadd0439c: return fetch_ds_type_bare_contact_link (T);
+ case 0xd3680c61: return fetch_ds_type_contact_status (T);
+ case 0x2c97f39e: return fetch_ds_type_bare_contact_status (T);
+ case 0x3de191a1: return fetch_ds_type_contact_suggested (T);
+ case 0xc21e6e5e: return fetch_ds_type_bare_contact_suggested (T);
+ case 0x2b1a62f0: return fetch_ds_type_dc_option (T);
+ case 0xd4e59d0f: return fetch_ds_type_bare_dc_option (T);
+ case 0x535b7918: return fetch_ds_type_decrypted_message (T);
+ case 0xaca486e7: return fetch_ds_type_bare_decrypted_message (T);
+ case 0x4e0eefde: return fetch_ds_type_decrypted_message_action (T);
+ case 0xb1f11021: return fetch_ds_type_bare_decrypted_message_action (T);
+ case 0x1be31789: return fetch_ds_type_decrypted_message_layer (T);
+ case 0xe41ce876: return fetch_ds_type_bare_decrypted_message_layer (T);
+ case 0x34e0d674: return fetch_ds_type_decrypted_message_media (T);
+ case 0xcb1f298b: return fetch_ds_type_bare_decrypted_message_media (T);
+ case 0xc1dd804a: return fetch_ds_type_dialog (T);
+ case 0x3e227fb5: return fetch_ds_type_bare_dialog (T);
+ case 0xae636f24: return fetch_ds_type_disabled_feature (T);
+ case 0x519c90db: return fetch_ds_type_bare_disabled_feature (T);
+ case 0x51a73418: return fetch_ds_type_document (T);
+ case 0xae58cbe7: return fetch_ds_type_bare_document (T);
+ case 0x97c637a3: return fetch_ds_type_document_attribute (T);
+ case 0x6839c85c: return fetch_ds_type_bare_document_attribute (T);
+ case 0x2210c154: return fetch_ds_type_double (T);
+ case 0xddef3eab: return fetch_ds_type_bare_double (T);
+ case 0xb1718213: return fetch_ds_type_encrypted_chat (T);
+ case 0x4e8e7dec: return fetch_ds_type_bare_encrypted_chat (T);
+ case 0x886fd032: return fetch_ds_type_encrypted_file (T);
+ case 0x77902fcd: return fetch_ds_type_bare_encrypted_file (T);
+ case 0xce6b8a1e: return fetch_ds_type_encrypted_message (T);
+ case 0x319475e1: return fetch_ds_type_bare_encrypted_message (T);
+ case 0xc4b9f9bb: return fetch_ds_type_error (T);
+ case 0x3b460644: return fetch_ds_type_bare_error (T);
+ case 0x95f132d5: return fetch_ds_type_exported_chat_invite (T);
+ case 0x6a0ecd2a: return fetch_ds_type_bare_exported_chat_invite (T);
+ case 0x2f8ffb30: return fetch_ds_type_file_location (T);
+ case 0xd07004cf: return fetch_ds_type_bare_file_location (T);
+ case 0xf67b4034: return fetch_ds_type_geo_chat_message (T);
+ case 0x0984bfcb: return fetch_ds_type_bare_geo_chat_message (T);
+ case 0x315e0a53: return fetch_ds_type_geo_point (T);
+ case 0xcea1f5ac: return fetch_ds_type_bare_geo_point (T);
+ case 0xd0028438: return fetch_ds_type_imported_contact (T);
+ case 0x2ffd7bc7: return fetch_ds_type_bare_imported_contact (T);
+ case 0x770656a8: return fetch_ds_type_input_app_event (T);
+ case 0x88f9a957: return fetch_ds_type_bare_input_app_event (T);
+ case 0xae8e9c7b: return fetch_ds_type_input_audio (T);
+ case 0x51716384: return fetch_ds_type_bare_input_audio (T);
+ case 0x3a60776d: return fetch_ds_type_input_chat_photo (T);
+ case 0xc59f8892: return fetch_ds_type_bare_input_chat_photo (T);
+ case 0xf392b7f4: return fetch_ds_type_input_contact (T);
+ case 0x0c6d480b: return fetch_ds_type_bare_input_contact (T);
+ case 0x6a8963fc: return fetch_ds_type_input_document (T);
+ case 0x95769c03: return fetch_ds_type_bare_input_document (T);
+ case 0xf141b5e1: return fetch_ds_type_input_encrypted_chat (T);
+ case 0x0ebe4a1e: return fetch_ds_type_bare_input_encrypted_chat (T);
+ case 0x0b5c064f: return fetch_ds_type_input_encrypted_file (T);
+ case 0xf4a3f9b0: return fetch_ds_type_bare_input_encrypted_file (T);
+ case 0x0f60f9ca: return fetch_ds_type_input_file (T);
+ case 0xf09f0635: return fetch_ds_type_bare_input_file (T);
+ case 0xe6daa38b: return fetch_ds_type_input_file_location (T);
+ case 0x19255c74: return fetch_ds_type_bare_input_file_location (T);
+ case 0x74d456fa: return fetch_ds_type_input_geo_chat (T);
+ case 0x8b2ba905: return fetch_ds_type_bare_input_geo_chat (T);
+ case 0x17768f1f: return fetch_ds_type_input_geo_point (T);
+ case 0xe88970e0: return fetch_ds_type_bare_input_geo_point (T);
+ case 0xb32c91dd: return fetch_ds_type_input_media (T);
+ case 0x4cd36e22: return fetch_ds_type_bare_input_media (T);
+ case 0x02b6911b: return fetch_ds_type_input_notify_peer (T);
+ case 0xfd496ee4: return fetch_ds_type_bare_input_notify_peer (T);
+ case 0x9e67268d: return fetch_ds_type_input_peer (T);
+ case 0x6198d972: return fetch_ds_type_bare_input_peer (T);
+ case 0x185a48ac: return fetch_ds_type_input_peer_notify_events (T);
+ case 0xe7a5b753: return fetch_ds_type_bare_input_peer_notify_events (T);
+ case 0x46a2ce98: return fetch_ds_type_input_peer_notify_settings (T);
+ case 0xb95d3167: return fetch_ds_type_bare_input_peer_notify_settings (T);
+ case 0xe74279c9: return fetch_ds_type_input_photo (T);
+ case 0x18bd8636: return fetch_ds_type_bare_input_photo (T);
+ case 0x7477e321: return fetch_ds_type_input_photo_crop (T);
+ case 0x8b881cde: return fetch_ds_type_bare_input_photo_crop (T);
+ case 0x4f96cb18: return fetch_ds_type_input_privacy_key (T);
+ case 0xb06934e7: return fetch_ds_type_bare_input_privacy_key (T);
+ case 0x4b815163: return fetch_ds_type_input_privacy_rule (T);
+ case 0xb47eae9c: return fetch_ds_type_bare_input_privacy_rule (T);
+ case 0xe44d415c: return fetch_ds_type_input_sticker_set (T);
+ case 0x1bb2bea3: return fetch_ds_type_bare_input_sticker_set (T);
+ case 0xadfe0c6a: return fetch_ds_type_input_user (T);
+ case 0x5201f395: return fetch_ds_type_bare_input_user (T);
+ case 0xbb5f7a27: return fetch_ds_type_input_video (T);
+ case 0x44a085d8: return fetch_ds_type_bare_input_video (T);
+ case 0xa8509bda: return fetch_ds_type_int (T);
+ case 0x57af6425: return fetch_ds_type_bare_int (T);
+ case 0x7d36c439: return fetch_ds_type_int128 (T);
+ case 0x82c93bc6: return fetch_ds_type_bare_int128 (T);
+ case 0xf2c798b3: return fetch_ds_type_int256 (T);
+ case 0x0d38674c: return fetch_ds_type_bare_int256 (T);
+ case 0xa2fa4880: return fetch_ds_type_keyboard_button (T);
+ case 0x5d05b77f: return fetch_ds_type_bare_keyboard_button (T);
+ case 0x77608b83: return fetch_ds_type_keyboard_button_row (T);
+ case 0x889f747c: return fetch_ds_type_bare_keyboard_button_row (T);
+ case 0x22076cba: return fetch_ds_type_long (T);
+ case 0xddf89345: return fetch_ds_type_bare_long (T);
+ case 0x5d652a7f: return fetch_ds_type_message (T);
+ case 0xa29ad580: return fetch_ds_type_bare_message (T);
+ case 0x383415fa: return fetch_ds_type_message_action (T);
+ case 0xc7cbea05: return fetch_ds_type_bare_message_action (T);
+ case 0x95f2471a: return fetch_ds_type_message_media (T);
+ case 0x6a0db8e5: return fetch_ds_type_bare_message_media (T);
+ case 0x80895ae0: return fetch_ds_type_messages_filter (T);
+ case 0x7f76a51f: return fetch_ds_type_bare_messages_filter (T);
+ case 0x8e1a1775: return fetch_ds_type_nearest_dc (T);
+ case 0x71e5e88a: return fetch_ds_type_bare_nearest_dc (T);
+ case 0x9fcb8237: return fetch_ds_type_notify_peer (T);
+ case 0x60347dc8: return fetch_ds_type_bare_notify_peer (T);
+ case 0x56730bcc: return fetch_ds_type_null (T);
+ case 0xa98cf433: return fetch_ds_type_bare_null (T);
+ case 0xbfa3de38: return fetch_ds_type_p_q_inner_data (T);
+ case 0x405c21c7: return fetch_ds_type_bare_p_q_inner_data (T);
+ case 0x276159d6: return fetch_ds_type_peer (T);
+ case 0xd89ea629: return fetch_ds_type_bare_peer (T);
+ case 0xc0c8d13b: return fetch_ds_type_peer_notify_events (T);
+ case 0x3f372ec4: return fetch_ds_type_bare_peer_notify_events (T);
+ case 0xfdf894fc: return fetch_ds_type_peer_notify_settings (T);
+ case 0x02076b03: return fetch_ds_type_bare_peer_notify_settings (T);
+ case 0xc207550a: return fetch_ds_type_photo (T);
+ case 0x3df8aaf5: return fetch_ds_type_bare_photo (T);
+ case 0x900f60dd: return fetch_ds_type_photo_size (T);
+ case 0x6ff09f22: return fetch_ds_type_bare_photo_size (T);
+ case 0xbc2eab30: return fetch_ds_type_privacy_key (T);
+ case 0x43d154cf: return fetch_ds_type_bare_privacy_key (T);
+ case 0xa8638aec: return fetch_ds_type_privacy_rule (T);
+ case 0x579c7513: return fetch_ds_type_bare_privacy_rule (T);
+ case 0xa384b779: return fetch_ds_type_received_notify_message (T);
+ case 0x5c7b4886: return fetch_ds_type_bare_received_notify_message (T);
+ case 0x612ca4a9: return fetch_ds_type_reply_markup (T);
+ case 0x9ed35b56: return fetch_ds_type_bare_reply_markup (T);
+ case 0x05162463: return fetch_ds_type_res_p_q (T);
+ case 0xfae9db9c: return fetch_ds_type_bare_res_p_q (T);
+ case 0x70541c7e: return fetch_ds_type_send_message_action (T);
+ case 0x8fabe381: return fetch_ds_type_bare_send_message_action (T);
+ case 0xa9230301: return fetch_ds_type_server_d_h_params (T);
+ case 0x56dcfcfe: return fetch_ds_type_bare_server_d_h_params (T);
+ case 0xb5890dba: return fetch_ds_type_server_d_h_inner_data (T);
+ case 0x4a76f245: return fetch_ds_type_bare_server_d_h_inner_data (T);
+ case 0xdb8a468f: return fetch_ds_type_set_client_d_h_params_answer (T);
+ case 0x2475b970: return fetch_ds_type_bare_set_client_d_h_params_answer (T);
+ case 0x12b299d4: return fetch_ds_type_sticker_pack (T);
+ case 0xed4d662b: return fetch_ds_type_bare_sticker_pack (T);
+ case 0xa7a43b17: return fetch_ds_type_sticker_set (T);
+ case 0x585bc4e8: return fetch_ds_type_bare_sticker_set (T);
+ case 0xb5286e24: return fetch_ds_type_string (T);
+ case 0x4ad791db: return fetch_ds_type_bare_string (T);
+ case 0x2e02b27e: return fetch_ds_type_update (T);
+ case 0xd1fd4d81: return fetch_ds_type_bare_update (T);
+ case 0x22499d27: return fetch_ds_type_updates (T);
+ case 0xddb662d8: return fetch_ds_type_bare_updates (T);
+ case 0x02e6c0c8: return fetch_ds_type_user (T);
+ case 0xfd193f37: return fetch_ds_type_bare_user (T);
+ case 0x5a89ac5b: return fetch_ds_type_user_full (T);
+ case 0xa57653a4: return fetch_ds_type_bare_user_full (T);
+ case 0x9a486229: return fetch_ds_type_user_profile_photo (T);
+ case 0x65b79dd6: return fetch_ds_type_bare_user_profile_photo (T);
+ case 0x76de9570: return fetch_ds_type_user_status (T);
+ case 0x89216a8f: return fetch_ds_type_bare_user_status (T);
+ case 0x1cb5c415: return fetch_ds_type_vector (T);
+ case 0xe34a3bea: return fetch_ds_type_bare_vector (T);
+ case 0x1716b174: return fetch_ds_type_video (T);
+ case 0xe8e94e8b: return fetch_ds_type_bare_video (T);
+ case 0xafa14973: return fetch_ds_type_wall_paper (T);
+ case 0x505eb68c: return fetch_ds_type_bare_wall_paper (T);
+ case 0x8d8c0d41: return fetch_ds_type_web_page (T);
+ case 0x7273f2be: return fetch_ds_type_bare_web_page (T);
+ case 0x1250abde: return fetch_ds_type_account_authorizations (T);
+ case 0xedaf5421: return fetch_ds_type_bare_account_authorizations (T);
+ case 0xeac2a804: return fetch_ds_type_account_password (T);
+ case 0x153d57fb: return fetch_ds_type_bare_account_password (T);
+ case 0xbcfc532c: return fetch_ds_type_account_password_input_settings (T);
+ case 0x4303acd3: return fetch_ds_type_bare_account_password_input_settings (T);
+ case 0xb7b72ab3: return fetch_ds_type_account_password_settings (T);
+ case 0x4848d54c: return fetch_ds_type_bare_account_password_settings (T);
+ case 0x554abb6f: return fetch_ds_type_account_privacy_rules (T);
+ case 0xaab54490: return fetch_ds_type_bare_account_privacy_rules (T);
+ case 0xa4f58c4c: return fetch_ds_type_account_sent_change_phone_code (T);
+ case 0x5b0a73b3: return fetch_ds_type_bare_account_sent_change_phone_code (T);
+ case 0xff036af1: return fetch_ds_type_auth_authorization (T);
+ case 0x00fc950e: return fetch_ds_type_bare_auth_authorization (T);
+ case 0x811ea28e: return fetch_ds_type_auth_checked_phone (T);
+ case 0x7ee15d71: return fetch_ds_type_bare_auth_checked_phone (T);
+ case 0xdf969c2d: return fetch_ds_type_auth_exported_authorization (T);
+ case 0x206963d2: return fetch_ds_type_bare_auth_exported_authorization (T);
+ case 0x137948a5: return fetch_ds_type_auth_password_recovery (T);
+ case 0xec86b75a: return fetch_ds_type_bare_auth_password_recovery (T);
+ case 0x0cc8bc16: return fetch_ds_type_auth_sent_code (T);
+ case 0xf33743e9: return fetch_ds_type_bare_auth_sent_code (T);
+ case 0x0377168f: return fetch_ds_type_binlog_encr_key (T);
+ case 0xfc88e970: return fetch_ds_type_bare_binlog_encr_key (T);
+ case 0x66ff03a6: return fetch_ds_type_binlog_update (T);
+ case 0x9900fc59: return fetch_ds_type_bare_binlog_update (T);
+ case 0x8c1b8fb4: return fetch_ds_type_contacts_blocked (T);
+ case 0x73e4704b: return fetch_ds_type_bare_contacts_blocked (T);
+ case 0xd8c02560: return fetch_ds_type_contacts_contacts (T);
+ case 0x273fda9f: return fetch_ds_type_bare_contacts_contacts (T);
+ case 0x0566000e: return fetch_ds_type_contacts_found (T);
+ case 0xfa99fff1: return fetch_ds_type_bare_contacts_found (T);
+ case 0xad524315: return fetch_ds_type_contacts_imported_contacts (T);
+ case 0x52adbcea: return fetch_ds_type_bare_contacts_imported_contacts (T);
+ case 0x3ace484c: return fetch_ds_type_contacts_link (T);
+ case 0xc531b7b3: return fetch_ds_type_bare_contacts_link (T);
+ case 0x5649dcc5: return fetch_ds_type_contacts_suggested (T);
+ case 0xa9b6233a: return fetch_ds_type_bare_contacts_suggested (T);
+ case 0x48feb267: return fetch_ds_type_geochats_located (T);
+ case 0xb7014d98: return fetch_ds_type_bare_geochats_located (T);
+ case 0x6d0a0e59: return fetch_ds_type_geochats_messages (T);
+ case 0x92f5f1a6: return fetch_ds_type_bare_geochats_messages (T);
+ case 0x17b1578b: return fetch_ds_type_geochats_stated_message (T);
+ case 0xe84ea874: return fetch_ds_type_bare_geochats_stated_message (T);
+ case 0x4ddd9627: return fetch_ds_type_help_app_update (T);
+ case 0xb22269d8: return fetch_ds_type_bare_help_app_update (T);
+ case 0x18cb9f78: return fetch_ds_type_help_invite_text (T);
+ case 0xe7346087: return fetch_ds_type_bare_help_invite_text (T);
+ case 0x17c6b5f6: return fetch_ds_type_help_support (T);
+ case 0xe8394a09: return fetch_ds_type_bare_help_support (T);
+ case 0xb45c69d1: return fetch_ds_type_messages_affected_history (T);
+ case 0x4ba3962e: return fetch_ds_type_bare_messages_affected_history (T);
+ case 0x84d19185: return fetch_ds_type_messages_affected_messages (T);
+ case 0x7b2e6e7a: return fetch_ds_type_bare_messages_affected_messages (T);
+ case 0xb485502f: return fetch_ds_type_messages_all_stickers (T);
+ case 0x4b7aafd0: return fetch_ds_type_bare_messages_all_stickers (T);
+ case 0xe5d7d19c: return fetch_ds_type_messages_chat_full (T);
+ case 0x1a282e63: return fetch_ds_type_bare_messages_chat_full (T);
+ case 0x64ff9fd5: return fetch_ds_type_messages_chats (T);
+ case 0x9b00602a: return fetch_ds_type_bare_messages_chats (T);
+ case 0xecc058e8: return fetch_ds_type_messages_dh_config (T);
+ case 0x133fa717: return fetch_ds_type_bare_messages_dh_config (T);
+ case 0x645af8b3: return fetch_ds_type_messages_dialogs (T);
+ case 0x9ba5074c: return fetch_ds_type_bare_messages_dialogs (T);
+ case 0x3f4e0648: return fetch_ds_type_messages_message (T);
+ case 0xc0b1f9b7: return fetch_ds_type_bare_messages_message (T);
+ case 0x8735e464: return fetch_ds_type_messages_messages (T);
+ case 0x78ca1b9b: return fetch_ds_type_bare_messages_messages (T);
+ case 0xc29c7607: return fetch_ds_type_messages_sent_encrypted_message (T);
+ case 0x3d6389f8: return fetch_ds_type_bare_messages_sent_encrypted_message (T);
+ case 0x799ce190: return fetch_ds_type_messages_sent_message (T);
+ case 0x86631e6f: return fetch_ds_type_bare_messages_sent_message (T);
+ case 0xb60a24a6: return fetch_ds_type_messages_sticker_set (T);
+ case 0x49f5db59: return fetch_ds_type_bare_messages_sticker_set (T);
+ case 0x7bfa5710: return fetch_ds_type_messages_stickers (T);
+ case 0x8405a8ef: return fetch_ds_type_bare_messages_stickers (T);
+ case 0x20212ca8: return fetch_ds_type_photos_photo (T);
+ case 0xdfded357: return fetch_ds_type_bare_photos_photo (T);
+ case 0x98cf75f1: return fetch_ds_type_photos_photos (T);
+ case 0x67308a0e: return fetch_ds_type_bare_photos_photos (T);
+ case 0x3e2838a8: return fetch_ds_type_storage_file_type (T);
+ case 0xc1d7c757: return fetch_ds_type_bare_storage_file_type (T);
+ case 0xf57a2419: return fetch_ds_type_updates_difference (T);
+ case 0x0a85dbe6: return fetch_ds_type_bare_updates_difference (T);
+ case 0xa56c2a3e: return fetch_ds_type_updates_state (T);
+ case 0x5a93d5c1: return fetch_ds_type_bare_updates_state (T);
+ case 0x096a18d5: return fetch_ds_type_upload_file (T);
+ case 0xf695e72a: return fetch_ds_type_bare_upload_file (T);
+ default: return NULL; }
+}
diff --git a/protocols/Telegram/tgl/auto/auto-fetch-ds.h b/protocols/Telegram/tgl/auto/auto-fetch-ds.h
new file mode 100644
index 0000000000..6c39473b14
--- /dev/null
+++ b/protocols/Telegram/tgl/auto/auto-fetch-ds.h
@@ -0,0 +1,716 @@
+#ifdef _MSC_VER
+#include "..\auto.h"
+#else
+#include "auto.h"
+#endif
+#include <assert.h>
+#include <stdio.h>
+struct tgl_state;
+struct tl_ds_account_days_t_t_l *fetch_ds_constructor_account_days_t_t_l (struct paramed_type *T);
+struct tl_ds_audio *fetch_ds_constructor_audio_empty (struct paramed_type *T);
+struct tl_ds_audio *fetch_ds_constructor_audio (struct paramed_type *T);
+struct tl_ds_authorization *fetch_ds_constructor_authorization (struct paramed_type *T);
+struct tl_ds_bool *fetch_ds_constructor_bool_false (struct paramed_type *T);
+struct tl_ds_bool *fetch_ds_constructor_bool_true (struct paramed_type *T);
+struct tl_ds_bot_command *fetch_ds_constructor_bot_command (struct paramed_type *T);
+struct tl_ds_bot_command *fetch_ds_constructor_bot_command_old (struct paramed_type *T);
+struct tl_ds_bot_info *fetch_ds_constructor_bot_info_empty (struct paramed_type *T);
+struct tl_ds_bot_info *fetch_ds_constructor_bot_info (struct paramed_type *T);
+struct tl_ds_string *fetch_ds_constructor_bytes (struct paramed_type *T);
+struct tl_ds_chat *fetch_ds_constructor_chat_empty (struct paramed_type *T);
+struct tl_ds_chat *fetch_ds_constructor_chat (struct paramed_type *T);
+struct tl_ds_chat *fetch_ds_constructor_chat_forbidden (struct paramed_type *T);
+struct tl_ds_chat *fetch_ds_constructor_geo_chat (struct paramed_type *T);
+struct tl_ds_chat_full *fetch_ds_constructor_chat_full (struct paramed_type *T);
+struct tl_ds_chat_invite *fetch_ds_constructor_chat_invite_already (struct paramed_type *T);
+struct tl_ds_chat_invite *fetch_ds_constructor_chat_invite (struct paramed_type *T);
+struct tl_ds_chat_located *fetch_ds_constructor_chat_located (struct paramed_type *T);
+struct tl_ds_chat_participant *fetch_ds_constructor_chat_participant (struct paramed_type *T);
+struct tl_ds_chat_participants *fetch_ds_constructor_chat_participants_forbidden (struct paramed_type *T);
+struct tl_ds_chat_participants *fetch_ds_constructor_chat_participants (struct paramed_type *T);
+struct tl_ds_chat_photo *fetch_ds_constructor_chat_photo_empty (struct paramed_type *T);
+struct tl_ds_chat_photo *fetch_ds_constructor_chat_photo (struct paramed_type *T);
+struct tl_ds_client_d_h_inner_data *fetch_ds_constructor_client_d_h_inner_data (struct paramed_type *T);
+struct tl_ds_config *fetch_ds_constructor_config (struct paramed_type *T);
+struct tl_ds_contact *fetch_ds_constructor_contact (struct paramed_type *T);
+struct tl_ds_contact_blocked *fetch_ds_constructor_contact_blocked (struct paramed_type *T);
+struct tl_ds_contact_found *fetch_ds_constructor_contact_found (struct paramed_type *T);
+struct tl_ds_contact_link *fetch_ds_constructor_contact_link_unknown (struct paramed_type *T);
+struct tl_ds_contact_link *fetch_ds_constructor_contact_link_none (struct paramed_type *T);
+struct tl_ds_contact_link *fetch_ds_constructor_contact_link_has_phone (struct paramed_type *T);
+struct tl_ds_contact_link *fetch_ds_constructor_contact_link_contact (struct paramed_type *T);
+struct tl_ds_contact_status *fetch_ds_constructor_contact_status (struct paramed_type *T);
+struct tl_ds_contact_suggested *fetch_ds_constructor_contact_suggested (struct paramed_type *T);
+struct tl_ds_dc_option *fetch_ds_constructor_dc_option_l28 (struct paramed_type *T);
+struct tl_ds_dc_option *fetch_ds_constructor_dc_option (struct paramed_type *T);
+struct tl_ds_decrypted_message *fetch_ds_constructor_decrypted_message (struct paramed_type *T);
+struct tl_ds_decrypted_message *fetch_ds_constructor_decrypted_message_service (struct paramed_type *T);
+struct tl_ds_decrypted_message_action *fetch_ds_constructor_decrypted_message_action_set_message_t_t_l (struct paramed_type *T);
+struct tl_ds_decrypted_message_action *fetch_ds_constructor_decrypted_message_action_read_messages (struct paramed_type *T);
+struct tl_ds_decrypted_message_action *fetch_ds_constructor_decrypted_message_action_delete_messages (struct paramed_type *T);
+struct tl_ds_decrypted_message_action *fetch_ds_constructor_decrypted_message_action_screenshot_messages (struct paramed_type *T);
+struct tl_ds_decrypted_message_action *fetch_ds_constructor_decrypted_message_action_flush_history (struct paramed_type *T);
+struct tl_ds_decrypted_message_action *fetch_ds_constructor_decrypted_message_action_resend (struct paramed_type *T);
+struct tl_ds_decrypted_message_action *fetch_ds_constructor_decrypted_message_action_notify_layer (struct paramed_type *T);
+struct tl_ds_decrypted_message_action *fetch_ds_constructor_decrypted_message_action_typing (struct paramed_type *T);
+struct tl_ds_decrypted_message_action *fetch_ds_constructor_decrypted_message_action_request_key (struct paramed_type *T);
+struct tl_ds_decrypted_message_action *fetch_ds_constructor_decrypted_message_action_accept_key (struct paramed_type *T);
+struct tl_ds_decrypted_message_action *fetch_ds_constructor_decrypted_message_action_abort_key (struct paramed_type *T);
+struct tl_ds_decrypted_message_action *fetch_ds_constructor_decrypted_message_action_commit_key (struct paramed_type *T);
+struct tl_ds_decrypted_message_action *fetch_ds_constructor_decrypted_message_action_noop (struct paramed_type *T);
+struct tl_ds_decrypted_message_layer *fetch_ds_constructor_decrypted_message_layer (struct paramed_type *T);
+struct tl_ds_decrypted_message_media *fetch_ds_constructor_decrypted_message_media_empty (struct paramed_type *T);
+struct tl_ds_decrypted_message_media *fetch_ds_constructor_decrypted_message_media_photo (struct paramed_type *T);
+struct tl_ds_decrypted_message_media *fetch_ds_constructor_decrypted_message_media_geo_point (struct paramed_type *T);
+struct tl_ds_decrypted_message_media *fetch_ds_constructor_decrypted_message_media_contact (struct paramed_type *T);
+struct tl_ds_decrypted_message_media *fetch_ds_constructor_decrypted_message_media_document (struct paramed_type *T);
+struct tl_ds_decrypted_message_media *fetch_ds_constructor_decrypted_message_media_video (struct paramed_type *T);
+struct tl_ds_decrypted_message_media *fetch_ds_constructor_decrypted_message_media_audio (struct paramed_type *T);
+struct tl_ds_decrypted_message_media *fetch_ds_constructor_decrypted_message_media_external_document (struct paramed_type *T);
+struct tl_ds_decrypted_message_media *fetch_ds_constructor_decrypted_message_media_video_l12 (struct paramed_type *T);
+struct tl_ds_decrypted_message_media *fetch_ds_constructor_decrypted_message_media_audio_l12 (struct paramed_type *T);
+struct tl_ds_dialog *fetch_ds_constructor_dialog (struct paramed_type *T);
+struct tl_ds_disabled_feature *fetch_ds_constructor_disabled_feature (struct paramed_type *T);
+struct tl_ds_document *fetch_ds_constructor_document_empty (struct paramed_type *T);
+struct tl_ds_document *fetch_ds_constructor_document (struct paramed_type *T);
+struct tl_ds_document *fetch_ds_constructor_document_l19 (struct paramed_type *T);
+struct tl_ds_document_attribute *fetch_ds_constructor_document_attribute_image_size (struct paramed_type *T);
+struct tl_ds_document_attribute *fetch_ds_constructor_document_attribute_animated (struct paramed_type *T);
+struct tl_ds_document_attribute *fetch_ds_constructor_document_attribute_sticker_l28 (struct paramed_type *T);
+struct tl_ds_document_attribute *fetch_ds_constructor_document_attribute_sticker (struct paramed_type *T);
+struct tl_ds_document_attribute *fetch_ds_constructor_document_attribute_video (struct paramed_type *T);
+struct tl_ds_document_attribute *fetch_ds_constructor_document_attribute_audio (struct paramed_type *T);
+struct tl_ds_document_attribute *fetch_ds_constructor_document_attribute_filename (struct paramed_type *T);
+double *fetch_ds_constructor_double (struct paramed_type *T);
+struct tl_ds_encrypted_chat *fetch_ds_constructor_encrypted_chat_empty (struct paramed_type *T);
+struct tl_ds_encrypted_chat *fetch_ds_constructor_encrypted_chat_waiting (struct paramed_type *T);
+struct tl_ds_encrypted_chat *fetch_ds_constructor_encrypted_chat_requested (struct paramed_type *T);
+struct tl_ds_encrypted_chat *fetch_ds_constructor_encrypted_chat (struct paramed_type *T);
+struct tl_ds_encrypted_chat *fetch_ds_constructor_encrypted_chat_discarded (struct paramed_type *T);
+struct tl_ds_encrypted_file *fetch_ds_constructor_encrypted_file_empty (struct paramed_type *T);
+struct tl_ds_encrypted_file *fetch_ds_constructor_encrypted_file (struct paramed_type *T);
+struct tl_ds_encrypted_message *fetch_ds_constructor_encrypted_message (struct paramed_type *T);
+struct tl_ds_encrypted_message *fetch_ds_constructor_encrypted_message_service (struct paramed_type *T);
+struct tl_ds_error *fetch_ds_constructor_error (struct paramed_type *T);
+struct tl_ds_exported_chat_invite *fetch_ds_constructor_chat_invite_empty (struct paramed_type *T);
+struct tl_ds_exported_chat_invite *fetch_ds_constructor_chat_invite_exported (struct paramed_type *T);
+struct tl_ds_file_location *fetch_ds_constructor_file_location_unavailable (struct paramed_type *T);
+struct tl_ds_file_location *fetch_ds_constructor_file_location (struct paramed_type *T);
+struct tl_ds_geo_chat_message *fetch_ds_constructor_geo_chat_message_empty (struct paramed_type *T);
+struct tl_ds_geo_chat_message *fetch_ds_constructor_geo_chat_message (struct paramed_type *T);
+struct tl_ds_geo_chat_message *fetch_ds_constructor_geo_chat_message_service (struct paramed_type *T);
+struct tl_ds_geo_point *fetch_ds_constructor_geo_point_empty (struct paramed_type *T);
+struct tl_ds_geo_point *fetch_ds_constructor_geo_point (struct paramed_type *T);
+struct tl_ds_imported_contact *fetch_ds_constructor_imported_contact (struct paramed_type *T);
+struct tl_ds_input_app_event *fetch_ds_constructor_input_app_event (struct paramed_type *T);
+struct tl_ds_input_audio *fetch_ds_constructor_input_audio_empty (struct paramed_type *T);
+struct tl_ds_input_audio *fetch_ds_constructor_input_audio (struct paramed_type *T);
+struct tl_ds_input_chat_photo *fetch_ds_constructor_input_chat_photo_empty (struct paramed_type *T);
+struct tl_ds_input_chat_photo *fetch_ds_constructor_input_chat_uploaded_photo (struct paramed_type *T);
+struct tl_ds_input_chat_photo *fetch_ds_constructor_input_chat_photo (struct paramed_type *T);
+struct tl_ds_input_contact *fetch_ds_constructor_input_phone_contact (struct paramed_type *T);
+struct tl_ds_input_document *fetch_ds_constructor_input_document_empty (struct paramed_type *T);
+struct tl_ds_input_document *fetch_ds_constructor_input_document (struct paramed_type *T);
+struct tl_ds_input_encrypted_chat *fetch_ds_constructor_input_encrypted_chat (struct paramed_type *T);
+struct tl_ds_input_encrypted_file *fetch_ds_constructor_input_encrypted_file_empty (struct paramed_type *T);
+struct tl_ds_input_encrypted_file *fetch_ds_constructor_input_encrypted_file_uploaded (struct paramed_type *T);
+struct tl_ds_input_encrypted_file *fetch_ds_constructor_input_encrypted_file (struct paramed_type *T);
+struct tl_ds_input_encrypted_file *fetch_ds_constructor_input_encrypted_file_big_uploaded (struct paramed_type *T);
+struct tl_ds_input_file *fetch_ds_constructor_input_file (struct paramed_type *T);
+struct tl_ds_input_file *fetch_ds_constructor_input_file_big (struct paramed_type *T);
+struct tl_ds_input_file_location *fetch_ds_constructor_input_file_location (struct paramed_type *T);
+struct tl_ds_input_file_location *fetch_ds_constructor_input_video_file_location (struct paramed_type *T);
+struct tl_ds_input_file_location *fetch_ds_constructor_input_encrypted_file_location (struct paramed_type *T);
+struct tl_ds_input_file_location *fetch_ds_constructor_input_audio_file_location (struct paramed_type *T);
+struct tl_ds_input_file_location *fetch_ds_constructor_input_document_file_location (struct paramed_type *T);
+struct tl_ds_input_geo_chat *fetch_ds_constructor_input_geo_chat (struct paramed_type *T);
+struct tl_ds_input_geo_point *fetch_ds_constructor_input_geo_point_empty (struct paramed_type *T);
+struct tl_ds_input_geo_point *fetch_ds_constructor_input_geo_point (struct paramed_type *T);
+struct tl_ds_input_media *fetch_ds_constructor_input_media_empty (struct paramed_type *T);
+struct tl_ds_input_media *fetch_ds_constructor_input_media_uploaded_photo (struct paramed_type *T);
+struct tl_ds_input_media *fetch_ds_constructor_input_media_photo (struct paramed_type *T);
+struct tl_ds_input_media *fetch_ds_constructor_input_media_geo_point (struct paramed_type *T);
+struct tl_ds_input_media *fetch_ds_constructor_input_media_contact (struct paramed_type *T);
+struct tl_ds_input_media *fetch_ds_constructor_input_media_uploaded_video (struct paramed_type *T);
+struct tl_ds_input_media *fetch_ds_constructor_input_media_uploaded_thumb_video (struct paramed_type *T);
+struct tl_ds_input_media *fetch_ds_constructor_input_media_video (struct paramed_type *T);
+struct tl_ds_input_media *fetch_ds_constructor_input_media_uploaded_audio (struct paramed_type *T);
+struct tl_ds_input_media *fetch_ds_constructor_input_media_audio (struct paramed_type *T);
+struct tl_ds_input_media *fetch_ds_constructor_input_media_uploaded_document (struct paramed_type *T);
+struct tl_ds_input_media *fetch_ds_constructor_input_media_uploaded_thumb_document (struct paramed_type *T);
+struct tl_ds_input_media *fetch_ds_constructor_input_media_document (struct paramed_type *T);
+struct tl_ds_input_media *fetch_ds_constructor_input_media_venue (struct paramed_type *T);
+struct tl_ds_input_notify_peer *fetch_ds_constructor_input_notify_peer (struct paramed_type *T);
+struct tl_ds_input_notify_peer *fetch_ds_constructor_input_notify_users (struct paramed_type *T);
+struct tl_ds_input_notify_peer *fetch_ds_constructor_input_notify_chats (struct paramed_type *T);
+struct tl_ds_input_notify_peer *fetch_ds_constructor_input_notify_all (struct paramed_type *T);
+struct tl_ds_input_notify_peer *fetch_ds_constructor_input_notify_geo_chat_peer (struct paramed_type *T);
+struct tl_ds_input_peer *fetch_ds_constructor_input_peer_empty (struct paramed_type *T);
+struct tl_ds_input_peer *fetch_ds_constructor_input_peer_self (struct paramed_type *T);
+struct tl_ds_input_peer *fetch_ds_constructor_input_peer_contact (struct paramed_type *T);
+struct tl_ds_input_peer *fetch_ds_constructor_input_peer_foreign (struct paramed_type *T);
+struct tl_ds_input_peer *fetch_ds_constructor_input_peer_chat (struct paramed_type *T);
+struct tl_ds_input_peer_notify_events *fetch_ds_constructor_input_peer_notify_events_empty (struct paramed_type *T);
+struct tl_ds_input_peer_notify_events *fetch_ds_constructor_input_peer_notify_events_all (struct paramed_type *T);
+struct tl_ds_input_peer_notify_settings *fetch_ds_constructor_input_peer_notify_settings (struct paramed_type *T);
+struct tl_ds_input_photo *fetch_ds_constructor_input_photo_empty (struct paramed_type *T);
+struct tl_ds_input_photo *fetch_ds_constructor_input_photo (struct paramed_type *T);
+struct tl_ds_input_photo_crop *fetch_ds_constructor_input_photo_crop_auto (struct paramed_type *T);
+struct tl_ds_input_photo_crop *fetch_ds_constructor_input_photo_crop (struct paramed_type *T);
+struct tl_ds_input_privacy_key *fetch_ds_constructor_input_privacy_key_status_timestamp (struct paramed_type *T);
+struct tl_ds_input_privacy_rule *fetch_ds_constructor_input_privacy_value_allow_contacts (struct paramed_type *T);
+struct tl_ds_input_privacy_rule *fetch_ds_constructor_input_privacy_value_allow_all (struct paramed_type *T);
+struct tl_ds_input_privacy_rule *fetch_ds_constructor_input_privacy_value_allow_users (struct paramed_type *T);
+struct tl_ds_input_privacy_rule *fetch_ds_constructor_input_privacy_value_disallow_contacts (struct paramed_type *T);
+struct tl_ds_input_privacy_rule *fetch_ds_constructor_input_privacy_value_disallow_all (struct paramed_type *T);
+struct tl_ds_input_privacy_rule *fetch_ds_constructor_input_privacy_value_disallow_users (struct paramed_type *T);
+struct tl_ds_input_sticker_set *fetch_ds_constructor_input_sticker_set_empty (struct paramed_type *T);
+struct tl_ds_input_sticker_set *fetch_ds_constructor_input_sticker_set_i_d (struct paramed_type *T);
+struct tl_ds_input_sticker_set *fetch_ds_constructor_input_sticker_set_short_name (struct paramed_type *T);
+struct tl_ds_input_user *fetch_ds_constructor_input_user_empty (struct paramed_type *T);
+struct tl_ds_input_user *fetch_ds_constructor_input_user_self (struct paramed_type *T);
+struct tl_ds_input_user *fetch_ds_constructor_input_user_contact (struct paramed_type *T);
+struct tl_ds_input_user *fetch_ds_constructor_input_user_foreign (struct paramed_type *T);
+struct tl_ds_input_video *fetch_ds_constructor_input_video_empty (struct paramed_type *T);
+struct tl_ds_input_video *fetch_ds_constructor_input_video (struct paramed_type *T);
+int *fetch_ds_constructor_int (struct paramed_type *T);
+struct tl_ds_int128 *fetch_ds_constructor_int128 (struct paramed_type *T);
+struct tl_ds_int256 *fetch_ds_constructor_int256 (struct paramed_type *T);
+struct tl_ds_keyboard_button *fetch_ds_constructor_keyboard_button (struct paramed_type *T);
+struct tl_ds_keyboard_button_row *fetch_ds_constructor_keyboard_button_row (struct paramed_type *T);
+long long *fetch_ds_constructor_long (struct paramed_type *T);
+struct tl_ds_message *fetch_ds_constructor_message_empty (struct paramed_type *T);
+struct tl_ds_message *fetch_ds_constructor_message (struct paramed_type *T);
+struct tl_ds_message *fetch_ds_constructor_message_service (struct paramed_type *T);
+struct tl_ds_message_action *fetch_ds_constructor_message_action_empty (struct paramed_type *T);
+struct tl_ds_message_action *fetch_ds_constructor_message_action_chat_create (struct paramed_type *T);
+struct tl_ds_message_action *fetch_ds_constructor_message_action_chat_edit_title (struct paramed_type *T);
+struct tl_ds_message_action *fetch_ds_constructor_message_action_chat_edit_photo (struct paramed_type *T);
+struct tl_ds_message_action *fetch_ds_constructor_message_action_chat_delete_photo (struct paramed_type *T);
+struct tl_ds_message_action *fetch_ds_constructor_message_action_chat_add_user (struct paramed_type *T);
+struct tl_ds_message_action *fetch_ds_constructor_message_action_chat_delete_user (struct paramed_type *T);
+struct tl_ds_message_action *fetch_ds_constructor_message_action_geo_chat_create (struct paramed_type *T);
+struct tl_ds_message_action *fetch_ds_constructor_message_action_geo_chat_checkin (struct paramed_type *T);
+struct tl_ds_message_action *fetch_ds_constructor_message_action_chat_joined_by_link (struct paramed_type *T);
+struct tl_ds_message_media *fetch_ds_constructor_message_media_empty (struct paramed_type *T);
+struct tl_ds_message_media *fetch_ds_constructor_message_media_photo (struct paramed_type *T);
+struct tl_ds_message_media *fetch_ds_constructor_message_media_video (struct paramed_type *T);
+struct tl_ds_message_media *fetch_ds_constructor_message_media_geo (struct paramed_type *T);
+struct tl_ds_message_media *fetch_ds_constructor_message_media_contact (struct paramed_type *T);
+struct tl_ds_message_media *fetch_ds_constructor_message_media_unsupported (struct paramed_type *T);
+struct tl_ds_message_media *fetch_ds_constructor_message_media_document (struct paramed_type *T);
+struct tl_ds_message_media *fetch_ds_constructor_message_media_audio (struct paramed_type *T);
+struct tl_ds_message_media *fetch_ds_constructor_message_media_web_page (struct paramed_type *T);
+struct tl_ds_message_media *fetch_ds_constructor_message_media_venue (struct paramed_type *T);
+struct tl_ds_message_media *fetch_ds_constructor_message_media_photo_l27 (struct paramed_type *T);
+struct tl_ds_message_media *fetch_ds_constructor_message_media_video_l27 (struct paramed_type *T);
+struct tl_ds_messages_filter *fetch_ds_constructor_input_messages_filter_empty (struct paramed_type *T);
+struct tl_ds_messages_filter *fetch_ds_constructor_input_messages_filter_photos (struct paramed_type *T);
+struct tl_ds_messages_filter *fetch_ds_constructor_input_messages_filter_video (struct paramed_type *T);
+struct tl_ds_messages_filter *fetch_ds_constructor_input_messages_filter_photo_video (struct paramed_type *T);
+struct tl_ds_messages_filter *fetch_ds_constructor_input_messages_filter_photo_video_documents (struct paramed_type *T);
+struct tl_ds_messages_filter *fetch_ds_constructor_input_messages_filter_document (struct paramed_type *T);
+struct tl_ds_messages_filter *fetch_ds_constructor_input_messages_filter_audio (struct paramed_type *T);
+struct tl_ds_nearest_dc *fetch_ds_constructor_nearest_dc (struct paramed_type *T);
+struct tl_ds_notify_peer *fetch_ds_constructor_notify_peer (struct paramed_type *T);
+struct tl_ds_notify_peer *fetch_ds_constructor_notify_users (struct paramed_type *T);
+struct tl_ds_notify_peer *fetch_ds_constructor_notify_chats (struct paramed_type *T);
+struct tl_ds_notify_peer *fetch_ds_constructor_notify_all (struct paramed_type *T);
+struct tl_ds_null *fetch_ds_constructor_null (struct paramed_type *T);
+struct tl_ds_p_q_inner_data *fetch_ds_constructor_p_q_inner_data (struct paramed_type *T);
+struct tl_ds_p_q_inner_data *fetch_ds_constructor_p_q_inner_data_temp (struct paramed_type *T);
+struct tl_ds_peer *fetch_ds_constructor_peer_user (struct paramed_type *T);
+struct tl_ds_peer *fetch_ds_constructor_peer_chat (struct paramed_type *T);
+struct tl_ds_peer_notify_events *fetch_ds_constructor_peer_notify_events_empty (struct paramed_type *T);
+struct tl_ds_peer_notify_events *fetch_ds_constructor_peer_notify_events_all (struct paramed_type *T);
+struct tl_ds_peer_notify_settings *fetch_ds_constructor_peer_notify_settings_empty (struct paramed_type *T);
+struct tl_ds_peer_notify_settings *fetch_ds_constructor_peer_notify_settings (struct paramed_type *T);
+struct tl_ds_photo *fetch_ds_constructor_photo_empty (struct paramed_type *T);
+struct tl_ds_photo *fetch_ds_constructor_photo (struct paramed_type *T);
+struct tl_ds_photo *fetch_ds_constructor_photo_l27 (struct paramed_type *T);
+struct tl_ds_photo_size *fetch_ds_constructor_photo_size_empty (struct paramed_type *T);
+struct tl_ds_photo_size *fetch_ds_constructor_photo_size (struct paramed_type *T);
+struct tl_ds_photo_size *fetch_ds_constructor_photo_cached_size (struct paramed_type *T);
+struct tl_ds_privacy_key *fetch_ds_constructor_privacy_key_status_timestamp (struct paramed_type *T);
+struct tl_ds_privacy_rule *fetch_ds_constructor_privacy_value_allow_contacts (struct paramed_type *T);
+struct tl_ds_privacy_rule *fetch_ds_constructor_privacy_value_allow_all (struct paramed_type *T);
+struct tl_ds_privacy_rule *fetch_ds_constructor_privacy_value_allow_users (struct paramed_type *T);
+struct tl_ds_privacy_rule *fetch_ds_constructor_privacy_value_disallow_contacts (struct paramed_type *T);
+struct tl_ds_privacy_rule *fetch_ds_constructor_privacy_value_disallow_all (struct paramed_type *T);
+struct tl_ds_privacy_rule *fetch_ds_constructor_privacy_value_disallow_users (struct paramed_type *T);
+struct tl_ds_received_notify_message *fetch_ds_constructor_received_notify_message (struct paramed_type *T);
+struct tl_ds_reply_markup *fetch_ds_constructor_reply_keyboard_hide (struct paramed_type *T);
+struct tl_ds_reply_markup *fetch_ds_constructor_reply_keyboard_force_reply (struct paramed_type *T);
+struct tl_ds_reply_markup *fetch_ds_constructor_reply_keyboard_markup (struct paramed_type *T);
+struct tl_ds_res_p_q *fetch_ds_constructor_res_p_q (struct paramed_type *T);
+struct tl_ds_send_message_action *fetch_ds_constructor_send_message_typing_action (struct paramed_type *T);
+struct tl_ds_send_message_action *fetch_ds_constructor_send_message_cancel_action (struct paramed_type *T);
+struct tl_ds_send_message_action *fetch_ds_constructor_send_message_record_video_action (struct paramed_type *T);
+struct tl_ds_send_message_action *fetch_ds_constructor_send_message_upload_video_action_l27 (struct paramed_type *T);
+struct tl_ds_send_message_action *fetch_ds_constructor_send_message_upload_video_action (struct paramed_type *T);
+struct tl_ds_send_message_action *fetch_ds_constructor_send_message_record_audio_action (struct paramed_type *T);
+struct tl_ds_send_message_action *fetch_ds_constructor_send_message_upload_audio_action_l27 (struct paramed_type *T);
+struct tl_ds_send_message_action *fetch_ds_constructor_send_message_upload_audio_action (struct paramed_type *T);
+struct tl_ds_send_message_action *fetch_ds_constructor_send_message_upload_photo_action (struct paramed_type *T);
+struct tl_ds_send_message_action *fetch_ds_constructor_send_message_upload_document_action_l27 (struct paramed_type *T);
+struct tl_ds_send_message_action *fetch_ds_constructor_send_message_upload_document_action (struct paramed_type *T);
+struct tl_ds_send_message_action *fetch_ds_constructor_send_message_geo_location_action (struct paramed_type *T);
+struct tl_ds_send_message_action *fetch_ds_constructor_send_message_choose_contact_action (struct paramed_type *T);
+struct tl_ds_server_d_h_params *fetch_ds_constructor_server_d_h_params_fail (struct paramed_type *T);
+struct tl_ds_server_d_h_params *fetch_ds_constructor_server_d_h_params_ok (struct paramed_type *T);
+struct tl_ds_server_d_h_inner_data *fetch_ds_constructor_server_d_h_inner_data (struct paramed_type *T);
+struct tl_ds_set_client_d_h_params_answer *fetch_ds_constructor_dh_gen_ok (struct paramed_type *T);
+struct tl_ds_set_client_d_h_params_answer *fetch_ds_constructor_dh_gen_retry (struct paramed_type *T);
+struct tl_ds_set_client_d_h_params_answer *fetch_ds_constructor_dh_gen_fail (struct paramed_type *T);
+struct tl_ds_sticker_pack *fetch_ds_constructor_sticker_pack (struct paramed_type *T);
+struct tl_ds_sticker_set *fetch_ds_constructor_sticker_set (struct paramed_type *T);
+struct tl_ds_string *fetch_ds_constructor_string (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_new_message (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_message_i_d (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_delete_messages (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_user_typing (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_chat_user_typing (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_chat_participants (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_user_status (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_user_name (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_user_photo (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_contact_registered (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_contact_link (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_new_authorization (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_new_geo_chat_message (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_new_encrypted_message (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_encrypted_chat_typing (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_encryption (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_encrypted_messages_read (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_chat_participant_add (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_chat_participant_delete (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_dc_options (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_user_blocked (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_notify_settings (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_service_notification (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_privacy (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_user_phone (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_read_history_inbox (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_read_history_outbox (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_web_page (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_read_messages_contents (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_constructor_update_msg_update (struct paramed_type *T);
+struct tl_ds_updates *fetch_ds_constructor_updates_too_long (struct paramed_type *T);
+struct tl_ds_updates *fetch_ds_constructor_update_short_message (struct paramed_type *T);
+struct tl_ds_updates *fetch_ds_constructor_update_short_chat_message (struct paramed_type *T);
+struct tl_ds_updates *fetch_ds_constructor_update_short (struct paramed_type *T);
+struct tl_ds_updates *fetch_ds_constructor_updates_combined (struct paramed_type *T);
+struct tl_ds_updates *fetch_ds_constructor_updates (struct paramed_type *T);
+struct tl_ds_user *fetch_ds_constructor_user_empty (struct paramed_type *T);
+struct tl_ds_user *fetch_ds_constructor_user (struct paramed_type *T);
+struct tl_ds_user_full *fetch_ds_constructor_user_full (struct paramed_type *T);
+struct tl_ds_user_profile_photo *fetch_ds_constructor_user_profile_photo_empty (struct paramed_type *T);
+struct tl_ds_user_profile_photo *fetch_ds_constructor_user_profile_photo (struct paramed_type *T);
+struct tl_ds_user_status *fetch_ds_constructor_user_status_empty (struct paramed_type *T);
+struct tl_ds_user_status *fetch_ds_constructor_user_status_online (struct paramed_type *T);
+struct tl_ds_user_status *fetch_ds_constructor_user_status_offline (struct paramed_type *T);
+struct tl_ds_user_status *fetch_ds_constructor_user_status_recently (struct paramed_type *T);
+struct tl_ds_user_status *fetch_ds_constructor_user_status_last_week (struct paramed_type *T);
+struct tl_ds_user_status *fetch_ds_constructor_user_status_last_month (struct paramed_type *T);
+struct tl_ds_vector *fetch_ds_constructor_vector (struct paramed_type *T);
+struct tl_ds_video *fetch_ds_constructor_video_empty (struct paramed_type *T);
+struct tl_ds_video *fetch_ds_constructor_video (struct paramed_type *T);
+struct tl_ds_video *fetch_ds_constructor_video_l27 (struct paramed_type *T);
+struct tl_ds_wall_paper *fetch_ds_constructor_wall_paper (struct paramed_type *T);
+struct tl_ds_wall_paper *fetch_ds_constructor_wall_paper_solid (struct paramed_type *T);
+struct tl_ds_web_page *fetch_ds_constructor_web_page_empty (struct paramed_type *T);
+struct tl_ds_web_page *fetch_ds_constructor_web_page_pending (struct paramed_type *T);
+struct tl_ds_web_page *fetch_ds_constructor_web_page (struct paramed_type *T);
+struct tl_ds_account_authorizations *fetch_ds_constructor_account_authorizations (struct paramed_type *T);
+struct tl_ds_account_password *fetch_ds_constructor_account_no_password (struct paramed_type *T);
+struct tl_ds_account_password *fetch_ds_constructor_account_password (struct paramed_type *T);
+struct tl_ds_account_password_input_settings *fetch_ds_constructor_account_password_input_settings (struct paramed_type *T);
+struct tl_ds_account_password_settings *fetch_ds_constructor_account_password_settings (struct paramed_type *T);
+struct tl_ds_account_privacy_rules *fetch_ds_constructor_account_privacy_rules (struct paramed_type *T);
+struct tl_ds_account_sent_change_phone_code *fetch_ds_constructor_account_sent_change_phone_code (struct paramed_type *T);
+struct tl_ds_auth_authorization *fetch_ds_constructor_auth_authorization (struct paramed_type *T);
+struct tl_ds_auth_checked_phone *fetch_ds_constructor_auth_checked_phone (struct paramed_type *T);
+struct tl_ds_auth_exported_authorization *fetch_ds_constructor_auth_exported_authorization (struct paramed_type *T);
+struct tl_ds_auth_password_recovery *fetch_ds_constructor_auth_password_recovery (struct paramed_type *T);
+struct tl_ds_auth_sent_code *fetch_ds_constructor_auth_sent_code (struct paramed_type *T);
+struct tl_ds_auth_sent_code *fetch_ds_constructor_auth_sent_app_code (struct paramed_type *T);
+struct tl_ds_binlog_encr_key *fetch_ds_constructor_binlog_encr_key (struct paramed_type *T);
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_start (struct paramed_type *T);
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_dc_option (struct paramed_type *T);
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_dc_option_new (struct paramed_type *T);
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_auth_key (struct paramed_type *T);
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_default_dc (struct paramed_type *T);
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_dc_signed (struct paramed_type *T);
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_our_id (struct paramed_type *T);
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_set_dh_params (struct paramed_type *T);
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_set_pts (struct paramed_type *T);
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_set_qts (struct paramed_type *T);
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_set_date (struct paramed_type *T);
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_set_seq (struct paramed_type *T);
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_encr_chat_delete (struct paramed_type *T);
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_encr_chat_new (struct paramed_type *T);
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_encr_chat_exchange_new (struct paramed_type *T);
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_user_delete (struct paramed_type *T);
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_user_new (struct paramed_type *T);
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_chat_new (struct paramed_type *T);
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_chat_add_participant (struct paramed_type *T);
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_chat_del_participant (struct paramed_type *T);
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_set_msg_id (struct paramed_type *T);
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_message_delete (struct paramed_type *T);
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_message_new (struct paramed_type *T);
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_message_encr_new (struct paramed_type *T);
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_msg_update (struct paramed_type *T);
+struct tl_ds_binlog_update *fetch_ds_constructor_binlog_reset_authorization (struct paramed_type *T);
+struct tl_ds_contacts_blocked *fetch_ds_constructor_contacts_blocked (struct paramed_type *T);
+struct tl_ds_contacts_blocked *fetch_ds_constructor_contacts_blocked_slice (struct paramed_type *T);
+struct tl_ds_contacts_contacts *fetch_ds_constructor_contacts_contacts_not_modified (struct paramed_type *T);
+struct tl_ds_contacts_contacts *fetch_ds_constructor_contacts_contacts (struct paramed_type *T);
+struct tl_ds_contacts_found *fetch_ds_constructor_contacts_found (struct paramed_type *T);
+struct tl_ds_contacts_imported_contacts *fetch_ds_constructor_contacts_imported_contacts (struct paramed_type *T);
+struct tl_ds_contacts_link *fetch_ds_constructor_contacts_link (struct paramed_type *T);
+struct tl_ds_contacts_suggested *fetch_ds_constructor_contacts_suggested (struct paramed_type *T);
+struct tl_ds_geochats_located *fetch_ds_constructor_geochats_located (struct paramed_type *T);
+struct tl_ds_geochats_messages *fetch_ds_constructor_geochats_messages (struct paramed_type *T);
+struct tl_ds_geochats_messages *fetch_ds_constructor_geochats_messages_slice (struct paramed_type *T);
+struct tl_ds_geochats_stated_message *fetch_ds_constructor_geochats_stated_message (struct paramed_type *T);
+struct tl_ds_help_app_update *fetch_ds_constructor_help_app_update (struct paramed_type *T);
+struct tl_ds_help_app_update *fetch_ds_constructor_help_no_app_update (struct paramed_type *T);
+struct tl_ds_help_invite_text *fetch_ds_constructor_help_invite_text (struct paramed_type *T);
+struct tl_ds_help_support *fetch_ds_constructor_help_support (struct paramed_type *T);
+struct tl_ds_messages_affected_history *fetch_ds_constructor_messages_affected_history (struct paramed_type *T);
+struct tl_ds_messages_affected_messages *fetch_ds_constructor_messages_affected_messages (struct paramed_type *T);
+struct tl_ds_messages_all_stickers *fetch_ds_constructor_messages_all_stickers_not_modified (struct paramed_type *T);
+struct tl_ds_messages_all_stickers *fetch_ds_constructor_messages_all_stickers (struct paramed_type *T);
+struct tl_ds_messages_chat_full *fetch_ds_constructor_messages_chat_full (struct paramed_type *T);
+struct tl_ds_messages_chats *fetch_ds_constructor_messages_chats (struct paramed_type *T);
+struct tl_ds_messages_dh_config *fetch_ds_constructor_messages_dh_config_not_modified (struct paramed_type *T);
+struct tl_ds_messages_dh_config *fetch_ds_constructor_messages_dh_config (struct paramed_type *T);
+struct tl_ds_messages_dialogs *fetch_ds_constructor_messages_dialogs (struct paramed_type *T);
+struct tl_ds_messages_dialogs *fetch_ds_constructor_messages_dialogs_slice (struct paramed_type *T);
+struct tl_ds_messages_message *fetch_ds_constructor_messages_message_empty (struct paramed_type *T);
+struct tl_ds_messages_messages *fetch_ds_constructor_messages_messages (struct paramed_type *T);
+struct tl_ds_messages_messages *fetch_ds_constructor_messages_messages_slice (struct paramed_type *T);
+struct tl_ds_messages_sent_encrypted_message *fetch_ds_constructor_messages_sent_encrypted_message (struct paramed_type *T);
+struct tl_ds_messages_sent_encrypted_message *fetch_ds_constructor_messages_sent_encrypted_file (struct paramed_type *T);
+struct tl_ds_messages_sent_message *fetch_ds_constructor_messages_sent_message (struct paramed_type *T);
+struct tl_ds_messages_sent_message *fetch_ds_constructor_messages_sent_message_link (struct paramed_type *T);
+struct tl_ds_messages_sticker_set *fetch_ds_constructor_messages_sticker_set (struct paramed_type *T);
+struct tl_ds_messages_stickers *fetch_ds_constructor_messages_stickers_not_modified (struct paramed_type *T);
+struct tl_ds_messages_stickers *fetch_ds_constructor_messages_stickers (struct paramed_type *T);
+struct tl_ds_photos_photo *fetch_ds_constructor_photos_photo (struct paramed_type *T);
+struct tl_ds_photos_photos *fetch_ds_constructor_photos_photos (struct paramed_type *T);
+struct tl_ds_photos_photos *fetch_ds_constructor_photos_photos_slice (struct paramed_type *T);
+struct tl_ds_storage_file_type *fetch_ds_constructor_storage_file_unknown (struct paramed_type *T);
+struct tl_ds_storage_file_type *fetch_ds_constructor_storage_file_jpeg (struct paramed_type *T);
+struct tl_ds_storage_file_type *fetch_ds_constructor_storage_file_gif (struct paramed_type *T);
+struct tl_ds_storage_file_type *fetch_ds_constructor_storage_file_png (struct paramed_type *T);
+struct tl_ds_storage_file_type *fetch_ds_constructor_storage_file_pdf (struct paramed_type *T);
+struct tl_ds_storage_file_type *fetch_ds_constructor_storage_file_mp3 (struct paramed_type *T);
+struct tl_ds_storage_file_type *fetch_ds_constructor_storage_file_mov (struct paramed_type *T);
+struct tl_ds_storage_file_type *fetch_ds_constructor_storage_file_partial (struct paramed_type *T);
+struct tl_ds_storage_file_type *fetch_ds_constructor_storage_file_mp4 (struct paramed_type *T);
+struct tl_ds_storage_file_type *fetch_ds_constructor_storage_file_webp (struct paramed_type *T);
+struct tl_ds_updates_difference *fetch_ds_constructor_updates_difference_empty (struct paramed_type *T);
+struct tl_ds_updates_difference *fetch_ds_constructor_updates_difference (struct paramed_type *T);
+struct tl_ds_updates_difference *fetch_ds_constructor_updates_difference_slice (struct paramed_type *T);
+struct tl_ds_updates_state *fetch_ds_constructor_updates_state (struct paramed_type *T);
+struct tl_ds_upload_file *fetch_ds_constructor_upload_file (struct paramed_type *T);
+struct tl_ds_account_days_t_t_l *fetch_ds_type_account_days_t_t_l (struct paramed_type *T);
+struct tl_ds_account_days_t_t_l *fetch_ds_type_bare_account_days_t_t_l (struct paramed_type *T);
+struct tl_ds_audio *fetch_ds_type_audio (struct paramed_type *T);
+struct tl_ds_audio *fetch_ds_type_bare_audio (struct paramed_type *T);
+struct tl_ds_authorization *fetch_ds_type_authorization (struct paramed_type *T);
+struct tl_ds_authorization *fetch_ds_type_bare_authorization (struct paramed_type *T);
+struct tl_ds_bool *fetch_ds_type_bool (struct paramed_type *T);
+struct tl_ds_bool *fetch_ds_type_bare_bool (struct paramed_type *T);
+struct tl_ds_bot_command *fetch_ds_type_bot_command (struct paramed_type *T);
+struct tl_ds_bot_command *fetch_ds_type_bare_bot_command (struct paramed_type *T);
+struct tl_ds_bot_info *fetch_ds_type_bot_info (struct paramed_type *T);
+struct tl_ds_bot_info *fetch_ds_type_bare_bot_info (struct paramed_type *T);
+struct tl_ds_string *fetch_ds_type_bytes (struct paramed_type *T);
+struct tl_ds_string *fetch_ds_type_bare_bytes (struct paramed_type *T);
+struct tl_ds_chat *fetch_ds_type_chat (struct paramed_type *T);
+struct tl_ds_chat *fetch_ds_type_bare_chat (struct paramed_type *T);
+struct tl_ds_chat_full *fetch_ds_type_chat_full (struct paramed_type *T);
+struct tl_ds_chat_full *fetch_ds_type_bare_chat_full (struct paramed_type *T);
+struct tl_ds_chat_invite *fetch_ds_type_chat_invite (struct paramed_type *T);
+struct tl_ds_chat_invite *fetch_ds_type_bare_chat_invite (struct paramed_type *T);
+struct tl_ds_chat_located *fetch_ds_type_chat_located (struct paramed_type *T);
+struct tl_ds_chat_located *fetch_ds_type_bare_chat_located (struct paramed_type *T);
+struct tl_ds_chat_participant *fetch_ds_type_chat_participant (struct paramed_type *T);
+struct tl_ds_chat_participant *fetch_ds_type_bare_chat_participant (struct paramed_type *T);
+struct tl_ds_chat_participants *fetch_ds_type_chat_participants (struct paramed_type *T);
+struct tl_ds_chat_participants *fetch_ds_type_bare_chat_participants (struct paramed_type *T);
+struct tl_ds_chat_photo *fetch_ds_type_chat_photo (struct paramed_type *T);
+struct tl_ds_chat_photo *fetch_ds_type_bare_chat_photo (struct paramed_type *T);
+struct tl_ds_client_d_h_inner_data *fetch_ds_type_client_d_h_inner_data (struct paramed_type *T);
+struct tl_ds_client_d_h_inner_data *fetch_ds_type_bare_client_d_h_inner_data (struct paramed_type *T);
+struct tl_ds_config *fetch_ds_type_config (struct paramed_type *T);
+struct tl_ds_config *fetch_ds_type_bare_config (struct paramed_type *T);
+struct tl_ds_contact *fetch_ds_type_contact (struct paramed_type *T);
+struct tl_ds_contact *fetch_ds_type_bare_contact (struct paramed_type *T);
+struct tl_ds_contact_blocked *fetch_ds_type_contact_blocked (struct paramed_type *T);
+struct tl_ds_contact_blocked *fetch_ds_type_bare_contact_blocked (struct paramed_type *T);
+struct tl_ds_contact_found *fetch_ds_type_contact_found (struct paramed_type *T);
+struct tl_ds_contact_found *fetch_ds_type_bare_contact_found (struct paramed_type *T);
+struct tl_ds_contact_link *fetch_ds_type_contact_link (struct paramed_type *T);
+struct tl_ds_contact_link *fetch_ds_type_bare_contact_link (struct paramed_type *T);
+struct tl_ds_contact_status *fetch_ds_type_contact_status (struct paramed_type *T);
+struct tl_ds_contact_status *fetch_ds_type_bare_contact_status (struct paramed_type *T);
+struct tl_ds_contact_suggested *fetch_ds_type_contact_suggested (struct paramed_type *T);
+struct tl_ds_contact_suggested *fetch_ds_type_bare_contact_suggested (struct paramed_type *T);
+struct tl_ds_dc_option *fetch_ds_type_dc_option (struct paramed_type *T);
+struct tl_ds_dc_option *fetch_ds_type_bare_dc_option (struct paramed_type *T);
+struct tl_ds_decrypted_message *fetch_ds_type_decrypted_message (struct paramed_type *T);
+struct tl_ds_decrypted_message *fetch_ds_type_bare_decrypted_message (struct paramed_type *T);
+struct tl_ds_decrypted_message_action *fetch_ds_type_decrypted_message_action (struct paramed_type *T);
+struct tl_ds_decrypted_message_action *fetch_ds_type_bare_decrypted_message_action (struct paramed_type *T);
+struct tl_ds_decrypted_message_layer *fetch_ds_type_decrypted_message_layer (struct paramed_type *T);
+struct tl_ds_decrypted_message_layer *fetch_ds_type_bare_decrypted_message_layer (struct paramed_type *T);
+struct tl_ds_decrypted_message_media *fetch_ds_type_decrypted_message_media (struct paramed_type *T);
+struct tl_ds_decrypted_message_media *fetch_ds_type_bare_decrypted_message_media (struct paramed_type *T);
+struct tl_ds_dialog *fetch_ds_type_dialog (struct paramed_type *T);
+struct tl_ds_dialog *fetch_ds_type_bare_dialog (struct paramed_type *T);
+struct tl_ds_disabled_feature *fetch_ds_type_disabled_feature (struct paramed_type *T);
+struct tl_ds_disabled_feature *fetch_ds_type_bare_disabled_feature (struct paramed_type *T);
+struct tl_ds_document *fetch_ds_type_document (struct paramed_type *T);
+struct tl_ds_document *fetch_ds_type_bare_document (struct paramed_type *T);
+struct tl_ds_document_attribute *fetch_ds_type_document_attribute (struct paramed_type *T);
+struct tl_ds_document_attribute *fetch_ds_type_bare_document_attribute (struct paramed_type *T);
+double *fetch_ds_type_double (struct paramed_type *T);
+double *fetch_ds_type_bare_double (struct paramed_type *T);
+struct tl_ds_encrypted_chat *fetch_ds_type_encrypted_chat (struct paramed_type *T);
+struct tl_ds_encrypted_chat *fetch_ds_type_bare_encrypted_chat (struct paramed_type *T);
+struct tl_ds_encrypted_file *fetch_ds_type_encrypted_file (struct paramed_type *T);
+struct tl_ds_encrypted_file *fetch_ds_type_bare_encrypted_file (struct paramed_type *T);
+struct tl_ds_encrypted_message *fetch_ds_type_encrypted_message (struct paramed_type *T);
+struct tl_ds_encrypted_message *fetch_ds_type_bare_encrypted_message (struct paramed_type *T);
+struct tl_ds_error *fetch_ds_type_error (struct paramed_type *T);
+struct tl_ds_error *fetch_ds_type_bare_error (struct paramed_type *T);
+struct tl_ds_exported_chat_invite *fetch_ds_type_exported_chat_invite (struct paramed_type *T);
+struct tl_ds_exported_chat_invite *fetch_ds_type_bare_exported_chat_invite (struct paramed_type *T);
+struct tl_ds_file_location *fetch_ds_type_file_location (struct paramed_type *T);
+struct tl_ds_file_location *fetch_ds_type_bare_file_location (struct paramed_type *T);
+struct tl_ds_geo_chat_message *fetch_ds_type_geo_chat_message (struct paramed_type *T);
+struct tl_ds_geo_chat_message *fetch_ds_type_bare_geo_chat_message (struct paramed_type *T);
+struct tl_ds_geo_point *fetch_ds_type_geo_point (struct paramed_type *T);
+struct tl_ds_geo_point *fetch_ds_type_bare_geo_point (struct paramed_type *T);
+struct tl_ds_imported_contact *fetch_ds_type_imported_contact (struct paramed_type *T);
+struct tl_ds_imported_contact *fetch_ds_type_bare_imported_contact (struct paramed_type *T);
+struct tl_ds_input_app_event *fetch_ds_type_input_app_event (struct paramed_type *T);
+struct tl_ds_input_app_event *fetch_ds_type_bare_input_app_event (struct paramed_type *T);
+struct tl_ds_input_audio *fetch_ds_type_input_audio (struct paramed_type *T);
+struct tl_ds_input_audio *fetch_ds_type_bare_input_audio (struct paramed_type *T);
+struct tl_ds_input_chat_photo *fetch_ds_type_input_chat_photo (struct paramed_type *T);
+struct tl_ds_input_chat_photo *fetch_ds_type_bare_input_chat_photo (struct paramed_type *T);
+struct tl_ds_input_contact *fetch_ds_type_input_contact (struct paramed_type *T);
+struct tl_ds_input_contact *fetch_ds_type_bare_input_contact (struct paramed_type *T);
+struct tl_ds_input_document *fetch_ds_type_input_document (struct paramed_type *T);
+struct tl_ds_input_document *fetch_ds_type_bare_input_document (struct paramed_type *T);
+struct tl_ds_input_encrypted_chat *fetch_ds_type_input_encrypted_chat (struct paramed_type *T);
+struct tl_ds_input_encrypted_chat *fetch_ds_type_bare_input_encrypted_chat (struct paramed_type *T);
+struct tl_ds_input_encrypted_file *fetch_ds_type_input_encrypted_file (struct paramed_type *T);
+struct tl_ds_input_encrypted_file *fetch_ds_type_bare_input_encrypted_file (struct paramed_type *T);
+struct tl_ds_input_file *fetch_ds_type_input_file (struct paramed_type *T);
+struct tl_ds_input_file *fetch_ds_type_bare_input_file (struct paramed_type *T);
+struct tl_ds_input_file_location *fetch_ds_type_input_file_location (struct paramed_type *T);
+struct tl_ds_input_file_location *fetch_ds_type_bare_input_file_location (struct paramed_type *T);
+struct tl_ds_input_geo_chat *fetch_ds_type_input_geo_chat (struct paramed_type *T);
+struct tl_ds_input_geo_chat *fetch_ds_type_bare_input_geo_chat (struct paramed_type *T);
+struct tl_ds_input_geo_point *fetch_ds_type_input_geo_point (struct paramed_type *T);
+struct tl_ds_input_geo_point *fetch_ds_type_bare_input_geo_point (struct paramed_type *T);
+struct tl_ds_input_media *fetch_ds_type_input_media (struct paramed_type *T);
+struct tl_ds_input_media *fetch_ds_type_bare_input_media (struct paramed_type *T);
+struct tl_ds_input_notify_peer *fetch_ds_type_input_notify_peer (struct paramed_type *T);
+struct tl_ds_input_notify_peer *fetch_ds_type_bare_input_notify_peer (struct paramed_type *T);
+struct tl_ds_input_peer *fetch_ds_type_input_peer (struct paramed_type *T);
+struct tl_ds_input_peer *fetch_ds_type_bare_input_peer (struct paramed_type *T);
+struct tl_ds_input_peer_notify_events *fetch_ds_type_input_peer_notify_events (struct paramed_type *T);
+struct tl_ds_input_peer_notify_events *fetch_ds_type_bare_input_peer_notify_events (struct paramed_type *T);
+struct tl_ds_input_peer_notify_settings *fetch_ds_type_input_peer_notify_settings (struct paramed_type *T);
+struct tl_ds_input_peer_notify_settings *fetch_ds_type_bare_input_peer_notify_settings (struct paramed_type *T);
+struct tl_ds_input_photo *fetch_ds_type_input_photo (struct paramed_type *T);
+struct tl_ds_input_photo *fetch_ds_type_bare_input_photo (struct paramed_type *T);
+struct tl_ds_input_photo_crop *fetch_ds_type_input_photo_crop (struct paramed_type *T);
+struct tl_ds_input_photo_crop *fetch_ds_type_bare_input_photo_crop (struct paramed_type *T);
+struct tl_ds_input_privacy_key *fetch_ds_type_input_privacy_key (struct paramed_type *T);
+struct tl_ds_input_privacy_key *fetch_ds_type_bare_input_privacy_key (struct paramed_type *T);
+struct tl_ds_input_privacy_rule *fetch_ds_type_input_privacy_rule (struct paramed_type *T);
+struct tl_ds_input_privacy_rule *fetch_ds_type_bare_input_privacy_rule (struct paramed_type *T);
+struct tl_ds_input_sticker_set *fetch_ds_type_input_sticker_set (struct paramed_type *T);
+struct tl_ds_input_sticker_set *fetch_ds_type_bare_input_sticker_set (struct paramed_type *T);
+struct tl_ds_input_user *fetch_ds_type_input_user (struct paramed_type *T);
+struct tl_ds_input_user *fetch_ds_type_bare_input_user (struct paramed_type *T);
+struct tl_ds_input_video *fetch_ds_type_input_video (struct paramed_type *T);
+struct tl_ds_input_video *fetch_ds_type_bare_input_video (struct paramed_type *T);
+int *fetch_ds_type_int (struct paramed_type *T);
+int *fetch_ds_type_bare_int (struct paramed_type *T);
+struct tl_ds_int128 *fetch_ds_type_int128 (struct paramed_type *T);
+struct tl_ds_int128 *fetch_ds_type_bare_int128 (struct paramed_type *T);
+struct tl_ds_int256 *fetch_ds_type_int256 (struct paramed_type *T);
+struct tl_ds_int256 *fetch_ds_type_bare_int256 (struct paramed_type *T);
+struct tl_ds_keyboard_button *fetch_ds_type_keyboard_button (struct paramed_type *T);
+struct tl_ds_keyboard_button *fetch_ds_type_bare_keyboard_button (struct paramed_type *T);
+struct tl_ds_keyboard_button_row *fetch_ds_type_keyboard_button_row (struct paramed_type *T);
+struct tl_ds_keyboard_button_row *fetch_ds_type_bare_keyboard_button_row (struct paramed_type *T);
+long long *fetch_ds_type_long (struct paramed_type *T);
+long long *fetch_ds_type_bare_long (struct paramed_type *T);
+struct tl_ds_message *fetch_ds_type_message (struct paramed_type *T);
+struct tl_ds_message *fetch_ds_type_bare_message (struct paramed_type *T);
+struct tl_ds_message_action *fetch_ds_type_message_action (struct paramed_type *T);
+struct tl_ds_message_action *fetch_ds_type_bare_message_action (struct paramed_type *T);
+struct tl_ds_message_media *fetch_ds_type_message_media (struct paramed_type *T);
+struct tl_ds_message_media *fetch_ds_type_bare_message_media (struct paramed_type *T);
+struct tl_ds_messages_filter *fetch_ds_type_messages_filter (struct paramed_type *T);
+struct tl_ds_messages_filter *fetch_ds_type_bare_messages_filter (struct paramed_type *T);
+struct tl_ds_nearest_dc *fetch_ds_type_nearest_dc (struct paramed_type *T);
+struct tl_ds_nearest_dc *fetch_ds_type_bare_nearest_dc (struct paramed_type *T);
+struct tl_ds_notify_peer *fetch_ds_type_notify_peer (struct paramed_type *T);
+struct tl_ds_notify_peer *fetch_ds_type_bare_notify_peer (struct paramed_type *T);
+struct tl_ds_null *fetch_ds_type_null (struct paramed_type *T);
+struct tl_ds_null *fetch_ds_type_bare_null (struct paramed_type *T);
+struct tl_ds_p_q_inner_data *fetch_ds_type_p_q_inner_data (struct paramed_type *T);
+struct tl_ds_p_q_inner_data *fetch_ds_type_bare_p_q_inner_data (struct paramed_type *T);
+struct tl_ds_peer *fetch_ds_type_peer (struct paramed_type *T);
+struct tl_ds_peer *fetch_ds_type_bare_peer (struct paramed_type *T);
+struct tl_ds_peer_notify_events *fetch_ds_type_peer_notify_events (struct paramed_type *T);
+struct tl_ds_peer_notify_events *fetch_ds_type_bare_peer_notify_events (struct paramed_type *T);
+struct tl_ds_peer_notify_settings *fetch_ds_type_peer_notify_settings (struct paramed_type *T);
+struct tl_ds_peer_notify_settings *fetch_ds_type_bare_peer_notify_settings (struct paramed_type *T);
+struct tl_ds_photo *fetch_ds_type_photo (struct paramed_type *T);
+struct tl_ds_photo *fetch_ds_type_bare_photo (struct paramed_type *T);
+struct tl_ds_photo_size *fetch_ds_type_photo_size (struct paramed_type *T);
+struct tl_ds_photo_size *fetch_ds_type_bare_photo_size (struct paramed_type *T);
+struct tl_ds_privacy_key *fetch_ds_type_privacy_key (struct paramed_type *T);
+struct tl_ds_privacy_key *fetch_ds_type_bare_privacy_key (struct paramed_type *T);
+struct tl_ds_privacy_rule *fetch_ds_type_privacy_rule (struct paramed_type *T);
+struct tl_ds_privacy_rule *fetch_ds_type_bare_privacy_rule (struct paramed_type *T);
+struct tl_ds_received_notify_message *fetch_ds_type_received_notify_message (struct paramed_type *T);
+struct tl_ds_received_notify_message *fetch_ds_type_bare_received_notify_message (struct paramed_type *T);
+struct tl_ds_reply_markup *fetch_ds_type_reply_markup (struct paramed_type *T);
+struct tl_ds_reply_markup *fetch_ds_type_bare_reply_markup (struct paramed_type *T);
+struct tl_ds_res_p_q *fetch_ds_type_res_p_q (struct paramed_type *T);
+struct tl_ds_res_p_q *fetch_ds_type_bare_res_p_q (struct paramed_type *T);
+struct tl_ds_send_message_action *fetch_ds_type_send_message_action (struct paramed_type *T);
+struct tl_ds_send_message_action *fetch_ds_type_bare_send_message_action (struct paramed_type *T);
+struct tl_ds_server_d_h_params *fetch_ds_type_server_d_h_params (struct paramed_type *T);
+struct tl_ds_server_d_h_params *fetch_ds_type_bare_server_d_h_params (struct paramed_type *T);
+struct tl_ds_server_d_h_inner_data *fetch_ds_type_server_d_h_inner_data (struct paramed_type *T);
+struct tl_ds_server_d_h_inner_data *fetch_ds_type_bare_server_d_h_inner_data (struct paramed_type *T);
+struct tl_ds_set_client_d_h_params_answer *fetch_ds_type_set_client_d_h_params_answer (struct paramed_type *T);
+struct tl_ds_set_client_d_h_params_answer *fetch_ds_type_bare_set_client_d_h_params_answer (struct paramed_type *T);
+struct tl_ds_sticker_pack *fetch_ds_type_sticker_pack (struct paramed_type *T);
+struct tl_ds_sticker_pack *fetch_ds_type_bare_sticker_pack (struct paramed_type *T);
+struct tl_ds_sticker_set *fetch_ds_type_sticker_set (struct paramed_type *T);
+struct tl_ds_sticker_set *fetch_ds_type_bare_sticker_set (struct paramed_type *T);
+struct tl_ds_string *fetch_ds_type_string (struct paramed_type *T);
+struct tl_ds_string *fetch_ds_type_bare_string (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_type_update (struct paramed_type *T);
+struct tl_ds_update *fetch_ds_type_bare_update (struct paramed_type *T);
+struct tl_ds_updates *fetch_ds_type_updates (struct paramed_type *T);
+struct tl_ds_updates *fetch_ds_type_bare_updates (struct paramed_type *T);
+struct tl_ds_user *fetch_ds_type_user (struct paramed_type *T);
+struct tl_ds_user *fetch_ds_type_bare_user (struct paramed_type *T);
+struct tl_ds_user_full *fetch_ds_type_user_full (struct paramed_type *T);
+struct tl_ds_user_full *fetch_ds_type_bare_user_full (struct paramed_type *T);
+struct tl_ds_user_profile_photo *fetch_ds_type_user_profile_photo (struct paramed_type *T);
+struct tl_ds_user_profile_photo *fetch_ds_type_bare_user_profile_photo (struct paramed_type *T);
+struct tl_ds_user_status *fetch_ds_type_user_status (struct paramed_type *T);
+struct tl_ds_user_status *fetch_ds_type_bare_user_status (struct paramed_type *T);
+struct tl_ds_vector *fetch_ds_type_vector (struct paramed_type *T);
+struct tl_ds_vector *fetch_ds_type_bare_vector (struct paramed_type *T);
+struct tl_ds_video *fetch_ds_type_video (struct paramed_type *T);
+struct tl_ds_video *fetch_ds_type_bare_video (struct paramed_type *T);
+struct tl_ds_wall_paper *fetch_ds_type_wall_paper (struct paramed_type *T);
+struct tl_ds_wall_paper *fetch_ds_type_bare_wall_paper (struct paramed_type *T);
+struct tl_ds_web_page *fetch_ds_type_web_page (struct paramed_type *T);
+struct tl_ds_web_page *fetch_ds_type_bare_web_page (struct paramed_type *T);
+struct tl_ds_account_authorizations *fetch_ds_type_account_authorizations (struct paramed_type *T);
+struct tl_ds_account_authorizations *fetch_ds_type_bare_account_authorizations (struct paramed_type *T);
+struct tl_ds_account_password *fetch_ds_type_account_password (struct paramed_type *T);
+struct tl_ds_account_password *fetch_ds_type_bare_account_password (struct paramed_type *T);
+struct tl_ds_account_password_input_settings *fetch_ds_type_account_password_input_settings (struct paramed_type *T);
+struct tl_ds_account_password_input_settings *fetch_ds_type_bare_account_password_input_settings (struct paramed_type *T);
+struct tl_ds_account_password_settings *fetch_ds_type_account_password_settings (struct paramed_type *T);
+struct tl_ds_account_password_settings *fetch_ds_type_bare_account_password_settings (struct paramed_type *T);
+struct tl_ds_account_privacy_rules *fetch_ds_type_account_privacy_rules (struct paramed_type *T);
+struct tl_ds_account_privacy_rules *fetch_ds_type_bare_account_privacy_rules (struct paramed_type *T);
+struct tl_ds_account_sent_change_phone_code *fetch_ds_type_account_sent_change_phone_code (struct paramed_type *T);
+struct tl_ds_account_sent_change_phone_code *fetch_ds_type_bare_account_sent_change_phone_code (struct paramed_type *T);
+struct tl_ds_auth_authorization *fetch_ds_type_auth_authorization (struct paramed_type *T);
+struct tl_ds_auth_authorization *fetch_ds_type_bare_auth_authorization (struct paramed_type *T);
+struct tl_ds_auth_checked_phone *fetch_ds_type_auth_checked_phone (struct paramed_type *T);
+struct tl_ds_auth_checked_phone *fetch_ds_type_bare_auth_checked_phone (struct paramed_type *T);
+struct tl_ds_auth_exported_authorization *fetch_ds_type_auth_exported_authorization (struct paramed_type *T);
+struct tl_ds_auth_exported_authorization *fetch_ds_type_bare_auth_exported_authorization (struct paramed_type *T);
+struct tl_ds_auth_password_recovery *fetch_ds_type_auth_password_recovery (struct paramed_type *T);
+struct tl_ds_auth_password_recovery *fetch_ds_type_bare_auth_password_recovery (struct paramed_type *T);
+struct tl_ds_auth_sent_code *fetch_ds_type_auth_sent_code (struct paramed_type *T);
+struct tl_ds_auth_sent_code *fetch_ds_type_bare_auth_sent_code (struct paramed_type *T);
+struct tl_ds_binlog_encr_key *fetch_ds_type_binlog_encr_key (struct paramed_type *T);
+struct tl_ds_binlog_encr_key *fetch_ds_type_bare_binlog_encr_key (struct paramed_type *T);
+struct tl_ds_binlog_update *fetch_ds_type_binlog_update (struct paramed_type *T);
+struct tl_ds_binlog_update *fetch_ds_type_bare_binlog_update (struct paramed_type *T);
+struct tl_ds_contacts_blocked *fetch_ds_type_contacts_blocked (struct paramed_type *T);
+struct tl_ds_contacts_blocked *fetch_ds_type_bare_contacts_blocked (struct paramed_type *T);
+struct tl_ds_contacts_contacts *fetch_ds_type_contacts_contacts (struct paramed_type *T);
+struct tl_ds_contacts_contacts *fetch_ds_type_bare_contacts_contacts (struct paramed_type *T);
+struct tl_ds_contacts_found *fetch_ds_type_contacts_found (struct paramed_type *T);
+struct tl_ds_contacts_found *fetch_ds_type_bare_contacts_found (struct paramed_type *T);
+struct tl_ds_contacts_imported_contacts *fetch_ds_type_contacts_imported_contacts (struct paramed_type *T);
+struct tl_ds_contacts_imported_contacts *fetch_ds_type_bare_contacts_imported_contacts (struct paramed_type *T);
+struct tl_ds_contacts_link *fetch_ds_type_contacts_link (struct paramed_type *T);
+struct tl_ds_contacts_link *fetch_ds_type_bare_contacts_link (struct paramed_type *T);
+struct tl_ds_contacts_suggested *fetch_ds_type_contacts_suggested (struct paramed_type *T);
+struct tl_ds_contacts_suggested *fetch_ds_type_bare_contacts_suggested (struct paramed_type *T);
+struct tl_ds_geochats_located *fetch_ds_type_geochats_located (struct paramed_type *T);
+struct tl_ds_geochats_located *fetch_ds_type_bare_geochats_located (struct paramed_type *T);
+struct tl_ds_geochats_messages *fetch_ds_type_geochats_messages (struct paramed_type *T);
+struct tl_ds_geochats_messages *fetch_ds_type_bare_geochats_messages (struct paramed_type *T);
+struct tl_ds_geochats_stated_message *fetch_ds_type_geochats_stated_message (struct paramed_type *T);
+struct tl_ds_geochats_stated_message *fetch_ds_type_bare_geochats_stated_message (struct paramed_type *T);
+struct tl_ds_help_app_update *fetch_ds_type_help_app_update (struct paramed_type *T);
+struct tl_ds_help_app_update *fetch_ds_type_bare_help_app_update (struct paramed_type *T);
+struct tl_ds_help_invite_text *fetch_ds_type_help_invite_text (struct paramed_type *T);
+struct tl_ds_help_invite_text *fetch_ds_type_bare_help_invite_text (struct paramed_type *T);
+struct tl_ds_help_support *fetch_ds_type_help_support (struct paramed_type *T);
+struct tl_ds_help_support *fetch_ds_type_bare_help_support (struct paramed_type *T);
+struct tl_ds_messages_affected_history *fetch_ds_type_messages_affected_history (struct paramed_type *T);
+struct tl_ds_messages_affected_history *fetch_ds_type_bare_messages_affected_history (struct paramed_type *T);
+struct tl_ds_messages_affected_messages *fetch_ds_type_messages_affected_messages (struct paramed_type *T);
+struct tl_ds_messages_affected_messages *fetch_ds_type_bare_messages_affected_messages (struct paramed_type *T);
+struct tl_ds_messages_all_stickers *fetch_ds_type_messages_all_stickers (struct paramed_type *T);
+struct tl_ds_messages_all_stickers *fetch_ds_type_bare_messages_all_stickers (struct paramed_type *T);
+struct tl_ds_messages_chat_full *fetch_ds_type_messages_chat_full (struct paramed_type *T);
+struct tl_ds_messages_chat_full *fetch_ds_type_bare_messages_chat_full (struct paramed_type *T);
+struct tl_ds_messages_chats *fetch_ds_type_messages_chats (struct paramed_type *T);
+struct tl_ds_messages_chats *fetch_ds_type_bare_messages_chats (struct paramed_type *T);
+struct tl_ds_messages_dh_config *fetch_ds_type_messages_dh_config (struct paramed_type *T);
+struct tl_ds_messages_dh_config *fetch_ds_type_bare_messages_dh_config (struct paramed_type *T);
+struct tl_ds_messages_dialogs *fetch_ds_type_messages_dialogs (struct paramed_type *T);
+struct tl_ds_messages_dialogs *fetch_ds_type_bare_messages_dialogs (struct paramed_type *T);
+struct tl_ds_messages_message *fetch_ds_type_messages_message (struct paramed_type *T);
+struct tl_ds_messages_message *fetch_ds_type_bare_messages_message (struct paramed_type *T);
+struct tl_ds_messages_messages *fetch_ds_type_messages_messages (struct paramed_type *T);
+struct tl_ds_messages_messages *fetch_ds_type_bare_messages_messages (struct paramed_type *T);
+struct tl_ds_messages_sent_encrypted_message *fetch_ds_type_messages_sent_encrypted_message (struct paramed_type *T);
+struct tl_ds_messages_sent_encrypted_message *fetch_ds_type_bare_messages_sent_encrypted_message (struct paramed_type *T);
+struct tl_ds_messages_sent_message *fetch_ds_type_messages_sent_message (struct paramed_type *T);
+struct tl_ds_messages_sent_message *fetch_ds_type_bare_messages_sent_message (struct paramed_type *T);
+struct tl_ds_messages_sticker_set *fetch_ds_type_messages_sticker_set (struct paramed_type *T);
+struct tl_ds_messages_sticker_set *fetch_ds_type_bare_messages_sticker_set (struct paramed_type *T);
+struct tl_ds_messages_stickers *fetch_ds_type_messages_stickers (struct paramed_type *T);
+struct tl_ds_messages_stickers *fetch_ds_type_bare_messages_stickers (struct paramed_type *T);
+struct tl_ds_photos_photo *fetch_ds_type_photos_photo (struct paramed_type *T);
+struct tl_ds_photos_photo *fetch_ds_type_bare_photos_photo (struct paramed_type *T);
+struct tl_ds_photos_photos *fetch_ds_type_photos_photos (struct paramed_type *T);
+struct tl_ds_photos_photos *fetch_ds_type_bare_photos_photos (struct paramed_type *T);
+struct tl_ds_storage_file_type *fetch_ds_type_storage_file_type (struct paramed_type *T);
+struct tl_ds_storage_file_type *fetch_ds_type_bare_storage_file_type (struct paramed_type *T);
+struct tl_ds_updates_difference *fetch_ds_type_updates_difference (struct paramed_type *T);
+struct tl_ds_updates_difference *fetch_ds_type_bare_updates_difference (struct paramed_type *T);
+struct tl_ds_updates_state *fetch_ds_type_updates_state (struct paramed_type *T);
+struct tl_ds_updates_state *fetch_ds_type_bare_updates_state (struct paramed_type *T);
+struct tl_ds_upload_file *fetch_ds_type_upload_file (struct paramed_type *T);
+struct tl_ds_upload_file *fetch_ds_type_bare_upload_file (struct paramed_type *T);
+void *fetch_ds_type_any (struct paramed_type *T);
diff --git a/protocols/Telegram/tgl/auto/auto-fetch.c b/protocols/Telegram/tgl/auto/auto-fetch.c
new file mode 100644
index 0000000000..adb2ef789d
--- /dev/null
+++ b/protocols/Telegram/tgl/auto/auto-fetch.c
@@ -0,0 +1,16330 @@
+#ifdef _MSC_VER
+#include "..\auto.h"
+#include "auto-fetch.h"
+#include "auto-skip.h"
+#include "..\auto-static-fetch.c"
+#include "..\mtproto-common.h"
+#else
+#include "auto.h"
+#include "auto/auto-fetch.h"
+#include "auto/auto-skip.h"
+#include "auto-static-fetch.c"
+#include "mtproto-common.h"
+#endif
+#include <assert.h>
+int fetch_constructor_account_days_t_t_l (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb8d0afdf && T->type->name != 0x472f5020)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int fetch_constructor_audio_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fc5ec4e && T->type->name != 0x603a13b1)) { return -1; }
+ eprintf (" audioEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fc5ec4e && T->type->name != 0x603a13b1)) { return -1; }
+ eprintf (" audio");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" duration :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mime_type :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" size :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field7) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc_id :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field8) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_authorization (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bf2e6f6 && T->type->name != 0x840d1909)) { return -1; }
+ eprintf (" authorization");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" hash :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" device_model :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" platform :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" system_version :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" api_id :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" app_name :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field7) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" app_version :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field8) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date_created :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field9) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date_active :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field10) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" ip :"); }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field11) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" country :"); }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field12) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" region :"); }
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field13) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_bool_false (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x250be282 && T->type->name != 0xdaf41d7d)) { return -1; }
+ eprintf (" boolFalse");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_bool_true (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x250be282 && T->type->name != 0xdaf41d7d)) { return -1; }
+ eprintf (" boolTrue");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_bot_command (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x75e7ea6c && T->type->name != 0x8a181593)) { return -1; }
+ eprintf (" botCommand");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" command :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" description :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_bot_command_old (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x75e7ea6c && T->type->name != 0x8a181593)) { return -1; }
+ eprintf (" botCommandOld");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" command :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" params :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" description :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_bot_info_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb2e16f93 && T->type->name != 0x4d1e906c)) { return -1; }
+ eprintf (" botInfoEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_bot_info (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb2e16f93 && T->type->name != 0x4d1e906c)) { return -1; }
+ eprintf (" botInfo");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" version :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" share_text :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" description :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" commands :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x75e7ea6c, .id = "BotCommand", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_bytes (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0ee1379f && T->type->name != 0xf11ec860)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int fetch_constructor_chat_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return -1; }
+ eprintf (" chatEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return -1; }
+ eprintf (" chat");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" title :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x56922676, .id = "ChatPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_chat_photo (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" participants_count :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" left :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bool (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" version :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field7) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_chat_forbidden (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return -1; }
+ eprintf (" chatForbidden");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" title :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_geo_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return -1; }
+ eprintf (" geoChat");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" title :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" address :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" venue :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" geo :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_geo_point (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x56922676, .id = "ChatPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_chat_photo (field7) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" participants_count :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field8) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field9) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" checked_in :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bool (field10) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" version :"); }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field11) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_chat_full (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02a614 && T->type->name != 0xd1fd59eb)) { return -1; }
+ eprintf (" chatFull");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" participants :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x77930f9f, .id = "ChatParticipants", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_chat_participants (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_photo :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_photo (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" notify_settings :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_peer_notify_settings (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" exported_invite :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f132d5, .id = "ExportedChatInvite", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_exported_chat_invite (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" bot_info :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb2e16f93, .id = "BotInfo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_chat_invite_already (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x94f910b1 && T->type->name != 0x6b06ef4e)) { return -1; }
+ eprintf (" chatInviteAlready");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_chat (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_chat_invite (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x94f910b1 && T->type->name != 0x6b06ef4e)) { return -1; }
+ eprintf (" chatInvite");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" title :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_chat_located (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3631cf4c && T->type->name != 0xc9ce30b3)) { return -1; }
+ eprintf (" chatLocated");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" distance :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_chat_participant (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc8d7493e && T->type->name != 0x3728b6c1)) { return -1; }
+ eprintf (" chatParticipant");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" inviter_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_chat_participants_forbidden (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x77930f9f && T->type->name != 0x886cf060)) { return -1; }
+ eprintf (" chatParticipantsForbidden");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_chat_participants (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x77930f9f && T->type->name != 0x886cf060)) { return -1; }
+ eprintf (" chatParticipants");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" admin_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" participants :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc8d7493e, .id = "ChatParticipant", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" version :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_chat_photo_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x56922676 && T->type->name != 0xa96dd989)) { return -1; }
+ eprintf (" chatPhotoEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_chat_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x56922676 && T->type->name != 0xa96dd989)) { return -1; }
+ eprintf (" chatPhoto");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo_small :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_file_location (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo_big :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_file_location (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_client_d_h_inner_data (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6643b654 && T->type->name != 0x99bc49ab)) { return -1; }
+ eprintf (" client_DH_inner_data");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" nonce :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int128 (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" server_nonce :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int128 (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" retry_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" g_b :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_config (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e32b894 && T->type->name != 0xb1cd476b)) { return -1; }
+ eprintf (" config");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" expires :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" test_mode :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bool (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" this_dc :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc_options :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2b1a62f0, .id = "DcOption", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_size_max :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" broadcast_size_max :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field7) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" forwarded_count_max :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field8) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" online_update_period_ms :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field9) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" offline_blur_timeout_ms :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field10) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" offline_idle_timeout_ms :"); }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field11) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" online_cloud_timeout_ms :"); }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field12) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" notify_cloud_delay_ms :"); }
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field13) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" notify_default_delay_ms :"); }
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field14) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_big_size :"); }
+ struct paramed_type *field15 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field15) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" push_chat_period_ms :"); }
+ struct paramed_type *field16 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field16) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" push_chat_limit :"); }
+ struct paramed_type *field17 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field17) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" disabled_features :"); }
+ struct paramed_type *field18 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xae636f24, .id = "DisabledFeature", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field18) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf911c994 && T->type->name != 0x06ee366b)) { return -1; }
+ eprintf (" contact");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mutual :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bool (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_contact_blocked (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x561bc879 && T->type->name != 0xa9e43786)) { return -1; }
+ eprintf (" contactBlocked");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_contact_found (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xea879f95 && T->type->name != 0x1578606a)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int fetch_constructor_contact_link_unknown (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return -1; }
+ eprintf (" contactLinkUnknown");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_contact_link_none (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return -1; }
+ eprintf (" contactLinkNone");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_contact_link_has_phone (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return -1; }
+ eprintf (" contactLinkHasPhone");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_contact_link_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return -1; }
+ eprintf (" contactLinkContact");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_contact_status (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd3680c61 && T->type->name != 0x2c97f39e)) { return -1; }
+ eprintf (" contactStatus");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" status :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x76de9570, .id = "UserStatus", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_user_status (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_contact_suggested (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3de191a1 && T->type->name != 0xc21e6e5e)) { return -1; }
+ eprintf (" contactSuggested");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mutual_contacts :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_dc_option_l28 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2b1a62f0 && T->type->name != 0xd4e59d0f)) { return -1; }
+ eprintf (" dcOptionL28");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" hostname :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" ip_address :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" port :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_dc_option (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2b1a62f0 && T->type->name != 0xd4e59d0f)) { return -1; }
+ eprintf (" dcOption");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" ip_address :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" port :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_decrypted_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x535b7918 && T->type->name != 0xaca486e7)) { return -1; }
+ eprintf (" decryptedMessage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" random_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" ttl :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" message :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" media :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x34e0d674, .id = "DecryptedMessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_decrypted_message_media (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_decrypted_message_service (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x535b7918 && T->type->name != 0xaca486e7)) { return -1; }
+ eprintf (" decryptedMessageService");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" random_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" action :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4e0eefde, .id = "DecryptedMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_decrypted_message_action (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_decrypted_message_action_set_message_t_t_l (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ eprintf (" decryptedMessageActionSetMessageTTL");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" ttl_seconds :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_decrypted_message_action_read_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ eprintf (" decryptedMessageActionReadMessages");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" random_ids :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_decrypted_message_action_delete_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ eprintf (" decryptedMessageActionDeleteMessages");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" random_ids :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_decrypted_message_action_screenshot_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ eprintf (" decryptedMessageActionScreenshotMessages");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" random_ids :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_decrypted_message_action_flush_history (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ eprintf (" decryptedMessageActionFlushHistory");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_decrypted_message_action_resend (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ eprintf (" decryptedMessageActionResend");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" start_seq_no :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" end_seq_no :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_decrypted_message_action_notify_layer (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ eprintf (" decryptedMessageActionNotifyLayer");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" layer :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_decrypted_message_action_typing (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ eprintf (" decryptedMessageActionTyping");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" action :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x70541c7e, .id = "SendMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_send_message_action (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_decrypted_message_action_request_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ eprintf (" decryptedMessageActionRequestKey");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" exchange_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" g_a :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_decrypted_message_action_accept_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ eprintf (" decryptedMessageActionAcceptKey");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" exchange_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" g_b :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key_fingerprint :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_decrypted_message_action_abort_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ eprintf (" decryptedMessageActionAbortKey");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" exchange_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_decrypted_message_action_commit_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ eprintf (" decryptedMessageActionCommitKey");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" exchange_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key_fingerprint :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_decrypted_message_action_noop (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ eprintf (" decryptedMessageActionNoop");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_decrypted_message_layer (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1be31789 && T->type->name != 0xe41ce876)) { return -1; }
+ eprintf (" decryptedMessageLayer");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" random_bytes :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" layer :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" in_seq_no :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" out_seq_no :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" message :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x535b7918, .id = "DecryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_decrypted_message (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_decrypted_message_media_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ eprintf (" decryptedMessageMediaEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_decrypted_message_media_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ eprintf (" decryptedMessageMediaPhoto");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" str_thumb :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb_w :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb_h :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" w :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" h :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" size :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field7) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" iv :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field8) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_decrypted_message_media_geo_point (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ eprintf (" decryptedMessageMediaGeoPoint");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" latitude :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_double (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" longitude :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_double (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_decrypted_message_media_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ eprintf (" decryptedMessageMediaContact");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" phone_number :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" first_name :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" last_name :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_decrypted_message_media_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ eprintf (" decryptedMessageMediaDocument");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" str_thumb :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb_w :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb_h :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" file_name :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mime_type :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" size :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field7) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" iv :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field8) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_decrypted_message_media_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ eprintf (" decryptedMessageMediaVideo");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" str_thumb :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb_w :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb_h :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" duration :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mime_type :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" w :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" h :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field7) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" size :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field8) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field9) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" iv :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field10) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_decrypted_message_media_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ eprintf (" decryptedMessageMediaAudio");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" duration :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mime_type :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" size :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" iv :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_decrypted_message_media_external_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ eprintf (" decryptedMessageMediaExternalDocument");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mime_type :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" size :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_photo_size (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc_id :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field7) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" attributes :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field8) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_decrypted_message_media_video_l12 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ eprintf (" decryptedMessageMediaVideoL12");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" str_thumb :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb_w :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb_h :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" duration :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" w :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" h :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" size :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field7) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field8) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" iv :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field9) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_decrypted_message_media_audio_l12 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ eprintf (" decryptedMessageMediaAudioL12");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" duration :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" size :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" iv :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_dialog (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc1dd804a && T->type->name != 0x3e227fb5)) { return -1; }
+ eprintf (" dialog");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" peer :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_peer (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" top_message :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" read_inbox_max_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" unread_count :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" notify_settings :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_peer_notify_settings (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_disabled_feature (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xae636f24 && T->type->name != 0x519c90db)) { return -1; }
+ eprintf (" disabledFeature");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" feature :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" description :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_document_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x51a73418 && T->type->name != 0xae58cbe7)) { return -1; }
+ eprintf (" documentEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x51a73418 && T->type->name != 0xae58cbe7)) { return -1; }
+ eprintf (" document");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mime_type :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" size :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_photo_size (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc_id :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field7) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" attributes :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field8) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_document_l19 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x51a73418 && T->type->name != 0xae58cbe7)) { return -1; }
+ eprintf (" document_l19");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" file_name :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mime_type :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" size :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field7) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_photo_size (field8) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc_id :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field9) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_document_attribute_image_size (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ eprintf (" documentAttributeImageSize");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" w :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" h :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_document_attribute_animated (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ eprintf (" documentAttributeAnimated");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_document_attribute_sticker_l28 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ eprintf (" documentAttributeStickerL28");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" alt :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_document_attribute_sticker (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ eprintf (" documentAttributeSticker");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" alt :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" stickerset :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe44d415c, .id = "InputStickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_input_sticker_set (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_document_attribute_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ eprintf (" documentAttributeVideo");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" duration :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" w :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" h :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_document_attribute_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ eprintf (" documentAttributeAudio");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" duration :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_document_attribute_filename (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ eprintf (" documentAttributeFilename");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" file_name :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_double (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2210c154 && T->type->name != 0xddef3eab)) { return -1; }
+ if (in_remaining () < 8) { return -1;}
+ eprintf (" %lf", fetch_double ());
+ return 0;
+}
+int fetch_constructor_encrypted_chat_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return -1; }
+ eprintf (" encryptedChatEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_encrypted_chat_waiting (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return -1; }
+ eprintf (" encryptedChatWaiting");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" admin_id :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" participant_id :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_encrypted_chat_requested (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return -1; }
+ eprintf (" encryptedChatRequested");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" admin_id :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" participant_id :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" g_a :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_encrypted_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return -1; }
+ eprintf (" encryptedChat");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" admin_id :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" participant_id :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" g_a_or_b :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key_fingerprint :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field7) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_encrypted_chat_discarded (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return -1; }
+ eprintf (" encryptedChatDiscarded");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_encrypted_file_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x886fd032 && T->type->name != 0x77902fcd)) { return -1; }
+ eprintf (" encryptedFileEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_encrypted_file (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x886fd032 && T->type->name != 0x77902fcd)) { return -1; }
+ eprintf (" encryptedFile");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" size :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc_id :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key_fingerprint :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_encrypted_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xce6b8a1e && T->type->name != 0x319475e1)) { return -1; }
+ eprintf (" encryptedMessage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" random_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" bytes :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" file :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x886fd032, .id = "EncryptedFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_encrypted_file (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_encrypted_message_service (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xce6b8a1e && T->type->name != 0x319475e1)) { return -1; }
+ eprintf (" encryptedMessageService");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" random_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" bytes :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_error (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc4b9f9bb && T->type->name != 0x3b460644)) { return -1; }
+ eprintf (" error");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" code :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" text :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_chat_invite_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f132d5 && T->type->name != 0x6a0ecd2a)) { return -1; }
+ eprintf (" chatInviteEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_chat_invite_exported (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f132d5 && T->type->name != 0x6a0ecd2a)) { return -1; }
+ eprintf (" chatInviteExported");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" link :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_file_location_unavailable (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2f8ffb30 && T->type->name != 0xd07004cf)) { return -1; }
+ eprintf (" fileLocationUnavailable");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" volume_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" local_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" secret :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2f8ffb30 && T->type->name != 0xd07004cf)) { return -1; }
+ eprintf (" fileLocation");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" volume_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" local_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" secret :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_geo_chat_message_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf67b4034 && T->type->name != 0x0984bfcb)) { return -1; }
+ eprintf (" geoChatMessageEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_geo_chat_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf67b4034 && T->type->name != 0x0984bfcb)) { return -1; }
+ eprintf (" geoChatMessage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" from_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" message :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" media :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_message_media (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_geo_chat_message_service (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf67b4034 && T->type->name != 0x0984bfcb)) { return -1; }
+ eprintf (" geoChatMessageService");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" from_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" action :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x383415fa, .id = "MessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_message_action (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_geo_point_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x315e0a53 && T->type->name != 0xcea1f5ac)) { return -1; }
+ eprintf (" geoPointEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_geo_point (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x315e0a53 && T->type->name != 0xcea1f5ac)) { return -1; }
+ eprintf (" geoPoint");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" longitude :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_double (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" latitude :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_double (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_imported_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd0028438 && T->type->name != 0x2ffd7bc7)) { return -1; }
+ eprintf (" importedContact");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" client_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_app_event (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x770656a8 && T->type->name != 0x88f9a957)) { return -1; }
+ eprintf (" inputAppEvent");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" time :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_double (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" type :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" peer :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" data :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_audio_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xae8e9c7b && T->type->name != 0x51716384)) { return -1; }
+ eprintf (" inputAudioEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xae8e9c7b && T->type->name != 0x51716384)) { return -1; }
+ eprintf (" inputAudio");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_chat_photo_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3a60776d && T->type->name != 0xc59f8892)) { return -1; }
+ eprintf (" inputChatPhotoEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_chat_uploaded_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3a60776d && T->type->name != 0xc59f8892)) { return -1; }
+ eprintf (" inputChatUploadedPhoto");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" file :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_input_file (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" crop :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7477e321, .id = "InputPhotoCrop", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_input_photo_crop (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_chat_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3a60776d && T->type->name != 0xc59f8892)) { return -1; }
+ eprintf (" inputChatPhoto");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe74279c9, .id = "InputPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_input_photo (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" crop :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7477e321, .id = "InputPhotoCrop", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_input_photo_crop (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_phone_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf392b7f4 && T->type->name != 0x0c6d480b)) { return -1; }
+ eprintf (" inputPhoneContact");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" client_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" phone :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" first_name :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" last_name :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_document_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6a8963fc && T->type->name != 0x95769c03)) { return -1; }
+ eprintf (" inputDocumentEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6a8963fc && T->type->name != 0x95769c03)) { return -1; }
+ eprintf (" inputDocument");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_encrypted_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf141b5e1 && T->type->name != 0x0ebe4a1e)) { return -1; }
+ eprintf (" inputEncryptedChat");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_encrypted_file_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return -1; }
+ eprintf (" inputEncryptedFileEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_encrypted_file_uploaded (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return -1; }
+ eprintf (" inputEncryptedFileUploaded");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" parts :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" md5_checksum :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key_fingerprint :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_encrypted_file (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return -1; }
+ eprintf (" inputEncryptedFile");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_encrypted_file_big_uploaded (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return -1; }
+ eprintf (" inputEncryptedFileBigUploaded");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" parts :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key_fingerprint :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_file (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0f60f9ca && T->type->name != 0xf09f0635)) { return -1; }
+ eprintf (" inputFile");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" parts :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" name :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" md5_checksum :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_file_big (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0f60f9ca && T->type->name != 0xf09f0635)) { return -1; }
+ eprintf (" inputFileBig");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" parts :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" name :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return -1; }
+ eprintf (" inputFileLocation");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" volume_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" local_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" secret :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_video_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return -1; }
+ eprintf (" inputVideoFileLocation");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_encrypted_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return -1; }
+ eprintf (" inputEncryptedFileLocation");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_audio_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return -1; }
+ eprintf (" inputAudioFileLocation");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_document_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return -1; }
+ eprintf (" inputDocumentFileLocation");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_geo_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x74d456fa && T->type->name != 0x8b2ba905)) { return -1; }
+ eprintf (" inputGeoChat");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_geo_point_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17768f1f && T->type->name != 0xe88970e0)) { return -1; }
+ eprintf (" inputGeoPointEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_geo_point (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17768f1f && T->type->name != 0xe88970e0)) { return -1; }
+ eprintf (" inputGeoPoint");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" latitude :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_double (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" longitude :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_double (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_media_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ eprintf (" inputMediaEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_media_uploaded_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ eprintf (" inputMediaUploadedPhoto");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" file :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_input_file (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" caption :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_media_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ eprintf (" inputMediaPhoto");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe74279c9, .id = "InputPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_input_photo (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" caption :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_media_geo_point (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ eprintf (" inputMediaGeoPoint");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" geo_point :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17768f1f, .id = "InputGeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_input_geo_point (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_media_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ eprintf (" inputMediaContact");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" phone_number :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" first_name :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" last_name :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_media_uploaded_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ eprintf (" inputMediaUploadedVideo");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" file :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_input_file (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" duration :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" w :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" h :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" caption :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_media_uploaded_thumb_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ eprintf (" inputMediaUploadedThumbVideo");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" file :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_input_file (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_input_file (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" duration :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" w :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" h :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" caption :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_media_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ eprintf (" inputMediaVideo");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" video_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xbb5f7a27, .id = "InputVideo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_input_video (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" caption :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_media_uploaded_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ eprintf (" inputMediaUploadedAudio");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" file :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_input_file (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" duration :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mime_type :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_media_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ eprintf (" inputMediaAudio");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" audio_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xae8e9c7b, .id = "InputAudio", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_input_audio (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_media_uploaded_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ eprintf (" inputMediaUploadedDocument");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" file :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_input_file (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mime_type :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" attributes :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_media_uploaded_thumb_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ eprintf (" inputMediaUploadedThumbDocument");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" file :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_input_file (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_input_file (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mime_type :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" attributes :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_media_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ eprintf (" inputMediaDocument");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" document_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x6a8963fc, .id = "InputDocument", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_input_document (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_media_venue (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ eprintf (" inputMediaVenue");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" geo_point :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17768f1f, .id = "InputGeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_input_geo_point (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" title :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" address :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" provider :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" venue_id :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_notify_peer (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return -1; }
+ eprintf (" inputNotifyPeer");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" peer :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9e67268d, .id = "InputPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_input_peer (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_notify_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return -1; }
+ eprintf (" inputNotifyUsers");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_notify_chats (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return -1; }
+ eprintf (" inputNotifyChats");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_notify_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return -1; }
+ eprintf (" inputNotifyAll");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_notify_geo_chat_peer (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return -1; }
+ eprintf (" inputNotifyGeoChatPeer");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" geo_peer :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x74d456fa, .id = "InputGeoChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_input_geo_chat (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_peer_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return -1; }
+ eprintf (" inputPeerEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_peer_self (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return -1; }
+ eprintf (" inputPeerSelf");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_peer_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return -1; }
+ eprintf (" inputPeerContact");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_peer_foreign (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return -1; }
+ eprintf (" inputPeerForeign");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_peer_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return -1; }
+ eprintf (" inputPeerChat");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_peer_notify_events_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x185a48ac && T->type->name != 0xe7a5b753)) { return -1; }
+ eprintf (" inputPeerNotifyEventsEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_peer_notify_events_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x185a48ac && T->type->name != 0xe7a5b753)) { return -1; }
+ eprintf (" inputPeerNotifyEventsAll");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_peer_notify_settings (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x46a2ce98 && T->type->name != 0xb95d3167)) { return -1; }
+ eprintf (" inputPeerNotifySettings");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mute_until :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" sound :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" show_previews :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bool (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" events_mask :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_photo_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe74279c9 && T->type->name != 0x18bd8636)) { return -1; }
+ eprintf (" inputPhotoEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe74279c9 && T->type->name != 0x18bd8636)) { return -1; }
+ eprintf (" inputPhoto");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_photo_crop_auto (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7477e321 && T->type->name != 0x8b881cde)) { return -1; }
+ eprintf (" inputPhotoCropAuto");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_photo_crop (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7477e321 && T->type->name != 0x8b881cde)) { return -1; }
+ eprintf (" inputPhotoCrop");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" crop_left :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_double (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" crop_top :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_double (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" crop_width :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_double (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_privacy_key_status_timestamp (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4f96cb18 && T->type->name != 0xb06934e7)) { return -1; }
+ eprintf (" inputPrivacyKeyStatusTimestamp");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_privacy_value_allow_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ eprintf (" inputPrivacyValueAllowContacts");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_privacy_value_allow_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ eprintf (" inputPrivacyValueAllowAll");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_privacy_value_allow_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ eprintf (" inputPrivacyValueAllowUsers");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_privacy_value_disallow_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ eprintf (" inputPrivacyValueDisallowContacts");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_privacy_value_disallow_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ eprintf (" inputPrivacyValueDisallowAll");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_privacy_value_disallow_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ eprintf (" inputPrivacyValueDisallowUsers");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_sticker_set_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe44d415c && T->type->name != 0x1bb2bea3)) { return -1; }
+ eprintf (" inputStickerSetEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_sticker_set_i_d (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe44d415c && T->type->name != 0x1bb2bea3)) { return -1; }
+ eprintf (" inputStickerSetID");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_sticker_set_short_name (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe44d415c && T->type->name != 0x1bb2bea3)) { return -1; }
+ eprintf (" inputStickerSetShortName");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" short_name :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_user_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return -1; }
+ eprintf (" inputUserEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_user_self (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return -1; }
+ eprintf (" inputUserSelf");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_user_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return -1; }
+ eprintf (" inputUserContact");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_user_foreign (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return -1; }
+ eprintf (" inputUserForeign");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_video_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbb5f7a27 && T->type->name != 0x44a085d8)) { return -1; }
+ eprintf (" inputVideoEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbb5f7a27 && T->type->name != 0x44a085d8)) { return -1; }
+ eprintf (" inputVideo");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_int (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8509bda && T->type->name != 0x57af6425)) { return -1; }
+ if (in_remaining () < 4) { return -1;}
+ eprintf (" %d", fetch_int ());
+ return 0;
+}
+int fetch_constructor_int128 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7d36c439 && T->type->name != 0x82c93bc6)) { return -1; }
+ eprintf (" int128");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_int256 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf2c798b3 && T->type->name != 0x0d38674c)) { return -1; }
+ eprintf (" int256");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_keyboard_button (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa2fa4880 && T->type->name != 0x5d05b77f)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int fetch_constructor_keyboard_button_row (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x77608b83 && T->type->name != 0x889f747c)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa2fa4880, .id = "KeyboardButton", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int fetch_constructor_long (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22076cba && T->type->name != 0xddf89345)) { return -1; }
+ if (in_remaining () < 8) { return -1;}
+ eprintf (" %I64d", fetch_long ());
+ return 0;
+}
+int fetch_constructor_message_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5d652a7f && T->type->name != 0xa29ad580)) { return -1; }
+ eprintf (" messageEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5d652a7f && T->type->name != 0xa29ad580)) { return -1; }
+ eprintf (" message");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ if (in_remaining () < 4) { return -1;}
+ eprintf (" %d", prefetch_int ());
+ struct paramed_type *var0 = INT2PTR (fetch_int ());
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" from_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" to_id :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_peer (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" fwd_from_id :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" fwd_date :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" reply_to_msg_id :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field7) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field8) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" message :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field9) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" media :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_message_media (field10) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (PTR2INT (var0) & (1 << 6)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" reply_markup :"); }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x612ca4a9, .id = "ReplyMarkup", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_reply_markup (field11) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ return 0;
+}
+int fetch_constructor_message_service (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5d652a7f && T->type->name != 0xa29ad580)) { return -1; }
+ eprintf (" messageService");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" from_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" to_id :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_peer (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" action :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x383415fa, .id = "MessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_message_action (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_message_action_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ eprintf (" messageActionEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_message_action_chat_create (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ eprintf (" messageActionChatCreate");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" title :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_message_action_chat_edit_title (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ eprintf (" messageActionChatEditTitle");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" title :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_message_action_chat_edit_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ eprintf (" messageActionChatEditPhoto");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_photo (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_message_action_chat_delete_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ eprintf (" messageActionChatDeletePhoto");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_message_action_chat_add_user (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ eprintf (" messageActionChatAddUser");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_message_action_chat_delete_user (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ eprintf (" messageActionChatDeleteUser");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_message_action_geo_chat_create (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ eprintf (" messageActionGeoChatCreate");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" title :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" address :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_message_action_geo_chat_checkin (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ eprintf (" messageActionGeoChatCheckin");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_message_action_chat_joined_by_link (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ eprintf (" messageActionChatJoinedByLink");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" inviter_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_message_media_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ eprintf (" messageMediaEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_message_media_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ eprintf (" messageMediaPhoto");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_photo (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" caption :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_message_media_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ eprintf (" messageMediaVideo");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" video :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1716b174, .id = "Video", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_video (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" caption :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_message_media_geo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ eprintf (" messageMediaGeo");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" geo :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_geo_point (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_message_media_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ eprintf (" messageMediaContact");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" phone_number :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" first_name :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" last_name :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_message_media_unsupported (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ eprintf (" messageMediaUnsupported");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_message_media_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ eprintf (" messageMediaDocument");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" document :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_document (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_message_media_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ eprintf (" messageMediaAudio");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" audio :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9fc5ec4e, .id = "Audio", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_audio (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_message_media_web_page (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ eprintf (" messageMediaWebPage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" webpage :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x8d8c0d41, .id = "WebPage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_web_page (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_message_media_venue (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ eprintf (" messageMediaVenue");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" geo :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_geo_point (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" title :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" address :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" provider :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" venue_id :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_message_media_photo_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ eprintf (" messageMediaPhotoL27");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_photo (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_message_media_video_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ eprintf (" messageMediaVideoL27");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" video :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1716b174, .id = "Video", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_video (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_messages_filter_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ eprintf (" inputMessagesFilterEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_messages_filter_photos (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ eprintf (" inputMessagesFilterPhotos");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_messages_filter_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ eprintf (" inputMessagesFilterVideo");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_messages_filter_photo_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ eprintf (" inputMessagesFilterPhotoVideo");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_messages_filter_photo_video_documents (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ eprintf (" inputMessagesFilterPhotoVideoDocuments");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_messages_filter_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ eprintf (" inputMessagesFilterDocument");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_input_messages_filter_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ eprintf (" inputMessagesFilterAudio");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_nearest_dc (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8e1a1775 && T->type->name != 0x71e5e88a)) { return -1; }
+ eprintf (" nearestDc");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" country :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" this_dc :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" nearest_dc :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_notify_peer (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return -1; }
+ eprintf (" notifyPeer");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" peer :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_peer (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_notify_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return -1; }
+ eprintf (" notifyUsers");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_notify_chats (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return -1; }
+ eprintf (" notifyChats");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_notify_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return -1; }
+ eprintf (" notifyAll");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_null (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x56730bcc && T->type->name != 0xa98cf433)) { return -1; }
+ eprintf (" null");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_p_q_inner_data (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbfa3de38 && T->type->name != 0x405c21c7)) { return -1; }
+ eprintf (" p_q_inner_data");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pq :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" p :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" q :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" nonce :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int128 (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" server_nonce :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int128 (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_nonce :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0d38674c, .id = "Bare_Int256", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int256 (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_p_q_inner_data_temp (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbfa3de38 && T->type->name != 0x405c21c7)) { return -1; }
+ eprintf (" p_q_inner_data_temp");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pq :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" p :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" q :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" nonce :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int128 (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" server_nonce :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int128 (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_nonce :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0d38674c, .id = "Bare_Int256", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int256 (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" expires_in :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field7) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_peer_user (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x276159d6 && T->type->name != 0xd89ea629)) { return -1; }
+ eprintf (" peerUser");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_peer_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x276159d6 && T->type->name != 0xd89ea629)) { return -1; }
+ eprintf (" peerChat");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_peer_notify_events_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc0c8d13b && T->type->name != 0x3f372ec4)) { return -1; }
+ eprintf (" peerNotifyEventsEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_peer_notify_events_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc0c8d13b && T->type->name != 0x3f372ec4)) { return -1; }
+ eprintf (" peerNotifyEventsAll");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_peer_notify_settings_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xfdf894fc && T->type->name != 0x02076b03)) { return -1; }
+ eprintf (" peerNotifySettingsEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_peer_notify_settings (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xfdf894fc && T->type->name != 0x02076b03)) { return -1; }
+ eprintf (" peerNotifySettings");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mute_until :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" sound :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" show_previews :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bool (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" events_mask :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_photo_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc207550a && T->type->name != 0x3df8aaf5)) { return -1; }
+ eprintf (" photoEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc207550a && T->type->name != 0x3df8aaf5)) { return -1; }
+ eprintf (" photo");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" geo :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_geo_point (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" sizes :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_photo_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc207550a && T->type->name != 0x3df8aaf5)) { return -1; }
+ eprintf (" photoL27");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" caption :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" geo :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_geo_point (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" sizes :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field7) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_photo_size_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x900f60dd && T->type->name != 0x6ff09f22)) { return -1; }
+ eprintf (" photoSizeEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" type :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_photo_size (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x900f60dd && T->type->name != 0x6ff09f22)) { return -1; }
+ eprintf (" photoSize");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" type :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" location :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_file_location (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" w :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" h :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" size :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_photo_cached_size (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x900f60dd && T->type->name != 0x6ff09f22)) { return -1; }
+ eprintf (" photoCachedSize");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" type :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" location :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_file_location (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" w :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" h :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" bytes :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_privacy_key_status_timestamp (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbc2eab30 && T->type->name != 0x43d154cf)) { return -1; }
+ eprintf (" privacyKeyStatusTimestamp");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_privacy_value_allow_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ eprintf (" privacyValueAllowContacts");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_privacy_value_allow_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ eprintf (" privacyValueAllowAll");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_privacy_value_allow_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ eprintf (" privacyValueAllowUsers");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_privacy_value_disallow_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ eprintf (" privacyValueDisallowContacts");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_privacy_value_disallow_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ eprintf (" privacyValueDisallowAll");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_privacy_value_disallow_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ eprintf (" privacyValueDisallowUsers");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_received_notify_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa384b779 && T->type->name != 0x5c7b4886)) { return -1; }
+ eprintf (" receivedNotifyMessage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_reply_keyboard_hide (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x612ca4a9 && T->type->name != 0x9ed35b56)) { return -1; }
+ eprintf (" replyKeyboardHide");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_reply_keyboard_force_reply (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x612ca4a9 && T->type->name != 0x9ed35b56)) { return -1; }
+ eprintf (" replyKeyboardForceReply");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_reply_keyboard_markup (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x612ca4a9 && T->type->name != 0x9ed35b56)) { return -1; }
+ eprintf (" replyKeyboardMarkup");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" rows :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x77608b83, .id = "KeyboardButtonRow", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_res_p_q (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x05162463 && T->type->name != 0xfae9db9c)) { return -1; }
+ eprintf (" resPQ");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" nonce :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int128 (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" server_nonce :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int128 (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pq :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" server_public_key_fingerprints :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_send_message_typing_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ eprintf (" sendMessageTypingAction");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_send_message_cancel_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ eprintf (" sendMessageCancelAction");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_send_message_record_video_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ eprintf (" sendMessageRecordVideoAction");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_send_message_upload_video_action_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ eprintf (" sendMessageUploadVideoActionL27");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_send_message_upload_video_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ eprintf (" sendMessageUploadVideoAction");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" progress :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_send_message_record_audio_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ eprintf (" sendMessageRecordAudioAction");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_send_message_upload_audio_action_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ eprintf (" sendMessageUploadAudioActionL27");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_send_message_upload_audio_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ eprintf (" sendMessageUploadAudioAction");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" progress :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_send_message_upload_photo_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ eprintf (" sendMessageUploadPhotoAction");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" progress :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_send_message_upload_document_action_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ eprintf (" sendMessageUploadDocumentActionL27");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_send_message_upload_document_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ eprintf (" sendMessageUploadDocumentAction");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" progress :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_send_message_geo_location_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ eprintf (" sendMessageGeoLocationAction");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_send_message_choose_contact_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ eprintf (" sendMessageChooseContactAction");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_server_d_h_params_fail (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa9230301 && T->type->name != 0x56dcfcfe)) { return -1; }
+ eprintf (" server_DH_params_fail");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" nonce :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int128 (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" server_nonce :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int128 (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_nonce_hash :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int128 (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_server_d_h_params_ok (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa9230301 && T->type->name != 0x56dcfcfe)) { return -1; }
+ eprintf (" server_DH_params_ok");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" nonce :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int128 (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" server_nonce :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int128 (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" encrypted_answer :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_server_d_h_inner_data (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb5890dba && T->type->name != 0x4a76f245)) { return -1; }
+ eprintf (" server_DH_inner_data");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" nonce :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int128 (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" server_nonce :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int128 (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" g :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dh_prime :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" g_a :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" server_time :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_dh_gen_ok (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdb8a468f && T->type->name != 0x2475b970)) { return -1; }
+ eprintf (" dh_gen_ok");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" nonce :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int128 (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" server_nonce :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int128 (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_nonce_hash1 :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int128 (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_dh_gen_retry (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdb8a468f && T->type->name != 0x2475b970)) { return -1; }
+ eprintf (" dh_gen_retry");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" nonce :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int128 (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" server_nonce :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int128 (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_nonce_hash2 :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int128 (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_dh_gen_fail (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdb8a468f && T->type->name != 0x2475b970)) { return -1; }
+ eprintf (" dh_gen_fail");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" nonce :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int128 (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" server_nonce :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int128 (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_nonce_hash3 :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int128 (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_sticker_pack (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x12b299d4 && T->type->name != 0xed4d662b)) { return -1; }
+ eprintf (" stickerPack");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" emoticon :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" documents :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_sticker_set (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa7a43b17 && T->type->name != 0x585bc4e8)) { return -1; }
+ eprintf (" stickerSet");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" title :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" short_name :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_string (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb5286e24 && T->type->name != 0x4ad791db)) { return -1; }
+ static char buf[1 << 22];
+ int l = prefetch_strlen ();
+ if (l < 0 || (l >= (1 << 22) - 2)) { return -1; }
+ memcpy (buf, fetch_str (l), l);
+ buf[l] = 0;
+ print_escaped_string (buf, l);
+ return 0;
+}
+int fetch_constructor_update_new_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateNewMessage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" message :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_message (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts_count :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_message_i_d (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateMessageID");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" random_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_delete_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateDeleteMessages");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" messages :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts_count :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_user_typing (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateUserTyping");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" action :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x70541c7e, .id = "SendMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_send_message_action (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_chat_user_typing (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateChatUserTyping");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" action :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x70541c7e, .id = "SendMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_send_message_action (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_chat_participants (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateChatParticipants");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" participants :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x77930f9f, .id = "ChatParticipants", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_chat_participants (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_user_status (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateUserStatus");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" status :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x76de9570, .id = "UserStatus", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_user_status (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_user_name (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateUserName");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" first_name :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" last_name :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" username :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_user_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateUserPhoto");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9a486229, .id = "UserProfilePhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_user_profile_photo (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" previous :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bool (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_contact_registered (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateContactRegistered");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_contact_link (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateContactLink");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" my_link :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_contact_link (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" foreign_link :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_contact_link (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_new_authorization (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateNewAuthorization");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" auth_key_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" device :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" location :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_new_geo_chat_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateNewGeoChatMessage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" geo_message :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_geo_chat_message (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_new_encrypted_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateNewEncryptedMessage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" encr_message :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xce6b8a1e, .id = "EncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_encrypted_message (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" qts :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_encrypted_chat_typing (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateEncryptedChatTyping");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_encryption (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateEncryption");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" encr_chat :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb1718213, .id = "EncryptedChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_encrypted_chat (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_encrypted_messages_read (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateEncryptedMessagesRead");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" max_date :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_chat_participant_add (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateChatParticipantAdd");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" inviter_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" version :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_chat_participant_delete (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateChatParticipantDelete");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" version :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_dc_options (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateDcOptions");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc_options :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2b1a62f0, .id = "DcOption", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_user_blocked (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateUserBlocked");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" blocked :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bool (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_notify_settings (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateNotifySettings");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" notify_peer :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9fcb8237, .id = "NotifyPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_notify_peer (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" notify_settings :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_peer_notify_settings (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_service_notification (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateServiceNotification");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" type :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" message_text :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" media :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_message_media (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" popup :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bool (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_privacy (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updatePrivacy");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xbc2eab30, .id = "PrivacyKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_privacy_key (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" rules :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa8638aec, .id = "PrivacyRule", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_user_phone (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateUserPhone");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" phone :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_read_history_inbox (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateReadHistoryInbox");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" peer :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_peer (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" max_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts_count :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_read_history_outbox (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateReadHistoryOutbox");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" peer :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_peer (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" max_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts_count :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_web_page (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateWebPage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" webpage :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x8d8c0d41, .id = "WebPage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_web_page (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_read_messages_contents (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateReadMessagesContents");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" messages :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts_count :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_msg_update (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateMsgUpdate");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts_count :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_updates_too_long (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ eprintf (" updatesTooLong");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_update_short_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ eprintf (" updateShortMessage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ if (in_remaining () < 4) { return -1;}
+ eprintf (" %d", prefetch_int ());
+ struct paramed_type *var0 = INT2PTR (fetch_int ());
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" message :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts_count :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field7) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" fwd_from_id :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field8) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" fwd_date :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field9) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" reply_to_msg_id :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field10) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ return 0;
+}
+int fetch_constructor_update_short_chat_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ eprintf (" updateShortChatMessage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ if (in_remaining () < 4) { return -1;}
+ eprintf (" %d", prefetch_int ());
+ struct paramed_type *var0 = INT2PTR (fetch_int ());
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" from_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" message :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts_count :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field7) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field8) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" fwd_from_id :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field9) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" fwd_date :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field10) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" reply_to_msg_id :"); }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field11) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ return 0;
+}
+int fetch_constructor_update_short (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ eprintf (" updateShort");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" update :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_update (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_updates_combined (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ eprintf (" updatesCombined");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" updates :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chats :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" seq_start :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" seq :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_updates (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ eprintf (" updates");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" updates :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chats :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" seq :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_user_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02e6c0c8 && T->type->name != 0xfd193f37)) { return -1; }
+ eprintf (" userEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_user (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02e6c0c8 && T->type->name != 0xfd193f37)) { return -1; }
+ eprintf (" user");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ if (in_remaining () < 4) { return -1;}
+ eprintf (" %d", prefetch_int ());
+ struct paramed_type *var0 = INT2PTR (fetch_int ());
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (PTR2INT (var0) & (1 << 0)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 1)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" first_name :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" last_name :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" username :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 4)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" phone :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field7) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 5)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9a486229, .id = "UserProfilePhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_user_profile_photo (field8) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 6)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" status :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x76de9570, .id = "UserStatus", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_user_status (field9) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 14)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" bot_info_version :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field10) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ return 0;
+}
+int fetch_constructor_user_full (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5a89ac5b && T->type->name != 0xa57653a4)) { return -1; }
+ eprintf (" userFull");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_user (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" link :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3ace484c, .id = "contacts.Link", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_contacts_link (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" profile_photo :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_photo (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" notify_settings :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_peer_notify_settings (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" blocked :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bool (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" bot_info :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb2e16f93, .id = "BotInfo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bot_info (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_user_profile_photo_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9a486229 && T->type->name != 0x65b79dd6)) { return -1; }
+ eprintf (" userProfilePhotoEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_user_profile_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9a486229 && T->type->name != 0x65b79dd6)) { return -1; }
+ eprintf (" userProfilePhoto");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo_small :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_file_location (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo_big :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_file_location (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_user_status_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ eprintf (" userStatusEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_user_status_online (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ eprintf (" userStatusOnline");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" expires :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_user_status_offline (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ eprintf (" userStatusOffline");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" was_online :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_user_status_recently (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ eprintf (" userStatusRecently");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_user_status_last_week (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ eprintf (" userStatusLastWeek");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_user_status_last_month (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ eprintf (" userStatusLastMonth");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_vector (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1cb5c415 && T->type->name != 0xe34a3bea)) { return -1; }
+ if (ODDP(T->params[0])) { return -1; }
+ struct paramed_type *var0 = T->params[0]; assert (var0);
+ eprintf (" vector");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (in_remaining () < 4) { return -1;}
+ eprintf (" %d", prefetch_int ());
+ struct paramed_type *var1 = INT2PTR (fetch_int ());
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ int multiplicity3 = PTR2INT (
+ ((void *)var1) + 0 );
+ struct paramed_type *field3 =
+ var0;
+ eprintf (" [");
+ if (multiline_output >= 1) { eprintf ("\n"); }
+ if (multiline_output >= 1) { multiline_offset += multiline_offset_size;}
+ while (multiplicity3 -- > 0) {
+ if (multiline_output >= 1) { print_offset (); }
+ if (fetch_type_any (field3) < 0) { return -1;}
+ if (multiline_output >= 1) { eprintf ("\n"); }
+ }
+ if (multiline_output >= 1) { multiline_offset -= multiline_offset_size; print_offset ();}
+ eprintf (" ]");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_video_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1716b174 && T->type->name != 0xe8e94e8b)) { return -1; }
+ eprintf (" videoEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1716b174 && T->type->name != 0xe8e94e8b)) { return -1; }
+ eprintf (" video");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" duration :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" size :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_photo_size (field7) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc_id :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field8) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" w :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field9) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" h :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field10) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_video_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1716b174 && T->type->name != 0xe8e94e8b)) { return -1; }
+ eprintf (" videoL27");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" caption :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" duration :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mime_type :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field7) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" size :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field8) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_photo_size (field9) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc_id :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field10) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" w :"); }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field11) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" h :"); }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field12) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_wall_paper (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xafa14973 && T->type->name != 0x505eb68c)) { return -1; }
+ eprintf (" wallPaper");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" title :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" sizes :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" color :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_wall_paper_solid (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xafa14973 && T->type->name != 0x505eb68c)) { return -1; }
+ eprintf (" wallPaperSolid");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" title :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" bg_color :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" color :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_web_page_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8d8c0d41 && T->type->name != 0x7273f2be)) { return -1; }
+ eprintf (" webPageEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_web_page_pending (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8d8c0d41 && T->type->name != 0x7273f2be)) { return -1; }
+ eprintf (" webPagePending");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_web_page (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8d8c0d41 && T->type->name != 0x7273f2be)) { return -1; }
+ eprintf (" webPage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ if (in_remaining () < 4) { return -1;}
+ eprintf (" %d", prefetch_int ());
+ struct paramed_type *var0 = INT2PTR (fetch_int ());
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" url :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" display_url :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (PTR2INT (var0) & (1 << 0)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" type :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 1)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" site_name :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" title :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field7) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" description :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field8) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 4)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_photo (field9) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 5)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" embed_url :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field10) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 5)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" embed_type :"); }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field11) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 6)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" embed_width :"); }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field12) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 6)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" embed_height :"); }
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field13) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 7)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" duration :"); }
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field14) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 8)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" author :"); }
+ struct paramed_type *field15 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field15) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ return 0;
+}
+int fetch_constructor_account_authorizations (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1250abde && T->type->name != 0xedaf5421)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bf2e6f6, .id = "Authorization", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int fetch_constructor_account_no_password (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xeac2a804 && T->type->name != 0x153d57fb)) { return -1; }
+ eprintf (" account.noPassword");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_salt :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" email_unconfirmed_pattern :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_account_password (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xeac2a804 && T->type->name != 0x153d57fb)) { return -1; }
+ eprintf (" account.password");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" current_salt :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_salt :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" hint :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" has_recovery :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bool (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" email_unconfirmed_pattern :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_account_password_input_settings (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbcfc532c && T->type->name != 0x4303acd3)) { return -1; }
+ eprintf (" account.passwordInputSettings");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ if (in_remaining () < 4) { return -1;}
+ eprintf (" %d", prefetch_int ());
+ struct paramed_type *var0 = INT2PTR (fetch_int ());
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (PTR2INT (var0) & (1 << 0)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_salt :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 0)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_password_hash :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 0)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" hint :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 1)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" email :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ return 0;
+}
+int fetch_constructor_account_password_settings (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb7b72ab3 && T->type->name != 0x4848d54c)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int fetch_constructor_account_privacy_rules (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x554abb6f && T->type->name != 0xaab54490)) { return -1; }
+ eprintf (" account.privacyRules");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" rules :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa8638aec, .id = "PrivacyRule", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_account_sent_change_phone_code (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa4f58c4c && T->type->name != 0x5b0a73b3)) { return -1; }
+ eprintf (" account.sentChangePhoneCode");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" phone_code_hash :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" send_call_timeout :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_auth_authorization (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xff036af1 && T->type->name != 0x00fc950e)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_user (field1) < 0) { return -1;}
+ return 0;
+}
+int fetch_constructor_auth_checked_phone (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x811ea28e && T->type->name != 0x7ee15d71)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bool (field1) < 0) { return -1;}
+ return 0;
+}
+int fetch_constructor_auth_exported_authorization (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdf969c2d && T->type->name != 0x206963d2)) { return -1; }
+ eprintf (" auth.exportedAuthorization");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" bytes :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_auth_password_recovery (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x137948a5 && T->type->name != 0xec86b75a)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int fetch_constructor_auth_sent_code (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0cc8bc16 && T->type->name != 0xf33743e9)) { return -1; }
+ eprintf (" auth.sentCode");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" phone_registered :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bool (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" phone_code_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" send_call_timeout :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" is_password :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bool (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_auth_sent_app_code (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0cc8bc16 && T->type->name != 0xf33743e9)) { return -1; }
+ eprintf (" auth.sentAppCode");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" phone_registered :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bool (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" phone_code_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" send_call_timeout :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" is_password :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bool (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_binlog_encr_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0377168f && T->type->name != 0xfc88e970)) { return -1; }
+ int multiplicity1 = PTR2INT (
+ INT2PTR (64) );
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ eprintf (" [");
+ if (multiline_output >= 1) { eprintf ("\n"); }
+ if (multiline_output >= 1) { multiline_offset += multiline_offset_size;}
+ while (multiplicity1 -- > 0) {
+ if (multiline_output >= 1) { print_offset (); }
+ if (fetch_type_any (field1) < 0) { return -1;}
+ if (multiline_output >= 1) { eprintf ("\n"); }
+ }
+ if (multiline_output >= 1) { multiline_offset -= multiline_offset_size; print_offset ();}
+ eprintf (" ]");
+ return 0;
+}
+int fetch_constructor_binlog_start (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.start");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_binlog_dc_option (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.dcOption");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" name :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" ip :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" port :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_binlog_dc_option_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.dcOptionNew");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" name :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" ip :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" port :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_binlog_auth_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.authKey");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_binlog_encr_key (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_binlog_default_dc (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.defaultDc");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_binlog_dc_signed (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.dcSigned");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_binlog_our_id (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.ourId");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_binlog_set_dh_params (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.setDhParams");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" root :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" prime :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_binlog_encr_key (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" version :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_binlog_set_pts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.setPts");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_binlog_set_qts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.setQts");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" qts :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_binlog_set_date (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.setDate");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_binlog_set_seq (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.setSeq");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" seq :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_binlog_encr_chat_delete (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.encrChatDelete");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_binlog_encr_chat_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.encrChatNew");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ if (in_remaining () < 4) { return -1;}
+ eprintf (" %d", prefetch_int ());
+ struct paramed_type *var0 = INT2PTR (fetch_int ());
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" admin :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_binlog_encr_key (field7) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" g_key :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_binlog_encr_key (field8) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" state :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field9) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" ttl :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field10) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 25)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" layer :"); }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field11) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" in_seq_no :"); }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field12) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" last_in_seq_no :"); }
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field13) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" out_seq_no :"); }
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field14) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 27)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key_fingerprint :"); }
+ struct paramed_type *field15 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field15) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ return 0;
+}
+int fetch_constructor_binlog_encr_chat_exchange_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.encrChatExchangeNew");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ if (in_remaining () < 4) { return -1;}
+ eprintf (" %d", prefetch_int ());
+ struct paramed_type *var0 = INT2PTR (fetch_int ());
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" exchange_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_binlog_encr_key (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" state :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ return 0;
+}
+int fetch_constructor_binlog_user_delete (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.userDelete");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_binlog_user_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.userNew");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ if (in_remaining () < 4) { return -1;}
+ eprintf (" %d", prefetch_int ());
+ struct paramed_type *var0 = INT2PTR (fetch_int ());
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" first_name :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" last_name :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" phone :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" username :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field7) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_photo (field8) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" real_first_name :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field9) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" real_last_name :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field10) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_photo :"); }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9a486229, .id = "UserProfilePhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_user_profile_photo (field11) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" last_read_in :"); }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field12) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 25)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" last_read_out :"); }
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field13) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" bot_info :"); }
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb2e16f93, .id = "BotInfo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bot_info (field14) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ return 0;
+}
+int fetch_constructor_binlog_chat_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.chatNew");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ if (in_remaining () < 4) { return -1;}
+ eprintf (" %d", prefetch_int ());
+ struct paramed_type *var0 = INT2PTR (fetch_int ());
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" title :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_num :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" version :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" participants :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc8d7493e, .id = "ChatParticipant", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field7) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_photo :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x56922676, .id = "ChatPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_chat_photo (field8) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_photo (field9) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" admin :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field10) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" last_read_in :"); }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field11) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 25)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" last_read_out :"); }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field12) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ return 0;
+}
+int fetch_constructor_binlog_chat_add_participant (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.chatAddParticipant");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" version :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" inviter_id :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_binlog_chat_del_participant (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.chatDelParticipant");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" version :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_binlog_set_msg_id (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.setMsgId");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" old_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_binlog_message_delete (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.messageDelete");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" lid :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_binlog_message_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.messageNew");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ if (in_remaining () < 4) { return -1;}
+ eprintf (" %d", prefetch_int ());
+ struct paramed_type *var0 = INT2PTR (fetch_int ());
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" lid :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" from_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" to_type :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" to_id :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" fwd_from_id :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" fwd_date :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field7) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field8) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" message :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field9) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" media :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_message_media (field10) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" action :"); }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x383415fa, .id = "MessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_message_action (field11) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" reply_id :"); }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field12) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" reply_markup :"); }
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x612ca4a9, .id = "ReplyMarkup", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_reply_markup (field13) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ return 0;
+}
+int fetch_constructor_binlog_message_encr_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.messageEncrNew");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ if (in_remaining () < 4) { return -1;}
+ eprintf (" %d", prefetch_int ());
+ struct paramed_type *var0 = INT2PTR (fetch_int ());
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" lid :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" from_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" to_type :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" to_id :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" message :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field7) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" encr_media :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x34e0d674, .id = "DecryptedMessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_decrypted_message_media (field8) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" encr_action :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4e0eefde, .id = "DecryptedMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_decrypted_message_action (field9) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" file :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x886fd032, .id = "EncryptedFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_encrypted_file (field10) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ return 0;
+}
+int fetch_constructor_binlog_msg_update (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.msgUpdate");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" lid :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_long (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_binlog_reset_authorization (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.resetAuthorization");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_contacts_blocked (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8c1b8fb4 && T->type->name != 0x73e4704b)) { return -1; }
+ eprintf (" contacts.blocked");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" blocked :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x561bc879, .id = "ContactBlocked", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_contacts_blocked_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8c1b8fb4 && T->type->name != 0x73e4704b)) { return -1; }
+ eprintf (" contacts.blockedSlice");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" count :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" blocked :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x561bc879, .id = "ContactBlocked", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_contacts_contacts_not_modified (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd8c02560 && T->type->name != 0x273fda9f)) { return -1; }
+ eprintf (" contacts.contactsNotModified");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_contacts_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd8c02560 && T->type->name != 0x273fda9f)) { return -1; }
+ eprintf (" contacts.contacts");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" contacts :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf911c994, .id = "Contact", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_contacts_found (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0566000e && T->type->name != 0xfa99fff1)) { return -1; }
+ eprintf (" contacts.found");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" results :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xea879f95, .id = "ContactFound", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_contacts_imported_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xad524315 && T->type->name != 0x52adbcea)) { return -1; }
+ eprintf (" contacts.importedContacts");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" imported :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xd0028438, .id = "ImportedContact", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" retry_contacts :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_contacts_link (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3ace484c && T->type->name != 0xc531b7b3)) { return -1; }
+ eprintf (" contacts.link");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" my_link :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_contact_link (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" foreign_link :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_contact_link (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_user (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_contacts_suggested (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5649dcc5 && T->type->name != 0xa9b6233a)) { return -1; }
+ eprintf (" contacts.suggested");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" results :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3de191a1, .id = "ContactSuggested", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_geochats_located (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x48feb267 && T->type->name != 0xb7014d98)) { return -1; }
+ eprintf (" geochats.located");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" results :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3631cf4c, .id = "ChatLocated", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" messages :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chats :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_geochats_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6d0a0e59 && T->type->name != 0x92f5f1a6)) { return -1; }
+ eprintf (" geochats.messages");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" messages :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chats :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_geochats_messages_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6d0a0e59 && T->type->name != 0x92f5f1a6)) { return -1; }
+ eprintf (" geochats.messagesSlice");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" count :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" messages :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chats :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_geochats_stated_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17b1578b && T->type->name != 0xe84ea874)) { return -1; }
+ eprintf (" geochats.statedMessage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" message :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_geo_chat_message (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chats :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" seq :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_help_app_update (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4ddd9627 && T->type->name != 0xb22269d8)) { return -1; }
+ eprintf (" help.appUpdate");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" critical :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bool (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" url :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" text :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_help_no_app_update (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4ddd9627 && T->type->name != 0xb22269d8)) { return -1; }
+ eprintf (" help.noAppUpdate");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_help_invite_text (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x18cb9f78 && T->type->name != 0xe7346087)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int fetch_constructor_help_support (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17c6b5f6 && T->type->name != 0xe8394a09)) { return -1; }
+ eprintf (" help.support");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" phone_number :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_user (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_messages_affected_history (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb45c69d1 && T->type->name != 0x4ba3962e)) { return -1; }
+ eprintf (" messages.affectedHistory");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts_count :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" offset :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_messages_affected_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x84d19185 && T->type->name != 0x7b2e6e7a)) { return -1; }
+ eprintf (" messages.affectedMessages");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts_count :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_messages_all_stickers_not_modified (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb485502f && T->type->name != 0x4b7aafd0)) { return -1; }
+ eprintf (" messages.allStickersNotModified");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_messages_all_stickers (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb485502f && T->type->name != 0x4b7aafd0)) { return -1; }
+ eprintf (" messages.allStickers");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" hash :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" packs :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x12b299d4, .id = "StickerPack", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" sets :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa7a43b17, .id = "StickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" documents :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_messages_chat_full (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe5d7d19c && T->type->name != 0x1a282e63)) { return -1; }
+ eprintf (" messages.chatFull");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" full_chat :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02a614, .id = "ChatFull", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_chat_full (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chats :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_messages_chats (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x64ff9fd5 && T->type->name != 0x9b00602a)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int fetch_constructor_messages_dh_config_not_modified (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xecc058e8 && T->type->name != 0x133fa717)) { return -1; }
+ eprintf (" messages.dhConfigNotModified");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" random :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_messages_dh_config (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xecc058e8 && T->type->name != 0x133fa717)) { return -1; }
+ eprintf (" messages.dhConfig");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" g :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" p :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" version :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" random :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_messages_dialogs (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x645af8b3 && T->type->name != 0x9ba5074c)) { return -1; }
+ eprintf (" messages.dialogs");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dialogs :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc1dd804a, .id = "Dialog", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" messages :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chats :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_messages_dialogs_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x645af8b3 && T->type->name != 0x9ba5074c)) { return -1; }
+ eprintf (" messages.dialogsSlice");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" count :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dialogs :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc1dd804a, .id = "Dialog", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" messages :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chats :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_messages_message_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3f4e0648 && T->type->name != 0xc0b1f9b7)) { return -1; }
+ eprintf (" messages.messageEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_messages_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8735e464 && T->type->name != 0x78ca1b9b)) { return -1; }
+ eprintf (" messages.messages");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" messages :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chats :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_messages_messages_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8735e464 && T->type->name != 0x78ca1b9b)) { return -1; }
+ eprintf (" messages.messagesSlice");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" count :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" messages :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chats :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_messages_sent_encrypted_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc29c7607 && T->type->name != 0x3d6389f8)) { return -1; }
+ eprintf (" messages.sentEncryptedMessage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_messages_sent_encrypted_file (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc29c7607 && T->type->name != 0x3d6389f8)) { return -1; }
+ eprintf (" messages.sentEncryptedFile");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" file :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x886fd032, .id = "EncryptedFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_encrypted_file (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_messages_sent_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x799ce190 && T->type->name != 0x86631e6f)) { return -1; }
+ eprintf (" messages.sentMessage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" media :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_message_media (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts_count :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_messages_sent_message_link (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x799ce190 && T->type->name != 0x86631e6f)) { return -1; }
+ eprintf (" messages.sentMessageLink");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" media :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_message_media (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts_count :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" links :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3ace484c, .id = "contacts.Link", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" seq :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field7) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_messages_sticker_set (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb60a24a6 && T->type->name != 0x49f5db59)) { return -1; }
+ eprintf (" messages.stickerSet");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" set :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa7a43b17, .id = "StickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_sticker_set (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" packs :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x12b299d4, .id = "StickerPack", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" documents :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_messages_stickers_not_modified (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bfa5710 && T->type->name != 0x8405a8ef)) { return -1; }
+ eprintf (" messages.stickersNotModified");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_messages_stickers (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bfa5710 && T->type->name != 0x8405a8ef)) { return -1; }
+ eprintf (" messages.stickers");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" hash :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_string (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" stickers :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_photos_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x20212ca8 && T->type->name != 0xdfded357)) { return -1; }
+ eprintf (" photos.photo");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_photo (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_photos_photos (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x98cf75f1 && T->type->name != 0x67308a0e)) { return -1; }
+ eprintf (" photos.photos");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photos :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_photos_photos_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x98cf75f1 && T->type->name != 0x67308a0e)) { return -1; }
+ eprintf (" photos.photosSlice");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" count :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photos :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_storage_file_unknown (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ eprintf (" storage.fileUnknown");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_storage_file_jpeg (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ eprintf (" storage.fileJpeg");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_storage_file_gif (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ eprintf (" storage.fileGif");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_storage_file_png (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ eprintf (" storage.filePng");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_storage_file_pdf (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ eprintf (" storage.filePdf");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_storage_file_mp3 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ eprintf (" storage.fileMp3");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_storage_file_mov (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ eprintf (" storage.fileMov");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_storage_file_partial (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ eprintf (" storage.filePartial");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_storage_file_mp4 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ eprintf (" storage.fileMp4");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_storage_file_webp (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ eprintf (" storage.fileWebp");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_updates_difference_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf57a2419 && T->type->name != 0x0a85dbe6)) { return -1; }
+ eprintf (" updates.differenceEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" seq :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_updates_difference (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf57a2419 && T->type->name != 0x0a85dbe6)) { return -1; }
+ eprintf (" updates.difference");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_messages :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_encrypted_messages :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xce6b8a1e, .id = "EncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" other_updates :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chats :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" state :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa56c2a3e, .id = "updates.State", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_updates_state (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_updates_difference_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf57a2419 && T->type->name != 0x0a85dbe6)) { return -1; }
+ eprintf (" updates.differenceSlice");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_messages :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_encrypted_messages :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xce6b8a1e, .id = "EncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" other_updates :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chats :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (fetch_type_vector (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" intermediate_state :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa56c2a3e, .id = "updates.State", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_updates_state (field6) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_updates_state (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa56c2a3e && T->type->name != 0x5a93d5c1)) { return -1; }
+ eprintf (" updates.state");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" qts :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" seq :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field4) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" unread_count :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field5) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_constructor_upload_file (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x096a18d5 && T->type->name != 0xf695e72a)) { return -1; }
+ eprintf (" upload.file");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" type :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3e2838a8, .id = "storage.FileType", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_storage_file_type (field1) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mtime :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_int (field2) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" bytes :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (fetch_type_bare_bytes (field3) < 0) { return -1;}
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int fetch_type_account_days_t_t_l (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xb8d0afdf: res = fetch_constructor_account_days_t_t_l (T); break;
+ default: return -1;
+ }
+ return res;
+}
+int fetch_type_bare_account_days_t_t_l (struct paramed_type *T) {
+ if (fetch_constructor_account_days_t_t_l (T) >= 0) { return 0; }
+ return -1;
+}
+int fetch_type_audio (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x586988d8: res = fetch_constructor_audio_empty (T); break;
+ case 0xc7ac6496: res = fetch_constructor_audio (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_audio (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_audio_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_audio_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_audio (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_audio (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_authorization (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x7bf2e6f6: res = fetch_constructor_authorization (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_authorization (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_authorization (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_bool (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xbc799737: res = fetch_constructor_bool_false (T); break;
+ case 0x997275b5: res = fetch_constructor_bool_true (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_bool (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_bool_false (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_bool_false (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_bool_true (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_bool_true (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_bot_command (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xc27ac8c7: res = fetch_constructor_bot_command (T); break;
+ case 0xb79d22ab: res = fetch_constructor_bot_command_old (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_bot_command (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_bot_command (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_bot_command (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_bot_command_old (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_bot_command_old (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_bot_info (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xbb2e37ce: res = fetch_constructor_bot_info_empty (T); break;
+ case 0x09cf585d: res = fetch_constructor_bot_info (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_bot_info (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_bot_info_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_bot_info_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_bot_info (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_bot_info (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_bytes (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x0ee1379f: res = fetch_constructor_bytes (T); break;
+ default: return -1;
+ }
+ return res;
+}
+int fetch_type_bare_bytes (struct paramed_type *T) {
+ if (fetch_constructor_bytes (T) >= 0) { return 0; }
+ return -1;
+}
+int fetch_type_chat (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x9ba2d800: res = fetch_constructor_chat_empty (T); break;
+ case 0x6e9c9bc7: res = fetch_constructor_chat (T); break;
+ case 0xfb0ccc41: res = fetch_constructor_chat_forbidden (T); break;
+ case 0x75eaea5a: res = fetch_constructor_geo_chat (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_chat (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_chat_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_chat_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_chat (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_chat (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_chat_forbidden (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_chat_forbidden (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_geo_chat (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_geo_chat (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_chat_full (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x2e02a614: res = fetch_constructor_chat_full (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_chat_full (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_chat_full (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_chat_invite (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x5a686d7c: res = fetch_constructor_chat_invite_already (T); break;
+ case 0xce917dcd: res = fetch_constructor_chat_invite (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_chat_invite (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_chat_invite_already (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_chat_invite_already (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_chat_invite (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_chat_invite (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_chat_located (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x3631cf4c: res = fetch_constructor_chat_located (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_chat_located (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_chat_located (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_chat_participant (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xc8d7493e: res = fetch_constructor_chat_participant (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_chat_participant (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_chat_participant (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_chat_participants (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x0fd2bb8a: res = fetch_constructor_chat_participants_forbidden (T); break;
+ case 0x7841b415: res = fetch_constructor_chat_participants (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_chat_participants (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_chat_participants_forbidden (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_chat_participants_forbidden (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_chat_participants (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_chat_participants (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_chat_photo (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x37c1011c: res = fetch_constructor_chat_photo_empty (T); break;
+ case 0x6153276a: res = fetch_constructor_chat_photo (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_chat_photo (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_chat_photo_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_chat_photo_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_chat_photo (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_chat_photo (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_client_d_h_inner_data (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x6643b654: res = fetch_constructor_client_d_h_inner_data (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_client_d_h_inner_data (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_client_d_h_inner_data (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_config (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x4e32b894: res = fetch_constructor_config (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_config (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_config (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_contact (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xf911c994: res = fetch_constructor_contact (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_contact (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_contact (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_contact_blocked (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x561bc879: res = fetch_constructor_contact_blocked (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_contact_blocked (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_contact_blocked (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_contact_found (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xea879f95: res = fetch_constructor_contact_found (T); break;
+ default: return -1;
+ }
+ return res;
+}
+int fetch_type_bare_contact_found (struct paramed_type *T) {
+ if (fetch_constructor_contact_found (T) >= 0) { return 0; }
+ return -1;
+}
+int fetch_type_contact_link (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x5f4f9247: res = fetch_constructor_contact_link_unknown (T); break;
+ case 0xfeedd3ad: res = fetch_constructor_contact_link_none (T); break;
+ case 0x268f3f59: res = fetch_constructor_contact_link_has_phone (T); break;
+ case 0xd502c2d0: res = fetch_constructor_contact_link_contact (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_contact_link (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_contact_link_unknown (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_contact_link_unknown (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_contact_link_none (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_contact_link_none (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_contact_link_has_phone (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_contact_link_has_phone (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_contact_link_contact (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_contact_link_contact (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_contact_status (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xd3680c61: res = fetch_constructor_contact_status (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_contact_status (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_contact_status (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_contact_suggested (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x3de191a1: res = fetch_constructor_contact_suggested (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_contact_suggested (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_contact_suggested (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_dc_option (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x2ec2a43c: res = fetch_constructor_dc_option_l28 (T); break;
+ case 0x05d8c6cc: res = fetch_constructor_dc_option (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_dc_option (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_dc_option_l28 (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_dc_option_l28 (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_dc_option (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_dc_option (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_decrypted_message (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x204d3878: res = fetch_constructor_decrypted_message (T); break;
+ case 0x73164160: res = fetch_constructor_decrypted_message_service (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_decrypted_message (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_decrypted_message (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_decrypted_message (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_service (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_decrypted_message_service (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_decrypted_message_action (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xa1733aec: res = fetch_constructor_decrypted_message_action_set_message_t_t_l (T); break;
+ case 0x0c4f40be: res = fetch_constructor_decrypted_message_action_read_messages (T); break;
+ case 0x65614304: res = fetch_constructor_decrypted_message_action_delete_messages (T); break;
+ case 0x8ac1f475: res = fetch_constructor_decrypted_message_action_screenshot_messages (T); break;
+ case 0x6719e45c: res = fetch_constructor_decrypted_message_action_flush_history (T); break;
+ case 0x511110b0: res = fetch_constructor_decrypted_message_action_resend (T); break;
+ case 0xf3048883: res = fetch_constructor_decrypted_message_action_notify_layer (T); break;
+ case 0xccb27641: res = fetch_constructor_decrypted_message_action_typing (T); break;
+ case 0xf3c9611b: res = fetch_constructor_decrypted_message_action_request_key (T); break;
+ case 0x6fe1735b: res = fetch_constructor_decrypted_message_action_accept_key (T); break;
+ case 0xdd05ec6b: res = fetch_constructor_decrypted_message_action_abort_key (T); break;
+ case 0xec2e0b9b: res = fetch_constructor_decrypted_message_action_commit_key (T); break;
+ case 0xa82fdd63: res = fetch_constructor_decrypted_message_action_noop (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_decrypted_message_action (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_decrypted_message_action_set_message_t_t_l (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_decrypted_message_action_set_message_t_t_l (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_action_read_messages (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_decrypted_message_action_read_messages (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_action_delete_messages (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_decrypted_message_action_delete_messages (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_action_screenshot_messages (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_decrypted_message_action_screenshot_messages (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_action_flush_history (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_decrypted_message_action_flush_history (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_action_resend (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_decrypted_message_action_resend (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_action_notify_layer (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_decrypted_message_action_notify_layer (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_action_typing (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_decrypted_message_action_typing (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_action_request_key (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_decrypted_message_action_request_key (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_action_accept_key (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_decrypted_message_action_accept_key (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_action_abort_key (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_decrypted_message_action_abort_key (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_action_commit_key (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_decrypted_message_action_commit_key (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_action_noop (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_decrypted_message_action_noop (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_decrypted_message_layer (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x1be31789: res = fetch_constructor_decrypted_message_layer (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_decrypted_message_layer (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_decrypted_message_layer (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_decrypted_message_media (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x089f5c4a: res = fetch_constructor_decrypted_message_media_empty (T); break;
+ case 0x32798a8c: res = fetch_constructor_decrypted_message_media_photo (T); break;
+ case 0x35480a59: res = fetch_constructor_decrypted_message_media_geo_point (T); break;
+ case 0x588a0a97: res = fetch_constructor_decrypted_message_media_contact (T); break;
+ case 0xb095434b: res = fetch_constructor_decrypted_message_media_document (T); break;
+ case 0x524a415d: res = fetch_constructor_decrypted_message_media_video (T); break;
+ case 0x57e0a9cb: res = fetch_constructor_decrypted_message_media_audio (T); break;
+ case 0xfa95b0dd: res = fetch_constructor_decrypted_message_media_external_document (T); break;
+ case 0x4cee6ef3: res = fetch_constructor_decrypted_message_media_video_l12 (T); break;
+ case 0x6080758f: res = fetch_constructor_decrypted_message_media_audio_l12 (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_decrypted_message_media (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_decrypted_message_media_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_decrypted_message_media_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_media_photo (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_decrypted_message_media_photo (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_media_geo_point (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_decrypted_message_media_geo_point (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_media_contact (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_decrypted_message_media_contact (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_media_document (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_decrypted_message_media_document (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_media_video (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_decrypted_message_media_video (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_media_audio (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_decrypted_message_media_audio (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_media_external_document (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_decrypted_message_media_external_document (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_media_video_l12 (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_decrypted_message_media_video_l12 (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_media_audio_l12 (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_decrypted_message_media_audio_l12 (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_dialog (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xc1dd804a: res = fetch_constructor_dialog (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_dialog (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_dialog (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_disabled_feature (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xae636f24: res = fetch_constructor_disabled_feature (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_disabled_feature (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_disabled_feature (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_document (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x36f8c871: res = fetch_constructor_document_empty (T); break;
+ case 0xf9a39f4f: res = fetch_constructor_document (T); break;
+ case 0x9efc6326: res = fetch_constructor_document_l19 (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_document (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_document_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_document_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_document (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_document (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_document_l19 (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_document_l19 (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_document_attribute (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x6c37c15c: res = fetch_constructor_document_attribute_image_size (T); break;
+ case 0x11b58939: res = fetch_constructor_document_attribute_animated (T); break;
+ case 0x994c9882: res = fetch_constructor_document_attribute_sticker_l28 (T); break;
+ case 0x3a556302: res = fetch_constructor_document_attribute_sticker (T); break;
+ case 0x5910cccb: res = fetch_constructor_document_attribute_video (T); break;
+ case 0x051448e5: res = fetch_constructor_document_attribute_audio (T); break;
+ case 0x15590068: res = fetch_constructor_document_attribute_filename (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_document_attribute (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_document_attribute_image_size (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_document_attribute_image_size (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_document_attribute_animated (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_document_attribute_animated (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_document_attribute_sticker_l28 (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_document_attribute_sticker_l28 (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_document_attribute_sticker (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_document_attribute_sticker (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_document_attribute_video (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_document_attribute_video (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_document_attribute_audio (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_document_attribute_audio (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_document_attribute_filename (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_document_attribute_filename (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_double (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x2210c154: res = fetch_constructor_double (T); break;
+ default: return -1;
+ }
+ return res;
+}
+int fetch_type_bare_double (struct paramed_type *T) {
+ if (fetch_constructor_double (T) >= 0) { return 0; }
+ return -1;
+}
+int fetch_type_encrypted_chat (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xab7ec0a0: res = fetch_constructor_encrypted_chat_empty (T); break;
+ case 0x3bf703dc: res = fetch_constructor_encrypted_chat_waiting (T); break;
+ case 0xc878527e: res = fetch_constructor_encrypted_chat_requested (T); break;
+ case 0xfa56ce36: res = fetch_constructor_encrypted_chat (T); break;
+ case 0x13d6dd27: res = fetch_constructor_encrypted_chat_discarded (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_encrypted_chat (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_encrypted_chat_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_encrypted_chat_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_encrypted_chat_waiting (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_encrypted_chat_waiting (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_encrypted_chat_requested (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_encrypted_chat_requested (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_encrypted_chat (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_encrypted_chat (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_encrypted_chat_discarded (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_encrypted_chat_discarded (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_encrypted_file (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xc21f497e: res = fetch_constructor_encrypted_file_empty (T); break;
+ case 0x4a70994c: res = fetch_constructor_encrypted_file (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_encrypted_file (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_encrypted_file_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_encrypted_file_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_encrypted_file (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_encrypted_file (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_encrypted_message (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xed18c118: res = fetch_constructor_encrypted_message (T); break;
+ case 0x23734b06: res = fetch_constructor_encrypted_message_service (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_encrypted_message (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_encrypted_message (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_encrypted_message (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_encrypted_message_service (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_encrypted_message_service (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_error (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xc4b9f9bb: res = fetch_constructor_error (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_error (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_error (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_exported_chat_invite (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x69df3769: res = fetch_constructor_chat_invite_empty (T); break;
+ case 0xfc2e05bc: res = fetch_constructor_chat_invite_exported (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_exported_chat_invite (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_chat_invite_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_chat_invite_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_chat_invite_exported (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_chat_invite_exported (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_file_location (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x7c596b46: res = fetch_constructor_file_location_unavailable (T); break;
+ case 0x53d69076: res = fetch_constructor_file_location (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_file_location (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_file_location_unavailable (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_file_location_unavailable (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_file_location (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_file_location (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_geo_chat_message (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x60311a9b: res = fetch_constructor_geo_chat_message_empty (T); break;
+ case 0x4505f8e1: res = fetch_constructor_geo_chat_message (T); break;
+ case 0xd34fa24e: res = fetch_constructor_geo_chat_message_service (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_geo_chat_message (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_geo_chat_message_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_geo_chat_message_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_geo_chat_message (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_geo_chat_message (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_geo_chat_message_service (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_geo_chat_message_service (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_geo_point (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x1117dd5f: res = fetch_constructor_geo_point_empty (T); break;
+ case 0x2049d70c: res = fetch_constructor_geo_point (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_geo_point (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_geo_point_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_geo_point_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_geo_point (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_geo_point (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_imported_contact (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xd0028438: res = fetch_constructor_imported_contact (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_imported_contact (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_imported_contact (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_input_app_event (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x770656a8: res = fetch_constructor_input_app_event (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_input_app_event (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_input_app_event (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_input_audio (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xd95adc84: res = fetch_constructor_input_audio_empty (T); break;
+ case 0x77d440ff: res = fetch_constructor_input_audio (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_input_audio (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_input_audio_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_audio_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_audio (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_audio (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_input_chat_photo (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x1ca48f57: res = fetch_constructor_input_chat_photo_empty (T); break;
+ case 0x94254732: res = fetch_constructor_input_chat_uploaded_photo (T); break;
+ case 0xb2e1bf08: res = fetch_constructor_input_chat_photo (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_input_chat_photo (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_input_chat_photo_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_chat_photo_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_chat_uploaded_photo (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_chat_uploaded_photo (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_chat_photo (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_chat_photo (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_input_contact (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xf392b7f4: res = fetch_constructor_input_phone_contact (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_input_contact (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_input_phone_contact (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_input_document (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x72f0eaae: res = fetch_constructor_input_document_empty (T); break;
+ case 0x18798952: res = fetch_constructor_input_document (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_input_document (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_input_document_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_document_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_document (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_document (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_input_encrypted_chat (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xf141b5e1: res = fetch_constructor_input_encrypted_chat (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_input_encrypted_chat (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_input_encrypted_chat (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_input_encrypted_file (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x1837c364: res = fetch_constructor_input_encrypted_file_empty (T); break;
+ case 0x64bd0306: res = fetch_constructor_input_encrypted_file_uploaded (T); break;
+ case 0x5a17b5e5: res = fetch_constructor_input_encrypted_file (T); break;
+ case 0x2dc173c8: res = fetch_constructor_input_encrypted_file_big_uploaded (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_input_encrypted_file (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_input_encrypted_file_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_encrypted_file_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_encrypted_file_uploaded (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_encrypted_file_uploaded (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_encrypted_file (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_encrypted_file (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_encrypted_file_big_uploaded (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_encrypted_file_big_uploaded (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_input_file (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xf52ff27f: res = fetch_constructor_input_file (T); break;
+ case 0xfa4f0bb5: res = fetch_constructor_input_file_big (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_input_file (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_input_file (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_file (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_file_big (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_file_big (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_input_file_location (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x14637196: res = fetch_constructor_input_file_location (T); break;
+ case 0x3d0364ec: res = fetch_constructor_input_video_file_location (T); break;
+ case 0xf5235d55: res = fetch_constructor_input_encrypted_file_location (T); break;
+ case 0x74dc404d: res = fetch_constructor_input_audio_file_location (T); break;
+ case 0x4e45abe9: res = fetch_constructor_input_document_file_location (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_input_file_location (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_input_file_location (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_file_location (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_video_file_location (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_video_file_location (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_encrypted_file_location (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_encrypted_file_location (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_audio_file_location (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_audio_file_location (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_document_file_location (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_document_file_location (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_input_geo_chat (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x74d456fa: res = fetch_constructor_input_geo_chat (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_input_geo_chat (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_input_geo_chat (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_input_geo_point (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xe4c123d6: res = fetch_constructor_input_geo_point_empty (T); break;
+ case 0xf3b7acc9: res = fetch_constructor_input_geo_point (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_input_geo_point (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_input_geo_point_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_geo_point_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_geo_point (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_geo_point (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_input_media (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x9664f57f: res = fetch_constructor_input_media_empty (T); break;
+ case 0xf7aff1c0: res = fetch_constructor_input_media_uploaded_photo (T); break;
+ case 0xe9bfb4f3: res = fetch_constructor_input_media_photo (T); break;
+ case 0xf9c44144: res = fetch_constructor_input_media_geo_point (T); break;
+ case 0xa6e45987: res = fetch_constructor_input_media_contact (T); break;
+ case 0xe13fd4bc: res = fetch_constructor_input_media_uploaded_video (T); break;
+ case 0x96fb97dc: res = fetch_constructor_input_media_uploaded_thumb_video (T); break;
+ case 0x936a4ebd: res = fetch_constructor_input_media_video (T); break;
+ case 0x4e498cab: res = fetch_constructor_input_media_uploaded_audio (T); break;
+ case 0x89938781: res = fetch_constructor_input_media_audio (T); break;
+ case 0xffe76b78: res = fetch_constructor_input_media_uploaded_document (T); break;
+ case 0x41481486: res = fetch_constructor_input_media_uploaded_thumb_document (T); break;
+ case 0xd184e841: res = fetch_constructor_input_media_document (T); break;
+ case 0x2827a81a: res = fetch_constructor_input_media_venue (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_input_media (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_input_media_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_media_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_media_uploaded_photo (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_media_uploaded_photo (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_media_photo (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_media_photo (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_media_geo_point (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_media_geo_point (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_media_contact (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_media_contact (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_media_uploaded_video (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_media_uploaded_video (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_media_uploaded_thumb_video (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_media_uploaded_thumb_video (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_media_video (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_media_video (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_media_uploaded_audio (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_media_uploaded_audio (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_media_audio (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_media_audio (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_media_uploaded_document (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_media_uploaded_document (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_media_uploaded_thumb_document (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_media_uploaded_thumb_document (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_media_document (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_media_document (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_media_venue (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_media_venue (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_input_notify_peer (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xb8bc5b0c: res = fetch_constructor_input_notify_peer (T); break;
+ case 0x193b4417: res = fetch_constructor_input_notify_users (T); break;
+ case 0x4a95e84e: res = fetch_constructor_input_notify_chats (T); break;
+ case 0xa429b886: res = fetch_constructor_input_notify_all (T); break;
+ case 0x4d8ddec8: res = fetch_constructor_input_notify_geo_chat_peer (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_input_notify_peer (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_input_notify_peer (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_notify_peer (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_notify_users (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_notify_users (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_notify_chats (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_notify_chats (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_notify_all (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_notify_all (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_notify_geo_chat_peer (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_notify_geo_chat_peer (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_input_peer (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x7f3b18ea: res = fetch_constructor_input_peer_empty (T); break;
+ case 0x7da07ec9: res = fetch_constructor_input_peer_self (T); break;
+ case 0x1023dbe8: res = fetch_constructor_input_peer_contact (T); break;
+ case 0x9b447325: res = fetch_constructor_input_peer_foreign (T); break;
+ case 0x179be863: res = fetch_constructor_input_peer_chat (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_input_peer (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_input_peer_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_peer_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_peer_self (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_peer_self (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_peer_contact (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_peer_contact (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_peer_foreign (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_peer_foreign (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_peer_chat (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_peer_chat (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_input_peer_notify_events (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xf03064d8: res = fetch_constructor_input_peer_notify_events_empty (T); break;
+ case 0xe86a2c74: res = fetch_constructor_input_peer_notify_events_all (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_input_peer_notify_events (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_input_peer_notify_events_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_peer_notify_events_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_peer_notify_events_all (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_peer_notify_events_all (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_input_peer_notify_settings (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x46a2ce98: res = fetch_constructor_input_peer_notify_settings (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_input_peer_notify_settings (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_input_peer_notify_settings (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_input_photo (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x1cd7bf0d: res = fetch_constructor_input_photo_empty (T); break;
+ case 0xfb95c6c4: res = fetch_constructor_input_photo (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_input_photo (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_input_photo_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_photo_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_photo (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_photo (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_input_photo_crop (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xade6b004: res = fetch_constructor_input_photo_crop_auto (T); break;
+ case 0xd9915325: res = fetch_constructor_input_photo_crop (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_input_photo_crop (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_input_photo_crop_auto (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_photo_crop_auto (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_photo_crop (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_photo_crop (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_input_privacy_key (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x4f96cb18: res = fetch_constructor_input_privacy_key_status_timestamp (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_input_privacy_key (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_input_privacy_key_status_timestamp (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_input_privacy_rule (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x0d09e07b: res = fetch_constructor_input_privacy_value_allow_contacts (T); break;
+ case 0x184b35ce: res = fetch_constructor_input_privacy_value_allow_all (T); break;
+ case 0x131cc67f: res = fetch_constructor_input_privacy_value_allow_users (T); break;
+ case 0x0ba52007: res = fetch_constructor_input_privacy_value_disallow_contacts (T); break;
+ case 0xd66b66c9: res = fetch_constructor_input_privacy_value_disallow_all (T); break;
+ case 0x90110467: res = fetch_constructor_input_privacy_value_disallow_users (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_input_privacy_rule (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_input_privacy_value_allow_contacts (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_privacy_value_allow_contacts (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_privacy_value_allow_all (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_privacy_value_allow_all (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_privacy_value_allow_users (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_privacy_value_allow_users (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_privacy_value_disallow_contacts (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_privacy_value_disallow_contacts (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_privacy_value_disallow_all (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_privacy_value_disallow_all (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_privacy_value_disallow_users (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_privacy_value_disallow_users (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_input_sticker_set (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xffb62b95: res = fetch_constructor_input_sticker_set_empty (T); break;
+ case 0x9de7a269: res = fetch_constructor_input_sticker_set_i_d (T); break;
+ case 0x861cc8a0: res = fetch_constructor_input_sticker_set_short_name (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_input_sticker_set (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_input_sticker_set_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_sticker_set_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_sticker_set_i_d (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_sticker_set_i_d (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_sticker_set_short_name (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_sticker_set_short_name (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_input_user (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xb98886cf: res = fetch_constructor_input_user_empty (T); break;
+ case 0xf7c1b13f: res = fetch_constructor_input_user_self (T); break;
+ case 0x86e94f65: res = fetch_constructor_input_user_contact (T); break;
+ case 0x655e74ff: res = fetch_constructor_input_user_foreign (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_input_user (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_input_user_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_user_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_user_self (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_user_self (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_user_contact (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_user_contact (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_user_foreign (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_user_foreign (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_input_video (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x5508ec75: res = fetch_constructor_input_video_empty (T); break;
+ case 0xee579652: res = fetch_constructor_input_video (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_input_video (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_input_video_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_video_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_video (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_video (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_int (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xa8509bda: res = fetch_constructor_int (T); break;
+ default: return -1;
+ }
+ return res;
+}
+int fetch_type_bare_int (struct paramed_type *T) {
+ if (fetch_constructor_int (T) >= 0) { return 0; }
+ return -1;
+}
+int fetch_type_int128 (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x7d36c439: res = fetch_constructor_int128 (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_int128 (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_int128 (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_int256 (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xf2c798b3: res = fetch_constructor_int256 (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_int256 (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_int256 (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_keyboard_button (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xa2fa4880: res = fetch_constructor_keyboard_button (T); break;
+ default: return -1;
+ }
+ return res;
+}
+int fetch_type_bare_keyboard_button (struct paramed_type *T) {
+ if (fetch_constructor_keyboard_button (T) >= 0) { return 0; }
+ return -1;
+}
+int fetch_type_keyboard_button_row (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x77608b83: res = fetch_constructor_keyboard_button_row (T); break;
+ default: return -1;
+ }
+ return res;
+}
+int fetch_type_bare_keyboard_button_row (struct paramed_type *T) {
+ if (fetch_constructor_keyboard_button_row (T) >= 0) { return 0; }
+ return -1;
+}
+int fetch_type_long (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x22076cba: res = fetch_constructor_long (T); break;
+ default: return -1;
+ }
+ return res;
+}
+int fetch_type_bare_long (struct paramed_type *T) {
+ if (fetch_constructor_long (T) >= 0) { return 0; }
+ return -1;
+}
+int fetch_type_message (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x83e5de54: res = fetch_constructor_message_empty (T); break;
+ case 0xc3060325: res = fetch_constructor_message (T); break;
+ case 0x1d86f70e: res = fetch_constructor_message_service (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_message (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_message_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_message_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_message (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_service (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_message_service (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_message_action (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xb6aef7b0: res = fetch_constructor_message_action_empty (T); break;
+ case 0xa6638b9a: res = fetch_constructor_message_action_chat_create (T); break;
+ case 0xb5a1ce5a: res = fetch_constructor_message_action_chat_edit_title (T); break;
+ case 0x7fcb13a8: res = fetch_constructor_message_action_chat_edit_photo (T); break;
+ case 0x95e3fbef: res = fetch_constructor_message_action_chat_delete_photo (T); break;
+ case 0x5e3cfc4b: res = fetch_constructor_message_action_chat_add_user (T); break;
+ case 0xb2ae9b0c: res = fetch_constructor_message_action_chat_delete_user (T); break;
+ case 0x6f038ebc: res = fetch_constructor_message_action_geo_chat_create (T); break;
+ case 0x0c7d53de: res = fetch_constructor_message_action_geo_chat_checkin (T); break;
+ case 0xf89cf5e8: res = fetch_constructor_message_action_chat_joined_by_link (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_message_action (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_message_action_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_message_action_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_action_chat_create (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_message_action_chat_create (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_action_chat_edit_title (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_message_action_chat_edit_title (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_action_chat_edit_photo (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_message_action_chat_edit_photo (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_action_chat_delete_photo (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_message_action_chat_delete_photo (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_action_chat_add_user (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_message_action_chat_add_user (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_action_chat_delete_user (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_message_action_chat_delete_user (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_action_geo_chat_create (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_message_action_geo_chat_create (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_action_geo_chat_checkin (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_message_action_geo_chat_checkin (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_action_chat_joined_by_link (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_message_action_chat_joined_by_link (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_message_media (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x3ded6320: res = fetch_constructor_message_media_empty (T); break;
+ case 0x3d8ce53d: res = fetch_constructor_message_media_photo (T); break;
+ case 0x5bcf1675: res = fetch_constructor_message_media_video (T); break;
+ case 0x56e0d474: res = fetch_constructor_message_media_geo (T); break;
+ case 0x5e7d2f39: res = fetch_constructor_message_media_contact (T); break;
+ case 0x9f84f49e: res = fetch_constructor_message_media_unsupported (T); break;
+ case 0x2fda2204: res = fetch_constructor_message_media_document (T); break;
+ case 0xc6b68300: res = fetch_constructor_message_media_audio (T); break;
+ case 0xa32dd600: res = fetch_constructor_message_media_web_page (T); break;
+ case 0x7912b71f: res = fetch_constructor_message_media_venue (T); break;
+ case 0xc8c45a2a: res = fetch_constructor_message_media_photo_l27 (T); break;
+ case 0xa2d24290: res = fetch_constructor_message_media_video_l27 (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_message_media (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_message_media_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_message_media_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_media_photo (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_message_media_photo (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_media_video (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_message_media_video (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_media_geo (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_message_media_geo (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_media_contact (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_message_media_contact (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_media_unsupported (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_message_media_unsupported (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_media_document (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_message_media_document (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_media_audio (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_message_media_audio (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_media_web_page (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_message_media_web_page (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_media_venue (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_message_media_venue (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_media_photo_l27 (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_message_media_photo_l27 (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_media_video_l27 (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_message_media_video_l27 (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_messages_filter (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x57e2f66c: res = fetch_constructor_input_messages_filter_empty (T); break;
+ case 0x9609a51c: res = fetch_constructor_input_messages_filter_photos (T); break;
+ case 0x9fc00e65: res = fetch_constructor_input_messages_filter_video (T); break;
+ case 0x56e9f0e4: res = fetch_constructor_input_messages_filter_photo_video (T); break;
+ case 0xd95e73bb: res = fetch_constructor_input_messages_filter_photo_video_documents (T); break;
+ case 0x9eddf188: res = fetch_constructor_input_messages_filter_document (T); break;
+ case 0xcfc87522: res = fetch_constructor_input_messages_filter_audio (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_messages_filter (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_input_messages_filter_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_messages_filter_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_messages_filter_photos (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_messages_filter_photos (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_messages_filter_video (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_messages_filter_video (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_messages_filter_photo_video (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_messages_filter_photo_video (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_messages_filter_photo_video_documents (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_messages_filter_photo_video_documents (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_messages_filter_document (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_messages_filter_document (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_messages_filter_audio (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_input_messages_filter_audio (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_nearest_dc (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x8e1a1775: res = fetch_constructor_nearest_dc (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_nearest_dc (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_nearest_dc (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_notify_peer (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x9fd40bd8: res = fetch_constructor_notify_peer (T); break;
+ case 0xb4c83b4c: res = fetch_constructor_notify_users (T); break;
+ case 0xc007cec3: res = fetch_constructor_notify_chats (T); break;
+ case 0x74d07c60: res = fetch_constructor_notify_all (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_notify_peer (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_notify_peer (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_notify_peer (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_notify_users (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_notify_users (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_notify_chats (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_notify_chats (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_notify_all (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_notify_all (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_null (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x56730bcc: res = fetch_constructor_null (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_null (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_null (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_p_q_inner_data (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x83c95aec: res = fetch_constructor_p_q_inner_data (T); break;
+ case 0x3c6a84d4: res = fetch_constructor_p_q_inner_data_temp (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_p_q_inner_data (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_p_q_inner_data (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_p_q_inner_data (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_p_q_inner_data_temp (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_p_q_inner_data_temp (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_peer (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x9db1bc6d: res = fetch_constructor_peer_user (T); break;
+ case 0xbad0e5bb: res = fetch_constructor_peer_chat (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_peer (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_peer_user (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_peer_user (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_peer_chat (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_peer_chat (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_peer_notify_events (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xadd53cb3: res = fetch_constructor_peer_notify_events_empty (T); break;
+ case 0x6d1ded88: res = fetch_constructor_peer_notify_events_all (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_peer_notify_events (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_peer_notify_events_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_peer_notify_events_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_peer_notify_events_all (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_peer_notify_events_all (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_peer_notify_settings (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x70a68512: res = fetch_constructor_peer_notify_settings_empty (T); break;
+ case 0x8d5e11ee: res = fetch_constructor_peer_notify_settings (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_peer_notify_settings (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_peer_notify_settings_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_peer_notify_settings_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_peer_notify_settings (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_peer_notify_settings (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_photo (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x2331b22d: res = fetch_constructor_photo_empty (T); break;
+ case 0xc3838076: res = fetch_constructor_photo (T); break;
+ case 0x22b56751: res = fetch_constructor_photo_l27 (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_photo (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_photo_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_photo_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_photo (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_photo (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_photo_l27 (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_photo_l27 (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_photo_size (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x0e17e23c: res = fetch_constructor_photo_size_empty (T); break;
+ case 0x77bfb61b: res = fetch_constructor_photo_size (T); break;
+ case 0xe9a734fa: res = fetch_constructor_photo_cached_size (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_photo_size (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_photo_size_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_photo_size_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_photo_size (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_photo_size (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_photo_cached_size (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_photo_cached_size (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_privacy_key (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xbc2eab30: res = fetch_constructor_privacy_key_status_timestamp (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_privacy_key (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_privacy_key_status_timestamp (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_privacy_rule (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xfffe1bac: res = fetch_constructor_privacy_value_allow_contacts (T); break;
+ case 0x65427b82: res = fetch_constructor_privacy_value_allow_all (T); break;
+ case 0x4d5bbe0c: res = fetch_constructor_privacy_value_allow_users (T); break;
+ case 0xf888fa1a: res = fetch_constructor_privacy_value_disallow_contacts (T); break;
+ case 0x8b73e763: res = fetch_constructor_privacy_value_disallow_all (T); break;
+ case 0x0c7f49b7: res = fetch_constructor_privacy_value_disallow_users (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_privacy_rule (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_privacy_value_allow_contacts (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_privacy_value_allow_contacts (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_privacy_value_allow_all (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_privacy_value_allow_all (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_privacy_value_allow_users (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_privacy_value_allow_users (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_privacy_value_disallow_contacts (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_privacy_value_disallow_contacts (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_privacy_value_disallow_all (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_privacy_value_disallow_all (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_privacy_value_disallow_users (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_privacy_value_disallow_users (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_received_notify_message (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xa384b779: res = fetch_constructor_received_notify_message (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_received_notify_message (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_received_notify_message (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_reply_markup (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xa03e5b85: res = fetch_constructor_reply_keyboard_hide (T); break;
+ case 0xf4108aa0: res = fetch_constructor_reply_keyboard_force_reply (T); break;
+ case 0x3502758c: res = fetch_constructor_reply_keyboard_markup (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_reply_markup (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_reply_keyboard_hide (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_reply_keyboard_hide (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_reply_keyboard_force_reply (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_reply_keyboard_force_reply (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_reply_keyboard_markup (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_reply_keyboard_markup (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_res_p_q (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x05162463: res = fetch_constructor_res_p_q (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_res_p_q (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_res_p_q (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_send_message_action (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x16bf744e: res = fetch_constructor_send_message_typing_action (T); break;
+ case 0xfd5ec8f5: res = fetch_constructor_send_message_cancel_action (T); break;
+ case 0xa187d66f: res = fetch_constructor_send_message_record_video_action (T); break;
+ case 0x92042ff7: res = fetch_constructor_send_message_upload_video_action_l27 (T); break;
+ case 0xe9763aec: res = fetch_constructor_send_message_upload_video_action (T); break;
+ case 0xd52f73f7: res = fetch_constructor_send_message_record_audio_action (T); break;
+ case 0xe6ac8a6f: res = fetch_constructor_send_message_upload_audio_action_l27 (T); break;
+ case 0xf351d7ab: res = fetch_constructor_send_message_upload_audio_action (T); break;
+ case 0xd1d34a26: res = fetch_constructor_send_message_upload_photo_action (T); break;
+ case 0x8faee98e: res = fetch_constructor_send_message_upload_document_action_l27 (T); break;
+ case 0xaa0cd9e4: res = fetch_constructor_send_message_upload_document_action (T); break;
+ case 0x176f8ba1: res = fetch_constructor_send_message_geo_location_action (T); break;
+ case 0x628cbc6f: res = fetch_constructor_send_message_choose_contact_action (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_send_message_action (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_send_message_typing_action (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_send_message_typing_action (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_send_message_cancel_action (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_send_message_cancel_action (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_send_message_record_video_action (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_send_message_record_video_action (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_send_message_upload_video_action_l27 (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_send_message_upload_video_action_l27 (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_send_message_upload_video_action (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_send_message_upload_video_action (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_send_message_record_audio_action (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_send_message_record_audio_action (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_send_message_upload_audio_action_l27 (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_send_message_upload_audio_action_l27 (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_send_message_upload_audio_action (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_send_message_upload_audio_action (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_send_message_upload_photo_action (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_send_message_upload_photo_action (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_send_message_upload_document_action_l27 (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_send_message_upload_document_action_l27 (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_send_message_upload_document_action (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_send_message_upload_document_action (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_send_message_geo_location_action (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_send_message_geo_location_action (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_send_message_choose_contact_action (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_send_message_choose_contact_action (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_server_d_h_params (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x79cb045d: res = fetch_constructor_server_d_h_params_fail (T); break;
+ case 0xd0e8075c: res = fetch_constructor_server_d_h_params_ok (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_server_d_h_params (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_server_d_h_params_fail (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_server_d_h_params_fail (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_server_d_h_params_ok (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_server_d_h_params_ok (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_server_d_h_inner_data (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xb5890dba: res = fetch_constructor_server_d_h_inner_data (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_server_d_h_inner_data (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_server_d_h_inner_data (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_set_client_d_h_params_answer (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x3bcbf734: res = fetch_constructor_dh_gen_ok (T); break;
+ case 0x46dc1fb9: res = fetch_constructor_dh_gen_retry (T); break;
+ case 0xa69dae02: res = fetch_constructor_dh_gen_fail (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_set_client_d_h_params_answer (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_dh_gen_ok (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_dh_gen_ok (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_dh_gen_retry (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_dh_gen_retry (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_dh_gen_fail (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_dh_gen_fail (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_sticker_pack (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x12b299d4: res = fetch_constructor_sticker_pack (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_sticker_pack (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_sticker_pack (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_sticker_set (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xa7a43b17: res = fetch_constructor_sticker_set (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_sticker_set (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_sticker_set (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_string (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xb5286e24: res = fetch_constructor_string (T); break;
+ default: return -1;
+ }
+ return res;
+}
+int fetch_type_bare_string (struct paramed_type *T) {
+ if (fetch_constructor_string (T) >= 0) { return 0; }
+ return -1;
+}
+int fetch_type_update (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x1f2b0afd: res = fetch_constructor_update_new_message (T); break;
+ case 0x4e90bfd6: res = fetch_constructor_update_message_i_d (T); break;
+ case 0xa20db0e5: res = fetch_constructor_update_delete_messages (T); break;
+ case 0x5c486927: res = fetch_constructor_update_user_typing (T); break;
+ case 0x9a65ea1f: res = fetch_constructor_update_chat_user_typing (T); break;
+ case 0x07761198: res = fetch_constructor_update_chat_participants (T); break;
+ case 0x1bfbd823: res = fetch_constructor_update_user_status (T); break;
+ case 0xa7332b73: res = fetch_constructor_update_user_name (T); break;
+ case 0x95313b0c: res = fetch_constructor_update_user_photo (T); break;
+ case 0x2575bbb9: res = fetch_constructor_update_contact_registered (T); break;
+ case 0x9d2e67c5: res = fetch_constructor_update_contact_link (T); break;
+ case 0x8f06529a: res = fetch_constructor_update_new_authorization (T); break;
+ case 0x5a68e3f7: res = fetch_constructor_update_new_geo_chat_message (T); break;
+ case 0x12bcbd9a: res = fetch_constructor_update_new_encrypted_message (T); break;
+ case 0x1710f156: res = fetch_constructor_update_encrypted_chat_typing (T); break;
+ case 0xb4a2e88d: res = fetch_constructor_update_encryption (T); break;
+ case 0x38fe25b7: res = fetch_constructor_update_encrypted_messages_read (T); break;
+ case 0x3a0eeb22: res = fetch_constructor_update_chat_participant_add (T); break;
+ case 0x6e5f8c22: res = fetch_constructor_update_chat_participant_delete (T); break;
+ case 0x8e5e9873: res = fetch_constructor_update_dc_options (T); break;
+ case 0x80ece81a: res = fetch_constructor_update_user_blocked (T); break;
+ case 0xbec268ef: res = fetch_constructor_update_notify_settings (T); break;
+ case 0x382dd3e4: res = fetch_constructor_update_service_notification (T); break;
+ case 0xee3b272a: res = fetch_constructor_update_privacy (T); break;
+ case 0x12b9417b: res = fetch_constructor_update_user_phone (T); break;
+ case 0x9961fd5c: res = fetch_constructor_update_read_history_inbox (T); break;
+ case 0x2f2f21bf: res = fetch_constructor_update_read_history_outbox (T); break;
+ case 0x2cc36971: res = fetch_constructor_update_web_page (T); break;
+ case 0x68c13933: res = fetch_constructor_update_read_messages_contents (T); break;
+ case 0x03114739: res = fetch_constructor_update_msg_update (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_update (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_update_new_message (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_new_message (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_message_i_d (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_message_i_d (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_delete_messages (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_delete_messages (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_user_typing (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_user_typing (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_chat_user_typing (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_chat_user_typing (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_chat_participants (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_chat_participants (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_user_status (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_user_status (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_user_name (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_user_name (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_user_photo (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_user_photo (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_contact_registered (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_contact_registered (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_contact_link (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_contact_link (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_new_authorization (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_new_authorization (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_new_geo_chat_message (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_new_geo_chat_message (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_new_encrypted_message (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_new_encrypted_message (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_encrypted_chat_typing (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_encrypted_chat_typing (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_encryption (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_encryption (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_encrypted_messages_read (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_encrypted_messages_read (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_chat_participant_add (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_chat_participant_add (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_chat_participant_delete (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_chat_participant_delete (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_dc_options (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_dc_options (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_user_blocked (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_user_blocked (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_notify_settings (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_notify_settings (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_service_notification (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_service_notification (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_privacy (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_privacy (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_user_phone (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_user_phone (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_read_history_inbox (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_read_history_inbox (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_read_history_outbox (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_read_history_outbox (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_web_page (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_web_page (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_read_messages_contents (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_read_messages_contents (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_msg_update (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_msg_update (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_updates (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xe317af7e: res = fetch_constructor_updates_too_long (T); break;
+ case 0xed5c2127: res = fetch_constructor_update_short_message (T); break;
+ case 0x52238b3c: res = fetch_constructor_update_short_chat_message (T); break;
+ case 0x78d4dec1: res = fetch_constructor_update_short (T); break;
+ case 0x725b04c3: res = fetch_constructor_updates_combined (T); break;
+ case 0x74ae4240: res = fetch_constructor_updates (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_updates (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_updates_too_long (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_updates_too_long (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_short_message (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_short_message (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_short_chat_message (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_short_chat_message (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_short (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_update_short (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_updates_combined (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_updates_combined (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_updates (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_updates (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_user (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x200250ba: res = fetch_constructor_user_empty (T); break;
+ case 0x22e49072: res = fetch_constructor_user (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_user (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_user_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_user_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_user (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_user (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_user_full (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x5a89ac5b: res = fetch_constructor_user_full (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_user_full (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_user_full (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_user_profile_photo (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x4f11bae1: res = fetch_constructor_user_profile_photo_empty (T); break;
+ case 0xd559d8c8: res = fetch_constructor_user_profile_photo (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_user_profile_photo (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_user_profile_photo_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_user_profile_photo_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_user_profile_photo (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_user_profile_photo (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_user_status (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x09d05049: res = fetch_constructor_user_status_empty (T); break;
+ case 0xedb93949: res = fetch_constructor_user_status_online (T); break;
+ case 0x008c703f: res = fetch_constructor_user_status_offline (T); break;
+ case 0xe26f42f1: res = fetch_constructor_user_status_recently (T); break;
+ case 0x07bf09fc: res = fetch_constructor_user_status_last_week (T); break;
+ case 0x77ebc742: res = fetch_constructor_user_status_last_month (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_user_status (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_user_status_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_user_status_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_user_status_online (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_user_status_online (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_user_status_offline (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_user_status_offline (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_user_status_recently (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_user_status_recently (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_user_status_last_week (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_user_status_last_week (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_user_status_last_month (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_user_status_last_month (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_vector (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x1cb5c415: res = fetch_constructor_vector (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_vector (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_vector (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_video (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xc10658a8: res = fetch_constructor_video_empty (T); break;
+ case 0xee9f4a4d: res = fetch_constructor_video (T); break;
+ case 0x388fa391: res = fetch_constructor_video_l27 (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_video (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_video_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_video_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_video (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_video (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_video_l27 (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_video_l27 (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_wall_paper (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xccb03657: res = fetch_constructor_wall_paper (T); break;
+ case 0x63117f24: res = fetch_constructor_wall_paper_solid (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_wall_paper (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_wall_paper (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_wall_paper (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_wall_paper_solid (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_wall_paper_solid (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_web_page (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xeb1477e8: res = fetch_constructor_web_page_empty (T); break;
+ case 0xc586da1c: res = fetch_constructor_web_page_pending (T); break;
+ case 0xa31ea0b5: res = fetch_constructor_web_page (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_web_page (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_web_page_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_web_page_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_web_page_pending (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_web_page_pending (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_web_page (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_web_page (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_account_authorizations (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x1250abde: res = fetch_constructor_account_authorizations (T); break;
+ default: return -1;
+ }
+ return res;
+}
+int fetch_type_bare_account_authorizations (struct paramed_type *T) {
+ if (fetch_constructor_account_authorizations (T) >= 0) { return 0; }
+ return -1;
+}
+int fetch_type_account_password (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x96dabc18: res = fetch_constructor_account_no_password (T); break;
+ case 0x7c18141c: res = fetch_constructor_account_password (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_account_password (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_account_no_password (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_account_no_password (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_account_password (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_account_password (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_account_password_input_settings (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xbcfc532c: res = fetch_constructor_account_password_input_settings (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_account_password_input_settings (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_account_password_input_settings (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_account_password_settings (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xb7b72ab3: res = fetch_constructor_account_password_settings (T); break;
+ default: return -1;
+ }
+ return res;
+}
+int fetch_type_bare_account_password_settings (struct paramed_type *T) {
+ if (fetch_constructor_account_password_settings (T) >= 0) { return 0; }
+ return -1;
+}
+int fetch_type_account_privacy_rules (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x554abb6f: res = fetch_constructor_account_privacy_rules (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_account_privacy_rules (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_account_privacy_rules (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_account_sent_change_phone_code (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xa4f58c4c: res = fetch_constructor_account_sent_change_phone_code (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_account_sent_change_phone_code (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_account_sent_change_phone_code (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_auth_authorization (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xff036af1: res = fetch_constructor_auth_authorization (T); break;
+ default: return -1;
+ }
+ return res;
+}
+int fetch_type_bare_auth_authorization (struct paramed_type *T) {
+ if (fetch_constructor_auth_authorization (T) >= 0) { return 0; }
+ return -1;
+}
+int fetch_type_auth_checked_phone (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x811ea28e: res = fetch_constructor_auth_checked_phone (T); break;
+ default: return -1;
+ }
+ return res;
+}
+int fetch_type_bare_auth_checked_phone (struct paramed_type *T) {
+ if (fetch_constructor_auth_checked_phone (T) >= 0) { return 0; }
+ return -1;
+}
+int fetch_type_auth_exported_authorization (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xdf969c2d: res = fetch_constructor_auth_exported_authorization (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_auth_exported_authorization (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_auth_exported_authorization (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_auth_password_recovery (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x137948a5: res = fetch_constructor_auth_password_recovery (T); break;
+ default: return -1;
+ }
+ return res;
+}
+int fetch_type_bare_auth_password_recovery (struct paramed_type *T) {
+ if (fetch_constructor_auth_password_recovery (T) >= 0) { return 0; }
+ return -1;
+}
+int fetch_type_auth_sent_code (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xefed51d9: res = fetch_constructor_auth_sent_code (T); break;
+ case 0xe325edcf: res = fetch_constructor_auth_sent_app_code (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_auth_sent_code (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_auth_sent_code (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_auth_sent_code (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_auth_sent_app_code (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_auth_sent_app_code (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_binlog_encr_key (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x0377168f: res = fetch_constructor_binlog_encr_key (T); break;
+ default: return -1;
+ }
+ return res;
+}
+int fetch_type_bare_binlog_encr_key (struct paramed_type *T) {
+ if (fetch_constructor_binlog_encr_key (T) >= 0) { return 0; }
+ return -1;
+}
+int fetch_type_binlog_update (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x3b06de69: res = fetch_constructor_binlog_start (T); break;
+ case 0xf96feb32: res = fetch_constructor_binlog_dc_option (T); break;
+ case 0x7c0d22d8: res = fetch_constructor_binlog_dc_option_new (T); break;
+ case 0x71e8c156: res = fetch_constructor_binlog_auth_key (T); break;
+ case 0x9e83dbdc: res = fetch_constructor_binlog_default_dc (T); break;
+ case 0x26451bb5: res = fetch_constructor_binlog_dc_signed (T); break;
+ case 0x68a870e8: res = fetch_constructor_binlog_our_id (T); break;
+ case 0xeaeb7826: res = fetch_constructor_binlog_set_dh_params (T); break;
+ case 0x2ca8c939: res = fetch_constructor_binlog_set_pts (T); break;
+ case 0xd95738ac: res = fetch_constructor_binlog_set_qts (T); break;
+ case 0x1d0f4b52: res = fetch_constructor_binlog_set_date (T); break;
+ case 0x6eeb2989: res = fetch_constructor_binlog_set_seq (T); break;
+ case 0xee1b38e8: res = fetch_constructor_binlog_encr_chat_delete (T); break;
+ case 0x84977251: res = fetch_constructor_binlog_encr_chat_new (T); break;
+ case 0x9d49488d: res = fetch_constructor_binlog_encr_chat_exchange_new (T); break;
+ case 0xac55d447: res = fetch_constructor_binlog_user_delete (T); break;
+ case 0x127cf2f9: res = fetch_constructor_binlog_user_new (T); break;
+ case 0x0a10aa92: res = fetch_constructor_binlog_chat_new (T); break;
+ case 0x535475ea: res = fetch_constructor_binlog_chat_add_participant (T); break;
+ case 0x7dd1a1a2: res = fetch_constructor_binlog_chat_del_participant (T); break;
+ case 0x3c873416: res = fetch_constructor_binlog_set_msg_id (T); break;
+ case 0x847e77b1: res = fetch_constructor_binlog_message_delete (T); break;
+ case 0x427cfcdb: res = fetch_constructor_binlog_message_new (T); break;
+ case 0x6cf7cabc: res = fetch_constructor_binlog_message_encr_new (T); break;
+ case 0x6dd4d85f: res = fetch_constructor_binlog_msg_update (T); break;
+ case 0x83327955: res = fetch_constructor_binlog_reset_authorization (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_binlog_update (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_binlog_start (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_binlog_start (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_dc_option (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_binlog_dc_option (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_dc_option_new (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_binlog_dc_option_new (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_auth_key (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_binlog_auth_key (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_default_dc (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_binlog_default_dc (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_dc_signed (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_binlog_dc_signed (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_our_id (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_binlog_our_id (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_set_dh_params (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_binlog_set_dh_params (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_set_pts (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_binlog_set_pts (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_set_qts (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_binlog_set_qts (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_set_date (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_binlog_set_date (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_set_seq (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_binlog_set_seq (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_encr_chat_delete (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_binlog_encr_chat_delete (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_encr_chat_new (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_binlog_encr_chat_new (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_encr_chat_exchange_new (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_binlog_encr_chat_exchange_new (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_user_delete (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_binlog_user_delete (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_user_new (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_binlog_user_new (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_chat_new (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_binlog_chat_new (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_chat_add_participant (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_binlog_chat_add_participant (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_chat_del_participant (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_binlog_chat_del_participant (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_set_msg_id (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_binlog_set_msg_id (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_message_delete (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_binlog_message_delete (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_message_new (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_binlog_message_new (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_message_encr_new (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_binlog_message_encr_new (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_msg_update (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_binlog_msg_update (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_reset_authorization (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_binlog_reset_authorization (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_contacts_blocked (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x1c138d15: res = fetch_constructor_contacts_blocked (T); break;
+ case 0x900802a1: res = fetch_constructor_contacts_blocked_slice (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_contacts_blocked (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_contacts_blocked (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_contacts_blocked (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_contacts_blocked_slice (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_contacts_blocked_slice (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_contacts_contacts (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xb74ba9d2: res = fetch_constructor_contacts_contacts_not_modified (T); break;
+ case 0x6f8b8cb2: res = fetch_constructor_contacts_contacts (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_contacts_contacts (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_contacts_contacts_not_modified (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_contacts_contacts_not_modified (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_contacts_contacts (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_contacts_contacts (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_contacts_found (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x0566000e: res = fetch_constructor_contacts_found (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_contacts_found (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_contacts_found (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_contacts_imported_contacts (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xad524315: res = fetch_constructor_contacts_imported_contacts (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_contacts_imported_contacts (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_contacts_imported_contacts (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_contacts_link (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x3ace484c: res = fetch_constructor_contacts_link (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_contacts_link (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_contacts_link (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_contacts_suggested (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x5649dcc5: res = fetch_constructor_contacts_suggested (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_contacts_suggested (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_contacts_suggested (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_geochats_located (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x48feb267: res = fetch_constructor_geochats_located (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_geochats_located (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_geochats_located (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_geochats_messages (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xd1526db1: res = fetch_constructor_geochats_messages (T); break;
+ case 0xbc5863e8: res = fetch_constructor_geochats_messages_slice (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_geochats_messages (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_geochats_messages (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_geochats_messages (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_geochats_messages_slice (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_geochats_messages_slice (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_geochats_stated_message (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x17b1578b: res = fetch_constructor_geochats_stated_message (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_geochats_stated_message (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_geochats_stated_message (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_help_app_update (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x8987f311: res = fetch_constructor_help_app_update (T); break;
+ case 0xc45a6536: res = fetch_constructor_help_no_app_update (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_help_app_update (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_help_app_update (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_help_app_update (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_help_no_app_update (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_help_no_app_update (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_help_invite_text (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x18cb9f78: res = fetch_constructor_help_invite_text (T); break;
+ default: return -1;
+ }
+ return res;
+}
+int fetch_type_bare_help_invite_text (struct paramed_type *T) {
+ if (fetch_constructor_help_invite_text (T) >= 0) { return 0; }
+ return -1;
+}
+int fetch_type_help_support (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x17c6b5f6: res = fetch_constructor_help_support (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_help_support (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_help_support (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_messages_affected_history (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xb45c69d1: res = fetch_constructor_messages_affected_history (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_messages_affected_history (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_messages_affected_history (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_messages_affected_messages (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x84d19185: res = fetch_constructor_messages_affected_messages (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_messages_affected_messages (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_messages_affected_messages (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_messages_all_stickers (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xe86602c3: res = fetch_constructor_messages_all_stickers_not_modified (T); break;
+ case 0x5ce352ec: res = fetch_constructor_messages_all_stickers (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_messages_all_stickers (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_messages_all_stickers_not_modified (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_messages_all_stickers_not_modified (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_messages_all_stickers (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_messages_all_stickers (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_messages_chat_full (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xe5d7d19c: res = fetch_constructor_messages_chat_full (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_messages_chat_full (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_messages_chat_full (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_messages_chats (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x64ff9fd5: res = fetch_constructor_messages_chats (T); break;
+ default: return -1;
+ }
+ return res;
+}
+int fetch_type_bare_messages_chats (struct paramed_type *T) {
+ if (fetch_constructor_messages_chats (T) >= 0) { return 0; }
+ return -1;
+}
+int fetch_type_messages_dh_config (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xc0e24635: res = fetch_constructor_messages_dh_config_not_modified (T); break;
+ case 0x2c221edd: res = fetch_constructor_messages_dh_config (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_messages_dh_config (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_messages_dh_config_not_modified (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_messages_dh_config_not_modified (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_messages_dh_config (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_messages_dh_config (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_messages_dialogs (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x15ba6c40: res = fetch_constructor_messages_dialogs (T); break;
+ case 0x71e094f3: res = fetch_constructor_messages_dialogs_slice (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_messages_dialogs (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_messages_dialogs (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_messages_dialogs (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_messages_dialogs_slice (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_messages_dialogs_slice (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_messages_message (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x3f4e0648: res = fetch_constructor_messages_message_empty (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_messages_message (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_messages_message_empty (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_messages_messages (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x8c718e87: res = fetch_constructor_messages_messages (T); break;
+ case 0x0b446ae3: res = fetch_constructor_messages_messages_slice (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_messages_messages (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_messages_messages (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_messages_messages (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_messages_messages_slice (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_messages_messages_slice (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_messages_sent_encrypted_message (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x560f8935: res = fetch_constructor_messages_sent_encrypted_message (T); break;
+ case 0x9493ff32: res = fetch_constructor_messages_sent_encrypted_file (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_messages_sent_encrypted_message (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_messages_sent_encrypted_message (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_messages_sent_encrypted_message (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_messages_sent_encrypted_file (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_messages_sent_encrypted_file (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_messages_sent_message (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x4c3d47f3: res = fetch_constructor_messages_sent_message (T); break;
+ case 0x35a1a663: res = fetch_constructor_messages_sent_message_link (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_messages_sent_message (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_messages_sent_message (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_messages_sent_message (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_messages_sent_message_link (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_messages_sent_message_link (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_messages_sticker_set (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xb60a24a6: res = fetch_constructor_messages_sticker_set (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_messages_sticker_set (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_messages_sticker_set (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_messages_stickers (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xf1749a22: res = fetch_constructor_messages_stickers_not_modified (T); break;
+ case 0x8a8ecd32: res = fetch_constructor_messages_stickers (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_messages_stickers (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_messages_stickers_not_modified (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_messages_stickers_not_modified (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_messages_stickers (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_messages_stickers (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_photos_photo (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x20212ca8: res = fetch_constructor_photos_photo (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_photos_photo (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_photos_photo (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_photos_photos (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x8dca6aa5: res = fetch_constructor_photos_photos (T); break;
+ case 0x15051f54: res = fetch_constructor_photos_photos_slice (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_photos_photos (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_photos_photos (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_photos_photos (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_photos_photos_slice (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_photos_photos_slice (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_storage_file_type (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xaa963b05: res = fetch_constructor_storage_file_unknown (T); break;
+ case 0x007efe0e: res = fetch_constructor_storage_file_jpeg (T); break;
+ case 0xcae1aadf: res = fetch_constructor_storage_file_gif (T); break;
+ case 0x0a4f63c0: res = fetch_constructor_storage_file_png (T); break;
+ case 0xae1e508d: res = fetch_constructor_storage_file_pdf (T); break;
+ case 0x528a0677: res = fetch_constructor_storage_file_mp3 (T); break;
+ case 0x4b09ebbc: res = fetch_constructor_storage_file_mov (T); break;
+ case 0x40bc6f52: res = fetch_constructor_storage_file_partial (T); break;
+ case 0xb3cea0e4: res = fetch_constructor_storage_file_mp4 (T); break;
+ case 0x1081464c: res = fetch_constructor_storage_file_webp (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_storage_file_type (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_storage_file_unknown (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_storage_file_unknown (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_storage_file_jpeg (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_storage_file_jpeg (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_storage_file_gif (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_storage_file_gif (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_storage_file_png (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_storage_file_png (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_storage_file_pdf (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_storage_file_pdf (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_storage_file_mp3 (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_storage_file_mp3 (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_storage_file_mov (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_storage_file_mov (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_storage_file_partial (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_storage_file_partial (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_storage_file_mp4 (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_storage_file_mp4 (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_storage_file_webp (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_storage_file_webp (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_updates_difference (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x5d75a138: res = fetch_constructor_updates_difference_empty (T); break;
+ case 0x00f49ca0: res = fetch_constructor_updates_difference (T); break;
+ case 0xa8fb1981: res = fetch_constructor_updates_difference_slice (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_updates_difference (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ if (skip_constructor_updates_difference_empty (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_updates_difference_empty (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_updates_difference (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_updates_difference (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_updates_difference_slice (T) >= 0) { in_ptr = save_in_ptr; eprintf (" ("); assert (!fetch_constructor_updates_difference_slice (T)); if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int fetch_type_updates_state (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0xa56c2a3e: res = fetch_constructor_updates_state (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_updates_state (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_updates_state (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_upload_file (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ int magic = fetch_int ();
+ int res = -1;
+ switch (magic) {
+ case 0x096a18d5: res = fetch_constructor_upload_file (T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int fetch_type_bare_upload_file (struct paramed_type *T) {
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ if (fetch_constructor_upload_file (T) >= 0) { if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (" )");return 0; }
+ return -1;
+}
+int fetch_type_any (struct paramed_type *T) {
+ switch (T->type->name) {
+ case 0xb8d0afdf: return fetch_type_account_days_t_t_l (T);
+ case 0x472f5020: return fetch_type_bare_account_days_t_t_l (T);
+ case 0x9fc5ec4e: return fetch_type_audio (T);
+ case 0x603a13b1: return fetch_type_bare_audio (T);
+ case 0x7bf2e6f6: return fetch_type_authorization (T);
+ case 0x840d1909: return fetch_type_bare_authorization (T);
+ case 0x250be282: return fetch_type_bool (T);
+ case 0xdaf41d7d: return fetch_type_bare_bool (T);
+ case 0x75e7ea6c: return fetch_type_bot_command (T);
+ case 0x8a181593: return fetch_type_bare_bot_command (T);
+ case 0xb2e16f93: return fetch_type_bot_info (T);
+ case 0x4d1e906c: return fetch_type_bare_bot_info (T);
+ case 0x0ee1379f: return fetch_type_bytes (T);
+ case 0xf11ec860: return fetch_type_bare_bytes (T);
+ case 0x7bd865dc: return fetch_type_chat (T);
+ case 0x84279a23: return fetch_type_bare_chat (T);
+ case 0x2e02a614: return fetch_type_chat_full (T);
+ case 0xd1fd59eb: return fetch_type_bare_chat_full (T);
+ case 0x94f910b1: return fetch_type_chat_invite (T);
+ case 0x6b06ef4e: return fetch_type_bare_chat_invite (T);
+ case 0x3631cf4c: return fetch_type_chat_located (T);
+ case 0xc9ce30b3: return fetch_type_bare_chat_located (T);
+ case 0xc8d7493e: return fetch_type_chat_participant (T);
+ case 0x3728b6c1: return fetch_type_bare_chat_participant (T);
+ case 0x77930f9f: return fetch_type_chat_participants (T);
+ case 0x886cf060: return fetch_type_bare_chat_participants (T);
+ case 0x56922676: return fetch_type_chat_photo (T);
+ case 0xa96dd989: return fetch_type_bare_chat_photo (T);
+ case 0x6643b654: return fetch_type_client_d_h_inner_data (T);
+ case 0x99bc49ab: return fetch_type_bare_client_d_h_inner_data (T);
+ case 0x4e32b894: return fetch_type_config (T);
+ case 0xb1cd476b: return fetch_type_bare_config (T);
+ case 0xf911c994: return fetch_type_contact (T);
+ case 0x06ee366b: return fetch_type_bare_contact (T);
+ case 0x561bc879: return fetch_type_contact_blocked (T);
+ case 0xa9e43786: return fetch_type_bare_contact_blocked (T);
+ case 0xea879f95: return fetch_type_contact_found (T);
+ case 0x1578606a: return fetch_type_bare_contact_found (T);
+ case 0x522fbc63: return fetch_type_contact_link (T);
+ case 0xadd0439c: return fetch_type_bare_contact_link (T);
+ case 0xd3680c61: return fetch_type_contact_status (T);
+ case 0x2c97f39e: return fetch_type_bare_contact_status (T);
+ case 0x3de191a1: return fetch_type_contact_suggested (T);
+ case 0xc21e6e5e: return fetch_type_bare_contact_suggested (T);
+ case 0x2b1a62f0: return fetch_type_dc_option (T);
+ case 0xd4e59d0f: return fetch_type_bare_dc_option (T);
+ case 0x535b7918: return fetch_type_decrypted_message (T);
+ case 0xaca486e7: return fetch_type_bare_decrypted_message (T);
+ case 0x4e0eefde: return fetch_type_decrypted_message_action (T);
+ case 0xb1f11021: return fetch_type_bare_decrypted_message_action (T);
+ case 0x1be31789: return fetch_type_decrypted_message_layer (T);
+ case 0xe41ce876: return fetch_type_bare_decrypted_message_layer (T);
+ case 0x34e0d674: return fetch_type_decrypted_message_media (T);
+ case 0xcb1f298b: return fetch_type_bare_decrypted_message_media (T);
+ case 0xc1dd804a: return fetch_type_dialog (T);
+ case 0x3e227fb5: return fetch_type_bare_dialog (T);
+ case 0xae636f24: return fetch_type_disabled_feature (T);
+ case 0x519c90db: return fetch_type_bare_disabled_feature (T);
+ case 0x51a73418: return fetch_type_document (T);
+ case 0xae58cbe7: return fetch_type_bare_document (T);
+ case 0x97c637a3: return fetch_type_document_attribute (T);
+ case 0x6839c85c: return fetch_type_bare_document_attribute (T);
+ case 0x2210c154: return fetch_type_double (T);
+ case 0xddef3eab: return fetch_type_bare_double (T);
+ case 0xb1718213: return fetch_type_encrypted_chat (T);
+ case 0x4e8e7dec: return fetch_type_bare_encrypted_chat (T);
+ case 0x886fd032: return fetch_type_encrypted_file (T);
+ case 0x77902fcd: return fetch_type_bare_encrypted_file (T);
+ case 0xce6b8a1e: return fetch_type_encrypted_message (T);
+ case 0x319475e1: return fetch_type_bare_encrypted_message (T);
+ case 0xc4b9f9bb: return fetch_type_error (T);
+ case 0x3b460644: return fetch_type_bare_error (T);
+ case 0x95f132d5: return fetch_type_exported_chat_invite (T);
+ case 0x6a0ecd2a: return fetch_type_bare_exported_chat_invite (T);
+ case 0x2f8ffb30: return fetch_type_file_location (T);
+ case 0xd07004cf: return fetch_type_bare_file_location (T);
+ case 0xf67b4034: return fetch_type_geo_chat_message (T);
+ case 0x0984bfcb: return fetch_type_bare_geo_chat_message (T);
+ case 0x315e0a53: return fetch_type_geo_point (T);
+ case 0xcea1f5ac: return fetch_type_bare_geo_point (T);
+ case 0xd0028438: return fetch_type_imported_contact (T);
+ case 0x2ffd7bc7: return fetch_type_bare_imported_contact (T);
+ case 0x770656a8: return fetch_type_input_app_event (T);
+ case 0x88f9a957: return fetch_type_bare_input_app_event (T);
+ case 0xae8e9c7b: return fetch_type_input_audio (T);
+ case 0x51716384: return fetch_type_bare_input_audio (T);
+ case 0x3a60776d: return fetch_type_input_chat_photo (T);
+ case 0xc59f8892: return fetch_type_bare_input_chat_photo (T);
+ case 0xf392b7f4: return fetch_type_input_contact (T);
+ case 0x0c6d480b: return fetch_type_bare_input_contact (T);
+ case 0x6a8963fc: return fetch_type_input_document (T);
+ case 0x95769c03: return fetch_type_bare_input_document (T);
+ case 0xf141b5e1: return fetch_type_input_encrypted_chat (T);
+ case 0x0ebe4a1e: return fetch_type_bare_input_encrypted_chat (T);
+ case 0x0b5c064f: return fetch_type_input_encrypted_file (T);
+ case 0xf4a3f9b0: return fetch_type_bare_input_encrypted_file (T);
+ case 0x0f60f9ca: return fetch_type_input_file (T);
+ case 0xf09f0635: return fetch_type_bare_input_file (T);
+ case 0xe6daa38b: return fetch_type_input_file_location (T);
+ case 0x19255c74: return fetch_type_bare_input_file_location (T);
+ case 0x74d456fa: return fetch_type_input_geo_chat (T);
+ case 0x8b2ba905: return fetch_type_bare_input_geo_chat (T);
+ case 0x17768f1f: return fetch_type_input_geo_point (T);
+ case 0xe88970e0: return fetch_type_bare_input_geo_point (T);
+ case 0xb32c91dd: return fetch_type_input_media (T);
+ case 0x4cd36e22: return fetch_type_bare_input_media (T);
+ case 0x02b6911b: return fetch_type_input_notify_peer (T);
+ case 0xfd496ee4: return fetch_type_bare_input_notify_peer (T);
+ case 0x9e67268d: return fetch_type_input_peer (T);
+ case 0x6198d972: return fetch_type_bare_input_peer (T);
+ case 0x185a48ac: return fetch_type_input_peer_notify_events (T);
+ case 0xe7a5b753: return fetch_type_bare_input_peer_notify_events (T);
+ case 0x46a2ce98: return fetch_type_input_peer_notify_settings (T);
+ case 0xb95d3167: return fetch_type_bare_input_peer_notify_settings (T);
+ case 0xe74279c9: return fetch_type_input_photo (T);
+ case 0x18bd8636: return fetch_type_bare_input_photo (T);
+ case 0x7477e321: return fetch_type_input_photo_crop (T);
+ case 0x8b881cde: return fetch_type_bare_input_photo_crop (T);
+ case 0x4f96cb18: return fetch_type_input_privacy_key (T);
+ case 0xb06934e7: return fetch_type_bare_input_privacy_key (T);
+ case 0x4b815163: return fetch_type_input_privacy_rule (T);
+ case 0xb47eae9c: return fetch_type_bare_input_privacy_rule (T);
+ case 0xe44d415c: return fetch_type_input_sticker_set (T);
+ case 0x1bb2bea3: return fetch_type_bare_input_sticker_set (T);
+ case 0xadfe0c6a: return fetch_type_input_user (T);
+ case 0x5201f395: return fetch_type_bare_input_user (T);
+ case 0xbb5f7a27: return fetch_type_input_video (T);
+ case 0x44a085d8: return fetch_type_bare_input_video (T);
+ case 0xa8509bda: return fetch_type_int (T);
+ case 0x57af6425: return fetch_type_bare_int (T);
+ case 0x7d36c439: return fetch_type_int128 (T);
+ case 0x82c93bc6: return fetch_type_bare_int128 (T);
+ case 0xf2c798b3: return fetch_type_int256 (T);
+ case 0x0d38674c: return fetch_type_bare_int256 (T);
+ case 0xa2fa4880: return fetch_type_keyboard_button (T);
+ case 0x5d05b77f: return fetch_type_bare_keyboard_button (T);
+ case 0x77608b83: return fetch_type_keyboard_button_row (T);
+ case 0x889f747c: return fetch_type_bare_keyboard_button_row (T);
+ case 0x22076cba: return fetch_type_long (T);
+ case 0xddf89345: return fetch_type_bare_long (T);
+ case 0x5d652a7f: return fetch_type_message (T);
+ case 0xa29ad580: return fetch_type_bare_message (T);
+ case 0x383415fa: return fetch_type_message_action (T);
+ case 0xc7cbea05: return fetch_type_bare_message_action (T);
+ case 0x95f2471a: return fetch_type_message_media (T);
+ case 0x6a0db8e5: return fetch_type_bare_message_media (T);
+ case 0x80895ae0: return fetch_type_messages_filter (T);
+ case 0x7f76a51f: return fetch_type_bare_messages_filter (T);
+ case 0x8e1a1775: return fetch_type_nearest_dc (T);
+ case 0x71e5e88a: return fetch_type_bare_nearest_dc (T);
+ case 0x9fcb8237: return fetch_type_notify_peer (T);
+ case 0x60347dc8: return fetch_type_bare_notify_peer (T);
+ case 0x56730bcc: return fetch_type_null (T);
+ case 0xa98cf433: return fetch_type_bare_null (T);
+ case 0xbfa3de38: return fetch_type_p_q_inner_data (T);
+ case 0x405c21c7: return fetch_type_bare_p_q_inner_data (T);
+ case 0x276159d6: return fetch_type_peer (T);
+ case 0xd89ea629: return fetch_type_bare_peer (T);
+ case 0xc0c8d13b: return fetch_type_peer_notify_events (T);
+ case 0x3f372ec4: return fetch_type_bare_peer_notify_events (T);
+ case 0xfdf894fc: return fetch_type_peer_notify_settings (T);
+ case 0x02076b03: return fetch_type_bare_peer_notify_settings (T);
+ case 0xc207550a: return fetch_type_photo (T);
+ case 0x3df8aaf5: return fetch_type_bare_photo (T);
+ case 0x900f60dd: return fetch_type_photo_size (T);
+ case 0x6ff09f22: return fetch_type_bare_photo_size (T);
+ case 0xbc2eab30: return fetch_type_privacy_key (T);
+ case 0x43d154cf: return fetch_type_bare_privacy_key (T);
+ case 0xa8638aec: return fetch_type_privacy_rule (T);
+ case 0x579c7513: return fetch_type_bare_privacy_rule (T);
+ case 0xa384b779: return fetch_type_received_notify_message (T);
+ case 0x5c7b4886: return fetch_type_bare_received_notify_message (T);
+ case 0x612ca4a9: return fetch_type_reply_markup (T);
+ case 0x9ed35b56: return fetch_type_bare_reply_markup (T);
+ case 0x05162463: return fetch_type_res_p_q (T);
+ case 0xfae9db9c: return fetch_type_bare_res_p_q (T);
+ case 0x70541c7e: return fetch_type_send_message_action (T);
+ case 0x8fabe381: return fetch_type_bare_send_message_action (T);
+ case 0xa9230301: return fetch_type_server_d_h_params (T);
+ case 0x56dcfcfe: return fetch_type_bare_server_d_h_params (T);
+ case 0xb5890dba: return fetch_type_server_d_h_inner_data (T);
+ case 0x4a76f245: return fetch_type_bare_server_d_h_inner_data (T);
+ case 0xdb8a468f: return fetch_type_set_client_d_h_params_answer (T);
+ case 0x2475b970: return fetch_type_bare_set_client_d_h_params_answer (T);
+ case 0x12b299d4: return fetch_type_sticker_pack (T);
+ case 0xed4d662b: return fetch_type_bare_sticker_pack (T);
+ case 0xa7a43b17: return fetch_type_sticker_set (T);
+ case 0x585bc4e8: return fetch_type_bare_sticker_set (T);
+ case 0xb5286e24: return fetch_type_string (T);
+ case 0x4ad791db: return fetch_type_bare_string (T);
+ case 0x2e02b27e: return fetch_type_update (T);
+ case 0xd1fd4d81: return fetch_type_bare_update (T);
+ case 0x22499d27: return fetch_type_updates (T);
+ case 0xddb662d8: return fetch_type_bare_updates (T);
+ case 0x02e6c0c8: return fetch_type_user (T);
+ case 0xfd193f37: return fetch_type_bare_user (T);
+ case 0x5a89ac5b: return fetch_type_user_full (T);
+ case 0xa57653a4: return fetch_type_bare_user_full (T);
+ case 0x9a486229: return fetch_type_user_profile_photo (T);
+ case 0x65b79dd6: return fetch_type_bare_user_profile_photo (T);
+ case 0x76de9570: return fetch_type_user_status (T);
+ case 0x89216a8f: return fetch_type_bare_user_status (T);
+ case 0x1cb5c415: return fetch_type_vector (T);
+ case 0xe34a3bea: return fetch_type_bare_vector (T);
+ case 0x1716b174: return fetch_type_video (T);
+ case 0xe8e94e8b: return fetch_type_bare_video (T);
+ case 0xafa14973: return fetch_type_wall_paper (T);
+ case 0x505eb68c: return fetch_type_bare_wall_paper (T);
+ case 0x8d8c0d41: return fetch_type_web_page (T);
+ case 0x7273f2be: return fetch_type_bare_web_page (T);
+ case 0x1250abde: return fetch_type_account_authorizations (T);
+ case 0xedaf5421: return fetch_type_bare_account_authorizations (T);
+ case 0xeac2a804: return fetch_type_account_password (T);
+ case 0x153d57fb: return fetch_type_bare_account_password (T);
+ case 0xbcfc532c: return fetch_type_account_password_input_settings (T);
+ case 0x4303acd3: return fetch_type_bare_account_password_input_settings (T);
+ case 0xb7b72ab3: return fetch_type_account_password_settings (T);
+ case 0x4848d54c: return fetch_type_bare_account_password_settings (T);
+ case 0x554abb6f: return fetch_type_account_privacy_rules (T);
+ case 0xaab54490: return fetch_type_bare_account_privacy_rules (T);
+ case 0xa4f58c4c: return fetch_type_account_sent_change_phone_code (T);
+ case 0x5b0a73b3: return fetch_type_bare_account_sent_change_phone_code (T);
+ case 0xff036af1: return fetch_type_auth_authorization (T);
+ case 0x00fc950e: return fetch_type_bare_auth_authorization (T);
+ case 0x811ea28e: return fetch_type_auth_checked_phone (T);
+ case 0x7ee15d71: return fetch_type_bare_auth_checked_phone (T);
+ case 0xdf969c2d: return fetch_type_auth_exported_authorization (T);
+ case 0x206963d2: return fetch_type_bare_auth_exported_authorization (T);
+ case 0x137948a5: return fetch_type_auth_password_recovery (T);
+ case 0xec86b75a: return fetch_type_bare_auth_password_recovery (T);
+ case 0x0cc8bc16: return fetch_type_auth_sent_code (T);
+ case 0xf33743e9: return fetch_type_bare_auth_sent_code (T);
+ case 0x0377168f: return fetch_type_binlog_encr_key (T);
+ case 0xfc88e970: return fetch_type_bare_binlog_encr_key (T);
+ case 0x66ff03a6: return fetch_type_binlog_update (T);
+ case 0x9900fc59: return fetch_type_bare_binlog_update (T);
+ case 0x8c1b8fb4: return fetch_type_contacts_blocked (T);
+ case 0x73e4704b: return fetch_type_bare_contacts_blocked (T);
+ case 0xd8c02560: return fetch_type_contacts_contacts (T);
+ case 0x273fda9f: return fetch_type_bare_contacts_contacts (T);
+ case 0x0566000e: return fetch_type_contacts_found (T);
+ case 0xfa99fff1: return fetch_type_bare_contacts_found (T);
+ case 0xad524315: return fetch_type_contacts_imported_contacts (T);
+ case 0x52adbcea: return fetch_type_bare_contacts_imported_contacts (T);
+ case 0x3ace484c: return fetch_type_contacts_link (T);
+ case 0xc531b7b3: return fetch_type_bare_contacts_link (T);
+ case 0x5649dcc5: return fetch_type_contacts_suggested (T);
+ case 0xa9b6233a: return fetch_type_bare_contacts_suggested (T);
+ case 0x48feb267: return fetch_type_geochats_located (T);
+ case 0xb7014d98: return fetch_type_bare_geochats_located (T);
+ case 0x6d0a0e59: return fetch_type_geochats_messages (T);
+ case 0x92f5f1a6: return fetch_type_bare_geochats_messages (T);
+ case 0x17b1578b: return fetch_type_geochats_stated_message (T);
+ case 0xe84ea874: return fetch_type_bare_geochats_stated_message (T);
+ case 0x4ddd9627: return fetch_type_help_app_update (T);
+ case 0xb22269d8: return fetch_type_bare_help_app_update (T);
+ case 0x18cb9f78: return fetch_type_help_invite_text (T);
+ case 0xe7346087: return fetch_type_bare_help_invite_text (T);
+ case 0x17c6b5f6: return fetch_type_help_support (T);
+ case 0xe8394a09: return fetch_type_bare_help_support (T);
+ case 0xb45c69d1: return fetch_type_messages_affected_history (T);
+ case 0x4ba3962e: return fetch_type_bare_messages_affected_history (T);
+ case 0x84d19185: return fetch_type_messages_affected_messages (T);
+ case 0x7b2e6e7a: return fetch_type_bare_messages_affected_messages (T);
+ case 0xb485502f: return fetch_type_messages_all_stickers (T);
+ case 0x4b7aafd0: return fetch_type_bare_messages_all_stickers (T);
+ case 0xe5d7d19c: return fetch_type_messages_chat_full (T);
+ case 0x1a282e63: return fetch_type_bare_messages_chat_full (T);
+ case 0x64ff9fd5: return fetch_type_messages_chats (T);
+ case 0x9b00602a: return fetch_type_bare_messages_chats (T);
+ case 0xecc058e8: return fetch_type_messages_dh_config (T);
+ case 0x133fa717: return fetch_type_bare_messages_dh_config (T);
+ case 0x645af8b3: return fetch_type_messages_dialogs (T);
+ case 0x9ba5074c: return fetch_type_bare_messages_dialogs (T);
+ case 0x3f4e0648: return fetch_type_messages_message (T);
+ case 0xc0b1f9b7: return fetch_type_bare_messages_message (T);
+ case 0x8735e464: return fetch_type_messages_messages (T);
+ case 0x78ca1b9b: return fetch_type_bare_messages_messages (T);
+ case 0xc29c7607: return fetch_type_messages_sent_encrypted_message (T);
+ case 0x3d6389f8: return fetch_type_bare_messages_sent_encrypted_message (T);
+ case 0x799ce190: return fetch_type_messages_sent_message (T);
+ case 0x86631e6f: return fetch_type_bare_messages_sent_message (T);
+ case 0xb60a24a6: return fetch_type_messages_sticker_set (T);
+ case 0x49f5db59: return fetch_type_bare_messages_sticker_set (T);
+ case 0x7bfa5710: return fetch_type_messages_stickers (T);
+ case 0x8405a8ef: return fetch_type_bare_messages_stickers (T);
+ case 0x20212ca8: return fetch_type_photos_photo (T);
+ case 0xdfded357: return fetch_type_bare_photos_photo (T);
+ case 0x98cf75f1: return fetch_type_photos_photos (T);
+ case 0x67308a0e: return fetch_type_bare_photos_photos (T);
+ case 0x3e2838a8: return fetch_type_storage_file_type (T);
+ case 0xc1d7c757: return fetch_type_bare_storage_file_type (T);
+ case 0xf57a2419: return fetch_type_updates_difference (T);
+ case 0x0a85dbe6: return fetch_type_bare_updates_difference (T);
+ case 0xa56c2a3e: return fetch_type_updates_state (T);
+ case 0x5a93d5c1: return fetch_type_bare_updates_state (T);
+ case 0x096a18d5: return fetch_type_upload_file (T);
+ case 0xf695e72a: return fetch_type_bare_upload_file (T);
+ default: return -1; }
+}
diff --git a/protocols/Telegram/tgl/auto/auto-fetch.h b/protocols/Telegram/tgl/auto/auto-fetch.h
new file mode 100644
index 0000000000..803f7b6902
--- /dev/null
+++ b/protocols/Telegram/tgl/auto/auto-fetch.h
@@ -0,0 +1,717 @@
+#ifdef _MSC_VER
+#include "..\auto.h"
+#else
+#include "auto.h"
+#endif
+#include <assert.h>
+#include <stdio.h>
+struct tgl_state;
+char *tglf_extf_fetch (struct tgl_state *TLS, struct paramed_type *T);
+int fetch_constructor_account_days_t_t_l (struct paramed_type *T);
+int fetch_constructor_audio_empty (struct paramed_type *T);
+int fetch_constructor_audio (struct paramed_type *T);
+int fetch_constructor_authorization (struct paramed_type *T);
+int fetch_constructor_bool_false (struct paramed_type *T);
+int fetch_constructor_bool_true (struct paramed_type *T);
+int fetch_constructor_bot_command (struct paramed_type *T);
+int fetch_constructor_bot_command_old (struct paramed_type *T);
+int fetch_constructor_bot_info_empty (struct paramed_type *T);
+int fetch_constructor_bot_info (struct paramed_type *T);
+int fetch_constructor_bytes (struct paramed_type *T);
+int fetch_constructor_chat_empty (struct paramed_type *T);
+int fetch_constructor_chat (struct paramed_type *T);
+int fetch_constructor_chat_forbidden (struct paramed_type *T);
+int fetch_constructor_geo_chat (struct paramed_type *T);
+int fetch_constructor_chat_full (struct paramed_type *T);
+int fetch_constructor_chat_invite_already (struct paramed_type *T);
+int fetch_constructor_chat_invite (struct paramed_type *T);
+int fetch_constructor_chat_located (struct paramed_type *T);
+int fetch_constructor_chat_participant (struct paramed_type *T);
+int fetch_constructor_chat_participants_forbidden (struct paramed_type *T);
+int fetch_constructor_chat_participants (struct paramed_type *T);
+int fetch_constructor_chat_photo_empty (struct paramed_type *T);
+int fetch_constructor_chat_photo (struct paramed_type *T);
+int fetch_constructor_client_d_h_inner_data (struct paramed_type *T);
+int fetch_constructor_config (struct paramed_type *T);
+int fetch_constructor_contact (struct paramed_type *T);
+int fetch_constructor_contact_blocked (struct paramed_type *T);
+int fetch_constructor_contact_found (struct paramed_type *T);
+int fetch_constructor_contact_link_unknown (struct paramed_type *T);
+int fetch_constructor_contact_link_none (struct paramed_type *T);
+int fetch_constructor_contact_link_has_phone (struct paramed_type *T);
+int fetch_constructor_contact_link_contact (struct paramed_type *T);
+int fetch_constructor_contact_status (struct paramed_type *T);
+int fetch_constructor_contact_suggested (struct paramed_type *T);
+int fetch_constructor_dc_option_l28 (struct paramed_type *T);
+int fetch_constructor_dc_option (struct paramed_type *T);
+int fetch_constructor_decrypted_message (struct paramed_type *T);
+int fetch_constructor_decrypted_message_service (struct paramed_type *T);
+int fetch_constructor_decrypted_message_action_set_message_t_t_l (struct paramed_type *T);
+int fetch_constructor_decrypted_message_action_read_messages (struct paramed_type *T);
+int fetch_constructor_decrypted_message_action_delete_messages (struct paramed_type *T);
+int fetch_constructor_decrypted_message_action_screenshot_messages (struct paramed_type *T);
+int fetch_constructor_decrypted_message_action_flush_history (struct paramed_type *T);
+int fetch_constructor_decrypted_message_action_resend (struct paramed_type *T);
+int fetch_constructor_decrypted_message_action_notify_layer (struct paramed_type *T);
+int fetch_constructor_decrypted_message_action_typing (struct paramed_type *T);
+int fetch_constructor_decrypted_message_action_request_key (struct paramed_type *T);
+int fetch_constructor_decrypted_message_action_accept_key (struct paramed_type *T);
+int fetch_constructor_decrypted_message_action_abort_key (struct paramed_type *T);
+int fetch_constructor_decrypted_message_action_commit_key (struct paramed_type *T);
+int fetch_constructor_decrypted_message_action_noop (struct paramed_type *T);
+int fetch_constructor_decrypted_message_layer (struct paramed_type *T);
+int fetch_constructor_decrypted_message_media_empty (struct paramed_type *T);
+int fetch_constructor_decrypted_message_media_photo (struct paramed_type *T);
+int fetch_constructor_decrypted_message_media_geo_point (struct paramed_type *T);
+int fetch_constructor_decrypted_message_media_contact (struct paramed_type *T);
+int fetch_constructor_decrypted_message_media_document (struct paramed_type *T);
+int fetch_constructor_decrypted_message_media_video (struct paramed_type *T);
+int fetch_constructor_decrypted_message_media_audio (struct paramed_type *T);
+int fetch_constructor_decrypted_message_media_external_document (struct paramed_type *T);
+int fetch_constructor_decrypted_message_media_video_l12 (struct paramed_type *T);
+int fetch_constructor_decrypted_message_media_audio_l12 (struct paramed_type *T);
+int fetch_constructor_dialog (struct paramed_type *T);
+int fetch_constructor_disabled_feature (struct paramed_type *T);
+int fetch_constructor_document_empty (struct paramed_type *T);
+int fetch_constructor_document (struct paramed_type *T);
+int fetch_constructor_document_l19 (struct paramed_type *T);
+int fetch_constructor_document_attribute_image_size (struct paramed_type *T);
+int fetch_constructor_document_attribute_animated (struct paramed_type *T);
+int fetch_constructor_document_attribute_sticker_l28 (struct paramed_type *T);
+int fetch_constructor_document_attribute_sticker (struct paramed_type *T);
+int fetch_constructor_document_attribute_video (struct paramed_type *T);
+int fetch_constructor_document_attribute_audio (struct paramed_type *T);
+int fetch_constructor_document_attribute_filename (struct paramed_type *T);
+int fetch_constructor_double (struct paramed_type *T);
+int fetch_constructor_encrypted_chat_empty (struct paramed_type *T);
+int fetch_constructor_encrypted_chat_waiting (struct paramed_type *T);
+int fetch_constructor_encrypted_chat_requested (struct paramed_type *T);
+int fetch_constructor_encrypted_chat (struct paramed_type *T);
+int fetch_constructor_encrypted_chat_discarded (struct paramed_type *T);
+int fetch_constructor_encrypted_file_empty (struct paramed_type *T);
+int fetch_constructor_encrypted_file (struct paramed_type *T);
+int fetch_constructor_encrypted_message (struct paramed_type *T);
+int fetch_constructor_encrypted_message_service (struct paramed_type *T);
+int fetch_constructor_error (struct paramed_type *T);
+int fetch_constructor_chat_invite_empty (struct paramed_type *T);
+int fetch_constructor_chat_invite_exported (struct paramed_type *T);
+int fetch_constructor_file_location_unavailable (struct paramed_type *T);
+int fetch_constructor_file_location (struct paramed_type *T);
+int fetch_constructor_geo_chat_message_empty (struct paramed_type *T);
+int fetch_constructor_geo_chat_message (struct paramed_type *T);
+int fetch_constructor_geo_chat_message_service (struct paramed_type *T);
+int fetch_constructor_geo_point_empty (struct paramed_type *T);
+int fetch_constructor_geo_point (struct paramed_type *T);
+int fetch_constructor_imported_contact (struct paramed_type *T);
+int fetch_constructor_input_app_event (struct paramed_type *T);
+int fetch_constructor_input_audio_empty (struct paramed_type *T);
+int fetch_constructor_input_audio (struct paramed_type *T);
+int fetch_constructor_input_chat_photo_empty (struct paramed_type *T);
+int fetch_constructor_input_chat_uploaded_photo (struct paramed_type *T);
+int fetch_constructor_input_chat_photo (struct paramed_type *T);
+int fetch_constructor_input_phone_contact (struct paramed_type *T);
+int fetch_constructor_input_document_empty (struct paramed_type *T);
+int fetch_constructor_input_document (struct paramed_type *T);
+int fetch_constructor_input_encrypted_chat (struct paramed_type *T);
+int fetch_constructor_input_encrypted_file_empty (struct paramed_type *T);
+int fetch_constructor_input_encrypted_file_uploaded (struct paramed_type *T);
+int fetch_constructor_input_encrypted_file (struct paramed_type *T);
+int fetch_constructor_input_encrypted_file_big_uploaded (struct paramed_type *T);
+int fetch_constructor_input_file (struct paramed_type *T);
+int fetch_constructor_input_file_big (struct paramed_type *T);
+int fetch_constructor_input_file_location (struct paramed_type *T);
+int fetch_constructor_input_video_file_location (struct paramed_type *T);
+int fetch_constructor_input_encrypted_file_location (struct paramed_type *T);
+int fetch_constructor_input_audio_file_location (struct paramed_type *T);
+int fetch_constructor_input_document_file_location (struct paramed_type *T);
+int fetch_constructor_input_geo_chat (struct paramed_type *T);
+int fetch_constructor_input_geo_point_empty (struct paramed_type *T);
+int fetch_constructor_input_geo_point (struct paramed_type *T);
+int fetch_constructor_input_media_empty (struct paramed_type *T);
+int fetch_constructor_input_media_uploaded_photo (struct paramed_type *T);
+int fetch_constructor_input_media_photo (struct paramed_type *T);
+int fetch_constructor_input_media_geo_point (struct paramed_type *T);
+int fetch_constructor_input_media_contact (struct paramed_type *T);
+int fetch_constructor_input_media_uploaded_video (struct paramed_type *T);
+int fetch_constructor_input_media_uploaded_thumb_video (struct paramed_type *T);
+int fetch_constructor_input_media_video (struct paramed_type *T);
+int fetch_constructor_input_media_uploaded_audio (struct paramed_type *T);
+int fetch_constructor_input_media_audio (struct paramed_type *T);
+int fetch_constructor_input_media_uploaded_document (struct paramed_type *T);
+int fetch_constructor_input_media_uploaded_thumb_document (struct paramed_type *T);
+int fetch_constructor_input_media_document (struct paramed_type *T);
+int fetch_constructor_input_media_venue (struct paramed_type *T);
+int fetch_constructor_input_notify_peer (struct paramed_type *T);
+int fetch_constructor_input_notify_users (struct paramed_type *T);
+int fetch_constructor_input_notify_chats (struct paramed_type *T);
+int fetch_constructor_input_notify_all (struct paramed_type *T);
+int fetch_constructor_input_notify_geo_chat_peer (struct paramed_type *T);
+int fetch_constructor_input_peer_empty (struct paramed_type *T);
+int fetch_constructor_input_peer_self (struct paramed_type *T);
+int fetch_constructor_input_peer_contact (struct paramed_type *T);
+int fetch_constructor_input_peer_foreign (struct paramed_type *T);
+int fetch_constructor_input_peer_chat (struct paramed_type *T);
+int fetch_constructor_input_peer_notify_events_empty (struct paramed_type *T);
+int fetch_constructor_input_peer_notify_events_all (struct paramed_type *T);
+int fetch_constructor_input_peer_notify_settings (struct paramed_type *T);
+int fetch_constructor_input_photo_empty (struct paramed_type *T);
+int fetch_constructor_input_photo (struct paramed_type *T);
+int fetch_constructor_input_photo_crop_auto (struct paramed_type *T);
+int fetch_constructor_input_photo_crop (struct paramed_type *T);
+int fetch_constructor_input_privacy_key_status_timestamp (struct paramed_type *T);
+int fetch_constructor_input_privacy_value_allow_contacts (struct paramed_type *T);
+int fetch_constructor_input_privacy_value_allow_all (struct paramed_type *T);
+int fetch_constructor_input_privacy_value_allow_users (struct paramed_type *T);
+int fetch_constructor_input_privacy_value_disallow_contacts (struct paramed_type *T);
+int fetch_constructor_input_privacy_value_disallow_all (struct paramed_type *T);
+int fetch_constructor_input_privacy_value_disallow_users (struct paramed_type *T);
+int fetch_constructor_input_sticker_set_empty (struct paramed_type *T);
+int fetch_constructor_input_sticker_set_i_d (struct paramed_type *T);
+int fetch_constructor_input_sticker_set_short_name (struct paramed_type *T);
+int fetch_constructor_input_user_empty (struct paramed_type *T);
+int fetch_constructor_input_user_self (struct paramed_type *T);
+int fetch_constructor_input_user_contact (struct paramed_type *T);
+int fetch_constructor_input_user_foreign (struct paramed_type *T);
+int fetch_constructor_input_video_empty (struct paramed_type *T);
+int fetch_constructor_input_video (struct paramed_type *T);
+int fetch_constructor_int (struct paramed_type *T);
+int fetch_constructor_int128 (struct paramed_type *T);
+int fetch_constructor_int256 (struct paramed_type *T);
+int fetch_constructor_keyboard_button (struct paramed_type *T);
+int fetch_constructor_keyboard_button_row (struct paramed_type *T);
+int fetch_constructor_long (struct paramed_type *T);
+int fetch_constructor_message_empty (struct paramed_type *T);
+int fetch_constructor_message (struct paramed_type *T);
+int fetch_constructor_message_service (struct paramed_type *T);
+int fetch_constructor_message_action_empty (struct paramed_type *T);
+int fetch_constructor_message_action_chat_create (struct paramed_type *T);
+int fetch_constructor_message_action_chat_edit_title (struct paramed_type *T);
+int fetch_constructor_message_action_chat_edit_photo (struct paramed_type *T);
+int fetch_constructor_message_action_chat_delete_photo (struct paramed_type *T);
+int fetch_constructor_message_action_chat_add_user (struct paramed_type *T);
+int fetch_constructor_message_action_chat_delete_user (struct paramed_type *T);
+int fetch_constructor_message_action_geo_chat_create (struct paramed_type *T);
+int fetch_constructor_message_action_geo_chat_checkin (struct paramed_type *T);
+int fetch_constructor_message_action_chat_joined_by_link (struct paramed_type *T);
+int fetch_constructor_message_media_empty (struct paramed_type *T);
+int fetch_constructor_message_media_photo (struct paramed_type *T);
+int fetch_constructor_message_media_video (struct paramed_type *T);
+int fetch_constructor_message_media_geo (struct paramed_type *T);
+int fetch_constructor_message_media_contact (struct paramed_type *T);
+int fetch_constructor_message_media_unsupported (struct paramed_type *T);
+int fetch_constructor_message_media_document (struct paramed_type *T);
+int fetch_constructor_message_media_audio (struct paramed_type *T);
+int fetch_constructor_message_media_web_page (struct paramed_type *T);
+int fetch_constructor_message_media_venue (struct paramed_type *T);
+int fetch_constructor_message_media_photo_l27 (struct paramed_type *T);
+int fetch_constructor_message_media_video_l27 (struct paramed_type *T);
+int fetch_constructor_input_messages_filter_empty (struct paramed_type *T);
+int fetch_constructor_input_messages_filter_photos (struct paramed_type *T);
+int fetch_constructor_input_messages_filter_video (struct paramed_type *T);
+int fetch_constructor_input_messages_filter_photo_video (struct paramed_type *T);
+int fetch_constructor_input_messages_filter_photo_video_documents (struct paramed_type *T);
+int fetch_constructor_input_messages_filter_document (struct paramed_type *T);
+int fetch_constructor_input_messages_filter_audio (struct paramed_type *T);
+int fetch_constructor_nearest_dc (struct paramed_type *T);
+int fetch_constructor_notify_peer (struct paramed_type *T);
+int fetch_constructor_notify_users (struct paramed_type *T);
+int fetch_constructor_notify_chats (struct paramed_type *T);
+int fetch_constructor_notify_all (struct paramed_type *T);
+int fetch_constructor_null (struct paramed_type *T);
+int fetch_constructor_p_q_inner_data (struct paramed_type *T);
+int fetch_constructor_p_q_inner_data_temp (struct paramed_type *T);
+int fetch_constructor_peer_user (struct paramed_type *T);
+int fetch_constructor_peer_chat (struct paramed_type *T);
+int fetch_constructor_peer_notify_events_empty (struct paramed_type *T);
+int fetch_constructor_peer_notify_events_all (struct paramed_type *T);
+int fetch_constructor_peer_notify_settings_empty (struct paramed_type *T);
+int fetch_constructor_peer_notify_settings (struct paramed_type *T);
+int fetch_constructor_photo_empty (struct paramed_type *T);
+int fetch_constructor_photo (struct paramed_type *T);
+int fetch_constructor_photo_l27 (struct paramed_type *T);
+int fetch_constructor_photo_size_empty (struct paramed_type *T);
+int fetch_constructor_photo_size (struct paramed_type *T);
+int fetch_constructor_photo_cached_size (struct paramed_type *T);
+int fetch_constructor_privacy_key_status_timestamp (struct paramed_type *T);
+int fetch_constructor_privacy_value_allow_contacts (struct paramed_type *T);
+int fetch_constructor_privacy_value_allow_all (struct paramed_type *T);
+int fetch_constructor_privacy_value_allow_users (struct paramed_type *T);
+int fetch_constructor_privacy_value_disallow_contacts (struct paramed_type *T);
+int fetch_constructor_privacy_value_disallow_all (struct paramed_type *T);
+int fetch_constructor_privacy_value_disallow_users (struct paramed_type *T);
+int fetch_constructor_received_notify_message (struct paramed_type *T);
+int fetch_constructor_reply_keyboard_hide (struct paramed_type *T);
+int fetch_constructor_reply_keyboard_force_reply (struct paramed_type *T);
+int fetch_constructor_reply_keyboard_markup (struct paramed_type *T);
+int fetch_constructor_res_p_q (struct paramed_type *T);
+int fetch_constructor_send_message_typing_action (struct paramed_type *T);
+int fetch_constructor_send_message_cancel_action (struct paramed_type *T);
+int fetch_constructor_send_message_record_video_action (struct paramed_type *T);
+int fetch_constructor_send_message_upload_video_action_l27 (struct paramed_type *T);
+int fetch_constructor_send_message_upload_video_action (struct paramed_type *T);
+int fetch_constructor_send_message_record_audio_action (struct paramed_type *T);
+int fetch_constructor_send_message_upload_audio_action_l27 (struct paramed_type *T);
+int fetch_constructor_send_message_upload_audio_action (struct paramed_type *T);
+int fetch_constructor_send_message_upload_photo_action (struct paramed_type *T);
+int fetch_constructor_send_message_upload_document_action_l27 (struct paramed_type *T);
+int fetch_constructor_send_message_upload_document_action (struct paramed_type *T);
+int fetch_constructor_send_message_geo_location_action (struct paramed_type *T);
+int fetch_constructor_send_message_choose_contact_action (struct paramed_type *T);
+int fetch_constructor_server_d_h_params_fail (struct paramed_type *T);
+int fetch_constructor_server_d_h_params_ok (struct paramed_type *T);
+int fetch_constructor_server_d_h_inner_data (struct paramed_type *T);
+int fetch_constructor_dh_gen_ok (struct paramed_type *T);
+int fetch_constructor_dh_gen_retry (struct paramed_type *T);
+int fetch_constructor_dh_gen_fail (struct paramed_type *T);
+int fetch_constructor_sticker_pack (struct paramed_type *T);
+int fetch_constructor_sticker_set (struct paramed_type *T);
+int fetch_constructor_string (struct paramed_type *T);
+int fetch_constructor_update_new_message (struct paramed_type *T);
+int fetch_constructor_update_message_i_d (struct paramed_type *T);
+int fetch_constructor_update_delete_messages (struct paramed_type *T);
+int fetch_constructor_update_user_typing (struct paramed_type *T);
+int fetch_constructor_update_chat_user_typing (struct paramed_type *T);
+int fetch_constructor_update_chat_participants (struct paramed_type *T);
+int fetch_constructor_update_user_status (struct paramed_type *T);
+int fetch_constructor_update_user_name (struct paramed_type *T);
+int fetch_constructor_update_user_photo (struct paramed_type *T);
+int fetch_constructor_update_contact_registered (struct paramed_type *T);
+int fetch_constructor_update_contact_link (struct paramed_type *T);
+int fetch_constructor_update_new_authorization (struct paramed_type *T);
+int fetch_constructor_update_new_geo_chat_message (struct paramed_type *T);
+int fetch_constructor_update_new_encrypted_message (struct paramed_type *T);
+int fetch_constructor_update_encrypted_chat_typing (struct paramed_type *T);
+int fetch_constructor_update_encryption (struct paramed_type *T);
+int fetch_constructor_update_encrypted_messages_read (struct paramed_type *T);
+int fetch_constructor_update_chat_participant_add (struct paramed_type *T);
+int fetch_constructor_update_chat_participant_delete (struct paramed_type *T);
+int fetch_constructor_update_dc_options (struct paramed_type *T);
+int fetch_constructor_update_user_blocked (struct paramed_type *T);
+int fetch_constructor_update_notify_settings (struct paramed_type *T);
+int fetch_constructor_update_service_notification (struct paramed_type *T);
+int fetch_constructor_update_privacy (struct paramed_type *T);
+int fetch_constructor_update_user_phone (struct paramed_type *T);
+int fetch_constructor_update_read_history_inbox (struct paramed_type *T);
+int fetch_constructor_update_read_history_outbox (struct paramed_type *T);
+int fetch_constructor_update_web_page (struct paramed_type *T);
+int fetch_constructor_update_read_messages_contents (struct paramed_type *T);
+int fetch_constructor_update_msg_update (struct paramed_type *T);
+int fetch_constructor_updates_too_long (struct paramed_type *T);
+int fetch_constructor_update_short_message (struct paramed_type *T);
+int fetch_constructor_update_short_chat_message (struct paramed_type *T);
+int fetch_constructor_update_short (struct paramed_type *T);
+int fetch_constructor_updates_combined (struct paramed_type *T);
+int fetch_constructor_updates (struct paramed_type *T);
+int fetch_constructor_user_empty (struct paramed_type *T);
+int fetch_constructor_user (struct paramed_type *T);
+int fetch_constructor_user_full (struct paramed_type *T);
+int fetch_constructor_user_profile_photo_empty (struct paramed_type *T);
+int fetch_constructor_user_profile_photo (struct paramed_type *T);
+int fetch_constructor_user_status_empty (struct paramed_type *T);
+int fetch_constructor_user_status_online (struct paramed_type *T);
+int fetch_constructor_user_status_offline (struct paramed_type *T);
+int fetch_constructor_user_status_recently (struct paramed_type *T);
+int fetch_constructor_user_status_last_week (struct paramed_type *T);
+int fetch_constructor_user_status_last_month (struct paramed_type *T);
+int fetch_constructor_vector (struct paramed_type *T);
+int fetch_constructor_video_empty (struct paramed_type *T);
+int fetch_constructor_video (struct paramed_type *T);
+int fetch_constructor_video_l27 (struct paramed_type *T);
+int fetch_constructor_wall_paper (struct paramed_type *T);
+int fetch_constructor_wall_paper_solid (struct paramed_type *T);
+int fetch_constructor_web_page_empty (struct paramed_type *T);
+int fetch_constructor_web_page_pending (struct paramed_type *T);
+int fetch_constructor_web_page (struct paramed_type *T);
+int fetch_constructor_account_authorizations (struct paramed_type *T);
+int fetch_constructor_account_no_password (struct paramed_type *T);
+int fetch_constructor_account_password (struct paramed_type *T);
+int fetch_constructor_account_password_input_settings (struct paramed_type *T);
+int fetch_constructor_account_password_settings (struct paramed_type *T);
+int fetch_constructor_account_privacy_rules (struct paramed_type *T);
+int fetch_constructor_account_sent_change_phone_code (struct paramed_type *T);
+int fetch_constructor_auth_authorization (struct paramed_type *T);
+int fetch_constructor_auth_checked_phone (struct paramed_type *T);
+int fetch_constructor_auth_exported_authorization (struct paramed_type *T);
+int fetch_constructor_auth_password_recovery (struct paramed_type *T);
+int fetch_constructor_auth_sent_code (struct paramed_type *T);
+int fetch_constructor_auth_sent_app_code (struct paramed_type *T);
+int fetch_constructor_binlog_encr_key (struct paramed_type *T);
+int fetch_constructor_binlog_start (struct paramed_type *T);
+int fetch_constructor_binlog_dc_option (struct paramed_type *T);
+int fetch_constructor_binlog_dc_option_new (struct paramed_type *T);
+int fetch_constructor_binlog_auth_key (struct paramed_type *T);
+int fetch_constructor_binlog_default_dc (struct paramed_type *T);
+int fetch_constructor_binlog_dc_signed (struct paramed_type *T);
+int fetch_constructor_binlog_our_id (struct paramed_type *T);
+int fetch_constructor_binlog_set_dh_params (struct paramed_type *T);
+int fetch_constructor_binlog_set_pts (struct paramed_type *T);
+int fetch_constructor_binlog_set_qts (struct paramed_type *T);
+int fetch_constructor_binlog_set_date (struct paramed_type *T);
+int fetch_constructor_binlog_set_seq (struct paramed_type *T);
+int fetch_constructor_binlog_encr_chat_delete (struct paramed_type *T);
+int fetch_constructor_binlog_encr_chat_new (struct paramed_type *T);
+int fetch_constructor_binlog_encr_chat_exchange_new (struct paramed_type *T);
+int fetch_constructor_binlog_user_delete (struct paramed_type *T);
+int fetch_constructor_binlog_user_new (struct paramed_type *T);
+int fetch_constructor_binlog_chat_new (struct paramed_type *T);
+int fetch_constructor_binlog_chat_add_participant (struct paramed_type *T);
+int fetch_constructor_binlog_chat_del_participant (struct paramed_type *T);
+int fetch_constructor_binlog_set_msg_id (struct paramed_type *T);
+int fetch_constructor_binlog_message_delete (struct paramed_type *T);
+int fetch_constructor_binlog_message_new (struct paramed_type *T);
+int fetch_constructor_binlog_message_encr_new (struct paramed_type *T);
+int fetch_constructor_binlog_msg_update (struct paramed_type *T);
+int fetch_constructor_binlog_reset_authorization (struct paramed_type *T);
+int fetch_constructor_contacts_blocked (struct paramed_type *T);
+int fetch_constructor_contacts_blocked_slice (struct paramed_type *T);
+int fetch_constructor_contacts_contacts_not_modified (struct paramed_type *T);
+int fetch_constructor_contacts_contacts (struct paramed_type *T);
+int fetch_constructor_contacts_found (struct paramed_type *T);
+int fetch_constructor_contacts_imported_contacts (struct paramed_type *T);
+int fetch_constructor_contacts_link (struct paramed_type *T);
+int fetch_constructor_contacts_suggested (struct paramed_type *T);
+int fetch_constructor_geochats_located (struct paramed_type *T);
+int fetch_constructor_geochats_messages (struct paramed_type *T);
+int fetch_constructor_geochats_messages_slice (struct paramed_type *T);
+int fetch_constructor_geochats_stated_message (struct paramed_type *T);
+int fetch_constructor_help_app_update (struct paramed_type *T);
+int fetch_constructor_help_no_app_update (struct paramed_type *T);
+int fetch_constructor_help_invite_text (struct paramed_type *T);
+int fetch_constructor_help_support (struct paramed_type *T);
+int fetch_constructor_messages_affected_history (struct paramed_type *T);
+int fetch_constructor_messages_affected_messages (struct paramed_type *T);
+int fetch_constructor_messages_all_stickers_not_modified (struct paramed_type *T);
+int fetch_constructor_messages_all_stickers (struct paramed_type *T);
+int fetch_constructor_messages_chat_full (struct paramed_type *T);
+int fetch_constructor_messages_chats (struct paramed_type *T);
+int fetch_constructor_messages_dh_config_not_modified (struct paramed_type *T);
+int fetch_constructor_messages_dh_config (struct paramed_type *T);
+int fetch_constructor_messages_dialogs (struct paramed_type *T);
+int fetch_constructor_messages_dialogs_slice (struct paramed_type *T);
+int fetch_constructor_messages_message_empty (struct paramed_type *T);
+int fetch_constructor_messages_messages (struct paramed_type *T);
+int fetch_constructor_messages_messages_slice (struct paramed_type *T);
+int fetch_constructor_messages_sent_encrypted_message (struct paramed_type *T);
+int fetch_constructor_messages_sent_encrypted_file (struct paramed_type *T);
+int fetch_constructor_messages_sent_message (struct paramed_type *T);
+int fetch_constructor_messages_sent_message_link (struct paramed_type *T);
+int fetch_constructor_messages_sticker_set (struct paramed_type *T);
+int fetch_constructor_messages_stickers_not_modified (struct paramed_type *T);
+int fetch_constructor_messages_stickers (struct paramed_type *T);
+int fetch_constructor_photos_photo (struct paramed_type *T);
+int fetch_constructor_photos_photos (struct paramed_type *T);
+int fetch_constructor_photos_photos_slice (struct paramed_type *T);
+int fetch_constructor_storage_file_unknown (struct paramed_type *T);
+int fetch_constructor_storage_file_jpeg (struct paramed_type *T);
+int fetch_constructor_storage_file_gif (struct paramed_type *T);
+int fetch_constructor_storage_file_png (struct paramed_type *T);
+int fetch_constructor_storage_file_pdf (struct paramed_type *T);
+int fetch_constructor_storage_file_mp3 (struct paramed_type *T);
+int fetch_constructor_storage_file_mov (struct paramed_type *T);
+int fetch_constructor_storage_file_partial (struct paramed_type *T);
+int fetch_constructor_storage_file_mp4 (struct paramed_type *T);
+int fetch_constructor_storage_file_webp (struct paramed_type *T);
+int fetch_constructor_updates_difference_empty (struct paramed_type *T);
+int fetch_constructor_updates_difference (struct paramed_type *T);
+int fetch_constructor_updates_difference_slice (struct paramed_type *T);
+int fetch_constructor_updates_state (struct paramed_type *T);
+int fetch_constructor_upload_file (struct paramed_type *T);
+int fetch_type_account_days_t_t_l (struct paramed_type *T);
+int fetch_type_bare_account_days_t_t_l (struct paramed_type *T);
+int fetch_type_audio (struct paramed_type *T);
+int fetch_type_bare_audio (struct paramed_type *T);
+int fetch_type_authorization (struct paramed_type *T);
+int fetch_type_bare_authorization (struct paramed_type *T);
+int fetch_type_bool (struct paramed_type *T);
+int fetch_type_bare_bool (struct paramed_type *T);
+int fetch_type_bot_command (struct paramed_type *T);
+int fetch_type_bare_bot_command (struct paramed_type *T);
+int fetch_type_bot_info (struct paramed_type *T);
+int fetch_type_bare_bot_info (struct paramed_type *T);
+int fetch_type_bytes (struct paramed_type *T);
+int fetch_type_bare_bytes (struct paramed_type *T);
+int fetch_type_chat (struct paramed_type *T);
+int fetch_type_bare_chat (struct paramed_type *T);
+int fetch_type_chat_full (struct paramed_type *T);
+int fetch_type_bare_chat_full (struct paramed_type *T);
+int fetch_type_chat_invite (struct paramed_type *T);
+int fetch_type_bare_chat_invite (struct paramed_type *T);
+int fetch_type_chat_located (struct paramed_type *T);
+int fetch_type_bare_chat_located (struct paramed_type *T);
+int fetch_type_chat_participant (struct paramed_type *T);
+int fetch_type_bare_chat_participant (struct paramed_type *T);
+int fetch_type_chat_participants (struct paramed_type *T);
+int fetch_type_bare_chat_participants (struct paramed_type *T);
+int fetch_type_chat_photo (struct paramed_type *T);
+int fetch_type_bare_chat_photo (struct paramed_type *T);
+int fetch_type_client_d_h_inner_data (struct paramed_type *T);
+int fetch_type_bare_client_d_h_inner_data (struct paramed_type *T);
+int fetch_type_config (struct paramed_type *T);
+int fetch_type_bare_config (struct paramed_type *T);
+int fetch_type_contact (struct paramed_type *T);
+int fetch_type_bare_contact (struct paramed_type *T);
+int fetch_type_contact_blocked (struct paramed_type *T);
+int fetch_type_bare_contact_blocked (struct paramed_type *T);
+int fetch_type_contact_found (struct paramed_type *T);
+int fetch_type_bare_contact_found (struct paramed_type *T);
+int fetch_type_contact_link (struct paramed_type *T);
+int fetch_type_bare_contact_link (struct paramed_type *T);
+int fetch_type_contact_status (struct paramed_type *T);
+int fetch_type_bare_contact_status (struct paramed_type *T);
+int fetch_type_contact_suggested (struct paramed_type *T);
+int fetch_type_bare_contact_suggested (struct paramed_type *T);
+int fetch_type_dc_option (struct paramed_type *T);
+int fetch_type_bare_dc_option (struct paramed_type *T);
+int fetch_type_decrypted_message (struct paramed_type *T);
+int fetch_type_bare_decrypted_message (struct paramed_type *T);
+int fetch_type_decrypted_message_action (struct paramed_type *T);
+int fetch_type_bare_decrypted_message_action (struct paramed_type *T);
+int fetch_type_decrypted_message_layer (struct paramed_type *T);
+int fetch_type_bare_decrypted_message_layer (struct paramed_type *T);
+int fetch_type_decrypted_message_media (struct paramed_type *T);
+int fetch_type_bare_decrypted_message_media (struct paramed_type *T);
+int fetch_type_dialog (struct paramed_type *T);
+int fetch_type_bare_dialog (struct paramed_type *T);
+int fetch_type_disabled_feature (struct paramed_type *T);
+int fetch_type_bare_disabled_feature (struct paramed_type *T);
+int fetch_type_document (struct paramed_type *T);
+int fetch_type_bare_document (struct paramed_type *T);
+int fetch_type_document_attribute (struct paramed_type *T);
+int fetch_type_bare_document_attribute (struct paramed_type *T);
+int fetch_type_double (struct paramed_type *T);
+int fetch_type_bare_double (struct paramed_type *T);
+int fetch_type_encrypted_chat (struct paramed_type *T);
+int fetch_type_bare_encrypted_chat (struct paramed_type *T);
+int fetch_type_encrypted_file (struct paramed_type *T);
+int fetch_type_bare_encrypted_file (struct paramed_type *T);
+int fetch_type_encrypted_message (struct paramed_type *T);
+int fetch_type_bare_encrypted_message (struct paramed_type *T);
+int fetch_type_error (struct paramed_type *T);
+int fetch_type_bare_error (struct paramed_type *T);
+int fetch_type_exported_chat_invite (struct paramed_type *T);
+int fetch_type_bare_exported_chat_invite (struct paramed_type *T);
+int fetch_type_file_location (struct paramed_type *T);
+int fetch_type_bare_file_location (struct paramed_type *T);
+int fetch_type_geo_chat_message (struct paramed_type *T);
+int fetch_type_bare_geo_chat_message (struct paramed_type *T);
+int fetch_type_geo_point (struct paramed_type *T);
+int fetch_type_bare_geo_point (struct paramed_type *T);
+int fetch_type_imported_contact (struct paramed_type *T);
+int fetch_type_bare_imported_contact (struct paramed_type *T);
+int fetch_type_input_app_event (struct paramed_type *T);
+int fetch_type_bare_input_app_event (struct paramed_type *T);
+int fetch_type_input_audio (struct paramed_type *T);
+int fetch_type_bare_input_audio (struct paramed_type *T);
+int fetch_type_input_chat_photo (struct paramed_type *T);
+int fetch_type_bare_input_chat_photo (struct paramed_type *T);
+int fetch_type_input_contact (struct paramed_type *T);
+int fetch_type_bare_input_contact (struct paramed_type *T);
+int fetch_type_input_document (struct paramed_type *T);
+int fetch_type_bare_input_document (struct paramed_type *T);
+int fetch_type_input_encrypted_chat (struct paramed_type *T);
+int fetch_type_bare_input_encrypted_chat (struct paramed_type *T);
+int fetch_type_input_encrypted_file (struct paramed_type *T);
+int fetch_type_bare_input_encrypted_file (struct paramed_type *T);
+int fetch_type_input_file (struct paramed_type *T);
+int fetch_type_bare_input_file (struct paramed_type *T);
+int fetch_type_input_file_location (struct paramed_type *T);
+int fetch_type_bare_input_file_location (struct paramed_type *T);
+int fetch_type_input_geo_chat (struct paramed_type *T);
+int fetch_type_bare_input_geo_chat (struct paramed_type *T);
+int fetch_type_input_geo_point (struct paramed_type *T);
+int fetch_type_bare_input_geo_point (struct paramed_type *T);
+int fetch_type_input_media (struct paramed_type *T);
+int fetch_type_bare_input_media (struct paramed_type *T);
+int fetch_type_input_notify_peer (struct paramed_type *T);
+int fetch_type_bare_input_notify_peer (struct paramed_type *T);
+int fetch_type_input_peer (struct paramed_type *T);
+int fetch_type_bare_input_peer (struct paramed_type *T);
+int fetch_type_input_peer_notify_events (struct paramed_type *T);
+int fetch_type_bare_input_peer_notify_events (struct paramed_type *T);
+int fetch_type_input_peer_notify_settings (struct paramed_type *T);
+int fetch_type_bare_input_peer_notify_settings (struct paramed_type *T);
+int fetch_type_input_photo (struct paramed_type *T);
+int fetch_type_bare_input_photo (struct paramed_type *T);
+int fetch_type_input_photo_crop (struct paramed_type *T);
+int fetch_type_bare_input_photo_crop (struct paramed_type *T);
+int fetch_type_input_privacy_key (struct paramed_type *T);
+int fetch_type_bare_input_privacy_key (struct paramed_type *T);
+int fetch_type_input_privacy_rule (struct paramed_type *T);
+int fetch_type_bare_input_privacy_rule (struct paramed_type *T);
+int fetch_type_input_sticker_set (struct paramed_type *T);
+int fetch_type_bare_input_sticker_set (struct paramed_type *T);
+int fetch_type_input_user (struct paramed_type *T);
+int fetch_type_bare_input_user (struct paramed_type *T);
+int fetch_type_input_video (struct paramed_type *T);
+int fetch_type_bare_input_video (struct paramed_type *T);
+int fetch_type_int (struct paramed_type *T);
+int fetch_type_bare_int (struct paramed_type *T);
+int fetch_type_int128 (struct paramed_type *T);
+int fetch_type_bare_int128 (struct paramed_type *T);
+int fetch_type_int256 (struct paramed_type *T);
+int fetch_type_bare_int256 (struct paramed_type *T);
+int fetch_type_keyboard_button (struct paramed_type *T);
+int fetch_type_bare_keyboard_button (struct paramed_type *T);
+int fetch_type_keyboard_button_row (struct paramed_type *T);
+int fetch_type_bare_keyboard_button_row (struct paramed_type *T);
+int fetch_type_long (struct paramed_type *T);
+int fetch_type_bare_long (struct paramed_type *T);
+int fetch_type_message (struct paramed_type *T);
+int fetch_type_bare_message (struct paramed_type *T);
+int fetch_type_message_action (struct paramed_type *T);
+int fetch_type_bare_message_action (struct paramed_type *T);
+int fetch_type_message_media (struct paramed_type *T);
+int fetch_type_bare_message_media (struct paramed_type *T);
+int fetch_type_messages_filter (struct paramed_type *T);
+int fetch_type_bare_messages_filter (struct paramed_type *T);
+int fetch_type_nearest_dc (struct paramed_type *T);
+int fetch_type_bare_nearest_dc (struct paramed_type *T);
+int fetch_type_notify_peer (struct paramed_type *T);
+int fetch_type_bare_notify_peer (struct paramed_type *T);
+int fetch_type_null (struct paramed_type *T);
+int fetch_type_bare_null (struct paramed_type *T);
+int fetch_type_p_q_inner_data (struct paramed_type *T);
+int fetch_type_bare_p_q_inner_data (struct paramed_type *T);
+int fetch_type_peer (struct paramed_type *T);
+int fetch_type_bare_peer (struct paramed_type *T);
+int fetch_type_peer_notify_events (struct paramed_type *T);
+int fetch_type_bare_peer_notify_events (struct paramed_type *T);
+int fetch_type_peer_notify_settings (struct paramed_type *T);
+int fetch_type_bare_peer_notify_settings (struct paramed_type *T);
+int fetch_type_photo (struct paramed_type *T);
+int fetch_type_bare_photo (struct paramed_type *T);
+int fetch_type_photo_size (struct paramed_type *T);
+int fetch_type_bare_photo_size (struct paramed_type *T);
+int fetch_type_privacy_key (struct paramed_type *T);
+int fetch_type_bare_privacy_key (struct paramed_type *T);
+int fetch_type_privacy_rule (struct paramed_type *T);
+int fetch_type_bare_privacy_rule (struct paramed_type *T);
+int fetch_type_received_notify_message (struct paramed_type *T);
+int fetch_type_bare_received_notify_message (struct paramed_type *T);
+int fetch_type_reply_markup (struct paramed_type *T);
+int fetch_type_bare_reply_markup (struct paramed_type *T);
+int fetch_type_res_p_q (struct paramed_type *T);
+int fetch_type_bare_res_p_q (struct paramed_type *T);
+int fetch_type_send_message_action (struct paramed_type *T);
+int fetch_type_bare_send_message_action (struct paramed_type *T);
+int fetch_type_server_d_h_params (struct paramed_type *T);
+int fetch_type_bare_server_d_h_params (struct paramed_type *T);
+int fetch_type_server_d_h_inner_data (struct paramed_type *T);
+int fetch_type_bare_server_d_h_inner_data (struct paramed_type *T);
+int fetch_type_set_client_d_h_params_answer (struct paramed_type *T);
+int fetch_type_bare_set_client_d_h_params_answer (struct paramed_type *T);
+int fetch_type_sticker_pack (struct paramed_type *T);
+int fetch_type_bare_sticker_pack (struct paramed_type *T);
+int fetch_type_sticker_set (struct paramed_type *T);
+int fetch_type_bare_sticker_set (struct paramed_type *T);
+int fetch_type_string (struct paramed_type *T);
+int fetch_type_bare_string (struct paramed_type *T);
+int fetch_type_update (struct paramed_type *T);
+int fetch_type_bare_update (struct paramed_type *T);
+int fetch_type_updates (struct paramed_type *T);
+int fetch_type_bare_updates (struct paramed_type *T);
+int fetch_type_user (struct paramed_type *T);
+int fetch_type_bare_user (struct paramed_type *T);
+int fetch_type_user_full (struct paramed_type *T);
+int fetch_type_bare_user_full (struct paramed_type *T);
+int fetch_type_user_profile_photo (struct paramed_type *T);
+int fetch_type_bare_user_profile_photo (struct paramed_type *T);
+int fetch_type_user_status (struct paramed_type *T);
+int fetch_type_bare_user_status (struct paramed_type *T);
+int fetch_type_vector (struct paramed_type *T);
+int fetch_type_bare_vector (struct paramed_type *T);
+int fetch_type_video (struct paramed_type *T);
+int fetch_type_bare_video (struct paramed_type *T);
+int fetch_type_wall_paper (struct paramed_type *T);
+int fetch_type_bare_wall_paper (struct paramed_type *T);
+int fetch_type_web_page (struct paramed_type *T);
+int fetch_type_bare_web_page (struct paramed_type *T);
+int fetch_type_account_authorizations (struct paramed_type *T);
+int fetch_type_bare_account_authorizations (struct paramed_type *T);
+int fetch_type_account_password (struct paramed_type *T);
+int fetch_type_bare_account_password (struct paramed_type *T);
+int fetch_type_account_password_input_settings (struct paramed_type *T);
+int fetch_type_bare_account_password_input_settings (struct paramed_type *T);
+int fetch_type_account_password_settings (struct paramed_type *T);
+int fetch_type_bare_account_password_settings (struct paramed_type *T);
+int fetch_type_account_privacy_rules (struct paramed_type *T);
+int fetch_type_bare_account_privacy_rules (struct paramed_type *T);
+int fetch_type_account_sent_change_phone_code (struct paramed_type *T);
+int fetch_type_bare_account_sent_change_phone_code (struct paramed_type *T);
+int fetch_type_auth_authorization (struct paramed_type *T);
+int fetch_type_bare_auth_authorization (struct paramed_type *T);
+int fetch_type_auth_checked_phone (struct paramed_type *T);
+int fetch_type_bare_auth_checked_phone (struct paramed_type *T);
+int fetch_type_auth_exported_authorization (struct paramed_type *T);
+int fetch_type_bare_auth_exported_authorization (struct paramed_type *T);
+int fetch_type_auth_password_recovery (struct paramed_type *T);
+int fetch_type_bare_auth_password_recovery (struct paramed_type *T);
+int fetch_type_auth_sent_code (struct paramed_type *T);
+int fetch_type_bare_auth_sent_code (struct paramed_type *T);
+int fetch_type_binlog_encr_key (struct paramed_type *T);
+int fetch_type_bare_binlog_encr_key (struct paramed_type *T);
+int fetch_type_binlog_update (struct paramed_type *T);
+int fetch_type_bare_binlog_update (struct paramed_type *T);
+int fetch_type_contacts_blocked (struct paramed_type *T);
+int fetch_type_bare_contacts_blocked (struct paramed_type *T);
+int fetch_type_contacts_contacts (struct paramed_type *T);
+int fetch_type_bare_contacts_contacts (struct paramed_type *T);
+int fetch_type_contacts_found (struct paramed_type *T);
+int fetch_type_bare_contacts_found (struct paramed_type *T);
+int fetch_type_contacts_imported_contacts (struct paramed_type *T);
+int fetch_type_bare_contacts_imported_contacts (struct paramed_type *T);
+int fetch_type_contacts_link (struct paramed_type *T);
+int fetch_type_bare_contacts_link (struct paramed_type *T);
+int fetch_type_contacts_suggested (struct paramed_type *T);
+int fetch_type_bare_contacts_suggested (struct paramed_type *T);
+int fetch_type_geochats_located (struct paramed_type *T);
+int fetch_type_bare_geochats_located (struct paramed_type *T);
+int fetch_type_geochats_messages (struct paramed_type *T);
+int fetch_type_bare_geochats_messages (struct paramed_type *T);
+int fetch_type_geochats_stated_message (struct paramed_type *T);
+int fetch_type_bare_geochats_stated_message (struct paramed_type *T);
+int fetch_type_help_app_update (struct paramed_type *T);
+int fetch_type_bare_help_app_update (struct paramed_type *T);
+int fetch_type_help_invite_text (struct paramed_type *T);
+int fetch_type_bare_help_invite_text (struct paramed_type *T);
+int fetch_type_help_support (struct paramed_type *T);
+int fetch_type_bare_help_support (struct paramed_type *T);
+int fetch_type_messages_affected_history (struct paramed_type *T);
+int fetch_type_bare_messages_affected_history (struct paramed_type *T);
+int fetch_type_messages_affected_messages (struct paramed_type *T);
+int fetch_type_bare_messages_affected_messages (struct paramed_type *T);
+int fetch_type_messages_all_stickers (struct paramed_type *T);
+int fetch_type_bare_messages_all_stickers (struct paramed_type *T);
+int fetch_type_messages_chat_full (struct paramed_type *T);
+int fetch_type_bare_messages_chat_full (struct paramed_type *T);
+int fetch_type_messages_chats (struct paramed_type *T);
+int fetch_type_bare_messages_chats (struct paramed_type *T);
+int fetch_type_messages_dh_config (struct paramed_type *T);
+int fetch_type_bare_messages_dh_config (struct paramed_type *T);
+int fetch_type_messages_dialogs (struct paramed_type *T);
+int fetch_type_bare_messages_dialogs (struct paramed_type *T);
+int fetch_type_messages_message (struct paramed_type *T);
+int fetch_type_bare_messages_message (struct paramed_type *T);
+int fetch_type_messages_messages (struct paramed_type *T);
+int fetch_type_bare_messages_messages (struct paramed_type *T);
+int fetch_type_messages_sent_encrypted_message (struct paramed_type *T);
+int fetch_type_bare_messages_sent_encrypted_message (struct paramed_type *T);
+int fetch_type_messages_sent_message (struct paramed_type *T);
+int fetch_type_bare_messages_sent_message (struct paramed_type *T);
+int fetch_type_messages_sticker_set (struct paramed_type *T);
+int fetch_type_bare_messages_sticker_set (struct paramed_type *T);
+int fetch_type_messages_stickers (struct paramed_type *T);
+int fetch_type_bare_messages_stickers (struct paramed_type *T);
+int fetch_type_photos_photo (struct paramed_type *T);
+int fetch_type_bare_photos_photo (struct paramed_type *T);
+int fetch_type_photos_photos (struct paramed_type *T);
+int fetch_type_bare_photos_photos (struct paramed_type *T);
+int fetch_type_storage_file_type (struct paramed_type *T);
+int fetch_type_bare_storage_file_type (struct paramed_type *T);
+int fetch_type_updates_difference (struct paramed_type *T);
+int fetch_type_bare_updates_difference (struct paramed_type *T);
+int fetch_type_updates_state (struct paramed_type *T);
+int fetch_type_bare_updates_state (struct paramed_type *T);
+int fetch_type_upload_file (struct paramed_type *T);
+int fetch_type_bare_upload_file (struct paramed_type *T);
+int fetch_type_any (struct paramed_type *T);
diff --git a/protocols/Telegram/tgl/auto/auto-free-ds.c b/protocols/Telegram/tgl/auto/auto-free-ds.c
new file mode 100644
index 0000000000..1538633aff
--- /dev/null
+++ b/protocols/Telegram/tgl/auto/auto-free-ds.c
@@ -0,0 +1,9116 @@
+#ifdef _MSC_VER
+#include "..\auto.h"
+#include "auto-free-ds.h"
+#include "auto-skip.h"
+#include "auto-types.h"
+#include "..\auto-static-free-ds.c"
+#include "..\mtproto-common.h"
+#else
+#include "auto.h"
+#include "auto/auto-free-ds.h"
+#include "auto/auto-skip.h"
+#include "auto/auto-types.h"
+#include "auto-static-free-ds.c"
+#include "mtproto-common.h"
+#endif
+#include <assert.h>
+void free_ds_constructor_account_days_t_t_l (struct tl_ds_account_days_t_t_l *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb8d0afdf && T->type->name != 0x472f5020)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->days, field1);
+}
+void free_ds_constructor_audio_empty (struct tl_ds_audio *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fc5ec4e && T->type->name != 0x603a13b1)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+}
+void free_ds_constructor_audio (struct tl_ds_audio *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fc5ec4e && T->type->name != 0x603a13b1)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->duration, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->mime_type, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->size, field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->dc_id, field8);
+}
+void free_ds_constructor_authorization (struct tl_ds_authorization *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bf2e6f6 && T->type->name != 0x840d1909)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->hash, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->flags, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->device_model, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->platform, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->system_version, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->api_id, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->app_name, field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->app_version, field8);
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date_created, field9);
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date_active, field10);
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->ip, field11);
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->country, field12);
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->region, field13);
+}
+void free_ds_constructor_bool_false (struct tl_ds_bool *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x250be282 && T->type->name != 0xdaf41d7d)) { return; }
+}
+void free_ds_constructor_bool_true (struct tl_ds_bool *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x250be282 && T->type->name != 0xdaf41d7d)) { return; }
+}
+void free_ds_constructor_bot_command (struct tl_ds_bot_command *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x75e7ea6c && T->type->name != 0x8a181593)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->command, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->description, field2);
+}
+void free_ds_constructor_bot_command_old (struct tl_ds_bot_command *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x75e7ea6c && T->type->name != 0x8a181593)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->command, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->params, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->description, field3);
+}
+void free_ds_constructor_bot_info_empty (struct tl_ds_bot_info *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb2e16f93 && T->type->name != 0x4d1e906c)) { return; }
+}
+void free_ds_constructor_bot_info (struct tl_ds_bot_info *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb2e16f93 && T->type->name != 0x4d1e906c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->version, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->share_text, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->description, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x75e7ea6c, .id = "BotCommand", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->commands, field5);
+}
+void free_ds_constructor_bytes (struct tl_ds_string *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0ee1379f && T->type->name != 0xf11ec860)) { return; }
+ tfree (D->data, D->len + 1);
+ tfree (D, sizeof (*D));
+}
+void free_ds_constructor_chat_empty (struct tl_ds_chat *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field1);
+}
+void free_ds_constructor_chat (struct tl_ds_chat *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->title, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x56922676, .id = "ChatPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_chat_photo (D->photo, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->participants_count, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bool (D->left, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->version, field7);
+}
+void free_ds_constructor_chat_forbidden (struct tl_ds_chat *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->title, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field3);
+}
+void free_ds_constructor_geo_chat (struct tl_ds_chat *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->title, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->address, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->venue, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_geo_point (D->geo, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x56922676, .id = "ChatPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_chat_photo (D->photo, field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->participants_count, field8);
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field9);
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bool (D->checked_in, field10);
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->version, field11);
+}
+void free_ds_constructor_chat_full (struct tl_ds_chat_full *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02a614 && T->type->name != 0xd1fd59eb)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x77930f9f, .id = "ChatParticipants", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_chat_participants (D->participants, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_photo (D->chat_photo, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_peer_notify_settings (D->notify_settings, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f132d5, .id = "ExportedChatInvite", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_exported_chat_invite (D->exported_invite, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb2e16f93, .id = "BotInfo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->bot_info, field6);
+}
+void free_ds_constructor_chat_invite_already (struct tl_ds_chat_invite *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x94f910b1 && T->type->name != 0x6b06ef4e)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_chat (D->chat, field1);
+}
+void free_ds_constructor_chat_invite (struct tl_ds_chat_invite *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x94f910b1 && T->type->name != 0x6b06ef4e)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->title, field1);
+}
+void free_ds_constructor_chat_located (struct tl_ds_chat_located *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3631cf4c && T->type->name != 0xc9ce30b3)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->chat_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->distance, field2);
+}
+void free_ds_constructor_chat_participant (struct tl_ds_chat_participant *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc8d7493e && T->type->name != 0x3728b6c1)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->inviter_id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field3);
+}
+void free_ds_constructor_chat_participants_forbidden (struct tl_ds_chat_participants *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x77930f9f && T->type->name != 0x886cf060)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->chat_id, field1);
+}
+void free_ds_constructor_chat_participants (struct tl_ds_chat_participants *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x77930f9f && T->type->name != 0x886cf060)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->chat_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->admin_id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc8d7493e, .id = "ChatParticipant", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->participants, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->version, field4);
+}
+void free_ds_constructor_chat_photo_empty (struct tl_ds_chat_photo *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x56922676 && T->type->name != 0xa96dd989)) { return; }
+}
+void free_ds_constructor_chat_photo (struct tl_ds_chat_photo *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x56922676 && T->type->name != 0xa96dd989)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_file_location (D->photo_small, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_file_location (D->photo_big, field2);
+}
+void free_ds_constructor_client_d_h_inner_data (struct tl_ds_client_d_h_inner_data *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6643b654 && T->type->name != 0x99bc49ab)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int128 (D->nonce, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int128 (D->server_nonce, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->retry_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->g_b, field4);
+}
+void free_ds_constructor_config (struct tl_ds_config *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e32b894 && T->type->name != 0xb1cd476b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->expires, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bool (D->test_mode, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->this_dc, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2b1a62f0, .id = "DcOption", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->dc_options, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->chat_size_max, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->broadcast_size_max, field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->forwarded_count_max, field8);
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->online_update_period_ms, field9);
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->offline_blur_timeout_ms, field10);
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->offline_idle_timeout_ms, field11);
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->online_cloud_timeout_ms, field12);
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->notify_cloud_delay_ms, field13);
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->notify_default_delay_ms, field14);
+ struct paramed_type *field15 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->chat_big_size, field15);
+ struct paramed_type *field16 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->push_chat_period_ms, field16);
+ struct paramed_type *field17 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->push_chat_limit, field17);
+ struct paramed_type *field18 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xae636f24, .id = "DisabledFeature", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->disabled_features, field18);
+}
+void free_ds_constructor_contact (struct tl_ds_contact *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf911c994 && T->type->name != 0x06ee366b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bool (D->mutual, field2);
+}
+void free_ds_constructor_contact_blocked (struct tl_ds_contact_blocked *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x561bc879 && T->type->name != 0xa9e43786)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field2);
+}
+void free_ds_constructor_contact_found (struct tl_ds_contact_found *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xea879f95 && T->type->name != 0x1578606a)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field1);
+}
+void free_ds_constructor_contact_link_unknown (struct tl_ds_contact_link *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return; }
+}
+void free_ds_constructor_contact_link_none (struct tl_ds_contact_link *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return; }
+}
+void free_ds_constructor_contact_link_has_phone (struct tl_ds_contact_link *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return; }
+}
+void free_ds_constructor_contact_link_contact (struct tl_ds_contact_link *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return; }
+}
+void free_ds_constructor_contact_status (struct tl_ds_contact_status *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd3680c61 && T->type->name != 0x2c97f39e)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x76de9570, .id = "UserStatus", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_user_status (D->status, field2);
+}
+void free_ds_constructor_contact_suggested (struct tl_ds_contact_suggested *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3de191a1 && T->type->name != 0xc21e6e5e)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->mutual_contacts, field2);
+}
+void free_ds_constructor_dc_option_l28 (struct tl_ds_dc_option *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2b1a62f0 && T->type->name != 0xd4e59d0f)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->hostname, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->ip_address, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->port, field4);
+}
+void free_ds_constructor_dc_option (struct tl_ds_dc_option *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2b1a62f0 && T->type->name != 0xd4e59d0f)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->flags, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->ip_address, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->port, field4);
+}
+void free_ds_constructor_decrypted_message (struct tl_ds_decrypted_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x535b7918 && T->type->name != 0xaca486e7)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->random_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->ttl, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->message, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x34e0d674, .id = "DecryptedMessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_decrypted_message_media (D->media, field4);
+}
+void free_ds_constructor_decrypted_message_service (struct tl_ds_decrypted_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x535b7918 && T->type->name != 0xaca486e7)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->random_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4e0eefde, .id = "DecryptedMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_decrypted_message_action (D->action, field2);
+}
+void free_ds_constructor_decrypted_message_action_set_message_t_t_l (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->ttl_seconds, field1);
+}
+void free_ds_constructor_decrypted_message_action_read_messages (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->random_ids, field1);
+}
+void free_ds_constructor_decrypted_message_action_delete_messages (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->random_ids, field1);
+}
+void free_ds_constructor_decrypted_message_action_screenshot_messages (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->random_ids, field1);
+}
+void free_ds_constructor_decrypted_message_action_flush_history (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return; }
+}
+void free_ds_constructor_decrypted_message_action_resend (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->start_seq_no, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->end_seq_no, field2);
+}
+void free_ds_constructor_decrypted_message_action_notify_layer (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->layer, field1);
+}
+void free_ds_constructor_decrypted_message_action_typing (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x70541c7e, .id = "SendMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_send_message_action (D->action, field1);
+}
+void free_ds_constructor_decrypted_message_action_request_key (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->exchange_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->g_a, field2);
+}
+void free_ds_constructor_decrypted_message_action_accept_key (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->exchange_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->g_b, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->key_fingerprint, field3);
+}
+void free_ds_constructor_decrypted_message_action_abort_key (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->exchange_id, field1);
+}
+void free_ds_constructor_decrypted_message_action_commit_key (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->exchange_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->key_fingerprint, field2);
+}
+void free_ds_constructor_decrypted_message_action_noop (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return; }
+}
+void free_ds_constructor_decrypted_message_layer (struct tl_ds_decrypted_message_layer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1be31789 && T->type->name != 0xe41ce876)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->random_bytes, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->layer, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->in_seq_no, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->out_seq_no, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x535b7918, .id = "DecryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_decrypted_message (D->message, field5);
+}
+void free_ds_constructor_decrypted_message_media_empty (struct tl_ds_decrypted_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return; }
+}
+void free_ds_constructor_decrypted_message_media_photo (struct tl_ds_decrypted_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->str_thumb, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->thumb_w, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->thumb_h, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->w, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->h, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->size, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->key, field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->iv, field8);
+}
+void free_ds_constructor_decrypted_message_media_geo_point (struct tl_ds_decrypted_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_double (D->latitude, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_double (D->longitude, field2);
+}
+void free_ds_constructor_decrypted_message_media_contact (struct tl_ds_decrypted_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->phone_number, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->first_name, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->last_name, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field4);
+}
+void free_ds_constructor_decrypted_message_media_document (struct tl_ds_decrypted_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->str_thumb, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->thumb_w, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->thumb_h, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->file_name, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->mime_type, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->size, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->key, field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->iv, field8);
+}
+void free_ds_constructor_decrypted_message_media_video (struct tl_ds_decrypted_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->str_thumb, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->thumb_w, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->thumb_h, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->duration, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->mime_type, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->w, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->h, field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->size, field8);
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->key, field9);
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->iv, field10);
+}
+void free_ds_constructor_decrypted_message_media_audio (struct tl_ds_decrypted_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->duration, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->mime_type, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->size, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->key, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->iv, field5);
+}
+void free_ds_constructor_decrypted_message_media_external_document (struct tl_ds_decrypted_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->mime_type, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->size, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_photo_size (D->thumb, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->dc_id, field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->attributes, field8);
+}
+void free_ds_constructor_decrypted_message_media_video_l12 (struct tl_ds_decrypted_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->str_thumb, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->thumb_w, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->thumb_h, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->duration, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->w, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->h, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->size, field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->key, field8);
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->iv, field9);
+}
+void free_ds_constructor_decrypted_message_media_audio_l12 (struct tl_ds_decrypted_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->duration, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->size, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->key, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->iv, field4);
+}
+void free_ds_constructor_dialog (struct tl_ds_dialog *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc1dd804a && T->type->name != 0x3e227fb5)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_peer (D->peer, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->top_message, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->read_inbox_max_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->unread_count, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_peer_notify_settings (D->notify_settings, field5);
+}
+void free_ds_constructor_disabled_feature (struct tl_ds_disabled_feature *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xae636f24 && T->type->name != 0x519c90db)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->feature, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->description, field2);
+}
+void free_ds_constructor_document_empty (struct tl_ds_document *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x51a73418 && T->type->name != 0xae58cbe7)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+}
+void free_ds_constructor_document (struct tl_ds_document *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x51a73418 && T->type->name != 0xae58cbe7)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->mime_type, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->size, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_photo_size (D->thumb, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->dc_id, field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->attributes, field8);
+}
+void free_ds_constructor_document_l19 (struct tl_ds_document *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x51a73418 && T->type->name != 0xae58cbe7)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->file_name, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->mime_type, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->size, field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_photo_size (D->thumb, field8);
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->dc_id, field9);
+}
+void free_ds_constructor_document_attribute_image_size (struct tl_ds_document_attribute *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->w, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->h, field2);
+}
+void free_ds_constructor_document_attribute_animated (struct tl_ds_document_attribute *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return; }
+}
+void free_ds_constructor_document_attribute_sticker_l28 (struct tl_ds_document_attribute *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->alt, field1);
+}
+void free_ds_constructor_document_attribute_sticker (struct tl_ds_document_attribute *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->alt, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe44d415c, .id = "InputStickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_input_sticker_set (D->stickerset, field2);
+}
+void free_ds_constructor_document_attribute_video (struct tl_ds_document_attribute *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->duration, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->w, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->h, field3);
+}
+void free_ds_constructor_document_attribute_audio (struct tl_ds_document_attribute *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->duration, field1);
+}
+void free_ds_constructor_document_attribute_filename (struct tl_ds_document_attribute *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->file_name, field1);
+}
+void free_ds_constructor_double (double *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2210c154 && T->type->name != 0xddef3eab)) { return; }
+ tfree (D, sizeof (*D));
+}
+void free_ds_constructor_encrypted_chat_empty (struct tl_ds_encrypted_chat *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field1);
+}
+void free_ds_constructor_encrypted_chat_waiting (struct tl_ds_encrypted_chat *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->admin_id, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->participant_id, field5);
+}
+void free_ds_constructor_encrypted_chat_requested (struct tl_ds_encrypted_chat *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->admin_id, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->participant_id, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->g_a, field6);
+}
+void free_ds_constructor_encrypted_chat (struct tl_ds_encrypted_chat *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->admin_id, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->participant_id, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->g_a_or_b, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->key_fingerprint, field7);
+}
+void free_ds_constructor_encrypted_chat_discarded (struct tl_ds_encrypted_chat *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field1);
+}
+void free_ds_constructor_encrypted_file_empty (struct tl_ds_encrypted_file *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x886fd032 && T->type->name != 0x77902fcd)) { return; }
+}
+void free_ds_constructor_encrypted_file (struct tl_ds_encrypted_file *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x886fd032 && T->type->name != 0x77902fcd)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->size, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->dc_id, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->key_fingerprint, field5);
+}
+void free_ds_constructor_encrypted_message (struct tl_ds_encrypted_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xce6b8a1e && T->type->name != 0x319475e1)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->random_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->chat_id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->bytes, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x886fd032, .id = "EncryptedFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_encrypted_file (D->file, field5);
+}
+void free_ds_constructor_encrypted_message_service (struct tl_ds_encrypted_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xce6b8a1e && T->type->name != 0x319475e1)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->random_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->chat_id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->bytes, field4);
+}
+void free_ds_constructor_error (struct tl_ds_error *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc4b9f9bb && T->type->name != 0x3b460644)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->code, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->text, field2);
+}
+void free_ds_constructor_chat_invite_empty (struct tl_ds_exported_chat_invite *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f132d5 && T->type->name != 0x6a0ecd2a)) { return; }
+}
+void free_ds_constructor_chat_invite_exported (struct tl_ds_exported_chat_invite *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f132d5 && T->type->name != 0x6a0ecd2a)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->link, field1);
+}
+void free_ds_constructor_file_location_unavailable (struct tl_ds_file_location *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2f8ffb30 && T->type->name != 0xd07004cf)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->volume_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->local_id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->secret, field3);
+}
+void free_ds_constructor_file_location (struct tl_ds_file_location *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2f8ffb30 && T->type->name != 0xd07004cf)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->dc_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->volume_id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->local_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->secret, field4);
+}
+void free_ds_constructor_geo_chat_message_empty (struct tl_ds_geo_chat_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf67b4034 && T->type->name != 0x0984bfcb)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->chat_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field2);
+}
+void free_ds_constructor_geo_chat_message (struct tl_ds_geo_chat_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf67b4034 && T->type->name != 0x0984bfcb)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->chat_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->from_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->message, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_message_media (D->media, field6);
+}
+void free_ds_constructor_geo_chat_message_service (struct tl_ds_geo_chat_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf67b4034 && T->type->name != 0x0984bfcb)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->chat_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->from_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x383415fa, .id = "MessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_message_action (D->action, field5);
+}
+void free_ds_constructor_geo_point_empty (struct tl_ds_geo_point *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x315e0a53 && T->type->name != 0xcea1f5ac)) { return; }
+}
+void free_ds_constructor_geo_point (struct tl_ds_geo_point *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x315e0a53 && T->type->name != 0xcea1f5ac)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_double (D->longitude, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_double (D->latitude, field2);
+}
+void free_ds_constructor_imported_contact (struct tl_ds_imported_contact *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd0028438 && T->type->name != 0x2ffd7bc7)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->client_id, field2);
+}
+void free_ds_constructor_input_app_event (struct tl_ds_input_app_event *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x770656a8 && T->type->name != 0x88f9a957)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_double (D->time, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->type, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->peer, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->data, field4);
+}
+void free_ds_constructor_input_audio_empty (struct tl_ds_input_audio *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xae8e9c7b && T->type->name != 0x51716384)) { return; }
+}
+void free_ds_constructor_input_audio (struct tl_ds_input_audio *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xae8e9c7b && T->type->name != 0x51716384)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field2);
+}
+void free_ds_constructor_input_chat_photo_empty (struct tl_ds_input_chat_photo *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3a60776d && T->type->name != 0xc59f8892)) { return; }
+}
+void free_ds_constructor_input_chat_uploaded_photo (struct tl_ds_input_chat_photo *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3a60776d && T->type->name != 0xc59f8892)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_input_file (D->file, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7477e321, .id = "InputPhotoCrop", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_input_photo_crop (D->crop, field2);
+}
+void free_ds_constructor_input_chat_photo (struct tl_ds_input_chat_photo *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3a60776d && T->type->name != 0xc59f8892)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe74279c9, .id = "InputPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_input_photo (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7477e321, .id = "InputPhotoCrop", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_input_photo_crop (D->crop, field2);
+}
+void free_ds_constructor_input_phone_contact (struct tl_ds_input_contact *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf392b7f4 && T->type->name != 0x0c6d480b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->client_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->phone, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->first_name, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->last_name, field4);
+}
+void free_ds_constructor_input_document_empty (struct tl_ds_input_document *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6a8963fc && T->type->name != 0x95769c03)) { return; }
+}
+void free_ds_constructor_input_document (struct tl_ds_input_document *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6a8963fc && T->type->name != 0x95769c03)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field2);
+}
+void free_ds_constructor_input_encrypted_chat (struct tl_ds_input_encrypted_chat *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf141b5e1 && T->type->name != 0x0ebe4a1e)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->chat_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field2);
+}
+void free_ds_constructor_input_encrypted_file_empty (struct tl_ds_input_encrypted_file *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return; }
+}
+void free_ds_constructor_input_encrypted_file_uploaded (struct tl_ds_input_encrypted_file *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->parts, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->md5_checksum, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->key_fingerprint, field4);
+}
+void free_ds_constructor_input_encrypted_file (struct tl_ds_input_encrypted_file *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field2);
+}
+void free_ds_constructor_input_encrypted_file_big_uploaded (struct tl_ds_input_encrypted_file *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->parts, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->key_fingerprint, field3);
+}
+void free_ds_constructor_input_file (struct tl_ds_input_file *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0f60f9ca && T->type->name != 0xf09f0635)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->parts, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->name, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->md5_checksum, field4);
+}
+void free_ds_constructor_input_file_big (struct tl_ds_input_file *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0f60f9ca && T->type->name != 0xf09f0635)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->parts, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->name, field3);
+}
+void free_ds_constructor_input_file_location (struct tl_ds_input_file_location *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->volume_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->local_id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->secret, field3);
+}
+void free_ds_constructor_input_video_file_location (struct tl_ds_input_file_location *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field2);
+}
+void free_ds_constructor_input_encrypted_file_location (struct tl_ds_input_file_location *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field2);
+}
+void free_ds_constructor_input_audio_file_location (struct tl_ds_input_file_location *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field2);
+}
+void free_ds_constructor_input_document_file_location (struct tl_ds_input_file_location *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field2);
+}
+void free_ds_constructor_input_geo_chat (struct tl_ds_input_geo_chat *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x74d456fa && T->type->name != 0x8b2ba905)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->chat_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field2);
+}
+void free_ds_constructor_input_geo_point_empty (struct tl_ds_input_geo_point *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17768f1f && T->type->name != 0xe88970e0)) { return; }
+}
+void free_ds_constructor_input_geo_point (struct tl_ds_input_geo_point *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17768f1f && T->type->name != 0xe88970e0)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_double (D->latitude, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_double (D->longitude, field2);
+}
+void free_ds_constructor_input_media_empty (struct tl_ds_input_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return; }
+}
+void free_ds_constructor_input_media_uploaded_photo (struct tl_ds_input_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_input_file (D->file, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->caption, field2);
+}
+void free_ds_constructor_input_media_photo (struct tl_ds_input_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe74279c9, .id = "InputPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_input_photo (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->caption, field2);
+}
+void free_ds_constructor_input_media_geo_point (struct tl_ds_input_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17768f1f, .id = "InputGeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_input_geo_point (D->geo_point, field1);
+}
+void free_ds_constructor_input_media_contact (struct tl_ds_input_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->phone_number, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->first_name, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->last_name, field3);
+}
+void free_ds_constructor_input_media_uploaded_video (struct tl_ds_input_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_input_file (D->file, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->duration, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->w, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->h, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->caption, field5);
+}
+void free_ds_constructor_input_media_uploaded_thumb_video (struct tl_ds_input_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_input_file (D->file, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_input_file (D->thumb, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->duration, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->w, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->h, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->caption, field6);
+}
+void free_ds_constructor_input_media_video (struct tl_ds_input_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xbb5f7a27, .id = "InputVideo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_input_video (D->video_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->caption, field2);
+}
+void free_ds_constructor_input_media_uploaded_audio (struct tl_ds_input_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_input_file (D->file, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->duration, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->mime_type, field3);
+}
+void free_ds_constructor_input_media_audio (struct tl_ds_input_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xae8e9c7b, .id = "InputAudio", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_input_audio (D->audio_id, field1);
+}
+void free_ds_constructor_input_media_uploaded_document (struct tl_ds_input_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_input_file (D->file, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->mime_type, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->attributes, field3);
+}
+void free_ds_constructor_input_media_uploaded_thumb_document (struct tl_ds_input_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_input_file (D->file, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_input_file (D->thumb, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->mime_type, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->attributes, field4);
+}
+void free_ds_constructor_input_media_document (struct tl_ds_input_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x6a8963fc, .id = "InputDocument", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_input_document (D->document_id, field1);
+}
+void free_ds_constructor_input_media_venue (struct tl_ds_input_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17768f1f, .id = "InputGeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_input_geo_point (D->geo_point, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->title, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->address, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->provider, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->venue_id, field5);
+}
+void free_ds_constructor_input_notify_peer (struct tl_ds_input_notify_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9e67268d, .id = "InputPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_input_peer (D->peer, field1);
+}
+void free_ds_constructor_input_notify_users (struct tl_ds_input_notify_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return; }
+}
+void free_ds_constructor_input_notify_chats (struct tl_ds_input_notify_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return; }
+}
+void free_ds_constructor_input_notify_all (struct tl_ds_input_notify_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return; }
+}
+void free_ds_constructor_input_notify_geo_chat_peer (struct tl_ds_input_notify_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x74d456fa, .id = "InputGeoChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_input_geo_chat (D->geo_peer, field1);
+}
+void free_ds_constructor_input_peer_empty (struct tl_ds_input_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return; }
+}
+void free_ds_constructor_input_peer_self (struct tl_ds_input_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return; }
+}
+void free_ds_constructor_input_peer_contact (struct tl_ds_input_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field1);
+}
+void free_ds_constructor_input_peer_foreign (struct tl_ds_input_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field2);
+}
+void free_ds_constructor_input_peer_chat (struct tl_ds_input_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->chat_id, field1);
+}
+void free_ds_constructor_input_peer_notify_events_empty (struct tl_ds_input_peer_notify_events *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x185a48ac && T->type->name != 0xe7a5b753)) { return; }
+}
+void free_ds_constructor_input_peer_notify_events_all (struct tl_ds_input_peer_notify_events *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x185a48ac && T->type->name != 0xe7a5b753)) { return; }
+}
+void free_ds_constructor_input_peer_notify_settings (struct tl_ds_input_peer_notify_settings *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x46a2ce98 && T->type->name != 0xb95d3167)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->mute_until, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->sound, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bool (D->show_previews, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->events_mask, field4);
+}
+void free_ds_constructor_input_photo_empty (struct tl_ds_input_photo *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe74279c9 && T->type->name != 0x18bd8636)) { return; }
+}
+void free_ds_constructor_input_photo (struct tl_ds_input_photo *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe74279c9 && T->type->name != 0x18bd8636)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field2);
+}
+void free_ds_constructor_input_photo_crop_auto (struct tl_ds_input_photo_crop *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7477e321 && T->type->name != 0x8b881cde)) { return; }
+}
+void free_ds_constructor_input_photo_crop (struct tl_ds_input_photo_crop *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7477e321 && T->type->name != 0x8b881cde)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_double (D->crop_left, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_double (D->crop_top, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_double (D->crop_width, field3);
+}
+void free_ds_constructor_input_privacy_key_status_timestamp (struct tl_ds_input_privacy_key *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4f96cb18 && T->type->name != 0xb06934e7)) { return; }
+}
+void free_ds_constructor_input_privacy_value_allow_contacts (struct tl_ds_input_privacy_rule *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return; }
+}
+void free_ds_constructor_input_privacy_value_allow_all (struct tl_ds_input_privacy_rule *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return; }
+}
+void free_ds_constructor_input_privacy_value_allow_users (struct tl_ds_input_privacy_rule *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->users, field1);
+}
+void free_ds_constructor_input_privacy_value_disallow_contacts (struct tl_ds_input_privacy_rule *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return; }
+}
+void free_ds_constructor_input_privacy_value_disallow_all (struct tl_ds_input_privacy_rule *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return; }
+}
+void free_ds_constructor_input_privacy_value_disallow_users (struct tl_ds_input_privacy_rule *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->users, field1);
+}
+void free_ds_constructor_input_sticker_set_empty (struct tl_ds_input_sticker_set *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe44d415c && T->type->name != 0x1bb2bea3)) { return; }
+}
+void free_ds_constructor_input_sticker_set_i_d (struct tl_ds_input_sticker_set *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe44d415c && T->type->name != 0x1bb2bea3)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field2);
+}
+void free_ds_constructor_input_sticker_set_short_name (struct tl_ds_input_sticker_set *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe44d415c && T->type->name != 0x1bb2bea3)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->short_name, field1);
+}
+void free_ds_constructor_input_user_empty (struct tl_ds_input_user *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return; }
+}
+void free_ds_constructor_input_user_self (struct tl_ds_input_user *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return; }
+}
+void free_ds_constructor_input_user_contact (struct tl_ds_input_user *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field1);
+}
+void free_ds_constructor_input_user_foreign (struct tl_ds_input_user *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field2);
+}
+void free_ds_constructor_input_video_empty (struct tl_ds_input_video *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbb5f7a27 && T->type->name != 0x44a085d8)) { return; }
+}
+void free_ds_constructor_input_video (struct tl_ds_input_video *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbb5f7a27 && T->type->name != 0x44a085d8)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field2);
+}
+void free_ds_constructor_int (int *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8509bda && T->type->name != 0x57af6425)) { return; }
+ tfree (D, sizeof (*D));
+}
+void free_ds_constructor_int128 (struct tl_ds_int128 *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7d36c439 && T->type->name != 0x82c93bc6)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->f0, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->f1, field2);
+}
+void free_ds_constructor_int256 (struct tl_ds_int256 *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf2c798b3 && T->type->name != 0x0d38674c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->f0, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->f1, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->f2, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->f3, field4);
+}
+void free_ds_constructor_keyboard_button (struct tl_ds_keyboard_button *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa2fa4880 && T->type->name != 0x5d05b77f)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->text, field1);
+}
+void free_ds_constructor_keyboard_button_row (struct tl_ds_keyboard_button_row *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x77608b83 && T->type->name != 0x889f747c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa2fa4880, .id = "KeyboardButton", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->buttons, field1);
+}
+void free_ds_constructor_long (long long *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22076cba && T->type->name != 0xddf89345)) { return; }
+ tfree (D, sizeof (*D));
+}
+void free_ds_constructor_message_empty (struct tl_ds_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5d652a7f && T->type->name != 0xa29ad580)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field1);
+}
+void free_ds_constructor_message (struct tl_ds_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5d652a7f && T->type->name != 0xa29ad580)) { return; }
+ struct paramed_type *var0 = INT2PTR (*D->flags);
+ tfree (D->flags, sizeof (*D->flags));
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->from_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_peer (D->to_id, field4);
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->fwd_from_id, field5);
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->fwd_date, field6);
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->reply_to_msg_id, field7);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field8);
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->message, field9);
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_message_media (D->media, field10);
+ if (PTR2INT (var0) & (1 << 6)) {
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x612ca4a9, .id = "ReplyMarkup", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_reply_markup (D->reply_markup, field11);
+ }
+}
+void free_ds_constructor_message_service (struct tl_ds_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5d652a7f && T->type->name != 0xa29ad580)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->flags, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->from_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_peer (D->to_id, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x383415fa, .id = "MessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_message_action (D->action, field6);
+}
+void free_ds_constructor_message_action_empty (struct tl_ds_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return; }
+}
+void free_ds_constructor_message_action_chat_create (struct tl_ds_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->title, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->users, field2);
+}
+void free_ds_constructor_message_action_chat_edit_title (struct tl_ds_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->title, field1);
+}
+void free_ds_constructor_message_action_chat_edit_photo (struct tl_ds_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_photo (D->photo, field1);
+}
+void free_ds_constructor_message_action_chat_delete_photo (struct tl_ds_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return; }
+}
+void free_ds_constructor_message_action_chat_add_user (struct tl_ds_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field1);
+}
+void free_ds_constructor_message_action_chat_delete_user (struct tl_ds_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field1);
+}
+void free_ds_constructor_message_action_geo_chat_create (struct tl_ds_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->title, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->address, field2);
+}
+void free_ds_constructor_message_action_geo_chat_checkin (struct tl_ds_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return; }
+}
+void free_ds_constructor_message_action_chat_joined_by_link (struct tl_ds_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->inviter_id, field1);
+}
+void free_ds_constructor_message_media_empty (struct tl_ds_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return; }
+}
+void free_ds_constructor_message_media_photo (struct tl_ds_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_photo (D->photo, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->caption, field2);
+}
+void free_ds_constructor_message_media_video (struct tl_ds_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1716b174, .id = "Video", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_video (D->video, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->caption, field2);
+}
+void free_ds_constructor_message_media_geo (struct tl_ds_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_geo_point (D->geo, field1);
+}
+void free_ds_constructor_message_media_contact (struct tl_ds_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->phone_number, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->first_name, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->last_name, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field4);
+}
+void free_ds_constructor_message_media_unsupported (struct tl_ds_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return; }
+}
+void free_ds_constructor_message_media_document (struct tl_ds_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_document (D->document, field1);
+}
+void free_ds_constructor_message_media_audio (struct tl_ds_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9fc5ec4e, .id = "Audio", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_audio (D->audio, field1);
+}
+void free_ds_constructor_message_media_web_page (struct tl_ds_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x8d8c0d41, .id = "WebPage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_web_page (D->webpage, field1);
+}
+void free_ds_constructor_message_media_venue (struct tl_ds_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_geo_point (D->geo, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->title, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->address, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->provider, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->venue_id, field5);
+}
+void free_ds_constructor_message_media_photo_l27 (struct tl_ds_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_photo (D->photo, field1);
+}
+void free_ds_constructor_message_media_video_l27 (struct tl_ds_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1716b174, .id = "Video", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_video (D->video, field1);
+}
+void free_ds_constructor_input_messages_filter_empty (struct tl_ds_messages_filter *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return; }
+}
+void free_ds_constructor_input_messages_filter_photos (struct tl_ds_messages_filter *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return; }
+}
+void free_ds_constructor_input_messages_filter_video (struct tl_ds_messages_filter *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return; }
+}
+void free_ds_constructor_input_messages_filter_photo_video (struct tl_ds_messages_filter *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return; }
+}
+void free_ds_constructor_input_messages_filter_photo_video_documents (struct tl_ds_messages_filter *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return; }
+}
+void free_ds_constructor_input_messages_filter_document (struct tl_ds_messages_filter *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return; }
+}
+void free_ds_constructor_input_messages_filter_audio (struct tl_ds_messages_filter *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return; }
+}
+void free_ds_constructor_nearest_dc (struct tl_ds_nearest_dc *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8e1a1775 && T->type->name != 0x71e5e88a)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->country, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->this_dc, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->nearest_dc, field3);
+}
+void free_ds_constructor_notify_peer (struct tl_ds_notify_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_peer (D->peer, field1);
+}
+void free_ds_constructor_notify_users (struct tl_ds_notify_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return; }
+}
+void free_ds_constructor_notify_chats (struct tl_ds_notify_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return; }
+}
+void free_ds_constructor_notify_all (struct tl_ds_notify_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return; }
+}
+void free_ds_constructor_null (struct tl_ds_null *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x56730bcc && T->type->name != 0xa98cf433)) { return; }
+}
+void free_ds_constructor_p_q_inner_data (struct tl_ds_p_q_inner_data *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbfa3de38 && T->type->name != 0x405c21c7)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->pq, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->p, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->q, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int128 (D->nonce, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int128 (D->server_nonce, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0d38674c, .id = "Bare_Int256", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int256 (D->new_nonce, field6);
+}
+void free_ds_constructor_p_q_inner_data_temp (struct tl_ds_p_q_inner_data *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbfa3de38 && T->type->name != 0x405c21c7)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->pq, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->p, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->q, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int128 (D->nonce, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int128 (D->server_nonce, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0d38674c, .id = "Bare_Int256", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int256 (D->new_nonce, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->expires_in, field7);
+}
+void free_ds_constructor_peer_user (struct tl_ds_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x276159d6 && T->type->name != 0xd89ea629)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field1);
+}
+void free_ds_constructor_peer_chat (struct tl_ds_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x276159d6 && T->type->name != 0xd89ea629)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->chat_id, field1);
+}
+void free_ds_constructor_peer_notify_events_empty (struct tl_ds_peer_notify_events *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc0c8d13b && T->type->name != 0x3f372ec4)) { return; }
+}
+void free_ds_constructor_peer_notify_events_all (struct tl_ds_peer_notify_events *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc0c8d13b && T->type->name != 0x3f372ec4)) { return; }
+}
+void free_ds_constructor_peer_notify_settings_empty (struct tl_ds_peer_notify_settings *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xfdf894fc && T->type->name != 0x02076b03)) { return; }
+}
+void free_ds_constructor_peer_notify_settings (struct tl_ds_peer_notify_settings *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xfdf894fc && T->type->name != 0x02076b03)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->mute_until, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->sound, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bool (D->show_previews, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->events_mask, field4);
+}
+void free_ds_constructor_photo_empty (struct tl_ds_photo *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc207550a && T->type->name != 0x3df8aaf5)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+}
+void free_ds_constructor_photo (struct tl_ds_photo *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc207550a && T->type->name != 0x3df8aaf5)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_geo_point (D->geo, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->sizes, field6);
+}
+void free_ds_constructor_photo_l27 (struct tl_ds_photo *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc207550a && T->type->name != 0x3df8aaf5)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->caption, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_geo_point (D->geo, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->sizes, field7);
+}
+void free_ds_constructor_photo_size_empty (struct tl_ds_photo_size *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x900f60dd && T->type->name != 0x6ff09f22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->type, field1);
+}
+void free_ds_constructor_photo_size (struct tl_ds_photo_size *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x900f60dd && T->type->name != 0x6ff09f22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->type, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_file_location (D->location, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->w, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->h, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->size, field5);
+}
+void free_ds_constructor_photo_cached_size (struct tl_ds_photo_size *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x900f60dd && T->type->name != 0x6ff09f22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->type, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_file_location (D->location, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->w, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->h, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->bytes, field5);
+}
+void free_ds_constructor_privacy_key_status_timestamp (struct tl_ds_privacy_key *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbc2eab30 && T->type->name != 0x43d154cf)) { return; }
+}
+void free_ds_constructor_privacy_value_allow_contacts (struct tl_ds_privacy_rule *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return; }
+}
+void free_ds_constructor_privacy_value_allow_all (struct tl_ds_privacy_rule *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return; }
+}
+void free_ds_constructor_privacy_value_allow_users (struct tl_ds_privacy_rule *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->users, field1);
+}
+void free_ds_constructor_privacy_value_disallow_contacts (struct tl_ds_privacy_rule *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return; }
+}
+void free_ds_constructor_privacy_value_disallow_all (struct tl_ds_privacy_rule *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return; }
+}
+void free_ds_constructor_privacy_value_disallow_users (struct tl_ds_privacy_rule *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->users, field1);
+}
+void free_ds_constructor_received_notify_message (struct tl_ds_received_notify_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa384b779 && T->type->name != 0x5c7b4886)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->flags, field2);
+}
+void free_ds_constructor_reply_keyboard_hide (struct tl_ds_reply_markup *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x612ca4a9 && T->type->name != 0x9ed35b56)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->flags, field1);
+}
+void free_ds_constructor_reply_keyboard_force_reply (struct tl_ds_reply_markup *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x612ca4a9 && T->type->name != 0x9ed35b56)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->flags, field1);
+}
+void free_ds_constructor_reply_keyboard_markup (struct tl_ds_reply_markup *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x612ca4a9 && T->type->name != 0x9ed35b56)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->flags, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x77608b83, .id = "KeyboardButtonRow", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->rows, field2);
+}
+void free_ds_constructor_res_p_q (struct tl_ds_res_p_q *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x05162463 && T->type->name != 0xfae9db9c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int128 (D->nonce, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int128 (D->server_nonce, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->pq, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->server_public_key_fingerprints, field4);
+}
+void free_ds_constructor_send_message_typing_action (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return; }
+}
+void free_ds_constructor_send_message_cancel_action (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return; }
+}
+void free_ds_constructor_send_message_record_video_action (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return; }
+}
+void free_ds_constructor_send_message_upload_video_action_l27 (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return; }
+}
+void free_ds_constructor_send_message_upload_video_action (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->progress, field1);
+}
+void free_ds_constructor_send_message_record_audio_action (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return; }
+}
+void free_ds_constructor_send_message_upload_audio_action_l27 (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return; }
+}
+void free_ds_constructor_send_message_upload_audio_action (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->progress, field1);
+}
+void free_ds_constructor_send_message_upload_photo_action (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->progress, field1);
+}
+void free_ds_constructor_send_message_upload_document_action_l27 (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return; }
+}
+void free_ds_constructor_send_message_upload_document_action (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->progress, field1);
+}
+void free_ds_constructor_send_message_geo_location_action (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return; }
+}
+void free_ds_constructor_send_message_choose_contact_action (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return; }
+}
+void free_ds_constructor_server_d_h_params_fail (struct tl_ds_server_d_h_params *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa9230301 && T->type->name != 0x56dcfcfe)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int128 (D->nonce, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int128 (D->server_nonce, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int128 (D->new_nonce_hash, field3);
+}
+void free_ds_constructor_server_d_h_params_ok (struct tl_ds_server_d_h_params *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa9230301 && T->type->name != 0x56dcfcfe)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int128 (D->nonce, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int128 (D->server_nonce, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->encrypted_answer, field3);
+}
+void free_ds_constructor_server_d_h_inner_data (struct tl_ds_server_d_h_inner_data *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb5890dba && T->type->name != 0x4a76f245)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int128 (D->nonce, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int128 (D->server_nonce, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->g, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->dh_prime, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->g_a, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->server_time, field6);
+}
+void free_ds_constructor_dh_gen_ok (struct tl_ds_set_client_d_h_params_answer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdb8a468f && T->type->name != 0x2475b970)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int128 (D->nonce, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int128 (D->server_nonce, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int128 (D->new_nonce_hash1, field3);
+}
+void free_ds_constructor_dh_gen_retry (struct tl_ds_set_client_d_h_params_answer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdb8a468f && T->type->name != 0x2475b970)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int128 (D->nonce, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int128 (D->server_nonce, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int128 (D->new_nonce_hash2, field3);
+}
+void free_ds_constructor_dh_gen_fail (struct tl_ds_set_client_d_h_params_answer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdb8a468f && T->type->name != 0x2475b970)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int128 (D->nonce, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int128 (D->server_nonce, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int128 (D->new_nonce_hash3, field3);
+}
+void free_ds_constructor_sticker_pack (struct tl_ds_sticker_pack *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x12b299d4 && T->type->name != 0xed4d662b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->emoticon, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->documents, field2);
+}
+void free_ds_constructor_sticker_set (struct tl_ds_sticker_set *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa7a43b17 && T->type->name != 0x585bc4e8)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->title, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->short_name, field4);
+}
+void free_ds_constructor_string (struct tl_ds_string *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb5286e24 && T->type->name != 0x4ad791db)) { return; }
+ tfree (D->data, D->len + 1);
+ tfree (D, sizeof (*D));
+}
+void free_ds_constructor_update_new_message (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_message (D->message, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->pts, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->pts_count, field3);
+}
+void free_ds_constructor_update_message_i_d (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->random_id, field2);
+}
+void free_ds_constructor_update_delete_messages (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->messages, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->pts, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->pts_count, field3);
+}
+void free_ds_constructor_update_user_typing (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x70541c7e, .id = "SendMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_send_message_action (D->action, field2);
+}
+void free_ds_constructor_update_chat_user_typing (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->chat_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x70541c7e, .id = "SendMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_send_message_action (D->action, field3);
+}
+void free_ds_constructor_update_chat_participants (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x77930f9f, .id = "ChatParticipants", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_chat_participants (D->participants, field1);
+}
+void free_ds_constructor_update_user_status (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x76de9570, .id = "UserStatus", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_user_status (D->status, field2);
+}
+void free_ds_constructor_update_user_name (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->first_name, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->last_name, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->username, field4);
+}
+void free_ds_constructor_update_user_photo (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9a486229, .id = "UserProfilePhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_user_profile_photo (D->photo, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bool (D->previous, field4);
+}
+void free_ds_constructor_update_contact_registered (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field2);
+}
+void free_ds_constructor_update_contact_link (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_contact_link (D->my_link, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_contact_link (D->foreign_link, field3);
+}
+void free_ds_constructor_update_new_authorization (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->auth_key_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->device, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->location, field4);
+}
+void free_ds_constructor_update_new_geo_chat_message (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_geo_chat_message (D->geo_message, field1);
+}
+void free_ds_constructor_update_new_encrypted_message (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xce6b8a1e, .id = "EncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_encrypted_message (D->encr_message, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->qts, field2);
+}
+void free_ds_constructor_update_encrypted_chat_typing (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->chat_id, field1);
+}
+void free_ds_constructor_update_encryption (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb1718213, .id = "EncryptedChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_encrypted_chat (D->encr_chat, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field2);
+}
+void free_ds_constructor_update_encrypted_messages_read (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->chat_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->max_date, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field3);
+}
+void free_ds_constructor_update_chat_participant_add (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->chat_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->inviter_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->version, field4);
+}
+void free_ds_constructor_update_chat_participant_delete (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->chat_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->version, field3);
+}
+void free_ds_constructor_update_dc_options (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2b1a62f0, .id = "DcOption", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->dc_options, field1);
+}
+void free_ds_constructor_update_user_blocked (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bool (D->blocked, field2);
+}
+void free_ds_constructor_update_notify_settings (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9fcb8237, .id = "NotifyPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_notify_peer (D->notify_peer, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_peer_notify_settings (D->notify_settings, field2);
+}
+void free_ds_constructor_update_service_notification (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->type, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->message_text, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_message_media (D->media, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bool (D->popup, field4);
+}
+void free_ds_constructor_update_privacy (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xbc2eab30, .id = "PrivacyKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_privacy_key (D->key, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa8638aec, .id = "PrivacyRule", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->rules, field2);
+}
+void free_ds_constructor_update_user_phone (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->phone, field2);
+}
+void free_ds_constructor_update_read_history_inbox (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_peer (D->peer, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->max_id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->pts, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->pts_count, field4);
+}
+void free_ds_constructor_update_read_history_outbox (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_peer (D->peer, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->max_id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->pts, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->pts_count, field4);
+}
+void free_ds_constructor_update_web_page (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x8d8c0d41, .id = "WebPage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_web_page (D->webpage, field1);
+}
+void free_ds_constructor_update_read_messages_contents (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->messages, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->pts, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->pts_count, field3);
+}
+void free_ds_constructor_update_msg_update (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->pts, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->pts_count, field3);
+}
+void free_ds_constructor_updates_too_long (struct tl_ds_updates *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return; }
+}
+void free_ds_constructor_update_short_message (struct tl_ds_updates *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return; }
+ struct paramed_type *var0 = INT2PTR (*D->flags);
+ tfree (D->flags, sizeof (*D->flags));
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->message, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->pts, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->pts_count, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field7);
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->fwd_from_id, field8);
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->fwd_date, field9);
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->reply_to_msg_id, field10);
+ }
+}
+void free_ds_constructor_update_short_chat_message (struct tl_ds_updates *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return; }
+ struct paramed_type *var0 = INT2PTR (*D->flags);
+ tfree (D->flags, sizeof (*D->flags));
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->from_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->chat_id, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->message, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->pts, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->pts_count, field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field8);
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->fwd_from_id, field9);
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->fwd_date, field10);
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->reply_to_msg_id, field11);
+ }
+}
+void free_ds_constructor_update_short (struct tl_ds_updates *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_update (D->update, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field2);
+}
+void free_ds_constructor_updates_combined (struct tl_ds_updates *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->updates, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->users, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->chats, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->seq_start, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->seq, field6);
+}
+void free_ds_constructor_updates (struct tl_ds_updates *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->updates, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->users, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->chats, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->seq, field5);
+}
+void free_ds_constructor_user_empty (struct tl_ds_user *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02e6c0c8 && T->type->name != 0xfd193f37)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field1);
+}
+void free_ds_constructor_user (struct tl_ds_user *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02e6c0c8 && T->type->name != 0xfd193f37)) { return; }
+ struct paramed_type *var0 = INT2PTR (*D->flags);
+ tfree (D->flags, sizeof (*D->flags));
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field2);
+ if (PTR2INT (var0) & (1 << 0)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field3);
+ }
+ if (PTR2INT (var0) & (1 << 1)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->first_name, field4);
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->last_name, field5);
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->username, field6);
+ }
+ if (PTR2INT (var0) & (1 << 4)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->phone, field7);
+ }
+ if (PTR2INT (var0) & (1 << 5)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9a486229, .id = "UserProfilePhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_user_profile_photo (D->photo, field8);
+ }
+ if (PTR2INT (var0) & (1 << 6)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x76de9570, .id = "UserStatus", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_user_status (D->status, field9);
+ }
+ if (PTR2INT (var0) & (1 << 14)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->bot_info_version, field10);
+ }
+}
+void free_ds_constructor_user_full (struct tl_ds_user_full *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5a89ac5b && T->type->name != 0xa57653a4)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_user (D->user, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3ace484c, .id = "contacts.Link", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_contacts_link (D->link, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_photo (D->profile_photo, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_peer_notify_settings (D->notify_settings, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bool (D->blocked, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb2e16f93, .id = "BotInfo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bot_info (D->bot_info, field6);
+}
+void free_ds_constructor_user_profile_photo_empty (struct tl_ds_user_profile_photo *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9a486229 && T->type->name != 0x65b79dd6)) { return; }
+}
+void free_ds_constructor_user_profile_photo (struct tl_ds_user_profile_photo *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9a486229 && T->type->name != 0x65b79dd6)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->photo_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_file_location (D->photo_small, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_file_location (D->photo_big, field3);
+}
+void free_ds_constructor_user_status_empty (struct tl_ds_user_status *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return; }
+}
+void free_ds_constructor_user_status_online (struct tl_ds_user_status *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->expires, field1);
+}
+void free_ds_constructor_user_status_offline (struct tl_ds_user_status *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->was_online, field1);
+}
+void free_ds_constructor_user_status_recently (struct tl_ds_user_status *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return; }
+}
+void free_ds_constructor_user_status_last_week (struct tl_ds_user_status *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return; }
+}
+void free_ds_constructor_user_status_last_month (struct tl_ds_user_status *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return; }
+}
+void free_ds_constructor_vector (struct tl_ds_vector *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1cb5c415 && T->type->name != 0xe34a3bea)) { return; }
+ if (ODDP(T->params[0])) { return; }
+ struct paramed_type *var0 = T->params[0]; assert (var0);
+ struct paramed_type *var1 = INT2PTR (*D->f1);
+ tfree (D->f1, sizeof (*D->f1));
+ int multiplicity3 = PTR2INT (
+ ((void *)var1) + 0 );
+ struct paramed_type *field3 =
+ var0;
+ {
+ int i = 0;
+ while (i < multiplicity3) {
+ free_ds_type_any (D->f2[i ++], field3);
+ }
+ }
+ tfree (D->f2, sizeof (void *) * multiplicity3);
+}
+void free_ds_constructor_video_empty (struct tl_ds_video *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1716b174 && T->type->name != 0xe8e94e8b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+}
+void free_ds_constructor_video (struct tl_ds_video *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1716b174 && T->type->name != 0xe8e94e8b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->duration, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->size, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_photo_size (D->thumb, field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->dc_id, field8);
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->w, field9);
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->h, field10);
+}
+void free_ds_constructor_video_l27 (struct tl_ds_video *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1716b174 && T->type->name != 0xe8e94e8b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->caption, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->duration, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->mime_type, field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->size, field8);
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_photo_size (D->thumb, field9);
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->dc_id, field10);
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->w, field11);
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->h, field12);
+}
+void free_ds_constructor_wall_paper (struct tl_ds_wall_paper *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xafa14973 && T->type->name != 0x505eb68c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->title, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->sizes, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->color, field4);
+}
+void free_ds_constructor_wall_paper_solid (struct tl_ds_wall_paper *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xafa14973 && T->type->name != 0x505eb68c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->title, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->bg_color, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->color, field4);
+}
+void free_ds_constructor_web_page_empty (struct tl_ds_web_page *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8d8c0d41 && T->type->name != 0x7273f2be)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+}
+void free_ds_constructor_web_page_pending (struct tl_ds_web_page *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8d8c0d41 && T->type->name != 0x7273f2be)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field2);
+}
+void free_ds_constructor_web_page (struct tl_ds_web_page *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8d8c0d41 && T->type->name != 0x7273f2be)) { return; }
+ struct paramed_type *var0 = INT2PTR (*D->flags);
+ tfree (D->flags, sizeof (*D->flags));
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->url, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->display_url, field4);
+ if (PTR2INT (var0) & (1 << 0)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->type, field5);
+ }
+ if (PTR2INT (var0) & (1 << 1)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->site_name, field6);
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->title, field7);
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->description, field8);
+ }
+ if (PTR2INT (var0) & (1 << 4)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_photo (D->photo, field9);
+ }
+ if (PTR2INT (var0) & (1 << 5)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->embed_url, field10);
+ }
+ if (PTR2INT (var0) & (1 << 5)) {
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->embed_type, field11);
+ }
+ if (PTR2INT (var0) & (1 << 6)) {
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->embed_width, field12);
+ }
+ if (PTR2INT (var0) & (1 << 6)) {
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->embed_height, field13);
+ }
+ if (PTR2INT (var0) & (1 << 7)) {
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->duration, field14);
+ }
+ if (PTR2INT (var0) & (1 << 8)) {
+ struct paramed_type *field15 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->author, field15);
+ }
+}
+void free_ds_constructor_account_authorizations (struct tl_ds_account_authorizations *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1250abde && T->type->name != 0xedaf5421)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bf2e6f6, .id = "Authorization", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->authorizations, field1);
+}
+void free_ds_constructor_account_no_password (struct tl_ds_account_password *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xeac2a804 && T->type->name != 0x153d57fb)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->new_salt, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->email_unconfirmed_pattern, field2);
+}
+void free_ds_constructor_account_password (struct tl_ds_account_password *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xeac2a804 && T->type->name != 0x153d57fb)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->current_salt, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->new_salt, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->hint, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bool (D->has_recovery, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->email_unconfirmed_pattern, field5);
+}
+void free_ds_constructor_account_password_input_settings (struct tl_ds_account_password_input_settings *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbcfc532c && T->type->name != 0x4303acd3)) { return; }
+ struct paramed_type *var0 = INT2PTR (*D->flags);
+ tfree (D->flags, sizeof (*D->flags));
+ if (PTR2INT (var0) & (1 << 0)) {
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->new_salt, field2);
+ }
+ if (PTR2INT (var0) & (1 << 0)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->new_password_hash, field3);
+ }
+ if (PTR2INT (var0) & (1 << 0)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->hint, field4);
+ }
+ if (PTR2INT (var0) & (1 << 1)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->email, field5);
+ }
+}
+void free_ds_constructor_account_password_settings (struct tl_ds_account_password_settings *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb7b72ab3 && T->type->name != 0x4848d54c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->email, field1);
+}
+void free_ds_constructor_account_privacy_rules (struct tl_ds_account_privacy_rules *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x554abb6f && T->type->name != 0xaab54490)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa8638aec, .id = "PrivacyRule", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->rules, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->users, field2);
+}
+void free_ds_constructor_account_sent_change_phone_code (struct tl_ds_account_sent_change_phone_code *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa4f58c4c && T->type->name != 0x5b0a73b3)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->phone_code_hash, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->send_call_timeout, field2);
+}
+void free_ds_constructor_auth_authorization (struct tl_ds_auth_authorization *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xff036af1 && T->type->name != 0x00fc950e)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_user (D->user, field1);
+}
+void free_ds_constructor_auth_checked_phone (struct tl_ds_auth_checked_phone *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x811ea28e && T->type->name != 0x7ee15d71)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bool (D->phone_registered, field1);
+}
+void free_ds_constructor_auth_exported_authorization (struct tl_ds_auth_exported_authorization *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdf969c2d && T->type->name != 0x206963d2)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->bytes, field2);
+}
+void free_ds_constructor_auth_password_recovery (struct tl_ds_auth_password_recovery *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x137948a5 && T->type->name != 0xec86b75a)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->email_pattern, field1);
+}
+void free_ds_constructor_auth_sent_code (struct tl_ds_auth_sent_code *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0cc8bc16 && T->type->name != 0xf33743e9)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bool (D->phone_registered, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->phone_code_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->send_call_timeout, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bool (D->is_password, field4);
+}
+void free_ds_constructor_auth_sent_app_code (struct tl_ds_auth_sent_code *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0cc8bc16 && T->type->name != 0xf33743e9)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bool (D->phone_registered, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->phone_code_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->send_call_timeout, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bool (D->is_password, field4);
+}
+void free_ds_constructor_binlog_encr_key (struct tl_ds_binlog_encr_key *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0377168f && T->type->name != 0xfc88e970)) { return; }
+ int multiplicity1 = PTR2INT (
+ INT2PTR (64) );
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ {
+ int i = 0;
+ while (i < multiplicity1) {
+ free_ds_type_any (D->key[i ++], field1);
+ }
+ }
+ tfree (D->key, sizeof (void *) * multiplicity1);
+}
+void free_ds_constructor_binlog_start (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+}
+void free_ds_constructor_binlog_dc_option (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->dc, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->name, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->ip, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->port, field4);
+}
+void free_ds_constructor_binlog_dc_option_new (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->flags, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->dc, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->name, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->ip, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->port, field5);
+}
+void free_ds_constructor_binlog_auth_key (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->dc, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_binlog_encr_key (D->key, field2);
+}
+void free_ds_constructor_binlog_default_dc (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->dc, field1);
+}
+void free_ds_constructor_binlog_dc_signed (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->dc, field1);
+}
+void free_ds_constructor_binlog_our_id (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field1);
+}
+void free_ds_constructor_binlog_set_dh_params (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->root, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_binlog_encr_key (D->prime, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->version, field3);
+}
+void free_ds_constructor_binlog_set_pts (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->pts, field1);
+}
+void free_ds_constructor_binlog_set_qts (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->qts, field1);
+}
+void free_ds_constructor_binlog_set_date (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field1);
+}
+void free_ds_constructor_binlog_set_seq (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->seq, field1);
+}
+void free_ds_constructor_binlog_encr_chat_delete (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field1);
+}
+void free_ds_constructor_binlog_encr_chat_new (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *var0 = INT2PTR (*D->flags);
+ tfree (D->flags, sizeof (*D->flags));
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field2);
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field3);
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field4);
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->admin, field5);
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field6);
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_binlog_encr_key (D->key, field7);
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_binlog_encr_key (D->g_key, field8);
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->state, field9);
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->ttl, field10);
+ }
+ if (PTR2INT (var0) & (1 << 25)) {
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->layer, field11);
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->in_seq_no, field12);
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->last_in_seq_no, field13);
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->out_seq_no, field14);
+ }
+ if (PTR2INT (var0) & (1 << 27)) {
+ struct paramed_type *field15 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->key_fingerprint, field15);
+ }
+}
+void free_ds_constructor_binlog_encr_chat_exchange_new (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *var0 = INT2PTR (*D->flags);
+ tfree (D->flags, sizeof (*D->flags));
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field2);
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->exchange_id, field3);
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_binlog_encr_key (D->key, field4);
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->state, field5);
+ }
+}
+void free_ds_constructor_binlog_user_delete (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field1);
+}
+void free_ds_constructor_binlog_user_new (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *var0 = INT2PTR (*D->flags);
+ tfree (D->flags, sizeof (*D->flags));
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field2);
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->access_hash, field3);
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->first_name, field4);
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->last_name, field5);
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->phone, field6);
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->username, field7);
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_photo (D->photo, field8);
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->real_first_name, field9);
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->real_last_name, field10);
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9a486229, .id = "UserProfilePhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_user_profile_photo (D->user_photo, field11);
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->last_read_in, field12);
+ }
+ if (PTR2INT (var0) & (1 << 25)) {
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->last_read_out, field13);
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb2e16f93, .id = "BotInfo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bot_info (D->bot_info, field14);
+ }
+}
+void free_ds_constructor_binlog_chat_new (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *var0 = INT2PTR (*D->flags);
+ tfree (D->flags, sizeof (*D->flags));
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field2);
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->title, field3);
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_num, field4);
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field5);
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->version, field6);
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc8d7493e, .id = "ChatParticipant", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->participants, field7);
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x56922676, .id = "ChatPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_chat_photo (D->chat_photo, field8);
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_photo (D->photo, field9);
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->admin, field10);
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->last_read_in, field11);
+ }
+ if (PTR2INT (var0) & (1 << 25)) {
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->last_read_out, field12);
+ }
+}
+void free_ds_constructor_binlog_chat_add_participant (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->version, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->inviter_id, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field5);
+}
+void free_ds_constructor_binlog_chat_del_participant (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->version, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->user_id, field3);
+}
+void free_ds_constructor_binlog_set_msg_id (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->old_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->new_id, field2);
+}
+void free_ds_constructor_binlog_message_delete (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->lid, field1);
+}
+void free_ds_constructor_binlog_message_new (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *var0 = INT2PTR (*D->flags);
+ tfree (D->flags, sizeof (*D->flags));
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->lid, field2);
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->from_id, field3);
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->to_type, field4);
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->to_id, field5);
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->fwd_from_id, field6);
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->fwd_date, field7);
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field8);
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->message, field9);
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_message_media (D->media, field10);
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x383415fa, .id = "MessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_message_action (D->action, field11);
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->reply_id, field12);
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x612ca4a9, .id = "ReplyMarkup", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_reply_markup (D->reply_markup, field13);
+ }
+}
+void free_ds_constructor_binlog_message_encr_new (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *var0 = INT2PTR (*D->flags);
+ tfree (D->flags, sizeof (*D->flags));
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->lid, field2);
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->from_id, field3);
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->to_type, field4);
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->to_id, field5);
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field6);
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->message, field7);
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x34e0d674, .id = "DecryptedMessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_decrypted_message_media (D->encr_media, field8);
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4e0eefde, .id = "DecryptedMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_decrypted_message_action (D->encr_action, field9);
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x886fd032, .id = "EncryptedFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_encrypted_file (D->file, field10);
+ }
+}
+void free_ds_constructor_binlog_msg_update (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_long (D->lid, field1);
+}
+void free_ds_constructor_binlog_reset_authorization (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+}
+void free_ds_constructor_contacts_blocked (struct tl_ds_contacts_blocked *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8c1b8fb4 && T->type->name != 0x73e4704b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x561bc879, .id = "ContactBlocked", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->blocked, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->users, field2);
+}
+void free_ds_constructor_contacts_blocked_slice (struct tl_ds_contacts_blocked *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8c1b8fb4 && T->type->name != 0x73e4704b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->count, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x561bc879, .id = "ContactBlocked", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->blocked, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->users, field3);
+}
+void free_ds_constructor_contacts_contacts_not_modified (struct tl_ds_contacts_contacts *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd8c02560 && T->type->name != 0x273fda9f)) { return; }
+}
+void free_ds_constructor_contacts_contacts (struct tl_ds_contacts_contacts *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd8c02560 && T->type->name != 0x273fda9f)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf911c994, .id = "Contact", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->contacts, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->users, field2);
+}
+void free_ds_constructor_contacts_found (struct tl_ds_contacts_found *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0566000e && T->type->name != 0xfa99fff1)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xea879f95, .id = "ContactFound", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->results, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->users, field2);
+}
+void free_ds_constructor_contacts_imported_contacts (struct tl_ds_contacts_imported_contacts *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xad524315 && T->type->name != 0x52adbcea)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xd0028438, .id = "ImportedContact", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->imported, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->retry_contacts, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->users, field3);
+}
+void free_ds_constructor_contacts_link (struct tl_ds_contacts_link *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3ace484c && T->type->name != 0xc531b7b3)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_contact_link (D->my_link, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_contact_link (D->foreign_link, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_user (D->user, field3);
+}
+void free_ds_constructor_contacts_suggested (struct tl_ds_contacts_suggested *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5649dcc5 && T->type->name != 0xa9b6233a)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3de191a1, .id = "ContactSuggested", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->results, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->users, field2);
+}
+void free_ds_constructor_geochats_located (struct tl_ds_geochats_located *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x48feb267 && T->type->name != 0xb7014d98)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3631cf4c, .id = "ChatLocated", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->results, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->messages, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->chats, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->users, field4);
+}
+void free_ds_constructor_geochats_messages (struct tl_ds_geochats_messages *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6d0a0e59 && T->type->name != 0x92f5f1a6)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->messages, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->chats, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->users, field3);
+}
+void free_ds_constructor_geochats_messages_slice (struct tl_ds_geochats_messages *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6d0a0e59 && T->type->name != 0x92f5f1a6)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->count, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->messages, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->chats, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->users, field4);
+}
+void free_ds_constructor_geochats_stated_message (struct tl_ds_geochats_stated_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17b1578b && T->type->name != 0xe84ea874)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_geo_chat_message (D->message, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->chats, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->users, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->seq, field4);
+}
+void free_ds_constructor_help_app_update (struct tl_ds_help_app_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4ddd9627 && T->type->name != 0xb22269d8)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bool (D->critical, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->url, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->text, field4);
+}
+void free_ds_constructor_help_no_app_update (struct tl_ds_help_app_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4ddd9627 && T->type->name != 0xb22269d8)) { return; }
+}
+void free_ds_constructor_help_invite_text (struct tl_ds_help_invite_text *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x18cb9f78 && T->type->name != 0xe7346087)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->message, field1);
+}
+void free_ds_constructor_help_support (struct tl_ds_help_support *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17c6b5f6 && T->type->name != 0xe8394a09)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->phone_number, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_user (D->user, field2);
+}
+void free_ds_constructor_messages_affected_history (struct tl_ds_messages_affected_history *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb45c69d1 && T->type->name != 0x4ba3962e)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->pts, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->pts_count, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->offset, field3);
+}
+void free_ds_constructor_messages_affected_messages (struct tl_ds_messages_affected_messages *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x84d19185 && T->type->name != 0x7b2e6e7a)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->pts, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->pts_count, field2);
+}
+void free_ds_constructor_messages_all_stickers_not_modified (struct tl_ds_messages_all_stickers *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb485502f && T->type->name != 0x4b7aafd0)) { return; }
+}
+void free_ds_constructor_messages_all_stickers (struct tl_ds_messages_all_stickers *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb485502f && T->type->name != 0x4b7aafd0)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->hash, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x12b299d4, .id = "StickerPack", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->packs, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa7a43b17, .id = "StickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->sets, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->documents, field4);
+}
+void free_ds_constructor_messages_chat_full (struct tl_ds_messages_chat_full *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe5d7d19c && T->type->name != 0x1a282e63)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02a614, .id = "ChatFull", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_chat_full (D->full_chat, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->chats, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->users, field3);
+}
+void free_ds_constructor_messages_chats (struct tl_ds_messages_chats *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x64ff9fd5 && T->type->name != 0x9b00602a)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->chats, field1);
+}
+void free_ds_constructor_messages_dh_config_not_modified (struct tl_ds_messages_dh_config *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xecc058e8 && T->type->name != 0x133fa717)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->random, field1);
+}
+void free_ds_constructor_messages_dh_config (struct tl_ds_messages_dh_config *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xecc058e8 && T->type->name != 0x133fa717)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->g, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->p, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->version, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->random, field4);
+}
+void free_ds_constructor_messages_dialogs (struct tl_ds_messages_dialogs *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x645af8b3 && T->type->name != 0x9ba5074c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc1dd804a, .id = "Dialog", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->dialogs, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->messages, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->chats, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->users, field4);
+}
+void free_ds_constructor_messages_dialogs_slice (struct tl_ds_messages_dialogs *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x645af8b3 && T->type->name != 0x9ba5074c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->count, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc1dd804a, .id = "Dialog", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->dialogs, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->messages, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->chats, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->users, field5);
+}
+void free_ds_constructor_messages_message_empty (struct tl_ds_messages_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3f4e0648 && T->type->name != 0xc0b1f9b7)) { return; }
+}
+void free_ds_constructor_messages_messages (struct tl_ds_messages_messages *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8735e464 && T->type->name != 0x78ca1b9b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->messages, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->chats, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->users, field3);
+}
+void free_ds_constructor_messages_messages_slice (struct tl_ds_messages_messages *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8735e464 && T->type->name != 0x78ca1b9b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->count, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->messages, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->chats, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->users, field4);
+}
+void free_ds_constructor_messages_sent_encrypted_message (struct tl_ds_messages_sent_encrypted_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc29c7607 && T->type->name != 0x3d6389f8)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field1);
+}
+void free_ds_constructor_messages_sent_encrypted_file (struct tl_ds_messages_sent_encrypted_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc29c7607 && T->type->name != 0x3d6389f8)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x886fd032, .id = "EncryptedFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_encrypted_file (D->file, field2);
+}
+void free_ds_constructor_messages_sent_message (struct tl_ds_messages_sent_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x799ce190 && T->type->name != 0x86631e6f)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_message_media (D->media, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->pts, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->pts_count, field5);
+}
+void free_ds_constructor_messages_sent_message_link (struct tl_ds_messages_sent_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x799ce190 && T->type->name != 0x86631e6f)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_message_media (D->media, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->pts, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->pts_count, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3ace484c, .id = "contacts.Link", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->links, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->seq, field7);
+}
+void free_ds_constructor_messages_sticker_set (struct tl_ds_messages_sticker_set *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb60a24a6 && T->type->name != 0x49f5db59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa7a43b17, .id = "StickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_sticker_set (D->set, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x12b299d4, .id = "StickerPack", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->packs, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->documents, field3);
+}
+void free_ds_constructor_messages_stickers_not_modified (struct tl_ds_messages_stickers *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bfa5710 && T->type->name != 0x8405a8ef)) { return; }
+}
+void free_ds_constructor_messages_stickers (struct tl_ds_messages_stickers *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bfa5710 && T->type->name != 0x8405a8ef)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_string (D->hash, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->stickers, field2);
+}
+void free_ds_constructor_photos_photo (struct tl_ds_photos_photo *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x20212ca8 && T->type->name != 0xdfded357)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_photo (D->photo, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->users, field2);
+}
+void free_ds_constructor_photos_photos (struct tl_ds_photos_photos *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x98cf75f1 && T->type->name != 0x67308a0e)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->photos, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->users, field2);
+}
+void free_ds_constructor_photos_photos_slice (struct tl_ds_photos_photos *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x98cf75f1 && T->type->name != 0x67308a0e)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->count, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->photos, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->users, field3);
+}
+void free_ds_constructor_storage_file_unknown (struct tl_ds_storage_file_type *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return; }
+}
+void free_ds_constructor_storage_file_jpeg (struct tl_ds_storage_file_type *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return; }
+}
+void free_ds_constructor_storage_file_gif (struct tl_ds_storage_file_type *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return; }
+}
+void free_ds_constructor_storage_file_png (struct tl_ds_storage_file_type *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return; }
+}
+void free_ds_constructor_storage_file_pdf (struct tl_ds_storage_file_type *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return; }
+}
+void free_ds_constructor_storage_file_mp3 (struct tl_ds_storage_file_type *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return; }
+}
+void free_ds_constructor_storage_file_mov (struct tl_ds_storage_file_type *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return; }
+}
+void free_ds_constructor_storage_file_partial (struct tl_ds_storage_file_type *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return; }
+}
+void free_ds_constructor_storage_file_mp4 (struct tl_ds_storage_file_type *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return; }
+}
+void free_ds_constructor_storage_file_webp (struct tl_ds_storage_file_type *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return; }
+}
+void free_ds_constructor_updates_difference_empty (struct tl_ds_updates_difference *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf57a2419 && T->type->name != 0x0a85dbe6)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->seq, field2);
+}
+void free_ds_constructor_updates_difference (struct tl_ds_updates_difference *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf57a2419 && T->type->name != 0x0a85dbe6)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->new_messages, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xce6b8a1e, .id = "EncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->new_encrypted_messages, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->other_updates, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->chats, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->users, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa56c2a3e, .id = "updates.State", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_updates_state (D->state, field6);
+}
+void free_ds_constructor_updates_difference_slice (struct tl_ds_updates_difference *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf57a2419 && T->type->name != 0x0a85dbe6)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->new_messages, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xce6b8a1e, .id = "EncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->new_encrypted_messages, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->other_updates, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->chats, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ free_ds_type_any (D->users, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa56c2a3e, .id = "updates.State", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_updates_state (D->intermediate_state, field6);
+}
+void free_ds_constructor_updates_state (struct tl_ds_updates_state *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa56c2a3e && T->type->name != 0x5a93d5c1)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->pts, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->qts, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->date, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->seq, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->unread_count, field5);
+}
+void free_ds_constructor_upload_file (struct tl_ds_upload_file *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x096a18d5 && T->type->name != 0xf695e72a)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3e2838a8, .id = "storage.FileType", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_storage_file_type (D->type, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_int (D->mtime, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ free_ds_type_bytes (D->bytes, field3);
+}
+void free_ds_type_account_days_t_t_l (struct tl_ds_account_days_t_t_l *D, struct paramed_type *T) {
+ free_ds_constructor_account_days_t_t_l (D, T); return;
+}
+void free_ds_type_audio (struct tl_ds_audio *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x586988d8: free_ds_constructor_audio_empty (D, T); return;
+ case 0xc7ac6496: free_ds_constructor_audio (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_authorization (struct tl_ds_authorization *D, struct paramed_type *T) {
+ free_ds_constructor_authorization (D, T); return;
+}
+void free_ds_type_bool (struct tl_ds_bool *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xbc799737: free_ds_constructor_bool_false (D, T); return;
+ case 0x997275b5: free_ds_constructor_bool_true (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_bot_command (struct tl_ds_bot_command *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xc27ac8c7: free_ds_constructor_bot_command (D, T); return;
+ case 0xb79d22ab: free_ds_constructor_bot_command_old (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_bot_info (struct tl_ds_bot_info *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xbb2e37ce: free_ds_constructor_bot_info_empty (D, T); return;
+ case 0x09cf585d: free_ds_constructor_bot_info (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_bytes (struct tl_ds_string *D, struct paramed_type *T) {
+ free_ds_constructor_bytes (D, T); return;
+}
+void free_ds_type_chat (struct tl_ds_chat *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x9ba2d800: free_ds_constructor_chat_empty (D, T); return;
+ case 0x6e9c9bc7: free_ds_constructor_chat (D, T); return;
+ case 0xfb0ccc41: free_ds_constructor_chat_forbidden (D, T); return;
+ case 0x75eaea5a: free_ds_constructor_geo_chat (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_chat_full (struct tl_ds_chat_full *D, struct paramed_type *T) {
+ free_ds_constructor_chat_full (D, T); return;
+}
+void free_ds_type_chat_invite (struct tl_ds_chat_invite *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x5a686d7c: free_ds_constructor_chat_invite_already (D, T); return;
+ case 0xce917dcd: free_ds_constructor_chat_invite (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_chat_located (struct tl_ds_chat_located *D, struct paramed_type *T) {
+ free_ds_constructor_chat_located (D, T); return;
+}
+void free_ds_type_chat_participant (struct tl_ds_chat_participant *D, struct paramed_type *T) {
+ free_ds_constructor_chat_participant (D, T); return;
+}
+void free_ds_type_chat_participants (struct tl_ds_chat_participants *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x0fd2bb8a: free_ds_constructor_chat_participants_forbidden (D, T); return;
+ case 0x7841b415: free_ds_constructor_chat_participants (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_chat_photo (struct tl_ds_chat_photo *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x37c1011c: free_ds_constructor_chat_photo_empty (D, T); return;
+ case 0x6153276a: free_ds_constructor_chat_photo (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_client_d_h_inner_data (struct tl_ds_client_d_h_inner_data *D, struct paramed_type *T) {
+ free_ds_constructor_client_d_h_inner_data (D, T); return;
+}
+void free_ds_type_config (struct tl_ds_config *D, struct paramed_type *T) {
+ free_ds_constructor_config (D, T); return;
+}
+void free_ds_type_contact (struct tl_ds_contact *D, struct paramed_type *T) {
+ free_ds_constructor_contact (D, T); return;
+}
+void free_ds_type_contact_blocked (struct tl_ds_contact_blocked *D, struct paramed_type *T) {
+ free_ds_constructor_contact_blocked (D, T); return;
+}
+void free_ds_type_contact_found (struct tl_ds_contact_found *D, struct paramed_type *T) {
+ free_ds_constructor_contact_found (D, T); return;
+}
+void free_ds_type_contact_link (struct tl_ds_contact_link *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x5f4f9247: free_ds_constructor_contact_link_unknown (D, T); return;
+ case 0xfeedd3ad: free_ds_constructor_contact_link_none (D, T); return;
+ case 0x268f3f59: free_ds_constructor_contact_link_has_phone (D, T); return;
+ case 0xd502c2d0: free_ds_constructor_contact_link_contact (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_contact_status (struct tl_ds_contact_status *D, struct paramed_type *T) {
+ free_ds_constructor_contact_status (D, T); return;
+}
+void free_ds_type_contact_suggested (struct tl_ds_contact_suggested *D, struct paramed_type *T) {
+ free_ds_constructor_contact_suggested (D, T); return;
+}
+void free_ds_type_dc_option (struct tl_ds_dc_option *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x2ec2a43c: free_ds_constructor_dc_option_l28 (D, T); return;
+ case 0x05d8c6cc: free_ds_constructor_dc_option (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_decrypted_message (struct tl_ds_decrypted_message *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x204d3878: free_ds_constructor_decrypted_message (D, T); return;
+ case 0x73164160: free_ds_constructor_decrypted_message_service (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_decrypted_message_action (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xa1733aec: free_ds_constructor_decrypted_message_action_set_message_t_t_l (D, T); return;
+ case 0x0c4f40be: free_ds_constructor_decrypted_message_action_read_messages (D, T); return;
+ case 0x65614304: free_ds_constructor_decrypted_message_action_delete_messages (D, T); return;
+ case 0x8ac1f475: free_ds_constructor_decrypted_message_action_screenshot_messages (D, T); return;
+ case 0x6719e45c: free_ds_constructor_decrypted_message_action_flush_history (D, T); return;
+ case 0x511110b0: free_ds_constructor_decrypted_message_action_resend (D, T); return;
+ case 0xf3048883: free_ds_constructor_decrypted_message_action_notify_layer (D, T); return;
+ case 0xccb27641: free_ds_constructor_decrypted_message_action_typing (D, T); return;
+ case 0xf3c9611b: free_ds_constructor_decrypted_message_action_request_key (D, T); return;
+ case 0x6fe1735b: free_ds_constructor_decrypted_message_action_accept_key (D, T); return;
+ case 0xdd05ec6b: free_ds_constructor_decrypted_message_action_abort_key (D, T); return;
+ case 0xec2e0b9b: free_ds_constructor_decrypted_message_action_commit_key (D, T); return;
+ case 0xa82fdd63: free_ds_constructor_decrypted_message_action_noop (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_decrypted_message_layer (struct tl_ds_decrypted_message_layer *D, struct paramed_type *T) {
+ free_ds_constructor_decrypted_message_layer (D, T); return;
+}
+void free_ds_type_decrypted_message_media (struct tl_ds_decrypted_message_media *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x089f5c4a: free_ds_constructor_decrypted_message_media_empty (D, T); return;
+ case 0x32798a8c: free_ds_constructor_decrypted_message_media_photo (D, T); return;
+ case 0x35480a59: free_ds_constructor_decrypted_message_media_geo_point (D, T); return;
+ case 0x588a0a97: free_ds_constructor_decrypted_message_media_contact (D, T); return;
+ case 0xb095434b: free_ds_constructor_decrypted_message_media_document (D, T); return;
+ case 0x524a415d: free_ds_constructor_decrypted_message_media_video (D, T); return;
+ case 0x57e0a9cb: free_ds_constructor_decrypted_message_media_audio (D, T); return;
+ case 0xfa95b0dd: free_ds_constructor_decrypted_message_media_external_document (D, T); return;
+ case 0x4cee6ef3: free_ds_constructor_decrypted_message_media_video_l12 (D, T); return;
+ case 0x6080758f: free_ds_constructor_decrypted_message_media_audio_l12 (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_dialog (struct tl_ds_dialog *D, struct paramed_type *T) {
+ free_ds_constructor_dialog (D, T); return;
+}
+void free_ds_type_disabled_feature (struct tl_ds_disabled_feature *D, struct paramed_type *T) {
+ free_ds_constructor_disabled_feature (D, T); return;
+}
+void free_ds_type_document (struct tl_ds_document *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x36f8c871: free_ds_constructor_document_empty (D, T); return;
+ case 0xf9a39f4f: free_ds_constructor_document (D, T); return;
+ case 0x9efc6326: free_ds_constructor_document_l19 (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_document_attribute (struct tl_ds_document_attribute *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x6c37c15c: free_ds_constructor_document_attribute_image_size (D, T); return;
+ case 0x11b58939: free_ds_constructor_document_attribute_animated (D, T); return;
+ case 0x994c9882: free_ds_constructor_document_attribute_sticker_l28 (D, T); return;
+ case 0x3a556302: free_ds_constructor_document_attribute_sticker (D, T); return;
+ case 0x5910cccb: free_ds_constructor_document_attribute_video (D, T); return;
+ case 0x051448e5: free_ds_constructor_document_attribute_audio (D, T); return;
+ case 0x15590068: free_ds_constructor_document_attribute_filename (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_double (double *D, struct paramed_type *T) {
+ free_ds_constructor_double (D, T); return;
+}
+void free_ds_type_encrypted_chat (struct tl_ds_encrypted_chat *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xab7ec0a0: free_ds_constructor_encrypted_chat_empty (D, T); return;
+ case 0x3bf703dc: free_ds_constructor_encrypted_chat_waiting (D, T); return;
+ case 0xc878527e: free_ds_constructor_encrypted_chat_requested (D, T); return;
+ case 0xfa56ce36: free_ds_constructor_encrypted_chat (D, T); return;
+ case 0x13d6dd27: free_ds_constructor_encrypted_chat_discarded (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_encrypted_file (struct tl_ds_encrypted_file *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xc21f497e: free_ds_constructor_encrypted_file_empty (D, T); return;
+ case 0x4a70994c: free_ds_constructor_encrypted_file (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_encrypted_message (struct tl_ds_encrypted_message *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xed18c118: free_ds_constructor_encrypted_message (D, T); return;
+ case 0x23734b06: free_ds_constructor_encrypted_message_service (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_error (struct tl_ds_error *D, struct paramed_type *T) {
+ free_ds_constructor_error (D, T); return;
+}
+void free_ds_type_exported_chat_invite (struct tl_ds_exported_chat_invite *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x69df3769: free_ds_constructor_chat_invite_empty (D, T); return;
+ case 0xfc2e05bc: free_ds_constructor_chat_invite_exported (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_file_location (struct tl_ds_file_location *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x7c596b46: free_ds_constructor_file_location_unavailable (D, T); return;
+ case 0x53d69076: free_ds_constructor_file_location (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_geo_chat_message (struct tl_ds_geo_chat_message *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x60311a9b: free_ds_constructor_geo_chat_message_empty (D, T); return;
+ case 0x4505f8e1: free_ds_constructor_geo_chat_message (D, T); return;
+ case 0xd34fa24e: free_ds_constructor_geo_chat_message_service (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_geo_point (struct tl_ds_geo_point *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x1117dd5f: free_ds_constructor_geo_point_empty (D, T); return;
+ case 0x2049d70c: free_ds_constructor_geo_point (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_imported_contact (struct tl_ds_imported_contact *D, struct paramed_type *T) {
+ free_ds_constructor_imported_contact (D, T); return;
+}
+void free_ds_type_input_app_event (struct tl_ds_input_app_event *D, struct paramed_type *T) {
+ free_ds_constructor_input_app_event (D, T); return;
+}
+void free_ds_type_input_audio (struct tl_ds_input_audio *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xd95adc84: free_ds_constructor_input_audio_empty (D, T); return;
+ case 0x77d440ff: free_ds_constructor_input_audio (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_input_chat_photo (struct tl_ds_input_chat_photo *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x1ca48f57: free_ds_constructor_input_chat_photo_empty (D, T); return;
+ case 0x94254732: free_ds_constructor_input_chat_uploaded_photo (D, T); return;
+ case 0xb2e1bf08: free_ds_constructor_input_chat_photo (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_input_contact (struct tl_ds_input_contact *D, struct paramed_type *T) {
+ free_ds_constructor_input_phone_contact (D, T); return;
+}
+void free_ds_type_input_document (struct tl_ds_input_document *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x72f0eaae: free_ds_constructor_input_document_empty (D, T); return;
+ case 0x18798952: free_ds_constructor_input_document (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_input_encrypted_chat (struct tl_ds_input_encrypted_chat *D, struct paramed_type *T) {
+ free_ds_constructor_input_encrypted_chat (D, T); return;
+}
+void free_ds_type_input_encrypted_file (struct tl_ds_input_encrypted_file *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x1837c364: free_ds_constructor_input_encrypted_file_empty (D, T); return;
+ case 0x64bd0306: free_ds_constructor_input_encrypted_file_uploaded (D, T); return;
+ case 0x5a17b5e5: free_ds_constructor_input_encrypted_file (D, T); return;
+ case 0x2dc173c8: free_ds_constructor_input_encrypted_file_big_uploaded (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_input_file (struct tl_ds_input_file *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xf52ff27f: free_ds_constructor_input_file (D, T); return;
+ case 0xfa4f0bb5: free_ds_constructor_input_file_big (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_input_file_location (struct tl_ds_input_file_location *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x14637196: free_ds_constructor_input_file_location (D, T); return;
+ case 0x3d0364ec: free_ds_constructor_input_video_file_location (D, T); return;
+ case 0xf5235d55: free_ds_constructor_input_encrypted_file_location (D, T); return;
+ case 0x74dc404d: free_ds_constructor_input_audio_file_location (D, T); return;
+ case 0x4e45abe9: free_ds_constructor_input_document_file_location (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_input_geo_chat (struct tl_ds_input_geo_chat *D, struct paramed_type *T) {
+ free_ds_constructor_input_geo_chat (D, T); return;
+}
+void free_ds_type_input_geo_point (struct tl_ds_input_geo_point *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xe4c123d6: free_ds_constructor_input_geo_point_empty (D, T); return;
+ case 0xf3b7acc9: free_ds_constructor_input_geo_point (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_input_media (struct tl_ds_input_media *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x9664f57f: free_ds_constructor_input_media_empty (D, T); return;
+ case 0xf7aff1c0: free_ds_constructor_input_media_uploaded_photo (D, T); return;
+ case 0xe9bfb4f3: free_ds_constructor_input_media_photo (D, T); return;
+ case 0xf9c44144: free_ds_constructor_input_media_geo_point (D, T); return;
+ case 0xa6e45987: free_ds_constructor_input_media_contact (D, T); return;
+ case 0xe13fd4bc: free_ds_constructor_input_media_uploaded_video (D, T); return;
+ case 0x96fb97dc: free_ds_constructor_input_media_uploaded_thumb_video (D, T); return;
+ case 0x936a4ebd: free_ds_constructor_input_media_video (D, T); return;
+ case 0x4e498cab: free_ds_constructor_input_media_uploaded_audio (D, T); return;
+ case 0x89938781: free_ds_constructor_input_media_audio (D, T); return;
+ case 0xffe76b78: free_ds_constructor_input_media_uploaded_document (D, T); return;
+ case 0x41481486: free_ds_constructor_input_media_uploaded_thumb_document (D, T); return;
+ case 0xd184e841: free_ds_constructor_input_media_document (D, T); return;
+ case 0x2827a81a: free_ds_constructor_input_media_venue (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_input_notify_peer (struct tl_ds_input_notify_peer *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xb8bc5b0c: free_ds_constructor_input_notify_peer (D, T); return;
+ case 0x193b4417: free_ds_constructor_input_notify_users (D, T); return;
+ case 0x4a95e84e: free_ds_constructor_input_notify_chats (D, T); return;
+ case 0xa429b886: free_ds_constructor_input_notify_all (D, T); return;
+ case 0x4d8ddec8: free_ds_constructor_input_notify_geo_chat_peer (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_input_peer (struct tl_ds_input_peer *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x7f3b18ea: free_ds_constructor_input_peer_empty (D, T); return;
+ case 0x7da07ec9: free_ds_constructor_input_peer_self (D, T); return;
+ case 0x1023dbe8: free_ds_constructor_input_peer_contact (D, T); return;
+ case 0x9b447325: free_ds_constructor_input_peer_foreign (D, T); return;
+ case 0x179be863: free_ds_constructor_input_peer_chat (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_input_peer_notify_events (struct tl_ds_input_peer_notify_events *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xf03064d8: free_ds_constructor_input_peer_notify_events_empty (D, T); return;
+ case 0xe86a2c74: free_ds_constructor_input_peer_notify_events_all (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_input_peer_notify_settings (struct tl_ds_input_peer_notify_settings *D, struct paramed_type *T) {
+ free_ds_constructor_input_peer_notify_settings (D, T); return;
+}
+void free_ds_type_input_photo (struct tl_ds_input_photo *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x1cd7bf0d: free_ds_constructor_input_photo_empty (D, T); return;
+ case 0xfb95c6c4: free_ds_constructor_input_photo (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_input_photo_crop (struct tl_ds_input_photo_crop *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xade6b004: free_ds_constructor_input_photo_crop_auto (D, T); return;
+ case 0xd9915325: free_ds_constructor_input_photo_crop (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_input_privacy_key (struct tl_ds_input_privacy_key *D, struct paramed_type *T) {
+ free_ds_constructor_input_privacy_key_status_timestamp (D, T); return;
+}
+void free_ds_type_input_privacy_rule (struct tl_ds_input_privacy_rule *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x0d09e07b: free_ds_constructor_input_privacy_value_allow_contacts (D, T); return;
+ case 0x184b35ce: free_ds_constructor_input_privacy_value_allow_all (D, T); return;
+ case 0x131cc67f: free_ds_constructor_input_privacy_value_allow_users (D, T); return;
+ case 0x0ba52007: free_ds_constructor_input_privacy_value_disallow_contacts (D, T); return;
+ case 0xd66b66c9: free_ds_constructor_input_privacy_value_disallow_all (D, T); return;
+ case 0x90110467: free_ds_constructor_input_privacy_value_disallow_users (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_input_sticker_set (struct tl_ds_input_sticker_set *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xffb62b95: free_ds_constructor_input_sticker_set_empty (D, T); return;
+ case 0x9de7a269: free_ds_constructor_input_sticker_set_i_d (D, T); return;
+ case 0x861cc8a0: free_ds_constructor_input_sticker_set_short_name (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_input_user (struct tl_ds_input_user *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xb98886cf: free_ds_constructor_input_user_empty (D, T); return;
+ case 0xf7c1b13f: free_ds_constructor_input_user_self (D, T); return;
+ case 0x86e94f65: free_ds_constructor_input_user_contact (D, T); return;
+ case 0x655e74ff: free_ds_constructor_input_user_foreign (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_input_video (struct tl_ds_input_video *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x5508ec75: free_ds_constructor_input_video_empty (D, T); return;
+ case 0xee579652: free_ds_constructor_input_video (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_int (int *D, struct paramed_type *T) {
+ free_ds_constructor_int (D, T); return;
+}
+void free_ds_type_int128 (struct tl_ds_int128 *D, struct paramed_type *T) {
+ free_ds_constructor_int128 (D, T); return;
+}
+void free_ds_type_int256 (struct tl_ds_int256 *D, struct paramed_type *T) {
+ free_ds_constructor_int256 (D, T); return;
+}
+void free_ds_type_keyboard_button (struct tl_ds_keyboard_button *D, struct paramed_type *T) {
+ free_ds_constructor_keyboard_button (D, T); return;
+}
+void free_ds_type_keyboard_button_row (struct tl_ds_keyboard_button_row *D, struct paramed_type *T) {
+ free_ds_constructor_keyboard_button_row (D, T); return;
+}
+void free_ds_type_long (long long *D, struct paramed_type *T) {
+ free_ds_constructor_long (D, T); return;
+}
+void free_ds_type_message (struct tl_ds_message *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x83e5de54: free_ds_constructor_message_empty (D, T); return;
+ case 0xc3060325: free_ds_constructor_message (D, T); return;
+ case 0x1d86f70e: free_ds_constructor_message_service (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_message_action (struct tl_ds_message_action *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xb6aef7b0: free_ds_constructor_message_action_empty (D, T); return;
+ case 0xa6638b9a: free_ds_constructor_message_action_chat_create (D, T); return;
+ case 0xb5a1ce5a: free_ds_constructor_message_action_chat_edit_title (D, T); return;
+ case 0x7fcb13a8: free_ds_constructor_message_action_chat_edit_photo (D, T); return;
+ case 0x95e3fbef: free_ds_constructor_message_action_chat_delete_photo (D, T); return;
+ case 0x5e3cfc4b: free_ds_constructor_message_action_chat_add_user (D, T); return;
+ case 0xb2ae9b0c: free_ds_constructor_message_action_chat_delete_user (D, T); return;
+ case 0x6f038ebc: free_ds_constructor_message_action_geo_chat_create (D, T); return;
+ case 0x0c7d53de: free_ds_constructor_message_action_geo_chat_checkin (D, T); return;
+ case 0xf89cf5e8: free_ds_constructor_message_action_chat_joined_by_link (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_message_media (struct tl_ds_message_media *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x3ded6320: free_ds_constructor_message_media_empty (D, T); return;
+ case 0x3d8ce53d: free_ds_constructor_message_media_photo (D, T); return;
+ case 0x5bcf1675: free_ds_constructor_message_media_video (D, T); return;
+ case 0x56e0d474: free_ds_constructor_message_media_geo (D, T); return;
+ case 0x5e7d2f39: free_ds_constructor_message_media_contact (D, T); return;
+ case 0x9f84f49e: free_ds_constructor_message_media_unsupported (D, T); return;
+ case 0x2fda2204: free_ds_constructor_message_media_document (D, T); return;
+ case 0xc6b68300: free_ds_constructor_message_media_audio (D, T); return;
+ case 0xa32dd600: free_ds_constructor_message_media_web_page (D, T); return;
+ case 0x7912b71f: free_ds_constructor_message_media_venue (D, T); return;
+ case 0xc8c45a2a: free_ds_constructor_message_media_photo_l27 (D, T); return;
+ case 0xa2d24290: free_ds_constructor_message_media_video_l27 (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_messages_filter (struct tl_ds_messages_filter *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x57e2f66c: free_ds_constructor_input_messages_filter_empty (D, T); return;
+ case 0x9609a51c: free_ds_constructor_input_messages_filter_photos (D, T); return;
+ case 0x9fc00e65: free_ds_constructor_input_messages_filter_video (D, T); return;
+ case 0x56e9f0e4: free_ds_constructor_input_messages_filter_photo_video (D, T); return;
+ case 0xd95e73bb: free_ds_constructor_input_messages_filter_photo_video_documents (D, T); return;
+ case 0x9eddf188: free_ds_constructor_input_messages_filter_document (D, T); return;
+ case 0xcfc87522: free_ds_constructor_input_messages_filter_audio (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_nearest_dc (struct tl_ds_nearest_dc *D, struct paramed_type *T) {
+ free_ds_constructor_nearest_dc (D, T); return;
+}
+void free_ds_type_notify_peer (struct tl_ds_notify_peer *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x9fd40bd8: free_ds_constructor_notify_peer (D, T); return;
+ case 0xb4c83b4c: free_ds_constructor_notify_users (D, T); return;
+ case 0xc007cec3: free_ds_constructor_notify_chats (D, T); return;
+ case 0x74d07c60: free_ds_constructor_notify_all (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_null (struct tl_ds_null *D, struct paramed_type *T) {
+ free_ds_constructor_null (D, T); return;
+}
+void free_ds_type_p_q_inner_data (struct tl_ds_p_q_inner_data *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x83c95aec: free_ds_constructor_p_q_inner_data (D, T); return;
+ case 0x3c6a84d4: free_ds_constructor_p_q_inner_data_temp (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_peer (struct tl_ds_peer *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x9db1bc6d: free_ds_constructor_peer_user (D, T); return;
+ case 0xbad0e5bb: free_ds_constructor_peer_chat (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_peer_notify_events (struct tl_ds_peer_notify_events *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xadd53cb3: free_ds_constructor_peer_notify_events_empty (D, T); return;
+ case 0x6d1ded88: free_ds_constructor_peer_notify_events_all (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_peer_notify_settings (struct tl_ds_peer_notify_settings *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x70a68512: free_ds_constructor_peer_notify_settings_empty (D, T); return;
+ case 0x8d5e11ee: free_ds_constructor_peer_notify_settings (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_photo (struct tl_ds_photo *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x2331b22d: free_ds_constructor_photo_empty (D, T); return;
+ case 0xc3838076: free_ds_constructor_photo (D, T); return;
+ case 0x22b56751: free_ds_constructor_photo_l27 (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_photo_size (struct tl_ds_photo_size *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x0e17e23c: free_ds_constructor_photo_size_empty (D, T); return;
+ case 0x77bfb61b: free_ds_constructor_photo_size (D, T); return;
+ case 0xe9a734fa: free_ds_constructor_photo_cached_size (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_privacy_key (struct tl_ds_privacy_key *D, struct paramed_type *T) {
+ free_ds_constructor_privacy_key_status_timestamp (D, T); return;
+}
+void free_ds_type_privacy_rule (struct tl_ds_privacy_rule *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xfffe1bac: free_ds_constructor_privacy_value_allow_contacts (D, T); return;
+ case 0x65427b82: free_ds_constructor_privacy_value_allow_all (D, T); return;
+ case 0x4d5bbe0c: free_ds_constructor_privacy_value_allow_users (D, T); return;
+ case 0xf888fa1a: free_ds_constructor_privacy_value_disallow_contacts (D, T); return;
+ case 0x8b73e763: free_ds_constructor_privacy_value_disallow_all (D, T); return;
+ case 0x0c7f49b7: free_ds_constructor_privacy_value_disallow_users (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_received_notify_message (struct tl_ds_received_notify_message *D, struct paramed_type *T) {
+ free_ds_constructor_received_notify_message (D, T); return;
+}
+void free_ds_type_reply_markup (struct tl_ds_reply_markup *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xa03e5b85: free_ds_constructor_reply_keyboard_hide (D, T); return;
+ case 0xf4108aa0: free_ds_constructor_reply_keyboard_force_reply (D, T); return;
+ case 0x3502758c: free_ds_constructor_reply_keyboard_markup (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_res_p_q (struct tl_ds_res_p_q *D, struct paramed_type *T) {
+ free_ds_constructor_res_p_q (D, T); return;
+}
+void free_ds_type_send_message_action (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x16bf744e: free_ds_constructor_send_message_typing_action (D, T); return;
+ case 0xfd5ec8f5: free_ds_constructor_send_message_cancel_action (D, T); return;
+ case 0xa187d66f: free_ds_constructor_send_message_record_video_action (D, T); return;
+ case 0x92042ff7: free_ds_constructor_send_message_upload_video_action_l27 (D, T); return;
+ case 0xe9763aec: free_ds_constructor_send_message_upload_video_action (D, T); return;
+ case 0xd52f73f7: free_ds_constructor_send_message_record_audio_action (D, T); return;
+ case 0xe6ac8a6f: free_ds_constructor_send_message_upload_audio_action_l27 (D, T); return;
+ case 0xf351d7ab: free_ds_constructor_send_message_upload_audio_action (D, T); return;
+ case 0xd1d34a26: free_ds_constructor_send_message_upload_photo_action (D, T); return;
+ case 0x8faee98e: free_ds_constructor_send_message_upload_document_action_l27 (D, T); return;
+ case 0xaa0cd9e4: free_ds_constructor_send_message_upload_document_action (D, T); return;
+ case 0x176f8ba1: free_ds_constructor_send_message_geo_location_action (D, T); return;
+ case 0x628cbc6f: free_ds_constructor_send_message_choose_contact_action (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_server_d_h_params (struct tl_ds_server_d_h_params *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x79cb045d: free_ds_constructor_server_d_h_params_fail (D, T); return;
+ case 0xd0e8075c: free_ds_constructor_server_d_h_params_ok (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_server_d_h_inner_data (struct tl_ds_server_d_h_inner_data *D, struct paramed_type *T) {
+ free_ds_constructor_server_d_h_inner_data (D, T); return;
+}
+void free_ds_type_set_client_d_h_params_answer (struct tl_ds_set_client_d_h_params_answer *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x3bcbf734: free_ds_constructor_dh_gen_ok (D, T); return;
+ case 0x46dc1fb9: free_ds_constructor_dh_gen_retry (D, T); return;
+ case 0xa69dae02: free_ds_constructor_dh_gen_fail (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_sticker_pack (struct tl_ds_sticker_pack *D, struct paramed_type *T) {
+ free_ds_constructor_sticker_pack (D, T); return;
+}
+void free_ds_type_sticker_set (struct tl_ds_sticker_set *D, struct paramed_type *T) {
+ free_ds_constructor_sticker_set (D, T); return;
+}
+void free_ds_type_string (struct tl_ds_string *D, struct paramed_type *T) {
+ free_ds_constructor_string (D, T); return;
+}
+void free_ds_type_update (struct tl_ds_update *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x1f2b0afd: free_ds_constructor_update_new_message (D, T); return;
+ case 0x4e90bfd6: free_ds_constructor_update_message_i_d (D, T); return;
+ case 0xa20db0e5: free_ds_constructor_update_delete_messages (D, T); return;
+ case 0x5c486927: free_ds_constructor_update_user_typing (D, T); return;
+ case 0x9a65ea1f: free_ds_constructor_update_chat_user_typing (D, T); return;
+ case 0x07761198: free_ds_constructor_update_chat_participants (D, T); return;
+ case 0x1bfbd823: free_ds_constructor_update_user_status (D, T); return;
+ case 0xa7332b73: free_ds_constructor_update_user_name (D, T); return;
+ case 0x95313b0c: free_ds_constructor_update_user_photo (D, T); return;
+ case 0x2575bbb9: free_ds_constructor_update_contact_registered (D, T); return;
+ case 0x9d2e67c5: free_ds_constructor_update_contact_link (D, T); return;
+ case 0x8f06529a: free_ds_constructor_update_new_authorization (D, T); return;
+ case 0x5a68e3f7: free_ds_constructor_update_new_geo_chat_message (D, T); return;
+ case 0x12bcbd9a: free_ds_constructor_update_new_encrypted_message (D, T); return;
+ case 0x1710f156: free_ds_constructor_update_encrypted_chat_typing (D, T); return;
+ case 0xb4a2e88d: free_ds_constructor_update_encryption (D, T); return;
+ case 0x38fe25b7: free_ds_constructor_update_encrypted_messages_read (D, T); return;
+ case 0x3a0eeb22: free_ds_constructor_update_chat_participant_add (D, T); return;
+ case 0x6e5f8c22: free_ds_constructor_update_chat_participant_delete (D, T); return;
+ case 0x8e5e9873: free_ds_constructor_update_dc_options (D, T); return;
+ case 0x80ece81a: free_ds_constructor_update_user_blocked (D, T); return;
+ case 0xbec268ef: free_ds_constructor_update_notify_settings (D, T); return;
+ case 0x382dd3e4: free_ds_constructor_update_service_notification (D, T); return;
+ case 0xee3b272a: free_ds_constructor_update_privacy (D, T); return;
+ case 0x12b9417b: free_ds_constructor_update_user_phone (D, T); return;
+ case 0x9961fd5c: free_ds_constructor_update_read_history_inbox (D, T); return;
+ case 0x2f2f21bf: free_ds_constructor_update_read_history_outbox (D, T); return;
+ case 0x2cc36971: free_ds_constructor_update_web_page (D, T); return;
+ case 0x68c13933: free_ds_constructor_update_read_messages_contents (D, T); return;
+ case 0x03114739: free_ds_constructor_update_msg_update (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_updates (struct tl_ds_updates *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xe317af7e: free_ds_constructor_updates_too_long (D, T); return;
+ case 0xed5c2127: free_ds_constructor_update_short_message (D, T); return;
+ case 0x52238b3c: free_ds_constructor_update_short_chat_message (D, T); return;
+ case 0x78d4dec1: free_ds_constructor_update_short (D, T); return;
+ case 0x725b04c3: free_ds_constructor_updates_combined (D, T); return;
+ case 0x74ae4240: free_ds_constructor_updates (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_user (struct tl_ds_user *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x200250ba: free_ds_constructor_user_empty (D, T); return;
+ case 0x22e49072: free_ds_constructor_user (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_user_full (struct tl_ds_user_full *D, struct paramed_type *T) {
+ free_ds_constructor_user_full (D, T); return;
+}
+void free_ds_type_user_profile_photo (struct tl_ds_user_profile_photo *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x4f11bae1: free_ds_constructor_user_profile_photo_empty (D, T); return;
+ case 0xd559d8c8: free_ds_constructor_user_profile_photo (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_user_status (struct tl_ds_user_status *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x09d05049: free_ds_constructor_user_status_empty (D, T); return;
+ case 0xedb93949: free_ds_constructor_user_status_online (D, T); return;
+ case 0x008c703f: free_ds_constructor_user_status_offline (D, T); return;
+ case 0xe26f42f1: free_ds_constructor_user_status_recently (D, T); return;
+ case 0x07bf09fc: free_ds_constructor_user_status_last_week (D, T); return;
+ case 0x77ebc742: free_ds_constructor_user_status_last_month (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_vector (struct tl_ds_vector *D, struct paramed_type *T) {
+ free_ds_constructor_vector (D, T); return;
+}
+void free_ds_type_video (struct tl_ds_video *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xc10658a8: free_ds_constructor_video_empty (D, T); return;
+ case 0xee9f4a4d: free_ds_constructor_video (D, T); return;
+ case 0x388fa391: free_ds_constructor_video_l27 (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_wall_paper (struct tl_ds_wall_paper *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xccb03657: free_ds_constructor_wall_paper (D, T); return;
+ case 0x63117f24: free_ds_constructor_wall_paper_solid (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_web_page (struct tl_ds_web_page *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xeb1477e8: free_ds_constructor_web_page_empty (D, T); return;
+ case 0xc586da1c: free_ds_constructor_web_page_pending (D, T); return;
+ case 0xa31ea0b5: free_ds_constructor_web_page (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_account_authorizations (struct tl_ds_account_authorizations *D, struct paramed_type *T) {
+ free_ds_constructor_account_authorizations (D, T); return;
+}
+void free_ds_type_account_password (struct tl_ds_account_password *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x96dabc18: free_ds_constructor_account_no_password (D, T); return;
+ case 0x7c18141c: free_ds_constructor_account_password (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_account_password_input_settings (struct tl_ds_account_password_input_settings *D, struct paramed_type *T) {
+ free_ds_constructor_account_password_input_settings (D, T); return;
+}
+void free_ds_type_account_password_settings (struct tl_ds_account_password_settings *D, struct paramed_type *T) {
+ free_ds_constructor_account_password_settings (D, T); return;
+}
+void free_ds_type_account_privacy_rules (struct tl_ds_account_privacy_rules *D, struct paramed_type *T) {
+ free_ds_constructor_account_privacy_rules (D, T); return;
+}
+void free_ds_type_account_sent_change_phone_code (struct tl_ds_account_sent_change_phone_code *D, struct paramed_type *T) {
+ free_ds_constructor_account_sent_change_phone_code (D, T); return;
+}
+void free_ds_type_auth_authorization (struct tl_ds_auth_authorization *D, struct paramed_type *T) {
+ free_ds_constructor_auth_authorization (D, T); return;
+}
+void free_ds_type_auth_checked_phone (struct tl_ds_auth_checked_phone *D, struct paramed_type *T) {
+ free_ds_constructor_auth_checked_phone (D, T); return;
+}
+void free_ds_type_auth_exported_authorization (struct tl_ds_auth_exported_authorization *D, struct paramed_type *T) {
+ free_ds_constructor_auth_exported_authorization (D, T); return;
+}
+void free_ds_type_auth_password_recovery (struct tl_ds_auth_password_recovery *D, struct paramed_type *T) {
+ free_ds_constructor_auth_password_recovery (D, T); return;
+}
+void free_ds_type_auth_sent_code (struct tl_ds_auth_sent_code *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xefed51d9: free_ds_constructor_auth_sent_code (D, T); return;
+ case 0xe325edcf: free_ds_constructor_auth_sent_app_code (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_binlog_encr_key (struct tl_ds_binlog_encr_key *D, struct paramed_type *T) {
+ free_ds_constructor_binlog_encr_key (D, T); return;
+}
+void free_ds_type_binlog_update (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x3b06de69: free_ds_constructor_binlog_start (D, T); return;
+ case 0xf96feb32: free_ds_constructor_binlog_dc_option (D, T); return;
+ case 0x7c0d22d8: free_ds_constructor_binlog_dc_option_new (D, T); return;
+ case 0x71e8c156: free_ds_constructor_binlog_auth_key (D, T); return;
+ case 0x9e83dbdc: free_ds_constructor_binlog_default_dc (D, T); return;
+ case 0x26451bb5: free_ds_constructor_binlog_dc_signed (D, T); return;
+ case 0x68a870e8: free_ds_constructor_binlog_our_id (D, T); return;
+ case 0xeaeb7826: free_ds_constructor_binlog_set_dh_params (D, T); return;
+ case 0x2ca8c939: free_ds_constructor_binlog_set_pts (D, T); return;
+ case 0xd95738ac: free_ds_constructor_binlog_set_qts (D, T); return;
+ case 0x1d0f4b52: free_ds_constructor_binlog_set_date (D, T); return;
+ case 0x6eeb2989: free_ds_constructor_binlog_set_seq (D, T); return;
+ case 0xee1b38e8: free_ds_constructor_binlog_encr_chat_delete (D, T); return;
+ case 0x84977251: free_ds_constructor_binlog_encr_chat_new (D, T); return;
+ case 0x9d49488d: free_ds_constructor_binlog_encr_chat_exchange_new (D, T); return;
+ case 0xac55d447: free_ds_constructor_binlog_user_delete (D, T); return;
+ case 0x127cf2f9: free_ds_constructor_binlog_user_new (D, T); return;
+ case 0x0a10aa92: free_ds_constructor_binlog_chat_new (D, T); return;
+ case 0x535475ea: free_ds_constructor_binlog_chat_add_participant (D, T); return;
+ case 0x7dd1a1a2: free_ds_constructor_binlog_chat_del_participant (D, T); return;
+ case 0x3c873416: free_ds_constructor_binlog_set_msg_id (D, T); return;
+ case 0x847e77b1: free_ds_constructor_binlog_message_delete (D, T); return;
+ case 0x427cfcdb: free_ds_constructor_binlog_message_new (D, T); return;
+ case 0x6cf7cabc: free_ds_constructor_binlog_message_encr_new (D, T); return;
+ case 0x6dd4d85f: free_ds_constructor_binlog_msg_update (D, T); return;
+ case 0x83327955: free_ds_constructor_binlog_reset_authorization (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_contacts_blocked (struct tl_ds_contacts_blocked *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x1c138d15: free_ds_constructor_contacts_blocked (D, T); return;
+ case 0x900802a1: free_ds_constructor_contacts_blocked_slice (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_contacts_contacts (struct tl_ds_contacts_contacts *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xb74ba9d2: free_ds_constructor_contacts_contacts_not_modified (D, T); return;
+ case 0x6f8b8cb2: free_ds_constructor_contacts_contacts (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_contacts_found (struct tl_ds_contacts_found *D, struct paramed_type *T) {
+ free_ds_constructor_contacts_found (D, T); return;
+}
+void free_ds_type_contacts_imported_contacts (struct tl_ds_contacts_imported_contacts *D, struct paramed_type *T) {
+ free_ds_constructor_contacts_imported_contacts (D, T); return;
+}
+void free_ds_type_contacts_link (struct tl_ds_contacts_link *D, struct paramed_type *T) {
+ free_ds_constructor_contacts_link (D, T); return;
+}
+void free_ds_type_contacts_suggested (struct tl_ds_contacts_suggested *D, struct paramed_type *T) {
+ free_ds_constructor_contacts_suggested (D, T); return;
+}
+void free_ds_type_geochats_located (struct tl_ds_geochats_located *D, struct paramed_type *T) {
+ free_ds_constructor_geochats_located (D, T); return;
+}
+void free_ds_type_geochats_messages (struct tl_ds_geochats_messages *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xd1526db1: free_ds_constructor_geochats_messages (D, T); return;
+ case 0xbc5863e8: free_ds_constructor_geochats_messages_slice (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_geochats_stated_message (struct tl_ds_geochats_stated_message *D, struct paramed_type *T) {
+ free_ds_constructor_geochats_stated_message (D, T); return;
+}
+void free_ds_type_help_app_update (struct tl_ds_help_app_update *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x8987f311: free_ds_constructor_help_app_update (D, T); return;
+ case 0xc45a6536: free_ds_constructor_help_no_app_update (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_help_invite_text (struct tl_ds_help_invite_text *D, struct paramed_type *T) {
+ free_ds_constructor_help_invite_text (D, T); return;
+}
+void free_ds_type_help_support (struct tl_ds_help_support *D, struct paramed_type *T) {
+ free_ds_constructor_help_support (D, T); return;
+}
+void free_ds_type_messages_affected_history (struct tl_ds_messages_affected_history *D, struct paramed_type *T) {
+ free_ds_constructor_messages_affected_history (D, T); return;
+}
+void free_ds_type_messages_affected_messages (struct tl_ds_messages_affected_messages *D, struct paramed_type *T) {
+ free_ds_constructor_messages_affected_messages (D, T); return;
+}
+void free_ds_type_messages_all_stickers (struct tl_ds_messages_all_stickers *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xe86602c3: free_ds_constructor_messages_all_stickers_not_modified (D, T); return;
+ case 0x5ce352ec: free_ds_constructor_messages_all_stickers (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_messages_chat_full (struct tl_ds_messages_chat_full *D, struct paramed_type *T) {
+ free_ds_constructor_messages_chat_full (D, T); return;
+}
+void free_ds_type_messages_chats (struct tl_ds_messages_chats *D, struct paramed_type *T) {
+ free_ds_constructor_messages_chats (D, T); return;
+}
+void free_ds_type_messages_dh_config (struct tl_ds_messages_dh_config *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xc0e24635: free_ds_constructor_messages_dh_config_not_modified (D, T); return;
+ case 0x2c221edd: free_ds_constructor_messages_dh_config (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_messages_dialogs (struct tl_ds_messages_dialogs *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x15ba6c40: free_ds_constructor_messages_dialogs (D, T); return;
+ case 0x71e094f3: free_ds_constructor_messages_dialogs_slice (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_messages_message (struct tl_ds_messages_message *D, struct paramed_type *T) {
+ free_ds_constructor_messages_message_empty (D, T); return;
+}
+void free_ds_type_messages_messages (struct tl_ds_messages_messages *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x8c718e87: free_ds_constructor_messages_messages (D, T); return;
+ case 0x0b446ae3: free_ds_constructor_messages_messages_slice (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_messages_sent_encrypted_message (struct tl_ds_messages_sent_encrypted_message *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x560f8935: free_ds_constructor_messages_sent_encrypted_message (D, T); return;
+ case 0x9493ff32: free_ds_constructor_messages_sent_encrypted_file (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_messages_sent_message (struct tl_ds_messages_sent_message *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x4c3d47f3: free_ds_constructor_messages_sent_message (D, T); return;
+ case 0x35a1a663: free_ds_constructor_messages_sent_message_link (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_messages_sticker_set (struct tl_ds_messages_sticker_set *D, struct paramed_type *T) {
+ free_ds_constructor_messages_sticker_set (D, T); return;
+}
+void free_ds_type_messages_stickers (struct tl_ds_messages_stickers *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xf1749a22: free_ds_constructor_messages_stickers_not_modified (D, T); return;
+ case 0x8a8ecd32: free_ds_constructor_messages_stickers (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_photos_photo (struct tl_ds_photos_photo *D, struct paramed_type *T) {
+ free_ds_constructor_photos_photo (D, T); return;
+}
+void free_ds_type_photos_photos (struct tl_ds_photos_photos *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x8dca6aa5: free_ds_constructor_photos_photos (D, T); return;
+ case 0x15051f54: free_ds_constructor_photos_photos_slice (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_storage_file_type (struct tl_ds_storage_file_type *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xaa963b05: free_ds_constructor_storage_file_unknown (D, T); return;
+ case 0x007efe0e: free_ds_constructor_storage_file_jpeg (D, T); return;
+ case 0xcae1aadf: free_ds_constructor_storage_file_gif (D, T); return;
+ case 0x0a4f63c0: free_ds_constructor_storage_file_png (D, T); return;
+ case 0xae1e508d: free_ds_constructor_storage_file_pdf (D, T); return;
+ case 0x528a0677: free_ds_constructor_storage_file_mp3 (D, T); return;
+ case 0x4b09ebbc: free_ds_constructor_storage_file_mov (D, T); return;
+ case 0x40bc6f52: free_ds_constructor_storage_file_partial (D, T); return;
+ case 0xb3cea0e4: free_ds_constructor_storage_file_mp4 (D, T); return;
+ case 0x1081464c: free_ds_constructor_storage_file_webp (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_updates_difference (struct tl_ds_updates_difference *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x5d75a138: free_ds_constructor_updates_difference_empty (D, T); return;
+ case 0x00f49ca0: free_ds_constructor_updates_difference (D, T); return;
+ case 0xa8fb1981: free_ds_constructor_updates_difference_slice (D, T); return;
+ default: assert (0);
+ }
+}
+void free_ds_type_updates_state (struct tl_ds_updates_state *D, struct paramed_type *T) {
+ free_ds_constructor_updates_state (D, T); return;
+}
+void free_ds_type_upload_file (struct tl_ds_upload_file *D, struct paramed_type *T) {
+ free_ds_constructor_upload_file (D, T); return;
+}
+void free_ds_type_any (void *D, struct paramed_type *T) {
+ switch (T->type->name) {
+ case 0xb8d0afdf: free_ds_type_account_days_t_t_l (D, T); return;
+ case 0x472f5020: free_ds_type_account_days_t_t_l (D, T); return;
+ case 0x9fc5ec4e: free_ds_type_audio (D, T); return;
+ case 0x603a13b1: free_ds_type_audio (D, T); return;
+ case 0x7bf2e6f6: free_ds_type_authorization (D, T); return;
+ case 0x840d1909: free_ds_type_authorization (D, T); return;
+ case 0x250be282: free_ds_type_bool (D, T); return;
+ case 0xdaf41d7d: free_ds_type_bool (D, T); return;
+ case 0x75e7ea6c: free_ds_type_bot_command (D, T); return;
+ case 0x8a181593: free_ds_type_bot_command (D, T); return;
+ case 0xb2e16f93: free_ds_type_bot_info (D, T); return;
+ case 0x4d1e906c: free_ds_type_bot_info (D, T); return;
+ case 0x0ee1379f: free_ds_type_bytes (D, T); return;
+ case 0xf11ec860: free_ds_type_bytes (D, T); return;
+ case 0x7bd865dc: free_ds_type_chat (D, T); return;
+ case 0x84279a23: free_ds_type_chat (D, T); return;
+ case 0x2e02a614: free_ds_type_chat_full (D, T); return;
+ case 0xd1fd59eb: free_ds_type_chat_full (D, T); return;
+ case 0x94f910b1: free_ds_type_chat_invite (D, T); return;
+ case 0x6b06ef4e: free_ds_type_chat_invite (D, T); return;
+ case 0x3631cf4c: free_ds_type_chat_located (D, T); return;
+ case 0xc9ce30b3: free_ds_type_chat_located (D, T); return;
+ case 0xc8d7493e: free_ds_type_chat_participant (D, T); return;
+ case 0x3728b6c1: free_ds_type_chat_participant (D, T); return;
+ case 0x77930f9f: free_ds_type_chat_participants (D, T); return;
+ case 0x886cf060: free_ds_type_chat_participants (D, T); return;
+ case 0x56922676: free_ds_type_chat_photo (D, T); return;
+ case 0xa96dd989: free_ds_type_chat_photo (D, T); return;
+ case 0x6643b654: free_ds_type_client_d_h_inner_data (D, T); return;
+ case 0x99bc49ab: free_ds_type_client_d_h_inner_data (D, T); return;
+ case 0x4e32b894: free_ds_type_config (D, T); return;
+ case 0xb1cd476b: free_ds_type_config (D, T); return;
+ case 0xf911c994: free_ds_type_contact (D, T); return;
+ case 0x06ee366b: free_ds_type_contact (D, T); return;
+ case 0x561bc879: free_ds_type_contact_blocked (D, T); return;
+ case 0xa9e43786: free_ds_type_contact_blocked (D, T); return;
+ case 0xea879f95: free_ds_type_contact_found (D, T); return;
+ case 0x1578606a: free_ds_type_contact_found (D, T); return;
+ case 0x522fbc63: free_ds_type_contact_link (D, T); return;
+ case 0xadd0439c: free_ds_type_contact_link (D, T); return;
+ case 0xd3680c61: free_ds_type_contact_status (D, T); return;
+ case 0x2c97f39e: free_ds_type_contact_status (D, T); return;
+ case 0x3de191a1: free_ds_type_contact_suggested (D, T); return;
+ case 0xc21e6e5e: free_ds_type_contact_suggested (D, T); return;
+ case 0x2b1a62f0: free_ds_type_dc_option (D, T); return;
+ case 0xd4e59d0f: free_ds_type_dc_option (D, T); return;
+ case 0x535b7918: free_ds_type_decrypted_message (D, T); return;
+ case 0xaca486e7: free_ds_type_decrypted_message (D, T); return;
+ case 0x4e0eefde: free_ds_type_decrypted_message_action (D, T); return;
+ case 0xb1f11021: free_ds_type_decrypted_message_action (D, T); return;
+ case 0x1be31789: free_ds_type_decrypted_message_layer (D, T); return;
+ case 0xe41ce876: free_ds_type_decrypted_message_layer (D, T); return;
+ case 0x34e0d674: free_ds_type_decrypted_message_media (D, T); return;
+ case 0xcb1f298b: free_ds_type_decrypted_message_media (D, T); return;
+ case 0xc1dd804a: free_ds_type_dialog (D, T); return;
+ case 0x3e227fb5: free_ds_type_dialog (D, T); return;
+ case 0xae636f24: free_ds_type_disabled_feature (D, T); return;
+ case 0x519c90db: free_ds_type_disabled_feature (D, T); return;
+ case 0x51a73418: free_ds_type_document (D, T); return;
+ case 0xae58cbe7: free_ds_type_document (D, T); return;
+ case 0x97c637a3: free_ds_type_document_attribute (D, T); return;
+ case 0x6839c85c: free_ds_type_document_attribute (D, T); return;
+ case 0x2210c154: free_ds_type_double (D, T); return;
+ case 0xddef3eab: free_ds_type_double (D, T); return;
+ case 0xb1718213: free_ds_type_encrypted_chat (D, T); return;
+ case 0x4e8e7dec: free_ds_type_encrypted_chat (D, T); return;
+ case 0x886fd032: free_ds_type_encrypted_file (D, T); return;
+ case 0x77902fcd: free_ds_type_encrypted_file (D, T); return;
+ case 0xce6b8a1e: free_ds_type_encrypted_message (D, T); return;
+ case 0x319475e1: free_ds_type_encrypted_message (D, T); return;
+ case 0xc4b9f9bb: free_ds_type_error (D, T); return;
+ case 0x3b460644: free_ds_type_error (D, T); return;
+ case 0x95f132d5: free_ds_type_exported_chat_invite (D, T); return;
+ case 0x6a0ecd2a: free_ds_type_exported_chat_invite (D, T); return;
+ case 0x2f8ffb30: free_ds_type_file_location (D, T); return;
+ case 0xd07004cf: free_ds_type_file_location (D, T); return;
+ case 0xf67b4034: free_ds_type_geo_chat_message (D, T); return;
+ case 0x0984bfcb: free_ds_type_geo_chat_message (D, T); return;
+ case 0x315e0a53: free_ds_type_geo_point (D, T); return;
+ case 0xcea1f5ac: free_ds_type_geo_point (D, T); return;
+ case 0xd0028438: free_ds_type_imported_contact (D, T); return;
+ case 0x2ffd7bc7: free_ds_type_imported_contact (D, T); return;
+ case 0x770656a8: free_ds_type_input_app_event (D, T); return;
+ case 0x88f9a957: free_ds_type_input_app_event (D, T); return;
+ case 0xae8e9c7b: free_ds_type_input_audio (D, T); return;
+ case 0x51716384: free_ds_type_input_audio (D, T); return;
+ case 0x3a60776d: free_ds_type_input_chat_photo (D, T); return;
+ case 0xc59f8892: free_ds_type_input_chat_photo (D, T); return;
+ case 0xf392b7f4: free_ds_type_input_contact (D, T); return;
+ case 0x0c6d480b: free_ds_type_input_contact (D, T); return;
+ case 0x6a8963fc: free_ds_type_input_document (D, T); return;
+ case 0x95769c03: free_ds_type_input_document (D, T); return;
+ case 0xf141b5e1: free_ds_type_input_encrypted_chat (D, T); return;
+ case 0x0ebe4a1e: free_ds_type_input_encrypted_chat (D, T); return;
+ case 0x0b5c064f: free_ds_type_input_encrypted_file (D, T); return;
+ case 0xf4a3f9b0: free_ds_type_input_encrypted_file (D, T); return;
+ case 0x0f60f9ca: free_ds_type_input_file (D, T); return;
+ case 0xf09f0635: free_ds_type_input_file (D, T); return;
+ case 0xe6daa38b: free_ds_type_input_file_location (D, T); return;
+ case 0x19255c74: free_ds_type_input_file_location (D, T); return;
+ case 0x74d456fa: free_ds_type_input_geo_chat (D, T); return;
+ case 0x8b2ba905: free_ds_type_input_geo_chat (D, T); return;
+ case 0x17768f1f: free_ds_type_input_geo_point (D, T); return;
+ case 0xe88970e0: free_ds_type_input_geo_point (D, T); return;
+ case 0xb32c91dd: free_ds_type_input_media (D, T); return;
+ case 0x4cd36e22: free_ds_type_input_media (D, T); return;
+ case 0x02b6911b: free_ds_type_input_notify_peer (D, T); return;
+ case 0xfd496ee4: free_ds_type_input_notify_peer (D, T); return;
+ case 0x9e67268d: free_ds_type_input_peer (D, T); return;
+ case 0x6198d972: free_ds_type_input_peer (D, T); return;
+ case 0x185a48ac: free_ds_type_input_peer_notify_events (D, T); return;
+ case 0xe7a5b753: free_ds_type_input_peer_notify_events (D, T); return;
+ case 0x46a2ce98: free_ds_type_input_peer_notify_settings (D, T); return;
+ case 0xb95d3167: free_ds_type_input_peer_notify_settings (D, T); return;
+ case 0xe74279c9: free_ds_type_input_photo (D, T); return;
+ case 0x18bd8636: free_ds_type_input_photo (D, T); return;
+ case 0x7477e321: free_ds_type_input_photo_crop (D, T); return;
+ case 0x8b881cde: free_ds_type_input_photo_crop (D, T); return;
+ case 0x4f96cb18: free_ds_type_input_privacy_key (D, T); return;
+ case 0xb06934e7: free_ds_type_input_privacy_key (D, T); return;
+ case 0x4b815163: free_ds_type_input_privacy_rule (D, T); return;
+ case 0xb47eae9c: free_ds_type_input_privacy_rule (D, T); return;
+ case 0xe44d415c: free_ds_type_input_sticker_set (D, T); return;
+ case 0x1bb2bea3: free_ds_type_input_sticker_set (D, T); return;
+ case 0xadfe0c6a: free_ds_type_input_user (D, T); return;
+ case 0x5201f395: free_ds_type_input_user (D, T); return;
+ case 0xbb5f7a27: free_ds_type_input_video (D, T); return;
+ case 0x44a085d8: free_ds_type_input_video (D, T); return;
+ case 0xa8509bda: free_ds_type_int (D, T); return;
+ case 0x57af6425: free_ds_type_int (D, T); return;
+ case 0x7d36c439: free_ds_type_int128 (D, T); return;
+ case 0x82c93bc6: free_ds_type_int128 (D, T); return;
+ case 0xf2c798b3: free_ds_type_int256 (D, T); return;
+ case 0x0d38674c: free_ds_type_int256 (D, T); return;
+ case 0xa2fa4880: free_ds_type_keyboard_button (D, T); return;
+ case 0x5d05b77f: free_ds_type_keyboard_button (D, T); return;
+ case 0x77608b83: free_ds_type_keyboard_button_row (D, T); return;
+ case 0x889f747c: free_ds_type_keyboard_button_row (D, T); return;
+ case 0x22076cba: free_ds_type_long (D, T); return;
+ case 0xddf89345: free_ds_type_long (D, T); return;
+ case 0x5d652a7f: free_ds_type_message (D, T); return;
+ case 0xa29ad580: free_ds_type_message (D, T); return;
+ case 0x383415fa: free_ds_type_message_action (D, T); return;
+ case 0xc7cbea05: free_ds_type_message_action (D, T); return;
+ case 0x95f2471a: free_ds_type_message_media (D, T); return;
+ case 0x6a0db8e5: free_ds_type_message_media (D, T); return;
+ case 0x80895ae0: free_ds_type_messages_filter (D, T); return;
+ case 0x7f76a51f: free_ds_type_messages_filter (D, T); return;
+ case 0x8e1a1775: free_ds_type_nearest_dc (D, T); return;
+ case 0x71e5e88a: free_ds_type_nearest_dc (D, T); return;
+ case 0x9fcb8237: free_ds_type_notify_peer (D, T); return;
+ case 0x60347dc8: free_ds_type_notify_peer (D, T); return;
+ case 0x56730bcc: free_ds_type_null (D, T); return;
+ case 0xa98cf433: free_ds_type_null (D, T); return;
+ case 0xbfa3de38: free_ds_type_p_q_inner_data (D, T); return;
+ case 0x405c21c7: free_ds_type_p_q_inner_data (D, T); return;
+ case 0x276159d6: free_ds_type_peer (D, T); return;
+ case 0xd89ea629: free_ds_type_peer (D, T); return;
+ case 0xc0c8d13b: free_ds_type_peer_notify_events (D, T); return;
+ case 0x3f372ec4: free_ds_type_peer_notify_events (D, T); return;
+ case 0xfdf894fc: free_ds_type_peer_notify_settings (D, T); return;
+ case 0x02076b03: free_ds_type_peer_notify_settings (D, T); return;
+ case 0xc207550a: free_ds_type_photo (D, T); return;
+ case 0x3df8aaf5: free_ds_type_photo (D, T); return;
+ case 0x900f60dd: free_ds_type_photo_size (D, T); return;
+ case 0x6ff09f22: free_ds_type_photo_size (D, T); return;
+ case 0xbc2eab30: free_ds_type_privacy_key (D, T); return;
+ case 0x43d154cf: free_ds_type_privacy_key (D, T); return;
+ case 0xa8638aec: free_ds_type_privacy_rule (D, T); return;
+ case 0x579c7513: free_ds_type_privacy_rule (D, T); return;
+ case 0xa384b779: free_ds_type_received_notify_message (D, T); return;
+ case 0x5c7b4886: free_ds_type_received_notify_message (D, T); return;
+ case 0x612ca4a9: free_ds_type_reply_markup (D, T); return;
+ case 0x9ed35b56: free_ds_type_reply_markup (D, T); return;
+ case 0x05162463: free_ds_type_res_p_q (D, T); return;
+ case 0xfae9db9c: free_ds_type_res_p_q (D, T); return;
+ case 0x70541c7e: free_ds_type_send_message_action (D, T); return;
+ case 0x8fabe381: free_ds_type_send_message_action (D, T); return;
+ case 0xa9230301: free_ds_type_server_d_h_params (D, T); return;
+ case 0x56dcfcfe: free_ds_type_server_d_h_params (D, T); return;
+ case 0xb5890dba: free_ds_type_server_d_h_inner_data (D, T); return;
+ case 0x4a76f245: free_ds_type_server_d_h_inner_data (D, T); return;
+ case 0xdb8a468f: free_ds_type_set_client_d_h_params_answer (D, T); return;
+ case 0x2475b970: free_ds_type_set_client_d_h_params_answer (D, T); return;
+ case 0x12b299d4: free_ds_type_sticker_pack (D, T); return;
+ case 0xed4d662b: free_ds_type_sticker_pack (D, T); return;
+ case 0xa7a43b17: free_ds_type_sticker_set (D, T); return;
+ case 0x585bc4e8: free_ds_type_sticker_set (D, T); return;
+ case 0xb5286e24: free_ds_type_string (D, T); return;
+ case 0x4ad791db: free_ds_type_string (D, T); return;
+ case 0x2e02b27e: free_ds_type_update (D, T); return;
+ case 0xd1fd4d81: free_ds_type_update (D, T); return;
+ case 0x22499d27: free_ds_type_updates (D, T); return;
+ case 0xddb662d8: free_ds_type_updates (D, T); return;
+ case 0x02e6c0c8: free_ds_type_user (D, T); return;
+ case 0xfd193f37: free_ds_type_user (D, T); return;
+ case 0x5a89ac5b: free_ds_type_user_full (D, T); return;
+ case 0xa57653a4: free_ds_type_user_full (D, T); return;
+ case 0x9a486229: free_ds_type_user_profile_photo (D, T); return;
+ case 0x65b79dd6: free_ds_type_user_profile_photo (D, T); return;
+ case 0x76de9570: free_ds_type_user_status (D, T); return;
+ case 0x89216a8f: free_ds_type_user_status (D, T); return;
+ case 0x1cb5c415: free_ds_type_vector (D, T); return;
+ case 0xe34a3bea: free_ds_type_vector (D, T); return;
+ case 0x1716b174: free_ds_type_video (D, T); return;
+ case 0xe8e94e8b: free_ds_type_video (D, T); return;
+ case 0xafa14973: free_ds_type_wall_paper (D, T); return;
+ case 0x505eb68c: free_ds_type_wall_paper (D, T); return;
+ case 0x8d8c0d41: free_ds_type_web_page (D, T); return;
+ case 0x7273f2be: free_ds_type_web_page (D, T); return;
+ case 0x1250abde: free_ds_type_account_authorizations (D, T); return;
+ case 0xedaf5421: free_ds_type_account_authorizations (D, T); return;
+ case 0xeac2a804: free_ds_type_account_password (D, T); return;
+ case 0x153d57fb: free_ds_type_account_password (D, T); return;
+ case 0xbcfc532c: free_ds_type_account_password_input_settings (D, T); return;
+ case 0x4303acd3: free_ds_type_account_password_input_settings (D, T); return;
+ case 0xb7b72ab3: free_ds_type_account_password_settings (D, T); return;
+ case 0x4848d54c: free_ds_type_account_password_settings (D, T); return;
+ case 0x554abb6f: free_ds_type_account_privacy_rules (D, T); return;
+ case 0xaab54490: free_ds_type_account_privacy_rules (D, T); return;
+ case 0xa4f58c4c: free_ds_type_account_sent_change_phone_code (D, T); return;
+ case 0x5b0a73b3: free_ds_type_account_sent_change_phone_code (D, T); return;
+ case 0xff036af1: free_ds_type_auth_authorization (D, T); return;
+ case 0x00fc950e: free_ds_type_auth_authorization (D, T); return;
+ case 0x811ea28e: free_ds_type_auth_checked_phone (D, T); return;
+ case 0x7ee15d71: free_ds_type_auth_checked_phone (D, T); return;
+ case 0xdf969c2d: free_ds_type_auth_exported_authorization (D, T); return;
+ case 0x206963d2: free_ds_type_auth_exported_authorization (D, T); return;
+ case 0x137948a5: free_ds_type_auth_password_recovery (D, T); return;
+ case 0xec86b75a: free_ds_type_auth_password_recovery (D, T); return;
+ case 0x0cc8bc16: free_ds_type_auth_sent_code (D, T); return;
+ case 0xf33743e9: free_ds_type_auth_sent_code (D, T); return;
+ case 0x0377168f: free_ds_type_binlog_encr_key (D, T); return;
+ case 0xfc88e970: free_ds_type_binlog_encr_key (D, T); return;
+ case 0x66ff03a6: free_ds_type_binlog_update (D, T); return;
+ case 0x9900fc59: free_ds_type_binlog_update (D, T); return;
+ case 0x8c1b8fb4: free_ds_type_contacts_blocked (D, T); return;
+ case 0x73e4704b: free_ds_type_contacts_blocked (D, T); return;
+ case 0xd8c02560: free_ds_type_contacts_contacts (D, T); return;
+ case 0x273fda9f: free_ds_type_contacts_contacts (D, T); return;
+ case 0x0566000e: free_ds_type_contacts_found (D, T); return;
+ case 0xfa99fff1: free_ds_type_contacts_found (D, T); return;
+ case 0xad524315: free_ds_type_contacts_imported_contacts (D, T); return;
+ case 0x52adbcea: free_ds_type_contacts_imported_contacts (D, T); return;
+ case 0x3ace484c: free_ds_type_contacts_link (D, T); return;
+ case 0xc531b7b3: free_ds_type_contacts_link (D, T); return;
+ case 0x5649dcc5: free_ds_type_contacts_suggested (D, T); return;
+ case 0xa9b6233a: free_ds_type_contacts_suggested (D, T); return;
+ case 0x48feb267: free_ds_type_geochats_located (D, T); return;
+ case 0xb7014d98: free_ds_type_geochats_located (D, T); return;
+ case 0x6d0a0e59: free_ds_type_geochats_messages (D, T); return;
+ case 0x92f5f1a6: free_ds_type_geochats_messages (D, T); return;
+ case 0x17b1578b: free_ds_type_geochats_stated_message (D, T); return;
+ case 0xe84ea874: free_ds_type_geochats_stated_message (D, T); return;
+ case 0x4ddd9627: free_ds_type_help_app_update (D, T); return;
+ case 0xb22269d8: free_ds_type_help_app_update (D, T); return;
+ case 0x18cb9f78: free_ds_type_help_invite_text (D, T); return;
+ case 0xe7346087: free_ds_type_help_invite_text (D, T); return;
+ case 0x17c6b5f6: free_ds_type_help_support (D, T); return;
+ case 0xe8394a09: free_ds_type_help_support (D, T); return;
+ case 0xb45c69d1: free_ds_type_messages_affected_history (D, T); return;
+ case 0x4ba3962e: free_ds_type_messages_affected_history (D, T); return;
+ case 0x84d19185: free_ds_type_messages_affected_messages (D, T); return;
+ case 0x7b2e6e7a: free_ds_type_messages_affected_messages (D, T); return;
+ case 0xb485502f: free_ds_type_messages_all_stickers (D, T); return;
+ case 0x4b7aafd0: free_ds_type_messages_all_stickers (D, T); return;
+ case 0xe5d7d19c: free_ds_type_messages_chat_full (D, T); return;
+ case 0x1a282e63: free_ds_type_messages_chat_full (D, T); return;
+ case 0x64ff9fd5: free_ds_type_messages_chats (D, T); return;
+ case 0x9b00602a: free_ds_type_messages_chats (D, T); return;
+ case 0xecc058e8: free_ds_type_messages_dh_config (D, T); return;
+ case 0x133fa717: free_ds_type_messages_dh_config (D, T); return;
+ case 0x645af8b3: free_ds_type_messages_dialogs (D, T); return;
+ case 0x9ba5074c: free_ds_type_messages_dialogs (D, T); return;
+ case 0x3f4e0648: free_ds_type_messages_message (D, T); return;
+ case 0xc0b1f9b7: free_ds_type_messages_message (D, T); return;
+ case 0x8735e464: free_ds_type_messages_messages (D, T); return;
+ case 0x78ca1b9b: free_ds_type_messages_messages (D, T); return;
+ case 0xc29c7607: free_ds_type_messages_sent_encrypted_message (D, T); return;
+ case 0x3d6389f8: free_ds_type_messages_sent_encrypted_message (D, T); return;
+ case 0x799ce190: free_ds_type_messages_sent_message (D, T); return;
+ case 0x86631e6f: free_ds_type_messages_sent_message (D, T); return;
+ case 0xb60a24a6: free_ds_type_messages_sticker_set (D, T); return;
+ case 0x49f5db59: free_ds_type_messages_sticker_set (D, T); return;
+ case 0x7bfa5710: free_ds_type_messages_stickers (D, T); return;
+ case 0x8405a8ef: free_ds_type_messages_stickers (D, T); return;
+ case 0x20212ca8: free_ds_type_photos_photo (D, T); return;
+ case 0xdfded357: free_ds_type_photos_photo (D, T); return;
+ case 0x98cf75f1: free_ds_type_photos_photos (D, T); return;
+ case 0x67308a0e: free_ds_type_photos_photos (D, T); return;
+ case 0x3e2838a8: free_ds_type_storage_file_type (D, T); return;
+ case 0xc1d7c757: free_ds_type_storage_file_type (D, T); return;
+ case 0xf57a2419: free_ds_type_updates_difference (D, T); return;
+ case 0x0a85dbe6: free_ds_type_updates_difference (D, T); return;
+ case 0xa56c2a3e: free_ds_type_updates_state (D, T); return;
+ case 0x5a93d5c1: free_ds_type_updates_state (D, T); return;
+ case 0x096a18d5: free_ds_type_upload_file (D, T); return;
+ case 0xf695e72a: free_ds_type_upload_file (D, T); return;
+ default: return; }
+}
diff --git a/protocols/Telegram/tgl/auto/auto-free-ds.h b/protocols/Telegram/tgl/auto/auto-free-ds.h
new file mode 100644
index 0000000000..7785aa0141
--- /dev/null
+++ b/protocols/Telegram/tgl/auto/auto-free-ds.h
@@ -0,0 +1,569 @@
+#ifdef _MSC_VER
+#include "..\auto.h"
+#include "auto-types.h"
+#else
+#include "auto.h"
+#include "auto/auto-types.h"
+#endif
+#include <assert.h>
+#include <stdio.h>
+struct tgl_state;
+void free_ds_constructor_account_days_t_t_l (struct tl_ds_account_days_t_t_l *D, struct paramed_type *T);
+void free_ds_constructor_audio_empty (struct tl_ds_audio *D, struct paramed_type *T);
+void free_ds_constructor_audio (struct tl_ds_audio *D, struct paramed_type *T);
+void free_ds_constructor_authorization (struct tl_ds_authorization *D, struct paramed_type *T);
+void free_ds_constructor_bool_false (struct tl_ds_bool *D, struct paramed_type *T);
+void free_ds_constructor_bool_true (struct tl_ds_bool *D, struct paramed_type *T);
+void free_ds_constructor_bot_command (struct tl_ds_bot_command *D, struct paramed_type *T);
+void free_ds_constructor_bot_command_old (struct tl_ds_bot_command *D, struct paramed_type *T);
+void free_ds_constructor_bot_info_empty (struct tl_ds_bot_info *D, struct paramed_type *T);
+void free_ds_constructor_bot_info (struct tl_ds_bot_info *D, struct paramed_type *T);
+void free_ds_constructor_bytes (struct tl_ds_string *D, struct paramed_type *T);
+void free_ds_constructor_chat_empty (struct tl_ds_chat *D, struct paramed_type *T);
+void free_ds_constructor_chat (struct tl_ds_chat *D, struct paramed_type *T);
+void free_ds_constructor_chat_forbidden (struct tl_ds_chat *D, struct paramed_type *T);
+void free_ds_constructor_geo_chat (struct tl_ds_chat *D, struct paramed_type *T);
+void free_ds_constructor_chat_full (struct tl_ds_chat_full *D, struct paramed_type *T);
+void free_ds_constructor_chat_invite_already (struct tl_ds_chat_invite *D, struct paramed_type *T);
+void free_ds_constructor_chat_invite (struct tl_ds_chat_invite *D, struct paramed_type *T);
+void free_ds_constructor_chat_located (struct tl_ds_chat_located *D, struct paramed_type *T);
+void free_ds_constructor_chat_participant (struct tl_ds_chat_participant *D, struct paramed_type *T);
+void free_ds_constructor_chat_participants_forbidden (struct tl_ds_chat_participants *D, struct paramed_type *T);
+void free_ds_constructor_chat_participants (struct tl_ds_chat_participants *D, struct paramed_type *T);
+void free_ds_constructor_chat_photo_empty (struct tl_ds_chat_photo *D, struct paramed_type *T);
+void free_ds_constructor_chat_photo (struct tl_ds_chat_photo *D, struct paramed_type *T);
+void free_ds_constructor_client_d_h_inner_data (struct tl_ds_client_d_h_inner_data *D, struct paramed_type *T);
+void free_ds_constructor_config (struct tl_ds_config *D, struct paramed_type *T);
+void free_ds_constructor_contact (struct tl_ds_contact *D, struct paramed_type *T);
+void free_ds_constructor_contact_blocked (struct tl_ds_contact_blocked *D, struct paramed_type *T);
+void free_ds_constructor_contact_found (struct tl_ds_contact_found *D, struct paramed_type *T);
+void free_ds_constructor_contact_link_unknown (struct tl_ds_contact_link *D, struct paramed_type *T);
+void free_ds_constructor_contact_link_none (struct tl_ds_contact_link *D, struct paramed_type *T);
+void free_ds_constructor_contact_link_has_phone (struct tl_ds_contact_link *D, struct paramed_type *T);
+void free_ds_constructor_contact_link_contact (struct tl_ds_contact_link *D, struct paramed_type *T);
+void free_ds_constructor_contact_status (struct tl_ds_contact_status *D, struct paramed_type *T);
+void free_ds_constructor_contact_suggested (struct tl_ds_contact_suggested *D, struct paramed_type *T);
+void free_ds_constructor_dc_option_l28 (struct tl_ds_dc_option *D, struct paramed_type *T);
+void free_ds_constructor_dc_option (struct tl_ds_dc_option *D, struct paramed_type *T);
+void free_ds_constructor_decrypted_message (struct tl_ds_decrypted_message *D, struct paramed_type *T);
+void free_ds_constructor_decrypted_message_service (struct tl_ds_decrypted_message *D, struct paramed_type *T);
+void free_ds_constructor_decrypted_message_action_set_message_t_t_l (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void free_ds_constructor_decrypted_message_action_read_messages (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void free_ds_constructor_decrypted_message_action_delete_messages (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void free_ds_constructor_decrypted_message_action_screenshot_messages (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void free_ds_constructor_decrypted_message_action_flush_history (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void free_ds_constructor_decrypted_message_action_resend (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void free_ds_constructor_decrypted_message_action_notify_layer (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void free_ds_constructor_decrypted_message_action_typing (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void free_ds_constructor_decrypted_message_action_request_key (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void free_ds_constructor_decrypted_message_action_accept_key (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void free_ds_constructor_decrypted_message_action_abort_key (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void free_ds_constructor_decrypted_message_action_commit_key (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void free_ds_constructor_decrypted_message_action_noop (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void free_ds_constructor_decrypted_message_layer (struct tl_ds_decrypted_message_layer *D, struct paramed_type *T);
+void free_ds_constructor_decrypted_message_media_empty (struct tl_ds_decrypted_message_media *D, struct paramed_type *T);
+void free_ds_constructor_decrypted_message_media_photo (struct tl_ds_decrypted_message_media *D, struct paramed_type *T);
+void free_ds_constructor_decrypted_message_media_geo_point (struct tl_ds_decrypted_message_media *D, struct paramed_type *T);
+void free_ds_constructor_decrypted_message_media_contact (struct tl_ds_decrypted_message_media *D, struct paramed_type *T);
+void free_ds_constructor_decrypted_message_media_document (struct tl_ds_decrypted_message_media *D, struct paramed_type *T);
+void free_ds_constructor_decrypted_message_media_video (struct tl_ds_decrypted_message_media *D, struct paramed_type *T);
+void free_ds_constructor_decrypted_message_media_audio (struct tl_ds_decrypted_message_media *D, struct paramed_type *T);
+void free_ds_constructor_decrypted_message_media_external_document (struct tl_ds_decrypted_message_media *D, struct paramed_type *T);
+void free_ds_constructor_decrypted_message_media_video_l12 (struct tl_ds_decrypted_message_media *D, struct paramed_type *T);
+void free_ds_constructor_decrypted_message_media_audio_l12 (struct tl_ds_decrypted_message_media *D, struct paramed_type *T);
+void free_ds_constructor_dialog (struct tl_ds_dialog *D, struct paramed_type *T);
+void free_ds_constructor_disabled_feature (struct tl_ds_disabled_feature *D, struct paramed_type *T);
+void free_ds_constructor_document_empty (struct tl_ds_document *D, struct paramed_type *T);
+void free_ds_constructor_document (struct tl_ds_document *D, struct paramed_type *T);
+void free_ds_constructor_document_l19 (struct tl_ds_document *D, struct paramed_type *T);
+void free_ds_constructor_document_attribute_image_size (struct tl_ds_document_attribute *D, struct paramed_type *T);
+void free_ds_constructor_document_attribute_animated (struct tl_ds_document_attribute *D, struct paramed_type *T);
+void free_ds_constructor_document_attribute_sticker_l28 (struct tl_ds_document_attribute *D, struct paramed_type *T);
+void free_ds_constructor_document_attribute_sticker (struct tl_ds_document_attribute *D, struct paramed_type *T);
+void free_ds_constructor_document_attribute_video (struct tl_ds_document_attribute *D, struct paramed_type *T);
+void free_ds_constructor_document_attribute_audio (struct tl_ds_document_attribute *D, struct paramed_type *T);
+void free_ds_constructor_document_attribute_filename (struct tl_ds_document_attribute *D, struct paramed_type *T);
+void free_ds_constructor_double (double *D, struct paramed_type *T);
+void free_ds_constructor_encrypted_chat_empty (struct tl_ds_encrypted_chat *D, struct paramed_type *T);
+void free_ds_constructor_encrypted_chat_waiting (struct tl_ds_encrypted_chat *D, struct paramed_type *T);
+void free_ds_constructor_encrypted_chat_requested (struct tl_ds_encrypted_chat *D, struct paramed_type *T);
+void free_ds_constructor_encrypted_chat (struct tl_ds_encrypted_chat *D, struct paramed_type *T);
+void free_ds_constructor_encrypted_chat_discarded (struct tl_ds_encrypted_chat *D, struct paramed_type *T);
+void free_ds_constructor_encrypted_file_empty (struct tl_ds_encrypted_file *D, struct paramed_type *T);
+void free_ds_constructor_encrypted_file (struct tl_ds_encrypted_file *D, struct paramed_type *T);
+void free_ds_constructor_encrypted_message (struct tl_ds_encrypted_message *D, struct paramed_type *T);
+void free_ds_constructor_encrypted_message_service (struct tl_ds_encrypted_message *D, struct paramed_type *T);
+void free_ds_constructor_error (struct tl_ds_error *D, struct paramed_type *T);
+void free_ds_constructor_chat_invite_empty (struct tl_ds_exported_chat_invite *D, struct paramed_type *T);
+void free_ds_constructor_chat_invite_exported (struct tl_ds_exported_chat_invite *D, struct paramed_type *T);
+void free_ds_constructor_file_location_unavailable (struct tl_ds_file_location *D, struct paramed_type *T);
+void free_ds_constructor_file_location (struct tl_ds_file_location *D, struct paramed_type *T);
+void free_ds_constructor_geo_chat_message_empty (struct tl_ds_geo_chat_message *D, struct paramed_type *T);
+void free_ds_constructor_geo_chat_message (struct tl_ds_geo_chat_message *D, struct paramed_type *T);
+void free_ds_constructor_geo_chat_message_service (struct tl_ds_geo_chat_message *D, struct paramed_type *T);
+void free_ds_constructor_geo_point_empty (struct tl_ds_geo_point *D, struct paramed_type *T);
+void free_ds_constructor_geo_point (struct tl_ds_geo_point *D, struct paramed_type *T);
+void free_ds_constructor_imported_contact (struct tl_ds_imported_contact *D, struct paramed_type *T);
+void free_ds_constructor_input_app_event (struct tl_ds_input_app_event *D, struct paramed_type *T);
+void free_ds_constructor_input_audio_empty (struct tl_ds_input_audio *D, struct paramed_type *T);
+void free_ds_constructor_input_audio (struct tl_ds_input_audio *D, struct paramed_type *T);
+void free_ds_constructor_input_chat_photo_empty (struct tl_ds_input_chat_photo *D, struct paramed_type *T);
+void free_ds_constructor_input_chat_uploaded_photo (struct tl_ds_input_chat_photo *D, struct paramed_type *T);
+void free_ds_constructor_input_chat_photo (struct tl_ds_input_chat_photo *D, struct paramed_type *T);
+void free_ds_constructor_input_phone_contact (struct tl_ds_input_contact *D, struct paramed_type *T);
+void free_ds_constructor_input_document_empty (struct tl_ds_input_document *D, struct paramed_type *T);
+void free_ds_constructor_input_document (struct tl_ds_input_document *D, struct paramed_type *T);
+void free_ds_constructor_input_encrypted_chat (struct tl_ds_input_encrypted_chat *D, struct paramed_type *T);
+void free_ds_constructor_input_encrypted_file_empty (struct tl_ds_input_encrypted_file *D, struct paramed_type *T);
+void free_ds_constructor_input_encrypted_file_uploaded (struct tl_ds_input_encrypted_file *D, struct paramed_type *T);
+void free_ds_constructor_input_encrypted_file (struct tl_ds_input_encrypted_file *D, struct paramed_type *T);
+void free_ds_constructor_input_encrypted_file_big_uploaded (struct tl_ds_input_encrypted_file *D, struct paramed_type *T);
+void free_ds_constructor_input_file (struct tl_ds_input_file *D, struct paramed_type *T);
+void free_ds_constructor_input_file_big (struct tl_ds_input_file *D, struct paramed_type *T);
+void free_ds_constructor_input_file_location (struct tl_ds_input_file_location *D, struct paramed_type *T);
+void free_ds_constructor_input_video_file_location (struct tl_ds_input_file_location *D, struct paramed_type *T);
+void free_ds_constructor_input_encrypted_file_location (struct tl_ds_input_file_location *D, struct paramed_type *T);
+void free_ds_constructor_input_audio_file_location (struct tl_ds_input_file_location *D, struct paramed_type *T);
+void free_ds_constructor_input_document_file_location (struct tl_ds_input_file_location *D, struct paramed_type *T);
+void free_ds_constructor_input_geo_chat (struct tl_ds_input_geo_chat *D, struct paramed_type *T);
+void free_ds_constructor_input_geo_point_empty (struct tl_ds_input_geo_point *D, struct paramed_type *T);
+void free_ds_constructor_input_geo_point (struct tl_ds_input_geo_point *D, struct paramed_type *T);
+void free_ds_constructor_input_media_empty (struct tl_ds_input_media *D, struct paramed_type *T);
+void free_ds_constructor_input_media_uploaded_photo (struct tl_ds_input_media *D, struct paramed_type *T);
+void free_ds_constructor_input_media_photo (struct tl_ds_input_media *D, struct paramed_type *T);
+void free_ds_constructor_input_media_geo_point (struct tl_ds_input_media *D, struct paramed_type *T);
+void free_ds_constructor_input_media_contact (struct tl_ds_input_media *D, struct paramed_type *T);
+void free_ds_constructor_input_media_uploaded_video (struct tl_ds_input_media *D, struct paramed_type *T);
+void free_ds_constructor_input_media_uploaded_thumb_video (struct tl_ds_input_media *D, struct paramed_type *T);
+void free_ds_constructor_input_media_video (struct tl_ds_input_media *D, struct paramed_type *T);
+void free_ds_constructor_input_media_uploaded_audio (struct tl_ds_input_media *D, struct paramed_type *T);
+void free_ds_constructor_input_media_audio (struct tl_ds_input_media *D, struct paramed_type *T);
+void free_ds_constructor_input_media_uploaded_document (struct tl_ds_input_media *D, struct paramed_type *T);
+void free_ds_constructor_input_media_uploaded_thumb_document (struct tl_ds_input_media *D, struct paramed_type *T);
+void free_ds_constructor_input_media_document (struct tl_ds_input_media *D, struct paramed_type *T);
+void free_ds_constructor_input_media_venue (struct tl_ds_input_media *D, struct paramed_type *T);
+void free_ds_constructor_input_notify_peer (struct tl_ds_input_notify_peer *D, struct paramed_type *T);
+void free_ds_constructor_input_notify_users (struct tl_ds_input_notify_peer *D, struct paramed_type *T);
+void free_ds_constructor_input_notify_chats (struct tl_ds_input_notify_peer *D, struct paramed_type *T);
+void free_ds_constructor_input_notify_all (struct tl_ds_input_notify_peer *D, struct paramed_type *T);
+void free_ds_constructor_input_notify_geo_chat_peer (struct tl_ds_input_notify_peer *D, struct paramed_type *T);
+void free_ds_constructor_input_peer_empty (struct tl_ds_input_peer *D, struct paramed_type *T);
+void free_ds_constructor_input_peer_self (struct tl_ds_input_peer *D, struct paramed_type *T);
+void free_ds_constructor_input_peer_contact (struct tl_ds_input_peer *D, struct paramed_type *T);
+void free_ds_constructor_input_peer_foreign (struct tl_ds_input_peer *D, struct paramed_type *T);
+void free_ds_constructor_input_peer_chat (struct tl_ds_input_peer *D, struct paramed_type *T);
+void free_ds_constructor_input_peer_notify_events_empty (struct tl_ds_input_peer_notify_events *D, struct paramed_type *T);
+void free_ds_constructor_input_peer_notify_events_all (struct tl_ds_input_peer_notify_events *D, struct paramed_type *T);
+void free_ds_constructor_input_peer_notify_settings (struct tl_ds_input_peer_notify_settings *D, struct paramed_type *T);
+void free_ds_constructor_input_photo_empty (struct tl_ds_input_photo *D, struct paramed_type *T);
+void free_ds_constructor_input_photo (struct tl_ds_input_photo *D, struct paramed_type *T);
+void free_ds_constructor_input_photo_crop_auto (struct tl_ds_input_photo_crop *D, struct paramed_type *T);
+void free_ds_constructor_input_photo_crop (struct tl_ds_input_photo_crop *D, struct paramed_type *T);
+void free_ds_constructor_input_privacy_key_status_timestamp (struct tl_ds_input_privacy_key *D, struct paramed_type *T);
+void free_ds_constructor_input_privacy_value_allow_contacts (struct tl_ds_input_privacy_rule *D, struct paramed_type *T);
+void free_ds_constructor_input_privacy_value_allow_all (struct tl_ds_input_privacy_rule *D, struct paramed_type *T);
+void free_ds_constructor_input_privacy_value_allow_users (struct tl_ds_input_privacy_rule *D, struct paramed_type *T);
+void free_ds_constructor_input_privacy_value_disallow_contacts (struct tl_ds_input_privacy_rule *D, struct paramed_type *T);
+void free_ds_constructor_input_privacy_value_disallow_all (struct tl_ds_input_privacy_rule *D, struct paramed_type *T);
+void free_ds_constructor_input_privacy_value_disallow_users (struct tl_ds_input_privacy_rule *D, struct paramed_type *T);
+void free_ds_constructor_input_sticker_set_empty (struct tl_ds_input_sticker_set *D, struct paramed_type *T);
+void free_ds_constructor_input_sticker_set_i_d (struct tl_ds_input_sticker_set *D, struct paramed_type *T);
+void free_ds_constructor_input_sticker_set_short_name (struct tl_ds_input_sticker_set *D, struct paramed_type *T);
+void free_ds_constructor_input_user_empty (struct tl_ds_input_user *D, struct paramed_type *T);
+void free_ds_constructor_input_user_self (struct tl_ds_input_user *D, struct paramed_type *T);
+void free_ds_constructor_input_user_contact (struct tl_ds_input_user *D, struct paramed_type *T);
+void free_ds_constructor_input_user_foreign (struct tl_ds_input_user *D, struct paramed_type *T);
+void free_ds_constructor_input_video_empty (struct tl_ds_input_video *D, struct paramed_type *T);
+void free_ds_constructor_input_video (struct tl_ds_input_video *D, struct paramed_type *T);
+void free_ds_constructor_int (int *D, struct paramed_type *T);
+void free_ds_constructor_int128 (struct tl_ds_int128 *D, struct paramed_type *T);
+void free_ds_constructor_int256 (struct tl_ds_int256 *D, struct paramed_type *T);
+void free_ds_constructor_keyboard_button (struct tl_ds_keyboard_button *D, struct paramed_type *T);
+void free_ds_constructor_keyboard_button_row (struct tl_ds_keyboard_button_row *D, struct paramed_type *T);
+void free_ds_constructor_long (long long *D, struct paramed_type *T);
+void free_ds_constructor_message_empty (struct tl_ds_message *D, struct paramed_type *T);
+void free_ds_constructor_message (struct tl_ds_message *D, struct paramed_type *T);
+void free_ds_constructor_message_service (struct tl_ds_message *D, struct paramed_type *T);
+void free_ds_constructor_message_action_empty (struct tl_ds_message_action *D, struct paramed_type *T);
+void free_ds_constructor_message_action_chat_create (struct tl_ds_message_action *D, struct paramed_type *T);
+void free_ds_constructor_message_action_chat_edit_title (struct tl_ds_message_action *D, struct paramed_type *T);
+void free_ds_constructor_message_action_chat_edit_photo (struct tl_ds_message_action *D, struct paramed_type *T);
+void free_ds_constructor_message_action_chat_delete_photo (struct tl_ds_message_action *D, struct paramed_type *T);
+void free_ds_constructor_message_action_chat_add_user (struct tl_ds_message_action *D, struct paramed_type *T);
+void free_ds_constructor_message_action_chat_delete_user (struct tl_ds_message_action *D, struct paramed_type *T);
+void free_ds_constructor_message_action_geo_chat_create (struct tl_ds_message_action *D, struct paramed_type *T);
+void free_ds_constructor_message_action_geo_chat_checkin (struct tl_ds_message_action *D, struct paramed_type *T);
+void free_ds_constructor_message_action_chat_joined_by_link (struct tl_ds_message_action *D, struct paramed_type *T);
+void free_ds_constructor_message_media_empty (struct tl_ds_message_media *D, struct paramed_type *T);
+void free_ds_constructor_message_media_photo (struct tl_ds_message_media *D, struct paramed_type *T);
+void free_ds_constructor_message_media_video (struct tl_ds_message_media *D, struct paramed_type *T);
+void free_ds_constructor_message_media_geo (struct tl_ds_message_media *D, struct paramed_type *T);
+void free_ds_constructor_message_media_contact (struct tl_ds_message_media *D, struct paramed_type *T);
+void free_ds_constructor_message_media_unsupported (struct tl_ds_message_media *D, struct paramed_type *T);
+void free_ds_constructor_message_media_document (struct tl_ds_message_media *D, struct paramed_type *T);
+void free_ds_constructor_message_media_audio (struct tl_ds_message_media *D, struct paramed_type *T);
+void free_ds_constructor_message_media_web_page (struct tl_ds_message_media *D, struct paramed_type *T);
+void free_ds_constructor_message_media_venue (struct tl_ds_message_media *D, struct paramed_type *T);
+void free_ds_constructor_message_media_photo_l27 (struct tl_ds_message_media *D, struct paramed_type *T);
+void free_ds_constructor_message_media_video_l27 (struct tl_ds_message_media *D, struct paramed_type *T);
+void free_ds_constructor_input_messages_filter_empty (struct tl_ds_messages_filter *D, struct paramed_type *T);
+void free_ds_constructor_input_messages_filter_photos (struct tl_ds_messages_filter *D, struct paramed_type *T);
+void free_ds_constructor_input_messages_filter_video (struct tl_ds_messages_filter *D, struct paramed_type *T);
+void free_ds_constructor_input_messages_filter_photo_video (struct tl_ds_messages_filter *D, struct paramed_type *T);
+void free_ds_constructor_input_messages_filter_photo_video_documents (struct tl_ds_messages_filter *D, struct paramed_type *T);
+void free_ds_constructor_input_messages_filter_document (struct tl_ds_messages_filter *D, struct paramed_type *T);
+void free_ds_constructor_input_messages_filter_audio (struct tl_ds_messages_filter *D, struct paramed_type *T);
+void free_ds_constructor_nearest_dc (struct tl_ds_nearest_dc *D, struct paramed_type *T);
+void free_ds_constructor_notify_peer (struct tl_ds_notify_peer *D, struct paramed_type *T);
+void free_ds_constructor_notify_users (struct tl_ds_notify_peer *D, struct paramed_type *T);
+void free_ds_constructor_notify_chats (struct tl_ds_notify_peer *D, struct paramed_type *T);
+void free_ds_constructor_notify_all (struct tl_ds_notify_peer *D, struct paramed_type *T);
+void free_ds_constructor_null (struct tl_ds_null *D, struct paramed_type *T);
+void free_ds_constructor_p_q_inner_data (struct tl_ds_p_q_inner_data *D, struct paramed_type *T);
+void free_ds_constructor_p_q_inner_data_temp (struct tl_ds_p_q_inner_data *D, struct paramed_type *T);
+void free_ds_constructor_peer_user (struct tl_ds_peer *D, struct paramed_type *T);
+void free_ds_constructor_peer_chat (struct tl_ds_peer *D, struct paramed_type *T);
+void free_ds_constructor_peer_notify_events_empty (struct tl_ds_peer_notify_events *D, struct paramed_type *T);
+void free_ds_constructor_peer_notify_events_all (struct tl_ds_peer_notify_events *D, struct paramed_type *T);
+void free_ds_constructor_peer_notify_settings_empty (struct tl_ds_peer_notify_settings *D, struct paramed_type *T);
+void free_ds_constructor_peer_notify_settings (struct tl_ds_peer_notify_settings *D, struct paramed_type *T);
+void free_ds_constructor_photo_empty (struct tl_ds_photo *D, struct paramed_type *T);
+void free_ds_constructor_photo (struct tl_ds_photo *D, struct paramed_type *T);
+void free_ds_constructor_photo_l27 (struct tl_ds_photo *D, struct paramed_type *T);
+void free_ds_constructor_photo_size_empty (struct tl_ds_photo_size *D, struct paramed_type *T);
+void free_ds_constructor_photo_size (struct tl_ds_photo_size *D, struct paramed_type *T);
+void free_ds_constructor_photo_cached_size (struct tl_ds_photo_size *D, struct paramed_type *T);
+void free_ds_constructor_privacy_key_status_timestamp (struct tl_ds_privacy_key *D, struct paramed_type *T);
+void free_ds_constructor_privacy_value_allow_contacts (struct tl_ds_privacy_rule *D, struct paramed_type *T);
+void free_ds_constructor_privacy_value_allow_all (struct tl_ds_privacy_rule *D, struct paramed_type *T);
+void free_ds_constructor_privacy_value_allow_users (struct tl_ds_privacy_rule *D, struct paramed_type *T);
+void free_ds_constructor_privacy_value_disallow_contacts (struct tl_ds_privacy_rule *D, struct paramed_type *T);
+void free_ds_constructor_privacy_value_disallow_all (struct tl_ds_privacy_rule *D, struct paramed_type *T);
+void free_ds_constructor_privacy_value_disallow_users (struct tl_ds_privacy_rule *D, struct paramed_type *T);
+void free_ds_constructor_received_notify_message (struct tl_ds_received_notify_message *D, struct paramed_type *T);
+void free_ds_constructor_reply_keyboard_hide (struct tl_ds_reply_markup *D, struct paramed_type *T);
+void free_ds_constructor_reply_keyboard_force_reply (struct tl_ds_reply_markup *D, struct paramed_type *T);
+void free_ds_constructor_reply_keyboard_markup (struct tl_ds_reply_markup *D, struct paramed_type *T);
+void free_ds_constructor_res_p_q (struct tl_ds_res_p_q *D, struct paramed_type *T);
+void free_ds_constructor_send_message_typing_action (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void free_ds_constructor_send_message_cancel_action (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void free_ds_constructor_send_message_record_video_action (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void free_ds_constructor_send_message_upload_video_action_l27 (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void free_ds_constructor_send_message_upload_video_action (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void free_ds_constructor_send_message_record_audio_action (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void free_ds_constructor_send_message_upload_audio_action_l27 (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void free_ds_constructor_send_message_upload_audio_action (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void free_ds_constructor_send_message_upload_photo_action (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void free_ds_constructor_send_message_upload_document_action_l27 (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void free_ds_constructor_send_message_upload_document_action (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void free_ds_constructor_send_message_geo_location_action (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void free_ds_constructor_send_message_choose_contact_action (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void free_ds_constructor_server_d_h_params_fail (struct tl_ds_server_d_h_params *D, struct paramed_type *T);
+void free_ds_constructor_server_d_h_params_ok (struct tl_ds_server_d_h_params *D, struct paramed_type *T);
+void free_ds_constructor_server_d_h_inner_data (struct tl_ds_server_d_h_inner_data *D, struct paramed_type *T);
+void free_ds_constructor_dh_gen_ok (struct tl_ds_set_client_d_h_params_answer *D, struct paramed_type *T);
+void free_ds_constructor_dh_gen_retry (struct tl_ds_set_client_d_h_params_answer *D, struct paramed_type *T);
+void free_ds_constructor_dh_gen_fail (struct tl_ds_set_client_d_h_params_answer *D, struct paramed_type *T);
+void free_ds_constructor_sticker_pack (struct tl_ds_sticker_pack *D, struct paramed_type *T);
+void free_ds_constructor_sticker_set (struct tl_ds_sticker_set *D, struct paramed_type *T);
+void free_ds_constructor_string (struct tl_ds_string *D, struct paramed_type *T);
+void free_ds_constructor_update_new_message (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_message_i_d (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_delete_messages (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_user_typing (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_chat_user_typing (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_chat_participants (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_user_status (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_user_name (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_user_photo (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_contact_registered (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_contact_link (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_new_authorization (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_new_geo_chat_message (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_new_encrypted_message (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_encrypted_chat_typing (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_encryption (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_encrypted_messages_read (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_chat_participant_add (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_chat_participant_delete (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_dc_options (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_user_blocked (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_notify_settings (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_service_notification (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_privacy (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_user_phone (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_read_history_inbox (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_read_history_outbox (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_web_page (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_read_messages_contents (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_update_msg_update (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_constructor_updates_too_long (struct tl_ds_updates *D, struct paramed_type *T);
+void free_ds_constructor_update_short_message (struct tl_ds_updates *D, struct paramed_type *T);
+void free_ds_constructor_update_short_chat_message (struct tl_ds_updates *D, struct paramed_type *T);
+void free_ds_constructor_update_short (struct tl_ds_updates *D, struct paramed_type *T);
+void free_ds_constructor_updates_combined (struct tl_ds_updates *D, struct paramed_type *T);
+void free_ds_constructor_updates (struct tl_ds_updates *D, struct paramed_type *T);
+void free_ds_constructor_user_empty (struct tl_ds_user *D, struct paramed_type *T);
+void free_ds_constructor_user (struct tl_ds_user *D, struct paramed_type *T);
+void free_ds_constructor_user_full (struct tl_ds_user_full *D, struct paramed_type *T);
+void free_ds_constructor_user_profile_photo_empty (struct tl_ds_user_profile_photo *D, struct paramed_type *T);
+void free_ds_constructor_user_profile_photo (struct tl_ds_user_profile_photo *D, struct paramed_type *T);
+void free_ds_constructor_user_status_empty (struct tl_ds_user_status *D, struct paramed_type *T);
+void free_ds_constructor_user_status_online (struct tl_ds_user_status *D, struct paramed_type *T);
+void free_ds_constructor_user_status_offline (struct tl_ds_user_status *D, struct paramed_type *T);
+void free_ds_constructor_user_status_recently (struct tl_ds_user_status *D, struct paramed_type *T);
+void free_ds_constructor_user_status_last_week (struct tl_ds_user_status *D, struct paramed_type *T);
+void free_ds_constructor_user_status_last_month (struct tl_ds_user_status *D, struct paramed_type *T);
+void free_ds_constructor_vector (struct tl_ds_vector *D, struct paramed_type *T);
+void free_ds_constructor_video_empty (struct tl_ds_video *D, struct paramed_type *T);
+void free_ds_constructor_video (struct tl_ds_video *D, struct paramed_type *T);
+void free_ds_constructor_video_l27 (struct tl_ds_video *D, struct paramed_type *T);
+void free_ds_constructor_wall_paper (struct tl_ds_wall_paper *D, struct paramed_type *T);
+void free_ds_constructor_wall_paper_solid (struct tl_ds_wall_paper *D, struct paramed_type *T);
+void free_ds_constructor_web_page_empty (struct tl_ds_web_page *D, struct paramed_type *T);
+void free_ds_constructor_web_page_pending (struct tl_ds_web_page *D, struct paramed_type *T);
+void free_ds_constructor_web_page (struct tl_ds_web_page *D, struct paramed_type *T);
+void free_ds_constructor_account_authorizations (struct tl_ds_account_authorizations *D, struct paramed_type *T);
+void free_ds_constructor_account_no_password (struct tl_ds_account_password *D, struct paramed_type *T);
+void free_ds_constructor_account_password (struct tl_ds_account_password *D, struct paramed_type *T);
+void free_ds_constructor_account_password_input_settings (struct tl_ds_account_password_input_settings *D, struct paramed_type *T);
+void free_ds_constructor_account_password_settings (struct tl_ds_account_password_settings *D, struct paramed_type *T);
+void free_ds_constructor_account_privacy_rules (struct tl_ds_account_privacy_rules *D, struct paramed_type *T);
+void free_ds_constructor_account_sent_change_phone_code (struct tl_ds_account_sent_change_phone_code *D, struct paramed_type *T);
+void free_ds_constructor_auth_authorization (struct tl_ds_auth_authorization *D, struct paramed_type *T);
+void free_ds_constructor_auth_checked_phone (struct tl_ds_auth_checked_phone *D, struct paramed_type *T);
+void free_ds_constructor_auth_exported_authorization (struct tl_ds_auth_exported_authorization *D, struct paramed_type *T);
+void free_ds_constructor_auth_password_recovery (struct tl_ds_auth_password_recovery *D, struct paramed_type *T);
+void free_ds_constructor_auth_sent_code (struct tl_ds_auth_sent_code *D, struct paramed_type *T);
+void free_ds_constructor_auth_sent_app_code (struct tl_ds_auth_sent_code *D, struct paramed_type *T);
+void free_ds_constructor_binlog_encr_key (struct tl_ds_binlog_encr_key *D, struct paramed_type *T);
+void free_ds_constructor_binlog_start (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void free_ds_constructor_binlog_dc_option (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void free_ds_constructor_binlog_dc_option_new (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void free_ds_constructor_binlog_auth_key (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void free_ds_constructor_binlog_default_dc (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void free_ds_constructor_binlog_dc_signed (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void free_ds_constructor_binlog_our_id (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void free_ds_constructor_binlog_set_dh_params (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void free_ds_constructor_binlog_set_pts (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void free_ds_constructor_binlog_set_qts (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void free_ds_constructor_binlog_set_date (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void free_ds_constructor_binlog_set_seq (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void free_ds_constructor_binlog_encr_chat_delete (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void free_ds_constructor_binlog_encr_chat_new (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void free_ds_constructor_binlog_encr_chat_exchange_new (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void free_ds_constructor_binlog_user_delete (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void free_ds_constructor_binlog_user_new (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void free_ds_constructor_binlog_chat_new (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void free_ds_constructor_binlog_chat_add_participant (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void free_ds_constructor_binlog_chat_del_participant (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void free_ds_constructor_binlog_set_msg_id (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void free_ds_constructor_binlog_message_delete (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void free_ds_constructor_binlog_message_new (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void free_ds_constructor_binlog_message_encr_new (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void free_ds_constructor_binlog_msg_update (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void free_ds_constructor_binlog_reset_authorization (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void free_ds_constructor_contacts_blocked (struct tl_ds_contacts_blocked *D, struct paramed_type *T);
+void free_ds_constructor_contacts_blocked_slice (struct tl_ds_contacts_blocked *D, struct paramed_type *T);
+void free_ds_constructor_contacts_contacts_not_modified (struct tl_ds_contacts_contacts *D, struct paramed_type *T);
+void free_ds_constructor_contacts_contacts (struct tl_ds_contacts_contacts *D, struct paramed_type *T);
+void free_ds_constructor_contacts_found (struct tl_ds_contacts_found *D, struct paramed_type *T);
+void free_ds_constructor_contacts_imported_contacts (struct tl_ds_contacts_imported_contacts *D, struct paramed_type *T);
+void free_ds_constructor_contacts_link (struct tl_ds_contacts_link *D, struct paramed_type *T);
+void free_ds_constructor_contacts_suggested (struct tl_ds_contacts_suggested *D, struct paramed_type *T);
+void free_ds_constructor_geochats_located (struct tl_ds_geochats_located *D, struct paramed_type *T);
+void free_ds_constructor_geochats_messages (struct tl_ds_geochats_messages *D, struct paramed_type *T);
+void free_ds_constructor_geochats_messages_slice (struct tl_ds_geochats_messages *D, struct paramed_type *T);
+void free_ds_constructor_geochats_stated_message (struct tl_ds_geochats_stated_message *D, struct paramed_type *T);
+void free_ds_constructor_help_app_update (struct tl_ds_help_app_update *D, struct paramed_type *T);
+void free_ds_constructor_help_no_app_update (struct tl_ds_help_app_update *D, struct paramed_type *T);
+void free_ds_constructor_help_invite_text (struct tl_ds_help_invite_text *D, struct paramed_type *T);
+void free_ds_constructor_help_support (struct tl_ds_help_support *D, struct paramed_type *T);
+void free_ds_constructor_messages_affected_history (struct tl_ds_messages_affected_history *D, struct paramed_type *T);
+void free_ds_constructor_messages_affected_messages (struct tl_ds_messages_affected_messages *D, struct paramed_type *T);
+void free_ds_constructor_messages_all_stickers_not_modified (struct tl_ds_messages_all_stickers *D, struct paramed_type *T);
+void free_ds_constructor_messages_all_stickers (struct tl_ds_messages_all_stickers *D, struct paramed_type *T);
+void free_ds_constructor_messages_chat_full (struct tl_ds_messages_chat_full *D, struct paramed_type *T);
+void free_ds_constructor_messages_chats (struct tl_ds_messages_chats *D, struct paramed_type *T);
+void free_ds_constructor_messages_dh_config_not_modified (struct tl_ds_messages_dh_config *D, struct paramed_type *T);
+void free_ds_constructor_messages_dh_config (struct tl_ds_messages_dh_config *D, struct paramed_type *T);
+void free_ds_constructor_messages_dialogs (struct tl_ds_messages_dialogs *D, struct paramed_type *T);
+void free_ds_constructor_messages_dialogs_slice (struct tl_ds_messages_dialogs *D, struct paramed_type *T);
+void free_ds_constructor_messages_message_empty (struct tl_ds_messages_message *D, struct paramed_type *T);
+void free_ds_constructor_messages_messages (struct tl_ds_messages_messages *D, struct paramed_type *T);
+void free_ds_constructor_messages_messages_slice (struct tl_ds_messages_messages *D, struct paramed_type *T);
+void free_ds_constructor_messages_sent_encrypted_message (struct tl_ds_messages_sent_encrypted_message *D, struct paramed_type *T);
+void free_ds_constructor_messages_sent_encrypted_file (struct tl_ds_messages_sent_encrypted_message *D, struct paramed_type *T);
+void free_ds_constructor_messages_sent_message (struct tl_ds_messages_sent_message *D, struct paramed_type *T);
+void free_ds_constructor_messages_sent_message_link (struct tl_ds_messages_sent_message *D, struct paramed_type *T);
+void free_ds_constructor_messages_sticker_set (struct tl_ds_messages_sticker_set *D, struct paramed_type *T);
+void free_ds_constructor_messages_stickers_not_modified (struct tl_ds_messages_stickers *D, struct paramed_type *T);
+void free_ds_constructor_messages_stickers (struct tl_ds_messages_stickers *D, struct paramed_type *T);
+void free_ds_constructor_photos_photo (struct tl_ds_photos_photo *D, struct paramed_type *T);
+void free_ds_constructor_photos_photos (struct tl_ds_photos_photos *D, struct paramed_type *T);
+void free_ds_constructor_photos_photos_slice (struct tl_ds_photos_photos *D, struct paramed_type *T);
+void free_ds_constructor_storage_file_unknown (struct tl_ds_storage_file_type *D, struct paramed_type *T);
+void free_ds_constructor_storage_file_jpeg (struct tl_ds_storage_file_type *D, struct paramed_type *T);
+void free_ds_constructor_storage_file_gif (struct tl_ds_storage_file_type *D, struct paramed_type *T);
+void free_ds_constructor_storage_file_png (struct tl_ds_storage_file_type *D, struct paramed_type *T);
+void free_ds_constructor_storage_file_pdf (struct tl_ds_storage_file_type *D, struct paramed_type *T);
+void free_ds_constructor_storage_file_mp3 (struct tl_ds_storage_file_type *D, struct paramed_type *T);
+void free_ds_constructor_storage_file_mov (struct tl_ds_storage_file_type *D, struct paramed_type *T);
+void free_ds_constructor_storage_file_partial (struct tl_ds_storage_file_type *D, struct paramed_type *T);
+void free_ds_constructor_storage_file_mp4 (struct tl_ds_storage_file_type *D, struct paramed_type *T);
+void free_ds_constructor_storage_file_webp (struct tl_ds_storage_file_type *D, struct paramed_type *T);
+void free_ds_constructor_updates_difference_empty (struct tl_ds_updates_difference *D, struct paramed_type *T);
+void free_ds_constructor_updates_difference (struct tl_ds_updates_difference *D, struct paramed_type *T);
+void free_ds_constructor_updates_difference_slice (struct tl_ds_updates_difference *D, struct paramed_type *T);
+void free_ds_constructor_updates_state (struct tl_ds_updates_state *D, struct paramed_type *T);
+void free_ds_constructor_upload_file (struct tl_ds_upload_file *D, struct paramed_type *T);
+void free_ds_type_account_days_t_t_l (struct tl_ds_account_days_t_t_l *D, struct paramed_type *T);
+void free_ds_type_audio (struct tl_ds_audio *D, struct paramed_type *T);
+void free_ds_type_authorization (struct tl_ds_authorization *D, struct paramed_type *T);
+void free_ds_type_bool (struct tl_ds_bool *D, struct paramed_type *T);
+void free_ds_type_bot_command (struct tl_ds_bot_command *D, struct paramed_type *T);
+void free_ds_type_bot_info (struct tl_ds_bot_info *D, struct paramed_type *T);
+void free_ds_type_bytes (struct tl_ds_string *D, struct paramed_type *T);
+void free_ds_type_chat (struct tl_ds_chat *D, struct paramed_type *T);
+void free_ds_type_chat_full (struct tl_ds_chat_full *D, struct paramed_type *T);
+void free_ds_type_chat_invite (struct tl_ds_chat_invite *D, struct paramed_type *T);
+void free_ds_type_chat_located (struct tl_ds_chat_located *D, struct paramed_type *T);
+void free_ds_type_chat_participant (struct tl_ds_chat_participant *D, struct paramed_type *T);
+void free_ds_type_chat_participants (struct tl_ds_chat_participants *D, struct paramed_type *T);
+void free_ds_type_chat_photo (struct tl_ds_chat_photo *D, struct paramed_type *T);
+void free_ds_type_client_d_h_inner_data (struct tl_ds_client_d_h_inner_data *D, struct paramed_type *T);
+void free_ds_type_config (struct tl_ds_config *D, struct paramed_type *T);
+void free_ds_type_contact (struct tl_ds_contact *D, struct paramed_type *T);
+void free_ds_type_contact_blocked (struct tl_ds_contact_blocked *D, struct paramed_type *T);
+void free_ds_type_contact_found (struct tl_ds_contact_found *D, struct paramed_type *T);
+void free_ds_type_contact_link (struct tl_ds_contact_link *D, struct paramed_type *T);
+void free_ds_type_contact_status (struct tl_ds_contact_status *D, struct paramed_type *T);
+void free_ds_type_contact_suggested (struct tl_ds_contact_suggested *D, struct paramed_type *T);
+void free_ds_type_dc_option (struct tl_ds_dc_option *D, struct paramed_type *T);
+void free_ds_type_decrypted_message (struct tl_ds_decrypted_message *D, struct paramed_type *T);
+void free_ds_type_decrypted_message_action (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void free_ds_type_decrypted_message_layer (struct tl_ds_decrypted_message_layer *D, struct paramed_type *T);
+void free_ds_type_decrypted_message_media (struct tl_ds_decrypted_message_media *D, struct paramed_type *T);
+void free_ds_type_dialog (struct tl_ds_dialog *D, struct paramed_type *T);
+void free_ds_type_disabled_feature (struct tl_ds_disabled_feature *D, struct paramed_type *T);
+void free_ds_type_document (struct tl_ds_document *D, struct paramed_type *T);
+void free_ds_type_document_attribute (struct tl_ds_document_attribute *D, struct paramed_type *T);
+void free_ds_type_double (double *D, struct paramed_type *T);
+void free_ds_type_encrypted_chat (struct tl_ds_encrypted_chat *D, struct paramed_type *T);
+void free_ds_type_encrypted_file (struct tl_ds_encrypted_file *D, struct paramed_type *T);
+void free_ds_type_encrypted_message (struct tl_ds_encrypted_message *D, struct paramed_type *T);
+void free_ds_type_error (struct tl_ds_error *D, struct paramed_type *T);
+void free_ds_type_exported_chat_invite (struct tl_ds_exported_chat_invite *D, struct paramed_type *T);
+void free_ds_type_file_location (struct tl_ds_file_location *D, struct paramed_type *T);
+void free_ds_type_geo_chat_message (struct tl_ds_geo_chat_message *D, struct paramed_type *T);
+void free_ds_type_geo_point (struct tl_ds_geo_point *D, struct paramed_type *T);
+void free_ds_type_imported_contact (struct tl_ds_imported_contact *D, struct paramed_type *T);
+void free_ds_type_input_app_event (struct tl_ds_input_app_event *D, struct paramed_type *T);
+void free_ds_type_input_audio (struct tl_ds_input_audio *D, struct paramed_type *T);
+void free_ds_type_input_chat_photo (struct tl_ds_input_chat_photo *D, struct paramed_type *T);
+void free_ds_type_input_contact (struct tl_ds_input_contact *D, struct paramed_type *T);
+void free_ds_type_input_document (struct tl_ds_input_document *D, struct paramed_type *T);
+void free_ds_type_input_encrypted_chat (struct tl_ds_input_encrypted_chat *D, struct paramed_type *T);
+void free_ds_type_input_encrypted_file (struct tl_ds_input_encrypted_file *D, struct paramed_type *T);
+void free_ds_type_input_file (struct tl_ds_input_file *D, struct paramed_type *T);
+void free_ds_type_input_file_location (struct tl_ds_input_file_location *D, struct paramed_type *T);
+void free_ds_type_input_geo_chat (struct tl_ds_input_geo_chat *D, struct paramed_type *T);
+void free_ds_type_input_geo_point (struct tl_ds_input_geo_point *D, struct paramed_type *T);
+void free_ds_type_input_media (struct tl_ds_input_media *D, struct paramed_type *T);
+void free_ds_type_input_notify_peer (struct tl_ds_input_notify_peer *D, struct paramed_type *T);
+void free_ds_type_input_peer (struct tl_ds_input_peer *D, struct paramed_type *T);
+void free_ds_type_input_peer_notify_events (struct tl_ds_input_peer_notify_events *D, struct paramed_type *T);
+void free_ds_type_input_peer_notify_settings (struct tl_ds_input_peer_notify_settings *D, struct paramed_type *T);
+void free_ds_type_input_photo (struct tl_ds_input_photo *D, struct paramed_type *T);
+void free_ds_type_input_photo_crop (struct tl_ds_input_photo_crop *D, struct paramed_type *T);
+void free_ds_type_input_privacy_key (struct tl_ds_input_privacy_key *D, struct paramed_type *T);
+void free_ds_type_input_privacy_rule (struct tl_ds_input_privacy_rule *D, struct paramed_type *T);
+void free_ds_type_input_sticker_set (struct tl_ds_input_sticker_set *D, struct paramed_type *T);
+void free_ds_type_input_user (struct tl_ds_input_user *D, struct paramed_type *T);
+void free_ds_type_input_video (struct tl_ds_input_video *D, struct paramed_type *T);
+void free_ds_type_int (int *D, struct paramed_type *T);
+void free_ds_type_int128 (struct tl_ds_int128 *D, struct paramed_type *T);
+void free_ds_type_int256 (struct tl_ds_int256 *D, struct paramed_type *T);
+void free_ds_type_keyboard_button (struct tl_ds_keyboard_button *D, struct paramed_type *T);
+void free_ds_type_keyboard_button_row (struct tl_ds_keyboard_button_row *D, struct paramed_type *T);
+void free_ds_type_long (long long *D, struct paramed_type *T);
+void free_ds_type_message (struct tl_ds_message *D, struct paramed_type *T);
+void free_ds_type_message_action (struct tl_ds_message_action *D, struct paramed_type *T);
+void free_ds_type_message_media (struct tl_ds_message_media *D, struct paramed_type *T);
+void free_ds_type_messages_filter (struct tl_ds_messages_filter *D, struct paramed_type *T);
+void free_ds_type_nearest_dc (struct tl_ds_nearest_dc *D, struct paramed_type *T);
+void free_ds_type_notify_peer (struct tl_ds_notify_peer *D, struct paramed_type *T);
+void free_ds_type_null (struct tl_ds_null *D, struct paramed_type *T);
+void free_ds_type_p_q_inner_data (struct tl_ds_p_q_inner_data *D, struct paramed_type *T);
+void free_ds_type_peer (struct tl_ds_peer *D, struct paramed_type *T);
+void free_ds_type_peer_notify_events (struct tl_ds_peer_notify_events *D, struct paramed_type *T);
+void free_ds_type_peer_notify_settings (struct tl_ds_peer_notify_settings *D, struct paramed_type *T);
+void free_ds_type_photo (struct tl_ds_photo *D, struct paramed_type *T);
+void free_ds_type_photo_size (struct tl_ds_photo_size *D, struct paramed_type *T);
+void free_ds_type_privacy_key (struct tl_ds_privacy_key *D, struct paramed_type *T);
+void free_ds_type_privacy_rule (struct tl_ds_privacy_rule *D, struct paramed_type *T);
+void free_ds_type_received_notify_message (struct tl_ds_received_notify_message *D, struct paramed_type *T);
+void free_ds_type_reply_markup (struct tl_ds_reply_markup *D, struct paramed_type *T);
+void free_ds_type_res_p_q (struct tl_ds_res_p_q *D, struct paramed_type *T);
+void free_ds_type_send_message_action (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void free_ds_type_server_d_h_params (struct tl_ds_server_d_h_params *D, struct paramed_type *T);
+void free_ds_type_server_d_h_inner_data (struct tl_ds_server_d_h_inner_data *D, struct paramed_type *T);
+void free_ds_type_set_client_d_h_params_answer (struct tl_ds_set_client_d_h_params_answer *D, struct paramed_type *T);
+void free_ds_type_sticker_pack (struct tl_ds_sticker_pack *D, struct paramed_type *T);
+void free_ds_type_sticker_set (struct tl_ds_sticker_set *D, struct paramed_type *T);
+void free_ds_type_string (struct tl_ds_string *D, struct paramed_type *T);
+void free_ds_type_update (struct tl_ds_update *D, struct paramed_type *T);
+void free_ds_type_updates (struct tl_ds_updates *D, struct paramed_type *T);
+void free_ds_type_user (struct tl_ds_user *D, struct paramed_type *T);
+void free_ds_type_user_full (struct tl_ds_user_full *D, struct paramed_type *T);
+void free_ds_type_user_profile_photo (struct tl_ds_user_profile_photo *D, struct paramed_type *T);
+void free_ds_type_user_status (struct tl_ds_user_status *D, struct paramed_type *T);
+void free_ds_type_vector (struct tl_ds_vector *D, struct paramed_type *T);
+void free_ds_type_video (struct tl_ds_video *D, struct paramed_type *T);
+void free_ds_type_wall_paper (struct tl_ds_wall_paper *D, struct paramed_type *T);
+void free_ds_type_web_page (struct tl_ds_web_page *D, struct paramed_type *T);
+void free_ds_type_account_authorizations (struct tl_ds_account_authorizations *D, struct paramed_type *T);
+void free_ds_type_account_password (struct tl_ds_account_password *D, struct paramed_type *T);
+void free_ds_type_account_password_input_settings (struct tl_ds_account_password_input_settings *D, struct paramed_type *T);
+void free_ds_type_account_password_settings (struct tl_ds_account_password_settings *D, struct paramed_type *T);
+void free_ds_type_account_privacy_rules (struct tl_ds_account_privacy_rules *D, struct paramed_type *T);
+void free_ds_type_account_sent_change_phone_code (struct tl_ds_account_sent_change_phone_code *D, struct paramed_type *T);
+void free_ds_type_auth_authorization (struct tl_ds_auth_authorization *D, struct paramed_type *T);
+void free_ds_type_auth_checked_phone (struct tl_ds_auth_checked_phone *D, struct paramed_type *T);
+void free_ds_type_auth_exported_authorization (struct tl_ds_auth_exported_authorization *D, struct paramed_type *T);
+void free_ds_type_auth_password_recovery (struct tl_ds_auth_password_recovery *D, struct paramed_type *T);
+void free_ds_type_auth_sent_code (struct tl_ds_auth_sent_code *D, struct paramed_type *T);
+void free_ds_type_binlog_encr_key (struct tl_ds_binlog_encr_key *D, struct paramed_type *T);
+void free_ds_type_binlog_update (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void free_ds_type_contacts_blocked (struct tl_ds_contacts_blocked *D, struct paramed_type *T);
+void free_ds_type_contacts_contacts (struct tl_ds_contacts_contacts *D, struct paramed_type *T);
+void free_ds_type_contacts_found (struct tl_ds_contacts_found *D, struct paramed_type *T);
+void free_ds_type_contacts_imported_contacts (struct tl_ds_contacts_imported_contacts *D, struct paramed_type *T);
+void free_ds_type_contacts_link (struct tl_ds_contacts_link *D, struct paramed_type *T);
+void free_ds_type_contacts_suggested (struct tl_ds_contacts_suggested *D, struct paramed_type *T);
+void free_ds_type_geochats_located (struct tl_ds_geochats_located *D, struct paramed_type *T);
+void free_ds_type_geochats_messages (struct tl_ds_geochats_messages *D, struct paramed_type *T);
+void free_ds_type_geochats_stated_message (struct tl_ds_geochats_stated_message *D, struct paramed_type *T);
+void free_ds_type_help_app_update (struct tl_ds_help_app_update *D, struct paramed_type *T);
+void free_ds_type_help_invite_text (struct tl_ds_help_invite_text *D, struct paramed_type *T);
+void free_ds_type_help_support (struct tl_ds_help_support *D, struct paramed_type *T);
+void free_ds_type_messages_affected_history (struct tl_ds_messages_affected_history *D, struct paramed_type *T);
+void free_ds_type_messages_affected_messages (struct tl_ds_messages_affected_messages *D, struct paramed_type *T);
+void free_ds_type_messages_all_stickers (struct tl_ds_messages_all_stickers *D, struct paramed_type *T);
+void free_ds_type_messages_chat_full (struct tl_ds_messages_chat_full *D, struct paramed_type *T);
+void free_ds_type_messages_chats (struct tl_ds_messages_chats *D, struct paramed_type *T);
+void free_ds_type_messages_dh_config (struct tl_ds_messages_dh_config *D, struct paramed_type *T);
+void free_ds_type_messages_dialogs (struct tl_ds_messages_dialogs *D, struct paramed_type *T);
+void free_ds_type_messages_message (struct tl_ds_messages_message *D, struct paramed_type *T);
+void free_ds_type_messages_messages (struct tl_ds_messages_messages *D, struct paramed_type *T);
+void free_ds_type_messages_sent_encrypted_message (struct tl_ds_messages_sent_encrypted_message *D, struct paramed_type *T);
+void free_ds_type_messages_sent_message (struct tl_ds_messages_sent_message *D, struct paramed_type *T);
+void free_ds_type_messages_sticker_set (struct tl_ds_messages_sticker_set *D, struct paramed_type *T);
+void free_ds_type_messages_stickers (struct tl_ds_messages_stickers *D, struct paramed_type *T);
+void free_ds_type_photos_photo (struct tl_ds_photos_photo *D, struct paramed_type *T);
+void free_ds_type_photos_photos (struct tl_ds_photos_photos *D, struct paramed_type *T);
+void free_ds_type_storage_file_type (struct tl_ds_storage_file_type *D, struct paramed_type *T);
+void free_ds_type_updates_difference (struct tl_ds_updates_difference *D, struct paramed_type *T);
+void free_ds_type_updates_state (struct tl_ds_updates_state *D, struct paramed_type *T);
+void free_ds_type_upload_file (struct tl_ds_upload_file *D, struct paramed_type *T);
+void free_ds_type_any (void *D, struct paramed_type *T);
diff --git a/protocols/Telegram/tgl/auto/auto-print-ds.c b/protocols/Telegram/tgl/auto/auto-print-ds.c
new file mode 100644
index 0000000000..6ca075d912
--- /dev/null
+++ b/protocols/Telegram/tgl/auto/auto-print-ds.c
@@ -0,0 +1,16382 @@
+#ifdef _MSC_VER
+#include "..\auto.h"
+#include "auto-print-ds.h"
+#include "auto-skip.h"
+#include "..\auto-static-print-ds.c"
+#include "..\mtproto-common.h"
+#else
+#include "auto.h"
+#include "auto/auto-print-ds.h"
+#include "auto/auto-skip.h"
+#include "auto-static-print-ds.c"
+#include "mtproto-common.h"
+#endif
+#include <assert.h>
+int print_ds_constructor_account_days_t_t_l (struct tl_ds_account_days_t_t_l *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb8d0afdf && T->type->name != 0x472f5020)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->days, field1);
+ return 0;
+}
+int print_ds_constructor_audio_empty (struct tl_ds_audio *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fc5ec4e && T->type->name != 0x603a13b1)) { return -1; }
+ eprintf (" audioEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_audio (struct tl_ds_audio *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fc5ec4e && T->type->name != 0x603a13b1)) { return -1; }
+ eprintf (" audio");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" duration :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->duration, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mime_type :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->mime_type, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" size :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->size, field7);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc_id :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->dc_id, field8);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_authorization (struct tl_ds_authorization *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bf2e6f6 && T->type->name != 0x840d1909)) { return -1; }
+ eprintf (" authorization");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" hash :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->hash, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->flags, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" device_model :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->device_model, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" platform :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->platform, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" system_version :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->system_version, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" api_id :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->api_id, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" app_name :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->app_name, field7);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" app_version :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->app_version, field8);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date_created :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date_created, field9);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date_active :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date_active, field10);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" ip :"); }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->ip, field11);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" country :"); }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->country, field12);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" region :"); }
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->region, field13);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_bool_false (struct tl_ds_bool *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x250be282 && T->type->name != 0xdaf41d7d)) { return -1; }
+ eprintf (" boolFalse");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_bool_true (struct tl_ds_bool *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x250be282 && T->type->name != 0xdaf41d7d)) { return -1; }
+ eprintf (" boolTrue");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_bot_command (struct tl_ds_bot_command *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x75e7ea6c && T->type->name != 0x8a181593)) { return -1; }
+ eprintf (" botCommand");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" command :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->command, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" description :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->description, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_bot_command_old (struct tl_ds_bot_command *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x75e7ea6c && T->type->name != 0x8a181593)) { return -1; }
+ eprintf (" botCommandOld");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" command :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->command, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" params :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->params, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" description :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->description, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_bot_info_empty (struct tl_ds_bot_info *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb2e16f93 && T->type->name != 0x4d1e906c)) { return -1; }
+ eprintf (" botInfoEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_bot_info (struct tl_ds_bot_info *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb2e16f93 && T->type->name != 0x4d1e906c)) { return -1; }
+ eprintf (" botInfo");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" version :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->version, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" share_text :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->share_text, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" description :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->description, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" commands :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x75e7ea6c, .id = "BotCommand", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->commands, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_bytes (struct tl_ds_string *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0ee1379f && T->type->name != 0xf11ec860)) { return -1; }
+ print_escaped_string (DS->data, DS->len);
+ return 0;
+}
+int print_ds_constructor_chat_empty (struct tl_ds_chat *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return -1; }
+ eprintf (" chatEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_chat (struct tl_ds_chat *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return -1; }
+ eprintf (" chat");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" title :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->title, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x56922676, .id = "ChatPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_chat_photo (DS->photo, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" participants_count :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->participants_count, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" left :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bool (DS->left, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" version :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->version, field7);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_chat_forbidden (struct tl_ds_chat *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return -1; }
+ eprintf (" chatForbidden");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" title :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->title, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_geo_chat (struct tl_ds_chat *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return -1; }
+ eprintf (" geoChat");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" title :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->title, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" address :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->address, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" venue :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->venue, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" geo :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_geo_point (DS->geo, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x56922676, .id = "ChatPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_chat_photo (DS->photo, field7);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" participants_count :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->participants_count, field8);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field9);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" checked_in :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bool (DS->checked_in, field10);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" version :"); }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->version, field11);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_chat_full (struct tl_ds_chat_full *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02a614 && T->type->name != 0xd1fd59eb)) { return -1; }
+ eprintf (" chatFull");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" participants :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x77930f9f, .id = "ChatParticipants", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_chat_participants (DS->participants, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_photo :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_photo (DS->chat_photo, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" notify_settings :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_peer_notify_settings (DS->notify_settings, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" exported_invite :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f132d5, .id = "ExportedChatInvite", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_exported_chat_invite (DS->exported_invite, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" bot_info :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb2e16f93, .id = "BotInfo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->bot_info, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_chat_invite_already (struct tl_ds_chat_invite *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x94f910b1 && T->type->name != 0x6b06ef4e)) { return -1; }
+ eprintf (" chatInviteAlready");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_chat (DS->chat, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_chat_invite (struct tl_ds_chat_invite *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x94f910b1 && T->type->name != 0x6b06ef4e)) { return -1; }
+ eprintf (" chatInvite");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" title :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->title, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_chat_located (struct tl_ds_chat_located *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3631cf4c && T->type->name != 0xc9ce30b3)) { return -1; }
+ eprintf (" chatLocated");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->chat_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" distance :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->distance, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_chat_participant (struct tl_ds_chat_participant *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc8d7493e && T->type->name != 0x3728b6c1)) { return -1; }
+ eprintf (" chatParticipant");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" inviter_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->inviter_id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_chat_participants_forbidden (struct tl_ds_chat_participants *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x77930f9f && T->type->name != 0x886cf060)) { return -1; }
+ eprintf (" chatParticipantsForbidden");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->chat_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_chat_participants (struct tl_ds_chat_participants *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x77930f9f && T->type->name != 0x886cf060)) { return -1; }
+ eprintf (" chatParticipants");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->chat_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" admin_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->admin_id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" participants :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc8d7493e, .id = "ChatParticipant", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->participants, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" version :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->version, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_chat_photo_empty (struct tl_ds_chat_photo *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x56922676 && T->type->name != 0xa96dd989)) { return -1; }
+ eprintf (" chatPhotoEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_chat_photo (struct tl_ds_chat_photo *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x56922676 && T->type->name != 0xa96dd989)) { return -1; }
+ eprintf (" chatPhoto");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo_small :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_file_location (DS->photo_small, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo_big :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_file_location (DS->photo_big, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_client_d_h_inner_data (struct tl_ds_client_d_h_inner_data *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6643b654 && T->type->name != 0x99bc49ab)) { return -1; }
+ eprintf (" client_DH_inner_data");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" nonce :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int128 (DS->nonce, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" server_nonce :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int128 (DS->server_nonce, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" retry_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->retry_id, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" g_b :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->g_b, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_config (struct tl_ds_config *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e32b894 && T->type->name != 0xb1cd476b)) { return -1; }
+ eprintf (" config");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" expires :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->expires, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" test_mode :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bool (DS->test_mode, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" this_dc :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->this_dc, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc_options :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2b1a62f0, .id = "DcOption", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->dc_options, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_size_max :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->chat_size_max, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" broadcast_size_max :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->broadcast_size_max, field7);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" forwarded_count_max :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->forwarded_count_max, field8);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" online_update_period_ms :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->online_update_period_ms, field9);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" offline_blur_timeout_ms :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->offline_blur_timeout_ms, field10);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" offline_idle_timeout_ms :"); }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->offline_idle_timeout_ms, field11);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" online_cloud_timeout_ms :"); }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->online_cloud_timeout_ms, field12);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" notify_cloud_delay_ms :"); }
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->notify_cloud_delay_ms, field13);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" notify_default_delay_ms :"); }
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->notify_default_delay_ms, field14);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_big_size :"); }
+ struct paramed_type *field15 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->chat_big_size, field15);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" push_chat_period_ms :"); }
+ struct paramed_type *field16 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->push_chat_period_ms, field16);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" push_chat_limit :"); }
+ struct paramed_type *field17 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->push_chat_limit, field17);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" disabled_features :"); }
+ struct paramed_type *field18 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xae636f24, .id = "DisabledFeature", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->disabled_features, field18);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_contact (struct tl_ds_contact *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf911c994 && T->type->name != 0x06ee366b)) { return -1; }
+ eprintf (" contact");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mutual :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bool (DS->mutual, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_contact_blocked (struct tl_ds_contact_blocked *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x561bc879 && T->type->name != 0xa9e43786)) { return -1; }
+ eprintf (" contactBlocked");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_contact_found (struct tl_ds_contact_found *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xea879f95 && T->type->name != 0x1578606a)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field1);
+ return 0;
+}
+int print_ds_constructor_contact_link_unknown (struct tl_ds_contact_link *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return -1; }
+ eprintf (" contactLinkUnknown");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_contact_link_none (struct tl_ds_contact_link *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return -1; }
+ eprintf (" contactLinkNone");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_contact_link_has_phone (struct tl_ds_contact_link *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return -1; }
+ eprintf (" contactLinkHasPhone");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_contact_link_contact (struct tl_ds_contact_link *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return -1; }
+ eprintf (" contactLinkContact");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_contact_status (struct tl_ds_contact_status *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd3680c61 && T->type->name != 0x2c97f39e)) { return -1; }
+ eprintf (" contactStatus");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" status :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x76de9570, .id = "UserStatus", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_user_status (DS->status, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_contact_suggested (struct tl_ds_contact_suggested *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3de191a1 && T->type->name != 0xc21e6e5e)) { return -1; }
+ eprintf (" contactSuggested");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mutual_contacts :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->mutual_contacts, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_dc_option_l28 (struct tl_ds_dc_option *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2b1a62f0 && T->type->name != 0xd4e59d0f)) { return -1; }
+ eprintf (" dcOptionL28");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" hostname :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->hostname, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" ip_address :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->ip_address, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" port :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->port, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_dc_option (struct tl_ds_dc_option *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2b1a62f0 && T->type->name != 0xd4e59d0f)) { return -1; }
+ eprintf (" dcOption");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->flags, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" ip_address :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->ip_address, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" port :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->port, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_decrypted_message (struct tl_ds_decrypted_message *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x535b7918 && T->type->name != 0xaca486e7)) { return -1; }
+ eprintf (" decryptedMessage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" random_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->random_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" ttl :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->ttl, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" message :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->message, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" media :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x34e0d674, .id = "DecryptedMessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_decrypted_message_media (DS->media, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_decrypted_message_service (struct tl_ds_decrypted_message *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x535b7918 && T->type->name != 0xaca486e7)) { return -1; }
+ eprintf (" decryptedMessageService");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" random_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->random_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" action :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4e0eefde, .id = "DecryptedMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_decrypted_message_action (DS->action, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_decrypted_message_action_set_message_t_t_l (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ eprintf (" decryptedMessageActionSetMessageTTL");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" ttl_seconds :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->ttl_seconds, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_decrypted_message_action_read_messages (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ eprintf (" decryptedMessageActionReadMessages");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" random_ids :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->random_ids, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_decrypted_message_action_delete_messages (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ eprintf (" decryptedMessageActionDeleteMessages");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" random_ids :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->random_ids, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_decrypted_message_action_screenshot_messages (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ eprintf (" decryptedMessageActionScreenshotMessages");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" random_ids :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->random_ids, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_decrypted_message_action_flush_history (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ eprintf (" decryptedMessageActionFlushHistory");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_decrypted_message_action_resend (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ eprintf (" decryptedMessageActionResend");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" start_seq_no :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->start_seq_no, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" end_seq_no :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->end_seq_no, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_decrypted_message_action_notify_layer (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ eprintf (" decryptedMessageActionNotifyLayer");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" layer :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->layer, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_decrypted_message_action_typing (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ eprintf (" decryptedMessageActionTyping");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" action :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x70541c7e, .id = "SendMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_send_message_action (DS->action, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_decrypted_message_action_request_key (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ eprintf (" decryptedMessageActionRequestKey");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" exchange_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->exchange_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" g_a :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->g_a, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_decrypted_message_action_accept_key (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ eprintf (" decryptedMessageActionAcceptKey");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" exchange_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->exchange_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" g_b :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->g_b, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key_fingerprint :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->key_fingerprint, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_decrypted_message_action_abort_key (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ eprintf (" decryptedMessageActionAbortKey");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" exchange_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->exchange_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_decrypted_message_action_commit_key (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ eprintf (" decryptedMessageActionCommitKey");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" exchange_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->exchange_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key_fingerprint :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->key_fingerprint, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_decrypted_message_action_noop (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ eprintf (" decryptedMessageActionNoop");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_decrypted_message_layer (struct tl_ds_decrypted_message_layer *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1be31789 && T->type->name != 0xe41ce876)) { return -1; }
+ eprintf (" decryptedMessageLayer");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" random_bytes :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->random_bytes, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" layer :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->layer, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" in_seq_no :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->in_seq_no, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" out_seq_no :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->out_seq_no, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" message :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x535b7918, .id = "DecryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_decrypted_message (DS->message, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_decrypted_message_media_empty (struct tl_ds_decrypted_message_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ eprintf (" decryptedMessageMediaEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_decrypted_message_media_photo (struct tl_ds_decrypted_message_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ eprintf (" decryptedMessageMediaPhoto");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" str_thumb :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->str_thumb, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb_w :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->thumb_w, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb_h :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->thumb_h, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" w :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->w, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" h :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->h, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" size :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->size, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->key, field7);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" iv :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->iv, field8);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_decrypted_message_media_geo_point (struct tl_ds_decrypted_message_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ eprintf (" decryptedMessageMediaGeoPoint");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" latitude :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_double (DS->latitude, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" longitude :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_double (DS->longitude, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_decrypted_message_media_contact (struct tl_ds_decrypted_message_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ eprintf (" decryptedMessageMediaContact");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" phone_number :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->phone_number, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" first_name :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->first_name, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" last_name :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->last_name, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_decrypted_message_media_document (struct tl_ds_decrypted_message_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ eprintf (" decryptedMessageMediaDocument");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" str_thumb :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->str_thumb, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb_w :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->thumb_w, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb_h :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->thumb_h, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" file_name :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->file_name, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mime_type :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->mime_type, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" size :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->size, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->key, field7);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" iv :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->iv, field8);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_decrypted_message_media_video (struct tl_ds_decrypted_message_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ eprintf (" decryptedMessageMediaVideo");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" str_thumb :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->str_thumb, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb_w :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->thumb_w, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb_h :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->thumb_h, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" duration :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->duration, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mime_type :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->mime_type, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" w :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->w, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" h :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->h, field7);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" size :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->size, field8);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->key, field9);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" iv :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->iv, field10);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_decrypted_message_media_audio (struct tl_ds_decrypted_message_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ eprintf (" decryptedMessageMediaAudio");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" duration :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->duration, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mime_type :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->mime_type, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" size :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->size, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->key, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" iv :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->iv, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_decrypted_message_media_external_document (struct tl_ds_decrypted_message_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ eprintf (" decryptedMessageMediaExternalDocument");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mime_type :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->mime_type, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" size :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->size, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_photo_size (DS->thumb, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc_id :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->dc_id, field7);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" attributes :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->attributes, field8);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_decrypted_message_media_video_l12 (struct tl_ds_decrypted_message_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ eprintf (" decryptedMessageMediaVideoL12");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" str_thumb :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->str_thumb, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb_w :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->thumb_w, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb_h :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->thumb_h, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" duration :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->duration, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" w :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->w, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" h :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->h, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" size :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->size, field7);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->key, field8);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" iv :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->iv, field9);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_decrypted_message_media_audio_l12 (struct tl_ds_decrypted_message_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ eprintf (" decryptedMessageMediaAudioL12");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" duration :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->duration, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" size :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->size, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->key, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" iv :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->iv, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_dialog (struct tl_ds_dialog *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc1dd804a && T->type->name != 0x3e227fb5)) { return -1; }
+ eprintf (" dialog");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" peer :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_peer (DS->peer, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" top_message :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->top_message, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" read_inbox_max_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->read_inbox_max_id, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" unread_count :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->unread_count, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" notify_settings :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_peer_notify_settings (DS->notify_settings, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_disabled_feature (struct tl_ds_disabled_feature *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xae636f24 && T->type->name != 0x519c90db)) { return -1; }
+ eprintf (" disabledFeature");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" feature :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->feature, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" description :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->description, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_document_empty (struct tl_ds_document *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x51a73418 && T->type->name != 0xae58cbe7)) { return -1; }
+ eprintf (" documentEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_document (struct tl_ds_document *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x51a73418 && T->type->name != 0xae58cbe7)) { return -1; }
+ eprintf (" document");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mime_type :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->mime_type, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" size :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->size, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_photo_size (DS->thumb, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc_id :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->dc_id, field7);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" attributes :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->attributes, field8);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_document_l19 (struct tl_ds_document *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x51a73418 && T->type->name != 0xae58cbe7)) { return -1; }
+ eprintf (" document_l19");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" file_name :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->file_name, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mime_type :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->mime_type, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" size :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->size, field7);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_photo_size (DS->thumb, field8);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc_id :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->dc_id, field9);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_document_attribute_image_size (struct tl_ds_document_attribute *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ eprintf (" documentAttributeImageSize");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" w :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->w, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" h :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->h, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_document_attribute_animated (struct tl_ds_document_attribute *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ eprintf (" documentAttributeAnimated");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_document_attribute_sticker_l28 (struct tl_ds_document_attribute *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ eprintf (" documentAttributeStickerL28");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" alt :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->alt, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_document_attribute_sticker (struct tl_ds_document_attribute *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ eprintf (" documentAttributeSticker");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" alt :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->alt, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" stickerset :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe44d415c, .id = "InputStickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_input_sticker_set (DS->stickerset, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_document_attribute_video (struct tl_ds_document_attribute *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ eprintf (" documentAttributeVideo");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" duration :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->duration, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" w :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->w, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" h :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->h, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_document_attribute_audio (struct tl_ds_document_attribute *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ eprintf (" documentAttributeAudio");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" duration :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->duration, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_document_attribute_filename (struct tl_ds_document_attribute *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ eprintf (" documentAttributeFilename");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" file_name :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->file_name, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_double (double *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2210c154 && T->type->name != 0xddef3eab)) { return -1; }
+ eprintf (" %lf", *DS);
+ return 0;
+}
+int print_ds_constructor_encrypted_chat_empty (struct tl_ds_encrypted_chat *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return -1; }
+ eprintf (" encryptedChatEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_encrypted_chat_waiting (struct tl_ds_encrypted_chat *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return -1; }
+ eprintf (" encryptedChatWaiting");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" admin_id :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->admin_id, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" participant_id :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->participant_id, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_encrypted_chat_requested (struct tl_ds_encrypted_chat *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return -1; }
+ eprintf (" encryptedChatRequested");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" admin_id :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->admin_id, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" participant_id :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->participant_id, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" g_a :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->g_a, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_encrypted_chat (struct tl_ds_encrypted_chat *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return -1; }
+ eprintf (" encryptedChat");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" admin_id :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->admin_id, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" participant_id :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->participant_id, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" g_a_or_b :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->g_a_or_b, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key_fingerprint :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->key_fingerprint, field7);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_encrypted_chat_discarded (struct tl_ds_encrypted_chat *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return -1; }
+ eprintf (" encryptedChatDiscarded");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_encrypted_file_empty (struct tl_ds_encrypted_file *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x886fd032 && T->type->name != 0x77902fcd)) { return -1; }
+ eprintf (" encryptedFileEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_encrypted_file (struct tl_ds_encrypted_file *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x886fd032 && T->type->name != 0x77902fcd)) { return -1; }
+ eprintf (" encryptedFile");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" size :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->size, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc_id :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->dc_id, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key_fingerprint :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->key_fingerprint, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_encrypted_message (struct tl_ds_encrypted_message *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xce6b8a1e && T->type->name != 0x319475e1)) { return -1; }
+ eprintf (" encryptedMessage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" random_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->random_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->chat_id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" bytes :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->bytes, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" file :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x886fd032, .id = "EncryptedFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_encrypted_file (DS->file, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_encrypted_message_service (struct tl_ds_encrypted_message *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xce6b8a1e && T->type->name != 0x319475e1)) { return -1; }
+ eprintf (" encryptedMessageService");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" random_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->random_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->chat_id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" bytes :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->bytes, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_error (struct tl_ds_error *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc4b9f9bb && T->type->name != 0x3b460644)) { return -1; }
+ eprintf (" error");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" code :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->code, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" text :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->text, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_chat_invite_empty (struct tl_ds_exported_chat_invite *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f132d5 && T->type->name != 0x6a0ecd2a)) { return -1; }
+ eprintf (" chatInviteEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_chat_invite_exported (struct tl_ds_exported_chat_invite *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f132d5 && T->type->name != 0x6a0ecd2a)) { return -1; }
+ eprintf (" chatInviteExported");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" link :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->link, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_file_location_unavailable (struct tl_ds_file_location *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2f8ffb30 && T->type->name != 0xd07004cf)) { return -1; }
+ eprintf (" fileLocationUnavailable");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" volume_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->volume_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" local_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->local_id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" secret :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->secret, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_file_location (struct tl_ds_file_location *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2f8ffb30 && T->type->name != 0xd07004cf)) { return -1; }
+ eprintf (" fileLocation");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->dc_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" volume_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->volume_id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" local_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->local_id, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" secret :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->secret, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_geo_chat_message_empty (struct tl_ds_geo_chat_message *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf67b4034 && T->type->name != 0x0984bfcb)) { return -1; }
+ eprintf (" geoChatMessageEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->chat_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_geo_chat_message (struct tl_ds_geo_chat_message *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf67b4034 && T->type->name != 0x0984bfcb)) { return -1; }
+ eprintf (" geoChatMessage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->chat_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" from_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->from_id, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" message :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->message, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" media :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_message_media (DS->media, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_geo_chat_message_service (struct tl_ds_geo_chat_message *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf67b4034 && T->type->name != 0x0984bfcb)) { return -1; }
+ eprintf (" geoChatMessageService");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->chat_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" from_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->from_id, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" action :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x383415fa, .id = "MessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_message_action (DS->action, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_geo_point_empty (struct tl_ds_geo_point *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x315e0a53 && T->type->name != 0xcea1f5ac)) { return -1; }
+ eprintf (" geoPointEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_geo_point (struct tl_ds_geo_point *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x315e0a53 && T->type->name != 0xcea1f5ac)) { return -1; }
+ eprintf (" geoPoint");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" longitude :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_double (DS->longitude, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" latitude :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_double (DS->latitude, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_imported_contact (struct tl_ds_imported_contact *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd0028438 && T->type->name != 0x2ffd7bc7)) { return -1; }
+ eprintf (" importedContact");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" client_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->client_id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_app_event (struct tl_ds_input_app_event *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x770656a8 && T->type->name != 0x88f9a957)) { return -1; }
+ eprintf (" inputAppEvent");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" time :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_double (DS->time, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" type :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->type, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" peer :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->peer, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" data :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->data, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_audio_empty (struct tl_ds_input_audio *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xae8e9c7b && T->type->name != 0x51716384)) { return -1; }
+ eprintf (" inputAudioEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_audio (struct tl_ds_input_audio *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xae8e9c7b && T->type->name != 0x51716384)) { return -1; }
+ eprintf (" inputAudio");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_chat_photo_empty (struct tl_ds_input_chat_photo *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3a60776d && T->type->name != 0xc59f8892)) { return -1; }
+ eprintf (" inputChatPhotoEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_chat_uploaded_photo (struct tl_ds_input_chat_photo *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3a60776d && T->type->name != 0xc59f8892)) { return -1; }
+ eprintf (" inputChatUploadedPhoto");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" file :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_input_file (DS->file, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" crop :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7477e321, .id = "InputPhotoCrop", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_input_photo_crop (DS->crop, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_chat_photo (struct tl_ds_input_chat_photo *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3a60776d && T->type->name != 0xc59f8892)) { return -1; }
+ eprintf (" inputChatPhoto");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe74279c9, .id = "InputPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_input_photo (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" crop :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7477e321, .id = "InputPhotoCrop", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_input_photo_crop (DS->crop, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_phone_contact (struct tl_ds_input_contact *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf392b7f4 && T->type->name != 0x0c6d480b)) { return -1; }
+ eprintf (" inputPhoneContact");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" client_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->client_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" phone :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->phone, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" first_name :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->first_name, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" last_name :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->last_name, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_document_empty (struct tl_ds_input_document *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6a8963fc && T->type->name != 0x95769c03)) { return -1; }
+ eprintf (" inputDocumentEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_document (struct tl_ds_input_document *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6a8963fc && T->type->name != 0x95769c03)) { return -1; }
+ eprintf (" inputDocument");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_encrypted_chat (struct tl_ds_input_encrypted_chat *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf141b5e1 && T->type->name != 0x0ebe4a1e)) { return -1; }
+ eprintf (" inputEncryptedChat");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->chat_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_encrypted_file_empty (struct tl_ds_input_encrypted_file *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return -1; }
+ eprintf (" inputEncryptedFileEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_encrypted_file_uploaded (struct tl_ds_input_encrypted_file *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return -1; }
+ eprintf (" inputEncryptedFileUploaded");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" parts :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->parts, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" md5_checksum :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->md5_checksum, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key_fingerprint :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->key_fingerprint, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_encrypted_file (struct tl_ds_input_encrypted_file *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return -1; }
+ eprintf (" inputEncryptedFile");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_encrypted_file_big_uploaded (struct tl_ds_input_encrypted_file *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return -1; }
+ eprintf (" inputEncryptedFileBigUploaded");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" parts :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->parts, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key_fingerprint :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->key_fingerprint, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_file (struct tl_ds_input_file *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0f60f9ca && T->type->name != 0xf09f0635)) { return -1; }
+ eprintf (" inputFile");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" parts :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->parts, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" name :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->name, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" md5_checksum :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->md5_checksum, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_file_big (struct tl_ds_input_file *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0f60f9ca && T->type->name != 0xf09f0635)) { return -1; }
+ eprintf (" inputFileBig");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" parts :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->parts, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" name :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->name, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_file_location (struct tl_ds_input_file_location *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return -1; }
+ eprintf (" inputFileLocation");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" volume_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->volume_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" local_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->local_id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" secret :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->secret, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_video_file_location (struct tl_ds_input_file_location *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return -1; }
+ eprintf (" inputVideoFileLocation");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_encrypted_file_location (struct tl_ds_input_file_location *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return -1; }
+ eprintf (" inputEncryptedFileLocation");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_audio_file_location (struct tl_ds_input_file_location *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return -1; }
+ eprintf (" inputAudioFileLocation");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_document_file_location (struct tl_ds_input_file_location *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return -1; }
+ eprintf (" inputDocumentFileLocation");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_geo_chat (struct tl_ds_input_geo_chat *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x74d456fa && T->type->name != 0x8b2ba905)) { return -1; }
+ eprintf (" inputGeoChat");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->chat_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_geo_point_empty (struct tl_ds_input_geo_point *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17768f1f && T->type->name != 0xe88970e0)) { return -1; }
+ eprintf (" inputGeoPointEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_geo_point (struct tl_ds_input_geo_point *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17768f1f && T->type->name != 0xe88970e0)) { return -1; }
+ eprintf (" inputGeoPoint");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" latitude :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_double (DS->latitude, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" longitude :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_double (DS->longitude, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_media_empty (struct tl_ds_input_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ eprintf (" inputMediaEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_media_uploaded_photo (struct tl_ds_input_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ eprintf (" inputMediaUploadedPhoto");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" file :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_input_file (DS->file, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" caption :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->caption, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_media_photo (struct tl_ds_input_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ eprintf (" inputMediaPhoto");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe74279c9, .id = "InputPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_input_photo (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" caption :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->caption, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_media_geo_point (struct tl_ds_input_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ eprintf (" inputMediaGeoPoint");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" geo_point :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17768f1f, .id = "InputGeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_input_geo_point (DS->geo_point, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_media_contact (struct tl_ds_input_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ eprintf (" inputMediaContact");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" phone_number :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->phone_number, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" first_name :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->first_name, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" last_name :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->last_name, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_media_uploaded_video (struct tl_ds_input_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ eprintf (" inputMediaUploadedVideo");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" file :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_input_file (DS->file, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" duration :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->duration, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" w :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->w, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" h :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->h, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" caption :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->caption, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_media_uploaded_thumb_video (struct tl_ds_input_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ eprintf (" inputMediaUploadedThumbVideo");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" file :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_input_file (DS->file, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_input_file (DS->thumb, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" duration :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->duration, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" w :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->w, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" h :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->h, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" caption :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->caption, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_media_video (struct tl_ds_input_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ eprintf (" inputMediaVideo");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" video_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xbb5f7a27, .id = "InputVideo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_input_video (DS->video_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" caption :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->caption, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_media_uploaded_audio (struct tl_ds_input_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ eprintf (" inputMediaUploadedAudio");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" file :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_input_file (DS->file, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" duration :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->duration, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mime_type :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->mime_type, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_media_audio (struct tl_ds_input_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ eprintf (" inputMediaAudio");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" audio_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xae8e9c7b, .id = "InputAudio", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_input_audio (DS->audio_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_media_uploaded_document (struct tl_ds_input_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ eprintf (" inputMediaUploadedDocument");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" file :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_input_file (DS->file, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mime_type :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->mime_type, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" attributes :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->attributes, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_media_uploaded_thumb_document (struct tl_ds_input_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ eprintf (" inputMediaUploadedThumbDocument");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" file :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_input_file (DS->file, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_input_file (DS->thumb, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mime_type :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->mime_type, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" attributes :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->attributes, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_media_document (struct tl_ds_input_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ eprintf (" inputMediaDocument");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" document_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x6a8963fc, .id = "InputDocument", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_input_document (DS->document_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_media_venue (struct tl_ds_input_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ eprintf (" inputMediaVenue");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" geo_point :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17768f1f, .id = "InputGeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_input_geo_point (DS->geo_point, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" title :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->title, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" address :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->address, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" provider :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->provider, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" venue_id :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->venue_id, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_notify_peer (struct tl_ds_input_notify_peer *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return -1; }
+ eprintf (" inputNotifyPeer");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" peer :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9e67268d, .id = "InputPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_input_peer (DS->peer, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_notify_users (struct tl_ds_input_notify_peer *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return -1; }
+ eprintf (" inputNotifyUsers");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_notify_chats (struct tl_ds_input_notify_peer *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return -1; }
+ eprintf (" inputNotifyChats");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_notify_all (struct tl_ds_input_notify_peer *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return -1; }
+ eprintf (" inputNotifyAll");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_notify_geo_chat_peer (struct tl_ds_input_notify_peer *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return -1; }
+ eprintf (" inputNotifyGeoChatPeer");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" geo_peer :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x74d456fa, .id = "InputGeoChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_input_geo_chat (DS->geo_peer, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_peer_empty (struct tl_ds_input_peer *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return -1; }
+ eprintf (" inputPeerEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_peer_self (struct tl_ds_input_peer *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return -1; }
+ eprintf (" inputPeerSelf");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_peer_contact (struct tl_ds_input_peer *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return -1; }
+ eprintf (" inputPeerContact");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_peer_foreign (struct tl_ds_input_peer *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return -1; }
+ eprintf (" inputPeerForeign");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_peer_chat (struct tl_ds_input_peer *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return -1; }
+ eprintf (" inputPeerChat");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->chat_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_peer_notify_events_empty (struct tl_ds_input_peer_notify_events *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x185a48ac && T->type->name != 0xe7a5b753)) { return -1; }
+ eprintf (" inputPeerNotifyEventsEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_peer_notify_events_all (struct tl_ds_input_peer_notify_events *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x185a48ac && T->type->name != 0xe7a5b753)) { return -1; }
+ eprintf (" inputPeerNotifyEventsAll");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_peer_notify_settings (struct tl_ds_input_peer_notify_settings *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x46a2ce98 && T->type->name != 0xb95d3167)) { return -1; }
+ eprintf (" inputPeerNotifySettings");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mute_until :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->mute_until, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" sound :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->sound, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" show_previews :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bool (DS->show_previews, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" events_mask :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->events_mask, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_photo_empty (struct tl_ds_input_photo *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe74279c9 && T->type->name != 0x18bd8636)) { return -1; }
+ eprintf (" inputPhotoEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_photo (struct tl_ds_input_photo *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe74279c9 && T->type->name != 0x18bd8636)) { return -1; }
+ eprintf (" inputPhoto");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_photo_crop_auto (struct tl_ds_input_photo_crop *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7477e321 && T->type->name != 0x8b881cde)) { return -1; }
+ eprintf (" inputPhotoCropAuto");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_photo_crop (struct tl_ds_input_photo_crop *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7477e321 && T->type->name != 0x8b881cde)) { return -1; }
+ eprintf (" inputPhotoCrop");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" crop_left :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_double (DS->crop_left, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" crop_top :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_double (DS->crop_top, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" crop_width :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_double (DS->crop_width, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_privacy_key_status_timestamp (struct tl_ds_input_privacy_key *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4f96cb18 && T->type->name != 0xb06934e7)) { return -1; }
+ eprintf (" inputPrivacyKeyStatusTimestamp");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_privacy_value_allow_contacts (struct tl_ds_input_privacy_rule *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ eprintf (" inputPrivacyValueAllowContacts");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_privacy_value_allow_all (struct tl_ds_input_privacy_rule *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ eprintf (" inputPrivacyValueAllowAll");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_privacy_value_allow_users (struct tl_ds_input_privacy_rule *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ eprintf (" inputPrivacyValueAllowUsers");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->users, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_privacy_value_disallow_contacts (struct tl_ds_input_privacy_rule *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ eprintf (" inputPrivacyValueDisallowContacts");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_privacy_value_disallow_all (struct tl_ds_input_privacy_rule *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ eprintf (" inputPrivacyValueDisallowAll");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_privacy_value_disallow_users (struct tl_ds_input_privacy_rule *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ eprintf (" inputPrivacyValueDisallowUsers");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->users, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_sticker_set_empty (struct tl_ds_input_sticker_set *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe44d415c && T->type->name != 0x1bb2bea3)) { return -1; }
+ eprintf (" inputStickerSetEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_sticker_set_i_d (struct tl_ds_input_sticker_set *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe44d415c && T->type->name != 0x1bb2bea3)) { return -1; }
+ eprintf (" inputStickerSetID");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_sticker_set_short_name (struct tl_ds_input_sticker_set *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe44d415c && T->type->name != 0x1bb2bea3)) { return -1; }
+ eprintf (" inputStickerSetShortName");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" short_name :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->short_name, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_user_empty (struct tl_ds_input_user *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return -1; }
+ eprintf (" inputUserEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_user_self (struct tl_ds_input_user *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return -1; }
+ eprintf (" inputUserSelf");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_user_contact (struct tl_ds_input_user *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return -1; }
+ eprintf (" inputUserContact");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_user_foreign (struct tl_ds_input_user *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return -1; }
+ eprintf (" inputUserForeign");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_video_empty (struct tl_ds_input_video *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbb5f7a27 && T->type->name != 0x44a085d8)) { return -1; }
+ eprintf (" inputVideoEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_video (struct tl_ds_input_video *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbb5f7a27 && T->type->name != 0x44a085d8)) { return -1; }
+ eprintf (" inputVideo");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_int (int *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8509bda && T->type->name != 0x57af6425)) { return -1; }
+ eprintf (" %d", *DS);
+ return 0;
+}
+int print_ds_constructor_int128 (struct tl_ds_int128 *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7d36c439 && T->type->name != 0x82c93bc6)) { return -1; }
+ eprintf (" int128");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->f0, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->f1, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_int256 (struct tl_ds_int256 *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf2c798b3 && T->type->name != 0x0d38674c)) { return -1; }
+ eprintf (" int256");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->f0, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->f1, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->f2, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->f3, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_keyboard_button (struct tl_ds_keyboard_button *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa2fa4880 && T->type->name != 0x5d05b77f)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->text, field1);
+ return 0;
+}
+int print_ds_constructor_keyboard_button_row (struct tl_ds_keyboard_button_row *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x77608b83 && T->type->name != 0x889f747c)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa2fa4880, .id = "KeyboardButton", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->buttons, field1);
+ return 0;
+}
+int print_ds_constructor_long (long long *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22076cba && T->type->name != 0xddf89345)) { return -1; }
+ eprintf (" %I64d", *DS);
+ return 0;
+}
+int print_ds_constructor_message_empty (struct tl_ds_message *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5d652a7f && T->type->name != 0xa29ad580)) { return -1; }
+ eprintf (" messageEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_message (struct tl_ds_message *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5d652a7f && T->type->name != 0xa29ad580)) { return -1; }
+ eprintf (" message");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ struct paramed_type *var0 = INT2PTR (*DS->flags);
+ eprintf (" %d", (int)PTR2INT (var0));
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" from_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->from_id, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" to_id :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_peer (DS->to_id, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" fwd_from_id :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->fwd_from_id, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" fwd_date :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->fwd_date, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" reply_to_msg_id :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->reply_to_msg_id, field7);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field8);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" message :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->message, field9);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" media :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_message_media (DS->media, field10);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (PTR2INT (var0) & (1 << 6)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" reply_markup :"); }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x612ca4a9, .id = "ReplyMarkup", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_reply_markup (DS->reply_markup, field11);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ return 0;
+}
+int print_ds_constructor_message_service (struct tl_ds_message *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5d652a7f && T->type->name != 0xa29ad580)) { return -1; }
+ eprintf (" messageService");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->flags, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" from_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->from_id, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" to_id :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_peer (DS->to_id, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" action :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x383415fa, .id = "MessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_message_action (DS->action, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_message_action_empty (struct tl_ds_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ eprintf (" messageActionEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_message_action_chat_create (struct tl_ds_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ eprintf (" messageActionChatCreate");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" title :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->title, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->users, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_message_action_chat_edit_title (struct tl_ds_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ eprintf (" messageActionChatEditTitle");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" title :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->title, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_message_action_chat_edit_photo (struct tl_ds_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ eprintf (" messageActionChatEditPhoto");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_photo (DS->photo, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_message_action_chat_delete_photo (struct tl_ds_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ eprintf (" messageActionChatDeletePhoto");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_message_action_chat_add_user (struct tl_ds_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ eprintf (" messageActionChatAddUser");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_message_action_chat_delete_user (struct tl_ds_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ eprintf (" messageActionChatDeleteUser");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_message_action_geo_chat_create (struct tl_ds_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ eprintf (" messageActionGeoChatCreate");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" title :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->title, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" address :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->address, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_message_action_geo_chat_checkin (struct tl_ds_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ eprintf (" messageActionGeoChatCheckin");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_message_action_chat_joined_by_link (struct tl_ds_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ eprintf (" messageActionChatJoinedByLink");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" inviter_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->inviter_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_message_media_empty (struct tl_ds_message_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ eprintf (" messageMediaEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_message_media_photo (struct tl_ds_message_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ eprintf (" messageMediaPhoto");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_photo (DS->photo, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" caption :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->caption, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_message_media_video (struct tl_ds_message_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ eprintf (" messageMediaVideo");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" video :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1716b174, .id = "Video", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_video (DS->video, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" caption :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->caption, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_message_media_geo (struct tl_ds_message_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ eprintf (" messageMediaGeo");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" geo :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_geo_point (DS->geo, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_message_media_contact (struct tl_ds_message_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ eprintf (" messageMediaContact");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" phone_number :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->phone_number, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" first_name :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->first_name, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" last_name :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->last_name, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_message_media_unsupported (struct tl_ds_message_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ eprintf (" messageMediaUnsupported");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_message_media_document (struct tl_ds_message_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ eprintf (" messageMediaDocument");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" document :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_document (DS->document, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_message_media_audio (struct tl_ds_message_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ eprintf (" messageMediaAudio");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" audio :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9fc5ec4e, .id = "Audio", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_audio (DS->audio, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_message_media_web_page (struct tl_ds_message_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ eprintf (" messageMediaWebPage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" webpage :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x8d8c0d41, .id = "WebPage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_web_page (DS->webpage, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_message_media_venue (struct tl_ds_message_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ eprintf (" messageMediaVenue");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" geo :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_geo_point (DS->geo, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" title :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->title, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" address :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->address, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" provider :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->provider, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" venue_id :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->venue_id, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_message_media_photo_l27 (struct tl_ds_message_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ eprintf (" messageMediaPhotoL27");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_photo (DS->photo, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_message_media_video_l27 (struct tl_ds_message_media *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ eprintf (" messageMediaVideoL27");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" video :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1716b174, .id = "Video", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_video (DS->video, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_messages_filter_empty (struct tl_ds_messages_filter *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ eprintf (" inputMessagesFilterEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_messages_filter_photos (struct tl_ds_messages_filter *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ eprintf (" inputMessagesFilterPhotos");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_messages_filter_video (struct tl_ds_messages_filter *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ eprintf (" inputMessagesFilterVideo");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_messages_filter_photo_video (struct tl_ds_messages_filter *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ eprintf (" inputMessagesFilterPhotoVideo");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_messages_filter_photo_video_documents (struct tl_ds_messages_filter *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ eprintf (" inputMessagesFilterPhotoVideoDocuments");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_messages_filter_document (struct tl_ds_messages_filter *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ eprintf (" inputMessagesFilterDocument");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_input_messages_filter_audio (struct tl_ds_messages_filter *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ eprintf (" inputMessagesFilterAudio");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_nearest_dc (struct tl_ds_nearest_dc *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8e1a1775 && T->type->name != 0x71e5e88a)) { return -1; }
+ eprintf (" nearestDc");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" country :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->country, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" this_dc :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->this_dc, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" nearest_dc :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->nearest_dc, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_notify_peer (struct tl_ds_notify_peer *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return -1; }
+ eprintf (" notifyPeer");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" peer :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_peer (DS->peer, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_notify_users (struct tl_ds_notify_peer *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return -1; }
+ eprintf (" notifyUsers");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_notify_chats (struct tl_ds_notify_peer *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return -1; }
+ eprintf (" notifyChats");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_notify_all (struct tl_ds_notify_peer *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return -1; }
+ eprintf (" notifyAll");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_null (struct tl_ds_null *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x56730bcc && T->type->name != 0xa98cf433)) { return -1; }
+ eprintf (" null");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_p_q_inner_data (struct tl_ds_p_q_inner_data *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbfa3de38 && T->type->name != 0x405c21c7)) { return -1; }
+ eprintf (" p_q_inner_data");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pq :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->pq, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" p :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->p, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" q :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->q, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" nonce :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int128 (DS->nonce, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" server_nonce :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int128 (DS->server_nonce, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_nonce :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0d38674c, .id = "Bare_Int256", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int256 (DS->new_nonce, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_p_q_inner_data_temp (struct tl_ds_p_q_inner_data *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbfa3de38 && T->type->name != 0x405c21c7)) { return -1; }
+ eprintf (" p_q_inner_data_temp");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pq :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->pq, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" p :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->p, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" q :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->q, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" nonce :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int128 (DS->nonce, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" server_nonce :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int128 (DS->server_nonce, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_nonce :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0d38674c, .id = "Bare_Int256", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int256 (DS->new_nonce, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" expires_in :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->expires_in, field7);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_peer_user (struct tl_ds_peer *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x276159d6 && T->type->name != 0xd89ea629)) { return -1; }
+ eprintf (" peerUser");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_peer_chat (struct tl_ds_peer *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x276159d6 && T->type->name != 0xd89ea629)) { return -1; }
+ eprintf (" peerChat");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->chat_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_peer_notify_events_empty (struct tl_ds_peer_notify_events *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc0c8d13b && T->type->name != 0x3f372ec4)) { return -1; }
+ eprintf (" peerNotifyEventsEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_peer_notify_events_all (struct tl_ds_peer_notify_events *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc0c8d13b && T->type->name != 0x3f372ec4)) { return -1; }
+ eprintf (" peerNotifyEventsAll");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_peer_notify_settings_empty (struct tl_ds_peer_notify_settings *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xfdf894fc && T->type->name != 0x02076b03)) { return -1; }
+ eprintf (" peerNotifySettingsEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_peer_notify_settings (struct tl_ds_peer_notify_settings *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xfdf894fc && T->type->name != 0x02076b03)) { return -1; }
+ eprintf (" peerNotifySettings");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mute_until :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->mute_until, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" sound :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->sound, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" show_previews :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bool (DS->show_previews, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" events_mask :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->events_mask, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_photo_empty (struct tl_ds_photo *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc207550a && T->type->name != 0x3df8aaf5)) { return -1; }
+ eprintf (" photoEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_photo (struct tl_ds_photo *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc207550a && T->type->name != 0x3df8aaf5)) { return -1; }
+ eprintf (" photo");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" geo :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_geo_point (DS->geo, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" sizes :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->sizes, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_photo_l27 (struct tl_ds_photo *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc207550a && T->type->name != 0x3df8aaf5)) { return -1; }
+ eprintf (" photoL27");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" caption :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->caption, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" geo :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_geo_point (DS->geo, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" sizes :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->sizes, field7);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_photo_size_empty (struct tl_ds_photo_size *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x900f60dd && T->type->name != 0x6ff09f22)) { return -1; }
+ eprintf (" photoSizeEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" type :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->type, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_photo_size (struct tl_ds_photo_size *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x900f60dd && T->type->name != 0x6ff09f22)) { return -1; }
+ eprintf (" photoSize");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" type :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->type, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" location :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_file_location (DS->location, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" w :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->w, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" h :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->h, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" size :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->size, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_photo_cached_size (struct tl_ds_photo_size *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x900f60dd && T->type->name != 0x6ff09f22)) { return -1; }
+ eprintf (" photoCachedSize");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" type :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->type, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" location :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_file_location (DS->location, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" w :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->w, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" h :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->h, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" bytes :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->bytes, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_privacy_key_status_timestamp (struct tl_ds_privacy_key *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbc2eab30 && T->type->name != 0x43d154cf)) { return -1; }
+ eprintf (" privacyKeyStatusTimestamp");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_privacy_value_allow_contacts (struct tl_ds_privacy_rule *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ eprintf (" privacyValueAllowContacts");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_privacy_value_allow_all (struct tl_ds_privacy_rule *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ eprintf (" privacyValueAllowAll");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_privacy_value_allow_users (struct tl_ds_privacy_rule *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ eprintf (" privacyValueAllowUsers");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->users, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_privacy_value_disallow_contacts (struct tl_ds_privacy_rule *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ eprintf (" privacyValueDisallowContacts");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_privacy_value_disallow_all (struct tl_ds_privacy_rule *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ eprintf (" privacyValueDisallowAll");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_privacy_value_disallow_users (struct tl_ds_privacy_rule *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ eprintf (" privacyValueDisallowUsers");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->users, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_received_notify_message (struct tl_ds_received_notify_message *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa384b779 && T->type->name != 0x5c7b4886)) { return -1; }
+ eprintf (" receivedNotifyMessage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->flags, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_reply_keyboard_hide (struct tl_ds_reply_markup *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x612ca4a9 && T->type->name != 0x9ed35b56)) { return -1; }
+ eprintf (" replyKeyboardHide");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->flags, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_reply_keyboard_force_reply (struct tl_ds_reply_markup *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x612ca4a9 && T->type->name != 0x9ed35b56)) { return -1; }
+ eprintf (" replyKeyboardForceReply");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->flags, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_reply_keyboard_markup (struct tl_ds_reply_markup *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x612ca4a9 && T->type->name != 0x9ed35b56)) { return -1; }
+ eprintf (" replyKeyboardMarkup");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->flags, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" rows :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x77608b83, .id = "KeyboardButtonRow", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->rows, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_res_p_q (struct tl_ds_res_p_q *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x05162463 && T->type->name != 0xfae9db9c)) { return -1; }
+ eprintf (" resPQ");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" nonce :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int128 (DS->nonce, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" server_nonce :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int128 (DS->server_nonce, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pq :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->pq, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" server_public_key_fingerprints :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->server_public_key_fingerprints, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_send_message_typing_action (struct tl_ds_send_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ eprintf (" sendMessageTypingAction");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_send_message_cancel_action (struct tl_ds_send_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ eprintf (" sendMessageCancelAction");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_send_message_record_video_action (struct tl_ds_send_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ eprintf (" sendMessageRecordVideoAction");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_send_message_upload_video_action_l27 (struct tl_ds_send_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ eprintf (" sendMessageUploadVideoActionL27");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_send_message_upload_video_action (struct tl_ds_send_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ eprintf (" sendMessageUploadVideoAction");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" progress :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->progress, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_send_message_record_audio_action (struct tl_ds_send_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ eprintf (" sendMessageRecordAudioAction");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_send_message_upload_audio_action_l27 (struct tl_ds_send_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ eprintf (" sendMessageUploadAudioActionL27");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_send_message_upload_audio_action (struct tl_ds_send_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ eprintf (" sendMessageUploadAudioAction");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" progress :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->progress, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_send_message_upload_photo_action (struct tl_ds_send_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ eprintf (" sendMessageUploadPhotoAction");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" progress :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->progress, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_send_message_upload_document_action_l27 (struct tl_ds_send_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ eprintf (" sendMessageUploadDocumentActionL27");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_send_message_upload_document_action (struct tl_ds_send_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ eprintf (" sendMessageUploadDocumentAction");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" progress :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->progress, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_send_message_geo_location_action (struct tl_ds_send_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ eprintf (" sendMessageGeoLocationAction");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_send_message_choose_contact_action (struct tl_ds_send_message_action *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ eprintf (" sendMessageChooseContactAction");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_server_d_h_params_fail (struct tl_ds_server_d_h_params *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa9230301 && T->type->name != 0x56dcfcfe)) { return -1; }
+ eprintf (" server_DH_params_fail");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" nonce :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int128 (DS->nonce, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" server_nonce :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int128 (DS->server_nonce, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_nonce_hash :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int128 (DS->new_nonce_hash, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_server_d_h_params_ok (struct tl_ds_server_d_h_params *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa9230301 && T->type->name != 0x56dcfcfe)) { return -1; }
+ eprintf (" server_DH_params_ok");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" nonce :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int128 (DS->nonce, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" server_nonce :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int128 (DS->server_nonce, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" encrypted_answer :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->encrypted_answer, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_server_d_h_inner_data (struct tl_ds_server_d_h_inner_data *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb5890dba && T->type->name != 0x4a76f245)) { return -1; }
+ eprintf (" server_DH_inner_data");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" nonce :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int128 (DS->nonce, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" server_nonce :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int128 (DS->server_nonce, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" g :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->g, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dh_prime :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->dh_prime, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" g_a :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->g_a, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" server_time :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->server_time, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_dh_gen_ok (struct tl_ds_set_client_d_h_params_answer *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdb8a468f && T->type->name != 0x2475b970)) { return -1; }
+ eprintf (" dh_gen_ok");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" nonce :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int128 (DS->nonce, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" server_nonce :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int128 (DS->server_nonce, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_nonce_hash1 :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int128 (DS->new_nonce_hash1, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_dh_gen_retry (struct tl_ds_set_client_d_h_params_answer *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdb8a468f && T->type->name != 0x2475b970)) { return -1; }
+ eprintf (" dh_gen_retry");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" nonce :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int128 (DS->nonce, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" server_nonce :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int128 (DS->server_nonce, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_nonce_hash2 :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int128 (DS->new_nonce_hash2, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_dh_gen_fail (struct tl_ds_set_client_d_h_params_answer *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdb8a468f && T->type->name != 0x2475b970)) { return -1; }
+ eprintf (" dh_gen_fail");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" nonce :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int128 (DS->nonce, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" server_nonce :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int128 (DS->server_nonce, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_nonce_hash3 :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int128 (DS->new_nonce_hash3, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_sticker_pack (struct tl_ds_sticker_pack *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x12b299d4 && T->type->name != 0xed4d662b)) { return -1; }
+ eprintf (" stickerPack");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" emoticon :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->emoticon, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" documents :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->documents, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_sticker_set (struct tl_ds_sticker_set *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa7a43b17 && T->type->name != 0x585bc4e8)) { return -1; }
+ eprintf (" stickerSet");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" title :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->title, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" short_name :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->short_name, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_string (struct tl_ds_string *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb5286e24 && T->type->name != 0x4ad791db)) { return -1; }
+ print_escaped_string (DS->data, DS->len);
+ return 0;
+}
+int print_ds_constructor_update_new_message (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateNewMessage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" message :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_message (DS->message, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->pts, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts_count :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->pts_count, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_message_i_d (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateMessageID");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" random_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->random_id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_delete_messages (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateDeleteMessages");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" messages :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->messages, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->pts, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts_count :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->pts_count, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_user_typing (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateUserTyping");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" action :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x70541c7e, .id = "SendMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_send_message_action (DS->action, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_chat_user_typing (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateChatUserTyping");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->chat_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" action :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x70541c7e, .id = "SendMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_send_message_action (DS->action, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_chat_participants (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateChatParticipants");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" participants :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x77930f9f, .id = "ChatParticipants", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_chat_participants (DS->participants, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_user_status (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateUserStatus");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" status :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x76de9570, .id = "UserStatus", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_user_status (DS->status, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_user_name (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateUserName");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" first_name :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->first_name, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" last_name :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->last_name, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" username :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->username, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_user_photo (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateUserPhoto");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9a486229, .id = "UserProfilePhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_user_profile_photo (DS->photo, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" previous :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bool (DS->previous, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_contact_registered (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateContactRegistered");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_contact_link (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateContactLink");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" my_link :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_contact_link (DS->my_link, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" foreign_link :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_contact_link (DS->foreign_link, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_new_authorization (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateNewAuthorization");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" auth_key_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->auth_key_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" device :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->device, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" location :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->location, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_new_geo_chat_message (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateNewGeoChatMessage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" geo_message :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_geo_chat_message (DS->geo_message, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_new_encrypted_message (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateNewEncryptedMessage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" encr_message :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xce6b8a1e, .id = "EncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_encrypted_message (DS->encr_message, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" qts :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->qts, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_encrypted_chat_typing (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateEncryptedChatTyping");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->chat_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_encryption (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateEncryption");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" encr_chat :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb1718213, .id = "EncryptedChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_encrypted_chat (DS->encr_chat, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_encrypted_messages_read (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateEncryptedMessagesRead");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->chat_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" max_date :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->max_date, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_chat_participant_add (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateChatParticipantAdd");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->chat_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" inviter_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->inviter_id, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" version :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->version, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_chat_participant_delete (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateChatParticipantDelete");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->chat_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" version :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->version, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_dc_options (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateDcOptions");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc_options :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2b1a62f0, .id = "DcOption", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->dc_options, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_user_blocked (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateUserBlocked");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" blocked :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bool (DS->blocked, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_notify_settings (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateNotifySettings");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" notify_peer :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9fcb8237, .id = "NotifyPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_notify_peer (DS->notify_peer, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" notify_settings :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_peer_notify_settings (DS->notify_settings, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_service_notification (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateServiceNotification");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" type :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->type, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" message_text :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->message_text, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" media :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_message_media (DS->media, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" popup :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bool (DS->popup, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_privacy (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updatePrivacy");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xbc2eab30, .id = "PrivacyKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_privacy_key (DS->key, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" rules :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa8638aec, .id = "PrivacyRule", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->rules, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_user_phone (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateUserPhone");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" phone :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->phone, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_read_history_inbox (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateReadHistoryInbox");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" peer :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_peer (DS->peer, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" max_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->max_id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->pts, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts_count :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->pts_count, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_read_history_outbox (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateReadHistoryOutbox");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" peer :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_peer (DS->peer, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" max_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->max_id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->pts, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts_count :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->pts_count, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_web_page (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateWebPage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" webpage :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x8d8c0d41, .id = "WebPage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_web_page (DS->webpage, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_read_messages_contents (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateReadMessagesContents");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" messages :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->messages, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->pts, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts_count :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->pts_count, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_msg_update (struct tl_ds_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ eprintf (" updateMsgUpdate");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->pts, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts_count :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->pts_count, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_updates_too_long (struct tl_ds_updates *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ eprintf (" updatesTooLong");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_update_short_message (struct tl_ds_updates *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ eprintf (" updateShortMessage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ struct paramed_type *var0 = INT2PTR (*DS->flags);
+ eprintf (" %d", (int)PTR2INT (var0));
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" message :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->message, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->pts, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts_count :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->pts_count, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field7);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" fwd_from_id :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->fwd_from_id, field8);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" fwd_date :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->fwd_date, field9);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" reply_to_msg_id :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->reply_to_msg_id, field10);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ return 0;
+}
+int print_ds_constructor_update_short_chat_message (struct tl_ds_updates *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ eprintf (" updateShortChatMessage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ struct paramed_type *var0 = INT2PTR (*DS->flags);
+ eprintf (" %d", (int)PTR2INT (var0));
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" from_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->from_id, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_id :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->chat_id, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" message :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->message, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->pts, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts_count :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->pts_count, field7);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field8);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" fwd_from_id :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->fwd_from_id, field9);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" fwd_date :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->fwd_date, field10);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" reply_to_msg_id :"); }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->reply_to_msg_id, field11);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ return 0;
+}
+int print_ds_constructor_update_short (struct tl_ds_updates *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ eprintf (" updateShort");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" update :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_update (DS->update, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_updates_combined (struct tl_ds_updates *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ eprintf (" updatesCombined");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" updates :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->updates, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->users, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chats :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->chats, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" seq_start :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->seq_start, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" seq :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->seq, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_updates (struct tl_ds_updates *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ eprintf (" updates");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" updates :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->updates, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->users, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chats :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->chats, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" seq :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->seq, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_user_empty (struct tl_ds_user *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02e6c0c8 && T->type->name != 0xfd193f37)) { return -1; }
+ eprintf (" userEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_user (struct tl_ds_user *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02e6c0c8 && T->type->name != 0xfd193f37)) { return -1; }
+ eprintf (" user");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ struct paramed_type *var0 = INT2PTR (*DS->flags);
+ eprintf (" %d", (int)PTR2INT (var0));
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (PTR2INT (var0) & (1 << 0)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 1)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" first_name :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->first_name, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" last_name :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->last_name, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" username :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->username, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 4)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" phone :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->phone, field7);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 5)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9a486229, .id = "UserProfilePhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_user_profile_photo (DS->photo, field8);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 6)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" status :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x76de9570, .id = "UserStatus", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_user_status (DS->status, field9);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 14)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" bot_info_version :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->bot_info_version, field10);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ return 0;
+}
+int print_ds_constructor_user_full (struct tl_ds_user_full *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5a89ac5b && T->type->name != 0xa57653a4)) { return -1; }
+ eprintf (" userFull");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_user (DS->user, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" link :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3ace484c, .id = "contacts.Link", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_contacts_link (DS->link, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" profile_photo :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_photo (DS->profile_photo, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" notify_settings :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_peer_notify_settings (DS->notify_settings, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" blocked :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bool (DS->blocked, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" bot_info :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb2e16f93, .id = "BotInfo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bot_info (DS->bot_info, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_user_profile_photo_empty (struct tl_ds_user_profile_photo *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9a486229 && T->type->name != 0x65b79dd6)) { return -1; }
+ eprintf (" userProfilePhotoEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_user_profile_photo (struct tl_ds_user_profile_photo *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9a486229 && T->type->name != 0x65b79dd6)) { return -1; }
+ eprintf (" userProfilePhoto");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->photo_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo_small :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_file_location (DS->photo_small, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo_big :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_file_location (DS->photo_big, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_user_status_empty (struct tl_ds_user_status *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ eprintf (" userStatusEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_user_status_online (struct tl_ds_user_status *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ eprintf (" userStatusOnline");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" expires :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->expires, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_user_status_offline (struct tl_ds_user_status *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ eprintf (" userStatusOffline");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" was_online :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->was_online, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_user_status_recently (struct tl_ds_user_status *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ eprintf (" userStatusRecently");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_user_status_last_week (struct tl_ds_user_status *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ eprintf (" userStatusLastWeek");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_user_status_last_month (struct tl_ds_user_status *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ eprintf (" userStatusLastMonth");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_vector (struct tl_ds_vector *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1cb5c415 && T->type->name != 0xe34a3bea)) { return -1; }
+ if (ODDP(T->params[0])) { return -1; }
+ struct paramed_type *var0 = T->params[0]; assert (var0);
+ eprintf (" vector");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ struct paramed_type *var1 = INT2PTR (*DS->f1);
+ eprintf (" %d", (int)PTR2INT (var1));
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ int multiplicity3 = PTR2INT (
+ ((void *)var1) + 0 );
+ struct paramed_type *field3 =
+ var0;
+ eprintf (" [");
+ if (multiline_output >= 1) { eprintf ("\n"); }
+ if (multiline_output >= 1) { multiline_offset += multiline_offset_size;}
+ {
+ int i = 0;
+ while (i < multiplicity3) {
+ if (multiline_output >= 1) { print_offset (); }
+ print_ds_type_any (DS->f2[i ++], field3);
+ if (multiline_output >= 1) { eprintf ("\n"); }
+ }
+ }
+ if (multiline_output >= 1) { multiline_offset -= multiline_offset_size; print_offset ();}
+ eprintf (" ]");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_video_empty (struct tl_ds_video *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1716b174 && T->type->name != 0xe8e94e8b)) { return -1; }
+ eprintf (" videoEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_video (struct tl_ds_video *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1716b174 && T->type->name != 0xe8e94e8b)) { return -1; }
+ eprintf (" video");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" duration :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->duration, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" size :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->size, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_photo_size (DS->thumb, field7);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc_id :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->dc_id, field8);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" w :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->w, field9);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" h :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->h, field10);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_video_l27 (struct tl_ds_video *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1716b174 && T->type->name != 0xe8e94e8b)) { return -1; }
+ eprintf (" videoL27");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" caption :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->caption, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" duration :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->duration, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mime_type :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->mime_type, field7);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" size :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->size, field8);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" thumb :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_photo_size (DS->thumb, field9);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc_id :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->dc_id, field10);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" w :"); }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->w, field11);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" h :"); }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->h, field12);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_wall_paper (struct tl_ds_wall_paper *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xafa14973 && T->type->name != 0x505eb68c)) { return -1; }
+ eprintf (" wallPaper");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" title :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->title, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" sizes :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->sizes, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" color :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->color, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_wall_paper_solid (struct tl_ds_wall_paper *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xafa14973 && T->type->name != 0x505eb68c)) { return -1; }
+ eprintf (" wallPaperSolid");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" title :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->title, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" bg_color :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->bg_color, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" color :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->color, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_web_page_empty (struct tl_ds_web_page *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8d8c0d41 && T->type->name != 0x7273f2be)) { return -1; }
+ eprintf (" webPageEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_web_page_pending (struct tl_ds_web_page *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8d8c0d41 && T->type->name != 0x7273f2be)) { return -1; }
+ eprintf (" webPagePending");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_web_page (struct tl_ds_web_page *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8d8c0d41 && T->type->name != 0x7273f2be)) { return -1; }
+ eprintf (" webPage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ struct paramed_type *var0 = INT2PTR (*DS->flags);
+ eprintf (" %d", (int)PTR2INT (var0));
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" url :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->url, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" display_url :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->display_url, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (PTR2INT (var0) & (1 << 0)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" type :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->type, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 1)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" site_name :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->site_name, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" title :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->title, field7);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" description :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->description, field8);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 4)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_photo (DS->photo, field9);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 5)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" embed_url :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->embed_url, field10);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 5)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" embed_type :"); }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->embed_type, field11);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 6)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" embed_width :"); }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->embed_width, field12);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 6)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" embed_height :"); }
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->embed_height, field13);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 7)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" duration :"); }
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->duration, field14);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 8)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" author :"); }
+ struct paramed_type *field15 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->author, field15);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ return 0;
+}
+int print_ds_constructor_account_authorizations (struct tl_ds_account_authorizations *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1250abde && T->type->name != 0xedaf5421)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bf2e6f6, .id = "Authorization", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->authorizations, field1);
+ return 0;
+}
+int print_ds_constructor_account_no_password (struct tl_ds_account_password *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xeac2a804 && T->type->name != 0x153d57fb)) { return -1; }
+ eprintf (" account.noPassword");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_salt :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->new_salt, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" email_unconfirmed_pattern :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->email_unconfirmed_pattern, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_account_password (struct tl_ds_account_password *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xeac2a804 && T->type->name != 0x153d57fb)) { return -1; }
+ eprintf (" account.password");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" current_salt :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->current_salt, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_salt :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->new_salt, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" hint :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->hint, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" has_recovery :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bool (DS->has_recovery, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" email_unconfirmed_pattern :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->email_unconfirmed_pattern, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_account_password_input_settings (struct tl_ds_account_password_input_settings *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbcfc532c && T->type->name != 0x4303acd3)) { return -1; }
+ eprintf (" account.passwordInputSettings");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ struct paramed_type *var0 = INT2PTR (*DS->flags);
+ eprintf (" %d", (int)PTR2INT (var0));
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (PTR2INT (var0) & (1 << 0)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_salt :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->new_salt, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 0)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_password_hash :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->new_password_hash, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 0)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" hint :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->hint, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 1)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" email :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->email, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ return 0;
+}
+int print_ds_constructor_account_password_settings (struct tl_ds_account_password_settings *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb7b72ab3 && T->type->name != 0x4848d54c)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->email, field1);
+ return 0;
+}
+int print_ds_constructor_account_privacy_rules (struct tl_ds_account_privacy_rules *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x554abb6f && T->type->name != 0xaab54490)) { return -1; }
+ eprintf (" account.privacyRules");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" rules :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa8638aec, .id = "PrivacyRule", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->rules, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->users, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_account_sent_change_phone_code (struct tl_ds_account_sent_change_phone_code *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa4f58c4c && T->type->name != 0x5b0a73b3)) { return -1; }
+ eprintf (" account.sentChangePhoneCode");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" phone_code_hash :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->phone_code_hash, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" send_call_timeout :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->send_call_timeout, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_auth_authorization (struct tl_ds_auth_authorization *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xff036af1 && T->type->name != 0x00fc950e)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_user (DS->user, field1);
+ return 0;
+}
+int print_ds_constructor_auth_checked_phone (struct tl_ds_auth_checked_phone *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x811ea28e && T->type->name != 0x7ee15d71)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bool (DS->phone_registered, field1);
+ return 0;
+}
+int print_ds_constructor_auth_exported_authorization (struct tl_ds_auth_exported_authorization *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdf969c2d && T->type->name != 0x206963d2)) { return -1; }
+ eprintf (" auth.exportedAuthorization");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" bytes :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->bytes, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_auth_password_recovery (struct tl_ds_auth_password_recovery *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x137948a5 && T->type->name != 0xec86b75a)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->email_pattern, field1);
+ return 0;
+}
+int print_ds_constructor_auth_sent_code (struct tl_ds_auth_sent_code *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0cc8bc16 && T->type->name != 0xf33743e9)) { return -1; }
+ eprintf (" auth.sentCode");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" phone_registered :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bool (DS->phone_registered, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" phone_code_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->phone_code_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" send_call_timeout :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->send_call_timeout, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" is_password :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bool (DS->is_password, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_auth_sent_app_code (struct tl_ds_auth_sent_code *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0cc8bc16 && T->type->name != 0xf33743e9)) { return -1; }
+ eprintf (" auth.sentAppCode");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" phone_registered :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bool (DS->phone_registered, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" phone_code_hash :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->phone_code_hash, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" send_call_timeout :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->send_call_timeout, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" is_password :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bool (DS->is_password, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_binlog_encr_key (struct tl_ds_binlog_encr_key *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0377168f && T->type->name != 0xfc88e970)) { return -1; }
+ int multiplicity1 = PTR2INT (
+ INT2PTR (64) );
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ eprintf (" [");
+ if (multiline_output >= 1) { eprintf ("\n"); }
+ if (multiline_output >= 1) { multiline_offset += multiline_offset_size;}
+ {
+ int i = 0;
+ while (i < multiplicity1) {
+ if (multiline_output >= 1) { print_offset (); }
+ print_ds_type_any (DS->key[i ++], field1);
+ if (multiline_output >= 1) { eprintf ("\n"); }
+ }
+ }
+ if (multiline_output >= 1) { multiline_offset -= multiline_offset_size; print_offset ();}
+ eprintf (" ]");
+ return 0;
+}
+int print_ds_constructor_binlog_start (struct tl_ds_binlog_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.start");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_binlog_dc_option (struct tl_ds_binlog_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.dcOption");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->dc, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" name :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->name, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" ip :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->ip, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" port :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->port, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_binlog_dc_option_new (struct tl_ds_binlog_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.dcOptionNew");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->flags, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->dc, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" name :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->name, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" ip :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->ip, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" port :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->port, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_binlog_auth_key (struct tl_ds_binlog_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.authKey");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->dc, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_binlog_encr_key (DS->key, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_binlog_default_dc (struct tl_ds_binlog_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.defaultDc");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->dc, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_binlog_dc_signed (struct tl_ds_binlog_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.dcSigned");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dc :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->dc, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_binlog_our_id (struct tl_ds_binlog_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.ourId");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_binlog_set_dh_params (struct tl_ds_binlog_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.setDhParams");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" root :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->root, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" prime :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_binlog_encr_key (DS->prime, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" version :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->version, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_binlog_set_pts (struct tl_ds_binlog_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.setPts");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->pts, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_binlog_set_qts (struct tl_ds_binlog_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.setQts");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" qts :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->qts, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_binlog_set_date (struct tl_ds_binlog_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.setDate");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_binlog_set_seq (struct tl_ds_binlog_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.setSeq");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" seq :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->seq, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_binlog_encr_chat_delete (struct tl_ds_binlog_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.encrChatDelete");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_binlog_encr_chat_new (struct tl_ds_binlog_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.encrChatNew");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ struct paramed_type *var0 = INT2PTR (*DS->flags);
+ eprintf (" %d", (int)PTR2INT (var0));
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" admin :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->admin, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_binlog_encr_key (DS->key, field7);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" g_key :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_binlog_encr_key (DS->g_key, field8);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" state :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->state, field9);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" ttl :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->ttl, field10);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 25)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" layer :"); }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->layer, field11);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" in_seq_no :"); }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->in_seq_no, field12);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" last_in_seq_no :"); }
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->last_in_seq_no, field13);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" out_seq_no :"); }
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->out_seq_no, field14);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 27)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key_fingerprint :"); }
+ struct paramed_type *field15 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->key_fingerprint, field15);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ return 0;
+}
+int print_ds_constructor_binlog_encr_chat_exchange_new (struct tl_ds_binlog_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.encrChatExchangeNew");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ struct paramed_type *var0 = INT2PTR (*DS->flags);
+ eprintf (" %d", (int)PTR2INT (var0));
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" exchange_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->exchange_id, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" key :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_binlog_encr_key (DS->key, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" state :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->state, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ return 0;
+}
+int print_ds_constructor_binlog_user_delete (struct tl_ds_binlog_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.userDelete");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_binlog_user_new (struct tl_ds_binlog_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.userNew");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ struct paramed_type *var0 = INT2PTR (*DS->flags);
+ eprintf (" %d", (int)PTR2INT (var0));
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" access_hash :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->access_hash, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" first_name :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->first_name, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" last_name :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->last_name, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" phone :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->phone, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" username :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->username, field7);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_photo (DS->photo, field8);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" real_first_name :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->real_first_name, field9);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" real_last_name :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->real_last_name, field10);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_photo :"); }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9a486229, .id = "UserProfilePhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_user_profile_photo (DS->user_photo, field11);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" last_read_in :"); }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->last_read_in, field12);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 25)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" last_read_out :"); }
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->last_read_out, field13);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" bot_info :"); }
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb2e16f93, .id = "BotInfo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bot_info (DS->bot_info, field14);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ return 0;
+}
+int print_ds_constructor_binlog_chat_new (struct tl_ds_binlog_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.chatNew");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ struct paramed_type *var0 = INT2PTR (*DS->flags);
+ eprintf (" %d", (int)PTR2INT (var0));
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" title :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->title, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_num :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_num, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" version :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->version, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" participants :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc8d7493e, .id = "ChatParticipant", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->participants, field7);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chat_photo :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x56922676, .id = "ChatPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_chat_photo (DS->chat_photo, field8);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_photo (DS->photo, field9);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" admin :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->admin, field10);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" last_read_in :"); }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->last_read_in, field11);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 25)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" last_read_out :"); }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->last_read_out, field12);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ return 0;
+}
+int print_ds_constructor_binlog_chat_add_participant (struct tl_ds_binlog_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.chatAddParticipant");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" version :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->version, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" inviter_id :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->inviter_id, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_binlog_chat_del_participant (struct tl_ds_binlog_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.chatDelParticipant");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" version :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->version, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->user_id, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_binlog_set_msg_id (struct tl_ds_binlog_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.setMsgId");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" old_id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->old_id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_id :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->new_id, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_binlog_message_delete (struct tl_ds_binlog_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.messageDelete");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" lid :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->lid, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_binlog_message_new (struct tl_ds_binlog_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.messageNew");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ struct paramed_type *var0 = INT2PTR (*DS->flags);
+ eprintf (" %d", (int)PTR2INT (var0));
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" lid :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->lid, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" from_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->from_id, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" to_type :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->to_type, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" to_id :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->to_id, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" fwd_from_id :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->fwd_from_id, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" fwd_date :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->fwd_date, field7);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field8);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" message :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->message, field9);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" media :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_message_media (DS->media, field10);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" action :"); }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x383415fa, .id = "MessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_message_action (DS->action, field11);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" reply_id :"); }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->reply_id, field12);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" reply_markup :"); }
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x612ca4a9, .id = "ReplyMarkup", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_reply_markup (DS->reply_markup, field13);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ return 0;
+}
+int print_ds_constructor_binlog_message_encr_new (struct tl_ds_binlog_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.messageEncrNew");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" flags :"); }
+ struct paramed_type *var0 = INT2PTR (*DS->flags);
+ eprintf (" %d", (int)PTR2INT (var0));
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" lid :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->lid, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" from_id :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->from_id, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" to_type :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->to_type, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" to_id :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->to_id, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" message :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->message, field7);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" encr_media :"); }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x34e0d674, .id = "DecryptedMessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_decrypted_message_media (DS->encr_media, field8);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" encr_action :"); }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4e0eefde, .id = "DecryptedMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_decrypted_message_action (DS->encr_action, field9);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" file :"); }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x886fd032, .id = "EncryptedFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_encrypted_file (DS->file, field10);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ }
+ return 0;
+}
+int print_ds_constructor_binlog_msg_update (struct tl_ds_binlog_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.msgUpdate");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" lid :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_long (DS->lid, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_binlog_reset_authorization (struct tl_ds_binlog_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ eprintf (" binlog.resetAuthorization");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_contacts_blocked (struct tl_ds_contacts_blocked *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8c1b8fb4 && T->type->name != 0x73e4704b)) { return -1; }
+ eprintf (" contacts.blocked");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" blocked :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x561bc879, .id = "ContactBlocked", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->blocked, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->users, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_contacts_blocked_slice (struct tl_ds_contacts_blocked *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8c1b8fb4 && T->type->name != 0x73e4704b)) { return -1; }
+ eprintf (" contacts.blockedSlice");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" count :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->count, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" blocked :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x561bc879, .id = "ContactBlocked", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->blocked, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->users, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_contacts_contacts_not_modified (struct tl_ds_contacts_contacts *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd8c02560 && T->type->name != 0x273fda9f)) { return -1; }
+ eprintf (" contacts.contactsNotModified");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_contacts_contacts (struct tl_ds_contacts_contacts *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd8c02560 && T->type->name != 0x273fda9f)) { return -1; }
+ eprintf (" contacts.contacts");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" contacts :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf911c994, .id = "Contact", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->contacts, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->users, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_contacts_found (struct tl_ds_contacts_found *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0566000e && T->type->name != 0xfa99fff1)) { return -1; }
+ eprintf (" contacts.found");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" results :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xea879f95, .id = "ContactFound", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->results, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->users, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_contacts_imported_contacts (struct tl_ds_contacts_imported_contacts *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xad524315 && T->type->name != 0x52adbcea)) { return -1; }
+ eprintf (" contacts.importedContacts");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" imported :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xd0028438, .id = "ImportedContact", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->imported, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" retry_contacts :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->retry_contacts, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->users, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_contacts_link (struct tl_ds_contacts_link *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3ace484c && T->type->name != 0xc531b7b3)) { return -1; }
+ eprintf (" contacts.link");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" my_link :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_contact_link (DS->my_link, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" foreign_link :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_contact_link (DS->foreign_link, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_user (DS->user, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_contacts_suggested (struct tl_ds_contacts_suggested *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5649dcc5 && T->type->name != 0xa9b6233a)) { return -1; }
+ eprintf (" contacts.suggested");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" results :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3de191a1, .id = "ContactSuggested", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->results, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->users, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_geochats_located (struct tl_ds_geochats_located *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x48feb267 && T->type->name != 0xb7014d98)) { return -1; }
+ eprintf (" geochats.located");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" results :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3631cf4c, .id = "ChatLocated", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->results, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" messages :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->messages, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chats :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->chats, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->users, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_geochats_messages (struct tl_ds_geochats_messages *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6d0a0e59 && T->type->name != 0x92f5f1a6)) { return -1; }
+ eprintf (" geochats.messages");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" messages :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->messages, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chats :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->chats, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->users, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_geochats_messages_slice (struct tl_ds_geochats_messages *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6d0a0e59 && T->type->name != 0x92f5f1a6)) { return -1; }
+ eprintf (" geochats.messagesSlice");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" count :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->count, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" messages :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->messages, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chats :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->chats, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->users, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_geochats_stated_message (struct tl_ds_geochats_stated_message *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17b1578b && T->type->name != 0xe84ea874)) { return -1; }
+ eprintf (" geochats.statedMessage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" message :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_geo_chat_message (DS->message, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chats :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->chats, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->users, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" seq :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->seq, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_help_app_update (struct tl_ds_help_app_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4ddd9627 && T->type->name != 0xb22269d8)) { return -1; }
+ eprintf (" help.appUpdate");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" critical :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bool (DS->critical, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" url :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->url, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" text :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->text, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_help_no_app_update (struct tl_ds_help_app_update *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4ddd9627 && T->type->name != 0xb22269d8)) { return -1; }
+ eprintf (" help.noAppUpdate");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_help_invite_text (struct tl_ds_help_invite_text *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x18cb9f78 && T->type->name != 0xe7346087)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->message, field1);
+ return 0;
+}
+int print_ds_constructor_help_support (struct tl_ds_help_support *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17c6b5f6 && T->type->name != 0xe8394a09)) { return -1; }
+ eprintf (" help.support");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" phone_number :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->phone_number, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" user :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_user (DS->user, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_messages_affected_history (struct tl_ds_messages_affected_history *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb45c69d1 && T->type->name != 0x4ba3962e)) { return -1; }
+ eprintf (" messages.affectedHistory");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->pts, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts_count :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->pts_count, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" offset :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->offset, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_messages_affected_messages (struct tl_ds_messages_affected_messages *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x84d19185 && T->type->name != 0x7b2e6e7a)) { return -1; }
+ eprintf (" messages.affectedMessages");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->pts, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts_count :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->pts_count, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_messages_all_stickers_not_modified (struct tl_ds_messages_all_stickers *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb485502f && T->type->name != 0x4b7aafd0)) { return -1; }
+ eprintf (" messages.allStickersNotModified");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_messages_all_stickers (struct tl_ds_messages_all_stickers *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb485502f && T->type->name != 0x4b7aafd0)) { return -1; }
+ eprintf (" messages.allStickers");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" hash :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->hash, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" packs :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x12b299d4, .id = "StickerPack", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->packs, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" sets :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa7a43b17, .id = "StickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->sets, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" documents :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->documents, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_messages_chat_full (struct tl_ds_messages_chat_full *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe5d7d19c && T->type->name != 0x1a282e63)) { return -1; }
+ eprintf (" messages.chatFull");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" full_chat :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02a614, .id = "ChatFull", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_chat_full (DS->full_chat, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chats :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->chats, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->users, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_messages_chats (struct tl_ds_messages_chats *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x64ff9fd5 && T->type->name != 0x9b00602a)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->chats, field1);
+ return 0;
+}
+int print_ds_constructor_messages_dh_config_not_modified (struct tl_ds_messages_dh_config *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xecc058e8 && T->type->name != 0x133fa717)) { return -1; }
+ eprintf (" messages.dhConfigNotModified");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" random :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->random, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_messages_dh_config (struct tl_ds_messages_dh_config *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xecc058e8 && T->type->name != 0x133fa717)) { return -1; }
+ eprintf (" messages.dhConfig");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" g :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->g, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" p :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->p, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" version :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->version, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" random :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->random, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_messages_dialogs (struct tl_ds_messages_dialogs *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x645af8b3 && T->type->name != 0x9ba5074c)) { return -1; }
+ eprintf (" messages.dialogs");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dialogs :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc1dd804a, .id = "Dialog", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->dialogs, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" messages :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->messages, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chats :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->chats, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->users, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_messages_dialogs_slice (struct tl_ds_messages_dialogs *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x645af8b3 && T->type->name != 0x9ba5074c)) { return -1; }
+ eprintf (" messages.dialogsSlice");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" count :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->count, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" dialogs :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc1dd804a, .id = "Dialog", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->dialogs, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" messages :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->messages, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chats :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->chats, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->users, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_messages_message_empty (struct tl_ds_messages_message *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3f4e0648 && T->type->name != 0xc0b1f9b7)) { return -1; }
+ eprintf (" messages.messageEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_messages_messages (struct tl_ds_messages_messages *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8735e464 && T->type->name != 0x78ca1b9b)) { return -1; }
+ eprintf (" messages.messages");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" messages :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->messages, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chats :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->chats, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->users, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_messages_messages_slice (struct tl_ds_messages_messages *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8735e464 && T->type->name != 0x78ca1b9b)) { return -1; }
+ eprintf (" messages.messagesSlice");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" count :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->count, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" messages :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->messages, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chats :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->chats, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->users, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_messages_sent_encrypted_message (struct tl_ds_messages_sent_encrypted_message *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc29c7607 && T->type->name != 0x3d6389f8)) { return -1; }
+ eprintf (" messages.sentEncryptedMessage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_messages_sent_encrypted_file (struct tl_ds_messages_sent_encrypted_message *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc29c7607 && T->type->name != 0x3d6389f8)) { return -1; }
+ eprintf (" messages.sentEncryptedFile");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" file :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x886fd032, .id = "EncryptedFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_encrypted_file (DS->file, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_messages_sent_message (struct tl_ds_messages_sent_message *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x799ce190 && T->type->name != 0x86631e6f)) { return -1; }
+ eprintf (" messages.sentMessage");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" media :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_message_media (DS->media, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->pts, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts_count :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->pts_count, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_messages_sent_message_link (struct tl_ds_messages_sent_message *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x799ce190 && T->type->name != 0x86631e6f)) { return -1; }
+ eprintf (" messages.sentMessageLink");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" id :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->id, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" media :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_message_media (DS->media, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->pts, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts_count :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->pts_count, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" links :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3ace484c, .id = "contacts.Link", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->links, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" seq :"); }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->seq, field7);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_messages_sticker_set (struct tl_ds_messages_sticker_set *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb60a24a6 && T->type->name != 0x49f5db59)) { return -1; }
+ eprintf (" messages.stickerSet");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" set :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa7a43b17, .id = "StickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_sticker_set (DS->set, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" packs :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x12b299d4, .id = "StickerPack", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->packs, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" documents :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->documents, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_messages_stickers_not_modified (struct tl_ds_messages_stickers *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bfa5710 && T->type->name != 0x8405a8ef)) { return -1; }
+ eprintf (" messages.stickersNotModified");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_messages_stickers (struct tl_ds_messages_stickers *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bfa5710 && T->type->name != 0x8405a8ef)) { return -1; }
+ eprintf (" messages.stickers");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" hash :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_string (DS->hash, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" stickers :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->stickers, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_photos_photo (struct tl_ds_photos_photo *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x20212ca8 && T->type->name != 0xdfded357)) { return -1; }
+ eprintf (" photos.photo");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photo :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_photo (DS->photo, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->users, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_photos_photos (struct tl_ds_photos_photos *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x98cf75f1 && T->type->name != 0x67308a0e)) { return -1; }
+ eprintf (" photos.photos");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photos :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->photos, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->users, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_photos_photos_slice (struct tl_ds_photos_photos *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x98cf75f1 && T->type->name != 0x67308a0e)) { return -1; }
+ eprintf (" photos.photosSlice");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" count :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->count, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" photos :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->photos, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->users, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_storage_file_unknown (struct tl_ds_storage_file_type *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ eprintf (" storage.fileUnknown");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_storage_file_jpeg (struct tl_ds_storage_file_type *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ eprintf (" storage.fileJpeg");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_storage_file_gif (struct tl_ds_storage_file_type *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ eprintf (" storage.fileGif");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_storage_file_png (struct tl_ds_storage_file_type *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ eprintf (" storage.filePng");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_storage_file_pdf (struct tl_ds_storage_file_type *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ eprintf (" storage.filePdf");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_storage_file_mp3 (struct tl_ds_storage_file_type *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ eprintf (" storage.fileMp3");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_storage_file_mov (struct tl_ds_storage_file_type *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ eprintf (" storage.fileMov");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_storage_file_partial (struct tl_ds_storage_file_type *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ eprintf (" storage.filePartial");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_storage_file_mp4 (struct tl_ds_storage_file_type *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ eprintf (" storage.fileMp4");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_storage_file_webp (struct tl_ds_storage_file_type *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ eprintf (" storage.fileWebp");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_updates_difference_empty (struct tl_ds_updates_difference *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf57a2419 && T->type->name != 0x0a85dbe6)) { return -1; }
+ eprintf (" updates.differenceEmpty");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" seq :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->seq, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_updates_difference (struct tl_ds_updates_difference *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf57a2419 && T->type->name != 0x0a85dbe6)) { return -1; }
+ eprintf (" updates.difference");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_messages :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->new_messages, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_encrypted_messages :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xce6b8a1e, .id = "EncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->new_encrypted_messages, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" other_updates :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->other_updates, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chats :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->chats, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->users, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" state :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa56c2a3e, .id = "updates.State", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_updates_state (DS->state, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_updates_difference_slice (struct tl_ds_updates_difference *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf57a2419 && T->type->name != 0x0a85dbe6)) { return -1; }
+ eprintf (" updates.differenceSlice");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_messages :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->new_messages, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" new_encrypted_messages :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xce6b8a1e, .id = "EncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->new_encrypted_messages, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" other_updates :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->other_updates, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" chats :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->chats, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" users :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ print_ds_type_vector ((void *)DS->users, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" intermediate_state :"); }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa56c2a3e, .id = "updates.State", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_updates_state (DS->intermediate_state, field6);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_updates_state (struct tl_ds_updates_state *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa56c2a3e && T->type->name != 0x5a93d5c1)) { return -1; }
+ eprintf (" updates.state");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" pts :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->pts, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" qts :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->qts, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" date :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->date, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" seq :"); }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->seq, field4);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" unread_count :"); }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->unread_count, field5);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_constructor_upload_file (struct tl_ds_upload_file *DS, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x096a18d5 && T->type->name != 0xf695e72a)) { return -1; }
+ eprintf (" upload.file");
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" type :"); }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3e2838a8, .id = "storage.FileType", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_storage_file_type (DS->type, field1);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" mtime :"); }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_int (DS->mtime, field2);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ if (multiline_output >= 2) { print_offset (); }
+ if (!disable_field_names) { eprintf (" bytes :"); }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ print_ds_type_bare_bytes (DS->bytes, field3);
+ if (multiline_output >= 2) { eprintf ("\n"); }
+ return 0;
+}
+int print_ds_type_account_days_t_t_l (struct tl_ds_account_days_t_t_l *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_account_days_t_t_l (DS, T);
+ return res;
+}
+int print_ds_type_bare_account_days_t_t_l (struct tl_ds_account_days_t_t_l *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_account_days_t_t_l (DS, T);
+ return res;
+}
+int print_ds_type_audio (struct tl_ds_audio *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x586988d8: res = print_ds_constructor_audio_empty (DS, T); break;
+ case 0xc7ac6496: res = print_ds_constructor_audio (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_audio (struct tl_ds_audio *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x586988d8: res = print_ds_constructor_audio_empty (DS, T); break;
+ case 0xc7ac6496: res = print_ds_constructor_audio (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_authorization (struct tl_ds_authorization *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_authorization (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_authorization (struct tl_ds_authorization *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_authorization (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bool (struct tl_ds_bool *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xbc799737: res = print_ds_constructor_bool_false (DS, T); break;
+ case 0x997275b5: res = print_ds_constructor_bool_true (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_bool (struct tl_ds_bool *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xbc799737: res = print_ds_constructor_bool_false (DS, T); break;
+ case 0x997275b5: res = print_ds_constructor_bool_true (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bot_command (struct tl_ds_bot_command *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xc27ac8c7: res = print_ds_constructor_bot_command (DS, T); break;
+ case 0xb79d22ab: res = print_ds_constructor_bot_command_old (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_bot_command (struct tl_ds_bot_command *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xc27ac8c7: res = print_ds_constructor_bot_command (DS, T); break;
+ case 0xb79d22ab: res = print_ds_constructor_bot_command_old (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bot_info (struct tl_ds_bot_info *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xbb2e37ce: res = print_ds_constructor_bot_info_empty (DS, T); break;
+ case 0x09cf585d: res = print_ds_constructor_bot_info (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_bot_info (struct tl_ds_bot_info *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xbb2e37ce: res = print_ds_constructor_bot_info_empty (DS, T); break;
+ case 0x09cf585d: res = print_ds_constructor_bot_info (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bytes (struct tl_ds_string *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_bytes (DS, T);
+ return res;
+}
+int print_ds_type_bare_bytes (struct tl_ds_string *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_bytes (DS, T);
+ return res;
+}
+int print_ds_type_chat (struct tl_ds_chat *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x9ba2d800: res = print_ds_constructor_chat_empty (DS, T); break;
+ case 0x6e9c9bc7: res = print_ds_constructor_chat (DS, T); break;
+ case 0xfb0ccc41: res = print_ds_constructor_chat_forbidden (DS, T); break;
+ case 0x75eaea5a: res = print_ds_constructor_geo_chat (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_chat (struct tl_ds_chat *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x9ba2d800: res = print_ds_constructor_chat_empty (DS, T); break;
+ case 0x6e9c9bc7: res = print_ds_constructor_chat (DS, T); break;
+ case 0xfb0ccc41: res = print_ds_constructor_chat_forbidden (DS, T); break;
+ case 0x75eaea5a: res = print_ds_constructor_geo_chat (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_chat_full (struct tl_ds_chat_full *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_chat_full (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_chat_full (struct tl_ds_chat_full *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_chat_full (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_chat_invite (struct tl_ds_chat_invite *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x5a686d7c: res = print_ds_constructor_chat_invite_already (DS, T); break;
+ case 0xce917dcd: res = print_ds_constructor_chat_invite (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_chat_invite (struct tl_ds_chat_invite *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x5a686d7c: res = print_ds_constructor_chat_invite_already (DS, T); break;
+ case 0xce917dcd: res = print_ds_constructor_chat_invite (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_chat_located (struct tl_ds_chat_located *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_chat_located (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_chat_located (struct tl_ds_chat_located *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_chat_located (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_chat_participant (struct tl_ds_chat_participant *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_chat_participant (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_chat_participant (struct tl_ds_chat_participant *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_chat_participant (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_chat_participants (struct tl_ds_chat_participants *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x0fd2bb8a: res = print_ds_constructor_chat_participants_forbidden (DS, T); break;
+ case 0x7841b415: res = print_ds_constructor_chat_participants (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_chat_participants (struct tl_ds_chat_participants *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x0fd2bb8a: res = print_ds_constructor_chat_participants_forbidden (DS, T); break;
+ case 0x7841b415: res = print_ds_constructor_chat_participants (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_chat_photo (struct tl_ds_chat_photo *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x37c1011c: res = print_ds_constructor_chat_photo_empty (DS, T); break;
+ case 0x6153276a: res = print_ds_constructor_chat_photo (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_chat_photo (struct tl_ds_chat_photo *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x37c1011c: res = print_ds_constructor_chat_photo_empty (DS, T); break;
+ case 0x6153276a: res = print_ds_constructor_chat_photo (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_client_d_h_inner_data (struct tl_ds_client_d_h_inner_data *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_client_d_h_inner_data (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_client_d_h_inner_data (struct tl_ds_client_d_h_inner_data *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_client_d_h_inner_data (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_config (struct tl_ds_config *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_config (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_config (struct tl_ds_config *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_config (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_contact (struct tl_ds_contact *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_contact (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_contact (struct tl_ds_contact *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_contact (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_contact_blocked (struct tl_ds_contact_blocked *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_contact_blocked (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_contact_blocked (struct tl_ds_contact_blocked *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_contact_blocked (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_contact_found (struct tl_ds_contact_found *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_contact_found (DS, T);
+ return res;
+}
+int print_ds_type_bare_contact_found (struct tl_ds_contact_found *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_contact_found (DS, T);
+ return res;
+}
+int print_ds_type_contact_link (struct tl_ds_contact_link *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x5f4f9247: res = print_ds_constructor_contact_link_unknown (DS, T); break;
+ case 0xfeedd3ad: res = print_ds_constructor_contact_link_none (DS, T); break;
+ case 0x268f3f59: res = print_ds_constructor_contact_link_has_phone (DS, T); break;
+ case 0xd502c2d0: res = print_ds_constructor_contact_link_contact (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_contact_link (struct tl_ds_contact_link *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x5f4f9247: res = print_ds_constructor_contact_link_unknown (DS, T); break;
+ case 0xfeedd3ad: res = print_ds_constructor_contact_link_none (DS, T); break;
+ case 0x268f3f59: res = print_ds_constructor_contact_link_has_phone (DS, T); break;
+ case 0xd502c2d0: res = print_ds_constructor_contact_link_contact (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_contact_status (struct tl_ds_contact_status *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_contact_status (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_contact_status (struct tl_ds_contact_status *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_contact_status (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_contact_suggested (struct tl_ds_contact_suggested *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_contact_suggested (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_contact_suggested (struct tl_ds_contact_suggested *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_contact_suggested (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_dc_option (struct tl_ds_dc_option *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x2ec2a43c: res = print_ds_constructor_dc_option_l28 (DS, T); break;
+ case 0x05d8c6cc: res = print_ds_constructor_dc_option (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_dc_option (struct tl_ds_dc_option *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x2ec2a43c: res = print_ds_constructor_dc_option_l28 (DS, T); break;
+ case 0x05d8c6cc: res = print_ds_constructor_dc_option (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_decrypted_message (struct tl_ds_decrypted_message *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x204d3878: res = print_ds_constructor_decrypted_message (DS, T); break;
+ case 0x73164160: res = print_ds_constructor_decrypted_message_service (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_decrypted_message (struct tl_ds_decrypted_message *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x204d3878: res = print_ds_constructor_decrypted_message (DS, T); break;
+ case 0x73164160: res = print_ds_constructor_decrypted_message_service (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_decrypted_message_action (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xa1733aec: res = print_ds_constructor_decrypted_message_action_set_message_t_t_l (DS, T); break;
+ case 0x0c4f40be: res = print_ds_constructor_decrypted_message_action_read_messages (DS, T); break;
+ case 0x65614304: res = print_ds_constructor_decrypted_message_action_delete_messages (DS, T); break;
+ case 0x8ac1f475: res = print_ds_constructor_decrypted_message_action_screenshot_messages (DS, T); break;
+ case 0x6719e45c: res = print_ds_constructor_decrypted_message_action_flush_history (DS, T); break;
+ case 0x511110b0: res = print_ds_constructor_decrypted_message_action_resend (DS, T); break;
+ case 0xf3048883: res = print_ds_constructor_decrypted_message_action_notify_layer (DS, T); break;
+ case 0xccb27641: res = print_ds_constructor_decrypted_message_action_typing (DS, T); break;
+ case 0xf3c9611b: res = print_ds_constructor_decrypted_message_action_request_key (DS, T); break;
+ case 0x6fe1735b: res = print_ds_constructor_decrypted_message_action_accept_key (DS, T); break;
+ case 0xdd05ec6b: res = print_ds_constructor_decrypted_message_action_abort_key (DS, T); break;
+ case 0xec2e0b9b: res = print_ds_constructor_decrypted_message_action_commit_key (DS, T); break;
+ case 0xa82fdd63: res = print_ds_constructor_decrypted_message_action_noop (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_decrypted_message_action (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xa1733aec: res = print_ds_constructor_decrypted_message_action_set_message_t_t_l (DS, T); break;
+ case 0x0c4f40be: res = print_ds_constructor_decrypted_message_action_read_messages (DS, T); break;
+ case 0x65614304: res = print_ds_constructor_decrypted_message_action_delete_messages (DS, T); break;
+ case 0x8ac1f475: res = print_ds_constructor_decrypted_message_action_screenshot_messages (DS, T); break;
+ case 0x6719e45c: res = print_ds_constructor_decrypted_message_action_flush_history (DS, T); break;
+ case 0x511110b0: res = print_ds_constructor_decrypted_message_action_resend (DS, T); break;
+ case 0xf3048883: res = print_ds_constructor_decrypted_message_action_notify_layer (DS, T); break;
+ case 0xccb27641: res = print_ds_constructor_decrypted_message_action_typing (DS, T); break;
+ case 0xf3c9611b: res = print_ds_constructor_decrypted_message_action_request_key (DS, T); break;
+ case 0x6fe1735b: res = print_ds_constructor_decrypted_message_action_accept_key (DS, T); break;
+ case 0xdd05ec6b: res = print_ds_constructor_decrypted_message_action_abort_key (DS, T); break;
+ case 0xec2e0b9b: res = print_ds_constructor_decrypted_message_action_commit_key (DS, T); break;
+ case 0xa82fdd63: res = print_ds_constructor_decrypted_message_action_noop (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_decrypted_message_layer (struct tl_ds_decrypted_message_layer *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_decrypted_message_layer (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_decrypted_message_layer (struct tl_ds_decrypted_message_layer *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_decrypted_message_layer (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_decrypted_message_media (struct tl_ds_decrypted_message_media *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x089f5c4a: res = print_ds_constructor_decrypted_message_media_empty (DS, T); break;
+ case 0x32798a8c: res = print_ds_constructor_decrypted_message_media_photo (DS, T); break;
+ case 0x35480a59: res = print_ds_constructor_decrypted_message_media_geo_point (DS, T); break;
+ case 0x588a0a97: res = print_ds_constructor_decrypted_message_media_contact (DS, T); break;
+ case 0xb095434b: res = print_ds_constructor_decrypted_message_media_document (DS, T); break;
+ case 0x524a415d: res = print_ds_constructor_decrypted_message_media_video (DS, T); break;
+ case 0x57e0a9cb: res = print_ds_constructor_decrypted_message_media_audio (DS, T); break;
+ case 0xfa95b0dd: res = print_ds_constructor_decrypted_message_media_external_document (DS, T); break;
+ case 0x4cee6ef3: res = print_ds_constructor_decrypted_message_media_video_l12 (DS, T); break;
+ case 0x6080758f: res = print_ds_constructor_decrypted_message_media_audio_l12 (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_decrypted_message_media (struct tl_ds_decrypted_message_media *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x089f5c4a: res = print_ds_constructor_decrypted_message_media_empty (DS, T); break;
+ case 0x32798a8c: res = print_ds_constructor_decrypted_message_media_photo (DS, T); break;
+ case 0x35480a59: res = print_ds_constructor_decrypted_message_media_geo_point (DS, T); break;
+ case 0x588a0a97: res = print_ds_constructor_decrypted_message_media_contact (DS, T); break;
+ case 0xb095434b: res = print_ds_constructor_decrypted_message_media_document (DS, T); break;
+ case 0x524a415d: res = print_ds_constructor_decrypted_message_media_video (DS, T); break;
+ case 0x57e0a9cb: res = print_ds_constructor_decrypted_message_media_audio (DS, T); break;
+ case 0xfa95b0dd: res = print_ds_constructor_decrypted_message_media_external_document (DS, T); break;
+ case 0x4cee6ef3: res = print_ds_constructor_decrypted_message_media_video_l12 (DS, T); break;
+ case 0x6080758f: res = print_ds_constructor_decrypted_message_media_audio_l12 (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_dialog (struct tl_ds_dialog *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_dialog (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_dialog (struct tl_ds_dialog *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_dialog (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_disabled_feature (struct tl_ds_disabled_feature *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_disabled_feature (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_disabled_feature (struct tl_ds_disabled_feature *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_disabled_feature (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_document (struct tl_ds_document *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x36f8c871: res = print_ds_constructor_document_empty (DS, T); break;
+ case 0xf9a39f4f: res = print_ds_constructor_document (DS, T); break;
+ case 0x9efc6326: res = print_ds_constructor_document_l19 (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_document (struct tl_ds_document *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x36f8c871: res = print_ds_constructor_document_empty (DS, T); break;
+ case 0xf9a39f4f: res = print_ds_constructor_document (DS, T); break;
+ case 0x9efc6326: res = print_ds_constructor_document_l19 (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_document_attribute (struct tl_ds_document_attribute *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x6c37c15c: res = print_ds_constructor_document_attribute_image_size (DS, T); break;
+ case 0x11b58939: res = print_ds_constructor_document_attribute_animated (DS, T); break;
+ case 0x994c9882: res = print_ds_constructor_document_attribute_sticker_l28 (DS, T); break;
+ case 0x3a556302: res = print_ds_constructor_document_attribute_sticker (DS, T); break;
+ case 0x5910cccb: res = print_ds_constructor_document_attribute_video (DS, T); break;
+ case 0x051448e5: res = print_ds_constructor_document_attribute_audio (DS, T); break;
+ case 0x15590068: res = print_ds_constructor_document_attribute_filename (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_document_attribute (struct tl_ds_document_attribute *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x6c37c15c: res = print_ds_constructor_document_attribute_image_size (DS, T); break;
+ case 0x11b58939: res = print_ds_constructor_document_attribute_animated (DS, T); break;
+ case 0x994c9882: res = print_ds_constructor_document_attribute_sticker_l28 (DS, T); break;
+ case 0x3a556302: res = print_ds_constructor_document_attribute_sticker (DS, T); break;
+ case 0x5910cccb: res = print_ds_constructor_document_attribute_video (DS, T); break;
+ case 0x051448e5: res = print_ds_constructor_document_attribute_audio (DS, T); break;
+ case 0x15590068: res = print_ds_constructor_document_attribute_filename (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_double (double *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_double (DS, T);
+ return res;
+}
+int print_ds_type_bare_double (double *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_double (DS, T);
+ return res;
+}
+int print_ds_type_encrypted_chat (struct tl_ds_encrypted_chat *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xab7ec0a0: res = print_ds_constructor_encrypted_chat_empty (DS, T); break;
+ case 0x3bf703dc: res = print_ds_constructor_encrypted_chat_waiting (DS, T); break;
+ case 0xc878527e: res = print_ds_constructor_encrypted_chat_requested (DS, T); break;
+ case 0xfa56ce36: res = print_ds_constructor_encrypted_chat (DS, T); break;
+ case 0x13d6dd27: res = print_ds_constructor_encrypted_chat_discarded (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_encrypted_chat (struct tl_ds_encrypted_chat *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xab7ec0a0: res = print_ds_constructor_encrypted_chat_empty (DS, T); break;
+ case 0x3bf703dc: res = print_ds_constructor_encrypted_chat_waiting (DS, T); break;
+ case 0xc878527e: res = print_ds_constructor_encrypted_chat_requested (DS, T); break;
+ case 0xfa56ce36: res = print_ds_constructor_encrypted_chat (DS, T); break;
+ case 0x13d6dd27: res = print_ds_constructor_encrypted_chat_discarded (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_encrypted_file (struct tl_ds_encrypted_file *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xc21f497e: res = print_ds_constructor_encrypted_file_empty (DS, T); break;
+ case 0x4a70994c: res = print_ds_constructor_encrypted_file (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_encrypted_file (struct tl_ds_encrypted_file *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xc21f497e: res = print_ds_constructor_encrypted_file_empty (DS, T); break;
+ case 0x4a70994c: res = print_ds_constructor_encrypted_file (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_encrypted_message (struct tl_ds_encrypted_message *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xed18c118: res = print_ds_constructor_encrypted_message (DS, T); break;
+ case 0x23734b06: res = print_ds_constructor_encrypted_message_service (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_encrypted_message (struct tl_ds_encrypted_message *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xed18c118: res = print_ds_constructor_encrypted_message (DS, T); break;
+ case 0x23734b06: res = print_ds_constructor_encrypted_message_service (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_error (struct tl_ds_error *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_error (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_error (struct tl_ds_error *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_error (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_exported_chat_invite (struct tl_ds_exported_chat_invite *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x69df3769: res = print_ds_constructor_chat_invite_empty (DS, T); break;
+ case 0xfc2e05bc: res = print_ds_constructor_chat_invite_exported (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_exported_chat_invite (struct tl_ds_exported_chat_invite *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x69df3769: res = print_ds_constructor_chat_invite_empty (DS, T); break;
+ case 0xfc2e05bc: res = print_ds_constructor_chat_invite_exported (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_file_location (struct tl_ds_file_location *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x7c596b46: res = print_ds_constructor_file_location_unavailable (DS, T); break;
+ case 0x53d69076: res = print_ds_constructor_file_location (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_file_location (struct tl_ds_file_location *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x7c596b46: res = print_ds_constructor_file_location_unavailable (DS, T); break;
+ case 0x53d69076: res = print_ds_constructor_file_location (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_geo_chat_message (struct tl_ds_geo_chat_message *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x60311a9b: res = print_ds_constructor_geo_chat_message_empty (DS, T); break;
+ case 0x4505f8e1: res = print_ds_constructor_geo_chat_message (DS, T); break;
+ case 0xd34fa24e: res = print_ds_constructor_geo_chat_message_service (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_geo_chat_message (struct tl_ds_geo_chat_message *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x60311a9b: res = print_ds_constructor_geo_chat_message_empty (DS, T); break;
+ case 0x4505f8e1: res = print_ds_constructor_geo_chat_message (DS, T); break;
+ case 0xd34fa24e: res = print_ds_constructor_geo_chat_message_service (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_geo_point (struct tl_ds_geo_point *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x1117dd5f: res = print_ds_constructor_geo_point_empty (DS, T); break;
+ case 0x2049d70c: res = print_ds_constructor_geo_point (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_geo_point (struct tl_ds_geo_point *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x1117dd5f: res = print_ds_constructor_geo_point_empty (DS, T); break;
+ case 0x2049d70c: res = print_ds_constructor_geo_point (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_imported_contact (struct tl_ds_imported_contact *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_imported_contact (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_imported_contact (struct tl_ds_imported_contact *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_imported_contact (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_input_app_event (struct tl_ds_input_app_event *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_input_app_event (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_input_app_event (struct tl_ds_input_app_event *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_input_app_event (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_input_audio (struct tl_ds_input_audio *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xd95adc84: res = print_ds_constructor_input_audio_empty (DS, T); break;
+ case 0x77d440ff: res = print_ds_constructor_input_audio (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_input_audio (struct tl_ds_input_audio *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xd95adc84: res = print_ds_constructor_input_audio_empty (DS, T); break;
+ case 0x77d440ff: res = print_ds_constructor_input_audio (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_input_chat_photo (struct tl_ds_input_chat_photo *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x1ca48f57: res = print_ds_constructor_input_chat_photo_empty (DS, T); break;
+ case 0x94254732: res = print_ds_constructor_input_chat_uploaded_photo (DS, T); break;
+ case 0xb2e1bf08: res = print_ds_constructor_input_chat_photo (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_input_chat_photo (struct tl_ds_input_chat_photo *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x1ca48f57: res = print_ds_constructor_input_chat_photo_empty (DS, T); break;
+ case 0x94254732: res = print_ds_constructor_input_chat_uploaded_photo (DS, T); break;
+ case 0xb2e1bf08: res = print_ds_constructor_input_chat_photo (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_input_contact (struct tl_ds_input_contact *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_input_phone_contact (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_input_contact (struct tl_ds_input_contact *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_input_phone_contact (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_input_document (struct tl_ds_input_document *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x72f0eaae: res = print_ds_constructor_input_document_empty (DS, T); break;
+ case 0x18798952: res = print_ds_constructor_input_document (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_input_document (struct tl_ds_input_document *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x72f0eaae: res = print_ds_constructor_input_document_empty (DS, T); break;
+ case 0x18798952: res = print_ds_constructor_input_document (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_input_encrypted_chat (struct tl_ds_input_encrypted_chat *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_input_encrypted_chat (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_input_encrypted_chat (struct tl_ds_input_encrypted_chat *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_input_encrypted_chat (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_input_encrypted_file (struct tl_ds_input_encrypted_file *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x1837c364: res = print_ds_constructor_input_encrypted_file_empty (DS, T); break;
+ case 0x64bd0306: res = print_ds_constructor_input_encrypted_file_uploaded (DS, T); break;
+ case 0x5a17b5e5: res = print_ds_constructor_input_encrypted_file (DS, T); break;
+ case 0x2dc173c8: res = print_ds_constructor_input_encrypted_file_big_uploaded (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_input_encrypted_file (struct tl_ds_input_encrypted_file *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x1837c364: res = print_ds_constructor_input_encrypted_file_empty (DS, T); break;
+ case 0x64bd0306: res = print_ds_constructor_input_encrypted_file_uploaded (DS, T); break;
+ case 0x5a17b5e5: res = print_ds_constructor_input_encrypted_file (DS, T); break;
+ case 0x2dc173c8: res = print_ds_constructor_input_encrypted_file_big_uploaded (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_input_file (struct tl_ds_input_file *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xf52ff27f: res = print_ds_constructor_input_file (DS, T); break;
+ case 0xfa4f0bb5: res = print_ds_constructor_input_file_big (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_input_file (struct tl_ds_input_file *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xf52ff27f: res = print_ds_constructor_input_file (DS, T); break;
+ case 0xfa4f0bb5: res = print_ds_constructor_input_file_big (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_input_file_location (struct tl_ds_input_file_location *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x14637196: res = print_ds_constructor_input_file_location (DS, T); break;
+ case 0x3d0364ec: res = print_ds_constructor_input_video_file_location (DS, T); break;
+ case 0xf5235d55: res = print_ds_constructor_input_encrypted_file_location (DS, T); break;
+ case 0x74dc404d: res = print_ds_constructor_input_audio_file_location (DS, T); break;
+ case 0x4e45abe9: res = print_ds_constructor_input_document_file_location (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_input_file_location (struct tl_ds_input_file_location *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x14637196: res = print_ds_constructor_input_file_location (DS, T); break;
+ case 0x3d0364ec: res = print_ds_constructor_input_video_file_location (DS, T); break;
+ case 0xf5235d55: res = print_ds_constructor_input_encrypted_file_location (DS, T); break;
+ case 0x74dc404d: res = print_ds_constructor_input_audio_file_location (DS, T); break;
+ case 0x4e45abe9: res = print_ds_constructor_input_document_file_location (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_input_geo_chat (struct tl_ds_input_geo_chat *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_input_geo_chat (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_input_geo_chat (struct tl_ds_input_geo_chat *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_input_geo_chat (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_input_geo_point (struct tl_ds_input_geo_point *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xe4c123d6: res = print_ds_constructor_input_geo_point_empty (DS, T); break;
+ case 0xf3b7acc9: res = print_ds_constructor_input_geo_point (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_input_geo_point (struct tl_ds_input_geo_point *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xe4c123d6: res = print_ds_constructor_input_geo_point_empty (DS, T); break;
+ case 0xf3b7acc9: res = print_ds_constructor_input_geo_point (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_input_media (struct tl_ds_input_media *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x9664f57f: res = print_ds_constructor_input_media_empty (DS, T); break;
+ case 0xf7aff1c0: res = print_ds_constructor_input_media_uploaded_photo (DS, T); break;
+ case 0xe9bfb4f3: res = print_ds_constructor_input_media_photo (DS, T); break;
+ case 0xf9c44144: res = print_ds_constructor_input_media_geo_point (DS, T); break;
+ case 0xa6e45987: res = print_ds_constructor_input_media_contact (DS, T); break;
+ case 0xe13fd4bc: res = print_ds_constructor_input_media_uploaded_video (DS, T); break;
+ case 0x96fb97dc: res = print_ds_constructor_input_media_uploaded_thumb_video (DS, T); break;
+ case 0x936a4ebd: res = print_ds_constructor_input_media_video (DS, T); break;
+ case 0x4e498cab: res = print_ds_constructor_input_media_uploaded_audio (DS, T); break;
+ case 0x89938781: res = print_ds_constructor_input_media_audio (DS, T); break;
+ case 0xffe76b78: res = print_ds_constructor_input_media_uploaded_document (DS, T); break;
+ case 0x41481486: res = print_ds_constructor_input_media_uploaded_thumb_document (DS, T); break;
+ case 0xd184e841: res = print_ds_constructor_input_media_document (DS, T); break;
+ case 0x2827a81a: res = print_ds_constructor_input_media_venue (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_input_media (struct tl_ds_input_media *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x9664f57f: res = print_ds_constructor_input_media_empty (DS, T); break;
+ case 0xf7aff1c0: res = print_ds_constructor_input_media_uploaded_photo (DS, T); break;
+ case 0xe9bfb4f3: res = print_ds_constructor_input_media_photo (DS, T); break;
+ case 0xf9c44144: res = print_ds_constructor_input_media_geo_point (DS, T); break;
+ case 0xa6e45987: res = print_ds_constructor_input_media_contact (DS, T); break;
+ case 0xe13fd4bc: res = print_ds_constructor_input_media_uploaded_video (DS, T); break;
+ case 0x96fb97dc: res = print_ds_constructor_input_media_uploaded_thumb_video (DS, T); break;
+ case 0x936a4ebd: res = print_ds_constructor_input_media_video (DS, T); break;
+ case 0x4e498cab: res = print_ds_constructor_input_media_uploaded_audio (DS, T); break;
+ case 0x89938781: res = print_ds_constructor_input_media_audio (DS, T); break;
+ case 0xffe76b78: res = print_ds_constructor_input_media_uploaded_document (DS, T); break;
+ case 0x41481486: res = print_ds_constructor_input_media_uploaded_thumb_document (DS, T); break;
+ case 0xd184e841: res = print_ds_constructor_input_media_document (DS, T); break;
+ case 0x2827a81a: res = print_ds_constructor_input_media_venue (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_input_notify_peer (struct tl_ds_input_notify_peer *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xb8bc5b0c: res = print_ds_constructor_input_notify_peer (DS, T); break;
+ case 0x193b4417: res = print_ds_constructor_input_notify_users (DS, T); break;
+ case 0x4a95e84e: res = print_ds_constructor_input_notify_chats (DS, T); break;
+ case 0xa429b886: res = print_ds_constructor_input_notify_all (DS, T); break;
+ case 0x4d8ddec8: res = print_ds_constructor_input_notify_geo_chat_peer (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_input_notify_peer (struct tl_ds_input_notify_peer *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xb8bc5b0c: res = print_ds_constructor_input_notify_peer (DS, T); break;
+ case 0x193b4417: res = print_ds_constructor_input_notify_users (DS, T); break;
+ case 0x4a95e84e: res = print_ds_constructor_input_notify_chats (DS, T); break;
+ case 0xa429b886: res = print_ds_constructor_input_notify_all (DS, T); break;
+ case 0x4d8ddec8: res = print_ds_constructor_input_notify_geo_chat_peer (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_input_peer (struct tl_ds_input_peer *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x7f3b18ea: res = print_ds_constructor_input_peer_empty (DS, T); break;
+ case 0x7da07ec9: res = print_ds_constructor_input_peer_self (DS, T); break;
+ case 0x1023dbe8: res = print_ds_constructor_input_peer_contact (DS, T); break;
+ case 0x9b447325: res = print_ds_constructor_input_peer_foreign (DS, T); break;
+ case 0x179be863: res = print_ds_constructor_input_peer_chat (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_input_peer (struct tl_ds_input_peer *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x7f3b18ea: res = print_ds_constructor_input_peer_empty (DS, T); break;
+ case 0x7da07ec9: res = print_ds_constructor_input_peer_self (DS, T); break;
+ case 0x1023dbe8: res = print_ds_constructor_input_peer_contact (DS, T); break;
+ case 0x9b447325: res = print_ds_constructor_input_peer_foreign (DS, T); break;
+ case 0x179be863: res = print_ds_constructor_input_peer_chat (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_input_peer_notify_events (struct tl_ds_input_peer_notify_events *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xf03064d8: res = print_ds_constructor_input_peer_notify_events_empty (DS, T); break;
+ case 0xe86a2c74: res = print_ds_constructor_input_peer_notify_events_all (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_input_peer_notify_events (struct tl_ds_input_peer_notify_events *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xf03064d8: res = print_ds_constructor_input_peer_notify_events_empty (DS, T); break;
+ case 0xe86a2c74: res = print_ds_constructor_input_peer_notify_events_all (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_input_peer_notify_settings (struct tl_ds_input_peer_notify_settings *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_input_peer_notify_settings (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_input_peer_notify_settings (struct tl_ds_input_peer_notify_settings *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_input_peer_notify_settings (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_input_photo (struct tl_ds_input_photo *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x1cd7bf0d: res = print_ds_constructor_input_photo_empty (DS, T); break;
+ case 0xfb95c6c4: res = print_ds_constructor_input_photo (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_input_photo (struct tl_ds_input_photo *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x1cd7bf0d: res = print_ds_constructor_input_photo_empty (DS, T); break;
+ case 0xfb95c6c4: res = print_ds_constructor_input_photo (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_input_photo_crop (struct tl_ds_input_photo_crop *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xade6b004: res = print_ds_constructor_input_photo_crop_auto (DS, T); break;
+ case 0xd9915325: res = print_ds_constructor_input_photo_crop (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_input_photo_crop (struct tl_ds_input_photo_crop *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xade6b004: res = print_ds_constructor_input_photo_crop_auto (DS, T); break;
+ case 0xd9915325: res = print_ds_constructor_input_photo_crop (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_input_privacy_key (struct tl_ds_input_privacy_key *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_input_privacy_key_status_timestamp (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_input_privacy_key (struct tl_ds_input_privacy_key *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_input_privacy_key_status_timestamp (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_input_privacy_rule (struct tl_ds_input_privacy_rule *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x0d09e07b: res = print_ds_constructor_input_privacy_value_allow_contacts (DS, T); break;
+ case 0x184b35ce: res = print_ds_constructor_input_privacy_value_allow_all (DS, T); break;
+ case 0x131cc67f: res = print_ds_constructor_input_privacy_value_allow_users (DS, T); break;
+ case 0x0ba52007: res = print_ds_constructor_input_privacy_value_disallow_contacts (DS, T); break;
+ case 0xd66b66c9: res = print_ds_constructor_input_privacy_value_disallow_all (DS, T); break;
+ case 0x90110467: res = print_ds_constructor_input_privacy_value_disallow_users (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_input_privacy_rule (struct tl_ds_input_privacy_rule *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x0d09e07b: res = print_ds_constructor_input_privacy_value_allow_contacts (DS, T); break;
+ case 0x184b35ce: res = print_ds_constructor_input_privacy_value_allow_all (DS, T); break;
+ case 0x131cc67f: res = print_ds_constructor_input_privacy_value_allow_users (DS, T); break;
+ case 0x0ba52007: res = print_ds_constructor_input_privacy_value_disallow_contacts (DS, T); break;
+ case 0xd66b66c9: res = print_ds_constructor_input_privacy_value_disallow_all (DS, T); break;
+ case 0x90110467: res = print_ds_constructor_input_privacy_value_disallow_users (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_input_sticker_set (struct tl_ds_input_sticker_set *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xffb62b95: res = print_ds_constructor_input_sticker_set_empty (DS, T); break;
+ case 0x9de7a269: res = print_ds_constructor_input_sticker_set_i_d (DS, T); break;
+ case 0x861cc8a0: res = print_ds_constructor_input_sticker_set_short_name (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_input_sticker_set (struct tl_ds_input_sticker_set *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xffb62b95: res = print_ds_constructor_input_sticker_set_empty (DS, T); break;
+ case 0x9de7a269: res = print_ds_constructor_input_sticker_set_i_d (DS, T); break;
+ case 0x861cc8a0: res = print_ds_constructor_input_sticker_set_short_name (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_input_user (struct tl_ds_input_user *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xb98886cf: res = print_ds_constructor_input_user_empty (DS, T); break;
+ case 0xf7c1b13f: res = print_ds_constructor_input_user_self (DS, T); break;
+ case 0x86e94f65: res = print_ds_constructor_input_user_contact (DS, T); break;
+ case 0x655e74ff: res = print_ds_constructor_input_user_foreign (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_input_user (struct tl_ds_input_user *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xb98886cf: res = print_ds_constructor_input_user_empty (DS, T); break;
+ case 0xf7c1b13f: res = print_ds_constructor_input_user_self (DS, T); break;
+ case 0x86e94f65: res = print_ds_constructor_input_user_contact (DS, T); break;
+ case 0x655e74ff: res = print_ds_constructor_input_user_foreign (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_input_video (struct tl_ds_input_video *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x5508ec75: res = print_ds_constructor_input_video_empty (DS, T); break;
+ case 0xee579652: res = print_ds_constructor_input_video (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_input_video (struct tl_ds_input_video *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x5508ec75: res = print_ds_constructor_input_video_empty (DS, T); break;
+ case 0xee579652: res = print_ds_constructor_input_video (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_int (int *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_int (DS, T);
+ return res;
+}
+int print_ds_type_bare_int (int *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_int (DS, T);
+ return res;
+}
+int print_ds_type_int128 (struct tl_ds_int128 *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_int128 (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_int128 (struct tl_ds_int128 *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_int128 (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_int256 (struct tl_ds_int256 *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_int256 (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_int256 (struct tl_ds_int256 *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_int256 (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_keyboard_button (struct tl_ds_keyboard_button *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_keyboard_button (DS, T);
+ return res;
+}
+int print_ds_type_bare_keyboard_button (struct tl_ds_keyboard_button *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_keyboard_button (DS, T);
+ return res;
+}
+int print_ds_type_keyboard_button_row (struct tl_ds_keyboard_button_row *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_keyboard_button_row (DS, T);
+ return res;
+}
+int print_ds_type_bare_keyboard_button_row (struct tl_ds_keyboard_button_row *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_keyboard_button_row (DS, T);
+ return res;
+}
+int print_ds_type_long (long long *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_long (DS, T);
+ return res;
+}
+int print_ds_type_bare_long (long long *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_long (DS, T);
+ return res;
+}
+int print_ds_type_message (struct tl_ds_message *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x83e5de54: res = print_ds_constructor_message_empty (DS, T); break;
+ case 0xc3060325: res = print_ds_constructor_message (DS, T); break;
+ case 0x1d86f70e: res = print_ds_constructor_message_service (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_message (struct tl_ds_message *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x83e5de54: res = print_ds_constructor_message_empty (DS, T); break;
+ case 0xc3060325: res = print_ds_constructor_message (DS, T); break;
+ case 0x1d86f70e: res = print_ds_constructor_message_service (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_message_action (struct tl_ds_message_action *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xb6aef7b0: res = print_ds_constructor_message_action_empty (DS, T); break;
+ case 0xa6638b9a: res = print_ds_constructor_message_action_chat_create (DS, T); break;
+ case 0xb5a1ce5a: res = print_ds_constructor_message_action_chat_edit_title (DS, T); break;
+ case 0x7fcb13a8: res = print_ds_constructor_message_action_chat_edit_photo (DS, T); break;
+ case 0x95e3fbef: res = print_ds_constructor_message_action_chat_delete_photo (DS, T); break;
+ case 0x5e3cfc4b: res = print_ds_constructor_message_action_chat_add_user (DS, T); break;
+ case 0xb2ae9b0c: res = print_ds_constructor_message_action_chat_delete_user (DS, T); break;
+ case 0x6f038ebc: res = print_ds_constructor_message_action_geo_chat_create (DS, T); break;
+ case 0x0c7d53de: res = print_ds_constructor_message_action_geo_chat_checkin (DS, T); break;
+ case 0xf89cf5e8: res = print_ds_constructor_message_action_chat_joined_by_link (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_message_action (struct tl_ds_message_action *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xb6aef7b0: res = print_ds_constructor_message_action_empty (DS, T); break;
+ case 0xa6638b9a: res = print_ds_constructor_message_action_chat_create (DS, T); break;
+ case 0xb5a1ce5a: res = print_ds_constructor_message_action_chat_edit_title (DS, T); break;
+ case 0x7fcb13a8: res = print_ds_constructor_message_action_chat_edit_photo (DS, T); break;
+ case 0x95e3fbef: res = print_ds_constructor_message_action_chat_delete_photo (DS, T); break;
+ case 0x5e3cfc4b: res = print_ds_constructor_message_action_chat_add_user (DS, T); break;
+ case 0xb2ae9b0c: res = print_ds_constructor_message_action_chat_delete_user (DS, T); break;
+ case 0x6f038ebc: res = print_ds_constructor_message_action_geo_chat_create (DS, T); break;
+ case 0x0c7d53de: res = print_ds_constructor_message_action_geo_chat_checkin (DS, T); break;
+ case 0xf89cf5e8: res = print_ds_constructor_message_action_chat_joined_by_link (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_message_media (struct tl_ds_message_media *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x3ded6320: res = print_ds_constructor_message_media_empty (DS, T); break;
+ case 0x3d8ce53d: res = print_ds_constructor_message_media_photo (DS, T); break;
+ case 0x5bcf1675: res = print_ds_constructor_message_media_video (DS, T); break;
+ case 0x56e0d474: res = print_ds_constructor_message_media_geo (DS, T); break;
+ case 0x5e7d2f39: res = print_ds_constructor_message_media_contact (DS, T); break;
+ case 0x9f84f49e: res = print_ds_constructor_message_media_unsupported (DS, T); break;
+ case 0x2fda2204: res = print_ds_constructor_message_media_document (DS, T); break;
+ case 0xc6b68300: res = print_ds_constructor_message_media_audio (DS, T); break;
+ case 0xa32dd600: res = print_ds_constructor_message_media_web_page (DS, T); break;
+ case 0x7912b71f: res = print_ds_constructor_message_media_venue (DS, T); break;
+ case 0xc8c45a2a: res = print_ds_constructor_message_media_photo_l27 (DS, T); break;
+ case 0xa2d24290: res = print_ds_constructor_message_media_video_l27 (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_message_media (struct tl_ds_message_media *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x3ded6320: res = print_ds_constructor_message_media_empty (DS, T); break;
+ case 0x3d8ce53d: res = print_ds_constructor_message_media_photo (DS, T); break;
+ case 0x5bcf1675: res = print_ds_constructor_message_media_video (DS, T); break;
+ case 0x56e0d474: res = print_ds_constructor_message_media_geo (DS, T); break;
+ case 0x5e7d2f39: res = print_ds_constructor_message_media_contact (DS, T); break;
+ case 0x9f84f49e: res = print_ds_constructor_message_media_unsupported (DS, T); break;
+ case 0x2fda2204: res = print_ds_constructor_message_media_document (DS, T); break;
+ case 0xc6b68300: res = print_ds_constructor_message_media_audio (DS, T); break;
+ case 0xa32dd600: res = print_ds_constructor_message_media_web_page (DS, T); break;
+ case 0x7912b71f: res = print_ds_constructor_message_media_venue (DS, T); break;
+ case 0xc8c45a2a: res = print_ds_constructor_message_media_photo_l27 (DS, T); break;
+ case 0xa2d24290: res = print_ds_constructor_message_media_video_l27 (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_messages_filter (struct tl_ds_messages_filter *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x57e2f66c: res = print_ds_constructor_input_messages_filter_empty (DS, T); break;
+ case 0x9609a51c: res = print_ds_constructor_input_messages_filter_photos (DS, T); break;
+ case 0x9fc00e65: res = print_ds_constructor_input_messages_filter_video (DS, T); break;
+ case 0x56e9f0e4: res = print_ds_constructor_input_messages_filter_photo_video (DS, T); break;
+ case 0xd95e73bb: res = print_ds_constructor_input_messages_filter_photo_video_documents (DS, T); break;
+ case 0x9eddf188: res = print_ds_constructor_input_messages_filter_document (DS, T); break;
+ case 0xcfc87522: res = print_ds_constructor_input_messages_filter_audio (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_messages_filter (struct tl_ds_messages_filter *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x57e2f66c: res = print_ds_constructor_input_messages_filter_empty (DS, T); break;
+ case 0x9609a51c: res = print_ds_constructor_input_messages_filter_photos (DS, T); break;
+ case 0x9fc00e65: res = print_ds_constructor_input_messages_filter_video (DS, T); break;
+ case 0x56e9f0e4: res = print_ds_constructor_input_messages_filter_photo_video (DS, T); break;
+ case 0xd95e73bb: res = print_ds_constructor_input_messages_filter_photo_video_documents (DS, T); break;
+ case 0x9eddf188: res = print_ds_constructor_input_messages_filter_document (DS, T); break;
+ case 0xcfc87522: res = print_ds_constructor_input_messages_filter_audio (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_nearest_dc (struct tl_ds_nearest_dc *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_nearest_dc (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_nearest_dc (struct tl_ds_nearest_dc *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_nearest_dc (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_notify_peer (struct tl_ds_notify_peer *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x9fd40bd8: res = print_ds_constructor_notify_peer (DS, T); break;
+ case 0xb4c83b4c: res = print_ds_constructor_notify_users (DS, T); break;
+ case 0xc007cec3: res = print_ds_constructor_notify_chats (DS, T); break;
+ case 0x74d07c60: res = print_ds_constructor_notify_all (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_notify_peer (struct tl_ds_notify_peer *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x9fd40bd8: res = print_ds_constructor_notify_peer (DS, T); break;
+ case 0xb4c83b4c: res = print_ds_constructor_notify_users (DS, T); break;
+ case 0xc007cec3: res = print_ds_constructor_notify_chats (DS, T); break;
+ case 0x74d07c60: res = print_ds_constructor_notify_all (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_null (struct tl_ds_null *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_null (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_null (struct tl_ds_null *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_null (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_p_q_inner_data (struct tl_ds_p_q_inner_data *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x83c95aec: res = print_ds_constructor_p_q_inner_data (DS, T); break;
+ case 0x3c6a84d4: res = print_ds_constructor_p_q_inner_data_temp (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_p_q_inner_data (struct tl_ds_p_q_inner_data *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x83c95aec: res = print_ds_constructor_p_q_inner_data (DS, T); break;
+ case 0x3c6a84d4: res = print_ds_constructor_p_q_inner_data_temp (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_peer (struct tl_ds_peer *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x9db1bc6d: res = print_ds_constructor_peer_user (DS, T); break;
+ case 0xbad0e5bb: res = print_ds_constructor_peer_chat (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_peer (struct tl_ds_peer *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x9db1bc6d: res = print_ds_constructor_peer_user (DS, T); break;
+ case 0xbad0e5bb: res = print_ds_constructor_peer_chat (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_peer_notify_events (struct tl_ds_peer_notify_events *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xadd53cb3: res = print_ds_constructor_peer_notify_events_empty (DS, T); break;
+ case 0x6d1ded88: res = print_ds_constructor_peer_notify_events_all (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_peer_notify_events (struct tl_ds_peer_notify_events *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xadd53cb3: res = print_ds_constructor_peer_notify_events_empty (DS, T); break;
+ case 0x6d1ded88: res = print_ds_constructor_peer_notify_events_all (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_peer_notify_settings (struct tl_ds_peer_notify_settings *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x70a68512: res = print_ds_constructor_peer_notify_settings_empty (DS, T); break;
+ case 0x8d5e11ee: res = print_ds_constructor_peer_notify_settings (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_peer_notify_settings (struct tl_ds_peer_notify_settings *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x70a68512: res = print_ds_constructor_peer_notify_settings_empty (DS, T); break;
+ case 0x8d5e11ee: res = print_ds_constructor_peer_notify_settings (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_photo (struct tl_ds_photo *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x2331b22d: res = print_ds_constructor_photo_empty (DS, T); break;
+ case 0xc3838076: res = print_ds_constructor_photo (DS, T); break;
+ case 0x22b56751: res = print_ds_constructor_photo_l27 (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_photo (struct tl_ds_photo *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x2331b22d: res = print_ds_constructor_photo_empty (DS, T); break;
+ case 0xc3838076: res = print_ds_constructor_photo (DS, T); break;
+ case 0x22b56751: res = print_ds_constructor_photo_l27 (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_photo_size (struct tl_ds_photo_size *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x0e17e23c: res = print_ds_constructor_photo_size_empty (DS, T); break;
+ case 0x77bfb61b: res = print_ds_constructor_photo_size (DS, T); break;
+ case 0xe9a734fa: res = print_ds_constructor_photo_cached_size (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_photo_size (struct tl_ds_photo_size *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x0e17e23c: res = print_ds_constructor_photo_size_empty (DS, T); break;
+ case 0x77bfb61b: res = print_ds_constructor_photo_size (DS, T); break;
+ case 0xe9a734fa: res = print_ds_constructor_photo_cached_size (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_privacy_key (struct tl_ds_privacy_key *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_privacy_key_status_timestamp (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_privacy_key (struct tl_ds_privacy_key *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_privacy_key_status_timestamp (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_privacy_rule (struct tl_ds_privacy_rule *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xfffe1bac: res = print_ds_constructor_privacy_value_allow_contacts (DS, T); break;
+ case 0x65427b82: res = print_ds_constructor_privacy_value_allow_all (DS, T); break;
+ case 0x4d5bbe0c: res = print_ds_constructor_privacy_value_allow_users (DS, T); break;
+ case 0xf888fa1a: res = print_ds_constructor_privacy_value_disallow_contacts (DS, T); break;
+ case 0x8b73e763: res = print_ds_constructor_privacy_value_disallow_all (DS, T); break;
+ case 0x0c7f49b7: res = print_ds_constructor_privacy_value_disallow_users (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_privacy_rule (struct tl_ds_privacy_rule *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xfffe1bac: res = print_ds_constructor_privacy_value_allow_contacts (DS, T); break;
+ case 0x65427b82: res = print_ds_constructor_privacy_value_allow_all (DS, T); break;
+ case 0x4d5bbe0c: res = print_ds_constructor_privacy_value_allow_users (DS, T); break;
+ case 0xf888fa1a: res = print_ds_constructor_privacy_value_disallow_contacts (DS, T); break;
+ case 0x8b73e763: res = print_ds_constructor_privacy_value_disallow_all (DS, T); break;
+ case 0x0c7f49b7: res = print_ds_constructor_privacy_value_disallow_users (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_received_notify_message (struct tl_ds_received_notify_message *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_received_notify_message (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_received_notify_message (struct tl_ds_received_notify_message *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_received_notify_message (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_reply_markup (struct tl_ds_reply_markup *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xa03e5b85: res = print_ds_constructor_reply_keyboard_hide (DS, T); break;
+ case 0xf4108aa0: res = print_ds_constructor_reply_keyboard_force_reply (DS, T); break;
+ case 0x3502758c: res = print_ds_constructor_reply_keyboard_markup (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_reply_markup (struct tl_ds_reply_markup *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xa03e5b85: res = print_ds_constructor_reply_keyboard_hide (DS, T); break;
+ case 0xf4108aa0: res = print_ds_constructor_reply_keyboard_force_reply (DS, T); break;
+ case 0x3502758c: res = print_ds_constructor_reply_keyboard_markup (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_res_p_q (struct tl_ds_res_p_q *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_res_p_q (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_res_p_q (struct tl_ds_res_p_q *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_res_p_q (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_send_message_action (struct tl_ds_send_message_action *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x16bf744e: res = print_ds_constructor_send_message_typing_action (DS, T); break;
+ case 0xfd5ec8f5: res = print_ds_constructor_send_message_cancel_action (DS, T); break;
+ case 0xa187d66f: res = print_ds_constructor_send_message_record_video_action (DS, T); break;
+ case 0x92042ff7: res = print_ds_constructor_send_message_upload_video_action_l27 (DS, T); break;
+ case 0xe9763aec: res = print_ds_constructor_send_message_upload_video_action (DS, T); break;
+ case 0xd52f73f7: res = print_ds_constructor_send_message_record_audio_action (DS, T); break;
+ case 0xe6ac8a6f: res = print_ds_constructor_send_message_upload_audio_action_l27 (DS, T); break;
+ case 0xf351d7ab: res = print_ds_constructor_send_message_upload_audio_action (DS, T); break;
+ case 0xd1d34a26: res = print_ds_constructor_send_message_upload_photo_action (DS, T); break;
+ case 0x8faee98e: res = print_ds_constructor_send_message_upload_document_action_l27 (DS, T); break;
+ case 0xaa0cd9e4: res = print_ds_constructor_send_message_upload_document_action (DS, T); break;
+ case 0x176f8ba1: res = print_ds_constructor_send_message_geo_location_action (DS, T); break;
+ case 0x628cbc6f: res = print_ds_constructor_send_message_choose_contact_action (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_send_message_action (struct tl_ds_send_message_action *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x16bf744e: res = print_ds_constructor_send_message_typing_action (DS, T); break;
+ case 0xfd5ec8f5: res = print_ds_constructor_send_message_cancel_action (DS, T); break;
+ case 0xa187d66f: res = print_ds_constructor_send_message_record_video_action (DS, T); break;
+ case 0x92042ff7: res = print_ds_constructor_send_message_upload_video_action_l27 (DS, T); break;
+ case 0xe9763aec: res = print_ds_constructor_send_message_upload_video_action (DS, T); break;
+ case 0xd52f73f7: res = print_ds_constructor_send_message_record_audio_action (DS, T); break;
+ case 0xe6ac8a6f: res = print_ds_constructor_send_message_upload_audio_action_l27 (DS, T); break;
+ case 0xf351d7ab: res = print_ds_constructor_send_message_upload_audio_action (DS, T); break;
+ case 0xd1d34a26: res = print_ds_constructor_send_message_upload_photo_action (DS, T); break;
+ case 0x8faee98e: res = print_ds_constructor_send_message_upload_document_action_l27 (DS, T); break;
+ case 0xaa0cd9e4: res = print_ds_constructor_send_message_upload_document_action (DS, T); break;
+ case 0x176f8ba1: res = print_ds_constructor_send_message_geo_location_action (DS, T); break;
+ case 0x628cbc6f: res = print_ds_constructor_send_message_choose_contact_action (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_server_d_h_params (struct tl_ds_server_d_h_params *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x79cb045d: res = print_ds_constructor_server_d_h_params_fail (DS, T); break;
+ case 0xd0e8075c: res = print_ds_constructor_server_d_h_params_ok (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_server_d_h_params (struct tl_ds_server_d_h_params *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x79cb045d: res = print_ds_constructor_server_d_h_params_fail (DS, T); break;
+ case 0xd0e8075c: res = print_ds_constructor_server_d_h_params_ok (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_server_d_h_inner_data (struct tl_ds_server_d_h_inner_data *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_server_d_h_inner_data (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_server_d_h_inner_data (struct tl_ds_server_d_h_inner_data *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_server_d_h_inner_data (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_set_client_d_h_params_answer (struct tl_ds_set_client_d_h_params_answer *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x3bcbf734: res = print_ds_constructor_dh_gen_ok (DS, T); break;
+ case 0x46dc1fb9: res = print_ds_constructor_dh_gen_retry (DS, T); break;
+ case 0xa69dae02: res = print_ds_constructor_dh_gen_fail (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_set_client_d_h_params_answer (struct tl_ds_set_client_d_h_params_answer *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x3bcbf734: res = print_ds_constructor_dh_gen_ok (DS, T); break;
+ case 0x46dc1fb9: res = print_ds_constructor_dh_gen_retry (DS, T); break;
+ case 0xa69dae02: res = print_ds_constructor_dh_gen_fail (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_sticker_pack (struct tl_ds_sticker_pack *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_sticker_pack (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_sticker_pack (struct tl_ds_sticker_pack *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_sticker_pack (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_sticker_set (struct tl_ds_sticker_set *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_sticker_set (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_sticker_set (struct tl_ds_sticker_set *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_sticker_set (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_string (struct tl_ds_string *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_string (DS, T);
+ return res;
+}
+int print_ds_type_bare_string (struct tl_ds_string *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_string (DS, T);
+ return res;
+}
+int print_ds_type_update (struct tl_ds_update *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x1f2b0afd: res = print_ds_constructor_update_new_message (DS, T); break;
+ case 0x4e90bfd6: res = print_ds_constructor_update_message_i_d (DS, T); break;
+ case 0xa20db0e5: res = print_ds_constructor_update_delete_messages (DS, T); break;
+ case 0x5c486927: res = print_ds_constructor_update_user_typing (DS, T); break;
+ case 0x9a65ea1f: res = print_ds_constructor_update_chat_user_typing (DS, T); break;
+ case 0x07761198: res = print_ds_constructor_update_chat_participants (DS, T); break;
+ case 0x1bfbd823: res = print_ds_constructor_update_user_status (DS, T); break;
+ case 0xa7332b73: res = print_ds_constructor_update_user_name (DS, T); break;
+ case 0x95313b0c: res = print_ds_constructor_update_user_photo (DS, T); break;
+ case 0x2575bbb9: res = print_ds_constructor_update_contact_registered (DS, T); break;
+ case 0x9d2e67c5: res = print_ds_constructor_update_contact_link (DS, T); break;
+ case 0x8f06529a: res = print_ds_constructor_update_new_authorization (DS, T); break;
+ case 0x5a68e3f7: res = print_ds_constructor_update_new_geo_chat_message (DS, T); break;
+ case 0x12bcbd9a: res = print_ds_constructor_update_new_encrypted_message (DS, T); break;
+ case 0x1710f156: res = print_ds_constructor_update_encrypted_chat_typing (DS, T); break;
+ case 0xb4a2e88d: res = print_ds_constructor_update_encryption (DS, T); break;
+ case 0x38fe25b7: res = print_ds_constructor_update_encrypted_messages_read (DS, T); break;
+ case 0x3a0eeb22: res = print_ds_constructor_update_chat_participant_add (DS, T); break;
+ case 0x6e5f8c22: res = print_ds_constructor_update_chat_participant_delete (DS, T); break;
+ case 0x8e5e9873: res = print_ds_constructor_update_dc_options (DS, T); break;
+ case 0x80ece81a: res = print_ds_constructor_update_user_blocked (DS, T); break;
+ case 0xbec268ef: res = print_ds_constructor_update_notify_settings (DS, T); break;
+ case 0x382dd3e4: res = print_ds_constructor_update_service_notification (DS, T); break;
+ case 0xee3b272a: res = print_ds_constructor_update_privacy (DS, T); break;
+ case 0x12b9417b: res = print_ds_constructor_update_user_phone (DS, T); break;
+ case 0x9961fd5c: res = print_ds_constructor_update_read_history_inbox (DS, T); break;
+ case 0x2f2f21bf: res = print_ds_constructor_update_read_history_outbox (DS, T); break;
+ case 0x2cc36971: res = print_ds_constructor_update_web_page (DS, T); break;
+ case 0x68c13933: res = print_ds_constructor_update_read_messages_contents (DS, T); break;
+ case 0x03114739: res = print_ds_constructor_update_msg_update (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_update (struct tl_ds_update *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x1f2b0afd: res = print_ds_constructor_update_new_message (DS, T); break;
+ case 0x4e90bfd6: res = print_ds_constructor_update_message_i_d (DS, T); break;
+ case 0xa20db0e5: res = print_ds_constructor_update_delete_messages (DS, T); break;
+ case 0x5c486927: res = print_ds_constructor_update_user_typing (DS, T); break;
+ case 0x9a65ea1f: res = print_ds_constructor_update_chat_user_typing (DS, T); break;
+ case 0x07761198: res = print_ds_constructor_update_chat_participants (DS, T); break;
+ case 0x1bfbd823: res = print_ds_constructor_update_user_status (DS, T); break;
+ case 0xa7332b73: res = print_ds_constructor_update_user_name (DS, T); break;
+ case 0x95313b0c: res = print_ds_constructor_update_user_photo (DS, T); break;
+ case 0x2575bbb9: res = print_ds_constructor_update_contact_registered (DS, T); break;
+ case 0x9d2e67c5: res = print_ds_constructor_update_contact_link (DS, T); break;
+ case 0x8f06529a: res = print_ds_constructor_update_new_authorization (DS, T); break;
+ case 0x5a68e3f7: res = print_ds_constructor_update_new_geo_chat_message (DS, T); break;
+ case 0x12bcbd9a: res = print_ds_constructor_update_new_encrypted_message (DS, T); break;
+ case 0x1710f156: res = print_ds_constructor_update_encrypted_chat_typing (DS, T); break;
+ case 0xb4a2e88d: res = print_ds_constructor_update_encryption (DS, T); break;
+ case 0x38fe25b7: res = print_ds_constructor_update_encrypted_messages_read (DS, T); break;
+ case 0x3a0eeb22: res = print_ds_constructor_update_chat_participant_add (DS, T); break;
+ case 0x6e5f8c22: res = print_ds_constructor_update_chat_participant_delete (DS, T); break;
+ case 0x8e5e9873: res = print_ds_constructor_update_dc_options (DS, T); break;
+ case 0x80ece81a: res = print_ds_constructor_update_user_blocked (DS, T); break;
+ case 0xbec268ef: res = print_ds_constructor_update_notify_settings (DS, T); break;
+ case 0x382dd3e4: res = print_ds_constructor_update_service_notification (DS, T); break;
+ case 0xee3b272a: res = print_ds_constructor_update_privacy (DS, T); break;
+ case 0x12b9417b: res = print_ds_constructor_update_user_phone (DS, T); break;
+ case 0x9961fd5c: res = print_ds_constructor_update_read_history_inbox (DS, T); break;
+ case 0x2f2f21bf: res = print_ds_constructor_update_read_history_outbox (DS, T); break;
+ case 0x2cc36971: res = print_ds_constructor_update_web_page (DS, T); break;
+ case 0x68c13933: res = print_ds_constructor_update_read_messages_contents (DS, T); break;
+ case 0x03114739: res = print_ds_constructor_update_msg_update (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_updates (struct tl_ds_updates *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xe317af7e: res = print_ds_constructor_updates_too_long (DS, T); break;
+ case 0xed5c2127: res = print_ds_constructor_update_short_message (DS, T); break;
+ case 0x52238b3c: res = print_ds_constructor_update_short_chat_message (DS, T); break;
+ case 0x78d4dec1: res = print_ds_constructor_update_short (DS, T); break;
+ case 0x725b04c3: res = print_ds_constructor_updates_combined (DS, T); break;
+ case 0x74ae4240: res = print_ds_constructor_updates (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_updates (struct tl_ds_updates *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xe317af7e: res = print_ds_constructor_updates_too_long (DS, T); break;
+ case 0xed5c2127: res = print_ds_constructor_update_short_message (DS, T); break;
+ case 0x52238b3c: res = print_ds_constructor_update_short_chat_message (DS, T); break;
+ case 0x78d4dec1: res = print_ds_constructor_update_short (DS, T); break;
+ case 0x725b04c3: res = print_ds_constructor_updates_combined (DS, T); break;
+ case 0x74ae4240: res = print_ds_constructor_updates (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_user (struct tl_ds_user *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x200250ba: res = print_ds_constructor_user_empty (DS, T); break;
+ case 0x22e49072: res = print_ds_constructor_user (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_user (struct tl_ds_user *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x200250ba: res = print_ds_constructor_user_empty (DS, T); break;
+ case 0x22e49072: res = print_ds_constructor_user (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_user_full (struct tl_ds_user_full *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_user_full (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_user_full (struct tl_ds_user_full *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_user_full (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_user_profile_photo (struct tl_ds_user_profile_photo *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x4f11bae1: res = print_ds_constructor_user_profile_photo_empty (DS, T); break;
+ case 0xd559d8c8: res = print_ds_constructor_user_profile_photo (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_user_profile_photo (struct tl_ds_user_profile_photo *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x4f11bae1: res = print_ds_constructor_user_profile_photo_empty (DS, T); break;
+ case 0xd559d8c8: res = print_ds_constructor_user_profile_photo (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_user_status (struct tl_ds_user_status *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x09d05049: res = print_ds_constructor_user_status_empty (DS, T); break;
+ case 0xedb93949: res = print_ds_constructor_user_status_online (DS, T); break;
+ case 0x008c703f: res = print_ds_constructor_user_status_offline (DS, T); break;
+ case 0xe26f42f1: res = print_ds_constructor_user_status_recently (DS, T); break;
+ case 0x07bf09fc: res = print_ds_constructor_user_status_last_week (DS, T); break;
+ case 0x77ebc742: res = print_ds_constructor_user_status_last_month (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_user_status (struct tl_ds_user_status *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x09d05049: res = print_ds_constructor_user_status_empty (DS, T); break;
+ case 0xedb93949: res = print_ds_constructor_user_status_online (DS, T); break;
+ case 0x008c703f: res = print_ds_constructor_user_status_offline (DS, T); break;
+ case 0xe26f42f1: res = print_ds_constructor_user_status_recently (DS, T); break;
+ case 0x07bf09fc: res = print_ds_constructor_user_status_last_week (DS, T); break;
+ case 0x77ebc742: res = print_ds_constructor_user_status_last_month (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_vector (struct tl_ds_vector *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_vector (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_vector (struct tl_ds_vector *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_vector (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_video (struct tl_ds_video *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xc10658a8: res = print_ds_constructor_video_empty (DS, T); break;
+ case 0xee9f4a4d: res = print_ds_constructor_video (DS, T); break;
+ case 0x388fa391: res = print_ds_constructor_video_l27 (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_video (struct tl_ds_video *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xc10658a8: res = print_ds_constructor_video_empty (DS, T); break;
+ case 0xee9f4a4d: res = print_ds_constructor_video (DS, T); break;
+ case 0x388fa391: res = print_ds_constructor_video_l27 (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_wall_paper (struct tl_ds_wall_paper *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xccb03657: res = print_ds_constructor_wall_paper (DS, T); break;
+ case 0x63117f24: res = print_ds_constructor_wall_paper_solid (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_wall_paper (struct tl_ds_wall_paper *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xccb03657: res = print_ds_constructor_wall_paper (DS, T); break;
+ case 0x63117f24: res = print_ds_constructor_wall_paper_solid (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_web_page (struct tl_ds_web_page *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xeb1477e8: res = print_ds_constructor_web_page_empty (DS, T); break;
+ case 0xc586da1c: res = print_ds_constructor_web_page_pending (DS, T); break;
+ case 0xa31ea0b5: res = print_ds_constructor_web_page (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_web_page (struct tl_ds_web_page *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xeb1477e8: res = print_ds_constructor_web_page_empty (DS, T); break;
+ case 0xc586da1c: res = print_ds_constructor_web_page_pending (DS, T); break;
+ case 0xa31ea0b5: res = print_ds_constructor_web_page (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_account_authorizations (struct tl_ds_account_authorizations *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_account_authorizations (DS, T);
+ return res;
+}
+int print_ds_type_bare_account_authorizations (struct tl_ds_account_authorizations *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_account_authorizations (DS, T);
+ return res;
+}
+int print_ds_type_account_password (struct tl_ds_account_password *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x96dabc18: res = print_ds_constructor_account_no_password (DS, T); break;
+ case 0x7c18141c: res = print_ds_constructor_account_password (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_account_password (struct tl_ds_account_password *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x96dabc18: res = print_ds_constructor_account_no_password (DS, T); break;
+ case 0x7c18141c: res = print_ds_constructor_account_password (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_account_password_input_settings (struct tl_ds_account_password_input_settings *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_account_password_input_settings (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_account_password_input_settings (struct tl_ds_account_password_input_settings *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_account_password_input_settings (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_account_password_settings (struct tl_ds_account_password_settings *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_account_password_settings (DS, T);
+ return res;
+}
+int print_ds_type_bare_account_password_settings (struct tl_ds_account_password_settings *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_account_password_settings (DS, T);
+ return res;
+}
+int print_ds_type_account_privacy_rules (struct tl_ds_account_privacy_rules *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_account_privacy_rules (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_account_privacy_rules (struct tl_ds_account_privacy_rules *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_account_privacy_rules (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_account_sent_change_phone_code (struct tl_ds_account_sent_change_phone_code *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_account_sent_change_phone_code (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_account_sent_change_phone_code (struct tl_ds_account_sent_change_phone_code *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_account_sent_change_phone_code (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_auth_authorization (struct tl_ds_auth_authorization *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_auth_authorization (DS, T);
+ return res;
+}
+int print_ds_type_bare_auth_authorization (struct tl_ds_auth_authorization *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_auth_authorization (DS, T);
+ return res;
+}
+int print_ds_type_auth_checked_phone (struct tl_ds_auth_checked_phone *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_auth_checked_phone (DS, T);
+ return res;
+}
+int print_ds_type_bare_auth_checked_phone (struct tl_ds_auth_checked_phone *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_auth_checked_phone (DS, T);
+ return res;
+}
+int print_ds_type_auth_exported_authorization (struct tl_ds_auth_exported_authorization *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_auth_exported_authorization (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_auth_exported_authorization (struct tl_ds_auth_exported_authorization *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_auth_exported_authorization (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_auth_password_recovery (struct tl_ds_auth_password_recovery *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_auth_password_recovery (DS, T);
+ return res;
+}
+int print_ds_type_bare_auth_password_recovery (struct tl_ds_auth_password_recovery *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_auth_password_recovery (DS, T);
+ return res;
+}
+int print_ds_type_auth_sent_code (struct tl_ds_auth_sent_code *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xefed51d9: res = print_ds_constructor_auth_sent_code (DS, T); break;
+ case 0xe325edcf: res = print_ds_constructor_auth_sent_app_code (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_auth_sent_code (struct tl_ds_auth_sent_code *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xefed51d9: res = print_ds_constructor_auth_sent_code (DS, T); break;
+ case 0xe325edcf: res = print_ds_constructor_auth_sent_app_code (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_binlog_encr_key (struct tl_ds_binlog_encr_key *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_binlog_encr_key (DS, T);
+ return res;
+}
+int print_ds_type_bare_binlog_encr_key (struct tl_ds_binlog_encr_key *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_binlog_encr_key (DS, T);
+ return res;
+}
+int print_ds_type_binlog_update (struct tl_ds_binlog_update *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x3b06de69: res = print_ds_constructor_binlog_start (DS, T); break;
+ case 0xf96feb32: res = print_ds_constructor_binlog_dc_option (DS, T); break;
+ case 0x7c0d22d8: res = print_ds_constructor_binlog_dc_option_new (DS, T); break;
+ case 0x71e8c156: res = print_ds_constructor_binlog_auth_key (DS, T); break;
+ case 0x9e83dbdc: res = print_ds_constructor_binlog_default_dc (DS, T); break;
+ case 0x26451bb5: res = print_ds_constructor_binlog_dc_signed (DS, T); break;
+ case 0x68a870e8: res = print_ds_constructor_binlog_our_id (DS, T); break;
+ case 0xeaeb7826: res = print_ds_constructor_binlog_set_dh_params (DS, T); break;
+ case 0x2ca8c939: res = print_ds_constructor_binlog_set_pts (DS, T); break;
+ case 0xd95738ac: res = print_ds_constructor_binlog_set_qts (DS, T); break;
+ case 0x1d0f4b52: res = print_ds_constructor_binlog_set_date (DS, T); break;
+ case 0x6eeb2989: res = print_ds_constructor_binlog_set_seq (DS, T); break;
+ case 0xee1b38e8: res = print_ds_constructor_binlog_encr_chat_delete (DS, T); break;
+ case 0x84977251: res = print_ds_constructor_binlog_encr_chat_new (DS, T); break;
+ case 0x9d49488d: res = print_ds_constructor_binlog_encr_chat_exchange_new (DS, T); break;
+ case 0xac55d447: res = print_ds_constructor_binlog_user_delete (DS, T); break;
+ case 0x127cf2f9: res = print_ds_constructor_binlog_user_new (DS, T); break;
+ case 0x0a10aa92: res = print_ds_constructor_binlog_chat_new (DS, T); break;
+ case 0x535475ea: res = print_ds_constructor_binlog_chat_add_participant (DS, T); break;
+ case 0x7dd1a1a2: res = print_ds_constructor_binlog_chat_del_participant (DS, T); break;
+ case 0x3c873416: res = print_ds_constructor_binlog_set_msg_id (DS, T); break;
+ case 0x847e77b1: res = print_ds_constructor_binlog_message_delete (DS, T); break;
+ case 0x427cfcdb: res = print_ds_constructor_binlog_message_new (DS, T); break;
+ case 0x6cf7cabc: res = print_ds_constructor_binlog_message_encr_new (DS, T); break;
+ case 0x6dd4d85f: res = print_ds_constructor_binlog_msg_update (DS, T); break;
+ case 0x83327955: res = print_ds_constructor_binlog_reset_authorization (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_binlog_update (struct tl_ds_binlog_update *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x3b06de69: res = print_ds_constructor_binlog_start (DS, T); break;
+ case 0xf96feb32: res = print_ds_constructor_binlog_dc_option (DS, T); break;
+ case 0x7c0d22d8: res = print_ds_constructor_binlog_dc_option_new (DS, T); break;
+ case 0x71e8c156: res = print_ds_constructor_binlog_auth_key (DS, T); break;
+ case 0x9e83dbdc: res = print_ds_constructor_binlog_default_dc (DS, T); break;
+ case 0x26451bb5: res = print_ds_constructor_binlog_dc_signed (DS, T); break;
+ case 0x68a870e8: res = print_ds_constructor_binlog_our_id (DS, T); break;
+ case 0xeaeb7826: res = print_ds_constructor_binlog_set_dh_params (DS, T); break;
+ case 0x2ca8c939: res = print_ds_constructor_binlog_set_pts (DS, T); break;
+ case 0xd95738ac: res = print_ds_constructor_binlog_set_qts (DS, T); break;
+ case 0x1d0f4b52: res = print_ds_constructor_binlog_set_date (DS, T); break;
+ case 0x6eeb2989: res = print_ds_constructor_binlog_set_seq (DS, T); break;
+ case 0xee1b38e8: res = print_ds_constructor_binlog_encr_chat_delete (DS, T); break;
+ case 0x84977251: res = print_ds_constructor_binlog_encr_chat_new (DS, T); break;
+ case 0x9d49488d: res = print_ds_constructor_binlog_encr_chat_exchange_new (DS, T); break;
+ case 0xac55d447: res = print_ds_constructor_binlog_user_delete (DS, T); break;
+ case 0x127cf2f9: res = print_ds_constructor_binlog_user_new (DS, T); break;
+ case 0x0a10aa92: res = print_ds_constructor_binlog_chat_new (DS, T); break;
+ case 0x535475ea: res = print_ds_constructor_binlog_chat_add_participant (DS, T); break;
+ case 0x7dd1a1a2: res = print_ds_constructor_binlog_chat_del_participant (DS, T); break;
+ case 0x3c873416: res = print_ds_constructor_binlog_set_msg_id (DS, T); break;
+ case 0x847e77b1: res = print_ds_constructor_binlog_message_delete (DS, T); break;
+ case 0x427cfcdb: res = print_ds_constructor_binlog_message_new (DS, T); break;
+ case 0x6cf7cabc: res = print_ds_constructor_binlog_message_encr_new (DS, T); break;
+ case 0x6dd4d85f: res = print_ds_constructor_binlog_msg_update (DS, T); break;
+ case 0x83327955: res = print_ds_constructor_binlog_reset_authorization (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_contacts_blocked (struct tl_ds_contacts_blocked *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x1c138d15: res = print_ds_constructor_contacts_blocked (DS, T); break;
+ case 0x900802a1: res = print_ds_constructor_contacts_blocked_slice (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_contacts_blocked (struct tl_ds_contacts_blocked *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x1c138d15: res = print_ds_constructor_contacts_blocked (DS, T); break;
+ case 0x900802a1: res = print_ds_constructor_contacts_blocked_slice (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_contacts_contacts (struct tl_ds_contacts_contacts *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xb74ba9d2: res = print_ds_constructor_contacts_contacts_not_modified (DS, T); break;
+ case 0x6f8b8cb2: res = print_ds_constructor_contacts_contacts (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_contacts_contacts (struct tl_ds_contacts_contacts *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xb74ba9d2: res = print_ds_constructor_contacts_contacts_not_modified (DS, T); break;
+ case 0x6f8b8cb2: res = print_ds_constructor_contacts_contacts (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_contacts_found (struct tl_ds_contacts_found *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_contacts_found (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_contacts_found (struct tl_ds_contacts_found *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_contacts_found (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_contacts_imported_contacts (struct tl_ds_contacts_imported_contacts *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_contacts_imported_contacts (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_contacts_imported_contacts (struct tl_ds_contacts_imported_contacts *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_contacts_imported_contacts (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_contacts_link (struct tl_ds_contacts_link *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_contacts_link (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_contacts_link (struct tl_ds_contacts_link *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_contacts_link (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_contacts_suggested (struct tl_ds_contacts_suggested *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_contacts_suggested (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_contacts_suggested (struct tl_ds_contacts_suggested *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_contacts_suggested (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_geochats_located (struct tl_ds_geochats_located *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_geochats_located (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_geochats_located (struct tl_ds_geochats_located *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_geochats_located (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_geochats_messages (struct tl_ds_geochats_messages *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xd1526db1: res = print_ds_constructor_geochats_messages (DS, T); break;
+ case 0xbc5863e8: res = print_ds_constructor_geochats_messages_slice (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_geochats_messages (struct tl_ds_geochats_messages *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xd1526db1: res = print_ds_constructor_geochats_messages (DS, T); break;
+ case 0xbc5863e8: res = print_ds_constructor_geochats_messages_slice (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_geochats_stated_message (struct tl_ds_geochats_stated_message *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_geochats_stated_message (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_geochats_stated_message (struct tl_ds_geochats_stated_message *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_geochats_stated_message (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_help_app_update (struct tl_ds_help_app_update *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x8987f311: res = print_ds_constructor_help_app_update (DS, T); break;
+ case 0xc45a6536: res = print_ds_constructor_help_no_app_update (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_help_app_update (struct tl_ds_help_app_update *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x8987f311: res = print_ds_constructor_help_app_update (DS, T); break;
+ case 0xc45a6536: res = print_ds_constructor_help_no_app_update (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_help_invite_text (struct tl_ds_help_invite_text *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_help_invite_text (DS, T);
+ return res;
+}
+int print_ds_type_bare_help_invite_text (struct tl_ds_help_invite_text *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_help_invite_text (DS, T);
+ return res;
+}
+int print_ds_type_help_support (struct tl_ds_help_support *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_help_support (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_help_support (struct tl_ds_help_support *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_help_support (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_messages_affected_history (struct tl_ds_messages_affected_history *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_messages_affected_history (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_messages_affected_history (struct tl_ds_messages_affected_history *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_messages_affected_history (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_messages_affected_messages (struct tl_ds_messages_affected_messages *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_messages_affected_messages (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_messages_affected_messages (struct tl_ds_messages_affected_messages *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_messages_affected_messages (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_messages_all_stickers (struct tl_ds_messages_all_stickers *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xe86602c3: res = print_ds_constructor_messages_all_stickers_not_modified (DS, T); break;
+ case 0x5ce352ec: res = print_ds_constructor_messages_all_stickers (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_messages_all_stickers (struct tl_ds_messages_all_stickers *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xe86602c3: res = print_ds_constructor_messages_all_stickers_not_modified (DS, T); break;
+ case 0x5ce352ec: res = print_ds_constructor_messages_all_stickers (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_messages_chat_full (struct tl_ds_messages_chat_full *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_messages_chat_full (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_messages_chat_full (struct tl_ds_messages_chat_full *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_messages_chat_full (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_messages_chats (struct tl_ds_messages_chats *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_messages_chats (DS, T);
+ return res;
+}
+int print_ds_type_bare_messages_chats (struct tl_ds_messages_chats *DS, struct paramed_type *T) {
+ int res;
+ res = print_ds_constructor_messages_chats (DS, T);
+ return res;
+}
+int print_ds_type_messages_dh_config (struct tl_ds_messages_dh_config *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xc0e24635: res = print_ds_constructor_messages_dh_config_not_modified (DS, T); break;
+ case 0x2c221edd: res = print_ds_constructor_messages_dh_config (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_messages_dh_config (struct tl_ds_messages_dh_config *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xc0e24635: res = print_ds_constructor_messages_dh_config_not_modified (DS, T); break;
+ case 0x2c221edd: res = print_ds_constructor_messages_dh_config (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_messages_dialogs (struct tl_ds_messages_dialogs *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x15ba6c40: res = print_ds_constructor_messages_dialogs (DS, T); break;
+ case 0x71e094f3: res = print_ds_constructor_messages_dialogs_slice (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_messages_dialogs (struct tl_ds_messages_dialogs *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x15ba6c40: res = print_ds_constructor_messages_dialogs (DS, T); break;
+ case 0x71e094f3: res = print_ds_constructor_messages_dialogs_slice (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_messages_message (struct tl_ds_messages_message *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_messages_message_empty (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_messages_message (struct tl_ds_messages_message *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_messages_message_empty (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_messages_messages (struct tl_ds_messages_messages *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x8c718e87: res = print_ds_constructor_messages_messages (DS, T); break;
+ case 0x0b446ae3: res = print_ds_constructor_messages_messages_slice (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_messages_messages (struct tl_ds_messages_messages *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x8c718e87: res = print_ds_constructor_messages_messages (DS, T); break;
+ case 0x0b446ae3: res = print_ds_constructor_messages_messages_slice (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_messages_sent_encrypted_message (struct tl_ds_messages_sent_encrypted_message *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x560f8935: res = print_ds_constructor_messages_sent_encrypted_message (DS, T); break;
+ case 0x9493ff32: res = print_ds_constructor_messages_sent_encrypted_file (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_messages_sent_encrypted_message (struct tl_ds_messages_sent_encrypted_message *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x560f8935: res = print_ds_constructor_messages_sent_encrypted_message (DS, T); break;
+ case 0x9493ff32: res = print_ds_constructor_messages_sent_encrypted_file (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_messages_sent_message (struct tl_ds_messages_sent_message *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x4c3d47f3: res = print_ds_constructor_messages_sent_message (DS, T); break;
+ case 0x35a1a663: res = print_ds_constructor_messages_sent_message_link (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_messages_sent_message (struct tl_ds_messages_sent_message *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x4c3d47f3: res = print_ds_constructor_messages_sent_message (DS, T); break;
+ case 0x35a1a663: res = print_ds_constructor_messages_sent_message_link (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_messages_sticker_set (struct tl_ds_messages_sticker_set *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_messages_sticker_set (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_messages_sticker_set (struct tl_ds_messages_sticker_set *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_messages_sticker_set (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_messages_stickers (struct tl_ds_messages_stickers *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xf1749a22: res = print_ds_constructor_messages_stickers_not_modified (DS, T); break;
+ case 0x8a8ecd32: res = print_ds_constructor_messages_stickers (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_messages_stickers (struct tl_ds_messages_stickers *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xf1749a22: res = print_ds_constructor_messages_stickers_not_modified (DS, T); break;
+ case 0x8a8ecd32: res = print_ds_constructor_messages_stickers (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_photos_photo (struct tl_ds_photos_photo *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_photos_photo (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_photos_photo (struct tl_ds_photos_photo *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_photos_photo (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_photos_photos (struct tl_ds_photos_photos *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x8dca6aa5: res = print_ds_constructor_photos_photos (DS, T); break;
+ case 0x15051f54: res = print_ds_constructor_photos_photos_slice (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_photos_photos (struct tl_ds_photos_photos *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x8dca6aa5: res = print_ds_constructor_photos_photos (DS, T); break;
+ case 0x15051f54: res = print_ds_constructor_photos_photos_slice (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_storage_file_type (struct tl_ds_storage_file_type *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xaa963b05: res = print_ds_constructor_storage_file_unknown (DS, T); break;
+ case 0x007efe0e: res = print_ds_constructor_storage_file_jpeg (DS, T); break;
+ case 0xcae1aadf: res = print_ds_constructor_storage_file_gif (DS, T); break;
+ case 0x0a4f63c0: res = print_ds_constructor_storage_file_png (DS, T); break;
+ case 0xae1e508d: res = print_ds_constructor_storage_file_pdf (DS, T); break;
+ case 0x528a0677: res = print_ds_constructor_storage_file_mp3 (DS, T); break;
+ case 0x4b09ebbc: res = print_ds_constructor_storage_file_mov (DS, T); break;
+ case 0x40bc6f52: res = print_ds_constructor_storage_file_partial (DS, T); break;
+ case 0xb3cea0e4: res = print_ds_constructor_storage_file_mp4 (DS, T); break;
+ case 0x1081464c: res = print_ds_constructor_storage_file_webp (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_storage_file_type (struct tl_ds_storage_file_type *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0xaa963b05: res = print_ds_constructor_storage_file_unknown (DS, T); break;
+ case 0x007efe0e: res = print_ds_constructor_storage_file_jpeg (DS, T); break;
+ case 0xcae1aadf: res = print_ds_constructor_storage_file_gif (DS, T); break;
+ case 0x0a4f63c0: res = print_ds_constructor_storage_file_png (DS, T); break;
+ case 0xae1e508d: res = print_ds_constructor_storage_file_pdf (DS, T); break;
+ case 0x528a0677: res = print_ds_constructor_storage_file_mp3 (DS, T); break;
+ case 0x4b09ebbc: res = print_ds_constructor_storage_file_mov (DS, T); break;
+ case 0x40bc6f52: res = print_ds_constructor_storage_file_partial (DS, T); break;
+ case 0xb3cea0e4: res = print_ds_constructor_storage_file_mp4 (DS, T); break;
+ case 0x1081464c: res = print_ds_constructor_storage_file_webp (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_updates_difference (struct tl_ds_updates_difference *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x5d75a138: res = print_ds_constructor_updates_difference_empty (DS, T); break;
+ case 0x00f49ca0: res = print_ds_constructor_updates_difference (DS, T); break;
+ case 0xa8fb1981: res = print_ds_constructor_updates_difference_slice (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_updates_difference (struct tl_ds_updates_difference *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ switch (DS->magic) {
+ case 0x5d75a138: res = print_ds_constructor_updates_difference_empty (DS, T); break;
+ case 0x00f49ca0: res = print_ds_constructor_updates_difference (DS, T); break;
+ case 0xa8fb1981: res = print_ds_constructor_updates_difference_slice (DS, T); break;
+ default: return -1;
+ }
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_updates_state (struct tl_ds_updates_state *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_updates_state (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_updates_state (struct tl_ds_updates_state *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_updates_state (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_upload_file (struct tl_ds_upload_file *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_upload_file (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_bare_upload_file (struct tl_ds_upload_file *DS, struct paramed_type *T) {
+ int res;
+ if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }
+ eprintf (" (");
+ res = print_ds_constructor_upload_file (DS, T);
+ if (res >= 0) {
+ if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }
+ eprintf (" )");
+ }
+ return res;
+}
+int print_ds_type_any (void *DS, struct paramed_type *T) {
+ switch (T->type->name) {
+ case 0xb8d0afdf: return print_ds_type_account_days_t_t_l (DS, T);
+ case 0x472f5020: return print_ds_type_bare_account_days_t_t_l (DS, T);
+ case 0x9fc5ec4e: return print_ds_type_audio (DS, T);
+ case 0x603a13b1: return print_ds_type_bare_audio (DS, T);
+ case 0x7bf2e6f6: return print_ds_type_authorization (DS, T);
+ case 0x840d1909: return print_ds_type_bare_authorization (DS, T);
+ case 0x250be282: return print_ds_type_bool (DS, T);
+ case 0xdaf41d7d: return print_ds_type_bare_bool (DS, T);
+ case 0x75e7ea6c: return print_ds_type_bot_command (DS, T);
+ case 0x8a181593: return print_ds_type_bare_bot_command (DS, T);
+ case 0xb2e16f93: return print_ds_type_bot_info (DS, T);
+ case 0x4d1e906c: return print_ds_type_bare_bot_info (DS, T);
+ case 0x0ee1379f: return print_ds_type_bytes (DS, T);
+ case 0xf11ec860: return print_ds_type_bare_bytes (DS, T);
+ case 0x7bd865dc: return print_ds_type_chat (DS, T);
+ case 0x84279a23: return print_ds_type_bare_chat (DS, T);
+ case 0x2e02a614: return print_ds_type_chat_full (DS, T);
+ case 0xd1fd59eb: return print_ds_type_bare_chat_full (DS, T);
+ case 0x94f910b1: return print_ds_type_chat_invite (DS, T);
+ case 0x6b06ef4e: return print_ds_type_bare_chat_invite (DS, T);
+ case 0x3631cf4c: return print_ds_type_chat_located (DS, T);
+ case 0xc9ce30b3: return print_ds_type_bare_chat_located (DS, T);
+ case 0xc8d7493e: return print_ds_type_chat_participant (DS, T);
+ case 0x3728b6c1: return print_ds_type_bare_chat_participant (DS, T);
+ case 0x77930f9f: return print_ds_type_chat_participants (DS, T);
+ case 0x886cf060: return print_ds_type_bare_chat_participants (DS, T);
+ case 0x56922676: return print_ds_type_chat_photo (DS, T);
+ case 0xa96dd989: return print_ds_type_bare_chat_photo (DS, T);
+ case 0x6643b654: return print_ds_type_client_d_h_inner_data (DS, T);
+ case 0x99bc49ab: return print_ds_type_bare_client_d_h_inner_data (DS, T);
+ case 0x4e32b894: return print_ds_type_config (DS, T);
+ case 0xb1cd476b: return print_ds_type_bare_config (DS, T);
+ case 0xf911c994: return print_ds_type_contact (DS, T);
+ case 0x06ee366b: return print_ds_type_bare_contact (DS, T);
+ case 0x561bc879: return print_ds_type_contact_blocked (DS, T);
+ case 0xa9e43786: return print_ds_type_bare_contact_blocked (DS, T);
+ case 0xea879f95: return print_ds_type_contact_found (DS, T);
+ case 0x1578606a: return print_ds_type_bare_contact_found (DS, T);
+ case 0x522fbc63: return print_ds_type_contact_link (DS, T);
+ case 0xadd0439c: return print_ds_type_bare_contact_link (DS, T);
+ case 0xd3680c61: return print_ds_type_contact_status (DS, T);
+ case 0x2c97f39e: return print_ds_type_bare_contact_status (DS, T);
+ case 0x3de191a1: return print_ds_type_contact_suggested (DS, T);
+ case 0xc21e6e5e: return print_ds_type_bare_contact_suggested (DS, T);
+ case 0x2b1a62f0: return print_ds_type_dc_option (DS, T);
+ case 0xd4e59d0f: return print_ds_type_bare_dc_option (DS, T);
+ case 0x535b7918: return print_ds_type_decrypted_message (DS, T);
+ case 0xaca486e7: return print_ds_type_bare_decrypted_message (DS, T);
+ case 0x4e0eefde: return print_ds_type_decrypted_message_action (DS, T);
+ case 0xb1f11021: return print_ds_type_bare_decrypted_message_action (DS, T);
+ case 0x1be31789: return print_ds_type_decrypted_message_layer (DS, T);
+ case 0xe41ce876: return print_ds_type_bare_decrypted_message_layer (DS, T);
+ case 0x34e0d674: return print_ds_type_decrypted_message_media (DS, T);
+ case 0xcb1f298b: return print_ds_type_bare_decrypted_message_media (DS, T);
+ case 0xc1dd804a: return print_ds_type_dialog (DS, T);
+ case 0x3e227fb5: return print_ds_type_bare_dialog (DS, T);
+ case 0xae636f24: return print_ds_type_disabled_feature (DS, T);
+ case 0x519c90db: return print_ds_type_bare_disabled_feature (DS, T);
+ case 0x51a73418: return print_ds_type_document (DS, T);
+ case 0xae58cbe7: return print_ds_type_bare_document (DS, T);
+ case 0x97c637a3: return print_ds_type_document_attribute (DS, T);
+ case 0x6839c85c: return print_ds_type_bare_document_attribute (DS, T);
+ case 0x2210c154: return print_ds_type_double (DS, T);
+ case 0xddef3eab: return print_ds_type_bare_double (DS, T);
+ case 0xb1718213: return print_ds_type_encrypted_chat (DS, T);
+ case 0x4e8e7dec: return print_ds_type_bare_encrypted_chat (DS, T);
+ case 0x886fd032: return print_ds_type_encrypted_file (DS, T);
+ case 0x77902fcd: return print_ds_type_bare_encrypted_file (DS, T);
+ case 0xce6b8a1e: return print_ds_type_encrypted_message (DS, T);
+ case 0x319475e1: return print_ds_type_bare_encrypted_message (DS, T);
+ case 0xc4b9f9bb: return print_ds_type_error (DS, T);
+ case 0x3b460644: return print_ds_type_bare_error (DS, T);
+ case 0x95f132d5: return print_ds_type_exported_chat_invite (DS, T);
+ case 0x6a0ecd2a: return print_ds_type_bare_exported_chat_invite (DS, T);
+ case 0x2f8ffb30: return print_ds_type_file_location (DS, T);
+ case 0xd07004cf: return print_ds_type_bare_file_location (DS, T);
+ case 0xf67b4034: return print_ds_type_geo_chat_message (DS, T);
+ case 0x0984bfcb: return print_ds_type_bare_geo_chat_message (DS, T);
+ case 0x315e0a53: return print_ds_type_geo_point (DS, T);
+ case 0xcea1f5ac: return print_ds_type_bare_geo_point (DS, T);
+ case 0xd0028438: return print_ds_type_imported_contact (DS, T);
+ case 0x2ffd7bc7: return print_ds_type_bare_imported_contact (DS, T);
+ case 0x770656a8: return print_ds_type_input_app_event (DS, T);
+ case 0x88f9a957: return print_ds_type_bare_input_app_event (DS, T);
+ case 0xae8e9c7b: return print_ds_type_input_audio (DS, T);
+ case 0x51716384: return print_ds_type_bare_input_audio (DS, T);
+ case 0x3a60776d: return print_ds_type_input_chat_photo (DS, T);
+ case 0xc59f8892: return print_ds_type_bare_input_chat_photo (DS, T);
+ case 0xf392b7f4: return print_ds_type_input_contact (DS, T);
+ case 0x0c6d480b: return print_ds_type_bare_input_contact (DS, T);
+ case 0x6a8963fc: return print_ds_type_input_document (DS, T);
+ case 0x95769c03: return print_ds_type_bare_input_document (DS, T);
+ case 0xf141b5e1: return print_ds_type_input_encrypted_chat (DS, T);
+ case 0x0ebe4a1e: return print_ds_type_bare_input_encrypted_chat (DS, T);
+ case 0x0b5c064f: return print_ds_type_input_encrypted_file (DS, T);
+ case 0xf4a3f9b0: return print_ds_type_bare_input_encrypted_file (DS, T);
+ case 0x0f60f9ca: return print_ds_type_input_file (DS, T);
+ case 0xf09f0635: return print_ds_type_bare_input_file (DS, T);
+ case 0xe6daa38b: return print_ds_type_input_file_location (DS, T);
+ case 0x19255c74: return print_ds_type_bare_input_file_location (DS, T);
+ case 0x74d456fa: return print_ds_type_input_geo_chat (DS, T);
+ case 0x8b2ba905: return print_ds_type_bare_input_geo_chat (DS, T);
+ case 0x17768f1f: return print_ds_type_input_geo_point (DS, T);
+ case 0xe88970e0: return print_ds_type_bare_input_geo_point (DS, T);
+ case 0xb32c91dd: return print_ds_type_input_media (DS, T);
+ case 0x4cd36e22: return print_ds_type_bare_input_media (DS, T);
+ case 0x02b6911b: return print_ds_type_input_notify_peer (DS, T);
+ case 0xfd496ee4: return print_ds_type_bare_input_notify_peer (DS, T);
+ case 0x9e67268d: return print_ds_type_input_peer (DS, T);
+ case 0x6198d972: return print_ds_type_bare_input_peer (DS, T);
+ case 0x185a48ac: return print_ds_type_input_peer_notify_events (DS, T);
+ case 0xe7a5b753: return print_ds_type_bare_input_peer_notify_events (DS, T);
+ case 0x46a2ce98: return print_ds_type_input_peer_notify_settings (DS, T);
+ case 0xb95d3167: return print_ds_type_bare_input_peer_notify_settings (DS, T);
+ case 0xe74279c9: return print_ds_type_input_photo (DS, T);
+ case 0x18bd8636: return print_ds_type_bare_input_photo (DS, T);
+ case 0x7477e321: return print_ds_type_input_photo_crop (DS, T);
+ case 0x8b881cde: return print_ds_type_bare_input_photo_crop (DS, T);
+ case 0x4f96cb18: return print_ds_type_input_privacy_key (DS, T);
+ case 0xb06934e7: return print_ds_type_bare_input_privacy_key (DS, T);
+ case 0x4b815163: return print_ds_type_input_privacy_rule (DS, T);
+ case 0xb47eae9c: return print_ds_type_bare_input_privacy_rule (DS, T);
+ case 0xe44d415c: return print_ds_type_input_sticker_set (DS, T);
+ case 0x1bb2bea3: return print_ds_type_bare_input_sticker_set (DS, T);
+ case 0xadfe0c6a: return print_ds_type_input_user (DS, T);
+ case 0x5201f395: return print_ds_type_bare_input_user (DS, T);
+ case 0xbb5f7a27: return print_ds_type_input_video (DS, T);
+ case 0x44a085d8: return print_ds_type_bare_input_video (DS, T);
+ case 0xa8509bda: return print_ds_type_int (DS, T);
+ case 0x57af6425: return print_ds_type_bare_int (DS, T);
+ case 0x7d36c439: return print_ds_type_int128 (DS, T);
+ case 0x82c93bc6: return print_ds_type_bare_int128 (DS, T);
+ case 0xf2c798b3: return print_ds_type_int256 (DS, T);
+ case 0x0d38674c: return print_ds_type_bare_int256 (DS, T);
+ case 0xa2fa4880: return print_ds_type_keyboard_button (DS, T);
+ case 0x5d05b77f: return print_ds_type_bare_keyboard_button (DS, T);
+ case 0x77608b83: return print_ds_type_keyboard_button_row (DS, T);
+ case 0x889f747c: return print_ds_type_bare_keyboard_button_row (DS, T);
+ case 0x22076cba: return print_ds_type_long (DS, T);
+ case 0xddf89345: return print_ds_type_bare_long (DS, T);
+ case 0x5d652a7f: return print_ds_type_message (DS, T);
+ case 0xa29ad580: return print_ds_type_bare_message (DS, T);
+ case 0x383415fa: return print_ds_type_message_action (DS, T);
+ case 0xc7cbea05: return print_ds_type_bare_message_action (DS, T);
+ case 0x95f2471a: return print_ds_type_message_media (DS, T);
+ case 0x6a0db8e5: return print_ds_type_bare_message_media (DS, T);
+ case 0x80895ae0: return print_ds_type_messages_filter (DS, T);
+ case 0x7f76a51f: return print_ds_type_bare_messages_filter (DS, T);
+ case 0x8e1a1775: return print_ds_type_nearest_dc (DS, T);
+ case 0x71e5e88a: return print_ds_type_bare_nearest_dc (DS, T);
+ case 0x9fcb8237: return print_ds_type_notify_peer (DS, T);
+ case 0x60347dc8: return print_ds_type_bare_notify_peer (DS, T);
+ case 0x56730bcc: return print_ds_type_null (DS, T);
+ case 0xa98cf433: return print_ds_type_bare_null (DS, T);
+ case 0xbfa3de38: return print_ds_type_p_q_inner_data (DS, T);
+ case 0x405c21c7: return print_ds_type_bare_p_q_inner_data (DS, T);
+ case 0x276159d6: return print_ds_type_peer (DS, T);
+ case 0xd89ea629: return print_ds_type_bare_peer (DS, T);
+ case 0xc0c8d13b: return print_ds_type_peer_notify_events (DS, T);
+ case 0x3f372ec4: return print_ds_type_bare_peer_notify_events (DS, T);
+ case 0xfdf894fc: return print_ds_type_peer_notify_settings (DS, T);
+ case 0x02076b03: return print_ds_type_bare_peer_notify_settings (DS, T);
+ case 0xc207550a: return print_ds_type_photo (DS, T);
+ case 0x3df8aaf5: return print_ds_type_bare_photo (DS, T);
+ case 0x900f60dd: return print_ds_type_photo_size (DS, T);
+ case 0x6ff09f22: return print_ds_type_bare_photo_size (DS, T);
+ case 0xbc2eab30: return print_ds_type_privacy_key (DS, T);
+ case 0x43d154cf: return print_ds_type_bare_privacy_key (DS, T);
+ case 0xa8638aec: return print_ds_type_privacy_rule (DS, T);
+ case 0x579c7513: return print_ds_type_bare_privacy_rule (DS, T);
+ case 0xa384b779: return print_ds_type_received_notify_message (DS, T);
+ case 0x5c7b4886: return print_ds_type_bare_received_notify_message (DS, T);
+ case 0x612ca4a9: return print_ds_type_reply_markup (DS, T);
+ case 0x9ed35b56: return print_ds_type_bare_reply_markup (DS, T);
+ case 0x05162463: return print_ds_type_res_p_q (DS, T);
+ case 0xfae9db9c: return print_ds_type_bare_res_p_q (DS, T);
+ case 0x70541c7e: return print_ds_type_send_message_action (DS, T);
+ case 0x8fabe381: return print_ds_type_bare_send_message_action (DS, T);
+ case 0xa9230301: return print_ds_type_server_d_h_params (DS, T);
+ case 0x56dcfcfe: return print_ds_type_bare_server_d_h_params (DS, T);
+ case 0xb5890dba: return print_ds_type_server_d_h_inner_data (DS, T);
+ case 0x4a76f245: return print_ds_type_bare_server_d_h_inner_data (DS, T);
+ case 0xdb8a468f: return print_ds_type_set_client_d_h_params_answer (DS, T);
+ case 0x2475b970: return print_ds_type_bare_set_client_d_h_params_answer (DS, T);
+ case 0x12b299d4: return print_ds_type_sticker_pack (DS, T);
+ case 0xed4d662b: return print_ds_type_bare_sticker_pack (DS, T);
+ case 0xa7a43b17: return print_ds_type_sticker_set (DS, T);
+ case 0x585bc4e8: return print_ds_type_bare_sticker_set (DS, T);
+ case 0xb5286e24: return print_ds_type_string (DS, T);
+ case 0x4ad791db: return print_ds_type_bare_string (DS, T);
+ case 0x2e02b27e: return print_ds_type_update (DS, T);
+ case 0xd1fd4d81: return print_ds_type_bare_update (DS, T);
+ case 0x22499d27: return print_ds_type_updates (DS, T);
+ case 0xddb662d8: return print_ds_type_bare_updates (DS, T);
+ case 0x02e6c0c8: return print_ds_type_user (DS, T);
+ case 0xfd193f37: return print_ds_type_bare_user (DS, T);
+ case 0x5a89ac5b: return print_ds_type_user_full (DS, T);
+ case 0xa57653a4: return print_ds_type_bare_user_full (DS, T);
+ case 0x9a486229: return print_ds_type_user_profile_photo (DS, T);
+ case 0x65b79dd6: return print_ds_type_bare_user_profile_photo (DS, T);
+ case 0x76de9570: return print_ds_type_user_status (DS, T);
+ case 0x89216a8f: return print_ds_type_bare_user_status (DS, T);
+ case 0x1cb5c415: return print_ds_type_vector (DS, T);
+ case 0xe34a3bea: return print_ds_type_bare_vector (DS, T);
+ case 0x1716b174: return print_ds_type_video (DS, T);
+ case 0xe8e94e8b: return print_ds_type_bare_video (DS, T);
+ case 0xafa14973: return print_ds_type_wall_paper (DS, T);
+ case 0x505eb68c: return print_ds_type_bare_wall_paper (DS, T);
+ case 0x8d8c0d41: return print_ds_type_web_page (DS, T);
+ case 0x7273f2be: return print_ds_type_bare_web_page (DS, T);
+ case 0x1250abde: return print_ds_type_account_authorizations (DS, T);
+ case 0xedaf5421: return print_ds_type_bare_account_authorizations (DS, T);
+ case 0xeac2a804: return print_ds_type_account_password (DS, T);
+ case 0x153d57fb: return print_ds_type_bare_account_password (DS, T);
+ case 0xbcfc532c: return print_ds_type_account_password_input_settings (DS, T);
+ case 0x4303acd3: return print_ds_type_bare_account_password_input_settings (DS, T);
+ case 0xb7b72ab3: return print_ds_type_account_password_settings (DS, T);
+ case 0x4848d54c: return print_ds_type_bare_account_password_settings (DS, T);
+ case 0x554abb6f: return print_ds_type_account_privacy_rules (DS, T);
+ case 0xaab54490: return print_ds_type_bare_account_privacy_rules (DS, T);
+ case 0xa4f58c4c: return print_ds_type_account_sent_change_phone_code (DS, T);
+ case 0x5b0a73b3: return print_ds_type_bare_account_sent_change_phone_code (DS, T);
+ case 0xff036af1: return print_ds_type_auth_authorization (DS, T);
+ case 0x00fc950e: return print_ds_type_bare_auth_authorization (DS, T);
+ case 0x811ea28e: return print_ds_type_auth_checked_phone (DS, T);
+ case 0x7ee15d71: return print_ds_type_bare_auth_checked_phone (DS, T);
+ case 0xdf969c2d: return print_ds_type_auth_exported_authorization (DS, T);
+ case 0x206963d2: return print_ds_type_bare_auth_exported_authorization (DS, T);
+ case 0x137948a5: return print_ds_type_auth_password_recovery (DS, T);
+ case 0xec86b75a: return print_ds_type_bare_auth_password_recovery (DS, T);
+ case 0x0cc8bc16: return print_ds_type_auth_sent_code (DS, T);
+ case 0xf33743e9: return print_ds_type_bare_auth_sent_code (DS, T);
+ case 0x0377168f: return print_ds_type_binlog_encr_key (DS, T);
+ case 0xfc88e970: return print_ds_type_bare_binlog_encr_key (DS, T);
+ case 0x66ff03a6: return print_ds_type_binlog_update (DS, T);
+ case 0x9900fc59: return print_ds_type_bare_binlog_update (DS, T);
+ case 0x8c1b8fb4: return print_ds_type_contacts_blocked (DS, T);
+ case 0x73e4704b: return print_ds_type_bare_contacts_blocked (DS, T);
+ case 0xd8c02560: return print_ds_type_contacts_contacts (DS, T);
+ case 0x273fda9f: return print_ds_type_bare_contacts_contacts (DS, T);
+ case 0x0566000e: return print_ds_type_contacts_found (DS, T);
+ case 0xfa99fff1: return print_ds_type_bare_contacts_found (DS, T);
+ case 0xad524315: return print_ds_type_contacts_imported_contacts (DS, T);
+ case 0x52adbcea: return print_ds_type_bare_contacts_imported_contacts (DS, T);
+ case 0x3ace484c: return print_ds_type_contacts_link (DS, T);
+ case 0xc531b7b3: return print_ds_type_bare_contacts_link (DS, T);
+ case 0x5649dcc5: return print_ds_type_contacts_suggested (DS, T);
+ case 0xa9b6233a: return print_ds_type_bare_contacts_suggested (DS, T);
+ case 0x48feb267: return print_ds_type_geochats_located (DS, T);
+ case 0xb7014d98: return print_ds_type_bare_geochats_located (DS, T);
+ case 0x6d0a0e59: return print_ds_type_geochats_messages (DS, T);
+ case 0x92f5f1a6: return print_ds_type_bare_geochats_messages (DS, T);
+ case 0x17b1578b: return print_ds_type_geochats_stated_message (DS, T);
+ case 0xe84ea874: return print_ds_type_bare_geochats_stated_message (DS, T);
+ case 0x4ddd9627: return print_ds_type_help_app_update (DS, T);
+ case 0xb22269d8: return print_ds_type_bare_help_app_update (DS, T);
+ case 0x18cb9f78: return print_ds_type_help_invite_text (DS, T);
+ case 0xe7346087: return print_ds_type_bare_help_invite_text (DS, T);
+ case 0x17c6b5f6: return print_ds_type_help_support (DS, T);
+ case 0xe8394a09: return print_ds_type_bare_help_support (DS, T);
+ case 0xb45c69d1: return print_ds_type_messages_affected_history (DS, T);
+ case 0x4ba3962e: return print_ds_type_bare_messages_affected_history (DS, T);
+ case 0x84d19185: return print_ds_type_messages_affected_messages (DS, T);
+ case 0x7b2e6e7a: return print_ds_type_bare_messages_affected_messages (DS, T);
+ case 0xb485502f: return print_ds_type_messages_all_stickers (DS, T);
+ case 0x4b7aafd0: return print_ds_type_bare_messages_all_stickers (DS, T);
+ case 0xe5d7d19c: return print_ds_type_messages_chat_full (DS, T);
+ case 0x1a282e63: return print_ds_type_bare_messages_chat_full (DS, T);
+ case 0x64ff9fd5: return print_ds_type_messages_chats (DS, T);
+ case 0x9b00602a: return print_ds_type_bare_messages_chats (DS, T);
+ case 0xecc058e8: return print_ds_type_messages_dh_config (DS, T);
+ case 0x133fa717: return print_ds_type_bare_messages_dh_config (DS, T);
+ case 0x645af8b3: return print_ds_type_messages_dialogs (DS, T);
+ case 0x9ba5074c: return print_ds_type_bare_messages_dialogs (DS, T);
+ case 0x3f4e0648: return print_ds_type_messages_message (DS, T);
+ case 0xc0b1f9b7: return print_ds_type_bare_messages_message (DS, T);
+ case 0x8735e464: return print_ds_type_messages_messages (DS, T);
+ case 0x78ca1b9b: return print_ds_type_bare_messages_messages (DS, T);
+ case 0xc29c7607: return print_ds_type_messages_sent_encrypted_message (DS, T);
+ case 0x3d6389f8: return print_ds_type_bare_messages_sent_encrypted_message (DS, T);
+ case 0x799ce190: return print_ds_type_messages_sent_message (DS, T);
+ case 0x86631e6f: return print_ds_type_bare_messages_sent_message (DS, T);
+ case 0xb60a24a6: return print_ds_type_messages_sticker_set (DS, T);
+ case 0x49f5db59: return print_ds_type_bare_messages_sticker_set (DS, T);
+ case 0x7bfa5710: return print_ds_type_messages_stickers (DS, T);
+ case 0x8405a8ef: return print_ds_type_bare_messages_stickers (DS, T);
+ case 0x20212ca8: return print_ds_type_photos_photo (DS, T);
+ case 0xdfded357: return print_ds_type_bare_photos_photo (DS, T);
+ case 0x98cf75f1: return print_ds_type_photos_photos (DS, T);
+ case 0x67308a0e: return print_ds_type_bare_photos_photos (DS, T);
+ case 0x3e2838a8: return print_ds_type_storage_file_type (DS, T);
+ case 0xc1d7c757: return print_ds_type_bare_storage_file_type (DS, T);
+ case 0xf57a2419: return print_ds_type_updates_difference (DS, T);
+ case 0x0a85dbe6: return print_ds_type_bare_updates_difference (DS, T);
+ case 0xa56c2a3e: return print_ds_type_updates_state (DS, T);
+ case 0x5a93d5c1: return print_ds_type_bare_updates_state (DS, T);
+ case 0x096a18d5: return print_ds_type_upload_file (DS, T);
+ case 0xf695e72a: return print_ds_type_bare_upload_file (DS, T);
+ default: return -1; }
+}
diff --git a/protocols/Telegram/tgl/auto/auto-print-ds.h b/protocols/Telegram/tgl/auto/auto-print-ds.h
new file mode 100644
index 0000000000..2f74cd9f17
--- /dev/null
+++ b/protocols/Telegram/tgl/auto/auto-print-ds.h
@@ -0,0 +1,719 @@
+#ifdef _MSC_VER
+#include "..\auto.h"
+#include "auto-types.h"
+#else
+#include "auto.h"
+#include "auto-types.h"
+#endif
+#include <assert.h>
+#include <stdio.h>
+struct tgl_state;
+char *tglf_extf_print_ds (struct tgl_state *TLS, void *DS, struct paramed_type *T);
+int print_ds_constructor_account_days_t_t_l (struct tl_ds_account_days_t_t_l *DS, struct paramed_type *T);
+int print_ds_constructor_audio_empty (struct tl_ds_audio *DS, struct paramed_type *T);
+int print_ds_constructor_audio (struct tl_ds_audio *DS, struct paramed_type *T);
+int print_ds_constructor_authorization (struct tl_ds_authorization *DS, struct paramed_type *T);
+int print_ds_constructor_bool_false (struct tl_ds_bool *DS, struct paramed_type *T);
+int print_ds_constructor_bool_true (struct tl_ds_bool *DS, struct paramed_type *T);
+int print_ds_constructor_bot_command (struct tl_ds_bot_command *DS, struct paramed_type *T);
+int print_ds_constructor_bot_command_old (struct tl_ds_bot_command *DS, struct paramed_type *T);
+int print_ds_constructor_bot_info_empty (struct tl_ds_bot_info *DS, struct paramed_type *T);
+int print_ds_constructor_bot_info (struct tl_ds_bot_info *DS, struct paramed_type *T);
+int print_ds_constructor_bytes (struct tl_ds_string *DS, struct paramed_type *T);
+int print_ds_constructor_chat_empty (struct tl_ds_chat *DS, struct paramed_type *T);
+int print_ds_constructor_chat (struct tl_ds_chat *DS, struct paramed_type *T);
+int print_ds_constructor_chat_forbidden (struct tl_ds_chat *DS, struct paramed_type *T);
+int print_ds_constructor_geo_chat (struct tl_ds_chat *DS, struct paramed_type *T);
+int print_ds_constructor_chat_full (struct tl_ds_chat_full *DS, struct paramed_type *T);
+int print_ds_constructor_chat_invite_already (struct tl_ds_chat_invite *DS, struct paramed_type *T);
+int print_ds_constructor_chat_invite (struct tl_ds_chat_invite *DS, struct paramed_type *T);
+int print_ds_constructor_chat_located (struct tl_ds_chat_located *DS, struct paramed_type *T);
+int print_ds_constructor_chat_participant (struct tl_ds_chat_participant *DS, struct paramed_type *T);
+int print_ds_constructor_chat_participants_forbidden (struct tl_ds_chat_participants *DS, struct paramed_type *T);
+int print_ds_constructor_chat_participants (struct tl_ds_chat_participants *DS, struct paramed_type *T);
+int print_ds_constructor_chat_photo_empty (struct tl_ds_chat_photo *DS, struct paramed_type *T);
+int print_ds_constructor_chat_photo (struct tl_ds_chat_photo *DS, struct paramed_type *T);
+int print_ds_constructor_client_d_h_inner_data (struct tl_ds_client_d_h_inner_data *DS, struct paramed_type *T);
+int print_ds_constructor_config (struct tl_ds_config *DS, struct paramed_type *T);
+int print_ds_constructor_contact (struct tl_ds_contact *DS, struct paramed_type *T);
+int print_ds_constructor_contact_blocked (struct tl_ds_contact_blocked *DS, struct paramed_type *T);
+int print_ds_constructor_contact_found (struct tl_ds_contact_found *DS, struct paramed_type *T);
+int print_ds_constructor_contact_link_unknown (struct tl_ds_contact_link *DS, struct paramed_type *T);
+int print_ds_constructor_contact_link_none (struct tl_ds_contact_link *DS, struct paramed_type *T);
+int print_ds_constructor_contact_link_has_phone (struct tl_ds_contact_link *DS, struct paramed_type *T);
+int print_ds_constructor_contact_link_contact (struct tl_ds_contact_link *DS, struct paramed_type *T);
+int print_ds_constructor_contact_status (struct tl_ds_contact_status *DS, struct paramed_type *T);
+int print_ds_constructor_contact_suggested (struct tl_ds_contact_suggested *DS, struct paramed_type *T);
+int print_ds_constructor_dc_option_l28 (struct tl_ds_dc_option *DS, struct paramed_type *T);
+int print_ds_constructor_dc_option (struct tl_ds_dc_option *DS, struct paramed_type *T);
+int print_ds_constructor_decrypted_message (struct tl_ds_decrypted_message *DS, struct paramed_type *T);
+int print_ds_constructor_decrypted_message_service (struct tl_ds_decrypted_message *DS, struct paramed_type *T);
+int print_ds_constructor_decrypted_message_action_set_message_t_t_l (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_decrypted_message_action_read_messages (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_decrypted_message_action_delete_messages (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_decrypted_message_action_screenshot_messages (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_decrypted_message_action_flush_history (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_decrypted_message_action_resend (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_decrypted_message_action_notify_layer (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_decrypted_message_action_typing (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_decrypted_message_action_request_key (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_decrypted_message_action_accept_key (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_decrypted_message_action_abort_key (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_decrypted_message_action_commit_key (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_decrypted_message_action_noop (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_decrypted_message_layer (struct tl_ds_decrypted_message_layer *DS, struct paramed_type *T);
+int print_ds_constructor_decrypted_message_media_empty (struct tl_ds_decrypted_message_media *DS, struct paramed_type *T);
+int print_ds_constructor_decrypted_message_media_photo (struct tl_ds_decrypted_message_media *DS, struct paramed_type *T);
+int print_ds_constructor_decrypted_message_media_geo_point (struct tl_ds_decrypted_message_media *DS, struct paramed_type *T);
+int print_ds_constructor_decrypted_message_media_contact (struct tl_ds_decrypted_message_media *DS, struct paramed_type *T);
+int print_ds_constructor_decrypted_message_media_document (struct tl_ds_decrypted_message_media *DS, struct paramed_type *T);
+int print_ds_constructor_decrypted_message_media_video (struct tl_ds_decrypted_message_media *DS, struct paramed_type *T);
+int print_ds_constructor_decrypted_message_media_audio (struct tl_ds_decrypted_message_media *DS, struct paramed_type *T);
+int print_ds_constructor_decrypted_message_media_external_document (struct tl_ds_decrypted_message_media *DS, struct paramed_type *T);
+int print_ds_constructor_decrypted_message_media_video_l12 (struct tl_ds_decrypted_message_media *DS, struct paramed_type *T);
+int print_ds_constructor_decrypted_message_media_audio_l12 (struct tl_ds_decrypted_message_media *DS, struct paramed_type *T);
+int print_ds_constructor_dialog (struct tl_ds_dialog *DS, struct paramed_type *T);
+int print_ds_constructor_disabled_feature (struct tl_ds_disabled_feature *DS, struct paramed_type *T);
+int print_ds_constructor_document_empty (struct tl_ds_document *DS, struct paramed_type *T);
+int print_ds_constructor_document (struct tl_ds_document *DS, struct paramed_type *T);
+int print_ds_constructor_document_l19 (struct tl_ds_document *DS, struct paramed_type *T);
+int print_ds_constructor_document_attribute_image_size (struct tl_ds_document_attribute *DS, struct paramed_type *T);
+int print_ds_constructor_document_attribute_animated (struct tl_ds_document_attribute *DS, struct paramed_type *T);
+int print_ds_constructor_document_attribute_sticker_l28 (struct tl_ds_document_attribute *DS, struct paramed_type *T);
+int print_ds_constructor_document_attribute_sticker (struct tl_ds_document_attribute *DS, struct paramed_type *T);
+int print_ds_constructor_document_attribute_video (struct tl_ds_document_attribute *DS, struct paramed_type *T);
+int print_ds_constructor_document_attribute_audio (struct tl_ds_document_attribute *DS, struct paramed_type *T);
+int print_ds_constructor_document_attribute_filename (struct tl_ds_document_attribute *DS, struct paramed_type *T);
+int print_ds_constructor_double (double *DS, struct paramed_type *T);
+int print_ds_constructor_encrypted_chat_empty (struct tl_ds_encrypted_chat *DS, struct paramed_type *T);
+int print_ds_constructor_encrypted_chat_waiting (struct tl_ds_encrypted_chat *DS, struct paramed_type *T);
+int print_ds_constructor_encrypted_chat_requested (struct tl_ds_encrypted_chat *DS, struct paramed_type *T);
+int print_ds_constructor_encrypted_chat (struct tl_ds_encrypted_chat *DS, struct paramed_type *T);
+int print_ds_constructor_encrypted_chat_discarded (struct tl_ds_encrypted_chat *DS, struct paramed_type *T);
+int print_ds_constructor_encrypted_file_empty (struct tl_ds_encrypted_file *DS, struct paramed_type *T);
+int print_ds_constructor_encrypted_file (struct tl_ds_encrypted_file *DS, struct paramed_type *T);
+int print_ds_constructor_encrypted_message (struct tl_ds_encrypted_message *DS, struct paramed_type *T);
+int print_ds_constructor_encrypted_message_service (struct tl_ds_encrypted_message *DS, struct paramed_type *T);
+int print_ds_constructor_error (struct tl_ds_error *DS, struct paramed_type *T);
+int print_ds_constructor_chat_invite_empty (struct tl_ds_exported_chat_invite *DS, struct paramed_type *T);
+int print_ds_constructor_chat_invite_exported (struct tl_ds_exported_chat_invite *DS, struct paramed_type *T);
+int print_ds_constructor_file_location_unavailable (struct tl_ds_file_location *DS, struct paramed_type *T);
+int print_ds_constructor_file_location (struct tl_ds_file_location *DS, struct paramed_type *T);
+int print_ds_constructor_geo_chat_message_empty (struct tl_ds_geo_chat_message *DS, struct paramed_type *T);
+int print_ds_constructor_geo_chat_message (struct tl_ds_geo_chat_message *DS, struct paramed_type *T);
+int print_ds_constructor_geo_chat_message_service (struct tl_ds_geo_chat_message *DS, struct paramed_type *T);
+int print_ds_constructor_geo_point_empty (struct tl_ds_geo_point *DS, struct paramed_type *T);
+int print_ds_constructor_geo_point (struct tl_ds_geo_point *DS, struct paramed_type *T);
+int print_ds_constructor_imported_contact (struct tl_ds_imported_contact *DS, struct paramed_type *T);
+int print_ds_constructor_input_app_event (struct tl_ds_input_app_event *DS, struct paramed_type *T);
+int print_ds_constructor_input_audio_empty (struct tl_ds_input_audio *DS, struct paramed_type *T);
+int print_ds_constructor_input_audio (struct tl_ds_input_audio *DS, struct paramed_type *T);
+int print_ds_constructor_input_chat_photo_empty (struct tl_ds_input_chat_photo *DS, struct paramed_type *T);
+int print_ds_constructor_input_chat_uploaded_photo (struct tl_ds_input_chat_photo *DS, struct paramed_type *T);
+int print_ds_constructor_input_chat_photo (struct tl_ds_input_chat_photo *DS, struct paramed_type *T);
+int print_ds_constructor_input_phone_contact (struct tl_ds_input_contact *DS, struct paramed_type *T);
+int print_ds_constructor_input_document_empty (struct tl_ds_input_document *DS, struct paramed_type *T);
+int print_ds_constructor_input_document (struct tl_ds_input_document *DS, struct paramed_type *T);
+int print_ds_constructor_input_encrypted_chat (struct tl_ds_input_encrypted_chat *DS, struct paramed_type *T);
+int print_ds_constructor_input_encrypted_file_empty (struct tl_ds_input_encrypted_file *DS, struct paramed_type *T);
+int print_ds_constructor_input_encrypted_file_uploaded (struct tl_ds_input_encrypted_file *DS, struct paramed_type *T);
+int print_ds_constructor_input_encrypted_file (struct tl_ds_input_encrypted_file *DS, struct paramed_type *T);
+int print_ds_constructor_input_encrypted_file_big_uploaded (struct tl_ds_input_encrypted_file *DS, struct paramed_type *T);
+int print_ds_constructor_input_file (struct tl_ds_input_file *DS, struct paramed_type *T);
+int print_ds_constructor_input_file_big (struct tl_ds_input_file *DS, struct paramed_type *T);
+int print_ds_constructor_input_file_location (struct tl_ds_input_file_location *DS, struct paramed_type *T);
+int print_ds_constructor_input_video_file_location (struct tl_ds_input_file_location *DS, struct paramed_type *T);
+int print_ds_constructor_input_encrypted_file_location (struct tl_ds_input_file_location *DS, struct paramed_type *T);
+int print_ds_constructor_input_audio_file_location (struct tl_ds_input_file_location *DS, struct paramed_type *T);
+int print_ds_constructor_input_document_file_location (struct tl_ds_input_file_location *DS, struct paramed_type *T);
+int print_ds_constructor_input_geo_chat (struct tl_ds_input_geo_chat *DS, struct paramed_type *T);
+int print_ds_constructor_input_geo_point_empty (struct tl_ds_input_geo_point *DS, struct paramed_type *T);
+int print_ds_constructor_input_geo_point (struct tl_ds_input_geo_point *DS, struct paramed_type *T);
+int print_ds_constructor_input_media_empty (struct tl_ds_input_media *DS, struct paramed_type *T);
+int print_ds_constructor_input_media_uploaded_photo (struct tl_ds_input_media *DS, struct paramed_type *T);
+int print_ds_constructor_input_media_photo (struct tl_ds_input_media *DS, struct paramed_type *T);
+int print_ds_constructor_input_media_geo_point (struct tl_ds_input_media *DS, struct paramed_type *T);
+int print_ds_constructor_input_media_contact (struct tl_ds_input_media *DS, struct paramed_type *T);
+int print_ds_constructor_input_media_uploaded_video (struct tl_ds_input_media *DS, struct paramed_type *T);
+int print_ds_constructor_input_media_uploaded_thumb_video (struct tl_ds_input_media *DS, struct paramed_type *T);
+int print_ds_constructor_input_media_video (struct tl_ds_input_media *DS, struct paramed_type *T);
+int print_ds_constructor_input_media_uploaded_audio (struct tl_ds_input_media *DS, struct paramed_type *T);
+int print_ds_constructor_input_media_audio (struct tl_ds_input_media *DS, struct paramed_type *T);
+int print_ds_constructor_input_media_uploaded_document (struct tl_ds_input_media *DS, struct paramed_type *T);
+int print_ds_constructor_input_media_uploaded_thumb_document (struct tl_ds_input_media *DS, struct paramed_type *T);
+int print_ds_constructor_input_media_document (struct tl_ds_input_media *DS, struct paramed_type *T);
+int print_ds_constructor_input_media_venue (struct tl_ds_input_media *DS, struct paramed_type *T);
+int print_ds_constructor_input_notify_peer (struct tl_ds_input_notify_peer *DS, struct paramed_type *T);
+int print_ds_constructor_input_notify_users (struct tl_ds_input_notify_peer *DS, struct paramed_type *T);
+int print_ds_constructor_input_notify_chats (struct tl_ds_input_notify_peer *DS, struct paramed_type *T);
+int print_ds_constructor_input_notify_all (struct tl_ds_input_notify_peer *DS, struct paramed_type *T);
+int print_ds_constructor_input_notify_geo_chat_peer (struct tl_ds_input_notify_peer *DS, struct paramed_type *T);
+int print_ds_constructor_input_peer_empty (struct tl_ds_input_peer *DS, struct paramed_type *T);
+int print_ds_constructor_input_peer_self (struct tl_ds_input_peer *DS, struct paramed_type *T);
+int print_ds_constructor_input_peer_contact (struct tl_ds_input_peer *DS, struct paramed_type *T);
+int print_ds_constructor_input_peer_foreign (struct tl_ds_input_peer *DS, struct paramed_type *T);
+int print_ds_constructor_input_peer_chat (struct tl_ds_input_peer *DS, struct paramed_type *T);
+int print_ds_constructor_input_peer_notify_events_empty (struct tl_ds_input_peer_notify_events *DS, struct paramed_type *T);
+int print_ds_constructor_input_peer_notify_events_all (struct tl_ds_input_peer_notify_events *DS, struct paramed_type *T);
+int print_ds_constructor_input_peer_notify_settings (struct tl_ds_input_peer_notify_settings *DS, struct paramed_type *T);
+int print_ds_constructor_input_photo_empty (struct tl_ds_input_photo *DS, struct paramed_type *T);
+int print_ds_constructor_input_photo (struct tl_ds_input_photo *DS, struct paramed_type *T);
+int print_ds_constructor_input_photo_crop_auto (struct tl_ds_input_photo_crop *DS, struct paramed_type *T);
+int print_ds_constructor_input_photo_crop (struct tl_ds_input_photo_crop *DS, struct paramed_type *T);
+int print_ds_constructor_input_privacy_key_status_timestamp (struct tl_ds_input_privacy_key *DS, struct paramed_type *T);
+int print_ds_constructor_input_privacy_value_allow_contacts (struct tl_ds_input_privacy_rule *DS, struct paramed_type *T);
+int print_ds_constructor_input_privacy_value_allow_all (struct tl_ds_input_privacy_rule *DS, struct paramed_type *T);
+int print_ds_constructor_input_privacy_value_allow_users (struct tl_ds_input_privacy_rule *DS, struct paramed_type *T);
+int print_ds_constructor_input_privacy_value_disallow_contacts (struct tl_ds_input_privacy_rule *DS, struct paramed_type *T);
+int print_ds_constructor_input_privacy_value_disallow_all (struct tl_ds_input_privacy_rule *DS, struct paramed_type *T);
+int print_ds_constructor_input_privacy_value_disallow_users (struct tl_ds_input_privacy_rule *DS, struct paramed_type *T);
+int print_ds_constructor_input_sticker_set_empty (struct tl_ds_input_sticker_set *DS, struct paramed_type *T);
+int print_ds_constructor_input_sticker_set_i_d (struct tl_ds_input_sticker_set *DS, struct paramed_type *T);
+int print_ds_constructor_input_sticker_set_short_name (struct tl_ds_input_sticker_set *DS, struct paramed_type *T);
+int print_ds_constructor_input_user_empty (struct tl_ds_input_user *DS, struct paramed_type *T);
+int print_ds_constructor_input_user_self (struct tl_ds_input_user *DS, struct paramed_type *T);
+int print_ds_constructor_input_user_contact (struct tl_ds_input_user *DS, struct paramed_type *T);
+int print_ds_constructor_input_user_foreign (struct tl_ds_input_user *DS, struct paramed_type *T);
+int print_ds_constructor_input_video_empty (struct tl_ds_input_video *DS, struct paramed_type *T);
+int print_ds_constructor_input_video (struct tl_ds_input_video *DS, struct paramed_type *T);
+int print_ds_constructor_int (int *DS, struct paramed_type *T);
+int print_ds_constructor_int128 (struct tl_ds_int128 *DS, struct paramed_type *T);
+int print_ds_constructor_int256 (struct tl_ds_int256 *DS, struct paramed_type *T);
+int print_ds_constructor_keyboard_button (struct tl_ds_keyboard_button *DS, struct paramed_type *T);
+int print_ds_constructor_keyboard_button_row (struct tl_ds_keyboard_button_row *DS, struct paramed_type *T);
+int print_ds_constructor_long (long long *DS, struct paramed_type *T);
+int print_ds_constructor_message_empty (struct tl_ds_message *DS, struct paramed_type *T);
+int print_ds_constructor_message (struct tl_ds_message *DS, struct paramed_type *T);
+int print_ds_constructor_message_service (struct tl_ds_message *DS, struct paramed_type *T);
+int print_ds_constructor_message_action_empty (struct tl_ds_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_message_action_chat_create (struct tl_ds_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_message_action_chat_edit_title (struct tl_ds_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_message_action_chat_edit_photo (struct tl_ds_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_message_action_chat_delete_photo (struct tl_ds_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_message_action_chat_add_user (struct tl_ds_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_message_action_chat_delete_user (struct tl_ds_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_message_action_geo_chat_create (struct tl_ds_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_message_action_geo_chat_checkin (struct tl_ds_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_message_action_chat_joined_by_link (struct tl_ds_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_message_media_empty (struct tl_ds_message_media *DS, struct paramed_type *T);
+int print_ds_constructor_message_media_photo (struct tl_ds_message_media *DS, struct paramed_type *T);
+int print_ds_constructor_message_media_video (struct tl_ds_message_media *DS, struct paramed_type *T);
+int print_ds_constructor_message_media_geo (struct tl_ds_message_media *DS, struct paramed_type *T);
+int print_ds_constructor_message_media_contact (struct tl_ds_message_media *DS, struct paramed_type *T);
+int print_ds_constructor_message_media_unsupported (struct tl_ds_message_media *DS, struct paramed_type *T);
+int print_ds_constructor_message_media_document (struct tl_ds_message_media *DS, struct paramed_type *T);
+int print_ds_constructor_message_media_audio (struct tl_ds_message_media *DS, struct paramed_type *T);
+int print_ds_constructor_message_media_web_page (struct tl_ds_message_media *DS, struct paramed_type *T);
+int print_ds_constructor_message_media_venue (struct tl_ds_message_media *DS, struct paramed_type *T);
+int print_ds_constructor_message_media_photo_l27 (struct tl_ds_message_media *DS, struct paramed_type *T);
+int print_ds_constructor_message_media_video_l27 (struct tl_ds_message_media *DS, struct paramed_type *T);
+int print_ds_constructor_input_messages_filter_empty (struct tl_ds_messages_filter *DS, struct paramed_type *T);
+int print_ds_constructor_input_messages_filter_photos (struct tl_ds_messages_filter *DS, struct paramed_type *T);
+int print_ds_constructor_input_messages_filter_video (struct tl_ds_messages_filter *DS, struct paramed_type *T);
+int print_ds_constructor_input_messages_filter_photo_video (struct tl_ds_messages_filter *DS, struct paramed_type *T);
+int print_ds_constructor_input_messages_filter_photo_video_documents (struct tl_ds_messages_filter *DS, struct paramed_type *T);
+int print_ds_constructor_input_messages_filter_document (struct tl_ds_messages_filter *DS, struct paramed_type *T);
+int print_ds_constructor_input_messages_filter_audio (struct tl_ds_messages_filter *DS, struct paramed_type *T);
+int print_ds_constructor_nearest_dc (struct tl_ds_nearest_dc *DS, struct paramed_type *T);
+int print_ds_constructor_notify_peer (struct tl_ds_notify_peer *DS, struct paramed_type *T);
+int print_ds_constructor_notify_users (struct tl_ds_notify_peer *DS, struct paramed_type *T);
+int print_ds_constructor_notify_chats (struct tl_ds_notify_peer *DS, struct paramed_type *T);
+int print_ds_constructor_notify_all (struct tl_ds_notify_peer *DS, struct paramed_type *T);
+int print_ds_constructor_null (struct tl_ds_null *DS, struct paramed_type *T);
+int print_ds_constructor_p_q_inner_data (struct tl_ds_p_q_inner_data *DS, struct paramed_type *T);
+int print_ds_constructor_p_q_inner_data_temp (struct tl_ds_p_q_inner_data *DS, struct paramed_type *T);
+int print_ds_constructor_peer_user (struct tl_ds_peer *DS, struct paramed_type *T);
+int print_ds_constructor_peer_chat (struct tl_ds_peer *DS, struct paramed_type *T);
+int print_ds_constructor_peer_notify_events_empty (struct tl_ds_peer_notify_events *DS, struct paramed_type *T);
+int print_ds_constructor_peer_notify_events_all (struct tl_ds_peer_notify_events *DS, struct paramed_type *T);
+int print_ds_constructor_peer_notify_settings_empty (struct tl_ds_peer_notify_settings *DS, struct paramed_type *T);
+int print_ds_constructor_peer_notify_settings (struct tl_ds_peer_notify_settings *DS, struct paramed_type *T);
+int print_ds_constructor_photo_empty (struct tl_ds_photo *DS, struct paramed_type *T);
+int print_ds_constructor_photo (struct tl_ds_photo *DS, struct paramed_type *T);
+int print_ds_constructor_photo_l27 (struct tl_ds_photo *DS, struct paramed_type *T);
+int print_ds_constructor_photo_size_empty (struct tl_ds_photo_size *DS, struct paramed_type *T);
+int print_ds_constructor_photo_size (struct tl_ds_photo_size *DS, struct paramed_type *T);
+int print_ds_constructor_photo_cached_size (struct tl_ds_photo_size *DS, struct paramed_type *T);
+int print_ds_constructor_privacy_key_status_timestamp (struct tl_ds_privacy_key *DS, struct paramed_type *T);
+int print_ds_constructor_privacy_value_allow_contacts (struct tl_ds_privacy_rule *DS, struct paramed_type *T);
+int print_ds_constructor_privacy_value_allow_all (struct tl_ds_privacy_rule *DS, struct paramed_type *T);
+int print_ds_constructor_privacy_value_allow_users (struct tl_ds_privacy_rule *DS, struct paramed_type *T);
+int print_ds_constructor_privacy_value_disallow_contacts (struct tl_ds_privacy_rule *DS, struct paramed_type *T);
+int print_ds_constructor_privacy_value_disallow_all (struct tl_ds_privacy_rule *DS, struct paramed_type *T);
+int print_ds_constructor_privacy_value_disallow_users (struct tl_ds_privacy_rule *DS, struct paramed_type *T);
+int print_ds_constructor_received_notify_message (struct tl_ds_received_notify_message *DS, struct paramed_type *T);
+int print_ds_constructor_reply_keyboard_hide (struct tl_ds_reply_markup *DS, struct paramed_type *T);
+int print_ds_constructor_reply_keyboard_force_reply (struct tl_ds_reply_markup *DS, struct paramed_type *T);
+int print_ds_constructor_reply_keyboard_markup (struct tl_ds_reply_markup *DS, struct paramed_type *T);
+int print_ds_constructor_res_p_q (struct tl_ds_res_p_q *DS, struct paramed_type *T);
+int print_ds_constructor_send_message_typing_action (struct tl_ds_send_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_send_message_cancel_action (struct tl_ds_send_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_send_message_record_video_action (struct tl_ds_send_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_send_message_upload_video_action_l27 (struct tl_ds_send_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_send_message_upload_video_action (struct tl_ds_send_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_send_message_record_audio_action (struct tl_ds_send_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_send_message_upload_audio_action_l27 (struct tl_ds_send_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_send_message_upload_audio_action (struct tl_ds_send_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_send_message_upload_photo_action (struct tl_ds_send_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_send_message_upload_document_action_l27 (struct tl_ds_send_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_send_message_upload_document_action (struct tl_ds_send_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_send_message_geo_location_action (struct tl_ds_send_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_send_message_choose_contact_action (struct tl_ds_send_message_action *DS, struct paramed_type *T);
+int print_ds_constructor_server_d_h_params_fail (struct tl_ds_server_d_h_params *DS, struct paramed_type *T);
+int print_ds_constructor_server_d_h_params_ok (struct tl_ds_server_d_h_params *DS, struct paramed_type *T);
+int print_ds_constructor_server_d_h_inner_data (struct tl_ds_server_d_h_inner_data *DS, struct paramed_type *T);
+int print_ds_constructor_dh_gen_ok (struct tl_ds_set_client_d_h_params_answer *DS, struct paramed_type *T);
+int print_ds_constructor_dh_gen_retry (struct tl_ds_set_client_d_h_params_answer *DS, struct paramed_type *T);
+int print_ds_constructor_dh_gen_fail (struct tl_ds_set_client_d_h_params_answer *DS, struct paramed_type *T);
+int print_ds_constructor_sticker_pack (struct tl_ds_sticker_pack *DS, struct paramed_type *T);
+int print_ds_constructor_sticker_set (struct tl_ds_sticker_set *DS, struct paramed_type *T);
+int print_ds_constructor_string (struct tl_ds_string *DS, struct paramed_type *T);
+int print_ds_constructor_update_new_message (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_message_i_d (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_delete_messages (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_user_typing (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_chat_user_typing (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_chat_participants (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_user_status (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_user_name (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_user_photo (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_contact_registered (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_contact_link (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_new_authorization (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_new_geo_chat_message (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_new_encrypted_message (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_encrypted_chat_typing (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_encryption (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_encrypted_messages_read (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_chat_participant_add (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_chat_participant_delete (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_dc_options (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_user_blocked (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_notify_settings (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_service_notification (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_privacy (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_user_phone (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_read_history_inbox (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_read_history_outbox (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_web_page (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_read_messages_contents (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_update_msg_update (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_constructor_updates_too_long (struct tl_ds_updates *DS, struct paramed_type *T);
+int print_ds_constructor_update_short_message (struct tl_ds_updates *DS, struct paramed_type *T);
+int print_ds_constructor_update_short_chat_message (struct tl_ds_updates *DS, struct paramed_type *T);
+int print_ds_constructor_update_short (struct tl_ds_updates *DS, struct paramed_type *T);
+int print_ds_constructor_updates_combined (struct tl_ds_updates *DS, struct paramed_type *T);
+int print_ds_constructor_updates (struct tl_ds_updates *DS, struct paramed_type *T);
+int print_ds_constructor_user_empty (struct tl_ds_user *DS, struct paramed_type *T);
+int print_ds_constructor_user (struct tl_ds_user *DS, struct paramed_type *T);
+int print_ds_constructor_user_full (struct tl_ds_user_full *DS, struct paramed_type *T);
+int print_ds_constructor_user_profile_photo_empty (struct tl_ds_user_profile_photo *DS, struct paramed_type *T);
+int print_ds_constructor_user_profile_photo (struct tl_ds_user_profile_photo *DS, struct paramed_type *T);
+int print_ds_constructor_user_status_empty (struct tl_ds_user_status *DS, struct paramed_type *T);
+int print_ds_constructor_user_status_online (struct tl_ds_user_status *DS, struct paramed_type *T);
+int print_ds_constructor_user_status_offline (struct tl_ds_user_status *DS, struct paramed_type *T);
+int print_ds_constructor_user_status_recently (struct tl_ds_user_status *DS, struct paramed_type *T);
+int print_ds_constructor_user_status_last_week (struct tl_ds_user_status *DS, struct paramed_type *T);
+int print_ds_constructor_user_status_last_month (struct tl_ds_user_status *DS, struct paramed_type *T);
+int print_ds_constructor_vector (struct tl_ds_vector *DS, struct paramed_type *T);
+int print_ds_constructor_video_empty (struct tl_ds_video *DS, struct paramed_type *T);
+int print_ds_constructor_video (struct tl_ds_video *DS, struct paramed_type *T);
+int print_ds_constructor_video_l27 (struct tl_ds_video *DS, struct paramed_type *T);
+int print_ds_constructor_wall_paper (struct tl_ds_wall_paper *DS, struct paramed_type *T);
+int print_ds_constructor_wall_paper_solid (struct tl_ds_wall_paper *DS, struct paramed_type *T);
+int print_ds_constructor_web_page_empty (struct tl_ds_web_page *DS, struct paramed_type *T);
+int print_ds_constructor_web_page_pending (struct tl_ds_web_page *DS, struct paramed_type *T);
+int print_ds_constructor_web_page (struct tl_ds_web_page *DS, struct paramed_type *T);
+int print_ds_constructor_account_authorizations (struct tl_ds_account_authorizations *DS, struct paramed_type *T);
+int print_ds_constructor_account_no_password (struct tl_ds_account_password *DS, struct paramed_type *T);
+int print_ds_constructor_account_password (struct tl_ds_account_password *DS, struct paramed_type *T);
+int print_ds_constructor_account_password_input_settings (struct tl_ds_account_password_input_settings *DS, struct paramed_type *T);
+int print_ds_constructor_account_password_settings (struct tl_ds_account_password_settings *DS, struct paramed_type *T);
+int print_ds_constructor_account_privacy_rules (struct tl_ds_account_privacy_rules *DS, struct paramed_type *T);
+int print_ds_constructor_account_sent_change_phone_code (struct tl_ds_account_sent_change_phone_code *DS, struct paramed_type *T);
+int print_ds_constructor_auth_authorization (struct tl_ds_auth_authorization *DS, struct paramed_type *T);
+int print_ds_constructor_auth_checked_phone (struct tl_ds_auth_checked_phone *DS, struct paramed_type *T);
+int print_ds_constructor_auth_exported_authorization (struct tl_ds_auth_exported_authorization *DS, struct paramed_type *T);
+int print_ds_constructor_auth_password_recovery (struct tl_ds_auth_password_recovery *DS, struct paramed_type *T);
+int print_ds_constructor_auth_sent_code (struct tl_ds_auth_sent_code *DS, struct paramed_type *T);
+int print_ds_constructor_auth_sent_app_code (struct tl_ds_auth_sent_code *DS, struct paramed_type *T);
+int print_ds_constructor_binlog_encr_key (struct tl_ds_binlog_encr_key *DS, struct paramed_type *T);
+int print_ds_constructor_binlog_start (struct tl_ds_binlog_update *DS, struct paramed_type *T);
+int print_ds_constructor_binlog_dc_option (struct tl_ds_binlog_update *DS, struct paramed_type *T);
+int print_ds_constructor_binlog_dc_option_new (struct tl_ds_binlog_update *DS, struct paramed_type *T);
+int print_ds_constructor_binlog_auth_key (struct tl_ds_binlog_update *DS, struct paramed_type *T);
+int print_ds_constructor_binlog_default_dc (struct tl_ds_binlog_update *DS, struct paramed_type *T);
+int print_ds_constructor_binlog_dc_signed (struct tl_ds_binlog_update *DS, struct paramed_type *T);
+int print_ds_constructor_binlog_our_id (struct tl_ds_binlog_update *DS, struct paramed_type *T);
+int print_ds_constructor_binlog_set_dh_params (struct tl_ds_binlog_update *DS, struct paramed_type *T);
+int print_ds_constructor_binlog_set_pts (struct tl_ds_binlog_update *DS, struct paramed_type *T);
+int print_ds_constructor_binlog_set_qts (struct tl_ds_binlog_update *DS, struct paramed_type *T);
+int print_ds_constructor_binlog_set_date (struct tl_ds_binlog_update *DS, struct paramed_type *T);
+int print_ds_constructor_binlog_set_seq (struct tl_ds_binlog_update *DS, struct paramed_type *T);
+int print_ds_constructor_binlog_encr_chat_delete (struct tl_ds_binlog_update *DS, struct paramed_type *T);
+int print_ds_constructor_binlog_encr_chat_new (struct tl_ds_binlog_update *DS, struct paramed_type *T);
+int print_ds_constructor_binlog_encr_chat_exchange_new (struct tl_ds_binlog_update *DS, struct paramed_type *T);
+int print_ds_constructor_binlog_user_delete (struct tl_ds_binlog_update *DS, struct paramed_type *T);
+int print_ds_constructor_binlog_user_new (struct tl_ds_binlog_update *DS, struct paramed_type *T);
+int print_ds_constructor_binlog_chat_new (struct tl_ds_binlog_update *DS, struct paramed_type *T);
+int print_ds_constructor_binlog_chat_add_participant (struct tl_ds_binlog_update *DS, struct paramed_type *T);
+int print_ds_constructor_binlog_chat_del_participant (struct tl_ds_binlog_update *DS, struct paramed_type *T);
+int print_ds_constructor_binlog_set_msg_id (struct tl_ds_binlog_update *DS, struct paramed_type *T);
+int print_ds_constructor_binlog_message_delete (struct tl_ds_binlog_update *DS, struct paramed_type *T);
+int print_ds_constructor_binlog_message_new (struct tl_ds_binlog_update *DS, struct paramed_type *T);
+int print_ds_constructor_binlog_message_encr_new (struct tl_ds_binlog_update *DS, struct paramed_type *T);
+int print_ds_constructor_binlog_msg_update (struct tl_ds_binlog_update *DS, struct paramed_type *T);
+int print_ds_constructor_binlog_reset_authorization (struct tl_ds_binlog_update *DS, struct paramed_type *T);
+int print_ds_constructor_contacts_blocked (struct tl_ds_contacts_blocked *DS, struct paramed_type *T);
+int print_ds_constructor_contacts_blocked_slice (struct tl_ds_contacts_blocked *DS, struct paramed_type *T);
+int print_ds_constructor_contacts_contacts_not_modified (struct tl_ds_contacts_contacts *DS, struct paramed_type *T);
+int print_ds_constructor_contacts_contacts (struct tl_ds_contacts_contacts *DS, struct paramed_type *T);
+int print_ds_constructor_contacts_found (struct tl_ds_contacts_found *DS, struct paramed_type *T);
+int print_ds_constructor_contacts_imported_contacts (struct tl_ds_contacts_imported_contacts *DS, struct paramed_type *T);
+int print_ds_constructor_contacts_link (struct tl_ds_contacts_link *DS, struct paramed_type *T);
+int print_ds_constructor_contacts_suggested (struct tl_ds_contacts_suggested *DS, struct paramed_type *T);
+int print_ds_constructor_geochats_located (struct tl_ds_geochats_located *DS, struct paramed_type *T);
+int print_ds_constructor_geochats_messages (struct tl_ds_geochats_messages *DS, struct paramed_type *T);
+int print_ds_constructor_geochats_messages_slice (struct tl_ds_geochats_messages *DS, struct paramed_type *T);
+int print_ds_constructor_geochats_stated_message (struct tl_ds_geochats_stated_message *DS, struct paramed_type *T);
+int print_ds_constructor_help_app_update (struct tl_ds_help_app_update *DS, struct paramed_type *T);
+int print_ds_constructor_help_no_app_update (struct tl_ds_help_app_update *DS, struct paramed_type *T);
+int print_ds_constructor_help_invite_text (struct tl_ds_help_invite_text *DS, struct paramed_type *T);
+int print_ds_constructor_help_support (struct tl_ds_help_support *DS, struct paramed_type *T);
+int print_ds_constructor_messages_affected_history (struct tl_ds_messages_affected_history *DS, struct paramed_type *T);
+int print_ds_constructor_messages_affected_messages (struct tl_ds_messages_affected_messages *DS, struct paramed_type *T);
+int print_ds_constructor_messages_all_stickers_not_modified (struct tl_ds_messages_all_stickers *DS, struct paramed_type *T);
+int print_ds_constructor_messages_all_stickers (struct tl_ds_messages_all_stickers *DS, struct paramed_type *T);
+int print_ds_constructor_messages_chat_full (struct tl_ds_messages_chat_full *DS, struct paramed_type *T);
+int print_ds_constructor_messages_chats (struct tl_ds_messages_chats *DS, struct paramed_type *T);
+int print_ds_constructor_messages_dh_config_not_modified (struct tl_ds_messages_dh_config *DS, struct paramed_type *T);
+int print_ds_constructor_messages_dh_config (struct tl_ds_messages_dh_config *DS, struct paramed_type *T);
+int print_ds_constructor_messages_dialogs (struct tl_ds_messages_dialogs *DS, struct paramed_type *T);
+int print_ds_constructor_messages_dialogs_slice (struct tl_ds_messages_dialogs *DS, struct paramed_type *T);
+int print_ds_constructor_messages_message_empty (struct tl_ds_messages_message *DS, struct paramed_type *T);
+int print_ds_constructor_messages_messages (struct tl_ds_messages_messages *DS, struct paramed_type *T);
+int print_ds_constructor_messages_messages_slice (struct tl_ds_messages_messages *DS, struct paramed_type *T);
+int print_ds_constructor_messages_sent_encrypted_message (struct tl_ds_messages_sent_encrypted_message *DS, struct paramed_type *T);
+int print_ds_constructor_messages_sent_encrypted_file (struct tl_ds_messages_sent_encrypted_message *DS, struct paramed_type *T);
+int print_ds_constructor_messages_sent_message (struct tl_ds_messages_sent_message *DS, struct paramed_type *T);
+int print_ds_constructor_messages_sent_message_link (struct tl_ds_messages_sent_message *DS, struct paramed_type *T);
+int print_ds_constructor_messages_sticker_set (struct tl_ds_messages_sticker_set *DS, struct paramed_type *T);
+int print_ds_constructor_messages_stickers_not_modified (struct tl_ds_messages_stickers *DS, struct paramed_type *T);
+int print_ds_constructor_messages_stickers (struct tl_ds_messages_stickers *DS, struct paramed_type *T);
+int print_ds_constructor_photos_photo (struct tl_ds_photos_photo *DS, struct paramed_type *T);
+int print_ds_constructor_photos_photos (struct tl_ds_photos_photos *DS, struct paramed_type *T);
+int print_ds_constructor_photos_photos_slice (struct tl_ds_photos_photos *DS, struct paramed_type *T);
+int print_ds_constructor_storage_file_unknown (struct tl_ds_storage_file_type *DS, struct paramed_type *T);
+int print_ds_constructor_storage_file_jpeg (struct tl_ds_storage_file_type *DS, struct paramed_type *T);
+int print_ds_constructor_storage_file_gif (struct tl_ds_storage_file_type *DS, struct paramed_type *T);
+int print_ds_constructor_storage_file_png (struct tl_ds_storage_file_type *DS, struct paramed_type *T);
+int print_ds_constructor_storage_file_pdf (struct tl_ds_storage_file_type *DS, struct paramed_type *T);
+int print_ds_constructor_storage_file_mp3 (struct tl_ds_storage_file_type *DS, struct paramed_type *T);
+int print_ds_constructor_storage_file_mov (struct tl_ds_storage_file_type *DS, struct paramed_type *T);
+int print_ds_constructor_storage_file_partial (struct tl_ds_storage_file_type *DS, struct paramed_type *T);
+int print_ds_constructor_storage_file_mp4 (struct tl_ds_storage_file_type *DS, struct paramed_type *T);
+int print_ds_constructor_storage_file_webp (struct tl_ds_storage_file_type *DS, struct paramed_type *T);
+int print_ds_constructor_updates_difference_empty (struct tl_ds_updates_difference *DS, struct paramed_type *T);
+int print_ds_constructor_updates_difference (struct tl_ds_updates_difference *DS, struct paramed_type *T);
+int print_ds_constructor_updates_difference_slice (struct tl_ds_updates_difference *DS, struct paramed_type *T);
+int print_ds_constructor_updates_state (struct tl_ds_updates_state *DS, struct paramed_type *T);
+int print_ds_constructor_upload_file (struct tl_ds_upload_file *DS, struct paramed_type *T);
+int print_ds_type_account_days_t_t_l (struct tl_ds_account_days_t_t_l *DS, struct paramed_type *T);
+int print_ds_type_bare_account_days_t_t_l (struct tl_ds_account_days_t_t_l *DS, struct paramed_type *T);
+int print_ds_type_audio (struct tl_ds_audio *DS, struct paramed_type *T);
+int print_ds_type_bare_audio (struct tl_ds_audio *DS, struct paramed_type *T);
+int print_ds_type_authorization (struct tl_ds_authorization *DS, struct paramed_type *T);
+int print_ds_type_bare_authorization (struct tl_ds_authorization *DS, struct paramed_type *T);
+int print_ds_type_bool (struct tl_ds_bool *DS, struct paramed_type *T);
+int print_ds_type_bare_bool (struct tl_ds_bool *DS, struct paramed_type *T);
+int print_ds_type_bot_command (struct tl_ds_bot_command *DS, struct paramed_type *T);
+int print_ds_type_bare_bot_command (struct tl_ds_bot_command *DS, struct paramed_type *T);
+int print_ds_type_bot_info (struct tl_ds_bot_info *DS, struct paramed_type *T);
+int print_ds_type_bare_bot_info (struct tl_ds_bot_info *DS, struct paramed_type *T);
+int print_ds_type_bytes (struct tl_ds_string *DS, struct paramed_type *T);
+int print_ds_type_bare_bytes (struct tl_ds_string *DS, struct paramed_type *T);
+int print_ds_type_chat (struct tl_ds_chat *DS, struct paramed_type *T);
+int print_ds_type_bare_chat (struct tl_ds_chat *DS, struct paramed_type *T);
+int print_ds_type_chat_full (struct tl_ds_chat_full *DS, struct paramed_type *T);
+int print_ds_type_bare_chat_full (struct tl_ds_chat_full *DS, struct paramed_type *T);
+int print_ds_type_chat_invite (struct tl_ds_chat_invite *DS, struct paramed_type *T);
+int print_ds_type_bare_chat_invite (struct tl_ds_chat_invite *DS, struct paramed_type *T);
+int print_ds_type_chat_located (struct tl_ds_chat_located *DS, struct paramed_type *T);
+int print_ds_type_bare_chat_located (struct tl_ds_chat_located *DS, struct paramed_type *T);
+int print_ds_type_chat_participant (struct tl_ds_chat_participant *DS, struct paramed_type *T);
+int print_ds_type_bare_chat_participant (struct tl_ds_chat_participant *DS, struct paramed_type *T);
+int print_ds_type_chat_participants (struct tl_ds_chat_participants *DS, struct paramed_type *T);
+int print_ds_type_bare_chat_participants (struct tl_ds_chat_participants *DS, struct paramed_type *T);
+int print_ds_type_chat_photo (struct tl_ds_chat_photo *DS, struct paramed_type *T);
+int print_ds_type_bare_chat_photo (struct tl_ds_chat_photo *DS, struct paramed_type *T);
+int print_ds_type_client_d_h_inner_data (struct tl_ds_client_d_h_inner_data *DS, struct paramed_type *T);
+int print_ds_type_bare_client_d_h_inner_data (struct tl_ds_client_d_h_inner_data *DS, struct paramed_type *T);
+int print_ds_type_config (struct tl_ds_config *DS, struct paramed_type *T);
+int print_ds_type_bare_config (struct tl_ds_config *DS, struct paramed_type *T);
+int print_ds_type_contact (struct tl_ds_contact *DS, struct paramed_type *T);
+int print_ds_type_bare_contact (struct tl_ds_contact *DS, struct paramed_type *T);
+int print_ds_type_contact_blocked (struct tl_ds_contact_blocked *DS, struct paramed_type *T);
+int print_ds_type_bare_contact_blocked (struct tl_ds_contact_blocked *DS, struct paramed_type *T);
+int print_ds_type_contact_found (struct tl_ds_contact_found *DS, struct paramed_type *T);
+int print_ds_type_bare_contact_found (struct tl_ds_contact_found *DS, struct paramed_type *T);
+int print_ds_type_contact_link (struct tl_ds_contact_link *DS, struct paramed_type *T);
+int print_ds_type_bare_contact_link (struct tl_ds_contact_link *DS, struct paramed_type *T);
+int print_ds_type_contact_status (struct tl_ds_contact_status *DS, struct paramed_type *T);
+int print_ds_type_bare_contact_status (struct tl_ds_contact_status *DS, struct paramed_type *T);
+int print_ds_type_contact_suggested (struct tl_ds_contact_suggested *DS, struct paramed_type *T);
+int print_ds_type_bare_contact_suggested (struct tl_ds_contact_suggested *DS, struct paramed_type *T);
+int print_ds_type_dc_option (struct tl_ds_dc_option *DS, struct paramed_type *T);
+int print_ds_type_bare_dc_option (struct tl_ds_dc_option *DS, struct paramed_type *T);
+int print_ds_type_decrypted_message (struct tl_ds_decrypted_message *DS, struct paramed_type *T);
+int print_ds_type_bare_decrypted_message (struct tl_ds_decrypted_message *DS, struct paramed_type *T);
+int print_ds_type_decrypted_message_action (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T);
+int print_ds_type_bare_decrypted_message_action (struct tl_ds_decrypted_message_action *DS, struct paramed_type *T);
+int print_ds_type_decrypted_message_layer (struct tl_ds_decrypted_message_layer *DS, struct paramed_type *T);
+int print_ds_type_bare_decrypted_message_layer (struct tl_ds_decrypted_message_layer *DS, struct paramed_type *T);
+int print_ds_type_decrypted_message_media (struct tl_ds_decrypted_message_media *DS, struct paramed_type *T);
+int print_ds_type_bare_decrypted_message_media (struct tl_ds_decrypted_message_media *DS, struct paramed_type *T);
+int print_ds_type_dialog (struct tl_ds_dialog *DS, struct paramed_type *T);
+int print_ds_type_bare_dialog (struct tl_ds_dialog *DS, struct paramed_type *T);
+int print_ds_type_disabled_feature (struct tl_ds_disabled_feature *DS, struct paramed_type *T);
+int print_ds_type_bare_disabled_feature (struct tl_ds_disabled_feature *DS, struct paramed_type *T);
+int print_ds_type_document (struct tl_ds_document *DS, struct paramed_type *T);
+int print_ds_type_bare_document (struct tl_ds_document *DS, struct paramed_type *T);
+int print_ds_type_document_attribute (struct tl_ds_document_attribute *DS, struct paramed_type *T);
+int print_ds_type_bare_document_attribute (struct tl_ds_document_attribute *DS, struct paramed_type *T);
+int print_ds_type_double (double *DS, struct paramed_type *T);
+int print_ds_type_bare_double (double *DS, struct paramed_type *T);
+int print_ds_type_encrypted_chat (struct tl_ds_encrypted_chat *DS, struct paramed_type *T);
+int print_ds_type_bare_encrypted_chat (struct tl_ds_encrypted_chat *DS, struct paramed_type *T);
+int print_ds_type_encrypted_file (struct tl_ds_encrypted_file *DS, struct paramed_type *T);
+int print_ds_type_bare_encrypted_file (struct tl_ds_encrypted_file *DS, struct paramed_type *T);
+int print_ds_type_encrypted_message (struct tl_ds_encrypted_message *DS, struct paramed_type *T);
+int print_ds_type_bare_encrypted_message (struct tl_ds_encrypted_message *DS, struct paramed_type *T);
+int print_ds_type_error (struct tl_ds_error *DS, struct paramed_type *T);
+int print_ds_type_bare_error (struct tl_ds_error *DS, struct paramed_type *T);
+int print_ds_type_exported_chat_invite (struct tl_ds_exported_chat_invite *DS, struct paramed_type *T);
+int print_ds_type_bare_exported_chat_invite (struct tl_ds_exported_chat_invite *DS, struct paramed_type *T);
+int print_ds_type_file_location (struct tl_ds_file_location *DS, struct paramed_type *T);
+int print_ds_type_bare_file_location (struct tl_ds_file_location *DS, struct paramed_type *T);
+int print_ds_type_geo_chat_message (struct tl_ds_geo_chat_message *DS, struct paramed_type *T);
+int print_ds_type_bare_geo_chat_message (struct tl_ds_geo_chat_message *DS, struct paramed_type *T);
+int print_ds_type_geo_point (struct tl_ds_geo_point *DS, struct paramed_type *T);
+int print_ds_type_bare_geo_point (struct tl_ds_geo_point *DS, struct paramed_type *T);
+int print_ds_type_imported_contact (struct tl_ds_imported_contact *DS, struct paramed_type *T);
+int print_ds_type_bare_imported_contact (struct tl_ds_imported_contact *DS, struct paramed_type *T);
+int print_ds_type_input_app_event (struct tl_ds_input_app_event *DS, struct paramed_type *T);
+int print_ds_type_bare_input_app_event (struct tl_ds_input_app_event *DS, struct paramed_type *T);
+int print_ds_type_input_audio (struct tl_ds_input_audio *DS, struct paramed_type *T);
+int print_ds_type_bare_input_audio (struct tl_ds_input_audio *DS, struct paramed_type *T);
+int print_ds_type_input_chat_photo (struct tl_ds_input_chat_photo *DS, struct paramed_type *T);
+int print_ds_type_bare_input_chat_photo (struct tl_ds_input_chat_photo *DS, struct paramed_type *T);
+int print_ds_type_input_contact (struct tl_ds_input_contact *DS, struct paramed_type *T);
+int print_ds_type_bare_input_contact (struct tl_ds_input_contact *DS, struct paramed_type *T);
+int print_ds_type_input_document (struct tl_ds_input_document *DS, struct paramed_type *T);
+int print_ds_type_bare_input_document (struct tl_ds_input_document *DS, struct paramed_type *T);
+int print_ds_type_input_encrypted_chat (struct tl_ds_input_encrypted_chat *DS, struct paramed_type *T);
+int print_ds_type_bare_input_encrypted_chat (struct tl_ds_input_encrypted_chat *DS, struct paramed_type *T);
+int print_ds_type_input_encrypted_file (struct tl_ds_input_encrypted_file *DS, struct paramed_type *T);
+int print_ds_type_bare_input_encrypted_file (struct tl_ds_input_encrypted_file *DS, struct paramed_type *T);
+int print_ds_type_input_file (struct tl_ds_input_file *DS, struct paramed_type *T);
+int print_ds_type_bare_input_file (struct tl_ds_input_file *DS, struct paramed_type *T);
+int print_ds_type_input_file_location (struct tl_ds_input_file_location *DS, struct paramed_type *T);
+int print_ds_type_bare_input_file_location (struct tl_ds_input_file_location *DS, struct paramed_type *T);
+int print_ds_type_input_geo_chat (struct tl_ds_input_geo_chat *DS, struct paramed_type *T);
+int print_ds_type_bare_input_geo_chat (struct tl_ds_input_geo_chat *DS, struct paramed_type *T);
+int print_ds_type_input_geo_point (struct tl_ds_input_geo_point *DS, struct paramed_type *T);
+int print_ds_type_bare_input_geo_point (struct tl_ds_input_geo_point *DS, struct paramed_type *T);
+int print_ds_type_input_media (struct tl_ds_input_media *DS, struct paramed_type *T);
+int print_ds_type_bare_input_media (struct tl_ds_input_media *DS, struct paramed_type *T);
+int print_ds_type_input_notify_peer (struct tl_ds_input_notify_peer *DS, struct paramed_type *T);
+int print_ds_type_bare_input_notify_peer (struct tl_ds_input_notify_peer *DS, struct paramed_type *T);
+int print_ds_type_input_peer (struct tl_ds_input_peer *DS, struct paramed_type *T);
+int print_ds_type_bare_input_peer (struct tl_ds_input_peer *DS, struct paramed_type *T);
+int print_ds_type_input_peer_notify_events (struct tl_ds_input_peer_notify_events *DS, struct paramed_type *T);
+int print_ds_type_bare_input_peer_notify_events (struct tl_ds_input_peer_notify_events *DS, struct paramed_type *T);
+int print_ds_type_input_peer_notify_settings (struct tl_ds_input_peer_notify_settings *DS, struct paramed_type *T);
+int print_ds_type_bare_input_peer_notify_settings (struct tl_ds_input_peer_notify_settings *DS, struct paramed_type *T);
+int print_ds_type_input_photo (struct tl_ds_input_photo *DS, struct paramed_type *T);
+int print_ds_type_bare_input_photo (struct tl_ds_input_photo *DS, struct paramed_type *T);
+int print_ds_type_input_photo_crop (struct tl_ds_input_photo_crop *DS, struct paramed_type *T);
+int print_ds_type_bare_input_photo_crop (struct tl_ds_input_photo_crop *DS, struct paramed_type *T);
+int print_ds_type_input_privacy_key (struct tl_ds_input_privacy_key *DS, struct paramed_type *T);
+int print_ds_type_bare_input_privacy_key (struct tl_ds_input_privacy_key *DS, struct paramed_type *T);
+int print_ds_type_input_privacy_rule (struct tl_ds_input_privacy_rule *DS, struct paramed_type *T);
+int print_ds_type_bare_input_privacy_rule (struct tl_ds_input_privacy_rule *DS, struct paramed_type *T);
+int print_ds_type_input_sticker_set (struct tl_ds_input_sticker_set *DS, struct paramed_type *T);
+int print_ds_type_bare_input_sticker_set (struct tl_ds_input_sticker_set *DS, struct paramed_type *T);
+int print_ds_type_input_user (struct tl_ds_input_user *DS, struct paramed_type *T);
+int print_ds_type_bare_input_user (struct tl_ds_input_user *DS, struct paramed_type *T);
+int print_ds_type_input_video (struct tl_ds_input_video *DS, struct paramed_type *T);
+int print_ds_type_bare_input_video (struct tl_ds_input_video *DS, struct paramed_type *T);
+int print_ds_type_int (int *DS, struct paramed_type *T);
+int print_ds_type_bare_int (int *DS, struct paramed_type *T);
+int print_ds_type_int128 (struct tl_ds_int128 *DS, struct paramed_type *T);
+int print_ds_type_bare_int128 (struct tl_ds_int128 *DS, struct paramed_type *T);
+int print_ds_type_int256 (struct tl_ds_int256 *DS, struct paramed_type *T);
+int print_ds_type_bare_int256 (struct tl_ds_int256 *DS, struct paramed_type *T);
+int print_ds_type_keyboard_button (struct tl_ds_keyboard_button *DS, struct paramed_type *T);
+int print_ds_type_bare_keyboard_button (struct tl_ds_keyboard_button *DS, struct paramed_type *T);
+int print_ds_type_keyboard_button_row (struct tl_ds_keyboard_button_row *DS, struct paramed_type *T);
+int print_ds_type_bare_keyboard_button_row (struct tl_ds_keyboard_button_row *DS, struct paramed_type *T);
+int print_ds_type_long (long long *DS, struct paramed_type *T);
+int print_ds_type_bare_long (long long *DS, struct paramed_type *T);
+int print_ds_type_message (struct tl_ds_message *DS, struct paramed_type *T);
+int print_ds_type_bare_message (struct tl_ds_message *DS, struct paramed_type *T);
+int print_ds_type_message_action (struct tl_ds_message_action *DS, struct paramed_type *T);
+int print_ds_type_bare_message_action (struct tl_ds_message_action *DS, struct paramed_type *T);
+int print_ds_type_message_media (struct tl_ds_message_media *DS, struct paramed_type *T);
+int print_ds_type_bare_message_media (struct tl_ds_message_media *DS, struct paramed_type *T);
+int print_ds_type_messages_filter (struct tl_ds_messages_filter *DS, struct paramed_type *T);
+int print_ds_type_bare_messages_filter (struct tl_ds_messages_filter *DS, struct paramed_type *T);
+int print_ds_type_nearest_dc (struct tl_ds_nearest_dc *DS, struct paramed_type *T);
+int print_ds_type_bare_nearest_dc (struct tl_ds_nearest_dc *DS, struct paramed_type *T);
+int print_ds_type_notify_peer (struct tl_ds_notify_peer *DS, struct paramed_type *T);
+int print_ds_type_bare_notify_peer (struct tl_ds_notify_peer *DS, struct paramed_type *T);
+int print_ds_type_null (struct tl_ds_null *DS, struct paramed_type *T);
+int print_ds_type_bare_null (struct tl_ds_null *DS, struct paramed_type *T);
+int print_ds_type_p_q_inner_data (struct tl_ds_p_q_inner_data *DS, struct paramed_type *T);
+int print_ds_type_bare_p_q_inner_data (struct tl_ds_p_q_inner_data *DS, struct paramed_type *T);
+int print_ds_type_peer (struct tl_ds_peer *DS, struct paramed_type *T);
+int print_ds_type_bare_peer (struct tl_ds_peer *DS, struct paramed_type *T);
+int print_ds_type_peer_notify_events (struct tl_ds_peer_notify_events *DS, struct paramed_type *T);
+int print_ds_type_bare_peer_notify_events (struct tl_ds_peer_notify_events *DS, struct paramed_type *T);
+int print_ds_type_peer_notify_settings (struct tl_ds_peer_notify_settings *DS, struct paramed_type *T);
+int print_ds_type_bare_peer_notify_settings (struct tl_ds_peer_notify_settings *DS, struct paramed_type *T);
+int print_ds_type_photo (struct tl_ds_photo *DS, struct paramed_type *T);
+int print_ds_type_bare_photo (struct tl_ds_photo *DS, struct paramed_type *T);
+int print_ds_type_photo_size (struct tl_ds_photo_size *DS, struct paramed_type *T);
+int print_ds_type_bare_photo_size (struct tl_ds_photo_size *DS, struct paramed_type *T);
+int print_ds_type_privacy_key (struct tl_ds_privacy_key *DS, struct paramed_type *T);
+int print_ds_type_bare_privacy_key (struct tl_ds_privacy_key *DS, struct paramed_type *T);
+int print_ds_type_privacy_rule (struct tl_ds_privacy_rule *DS, struct paramed_type *T);
+int print_ds_type_bare_privacy_rule (struct tl_ds_privacy_rule *DS, struct paramed_type *T);
+int print_ds_type_received_notify_message (struct tl_ds_received_notify_message *DS, struct paramed_type *T);
+int print_ds_type_bare_received_notify_message (struct tl_ds_received_notify_message *DS, struct paramed_type *T);
+int print_ds_type_reply_markup (struct tl_ds_reply_markup *DS, struct paramed_type *T);
+int print_ds_type_bare_reply_markup (struct tl_ds_reply_markup *DS, struct paramed_type *T);
+int print_ds_type_res_p_q (struct tl_ds_res_p_q *DS, struct paramed_type *T);
+int print_ds_type_bare_res_p_q (struct tl_ds_res_p_q *DS, struct paramed_type *T);
+int print_ds_type_send_message_action (struct tl_ds_send_message_action *DS, struct paramed_type *T);
+int print_ds_type_bare_send_message_action (struct tl_ds_send_message_action *DS, struct paramed_type *T);
+int print_ds_type_server_d_h_params (struct tl_ds_server_d_h_params *DS, struct paramed_type *T);
+int print_ds_type_bare_server_d_h_params (struct tl_ds_server_d_h_params *DS, struct paramed_type *T);
+int print_ds_type_server_d_h_inner_data (struct tl_ds_server_d_h_inner_data *DS, struct paramed_type *T);
+int print_ds_type_bare_server_d_h_inner_data (struct tl_ds_server_d_h_inner_data *DS, struct paramed_type *T);
+int print_ds_type_set_client_d_h_params_answer (struct tl_ds_set_client_d_h_params_answer *DS, struct paramed_type *T);
+int print_ds_type_bare_set_client_d_h_params_answer (struct tl_ds_set_client_d_h_params_answer *DS, struct paramed_type *T);
+int print_ds_type_sticker_pack (struct tl_ds_sticker_pack *DS, struct paramed_type *T);
+int print_ds_type_bare_sticker_pack (struct tl_ds_sticker_pack *DS, struct paramed_type *T);
+int print_ds_type_sticker_set (struct tl_ds_sticker_set *DS, struct paramed_type *T);
+int print_ds_type_bare_sticker_set (struct tl_ds_sticker_set *DS, struct paramed_type *T);
+int print_ds_type_string (struct tl_ds_string *DS, struct paramed_type *T);
+int print_ds_type_bare_string (struct tl_ds_string *DS, struct paramed_type *T);
+int print_ds_type_update (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_type_bare_update (struct tl_ds_update *DS, struct paramed_type *T);
+int print_ds_type_updates (struct tl_ds_updates *DS, struct paramed_type *T);
+int print_ds_type_bare_updates (struct tl_ds_updates *DS, struct paramed_type *T);
+int print_ds_type_user (struct tl_ds_user *DS, struct paramed_type *T);
+int print_ds_type_bare_user (struct tl_ds_user *DS, struct paramed_type *T);
+int print_ds_type_user_full (struct tl_ds_user_full *DS, struct paramed_type *T);
+int print_ds_type_bare_user_full (struct tl_ds_user_full *DS, struct paramed_type *T);
+int print_ds_type_user_profile_photo (struct tl_ds_user_profile_photo *DS, struct paramed_type *T);
+int print_ds_type_bare_user_profile_photo (struct tl_ds_user_profile_photo *DS, struct paramed_type *T);
+int print_ds_type_user_status (struct tl_ds_user_status *DS, struct paramed_type *T);
+int print_ds_type_bare_user_status (struct tl_ds_user_status *DS, struct paramed_type *T);
+int print_ds_type_vector (struct tl_ds_vector *DS, struct paramed_type *T);
+int print_ds_type_bare_vector (struct tl_ds_vector *DS, struct paramed_type *T);
+int print_ds_type_video (struct tl_ds_video *DS, struct paramed_type *T);
+int print_ds_type_bare_video (struct tl_ds_video *DS, struct paramed_type *T);
+int print_ds_type_wall_paper (struct tl_ds_wall_paper *DS, struct paramed_type *T);
+int print_ds_type_bare_wall_paper (struct tl_ds_wall_paper *DS, struct paramed_type *T);
+int print_ds_type_web_page (struct tl_ds_web_page *DS, struct paramed_type *T);
+int print_ds_type_bare_web_page (struct tl_ds_web_page *DS, struct paramed_type *T);
+int print_ds_type_account_authorizations (struct tl_ds_account_authorizations *DS, struct paramed_type *T);
+int print_ds_type_bare_account_authorizations (struct tl_ds_account_authorizations *DS, struct paramed_type *T);
+int print_ds_type_account_password (struct tl_ds_account_password *DS, struct paramed_type *T);
+int print_ds_type_bare_account_password (struct tl_ds_account_password *DS, struct paramed_type *T);
+int print_ds_type_account_password_input_settings (struct tl_ds_account_password_input_settings *DS, struct paramed_type *T);
+int print_ds_type_bare_account_password_input_settings (struct tl_ds_account_password_input_settings *DS, struct paramed_type *T);
+int print_ds_type_account_password_settings (struct tl_ds_account_password_settings *DS, struct paramed_type *T);
+int print_ds_type_bare_account_password_settings (struct tl_ds_account_password_settings *DS, struct paramed_type *T);
+int print_ds_type_account_privacy_rules (struct tl_ds_account_privacy_rules *DS, struct paramed_type *T);
+int print_ds_type_bare_account_privacy_rules (struct tl_ds_account_privacy_rules *DS, struct paramed_type *T);
+int print_ds_type_account_sent_change_phone_code (struct tl_ds_account_sent_change_phone_code *DS, struct paramed_type *T);
+int print_ds_type_bare_account_sent_change_phone_code (struct tl_ds_account_sent_change_phone_code *DS, struct paramed_type *T);
+int print_ds_type_auth_authorization (struct tl_ds_auth_authorization *DS, struct paramed_type *T);
+int print_ds_type_bare_auth_authorization (struct tl_ds_auth_authorization *DS, struct paramed_type *T);
+int print_ds_type_auth_checked_phone (struct tl_ds_auth_checked_phone *DS, struct paramed_type *T);
+int print_ds_type_bare_auth_checked_phone (struct tl_ds_auth_checked_phone *DS, struct paramed_type *T);
+int print_ds_type_auth_exported_authorization (struct tl_ds_auth_exported_authorization *DS, struct paramed_type *T);
+int print_ds_type_bare_auth_exported_authorization (struct tl_ds_auth_exported_authorization *DS, struct paramed_type *T);
+int print_ds_type_auth_password_recovery (struct tl_ds_auth_password_recovery *DS, struct paramed_type *T);
+int print_ds_type_bare_auth_password_recovery (struct tl_ds_auth_password_recovery *DS, struct paramed_type *T);
+int print_ds_type_auth_sent_code (struct tl_ds_auth_sent_code *DS, struct paramed_type *T);
+int print_ds_type_bare_auth_sent_code (struct tl_ds_auth_sent_code *DS, struct paramed_type *T);
+int print_ds_type_binlog_encr_key (struct tl_ds_binlog_encr_key *DS, struct paramed_type *T);
+int print_ds_type_bare_binlog_encr_key (struct tl_ds_binlog_encr_key *DS, struct paramed_type *T);
+int print_ds_type_binlog_update (struct tl_ds_binlog_update *DS, struct paramed_type *T);
+int print_ds_type_bare_binlog_update (struct tl_ds_binlog_update *DS, struct paramed_type *T);
+int print_ds_type_contacts_blocked (struct tl_ds_contacts_blocked *DS, struct paramed_type *T);
+int print_ds_type_bare_contacts_blocked (struct tl_ds_contacts_blocked *DS, struct paramed_type *T);
+int print_ds_type_contacts_contacts (struct tl_ds_contacts_contacts *DS, struct paramed_type *T);
+int print_ds_type_bare_contacts_contacts (struct tl_ds_contacts_contacts *DS, struct paramed_type *T);
+int print_ds_type_contacts_found (struct tl_ds_contacts_found *DS, struct paramed_type *T);
+int print_ds_type_bare_contacts_found (struct tl_ds_contacts_found *DS, struct paramed_type *T);
+int print_ds_type_contacts_imported_contacts (struct tl_ds_contacts_imported_contacts *DS, struct paramed_type *T);
+int print_ds_type_bare_contacts_imported_contacts (struct tl_ds_contacts_imported_contacts *DS, struct paramed_type *T);
+int print_ds_type_contacts_link (struct tl_ds_contacts_link *DS, struct paramed_type *T);
+int print_ds_type_bare_contacts_link (struct tl_ds_contacts_link *DS, struct paramed_type *T);
+int print_ds_type_contacts_suggested (struct tl_ds_contacts_suggested *DS, struct paramed_type *T);
+int print_ds_type_bare_contacts_suggested (struct tl_ds_contacts_suggested *DS, struct paramed_type *T);
+int print_ds_type_geochats_located (struct tl_ds_geochats_located *DS, struct paramed_type *T);
+int print_ds_type_bare_geochats_located (struct tl_ds_geochats_located *DS, struct paramed_type *T);
+int print_ds_type_geochats_messages (struct tl_ds_geochats_messages *DS, struct paramed_type *T);
+int print_ds_type_bare_geochats_messages (struct tl_ds_geochats_messages *DS, struct paramed_type *T);
+int print_ds_type_geochats_stated_message (struct tl_ds_geochats_stated_message *DS, struct paramed_type *T);
+int print_ds_type_bare_geochats_stated_message (struct tl_ds_geochats_stated_message *DS, struct paramed_type *T);
+int print_ds_type_help_app_update (struct tl_ds_help_app_update *DS, struct paramed_type *T);
+int print_ds_type_bare_help_app_update (struct tl_ds_help_app_update *DS, struct paramed_type *T);
+int print_ds_type_help_invite_text (struct tl_ds_help_invite_text *DS, struct paramed_type *T);
+int print_ds_type_bare_help_invite_text (struct tl_ds_help_invite_text *DS, struct paramed_type *T);
+int print_ds_type_help_support (struct tl_ds_help_support *DS, struct paramed_type *T);
+int print_ds_type_bare_help_support (struct tl_ds_help_support *DS, struct paramed_type *T);
+int print_ds_type_messages_affected_history (struct tl_ds_messages_affected_history *DS, struct paramed_type *T);
+int print_ds_type_bare_messages_affected_history (struct tl_ds_messages_affected_history *DS, struct paramed_type *T);
+int print_ds_type_messages_affected_messages (struct tl_ds_messages_affected_messages *DS, struct paramed_type *T);
+int print_ds_type_bare_messages_affected_messages (struct tl_ds_messages_affected_messages *DS, struct paramed_type *T);
+int print_ds_type_messages_all_stickers (struct tl_ds_messages_all_stickers *DS, struct paramed_type *T);
+int print_ds_type_bare_messages_all_stickers (struct tl_ds_messages_all_stickers *DS, struct paramed_type *T);
+int print_ds_type_messages_chat_full (struct tl_ds_messages_chat_full *DS, struct paramed_type *T);
+int print_ds_type_bare_messages_chat_full (struct tl_ds_messages_chat_full *DS, struct paramed_type *T);
+int print_ds_type_messages_chats (struct tl_ds_messages_chats *DS, struct paramed_type *T);
+int print_ds_type_bare_messages_chats (struct tl_ds_messages_chats *DS, struct paramed_type *T);
+int print_ds_type_messages_dh_config (struct tl_ds_messages_dh_config *DS, struct paramed_type *T);
+int print_ds_type_bare_messages_dh_config (struct tl_ds_messages_dh_config *DS, struct paramed_type *T);
+int print_ds_type_messages_dialogs (struct tl_ds_messages_dialogs *DS, struct paramed_type *T);
+int print_ds_type_bare_messages_dialogs (struct tl_ds_messages_dialogs *DS, struct paramed_type *T);
+int print_ds_type_messages_message (struct tl_ds_messages_message *DS, struct paramed_type *T);
+int print_ds_type_bare_messages_message (struct tl_ds_messages_message *DS, struct paramed_type *T);
+int print_ds_type_messages_messages (struct tl_ds_messages_messages *DS, struct paramed_type *T);
+int print_ds_type_bare_messages_messages (struct tl_ds_messages_messages *DS, struct paramed_type *T);
+int print_ds_type_messages_sent_encrypted_message (struct tl_ds_messages_sent_encrypted_message *DS, struct paramed_type *T);
+int print_ds_type_bare_messages_sent_encrypted_message (struct tl_ds_messages_sent_encrypted_message *DS, struct paramed_type *T);
+int print_ds_type_messages_sent_message (struct tl_ds_messages_sent_message *DS, struct paramed_type *T);
+int print_ds_type_bare_messages_sent_message (struct tl_ds_messages_sent_message *DS, struct paramed_type *T);
+int print_ds_type_messages_sticker_set (struct tl_ds_messages_sticker_set *DS, struct paramed_type *T);
+int print_ds_type_bare_messages_sticker_set (struct tl_ds_messages_sticker_set *DS, struct paramed_type *T);
+int print_ds_type_messages_stickers (struct tl_ds_messages_stickers *DS, struct paramed_type *T);
+int print_ds_type_bare_messages_stickers (struct tl_ds_messages_stickers *DS, struct paramed_type *T);
+int print_ds_type_photos_photo (struct tl_ds_photos_photo *DS, struct paramed_type *T);
+int print_ds_type_bare_photos_photo (struct tl_ds_photos_photo *DS, struct paramed_type *T);
+int print_ds_type_photos_photos (struct tl_ds_photos_photos *DS, struct paramed_type *T);
+int print_ds_type_bare_photos_photos (struct tl_ds_photos_photos *DS, struct paramed_type *T);
+int print_ds_type_storage_file_type (struct tl_ds_storage_file_type *DS, struct paramed_type *T);
+int print_ds_type_bare_storage_file_type (struct tl_ds_storage_file_type *DS, struct paramed_type *T);
+int print_ds_type_updates_difference (struct tl_ds_updates_difference *DS, struct paramed_type *T);
+int print_ds_type_bare_updates_difference (struct tl_ds_updates_difference *DS, struct paramed_type *T);
+int print_ds_type_updates_state (struct tl_ds_updates_state *DS, struct paramed_type *T);
+int print_ds_type_bare_updates_state (struct tl_ds_updates_state *DS, struct paramed_type *T);
+int print_ds_type_upload_file (struct tl_ds_upload_file *DS, struct paramed_type *T);
+int print_ds_type_bare_upload_file (struct tl_ds_upload_file *DS, struct paramed_type *T);
+int print_ds_type_any (void *DS, struct paramed_type *T);
diff --git a/protocols/Telegram/tgl/auto/auto-skip.c b/protocols/Telegram/tgl/auto/auto-skip.c
new file mode 100644
index 0000000000..9ff28a1de2
--- /dev/null
+++ b/protocols/Telegram/tgl/auto/auto-skip.c
@@ -0,0 +1,11302 @@
+#ifdef _MSC_VER
+#include "..\auto.h"
+#include "auto-skip.h"
+#include "..\auto-static-skip.c"
+#include "..\mtproto-common.h"
+#else
+#include "auto.h"
+#include "auto/auto-skip.h"
+#include "auto-static-skip.c"
+#include "mtproto-common.h"
+#endif
+#include <assert.h>
+int skip_constructor_account_days_t_t_l (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb8d0afdf && T->type->name != 0x472f5020)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_audio_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fc5ec4e && T->type->name != 0x603a13b1)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fc5ec4e && T->type->name != 0x603a13b1)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field6) < 0) { return -1;}
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field7) < 0) { return -1;}
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field8) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_authorization (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bf2e6f6 && T->type->name != 0x840d1909)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field6) < 0) { return -1;}
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field7) < 0) { return -1;}
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field8) < 0) { return -1;}
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field9) < 0) { return -1;}
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field10) < 0) { return -1;}
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field11) < 0) { return -1;}
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field12) < 0) { return -1;}
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field13) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_bool_false (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x250be282 && T->type->name != 0xdaf41d7d)) { return -1; }
+ return 0;
+}
+int skip_constructor_bool_true (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x250be282 && T->type->name != 0xdaf41d7d)) { return -1; }
+ return 0;
+}
+int skip_constructor_bot_command (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x75e7ea6c && T->type->name != 0x8a181593)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_bot_command_old (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x75e7ea6c && T->type->name != 0x8a181593)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_bot_info_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb2e16f93 && T->type->name != 0x4d1e906c)) { return -1; }
+ return 0;
+}
+int skip_constructor_bot_info (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb2e16f93 && T->type->name != 0x4d1e906c)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x75e7ea6c, .id = "BotCommand", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field5) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_bytes (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0ee1379f && T->type->name != 0xf11ec860)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_chat_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x56922676, .id = "ChatPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_chat_photo (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bool (field6) < 0) { return -1;}
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field7) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_chat_forbidden (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_geo_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_geo_point (field6) < 0) { return -1;}
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x56922676, .id = "ChatPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_chat_photo (field7) < 0) { return -1;}
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field8) < 0) { return -1;}
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field9) < 0) { return -1;}
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bool (field10) < 0) { return -1;}
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field11) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_chat_full (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02a614 && T->type->name != 0xd1fd59eb)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x77930f9f, .id = "ChatParticipants", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_chat_participants (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_photo (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_peer_notify_settings (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f132d5, .id = "ExportedChatInvite", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_exported_chat_invite (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb2e16f93, .id = "BotInfo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field6) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_chat_invite_already (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x94f910b1 && T->type->name != 0x6b06ef4e)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_chat (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_chat_invite (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x94f910b1 && T->type->name != 0x6b06ef4e)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_chat_located (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3631cf4c && T->type->name != 0xc9ce30b3)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_chat_participant (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc8d7493e && T->type->name != 0x3728b6c1)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_chat_participants_forbidden (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x77930f9f && T->type->name != 0x886cf060)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_chat_participants (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x77930f9f && T->type->name != 0x886cf060)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc8d7493e, .id = "ChatParticipant", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_chat_photo_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x56922676 && T->type->name != 0xa96dd989)) { return -1; }
+ return 0;
+}
+int skip_constructor_chat_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x56922676 && T->type->name != 0xa96dd989)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_file_location (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_file_location (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_client_d_h_inner_data (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6643b654 && T->type->name != 0x99bc49ab)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int128 (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int128 (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_config (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e32b894 && T->type->name != 0xb1cd476b)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bool (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2b1a62f0, .id = "DcOption", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field6) < 0) { return -1;}
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field7) < 0) { return -1;}
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field8) < 0) { return -1;}
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field9) < 0) { return -1;}
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field10) < 0) { return -1;}
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field11) < 0) { return -1;}
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field12) < 0) { return -1;}
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field13) < 0) { return -1;}
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field14) < 0) { return -1;}
+ struct paramed_type *field15 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field15) < 0) { return -1;}
+ struct paramed_type *field16 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field16) < 0) { return -1;}
+ struct paramed_type *field17 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field17) < 0) { return -1;}
+ struct paramed_type *field18 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xae636f24, .id = "DisabledFeature", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field18) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf911c994 && T->type->name != 0x06ee366b)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bool (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_contact_blocked (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x561bc879 && T->type->name != 0xa9e43786)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_contact_found (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xea879f95 && T->type->name != 0x1578606a)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_contact_link_unknown (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return -1; }
+ return 0;
+}
+int skip_constructor_contact_link_none (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return -1; }
+ return 0;
+}
+int skip_constructor_contact_link_has_phone (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return -1; }
+ return 0;
+}
+int skip_constructor_contact_link_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return -1; }
+ return 0;
+}
+int skip_constructor_contact_status (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd3680c61 && T->type->name != 0x2c97f39e)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x76de9570, .id = "UserStatus", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_user_status (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_contact_suggested (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3de191a1 && T->type->name != 0xc21e6e5e)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_dc_option_l28 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2b1a62f0 && T->type->name != 0xd4e59d0f)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_dc_option (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2b1a62f0 && T->type->name != 0xd4e59d0f)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_decrypted_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x535b7918 && T->type->name != 0xaca486e7)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x34e0d674, .id = "DecryptedMessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_decrypted_message_media (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_decrypted_message_service (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x535b7918 && T->type->name != 0xaca486e7)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4e0eefde, .id = "DecryptedMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_decrypted_message_action (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_decrypted_message_action_set_message_t_t_l (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_decrypted_message_action_read_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_decrypted_message_action_delete_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_decrypted_message_action_screenshot_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_decrypted_message_action_flush_history (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ return 0;
+}
+int skip_constructor_decrypted_message_action_resend (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_decrypted_message_action_notify_layer (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_decrypted_message_action_typing (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x70541c7e, .id = "SendMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_send_message_action (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_decrypted_message_action_request_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_decrypted_message_action_accept_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_decrypted_message_action_abort_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_decrypted_message_action_commit_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_decrypted_message_action_noop (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ return 0;
+}
+int skip_constructor_decrypted_message_layer (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1be31789 && T->type->name != 0xe41ce876)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x535b7918, .id = "DecryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_decrypted_message (field5) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_decrypted_message_media_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ return 0;
+}
+int skip_constructor_decrypted_message_media_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field6) < 0) { return -1;}
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field7) < 0) { return -1;}
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field8) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_decrypted_message_media_geo_point (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_double (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_double (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_decrypted_message_media_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_decrypted_message_media_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field6) < 0) { return -1;}
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field7) < 0) { return -1;}
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field8) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_decrypted_message_media_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field6) < 0) { return -1;}
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field7) < 0) { return -1;}
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field8) < 0) { return -1;}
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field9) < 0) { return -1;}
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field10) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_decrypted_message_media_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field5) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_decrypted_message_media_external_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_photo_size (field6) < 0) { return -1;}
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field7) < 0) { return -1;}
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field8) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_decrypted_message_media_video_l12 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field6) < 0) { return -1;}
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field7) < 0) { return -1;}
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field8) < 0) { return -1;}
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field9) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_decrypted_message_media_audio_l12 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_dialog (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc1dd804a && T->type->name != 0x3e227fb5)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_peer (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_peer_notify_settings (field5) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_disabled_feature (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xae636f24 && T->type->name != 0x519c90db)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_document_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x51a73418 && T->type->name != 0xae58cbe7)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x51a73418 && T->type->name != 0xae58cbe7)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_photo_size (field6) < 0) { return -1;}
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field7) < 0) { return -1;}
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field8) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_document_l19 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x51a73418 && T->type->name != 0xae58cbe7)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field6) < 0) { return -1;}
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field7) < 0) { return -1;}
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_photo_size (field8) < 0) { return -1;}
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field9) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_document_attribute_image_size (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_document_attribute_animated (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ return 0;
+}
+int skip_constructor_document_attribute_sticker_l28 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_document_attribute_sticker (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe44d415c, .id = "InputStickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_input_sticker_set (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_document_attribute_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_document_attribute_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_document_attribute_filename (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_double (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2210c154 && T->type->name != 0xddef3eab)) { return -1; }
+ if (in_remaining () < 8) { return -1;}
+ fetch_double ();
+ return 0;
+}
+int skip_constructor_encrypted_chat_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_encrypted_chat_waiting (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field5) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_encrypted_chat_requested (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field6) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_encrypted_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field6) < 0) { return -1;}
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field7) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_encrypted_chat_discarded (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_encrypted_file_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x886fd032 && T->type->name != 0x77902fcd)) { return -1; }
+ return 0;
+}
+int skip_constructor_encrypted_file (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x886fd032 && T->type->name != 0x77902fcd)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field5) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_encrypted_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xce6b8a1e && T->type->name != 0x319475e1)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x886fd032, .id = "EncryptedFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_encrypted_file (field5) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_encrypted_message_service (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xce6b8a1e && T->type->name != 0x319475e1)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_error (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc4b9f9bb && T->type->name != 0x3b460644)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_chat_invite_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f132d5 && T->type->name != 0x6a0ecd2a)) { return -1; }
+ return 0;
+}
+int skip_constructor_chat_invite_exported (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f132d5 && T->type->name != 0x6a0ecd2a)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_file_location_unavailable (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2f8ffb30 && T->type->name != 0xd07004cf)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2f8ffb30 && T->type->name != 0xd07004cf)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_geo_chat_message_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf67b4034 && T->type->name != 0x0984bfcb)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_geo_chat_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf67b4034 && T->type->name != 0x0984bfcb)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_message_media (field6) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_geo_chat_message_service (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf67b4034 && T->type->name != 0x0984bfcb)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x383415fa, .id = "MessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_message_action (field5) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_geo_point_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x315e0a53 && T->type->name != 0xcea1f5ac)) { return -1; }
+ return 0;
+}
+int skip_constructor_geo_point (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x315e0a53 && T->type->name != 0xcea1f5ac)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_double (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_double (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_imported_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd0028438 && T->type->name != 0x2ffd7bc7)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_app_event (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x770656a8 && T->type->name != 0x88f9a957)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_double (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_audio_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xae8e9c7b && T->type->name != 0x51716384)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xae8e9c7b && T->type->name != 0x51716384)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_chat_photo_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3a60776d && T->type->name != 0xc59f8892)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_chat_uploaded_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3a60776d && T->type->name != 0xc59f8892)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_input_file (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7477e321, .id = "InputPhotoCrop", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_input_photo_crop (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_chat_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3a60776d && T->type->name != 0xc59f8892)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe74279c9, .id = "InputPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_input_photo (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7477e321, .id = "InputPhotoCrop", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_input_photo_crop (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_phone_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf392b7f4 && T->type->name != 0x0c6d480b)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_document_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6a8963fc && T->type->name != 0x95769c03)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6a8963fc && T->type->name != 0x95769c03)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_encrypted_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf141b5e1 && T->type->name != 0x0ebe4a1e)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_encrypted_file_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_encrypted_file_uploaded (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_encrypted_file (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_encrypted_file_big_uploaded (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_file (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0f60f9ca && T->type->name != 0xf09f0635)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_file_big (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0f60f9ca && T->type->name != 0xf09f0635)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_video_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_encrypted_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_audio_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_document_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_geo_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x74d456fa && T->type->name != 0x8b2ba905)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_geo_point_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17768f1f && T->type->name != 0xe88970e0)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_geo_point (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17768f1f && T->type->name != 0xe88970e0)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_double (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_double (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_media_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_media_uploaded_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_input_file (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_media_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe74279c9, .id = "InputPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_input_photo (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_media_geo_point (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17768f1f, .id = "InputGeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_input_geo_point (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_media_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_media_uploaded_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_input_file (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field5) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_media_uploaded_thumb_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_input_file (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_input_file (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field6) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_media_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xbb5f7a27, .id = "InputVideo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_input_video (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_media_uploaded_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_input_file (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_media_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xae8e9c7b, .id = "InputAudio", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_input_audio (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_media_uploaded_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_input_file (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_media_uploaded_thumb_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_input_file (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_input_file (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_media_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x6a8963fc, .id = "InputDocument", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_input_document (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_media_venue (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17768f1f, .id = "InputGeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_input_geo_point (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field5) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_notify_peer (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9e67268d, .id = "InputPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_input_peer (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_notify_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_notify_chats (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_notify_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_notify_geo_chat_peer (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x74d456fa, .id = "InputGeoChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_input_geo_chat (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_peer_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_peer_self (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_peer_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_peer_foreign (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_peer_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_peer_notify_events_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x185a48ac && T->type->name != 0xe7a5b753)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_peer_notify_events_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x185a48ac && T->type->name != 0xe7a5b753)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_peer_notify_settings (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x46a2ce98 && T->type->name != 0xb95d3167)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bool (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_photo_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe74279c9 && T->type->name != 0x18bd8636)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe74279c9 && T->type->name != 0x18bd8636)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_photo_crop_auto (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7477e321 && T->type->name != 0x8b881cde)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_photo_crop (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7477e321 && T->type->name != 0x8b881cde)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_double (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_double (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_double (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_privacy_key_status_timestamp (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4f96cb18 && T->type->name != 0xb06934e7)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_privacy_value_allow_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_privacy_value_allow_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_privacy_value_allow_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_privacy_value_disallow_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_privacy_value_disallow_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_privacy_value_disallow_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_sticker_set_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe44d415c && T->type->name != 0x1bb2bea3)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_sticker_set_i_d (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe44d415c && T->type->name != 0x1bb2bea3)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_sticker_set_short_name (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe44d415c && T->type->name != 0x1bb2bea3)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_user_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_user_self (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_user_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_user_foreign (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_video_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbb5f7a27 && T->type->name != 0x44a085d8)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbb5f7a27 && T->type->name != 0x44a085d8)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_int (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8509bda && T->type->name != 0x57af6425)) { return -1; }
+ if (in_remaining () < 4) { return -1;}
+ fetch_int ();
+ return 0;
+}
+int skip_constructor_int128 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7d36c439 && T->type->name != 0x82c93bc6)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_int256 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf2c798b3 && T->type->name != 0x0d38674c)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_keyboard_button (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa2fa4880 && T->type->name != 0x5d05b77f)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_keyboard_button_row (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x77608b83 && T->type->name != 0x889f747c)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa2fa4880, .id = "KeyboardButton", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_long (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22076cba && T->type->name != 0xddf89345)) { return -1; }
+ if (in_remaining () < 8) { return -1;}
+ fetch_long ();
+ return 0;
+}
+int skip_constructor_message_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5d652a7f && T->type->name != 0xa29ad580)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5d652a7f && T->type->name != 0xa29ad580)) { return -1; }
+ if (in_remaining () < 4) { return -1;}
+ struct paramed_type *var0 = INT2PTR (fetch_int ());
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_peer (field4) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field5) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field6) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field7) < 0) { return -1;}
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field8) < 0) { return -1;}
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field9) < 0) { return -1;}
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_message_media (field10) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 6)) {
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x612ca4a9, .id = "ReplyMarkup", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_reply_markup (field11) < 0) { return -1;}
+ }
+ return 0;
+}
+int skip_constructor_message_service (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5d652a7f && T->type->name != 0xa29ad580)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_peer (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x383415fa, .id = "MessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_message_action (field6) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_message_action_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ return 0;
+}
+int skip_constructor_message_action_chat_create (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_message_action_chat_edit_title (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_message_action_chat_edit_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_photo (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_message_action_chat_delete_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ return 0;
+}
+int skip_constructor_message_action_chat_add_user (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_message_action_chat_delete_user (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_message_action_geo_chat_create (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_message_action_geo_chat_checkin (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ return 0;
+}
+int skip_constructor_message_action_chat_joined_by_link (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_message_media_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ return 0;
+}
+int skip_constructor_message_media_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_photo (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_message_media_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1716b174, .id = "Video", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_video (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_message_media_geo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_geo_point (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_message_media_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_message_media_unsupported (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ return 0;
+}
+int skip_constructor_message_media_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_document (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_message_media_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9fc5ec4e, .id = "Audio", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_audio (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_message_media_web_page (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x8d8c0d41, .id = "WebPage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_web_page (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_message_media_venue (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_geo_point (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field5) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_message_media_photo_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_photo (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_message_media_video_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1716b174, .id = "Video", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_video (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_input_messages_filter_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_messages_filter_photos (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_messages_filter_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_messages_filter_photo_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_messages_filter_photo_video_documents (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_messages_filter_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ return 0;
+}
+int skip_constructor_input_messages_filter_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ return 0;
+}
+int skip_constructor_nearest_dc (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8e1a1775 && T->type->name != 0x71e5e88a)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_notify_peer (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_peer (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_notify_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return -1; }
+ return 0;
+}
+int skip_constructor_notify_chats (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return -1; }
+ return 0;
+}
+int skip_constructor_notify_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return -1; }
+ return 0;
+}
+int skip_constructor_null (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x56730bcc && T->type->name != 0xa98cf433)) { return -1; }
+ return 0;
+}
+int skip_constructor_p_q_inner_data (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbfa3de38 && T->type->name != 0x405c21c7)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int128 (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int128 (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0d38674c, .id = "Bare_Int256", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int256 (field6) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_p_q_inner_data_temp (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbfa3de38 && T->type->name != 0x405c21c7)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int128 (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int128 (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0d38674c, .id = "Bare_Int256", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int256 (field6) < 0) { return -1;}
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field7) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_peer_user (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x276159d6 && T->type->name != 0xd89ea629)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_peer_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x276159d6 && T->type->name != 0xd89ea629)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_peer_notify_events_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc0c8d13b && T->type->name != 0x3f372ec4)) { return -1; }
+ return 0;
+}
+int skip_constructor_peer_notify_events_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc0c8d13b && T->type->name != 0x3f372ec4)) { return -1; }
+ return 0;
+}
+int skip_constructor_peer_notify_settings_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xfdf894fc && T->type->name != 0x02076b03)) { return -1; }
+ return 0;
+}
+int skip_constructor_peer_notify_settings (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xfdf894fc && T->type->name != 0x02076b03)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bool (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_photo_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc207550a && T->type->name != 0x3df8aaf5)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc207550a && T->type->name != 0x3df8aaf5)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_geo_point (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field6) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_photo_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc207550a && T->type->name != 0x3df8aaf5)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_geo_point (field6) < 0) { return -1;}
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field7) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_photo_size_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x900f60dd && T->type->name != 0x6ff09f22)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_photo_size (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x900f60dd && T->type->name != 0x6ff09f22)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_file_location (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field5) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_photo_cached_size (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x900f60dd && T->type->name != 0x6ff09f22)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_file_location (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field5) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_privacy_key_status_timestamp (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbc2eab30 && T->type->name != 0x43d154cf)) { return -1; }
+ return 0;
+}
+int skip_constructor_privacy_value_allow_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ return 0;
+}
+int skip_constructor_privacy_value_allow_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ return 0;
+}
+int skip_constructor_privacy_value_allow_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_privacy_value_disallow_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ return 0;
+}
+int skip_constructor_privacy_value_disallow_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ return 0;
+}
+int skip_constructor_privacy_value_disallow_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_received_notify_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa384b779 && T->type->name != 0x5c7b4886)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_reply_keyboard_hide (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x612ca4a9 && T->type->name != 0x9ed35b56)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_reply_keyboard_force_reply (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x612ca4a9 && T->type->name != 0x9ed35b56)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_reply_keyboard_markup (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x612ca4a9 && T->type->name != 0x9ed35b56)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x77608b83, .id = "KeyboardButtonRow", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_res_p_q (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x05162463 && T->type->name != 0xfae9db9c)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int128 (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int128 (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_send_message_typing_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ return 0;
+}
+int skip_constructor_send_message_cancel_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ return 0;
+}
+int skip_constructor_send_message_record_video_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ return 0;
+}
+int skip_constructor_send_message_upload_video_action_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ return 0;
+}
+int skip_constructor_send_message_upload_video_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_send_message_record_audio_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ return 0;
+}
+int skip_constructor_send_message_upload_audio_action_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ return 0;
+}
+int skip_constructor_send_message_upload_audio_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_send_message_upload_photo_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_send_message_upload_document_action_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ return 0;
+}
+int skip_constructor_send_message_upload_document_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_send_message_geo_location_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ return 0;
+}
+int skip_constructor_send_message_choose_contact_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ return 0;
+}
+int skip_constructor_server_d_h_params_fail (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa9230301 && T->type->name != 0x56dcfcfe)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int128 (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int128 (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int128 (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_server_d_h_params_ok (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa9230301 && T->type->name != 0x56dcfcfe)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int128 (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int128 (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_server_d_h_inner_data (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb5890dba && T->type->name != 0x4a76f245)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int128 (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int128 (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field6) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_dh_gen_ok (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdb8a468f && T->type->name != 0x2475b970)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int128 (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int128 (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int128 (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_dh_gen_retry (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdb8a468f && T->type->name != 0x2475b970)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int128 (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int128 (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int128 (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_dh_gen_fail (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdb8a468f && T->type->name != 0x2475b970)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int128 (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int128 (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int128 (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_sticker_pack (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x12b299d4 && T->type->name != 0xed4d662b)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_sticker_set (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa7a43b17 && T->type->name != 0x585bc4e8)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_string (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb5286e24 && T->type->name != 0x4ad791db)) { return -1; }
+ int l = prefetch_strlen ();
+ if (l < 0) { return -1;}
+ fetch_str (l);
+ return 0;
+}
+int skip_constructor_update_new_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_message (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_message_i_d (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_delete_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_user_typing (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x70541c7e, .id = "SendMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_send_message_action (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_chat_user_typing (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x70541c7e, .id = "SendMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_send_message_action (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_chat_participants (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x77930f9f, .id = "ChatParticipants", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_chat_participants (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_user_status (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x76de9570, .id = "UserStatus", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_user_status (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_user_name (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_user_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9a486229, .id = "UserProfilePhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_user_profile_photo (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bool (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_contact_registered (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_contact_link (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_contact_link (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_contact_link (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_new_authorization (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_new_geo_chat_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_geo_chat_message (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_new_encrypted_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xce6b8a1e, .id = "EncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_encrypted_message (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_encrypted_chat_typing (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_encryption (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb1718213, .id = "EncryptedChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_encrypted_chat (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_encrypted_messages_read (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_chat_participant_add (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_chat_participant_delete (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_dc_options (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2b1a62f0, .id = "DcOption", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_user_blocked (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bool (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_notify_settings (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9fcb8237, .id = "NotifyPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_notify_peer (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_peer_notify_settings (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_service_notification (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_message_media (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bool (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_privacy (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xbc2eab30, .id = "PrivacyKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_privacy_key (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa8638aec, .id = "PrivacyRule", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_user_phone (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_read_history_inbox (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_peer (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_read_history_outbox (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_peer (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_web_page (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x8d8c0d41, .id = "WebPage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_web_page (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_read_messages_contents (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_update_msg_update (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_updates_too_long (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ return 0;
+}
+int skip_constructor_update_short_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ if (in_remaining () < 4) { return -1;}
+ struct paramed_type *var0 = INT2PTR (fetch_int ());
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field6) < 0) { return -1;}
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field7) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field8) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field9) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field10) < 0) { return -1;}
+ }
+ return 0;
+}
+int skip_constructor_update_short_chat_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ if (in_remaining () < 4) { return -1;}
+ struct paramed_type *var0 = INT2PTR (fetch_int ());
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field6) < 0) { return -1;}
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field7) < 0) { return -1;}
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field8) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field9) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field10) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field11) < 0) { return -1;}
+ }
+ return 0;
+}
+int skip_constructor_update_short (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_update (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_updates_combined (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field6) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_updates (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field5) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_user_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02e6c0c8 && T->type->name != 0xfd193f37)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_user (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02e6c0c8 && T->type->name != 0xfd193f37)) { return -1; }
+ if (in_remaining () < 4) { return -1;}
+ struct paramed_type *var0 = INT2PTR (fetch_int ());
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 0)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field3) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 1)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field4) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field5) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field6) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 4)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field7) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 5)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9a486229, .id = "UserProfilePhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_user_profile_photo (field8) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 6)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x76de9570, .id = "UserStatus", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_user_status (field9) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 14)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field10) < 0) { return -1;}
+ }
+ return 0;
+}
+int skip_constructor_user_full (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5a89ac5b && T->type->name != 0xa57653a4)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_user (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3ace484c, .id = "contacts.Link", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_contacts_link (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_photo (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_peer_notify_settings (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bool (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb2e16f93, .id = "BotInfo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bot_info (field6) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_user_profile_photo_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9a486229 && T->type->name != 0x65b79dd6)) { return -1; }
+ return 0;
+}
+int skip_constructor_user_profile_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9a486229 && T->type->name != 0x65b79dd6)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_file_location (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_file_location (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_user_status_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ return 0;
+}
+int skip_constructor_user_status_online (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_user_status_offline (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_user_status_recently (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ return 0;
+}
+int skip_constructor_user_status_last_week (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ return 0;
+}
+int skip_constructor_user_status_last_month (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ return 0;
+}
+int skip_constructor_vector (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1cb5c415 && T->type->name != 0xe34a3bea)) { return -1; }
+ if (ODDP(T->params[0])) { return -1; }
+ struct paramed_type *var0 = T->params[0]; assert (var0);
+ if (in_remaining () < 4) { return -1;}
+ struct paramed_type *var1 = INT2PTR (fetch_int ());
+ int multiplicity3 = PTR2INT (
+ ((void *)var1) + 0 );
+ struct paramed_type *field3 =
+ var0;
+ while (multiplicity3 -- > 0) {
+ if (skip_type_any (field3) < 0) { return -1;}
+ }
+ return 0;
+}
+int skip_constructor_video_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1716b174 && T->type->name != 0xe8e94e8b)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1716b174 && T->type->name != 0xe8e94e8b)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field6) < 0) { return -1;}
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_photo_size (field7) < 0) { return -1;}
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field8) < 0) { return -1;}
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field9) < 0) { return -1;}
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field10) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_video_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1716b174 && T->type->name != 0xe8e94e8b)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field6) < 0) { return -1;}
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field7) < 0) { return -1;}
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field8) < 0) { return -1;}
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_photo_size (field9) < 0) { return -1;}
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field10) < 0) { return -1;}
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field11) < 0) { return -1;}
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field12) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_wall_paper (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xafa14973 && T->type->name != 0x505eb68c)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_wall_paper_solid (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xafa14973 && T->type->name != 0x505eb68c)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_web_page_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8d8c0d41 && T->type->name != 0x7273f2be)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_web_page_pending (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8d8c0d41 && T->type->name != 0x7273f2be)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_web_page (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8d8c0d41 && T->type->name != 0x7273f2be)) { return -1; }
+ if (in_remaining () < 4) { return -1;}
+ struct paramed_type *var0 = INT2PTR (fetch_int ());
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field4) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 0)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field5) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 1)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field6) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field7) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field8) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 4)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_photo (field9) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 5)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field10) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 5)) {
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field11) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 6)) {
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field12) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 6)) {
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field13) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 7)) {
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field14) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 8)) {
+ struct paramed_type *field15 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field15) < 0) { return -1;}
+ }
+ return 0;
+}
+int skip_constructor_account_authorizations (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1250abde && T->type->name != 0xedaf5421)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bf2e6f6, .id = "Authorization", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_account_no_password (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xeac2a804 && T->type->name != 0x153d57fb)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_account_password (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xeac2a804 && T->type->name != 0x153d57fb)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bool (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field5) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_account_password_input_settings (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbcfc532c && T->type->name != 0x4303acd3)) { return -1; }
+ if (in_remaining () < 4) { return -1;}
+ struct paramed_type *var0 = INT2PTR (fetch_int ());
+ if (PTR2INT (var0) & (1 << 0)) {
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field2) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 0)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field3) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 0)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field4) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 1)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field5) < 0) { return -1;}
+ }
+ return 0;
+}
+int skip_constructor_account_password_settings (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb7b72ab3 && T->type->name != 0x4848d54c)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_account_privacy_rules (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x554abb6f && T->type->name != 0xaab54490)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa8638aec, .id = "PrivacyRule", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_account_sent_change_phone_code (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa4f58c4c && T->type->name != 0x5b0a73b3)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_auth_authorization (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xff036af1 && T->type->name != 0x00fc950e)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_user (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_auth_checked_phone (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x811ea28e && T->type->name != 0x7ee15d71)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bool (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_auth_exported_authorization (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdf969c2d && T->type->name != 0x206963d2)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_auth_password_recovery (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x137948a5 && T->type->name != 0xec86b75a)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_auth_sent_code (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0cc8bc16 && T->type->name != 0xf33743e9)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bool (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bool (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_auth_sent_app_code (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0cc8bc16 && T->type->name != 0xf33743e9)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bool (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bool (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_binlog_encr_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0377168f && T->type->name != 0xfc88e970)) { return -1; }
+ int multiplicity1 = PTR2INT (
+ INT2PTR (64) );
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ while (multiplicity1 -- > 0) {
+ if (skip_type_any (field1) < 0) { return -1;}
+ }
+ return 0;
+}
+int skip_constructor_binlog_start (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ return 0;
+}
+int skip_constructor_binlog_dc_option (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_binlog_dc_option_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field5) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_binlog_auth_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_binlog_encr_key (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_binlog_default_dc (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_binlog_dc_signed (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_binlog_our_id (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_binlog_set_dh_params (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_binlog_encr_key (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_binlog_set_pts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_binlog_set_qts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_binlog_set_date (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_binlog_set_seq (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_binlog_encr_chat_delete (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_binlog_encr_chat_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (in_remaining () < 4) { return -1;}
+ struct paramed_type *var0 = INT2PTR (fetch_int ());
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field3) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field5) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field6) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_binlog_encr_key (field7) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_binlog_encr_key (field8) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field9) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field10) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 25)) {
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field11) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field12) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field13) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field14) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 27)) {
+ struct paramed_type *field15 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field15) < 0) { return -1;}
+ }
+ return 0;
+}
+int skip_constructor_binlog_encr_chat_exchange_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (in_remaining () < 4) { return -1;}
+ struct paramed_type *var0 = INT2PTR (fetch_int ());
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field3) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_binlog_encr_key (field4) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field5) < 0) { return -1;}
+ }
+ return 0;
+}
+int skip_constructor_binlog_user_delete (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_binlog_user_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (in_remaining () < 4) { return -1;}
+ struct paramed_type *var0 = INT2PTR (fetch_int ());
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field3) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field4) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field5) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field6) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field7) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_photo (field8) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field9) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field10) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9a486229, .id = "UserProfilePhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_user_profile_photo (field11) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field12) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 25)) {
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field13) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb2e16f93, .id = "BotInfo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bot_info (field14) < 0) { return -1;}
+ }
+ return 0;
+}
+int skip_constructor_binlog_chat_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (in_remaining () < 4) { return -1;}
+ struct paramed_type *var0 = INT2PTR (fetch_int ());
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field5) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field6) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc8d7493e, .id = "ChatParticipant", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field7) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x56922676, .id = "ChatPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_chat_photo (field8) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_photo (field9) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field10) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field11) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 25)) {
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field12) < 0) { return -1;}
+ }
+ return 0;
+}
+int skip_constructor_binlog_chat_add_participant (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field5) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_binlog_chat_del_participant (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_binlog_set_msg_id (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_binlog_message_delete (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_binlog_message_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (in_remaining () < 4) { return -1;}
+ struct paramed_type *var0 = INT2PTR (fetch_int ());
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field5) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field6) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field7) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field8) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field9) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_message_media (field10) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x383415fa, .id = "MessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_message_action (field11) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field12) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x612ca4a9, .id = "ReplyMarkup", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_reply_markup (field13) < 0) { return -1;}
+ }
+ return 0;
+}
+int skip_constructor_binlog_message_encr_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (in_remaining () < 4) { return -1;}
+ struct paramed_type *var0 = INT2PTR (fetch_int ());
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field2) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field5) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field6) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field7) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x34e0d674, .id = "DecryptedMessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_decrypted_message_media (field8) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4e0eefde, .id = "DecryptedMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_decrypted_message_action (field9) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x886fd032, .id = "EncryptedFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_encrypted_file (field10) < 0) { return -1;}
+ }
+ return 0;
+}
+int skip_constructor_binlog_msg_update (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_long (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_binlog_reset_authorization (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ return 0;
+}
+int skip_constructor_contacts_blocked (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8c1b8fb4 && T->type->name != 0x73e4704b)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x561bc879, .id = "ContactBlocked", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_contacts_blocked_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8c1b8fb4 && T->type->name != 0x73e4704b)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x561bc879, .id = "ContactBlocked", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_contacts_contacts_not_modified (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd8c02560 && T->type->name != 0x273fda9f)) { return -1; }
+ return 0;
+}
+int skip_constructor_contacts_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd8c02560 && T->type->name != 0x273fda9f)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf911c994, .id = "Contact", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_contacts_found (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0566000e && T->type->name != 0xfa99fff1)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xea879f95, .id = "ContactFound", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_contacts_imported_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xad524315 && T->type->name != 0x52adbcea)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xd0028438, .id = "ImportedContact", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_contacts_link (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3ace484c && T->type->name != 0xc531b7b3)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_contact_link (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_contact_link (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_user (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_contacts_suggested (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5649dcc5 && T->type->name != 0xa9b6233a)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3de191a1, .id = "ContactSuggested", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_geochats_located (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x48feb267 && T->type->name != 0xb7014d98)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3631cf4c, .id = "ChatLocated", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_geochats_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6d0a0e59 && T->type->name != 0x92f5f1a6)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_geochats_messages_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6d0a0e59 && T->type->name != 0x92f5f1a6)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_geochats_stated_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17b1578b && T->type->name != 0xe84ea874)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_geo_chat_message (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_help_app_update (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4ddd9627 && T->type->name != 0xb22269d8)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bool (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_help_no_app_update (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4ddd9627 && T->type->name != 0xb22269d8)) { return -1; }
+ return 0;
+}
+int skip_constructor_help_invite_text (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x18cb9f78 && T->type->name != 0xe7346087)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_help_support (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17c6b5f6 && T->type->name != 0xe8394a09)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_user (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_messages_affected_history (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb45c69d1 && T->type->name != 0x4ba3962e)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_messages_affected_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x84d19185 && T->type->name != 0x7b2e6e7a)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_messages_all_stickers_not_modified (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb485502f && T->type->name != 0x4b7aafd0)) { return -1; }
+ return 0;
+}
+int skip_constructor_messages_all_stickers (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb485502f && T->type->name != 0x4b7aafd0)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x12b299d4, .id = "StickerPack", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa7a43b17, .id = "StickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_messages_chat_full (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe5d7d19c && T->type->name != 0x1a282e63)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02a614, .id = "ChatFull", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_chat_full (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_messages_chats (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x64ff9fd5 && T->type->name != 0x9b00602a)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_messages_dh_config_not_modified (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xecc058e8 && T->type->name != 0x133fa717)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_messages_dh_config (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xecc058e8 && T->type->name != 0x133fa717)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_messages_dialogs (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x645af8b3 && T->type->name != 0x9ba5074c)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc1dd804a, .id = "Dialog", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_messages_dialogs_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x645af8b3 && T->type->name != 0x9ba5074c)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc1dd804a, .id = "Dialog", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field5) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_messages_message_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3f4e0648 && T->type->name != 0xc0b1f9b7)) { return -1; }
+ return 0;
+}
+int skip_constructor_messages_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8735e464 && T->type->name != 0x78ca1b9b)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_messages_messages_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8735e464 && T->type->name != 0x78ca1b9b)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field4) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_messages_sent_encrypted_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc29c7607 && T->type->name != 0x3d6389f8)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_messages_sent_encrypted_file (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc29c7607 && T->type->name != 0x3d6389f8)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x886fd032, .id = "EncryptedFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_encrypted_file (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_messages_sent_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x799ce190 && T->type->name != 0x86631e6f)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_message_media (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field5) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_messages_sent_message_link (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x799ce190 && T->type->name != 0x86631e6f)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_message_media (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3ace484c, .id = "contacts.Link", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field6) < 0) { return -1;}
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field7) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_messages_sticker_set (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb60a24a6 && T->type->name != 0x49f5db59)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa7a43b17, .id = "StickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_sticker_set (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x12b299d4, .id = "StickerPack", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_messages_stickers_not_modified (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bfa5710 && T->type->name != 0x8405a8ef)) { return -1; }
+ return 0;
+}
+int skip_constructor_messages_stickers (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bfa5710 && T->type->name != 0x8405a8ef)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_string (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_photos_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x20212ca8 && T->type->name != 0xdfded357)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_photo (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_photos_photos (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x98cf75f1 && T->type->name != 0x67308a0e)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_photos_photos_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x98cf75f1 && T->type->name != 0x67308a0e)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_storage_file_unknown (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int skip_constructor_storage_file_jpeg (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int skip_constructor_storage_file_gif (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int skip_constructor_storage_file_png (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int skip_constructor_storage_file_pdf (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int skip_constructor_storage_file_mp3 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int skip_constructor_storage_file_mov (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int skip_constructor_storage_file_partial (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int skip_constructor_storage_file_mp4 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int skip_constructor_storage_file_webp (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int skip_constructor_updates_difference_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf57a2419 && T->type->name != 0x0a85dbe6)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_updates_difference (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf57a2419 && T->type->name != 0x0a85dbe6)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xce6b8a1e, .id = "EncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa56c2a3e, .id = "updates.State", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_updates_state (field6) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_updates_difference_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf57a2419 && T->type->name != 0x0a85dbe6)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xce6b8a1e, .id = "EncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (skip_type_vector (field5) < 0) { return -1;}
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa56c2a3e, .id = "updates.State", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_updates_state (field6) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_updates_state (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa56c2a3e && T->type->name != 0x5a93d5c1)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field4) < 0) { return -1;}
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field5) < 0) { return -1;}
+ return 0;
+}
+int skip_constructor_upload_file (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x096a18d5 && T->type->name != 0xf695e72a)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3e2838a8, .id = "storage.FileType", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_storage_file_type (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_int (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (skip_type_bare_bytes (field3) < 0) { return -1;}
+ return 0;
+}
+int skip_type_account_days_t_t_l (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xb8d0afdf: return skip_constructor_account_days_t_t_l (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_account_days_t_t_l (struct paramed_type *T) {
+ if (skip_constructor_account_days_t_t_l (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_audio (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x586988d8: return skip_constructor_audio_empty (T);
+ case 0xc7ac6496: return skip_constructor_audio (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_audio (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_audio_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_audio (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_authorization (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x7bf2e6f6: return skip_constructor_authorization (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_authorization (struct paramed_type *T) {
+ if (skip_constructor_authorization (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_bool (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xbc799737: return skip_constructor_bool_false (T);
+ case 0x997275b5: return skip_constructor_bool_true (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_bool (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_bool_false (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_bool_true (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_bot_command (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xc27ac8c7: return skip_constructor_bot_command (T);
+ case 0xb79d22ab: return skip_constructor_bot_command_old (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_bot_command (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_bot_command (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_bot_command_old (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_bot_info (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xbb2e37ce: return skip_constructor_bot_info_empty (T);
+ case 0x09cf585d: return skip_constructor_bot_info (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_bot_info (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_bot_info_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_bot_info (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_bytes (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x0ee1379f: return skip_constructor_bytes (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_bytes (struct paramed_type *T) {
+ if (skip_constructor_bytes (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_chat (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x9ba2d800: return skip_constructor_chat_empty (T);
+ case 0x6e9c9bc7: return skip_constructor_chat (T);
+ case 0xfb0ccc41: return skip_constructor_chat_forbidden (T);
+ case 0x75eaea5a: return skip_constructor_geo_chat (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_chat (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_chat_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_chat (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_chat_forbidden (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_geo_chat (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_chat_full (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x2e02a614: return skip_constructor_chat_full (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_chat_full (struct paramed_type *T) {
+ if (skip_constructor_chat_full (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_chat_invite (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x5a686d7c: return skip_constructor_chat_invite_already (T);
+ case 0xce917dcd: return skip_constructor_chat_invite (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_chat_invite (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_chat_invite_already (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_chat_invite (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_chat_located (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x3631cf4c: return skip_constructor_chat_located (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_chat_located (struct paramed_type *T) {
+ if (skip_constructor_chat_located (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_chat_participant (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xc8d7493e: return skip_constructor_chat_participant (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_chat_participant (struct paramed_type *T) {
+ if (skip_constructor_chat_participant (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_chat_participants (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x0fd2bb8a: return skip_constructor_chat_participants_forbidden (T);
+ case 0x7841b415: return skip_constructor_chat_participants (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_chat_participants (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_chat_participants_forbidden (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_chat_participants (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_chat_photo (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x37c1011c: return skip_constructor_chat_photo_empty (T);
+ case 0x6153276a: return skip_constructor_chat_photo (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_chat_photo (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_chat_photo_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_chat_photo (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_client_d_h_inner_data (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x6643b654: return skip_constructor_client_d_h_inner_data (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_client_d_h_inner_data (struct paramed_type *T) {
+ if (skip_constructor_client_d_h_inner_data (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_config (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x4e32b894: return skip_constructor_config (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_config (struct paramed_type *T) {
+ if (skip_constructor_config (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_contact (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xf911c994: return skip_constructor_contact (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_contact (struct paramed_type *T) {
+ if (skip_constructor_contact (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_contact_blocked (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x561bc879: return skip_constructor_contact_blocked (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_contact_blocked (struct paramed_type *T) {
+ if (skip_constructor_contact_blocked (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_contact_found (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xea879f95: return skip_constructor_contact_found (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_contact_found (struct paramed_type *T) {
+ if (skip_constructor_contact_found (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_contact_link (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x5f4f9247: return skip_constructor_contact_link_unknown (T);
+ case 0xfeedd3ad: return skip_constructor_contact_link_none (T);
+ case 0x268f3f59: return skip_constructor_contact_link_has_phone (T);
+ case 0xd502c2d0: return skip_constructor_contact_link_contact (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_contact_link (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_contact_link_unknown (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_contact_link_none (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_contact_link_has_phone (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_contact_link_contact (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_contact_status (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xd3680c61: return skip_constructor_contact_status (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_contact_status (struct paramed_type *T) {
+ if (skip_constructor_contact_status (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_contact_suggested (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x3de191a1: return skip_constructor_contact_suggested (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_contact_suggested (struct paramed_type *T) {
+ if (skip_constructor_contact_suggested (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_dc_option (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x2ec2a43c: return skip_constructor_dc_option_l28 (T);
+ case 0x05d8c6cc: return skip_constructor_dc_option (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_dc_option (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_dc_option_l28 (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_dc_option (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_decrypted_message (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x204d3878: return skip_constructor_decrypted_message (T);
+ case 0x73164160: return skip_constructor_decrypted_message_service (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_decrypted_message (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_decrypted_message (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_service (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_decrypted_message_action (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xa1733aec: return skip_constructor_decrypted_message_action_set_message_t_t_l (T);
+ case 0x0c4f40be: return skip_constructor_decrypted_message_action_read_messages (T);
+ case 0x65614304: return skip_constructor_decrypted_message_action_delete_messages (T);
+ case 0x8ac1f475: return skip_constructor_decrypted_message_action_screenshot_messages (T);
+ case 0x6719e45c: return skip_constructor_decrypted_message_action_flush_history (T);
+ case 0x511110b0: return skip_constructor_decrypted_message_action_resend (T);
+ case 0xf3048883: return skip_constructor_decrypted_message_action_notify_layer (T);
+ case 0xccb27641: return skip_constructor_decrypted_message_action_typing (T);
+ case 0xf3c9611b: return skip_constructor_decrypted_message_action_request_key (T);
+ case 0x6fe1735b: return skip_constructor_decrypted_message_action_accept_key (T);
+ case 0xdd05ec6b: return skip_constructor_decrypted_message_action_abort_key (T);
+ case 0xec2e0b9b: return skip_constructor_decrypted_message_action_commit_key (T);
+ case 0xa82fdd63: return skip_constructor_decrypted_message_action_noop (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_decrypted_message_action (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_decrypted_message_action_set_message_t_t_l (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_action_read_messages (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_action_delete_messages (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_action_screenshot_messages (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_action_flush_history (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_action_resend (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_action_notify_layer (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_action_typing (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_action_request_key (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_action_accept_key (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_action_abort_key (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_action_commit_key (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_action_noop (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_decrypted_message_layer (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x1be31789: return skip_constructor_decrypted_message_layer (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_decrypted_message_layer (struct paramed_type *T) {
+ if (skip_constructor_decrypted_message_layer (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_decrypted_message_media (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x089f5c4a: return skip_constructor_decrypted_message_media_empty (T);
+ case 0x32798a8c: return skip_constructor_decrypted_message_media_photo (T);
+ case 0x35480a59: return skip_constructor_decrypted_message_media_geo_point (T);
+ case 0x588a0a97: return skip_constructor_decrypted_message_media_contact (T);
+ case 0xb095434b: return skip_constructor_decrypted_message_media_document (T);
+ case 0x524a415d: return skip_constructor_decrypted_message_media_video (T);
+ case 0x57e0a9cb: return skip_constructor_decrypted_message_media_audio (T);
+ case 0xfa95b0dd: return skip_constructor_decrypted_message_media_external_document (T);
+ case 0x4cee6ef3: return skip_constructor_decrypted_message_media_video_l12 (T);
+ case 0x6080758f: return skip_constructor_decrypted_message_media_audio_l12 (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_decrypted_message_media (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_decrypted_message_media_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_media_photo (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_media_geo_point (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_media_contact (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_media_document (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_media_video (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_media_audio (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_media_external_document (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_media_video_l12 (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_decrypted_message_media_audio_l12 (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_dialog (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xc1dd804a: return skip_constructor_dialog (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_dialog (struct paramed_type *T) {
+ if (skip_constructor_dialog (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_disabled_feature (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xae636f24: return skip_constructor_disabled_feature (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_disabled_feature (struct paramed_type *T) {
+ if (skip_constructor_disabled_feature (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_document (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x36f8c871: return skip_constructor_document_empty (T);
+ case 0xf9a39f4f: return skip_constructor_document (T);
+ case 0x9efc6326: return skip_constructor_document_l19 (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_document (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_document_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_document (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_document_l19 (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_document_attribute (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x6c37c15c: return skip_constructor_document_attribute_image_size (T);
+ case 0x11b58939: return skip_constructor_document_attribute_animated (T);
+ case 0x994c9882: return skip_constructor_document_attribute_sticker_l28 (T);
+ case 0x3a556302: return skip_constructor_document_attribute_sticker (T);
+ case 0x5910cccb: return skip_constructor_document_attribute_video (T);
+ case 0x051448e5: return skip_constructor_document_attribute_audio (T);
+ case 0x15590068: return skip_constructor_document_attribute_filename (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_document_attribute (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_document_attribute_image_size (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_document_attribute_animated (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_document_attribute_sticker_l28 (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_document_attribute_sticker (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_document_attribute_video (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_document_attribute_audio (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_document_attribute_filename (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_double (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x2210c154: return skip_constructor_double (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_double (struct paramed_type *T) {
+ if (skip_constructor_double (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_encrypted_chat (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xab7ec0a0: return skip_constructor_encrypted_chat_empty (T);
+ case 0x3bf703dc: return skip_constructor_encrypted_chat_waiting (T);
+ case 0xc878527e: return skip_constructor_encrypted_chat_requested (T);
+ case 0xfa56ce36: return skip_constructor_encrypted_chat (T);
+ case 0x13d6dd27: return skip_constructor_encrypted_chat_discarded (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_encrypted_chat (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_encrypted_chat_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_encrypted_chat_waiting (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_encrypted_chat_requested (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_encrypted_chat (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_encrypted_chat_discarded (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_encrypted_file (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xc21f497e: return skip_constructor_encrypted_file_empty (T);
+ case 0x4a70994c: return skip_constructor_encrypted_file (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_encrypted_file (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_encrypted_file_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_encrypted_file (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_encrypted_message (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xed18c118: return skip_constructor_encrypted_message (T);
+ case 0x23734b06: return skip_constructor_encrypted_message_service (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_encrypted_message (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_encrypted_message (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_encrypted_message_service (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_error (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xc4b9f9bb: return skip_constructor_error (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_error (struct paramed_type *T) {
+ if (skip_constructor_error (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_exported_chat_invite (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x69df3769: return skip_constructor_chat_invite_empty (T);
+ case 0xfc2e05bc: return skip_constructor_chat_invite_exported (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_exported_chat_invite (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_chat_invite_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_chat_invite_exported (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_file_location (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x7c596b46: return skip_constructor_file_location_unavailable (T);
+ case 0x53d69076: return skip_constructor_file_location (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_file_location (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_file_location_unavailable (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_file_location (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_geo_chat_message (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x60311a9b: return skip_constructor_geo_chat_message_empty (T);
+ case 0x4505f8e1: return skip_constructor_geo_chat_message (T);
+ case 0xd34fa24e: return skip_constructor_geo_chat_message_service (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_geo_chat_message (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_geo_chat_message_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_geo_chat_message (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_geo_chat_message_service (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_geo_point (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x1117dd5f: return skip_constructor_geo_point_empty (T);
+ case 0x2049d70c: return skip_constructor_geo_point (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_geo_point (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_geo_point_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_geo_point (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_imported_contact (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xd0028438: return skip_constructor_imported_contact (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_imported_contact (struct paramed_type *T) {
+ if (skip_constructor_imported_contact (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_input_app_event (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x770656a8: return skip_constructor_input_app_event (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_input_app_event (struct paramed_type *T) {
+ if (skip_constructor_input_app_event (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_input_audio (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xd95adc84: return skip_constructor_input_audio_empty (T);
+ case 0x77d440ff: return skip_constructor_input_audio (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_input_audio (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_audio_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_audio (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_input_chat_photo (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x1ca48f57: return skip_constructor_input_chat_photo_empty (T);
+ case 0x94254732: return skip_constructor_input_chat_uploaded_photo (T);
+ case 0xb2e1bf08: return skip_constructor_input_chat_photo (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_input_chat_photo (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_chat_photo_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_chat_uploaded_photo (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_chat_photo (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_input_contact (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xf392b7f4: return skip_constructor_input_phone_contact (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_input_contact (struct paramed_type *T) {
+ if (skip_constructor_input_phone_contact (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_input_document (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x72f0eaae: return skip_constructor_input_document_empty (T);
+ case 0x18798952: return skip_constructor_input_document (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_input_document (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_document_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_document (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_input_encrypted_chat (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xf141b5e1: return skip_constructor_input_encrypted_chat (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_input_encrypted_chat (struct paramed_type *T) {
+ if (skip_constructor_input_encrypted_chat (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_input_encrypted_file (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x1837c364: return skip_constructor_input_encrypted_file_empty (T);
+ case 0x64bd0306: return skip_constructor_input_encrypted_file_uploaded (T);
+ case 0x5a17b5e5: return skip_constructor_input_encrypted_file (T);
+ case 0x2dc173c8: return skip_constructor_input_encrypted_file_big_uploaded (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_input_encrypted_file (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_encrypted_file_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_encrypted_file_uploaded (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_encrypted_file (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_encrypted_file_big_uploaded (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_input_file (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xf52ff27f: return skip_constructor_input_file (T);
+ case 0xfa4f0bb5: return skip_constructor_input_file_big (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_input_file (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_file (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_file_big (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_input_file_location (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x14637196: return skip_constructor_input_file_location (T);
+ case 0x3d0364ec: return skip_constructor_input_video_file_location (T);
+ case 0xf5235d55: return skip_constructor_input_encrypted_file_location (T);
+ case 0x74dc404d: return skip_constructor_input_audio_file_location (T);
+ case 0x4e45abe9: return skip_constructor_input_document_file_location (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_input_file_location (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_file_location (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_video_file_location (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_encrypted_file_location (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_audio_file_location (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_document_file_location (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_input_geo_chat (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x74d456fa: return skip_constructor_input_geo_chat (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_input_geo_chat (struct paramed_type *T) {
+ if (skip_constructor_input_geo_chat (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_input_geo_point (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xe4c123d6: return skip_constructor_input_geo_point_empty (T);
+ case 0xf3b7acc9: return skip_constructor_input_geo_point (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_input_geo_point (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_geo_point_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_geo_point (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_input_media (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x9664f57f: return skip_constructor_input_media_empty (T);
+ case 0xf7aff1c0: return skip_constructor_input_media_uploaded_photo (T);
+ case 0xe9bfb4f3: return skip_constructor_input_media_photo (T);
+ case 0xf9c44144: return skip_constructor_input_media_geo_point (T);
+ case 0xa6e45987: return skip_constructor_input_media_contact (T);
+ case 0xe13fd4bc: return skip_constructor_input_media_uploaded_video (T);
+ case 0x96fb97dc: return skip_constructor_input_media_uploaded_thumb_video (T);
+ case 0x936a4ebd: return skip_constructor_input_media_video (T);
+ case 0x4e498cab: return skip_constructor_input_media_uploaded_audio (T);
+ case 0x89938781: return skip_constructor_input_media_audio (T);
+ case 0xffe76b78: return skip_constructor_input_media_uploaded_document (T);
+ case 0x41481486: return skip_constructor_input_media_uploaded_thumb_document (T);
+ case 0xd184e841: return skip_constructor_input_media_document (T);
+ case 0x2827a81a: return skip_constructor_input_media_venue (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_input_media (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_media_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_media_uploaded_photo (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_media_photo (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_media_geo_point (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_media_contact (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_media_uploaded_video (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_media_uploaded_thumb_video (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_media_video (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_media_uploaded_audio (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_media_audio (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_media_uploaded_document (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_media_uploaded_thumb_document (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_media_document (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_media_venue (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_input_notify_peer (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xb8bc5b0c: return skip_constructor_input_notify_peer (T);
+ case 0x193b4417: return skip_constructor_input_notify_users (T);
+ case 0x4a95e84e: return skip_constructor_input_notify_chats (T);
+ case 0xa429b886: return skip_constructor_input_notify_all (T);
+ case 0x4d8ddec8: return skip_constructor_input_notify_geo_chat_peer (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_input_notify_peer (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_notify_peer (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_notify_users (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_notify_chats (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_notify_all (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_notify_geo_chat_peer (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_input_peer (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x7f3b18ea: return skip_constructor_input_peer_empty (T);
+ case 0x7da07ec9: return skip_constructor_input_peer_self (T);
+ case 0x1023dbe8: return skip_constructor_input_peer_contact (T);
+ case 0x9b447325: return skip_constructor_input_peer_foreign (T);
+ case 0x179be863: return skip_constructor_input_peer_chat (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_input_peer (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_peer_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_peer_self (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_peer_contact (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_peer_foreign (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_peer_chat (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_input_peer_notify_events (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xf03064d8: return skip_constructor_input_peer_notify_events_empty (T);
+ case 0xe86a2c74: return skip_constructor_input_peer_notify_events_all (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_input_peer_notify_events (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_peer_notify_events_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_peer_notify_events_all (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_input_peer_notify_settings (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x46a2ce98: return skip_constructor_input_peer_notify_settings (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_input_peer_notify_settings (struct paramed_type *T) {
+ if (skip_constructor_input_peer_notify_settings (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_input_photo (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x1cd7bf0d: return skip_constructor_input_photo_empty (T);
+ case 0xfb95c6c4: return skip_constructor_input_photo (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_input_photo (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_photo_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_photo (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_input_photo_crop (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xade6b004: return skip_constructor_input_photo_crop_auto (T);
+ case 0xd9915325: return skip_constructor_input_photo_crop (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_input_photo_crop (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_photo_crop_auto (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_photo_crop (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_input_privacy_key (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x4f96cb18: return skip_constructor_input_privacy_key_status_timestamp (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_input_privacy_key (struct paramed_type *T) {
+ if (skip_constructor_input_privacy_key_status_timestamp (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_input_privacy_rule (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x0d09e07b: return skip_constructor_input_privacy_value_allow_contacts (T);
+ case 0x184b35ce: return skip_constructor_input_privacy_value_allow_all (T);
+ case 0x131cc67f: return skip_constructor_input_privacy_value_allow_users (T);
+ case 0x0ba52007: return skip_constructor_input_privacy_value_disallow_contacts (T);
+ case 0xd66b66c9: return skip_constructor_input_privacy_value_disallow_all (T);
+ case 0x90110467: return skip_constructor_input_privacy_value_disallow_users (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_input_privacy_rule (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_privacy_value_allow_contacts (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_privacy_value_allow_all (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_privacy_value_allow_users (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_privacy_value_disallow_contacts (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_privacy_value_disallow_all (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_privacy_value_disallow_users (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_input_sticker_set (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xffb62b95: return skip_constructor_input_sticker_set_empty (T);
+ case 0x9de7a269: return skip_constructor_input_sticker_set_i_d (T);
+ case 0x861cc8a0: return skip_constructor_input_sticker_set_short_name (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_input_sticker_set (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_sticker_set_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_sticker_set_i_d (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_sticker_set_short_name (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_input_user (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xb98886cf: return skip_constructor_input_user_empty (T);
+ case 0xf7c1b13f: return skip_constructor_input_user_self (T);
+ case 0x86e94f65: return skip_constructor_input_user_contact (T);
+ case 0x655e74ff: return skip_constructor_input_user_foreign (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_input_user (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_user_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_user_self (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_user_contact (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_user_foreign (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_input_video (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x5508ec75: return skip_constructor_input_video_empty (T);
+ case 0xee579652: return skip_constructor_input_video (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_input_video (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_video_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_video (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_int (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xa8509bda: return skip_constructor_int (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_int (struct paramed_type *T) {
+ if (skip_constructor_int (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_int128 (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x7d36c439: return skip_constructor_int128 (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_int128 (struct paramed_type *T) {
+ if (skip_constructor_int128 (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_int256 (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xf2c798b3: return skip_constructor_int256 (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_int256 (struct paramed_type *T) {
+ if (skip_constructor_int256 (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_keyboard_button (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xa2fa4880: return skip_constructor_keyboard_button (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_keyboard_button (struct paramed_type *T) {
+ if (skip_constructor_keyboard_button (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_keyboard_button_row (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x77608b83: return skip_constructor_keyboard_button_row (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_keyboard_button_row (struct paramed_type *T) {
+ if (skip_constructor_keyboard_button_row (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_long (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x22076cba: return skip_constructor_long (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_long (struct paramed_type *T) {
+ if (skip_constructor_long (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_message (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x83e5de54: return skip_constructor_message_empty (T);
+ case 0xc3060325: return skip_constructor_message (T);
+ case 0x1d86f70e: return skip_constructor_message_service (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_message (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_message_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_service (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_message_action (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xb6aef7b0: return skip_constructor_message_action_empty (T);
+ case 0xa6638b9a: return skip_constructor_message_action_chat_create (T);
+ case 0xb5a1ce5a: return skip_constructor_message_action_chat_edit_title (T);
+ case 0x7fcb13a8: return skip_constructor_message_action_chat_edit_photo (T);
+ case 0x95e3fbef: return skip_constructor_message_action_chat_delete_photo (T);
+ case 0x5e3cfc4b: return skip_constructor_message_action_chat_add_user (T);
+ case 0xb2ae9b0c: return skip_constructor_message_action_chat_delete_user (T);
+ case 0x6f038ebc: return skip_constructor_message_action_geo_chat_create (T);
+ case 0x0c7d53de: return skip_constructor_message_action_geo_chat_checkin (T);
+ case 0xf89cf5e8: return skip_constructor_message_action_chat_joined_by_link (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_message_action (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_message_action_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_action_chat_create (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_action_chat_edit_title (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_action_chat_edit_photo (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_action_chat_delete_photo (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_action_chat_add_user (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_action_chat_delete_user (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_action_geo_chat_create (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_action_geo_chat_checkin (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_action_chat_joined_by_link (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_message_media (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x3ded6320: return skip_constructor_message_media_empty (T);
+ case 0x3d8ce53d: return skip_constructor_message_media_photo (T);
+ case 0x5bcf1675: return skip_constructor_message_media_video (T);
+ case 0x56e0d474: return skip_constructor_message_media_geo (T);
+ case 0x5e7d2f39: return skip_constructor_message_media_contact (T);
+ case 0x9f84f49e: return skip_constructor_message_media_unsupported (T);
+ case 0x2fda2204: return skip_constructor_message_media_document (T);
+ case 0xc6b68300: return skip_constructor_message_media_audio (T);
+ case 0xa32dd600: return skip_constructor_message_media_web_page (T);
+ case 0x7912b71f: return skip_constructor_message_media_venue (T);
+ case 0xc8c45a2a: return skip_constructor_message_media_photo_l27 (T);
+ case 0xa2d24290: return skip_constructor_message_media_video_l27 (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_message_media (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_message_media_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_media_photo (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_media_video (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_media_geo (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_media_contact (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_media_unsupported (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_media_document (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_media_audio (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_media_web_page (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_media_venue (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_media_photo_l27 (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_message_media_video_l27 (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_messages_filter (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x57e2f66c: return skip_constructor_input_messages_filter_empty (T);
+ case 0x9609a51c: return skip_constructor_input_messages_filter_photos (T);
+ case 0x9fc00e65: return skip_constructor_input_messages_filter_video (T);
+ case 0x56e9f0e4: return skip_constructor_input_messages_filter_photo_video (T);
+ case 0xd95e73bb: return skip_constructor_input_messages_filter_photo_video_documents (T);
+ case 0x9eddf188: return skip_constructor_input_messages_filter_document (T);
+ case 0xcfc87522: return skip_constructor_input_messages_filter_audio (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_messages_filter (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_input_messages_filter_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_messages_filter_photos (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_messages_filter_video (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_messages_filter_photo_video (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_messages_filter_photo_video_documents (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_messages_filter_document (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_input_messages_filter_audio (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_nearest_dc (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x8e1a1775: return skip_constructor_nearest_dc (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_nearest_dc (struct paramed_type *T) {
+ if (skip_constructor_nearest_dc (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_notify_peer (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x9fd40bd8: return skip_constructor_notify_peer (T);
+ case 0xb4c83b4c: return skip_constructor_notify_users (T);
+ case 0xc007cec3: return skip_constructor_notify_chats (T);
+ case 0x74d07c60: return skip_constructor_notify_all (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_notify_peer (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_notify_peer (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_notify_users (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_notify_chats (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_notify_all (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_null (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x56730bcc: return skip_constructor_null (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_null (struct paramed_type *T) {
+ if (skip_constructor_null (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_p_q_inner_data (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x83c95aec: return skip_constructor_p_q_inner_data (T);
+ case 0x3c6a84d4: return skip_constructor_p_q_inner_data_temp (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_p_q_inner_data (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_p_q_inner_data (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_p_q_inner_data_temp (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_peer (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x9db1bc6d: return skip_constructor_peer_user (T);
+ case 0xbad0e5bb: return skip_constructor_peer_chat (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_peer (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_peer_user (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_peer_chat (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_peer_notify_events (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xadd53cb3: return skip_constructor_peer_notify_events_empty (T);
+ case 0x6d1ded88: return skip_constructor_peer_notify_events_all (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_peer_notify_events (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_peer_notify_events_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_peer_notify_events_all (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_peer_notify_settings (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x70a68512: return skip_constructor_peer_notify_settings_empty (T);
+ case 0x8d5e11ee: return skip_constructor_peer_notify_settings (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_peer_notify_settings (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_peer_notify_settings_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_peer_notify_settings (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_photo (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x2331b22d: return skip_constructor_photo_empty (T);
+ case 0xc3838076: return skip_constructor_photo (T);
+ case 0x22b56751: return skip_constructor_photo_l27 (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_photo (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_photo_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_photo (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_photo_l27 (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_photo_size (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x0e17e23c: return skip_constructor_photo_size_empty (T);
+ case 0x77bfb61b: return skip_constructor_photo_size (T);
+ case 0xe9a734fa: return skip_constructor_photo_cached_size (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_photo_size (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_photo_size_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_photo_size (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_photo_cached_size (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_privacy_key (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xbc2eab30: return skip_constructor_privacy_key_status_timestamp (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_privacy_key (struct paramed_type *T) {
+ if (skip_constructor_privacy_key_status_timestamp (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_privacy_rule (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xfffe1bac: return skip_constructor_privacy_value_allow_contacts (T);
+ case 0x65427b82: return skip_constructor_privacy_value_allow_all (T);
+ case 0x4d5bbe0c: return skip_constructor_privacy_value_allow_users (T);
+ case 0xf888fa1a: return skip_constructor_privacy_value_disallow_contacts (T);
+ case 0x8b73e763: return skip_constructor_privacy_value_disallow_all (T);
+ case 0x0c7f49b7: return skip_constructor_privacy_value_disallow_users (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_privacy_rule (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_privacy_value_allow_contacts (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_privacy_value_allow_all (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_privacy_value_allow_users (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_privacy_value_disallow_contacts (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_privacy_value_disallow_all (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_privacy_value_disallow_users (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_received_notify_message (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xa384b779: return skip_constructor_received_notify_message (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_received_notify_message (struct paramed_type *T) {
+ if (skip_constructor_received_notify_message (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_reply_markup (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xa03e5b85: return skip_constructor_reply_keyboard_hide (T);
+ case 0xf4108aa0: return skip_constructor_reply_keyboard_force_reply (T);
+ case 0x3502758c: return skip_constructor_reply_keyboard_markup (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_reply_markup (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_reply_keyboard_hide (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_reply_keyboard_force_reply (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_reply_keyboard_markup (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_res_p_q (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x05162463: return skip_constructor_res_p_q (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_res_p_q (struct paramed_type *T) {
+ if (skip_constructor_res_p_q (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_send_message_action (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x16bf744e: return skip_constructor_send_message_typing_action (T);
+ case 0xfd5ec8f5: return skip_constructor_send_message_cancel_action (T);
+ case 0xa187d66f: return skip_constructor_send_message_record_video_action (T);
+ case 0x92042ff7: return skip_constructor_send_message_upload_video_action_l27 (T);
+ case 0xe9763aec: return skip_constructor_send_message_upload_video_action (T);
+ case 0xd52f73f7: return skip_constructor_send_message_record_audio_action (T);
+ case 0xe6ac8a6f: return skip_constructor_send_message_upload_audio_action_l27 (T);
+ case 0xf351d7ab: return skip_constructor_send_message_upload_audio_action (T);
+ case 0xd1d34a26: return skip_constructor_send_message_upload_photo_action (T);
+ case 0x8faee98e: return skip_constructor_send_message_upload_document_action_l27 (T);
+ case 0xaa0cd9e4: return skip_constructor_send_message_upload_document_action (T);
+ case 0x176f8ba1: return skip_constructor_send_message_geo_location_action (T);
+ case 0x628cbc6f: return skip_constructor_send_message_choose_contact_action (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_send_message_action (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_send_message_typing_action (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_send_message_cancel_action (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_send_message_record_video_action (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_send_message_upload_video_action_l27 (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_send_message_upload_video_action (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_send_message_record_audio_action (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_send_message_upload_audio_action_l27 (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_send_message_upload_audio_action (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_send_message_upload_photo_action (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_send_message_upload_document_action_l27 (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_send_message_upload_document_action (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_send_message_geo_location_action (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_send_message_choose_contact_action (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_server_d_h_params (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x79cb045d: return skip_constructor_server_d_h_params_fail (T);
+ case 0xd0e8075c: return skip_constructor_server_d_h_params_ok (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_server_d_h_params (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_server_d_h_params_fail (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_server_d_h_params_ok (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_server_d_h_inner_data (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xb5890dba: return skip_constructor_server_d_h_inner_data (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_server_d_h_inner_data (struct paramed_type *T) {
+ if (skip_constructor_server_d_h_inner_data (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_set_client_d_h_params_answer (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x3bcbf734: return skip_constructor_dh_gen_ok (T);
+ case 0x46dc1fb9: return skip_constructor_dh_gen_retry (T);
+ case 0xa69dae02: return skip_constructor_dh_gen_fail (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_set_client_d_h_params_answer (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_dh_gen_ok (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_dh_gen_retry (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_dh_gen_fail (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_sticker_pack (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x12b299d4: return skip_constructor_sticker_pack (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_sticker_pack (struct paramed_type *T) {
+ if (skip_constructor_sticker_pack (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_sticker_set (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xa7a43b17: return skip_constructor_sticker_set (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_sticker_set (struct paramed_type *T) {
+ if (skip_constructor_sticker_set (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_string (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xb5286e24: return skip_constructor_string (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_string (struct paramed_type *T) {
+ if (skip_constructor_string (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_update (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x1f2b0afd: return skip_constructor_update_new_message (T);
+ case 0x4e90bfd6: return skip_constructor_update_message_i_d (T);
+ case 0xa20db0e5: return skip_constructor_update_delete_messages (T);
+ case 0x5c486927: return skip_constructor_update_user_typing (T);
+ case 0x9a65ea1f: return skip_constructor_update_chat_user_typing (T);
+ case 0x07761198: return skip_constructor_update_chat_participants (T);
+ case 0x1bfbd823: return skip_constructor_update_user_status (T);
+ case 0xa7332b73: return skip_constructor_update_user_name (T);
+ case 0x95313b0c: return skip_constructor_update_user_photo (T);
+ case 0x2575bbb9: return skip_constructor_update_contact_registered (T);
+ case 0x9d2e67c5: return skip_constructor_update_contact_link (T);
+ case 0x8f06529a: return skip_constructor_update_new_authorization (T);
+ case 0x5a68e3f7: return skip_constructor_update_new_geo_chat_message (T);
+ case 0x12bcbd9a: return skip_constructor_update_new_encrypted_message (T);
+ case 0x1710f156: return skip_constructor_update_encrypted_chat_typing (T);
+ case 0xb4a2e88d: return skip_constructor_update_encryption (T);
+ case 0x38fe25b7: return skip_constructor_update_encrypted_messages_read (T);
+ case 0x3a0eeb22: return skip_constructor_update_chat_participant_add (T);
+ case 0x6e5f8c22: return skip_constructor_update_chat_participant_delete (T);
+ case 0x8e5e9873: return skip_constructor_update_dc_options (T);
+ case 0x80ece81a: return skip_constructor_update_user_blocked (T);
+ case 0xbec268ef: return skip_constructor_update_notify_settings (T);
+ case 0x382dd3e4: return skip_constructor_update_service_notification (T);
+ case 0xee3b272a: return skip_constructor_update_privacy (T);
+ case 0x12b9417b: return skip_constructor_update_user_phone (T);
+ case 0x9961fd5c: return skip_constructor_update_read_history_inbox (T);
+ case 0x2f2f21bf: return skip_constructor_update_read_history_outbox (T);
+ case 0x2cc36971: return skip_constructor_update_web_page (T);
+ case 0x68c13933: return skip_constructor_update_read_messages_contents (T);
+ case 0x03114739: return skip_constructor_update_msg_update (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_update (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_update_new_message (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_message_i_d (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_delete_messages (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_user_typing (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_chat_user_typing (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_chat_participants (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_user_status (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_user_name (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_user_photo (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_contact_registered (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_contact_link (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_new_authorization (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_new_geo_chat_message (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_new_encrypted_message (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_encrypted_chat_typing (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_encryption (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_encrypted_messages_read (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_chat_participant_add (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_chat_participant_delete (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_dc_options (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_user_blocked (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_notify_settings (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_service_notification (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_privacy (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_user_phone (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_read_history_inbox (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_read_history_outbox (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_web_page (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_read_messages_contents (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_msg_update (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_updates (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xe317af7e: return skip_constructor_updates_too_long (T);
+ case 0xed5c2127: return skip_constructor_update_short_message (T);
+ case 0x52238b3c: return skip_constructor_update_short_chat_message (T);
+ case 0x78d4dec1: return skip_constructor_update_short (T);
+ case 0x725b04c3: return skip_constructor_updates_combined (T);
+ case 0x74ae4240: return skip_constructor_updates (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_updates (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_updates_too_long (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_short_message (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_short_chat_message (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_update_short (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_updates_combined (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_updates (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_user (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x200250ba: return skip_constructor_user_empty (T);
+ case 0x22e49072: return skip_constructor_user (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_user (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_user_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_user (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_user_full (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x5a89ac5b: return skip_constructor_user_full (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_user_full (struct paramed_type *T) {
+ if (skip_constructor_user_full (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_user_profile_photo (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x4f11bae1: return skip_constructor_user_profile_photo_empty (T);
+ case 0xd559d8c8: return skip_constructor_user_profile_photo (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_user_profile_photo (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_user_profile_photo_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_user_profile_photo (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_user_status (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x09d05049: return skip_constructor_user_status_empty (T);
+ case 0xedb93949: return skip_constructor_user_status_online (T);
+ case 0x008c703f: return skip_constructor_user_status_offline (T);
+ case 0xe26f42f1: return skip_constructor_user_status_recently (T);
+ case 0x07bf09fc: return skip_constructor_user_status_last_week (T);
+ case 0x77ebc742: return skip_constructor_user_status_last_month (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_user_status (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_user_status_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_user_status_online (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_user_status_offline (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_user_status_recently (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_user_status_last_week (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_user_status_last_month (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_vector (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x1cb5c415: return skip_constructor_vector (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_vector (struct paramed_type *T) {
+ if (skip_constructor_vector (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_video (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xc10658a8: return skip_constructor_video_empty (T);
+ case 0xee9f4a4d: return skip_constructor_video (T);
+ case 0x388fa391: return skip_constructor_video_l27 (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_video (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_video_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_video (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_video_l27 (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_wall_paper (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xccb03657: return skip_constructor_wall_paper (T);
+ case 0x63117f24: return skip_constructor_wall_paper_solid (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_wall_paper (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_wall_paper (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_wall_paper_solid (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_web_page (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xeb1477e8: return skip_constructor_web_page_empty (T);
+ case 0xc586da1c: return skip_constructor_web_page_pending (T);
+ case 0xa31ea0b5: return skip_constructor_web_page (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_web_page (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_web_page_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_web_page_pending (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_web_page (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_account_authorizations (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x1250abde: return skip_constructor_account_authorizations (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_account_authorizations (struct paramed_type *T) {
+ if (skip_constructor_account_authorizations (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_account_password (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x96dabc18: return skip_constructor_account_no_password (T);
+ case 0x7c18141c: return skip_constructor_account_password (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_account_password (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_account_no_password (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_account_password (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_account_password_input_settings (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xbcfc532c: return skip_constructor_account_password_input_settings (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_account_password_input_settings (struct paramed_type *T) {
+ if (skip_constructor_account_password_input_settings (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_account_password_settings (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xb7b72ab3: return skip_constructor_account_password_settings (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_account_password_settings (struct paramed_type *T) {
+ if (skip_constructor_account_password_settings (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_account_privacy_rules (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x554abb6f: return skip_constructor_account_privacy_rules (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_account_privacy_rules (struct paramed_type *T) {
+ if (skip_constructor_account_privacy_rules (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_account_sent_change_phone_code (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xa4f58c4c: return skip_constructor_account_sent_change_phone_code (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_account_sent_change_phone_code (struct paramed_type *T) {
+ if (skip_constructor_account_sent_change_phone_code (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_auth_authorization (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xff036af1: return skip_constructor_auth_authorization (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_auth_authorization (struct paramed_type *T) {
+ if (skip_constructor_auth_authorization (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_auth_checked_phone (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x811ea28e: return skip_constructor_auth_checked_phone (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_auth_checked_phone (struct paramed_type *T) {
+ if (skip_constructor_auth_checked_phone (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_auth_exported_authorization (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xdf969c2d: return skip_constructor_auth_exported_authorization (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_auth_exported_authorization (struct paramed_type *T) {
+ if (skip_constructor_auth_exported_authorization (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_auth_password_recovery (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x137948a5: return skip_constructor_auth_password_recovery (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_auth_password_recovery (struct paramed_type *T) {
+ if (skip_constructor_auth_password_recovery (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_auth_sent_code (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xefed51d9: return skip_constructor_auth_sent_code (T);
+ case 0xe325edcf: return skip_constructor_auth_sent_app_code (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_auth_sent_code (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_auth_sent_code (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_auth_sent_app_code (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_binlog_encr_key (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x0377168f: return skip_constructor_binlog_encr_key (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_binlog_encr_key (struct paramed_type *T) {
+ if (skip_constructor_binlog_encr_key (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_binlog_update (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x3b06de69: return skip_constructor_binlog_start (T);
+ case 0xf96feb32: return skip_constructor_binlog_dc_option (T);
+ case 0x7c0d22d8: return skip_constructor_binlog_dc_option_new (T);
+ case 0x71e8c156: return skip_constructor_binlog_auth_key (T);
+ case 0x9e83dbdc: return skip_constructor_binlog_default_dc (T);
+ case 0x26451bb5: return skip_constructor_binlog_dc_signed (T);
+ case 0x68a870e8: return skip_constructor_binlog_our_id (T);
+ case 0xeaeb7826: return skip_constructor_binlog_set_dh_params (T);
+ case 0x2ca8c939: return skip_constructor_binlog_set_pts (T);
+ case 0xd95738ac: return skip_constructor_binlog_set_qts (T);
+ case 0x1d0f4b52: return skip_constructor_binlog_set_date (T);
+ case 0x6eeb2989: return skip_constructor_binlog_set_seq (T);
+ case 0xee1b38e8: return skip_constructor_binlog_encr_chat_delete (T);
+ case 0x84977251: return skip_constructor_binlog_encr_chat_new (T);
+ case 0x9d49488d: return skip_constructor_binlog_encr_chat_exchange_new (T);
+ case 0xac55d447: return skip_constructor_binlog_user_delete (T);
+ case 0x127cf2f9: return skip_constructor_binlog_user_new (T);
+ case 0x0a10aa92: return skip_constructor_binlog_chat_new (T);
+ case 0x535475ea: return skip_constructor_binlog_chat_add_participant (T);
+ case 0x7dd1a1a2: return skip_constructor_binlog_chat_del_participant (T);
+ case 0x3c873416: return skip_constructor_binlog_set_msg_id (T);
+ case 0x847e77b1: return skip_constructor_binlog_message_delete (T);
+ case 0x427cfcdb: return skip_constructor_binlog_message_new (T);
+ case 0x6cf7cabc: return skip_constructor_binlog_message_encr_new (T);
+ case 0x6dd4d85f: return skip_constructor_binlog_msg_update (T);
+ case 0x83327955: return skip_constructor_binlog_reset_authorization (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_binlog_update (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_binlog_start (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_dc_option (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_dc_option_new (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_auth_key (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_default_dc (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_dc_signed (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_our_id (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_set_dh_params (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_set_pts (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_set_qts (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_set_date (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_set_seq (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_encr_chat_delete (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_encr_chat_new (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_encr_chat_exchange_new (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_user_delete (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_user_new (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_chat_new (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_chat_add_participant (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_chat_del_participant (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_set_msg_id (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_message_delete (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_message_new (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_message_encr_new (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_msg_update (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_binlog_reset_authorization (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_contacts_blocked (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x1c138d15: return skip_constructor_contacts_blocked (T);
+ case 0x900802a1: return skip_constructor_contacts_blocked_slice (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_contacts_blocked (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_contacts_blocked (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_contacts_blocked_slice (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_contacts_contacts (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xb74ba9d2: return skip_constructor_contacts_contacts_not_modified (T);
+ case 0x6f8b8cb2: return skip_constructor_contacts_contacts (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_contacts_contacts (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_contacts_contacts_not_modified (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_contacts_contacts (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_contacts_found (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x0566000e: return skip_constructor_contacts_found (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_contacts_found (struct paramed_type *T) {
+ if (skip_constructor_contacts_found (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_contacts_imported_contacts (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xad524315: return skip_constructor_contacts_imported_contacts (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_contacts_imported_contacts (struct paramed_type *T) {
+ if (skip_constructor_contacts_imported_contacts (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_contacts_link (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x3ace484c: return skip_constructor_contacts_link (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_contacts_link (struct paramed_type *T) {
+ if (skip_constructor_contacts_link (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_contacts_suggested (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x5649dcc5: return skip_constructor_contacts_suggested (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_contacts_suggested (struct paramed_type *T) {
+ if (skip_constructor_contacts_suggested (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_geochats_located (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x48feb267: return skip_constructor_geochats_located (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_geochats_located (struct paramed_type *T) {
+ if (skip_constructor_geochats_located (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_geochats_messages (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xd1526db1: return skip_constructor_geochats_messages (T);
+ case 0xbc5863e8: return skip_constructor_geochats_messages_slice (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_geochats_messages (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_geochats_messages (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_geochats_messages_slice (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_geochats_stated_message (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x17b1578b: return skip_constructor_geochats_stated_message (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_geochats_stated_message (struct paramed_type *T) {
+ if (skip_constructor_geochats_stated_message (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_help_app_update (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x8987f311: return skip_constructor_help_app_update (T);
+ case 0xc45a6536: return skip_constructor_help_no_app_update (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_help_app_update (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_help_app_update (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_help_no_app_update (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_help_invite_text (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x18cb9f78: return skip_constructor_help_invite_text (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_help_invite_text (struct paramed_type *T) {
+ if (skip_constructor_help_invite_text (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_help_support (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x17c6b5f6: return skip_constructor_help_support (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_help_support (struct paramed_type *T) {
+ if (skip_constructor_help_support (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_messages_affected_history (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xb45c69d1: return skip_constructor_messages_affected_history (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_messages_affected_history (struct paramed_type *T) {
+ if (skip_constructor_messages_affected_history (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_messages_affected_messages (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x84d19185: return skip_constructor_messages_affected_messages (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_messages_affected_messages (struct paramed_type *T) {
+ if (skip_constructor_messages_affected_messages (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_messages_all_stickers (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xe86602c3: return skip_constructor_messages_all_stickers_not_modified (T);
+ case 0x5ce352ec: return skip_constructor_messages_all_stickers (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_messages_all_stickers (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_messages_all_stickers_not_modified (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_messages_all_stickers (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_messages_chat_full (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xe5d7d19c: return skip_constructor_messages_chat_full (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_messages_chat_full (struct paramed_type *T) {
+ if (skip_constructor_messages_chat_full (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_messages_chats (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x64ff9fd5: return skip_constructor_messages_chats (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_messages_chats (struct paramed_type *T) {
+ if (skip_constructor_messages_chats (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_messages_dh_config (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xc0e24635: return skip_constructor_messages_dh_config_not_modified (T);
+ case 0x2c221edd: return skip_constructor_messages_dh_config (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_messages_dh_config (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_messages_dh_config_not_modified (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_messages_dh_config (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_messages_dialogs (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x15ba6c40: return skip_constructor_messages_dialogs (T);
+ case 0x71e094f3: return skip_constructor_messages_dialogs_slice (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_messages_dialogs (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_messages_dialogs (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_messages_dialogs_slice (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_messages_message (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x3f4e0648: return skip_constructor_messages_message_empty (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_messages_message (struct paramed_type *T) {
+ if (skip_constructor_messages_message_empty (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_messages_messages (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x8c718e87: return skip_constructor_messages_messages (T);
+ case 0x0b446ae3: return skip_constructor_messages_messages_slice (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_messages_messages (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_messages_messages (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_messages_messages_slice (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_messages_sent_encrypted_message (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x560f8935: return skip_constructor_messages_sent_encrypted_message (T);
+ case 0x9493ff32: return skip_constructor_messages_sent_encrypted_file (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_messages_sent_encrypted_message (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_messages_sent_encrypted_message (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_messages_sent_encrypted_file (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_messages_sent_message (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x4c3d47f3: return skip_constructor_messages_sent_message (T);
+ case 0x35a1a663: return skip_constructor_messages_sent_message_link (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_messages_sent_message (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_messages_sent_message (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_messages_sent_message_link (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_messages_sticker_set (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xb60a24a6: return skip_constructor_messages_sticker_set (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_messages_sticker_set (struct paramed_type *T) {
+ if (skip_constructor_messages_sticker_set (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_messages_stickers (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xf1749a22: return skip_constructor_messages_stickers_not_modified (T);
+ case 0x8a8ecd32: return skip_constructor_messages_stickers (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_messages_stickers (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_messages_stickers_not_modified (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_messages_stickers (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_photos_photo (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x20212ca8: return skip_constructor_photos_photo (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_photos_photo (struct paramed_type *T) {
+ if (skip_constructor_photos_photo (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_photos_photos (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x8dca6aa5: return skip_constructor_photos_photos (T);
+ case 0x15051f54: return skip_constructor_photos_photos_slice (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_photos_photos (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_photos_photos (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_photos_photos_slice (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_storage_file_type (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xaa963b05: return skip_constructor_storage_file_unknown (T);
+ case 0x007efe0e: return skip_constructor_storage_file_jpeg (T);
+ case 0xcae1aadf: return skip_constructor_storage_file_gif (T);
+ case 0x0a4f63c0: return skip_constructor_storage_file_png (T);
+ case 0xae1e508d: return skip_constructor_storage_file_pdf (T);
+ case 0x528a0677: return skip_constructor_storage_file_mp3 (T);
+ case 0x4b09ebbc: return skip_constructor_storage_file_mov (T);
+ case 0x40bc6f52: return skip_constructor_storage_file_partial (T);
+ case 0xb3cea0e4: return skip_constructor_storage_file_mp4 (T);
+ case 0x1081464c: return skip_constructor_storage_file_webp (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_storage_file_type (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_storage_file_unknown (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_storage_file_jpeg (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_storage_file_gif (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_storage_file_png (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_storage_file_pdf (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_storage_file_mp3 (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_storage_file_mov (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_storage_file_partial (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_storage_file_mp4 (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_storage_file_webp (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_updates_difference (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x5d75a138: return skip_constructor_updates_difference_empty (T);
+ case 0x00f49ca0: return skip_constructor_updates_difference (T);
+ case 0xa8fb1981: return skip_constructor_updates_difference_slice (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_updates_difference (struct paramed_type *T) {
+ int *save_in_ptr = in_ptr;
+ if (skip_constructor_updates_difference_empty (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_updates_difference (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ if (skip_constructor_updates_difference_slice (T) >= 0) { return 0; }
+ in_ptr = save_in_ptr;
+ return -1;
+}
+int skip_type_updates_state (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0xa56c2a3e: return skip_constructor_updates_state (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_updates_state (struct paramed_type *T) {
+ if (skip_constructor_updates_state (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_upload_file (struct paramed_type *T) {
+ if (in_remaining () < 4) { return -1;}
+ int magic = fetch_int ();
+ switch (magic) {
+ case 0x096a18d5: return skip_constructor_upload_file (T);
+ default: return -1;
+ }
+}
+int skip_type_bare_upload_file (struct paramed_type *T) {
+ if (skip_constructor_upload_file (T) >= 0) { return 0; }
+ return -1;
+}
+int skip_type_any (struct paramed_type *T) {
+ switch (T->type->name) {
+ case 0xb8d0afdf: return skip_type_account_days_t_t_l (T);
+ case 0x472f5020: return skip_type_bare_account_days_t_t_l (T);
+ case 0x9fc5ec4e: return skip_type_audio (T);
+ case 0x603a13b1: return skip_type_bare_audio (T);
+ case 0x7bf2e6f6: return skip_type_authorization (T);
+ case 0x840d1909: return skip_type_bare_authorization (T);
+ case 0x250be282: return skip_type_bool (T);
+ case 0xdaf41d7d: return skip_type_bare_bool (T);
+ case 0x75e7ea6c: return skip_type_bot_command (T);
+ case 0x8a181593: return skip_type_bare_bot_command (T);
+ case 0xb2e16f93: return skip_type_bot_info (T);
+ case 0x4d1e906c: return skip_type_bare_bot_info (T);
+ case 0x0ee1379f: return skip_type_bytes (T);
+ case 0xf11ec860: return skip_type_bare_bytes (T);
+ case 0x7bd865dc: return skip_type_chat (T);
+ case 0x84279a23: return skip_type_bare_chat (T);
+ case 0x2e02a614: return skip_type_chat_full (T);
+ case 0xd1fd59eb: return skip_type_bare_chat_full (T);
+ case 0x94f910b1: return skip_type_chat_invite (T);
+ case 0x6b06ef4e: return skip_type_bare_chat_invite (T);
+ case 0x3631cf4c: return skip_type_chat_located (T);
+ case 0xc9ce30b3: return skip_type_bare_chat_located (T);
+ case 0xc8d7493e: return skip_type_chat_participant (T);
+ case 0x3728b6c1: return skip_type_bare_chat_participant (T);
+ case 0x77930f9f: return skip_type_chat_participants (T);
+ case 0x886cf060: return skip_type_bare_chat_participants (T);
+ case 0x56922676: return skip_type_chat_photo (T);
+ case 0xa96dd989: return skip_type_bare_chat_photo (T);
+ case 0x6643b654: return skip_type_client_d_h_inner_data (T);
+ case 0x99bc49ab: return skip_type_bare_client_d_h_inner_data (T);
+ case 0x4e32b894: return skip_type_config (T);
+ case 0xb1cd476b: return skip_type_bare_config (T);
+ case 0xf911c994: return skip_type_contact (T);
+ case 0x06ee366b: return skip_type_bare_contact (T);
+ case 0x561bc879: return skip_type_contact_blocked (T);
+ case 0xa9e43786: return skip_type_bare_contact_blocked (T);
+ case 0xea879f95: return skip_type_contact_found (T);
+ case 0x1578606a: return skip_type_bare_contact_found (T);
+ case 0x522fbc63: return skip_type_contact_link (T);
+ case 0xadd0439c: return skip_type_bare_contact_link (T);
+ case 0xd3680c61: return skip_type_contact_status (T);
+ case 0x2c97f39e: return skip_type_bare_contact_status (T);
+ case 0x3de191a1: return skip_type_contact_suggested (T);
+ case 0xc21e6e5e: return skip_type_bare_contact_suggested (T);
+ case 0x2b1a62f0: return skip_type_dc_option (T);
+ case 0xd4e59d0f: return skip_type_bare_dc_option (T);
+ case 0x535b7918: return skip_type_decrypted_message (T);
+ case 0xaca486e7: return skip_type_bare_decrypted_message (T);
+ case 0x4e0eefde: return skip_type_decrypted_message_action (T);
+ case 0xb1f11021: return skip_type_bare_decrypted_message_action (T);
+ case 0x1be31789: return skip_type_decrypted_message_layer (T);
+ case 0xe41ce876: return skip_type_bare_decrypted_message_layer (T);
+ case 0x34e0d674: return skip_type_decrypted_message_media (T);
+ case 0xcb1f298b: return skip_type_bare_decrypted_message_media (T);
+ case 0xc1dd804a: return skip_type_dialog (T);
+ case 0x3e227fb5: return skip_type_bare_dialog (T);
+ case 0xae636f24: return skip_type_disabled_feature (T);
+ case 0x519c90db: return skip_type_bare_disabled_feature (T);
+ case 0x51a73418: return skip_type_document (T);
+ case 0xae58cbe7: return skip_type_bare_document (T);
+ case 0x97c637a3: return skip_type_document_attribute (T);
+ case 0x6839c85c: return skip_type_bare_document_attribute (T);
+ case 0x2210c154: return skip_type_double (T);
+ case 0xddef3eab: return skip_type_bare_double (T);
+ case 0xb1718213: return skip_type_encrypted_chat (T);
+ case 0x4e8e7dec: return skip_type_bare_encrypted_chat (T);
+ case 0x886fd032: return skip_type_encrypted_file (T);
+ case 0x77902fcd: return skip_type_bare_encrypted_file (T);
+ case 0xce6b8a1e: return skip_type_encrypted_message (T);
+ case 0x319475e1: return skip_type_bare_encrypted_message (T);
+ case 0xc4b9f9bb: return skip_type_error (T);
+ case 0x3b460644: return skip_type_bare_error (T);
+ case 0x95f132d5: return skip_type_exported_chat_invite (T);
+ case 0x6a0ecd2a: return skip_type_bare_exported_chat_invite (T);
+ case 0x2f8ffb30: return skip_type_file_location (T);
+ case 0xd07004cf: return skip_type_bare_file_location (T);
+ case 0xf67b4034: return skip_type_geo_chat_message (T);
+ case 0x0984bfcb: return skip_type_bare_geo_chat_message (T);
+ case 0x315e0a53: return skip_type_geo_point (T);
+ case 0xcea1f5ac: return skip_type_bare_geo_point (T);
+ case 0xd0028438: return skip_type_imported_contact (T);
+ case 0x2ffd7bc7: return skip_type_bare_imported_contact (T);
+ case 0x770656a8: return skip_type_input_app_event (T);
+ case 0x88f9a957: return skip_type_bare_input_app_event (T);
+ case 0xae8e9c7b: return skip_type_input_audio (T);
+ case 0x51716384: return skip_type_bare_input_audio (T);
+ case 0x3a60776d: return skip_type_input_chat_photo (T);
+ case 0xc59f8892: return skip_type_bare_input_chat_photo (T);
+ case 0xf392b7f4: return skip_type_input_contact (T);
+ case 0x0c6d480b: return skip_type_bare_input_contact (T);
+ case 0x6a8963fc: return skip_type_input_document (T);
+ case 0x95769c03: return skip_type_bare_input_document (T);
+ case 0xf141b5e1: return skip_type_input_encrypted_chat (T);
+ case 0x0ebe4a1e: return skip_type_bare_input_encrypted_chat (T);
+ case 0x0b5c064f: return skip_type_input_encrypted_file (T);
+ case 0xf4a3f9b0: return skip_type_bare_input_encrypted_file (T);
+ case 0x0f60f9ca: return skip_type_input_file (T);
+ case 0xf09f0635: return skip_type_bare_input_file (T);
+ case 0xe6daa38b: return skip_type_input_file_location (T);
+ case 0x19255c74: return skip_type_bare_input_file_location (T);
+ case 0x74d456fa: return skip_type_input_geo_chat (T);
+ case 0x8b2ba905: return skip_type_bare_input_geo_chat (T);
+ case 0x17768f1f: return skip_type_input_geo_point (T);
+ case 0xe88970e0: return skip_type_bare_input_geo_point (T);
+ case 0xb32c91dd: return skip_type_input_media (T);
+ case 0x4cd36e22: return skip_type_bare_input_media (T);
+ case 0x02b6911b: return skip_type_input_notify_peer (T);
+ case 0xfd496ee4: return skip_type_bare_input_notify_peer (T);
+ case 0x9e67268d: return skip_type_input_peer (T);
+ case 0x6198d972: return skip_type_bare_input_peer (T);
+ case 0x185a48ac: return skip_type_input_peer_notify_events (T);
+ case 0xe7a5b753: return skip_type_bare_input_peer_notify_events (T);
+ case 0x46a2ce98: return skip_type_input_peer_notify_settings (T);
+ case 0xb95d3167: return skip_type_bare_input_peer_notify_settings (T);
+ case 0xe74279c9: return skip_type_input_photo (T);
+ case 0x18bd8636: return skip_type_bare_input_photo (T);
+ case 0x7477e321: return skip_type_input_photo_crop (T);
+ case 0x8b881cde: return skip_type_bare_input_photo_crop (T);
+ case 0x4f96cb18: return skip_type_input_privacy_key (T);
+ case 0xb06934e7: return skip_type_bare_input_privacy_key (T);
+ case 0x4b815163: return skip_type_input_privacy_rule (T);
+ case 0xb47eae9c: return skip_type_bare_input_privacy_rule (T);
+ case 0xe44d415c: return skip_type_input_sticker_set (T);
+ case 0x1bb2bea3: return skip_type_bare_input_sticker_set (T);
+ case 0xadfe0c6a: return skip_type_input_user (T);
+ case 0x5201f395: return skip_type_bare_input_user (T);
+ case 0xbb5f7a27: return skip_type_input_video (T);
+ case 0x44a085d8: return skip_type_bare_input_video (T);
+ case 0xa8509bda: return skip_type_int (T);
+ case 0x57af6425: return skip_type_bare_int (T);
+ case 0x7d36c439: return skip_type_int128 (T);
+ case 0x82c93bc6: return skip_type_bare_int128 (T);
+ case 0xf2c798b3: return skip_type_int256 (T);
+ case 0x0d38674c: return skip_type_bare_int256 (T);
+ case 0xa2fa4880: return skip_type_keyboard_button (T);
+ case 0x5d05b77f: return skip_type_bare_keyboard_button (T);
+ case 0x77608b83: return skip_type_keyboard_button_row (T);
+ case 0x889f747c: return skip_type_bare_keyboard_button_row (T);
+ case 0x22076cba: return skip_type_long (T);
+ case 0xddf89345: return skip_type_bare_long (T);
+ case 0x5d652a7f: return skip_type_message (T);
+ case 0xa29ad580: return skip_type_bare_message (T);
+ case 0x383415fa: return skip_type_message_action (T);
+ case 0xc7cbea05: return skip_type_bare_message_action (T);
+ case 0x95f2471a: return skip_type_message_media (T);
+ case 0x6a0db8e5: return skip_type_bare_message_media (T);
+ case 0x80895ae0: return skip_type_messages_filter (T);
+ case 0x7f76a51f: return skip_type_bare_messages_filter (T);
+ case 0x8e1a1775: return skip_type_nearest_dc (T);
+ case 0x71e5e88a: return skip_type_bare_nearest_dc (T);
+ case 0x9fcb8237: return skip_type_notify_peer (T);
+ case 0x60347dc8: return skip_type_bare_notify_peer (T);
+ case 0x56730bcc: return skip_type_null (T);
+ case 0xa98cf433: return skip_type_bare_null (T);
+ case 0xbfa3de38: return skip_type_p_q_inner_data (T);
+ case 0x405c21c7: return skip_type_bare_p_q_inner_data (T);
+ case 0x276159d6: return skip_type_peer (T);
+ case 0xd89ea629: return skip_type_bare_peer (T);
+ case 0xc0c8d13b: return skip_type_peer_notify_events (T);
+ case 0x3f372ec4: return skip_type_bare_peer_notify_events (T);
+ case 0xfdf894fc: return skip_type_peer_notify_settings (T);
+ case 0x02076b03: return skip_type_bare_peer_notify_settings (T);
+ case 0xc207550a: return skip_type_photo (T);
+ case 0x3df8aaf5: return skip_type_bare_photo (T);
+ case 0x900f60dd: return skip_type_photo_size (T);
+ case 0x6ff09f22: return skip_type_bare_photo_size (T);
+ case 0xbc2eab30: return skip_type_privacy_key (T);
+ case 0x43d154cf: return skip_type_bare_privacy_key (T);
+ case 0xa8638aec: return skip_type_privacy_rule (T);
+ case 0x579c7513: return skip_type_bare_privacy_rule (T);
+ case 0xa384b779: return skip_type_received_notify_message (T);
+ case 0x5c7b4886: return skip_type_bare_received_notify_message (T);
+ case 0x612ca4a9: return skip_type_reply_markup (T);
+ case 0x9ed35b56: return skip_type_bare_reply_markup (T);
+ case 0x05162463: return skip_type_res_p_q (T);
+ case 0xfae9db9c: return skip_type_bare_res_p_q (T);
+ case 0x70541c7e: return skip_type_send_message_action (T);
+ case 0x8fabe381: return skip_type_bare_send_message_action (T);
+ case 0xa9230301: return skip_type_server_d_h_params (T);
+ case 0x56dcfcfe: return skip_type_bare_server_d_h_params (T);
+ case 0xb5890dba: return skip_type_server_d_h_inner_data (T);
+ case 0x4a76f245: return skip_type_bare_server_d_h_inner_data (T);
+ case 0xdb8a468f: return skip_type_set_client_d_h_params_answer (T);
+ case 0x2475b970: return skip_type_bare_set_client_d_h_params_answer (T);
+ case 0x12b299d4: return skip_type_sticker_pack (T);
+ case 0xed4d662b: return skip_type_bare_sticker_pack (T);
+ case 0xa7a43b17: return skip_type_sticker_set (T);
+ case 0x585bc4e8: return skip_type_bare_sticker_set (T);
+ case 0xb5286e24: return skip_type_string (T);
+ case 0x4ad791db: return skip_type_bare_string (T);
+ case 0x2e02b27e: return skip_type_update (T);
+ case 0xd1fd4d81: return skip_type_bare_update (T);
+ case 0x22499d27: return skip_type_updates (T);
+ case 0xddb662d8: return skip_type_bare_updates (T);
+ case 0x02e6c0c8: return skip_type_user (T);
+ case 0xfd193f37: return skip_type_bare_user (T);
+ case 0x5a89ac5b: return skip_type_user_full (T);
+ case 0xa57653a4: return skip_type_bare_user_full (T);
+ case 0x9a486229: return skip_type_user_profile_photo (T);
+ case 0x65b79dd6: return skip_type_bare_user_profile_photo (T);
+ case 0x76de9570: return skip_type_user_status (T);
+ case 0x89216a8f: return skip_type_bare_user_status (T);
+ case 0x1cb5c415: return skip_type_vector (T);
+ case 0xe34a3bea: return skip_type_bare_vector (T);
+ case 0x1716b174: return skip_type_video (T);
+ case 0xe8e94e8b: return skip_type_bare_video (T);
+ case 0xafa14973: return skip_type_wall_paper (T);
+ case 0x505eb68c: return skip_type_bare_wall_paper (T);
+ case 0x8d8c0d41: return skip_type_web_page (T);
+ case 0x7273f2be: return skip_type_bare_web_page (T);
+ case 0x1250abde: return skip_type_account_authorizations (T);
+ case 0xedaf5421: return skip_type_bare_account_authorizations (T);
+ case 0xeac2a804: return skip_type_account_password (T);
+ case 0x153d57fb: return skip_type_bare_account_password (T);
+ case 0xbcfc532c: return skip_type_account_password_input_settings (T);
+ case 0x4303acd3: return skip_type_bare_account_password_input_settings (T);
+ case 0xb7b72ab3: return skip_type_account_password_settings (T);
+ case 0x4848d54c: return skip_type_bare_account_password_settings (T);
+ case 0x554abb6f: return skip_type_account_privacy_rules (T);
+ case 0xaab54490: return skip_type_bare_account_privacy_rules (T);
+ case 0xa4f58c4c: return skip_type_account_sent_change_phone_code (T);
+ case 0x5b0a73b3: return skip_type_bare_account_sent_change_phone_code (T);
+ case 0xff036af1: return skip_type_auth_authorization (T);
+ case 0x00fc950e: return skip_type_bare_auth_authorization (T);
+ case 0x811ea28e: return skip_type_auth_checked_phone (T);
+ case 0x7ee15d71: return skip_type_bare_auth_checked_phone (T);
+ case 0xdf969c2d: return skip_type_auth_exported_authorization (T);
+ case 0x206963d2: return skip_type_bare_auth_exported_authorization (T);
+ case 0x137948a5: return skip_type_auth_password_recovery (T);
+ case 0xec86b75a: return skip_type_bare_auth_password_recovery (T);
+ case 0x0cc8bc16: return skip_type_auth_sent_code (T);
+ case 0xf33743e9: return skip_type_bare_auth_sent_code (T);
+ case 0x0377168f: return skip_type_binlog_encr_key (T);
+ case 0xfc88e970: return skip_type_bare_binlog_encr_key (T);
+ case 0x66ff03a6: return skip_type_binlog_update (T);
+ case 0x9900fc59: return skip_type_bare_binlog_update (T);
+ case 0x8c1b8fb4: return skip_type_contacts_blocked (T);
+ case 0x73e4704b: return skip_type_bare_contacts_blocked (T);
+ case 0xd8c02560: return skip_type_contacts_contacts (T);
+ case 0x273fda9f: return skip_type_bare_contacts_contacts (T);
+ case 0x0566000e: return skip_type_contacts_found (T);
+ case 0xfa99fff1: return skip_type_bare_contacts_found (T);
+ case 0xad524315: return skip_type_contacts_imported_contacts (T);
+ case 0x52adbcea: return skip_type_bare_contacts_imported_contacts (T);
+ case 0x3ace484c: return skip_type_contacts_link (T);
+ case 0xc531b7b3: return skip_type_bare_contacts_link (T);
+ case 0x5649dcc5: return skip_type_contacts_suggested (T);
+ case 0xa9b6233a: return skip_type_bare_contacts_suggested (T);
+ case 0x48feb267: return skip_type_geochats_located (T);
+ case 0xb7014d98: return skip_type_bare_geochats_located (T);
+ case 0x6d0a0e59: return skip_type_geochats_messages (T);
+ case 0x92f5f1a6: return skip_type_bare_geochats_messages (T);
+ case 0x17b1578b: return skip_type_geochats_stated_message (T);
+ case 0xe84ea874: return skip_type_bare_geochats_stated_message (T);
+ case 0x4ddd9627: return skip_type_help_app_update (T);
+ case 0xb22269d8: return skip_type_bare_help_app_update (T);
+ case 0x18cb9f78: return skip_type_help_invite_text (T);
+ case 0xe7346087: return skip_type_bare_help_invite_text (T);
+ case 0x17c6b5f6: return skip_type_help_support (T);
+ case 0xe8394a09: return skip_type_bare_help_support (T);
+ case 0xb45c69d1: return skip_type_messages_affected_history (T);
+ case 0x4ba3962e: return skip_type_bare_messages_affected_history (T);
+ case 0x84d19185: return skip_type_messages_affected_messages (T);
+ case 0x7b2e6e7a: return skip_type_bare_messages_affected_messages (T);
+ case 0xb485502f: return skip_type_messages_all_stickers (T);
+ case 0x4b7aafd0: return skip_type_bare_messages_all_stickers (T);
+ case 0xe5d7d19c: return skip_type_messages_chat_full (T);
+ case 0x1a282e63: return skip_type_bare_messages_chat_full (T);
+ case 0x64ff9fd5: return skip_type_messages_chats (T);
+ case 0x9b00602a: return skip_type_bare_messages_chats (T);
+ case 0xecc058e8: return skip_type_messages_dh_config (T);
+ case 0x133fa717: return skip_type_bare_messages_dh_config (T);
+ case 0x645af8b3: return skip_type_messages_dialogs (T);
+ case 0x9ba5074c: return skip_type_bare_messages_dialogs (T);
+ case 0x3f4e0648: return skip_type_messages_message (T);
+ case 0xc0b1f9b7: return skip_type_bare_messages_message (T);
+ case 0x8735e464: return skip_type_messages_messages (T);
+ case 0x78ca1b9b: return skip_type_bare_messages_messages (T);
+ case 0xc29c7607: return skip_type_messages_sent_encrypted_message (T);
+ case 0x3d6389f8: return skip_type_bare_messages_sent_encrypted_message (T);
+ case 0x799ce190: return skip_type_messages_sent_message (T);
+ case 0x86631e6f: return skip_type_bare_messages_sent_message (T);
+ case 0xb60a24a6: return skip_type_messages_sticker_set (T);
+ case 0x49f5db59: return skip_type_bare_messages_sticker_set (T);
+ case 0x7bfa5710: return skip_type_messages_stickers (T);
+ case 0x8405a8ef: return skip_type_bare_messages_stickers (T);
+ case 0x20212ca8: return skip_type_photos_photo (T);
+ case 0xdfded357: return skip_type_bare_photos_photo (T);
+ case 0x98cf75f1: return skip_type_photos_photos (T);
+ case 0x67308a0e: return skip_type_bare_photos_photos (T);
+ case 0x3e2838a8: return skip_type_storage_file_type (T);
+ case 0xc1d7c757: return skip_type_bare_storage_file_type (T);
+ case 0xf57a2419: return skip_type_updates_difference (T);
+ case 0x0a85dbe6: return skip_type_bare_updates_difference (T);
+ case 0xa56c2a3e: return skip_type_updates_state (T);
+ case 0x5a93d5c1: return skip_type_bare_updates_state (T);
+ case 0x096a18d5: return skip_type_upload_file (T);
+ case 0xf695e72a: return skip_type_bare_upload_file (T);
+ default: return -1; }
+}
diff --git a/protocols/Telegram/tgl/auto/auto-skip.h b/protocols/Telegram/tgl/auto/auto-skip.h
new file mode 100644
index 0000000000..f26a800b1a
--- /dev/null
+++ b/protocols/Telegram/tgl/auto/auto-skip.h
@@ -0,0 +1,714 @@
+#ifdef _MSC_VER
+#include "..\auto.h"
+#else
+#include "auto.h"
+#endif
+#include <assert.h>
+int skip_constructor_account_days_t_t_l (struct paramed_type *T);
+int skip_constructor_audio_empty (struct paramed_type *T);
+int skip_constructor_audio (struct paramed_type *T);
+int skip_constructor_authorization (struct paramed_type *T);
+int skip_constructor_bool_false (struct paramed_type *T);
+int skip_constructor_bool_true (struct paramed_type *T);
+int skip_constructor_bot_command (struct paramed_type *T);
+int skip_constructor_bot_command_old (struct paramed_type *T);
+int skip_constructor_bot_info_empty (struct paramed_type *T);
+int skip_constructor_bot_info (struct paramed_type *T);
+int skip_constructor_bytes (struct paramed_type *T);
+int skip_constructor_chat_empty (struct paramed_type *T);
+int skip_constructor_chat (struct paramed_type *T);
+int skip_constructor_chat_forbidden (struct paramed_type *T);
+int skip_constructor_geo_chat (struct paramed_type *T);
+int skip_constructor_chat_full (struct paramed_type *T);
+int skip_constructor_chat_invite_already (struct paramed_type *T);
+int skip_constructor_chat_invite (struct paramed_type *T);
+int skip_constructor_chat_located (struct paramed_type *T);
+int skip_constructor_chat_participant (struct paramed_type *T);
+int skip_constructor_chat_participants_forbidden (struct paramed_type *T);
+int skip_constructor_chat_participants (struct paramed_type *T);
+int skip_constructor_chat_photo_empty (struct paramed_type *T);
+int skip_constructor_chat_photo (struct paramed_type *T);
+int skip_constructor_client_d_h_inner_data (struct paramed_type *T);
+int skip_constructor_config (struct paramed_type *T);
+int skip_constructor_contact (struct paramed_type *T);
+int skip_constructor_contact_blocked (struct paramed_type *T);
+int skip_constructor_contact_found (struct paramed_type *T);
+int skip_constructor_contact_link_unknown (struct paramed_type *T);
+int skip_constructor_contact_link_none (struct paramed_type *T);
+int skip_constructor_contact_link_has_phone (struct paramed_type *T);
+int skip_constructor_contact_link_contact (struct paramed_type *T);
+int skip_constructor_contact_status (struct paramed_type *T);
+int skip_constructor_contact_suggested (struct paramed_type *T);
+int skip_constructor_dc_option_l28 (struct paramed_type *T);
+int skip_constructor_dc_option (struct paramed_type *T);
+int skip_constructor_decrypted_message (struct paramed_type *T);
+int skip_constructor_decrypted_message_service (struct paramed_type *T);
+int skip_constructor_decrypted_message_action_set_message_t_t_l (struct paramed_type *T);
+int skip_constructor_decrypted_message_action_read_messages (struct paramed_type *T);
+int skip_constructor_decrypted_message_action_delete_messages (struct paramed_type *T);
+int skip_constructor_decrypted_message_action_screenshot_messages (struct paramed_type *T);
+int skip_constructor_decrypted_message_action_flush_history (struct paramed_type *T);
+int skip_constructor_decrypted_message_action_resend (struct paramed_type *T);
+int skip_constructor_decrypted_message_action_notify_layer (struct paramed_type *T);
+int skip_constructor_decrypted_message_action_typing (struct paramed_type *T);
+int skip_constructor_decrypted_message_action_request_key (struct paramed_type *T);
+int skip_constructor_decrypted_message_action_accept_key (struct paramed_type *T);
+int skip_constructor_decrypted_message_action_abort_key (struct paramed_type *T);
+int skip_constructor_decrypted_message_action_commit_key (struct paramed_type *T);
+int skip_constructor_decrypted_message_action_noop (struct paramed_type *T);
+int skip_constructor_decrypted_message_layer (struct paramed_type *T);
+int skip_constructor_decrypted_message_media_empty (struct paramed_type *T);
+int skip_constructor_decrypted_message_media_photo (struct paramed_type *T);
+int skip_constructor_decrypted_message_media_geo_point (struct paramed_type *T);
+int skip_constructor_decrypted_message_media_contact (struct paramed_type *T);
+int skip_constructor_decrypted_message_media_document (struct paramed_type *T);
+int skip_constructor_decrypted_message_media_video (struct paramed_type *T);
+int skip_constructor_decrypted_message_media_audio (struct paramed_type *T);
+int skip_constructor_decrypted_message_media_external_document (struct paramed_type *T);
+int skip_constructor_decrypted_message_media_video_l12 (struct paramed_type *T);
+int skip_constructor_decrypted_message_media_audio_l12 (struct paramed_type *T);
+int skip_constructor_dialog (struct paramed_type *T);
+int skip_constructor_disabled_feature (struct paramed_type *T);
+int skip_constructor_document_empty (struct paramed_type *T);
+int skip_constructor_document (struct paramed_type *T);
+int skip_constructor_document_l19 (struct paramed_type *T);
+int skip_constructor_document_attribute_image_size (struct paramed_type *T);
+int skip_constructor_document_attribute_animated (struct paramed_type *T);
+int skip_constructor_document_attribute_sticker_l28 (struct paramed_type *T);
+int skip_constructor_document_attribute_sticker (struct paramed_type *T);
+int skip_constructor_document_attribute_video (struct paramed_type *T);
+int skip_constructor_document_attribute_audio (struct paramed_type *T);
+int skip_constructor_document_attribute_filename (struct paramed_type *T);
+int skip_constructor_double (struct paramed_type *T);
+int skip_constructor_encrypted_chat_empty (struct paramed_type *T);
+int skip_constructor_encrypted_chat_waiting (struct paramed_type *T);
+int skip_constructor_encrypted_chat_requested (struct paramed_type *T);
+int skip_constructor_encrypted_chat (struct paramed_type *T);
+int skip_constructor_encrypted_chat_discarded (struct paramed_type *T);
+int skip_constructor_encrypted_file_empty (struct paramed_type *T);
+int skip_constructor_encrypted_file (struct paramed_type *T);
+int skip_constructor_encrypted_message (struct paramed_type *T);
+int skip_constructor_encrypted_message_service (struct paramed_type *T);
+int skip_constructor_error (struct paramed_type *T);
+int skip_constructor_chat_invite_empty (struct paramed_type *T);
+int skip_constructor_chat_invite_exported (struct paramed_type *T);
+int skip_constructor_file_location_unavailable (struct paramed_type *T);
+int skip_constructor_file_location (struct paramed_type *T);
+int skip_constructor_geo_chat_message_empty (struct paramed_type *T);
+int skip_constructor_geo_chat_message (struct paramed_type *T);
+int skip_constructor_geo_chat_message_service (struct paramed_type *T);
+int skip_constructor_geo_point_empty (struct paramed_type *T);
+int skip_constructor_geo_point (struct paramed_type *T);
+int skip_constructor_imported_contact (struct paramed_type *T);
+int skip_constructor_input_app_event (struct paramed_type *T);
+int skip_constructor_input_audio_empty (struct paramed_type *T);
+int skip_constructor_input_audio (struct paramed_type *T);
+int skip_constructor_input_chat_photo_empty (struct paramed_type *T);
+int skip_constructor_input_chat_uploaded_photo (struct paramed_type *T);
+int skip_constructor_input_chat_photo (struct paramed_type *T);
+int skip_constructor_input_phone_contact (struct paramed_type *T);
+int skip_constructor_input_document_empty (struct paramed_type *T);
+int skip_constructor_input_document (struct paramed_type *T);
+int skip_constructor_input_encrypted_chat (struct paramed_type *T);
+int skip_constructor_input_encrypted_file_empty (struct paramed_type *T);
+int skip_constructor_input_encrypted_file_uploaded (struct paramed_type *T);
+int skip_constructor_input_encrypted_file (struct paramed_type *T);
+int skip_constructor_input_encrypted_file_big_uploaded (struct paramed_type *T);
+int skip_constructor_input_file (struct paramed_type *T);
+int skip_constructor_input_file_big (struct paramed_type *T);
+int skip_constructor_input_file_location (struct paramed_type *T);
+int skip_constructor_input_video_file_location (struct paramed_type *T);
+int skip_constructor_input_encrypted_file_location (struct paramed_type *T);
+int skip_constructor_input_audio_file_location (struct paramed_type *T);
+int skip_constructor_input_document_file_location (struct paramed_type *T);
+int skip_constructor_input_geo_chat (struct paramed_type *T);
+int skip_constructor_input_geo_point_empty (struct paramed_type *T);
+int skip_constructor_input_geo_point (struct paramed_type *T);
+int skip_constructor_input_media_empty (struct paramed_type *T);
+int skip_constructor_input_media_uploaded_photo (struct paramed_type *T);
+int skip_constructor_input_media_photo (struct paramed_type *T);
+int skip_constructor_input_media_geo_point (struct paramed_type *T);
+int skip_constructor_input_media_contact (struct paramed_type *T);
+int skip_constructor_input_media_uploaded_video (struct paramed_type *T);
+int skip_constructor_input_media_uploaded_thumb_video (struct paramed_type *T);
+int skip_constructor_input_media_video (struct paramed_type *T);
+int skip_constructor_input_media_uploaded_audio (struct paramed_type *T);
+int skip_constructor_input_media_audio (struct paramed_type *T);
+int skip_constructor_input_media_uploaded_document (struct paramed_type *T);
+int skip_constructor_input_media_uploaded_thumb_document (struct paramed_type *T);
+int skip_constructor_input_media_document (struct paramed_type *T);
+int skip_constructor_input_media_venue (struct paramed_type *T);
+int skip_constructor_input_notify_peer (struct paramed_type *T);
+int skip_constructor_input_notify_users (struct paramed_type *T);
+int skip_constructor_input_notify_chats (struct paramed_type *T);
+int skip_constructor_input_notify_all (struct paramed_type *T);
+int skip_constructor_input_notify_geo_chat_peer (struct paramed_type *T);
+int skip_constructor_input_peer_empty (struct paramed_type *T);
+int skip_constructor_input_peer_self (struct paramed_type *T);
+int skip_constructor_input_peer_contact (struct paramed_type *T);
+int skip_constructor_input_peer_foreign (struct paramed_type *T);
+int skip_constructor_input_peer_chat (struct paramed_type *T);
+int skip_constructor_input_peer_notify_events_empty (struct paramed_type *T);
+int skip_constructor_input_peer_notify_events_all (struct paramed_type *T);
+int skip_constructor_input_peer_notify_settings (struct paramed_type *T);
+int skip_constructor_input_photo_empty (struct paramed_type *T);
+int skip_constructor_input_photo (struct paramed_type *T);
+int skip_constructor_input_photo_crop_auto (struct paramed_type *T);
+int skip_constructor_input_photo_crop (struct paramed_type *T);
+int skip_constructor_input_privacy_key_status_timestamp (struct paramed_type *T);
+int skip_constructor_input_privacy_value_allow_contacts (struct paramed_type *T);
+int skip_constructor_input_privacy_value_allow_all (struct paramed_type *T);
+int skip_constructor_input_privacy_value_allow_users (struct paramed_type *T);
+int skip_constructor_input_privacy_value_disallow_contacts (struct paramed_type *T);
+int skip_constructor_input_privacy_value_disallow_all (struct paramed_type *T);
+int skip_constructor_input_privacy_value_disallow_users (struct paramed_type *T);
+int skip_constructor_input_sticker_set_empty (struct paramed_type *T);
+int skip_constructor_input_sticker_set_i_d (struct paramed_type *T);
+int skip_constructor_input_sticker_set_short_name (struct paramed_type *T);
+int skip_constructor_input_user_empty (struct paramed_type *T);
+int skip_constructor_input_user_self (struct paramed_type *T);
+int skip_constructor_input_user_contact (struct paramed_type *T);
+int skip_constructor_input_user_foreign (struct paramed_type *T);
+int skip_constructor_input_video_empty (struct paramed_type *T);
+int skip_constructor_input_video (struct paramed_type *T);
+int skip_constructor_int (struct paramed_type *T);
+int skip_constructor_int128 (struct paramed_type *T);
+int skip_constructor_int256 (struct paramed_type *T);
+int skip_constructor_keyboard_button (struct paramed_type *T);
+int skip_constructor_keyboard_button_row (struct paramed_type *T);
+int skip_constructor_long (struct paramed_type *T);
+int skip_constructor_message_empty (struct paramed_type *T);
+int skip_constructor_message (struct paramed_type *T);
+int skip_constructor_message_service (struct paramed_type *T);
+int skip_constructor_message_action_empty (struct paramed_type *T);
+int skip_constructor_message_action_chat_create (struct paramed_type *T);
+int skip_constructor_message_action_chat_edit_title (struct paramed_type *T);
+int skip_constructor_message_action_chat_edit_photo (struct paramed_type *T);
+int skip_constructor_message_action_chat_delete_photo (struct paramed_type *T);
+int skip_constructor_message_action_chat_add_user (struct paramed_type *T);
+int skip_constructor_message_action_chat_delete_user (struct paramed_type *T);
+int skip_constructor_message_action_geo_chat_create (struct paramed_type *T);
+int skip_constructor_message_action_geo_chat_checkin (struct paramed_type *T);
+int skip_constructor_message_action_chat_joined_by_link (struct paramed_type *T);
+int skip_constructor_message_media_empty (struct paramed_type *T);
+int skip_constructor_message_media_photo (struct paramed_type *T);
+int skip_constructor_message_media_video (struct paramed_type *T);
+int skip_constructor_message_media_geo (struct paramed_type *T);
+int skip_constructor_message_media_contact (struct paramed_type *T);
+int skip_constructor_message_media_unsupported (struct paramed_type *T);
+int skip_constructor_message_media_document (struct paramed_type *T);
+int skip_constructor_message_media_audio (struct paramed_type *T);
+int skip_constructor_message_media_web_page (struct paramed_type *T);
+int skip_constructor_message_media_venue (struct paramed_type *T);
+int skip_constructor_message_media_photo_l27 (struct paramed_type *T);
+int skip_constructor_message_media_video_l27 (struct paramed_type *T);
+int skip_constructor_input_messages_filter_empty (struct paramed_type *T);
+int skip_constructor_input_messages_filter_photos (struct paramed_type *T);
+int skip_constructor_input_messages_filter_video (struct paramed_type *T);
+int skip_constructor_input_messages_filter_photo_video (struct paramed_type *T);
+int skip_constructor_input_messages_filter_photo_video_documents (struct paramed_type *T);
+int skip_constructor_input_messages_filter_document (struct paramed_type *T);
+int skip_constructor_input_messages_filter_audio (struct paramed_type *T);
+int skip_constructor_nearest_dc (struct paramed_type *T);
+int skip_constructor_notify_peer (struct paramed_type *T);
+int skip_constructor_notify_users (struct paramed_type *T);
+int skip_constructor_notify_chats (struct paramed_type *T);
+int skip_constructor_notify_all (struct paramed_type *T);
+int skip_constructor_null (struct paramed_type *T);
+int skip_constructor_p_q_inner_data (struct paramed_type *T);
+int skip_constructor_p_q_inner_data_temp (struct paramed_type *T);
+int skip_constructor_peer_user (struct paramed_type *T);
+int skip_constructor_peer_chat (struct paramed_type *T);
+int skip_constructor_peer_notify_events_empty (struct paramed_type *T);
+int skip_constructor_peer_notify_events_all (struct paramed_type *T);
+int skip_constructor_peer_notify_settings_empty (struct paramed_type *T);
+int skip_constructor_peer_notify_settings (struct paramed_type *T);
+int skip_constructor_photo_empty (struct paramed_type *T);
+int skip_constructor_photo (struct paramed_type *T);
+int skip_constructor_photo_l27 (struct paramed_type *T);
+int skip_constructor_photo_size_empty (struct paramed_type *T);
+int skip_constructor_photo_size (struct paramed_type *T);
+int skip_constructor_photo_cached_size (struct paramed_type *T);
+int skip_constructor_privacy_key_status_timestamp (struct paramed_type *T);
+int skip_constructor_privacy_value_allow_contacts (struct paramed_type *T);
+int skip_constructor_privacy_value_allow_all (struct paramed_type *T);
+int skip_constructor_privacy_value_allow_users (struct paramed_type *T);
+int skip_constructor_privacy_value_disallow_contacts (struct paramed_type *T);
+int skip_constructor_privacy_value_disallow_all (struct paramed_type *T);
+int skip_constructor_privacy_value_disallow_users (struct paramed_type *T);
+int skip_constructor_received_notify_message (struct paramed_type *T);
+int skip_constructor_reply_keyboard_hide (struct paramed_type *T);
+int skip_constructor_reply_keyboard_force_reply (struct paramed_type *T);
+int skip_constructor_reply_keyboard_markup (struct paramed_type *T);
+int skip_constructor_res_p_q (struct paramed_type *T);
+int skip_constructor_send_message_typing_action (struct paramed_type *T);
+int skip_constructor_send_message_cancel_action (struct paramed_type *T);
+int skip_constructor_send_message_record_video_action (struct paramed_type *T);
+int skip_constructor_send_message_upload_video_action_l27 (struct paramed_type *T);
+int skip_constructor_send_message_upload_video_action (struct paramed_type *T);
+int skip_constructor_send_message_record_audio_action (struct paramed_type *T);
+int skip_constructor_send_message_upload_audio_action_l27 (struct paramed_type *T);
+int skip_constructor_send_message_upload_audio_action (struct paramed_type *T);
+int skip_constructor_send_message_upload_photo_action (struct paramed_type *T);
+int skip_constructor_send_message_upload_document_action_l27 (struct paramed_type *T);
+int skip_constructor_send_message_upload_document_action (struct paramed_type *T);
+int skip_constructor_send_message_geo_location_action (struct paramed_type *T);
+int skip_constructor_send_message_choose_contact_action (struct paramed_type *T);
+int skip_constructor_server_d_h_params_fail (struct paramed_type *T);
+int skip_constructor_server_d_h_params_ok (struct paramed_type *T);
+int skip_constructor_server_d_h_inner_data (struct paramed_type *T);
+int skip_constructor_dh_gen_ok (struct paramed_type *T);
+int skip_constructor_dh_gen_retry (struct paramed_type *T);
+int skip_constructor_dh_gen_fail (struct paramed_type *T);
+int skip_constructor_sticker_pack (struct paramed_type *T);
+int skip_constructor_sticker_set (struct paramed_type *T);
+int skip_constructor_string (struct paramed_type *T);
+int skip_constructor_update_new_message (struct paramed_type *T);
+int skip_constructor_update_message_i_d (struct paramed_type *T);
+int skip_constructor_update_delete_messages (struct paramed_type *T);
+int skip_constructor_update_user_typing (struct paramed_type *T);
+int skip_constructor_update_chat_user_typing (struct paramed_type *T);
+int skip_constructor_update_chat_participants (struct paramed_type *T);
+int skip_constructor_update_user_status (struct paramed_type *T);
+int skip_constructor_update_user_name (struct paramed_type *T);
+int skip_constructor_update_user_photo (struct paramed_type *T);
+int skip_constructor_update_contact_registered (struct paramed_type *T);
+int skip_constructor_update_contact_link (struct paramed_type *T);
+int skip_constructor_update_new_authorization (struct paramed_type *T);
+int skip_constructor_update_new_geo_chat_message (struct paramed_type *T);
+int skip_constructor_update_new_encrypted_message (struct paramed_type *T);
+int skip_constructor_update_encrypted_chat_typing (struct paramed_type *T);
+int skip_constructor_update_encryption (struct paramed_type *T);
+int skip_constructor_update_encrypted_messages_read (struct paramed_type *T);
+int skip_constructor_update_chat_participant_add (struct paramed_type *T);
+int skip_constructor_update_chat_participant_delete (struct paramed_type *T);
+int skip_constructor_update_dc_options (struct paramed_type *T);
+int skip_constructor_update_user_blocked (struct paramed_type *T);
+int skip_constructor_update_notify_settings (struct paramed_type *T);
+int skip_constructor_update_service_notification (struct paramed_type *T);
+int skip_constructor_update_privacy (struct paramed_type *T);
+int skip_constructor_update_user_phone (struct paramed_type *T);
+int skip_constructor_update_read_history_inbox (struct paramed_type *T);
+int skip_constructor_update_read_history_outbox (struct paramed_type *T);
+int skip_constructor_update_web_page (struct paramed_type *T);
+int skip_constructor_update_read_messages_contents (struct paramed_type *T);
+int skip_constructor_update_msg_update (struct paramed_type *T);
+int skip_constructor_updates_too_long (struct paramed_type *T);
+int skip_constructor_update_short_message (struct paramed_type *T);
+int skip_constructor_update_short_chat_message (struct paramed_type *T);
+int skip_constructor_update_short (struct paramed_type *T);
+int skip_constructor_updates_combined (struct paramed_type *T);
+int skip_constructor_updates (struct paramed_type *T);
+int skip_constructor_user_empty (struct paramed_type *T);
+int skip_constructor_user (struct paramed_type *T);
+int skip_constructor_user_full (struct paramed_type *T);
+int skip_constructor_user_profile_photo_empty (struct paramed_type *T);
+int skip_constructor_user_profile_photo (struct paramed_type *T);
+int skip_constructor_user_status_empty (struct paramed_type *T);
+int skip_constructor_user_status_online (struct paramed_type *T);
+int skip_constructor_user_status_offline (struct paramed_type *T);
+int skip_constructor_user_status_recently (struct paramed_type *T);
+int skip_constructor_user_status_last_week (struct paramed_type *T);
+int skip_constructor_user_status_last_month (struct paramed_type *T);
+int skip_constructor_vector (struct paramed_type *T);
+int skip_constructor_video_empty (struct paramed_type *T);
+int skip_constructor_video (struct paramed_type *T);
+int skip_constructor_video_l27 (struct paramed_type *T);
+int skip_constructor_wall_paper (struct paramed_type *T);
+int skip_constructor_wall_paper_solid (struct paramed_type *T);
+int skip_constructor_web_page_empty (struct paramed_type *T);
+int skip_constructor_web_page_pending (struct paramed_type *T);
+int skip_constructor_web_page (struct paramed_type *T);
+int skip_constructor_account_authorizations (struct paramed_type *T);
+int skip_constructor_account_no_password (struct paramed_type *T);
+int skip_constructor_account_password (struct paramed_type *T);
+int skip_constructor_account_password_input_settings (struct paramed_type *T);
+int skip_constructor_account_password_settings (struct paramed_type *T);
+int skip_constructor_account_privacy_rules (struct paramed_type *T);
+int skip_constructor_account_sent_change_phone_code (struct paramed_type *T);
+int skip_constructor_auth_authorization (struct paramed_type *T);
+int skip_constructor_auth_checked_phone (struct paramed_type *T);
+int skip_constructor_auth_exported_authorization (struct paramed_type *T);
+int skip_constructor_auth_password_recovery (struct paramed_type *T);
+int skip_constructor_auth_sent_code (struct paramed_type *T);
+int skip_constructor_auth_sent_app_code (struct paramed_type *T);
+int skip_constructor_binlog_encr_key (struct paramed_type *T);
+int skip_constructor_binlog_start (struct paramed_type *T);
+int skip_constructor_binlog_dc_option (struct paramed_type *T);
+int skip_constructor_binlog_dc_option_new (struct paramed_type *T);
+int skip_constructor_binlog_auth_key (struct paramed_type *T);
+int skip_constructor_binlog_default_dc (struct paramed_type *T);
+int skip_constructor_binlog_dc_signed (struct paramed_type *T);
+int skip_constructor_binlog_our_id (struct paramed_type *T);
+int skip_constructor_binlog_set_dh_params (struct paramed_type *T);
+int skip_constructor_binlog_set_pts (struct paramed_type *T);
+int skip_constructor_binlog_set_qts (struct paramed_type *T);
+int skip_constructor_binlog_set_date (struct paramed_type *T);
+int skip_constructor_binlog_set_seq (struct paramed_type *T);
+int skip_constructor_binlog_encr_chat_delete (struct paramed_type *T);
+int skip_constructor_binlog_encr_chat_new (struct paramed_type *T);
+int skip_constructor_binlog_encr_chat_exchange_new (struct paramed_type *T);
+int skip_constructor_binlog_user_delete (struct paramed_type *T);
+int skip_constructor_binlog_user_new (struct paramed_type *T);
+int skip_constructor_binlog_chat_new (struct paramed_type *T);
+int skip_constructor_binlog_chat_add_participant (struct paramed_type *T);
+int skip_constructor_binlog_chat_del_participant (struct paramed_type *T);
+int skip_constructor_binlog_set_msg_id (struct paramed_type *T);
+int skip_constructor_binlog_message_delete (struct paramed_type *T);
+int skip_constructor_binlog_message_new (struct paramed_type *T);
+int skip_constructor_binlog_message_encr_new (struct paramed_type *T);
+int skip_constructor_binlog_msg_update (struct paramed_type *T);
+int skip_constructor_binlog_reset_authorization (struct paramed_type *T);
+int skip_constructor_contacts_blocked (struct paramed_type *T);
+int skip_constructor_contacts_blocked_slice (struct paramed_type *T);
+int skip_constructor_contacts_contacts_not_modified (struct paramed_type *T);
+int skip_constructor_contacts_contacts (struct paramed_type *T);
+int skip_constructor_contacts_found (struct paramed_type *T);
+int skip_constructor_contacts_imported_contacts (struct paramed_type *T);
+int skip_constructor_contacts_link (struct paramed_type *T);
+int skip_constructor_contacts_suggested (struct paramed_type *T);
+int skip_constructor_geochats_located (struct paramed_type *T);
+int skip_constructor_geochats_messages (struct paramed_type *T);
+int skip_constructor_geochats_messages_slice (struct paramed_type *T);
+int skip_constructor_geochats_stated_message (struct paramed_type *T);
+int skip_constructor_help_app_update (struct paramed_type *T);
+int skip_constructor_help_no_app_update (struct paramed_type *T);
+int skip_constructor_help_invite_text (struct paramed_type *T);
+int skip_constructor_help_support (struct paramed_type *T);
+int skip_constructor_messages_affected_history (struct paramed_type *T);
+int skip_constructor_messages_affected_messages (struct paramed_type *T);
+int skip_constructor_messages_all_stickers_not_modified (struct paramed_type *T);
+int skip_constructor_messages_all_stickers (struct paramed_type *T);
+int skip_constructor_messages_chat_full (struct paramed_type *T);
+int skip_constructor_messages_chats (struct paramed_type *T);
+int skip_constructor_messages_dh_config_not_modified (struct paramed_type *T);
+int skip_constructor_messages_dh_config (struct paramed_type *T);
+int skip_constructor_messages_dialogs (struct paramed_type *T);
+int skip_constructor_messages_dialogs_slice (struct paramed_type *T);
+int skip_constructor_messages_message_empty (struct paramed_type *T);
+int skip_constructor_messages_messages (struct paramed_type *T);
+int skip_constructor_messages_messages_slice (struct paramed_type *T);
+int skip_constructor_messages_sent_encrypted_message (struct paramed_type *T);
+int skip_constructor_messages_sent_encrypted_file (struct paramed_type *T);
+int skip_constructor_messages_sent_message (struct paramed_type *T);
+int skip_constructor_messages_sent_message_link (struct paramed_type *T);
+int skip_constructor_messages_sticker_set (struct paramed_type *T);
+int skip_constructor_messages_stickers_not_modified (struct paramed_type *T);
+int skip_constructor_messages_stickers (struct paramed_type *T);
+int skip_constructor_photos_photo (struct paramed_type *T);
+int skip_constructor_photos_photos (struct paramed_type *T);
+int skip_constructor_photos_photos_slice (struct paramed_type *T);
+int skip_constructor_storage_file_unknown (struct paramed_type *T);
+int skip_constructor_storage_file_jpeg (struct paramed_type *T);
+int skip_constructor_storage_file_gif (struct paramed_type *T);
+int skip_constructor_storage_file_png (struct paramed_type *T);
+int skip_constructor_storage_file_pdf (struct paramed_type *T);
+int skip_constructor_storage_file_mp3 (struct paramed_type *T);
+int skip_constructor_storage_file_mov (struct paramed_type *T);
+int skip_constructor_storage_file_partial (struct paramed_type *T);
+int skip_constructor_storage_file_mp4 (struct paramed_type *T);
+int skip_constructor_storage_file_webp (struct paramed_type *T);
+int skip_constructor_updates_difference_empty (struct paramed_type *T);
+int skip_constructor_updates_difference (struct paramed_type *T);
+int skip_constructor_updates_difference_slice (struct paramed_type *T);
+int skip_constructor_updates_state (struct paramed_type *T);
+int skip_constructor_upload_file (struct paramed_type *T);
+int skip_type_account_days_t_t_l (struct paramed_type *T);
+int skip_type_bare_account_days_t_t_l (struct paramed_type *T);
+int skip_type_audio (struct paramed_type *T);
+int skip_type_bare_audio (struct paramed_type *T);
+int skip_type_authorization (struct paramed_type *T);
+int skip_type_bare_authorization (struct paramed_type *T);
+int skip_type_bool (struct paramed_type *T);
+int skip_type_bare_bool (struct paramed_type *T);
+int skip_type_bot_command (struct paramed_type *T);
+int skip_type_bare_bot_command (struct paramed_type *T);
+int skip_type_bot_info (struct paramed_type *T);
+int skip_type_bare_bot_info (struct paramed_type *T);
+int skip_type_bytes (struct paramed_type *T);
+int skip_type_bare_bytes (struct paramed_type *T);
+int skip_type_chat (struct paramed_type *T);
+int skip_type_bare_chat (struct paramed_type *T);
+int skip_type_chat_full (struct paramed_type *T);
+int skip_type_bare_chat_full (struct paramed_type *T);
+int skip_type_chat_invite (struct paramed_type *T);
+int skip_type_bare_chat_invite (struct paramed_type *T);
+int skip_type_chat_located (struct paramed_type *T);
+int skip_type_bare_chat_located (struct paramed_type *T);
+int skip_type_chat_participant (struct paramed_type *T);
+int skip_type_bare_chat_participant (struct paramed_type *T);
+int skip_type_chat_participants (struct paramed_type *T);
+int skip_type_bare_chat_participants (struct paramed_type *T);
+int skip_type_chat_photo (struct paramed_type *T);
+int skip_type_bare_chat_photo (struct paramed_type *T);
+int skip_type_client_d_h_inner_data (struct paramed_type *T);
+int skip_type_bare_client_d_h_inner_data (struct paramed_type *T);
+int skip_type_config (struct paramed_type *T);
+int skip_type_bare_config (struct paramed_type *T);
+int skip_type_contact (struct paramed_type *T);
+int skip_type_bare_contact (struct paramed_type *T);
+int skip_type_contact_blocked (struct paramed_type *T);
+int skip_type_bare_contact_blocked (struct paramed_type *T);
+int skip_type_contact_found (struct paramed_type *T);
+int skip_type_bare_contact_found (struct paramed_type *T);
+int skip_type_contact_link (struct paramed_type *T);
+int skip_type_bare_contact_link (struct paramed_type *T);
+int skip_type_contact_status (struct paramed_type *T);
+int skip_type_bare_contact_status (struct paramed_type *T);
+int skip_type_contact_suggested (struct paramed_type *T);
+int skip_type_bare_contact_suggested (struct paramed_type *T);
+int skip_type_dc_option (struct paramed_type *T);
+int skip_type_bare_dc_option (struct paramed_type *T);
+int skip_type_decrypted_message (struct paramed_type *T);
+int skip_type_bare_decrypted_message (struct paramed_type *T);
+int skip_type_decrypted_message_action (struct paramed_type *T);
+int skip_type_bare_decrypted_message_action (struct paramed_type *T);
+int skip_type_decrypted_message_layer (struct paramed_type *T);
+int skip_type_bare_decrypted_message_layer (struct paramed_type *T);
+int skip_type_decrypted_message_media (struct paramed_type *T);
+int skip_type_bare_decrypted_message_media (struct paramed_type *T);
+int skip_type_dialog (struct paramed_type *T);
+int skip_type_bare_dialog (struct paramed_type *T);
+int skip_type_disabled_feature (struct paramed_type *T);
+int skip_type_bare_disabled_feature (struct paramed_type *T);
+int skip_type_document (struct paramed_type *T);
+int skip_type_bare_document (struct paramed_type *T);
+int skip_type_document_attribute (struct paramed_type *T);
+int skip_type_bare_document_attribute (struct paramed_type *T);
+int skip_type_double (struct paramed_type *T);
+int skip_type_bare_double (struct paramed_type *T);
+int skip_type_encrypted_chat (struct paramed_type *T);
+int skip_type_bare_encrypted_chat (struct paramed_type *T);
+int skip_type_encrypted_file (struct paramed_type *T);
+int skip_type_bare_encrypted_file (struct paramed_type *T);
+int skip_type_encrypted_message (struct paramed_type *T);
+int skip_type_bare_encrypted_message (struct paramed_type *T);
+int skip_type_error (struct paramed_type *T);
+int skip_type_bare_error (struct paramed_type *T);
+int skip_type_exported_chat_invite (struct paramed_type *T);
+int skip_type_bare_exported_chat_invite (struct paramed_type *T);
+int skip_type_file_location (struct paramed_type *T);
+int skip_type_bare_file_location (struct paramed_type *T);
+int skip_type_geo_chat_message (struct paramed_type *T);
+int skip_type_bare_geo_chat_message (struct paramed_type *T);
+int skip_type_geo_point (struct paramed_type *T);
+int skip_type_bare_geo_point (struct paramed_type *T);
+int skip_type_imported_contact (struct paramed_type *T);
+int skip_type_bare_imported_contact (struct paramed_type *T);
+int skip_type_input_app_event (struct paramed_type *T);
+int skip_type_bare_input_app_event (struct paramed_type *T);
+int skip_type_input_audio (struct paramed_type *T);
+int skip_type_bare_input_audio (struct paramed_type *T);
+int skip_type_input_chat_photo (struct paramed_type *T);
+int skip_type_bare_input_chat_photo (struct paramed_type *T);
+int skip_type_input_contact (struct paramed_type *T);
+int skip_type_bare_input_contact (struct paramed_type *T);
+int skip_type_input_document (struct paramed_type *T);
+int skip_type_bare_input_document (struct paramed_type *T);
+int skip_type_input_encrypted_chat (struct paramed_type *T);
+int skip_type_bare_input_encrypted_chat (struct paramed_type *T);
+int skip_type_input_encrypted_file (struct paramed_type *T);
+int skip_type_bare_input_encrypted_file (struct paramed_type *T);
+int skip_type_input_file (struct paramed_type *T);
+int skip_type_bare_input_file (struct paramed_type *T);
+int skip_type_input_file_location (struct paramed_type *T);
+int skip_type_bare_input_file_location (struct paramed_type *T);
+int skip_type_input_geo_chat (struct paramed_type *T);
+int skip_type_bare_input_geo_chat (struct paramed_type *T);
+int skip_type_input_geo_point (struct paramed_type *T);
+int skip_type_bare_input_geo_point (struct paramed_type *T);
+int skip_type_input_media (struct paramed_type *T);
+int skip_type_bare_input_media (struct paramed_type *T);
+int skip_type_input_notify_peer (struct paramed_type *T);
+int skip_type_bare_input_notify_peer (struct paramed_type *T);
+int skip_type_input_peer (struct paramed_type *T);
+int skip_type_bare_input_peer (struct paramed_type *T);
+int skip_type_input_peer_notify_events (struct paramed_type *T);
+int skip_type_bare_input_peer_notify_events (struct paramed_type *T);
+int skip_type_input_peer_notify_settings (struct paramed_type *T);
+int skip_type_bare_input_peer_notify_settings (struct paramed_type *T);
+int skip_type_input_photo (struct paramed_type *T);
+int skip_type_bare_input_photo (struct paramed_type *T);
+int skip_type_input_photo_crop (struct paramed_type *T);
+int skip_type_bare_input_photo_crop (struct paramed_type *T);
+int skip_type_input_privacy_key (struct paramed_type *T);
+int skip_type_bare_input_privacy_key (struct paramed_type *T);
+int skip_type_input_privacy_rule (struct paramed_type *T);
+int skip_type_bare_input_privacy_rule (struct paramed_type *T);
+int skip_type_input_sticker_set (struct paramed_type *T);
+int skip_type_bare_input_sticker_set (struct paramed_type *T);
+int skip_type_input_user (struct paramed_type *T);
+int skip_type_bare_input_user (struct paramed_type *T);
+int skip_type_input_video (struct paramed_type *T);
+int skip_type_bare_input_video (struct paramed_type *T);
+int skip_type_int (struct paramed_type *T);
+int skip_type_bare_int (struct paramed_type *T);
+int skip_type_int128 (struct paramed_type *T);
+int skip_type_bare_int128 (struct paramed_type *T);
+int skip_type_int256 (struct paramed_type *T);
+int skip_type_bare_int256 (struct paramed_type *T);
+int skip_type_keyboard_button (struct paramed_type *T);
+int skip_type_bare_keyboard_button (struct paramed_type *T);
+int skip_type_keyboard_button_row (struct paramed_type *T);
+int skip_type_bare_keyboard_button_row (struct paramed_type *T);
+int skip_type_long (struct paramed_type *T);
+int skip_type_bare_long (struct paramed_type *T);
+int skip_type_message (struct paramed_type *T);
+int skip_type_bare_message (struct paramed_type *T);
+int skip_type_message_action (struct paramed_type *T);
+int skip_type_bare_message_action (struct paramed_type *T);
+int skip_type_message_media (struct paramed_type *T);
+int skip_type_bare_message_media (struct paramed_type *T);
+int skip_type_messages_filter (struct paramed_type *T);
+int skip_type_bare_messages_filter (struct paramed_type *T);
+int skip_type_nearest_dc (struct paramed_type *T);
+int skip_type_bare_nearest_dc (struct paramed_type *T);
+int skip_type_notify_peer (struct paramed_type *T);
+int skip_type_bare_notify_peer (struct paramed_type *T);
+int skip_type_null (struct paramed_type *T);
+int skip_type_bare_null (struct paramed_type *T);
+int skip_type_p_q_inner_data (struct paramed_type *T);
+int skip_type_bare_p_q_inner_data (struct paramed_type *T);
+int skip_type_peer (struct paramed_type *T);
+int skip_type_bare_peer (struct paramed_type *T);
+int skip_type_peer_notify_events (struct paramed_type *T);
+int skip_type_bare_peer_notify_events (struct paramed_type *T);
+int skip_type_peer_notify_settings (struct paramed_type *T);
+int skip_type_bare_peer_notify_settings (struct paramed_type *T);
+int skip_type_photo (struct paramed_type *T);
+int skip_type_bare_photo (struct paramed_type *T);
+int skip_type_photo_size (struct paramed_type *T);
+int skip_type_bare_photo_size (struct paramed_type *T);
+int skip_type_privacy_key (struct paramed_type *T);
+int skip_type_bare_privacy_key (struct paramed_type *T);
+int skip_type_privacy_rule (struct paramed_type *T);
+int skip_type_bare_privacy_rule (struct paramed_type *T);
+int skip_type_received_notify_message (struct paramed_type *T);
+int skip_type_bare_received_notify_message (struct paramed_type *T);
+int skip_type_reply_markup (struct paramed_type *T);
+int skip_type_bare_reply_markup (struct paramed_type *T);
+int skip_type_res_p_q (struct paramed_type *T);
+int skip_type_bare_res_p_q (struct paramed_type *T);
+int skip_type_send_message_action (struct paramed_type *T);
+int skip_type_bare_send_message_action (struct paramed_type *T);
+int skip_type_server_d_h_params (struct paramed_type *T);
+int skip_type_bare_server_d_h_params (struct paramed_type *T);
+int skip_type_server_d_h_inner_data (struct paramed_type *T);
+int skip_type_bare_server_d_h_inner_data (struct paramed_type *T);
+int skip_type_set_client_d_h_params_answer (struct paramed_type *T);
+int skip_type_bare_set_client_d_h_params_answer (struct paramed_type *T);
+int skip_type_sticker_pack (struct paramed_type *T);
+int skip_type_bare_sticker_pack (struct paramed_type *T);
+int skip_type_sticker_set (struct paramed_type *T);
+int skip_type_bare_sticker_set (struct paramed_type *T);
+int skip_type_string (struct paramed_type *T);
+int skip_type_bare_string (struct paramed_type *T);
+int skip_type_update (struct paramed_type *T);
+int skip_type_bare_update (struct paramed_type *T);
+int skip_type_updates (struct paramed_type *T);
+int skip_type_bare_updates (struct paramed_type *T);
+int skip_type_user (struct paramed_type *T);
+int skip_type_bare_user (struct paramed_type *T);
+int skip_type_user_full (struct paramed_type *T);
+int skip_type_bare_user_full (struct paramed_type *T);
+int skip_type_user_profile_photo (struct paramed_type *T);
+int skip_type_bare_user_profile_photo (struct paramed_type *T);
+int skip_type_user_status (struct paramed_type *T);
+int skip_type_bare_user_status (struct paramed_type *T);
+int skip_type_vector (struct paramed_type *T);
+int skip_type_bare_vector (struct paramed_type *T);
+int skip_type_video (struct paramed_type *T);
+int skip_type_bare_video (struct paramed_type *T);
+int skip_type_wall_paper (struct paramed_type *T);
+int skip_type_bare_wall_paper (struct paramed_type *T);
+int skip_type_web_page (struct paramed_type *T);
+int skip_type_bare_web_page (struct paramed_type *T);
+int skip_type_account_authorizations (struct paramed_type *T);
+int skip_type_bare_account_authorizations (struct paramed_type *T);
+int skip_type_account_password (struct paramed_type *T);
+int skip_type_bare_account_password (struct paramed_type *T);
+int skip_type_account_password_input_settings (struct paramed_type *T);
+int skip_type_bare_account_password_input_settings (struct paramed_type *T);
+int skip_type_account_password_settings (struct paramed_type *T);
+int skip_type_bare_account_password_settings (struct paramed_type *T);
+int skip_type_account_privacy_rules (struct paramed_type *T);
+int skip_type_bare_account_privacy_rules (struct paramed_type *T);
+int skip_type_account_sent_change_phone_code (struct paramed_type *T);
+int skip_type_bare_account_sent_change_phone_code (struct paramed_type *T);
+int skip_type_auth_authorization (struct paramed_type *T);
+int skip_type_bare_auth_authorization (struct paramed_type *T);
+int skip_type_auth_checked_phone (struct paramed_type *T);
+int skip_type_bare_auth_checked_phone (struct paramed_type *T);
+int skip_type_auth_exported_authorization (struct paramed_type *T);
+int skip_type_bare_auth_exported_authorization (struct paramed_type *T);
+int skip_type_auth_password_recovery (struct paramed_type *T);
+int skip_type_bare_auth_password_recovery (struct paramed_type *T);
+int skip_type_auth_sent_code (struct paramed_type *T);
+int skip_type_bare_auth_sent_code (struct paramed_type *T);
+int skip_type_binlog_encr_key (struct paramed_type *T);
+int skip_type_bare_binlog_encr_key (struct paramed_type *T);
+int skip_type_binlog_update (struct paramed_type *T);
+int skip_type_bare_binlog_update (struct paramed_type *T);
+int skip_type_contacts_blocked (struct paramed_type *T);
+int skip_type_bare_contacts_blocked (struct paramed_type *T);
+int skip_type_contacts_contacts (struct paramed_type *T);
+int skip_type_bare_contacts_contacts (struct paramed_type *T);
+int skip_type_contacts_found (struct paramed_type *T);
+int skip_type_bare_contacts_found (struct paramed_type *T);
+int skip_type_contacts_imported_contacts (struct paramed_type *T);
+int skip_type_bare_contacts_imported_contacts (struct paramed_type *T);
+int skip_type_contacts_link (struct paramed_type *T);
+int skip_type_bare_contacts_link (struct paramed_type *T);
+int skip_type_contacts_suggested (struct paramed_type *T);
+int skip_type_bare_contacts_suggested (struct paramed_type *T);
+int skip_type_geochats_located (struct paramed_type *T);
+int skip_type_bare_geochats_located (struct paramed_type *T);
+int skip_type_geochats_messages (struct paramed_type *T);
+int skip_type_bare_geochats_messages (struct paramed_type *T);
+int skip_type_geochats_stated_message (struct paramed_type *T);
+int skip_type_bare_geochats_stated_message (struct paramed_type *T);
+int skip_type_help_app_update (struct paramed_type *T);
+int skip_type_bare_help_app_update (struct paramed_type *T);
+int skip_type_help_invite_text (struct paramed_type *T);
+int skip_type_bare_help_invite_text (struct paramed_type *T);
+int skip_type_help_support (struct paramed_type *T);
+int skip_type_bare_help_support (struct paramed_type *T);
+int skip_type_messages_affected_history (struct paramed_type *T);
+int skip_type_bare_messages_affected_history (struct paramed_type *T);
+int skip_type_messages_affected_messages (struct paramed_type *T);
+int skip_type_bare_messages_affected_messages (struct paramed_type *T);
+int skip_type_messages_all_stickers (struct paramed_type *T);
+int skip_type_bare_messages_all_stickers (struct paramed_type *T);
+int skip_type_messages_chat_full (struct paramed_type *T);
+int skip_type_bare_messages_chat_full (struct paramed_type *T);
+int skip_type_messages_chats (struct paramed_type *T);
+int skip_type_bare_messages_chats (struct paramed_type *T);
+int skip_type_messages_dh_config (struct paramed_type *T);
+int skip_type_bare_messages_dh_config (struct paramed_type *T);
+int skip_type_messages_dialogs (struct paramed_type *T);
+int skip_type_bare_messages_dialogs (struct paramed_type *T);
+int skip_type_messages_message (struct paramed_type *T);
+int skip_type_bare_messages_message (struct paramed_type *T);
+int skip_type_messages_messages (struct paramed_type *T);
+int skip_type_bare_messages_messages (struct paramed_type *T);
+int skip_type_messages_sent_encrypted_message (struct paramed_type *T);
+int skip_type_bare_messages_sent_encrypted_message (struct paramed_type *T);
+int skip_type_messages_sent_message (struct paramed_type *T);
+int skip_type_bare_messages_sent_message (struct paramed_type *T);
+int skip_type_messages_sticker_set (struct paramed_type *T);
+int skip_type_bare_messages_sticker_set (struct paramed_type *T);
+int skip_type_messages_stickers (struct paramed_type *T);
+int skip_type_bare_messages_stickers (struct paramed_type *T);
+int skip_type_photos_photo (struct paramed_type *T);
+int skip_type_bare_photos_photo (struct paramed_type *T);
+int skip_type_photos_photos (struct paramed_type *T);
+int skip_type_bare_photos_photos (struct paramed_type *T);
+int skip_type_storage_file_type (struct paramed_type *T);
+int skip_type_bare_storage_file_type (struct paramed_type *T);
+int skip_type_updates_difference (struct paramed_type *T);
+int skip_type_bare_updates_difference (struct paramed_type *T);
+int skip_type_updates_state (struct paramed_type *T);
+int skip_type_bare_updates_state (struct paramed_type *T);
+int skip_type_upload_file (struct paramed_type *T);
+int skip_type_bare_upload_file (struct paramed_type *T);
+int skip_type_any (struct paramed_type *T);
diff --git a/protocols/Telegram/tgl/auto/auto-store-ds.c b/protocols/Telegram/tgl/auto/auto-store-ds.c
new file mode 100644
index 0000000000..1a5356e4d0
--- /dev/null
+++ b/protocols/Telegram/tgl/auto/auto-store-ds.c
@@ -0,0 +1,10208 @@
+#ifdef _MSC_VER
+#include "..\auto.h"
+#include "auto-store-ds.h"
+#include "auto-skip.h"
+#include "auto-types.h"
+#include "..\auto-static-store-ds.c"
+#include "..\mtproto-common.h"
+#else
+#include "auto.h"
+#include "auto/auto-store-ds.h"
+#include "auto/auto-skip.h"
+#include "auto/auto-types.h"
+#include "auto-static-store-ds.c"
+#include "mtproto-common.h"
+#endif
+#include <assert.h>
+void store_ds_constructor_account_days_t_t_l (struct tl_ds_account_days_t_t_l *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb8d0afdf && T->type->name != 0x472f5020)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->days, field1);
+}
+void store_ds_constructor_audio_empty (struct tl_ds_audio *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fc5ec4e && T->type->name != 0x603a13b1)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+}
+void store_ds_constructor_audio (struct tl_ds_audio *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fc5ec4e && T->type->name != 0x603a13b1)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->duration, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->mime_type, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->size, field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->dc_id, field8);
+}
+void store_ds_constructor_authorization (struct tl_ds_authorization *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bf2e6f6 && T->type->name != 0x840d1909)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->hash, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->flags, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->device_model, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->platform, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->system_version, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->api_id, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->app_name, field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->app_version, field8);
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date_created, field9);
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date_active, field10);
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->ip, field11);
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->country, field12);
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->region, field13);
+}
+void store_ds_constructor_bool_false (struct tl_ds_bool *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x250be282 && T->type->name != 0xdaf41d7d)) { return; }
+}
+void store_ds_constructor_bool_true (struct tl_ds_bool *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x250be282 && T->type->name != 0xdaf41d7d)) { return; }
+}
+void store_ds_constructor_bot_command (struct tl_ds_bot_command *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x75e7ea6c && T->type->name != 0x8a181593)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->command, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->description, field2);
+}
+void store_ds_constructor_bot_command_old (struct tl_ds_bot_command *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x75e7ea6c && T->type->name != 0x8a181593)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->command, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->params, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->description, field3);
+}
+void store_ds_constructor_bot_info_empty (struct tl_ds_bot_info *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb2e16f93 && T->type->name != 0x4d1e906c)) { return; }
+}
+void store_ds_constructor_bot_info (struct tl_ds_bot_info *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb2e16f93 && T->type->name != 0x4d1e906c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->version, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->share_text, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->description, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x75e7ea6c, .id = "BotCommand", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->commands, field5);
+}
+void store_ds_constructor_bytes (struct tl_ds_string *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0ee1379f && T->type->name != 0xf11ec860)) { return; }
+ out_cstring (D->data, D->len);
+}
+void store_ds_constructor_chat_empty (struct tl_ds_chat *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field1);
+}
+void store_ds_constructor_chat (struct tl_ds_chat *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->title, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x56922676, .id = "ChatPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_chat_photo (D->photo, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->participants_count, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bool (D->left, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->version, field7);
+}
+void store_ds_constructor_chat_forbidden (struct tl_ds_chat *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->title, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field3);
+}
+void store_ds_constructor_geo_chat (struct tl_ds_chat *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->title, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->address, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->venue, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_geo_point (D->geo, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x56922676, .id = "ChatPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_chat_photo (D->photo, field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->participants_count, field8);
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field9);
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bool (D->checked_in, field10);
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->version, field11);
+}
+void store_ds_constructor_chat_full (struct tl_ds_chat_full *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02a614 && T->type->name != 0xd1fd59eb)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x77930f9f, .id = "ChatParticipants", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_chat_participants (D->participants, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_photo (D->chat_photo, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_peer_notify_settings (D->notify_settings, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f132d5, .id = "ExportedChatInvite", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_exported_chat_invite (D->exported_invite, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb2e16f93, .id = "BotInfo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->bot_info, field6);
+}
+void store_ds_constructor_chat_invite_already (struct tl_ds_chat_invite *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x94f910b1 && T->type->name != 0x6b06ef4e)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_chat (D->chat, field1);
+}
+void store_ds_constructor_chat_invite (struct tl_ds_chat_invite *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x94f910b1 && T->type->name != 0x6b06ef4e)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->title, field1);
+}
+void store_ds_constructor_chat_located (struct tl_ds_chat_located *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3631cf4c && T->type->name != 0xc9ce30b3)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->chat_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->distance, field2);
+}
+void store_ds_constructor_chat_participant (struct tl_ds_chat_participant *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc8d7493e && T->type->name != 0x3728b6c1)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->inviter_id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field3);
+}
+void store_ds_constructor_chat_participants_forbidden (struct tl_ds_chat_participants *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x77930f9f && T->type->name != 0x886cf060)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->chat_id, field1);
+}
+void store_ds_constructor_chat_participants (struct tl_ds_chat_participants *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x77930f9f && T->type->name != 0x886cf060)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->chat_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->admin_id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc8d7493e, .id = "ChatParticipant", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->participants, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->version, field4);
+}
+void store_ds_constructor_chat_photo_empty (struct tl_ds_chat_photo *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x56922676 && T->type->name != 0xa96dd989)) { return; }
+}
+void store_ds_constructor_chat_photo (struct tl_ds_chat_photo *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x56922676 && T->type->name != 0xa96dd989)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_file_location (D->photo_small, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_file_location (D->photo_big, field2);
+}
+void store_ds_constructor_client_d_h_inner_data (struct tl_ds_client_d_h_inner_data *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6643b654 && T->type->name != 0x99bc49ab)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int128 (D->nonce, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int128 (D->server_nonce, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->retry_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->g_b, field4);
+}
+void store_ds_constructor_config (struct tl_ds_config *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e32b894 && T->type->name != 0xb1cd476b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->expires, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bool (D->test_mode, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->this_dc, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2b1a62f0, .id = "DcOption", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->dc_options, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->chat_size_max, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->broadcast_size_max, field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->forwarded_count_max, field8);
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->online_update_period_ms, field9);
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->offline_blur_timeout_ms, field10);
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->offline_idle_timeout_ms, field11);
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->online_cloud_timeout_ms, field12);
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->notify_cloud_delay_ms, field13);
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->notify_default_delay_ms, field14);
+ struct paramed_type *field15 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->chat_big_size, field15);
+ struct paramed_type *field16 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->push_chat_period_ms, field16);
+ struct paramed_type *field17 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->push_chat_limit, field17);
+ struct paramed_type *field18 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xae636f24, .id = "DisabledFeature", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->disabled_features, field18);
+}
+void store_ds_constructor_contact (struct tl_ds_contact *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf911c994 && T->type->name != 0x06ee366b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bool (D->mutual, field2);
+}
+void store_ds_constructor_contact_blocked (struct tl_ds_contact_blocked *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x561bc879 && T->type->name != 0xa9e43786)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field2);
+}
+void store_ds_constructor_contact_found (struct tl_ds_contact_found *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xea879f95 && T->type->name != 0x1578606a)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field1);
+}
+void store_ds_constructor_contact_link_unknown (struct tl_ds_contact_link *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return; }
+}
+void store_ds_constructor_contact_link_none (struct tl_ds_contact_link *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return; }
+}
+void store_ds_constructor_contact_link_has_phone (struct tl_ds_contact_link *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return; }
+}
+void store_ds_constructor_contact_link_contact (struct tl_ds_contact_link *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return; }
+}
+void store_ds_constructor_contact_status (struct tl_ds_contact_status *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd3680c61 && T->type->name != 0x2c97f39e)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x76de9570, .id = "UserStatus", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_user_status (D->status, field2);
+}
+void store_ds_constructor_contact_suggested (struct tl_ds_contact_suggested *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3de191a1 && T->type->name != 0xc21e6e5e)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->mutual_contacts, field2);
+}
+void store_ds_constructor_dc_option_l28 (struct tl_ds_dc_option *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2b1a62f0 && T->type->name != 0xd4e59d0f)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->hostname, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->ip_address, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->port, field4);
+}
+void store_ds_constructor_dc_option (struct tl_ds_dc_option *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2b1a62f0 && T->type->name != 0xd4e59d0f)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->flags, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->ip_address, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->port, field4);
+}
+void store_ds_constructor_decrypted_message (struct tl_ds_decrypted_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x535b7918 && T->type->name != 0xaca486e7)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->random_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->ttl, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->message, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x34e0d674, .id = "DecryptedMessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_decrypted_message_media (D->media, field4);
+}
+void store_ds_constructor_decrypted_message_service (struct tl_ds_decrypted_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x535b7918 && T->type->name != 0xaca486e7)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->random_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4e0eefde, .id = "DecryptedMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_decrypted_message_action (D->action, field2);
+}
+void store_ds_constructor_decrypted_message_action_set_message_t_t_l (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->ttl_seconds, field1);
+}
+void store_ds_constructor_decrypted_message_action_read_messages (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->random_ids, field1);
+}
+void store_ds_constructor_decrypted_message_action_delete_messages (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->random_ids, field1);
+}
+void store_ds_constructor_decrypted_message_action_screenshot_messages (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->random_ids, field1);
+}
+void store_ds_constructor_decrypted_message_action_flush_history (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return; }
+}
+void store_ds_constructor_decrypted_message_action_resend (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->start_seq_no, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->end_seq_no, field2);
+}
+void store_ds_constructor_decrypted_message_action_notify_layer (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->layer, field1);
+}
+void store_ds_constructor_decrypted_message_action_typing (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x70541c7e, .id = "SendMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_send_message_action (D->action, field1);
+}
+void store_ds_constructor_decrypted_message_action_request_key (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->exchange_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->g_a, field2);
+}
+void store_ds_constructor_decrypted_message_action_accept_key (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->exchange_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->g_b, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->key_fingerprint, field3);
+}
+void store_ds_constructor_decrypted_message_action_abort_key (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->exchange_id, field1);
+}
+void store_ds_constructor_decrypted_message_action_commit_key (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->exchange_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->key_fingerprint, field2);
+}
+void store_ds_constructor_decrypted_message_action_noop (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return; }
+}
+void store_ds_constructor_decrypted_message_layer (struct tl_ds_decrypted_message_layer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1be31789 && T->type->name != 0xe41ce876)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->random_bytes, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->layer, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->in_seq_no, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->out_seq_no, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x535b7918, .id = "DecryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_decrypted_message (D->message, field5);
+}
+void store_ds_constructor_decrypted_message_media_empty (struct tl_ds_decrypted_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return; }
+}
+void store_ds_constructor_decrypted_message_media_photo (struct tl_ds_decrypted_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->str_thumb, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->thumb_w, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->thumb_h, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->w, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->h, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->size, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->key, field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->iv, field8);
+}
+void store_ds_constructor_decrypted_message_media_geo_point (struct tl_ds_decrypted_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_double (D->latitude, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_double (D->longitude, field2);
+}
+void store_ds_constructor_decrypted_message_media_contact (struct tl_ds_decrypted_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->phone_number, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->first_name, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->last_name, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field4);
+}
+void store_ds_constructor_decrypted_message_media_document (struct tl_ds_decrypted_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->str_thumb, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->thumb_w, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->thumb_h, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->file_name, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->mime_type, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->size, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->key, field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->iv, field8);
+}
+void store_ds_constructor_decrypted_message_media_video (struct tl_ds_decrypted_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->str_thumb, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->thumb_w, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->thumb_h, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->duration, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->mime_type, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->w, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->h, field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->size, field8);
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->key, field9);
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->iv, field10);
+}
+void store_ds_constructor_decrypted_message_media_audio (struct tl_ds_decrypted_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->duration, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->mime_type, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->size, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->key, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->iv, field5);
+}
+void store_ds_constructor_decrypted_message_media_external_document (struct tl_ds_decrypted_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->mime_type, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->size, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_photo_size (D->thumb, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->dc_id, field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->attributes, field8);
+}
+void store_ds_constructor_decrypted_message_media_video_l12 (struct tl_ds_decrypted_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->str_thumb, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->thumb_w, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->thumb_h, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->duration, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->w, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->h, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->size, field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->key, field8);
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->iv, field9);
+}
+void store_ds_constructor_decrypted_message_media_audio_l12 (struct tl_ds_decrypted_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->duration, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->size, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->key, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->iv, field4);
+}
+void store_ds_constructor_dialog (struct tl_ds_dialog *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc1dd804a && T->type->name != 0x3e227fb5)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_peer (D->peer, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->top_message, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->read_inbox_max_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->unread_count, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_peer_notify_settings (D->notify_settings, field5);
+}
+void store_ds_constructor_disabled_feature (struct tl_ds_disabled_feature *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xae636f24 && T->type->name != 0x519c90db)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->feature, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->description, field2);
+}
+void store_ds_constructor_document_empty (struct tl_ds_document *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x51a73418 && T->type->name != 0xae58cbe7)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+}
+void store_ds_constructor_document (struct tl_ds_document *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x51a73418 && T->type->name != 0xae58cbe7)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->mime_type, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->size, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_photo_size (D->thumb, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->dc_id, field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->attributes, field8);
+}
+void store_ds_constructor_document_l19 (struct tl_ds_document *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x51a73418 && T->type->name != 0xae58cbe7)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->file_name, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->mime_type, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->size, field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_photo_size (D->thumb, field8);
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->dc_id, field9);
+}
+void store_ds_constructor_document_attribute_image_size (struct tl_ds_document_attribute *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->w, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->h, field2);
+}
+void store_ds_constructor_document_attribute_animated (struct tl_ds_document_attribute *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return; }
+}
+void store_ds_constructor_document_attribute_sticker_l28 (struct tl_ds_document_attribute *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->alt, field1);
+}
+void store_ds_constructor_document_attribute_sticker (struct tl_ds_document_attribute *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->alt, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe44d415c, .id = "InputStickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_input_sticker_set (D->stickerset, field2);
+}
+void store_ds_constructor_document_attribute_video (struct tl_ds_document_attribute *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->duration, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->w, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->h, field3);
+}
+void store_ds_constructor_document_attribute_audio (struct tl_ds_document_attribute *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->duration, field1);
+}
+void store_ds_constructor_document_attribute_filename (struct tl_ds_document_attribute *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->file_name, field1);
+}
+void store_ds_constructor_double (double *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2210c154 && T->type->name != 0xddef3eab)) { return; }
+ out_double (*D);
+}
+void store_ds_constructor_encrypted_chat_empty (struct tl_ds_encrypted_chat *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field1);
+}
+void store_ds_constructor_encrypted_chat_waiting (struct tl_ds_encrypted_chat *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->admin_id, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->participant_id, field5);
+}
+void store_ds_constructor_encrypted_chat_requested (struct tl_ds_encrypted_chat *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->admin_id, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->participant_id, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->g_a, field6);
+}
+void store_ds_constructor_encrypted_chat (struct tl_ds_encrypted_chat *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->admin_id, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->participant_id, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->g_a_or_b, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->key_fingerprint, field7);
+}
+void store_ds_constructor_encrypted_chat_discarded (struct tl_ds_encrypted_chat *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field1);
+}
+void store_ds_constructor_encrypted_file_empty (struct tl_ds_encrypted_file *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x886fd032 && T->type->name != 0x77902fcd)) { return; }
+}
+void store_ds_constructor_encrypted_file (struct tl_ds_encrypted_file *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x886fd032 && T->type->name != 0x77902fcd)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->size, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->dc_id, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->key_fingerprint, field5);
+}
+void store_ds_constructor_encrypted_message (struct tl_ds_encrypted_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xce6b8a1e && T->type->name != 0x319475e1)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->random_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->chat_id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->bytes, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x886fd032, .id = "EncryptedFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_encrypted_file (D->file, field5);
+}
+void store_ds_constructor_encrypted_message_service (struct tl_ds_encrypted_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xce6b8a1e && T->type->name != 0x319475e1)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->random_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->chat_id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->bytes, field4);
+}
+void store_ds_constructor_error (struct tl_ds_error *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc4b9f9bb && T->type->name != 0x3b460644)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->code, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->text, field2);
+}
+void store_ds_constructor_chat_invite_empty (struct tl_ds_exported_chat_invite *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f132d5 && T->type->name != 0x6a0ecd2a)) { return; }
+}
+void store_ds_constructor_chat_invite_exported (struct tl_ds_exported_chat_invite *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f132d5 && T->type->name != 0x6a0ecd2a)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->link, field1);
+}
+void store_ds_constructor_file_location_unavailable (struct tl_ds_file_location *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2f8ffb30 && T->type->name != 0xd07004cf)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->volume_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->local_id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->secret, field3);
+}
+void store_ds_constructor_file_location (struct tl_ds_file_location *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2f8ffb30 && T->type->name != 0xd07004cf)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->dc_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->volume_id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->local_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->secret, field4);
+}
+void store_ds_constructor_geo_chat_message_empty (struct tl_ds_geo_chat_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf67b4034 && T->type->name != 0x0984bfcb)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->chat_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field2);
+}
+void store_ds_constructor_geo_chat_message (struct tl_ds_geo_chat_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf67b4034 && T->type->name != 0x0984bfcb)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->chat_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->from_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->message, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_message_media (D->media, field6);
+}
+void store_ds_constructor_geo_chat_message_service (struct tl_ds_geo_chat_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf67b4034 && T->type->name != 0x0984bfcb)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->chat_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->from_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x383415fa, .id = "MessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_message_action (D->action, field5);
+}
+void store_ds_constructor_geo_point_empty (struct tl_ds_geo_point *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x315e0a53 && T->type->name != 0xcea1f5ac)) { return; }
+}
+void store_ds_constructor_geo_point (struct tl_ds_geo_point *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x315e0a53 && T->type->name != 0xcea1f5ac)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_double (D->longitude, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_double (D->latitude, field2);
+}
+void store_ds_constructor_imported_contact (struct tl_ds_imported_contact *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd0028438 && T->type->name != 0x2ffd7bc7)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->client_id, field2);
+}
+void store_ds_constructor_input_app_event (struct tl_ds_input_app_event *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x770656a8 && T->type->name != 0x88f9a957)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_double (D->time, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->type, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->peer, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->data, field4);
+}
+void store_ds_constructor_input_audio_empty (struct tl_ds_input_audio *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xae8e9c7b && T->type->name != 0x51716384)) { return; }
+}
+void store_ds_constructor_input_audio (struct tl_ds_input_audio *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xae8e9c7b && T->type->name != 0x51716384)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field2);
+}
+void store_ds_constructor_input_chat_photo_empty (struct tl_ds_input_chat_photo *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3a60776d && T->type->name != 0xc59f8892)) { return; }
+}
+void store_ds_constructor_input_chat_uploaded_photo (struct tl_ds_input_chat_photo *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3a60776d && T->type->name != 0xc59f8892)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_input_file (D->file, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7477e321, .id = "InputPhotoCrop", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_input_photo_crop (D->crop, field2);
+}
+void store_ds_constructor_input_chat_photo (struct tl_ds_input_chat_photo *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3a60776d && T->type->name != 0xc59f8892)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe74279c9, .id = "InputPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_input_photo (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7477e321, .id = "InputPhotoCrop", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_input_photo_crop (D->crop, field2);
+}
+void store_ds_constructor_input_phone_contact (struct tl_ds_input_contact *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf392b7f4 && T->type->name != 0x0c6d480b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->client_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->phone, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->first_name, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->last_name, field4);
+}
+void store_ds_constructor_input_document_empty (struct tl_ds_input_document *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6a8963fc && T->type->name != 0x95769c03)) { return; }
+}
+void store_ds_constructor_input_document (struct tl_ds_input_document *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6a8963fc && T->type->name != 0x95769c03)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field2);
+}
+void store_ds_constructor_input_encrypted_chat (struct tl_ds_input_encrypted_chat *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf141b5e1 && T->type->name != 0x0ebe4a1e)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->chat_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field2);
+}
+void store_ds_constructor_input_encrypted_file_empty (struct tl_ds_input_encrypted_file *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return; }
+}
+void store_ds_constructor_input_encrypted_file_uploaded (struct tl_ds_input_encrypted_file *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->parts, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->md5_checksum, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->key_fingerprint, field4);
+}
+void store_ds_constructor_input_encrypted_file (struct tl_ds_input_encrypted_file *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field2);
+}
+void store_ds_constructor_input_encrypted_file_big_uploaded (struct tl_ds_input_encrypted_file *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->parts, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->key_fingerprint, field3);
+}
+void store_ds_constructor_input_file (struct tl_ds_input_file *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0f60f9ca && T->type->name != 0xf09f0635)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->parts, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->name, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->md5_checksum, field4);
+}
+void store_ds_constructor_input_file_big (struct tl_ds_input_file *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0f60f9ca && T->type->name != 0xf09f0635)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->parts, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->name, field3);
+}
+void store_ds_constructor_input_file_location (struct tl_ds_input_file_location *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->volume_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->local_id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->secret, field3);
+}
+void store_ds_constructor_input_video_file_location (struct tl_ds_input_file_location *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field2);
+}
+void store_ds_constructor_input_encrypted_file_location (struct tl_ds_input_file_location *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field2);
+}
+void store_ds_constructor_input_audio_file_location (struct tl_ds_input_file_location *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field2);
+}
+void store_ds_constructor_input_document_file_location (struct tl_ds_input_file_location *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field2);
+}
+void store_ds_constructor_input_geo_chat (struct tl_ds_input_geo_chat *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x74d456fa && T->type->name != 0x8b2ba905)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->chat_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field2);
+}
+void store_ds_constructor_input_geo_point_empty (struct tl_ds_input_geo_point *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17768f1f && T->type->name != 0xe88970e0)) { return; }
+}
+void store_ds_constructor_input_geo_point (struct tl_ds_input_geo_point *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17768f1f && T->type->name != 0xe88970e0)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_double (D->latitude, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_double (D->longitude, field2);
+}
+void store_ds_constructor_input_media_empty (struct tl_ds_input_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return; }
+}
+void store_ds_constructor_input_media_uploaded_photo (struct tl_ds_input_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_input_file (D->file, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->caption, field2);
+}
+void store_ds_constructor_input_media_photo (struct tl_ds_input_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe74279c9, .id = "InputPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_input_photo (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->caption, field2);
+}
+void store_ds_constructor_input_media_geo_point (struct tl_ds_input_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17768f1f, .id = "InputGeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_input_geo_point (D->geo_point, field1);
+}
+void store_ds_constructor_input_media_contact (struct tl_ds_input_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->phone_number, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->first_name, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->last_name, field3);
+}
+void store_ds_constructor_input_media_uploaded_video (struct tl_ds_input_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_input_file (D->file, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->duration, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->w, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->h, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->caption, field5);
+}
+void store_ds_constructor_input_media_uploaded_thumb_video (struct tl_ds_input_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_input_file (D->file, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_input_file (D->thumb, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->duration, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->w, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->h, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->caption, field6);
+}
+void store_ds_constructor_input_media_video (struct tl_ds_input_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xbb5f7a27, .id = "InputVideo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_input_video (D->video_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->caption, field2);
+}
+void store_ds_constructor_input_media_uploaded_audio (struct tl_ds_input_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_input_file (D->file, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->duration, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->mime_type, field3);
+}
+void store_ds_constructor_input_media_audio (struct tl_ds_input_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xae8e9c7b, .id = "InputAudio", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_input_audio (D->audio_id, field1);
+}
+void store_ds_constructor_input_media_uploaded_document (struct tl_ds_input_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_input_file (D->file, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->mime_type, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->attributes, field3);
+}
+void store_ds_constructor_input_media_uploaded_thumb_document (struct tl_ds_input_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_input_file (D->file, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_input_file (D->thumb, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->mime_type, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->attributes, field4);
+}
+void store_ds_constructor_input_media_document (struct tl_ds_input_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x6a8963fc, .id = "InputDocument", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_input_document (D->document_id, field1);
+}
+void store_ds_constructor_input_media_venue (struct tl_ds_input_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17768f1f, .id = "InputGeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_input_geo_point (D->geo_point, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->title, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->address, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->provider, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->venue_id, field5);
+}
+void store_ds_constructor_input_notify_peer (struct tl_ds_input_notify_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9e67268d, .id = "InputPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_input_peer (D->peer, field1);
+}
+void store_ds_constructor_input_notify_users (struct tl_ds_input_notify_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return; }
+}
+void store_ds_constructor_input_notify_chats (struct tl_ds_input_notify_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return; }
+}
+void store_ds_constructor_input_notify_all (struct tl_ds_input_notify_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return; }
+}
+void store_ds_constructor_input_notify_geo_chat_peer (struct tl_ds_input_notify_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x74d456fa, .id = "InputGeoChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_input_geo_chat (D->geo_peer, field1);
+}
+void store_ds_constructor_input_peer_empty (struct tl_ds_input_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return; }
+}
+void store_ds_constructor_input_peer_self (struct tl_ds_input_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return; }
+}
+void store_ds_constructor_input_peer_contact (struct tl_ds_input_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field1);
+}
+void store_ds_constructor_input_peer_foreign (struct tl_ds_input_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field2);
+}
+void store_ds_constructor_input_peer_chat (struct tl_ds_input_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->chat_id, field1);
+}
+void store_ds_constructor_input_peer_notify_events_empty (struct tl_ds_input_peer_notify_events *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x185a48ac && T->type->name != 0xe7a5b753)) { return; }
+}
+void store_ds_constructor_input_peer_notify_events_all (struct tl_ds_input_peer_notify_events *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x185a48ac && T->type->name != 0xe7a5b753)) { return; }
+}
+void store_ds_constructor_input_peer_notify_settings (struct tl_ds_input_peer_notify_settings *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x46a2ce98 && T->type->name != 0xb95d3167)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->mute_until, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->sound, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bool (D->show_previews, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->events_mask, field4);
+}
+void store_ds_constructor_input_photo_empty (struct tl_ds_input_photo *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe74279c9 && T->type->name != 0x18bd8636)) { return; }
+}
+void store_ds_constructor_input_photo (struct tl_ds_input_photo *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe74279c9 && T->type->name != 0x18bd8636)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field2);
+}
+void store_ds_constructor_input_photo_crop_auto (struct tl_ds_input_photo_crop *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7477e321 && T->type->name != 0x8b881cde)) { return; }
+}
+void store_ds_constructor_input_photo_crop (struct tl_ds_input_photo_crop *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7477e321 && T->type->name != 0x8b881cde)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_double (D->crop_left, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_double (D->crop_top, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_double (D->crop_width, field3);
+}
+void store_ds_constructor_input_privacy_key_status_timestamp (struct tl_ds_input_privacy_key *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4f96cb18 && T->type->name != 0xb06934e7)) { return; }
+}
+void store_ds_constructor_input_privacy_value_allow_contacts (struct tl_ds_input_privacy_rule *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return; }
+}
+void store_ds_constructor_input_privacy_value_allow_all (struct tl_ds_input_privacy_rule *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return; }
+}
+void store_ds_constructor_input_privacy_value_allow_users (struct tl_ds_input_privacy_rule *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->users, field1);
+}
+void store_ds_constructor_input_privacy_value_disallow_contacts (struct tl_ds_input_privacy_rule *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return; }
+}
+void store_ds_constructor_input_privacy_value_disallow_all (struct tl_ds_input_privacy_rule *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return; }
+}
+void store_ds_constructor_input_privacy_value_disallow_users (struct tl_ds_input_privacy_rule *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->users, field1);
+}
+void store_ds_constructor_input_sticker_set_empty (struct tl_ds_input_sticker_set *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe44d415c && T->type->name != 0x1bb2bea3)) { return; }
+}
+void store_ds_constructor_input_sticker_set_i_d (struct tl_ds_input_sticker_set *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe44d415c && T->type->name != 0x1bb2bea3)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field2);
+}
+void store_ds_constructor_input_sticker_set_short_name (struct tl_ds_input_sticker_set *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe44d415c && T->type->name != 0x1bb2bea3)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->short_name, field1);
+}
+void store_ds_constructor_input_user_empty (struct tl_ds_input_user *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return; }
+}
+void store_ds_constructor_input_user_self (struct tl_ds_input_user *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return; }
+}
+void store_ds_constructor_input_user_contact (struct tl_ds_input_user *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field1);
+}
+void store_ds_constructor_input_user_foreign (struct tl_ds_input_user *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field2);
+}
+void store_ds_constructor_input_video_empty (struct tl_ds_input_video *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbb5f7a27 && T->type->name != 0x44a085d8)) { return; }
+}
+void store_ds_constructor_input_video (struct tl_ds_input_video *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbb5f7a27 && T->type->name != 0x44a085d8)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field2);
+}
+void store_ds_constructor_int (int *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8509bda && T->type->name != 0x57af6425)) { return; }
+ out_int (*D);
+}
+void store_ds_constructor_int128 (struct tl_ds_int128 *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7d36c439 && T->type->name != 0x82c93bc6)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->f0, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->f1, field2);
+}
+void store_ds_constructor_int256 (struct tl_ds_int256 *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf2c798b3 && T->type->name != 0x0d38674c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->f0, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->f1, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->f2, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->f3, field4);
+}
+void store_ds_constructor_keyboard_button (struct tl_ds_keyboard_button *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa2fa4880 && T->type->name != 0x5d05b77f)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->text, field1);
+}
+void store_ds_constructor_keyboard_button_row (struct tl_ds_keyboard_button_row *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x77608b83 && T->type->name != 0x889f747c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa2fa4880, .id = "KeyboardButton", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->buttons, field1);
+}
+void store_ds_constructor_long (long long *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22076cba && T->type->name != 0xddf89345)) { return; }
+ out_long (*D);
+}
+void store_ds_constructor_message_empty (struct tl_ds_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5d652a7f && T->type->name != 0xa29ad580)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field1);
+}
+void store_ds_constructor_message (struct tl_ds_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5d652a7f && T->type->name != 0xa29ad580)) { return; }
+ struct paramed_type *var0 = INT2PTR (*D->flags);
+ out_int (PTR2INT (var0));
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->from_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_peer (D->to_id, field4);
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->fwd_from_id, field5);
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->fwd_date, field6);
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->reply_to_msg_id, field7);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field8);
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->message, field9);
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_message_media (D->media, field10);
+ if (PTR2INT (var0) & (1 << 6)) {
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x612ca4a9, .id = "ReplyMarkup", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_reply_markup (D->reply_markup, field11);
+ }
+}
+void store_ds_constructor_message_service (struct tl_ds_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5d652a7f && T->type->name != 0xa29ad580)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->flags, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->from_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_peer (D->to_id, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x383415fa, .id = "MessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_message_action (D->action, field6);
+}
+void store_ds_constructor_message_action_empty (struct tl_ds_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return; }
+}
+void store_ds_constructor_message_action_chat_create (struct tl_ds_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->title, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->users, field2);
+}
+void store_ds_constructor_message_action_chat_edit_title (struct tl_ds_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->title, field1);
+}
+void store_ds_constructor_message_action_chat_edit_photo (struct tl_ds_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_photo (D->photo, field1);
+}
+void store_ds_constructor_message_action_chat_delete_photo (struct tl_ds_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return; }
+}
+void store_ds_constructor_message_action_chat_add_user (struct tl_ds_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field1);
+}
+void store_ds_constructor_message_action_chat_delete_user (struct tl_ds_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field1);
+}
+void store_ds_constructor_message_action_geo_chat_create (struct tl_ds_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->title, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->address, field2);
+}
+void store_ds_constructor_message_action_geo_chat_checkin (struct tl_ds_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return; }
+}
+void store_ds_constructor_message_action_chat_joined_by_link (struct tl_ds_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->inviter_id, field1);
+}
+void store_ds_constructor_message_media_empty (struct tl_ds_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return; }
+}
+void store_ds_constructor_message_media_photo (struct tl_ds_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_photo (D->photo, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->caption, field2);
+}
+void store_ds_constructor_message_media_video (struct tl_ds_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1716b174, .id = "Video", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_video (D->video, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->caption, field2);
+}
+void store_ds_constructor_message_media_geo (struct tl_ds_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_geo_point (D->geo, field1);
+}
+void store_ds_constructor_message_media_contact (struct tl_ds_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->phone_number, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->first_name, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->last_name, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field4);
+}
+void store_ds_constructor_message_media_unsupported (struct tl_ds_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return; }
+}
+void store_ds_constructor_message_media_document (struct tl_ds_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_document (D->document, field1);
+}
+void store_ds_constructor_message_media_audio (struct tl_ds_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9fc5ec4e, .id = "Audio", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_audio (D->audio, field1);
+}
+void store_ds_constructor_message_media_web_page (struct tl_ds_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x8d8c0d41, .id = "WebPage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_web_page (D->webpage, field1);
+}
+void store_ds_constructor_message_media_venue (struct tl_ds_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_geo_point (D->geo, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->title, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->address, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->provider, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->venue_id, field5);
+}
+void store_ds_constructor_message_media_photo_l27 (struct tl_ds_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_photo (D->photo, field1);
+}
+void store_ds_constructor_message_media_video_l27 (struct tl_ds_message_media *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1716b174, .id = "Video", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_video (D->video, field1);
+}
+void store_ds_constructor_input_messages_filter_empty (struct tl_ds_messages_filter *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return; }
+}
+void store_ds_constructor_input_messages_filter_photos (struct tl_ds_messages_filter *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return; }
+}
+void store_ds_constructor_input_messages_filter_video (struct tl_ds_messages_filter *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return; }
+}
+void store_ds_constructor_input_messages_filter_photo_video (struct tl_ds_messages_filter *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return; }
+}
+void store_ds_constructor_input_messages_filter_photo_video_documents (struct tl_ds_messages_filter *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return; }
+}
+void store_ds_constructor_input_messages_filter_document (struct tl_ds_messages_filter *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return; }
+}
+void store_ds_constructor_input_messages_filter_audio (struct tl_ds_messages_filter *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return; }
+}
+void store_ds_constructor_nearest_dc (struct tl_ds_nearest_dc *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8e1a1775 && T->type->name != 0x71e5e88a)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->country, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->this_dc, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->nearest_dc, field3);
+}
+void store_ds_constructor_notify_peer (struct tl_ds_notify_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_peer (D->peer, field1);
+}
+void store_ds_constructor_notify_users (struct tl_ds_notify_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return; }
+}
+void store_ds_constructor_notify_chats (struct tl_ds_notify_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return; }
+}
+void store_ds_constructor_notify_all (struct tl_ds_notify_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return; }
+}
+void store_ds_constructor_null (struct tl_ds_null *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x56730bcc && T->type->name != 0xa98cf433)) { return; }
+}
+void store_ds_constructor_p_q_inner_data (struct tl_ds_p_q_inner_data *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbfa3de38 && T->type->name != 0x405c21c7)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->pq, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->p, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->q, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int128 (D->nonce, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int128 (D->server_nonce, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0d38674c, .id = "Bare_Int256", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int256 (D->new_nonce, field6);
+}
+void store_ds_constructor_p_q_inner_data_temp (struct tl_ds_p_q_inner_data *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbfa3de38 && T->type->name != 0x405c21c7)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->pq, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->p, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->q, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int128 (D->nonce, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int128 (D->server_nonce, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0d38674c, .id = "Bare_Int256", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int256 (D->new_nonce, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->expires_in, field7);
+}
+void store_ds_constructor_peer_user (struct tl_ds_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x276159d6 && T->type->name != 0xd89ea629)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field1);
+}
+void store_ds_constructor_peer_chat (struct tl_ds_peer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x276159d6 && T->type->name != 0xd89ea629)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->chat_id, field1);
+}
+void store_ds_constructor_peer_notify_events_empty (struct tl_ds_peer_notify_events *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc0c8d13b && T->type->name != 0x3f372ec4)) { return; }
+}
+void store_ds_constructor_peer_notify_events_all (struct tl_ds_peer_notify_events *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc0c8d13b && T->type->name != 0x3f372ec4)) { return; }
+}
+void store_ds_constructor_peer_notify_settings_empty (struct tl_ds_peer_notify_settings *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xfdf894fc && T->type->name != 0x02076b03)) { return; }
+}
+void store_ds_constructor_peer_notify_settings (struct tl_ds_peer_notify_settings *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xfdf894fc && T->type->name != 0x02076b03)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->mute_until, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->sound, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bool (D->show_previews, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->events_mask, field4);
+}
+void store_ds_constructor_photo_empty (struct tl_ds_photo *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc207550a && T->type->name != 0x3df8aaf5)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+}
+void store_ds_constructor_photo (struct tl_ds_photo *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc207550a && T->type->name != 0x3df8aaf5)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_geo_point (D->geo, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->sizes, field6);
+}
+void store_ds_constructor_photo_l27 (struct tl_ds_photo *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc207550a && T->type->name != 0x3df8aaf5)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->caption, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_geo_point (D->geo, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->sizes, field7);
+}
+void store_ds_constructor_photo_size_empty (struct tl_ds_photo_size *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x900f60dd && T->type->name != 0x6ff09f22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->type, field1);
+}
+void store_ds_constructor_photo_size (struct tl_ds_photo_size *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x900f60dd && T->type->name != 0x6ff09f22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->type, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_file_location (D->location, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->w, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->h, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->size, field5);
+}
+void store_ds_constructor_photo_cached_size (struct tl_ds_photo_size *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x900f60dd && T->type->name != 0x6ff09f22)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->type, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_file_location (D->location, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->w, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->h, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->bytes, field5);
+}
+void store_ds_constructor_privacy_key_status_timestamp (struct tl_ds_privacy_key *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbc2eab30 && T->type->name != 0x43d154cf)) { return; }
+}
+void store_ds_constructor_privacy_value_allow_contacts (struct tl_ds_privacy_rule *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return; }
+}
+void store_ds_constructor_privacy_value_allow_all (struct tl_ds_privacy_rule *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return; }
+}
+void store_ds_constructor_privacy_value_allow_users (struct tl_ds_privacy_rule *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->users, field1);
+}
+void store_ds_constructor_privacy_value_disallow_contacts (struct tl_ds_privacy_rule *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return; }
+}
+void store_ds_constructor_privacy_value_disallow_all (struct tl_ds_privacy_rule *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return; }
+}
+void store_ds_constructor_privacy_value_disallow_users (struct tl_ds_privacy_rule *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->users, field1);
+}
+void store_ds_constructor_received_notify_message (struct tl_ds_received_notify_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa384b779 && T->type->name != 0x5c7b4886)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->flags, field2);
+}
+void store_ds_constructor_reply_keyboard_hide (struct tl_ds_reply_markup *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x612ca4a9 && T->type->name != 0x9ed35b56)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->flags, field1);
+}
+void store_ds_constructor_reply_keyboard_force_reply (struct tl_ds_reply_markup *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x612ca4a9 && T->type->name != 0x9ed35b56)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->flags, field1);
+}
+void store_ds_constructor_reply_keyboard_markup (struct tl_ds_reply_markup *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x612ca4a9 && T->type->name != 0x9ed35b56)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->flags, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x77608b83, .id = "KeyboardButtonRow", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->rows, field2);
+}
+void store_ds_constructor_res_p_q (struct tl_ds_res_p_q *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x05162463 && T->type->name != 0xfae9db9c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int128 (D->nonce, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int128 (D->server_nonce, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->pq, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->server_public_key_fingerprints, field4);
+}
+void store_ds_constructor_send_message_typing_action (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return; }
+}
+void store_ds_constructor_send_message_cancel_action (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return; }
+}
+void store_ds_constructor_send_message_record_video_action (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return; }
+}
+void store_ds_constructor_send_message_upload_video_action_l27 (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return; }
+}
+void store_ds_constructor_send_message_upload_video_action (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->progress, field1);
+}
+void store_ds_constructor_send_message_record_audio_action (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return; }
+}
+void store_ds_constructor_send_message_upload_audio_action_l27 (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return; }
+}
+void store_ds_constructor_send_message_upload_audio_action (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->progress, field1);
+}
+void store_ds_constructor_send_message_upload_photo_action (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->progress, field1);
+}
+void store_ds_constructor_send_message_upload_document_action_l27 (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return; }
+}
+void store_ds_constructor_send_message_upload_document_action (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->progress, field1);
+}
+void store_ds_constructor_send_message_geo_location_action (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return; }
+}
+void store_ds_constructor_send_message_choose_contact_action (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return; }
+}
+void store_ds_constructor_server_d_h_params_fail (struct tl_ds_server_d_h_params *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa9230301 && T->type->name != 0x56dcfcfe)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int128 (D->nonce, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int128 (D->server_nonce, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int128 (D->new_nonce_hash, field3);
+}
+void store_ds_constructor_server_d_h_params_ok (struct tl_ds_server_d_h_params *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa9230301 && T->type->name != 0x56dcfcfe)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int128 (D->nonce, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int128 (D->server_nonce, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->encrypted_answer, field3);
+}
+void store_ds_constructor_server_d_h_inner_data (struct tl_ds_server_d_h_inner_data *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb5890dba && T->type->name != 0x4a76f245)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int128 (D->nonce, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int128 (D->server_nonce, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->g, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->dh_prime, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->g_a, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->server_time, field6);
+}
+void store_ds_constructor_dh_gen_ok (struct tl_ds_set_client_d_h_params_answer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdb8a468f && T->type->name != 0x2475b970)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int128 (D->nonce, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int128 (D->server_nonce, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int128 (D->new_nonce_hash1, field3);
+}
+void store_ds_constructor_dh_gen_retry (struct tl_ds_set_client_d_h_params_answer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdb8a468f && T->type->name != 0x2475b970)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int128 (D->nonce, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int128 (D->server_nonce, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int128 (D->new_nonce_hash2, field3);
+}
+void store_ds_constructor_dh_gen_fail (struct tl_ds_set_client_d_h_params_answer *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdb8a468f && T->type->name != 0x2475b970)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int128 (D->nonce, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int128 (D->server_nonce, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int128 (D->new_nonce_hash3, field3);
+}
+void store_ds_constructor_sticker_pack (struct tl_ds_sticker_pack *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x12b299d4 && T->type->name != 0xed4d662b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->emoticon, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->documents, field2);
+}
+void store_ds_constructor_sticker_set (struct tl_ds_sticker_set *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa7a43b17 && T->type->name != 0x585bc4e8)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->title, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->short_name, field4);
+}
+void store_ds_constructor_string (struct tl_ds_string *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb5286e24 && T->type->name != 0x4ad791db)) { return; }
+ out_cstring (D->data, D->len);
+}
+void store_ds_constructor_update_new_message (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_message (D->message, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->pts, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->pts_count, field3);
+}
+void store_ds_constructor_update_message_i_d (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->random_id, field2);
+}
+void store_ds_constructor_update_delete_messages (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->messages, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->pts, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->pts_count, field3);
+}
+void store_ds_constructor_update_user_typing (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x70541c7e, .id = "SendMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_send_message_action (D->action, field2);
+}
+void store_ds_constructor_update_chat_user_typing (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->chat_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x70541c7e, .id = "SendMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_send_message_action (D->action, field3);
+}
+void store_ds_constructor_update_chat_participants (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x77930f9f, .id = "ChatParticipants", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_chat_participants (D->participants, field1);
+}
+void store_ds_constructor_update_user_status (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x76de9570, .id = "UserStatus", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_user_status (D->status, field2);
+}
+void store_ds_constructor_update_user_name (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->first_name, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->last_name, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->username, field4);
+}
+void store_ds_constructor_update_user_photo (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9a486229, .id = "UserProfilePhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_user_profile_photo (D->photo, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bool (D->previous, field4);
+}
+void store_ds_constructor_update_contact_registered (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field2);
+}
+void store_ds_constructor_update_contact_link (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_contact_link (D->my_link, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_contact_link (D->foreign_link, field3);
+}
+void store_ds_constructor_update_new_authorization (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->auth_key_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->device, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->location, field4);
+}
+void store_ds_constructor_update_new_geo_chat_message (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_geo_chat_message (D->geo_message, field1);
+}
+void store_ds_constructor_update_new_encrypted_message (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xce6b8a1e, .id = "EncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_encrypted_message (D->encr_message, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->qts, field2);
+}
+void store_ds_constructor_update_encrypted_chat_typing (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->chat_id, field1);
+}
+void store_ds_constructor_update_encryption (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb1718213, .id = "EncryptedChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_encrypted_chat (D->encr_chat, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field2);
+}
+void store_ds_constructor_update_encrypted_messages_read (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->chat_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->max_date, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field3);
+}
+void store_ds_constructor_update_chat_participant_add (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->chat_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->inviter_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->version, field4);
+}
+void store_ds_constructor_update_chat_participant_delete (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->chat_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->version, field3);
+}
+void store_ds_constructor_update_dc_options (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2b1a62f0, .id = "DcOption", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->dc_options, field1);
+}
+void store_ds_constructor_update_user_blocked (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bool (D->blocked, field2);
+}
+void store_ds_constructor_update_notify_settings (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9fcb8237, .id = "NotifyPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_notify_peer (D->notify_peer, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_peer_notify_settings (D->notify_settings, field2);
+}
+void store_ds_constructor_update_service_notification (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->type, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->message_text, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_message_media (D->media, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bool (D->popup, field4);
+}
+void store_ds_constructor_update_privacy (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xbc2eab30, .id = "PrivacyKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_privacy_key (D->key, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa8638aec, .id = "PrivacyRule", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->rules, field2);
+}
+void store_ds_constructor_update_user_phone (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->phone, field2);
+}
+void store_ds_constructor_update_read_history_inbox (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_peer (D->peer, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->max_id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->pts, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->pts_count, field4);
+}
+void store_ds_constructor_update_read_history_outbox (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_peer (D->peer, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->max_id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->pts, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->pts_count, field4);
+}
+void store_ds_constructor_update_web_page (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x8d8c0d41, .id = "WebPage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_web_page (D->webpage, field1);
+}
+void store_ds_constructor_update_read_messages_contents (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->messages, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->pts, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->pts_count, field3);
+}
+void store_ds_constructor_update_msg_update (struct tl_ds_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->pts, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->pts_count, field3);
+}
+void store_ds_constructor_updates_too_long (struct tl_ds_updates *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return; }
+}
+void store_ds_constructor_update_short_message (struct tl_ds_updates *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return; }
+ struct paramed_type *var0 = INT2PTR (*D->flags);
+ out_int (PTR2INT (var0));
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->message, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->pts, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->pts_count, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field7);
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->fwd_from_id, field8);
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->fwd_date, field9);
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->reply_to_msg_id, field10);
+ }
+}
+void store_ds_constructor_update_short_chat_message (struct tl_ds_updates *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return; }
+ struct paramed_type *var0 = INT2PTR (*D->flags);
+ out_int (PTR2INT (var0));
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->from_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->chat_id, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->message, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->pts, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->pts_count, field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field8);
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->fwd_from_id, field9);
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->fwd_date, field10);
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->reply_to_msg_id, field11);
+ }
+}
+void store_ds_constructor_update_short (struct tl_ds_updates *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_update (D->update, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field2);
+}
+void store_ds_constructor_updates_combined (struct tl_ds_updates *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->updates, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->users, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->chats, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->seq_start, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->seq, field6);
+}
+void store_ds_constructor_updates (struct tl_ds_updates *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->updates, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->users, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->chats, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->seq, field5);
+}
+void store_ds_constructor_user_empty (struct tl_ds_user *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02e6c0c8 && T->type->name != 0xfd193f37)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field1);
+}
+void store_ds_constructor_user (struct tl_ds_user *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02e6c0c8 && T->type->name != 0xfd193f37)) { return; }
+ struct paramed_type *var0 = INT2PTR (*D->flags);
+ out_int (PTR2INT (var0));
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field2);
+ if (PTR2INT (var0) & (1 << 0)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field3);
+ }
+ if (PTR2INT (var0) & (1 << 1)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->first_name, field4);
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->last_name, field5);
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->username, field6);
+ }
+ if (PTR2INT (var0) & (1 << 4)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->phone, field7);
+ }
+ if (PTR2INT (var0) & (1 << 5)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9a486229, .id = "UserProfilePhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_user_profile_photo (D->photo, field8);
+ }
+ if (PTR2INT (var0) & (1 << 6)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x76de9570, .id = "UserStatus", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_user_status (D->status, field9);
+ }
+ if (PTR2INT (var0) & (1 << 14)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->bot_info_version, field10);
+ }
+}
+void store_ds_constructor_user_full (struct tl_ds_user_full *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5a89ac5b && T->type->name != 0xa57653a4)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_user (D->user, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3ace484c, .id = "contacts.Link", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_contacts_link (D->link, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_photo (D->profile_photo, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_peer_notify_settings (D->notify_settings, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bool (D->blocked, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb2e16f93, .id = "BotInfo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bot_info (D->bot_info, field6);
+}
+void store_ds_constructor_user_profile_photo_empty (struct tl_ds_user_profile_photo *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9a486229 && T->type->name != 0x65b79dd6)) { return; }
+}
+void store_ds_constructor_user_profile_photo (struct tl_ds_user_profile_photo *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9a486229 && T->type->name != 0x65b79dd6)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->photo_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_file_location (D->photo_small, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_file_location (D->photo_big, field3);
+}
+void store_ds_constructor_user_status_empty (struct tl_ds_user_status *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return; }
+}
+void store_ds_constructor_user_status_online (struct tl_ds_user_status *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->expires, field1);
+}
+void store_ds_constructor_user_status_offline (struct tl_ds_user_status *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->was_online, field1);
+}
+void store_ds_constructor_user_status_recently (struct tl_ds_user_status *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return; }
+}
+void store_ds_constructor_user_status_last_week (struct tl_ds_user_status *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return; }
+}
+void store_ds_constructor_user_status_last_month (struct tl_ds_user_status *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return; }
+}
+void store_ds_constructor_vector (struct tl_ds_vector *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1cb5c415 && T->type->name != 0xe34a3bea)) { return; }
+ if (ODDP(T->params[0])) { return; }
+ struct paramed_type *var0 = T->params[0]; assert (var0);
+ struct paramed_type *var1 = INT2PTR (*D->f1);
+ out_int (PTR2INT (var1));
+ int multiplicity3 = PTR2INT (
+ ((void *)var1) + 0 );
+ struct paramed_type *field3 =
+ var0;
+ {
+ int i = 0;
+ while (i < multiplicity3) {
+ store_ds_type_any (D->f2[i ++], field3);
+ }
+ }
+}
+void store_ds_constructor_video_empty (struct tl_ds_video *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1716b174 && T->type->name != 0xe8e94e8b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+}
+void store_ds_constructor_video (struct tl_ds_video *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1716b174 && T->type->name != 0xe8e94e8b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->duration, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->size, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_photo_size (D->thumb, field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->dc_id, field8);
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->w, field9);
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->h, field10);
+}
+void store_ds_constructor_video_l27 (struct tl_ds_video *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1716b174 && T->type->name != 0xe8e94e8b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->caption, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->duration, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->mime_type, field7);
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->size, field8);
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_photo_size (D->thumb, field9);
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->dc_id, field10);
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->w, field11);
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->h, field12);
+}
+void store_ds_constructor_wall_paper (struct tl_ds_wall_paper *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xafa14973 && T->type->name != 0x505eb68c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->title, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->sizes, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->color, field4);
+}
+void store_ds_constructor_wall_paper_solid (struct tl_ds_wall_paper *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xafa14973 && T->type->name != 0x505eb68c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->title, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->bg_color, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->color, field4);
+}
+void store_ds_constructor_web_page_empty (struct tl_ds_web_page *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8d8c0d41 && T->type->name != 0x7273f2be)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+}
+void store_ds_constructor_web_page_pending (struct tl_ds_web_page *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8d8c0d41 && T->type->name != 0x7273f2be)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field2);
+}
+void store_ds_constructor_web_page (struct tl_ds_web_page *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8d8c0d41 && T->type->name != 0x7273f2be)) { return; }
+ struct paramed_type *var0 = INT2PTR (*D->flags);
+ out_int (PTR2INT (var0));
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->id, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->url, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->display_url, field4);
+ if (PTR2INT (var0) & (1 << 0)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->type, field5);
+ }
+ if (PTR2INT (var0) & (1 << 1)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->site_name, field6);
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->title, field7);
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->description, field8);
+ }
+ if (PTR2INT (var0) & (1 << 4)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_photo (D->photo, field9);
+ }
+ if (PTR2INT (var0) & (1 << 5)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->embed_url, field10);
+ }
+ if (PTR2INT (var0) & (1 << 5)) {
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->embed_type, field11);
+ }
+ if (PTR2INT (var0) & (1 << 6)) {
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->embed_width, field12);
+ }
+ if (PTR2INT (var0) & (1 << 6)) {
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->embed_height, field13);
+ }
+ if (PTR2INT (var0) & (1 << 7)) {
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->duration, field14);
+ }
+ if (PTR2INT (var0) & (1 << 8)) {
+ struct paramed_type *field15 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->author, field15);
+ }
+}
+void store_ds_constructor_account_authorizations (struct tl_ds_account_authorizations *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1250abde && T->type->name != 0xedaf5421)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bf2e6f6, .id = "Authorization", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->authorizations, field1);
+}
+void store_ds_constructor_account_no_password (struct tl_ds_account_password *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xeac2a804 && T->type->name != 0x153d57fb)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->new_salt, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->email_unconfirmed_pattern, field2);
+}
+void store_ds_constructor_account_password (struct tl_ds_account_password *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xeac2a804 && T->type->name != 0x153d57fb)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->current_salt, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->new_salt, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->hint, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bool (D->has_recovery, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->email_unconfirmed_pattern, field5);
+}
+void store_ds_constructor_account_password_input_settings (struct tl_ds_account_password_input_settings *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbcfc532c && T->type->name != 0x4303acd3)) { return; }
+ struct paramed_type *var0 = INT2PTR (*D->flags);
+ out_int (PTR2INT (var0));
+ if (PTR2INT (var0) & (1 << 0)) {
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->new_salt, field2);
+ }
+ if (PTR2INT (var0) & (1 << 0)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->new_password_hash, field3);
+ }
+ if (PTR2INT (var0) & (1 << 0)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->hint, field4);
+ }
+ if (PTR2INT (var0) & (1 << 1)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->email, field5);
+ }
+}
+void store_ds_constructor_account_password_settings (struct tl_ds_account_password_settings *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb7b72ab3 && T->type->name != 0x4848d54c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->email, field1);
+}
+void store_ds_constructor_account_privacy_rules (struct tl_ds_account_privacy_rules *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x554abb6f && T->type->name != 0xaab54490)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa8638aec, .id = "PrivacyRule", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->rules, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->users, field2);
+}
+void store_ds_constructor_account_sent_change_phone_code (struct tl_ds_account_sent_change_phone_code *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa4f58c4c && T->type->name != 0x5b0a73b3)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->phone_code_hash, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->send_call_timeout, field2);
+}
+void store_ds_constructor_auth_authorization (struct tl_ds_auth_authorization *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xff036af1 && T->type->name != 0x00fc950e)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_user (D->user, field1);
+}
+void store_ds_constructor_auth_checked_phone (struct tl_ds_auth_checked_phone *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x811ea28e && T->type->name != 0x7ee15d71)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bool (D->phone_registered, field1);
+}
+void store_ds_constructor_auth_exported_authorization (struct tl_ds_auth_exported_authorization *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdf969c2d && T->type->name != 0x206963d2)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->bytes, field2);
+}
+void store_ds_constructor_auth_password_recovery (struct tl_ds_auth_password_recovery *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x137948a5 && T->type->name != 0xec86b75a)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->email_pattern, field1);
+}
+void store_ds_constructor_auth_sent_code (struct tl_ds_auth_sent_code *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0cc8bc16 && T->type->name != 0xf33743e9)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bool (D->phone_registered, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->phone_code_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->send_call_timeout, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bool (D->is_password, field4);
+}
+void store_ds_constructor_auth_sent_app_code (struct tl_ds_auth_sent_code *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0cc8bc16 && T->type->name != 0xf33743e9)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bool (D->phone_registered, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->phone_code_hash, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->send_call_timeout, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bool (D->is_password, field4);
+}
+void store_ds_constructor_binlog_encr_key (struct tl_ds_binlog_encr_key *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0377168f && T->type->name != 0xfc88e970)) { return; }
+ int multiplicity1 = PTR2INT (
+ INT2PTR (64) );
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ {
+ int i = 0;
+ while (i < multiplicity1) {
+ store_ds_type_any (D->key[i ++], field1);
+ }
+ }
+}
+void store_ds_constructor_binlog_start (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+}
+void store_ds_constructor_binlog_dc_option (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->dc, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->name, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->ip, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->port, field4);
+}
+void store_ds_constructor_binlog_dc_option_new (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->flags, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->dc, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->name, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->ip, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->port, field5);
+}
+void store_ds_constructor_binlog_auth_key (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->dc, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_binlog_encr_key (D->key, field2);
+}
+void store_ds_constructor_binlog_default_dc (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->dc, field1);
+}
+void store_ds_constructor_binlog_dc_signed (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->dc, field1);
+}
+void store_ds_constructor_binlog_our_id (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field1);
+}
+void store_ds_constructor_binlog_set_dh_params (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->root, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_binlog_encr_key (D->prime, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->version, field3);
+}
+void store_ds_constructor_binlog_set_pts (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->pts, field1);
+}
+void store_ds_constructor_binlog_set_qts (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->qts, field1);
+}
+void store_ds_constructor_binlog_set_date (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field1);
+}
+void store_ds_constructor_binlog_set_seq (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->seq, field1);
+}
+void store_ds_constructor_binlog_encr_chat_delete (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field1);
+}
+void store_ds_constructor_binlog_encr_chat_new (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *var0 = INT2PTR (*D->flags);
+ out_int (PTR2INT (var0));
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field2);
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field3);
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field4);
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->admin, field5);
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field6);
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_binlog_encr_key (D->key, field7);
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_binlog_encr_key (D->g_key, field8);
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->state, field9);
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->ttl, field10);
+ }
+ if (PTR2INT (var0) & (1 << 25)) {
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->layer, field11);
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->in_seq_no, field12);
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->last_in_seq_no, field13);
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->out_seq_no, field14);
+ }
+ if (PTR2INT (var0) & (1 << 27)) {
+ struct paramed_type *field15 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->key_fingerprint, field15);
+ }
+}
+void store_ds_constructor_binlog_encr_chat_exchange_new (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *var0 = INT2PTR (*D->flags);
+ out_int (PTR2INT (var0));
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field2);
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->exchange_id, field3);
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_binlog_encr_key (D->key, field4);
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->state, field5);
+ }
+}
+void store_ds_constructor_binlog_user_delete (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field1);
+}
+void store_ds_constructor_binlog_user_new (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *var0 = INT2PTR (*D->flags);
+ out_int (PTR2INT (var0));
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field2);
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->access_hash, field3);
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->first_name, field4);
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->last_name, field5);
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->phone, field6);
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->username, field7);
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_photo (D->photo, field8);
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->real_first_name, field9);
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->real_last_name, field10);
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9a486229, .id = "UserProfilePhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_user_profile_photo (D->user_photo, field11);
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->last_read_in, field12);
+ }
+ if (PTR2INT (var0) & (1 << 25)) {
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->last_read_out, field13);
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb2e16f93, .id = "BotInfo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bot_info (D->bot_info, field14);
+ }
+}
+void store_ds_constructor_binlog_chat_new (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *var0 = INT2PTR (*D->flags);
+ out_int (PTR2INT (var0));
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field2);
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->title, field3);
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_num, field4);
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field5);
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->version, field6);
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc8d7493e, .id = "ChatParticipant", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->participants, field7);
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x56922676, .id = "ChatPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_chat_photo (D->chat_photo, field8);
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_photo (D->photo, field9);
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->admin, field10);
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->last_read_in, field11);
+ }
+ if (PTR2INT (var0) & (1 << 25)) {
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->last_read_out, field12);
+ }
+}
+void store_ds_constructor_binlog_chat_add_participant (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->version, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->inviter_id, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field5);
+}
+void store_ds_constructor_binlog_chat_del_participant (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->version, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->user_id, field3);
+}
+void store_ds_constructor_binlog_set_msg_id (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->old_id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->new_id, field2);
+}
+void store_ds_constructor_binlog_message_delete (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->lid, field1);
+}
+void store_ds_constructor_binlog_message_new (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *var0 = INT2PTR (*D->flags);
+ out_int (PTR2INT (var0));
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->lid, field2);
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->from_id, field3);
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->to_type, field4);
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->to_id, field5);
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->fwd_from_id, field6);
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->fwd_date, field7);
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field8);
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->message, field9);
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_message_media (D->media, field10);
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x383415fa, .id = "MessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_message_action (D->action, field11);
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->reply_id, field12);
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x612ca4a9, .id = "ReplyMarkup", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_reply_markup (D->reply_markup, field13);
+ }
+}
+void store_ds_constructor_binlog_message_encr_new (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *var0 = INT2PTR (*D->flags);
+ out_int (PTR2INT (var0));
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->lid, field2);
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->from_id, field3);
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->to_type, field4);
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->to_id, field5);
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field6);
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->message, field7);
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x34e0d674, .id = "DecryptedMessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_decrypted_message_media (D->encr_media, field8);
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4e0eefde, .id = "DecryptedMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_decrypted_message_action (D->encr_action, field9);
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x886fd032, .id = "EncryptedFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_encrypted_file (D->file, field10);
+ }
+}
+void store_ds_constructor_binlog_msg_update (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_long (D->lid, field1);
+}
+void store_ds_constructor_binlog_reset_authorization (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return; }
+}
+void store_ds_constructor_contacts_blocked (struct tl_ds_contacts_blocked *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8c1b8fb4 && T->type->name != 0x73e4704b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x561bc879, .id = "ContactBlocked", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->blocked, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->users, field2);
+}
+void store_ds_constructor_contacts_blocked_slice (struct tl_ds_contacts_blocked *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8c1b8fb4 && T->type->name != 0x73e4704b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->count, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x561bc879, .id = "ContactBlocked", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->blocked, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->users, field3);
+}
+void store_ds_constructor_contacts_contacts_not_modified (struct tl_ds_contacts_contacts *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd8c02560 && T->type->name != 0x273fda9f)) { return; }
+}
+void store_ds_constructor_contacts_contacts (struct tl_ds_contacts_contacts *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd8c02560 && T->type->name != 0x273fda9f)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf911c994, .id = "Contact", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->contacts, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->users, field2);
+}
+void store_ds_constructor_contacts_found (struct tl_ds_contacts_found *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0566000e && T->type->name != 0xfa99fff1)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xea879f95, .id = "ContactFound", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->results, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->users, field2);
+}
+void store_ds_constructor_contacts_imported_contacts (struct tl_ds_contacts_imported_contacts *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xad524315 && T->type->name != 0x52adbcea)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xd0028438, .id = "ImportedContact", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->imported, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->retry_contacts, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->users, field3);
+}
+void store_ds_constructor_contacts_link (struct tl_ds_contacts_link *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3ace484c && T->type->name != 0xc531b7b3)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_contact_link (D->my_link, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_contact_link (D->foreign_link, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_user (D->user, field3);
+}
+void store_ds_constructor_contacts_suggested (struct tl_ds_contacts_suggested *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5649dcc5 && T->type->name != 0xa9b6233a)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3de191a1, .id = "ContactSuggested", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->results, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->users, field2);
+}
+void store_ds_constructor_geochats_located (struct tl_ds_geochats_located *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x48feb267 && T->type->name != 0xb7014d98)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3631cf4c, .id = "ChatLocated", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->results, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->messages, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->chats, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->users, field4);
+}
+void store_ds_constructor_geochats_messages (struct tl_ds_geochats_messages *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6d0a0e59 && T->type->name != 0x92f5f1a6)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->messages, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->chats, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->users, field3);
+}
+void store_ds_constructor_geochats_messages_slice (struct tl_ds_geochats_messages *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6d0a0e59 && T->type->name != 0x92f5f1a6)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->count, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->messages, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->chats, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->users, field4);
+}
+void store_ds_constructor_geochats_stated_message (struct tl_ds_geochats_stated_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17b1578b && T->type->name != 0xe84ea874)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_geo_chat_message (D->message, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->chats, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->users, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->seq, field4);
+}
+void store_ds_constructor_help_app_update (struct tl_ds_help_app_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4ddd9627 && T->type->name != 0xb22269d8)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bool (D->critical, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->url, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->text, field4);
+}
+void store_ds_constructor_help_no_app_update (struct tl_ds_help_app_update *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4ddd9627 && T->type->name != 0xb22269d8)) { return; }
+}
+void store_ds_constructor_help_invite_text (struct tl_ds_help_invite_text *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x18cb9f78 && T->type->name != 0xe7346087)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->message, field1);
+}
+void store_ds_constructor_help_support (struct tl_ds_help_support *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17c6b5f6 && T->type->name != 0xe8394a09)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->phone_number, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_user (D->user, field2);
+}
+void store_ds_constructor_messages_affected_history (struct tl_ds_messages_affected_history *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb45c69d1 && T->type->name != 0x4ba3962e)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->pts, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->pts_count, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->offset, field3);
+}
+void store_ds_constructor_messages_affected_messages (struct tl_ds_messages_affected_messages *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x84d19185 && T->type->name != 0x7b2e6e7a)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->pts, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->pts_count, field2);
+}
+void store_ds_constructor_messages_all_stickers_not_modified (struct tl_ds_messages_all_stickers *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb485502f && T->type->name != 0x4b7aafd0)) { return; }
+}
+void store_ds_constructor_messages_all_stickers (struct tl_ds_messages_all_stickers *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb485502f && T->type->name != 0x4b7aafd0)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->hash, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x12b299d4, .id = "StickerPack", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->packs, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa7a43b17, .id = "StickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->sets, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->documents, field4);
+}
+void store_ds_constructor_messages_chat_full (struct tl_ds_messages_chat_full *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe5d7d19c && T->type->name != 0x1a282e63)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02a614, .id = "ChatFull", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_chat_full (D->full_chat, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->chats, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->users, field3);
+}
+void store_ds_constructor_messages_chats (struct tl_ds_messages_chats *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x64ff9fd5 && T->type->name != 0x9b00602a)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->chats, field1);
+}
+void store_ds_constructor_messages_dh_config_not_modified (struct tl_ds_messages_dh_config *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xecc058e8 && T->type->name != 0x133fa717)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->random, field1);
+}
+void store_ds_constructor_messages_dh_config (struct tl_ds_messages_dh_config *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xecc058e8 && T->type->name != 0x133fa717)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->g, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->p, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->version, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->random, field4);
+}
+void store_ds_constructor_messages_dialogs (struct tl_ds_messages_dialogs *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x645af8b3 && T->type->name != 0x9ba5074c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc1dd804a, .id = "Dialog", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->dialogs, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->messages, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->chats, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->users, field4);
+}
+void store_ds_constructor_messages_dialogs_slice (struct tl_ds_messages_dialogs *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x645af8b3 && T->type->name != 0x9ba5074c)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->count, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc1dd804a, .id = "Dialog", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->dialogs, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->messages, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->chats, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->users, field5);
+}
+void store_ds_constructor_messages_message_empty (struct tl_ds_messages_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3f4e0648 && T->type->name != 0xc0b1f9b7)) { return; }
+}
+void store_ds_constructor_messages_messages (struct tl_ds_messages_messages *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8735e464 && T->type->name != 0x78ca1b9b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->messages, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->chats, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->users, field3);
+}
+void store_ds_constructor_messages_messages_slice (struct tl_ds_messages_messages *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8735e464 && T->type->name != 0x78ca1b9b)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->count, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->messages, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->chats, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->users, field4);
+}
+void store_ds_constructor_messages_sent_encrypted_message (struct tl_ds_messages_sent_encrypted_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc29c7607 && T->type->name != 0x3d6389f8)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field1);
+}
+void store_ds_constructor_messages_sent_encrypted_file (struct tl_ds_messages_sent_encrypted_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc29c7607 && T->type->name != 0x3d6389f8)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x886fd032, .id = "EncryptedFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_encrypted_file (D->file, field2);
+}
+void store_ds_constructor_messages_sent_message (struct tl_ds_messages_sent_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x799ce190 && T->type->name != 0x86631e6f)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_message_media (D->media, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->pts, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->pts_count, field5);
+}
+void store_ds_constructor_messages_sent_message_link (struct tl_ds_messages_sent_message *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x799ce190 && T->type->name != 0x86631e6f)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->id, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_message_media (D->media, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->pts, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->pts_count, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3ace484c, .id = "contacts.Link", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->links, field6);
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->seq, field7);
+}
+void store_ds_constructor_messages_sticker_set (struct tl_ds_messages_sticker_set *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb60a24a6 && T->type->name != 0x49f5db59)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa7a43b17, .id = "StickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_sticker_set (D->set, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x12b299d4, .id = "StickerPack", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->packs, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->documents, field3);
+}
+void store_ds_constructor_messages_stickers_not_modified (struct tl_ds_messages_stickers *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bfa5710 && T->type->name != 0x8405a8ef)) { return; }
+}
+void store_ds_constructor_messages_stickers (struct tl_ds_messages_stickers *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bfa5710 && T->type->name != 0x8405a8ef)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_string (D->hash, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->stickers, field2);
+}
+void store_ds_constructor_photos_photo (struct tl_ds_photos_photo *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x20212ca8 && T->type->name != 0xdfded357)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_photo (D->photo, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->users, field2);
+}
+void store_ds_constructor_photos_photos (struct tl_ds_photos_photos *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x98cf75f1 && T->type->name != 0x67308a0e)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->photos, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->users, field2);
+}
+void store_ds_constructor_photos_photos_slice (struct tl_ds_photos_photos *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x98cf75f1 && T->type->name != 0x67308a0e)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->count, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->photos, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->users, field3);
+}
+void store_ds_constructor_storage_file_unknown (struct tl_ds_storage_file_type *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return; }
+}
+void store_ds_constructor_storage_file_jpeg (struct tl_ds_storage_file_type *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return; }
+}
+void store_ds_constructor_storage_file_gif (struct tl_ds_storage_file_type *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return; }
+}
+void store_ds_constructor_storage_file_png (struct tl_ds_storage_file_type *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return; }
+}
+void store_ds_constructor_storage_file_pdf (struct tl_ds_storage_file_type *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return; }
+}
+void store_ds_constructor_storage_file_mp3 (struct tl_ds_storage_file_type *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return; }
+}
+void store_ds_constructor_storage_file_mov (struct tl_ds_storage_file_type *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return; }
+}
+void store_ds_constructor_storage_file_partial (struct tl_ds_storage_file_type *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return; }
+}
+void store_ds_constructor_storage_file_mp4 (struct tl_ds_storage_file_type *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return; }
+}
+void store_ds_constructor_storage_file_webp (struct tl_ds_storage_file_type *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return; }
+}
+void store_ds_constructor_updates_difference_empty (struct tl_ds_updates_difference *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf57a2419 && T->type->name != 0x0a85dbe6)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->seq, field2);
+}
+void store_ds_constructor_updates_difference (struct tl_ds_updates_difference *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf57a2419 && T->type->name != 0x0a85dbe6)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->new_messages, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xce6b8a1e, .id = "EncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->new_encrypted_messages, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->other_updates, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->chats, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->users, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa56c2a3e, .id = "updates.State", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_updates_state (D->state, field6);
+}
+void store_ds_constructor_updates_difference_slice (struct tl_ds_updates_difference *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf57a2419 && T->type->name != 0x0a85dbe6)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->new_messages, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xce6b8a1e, .id = "EncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->new_encrypted_messages, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->other_updates, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->chats, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ store_ds_type_vector ((void *)D->users, field5);
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa56c2a3e, .id = "updates.State", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_updates_state (D->intermediate_state, field6);
+}
+void store_ds_constructor_updates_state (struct tl_ds_updates_state *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa56c2a3e && T->type->name != 0x5a93d5c1)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->pts, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->qts, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->date, field3);
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->seq, field4);
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->unread_count, field5);
+}
+void store_ds_constructor_upload_file (struct tl_ds_upload_file *D, struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x096a18d5 && T->type->name != 0xf695e72a)) { return; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3e2838a8, .id = "storage.FileType", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_storage_file_type (D->type, field1);
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_int (D->mtime, field2);
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ store_ds_type_bare_bytes (D->bytes, field3);
+}
+void store_ds_type_account_days_t_t_l (struct tl_ds_account_days_t_t_l *D, struct paramed_type *T) {
+ out_int (0xb8d0afdf);
+ store_ds_constructor_account_days_t_t_l (D, T); return;
+}
+void store_ds_type_bare_account_days_t_t_l (struct tl_ds_account_days_t_t_l *D, struct paramed_type *T) {
+ store_ds_constructor_account_days_t_t_l (D, T); return;
+}
+void store_ds_type_audio (struct tl_ds_audio *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x586988d8: store_ds_constructor_audio_empty (D, T); return;
+ case 0xc7ac6496: store_ds_constructor_audio (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_audio (struct tl_ds_audio *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x586988d8: store_ds_constructor_audio_empty (D, T); return;
+ case 0xc7ac6496: store_ds_constructor_audio (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_authorization (struct tl_ds_authorization *D, struct paramed_type *T) {
+ out_int (0x7bf2e6f6);
+ store_ds_constructor_authorization (D, T); return;
+}
+void store_ds_type_bare_authorization (struct tl_ds_authorization *D, struct paramed_type *T) {
+ store_ds_constructor_authorization (D, T); return;
+}
+void store_ds_type_bool (struct tl_ds_bool *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xbc799737: store_ds_constructor_bool_false (D, T); return;
+ case 0x997275b5: store_ds_constructor_bool_true (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_bool (struct tl_ds_bool *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xbc799737: store_ds_constructor_bool_false (D, T); return;
+ case 0x997275b5: store_ds_constructor_bool_true (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bot_command (struct tl_ds_bot_command *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xc27ac8c7: store_ds_constructor_bot_command (D, T); return;
+ case 0xb79d22ab: store_ds_constructor_bot_command_old (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_bot_command (struct tl_ds_bot_command *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xc27ac8c7: store_ds_constructor_bot_command (D, T); return;
+ case 0xb79d22ab: store_ds_constructor_bot_command_old (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bot_info (struct tl_ds_bot_info *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xbb2e37ce: store_ds_constructor_bot_info_empty (D, T); return;
+ case 0x09cf585d: store_ds_constructor_bot_info (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_bot_info (struct tl_ds_bot_info *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xbb2e37ce: store_ds_constructor_bot_info_empty (D, T); return;
+ case 0x09cf585d: store_ds_constructor_bot_info (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bytes (struct tl_ds_string *D, struct paramed_type *T) {
+ out_int (0x0ee1379f);
+ store_ds_constructor_bytes (D, T); return;
+}
+void store_ds_type_bare_bytes (struct tl_ds_string *D, struct paramed_type *T) {
+ store_ds_constructor_bytes (D, T); return;
+}
+void store_ds_type_chat (struct tl_ds_chat *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x9ba2d800: store_ds_constructor_chat_empty (D, T); return;
+ case 0x6e9c9bc7: store_ds_constructor_chat (D, T); return;
+ case 0xfb0ccc41: store_ds_constructor_chat_forbidden (D, T); return;
+ case 0x75eaea5a: store_ds_constructor_geo_chat (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_chat (struct tl_ds_chat *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x9ba2d800: store_ds_constructor_chat_empty (D, T); return;
+ case 0x6e9c9bc7: store_ds_constructor_chat (D, T); return;
+ case 0xfb0ccc41: store_ds_constructor_chat_forbidden (D, T); return;
+ case 0x75eaea5a: store_ds_constructor_geo_chat (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_chat_full (struct tl_ds_chat_full *D, struct paramed_type *T) {
+ out_int (0x2e02a614);
+ store_ds_constructor_chat_full (D, T); return;
+}
+void store_ds_type_bare_chat_full (struct tl_ds_chat_full *D, struct paramed_type *T) {
+ store_ds_constructor_chat_full (D, T); return;
+}
+void store_ds_type_chat_invite (struct tl_ds_chat_invite *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x5a686d7c: store_ds_constructor_chat_invite_already (D, T); return;
+ case 0xce917dcd: store_ds_constructor_chat_invite (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_chat_invite (struct tl_ds_chat_invite *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x5a686d7c: store_ds_constructor_chat_invite_already (D, T); return;
+ case 0xce917dcd: store_ds_constructor_chat_invite (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_chat_located (struct tl_ds_chat_located *D, struct paramed_type *T) {
+ out_int (0x3631cf4c);
+ store_ds_constructor_chat_located (D, T); return;
+}
+void store_ds_type_bare_chat_located (struct tl_ds_chat_located *D, struct paramed_type *T) {
+ store_ds_constructor_chat_located (D, T); return;
+}
+void store_ds_type_chat_participant (struct tl_ds_chat_participant *D, struct paramed_type *T) {
+ out_int (0xc8d7493e);
+ store_ds_constructor_chat_participant (D, T); return;
+}
+void store_ds_type_bare_chat_participant (struct tl_ds_chat_participant *D, struct paramed_type *T) {
+ store_ds_constructor_chat_participant (D, T); return;
+}
+void store_ds_type_chat_participants (struct tl_ds_chat_participants *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x0fd2bb8a: store_ds_constructor_chat_participants_forbidden (D, T); return;
+ case 0x7841b415: store_ds_constructor_chat_participants (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_chat_participants (struct tl_ds_chat_participants *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x0fd2bb8a: store_ds_constructor_chat_participants_forbidden (D, T); return;
+ case 0x7841b415: store_ds_constructor_chat_participants (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_chat_photo (struct tl_ds_chat_photo *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x37c1011c: store_ds_constructor_chat_photo_empty (D, T); return;
+ case 0x6153276a: store_ds_constructor_chat_photo (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_chat_photo (struct tl_ds_chat_photo *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x37c1011c: store_ds_constructor_chat_photo_empty (D, T); return;
+ case 0x6153276a: store_ds_constructor_chat_photo (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_client_d_h_inner_data (struct tl_ds_client_d_h_inner_data *D, struct paramed_type *T) {
+ out_int (0x6643b654);
+ store_ds_constructor_client_d_h_inner_data (D, T); return;
+}
+void store_ds_type_bare_client_d_h_inner_data (struct tl_ds_client_d_h_inner_data *D, struct paramed_type *T) {
+ store_ds_constructor_client_d_h_inner_data (D, T); return;
+}
+void store_ds_type_config (struct tl_ds_config *D, struct paramed_type *T) {
+ out_int (0x4e32b894);
+ store_ds_constructor_config (D, T); return;
+}
+void store_ds_type_bare_config (struct tl_ds_config *D, struct paramed_type *T) {
+ store_ds_constructor_config (D, T); return;
+}
+void store_ds_type_contact (struct tl_ds_contact *D, struct paramed_type *T) {
+ out_int (0xf911c994);
+ store_ds_constructor_contact (D, T); return;
+}
+void store_ds_type_bare_contact (struct tl_ds_contact *D, struct paramed_type *T) {
+ store_ds_constructor_contact (D, T); return;
+}
+void store_ds_type_contact_blocked (struct tl_ds_contact_blocked *D, struct paramed_type *T) {
+ out_int (0x561bc879);
+ store_ds_constructor_contact_blocked (D, T); return;
+}
+void store_ds_type_bare_contact_blocked (struct tl_ds_contact_blocked *D, struct paramed_type *T) {
+ store_ds_constructor_contact_blocked (D, T); return;
+}
+void store_ds_type_contact_found (struct tl_ds_contact_found *D, struct paramed_type *T) {
+ out_int (0xea879f95);
+ store_ds_constructor_contact_found (D, T); return;
+}
+void store_ds_type_bare_contact_found (struct tl_ds_contact_found *D, struct paramed_type *T) {
+ store_ds_constructor_contact_found (D, T); return;
+}
+void store_ds_type_contact_link (struct tl_ds_contact_link *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x5f4f9247: store_ds_constructor_contact_link_unknown (D, T); return;
+ case 0xfeedd3ad: store_ds_constructor_contact_link_none (D, T); return;
+ case 0x268f3f59: store_ds_constructor_contact_link_has_phone (D, T); return;
+ case 0xd502c2d0: store_ds_constructor_contact_link_contact (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_contact_link (struct tl_ds_contact_link *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x5f4f9247: store_ds_constructor_contact_link_unknown (D, T); return;
+ case 0xfeedd3ad: store_ds_constructor_contact_link_none (D, T); return;
+ case 0x268f3f59: store_ds_constructor_contact_link_has_phone (D, T); return;
+ case 0xd502c2d0: store_ds_constructor_contact_link_contact (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_contact_status (struct tl_ds_contact_status *D, struct paramed_type *T) {
+ out_int (0xd3680c61);
+ store_ds_constructor_contact_status (D, T); return;
+}
+void store_ds_type_bare_contact_status (struct tl_ds_contact_status *D, struct paramed_type *T) {
+ store_ds_constructor_contact_status (D, T); return;
+}
+void store_ds_type_contact_suggested (struct tl_ds_contact_suggested *D, struct paramed_type *T) {
+ out_int (0x3de191a1);
+ store_ds_constructor_contact_suggested (D, T); return;
+}
+void store_ds_type_bare_contact_suggested (struct tl_ds_contact_suggested *D, struct paramed_type *T) {
+ store_ds_constructor_contact_suggested (D, T); return;
+}
+void store_ds_type_dc_option (struct tl_ds_dc_option *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x2ec2a43c: store_ds_constructor_dc_option_l28 (D, T); return;
+ case 0x05d8c6cc: store_ds_constructor_dc_option (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_dc_option (struct tl_ds_dc_option *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x2ec2a43c: store_ds_constructor_dc_option_l28 (D, T); return;
+ case 0x05d8c6cc: store_ds_constructor_dc_option (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_decrypted_message (struct tl_ds_decrypted_message *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x204d3878: store_ds_constructor_decrypted_message (D, T); return;
+ case 0x73164160: store_ds_constructor_decrypted_message_service (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_decrypted_message (struct tl_ds_decrypted_message *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x204d3878: store_ds_constructor_decrypted_message (D, T); return;
+ case 0x73164160: store_ds_constructor_decrypted_message_service (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_decrypted_message_action (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xa1733aec: store_ds_constructor_decrypted_message_action_set_message_t_t_l (D, T); return;
+ case 0x0c4f40be: store_ds_constructor_decrypted_message_action_read_messages (D, T); return;
+ case 0x65614304: store_ds_constructor_decrypted_message_action_delete_messages (D, T); return;
+ case 0x8ac1f475: store_ds_constructor_decrypted_message_action_screenshot_messages (D, T); return;
+ case 0x6719e45c: store_ds_constructor_decrypted_message_action_flush_history (D, T); return;
+ case 0x511110b0: store_ds_constructor_decrypted_message_action_resend (D, T); return;
+ case 0xf3048883: store_ds_constructor_decrypted_message_action_notify_layer (D, T); return;
+ case 0xccb27641: store_ds_constructor_decrypted_message_action_typing (D, T); return;
+ case 0xf3c9611b: store_ds_constructor_decrypted_message_action_request_key (D, T); return;
+ case 0x6fe1735b: store_ds_constructor_decrypted_message_action_accept_key (D, T); return;
+ case 0xdd05ec6b: store_ds_constructor_decrypted_message_action_abort_key (D, T); return;
+ case 0xec2e0b9b: store_ds_constructor_decrypted_message_action_commit_key (D, T); return;
+ case 0xa82fdd63: store_ds_constructor_decrypted_message_action_noop (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_decrypted_message_action (struct tl_ds_decrypted_message_action *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xa1733aec: store_ds_constructor_decrypted_message_action_set_message_t_t_l (D, T); return;
+ case 0x0c4f40be: store_ds_constructor_decrypted_message_action_read_messages (D, T); return;
+ case 0x65614304: store_ds_constructor_decrypted_message_action_delete_messages (D, T); return;
+ case 0x8ac1f475: store_ds_constructor_decrypted_message_action_screenshot_messages (D, T); return;
+ case 0x6719e45c: store_ds_constructor_decrypted_message_action_flush_history (D, T); return;
+ case 0x511110b0: store_ds_constructor_decrypted_message_action_resend (D, T); return;
+ case 0xf3048883: store_ds_constructor_decrypted_message_action_notify_layer (D, T); return;
+ case 0xccb27641: store_ds_constructor_decrypted_message_action_typing (D, T); return;
+ case 0xf3c9611b: store_ds_constructor_decrypted_message_action_request_key (D, T); return;
+ case 0x6fe1735b: store_ds_constructor_decrypted_message_action_accept_key (D, T); return;
+ case 0xdd05ec6b: store_ds_constructor_decrypted_message_action_abort_key (D, T); return;
+ case 0xec2e0b9b: store_ds_constructor_decrypted_message_action_commit_key (D, T); return;
+ case 0xa82fdd63: store_ds_constructor_decrypted_message_action_noop (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_decrypted_message_layer (struct tl_ds_decrypted_message_layer *D, struct paramed_type *T) {
+ out_int (0x1be31789);
+ store_ds_constructor_decrypted_message_layer (D, T); return;
+}
+void store_ds_type_bare_decrypted_message_layer (struct tl_ds_decrypted_message_layer *D, struct paramed_type *T) {
+ store_ds_constructor_decrypted_message_layer (D, T); return;
+}
+void store_ds_type_decrypted_message_media (struct tl_ds_decrypted_message_media *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x089f5c4a: store_ds_constructor_decrypted_message_media_empty (D, T); return;
+ case 0x32798a8c: store_ds_constructor_decrypted_message_media_photo (D, T); return;
+ case 0x35480a59: store_ds_constructor_decrypted_message_media_geo_point (D, T); return;
+ case 0x588a0a97: store_ds_constructor_decrypted_message_media_contact (D, T); return;
+ case 0xb095434b: store_ds_constructor_decrypted_message_media_document (D, T); return;
+ case 0x524a415d: store_ds_constructor_decrypted_message_media_video (D, T); return;
+ case 0x57e0a9cb: store_ds_constructor_decrypted_message_media_audio (D, T); return;
+ case 0xfa95b0dd: store_ds_constructor_decrypted_message_media_external_document (D, T); return;
+ case 0x4cee6ef3: store_ds_constructor_decrypted_message_media_video_l12 (D, T); return;
+ case 0x6080758f: store_ds_constructor_decrypted_message_media_audio_l12 (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_decrypted_message_media (struct tl_ds_decrypted_message_media *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x089f5c4a: store_ds_constructor_decrypted_message_media_empty (D, T); return;
+ case 0x32798a8c: store_ds_constructor_decrypted_message_media_photo (D, T); return;
+ case 0x35480a59: store_ds_constructor_decrypted_message_media_geo_point (D, T); return;
+ case 0x588a0a97: store_ds_constructor_decrypted_message_media_contact (D, T); return;
+ case 0xb095434b: store_ds_constructor_decrypted_message_media_document (D, T); return;
+ case 0x524a415d: store_ds_constructor_decrypted_message_media_video (D, T); return;
+ case 0x57e0a9cb: store_ds_constructor_decrypted_message_media_audio (D, T); return;
+ case 0xfa95b0dd: store_ds_constructor_decrypted_message_media_external_document (D, T); return;
+ case 0x4cee6ef3: store_ds_constructor_decrypted_message_media_video_l12 (D, T); return;
+ case 0x6080758f: store_ds_constructor_decrypted_message_media_audio_l12 (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_dialog (struct tl_ds_dialog *D, struct paramed_type *T) {
+ out_int (0xc1dd804a);
+ store_ds_constructor_dialog (D, T); return;
+}
+void store_ds_type_bare_dialog (struct tl_ds_dialog *D, struct paramed_type *T) {
+ store_ds_constructor_dialog (D, T); return;
+}
+void store_ds_type_disabled_feature (struct tl_ds_disabled_feature *D, struct paramed_type *T) {
+ out_int (0xae636f24);
+ store_ds_constructor_disabled_feature (D, T); return;
+}
+void store_ds_type_bare_disabled_feature (struct tl_ds_disabled_feature *D, struct paramed_type *T) {
+ store_ds_constructor_disabled_feature (D, T); return;
+}
+void store_ds_type_document (struct tl_ds_document *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x36f8c871: store_ds_constructor_document_empty (D, T); return;
+ case 0xf9a39f4f: store_ds_constructor_document (D, T); return;
+ case 0x9efc6326: store_ds_constructor_document_l19 (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_document (struct tl_ds_document *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x36f8c871: store_ds_constructor_document_empty (D, T); return;
+ case 0xf9a39f4f: store_ds_constructor_document (D, T); return;
+ case 0x9efc6326: store_ds_constructor_document_l19 (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_document_attribute (struct tl_ds_document_attribute *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x6c37c15c: store_ds_constructor_document_attribute_image_size (D, T); return;
+ case 0x11b58939: store_ds_constructor_document_attribute_animated (D, T); return;
+ case 0x994c9882: store_ds_constructor_document_attribute_sticker_l28 (D, T); return;
+ case 0x3a556302: store_ds_constructor_document_attribute_sticker (D, T); return;
+ case 0x5910cccb: store_ds_constructor_document_attribute_video (D, T); return;
+ case 0x051448e5: store_ds_constructor_document_attribute_audio (D, T); return;
+ case 0x15590068: store_ds_constructor_document_attribute_filename (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_document_attribute (struct tl_ds_document_attribute *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x6c37c15c: store_ds_constructor_document_attribute_image_size (D, T); return;
+ case 0x11b58939: store_ds_constructor_document_attribute_animated (D, T); return;
+ case 0x994c9882: store_ds_constructor_document_attribute_sticker_l28 (D, T); return;
+ case 0x3a556302: store_ds_constructor_document_attribute_sticker (D, T); return;
+ case 0x5910cccb: store_ds_constructor_document_attribute_video (D, T); return;
+ case 0x051448e5: store_ds_constructor_document_attribute_audio (D, T); return;
+ case 0x15590068: store_ds_constructor_document_attribute_filename (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_double (double *D, struct paramed_type *T) {
+ out_int (0x2210c154);
+ store_ds_constructor_double (D, T); return;
+}
+void store_ds_type_bare_double (double *D, struct paramed_type *T) {
+ store_ds_constructor_double (D, T); return;
+}
+void store_ds_type_encrypted_chat (struct tl_ds_encrypted_chat *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xab7ec0a0: store_ds_constructor_encrypted_chat_empty (D, T); return;
+ case 0x3bf703dc: store_ds_constructor_encrypted_chat_waiting (D, T); return;
+ case 0xc878527e: store_ds_constructor_encrypted_chat_requested (D, T); return;
+ case 0xfa56ce36: store_ds_constructor_encrypted_chat (D, T); return;
+ case 0x13d6dd27: store_ds_constructor_encrypted_chat_discarded (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_encrypted_chat (struct tl_ds_encrypted_chat *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xab7ec0a0: store_ds_constructor_encrypted_chat_empty (D, T); return;
+ case 0x3bf703dc: store_ds_constructor_encrypted_chat_waiting (D, T); return;
+ case 0xc878527e: store_ds_constructor_encrypted_chat_requested (D, T); return;
+ case 0xfa56ce36: store_ds_constructor_encrypted_chat (D, T); return;
+ case 0x13d6dd27: store_ds_constructor_encrypted_chat_discarded (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_encrypted_file (struct tl_ds_encrypted_file *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xc21f497e: store_ds_constructor_encrypted_file_empty (D, T); return;
+ case 0x4a70994c: store_ds_constructor_encrypted_file (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_encrypted_file (struct tl_ds_encrypted_file *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xc21f497e: store_ds_constructor_encrypted_file_empty (D, T); return;
+ case 0x4a70994c: store_ds_constructor_encrypted_file (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_encrypted_message (struct tl_ds_encrypted_message *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xed18c118: store_ds_constructor_encrypted_message (D, T); return;
+ case 0x23734b06: store_ds_constructor_encrypted_message_service (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_encrypted_message (struct tl_ds_encrypted_message *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xed18c118: store_ds_constructor_encrypted_message (D, T); return;
+ case 0x23734b06: store_ds_constructor_encrypted_message_service (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_error (struct tl_ds_error *D, struct paramed_type *T) {
+ out_int (0xc4b9f9bb);
+ store_ds_constructor_error (D, T); return;
+}
+void store_ds_type_bare_error (struct tl_ds_error *D, struct paramed_type *T) {
+ store_ds_constructor_error (D, T); return;
+}
+void store_ds_type_exported_chat_invite (struct tl_ds_exported_chat_invite *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x69df3769: store_ds_constructor_chat_invite_empty (D, T); return;
+ case 0xfc2e05bc: store_ds_constructor_chat_invite_exported (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_exported_chat_invite (struct tl_ds_exported_chat_invite *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x69df3769: store_ds_constructor_chat_invite_empty (D, T); return;
+ case 0xfc2e05bc: store_ds_constructor_chat_invite_exported (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_file_location (struct tl_ds_file_location *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x7c596b46: store_ds_constructor_file_location_unavailable (D, T); return;
+ case 0x53d69076: store_ds_constructor_file_location (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_file_location (struct tl_ds_file_location *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x7c596b46: store_ds_constructor_file_location_unavailable (D, T); return;
+ case 0x53d69076: store_ds_constructor_file_location (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_geo_chat_message (struct tl_ds_geo_chat_message *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x60311a9b: store_ds_constructor_geo_chat_message_empty (D, T); return;
+ case 0x4505f8e1: store_ds_constructor_geo_chat_message (D, T); return;
+ case 0xd34fa24e: store_ds_constructor_geo_chat_message_service (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_geo_chat_message (struct tl_ds_geo_chat_message *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x60311a9b: store_ds_constructor_geo_chat_message_empty (D, T); return;
+ case 0x4505f8e1: store_ds_constructor_geo_chat_message (D, T); return;
+ case 0xd34fa24e: store_ds_constructor_geo_chat_message_service (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_geo_point (struct tl_ds_geo_point *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x1117dd5f: store_ds_constructor_geo_point_empty (D, T); return;
+ case 0x2049d70c: store_ds_constructor_geo_point (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_geo_point (struct tl_ds_geo_point *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x1117dd5f: store_ds_constructor_geo_point_empty (D, T); return;
+ case 0x2049d70c: store_ds_constructor_geo_point (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_imported_contact (struct tl_ds_imported_contact *D, struct paramed_type *T) {
+ out_int (0xd0028438);
+ store_ds_constructor_imported_contact (D, T); return;
+}
+void store_ds_type_bare_imported_contact (struct tl_ds_imported_contact *D, struct paramed_type *T) {
+ store_ds_constructor_imported_contact (D, T); return;
+}
+void store_ds_type_input_app_event (struct tl_ds_input_app_event *D, struct paramed_type *T) {
+ out_int (0x770656a8);
+ store_ds_constructor_input_app_event (D, T); return;
+}
+void store_ds_type_bare_input_app_event (struct tl_ds_input_app_event *D, struct paramed_type *T) {
+ store_ds_constructor_input_app_event (D, T); return;
+}
+void store_ds_type_input_audio (struct tl_ds_input_audio *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xd95adc84: store_ds_constructor_input_audio_empty (D, T); return;
+ case 0x77d440ff: store_ds_constructor_input_audio (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_input_audio (struct tl_ds_input_audio *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xd95adc84: store_ds_constructor_input_audio_empty (D, T); return;
+ case 0x77d440ff: store_ds_constructor_input_audio (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_input_chat_photo (struct tl_ds_input_chat_photo *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x1ca48f57: store_ds_constructor_input_chat_photo_empty (D, T); return;
+ case 0x94254732: store_ds_constructor_input_chat_uploaded_photo (D, T); return;
+ case 0xb2e1bf08: store_ds_constructor_input_chat_photo (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_input_chat_photo (struct tl_ds_input_chat_photo *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x1ca48f57: store_ds_constructor_input_chat_photo_empty (D, T); return;
+ case 0x94254732: store_ds_constructor_input_chat_uploaded_photo (D, T); return;
+ case 0xb2e1bf08: store_ds_constructor_input_chat_photo (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_input_contact (struct tl_ds_input_contact *D, struct paramed_type *T) {
+ out_int (0xf392b7f4);
+ store_ds_constructor_input_phone_contact (D, T); return;
+}
+void store_ds_type_bare_input_contact (struct tl_ds_input_contact *D, struct paramed_type *T) {
+ store_ds_constructor_input_phone_contact (D, T); return;
+}
+void store_ds_type_input_document (struct tl_ds_input_document *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x72f0eaae: store_ds_constructor_input_document_empty (D, T); return;
+ case 0x18798952: store_ds_constructor_input_document (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_input_document (struct tl_ds_input_document *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x72f0eaae: store_ds_constructor_input_document_empty (D, T); return;
+ case 0x18798952: store_ds_constructor_input_document (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_input_encrypted_chat (struct tl_ds_input_encrypted_chat *D, struct paramed_type *T) {
+ out_int (0xf141b5e1);
+ store_ds_constructor_input_encrypted_chat (D, T); return;
+}
+void store_ds_type_bare_input_encrypted_chat (struct tl_ds_input_encrypted_chat *D, struct paramed_type *T) {
+ store_ds_constructor_input_encrypted_chat (D, T); return;
+}
+void store_ds_type_input_encrypted_file (struct tl_ds_input_encrypted_file *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x1837c364: store_ds_constructor_input_encrypted_file_empty (D, T); return;
+ case 0x64bd0306: store_ds_constructor_input_encrypted_file_uploaded (D, T); return;
+ case 0x5a17b5e5: store_ds_constructor_input_encrypted_file (D, T); return;
+ case 0x2dc173c8: store_ds_constructor_input_encrypted_file_big_uploaded (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_input_encrypted_file (struct tl_ds_input_encrypted_file *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x1837c364: store_ds_constructor_input_encrypted_file_empty (D, T); return;
+ case 0x64bd0306: store_ds_constructor_input_encrypted_file_uploaded (D, T); return;
+ case 0x5a17b5e5: store_ds_constructor_input_encrypted_file (D, T); return;
+ case 0x2dc173c8: store_ds_constructor_input_encrypted_file_big_uploaded (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_input_file (struct tl_ds_input_file *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xf52ff27f: store_ds_constructor_input_file (D, T); return;
+ case 0xfa4f0bb5: store_ds_constructor_input_file_big (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_input_file (struct tl_ds_input_file *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xf52ff27f: store_ds_constructor_input_file (D, T); return;
+ case 0xfa4f0bb5: store_ds_constructor_input_file_big (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_input_file_location (struct tl_ds_input_file_location *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x14637196: store_ds_constructor_input_file_location (D, T); return;
+ case 0x3d0364ec: store_ds_constructor_input_video_file_location (D, T); return;
+ case 0xf5235d55: store_ds_constructor_input_encrypted_file_location (D, T); return;
+ case 0x74dc404d: store_ds_constructor_input_audio_file_location (D, T); return;
+ case 0x4e45abe9: store_ds_constructor_input_document_file_location (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_input_file_location (struct tl_ds_input_file_location *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x14637196: store_ds_constructor_input_file_location (D, T); return;
+ case 0x3d0364ec: store_ds_constructor_input_video_file_location (D, T); return;
+ case 0xf5235d55: store_ds_constructor_input_encrypted_file_location (D, T); return;
+ case 0x74dc404d: store_ds_constructor_input_audio_file_location (D, T); return;
+ case 0x4e45abe9: store_ds_constructor_input_document_file_location (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_input_geo_chat (struct tl_ds_input_geo_chat *D, struct paramed_type *T) {
+ out_int (0x74d456fa);
+ store_ds_constructor_input_geo_chat (D, T); return;
+}
+void store_ds_type_bare_input_geo_chat (struct tl_ds_input_geo_chat *D, struct paramed_type *T) {
+ store_ds_constructor_input_geo_chat (D, T); return;
+}
+void store_ds_type_input_geo_point (struct tl_ds_input_geo_point *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xe4c123d6: store_ds_constructor_input_geo_point_empty (D, T); return;
+ case 0xf3b7acc9: store_ds_constructor_input_geo_point (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_input_geo_point (struct tl_ds_input_geo_point *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xe4c123d6: store_ds_constructor_input_geo_point_empty (D, T); return;
+ case 0xf3b7acc9: store_ds_constructor_input_geo_point (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_input_media (struct tl_ds_input_media *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x9664f57f: store_ds_constructor_input_media_empty (D, T); return;
+ case 0xf7aff1c0: store_ds_constructor_input_media_uploaded_photo (D, T); return;
+ case 0xe9bfb4f3: store_ds_constructor_input_media_photo (D, T); return;
+ case 0xf9c44144: store_ds_constructor_input_media_geo_point (D, T); return;
+ case 0xa6e45987: store_ds_constructor_input_media_contact (D, T); return;
+ case 0xe13fd4bc: store_ds_constructor_input_media_uploaded_video (D, T); return;
+ case 0x96fb97dc: store_ds_constructor_input_media_uploaded_thumb_video (D, T); return;
+ case 0x936a4ebd: store_ds_constructor_input_media_video (D, T); return;
+ case 0x4e498cab: store_ds_constructor_input_media_uploaded_audio (D, T); return;
+ case 0x89938781: store_ds_constructor_input_media_audio (D, T); return;
+ case 0xffe76b78: store_ds_constructor_input_media_uploaded_document (D, T); return;
+ case 0x41481486: store_ds_constructor_input_media_uploaded_thumb_document (D, T); return;
+ case 0xd184e841: store_ds_constructor_input_media_document (D, T); return;
+ case 0x2827a81a: store_ds_constructor_input_media_venue (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_input_media (struct tl_ds_input_media *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x9664f57f: store_ds_constructor_input_media_empty (D, T); return;
+ case 0xf7aff1c0: store_ds_constructor_input_media_uploaded_photo (D, T); return;
+ case 0xe9bfb4f3: store_ds_constructor_input_media_photo (D, T); return;
+ case 0xf9c44144: store_ds_constructor_input_media_geo_point (D, T); return;
+ case 0xa6e45987: store_ds_constructor_input_media_contact (D, T); return;
+ case 0xe13fd4bc: store_ds_constructor_input_media_uploaded_video (D, T); return;
+ case 0x96fb97dc: store_ds_constructor_input_media_uploaded_thumb_video (D, T); return;
+ case 0x936a4ebd: store_ds_constructor_input_media_video (D, T); return;
+ case 0x4e498cab: store_ds_constructor_input_media_uploaded_audio (D, T); return;
+ case 0x89938781: store_ds_constructor_input_media_audio (D, T); return;
+ case 0xffe76b78: store_ds_constructor_input_media_uploaded_document (D, T); return;
+ case 0x41481486: store_ds_constructor_input_media_uploaded_thumb_document (D, T); return;
+ case 0xd184e841: store_ds_constructor_input_media_document (D, T); return;
+ case 0x2827a81a: store_ds_constructor_input_media_venue (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_input_notify_peer (struct tl_ds_input_notify_peer *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xb8bc5b0c: store_ds_constructor_input_notify_peer (D, T); return;
+ case 0x193b4417: store_ds_constructor_input_notify_users (D, T); return;
+ case 0x4a95e84e: store_ds_constructor_input_notify_chats (D, T); return;
+ case 0xa429b886: store_ds_constructor_input_notify_all (D, T); return;
+ case 0x4d8ddec8: store_ds_constructor_input_notify_geo_chat_peer (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_input_notify_peer (struct tl_ds_input_notify_peer *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xb8bc5b0c: store_ds_constructor_input_notify_peer (D, T); return;
+ case 0x193b4417: store_ds_constructor_input_notify_users (D, T); return;
+ case 0x4a95e84e: store_ds_constructor_input_notify_chats (D, T); return;
+ case 0xa429b886: store_ds_constructor_input_notify_all (D, T); return;
+ case 0x4d8ddec8: store_ds_constructor_input_notify_geo_chat_peer (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_input_peer (struct tl_ds_input_peer *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x7f3b18ea: store_ds_constructor_input_peer_empty (D, T); return;
+ case 0x7da07ec9: store_ds_constructor_input_peer_self (D, T); return;
+ case 0x1023dbe8: store_ds_constructor_input_peer_contact (D, T); return;
+ case 0x9b447325: store_ds_constructor_input_peer_foreign (D, T); return;
+ case 0x179be863: store_ds_constructor_input_peer_chat (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_input_peer (struct tl_ds_input_peer *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x7f3b18ea: store_ds_constructor_input_peer_empty (D, T); return;
+ case 0x7da07ec9: store_ds_constructor_input_peer_self (D, T); return;
+ case 0x1023dbe8: store_ds_constructor_input_peer_contact (D, T); return;
+ case 0x9b447325: store_ds_constructor_input_peer_foreign (D, T); return;
+ case 0x179be863: store_ds_constructor_input_peer_chat (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_input_peer_notify_events (struct tl_ds_input_peer_notify_events *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xf03064d8: store_ds_constructor_input_peer_notify_events_empty (D, T); return;
+ case 0xe86a2c74: store_ds_constructor_input_peer_notify_events_all (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_input_peer_notify_events (struct tl_ds_input_peer_notify_events *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xf03064d8: store_ds_constructor_input_peer_notify_events_empty (D, T); return;
+ case 0xe86a2c74: store_ds_constructor_input_peer_notify_events_all (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_input_peer_notify_settings (struct tl_ds_input_peer_notify_settings *D, struct paramed_type *T) {
+ out_int (0x46a2ce98);
+ store_ds_constructor_input_peer_notify_settings (D, T); return;
+}
+void store_ds_type_bare_input_peer_notify_settings (struct tl_ds_input_peer_notify_settings *D, struct paramed_type *T) {
+ store_ds_constructor_input_peer_notify_settings (D, T); return;
+}
+void store_ds_type_input_photo (struct tl_ds_input_photo *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x1cd7bf0d: store_ds_constructor_input_photo_empty (D, T); return;
+ case 0xfb95c6c4: store_ds_constructor_input_photo (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_input_photo (struct tl_ds_input_photo *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x1cd7bf0d: store_ds_constructor_input_photo_empty (D, T); return;
+ case 0xfb95c6c4: store_ds_constructor_input_photo (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_input_photo_crop (struct tl_ds_input_photo_crop *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xade6b004: store_ds_constructor_input_photo_crop_auto (D, T); return;
+ case 0xd9915325: store_ds_constructor_input_photo_crop (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_input_photo_crop (struct tl_ds_input_photo_crop *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xade6b004: store_ds_constructor_input_photo_crop_auto (D, T); return;
+ case 0xd9915325: store_ds_constructor_input_photo_crop (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_input_privacy_key (struct tl_ds_input_privacy_key *D, struct paramed_type *T) {
+ out_int (0x4f96cb18);
+ store_ds_constructor_input_privacy_key_status_timestamp (D, T); return;
+}
+void store_ds_type_bare_input_privacy_key (struct tl_ds_input_privacy_key *D, struct paramed_type *T) {
+ store_ds_constructor_input_privacy_key_status_timestamp (D, T); return;
+}
+void store_ds_type_input_privacy_rule (struct tl_ds_input_privacy_rule *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x0d09e07b: store_ds_constructor_input_privacy_value_allow_contacts (D, T); return;
+ case 0x184b35ce: store_ds_constructor_input_privacy_value_allow_all (D, T); return;
+ case 0x131cc67f: store_ds_constructor_input_privacy_value_allow_users (D, T); return;
+ case 0x0ba52007: store_ds_constructor_input_privacy_value_disallow_contacts (D, T); return;
+ case 0xd66b66c9: store_ds_constructor_input_privacy_value_disallow_all (D, T); return;
+ case 0x90110467: store_ds_constructor_input_privacy_value_disallow_users (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_input_privacy_rule (struct tl_ds_input_privacy_rule *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x0d09e07b: store_ds_constructor_input_privacy_value_allow_contacts (D, T); return;
+ case 0x184b35ce: store_ds_constructor_input_privacy_value_allow_all (D, T); return;
+ case 0x131cc67f: store_ds_constructor_input_privacy_value_allow_users (D, T); return;
+ case 0x0ba52007: store_ds_constructor_input_privacy_value_disallow_contacts (D, T); return;
+ case 0xd66b66c9: store_ds_constructor_input_privacy_value_disallow_all (D, T); return;
+ case 0x90110467: store_ds_constructor_input_privacy_value_disallow_users (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_input_sticker_set (struct tl_ds_input_sticker_set *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xffb62b95: store_ds_constructor_input_sticker_set_empty (D, T); return;
+ case 0x9de7a269: store_ds_constructor_input_sticker_set_i_d (D, T); return;
+ case 0x861cc8a0: store_ds_constructor_input_sticker_set_short_name (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_input_sticker_set (struct tl_ds_input_sticker_set *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xffb62b95: store_ds_constructor_input_sticker_set_empty (D, T); return;
+ case 0x9de7a269: store_ds_constructor_input_sticker_set_i_d (D, T); return;
+ case 0x861cc8a0: store_ds_constructor_input_sticker_set_short_name (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_input_user (struct tl_ds_input_user *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xb98886cf: store_ds_constructor_input_user_empty (D, T); return;
+ case 0xf7c1b13f: store_ds_constructor_input_user_self (D, T); return;
+ case 0x86e94f65: store_ds_constructor_input_user_contact (D, T); return;
+ case 0x655e74ff: store_ds_constructor_input_user_foreign (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_input_user (struct tl_ds_input_user *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xb98886cf: store_ds_constructor_input_user_empty (D, T); return;
+ case 0xf7c1b13f: store_ds_constructor_input_user_self (D, T); return;
+ case 0x86e94f65: store_ds_constructor_input_user_contact (D, T); return;
+ case 0x655e74ff: store_ds_constructor_input_user_foreign (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_input_video (struct tl_ds_input_video *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x5508ec75: store_ds_constructor_input_video_empty (D, T); return;
+ case 0xee579652: store_ds_constructor_input_video (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_input_video (struct tl_ds_input_video *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x5508ec75: store_ds_constructor_input_video_empty (D, T); return;
+ case 0xee579652: store_ds_constructor_input_video (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_int (int *D, struct paramed_type *T) {
+ out_int (0xa8509bda);
+ store_ds_constructor_int (D, T); return;
+}
+void store_ds_type_bare_int (int *D, struct paramed_type *T) {
+ store_ds_constructor_int (D, T); return;
+}
+void store_ds_type_int128 (struct tl_ds_int128 *D, struct paramed_type *T) {
+ out_int (0x7d36c439);
+ store_ds_constructor_int128 (D, T); return;
+}
+void store_ds_type_bare_int128 (struct tl_ds_int128 *D, struct paramed_type *T) {
+ store_ds_constructor_int128 (D, T); return;
+}
+void store_ds_type_int256 (struct tl_ds_int256 *D, struct paramed_type *T) {
+ out_int (0xf2c798b3);
+ store_ds_constructor_int256 (D, T); return;
+}
+void store_ds_type_bare_int256 (struct tl_ds_int256 *D, struct paramed_type *T) {
+ store_ds_constructor_int256 (D, T); return;
+}
+void store_ds_type_keyboard_button (struct tl_ds_keyboard_button *D, struct paramed_type *T) {
+ out_int (0xa2fa4880);
+ store_ds_constructor_keyboard_button (D, T); return;
+}
+void store_ds_type_bare_keyboard_button (struct tl_ds_keyboard_button *D, struct paramed_type *T) {
+ store_ds_constructor_keyboard_button (D, T); return;
+}
+void store_ds_type_keyboard_button_row (struct tl_ds_keyboard_button_row *D, struct paramed_type *T) {
+ out_int (0x77608b83);
+ store_ds_constructor_keyboard_button_row (D, T); return;
+}
+void store_ds_type_bare_keyboard_button_row (struct tl_ds_keyboard_button_row *D, struct paramed_type *T) {
+ store_ds_constructor_keyboard_button_row (D, T); return;
+}
+void store_ds_type_long (long long *D, struct paramed_type *T) {
+ out_int (0x22076cba);
+ store_ds_constructor_long (D, T); return;
+}
+void store_ds_type_bare_long (long long *D, struct paramed_type *T) {
+ store_ds_constructor_long (D, T); return;
+}
+void store_ds_type_message (struct tl_ds_message *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x83e5de54: store_ds_constructor_message_empty (D, T); return;
+ case 0xc3060325: store_ds_constructor_message (D, T); return;
+ case 0x1d86f70e: store_ds_constructor_message_service (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_message (struct tl_ds_message *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x83e5de54: store_ds_constructor_message_empty (D, T); return;
+ case 0xc3060325: store_ds_constructor_message (D, T); return;
+ case 0x1d86f70e: store_ds_constructor_message_service (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_message_action (struct tl_ds_message_action *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xb6aef7b0: store_ds_constructor_message_action_empty (D, T); return;
+ case 0xa6638b9a: store_ds_constructor_message_action_chat_create (D, T); return;
+ case 0xb5a1ce5a: store_ds_constructor_message_action_chat_edit_title (D, T); return;
+ case 0x7fcb13a8: store_ds_constructor_message_action_chat_edit_photo (D, T); return;
+ case 0x95e3fbef: store_ds_constructor_message_action_chat_delete_photo (D, T); return;
+ case 0x5e3cfc4b: store_ds_constructor_message_action_chat_add_user (D, T); return;
+ case 0xb2ae9b0c: store_ds_constructor_message_action_chat_delete_user (D, T); return;
+ case 0x6f038ebc: store_ds_constructor_message_action_geo_chat_create (D, T); return;
+ case 0x0c7d53de: store_ds_constructor_message_action_geo_chat_checkin (D, T); return;
+ case 0xf89cf5e8: store_ds_constructor_message_action_chat_joined_by_link (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_message_action (struct tl_ds_message_action *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xb6aef7b0: store_ds_constructor_message_action_empty (D, T); return;
+ case 0xa6638b9a: store_ds_constructor_message_action_chat_create (D, T); return;
+ case 0xb5a1ce5a: store_ds_constructor_message_action_chat_edit_title (D, T); return;
+ case 0x7fcb13a8: store_ds_constructor_message_action_chat_edit_photo (D, T); return;
+ case 0x95e3fbef: store_ds_constructor_message_action_chat_delete_photo (D, T); return;
+ case 0x5e3cfc4b: store_ds_constructor_message_action_chat_add_user (D, T); return;
+ case 0xb2ae9b0c: store_ds_constructor_message_action_chat_delete_user (D, T); return;
+ case 0x6f038ebc: store_ds_constructor_message_action_geo_chat_create (D, T); return;
+ case 0x0c7d53de: store_ds_constructor_message_action_geo_chat_checkin (D, T); return;
+ case 0xf89cf5e8: store_ds_constructor_message_action_chat_joined_by_link (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_message_media (struct tl_ds_message_media *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x3ded6320: store_ds_constructor_message_media_empty (D, T); return;
+ case 0x3d8ce53d: store_ds_constructor_message_media_photo (D, T); return;
+ case 0x5bcf1675: store_ds_constructor_message_media_video (D, T); return;
+ case 0x56e0d474: store_ds_constructor_message_media_geo (D, T); return;
+ case 0x5e7d2f39: store_ds_constructor_message_media_contact (D, T); return;
+ case 0x9f84f49e: store_ds_constructor_message_media_unsupported (D, T); return;
+ case 0x2fda2204: store_ds_constructor_message_media_document (D, T); return;
+ case 0xc6b68300: store_ds_constructor_message_media_audio (D, T); return;
+ case 0xa32dd600: store_ds_constructor_message_media_web_page (D, T); return;
+ case 0x7912b71f: store_ds_constructor_message_media_venue (D, T); return;
+ case 0xc8c45a2a: store_ds_constructor_message_media_photo_l27 (D, T); return;
+ case 0xa2d24290: store_ds_constructor_message_media_video_l27 (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_message_media (struct tl_ds_message_media *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x3ded6320: store_ds_constructor_message_media_empty (D, T); return;
+ case 0x3d8ce53d: store_ds_constructor_message_media_photo (D, T); return;
+ case 0x5bcf1675: store_ds_constructor_message_media_video (D, T); return;
+ case 0x56e0d474: store_ds_constructor_message_media_geo (D, T); return;
+ case 0x5e7d2f39: store_ds_constructor_message_media_contact (D, T); return;
+ case 0x9f84f49e: store_ds_constructor_message_media_unsupported (D, T); return;
+ case 0x2fda2204: store_ds_constructor_message_media_document (D, T); return;
+ case 0xc6b68300: store_ds_constructor_message_media_audio (D, T); return;
+ case 0xa32dd600: store_ds_constructor_message_media_web_page (D, T); return;
+ case 0x7912b71f: store_ds_constructor_message_media_venue (D, T); return;
+ case 0xc8c45a2a: store_ds_constructor_message_media_photo_l27 (D, T); return;
+ case 0xa2d24290: store_ds_constructor_message_media_video_l27 (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_messages_filter (struct tl_ds_messages_filter *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x57e2f66c: store_ds_constructor_input_messages_filter_empty (D, T); return;
+ case 0x9609a51c: store_ds_constructor_input_messages_filter_photos (D, T); return;
+ case 0x9fc00e65: store_ds_constructor_input_messages_filter_video (D, T); return;
+ case 0x56e9f0e4: store_ds_constructor_input_messages_filter_photo_video (D, T); return;
+ case 0xd95e73bb: store_ds_constructor_input_messages_filter_photo_video_documents (D, T); return;
+ case 0x9eddf188: store_ds_constructor_input_messages_filter_document (D, T); return;
+ case 0xcfc87522: store_ds_constructor_input_messages_filter_audio (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_messages_filter (struct tl_ds_messages_filter *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x57e2f66c: store_ds_constructor_input_messages_filter_empty (D, T); return;
+ case 0x9609a51c: store_ds_constructor_input_messages_filter_photos (D, T); return;
+ case 0x9fc00e65: store_ds_constructor_input_messages_filter_video (D, T); return;
+ case 0x56e9f0e4: store_ds_constructor_input_messages_filter_photo_video (D, T); return;
+ case 0xd95e73bb: store_ds_constructor_input_messages_filter_photo_video_documents (D, T); return;
+ case 0x9eddf188: store_ds_constructor_input_messages_filter_document (D, T); return;
+ case 0xcfc87522: store_ds_constructor_input_messages_filter_audio (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_nearest_dc (struct tl_ds_nearest_dc *D, struct paramed_type *T) {
+ out_int (0x8e1a1775);
+ store_ds_constructor_nearest_dc (D, T); return;
+}
+void store_ds_type_bare_nearest_dc (struct tl_ds_nearest_dc *D, struct paramed_type *T) {
+ store_ds_constructor_nearest_dc (D, T); return;
+}
+void store_ds_type_notify_peer (struct tl_ds_notify_peer *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x9fd40bd8: store_ds_constructor_notify_peer (D, T); return;
+ case 0xb4c83b4c: store_ds_constructor_notify_users (D, T); return;
+ case 0xc007cec3: store_ds_constructor_notify_chats (D, T); return;
+ case 0x74d07c60: store_ds_constructor_notify_all (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_notify_peer (struct tl_ds_notify_peer *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x9fd40bd8: store_ds_constructor_notify_peer (D, T); return;
+ case 0xb4c83b4c: store_ds_constructor_notify_users (D, T); return;
+ case 0xc007cec3: store_ds_constructor_notify_chats (D, T); return;
+ case 0x74d07c60: store_ds_constructor_notify_all (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_null (struct tl_ds_null *D, struct paramed_type *T) {
+ out_int (0x56730bcc);
+ store_ds_constructor_null (D, T); return;
+}
+void store_ds_type_bare_null (struct tl_ds_null *D, struct paramed_type *T) {
+ store_ds_constructor_null (D, T); return;
+}
+void store_ds_type_p_q_inner_data (struct tl_ds_p_q_inner_data *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x83c95aec: store_ds_constructor_p_q_inner_data (D, T); return;
+ case 0x3c6a84d4: store_ds_constructor_p_q_inner_data_temp (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_p_q_inner_data (struct tl_ds_p_q_inner_data *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x83c95aec: store_ds_constructor_p_q_inner_data (D, T); return;
+ case 0x3c6a84d4: store_ds_constructor_p_q_inner_data_temp (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_peer (struct tl_ds_peer *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x9db1bc6d: store_ds_constructor_peer_user (D, T); return;
+ case 0xbad0e5bb: store_ds_constructor_peer_chat (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_peer (struct tl_ds_peer *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x9db1bc6d: store_ds_constructor_peer_user (D, T); return;
+ case 0xbad0e5bb: store_ds_constructor_peer_chat (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_peer_notify_events (struct tl_ds_peer_notify_events *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xadd53cb3: store_ds_constructor_peer_notify_events_empty (D, T); return;
+ case 0x6d1ded88: store_ds_constructor_peer_notify_events_all (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_peer_notify_events (struct tl_ds_peer_notify_events *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xadd53cb3: store_ds_constructor_peer_notify_events_empty (D, T); return;
+ case 0x6d1ded88: store_ds_constructor_peer_notify_events_all (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_peer_notify_settings (struct tl_ds_peer_notify_settings *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x70a68512: store_ds_constructor_peer_notify_settings_empty (D, T); return;
+ case 0x8d5e11ee: store_ds_constructor_peer_notify_settings (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_peer_notify_settings (struct tl_ds_peer_notify_settings *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x70a68512: store_ds_constructor_peer_notify_settings_empty (D, T); return;
+ case 0x8d5e11ee: store_ds_constructor_peer_notify_settings (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_photo (struct tl_ds_photo *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x2331b22d: store_ds_constructor_photo_empty (D, T); return;
+ case 0xc3838076: store_ds_constructor_photo (D, T); return;
+ case 0x22b56751: store_ds_constructor_photo_l27 (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_photo (struct tl_ds_photo *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x2331b22d: store_ds_constructor_photo_empty (D, T); return;
+ case 0xc3838076: store_ds_constructor_photo (D, T); return;
+ case 0x22b56751: store_ds_constructor_photo_l27 (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_photo_size (struct tl_ds_photo_size *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x0e17e23c: store_ds_constructor_photo_size_empty (D, T); return;
+ case 0x77bfb61b: store_ds_constructor_photo_size (D, T); return;
+ case 0xe9a734fa: store_ds_constructor_photo_cached_size (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_photo_size (struct tl_ds_photo_size *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x0e17e23c: store_ds_constructor_photo_size_empty (D, T); return;
+ case 0x77bfb61b: store_ds_constructor_photo_size (D, T); return;
+ case 0xe9a734fa: store_ds_constructor_photo_cached_size (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_privacy_key (struct tl_ds_privacy_key *D, struct paramed_type *T) {
+ out_int (0xbc2eab30);
+ store_ds_constructor_privacy_key_status_timestamp (D, T); return;
+}
+void store_ds_type_bare_privacy_key (struct tl_ds_privacy_key *D, struct paramed_type *T) {
+ store_ds_constructor_privacy_key_status_timestamp (D, T); return;
+}
+void store_ds_type_privacy_rule (struct tl_ds_privacy_rule *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xfffe1bac: store_ds_constructor_privacy_value_allow_contacts (D, T); return;
+ case 0x65427b82: store_ds_constructor_privacy_value_allow_all (D, T); return;
+ case 0x4d5bbe0c: store_ds_constructor_privacy_value_allow_users (D, T); return;
+ case 0xf888fa1a: store_ds_constructor_privacy_value_disallow_contacts (D, T); return;
+ case 0x8b73e763: store_ds_constructor_privacy_value_disallow_all (D, T); return;
+ case 0x0c7f49b7: store_ds_constructor_privacy_value_disallow_users (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_privacy_rule (struct tl_ds_privacy_rule *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xfffe1bac: store_ds_constructor_privacy_value_allow_contacts (D, T); return;
+ case 0x65427b82: store_ds_constructor_privacy_value_allow_all (D, T); return;
+ case 0x4d5bbe0c: store_ds_constructor_privacy_value_allow_users (D, T); return;
+ case 0xf888fa1a: store_ds_constructor_privacy_value_disallow_contacts (D, T); return;
+ case 0x8b73e763: store_ds_constructor_privacy_value_disallow_all (D, T); return;
+ case 0x0c7f49b7: store_ds_constructor_privacy_value_disallow_users (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_received_notify_message (struct tl_ds_received_notify_message *D, struct paramed_type *T) {
+ out_int (0xa384b779);
+ store_ds_constructor_received_notify_message (D, T); return;
+}
+void store_ds_type_bare_received_notify_message (struct tl_ds_received_notify_message *D, struct paramed_type *T) {
+ store_ds_constructor_received_notify_message (D, T); return;
+}
+void store_ds_type_reply_markup (struct tl_ds_reply_markup *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xa03e5b85: store_ds_constructor_reply_keyboard_hide (D, T); return;
+ case 0xf4108aa0: store_ds_constructor_reply_keyboard_force_reply (D, T); return;
+ case 0x3502758c: store_ds_constructor_reply_keyboard_markup (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_reply_markup (struct tl_ds_reply_markup *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xa03e5b85: store_ds_constructor_reply_keyboard_hide (D, T); return;
+ case 0xf4108aa0: store_ds_constructor_reply_keyboard_force_reply (D, T); return;
+ case 0x3502758c: store_ds_constructor_reply_keyboard_markup (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_res_p_q (struct tl_ds_res_p_q *D, struct paramed_type *T) {
+ out_int (0x05162463);
+ store_ds_constructor_res_p_q (D, T); return;
+}
+void store_ds_type_bare_res_p_q (struct tl_ds_res_p_q *D, struct paramed_type *T) {
+ store_ds_constructor_res_p_q (D, T); return;
+}
+void store_ds_type_send_message_action (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x16bf744e: store_ds_constructor_send_message_typing_action (D, T); return;
+ case 0xfd5ec8f5: store_ds_constructor_send_message_cancel_action (D, T); return;
+ case 0xa187d66f: store_ds_constructor_send_message_record_video_action (D, T); return;
+ case 0x92042ff7: store_ds_constructor_send_message_upload_video_action_l27 (D, T); return;
+ case 0xe9763aec: store_ds_constructor_send_message_upload_video_action (D, T); return;
+ case 0xd52f73f7: store_ds_constructor_send_message_record_audio_action (D, T); return;
+ case 0xe6ac8a6f: store_ds_constructor_send_message_upload_audio_action_l27 (D, T); return;
+ case 0xf351d7ab: store_ds_constructor_send_message_upload_audio_action (D, T); return;
+ case 0xd1d34a26: store_ds_constructor_send_message_upload_photo_action (D, T); return;
+ case 0x8faee98e: store_ds_constructor_send_message_upload_document_action_l27 (D, T); return;
+ case 0xaa0cd9e4: store_ds_constructor_send_message_upload_document_action (D, T); return;
+ case 0x176f8ba1: store_ds_constructor_send_message_geo_location_action (D, T); return;
+ case 0x628cbc6f: store_ds_constructor_send_message_choose_contact_action (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_send_message_action (struct tl_ds_send_message_action *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x16bf744e: store_ds_constructor_send_message_typing_action (D, T); return;
+ case 0xfd5ec8f5: store_ds_constructor_send_message_cancel_action (D, T); return;
+ case 0xa187d66f: store_ds_constructor_send_message_record_video_action (D, T); return;
+ case 0x92042ff7: store_ds_constructor_send_message_upload_video_action_l27 (D, T); return;
+ case 0xe9763aec: store_ds_constructor_send_message_upload_video_action (D, T); return;
+ case 0xd52f73f7: store_ds_constructor_send_message_record_audio_action (D, T); return;
+ case 0xe6ac8a6f: store_ds_constructor_send_message_upload_audio_action_l27 (D, T); return;
+ case 0xf351d7ab: store_ds_constructor_send_message_upload_audio_action (D, T); return;
+ case 0xd1d34a26: store_ds_constructor_send_message_upload_photo_action (D, T); return;
+ case 0x8faee98e: store_ds_constructor_send_message_upload_document_action_l27 (D, T); return;
+ case 0xaa0cd9e4: store_ds_constructor_send_message_upload_document_action (D, T); return;
+ case 0x176f8ba1: store_ds_constructor_send_message_geo_location_action (D, T); return;
+ case 0x628cbc6f: store_ds_constructor_send_message_choose_contact_action (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_server_d_h_params (struct tl_ds_server_d_h_params *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x79cb045d: store_ds_constructor_server_d_h_params_fail (D, T); return;
+ case 0xd0e8075c: store_ds_constructor_server_d_h_params_ok (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_server_d_h_params (struct tl_ds_server_d_h_params *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x79cb045d: store_ds_constructor_server_d_h_params_fail (D, T); return;
+ case 0xd0e8075c: store_ds_constructor_server_d_h_params_ok (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_server_d_h_inner_data (struct tl_ds_server_d_h_inner_data *D, struct paramed_type *T) {
+ out_int (0xb5890dba);
+ store_ds_constructor_server_d_h_inner_data (D, T); return;
+}
+void store_ds_type_bare_server_d_h_inner_data (struct tl_ds_server_d_h_inner_data *D, struct paramed_type *T) {
+ store_ds_constructor_server_d_h_inner_data (D, T); return;
+}
+void store_ds_type_set_client_d_h_params_answer (struct tl_ds_set_client_d_h_params_answer *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x3bcbf734: store_ds_constructor_dh_gen_ok (D, T); return;
+ case 0x46dc1fb9: store_ds_constructor_dh_gen_retry (D, T); return;
+ case 0xa69dae02: store_ds_constructor_dh_gen_fail (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_set_client_d_h_params_answer (struct tl_ds_set_client_d_h_params_answer *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x3bcbf734: store_ds_constructor_dh_gen_ok (D, T); return;
+ case 0x46dc1fb9: store_ds_constructor_dh_gen_retry (D, T); return;
+ case 0xa69dae02: store_ds_constructor_dh_gen_fail (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_sticker_pack (struct tl_ds_sticker_pack *D, struct paramed_type *T) {
+ out_int (0x12b299d4);
+ store_ds_constructor_sticker_pack (D, T); return;
+}
+void store_ds_type_bare_sticker_pack (struct tl_ds_sticker_pack *D, struct paramed_type *T) {
+ store_ds_constructor_sticker_pack (D, T); return;
+}
+void store_ds_type_sticker_set (struct tl_ds_sticker_set *D, struct paramed_type *T) {
+ out_int (0xa7a43b17);
+ store_ds_constructor_sticker_set (D, T); return;
+}
+void store_ds_type_bare_sticker_set (struct tl_ds_sticker_set *D, struct paramed_type *T) {
+ store_ds_constructor_sticker_set (D, T); return;
+}
+void store_ds_type_string (struct tl_ds_string *D, struct paramed_type *T) {
+ out_int (0xb5286e24);
+ store_ds_constructor_string (D, T); return;
+}
+void store_ds_type_bare_string (struct tl_ds_string *D, struct paramed_type *T) {
+ store_ds_constructor_string (D, T); return;
+}
+void store_ds_type_update (struct tl_ds_update *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x1f2b0afd: store_ds_constructor_update_new_message (D, T); return;
+ case 0x4e90bfd6: store_ds_constructor_update_message_i_d (D, T); return;
+ case 0xa20db0e5: store_ds_constructor_update_delete_messages (D, T); return;
+ case 0x5c486927: store_ds_constructor_update_user_typing (D, T); return;
+ case 0x9a65ea1f: store_ds_constructor_update_chat_user_typing (D, T); return;
+ case 0x07761198: store_ds_constructor_update_chat_participants (D, T); return;
+ case 0x1bfbd823: store_ds_constructor_update_user_status (D, T); return;
+ case 0xa7332b73: store_ds_constructor_update_user_name (D, T); return;
+ case 0x95313b0c: store_ds_constructor_update_user_photo (D, T); return;
+ case 0x2575bbb9: store_ds_constructor_update_contact_registered (D, T); return;
+ case 0x9d2e67c5: store_ds_constructor_update_contact_link (D, T); return;
+ case 0x8f06529a: store_ds_constructor_update_new_authorization (D, T); return;
+ case 0x5a68e3f7: store_ds_constructor_update_new_geo_chat_message (D, T); return;
+ case 0x12bcbd9a: store_ds_constructor_update_new_encrypted_message (D, T); return;
+ case 0x1710f156: store_ds_constructor_update_encrypted_chat_typing (D, T); return;
+ case 0xb4a2e88d: store_ds_constructor_update_encryption (D, T); return;
+ case 0x38fe25b7: store_ds_constructor_update_encrypted_messages_read (D, T); return;
+ case 0x3a0eeb22: store_ds_constructor_update_chat_participant_add (D, T); return;
+ case 0x6e5f8c22: store_ds_constructor_update_chat_participant_delete (D, T); return;
+ case 0x8e5e9873: store_ds_constructor_update_dc_options (D, T); return;
+ case 0x80ece81a: store_ds_constructor_update_user_blocked (D, T); return;
+ case 0xbec268ef: store_ds_constructor_update_notify_settings (D, T); return;
+ case 0x382dd3e4: store_ds_constructor_update_service_notification (D, T); return;
+ case 0xee3b272a: store_ds_constructor_update_privacy (D, T); return;
+ case 0x12b9417b: store_ds_constructor_update_user_phone (D, T); return;
+ case 0x9961fd5c: store_ds_constructor_update_read_history_inbox (D, T); return;
+ case 0x2f2f21bf: store_ds_constructor_update_read_history_outbox (D, T); return;
+ case 0x2cc36971: store_ds_constructor_update_web_page (D, T); return;
+ case 0x68c13933: store_ds_constructor_update_read_messages_contents (D, T); return;
+ case 0x03114739: store_ds_constructor_update_msg_update (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_update (struct tl_ds_update *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x1f2b0afd: store_ds_constructor_update_new_message (D, T); return;
+ case 0x4e90bfd6: store_ds_constructor_update_message_i_d (D, T); return;
+ case 0xa20db0e5: store_ds_constructor_update_delete_messages (D, T); return;
+ case 0x5c486927: store_ds_constructor_update_user_typing (D, T); return;
+ case 0x9a65ea1f: store_ds_constructor_update_chat_user_typing (D, T); return;
+ case 0x07761198: store_ds_constructor_update_chat_participants (D, T); return;
+ case 0x1bfbd823: store_ds_constructor_update_user_status (D, T); return;
+ case 0xa7332b73: store_ds_constructor_update_user_name (D, T); return;
+ case 0x95313b0c: store_ds_constructor_update_user_photo (D, T); return;
+ case 0x2575bbb9: store_ds_constructor_update_contact_registered (D, T); return;
+ case 0x9d2e67c5: store_ds_constructor_update_contact_link (D, T); return;
+ case 0x8f06529a: store_ds_constructor_update_new_authorization (D, T); return;
+ case 0x5a68e3f7: store_ds_constructor_update_new_geo_chat_message (D, T); return;
+ case 0x12bcbd9a: store_ds_constructor_update_new_encrypted_message (D, T); return;
+ case 0x1710f156: store_ds_constructor_update_encrypted_chat_typing (D, T); return;
+ case 0xb4a2e88d: store_ds_constructor_update_encryption (D, T); return;
+ case 0x38fe25b7: store_ds_constructor_update_encrypted_messages_read (D, T); return;
+ case 0x3a0eeb22: store_ds_constructor_update_chat_participant_add (D, T); return;
+ case 0x6e5f8c22: store_ds_constructor_update_chat_participant_delete (D, T); return;
+ case 0x8e5e9873: store_ds_constructor_update_dc_options (D, T); return;
+ case 0x80ece81a: store_ds_constructor_update_user_blocked (D, T); return;
+ case 0xbec268ef: store_ds_constructor_update_notify_settings (D, T); return;
+ case 0x382dd3e4: store_ds_constructor_update_service_notification (D, T); return;
+ case 0xee3b272a: store_ds_constructor_update_privacy (D, T); return;
+ case 0x12b9417b: store_ds_constructor_update_user_phone (D, T); return;
+ case 0x9961fd5c: store_ds_constructor_update_read_history_inbox (D, T); return;
+ case 0x2f2f21bf: store_ds_constructor_update_read_history_outbox (D, T); return;
+ case 0x2cc36971: store_ds_constructor_update_web_page (D, T); return;
+ case 0x68c13933: store_ds_constructor_update_read_messages_contents (D, T); return;
+ case 0x03114739: store_ds_constructor_update_msg_update (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_updates (struct tl_ds_updates *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xe317af7e: store_ds_constructor_updates_too_long (D, T); return;
+ case 0xed5c2127: store_ds_constructor_update_short_message (D, T); return;
+ case 0x52238b3c: store_ds_constructor_update_short_chat_message (D, T); return;
+ case 0x78d4dec1: store_ds_constructor_update_short (D, T); return;
+ case 0x725b04c3: store_ds_constructor_updates_combined (D, T); return;
+ case 0x74ae4240: store_ds_constructor_updates (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_updates (struct tl_ds_updates *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xe317af7e: store_ds_constructor_updates_too_long (D, T); return;
+ case 0xed5c2127: store_ds_constructor_update_short_message (D, T); return;
+ case 0x52238b3c: store_ds_constructor_update_short_chat_message (D, T); return;
+ case 0x78d4dec1: store_ds_constructor_update_short (D, T); return;
+ case 0x725b04c3: store_ds_constructor_updates_combined (D, T); return;
+ case 0x74ae4240: store_ds_constructor_updates (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_user (struct tl_ds_user *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x200250ba: store_ds_constructor_user_empty (D, T); return;
+ case 0x22e49072: store_ds_constructor_user (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_user (struct tl_ds_user *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x200250ba: store_ds_constructor_user_empty (D, T); return;
+ case 0x22e49072: store_ds_constructor_user (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_user_full (struct tl_ds_user_full *D, struct paramed_type *T) {
+ out_int (0x5a89ac5b);
+ store_ds_constructor_user_full (D, T); return;
+}
+void store_ds_type_bare_user_full (struct tl_ds_user_full *D, struct paramed_type *T) {
+ store_ds_constructor_user_full (D, T); return;
+}
+void store_ds_type_user_profile_photo (struct tl_ds_user_profile_photo *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x4f11bae1: store_ds_constructor_user_profile_photo_empty (D, T); return;
+ case 0xd559d8c8: store_ds_constructor_user_profile_photo (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_user_profile_photo (struct tl_ds_user_profile_photo *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x4f11bae1: store_ds_constructor_user_profile_photo_empty (D, T); return;
+ case 0xd559d8c8: store_ds_constructor_user_profile_photo (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_user_status (struct tl_ds_user_status *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x09d05049: store_ds_constructor_user_status_empty (D, T); return;
+ case 0xedb93949: store_ds_constructor_user_status_online (D, T); return;
+ case 0x008c703f: store_ds_constructor_user_status_offline (D, T); return;
+ case 0xe26f42f1: store_ds_constructor_user_status_recently (D, T); return;
+ case 0x07bf09fc: store_ds_constructor_user_status_last_week (D, T); return;
+ case 0x77ebc742: store_ds_constructor_user_status_last_month (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_user_status (struct tl_ds_user_status *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x09d05049: store_ds_constructor_user_status_empty (D, T); return;
+ case 0xedb93949: store_ds_constructor_user_status_online (D, T); return;
+ case 0x008c703f: store_ds_constructor_user_status_offline (D, T); return;
+ case 0xe26f42f1: store_ds_constructor_user_status_recently (D, T); return;
+ case 0x07bf09fc: store_ds_constructor_user_status_last_week (D, T); return;
+ case 0x77ebc742: store_ds_constructor_user_status_last_month (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_vector (struct tl_ds_vector *D, struct paramed_type *T) {
+ out_int (0x1cb5c415);
+ store_ds_constructor_vector (D, T); return;
+}
+void store_ds_type_bare_vector (struct tl_ds_vector *D, struct paramed_type *T) {
+ store_ds_constructor_vector (D, T); return;
+}
+void store_ds_type_video (struct tl_ds_video *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xc10658a8: store_ds_constructor_video_empty (D, T); return;
+ case 0xee9f4a4d: store_ds_constructor_video (D, T); return;
+ case 0x388fa391: store_ds_constructor_video_l27 (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_video (struct tl_ds_video *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xc10658a8: store_ds_constructor_video_empty (D, T); return;
+ case 0xee9f4a4d: store_ds_constructor_video (D, T); return;
+ case 0x388fa391: store_ds_constructor_video_l27 (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_wall_paper (struct tl_ds_wall_paper *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xccb03657: store_ds_constructor_wall_paper (D, T); return;
+ case 0x63117f24: store_ds_constructor_wall_paper_solid (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_wall_paper (struct tl_ds_wall_paper *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xccb03657: store_ds_constructor_wall_paper (D, T); return;
+ case 0x63117f24: store_ds_constructor_wall_paper_solid (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_web_page (struct tl_ds_web_page *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xeb1477e8: store_ds_constructor_web_page_empty (D, T); return;
+ case 0xc586da1c: store_ds_constructor_web_page_pending (D, T); return;
+ case 0xa31ea0b5: store_ds_constructor_web_page (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_web_page (struct tl_ds_web_page *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xeb1477e8: store_ds_constructor_web_page_empty (D, T); return;
+ case 0xc586da1c: store_ds_constructor_web_page_pending (D, T); return;
+ case 0xa31ea0b5: store_ds_constructor_web_page (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_account_authorizations (struct tl_ds_account_authorizations *D, struct paramed_type *T) {
+ out_int (0x1250abde);
+ store_ds_constructor_account_authorizations (D, T); return;
+}
+void store_ds_type_bare_account_authorizations (struct tl_ds_account_authorizations *D, struct paramed_type *T) {
+ store_ds_constructor_account_authorizations (D, T); return;
+}
+void store_ds_type_account_password (struct tl_ds_account_password *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x96dabc18: store_ds_constructor_account_no_password (D, T); return;
+ case 0x7c18141c: store_ds_constructor_account_password (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_account_password (struct tl_ds_account_password *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x96dabc18: store_ds_constructor_account_no_password (D, T); return;
+ case 0x7c18141c: store_ds_constructor_account_password (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_account_password_input_settings (struct tl_ds_account_password_input_settings *D, struct paramed_type *T) {
+ out_int (0xbcfc532c);
+ store_ds_constructor_account_password_input_settings (D, T); return;
+}
+void store_ds_type_bare_account_password_input_settings (struct tl_ds_account_password_input_settings *D, struct paramed_type *T) {
+ store_ds_constructor_account_password_input_settings (D, T); return;
+}
+void store_ds_type_account_password_settings (struct tl_ds_account_password_settings *D, struct paramed_type *T) {
+ out_int (0xb7b72ab3);
+ store_ds_constructor_account_password_settings (D, T); return;
+}
+void store_ds_type_bare_account_password_settings (struct tl_ds_account_password_settings *D, struct paramed_type *T) {
+ store_ds_constructor_account_password_settings (D, T); return;
+}
+void store_ds_type_account_privacy_rules (struct tl_ds_account_privacy_rules *D, struct paramed_type *T) {
+ out_int (0x554abb6f);
+ store_ds_constructor_account_privacy_rules (D, T); return;
+}
+void store_ds_type_bare_account_privacy_rules (struct tl_ds_account_privacy_rules *D, struct paramed_type *T) {
+ store_ds_constructor_account_privacy_rules (D, T); return;
+}
+void store_ds_type_account_sent_change_phone_code (struct tl_ds_account_sent_change_phone_code *D, struct paramed_type *T) {
+ out_int (0xa4f58c4c);
+ store_ds_constructor_account_sent_change_phone_code (D, T); return;
+}
+void store_ds_type_bare_account_sent_change_phone_code (struct tl_ds_account_sent_change_phone_code *D, struct paramed_type *T) {
+ store_ds_constructor_account_sent_change_phone_code (D, T); return;
+}
+void store_ds_type_auth_authorization (struct tl_ds_auth_authorization *D, struct paramed_type *T) {
+ out_int (0xff036af1);
+ store_ds_constructor_auth_authorization (D, T); return;
+}
+void store_ds_type_bare_auth_authorization (struct tl_ds_auth_authorization *D, struct paramed_type *T) {
+ store_ds_constructor_auth_authorization (D, T); return;
+}
+void store_ds_type_auth_checked_phone (struct tl_ds_auth_checked_phone *D, struct paramed_type *T) {
+ out_int (0x811ea28e);
+ store_ds_constructor_auth_checked_phone (D, T); return;
+}
+void store_ds_type_bare_auth_checked_phone (struct tl_ds_auth_checked_phone *D, struct paramed_type *T) {
+ store_ds_constructor_auth_checked_phone (D, T); return;
+}
+void store_ds_type_auth_exported_authorization (struct tl_ds_auth_exported_authorization *D, struct paramed_type *T) {
+ out_int (0xdf969c2d);
+ store_ds_constructor_auth_exported_authorization (D, T); return;
+}
+void store_ds_type_bare_auth_exported_authorization (struct tl_ds_auth_exported_authorization *D, struct paramed_type *T) {
+ store_ds_constructor_auth_exported_authorization (D, T); return;
+}
+void store_ds_type_auth_password_recovery (struct tl_ds_auth_password_recovery *D, struct paramed_type *T) {
+ out_int (0x137948a5);
+ store_ds_constructor_auth_password_recovery (D, T); return;
+}
+void store_ds_type_bare_auth_password_recovery (struct tl_ds_auth_password_recovery *D, struct paramed_type *T) {
+ store_ds_constructor_auth_password_recovery (D, T); return;
+}
+void store_ds_type_auth_sent_code (struct tl_ds_auth_sent_code *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xefed51d9: store_ds_constructor_auth_sent_code (D, T); return;
+ case 0xe325edcf: store_ds_constructor_auth_sent_app_code (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_auth_sent_code (struct tl_ds_auth_sent_code *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xefed51d9: store_ds_constructor_auth_sent_code (D, T); return;
+ case 0xe325edcf: store_ds_constructor_auth_sent_app_code (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_binlog_encr_key (struct tl_ds_binlog_encr_key *D, struct paramed_type *T) {
+ out_int (0x0377168f);
+ store_ds_constructor_binlog_encr_key (D, T); return;
+}
+void store_ds_type_bare_binlog_encr_key (struct tl_ds_binlog_encr_key *D, struct paramed_type *T) {
+ store_ds_constructor_binlog_encr_key (D, T); return;
+}
+void store_ds_type_binlog_update (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x3b06de69: store_ds_constructor_binlog_start (D, T); return;
+ case 0xf96feb32: store_ds_constructor_binlog_dc_option (D, T); return;
+ case 0x7c0d22d8: store_ds_constructor_binlog_dc_option_new (D, T); return;
+ case 0x71e8c156: store_ds_constructor_binlog_auth_key (D, T); return;
+ case 0x9e83dbdc: store_ds_constructor_binlog_default_dc (D, T); return;
+ case 0x26451bb5: store_ds_constructor_binlog_dc_signed (D, T); return;
+ case 0x68a870e8: store_ds_constructor_binlog_our_id (D, T); return;
+ case 0xeaeb7826: store_ds_constructor_binlog_set_dh_params (D, T); return;
+ case 0x2ca8c939: store_ds_constructor_binlog_set_pts (D, T); return;
+ case 0xd95738ac: store_ds_constructor_binlog_set_qts (D, T); return;
+ case 0x1d0f4b52: store_ds_constructor_binlog_set_date (D, T); return;
+ case 0x6eeb2989: store_ds_constructor_binlog_set_seq (D, T); return;
+ case 0xee1b38e8: store_ds_constructor_binlog_encr_chat_delete (D, T); return;
+ case 0x84977251: store_ds_constructor_binlog_encr_chat_new (D, T); return;
+ case 0x9d49488d: store_ds_constructor_binlog_encr_chat_exchange_new (D, T); return;
+ case 0xac55d447: store_ds_constructor_binlog_user_delete (D, T); return;
+ case 0x127cf2f9: store_ds_constructor_binlog_user_new (D, T); return;
+ case 0x0a10aa92: store_ds_constructor_binlog_chat_new (D, T); return;
+ case 0x535475ea: store_ds_constructor_binlog_chat_add_participant (D, T); return;
+ case 0x7dd1a1a2: store_ds_constructor_binlog_chat_del_participant (D, T); return;
+ case 0x3c873416: store_ds_constructor_binlog_set_msg_id (D, T); return;
+ case 0x847e77b1: store_ds_constructor_binlog_message_delete (D, T); return;
+ case 0x427cfcdb: store_ds_constructor_binlog_message_new (D, T); return;
+ case 0x6cf7cabc: store_ds_constructor_binlog_message_encr_new (D, T); return;
+ case 0x6dd4d85f: store_ds_constructor_binlog_msg_update (D, T); return;
+ case 0x83327955: store_ds_constructor_binlog_reset_authorization (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_binlog_update (struct tl_ds_binlog_update *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x3b06de69: store_ds_constructor_binlog_start (D, T); return;
+ case 0xf96feb32: store_ds_constructor_binlog_dc_option (D, T); return;
+ case 0x7c0d22d8: store_ds_constructor_binlog_dc_option_new (D, T); return;
+ case 0x71e8c156: store_ds_constructor_binlog_auth_key (D, T); return;
+ case 0x9e83dbdc: store_ds_constructor_binlog_default_dc (D, T); return;
+ case 0x26451bb5: store_ds_constructor_binlog_dc_signed (D, T); return;
+ case 0x68a870e8: store_ds_constructor_binlog_our_id (D, T); return;
+ case 0xeaeb7826: store_ds_constructor_binlog_set_dh_params (D, T); return;
+ case 0x2ca8c939: store_ds_constructor_binlog_set_pts (D, T); return;
+ case 0xd95738ac: store_ds_constructor_binlog_set_qts (D, T); return;
+ case 0x1d0f4b52: store_ds_constructor_binlog_set_date (D, T); return;
+ case 0x6eeb2989: store_ds_constructor_binlog_set_seq (D, T); return;
+ case 0xee1b38e8: store_ds_constructor_binlog_encr_chat_delete (D, T); return;
+ case 0x84977251: store_ds_constructor_binlog_encr_chat_new (D, T); return;
+ case 0x9d49488d: store_ds_constructor_binlog_encr_chat_exchange_new (D, T); return;
+ case 0xac55d447: store_ds_constructor_binlog_user_delete (D, T); return;
+ case 0x127cf2f9: store_ds_constructor_binlog_user_new (D, T); return;
+ case 0x0a10aa92: store_ds_constructor_binlog_chat_new (D, T); return;
+ case 0x535475ea: store_ds_constructor_binlog_chat_add_participant (D, T); return;
+ case 0x7dd1a1a2: store_ds_constructor_binlog_chat_del_participant (D, T); return;
+ case 0x3c873416: store_ds_constructor_binlog_set_msg_id (D, T); return;
+ case 0x847e77b1: store_ds_constructor_binlog_message_delete (D, T); return;
+ case 0x427cfcdb: store_ds_constructor_binlog_message_new (D, T); return;
+ case 0x6cf7cabc: store_ds_constructor_binlog_message_encr_new (D, T); return;
+ case 0x6dd4d85f: store_ds_constructor_binlog_msg_update (D, T); return;
+ case 0x83327955: store_ds_constructor_binlog_reset_authorization (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_contacts_blocked (struct tl_ds_contacts_blocked *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x1c138d15: store_ds_constructor_contacts_blocked (D, T); return;
+ case 0x900802a1: store_ds_constructor_contacts_blocked_slice (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_contacts_blocked (struct tl_ds_contacts_blocked *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x1c138d15: store_ds_constructor_contacts_blocked (D, T); return;
+ case 0x900802a1: store_ds_constructor_contacts_blocked_slice (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_contacts_contacts (struct tl_ds_contacts_contacts *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xb74ba9d2: store_ds_constructor_contacts_contacts_not_modified (D, T); return;
+ case 0x6f8b8cb2: store_ds_constructor_contacts_contacts (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_contacts_contacts (struct tl_ds_contacts_contacts *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xb74ba9d2: store_ds_constructor_contacts_contacts_not_modified (D, T); return;
+ case 0x6f8b8cb2: store_ds_constructor_contacts_contacts (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_contacts_found (struct tl_ds_contacts_found *D, struct paramed_type *T) {
+ out_int (0x0566000e);
+ store_ds_constructor_contacts_found (D, T); return;
+}
+void store_ds_type_bare_contacts_found (struct tl_ds_contacts_found *D, struct paramed_type *T) {
+ store_ds_constructor_contacts_found (D, T); return;
+}
+void store_ds_type_contacts_imported_contacts (struct tl_ds_contacts_imported_contacts *D, struct paramed_type *T) {
+ out_int (0xad524315);
+ store_ds_constructor_contacts_imported_contacts (D, T); return;
+}
+void store_ds_type_bare_contacts_imported_contacts (struct tl_ds_contacts_imported_contacts *D, struct paramed_type *T) {
+ store_ds_constructor_contacts_imported_contacts (D, T); return;
+}
+void store_ds_type_contacts_link (struct tl_ds_contacts_link *D, struct paramed_type *T) {
+ out_int (0x3ace484c);
+ store_ds_constructor_contacts_link (D, T); return;
+}
+void store_ds_type_bare_contacts_link (struct tl_ds_contacts_link *D, struct paramed_type *T) {
+ store_ds_constructor_contacts_link (D, T); return;
+}
+void store_ds_type_contacts_suggested (struct tl_ds_contacts_suggested *D, struct paramed_type *T) {
+ out_int (0x5649dcc5);
+ store_ds_constructor_contacts_suggested (D, T); return;
+}
+void store_ds_type_bare_contacts_suggested (struct tl_ds_contacts_suggested *D, struct paramed_type *T) {
+ store_ds_constructor_contacts_suggested (D, T); return;
+}
+void store_ds_type_geochats_located (struct tl_ds_geochats_located *D, struct paramed_type *T) {
+ out_int (0x48feb267);
+ store_ds_constructor_geochats_located (D, T); return;
+}
+void store_ds_type_bare_geochats_located (struct tl_ds_geochats_located *D, struct paramed_type *T) {
+ store_ds_constructor_geochats_located (D, T); return;
+}
+void store_ds_type_geochats_messages (struct tl_ds_geochats_messages *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xd1526db1: store_ds_constructor_geochats_messages (D, T); return;
+ case 0xbc5863e8: store_ds_constructor_geochats_messages_slice (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_geochats_messages (struct tl_ds_geochats_messages *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xd1526db1: store_ds_constructor_geochats_messages (D, T); return;
+ case 0xbc5863e8: store_ds_constructor_geochats_messages_slice (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_geochats_stated_message (struct tl_ds_geochats_stated_message *D, struct paramed_type *T) {
+ out_int (0x17b1578b);
+ store_ds_constructor_geochats_stated_message (D, T); return;
+}
+void store_ds_type_bare_geochats_stated_message (struct tl_ds_geochats_stated_message *D, struct paramed_type *T) {
+ store_ds_constructor_geochats_stated_message (D, T); return;
+}
+void store_ds_type_help_app_update (struct tl_ds_help_app_update *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x8987f311: store_ds_constructor_help_app_update (D, T); return;
+ case 0xc45a6536: store_ds_constructor_help_no_app_update (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_help_app_update (struct tl_ds_help_app_update *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x8987f311: store_ds_constructor_help_app_update (D, T); return;
+ case 0xc45a6536: store_ds_constructor_help_no_app_update (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_help_invite_text (struct tl_ds_help_invite_text *D, struct paramed_type *T) {
+ out_int (0x18cb9f78);
+ store_ds_constructor_help_invite_text (D, T); return;
+}
+void store_ds_type_bare_help_invite_text (struct tl_ds_help_invite_text *D, struct paramed_type *T) {
+ store_ds_constructor_help_invite_text (D, T); return;
+}
+void store_ds_type_help_support (struct tl_ds_help_support *D, struct paramed_type *T) {
+ out_int (0x17c6b5f6);
+ store_ds_constructor_help_support (D, T); return;
+}
+void store_ds_type_bare_help_support (struct tl_ds_help_support *D, struct paramed_type *T) {
+ store_ds_constructor_help_support (D, T); return;
+}
+void store_ds_type_messages_affected_history (struct tl_ds_messages_affected_history *D, struct paramed_type *T) {
+ out_int (0xb45c69d1);
+ store_ds_constructor_messages_affected_history (D, T); return;
+}
+void store_ds_type_bare_messages_affected_history (struct tl_ds_messages_affected_history *D, struct paramed_type *T) {
+ store_ds_constructor_messages_affected_history (D, T); return;
+}
+void store_ds_type_messages_affected_messages (struct tl_ds_messages_affected_messages *D, struct paramed_type *T) {
+ out_int (0x84d19185);
+ store_ds_constructor_messages_affected_messages (D, T); return;
+}
+void store_ds_type_bare_messages_affected_messages (struct tl_ds_messages_affected_messages *D, struct paramed_type *T) {
+ store_ds_constructor_messages_affected_messages (D, T); return;
+}
+void store_ds_type_messages_all_stickers (struct tl_ds_messages_all_stickers *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xe86602c3: store_ds_constructor_messages_all_stickers_not_modified (D, T); return;
+ case 0x5ce352ec: store_ds_constructor_messages_all_stickers (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_messages_all_stickers (struct tl_ds_messages_all_stickers *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xe86602c3: store_ds_constructor_messages_all_stickers_not_modified (D, T); return;
+ case 0x5ce352ec: store_ds_constructor_messages_all_stickers (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_messages_chat_full (struct tl_ds_messages_chat_full *D, struct paramed_type *T) {
+ out_int (0xe5d7d19c);
+ store_ds_constructor_messages_chat_full (D, T); return;
+}
+void store_ds_type_bare_messages_chat_full (struct tl_ds_messages_chat_full *D, struct paramed_type *T) {
+ store_ds_constructor_messages_chat_full (D, T); return;
+}
+void store_ds_type_messages_chats (struct tl_ds_messages_chats *D, struct paramed_type *T) {
+ out_int (0x64ff9fd5);
+ store_ds_constructor_messages_chats (D, T); return;
+}
+void store_ds_type_bare_messages_chats (struct tl_ds_messages_chats *D, struct paramed_type *T) {
+ store_ds_constructor_messages_chats (D, T); return;
+}
+void store_ds_type_messages_dh_config (struct tl_ds_messages_dh_config *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xc0e24635: store_ds_constructor_messages_dh_config_not_modified (D, T); return;
+ case 0x2c221edd: store_ds_constructor_messages_dh_config (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_messages_dh_config (struct tl_ds_messages_dh_config *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xc0e24635: store_ds_constructor_messages_dh_config_not_modified (D, T); return;
+ case 0x2c221edd: store_ds_constructor_messages_dh_config (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_messages_dialogs (struct tl_ds_messages_dialogs *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x15ba6c40: store_ds_constructor_messages_dialogs (D, T); return;
+ case 0x71e094f3: store_ds_constructor_messages_dialogs_slice (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_messages_dialogs (struct tl_ds_messages_dialogs *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x15ba6c40: store_ds_constructor_messages_dialogs (D, T); return;
+ case 0x71e094f3: store_ds_constructor_messages_dialogs_slice (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_messages_message (struct tl_ds_messages_message *D, struct paramed_type *T) {
+ out_int (0x3f4e0648);
+ store_ds_constructor_messages_message_empty (D, T); return;
+}
+void store_ds_type_bare_messages_message (struct tl_ds_messages_message *D, struct paramed_type *T) {
+ store_ds_constructor_messages_message_empty (D, T); return;
+}
+void store_ds_type_messages_messages (struct tl_ds_messages_messages *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x8c718e87: store_ds_constructor_messages_messages (D, T); return;
+ case 0x0b446ae3: store_ds_constructor_messages_messages_slice (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_messages_messages (struct tl_ds_messages_messages *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x8c718e87: store_ds_constructor_messages_messages (D, T); return;
+ case 0x0b446ae3: store_ds_constructor_messages_messages_slice (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_messages_sent_encrypted_message (struct tl_ds_messages_sent_encrypted_message *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x560f8935: store_ds_constructor_messages_sent_encrypted_message (D, T); return;
+ case 0x9493ff32: store_ds_constructor_messages_sent_encrypted_file (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_messages_sent_encrypted_message (struct tl_ds_messages_sent_encrypted_message *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x560f8935: store_ds_constructor_messages_sent_encrypted_message (D, T); return;
+ case 0x9493ff32: store_ds_constructor_messages_sent_encrypted_file (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_messages_sent_message (struct tl_ds_messages_sent_message *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x4c3d47f3: store_ds_constructor_messages_sent_message (D, T); return;
+ case 0x35a1a663: store_ds_constructor_messages_sent_message_link (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_messages_sent_message (struct tl_ds_messages_sent_message *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x4c3d47f3: store_ds_constructor_messages_sent_message (D, T); return;
+ case 0x35a1a663: store_ds_constructor_messages_sent_message_link (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_messages_sticker_set (struct tl_ds_messages_sticker_set *D, struct paramed_type *T) {
+ out_int (0xb60a24a6);
+ store_ds_constructor_messages_sticker_set (D, T); return;
+}
+void store_ds_type_bare_messages_sticker_set (struct tl_ds_messages_sticker_set *D, struct paramed_type *T) {
+ store_ds_constructor_messages_sticker_set (D, T); return;
+}
+void store_ds_type_messages_stickers (struct tl_ds_messages_stickers *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xf1749a22: store_ds_constructor_messages_stickers_not_modified (D, T); return;
+ case 0x8a8ecd32: store_ds_constructor_messages_stickers (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_messages_stickers (struct tl_ds_messages_stickers *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xf1749a22: store_ds_constructor_messages_stickers_not_modified (D, T); return;
+ case 0x8a8ecd32: store_ds_constructor_messages_stickers (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_photos_photo (struct tl_ds_photos_photo *D, struct paramed_type *T) {
+ out_int (0x20212ca8);
+ store_ds_constructor_photos_photo (D, T); return;
+}
+void store_ds_type_bare_photos_photo (struct tl_ds_photos_photo *D, struct paramed_type *T) {
+ store_ds_constructor_photos_photo (D, T); return;
+}
+void store_ds_type_photos_photos (struct tl_ds_photos_photos *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x8dca6aa5: store_ds_constructor_photos_photos (D, T); return;
+ case 0x15051f54: store_ds_constructor_photos_photos_slice (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_photos_photos (struct tl_ds_photos_photos *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x8dca6aa5: store_ds_constructor_photos_photos (D, T); return;
+ case 0x15051f54: store_ds_constructor_photos_photos_slice (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_storage_file_type (struct tl_ds_storage_file_type *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0xaa963b05: store_ds_constructor_storage_file_unknown (D, T); return;
+ case 0x007efe0e: store_ds_constructor_storage_file_jpeg (D, T); return;
+ case 0xcae1aadf: store_ds_constructor_storage_file_gif (D, T); return;
+ case 0x0a4f63c0: store_ds_constructor_storage_file_png (D, T); return;
+ case 0xae1e508d: store_ds_constructor_storage_file_pdf (D, T); return;
+ case 0x528a0677: store_ds_constructor_storage_file_mp3 (D, T); return;
+ case 0x4b09ebbc: store_ds_constructor_storage_file_mov (D, T); return;
+ case 0x40bc6f52: store_ds_constructor_storage_file_partial (D, T); return;
+ case 0xb3cea0e4: store_ds_constructor_storage_file_mp4 (D, T); return;
+ case 0x1081464c: store_ds_constructor_storage_file_webp (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_storage_file_type (struct tl_ds_storage_file_type *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0xaa963b05: store_ds_constructor_storage_file_unknown (D, T); return;
+ case 0x007efe0e: store_ds_constructor_storage_file_jpeg (D, T); return;
+ case 0xcae1aadf: store_ds_constructor_storage_file_gif (D, T); return;
+ case 0x0a4f63c0: store_ds_constructor_storage_file_png (D, T); return;
+ case 0xae1e508d: store_ds_constructor_storage_file_pdf (D, T); return;
+ case 0x528a0677: store_ds_constructor_storage_file_mp3 (D, T); return;
+ case 0x4b09ebbc: store_ds_constructor_storage_file_mov (D, T); return;
+ case 0x40bc6f52: store_ds_constructor_storage_file_partial (D, T); return;
+ case 0xb3cea0e4: store_ds_constructor_storage_file_mp4 (D, T); return;
+ case 0x1081464c: store_ds_constructor_storage_file_webp (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_updates_difference (struct tl_ds_updates_difference *D, struct paramed_type *T) {
+ out_int (D->magic);
+ switch (D->magic) {
+ case 0x5d75a138: store_ds_constructor_updates_difference_empty (D, T); return;
+ case 0x00f49ca0: store_ds_constructor_updates_difference (D, T); return;
+ case 0xa8fb1981: store_ds_constructor_updates_difference_slice (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_bare_updates_difference (struct tl_ds_updates_difference *D, struct paramed_type *T) {
+ switch (D->magic) {
+ case 0x5d75a138: store_ds_constructor_updates_difference_empty (D, T); return;
+ case 0x00f49ca0: store_ds_constructor_updates_difference (D, T); return;
+ case 0xa8fb1981: store_ds_constructor_updates_difference_slice (D, T); return;
+ default: assert (0);
+ }
+}
+void store_ds_type_updates_state (struct tl_ds_updates_state *D, struct paramed_type *T) {
+ out_int (0xa56c2a3e);
+ store_ds_constructor_updates_state (D, T); return;
+}
+void store_ds_type_bare_updates_state (struct tl_ds_updates_state *D, struct paramed_type *T) {
+ store_ds_constructor_updates_state (D, T); return;
+}
+void store_ds_type_upload_file (struct tl_ds_upload_file *D, struct paramed_type *T) {
+ out_int (0x096a18d5);
+ store_ds_constructor_upload_file (D, T); return;
+}
+void store_ds_type_bare_upload_file (struct tl_ds_upload_file *D, struct paramed_type *T) {
+ store_ds_constructor_upload_file (D, T); return;
+}
+void store_ds_type_any (void *D, struct paramed_type *T) {
+ switch (T->type->name) {
+ case 0xb8d0afdf: store_ds_type_account_days_t_t_l (D, T); return;
+ case 0x472f5020: store_ds_type_bare_account_days_t_t_l (D, T); return;
+ case 0x9fc5ec4e: store_ds_type_audio (D, T); return;
+ case 0x603a13b1: store_ds_type_bare_audio (D, T); return;
+ case 0x7bf2e6f6: store_ds_type_authorization (D, T); return;
+ case 0x840d1909: store_ds_type_bare_authorization (D, T); return;
+ case 0x250be282: store_ds_type_bool (D, T); return;
+ case 0xdaf41d7d: store_ds_type_bare_bool (D, T); return;
+ case 0x75e7ea6c: store_ds_type_bot_command (D, T); return;
+ case 0x8a181593: store_ds_type_bare_bot_command (D, T); return;
+ case 0xb2e16f93: store_ds_type_bot_info (D, T); return;
+ case 0x4d1e906c: store_ds_type_bare_bot_info (D, T); return;
+ case 0x0ee1379f: store_ds_type_bytes (D, T); return;
+ case 0xf11ec860: store_ds_type_bare_bytes (D, T); return;
+ case 0x7bd865dc: store_ds_type_chat (D, T); return;
+ case 0x84279a23: store_ds_type_bare_chat (D, T); return;
+ case 0x2e02a614: store_ds_type_chat_full (D, T); return;
+ case 0xd1fd59eb: store_ds_type_bare_chat_full (D, T); return;
+ case 0x94f910b1: store_ds_type_chat_invite (D, T); return;
+ case 0x6b06ef4e: store_ds_type_bare_chat_invite (D, T); return;
+ case 0x3631cf4c: store_ds_type_chat_located (D, T); return;
+ case 0xc9ce30b3: store_ds_type_bare_chat_located (D, T); return;
+ case 0xc8d7493e: store_ds_type_chat_participant (D, T); return;
+ case 0x3728b6c1: store_ds_type_bare_chat_participant (D, T); return;
+ case 0x77930f9f: store_ds_type_chat_participants (D, T); return;
+ case 0x886cf060: store_ds_type_bare_chat_participants (D, T); return;
+ case 0x56922676: store_ds_type_chat_photo (D, T); return;
+ case 0xa96dd989: store_ds_type_bare_chat_photo (D, T); return;
+ case 0x6643b654: store_ds_type_client_d_h_inner_data (D, T); return;
+ case 0x99bc49ab: store_ds_type_bare_client_d_h_inner_data (D, T); return;
+ case 0x4e32b894: store_ds_type_config (D, T); return;
+ case 0xb1cd476b: store_ds_type_bare_config (D, T); return;
+ case 0xf911c994: store_ds_type_contact (D, T); return;
+ case 0x06ee366b: store_ds_type_bare_contact (D, T); return;
+ case 0x561bc879: store_ds_type_contact_blocked (D, T); return;
+ case 0xa9e43786: store_ds_type_bare_contact_blocked (D, T); return;
+ case 0xea879f95: store_ds_type_contact_found (D, T); return;
+ case 0x1578606a: store_ds_type_bare_contact_found (D, T); return;
+ case 0x522fbc63: store_ds_type_contact_link (D, T); return;
+ case 0xadd0439c: store_ds_type_bare_contact_link (D, T); return;
+ case 0xd3680c61: store_ds_type_contact_status (D, T); return;
+ case 0x2c97f39e: store_ds_type_bare_contact_status (D, T); return;
+ case 0x3de191a1: store_ds_type_contact_suggested (D, T); return;
+ case 0xc21e6e5e: store_ds_type_bare_contact_suggested (D, T); return;
+ case 0x2b1a62f0: store_ds_type_dc_option (D, T); return;
+ case 0xd4e59d0f: store_ds_type_bare_dc_option (D, T); return;
+ case 0x535b7918: store_ds_type_decrypted_message (D, T); return;
+ case 0xaca486e7: store_ds_type_bare_decrypted_message (D, T); return;
+ case 0x4e0eefde: store_ds_type_decrypted_message_action (D, T); return;
+ case 0xb1f11021: store_ds_type_bare_decrypted_message_action (D, T); return;
+ case 0x1be31789: store_ds_type_decrypted_message_layer (D, T); return;
+ case 0xe41ce876: store_ds_type_bare_decrypted_message_layer (D, T); return;
+ case 0x34e0d674: store_ds_type_decrypted_message_media (D, T); return;
+ case 0xcb1f298b: store_ds_type_bare_decrypted_message_media (D, T); return;
+ case 0xc1dd804a: store_ds_type_dialog (D, T); return;
+ case 0x3e227fb5: store_ds_type_bare_dialog (D, T); return;
+ case 0xae636f24: store_ds_type_disabled_feature (D, T); return;
+ case 0x519c90db: store_ds_type_bare_disabled_feature (D, T); return;
+ case 0x51a73418: store_ds_type_document (D, T); return;
+ case 0xae58cbe7: store_ds_type_bare_document (D, T); return;
+ case 0x97c637a3: store_ds_type_document_attribute (D, T); return;
+ case 0x6839c85c: store_ds_type_bare_document_attribute (D, T); return;
+ case 0x2210c154: store_ds_type_double (D, T); return;
+ case 0xddef3eab: store_ds_type_bare_double (D, T); return;
+ case 0xb1718213: store_ds_type_encrypted_chat (D, T); return;
+ case 0x4e8e7dec: store_ds_type_bare_encrypted_chat (D, T); return;
+ case 0x886fd032: store_ds_type_encrypted_file (D, T); return;
+ case 0x77902fcd: store_ds_type_bare_encrypted_file (D, T); return;
+ case 0xce6b8a1e: store_ds_type_encrypted_message (D, T); return;
+ case 0x319475e1: store_ds_type_bare_encrypted_message (D, T); return;
+ case 0xc4b9f9bb: store_ds_type_error (D, T); return;
+ case 0x3b460644: store_ds_type_bare_error (D, T); return;
+ case 0x95f132d5: store_ds_type_exported_chat_invite (D, T); return;
+ case 0x6a0ecd2a: store_ds_type_bare_exported_chat_invite (D, T); return;
+ case 0x2f8ffb30: store_ds_type_file_location (D, T); return;
+ case 0xd07004cf: store_ds_type_bare_file_location (D, T); return;
+ case 0xf67b4034: store_ds_type_geo_chat_message (D, T); return;
+ case 0x0984bfcb: store_ds_type_bare_geo_chat_message (D, T); return;
+ case 0x315e0a53: store_ds_type_geo_point (D, T); return;
+ case 0xcea1f5ac: store_ds_type_bare_geo_point (D, T); return;
+ case 0xd0028438: store_ds_type_imported_contact (D, T); return;
+ case 0x2ffd7bc7: store_ds_type_bare_imported_contact (D, T); return;
+ case 0x770656a8: store_ds_type_input_app_event (D, T); return;
+ case 0x88f9a957: store_ds_type_bare_input_app_event (D, T); return;
+ case 0xae8e9c7b: store_ds_type_input_audio (D, T); return;
+ case 0x51716384: store_ds_type_bare_input_audio (D, T); return;
+ case 0x3a60776d: store_ds_type_input_chat_photo (D, T); return;
+ case 0xc59f8892: store_ds_type_bare_input_chat_photo (D, T); return;
+ case 0xf392b7f4: store_ds_type_input_contact (D, T); return;
+ case 0x0c6d480b: store_ds_type_bare_input_contact (D, T); return;
+ case 0x6a8963fc: store_ds_type_input_document (D, T); return;
+ case 0x95769c03: store_ds_type_bare_input_document (D, T); return;
+ case 0xf141b5e1: store_ds_type_input_encrypted_chat (D, T); return;
+ case 0x0ebe4a1e: store_ds_type_bare_input_encrypted_chat (D, T); return;
+ case 0x0b5c064f: store_ds_type_input_encrypted_file (D, T); return;
+ case 0xf4a3f9b0: store_ds_type_bare_input_encrypted_file (D, T); return;
+ case 0x0f60f9ca: store_ds_type_input_file (D, T); return;
+ case 0xf09f0635: store_ds_type_bare_input_file (D, T); return;
+ case 0xe6daa38b: store_ds_type_input_file_location (D, T); return;
+ case 0x19255c74: store_ds_type_bare_input_file_location (D, T); return;
+ case 0x74d456fa: store_ds_type_input_geo_chat (D, T); return;
+ case 0x8b2ba905: store_ds_type_bare_input_geo_chat (D, T); return;
+ case 0x17768f1f: store_ds_type_input_geo_point (D, T); return;
+ case 0xe88970e0: store_ds_type_bare_input_geo_point (D, T); return;
+ case 0xb32c91dd: store_ds_type_input_media (D, T); return;
+ case 0x4cd36e22: store_ds_type_bare_input_media (D, T); return;
+ case 0x02b6911b: store_ds_type_input_notify_peer (D, T); return;
+ case 0xfd496ee4: store_ds_type_bare_input_notify_peer (D, T); return;
+ case 0x9e67268d: store_ds_type_input_peer (D, T); return;
+ case 0x6198d972: store_ds_type_bare_input_peer (D, T); return;
+ case 0x185a48ac: store_ds_type_input_peer_notify_events (D, T); return;
+ case 0xe7a5b753: store_ds_type_bare_input_peer_notify_events (D, T); return;
+ case 0x46a2ce98: store_ds_type_input_peer_notify_settings (D, T); return;
+ case 0xb95d3167: store_ds_type_bare_input_peer_notify_settings (D, T); return;
+ case 0xe74279c9: store_ds_type_input_photo (D, T); return;
+ case 0x18bd8636: store_ds_type_bare_input_photo (D, T); return;
+ case 0x7477e321: store_ds_type_input_photo_crop (D, T); return;
+ case 0x8b881cde: store_ds_type_bare_input_photo_crop (D, T); return;
+ case 0x4f96cb18: store_ds_type_input_privacy_key (D, T); return;
+ case 0xb06934e7: store_ds_type_bare_input_privacy_key (D, T); return;
+ case 0x4b815163: store_ds_type_input_privacy_rule (D, T); return;
+ case 0xb47eae9c: store_ds_type_bare_input_privacy_rule (D, T); return;
+ case 0xe44d415c: store_ds_type_input_sticker_set (D, T); return;
+ case 0x1bb2bea3: store_ds_type_bare_input_sticker_set (D, T); return;
+ case 0xadfe0c6a: store_ds_type_input_user (D, T); return;
+ case 0x5201f395: store_ds_type_bare_input_user (D, T); return;
+ case 0xbb5f7a27: store_ds_type_input_video (D, T); return;
+ case 0x44a085d8: store_ds_type_bare_input_video (D, T); return;
+ case 0xa8509bda: store_ds_type_int (D, T); return;
+ case 0x57af6425: store_ds_type_bare_int (D, T); return;
+ case 0x7d36c439: store_ds_type_int128 (D, T); return;
+ case 0x82c93bc6: store_ds_type_bare_int128 (D, T); return;
+ case 0xf2c798b3: store_ds_type_int256 (D, T); return;
+ case 0x0d38674c: store_ds_type_bare_int256 (D, T); return;
+ case 0xa2fa4880: store_ds_type_keyboard_button (D, T); return;
+ case 0x5d05b77f: store_ds_type_bare_keyboard_button (D, T); return;
+ case 0x77608b83: store_ds_type_keyboard_button_row (D, T); return;
+ case 0x889f747c: store_ds_type_bare_keyboard_button_row (D, T); return;
+ case 0x22076cba: store_ds_type_long (D, T); return;
+ case 0xddf89345: store_ds_type_bare_long (D, T); return;
+ case 0x5d652a7f: store_ds_type_message (D, T); return;
+ case 0xa29ad580: store_ds_type_bare_message (D, T); return;
+ case 0x383415fa: store_ds_type_message_action (D, T); return;
+ case 0xc7cbea05: store_ds_type_bare_message_action (D, T); return;
+ case 0x95f2471a: store_ds_type_message_media (D, T); return;
+ case 0x6a0db8e5: store_ds_type_bare_message_media (D, T); return;
+ case 0x80895ae0: store_ds_type_messages_filter (D, T); return;
+ case 0x7f76a51f: store_ds_type_bare_messages_filter (D, T); return;
+ case 0x8e1a1775: store_ds_type_nearest_dc (D, T); return;
+ case 0x71e5e88a: store_ds_type_bare_nearest_dc (D, T); return;
+ case 0x9fcb8237: store_ds_type_notify_peer (D, T); return;
+ case 0x60347dc8: store_ds_type_bare_notify_peer (D, T); return;
+ case 0x56730bcc: store_ds_type_null (D, T); return;
+ case 0xa98cf433: store_ds_type_bare_null (D, T); return;
+ case 0xbfa3de38: store_ds_type_p_q_inner_data (D, T); return;
+ case 0x405c21c7: store_ds_type_bare_p_q_inner_data (D, T); return;
+ case 0x276159d6: store_ds_type_peer (D, T); return;
+ case 0xd89ea629: store_ds_type_bare_peer (D, T); return;
+ case 0xc0c8d13b: store_ds_type_peer_notify_events (D, T); return;
+ case 0x3f372ec4: store_ds_type_bare_peer_notify_events (D, T); return;
+ case 0xfdf894fc: store_ds_type_peer_notify_settings (D, T); return;
+ case 0x02076b03: store_ds_type_bare_peer_notify_settings (D, T); return;
+ case 0xc207550a: store_ds_type_photo (D, T); return;
+ case 0x3df8aaf5: store_ds_type_bare_photo (D, T); return;
+ case 0x900f60dd: store_ds_type_photo_size (D, T); return;
+ case 0x6ff09f22: store_ds_type_bare_photo_size (D, T); return;
+ case 0xbc2eab30: store_ds_type_privacy_key (D, T); return;
+ case 0x43d154cf: store_ds_type_bare_privacy_key (D, T); return;
+ case 0xa8638aec: store_ds_type_privacy_rule (D, T); return;
+ case 0x579c7513: store_ds_type_bare_privacy_rule (D, T); return;
+ case 0xa384b779: store_ds_type_received_notify_message (D, T); return;
+ case 0x5c7b4886: store_ds_type_bare_received_notify_message (D, T); return;
+ case 0x612ca4a9: store_ds_type_reply_markup (D, T); return;
+ case 0x9ed35b56: store_ds_type_bare_reply_markup (D, T); return;
+ case 0x05162463: store_ds_type_res_p_q (D, T); return;
+ case 0xfae9db9c: store_ds_type_bare_res_p_q (D, T); return;
+ case 0x70541c7e: store_ds_type_send_message_action (D, T); return;
+ case 0x8fabe381: store_ds_type_bare_send_message_action (D, T); return;
+ case 0xa9230301: store_ds_type_server_d_h_params (D, T); return;
+ case 0x56dcfcfe: store_ds_type_bare_server_d_h_params (D, T); return;
+ case 0xb5890dba: store_ds_type_server_d_h_inner_data (D, T); return;
+ case 0x4a76f245: store_ds_type_bare_server_d_h_inner_data (D, T); return;
+ case 0xdb8a468f: store_ds_type_set_client_d_h_params_answer (D, T); return;
+ case 0x2475b970: store_ds_type_bare_set_client_d_h_params_answer (D, T); return;
+ case 0x12b299d4: store_ds_type_sticker_pack (D, T); return;
+ case 0xed4d662b: store_ds_type_bare_sticker_pack (D, T); return;
+ case 0xa7a43b17: store_ds_type_sticker_set (D, T); return;
+ case 0x585bc4e8: store_ds_type_bare_sticker_set (D, T); return;
+ case 0xb5286e24: store_ds_type_string (D, T); return;
+ case 0x4ad791db: store_ds_type_bare_string (D, T); return;
+ case 0x2e02b27e: store_ds_type_update (D, T); return;
+ case 0xd1fd4d81: store_ds_type_bare_update (D, T); return;
+ case 0x22499d27: store_ds_type_updates (D, T); return;
+ case 0xddb662d8: store_ds_type_bare_updates (D, T); return;
+ case 0x02e6c0c8: store_ds_type_user (D, T); return;
+ case 0xfd193f37: store_ds_type_bare_user (D, T); return;
+ case 0x5a89ac5b: store_ds_type_user_full (D, T); return;
+ case 0xa57653a4: store_ds_type_bare_user_full (D, T); return;
+ case 0x9a486229: store_ds_type_user_profile_photo (D, T); return;
+ case 0x65b79dd6: store_ds_type_bare_user_profile_photo (D, T); return;
+ case 0x76de9570: store_ds_type_user_status (D, T); return;
+ case 0x89216a8f: store_ds_type_bare_user_status (D, T); return;
+ case 0x1cb5c415: store_ds_type_vector (D, T); return;
+ case 0xe34a3bea: store_ds_type_bare_vector (D, T); return;
+ case 0x1716b174: store_ds_type_video (D, T); return;
+ case 0xe8e94e8b: store_ds_type_bare_video (D, T); return;
+ case 0xafa14973: store_ds_type_wall_paper (D, T); return;
+ case 0x505eb68c: store_ds_type_bare_wall_paper (D, T); return;
+ case 0x8d8c0d41: store_ds_type_web_page (D, T); return;
+ case 0x7273f2be: store_ds_type_bare_web_page (D, T); return;
+ case 0x1250abde: store_ds_type_account_authorizations (D, T); return;
+ case 0xedaf5421: store_ds_type_bare_account_authorizations (D, T); return;
+ case 0xeac2a804: store_ds_type_account_password (D, T); return;
+ case 0x153d57fb: store_ds_type_bare_account_password (D, T); return;
+ case 0xbcfc532c: store_ds_type_account_password_input_settings (D, T); return;
+ case 0x4303acd3: store_ds_type_bare_account_password_input_settings (D, T); return;
+ case 0xb7b72ab3: store_ds_type_account_password_settings (D, T); return;
+ case 0x4848d54c: store_ds_type_bare_account_password_settings (D, T); return;
+ case 0x554abb6f: store_ds_type_account_privacy_rules (D, T); return;
+ case 0xaab54490: store_ds_type_bare_account_privacy_rules (D, T); return;
+ case 0xa4f58c4c: store_ds_type_account_sent_change_phone_code (D, T); return;
+ case 0x5b0a73b3: store_ds_type_bare_account_sent_change_phone_code (D, T); return;
+ case 0xff036af1: store_ds_type_auth_authorization (D, T); return;
+ case 0x00fc950e: store_ds_type_bare_auth_authorization (D, T); return;
+ case 0x811ea28e: store_ds_type_auth_checked_phone (D, T); return;
+ case 0x7ee15d71: store_ds_type_bare_auth_checked_phone (D, T); return;
+ case 0xdf969c2d: store_ds_type_auth_exported_authorization (D, T); return;
+ case 0x206963d2: store_ds_type_bare_auth_exported_authorization (D, T); return;
+ case 0x137948a5: store_ds_type_auth_password_recovery (D, T); return;
+ case 0xec86b75a: store_ds_type_bare_auth_password_recovery (D, T); return;
+ case 0x0cc8bc16: store_ds_type_auth_sent_code (D, T); return;
+ case 0xf33743e9: store_ds_type_bare_auth_sent_code (D, T); return;
+ case 0x0377168f: store_ds_type_binlog_encr_key (D, T); return;
+ case 0xfc88e970: store_ds_type_bare_binlog_encr_key (D, T); return;
+ case 0x66ff03a6: store_ds_type_binlog_update (D, T); return;
+ case 0x9900fc59: store_ds_type_bare_binlog_update (D, T); return;
+ case 0x8c1b8fb4: store_ds_type_contacts_blocked (D, T); return;
+ case 0x73e4704b: store_ds_type_bare_contacts_blocked (D, T); return;
+ case 0xd8c02560: store_ds_type_contacts_contacts (D, T); return;
+ case 0x273fda9f: store_ds_type_bare_contacts_contacts (D, T); return;
+ case 0x0566000e: store_ds_type_contacts_found (D, T); return;
+ case 0xfa99fff1: store_ds_type_bare_contacts_found (D, T); return;
+ case 0xad524315: store_ds_type_contacts_imported_contacts (D, T); return;
+ case 0x52adbcea: store_ds_type_bare_contacts_imported_contacts (D, T); return;
+ case 0x3ace484c: store_ds_type_contacts_link (D, T); return;
+ case 0xc531b7b3: store_ds_type_bare_contacts_link (D, T); return;
+ case 0x5649dcc5: store_ds_type_contacts_suggested (D, T); return;
+ case 0xa9b6233a: store_ds_type_bare_contacts_suggested (D, T); return;
+ case 0x48feb267: store_ds_type_geochats_located (D, T); return;
+ case 0xb7014d98: store_ds_type_bare_geochats_located (D, T); return;
+ case 0x6d0a0e59: store_ds_type_geochats_messages (D, T); return;
+ case 0x92f5f1a6: store_ds_type_bare_geochats_messages (D, T); return;
+ case 0x17b1578b: store_ds_type_geochats_stated_message (D, T); return;
+ case 0xe84ea874: store_ds_type_bare_geochats_stated_message (D, T); return;
+ case 0x4ddd9627: store_ds_type_help_app_update (D, T); return;
+ case 0xb22269d8: store_ds_type_bare_help_app_update (D, T); return;
+ case 0x18cb9f78: store_ds_type_help_invite_text (D, T); return;
+ case 0xe7346087: store_ds_type_bare_help_invite_text (D, T); return;
+ case 0x17c6b5f6: store_ds_type_help_support (D, T); return;
+ case 0xe8394a09: store_ds_type_bare_help_support (D, T); return;
+ case 0xb45c69d1: store_ds_type_messages_affected_history (D, T); return;
+ case 0x4ba3962e: store_ds_type_bare_messages_affected_history (D, T); return;
+ case 0x84d19185: store_ds_type_messages_affected_messages (D, T); return;
+ case 0x7b2e6e7a: store_ds_type_bare_messages_affected_messages (D, T); return;
+ case 0xb485502f: store_ds_type_messages_all_stickers (D, T); return;
+ case 0x4b7aafd0: store_ds_type_bare_messages_all_stickers (D, T); return;
+ case 0xe5d7d19c: store_ds_type_messages_chat_full (D, T); return;
+ case 0x1a282e63: store_ds_type_bare_messages_chat_full (D, T); return;
+ case 0x64ff9fd5: store_ds_type_messages_chats (D, T); return;
+ case 0x9b00602a: store_ds_type_bare_messages_chats (D, T); return;
+ case 0xecc058e8: store_ds_type_messages_dh_config (D, T); return;
+ case 0x133fa717: store_ds_type_bare_messages_dh_config (D, T); return;
+ case 0x645af8b3: store_ds_type_messages_dialogs (D, T); return;
+ case 0x9ba5074c: store_ds_type_bare_messages_dialogs (D, T); return;
+ case 0x3f4e0648: store_ds_type_messages_message (D, T); return;
+ case 0xc0b1f9b7: store_ds_type_bare_messages_message (D, T); return;
+ case 0x8735e464: store_ds_type_messages_messages (D, T); return;
+ case 0x78ca1b9b: store_ds_type_bare_messages_messages (D, T); return;
+ case 0xc29c7607: store_ds_type_messages_sent_encrypted_message (D, T); return;
+ case 0x3d6389f8: store_ds_type_bare_messages_sent_encrypted_message (D, T); return;
+ case 0x799ce190: store_ds_type_messages_sent_message (D, T); return;
+ case 0x86631e6f: store_ds_type_bare_messages_sent_message (D, T); return;
+ case 0xb60a24a6: store_ds_type_messages_sticker_set (D, T); return;
+ case 0x49f5db59: store_ds_type_bare_messages_sticker_set (D, T); return;
+ case 0x7bfa5710: store_ds_type_messages_stickers (D, T); return;
+ case 0x8405a8ef: store_ds_type_bare_messages_stickers (D, T); return;
+ case 0x20212ca8: store_ds_type_photos_photo (D, T); return;
+ case 0xdfded357: store_ds_type_bare_photos_photo (D, T); return;
+ case 0x98cf75f1: store_ds_type_photos_photos (D, T); return;
+ case 0x67308a0e: store_ds_type_bare_photos_photos (D, T); return;
+ case 0x3e2838a8: store_ds_type_storage_file_type (D, T); return;
+ case 0xc1d7c757: store_ds_type_bare_storage_file_type (D, T); return;
+ case 0xf57a2419: store_ds_type_updates_difference (D, T); return;
+ case 0x0a85dbe6: store_ds_type_bare_updates_difference (D, T); return;
+ case 0xa56c2a3e: store_ds_type_updates_state (D, T); return;
+ case 0x5a93d5c1: store_ds_type_bare_updates_state (D, T); return;
+ case 0x096a18d5: store_ds_type_upload_file (D, T); return;
+ case 0xf695e72a: store_ds_type_bare_upload_file (D, T); return;
+ default: return; }
+}
diff --git a/protocols/Telegram/tgl/auto/auto-store-ds.h b/protocols/Telegram/tgl/auto/auto-store-ds.h
new file mode 100644
index 0000000000..4abc26b3ce
--- /dev/null
+++ b/protocols/Telegram/tgl/auto/auto-store-ds.h
@@ -0,0 +1,718 @@
+#ifdef _MSC_VER
+#include "..\auto.h"
+#include "auto-types.h"
+#else
+#include "auto.h"
+#include "auto/auto-types.h"
+#endif
+#include <assert.h>
+#include <stdio.h>
+struct tgl_state;
+void store_ds_constructor_account_days_t_t_l (struct tl_ds_account_days_t_t_l *D, struct paramed_type *T);
+void store_ds_constructor_audio_empty (struct tl_ds_audio *D, struct paramed_type *T);
+void store_ds_constructor_audio (struct tl_ds_audio *D, struct paramed_type *T);
+void store_ds_constructor_authorization (struct tl_ds_authorization *D, struct paramed_type *T);
+void store_ds_constructor_bool_false (struct tl_ds_bool *D, struct paramed_type *T);
+void store_ds_constructor_bool_true (struct tl_ds_bool *D, struct paramed_type *T);
+void store_ds_constructor_bot_command (struct tl_ds_bot_command *D, struct paramed_type *T);
+void store_ds_constructor_bot_command_old (struct tl_ds_bot_command *D, struct paramed_type *T);
+void store_ds_constructor_bot_info_empty (struct tl_ds_bot_info *D, struct paramed_type *T);
+void store_ds_constructor_bot_info (struct tl_ds_bot_info *D, struct paramed_type *T);
+void store_ds_constructor_bytes (struct tl_ds_string *D, struct paramed_type *T);
+void store_ds_constructor_chat_empty (struct tl_ds_chat *D, struct paramed_type *T);
+void store_ds_constructor_chat (struct tl_ds_chat *D, struct paramed_type *T);
+void store_ds_constructor_chat_forbidden (struct tl_ds_chat *D, struct paramed_type *T);
+void store_ds_constructor_geo_chat (struct tl_ds_chat *D, struct paramed_type *T);
+void store_ds_constructor_chat_full (struct tl_ds_chat_full *D, struct paramed_type *T);
+void store_ds_constructor_chat_invite_already (struct tl_ds_chat_invite *D, struct paramed_type *T);
+void store_ds_constructor_chat_invite (struct tl_ds_chat_invite *D, struct paramed_type *T);
+void store_ds_constructor_chat_located (struct tl_ds_chat_located *D, struct paramed_type *T);
+void store_ds_constructor_chat_participant (struct tl_ds_chat_participant *D, struct paramed_type *T);
+void store_ds_constructor_chat_participants_forbidden (struct tl_ds_chat_participants *D, struct paramed_type *T);
+void store_ds_constructor_chat_participants (struct tl_ds_chat_participants *D, struct paramed_type *T);
+void store_ds_constructor_chat_photo_empty (struct tl_ds_chat_photo *D, struct paramed_type *T);
+void store_ds_constructor_chat_photo (struct tl_ds_chat_photo *D, struct paramed_type *T);
+void store_ds_constructor_client_d_h_inner_data (struct tl_ds_client_d_h_inner_data *D, struct paramed_type *T);
+void store_ds_constructor_config (struct tl_ds_config *D, struct paramed_type *T);
+void store_ds_constructor_contact (struct tl_ds_contact *D, struct paramed_type *T);
+void store_ds_constructor_contact_blocked (struct tl_ds_contact_blocked *D, struct paramed_type *T);
+void store_ds_constructor_contact_found (struct tl_ds_contact_found *D, struct paramed_type *T);
+void store_ds_constructor_contact_link_unknown (struct tl_ds_contact_link *D, struct paramed_type *T);
+void store_ds_constructor_contact_link_none (struct tl_ds_contact_link *D, struct paramed_type *T);
+void store_ds_constructor_contact_link_has_phone (struct tl_ds_contact_link *D, struct paramed_type *T);
+void store_ds_constructor_contact_link_contact (struct tl_ds_contact_link *D, struct paramed_type *T);
+void store_ds_constructor_contact_status (struct tl_ds_contact_status *D, struct paramed_type *T);
+void store_ds_constructor_contact_suggested (struct tl_ds_contact_suggested *D, struct paramed_type *T);
+void store_ds_constructor_dc_option_l28 (struct tl_ds_dc_option *D, struct paramed_type *T);
+void store_ds_constructor_dc_option (struct tl_ds_dc_option *D, struct paramed_type *T);
+void store_ds_constructor_decrypted_message (struct tl_ds_decrypted_message *D, struct paramed_type *T);
+void store_ds_constructor_decrypted_message_service (struct tl_ds_decrypted_message *D, struct paramed_type *T);
+void store_ds_constructor_decrypted_message_action_set_message_t_t_l (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void store_ds_constructor_decrypted_message_action_read_messages (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void store_ds_constructor_decrypted_message_action_delete_messages (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void store_ds_constructor_decrypted_message_action_screenshot_messages (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void store_ds_constructor_decrypted_message_action_flush_history (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void store_ds_constructor_decrypted_message_action_resend (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void store_ds_constructor_decrypted_message_action_notify_layer (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void store_ds_constructor_decrypted_message_action_typing (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void store_ds_constructor_decrypted_message_action_request_key (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void store_ds_constructor_decrypted_message_action_accept_key (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void store_ds_constructor_decrypted_message_action_abort_key (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void store_ds_constructor_decrypted_message_action_commit_key (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void store_ds_constructor_decrypted_message_action_noop (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void store_ds_constructor_decrypted_message_layer (struct tl_ds_decrypted_message_layer *D, struct paramed_type *T);
+void store_ds_constructor_decrypted_message_media_empty (struct tl_ds_decrypted_message_media *D, struct paramed_type *T);
+void store_ds_constructor_decrypted_message_media_photo (struct tl_ds_decrypted_message_media *D, struct paramed_type *T);
+void store_ds_constructor_decrypted_message_media_geo_point (struct tl_ds_decrypted_message_media *D, struct paramed_type *T);
+void store_ds_constructor_decrypted_message_media_contact (struct tl_ds_decrypted_message_media *D, struct paramed_type *T);
+void store_ds_constructor_decrypted_message_media_document (struct tl_ds_decrypted_message_media *D, struct paramed_type *T);
+void store_ds_constructor_decrypted_message_media_video (struct tl_ds_decrypted_message_media *D, struct paramed_type *T);
+void store_ds_constructor_decrypted_message_media_audio (struct tl_ds_decrypted_message_media *D, struct paramed_type *T);
+void store_ds_constructor_decrypted_message_media_external_document (struct tl_ds_decrypted_message_media *D, struct paramed_type *T);
+void store_ds_constructor_decrypted_message_media_video_l12 (struct tl_ds_decrypted_message_media *D, struct paramed_type *T);
+void store_ds_constructor_decrypted_message_media_audio_l12 (struct tl_ds_decrypted_message_media *D, struct paramed_type *T);
+void store_ds_constructor_dialog (struct tl_ds_dialog *D, struct paramed_type *T);
+void store_ds_constructor_disabled_feature (struct tl_ds_disabled_feature *D, struct paramed_type *T);
+void store_ds_constructor_document_empty (struct tl_ds_document *D, struct paramed_type *T);
+void store_ds_constructor_document (struct tl_ds_document *D, struct paramed_type *T);
+void store_ds_constructor_document_l19 (struct tl_ds_document *D, struct paramed_type *T);
+void store_ds_constructor_document_attribute_image_size (struct tl_ds_document_attribute *D, struct paramed_type *T);
+void store_ds_constructor_document_attribute_animated (struct tl_ds_document_attribute *D, struct paramed_type *T);
+void store_ds_constructor_document_attribute_sticker_l28 (struct tl_ds_document_attribute *D, struct paramed_type *T);
+void store_ds_constructor_document_attribute_sticker (struct tl_ds_document_attribute *D, struct paramed_type *T);
+void store_ds_constructor_document_attribute_video (struct tl_ds_document_attribute *D, struct paramed_type *T);
+void store_ds_constructor_document_attribute_audio (struct tl_ds_document_attribute *D, struct paramed_type *T);
+void store_ds_constructor_document_attribute_filename (struct tl_ds_document_attribute *D, struct paramed_type *T);
+void store_ds_constructor_double (double *D, struct paramed_type *T);
+void store_ds_constructor_encrypted_chat_empty (struct tl_ds_encrypted_chat *D, struct paramed_type *T);
+void store_ds_constructor_encrypted_chat_waiting (struct tl_ds_encrypted_chat *D, struct paramed_type *T);
+void store_ds_constructor_encrypted_chat_requested (struct tl_ds_encrypted_chat *D, struct paramed_type *T);
+void store_ds_constructor_encrypted_chat (struct tl_ds_encrypted_chat *D, struct paramed_type *T);
+void store_ds_constructor_encrypted_chat_discarded (struct tl_ds_encrypted_chat *D, struct paramed_type *T);
+void store_ds_constructor_encrypted_file_empty (struct tl_ds_encrypted_file *D, struct paramed_type *T);
+void store_ds_constructor_encrypted_file (struct tl_ds_encrypted_file *D, struct paramed_type *T);
+void store_ds_constructor_encrypted_message (struct tl_ds_encrypted_message *D, struct paramed_type *T);
+void store_ds_constructor_encrypted_message_service (struct tl_ds_encrypted_message *D, struct paramed_type *T);
+void store_ds_constructor_error (struct tl_ds_error *D, struct paramed_type *T);
+void store_ds_constructor_chat_invite_empty (struct tl_ds_exported_chat_invite *D, struct paramed_type *T);
+void store_ds_constructor_chat_invite_exported (struct tl_ds_exported_chat_invite *D, struct paramed_type *T);
+void store_ds_constructor_file_location_unavailable (struct tl_ds_file_location *D, struct paramed_type *T);
+void store_ds_constructor_file_location (struct tl_ds_file_location *D, struct paramed_type *T);
+void store_ds_constructor_geo_chat_message_empty (struct tl_ds_geo_chat_message *D, struct paramed_type *T);
+void store_ds_constructor_geo_chat_message (struct tl_ds_geo_chat_message *D, struct paramed_type *T);
+void store_ds_constructor_geo_chat_message_service (struct tl_ds_geo_chat_message *D, struct paramed_type *T);
+void store_ds_constructor_geo_point_empty (struct tl_ds_geo_point *D, struct paramed_type *T);
+void store_ds_constructor_geo_point (struct tl_ds_geo_point *D, struct paramed_type *T);
+void store_ds_constructor_imported_contact (struct tl_ds_imported_contact *D, struct paramed_type *T);
+void store_ds_constructor_input_app_event (struct tl_ds_input_app_event *D, struct paramed_type *T);
+void store_ds_constructor_input_audio_empty (struct tl_ds_input_audio *D, struct paramed_type *T);
+void store_ds_constructor_input_audio (struct tl_ds_input_audio *D, struct paramed_type *T);
+void store_ds_constructor_input_chat_photo_empty (struct tl_ds_input_chat_photo *D, struct paramed_type *T);
+void store_ds_constructor_input_chat_uploaded_photo (struct tl_ds_input_chat_photo *D, struct paramed_type *T);
+void store_ds_constructor_input_chat_photo (struct tl_ds_input_chat_photo *D, struct paramed_type *T);
+void store_ds_constructor_input_phone_contact (struct tl_ds_input_contact *D, struct paramed_type *T);
+void store_ds_constructor_input_document_empty (struct tl_ds_input_document *D, struct paramed_type *T);
+void store_ds_constructor_input_document (struct tl_ds_input_document *D, struct paramed_type *T);
+void store_ds_constructor_input_encrypted_chat (struct tl_ds_input_encrypted_chat *D, struct paramed_type *T);
+void store_ds_constructor_input_encrypted_file_empty (struct tl_ds_input_encrypted_file *D, struct paramed_type *T);
+void store_ds_constructor_input_encrypted_file_uploaded (struct tl_ds_input_encrypted_file *D, struct paramed_type *T);
+void store_ds_constructor_input_encrypted_file (struct tl_ds_input_encrypted_file *D, struct paramed_type *T);
+void store_ds_constructor_input_encrypted_file_big_uploaded (struct tl_ds_input_encrypted_file *D, struct paramed_type *T);
+void store_ds_constructor_input_file (struct tl_ds_input_file *D, struct paramed_type *T);
+void store_ds_constructor_input_file_big (struct tl_ds_input_file *D, struct paramed_type *T);
+void store_ds_constructor_input_file_location (struct tl_ds_input_file_location *D, struct paramed_type *T);
+void store_ds_constructor_input_video_file_location (struct tl_ds_input_file_location *D, struct paramed_type *T);
+void store_ds_constructor_input_encrypted_file_location (struct tl_ds_input_file_location *D, struct paramed_type *T);
+void store_ds_constructor_input_audio_file_location (struct tl_ds_input_file_location *D, struct paramed_type *T);
+void store_ds_constructor_input_document_file_location (struct tl_ds_input_file_location *D, struct paramed_type *T);
+void store_ds_constructor_input_geo_chat (struct tl_ds_input_geo_chat *D, struct paramed_type *T);
+void store_ds_constructor_input_geo_point_empty (struct tl_ds_input_geo_point *D, struct paramed_type *T);
+void store_ds_constructor_input_geo_point (struct tl_ds_input_geo_point *D, struct paramed_type *T);
+void store_ds_constructor_input_media_empty (struct tl_ds_input_media *D, struct paramed_type *T);
+void store_ds_constructor_input_media_uploaded_photo (struct tl_ds_input_media *D, struct paramed_type *T);
+void store_ds_constructor_input_media_photo (struct tl_ds_input_media *D, struct paramed_type *T);
+void store_ds_constructor_input_media_geo_point (struct tl_ds_input_media *D, struct paramed_type *T);
+void store_ds_constructor_input_media_contact (struct tl_ds_input_media *D, struct paramed_type *T);
+void store_ds_constructor_input_media_uploaded_video (struct tl_ds_input_media *D, struct paramed_type *T);
+void store_ds_constructor_input_media_uploaded_thumb_video (struct tl_ds_input_media *D, struct paramed_type *T);
+void store_ds_constructor_input_media_video (struct tl_ds_input_media *D, struct paramed_type *T);
+void store_ds_constructor_input_media_uploaded_audio (struct tl_ds_input_media *D, struct paramed_type *T);
+void store_ds_constructor_input_media_audio (struct tl_ds_input_media *D, struct paramed_type *T);
+void store_ds_constructor_input_media_uploaded_document (struct tl_ds_input_media *D, struct paramed_type *T);
+void store_ds_constructor_input_media_uploaded_thumb_document (struct tl_ds_input_media *D, struct paramed_type *T);
+void store_ds_constructor_input_media_document (struct tl_ds_input_media *D, struct paramed_type *T);
+void store_ds_constructor_input_media_venue (struct tl_ds_input_media *D, struct paramed_type *T);
+void store_ds_constructor_input_notify_peer (struct tl_ds_input_notify_peer *D, struct paramed_type *T);
+void store_ds_constructor_input_notify_users (struct tl_ds_input_notify_peer *D, struct paramed_type *T);
+void store_ds_constructor_input_notify_chats (struct tl_ds_input_notify_peer *D, struct paramed_type *T);
+void store_ds_constructor_input_notify_all (struct tl_ds_input_notify_peer *D, struct paramed_type *T);
+void store_ds_constructor_input_notify_geo_chat_peer (struct tl_ds_input_notify_peer *D, struct paramed_type *T);
+void store_ds_constructor_input_peer_empty (struct tl_ds_input_peer *D, struct paramed_type *T);
+void store_ds_constructor_input_peer_self (struct tl_ds_input_peer *D, struct paramed_type *T);
+void store_ds_constructor_input_peer_contact (struct tl_ds_input_peer *D, struct paramed_type *T);
+void store_ds_constructor_input_peer_foreign (struct tl_ds_input_peer *D, struct paramed_type *T);
+void store_ds_constructor_input_peer_chat (struct tl_ds_input_peer *D, struct paramed_type *T);
+void store_ds_constructor_input_peer_notify_events_empty (struct tl_ds_input_peer_notify_events *D, struct paramed_type *T);
+void store_ds_constructor_input_peer_notify_events_all (struct tl_ds_input_peer_notify_events *D, struct paramed_type *T);
+void store_ds_constructor_input_peer_notify_settings (struct tl_ds_input_peer_notify_settings *D, struct paramed_type *T);
+void store_ds_constructor_input_photo_empty (struct tl_ds_input_photo *D, struct paramed_type *T);
+void store_ds_constructor_input_photo (struct tl_ds_input_photo *D, struct paramed_type *T);
+void store_ds_constructor_input_photo_crop_auto (struct tl_ds_input_photo_crop *D, struct paramed_type *T);
+void store_ds_constructor_input_photo_crop (struct tl_ds_input_photo_crop *D, struct paramed_type *T);
+void store_ds_constructor_input_privacy_key_status_timestamp (struct tl_ds_input_privacy_key *D, struct paramed_type *T);
+void store_ds_constructor_input_privacy_value_allow_contacts (struct tl_ds_input_privacy_rule *D, struct paramed_type *T);
+void store_ds_constructor_input_privacy_value_allow_all (struct tl_ds_input_privacy_rule *D, struct paramed_type *T);
+void store_ds_constructor_input_privacy_value_allow_users (struct tl_ds_input_privacy_rule *D, struct paramed_type *T);
+void store_ds_constructor_input_privacy_value_disallow_contacts (struct tl_ds_input_privacy_rule *D, struct paramed_type *T);
+void store_ds_constructor_input_privacy_value_disallow_all (struct tl_ds_input_privacy_rule *D, struct paramed_type *T);
+void store_ds_constructor_input_privacy_value_disallow_users (struct tl_ds_input_privacy_rule *D, struct paramed_type *T);
+void store_ds_constructor_input_sticker_set_empty (struct tl_ds_input_sticker_set *D, struct paramed_type *T);
+void store_ds_constructor_input_sticker_set_i_d (struct tl_ds_input_sticker_set *D, struct paramed_type *T);
+void store_ds_constructor_input_sticker_set_short_name (struct tl_ds_input_sticker_set *D, struct paramed_type *T);
+void store_ds_constructor_input_user_empty (struct tl_ds_input_user *D, struct paramed_type *T);
+void store_ds_constructor_input_user_self (struct tl_ds_input_user *D, struct paramed_type *T);
+void store_ds_constructor_input_user_contact (struct tl_ds_input_user *D, struct paramed_type *T);
+void store_ds_constructor_input_user_foreign (struct tl_ds_input_user *D, struct paramed_type *T);
+void store_ds_constructor_input_video_empty (struct tl_ds_input_video *D, struct paramed_type *T);
+void store_ds_constructor_input_video (struct tl_ds_input_video *D, struct paramed_type *T);
+void store_ds_constructor_int (int *D, struct paramed_type *T);
+void store_ds_constructor_int128 (struct tl_ds_int128 *D, struct paramed_type *T);
+void store_ds_constructor_int256 (struct tl_ds_int256 *D, struct paramed_type *T);
+void store_ds_constructor_keyboard_button (struct tl_ds_keyboard_button *D, struct paramed_type *T);
+void store_ds_constructor_keyboard_button_row (struct tl_ds_keyboard_button_row *D, struct paramed_type *T);
+void store_ds_constructor_long (long long *D, struct paramed_type *T);
+void store_ds_constructor_message_empty (struct tl_ds_message *D, struct paramed_type *T);
+void store_ds_constructor_message (struct tl_ds_message *D, struct paramed_type *T);
+void store_ds_constructor_message_service (struct tl_ds_message *D, struct paramed_type *T);
+void store_ds_constructor_message_action_empty (struct tl_ds_message_action *D, struct paramed_type *T);
+void store_ds_constructor_message_action_chat_create (struct tl_ds_message_action *D, struct paramed_type *T);
+void store_ds_constructor_message_action_chat_edit_title (struct tl_ds_message_action *D, struct paramed_type *T);
+void store_ds_constructor_message_action_chat_edit_photo (struct tl_ds_message_action *D, struct paramed_type *T);
+void store_ds_constructor_message_action_chat_delete_photo (struct tl_ds_message_action *D, struct paramed_type *T);
+void store_ds_constructor_message_action_chat_add_user (struct tl_ds_message_action *D, struct paramed_type *T);
+void store_ds_constructor_message_action_chat_delete_user (struct tl_ds_message_action *D, struct paramed_type *T);
+void store_ds_constructor_message_action_geo_chat_create (struct tl_ds_message_action *D, struct paramed_type *T);
+void store_ds_constructor_message_action_geo_chat_checkin (struct tl_ds_message_action *D, struct paramed_type *T);
+void store_ds_constructor_message_action_chat_joined_by_link (struct tl_ds_message_action *D, struct paramed_type *T);
+void store_ds_constructor_message_media_empty (struct tl_ds_message_media *D, struct paramed_type *T);
+void store_ds_constructor_message_media_photo (struct tl_ds_message_media *D, struct paramed_type *T);
+void store_ds_constructor_message_media_video (struct tl_ds_message_media *D, struct paramed_type *T);
+void store_ds_constructor_message_media_geo (struct tl_ds_message_media *D, struct paramed_type *T);
+void store_ds_constructor_message_media_contact (struct tl_ds_message_media *D, struct paramed_type *T);
+void store_ds_constructor_message_media_unsupported (struct tl_ds_message_media *D, struct paramed_type *T);
+void store_ds_constructor_message_media_document (struct tl_ds_message_media *D, struct paramed_type *T);
+void store_ds_constructor_message_media_audio (struct tl_ds_message_media *D, struct paramed_type *T);
+void store_ds_constructor_message_media_web_page (struct tl_ds_message_media *D, struct paramed_type *T);
+void store_ds_constructor_message_media_venue (struct tl_ds_message_media *D, struct paramed_type *T);
+void store_ds_constructor_message_media_photo_l27 (struct tl_ds_message_media *D, struct paramed_type *T);
+void store_ds_constructor_message_media_video_l27 (struct tl_ds_message_media *D, struct paramed_type *T);
+void store_ds_constructor_input_messages_filter_empty (struct tl_ds_messages_filter *D, struct paramed_type *T);
+void store_ds_constructor_input_messages_filter_photos (struct tl_ds_messages_filter *D, struct paramed_type *T);
+void store_ds_constructor_input_messages_filter_video (struct tl_ds_messages_filter *D, struct paramed_type *T);
+void store_ds_constructor_input_messages_filter_photo_video (struct tl_ds_messages_filter *D, struct paramed_type *T);
+void store_ds_constructor_input_messages_filter_photo_video_documents (struct tl_ds_messages_filter *D, struct paramed_type *T);
+void store_ds_constructor_input_messages_filter_document (struct tl_ds_messages_filter *D, struct paramed_type *T);
+void store_ds_constructor_input_messages_filter_audio (struct tl_ds_messages_filter *D, struct paramed_type *T);
+void store_ds_constructor_nearest_dc (struct tl_ds_nearest_dc *D, struct paramed_type *T);
+void store_ds_constructor_notify_peer (struct tl_ds_notify_peer *D, struct paramed_type *T);
+void store_ds_constructor_notify_users (struct tl_ds_notify_peer *D, struct paramed_type *T);
+void store_ds_constructor_notify_chats (struct tl_ds_notify_peer *D, struct paramed_type *T);
+void store_ds_constructor_notify_all (struct tl_ds_notify_peer *D, struct paramed_type *T);
+void store_ds_constructor_null (struct tl_ds_null *D, struct paramed_type *T);
+void store_ds_constructor_p_q_inner_data (struct tl_ds_p_q_inner_data *D, struct paramed_type *T);
+void store_ds_constructor_p_q_inner_data_temp (struct tl_ds_p_q_inner_data *D, struct paramed_type *T);
+void store_ds_constructor_peer_user (struct tl_ds_peer *D, struct paramed_type *T);
+void store_ds_constructor_peer_chat (struct tl_ds_peer *D, struct paramed_type *T);
+void store_ds_constructor_peer_notify_events_empty (struct tl_ds_peer_notify_events *D, struct paramed_type *T);
+void store_ds_constructor_peer_notify_events_all (struct tl_ds_peer_notify_events *D, struct paramed_type *T);
+void store_ds_constructor_peer_notify_settings_empty (struct tl_ds_peer_notify_settings *D, struct paramed_type *T);
+void store_ds_constructor_peer_notify_settings (struct tl_ds_peer_notify_settings *D, struct paramed_type *T);
+void store_ds_constructor_photo_empty (struct tl_ds_photo *D, struct paramed_type *T);
+void store_ds_constructor_photo (struct tl_ds_photo *D, struct paramed_type *T);
+void store_ds_constructor_photo_l27 (struct tl_ds_photo *D, struct paramed_type *T);
+void store_ds_constructor_photo_size_empty (struct tl_ds_photo_size *D, struct paramed_type *T);
+void store_ds_constructor_photo_size (struct tl_ds_photo_size *D, struct paramed_type *T);
+void store_ds_constructor_photo_cached_size (struct tl_ds_photo_size *D, struct paramed_type *T);
+void store_ds_constructor_privacy_key_status_timestamp (struct tl_ds_privacy_key *D, struct paramed_type *T);
+void store_ds_constructor_privacy_value_allow_contacts (struct tl_ds_privacy_rule *D, struct paramed_type *T);
+void store_ds_constructor_privacy_value_allow_all (struct tl_ds_privacy_rule *D, struct paramed_type *T);
+void store_ds_constructor_privacy_value_allow_users (struct tl_ds_privacy_rule *D, struct paramed_type *T);
+void store_ds_constructor_privacy_value_disallow_contacts (struct tl_ds_privacy_rule *D, struct paramed_type *T);
+void store_ds_constructor_privacy_value_disallow_all (struct tl_ds_privacy_rule *D, struct paramed_type *T);
+void store_ds_constructor_privacy_value_disallow_users (struct tl_ds_privacy_rule *D, struct paramed_type *T);
+void store_ds_constructor_received_notify_message (struct tl_ds_received_notify_message *D, struct paramed_type *T);
+void store_ds_constructor_reply_keyboard_hide (struct tl_ds_reply_markup *D, struct paramed_type *T);
+void store_ds_constructor_reply_keyboard_force_reply (struct tl_ds_reply_markup *D, struct paramed_type *T);
+void store_ds_constructor_reply_keyboard_markup (struct tl_ds_reply_markup *D, struct paramed_type *T);
+void store_ds_constructor_res_p_q (struct tl_ds_res_p_q *D, struct paramed_type *T);
+void store_ds_constructor_send_message_typing_action (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void store_ds_constructor_send_message_cancel_action (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void store_ds_constructor_send_message_record_video_action (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void store_ds_constructor_send_message_upload_video_action_l27 (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void store_ds_constructor_send_message_upload_video_action (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void store_ds_constructor_send_message_record_audio_action (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void store_ds_constructor_send_message_upload_audio_action_l27 (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void store_ds_constructor_send_message_upload_audio_action (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void store_ds_constructor_send_message_upload_photo_action (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void store_ds_constructor_send_message_upload_document_action_l27 (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void store_ds_constructor_send_message_upload_document_action (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void store_ds_constructor_send_message_geo_location_action (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void store_ds_constructor_send_message_choose_contact_action (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void store_ds_constructor_server_d_h_params_fail (struct tl_ds_server_d_h_params *D, struct paramed_type *T);
+void store_ds_constructor_server_d_h_params_ok (struct tl_ds_server_d_h_params *D, struct paramed_type *T);
+void store_ds_constructor_server_d_h_inner_data (struct tl_ds_server_d_h_inner_data *D, struct paramed_type *T);
+void store_ds_constructor_dh_gen_ok (struct tl_ds_set_client_d_h_params_answer *D, struct paramed_type *T);
+void store_ds_constructor_dh_gen_retry (struct tl_ds_set_client_d_h_params_answer *D, struct paramed_type *T);
+void store_ds_constructor_dh_gen_fail (struct tl_ds_set_client_d_h_params_answer *D, struct paramed_type *T);
+void store_ds_constructor_sticker_pack (struct tl_ds_sticker_pack *D, struct paramed_type *T);
+void store_ds_constructor_sticker_set (struct tl_ds_sticker_set *D, struct paramed_type *T);
+void store_ds_constructor_string (struct tl_ds_string *D, struct paramed_type *T);
+void store_ds_constructor_update_new_message (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_message_i_d (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_delete_messages (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_user_typing (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_chat_user_typing (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_chat_participants (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_user_status (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_user_name (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_user_photo (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_contact_registered (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_contact_link (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_new_authorization (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_new_geo_chat_message (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_new_encrypted_message (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_encrypted_chat_typing (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_encryption (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_encrypted_messages_read (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_chat_participant_add (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_chat_participant_delete (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_dc_options (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_user_blocked (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_notify_settings (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_service_notification (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_privacy (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_user_phone (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_read_history_inbox (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_read_history_outbox (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_web_page (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_read_messages_contents (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_update_msg_update (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_constructor_updates_too_long (struct tl_ds_updates *D, struct paramed_type *T);
+void store_ds_constructor_update_short_message (struct tl_ds_updates *D, struct paramed_type *T);
+void store_ds_constructor_update_short_chat_message (struct tl_ds_updates *D, struct paramed_type *T);
+void store_ds_constructor_update_short (struct tl_ds_updates *D, struct paramed_type *T);
+void store_ds_constructor_updates_combined (struct tl_ds_updates *D, struct paramed_type *T);
+void store_ds_constructor_updates (struct tl_ds_updates *D, struct paramed_type *T);
+void store_ds_constructor_user_empty (struct tl_ds_user *D, struct paramed_type *T);
+void store_ds_constructor_user (struct tl_ds_user *D, struct paramed_type *T);
+void store_ds_constructor_user_full (struct tl_ds_user_full *D, struct paramed_type *T);
+void store_ds_constructor_user_profile_photo_empty (struct tl_ds_user_profile_photo *D, struct paramed_type *T);
+void store_ds_constructor_user_profile_photo (struct tl_ds_user_profile_photo *D, struct paramed_type *T);
+void store_ds_constructor_user_status_empty (struct tl_ds_user_status *D, struct paramed_type *T);
+void store_ds_constructor_user_status_online (struct tl_ds_user_status *D, struct paramed_type *T);
+void store_ds_constructor_user_status_offline (struct tl_ds_user_status *D, struct paramed_type *T);
+void store_ds_constructor_user_status_recently (struct tl_ds_user_status *D, struct paramed_type *T);
+void store_ds_constructor_user_status_last_week (struct tl_ds_user_status *D, struct paramed_type *T);
+void store_ds_constructor_user_status_last_month (struct tl_ds_user_status *D, struct paramed_type *T);
+void store_ds_constructor_vector (struct tl_ds_vector *D, struct paramed_type *T);
+void store_ds_constructor_video_empty (struct tl_ds_video *D, struct paramed_type *T);
+void store_ds_constructor_video (struct tl_ds_video *D, struct paramed_type *T);
+void store_ds_constructor_video_l27 (struct tl_ds_video *D, struct paramed_type *T);
+void store_ds_constructor_wall_paper (struct tl_ds_wall_paper *D, struct paramed_type *T);
+void store_ds_constructor_wall_paper_solid (struct tl_ds_wall_paper *D, struct paramed_type *T);
+void store_ds_constructor_web_page_empty (struct tl_ds_web_page *D, struct paramed_type *T);
+void store_ds_constructor_web_page_pending (struct tl_ds_web_page *D, struct paramed_type *T);
+void store_ds_constructor_web_page (struct tl_ds_web_page *D, struct paramed_type *T);
+void store_ds_constructor_account_authorizations (struct tl_ds_account_authorizations *D, struct paramed_type *T);
+void store_ds_constructor_account_no_password (struct tl_ds_account_password *D, struct paramed_type *T);
+void store_ds_constructor_account_password (struct tl_ds_account_password *D, struct paramed_type *T);
+void store_ds_constructor_account_password_input_settings (struct tl_ds_account_password_input_settings *D, struct paramed_type *T);
+void store_ds_constructor_account_password_settings (struct tl_ds_account_password_settings *D, struct paramed_type *T);
+void store_ds_constructor_account_privacy_rules (struct tl_ds_account_privacy_rules *D, struct paramed_type *T);
+void store_ds_constructor_account_sent_change_phone_code (struct tl_ds_account_sent_change_phone_code *D, struct paramed_type *T);
+void store_ds_constructor_auth_authorization (struct tl_ds_auth_authorization *D, struct paramed_type *T);
+void store_ds_constructor_auth_checked_phone (struct tl_ds_auth_checked_phone *D, struct paramed_type *T);
+void store_ds_constructor_auth_exported_authorization (struct tl_ds_auth_exported_authorization *D, struct paramed_type *T);
+void store_ds_constructor_auth_password_recovery (struct tl_ds_auth_password_recovery *D, struct paramed_type *T);
+void store_ds_constructor_auth_sent_code (struct tl_ds_auth_sent_code *D, struct paramed_type *T);
+void store_ds_constructor_auth_sent_app_code (struct tl_ds_auth_sent_code *D, struct paramed_type *T);
+void store_ds_constructor_binlog_encr_key (struct tl_ds_binlog_encr_key *D, struct paramed_type *T);
+void store_ds_constructor_binlog_start (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void store_ds_constructor_binlog_dc_option (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void store_ds_constructor_binlog_dc_option_new (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void store_ds_constructor_binlog_auth_key (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void store_ds_constructor_binlog_default_dc (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void store_ds_constructor_binlog_dc_signed (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void store_ds_constructor_binlog_our_id (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void store_ds_constructor_binlog_set_dh_params (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void store_ds_constructor_binlog_set_pts (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void store_ds_constructor_binlog_set_qts (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void store_ds_constructor_binlog_set_date (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void store_ds_constructor_binlog_set_seq (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void store_ds_constructor_binlog_encr_chat_delete (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void store_ds_constructor_binlog_encr_chat_new (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void store_ds_constructor_binlog_encr_chat_exchange_new (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void store_ds_constructor_binlog_user_delete (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void store_ds_constructor_binlog_user_new (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void store_ds_constructor_binlog_chat_new (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void store_ds_constructor_binlog_chat_add_participant (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void store_ds_constructor_binlog_chat_del_participant (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void store_ds_constructor_binlog_set_msg_id (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void store_ds_constructor_binlog_message_delete (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void store_ds_constructor_binlog_message_new (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void store_ds_constructor_binlog_message_encr_new (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void store_ds_constructor_binlog_msg_update (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void store_ds_constructor_binlog_reset_authorization (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void store_ds_constructor_contacts_blocked (struct tl_ds_contacts_blocked *D, struct paramed_type *T);
+void store_ds_constructor_contacts_blocked_slice (struct tl_ds_contacts_blocked *D, struct paramed_type *T);
+void store_ds_constructor_contacts_contacts_not_modified (struct tl_ds_contacts_contacts *D, struct paramed_type *T);
+void store_ds_constructor_contacts_contacts (struct tl_ds_contacts_contacts *D, struct paramed_type *T);
+void store_ds_constructor_contacts_found (struct tl_ds_contacts_found *D, struct paramed_type *T);
+void store_ds_constructor_contacts_imported_contacts (struct tl_ds_contacts_imported_contacts *D, struct paramed_type *T);
+void store_ds_constructor_contacts_link (struct tl_ds_contacts_link *D, struct paramed_type *T);
+void store_ds_constructor_contacts_suggested (struct tl_ds_contacts_suggested *D, struct paramed_type *T);
+void store_ds_constructor_geochats_located (struct tl_ds_geochats_located *D, struct paramed_type *T);
+void store_ds_constructor_geochats_messages (struct tl_ds_geochats_messages *D, struct paramed_type *T);
+void store_ds_constructor_geochats_messages_slice (struct tl_ds_geochats_messages *D, struct paramed_type *T);
+void store_ds_constructor_geochats_stated_message (struct tl_ds_geochats_stated_message *D, struct paramed_type *T);
+void store_ds_constructor_help_app_update (struct tl_ds_help_app_update *D, struct paramed_type *T);
+void store_ds_constructor_help_no_app_update (struct tl_ds_help_app_update *D, struct paramed_type *T);
+void store_ds_constructor_help_invite_text (struct tl_ds_help_invite_text *D, struct paramed_type *T);
+void store_ds_constructor_help_support (struct tl_ds_help_support *D, struct paramed_type *T);
+void store_ds_constructor_messages_affected_history (struct tl_ds_messages_affected_history *D, struct paramed_type *T);
+void store_ds_constructor_messages_affected_messages (struct tl_ds_messages_affected_messages *D, struct paramed_type *T);
+void store_ds_constructor_messages_all_stickers_not_modified (struct tl_ds_messages_all_stickers *D, struct paramed_type *T);
+void store_ds_constructor_messages_all_stickers (struct tl_ds_messages_all_stickers *D, struct paramed_type *T);
+void store_ds_constructor_messages_chat_full (struct tl_ds_messages_chat_full *D, struct paramed_type *T);
+void store_ds_constructor_messages_chats (struct tl_ds_messages_chats *D, struct paramed_type *T);
+void store_ds_constructor_messages_dh_config_not_modified (struct tl_ds_messages_dh_config *D, struct paramed_type *T);
+void store_ds_constructor_messages_dh_config (struct tl_ds_messages_dh_config *D, struct paramed_type *T);
+void store_ds_constructor_messages_dialogs (struct tl_ds_messages_dialogs *D, struct paramed_type *T);
+void store_ds_constructor_messages_dialogs_slice (struct tl_ds_messages_dialogs *D, struct paramed_type *T);
+void store_ds_constructor_messages_message_empty (struct tl_ds_messages_message *D, struct paramed_type *T);
+void store_ds_constructor_messages_messages (struct tl_ds_messages_messages *D, struct paramed_type *T);
+void store_ds_constructor_messages_messages_slice (struct tl_ds_messages_messages *D, struct paramed_type *T);
+void store_ds_constructor_messages_sent_encrypted_message (struct tl_ds_messages_sent_encrypted_message *D, struct paramed_type *T);
+void store_ds_constructor_messages_sent_encrypted_file (struct tl_ds_messages_sent_encrypted_message *D, struct paramed_type *T);
+void store_ds_constructor_messages_sent_message (struct tl_ds_messages_sent_message *D, struct paramed_type *T);
+void store_ds_constructor_messages_sent_message_link (struct tl_ds_messages_sent_message *D, struct paramed_type *T);
+void store_ds_constructor_messages_sticker_set (struct tl_ds_messages_sticker_set *D, struct paramed_type *T);
+void store_ds_constructor_messages_stickers_not_modified (struct tl_ds_messages_stickers *D, struct paramed_type *T);
+void store_ds_constructor_messages_stickers (struct tl_ds_messages_stickers *D, struct paramed_type *T);
+void store_ds_constructor_photos_photo (struct tl_ds_photos_photo *D, struct paramed_type *T);
+void store_ds_constructor_photos_photos (struct tl_ds_photos_photos *D, struct paramed_type *T);
+void store_ds_constructor_photos_photos_slice (struct tl_ds_photos_photos *D, struct paramed_type *T);
+void store_ds_constructor_storage_file_unknown (struct tl_ds_storage_file_type *D, struct paramed_type *T);
+void store_ds_constructor_storage_file_jpeg (struct tl_ds_storage_file_type *D, struct paramed_type *T);
+void store_ds_constructor_storage_file_gif (struct tl_ds_storage_file_type *D, struct paramed_type *T);
+void store_ds_constructor_storage_file_png (struct tl_ds_storage_file_type *D, struct paramed_type *T);
+void store_ds_constructor_storage_file_pdf (struct tl_ds_storage_file_type *D, struct paramed_type *T);
+void store_ds_constructor_storage_file_mp3 (struct tl_ds_storage_file_type *D, struct paramed_type *T);
+void store_ds_constructor_storage_file_mov (struct tl_ds_storage_file_type *D, struct paramed_type *T);
+void store_ds_constructor_storage_file_partial (struct tl_ds_storage_file_type *D, struct paramed_type *T);
+void store_ds_constructor_storage_file_mp4 (struct tl_ds_storage_file_type *D, struct paramed_type *T);
+void store_ds_constructor_storage_file_webp (struct tl_ds_storage_file_type *D, struct paramed_type *T);
+void store_ds_constructor_updates_difference_empty (struct tl_ds_updates_difference *D, struct paramed_type *T);
+void store_ds_constructor_updates_difference (struct tl_ds_updates_difference *D, struct paramed_type *T);
+void store_ds_constructor_updates_difference_slice (struct tl_ds_updates_difference *D, struct paramed_type *T);
+void store_ds_constructor_updates_state (struct tl_ds_updates_state *D, struct paramed_type *T);
+void store_ds_constructor_upload_file (struct tl_ds_upload_file *D, struct paramed_type *T);
+void store_ds_type_account_days_t_t_l (struct tl_ds_account_days_t_t_l *D, struct paramed_type *T);
+void store_ds_type_bare_account_days_t_t_l (struct tl_ds_account_days_t_t_l *D, struct paramed_type *T);
+void store_ds_type_audio (struct tl_ds_audio *D, struct paramed_type *T);
+void store_ds_type_bare_audio (struct tl_ds_audio *D, struct paramed_type *T);
+void store_ds_type_authorization (struct tl_ds_authorization *D, struct paramed_type *T);
+void store_ds_type_bare_authorization (struct tl_ds_authorization *D, struct paramed_type *T);
+void store_ds_type_bool (struct tl_ds_bool *D, struct paramed_type *T);
+void store_ds_type_bare_bool (struct tl_ds_bool *D, struct paramed_type *T);
+void store_ds_type_bot_command (struct tl_ds_bot_command *D, struct paramed_type *T);
+void store_ds_type_bare_bot_command (struct tl_ds_bot_command *D, struct paramed_type *T);
+void store_ds_type_bot_info (struct tl_ds_bot_info *D, struct paramed_type *T);
+void store_ds_type_bare_bot_info (struct tl_ds_bot_info *D, struct paramed_type *T);
+void store_ds_type_bytes (struct tl_ds_string *D, struct paramed_type *T);
+void store_ds_type_bare_bytes (struct tl_ds_string *D, struct paramed_type *T);
+void store_ds_type_chat (struct tl_ds_chat *D, struct paramed_type *T);
+void store_ds_type_bare_chat (struct tl_ds_chat *D, struct paramed_type *T);
+void store_ds_type_chat_full (struct tl_ds_chat_full *D, struct paramed_type *T);
+void store_ds_type_bare_chat_full (struct tl_ds_chat_full *D, struct paramed_type *T);
+void store_ds_type_chat_invite (struct tl_ds_chat_invite *D, struct paramed_type *T);
+void store_ds_type_bare_chat_invite (struct tl_ds_chat_invite *D, struct paramed_type *T);
+void store_ds_type_chat_located (struct tl_ds_chat_located *D, struct paramed_type *T);
+void store_ds_type_bare_chat_located (struct tl_ds_chat_located *D, struct paramed_type *T);
+void store_ds_type_chat_participant (struct tl_ds_chat_participant *D, struct paramed_type *T);
+void store_ds_type_bare_chat_participant (struct tl_ds_chat_participant *D, struct paramed_type *T);
+void store_ds_type_chat_participants (struct tl_ds_chat_participants *D, struct paramed_type *T);
+void store_ds_type_bare_chat_participants (struct tl_ds_chat_participants *D, struct paramed_type *T);
+void store_ds_type_chat_photo (struct tl_ds_chat_photo *D, struct paramed_type *T);
+void store_ds_type_bare_chat_photo (struct tl_ds_chat_photo *D, struct paramed_type *T);
+void store_ds_type_client_d_h_inner_data (struct tl_ds_client_d_h_inner_data *D, struct paramed_type *T);
+void store_ds_type_bare_client_d_h_inner_data (struct tl_ds_client_d_h_inner_data *D, struct paramed_type *T);
+void store_ds_type_config (struct tl_ds_config *D, struct paramed_type *T);
+void store_ds_type_bare_config (struct tl_ds_config *D, struct paramed_type *T);
+void store_ds_type_contact (struct tl_ds_contact *D, struct paramed_type *T);
+void store_ds_type_bare_contact (struct tl_ds_contact *D, struct paramed_type *T);
+void store_ds_type_contact_blocked (struct tl_ds_contact_blocked *D, struct paramed_type *T);
+void store_ds_type_bare_contact_blocked (struct tl_ds_contact_blocked *D, struct paramed_type *T);
+void store_ds_type_contact_found (struct tl_ds_contact_found *D, struct paramed_type *T);
+void store_ds_type_bare_contact_found (struct tl_ds_contact_found *D, struct paramed_type *T);
+void store_ds_type_contact_link (struct tl_ds_contact_link *D, struct paramed_type *T);
+void store_ds_type_bare_contact_link (struct tl_ds_contact_link *D, struct paramed_type *T);
+void store_ds_type_contact_status (struct tl_ds_contact_status *D, struct paramed_type *T);
+void store_ds_type_bare_contact_status (struct tl_ds_contact_status *D, struct paramed_type *T);
+void store_ds_type_contact_suggested (struct tl_ds_contact_suggested *D, struct paramed_type *T);
+void store_ds_type_bare_contact_suggested (struct tl_ds_contact_suggested *D, struct paramed_type *T);
+void store_ds_type_dc_option (struct tl_ds_dc_option *D, struct paramed_type *T);
+void store_ds_type_bare_dc_option (struct tl_ds_dc_option *D, struct paramed_type *T);
+void store_ds_type_decrypted_message (struct tl_ds_decrypted_message *D, struct paramed_type *T);
+void store_ds_type_bare_decrypted_message (struct tl_ds_decrypted_message *D, struct paramed_type *T);
+void store_ds_type_decrypted_message_action (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void store_ds_type_bare_decrypted_message_action (struct tl_ds_decrypted_message_action *D, struct paramed_type *T);
+void store_ds_type_decrypted_message_layer (struct tl_ds_decrypted_message_layer *D, struct paramed_type *T);
+void store_ds_type_bare_decrypted_message_layer (struct tl_ds_decrypted_message_layer *D, struct paramed_type *T);
+void store_ds_type_decrypted_message_media (struct tl_ds_decrypted_message_media *D, struct paramed_type *T);
+void store_ds_type_bare_decrypted_message_media (struct tl_ds_decrypted_message_media *D, struct paramed_type *T);
+void store_ds_type_dialog (struct tl_ds_dialog *D, struct paramed_type *T);
+void store_ds_type_bare_dialog (struct tl_ds_dialog *D, struct paramed_type *T);
+void store_ds_type_disabled_feature (struct tl_ds_disabled_feature *D, struct paramed_type *T);
+void store_ds_type_bare_disabled_feature (struct tl_ds_disabled_feature *D, struct paramed_type *T);
+void store_ds_type_document (struct tl_ds_document *D, struct paramed_type *T);
+void store_ds_type_bare_document (struct tl_ds_document *D, struct paramed_type *T);
+void store_ds_type_document_attribute (struct tl_ds_document_attribute *D, struct paramed_type *T);
+void store_ds_type_bare_document_attribute (struct tl_ds_document_attribute *D, struct paramed_type *T);
+void store_ds_type_double (double *D, struct paramed_type *T);
+void store_ds_type_bare_double (double *D, struct paramed_type *T);
+void store_ds_type_encrypted_chat (struct tl_ds_encrypted_chat *D, struct paramed_type *T);
+void store_ds_type_bare_encrypted_chat (struct tl_ds_encrypted_chat *D, struct paramed_type *T);
+void store_ds_type_encrypted_file (struct tl_ds_encrypted_file *D, struct paramed_type *T);
+void store_ds_type_bare_encrypted_file (struct tl_ds_encrypted_file *D, struct paramed_type *T);
+void store_ds_type_encrypted_message (struct tl_ds_encrypted_message *D, struct paramed_type *T);
+void store_ds_type_bare_encrypted_message (struct tl_ds_encrypted_message *D, struct paramed_type *T);
+void store_ds_type_error (struct tl_ds_error *D, struct paramed_type *T);
+void store_ds_type_bare_error (struct tl_ds_error *D, struct paramed_type *T);
+void store_ds_type_exported_chat_invite (struct tl_ds_exported_chat_invite *D, struct paramed_type *T);
+void store_ds_type_bare_exported_chat_invite (struct tl_ds_exported_chat_invite *D, struct paramed_type *T);
+void store_ds_type_file_location (struct tl_ds_file_location *D, struct paramed_type *T);
+void store_ds_type_bare_file_location (struct tl_ds_file_location *D, struct paramed_type *T);
+void store_ds_type_geo_chat_message (struct tl_ds_geo_chat_message *D, struct paramed_type *T);
+void store_ds_type_bare_geo_chat_message (struct tl_ds_geo_chat_message *D, struct paramed_type *T);
+void store_ds_type_geo_point (struct tl_ds_geo_point *D, struct paramed_type *T);
+void store_ds_type_bare_geo_point (struct tl_ds_geo_point *D, struct paramed_type *T);
+void store_ds_type_imported_contact (struct tl_ds_imported_contact *D, struct paramed_type *T);
+void store_ds_type_bare_imported_contact (struct tl_ds_imported_contact *D, struct paramed_type *T);
+void store_ds_type_input_app_event (struct tl_ds_input_app_event *D, struct paramed_type *T);
+void store_ds_type_bare_input_app_event (struct tl_ds_input_app_event *D, struct paramed_type *T);
+void store_ds_type_input_audio (struct tl_ds_input_audio *D, struct paramed_type *T);
+void store_ds_type_bare_input_audio (struct tl_ds_input_audio *D, struct paramed_type *T);
+void store_ds_type_input_chat_photo (struct tl_ds_input_chat_photo *D, struct paramed_type *T);
+void store_ds_type_bare_input_chat_photo (struct tl_ds_input_chat_photo *D, struct paramed_type *T);
+void store_ds_type_input_contact (struct tl_ds_input_contact *D, struct paramed_type *T);
+void store_ds_type_bare_input_contact (struct tl_ds_input_contact *D, struct paramed_type *T);
+void store_ds_type_input_document (struct tl_ds_input_document *D, struct paramed_type *T);
+void store_ds_type_bare_input_document (struct tl_ds_input_document *D, struct paramed_type *T);
+void store_ds_type_input_encrypted_chat (struct tl_ds_input_encrypted_chat *D, struct paramed_type *T);
+void store_ds_type_bare_input_encrypted_chat (struct tl_ds_input_encrypted_chat *D, struct paramed_type *T);
+void store_ds_type_input_encrypted_file (struct tl_ds_input_encrypted_file *D, struct paramed_type *T);
+void store_ds_type_bare_input_encrypted_file (struct tl_ds_input_encrypted_file *D, struct paramed_type *T);
+void store_ds_type_input_file (struct tl_ds_input_file *D, struct paramed_type *T);
+void store_ds_type_bare_input_file (struct tl_ds_input_file *D, struct paramed_type *T);
+void store_ds_type_input_file_location (struct tl_ds_input_file_location *D, struct paramed_type *T);
+void store_ds_type_bare_input_file_location (struct tl_ds_input_file_location *D, struct paramed_type *T);
+void store_ds_type_input_geo_chat (struct tl_ds_input_geo_chat *D, struct paramed_type *T);
+void store_ds_type_bare_input_geo_chat (struct tl_ds_input_geo_chat *D, struct paramed_type *T);
+void store_ds_type_input_geo_point (struct tl_ds_input_geo_point *D, struct paramed_type *T);
+void store_ds_type_bare_input_geo_point (struct tl_ds_input_geo_point *D, struct paramed_type *T);
+void store_ds_type_input_media (struct tl_ds_input_media *D, struct paramed_type *T);
+void store_ds_type_bare_input_media (struct tl_ds_input_media *D, struct paramed_type *T);
+void store_ds_type_input_notify_peer (struct tl_ds_input_notify_peer *D, struct paramed_type *T);
+void store_ds_type_bare_input_notify_peer (struct tl_ds_input_notify_peer *D, struct paramed_type *T);
+void store_ds_type_input_peer (struct tl_ds_input_peer *D, struct paramed_type *T);
+void store_ds_type_bare_input_peer (struct tl_ds_input_peer *D, struct paramed_type *T);
+void store_ds_type_input_peer_notify_events (struct tl_ds_input_peer_notify_events *D, struct paramed_type *T);
+void store_ds_type_bare_input_peer_notify_events (struct tl_ds_input_peer_notify_events *D, struct paramed_type *T);
+void store_ds_type_input_peer_notify_settings (struct tl_ds_input_peer_notify_settings *D, struct paramed_type *T);
+void store_ds_type_bare_input_peer_notify_settings (struct tl_ds_input_peer_notify_settings *D, struct paramed_type *T);
+void store_ds_type_input_photo (struct tl_ds_input_photo *D, struct paramed_type *T);
+void store_ds_type_bare_input_photo (struct tl_ds_input_photo *D, struct paramed_type *T);
+void store_ds_type_input_photo_crop (struct tl_ds_input_photo_crop *D, struct paramed_type *T);
+void store_ds_type_bare_input_photo_crop (struct tl_ds_input_photo_crop *D, struct paramed_type *T);
+void store_ds_type_input_privacy_key (struct tl_ds_input_privacy_key *D, struct paramed_type *T);
+void store_ds_type_bare_input_privacy_key (struct tl_ds_input_privacy_key *D, struct paramed_type *T);
+void store_ds_type_input_privacy_rule (struct tl_ds_input_privacy_rule *D, struct paramed_type *T);
+void store_ds_type_bare_input_privacy_rule (struct tl_ds_input_privacy_rule *D, struct paramed_type *T);
+void store_ds_type_input_sticker_set (struct tl_ds_input_sticker_set *D, struct paramed_type *T);
+void store_ds_type_bare_input_sticker_set (struct tl_ds_input_sticker_set *D, struct paramed_type *T);
+void store_ds_type_input_user (struct tl_ds_input_user *D, struct paramed_type *T);
+void store_ds_type_bare_input_user (struct tl_ds_input_user *D, struct paramed_type *T);
+void store_ds_type_input_video (struct tl_ds_input_video *D, struct paramed_type *T);
+void store_ds_type_bare_input_video (struct tl_ds_input_video *D, struct paramed_type *T);
+void store_ds_type_int (int *D, struct paramed_type *T);
+void store_ds_type_bare_int (int *D, struct paramed_type *T);
+void store_ds_type_int128 (struct tl_ds_int128 *D, struct paramed_type *T);
+void store_ds_type_bare_int128 (struct tl_ds_int128 *D, struct paramed_type *T);
+void store_ds_type_int256 (struct tl_ds_int256 *D, struct paramed_type *T);
+void store_ds_type_bare_int256 (struct tl_ds_int256 *D, struct paramed_type *T);
+void store_ds_type_keyboard_button (struct tl_ds_keyboard_button *D, struct paramed_type *T);
+void store_ds_type_bare_keyboard_button (struct tl_ds_keyboard_button *D, struct paramed_type *T);
+void store_ds_type_keyboard_button_row (struct tl_ds_keyboard_button_row *D, struct paramed_type *T);
+void store_ds_type_bare_keyboard_button_row (struct tl_ds_keyboard_button_row *D, struct paramed_type *T);
+void store_ds_type_long (long long *D, struct paramed_type *T);
+void store_ds_type_bare_long (long long *D, struct paramed_type *T);
+void store_ds_type_message (struct tl_ds_message *D, struct paramed_type *T);
+void store_ds_type_bare_message (struct tl_ds_message *D, struct paramed_type *T);
+void store_ds_type_message_action (struct tl_ds_message_action *D, struct paramed_type *T);
+void store_ds_type_bare_message_action (struct tl_ds_message_action *D, struct paramed_type *T);
+void store_ds_type_message_media (struct tl_ds_message_media *D, struct paramed_type *T);
+void store_ds_type_bare_message_media (struct tl_ds_message_media *D, struct paramed_type *T);
+void store_ds_type_messages_filter (struct tl_ds_messages_filter *D, struct paramed_type *T);
+void store_ds_type_bare_messages_filter (struct tl_ds_messages_filter *D, struct paramed_type *T);
+void store_ds_type_nearest_dc (struct tl_ds_nearest_dc *D, struct paramed_type *T);
+void store_ds_type_bare_nearest_dc (struct tl_ds_nearest_dc *D, struct paramed_type *T);
+void store_ds_type_notify_peer (struct tl_ds_notify_peer *D, struct paramed_type *T);
+void store_ds_type_bare_notify_peer (struct tl_ds_notify_peer *D, struct paramed_type *T);
+void store_ds_type_null (struct tl_ds_null *D, struct paramed_type *T);
+void store_ds_type_bare_null (struct tl_ds_null *D, struct paramed_type *T);
+void store_ds_type_p_q_inner_data (struct tl_ds_p_q_inner_data *D, struct paramed_type *T);
+void store_ds_type_bare_p_q_inner_data (struct tl_ds_p_q_inner_data *D, struct paramed_type *T);
+void store_ds_type_peer (struct tl_ds_peer *D, struct paramed_type *T);
+void store_ds_type_bare_peer (struct tl_ds_peer *D, struct paramed_type *T);
+void store_ds_type_peer_notify_events (struct tl_ds_peer_notify_events *D, struct paramed_type *T);
+void store_ds_type_bare_peer_notify_events (struct tl_ds_peer_notify_events *D, struct paramed_type *T);
+void store_ds_type_peer_notify_settings (struct tl_ds_peer_notify_settings *D, struct paramed_type *T);
+void store_ds_type_bare_peer_notify_settings (struct tl_ds_peer_notify_settings *D, struct paramed_type *T);
+void store_ds_type_photo (struct tl_ds_photo *D, struct paramed_type *T);
+void store_ds_type_bare_photo (struct tl_ds_photo *D, struct paramed_type *T);
+void store_ds_type_photo_size (struct tl_ds_photo_size *D, struct paramed_type *T);
+void store_ds_type_bare_photo_size (struct tl_ds_photo_size *D, struct paramed_type *T);
+void store_ds_type_privacy_key (struct tl_ds_privacy_key *D, struct paramed_type *T);
+void store_ds_type_bare_privacy_key (struct tl_ds_privacy_key *D, struct paramed_type *T);
+void store_ds_type_privacy_rule (struct tl_ds_privacy_rule *D, struct paramed_type *T);
+void store_ds_type_bare_privacy_rule (struct tl_ds_privacy_rule *D, struct paramed_type *T);
+void store_ds_type_received_notify_message (struct tl_ds_received_notify_message *D, struct paramed_type *T);
+void store_ds_type_bare_received_notify_message (struct tl_ds_received_notify_message *D, struct paramed_type *T);
+void store_ds_type_reply_markup (struct tl_ds_reply_markup *D, struct paramed_type *T);
+void store_ds_type_bare_reply_markup (struct tl_ds_reply_markup *D, struct paramed_type *T);
+void store_ds_type_res_p_q (struct tl_ds_res_p_q *D, struct paramed_type *T);
+void store_ds_type_bare_res_p_q (struct tl_ds_res_p_q *D, struct paramed_type *T);
+void store_ds_type_send_message_action (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void store_ds_type_bare_send_message_action (struct tl_ds_send_message_action *D, struct paramed_type *T);
+void store_ds_type_server_d_h_params (struct tl_ds_server_d_h_params *D, struct paramed_type *T);
+void store_ds_type_bare_server_d_h_params (struct tl_ds_server_d_h_params *D, struct paramed_type *T);
+void store_ds_type_server_d_h_inner_data (struct tl_ds_server_d_h_inner_data *D, struct paramed_type *T);
+void store_ds_type_bare_server_d_h_inner_data (struct tl_ds_server_d_h_inner_data *D, struct paramed_type *T);
+void store_ds_type_set_client_d_h_params_answer (struct tl_ds_set_client_d_h_params_answer *D, struct paramed_type *T);
+void store_ds_type_bare_set_client_d_h_params_answer (struct tl_ds_set_client_d_h_params_answer *D, struct paramed_type *T);
+void store_ds_type_sticker_pack (struct tl_ds_sticker_pack *D, struct paramed_type *T);
+void store_ds_type_bare_sticker_pack (struct tl_ds_sticker_pack *D, struct paramed_type *T);
+void store_ds_type_sticker_set (struct tl_ds_sticker_set *D, struct paramed_type *T);
+void store_ds_type_bare_sticker_set (struct tl_ds_sticker_set *D, struct paramed_type *T);
+void store_ds_type_string (struct tl_ds_string *D, struct paramed_type *T);
+void store_ds_type_bare_string (struct tl_ds_string *D, struct paramed_type *T);
+void store_ds_type_update (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_type_bare_update (struct tl_ds_update *D, struct paramed_type *T);
+void store_ds_type_updates (struct tl_ds_updates *D, struct paramed_type *T);
+void store_ds_type_bare_updates (struct tl_ds_updates *D, struct paramed_type *T);
+void store_ds_type_user (struct tl_ds_user *D, struct paramed_type *T);
+void store_ds_type_bare_user (struct tl_ds_user *D, struct paramed_type *T);
+void store_ds_type_user_full (struct tl_ds_user_full *D, struct paramed_type *T);
+void store_ds_type_bare_user_full (struct tl_ds_user_full *D, struct paramed_type *T);
+void store_ds_type_user_profile_photo (struct tl_ds_user_profile_photo *D, struct paramed_type *T);
+void store_ds_type_bare_user_profile_photo (struct tl_ds_user_profile_photo *D, struct paramed_type *T);
+void store_ds_type_user_status (struct tl_ds_user_status *D, struct paramed_type *T);
+void store_ds_type_bare_user_status (struct tl_ds_user_status *D, struct paramed_type *T);
+void store_ds_type_vector (struct tl_ds_vector *D, struct paramed_type *T);
+void store_ds_type_bare_vector (struct tl_ds_vector *D, struct paramed_type *T);
+void store_ds_type_video (struct tl_ds_video *D, struct paramed_type *T);
+void store_ds_type_bare_video (struct tl_ds_video *D, struct paramed_type *T);
+void store_ds_type_wall_paper (struct tl_ds_wall_paper *D, struct paramed_type *T);
+void store_ds_type_bare_wall_paper (struct tl_ds_wall_paper *D, struct paramed_type *T);
+void store_ds_type_web_page (struct tl_ds_web_page *D, struct paramed_type *T);
+void store_ds_type_bare_web_page (struct tl_ds_web_page *D, struct paramed_type *T);
+void store_ds_type_account_authorizations (struct tl_ds_account_authorizations *D, struct paramed_type *T);
+void store_ds_type_bare_account_authorizations (struct tl_ds_account_authorizations *D, struct paramed_type *T);
+void store_ds_type_account_password (struct tl_ds_account_password *D, struct paramed_type *T);
+void store_ds_type_bare_account_password (struct tl_ds_account_password *D, struct paramed_type *T);
+void store_ds_type_account_password_input_settings (struct tl_ds_account_password_input_settings *D, struct paramed_type *T);
+void store_ds_type_bare_account_password_input_settings (struct tl_ds_account_password_input_settings *D, struct paramed_type *T);
+void store_ds_type_account_password_settings (struct tl_ds_account_password_settings *D, struct paramed_type *T);
+void store_ds_type_bare_account_password_settings (struct tl_ds_account_password_settings *D, struct paramed_type *T);
+void store_ds_type_account_privacy_rules (struct tl_ds_account_privacy_rules *D, struct paramed_type *T);
+void store_ds_type_bare_account_privacy_rules (struct tl_ds_account_privacy_rules *D, struct paramed_type *T);
+void store_ds_type_account_sent_change_phone_code (struct tl_ds_account_sent_change_phone_code *D, struct paramed_type *T);
+void store_ds_type_bare_account_sent_change_phone_code (struct tl_ds_account_sent_change_phone_code *D, struct paramed_type *T);
+void store_ds_type_auth_authorization (struct tl_ds_auth_authorization *D, struct paramed_type *T);
+void store_ds_type_bare_auth_authorization (struct tl_ds_auth_authorization *D, struct paramed_type *T);
+void store_ds_type_auth_checked_phone (struct tl_ds_auth_checked_phone *D, struct paramed_type *T);
+void store_ds_type_bare_auth_checked_phone (struct tl_ds_auth_checked_phone *D, struct paramed_type *T);
+void store_ds_type_auth_exported_authorization (struct tl_ds_auth_exported_authorization *D, struct paramed_type *T);
+void store_ds_type_bare_auth_exported_authorization (struct tl_ds_auth_exported_authorization *D, struct paramed_type *T);
+void store_ds_type_auth_password_recovery (struct tl_ds_auth_password_recovery *D, struct paramed_type *T);
+void store_ds_type_bare_auth_password_recovery (struct tl_ds_auth_password_recovery *D, struct paramed_type *T);
+void store_ds_type_auth_sent_code (struct tl_ds_auth_sent_code *D, struct paramed_type *T);
+void store_ds_type_bare_auth_sent_code (struct tl_ds_auth_sent_code *D, struct paramed_type *T);
+void store_ds_type_binlog_encr_key (struct tl_ds_binlog_encr_key *D, struct paramed_type *T);
+void store_ds_type_bare_binlog_encr_key (struct tl_ds_binlog_encr_key *D, struct paramed_type *T);
+void store_ds_type_binlog_update (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void store_ds_type_bare_binlog_update (struct tl_ds_binlog_update *D, struct paramed_type *T);
+void store_ds_type_contacts_blocked (struct tl_ds_contacts_blocked *D, struct paramed_type *T);
+void store_ds_type_bare_contacts_blocked (struct tl_ds_contacts_blocked *D, struct paramed_type *T);
+void store_ds_type_contacts_contacts (struct tl_ds_contacts_contacts *D, struct paramed_type *T);
+void store_ds_type_bare_contacts_contacts (struct tl_ds_contacts_contacts *D, struct paramed_type *T);
+void store_ds_type_contacts_found (struct tl_ds_contacts_found *D, struct paramed_type *T);
+void store_ds_type_bare_contacts_found (struct tl_ds_contacts_found *D, struct paramed_type *T);
+void store_ds_type_contacts_imported_contacts (struct tl_ds_contacts_imported_contacts *D, struct paramed_type *T);
+void store_ds_type_bare_contacts_imported_contacts (struct tl_ds_contacts_imported_contacts *D, struct paramed_type *T);
+void store_ds_type_contacts_link (struct tl_ds_contacts_link *D, struct paramed_type *T);
+void store_ds_type_bare_contacts_link (struct tl_ds_contacts_link *D, struct paramed_type *T);
+void store_ds_type_contacts_suggested (struct tl_ds_contacts_suggested *D, struct paramed_type *T);
+void store_ds_type_bare_contacts_suggested (struct tl_ds_contacts_suggested *D, struct paramed_type *T);
+void store_ds_type_geochats_located (struct tl_ds_geochats_located *D, struct paramed_type *T);
+void store_ds_type_bare_geochats_located (struct tl_ds_geochats_located *D, struct paramed_type *T);
+void store_ds_type_geochats_messages (struct tl_ds_geochats_messages *D, struct paramed_type *T);
+void store_ds_type_bare_geochats_messages (struct tl_ds_geochats_messages *D, struct paramed_type *T);
+void store_ds_type_geochats_stated_message (struct tl_ds_geochats_stated_message *D, struct paramed_type *T);
+void store_ds_type_bare_geochats_stated_message (struct tl_ds_geochats_stated_message *D, struct paramed_type *T);
+void store_ds_type_help_app_update (struct tl_ds_help_app_update *D, struct paramed_type *T);
+void store_ds_type_bare_help_app_update (struct tl_ds_help_app_update *D, struct paramed_type *T);
+void store_ds_type_help_invite_text (struct tl_ds_help_invite_text *D, struct paramed_type *T);
+void store_ds_type_bare_help_invite_text (struct tl_ds_help_invite_text *D, struct paramed_type *T);
+void store_ds_type_help_support (struct tl_ds_help_support *D, struct paramed_type *T);
+void store_ds_type_bare_help_support (struct tl_ds_help_support *D, struct paramed_type *T);
+void store_ds_type_messages_affected_history (struct tl_ds_messages_affected_history *D, struct paramed_type *T);
+void store_ds_type_bare_messages_affected_history (struct tl_ds_messages_affected_history *D, struct paramed_type *T);
+void store_ds_type_messages_affected_messages (struct tl_ds_messages_affected_messages *D, struct paramed_type *T);
+void store_ds_type_bare_messages_affected_messages (struct tl_ds_messages_affected_messages *D, struct paramed_type *T);
+void store_ds_type_messages_all_stickers (struct tl_ds_messages_all_stickers *D, struct paramed_type *T);
+void store_ds_type_bare_messages_all_stickers (struct tl_ds_messages_all_stickers *D, struct paramed_type *T);
+void store_ds_type_messages_chat_full (struct tl_ds_messages_chat_full *D, struct paramed_type *T);
+void store_ds_type_bare_messages_chat_full (struct tl_ds_messages_chat_full *D, struct paramed_type *T);
+void store_ds_type_messages_chats (struct tl_ds_messages_chats *D, struct paramed_type *T);
+void store_ds_type_bare_messages_chats (struct tl_ds_messages_chats *D, struct paramed_type *T);
+void store_ds_type_messages_dh_config (struct tl_ds_messages_dh_config *D, struct paramed_type *T);
+void store_ds_type_bare_messages_dh_config (struct tl_ds_messages_dh_config *D, struct paramed_type *T);
+void store_ds_type_messages_dialogs (struct tl_ds_messages_dialogs *D, struct paramed_type *T);
+void store_ds_type_bare_messages_dialogs (struct tl_ds_messages_dialogs *D, struct paramed_type *T);
+void store_ds_type_messages_message (struct tl_ds_messages_message *D, struct paramed_type *T);
+void store_ds_type_bare_messages_message (struct tl_ds_messages_message *D, struct paramed_type *T);
+void store_ds_type_messages_messages (struct tl_ds_messages_messages *D, struct paramed_type *T);
+void store_ds_type_bare_messages_messages (struct tl_ds_messages_messages *D, struct paramed_type *T);
+void store_ds_type_messages_sent_encrypted_message (struct tl_ds_messages_sent_encrypted_message *D, struct paramed_type *T);
+void store_ds_type_bare_messages_sent_encrypted_message (struct tl_ds_messages_sent_encrypted_message *D, struct paramed_type *T);
+void store_ds_type_messages_sent_message (struct tl_ds_messages_sent_message *D, struct paramed_type *T);
+void store_ds_type_bare_messages_sent_message (struct tl_ds_messages_sent_message *D, struct paramed_type *T);
+void store_ds_type_messages_sticker_set (struct tl_ds_messages_sticker_set *D, struct paramed_type *T);
+void store_ds_type_bare_messages_sticker_set (struct tl_ds_messages_sticker_set *D, struct paramed_type *T);
+void store_ds_type_messages_stickers (struct tl_ds_messages_stickers *D, struct paramed_type *T);
+void store_ds_type_bare_messages_stickers (struct tl_ds_messages_stickers *D, struct paramed_type *T);
+void store_ds_type_photos_photo (struct tl_ds_photos_photo *D, struct paramed_type *T);
+void store_ds_type_bare_photos_photo (struct tl_ds_photos_photo *D, struct paramed_type *T);
+void store_ds_type_photos_photos (struct tl_ds_photos_photos *D, struct paramed_type *T);
+void store_ds_type_bare_photos_photos (struct tl_ds_photos_photos *D, struct paramed_type *T);
+void store_ds_type_storage_file_type (struct tl_ds_storage_file_type *D, struct paramed_type *T);
+void store_ds_type_bare_storage_file_type (struct tl_ds_storage_file_type *D, struct paramed_type *T);
+void store_ds_type_updates_difference (struct tl_ds_updates_difference *D, struct paramed_type *T);
+void store_ds_type_bare_updates_difference (struct tl_ds_updates_difference *D, struct paramed_type *T);
+void store_ds_type_updates_state (struct tl_ds_updates_state *D, struct paramed_type *T);
+void store_ds_type_bare_updates_state (struct tl_ds_updates_state *D, struct paramed_type *T);
+void store_ds_type_upload_file (struct tl_ds_upload_file *D, struct paramed_type *T);
+void store_ds_type_bare_upload_file (struct tl_ds_upload_file *D, struct paramed_type *T);
+void store_ds_type_any (void *D, struct paramed_type *T);
diff --git a/protocols/Telegram/tgl/auto/auto-store.c b/protocols/Telegram/tgl/auto/auto-store.c
new file mode 100644
index 0000000000..50d5ff7970
--- /dev/null
+++ b/protocols/Telegram/tgl/auto/auto-store.c
@@ -0,0 +1,24400 @@
+#ifdef _MSC_VER
+#include "..\auto.h"
+#include "..\mtproto-common.h"
+#include "auto-store.h"
+#include "..\auto-static-store.c"
+#else
+#include "auto.h"
+#include "mtproto-common.h"
+#include "auto/auto-store.h"
+#include "auto-static-store.c"
+#endif
+#include <assert.h>
+int store_constructor_account_days_t_t_l (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb8d0afdf && T->type->name != 0x472f5020)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_audio_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fc5ec4e && T->type->name != 0x603a13b1)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fc5ec4e && T->type->name != 0x603a13b1)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "duration", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "mime_type", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field6) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "size", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field7) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "dc_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field8) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_authorization (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bf2e6f6 && T->type->name != 0x840d1909)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "device_model", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "platform", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 14 && !cur_token_quoted && !memcmp (cur_token, "system_version", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "api_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field6) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "app_name", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field7) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "app_version", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field8) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "date_created", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field9) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "date_active", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field10) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "ip", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field11) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "country", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field12) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "region", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field13) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_bool_false (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x250be282 && T->type->name != 0xdaf41d7d)) { return -1; }
+ return 0;
+}
+int store_constructor_bool_true (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x250be282 && T->type->name != 0xdaf41d7d)) { return -1; }
+ return 0;
+}
+int store_constructor_bot_command (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x75e7ea6c && T->type->name != 0x8a181593)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "command", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "description", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_bot_command_old (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x75e7ea6c && T->type->name != 0x8a181593)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "command", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "params", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "description", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_bot_info_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb2e16f93 && T->type->name != 0x4d1e906c)) { return -1; }
+ return 0;
+}
+int store_constructor_bot_info (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb2e16f93 && T->type->name != 0x4d1e906c)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "version", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "share_text", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "description", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "commands", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x75e7ea6c, .id = "BotCommand", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field5) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_bytes (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0ee1379f && T->type->name != 0xf11ec860)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_chat_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x56922676, .id = "ChatPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_chat_photo (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 18 && !cur_token_quoted && !memcmp (cur_token, "participants_count", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "left", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bool (field6) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "version", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field7) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_chat_forbidden (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_geo_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bd865dc && T->type->name != 0x84279a23)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "address", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "venue", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "geo", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_geo_point (field6) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x56922676, .id = "ChatPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_chat_photo (field7) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 18 && !cur_token_quoted && !memcmp (cur_token, "participants_count", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field8) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field9) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "checked_in", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bool (field10) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "version", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field11) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_chat_full (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02a614 && T->type->name != 0xd1fd59eb)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "participants", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x77930f9f, .id = "ChatParticipants", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_chat_participants (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "chat_photo", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_photo (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "notify_settings", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_peer_notify_settings (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "exported_invite", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f132d5, .id = "ExportedChatInvite", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_exported_chat_invite (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "bot_info", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb2e16f93, .id = "BotInfo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field6) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_chat_invite_already (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x94f910b1 && T->type->name != 0x6b06ef4e)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "chat", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_chat (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_chat_invite (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x94f910b1 && T->type->name != 0x6b06ef4e)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_chat_located (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3631cf4c && T->type->name != 0xc9ce30b3)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "distance", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_chat_participant (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc8d7493e && T->type->name != 0x3728b6c1)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "inviter_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_chat_participants_forbidden (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x77930f9f && T->type->name != 0x886cf060)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_chat_participants (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x77930f9f && T->type->name != 0x886cf060)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "admin_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "participants", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc8d7493e, .id = "ChatParticipant", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "version", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_chat_photo_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x56922676 && T->type->name != 0xa96dd989)) { return -1; }
+ return 0;
+}
+int store_constructor_chat_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x56922676 && T->type->name != 0xa96dd989)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "photo_small", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_file_location (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "photo_big", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_file_location (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_client_d_h_inner_data (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6643b654 && T->type->name != 0x99bc49ab)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "server_nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "retry_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "g_b", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_config (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e32b894 && T->type->name != 0xb1cd476b)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "expires", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "test_mode", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bool (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "this_dc", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "dc_options", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2b1a62f0, .id = "DcOption", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 13 && !cur_token_quoted && !memcmp (cur_token, "chat_size_max", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field6) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 18 && !cur_token_quoted && !memcmp (cur_token, "broadcast_size_max", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field7) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 19 && !cur_token_quoted && !memcmp (cur_token, "forwarded_count_max", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field8) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 23 && !cur_token_quoted && !memcmp (cur_token, "online_update_period_ms", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field9) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 23 && !cur_token_quoted && !memcmp (cur_token, "offline_blur_timeout_ms", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field10) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 23 && !cur_token_quoted && !memcmp (cur_token, "offline_idle_timeout_ms", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field11) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 23 && !cur_token_quoted && !memcmp (cur_token, "online_cloud_timeout_ms", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field12) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 21 && !cur_token_quoted && !memcmp (cur_token, "notify_cloud_delay_ms", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field13) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 23 && !cur_token_quoted && !memcmp (cur_token, "notify_default_delay_ms", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field14) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 13 && !cur_token_quoted && !memcmp (cur_token, "chat_big_size", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field15 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field15) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 19 && !cur_token_quoted && !memcmp (cur_token, "push_chat_period_ms", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field16 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field16) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "push_chat_limit", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field17 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field17) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 17 && !cur_token_quoted && !memcmp (cur_token, "disabled_features", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field18 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xae636f24, .id = "DisabledFeature", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field18) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf911c994 && T->type->name != 0x06ee366b)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "mutual", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bool (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_contact_blocked (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x561bc879 && T->type->name != 0xa9e43786)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_contact_found (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xea879f95 && T->type->name != 0x1578606a)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_contact_link_unknown (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return -1; }
+ return 0;
+}
+int store_constructor_contact_link_none (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return -1; }
+ return 0;
+}
+int store_constructor_contact_link_has_phone (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return -1; }
+ return 0;
+}
+int store_constructor_contact_link_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x522fbc63 && T->type->name != 0xadd0439c)) { return -1; }
+ return 0;
+}
+int store_constructor_contact_status (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd3680c61 && T->type->name != 0x2c97f39e)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "status", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x76de9570, .id = "UserStatus", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_user_status (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_contact_suggested (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3de191a1 && T->type->name != 0xc21e6e5e)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "mutual_contacts", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_dc_option_l28 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2b1a62f0 && T->type->name != 0xd4e59d0f)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "hostname", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "ip_address", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "port", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_dc_option (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2b1a62f0 && T->type->name != 0xd4e59d0f)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "ip_address", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "port", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_decrypted_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x535b7918 && T->type->name != 0xaca486e7)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "ttl", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "media", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x34e0d674, .id = "DecryptedMessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_decrypted_message_media (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_decrypted_message_service (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x535b7918 && T->type->name != 0xaca486e7)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "action", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4e0eefde, .id = "DecryptedMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_decrypted_message_action (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_decrypted_message_action_set_message_t_t_l (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "ttl_seconds", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_decrypted_message_action_read_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "random_ids", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_decrypted_message_action_delete_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "random_ids", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_decrypted_message_action_screenshot_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "random_ids", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_decrypted_message_action_flush_history (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ return 0;
+}
+int store_constructor_decrypted_message_action_resend (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "start_seq_no", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "end_seq_no", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_decrypted_message_action_notify_layer (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "layer", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_decrypted_message_action_typing (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "action", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x70541c7e, .id = "SendMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_send_message_action (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_decrypted_message_action_request_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "exchange_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "g_a", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_decrypted_message_action_accept_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "exchange_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "g_b", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "key_fingerprint", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_decrypted_message_action_abort_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "exchange_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_decrypted_message_action_commit_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "exchange_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "key_fingerprint", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_decrypted_message_action_noop (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4e0eefde && T->type->name != 0xb1f11021)) { return -1; }
+ return 0;
+}
+int store_constructor_decrypted_message_layer (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1be31789 && T->type->name != 0xe41ce876)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "random_bytes", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "layer", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "in_seq_no", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "out_seq_no", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x535b7918, .id = "DecryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_decrypted_message (field5) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_decrypted_message_media_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ return 0;
+}
+int store_constructor_decrypted_message_media_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "str_thumb", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "thumb_w", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "thumb_h", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "w", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "h", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "size", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field6) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "key", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field7) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "iv", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field8) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_decrypted_message_media_geo_point (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "latitude", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_double (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "longitude", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_double (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_decrypted_message_media_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "phone_number", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "first_name", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "last_name", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_decrypted_message_media_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "str_thumb", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "thumb_w", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "thumb_h", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "file_name", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "mime_type", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "size", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field6) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "key", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field7) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "iv", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field8) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_decrypted_message_media_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "str_thumb", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "thumb_w", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "thumb_h", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "duration", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "mime_type", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "w", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field6) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "h", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field7) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "size", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field8) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "key", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field9) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "iv", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field10) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_decrypted_message_media_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "duration", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "mime_type", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "size", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "key", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "iv", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field5) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_decrypted_message_media_external_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "mime_type", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "size", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "thumb", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_photo_size (field6) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "dc_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field7) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "attributes", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field8) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_decrypted_message_media_video_l12 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "str_thumb", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "thumb_w", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "thumb_h", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "duration", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "w", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "h", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field6) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "size", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field7) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "key", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field8) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "iv", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field9) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_decrypted_message_media_audio_l12 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x34e0d674 && T->type->name != 0xcb1f298b)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "duration", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "size", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "key", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "iv", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_dialog (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc1dd804a && T->type->name != 0x3e227fb5)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_peer (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "top_message", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 17 && !cur_token_quoted && !memcmp (cur_token, "read_inbox_max_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "unread_count", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "notify_settings", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_peer_notify_settings (field5) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_disabled_feature (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xae636f24 && T->type->name != 0x519c90db)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "feature", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "description", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_document_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x51a73418 && T->type->name != 0xae58cbe7)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x51a73418 && T->type->name != 0xae58cbe7)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "mime_type", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "size", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "thumb", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_photo_size (field6) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "dc_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field7) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "attributes", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field8) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_document_l19 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x51a73418 && T->type->name != 0xae58cbe7)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "file_name", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "mime_type", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field6) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "size", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field7) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "thumb", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_photo_size (field8) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "dc_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field9) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_document_attribute_image_size (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "w", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "h", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_document_attribute_animated (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ return 0;
+}
+int store_constructor_document_attribute_sticker_l28 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "alt", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_document_attribute_sticker (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "alt", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "stickerset", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe44d415c, .id = "InputStickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_sticker_set (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_document_attribute_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "duration", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "w", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "h", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_document_attribute_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "duration", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_document_attribute_filename (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x97c637a3 && T->type->name != 0x6839c85c)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "file_name", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_double (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2210c154 && T->type->name != 0xddef3eab)) { return -1; }
+ if (is_double ()) {
+ out_double (get_double());
+ local_next_token ();
+ return 0;
+ } else {
+ return -1;
+ }
+}
+int store_constructor_encrypted_chat_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_encrypted_chat_waiting (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "admin_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 14 && !cur_token_quoted && !memcmp (cur_token, "participant_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_encrypted_chat_requested (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "admin_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 14 && !cur_token_quoted && !memcmp (cur_token, "participant_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "g_a", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field6) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_encrypted_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "admin_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 14 && !cur_token_quoted && !memcmp (cur_token, "participant_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "g_a_or_b", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field6) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "key_fingerprint", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field7) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_encrypted_chat_discarded (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb1718213 && T->type->name != 0x4e8e7dec)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_encrypted_file_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x886fd032 && T->type->name != 0x77902fcd)) { return -1; }
+ return 0;
+}
+int store_constructor_encrypted_file (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x886fd032 && T->type->name != 0x77902fcd)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "size", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "dc_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "key_fingerprint", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_encrypted_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xce6b8a1e && T->type->name != 0x319475e1)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "bytes", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "file", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x886fd032, .id = "EncryptedFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_encrypted_file (field5) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_encrypted_message_service (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xce6b8a1e && T->type->name != 0x319475e1)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "bytes", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_error (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc4b9f9bb && T->type->name != 0x3b460644)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "code", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "text", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_chat_invite_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f132d5 && T->type->name != 0x6a0ecd2a)) { return -1; }
+ return 0;
+}
+int store_constructor_chat_invite_exported (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f132d5 && T->type->name != 0x6a0ecd2a)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "link", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_file_location_unavailable (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2f8ffb30 && T->type->name != 0xd07004cf)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "volume_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "local_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "secret", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2f8ffb30 && T->type->name != 0xd07004cf)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "dc_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "volume_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "local_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "secret", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_geo_chat_message_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf67b4034 && T->type->name != 0x0984bfcb)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_geo_chat_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf67b4034 && T->type->name != 0x0984bfcb)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "from_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "media", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_message_media (field6) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_geo_chat_message_service (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf67b4034 && T->type->name != 0x0984bfcb)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "from_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "action", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x383415fa, .id = "MessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_message_action (field5) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_geo_point_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x315e0a53 && T->type->name != 0xcea1f5ac)) { return -1; }
+ return 0;
+}
+int store_constructor_geo_point (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x315e0a53 && T->type->name != 0xcea1f5ac)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "longitude", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_double (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "latitude", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_double (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_imported_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd0028438 && T->type->name != 0x2ffd7bc7)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "client_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_app_event (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x770656a8 && T->type->name != 0x88f9a957)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "time", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_double (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "type", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "data", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_audio_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xae8e9c7b && T->type->name != 0x51716384)) { return -1; }
+ return 0;
+}
+int store_constructor_input_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xae8e9c7b && T->type->name != 0x51716384)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_chat_photo_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3a60776d && T->type->name != 0xc59f8892)) { return -1; }
+ return 0;
+}
+int store_constructor_input_chat_uploaded_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3a60776d && T->type->name != 0xc59f8892)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "file", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_file (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "crop", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7477e321, .id = "InputPhotoCrop", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_photo_crop (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_chat_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3a60776d && T->type->name != 0xc59f8892)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe74279c9, .id = "InputPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_photo (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "crop", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7477e321, .id = "InputPhotoCrop", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_photo_crop (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_phone_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf392b7f4 && T->type->name != 0x0c6d480b)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "client_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "phone", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "first_name", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "last_name", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_document_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6a8963fc && T->type->name != 0x95769c03)) { return -1; }
+ return 0;
+}
+int store_constructor_input_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6a8963fc && T->type->name != 0x95769c03)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_encrypted_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf141b5e1 && T->type->name != 0x0ebe4a1e)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_encrypted_file_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return -1; }
+ return 0;
+}
+int store_constructor_input_encrypted_file_uploaded (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "parts", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "md5_checksum", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "key_fingerprint", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_encrypted_file (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_encrypted_file_big_uploaded (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0b5c064f && T->type->name != 0xf4a3f9b0)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "parts", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "key_fingerprint", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_file (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0f60f9ca && T->type->name != 0xf09f0635)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "parts", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "name", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "md5_checksum", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_file_big (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0f60f9ca && T->type->name != 0xf09f0635)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "parts", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "name", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "volume_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "local_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "secret", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_video_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_encrypted_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_audio_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_document_file_location (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe6daa38b && T->type->name != 0x19255c74)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_geo_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x74d456fa && T->type->name != 0x8b2ba905)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_geo_point_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17768f1f && T->type->name != 0xe88970e0)) { return -1; }
+ return 0;
+}
+int store_constructor_input_geo_point (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17768f1f && T->type->name != 0xe88970e0)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "latitude", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_double (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "longitude", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_double (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_media_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ return 0;
+}
+int store_constructor_input_media_uploaded_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "file", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_file (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "caption", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_media_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe74279c9, .id = "InputPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_photo (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "caption", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_media_geo_point (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "geo_point", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17768f1f, .id = "InputGeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_geo_point (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_media_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "phone_number", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "first_name", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "last_name", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_media_uploaded_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "file", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_file (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "duration", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "w", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "h", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "caption", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field5) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_media_uploaded_thumb_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "file", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_file (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "thumb", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_file (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "duration", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "w", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "h", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "caption", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field6) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_media_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "video_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xbb5f7a27, .id = "InputVideo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_video (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "caption", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_media_uploaded_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "file", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_file (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "duration", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "mime_type", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_media_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "audio_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xae8e9c7b, .id = "InputAudio", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_audio (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_media_uploaded_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "file", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_file (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "mime_type", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "attributes", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_media_uploaded_thumb_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "file", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_file (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "thumb", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_file (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "mime_type", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "attributes", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x97c637a3, .id = "DocumentAttribute", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_media_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "document_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x6a8963fc, .id = "InputDocument", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_document (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_media_venue (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb32c91dd && T->type->name != 0x4cd36e22)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "geo_point", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17768f1f, .id = "InputGeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_geo_point (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "address", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "provider", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "venue_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field5) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_notify_peer (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9e67268d, .id = "InputPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_peer (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_notify_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return -1; }
+ return 0;
+}
+int store_constructor_input_notify_chats (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return -1; }
+ return 0;
+}
+int store_constructor_input_notify_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return -1; }
+ return 0;
+}
+int store_constructor_input_notify_geo_chat_peer (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02b6911b && T->type->name != 0xfd496ee4)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "geo_peer", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x74d456fa, .id = "InputGeoChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_geo_chat (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_peer_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return -1; }
+ return 0;
+}
+int store_constructor_input_peer_self (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return -1; }
+ return 0;
+}
+int store_constructor_input_peer_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_peer_foreign (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_peer_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9e67268d && T->type->name != 0x6198d972)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_peer_notify_events_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x185a48ac && T->type->name != 0xe7a5b753)) { return -1; }
+ return 0;
+}
+int store_constructor_input_peer_notify_events_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x185a48ac && T->type->name != 0xe7a5b753)) { return -1; }
+ return 0;
+}
+int store_constructor_input_peer_notify_settings (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x46a2ce98 && T->type->name != 0xb95d3167)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "mute_until", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "sound", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 13 && !cur_token_quoted && !memcmp (cur_token, "show_previews", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bool (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "events_mask", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_photo_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe74279c9 && T->type->name != 0x18bd8636)) { return -1; }
+ return 0;
+}
+int store_constructor_input_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe74279c9 && T->type->name != 0x18bd8636)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_photo_crop_auto (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7477e321 && T->type->name != 0x8b881cde)) { return -1; }
+ return 0;
+}
+int store_constructor_input_photo_crop (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7477e321 && T->type->name != 0x8b881cde)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "crop_left", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_double (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "crop_top", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_double (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "crop_width", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddef3eab, .id = "Bare_Double", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_double (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_privacy_key_status_timestamp (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4f96cb18 && T->type->name != 0xb06934e7)) { return -1; }
+ return 0;
+}
+int store_constructor_input_privacy_value_allow_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ return 0;
+}
+int store_constructor_input_privacy_value_allow_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ return 0;
+}
+int store_constructor_input_privacy_value_allow_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_privacy_value_disallow_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ return 0;
+}
+int store_constructor_input_privacy_value_disallow_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ return 0;
+}
+int store_constructor_input_privacy_value_disallow_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4b815163 && T->type->name != 0xb47eae9c)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_sticker_set_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe44d415c && T->type->name != 0x1bb2bea3)) { return -1; }
+ return 0;
+}
+int store_constructor_input_sticker_set_i_d (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe44d415c && T->type->name != 0x1bb2bea3)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_sticker_set_short_name (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe44d415c && T->type->name != 0x1bb2bea3)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "short_name", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_user_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return -1; }
+ return 0;
+}
+int store_constructor_input_user_self (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return -1; }
+ return 0;
+}
+int store_constructor_input_user_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_user_foreign (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xadfe0c6a && T->type->name != 0x5201f395)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_video_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbb5f7a27 && T->type->name != 0x44a085d8)) { return -1; }
+ return 0;
+}
+int store_constructor_input_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbb5f7a27 && T->type->name != 0x44a085d8)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_int (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8509bda && T->type->name != 0x57af6425)) { return -1; }
+ if (is_int ()) {
+ out_int (get_int ());
+ local_next_token ();
+ return 0;
+ } else {
+ return -1;
+ }
+}
+int store_constructor_int128 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7d36c439 && T->type->name != 0x82c93bc6)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_int256 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf2c798b3 && T->type->name != 0x0d38674c)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field3) < 0) { return -1;}
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_keyboard_button (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa2fa4880 && T->type->name != 0x5d05b77f)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_keyboard_button_row (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x77608b83 && T->type->name != 0x889f747c)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa2fa4880, .id = "KeyboardButton", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_long (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22076cba && T->type->name != 0xddf89345)) { return -1; }
+ if (is_int ()) {
+ out_long (get_int ());
+ local_next_token ();
+ return 0;
+ } else {
+ return -1;
+ }
+}
+int store_constructor_message_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5d652a7f && T->type->name != 0xa29ad580)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5d652a7f && T->type->name != 0xa29ad580)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ if (cur_token_len < 0) { return -1; }
+ if (!is_int ()) { return -1;}
+ struct paramed_type *var0 = INT2PTR (get_int ());
+ out_int (get_int ());
+ assert (var0);
+ local_next_token ();
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "from_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "to_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_peer (field4) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "fwd_from_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "fwd_date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field6) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "reply_to_msg_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field7) < 0) { return -1;}
+ }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field8) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field9) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "media", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_message_media (field10) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 6)) {
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "reply_markup", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x612ca4a9, .id = "ReplyMarkup", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_reply_markup (field11) < 0) { return -1;}
+ }
+ return 0;
+}
+int store_constructor_message_service (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5d652a7f && T->type->name != 0xa29ad580)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "from_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "to_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_peer (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "action", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x383415fa, .id = "MessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_message_action (field6) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_message_action_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ return 0;
+}
+int store_constructor_message_action_chat_create (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_message_action_chat_edit_title (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_message_action_chat_edit_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_photo (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_message_action_chat_delete_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ return 0;
+}
+int store_constructor_message_action_chat_add_user (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_message_action_chat_delete_user (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_message_action_geo_chat_create (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "address", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_message_action_geo_chat_checkin (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ return 0;
+}
+int store_constructor_message_action_chat_joined_by_link (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x383415fa && T->type->name != 0xc7cbea05)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "inviter_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_message_media_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ return 0;
+}
+int store_constructor_message_media_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_photo (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "caption", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_message_media_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "video", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1716b174, .id = "Video", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_video (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "caption", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_message_media_geo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "geo", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_geo_point (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_message_media_contact (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "phone_number", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "first_name", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "last_name", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_message_media_unsupported (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ return 0;
+}
+int store_constructor_message_media_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "document", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_document (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_message_media_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "audio", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9fc5ec4e, .id = "Audio", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_audio (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_message_media_web_page (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "webpage", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x8d8c0d41, .id = "WebPage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_web_page (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_message_media_venue (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "geo", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_geo_point (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "address", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "provider", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "venue_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field5) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_message_media_photo_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_photo (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_message_media_video_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x95f2471a && T->type->name != 0x6a0db8e5)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "video", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1716b174, .id = "Video", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_video (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_input_messages_filter_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ return 0;
+}
+int store_constructor_input_messages_filter_photos (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ return 0;
+}
+int store_constructor_input_messages_filter_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ return 0;
+}
+int store_constructor_input_messages_filter_photo_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ return 0;
+}
+int store_constructor_input_messages_filter_photo_video_documents (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ return 0;
+}
+int store_constructor_input_messages_filter_document (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ return 0;
+}
+int store_constructor_input_messages_filter_audio (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x80895ae0 && T->type->name != 0x7f76a51f)) { return -1; }
+ return 0;
+}
+int store_constructor_nearest_dc (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8e1a1775 && T->type->name != 0x71e5e88a)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "country", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "this_dc", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "nearest_dc", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_notify_peer (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_peer (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_notify_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return -1; }
+ return 0;
+}
+int store_constructor_notify_chats (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return -1; }
+ return 0;
+}
+int store_constructor_notify_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9fcb8237 && T->type->name != 0x60347dc8)) { return -1; }
+ return 0;
+}
+int store_constructor_null (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x56730bcc && T->type->name != 0xa98cf433)) { return -1; }
+ return 0;
+}
+int store_constructor_p_q_inner_data (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbfa3de38 && T->type->name != 0x405c21c7)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "pq", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "p", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "q", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "server_nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "new_nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0d38674c, .id = "Bare_Int256", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int256 (field6) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_p_q_inner_data_temp (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbfa3de38 && T->type->name != 0x405c21c7)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "pq", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "p", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "q", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "server_nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "new_nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0d38674c, .id = "Bare_Int256", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int256 (field6) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "expires_in", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field7) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_peer_user (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x276159d6 && T->type->name != 0xd89ea629)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_peer_chat (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x276159d6 && T->type->name != 0xd89ea629)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_peer_notify_events_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc0c8d13b && T->type->name != 0x3f372ec4)) { return -1; }
+ return 0;
+}
+int store_constructor_peer_notify_events_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc0c8d13b && T->type->name != 0x3f372ec4)) { return -1; }
+ return 0;
+}
+int store_constructor_peer_notify_settings_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xfdf894fc && T->type->name != 0x02076b03)) { return -1; }
+ return 0;
+}
+int store_constructor_peer_notify_settings (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xfdf894fc && T->type->name != 0x02076b03)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "mute_until", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "sound", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 13 && !cur_token_quoted && !memcmp (cur_token, "show_previews", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bool (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "events_mask", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_photo_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc207550a && T->type->name != 0x3df8aaf5)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc207550a && T->type->name != 0x3df8aaf5)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "geo", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_geo_point (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "sizes", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field6) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_photo_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc207550a && T->type->name != 0x3df8aaf5)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "caption", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "geo", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x315e0a53, .id = "GeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_geo_point (field6) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "sizes", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field7) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_photo_size_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x900f60dd && T->type->name != 0x6ff09f22)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "type", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_photo_size (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x900f60dd && T->type->name != 0x6ff09f22)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "type", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "location", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_file_location (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "w", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "h", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "size", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_photo_cached_size (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x900f60dd && T->type->name != 0x6ff09f22)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "type", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "location", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_file_location (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "w", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "h", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "bytes", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field5) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_privacy_key_status_timestamp (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbc2eab30 && T->type->name != 0x43d154cf)) { return -1; }
+ return 0;
+}
+int store_constructor_privacy_value_allow_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ return 0;
+}
+int store_constructor_privacy_value_allow_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ return 0;
+}
+int store_constructor_privacy_value_allow_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_privacy_value_disallow_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ return 0;
+}
+int store_constructor_privacy_value_disallow_all (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ return 0;
+}
+int store_constructor_privacy_value_disallow_users (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa8638aec && T->type->name != 0x579c7513)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_received_notify_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa384b779 && T->type->name != 0x5c7b4886)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_reply_keyboard_hide (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x612ca4a9 && T->type->name != 0x9ed35b56)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_reply_keyboard_force_reply (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x612ca4a9 && T->type->name != 0x9ed35b56)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_reply_keyboard_markup (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x612ca4a9 && T->type->name != 0x9ed35b56)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "rows", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x77608b83, .id = "KeyboardButtonRow", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_res_p_q (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x05162463 && T->type->name != 0xfae9db9c)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "server_nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "pq", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 30 && !cur_token_quoted && !memcmp (cur_token, "server_public_key_fingerprints", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_send_message_typing_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ return 0;
+}
+int store_constructor_send_message_cancel_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ return 0;
+}
+int store_constructor_send_message_record_video_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ return 0;
+}
+int store_constructor_send_message_upload_video_action_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ return 0;
+}
+int store_constructor_send_message_upload_video_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "progress", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_send_message_record_audio_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ return 0;
+}
+int store_constructor_send_message_upload_audio_action_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ return 0;
+}
+int store_constructor_send_message_upload_audio_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "progress", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_send_message_upload_photo_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "progress", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_send_message_upload_document_action_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ return 0;
+}
+int store_constructor_send_message_upload_document_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "progress", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_send_message_geo_location_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ return 0;
+}
+int store_constructor_send_message_choose_contact_action (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x70541c7e && T->type->name != 0x8fabe381)) { return -1; }
+ return 0;
+}
+int store_constructor_server_d_h_params_fail (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa9230301 && T->type->name != 0x56dcfcfe)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "server_nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 14 && !cur_token_quoted && !memcmp (cur_token, "new_nonce_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_server_d_h_params_ok (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa9230301 && T->type->name != 0x56dcfcfe)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "server_nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 16 && !cur_token_quoted && !memcmp (cur_token, "encrypted_answer", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_server_d_h_inner_data (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb5890dba && T->type->name != 0x4a76f245)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "server_nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "g", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "dh_prime", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "g_a", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "server_time", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field6) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_dh_gen_ok (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdb8a468f && T->type->name != 0x2475b970)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "server_nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "new_nonce_hash1", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_dh_gen_retry (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdb8a468f && T->type->name != 0x2475b970)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "server_nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "new_nonce_hash2", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_dh_gen_fail (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdb8a468f && T->type->name != 0x2475b970)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "server_nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "new_nonce_hash3", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_sticker_pack (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x12b299d4 && T->type->name != 0xed4d662b)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "emoticon", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "documents", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_sticker_set (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa7a43b17 && T->type->name != 0x585bc4e8)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "short_name", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_string (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb5286e24 && T->type->name != 0x4ad791db)) { return -1; }
+ if (cur_token_len >= 0) {
+ out_cstring (cur_token, cur_token_len);
+ local_next_token ();
+ return 0;
+ } else {
+ return -1;
+ }
+}
+int store_constructor_update_new_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_message (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "pts_count", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_message_i_d (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_delete_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "messages", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "pts_count", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_user_typing (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "action", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x70541c7e, .id = "SendMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_send_message_action (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_chat_user_typing (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "action", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x70541c7e, .id = "SendMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_send_message_action (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_chat_participants (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "participants", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x77930f9f, .id = "ChatParticipants", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_chat_participants (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_user_status (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "status", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x76de9570, .id = "UserStatus", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_user_status (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_user_name (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "first_name", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "last_name", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "username", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_user_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9a486229, .id = "UserProfilePhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_user_profile_photo (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "previous", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bool (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_contact_registered (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_contact_link (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "my_link", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_contact_link (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "foreign_link", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_contact_link (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_new_authorization (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "auth_key_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "device", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "location", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_new_geo_chat_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "geo_message", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_geo_chat_message (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_new_encrypted_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "encr_message", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xce6b8a1e, .id = "EncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_encrypted_message (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "qts", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_encrypted_chat_typing (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_encryption (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "encr_chat", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb1718213, .id = "EncryptedChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_encrypted_chat (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_encrypted_messages_read (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "max_date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_chat_participant_add (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "inviter_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "version", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_chat_participant_delete (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "version", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_dc_options (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "dc_options", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2b1a62f0, .id = "DcOption", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_user_blocked (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "blocked", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bool (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_notify_settings (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "notify_peer", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9fcb8237, .id = "NotifyPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_notify_peer (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "notify_settings", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_peer_notify_settings (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_service_notification (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "type", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "message_text", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "media", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_message_media (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "popup", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bool (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_privacy (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "key", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xbc2eab30, .id = "PrivacyKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_privacy_key (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "rules", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa8638aec, .id = "PrivacyRule", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_user_phone (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "phone", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_read_history_inbox (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_peer (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "max_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "pts_count", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_read_history_outbox (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x276159d6, .id = "Peer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_peer (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "max_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "pts_count", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_web_page (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "webpage", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x8d8c0d41, .id = "WebPage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_web_page (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_read_messages_contents (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "messages", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "pts_count", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_update_msg_update (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x2e02b27e && T->type->name != 0xd1fd4d81)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "pts_count", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_updates_too_long (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ return 0;
+}
+int store_constructor_update_short_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ if (cur_token_len < 0) { return -1; }
+ if (!is_int ()) { return -1;}
+ struct paramed_type *var0 = INT2PTR (get_int ());
+ out_int (get_int ());
+ assert (var0);
+ local_next_token ();
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "pts_count", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field6) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field7) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "fwd_from_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field8) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "fwd_date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field9) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "reply_to_msg_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field10) < 0) { return -1;}
+ }
+ return 0;
+}
+int store_constructor_update_short_chat_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ if (cur_token_len < 0) { return -1; }
+ if (!is_int ()) { return -1;}
+ struct paramed_type *var0 = INT2PTR (get_int ());
+ out_int (get_int ());
+ assert (var0);
+ local_next_token ();
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "from_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field6) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "pts_count", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field7) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field8) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "fwd_from_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field9) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "fwd_date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field10) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "reply_to_msg_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field11) < 0) { return -1;}
+ }
+ return 0;
+}
+int store_constructor_update_short (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "update", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_update (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_updates_combined (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "updates", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "chats", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "seq_start", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "seq", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field6) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_updates (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x22499d27 && T->type->name != 0xddb662d8)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "updates", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "chats", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "seq", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_user_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02e6c0c8 && T->type->name != 0xfd193f37)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_user (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x02e6c0c8 && T->type->name != 0xfd193f37)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ if (cur_token_len < 0) { return -1; }
+ if (!is_int ()) { return -1;}
+ struct paramed_type *var0 = INT2PTR (get_int ());
+ out_int (get_int ());
+ assert (var0);
+ local_next_token ();
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 0)) {
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field3) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 1)) {
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "first_name", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "last_name", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field5) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "username", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field6) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 4)) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "phone", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field7) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 5)) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9a486229, .id = "UserProfilePhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_user_profile_photo (field8) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 6)) {
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "status", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x76de9570, .id = "UserStatus", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_user_status (field9) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 14)) {
+ if (cur_token_len >= 0 && cur_token_len == 16 && !cur_token_quoted && !memcmp (cur_token, "bot_info_version", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field10) < 0) { return -1;}
+ }
+ return 0;
+}
+int store_constructor_user_full (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5a89ac5b && T->type->name != 0xa57653a4)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "user", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_user (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "link", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3ace484c, .id = "contacts.Link", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_contacts_link (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 13 && !cur_token_quoted && !memcmp (cur_token, "profile_photo", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_photo (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "notify_settings", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_peer_notify_settings (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "blocked", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bool (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "bot_info", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb2e16f93, .id = "BotInfo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bot_info (field6) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_user_profile_photo_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9a486229 && T->type->name != 0x65b79dd6)) { return -1; }
+ return 0;
+}
+int store_constructor_user_profile_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x9a486229 && T->type->name != 0x65b79dd6)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "photo_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "photo_small", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_file_location (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "photo_big", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2f8ffb30, .id = "FileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_file_location (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_user_status_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ return 0;
+}
+int store_constructor_user_status_online (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "expires", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_user_status_offline (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "was_online", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_user_status_recently (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ return 0;
+}
+int store_constructor_user_status_last_week (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ return 0;
+}
+int store_constructor_user_status_last_month (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x76de9570 && T->type->name != 0x89216a8f)) { return -1; }
+ return 0;
+}
+int store_constructor_vector (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1cb5c415 && T->type->name != 0xe34a3bea)) { return -1; }
+ if (ODDP(T->params[0])) { return -1; }
+ struct paramed_type *var0 = T->params[0]; assert (var0);
+ if (cur_token_len < 0) { return -1; }
+ if (!is_int ()) { return -1;}
+ struct paramed_type *var1 = INT2PTR (get_int ());
+ out_int (get_int ());
+ assert (var1);
+ local_next_token ();
+ expect_token ("[", 1);
+ int multiplicity3 = PTR2INT (
+ ((void *)var1) + 0 );
+ struct paramed_type *field3 =
+ var0;
+ while (multiplicity3 -- > 0) {
+ if (store_type_any (field3) < 0) { return -1;}
+ }
+ expect_token ("]", 1);
+ return 0;
+}
+int store_constructor_video_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1716b174 && T->type->name != 0xe8e94e8b)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_video (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1716b174 && T->type->name != 0xe8e94e8b)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "duration", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "size", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field6) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "thumb", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_photo_size (field7) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "dc_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field8) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "w", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field9) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "h", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field10) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_video_l27 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1716b174 && T->type->name != 0xe8e94e8b)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "caption", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "duration", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field6) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "mime_type", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field7) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "size", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field8) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "thumb", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_photo_size (field9) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "dc_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field10) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "w", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field11) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "h", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field12) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_wall_paper (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xafa14973 && T->type->name != 0x505eb68c)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "sizes", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x900f60dd, .id = "PhotoSize", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "color", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_wall_paper_solid (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xafa14973 && T->type->name != 0x505eb68c)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "bg_color", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "color", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_web_page_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8d8c0d41 && T->type->name != 0x7273f2be)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_web_page_pending (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8d8c0d41 && T->type->name != 0x7273f2be)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_web_page (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8d8c0d41 && T->type->name != 0x7273f2be)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ if (cur_token_len < 0) { return -1; }
+ if (!is_int ()) { return -1;}
+ struct paramed_type *var0 = INT2PTR (get_int ());
+ out_int (get_int ());
+ assert (var0);
+ local_next_token ();
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "url", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "display_url", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 0)) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "type", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field5) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 1)) {
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "site_name", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field6) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field7) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 3)) {
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "description", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field8) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 4)) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_photo (field9) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 5)) {
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "embed_url", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field10) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 5)) {
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "embed_type", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field11) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 6)) {
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "embed_width", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field12) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 6)) {
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "embed_height", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field13) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 7)) {
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "duration", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field14) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 8)) {
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "author", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field15 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field15) < 0) { return -1;}
+ }
+ return 0;
+}
+int store_constructor_account_authorizations (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x1250abde && T->type->name != 0xedaf5421)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bf2e6f6, .id = "Authorization", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_account_no_password (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xeac2a804 && T->type->name != 0x153d57fb)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "new_salt", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 25 && !cur_token_quoted && !memcmp (cur_token, "email_unconfirmed_pattern", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_account_password (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xeac2a804 && T->type->name != 0x153d57fb)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "current_salt", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "new_salt", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "hint", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "has_recovery", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bool (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 25 && !cur_token_quoted && !memcmp (cur_token, "email_unconfirmed_pattern", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field5) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_account_password_input_settings (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xbcfc532c && T->type->name != 0x4303acd3)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ if (cur_token_len < 0) { return -1; }
+ if (!is_int ()) { return -1;}
+ struct paramed_type *var0 = INT2PTR (get_int ());
+ out_int (get_int ());
+ assert (var0);
+ local_next_token ();
+ if (PTR2INT (var0) & (1 << 0)) {
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "new_salt", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field2) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 0)) {
+ if (cur_token_len >= 0 && cur_token_len == 17 && !cur_token_quoted && !memcmp (cur_token, "new_password_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field3) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 0)) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "hint", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 1)) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "email", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field5) < 0) { return -1;}
+ }
+ return 0;
+}
+int store_constructor_account_password_settings (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb7b72ab3 && T->type->name != 0x4848d54c)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_account_privacy_rules (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x554abb6f && T->type->name != 0xaab54490)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "rules", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa8638aec, .id = "PrivacyRule", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_account_sent_change_phone_code (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa4f58c4c && T->type->name != 0x5b0a73b3)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "phone_code_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 17 && !cur_token_quoted && !memcmp (cur_token, "send_call_timeout", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_auth_authorization (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xff036af1 && T->type->name != 0x00fc950e)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_user (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_auth_checked_phone (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x811ea28e && T->type->name != 0x7ee15d71)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bool (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_auth_exported_authorization (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xdf969c2d && T->type->name != 0x206963d2)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "bytes", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_auth_password_recovery (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x137948a5 && T->type->name != 0xec86b75a)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_auth_sent_code (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0cc8bc16 && T->type->name != 0xf33743e9)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 16 && !cur_token_quoted && !memcmp (cur_token, "phone_registered", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bool (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "phone_code_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 17 && !cur_token_quoted && !memcmp (cur_token, "send_call_timeout", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "is_password", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bool (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_auth_sent_app_code (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0cc8bc16 && T->type->name != 0xf33743e9)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 16 && !cur_token_quoted && !memcmp (cur_token, "phone_registered", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bool (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "phone_code_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 17 && !cur_token_quoted && !memcmp (cur_token, "send_call_timeout", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "is_password", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bool (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_binlog_encr_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0377168f && T->type->name != 0xfc88e970)) { return -1; }
+ expect_token ("[", 1);
+ int multiplicity1 = PTR2INT (
+ INT2PTR (64) );
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ while (multiplicity1 -- > 0) {
+ if (store_type_any (field1) < 0) { return -1;}
+ }
+ expect_token ("]", 1);
+ return 0;
+}
+int store_constructor_binlog_start (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ return 0;
+}
+int store_constructor_binlog_dc_option (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "dc", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "name", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "ip", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "port", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_binlog_dc_option_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "dc", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "name", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "ip", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "port", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_binlog_auth_key (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "dc", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "key", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_binlog_encr_key (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_binlog_default_dc (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "dc", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_binlog_dc_signed (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "dc", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_binlog_our_id (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_binlog_set_dh_params (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "root", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "prime", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_binlog_encr_key (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "version", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_binlog_set_pts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_binlog_set_qts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "qts", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_binlog_set_date (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_binlog_set_seq (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "seq", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_binlog_encr_chat_delete (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_binlog_encr_chat_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ if (cur_token_len < 0) { return -1; }
+ if (!is_int ()) { return -1;}
+ struct paramed_type *var0 = INT2PTR (get_int ());
+ out_int (get_int ());
+ assert (var0);
+ local_next_token ();
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field3) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "admin", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field6) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "key", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_binlog_encr_key (field7) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "g_key", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_binlog_encr_key (field8) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "state", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field9) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "ttl", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field10) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 25)) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "layer", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field11) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "in_seq_no", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field12) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ if (cur_token_len >= 0 && cur_token_len == 14 && !cur_token_quoted && !memcmp (cur_token, "last_in_seq_no", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field13) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "out_seq_no", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field14) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 27)) {
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "key_fingerprint", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field15 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field15) < 0) { return -1;}
+ }
+ return 0;
+}
+int store_constructor_binlog_encr_chat_exchange_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ if (cur_token_len < 0) { return -1; }
+ if (!is_int ()) { return -1;}
+ struct paramed_type *var0 = INT2PTR (get_int ());
+ out_int (get_int ());
+ assert (var0);
+ local_next_token ();
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "exchange_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field3) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "key", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfc88e970, .id = "Bare_binlog.EncrKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_binlog_encr_key (field4) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "state", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return -1;}
+ }
+ return 0;
+}
+int store_constructor_binlog_user_delete (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_binlog_user_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ if (cur_token_len < 0) { return -1; }
+ if (!is_int ()) { return -1;}
+ struct paramed_type *var0 = INT2PTR (get_int ());
+ out_int (get_int ());
+ assert (var0);
+ local_next_token ();
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "access_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field3) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "first_name", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "last_name", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field5) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "phone", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field6) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "username", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field7) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_photo (field8) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "real_first_name", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field9) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ if (cur_token_len >= 0 && cur_token_len == 14 && !cur_token_quoted && !memcmp (cur_token, "real_last_name", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field10) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "user_photo", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9a486229, .id = "UserProfilePhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_user_profile_photo (field11) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "last_read_in", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field12) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 25)) {
+ if (cur_token_len >= 0 && cur_token_len == 13 && !cur_token_quoted && !memcmp (cur_token, "last_read_out", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field13) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 26)) {
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "bot_info", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field14 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb2e16f93, .id = "BotInfo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bot_info (field14) < 0) { return -1;}
+ }
+ return 0;
+}
+int store_constructor_binlog_chat_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ if (cur_token_len < 0) { return -1; }
+ if (!is_int ()) { return -1;}
+ struct paramed_type *var0 = INT2PTR (get_int ());
+ out_int (get_int ());
+ assert (var0);
+ local_next_token ();
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "user_num", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "version", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field6) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "participants", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc8d7493e, .id = "ChatParticipant", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field7) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "chat_photo", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x56922676, .id = "ChatPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_chat_photo (field8) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_photo (field9) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "admin", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field10) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "last_read_in", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field11) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 25)) {
+ if (cur_token_len >= 0 && cur_token_len == 13 && !cur_token_quoted && !memcmp (cur_token, "last_read_out", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field12) < 0) { return -1;}
+ }
+ return 0;
+}
+int store_constructor_binlog_chat_add_participant (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "version", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "inviter_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_binlog_chat_del_participant (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "version", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_binlog_set_msg_id (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "old_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "new_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_binlog_message_delete (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "lid", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_binlog_message_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ if (cur_token_len < 0) { return -1; }
+ if (!is_int ()) { return -1;}
+ struct paramed_type *var0 = INT2PTR (get_int ());
+ out_int (get_int ());
+ assert (var0);
+ local_next_token ();
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "lid", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "from_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "to_type", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "to_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "fwd_from_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field6) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 18)) {
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "fwd_date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field7) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field8) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field9) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "media", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_message_media (field10) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "action", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field11 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x383415fa, .id = "MessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_message_action (field11) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "reply_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field12 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field12) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 24)) {
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "reply_markup", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field13 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x612ca4a9, .id = "ReplyMarkup", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_reply_markup (field13) < 0) { return -1;}
+ }
+ return 0;
+}
+int store_constructor_binlog_message_encr_new (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ if (cur_token_len < 0) { return -1; }
+ if (!is_int ()) { return -1;}
+ struct paramed_type *var0 = INT2PTR (get_int ());
+ out_int (get_int ());
+ assert (var0);
+ local_next_token ();
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "lid", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return -1;}
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "from_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "to_type", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 17)) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "to_id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 19)) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field6) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 20)) {
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field7) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 21)) {
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "encr_media", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x34e0d674, .id = "DecryptedMessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_decrypted_message_media (field8) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 22)) {
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "encr_action", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field9 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4e0eefde, .id = "DecryptedMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_decrypted_message_action (field9) < 0) { return -1;}
+ }
+ if (PTR2INT (var0) & (1 << 23)) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "file", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field10 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x886fd032, .id = "EncryptedFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_encrypted_file (field10) < 0) { return -1;}
+ }
+ return 0;
+}
+int store_constructor_binlog_msg_update (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "lid", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_binlog_reset_authorization (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x66ff03a6 && T->type->name != 0x9900fc59)) { return -1; }
+ return 0;
+}
+int store_constructor_contacts_blocked (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8c1b8fb4 && T->type->name != 0x73e4704b)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "blocked", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x561bc879, .id = "ContactBlocked", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_contacts_blocked_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8c1b8fb4 && T->type->name != 0x73e4704b)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "count", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "blocked", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x561bc879, .id = "ContactBlocked", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_contacts_contacts_not_modified (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd8c02560 && T->type->name != 0x273fda9f)) { return -1; }
+ return 0;
+}
+int store_constructor_contacts_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xd8c02560 && T->type->name != 0x273fda9f)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "contacts", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf911c994, .id = "Contact", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_contacts_found (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x0566000e && T->type->name != 0xfa99fff1)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "results", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xea879f95, .id = "ContactFound", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_contacts_imported_contacts (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xad524315 && T->type->name != 0x52adbcea)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "imported", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xd0028438, .id = "ImportedContact", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 14 && !cur_token_quoted && !memcmp (cur_token, "retry_contacts", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_contacts_link (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3ace484c && T->type->name != 0xc531b7b3)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "my_link", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_contact_link (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "foreign_link", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x522fbc63, .id = "ContactLink", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_contact_link (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "user", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_user (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_contacts_suggested (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x5649dcc5 && T->type->name != 0xa9b6233a)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "results", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3de191a1, .id = "ContactSuggested", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_geochats_located (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x48feb267 && T->type->name != 0xb7014d98)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "results", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3631cf4c, .id = "ChatLocated", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "messages", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "chats", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_geochats_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6d0a0e59 && T->type->name != 0x92f5f1a6)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "messages", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "chats", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_geochats_messages_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x6d0a0e59 && T->type->name != 0x92f5f1a6)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "count", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "messages", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "chats", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_geochats_stated_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17b1578b && T->type->name != 0xe84ea874)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf67b4034, .id = "GeoChatMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_geo_chat_message (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "chats", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "seq", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_help_app_update (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4ddd9627 && T->type->name != 0xb22269d8)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "critical", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bool (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "url", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "text", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_help_no_app_update (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x4ddd9627 && T->type->name != 0xb22269d8)) { return -1; }
+ return 0;
+}
+int store_constructor_help_invite_text (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x18cb9f78 && T->type->name != 0xe7346087)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_help_support (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x17c6b5f6 && T->type->name != 0xe8394a09)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "phone_number", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "user", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_user (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_messages_affected_history (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb45c69d1 && T->type->name != 0x4ba3962e)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "pts_count", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "offset", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_messages_affected_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x84d19185 && T->type->name != 0x7b2e6e7a)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "pts_count", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_messages_all_stickers_not_modified (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb485502f && T->type->name != 0x4b7aafd0)) { return -1; }
+ return 0;
+}
+int store_constructor_messages_all_stickers (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb485502f && T->type->name != 0x4b7aafd0)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "packs", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x12b299d4, .id = "StickerPack", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "sets", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa7a43b17, .id = "StickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "documents", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_messages_chat_full (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xe5d7d19c && T->type->name != 0x1a282e63)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "full_chat", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02a614, .id = "ChatFull", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_chat_full (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "chats", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_messages_chats (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x64ff9fd5 && T->type->name != 0x9b00602a)) { return -1; }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_messages_dh_config_not_modified (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xecc058e8 && T->type->name != 0x133fa717)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "random", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_messages_dh_config (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xecc058e8 && T->type->name != 0x133fa717)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "g", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "p", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "version", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "random", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_messages_dialogs (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x645af8b3 && T->type->name != 0x9ba5074c)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "dialogs", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc1dd804a, .id = "Dialog", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "messages", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "chats", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_messages_dialogs_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x645af8b3 && T->type->name != 0x9ba5074c)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "count", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "dialogs", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc1dd804a, .id = "Dialog", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "messages", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "chats", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field5) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_messages_message_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3f4e0648 && T->type->name != 0xc0b1f9b7)) { return -1; }
+ return 0;
+}
+int store_constructor_messages_messages (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8735e464 && T->type->name != 0x78ca1b9b)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "messages", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "chats", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_messages_messages_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x8735e464 && T->type->name != 0x78ca1b9b)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "count", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "messages", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "chats", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field4) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_messages_sent_encrypted_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc29c7607 && T->type->name != 0x3d6389f8)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_messages_sent_encrypted_file (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xc29c7607 && T->type->name != 0x3d6389f8)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "file", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x886fd032, .id = "EncryptedFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_encrypted_file (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_messages_sent_message (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x799ce190 && T->type->name != 0x86631e6f)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "media", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_message_media (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "pts_count", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_messages_sent_message_link (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x799ce190 && T->type->name != 0x86631e6f)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "media", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_message_media (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "pts_count", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "links", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3ace484c, .id = "contacts.Link", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field6) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "seq", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field7) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_messages_sticker_set (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xb60a24a6 && T->type->name != 0x49f5db59)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "set", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa7a43b17, .id = "StickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_sticker_set (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "packs", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x12b299d4, .id = "StickerPack", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "documents", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_messages_stickers_not_modified (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bfa5710 && T->type->name != 0x8405a8ef)) { return -1; }
+ return 0;
+}
+int store_constructor_messages_stickers (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x7bfa5710 && T->type->name != 0x8405a8ef)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "hash", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "stickers", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x51a73418, .id = "Document", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_photos_photo (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x20212ca8 && T->type->name != 0xdfded357)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_photo (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_photos_photos (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x98cf75f1 && T->type->name != 0x67308a0e)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "photos", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_photos_photos_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x98cf75f1 && T->type->name != 0x67308a0e)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "count", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "photos", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc207550a, .id = "Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field3) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_storage_file_unknown (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int store_constructor_storage_file_jpeg (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int store_constructor_storage_file_gif (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int store_constructor_storage_file_png (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int store_constructor_storage_file_pdf (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int store_constructor_storage_file_mp3 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int store_constructor_storage_file_mov (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int store_constructor_storage_file_partial (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int store_constructor_storage_file_mp4 (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int store_constructor_storage_file_webp (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x3e2838a8 && T->type->name != 0xc1d7c757)) { return -1; }
+ return 0;
+}
+int store_constructor_updates_difference_empty (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf57a2419 && T->type->name != 0x0a85dbe6)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "seq", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_updates_difference (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf57a2419 && T->type->name != 0x0a85dbe6)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "new_messages", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 22 && !cur_token_quoted && !memcmp (cur_token, "new_encrypted_messages", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xce6b8a1e, .id = "EncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 13 && !cur_token_quoted && !memcmp (cur_token, "other_updates", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "chats", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "state", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa56c2a3e, .id = "updates.State", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_updates_state (field6) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_updates_difference_slice (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xf57a2419 && T->type->name != 0x0a85dbe6)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "new_messages", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5d652a7f, .id = "Message", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 22 && !cur_token_quoted && !memcmp (cur_token, "new_encrypted_messages", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xce6b8a1e, .id = "EncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 13 && !cur_token_quoted && !memcmp (cur_token, "other_updates", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x2e02b27e, .id = "Update", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "chats", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bd865dc, .id = "Chat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field5) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 18 && !cur_token_quoted && !memcmp (cur_token, "intermediate_state", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa56c2a3e, .id = "updates.State", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_updates_state (field6) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_updates_state (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0xa56c2a3e && T->type->name != 0x5a93d5c1)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "qts", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "seq", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "unread_count", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return -1;}
+ return 0;
+}
+int store_constructor_upload_file (struct paramed_type *T) {
+ if (ODDP(T) || (T->type->name != 0x096a18d5 && T->type->name != 0xf695e72a)) { return -1; }
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "type", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3e2838a8, .id = "storage.FileType", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_storage_file_type (field1) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "mtime", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return -1;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "bytes", cur_token_len)) {
+ local_next_token ();
+ expect_token (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field3) < 0) { return -1;}
+ return 0;
+}
+int store_type_account_days_t_t_l (struct paramed_type *T) {
+ out_int (0xb8d0afdf);
+ if (store_constructor_account_days_t_t_l (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_bare_account_days_t_t_l (struct paramed_type *T) {
+ if (store_constructor_account_days_t_t_l (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_audio (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 10 && !memcmp (cur_token, "audioEmpty", cur_token_len)) {
+ out_int (0x586988d8);
+ local_next_token ();
+ if (store_constructor_audio_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 5 && !memcmp (cur_token, "audio", cur_token_len)) {
+ out_int (0xc7ac6496);
+ local_next_token ();
+ if (store_constructor_audio (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_audio (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 10 && !memcmp (cur_token, "audioEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_audio_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 5 && !memcmp (cur_token, "audio", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_audio (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_authorization (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "authorization", cur_token_len)) {
+ out_int (0x7bf2e6f6);
+ local_next_token ();
+ if (store_constructor_authorization (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_authorization (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "authorization", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_authorization (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bool (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 9 && !memcmp (cur_token, "boolFalse", cur_token_len)) {
+ out_int (0xbc799737);
+ local_next_token ();
+ if (store_constructor_bool_false (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 8 && !memcmp (cur_token, "boolTrue", cur_token_len)) {
+ out_int (0x997275b5);
+ local_next_token ();
+ if (store_constructor_bool_true (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_bool (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 9 && !memcmp (cur_token, "boolFalse", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_bool_false (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 8 && !memcmp (cur_token, "boolTrue", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_bool_true (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bot_command (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 10 && !memcmp (cur_token, "botCommand", cur_token_len)) {
+ out_int (0xc27ac8c7);
+ local_next_token ();
+ if (store_constructor_bot_command (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "botCommandOld", cur_token_len)) {
+ out_int (0xb79d22ab);
+ local_next_token ();
+ if (store_constructor_bot_command_old (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_bot_command (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 10 && !memcmp (cur_token, "botCommand", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_bot_command (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "botCommandOld", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_bot_command_old (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bot_info (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 12 && !memcmp (cur_token, "botInfoEmpty", cur_token_len)) {
+ out_int (0xbb2e37ce);
+ local_next_token ();
+ if (store_constructor_bot_info_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 7 && !memcmp (cur_token, "botInfo", cur_token_len)) {
+ out_int (0x09cf585d);
+ local_next_token ();
+ if (store_constructor_bot_info (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_bot_info (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 12 && !memcmp (cur_token, "botInfoEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_bot_info_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 7 && !memcmp (cur_token, "botInfo", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_bot_info (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bytes (struct paramed_type *T) {
+ out_int (0x0ee1379f);
+ if (store_constructor_bytes (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_bare_bytes (struct paramed_type *T) {
+ if (store_constructor_bytes (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_chat (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 9 && !memcmp (cur_token, "chatEmpty", cur_token_len)) {
+ out_int (0x9ba2d800);
+ local_next_token ();
+ if (store_constructor_chat_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 4 && !memcmp (cur_token, "chat", cur_token_len)) {
+ out_int (0x6e9c9bc7);
+ local_next_token ();
+ if (store_constructor_chat (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "chatForbidden", cur_token_len)) {
+ out_int (0xfb0ccc41);
+ local_next_token ();
+ if (store_constructor_chat_forbidden (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 7 && !memcmp (cur_token, "geoChat", cur_token_len)) {
+ out_int (0x75eaea5a);
+ local_next_token ();
+ if (store_constructor_geo_chat (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_chat (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 9 && !memcmp (cur_token, "chatEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_chat_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 4 && !memcmp (cur_token, "chat", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_chat (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "chatForbidden", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_chat_forbidden (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 7 && !memcmp (cur_token, "geoChat", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_geo_chat (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_chat_full (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 8 && !memcmp (cur_token, "chatFull", cur_token_len)) {
+ out_int (0x2e02a614);
+ local_next_token ();
+ if (store_constructor_chat_full (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_chat_full (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 8 && !memcmp (cur_token, "chatFull", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_chat_full (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_chat_invite (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "chatInviteAlready", cur_token_len)) {
+ out_int (0x5a686d7c);
+ local_next_token ();
+ if (store_constructor_chat_invite_already (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 10 && !memcmp (cur_token, "chatInvite", cur_token_len)) {
+ out_int (0xce917dcd);
+ local_next_token ();
+ if (store_constructor_chat_invite (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_chat_invite (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "chatInviteAlready", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_chat_invite_already (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 10 && !memcmp (cur_token, "chatInvite", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_chat_invite (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_chat_located (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 11 && !memcmp (cur_token, "chatLocated", cur_token_len)) {
+ out_int (0x3631cf4c);
+ local_next_token ();
+ if (store_constructor_chat_located (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_chat_located (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 11 && !memcmp (cur_token, "chatLocated", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_chat_located (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_chat_participant (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "chatParticipant", cur_token_len)) {
+ out_int (0xc8d7493e);
+ local_next_token ();
+ if (store_constructor_chat_participant (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_chat_participant (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "chatParticipant", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_chat_participant (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_chat_participants (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 25 && !memcmp (cur_token, "chatParticipantsForbidden", cur_token_len)) {
+ out_int (0x0fd2bb8a);
+ local_next_token ();
+ if (store_constructor_chat_participants_forbidden (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "chatParticipants", cur_token_len)) {
+ out_int (0x7841b415);
+ local_next_token ();
+ if (store_constructor_chat_participants (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_chat_participants (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 25 && !memcmp (cur_token, "chatParticipantsForbidden", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_chat_participants_forbidden (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "chatParticipants", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_chat_participants (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_chat_photo (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "chatPhotoEmpty", cur_token_len)) {
+ out_int (0x37c1011c);
+ local_next_token ();
+ if (store_constructor_chat_photo_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 9 && !memcmp (cur_token, "chatPhoto", cur_token_len)) {
+ out_int (0x6153276a);
+ local_next_token ();
+ if (store_constructor_chat_photo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_chat_photo (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "chatPhotoEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_chat_photo_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 9 && !memcmp (cur_token, "chatPhoto", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_chat_photo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_client_d_h_inner_data (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 20 && !memcmp (cur_token, "client_DH_inner_data", cur_token_len)) {
+ out_int (0x6643b654);
+ local_next_token ();
+ if (store_constructor_client_d_h_inner_data (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_client_d_h_inner_data (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 20 && !memcmp (cur_token, "client_DH_inner_data", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_client_d_h_inner_data (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_config (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 6 && !memcmp (cur_token, "config", cur_token_len)) {
+ out_int (0x4e32b894);
+ local_next_token ();
+ if (store_constructor_config (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_config (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 6 && !memcmp (cur_token, "config", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_config (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_contact (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 7 && !memcmp (cur_token, "contact", cur_token_len)) {
+ out_int (0xf911c994);
+ local_next_token ();
+ if (store_constructor_contact (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_contact (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 7 && !memcmp (cur_token, "contact", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_contact (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_contact_blocked (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "contactBlocked", cur_token_len)) {
+ out_int (0x561bc879);
+ local_next_token ();
+ if (store_constructor_contact_blocked (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_contact_blocked (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "contactBlocked", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_contact_blocked (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_contact_found (struct paramed_type *T) {
+ out_int (0xea879f95);
+ if (store_constructor_contact_found (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_bare_contact_found (struct paramed_type *T) {
+ if (store_constructor_contact_found (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_contact_link (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "contactLinkUnknown", cur_token_len)) {
+ out_int (0x5f4f9247);
+ local_next_token ();
+ if (store_constructor_contact_link_unknown (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "contactLinkNone", cur_token_len)) {
+ out_int (0xfeedd3ad);
+ local_next_token ();
+ if (store_constructor_contact_link_none (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "contactLinkHasPhone", cur_token_len)) {
+ out_int (0x268f3f59);
+ local_next_token ();
+ if (store_constructor_contact_link_has_phone (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "contactLinkContact", cur_token_len)) {
+ out_int (0xd502c2d0);
+ local_next_token ();
+ if (store_constructor_contact_link_contact (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_contact_link (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "contactLinkUnknown", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_contact_link_unknown (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "contactLinkNone", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_contact_link_none (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "contactLinkHasPhone", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_contact_link_has_phone (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "contactLinkContact", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_contact_link_contact (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_contact_status (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "contactStatus", cur_token_len)) {
+ out_int (0xd3680c61);
+ local_next_token ();
+ if (store_constructor_contact_status (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_contact_status (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "contactStatus", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_contact_status (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_contact_suggested (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 16 && !memcmp (cur_token, "contactSuggested", cur_token_len)) {
+ out_int (0x3de191a1);
+ local_next_token ();
+ if (store_constructor_contact_suggested (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_contact_suggested (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 16 && !memcmp (cur_token, "contactSuggested", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_contact_suggested (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_dc_option (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 11 && !memcmp (cur_token, "dcOptionL28", cur_token_len)) {
+ out_int (0x2ec2a43c);
+ local_next_token ();
+ if (store_constructor_dc_option_l28 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 8 && !memcmp (cur_token, "dcOption", cur_token_len)) {
+ out_int (0x05d8c6cc);
+ local_next_token ();
+ if (store_constructor_dc_option (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_dc_option (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 11 && !memcmp (cur_token, "dcOptionL28", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_dc_option_l28 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 8 && !memcmp (cur_token, "dcOption", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_dc_option (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_decrypted_message (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 16 && !memcmp (cur_token, "decryptedMessage", cur_token_len)) {
+ out_int (0x204d3878);
+ local_next_token ();
+ if (store_constructor_decrypted_message (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "decryptedMessageService", cur_token_len)) {
+ out_int (0x73164160);
+ local_next_token ();
+ if (store_constructor_decrypted_message_service (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_decrypted_message (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 16 && !memcmp (cur_token, "decryptedMessage", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_decrypted_message (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "decryptedMessageService", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_decrypted_message_service (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_decrypted_message_action (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 35 && !memcmp (cur_token, "decryptedMessageActionSetMessageTTL", cur_token_len)) {
+ out_int (0xa1733aec);
+ local_next_token ();
+ if (store_constructor_decrypted_message_action_set_message_t_t_l (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 34 && !memcmp (cur_token, "decryptedMessageActionReadMessages", cur_token_len)) {
+ out_int (0x0c4f40be);
+ local_next_token ();
+ if (store_constructor_decrypted_message_action_read_messages (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 36 && !memcmp (cur_token, "decryptedMessageActionDeleteMessages", cur_token_len)) {
+ out_int (0x65614304);
+ local_next_token ();
+ if (store_constructor_decrypted_message_action_delete_messages (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 40 && !memcmp (cur_token, "decryptedMessageActionScreenshotMessages", cur_token_len)) {
+ out_int (0x8ac1f475);
+ local_next_token ();
+ if (store_constructor_decrypted_message_action_screenshot_messages (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 34 && !memcmp (cur_token, "decryptedMessageActionFlushHistory", cur_token_len)) {
+ out_int (0x6719e45c);
+ local_next_token ();
+ if (store_constructor_decrypted_message_action_flush_history (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "decryptedMessageActionResend", cur_token_len)) {
+ out_int (0x511110b0);
+ local_next_token ();
+ if (store_constructor_decrypted_message_action_resend (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 33 && !memcmp (cur_token, "decryptedMessageActionNotifyLayer", cur_token_len)) {
+ out_int (0xf3048883);
+ local_next_token ();
+ if (store_constructor_decrypted_message_action_notify_layer (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "decryptedMessageActionTyping", cur_token_len)) {
+ out_int (0xccb27641);
+ local_next_token ();
+ if (store_constructor_decrypted_message_action_typing (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 32 && !memcmp (cur_token, "decryptedMessageActionRequestKey", cur_token_len)) {
+ out_int (0xf3c9611b);
+ local_next_token ();
+ if (store_constructor_decrypted_message_action_request_key (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 31 && !memcmp (cur_token, "decryptedMessageActionAcceptKey", cur_token_len)) {
+ out_int (0x6fe1735b);
+ local_next_token ();
+ if (store_constructor_decrypted_message_action_accept_key (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 30 && !memcmp (cur_token, "decryptedMessageActionAbortKey", cur_token_len)) {
+ out_int (0xdd05ec6b);
+ local_next_token ();
+ if (store_constructor_decrypted_message_action_abort_key (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 31 && !memcmp (cur_token, "decryptedMessageActionCommitKey", cur_token_len)) {
+ out_int (0xec2e0b9b);
+ local_next_token ();
+ if (store_constructor_decrypted_message_action_commit_key (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "decryptedMessageActionNoop", cur_token_len)) {
+ out_int (0xa82fdd63);
+ local_next_token ();
+ if (store_constructor_decrypted_message_action_noop (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_decrypted_message_action (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 35 && !memcmp (cur_token, "decryptedMessageActionSetMessageTTL", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_decrypted_message_action_set_message_t_t_l (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 34 && !memcmp (cur_token, "decryptedMessageActionReadMessages", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_decrypted_message_action_read_messages (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 36 && !memcmp (cur_token, "decryptedMessageActionDeleteMessages", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_decrypted_message_action_delete_messages (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 40 && !memcmp (cur_token, "decryptedMessageActionScreenshotMessages", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_decrypted_message_action_screenshot_messages (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 34 && !memcmp (cur_token, "decryptedMessageActionFlushHistory", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_decrypted_message_action_flush_history (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "decryptedMessageActionResend", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_decrypted_message_action_resend (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 33 && !memcmp (cur_token, "decryptedMessageActionNotifyLayer", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_decrypted_message_action_notify_layer (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "decryptedMessageActionTyping", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_decrypted_message_action_typing (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 32 && !memcmp (cur_token, "decryptedMessageActionRequestKey", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_decrypted_message_action_request_key (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 31 && !memcmp (cur_token, "decryptedMessageActionAcceptKey", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_decrypted_message_action_accept_key (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 30 && !memcmp (cur_token, "decryptedMessageActionAbortKey", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_decrypted_message_action_abort_key (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 31 && !memcmp (cur_token, "decryptedMessageActionCommitKey", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_decrypted_message_action_commit_key (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "decryptedMessageActionNoop", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_decrypted_message_action_noop (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_decrypted_message_layer (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 21 && !memcmp (cur_token, "decryptedMessageLayer", cur_token_len)) {
+ out_int (0x1be31789);
+ local_next_token ();
+ if (store_constructor_decrypted_message_layer (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_decrypted_message_layer (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 21 && !memcmp (cur_token, "decryptedMessageLayer", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_decrypted_message_layer (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_decrypted_message_media (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 26 && !memcmp (cur_token, "decryptedMessageMediaEmpty", cur_token_len)) {
+ out_int (0x089f5c4a);
+ local_next_token ();
+ if (store_constructor_decrypted_message_media_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "decryptedMessageMediaPhoto", cur_token_len)) {
+ out_int (0x32798a8c);
+ local_next_token ();
+ if (store_constructor_decrypted_message_media_photo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "decryptedMessageMediaGeoPoint", cur_token_len)) {
+ out_int (0x35480a59);
+ local_next_token ();
+ if (store_constructor_decrypted_message_media_geo_point (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "decryptedMessageMediaContact", cur_token_len)) {
+ out_int (0x588a0a97);
+ local_next_token ();
+ if (store_constructor_decrypted_message_media_contact (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "decryptedMessageMediaDocument", cur_token_len)) {
+ out_int (0xb095434b);
+ local_next_token ();
+ if (store_constructor_decrypted_message_media_document (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "decryptedMessageMediaVideo", cur_token_len)) {
+ out_int (0x524a415d);
+ local_next_token ();
+ if (store_constructor_decrypted_message_media_video (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "decryptedMessageMediaAudio", cur_token_len)) {
+ out_int (0x57e0a9cb);
+ local_next_token ();
+ if (store_constructor_decrypted_message_media_audio (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 37 && !memcmp (cur_token, "decryptedMessageMediaExternalDocument", cur_token_len)) {
+ out_int (0xfa95b0dd);
+ local_next_token ();
+ if (store_constructor_decrypted_message_media_external_document (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "decryptedMessageMediaVideoL12", cur_token_len)) {
+ out_int (0x4cee6ef3);
+ local_next_token ();
+ if (store_constructor_decrypted_message_media_video_l12 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "decryptedMessageMediaAudioL12", cur_token_len)) {
+ out_int (0x6080758f);
+ local_next_token ();
+ if (store_constructor_decrypted_message_media_audio_l12 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_decrypted_message_media (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 26 && !memcmp (cur_token, "decryptedMessageMediaEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_decrypted_message_media_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "decryptedMessageMediaPhoto", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_decrypted_message_media_photo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "decryptedMessageMediaGeoPoint", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_decrypted_message_media_geo_point (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "decryptedMessageMediaContact", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_decrypted_message_media_contact (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "decryptedMessageMediaDocument", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_decrypted_message_media_document (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "decryptedMessageMediaVideo", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_decrypted_message_media_video (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "decryptedMessageMediaAudio", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_decrypted_message_media_audio (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 37 && !memcmp (cur_token, "decryptedMessageMediaExternalDocument", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_decrypted_message_media_external_document (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "decryptedMessageMediaVideoL12", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_decrypted_message_media_video_l12 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "decryptedMessageMediaAudioL12", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_decrypted_message_media_audio_l12 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_dialog (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 6 && !memcmp (cur_token, "dialog", cur_token_len)) {
+ out_int (0xc1dd804a);
+ local_next_token ();
+ if (store_constructor_dialog (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_dialog (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 6 && !memcmp (cur_token, "dialog", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_dialog (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_disabled_feature (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "disabledFeature", cur_token_len)) {
+ out_int (0xae636f24);
+ local_next_token ();
+ if (store_constructor_disabled_feature (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_disabled_feature (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "disabledFeature", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_disabled_feature (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_document (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "documentEmpty", cur_token_len)) {
+ out_int (0x36f8c871);
+ local_next_token ();
+ if (store_constructor_document_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 8 && !memcmp (cur_token, "document", cur_token_len)) {
+ out_int (0xf9a39f4f);
+ local_next_token ();
+ if (store_constructor_document (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 12 && !memcmp (cur_token, "document_l19", cur_token_len)) {
+ out_int (0x9efc6326);
+ local_next_token ();
+ if (store_constructor_document_l19 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_document (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "documentEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_document_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 8 && !memcmp (cur_token, "document", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_document (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 12 && !memcmp (cur_token, "document_l19", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_document_l19 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_document_attribute (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 26 && !memcmp (cur_token, "documentAttributeImageSize", cur_token_len)) {
+ out_int (0x6c37c15c);
+ local_next_token ();
+ if (store_constructor_document_attribute_image_size (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "documentAttributeAnimated", cur_token_len)) {
+ out_int (0x11b58939);
+ local_next_token ();
+ if (store_constructor_document_attribute_animated (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "documentAttributeStickerL28", cur_token_len)) {
+ out_int (0x994c9882);
+ local_next_token ();
+ if (store_constructor_document_attribute_sticker_l28 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "documentAttributeSticker", cur_token_len)) {
+ out_int (0x3a556302);
+ local_next_token ();
+ if (store_constructor_document_attribute_sticker (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "documentAttributeVideo", cur_token_len)) {
+ out_int (0x5910cccb);
+ local_next_token ();
+ if (store_constructor_document_attribute_video (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "documentAttributeAudio", cur_token_len)) {
+ out_int (0x051448e5);
+ local_next_token ();
+ if (store_constructor_document_attribute_audio (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "documentAttributeFilename", cur_token_len)) {
+ out_int (0x15590068);
+ local_next_token ();
+ if (store_constructor_document_attribute_filename (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_document_attribute (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 26 && !memcmp (cur_token, "documentAttributeImageSize", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_document_attribute_image_size (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "documentAttributeAnimated", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_document_attribute_animated (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "documentAttributeStickerL28", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_document_attribute_sticker_l28 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "documentAttributeSticker", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_document_attribute_sticker (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "documentAttributeVideo", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_document_attribute_video (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "documentAttributeAudio", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_document_attribute_audio (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "documentAttributeFilename", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_document_attribute_filename (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_double (struct paramed_type *T) {
+ out_int (0x2210c154);
+ if (store_constructor_double (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_bare_double (struct paramed_type *T) {
+ if (store_constructor_double (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_encrypted_chat (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "encryptedChatEmpty", cur_token_len)) {
+ out_int (0xab7ec0a0);
+ local_next_token ();
+ if (store_constructor_encrypted_chat_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "encryptedChatWaiting", cur_token_len)) {
+ out_int (0x3bf703dc);
+ local_next_token ();
+ if (store_constructor_encrypted_chat_waiting (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "encryptedChatRequested", cur_token_len)) {
+ out_int (0xc878527e);
+ local_next_token ();
+ if (store_constructor_encrypted_chat_requested (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "encryptedChat", cur_token_len)) {
+ out_int (0xfa56ce36);
+ local_next_token ();
+ if (store_constructor_encrypted_chat (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "encryptedChatDiscarded", cur_token_len)) {
+ out_int (0x13d6dd27);
+ local_next_token ();
+ if (store_constructor_encrypted_chat_discarded (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_encrypted_chat (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "encryptedChatEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_encrypted_chat_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "encryptedChatWaiting", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_encrypted_chat_waiting (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "encryptedChatRequested", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_encrypted_chat_requested (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "encryptedChat", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_encrypted_chat (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "encryptedChatDiscarded", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_encrypted_chat_discarded (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_encrypted_file (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "encryptedFileEmpty", cur_token_len)) {
+ out_int (0xc21f497e);
+ local_next_token ();
+ if (store_constructor_encrypted_file_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "encryptedFile", cur_token_len)) {
+ out_int (0x4a70994c);
+ local_next_token ();
+ if (store_constructor_encrypted_file (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_encrypted_file (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "encryptedFileEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_encrypted_file_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "encryptedFile", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_encrypted_file (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_encrypted_message (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 16 && !memcmp (cur_token, "encryptedMessage", cur_token_len)) {
+ out_int (0xed18c118);
+ local_next_token ();
+ if (store_constructor_encrypted_message (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "encryptedMessageService", cur_token_len)) {
+ out_int (0x23734b06);
+ local_next_token ();
+ if (store_constructor_encrypted_message_service (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_encrypted_message (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 16 && !memcmp (cur_token, "encryptedMessage", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_encrypted_message (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "encryptedMessageService", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_encrypted_message_service (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_error (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 5 && !memcmp (cur_token, "error", cur_token_len)) {
+ out_int (0xc4b9f9bb);
+ local_next_token ();
+ if (store_constructor_error (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_error (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 5 && !memcmp (cur_token, "error", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_error (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_exported_chat_invite (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "chatInviteEmpty", cur_token_len)) {
+ out_int (0x69df3769);
+ local_next_token ();
+ if (store_constructor_chat_invite_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "chatInviteExported", cur_token_len)) {
+ out_int (0xfc2e05bc);
+ local_next_token ();
+ if (store_constructor_chat_invite_exported (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_exported_chat_invite (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "chatInviteEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_chat_invite_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "chatInviteExported", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_chat_invite_exported (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_file_location (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 23 && !memcmp (cur_token, "fileLocationUnavailable", cur_token_len)) {
+ out_int (0x7c596b46);
+ local_next_token ();
+ if (store_constructor_file_location_unavailable (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 12 && !memcmp (cur_token, "fileLocation", cur_token_len)) {
+ out_int (0x53d69076);
+ local_next_token ();
+ if (store_constructor_file_location (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_file_location (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 23 && !memcmp (cur_token, "fileLocationUnavailable", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_file_location_unavailable (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 12 && !memcmp (cur_token, "fileLocation", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_file_location (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_geo_chat_message (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 19 && !memcmp (cur_token, "geoChatMessageEmpty", cur_token_len)) {
+ out_int (0x60311a9b);
+ local_next_token ();
+ if (store_constructor_geo_chat_message_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "geoChatMessage", cur_token_len)) {
+ out_int (0x4505f8e1);
+ local_next_token ();
+ if (store_constructor_geo_chat_message (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "geoChatMessageService", cur_token_len)) {
+ out_int (0xd34fa24e);
+ local_next_token ();
+ if (store_constructor_geo_chat_message_service (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_geo_chat_message (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 19 && !memcmp (cur_token, "geoChatMessageEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_geo_chat_message_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "geoChatMessage", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_geo_chat_message (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "geoChatMessageService", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_geo_chat_message_service (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_geo_point (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "geoPointEmpty", cur_token_len)) {
+ out_int (0x1117dd5f);
+ local_next_token ();
+ if (store_constructor_geo_point_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 8 && !memcmp (cur_token, "geoPoint", cur_token_len)) {
+ out_int (0x2049d70c);
+ local_next_token ();
+ if (store_constructor_geo_point (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_geo_point (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "geoPointEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_geo_point_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 8 && !memcmp (cur_token, "geoPoint", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_geo_point (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_imported_contact (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "importedContact", cur_token_len)) {
+ out_int (0xd0028438);
+ local_next_token ();
+ if (store_constructor_imported_contact (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_imported_contact (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "importedContact", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_imported_contact (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_input_app_event (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "inputAppEvent", cur_token_len)) {
+ out_int (0x770656a8);
+ local_next_token ();
+ if (store_constructor_input_app_event (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_input_app_event (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "inputAppEvent", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_app_event (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_input_audio (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputAudioEmpty", cur_token_len)) {
+ out_int (0xd95adc84);
+ local_next_token ();
+ if (store_constructor_input_audio_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 10 && !memcmp (cur_token, "inputAudio", cur_token_len)) {
+ out_int (0x77d440ff);
+ local_next_token ();
+ if (store_constructor_input_audio (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_input_audio (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputAudioEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_audio_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 10 && !memcmp (cur_token, "inputAudio", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_audio (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_input_chat_photo (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 19 && !memcmp (cur_token, "inputChatPhotoEmpty", cur_token_len)) {
+ out_int (0x1ca48f57);
+ local_next_token ();
+ if (store_constructor_input_chat_photo_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "inputChatUploadedPhoto", cur_token_len)) {
+ out_int (0x94254732);
+ local_next_token ();
+ if (store_constructor_input_chat_uploaded_photo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "inputChatPhoto", cur_token_len)) {
+ out_int (0xb2e1bf08);
+ local_next_token ();
+ if (store_constructor_input_chat_photo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_input_chat_photo (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 19 && !memcmp (cur_token, "inputChatPhotoEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_chat_photo_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "inputChatUploadedPhoto", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_chat_uploaded_photo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "inputChatPhoto", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_chat_photo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_input_contact (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "inputPhoneContact", cur_token_len)) {
+ out_int (0xf392b7f4);
+ local_next_token ();
+ if (store_constructor_input_phone_contact (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_input_contact (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "inputPhoneContact", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_phone_contact (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_input_document (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "inputDocumentEmpty", cur_token_len)) {
+ out_int (0x72f0eaae);
+ local_next_token ();
+ if (store_constructor_input_document_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "inputDocument", cur_token_len)) {
+ out_int (0x18798952);
+ local_next_token ();
+ if (store_constructor_input_document (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_input_document (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "inputDocumentEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_document_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "inputDocument", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_document (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_input_encrypted_chat (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "inputEncryptedChat", cur_token_len)) {
+ out_int (0xf141b5e1);
+ local_next_token ();
+ if (store_constructor_input_encrypted_chat (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_input_encrypted_chat (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "inputEncryptedChat", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_encrypted_chat (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_input_encrypted_file (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 23 && !memcmp (cur_token, "inputEncryptedFileEmpty", cur_token_len)) {
+ out_int (0x1837c364);
+ local_next_token ();
+ if (store_constructor_input_encrypted_file_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "inputEncryptedFileUploaded", cur_token_len)) {
+ out_int (0x64bd0306);
+ local_next_token ();
+ if (store_constructor_input_encrypted_file_uploaded (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "inputEncryptedFile", cur_token_len)) {
+ out_int (0x5a17b5e5);
+ local_next_token ();
+ if (store_constructor_input_encrypted_file (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "inputEncryptedFileBigUploaded", cur_token_len)) {
+ out_int (0x2dc173c8);
+ local_next_token ();
+ if (store_constructor_input_encrypted_file_big_uploaded (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_input_encrypted_file (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 23 && !memcmp (cur_token, "inputEncryptedFileEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_encrypted_file_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "inputEncryptedFileUploaded", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_encrypted_file_uploaded (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "inputEncryptedFile", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_encrypted_file (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "inputEncryptedFileBigUploaded", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_encrypted_file_big_uploaded (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_input_file (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 9 && !memcmp (cur_token, "inputFile", cur_token_len)) {
+ out_int (0xf52ff27f);
+ local_next_token ();
+ if (store_constructor_input_file (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 12 && !memcmp (cur_token, "inputFileBig", cur_token_len)) {
+ out_int (0xfa4f0bb5);
+ local_next_token ();
+ if (store_constructor_input_file_big (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_input_file (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 9 && !memcmp (cur_token, "inputFile", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_file (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 12 && !memcmp (cur_token, "inputFileBig", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_file_big (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_input_file_location (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "inputFileLocation", cur_token_len)) {
+ out_int (0x14637196);
+ local_next_token ();
+ if (store_constructor_input_file_location (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "inputVideoFileLocation", cur_token_len)) {
+ out_int (0x3d0364ec);
+ local_next_token ();
+ if (store_constructor_input_video_file_location (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "inputEncryptedFileLocation", cur_token_len)) {
+ out_int (0xf5235d55);
+ local_next_token ();
+ if (store_constructor_input_encrypted_file_location (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "inputAudioFileLocation", cur_token_len)) {
+ out_int (0x74dc404d);
+ local_next_token ();
+ if (store_constructor_input_audio_file_location (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "inputDocumentFileLocation", cur_token_len)) {
+ out_int (0x4e45abe9);
+ local_next_token ();
+ if (store_constructor_input_document_file_location (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_input_file_location (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "inputFileLocation", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_file_location (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "inputVideoFileLocation", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_video_file_location (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "inputEncryptedFileLocation", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_encrypted_file_location (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "inputAudioFileLocation", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_audio_file_location (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "inputDocumentFileLocation", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_document_file_location (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_input_geo_chat (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 12 && !memcmp (cur_token, "inputGeoChat", cur_token_len)) {
+ out_int (0x74d456fa);
+ local_next_token ();
+ if (store_constructor_input_geo_chat (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_input_geo_chat (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 12 && !memcmp (cur_token, "inputGeoChat", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_geo_chat (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_input_geo_point (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "inputGeoPointEmpty", cur_token_len)) {
+ out_int (0xe4c123d6);
+ local_next_token ();
+ if (store_constructor_input_geo_point_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "inputGeoPoint", cur_token_len)) {
+ out_int (0xf3b7acc9);
+ local_next_token ();
+ if (store_constructor_input_geo_point (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_input_geo_point (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "inputGeoPointEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_geo_point_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "inputGeoPoint", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_geo_point (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_input_media (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputMediaEmpty", cur_token_len)) {
+ out_int (0x9664f57f);
+ local_next_token ();
+ if (store_constructor_input_media_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "inputMediaUploadedPhoto", cur_token_len)) {
+ out_int (0xf7aff1c0);
+ local_next_token ();
+ if (store_constructor_input_media_uploaded_photo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputMediaPhoto", cur_token_len)) {
+ out_int (0xe9bfb4f3);
+ local_next_token ();
+ if (store_constructor_input_media_photo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "inputMediaGeoPoint", cur_token_len)) {
+ out_int (0xf9c44144);
+ local_next_token ();
+ if (store_constructor_input_media_geo_point (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "inputMediaContact", cur_token_len)) {
+ out_int (0xa6e45987);
+ local_next_token ();
+ if (store_constructor_input_media_contact (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "inputMediaUploadedVideo", cur_token_len)) {
+ out_int (0xe13fd4bc);
+ local_next_token ();
+ if (store_constructor_input_media_uploaded_video (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "inputMediaUploadedThumbVideo", cur_token_len)) {
+ out_int (0x96fb97dc);
+ local_next_token ();
+ if (store_constructor_input_media_uploaded_thumb_video (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputMediaVideo", cur_token_len)) {
+ out_int (0x936a4ebd);
+ local_next_token ();
+ if (store_constructor_input_media_video (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "inputMediaUploadedAudio", cur_token_len)) {
+ out_int (0x4e498cab);
+ local_next_token ();
+ if (store_constructor_input_media_uploaded_audio (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputMediaAudio", cur_token_len)) {
+ out_int (0x89938781);
+ local_next_token ();
+ if (store_constructor_input_media_audio (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "inputMediaUploadedDocument", cur_token_len)) {
+ out_int (0xffe76b78);
+ local_next_token ();
+ if (store_constructor_input_media_uploaded_document (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 31 && !memcmp (cur_token, "inputMediaUploadedThumbDocument", cur_token_len)) {
+ out_int (0x41481486);
+ local_next_token ();
+ if (store_constructor_input_media_uploaded_thumb_document (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "inputMediaDocument", cur_token_len)) {
+ out_int (0xd184e841);
+ local_next_token ();
+ if (store_constructor_input_media_document (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputMediaVenue", cur_token_len)) {
+ out_int (0x2827a81a);
+ local_next_token ();
+ if (store_constructor_input_media_venue (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_input_media (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputMediaEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_media_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "inputMediaUploadedPhoto", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_media_uploaded_photo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputMediaPhoto", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_media_photo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "inputMediaGeoPoint", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_media_geo_point (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "inputMediaContact", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_media_contact (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "inputMediaUploadedVideo", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_media_uploaded_video (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "inputMediaUploadedThumbVideo", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_media_uploaded_thumb_video (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputMediaVideo", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_media_video (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "inputMediaUploadedAudio", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_media_uploaded_audio (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputMediaAudio", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_media_audio (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "inputMediaUploadedDocument", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_media_uploaded_document (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 31 && !memcmp (cur_token, "inputMediaUploadedThumbDocument", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_media_uploaded_thumb_document (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "inputMediaDocument", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_media_document (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputMediaVenue", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_media_venue (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_input_notify_peer (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputNotifyPeer", cur_token_len)) {
+ out_int (0xb8bc5b0c);
+ local_next_token ();
+ if (store_constructor_input_notify_peer (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "inputNotifyUsers", cur_token_len)) {
+ out_int (0x193b4417);
+ local_next_token ();
+ if (store_constructor_input_notify_users (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "inputNotifyChats", cur_token_len)) {
+ out_int (0x4a95e84e);
+ local_next_token ();
+ if (store_constructor_input_notify_chats (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "inputNotifyAll", cur_token_len)) {
+ out_int (0xa429b886);
+ local_next_token ();
+ if (store_constructor_input_notify_all (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "inputNotifyGeoChatPeer", cur_token_len)) {
+ out_int (0x4d8ddec8);
+ local_next_token ();
+ if (store_constructor_input_notify_geo_chat_peer (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_input_notify_peer (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputNotifyPeer", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_notify_peer (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "inputNotifyUsers", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_notify_users (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "inputNotifyChats", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_notify_chats (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "inputNotifyAll", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_notify_all (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "inputNotifyGeoChatPeer", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_notify_geo_chat_peer (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_input_peer (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "inputPeerEmpty", cur_token_len)) {
+ out_int (0x7f3b18ea);
+ local_next_token ();
+ if (store_constructor_input_peer_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "inputPeerSelf", cur_token_len)) {
+ out_int (0x7da07ec9);
+ local_next_token ();
+ if (store_constructor_input_peer_self (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "inputPeerContact", cur_token_len)) {
+ out_int (0x1023dbe8);
+ local_next_token ();
+ if (store_constructor_input_peer_contact (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "inputPeerForeign", cur_token_len)) {
+ out_int (0x9b447325);
+ local_next_token ();
+ if (store_constructor_input_peer_foreign (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "inputPeerChat", cur_token_len)) {
+ out_int (0x179be863);
+ local_next_token ();
+ if (store_constructor_input_peer_chat (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_input_peer (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "inputPeerEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_peer_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "inputPeerSelf", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_peer_self (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "inputPeerContact", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_peer_contact (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "inputPeerForeign", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_peer_foreign (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "inputPeerChat", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_peer_chat (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_input_peer_notify_events (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 26 && !memcmp (cur_token, "inputPeerNotifyEventsEmpty", cur_token_len)) {
+ out_int (0xf03064d8);
+ local_next_token ();
+ if (store_constructor_input_peer_notify_events_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "inputPeerNotifyEventsAll", cur_token_len)) {
+ out_int (0xe86a2c74);
+ local_next_token ();
+ if (store_constructor_input_peer_notify_events_all (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_input_peer_notify_events (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 26 && !memcmp (cur_token, "inputPeerNotifyEventsEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_peer_notify_events_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "inputPeerNotifyEventsAll", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_peer_notify_events_all (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_input_peer_notify_settings (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 23 && !memcmp (cur_token, "inputPeerNotifySettings", cur_token_len)) {
+ out_int (0x46a2ce98);
+ local_next_token ();
+ if (store_constructor_input_peer_notify_settings (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_input_peer_notify_settings (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 23 && !memcmp (cur_token, "inputPeerNotifySettings", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_peer_notify_settings (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_input_photo (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputPhotoEmpty", cur_token_len)) {
+ out_int (0x1cd7bf0d);
+ local_next_token ();
+ if (store_constructor_input_photo_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 10 && !memcmp (cur_token, "inputPhoto", cur_token_len)) {
+ out_int (0xfb95c6c4);
+ local_next_token ();
+ if (store_constructor_input_photo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_input_photo (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputPhotoEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_photo_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 10 && !memcmp (cur_token, "inputPhoto", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_photo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_input_photo_crop (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "inputPhotoCropAuto", cur_token_len)) {
+ out_int (0xade6b004);
+ local_next_token ();
+ if (store_constructor_input_photo_crop_auto (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "inputPhotoCrop", cur_token_len)) {
+ out_int (0xd9915325);
+ local_next_token ();
+ if (store_constructor_input_photo_crop (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_input_photo_crop (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "inputPhotoCropAuto", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_photo_crop_auto (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "inputPhotoCrop", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_photo_crop (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_input_privacy_key (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 30 && !memcmp (cur_token, "inputPrivacyKeyStatusTimestamp", cur_token_len)) {
+ out_int (0x4f96cb18);
+ local_next_token ();
+ if (store_constructor_input_privacy_key_status_timestamp (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_input_privacy_key (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 30 && !memcmp (cur_token, "inputPrivacyKeyStatusTimestamp", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_privacy_key_status_timestamp (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_input_privacy_rule (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 30 && !memcmp (cur_token, "inputPrivacyValueAllowContacts", cur_token_len)) {
+ out_int (0x0d09e07b);
+ local_next_token ();
+ if (store_constructor_input_privacy_value_allow_contacts (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "inputPrivacyValueAllowAll", cur_token_len)) {
+ out_int (0x184b35ce);
+ local_next_token ();
+ if (store_constructor_input_privacy_value_allow_all (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "inputPrivacyValueAllowUsers", cur_token_len)) {
+ out_int (0x131cc67f);
+ local_next_token ();
+ if (store_constructor_input_privacy_value_allow_users (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 33 && !memcmp (cur_token, "inputPrivacyValueDisallowContacts", cur_token_len)) {
+ out_int (0x0ba52007);
+ local_next_token ();
+ if (store_constructor_input_privacy_value_disallow_contacts (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "inputPrivacyValueDisallowAll", cur_token_len)) {
+ out_int (0xd66b66c9);
+ local_next_token ();
+ if (store_constructor_input_privacy_value_disallow_all (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 30 && !memcmp (cur_token, "inputPrivacyValueDisallowUsers", cur_token_len)) {
+ out_int (0x90110467);
+ local_next_token ();
+ if (store_constructor_input_privacy_value_disallow_users (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_input_privacy_rule (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 30 && !memcmp (cur_token, "inputPrivacyValueAllowContacts", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_privacy_value_allow_contacts (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "inputPrivacyValueAllowAll", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_privacy_value_allow_all (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "inputPrivacyValueAllowUsers", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_privacy_value_allow_users (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 33 && !memcmp (cur_token, "inputPrivacyValueDisallowContacts", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_privacy_value_disallow_contacts (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "inputPrivacyValueDisallowAll", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_privacy_value_disallow_all (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 30 && !memcmp (cur_token, "inputPrivacyValueDisallowUsers", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_privacy_value_disallow_users (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_input_sticker_set (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 20 && !memcmp (cur_token, "inputStickerSetEmpty", cur_token_len)) {
+ out_int (0xffb62b95);
+ local_next_token ();
+ if (store_constructor_input_sticker_set_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "inputStickerSetID", cur_token_len)) {
+ out_int (0x9de7a269);
+ local_next_token ();
+ if (store_constructor_input_sticker_set_i_d (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "inputStickerSetShortName", cur_token_len)) {
+ out_int (0x861cc8a0);
+ local_next_token ();
+ if (store_constructor_input_sticker_set_short_name (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_input_sticker_set (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 20 && !memcmp (cur_token, "inputStickerSetEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_sticker_set_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "inputStickerSetID", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_sticker_set_i_d (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "inputStickerSetShortName", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_sticker_set_short_name (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_input_user (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "inputUserEmpty", cur_token_len)) {
+ out_int (0xb98886cf);
+ local_next_token ();
+ if (store_constructor_input_user_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "inputUserSelf", cur_token_len)) {
+ out_int (0xf7c1b13f);
+ local_next_token ();
+ if (store_constructor_input_user_self (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "inputUserContact", cur_token_len)) {
+ out_int (0x86e94f65);
+ local_next_token ();
+ if (store_constructor_input_user_contact (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "inputUserForeign", cur_token_len)) {
+ out_int (0x655e74ff);
+ local_next_token ();
+ if (store_constructor_input_user_foreign (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_input_user (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "inputUserEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_user_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "inputUserSelf", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_user_self (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "inputUserContact", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_user_contact (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "inputUserForeign", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_user_foreign (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_input_video (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputVideoEmpty", cur_token_len)) {
+ out_int (0x5508ec75);
+ local_next_token ();
+ if (store_constructor_input_video_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 10 && !memcmp (cur_token, "inputVideo", cur_token_len)) {
+ out_int (0xee579652);
+ local_next_token ();
+ if (store_constructor_input_video (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_input_video (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "inputVideoEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_video_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 10 && !memcmp (cur_token, "inputVideo", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_video (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_int (struct paramed_type *T) {
+ out_int (0xa8509bda);
+ if (store_constructor_int (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_bare_int (struct paramed_type *T) {
+ if (store_constructor_int (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_int128 (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 6 && !memcmp (cur_token, "int128", cur_token_len)) {
+ out_int (0x7d36c439);
+ local_next_token ();
+ if (store_constructor_int128 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_int128 (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 6 && !memcmp (cur_token, "int128", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_int128 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_int256 (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 6 && !memcmp (cur_token, "int256", cur_token_len)) {
+ out_int (0xf2c798b3);
+ local_next_token ();
+ if (store_constructor_int256 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_int256 (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 6 && !memcmp (cur_token, "int256", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_int256 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_keyboard_button (struct paramed_type *T) {
+ out_int (0xa2fa4880);
+ if (store_constructor_keyboard_button (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_bare_keyboard_button (struct paramed_type *T) {
+ if (store_constructor_keyboard_button (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_keyboard_button_row (struct paramed_type *T) {
+ out_int (0x77608b83);
+ if (store_constructor_keyboard_button_row (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_bare_keyboard_button_row (struct paramed_type *T) {
+ if (store_constructor_keyboard_button_row (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_long (struct paramed_type *T) {
+ out_int (0x22076cba);
+ if (store_constructor_long (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_bare_long (struct paramed_type *T) {
+ if (store_constructor_long (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_message (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 12 && !memcmp (cur_token, "messageEmpty", cur_token_len)) {
+ out_int (0x83e5de54);
+ local_next_token ();
+ if (store_constructor_message_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 7 && !memcmp (cur_token, "message", cur_token_len)) {
+ out_int (0xc3060325);
+ local_next_token ();
+ if (store_constructor_message (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "messageService", cur_token_len)) {
+ out_int (0x1d86f70e);
+ local_next_token ();
+ if (store_constructor_message_service (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_message (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 12 && !memcmp (cur_token, "messageEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_message_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 7 && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_message (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "messageService", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_message_service (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_message_action (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "messageActionEmpty", cur_token_len)) {
+ out_int (0xb6aef7b0);
+ local_next_token ();
+ if (store_constructor_message_action_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "messageActionChatCreate", cur_token_len)) {
+ out_int (0xa6638b9a);
+ local_next_token ();
+ if (store_constructor_message_action_chat_create (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "messageActionChatEditTitle", cur_token_len)) {
+ out_int (0xb5a1ce5a);
+ local_next_token ();
+ if (store_constructor_message_action_chat_edit_title (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "messageActionChatEditPhoto", cur_token_len)) {
+ out_int (0x7fcb13a8);
+ local_next_token ();
+ if (store_constructor_message_action_chat_edit_photo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "messageActionChatDeletePhoto", cur_token_len)) {
+ out_int (0x95e3fbef);
+ local_next_token ();
+ if (store_constructor_message_action_chat_delete_photo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "messageActionChatAddUser", cur_token_len)) {
+ out_int (0x5e3cfc4b);
+ local_next_token ();
+ if (store_constructor_message_action_chat_add_user (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "messageActionChatDeleteUser", cur_token_len)) {
+ out_int (0xb2ae9b0c);
+ local_next_token ();
+ if (store_constructor_message_action_chat_delete_user (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "messageActionGeoChatCreate", cur_token_len)) {
+ out_int (0x6f038ebc);
+ local_next_token ();
+ if (store_constructor_message_action_geo_chat_create (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "messageActionGeoChatCheckin", cur_token_len)) {
+ out_int (0x0c7d53de);
+ local_next_token ();
+ if (store_constructor_message_action_geo_chat_checkin (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "messageActionChatJoinedByLink", cur_token_len)) {
+ out_int (0xf89cf5e8);
+ local_next_token ();
+ if (store_constructor_message_action_chat_joined_by_link (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_message_action (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "messageActionEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_message_action_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "messageActionChatCreate", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_message_action_chat_create (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "messageActionChatEditTitle", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_message_action_chat_edit_title (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "messageActionChatEditPhoto", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_message_action_chat_edit_photo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "messageActionChatDeletePhoto", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_message_action_chat_delete_photo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "messageActionChatAddUser", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_message_action_chat_add_user (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "messageActionChatDeleteUser", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_message_action_chat_delete_user (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "messageActionGeoChatCreate", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_message_action_geo_chat_create (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "messageActionGeoChatCheckin", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_message_action_geo_chat_checkin (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "messageActionChatJoinedByLink", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_message_action_chat_joined_by_link (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_message_media (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messageMediaEmpty", cur_token_len)) {
+ out_int (0x3ded6320);
+ local_next_token ();
+ if (store_constructor_message_media_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messageMediaPhoto", cur_token_len)) {
+ out_int (0x3d8ce53d);
+ local_next_token ();
+ if (store_constructor_message_media_photo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messageMediaVideo", cur_token_len)) {
+ out_int (0x5bcf1675);
+ local_next_token ();
+ if (store_constructor_message_media_video (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "messageMediaGeo", cur_token_len)) {
+ out_int (0x56e0d474);
+ local_next_token ();
+ if (store_constructor_message_media_geo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "messageMediaContact", cur_token_len)) {
+ out_int (0x5e7d2f39);
+ local_next_token ();
+ if (store_constructor_message_media_contact (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "messageMediaUnsupported", cur_token_len)) {
+ out_int (0x9f84f49e);
+ local_next_token ();
+ if (store_constructor_message_media_unsupported (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messageMediaDocument", cur_token_len)) {
+ out_int (0x2fda2204);
+ local_next_token ();
+ if (store_constructor_message_media_document (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messageMediaAudio", cur_token_len)) {
+ out_int (0xc6b68300);
+ local_next_token ();
+ if (store_constructor_message_media_audio (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "messageMediaWebPage", cur_token_len)) {
+ out_int (0xa32dd600);
+ local_next_token ();
+ if (store_constructor_message_media_web_page (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messageMediaVenue", cur_token_len)) {
+ out_int (0x7912b71f);
+ local_next_token ();
+ if (store_constructor_message_media_venue (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messageMediaPhotoL27", cur_token_len)) {
+ out_int (0xc8c45a2a);
+ local_next_token ();
+ if (store_constructor_message_media_photo_l27 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messageMediaVideoL27", cur_token_len)) {
+ out_int (0xa2d24290);
+ local_next_token ();
+ if (store_constructor_message_media_video_l27 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_message_media (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messageMediaEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_message_media_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messageMediaPhoto", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_message_media_photo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messageMediaVideo", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_message_media_video (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "messageMediaGeo", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_message_media_geo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "messageMediaContact", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_message_media_contact (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "messageMediaUnsupported", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_message_media_unsupported (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messageMediaDocument", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_message_media_document (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messageMediaAudio", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_message_media_audio (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "messageMediaWebPage", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_message_media_web_page (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messageMediaVenue", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_message_media_venue (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messageMediaPhotoL27", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_message_media_photo_l27 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messageMediaVideoL27", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_message_media_video_l27 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_messages_filter (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 24 && !memcmp (cur_token, "inputMessagesFilterEmpty", cur_token_len)) {
+ out_int (0x57e2f66c);
+ local_next_token ();
+ if (store_constructor_input_messages_filter_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "inputMessagesFilterPhotos", cur_token_len)) {
+ out_int (0x9609a51c);
+ local_next_token ();
+ if (store_constructor_input_messages_filter_photos (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "inputMessagesFilterVideo", cur_token_len)) {
+ out_int (0x9fc00e65);
+ local_next_token ();
+ if (store_constructor_input_messages_filter_video (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "inputMessagesFilterPhotoVideo", cur_token_len)) {
+ out_int (0x56e9f0e4);
+ local_next_token ();
+ if (store_constructor_input_messages_filter_photo_video (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 38 && !memcmp (cur_token, "inputMessagesFilterPhotoVideoDocuments", cur_token_len)) {
+ out_int (0xd95e73bb);
+ local_next_token ();
+ if (store_constructor_input_messages_filter_photo_video_documents (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "inputMessagesFilterDocument", cur_token_len)) {
+ out_int (0x9eddf188);
+ local_next_token ();
+ if (store_constructor_input_messages_filter_document (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "inputMessagesFilterAudio", cur_token_len)) {
+ out_int (0xcfc87522);
+ local_next_token ();
+ if (store_constructor_input_messages_filter_audio (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_messages_filter (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 24 && !memcmp (cur_token, "inputMessagesFilterEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_messages_filter_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "inputMessagesFilterPhotos", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_messages_filter_photos (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "inputMessagesFilterVideo", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_messages_filter_video (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "inputMessagesFilterPhotoVideo", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_messages_filter_photo_video (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 38 && !memcmp (cur_token, "inputMessagesFilterPhotoVideoDocuments", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_messages_filter_photo_video_documents (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "inputMessagesFilterDocument", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_messages_filter_document (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "inputMessagesFilterAudio", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_input_messages_filter_audio (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_nearest_dc (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 9 && !memcmp (cur_token, "nearestDc", cur_token_len)) {
+ out_int (0x8e1a1775);
+ local_next_token ();
+ if (store_constructor_nearest_dc (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_nearest_dc (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 9 && !memcmp (cur_token, "nearestDc", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_nearest_dc (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_notify_peer (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 10 && !memcmp (cur_token, "notifyPeer", cur_token_len)) {
+ out_int (0x9fd40bd8);
+ local_next_token ();
+ if (store_constructor_notify_peer (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 11 && !memcmp (cur_token, "notifyUsers", cur_token_len)) {
+ out_int (0xb4c83b4c);
+ local_next_token ();
+ if (store_constructor_notify_users (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 11 && !memcmp (cur_token, "notifyChats", cur_token_len)) {
+ out_int (0xc007cec3);
+ local_next_token ();
+ if (store_constructor_notify_chats (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 9 && !memcmp (cur_token, "notifyAll", cur_token_len)) {
+ out_int (0x74d07c60);
+ local_next_token ();
+ if (store_constructor_notify_all (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_notify_peer (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 10 && !memcmp (cur_token, "notifyPeer", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_notify_peer (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 11 && !memcmp (cur_token, "notifyUsers", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_notify_users (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 11 && !memcmp (cur_token, "notifyChats", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_notify_chats (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 9 && !memcmp (cur_token, "notifyAll", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_notify_all (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_null (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 4 && !memcmp (cur_token, "null", cur_token_len)) {
+ out_int (0x56730bcc);
+ local_next_token ();
+ if (store_constructor_null (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_null (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 4 && !memcmp (cur_token, "null", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_null (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_p_q_inner_data (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "p_q_inner_data", cur_token_len)) {
+ out_int (0x83c95aec);
+ local_next_token ();
+ if (store_constructor_p_q_inner_data (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "p_q_inner_data_temp", cur_token_len)) {
+ out_int (0x3c6a84d4);
+ local_next_token ();
+ if (store_constructor_p_q_inner_data_temp (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_p_q_inner_data (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "p_q_inner_data", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_p_q_inner_data (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "p_q_inner_data_temp", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_p_q_inner_data_temp (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_peer (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 8 && !memcmp (cur_token, "peerUser", cur_token_len)) {
+ out_int (0x9db1bc6d);
+ local_next_token ();
+ if (store_constructor_peer_user (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 8 && !memcmp (cur_token, "peerChat", cur_token_len)) {
+ out_int (0xbad0e5bb);
+ local_next_token ();
+ if (store_constructor_peer_chat (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_peer (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 8 && !memcmp (cur_token, "peerUser", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_peer_user (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 8 && !memcmp (cur_token, "peerChat", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_peer_chat (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_peer_notify_events (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 21 && !memcmp (cur_token, "peerNotifyEventsEmpty", cur_token_len)) {
+ out_int (0xadd53cb3);
+ local_next_token ();
+ if (store_constructor_peer_notify_events_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "peerNotifyEventsAll", cur_token_len)) {
+ out_int (0x6d1ded88);
+ local_next_token ();
+ if (store_constructor_peer_notify_events_all (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_peer_notify_events (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 21 && !memcmp (cur_token, "peerNotifyEventsEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_peer_notify_events_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "peerNotifyEventsAll", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_peer_notify_events_all (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_peer_notify_settings (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 23 && !memcmp (cur_token, "peerNotifySettingsEmpty", cur_token_len)) {
+ out_int (0x70a68512);
+ local_next_token ();
+ if (store_constructor_peer_notify_settings_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "peerNotifySettings", cur_token_len)) {
+ out_int (0x8d5e11ee);
+ local_next_token ();
+ if (store_constructor_peer_notify_settings (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_peer_notify_settings (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 23 && !memcmp (cur_token, "peerNotifySettingsEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_peer_notify_settings_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "peerNotifySettings", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_peer_notify_settings (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_photo (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 10 && !memcmp (cur_token, "photoEmpty", cur_token_len)) {
+ out_int (0x2331b22d);
+ local_next_token ();
+ if (store_constructor_photo_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 5 && !memcmp (cur_token, "photo", cur_token_len)) {
+ out_int (0xc3838076);
+ local_next_token ();
+ if (store_constructor_photo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 8 && !memcmp (cur_token, "photoL27", cur_token_len)) {
+ out_int (0x22b56751);
+ local_next_token ();
+ if (store_constructor_photo_l27 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_photo (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 10 && !memcmp (cur_token, "photoEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_photo_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 5 && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_photo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 8 && !memcmp (cur_token, "photoL27", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_photo_l27 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_photo_size (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "photoSizeEmpty", cur_token_len)) {
+ out_int (0x0e17e23c);
+ local_next_token ();
+ if (store_constructor_photo_size_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 9 && !memcmp (cur_token, "photoSize", cur_token_len)) {
+ out_int (0x77bfb61b);
+ local_next_token ();
+ if (store_constructor_photo_size (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "photoCachedSize", cur_token_len)) {
+ out_int (0xe9a734fa);
+ local_next_token ();
+ if (store_constructor_photo_cached_size (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_photo_size (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "photoSizeEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_photo_size_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 9 && !memcmp (cur_token, "photoSize", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_photo_size (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "photoCachedSize", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_photo_cached_size (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_privacy_key (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 25 && !memcmp (cur_token, "privacyKeyStatusTimestamp", cur_token_len)) {
+ out_int (0xbc2eab30);
+ local_next_token ();
+ if (store_constructor_privacy_key_status_timestamp (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_privacy_key (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 25 && !memcmp (cur_token, "privacyKeyStatusTimestamp", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_privacy_key_status_timestamp (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_privacy_rule (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 25 && !memcmp (cur_token, "privacyValueAllowContacts", cur_token_len)) {
+ out_int (0xfffe1bac);
+ local_next_token ();
+ if (store_constructor_privacy_value_allow_contacts (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "privacyValueAllowAll", cur_token_len)) {
+ out_int (0x65427b82);
+ local_next_token ();
+ if (store_constructor_privacy_value_allow_all (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "privacyValueAllowUsers", cur_token_len)) {
+ out_int (0x4d5bbe0c);
+ local_next_token ();
+ if (store_constructor_privacy_value_allow_users (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "privacyValueDisallowContacts", cur_token_len)) {
+ out_int (0xf888fa1a);
+ local_next_token ();
+ if (store_constructor_privacy_value_disallow_contacts (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "privacyValueDisallowAll", cur_token_len)) {
+ out_int (0x8b73e763);
+ local_next_token ();
+ if (store_constructor_privacy_value_disallow_all (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "privacyValueDisallowUsers", cur_token_len)) {
+ out_int (0x0c7f49b7);
+ local_next_token ();
+ if (store_constructor_privacy_value_disallow_users (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_privacy_rule (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 25 && !memcmp (cur_token, "privacyValueAllowContacts", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_privacy_value_allow_contacts (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "privacyValueAllowAll", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_privacy_value_allow_all (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "privacyValueAllowUsers", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_privacy_value_allow_users (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "privacyValueDisallowContacts", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_privacy_value_disallow_contacts (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "privacyValueDisallowAll", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_privacy_value_disallow_all (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "privacyValueDisallowUsers", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_privacy_value_disallow_users (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_received_notify_message (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 21 && !memcmp (cur_token, "receivedNotifyMessage", cur_token_len)) {
+ out_int (0xa384b779);
+ local_next_token ();
+ if (store_constructor_received_notify_message (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_received_notify_message (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 21 && !memcmp (cur_token, "receivedNotifyMessage", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_received_notify_message (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_reply_markup (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "replyKeyboardHide", cur_token_len)) {
+ out_int (0xa03e5b85);
+ local_next_token ();
+ if (store_constructor_reply_keyboard_hide (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "replyKeyboardForceReply", cur_token_len)) {
+ out_int (0xf4108aa0);
+ local_next_token ();
+ if (store_constructor_reply_keyboard_force_reply (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "replyKeyboardMarkup", cur_token_len)) {
+ out_int (0x3502758c);
+ local_next_token ();
+ if (store_constructor_reply_keyboard_markup (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_reply_markup (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "replyKeyboardHide", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_reply_keyboard_hide (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "replyKeyboardForceReply", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_reply_keyboard_force_reply (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "replyKeyboardMarkup", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_reply_keyboard_markup (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_res_p_q (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 5 && !memcmp (cur_token, "resPQ", cur_token_len)) {
+ out_int (0x05162463);
+ local_next_token ();
+ if (store_constructor_res_p_q (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_res_p_q (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 5 && !memcmp (cur_token, "resPQ", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_res_p_q (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_send_message_action (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 23 && !memcmp (cur_token, "sendMessageTypingAction", cur_token_len)) {
+ out_int (0x16bf744e);
+ local_next_token ();
+ if (store_constructor_send_message_typing_action (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "sendMessageCancelAction", cur_token_len)) {
+ out_int (0xfd5ec8f5);
+ local_next_token ();
+ if (store_constructor_send_message_cancel_action (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "sendMessageRecordVideoAction", cur_token_len)) {
+ out_int (0xa187d66f);
+ local_next_token ();
+ if (store_constructor_send_message_record_video_action (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 31 && !memcmp (cur_token, "sendMessageUploadVideoActionL27", cur_token_len)) {
+ out_int (0x92042ff7);
+ local_next_token ();
+ if (store_constructor_send_message_upload_video_action_l27 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "sendMessageUploadVideoAction", cur_token_len)) {
+ out_int (0xe9763aec);
+ local_next_token ();
+ if (store_constructor_send_message_upload_video_action (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "sendMessageRecordAudioAction", cur_token_len)) {
+ out_int (0xd52f73f7);
+ local_next_token ();
+ if (store_constructor_send_message_record_audio_action (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 31 && !memcmp (cur_token, "sendMessageUploadAudioActionL27", cur_token_len)) {
+ out_int (0xe6ac8a6f);
+ local_next_token ();
+ if (store_constructor_send_message_upload_audio_action_l27 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "sendMessageUploadAudioAction", cur_token_len)) {
+ out_int (0xf351d7ab);
+ local_next_token ();
+ if (store_constructor_send_message_upload_audio_action (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "sendMessageUploadPhotoAction", cur_token_len)) {
+ out_int (0xd1d34a26);
+ local_next_token ();
+ if (store_constructor_send_message_upload_photo_action (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 34 && !memcmp (cur_token, "sendMessageUploadDocumentActionL27", cur_token_len)) {
+ out_int (0x8faee98e);
+ local_next_token ();
+ if (store_constructor_send_message_upload_document_action_l27 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 31 && !memcmp (cur_token, "sendMessageUploadDocumentAction", cur_token_len)) {
+ out_int (0xaa0cd9e4);
+ local_next_token ();
+ if (store_constructor_send_message_upload_document_action (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "sendMessageGeoLocationAction", cur_token_len)) {
+ out_int (0x176f8ba1);
+ local_next_token ();
+ if (store_constructor_send_message_geo_location_action (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 30 && !memcmp (cur_token, "sendMessageChooseContactAction", cur_token_len)) {
+ out_int (0x628cbc6f);
+ local_next_token ();
+ if (store_constructor_send_message_choose_contact_action (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_send_message_action (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 23 && !memcmp (cur_token, "sendMessageTypingAction", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_send_message_typing_action (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "sendMessageCancelAction", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_send_message_cancel_action (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "sendMessageRecordVideoAction", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_send_message_record_video_action (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 31 && !memcmp (cur_token, "sendMessageUploadVideoActionL27", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_send_message_upload_video_action_l27 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "sendMessageUploadVideoAction", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_send_message_upload_video_action (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "sendMessageRecordAudioAction", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_send_message_record_audio_action (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 31 && !memcmp (cur_token, "sendMessageUploadAudioActionL27", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_send_message_upload_audio_action_l27 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "sendMessageUploadAudioAction", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_send_message_upload_audio_action (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "sendMessageUploadPhotoAction", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_send_message_upload_photo_action (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 34 && !memcmp (cur_token, "sendMessageUploadDocumentActionL27", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_send_message_upload_document_action_l27 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 31 && !memcmp (cur_token, "sendMessageUploadDocumentAction", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_send_message_upload_document_action (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "sendMessageGeoLocationAction", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_send_message_geo_location_action (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 30 && !memcmp (cur_token, "sendMessageChooseContactAction", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_send_message_choose_contact_action (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_server_d_h_params (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 21 && !memcmp (cur_token, "server_DH_params_fail", cur_token_len)) {
+ out_int (0x79cb045d);
+ local_next_token ();
+ if (store_constructor_server_d_h_params_fail (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "server_DH_params_ok", cur_token_len)) {
+ out_int (0xd0e8075c);
+ local_next_token ();
+ if (store_constructor_server_d_h_params_ok (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_server_d_h_params (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 21 && !memcmp (cur_token, "server_DH_params_fail", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_server_d_h_params_fail (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "server_DH_params_ok", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_server_d_h_params_ok (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_server_d_h_inner_data (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 20 && !memcmp (cur_token, "server_DH_inner_data", cur_token_len)) {
+ out_int (0xb5890dba);
+ local_next_token ();
+ if (store_constructor_server_d_h_inner_data (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_server_d_h_inner_data (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 20 && !memcmp (cur_token, "server_DH_inner_data", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_server_d_h_inner_data (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_set_client_d_h_params_answer (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 9 && !memcmp (cur_token, "dh_gen_ok", cur_token_len)) {
+ out_int (0x3bcbf734);
+ local_next_token ();
+ if (store_constructor_dh_gen_ok (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 12 && !memcmp (cur_token, "dh_gen_retry", cur_token_len)) {
+ out_int (0x46dc1fb9);
+ local_next_token ();
+ if (store_constructor_dh_gen_retry (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 11 && !memcmp (cur_token, "dh_gen_fail", cur_token_len)) {
+ out_int (0xa69dae02);
+ local_next_token ();
+ if (store_constructor_dh_gen_fail (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_set_client_d_h_params_answer (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 9 && !memcmp (cur_token, "dh_gen_ok", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_dh_gen_ok (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 12 && !memcmp (cur_token, "dh_gen_retry", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_dh_gen_retry (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 11 && !memcmp (cur_token, "dh_gen_fail", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_dh_gen_fail (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_sticker_pack (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 11 && !memcmp (cur_token, "stickerPack", cur_token_len)) {
+ out_int (0x12b299d4);
+ local_next_token ();
+ if (store_constructor_sticker_pack (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_sticker_pack (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 11 && !memcmp (cur_token, "stickerPack", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_sticker_pack (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_sticker_set (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 10 && !memcmp (cur_token, "stickerSet", cur_token_len)) {
+ out_int (0xa7a43b17);
+ local_next_token ();
+ if (store_constructor_sticker_set (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_sticker_set (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 10 && !memcmp (cur_token, "stickerSet", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_sticker_set (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_string (struct paramed_type *T) {
+ out_int (0xb5286e24);
+ if (store_constructor_string (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_bare_string (struct paramed_type *T) {
+ if (store_constructor_string (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_update (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 16 && !memcmp (cur_token, "updateNewMessage", cur_token_len)) {
+ out_int (0x1f2b0afd);
+ local_next_token ();
+ if (store_constructor_update_new_message (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "updateMessageID", cur_token_len)) {
+ out_int (0x4e90bfd6);
+ local_next_token ();
+ if (store_constructor_update_message_i_d (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "updateDeleteMessages", cur_token_len)) {
+ out_int (0xa20db0e5);
+ local_next_token ();
+ if (store_constructor_update_delete_messages (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "updateUserTyping", cur_token_len)) {
+ out_int (0x5c486927);
+ local_next_token ();
+ if (store_constructor_update_user_typing (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "updateChatUserTyping", cur_token_len)) {
+ out_int (0x9a65ea1f);
+ local_next_token ();
+ if (store_constructor_update_chat_user_typing (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "updateChatParticipants", cur_token_len)) {
+ out_int (0x07761198);
+ local_next_token ();
+ if (store_constructor_update_chat_participants (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "updateUserStatus", cur_token_len)) {
+ out_int (0x1bfbd823);
+ local_next_token ();
+ if (store_constructor_update_user_status (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "updateUserName", cur_token_len)) {
+ out_int (0xa7332b73);
+ local_next_token ();
+ if (store_constructor_update_user_name (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "updateUserPhoto", cur_token_len)) {
+ out_int (0x95313b0c);
+ local_next_token ();
+ if (store_constructor_update_user_photo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "updateContactRegistered", cur_token_len)) {
+ out_int (0x2575bbb9);
+ local_next_token ();
+ if (store_constructor_update_contact_registered (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "updateContactLink", cur_token_len)) {
+ out_int (0x9d2e67c5);
+ local_next_token ();
+ if (store_constructor_update_contact_link (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "updateNewAuthorization", cur_token_len)) {
+ out_int (0x8f06529a);
+ local_next_token ();
+ if (store_constructor_update_new_authorization (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "updateNewGeoChatMessage", cur_token_len)) {
+ out_int (0x5a68e3f7);
+ local_next_token ();
+ if (store_constructor_update_new_geo_chat_message (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "updateNewEncryptedMessage", cur_token_len)) {
+ out_int (0x12bcbd9a);
+ local_next_token ();
+ if (store_constructor_update_new_encrypted_message (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "updateEncryptedChatTyping", cur_token_len)) {
+ out_int (0x1710f156);
+ local_next_token ();
+ if (store_constructor_update_encrypted_chat_typing (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "updateEncryption", cur_token_len)) {
+ out_int (0xb4a2e88d);
+ local_next_token ();
+ if (store_constructor_update_encryption (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "updateEncryptedMessagesRead", cur_token_len)) {
+ out_int (0x38fe25b7);
+ local_next_token ();
+ if (store_constructor_update_encrypted_messages_read (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "updateChatParticipantAdd", cur_token_len)) {
+ out_int (0x3a0eeb22);
+ local_next_token ();
+ if (store_constructor_update_chat_participant_add (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "updateChatParticipantDelete", cur_token_len)) {
+ out_int (0x6e5f8c22);
+ local_next_token ();
+ if (store_constructor_update_chat_participant_delete (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "updateDcOptions", cur_token_len)) {
+ out_int (0x8e5e9873);
+ local_next_token ();
+ if (store_constructor_update_dc_options (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "updateUserBlocked", cur_token_len)) {
+ out_int (0x80ece81a);
+ local_next_token ();
+ if (store_constructor_update_user_blocked (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "updateNotifySettings", cur_token_len)) {
+ out_int (0xbec268ef);
+ local_next_token ();
+ if (store_constructor_update_notify_settings (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "updateServiceNotification", cur_token_len)) {
+ out_int (0x382dd3e4);
+ local_next_token ();
+ if (store_constructor_update_service_notification (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "updatePrivacy", cur_token_len)) {
+ out_int (0xee3b272a);
+ local_next_token ();
+ if (store_constructor_update_privacy (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "updateUserPhone", cur_token_len)) {
+ out_int (0x12b9417b);
+ local_next_token ();
+ if (store_constructor_update_user_phone (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "updateReadHistoryInbox", cur_token_len)) {
+ out_int (0x9961fd5c);
+ local_next_token ();
+ if (store_constructor_update_read_history_inbox (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "updateReadHistoryOutbox", cur_token_len)) {
+ out_int (0x2f2f21bf);
+ local_next_token ();
+ if (store_constructor_update_read_history_outbox (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "updateWebPage", cur_token_len)) {
+ out_int (0x2cc36971);
+ local_next_token ();
+ if (store_constructor_update_web_page (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "updateReadMessagesContents", cur_token_len)) {
+ out_int (0x68c13933);
+ local_next_token ();
+ if (store_constructor_update_read_messages_contents (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "updateMsgUpdate", cur_token_len)) {
+ out_int (0x03114739);
+ local_next_token ();
+ if (store_constructor_update_msg_update (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_update (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 16 && !memcmp (cur_token, "updateNewMessage", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_new_message (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "updateMessageID", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_message_i_d (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "updateDeleteMessages", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_delete_messages (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "updateUserTyping", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_user_typing (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "updateChatUserTyping", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_chat_user_typing (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "updateChatParticipants", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_chat_participants (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "updateUserStatus", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_user_status (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "updateUserName", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_user_name (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "updateUserPhoto", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_user_photo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "updateContactRegistered", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_contact_registered (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "updateContactLink", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_contact_link (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "updateNewAuthorization", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_new_authorization (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "updateNewGeoChatMessage", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_new_geo_chat_message (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "updateNewEncryptedMessage", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_new_encrypted_message (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "updateEncryptedChatTyping", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_encrypted_chat_typing (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "updateEncryption", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_encryption (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "updateEncryptedMessagesRead", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_encrypted_messages_read (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "updateChatParticipantAdd", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_chat_participant_add (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "updateChatParticipantDelete", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_chat_participant_delete (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "updateDcOptions", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_dc_options (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "updateUserBlocked", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_user_blocked (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "updateNotifySettings", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_notify_settings (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "updateServiceNotification", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_service_notification (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "updatePrivacy", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_privacy (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "updateUserPhone", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_user_phone (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "updateReadHistoryInbox", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_read_history_inbox (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "updateReadHistoryOutbox", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_read_history_outbox (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "updateWebPage", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_web_page (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "updateReadMessagesContents", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_read_messages_contents (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "updateMsgUpdate", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_msg_update (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_updates (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "updatesTooLong", cur_token_len)) {
+ out_int (0xe317af7e);
+ local_next_token ();
+ if (store_constructor_updates_too_long (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "updateShortMessage", cur_token_len)) {
+ out_int (0xed5c2127);
+ local_next_token ();
+ if (store_constructor_update_short_message (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "updateShortChatMessage", cur_token_len)) {
+ out_int (0x52238b3c);
+ local_next_token ();
+ if (store_constructor_update_short_chat_message (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 11 && !memcmp (cur_token, "updateShort", cur_token_len)) {
+ out_int (0x78d4dec1);
+ local_next_token ();
+ if (store_constructor_update_short (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "updatesCombined", cur_token_len)) {
+ out_int (0x725b04c3);
+ local_next_token ();
+ if (store_constructor_updates_combined (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 7 && !memcmp (cur_token, "updates", cur_token_len)) {
+ out_int (0x74ae4240);
+ local_next_token ();
+ if (store_constructor_updates (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_updates (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "updatesTooLong", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_updates_too_long (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "updateShortMessage", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_short_message (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "updateShortChatMessage", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_short_chat_message (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 11 && !memcmp (cur_token, "updateShort", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_update_short (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "updatesCombined", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_updates_combined (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 7 && !memcmp (cur_token, "updates", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_updates (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_user (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 9 && !memcmp (cur_token, "userEmpty", cur_token_len)) {
+ out_int (0x200250ba);
+ local_next_token ();
+ if (store_constructor_user_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 4 && !memcmp (cur_token, "user", cur_token_len)) {
+ out_int (0x22e49072);
+ local_next_token ();
+ if (store_constructor_user (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_user (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 9 && !memcmp (cur_token, "userEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_user_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 4 && !memcmp (cur_token, "user", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_user (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_user_full (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 8 && !memcmp (cur_token, "userFull", cur_token_len)) {
+ out_int (0x5a89ac5b);
+ local_next_token ();
+ if (store_constructor_user_full (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_user_full (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 8 && !memcmp (cur_token, "userFull", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_user_full (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_user_profile_photo (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 21 && !memcmp (cur_token, "userProfilePhotoEmpty", cur_token_len)) {
+ out_int (0x4f11bae1);
+ local_next_token ();
+ if (store_constructor_user_profile_photo_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "userProfilePhoto", cur_token_len)) {
+ out_int (0xd559d8c8);
+ local_next_token ();
+ if (store_constructor_user_profile_photo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_user_profile_photo (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 21 && !memcmp (cur_token, "userProfilePhotoEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_user_profile_photo_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "userProfilePhoto", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_user_profile_photo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_user_status (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "userStatusEmpty", cur_token_len)) {
+ out_int (0x09d05049);
+ local_next_token ();
+ if (store_constructor_user_status_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "userStatusOnline", cur_token_len)) {
+ out_int (0xedb93949);
+ local_next_token ();
+ if (store_constructor_user_status_online (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "userStatusOffline", cur_token_len)) {
+ out_int (0x008c703f);
+ local_next_token ();
+ if (store_constructor_user_status_offline (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "userStatusRecently", cur_token_len)) {
+ out_int (0xe26f42f1);
+ local_next_token ();
+ if (store_constructor_user_status_recently (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "userStatusLastWeek", cur_token_len)) {
+ out_int (0x07bf09fc);
+ local_next_token ();
+ if (store_constructor_user_status_last_week (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "userStatusLastMonth", cur_token_len)) {
+ out_int (0x77ebc742);
+ local_next_token ();
+ if (store_constructor_user_status_last_month (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_user_status (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 15 && !memcmp (cur_token, "userStatusEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_user_status_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "userStatusOnline", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_user_status_online (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "userStatusOffline", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_user_status_offline (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "userStatusRecently", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_user_status_recently (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "userStatusLastWeek", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_user_status_last_week (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "userStatusLastMonth", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_user_status_last_month (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_vector (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 6 && !memcmp (cur_token, "vector", cur_token_len)) {
+ out_int (0x1cb5c415);
+ local_next_token ();
+ if (store_constructor_vector (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_vector (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 6 && !memcmp (cur_token, "vector", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_vector (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_video (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 10 && !memcmp (cur_token, "videoEmpty", cur_token_len)) {
+ out_int (0xc10658a8);
+ local_next_token ();
+ if (store_constructor_video_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 5 && !memcmp (cur_token, "video", cur_token_len)) {
+ out_int (0xee9f4a4d);
+ local_next_token ();
+ if (store_constructor_video (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 8 && !memcmp (cur_token, "videoL27", cur_token_len)) {
+ out_int (0x388fa391);
+ local_next_token ();
+ if (store_constructor_video_l27 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_video (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 10 && !memcmp (cur_token, "videoEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_video_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 5 && !memcmp (cur_token, "video", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_video (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 8 && !memcmp (cur_token, "videoL27", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_video_l27 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_wall_paper (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 9 && !memcmp (cur_token, "wallPaper", cur_token_len)) {
+ out_int (0xccb03657);
+ local_next_token ();
+ if (store_constructor_wall_paper (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "wallPaperSolid", cur_token_len)) {
+ out_int (0x63117f24);
+ local_next_token ();
+ if (store_constructor_wall_paper_solid (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_wall_paper (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 9 && !memcmp (cur_token, "wallPaper", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_wall_paper (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "wallPaperSolid", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_wall_paper_solid (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_web_page (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 12 && !memcmp (cur_token, "webPageEmpty", cur_token_len)) {
+ out_int (0xeb1477e8);
+ local_next_token ();
+ if (store_constructor_web_page_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "webPagePending", cur_token_len)) {
+ out_int (0xc586da1c);
+ local_next_token ();
+ if (store_constructor_web_page_pending (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 7 && !memcmp (cur_token, "webPage", cur_token_len)) {
+ out_int (0xa31ea0b5);
+ local_next_token ();
+ if (store_constructor_web_page (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_web_page (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 12 && !memcmp (cur_token, "webPageEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_web_page_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "webPagePending", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_web_page_pending (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 7 && !memcmp (cur_token, "webPage", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_web_page (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_account_authorizations (struct paramed_type *T) {
+ out_int (0x1250abde);
+ if (store_constructor_account_authorizations (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_bare_account_authorizations (struct paramed_type *T) {
+ if (store_constructor_account_authorizations (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_account_password (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "account.noPassword", cur_token_len)) {
+ out_int (0x96dabc18);
+ local_next_token ();
+ if (store_constructor_account_no_password (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "account.password", cur_token_len)) {
+ out_int (0x7c18141c);
+ local_next_token ();
+ if (store_constructor_account_password (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_account_password (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "account.noPassword", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_account_no_password (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "account.password", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_account_password (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_account_password_input_settings (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 29 && !memcmp (cur_token, "account.passwordInputSettings", cur_token_len)) {
+ out_int (0xbcfc532c);
+ local_next_token ();
+ if (store_constructor_account_password_input_settings (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_account_password_input_settings (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 29 && !memcmp (cur_token, "account.passwordInputSettings", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_account_password_input_settings (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_account_password_settings (struct paramed_type *T) {
+ out_int (0xb7b72ab3);
+ if (store_constructor_account_password_settings (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_bare_account_password_settings (struct paramed_type *T) {
+ if (store_constructor_account_password_settings (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_account_privacy_rules (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 20 && !memcmp (cur_token, "account.privacyRules", cur_token_len)) {
+ out_int (0x554abb6f);
+ local_next_token ();
+ if (store_constructor_account_privacy_rules (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_account_privacy_rules (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 20 && !memcmp (cur_token, "account.privacyRules", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_account_privacy_rules (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_account_sent_change_phone_code (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 27 && !memcmp (cur_token, "account.sentChangePhoneCode", cur_token_len)) {
+ out_int (0xa4f58c4c);
+ local_next_token ();
+ if (store_constructor_account_sent_change_phone_code (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_account_sent_change_phone_code (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 27 && !memcmp (cur_token, "account.sentChangePhoneCode", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_account_sent_change_phone_code (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_auth_authorization (struct paramed_type *T) {
+ out_int (0xff036af1);
+ if (store_constructor_auth_authorization (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_bare_auth_authorization (struct paramed_type *T) {
+ if (store_constructor_auth_authorization (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_auth_checked_phone (struct paramed_type *T) {
+ out_int (0x811ea28e);
+ if (store_constructor_auth_checked_phone (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_bare_auth_checked_phone (struct paramed_type *T) {
+ if (store_constructor_auth_checked_phone (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_auth_exported_authorization (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 26 && !memcmp (cur_token, "auth.exportedAuthorization", cur_token_len)) {
+ out_int (0xdf969c2d);
+ local_next_token ();
+ if (store_constructor_auth_exported_authorization (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_auth_exported_authorization (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 26 && !memcmp (cur_token, "auth.exportedAuthorization", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_auth_exported_authorization (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_auth_password_recovery (struct paramed_type *T) {
+ out_int (0x137948a5);
+ if (store_constructor_auth_password_recovery (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_bare_auth_password_recovery (struct paramed_type *T) {
+ if (store_constructor_auth_password_recovery (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_auth_sent_code (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "auth.sentCode", cur_token_len)) {
+ out_int (0xefed51d9);
+ local_next_token ();
+ if (store_constructor_auth_sent_code (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "auth.sentAppCode", cur_token_len)) {
+ out_int (0xe325edcf);
+ local_next_token ();
+ if (store_constructor_auth_sent_app_code (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_auth_sent_code (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "auth.sentCode", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_auth_sent_code (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "auth.sentAppCode", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_auth_sent_app_code (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_binlog_encr_key (struct paramed_type *T) {
+ out_int (0x0377168f);
+ if (store_constructor_binlog_encr_key (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_bare_binlog_encr_key (struct paramed_type *T) {
+ if (store_constructor_binlog_encr_key (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_binlog_update (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 12 && !memcmp (cur_token, "binlog.start", cur_token_len)) {
+ out_int (0x3b06de69);
+ local_next_token ();
+ if (store_constructor_binlog_start (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "binlog.dcOption", cur_token_len)) {
+ out_int (0xf96feb32);
+ local_next_token ();
+ if (store_constructor_binlog_dc_option (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "binlog.dcOptionNew", cur_token_len)) {
+ out_int (0x7c0d22d8);
+ local_next_token ();
+ if (store_constructor_binlog_dc_option_new (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "binlog.authKey", cur_token_len)) {
+ out_int (0x71e8c156);
+ local_next_token ();
+ if (store_constructor_binlog_auth_key (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "binlog.defaultDc", cur_token_len)) {
+ out_int (0x9e83dbdc);
+ local_next_token ();
+ if (store_constructor_binlog_default_dc (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "binlog.dcSigned", cur_token_len)) {
+ out_int (0x26451bb5);
+ local_next_token ();
+ if (store_constructor_binlog_dc_signed (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 12 && !memcmp (cur_token, "binlog.ourId", cur_token_len)) {
+ out_int (0x68a870e8);
+ local_next_token ();
+ if (store_constructor_binlog_our_id (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "binlog.setDhParams", cur_token_len)) {
+ out_int (0xeaeb7826);
+ local_next_token ();
+ if (store_constructor_binlog_set_dh_params (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "binlog.setPts", cur_token_len)) {
+ out_int (0x2ca8c939);
+ local_next_token ();
+ if (store_constructor_binlog_set_pts (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "binlog.setQts", cur_token_len)) {
+ out_int (0xd95738ac);
+ local_next_token ();
+ if (store_constructor_binlog_set_qts (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "binlog.setDate", cur_token_len)) {
+ out_int (0x1d0f4b52);
+ local_next_token ();
+ if (store_constructor_binlog_set_date (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "binlog.setSeq", cur_token_len)) {
+ out_int (0x6eeb2989);
+ local_next_token ();
+ if (store_constructor_binlog_set_seq (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "binlog.encrChatDelete", cur_token_len)) {
+ out_int (0xee1b38e8);
+ local_next_token ();
+ if (store_constructor_binlog_encr_chat_delete (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "binlog.encrChatNew", cur_token_len)) {
+ out_int (0x84977251);
+ local_next_token ();
+ if (store_constructor_binlog_encr_chat_new (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "binlog.encrChatExchangeNew", cur_token_len)) {
+ out_int (0x9d49488d);
+ local_next_token ();
+ if (store_constructor_binlog_encr_chat_exchange_new (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "binlog.userDelete", cur_token_len)) {
+ out_int (0xac55d447);
+ local_next_token ();
+ if (store_constructor_binlog_user_delete (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "binlog.userNew", cur_token_len)) {
+ out_int (0x127cf2f9);
+ local_next_token ();
+ if (store_constructor_binlog_user_new (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "binlog.chatNew", cur_token_len)) {
+ out_int (0x0a10aa92);
+ local_next_token ();
+ if (store_constructor_binlog_chat_new (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "binlog.chatAddParticipant", cur_token_len)) {
+ out_int (0x535475ea);
+ local_next_token ();
+ if (store_constructor_binlog_chat_add_participant (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "binlog.chatDelParticipant", cur_token_len)) {
+ out_int (0x7dd1a1a2);
+ local_next_token ();
+ if (store_constructor_binlog_chat_del_participant (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "binlog.setMsgId", cur_token_len)) {
+ out_int (0x3c873416);
+ local_next_token ();
+ if (store_constructor_binlog_set_msg_id (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "binlog.messageDelete", cur_token_len)) {
+ out_int (0x847e77b1);
+ local_next_token ();
+ if (store_constructor_binlog_message_delete (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "binlog.messageNew", cur_token_len)) {
+ out_int (0x427cfcdb);
+ local_next_token ();
+ if (store_constructor_binlog_message_new (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "binlog.messageEncrNew", cur_token_len)) {
+ out_int (0x6cf7cabc);
+ local_next_token ();
+ if (store_constructor_binlog_message_encr_new (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "binlog.msgUpdate", cur_token_len)) {
+ out_int (0x6dd4d85f);
+ local_next_token ();
+ if (store_constructor_binlog_msg_update (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "binlog.resetAuthorization", cur_token_len)) {
+ out_int (0x83327955);
+ local_next_token ();
+ if (store_constructor_binlog_reset_authorization (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_binlog_update (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 12 && !memcmp (cur_token, "binlog.start", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_binlog_start (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "binlog.dcOption", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_binlog_dc_option (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "binlog.dcOptionNew", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_binlog_dc_option_new (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "binlog.authKey", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_binlog_auth_key (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "binlog.defaultDc", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_binlog_default_dc (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "binlog.dcSigned", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_binlog_dc_signed (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 12 && !memcmp (cur_token, "binlog.ourId", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_binlog_our_id (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "binlog.setDhParams", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_binlog_set_dh_params (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "binlog.setPts", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_binlog_set_pts (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "binlog.setQts", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_binlog_set_qts (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "binlog.setDate", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_binlog_set_date (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "binlog.setSeq", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_binlog_set_seq (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "binlog.encrChatDelete", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_binlog_encr_chat_delete (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "binlog.encrChatNew", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_binlog_encr_chat_new (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "binlog.encrChatExchangeNew", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_binlog_encr_chat_exchange_new (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "binlog.userDelete", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_binlog_user_delete (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "binlog.userNew", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_binlog_user_new (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "binlog.chatNew", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_binlog_chat_new (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "binlog.chatAddParticipant", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_binlog_chat_add_participant (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "binlog.chatDelParticipant", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_binlog_chat_del_participant (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "binlog.setMsgId", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_binlog_set_msg_id (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "binlog.messageDelete", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_binlog_message_delete (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "binlog.messageNew", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_binlog_message_new (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "binlog.messageEncrNew", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_binlog_message_encr_new (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "binlog.msgUpdate", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_binlog_msg_update (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "binlog.resetAuthorization", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_binlog_reset_authorization (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_contacts_blocked (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 16 && !memcmp (cur_token, "contacts.blocked", cur_token_len)) {
+ out_int (0x1c138d15);
+ local_next_token ();
+ if (store_constructor_contacts_blocked (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "contacts.blockedSlice", cur_token_len)) {
+ out_int (0x900802a1);
+ local_next_token ();
+ if (store_constructor_contacts_blocked_slice (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_contacts_blocked (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 16 && !memcmp (cur_token, "contacts.blocked", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_contacts_blocked (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "contacts.blockedSlice", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_contacts_blocked_slice (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_contacts_contacts (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 28 && !memcmp (cur_token, "contacts.contactsNotModified", cur_token_len)) {
+ out_int (0xb74ba9d2);
+ local_next_token ();
+ if (store_constructor_contacts_contacts_not_modified (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "contacts.contacts", cur_token_len)) {
+ out_int (0x6f8b8cb2);
+ local_next_token ();
+ if (store_constructor_contacts_contacts (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_contacts_contacts (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 28 && !memcmp (cur_token, "contacts.contactsNotModified", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_contacts_contacts_not_modified (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "contacts.contacts", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_contacts_contacts (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_contacts_found (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "contacts.found", cur_token_len)) {
+ out_int (0x0566000e);
+ local_next_token ();
+ if (store_constructor_contacts_found (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_contacts_found (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "contacts.found", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_contacts_found (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_contacts_imported_contacts (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 25 && !memcmp (cur_token, "contacts.importedContacts", cur_token_len)) {
+ out_int (0xad524315);
+ local_next_token ();
+ if (store_constructor_contacts_imported_contacts (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_contacts_imported_contacts (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 25 && !memcmp (cur_token, "contacts.importedContacts", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_contacts_imported_contacts (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_contacts_link (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "contacts.link", cur_token_len)) {
+ out_int (0x3ace484c);
+ local_next_token ();
+ if (store_constructor_contacts_link (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_contacts_link (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "contacts.link", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_contacts_link (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_contacts_suggested (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "contacts.suggested", cur_token_len)) {
+ out_int (0x5649dcc5);
+ local_next_token ();
+ if (store_constructor_contacts_suggested (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_contacts_suggested (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 18 && !memcmp (cur_token, "contacts.suggested", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_contacts_suggested (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_geochats_located (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 16 && !memcmp (cur_token, "geochats.located", cur_token_len)) {
+ out_int (0x48feb267);
+ local_next_token ();
+ if (store_constructor_geochats_located (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_geochats_located (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 16 && !memcmp (cur_token, "geochats.located", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_geochats_located (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_geochats_messages (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "geochats.messages", cur_token_len)) {
+ out_int (0xd1526db1);
+ local_next_token ();
+ if (store_constructor_geochats_messages (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "geochats.messagesSlice", cur_token_len)) {
+ out_int (0xbc5863e8);
+ local_next_token ();
+ if (store_constructor_geochats_messages_slice (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_geochats_messages (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "geochats.messages", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_geochats_messages (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "geochats.messagesSlice", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_geochats_messages_slice (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_geochats_stated_message (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 22 && !memcmp (cur_token, "geochats.statedMessage", cur_token_len)) {
+ out_int (0x17b1578b);
+ local_next_token ();
+ if (store_constructor_geochats_stated_message (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_geochats_stated_message (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 22 && !memcmp (cur_token, "geochats.statedMessage", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_geochats_stated_message (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_help_app_update (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "help.appUpdate", cur_token_len)) {
+ out_int (0x8987f311);
+ local_next_token ();
+ if (store_constructor_help_app_update (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "help.noAppUpdate", cur_token_len)) {
+ out_int (0xc45a6536);
+ local_next_token ();
+ if (store_constructor_help_no_app_update (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_help_app_update (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 14 && !memcmp (cur_token, "help.appUpdate", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_help_app_update (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "help.noAppUpdate", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_help_no_app_update (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_help_invite_text (struct paramed_type *T) {
+ out_int (0x18cb9f78);
+ if (store_constructor_help_invite_text (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_bare_help_invite_text (struct paramed_type *T) {
+ if (store_constructor_help_invite_text (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_help_support (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 12 && !memcmp (cur_token, "help.support", cur_token_len)) {
+ out_int (0x17c6b5f6);
+ local_next_token ();
+ if (store_constructor_help_support (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_help_support (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 12 && !memcmp (cur_token, "help.support", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_help_support (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_messages_affected_history (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 24 && !memcmp (cur_token, "messages.affectedHistory", cur_token_len)) {
+ out_int (0xb45c69d1);
+ local_next_token ();
+ if (store_constructor_messages_affected_history (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_messages_affected_history (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 24 && !memcmp (cur_token, "messages.affectedHistory", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_messages_affected_history (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_messages_affected_messages (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 25 && !memcmp (cur_token, "messages.affectedMessages", cur_token_len)) {
+ out_int (0x84d19185);
+ local_next_token ();
+ if (store_constructor_messages_affected_messages (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_messages_affected_messages (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 25 && !memcmp (cur_token, "messages.affectedMessages", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_messages_affected_messages (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_messages_all_stickers (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 31 && !memcmp (cur_token, "messages.allStickersNotModified", cur_token_len)) {
+ out_int (0xe86602c3);
+ local_next_token ();
+ if (store_constructor_messages_all_stickers_not_modified (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messages.allStickers", cur_token_len)) {
+ out_int (0x5ce352ec);
+ local_next_token ();
+ if (store_constructor_messages_all_stickers (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_messages_all_stickers (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 31 && !memcmp (cur_token, "messages.allStickersNotModified", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_messages_all_stickers_not_modified (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messages.allStickers", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_messages_all_stickers (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_messages_chat_full (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messages.chatFull", cur_token_len)) {
+ out_int (0xe5d7d19c);
+ local_next_token ();
+ if (store_constructor_messages_chat_full (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_messages_chat_full (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messages.chatFull", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_messages_chat_full (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_messages_chats (struct paramed_type *T) {
+ out_int (0x64ff9fd5);
+ if (store_constructor_messages_chats (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_bare_messages_chats (struct paramed_type *T) {
+ if (store_constructor_messages_chats (T) < 0) { return -1; }
+ return 0;
+}
+int store_type_messages_dh_config (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 28 && !memcmp (cur_token, "messages.dhConfigNotModified", cur_token_len)) {
+ out_int (0xc0e24635);
+ local_next_token ();
+ if (store_constructor_messages_dh_config_not_modified (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messages.dhConfig", cur_token_len)) {
+ out_int (0x2c221edd);
+ local_next_token ();
+ if (store_constructor_messages_dh_config (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_messages_dh_config (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 28 && !memcmp (cur_token, "messages.dhConfigNotModified", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_messages_dh_config_not_modified (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messages.dhConfig", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_messages_dh_config (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_messages_dialogs (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 16 && !memcmp (cur_token, "messages.dialogs", cur_token_len)) {
+ out_int (0x15ba6c40);
+ local_next_token ();
+ if (store_constructor_messages_dialogs (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "messages.dialogsSlice", cur_token_len)) {
+ out_int (0x71e094f3);
+ local_next_token ();
+ if (store_constructor_messages_dialogs_slice (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_messages_dialogs (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 16 && !memcmp (cur_token, "messages.dialogs", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_messages_dialogs (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "messages.dialogsSlice", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_messages_dialogs_slice (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_messages_message (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 21 && !memcmp (cur_token, "messages.messageEmpty", cur_token_len)) {
+ out_int (0x3f4e0648);
+ local_next_token ();
+ if (store_constructor_messages_message_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_messages_message (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 21 && !memcmp (cur_token, "messages.messageEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_messages_message_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_messages_messages (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messages.messages", cur_token_len)) {
+ out_int (0x8c718e87);
+ local_next_token ();
+ if (store_constructor_messages_messages (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "messages.messagesSlice", cur_token_len)) {
+ out_int (0x0b446ae3);
+ local_next_token ();
+ if (store_constructor_messages_messages_slice (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_messages_messages (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messages.messages", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_messages_messages (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "messages.messagesSlice", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_messages_messages_slice (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_messages_sent_encrypted_message (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 29 && !memcmp (cur_token, "messages.sentEncryptedMessage", cur_token_len)) {
+ out_int (0x560f8935);
+ local_next_token ();
+ if (store_constructor_messages_sent_encrypted_message (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "messages.sentEncryptedFile", cur_token_len)) {
+ out_int (0x9493ff32);
+ local_next_token ();
+ if (store_constructor_messages_sent_encrypted_file (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_messages_sent_encrypted_message (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 29 && !memcmp (cur_token, "messages.sentEncryptedMessage", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_messages_sent_encrypted_message (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "messages.sentEncryptedFile", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_messages_sent_encrypted_file (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_messages_sent_message (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messages.sentMessage", cur_token_len)) {
+ out_int (0x4c3d47f3);
+ local_next_token ();
+ if (store_constructor_messages_sent_message (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "messages.sentMessageLink", cur_token_len)) {
+ out_int (0x35a1a663);
+ local_next_token ();
+ if (store_constructor_messages_sent_message_link (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_messages_sent_message (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messages.sentMessage", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_messages_sent_message (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "messages.sentMessageLink", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_messages_sent_message_link (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_messages_sticker_set (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 19 && !memcmp (cur_token, "messages.stickerSet", cur_token_len)) {
+ out_int (0xb60a24a6);
+ local_next_token ();
+ if (store_constructor_messages_sticker_set (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_messages_sticker_set (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 19 && !memcmp (cur_token, "messages.stickerSet", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_messages_sticker_set (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_messages_stickers (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 28 && !memcmp (cur_token, "messages.stickersNotModified", cur_token_len)) {
+ out_int (0xf1749a22);
+ local_next_token ();
+ if (store_constructor_messages_stickers_not_modified (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messages.stickers", cur_token_len)) {
+ out_int (0x8a8ecd32);
+ local_next_token ();
+ if (store_constructor_messages_stickers (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_messages_stickers (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 28 && !memcmp (cur_token, "messages.stickersNotModified", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_messages_stickers_not_modified (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messages.stickers", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_messages_stickers (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_photos_photo (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 12 && !memcmp (cur_token, "photos.photo", cur_token_len)) {
+ out_int (0x20212ca8);
+ local_next_token ();
+ if (store_constructor_photos_photo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_photos_photo (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 12 && !memcmp (cur_token, "photos.photo", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_photos_photo (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_photos_photos (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "photos.photos", cur_token_len)) {
+ out_int (0x8dca6aa5);
+ local_next_token ();
+ if (store_constructor_photos_photos (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "photos.photosSlice", cur_token_len)) {
+ out_int (0x15051f54);
+ local_next_token ();
+ if (store_constructor_photos_photos_slice (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_photos_photos (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "photos.photos", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_photos_photos (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "photos.photosSlice", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_photos_photos_slice (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_storage_file_type (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 19 && !memcmp (cur_token, "storage.fileUnknown", cur_token_len)) {
+ out_int (0xaa963b05);
+ local_next_token ();
+ if (store_constructor_storage_file_unknown (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "storage.fileJpeg", cur_token_len)) {
+ out_int (0x007efe0e);
+ local_next_token ();
+ if (store_constructor_storage_file_jpeg (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "storage.fileGif", cur_token_len)) {
+ out_int (0xcae1aadf);
+ local_next_token ();
+ if (store_constructor_storage_file_gif (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "storage.filePng", cur_token_len)) {
+ out_int (0x0a4f63c0);
+ local_next_token ();
+ if (store_constructor_storage_file_png (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "storage.filePdf", cur_token_len)) {
+ out_int (0xae1e508d);
+ local_next_token ();
+ if (store_constructor_storage_file_pdf (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "storage.fileMp3", cur_token_len)) {
+ out_int (0x528a0677);
+ local_next_token ();
+ if (store_constructor_storage_file_mp3 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "storage.fileMov", cur_token_len)) {
+ out_int (0x4b09ebbc);
+ local_next_token ();
+ if (store_constructor_storage_file_mov (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "storage.filePartial", cur_token_len)) {
+ out_int (0x40bc6f52);
+ local_next_token ();
+ if (store_constructor_storage_file_partial (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "storage.fileMp4", cur_token_len)) {
+ out_int (0xb3cea0e4);
+ local_next_token ();
+ if (store_constructor_storage_file_mp4 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "storage.fileWebp", cur_token_len)) {
+ out_int (0x1081464c);
+ local_next_token ();
+ if (store_constructor_storage_file_webp (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_storage_file_type (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 19 && !memcmp (cur_token, "storage.fileUnknown", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_storage_file_unknown (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "storage.fileJpeg", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_storage_file_jpeg (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "storage.fileGif", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_storage_file_gif (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "storage.filePng", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_storage_file_png (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "storage.filePdf", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_storage_file_pdf (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "storage.fileMp3", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_storage_file_mp3 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "storage.fileMov", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_storage_file_mov (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "storage.filePartial", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_storage_file_partial (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "storage.fileMp4", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_storage_file_mp4 (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "storage.fileWebp", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_storage_file_webp (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_updates_difference (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 23 && !memcmp (cur_token, "updates.differenceEmpty", cur_token_len)) {
+ out_int (0x5d75a138);
+ local_next_token ();
+ if (store_constructor_updates_difference_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "updates.difference", cur_token_len)) {
+ out_int (0x00f49ca0);
+ local_next_token ();
+ if (store_constructor_updates_difference (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "updates.differenceSlice", cur_token_len)) {
+ out_int (0xa8fb1981);
+ local_next_token ();
+ if (store_constructor_updates_difference_slice (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_updates_difference (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 23 && !memcmp (cur_token, "updates.differenceEmpty", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_updates_difference_empty (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "updates.difference", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_updates_difference (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "updates.differenceSlice", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_updates_difference_slice (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_updates_state (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "updates.state", cur_token_len)) {
+ out_int (0xa56c2a3e);
+ local_next_token ();
+ if (store_constructor_updates_state (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_updates_state (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 13 && !memcmp (cur_token, "updates.state", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_updates_state (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_upload_file (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 11 && !memcmp (cur_token, "upload.file", cur_token_len)) {
+ out_int (0x096a18d5);
+ local_next_token ();
+ if (store_constructor_upload_file (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+int store_type_bare_upload_file (struct paramed_type *T) {
+ expect_token ("(", 1);
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len < 0) { return -1; }
+ if (cur_token_len == 11 && !memcmp (cur_token, "upload.file", cur_token_len)) {
+ local_next_token ();
+ if (store_constructor_upload_file (T) < 0) { return -1; }
+ expect_token (")", 1);
+ return 0;
+ }
+ return -1;
+}
+struct paramed_type *store_function_account_change_phone (void) {
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "phone_number", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "phone_code_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "phone_code", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_account_check_username (void) {
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "username", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_account_delete_account (void) {
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "reason", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_account_get_account_t_t_l (void) {
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb8d0afdf, .id = "AccountDaysTTL", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_account_get_authorizations (void) {
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1250abde, .id = "account.Authorizations", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_account_get_notify_settings (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02b6911b, .id = "InputNotifyPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_notify_peer (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xfdf894fc, .id = "PeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_account_get_password (void) {
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xeac2a804, .id = "account.Password", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_account_get_password_settings (void) {
+ if (cur_token_len >= 0 && cur_token_len == 21 && !cur_token_quoted && !memcmp (cur_token, "current_password_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb7b72ab3, .id = "account.PasswordSettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_account_get_privacy (void) {
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "key", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4f96cb18, .id = "InputPrivacyKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_privacy_key (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x554abb6f, .id = "account.PrivacyRules", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_account_get_wall_papers (void) {
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xafa14973, .id = "WallPaper", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_account_register_device (void) {
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "token_type", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "token", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "device_model", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 14 && !cur_token_quoted && !memcmp (cur_token, "system_version", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "app_version", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field5) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "app_sandbox", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bool (field6) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "lang_code", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field7) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_account_reset_authorization (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_account_reset_notify_settings (void) {
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_account_send_change_phone_code (void) {
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "phone_number", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa4f58c4c, .id = "account.SentChangePhoneCode", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_account_set_account_t_t_l (void) {
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "ttl", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb8d0afdf, .id = "AccountDaysTTL", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_account_days_t_t_l (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_account_set_privacy (void) {
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "key", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4f96cb18, .id = "InputPrivacyKey", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_privacy_key (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "rules", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4b815163, .id = "InputPrivacyRule", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x554abb6f, .id = "account.PrivacyRules", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_account_unregister_device (void) {
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "token_type", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "token", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_account_update_device_locked (void) {
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "period", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_account_update_notify_settings (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02b6911b, .id = "InputNotifyPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_notify_peer (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "settings", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x46a2ce98, .id = "InputPeerNotifySettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_peer_notify_settings (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_account_update_password_settings (void) {
+ if (cur_token_len >= 0 && cur_token_len == 21 && !cur_token_quoted && !memcmp (cur_token, "current_password_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "new_settings", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xbcfc532c, .id = "account.PasswordInputSettings", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_account_password_input_settings (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_account_update_profile (void) {
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "first_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "last_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_account_update_status (void) {
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "offline", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bool (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_account_update_username (void) {
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "username", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_auth_bind_temp_auth_key (void) {
+ if (cur_token_len >= 0 && cur_token_len == 16 && !cur_token_quoted && !memcmp (cur_token, "perm_auth_key_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "expires_at", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 17 && !cur_token_quoted && !memcmp (cur_token, "encrypted_message", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field4) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_auth_check_password (void) {
+ if (cur_token_len >= 0 && cur_token_len == 13 && !cur_token_quoted && !memcmp (cur_token, "password_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xff036af1, .id = "auth.Authorization", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_auth_check_phone (void) {
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "phone_number", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x811ea28e, .id = "auth.CheckedPhone", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_auth_export_authorization (void) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "dc_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xdf969c2d, .id = "auth.ExportedAuthorization", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_auth_import_authorization (void) {
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "bytes", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xff036af1, .id = "auth.Authorization", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_auth_import_bot_authorization (void) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "api_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "api_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 14 && !cur_token_quoted && !memcmp (cur_token, "bot_auth_token", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xff036af1, .id = "auth.Authorization", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_auth_log_out (void) {
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_auth_recover_password (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "code", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xff036af1, .id = "auth.Authorization", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_auth_request_password_recovery (void) {
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x137948a5, .id = "auth.PasswordRecovery", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_auth_reset_authorizations (void) {
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_auth_send_call (void) {
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "phone_number", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "phone_code_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_auth_send_code (void) {
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "phone_number", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "sms_type", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "api_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "api_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "lang_code", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field5) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0cc8bc16, .id = "auth.SentCode", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_auth_send_invites (void) {
+ if (cur_token_len >= 0 && cur_token_len == 13 && !cur_token_quoted && !memcmp (cur_token, "phone_numbers", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_auth_send_sms (void) {
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "phone_number", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "phone_code_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_auth_sign_in (void) {
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "phone_number", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "phone_code_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "phone_code", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xff036af1, .id = "auth.Authorization", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_auth_sign_up (void) {
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "phone_number", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "phone_code_hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "phone_code", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "first_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "last_name", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field5) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xff036af1, .id = "auth.Authorization", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_contacts_block (void) {
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_user (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_contacts_delete_contact (void) {
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_user (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3ace484c, .id = "contacts.Link", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_contacts_delete_contacts (void) {
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_contacts_export_card (void) {
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_contacts_get_blocked (void) {
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "offset", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "limit", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x8c1b8fb4, .id = "contacts.Blocked", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_contacts_get_contacts (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xd8c02560, .id = "contacts.Contacts", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_contacts_get_statuses (void) {
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xd3680c61, .id = "ContactStatus", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_contacts_get_suggested (void) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "limit", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5649dcc5, .id = "contacts.Suggested", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_contacts_import_card (void) {
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "export_card", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_contacts_import_contacts (void) {
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "contacts", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf392b7f4, .id = "InputContact", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "replace", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bool (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xad524315, .id = "contacts.ImportedContacts", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_contacts_resolve_username (void) {
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "username", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_contacts_search (void) {
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "q", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "limit", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0566000e, .id = "contacts.Found", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_contacts_unblock (void) {
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_user (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_geochats_checkin (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x74d456fa, .id = "InputGeoChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_geo_chat (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17b1578b, .id = "geochats.StatedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_geochats_create_geo_chat (void) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "geo_point", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17768f1f, .id = "InputGeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_geo_point (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "address", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "venue", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17b1578b, .id = "geochats.StatedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_geochats_edit_chat_photo (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x74d456fa, .id = "InputGeoChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_geo_chat (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3a60776d, .id = "InputChatPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_chat_photo (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17b1578b, .id = "geochats.StatedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_geochats_edit_chat_title (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x74d456fa, .id = "InputGeoChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_geo_chat (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "address", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17b1578b, .id = "geochats.StatedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_geochats_get_full_chat (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x74d456fa, .id = "InputGeoChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_geo_chat (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe5d7d19c, .id = "messages.ChatFull", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_geochats_get_history (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x74d456fa, .id = "InputGeoChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_geo_chat (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "offset", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "max_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "limit", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x6d0a0e59, .id = "geochats.Messages", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_geochats_get_located (void) {
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "geo_point", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17768f1f, .id = "InputGeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_geo_point (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "radius", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "limit", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x48feb267, .id = "geochats.Located", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_geochats_get_recents (void) {
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "offset", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "limit", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x6d0a0e59, .id = "geochats.Messages", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_geochats_search (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x74d456fa, .id = "InputGeoChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_geo_chat (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "q", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "filter", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x80895ae0, .id = "MessagesFilter", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_messages_filter (field3) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "min_date", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "max_date", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "offset", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field6) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "max_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field7) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "limit", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field8) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x6d0a0e59, .id = "geochats.Messages", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_geochats_send_media (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x74d456fa, .id = "InputGeoChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_geo_chat (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "media", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb32c91dd, .id = "InputMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_media (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17b1578b, .id = "geochats.StatedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_geochats_send_message (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x74d456fa, .id = "InputGeoChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_geo_chat (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17b1578b, .id = "geochats.StatedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_geochats_set_typing (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x74d456fa, .id = "InputGeoChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_geo_chat (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "typing", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bool (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_help_get_app_update (void) {
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "device_model", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 14 && !cur_token_quoted && !memcmp (cur_token, "system_version", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "app_version", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "lang_code", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ddd9627, .id = "help.AppUpdate", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_help_get_config (void) {
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4e32b894, .id = "Config", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_help_get_invite_text (void) {
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "lang_code", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x18cb9f78, .id = "help.InviteText", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_help_get_nearest_dc (void) {
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x8e1a1775, .id = "NearestDc", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_help_get_support (void) {
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17c6b5f6, .id = "help.Support", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_help_save_app_log (void) {
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "events", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x770656a8, .id = "InputAppEvent", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_init_connection (void) {
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "api_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "device_model", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 14 && !cur_token_quoted && !memcmp (cur_token, "system_version", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "app_version", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field5) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "lang_code", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field6) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "query", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field7 = store_function_any ();
+ if (!field7) { return 0; }
+ if (ODDP(field7)) { return 0; }
+ struct paramed_type *var0 = field7; assert (var0);
+ struct paramed_type *R =
+ var0;
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_invoke_after_msg (void) {
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "msg_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "query", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 = store_function_any ();
+ if (!field3) { return 0; }
+ if (ODDP(field3)) { return 0; }
+ struct paramed_type *var0 = field3; assert (var0);
+ struct paramed_type *R =
+ var0;
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_invoke_after_msgs (void) {
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "msg_ids", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "query", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 = store_function_any ();
+ if (!field3) { return 0; }
+ if (ODDP(field3)) { return 0; }
+ struct paramed_type *var0 = field3; assert (var0);
+ struct paramed_type *R =
+ var0;
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_invoke_with_layer (void) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "layer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "query", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 = store_function_any ();
+ if (!field3) { return 0; }
+ if (ODDP(field3)) { return 0; }
+ struct paramed_type *var0 = field3; assert (var0);
+ struct paramed_type *R =
+ var0;
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_invoke_without_updates (void) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "query", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 = store_function_any ();
+ if (!field2) { return 0; }
+ if (ODDP(field2)) { return 0; }
+ struct paramed_type *var0 = field2; assert (var0);
+ struct paramed_type *R =
+ var0;
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_accept_encryption (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf141b5e1, .id = "InputEncryptedChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_encrypted_chat (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "g_b", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "key_fingerprint", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb1718213, .id = "EncryptedChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_add_chat_user (void) {
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_user (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "fwd_limit", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x22499d27, .id = "Updates", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_check_chat_invite (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x94f910b1, .id = "ChatInvite", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_create_chat (void) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "users", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x22499d27, .id = "Updates", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_delete_chat_user (void) {
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_user (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x22499d27, .id = "Updates", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_delete_history (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9e67268d, .id = "InputPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_peer (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "offset", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb45c69d1, .id = "messages.AffectedHistory", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_delete_messages (void) {
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x84d19185, .id = "messages.AffectedMessages", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_discard_encryption (void) {
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_edit_chat_photo (void) {
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "photo", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x3a60776d, .id = "InputChatPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_chat_photo (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x22499d27, .id = "Updates", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_edit_chat_title (void) {
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "title", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x22499d27, .id = "Updates", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_export_chat_invite (void) {
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f132d5, .id = "ExportedChatInvite", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_forward_message (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9e67268d, .id = "InputPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_peer (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x22499d27, .id = "Updates", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_forward_messages (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9e67268d, .id = "InputPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_peer (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x22499d27, .id = "Updates", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_get_all_stickers (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb485502f, .id = "messages.AllStickers", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_get_chats (void) {
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x64ff9fd5, .id = "messages.Chats", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_get_dh_config (void) {
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "version", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 13 && !cur_token_quoted && !memcmp (cur_token, "random_length", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xecc058e8, .id = "messages.DhConfig", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_get_dialogs (void) {
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "offset", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "max_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "limit", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x645af8b3, .id = "messages.Dialogs", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_get_full_chat (void) {
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe5d7d19c, .id = "messages.ChatFull", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_get_history (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9e67268d, .id = "InputPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_peer (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "offset", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "max_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "limit", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x8735e464, .id = "messages.Messages", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_get_messages (void) {
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x8735e464, .id = "messages.Messages", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_get_sticker_set (void) {
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "stickerset", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe44d415c, .id = "InputStickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_sticker_set (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb60a24a6, .id = "messages.StickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_get_stickers (void) {
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "emoticon", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7bfa5710, .id = "messages.Stickers", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_get_web_page_preview (void) {
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x95f2471a, .id = "MessageMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_import_chat_invite (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "hash", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x22499d27, .id = "Updates", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_install_sticker_set (void) {
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "stickerset", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe44d415c, .id = "InputStickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_sticker_set (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_read_encrypted_history (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf141b5e1, .id = "InputEncryptedChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_encrypted_chat (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "max_date", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_read_history (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9e67268d, .id = "InputPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_peer (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "max_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "offset", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb45c69d1, .id = "messages.AffectedHistory", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_read_message_contents (void) {
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x84d19185, .id = "messages.AffectedMessages", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_received_messages (void) {
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "max_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa384b779, .id = "ReceivedNotifyMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_received_queue (void) {
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "max_qts", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_request_encryption (void) {
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_user (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "g_a", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb1718213, .id = "EncryptedChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_search (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9e67268d, .id = "InputPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_peer (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "q", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "filter", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x80895ae0, .id = "MessagesFilter", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_messages_filter (field3) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "min_date", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "max_date", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field5) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "offset", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field6) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "max_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field7 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field7) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "limit", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field8 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field8) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x8735e464, .id = "messages.Messages", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_send_broadcast (void) {
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "contacts", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "media", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb32c91dd, .id = "InputMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_media (field4) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x22499d27, .id = "Updates", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_send_encrypted (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf141b5e1, .id = "InputEncryptedChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_encrypted_chat (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "data", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc29c7607, .id = "messages.SentEncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_send_encrypted_file (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf141b5e1, .id = "InputEncryptedChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_encrypted_chat (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "data", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field3) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "file", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0b5c064f, .id = "InputEncryptedFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_encrypted_file (field4) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc29c7607, .id = "messages.SentEncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_send_encrypted_service (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf141b5e1, .id = "InputEncryptedChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_encrypted_chat (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "data", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xc29c7607, .id = "messages.SentEncryptedMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_send_media (void) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ if (cur_token_len < 0) { return 0; }
+ if (!is_int ()) { return 0;}
+ struct paramed_type *var0 = INT2PTR (get_int ());
+ out_int (get_int ());
+ assert (var0);
+ local_next_token ();
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9e67268d, .id = "InputPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_peer (field2) < 0) { return 0;}
+ if (PTR2INT (var0) & (1 << 0)) {
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "reply_to_msg_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return 0;}
+ }
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "media", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xb32c91dd, .id = "InputMedia", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_media (field4) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field5) < 0) { return 0;}
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "reply_markup", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x612ca4a9, .id = "ReplyMarkup", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_reply_markup (field6) < 0) { return 0;}
+ }
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x22499d27, .id = "Updates", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_send_message (void) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "flags", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ if (cur_token_len < 0) { return 0; }
+ if (!is_int ()) { return 0;}
+ struct paramed_type *var0 = INT2PTR (get_int ());
+ out_int (get_int ());
+ assert (var0);
+ local_next_token ();
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9e67268d, .id = "InputPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_peer (field2) < 0) { return 0;}
+ if (PTR2INT (var0) & (1 << 0)) {
+ if (cur_token_len >= 0 && cur_token_len == 15 && !cur_token_quoted && !memcmp (cur_token, "reply_to_msg_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return 0;}
+ }
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "message", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field5) < 0) { return 0;}
+ if (PTR2INT (var0) & (1 << 2)) {
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "reply_markup", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x612ca4a9, .id = "ReplyMarkup", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_reply_markup (field6) < 0) { return 0;}
+ }
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x799ce190, .id = "messages.SentMessage", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_set_encrypted_typing (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf141b5e1, .id = "InputEncryptedChat", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_encrypted_chat (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "typing", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bool (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_set_typing (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "peer", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9e67268d, .id = "InputPeer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_peer (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "action", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x70541c7e, .id = "SendMessageAction", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_send_message_action (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_start_bot (void) {
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "bot", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_user (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "chat_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "random_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field3) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 11 && !cur_token_quoted && !memcmp (cur_token, "start_param", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x22499d27, .id = "Updates", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_messages_uninstall_sticker_set (void) {
+ if (cur_token_len >= 0 && cur_token_len == 10 && !cur_token_quoted && !memcmp (cur_token, "stickerset", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe44d415c, .id = "InputStickerSet", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_sticker_set (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_photos_delete_photos (void) {
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe74279c9, .id = "InputPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_photos_get_user_photos (void) {
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "user_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_user (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "offset", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "max_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "limit", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field4) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x98cf75f1, .id = "photos.Photos", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_photos_update_profile_photo (void) {
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe74279c9, .id = "InputPhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_photo (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "crop", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7477e321, .id = "InputPhotoCrop", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_photo_crop (field2) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x9a486229, .id = "UserProfilePhoto", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_photos_upload_profile_photo (void) {
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "file", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x0f60f9ca, .id = "InputFile", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_file (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "caption", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "geo_point", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x17768f1f, .id = "InputGeoPoint", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_geo_point (field3) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "crop", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x7477e321, .id = "InputPhotoCrop", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_photo_crop (field4) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x20212ca8, .id = "photos.Photo", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_req_d_h_params (void) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "server_nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "p", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 1 && !cur_token_quoted && !memcmp (cur_token, "q", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field4) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 22 && !cur_token_quoted && !memcmp (cur_token, "public_key_fingerprint", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field5 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field5) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 14 && !cur_token_quoted && !memcmp (cur_token, "encrypted_data", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field6 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field6) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa9230301, .id = "Server_DH_Params", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_req_pq (void) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x05162463, .id = "ResPQ", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_set_client_d_h_params (void) {
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 12 && !cur_token_quoted && !memcmp (cur_token, "server_nonce", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x82c93bc6, .id = "Bare_Int128", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int128 (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 14 && !cur_token_quoted && !memcmp (cur_token, "encrypted_data", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x4ad791db, .id = "Bare_String", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_string (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xdb8a468f, .id = "Set_client_DH_params_answer", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_updates_get_difference (void) {
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "pts", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 4 && !cur_token_quoted && !memcmp (cur_token, "date", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 3 && !cur_token_quoted && !memcmp (cur_token, "qts", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf57a2419, .id = "updates.Difference", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_updates_get_state (void) {
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xa56c2a3e, .id = "updates.State", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_upload_get_file (void) {
+ if (cur_token_len >= 0 && cur_token_len == 8 && !cur_token_quoted && !memcmp (cur_token, "location", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xe6daa38b, .id = "InputFileLocation", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_file_location (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 6 && !cur_token_quoted && !memcmp (cur_token, "offset", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "limit", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x096a18d5, .id = "upload.File", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_upload_save_big_file_part (void) {
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "file_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "file_part", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 16 && !cur_token_quoted && !memcmp (cur_token, "file_total_parts", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field3) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "bytes", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field4 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field4) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_upload_save_file_part (void) {
+ if (cur_token_len >= 0 && cur_token_len == 7 && !cur_token_quoted && !memcmp (cur_token, "file_id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xddf89345, .id = "Bare_Long", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_long (field1) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 9 && !cur_token_quoted && !memcmp (cur_token, "file_part", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field2 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x57af6425, .id = "Bare_Int", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_int (field2) < 0) { return 0;}
+ if (cur_token_len >= 0 && cur_token_len == 5 && !cur_token_quoted && !memcmp (cur_token, "bytes", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field3 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xf11ec860, .id = "Bare_Bytes", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_bare_bytes (field3) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x250be282, .id = "Bool", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_users_get_full_user (void) {
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ if (store_type_input_user (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x5a89ac5b, .id = "UserFull", .params_num = 0, .params_types = 0},
+ .params = 0,
+ };
+ return paramed_type_dup (R);
+}
+struct paramed_type *store_function_users_get_users (void) {
+ if (cur_token_len >= 0 && cur_token_len == 2 && !cur_token_quoted && !memcmp (cur_token, "id", cur_token_len)) {
+ local_next_token ();
+ expect_token_ptr (":", 1);
+ }
+ struct paramed_type *field1 =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0xadfe0c6a, .id = "InputUser", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ if (store_type_vector (field1) < 0) { return 0;}
+ struct paramed_type *R =
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x1cb5c415, .id = "Vector", .params_num = 1, .params_types = 0},
+ .params = (struct paramed_type *[]){
+ &(struct paramed_type){
+ .type = &(struct tl_type_descr) {.name = 0x02e6c0c8, .id = "User", .params_num = 0, .params_types = 0},
+ .params = 0,
+ },
+ }
+ };
+ return paramed_type_dup (R);
+}
+int store_type_any (struct paramed_type *T) {
+ switch (T->type->name) {
+ case 0xb8d0afdf: return store_type_account_days_t_t_l (T);
+ case 0x472f5020: return store_type_bare_account_days_t_t_l (T);
+ case 0x9fc5ec4e: return store_type_audio (T);
+ case 0x603a13b1: return store_type_bare_audio (T);
+ case 0x7bf2e6f6: return store_type_authorization (T);
+ case 0x840d1909: return store_type_bare_authorization (T);
+ case 0x250be282: return store_type_bool (T);
+ case 0xdaf41d7d: return store_type_bare_bool (T);
+ case 0x75e7ea6c: return store_type_bot_command (T);
+ case 0x8a181593: return store_type_bare_bot_command (T);
+ case 0xb2e16f93: return store_type_bot_info (T);
+ case 0x4d1e906c: return store_type_bare_bot_info (T);
+ case 0x0ee1379f: return store_type_bytes (T);
+ case 0xf11ec860: return store_type_bare_bytes (T);
+ case 0x7bd865dc: return store_type_chat (T);
+ case 0x84279a23: return store_type_bare_chat (T);
+ case 0x2e02a614: return store_type_chat_full (T);
+ case 0xd1fd59eb: return store_type_bare_chat_full (T);
+ case 0x94f910b1: return store_type_chat_invite (T);
+ case 0x6b06ef4e: return store_type_bare_chat_invite (T);
+ case 0x3631cf4c: return store_type_chat_located (T);
+ case 0xc9ce30b3: return store_type_bare_chat_located (T);
+ case 0xc8d7493e: return store_type_chat_participant (T);
+ case 0x3728b6c1: return store_type_bare_chat_participant (T);
+ case 0x77930f9f: return store_type_chat_participants (T);
+ case 0x886cf060: return store_type_bare_chat_participants (T);
+ case 0x56922676: return store_type_chat_photo (T);
+ case 0xa96dd989: return store_type_bare_chat_photo (T);
+ case 0x6643b654: return store_type_client_d_h_inner_data (T);
+ case 0x99bc49ab: return store_type_bare_client_d_h_inner_data (T);
+ case 0x4e32b894: return store_type_config (T);
+ case 0xb1cd476b: return store_type_bare_config (T);
+ case 0xf911c994: return store_type_contact (T);
+ case 0x06ee366b: return store_type_bare_contact (T);
+ case 0x561bc879: return store_type_contact_blocked (T);
+ case 0xa9e43786: return store_type_bare_contact_blocked (T);
+ case 0xea879f95: return store_type_contact_found (T);
+ case 0x1578606a: return store_type_bare_contact_found (T);
+ case 0x522fbc63: return store_type_contact_link (T);
+ case 0xadd0439c: return store_type_bare_contact_link (T);
+ case 0xd3680c61: return store_type_contact_status (T);
+ case 0x2c97f39e: return store_type_bare_contact_status (T);
+ case 0x3de191a1: return store_type_contact_suggested (T);
+ case 0xc21e6e5e: return store_type_bare_contact_suggested (T);
+ case 0x2b1a62f0: return store_type_dc_option (T);
+ case 0xd4e59d0f: return store_type_bare_dc_option (T);
+ case 0x535b7918: return store_type_decrypted_message (T);
+ case 0xaca486e7: return store_type_bare_decrypted_message (T);
+ case 0x4e0eefde: return store_type_decrypted_message_action (T);
+ case 0xb1f11021: return store_type_bare_decrypted_message_action (T);
+ case 0x1be31789: return store_type_decrypted_message_layer (T);
+ case 0xe41ce876: return store_type_bare_decrypted_message_layer (T);
+ case 0x34e0d674: return store_type_decrypted_message_media (T);
+ case 0xcb1f298b: return store_type_bare_decrypted_message_media (T);
+ case 0xc1dd804a: return store_type_dialog (T);
+ case 0x3e227fb5: return store_type_bare_dialog (T);
+ case 0xae636f24: return store_type_disabled_feature (T);
+ case 0x519c90db: return store_type_bare_disabled_feature (T);
+ case 0x51a73418: return store_type_document (T);
+ case 0xae58cbe7: return store_type_bare_document (T);
+ case 0x97c637a3: return store_type_document_attribute (T);
+ case 0x6839c85c: return store_type_bare_document_attribute (T);
+ case 0x2210c154: return store_type_double (T);
+ case 0xddef3eab: return store_type_bare_double (T);
+ case 0xb1718213: return store_type_encrypted_chat (T);
+ case 0x4e8e7dec: return store_type_bare_encrypted_chat (T);
+ case 0x886fd032: return store_type_encrypted_file (T);
+ case 0x77902fcd: return store_type_bare_encrypted_file (T);
+ case 0xce6b8a1e: return store_type_encrypted_message (T);
+ case 0x319475e1: return store_type_bare_encrypted_message (T);
+ case 0xc4b9f9bb: return store_type_error (T);
+ case 0x3b460644: return store_type_bare_error (T);
+ case 0x95f132d5: return store_type_exported_chat_invite (T);
+ case 0x6a0ecd2a: return store_type_bare_exported_chat_invite (T);
+ case 0x2f8ffb30: return store_type_file_location (T);
+ case 0xd07004cf: return store_type_bare_file_location (T);
+ case 0xf67b4034: return store_type_geo_chat_message (T);
+ case 0x0984bfcb: return store_type_bare_geo_chat_message (T);
+ case 0x315e0a53: return store_type_geo_point (T);
+ case 0xcea1f5ac: return store_type_bare_geo_point (T);
+ case 0xd0028438: return store_type_imported_contact (T);
+ case 0x2ffd7bc7: return store_type_bare_imported_contact (T);
+ case 0x770656a8: return store_type_input_app_event (T);
+ case 0x88f9a957: return store_type_bare_input_app_event (T);
+ case 0xae8e9c7b: return store_type_input_audio (T);
+ case 0x51716384: return store_type_bare_input_audio (T);
+ case 0x3a60776d: return store_type_input_chat_photo (T);
+ case 0xc59f8892: return store_type_bare_input_chat_photo (T);
+ case 0xf392b7f4: return store_type_input_contact (T);
+ case 0x0c6d480b: return store_type_bare_input_contact (T);
+ case 0x6a8963fc: return store_type_input_document (T);
+ case 0x95769c03: return store_type_bare_input_document (T);
+ case 0xf141b5e1: return store_type_input_encrypted_chat (T);
+ case 0x0ebe4a1e: return store_type_bare_input_encrypted_chat (T);
+ case 0x0b5c064f: return store_type_input_encrypted_file (T);
+ case 0xf4a3f9b0: return store_type_bare_input_encrypted_file (T);
+ case 0x0f60f9ca: return store_type_input_file (T);
+ case 0xf09f0635: return store_type_bare_input_file (T);
+ case 0xe6daa38b: return store_type_input_file_location (T);
+ case 0x19255c74: return store_type_bare_input_file_location (T);
+ case 0x74d456fa: return store_type_input_geo_chat (T);
+ case 0x8b2ba905: return store_type_bare_input_geo_chat (T);
+ case 0x17768f1f: return store_type_input_geo_point (T);
+ case 0xe88970e0: return store_type_bare_input_geo_point (T);
+ case 0xb32c91dd: return store_type_input_media (T);
+ case 0x4cd36e22: return store_type_bare_input_media (T);
+ case 0x02b6911b: return store_type_input_notify_peer (T);
+ case 0xfd496ee4: return store_type_bare_input_notify_peer (T);
+ case 0x9e67268d: return store_type_input_peer (T);
+ case 0x6198d972: return store_type_bare_input_peer (T);
+ case 0x185a48ac: return store_type_input_peer_notify_events (T);
+ case 0xe7a5b753: return store_type_bare_input_peer_notify_events (T);
+ case 0x46a2ce98: return store_type_input_peer_notify_settings (T);
+ case 0xb95d3167: return store_type_bare_input_peer_notify_settings (T);
+ case 0xe74279c9: return store_type_input_photo (T);
+ case 0x18bd8636: return store_type_bare_input_photo (T);
+ case 0x7477e321: return store_type_input_photo_crop (T);
+ case 0x8b881cde: return store_type_bare_input_photo_crop (T);
+ case 0x4f96cb18: return store_type_input_privacy_key (T);
+ case 0xb06934e7: return store_type_bare_input_privacy_key (T);
+ case 0x4b815163: return store_type_input_privacy_rule (T);
+ case 0xb47eae9c: return store_type_bare_input_privacy_rule (T);
+ case 0xe44d415c: return store_type_input_sticker_set (T);
+ case 0x1bb2bea3: return store_type_bare_input_sticker_set (T);
+ case 0xadfe0c6a: return store_type_input_user (T);
+ case 0x5201f395: return store_type_bare_input_user (T);
+ case 0xbb5f7a27: return store_type_input_video (T);
+ case 0x44a085d8: return store_type_bare_input_video (T);
+ case 0xa8509bda: return store_type_int (T);
+ case 0x57af6425: return store_type_bare_int (T);
+ case 0x7d36c439: return store_type_int128 (T);
+ case 0x82c93bc6: return store_type_bare_int128 (T);
+ case 0xf2c798b3: return store_type_int256 (T);
+ case 0x0d38674c: return store_type_bare_int256 (T);
+ case 0xa2fa4880: return store_type_keyboard_button (T);
+ case 0x5d05b77f: return store_type_bare_keyboard_button (T);
+ case 0x77608b83: return store_type_keyboard_button_row (T);
+ case 0x889f747c: return store_type_bare_keyboard_button_row (T);
+ case 0x22076cba: return store_type_long (T);
+ case 0xddf89345: return store_type_bare_long (T);
+ case 0x5d652a7f: return store_type_message (T);
+ case 0xa29ad580: return store_type_bare_message (T);
+ case 0x383415fa: return store_type_message_action (T);
+ case 0xc7cbea05: return store_type_bare_message_action (T);
+ case 0x95f2471a: return store_type_message_media (T);
+ case 0x6a0db8e5: return store_type_bare_message_media (T);
+ case 0x80895ae0: return store_type_messages_filter (T);
+ case 0x7f76a51f: return store_type_bare_messages_filter (T);
+ case 0x8e1a1775: return store_type_nearest_dc (T);
+ case 0x71e5e88a: return store_type_bare_nearest_dc (T);
+ case 0x9fcb8237: return store_type_notify_peer (T);
+ case 0x60347dc8: return store_type_bare_notify_peer (T);
+ case 0x56730bcc: return store_type_null (T);
+ case 0xa98cf433: return store_type_bare_null (T);
+ case 0xbfa3de38: return store_type_p_q_inner_data (T);
+ case 0x405c21c7: return store_type_bare_p_q_inner_data (T);
+ case 0x276159d6: return store_type_peer (T);
+ case 0xd89ea629: return store_type_bare_peer (T);
+ case 0xc0c8d13b: return store_type_peer_notify_events (T);
+ case 0x3f372ec4: return store_type_bare_peer_notify_events (T);
+ case 0xfdf894fc: return store_type_peer_notify_settings (T);
+ case 0x02076b03: return store_type_bare_peer_notify_settings (T);
+ case 0xc207550a: return store_type_photo (T);
+ case 0x3df8aaf5: return store_type_bare_photo (T);
+ case 0x900f60dd: return store_type_photo_size (T);
+ case 0x6ff09f22: return store_type_bare_photo_size (T);
+ case 0xbc2eab30: return store_type_privacy_key (T);
+ case 0x43d154cf: return store_type_bare_privacy_key (T);
+ case 0xa8638aec: return store_type_privacy_rule (T);
+ case 0x579c7513: return store_type_bare_privacy_rule (T);
+ case 0xa384b779: return store_type_received_notify_message (T);
+ case 0x5c7b4886: return store_type_bare_received_notify_message (T);
+ case 0x612ca4a9: return store_type_reply_markup (T);
+ case 0x9ed35b56: return store_type_bare_reply_markup (T);
+ case 0x05162463: return store_type_res_p_q (T);
+ case 0xfae9db9c: return store_type_bare_res_p_q (T);
+ case 0x70541c7e: return store_type_send_message_action (T);
+ case 0x8fabe381: return store_type_bare_send_message_action (T);
+ case 0xa9230301: return store_type_server_d_h_params (T);
+ case 0x56dcfcfe: return store_type_bare_server_d_h_params (T);
+ case 0xb5890dba: return store_type_server_d_h_inner_data (T);
+ case 0x4a76f245: return store_type_bare_server_d_h_inner_data (T);
+ case 0xdb8a468f: return store_type_set_client_d_h_params_answer (T);
+ case 0x2475b970: return store_type_bare_set_client_d_h_params_answer (T);
+ case 0x12b299d4: return store_type_sticker_pack (T);
+ case 0xed4d662b: return store_type_bare_sticker_pack (T);
+ case 0xa7a43b17: return store_type_sticker_set (T);
+ case 0x585bc4e8: return store_type_bare_sticker_set (T);
+ case 0xb5286e24: return store_type_string (T);
+ case 0x4ad791db: return store_type_bare_string (T);
+ case 0x2e02b27e: return store_type_update (T);
+ case 0xd1fd4d81: return store_type_bare_update (T);
+ case 0x22499d27: return store_type_updates (T);
+ case 0xddb662d8: return store_type_bare_updates (T);
+ case 0x02e6c0c8: return store_type_user (T);
+ case 0xfd193f37: return store_type_bare_user (T);
+ case 0x5a89ac5b: return store_type_user_full (T);
+ case 0xa57653a4: return store_type_bare_user_full (T);
+ case 0x9a486229: return store_type_user_profile_photo (T);
+ case 0x65b79dd6: return store_type_bare_user_profile_photo (T);
+ case 0x76de9570: return store_type_user_status (T);
+ case 0x89216a8f: return store_type_bare_user_status (T);
+ case 0x1cb5c415: return store_type_vector (T);
+ case 0xe34a3bea: return store_type_bare_vector (T);
+ case 0x1716b174: return store_type_video (T);
+ case 0xe8e94e8b: return store_type_bare_video (T);
+ case 0xafa14973: return store_type_wall_paper (T);
+ case 0x505eb68c: return store_type_bare_wall_paper (T);
+ case 0x8d8c0d41: return store_type_web_page (T);
+ case 0x7273f2be: return store_type_bare_web_page (T);
+ case 0x1250abde: return store_type_account_authorizations (T);
+ case 0xedaf5421: return store_type_bare_account_authorizations (T);
+ case 0xeac2a804: return store_type_account_password (T);
+ case 0x153d57fb: return store_type_bare_account_password (T);
+ case 0xbcfc532c: return store_type_account_password_input_settings (T);
+ case 0x4303acd3: return store_type_bare_account_password_input_settings (T);
+ case 0xb7b72ab3: return store_type_account_password_settings (T);
+ case 0x4848d54c: return store_type_bare_account_password_settings (T);
+ case 0x554abb6f: return store_type_account_privacy_rules (T);
+ case 0xaab54490: return store_type_bare_account_privacy_rules (T);
+ case 0xa4f58c4c: return store_type_account_sent_change_phone_code (T);
+ case 0x5b0a73b3: return store_type_bare_account_sent_change_phone_code (T);
+ case 0xff036af1: return store_type_auth_authorization (T);
+ case 0x00fc950e: return store_type_bare_auth_authorization (T);
+ case 0x811ea28e: return store_type_auth_checked_phone (T);
+ case 0x7ee15d71: return store_type_bare_auth_checked_phone (T);
+ case 0xdf969c2d: return store_type_auth_exported_authorization (T);
+ case 0x206963d2: return store_type_bare_auth_exported_authorization (T);
+ case 0x137948a5: return store_type_auth_password_recovery (T);
+ case 0xec86b75a: return store_type_bare_auth_password_recovery (T);
+ case 0x0cc8bc16: return store_type_auth_sent_code (T);
+ case 0xf33743e9: return store_type_bare_auth_sent_code (T);
+ case 0x0377168f: return store_type_binlog_encr_key (T);
+ case 0xfc88e970: return store_type_bare_binlog_encr_key (T);
+ case 0x66ff03a6: return store_type_binlog_update (T);
+ case 0x9900fc59: return store_type_bare_binlog_update (T);
+ case 0x8c1b8fb4: return store_type_contacts_blocked (T);
+ case 0x73e4704b: return store_type_bare_contacts_blocked (T);
+ case 0xd8c02560: return store_type_contacts_contacts (T);
+ case 0x273fda9f: return store_type_bare_contacts_contacts (T);
+ case 0x0566000e: return store_type_contacts_found (T);
+ case 0xfa99fff1: return store_type_bare_contacts_found (T);
+ case 0xad524315: return store_type_contacts_imported_contacts (T);
+ case 0x52adbcea: return store_type_bare_contacts_imported_contacts (T);
+ case 0x3ace484c: return store_type_contacts_link (T);
+ case 0xc531b7b3: return store_type_bare_contacts_link (T);
+ case 0x5649dcc5: return store_type_contacts_suggested (T);
+ case 0xa9b6233a: return store_type_bare_contacts_suggested (T);
+ case 0x48feb267: return store_type_geochats_located (T);
+ case 0xb7014d98: return store_type_bare_geochats_located (T);
+ case 0x6d0a0e59: return store_type_geochats_messages (T);
+ case 0x92f5f1a6: return store_type_bare_geochats_messages (T);
+ case 0x17b1578b: return store_type_geochats_stated_message (T);
+ case 0xe84ea874: return store_type_bare_geochats_stated_message (T);
+ case 0x4ddd9627: return store_type_help_app_update (T);
+ case 0xb22269d8: return store_type_bare_help_app_update (T);
+ case 0x18cb9f78: return store_type_help_invite_text (T);
+ case 0xe7346087: return store_type_bare_help_invite_text (T);
+ case 0x17c6b5f6: return store_type_help_support (T);
+ case 0xe8394a09: return store_type_bare_help_support (T);
+ case 0xb45c69d1: return store_type_messages_affected_history (T);
+ case 0x4ba3962e: return store_type_bare_messages_affected_history (T);
+ case 0x84d19185: return store_type_messages_affected_messages (T);
+ case 0x7b2e6e7a: return store_type_bare_messages_affected_messages (T);
+ case 0xb485502f: return store_type_messages_all_stickers (T);
+ case 0x4b7aafd0: return store_type_bare_messages_all_stickers (T);
+ case 0xe5d7d19c: return store_type_messages_chat_full (T);
+ case 0x1a282e63: return store_type_bare_messages_chat_full (T);
+ case 0x64ff9fd5: return store_type_messages_chats (T);
+ case 0x9b00602a: return store_type_bare_messages_chats (T);
+ case 0xecc058e8: return store_type_messages_dh_config (T);
+ case 0x133fa717: return store_type_bare_messages_dh_config (T);
+ case 0x645af8b3: return store_type_messages_dialogs (T);
+ case 0x9ba5074c: return store_type_bare_messages_dialogs (T);
+ case 0x3f4e0648: return store_type_messages_message (T);
+ case 0xc0b1f9b7: return store_type_bare_messages_message (T);
+ case 0x8735e464: return store_type_messages_messages (T);
+ case 0x78ca1b9b: return store_type_bare_messages_messages (T);
+ case 0xc29c7607: return store_type_messages_sent_encrypted_message (T);
+ case 0x3d6389f8: return store_type_bare_messages_sent_encrypted_message (T);
+ case 0x799ce190: return store_type_messages_sent_message (T);
+ case 0x86631e6f: return store_type_bare_messages_sent_message (T);
+ case 0xb60a24a6: return store_type_messages_sticker_set (T);
+ case 0x49f5db59: return store_type_bare_messages_sticker_set (T);
+ case 0x7bfa5710: return store_type_messages_stickers (T);
+ case 0x8405a8ef: return store_type_bare_messages_stickers (T);
+ case 0x20212ca8: return store_type_photos_photo (T);
+ case 0xdfded357: return store_type_bare_photos_photo (T);
+ case 0x98cf75f1: return store_type_photos_photos (T);
+ case 0x67308a0e: return store_type_bare_photos_photos (T);
+ case 0x3e2838a8: return store_type_storage_file_type (T);
+ case 0xc1d7c757: return store_type_bare_storage_file_type (T);
+ case 0xf57a2419: return store_type_updates_difference (T);
+ case 0x0a85dbe6: return store_type_bare_updates_difference (T);
+ case 0xa56c2a3e: return store_type_updates_state (T);
+ case 0x5a93d5c1: return store_type_bare_updates_state (T);
+ case 0x096a18d5: return store_type_upload_file (T);
+ case 0xf695e72a: return store_type_bare_upload_file (T);
+ default: return -1; }
+}
+struct paramed_type *store_function_any (void) {
+ if (cur_token_len != 1 || *cur_token != '(') { return 0; }
+ local_next_token ();
+ if (cur_token_len == 1 || *cur_token == '.') {
+ local_next_token ();
+ if (cur_token_len != 1 || *cur_token != '=') { return 0; }
+ local_next_token ();
+ };
+ if (cur_token_len < 0) { return 0; }
+ if (cur_token_len == 19 && !memcmp (cur_token, "account.changePhone", cur_token_len)) {
+ out_int (0x70c32edb);
+ local_next_token ();
+ struct paramed_type *P = store_function_account_change_phone ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "account.checkUsername", cur_token_len)) {
+ out_int (0x2714d86c);
+ local_next_token ();
+ struct paramed_type *P = store_function_account_check_username ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "account.deleteAccount", cur_token_len)) {
+ out_int (0x418d4e0b);
+ local_next_token ();
+ struct paramed_type *P = store_function_account_delete_account ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "account.getAccountTTL", cur_token_len)) {
+ out_int (0x08fc711d);
+ local_next_token ();
+ struct paramed_type *P = store_function_account_get_account_t_t_l ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "account.getAuthorizations", cur_token_len)) {
+ out_int (0xe320c158);
+ local_next_token ();
+ struct paramed_type *P = store_function_account_get_authorizations ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "account.getNotifySettings", cur_token_len)) {
+ out_int (0x12b3ad31);
+ local_next_token ();
+ struct paramed_type *P = store_function_account_get_notify_settings ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "account.getPassword", cur_token_len)) {
+ out_int (0x548a30f5);
+ local_next_token ();
+ struct paramed_type *P = store_function_account_get_password ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "account.getPasswordSettings", cur_token_len)) {
+ out_int (0xbc8d11bb);
+ local_next_token ();
+ struct paramed_type *P = store_function_account_get_password_settings ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "account.getPrivacy", cur_token_len)) {
+ out_int (0xdadbc950);
+ local_next_token ();
+ struct paramed_type *P = store_function_account_get_privacy ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "account.getWallPapers", cur_token_len)) {
+ out_int (0xc04cfac2);
+ local_next_token ();
+ struct paramed_type *P = store_function_account_get_wall_papers ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "account.registerDevice", cur_token_len)) {
+ out_int (0x446c712c);
+ local_next_token ();
+ struct paramed_type *P = store_function_account_register_device ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "account.resetAuthorization", cur_token_len)) {
+ out_int (0xdf77f3bc);
+ local_next_token ();
+ struct paramed_type *P = store_function_account_reset_authorization ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "account.resetNotifySettings", cur_token_len)) {
+ out_int (0xdb7e1747);
+ local_next_token ();
+ struct paramed_type *P = store_function_account_reset_notify_settings ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "account.sendChangePhoneCode", cur_token_len)) {
+ out_int (0xa407a8f4);
+ local_next_token ();
+ struct paramed_type *P = store_function_account_send_change_phone_code ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "account.setAccountTTL", cur_token_len)) {
+ out_int (0x2442485e);
+ local_next_token ();
+ struct paramed_type *P = store_function_account_set_account_t_t_l ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "account.setPrivacy", cur_token_len)) {
+ out_int (0xc9f81ce8);
+ local_next_token ();
+ struct paramed_type *P = store_function_account_set_privacy ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "account.unregisterDevice", cur_token_len)) {
+ out_int (0x65c55b40);
+ local_next_token ();
+ struct paramed_type *P = store_function_account_unregister_device ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "account.updateDeviceLocked", cur_token_len)) {
+ out_int (0x38df3532);
+ local_next_token ();
+ struct paramed_type *P = store_function_account_update_device_locked ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "account.updateNotifySettings", cur_token_len)) {
+ out_int (0x84be5b93);
+ local_next_token ();
+ struct paramed_type *P = store_function_account_update_notify_settings ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 30 && !memcmp (cur_token, "account.updatePasswordSettings", cur_token_len)) {
+ out_int (0xfa7c4b86);
+ local_next_token ();
+ struct paramed_type *P = store_function_account_update_password_settings ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "account.updateProfile", cur_token_len)) {
+ out_int (0xf0888d68);
+ local_next_token ();
+ struct paramed_type *P = store_function_account_update_profile ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "account.updateStatus", cur_token_len)) {
+ out_int (0x6628562c);
+ local_next_token ();
+ struct paramed_type *P = store_function_account_update_status ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "account.updateUsername", cur_token_len)) {
+ out_int (0x3e0bdd7c);
+ local_next_token ();
+ struct paramed_type *P = store_function_account_update_username ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "auth.bindTempAuthKey", cur_token_len)) {
+ out_int (0xcdd42a05);
+ local_next_token ();
+ struct paramed_type *P = store_function_auth_bind_temp_auth_key ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "auth.checkPassword", cur_token_len)) {
+ out_int (0x0a63011e);
+ local_next_token ();
+ struct paramed_type *P = store_function_auth_check_password ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "auth.checkPhone", cur_token_len)) {
+ out_int (0x6fe51dfb);
+ local_next_token ();
+ struct paramed_type *P = store_function_auth_check_phone ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "auth.exportAuthorization", cur_token_len)) {
+ out_int (0xe5bfffcd);
+ local_next_token ();
+ struct paramed_type *P = store_function_auth_export_authorization ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "auth.importAuthorization", cur_token_len)) {
+ out_int (0xe3ef9613);
+ local_next_token ();
+ struct paramed_type *P = store_function_auth_import_authorization ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "auth.importBotAuthorization", cur_token_len)) {
+ out_int (0x67a3ff2c);
+ local_next_token ();
+ struct paramed_type *P = store_function_auth_import_bot_authorization ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 11 && !memcmp (cur_token, "auth.logOut", cur_token_len)) {
+ out_int (0x5717da40);
+ local_next_token ();
+ struct paramed_type *P = store_function_auth_log_out ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "auth.recoverPassword", cur_token_len)) {
+ out_int (0x4ea56e92);
+ local_next_token ();
+ struct paramed_type *P = store_function_auth_recover_password ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "auth.requestPasswordRecovery", cur_token_len)) {
+ out_int (0xd897bc66);
+ local_next_token ();
+ struct paramed_type *P = store_function_auth_request_password_recovery ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "auth.resetAuthorizations", cur_token_len)) {
+ out_int (0x9fab0d1a);
+ local_next_token ();
+ struct paramed_type *P = store_function_auth_reset_authorizations ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "auth.sendCall", cur_token_len)) {
+ out_int (0x03c51564);
+ local_next_token ();
+ struct paramed_type *P = store_function_auth_send_call ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "auth.sendCode", cur_token_len)) {
+ out_int (0x768d5f4d);
+ local_next_token ();
+ struct paramed_type *P = store_function_auth_send_code ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "auth.sendInvites", cur_token_len)) {
+ out_int (0x771c1d97);
+ local_next_token ();
+ struct paramed_type *P = store_function_auth_send_invites ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 12 && !memcmp (cur_token, "auth.sendSms", cur_token_len)) {
+ out_int (0x0da9f3e8);
+ local_next_token ();
+ struct paramed_type *P = store_function_auth_send_sms ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 11 && !memcmp (cur_token, "auth.signIn", cur_token_len)) {
+ out_int (0xbcd51581);
+ local_next_token ();
+ struct paramed_type *P = store_function_auth_sign_in ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 11 && !memcmp (cur_token, "auth.signUp", cur_token_len)) {
+ out_int (0x1b067634);
+ local_next_token ();
+ struct paramed_type *P = store_function_auth_sign_up ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "contacts.block", cur_token_len)) {
+ out_int (0x332b49fc);
+ local_next_token ();
+ struct paramed_type *P = store_function_contacts_block ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "contacts.deleteContact", cur_token_len)) {
+ out_int (0x8e953744);
+ local_next_token ();
+ struct paramed_type *P = store_function_contacts_delete_contact ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "contacts.deleteContacts", cur_token_len)) {
+ out_int (0x59ab389e);
+ local_next_token ();
+ struct paramed_type *P = store_function_contacts_delete_contacts ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "contacts.exportCard", cur_token_len)) {
+ out_int (0x84e53737);
+ local_next_token ();
+ struct paramed_type *P = store_function_contacts_export_card ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "contacts.getBlocked", cur_token_len)) {
+ out_int (0xf57c350f);
+ local_next_token ();
+ struct paramed_type *P = store_function_contacts_get_blocked ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "contacts.getContacts", cur_token_len)) {
+ out_int (0x22c6aa08);
+ local_next_token ();
+ struct paramed_type *P = store_function_contacts_get_contacts ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "contacts.getStatuses", cur_token_len)) {
+ out_int (0xc4a353ee);
+ local_next_token ();
+ struct paramed_type *P = store_function_contacts_get_statuses ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "contacts.getSuggested", cur_token_len)) {
+ out_int (0xcd773428);
+ local_next_token ();
+ struct paramed_type *P = store_function_contacts_get_suggested ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "contacts.importCard", cur_token_len)) {
+ out_int (0x4fe196fe);
+ local_next_token ();
+ struct paramed_type *P = store_function_contacts_import_card ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "contacts.importContacts", cur_token_len)) {
+ out_int (0xda30b32d);
+ local_next_token ();
+ struct paramed_type *P = store_function_contacts_import_contacts ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "contacts.resolveUsername", cur_token_len)) {
+ out_int (0x0bf0131c);
+ local_next_token ();
+ struct paramed_type *P = store_function_contacts_resolve_username ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "contacts.search", cur_token_len)) {
+ out_int (0x11f812d8);
+ local_next_token ();
+ struct paramed_type *P = store_function_contacts_search ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "contacts.unblock", cur_token_len)) {
+ out_int (0xe54100bd);
+ local_next_token ();
+ struct paramed_type *P = store_function_contacts_unblock ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "geochats.checkin", cur_token_len)) {
+ out_int (0x55b3e8fb);
+ local_next_token ();
+ struct paramed_type *P = store_function_geochats_checkin ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "geochats.createGeoChat", cur_token_len)) {
+ out_int (0x0e092e16);
+ local_next_token ();
+ struct paramed_type *P = store_function_geochats_create_geo_chat ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "geochats.editChatPhoto", cur_token_len)) {
+ out_int (0x35d81a95);
+ local_next_token ();
+ struct paramed_type *P = store_function_geochats_edit_chat_photo ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "geochats.editChatTitle", cur_token_len)) {
+ out_int (0x4c8e2273);
+ local_next_token ();
+ struct paramed_type *P = store_function_geochats_edit_chat_title ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "geochats.getFullChat", cur_token_len)) {
+ out_int (0x6722dd6f);
+ local_next_token ();
+ struct paramed_type *P = store_function_geochats_get_full_chat ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "geochats.getHistory", cur_token_len)) {
+ out_int (0xb53f7a68);
+ local_next_token ();
+ struct paramed_type *P = store_function_geochats_get_history ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "geochats.getLocated", cur_token_len)) {
+ out_int (0x7f192d8f);
+ local_next_token ();
+ struct paramed_type *P = store_function_geochats_get_located ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "geochats.getRecents", cur_token_len)) {
+ out_int (0xe1427e6f);
+ local_next_token ();
+ struct paramed_type *P = store_function_geochats_get_recents ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "geochats.search", cur_token_len)) {
+ out_int (0xcfcdc44d);
+ local_next_token ();
+ struct paramed_type *P = store_function_geochats_search ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "geochats.sendMedia", cur_token_len)) {
+ out_int (0xb8f0deff);
+ local_next_token ();
+ struct paramed_type *P = store_function_geochats_send_media ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "geochats.sendMessage", cur_token_len)) {
+ out_int (0x061b0044);
+ local_next_token ();
+ struct paramed_type *P = store_function_geochats_send_message ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "geochats.setTyping", cur_token_len)) {
+ out_int (0x08b8a729);
+ local_next_token ();
+ struct paramed_type *P = store_function_geochats_set_typing ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "help.getAppUpdate", cur_token_len)) {
+ out_int (0xc812ac7e);
+ local_next_token ();
+ struct paramed_type *P = store_function_help_get_app_update ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "help.getConfig", cur_token_len)) {
+ out_int (0xc4f9186b);
+ local_next_token ();
+ struct paramed_type *P = store_function_help_get_config ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "help.getInviteText", cur_token_len)) {
+ out_int (0xa4a95186);
+ local_next_token ();
+ struct paramed_type *P = store_function_help_get_invite_text ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "help.getNearestDc", cur_token_len)) {
+ out_int (0x1fb33026);
+ local_next_token ();
+ struct paramed_type *P = store_function_help_get_nearest_dc ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "help.getSupport", cur_token_len)) {
+ out_int (0x9cdf08cd);
+ local_next_token ();
+ struct paramed_type *P = store_function_help_get_support ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "help.saveAppLog", cur_token_len)) {
+ out_int (0x6f02f748);
+ local_next_token ();
+ struct paramed_type *P = store_function_help_save_app_log ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "initConnection", cur_token_len)) {
+ out_int (0x69796de9);
+ local_next_token ();
+ struct paramed_type *P = store_function_init_connection ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "invokeAfterMsg", cur_token_len)) {
+ out_int (0xcb9f372d);
+ local_next_token ();
+ struct paramed_type *P = store_function_invoke_after_msg ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "invokeAfterMsgs", cur_token_len)) {
+ out_int (0x3dc4b4f0);
+ local_next_token ();
+ struct paramed_type *P = store_function_invoke_after_msgs ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "invokeWithLayer", cur_token_len)) {
+ out_int (0xda9b0d0d);
+ local_next_token ();
+ struct paramed_type *P = store_function_invoke_with_layer ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "invokeWithoutUpdates", cur_token_len)) {
+ out_int (0xbf9459b7);
+ local_next_token ();
+ struct paramed_type *P = store_function_invoke_without_updates ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "messages.acceptEncryption", cur_token_len)) {
+ out_int (0x3dbc0415);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_accept_encryption ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messages.addChatUser", cur_token_len)) {
+ out_int (0xf9a0aa09);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_add_chat_user ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "messages.checkChatInvite", cur_token_len)) {
+ out_int (0x3eadb1bb);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_check_chat_invite ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "messages.createChat", cur_token_len)) {
+ out_int (0x09cb126e);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_create_chat ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "messages.deleteChatUser", cur_token_len)) {
+ out_int (0xe0611f16);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_delete_chat_user ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "messages.deleteHistory", cur_token_len)) {
+ out_int (0xf4f8fb61);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_delete_history ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "messages.deleteMessages", cur_token_len)) {
+ out_int (0xa5f18925);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_delete_messages ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "messages.discardEncryption", cur_token_len)) {
+ out_int (0xedd923c5);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_discard_encryption ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "messages.editChatPhoto", cur_token_len)) {
+ out_int (0xca4c79d8);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_edit_chat_photo ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "messages.editChatTitle", cur_token_len)) {
+ out_int (0xdc452855);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_edit_chat_title ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "messages.exportChatInvite", cur_token_len)) {
+ out_int (0x7d885289);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_export_chat_invite ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "messages.forwardMessage", cur_token_len)) {
+ out_int (0x33963bf9);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_forward_message ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 24 && !memcmp (cur_token, "messages.forwardMessages", cur_token_len)) {
+ out_int (0x55e1728d);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_forward_messages ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 23 && !memcmp (cur_token, "messages.getAllStickers", cur_token_len)) {
+ out_int (0xaa3bc868);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_get_all_stickers ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messages.getChats", cur_token_len)) {
+ out_int (0x3c6aa187);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_get_chats ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messages.getDhConfig", cur_token_len)) {
+ out_int (0x26cf8950);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_get_dh_config ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "messages.getDialogs", cur_token_len)) {
+ out_int (0xeccf1df6);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_get_dialogs ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messages.getFullChat", cur_token_len)) {
+ out_int (0x3b831c66);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_get_full_chat ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "messages.getHistory", cur_token_len)) {
+ out_int (0x92a1df2f);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_get_history ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messages.getMessages", cur_token_len)) {
+ out_int (0x4222fa74);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_get_messages ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "messages.getStickerSet", cur_token_len)) {
+ out_int (0x2619a90e);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_get_sticker_set ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messages.getStickers", cur_token_len)) {
+ out_int (0xae22e045);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_get_stickers ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "messages.getWebPagePreview", cur_token_len)) {
+ out_int (0x25223e24);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_get_web_page_preview ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "messages.importChatInvite", cur_token_len)) {
+ out_int (0x6c50051c);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_import_chat_invite ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "messages.installStickerSet", cur_token_len)) {
+ out_int (0xefbbfae9);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_install_sticker_set ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "messages.readEncryptedHistory", cur_token_len)) {
+ out_int (0x7f4b690a);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_read_encrypted_history ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messages.readHistory", cur_token_len)) {
+ out_int (0xb04f2510);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_read_history ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "messages.readMessageContents", cur_token_len)) {
+ out_int (0x36a73f77);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_read_message_contents ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "messages.receivedMessages", cur_token_len)) {
+ out_int (0x05a954c0);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_received_messages ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "messages.receivedQueue", cur_token_len)) {
+ out_int (0x55a5bb66);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_received_queue ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "messages.requestEncryption", cur_token_len)) {
+ out_int (0xf64daf43);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_request_encryption ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 15 && !memcmp (cur_token, "messages.search", cur_token_len)) {
+ out_int (0x07e9f2ab);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_search ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "messages.sendBroadcast", cur_token_len)) {
+ out_int (0xbf73f4da);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_send_broadcast ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "messages.sendEncrypted", cur_token_len)) {
+ out_int (0xa9776773);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_send_encrypted ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 26 && !memcmp (cur_token, "messages.sendEncryptedFile", cur_token_len)) {
+ out_int (0x9a901b66);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_send_encrypted_file ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 29 && !memcmp (cur_token, "messages.sendEncryptedService", cur_token_len)) {
+ out_int (0x32d439a4);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_send_encrypted_service ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "messages.sendMedia", cur_token_len)) {
+ out_int (0xc8f16791);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_send_media ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "messages.sendMessage", cur_token_len)) {
+ out_int (0xfc55e6b5);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_send_message ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 27 && !memcmp (cur_token, "messages.setEncryptedTyping", cur_token_len)) {
+ out_int (0x791451ed);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_set_encrypted_typing ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 18 && !memcmp (cur_token, "messages.setTyping", cur_token_len)) {
+ out_int (0xa3825e50);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_set_typing ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "messages.startBot", cur_token_len)) {
+ out_int (0x1b3e0ffc);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_start_bot ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 28 && !memcmp (cur_token, "messages.uninstallStickerSet", cur_token_len)) {
+ out_int (0xf96e55de);
+ local_next_token ();
+ struct paramed_type *P = store_function_messages_uninstall_sticker_set ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "photos.deletePhotos", cur_token_len)) {
+ out_int (0x87cf7f2f);
+ local_next_token ();
+ struct paramed_type *P = store_function_photos_delete_photos ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "photos.getUserPhotos", cur_token_len)) {
+ out_int (0xb7ee553c);
+ local_next_token ();
+ struct paramed_type *P = store_function_photos_get_user_photos ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "photos.updateProfilePhoto", cur_token_len)) {
+ out_int (0xeef579a0);
+ local_next_token ();
+ struct paramed_type *P = store_function_photos_update_profile_photo ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 25 && !memcmp (cur_token, "photos.uploadProfilePhoto", cur_token_len)) {
+ out_int (0xd50f9c88);
+ local_next_token ();
+ struct paramed_type *P = store_function_photos_upload_profile_photo ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 13 && !memcmp (cur_token, "req_DH_params", cur_token_len)) {
+ out_int (0xd712e4be);
+ local_next_token ();
+ struct paramed_type *P = store_function_req_d_h_params ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 6 && !memcmp (cur_token, "req_pq", cur_token_len)) {
+ out_int (0x60469778);
+ local_next_token ();
+ struct paramed_type *P = store_function_req_pq ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 20 && !memcmp (cur_token, "set_client_DH_params", cur_token_len)) {
+ out_int (0xf5045f1f);
+ local_next_token ();
+ struct paramed_type *P = store_function_set_client_d_h_params ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 21 && !memcmp (cur_token, "updates.getDifference", cur_token_len)) {
+ out_int (0x0a041495);
+ local_next_token ();
+ struct paramed_type *P = store_function_updates_get_difference ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 16 && !memcmp (cur_token, "updates.getState", cur_token_len)) {
+ out_int (0xedd4882a);
+ local_next_token ();
+ struct paramed_type *P = store_function_updates_get_state ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "upload.getFile", cur_token_len)) {
+ out_int (0xe3a6cfb5);
+ local_next_token ();
+ struct paramed_type *P = store_function_upload_get_file ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 22 && !memcmp (cur_token, "upload.saveBigFilePart", cur_token_len)) {
+ out_int (0xde7b673d);
+ local_next_token ();
+ struct paramed_type *P = store_function_upload_save_big_file_part ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 19 && !memcmp (cur_token, "upload.saveFilePart", cur_token_len)) {
+ out_int (0xb304a621);
+ local_next_token ();
+ struct paramed_type *P = store_function_upload_save_file_part ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 17 && !memcmp (cur_token, "users.getFullUser", cur_token_len)) {
+ out_int (0xca30a5b1);
+ local_next_token ();
+ struct paramed_type *P = store_function_users_get_full_user ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ if (cur_token_len == 14 && !memcmp (cur_token, "users.getUsers", cur_token_len)) {
+ out_int (0x0d91a548);
+ local_next_token ();
+ struct paramed_type *P = store_function_users_get_users ();
+ if (!P) { return 0; }
+ if (cur_token_len != 1 || *cur_token != ')') { return 0; }
+ local_next_token ();
+ return P;
+ }
+ return 0;
+}
diff --git a/protocols/Telegram/tgl/auto/auto-store.h b/protocols/Telegram/tgl/auto/auto-store.h
new file mode 100644
index 0000000000..9a7a737ad2
--- /dev/null
+++ b/protocols/Telegram/tgl/auto/auto-store.h
@@ -0,0 +1,848 @@
+#ifdef _MSC_VER
+#include "..\auto.h"
+#else
+#include "auto.h"
+#endif
+#include <assert.h>
+struct paramed_type *tglf_extf_store (struct tgl_state *TLS, const char *data, int data_len);
+int tglf_store_type (struct tgl_state *TLS, const char *work, int work_len, struct paramed_type *P);
+int store_constructor_account_days_t_t_l (struct paramed_type *T);
+int store_constructor_audio_empty (struct paramed_type *T);
+int store_constructor_audio (struct paramed_type *T);
+int store_constructor_authorization (struct paramed_type *T);
+int store_constructor_bool_false (struct paramed_type *T);
+int store_constructor_bool_true (struct paramed_type *T);
+int store_constructor_bot_command (struct paramed_type *T);
+int store_constructor_bot_command_old (struct paramed_type *T);
+int store_constructor_bot_info_empty (struct paramed_type *T);
+int store_constructor_bot_info (struct paramed_type *T);
+int store_constructor_bytes (struct paramed_type *T);
+int store_constructor_chat_empty (struct paramed_type *T);
+int store_constructor_chat (struct paramed_type *T);
+int store_constructor_chat_forbidden (struct paramed_type *T);
+int store_constructor_geo_chat (struct paramed_type *T);
+int store_constructor_chat_full (struct paramed_type *T);
+int store_constructor_chat_invite_already (struct paramed_type *T);
+int store_constructor_chat_invite (struct paramed_type *T);
+int store_constructor_chat_located (struct paramed_type *T);
+int store_constructor_chat_participant (struct paramed_type *T);
+int store_constructor_chat_participants_forbidden (struct paramed_type *T);
+int store_constructor_chat_participants (struct paramed_type *T);
+int store_constructor_chat_photo_empty (struct paramed_type *T);
+int store_constructor_chat_photo (struct paramed_type *T);
+int store_constructor_client_d_h_inner_data (struct paramed_type *T);
+int store_constructor_config (struct paramed_type *T);
+int store_constructor_contact (struct paramed_type *T);
+int store_constructor_contact_blocked (struct paramed_type *T);
+int store_constructor_contact_found (struct paramed_type *T);
+int store_constructor_contact_link_unknown (struct paramed_type *T);
+int store_constructor_contact_link_none (struct paramed_type *T);
+int store_constructor_contact_link_has_phone (struct paramed_type *T);
+int store_constructor_contact_link_contact (struct paramed_type *T);
+int store_constructor_contact_status (struct paramed_type *T);
+int store_constructor_contact_suggested (struct paramed_type *T);
+int store_constructor_dc_option_l28 (struct paramed_type *T);
+int store_constructor_dc_option (struct paramed_type *T);
+int store_constructor_decrypted_message (struct paramed_type *T);
+int store_constructor_decrypted_message_service (struct paramed_type *T);
+int store_constructor_decrypted_message_action_set_message_t_t_l (struct paramed_type *T);
+int store_constructor_decrypted_message_action_read_messages (struct paramed_type *T);
+int store_constructor_decrypted_message_action_delete_messages (struct paramed_type *T);
+int store_constructor_decrypted_message_action_screenshot_messages (struct paramed_type *T);
+int store_constructor_decrypted_message_action_flush_history (struct paramed_type *T);
+int store_constructor_decrypted_message_action_resend (struct paramed_type *T);
+int store_constructor_decrypted_message_action_notify_layer (struct paramed_type *T);
+int store_constructor_decrypted_message_action_typing (struct paramed_type *T);
+int store_constructor_decrypted_message_action_request_key (struct paramed_type *T);
+int store_constructor_decrypted_message_action_accept_key (struct paramed_type *T);
+int store_constructor_decrypted_message_action_abort_key (struct paramed_type *T);
+int store_constructor_decrypted_message_action_commit_key (struct paramed_type *T);
+int store_constructor_decrypted_message_action_noop (struct paramed_type *T);
+int store_constructor_decrypted_message_layer (struct paramed_type *T);
+int store_constructor_decrypted_message_media_empty (struct paramed_type *T);
+int store_constructor_decrypted_message_media_photo (struct paramed_type *T);
+int store_constructor_decrypted_message_media_geo_point (struct paramed_type *T);
+int store_constructor_decrypted_message_media_contact (struct paramed_type *T);
+int store_constructor_decrypted_message_media_document (struct paramed_type *T);
+int store_constructor_decrypted_message_media_video (struct paramed_type *T);
+int store_constructor_decrypted_message_media_audio (struct paramed_type *T);
+int store_constructor_decrypted_message_media_external_document (struct paramed_type *T);
+int store_constructor_decrypted_message_media_video_l12 (struct paramed_type *T);
+int store_constructor_decrypted_message_media_audio_l12 (struct paramed_type *T);
+int store_constructor_dialog (struct paramed_type *T);
+int store_constructor_disabled_feature (struct paramed_type *T);
+int store_constructor_document_empty (struct paramed_type *T);
+int store_constructor_document (struct paramed_type *T);
+int store_constructor_document_l19 (struct paramed_type *T);
+int store_constructor_document_attribute_image_size (struct paramed_type *T);
+int store_constructor_document_attribute_animated (struct paramed_type *T);
+int store_constructor_document_attribute_sticker_l28 (struct paramed_type *T);
+int store_constructor_document_attribute_sticker (struct paramed_type *T);
+int store_constructor_document_attribute_video (struct paramed_type *T);
+int store_constructor_document_attribute_audio (struct paramed_type *T);
+int store_constructor_document_attribute_filename (struct paramed_type *T);
+int store_constructor_double (struct paramed_type *T);
+int store_constructor_encrypted_chat_empty (struct paramed_type *T);
+int store_constructor_encrypted_chat_waiting (struct paramed_type *T);
+int store_constructor_encrypted_chat_requested (struct paramed_type *T);
+int store_constructor_encrypted_chat (struct paramed_type *T);
+int store_constructor_encrypted_chat_discarded (struct paramed_type *T);
+int store_constructor_encrypted_file_empty (struct paramed_type *T);
+int store_constructor_encrypted_file (struct paramed_type *T);
+int store_constructor_encrypted_message (struct paramed_type *T);
+int store_constructor_encrypted_message_service (struct paramed_type *T);
+int store_constructor_error (struct paramed_type *T);
+int store_constructor_chat_invite_empty (struct paramed_type *T);
+int store_constructor_chat_invite_exported (struct paramed_type *T);
+int store_constructor_file_location_unavailable (struct paramed_type *T);
+int store_constructor_file_location (struct paramed_type *T);
+int store_constructor_geo_chat_message_empty (struct paramed_type *T);
+int store_constructor_geo_chat_message (struct paramed_type *T);
+int store_constructor_geo_chat_message_service (struct paramed_type *T);
+int store_constructor_geo_point_empty (struct paramed_type *T);
+int store_constructor_geo_point (struct paramed_type *T);
+int store_constructor_imported_contact (struct paramed_type *T);
+int store_constructor_input_app_event (struct paramed_type *T);
+int store_constructor_input_audio_empty (struct paramed_type *T);
+int store_constructor_input_audio (struct paramed_type *T);
+int store_constructor_input_chat_photo_empty (struct paramed_type *T);
+int store_constructor_input_chat_uploaded_photo (struct paramed_type *T);
+int store_constructor_input_chat_photo (struct paramed_type *T);
+int store_constructor_input_phone_contact (struct paramed_type *T);
+int store_constructor_input_document_empty (struct paramed_type *T);
+int store_constructor_input_document (struct paramed_type *T);
+int store_constructor_input_encrypted_chat (struct paramed_type *T);
+int store_constructor_input_encrypted_file_empty (struct paramed_type *T);
+int store_constructor_input_encrypted_file_uploaded (struct paramed_type *T);
+int store_constructor_input_encrypted_file (struct paramed_type *T);
+int store_constructor_input_encrypted_file_big_uploaded (struct paramed_type *T);
+int store_constructor_input_file (struct paramed_type *T);
+int store_constructor_input_file_big (struct paramed_type *T);
+int store_constructor_input_file_location (struct paramed_type *T);
+int store_constructor_input_video_file_location (struct paramed_type *T);
+int store_constructor_input_encrypted_file_location (struct paramed_type *T);
+int store_constructor_input_audio_file_location (struct paramed_type *T);
+int store_constructor_input_document_file_location (struct paramed_type *T);
+int store_constructor_input_geo_chat (struct paramed_type *T);
+int store_constructor_input_geo_point_empty (struct paramed_type *T);
+int store_constructor_input_geo_point (struct paramed_type *T);
+int store_constructor_input_media_empty (struct paramed_type *T);
+int store_constructor_input_media_uploaded_photo (struct paramed_type *T);
+int store_constructor_input_media_photo (struct paramed_type *T);
+int store_constructor_input_media_geo_point (struct paramed_type *T);
+int store_constructor_input_media_contact (struct paramed_type *T);
+int store_constructor_input_media_uploaded_video (struct paramed_type *T);
+int store_constructor_input_media_uploaded_thumb_video (struct paramed_type *T);
+int store_constructor_input_media_video (struct paramed_type *T);
+int store_constructor_input_media_uploaded_audio (struct paramed_type *T);
+int store_constructor_input_media_audio (struct paramed_type *T);
+int store_constructor_input_media_uploaded_document (struct paramed_type *T);
+int store_constructor_input_media_uploaded_thumb_document (struct paramed_type *T);
+int store_constructor_input_media_document (struct paramed_type *T);
+int store_constructor_input_media_venue (struct paramed_type *T);
+int store_constructor_input_notify_peer (struct paramed_type *T);
+int store_constructor_input_notify_users (struct paramed_type *T);
+int store_constructor_input_notify_chats (struct paramed_type *T);
+int store_constructor_input_notify_all (struct paramed_type *T);
+int store_constructor_input_notify_geo_chat_peer (struct paramed_type *T);
+int store_constructor_input_peer_empty (struct paramed_type *T);
+int store_constructor_input_peer_self (struct paramed_type *T);
+int store_constructor_input_peer_contact (struct paramed_type *T);
+int store_constructor_input_peer_foreign (struct paramed_type *T);
+int store_constructor_input_peer_chat (struct paramed_type *T);
+int store_constructor_input_peer_notify_events_empty (struct paramed_type *T);
+int store_constructor_input_peer_notify_events_all (struct paramed_type *T);
+int store_constructor_input_peer_notify_settings (struct paramed_type *T);
+int store_constructor_input_photo_empty (struct paramed_type *T);
+int store_constructor_input_photo (struct paramed_type *T);
+int store_constructor_input_photo_crop_auto (struct paramed_type *T);
+int store_constructor_input_photo_crop (struct paramed_type *T);
+int store_constructor_input_privacy_key_status_timestamp (struct paramed_type *T);
+int store_constructor_input_privacy_value_allow_contacts (struct paramed_type *T);
+int store_constructor_input_privacy_value_allow_all (struct paramed_type *T);
+int store_constructor_input_privacy_value_allow_users (struct paramed_type *T);
+int store_constructor_input_privacy_value_disallow_contacts (struct paramed_type *T);
+int store_constructor_input_privacy_value_disallow_all (struct paramed_type *T);
+int store_constructor_input_privacy_value_disallow_users (struct paramed_type *T);
+int store_constructor_input_sticker_set_empty (struct paramed_type *T);
+int store_constructor_input_sticker_set_i_d (struct paramed_type *T);
+int store_constructor_input_sticker_set_short_name (struct paramed_type *T);
+int store_constructor_input_user_empty (struct paramed_type *T);
+int store_constructor_input_user_self (struct paramed_type *T);
+int store_constructor_input_user_contact (struct paramed_type *T);
+int store_constructor_input_user_foreign (struct paramed_type *T);
+int store_constructor_input_video_empty (struct paramed_type *T);
+int store_constructor_input_video (struct paramed_type *T);
+int store_constructor_int (struct paramed_type *T);
+int store_constructor_int128 (struct paramed_type *T);
+int store_constructor_int256 (struct paramed_type *T);
+int store_constructor_keyboard_button (struct paramed_type *T);
+int store_constructor_keyboard_button_row (struct paramed_type *T);
+int store_constructor_long (struct paramed_type *T);
+int store_constructor_message_empty (struct paramed_type *T);
+int store_constructor_message (struct paramed_type *T);
+int store_constructor_message_service (struct paramed_type *T);
+int store_constructor_message_action_empty (struct paramed_type *T);
+int store_constructor_message_action_chat_create (struct paramed_type *T);
+int store_constructor_message_action_chat_edit_title (struct paramed_type *T);
+int store_constructor_message_action_chat_edit_photo (struct paramed_type *T);
+int store_constructor_message_action_chat_delete_photo (struct paramed_type *T);
+int store_constructor_message_action_chat_add_user (struct paramed_type *T);
+int store_constructor_message_action_chat_delete_user (struct paramed_type *T);
+int store_constructor_message_action_geo_chat_create (struct paramed_type *T);
+int store_constructor_message_action_geo_chat_checkin (struct paramed_type *T);
+int store_constructor_message_action_chat_joined_by_link (struct paramed_type *T);
+int store_constructor_message_media_empty (struct paramed_type *T);
+int store_constructor_message_media_photo (struct paramed_type *T);
+int store_constructor_message_media_video (struct paramed_type *T);
+int store_constructor_message_media_geo (struct paramed_type *T);
+int store_constructor_message_media_contact (struct paramed_type *T);
+int store_constructor_message_media_unsupported (struct paramed_type *T);
+int store_constructor_message_media_document (struct paramed_type *T);
+int store_constructor_message_media_audio (struct paramed_type *T);
+int store_constructor_message_media_web_page (struct paramed_type *T);
+int store_constructor_message_media_venue (struct paramed_type *T);
+int store_constructor_message_media_photo_l27 (struct paramed_type *T);
+int store_constructor_message_media_video_l27 (struct paramed_type *T);
+int store_constructor_input_messages_filter_empty (struct paramed_type *T);
+int store_constructor_input_messages_filter_photos (struct paramed_type *T);
+int store_constructor_input_messages_filter_video (struct paramed_type *T);
+int store_constructor_input_messages_filter_photo_video (struct paramed_type *T);
+int store_constructor_input_messages_filter_photo_video_documents (struct paramed_type *T);
+int store_constructor_input_messages_filter_document (struct paramed_type *T);
+int store_constructor_input_messages_filter_audio (struct paramed_type *T);
+int store_constructor_nearest_dc (struct paramed_type *T);
+int store_constructor_notify_peer (struct paramed_type *T);
+int store_constructor_notify_users (struct paramed_type *T);
+int store_constructor_notify_chats (struct paramed_type *T);
+int store_constructor_notify_all (struct paramed_type *T);
+int store_constructor_null (struct paramed_type *T);
+int store_constructor_p_q_inner_data (struct paramed_type *T);
+int store_constructor_p_q_inner_data_temp (struct paramed_type *T);
+int store_constructor_peer_user (struct paramed_type *T);
+int store_constructor_peer_chat (struct paramed_type *T);
+int store_constructor_peer_notify_events_empty (struct paramed_type *T);
+int store_constructor_peer_notify_events_all (struct paramed_type *T);
+int store_constructor_peer_notify_settings_empty (struct paramed_type *T);
+int store_constructor_peer_notify_settings (struct paramed_type *T);
+int store_constructor_photo_empty (struct paramed_type *T);
+int store_constructor_photo (struct paramed_type *T);
+int store_constructor_photo_l27 (struct paramed_type *T);
+int store_constructor_photo_size_empty (struct paramed_type *T);
+int store_constructor_photo_size (struct paramed_type *T);
+int store_constructor_photo_cached_size (struct paramed_type *T);
+int store_constructor_privacy_key_status_timestamp (struct paramed_type *T);
+int store_constructor_privacy_value_allow_contacts (struct paramed_type *T);
+int store_constructor_privacy_value_allow_all (struct paramed_type *T);
+int store_constructor_privacy_value_allow_users (struct paramed_type *T);
+int store_constructor_privacy_value_disallow_contacts (struct paramed_type *T);
+int store_constructor_privacy_value_disallow_all (struct paramed_type *T);
+int store_constructor_privacy_value_disallow_users (struct paramed_type *T);
+int store_constructor_received_notify_message (struct paramed_type *T);
+int store_constructor_reply_keyboard_hide (struct paramed_type *T);
+int store_constructor_reply_keyboard_force_reply (struct paramed_type *T);
+int store_constructor_reply_keyboard_markup (struct paramed_type *T);
+int store_constructor_res_p_q (struct paramed_type *T);
+int store_constructor_send_message_typing_action (struct paramed_type *T);
+int store_constructor_send_message_cancel_action (struct paramed_type *T);
+int store_constructor_send_message_record_video_action (struct paramed_type *T);
+int store_constructor_send_message_upload_video_action_l27 (struct paramed_type *T);
+int store_constructor_send_message_upload_video_action (struct paramed_type *T);
+int store_constructor_send_message_record_audio_action (struct paramed_type *T);
+int store_constructor_send_message_upload_audio_action_l27 (struct paramed_type *T);
+int store_constructor_send_message_upload_audio_action (struct paramed_type *T);
+int store_constructor_send_message_upload_photo_action (struct paramed_type *T);
+int store_constructor_send_message_upload_document_action_l27 (struct paramed_type *T);
+int store_constructor_send_message_upload_document_action (struct paramed_type *T);
+int store_constructor_send_message_geo_location_action (struct paramed_type *T);
+int store_constructor_send_message_choose_contact_action (struct paramed_type *T);
+int store_constructor_server_d_h_params_fail (struct paramed_type *T);
+int store_constructor_server_d_h_params_ok (struct paramed_type *T);
+int store_constructor_server_d_h_inner_data (struct paramed_type *T);
+int store_constructor_dh_gen_ok (struct paramed_type *T);
+int store_constructor_dh_gen_retry (struct paramed_type *T);
+int store_constructor_dh_gen_fail (struct paramed_type *T);
+int store_constructor_sticker_pack (struct paramed_type *T);
+int store_constructor_sticker_set (struct paramed_type *T);
+int store_constructor_string (struct paramed_type *T);
+int store_constructor_update_new_message (struct paramed_type *T);
+int store_constructor_update_message_i_d (struct paramed_type *T);
+int store_constructor_update_delete_messages (struct paramed_type *T);
+int store_constructor_update_user_typing (struct paramed_type *T);
+int store_constructor_update_chat_user_typing (struct paramed_type *T);
+int store_constructor_update_chat_participants (struct paramed_type *T);
+int store_constructor_update_user_status (struct paramed_type *T);
+int store_constructor_update_user_name (struct paramed_type *T);
+int store_constructor_update_user_photo (struct paramed_type *T);
+int store_constructor_update_contact_registered (struct paramed_type *T);
+int store_constructor_update_contact_link (struct paramed_type *T);
+int store_constructor_update_new_authorization (struct paramed_type *T);
+int store_constructor_update_new_geo_chat_message (struct paramed_type *T);
+int store_constructor_update_new_encrypted_message (struct paramed_type *T);
+int store_constructor_update_encrypted_chat_typing (struct paramed_type *T);
+int store_constructor_update_encryption (struct paramed_type *T);
+int store_constructor_update_encrypted_messages_read (struct paramed_type *T);
+int store_constructor_update_chat_participant_add (struct paramed_type *T);
+int store_constructor_update_chat_participant_delete (struct paramed_type *T);
+int store_constructor_update_dc_options (struct paramed_type *T);
+int store_constructor_update_user_blocked (struct paramed_type *T);
+int store_constructor_update_notify_settings (struct paramed_type *T);
+int store_constructor_update_service_notification (struct paramed_type *T);
+int store_constructor_update_privacy (struct paramed_type *T);
+int store_constructor_update_user_phone (struct paramed_type *T);
+int store_constructor_update_read_history_inbox (struct paramed_type *T);
+int store_constructor_update_read_history_outbox (struct paramed_type *T);
+int store_constructor_update_web_page (struct paramed_type *T);
+int store_constructor_update_read_messages_contents (struct paramed_type *T);
+int store_constructor_update_msg_update (struct paramed_type *T);
+int store_constructor_updates_too_long (struct paramed_type *T);
+int store_constructor_update_short_message (struct paramed_type *T);
+int store_constructor_update_short_chat_message (struct paramed_type *T);
+int store_constructor_update_short (struct paramed_type *T);
+int store_constructor_updates_combined (struct paramed_type *T);
+int store_constructor_updates (struct paramed_type *T);
+int store_constructor_user_empty (struct paramed_type *T);
+int store_constructor_user (struct paramed_type *T);
+int store_constructor_user_full (struct paramed_type *T);
+int store_constructor_user_profile_photo_empty (struct paramed_type *T);
+int store_constructor_user_profile_photo (struct paramed_type *T);
+int store_constructor_user_status_empty (struct paramed_type *T);
+int store_constructor_user_status_online (struct paramed_type *T);
+int store_constructor_user_status_offline (struct paramed_type *T);
+int store_constructor_user_status_recently (struct paramed_type *T);
+int store_constructor_user_status_last_week (struct paramed_type *T);
+int store_constructor_user_status_last_month (struct paramed_type *T);
+int store_constructor_vector (struct paramed_type *T);
+int store_constructor_video_empty (struct paramed_type *T);
+int store_constructor_video (struct paramed_type *T);
+int store_constructor_video_l27 (struct paramed_type *T);
+int store_constructor_wall_paper (struct paramed_type *T);
+int store_constructor_wall_paper_solid (struct paramed_type *T);
+int store_constructor_web_page_empty (struct paramed_type *T);
+int store_constructor_web_page_pending (struct paramed_type *T);
+int store_constructor_web_page (struct paramed_type *T);
+int store_constructor_account_authorizations (struct paramed_type *T);
+int store_constructor_account_no_password (struct paramed_type *T);
+int store_constructor_account_password (struct paramed_type *T);
+int store_constructor_account_password_input_settings (struct paramed_type *T);
+int store_constructor_account_password_settings (struct paramed_type *T);
+int store_constructor_account_privacy_rules (struct paramed_type *T);
+int store_constructor_account_sent_change_phone_code (struct paramed_type *T);
+int store_constructor_auth_authorization (struct paramed_type *T);
+int store_constructor_auth_checked_phone (struct paramed_type *T);
+int store_constructor_auth_exported_authorization (struct paramed_type *T);
+int store_constructor_auth_password_recovery (struct paramed_type *T);
+int store_constructor_auth_sent_code (struct paramed_type *T);
+int store_constructor_auth_sent_app_code (struct paramed_type *T);
+int store_constructor_binlog_encr_key (struct paramed_type *T);
+int store_constructor_binlog_start (struct paramed_type *T);
+int store_constructor_binlog_dc_option (struct paramed_type *T);
+int store_constructor_binlog_dc_option_new (struct paramed_type *T);
+int store_constructor_binlog_auth_key (struct paramed_type *T);
+int store_constructor_binlog_default_dc (struct paramed_type *T);
+int store_constructor_binlog_dc_signed (struct paramed_type *T);
+int store_constructor_binlog_our_id (struct paramed_type *T);
+int store_constructor_binlog_set_dh_params (struct paramed_type *T);
+int store_constructor_binlog_set_pts (struct paramed_type *T);
+int store_constructor_binlog_set_qts (struct paramed_type *T);
+int store_constructor_binlog_set_date (struct paramed_type *T);
+int store_constructor_binlog_set_seq (struct paramed_type *T);
+int store_constructor_binlog_encr_chat_delete (struct paramed_type *T);
+int store_constructor_binlog_encr_chat_new (struct paramed_type *T);
+int store_constructor_binlog_encr_chat_exchange_new (struct paramed_type *T);
+int store_constructor_binlog_user_delete (struct paramed_type *T);
+int store_constructor_binlog_user_new (struct paramed_type *T);
+int store_constructor_binlog_chat_new (struct paramed_type *T);
+int store_constructor_binlog_chat_add_participant (struct paramed_type *T);
+int store_constructor_binlog_chat_del_participant (struct paramed_type *T);
+int store_constructor_binlog_set_msg_id (struct paramed_type *T);
+int store_constructor_binlog_message_delete (struct paramed_type *T);
+int store_constructor_binlog_message_new (struct paramed_type *T);
+int store_constructor_binlog_message_encr_new (struct paramed_type *T);
+int store_constructor_binlog_msg_update (struct paramed_type *T);
+int store_constructor_binlog_reset_authorization (struct paramed_type *T);
+int store_constructor_contacts_blocked (struct paramed_type *T);
+int store_constructor_contacts_blocked_slice (struct paramed_type *T);
+int store_constructor_contacts_contacts_not_modified (struct paramed_type *T);
+int store_constructor_contacts_contacts (struct paramed_type *T);
+int store_constructor_contacts_found (struct paramed_type *T);
+int store_constructor_contacts_imported_contacts (struct paramed_type *T);
+int store_constructor_contacts_link (struct paramed_type *T);
+int store_constructor_contacts_suggested (struct paramed_type *T);
+int store_constructor_geochats_located (struct paramed_type *T);
+int store_constructor_geochats_messages (struct paramed_type *T);
+int store_constructor_geochats_messages_slice (struct paramed_type *T);
+int store_constructor_geochats_stated_message (struct paramed_type *T);
+int store_constructor_help_app_update (struct paramed_type *T);
+int store_constructor_help_no_app_update (struct paramed_type *T);
+int store_constructor_help_invite_text (struct paramed_type *T);
+int store_constructor_help_support (struct paramed_type *T);
+int store_constructor_messages_affected_history (struct paramed_type *T);
+int store_constructor_messages_affected_messages (struct paramed_type *T);
+int store_constructor_messages_all_stickers_not_modified (struct paramed_type *T);
+int store_constructor_messages_all_stickers (struct paramed_type *T);
+int store_constructor_messages_chat_full (struct paramed_type *T);
+int store_constructor_messages_chats (struct paramed_type *T);
+int store_constructor_messages_dh_config_not_modified (struct paramed_type *T);
+int store_constructor_messages_dh_config (struct paramed_type *T);
+int store_constructor_messages_dialogs (struct paramed_type *T);
+int store_constructor_messages_dialogs_slice (struct paramed_type *T);
+int store_constructor_messages_message_empty (struct paramed_type *T);
+int store_constructor_messages_messages (struct paramed_type *T);
+int store_constructor_messages_messages_slice (struct paramed_type *T);
+int store_constructor_messages_sent_encrypted_message (struct paramed_type *T);
+int store_constructor_messages_sent_encrypted_file (struct paramed_type *T);
+int store_constructor_messages_sent_message (struct paramed_type *T);
+int store_constructor_messages_sent_message_link (struct paramed_type *T);
+int store_constructor_messages_sticker_set (struct paramed_type *T);
+int store_constructor_messages_stickers_not_modified (struct paramed_type *T);
+int store_constructor_messages_stickers (struct paramed_type *T);
+int store_constructor_photos_photo (struct paramed_type *T);
+int store_constructor_photos_photos (struct paramed_type *T);
+int store_constructor_photos_photos_slice (struct paramed_type *T);
+int store_constructor_storage_file_unknown (struct paramed_type *T);
+int store_constructor_storage_file_jpeg (struct paramed_type *T);
+int store_constructor_storage_file_gif (struct paramed_type *T);
+int store_constructor_storage_file_png (struct paramed_type *T);
+int store_constructor_storage_file_pdf (struct paramed_type *T);
+int store_constructor_storage_file_mp3 (struct paramed_type *T);
+int store_constructor_storage_file_mov (struct paramed_type *T);
+int store_constructor_storage_file_partial (struct paramed_type *T);
+int store_constructor_storage_file_mp4 (struct paramed_type *T);
+int store_constructor_storage_file_webp (struct paramed_type *T);
+int store_constructor_updates_difference_empty (struct paramed_type *T);
+int store_constructor_updates_difference (struct paramed_type *T);
+int store_constructor_updates_difference_slice (struct paramed_type *T);
+int store_constructor_updates_state (struct paramed_type *T);
+int store_constructor_upload_file (struct paramed_type *T);
+int store_type_account_days_t_t_l (struct paramed_type *T);
+int store_type_bare_account_days_t_t_l (struct paramed_type *T);
+int store_type_audio (struct paramed_type *T);
+int store_type_bare_audio (struct paramed_type *T);
+int store_type_authorization (struct paramed_type *T);
+int store_type_bare_authorization (struct paramed_type *T);
+int store_type_bool (struct paramed_type *T);
+int store_type_bare_bool (struct paramed_type *T);
+int store_type_bot_command (struct paramed_type *T);
+int store_type_bare_bot_command (struct paramed_type *T);
+int store_type_bot_info (struct paramed_type *T);
+int store_type_bare_bot_info (struct paramed_type *T);
+int store_type_bytes (struct paramed_type *T);
+int store_type_bare_bytes (struct paramed_type *T);
+int store_type_chat (struct paramed_type *T);
+int store_type_bare_chat (struct paramed_type *T);
+int store_type_chat_full (struct paramed_type *T);
+int store_type_bare_chat_full (struct paramed_type *T);
+int store_type_chat_invite (struct paramed_type *T);
+int store_type_bare_chat_invite (struct paramed_type *T);
+int store_type_chat_located (struct paramed_type *T);
+int store_type_bare_chat_located (struct paramed_type *T);
+int store_type_chat_participant (struct paramed_type *T);
+int store_type_bare_chat_participant (struct paramed_type *T);
+int store_type_chat_participants (struct paramed_type *T);
+int store_type_bare_chat_participants (struct paramed_type *T);
+int store_type_chat_photo (struct paramed_type *T);
+int store_type_bare_chat_photo (struct paramed_type *T);
+int store_type_client_d_h_inner_data (struct paramed_type *T);
+int store_type_bare_client_d_h_inner_data (struct paramed_type *T);
+int store_type_config (struct paramed_type *T);
+int store_type_bare_config (struct paramed_type *T);
+int store_type_contact (struct paramed_type *T);
+int store_type_bare_contact (struct paramed_type *T);
+int store_type_contact_blocked (struct paramed_type *T);
+int store_type_bare_contact_blocked (struct paramed_type *T);
+int store_type_contact_found (struct paramed_type *T);
+int store_type_bare_contact_found (struct paramed_type *T);
+int store_type_contact_link (struct paramed_type *T);
+int store_type_bare_contact_link (struct paramed_type *T);
+int store_type_contact_status (struct paramed_type *T);
+int store_type_bare_contact_status (struct paramed_type *T);
+int store_type_contact_suggested (struct paramed_type *T);
+int store_type_bare_contact_suggested (struct paramed_type *T);
+int store_type_dc_option (struct paramed_type *T);
+int store_type_bare_dc_option (struct paramed_type *T);
+int store_type_decrypted_message (struct paramed_type *T);
+int store_type_bare_decrypted_message (struct paramed_type *T);
+int store_type_decrypted_message_action (struct paramed_type *T);
+int store_type_bare_decrypted_message_action (struct paramed_type *T);
+int store_type_decrypted_message_layer (struct paramed_type *T);
+int store_type_bare_decrypted_message_layer (struct paramed_type *T);
+int store_type_decrypted_message_media (struct paramed_type *T);
+int store_type_bare_decrypted_message_media (struct paramed_type *T);
+int store_type_dialog (struct paramed_type *T);
+int store_type_bare_dialog (struct paramed_type *T);
+int store_type_disabled_feature (struct paramed_type *T);
+int store_type_bare_disabled_feature (struct paramed_type *T);
+int store_type_document (struct paramed_type *T);
+int store_type_bare_document (struct paramed_type *T);
+int store_type_document_attribute (struct paramed_type *T);
+int store_type_bare_document_attribute (struct paramed_type *T);
+int store_type_double (struct paramed_type *T);
+int store_type_bare_double (struct paramed_type *T);
+int store_type_encrypted_chat (struct paramed_type *T);
+int store_type_bare_encrypted_chat (struct paramed_type *T);
+int store_type_encrypted_file (struct paramed_type *T);
+int store_type_bare_encrypted_file (struct paramed_type *T);
+int store_type_encrypted_message (struct paramed_type *T);
+int store_type_bare_encrypted_message (struct paramed_type *T);
+int store_type_error (struct paramed_type *T);
+int store_type_bare_error (struct paramed_type *T);
+int store_type_exported_chat_invite (struct paramed_type *T);
+int store_type_bare_exported_chat_invite (struct paramed_type *T);
+int store_type_file_location (struct paramed_type *T);
+int store_type_bare_file_location (struct paramed_type *T);
+int store_type_geo_chat_message (struct paramed_type *T);
+int store_type_bare_geo_chat_message (struct paramed_type *T);
+int store_type_geo_point (struct paramed_type *T);
+int store_type_bare_geo_point (struct paramed_type *T);
+int store_type_imported_contact (struct paramed_type *T);
+int store_type_bare_imported_contact (struct paramed_type *T);
+int store_type_input_app_event (struct paramed_type *T);
+int store_type_bare_input_app_event (struct paramed_type *T);
+int store_type_input_audio (struct paramed_type *T);
+int store_type_bare_input_audio (struct paramed_type *T);
+int store_type_input_chat_photo (struct paramed_type *T);
+int store_type_bare_input_chat_photo (struct paramed_type *T);
+int store_type_input_contact (struct paramed_type *T);
+int store_type_bare_input_contact (struct paramed_type *T);
+int store_type_input_document (struct paramed_type *T);
+int store_type_bare_input_document (struct paramed_type *T);
+int store_type_input_encrypted_chat (struct paramed_type *T);
+int store_type_bare_input_encrypted_chat (struct paramed_type *T);
+int store_type_input_encrypted_file (struct paramed_type *T);
+int store_type_bare_input_encrypted_file (struct paramed_type *T);
+int store_type_input_file (struct paramed_type *T);
+int store_type_bare_input_file (struct paramed_type *T);
+int store_type_input_file_location (struct paramed_type *T);
+int store_type_bare_input_file_location (struct paramed_type *T);
+int store_type_input_geo_chat (struct paramed_type *T);
+int store_type_bare_input_geo_chat (struct paramed_type *T);
+int store_type_input_geo_point (struct paramed_type *T);
+int store_type_bare_input_geo_point (struct paramed_type *T);
+int store_type_input_media (struct paramed_type *T);
+int store_type_bare_input_media (struct paramed_type *T);
+int store_type_input_notify_peer (struct paramed_type *T);
+int store_type_bare_input_notify_peer (struct paramed_type *T);
+int store_type_input_peer (struct paramed_type *T);
+int store_type_bare_input_peer (struct paramed_type *T);
+int store_type_input_peer_notify_events (struct paramed_type *T);
+int store_type_bare_input_peer_notify_events (struct paramed_type *T);
+int store_type_input_peer_notify_settings (struct paramed_type *T);
+int store_type_bare_input_peer_notify_settings (struct paramed_type *T);
+int store_type_input_photo (struct paramed_type *T);
+int store_type_bare_input_photo (struct paramed_type *T);
+int store_type_input_photo_crop (struct paramed_type *T);
+int store_type_bare_input_photo_crop (struct paramed_type *T);
+int store_type_input_privacy_key (struct paramed_type *T);
+int store_type_bare_input_privacy_key (struct paramed_type *T);
+int store_type_input_privacy_rule (struct paramed_type *T);
+int store_type_bare_input_privacy_rule (struct paramed_type *T);
+int store_type_input_sticker_set (struct paramed_type *T);
+int store_type_bare_input_sticker_set (struct paramed_type *T);
+int store_type_input_user (struct paramed_type *T);
+int store_type_bare_input_user (struct paramed_type *T);
+int store_type_input_video (struct paramed_type *T);
+int store_type_bare_input_video (struct paramed_type *T);
+int store_type_int (struct paramed_type *T);
+int store_type_bare_int (struct paramed_type *T);
+int store_type_int128 (struct paramed_type *T);
+int store_type_bare_int128 (struct paramed_type *T);
+int store_type_int256 (struct paramed_type *T);
+int store_type_bare_int256 (struct paramed_type *T);
+int store_type_keyboard_button (struct paramed_type *T);
+int store_type_bare_keyboard_button (struct paramed_type *T);
+int store_type_keyboard_button_row (struct paramed_type *T);
+int store_type_bare_keyboard_button_row (struct paramed_type *T);
+int store_type_long (struct paramed_type *T);
+int store_type_bare_long (struct paramed_type *T);
+int store_type_message (struct paramed_type *T);
+int store_type_bare_message (struct paramed_type *T);
+int store_type_message_action (struct paramed_type *T);
+int store_type_bare_message_action (struct paramed_type *T);
+int store_type_message_media (struct paramed_type *T);
+int store_type_bare_message_media (struct paramed_type *T);
+int store_type_messages_filter (struct paramed_type *T);
+int store_type_bare_messages_filter (struct paramed_type *T);
+int store_type_nearest_dc (struct paramed_type *T);
+int store_type_bare_nearest_dc (struct paramed_type *T);
+int store_type_notify_peer (struct paramed_type *T);
+int store_type_bare_notify_peer (struct paramed_type *T);
+int store_type_null (struct paramed_type *T);
+int store_type_bare_null (struct paramed_type *T);
+int store_type_p_q_inner_data (struct paramed_type *T);
+int store_type_bare_p_q_inner_data (struct paramed_type *T);
+int store_type_peer (struct paramed_type *T);
+int store_type_bare_peer (struct paramed_type *T);
+int store_type_peer_notify_events (struct paramed_type *T);
+int store_type_bare_peer_notify_events (struct paramed_type *T);
+int store_type_peer_notify_settings (struct paramed_type *T);
+int store_type_bare_peer_notify_settings (struct paramed_type *T);
+int store_type_photo (struct paramed_type *T);
+int store_type_bare_photo (struct paramed_type *T);
+int store_type_photo_size (struct paramed_type *T);
+int store_type_bare_photo_size (struct paramed_type *T);
+int store_type_privacy_key (struct paramed_type *T);
+int store_type_bare_privacy_key (struct paramed_type *T);
+int store_type_privacy_rule (struct paramed_type *T);
+int store_type_bare_privacy_rule (struct paramed_type *T);
+int store_type_received_notify_message (struct paramed_type *T);
+int store_type_bare_received_notify_message (struct paramed_type *T);
+int store_type_reply_markup (struct paramed_type *T);
+int store_type_bare_reply_markup (struct paramed_type *T);
+int store_type_res_p_q (struct paramed_type *T);
+int store_type_bare_res_p_q (struct paramed_type *T);
+int store_type_send_message_action (struct paramed_type *T);
+int store_type_bare_send_message_action (struct paramed_type *T);
+int store_type_server_d_h_params (struct paramed_type *T);
+int store_type_bare_server_d_h_params (struct paramed_type *T);
+int store_type_server_d_h_inner_data (struct paramed_type *T);
+int store_type_bare_server_d_h_inner_data (struct paramed_type *T);
+int store_type_set_client_d_h_params_answer (struct paramed_type *T);
+int store_type_bare_set_client_d_h_params_answer (struct paramed_type *T);
+int store_type_sticker_pack (struct paramed_type *T);
+int store_type_bare_sticker_pack (struct paramed_type *T);
+int store_type_sticker_set (struct paramed_type *T);
+int store_type_bare_sticker_set (struct paramed_type *T);
+int store_type_string (struct paramed_type *T);
+int store_type_bare_string (struct paramed_type *T);
+int store_type_update (struct paramed_type *T);
+int store_type_bare_update (struct paramed_type *T);
+int store_type_updates (struct paramed_type *T);
+int store_type_bare_updates (struct paramed_type *T);
+int store_type_user (struct paramed_type *T);
+int store_type_bare_user (struct paramed_type *T);
+int store_type_user_full (struct paramed_type *T);
+int store_type_bare_user_full (struct paramed_type *T);
+int store_type_user_profile_photo (struct paramed_type *T);
+int store_type_bare_user_profile_photo (struct paramed_type *T);
+int store_type_user_status (struct paramed_type *T);
+int store_type_bare_user_status (struct paramed_type *T);
+int store_type_vector (struct paramed_type *T);
+int store_type_bare_vector (struct paramed_type *T);
+int store_type_video (struct paramed_type *T);
+int store_type_bare_video (struct paramed_type *T);
+int store_type_wall_paper (struct paramed_type *T);
+int store_type_bare_wall_paper (struct paramed_type *T);
+int store_type_web_page (struct paramed_type *T);
+int store_type_bare_web_page (struct paramed_type *T);
+int store_type_account_authorizations (struct paramed_type *T);
+int store_type_bare_account_authorizations (struct paramed_type *T);
+int store_type_account_password (struct paramed_type *T);
+int store_type_bare_account_password (struct paramed_type *T);
+int store_type_account_password_input_settings (struct paramed_type *T);
+int store_type_bare_account_password_input_settings (struct paramed_type *T);
+int store_type_account_password_settings (struct paramed_type *T);
+int store_type_bare_account_password_settings (struct paramed_type *T);
+int store_type_account_privacy_rules (struct paramed_type *T);
+int store_type_bare_account_privacy_rules (struct paramed_type *T);
+int store_type_account_sent_change_phone_code (struct paramed_type *T);
+int store_type_bare_account_sent_change_phone_code (struct paramed_type *T);
+int store_type_auth_authorization (struct paramed_type *T);
+int store_type_bare_auth_authorization (struct paramed_type *T);
+int store_type_auth_checked_phone (struct paramed_type *T);
+int store_type_bare_auth_checked_phone (struct paramed_type *T);
+int store_type_auth_exported_authorization (struct paramed_type *T);
+int store_type_bare_auth_exported_authorization (struct paramed_type *T);
+int store_type_auth_password_recovery (struct paramed_type *T);
+int store_type_bare_auth_password_recovery (struct paramed_type *T);
+int store_type_auth_sent_code (struct paramed_type *T);
+int store_type_bare_auth_sent_code (struct paramed_type *T);
+int store_type_binlog_encr_key (struct paramed_type *T);
+int store_type_bare_binlog_encr_key (struct paramed_type *T);
+int store_type_binlog_update (struct paramed_type *T);
+int store_type_bare_binlog_update (struct paramed_type *T);
+int store_type_contacts_blocked (struct paramed_type *T);
+int store_type_bare_contacts_blocked (struct paramed_type *T);
+int store_type_contacts_contacts (struct paramed_type *T);
+int store_type_bare_contacts_contacts (struct paramed_type *T);
+int store_type_contacts_found (struct paramed_type *T);
+int store_type_bare_contacts_found (struct paramed_type *T);
+int store_type_contacts_imported_contacts (struct paramed_type *T);
+int store_type_bare_contacts_imported_contacts (struct paramed_type *T);
+int store_type_contacts_link (struct paramed_type *T);
+int store_type_bare_contacts_link (struct paramed_type *T);
+int store_type_contacts_suggested (struct paramed_type *T);
+int store_type_bare_contacts_suggested (struct paramed_type *T);
+int store_type_geochats_located (struct paramed_type *T);
+int store_type_bare_geochats_located (struct paramed_type *T);
+int store_type_geochats_messages (struct paramed_type *T);
+int store_type_bare_geochats_messages (struct paramed_type *T);
+int store_type_geochats_stated_message (struct paramed_type *T);
+int store_type_bare_geochats_stated_message (struct paramed_type *T);
+int store_type_help_app_update (struct paramed_type *T);
+int store_type_bare_help_app_update (struct paramed_type *T);
+int store_type_help_invite_text (struct paramed_type *T);
+int store_type_bare_help_invite_text (struct paramed_type *T);
+int store_type_help_support (struct paramed_type *T);
+int store_type_bare_help_support (struct paramed_type *T);
+int store_type_messages_affected_history (struct paramed_type *T);
+int store_type_bare_messages_affected_history (struct paramed_type *T);
+int store_type_messages_affected_messages (struct paramed_type *T);
+int store_type_bare_messages_affected_messages (struct paramed_type *T);
+int store_type_messages_all_stickers (struct paramed_type *T);
+int store_type_bare_messages_all_stickers (struct paramed_type *T);
+int store_type_messages_chat_full (struct paramed_type *T);
+int store_type_bare_messages_chat_full (struct paramed_type *T);
+int store_type_messages_chats (struct paramed_type *T);
+int store_type_bare_messages_chats (struct paramed_type *T);
+int store_type_messages_dh_config (struct paramed_type *T);
+int store_type_bare_messages_dh_config (struct paramed_type *T);
+int store_type_messages_dialogs (struct paramed_type *T);
+int store_type_bare_messages_dialogs (struct paramed_type *T);
+int store_type_messages_message (struct paramed_type *T);
+int store_type_bare_messages_message (struct paramed_type *T);
+int store_type_messages_messages (struct paramed_type *T);
+int store_type_bare_messages_messages (struct paramed_type *T);
+int store_type_messages_sent_encrypted_message (struct paramed_type *T);
+int store_type_bare_messages_sent_encrypted_message (struct paramed_type *T);
+int store_type_messages_sent_message (struct paramed_type *T);
+int store_type_bare_messages_sent_message (struct paramed_type *T);
+int store_type_messages_sticker_set (struct paramed_type *T);
+int store_type_bare_messages_sticker_set (struct paramed_type *T);
+int store_type_messages_stickers (struct paramed_type *T);
+int store_type_bare_messages_stickers (struct paramed_type *T);
+int store_type_photos_photo (struct paramed_type *T);
+int store_type_bare_photos_photo (struct paramed_type *T);
+int store_type_photos_photos (struct paramed_type *T);
+int store_type_bare_photos_photos (struct paramed_type *T);
+int store_type_storage_file_type (struct paramed_type *T);
+int store_type_bare_storage_file_type (struct paramed_type *T);
+int store_type_updates_difference (struct paramed_type *T);
+int store_type_bare_updates_difference (struct paramed_type *T);
+int store_type_updates_state (struct paramed_type *T);
+int store_type_bare_updates_state (struct paramed_type *T);
+int store_type_upload_file (struct paramed_type *T);
+int store_type_bare_upload_file (struct paramed_type *T);
+struct paramed_type *store_function_account_change_phone (void);
+struct paramed_type *store_function_account_check_username (void);
+struct paramed_type *store_function_account_delete_account (void);
+struct paramed_type *store_function_account_get_account_t_t_l (void);
+struct paramed_type *store_function_account_get_authorizations (void);
+struct paramed_type *store_function_account_get_notify_settings (void);
+struct paramed_type *store_function_account_get_password (void);
+struct paramed_type *store_function_account_get_password_settings (void);
+struct paramed_type *store_function_account_get_privacy (void);
+struct paramed_type *store_function_account_get_wall_papers (void);
+struct paramed_type *store_function_account_register_device (void);
+struct paramed_type *store_function_account_reset_authorization (void);
+struct paramed_type *store_function_account_reset_notify_settings (void);
+struct paramed_type *store_function_account_send_change_phone_code (void);
+struct paramed_type *store_function_account_set_account_t_t_l (void);
+struct paramed_type *store_function_account_set_privacy (void);
+struct paramed_type *store_function_account_unregister_device (void);
+struct paramed_type *store_function_account_update_device_locked (void);
+struct paramed_type *store_function_account_update_notify_settings (void);
+struct paramed_type *store_function_account_update_password_settings (void);
+struct paramed_type *store_function_account_update_profile (void);
+struct paramed_type *store_function_account_update_status (void);
+struct paramed_type *store_function_account_update_username (void);
+struct paramed_type *store_function_auth_bind_temp_auth_key (void);
+struct paramed_type *store_function_auth_check_password (void);
+struct paramed_type *store_function_auth_check_phone (void);
+struct paramed_type *store_function_auth_export_authorization (void);
+struct paramed_type *store_function_auth_import_authorization (void);
+struct paramed_type *store_function_auth_import_bot_authorization (void);
+struct paramed_type *store_function_auth_log_out (void);
+struct paramed_type *store_function_auth_recover_password (void);
+struct paramed_type *store_function_auth_request_password_recovery (void);
+struct paramed_type *store_function_auth_reset_authorizations (void);
+struct paramed_type *store_function_auth_send_call (void);
+struct paramed_type *store_function_auth_send_code (void);
+struct paramed_type *store_function_auth_send_invites (void);
+struct paramed_type *store_function_auth_send_sms (void);
+struct paramed_type *store_function_auth_sign_in (void);
+struct paramed_type *store_function_auth_sign_up (void);
+struct paramed_type *store_function_contacts_block (void);
+struct paramed_type *store_function_contacts_delete_contact (void);
+struct paramed_type *store_function_contacts_delete_contacts (void);
+struct paramed_type *store_function_contacts_export_card (void);
+struct paramed_type *store_function_contacts_get_blocked (void);
+struct paramed_type *store_function_contacts_get_contacts (void);
+struct paramed_type *store_function_contacts_get_statuses (void);
+struct paramed_type *store_function_contacts_get_suggested (void);
+struct paramed_type *store_function_contacts_import_card (void);
+struct paramed_type *store_function_contacts_import_contacts (void);
+struct paramed_type *store_function_contacts_resolve_username (void);
+struct paramed_type *store_function_contacts_search (void);
+struct paramed_type *store_function_contacts_unblock (void);
+struct paramed_type *store_function_geochats_checkin (void);
+struct paramed_type *store_function_geochats_create_geo_chat (void);
+struct paramed_type *store_function_geochats_edit_chat_photo (void);
+struct paramed_type *store_function_geochats_edit_chat_title (void);
+struct paramed_type *store_function_geochats_get_full_chat (void);
+struct paramed_type *store_function_geochats_get_history (void);
+struct paramed_type *store_function_geochats_get_located (void);
+struct paramed_type *store_function_geochats_get_recents (void);
+struct paramed_type *store_function_geochats_search (void);
+struct paramed_type *store_function_geochats_send_media (void);
+struct paramed_type *store_function_geochats_send_message (void);
+struct paramed_type *store_function_geochats_set_typing (void);
+struct paramed_type *store_function_help_get_app_update (void);
+struct paramed_type *store_function_help_get_config (void);
+struct paramed_type *store_function_help_get_invite_text (void);
+struct paramed_type *store_function_help_get_nearest_dc (void);
+struct paramed_type *store_function_help_get_support (void);
+struct paramed_type *store_function_help_save_app_log (void);
+struct paramed_type *store_function_init_connection (void);
+struct paramed_type *store_function_invoke_after_msg (void);
+struct paramed_type *store_function_invoke_after_msgs (void);
+struct paramed_type *store_function_invoke_with_layer (void);
+struct paramed_type *store_function_invoke_without_updates (void);
+struct paramed_type *store_function_messages_accept_encryption (void);
+struct paramed_type *store_function_messages_add_chat_user (void);
+struct paramed_type *store_function_messages_check_chat_invite (void);
+struct paramed_type *store_function_messages_create_chat (void);
+struct paramed_type *store_function_messages_delete_chat_user (void);
+struct paramed_type *store_function_messages_delete_history (void);
+struct paramed_type *store_function_messages_delete_messages (void);
+struct paramed_type *store_function_messages_discard_encryption (void);
+struct paramed_type *store_function_messages_edit_chat_photo (void);
+struct paramed_type *store_function_messages_edit_chat_title (void);
+struct paramed_type *store_function_messages_export_chat_invite (void);
+struct paramed_type *store_function_messages_forward_message (void);
+struct paramed_type *store_function_messages_forward_messages (void);
+struct paramed_type *store_function_messages_get_all_stickers (void);
+struct paramed_type *store_function_messages_get_chats (void);
+struct paramed_type *store_function_messages_get_dh_config (void);
+struct paramed_type *store_function_messages_get_dialogs (void);
+struct paramed_type *store_function_messages_get_full_chat (void);
+struct paramed_type *store_function_messages_get_history (void);
+struct paramed_type *store_function_messages_get_messages (void);
+struct paramed_type *store_function_messages_get_sticker_set (void);
+struct paramed_type *store_function_messages_get_stickers (void);
+struct paramed_type *store_function_messages_get_web_page_preview (void);
+struct paramed_type *store_function_messages_import_chat_invite (void);
+struct paramed_type *store_function_messages_install_sticker_set (void);
+struct paramed_type *store_function_messages_read_encrypted_history (void);
+struct paramed_type *store_function_messages_read_history (void);
+struct paramed_type *store_function_messages_read_message_contents (void);
+struct paramed_type *store_function_messages_received_messages (void);
+struct paramed_type *store_function_messages_received_queue (void);
+struct paramed_type *store_function_messages_request_encryption (void);
+struct paramed_type *store_function_messages_search (void);
+struct paramed_type *store_function_messages_send_broadcast (void);
+struct paramed_type *store_function_messages_send_encrypted (void);
+struct paramed_type *store_function_messages_send_encrypted_file (void);
+struct paramed_type *store_function_messages_send_encrypted_service (void);
+struct paramed_type *store_function_messages_send_media (void);
+struct paramed_type *store_function_messages_send_message (void);
+struct paramed_type *store_function_messages_set_encrypted_typing (void);
+struct paramed_type *store_function_messages_set_typing (void);
+struct paramed_type *store_function_messages_start_bot (void);
+struct paramed_type *store_function_messages_uninstall_sticker_set (void);
+struct paramed_type *store_function_photos_delete_photos (void);
+struct paramed_type *store_function_photos_get_user_photos (void);
+struct paramed_type *store_function_photos_update_profile_photo (void);
+struct paramed_type *store_function_photos_upload_profile_photo (void);
+struct paramed_type *store_function_req_d_h_params (void);
+struct paramed_type *store_function_req_pq (void);
+struct paramed_type *store_function_set_client_d_h_params (void);
+struct paramed_type *store_function_updates_get_difference (void);
+struct paramed_type *store_function_updates_get_state (void);
+struct paramed_type *store_function_upload_get_file (void);
+struct paramed_type *store_function_upload_save_big_file_part (void);
+struct paramed_type *store_function_upload_save_file_part (void);
+struct paramed_type *store_function_users_get_full_user (void);
+struct paramed_type *store_function_users_get_users (void);
+int store_type_any (struct paramed_type *T);
+struct paramed_type *store_function_any (void);
diff --git a/protocols/Telegram/tgl/auto/auto-types.c b/protocols/Telegram/tgl/auto/auto-types.c
new file mode 100644
index 0000000000..d81edf0949
--- /dev/null
+++ b/protocols/Telegram/tgl/auto/auto-types.c
@@ -0,0 +1,1793 @@
+#ifdef _MSC_VER
+#include "..\auto.h"
+#else
+#include "auto.h"
+#endif
+struct tl_type_descr tl_type_account_days_t_t_l = {
+ .name = 0xb8d0afdf,
+ .id = "AccountDaysTTL"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_account_days_t_t_l = {
+ .name = 0x472f5020,
+ .id = "Bare_AccountDaysTTL",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_audio = {
+ .name = 0x9fc5ec4e,
+ .id = "Audio"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_audio = {
+ .name = 0x603a13b1,
+ .id = "Bare_Audio",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_authorization = {
+ .name = 0x7bf2e6f6,
+ .id = "Authorization"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_authorization = {
+ .name = 0x840d1909,
+ .id = "Bare_Authorization",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bool = {
+ .name = 0x250be282,
+ .id = "Bool"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_bool = {
+ .name = 0xdaf41d7d,
+ .id = "Bare_Bool",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bot_command = {
+ .name = 0x75e7ea6c,
+ .id = "BotCommand"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_bot_command = {
+ .name = 0x8a181593,
+ .id = "Bare_BotCommand",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bot_info = {
+ .name = 0xb2e16f93,
+ .id = "BotInfo"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_bot_info = {
+ .name = 0x4d1e906c,
+ .id = "Bare_BotInfo",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bytes = {
+ .name = 0x0ee1379f,
+ .id = "Bytes"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_bytes = {
+ .name = 0xf11ec860,
+ .id = "Bare_Bytes",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_chat = {
+ .name = 0x7bd865dc,
+ .id = "Chat"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_chat = {
+ .name = 0x84279a23,
+ .id = "Bare_Chat",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_chat_full = {
+ .name = 0x2e02a614,
+ .id = "ChatFull"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_chat_full = {
+ .name = 0xd1fd59eb,
+ .id = "Bare_ChatFull",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_chat_invite = {
+ .name = 0x94f910b1,
+ .id = "ChatInvite"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_chat_invite = {
+ .name = 0x6b06ef4e,
+ .id = "Bare_ChatInvite",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_chat_located = {
+ .name = 0x3631cf4c,
+ .id = "ChatLocated"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_chat_located = {
+ .name = 0xc9ce30b3,
+ .id = "Bare_ChatLocated",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_chat_participant = {
+ .name = 0xc8d7493e,
+ .id = "ChatParticipant"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_chat_participant = {
+ .name = 0x3728b6c1,
+ .id = "Bare_ChatParticipant",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_chat_participants = {
+ .name = 0x77930f9f,
+ .id = "ChatParticipants"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_chat_participants = {
+ .name = 0x886cf060,
+ .id = "Bare_ChatParticipants",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_chat_photo = {
+ .name = 0x56922676,
+ .id = "ChatPhoto"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_chat_photo = {
+ .name = 0xa96dd989,
+ .id = "Bare_ChatPhoto",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_client_d_h_inner_data = {
+ .name = 0x6643b654,
+ .id = "Client_DH_Inner_Data"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_client_d_h_inner_data = {
+ .name = 0x99bc49ab,
+ .id = "Bare_Client_DH_Inner_Data",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_config = {
+ .name = 0x4e32b894,
+ .id = "Config"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_config = {
+ .name = 0xb1cd476b,
+ .id = "Bare_Config",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_contact = {
+ .name = 0xf911c994,
+ .id = "Contact"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_contact = {
+ .name = 0x06ee366b,
+ .id = "Bare_Contact",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_contact_blocked = {
+ .name = 0x561bc879,
+ .id = "ContactBlocked"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_contact_blocked = {
+ .name = 0xa9e43786,
+ .id = "Bare_ContactBlocked",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_contact_found = {
+ .name = 0xea879f95,
+ .id = "ContactFound"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_contact_found = {
+ .name = 0x1578606a,
+ .id = "Bare_ContactFound",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_contact_link = {
+ .name = 0x522fbc63,
+ .id = "ContactLink"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_contact_link = {
+ .name = 0xadd0439c,
+ .id = "Bare_ContactLink",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_contact_status = {
+ .name = 0xd3680c61,
+ .id = "ContactStatus"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_contact_status = {
+ .name = 0x2c97f39e,
+ .id = "Bare_ContactStatus",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_contact_suggested = {
+ .name = 0x3de191a1,
+ .id = "ContactSuggested"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_contact_suggested = {
+ .name = 0xc21e6e5e,
+ .id = "Bare_ContactSuggested",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_dc_option = {
+ .name = 0x2b1a62f0,
+ .id = "DcOption"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_dc_option = {
+ .name = 0xd4e59d0f,
+ .id = "Bare_DcOption",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_decrypted_message = {
+ .name = 0x535b7918,
+ .id = "DecryptedMessage"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_decrypted_message = {
+ .name = 0xaca486e7,
+ .id = "Bare_DecryptedMessage",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_decrypted_message_action = {
+ .name = 0x4e0eefde,
+ .id = "DecryptedMessageAction"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_decrypted_message_action = {
+ .name = 0xb1f11021,
+ .id = "Bare_DecryptedMessageAction",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_decrypted_message_layer = {
+ .name = 0x1be31789,
+ .id = "DecryptedMessageLayer"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_decrypted_message_layer = {
+ .name = 0xe41ce876,
+ .id = "Bare_DecryptedMessageLayer",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_decrypted_message_media = {
+ .name = 0x34e0d674,
+ .id = "DecryptedMessageMedia"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_decrypted_message_media = {
+ .name = 0xcb1f298b,
+ .id = "Bare_DecryptedMessageMedia",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_dialog = {
+ .name = 0xc1dd804a,
+ .id = "Dialog"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_dialog = {
+ .name = 0x3e227fb5,
+ .id = "Bare_Dialog",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_disabled_feature = {
+ .name = 0xae636f24,
+ .id = "DisabledFeature"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_disabled_feature = {
+ .name = 0x519c90db,
+ .id = "Bare_DisabledFeature",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_document = {
+ .name = 0x51a73418,
+ .id = "Document"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_document = {
+ .name = 0xae58cbe7,
+ .id = "Bare_Document",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_document_attribute = {
+ .name = 0x97c637a3,
+ .id = "DocumentAttribute"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_document_attribute = {
+ .name = 0x6839c85c,
+ .id = "Bare_DocumentAttribute",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_double = {
+ .name = 0x2210c154,
+ .id = "Double"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_double = {
+ .name = 0xddef3eab,
+ .id = "Bare_Double",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_encrypted_chat = {
+ .name = 0xb1718213,
+ .id = "EncryptedChat"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_encrypted_chat = {
+ .name = 0x4e8e7dec,
+ .id = "Bare_EncryptedChat",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_encrypted_file = {
+ .name = 0x886fd032,
+ .id = "EncryptedFile"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_encrypted_file = {
+ .name = 0x77902fcd,
+ .id = "Bare_EncryptedFile",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_encrypted_message = {
+ .name = 0xce6b8a1e,
+ .id = "EncryptedMessage"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_encrypted_message = {
+ .name = 0x319475e1,
+ .id = "Bare_EncryptedMessage",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_error = {
+ .name = 0xc4b9f9bb,
+ .id = "Error"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_error = {
+ .name = 0x3b460644,
+ .id = "Bare_Error",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_exported_chat_invite = {
+ .name = 0x95f132d5,
+ .id = "ExportedChatInvite"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_exported_chat_invite = {
+ .name = 0x6a0ecd2a,
+ .id = "Bare_ExportedChatInvite",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_file_location = {
+ .name = 0x2f8ffb30,
+ .id = "FileLocation"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_file_location = {
+ .name = 0xd07004cf,
+ .id = "Bare_FileLocation",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_geo_chat_message = {
+ .name = 0xf67b4034,
+ .id = "GeoChatMessage"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_geo_chat_message = {
+ .name = 0x0984bfcb,
+ .id = "Bare_GeoChatMessage",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_geo_point = {
+ .name = 0x315e0a53,
+ .id = "GeoPoint"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_geo_point = {
+ .name = 0xcea1f5ac,
+ .id = "Bare_GeoPoint",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_imported_contact = {
+ .name = 0xd0028438,
+ .id = "ImportedContact"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_imported_contact = {
+ .name = 0x2ffd7bc7,
+ .id = "Bare_ImportedContact",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_input_app_event = {
+ .name = 0x770656a8,
+ .id = "InputAppEvent"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_input_app_event = {
+ .name = 0x88f9a957,
+ .id = "Bare_InputAppEvent",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_input_audio = {
+ .name = 0xae8e9c7b,
+ .id = "InputAudio"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_input_audio = {
+ .name = 0x51716384,
+ .id = "Bare_InputAudio",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_input_chat_photo = {
+ .name = 0x3a60776d,
+ .id = "InputChatPhoto"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_input_chat_photo = {
+ .name = 0xc59f8892,
+ .id = "Bare_InputChatPhoto",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_input_contact = {
+ .name = 0xf392b7f4,
+ .id = "InputContact"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_input_contact = {
+ .name = 0x0c6d480b,
+ .id = "Bare_InputContact",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_input_document = {
+ .name = 0x6a8963fc,
+ .id = "InputDocument"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_input_document = {
+ .name = 0x95769c03,
+ .id = "Bare_InputDocument",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_input_encrypted_chat = {
+ .name = 0xf141b5e1,
+ .id = "InputEncryptedChat"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_input_encrypted_chat = {
+ .name = 0x0ebe4a1e,
+ .id = "Bare_InputEncryptedChat",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_input_encrypted_file = {
+ .name = 0x0b5c064f,
+ .id = "InputEncryptedFile"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_input_encrypted_file = {
+ .name = 0xf4a3f9b0,
+ .id = "Bare_InputEncryptedFile",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_input_file = {
+ .name = 0x0f60f9ca,
+ .id = "InputFile"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_input_file = {
+ .name = 0xf09f0635,
+ .id = "Bare_InputFile",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_input_file_location = {
+ .name = 0xe6daa38b,
+ .id = "InputFileLocation"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_input_file_location = {
+ .name = 0x19255c74,
+ .id = "Bare_InputFileLocation",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_input_geo_chat = {
+ .name = 0x74d456fa,
+ .id = "InputGeoChat"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_input_geo_chat = {
+ .name = 0x8b2ba905,
+ .id = "Bare_InputGeoChat",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_input_geo_point = {
+ .name = 0x17768f1f,
+ .id = "InputGeoPoint"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_input_geo_point = {
+ .name = 0xe88970e0,
+ .id = "Bare_InputGeoPoint",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_input_media = {
+ .name = 0xb32c91dd,
+ .id = "InputMedia"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_input_media = {
+ .name = 0x4cd36e22,
+ .id = "Bare_InputMedia",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_input_notify_peer = {
+ .name = 0x02b6911b,
+ .id = "InputNotifyPeer"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_input_notify_peer = {
+ .name = 0xfd496ee4,
+ .id = "Bare_InputNotifyPeer",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_input_peer = {
+ .name = 0x9e67268d,
+ .id = "InputPeer"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_input_peer = {
+ .name = 0x6198d972,
+ .id = "Bare_InputPeer",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_input_peer_notify_events = {
+ .name = 0x185a48ac,
+ .id = "InputPeerNotifyEvents"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_input_peer_notify_events = {
+ .name = 0xe7a5b753,
+ .id = "Bare_InputPeerNotifyEvents",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_input_peer_notify_settings = {
+ .name = 0x46a2ce98,
+ .id = "InputPeerNotifySettings"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_input_peer_notify_settings = {
+ .name = 0xb95d3167,
+ .id = "Bare_InputPeerNotifySettings",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_input_photo = {
+ .name = 0xe74279c9,
+ .id = "InputPhoto"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_input_photo = {
+ .name = 0x18bd8636,
+ .id = "Bare_InputPhoto",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_input_photo_crop = {
+ .name = 0x7477e321,
+ .id = "InputPhotoCrop"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_input_photo_crop = {
+ .name = 0x8b881cde,
+ .id = "Bare_InputPhotoCrop",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_input_privacy_key = {
+ .name = 0x4f96cb18,
+ .id = "InputPrivacyKey"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_input_privacy_key = {
+ .name = 0xb06934e7,
+ .id = "Bare_InputPrivacyKey",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_input_privacy_rule = {
+ .name = 0x4b815163,
+ .id = "InputPrivacyRule"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_input_privacy_rule = {
+ .name = 0xb47eae9c,
+ .id = "Bare_InputPrivacyRule",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_input_sticker_set = {
+ .name = 0xe44d415c,
+ .id = "InputStickerSet"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_input_sticker_set = {
+ .name = 0x1bb2bea3,
+ .id = "Bare_InputStickerSet",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_input_user = {
+ .name = 0xadfe0c6a,
+ .id = "InputUser"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_input_user = {
+ .name = 0x5201f395,
+ .id = "Bare_InputUser",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_input_video = {
+ .name = 0xbb5f7a27,
+ .id = "InputVideo"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_input_video = {
+ .name = 0x44a085d8,
+ .id = "Bare_InputVideo",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_int = {
+ .name = 0xa8509bda,
+ .id = "Int"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_int = {
+ .name = 0x57af6425,
+ .id = "Bare_Int",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_int128 = {
+ .name = 0x7d36c439,
+ .id = "Int128"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_int128 = {
+ .name = 0x82c93bc6,
+ .id = "Bare_Int128",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_int256 = {
+ .name = 0xf2c798b3,
+ .id = "Int256"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_int256 = {
+ .name = 0x0d38674c,
+ .id = "Bare_Int256",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_keyboard_button = {
+ .name = 0xa2fa4880,
+ .id = "KeyboardButton"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_keyboard_button = {
+ .name = 0x5d05b77f,
+ .id = "Bare_KeyboardButton",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_keyboard_button_row = {
+ .name = 0x77608b83,
+ .id = "KeyboardButtonRow"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_keyboard_button_row = {
+ .name = 0x889f747c,
+ .id = "Bare_KeyboardButtonRow",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_long = {
+ .name = 0x22076cba,
+ .id = "Long"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_long = {
+ .name = 0xddf89345,
+ .id = "Bare_Long",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_message = {
+ .name = 0x5d652a7f,
+ .id = "Message"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_message = {
+ .name = 0xa29ad580,
+ .id = "Bare_Message",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_message_action = {
+ .name = 0x383415fa,
+ .id = "MessageAction"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_message_action = {
+ .name = 0xc7cbea05,
+ .id = "Bare_MessageAction",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_message_media = {
+ .name = 0x95f2471a,
+ .id = "MessageMedia"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_message_media = {
+ .name = 0x6a0db8e5,
+ .id = "Bare_MessageMedia",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_messages_filter = {
+ .name = 0x80895ae0,
+ .id = "MessagesFilter"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_messages_filter = {
+ .name = 0x7f76a51f,
+ .id = "Bare_MessagesFilter",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_nearest_dc = {
+ .name = 0x8e1a1775,
+ .id = "NearestDc"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_nearest_dc = {
+ .name = 0x71e5e88a,
+ .id = "Bare_NearestDc",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_notify_peer = {
+ .name = 0x9fcb8237,
+ .id = "NotifyPeer"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_notify_peer = {
+ .name = 0x60347dc8,
+ .id = "Bare_NotifyPeer",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_null = {
+ .name = 0x56730bcc,
+ .id = "Null"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_null = {
+ .name = 0xa98cf433,
+ .id = "Bare_Null",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_p_q_inner_data = {
+ .name = 0xbfa3de38,
+ .id = "P_Q_inner_data"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_p_q_inner_data = {
+ .name = 0x405c21c7,
+ .id = "Bare_P_Q_inner_data",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_peer = {
+ .name = 0x276159d6,
+ .id = "Peer"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_peer = {
+ .name = 0xd89ea629,
+ .id = "Bare_Peer",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_peer_notify_events = {
+ .name = 0xc0c8d13b,
+ .id = "PeerNotifyEvents"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_peer_notify_events = {
+ .name = 0x3f372ec4,
+ .id = "Bare_PeerNotifyEvents",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_peer_notify_settings = {
+ .name = 0xfdf894fc,
+ .id = "PeerNotifySettings"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_peer_notify_settings = {
+ .name = 0x02076b03,
+ .id = "Bare_PeerNotifySettings",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_photo = {
+ .name = 0xc207550a,
+ .id = "Photo"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_photo = {
+ .name = 0x3df8aaf5,
+ .id = "Bare_Photo",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_photo_size = {
+ .name = 0x900f60dd,
+ .id = "PhotoSize"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_photo_size = {
+ .name = 0x6ff09f22,
+ .id = "Bare_PhotoSize",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_privacy_key = {
+ .name = 0xbc2eab30,
+ .id = "PrivacyKey"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_privacy_key = {
+ .name = 0x43d154cf,
+ .id = "Bare_PrivacyKey",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_privacy_rule = {
+ .name = 0xa8638aec,
+ .id = "PrivacyRule"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_privacy_rule = {
+ .name = 0x579c7513,
+ .id = "Bare_PrivacyRule",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_received_notify_message = {
+ .name = 0xa384b779,
+ .id = "ReceivedNotifyMessage"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_received_notify_message = {
+ .name = 0x5c7b4886,
+ .id = "Bare_ReceivedNotifyMessage",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_reply_markup = {
+ .name = 0x612ca4a9,
+ .id = "ReplyMarkup"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_reply_markup = {
+ .name = 0x9ed35b56,
+ .id = "Bare_ReplyMarkup",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_res_p_q = {
+ .name = 0x05162463,
+ .id = "ResPQ"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_res_p_q = {
+ .name = 0xfae9db9c,
+ .id = "Bare_ResPQ",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_send_message_action = {
+ .name = 0x70541c7e,
+ .id = "SendMessageAction"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_send_message_action = {
+ .name = 0x8fabe381,
+ .id = "Bare_SendMessageAction",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_server_d_h_params = {
+ .name = 0xa9230301,
+ .id = "Server_DH_Params"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_server_d_h_params = {
+ .name = 0x56dcfcfe,
+ .id = "Bare_Server_DH_Params",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_server_d_h_inner_data = {
+ .name = 0xb5890dba,
+ .id = "Server_DH_inner_data"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_server_d_h_inner_data = {
+ .name = 0x4a76f245,
+ .id = "Bare_Server_DH_inner_data",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_set_client_d_h_params_answer = {
+ .name = 0xdb8a468f,
+ .id = "Set_client_DH_params_answer"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_set_client_d_h_params_answer = {
+ .name = 0x2475b970,
+ .id = "Bare_Set_client_DH_params_answer",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_sticker_pack = {
+ .name = 0x12b299d4,
+ .id = "StickerPack"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_sticker_pack = {
+ .name = 0xed4d662b,
+ .id = "Bare_StickerPack",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_sticker_set = {
+ .name = 0xa7a43b17,
+ .id = "StickerSet"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_sticker_set = {
+ .name = 0x585bc4e8,
+ .id = "Bare_StickerSet",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_string = {
+ .name = 0xb5286e24,
+ .id = "String"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_string = {
+ .name = 0x4ad791db,
+ .id = "Bare_String",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_update = {
+ .name = 0x2e02b27e,
+ .id = "Update"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_update = {
+ .name = 0xd1fd4d81,
+ .id = "Bare_Update",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_updates = {
+ .name = 0x22499d27,
+ .id = "Updates"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_updates = {
+ .name = 0xddb662d8,
+ .id = "Bare_Updates",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_user = {
+ .name = 0x02e6c0c8,
+ .id = "User"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_user = {
+ .name = 0xfd193f37,
+ .id = "Bare_User",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_user_full = {
+ .name = 0x5a89ac5b,
+ .id = "UserFull"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_user_full = {
+ .name = 0xa57653a4,
+ .id = "Bare_UserFull",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_user_profile_photo = {
+ .name = 0x9a486229,
+ .id = "UserProfilePhoto"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_user_profile_photo = {
+ .name = 0x65b79dd6,
+ .id = "Bare_UserProfilePhoto",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_user_status = {
+ .name = 0x76de9570,
+ .id = "UserStatus"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_user_status = {
+ .name = 0x89216a8f,
+ .id = "Bare_UserStatus",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_vector = {
+ .name = 0x1cb5c415,
+ .id = "Vector"
+, .params_num = 1,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_vector = {
+ .name = 0xe34a3bea,
+ .id = "Bare_Vector",
+ .params_num = 1,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_video = {
+ .name = 0x1716b174,
+ .id = "Video"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_video = {
+ .name = 0xe8e94e8b,
+ .id = "Bare_Video",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_wall_paper = {
+ .name = 0xafa14973,
+ .id = "WallPaper"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_wall_paper = {
+ .name = 0x505eb68c,
+ .id = "Bare_WallPaper",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_web_page = {
+ .name = 0x8d8c0d41,
+ .id = "WebPage"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_web_page = {
+ .name = 0x7273f2be,
+ .id = "Bare_WebPage",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_account_authorizations = {
+ .name = 0x1250abde,
+ .id = "account.Authorizations"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_account_authorizations = {
+ .name = 0xedaf5421,
+ .id = "Bare_account.Authorizations",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_account_password = {
+ .name = 0xeac2a804,
+ .id = "account.Password"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_account_password = {
+ .name = 0x153d57fb,
+ .id = "Bare_account.Password",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_account_password_input_settings = {
+ .name = 0xbcfc532c,
+ .id = "account.PasswordInputSettings"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_account_password_input_settings = {
+ .name = 0x4303acd3,
+ .id = "Bare_account.PasswordInputSettings",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_account_password_settings = {
+ .name = 0xb7b72ab3,
+ .id = "account.PasswordSettings"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_account_password_settings = {
+ .name = 0x4848d54c,
+ .id = "Bare_account.PasswordSettings",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_account_privacy_rules = {
+ .name = 0x554abb6f,
+ .id = "account.PrivacyRules"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_account_privacy_rules = {
+ .name = 0xaab54490,
+ .id = "Bare_account.PrivacyRules",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_account_sent_change_phone_code = {
+ .name = 0xa4f58c4c,
+ .id = "account.SentChangePhoneCode"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_account_sent_change_phone_code = {
+ .name = 0x5b0a73b3,
+ .id = "Bare_account.SentChangePhoneCode",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_auth_authorization = {
+ .name = 0xff036af1,
+ .id = "auth.Authorization"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_auth_authorization = {
+ .name = 0x00fc950e,
+ .id = "Bare_auth.Authorization",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_auth_checked_phone = {
+ .name = 0x811ea28e,
+ .id = "auth.CheckedPhone"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_auth_checked_phone = {
+ .name = 0x7ee15d71,
+ .id = "Bare_auth.CheckedPhone",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_auth_exported_authorization = {
+ .name = 0xdf969c2d,
+ .id = "auth.ExportedAuthorization"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_auth_exported_authorization = {
+ .name = 0x206963d2,
+ .id = "Bare_auth.ExportedAuthorization",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_auth_password_recovery = {
+ .name = 0x137948a5,
+ .id = "auth.PasswordRecovery"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_auth_password_recovery = {
+ .name = 0xec86b75a,
+ .id = "Bare_auth.PasswordRecovery",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_auth_sent_code = {
+ .name = 0x0cc8bc16,
+ .id = "auth.SentCode"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_auth_sent_code = {
+ .name = 0xf33743e9,
+ .id = "Bare_auth.SentCode",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_binlog_encr_key = {
+ .name = 0x0377168f,
+ .id = "binlog.EncrKey"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_binlog_encr_key = {
+ .name = 0xfc88e970,
+ .id = "Bare_binlog.EncrKey",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_binlog_update = {
+ .name = 0x66ff03a6,
+ .id = "binlog.Update"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_binlog_update = {
+ .name = 0x9900fc59,
+ .id = "Bare_binlog.Update",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_contacts_blocked = {
+ .name = 0x8c1b8fb4,
+ .id = "contacts.Blocked"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_contacts_blocked = {
+ .name = 0x73e4704b,
+ .id = "Bare_contacts.Blocked",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_contacts_contacts = {
+ .name = 0xd8c02560,
+ .id = "contacts.Contacts"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_contacts_contacts = {
+ .name = 0x273fda9f,
+ .id = "Bare_contacts.Contacts",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_contacts_found = {
+ .name = 0x0566000e,
+ .id = "contacts.Found"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_contacts_found = {
+ .name = 0xfa99fff1,
+ .id = "Bare_contacts.Found",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_contacts_imported_contacts = {
+ .name = 0xad524315,
+ .id = "contacts.ImportedContacts"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_contacts_imported_contacts = {
+ .name = 0x52adbcea,
+ .id = "Bare_contacts.ImportedContacts",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_contacts_link = {
+ .name = 0x3ace484c,
+ .id = "contacts.Link"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_contacts_link = {
+ .name = 0xc531b7b3,
+ .id = "Bare_contacts.Link",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_contacts_suggested = {
+ .name = 0x5649dcc5,
+ .id = "contacts.Suggested"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_contacts_suggested = {
+ .name = 0xa9b6233a,
+ .id = "Bare_contacts.Suggested",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_geochats_located = {
+ .name = 0x48feb267,
+ .id = "geochats.Located"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_geochats_located = {
+ .name = 0xb7014d98,
+ .id = "Bare_geochats.Located",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_geochats_messages = {
+ .name = 0x6d0a0e59,
+ .id = "geochats.Messages"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_geochats_messages = {
+ .name = 0x92f5f1a6,
+ .id = "Bare_geochats.Messages",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_geochats_stated_message = {
+ .name = 0x17b1578b,
+ .id = "geochats.StatedMessage"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_geochats_stated_message = {
+ .name = 0xe84ea874,
+ .id = "Bare_geochats.StatedMessage",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_help_app_update = {
+ .name = 0x4ddd9627,
+ .id = "help.AppUpdate"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_help_app_update = {
+ .name = 0xb22269d8,
+ .id = "Bare_help.AppUpdate",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_help_invite_text = {
+ .name = 0x18cb9f78,
+ .id = "help.InviteText"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_help_invite_text = {
+ .name = 0xe7346087,
+ .id = "Bare_help.InviteText",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_help_support = {
+ .name = 0x17c6b5f6,
+ .id = "help.Support"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_help_support = {
+ .name = 0xe8394a09,
+ .id = "Bare_help.Support",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_messages_affected_history = {
+ .name = 0xb45c69d1,
+ .id = "messages.AffectedHistory"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_messages_affected_history = {
+ .name = 0x4ba3962e,
+ .id = "Bare_messages.AffectedHistory",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_messages_affected_messages = {
+ .name = 0x84d19185,
+ .id = "messages.AffectedMessages"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_messages_affected_messages = {
+ .name = 0x7b2e6e7a,
+ .id = "Bare_messages.AffectedMessages",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_messages_all_stickers = {
+ .name = 0xb485502f,
+ .id = "messages.AllStickers"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_messages_all_stickers = {
+ .name = 0x4b7aafd0,
+ .id = "Bare_messages.AllStickers",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_messages_chat_full = {
+ .name = 0xe5d7d19c,
+ .id = "messages.ChatFull"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_messages_chat_full = {
+ .name = 0x1a282e63,
+ .id = "Bare_messages.ChatFull",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_messages_chats = {
+ .name = 0x64ff9fd5,
+ .id = "messages.Chats"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_messages_chats = {
+ .name = 0x9b00602a,
+ .id = "Bare_messages.Chats",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_messages_dh_config = {
+ .name = 0xecc058e8,
+ .id = "messages.DhConfig"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_messages_dh_config = {
+ .name = 0x133fa717,
+ .id = "Bare_messages.DhConfig",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_messages_dialogs = {
+ .name = 0x645af8b3,
+ .id = "messages.Dialogs"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_messages_dialogs = {
+ .name = 0x9ba5074c,
+ .id = "Bare_messages.Dialogs",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_messages_message = {
+ .name = 0x3f4e0648,
+ .id = "messages.Message"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_messages_message = {
+ .name = 0xc0b1f9b7,
+ .id = "Bare_messages.Message",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_messages_messages = {
+ .name = 0x8735e464,
+ .id = "messages.Messages"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_messages_messages = {
+ .name = 0x78ca1b9b,
+ .id = "Bare_messages.Messages",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_messages_sent_encrypted_message = {
+ .name = 0xc29c7607,
+ .id = "messages.SentEncryptedMessage"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_messages_sent_encrypted_message = {
+ .name = 0x3d6389f8,
+ .id = "Bare_messages.SentEncryptedMessage",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_messages_sent_message = {
+ .name = 0x799ce190,
+ .id = "messages.SentMessage"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_messages_sent_message = {
+ .name = 0x86631e6f,
+ .id = "Bare_messages.SentMessage",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_messages_sticker_set = {
+ .name = 0xb60a24a6,
+ .id = "messages.StickerSet"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_messages_sticker_set = {
+ .name = 0x49f5db59,
+ .id = "Bare_messages.StickerSet",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_messages_stickers = {
+ .name = 0x7bfa5710,
+ .id = "messages.Stickers"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_messages_stickers = {
+ .name = 0x8405a8ef,
+ .id = "Bare_messages.Stickers",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_photos_photo = {
+ .name = 0x20212ca8,
+ .id = "photos.Photo"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_photos_photo = {
+ .name = 0xdfded357,
+ .id = "Bare_photos.Photo",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_photos_photos = {
+ .name = 0x98cf75f1,
+ .id = "photos.Photos"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_photos_photos = {
+ .name = 0x67308a0e,
+ .id = "Bare_photos.Photos",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_storage_file_type = {
+ .name = 0x3e2838a8,
+ .id = "storage.FileType"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_storage_file_type = {
+ .name = 0xc1d7c757,
+ .id = "Bare_storage.FileType",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_updates_difference = {
+ .name = 0xf57a2419,
+ .id = "updates.Difference"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_updates_difference = {
+ .name = 0x0a85dbe6,
+ .id = "Bare_updates.Difference",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_updates_state = {
+ .name = 0xa56c2a3e,
+ .id = "updates.State"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_updates_state = {
+ .name = 0x5a93d5c1,
+ .id = "Bare_updates.State",
+ .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_upload_file = {
+ .name = 0x096a18d5,
+ .id = "upload.File"
+, .params_num = 0,
+ .params_types = 0
+};
+struct tl_type_descr tl_type_bare_upload_file = {
+ .name = 0xf695e72a,
+ .id = "Bare_upload.File",
+ .params_num = 0,
+ .params_types = 0
+};
diff --git a/protocols/Telegram/tgl/auto/auto-types.h b/protocols/Telegram/tgl/auto/auto-types.h
new file mode 100644
index 0000000000..74e8de9039
--- /dev/null
+++ b/protocols/Telegram/tgl/auto/auto-types.h
@@ -0,0 +1,1589 @@
+#ifndef __AUTO_TYPES_H__
+#define __AUTO_TYPES_H__
+#ifdef _MSC_VER
+#include "..\auto.h"
+#else
+#include "auto.h"
+#endif
+extern struct tl_type_descr tl_type_account_days_t_t_l;
+extern struct tl_type_descr tl_type_bare_account_days_t_t_l;
+extern struct tl_type_descr tl_type_audio;
+extern struct tl_type_descr tl_type_bare_audio;
+extern struct tl_type_descr tl_type_authorization;
+extern struct tl_type_descr tl_type_bare_authorization;
+extern struct tl_type_descr tl_type_bool;
+extern struct tl_type_descr tl_type_bare_bool;
+extern struct tl_type_descr tl_type_bot_command;
+extern struct tl_type_descr tl_type_bare_bot_command;
+extern struct tl_type_descr tl_type_bot_info;
+extern struct tl_type_descr tl_type_bare_bot_info;
+extern struct tl_type_descr tl_type_bytes;
+extern struct tl_type_descr tl_type_bare_bytes;
+extern struct tl_type_descr tl_type_chat;
+extern struct tl_type_descr tl_type_bare_chat;
+extern struct tl_type_descr tl_type_chat_full;
+extern struct tl_type_descr tl_type_bare_chat_full;
+extern struct tl_type_descr tl_type_chat_invite;
+extern struct tl_type_descr tl_type_bare_chat_invite;
+extern struct tl_type_descr tl_type_chat_located;
+extern struct tl_type_descr tl_type_bare_chat_located;
+extern struct tl_type_descr tl_type_chat_participant;
+extern struct tl_type_descr tl_type_bare_chat_participant;
+extern struct tl_type_descr tl_type_chat_participants;
+extern struct tl_type_descr tl_type_bare_chat_participants;
+extern struct tl_type_descr tl_type_chat_photo;
+extern struct tl_type_descr tl_type_bare_chat_photo;
+extern struct tl_type_descr tl_type_client_d_h_inner_data;
+extern struct tl_type_descr tl_type_bare_client_d_h_inner_data;
+extern struct tl_type_descr tl_type_config;
+extern struct tl_type_descr tl_type_bare_config;
+extern struct tl_type_descr tl_type_contact;
+extern struct tl_type_descr tl_type_bare_contact;
+extern struct tl_type_descr tl_type_contact_blocked;
+extern struct tl_type_descr tl_type_bare_contact_blocked;
+extern struct tl_type_descr tl_type_contact_found;
+extern struct tl_type_descr tl_type_bare_contact_found;
+extern struct tl_type_descr tl_type_contact_link;
+extern struct tl_type_descr tl_type_bare_contact_link;
+extern struct tl_type_descr tl_type_contact_status;
+extern struct tl_type_descr tl_type_bare_contact_status;
+extern struct tl_type_descr tl_type_contact_suggested;
+extern struct tl_type_descr tl_type_bare_contact_suggested;
+extern struct tl_type_descr tl_type_dc_option;
+extern struct tl_type_descr tl_type_bare_dc_option;
+extern struct tl_type_descr tl_type_decrypted_message;
+extern struct tl_type_descr tl_type_bare_decrypted_message;
+extern struct tl_type_descr tl_type_decrypted_message_action;
+extern struct tl_type_descr tl_type_bare_decrypted_message_action;
+extern struct tl_type_descr tl_type_decrypted_message_layer;
+extern struct tl_type_descr tl_type_bare_decrypted_message_layer;
+extern struct tl_type_descr tl_type_decrypted_message_media;
+extern struct tl_type_descr tl_type_bare_decrypted_message_media;
+extern struct tl_type_descr tl_type_dialog;
+extern struct tl_type_descr tl_type_bare_dialog;
+extern struct tl_type_descr tl_type_disabled_feature;
+extern struct tl_type_descr tl_type_bare_disabled_feature;
+extern struct tl_type_descr tl_type_document;
+extern struct tl_type_descr tl_type_bare_document;
+extern struct tl_type_descr tl_type_document_attribute;
+extern struct tl_type_descr tl_type_bare_document_attribute;
+extern struct tl_type_descr tl_type_double;
+extern struct tl_type_descr tl_type_bare_double;
+extern struct tl_type_descr tl_type_encrypted_chat;
+extern struct tl_type_descr tl_type_bare_encrypted_chat;
+extern struct tl_type_descr tl_type_encrypted_file;
+extern struct tl_type_descr tl_type_bare_encrypted_file;
+extern struct tl_type_descr tl_type_encrypted_message;
+extern struct tl_type_descr tl_type_bare_encrypted_message;
+extern struct tl_type_descr tl_type_error;
+extern struct tl_type_descr tl_type_bare_error;
+extern struct tl_type_descr tl_type_exported_chat_invite;
+extern struct tl_type_descr tl_type_bare_exported_chat_invite;
+extern struct tl_type_descr tl_type_file_location;
+extern struct tl_type_descr tl_type_bare_file_location;
+extern struct tl_type_descr tl_type_geo_chat_message;
+extern struct tl_type_descr tl_type_bare_geo_chat_message;
+extern struct tl_type_descr tl_type_geo_point;
+extern struct tl_type_descr tl_type_bare_geo_point;
+extern struct tl_type_descr tl_type_imported_contact;
+extern struct tl_type_descr tl_type_bare_imported_contact;
+extern struct tl_type_descr tl_type_input_app_event;
+extern struct tl_type_descr tl_type_bare_input_app_event;
+extern struct tl_type_descr tl_type_input_audio;
+extern struct tl_type_descr tl_type_bare_input_audio;
+extern struct tl_type_descr tl_type_input_chat_photo;
+extern struct tl_type_descr tl_type_bare_input_chat_photo;
+extern struct tl_type_descr tl_type_input_contact;
+extern struct tl_type_descr tl_type_bare_input_contact;
+extern struct tl_type_descr tl_type_input_document;
+extern struct tl_type_descr tl_type_bare_input_document;
+extern struct tl_type_descr tl_type_input_encrypted_chat;
+extern struct tl_type_descr tl_type_bare_input_encrypted_chat;
+extern struct tl_type_descr tl_type_input_encrypted_file;
+extern struct tl_type_descr tl_type_bare_input_encrypted_file;
+extern struct tl_type_descr tl_type_input_file;
+extern struct tl_type_descr tl_type_bare_input_file;
+extern struct tl_type_descr tl_type_input_file_location;
+extern struct tl_type_descr tl_type_bare_input_file_location;
+extern struct tl_type_descr tl_type_input_geo_chat;
+extern struct tl_type_descr tl_type_bare_input_geo_chat;
+extern struct tl_type_descr tl_type_input_geo_point;
+extern struct tl_type_descr tl_type_bare_input_geo_point;
+extern struct tl_type_descr tl_type_input_media;
+extern struct tl_type_descr tl_type_bare_input_media;
+extern struct tl_type_descr tl_type_input_notify_peer;
+extern struct tl_type_descr tl_type_bare_input_notify_peer;
+extern struct tl_type_descr tl_type_input_peer;
+extern struct tl_type_descr tl_type_bare_input_peer;
+extern struct tl_type_descr tl_type_input_peer_notify_events;
+extern struct tl_type_descr tl_type_bare_input_peer_notify_events;
+extern struct tl_type_descr tl_type_input_peer_notify_settings;
+extern struct tl_type_descr tl_type_bare_input_peer_notify_settings;
+extern struct tl_type_descr tl_type_input_photo;
+extern struct tl_type_descr tl_type_bare_input_photo;
+extern struct tl_type_descr tl_type_input_photo_crop;
+extern struct tl_type_descr tl_type_bare_input_photo_crop;
+extern struct tl_type_descr tl_type_input_privacy_key;
+extern struct tl_type_descr tl_type_bare_input_privacy_key;
+extern struct tl_type_descr tl_type_input_privacy_rule;
+extern struct tl_type_descr tl_type_bare_input_privacy_rule;
+extern struct tl_type_descr tl_type_input_sticker_set;
+extern struct tl_type_descr tl_type_bare_input_sticker_set;
+extern struct tl_type_descr tl_type_input_user;
+extern struct tl_type_descr tl_type_bare_input_user;
+extern struct tl_type_descr tl_type_input_video;
+extern struct tl_type_descr tl_type_bare_input_video;
+extern struct tl_type_descr tl_type_int;
+extern struct tl_type_descr tl_type_bare_int;
+extern struct tl_type_descr tl_type_int128;
+extern struct tl_type_descr tl_type_bare_int128;
+extern struct tl_type_descr tl_type_int256;
+extern struct tl_type_descr tl_type_bare_int256;
+extern struct tl_type_descr tl_type_keyboard_button;
+extern struct tl_type_descr tl_type_bare_keyboard_button;
+extern struct tl_type_descr tl_type_keyboard_button_row;
+extern struct tl_type_descr tl_type_bare_keyboard_button_row;
+extern struct tl_type_descr tl_type_long;
+extern struct tl_type_descr tl_type_bare_long;
+extern struct tl_type_descr tl_type_message;
+extern struct tl_type_descr tl_type_bare_message;
+extern struct tl_type_descr tl_type_message_action;
+extern struct tl_type_descr tl_type_bare_message_action;
+extern struct tl_type_descr tl_type_message_media;
+extern struct tl_type_descr tl_type_bare_message_media;
+extern struct tl_type_descr tl_type_messages_filter;
+extern struct tl_type_descr tl_type_bare_messages_filter;
+extern struct tl_type_descr tl_type_nearest_dc;
+extern struct tl_type_descr tl_type_bare_nearest_dc;
+extern struct tl_type_descr tl_type_notify_peer;
+extern struct tl_type_descr tl_type_bare_notify_peer;
+extern struct tl_type_descr tl_type_null;
+extern struct tl_type_descr tl_type_bare_null;
+extern struct tl_type_descr tl_type_p_q_inner_data;
+extern struct tl_type_descr tl_type_bare_p_q_inner_data;
+extern struct tl_type_descr tl_type_peer;
+extern struct tl_type_descr tl_type_bare_peer;
+extern struct tl_type_descr tl_type_peer_notify_events;
+extern struct tl_type_descr tl_type_bare_peer_notify_events;
+extern struct tl_type_descr tl_type_peer_notify_settings;
+extern struct tl_type_descr tl_type_bare_peer_notify_settings;
+extern struct tl_type_descr tl_type_photo;
+extern struct tl_type_descr tl_type_bare_photo;
+extern struct tl_type_descr tl_type_photo_size;
+extern struct tl_type_descr tl_type_bare_photo_size;
+extern struct tl_type_descr tl_type_privacy_key;
+extern struct tl_type_descr tl_type_bare_privacy_key;
+extern struct tl_type_descr tl_type_privacy_rule;
+extern struct tl_type_descr tl_type_bare_privacy_rule;
+extern struct tl_type_descr tl_type_received_notify_message;
+extern struct tl_type_descr tl_type_bare_received_notify_message;
+extern struct tl_type_descr tl_type_reply_markup;
+extern struct tl_type_descr tl_type_bare_reply_markup;
+extern struct tl_type_descr tl_type_res_p_q;
+extern struct tl_type_descr tl_type_bare_res_p_q;
+extern struct tl_type_descr tl_type_send_message_action;
+extern struct tl_type_descr tl_type_bare_send_message_action;
+extern struct tl_type_descr tl_type_server_d_h_params;
+extern struct tl_type_descr tl_type_bare_server_d_h_params;
+extern struct tl_type_descr tl_type_server_d_h_inner_data;
+extern struct tl_type_descr tl_type_bare_server_d_h_inner_data;
+extern struct tl_type_descr tl_type_set_client_d_h_params_answer;
+extern struct tl_type_descr tl_type_bare_set_client_d_h_params_answer;
+extern struct tl_type_descr tl_type_sticker_pack;
+extern struct tl_type_descr tl_type_bare_sticker_pack;
+extern struct tl_type_descr tl_type_sticker_set;
+extern struct tl_type_descr tl_type_bare_sticker_set;
+extern struct tl_type_descr tl_type_string;
+extern struct tl_type_descr tl_type_bare_string;
+extern struct tl_type_descr tl_type_update;
+extern struct tl_type_descr tl_type_bare_update;
+extern struct tl_type_descr tl_type_updates;
+extern struct tl_type_descr tl_type_bare_updates;
+extern struct tl_type_descr tl_type_user;
+extern struct tl_type_descr tl_type_bare_user;
+extern struct tl_type_descr tl_type_user_full;
+extern struct tl_type_descr tl_type_bare_user_full;
+extern struct tl_type_descr tl_type_user_profile_photo;
+extern struct tl_type_descr tl_type_bare_user_profile_photo;
+extern struct tl_type_descr tl_type_user_status;
+extern struct tl_type_descr tl_type_bare_user_status;
+extern struct tl_type_descr tl_type_vector;
+extern struct tl_type_descr tl_type_bare_vector;
+extern struct tl_type_descr tl_type_video;
+extern struct tl_type_descr tl_type_bare_video;
+extern struct tl_type_descr tl_type_wall_paper;
+extern struct tl_type_descr tl_type_bare_wall_paper;
+extern struct tl_type_descr tl_type_web_page;
+extern struct tl_type_descr tl_type_bare_web_page;
+extern struct tl_type_descr tl_type_account_authorizations;
+extern struct tl_type_descr tl_type_bare_account_authorizations;
+extern struct tl_type_descr tl_type_account_password;
+extern struct tl_type_descr tl_type_bare_account_password;
+extern struct tl_type_descr tl_type_account_password_input_settings;
+extern struct tl_type_descr tl_type_bare_account_password_input_settings;
+extern struct tl_type_descr tl_type_account_password_settings;
+extern struct tl_type_descr tl_type_bare_account_password_settings;
+extern struct tl_type_descr tl_type_account_privacy_rules;
+extern struct tl_type_descr tl_type_bare_account_privacy_rules;
+extern struct tl_type_descr tl_type_account_sent_change_phone_code;
+extern struct tl_type_descr tl_type_bare_account_sent_change_phone_code;
+extern struct tl_type_descr tl_type_auth_authorization;
+extern struct tl_type_descr tl_type_bare_auth_authorization;
+extern struct tl_type_descr tl_type_auth_checked_phone;
+extern struct tl_type_descr tl_type_bare_auth_checked_phone;
+extern struct tl_type_descr tl_type_auth_exported_authorization;
+extern struct tl_type_descr tl_type_bare_auth_exported_authorization;
+extern struct tl_type_descr tl_type_auth_password_recovery;
+extern struct tl_type_descr tl_type_bare_auth_password_recovery;
+extern struct tl_type_descr tl_type_auth_sent_code;
+extern struct tl_type_descr tl_type_bare_auth_sent_code;
+extern struct tl_type_descr tl_type_binlog_encr_key;
+extern struct tl_type_descr tl_type_bare_binlog_encr_key;
+extern struct tl_type_descr tl_type_binlog_update;
+extern struct tl_type_descr tl_type_bare_binlog_update;
+extern struct tl_type_descr tl_type_contacts_blocked;
+extern struct tl_type_descr tl_type_bare_contacts_blocked;
+extern struct tl_type_descr tl_type_contacts_contacts;
+extern struct tl_type_descr tl_type_bare_contacts_contacts;
+extern struct tl_type_descr tl_type_contacts_found;
+extern struct tl_type_descr tl_type_bare_contacts_found;
+extern struct tl_type_descr tl_type_contacts_imported_contacts;
+extern struct tl_type_descr tl_type_bare_contacts_imported_contacts;
+extern struct tl_type_descr tl_type_contacts_link;
+extern struct tl_type_descr tl_type_bare_contacts_link;
+extern struct tl_type_descr tl_type_contacts_suggested;
+extern struct tl_type_descr tl_type_bare_contacts_suggested;
+extern struct tl_type_descr tl_type_geochats_located;
+extern struct tl_type_descr tl_type_bare_geochats_located;
+extern struct tl_type_descr tl_type_geochats_messages;
+extern struct tl_type_descr tl_type_bare_geochats_messages;
+extern struct tl_type_descr tl_type_geochats_stated_message;
+extern struct tl_type_descr tl_type_bare_geochats_stated_message;
+extern struct tl_type_descr tl_type_help_app_update;
+extern struct tl_type_descr tl_type_bare_help_app_update;
+extern struct tl_type_descr tl_type_help_invite_text;
+extern struct tl_type_descr tl_type_bare_help_invite_text;
+extern struct tl_type_descr tl_type_help_support;
+extern struct tl_type_descr tl_type_bare_help_support;
+extern struct tl_type_descr tl_type_messages_affected_history;
+extern struct tl_type_descr tl_type_bare_messages_affected_history;
+extern struct tl_type_descr tl_type_messages_affected_messages;
+extern struct tl_type_descr tl_type_bare_messages_affected_messages;
+extern struct tl_type_descr tl_type_messages_all_stickers;
+extern struct tl_type_descr tl_type_bare_messages_all_stickers;
+extern struct tl_type_descr tl_type_messages_chat_full;
+extern struct tl_type_descr tl_type_bare_messages_chat_full;
+extern struct tl_type_descr tl_type_messages_chats;
+extern struct tl_type_descr tl_type_bare_messages_chats;
+extern struct tl_type_descr tl_type_messages_dh_config;
+extern struct tl_type_descr tl_type_bare_messages_dh_config;
+extern struct tl_type_descr tl_type_messages_dialogs;
+extern struct tl_type_descr tl_type_bare_messages_dialogs;
+extern struct tl_type_descr tl_type_messages_message;
+extern struct tl_type_descr tl_type_bare_messages_message;
+extern struct tl_type_descr tl_type_messages_messages;
+extern struct tl_type_descr tl_type_bare_messages_messages;
+extern struct tl_type_descr tl_type_messages_sent_encrypted_message;
+extern struct tl_type_descr tl_type_bare_messages_sent_encrypted_message;
+extern struct tl_type_descr tl_type_messages_sent_message;
+extern struct tl_type_descr tl_type_bare_messages_sent_message;
+extern struct tl_type_descr tl_type_messages_sticker_set;
+extern struct tl_type_descr tl_type_bare_messages_sticker_set;
+extern struct tl_type_descr tl_type_messages_stickers;
+extern struct tl_type_descr tl_type_bare_messages_stickers;
+extern struct tl_type_descr tl_type_photos_photo;
+extern struct tl_type_descr tl_type_bare_photos_photo;
+extern struct tl_type_descr tl_type_photos_photos;
+extern struct tl_type_descr tl_type_bare_photos_photos;
+extern struct tl_type_descr tl_type_storage_file_type;
+extern struct tl_type_descr tl_type_bare_storage_file_type;
+extern struct tl_type_descr tl_type_updates_difference;
+extern struct tl_type_descr tl_type_bare_updates_difference;
+extern struct tl_type_descr tl_type_updates_state;
+extern struct tl_type_descr tl_type_bare_updates_state;
+extern struct tl_type_descr tl_type_upload_file;
+extern struct tl_type_descr tl_type_bare_upload_file;
+struct tl_ds_account_days_t_t_l {
+ int *days;
+};
+struct tl_ds_audio {
+ unsigned magic;
+ long long *id;
+ long long *access_hash;
+ int *user_id;
+ int *date;
+ int *duration;
+ struct tl_ds_string *mime_type;
+ int *size;
+ int *dc_id;
+};
+struct tl_ds_authorization {
+ long long *hash;
+ int *flags;
+ struct tl_ds_string *device_model;
+ struct tl_ds_string *platform;
+ struct tl_ds_string *system_version;
+ int *api_id;
+ struct tl_ds_string *app_name;
+ struct tl_ds_string *app_version;
+ int *date_created;
+ int *date_active;
+ struct tl_ds_string *ip;
+ struct tl_ds_string *country;
+ struct tl_ds_string *region;
+};
+struct tl_ds_bool {
+ unsigned magic;
+};
+struct tl_ds_bot_command {
+ unsigned magic;
+ struct tl_ds_string *command;
+ struct tl_ds_string *description;
+ struct tl_ds_string *params;
+};
+struct tl_ds_bot_info {
+ unsigned magic;
+ int *user_id;
+ int *version;
+ struct tl_ds_string *share_text;
+ struct tl_ds_string *description;
+ struct {
+ int *cnt;
+ struct tl_ds_bot_command **data;
+ } *commands;
+};
+struct tl_ds_bytes {
+ int len;
+ char *data;
+};
+struct tl_ds_chat {
+ unsigned magic;
+ int *id;
+ struct tl_ds_string *title;
+ struct tl_ds_chat_photo *photo;
+ int *participants_count;
+ int *date;
+ struct tl_ds_bool *left;
+ int *version;
+ long long *access_hash;
+ struct tl_ds_string *address;
+ struct tl_ds_string *venue;
+ struct tl_ds_geo_point *geo;
+ struct tl_ds_bool *checked_in;
+};
+struct tl_ds_chat_full {
+ int *id;
+ struct tl_ds_chat_participants *participants;
+ struct tl_ds_photo *chat_photo;
+ struct tl_ds_peer_notify_settings *notify_settings;
+ struct tl_ds_exported_chat_invite *exported_invite;
+ struct {
+ int *cnt;
+ struct tl_ds_bot_info **data;
+ } *bot_info;
+};
+struct tl_ds_chat_invite {
+ unsigned magic;
+ struct tl_ds_chat *chat;
+ struct tl_ds_string *title;
+};
+struct tl_ds_chat_located {
+ int *chat_id;
+ int *distance;
+};
+struct tl_ds_chat_participant {
+ int *user_id;
+ int *inviter_id;
+ int *date;
+};
+struct tl_ds_chat_participants {
+ unsigned magic;
+ int *chat_id;
+ int *admin_id;
+ struct {
+ int *cnt;
+ struct tl_ds_chat_participant **data;
+ } *participants;
+ int *version;
+};
+struct tl_ds_chat_photo {
+ unsigned magic;
+ struct tl_ds_file_location *photo_small;
+ struct tl_ds_file_location *photo_big;
+};
+struct tl_ds_client_d_h_inner_data {
+ struct tl_ds_int128 *nonce;
+ struct tl_ds_int128 *server_nonce;
+ long long *retry_id;
+ struct tl_ds_string *g_b;
+};
+struct tl_ds_config {
+ int *date;
+ int *expires;
+ struct tl_ds_bool *test_mode;
+ int *this_dc;
+ struct {
+ int *cnt;
+ struct tl_ds_dc_option **data;
+ } *dc_options;
+ int *chat_size_max;
+ int *broadcast_size_max;
+ int *forwarded_count_max;
+ int *online_update_period_ms;
+ int *offline_blur_timeout_ms;
+ int *offline_idle_timeout_ms;
+ int *online_cloud_timeout_ms;
+ int *notify_cloud_delay_ms;
+ int *notify_default_delay_ms;
+ int *chat_big_size;
+ int *push_chat_period_ms;
+ int *push_chat_limit;
+ struct {
+ int *cnt;
+ struct tl_ds_disabled_feature **data;
+ } *disabled_features;
+};
+struct tl_ds_contact {
+ int *user_id;
+ struct tl_ds_bool *mutual;
+};
+struct tl_ds_contact_blocked {
+ int *user_id;
+ int *date;
+};
+struct tl_ds_contact_found {
+ int *user_id;
+};
+struct tl_ds_contact_link {
+ unsigned magic;
+};
+struct tl_ds_contact_status {
+ int *user_id;
+ struct tl_ds_user_status *status;
+};
+struct tl_ds_contact_suggested {
+ int *user_id;
+ int *mutual_contacts;
+};
+struct tl_ds_dc_option {
+ unsigned magic;
+ int *id;
+ struct tl_ds_string *hostname;
+ struct tl_ds_string *ip_address;
+ int *port;
+ int *flags;
+};
+struct tl_ds_decrypted_message {
+ unsigned magic;
+ long long *random_id;
+ int *ttl;
+ struct tl_ds_string *message;
+ struct tl_ds_decrypted_message_media *media;
+ struct tl_ds_decrypted_message_action *action;
+};
+struct tl_ds_decrypted_message_action {
+ unsigned magic;
+ int *ttl_seconds;
+ struct {
+ int *cnt;
+ long long **data;
+ } *random_ids;
+ int *start_seq_no;
+ int *end_seq_no;
+ int *layer;
+ struct tl_ds_send_message_action *action;
+ long long *exchange_id;
+ struct tl_ds_string *g_a;
+ struct tl_ds_string *g_b;
+ long long *key_fingerprint;
+};
+struct tl_ds_decrypted_message_layer {
+ struct tl_ds_string *random_bytes;
+ int *layer;
+ int *in_seq_no;
+ int *out_seq_no;
+ struct tl_ds_decrypted_message *message;
+};
+struct tl_ds_decrypted_message_media {
+ unsigned magic;
+ struct tl_ds_string *str_thumb;
+ int *thumb_w;
+ int *thumb_h;
+ int *w;
+ int *h;
+ int *size;
+ struct tl_ds_string *key;
+ struct tl_ds_string *iv;
+ double *latitude;
+ double *longitude;
+ struct tl_ds_string *phone_number;
+ struct tl_ds_string *first_name;
+ struct tl_ds_string *last_name;
+ int *user_id;
+ struct tl_ds_string *file_name;
+ struct tl_ds_string *mime_type;
+ int *duration;
+ long long *id;
+ long long *access_hash;
+ int *date;
+ struct tl_ds_photo_size *thumb;
+ int *dc_id;
+ struct {
+ int *cnt;
+ struct tl_ds_document_attribute **data;
+ } *attributes;
+};
+struct tl_ds_dialog {
+ struct tl_ds_peer *peer;
+ int *top_message;
+ int *read_inbox_max_id;
+ int *unread_count;
+ struct tl_ds_peer_notify_settings *notify_settings;
+};
+struct tl_ds_disabled_feature {
+ struct tl_ds_string *feature;
+ struct tl_ds_string *description;
+};
+struct tl_ds_document {
+ unsigned magic;
+ long long *id;
+ long long *access_hash;
+ int *date;
+ struct tl_ds_string *mime_type;
+ int *size;
+ struct tl_ds_photo_size *thumb;
+ int *dc_id;
+ struct {
+ int *cnt;
+ struct tl_ds_document_attribute **data;
+ } *attributes;
+ int *user_id;
+ struct tl_ds_string *file_name;
+};
+struct tl_ds_document_attribute {
+ unsigned magic;
+ int *w;
+ int *h;
+ struct tl_ds_string *alt;
+ struct tl_ds_input_sticker_set *stickerset;
+ int *duration;
+ struct tl_ds_string *file_name;
+};
+struct tl_ds_double {
+ int : 0;
+};
+struct tl_ds_encrypted_chat {
+ unsigned magic;
+ int *id;
+ long long *access_hash;
+ int *date;
+ int *admin_id;
+ int *participant_id;
+ struct tl_ds_string *g_a;
+ struct tl_ds_string *g_a_or_b;
+ long long *key_fingerprint;
+};
+struct tl_ds_encrypted_file {
+ unsigned magic;
+ long long *id;
+ long long *access_hash;
+ int *size;
+ int *dc_id;
+ int *key_fingerprint;
+};
+struct tl_ds_encrypted_message {
+ unsigned magic;
+ long long *random_id;
+ int *chat_id;
+ int *date;
+ struct tl_ds_string *bytes;
+ struct tl_ds_encrypted_file *file;
+};
+struct tl_ds_error {
+ int *code;
+ struct tl_ds_string *text;
+};
+struct tl_ds_exported_chat_invite {
+ unsigned magic;
+ struct tl_ds_string *link;
+};
+struct tl_ds_file_location {
+ unsigned magic;
+ long long *volume_id;
+ int *local_id;
+ long long *secret;
+ int *dc_id;
+};
+struct tl_ds_geo_chat_message {
+ unsigned magic;
+ int *chat_id;
+ int *id;
+ int *from_id;
+ int *date;
+ struct tl_ds_string *message;
+ struct tl_ds_message_media *media;
+ struct tl_ds_message_action *action;
+};
+struct tl_ds_geo_point {
+ unsigned magic;
+ double *longitude;
+ double *latitude;
+};
+struct tl_ds_imported_contact {
+ int *user_id;
+ long long *client_id;
+};
+struct tl_ds_input_app_event {
+ double *time;
+ struct tl_ds_string *type;
+ long long *peer;
+ struct tl_ds_string *data;
+};
+struct tl_ds_input_audio {
+ unsigned magic;
+ long long *id;
+ long long *access_hash;
+};
+struct tl_ds_input_chat_photo {
+ unsigned magic;
+ struct tl_ds_input_file *file;
+ struct tl_ds_input_photo_crop *crop;
+ struct tl_ds_input_photo *id;
+};
+struct tl_ds_input_contact {
+ long long *client_id;
+ struct tl_ds_string *phone;
+ struct tl_ds_string *first_name;
+ struct tl_ds_string *last_name;
+};
+struct tl_ds_input_document {
+ unsigned magic;
+ long long *id;
+ long long *access_hash;
+};
+struct tl_ds_input_encrypted_chat {
+ int *chat_id;
+ long long *access_hash;
+};
+struct tl_ds_input_encrypted_file {
+ unsigned magic;
+ long long *id;
+ int *parts;
+ struct tl_ds_string *md5_checksum;
+ int *key_fingerprint;
+ long long *access_hash;
+};
+struct tl_ds_input_file {
+ unsigned magic;
+ long long *id;
+ int *parts;
+ struct tl_ds_string *name;
+ struct tl_ds_string *md5_checksum;
+};
+struct tl_ds_input_file_location {
+ unsigned magic;
+ long long *volume_id;
+ int *local_id;
+ long long *secret;
+ long long *id;
+ long long *access_hash;
+};
+struct tl_ds_input_geo_chat {
+ int *chat_id;
+ long long *access_hash;
+};
+struct tl_ds_input_geo_point {
+ unsigned magic;
+ double *latitude;
+ double *longitude;
+};
+struct tl_ds_input_media {
+ unsigned magic;
+ struct tl_ds_input_file *file;
+ struct tl_ds_string *caption;
+ struct tl_ds_input_photo *id;
+ struct tl_ds_input_geo_point *geo_point;
+ struct tl_ds_string *phone_number;
+ struct tl_ds_string *first_name;
+ struct tl_ds_string *last_name;
+ int *duration;
+ int *w;
+ int *h;
+ struct tl_ds_input_file *thumb;
+ struct tl_ds_input_video *video_id;
+ struct tl_ds_string *mime_type;
+ struct tl_ds_input_audio *audio_id;
+ struct {
+ int *cnt;
+ struct tl_ds_document_attribute **data;
+ } *attributes;
+ struct tl_ds_input_document *document_id;
+ struct tl_ds_string *title;
+ struct tl_ds_string *address;
+ struct tl_ds_string *provider;
+ struct tl_ds_string *venue_id;
+};
+struct tl_ds_input_notify_peer {
+ unsigned magic;
+ struct tl_ds_input_peer *peer;
+ struct tl_ds_input_geo_chat *geo_peer;
+};
+struct tl_ds_input_peer {
+ unsigned magic;
+ int *user_id;
+ long long *access_hash;
+ int *chat_id;
+};
+struct tl_ds_input_peer_notify_events {
+ unsigned magic;
+};
+struct tl_ds_input_peer_notify_settings {
+ int *mute_until;
+ struct tl_ds_string *sound;
+ struct tl_ds_bool *show_previews;
+ int *events_mask;
+};
+struct tl_ds_input_photo {
+ unsigned magic;
+ long long *id;
+ long long *access_hash;
+};
+struct tl_ds_input_photo_crop {
+ unsigned magic;
+ double *crop_left;
+ double *crop_top;
+ double *crop_width;
+};
+struct tl_ds_input_privacy_key {
+ int : 0;
+};
+struct tl_ds_input_privacy_rule {
+ unsigned magic;
+ struct {
+ int *cnt;
+ struct tl_ds_input_user **data;
+ } *users;
+};
+struct tl_ds_input_sticker_set {
+ unsigned magic;
+ long long *id;
+ long long *access_hash;
+ struct tl_ds_string *short_name;
+};
+struct tl_ds_input_user {
+ unsigned magic;
+ int *user_id;
+ long long *access_hash;
+};
+struct tl_ds_input_video {
+ unsigned magic;
+ long long *id;
+ long long *access_hash;
+};
+struct tl_ds_int {
+ int : 0;
+};
+struct tl_ds_int128 {
+ long long *f0;
+ long long *f1;
+};
+struct tl_ds_int256 {
+ long long *f0;
+ long long *f1;
+ long long *f2;
+ long long *f3;
+};
+struct tl_ds_keyboard_button {
+ struct tl_ds_string *text;
+};
+struct tl_ds_keyboard_button_row {
+ struct {
+ int *cnt;
+ struct tl_ds_keyboard_button **data;
+ } *buttons;
+};
+struct tl_ds_long {
+ int : 0;
+};
+struct tl_ds_message {
+ unsigned magic;
+ int *id;
+ int *flags;
+ int *from_id;
+ struct tl_ds_peer *to_id;
+ int *fwd_from_id;
+ int *fwd_date;
+ int *reply_to_msg_id;
+ int *date;
+ struct tl_ds_string *message;
+ struct tl_ds_message_media *media;
+ struct tl_ds_reply_markup *reply_markup;
+ struct tl_ds_message_action *action;
+};
+struct tl_ds_message_action {
+ unsigned magic;
+ struct tl_ds_string *title;
+ struct {
+ int *cnt;
+ int **data;
+ } *users;
+ struct tl_ds_photo *photo;
+ int *user_id;
+ struct tl_ds_string *address;
+ int *inviter_id;
+};
+struct tl_ds_message_media {
+ unsigned magic;
+ struct tl_ds_photo *photo;
+ struct tl_ds_string *caption;
+ struct tl_ds_video *video;
+ struct tl_ds_geo_point *geo;
+ struct tl_ds_string *phone_number;
+ struct tl_ds_string *first_name;
+ struct tl_ds_string *last_name;
+ int *user_id;
+ struct tl_ds_document *document;
+ struct tl_ds_audio *audio;
+ struct tl_ds_web_page *webpage;
+ struct tl_ds_string *title;
+ struct tl_ds_string *address;
+ struct tl_ds_string *provider;
+ struct tl_ds_string *venue_id;
+};
+struct tl_ds_messages_filter {
+ unsigned magic;
+};
+struct tl_ds_nearest_dc {
+ struct tl_ds_string *country;
+ int *this_dc;
+ int *nearest_dc;
+};
+struct tl_ds_notify_peer {
+ unsigned magic;
+ struct tl_ds_peer *peer;
+};
+struct tl_ds_null {
+ int : 0;
+};
+struct tl_ds_p_q_inner_data {
+ unsigned magic;
+ struct tl_ds_string *pq;
+ struct tl_ds_string *p;
+ struct tl_ds_string *q;
+ struct tl_ds_int128 *nonce;
+ struct tl_ds_int128 *server_nonce;
+ struct tl_ds_int256 *new_nonce;
+ int *expires_in;
+};
+struct tl_ds_peer {
+ unsigned magic;
+ int *user_id;
+ int *chat_id;
+};
+struct tl_ds_peer_notify_events {
+ unsigned magic;
+};
+struct tl_ds_peer_notify_settings {
+ unsigned magic;
+ int *mute_until;
+ struct tl_ds_string *sound;
+ struct tl_ds_bool *show_previews;
+ int *events_mask;
+};
+struct tl_ds_photo {
+ unsigned magic;
+ long long *id;
+ long long *access_hash;
+ int *user_id;
+ int *date;
+ struct tl_ds_geo_point *geo;
+ struct {
+ int *cnt;
+ struct tl_ds_photo_size **data;
+ } *sizes;
+ struct tl_ds_string *caption;
+};
+struct tl_ds_photo_size {
+ unsigned magic;
+ struct tl_ds_string *type;
+ struct tl_ds_file_location *location;
+ int *w;
+ int *h;
+ int *size;
+ struct tl_ds_string *bytes;
+};
+struct tl_ds_privacy_key {
+ int : 0;
+};
+struct tl_ds_privacy_rule {
+ unsigned magic;
+ struct {
+ int *cnt;
+ int **data;
+ } *users;
+};
+struct tl_ds_received_notify_message {
+ int *id;
+ int *flags;
+};
+struct tl_ds_reply_markup {
+ unsigned magic;
+ int *flags;
+ struct {
+ int *cnt;
+ struct tl_ds_keyboard_button_row **data;
+ } *rows;
+};
+struct tl_ds_res_p_q {
+ struct tl_ds_int128 *nonce;
+ struct tl_ds_int128 *server_nonce;
+ struct tl_ds_string *pq;
+ struct {
+ int *cnt;
+ long long **data;
+ } *server_public_key_fingerprints;
+};
+struct tl_ds_send_message_action {
+ unsigned magic;
+ int *progress;
+};
+struct tl_ds_server_d_h_params {
+ unsigned magic;
+ struct tl_ds_int128 *nonce;
+ struct tl_ds_int128 *server_nonce;
+ struct tl_ds_int128 *new_nonce_hash;
+ struct tl_ds_string *encrypted_answer;
+};
+struct tl_ds_server_d_h_inner_data {
+ struct tl_ds_int128 *nonce;
+ struct tl_ds_int128 *server_nonce;
+ int *g;
+ struct tl_ds_string *dh_prime;
+ struct tl_ds_string *g_a;
+ int *server_time;
+};
+struct tl_ds_set_client_d_h_params_answer {
+ unsigned magic;
+ struct tl_ds_int128 *nonce;
+ struct tl_ds_int128 *server_nonce;
+ struct tl_ds_int128 *new_nonce_hash1;
+ struct tl_ds_int128 *new_nonce_hash2;
+ struct tl_ds_int128 *new_nonce_hash3;
+};
+struct tl_ds_sticker_pack {
+ struct tl_ds_string *emoticon;
+ struct {
+ int *cnt;
+ long long **data;
+ } *documents;
+};
+struct tl_ds_sticker_set {
+ long long *id;
+ long long *access_hash;
+ struct tl_ds_string *title;
+ struct tl_ds_string *short_name;
+};
+struct tl_ds_string {
+ int len;
+ char *data;
+};
+struct tl_ds_update {
+ unsigned magic;
+ struct tl_ds_message *message;
+ int *pts;
+ int *pts_count;
+ int *id;
+ long long *random_id;
+ struct {
+ int *cnt;
+ int **data;
+ } *messages;
+ int *user_id;
+ struct tl_ds_send_message_action *action;
+ int *chat_id;
+ struct tl_ds_chat_participants *participants;
+ struct tl_ds_user_status *status;
+ struct tl_ds_string *first_name;
+ struct tl_ds_string *last_name;
+ struct tl_ds_string *username;
+ int *date;
+ struct tl_ds_user_profile_photo *photo;
+ struct tl_ds_bool *previous;
+ struct tl_ds_contact_link *my_link;
+ struct tl_ds_contact_link *foreign_link;
+ long long *auth_key_id;
+ struct tl_ds_string *device;
+ struct tl_ds_string *location;
+ struct tl_ds_geo_chat_message *geo_message;
+ struct tl_ds_encrypted_message *encr_message;
+ int *qts;
+ struct tl_ds_encrypted_chat *encr_chat;
+ int *max_date;
+ int *inviter_id;
+ int *version;
+ struct {
+ int *cnt;
+ struct tl_ds_dc_option **data;
+ } *dc_options;
+ struct tl_ds_bool *blocked;
+ struct tl_ds_notify_peer *notify_peer;
+ struct tl_ds_peer_notify_settings *notify_settings;
+ struct tl_ds_string *type;
+ struct tl_ds_string *message_text;
+ struct tl_ds_message_media *media;
+ struct tl_ds_bool *popup;
+ struct tl_ds_privacy_key *key;
+ struct {
+ int *cnt;
+ struct tl_ds_privacy_rule **data;
+ } *rules;
+ struct tl_ds_string *phone;
+ struct tl_ds_peer *peer;
+ int *max_id;
+ struct tl_ds_web_page *webpage;
+};
+struct tl_ds_updates {
+ unsigned magic;
+ int *flags;
+ int *id;
+ int *user_id;
+ struct tl_ds_string *message;
+ int *pts;
+ int *pts_count;
+ int *date;
+ int *fwd_from_id;
+ int *fwd_date;
+ int *reply_to_msg_id;
+ int *from_id;
+ int *chat_id;
+ struct tl_ds_update *update;
+ struct {
+ int *cnt;
+ struct tl_ds_update **data;
+ } *updates;
+ struct {
+ int *cnt;
+ struct tl_ds_user **data;
+ } *users;
+ struct {
+ int *cnt;
+ struct tl_ds_chat **data;
+ } *chats;
+ int *seq_start;
+ int *seq;
+};
+struct tl_ds_user {
+ unsigned magic;
+ int *id;
+ int *flags;
+ long long *access_hash;
+ struct tl_ds_string *first_name;
+ struct tl_ds_string *last_name;
+ struct tl_ds_string *username;
+ struct tl_ds_string *phone;
+ struct tl_ds_user_profile_photo *photo;
+ struct tl_ds_user_status *status;
+ int *bot_info_version;
+};
+struct tl_ds_user_full {
+ struct tl_ds_user *user;
+ struct tl_ds_contacts_link *link;
+ struct tl_ds_photo *profile_photo;
+ struct tl_ds_peer_notify_settings *notify_settings;
+ struct tl_ds_bool *blocked;
+ struct tl_ds_bot_info *bot_info;
+};
+struct tl_ds_user_profile_photo {
+ unsigned magic;
+ long long *photo_id;
+ struct tl_ds_file_location *photo_small;
+ struct tl_ds_file_location *photo_big;
+};
+struct tl_ds_user_status {
+ unsigned magic;
+ int *expires;
+ int *was_online;
+};
+struct tl_ds_vector {
+ int *f1;
+ void **f2;
+};
+struct tl_ds_video {
+ unsigned magic;
+ long long *id;
+ long long *access_hash;
+ int *user_id;
+ int *date;
+ int *duration;
+ int *size;
+ struct tl_ds_photo_size *thumb;
+ int *dc_id;
+ int *w;
+ int *h;
+ struct tl_ds_string *caption;
+ struct tl_ds_string *mime_type;
+};
+struct tl_ds_wall_paper {
+ unsigned magic;
+ int *id;
+ struct tl_ds_string *title;
+ struct {
+ int *cnt;
+ struct tl_ds_photo_size **data;
+ } *sizes;
+ int *color;
+ int *bg_color;
+};
+struct tl_ds_web_page {
+ unsigned magic;
+ long long *id;
+ int *date;
+ int *flags;
+ struct tl_ds_string *url;
+ struct tl_ds_string *display_url;
+ struct tl_ds_string *type;
+ struct tl_ds_string *site_name;
+ struct tl_ds_string *title;
+ struct tl_ds_string *description;
+ struct tl_ds_photo *photo;
+ struct tl_ds_string *embed_url;
+ struct tl_ds_string *embed_type;
+ int *embed_width;
+ int *embed_height;
+ int *duration;
+ struct tl_ds_string *author;
+};
+struct tl_ds_account_authorizations {
+ struct {
+ int *cnt;
+ struct tl_ds_authorization **data;
+ } *authorizations;
+};
+struct tl_ds_account_password {
+ unsigned magic;
+ struct tl_ds_string *new_salt;
+ struct tl_ds_string *email_unconfirmed_pattern;
+ struct tl_ds_string *current_salt;
+ struct tl_ds_string *hint;
+ struct tl_ds_bool *has_recovery;
+};
+struct tl_ds_account_password_input_settings {
+ int *flags;
+ struct tl_ds_string *new_salt;
+ struct tl_ds_string *new_password_hash;
+ struct tl_ds_string *hint;
+ struct tl_ds_string *email;
+};
+struct tl_ds_account_password_settings {
+ struct tl_ds_string *email;
+};
+struct tl_ds_account_privacy_rules {
+ struct {
+ int *cnt;
+ struct tl_ds_privacy_rule **data;
+ } *rules;
+ struct {
+ int *cnt;
+ struct tl_ds_user **data;
+ } *users;
+};
+struct tl_ds_account_sent_change_phone_code {
+ struct tl_ds_string *phone_code_hash;
+ int *send_call_timeout;
+};
+struct tl_ds_auth_authorization {
+ struct tl_ds_user *user;
+};
+struct tl_ds_auth_checked_phone {
+ struct tl_ds_bool *phone_registered;
+};
+struct tl_ds_auth_exported_authorization {
+ int *id;
+ struct tl_ds_string *bytes;
+};
+struct tl_ds_auth_password_recovery {
+ struct tl_ds_string *email_pattern;
+};
+struct tl_ds_auth_sent_code {
+ unsigned magic;
+ struct tl_ds_bool *phone_registered;
+ struct tl_ds_string *phone_code_hash;
+ int *send_call_timeout;
+ struct tl_ds_bool *is_password;
+};
+struct tl_ds_binlog_encr_key {
+ int **key;
+};
+struct tl_ds_binlog_update {
+ unsigned magic;
+ int *dc;
+ struct tl_ds_string *name;
+ struct tl_ds_string *ip;
+ int *port;
+ int *flags;
+ struct tl_ds_binlog_encr_key *key;
+ int *id;
+ int *root;
+ struct tl_ds_binlog_encr_key *prime;
+ int *version;
+ int *pts;
+ int *qts;
+ int *date;
+ int *seq;
+ long long *access_hash;
+ int *admin;
+ int *user_id;
+ struct tl_ds_binlog_encr_key *g_key;
+ int *state;
+ int *ttl;
+ int *layer;
+ int *in_seq_no;
+ int *last_in_seq_no;
+ int *out_seq_no;
+ long long *key_fingerprint;
+ long long *exchange_id;
+ struct tl_ds_string *first_name;
+ struct tl_ds_string *last_name;
+ struct tl_ds_string *phone;
+ struct tl_ds_string *username;
+ struct tl_ds_photo *photo;
+ struct tl_ds_string *real_first_name;
+ struct tl_ds_string *real_last_name;
+ struct tl_ds_user_profile_photo *user_photo;
+ int *last_read_in;
+ int *last_read_out;
+ struct tl_ds_bot_info *bot_info;
+ struct tl_ds_string *title;
+ int *user_num;
+ struct {
+ int *cnt;
+ struct tl_ds_chat_participant **data;
+ } *participants;
+ struct tl_ds_chat_photo *chat_photo;
+ int *inviter_id;
+ long long *old_id;
+ int *new_id;
+ long long *lid;
+ int *from_id;
+ int *to_type;
+ int *to_id;
+ int *fwd_from_id;
+ int *fwd_date;
+ struct tl_ds_string *message;
+ struct tl_ds_message_media *media;
+ struct tl_ds_message_action *action;
+ int *reply_id;
+ struct tl_ds_reply_markup *reply_markup;
+ struct tl_ds_decrypted_message_media *encr_media;
+ struct tl_ds_decrypted_message_action *encr_action;
+ struct tl_ds_encrypted_file *file;
+};
+struct tl_ds_contacts_blocked {
+ unsigned magic;
+ struct {
+ int *cnt;
+ struct tl_ds_contact_blocked **data;
+ } *blocked;
+ struct {
+ int *cnt;
+ struct tl_ds_user **data;
+ } *users;
+ int *count;
+};
+struct tl_ds_contacts_contacts {
+ unsigned magic;
+ struct {
+ int *cnt;
+ struct tl_ds_contact **data;
+ } *contacts;
+ struct {
+ int *cnt;
+ struct tl_ds_user **data;
+ } *users;
+};
+struct tl_ds_contacts_found {
+ struct {
+ int *cnt;
+ struct tl_ds_contact_found **data;
+ } *results;
+ struct {
+ int *cnt;
+ struct tl_ds_user **data;
+ } *users;
+};
+struct tl_ds_contacts_imported_contacts {
+ struct {
+ int *cnt;
+ struct tl_ds_imported_contact **data;
+ } *imported;
+ struct {
+ int *cnt;
+ long long **data;
+ } *retry_contacts;
+ struct {
+ int *cnt;
+ struct tl_ds_user **data;
+ } *users;
+};
+struct tl_ds_contacts_link {
+ struct tl_ds_contact_link *my_link;
+ struct tl_ds_contact_link *foreign_link;
+ struct tl_ds_user *user;
+};
+struct tl_ds_contacts_suggested {
+ struct {
+ int *cnt;
+ struct tl_ds_contact_suggested **data;
+ } *results;
+ struct {
+ int *cnt;
+ struct tl_ds_user **data;
+ } *users;
+};
+struct tl_ds_geochats_located {
+ struct {
+ int *cnt;
+ struct tl_ds_chat_located **data;
+ } *results;
+ struct {
+ int *cnt;
+ struct tl_ds_geo_chat_message **data;
+ } *messages;
+ struct {
+ int *cnt;
+ struct tl_ds_chat **data;
+ } *chats;
+ struct {
+ int *cnt;
+ struct tl_ds_user **data;
+ } *users;
+};
+struct tl_ds_geochats_messages {
+ unsigned magic;
+ struct {
+ int *cnt;
+ struct tl_ds_geo_chat_message **data;
+ } *messages;
+ struct {
+ int *cnt;
+ struct tl_ds_chat **data;
+ } *chats;
+ struct {
+ int *cnt;
+ struct tl_ds_user **data;
+ } *users;
+ int *count;
+};
+struct tl_ds_geochats_stated_message {
+ struct tl_ds_geo_chat_message *message;
+ struct {
+ int *cnt;
+ struct tl_ds_chat **data;
+ } *chats;
+ struct {
+ int *cnt;
+ struct tl_ds_user **data;
+ } *users;
+ int *seq;
+};
+struct tl_ds_help_app_update {
+ unsigned magic;
+ int *id;
+ struct tl_ds_bool *critical;
+ struct tl_ds_string *url;
+ struct tl_ds_string *text;
+};
+struct tl_ds_help_invite_text {
+ struct tl_ds_string *message;
+};
+struct tl_ds_help_support {
+ struct tl_ds_string *phone_number;
+ struct tl_ds_user *user;
+};
+struct tl_ds_messages_affected_history {
+ int *pts;
+ int *pts_count;
+ int *offset;
+};
+struct tl_ds_messages_affected_messages {
+ int *pts;
+ int *pts_count;
+};
+struct tl_ds_messages_all_stickers {
+ unsigned magic;
+ struct tl_ds_string *hash;
+ struct {
+ int *cnt;
+ struct tl_ds_sticker_pack **data;
+ } *packs;
+ struct {
+ int *cnt;
+ struct tl_ds_sticker_set **data;
+ } *sets;
+ struct {
+ int *cnt;
+ struct tl_ds_document **data;
+ } *documents;
+};
+struct tl_ds_messages_chat_full {
+ struct tl_ds_chat_full *full_chat;
+ struct {
+ int *cnt;
+ struct tl_ds_chat **data;
+ } *chats;
+ struct {
+ int *cnt;
+ struct tl_ds_user **data;
+ } *users;
+};
+struct tl_ds_messages_chats {
+ struct {
+ int *cnt;
+ struct tl_ds_chat **data;
+ } *chats;
+};
+struct tl_ds_messages_dh_config {
+ unsigned magic;
+ struct tl_ds_string *random;
+ int *g;
+ struct tl_ds_string *p;
+ int *version;
+};
+struct tl_ds_messages_dialogs {
+ unsigned magic;
+ struct {
+ int *cnt;
+ struct tl_ds_dialog **data;
+ } *dialogs;
+ struct {
+ int *cnt;
+ struct tl_ds_message **data;
+ } *messages;
+ struct {
+ int *cnt;
+ struct tl_ds_chat **data;
+ } *chats;
+ struct {
+ int *cnt;
+ struct tl_ds_user **data;
+ } *users;
+ int *count;
+};
+struct tl_ds_messages_message {
+ int : 0;
+};
+struct tl_ds_messages_messages {
+ unsigned magic;
+ struct {
+ int *cnt;
+ struct tl_ds_message **data;
+ } *messages;
+ struct {
+ int *cnt;
+ struct tl_ds_chat **data;
+ } *chats;
+ struct {
+ int *cnt;
+ struct tl_ds_user **data;
+ } *users;
+ int *count;
+};
+struct tl_ds_messages_sent_encrypted_message {
+ unsigned magic;
+ int *date;
+ struct tl_ds_encrypted_file *file;
+};
+struct tl_ds_messages_sent_message {
+ unsigned magic;
+ int *id;
+ int *date;
+ struct tl_ds_message_media *media;
+ int *pts;
+ int *pts_count;
+ struct {
+ int *cnt;
+ struct tl_ds_contacts_link **data;
+ } *links;
+ int *seq;
+};
+struct tl_ds_messages_sticker_set {
+ struct tl_ds_sticker_set *set;
+ struct {
+ int *cnt;
+ struct tl_ds_sticker_pack **data;
+ } *packs;
+ struct {
+ int *cnt;
+ struct tl_ds_document **data;
+ } *documents;
+};
+struct tl_ds_messages_stickers {
+ unsigned magic;
+ struct tl_ds_string *hash;
+ struct {
+ int *cnt;
+ struct tl_ds_document **data;
+ } *stickers;
+};
+struct tl_ds_photos_photo {
+ struct tl_ds_photo *photo;
+ struct {
+ int *cnt;
+ struct tl_ds_user **data;
+ } *users;
+};
+struct tl_ds_photos_photos {
+ unsigned magic;
+ struct {
+ int *cnt;
+ struct tl_ds_photo **data;
+ } *photos;
+ struct {
+ int *cnt;
+ struct tl_ds_user **data;
+ } *users;
+ int *count;
+};
+struct tl_ds_storage_file_type {
+ unsigned magic;
+};
+struct tl_ds_updates_difference {
+ unsigned magic;
+ int *date;
+ int *seq;
+ struct {
+ int *cnt;
+ struct tl_ds_message **data;
+ } *new_messages;
+ struct {
+ int *cnt;
+ struct tl_ds_encrypted_message **data;
+ } *new_encrypted_messages;
+ struct {
+ int *cnt;
+ struct tl_ds_update **data;
+ } *other_updates;
+ struct {
+ int *cnt;
+ struct tl_ds_chat **data;
+ } *chats;
+ struct {
+ int *cnt;
+ struct tl_ds_user **data;
+ } *users;
+ struct tl_ds_updates_state *state;
+ struct tl_ds_updates_state *intermediate_state;
+};
+struct tl_ds_updates_state {
+ int *pts;
+ int *qts;
+ int *date;
+ int *seq;
+ int *unread_count;
+};
+struct tl_ds_upload_file {
+ struct tl_ds_storage_file_type *type;
+ int *mtime;
+ struct tl_ds_string *bytes;
+};
+#endif
diff --git a/protocols/Telegram/tgl/auto/constants.h b/protocols/Telegram/tgl/auto/constants.h
new file mode 100644
index 0000000000..643496f2d2
--- /dev/null
+++ b/protocols/Telegram/tgl/auto/constants.h
@@ -0,0 +1,561 @@
+/*
+ This file is part of telegram-client.
+
+ Telegram-client is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+
+ Telegram-client is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this telegram-client. If not, see <http://www.gnu.org/licenses/>.
+
+ Copyright Vitaly Valtman 2013
+*/
+#ifndef CONSTANTS_H
+#define CONSTANTS_H
+#define CODE_int 0xa8509bda
+#define CODE_long 0x22076cba
+#define CODE_double 0x2210c154
+#define CODE_string 0xb5286e24
+#define CODE_bytes 0x0ee1379f
+#define CODE_int128 0x7d36c439
+#define CODE_int256 0xf2c798b3
+#define CODE_bool_false 0xbc799737
+#define CODE_bool_true 0x997275b5
+#define CODE_vector 0x1cb5c415
+#define CODE_error 0xc4b9f9bb
+#define CODE_null 0x56730bcc
+#define CODE_input_peer_empty 0x7f3b18ea
+#define CODE_input_peer_self 0x7da07ec9
+#define CODE_input_peer_contact 0x1023dbe8
+#define CODE_input_peer_foreign 0x9b447325
+#define CODE_input_peer_chat 0x179be863
+#define CODE_input_user_empty 0xb98886cf
+#define CODE_input_user_self 0xf7c1b13f
+#define CODE_input_user_contact 0x86e94f65
+#define CODE_input_user_foreign 0x655e74ff
+#define CODE_input_phone_contact 0xf392b7f4
+#define CODE_input_file 0xf52ff27f
+#define CODE_input_media_empty 0x9664f57f
+#define CODE_input_media_uploaded_photo 0xf7aff1c0
+#define CODE_input_media_photo 0xe9bfb4f3
+#define CODE_input_media_geo_point 0xf9c44144
+#define CODE_input_media_contact 0xa6e45987
+#define CODE_input_media_uploaded_video 0xe13fd4bc
+#define CODE_input_media_uploaded_thumb_video 0x96fb97dc
+#define CODE_input_media_video 0x936a4ebd
+#define CODE_input_chat_photo_empty 0x1ca48f57
+#define CODE_input_chat_uploaded_photo 0x94254732
+#define CODE_input_chat_photo 0xb2e1bf08
+#define CODE_input_geo_point_empty 0xe4c123d6
+#define CODE_input_geo_point 0xf3b7acc9
+#define CODE_input_photo_empty 0x1cd7bf0d
+#define CODE_input_photo 0xfb95c6c4
+#define CODE_input_video_empty 0x5508ec75
+#define CODE_input_video 0xee579652
+#define CODE_input_file_location 0x14637196
+#define CODE_input_video_file_location 0x3d0364ec
+#define CODE_input_photo_crop_auto 0xade6b004
+#define CODE_input_photo_crop 0xd9915325
+#define CODE_input_app_event 0x770656a8
+#define CODE_peer_user 0x9db1bc6d
+#define CODE_peer_chat 0xbad0e5bb
+#define CODE_storage_file_unknown 0xaa963b05
+#define CODE_storage_file_jpeg 0x007efe0e
+#define CODE_storage_file_gif 0xcae1aadf
+#define CODE_storage_file_png 0x0a4f63c0
+#define CODE_storage_file_pdf 0xae1e508d
+#define CODE_storage_file_mp3 0x528a0677
+#define CODE_storage_file_mov 0x4b09ebbc
+#define CODE_storage_file_partial 0x40bc6f52
+#define CODE_storage_file_mp4 0xb3cea0e4
+#define CODE_storage_file_webp 0x1081464c
+#define CODE_file_location_unavailable 0x7c596b46
+#define CODE_file_location 0x53d69076
+#define CODE_user_empty 0x200250ba
+#define CODE_user_profile_photo_empty 0x4f11bae1
+#define CODE_user_profile_photo 0xd559d8c8
+#define CODE_user_status_empty 0x09d05049
+#define CODE_user_status_online 0xedb93949
+#define CODE_user_status_offline 0x008c703f
+#define CODE_chat_empty 0x9ba2d800
+#define CODE_chat 0x6e9c9bc7
+#define CODE_chat_forbidden 0xfb0ccc41
+#define CODE_chat_full 0x2e02a614
+#define CODE_chat_participant 0xc8d7493e
+#define CODE_chat_participants_forbidden 0x0fd2bb8a
+#define CODE_chat_participants 0x7841b415
+#define CODE_chat_photo_empty 0x37c1011c
+#define CODE_chat_photo 0x6153276a
+#define CODE_message_empty 0x83e5de54
+#define CODE_message 0xc3060325
+#define CODE_message_service 0x1d86f70e
+#define CODE_message_media_empty 0x3ded6320
+#define CODE_message_media_photo 0x3d8ce53d
+#define CODE_message_media_video 0x5bcf1675
+#define CODE_message_media_geo 0x56e0d474
+#define CODE_message_media_contact 0x5e7d2f39
+#define CODE_message_media_unsupported 0x9f84f49e
+#define CODE_message_action_empty 0xb6aef7b0
+#define CODE_message_action_chat_create 0xa6638b9a
+#define CODE_message_action_chat_edit_title 0xb5a1ce5a
+#define CODE_message_action_chat_edit_photo 0x7fcb13a8
+#define CODE_message_action_chat_delete_photo 0x95e3fbef
+#define CODE_message_action_chat_add_user 0x5e3cfc4b
+#define CODE_message_action_chat_delete_user 0xb2ae9b0c
+#define CODE_dialog 0xc1dd804a
+#define CODE_photo_empty 0x2331b22d
+#define CODE_photo 0xc3838076
+#define CODE_photo_l27 0x22b56751
+#define CODE_photo_size_empty 0x0e17e23c
+#define CODE_photo_size 0x77bfb61b
+#define CODE_photo_cached_size 0xe9a734fa
+#define CODE_video_empty 0xc10658a8
+#define CODE_video 0xee9f4a4d
+#define CODE_video_l27 0x388fa391
+#define CODE_geo_point_empty 0x1117dd5f
+#define CODE_geo_point 0x2049d70c
+#define CODE_auth_checked_phone 0x811ea28e
+#define CODE_auth_sent_code 0xefed51d9
+#define CODE_auth_authorization 0xff036af1
+#define CODE_auth_exported_authorization 0xdf969c2d
+#define CODE_input_notify_peer 0xb8bc5b0c
+#define CODE_input_notify_users 0x193b4417
+#define CODE_input_notify_chats 0x4a95e84e
+#define CODE_input_notify_all 0xa429b886
+#define CODE_input_peer_notify_events_empty 0xf03064d8
+#define CODE_input_peer_notify_events_all 0xe86a2c74
+#define CODE_input_peer_notify_settings 0x46a2ce98
+#define CODE_peer_notify_events_empty 0xadd53cb3
+#define CODE_peer_notify_events_all 0x6d1ded88
+#define CODE_peer_notify_settings_empty 0x70a68512
+#define CODE_peer_notify_settings 0x8d5e11ee
+#define CODE_wall_paper 0xccb03657
+#define CODE_user_full 0x5a89ac5b
+#define CODE_contact 0xf911c994
+#define CODE_imported_contact 0xd0028438
+#define CODE_contact_blocked 0x561bc879
+#define CODE_contact_suggested 0x3de191a1
+#define CODE_contact_status 0xd3680c61
+#define CODE_chat_located 0x3631cf4c
+#define CODE_contacts_link 0x3ace484c
+#define CODE_contacts_contacts_not_modified 0xb74ba9d2
+#define CODE_contacts_contacts 0x6f8b8cb2
+#define CODE_contacts_imported_contacts 0xad524315
+#define CODE_contacts_blocked 0x1c138d15
+#define CODE_contacts_blocked_slice 0x900802a1
+#define CODE_contacts_suggested 0x5649dcc5
+#define CODE_messages_dialogs 0x15ba6c40
+#define CODE_messages_dialogs_slice 0x71e094f3
+#define CODE_messages_messages 0x8c718e87
+#define CODE_messages_messages_slice 0x0b446ae3
+#define CODE_messages_message_empty 0x3f4e0648
+#define CODE_messages_sent_message 0x4c3d47f3
+#define CODE_messages_chats 0x64ff9fd5
+#define CODE_messages_chat_full 0xe5d7d19c
+#define CODE_messages_affected_history 0xb45c69d1
+#define CODE_input_messages_filter_empty 0x57e2f66c
+#define CODE_input_messages_filter_photos 0x9609a51c
+#define CODE_input_messages_filter_video 0x9fc00e65
+#define CODE_input_messages_filter_photo_video 0x56e9f0e4
+#define CODE_input_messages_filter_photo_video_documents 0xd95e73bb
+#define CODE_input_messages_filter_document 0x9eddf188
+#define CODE_input_messages_filter_audio 0xcfc87522
+#define CODE_update_new_message 0x1f2b0afd
+#define CODE_update_message_i_d 0x4e90bfd6
+#define CODE_update_delete_messages 0xa20db0e5
+#define CODE_update_user_typing 0x5c486927
+#define CODE_update_chat_user_typing 0x9a65ea1f
+#define CODE_update_chat_participants 0x07761198
+#define CODE_update_user_status 0x1bfbd823
+#define CODE_update_user_name 0xa7332b73
+#define CODE_update_user_photo 0x95313b0c
+#define CODE_update_contact_registered 0x2575bbb9
+#define CODE_update_contact_link 0x9d2e67c5
+#define CODE_update_new_authorization 0x8f06529a
+#define CODE_updates_state 0xa56c2a3e
+#define CODE_updates_difference_empty 0x5d75a138
+#define CODE_updates_difference 0x00f49ca0
+#define CODE_updates_difference_slice 0xa8fb1981
+#define CODE_updates_too_long 0xe317af7e
+#define CODE_update_short_message 0xed5c2127
+#define CODE_update_short_chat_message 0x52238b3c
+#define CODE_update_short 0x78d4dec1
+#define CODE_updates_combined 0x725b04c3
+#define CODE_updates 0x74ae4240
+#define CODE_photos_photos 0x8dca6aa5
+#define CODE_photos_photos_slice 0x15051f54
+#define CODE_photos_photo 0x20212ca8
+#define CODE_upload_file 0x096a18d5
+#define CODE_dc_option_l28 0x2ec2a43c
+#define CODE_dc_option 0x05d8c6cc
+#define CODE_config 0x4e32b894
+#define CODE_nearest_dc 0x8e1a1775
+#define CODE_help_app_update 0x8987f311
+#define CODE_help_no_app_update 0xc45a6536
+#define CODE_help_invite_text 0x18cb9f78
+#define CODE_messages_sent_message_link 0x35a1a663
+#define CODE_input_geo_chat 0x74d456fa
+#define CODE_input_notify_geo_chat_peer 0x4d8ddec8
+#define CODE_geo_chat 0x75eaea5a
+#define CODE_geo_chat_message_empty 0x60311a9b
+#define CODE_geo_chat_message 0x4505f8e1
+#define CODE_geo_chat_message_service 0xd34fa24e
+#define CODE_geochats_stated_message 0x17b1578b
+#define CODE_geochats_located 0x48feb267
+#define CODE_geochats_messages 0xd1526db1
+#define CODE_geochats_messages_slice 0xbc5863e8
+#define CODE_message_action_geo_chat_create 0x6f038ebc
+#define CODE_message_action_geo_chat_checkin 0x0c7d53de
+#define CODE_update_new_geo_chat_message 0x5a68e3f7
+#define CODE_wall_paper_solid 0x63117f24
+#define CODE_update_new_encrypted_message 0x12bcbd9a
+#define CODE_update_encrypted_chat_typing 0x1710f156
+#define CODE_update_encryption 0xb4a2e88d
+#define CODE_update_encrypted_messages_read 0x38fe25b7
+#define CODE_encrypted_chat_empty 0xab7ec0a0
+#define CODE_encrypted_chat_waiting 0x3bf703dc
+#define CODE_encrypted_chat_requested 0xc878527e
+#define CODE_encrypted_chat 0xfa56ce36
+#define CODE_encrypted_chat_discarded 0x13d6dd27
+#define CODE_input_encrypted_chat 0xf141b5e1
+#define CODE_encrypted_file_empty 0xc21f497e
+#define CODE_encrypted_file 0x4a70994c
+#define CODE_input_encrypted_file_empty 0x1837c364
+#define CODE_input_encrypted_file_uploaded 0x64bd0306
+#define CODE_input_encrypted_file 0x5a17b5e5
+#define CODE_input_encrypted_file_location 0xf5235d55
+#define CODE_encrypted_message 0xed18c118
+#define CODE_encrypted_message_service 0x23734b06
+#define CODE_messages_dh_config_not_modified 0xc0e24635
+#define CODE_messages_dh_config 0x2c221edd
+#define CODE_messages_sent_encrypted_message 0x560f8935
+#define CODE_messages_sent_encrypted_file 0x9493ff32
+#define CODE_input_file_big 0xfa4f0bb5
+#define CODE_input_encrypted_file_big_uploaded 0x2dc173c8
+#define CODE_update_chat_participant_add 0x3a0eeb22
+#define CODE_update_chat_participant_delete 0x6e5f8c22
+#define CODE_update_dc_options 0x8e5e9873
+#define CODE_input_media_uploaded_audio 0x4e498cab
+#define CODE_input_media_audio 0x89938781
+#define CODE_input_media_uploaded_document 0xffe76b78
+#define CODE_input_media_uploaded_thumb_document 0x41481486
+#define CODE_input_media_document 0xd184e841
+#define CODE_message_media_document 0x2fda2204
+#define CODE_message_media_audio 0xc6b68300
+#define CODE_input_audio_empty 0xd95adc84
+#define CODE_input_audio 0x77d440ff
+#define CODE_input_document_empty 0x72f0eaae
+#define CODE_input_document 0x18798952
+#define CODE_input_audio_file_location 0x74dc404d
+#define CODE_input_document_file_location 0x4e45abe9
+#define CODE_audio_empty 0x586988d8
+#define CODE_audio 0xc7ac6496
+#define CODE_document_empty 0x36f8c871
+#define CODE_document 0xf9a39f4f
+#define CODE_document_l19 0x9efc6326
+#define CODE_help_support 0x17c6b5f6
+#define CODE_notify_peer 0x9fd40bd8
+#define CODE_notify_users 0xb4c83b4c
+#define CODE_notify_chats 0xc007cec3
+#define CODE_notify_all 0x74d07c60
+#define CODE_update_user_blocked 0x80ece81a
+#define CODE_update_notify_settings 0xbec268ef
+#define CODE_auth_sent_app_code 0xe325edcf
+#define CODE_send_message_typing_action 0x16bf744e
+#define CODE_send_message_cancel_action 0xfd5ec8f5
+#define CODE_send_message_record_video_action 0xa187d66f
+#define CODE_send_message_upload_video_action_l27 0x92042ff7
+#define CODE_send_message_upload_video_action 0xe9763aec
+#define CODE_send_message_record_audio_action 0xd52f73f7
+#define CODE_send_message_upload_audio_action_l27 0xe6ac8a6f
+#define CODE_send_message_upload_audio_action 0xf351d7ab
+#define CODE_send_message_upload_photo_action 0xd1d34a26
+#define CODE_send_message_upload_document_action_l27 0x8faee98e
+#define CODE_send_message_upload_document_action 0xaa0cd9e4
+#define CODE_send_message_geo_location_action 0x176f8ba1
+#define CODE_send_message_choose_contact_action 0x628cbc6f
+#define CODE_contact_found 0xea879f95
+#define CODE_contacts_found 0x0566000e
+#define CODE_update_service_notification 0x382dd3e4
+#define CODE_user_status_recently 0xe26f42f1
+#define CODE_user_status_last_week 0x07bf09fc
+#define CODE_user_status_last_month 0x77ebc742
+#define CODE_update_privacy 0xee3b272a
+#define CODE_input_privacy_key_status_timestamp 0x4f96cb18
+#define CODE_privacy_key_status_timestamp 0xbc2eab30
+#define CODE_input_privacy_value_allow_contacts 0x0d09e07b
+#define CODE_input_privacy_value_allow_all 0x184b35ce
+#define CODE_input_privacy_value_allow_users 0x131cc67f
+#define CODE_input_privacy_value_disallow_contacts 0x0ba52007
+#define CODE_input_privacy_value_disallow_all 0xd66b66c9
+#define CODE_input_privacy_value_disallow_users 0x90110467
+#define CODE_privacy_value_allow_contacts 0xfffe1bac
+#define CODE_privacy_value_allow_all 0x65427b82
+#define CODE_privacy_value_allow_users 0x4d5bbe0c
+#define CODE_privacy_value_disallow_contacts 0xf888fa1a
+#define CODE_privacy_value_disallow_all 0x8b73e763
+#define CODE_privacy_value_disallow_users 0x0c7f49b7
+#define CODE_account_privacy_rules 0x554abb6f
+#define CODE_account_days_t_t_l 0xb8d0afdf
+#define CODE_account_sent_change_phone_code 0xa4f58c4c
+#define CODE_update_user_phone 0x12b9417b
+#define CODE_document_attribute_image_size 0x6c37c15c
+#define CODE_document_attribute_animated 0x11b58939
+#define CODE_document_attribute_sticker_l28 0x994c9882
+#define CODE_document_attribute_sticker 0x3a556302
+#define CODE_document_attribute_video 0x5910cccb
+#define CODE_document_attribute_audio 0x051448e5
+#define CODE_document_attribute_filename 0x15590068
+#define CODE_messages_stickers_not_modified 0xf1749a22
+#define CODE_messages_stickers 0x8a8ecd32
+#define CODE_sticker_pack 0x12b299d4
+#define CODE_messages_all_stickers_not_modified 0xe86602c3
+#define CODE_messages_all_stickers 0x5ce352ec
+#define CODE_disabled_feature 0xae636f24
+#define CODE_update_read_history_inbox 0x9961fd5c
+#define CODE_update_read_history_outbox 0x2f2f21bf
+#define CODE_messages_affected_messages 0x84d19185
+#define CODE_contact_link_unknown 0x5f4f9247
+#define CODE_contact_link_none 0xfeedd3ad
+#define CODE_contact_link_has_phone 0x268f3f59
+#define CODE_contact_link_contact 0xd502c2d0
+#define CODE_update_web_page 0x2cc36971
+#define CODE_web_page_empty 0xeb1477e8
+#define CODE_web_page_pending 0xc586da1c
+#define CODE_web_page 0xa31ea0b5
+#define CODE_message_media_web_page 0xa32dd600
+#define CODE_authorization 0x7bf2e6f6
+#define CODE_account_authorizations 0x1250abde
+#define CODE_account_no_password 0x96dabc18
+#define CODE_account_password 0x7c18141c
+#define CODE_account_password_settings 0xb7b72ab3
+#define CODE_account_password_input_settings 0xbcfc532c
+#define CODE_auth_password_recovery 0x137948a5
+#define CODE_input_media_venue 0x2827a81a
+#define CODE_message_media_venue 0x7912b71f
+#define CODE_received_notify_message 0xa384b779
+#define CODE_chat_invite_empty 0x69df3769
+#define CODE_chat_invite_exported 0xfc2e05bc
+#define CODE_chat_invite_already 0x5a686d7c
+#define CODE_chat_invite 0xce917dcd
+#define CODE_message_action_chat_joined_by_link 0xf89cf5e8
+#define CODE_update_read_messages_contents 0x68c13933
+#define CODE_input_sticker_set_empty 0xffb62b95
+#define CODE_input_sticker_set_i_d 0x9de7a269
+#define CODE_input_sticker_set_short_name 0x861cc8a0
+#define CODE_sticker_set 0xa7a43b17
+#define CODE_messages_sticker_set 0xb60a24a6
+#define CODE_user 0x22e49072
+#define CODE_bot_command 0xc27ac8c7
+#define CODE_bot_command_old 0xb79d22ab
+#define CODE_bot_info_empty 0xbb2e37ce
+#define CODE_bot_info 0x09cf585d
+#define CODE_keyboard_button 0xa2fa4880
+#define CODE_keyboard_button_row 0x77608b83
+#define CODE_reply_keyboard_hide 0xa03e5b85
+#define CODE_reply_keyboard_force_reply 0xf4108aa0
+#define CODE_reply_keyboard_markup 0x3502758c
+#define CODE_invoke_after_msg 0xcb9f372d
+#define CODE_invoke_after_msgs 0x3dc4b4f0
+#define CODE_auth_check_phone 0x6fe51dfb
+#define CODE_auth_send_code 0x768d5f4d
+#define CODE_auth_send_call 0x03c51564
+#define CODE_auth_sign_up 0x1b067634
+#define CODE_auth_sign_in 0xbcd51581
+#define CODE_auth_log_out 0x5717da40
+#define CODE_auth_reset_authorizations 0x9fab0d1a
+#define CODE_auth_send_invites 0x771c1d97
+#define CODE_auth_export_authorization 0xe5bfffcd
+#define CODE_auth_import_authorization 0xe3ef9613
+#define CODE_auth_bind_temp_auth_key 0xcdd42a05
+#define CODE_account_register_device 0x446c712c
+#define CODE_account_unregister_device 0x65c55b40
+#define CODE_account_update_notify_settings 0x84be5b93
+#define CODE_account_get_notify_settings 0x12b3ad31
+#define CODE_account_reset_notify_settings 0xdb7e1747
+#define CODE_account_update_profile 0xf0888d68
+#define CODE_account_update_status 0x6628562c
+#define CODE_account_get_wall_papers 0xc04cfac2
+#define CODE_users_get_users 0x0d91a548
+#define CODE_users_get_full_user 0xca30a5b1
+#define CODE_contacts_get_statuses 0xc4a353ee
+#define CODE_contacts_get_contacts 0x22c6aa08
+#define CODE_contacts_import_contacts 0xda30b32d
+#define CODE_contacts_get_suggested 0xcd773428
+#define CODE_contacts_delete_contact 0x8e953744
+#define CODE_contacts_delete_contacts 0x59ab389e
+#define CODE_contacts_block 0x332b49fc
+#define CODE_contacts_unblock 0xe54100bd
+#define CODE_contacts_get_blocked 0xf57c350f
+#define CODE_contacts_export_card 0x84e53737
+#define CODE_contacts_import_card 0x4fe196fe
+#define CODE_messages_get_messages 0x4222fa74
+#define CODE_messages_get_dialogs 0xeccf1df6
+#define CODE_messages_get_history 0x92a1df2f
+#define CODE_messages_search 0x07e9f2ab
+#define CODE_messages_read_history 0xb04f2510
+#define CODE_messages_delete_history 0xf4f8fb61
+#define CODE_messages_delete_messages 0xa5f18925
+#define CODE_messages_received_messages 0x05a954c0
+#define CODE_messages_set_typing 0xa3825e50
+#define CODE_messages_send_message 0xfc55e6b5
+#define CODE_messages_send_media 0xc8f16791
+#define CODE_messages_forward_messages 0x55e1728d
+#define CODE_messages_get_chats 0x3c6aa187
+#define CODE_messages_get_full_chat 0x3b831c66
+#define CODE_messages_edit_chat_title 0xdc452855
+#define CODE_messages_edit_chat_photo 0xca4c79d8
+#define CODE_messages_add_chat_user 0xf9a0aa09
+#define CODE_messages_delete_chat_user 0xe0611f16
+#define CODE_messages_create_chat 0x09cb126e
+#define CODE_updates_get_state 0xedd4882a
+#define CODE_updates_get_difference 0x0a041495
+#define CODE_photos_update_profile_photo 0xeef579a0
+#define CODE_photos_upload_profile_photo 0xd50f9c88
+#define CODE_photos_delete_photos 0x87cf7f2f
+#define CODE_upload_save_file_part 0xb304a621
+#define CODE_upload_get_file 0xe3a6cfb5
+#define CODE_help_get_config 0xc4f9186b
+#define CODE_help_get_nearest_dc 0x1fb33026
+#define CODE_help_get_app_update 0xc812ac7e
+#define CODE_help_save_app_log 0x6f02f748
+#define CODE_help_get_invite_text 0xa4a95186
+#define CODE_photos_get_user_photos 0xb7ee553c
+#define CODE_messages_forward_message 0x33963bf9
+#define CODE_messages_send_broadcast 0xbf73f4da
+#define CODE_geochats_get_located 0x7f192d8f
+#define CODE_geochats_get_recents 0xe1427e6f
+#define CODE_geochats_checkin 0x55b3e8fb
+#define CODE_geochats_get_full_chat 0x6722dd6f
+#define CODE_geochats_edit_chat_title 0x4c8e2273
+#define CODE_geochats_edit_chat_photo 0x35d81a95
+#define CODE_geochats_search 0xcfcdc44d
+#define CODE_geochats_get_history 0xb53f7a68
+#define CODE_geochats_set_typing 0x08b8a729
+#define CODE_geochats_send_message 0x061b0044
+#define CODE_geochats_send_media 0xb8f0deff
+#define CODE_geochats_create_geo_chat 0x0e092e16
+#define CODE_messages_get_dh_config 0x26cf8950
+#define CODE_messages_request_encryption 0xf64daf43
+#define CODE_messages_accept_encryption 0x3dbc0415
+#define CODE_messages_discard_encryption 0xedd923c5
+#define CODE_messages_set_encrypted_typing 0x791451ed
+#define CODE_messages_read_encrypted_history 0x7f4b690a
+#define CODE_messages_send_encrypted 0xa9776773
+#define CODE_messages_send_encrypted_file 0x9a901b66
+#define CODE_messages_send_encrypted_service 0x32d439a4
+#define CODE_messages_received_queue 0x55a5bb66
+#define CODE_upload_save_big_file_part 0xde7b673d
+#define CODE_init_connection 0x69796de9
+#define CODE_help_get_support 0x9cdf08cd
+#define CODE_auth_send_sms 0x0da9f3e8
+#define CODE_messages_read_message_contents 0x36a73f77
+#define CODE_account_check_username 0x2714d86c
+#define CODE_account_update_username 0x3e0bdd7c
+#define CODE_contacts_search 0x11f812d8
+#define CODE_account_get_privacy 0xdadbc950
+#define CODE_account_set_privacy 0xc9f81ce8
+#define CODE_account_delete_account 0x418d4e0b
+#define CODE_account_get_account_t_t_l 0x08fc711d
+#define CODE_account_set_account_t_t_l 0x2442485e
+#define CODE_invoke_with_layer 0xda9b0d0d
+#define CODE_contacts_resolve_username 0x0bf0131c
+#define CODE_account_send_change_phone_code 0xa407a8f4
+#define CODE_account_change_phone 0x70c32edb
+#define CODE_messages_get_stickers 0xae22e045
+#define CODE_messages_get_all_stickers 0xaa3bc868
+#define CODE_account_update_device_locked 0x38df3532
+#define CODE_auth_import_bot_authorization 0x67a3ff2c
+#define CODE_messages_get_web_page_preview 0x25223e24
+#define CODE_account_get_authorizations 0xe320c158
+#define CODE_account_reset_authorization 0xdf77f3bc
+#define CODE_account_get_password 0x548a30f5
+#define CODE_account_get_password_settings 0xbc8d11bb
+#define CODE_account_update_password_settings 0xfa7c4b86
+#define CODE_auth_check_password 0x0a63011e
+#define CODE_auth_request_password_recovery 0xd897bc66
+#define CODE_auth_recover_password 0x4ea56e92
+#define CODE_invoke_without_updates 0xbf9459b7
+#define CODE_messages_export_chat_invite 0x7d885289
+#define CODE_messages_check_chat_invite 0x3eadb1bb
+#define CODE_messages_import_chat_invite 0x6c50051c
+#define CODE_messages_get_sticker_set 0x2619a90e
+#define CODE_messages_install_sticker_set 0xefbbfae9
+#define CODE_messages_uninstall_sticker_set 0xf96e55de
+#define CODE_messages_start_bot 0x1b3e0ffc
+#define CODE_decrypted_message_media_empty 0x089f5c4a
+#define CODE_decrypted_message_media_photo 0x32798a8c
+#define CODE_decrypted_message_media_geo_point 0x35480a59
+#define CODE_decrypted_message_media_contact 0x588a0a97
+#define CODE_decrypted_message_action_set_message_t_t_l 0xa1733aec
+#define CODE_decrypted_message_media_document 0xb095434b
+#define CODE_decrypted_message_action_read_messages 0x0c4f40be
+#define CODE_decrypted_message_action_delete_messages 0x65614304
+#define CODE_decrypted_message_action_screenshot_messages 0x8ac1f475
+#define CODE_decrypted_message_action_flush_history 0x6719e45c
+#define CODE_decrypted_message 0x204d3878
+#define CODE_decrypted_message_service 0x73164160
+#define CODE_decrypted_message_media_video 0x524a415d
+#define CODE_decrypted_message_media_audio 0x57e0a9cb
+#define CODE_decrypted_message_layer 0x1be31789
+#define CODE_decrypted_message_action_resend 0x511110b0
+#define CODE_decrypted_message_action_notify_layer 0xf3048883
+#define CODE_decrypted_message_action_typing 0xccb27641
+#define CODE_decrypted_message_action_request_key 0xf3c9611b
+#define CODE_decrypted_message_action_accept_key 0x6fe1735b
+#define CODE_decrypted_message_action_abort_key 0xdd05ec6b
+#define CODE_decrypted_message_action_commit_key 0xec2e0b9b
+#define CODE_decrypted_message_action_noop 0xa82fdd63
+#define CODE_decrypted_message_media_external_document 0xfa95b0dd
+#define CODE_binlog_encr_key 0x0377168f
+#define CODE_binlog_start 0x3b06de69
+#define CODE_binlog_dc_option 0xf96feb32
+#define CODE_binlog_dc_option_new 0x7c0d22d8
+#define CODE_binlog_auth_key 0x71e8c156
+#define CODE_binlog_default_dc 0x9e83dbdc
+#define CODE_binlog_dc_signed 0x26451bb5
+#define CODE_binlog_our_id 0x68a870e8
+#define CODE_binlog_set_dh_params 0xeaeb7826
+#define CODE_binlog_set_pts 0x2ca8c939
+#define CODE_binlog_set_qts 0xd95738ac
+#define CODE_binlog_set_date 0x1d0f4b52
+#define CODE_binlog_set_seq 0x6eeb2989
+#define CODE_binlog_encr_chat_delete 0xee1b38e8
+#define CODE_binlog_encr_chat_new 0x84977251
+#define CODE_binlog_encr_chat_exchange_new 0x9d49488d
+#define CODE_binlog_user_delete 0xac55d447
+#define CODE_binlog_user_new 0x127cf2f9
+#define CODE_binlog_chat_new 0x0a10aa92
+#define CODE_binlog_chat_add_participant 0x535475ea
+#define CODE_binlog_chat_del_participant 0x7dd1a1a2
+#define CODE_binlog_set_msg_id 0x3c873416
+#define CODE_binlog_message_delete 0x847e77b1
+#define CODE_binlog_message_new 0x427cfcdb
+#define CODE_binlog_message_encr_new 0x6cf7cabc
+#define CODE_binlog_msg_update 0x6dd4d85f
+#define CODE_binlog_reset_authorization 0x83327955
+#define CODE_res_p_q 0x05162463
+#define CODE_server__d_h_params_fail 0x79cb045d
+#define CODE_server__d_h_params_ok 0xd0e8075c
+#define CODE_p_q_inner_data 0x83c95aec
+#define CODE_p_q_inner_data_temp 0x3c6a84d4
+#define CODE_client__d_h_inner_data 0x6643b654
+#define CODE_dh_gen_ok 0x3bcbf734
+#define CODE_dh_gen_retry 0x46dc1fb9
+#define CODE_dh_gen_fail 0xa69dae02
+#define CODE_server__d_h_inner_data 0xb5890dba
+#define CODE_req_pq 0x60469778
+#define CODE_req__d_h_params 0xd712e4be
+#define CODE_set_client__d_h_params 0xf5045f1f
+#define CODE_decrypted_message_media_video_l12 0x4cee6ef3
+#define CODE_decrypted_message_media_audio_l12 0x6080758f
+#define CODE_update_msg_update 0x03114739
+#define CODE_message_media_photo_l27 0xc8c45a2a
+#define CODE_message_media_video_l27 0xa2d24290
+#endif
diff --git a/protocols/Telegram/tgl/auto/scheme.tl b/protocols/Telegram/tgl/auto/scheme.tl
new file mode 100644
index 0000000000..e95425f435
--- /dev/null
+++ b/protocols/Telegram/tgl/auto/scheme.tl
@@ -0,0 +1,829 @@
+int ?= Int;
+long ?= Long;
+double ?= Double;
+string ?= String;
+
+bytes string = Bytes;
+
+int128 long long = Int128;
+int256 long long long long = Int256;
+
+boolFalse#bc799737 = Bool;
+boolTrue#997275b5 = Bool;
+
+vector#1cb5c415 {t:Type} # [ t ] = Vector t;
+
+error#c4b9f9bb code:int text:string = Error;
+
+null#56730bcc = Null;
+
+inputPeerEmpty#7f3b18ea = InputPeer;
+inputPeerSelf#7da07ec9 = InputPeer;
+inputPeerContact#1023dbe8 user_id:int = InputPeer;
+inputPeerForeign#9b447325 user_id:int access_hash:long = InputPeer;
+inputPeerChat#179be863 chat_id:int = InputPeer;
+
+inputUserEmpty#b98886cf = InputUser;
+inputUserSelf#f7c1b13f = InputUser;
+inputUserContact#86e94f65 user_id:int = InputUser;
+inputUserForeign#655e74ff user_id:int access_hash:long = InputUser;
+
+inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact;
+
+inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;
+
+inputMediaEmpty#9664f57f = InputMedia;
+inputMediaUploadedPhoto#f7aff1c0 file:InputFile caption:string = InputMedia;
+inputMediaPhoto#e9bfb4f3 id:InputPhoto caption:string = InputMedia;
+inputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;
+inputMediaContact#a6e45987 phone_number:string first_name:string last_name:string = InputMedia;
+inputMediaUploadedVideo#e13fd4bc file:InputFile duration:int w:int h:int caption:string = InputMedia;
+inputMediaUploadedThumbVideo#96fb97dc file:InputFile thumb:InputFile duration:int w:int h:int caption:string = InputMedia;
+inputMediaVideo#936a4ebd video_id:InputVideo caption:string = InputMedia;
+
+inputChatPhotoEmpty#1ca48f57 = InputChatPhoto;
+inputChatUploadedPhoto#94254732 file:InputFile crop:InputPhotoCrop = InputChatPhoto;
+inputChatPhoto#b2e1bf08 id:InputPhoto crop:InputPhotoCrop = InputChatPhoto;
+
+inputGeoPointEmpty#e4c123d6 = InputGeoPoint;
+inputGeoPoint#f3b7acc9 latitude:double longitude:double = InputGeoPoint;
+
+inputPhotoEmpty#1cd7bf0d = InputPhoto;
+inputPhoto#fb95c6c4 id:long access_hash:long = InputPhoto;
+
+inputVideoEmpty#5508ec75 = InputVideo;
+inputVideo#ee579652 id:long access_hash:long = InputVideo;
+
+inputFileLocation#14637196 volume_id:long local_id:int secret:long = InputFileLocation;
+inputVideoFileLocation#3d0364ec id:long access_hash:long = InputFileLocation;
+
+inputPhotoCropAuto#ade6b004 = InputPhotoCrop;
+inputPhotoCrop#d9915325 crop_left:double crop_top:double crop_width:double = InputPhotoCrop;
+
+inputAppEvent#770656a8 time:double type:string peer:long data:string = InputAppEvent;
+
+peerUser#9db1bc6d user_id:int = Peer;
+peerChat#bad0e5bb chat_id:int = Peer;
+
+storage.fileUnknown#aa963b05 = storage.FileType;
+storage.fileJpeg#7efe0e = storage.FileType;
+storage.fileGif#cae1aadf = storage.FileType;
+storage.filePng#a4f63c0 = storage.FileType;
+storage.filePdf#ae1e508d = storage.FileType;
+storage.fileMp3#528a0677 = storage.FileType;
+storage.fileMov#4b09ebbc = storage.FileType;
+storage.filePartial#40bc6f52 = storage.FileType;
+storage.fileMp4#b3cea0e4 = storage.FileType;
+storage.fileWebp#1081464c = storage.FileType;
+
+fileLocationUnavailable#7c596b46 volume_id:long local_id:int secret:long = FileLocation;
+fileLocation#53d69076 dc_id:int volume_id:long local_id:int secret:long = FileLocation;
+
+userEmpty#200250ba id:int = User;
+
+userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
+userProfilePhoto#d559d8c8 photo_id:long photo_small:FileLocation photo_big:FileLocation = UserProfilePhoto;
+
+userStatusEmpty#9d05049 = UserStatus;
+userStatusOnline#edb93949 expires:int = UserStatus;
+userStatusOffline#8c703f was_online:int = UserStatus;
+
+chatEmpty#9ba2d800 id:int = Chat;
+chat#6e9c9bc7 id:int title:string photo:ChatPhoto participants_count:int date:int left:Bool version:int = Chat;
+chatForbidden#fb0ccc41 id:int title:string date:int = Chat;
+
+chatFull#2e02a614 id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector<BotInfo> = ChatFull;
+
+
+chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant;
+
+chatParticipantsForbidden#fd2bb8a chat_id:int = ChatParticipants;
+chatParticipants#7841b415 chat_id:int admin_id:int participants:Vector<ChatParticipant> version:int = ChatParticipants;
+
+chatPhotoEmpty#37c1011c = ChatPhoto;
+chatPhoto#6153276a photo_small:FileLocation photo_big:FileLocation = ChatPhoto;
+
+messageEmpty#83e5de54 id:int = Message;
+message#c3060325 flags:# id:int from_id:int to_id:Peer fwd_from_id:flags.2?int fwd_date:flags.2?int reply_to_msg_id:flags.3?int date:int message:string media:MessageMedia reply_markup:flags.6?ReplyMarkup = Message;
+messageService#1d86f70e flags:int id:int from_id:int to_id:Peer date:int action:MessageAction = Message;
+
+messageMediaEmpty#3ded6320 = MessageMedia;
+messageMediaPhoto#3d8ce53d photo:Photo caption:string = MessageMedia;
+messageMediaVideo#5bcf1675 video:Video caption:string = MessageMedia;
+messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;
+messageMediaContact#5e7d2f39 phone_number:string first_name:string last_name:string user_id:int = MessageMedia;
+messageMediaUnsupported#9f84f49e = MessageMedia;
+
+messageActionEmpty#b6aef7b0 = MessageAction;
+messageActionChatCreate#a6638b9a title:string users:Vector<int> = MessageAction;
+messageActionChatEditTitle#b5a1ce5a title:string = MessageAction;
+messageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction;
+messageActionChatDeletePhoto#95e3fbef = MessageAction;
+messageActionChatAddUser#5e3cfc4b user_id:int = MessageAction;
+messageActionChatDeleteUser#b2ae9b0c user_id:int = MessageAction;
+
+dialog#c1dd804a peer:Peer top_message:int read_inbox_max_id:int unread_count:int notify_settings:PeerNotifySettings = Dialog;
+
+photoEmpty#2331b22d id:long = Photo;
+photo#c3838076 id:long access_hash:long user_id:int date:int geo:GeoPoint sizes:Vector<PhotoSize> = Photo;
+photoL27#22b56751 id:long access_hash:long user_id:int date:int caption:string geo:GeoPoint sizes:Vector<PhotoSize> = Photo;
+
+photoSizeEmpty#e17e23c type:string = PhotoSize;
+photoSize#77bfb61b type:string location:FileLocation w:int h:int size:int = PhotoSize;
+photoCachedSize#e9a734fa type:string location:FileLocation w:int h:int bytes:bytes = PhotoSize;
+
+videoEmpty#c10658a8 id:long = Video;
+video#ee9f4a4d id:long access_hash:long user_id:int date:int duration:int size:int thumb:PhotoSize dc_id:int w:int h:int = Video;
+videoL27#388fa391 id:long access_hash:long user_id:int date:int caption:string duration:int mime_type:string size:int thumb:PhotoSize dc_id:int w:int h:int = Video;
+
+geoPointEmpty#1117dd5f = GeoPoint;
+geoPoint#2049d70c longitude:double latitude:double = GeoPoint;
+
+auth.checkedPhone#811ea28e phone_registered:Bool = auth.CheckedPhone;
+
+auth.sentCode#efed51d9 phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
+
+auth.authorization#ff036af1 user:User = auth.Authorization;
+
+auth.exportedAuthorization#df969c2d id:int bytes:bytes = auth.ExportedAuthorization;
+
+inputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer;
+inputNotifyUsers#193b4417 = InputNotifyPeer;
+inputNotifyChats#4a95e84e = InputNotifyPeer;
+inputNotifyAll#a429b886 = InputNotifyPeer;
+
+inputPeerNotifyEventsEmpty#f03064d8 = InputPeerNotifyEvents;
+inputPeerNotifyEventsAll#e86a2c74 = InputPeerNotifyEvents;
+
+inputPeerNotifySettings#46a2ce98 mute_until:int sound:string show_previews:Bool events_mask:int = InputPeerNotifySettings;
+
+peerNotifyEventsEmpty#add53cb3 = PeerNotifyEvents;
+peerNotifyEventsAll#6d1ded88 = PeerNotifyEvents;
+
+peerNotifySettingsEmpty#70a68512 = PeerNotifySettings;
+peerNotifySettings#8d5e11ee mute_until:int sound:string show_previews:Bool events_mask:int = PeerNotifySettings;
+
+wallPaper#ccb03657 id:int title:string sizes:Vector<PhotoSize> color:int = WallPaper;
+
+userFull#5a89ac5b user:User link:contacts.Link profile_photo:Photo notify_settings:PeerNotifySettings blocked:Bool bot_info:BotInfo = UserFull;
+
+contact#f911c994 user_id:int mutual:Bool = Contact;
+
+importedContact#d0028438 user_id:int client_id:long = ImportedContact;
+
+contactBlocked#561bc879 user_id:int date:int = ContactBlocked;
+
+contactSuggested#3de191a1 user_id:int mutual_contacts:int = ContactSuggested;
+
+contactStatus#d3680c61 user_id:int status:UserStatus = ContactStatus;
+
+chatLocated#3631cf4c chat_id:int distance:int = ChatLocated;
+
+contacts.link#3ace484c my_link:ContactLink foreign_link:ContactLink user:User = contacts.Link;
+
+contacts.contactsNotModified#b74ba9d2 = contacts.Contacts;
+contacts.contacts#6f8b8cb2 contacts:Vector<Contact> users:Vector<User> = contacts.Contacts;
+
+contacts.importedContacts#ad524315 imported:Vector<ImportedContact> retry_contacts:Vector<long> users:Vector<User> = contacts.ImportedContacts;
+
+contacts.blocked#1c138d15 blocked:Vector<ContactBlocked> users:Vector<User> = contacts.Blocked;
+contacts.blockedSlice#900802a1 count:int blocked:Vector<ContactBlocked> users:Vector<User> = contacts.Blocked;
+
+contacts.suggested#5649dcc5 results:Vector<ContactSuggested> users:Vector<User> = contacts.Suggested;
+
+messages.dialogs#15ba6c40 dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
+messages.dialogsSlice#71e094f3 count:int dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
+
+messages.messages#8c718e87 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+messages.messagesSlice#b446ae3 count:int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+
+messages.messageEmpty#3f4e0648 = messages.Message;
+
+messages.sentMessage#4c3d47f3 id:int date:int media:MessageMedia pts:int pts_count:int = messages.SentMessage;
+
+messages.chats#64ff9fd5 chats:Vector<Chat> = messages.Chats;
+
+messages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector<Chat> users:Vector<User> = messages.ChatFull;
+
+messages.affectedHistory#b45c69d1 pts:int pts_count:int offset:int = messages.AffectedHistory;
+
+inputMessagesFilterEmpty#57e2f66c = MessagesFilter;
+inputMessagesFilterPhotos#9609a51c = MessagesFilter;
+inputMessagesFilterVideo#9fc00e65 = MessagesFilter;
+inputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter;
+inputMessagesFilterPhotoVideoDocuments#d95e73bb = MessagesFilter;
+inputMessagesFilterDocument#9eddf188 = MessagesFilter;
+inputMessagesFilterAudio#cfc87522 = MessagesFilter;
+
+updateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update;
+updateMessageID#4e90bfd6 id:int random_id:long = Update;
+updateDeleteMessages#a20db0e5 messages:Vector<int> pts:int pts_count:int = Update;
+updateUserTyping#5c486927 user_id:int action:SendMessageAction = Update;
+updateChatUserTyping#9a65ea1f chat_id:int user_id:int action:SendMessageAction = Update;
+updateChatParticipants#7761198 participants:ChatParticipants = Update;
+updateUserStatus#1bfbd823 user_id:int status:UserStatus = Update;
+updateUserName#a7332b73 user_id:int first_name:string last_name:string username:string = Update;
+updateUserPhoto#95313b0c user_id:int date:int photo:UserProfilePhoto previous:Bool = Update;
+updateContactRegistered#2575bbb9 user_id:int date:int = Update;
+updateContactLink#9d2e67c5 user_id:int my_link:ContactLink foreign_link:ContactLink = Update;
+updateNewAuthorization#8f06529a auth_key_id:long date:int device:string location:string = Update;
+
+updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
+
+updates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference;
+updates.difference#f49ca0 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> state:updates.State = updates.Difference;
+updates.differenceSlice#a8fb1981 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> intermediate_state:updates.State = updates.Difference;
+
+updatesTooLong#e317af7e = Updates;
+updateShortMessage#ed5c2127 flags:# id:int user_id:int message:string pts:int pts_count:int date:int fwd_from_id:flags.2?int fwd_date:flags.2?int reply_to_msg_id:flags.3?int = Updates;
+updateShortChatMessage#52238b3c flags:# id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from_id:flags.2?int fwd_date:flags.2?int reply_to_msg_id:flags.3?int = Updates;
+updateShort#78d4dec1 update:Update date:int = Updates;
+updatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;
+updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
+
+photos.photos#8dca6aa5 photos:Vector<Photo> users:Vector<User> = photos.Photos;
+photos.photosSlice#15051f54 count:int photos:Vector<Photo> users:Vector<User> = photos.Photos;
+
+photos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;
+
+upload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;
+
+dcOptionL28#2ec2a43c id:int hostname:string ip_address:string port:int = DcOption;
+dcOption#5d8c6cc flags:int id:int ip_address:string port:int = DcOption;
+
+config#4e32b894 date:int expires:int test_mode:Bool this_dc:int dc_options:Vector<DcOption> chat_size_max:int broadcast_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int chat_big_size:int push_chat_period_ms:int push_chat_limit:int disabled_features:Vector<DisabledFeature> = Config;
+
+nearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;
+
+help.appUpdate#8987f311 id:int critical:Bool url:string text:string = help.AppUpdate;
+help.noAppUpdate#c45a6536 = help.AppUpdate;
+
+help.inviteText#18cb9f78 message:string = help.InviteText;
+
+messages.sentMessageLink#35a1a663 id:int date:int media:MessageMedia pts:int pts_count:int links:Vector<contacts.Link> seq:int = messages.SentMessage;
+
+inputGeoChat#74d456fa chat_id:int access_hash:long = InputGeoChat;
+
+inputNotifyGeoChatPeer#4d8ddec8 geo_peer:InputGeoChat = InputNotifyPeer;
+
+geoChat#75eaea5a id:int access_hash:long title:string address:string venue:string geo:GeoPoint photo:ChatPhoto participants_count:int date:int checked_in:Bool version:int = Chat;
+
+geoChatMessageEmpty#60311a9b chat_id:int id:int = GeoChatMessage;
+geoChatMessage#4505f8e1 chat_id:int id:int from_id:int date:int message:string media:MessageMedia = GeoChatMessage;
+geoChatMessageService#d34fa24e chat_id:int id:int from_id:int date:int action:MessageAction = GeoChatMessage;
+
+geochats.statedMessage#17b1578b message:GeoChatMessage chats:Vector<Chat> users:Vector<User> seq:int = geochats.StatedMessage;
+
+geochats.located#48feb267 results:Vector<ChatLocated> messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Located;
+
+geochats.messages#d1526db1 messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Messages;
+geochats.messagesSlice#bc5863e8 count:int messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Messages;
+
+messageActionGeoChatCreate#6f038ebc title:string address:string = MessageAction;
+messageActionGeoChatCheckin#c7d53de = MessageAction;
+
+updateNewGeoChatMessage#5a68e3f7 geo_message:GeoChatMessage = Update;
+
+wallPaperSolid#63117f24 id:int title:string bg_color:int color:int = WallPaper;
+
+updateNewEncryptedMessage#12bcbd9a encr_message:EncryptedMessage qts:int = Update;
+updateEncryptedChatTyping#1710f156 chat_id:int = Update;
+updateEncryption#b4a2e88d encr_chat:EncryptedChat date:int = Update;
+updateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update;
+
+encryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat;
+encryptedChatWaiting#3bf703dc id:int access_hash:long date:int admin_id:int participant_id:int = EncryptedChat;
+encryptedChatRequested#c878527e id:int access_hash:long date:int admin_id:int participant_id:int g_a:bytes = EncryptedChat;
+encryptedChat#fa56ce36 id:int access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long = EncryptedChat;
+encryptedChatDiscarded#13d6dd27 id:int = EncryptedChat;
+
+inputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat;
+
+encryptedFileEmpty#c21f497e = EncryptedFile;
+encryptedFile#4a70994c id:long access_hash:long size:int dc_id:int key_fingerprint:int = EncryptedFile;
+
+inputEncryptedFileEmpty#1837c364 = InputEncryptedFile;
+inputEncryptedFileUploaded#64bd0306 id:long parts:int md5_checksum:string key_fingerprint:int = InputEncryptedFile;
+inputEncryptedFile#5a17b5e5 id:long access_hash:long = InputEncryptedFile;
+
+inputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation;
+
+encryptedMessage#ed18c118 random_id:long chat_id:int date:int bytes:bytes file:EncryptedFile = EncryptedMessage;
+encryptedMessageService#23734b06 random_id:long chat_id:int date:int bytes:bytes = EncryptedMessage;
+
+messages.dhConfigNotModified#c0e24635 random:bytes = messages.DhConfig;
+messages.dhConfig#2c221edd g:int p:bytes version:int random:bytes = messages.DhConfig;
+
+messages.sentEncryptedMessage#560f8935 date:int = messages.SentEncryptedMessage;
+messages.sentEncryptedFile#9493ff32 date:int file:EncryptedFile = messages.SentEncryptedMessage;
+
+inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;
+
+inputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile;
+
+updateChatParticipantAdd#3a0eeb22 chat_id:int user_id:int inviter_id:int version:int = Update;
+updateChatParticipantDelete#6e5f8c22 chat_id:int user_id:int version:int = Update;
+updateDcOptions#8e5e9873 dc_options:Vector<DcOption> = Update;
+
+inputMediaUploadedAudio#4e498cab file:InputFile duration:int mime_type:string = InputMedia;
+inputMediaAudio#89938781 audio_id:InputAudio = InputMedia;
+inputMediaUploadedDocument#ffe76b78 file:InputFile mime_type:string attributes:Vector<DocumentAttribute> = InputMedia;
+inputMediaUploadedThumbDocument#41481486 file:InputFile thumb:InputFile mime_type:string attributes:Vector<DocumentAttribute> = InputMedia;
+inputMediaDocument#d184e841 document_id:InputDocument = InputMedia;
+
+messageMediaDocument#2fda2204 document:Document = MessageMedia;
+messageMediaAudio#c6b68300 audio:Audio = MessageMedia;
+
+inputAudioEmpty#d95adc84 = InputAudio;
+inputAudio#77d440ff id:long access_hash:long = InputAudio;
+
+inputDocumentEmpty#72f0eaae = InputDocument;
+inputDocument#18798952 id:long access_hash:long = InputDocument;
+
+inputAudioFileLocation#74dc404d id:long access_hash:long = InputFileLocation;
+inputDocumentFileLocation#4e45abe9 id:long access_hash:long = InputFileLocation;
+
+audioEmpty#586988d8 id:long = Audio;
+audio#c7ac6496 id:long access_hash:long user_id:int date:int duration:int mime_type:string size:int dc_id:int = Audio;
+
+documentEmpty#36f8c871 id:long = Document;
+document#f9a39f4f id:long access_hash:long date:int mime_type:string size:int thumb:PhotoSize dc_id:int attributes:Vector<DocumentAttribute> = Document;
+document_l19#9efc6326 id:long access_hash:long user_id:int date:int file_name:string mime_type:string size:int thumb:PhotoSize dc_id:int = Document;
+
+help.support#17c6b5f6 phone_number:string user:User = help.Support;
+
+notifyPeer#9fd40bd8 peer:Peer = NotifyPeer;
+notifyUsers#b4c83b4c = NotifyPeer;
+notifyChats#c007cec3 = NotifyPeer;
+notifyAll#74d07c60 = NotifyPeer;
+
+updateUserBlocked#80ece81a user_id:int blocked:Bool = Update;
+updateNotifySettings#bec268ef notify_peer:NotifyPeer notify_settings:PeerNotifySettings = Update;
+
+auth.sentAppCode#e325edcf phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
+
+sendMessageTypingAction#16bf744e = SendMessageAction;
+sendMessageCancelAction#fd5ec8f5 = SendMessageAction;
+sendMessageRecordVideoAction#a187d66f = SendMessageAction;
+sendMessageUploadVideoActionL27#92042ff7 = SendMessageAction;
+sendMessageUploadVideoAction#e9763aec progress:int = SendMessageAction;
+sendMessageRecordAudioAction#d52f73f7 = SendMessageAction;
+sendMessageUploadAudioActionL27#e6ac8a6f = SendMessageAction;
+sendMessageUploadAudioAction#f351d7ab progress:int = SendMessageAction;
+sendMessageUploadPhotoAction#d1d34a26 progress:int = SendMessageAction;
+sendMessageUploadDocumentActionL27#8faee98e = SendMessageAction;
+sendMessageUploadDocumentAction#aa0cd9e4 progress:int = SendMessageAction;
+sendMessageGeoLocationAction#176f8ba1 = SendMessageAction;
+sendMessageChooseContactAction#628cbc6f = SendMessageAction;
+
+contactFound#ea879f95 user_id:int = ContactFound;
+
+contacts.found#566000e results:Vector<ContactFound> users:Vector<User> = contacts.Found;
+
+updateServiceNotification#382dd3e4 type:string message_text:string media:MessageMedia popup:Bool = Update;
+
+userStatusRecently#e26f42f1 = UserStatus;
+userStatusLastWeek#7bf09fc = UserStatus;
+userStatusLastMonth#77ebc742 = UserStatus;
+
+updatePrivacy#ee3b272a key:PrivacyKey rules:Vector<PrivacyRule> = Update;
+
+inputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey;
+
+privacyKeyStatusTimestamp#bc2eab30 = PrivacyKey;
+
+inputPrivacyValueAllowContacts#d09e07b = InputPrivacyRule;
+inputPrivacyValueAllowAll#184b35ce = InputPrivacyRule;
+inputPrivacyValueAllowUsers#131cc67f users:Vector<InputUser> = InputPrivacyRule;
+inputPrivacyValueDisallowContacts#ba52007 = InputPrivacyRule;
+inputPrivacyValueDisallowAll#d66b66c9 = InputPrivacyRule;
+inputPrivacyValueDisallowUsers#90110467 users:Vector<InputUser> = InputPrivacyRule;
+
+privacyValueAllowContacts#fffe1bac = PrivacyRule;
+privacyValueAllowAll#65427b82 = PrivacyRule;
+privacyValueAllowUsers#4d5bbe0c users:Vector<int> = PrivacyRule;
+privacyValueDisallowContacts#f888fa1a = PrivacyRule;
+privacyValueDisallowAll#8b73e763 = PrivacyRule;
+privacyValueDisallowUsers#c7f49b7 users:Vector<int> = PrivacyRule;
+
+account.privacyRules#554abb6f rules:Vector<PrivacyRule> users:Vector<User> = account.PrivacyRules;
+
+accountDaysTTL#b8d0afdf days:int = AccountDaysTTL;
+
+account.sentChangePhoneCode#a4f58c4c phone_code_hash:string send_call_timeout:int = account.SentChangePhoneCode;
+
+updateUserPhone#12b9417b user_id:int phone:string = Update;
+
+documentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute;
+documentAttributeAnimated#11b58939 = DocumentAttribute;
+documentAttributeStickerL28#994c9882 alt:string = DocumentAttribute;
+documentAttributeSticker#3a556302 alt:string stickerset:InputStickerSet = DocumentAttribute;
+documentAttributeVideo#5910cccb duration:int w:int h:int = DocumentAttribute;
+documentAttributeAudio#51448e5 duration:int = DocumentAttribute;
+documentAttributeFilename#15590068 file_name:string = DocumentAttribute;
+
+messages.stickersNotModified#f1749a22 = messages.Stickers;
+messages.stickers#8a8ecd32 hash:string stickers:Vector<Document> = messages.Stickers;
+
+stickerPack#12b299d4 emoticon:string documents:Vector<long> = StickerPack;
+
+messages.allStickersNotModified#e86602c3 = messages.AllStickers;
+messages.allStickers#5ce352ec hash:string packs:Vector<StickerPack> sets:Vector<StickerSet> documents:Vector<Document> = messages.AllStickers;
+
+disabledFeature#ae636f24 feature:string description:string = DisabledFeature;
+
+updateReadHistoryInbox#9961fd5c peer:Peer max_id:int pts:int pts_count:int = Update;
+updateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update;
+
+messages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages;
+
+contactLinkUnknown#5f4f9247 = ContactLink;
+contactLinkNone#feedd3ad = ContactLink;
+contactLinkHasPhone#268f3f59 = ContactLink;
+contactLinkContact#d502c2d0 = ContactLink;
+
+updateWebPage#2cc36971 webpage:WebPage = Update;
+
+webPageEmpty#eb1477e8 id:long = WebPage;
+webPagePending#c586da1c id:long date:int = WebPage;
+webPage#a31ea0b5 flags:# id:long url:string display_url:string type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string = WebPage;
+
+messageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia;
+
+authorization#7bf2e6f6 hash:long flags:int device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization;
+
+account.authorizations#1250abde authorizations:Vector<Authorization> = account.Authorizations;
+
+account.noPassword#96dabc18 new_salt:bytes email_unconfirmed_pattern:string = account.Password;
+account.password#7c18141c current_salt:bytes new_salt:bytes hint:string has_recovery:Bool email_unconfirmed_pattern:string = account.Password;
+
+account.passwordSettings#b7b72ab3 email:string = account.PasswordSettings;
+
+account.passwordInputSettings#bcfc532c flags:# new_salt:flags.0?bytes new_password_hash:flags.0?bytes hint:flags.0?string email:flags.1?string = account.PasswordInputSettings;
+
+auth.passwordRecovery#137948a5 email_pattern:string = auth.PasswordRecovery;
+
+inputMediaVenue#2827a81a geo_point:InputGeoPoint title:string address:string provider:string venue_id:string = InputMedia;
+
+messageMediaVenue#7912b71f geo:GeoPoint title:string address:string provider:string venue_id:string = MessageMedia;
+
+receivedNotifyMessage#a384b779 id:int flags:int = ReceivedNotifyMessage;
+
+chatInviteEmpty#69df3769 = ExportedChatInvite;
+chatInviteExported#fc2e05bc link:string = ExportedChatInvite;
+
+chatInviteAlready#5a686d7c chat:Chat = ChatInvite;
+chatInvite#ce917dcd title:string = ChatInvite;
+
+messageActionChatJoinedByLink#f89cf5e8 inviter_id:int = MessageAction;
+
+updateReadMessagesContents#68c13933 messages:Vector<int> pts:int pts_count:int = Update;
+
+inputStickerSetEmpty#ffb62b95 = InputStickerSet;
+inputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet;
+inputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet;
+
+stickerSet#a7a43b17 id:long access_hash:long title:string short_name:string = StickerSet;
+
+messages.stickerSet#b60a24a6 set:StickerSet packs:Vector<StickerPack> documents:Vector<Document> = messages.StickerSet;
+
+user#22e49072 flags:# id:int access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int = User;
+
+botCommand#c27ac8c7 command:string description:string = BotCommand;
+botCommandOld#b79d22ab command:string params:string description:string = BotCommand;
+
+botInfoEmpty#bb2e37ce = BotInfo;
+botInfo#9cf585d user_id:int version:int share_text:string description:string commands:Vector<BotCommand> = BotInfo;
+
+keyboardButton#a2fa4880 text:string = KeyboardButton;
+
+keyboardButtonRow#77608b83 buttons:Vector<KeyboardButton> = KeyboardButtonRow;
+
+replyKeyboardHide#a03e5b85 flags:int = ReplyMarkup;
+replyKeyboardForceReply#f4108aa0 flags:int = ReplyMarkup;
+replyKeyboardMarkup#3502758c flags:int rows:Vector<KeyboardButtonRow> = ReplyMarkup;
+
+---functions---
+
+invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
+
+invokeAfterMsgs#3dc4b4f0 {X:Type} msg_ids:Vector<long> query:!X = X;
+
+auth.checkPhone#6fe51dfb phone_number:string = auth.CheckedPhone;
+auth.sendCode#768d5f4d phone_number:string sms_type:int api_id:int api_hash:string lang_code:string = auth.SentCode;
+auth.sendCall#3c51564 phone_number:string phone_code_hash:string = Bool;
+auth.signUp#1b067634 phone_number:string phone_code_hash:string phone_code:string first_name:string last_name:string = auth.Authorization;
+auth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:string = auth.Authorization;
+auth.logOut#5717da40 = Bool;
+auth.resetAuthorizations#9fab0d1a = Bool;
+auth.sendInvites#771c1d97 phone_numbers:Vector<string> message:string = Bool;
+auth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization;
+auth.importAuthorization#e3ef9613 id:int bytes:bytes = auth.Authorization;
+auth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool;
+
+account.registerDevice#446c712c token_type:int token:string device_model:string system_version:string app_version:string app_sandbox:Bool lang_code:string = Bool;
+account.unregisterDevice#65c55b40 token_type:int token:string = Bool;
+account.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool;
+account.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings;
+account.resetNotifySettings#db7e1747 = Bool;
+account.updateProfile#f0888d68 first_name:string last_name:string = User;
+account.updateStatus#6628562c offline:Bool = Bool;
+account.getWallPapers#c04cfac2 = Vector<WallPaper>;
+
+users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
+users.getFullUser#ca30a5b1 id:InputUser = UserFull;
+
+contacts.getStatuses#c4a353ee = Vector<ContactStatus>;
+contacts.getContacts#22c6aa08 hash:string = contacts.Contacts;
+contacts.importContacts#da30b32d contacts:Vector<InputContact> replace:Bool = contacts.ImportedContacts;
+contacts.getSuggested#cd773428 limit:int = contacts.Suggested;
+contacts.deleteContact#8e953744 id:InputUser = contacts.Link;
+contacts.deleteContacts#59ab389e id:Vector<InputUser> = Bool;
+contacts.block#332b49fc id:InputUser = Bool;
+contacts.unblock#e54100bd id:InputUser = Bool;
+contacts.getBlocked#f57c350f offset:int limit:int = contacts.Blocked;
+contacts.exportCard#84e53737 = Vector<int>;
+contacts.importCard#4fe196fe export_card:Vector<int> = User;
+
+messages.getMessages#4222fa74 id:Vector<int> = messages.Messages;
+messages.getDialogs#eccf1df6 offset:int max_id:int limit:int = messages.Dialogs;
+messages.getHistory#92a1df2f peer:InputPeer offset:int max_id:int limit:int = messages.Messages;
+messages.search#7e9f2ab peer:InputPeer q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = messages.Messages;
+messages.readHistory#b04f2510 peer:InputPeer max_id:int offset:int = messages.AffectedHistory;
+messages.deleteHistory#f4f8fb61 peer:InputPeer offset:int = messages.AffectedHistory;
+messages.deleteMessages#a5f18925 id:Vector<int> = messages.AffectedMessages;
+messages.receivedMessages#5a954c0 max_id:int = Vector<ReceivedNotifyMessage>;
+messages.setTyping#a3825e50 peer:InputPeer action:SendMessageAction = Bool;
+messages.sendMessage#fc55e6b5 flags:# peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long reply_markup:flags.2?ReplyMarkup = messages.SentMessage;
+messages.sendMedia#c8f16791 flags:# peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia random_id:long reply_markup:flags.2?ReplyMarkup = Updates;
+messages.forwardMessages#55e1728d peer:InputPeer id:Vector<int> random_id:Vector<long> = Updates;
+messages.getChats#3c6aa187 id:Vector<int> = messages.Chats;
+messages.getFullChat#3b831c66 chat_id:int = messages.ChatFull;
+messages.editChatTitle#dc452855 chat_id:int title:string = Updates;
+messages.editChatPhoto#ca4c79d8 chat_id:int photo:InputChatPhoto = Updates;
+messages.addChatUser#f9a0aa09 chat_id:int user_id:InputUser fwd_limit:int = Updates;
+messages.deleteChatUser#e0611f16 chat_id:int user_id:InputUser = Updates;
+messages.createChat#9cb126e users:Vector<InputUser> title:string = Updates;
+
+updates.getState#edd4882a = updates.State;
+updates.getDifference#a041495 pts:int date:int qts:int = updates.Difference;
+
+photos.updateProfilePhoto#eef579a0 id:InputPhoto crop:InputPhotoCrop = UserProfilePhoto;
+photos.uploadProfilePhoto#d50f9c88 file:InputFile caption:string geo_point:InputGeoPoint crop:InputPhotoCrop = photos.Photo;
+photos.deletePhotos#87cf7f2f id:Vector<InputPhoto> = Vector<long>;
+
+upload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool;
+upload.getFile#e3a6cfb5 location:InputFileLocation offset:int limit:int = upload.File;
+
+help.getConfig#c4f9186b = Config;
+help.getNearestDc#1fb33026 = NearestDc;
+help.getAppUpdate#c812ac7e device_model:string system_version:string app_version:string lang_code:string = help.AppUpdate;
+help.saveAppLog#6f02f748 events:Vector<InputAppEvent> = Bool;
+help.getInviteText#a4a95186 lang_code:string = help.InviteText;
+
+photos.getUserPhotos#b7ee553c user_id:InputUser offset:int max_id:int limit:int = photos.Photos;
+
+messages.forwardMessage#33963bf9 peer:InputPeer id:int random_id:long = Updates;
+messages.sendBroadcast#bf73f4da contacts:Vector<InputUser> random_id:Vector<long> message:string media:InputMedia = Updates;
+
+geochats.getLocated#7f192d8f geo_point:InputGeoPoint radius:int limit:int = geochats.Located;
+geochats.getRecents#e1427e6f offset:int limit:int = geochats.Messages;
+geochats.checkin#55b3e8fb peer:InputGeoChat = geochats.StatedMessage;
+geochats.getFullChat#6722dd6f peer:InputGeoChat = messages.ChatFull;
+geochats.editChatTitle#4c8e2273 peer:InputGeoChat title:string address:string = geochats.StatedMessage;
+geochats.editChatPhoto#35d81a95 peer:InputGeoChat photo:InputChatPhoto = geochats.StatedMessage;
+geochats.search#cfcdc44d peer:InputGeoChat q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = geochats.Messages;
+geochats.getHistory#b53f7a68 peer:InputGeoChat offset:int max_id:int limit:int = geochats.Messages;
+geochats.setTyping#8b8a729 peer:InputGeoChat typing:Bool = Bool;
+geochats.sendMessage#61b0044 peer:InputGeoChat message:string random_id:long = geochats.StatedMessage;
+geochats.sendMedia#b8f0deff peer:InputGeoChat media:InputMedia random_id:long = geochats.StatedMessage;
+geochats.createGeoChat#e092e16 title:string geo_point:InputGeoPoint address:string venue:string = geochats.StatedMessage;
+
+messages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig;
+messages.requestEncryption#f64daf43 user_id:InputUser random_id:int g_a:bytes = EncryptedChat;
+messages.acceptEncryption#3dbc0415 peer:InputEncryptedChat g_b:bytes key_fingerprint:long = EncryptedChat;
+messages.discardEncryption#edd923c5 chat_id:int = Bool;
+messages.setEncryptedTyping#791451ed peer:InputEncryptedChat typing:Bool = Bool;
+messages.readEncryptedHistory#7f4b690a peer:InputEncryptedChat max_date:int = Bool;
+messages.sendEncrypted#a9776773 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
+messages.sendEncryptedFile#9a901b66 peer:InputEncryptedChat random_id:long data:bytes file:InputEncryptedFile = messages.SentEncryptedMessage;
+messages.sendEncryptedService#32d439a4 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
+messages.receivedQueue#55a5bb66 max_qts:int = Vector<long>;
+
+upload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool;
+
+initConnection#69796de9 {X:Type} api_id:int device_model:string system_version:string app_version:string lang_code:string query:!X = X;
+
+help.getSupport#9cdf08cd = help.Support;
+
+auth.sendSms#da9f3e8 phone_number:string phone_code_hash:string = Bool;
+
+messages.readMessageContents#36a73f77 id:Vector<int> = messages.AffectedMessages;
+
+account.checkUsername#2714d86c username:string = Bool;
+account.updateUsername#3e0bdd7c username:string = User;
+
+contacts.search#11f812d8 q:string limit:int = contacts.Found;
+
+account.getPrivacy#dadbc950 key:InputPrivacyKey = account.PrivacyRules;
+account.setPrivacy#c9f81ce8 key:InputPrivacyKey rules:Vector<InputPrivacyRule> = account.PrivacyRules;
+account.deleteAccount#418d4e0b reason:string = Bool;
+account.getAccountTTL#8fc711d = AccountDaysTTL;
+account.setAccountTTL#2442485e ttl:AccountDaysTTL = Bool;
+
+invokeWithLayer#da9b0d0d {X:Type} layer:int query:!X = X;
+
+contacts.resolveUsername#bf0131c username:string = User;
+
+account.sendChangePhoneCode#a407a8f4 phone_number:string = account.SentChangePhoneCode;
+account.changePhone#70c32edb phone_number:string phone_code_hash:string phone_code:string = User;
+
+messages.getStickers#ae22e045 emoticon:string hash:string = messages.Stickers;
+messages.getAllStickers#aa3bc868 hash:string = messages.AllStickers;
+
+account.updateDeviceLocked#38df3532 period:int = Bool;
+
+auth.importBotAuthorization#67a3ff2c flags:int api_id:int api_hash:string bot_auth_token:string = auth.Authorization;
+
+messages.getWebPagePreview#25223e24 message:string = MessageMedia;
+
+account.getAuthorizations#e320c158 = account.Authorizations;
+account.resetAuthorization#df77f3bc hash:long = Bool;
+account.getPassword#548a30f5 = account.Password;
+account.getPasswordSettings#bc8d11bb current_password_hash:bytes = account.PasswordSettings;
+account.updatePasswordSettings#fa7c4b86 current_password_hash:bytes new_settings:account.PasswordInputSettings = Bool;
+
+auth.checkPassword#a63011e password_hash:bytes = auth.Authorization;
+auth.requestPasswordRecovery#d897bc66 = auth.PasswordRecovery;
+auth.recoverPassword#4ea56e92 code:string = auth.Authorization;
+
+invokeWithoutUpdates#bf9459b7 {X:Type} query:!X = X;
+
+messages.exportChatInvite#7d885289 chat_id:int = ExportedChatInvite;
+messages.checkChatInvite#3eadb1bb hash:string = ChatInvite;
+messages.importChatInvite#6c50051c hash:string = Updates;
+messages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet;
+messages.installStickerSet#efbbfae9 stickerset:InputStickerSet = Bool;
+messages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool;
+messages.startBot#1b3e0ffc bot:InputUser chat_id:int random_id:long start_param:string = Updates;
+---types---
+decryptedMessageMediaEmpty#89f5c4a = DecryptedMessageMedia;
+decryptedMessageMediaPhoto#32798a8c str_thumb:bytes thumb_w:int thumb_h:int w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageMediaGeoPoint#35480a59 latitude:double longitude:double = DecryptedMessageMedia;
+decryptedMessageMediaContact#588a0a97 phone_number:string first_name:string last_name:string user_id:int = DecryptedMessageMedia;
+decryptedMessageActionSetMessageTTL#a1733aec ttl_seconds:int = DecryptedMessageAction;
+decryptedMessageMediaDocument#b095434b str_thumb:bytes thumb_w:int thumb_h:int file_name:string mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageActionReadMessages#c4f40be random_ids:Vector<long> = DecryptedMessageAction;
+decryptedMessageActionDeleteMessages#65614304 random_ids:Vector<long> = DecryptedMessageAction;
+decryptedMessageActionScreenshotMessages#8ac1f475 random_ids:Vector<long> = DecryptedMessageAction;
+decryptedMessageActionFlushHistory#6719e45c = DecryptedMessageAction;
+
+decryptedMessage#204d3878 random_id:long ttl:int message:string media:DecryptedMessageMedia = DecryptedMessage;
+decryptedMessageService#73164160 random_id:long action:DecryptedMessageAction = DecryptedMessage;
+decryptedMessageMediaVideo#524a415d str_thumb:bytes thumb_w:int thumb_h:int duration:int mime_type:string w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageMediaAudio#57e0a9cb duration:int mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageLayer#1be31789 random_bytes:bytes layer:int in_seq_no:int out_seq_no:int message:DecryptedMessage = DecryptedMessageLayer;
+decryptedMessageActionResend#511110b0 start_seq_no:int end_seq_no:int = DecryptedMessageAction;
+decryptedMessageActionNotifyLayer#f3048883 layer:int = DecryptedMessageAction;
+decryptedMessageActionTyping#ccb27641 action:SendMessageAction = DecryptedMessageAction;
+
+decryptedMessageActionRequestKey#f3c9611b exchange_id:long g_a:bytes = DecryptedMessageAction;
+decryptedMessageActionAcceptKey#6fe1735b exchange_id:long g_b:bytes key_fingerprint:long = DecryptedMessageAction;
+decryptedMessageActionAbortKey#dd05ec6b exchange_id:long = DecryptedMessageAction;
+decryptedMessageActionCommitKey#ec2e0b9b exchange_id:long key_fingerprint:long = DecryptedMessageAction;
+decryptedMessageActionNoop#a82fdd63 = DecryptedMessageAction;
+
+decryptedMessageMediaExternalDocument#fa95b0dd id:long access_hash:long date:int mime_type:string size:int thumb:PhotoSize dc_id:int attributes:Vector<DocumentAttribute> = DecryptedMessageMedia;
+---functions---
+---types---
+
+binlog.encrKey key:64*[int] = binlog.EncrKey;
+
+binlog.start = binlog.Update;
+
+binlog.dcOption dc:int name:string ip:string port:int = binlog.Update;
+binlog.dcOptionNew flags:int dc:int name:string ip:string port:int = binlog.Update;
+
+binlog.authKey dc:int key:%binlog.EncrKey = binlog.Update;
+binlog.defaultDc dc:int = binlog.Update;
+binlog.dcSigned dc:int = binlog.Update;
+
+binlog.ourId id:int = binlog.Update;
+
+binlog.setDhParams root:int prime:%binlog.EncrKey version:int = binlog.Update;
+
+binlog.setPts pts:int = binlog.Update;
+binlog.setQts qts:int = binlog.Update;
+binlog.setDate date:int = binlog.Update;
+binlog.setSeq seq:int = binlog.Update;
+
+binlog.encrChatDelete id:int = binlog.Update;
+binlog.encrChatNew#84977251 flags:# id:int
+ access_hash:flags.17?long
+ date:flags.18?int
+ admin:flags.19?int
+ user_id:flags.20?int
+ key:flags.21?%binlog.EncrKey
+ g_key:flags.22?%binlog.EncrKey
+ state:flags.23?int
+ ttl:flags.24?int
+ layer:flags.25?int
+ in_seq_no:flags.26?int last_in_seq_no:flags.26?int out_seq_no:flags.26?int
+ key_fingerprint:flags.27?long
+ = binlog.Update;
+
+binlog.encrChatExchangeNew#9d49488d flags:# id:int
+ exchange_id:flags.17?long
+ key:flags.18?%binlog.EncrKey
+ state:flags.19?int
+ = binlog.Update;
+
+binlog.userDelete id:int = binlog.Update;
+binlog.userNew#127cf2f9 flags:# id:int
+ access_hash:flags.17?long
+ first_name:flags.18?string last_name:flags.18?string
+ phone:flags.19?string
+ username:flags.20?string
+ photo:flags.21?Photo
+ real_first_name:flags.22?string real_last_name:flags.22?string
+ user_photo:flags.23?UserProfilePhoto
+ last_read_in:flags.24?int
+ last_read_out:flags.25?int
+ bot_info:flags.26?BotInfo
+ = binlog.Update;
+
+binlog.chatNew#0a10aa92 flags:# id:int
+ title:flags.17?string
+ user_num:flags.18?int
+ date:flags.19?int
+ version:flags.20?int participants:flags.20?(Vector ChatParticipant)
+ chat_photo:flags.21?ChatPhoto
+ photo:flags.22?Photo
+ admin:flags.23?int
+ last_read_in:flags.24?int
+ last_read_out:flags.25?int
+ = binlog.Update;
+
+binlog.chatAddParticipant id:int version:int user_id:int inviter_id:int date:int = binlog.Update;
+binlog.chatDelParticipant id:int version:int user_id:int = binlog.Update;
+
+binlog.setMsgId old_id:long new_id:int = binlog.Update;
+binlog.messageDelete lid:long = binlog.Update;
+
+binlog.messageNew#427cfcdb flags:# lid:long
+ from_id:flags.17?int to_type:flags.17?int to_id:flags.17?int
+ fwd_from_id:flags.18?int fwd_date:flags.18?int
+ date:flags.19?int
+ message:flags.20?string
+ media:flags.21?MessageMedia
+ action:flags.22?MessageAction
+ reply_id:flags.23?int
+ reply_markup:flags.24?ReplyMarkup
+ = binlog.Update;
+
+binlog.messageEncrNew#6cf7cabc flags:# lid:long
+ from_id:flags.17?int to_type:flags.17?int to_id:flags.17?int
+ //empty 18 bit
+ date:flags.19?int
+ message:flags.20?string
+ encr_media:flags.21?DecryptedMessageMedia
+ encr_action:flags.22?DecryptedMessageAction
+ file:flags.23?EncryptedFile
+ = binlog.Update;
+
+binlog.msgUpdate#6dd4d85f lid:long = binlog.Update;
+
+binlog.resetAuthorization = binlog.Update;
+
+
+---functions---
+---types---
+resPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:(Vector long) = ResPQ;
+server_DH_params_fail#79cb045d nonce:int128 server_nonce:int128 new_nonce_hash:int128 = Server_DH_Params;
+server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;
+
+p_q_inner_data#83c95aec pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 = P_Q_inner_data;
+p_q_inner_data_temp#3c6a84d4 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 expires_in:int = P_Q_inner_data;
+client_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data;
+
+dh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer;
+dh_gen_retry#46dc1fb9 nonce:int128 server_nonce:int128 new_nonce_hash2:int128 = Set_client_DH_params_answer;
+dh_gen_fail#a69dae02 nonce:int128 server_nonce:int128 new_nonce_hash3:int128 = Set_client_DH_params_answer;
+
+server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;
+
+---functions---
+req_pq#60469778 nonce:int128 = ResPQ;
+req_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params;
+set_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer;
+---types---
+decryptedMessageMediaVideoL12#4cee6ef3 str_thumb:bytes thumb_w:int thumb_h:int duration:int w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageMediaAudioL12#6080758f duration:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+
+updateMsgUpdate id:int pts:int pts_count:int = Update;
+
+messageMediaPhotoL27#c8c45a2a photo:Photo = MessageMedia;
+messageMediaVideoL27#a2d24290 video:Video = MessageMedia;
+//messageMediaDocumentL27#2fda2204 document:Document = MessageMedia;
+//messageMediaAudioL27#c6b68300 audio:Audio = MessageMedia;
+---functions---
diff --git a/protocols/Telegram/tgl/auto/scheme.tlo b/protocols/Telegram/tgl/auto/scheme.tlo
new file mode 100644
index 0000000000..02d3ca415e
--- /dev/null
+++ b/protocols/Telegram/tgl/auto/scheme.tlo
Binary files differ
diff --git a/protocols/Telegram/tgl/auto/scheme2.tl b/protocols/Telegram/tgl/auto/scheme2.tl
new file mode 100644
index 0000000000..1867166cb2
--- /dev/null
+++ b/protocols/Telegram/tgl/auto/scheme2.tl
@@ -0,0 +1,540 @@
+int#a8509bda ? = Int
+long#22076cba ? = Long
+double#2210c154 ? = Double
+string#b5286e24 ? = String
+bytes#0ee1379f string = Bytes
+int128#7d36c439 long long = Int128
+int256#f2c798b3 long long long long = Int256
+boolFalse#bc799737 = Bool
+boolTrue#997275b5 = Bool
+vector#1cb5c415 t:Type # [ t ] = Vector t
+error#c4b9f9bb code:int text:string = Error
+null#56730bcc = Null
+inputPeerEmpty#7f3b18ea = InputPeer
+inputPeerSelf#7da07ec9 = InputPeer
+inputPeerContact#1023dbe8 user_id:int = InputPeer
+inputPeerForeign#9b447325 user_id:int access_hash:long = InputPeer
+inputPeerChat#179be863 chat_id:int = InputPeer
+inputUserEmpty#b98886cf = InputUser
+inputUserSelf#f7c1b13f = InputUser
+inputUserContact#86e94f65 user_id:int = InputUser
+inputUserForeign#655e74ff user_id:int access_hash:long = InputUser
+inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact
+inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile
+inputMediaEmpty#9664f57f = InputMedia
+inputMediaUploadedPhoto#f7aff1c0 file:InputFile caption:string = InputMedia
+inputMediaPhoto#e9bfb4f3 id:InputPhoto caption:string = InputMedia
+inputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia
+inputMediaContact#a6e45987 phone_number:string first_name:string last_name:string = InputMedia
+inputMediaUploadedVideo#e13fd4bc file:InputFile duration:int w:int h:int caption:string = InputMedia
+inputMediaUploadedThumbVideo#96fb97dc file:InputFile thumb:InputFile duration:int w:int h:int caption:string = InputMedia
+inputMediaVideo#936a4ebd video_id:InputVideo caption:string = InputMedia
+inputChatPhotoEmpty#1ca48f57 = InputChatPhoto
+inputChatUploadedPhoto#94254732 file:InputFile crop:InputPhotoCrop = InputChatPhoto
+inputChatPhoto#b2e1bf08 id:InputPhoto crop:InputPhotoCrop = InputChatPhoto
+inputGeoPointEmpty#e4c123d6 = InputGeoPoint
+inputGeoPoint#f3b7acc9 latitude:double longitude:double = InputGeoPoint
+inputPhotoEmpty#1cd7bf0d = InputPhoto
+inputPhoto#fb95c6c4 id:long access_hash:long = InputPhoto
+inputVideoEmpty#5508ec75 = InputVideo
+inputVideo#ee579652 id:long access_hash:long = InputVideo
+inputFileLocation#14637196 volume_id:long local_id:int secret:long = InputFileLocation
+inputVideoFileLocation#3d0364ec id:long access_hash:long = InputFileLocation
+inputPhotoCropAuto#ade6b004 = InputPhotoCrop
+inputPhotoCrop#d9915325 crop_left:double crop_top:double crop_width:double = InputPhotoCrop
+inputAppEvent#770656a8 time:double type:string peer:long data:string = InputAppEvent
+peerUser#9db1bc6d user_id:int = Peer
+peerChat#bad0e5bb chat_id:int = Peer
+storage.fileUnknown#aa963b05 = storage.FileType
+storage.fileJpeg#007efe0e = storage.FileType
+storage.fileGif#cae1aadf = storage.FileType
+storage.filePng#0a4f63c0 = storage.FileType
+storage.filePdf#ae1e508d = storage.FileType
+storage.fileMp3#528a0677 = storage.FileType
+storage.fileMov#4b09ebbc = storage.FileType
+storage.filePartial#40bc6f52 = storage.FileType
+storage.fileMp4#b3cea0e4 = storage.FileType
+storage.fileWebp#1081464c = storage.FileType
+fileLocationUnavailable#7c596b46 volume_id:long local_id:int secret:long = FileLocation
+fileLocation#53d69076 dc_id:int volume_id:long local_id:int secret:long = FileLocation
+userEmpty#200250ba id:int = User
+userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto
+userProfilePhoto#d559d8c8 photo_id:long photo_small:FileLocation photo_big:FileLocation = UserProfilePhoto
+userStatusEmpty#09d05049 = UserStatus
+userStatusOnline#edb93949 expires:int = UserStatus
+userStatusOffline#008c703f was_online:int = UserStatus
+chatEmpty#9ba2d800 id:int = Chat
+chat#6e9c9bc7 id:int title:string photo:ChatPhoto participants_count:int date:int left:Bool version:int = Chat
+chatForbidden#fb0ccc41 id:int title:string date:int = Chat
+chatFull#2e02a614 id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector BotInfo = ChatFull
+chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant
+chatParticipantsForbidden#0fd2bb8a chat_id:int = ChatParticipants
+chatParticipants#7841b415 chat_id:int admin_id:int participants:Vector ChatParticipant version:int = ChatParticipants
+chatPhotoEmpty#37c1011c = ChatPhoto
+chatPhoto#6153276a photo_small:FileLocation photo_big:FileLocation = ChatPhoto
+messageEmpty#83e5de54 id:int = Message
+message#c3060325 flags:# id:int from_id:int to_id:Peer fwd_from_id:flags.2?int fwd_date:flags.2?int reply_to_msg_id:flags.3?int date:int message:string media:MessageMedia reply_markup:flags.6?ReplyMarkup = Message
+messageService#1d86f70e flags:int id:int from_id:int to_id:Peer date:int action:MessageAction = Message
+messageMediaEmpty#3ded6320 = MessageMedia
+messageMediaPhoto#3d8ce53d photo:Photo caption:string = MessageMedia
+messageMediaVideo#5bcf1675 video:Video caption:string = MessageMedia
+messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia
+messageMediaContact#5e7d2f39 phone_number:string first_name:string last_name:string user_id:int = MessageMedia
+messageMediaUnsupported#9f84f49e = MessageMedia
+messageActionEmpty#b6aef7b0 = MessageAction
+messageActionChatCreate#a6638b9a title:string users:Vector int = MessageAction
+messageActionChatEditTitle#b5a1ce5a title:string = MessageAction
+messageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction
+messageActionChatDeletePhoto#95e3fbef = MessageAction
+messageActionChatAddUser#5e3cfc4b user_id:int = MessageAction
+messageActionChatDeleteUser#b2ae9b0c user_id:int = MessageAction
+dialog#c1dd804a peer:Peer top_message:int read_inbox_max_id:int unread_count:int notify_settings:PeerNotifySettings = Dialog
+photoEmpty#2331b22d id:long = Photo
+photo#c3838076 id:long access_hash:long user_id:int date:int geo:GeoPoint sizes:Vector PhotoSize = Photo
+photoL27#22b56751 id:long access_hash:long user_id:int date:int caption:string geo:GeoPoint sizes:Vector PhotoSize = Photo
+photoSizeEmpty#0e17e23c type:string = PhotoSize
+photoSize#77bfb61b type:string location:FileLocation w:int h:int size:int = PhotoSize
+photoCachedSize#e9a734fa type:string location:FileLocation w:int h:int bytes:bytes = PhotoSize
+videoEmpty#c10658a8 id:long = Video
+video#ee9f4a4d id:long access_hash:long user_id:int date:int duration:int size:int thumb:PhotoSize dc_id:int w:int h:int = Video
+videoL27#388fa391 id:long access_hash:long user_id:int date:int caption:string duration:int mime_type:string size:int thumb:PhotoSize dc_id:int w:int h:int = Video
+geoPointEmpty#1117dd5f = GeoPoint
+geoPoint#2049d70c longitude:double latitude:double = GeoPoint
+auth.checkedPhone#811ea28e phone_registered:Bool = auth.CheckedPhone
+auth.sentCode#efed51d9 phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode
+auth.authorization#ff036af1 user:User = auth.Authorization
+auth.exportedAuthorization#df969c2d id:int bytes:bytes = auth.ExportedAuthorization
+inputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer
+inputNotifyUsers#193b4417 = InputNotifyPeer
+inputNotifyChats#4a95e84e = InputNotifyPeer
+inputNotifyAll#a429b886 = InputNotifyPeer
+inputPeerNotifyEventsEmpty#f03064d8 = InputPeerNotifyEvents
+inputPeerNotifyEventsAll#e86a2c74 = InputPeerNotifyEvents
+inputPeerNotifySettings#46a2ce98 mute_until:int sound:string show_previews:Bool events_mask:int = InputPeerNotifySettings
+peerNotifyEventsEmpty#add53cb3 = PeerNotifyEvents
+peerNotifyEventsAll#6d1ded88 = PeerNotifyEvents
+peerNotifySettingsEmpty#70a68512 = PeerNotifySettings
+peerNotifySettings#8d5e11ee mute_until:int sound:string show_previews:Bool events_mask:int = PeerNotifySettings
+wallPaper#ccb03657 id:int title:string sizes:Vector PhotoSize color:int = WallPaper
+userFull#5a89ac5b user:User link:contacts.Link profile_photo:Photo notify_settings:PeerNotifySettings blocked:Bool bot_info:BotInfo = UserFull
+contact#f911c994 user_id:int mutual:Bool = Contact
+importedContact#d0028438 user_id:int client_id:long = ImportedContact
+contactBlocked#561bc879 user_id:int date:int = ContactBlocked
+contactSuggested#3de191a1 user_id:int mutual_contacts:int = ContactSuggested
+contactStatus#d3680c61 user_id:int status:UserStatus = ContactStatus
+chatLocated#3631cf4c chat_id:int distance:int = ChatLocated
+contacts.link#3ace484c my_link:ContactLink foreign_link:ContactLink user:User = contacts.Link
+contacts.contactsNotModified#b74ba9d2 = contacts.Contacts
+contacts.contacts#6f8b8cb2 contacts:Vector Contact users:Vector User = contacts.Contacts
+contacts.importedContacts#ad524315 imported:Vector ImportedContact retry_contacts:Vector long users:Vector User = contacts.ImportedContacts
+contacts.blocked#1c138d15 blocked:Vector ContactBlocked users:Vector User = contacts.Blocked
+contacts.blockedSlice#900802a1 count:int blocked:Vector ContactBlocked users:Vector User = contacts.Blocked
+contacts.suggested#5649dcc5 results:Vector ContactSuggested users:Vector User = contacts.Suggested
+messages.dialogs#15ba6c40 dialogs:Vector Dialog messages:Vector Message chats:Vector Chat users:Vector User = messages.Dialogs
+messages.dialogsSlice#71e094f3 count:int dialogs:Vector Dialog messages:Vector Message chats:Vector Chat users:Vector User = messages.Dialogs
+messages.messages#8c718e87 messages:Vector Message chats:Vector Chat users:Vector User = messages.Messages
+messages.messagesSlice#0b446ae3 count:int messages:Vector Message chats:Vector Chat users:Vector User = messages.Messages
+messages.messageEmpty#3f4e0648 = messages.Message
+messages.sentMessage#4c3d47f3 id:int date:int media:MessageMedia pts:int pts_count:int = messages.SentMessage
+messages.chats#64ff9fd5 chats:Vector Chat = messages.Chats
+messages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector Chat users:Vector User = messages.ChatFull
+messages.affectedHistory#b45c69d1 pts:int pts_count:int offset:int = messages.AffectedHistory
+inputMessagesFilterEmpty#57e2f66c = MessagesFilter
+inputMessagesFilterPhotos#9609a51c = MessagesFilter
+inputMessagesFilterVideo#9fc00e65 = MessagesFilter
+inputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter
+inputMessagesFilterPhotoVideoDocuments#d95e73bb = MessagesFilter
+inputMessagesFilterDocument#9eddf188 = MessagesFilter
+inputMessagesFilterAudio#cfc87522 = MessagesFilter
+updateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update
+updateMessageID#4e90bfd6 id:int random_id:long = Update
+updateDeleteMessages#a20db0e5 messages:Vector int pts:int pts_count:int = Update
+updateUserTyping#5c486927 user_id:int action:SendMessageAction = Update
+updateChatUserTyping#9a65ea1f chat_id:int user_id:int action:SendMessageAction = Update
+updateChatParticipants#07761198 participants:ChatParticipants = Update
+updateUserStatus#1bfbd823 user_id:int status:UserStatus = Update
+updateUserName#a7332b73 user_id:int first_name:string last_name:string username:string = Update
+updateUserPhoto#95313b0c user_id:int date:int photo:UserProfilePhoto previous:Bool = Update
+updateContactRegistered#2575bbb9 user_id:int date:int = Update
+updateContactLink#9d2e67c5 user_id:int my_link:ContactLink foreign_link:ContactLink = Update
+updateNewAuthorization#8f06529a auth_key_id:long date:int device:string location:string = Update
+updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State
+updates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference
+updates.difference#00f49ca0 new_messages:Vector Message new_encrypted_messages:Vector EncryptedMessage other_updates:Vector Update chats:Vector Chat users:Vector User state:updates.State = updates.Difference
+updates.differenceSlice#a8fb1981 new_messages:Vector Message new_encrypted_messages:Vector EncryptedMessage other_updates:Vector Update chats:Vector Chat users:Vector User intermediate_state:updates.State = updates.Difference
+updatesTooLong#e317af7e = Updates
+updateShortMessage#ed5c2127 flags:# id:int user_id:int message:string pts:int pts_count:int date:int fwd_from_id:flags.2?int fwd_date:flags.2?int reply_to_msg_id:flags.3?int = Updates
+updateShortChatMessage#52238b3c flags:# id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from_id:flags.2?int fwd_date:flags.2?int reply_to_msg_id:flags.3?int = Updates
+updateShort#78d4dec1 update:Update date:int = Updates
+updatesCombined#725b04c3 updates:Vector Update users:Vector User chats:Vector Chat date:int seq_start:int seq:int = Updates
+updates#74ae4240 updates:Vector Update users:Vector User chats:Vector Chat date:int seq:int = Updates
+photos.photos#8dca6aa5 photos:Vector Photo users:Vector User = photos.Photos
+photos.photosSlice#15051f54 count:int photos:Vector Photo users:Vector User = photos.Photos
+photos.photo#20212ca8 photo:Photo users:Vector User = photos.Photo
+upload.file#096a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File
+dcOptionL28#2ec2a43c id:int hostname:string ip_address:string port:int = DcOption
+dcOption#05d8c6cc flags:int id:int ip_address:string port:int = DcOption
+config#4e32b894 date:int expires:int test_mode:Bool this_dc:int dc_options:Vector DcOption chat_size_max:int broadcast_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int chat_big_size:int push_chat_period_ms:int push_chat_limit:int disabled_features:Vector DisabledFeature = Config
+nearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc
+help.appUpdate#8987f311 id:int critical:Bool url:string text:string = help.AppUpdate
+help.noAppUpdate#c45a6536 = help.AppUpdate
+help.inviteText#18cb9f78 message:string = help.InviteText
+messages.sentMessageLink#35a1a663 id:int date:int media:MessageMedia pts:int pts_count:int links:Vector contacts.Link seq:int = messages.SentMessage
+inputGeoChat#74d456fa chat_id:int access_hash:long = InputGeoChat
+inputNotifyGeoChatPeer#4d8ddec8 geo_peer:InputGeoChat = InputNotifyPeer
+geoChat#75eaea5a id:int access_hash:long title:string address:string venue:string geo:GeoPoint photo:ChatPhoto participants_count:int date:int checked_in:Bool version:int = Chat
+geoChatMessageEmpty#60311a9b chat_id:int id:int = GeoChatMessage
+geoChatMessage#4505f8e1 chat_id:int id:int from_id:int date:int message:string media:MessageMedia = GeoChatMessage
+geoChatMessageService#d34fa24e chat_id:int id:int from_id:int date:int action:MessageAction = GeoChatMessage
+geochats.statedMessage#17b1578b message:GeoChatMessage chats:Vector Chat users:Vector User seq:int = geochats.StatedMessage
+geochats.located#48feb267 results:Vector ChatLocated messages:Vector GeoChatMessage chats:Vector Chat users:Vector User = geochats.Located
+geochats.messages#d1526db1 messages:Vector GeoChatMessage chats:Vector Chat users:Vector User = geochats.Messages
+geochats.messagesSlice#bc5863e8 count:int messages:Vector GeoChatMessage chats:Vector Chat users:Vector User = geochats.Messages
+messageActionGeoChatCreate#6f038ebc title:string address:string = MessageAction
+messageActionGeoChatCheckin#0c7d53de = MessageAction
+updateNewGeoChatMessage#5a68e3f7 geo_message:GeoChatMessage = Update
+wallPaperSolid#63117f24 id:int title:string bg_color:int color:int = WallPaper
+updateNewEncryptedMessage#12bcbd9a encr_message:EncryptedMessage qts:int = Update
+updateEncryptedChatTyping#1710f156 chat_id:int = Update
+updateEncryption#b4a2e88d encr_chat:EncryptedChat date:int = Update
+updateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update
+encryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat
+encryptedChatWaiting#3bf703dc id:int access_hash:long date:int admin_id:int participant_id:int = EncryptedChat
+encryptedChatRequested#c878527e id:int access_hash:long date:int admin_id:int participant_id:int g_a:bytes = EncryptedChat
+encryptedChat#fa56ce36 id:int access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long = EncryptedChat
+encryptedChatDiscarded#13d6dd27 id:int = EncryptedChat
+inputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat
+encryptedFileEmpty#c21f497e = EncryptedFile
+encryptedFile#4a70994c id:long access_hash:long size:int dc_id:int key_fingerprint:int = EncryptedFile
+inputEncryptedFileEmpty#1837c364 = InputEncryptedFile
+inputEncryptedFileUploaded#64bd0306 id:long parts:int md5_checksum:string key_fingerprint:int = InputEncryptedFile
+inputEncryptedFile#5a17b5e5 id:long access_hash:long = InputEncryptedFile
+inputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation
+encryptedMessage#ed18c118 random_id:long chat_id:int date:int bytes:bytes file:EncryptedFile = EncryptedMessage
+encryptedMessageService#23734b06 random_id:long chat_id:int date:int bytes:bytes = EncryptedMessage
+messages.dhConfigNotModified#c0e24635 random:bytes = messages.DhConfig
+messages.dhConfig#2c221edd g:int p:bytes version:int random:bytes = messages.DhConfig
+messages.sentEncryptedMessage#560f8935 date:int = messages.SentEncryptedMessage
+messages.sentEncryptedFile#9493ff32 date:int file:EncryptedFile = messages.SentEncryptedMessage
+inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile
+inputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile
+updateChatParticipantAdd#3a0eeb22 chat_id:int user_id:int inviter_id:int version:int = Update
+updateChatParticipantDelete#6e5f8c22 chat_id:int user_id:int version:int = Update
+updateDcOptions#8e5e9873 dc_options:Vector DcOption = Update
+inputMediaUploadedAudio#4e498cab file:InputFile duration:int mime_type:string = InputMedia
+inputMediaAudio#89938781 audio_id:InputAudio = InputMedia
+inputMediaUploadedDocument#ffe76b78 file:InputFile mime_type:string attributes:Vector DocumentAttribute = InputMedia
+inputMediaUploadedThumbDocument#41481486 file:InputFile thumb:InputFile mime_type:string attributes:Vector DocumentAttribute = InputMedia
+inputMediaDocument#d184e841 document_id:InputDocument = InputMedia
+messageMediaDocument#2fda2204 document:Document = MessageMedia
+messageMediaAudio#c6b68300 audio:Audio = MessageMedia
+inputAudioEmpty#d95adc84 = InputAudio
+inputAudio#77d440ff id:long access_hash:long = InputAudio
+inputDocumentEmpty#72f0eaae = InputDocument
+inputDocument#18798952 id:long access_hash:long = InputDocument
+inputAudioFileLocation#74dc404d id:long access_hash:long = InputFileLocation
+inputDocumentFileLocation#4e45abe9 id:long access_hash:long = InputFileLocation
+audioEmpty#586988d8 id:long = Audio
+audio#c7ac6496 id:long access_hash:long user_id:int date:int duration:int mime_type:string size:int dc_id:int = Audio
+documentEmpty#36f8c871 id:long = Document
+document#f9a39f4f id:long access_hash:long date:int mime_type:string size:int thumb:PhotoSize dc_id:int attributes:Vector DocumentAttribute = Document
+document_l19#9efc6326 id:long access_hash:long user_id:int date:int file_name:string mime_type:string size:int thumb:PhotoSize dc_id:int = Document
+help.support#17c6b5f6 phone_number:string user:User = help.Support
+notifyPeer#9fd40bd8 peer:Peer = NotifyPeer
+notifyUsers#b4c83b4c = NotifyPeer
+notifyChats#c007cec3 = NotifyPeer
+notifyAll#74d07c60 = NotifyPeer
+updateUserBlocked#80ece81a user_id:int blocked:Bool = Update
+updateNotifySettings#bec268ef notify_peer:NotifyPeer notify_settings:PeerNotifySettings = Update
+auth.sentAppCode#e325edcf phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode
+sendMessageTypingAction#16bf744e = SendMessageAction
+sendMessageCancelAction#fd5ec8f5 = SendMessageAction
+sendMessageRecordVideoAction#a187d66f = SendMessageAction
+sendMessageUploadVideoActionL27#92042ff7 = SendMessageAction
+sendMessageUploadVideoAction#e9763aec progress:int = SendMessageAction
+sendMessageRecordAudioAction#d52f73f7 = SendMessageAction
+sendMessageUploadAudioActionL27#e6ac8a6f = SendMessageAction
+sendMessageUploadAudioAction#f351d7ab progress:int = SendMessageAction
+sendMessageUploadPhotoAction#d1d34a26 progress:int = SendMessageAction
+sendMessageUploadDocumentActionL27#8faee98e = SendMessageAction
+sendMessageUploadDocumentAction#aa0cd9e4 progress:int = SendMessageAction
+sendMessageGeoLocationAction#176f8ba1 = SendMessageAction
+sendMessageChooseContactAction#628cbc6f = SendMessageAction
+contactFound#ea879f95 user_id:int = ContactFound
+contacts.found#0566000e results:Vector ContactFound users:Vector User = contacts.Found
+updateServiceNotification#382dd3e4 type:string message_text:string media:MessageMedia popup:Bool = Update
+userStatusRecently#e26f42f1 = UserStatus
+userStatusLastWeek#07bf09fc = UserStatus
+userStatusLastMonth#77ebc742 = UserStatus
+updatePrivacy#ee3b272a key:PrivacyKey rules:Vector PrivacyRule = Update
+inputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey
+privacyKeyStatusTimestamp#bc2eab30 = PrivacyKey
+inputPrivacyValueAllowContacts#0d09e07b = InputPrivacyRule
+inputPrivacyValueAllowAll#184b35ce = InputPrivacyRule
+inputPrivacyValueAllowUsers#131cc67f users:Vector InputUser = InputPrivacyRule
+inputPrivacyValueDisallowContacts#0ba52007 = InputPrivacyRule
+inputPrivacyValueDisallowAll#d66b66c9 = InputPrivacyRule
+inputPrivacyValueDisallowUsers#90110467 users:Vector InputUser = InputPrivacyRule
+privacyValueAllowContacts#fffe1bac = PrivacyRule
+privacyValueAllowAll#65427b82 = PrivacyRule
+privacyValueAllowUsers#4d5bbe0c users:Vector int = PrivacyRule
+privacyValueDisallowContacts#f888fa1a = PrivacyRule
+privacyValueDisallowAll#8b73e763 = PrivacyRule
+privacyValueDisallowUsers#0c7f49b7 users:Vector int = PrivacyRule
+account.privacyRules#554abb6f rules:Vector PrivacyRule users:Vector User = account.PrivacyRules
+accountDaysTTL#b8d0afdf days:int = AccountDaysTTL
+account.sentChangePhoneCode#a4f58c4c phone_code_hash:string send_call_timeout:int = account.SentChangePhoneCode
+updateUserPhone#12b9417b user_id:int phone:string = Update
+documentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute
+documentAttributeAnimated#11b58939 = DocumentAttribute
+documentAttributeStickerL28#994c9882 alt:string = DocumentAttribute
+documentAttributeSticker#3a556302 alt:string stickerset:InputStickerSet = DocumentAttribute
+documentAttributeVideo#5910cccb duration:int w:int h:int = DocumentAttribute
+documentAttributeAudio#051448e5 duration:int = DocumentAttribute
+documentAttributeFilename#15590068 file_name:string = DocumentAttribute
+messages.stickersNotModified#f1749a22 = messages.Stickers
+messages.stickers#8a8ecd32 hash:string stickers:Vector Document = messages.Stickers
+stickerPack#12b299d4 emoticon:string documents:Vector long = StickerPack
+messages.allStickersNotModified#e86602c3 = messages.AllStickers
+messages.allStickers#5ce352ec hash:string packs:Vector StickerPack sets:Vector StickerSet documents:Vector Document = messages.AllStickers
+disabledFeature#ae636f24 feature:string description:string = DisabledFeature
+updateReadHistoryInbox#9961fd5c peer:Peer max_id:int pts:int pts_count:int = Update
+updateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update
+messages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages
+contactLinkUnknown#5f4f9247 = ContactLink
+contactLinkNone#feedd3ad = ContactLink
+contactLinkHasPhone#268f3f59 = ContactLink
+contactLinkContact#d502c2d0 = ContactLink
+updateWebPage#2cc36971 webpage:WebPage = Update
+webPageEmpty#eb1477e8 id:long = WebPage
+webPagePending#c586da1c id:long date:int = WebPage
+webPage#a31ea0b5 flags:# id:long url:string display_url:string type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string = WebPage
+messageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia
+authorization#7bf2e6f6 hash:long flags:int device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization
+account.authorizations#1250abde authorizations:Vector Authorization = account.Authorizations
+account.noPassword#96dabc18 new_salt:bytes email_unconfirmed_pattern:string = account.Password
+account.password#7c18141c current_salt:bytes new_salt:bytes hint:string has_recovery:Bool email_unconfirmed_pattern:string = account.Password
+account.passwordSettings#b7b72ab3 email:string = account.PasswordSettings
+account.passwordInputSettings#bcfc532c flags:# new_salt:flags.0?bytes new_password_hash:flags.0?bytes hint:flags.0?string email:flags.1?string = account.PasswordInputSettings
+auth.passwordRecovery#137948a5 email_pattern:string = auth.PasswordRecovery
+inputMediaVenue#2827a81a geo_point:InputGeoPoint title:string address:string provider:string venue_id:string = InputMedia
+messageMediaVenue#7912b71f geo:GeoPoint title:string address:string provider:string venue_id:string = MessageMedia
+receivedNotifyMessage#a384b779 id:int flags:int = ReceivedNotifyMessage
+chatInviteEmpty#69df3769 = ExportedChatInvite
+chatInviteExported#fc2e05bc link:string = ExportedChatInvite
+chatInviteAlready#5a686d7c chat:Chat = ChatInvite
+chatInvite#ce917dcd title:string = ChatInvite
+messageActionChatJoinedByLink#f89cf5e8 inviter_id:int = MessageAction
+updateReadMessagesContents#68c13933 messages:Vector int pts:int pts_count:int = Update
+inputStickerSetEmpty#ffb62b95 = InputStickerSet
+inputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet
+inputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet
+stickerSet#a7a43b17 id:long access_hash:long title:string short_name:string = StickerSet
+messages.stickerSet#b60a24a6 set:StickerSet packs:Vector StickerPack documents:Vector Document = messages.StickerSet
+user#22e49072 flags:# id:int access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int = User
+botCommand#c27ac8c7 command:string description:string = BotCommand
+botCommandOld#b79d22ab command:string params:string description:string = BotCommand
+botInfoEmpty#bb2e37ce = BotInfo
+botInfo#09cf585d user_id:int version:int share_text:string description:string commands:Vector BotCommand = BotInfo
+keyboardButton#a2fa4880 text:string = KeyboardButton
+keyboardButtonRow#77608b83 buttons:Vector KeyboardButton = KeyboardButtonRow
+replyKeyboardHide#a03e5b85 flags:int = ReplyMarkup
+replyKeyboardForceReply#f4108aa0 flags:int = ReplyMarkup
+replyKeyboardMarkup#3502758c flags:int rows:Vector KeyboardButtonRow = ReplyMarkup
+invokeAfterMsg#cb9f372d X:Type msg_id:long query:X = X
+invokeAfterMsgs#3dc4b4f0 X:Type msg_ids:Vector long query:X = X
+auth.checkPhone#6fe51dfb phone_number:string = auth.CheckedPhone
+auth.sendCode#768d5f4d phone_number:string sms_type:int api_id:int api_hash:string lang_code:string = auth.SentCode
+auth.sendCall#03c51564 phone_number:string phone_code_hash:string = Bool
+auth.signUp#1b067634 phone_number:string phone_code_hash:string phone_code:string first_name:string last_name:string = auth.Authorization
+auth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:string = auth.Authorization
+auth.logOut#5717da40 = Bool
+auth.resetAuthorizations#9fab0d1a = Bool
+auth.sendInvites#771c1d97 phone_numbers:Vector string message:string = Bool
+auth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization
+auth.importAuthorization#e3ef9613 id:int bytes:bytes = auth.Authorization
+auth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool
+account.registerDevice#446c712c token_type:int token:string device_model:string system_version:string app_version:string app_sandbox:Bool lang_code:string = Bool
+account.unregisterDevice#65c55b40 token_type:int token:string = Bool
+account.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool
+account.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings
+account.resetNotifySettings#db7e1747 = Bool
+account.updateProfile#f0888d68 first_name:string last_name:string = User
+account.updateStatus#6628562c offline:Bool = Bool
+account.getWallPapers#c04cfac2 = Vector WallPaper
+users.getUsers#0d91a548 id:Vector InputUser = Vector User
+users.getFullUser#ca30a5b1 id:InputUser = UserFull
+contacts.getStatuses#c4a353ee = Vector ContactStatus
+contacts.getContacts#22c6aa08 hash:string = contacts.Contacts
+contacts.importContacts#da30b32d contacts:Vector InputContact replace:Bool = contacts.ImportedContacts
+contacts.getSuggested#cd773428 limit:int = contacts.Suggested
+contacts.deleteContact#8e953744 id:InputUser = contacts.Link
+contacts.deleteContacts#59ab389e id:Vector InputUser = Bool
+contacts.block#332b49fc id:InputUser = Bool
+contacts.unblock#e54100bd id:InputUser = Bool
+contacts.getBlocked#f57c350f offset:int limit:int = contacts.Blocked
+contacts.exportCard#84e53737 = Vector int
+contacts.importCard#4fe196fe export_card:Vector int = User
+messages.getMessages#4222fa74 id:Vector int = messages.Messages
+messages.getDialogs#eccf1df6 offset:int max_id:int limit:int = messages.Dialogs
+messages.getHistory#92a1df2f peer:InputPeer offset:int max_id:int limit:int = messages.Messages
+messages.search#07e9f2ab peer:InputPeer q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = messages.Messages
+messages.readHistory#b04f2510 peer:InputPeer max_id:int offset:int = messages.AffectedHistory
+messages.deleteHistory#f4f8fb61 peer:InputPeer offset:int = messages.AffectedHistory
+messages.deleteMessages#a5f18925 id:Vector int = messages.AffectedMessages
+messages.receivedMessages#05a954c0 max_id:int = Vector ReceivedNotifyMessage
+messages.setTyping#a3825e50 peer:InputPeer action:SendMessageAction = Bool
+messages.sendMessage#fc55e6b5 flags:# peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long reply_markup:flags.2?ReplyMarkup = messages.SentMessage
+messages.sendMedia#c8f16791 flags:# peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia random_id:long reply_markup:flags.2?ReplyMarkup = Updates
+messages.forwardMessages#55e1728d peer:InputPeer id:Vector int random_id:Vector long = Updates
+messages.getChats#3c6aa187 id:Vector int = messages.Chats
+messages.getFullChat#3b831c66 chat_id:int = messages.ChatFull
+messages.editChatTitle#dc452855 chat_id:int title:string = Updates
+messages.editChatPhoto#ca4c79d8 chat_id:int photo:InputChatPhoto = Updates
+messages.addChatUser#f9a0aa09 chat_id:int user_id:InputUser fwd_limit:int = Updates
+messages.deleteChatUser#e0611f16 chat_id:int user_id:InputUser = Updates
+messages.createChat#09cb126e users:Vector InputUser title:string = Updates
+updates.getState#edd4882a = updates.State
+updates.getDifference#0a041495 pts:int date:int qts:int = updates.Difference
+photos.updateProfilePhoto#eef579a0 id:InputPhoto crop:InputPhotoCrop = UserProfilePhoto
+photos.uploadProfilePhoto#d50f9c88 file:InputFile caption:string geo_point:InputGeoPoint crop:InputPhotoCrop = photos.Photo
+photos.deletePhotos#87cf7f2f id:Vector InputPhoto = Vector long
+upload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool
+upload.getFile#e3a6cfb5 location:InputFileLocation offset:int limit:int = upload.File
+help.getConfig#c4f9186b = Config
+help.getNearestDc#1fb33026 = NearestDc
+help.getAppUpdate#c812ac7e device_model:string system_version:string app_version:string lang_code:string = help.AppUpdate
+help.saveAppLog#6f02f748 events:Vector InputAppEvent = Bool
+help.getInviteText#a4a95186 lang_code:string = help.InviteText
+photos.getUserPhotos#b7ee553c user_id:InputUser offset:int max_id:int limit:int = photos.Photos
+messages.forwardMessage#33963bf9 peer:InputPeer id:int random_id:long = Updates
+messages.sendBroadcast#bf73f4da contacts:Vector InputUser random_id:Vector long message:string media:InputMedia = Updates
+geochats.getLocated#7f192d8f geo_point:InputGeoPoint radius:int limit:int = geochats.Located
+geochats.getRecents#e1427e6f offset:int limit:int = geochats.Messages
+geochats.checkin#55b3e8fb peer:InputGeoChat = geochats.StatedMessage
+geochats.getFullChat#6722dd6f peer:InputGeoChat = messages.ChatFull
+geochats.editChatTitle#4c8e2273 peer:InputGeoChat title:string address:string = geochats.StatedMessage
+geochats.editChatPhoto#35d81a95 peer:InputGeoChat photo:InputChatPhoto = geochats.StatedMessage
+geochats.search#cfcdc44d peer:InputGeoChat q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = geochats.Messages
+geochats.getHistory#b53f7a68 peer:InputGeoChat offset:int max_id:int limit:int = geochats.Messages
+geochats.setTyping#08b8a729 peer:InputGeoChat typing:Bool = Bool
+geochats.sendMessage#061b0044 peer:InputGeoChat message:string random_id:long = geochats.StatedMessage
+geochats.sendMedia#b8f0deff peer:InputGeoChat media:InputMedia random_id:long = geochats.StatedMessage
+geochats.createGeoChat#0e092e16 title:string geo_point:InputGeoPoint address:string venue:string = geochats.StatedMessage
+messages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig
+messages.requestEncryption#f64daf43 user_id:InputUser random_id:int g_a:bytes = EncryptedChat
+messages.acceptEncryption#3dbc0415 peer:InputEncryptedChat g_b:bytes key_fingerprint:long = EncryptedChat
+messages.discardEncryption#edd923c5 chat_id:int = Bool
+messages.setEncryptedTyping#791451ed peer:InputEncryptedChat typing:Bool = Bool
+messages.readEncryptedHistory#7f4b690a peer:InputEncryptedChat max_date:int = Bool
+messages.sendEncrypted#a9776773 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage
+messages.sendEncryptedFile#9a901b66 peer:InputEncryptedChat random_id:long data:bytes file:InputEncryptedFile = messages.SentEncryptedMessage
+messages.sendEncryptedService#32d439a4 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage
+messages.receivedQueue#55a5bb66 max_qts:int = Vector long
+upload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool
+initConnection#69796de9 X:Type api_id:int device_model:string system_version:string app_version:string lang_code:string query:X = X
+help.getSupport#9cdf08cd = help.Support
+auth.sendSms#0da9f3e8 phone_number:string phone_code_hash:string = Bool
+messages.readMessageContents#36a73f77 id:Vector int = messages.AffectedMessages
+account.checkUsername#2714d86c username:string = Bool
+account.updateUsername#3e0bdd7c username:string = User
+contacts.search#11f812d8 q:string limit:int = contacts.Found
+account.getPrivacy#dadbc950 key:InputPrivacyKey = account.PrivacyRules
+account.setPrivacy#c9f81ce8 key:InputPrivacyKey rules:Vector InputPrivacyRule = account.PrivacyRules
+account.deleteAccount#418d4e0b reason:string = Bool
+account.getAccountTTL#08fc711d = AccountDaysTTL
+account.setAccountTTL#2442485e ttl:AccountDaysTTL = Bool
+invokeWithLayer#da9b0d0d X:Type layer:int query:X = X
+contacts.resolveUsername#0bf0131c username:string = User
+account.sendChangePhoneCode#a407a8f4 phone_number:string = account.SentChangePhoneCode
+account.changePhone#70c32edb phone_number:string phone_code_hash:string phone_code:string = User
+messages.getStickers#ae22e045 emoticon:string hash:string = messages.Stickers
+messages.getAllStickers#aa3bc868 hash:string = messages.AllStickers
+account.updateDeviceLocked#38df3532 period:int = Bool
+auth.importBotAuthorization#67a3ff2c flags:int api_id:int api_hash:string bot_auth_token:string = auth.Authorization
+messages.getWebPagePreview#25223e24 message:string = MessageMedia
+account.getAuthorizations#e320c158 = account.Authorizations
+account.resetAuthorization#df77f3bc hash:long = Bool
+account.getPassword#548a30f5 = account.Password
+account.getPasswordSettings#bc8d11bb current_password_hash:bytes = account.PasswordSettings
+account.updatePasswordSettings#fa7c4b86 current_password_hash:bytes new_settings:account.PasswordInputSettings = Bool
+auth.checkPassword#0a63011e password_hash:bytes = auth.Authorization
+auth.requestPasswordRecovery#d897bc66 = auth.PasswordRecovery
+auth.recoverPassword#4ea56e92 code:string = auth.Authorization
+invokeWithoutUpdates#bf9459b7 X:Type query:X = X
+messages.exportChatInvite#7d885289 chat_id:int = ExportedChatInvite
+messages.checkChatInvite#3eadb1bb hash:string = ChatInvite
+messages.importChatInvite#6c50051c hash:string = Updates
+messages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet
+messages.installStickerSet#efbbfae9 stickerset:InputStickerSet = Bool
+messages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool
+messages.startBot#1b3e0ffc bot:InputUser chat_id:int random_id:long start_param:string = Updates
+decryptedMessageMediaEmpty#089f5c4a = DecryptedMessageMedia
+decryptedMessageMediaPhoto#32798a8c str_thumb:bytes thumb_w:int thumb_h:int w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia
+decryptedMessageMediaGeoPoint#35480a59 latitude:double longitude:double = DecryptedMessageMedia
+decryptedMessageMediaContact#588a0a97 phone_number:string first_name:string last_name:string user_id:int = DecryptedMessageMedia
+decryptedMessageActionSetMessageTTL#a1733aec ttl_seconds:int = DecryptedMessageAction
+decryptedMessageMediaDocument#b095434b str_thumb:bytes thumb_w:int thumb_h:int file_name:string mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia
+decryptedMessageActionReadMessages#0c4f40be random_ids:Vector long = DecryptedMessageAction
+decryptedMessageActionDeleteMessages#65614304 random_ids:Vector long = DecryptedMessageAction
+decryptedMessageActionScreenshotMessages#8ac1f475 random_ids:Vector long = DecryptedMessageAction
+decryptedMessageActionFlushHistory#6719e45c = DecryptedMessageAction
+decryptedMessage#204d3878 random_id:long ttl:int message:string media:DecryptedMessageMedia = DecryptedMessage
+decryptedMessageService#73164160 random_id:long action:DecryptedMessageAction = DecryptedMessage
+decryptedMessageMediaVideo#524a415d str_thumb:bytes thumb_w:int thumb_h:int duration:int mime_type:string w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia
+decryptedMessageMediaAudio#57e0a9cb duration:int mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia
+decryptedMessageLayer#1be31789 random_bytes:bytes layer:int in_seq_no:int out_seq_no:int message:DecryptedMessage = DecryptedMessageLayer
+decryptedMessageActionResend#511110b0 start_seq_no:int end_seq_no:int = DecryptedMessageAction
+decryptedMessageActionNotifyLayer#f3048883 layer:int = DecryptedMessageAction
+decryptedMessageActionTyping#ccb27641 action:SendMessageAction = DecryptedMessageAction
+decryptedMessageActionRequestKey#f3c9611b exchange_id:long g_a:bytes = DecryptedMessageAction
+decryptedMessageActionAcceptKey#6fe1735b exchange_id:long g_b:bytes key_fingerprint:long = DecryptedMessageAction
+decryptedMessageActionAbortKey#dd05ec6b exchange_id:long = DecryptedMessageAction
+decryptedMessageActionCommitKey#ec2e0b9b exchange_id:long key_fingerprint:long = DecryptedMessageAction
+decryptedMessageActionNoop#a82fdd63 = DecryptedMessageAction
+decryptedMessageMediaExternalDocument#fa95b0dd id:long access_hash:long date:int mime_type:string size:int thumb:PhotoSize dc_id:int attributes:Vector DocumentAttribute = DecryptedMessageMedia
+binlog.encrKey#0377168f key:64*[ int ] = binlog.EncrKey
+binlog.start#3b06de69 = binlog.Update
+binlog.dcOption#f96feb32 dc:int name:string ip:string port:int = binlog.Update
+binlog.dcOptionNew#7c0d22d8 flags:int dc:int name:string ip:string port:int = binlog.Update
+binlog.authKey#71e8c156 dc:int key:%binlog.EncrKey = binlog.Update
+binlog.defaultDc#9e83dbdc dc:int = binlog.Update
+binlog.dcSigned#26451bb5 dc:int = binlog.Update
+binlog.ourId#68a870e8 id:int = binlog.Update
+binlog.setDhParams#eaeb7826 root:int prime:%binlog.EncrKey version:int = binlog.Update
+binlog.setPts#2ca8c939 pts:int = binlog.Update
+binlog.setQts#d95738ac qts:int = binlog.Update
+binlog.setDate#1d0f4b52 date:int = binlog.Update
+binlog.setSeq#6eeb2989 seq:int = binlog.Update
+binlog.encrChatDelete#ee1b38e8 id:int = binlog.Update
+binlog.encrChatNew#84977251 flags:# id:int access_hash:flags.17?long date:flags.18?int admin:flags.19?int user_id:flags.20?int key:flags.21?%binlog.EncrKey g_key:flags.22?%binlog.EncrKey state:flags.23?int ttl:flags.24?int layer:flags.25?int in_seq_no:flags.26?int last_in_seq_no:flags.26?int out_seq_no:flags.26?int key_fingerprint:flags.27?long = binlog.Update
+binlog.encrChatExchangeNew#9d49488d flags:# id:int exchange_id:flags.17?long key:flags.18?%binlog.EncrKey state:flags.19?int = binlog.Update
+binlog.userDelete#ac55d447 id:int = binlog.Update
+binlog.userNew#127cf2f9 flags:# id:int access_hash:flags.17?long first_name:flags.18?string last_name:flags.18?string phone:flags.19?string username:flags.20?string photo:flags.21?Photo real_first_name:flags.22?string real_last_name:flags.22?string user_photo:flags.23?UserProfilePhoto last_read_in:flags.24?int last_read_out:flags.25?int bot_info:flags.26?BotInfo = binlog.Update
+binlog.chatNew#0a10aa92 flags:# id:int title:flags.17?string user_num:flags.18?int date:flags.19?int version:flags.20?int participants:flags.20?Vector ChatParticipant chat_photo:flags.21?ChatPhoto photo:flags.22?Photo admin:flags.23?int last_read_in:flags.24?int last_read_out:flags.25?int = binlog.Update
+binlog.chatAddParticipant#535475ea id:int version:int user_id:int inviter_id:int date:int = binlog.Update
+binlog.chatDelParticipant#7dd1a1a2 id:int version:int user_id:int = binlog.Update
+binlog.setMsgId#3c873416 old_id:long new_id:int = binlog.Update
+binlog.messageDelete#847e77b1 lid:long = binlog.Update
+binlog.messageNew#427cfcdb flags:# lid:long from_id:flags.17?int to_type:flags.17?int to_id:flags.17?int fwd_from_id:flags.18?int fwd_date:flags.18?int date:flags.19?int message:flags.20?string media:flags.21?MessageMedia action:flags.22?MessageAction reply_id:flags.23?int reply_markup:flags.24?ReplyMarkup = binlog.Update
+binlog.messageEncrNew#6cf7cabc flags:# lid:long from_id:flags.17?int to_type:flags.17?int to_id:flags.17?int date:flags.19?int message:flags.20?string encr_media:flags.21?DecryptedMessageMedia encr_action:flags.22?DecryptedMessageAction file:flags.23?EncryptedFile = binlog.Update
+binlog.msgUpdate#6dd4d85f lid:long = binlog.Update
+binlog.resetAuthorization#83327955 = binlog.Update
+resPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:Vector long = ResPQ
+server_DH_params_fail#79cb045d nonce:int128 server_nonce:int128 new_nonce_hash:int128 = Server_DH_Params
+server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params
+p_q_inner_data#83c95aec pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 = P_Q_inner_data
+p_q_inner_data_temp#3c6a84d4 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 expires_in:int = P_Q_inner_data
+client_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data
+dh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer
+dh_gen_retry#46dc1fb9 nonce:int128 server_nonce:int128 new_nonce_hash2:int128 = Set_client_DH_params_answer
+dh_gen_fail#a69dae02 nonce:int128 server_nonce:int128 new_nonce_hash3:int128 = Set_client_DH_params_answer
+server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data
+req_pq#60469778 nonce:int128 = ResPQ
+req_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params
+set_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer
+decryptedMessageMediaVideoL12#4cee6ef3 str_thumb:bytes thumb_w:int thumb_h:int duration:int w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia
+decryptedMessageMediaAudioL12#6080758f duration:int size:int key:bytes iv:bytes = DecryptedMessageMedia
+updateMsgUpdate#03114739 id:int pts:int pts_count:int = Update
+messageMediaPhotoL27#c8c45a2a photo:Photo = MessageMedia
+messageMediaVideoL27#a2d24290 video:Video = MessageMedia
diff --git a/protocols/Telegram/tgl/binlog.c b/protocols/Telegram/tgl/binlog.c
new file mode 100644
index 0000000000..ed5d514abf
--- /dev/null
+++ b/protocols/Telegram/tgl/binlog.c
@@ -0,0 +1,1829 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Vitaly Valtman 2013-2015
+*/
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#if defined(WIN32) || defined(_WIN32)
+#include <stdint.h>
+#include <string.h>
+#include <fcntl.h>
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#include <io.h>
+#include <sys/locking.h>
+#else
+#include <unistd.h>
+#include <sys/file.h>
+#endif
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include <openssl/bn.h>
+
+#include "tgl-binlog.h"
+#include "mtproto-common.h"
+//#include "net.h"
+#include "mtproto-client.h"
+#include "mtproto-utils.h"
+
+#include "tgl.h"
+#include "auto.h"
+#include "auto/auto-types.h"
+#include "auto/auto-skip.h"
+#include "auto/auto-store-ds.h"
+#include "auto/auto-fetch-ds.h"
+#include "auto/auto-free-ds.h"
+
+#include "tgl-structures.h"
+#include "tgl-methods-in.h"
+
+#include <openssl/sha.h>
+
+#define BINLOG_BUFFER_SIZE (1 << 20)
+static int binlog_buffer[BINLOG_BUFFER_SIZE];
+static int *rptr;
+static int *wptr;
+//static int TLS->binlog_fd;
+static int in_replay_log; // should be used ONLY for DEBUG
+
+
+#define MAX_LOG_EVENT_SIZE (1 << 17)
+
+char *get_binlog_file_name (void);
+
+static void *alloc_log_event (int l) {
+ return binlog_buffer;
+}
+
+static int mystreq1 (const char *a, const char *b, int l) {
+ if ((int)strlen (a) != l) { return 1; }
+ return memcmp (a, b, l);
+}
+
+static long long binlog_pos;
+
+static int fetch_comb_binlog_start (struct tgl_state *TLS, void *extra) {
+ return 0;
+}
+
+/* {{{ DC option */
+static int fetch_comb_binlog_dc_option (struct tgl_state *TLS, struct tl_ds_binlog_update *DS_U) {
+ vlogprintf (E_NOTICE, "DC%d '%.*s' update: %.*s:%d\n",
+ DS_LVAL (DS_U->dc),
+ DS_RSTR (DS_U->name),
+ DS_RSTR (DS_U->ip),
+ DS_LVAL (DS_U->port)
+ );
+
+ tglmp_alloc_dc (TLS,
+ 0,
+ DS_LVAL (DS_U->dc),
+ DS_STR_DUP (DS_U->ip),
+ DS_LVAL (DS_U->port)
+ );
+ return 0;
+}
+
+static int fetch_comb_binlog_dc_option_new (struct tgl_state *TLS, struct tl_ds_binlog_update *DS_U) {
+ vlogprintf (E_NOTICE, "DC%d '%.*s' update: %.*s:%d\n",
+ DS_LVAL (DS_U->dc),
+ DS_RSTR (DS_U->name),
+ DS_RSTR (DS_U->ip),
+ DS_LVAL (DS_U->port)
+ );
+
+ tglmp_alloc_dc (TLS,
+ DS_LVAL (DS_U->flags),
+ DS_LVAL (DS_U->dc),
+ DS_STR_DUP (DS_U->ip),
+ DS_LVAL (DS_U->port)
+ );
+ return 0;
+}
+/* }}} */
+
+/* {{{ Auth key */
+static int fetch_comb_binlog_auth_key (struct tgl_state *TLS, struct tl_ds_binlog_update *DS_U) {
+ int num = DS_LVAL (DS_U->dc);
+ assert (num > 0 && num <= MAX_DC_ID);
+ assert (TLS->DC_list[num]);
+
+ tglf_fetch_int_tuple ((void *)TLS->DC_list[num]->auth_key, DS_U->key->key, 64);
+
+ static unsigned char sha1_buffer[20];
+ SHA1 ((void *)TLS->DC_list[num]->auth_key, 256, sha1_buffer);
+ TLS->DC_list[num]->auth_key_id = *(long long *)(sha1_buffer + 12);
+
+ TLS->DC_list[num]->flags |= TGLDCF_AUTHORIZED;
+ return 0;
+}
+/* }}} */
+
+/* {{{ Default dc */
+static int fetch_comb_binlog_default_dc (struct tgl_state *TLS, struct tl_ds_binlog_update *DS_U) {
+ int num = DS_LVAL (DS_U->dc);
+ assert (num > 0 && num <= MAX_DC_ID);
+ TLS->DC_working = TLS->DC_list[num];
+ TLS->dc_working_num = num;
+ return 0;
+}
+/* }}} */
+
+/* {{{ DC signed */
+static int fetch_comb_binlog_dc_signed (struct tgl_state *TLS, struct tl_ds_binlog_update *DS_U) {
+ int num = DS_LVAL (DS_U->dc);
+ assert (num > 0 && num <= MAX_DC_ID);
+ assert (TLS->DC_list[num]);
+ TLS->DC_list[num]->flags |= TGLDCF_LOGGED_IN;
+ return 0;
+}
+/* }}} */
+
+/* {{{ our user_id */
+static int fetch_comb_binlog_our_id (struct tgl_state *TLS, struct tl_ds_binlog_update *DS_U) {
+ TLS->our_id = DS_LVAL (DS_U->id);
+ assert (TLS->our_id > 0);
+ if (TLS->callback.our_id) {
+ TLS->callback.our_id (TLS, TLS->our_id);
+ }
+ return 0;
+}
+/* }}} */
+
+/* {{{ Set DH params */
+static int fetch_comb_binlog_set_dh_params (struct tgl_state *TLS, struct tl_ds_binlog_update *DS_U) {
+ if (TLS->encr_prime) { tfree (TLS->encr_prime, 256); BN_free (TLS->encr_prime_bn); }
+
+ TLS->encr_root = DS_LVAL (DS_U->root);
+ TLS->encr_prime = talloc (256);
+ tglf_fetch_int_tuple ((void *)TLS->encr_prime, DS_U->prime->key, 64);
+
+ TLS->encr_prime_bn = BN_new ();
+ BN_bin2bn ((void *)TLS->encr_prime, 256, TLS->encr_prime_bn);
+ TLS->encr_param_version = DS_LVAL (DS_U->version);
+
+ assert (tglmp_check_DH_params (TLS, TLS->encr_prime_bn, TLS->encr_root) >= 0);
+
+ return 0;
+}
+/* }}} */
+
+/* {{{ Set pts, qts, date, seq */
+static int fetch_comb_binlog_set_pts (struct tgl_state *TLS, struct tl_ds_binlog_update *DS_U) {
+ TLS->pts = DS_LVAL (DS_U->pts);
+ return 0;
+}
+
+static int fetch_comb_binlog_set_qts (struct tgl_state *TLS, struct tl_ds_binlog_update *DS_U) {
+ TLS->qts = DS_LVAL (DS_U->qts);
+ return 0;
+}
+
+static int fetch_comb_binlog_set_date (struct tgl_state *TLS, struct tl_ds_binlog_update *DS_U) {
+ TLS->date = DS_LVAL (DS_U->date);
+ return 0;
+}
+
+static int fetch_comb_binlog_set_seq (struct tgl_state *TLS, struct tl_ds_binlog_update *DS_U) {
+ TLS->seq = DS_LVAL (DS_U->seq);
+ return 0;
+}
+/* }}} */
+
+/* {{{ delete user */
+static int fetch_comb_binlog_user_delete (struct tgl_state *TLS, struct tl_ds_binlog_update *DS_U) {
+ tgl_peer_id_t id = TGL_MK_USER (DS_LVAL (DS_U->id));
+ tgl_peer_t *U = tgl_peer_get (TLS, id);
+ assert (U);
+ U->flags |= TGLUF_DELETED;
+
+ if (TLS->callback.user_update) {
+ TLS->callback.user_update (TLS, (void *)U, TGL_UPDATE_DELETED);
+ }
+ return 0;
+}
+/* }}} */
+
+/* {{{ delete secret chat */
+static int fetch_comb_binlog_encr_chat_delete (struct tgl_state *TLS, struct tl_ds_binlog_update *DS_U) {
+ tgl_peer_id_t id = TGL_MK_ENCR_CHAT (DS_LVAL (DS_U->id));
+ tgl_peer_t *_U = tgl_peer_get (TLS, id);
+ assert (_U);
+ struct tgl_secret_chat *U = &_U->encr_chat;
+ memset (U->key, 0, sizeof (U->key));
+ U->flags |= TGLPF_DELETED;
+ U->state = sc_deleted;
+ if (U->g_key) {
+ tfree_secure (U->g_key, 256);
+ U->g_key = 0;
+ }
+
+ if (TLS->callback.secret_chat_update) {
+ TLS->callback.secret_chat_update (TLS, U, TGL_UPDATE_DELETED);
+ }
+ return 0;
+}
+/* }}} */
+
+static int fetch_comb_binlog_user_new (struct tgl_state *TLS, struct tl_ds_binlog_update *DS_U) {
+ tgl_peer_id_t id = TGL_MK_USER (DS_LVAL (DS_U->id));
+ tgl_peer_t *_U = tgl_peer_get (TLS, id);
+
+ int flags = DS_LVAL (DS_U->flags);
+
+ unsigned updates = 0;
+
+ if (flags & TGLPF_CREATE) {
+ if (!_U) {
+ _U = talloc0 (sizeof (*_U));
+ _U->id = id;
+ tglp_insert_encrypted_chat (TLS, _U);
+ } else {
+ assert (!(_U->flags & TGLPF_CREATED));
+ }
+ updates |= TGL_UPDATE_CREATED;
+ } else {
+ assert (_U->flags & TGLPF_CREATED);
+ }
+
+ struct tgl_user *U = (void *)_U;
+
+ if ((flags & 0xff) != (U->flags & 0xff)) {
+ updates |= TGL_UPDATE_FLAGS;
+ }
+ U->flags = flags & 0xffff;
+
+ if (DS_U->access_hash) {
+ U->access_hash = DS_LVAL (DS_U->access_hash);
+ updates |= TGL_UPDATE_ACCESS_HASH;
+ }
+
+ if (DS_U->first_name) {
+ if (U->first_name) {
+ tfree_str (U->first_name);
+ }
+ U->first_name = DS_STR_DUP (DS_U->first_name);
+ if (U->last_name) {
+ tfree_str (U->last_name);
+ }
+ U->last_name = DS_STR_DUP (DS_U->last_name);
+
+ updates |= TGL_UPDATE_NAME;
+
+ if (U->print_name) {
+ tglp_peer_delete_name (TLS, (void *)U);
+ tfree_str (U->print_name);
+ }
+ U->print_name = TLS->callback.create_print_name (TLS, U->id, U->first_name, U->last_name, 0, 0);
+ tglp_peer_insert_name (TLS, (void *)U);
+ }
+
+ if (DS_U->phone) {
+ if (U->phone) {
+ tfree_str (U->phone);
+ }
+ U->phone = DS_STR_DUP (DS_U->phone);
+ updates |= TGL_UPDATE_PHONE;
+ }
+
+ if (DS_U->username) {
+ if (U->username) {
+ tfree_str (U->username);
+ }
+ U->username = DS_STR_DUP (DS_U->username);
+ updates |= TGL_UPDATE_USERNAME;
+ }
+
+ if (DS_U->photo) {
+ if (U->photo) {
+ tgls_free_photo (TLS, U->photo);
+ }
+ U->photo = tglf_fetch_alloc_photo_new (TLS, DS_U->photo);
+ U->flags |= TGLUF_HAS_PHOTO;
+ //updates |= TGL_UPDATE_PHOTO;
+ }
+
+ if (DS_U->user_photo) {
+ U->photo_id = DS_LVAL (DS_U->user_photo->photo_id);
+ tglf_fetch_file_location_new (TLS, &U->photo_big, DS_U->user_photo->photo_big);
+ tglf_fetch_file_location_new (TLS, &U->photo_small, DS_U->user_photo->photo_small);
+ updates |= TGL_UPDATE_PHOTO;
+ }
+
+ if (DS_U->real_first_name) {
+ if (U->real_first_name) {
+ tfree_str (U->real_first_name);
+ }
+ U->real_first_name = DS_STR_DUP (DS_U->real_first_name);
+ if (U->real_last_name) {
+ tfree_str (U->real_last_name);
+ }
+ U->real_last_name = DS_STR_DUP (DS_U->real_last_name);
+
+ updates |= TGL_UPDATE_REAL_NAME;
+ }
+
+ if (DS_U->last_read_in) {
+ U->last_read_in = DS_LVAL (DS_U->last_read_in);
+ tgls_messages_mark_read (TLS, U->last, 0, U->last_read_in);
+ }
+
+ if (DS_U->last_read_out) {
+ U->last_read_out = DS_LVAL (DS_U->last_read_out);
+ tgls_messages_mark_read (TLS, U->last, TGLMF_OUT, U->last_read_out);
+ }
+
+ if (DS_U->bot_info) {
+ if (U->bot_info) {
+ tgls_free_bot_info (TLS, U->bot_info);
+ }
+ U->bot_info = tglf_fetch_alloc_bot_info (TLS, DS_U->bot_info);
+ }
+
+ if (TLS->callback.user_update && updates) {
+ TLS->callback.user_update (TLS, U, updates);
+ }
+
+ return 0;
+}
+
+static int fetch_comb_binlog_encr_chat_new (struct tgl_state *TLS, struct tl_ds_binlog_update *DS_U) {
+ tgl_peer_id_t id = TGL_MK_ENCR_CHAT (DS_LVAL (DS_U->id));
+ tgl_peer_t *_U = tgl_peer_get (TLS, id);
+
+ int flags = DS_LVAL (DS_U->flags);
+
+ unsigned updates = 0;
+
+ if (flags & TGLPF_CREATE) {
+ if (!_U) {
+ _U = talloc0 (sizeof (*_U));
+ _U->id = id;
+ tglp_insert_encrypted_chat (TLS, _U);
+ } else {
+ assert (!(_U->flags & TGLPF_CREATED));
+ }
+ updates |= TGL_UPDATE_CREATED;
+ } else {
+ assert (_U->flags & TGLPF_CREATED);
+ }
+
+ struct tgl_secret_chat *U = (void *)_U;
+
+ if ((flags & 0xff) != (U->flags & 0xff)) {
+ updates |= TGL_UPDATE_FLAGS;
+ }
+ U->flags = flags & 0xffff;
+
+ if (DS_U->access_hash) {
+ U->access_hash = DS_LVAL (DS_U->access_hash);
+ updates |= TGL_UPDATE_ACCESS_HASH;
+ }
+
+ if (DS_U->date) {
+ U->date = DS_LVAL (DS_U->date);
+ }
+
+ if (DS_U->admin) {
+ U->admin_id = DS_LVAL (DS_U->admin);
+ }
+
+ if (DS_U->user_id) {
+ U->user_id = DS_LVAL (DS_U->user_id);
+ }
+
+ if (DS_U->key_fingerprint) {
+ U->key_fingerprint = DS_LVAL (DS_U->key_fingerprint);
+ }
+
+ if (DS_U->in_seq_no) {
+ U->in_seq_no = DS_LVAL (DS_U->in_seq_no);
+ U->out_seq_no = DS_LVAL (DS_U->out_seq_no);
+ U->last_in_seq_no = DS_LVAL (DS_U->last_in_seq_no);
+ }
+
+ tgl_peer_t *Us = tgl_peer_get (TLS, TGL_MK_USER (U->user_id));
+
+ if (!U->print_name) {
+ if (Us) {
+ U->print_name = TLS->callback.create_print_name (TLS, id, "!", Us->user.first_name, Us->user.last_name, 0);
+ } else {
+ static char buf[100];
+ tsnprintf (buf, 99, "user#%d", U->user_id);
+ U->print_name = TLS->callback.create_print_name (TLS, id, "!", buf, 0, 0);
+ }
+ tglp_peer_insert_name (TLS, (void *)U);
+ }
+
+ if (DS_U->g_key) {
+ if (!U->g_key) {
+ U->g_key = talloc (256);
+ }
+ tglf_fetch_int_tuple ((void *)U->g_key, DS_U->g_key->key, 64);
+ }
+
+ if (DS_U->key) {
+ tglf_fetch_int_tuple (U->key, DS_U->key->key, 64);
+ }
+
+ if (DS_U->state) {
+ if (U->state == sc_waiting && DS_LVAL (DS_U->state) == sc_ok) {
+ tgl_do_create_keys_end (TLS, U);
+ }
+ if ((int)U->state != DS_LVAL (DS_U->state)) {
+ switch (DS_LVAL (DS_U->state)) {
+ case sc_request:
+ updates |= TGL_UPDATE_REQUESTED;
+ break;
+ case sc_ok:
+ updates |= TGL_UPDATE_WORKING;
+ vlogprintf (E_WARNING, "Secret chat in ok state\n");
+ break;
+ default:
+ break;
+ }
+ }
+ U->state = DS_LVAL (DS_U->state);
+ }
+
+ if (TLS->callback.secret_chat_update && updates) {
+ TLS->callback.secret_chat_update (TLS, U, updates);
+ }
+
+ return 0;
+}
+
+static int fetch_comb_binlog_chat_new (struct tgl_state *TLS, struct tl_ds_binlog_update *DS_U) {
+ tgl_peer_id_t id = TGL_MK_CHAT (DS_LVAL (DS_U->id));
+ tgl_peer_t *_U = tgl_peer_get (TLS, id);
+
+ int flags = DS_LVAL (DS_U->flags);
+
+ unsigned updates = 0;
+
+ if (flags & (1 << 16)) {
+ if (!_U) {
+ _U = talloc0 (sizeof (*_U));
+ _U->id = id;
+ tglp_insert_chat (TLS, _U);
+ } else {
+ assert (!(_U->flags & TGLPF_CREATED));
+ }
+ updates |= TGL_UPDATE_CREATED;
+ } else {
+ assert (_U->flags & TGLPF_CREATED);
+ }
+
+ struct tgl_chat *C = &_U->chat;
+
+ if ((flags & 0xff) != (C->flags & 0xff)) {
+ updates |= TGL_UPDATE_FLAGS;
+ }
+ C->flags = flags & 0xffff;
+
+ if (DS_U->title) {
+ if (C->title) {
+ tfree_str (C->title);
+ }
+ C->title = DS_STR_DUP (DS_U->title);
+
+ if (C->print_title) {
+ tglp_peer_delete_name (TLS, (void *)C);
+ tfree_str (C->print_title);
+ }
+ C->print_title = TLS->callback.create_print_name (TLS, C->id, C->title, 0, 0, 0);
+ tglp_peer_insert_name (TLS, (void *)C);
+
+ updates |= TGL_UPDATE_TITLE;
+ }
+
+ if (DS_U->user_num) {
+ C->users_num = DS_LVAL (DS_U->user_num);
+ }
+
+ if (DS_U->date) {
+ C->date = DS_LVAL (DS_U->date);
+ }
+
+ if (DS_U->chat_photo) {
+ tglf_fetch_file_location_new (TLS, &C->photo_big, DS_U->chat_photo->photo_big);
+ tglf_fetch_file_location_new (TLS, &C->photo_small, DS_U->chat_photo->photo_small);
+ updates |= TGL_UPDATE_PHOTO;
+ }
+
+ if (DS_U->photo) {
+ if (C->photo) {
+ tgls_free_photo (TLS, C->photo);
+ }
+ C->photo = tglf_fetch_alloc_photo_new (TLS, DS_U->photo);
+ C->flags |= TGLPF_HAS_PHOTO;
+ updates |= TGL_UPDATE_PHOTO;
+ }
+
+ if (DS_U->admin) {
+ C->admin_id = DS_LVAL (DS_U->admin);
+ updates |= TGL_UPDATE_ADMIN;
+ }
+
+ if (DS_U->version) {
+ C->version = DS_LVAL (DS_U->version);
+
+ if (C->user_list) { tfree (C->user_list, 12 * C->user_list_size); }
+
+ C->user_list_size = DS_LVAL (DS_U->participants->cnt);
+ C->user_list = talloc (12 * C->user_list_size);
+
+ int i;
+ for (i = 0; i < C->user_list_size; i++) {
+ C->user_list[i].user_id = DS_LVAL (DS_U->participants->data[i]->user_id);
+ C->user_list[i].inviter_id = DS_LVAL (DS_U->participants->data[i]->inviter_id);
+ C->user_list[i].date = DS_LVAL (DS_U->participants->data[i]->date);
+ }
+
+ updates |= TGL_UPDATE_MEMBERS;
+ }
+
+ if (DS_U->last_read_in) {
+ C->last_read_in = DS_LVAL (DS_U->last_read_in);
+ tgls_messages_mark_read (TLS, C->last, 0, C->last_read_in);
+ }
+
+ if (DS_U->last_read_out) {
+ C->last_read_out = DS_LVAL (DS_U->last_read_out);
+ tgls_messages_mark_read (TLS, C->last, TGLMF_OUT, C->last_read_out);
+ }
+
+
+ if (TLS->callback.chat_update && updates) {
+ TLS->callback.chat_update (TLS, C, updates);
+ }
+ return 0;
+}
+
+static int fetch_comb_binlog_chat_add_participant (struct tgl_state *TLS, struct tl_ds_binlog_update *DS_U) {
+ tgl_peer_id_t id = TGL_MK_CHAT (DS_LVAL (DS_U->id));
+ tgl_peer_t *_C = tgl_peer_get (TLS, id);
+ assert (_C && (_C->flags & TGLPF_CREATED));
+ struct tgl_chat *C = &_C->chat;
+
+ int version = DS_LVAL (DS_U->version);
+ int user = DS_LVAL (DS_U->user_id);
+ int inviter = DS_LVAL (DS_U->inviter_id);
+ int date = DS_LVAL (DS_U->date);
+
+
+ if (C->user_list_version > version) { return 0; }
+
+ int i;
+ for (i = 0; i < C->user_list_size; i++) {
+ if (C->user_list[i].user_id == user) {
+ return 0;
+ }
+ }
+
+ C->user_list_size ++;
+ C->user_list = trealloc (C->user_list, 12 * C->user_list_size - 12, 12 * C->user_list_size);
+ C->user_list[C->user_list_size - 1].user_id = user;
+ C->user_list[C->user_list_size - 1].inviter_id = inviter;
+ C->user_list[C->user_list_size - 1].date = date;
+ C->user_list_version = version;
+
+ if (TLS->callback.chat_update) {
+ TLS->callback.chat_update (TLS, C, TGL_UPDATE_MEMBERS);
+ }
+ return 0;
+}
+
+static int fetch_comb_binlog_chat_del_participant (struct tgl_state *TLS, struct tl_ds_binlog_update *DS_U) {
+ tgl_peer_id_t id = TGL_MK_CHAT (DS_LVAL (DS_U->id));
+ tgl_peer_t *_C = tgl_peer_get (TLS, id);
+ assert (_C && (_C->flags & TGLPF_CREATED));
+ struct tgl_chat *C = &_C->chat;
+
+ int version = DS_LVAL (DS_U->version);
+ int user = DS_LVAL (DS_U->user_id);
+ if (C->user_list_version > version) { return 0; }
+
+ int i;
+ for (i = 0; i < C->user_list_size; i++) {
+ if (C->user_list[i].user_id == user) {
+ struct tgl_chat_user t;
+ t = C->user_list[i];
+ C->user_list[i] = C->user_list[C->user_list_size - 1];
+ C->user_list[C->user_list_size - 1] = t;
+ }
+ }
+ if (C->user_list[C->user_list_size - 1].user_id != user) { return 0; }
+
+ assert (C->user_list[C->user_list_size - 1].user_id == user);
+ C->user_list_size --;
+ C->user_list = trealloc (C->user_list, 12 * C->user_list_size + 12, 12 * C->user_list_size);
+ C->user_list_version = version;
+
+ if (TLS->callback.chat_update) {
+ TLS->callback.chat_update (TLS, C, TGL_UPDATE_MEMBERS);
+ }
+ return 0;
+}
+
+static int fetch_comb_binlog_message_new (struct tgl_state *TLS, struct tl_ds_binlog_update *DS_U) {
+ struct tgl_message *M = tgl_message_get (TLS, DS_LVAL (DS_U->lid));
+ int flags = DS_LVAL (DS_U->flags);
+
+ if (flags & (1 << 16)) {
+ if (!M) {
+ M = tglm_message_alloc (TLS, DS_LVAL (DS_U->lid));
+ }
+ assert (!(M->flags & TGLMF_CREATED));
+ } else {
+ assert (M->flags & TGLMF_CREATED);
+ }
+
+ assert (flags & TGLMF_CREATED);
+ assert (!(M->flags & TGLMF_ENCRYPTED));
+ assert (!(flags & TGLMF_ENCRYPTED));
+
+ if ((M->flags & TGLMF_PENDING) && !(flags & TGLMF_PENDING)){
+ tglm_message_remove_unsent (TLS, M);
+ }
+ if (!(M->flags & TGLMF_PENDING) && (flags & TGLMF_PENDING)){
+ tglm_message_insert_unsent (TLS, M);
+ }
+
+ if ((M->flags & TGLMF_UNREAD) && !(flags & TGLMF_UNREAD)) {
+ M->flags = (flags & 0xffff) | TGLMF_UNREAD;
+ } else {
+ M->flags = (flags & 0xffff);
+ }
+
+ if (DS_U->from_id) {
+ M->from_id = TGL_MK_USER (DS_LVAL (DS_U->from_id));
+ }
+ if (DS_U->to_type) {
+ assert (flags & 0x10000);
+ M->to_id = tgl_set_peer_id (DS_LVAL (DS_U->to_type), DS_LVAL (DS_U->to_id));
+ assert (DS_LVAL (DS_U->to_type) != TGL_PEER_ENCR_CHAT);
+ }
+
+ if (DS_U->date) {
+ M->date = DS_LVAL (DS_U->date);
+ }
+
+ if (DS_U->fwd_from_id) {
+ M->fwd_from_id = TGL_MK_USER (DS_LVAL (DS_U->fwd_from_id));
+ M->fwd_date = DS_LVAL (DS_U->fwd_date);
+ }
+
+ if (DS_U->action) {
+ tglf_fetch_message_action_new (TLS, &M->action, DS_U->action);
+ M->flags |= TGLMF_SERVICE;
+ }
+
+ if (DS_U->message) {
+ M->message_len = DS_U->message->len;
+ M->message = DS_STR_DUP (DS_U->message);
+ assert (!(M->flags & TGLMF_SERVICE));
+ }
+
+ if (DS_U->media) {
+ tglf_fetch_message_media_new (TLS, &M->media, DS_U->media);
+ assert (!(M->flags & TGLMF_SERVICE));
+ }
+
+ if (DS_U->reply_id) {
+ M->reply_id = DS_LVAL (DS_U->reply_id);
+ }
+
+ if (flags & 0x10000) {
+ tglm_message_insert (TLS, M);
+ }
+
+ if (!(flags & TGLMF_UNREAD) && (M->flags & TGLMF_UNREAD)) {
+ tgls_messages_mark_read (TLS, M, M->flags & TGLMF_OUT, M->id);
+ }
+
+ if (DS_U->reply_markup) {
+ M->reply_markup = tglf_fetch_alloc_reply_markup (TLS, M->next, DS_U->reply_markup);
+ }
+ return 0;
+}
+
+static int fetch_comb_binlog_message_encr_new (struct tgl_state *TLS, struct tl_ds_binlog_update *DS_U) {
+ struct tgl_message *M = tgl_message_get (TLS, DS_LVAL (DS_U->lid));
+ int flags = DS_LVAL (DS_U->flags);
+
+ if (flags & (1 << 16)) {
+ if (!M) {
+ M = tglm_message_alloc (TLS, DS_LVAL (DS_U->lid));
+ } else {
+ assert (!(M->flags & TGLMF_CREATED));
+ }
+ assert (!(M->flags & TGLMF_CREATED));
+ } else {
+ assert (M->flags & TGLMF_CREATED);
+ }
+
+ assert (flags & TGLMF_CREATED);
+ assert (flags & TGLMF_ENCRYPTED);
+
+ if ((M->flags & TGLMF_PENDING) && !(flags & TGLMF_PENDING)){
+ tglm_message_remove_unsent (TLS, M);
+ }
+ if (!(M->flags & TGLMF_PENDING) && (flags & TGLMF_PENDING)){
+ tglm_message_insert_unsent (TLS, M);
+ }
+
+ M->flags = flags & 0xffff;
+
+ if (DS_U->from_id) {
+ M->from_id = TGL_MK_USER (DS_LVAL (DS_U->from_id));
+ }
+ if (DS_U->to_type) {
+ assert (flags & 0x10000);
+ M->to_id = tgl_set_peer_id (DS_LVAL (DS_U->to_type), DS_LVAL (DS_U->to_id));
+ }
+
+ if (DS_U->date) {
+ M->date = DS_LVAL (DS_U->date);
+ }
+
+ struct tgl_secret_chat *E = (void *)tgl_peer_get (TLS, M->to_id);
+ assert (E);
+
+ if (DS_U->message) {
+ M->message_len = DS_U->message->len;
+ M->message = DS_STR_DUP (DS_U->message);
+ assert (!(M->flags & TGLMF_SERVICE));
+ }
+
+ if (DS_U->encr_media) {
+ tglf_fetch_message_media_encrypted_new (TLS, &M->media, DS_U->encr_media);
+ assert (!(M->flags & TGLMF_SERVICE));
+ }
+
+ if (DS_U->encr_action) {
+ tglf_fetch_message_action_encrypted_new (TLS, &M->action, DS_U->encr_action);
+ M->flags |= TGLMF_SERVICE;
+ }
+
+ if (DS_U->file) {
+ tglf_fetch_encrypted_message_file_new (TLS, &M->media, DS_U->file);
+ assert (!(M->flags & TGLMF_SERVICE));
+ }
+
+ if (DS_U->encr_action && !(M->flags & TGLMF_OUT) && M->action.type == tgl_message_action_notify_layer) {
+ E->layer = M->action.layer;
+ }
+
+ if ((flags & TGLMF_CREATE) && (flags & TGLMF_OUT)) {
+ E->out_seq_no ++;
+ }
+
+ if (flags & 0x10000) {
+ tglm_message_insert (TLS, M);
+ }
+ return 0;
+}
+
+static int fetch_comb_binlog_set_msg_id (struct tgl_state *TLS, struct tl_ds_binlog_update *DS_U) {
+ struct tgl_message *M = tgl_message_get (TLS, DS_LVAL (DS_U->old_id));
+ assert (M);
+ if (M->flags & TGLMF_PENDING) {
+ tglm_message_remove_unsent (TLS, M);
+ M->flags &= ~TGLMF_PENDING;
+ }
+
+ tglm_message_remove_tree (TLS, M);
+ tglm_message_del_peer (TLS, M);
+
+ M->id = DS_LVAL (DS_U->new_id);
+ if (tgl_message_get (TLS, M->id)) {
+ tglm_message_del_use (TLS, M);
+ tgls_free_message (TLS, M);
+ } else {
+ tglm_message_insert_tree (TLS, M);
+ tglm_message_add_peer (TLS, M);
+ }
+ return 0;
+}
+
+static int fetch_comb_binlog_message_delete (struct tgl_state *TLS, struct tl_ds_binlog_update *DS_U) {
+ struct tgl_message *M = tgl_message_get (TLS, DS_LVAL (DS_U->lid));
+ assert (M);
+ if (M->flags & TGLMF_PENDING) {
+ tglm_message_remove_unsent (TLS, M);
+ M->flags &= ~TGLMF_PENDING;
+ }
+ tglm_message_remove_tree (TLS, M);
+ tglm_message_del_peer (TLS, M);
+ tglm_message_del_use (TLS, M);
+ tgls_free_message (TLS, M);
+ return 0;
+}
+
+static int fetch_comb_binlog_msg_update (struct tgl_state *TLS, struct tl_ds_binlog_update *DS_U) {
+ struct tgl_message *M = tgl_message_get (TLS, DS_LVAL (DS_U->lid));
+ if (!M) { return 0; }
+ assert (M);
+
+ if (!(M->flags & TGLMF_ENCRYPTED)) {
+ if (TLS->max_msg_id < M->id) {
+ TLS->max_msg_id = M->id;
+ }
+ }
+
+ if (TLS->callback.msg_receive) {
+ TLS->callback.msg_receive (TLS, M);
+ }
+ return 0;
+}
+
+static int fetch_comb_binlog_reset_authorization (struct tgl_state *TLS, void *extra) {
+ int i;
+ for (i = 0; i <= TLS->max_dc_num; i++) if (TLS->DC_list[i]) {
+ struct tgl_dc *D = TLS->DC_list[i];
+ D->flags = 0;
+ D->state = st_init;
+ D->auth_key_id = D->temp_auth_key_id = 0;
+ }
+ TLS->seq = 0;
+ TLS->qts = 0;
+ return 0;
+}
+
+static int fetch_comb_binlog_encr_chat_exchange_new (struct tgl_state *TLS, struct tl_ds_binlog_update *DS_U) {
+ tgl_peer_t *P = tgl_peer_get (TLS, TGL_MK_ENCR_CHAT (DS_LVAL (DS_U->id)));
+ assert (P);
+ if (DS_U->state) {
+ P->encr_chat.exchange_state = DS_LVAL (DS_U->state);
+ }
+ if (DS_U->exchange_id) {
+ P->encr_chat.exchange_id = DS_LVAL (DS_U->exchange_id);
+ }
+
+ static unsigned char sha_buffer[20];
+ switch (P->encr_chat.exchange_state) {
+ case tgl_sce_requested:
+ tglf_fetch_int_tuple (P->encr_chat.exchange_key, DS_U->key->key, 64);
+ break;
+ case tgl_sce_accepted:
+ tglf_fetch_int_tuple (P->encr_chat.exchange_key, DS_U->key->key, 64);
+
+ SHA1 ((unsigned char *)P->encr_chat.exchange_key, 256, sha_buffer);
+ P->encr_chat.exchange_key_fingerprint = *(long long *)(sha_buffer + 12);
+ break;
+ case tgl_sce_committed:
+ memcpy (P->encr_chat.exchange_key, P->encr_chat.key, 256);
+ P->encr_chat.exchange_key_fingerprint = P->encr_chat.key_fingerprint;
+
+ tglf_fetch_int_tuple (P->encr_chat.key, DS_U->key->key, 64);
+
+ SHA1 ((unsigned char *)P->encr_chat.key, 256, sha_buffer);
+ P->encr_chat.key_fingerprint = *(long long *)(sha_buffer + 12);
+ break;
+ case tgl_sce_confirmed:
+ P->encr_chat.exchange_state = tgl_sce_none;
+ if (P->encr_chat.exchange_state != tgl_sce_committed) {
+ memcpy (P->encr_chat.key, P->encr_chat.exchange_key, 256);
+ P->encr_chat.key_fingerprint = P->encr_chat.exchange_key_fingerprint;
+ }
+ break;
+ case tgl_sce_aborted:
+ P->encr_chat.exchange_state = tgl_sce_none;
+ if (P->encr_chat.exchange_state == tgl_sce_committed) {
+ memcpy (P->encr_chat.key, P->encr_chat.exchange_key, 256);
+ P->encr_chat.key_fingerprint = P->encr_chat.exchange_key_fingerprint;
+ }
+ break;
+ default:
+ assert (0);
+ }
+ return 0;
+}
+
+#define FETCH_COMBINATOR_FUNCTION(NAME) \
+ case CODE_ ## NAME:\
+ ok = fetch_comb_ ## NAME (TLS, DS_U); \
+ break; \
+
+
+static void replay_log_event (struct tgl_state *TLS) {
+ assert (rptr < wptr);
+ int op = *rptr;
+
+ vlogprintf (E_DEBUG, "replay_log_event: log_pos=%"_PRINTF_INT64_"d, op=0x%08x\n", binlog_pos, op);
+
+ in_ptr = rptr;
+ in_end = wptr;
+ if (skip_type_any (TYPE_TO_PARAM (binlog_update)) < 0) {
+ vlogprintf (E_ERROR, "Can not replay at %"_PRINTF_INT64_"d (magic = 0x%08x)\n", binlog_pos, *rptr);
+ assert (0);
+ }
+ int *end = in_ptr;
+ in_end = in_ptr;
+ in_ptr = rptr;
+ struct tl_ds_binlog_update *DS_U = fetch_ds_type_binlog_update (TYPE_TO_PARAM (binlog_update));
+ assert (in_ptr == end);
+
+ int ok = -1;
+
+ switch (op) {
+ FETCH_COMBINATOR_FUNCTION (binlog_start)
+ FETCH_COMBINATOR_FUNCTION (binlog_dc_option)
+ FETCH_COMBINATOR_FUNCTION (binlog_dc_option_new)
+ FETCH_COMBINATOR_FUNCTION (binlog_auth_key)
+ FETCH_COMBINATOR_FUNCTION (binlog_default_dc)
+ FETCH_COMBINATOR_FUNCTION (binlog_dc_signed)
+
+ FETCH_COMBINATOR_FUNCTION (binlog_our_id)
+
+ FETCH_COMBINATOR_FUNCTION (binlog_set_dh_params)
+ FETCH_COMBINATOR_FUNCTION (binlog_set_pts)
+ FETCH_COMBINATOR_FUNCTION (binlog_set_qts)
+ FETCH_COMBINATOR_FUNCTION (binlog_set_date)
+ FETCH_COMBINATOR_FUNCTION (binlog_set_seq)
+
+ FETCH_COMBINATOR_FUNCTION (binlog_user_new)
+ FETCH_COMBINATOR_FUNCTION (binlog_user_delete)
+
+ FETCH_COMBINATOR_FUNCTION (binlog_chat_new)
+ //FETCH_COMBINATOR_FUNCTION (binlog_chat_delete)
+
+ FETCH_COMBINATOR_FUNCTION (binlog_encr_chat_new)
+ FETCH_COMBINATOR_FUNCTION (binlog_encr_chat_delete)
+ FETCH_COMBINATOR_FUNCTION (binlog_chat_add_participant)
+ FETCH_COMBINATOR_FUNCTION (binlog_chat_del_participant)
+
+ FETCH_COMBINATOR_FUNCTION (binlog_message_new)
+ FETCH_COMBINATOR_FUNCTION (binlog_message_encr_new)
+ FETCH_COMBINATOR_FUNCTION (binlog_message_delete)
+ FETCH_COMBINATOR_FUNCTION (binlog_set_msg_id)
+
+ FETCH_COMBINATOR_FUNCTION (binlog_encr_chat_exchange_new)
+
+ FETCH_COMBINATOR_FUNCTION (binlog_msg_update)
+ FETCH_COMBINATOR_FUNCTION (binlog_reset_authorization)
+ default:
+ vlogprintf (E_ERROR, "Unknown op 0x%08x\n", op);
+ assert (0);
+ }
+ assert (ok >= 0);
+
+ free_ds_type_binlog_update (DS_U, TYPE_TO_PARAM (binlog_update));
+ assert (in_ptr == end);
+ //assert (in_ptr == in_end);
+ binlog_pos += (in_ptr - rptr) * 4;
+ rptr = in_ptr;
+}
+
+static void create_new_binlog (struct tgl_state *TLS) {
+ clear_packet ();
+ //static int s[1000];
+
+ //packet_ptr = s;
+ out_int (CODE_binlog_start);
+ if (TLS->test_mode) {
+ out_int (CODE_binlog_dc_option);
+ out_int (1);
+ out_string ("");
+ out_string (TG_SERVER_TEST_1);
+ out_int (443);
+ out_int (CODE_binlog_dc_option);
+ out_int (2);
+ out_string ("");
+ out_string (TG_SERVER_TEST_2);
+ out_int (443);
+ out_int (CODE_binlog_dc_option);
+ out_int (3);
+ out_string ("");
+ out_string (TG_SERVER_TEST_3);
+ out_int (443);
+ out_int (CODE_binlog_default_dc);
+ out_int (2);
+ } else {
+ out_int (CODE_binlog_dc_option);
+ out_int (1);
+ out_string ("");
+ out_string (TG_SERVER_1);
+ out_int (443);
+ out_int (CODE_binlog_dc_option);
+ out_int (2);
+ out_string ("");
+ out_string (TG_SERVER_2);
+ out_int (443);
+ out_int (CODE_binlog_dc_option);
+ out_int (3);
+ out_string ("");
+ out_string (TG_SERVER_3);
+ out_int (443);
+ out_int (CODE_binlog_dc_option);
+ out_int (4);
+ out_string ("");
+ out_string (TG_SERVER_4);
+ out_int (443);
+ out_int (CODE_binlog_dc_option);
+ out_int (5);
+ out_string ("");
+ out_string (TG_SERVER_5);
+ out_int (443);
+ out_int (CODE_binlog_default_dc);
+ out_int (2);
+ }
+
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ int fd = 0;
+ if(_sopen_s (&fd, TLS->binlog_name, _O_WRONLY | _O_EXCL | _O_CREAT, _SH_DENYNO, _S_IREAD | _S_IWRITE) != 0 ) {
+#else
+ int fd = open (TLS->binlog_name, O_WRONLY | O_EXCL | O_CREAT, 0600);
+ if (fd < 0) {
+#endif
+ perror ("Write new binlog");
+ exit (2);
+ }
+ assert (write (fd, packet_buffer, (packet_ptr - packet_buffer) * 4) == (packet_ptr - packet_buffer) * 4);
+ close (fd);
+}
+
+
+void tgl_replay_log (struct tgl_state *TLS) {
+ if (!TLS->binlog_enabled) { return; }
+#if defined(WIN32) || defined(_WIN32)
+ if (INVALID_FILE_ATTRIBUTES == GetFileAttributesA (TLS->binlog_name) && GetLastError () == ERROR_FILE_NOT_FOUND) {
+#else
+ if (access (TLS->binlog_name, F_OK) < 0) {
+#endif
+ printf ("No binlog found. Creating new one\n");
+ create_new_binlog (TLS);
+ }
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ int fd = 0;
+ if (_sopen_s(&fd, TLS->binlog_name, _O_RDONLY | _O_BINARY, _SH_DENYNO, _S_IREAD | _S_IWRITE) != 0) {
+#elif defined(WIN32) || defined(_WIN32)
+ int fd = open (TLS->binlog_name, O_RDONLY | O_BINARY);
+ if (fd < 0) {
+#else
+ int fd = open (TLS->binlog_name, O_RDONLY);
+ if (fd < 0) {
+#endif
+ perror ("binlog open");
+ exit (2);
+ }
+ int end = 0;
+ in_replay_log = 1;
+ while (1) {
+ if (!end && wptr - rptr < MAX_LOG_EVENT_SIZE / 4) {
+ if (wptr == rptr) {
+ wptr = rptr = binlog_buffer;
+ } else {
+ int x = wptr - rptr;
+ memcpy (binlog_buffer, rptr, 4 * x);
+ wptr -= (rptr - binlog_buffer);
+ rptr = binlog_buffer;
+ }
+ int l = (binlog_buffer + BINLOG_BUFFER_SIZE - wptr) * 4;
+ int k = read (fd, wptr, l);
+ if (k < 0) {
+ perror ("read binlog");
+ exit (2);
+ }
+ assert (!(k & 3));
+ if (k < l) {
+ end = 1;
+ }
+ wptr += (k / 4);
+ }
+ if (wptr == rptr) { break; }
+ replay_log_event (TLS);
+ }
+ in_replay_log = 0;
+ close (fd);
+}
+
+//static int b_packet_buffer[PACKET_BUFFER_SIZE];
+
+void tgl_reopen_binlog_for_writing (struct tgl_state *TLS) {
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ if (_sopen_s (&TLS->binlog_fd, TLS->binlog_name, _O_WRONLY | _O_BINARY, _SH_DENYNO, _S_IREAD | _S_IWRITE) != 0) {
+#elif defined(WIN32) || defined(_WIN32)
+ TLS->binlog_fd = open (TLS->binlog_name, O_WRONLY | _O_BINARY);
+ if (TLS->binlog_fd < 0) {
+#else
+ TLS->binlog_fd = open (TLS->binlog_name, O_WRONLY);
+ if (TLS->binlog_fd < 0) {
+#endif
+ perror ("binlog open");
+ exit (2);
+ }
+
+ assert (lseek (TLS->binlog_fd, binlog_pos, SEEK_SET) == binlog_pos);
+#if defined(WIN32) || defined(_WIN32)
+ HANDLE h = INVALID_HANDLE_VALUE;
+ DWORD size_lower, size_upper;
+ DWORD err = 0;
+ OVERLAPPED ovlp;
+ int flags = 0;
+
+ h = (HANDLE)_get_osfhandle(TLS->binlog_fd);
+ if (h == INVALID_HANDLE_VALUE) {
+ errno = EBADF;
+ goto error;
+ }
+
+ size_lower = GetFileSize (h, &size_upper);
+ if (size_lower == INVALID_FILE_SIZE) {
+ goto get_err;
+ }
+
+ memset (&ovlp, 0, sizeof ovlp);
+ flags |= LOCKFILE_EXCLUSIVE_LOCK | LOCKFILE_FAIL_IMMEDIATELY;
+
+ if (!LockFileEx (h, flags, 0, size_lower, size_upper, &ovlp)) {
+ goto get_err;
+ }
+ return;
+
+error:
+ perror ("get lock");
+ exit(2);
+
+get_err:
+ err = GetLastError();
+ switch (err)
+ {
+ case ERROR_LOCK_VIOLATION:
+ errno = EAGAIN;
+ break;
+ case ERROR_NOT_ENOUGH_MEMORY:
+ errno = ENOMEM;
+ break;
+ case ERROR_BAD_COMMAND:
+ errno = EINVAL;
+ break;
+ default:
+ errno = err;
+ }
+ goto error;
+#else
+ if (flock (TLS->binlog_fd, LOCK_EX | LOCK_NB) < 0) {
+ perror ("get lock");
+ exit (2);
+ }
+#endif
+}
+
+static void add_log_event (struct tgl_state *TLS, const int *data, int len) {
+ vlogprintf (E_DEBUG, "Add log event: magic = 0x%08x, len = %d\n", data[0], len);
+ assert (!(len & 3));
+ int *ev = talloc (len);
+ memcpy (ev, data, len);
+ rptr = (void *)ev;
+ wptr = rptr + (len / 4);
+ int *in = in_ptr;
+ int *end = in_end;
+ replay_log_event (TLS);
+ if (rptr != wptr) {
+ vlogprintf (E_ERROR, "Unread %"_PRINTF_INT64_"d ints. Len = %d\n", (long long)(wptr - rptr), len);
+ assert (rptr == wptr);
+ }
+ if (TLS->binlog_enabled) {
+ assert (TLS->binlog_fd > 0);
+ assert (write (TLS->binlog_fd, ev, len) == len);
+ }
+ tfree (ev, len);
+ in_ptr = in;
+ in_end = end;
+}
+
+void bl_do_dc_option_new (struct tgl_state *TLS, int flags, int id, const char *name, int l1, const char *ip, int l2, int port) {
+ struct tgl_dc *DC = TLS->DC_list[id];
+
+ if (DC) {
+ struct tgl_dc_option *O = DC->options[flags & 3];
+ while (O) {
+ if (!strncmp (O->ip, ip, l2)) {
+ return;
+ }
+ O = O->next;
+ }
+ }
+
+ clear_packet ();
+ out_int (CODE_binlog_dc_option_new);
+ out_int (flags);
+ out_int (id);
+
+ out_cstring (name, l1);
+ out_cstring (ip, l2);
+ out_int (port);
+
+ add_log_event (TLS, packet_buffer, 4 * (packet_ptr - packet_buffer));
+}
+
+void bl_do_dc_option (struct tgl_state *TLS, int id, const char *name, int l1, const char *ip, int l2, int port) {
+ bl_do_dc_option_new (TLS, 0, id, name, l1, ip, l2, port);
+}
+
+void bl_do_set_working_dc (struct tgl_state *TLS, int num) {
+ int *ev = alloc_log_event (8);
+ ev[0] = CODE_binlog_default_dc;
+ ev[1] = num;
+ add_log_event (TLS, ev, 8);
+}
+
+void bl_do_dc_signed (struct tgl_state *TLS, int id) {
+ clear_packet ();
+ out_int (CODE_binlog_dc_signed);
+ out_int (id);
+ add_log_event (TLS, packet_buffer, 4 * (packet_ptr - packet_buffer));
+}
+
+void bl_do_set_our_id (struct tgl_state *TLS, int id) {
+ if (TLS->our_id) {
+ assert (TLS->our_id == id);
+ return;
+ }
+
+ clear_packet ();
+ out_int (CODE_binlog_our_id);
+ out_int (id);
+ add_log_event (TLS, packet_buffer, 4 * (packet_ptr - packet_buffer));
+}
+
+void bl_do_set_dh_params (struct tgl_state *TLS, int root, unsigned char prime[], int version) {
+ clear_packet ();
+ out_int (CODE_binlog_set_dh_params);
+ out_int (root);
+ out_ints ((void *)prime, 64);
+ out_int (version);
+ add_log_event (TLS, packet_buffer, 4 * (packet_ptr - packet_buffer));
+}
+
+void bl_do_set_pts (struct tgl_state *TLS, int pts) {
+ if (TLS->locks & TGL_LOCK_DIFF) { return; }
+ if (pts <= TLS->pts) { return; }
+
+ clear_packet ();
+ out_int (CODE_binlog_set_pts);
+ out_int (pts);
+ add_log_event (TLS, packet_buffer, 4 * (packet_ptr - packet_buffer));
+}
+
+void bl_do_set_qts (struct tgl_state *TLS, int qts) {
+ if (TLS->locks & TGL_LOCK_DIFF) { return; }
+ if (qts <= TLS->qts) { return; }
+
+ clear_packet ();
+ out_int (CODE_binlog_set_qts);
+ out_int (qts);
+ add_log_event (TLS, packet_buffer, 4 * (packet_ptr - packet_buffer));
+}
+
+void bl_do_set_date (struct tgl_state *TLS, int date) {
+ if (TLS->locks & TGL_LOCK_DIFF) { return; }
+ if (date <= TLS->date) { return; }
+
+ clear_packet ();
+ out_int (CODE_binlog_set_date);
+ out_int (date);
+ add_log_event (TLS, packet_buffer, 4 * (packet_ptr - packet_buffer));
+}
+
+void bl_do_set_seq (struct tgl_state *TLS, int seq) {
+ if (TLS->locks & TGL_LOCK_DIFF) { return; }
+ if (seq <= TLS->seq) { return; }
+
+ clear_packet ();
+ out_int (CODE_binlog_set_seq);
+ out_int (seq);
+ add_log_event (TLS, packet_buffer, 4 * (packet_ptr - packet_buffer));
+}
+
+void bl_do_set_msg_id (struct tgl_state *TLS, struct tgl_message *M, int id) {
+ if (M->id == id) { return; }
+
+ clear_packet ();
+ out_int (CODE_binlog_set_msg_id);
+ out_long (M->id);
+ out_int (id);
+ add_log_event (TLS, packet_buffer, 4 * (packet_ptr - packet_buffer));
+}
+
+void bl_do_user_delete (struct tgl_state *TLS, struct tgl_user *U) {
+ if (U->flags & TGLUF_DELETED) { return; }
+
+ clear_packet ();
+ out_int (CODE_binlog_user_delete);
+ out_int (tgl_get_peer_id (U->id));
+ add_log_event (TLS, packet_buffer, 4 * (packet_ptr - packet_buffer));
+}
+
+void bl_do_encr_chat_delete (struct tgl_state *TLS, struct tgl_secret_chat *U) {
+ if (!(U->flags & TGLPF_CREATED) || U->state == sc_deleted || U->state == sc_none) { return; }
+
+ clear_packet ();
+ out_int (CODE_binlog_encr_chat_delete);
+ out_int (tgl_get_peer_id (U->id));
+ add_log_event (TLS, packet_buffer, 4 * (packet_ptr - packet_buffer));
+}
+
+void bl_do_chat_add_user (struct tgl_state *TLS, struct tgl_chat *C, int version, int user, int inviter, int date) {
+ if (C->user_list_version >= version || !C->user_list_version) { return; }
+
+ clear_packet ();
+ out_int (CODE_binlog_chat_add_participant);
+ out_int (tgl_get_peer_id (C->id));
+ out_int (version);
+ out_int (user);
+ out_int (inviter);
+ out_int (date);
+ add_log_event (TLS, packet_buffer, 4 * (packet_ptr - packet_buffer));
+}
+
+void bl_do_chat_del_user (struct tgl_state *TLS, struct tgl_chat *C, int version, int user) {
+ if (C->user_list_version >= version || !C->user_list_version) { return; }
+
+ clear_packet ();
+ out_int (CODE_binlog_chat_del_participant);
+ out_int (tgl_get_peer_id (C->id));
+ out_int (version);
+ out_int (user);
+ add_log_event (TLS, packet_buffer, 4 * (packet_ptr - packet_buffer));
+}
+
+void bl_do_create_message_new (struct tgl_state *TLS, long long id, int *from_id, int *to_type, int *to_id, int *fwd_from_id, int *fwd_date, int *date, const char *message, int message_len, struct tl_ds_message_media *media, struct tl_ds_message_action *action, int *reply_id, struct tl_ds_reply_markup *reply_markup, int flags) {
+ clear_packet ();
+ assert (!(flags & 0xfffe0000));
+
+ out_int (CODE_binlog_message_new);
+ int *flags_p = packet_ptr;
+ out_int (flags);
+ assert (*flags_p == flags);
+
+ out_long (id);
+
+ if (from_id) {
+ assert (to_type);
+ assert (to_id);
+ (*flags_p) |= (1 << 17);
+ out_int (*from_id);
+ out_int (*to_type);
+ out_int (*to_id);
+ }
+
+ if (fwd_from_id) {
+ assert (fwd_date);
+ (*flags_p) |= (1 << 18);
+ out_int (*fwd_from_id);
+ out_int (*fwd_date);
+ }
+
+ if (date) {
+ (*flags_p) |= (1 << 19);
+ out_int (*date);
+ }
+
+ if (message) {
+ (*flags_p) |= (1 << 20);
+ out_cstring (message, message_len);
+ }
+
+ if (media) {
+ (*flags_p) |= (1 << 21);
+ store_ds_type_message_media (media, TYPE_TO_PARAM (message_media));
+ }
+
+ if (action) {
+ (*flags_p) |= (1 << 22);
+
+ store_ds_type_message_action (action, TYPE_TO_PARAM (message_action));
+ }
+
+ if (reply_id) {
+ (*flags_p) |= (1 << 23);
+ out_int (*reply_id);
+ }
+
+ if (reply_markup) {
+ (*flags_p) |= (1 << 24);
+ store_ds_type_reply_markup (reply_markup, TYPE_TO_PARAM (reply_markup));
+ }
+
+ add_log_event (TLS, packet_buffer, 4 * (packet_ptr - packet_buffer));
+}
+
+void bl_do_create_message_encr_new (struct tgl_state *TLS, long long id, int *from_id, int *to_type, int *to_id, int *date, const char *message, int message_len, struct tl_ds_decrypted_message_media *media, struct tl_ds_decrypted_message_action *action, struct tl_ds_encrypted_file *file, int flags) {
+ clear_packet ();
+ assert (!(flags & 0xfffe0000));
+
+ out_int (CODE_binlog_message_encr_new);
+ int *flags_p = packet_ptr;
+ out_int (flags);
+ assert (flags & TGLMF_ENCRYPTED);
+ assert (*flags_p == flags);
+
+ out_long (id);
+
+ if (from_id) {
+ assert (to_id);
+ assert (to_type);
+ (*flags_p) |= (1 << 17);
+ out_int (*from_id);
+ out_int (*to_type);
+ out_int (*to_id);
+ }
+
+ if (date) {
+ (*flags_p) |= (1 << 19);
+ out_int (*date);
+ }
+
+ if (message) {
+ (*flags_p) |= (1 << 20);
+ out_cstring (message, message_len);
+ }
+
+ if (media) {
+ (*flags_p) |= (1 << 21);
+ store_ds_type_decrypted_message_media (media, TYPE_TO_PARAM (decrypted_message_media));
+ }
+
+ if (action) {
+ (*flags_p) |= (1 << 22);
+ store_ds_type_decrypted_message_action (action, TYPE_TO_PARAM (decrypted_message_action));
+ }
+
+ if (file) {
+ (*flags_p) |= (1 << 23);
+ store_ds_type_encrypted_file (file, TYPE_TO_PARAM (encrypted_file));
+ }
+
+ add_log_event (TLS, packet_buffer, 4 * (packet_ptr - packet_buffer));
+}
+
+void bl_do_message_delete (struct tgl_state *TLS, struct tgl_message *M) {
+ clear_packet ();
+ out_int (CODE_binlog_message_delete);
+ out_long (M->id);
+ add_log_event (TLS, packet_buffer, 4 * (packet_ptr - packet_buffer));
+}
+
+void bl_do_msg_update (struct tgl_state *TLS, long long id) {
+ clear_packet ();
+ out_int (CODE_binlog_msg_update);
+ out_long (id);
+ add_log_event (TLS, packet_buffer, 4 * (packet_ptr - packet_buffer));
+}
+
+void bl_do_reset_authorization (struct tgl_state *TLS) {
+ clear_packet ();
+ out_int (CODE_binlog_reset_authorization);
+ add_log_event (TLS, packet_buffer, 4 * (packet_ptr - packet_buffer));
+}
+
+void bl_do_encr_chat_exchange_new (struct tgl_state *TLS, struct tgl_secret_chat *E, long long *exchange_id, const void *key, int *state) {
+ clear_packet ();
+
+ out_int (CODE_binlog_encr_chat_exchange_new);
+ out_int (tgl_get_peer_id (E->id));
+
+ int *flags_p = packet_ptr;
+ out_int (0);
+
+ if (exchange_id) {
+ *flags_p |= (1 << 17);
+ out_long (*exchange_id);
+ }
+
+ if (key) {
+ *flags_p |= (1 << 18);
+ out_ints ((void *)key, 64);
+ }
+
+ if (state) {
+ *flags_p |= (1 << 19);
+ out_int (*state);
+ }
+ add_log_event (TLS, packet_buffer, 4 * (packet_ptr - packet_buffer));
+}
+
+void bl_do_set_auth_key (struct tgl_state *TLS, int num, unsigned char *buf) {
+ int *ev = alloc_log_event (8 + 8 + 256);
+ ev[0] = CODE_binlog_auth_key;
+ ev[1] = num;
+ //*(long long *)(ev + 2) = fingerprint;
+ memcpy (ev + 2, buf, 256);
+ add_log_event (TLS, ev, 8 + 256);
+}
+
+void bl_do_user_new (struct tgl_state *TLS, int id, long long *access_hash, const char *first_name, int first_name_len, const char *last_name, int last_name_len, const char *phone, int phone_len, const char *username, int username_len, struct tl_ds_photo *photo, const char *real_first_name, int real_first_name_len, const char *real_last_name, int real_last_name_len, struct tl_ds_user_profile_photo *profile_photo, int *last_read_in, int *last_read_out, struct tl_ds_bot_info *bot_info, int flags) {
+ tgl_peer_t *PP = tgl_peer_get (TLS, TGL_MK_USER (id));
+ struct tgl_user *P = &PP->user;
+
+ if (flags == TGL_FLAGS_UNCHANGED) {
+ flags = P->flags & 0xffff;
+ }
+
+ clear_packet ();
+ out_int (CODE_binlog_user_new);
+
+ int *flags_p = packet_ptr;
+
+ assert (!(flags & 0xfffe0000));
+ out_int (flags);
+ out_int (id);
+
+ if (access_hash) {
+ if (!P || P->access_hash != *access_hash) {
+ out_long (*access_hash);
+ (*flags_p) |= (1 << 17);
+ }
+ }
+
+ if (first_name) {
+ if (!P || !P->first_name || !P->last_name || mystreq1 (P->first_name, first_name, first_name_len) || mystreq1 (P->last_name, last_name, last_name_len)) {
+ out_cstring (first_name, first_name_len);
+ out_cstring (last_name, last_name_len);
+
+ (*flags_p) |= (1 << 18);
+ }
+ }
+
+ if (phone) {
+ if (!P || !P->phone || mystreq1 (P->phone, phone, phone_len)) {
+ out_cstring (phone, phone_len);
+ (*flags_p) |= (1 << 19);
+ }
+ }
+
+ if (username) {
+ if (!P || !P->username || mystreq1 (P->username, username, username_len)) {
+ out_cstring (username, username_len);
+ (*flags_p) |= (1 << 20);
+ }
+ }
+
+ if (photo) {
+ if (!P || !P->photo || P->photo->id != DS_LVAL (photo->id)) {
+ store_ds_type_photo (photo, TYPE_TO_PARAM (photo));
+ (*flags_p) |= (1 << 21);
+ }
+ }
+
+ if (real_first_name) {
+ assert (real_last_name);
+ if (!P || !P->real_first_name || !P->real_last_name || mystreq1 (P->real_first_name, real_first_name, real_first_name_len) || mystreq1 (P->real_last_name, real_last_name, real_last_name_len)) {
+ out_cstring (real_first_name, real_first_name_len);
+ out_cstring (real_last_name, real_last_name_len);
+
+ (*flags_p) |= (1 << 22);
+ }
+ }
+
+ if (profile_photo) {
+ if (!P || P->photo_id != DS_LVAL (profile_photo->photo_id)) {
+ store_ds_type_user_profile_photo (profile_photo, TYPE_TO_PARAM (user_profile_photo));
+ (*flags_p) |= (1 << 23);
+ }
+ }
+
+ if (last_read_in) {
+ if (!P || P->last_read_in < *last_read_in) {
+ out_int (*last_read_in);
+ (*flags_p) |= (1 << 24);
+ }
+ }
+
+ if (last_read_out) {
+ if (!P || P->last_read_out < *last_read_out) {
+ out_int (*last_read_out);
+ (*flags_p) |= (1 << 25);
+ }
+ }
+
+ if (bot_info) {
+ if (!P || !P->bot_info || P->bot_info->version != DS_LVAL (bot_info->version)) {
+ store_ds_type_bot_info (bot_info, TYPE_TO_PARAM (bot_info));
+ (*flags_p) |= (1 << 26);
+ }
+ }
+
+ if (((*flags_p) & 0xffff0000) || !P || (P->flags & 0xffff) != flags) {
+ add_log_event (TLS, packet_buffer, 4 * (packet_ptr - packet_buffer));
+ }
+}
+
+void bl_do_chat_new (struct tgl_state *TLS, int id, const char *title, int title_len, int *user_num, int *date, int *version, struct tl_ds_vector *participants, struct tl_ds_chat_photo *chat_photo, struct tl_ds_photo *photo, int *admin, int *last_read_in, int *last_read_out, int flags) {
+ tgl_peer_t *PP = tgl_peer_get (TLS, TGL_MK_CHAT (id));
+ struct tgl_chat *P = &PP->chat;
+
+ if (flags == TGL_FLAGS_UNCHANGED) {
+ flags = P ? (P->flags & 0xffff) : 0;
+ }
+
+ clear_packet ();
+ out_int (CODE_binlog_chat_new);
+
+ int *flags_p = packet_ptr;
+
+ assert (!(flags & 0xfffe0000));
+ out_int (flags);
+ out_int (id);
+
+ if (title) {
+ if (!P || !P->title || mystreq1 (P->title, title, title_len)) {
+ out_cstring (title, title_len);
+ (*flags_p) |= (1 << 17);
+ }
+ }
+
+ if (user_num) {
+ if (!P || P->users_num != *user_num) {
+ out_int (*user_num);
+ (*flags_p) |= (1 << 18);
+ }
+ }
+
+ if (date) {
+ if (!P || P->date != *date) {
+ out_int (*date);
+ (*flags_p) |= (1 << 19);
+ }
+ }
+
+ if (version) {
+ assert (participants);
+ if (!P || *version != P->version) {
+ out_int (*version);
+ store_ds_type_vector (participants, TYPE_TO_PARAM_1 (vector, TYPE_TO_PARAM (chat_participant)));
+ (*flags_p) |= (1 << 20);
+ }
+ }
+
+ if (chat_photo && chat_photo->photo_big) {
+ if (!P || DS_LVAL (chat_photo->photo_big->secret) != P->photo_big.secret) {
+ store_ds_type_chat_photo (chat_photo, TYPE_TO_PARAM (chat_photo));
+ (*flags_p) |= (1 << 21);
+ }
+ }
+
+ if (photo) {
+ if (!P || !P->photo || P->photo->id != DS_LVAL (photo->id)) {
+ store_ds_type_photo (photo, TYPE_TO_PARAM (photo));
+ (*flags_p) |= (1 << 22);
+ }
+ }
+
+ if (admin) {
+ if (!P || P->admin_id != *admin) {
+ out_int (*admin);
+ (*flags_p) |= (1 << 23);
+ }
+ }
+
+ if (last_read_in) {
+ if (!P || P->last_read_in < *last_read_in) {
+ out_int (*last_read_in);
+ (*flags_p) |= (1 << 24);
+ }
+ }
+
+ if (last_read_out) {
+ if (!P || P->last_read_out < *last_read_out) {
+ out_int (*last_read_out);
+ (*flags_p) |= (1 << 25);
+ }
+ }
+
+ if (((*flags_p) & 0xffff0000) || !P || (P->flags & 0xffff) != flags) {
+ add_log_event (TLS, packet_buffer, 4 * (packet_ptr - packet_buffer));
+ }
+}
+
+void bl_do_encr_chat_new (struct tgl_state *TLS, int id, long long *access_hash, int *date, int *admin, int *user_id, void *key, void *g_key, void *first_key_id, int *state, int *ttl, int *layer, int *in_seq_no, int *last_in_seq_no, int *out_seq_no, long long *key_fingerprint, int flags) {
+ tgl_peer_t *PP = tgl_peer_get (TLS, TGL_MK_ENCR_CHAT (id));
+ struct tgl_secret_chat *P = PP ? &PP->encr_chat : NULL;
+
+ if (flags == TGL_FLAGS_UNCHANGED) {
+ flags = P->flags & 0xffff;
+ }
+
+ clear_packet ();
+ out_int (CODE_binlog_encr_chat_new);
+
+ int *flags_p = packet_ptr;
+
+ assert (!(flags & 0xfffe0000));
+ out_int (flags);
+ out_int (id);
+
+ if (access_hash) {
+ if (!P || P->access_hash != *access_hash) {
+ out_long (*access_hash);
+ (*flags_p) |= (1 << 17);
+ }
+ }
+
+ if (date) {
+ if (!P || P->date != *date) {
+ out_int (*date);
+ (*flags_p) |= (1 << 18);
+ }
+ }
+
+ if (admin) {
+ if (!P || P->admin_id != *admin) {
+ out_int (*admin);
+ (*flags_p) |= (1 << 19);
+ }
+ }
+
+ if (user_id) {
+ if (!P || P->user_id != *user_id) {
+ out_int (*user_id);
+ (*flags_p) |= (1 << 20);
+ }
+ }
+
+ if (key) {
+ if (!P || memcmp (P->key, key, 256)) {
+ out_ints (key, 64);
+ (*flags_p) |= (1 << 21);
+ }
+ }
+
+ if (g_key) {
+ if (!P || !P->g_key || memcmp (P->g_key, g_key, 256)) {
+ out_ints (g_key, 64);
+ (*flags_p) |= (1 << 22);
+ }
+ }
+
+ if (state) {
+ if (!P || (int)P->state != *state) {
+ out_int (*state);
+ (*flags_p) |= (1 << 23);
+ }
+ }
+
+ if (ttl) {
+ if (!P || P->ttl != *ttl) {
+ out_int (*ttl);
+ (*flags_p) |= (1 << 24);
+ }
+ }
+
+ if (layer) {
+ if (!P || P->layer != *layer) {
+ out_int (*layer);
+ (*flags_p) |= (1 << 25);
+ }
+ }
+
+ if (in_seq_no || last_in_seq_no || out_seq_no) {
+ if (!P || (in_seq_no && P->in_seq_no != *in_seq_no) ||
+ (out_seq_no && P->out_seq_no != *out_seq_no) ||
+ (last_in_seq_no && P->last_in_seq_no != *last_in_seq_no)) {
+
+ out_int (in_seq_no ? *in_seq_no : P ? P->in_seq_no : 0);
+ out_int (last_in_seq_no ? *last_in_seq_no : P ? P->last_in_seq_no : 0);
+ out_int (out_seq_no ? *out_seq_no : P ? P->out_seq_no : 0);
+ (*flags_p) |= (1 << 26);
+ }
+ }
+
+ if (key_fingerprint) {
+ if (!P || P->key_fingerprint != *key_fingerprint) {
+ out_long (*key_fingerprint);
+ (*flags_p) |= (1 << 27);
+ }
+ }
+
+ if (((*flags_p) & 0xffff0000) || !P || (P->flags & 0xffff) != flags) {
+ add_log_event (TLS, packet_buffer, 4 * (packet_ptr - packet_buffer));
+ }
+}
diff --git a/protocols/Telegram/tgl/binlog.tl b/protocols/Telegram/tgl/binlog.tl
new file mode 100644
index 0000000000..a0c52424d7
--- /dev/null
+++ b/protocols/Telegram/tgl/binlog.tl
@@ -0,0 +1,102 @@
+---types---
+
+binlog.encrKey key:64*[int] = binlog.EncrKey;
+
+binlog.start = binlog.Update;
+
+binlog.dcOption dc:int name:string ip:string port:int = binlog.Update;
+binlog.dcOptionNew flags:int dc:int name:string ip:string port:int = binlog.Update;
+
+binlog.authKey dc:int key:%binlog.EncrKey = binlog.Update;
+binlog.defaultDc dc:int = binlog.Update;
+binlog.dcSigned dc:int = binlog.Update;
+
+binlog.ourId id:int = binlog.Update;
+
+binlog.setDhParams root:int prime:%binlog.EncrKey version:int = binlog.Update;
+
+binlog.setPts pts:int = binlog.Update;
+binlog.setQts qts:int = binlog.Update;
+binlog.setDate date:int = binlog.Update;
+binlog.setSeq seq:int = binlog.Update;
+
+binlog.encrChatDelete id:int = binlog.Update;
+binlog.encrChatNew#84977251 flags:# id:int
+ access_hash:flags.17?long
+ date:flags.18?int
+ admin:flags.19?int
+ user_id:flags.20?int
+ key:flags.21?%binlog.EncrKey
+ g_key:flags.22?%binlog.EncrKey
+ state:flags.23?int
+ ttl:flags.24?int
+ layer:flags.25?int
+ in_seq_no:flags.26?int last_in_seq_no:flags.26?int out_seq_no:flags.26?int
+ key_fingerprint:flags.27?long
+ = binlog.Update;
+
+binlog.encrChatExchangeNew#9d49488d flags:# id:int
+ exchange_id:flags.17?long
+ key:flags.18?%binlog.EncrKey
+ state:flags.19?int
+ = binlog.Update;
+
+binlog.userDelete id:int = binlog.Update;
+binlog.userNew#127cf2f9 flags:# id:int
+ access_hash:flags.17?long
+ first_name:flags.18?string last_name:flags.18?string
+ phone:flags.19?string
+ username:flags.20?string
+ photo:flags.21?Photo
+ real_first_name:flags.22?string real_last_name:flags.22?string
+ user_photo:flags.23?UserProfilePhoto
+ last_read_in:flags.24?int
+ last_read_out:flags.25?int
+ bot_info:flags.26?BotInfo
+ = binlog.Update;
+
+binlog.chatNew#0a10aa92 flags:# id:int
+ title:flags.17?string
+ user_num:flags.18?int
+ date:flags.19?int
+ version:flags.20?int participants:flags.20?(Vector ChatParticipant)
+ chat_photo:flags.21?ChatPhoto
+ photo:flags.22?Photo
+ admin:flags.23?int
+ last_read_in:flags.24?int
+ last_read_out:flags.25?int
+ = binlog.Update;
+
+binlog.chatAddParticipant id:int version:int user_id:int inviter_id:int date:int = binlog.Update;
+binlog.chatDelParticipant id:int version:int user_id:int = binlog.Update;
+
+binlog.setMsgId old_id:long new_id:int = binlog.Update;
+binlog.messageDelete lid:long = binlog.Update;
+
+binlog.messageNew#427cfcdb flags:# lid:long
+ from_id:flags.17?int to_type:flags.17?int to_id:flags.17?int
+ fwd_from_id:flags.18?int fwd_date:flags.18?int
+ date:flags.19?int
+ message:flags.20?string
+ media:flags.21?MessageMedia
+ action:flags.22?MessageAction
+ reply_id:flags.23?int
+ reply_markup:flags.24?ReplyMarkup
+ = binlog.Update;
+
+binlog.messageEncrNew#6cf7cabc flags:# lid:long
+ from_id:flags.17?int to_type:flags.17?int to_id:flags.17?int
+ //empty 18 bit
+ date:flags.19?int
+ message:flags.20?string
+ encr_media:flags.21?DecryptedMessageMedia
+ encr_action:flags.22?DecryptedMessageAction
+ file:flags.23?EncryptedFile
+ = binlog.Update;
+
+binlog.msgUpdate#6dd4d85f lid:long = binlog.Update;
+
+binlog.resetAuthorization = binlog.Update;
+
+
+---functions---
diff --git a/protocols/Telegram/tgl/config.h b/protocols/Telegram/tgl/config.h
new file mode 100644
index 0000000000..916c823b14
--- /dev/null
+++ b/protocols/Telegram/tgl/config.h
@@ -0,0 +1,163 @@
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* disable extf queries */
+#undef DISABLE_EXTF
+
+/* Use libevent v1 */
+//#undef EVENT_V1
+
+/* Use libevent v2 */
+//#undef EVENT_V2
+#define EVENT_V2
+
+/* Define to 1 if you have the `alarm' function. */
+#undef HAVE_ALARM
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#undef HAVE_ARPA_INET_H
+
+/* Define to 1 if you have the `endpwent' function. */
+#undef HAVE_ENDPWENT
+
+/* Define to 1 if you have the <execinfo.h> header file. */
+#undef HAVE_EXECINFO_H
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `event' library (-levent). */
+#undef HAVE_LIBEVENT
+
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
+/* Define to 1 if you have `z' library (-lz) */
+#undef HAVE_LIBZ
+
+/* Define to 1 if you have the <mach/mach.h> header file. */
+#undef HAVE_MACH_MACH_H
+
+/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
+ to 0 otherwise. */
+#undef HAVE_MALLOC
+
+/* Define to 1 if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+
+/* Define to 1 if you have the `memmove' function. */
+#undef HAVE_MEMMOVE
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `memset' function. */
+#undef HAVE_MEMSET
+
+/* Define to 1 if you have the `mkdir' function. */
+#undef HAVE_MKDIR
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#undef HAVE_NETDB_H
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
+
+/* Define to 1 if your system has a GNU libc compatible `realloc' function,
+ and to 0 otherwise. */
+#undef HAVE_REALLOC
+
+/* Define to 1 if you have the `select' function. */
+#undef HAVE_SELECT
+
+/* Define to 1 if you have the `socket' function. */
+#undef HAVE_SOCKET
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strdup' function. */
+#undef HAVE_STRDUP
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strndup' function. */
+#undef HAVE_STRNDUP
+
+/* Define to 1 if you have the <sys/file.h> header file. */
+#undef HAVE_SYS_FILE_H
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <termios.h> header file. */
+#undef HAVE_TERMIOS_H
+
+/* Define to 1 if you have the `uname' function. */
+#undef HAVE_UNAME
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if the system has the `__builtin_bswap32' built-in function */
+#undef HAVE___BUILTIN_BSWAP32
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* fixed for correct valgrind work */
+#undef VALGRIND_FIXES
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef gid_t
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+#undef inline
+#endif
+
+/* Define to rpl_malloc if the replacement function should be used. */
+#undef malloc
+
+/* Define to rpl_realloc if the replacement function should be used. */
+#undef realloc
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef uid_t
diff --git a/protocols/Telegram/tgl/config.h.in b/protocols/Telegram/tgl/config.h.in
new file mode 100644
index 0000000000..916c823b14
--- /dev/null
+++ b/protocols/Telegram/tgl/config.h.in
@@ -0,0 +1,163 @@
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* disable extf queries */
+#undef DISABLE_EXTF
+
+/* Use libevent v1 */
+//#undef EVENT_V1
+
+/* Use libevent v2 */
+//#undef EVENT_V2
+#define EVENT_V2
+
+/* Define to 1 if you have the `alarm' function. */
+#undef HAVE_ALARM
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#undef HAVE_ARPA_INET_H
+
+/* Define to 1 if you have the `endpwent' function. */
+#undef HAVE_ENDPWENT
+
+/* Define to 1 if you have the <execinfo.h> header file. */
+#undef HAVE_EXECINFO_H
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `event' library (-levent). */
+#undef HAVE_LIBEVENT
+
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
+/* Define to 1 if you have `z' library (-lz) */
+#undef HAVE_LIBZ
+
+/* Define to 1 if you have the <mach/mach.h> header file. */
+#undef HAVE_MACH_MACH_H
+
+/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
+ to 0 otherwise. */
+#undef HAVE_MALLOC
+
+/* Define to 1 if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+
+/* Define to 1 if you have the `memmove' function. */
+#undef HAVE_MEMMOVE
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `memset' function. */
+#undef HAVE_MEMSET
+
+/* Define to 1 if you have the `mkdir' function. */
+#undef HAVE_MKDIR
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#undef HAVE_NETDB_H
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
+
+/* Define to 1 if your system has a GNU libc compatible `realloc' function,
+ and to 0 otherwise. */
+#undef HAVE_REALLOC
+
+/* Define to 1 if you have the `select' function. */
+#undef HAVE_SELECT
+
+/* Define to 1 if you have the `socket' function. */
+#undef HAVE_SOCKET
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strdup' function. */
+#undef HAVE_STRDUP
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strndup' function. */
+#undef HAVE_STRNDUP
+
+/* Define to 1 if you have the <sys/file.h> header file. */
+#undef HAVE_SYS_FILE_H
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <termios.h> header file. */
+#undef HAVE_TERMIOS_H
+
+/* Define to 1 if you have the `uname' function. */
+#undef HAVE_UNAME
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if the system has the `__builtin_bswap32' built-in function */
+#undef HAVE___BUILTIN_BSWAP32
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* fixed for correct valgrind work */
+#undef VALGRIND_FIXES
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef gid_t
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+#undef inline
+#endif
+
+/* Define to rpl_malloc if the replacement function should be used. */
+#undef malloc
+
+/* Define to rpl_realloc if the replacement function should be used. */
+#undef realloc
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef uid_t
diff --git a/protocols/Telegram/tgl/configure b/protocols/Telegram/tgl/configure
new file mode 100644
index 0000000000..85b2f872e2
--- /dev/null
+++ b/protocols/Telegram/tgl/configure
@@ -0,0 +1,5669 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.69 for telegram-cli 1.0.
+#
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+ # into an infinite loop, continuously re-executing ourselves.
+ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+ _as_can_reexec=no; export _as_can_reexec;
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+ fi
+ # We don't want this to propagate to other subprocesses.
+ { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ as_found=:
+ case $as_dir in #(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+ if test "x$CONFIG_SHELL" != x; then :
+ export CONFIG_SHELL
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+ fi
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+ # already done that, so ensure we don't try to do so again and fall
+ # in an infinite loop. This has already happened in practice.
+ _as_can_reexec=no; export _as_can_reexec
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='telegram-cli'
+PACKAGE_TARNAME='telegram-cli'
+PACKAGE_VERSION='1.0'
+PACKAGE_STRING='telegram-cli 1.0'
+PACKAGE_BUGREPORT=''
+PACKAGE_URL=''
+
+ac_unique_file="config.h.in"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='LTLIBOBJS
+EXTRA_OBJECTS
+EXTRA_LIBS
+LIBOBJS
+EGREP
+GREP
+CPP
+OPENSSL_LDFLAGS
+OPENSSL_LIBS
+OPENSSL_INCLUDES
+PKG_CONFIG
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+with_openssl
+with_zlib
+enable_extf
+enable_libevent
+enable_valgrind
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *=) ac_optarg= ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ esac
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures telegram-cli 1.0 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking ...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/telegram-cli]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of telegram-cli 1.0:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+enables extended queries system
+--enable-libevent include libevent-based net and timers
+fixes for correct valgrind work
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-openssl=DIR root of the OpenSSL directory
+ --with-zlib=DIR root directory path of zlib installation [defaults to
+ /usr/local or /usr if not found in /usr/local]
+ --without-zlib to disable zlib usage completely
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to the package provider.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+telegram-cli configure 1.0
+generated by GNU Autoconf 2.69
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ test -x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } > conftest.i && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if eval \${$3+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_header_compiler=yes
+else
+ ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ac_header_preproc=yes
+else
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+ yes:no: )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=no"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_type
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by telegram-cli $as_me 1.0, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+ done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 2)
+ as_fn_append ac_configure_args1 " '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ as_fn_append ac_configure_args " '$ac_arg'"
+ ;;
+ esac
+ done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file" \
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_check_openssl.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_OPENSSL([action-if-found[, action-if-not-found]])
+#
+# DESCRIPTION
+#
+# Look for OpenSSL in a number of default spots, or in a user-selected
+# spot (via --with-openssl). Sets
+#
+# OPENSSL_INCLUDES to the include directives required
+# OPENSSL_LIBS to the -l directives required
+# OPENSSL_LDFLAGS to the -L or -R flags required
+#
+# and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately
+#
+# This macro sets OPENSSL_INCLUDES such that source files should use the
+# openssl/ directory in include directives:
+#
+# #include <openssl/hmac.h>
+#
+# LICENSE
+#
+# Copyright (c) 2009,2010 Zmanda Inc. <http://www.zmanda.com/>
+# Copyright (c) 2009,2010 Dustin J. Mitchell <dustin@zmanda.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 8
+
+# This is what autoupdate's m4 run will expand. It fires
+# the warning (with _au_warn_XXX), outputs it into the
+# updated configure.ac (with AC_DIAGNOSE), and then outputs
+# the replacement expansion.
+
+
+# This is an auxiliary macro that is also run when
+# autoupdate runs m4. It simply calls m4_warning, but
+# we need a wrapper so that each warning is emitted only
+# once. We break the quoting in m4_warning's argument in
+# order to expand this macro's arguments, not AU_DEFUN's.
+
+
+# Finally, this is the expansion that is picked up by
+# autoconf. It tells the user to run autoupdate, and
+# then outputs the replacement expansion. We do not care
+# about autoupdate's warning because that contains
+# information on what to do *after* running autoupdate.
+
+
+
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_check_zlib.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_ZLIB([action-if-found], [action-if-not-found])
+#
+# DESCRIPTION
+#
+# This macro searches for an installed zlib library. If nothing was
+# specified when calling configure, it searches first in /usr/local and
+# then in /usr, /opt/local and /sw. If the --with-zlib=DIR is specified,
+# it will try to find it in DIR/include/zlib.h and DIR/lib/libz.a. If
+# --without-zlib is specified, the library is not searched at all.
+#
+# If either the header file (zlib.h) or the library (libz) is not found,
+# shell commands 'action-if-not-found' is run. If 'action-if-not-found' is
+# not specified, the configuration exits on error, asking for a valid zlib
+# installation directory or --without-zlib.
+#
+# If both header file and library are found, shell commands
+# 'action-if-found' is run. If 'action-if-found' is not specified, the
+# default action appends '-I${ZLIB_HOME}/include' to CPFLAGS, appends
+# '-L$ZLIB_HOME}/lib' to LDFLAGS, prepends '-lz' to LIBS, and calls
+# AC_DEFINE(HAVE_LIBZ). You should use autoheader to include a definition
+# for this symbol in a config.h file. Sample usage in a C/C++ source is as
+# follows:
+#
+# #ifdef HAVE_LIBZ
+# #include <zlib.h>
+# #endif /* HAVE_LIBZ */
+#
+# LICENSE
+#
+# Copyright (c) 2008 Loic Dachary <loic@senga.org>
+# Copyright (c) 2010 Bastien Chevreux <bach@chevreux.org>
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 14
+
+# This is what autoupdate's m4 run will expand. It fires
+# the warning (with _au_warn_XXX), outputs it into the
+# updated configure.ac (with AC_DIAGNOSE), and then outputs
+# the replacement expansion.
+
+
+# This is an auxiliary macro that is also run when
+# autoupdate runs m4. It simply calls m4_warning, but
+# we need a wrapper so that each warning is emitted only
+# once. We break the quoting in m4_warning's argument in
+# order to expand this macro's arguments, not AU_DEFUN's.
+
+
+# Finally, this is the expansion that is picked up by
+# autoconf. It tells the user to run autoupdate, and
+# then outputs the replacement expansion. We do not care
+# about autoupdate's warning because that contains
+# information on what to do *after* running autoupdate.
+
+
+
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_gcc_builtin.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_GCC_BUILTIN(BUILTIN)
+#
+# DESCRIPTION
+#
+# This macro checks if the compiler supports one of GCC's built-in
+# functions; many other compilers also provide those same built-ins.
+#
+# The BUILTIN parameter is the name of the built-in function.
+#
+# If BUILTIN is supported define HAVE_<BUILTIN>. Keep in mind that since
+# builtins usually start with two underscores they will be copied over
+# into the HAVE_<BUILTIN> definition (e.g. HAVE___BUILTIN_EXPECT for
+# __builtin_expect()).
+#
+# The macro caches its result in the ax_cv_have_<BUILTIN> variable (e.g.
+# ax_cv_have___builtin_expect).
+#
+# The macro currently supports the following built-in functions:
+#
+# __builtin_assume_aligned
+# __builtin_bswap32
+# __builtin_bswap64
+# __builtin_choose_expr
+# __builtin___clear_cache
+# __builtin_clrsb
+# __builtin_clrsbl
+# __builtin_clrsbll
+# __builtin_clz
+# __builtin_clzl
+# __builtin_clzll
+# __builtin_complex
+# __builtin_constant_p
+# __builtin_ctz
+# __builtin_ctzl
+# __builtin_ctzll
+# __builtin_expect
+# __builtin_ffs
+# __builtin_ffsl
+# __builtin_ffsll
+# __builtin_fpclassify
+# __builtin_huge_val
+# __builtin_huge_valf
+# __builtin_huge_vall
+# __builtin_inf
+# __builtin_infd128
+# __builtin_infd32
+# __builtin_infd64
+# __builtin_inff
+# __builtin_infl
+# __builtin_isinf_sign
+# __builtin_nan
+# __builtin_nand128
+# __builtin_nand32
+# __builtin_nand64
+# __builtin_nanf
+# __builtin_nanl
+# __builtin_nans
+# __builtin_nansf
+# __builtin_nansl
+# __builtin_object_size
+# __builtin_parity
+# __builtin_parityl
+# __builtin_parityll
+# __builtin_popcount
+# __builtin_popcountl
+# __builtin_popcountll
+# __builtin_powi
+# __builtin_powif
+# __builtin_powil
+# __builtin_prefetch
+# __builtin_trap
+# __builtin_types_compatible_p
+# __builtin_unreachable
+#
+# Unsuppored built-ins will be tested with an empty parameter set and the
+# result of the check might be wrong or meaningless so use with care.
+#
+# LICENSE
+#
+# Copyright (c) 2013 Gabriele Svelto <gabriele.svelto@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 2
+
+
+
+
+# Checks for programs.
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+if test -z "$ac_file"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# BSD locations for headers and libraries from packages, Linux locations for self-compiled stuff.
+CPPFLAGS="$CPPFLAGS -I/usr/local/include"
+LDFLAGS="$LDFLAGS -L/usr/local/lib"
+
+# Checks for libraries.
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5
+$as_echo_n "checking for sqrt in -lm... " >&6; }
+if ${ac_cv_lib_m_sqrt+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sqrt ();
+int
+main ()
+{
+return sqrt ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_m_sqrt=yes
+else
+ ac_cv_lib_m_sqrt=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sqrt" >&5
+$as_echo "$ac_cv_lib_m_sqrt" >&6; }
+if test "x$ac_cv_lib_m_sqrt" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+ LIBS="-lm $LIBS"
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
+$as_echo_n "checking for library containing clock_gettime... " >&6; }
+if ${ac_cv_search_clock_gettime+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clock_gettime ();
+int
+main ()
+{
+return clock_gettime ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' rt; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_clock_gettime=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_clock_gettime+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_clock_gettime+:} false; then :
+
+else
+ ac_cv_search_clock_gettime=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5
+$as_echo "$ac_cv_search_clock_gettime" >&6; }
+ac_res=$ac_cv_search_clock_gettime
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+
+EVENT_VER=""
+EXTRA_OBJECTS=""
+
+# OPENSSL_INCLUDES to the include directives required
+# OPENSSL_LIBS to the -l directives required
+# OPENSSL_LDFLAGS to the -L or -R flags required
+
+
+ found=false
+
+# Check whether --with-openssl was given.
+if test "${with_openssl+set}" = set; then :
+ withval=$with_openssl;
+ case "$withval" in
+ "" | y | ye | yes | n | no)
+ as_fn_error $? "Invalid --with-openssl value" "$LINENO" 5
+ ;;
+ *) ssldirs="$withval"
+ ;;
+ esac
+
+else
+
+ # if pkg-config is installed and openssl has installed a .pc file,
+ # then use that information and don't search ssldirs
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ if test x"$PKG_CONFIG" != x""; then
+ OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null`
+ if test $? = 0; then
+ OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null`
+ OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null`
+ found=true
+ fi
+ fi
+
+ # no such luck; use some default ssldirs
+ if ! $found; then
+ ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr"
+ fi
+
+
+fi
+
+
+
+ # note that we #include <openssl/foo.h>, so the OpenSSL headers have to be in
+ # an 'openssl' subdirectory
+
+ if ! $found; then
+ OPENSSL_INCLUDES=
+ for ssldir in $ssldirs; do
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl/ssl.h in $ssldir" >&5
+$as_echo_n "checking for openssl/ssl.h in $ssldir... " >&6; }
+ if test -f "$ssldir/include/openssl/ssl.h"; then
+ OPENSSL_INCLUDES="-I$ssldir/include"
+ OPENSSL_LDFLAGS="-L$ssldir/lib"
+ OPENSSL_LIBS="-lssl -lcrypto"
+ found=true
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ break
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+ done
+
+ # if the file wasn't found, well, go ahead and try the link anyway -- maybe
+ # it will just work!
+ fi
+
+ # try the preprocessor and linker with our new flags,
+ # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiling and linking against OpenSSL works" >&5
+$as_echo_n "checking whether compiling and linking against OpenSSL works... " >&6; }
+ echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \
+ "OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&5
+
+ save_LIBS="$LIBS"
+ save_LDFLAGS="$LDFLAGS"
+ save_CPPFLAGS="$CPPFLAGS"
+ LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS"
+ LIBS="$OPENSSL_LIBS $LIBS"
+ CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <openssl/ssl.h>
+int
+main ()
+{
+SSL_new(NULL)
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ as_fn_error $? "No openssl found" "$LINENO" 5
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if ${ac_cv_prog_CPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+#
+# Handle user hints
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if zlib is wanted" >&5
+$as_echo_n "checking if zlib is wanted... " >&6; }
+zlib_places="/usr/local /usr /opt/local /sw"
+
+# Check whether --with-zlib was given.
+if test "${with_zlib+set}" = set; then :
+ withval=$with_zlib; if test "$withval" != no ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ if test -d "$withval"
+ then
+ zlib_places="$withval $zlib_places"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Sorry, $withval does not exist, checking usual places" >&5
+$as_echo "$as_me: WARNING: Sorry, $withval does not exist, checking usual places" >&2;}
+ fi
+else
+ zlib_places=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+
+
+#
+# Locate zlib, if wanted
+#
+if test -n "${zlib_places}"
+then
+ # check the user supplied or any other more or less 'standard' place:
+ # Most UNIX systems : /usr/local and /usr
+ # MacPorts / Fink on OSX : /opt/local respectively /sw
+ for ZLIB_HOME in ${zlib_places} ; do
+ if test -f "${ZLIB_HOME}/include/zlib.h"; then break; fi
+ ZLIB_HOME=""
+ done
+
+ ZLIB_OLD_LDFLAGS=$LDFLAGS
+ ZLIB_OLD_CPPFLAGS=$CPPFLAGS
+ if test -n "${ZLIB_HOME}"; then
+ LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
+ CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
+ fi
+
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateEnd in -lz" >&5
+$as_echo_n "checking for inflateEnd in -lz... " >&6; }
+if ${ac_cv_lib_z_inflateEnd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lz $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 inflateEnd ();
+int
+main ()
+{
+return inflateEnd ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_z_inflateEnd=yes
+else
+ ac_cv_lib_z_inflateEnd=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_z_inflateEnd" >&5
+$as_echo "$ac_cv_lib_z_inflateEnd" >&6; }
+if test "x$ac_cv_lib_z_inflateEnd" = xyes; then :
+ zlib_cv_libz=yes
+else
+ zlib_cv_libz=no
+fi
+
+ ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_zlib_h" = xyes; then :
+ zlib_cv_zlib_h=yes
+else
+ zlib_cv_zlib_h=no
+fi
+
+
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ if test "$zlib_cv_libz" = "yes" && test "$zlib_cv_zlib_h" = "yes"
+ then
+ #
+ # If both library and header were found, action-if-found
+ #
+
+ CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
+ LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
+ LIBS="-lz $LIBS"
+
+$as_echo "#define HAVE_LIBZ 1" >>confdefs.h
+
+
+ else
+ #
+ # If either header or library was not found, action-if-not-found
+ #
+ as_fn_error $? "No zlib found" "$LINENO" 5
+ fi
+fi
+
+
+# Check whether --enable-extf was given.
+if test "${enable_extf+set}" = set; then :
+ enableval=$enable_extf;
+ if test "x$enableval" = "xno" ; then
+
+$as_echo "#define DISABLE_EXTF 1" >>confdefs.h
+
+ fi
+
+fi
+
+
+# Check whether --enable-libevent was given.
+if test "${enable_libevent+set}" = set; then :
+ enableval=$enable_libevent;
+ if test "x$enableval" = "xyes" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for event_base_new in -levent" >&5
+$as_echo_n "checking for event_base_new in -levent... " >&6; }
+if ${ac_cv_lib_event_event_base_new+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-levent $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 event_base_new ();
+int
+main ()
+{
+return event_base_new ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_event_event_base_new=yes
+else
+ ac_cv_lib_event_event_base_new=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_event_event_base_new" >&5
+$as_echo "$ac_cv_lib_event_event_base_new" >&6; }
+if test "x$ac_cv_lib_event_event_base_new" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBEVENT 1
+_ACEOF
+
+ LIBS="-levent $LIBS"
+
+else
+ as_fn_error $? "no libevent found" "$LINENO" 5
+fi
+
+ ac_fn_c_check_header_mongrel "$LINENO" "event2/event.h" "ac_cv_header_event2_event_h" "$ac_includes_default"
+if test "x$ac_cv_header_event2_event_h" = xyes; then :
+
+$as_echo "#define EVENT_V2 1" >>confdefs.h
+
+else
+
+ ac_fn_c_check_header_mongrel "$LINENO" "event.h" "ac_cv_header_event_h" "$ac_includes_default"
+if test "x$ac_cv_header_event_h" = xyes; then :
+
+$as_echo "#define EVENT_V1 1" >>confdefs.h
+
+else
+ as_fn_error $? "no libevent found" "$LINENO" 5
+fi
+
+
+
+fi
+
+
+ EXTRA_OBJECTS="${EXTRA_OBJECTS} objs/tgl-net.o objs/tgl-timers.o"
+ fi
+
+fi
+
+
+# Check whether --enable-valgrind was given.
+if test "${enable_valgrind+set}" = set; then :
+ enableval=$enable_valgrind;
+ if test "x$enableval" = "xyes" ; then
+ ac_fn_c_check_header_mongrel "$LINENO" "valgrind/memcheck.h" "ac_cv_header_valgrind_memcheck_h" "$ac_includes_default"
+if test "x$ac_cv_header_valgrind_memcheck_h" = xyes; then :
+
+$as_echo "#define VALGRIND_FIXES 1" >>confdefs.h
+
+fi
+
+
+ fi
+
+fi
+
+
+# Checks for header files.
+for ac_header in execinfo.h fcntl.h malloc.h netdb.h stdlib.h string.h unistd.h arpa/inet.h mach/mach.h netinet/in.h sys/file.h sys/socket.h termios.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+# Checks for typedefs, structures, and compiler characteristics.
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5
+$as_echo_n "checking for uid_t in sys/types.h... " >&6; }
+if ${ac_cv_type_uid_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "uid_t" >/dev/null 2>&1; then :
+ ac_cv_type_uid_t=yes
+else
+ ac_cv_type_uid_t=no
+fi
+rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5
+$as_echo "$ac_cv_type_uid_t" >&6; }
+if test $ac_cv_type_uid_t = no; then
+
+$as_echo "#define uid_t int" >>confdefs.h
+
+
+$as_echo "#define gid_t int" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
+$as_echo_n "checking for inline... " >&6; }
+if ${ac_cv_c_inline+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_inline=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$ac_cv_c_inline" != no && break
+done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
+$as_echo "$ac_cv_c_inline" >&6; }
+
+case $ac_cv_c_inline in
+ inline | yes) ;;
+ *)
+ case $ac_cv_c_inline in
+ no) ac_val=;;
+ *) ac_val=$ac_cv_c_inline;;
+ esac
+ cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+ ;;
+esac
+
+
+# Checks for library functions.
+for ac_header in stdlib.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdlib_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STDLIB_H 1
+_ACEOF
+
+fi
+
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
+$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
+if ${ac_cv_func_malloc_0_nonnull+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_func_malloc_0_nonnull=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+# include <stdlib.h>
+#else
+char *malloc ();
+#endif
+
+int
+main ()
+{
+return ! malloc (0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_malloc_0_nonnull=yes
+else
+ ac_cv_func_malloc_0_nonnull=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
+$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
+if test $ac_cv_func_malloc_0_nonnull = yes; then :
+
+$as_echo "#define HAVE_MALLOC 1" >>confdefs.h
+
+else
+ $as_echo "#define HAVE_MALLOC 0" >>confdefs.h
+
+ case " $LIBOBJS " in
+ *" malloc.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS malloc.$ac_objext"
+ ;;
+esac
+
+
+$as_echo "#define malloc rpl_malloc" >>confdefs.h
+
+fi
+
+
+for ac_header in stdlib.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdlib_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STDLIB_H 1
+_ACEOF
+
+fi
+
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5
+$as_echo_n "checking for GNU libc compatible realloc... " >&6; }
+if ${ac_cv_func_realloc_0_nonnull+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_func_realloc_0_nonnull=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+# include <stdlib.h>
+#else
+char *realloc ();
+#endif
+
+int
+main ()
+{
+return ! realloc (0, 0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_realloc_0_nonnull=yes
+else
+ ac_cv_func_realloc_0_nonnull=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5
+$as_echo "$ac_cv_func_realloc_0_nonnull" >&6; }
+if test $ac_cv_func_realloc_0_nonnull = yes; then :
+
+$as_echo "#define HAVE_REALLOC 1" >>confdefs.h
+
+else
+ $as_echo "#define HAVE_REALLOC 0" >>confdefs.h
+
+ case " $LIBOBJS " in
+ *" realloc.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS realloc.$ac_objext"
+ ;;
+esac
+
+
+$as_echo "#define realloc rpl_realloc" >>confdefs.h
+
+fi
+
+
+for ac_func in alarm endpwent memset memmove mkdir select socket strdup strndup uname
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_bswap32" >&5
+$as_echo_n "checking for __builtin_bswap32... " >&6; }
+if ${ax_cv_have___builtin_bswap32+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ __builtin_bswap32(0)
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ax_cv_have___builtin_bswap32=yes
+else
+ ax_cv_have___builtin_bswap32=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_have___builtin_bswap32" >&5
+$as_echo "$ax_cv_have___builtin_bswap32" >&6; }
+
+ if test yes = $ax_cv_have___builtin_bswap32; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE___BUILTIN_BSWAP32 1
+_ACEOF
+
+fi
+
+
+
+
+
+
+ac_config_files="$ac_config_files Makefile"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by telegram-cli $as_me 1.0, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Report bugs to the package provider."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+telegram-cli config.status 1.0
+configured by $0, generated by GNU Autoconf 2.69,
+ with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=?*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ --*=)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h)
+ # Conflict between --help and --header
+ as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+ --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+ *) as_fn_append ac_config_targets " $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp= ac_tmp=
+ trap 'exit_status=$?
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+ trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_tt"; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any. Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[ ]*#[ ]*define[ ][ ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ for (key in D) D_is_set[key] = 1
+ FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+ line = \$ 0
+ split(line, arg, " ")
+ if (arg[1] == "#") {
+ defundef = arg[2]
+ mac1 = arg[3]
+ } else {
+ defundef = substr(arg[1], 2)
+ mac1 = arg[2]
+ }
+ split(mac1, mac2, "(") #)
+ macro = mac2[1]
+ prefix = substr(line, 1, index(line, defundef) - 1)
+ if (D_is_set[macro]) {
+ # Preserve the white space surrounding the "#".
+ print prefix "define", macro P[macro] D[macro]
+ next
+ } else {
+ # Replace #undef with comments. This is necessary, for example,
+ # in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ if (defundef == "undef") {
+ print "/*", prefix defundef, macro, "*/"
+ next
+ }
+ }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS "
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$ac_tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&2;}
+
+ rm -f "$ac_tmp/stdin"
+ case $ac_file in
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
+ if test x"$ac_file" != x-; then
+ {
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+ } >"$ac_tmp/config.h" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f "$ac_file"
+ mv "$ac_tmp/config.h" "$ac_file" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ fi
+ else
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+ || as_fn_error $? "could not create -" "$LINENO" 5
+ fi
+ ;;
+
+
+ esac
+
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
+
diff --git a/protocols/Telegram/tgl/configure.ac b/protocols/Telegram/tgl/configure.ac
new file mode 100644
index 0000000000..ea935a58ac
--- /dev/null
+++ b/protocols/Telegram/tgl/configure.ac
@@ -0,0 +1,79 @@
+AC_PREREQ([2.68])
+AC_INIT([telegram-cli], [1.0])
+AC_CONFIG_SRCDIR([config.h.in])
+AC_CONFIG_HEADERS([config.h])
+
+m4_include([m4_ax_check_openssl.m4])
+m4_include([m4_ax_check_zlib.m4])
+m4_include([m4-ax_gcc_builtin.m4])
+
+# Checks for programs.
+AC_PROG_CC
+
+# BSD locations for headers and libraries from packages, Linux locations for self-compiled stuff.
+CPPFLAGS="$CPPFLAGS -I/usr/local/include"
+LDFLAGS="$LDFLAGS -L/usr/local/lib"
+
+# Checks for libraries.
+AC_CHECK_LIB([m], [sqrt])
+AC_SEARCH_LIBS([clock_gettime], [rt])
+
+EVENT_VER=""
+EXTRA_OBJECTS=""
+
+# OPENSSL_INCLUDES to the include directives required
+# OPENSSL_LIBS to the -l directives required
+# OPENSSL_LDFLAGS to the -L or -R flags required
+
+AX_CHECK_OPENSSL(,[AC_MSG_ERROR([No openssl found])])
+AX_CHECK_ZLIB(, [AC_MSG_ERROR([No zlib found])])
+
+AC_ARG_ENABLE(extf,[enables extended queries system],
+ [
+ if test "x$enableval" = "xno" ; then
+ AC_DEFINE([DISABLE_EXTF],[1],[disable extf queries])
+ fi
+ ],[
+ ])
+
+AC_ARG_ENABLE(libevent,[--enable-libevent include libevent-based net and timers],
+ [
+ if test "x$enableval" = "xyes" ; then
+ AC_CHECK_LIB([event], [event_base_new], [], [AC_MSG_ERROR([no libevent found])])
+ AC_CHECK_HEADER(event2/event.h, [AC_DEFINE([EVENT_V2], [1], [Use libevent v2])], [
+ AC_CHECK_HEADER(event.h, [AC_DEFINE([EVENT_V1], [1], [Use libevent v1])], [AC_MSG_ERROR([no libevent found])])
+ ])
+ EXTRA_OBJECTS="${EXTRA_OBJECTS} objs/tgl-net.o objs/tgl-timers.o"
+ fi
+ ],[
+ ])
+
+AC_ARG_ENABLE(valgrind,[fixes for correct valgrind work],
+ [
+ if test "x$enableval" = "xyes" ; then
+ AC_CHECK_HEADER(valgrind/memcheck.h, [AC_DEFINE([VALGRIND_FIXES], [1], [fixed for correct valgrind work])], [
+ ])
+ fi
+ ],[
+ ])
+
+# Checks for header files.
+AC_CHECK_HEADERS([execinfo.h fcntl.h malloc.h netdb.h stdlib.h string.h unistd.h arpa/inet.h mach/mach.h netinet/in.h sys/file.h sys/socket.h termios.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_TYPE_SIZE_T
+AC_TYPE_UID_T
+AC_C_INLINE
+
+# Checks for library functions.
+AC_FUNC_MALLOC
+AC_FUNC_REALLOC
+AC_CHECK_FUNCS([alarm endpwent memset memmove mkdir select socket strdup strndup uname])
+
+AX_GCC_BUILTIN(__builtin_bswap32)
+
+AC_SUBST(EXTRA_LIBS)
+AC_SUBST(EXTRA_OBJECTS)
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+
diff --git a/protocols/Telegram/tgl/contrib/vs/config.bat b/protocols/Telegram/tgl/contrib/vs/config.bat
new file mode 100644
index 0000000000..8f51e40cf2
--- /dev/null
+++ b/protocols/Telegram/tgl/contrib/vs/config.bat
@@ -0,0 +1,524 @@
+@echo off
+setlocal enabledelayedexpansion
+set PACKAGE_NAME="telegram-cli"
+set PACKAGE_TARNAME="telegram-cli"
+set PACKAGE_VERSION="1.0"
+set PACKAGE_STRING="!PACKAGE_TARNAME:~1,-1! %PACKAGE_VERSION:~1%"
+set PACKAGE_BUGREPORT=""
+set PACKAGE_URL=""
+
+set SRC_FOLDER=..\..
+set SOURCE_LIST=()
+set AUTO_FOLDER=%SRC_FOLDER%\auto
+set BIN_FOLDER=bin
+set LIB_FOLDER=lib
+set DEFAULT_OUT_FOLDER=build
+set OUT_PATH=
+
+set GEN_TOOL=generate.exe
+set PARSER_TOOL=%SRC_FOLDER%\tl-parser\contrib\vs\build\Release\tl-parser.exe
+
+set CONFIG_HEADER_IN=%SRC_FOLDER%\config.h.in
+set CONFIG_HEADER=%SRC_FOLDER%\config.h
+
+set /p SCHEME_TL=<%SRC_FOLDER%\scheme.tl
+set SCHEME_TL=%SRC_FOLDER%\%SCHEME_TL%
+
+set /p ENCRYPTED_SCHEME_TL=<%SRC_FOLDER%\encrypted_scheme.tl
+set ENCRYPTED_SCHEME_TL=%SRC_FOLDER%\%ENCRYPTED_SCHEME_TL%
+
+set BINLOG_TL=%SRC_FOLDER%\binlog.tl
+set MTPROTO_TL=%SRC_FOLDER%\mtproto.tl
+set APPEND_TL=%SRC_FOLDER%\append.tl
+set CONSTANTS_HEADER=constants.h
+
+
+::#################################################################################################################################################
+:parse_args
+if not "%1"=="" (
+ if "%1"=="-o" (
+ set OUT_PATH=%2
+ )
+ if "%1"=="--gen-config" (
+ set /A GEN_CONFIG=1
+ )
+ if "%1"=="--gen-scheme" (
+ set /A GEN_SCHEME=1
+ )
+ if "%1"=="-debug" (
+ set /A DEBUG=1
+ set PARSER_TOOL=%PARSER_TOOL:Release=Debug%
+ )
+ if "%1"=="--parser-path" (
+ set PARSER_TOOL=%2
+ )
+ if "%1"=="--help" (
+ echo TGL Config
+ echo Usage:
+ echo --gen-config generate config.h
+ echo --gen-scheme generate Telegram API scheme headers and source files
+ echo --parser-path path to tl-parser.exe
+ echo -debug debuge mode
+ exit /b 0
+ )
+
+ shift
+ goto :parse_args
+)
+
+if {%OUT_PATH%}=={} (
+ set OUT_PATH=%DEFAULT_OUT_FOLDER%
+)
+::Make output folder if not exists
+if not exist %OUT_PATH% mkdir %OUT_PATH%
+
+
+::Copy source files to the output folder
+for %%i in %SOURCE_LIST% do (
+ if not exist %OUT_PATH%\%%i (
+ echo |set /p=Copying file: %%i
+ copy %%i %OUT_PATH%\%%i 1>NUL && (
+ echo Done
+ ) || (
+ echo Failed
+ )
+ )
+)
+
+::Generate config.h
+if defined GEN_CONFIG (
+ if not exist %CONFIG_HEADER% call :gen_config %CONFIG_HEADER%
+)
+
+
+::Generate Telegram API scheme source files
+if defined GEN_SCHEME (
+ set /a ERR_ENC=0
+
+ ::Check if tl-parser.exe exists
+ if not exist %PARSER_TOOL% (
+ echo Error: Cannot find %PARSER_TOOL%
+ exit /b 1
+ )
+
+ ::Check if generate.exe exists
+ set "GEN_TOOL=%OUT_PATH%\%BIN_FOLDER%\%GEN_TOOL%"
+ if not exist !GEN_TOOL! (
+ echo Error: Cannot find !GEN_TOOL!
+ exit /b 1
+ )
+
+ ::Make auto folder
+ if not exist %AUTO_FOLDER% mkdir %AUTO_FOLDER%
+
+ ::Generate scheme.tl
+ echo |set /p=Generating scheme.tl
+ type %SCHEME_TL% %ENCRYPTED_SCHEME_TL% %ENCRYPTED_SCHEME% %BINLOG_TL% %MTPROTO_TL% %APPEND_TL% 2>NUL > %AUTO_FOLDER%\scheme.tl
+ echo Done
+
+ ::Generate scheme2.tl
+ echo |set /p=Generating scheme2.tl
+ %PARSER_TOOL% -E %AUTO_FOLDER%\scheme.tl 2> %AUTO_FOLDER%\scheme2.tl
+ if not !ERRORLEVEL!==0 (
+ echo Failed
+ exit /b 1
+ ) else (
+ echo Done
+ )
+
+ ::Generate scheme.tlo
+ echo |set /p=Generating scheme.tlo
+ "%PARSER_TOOL%" -e "%AUTO_FOLDER%\scheme.tlo" %AUTO_FOLDER%\scheme.tl
+ if not !ERRORLEVEL!==0 (
+ echo Failed
+ exit /b 1
+ ) else (
+ echo Done
+ )
+
+ ::Generate constants.h
+ echo |set /p=Generating constants.h
+ call :gen_constants %AUTO_FOLDER%\scheme2.tl > %AUTO_FOLDER%\constants.h
+ if not !ERRORLEVEL!==0 (
+ echo Failed
+ exit /b 1
+ ) else (
+ echo Done
+ )
+
+
+ ::Generate auto-*.h
+ echo |set /p=Generating auto-skip.h
+ !GEN_TOOL! -g skip-header %AUTO_FOLDER%\scheme.tlo > %AUTO_FOLDER%\auto-skip.h
+ if not !ERRORLEVEL!==0 (
+ set /a ERR_ENC=!ERRORLEVEL!
+ if exist %AUTO_FOLDER%\auto-skip.h del /q /f %AUTO_FOLDER%\auto-skip.h
+ echo Failed
+ ) else (
+ echo Done
+ )
+
+ echo |set /p=Generating auto-fetch.h
+ !GEN_TOOL! -g fetch-header %AUTO_FOLDER%\scheme.tlo > %AUTO_FOLDER%\auto-fetch.h
+ if not !ERRORLEVEL!==0 (
+ set /a ERR_ENC=!ERRORLEVEL!
+ if exist %AUTO_FOLDER%\auto-fetch.h del /q /f %AUTO_FOLDER%\auto-fetch.h
+ echo Failed
+ ) else (
+ echo Done
+ )
+
+ echo |set /p=Generating auto-store.h
+ !GEN_TOOL! -g store-header %AUTO_FOLDER%\scheme.tlo > %AUTO_FOLDER%\auto-store.h
+ if not !ERRORLEVEL!==0 (
+ set /a ERR_ENC=!ERRORLEVEL!
+ if exist %AUTO_FOLDER%\auto-store.h del /q /f %AUTO_FOLDER%\auto-store.h
+ echo Failed
+ ) else (
+ echo Done
+ )
+
+ echo |set /p=Generating auto-autocomplete.h
+ !GEN_TOOL! -g autocomplete-header %AUTO_FOLDER%\scheme.tlo > %AUTO_FOLDER%\auto-autocomplete.h
+ if not !ERRORLEVEL!==0 (
+ set /a ERR_ENC=!ERRORLEVEL!
+ if exist %AUTO_FOLDER%\auto-autocomplete.h del /q /f %AUTO_FOLDER%\auto-autocomplete.h
+ echo Failed
+ ) else (
+ echo Done
+ )
+
+ echo |set /p=Generating auto-types.h
+ !GEN_TOOL! -g types-header %AUTO_FOLDER%\scheme.tlo > %AUTO_FOLDER%\auto-types.h
+ if not !ERRORLEVEL!==0 (
+ set /a ERR_ENC=!ERRORLEVEL!
+ if exist %AUTO_FOLDER%\auto-types.h del /q /f %AUTO_FOLDER%\auto-types.h
+ echo Failed
+ ) else (
+ echo Done
+ )
+
+ echo |set /p=Generating auto-fetch-ds.h
+ !GEN_TOOL! -g fetch-ds-header %AUTO_FOLDER%\scheme.tlo > %AUTO_FOLDER%\auto-fetch-ds.h
+ if not !ERRORLEVEL!==0 (
+ set /a ERR_ENC=!ERRORLEVEL!
+ if exist %AUTO_FOLDER%\auto-fetch-ds.h del /q /f %AUTO_FOLDER%\auto-fetch-ds.h
+ echo Failed
+ ) else (
+ echo Done
+ )
+
+ echo |set /p=Generating auto-free-ds.h
+ !GEN_TOOL! -g free-ds-header %AUTO_FOLDER%\scheme.tlo > %AUTO_FOLDER%\auto-free-ds.h
+ if not !ERRORLEVEL!==0 (
+ set /a ERR_ENC=!ERRORLEVEL!
+ if exist %AUTO_FOLDER%\auto-free-ds.h del /q /f %AUTO_FOLDER%\auto-free-ds.h
+ echo Failed
+ ) else (
+ echo Done
+ )
+
+ echo |set /p=Generating auto-store-ds.h
+ !GEN_TOOL! -g store-ds-header %AUTO_FOLDER%\scheme.tlo > %AUTO_FOLDER%\auto-store-ds.h
+ if not !ERRORLEVEL!==0 (
+ set /a ERR_ENC=!ERRORLEVEL!
+ if exist %AUTO_FOLDER%\auto-store-ds.h del /q /f %AUTO_FOLDER%\auto-store-ds.h
+ echo Failed
+ ) else (
+ echo Done
+ )
+
+ echo |set /p=Generating auto-print-ds.h
+ !GEN_TOOL! -g print-ds-header %AUTO_FOLDER%\scheme.tlo > %AUTO_FOLDER%\auto-print-ds.h
+ if not !ERRORLEVEL!==0 (
+ set /a ERR_ENC=!ERRORLEVEL!
+ if exist %AUTO_FOLDER%\auto-print-ds.h del /q /f %AUTO_FOLDER%\auto-print-ds.h
+ echo Failed
+ ) else (
+ echo Done
+ )
+
+
+ ::Generate auto-*.c
+ echo |set /p=Generating auto-skip.c
+ !GEN_TOOL! -g skip %AUTO_FOLDER%\scheme.tlo > %AUTO_FOLDER%\auto-skip.c
+ if not !ERRORLEVEL!==0 (
+ set /a ERR_ENC=!ERRORLEVEL!
+ if exist %AUTO_FOLDER%\auto-skip.c del /q /f %AUTO_FOLDER%\auto-skip.c
+ echo Failed
+ ) else (
+ echo Done
+ )
+
+ echo |set /p=Generating auto-fetch.c
+ !GEN_TOOL! -g fetch %AUTO_FOLDER%\scheme.tlo > %AUTO_FOLDER%\auto-fetch.c
+ if not !ERRORLEVEL!==0 (
+ set /a ERR_ENC=!ERRORLEVEL!
+ if exist %AUTO_FOLDER%\auto-fetch.c del /q /f %AUTO_FOLDER%\auto-fetch.c
+ echo Failed
+ ) else (
+ echo Done
+ )
+
+ echo |set /p=Generating auto-store.c
+ !GEN_TOOL! -g store %AUTO_FOLDER%\scheme.tlo > %AUTO_FOLDER%\auto-store.c
+ if not !ERRORLEVEL!==0 (
+ set /a ERR_ENC=!ERRORLEVEL!
+ if exist %AUTO_FOLDER%\auto-store.c del /q /f %AUTO_FOLDER%\auto-store.c
+ echo Failed
+ ) else (
+ echo Done
+ )
+
+ echo |set /p=Generating auto-autocomplete.c
+ !GEN_TOOL! -g autocomplete %AUTO_FOLDER%\scheme.tlo > %AUTO_FOLDER%\auto-autocomplete.c
+ if not !ERRORLEVEL!==0 (
+ set /a ERR_ENC=!ERRORLEVEL!
+ if exist %AUTO_FOLDER%\auto-autocomplete.c del /q /f %AUTO_FOLDER%\auto-autocomplete.c
+ echo Failed
+ ) else (
+ echo Done
+ )
+
+ echo |set /p=Generating auto-types.c
+ !GEN_TOOL! -g types %AUTO_FOLDER%\scheme.tlo > %AUTO_FOLDER%\auto-types.c
+ if not !ERRORLEVEL!==0 (
+ set /a ERR_ENC=!ERRORLEVEL!
+ if exist %AUTO_FOLDER%\auto-types.c del /q /f %AUTO_FOLDER%\auto-types.c
+ echo Failed
+ ) else (
+ echo Done
+ )
+
+ echo |set /p=Generating auto-fetch-ds.c
+ !GEN_TOOL! -g fetch-ds %AUTO_FOLDER%\scheme.tlo > %AUTO_FOLDER%\auto-fetch-ds.c
+ if not !ERRORLEVEL!==0 (
+ set /a ERR_ENC=!ERRORLEVEL!
+ if exist %AUTO_FOLDER%\auto-fetch-ds.c del /q /f %AUTO_FOLDER%\auto-fetch-ds.c
+ echo Failed
+ ) else (
+ echo Done
+ )
+
+ echo |set /p=Generating auto-free-ds.c
+ !GEN_TOOL! -g free-ds %AUTO_FOLDER%\scheme.tlo > %AUTO_FOLDER%\auto-free-ds.c
+ if not !ERRORLEVEL!==0 (
+ set /a ERR_ENC=!ERRORLEVEL!
+ if exist %AUTO_FOLDER%\auto-free-ds.c del /q /f %AUTO_FOLDER%\auto-free-ds.c
+ echo Failed
+ ) else (
+ echo Done
+ )
+
+ echo |set /p=Generating auto-store-ds.c
+ !GEN_TOOL! -g store-ds %AUTO_FOLDER%\scheme.tlo > %AUTO_FOLDER%\auto-store-ds.c
+ if not !ERRORLEVEL!==0 (
+ set /a ERR_ENC=!ERRORLEVEL!
+ if exist %AUTO_FOLDER%\auto-store-ds.c del /q /f %AUTO_FOLDER%\auto-store-ds.c
+ echo Failed
+ ) else (
+ echo Done
+ )
+
+ echo |set /p=Generating auto-print-ds.c
+ !GEN_TOOL! -g print-ds %AUTO_FOLDER%\scheme.tlo > %AUTO_FOLDER%\auto-print-ds.c
+ if not !ERRORLEVEL!==0 (
+ set /a ERR_ENC=!ERRORLEVEL!
+ if exist %AUTO_FOLDER%\auto-print-ds.c del /q /f %AUTO_FOLDER%\auto-print-ds.c
+ echo Failed
+ ) else (
+ echo Done
+ )
+ set /a ERRORLEVEL=!ERR_ENC!
+)
+
+::Script End
+exit /b !ERRORLEVEL!
+
+::#################################################################################################################################################
+:: Script Functions
+::#################################################################################################################################################
+
+:find_and_replace <file> <findString> <replaceString>
+ set file_path=%1
+ set find_str=%2
+ set "find_str=!find_str:~1,-1!"
+ set replace_str=%3 %4
+ set "replace_str=!replace_str:~1,-2!"
+
+ for /f "delims=" %%i in ('type "%file_path%" ^| find /n /v "" ^& break ^> "%file_path%" ') do (
+ set "line=%%i"
+ setlocal enableDelayedExpansion
+ set "line=!line:*]%find_str%=%replace_str%!"
+ set "line=!line:*]=!"
+ >>%file_path% echo(!line!
+ endlocal
+ )
+ exit /B %ERRORLEVEL%
+
+:gen_config <output folder>
+ :rem Copy config.h.in to the output folder
+ echo |set /p=Copying file: %CONFIG_HEADER_in%
+ copy %CONFIG_HEADER_IN% %1 1>NUL && (
+ echo Done
+ ) || (
+ echo Failed
+ exit /B %ERRORLEVEL%
+ )
+
+ echo |set /p=Configurating file: config.h
+ call :find_and_replace %1 "#undef PACKAGE_BUGREPORT" "#define PACKAGE_BUGREPORT %PACKAGE_BUGREPORT%"
+ call :find_and_replace %1 "#undef PACKAGE_NAME" "#define PACKAGE_NAME %PACKAGE_NAME%"
+ call :find_and_replace %1 "#undef PACKAGE_STRING" "#define PACKAGE_STRING %PACKAGE_STRING%"
+ call :find_and_replace %1 "#undef PACKAGE_TARNAME" "#define PACKAGE_TARNAME %PACKAGE_TARNAME%"
+ call :find_and_replace %1 "#undef PACKAGE_URL" "#define PACKAGE_URL %PACKAGE_URL%"
+ call :find_and_replace %1 "#undef PACKAGE_VERSION" "#define PACKAGE_VERSION %PACKAGE_VERSION%"
+
+ call :find_and_replace %1 "#undef EVENT_V2" "#define EVENT_V2 1"
+ call :find_and_replace %1 "#undef HAVE_FCNTL_H" "#define HAVE_FCNTL_H 1"
+ call :find_and_replace %1 "#undef HAVE_INTTYPES_H" "#define HAVE_INTTYPES_H 1"
+ call :find_and_replace %1 "#undef HAVE_LIBM" "#define HAVE_LIBM 1"
+ call :find_and_replace %1 "#undef HAVE_LIBZ" "#define HAVE_LIBZ 1"
+ call :find_and_replace %1 "#undef HAVE_MALLOC_H" "#define HAVE_MALLOC_H 1"
+ call :find_and_replace %1 "#undef HAVE_MALLOC" "#define HAVE_MALLOC 1"
+ call :find_and_replace %1 "#undef HAVE_MEMMOVE" "#define HAVE_MEMMOVE 1"
+ call :find_and_replace %1 "#undef HAVE_MEMORY_H" "#define HAVE_MEMORY_H 1"
+ call :find_and_replace %1 "#undef HAVE_MEMSET" "#define HAVE_MEMSET 1"
+ call :find_and_replace %1 "#undef HAVE_MKDIR" "#define HAVE_MKDIR 1"
+ call :find_and_replace %1 "#undef HAVE_REALLOC" "#define HAVE_REALLOC 1"
+ call :find_and_replace %1 "#undef HAVE_SELECT" "#define HAVE_SELECT 1"
+ call :find_and_replace %1 "#undef HAVE_SOCKET" "#define HAVE_SOCKET 1"
+ call :find_and_replace %1 "#undef HAVE_STDINT_H" "#define HAVE_STDINT_H 1"
+ call :find_and_replace %1 "#undef HAVE_STDLIB_H" "#define HAVE_STDLIB_H 1"
+ call :find_and_replace %1 "#undef HAVE_STRDUP" "#define HAVE_STRDUP 1"
+ call :find_and_replace %1 "#undef HAVE_STRING_H" "#define HAVE_STRING_H 1"
+ call :find_and_replace %1 "#undef HAVE_STRNDUP" "#define HAVE_STRNDUP 1"
+ call :find_and_replace %1 "#undef HAVE_SYS_STAT_H" "#define HAVE_SYS_STAT_H 1"
+ call :find_and_replace %1 "#undef HAVE_SYS_TYPES_H" "#define HAVE_SYS_TYPES_H 1"
+ call :find_and_replace %1 "#undef STDC_HEADERS" "#define STDC_HEADERS 1"
+ call :find_and_replace %1 "#undef gid_t" "#define gid_t int"
+ call :find_and_replace %1 "#undef uid_t" "#define uid_t int"
+ call :find_and_replace %1 "#undef inline" "#define inline __inline"
+ call :find_and_replace %1 "#undef" "// #undef"
+ if %ERRORLEVEL% == 0 echo Done
+ if not %ERRORLEVEL% == 0 (
+ echo Failed
+ if exist %1\%CONFIG_HEADER% del /q /f %1\%CONFIG_HEADER%
+ exit /b 1
+ )
+ exit /B 0
+
+:gen_constants <input file>
+ echo /*
+ echo This file is part of telegram-client.
+ echo.
+ echo Telegram-client is free software: you can redistribute it and/or modify
+ echo it under the terms of the GNU General Public License as published by
+ echo the Free Software Foundation, either version 2 of the License, or
+ echo (at your option) any later version.
+ echo.
+ echo Telegram-client is distributed in the hope that it will be useful,
+ echo but WITHOUT ANY WARRANTY; without even the implied warranty of
+ echo MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ echo GNU General Public License for more details.
+ echo.
+ echo You should have received a copy of the GNU General Public License
+ echo along with this telegram-client. If not, see ^<http://www.gnu.org/licenses/^>.
+ echo.
+ echo Copyright Vitaly Valtman 2013
+ echo */
+ echo #ifndef CONSTANTS_H
+ echo #define CONSTANTS_H
+
+ setlocal EnableDelayedExpansion
+ for /F "tokens=1" %%A in (%1) do (
+ call :split %%A # a
+ if %ERRORLEVEL% == 0 (
+
+ call :sub a[0]
+ if not "!h[%a[1]%]!"=="" (
+ echo ERROR: Duplicate magic %a[1]% for define %a[0]% and !h[%a[1]%]! 1>&2
+ exit /b 1
+ )
+
+ set h[!a[1]!]=!a[0]!
+ echo #define CODE_!a[0]! 0x!a[1]!
+ )
+ )
+ endlocal
+ echo #endif
+ exit /b0
+
+
+:split <string> <delim> <resultVar>
+ for /F "tokens=1,2 delims=%2" %%a in ("%1") do (
+ if "%%a"=="" exit /b 1
+ set %3[0]=%%a
+ if "%%b"=="" exit /b 1
+ set %3[1]=%%b
+ )
+ exit /b0
+
+
+:sub <string>
+ set /A len= 0
+ call :strlen %%1 len
+ (
+ setlocal EnableDelayedExpansion
+ set "substr="
+ for /l %%a IN (0,1,!len!) DO (
+ set Char=!%1:~%%a,1!
+ if "!Char!" EQU "A" SET Char=_a
+ if "!Char!" EQU "B" SET Char=_b
+ if "!Char!" EQU "C" SET Char=_c
+ if "!Char!" EQU "D" SET Char=_d
+ if "!Char!" EQU "E" SET Char=_e
+ if "!Char!" EQU "F" SET Char=_f
+ if "!Char!" EQU "G" SET Char=_g
+ if "!Char!" EQU "H" SET Char=_h
+ if "!Char!" EQU "I" SET Char=_i
+ if "!Char!" EQU "J" SET Char=_j
+ if "!Char!" EQU "K" SET Char=_k
+ if "!Char!" EQU "L" SET Char=_l
+ if "!Char!" EQU "M" SET Char=_m
+ if "!Char!" EQU "N" SET Char=_n
+ if "!Char!" EQU "O" SET Char=_o
+ if "!Char!" EQU "P" SET Char=_p
+ if "!Char!" EQU "Q" SET Char=_q
+ if "!Char!" EQU "R" SET Char=_r
+ if "!Char!" EQU "S" SET Char=_s
+ if "!Char!" EQU "T" SET Char=_t
+ if "!Char!" EQU "U" SET Char=_u
+ if "!Char!" EQU "V" SET Char=_v
+ if "!Char!" EQU "W" SET Char=_w
+ if "!Char!" EQU "X" SET Char=_x
+ if "!Char!" EQU "Y" SET Char=_y
+ if "!Char!" EQU "Z" SET Char=_z
+ if "!Char!" EQU "." SET Char=_
+
+ set substr=!substr!!Char!
+ )
+ )
+ (
+ endlocal
+ set "%~1=%substr%"
+ exit /b
+ )
+
+:strlen <stringVar> <resultVar>
+ (
+ setlocal EnableDelayedExpansion
+ set "s=!%~1!#"
+ set "len=0"
+ for %%P in (4096 2048 1024 512 256 128 64 32 16 8 4 2 1) do (
+ if "!s:~%%P,1!" NEQ "" (
+ set /a "len+=%%P"
+ set "s=!s:~%%P!"
+ )
+ )
+ )
+ (
+ endlocal
+ set "%~2=%len%"
+ exit /b
+ )
diff --git a/protocols/Telegram/tgl/contrib/vs/generate.vcxproj b/protocols/Telegram/tgl/contrib/vs/generate.vcxproj
new file mode 100644
index 0000000000..a70fb4bf27
--- /dev/null
+++ b/protocols/Telegram/tgl/contrib/vs/generate.vcxproj
@@ -0,0 +1,188 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{03A484BF-4CF0-4290-9BD2-D649F0797703}</ProjectGuid>
+ <RootNamespace>generate</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140_xp</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>build\$(Configuration)\</OutDir>
+ <IntDir>build\$(Configuration)\obj\generate\</IntDir>
+ <ExtensionsToDeleteOnClean>*.h;$(ExtensionsToDeleteOnClean)</ExtensionsToDeleteOnClean>
+ <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(ProjectDir);</IncludePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>build\$(Configuration)\</OutDir>
+ <IntDir>build\$(Configuration)\obj\generate\</IntDir>
+ <IncludePath>$(VC_IncludePath);$(WindowsSdk_71A_IncludePath);$(ProjectDir);</IncludePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ExtensionsToDeleteOnClean>*.h;$(ExtensionsToDeleteOnClean)</ExtensionsToDeleteOnClean>
+ <OutDir>build\$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>build\$(Platform)\$(Configuration)\obj\generate\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ExtensionsToDeleteOnClean>*.h;$(ExtensionsToDeleteOnClean)</ExtensionsToDeleteOnClean>
+ <OutDir>build\$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>build\$(Platform)\$(Configuration)\obj\generate\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <PreprocessorDefinitions>WIN32;HAVE_CONFIG_H;_CONSOLE;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <CompileAs>CompileAsC</CompileAs>
+ <DisableLanguageExtensions>false</DisableLanguageExtensions>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <OutputFile>$(OutDir)\bin\$(TargetName)$(TargetExt)</OutputFile>
+ <ProgramDatabaseFile>$(OutDir)\bin\$(TargetName).pdb</ProgramDatabaseFile>
+ <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalDependencies>zlibstat.lib;libeay32.lib;ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <SubSystem>Console</SubSystem>
+ <ProfileGuidedDatabase>$(OutDir)\bin\$(TargetName).pgd</ProfileGuidedDatabase>
+ </Link>
+ <PreBuildEvent>
+ <Command>config.bat --gen-config -o $(OutDir)</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <CompileAs>CompileAsC</CompileAs>
+ <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <OutputFile>$(OutDir)\bin\$(TargetName)$(TargetExt)</OutputFile>
+ </Link>
+ <PreBuildEvent>
+ <Command>config.bat --gen-config -o $(OutDir)</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Full</Optimization>
+ <PreprocessorDefinitions>WIN32;HAVE_CONFIG_H
+;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\openssl\include;..\..\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <CompileAs>CompileAsC</CompileAs>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <OutputFile>$(OutDir)\bin\$(TargetName)$(TargetExt)</OutputFile>
+ <ProgramDatabaseFile>$(OutDir)\bin\$(TargetName).pdb</ProgramDatabaseFile>
+ <AdditionalLibraryDirectories>..\..\openssl\lib;..\..\zlib\contrib\vstudio\vc11\x86\ZlibStatReleaseWithoutAsm\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalDependencies>zlibstat.lib;libeay32.lib;ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <SubSystem>Console</SubSystem>
+ <ProfileGuidedDatabase>$(OutDir)\bin\$(TargetName).pgd</ProfileGuidedDatabase>
+ </Link>
+ <PreBuildEvent>
+ <Command>config.bat --gen-config -o $(OutDir)</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <CompileAs>CompileAsC</CompileAs>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <OutputFile>$(OutDir)\bin\$(TargetName)$(TargetExt)</OutputFile>
+ </Link>
+ <PreBuildEvent>
+ <Command>config.bat --gen-config -o $(OutDir)</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\generate.h" />
+ <ClInclude Include="..\..\tools.h" />
+ <ClInclude Include="wingetopt.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\generate.c" />
+ <ClCompile Include="..\..\tools.c" />
+ <ClCompile Include="wingetopt.c" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/protocols/Telegram/tgl/contrib/vs/generate.vcxproj.filters b/protocols/Telegram/tgl/contrib/vs/generate.vcxproj.filters
new file mode 100644
index 0000000000..ed1998c59d
--- /dev/null
+++ b/protocols/Telegram/tgl/contrib/vs/generate.vcxproj.filters
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="wingetopt.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\generate.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\tools.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="wingetopt.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\generate.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\tools.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/protocols/Telegram/tgl/contrib/vs/tgl.sln b/protocols/Telegram/tgl/contrib/vs/tgl.sln
new file mode 100644
index 0000000000..063abfb0b6
--- /dev/null
+++ b/protocols/Telegram/tgl/contrib/vs/tgl.sln
@@ -0,0 +1,52 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tgl", "tgl.vcxproj", "{C3106192-32AD-442F-A3A2-E3CFB63F0CF1}"
+ ProjectSection(ProjectDependencies) = postProject
+ {14022761-9F27-4A2D-B7EA-F41FB9B3274C} = {14022761-9F27-4A2D-B7EA-F41FB9B3274C}
+ {03A484BF-4CF0-4290-9BD2-D649F0797703} = {03A484BF-4CF0-4290-9BD2-D649F0797703}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tl-parser", "..\..\tl-parser\contrib\vs\tl-parser.vcxproj", "{14022761-9F27-4A2D-B7EA-F41FB9B3274C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "generate", "generate.vcxproj", "{03A484BF-4CF0-4290-9BD2-D649F0797703}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {C3106192-32AD-442F-A3A2-E3CFB63F0CF1}.Debug|x64.ActiveCfg = Debug|x64
+ {C3106192-32AD-442F-A3A2-E3CFB63F0CF1}.Debug|x64.Build.0 = Debug|x64
+ {C3106192-32AD-442F-A3A2-E3CFB63F0CF1}.Debug|x86.ActiveCfg = Debug|Win32
+ {C3106192-32AD-442F-A3A2-E3CFB63F0CF1}.Debug|x86.Build.0 = Debug|Win32
+ {C3106192-32AD-442F-A3A2-E3CFB63F0CF1}.Release|x64.ActiveCfg = Release|x64
+ {C3106192-32AD-442F-A3A2-E3CFB63F0CF1}.Release|x64.Build.0 = Release|x64
+ {C3106192-32AD-442F-A3A2-E3CFB63F0CF1}.Release|x86.ActiveCfg = Release|Win32
+ {C3106192-32AD-442F-A3A2-E3CFB63F0CF1}.Release|x86.Build.0 = Release|Win32
+ {14022761-9F27-4A2D-B7EA-F41FB9B3274C}.Debug|x64.ActiveCfg = Debug|x64
+ {14022761-9F27-4A2D-B7EA-F41FB9B3274C}.Debug|x64.Build.0 = Debug|x64
+ {14022761-9F27-4A2D-B7EA-F41FB9B3274C}.Debug|x86.ActiveCfg = Debug|Win32
+ {14022761-9F27-4A2D-B7EA-F41FB9B3274C}.Debug|x86.Build.0 = Debug|Win32
+ {14022761-9F27-4A2D-B7EA-F41FB9B3274C}.Release|x64.ActiveCfg = Release|x64
+ {14022761-9F27-4A2D-B7EA-F41FB9B3274C}.Release|x64.Build.0 = Release|x64
+ {14022761-9F27-4A2D-B7EA-F41FB9B3274C}.Release|x86.ActiveCfg = Release|Win32
+ {14022761-9F27-4A2D-B7EA-F41FB9B3274C}.Release|x86.Build.0 = Release|Win32
+ {03A484BF-4CF0-4290-9BD2-D649F0797703}.Debug|x64.ActiveCfg = Debug|x64
+ {03A484BF-4CF0-4290-9BD2-D649F0797703}.Debug|x64.Build.0 = Debug|x64
+ {03A484BF-4CF0-4290-9BD2-D649F0797703}.Debug|x86.ActiveCfg = Debug|Win32
+ {03A484BF-4CF0-4290-9BD2-D649F0797703}.Debug|x86.Build.0 = Debug|Win32
+ {03A484BF-4CF0-4290-9BD2-D649F0797703}.Release|x64.ActiveCfg = Release|x64
+ {03A484BF-4CF0-4290-9BD2-D649F0797703}.Release|x64.Build.0 = Release|x64
+ {03A484BF-4CF0-4290-9BD2-D649F0797703}.Release|x86.ActiveCfg = Release|Win32
+ {03A484BF-4CF0-4290-9BD2-D649F0797703}.Release|x86.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/protocols/Telegram/tgl/contrib/vs/tgl.vcxproj b/protocols/Telegram/tgl/contrib/vs/tgl.vcxproj
new file mode 100644
index 0000000000..0dd16c17fd
--- /dev/null
+++ b/protocols/Telegram/tgl/contrib/vs/tgl.vcxproj
@@ -0,0 +1,251 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\auto.h" />
+ <ClInclude Include="..\..\event-old.h" />
+ <ClInclude Include="..\..\mtproto-client.h" />
+ <ClInclude Include="..\..\mtproto-common.h" />
+ <ClInclude Include="..\..\mtproto-utils.h" />
+ <ClInclude Include="..\..\no-preview.h" />
+ <ClInclude Include="..\..\queries.h" />
+ <ClInclude Include="..\..\tg-mime-types.h" />
+ <ClInclude Include="..\..\tgl-binlog.h" />
+ <ClInclude Include="..\..\tgl-fetch.h" />
+ <ClInclude Include="..\..\tgl-inner.h" />
+ <ClInclude Include="..\..\tgl-layout.h" />
+ <ClInclude Include="..\..\tgl-methods-in.h" />
+ <ClInclude Include="..\..\tgl-net-inner.h" />
+ <ClInclude Include="..\..\tgl-net.h" />
+ <ClInclude Include="..\..\tgl-structures.h" />
+ <ClInclude Include="..\..\tgl-timers.h" />
+ <ClInclude Include="..\..\tgl.h" />
+ <ClInclude Include="..\..\tools.h" />
+ <ClInclude Include="..\..\tree.h" />
+ <ClInclude Include="..\..\updates.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\auto\auto-autocomplete.c" />
+ <ClCompile Include="..\..\auto\auto-fetch-ds.c" />
+ <ClCompile Include="..\..\auto\auto-fetch.c" />
+ <ClCompile Include="..\..\auto\auto-free-ds.c" />
+ <ClCompile Include="..\..\auto\auto-print-ds.c" />
+ <ClCompile Include="..\..\auto\auto-skip.c" />
+ <ClCompile Include="..\..\auto\auto-store-ds.c" />
+ <ClCompile Include="..\..\auto\auto-store.c" />
+ <ClCompile Include="..\..\auto\auto-types.c" />
+ <ClCompile Include="..\..\binlog.c" />
+ <ClCompile Include="..\..\mime-types.c" />
+ <ClCompile Include="..\..\mtproto-client.c" />
+ <ClCompile Include="..\..\mtproto-common.c" />
+ <ClCompile Include="..\..\mtproto-utils.c" />
+ <ClCompile Include="..\..\queries.c" />
+ <ClCompile Include="..\..\structures.c" />
+ <ClCompile Include="..\..\tg-mime-types.c" />
+ <ClCompile Include="..\..\tgl-net.c" />
+ <ClCompile Include="..\..\tgl-timers.c" />
+ <ClCompile Include="..\..\tgl.c" />
+ <ClCompile Include="..\..\tools.c" />
+ <ClCompile Include="..\..\updates.c" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{C3106192-32AD-442F-A3A2-E3CFB63F0CF1}</ProjectGuid>
+ <RootNamespace>tgl</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140_xp</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>build\$(Configuration)\</OutDir>
+ <IntDir>build\$(Configuration)\obj\tgl\</IntDir>
+ <ExtensionsToDeleteOnClean>*.h;$(ExtensionsToDeleteOnClean)</ExtensionsToDeleteOnClean>
+ <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(IntDir);</IncludePath>
+ <PreBuildEventUseInBuild>true</PreBuildEventUseInBuild>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>build\$(Configuration)\</OutDir>
+ <IntDir>build\$(Configuration)\obj\tgl\</IntDir>
+ <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(IntDir);</IncludePath>
+ <PreBuildEventUseInBuild>true</PreBuildEventUseInBuild>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>build\$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>build\$(Platform)\$(Configuration)\obj\tgl\</IntDir>
+ <ExtensionsToDeleteOnClean>*.h;$(ExtensionsToDeleteOnClean)</ExtensionsToDeleteOnClean>
+ <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(IntDir);</IncludePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>build\$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>build\$(Platform)\$(Configuration)\obj\tgl\</IntDir>
+ <ExtensionsToDeleteOnClean>*.h;$(ExtensionsToDeleteOnClean)</ExtensionsToDeleteOnClean>
+ <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(IntDir);</IncludePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <PreprocessorDefinitions>WIN32;_LIB;HAVE_CONFIG_H;ZLIB_WINAPI;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <CompileAs>CompileAsC</CompileAs>
+ <DisableLanguageExtensions>false</DisableLanguageExtensions>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <ProgramDataBaseFileName>$(OutDir)\lib\$(ProjectName).pdb</ProgramDataBaseFileName>
+ <DisableSpecificWarnings>
+ </DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ <PreBuildEvent>
+ <Command>config.bat -debug --gen-config --gen-scheme -o $(OutDir)</Command>
+ </PreBuildEvent>
+ <Lib>
+ <OutputFile>$(OutDir)\lib\$(TargetName)$(TargetExt)</OutputFile>
+ <AdditionalDependencies>Ws2_32.lib;event.lib;libeay32.lib;ssleay32.lib;zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ </Lib>
+ <ProjectReference>
+ <LinkLibraryDependencies>true</LinkLibraryDependencies>
+ </ProjectReference>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <CompileAs>CompileAsC</CompileAs>
+ <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ <Lib>
+ <OutputFile>$(OutDir)\lib\$(TargetName)$(TargetExt)</OutputFile>
+ </Lib>
+ <PreBuildEvent>
+ <Command>config.bat --gen-config --gen-scheme -o $(OutDir)</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;_LIB;HAVE_CONFIG_H;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\openssl\include;..\..\zlib;..\..\libevent\include\;..\..\libevent\WIN32-Code\nmake\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <CompileAs>CompileAsC</CompileAs>
+ <DisableSpecificWarnings>
+ </DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ <PreBuildEvent>
+ <Command>config.bat --gen-config --gen-scheme -o $(OutDir)</Command>
+ </PreBuildEvent>
+ <Lib>
+ <OutputFile>$(OutDir)\lib\$(TargetName)$(TargetExt)</OutputFile>
+ <AdditionalDependencies>Ws2_32.lib;libevent.lib;libeay32.lib;ssleay32.lib;zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>..\..\openssl\lib;..\..\zlib\contrib\vstudio\vc11\x86\ZlibStatReleaseWithoutAsm\;..\..\zlib\contrib\vstudio\vc11\x86\ZlibDllReleaseWithoutAsm\;..\..\libevent\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ </Lib>
+ <ProjectReference />
+ <ProjectReference>
+ <LinkLibraryDependencies>true</LinkLibraryDependencies>
+ </ProjectReference>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <PreprocessorDefinitions>_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ <Lib>
+ <OutputFile>$(OutDir)\lib\$(TargetName)$(TargetExt)</OutputFile>
+ </Lib>
+ <PreBuildEvent>
+ <Command>config.bat --gen-config --gen-scheme -o $(OutDir)</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+ <Target Name="AfterClean">
+ <Delete Files="..\..\config.h" ContinueOnError="true" />
+ <RemoveDir Directories="..\..\auto\" />
+ </Target>
+</Project> \ No newline at end of file
diff --git a/protocols/Telegram/tgl/contrib/vs/tgl.vcxproj.filters b/protocols/Telegram/tgl/contrib/vs/tgl.vcxproj.filters
new file mode 100644
index 0000000000..0e031a039e
--- /dev/null
+++ b/protocols/Telegram/tgl/contrib/vs/tgl.vcxproj.filters
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ <Filter Include="Source Files\auto">
+ <UniqueIdentifier>{22d3d7ed-cbc2-49e1-b516-b0049e61afa7}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\auto.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\event-old.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\mtproto-client.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\mtproto-common.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\mtproto-utils.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\no-preview.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\queries.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\tgl.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\tgl-binlog.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\tgl-fetch.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\tgl-inner.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\tgl-layout.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\tgl-methods-in.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\tgl-net.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\tgl-net-inner.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\tgl-structures.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\tgl-timers.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\tg-mime-types.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\tools.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\tree.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\updates.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\binlog.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\mime-types.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\mtproto-client.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\mtproto-common.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\mtproto-utils.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\queries.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\structures.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\tgl.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\tgl-net.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\tgl-timers.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\tg-mime-types.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\tools.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\updates.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\auto\auto-autocomplete.c">
+ <Filter>Source Files\auto</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\auto\auto-fetch.c">
+ <Filter>Source Files\auto</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\auto\auto-fetch-ds.c">
+ <Filter>Source Files\auto</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\auto\auto-free-ds.c">
+ <Filter>Source Files\auto</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\auto\auto-print-ds.c">
+ <Filter>Source Files\auto</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\auto\auto-skip.c">
+ <Filter>Source Files\auto</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\auto\auto-store.c">
+ <Filter>Source Files\auto</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\auto\auto-store-ds.c">
+ <Filter>Source Files\auto</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\auto\auto-types.c">
+ <Filter>Source Files\auto</Filter>
+ </ClCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/protocols/Telegram/tgl/contrib/vs/tgl.vcxproj.user b/protocols/Telegram/tgl/contrib/vs/tgl.vcxproj.user
new file mode 100644
index 0000000000..6fb136bf0a
--- /dev/null
+++ b/protocols/Telegram/tgl/contrib/vs/tgl.vcxproj.user
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup />
+</Project> \ No newline at end of file
diff --git a/protocols/Telegram/tgl/contrib/vs/wingetopt.c b/protocols/Telegram/tgl/contrib/vs/wingetopt.c
new file mode 100644
index 0000000000..09dac17a4f
--- /dev/null
+++ b/protocols/Telegram/tgl/contrib/vs/wingetopt.c
@@ -0,0 +1,82 @@
+/*
+POSIX getopt for Windows
+
+AT&T Public License
+
+Code given out at the 1985 UNIFORUM conference in Dallas.
+*/
+
+#ifndef __GNUC__
+
+#include "wingetopt.h"
+#include <stdio.h>
+#include <string.h>
+
+#ifndef NULL
+#define NULL 0
+#endif
+#define EOF (-1)
+#define ERR(s, c) if(opterr){\
+ char errbuf[2];\
+ errbuf[0] = c; errbuf[1] = '\n';\
+ fputs(argv[0], stderr);\
+ fputs(s, stderr);\
+ fputc(c, stderr);}
+//(void) write(2, argv[0], (unsigned)strlen(argv[0]));\
+ //(void) write(2, s, (unsigned)strlen(s));\
+ //(void) write(2, errbuf, 2);}
+
+int opterr = 1;
+int optind = 1;
+int optopt;
+char *optarg;
+
+int
+getopt(argc, argv, opts)
+int argc;
+char **argv, *opts;
+{
+ static int sp = 1;
+ register int c;
+ register char *cp;
+
+ if (sp == 1)
+ if (optind >= argc ||
+ argv[optind][0] != '-' || argv[optind][1] == '\0')
+ return(EOF);
+ else if (strcmp(argv[optind], "--") == (int)NULL) {
+ optind++;
+ return(EOF);
+ }
+ optopt = c = argv[optind][sp];
+ if (c == ':' || (cp = strchr(opts, c)) == NULL) {
+ ERR(": illegal option -- ", c);
+ if (argv[optind][++sp] == '\0') {
+ optind++;
+ sp = 1;
+ }
+ return('?');
+ }
+ if (*++cp == ':') {
+ if (argv[optind][sp + 1] != '\0')
+ optarg = &argv[optind++][sp + 1];
+ else if (++optind >= argc) {
+ ERR(": option requires an argument -- ", c);
+ sp = 1;
+ return('?');
+ }
+ else
+ optarg = argv[optind++];
+ sp = 1;
+ }
+ else {
+ if (argv[optind][++sp] == '\0') {
+ sp = 1;
+ optind++;
+ }
+ optarg = NULL;
+ }
+ return(c);
+}
+
+#endif /* __GNUC__ */ \ No newline at end of file
diff --git a/protocols/Telegram/tgl/contrib/vs/wingetopt.h b/protocols/Telegram/tgl/contrib/vs/wingetopt.h
new file mode 100644
index 0000000000..4372c66011
--- /dev/null
+++ b/protocols/Telegram/tgl/contrib/vs/wingetopt.h
@@ -0,0 +1,32 @@
+/*
+POSIX getopt for Windows
+
+AT&T Public License
+
+Code given out at the 1985 UNIFORUM conference in Dallas.
+*/
+
+#ifdef __GNUC__
+#include <getopt.h>
+#endif
+#ifndef __GNUC__
+
+#ifndef _WINGETOPT_H_
+#define _WINGETOPT_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ extern int opterr;
+ extern int optind;
+ extern int optopt;
+ extern char *optarg;
+ extern int getopt(int argc, char **argv, char *opts);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _GETOPT_H_ */
+#endif /* __GNUC__ */ \ No newline at end of file
diff --git a/protocols/Telegram/tgl/encrypted_scheme.tl b/protocols/Telegram/tgl/encrypted_scheme.tl
new file mode 100644
index 0000000000..6fff5b6a55
--- /dev/null
+++ b/protocols/Telegram/tgl/encrypted_scheme.tl
@@ -0,0 +1 @@
+encrypted_scheme23.tl \ No newline at end of file
diff --git a/protocols/Telegram/tgl/encrypted_scheme16.tl b/protocols/Telegram/tgl/encrypted_scheme16.tl
new file mode 100644
index 0000000000..eb58ed4475
--- /dev/null
+++ b/protocols/Telegram/tgl/encrypted_scheme16.tl
@@ -0,0 +1,22 @@
+---types---
+decryptedMessageLayer#99a438cf layer:int message:DecryptedMessage = DecryptedMessageLayer;
+decryptedMessage#1f814f1f random_id:long random_bytes:bytes message:string media:DecryptedMessageMedia = DecryptedMessage;
+decryptedMessageService#aa48327d random_id:long random_bytes:bytes action:DecryptedMessageAction = DecryptedMessage;
+decryptedMessageMediaEmpty#89f5c4a = DecryptedMessageMedia;
+decryptedMessageMediaPhoto#32798a8c thumb:bytes thumb_w:int thumb_h:int w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+//decryptedMessageMediaVideo#4cee6ef3 thumb:bytes thumb_w:int thumb_h:int duration:int w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageMediaGeoPoint#35480a59 lat:double long:double = DecryptedMessageMedia;
+decryptedMessageMediaContact#588a0a97 phone_number:string first_name:string last_name:string user_id:int = DecryptedMessageMedia;
+decryptedMessageActionSetMessageTTL#a1733aec ttl_seconds:int = DecryptedMessageAction;
+
+decryptedMessageMediaDocument#b095434b thumb:bytes thumb_w:int thumb_h:int file_name:string mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia;
+//decryptedMessageMediaAudio#6080758f duration:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+
+decryptedMessageMediaVideo#524a415d thumb:bytes thumb_w:int thumb_h:int duration:int mime_type:string w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageMediaAudio#57e0a9cb duration:int mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageActionReadMessages#c4f40be random_ids:Vector<long> = DecryptedMessageAction;
+decryptedMessageActionDeleteMessages#65614304 random_ids:Vector<long> = DecryptedMessageAction;
+decryptedMessageActionScreenshotMessages#8ac1f475 random_ids:Vector<long> = DecryptedMessageAction;
+decryptedMessageActionFlushHistory#6719e45c = DecryptedMessageAction;
+decryptedMessageActionNotifyLayer#f3048883 layer:int = DecryptedMessageAction;
+---functions---
diff --git a/protocols/Telegram/tgl/encrypted_scheme17.tl b/protocols/Telegram/tgl/encrypted_scheme17.tl
new file mode 100644
index 0000000000..95e661bda5
--- /dev/null
+++ b/protocols/Telegram/tgl/encrypted_scheme17.tl
@@ -0,0 +1,31 @@
+---types---
+decryptedMessageLayer#1be31789 layer:int message:DecryptedMessage = DecryptedMessageLayer;
+decryptedMessage_l16#1f814f1f random_id:long random_bytes:bytes message:string media:DecryptedMessageMedia = DecryptedMessage;
+decryptedMessageService_l16#aa48327d random_id:long random_bytes:bytes action:DecryptedMessageAction = DecryptedMessage;
+
+decryptedMessage#204d3878 in_seq_no:int out_seq_no:int ttl:int random_id:long random_bytes:bytes message:string media:DecryptedMessageMedia = DecryptedMessage;
+decryptedMessageService#73164160 in_seq_no:int out_seq_no:int random_id:long random_bytes:bytes action:DecryptedMessageAction = DecryptedMessage;
+
+decryptedMessageMediaEmpty#89f5c4a = DecryptedMessageMedia;
+decryptedMessageMediaPhoto#32798a8c thumb:bytes thumb_w:int thumb_h:int w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+//decryptedMessageMediaVideo#4cee6ef3 thumb:bytes thumb_w:int thumb_h:int duration:int w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageMediaGeoPoint#35480a59 lat:double long:double = DecryptedMessageMedia;
+decryptedMessageMediaContact#588a0a97 phone_number:string first_name:string last_name:string user_id:int = DecryptedMessageMedia;
+decryptedMessageActionSetMessageTTL#a1733aec ttl_seconds:int = DecryptedMessageAction;
+
+decryptedMessageMediaDocument#b095434b thumb:bytes thumb_w:int thumb_h:int file_name:string mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia;
+//decryptedMessageMediaAudio#6080758f duration:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+
+decryptedMessageMediaVideo#524a415d thumb:bytes thumb_w:int thumb_h:int duration:int mime_type:string w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageMediaAudio#57e0a9cb duration:int mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageActionReadMessages#c4f40be random_ids:Vector<long> = DecryptedMessageAction;
+decryptedMessageActionDeleteMessages#65614304 random_ids:Vector<long> = DecryptedMessageAction;
+decryptedMessageActionScreenshotMessages#8ac1f475 random_ids:Vector<long> = DecryptedMessageAction;
+decryptedMessageActionFlushHistory#6719e45c = DecryptedMessageAction;
+decryptedMessageActionNotifyLayer#f3048883 layer:int = DecryptedMessageAction;
+
+decryptedMessageActionResend#511110b0 start_seq_no:int end_seq_no:int = DecryptedMessageAction;
+
+decryptedMessageActionTyping#ccb27641 action:SendMessageAction = DecryptedMessageAction;
+
+---functions---
diff --git a/protocols/Telegram/tgl/encrypted_scheme18.tl b/protocols/Telegram/tgl/encrypted_scheme18.tl
new file mode 100644
index 0000000000..134f719973
--- /dev/null
+++ b/protocols/Telegram/tgl/encrypted_scheme18.tl
@@ -0,0 +1,38 @@
+---types---
+decryptedMessageLayer#1be31789 layer:int message:DecryptedMessage = DecryptedMessageLayer;
+decryptedMessage_l16#1f814f1f random_id:long random_bytes:bytes message:string media:DecryptedMessageMedia = DecryptedMessage;
+decryptedMessageService_l16#aa48327d random_id:long random_bytes:bytes action:DecryptedMessageAction = DecryptedMessage;
+
+decryptedMessage#204d3878 in_seq_no:int out_seq_no:int ttl:int random_id:long random_bytes:bytes message:string media:DecryptedMessageMedia = DecryptedMessage;
+decryptedMessageService#73164160 in_seq_no:int out_seq_no:int random_id:long random_bytes:bytes action:DecryptedMessageAction = DecryptedMessage;
+
+decryptedMessageMediaEmpty#89f5c4a = DecryptedMessageMedia;
+decryptedMessageMediaPhoto#32798a8c thumb:bytes thumb_w:int thumb_h:int w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+//decryptedMessageMediaVideo#4cee6ef3 thumb:bytes thumb_w:int thumb_h:int duration:int w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageMediaGeoPoint#35480a59 latitude:double longitude:double = DecryptedMessageMedia;
+decryptedMessageMediaContact#588a0a97 phone_number:string first_name:string last_name:string user_id:int = DecryptedMessageMedia;
+decryptedMessageActionSetMessageTTL#a1733aec ttl_seconds:int = DecryptedMessageAction;
+
+decryptedMessageMediaDocument#b095434b thumb:bytes thumb_w:int thumb_h:int file_name:string mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia;
+//decryptedMessageMediaAudio#6080758f duration:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+
+decryptedMessageMediaVideo#524a415d thumb:bytes thumb_w:int thumb_h:int duration:int mime_type:string w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageMediaAudio#57e0a9cb duration:int mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageActionReadMessages#c4f40be random_ids:Vector<long> = DecryptedMessageAction;
+decryptedMessageActionDeleteMessages#65614304 random_ids:Vector<long> = DecryptedMessageAction;
+decryptedMessageActionScreenshotMessages#8ac1f475 random_ids:Vector<long> = DecryptedMessageAction;
+decryptedMessageActionFlushHistory#6719e45c = DecryptedMessageAction;
+decryptedMessageActionNotifyLayer#f3048883 layer:int = DecryptedMessageAction;
+
+decryptedMessageActionResend#511110b0 start_seq_no:int end_seq_no:int = DecryptedMessageAction;
+
+decryptedMessageActionTyping#ccb27641 action:SendMessageAction = DecryptedMessageAction;
+
+decryptedMessageActionRequestKey exchange_id:long g_a:string = DecryptedMessageAction;
+decryptedMessageActionAcceptKey exchange_id:long g_b:string key_fingerprint:long = DecryptedMessageAction;
+decryptedMessageActionCommitKey exchange_id:long key_fingerprint:long = DecryptedMessageAction;
+decryptedMessageActionAbortKey exchange_id:long = DecryptedMessageAction;
+decryptedMessageActionNoop = DecryptedMessageAction;
+
+
+---functions---
diff --git a/protocols/Telegram/tgl/encrypted_scheme23.tl b/protocols/Telegram/tgl/encrypted_scheme23.tl
new file mode 100644
index 0000000000..ae31312de1
--- /dev/null
+++ b/protocols/Telegram/tgl/encrypted_scheme23.tl
@@ -0,0 +1,29 @@
+---types---
+decryptedMessageMediaEmpty#89f5c4a = DecryptedMessageMedia;
+decryptedMessageMediaPhoto#32798a8c str_thumb:bytes thumb_w:int thumb_h:int w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageMediaGeoPoint#35480a59 latitude:double longitude:double = DecryptedMessageMedia;
+decryptedMessageMediaContact#588a0a97 phone_number:string first_name:string last_name:string user_id:int = DecryptedMessageMedia;
+decryptedMessageActionSetMessageTTL#a1733aec ttl_seconds:int = DecryptedMessageAction;
+decryptedMessageMediaDocument#b095434b str_thumb:bytes thumb_w:int thumb_h:int file_name:string mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageActionReadMessages#c4f40be random_ids:Vector<long> = DecryptedMessageAction;
+decryptedMessageActionDeleteMessages#65614304 random_ids:Vector<long> = DecryptedMessageAction;
+decryptedMessageActionScreenshotMessages#8ac1f475 random_ids:Vector<long> = DecryptedMessageAction;
+decryptedMessageActionFlushHistory#6719e45c = DecryptedMessageAction;
+
+decryptedMessage#204d3878 random_id:long ttl:int message:string media:DecryptedMessageMedia = DecryptedMessage;
+decryptedMessageService#73164160 random_id:long action:DecryptedMessageAction = DecryptedMessage;
+decryptedMessageMediaVideo#524a415d str_thumb:bytes thumb_w:int thumb_h:int duration:int mime_type:string w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageMediaAudio#57e0a9cb duration:int mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageLayer#1be31789 random_bytes:bytes layer:int in_seq_no:int out_seq_no:int message:DecryptedMessage = DecryptedMessageLayer;
+decryptedMessageActionResend#511110b0 start_seq_no:int end_seq_no:int = DecryptedMessageAction;
+decryptedMessageActionNotifyLayer#f3048883 layer:int = DecryptedMessageAction;
+decryptedMessageActionTyping#ccb27641 action:SendMessageAction = DecryptedMessageAction;
+
+decryptedMessageActionRequestKey#f3c9611b exchange_id:long g_a:bytes = DecryptedMessageAction;
+decryptedMessageActionAcceptKey#6fe1735b exchange_id:long g_b:bytes key_fingerprint:long = DecryptedMessageAction;
+decryptedMessageActionAbortKey#dd05ec6b exchange_id:long = DecryptedMessageAction;
+decryptedMessageActionCommitKey#ec2e0b9b exchange_id:long key_fingerprint:long = DecryptedMessageAction;
+decryptedMessageActionNoop#a82fdd63 = DecryptedMessageAction;
+
+decryptedMessageMediaExternalDocument#fa95b0dd id:long access_hash:long date:int mime_type:string size:int thumb:PhotoSize dc_id:int attributes:Vector<DocumentAttribute> = DecryptedMessageMedia;
+---functions---
diff --git a/protocols/Telegram/tgl/errors b/protocols/Telegram/tgl/errors
new file mode 100644
index 0000000000..481a144737
--- /dev/null
+++ b/protocols/Telegram/tgl/errors
@@ -0,0 +1,11 @@
+type of errors that tgl can set:
+
+EPROTO: server returned error for query. Some kinds of error (such as FLOOD_WAIT) tgl can handle by itself, but others it can not. In most cases it means bug in tgl or invalid parameter supplied to method (such as message id).
+
+EINVAL: tgl detected invalid argument supplied before sending query to server. For example user instead of chat or bad msg id.
+
+ENOENT: tgl received empty response from server. For example when user tried to get message by id
+
+EBADF: tgl can not open file on disk or file is empty
+
+E2BIG: supplied file is too big
diff --git a/protocols/Telegram/tgl/event-old.h b/protocols/Telegram/tgl/event-old.h
new file mode 100644
index 0000000000..b920e68f02
--- /dev/null
+++ b/protocols/Telegram/tgl/event-old.h
@@ -0,0 +1,48 @@
+#ifndef __EVENT_OLD_H__
+#define __EVENT_OLD_H__
+
+#include <assert.h>
+#include <stdlib.h>
+
+#define BEV_EVENT_READ EVBUFFER_READ
+#define BEV_EVENT_WRITE EVBUFFER_WRITE
+#define BEV_EVENT_EOF EVBUFFER_EOF
+#define BEV_EVENT_ERROR EVBUFFER_ERROR
+#define BEV_EVENT_TIMEOUT EVBUFFER_TIMEOUT
+
+typedef int evutil_socket_t;
+
+static inline struct event *event_new (struct event_base *base, int fd, int what, void(*callback)(int, short, void *), void *arg) __attribute__ ((unused));
+static inline struct event *event_new (struct event_base *base, int fd, int what, void(*callback)(int, short, void *), void *arg) {
+ struct event *ev = malloc (sizeof (*ev));
+ event_set (ev, fd, what, callback, arg);
+ event_base_set (base, ev);
+ return ev;
+}
+
+static inline struct event *evtimer_new (struct event_base *base, void(*callback)(int, short, void *), void *arg) __attribute__ ((unused));
+static inline struct event *evtimer_new (struct event_base *base, void(*callback)(int, short, void *), void *arg) {
+ struct event *ev = malloc (sizeof (*ev));
+ event_set (ev, -1, 0, callback, arg);
+ event_base_set (base, ev);
+ return ev;
+}
+
+static void event_free (struct event *ev) __attribute__ ((unused));
+static void event_free (struct event *ev) {
+ event_del (ev);
+ free (ev);
+}
+
+static struct bufferevent *bufferevent_socket_new (struct event_base *base, int fd, int flags) __attribute__ ((unused));
+static struct bufferevent *bufferevent_socket_new (struct event_base *base, int fd, int flags) {
+ assert (!flags);
+ struct bufferevent *bev = bufferevent_new(fd, 0, 0, 0, 0);
+ bufferevent_base_set (base, bev);
+ return bev;
+}
+
+static inline void *event_get_callback_arg(const struct event *ev) {
+ return ev->ev_arg;
+}
+#endif
diff --git a/protocols/Telegram/tgl/gen_constants_h.awk b/protocols/Telegram/tgl/gen_constants_h.awk
new file mode 100644
index 0000000000..74d20a70e2
--- /dev/null
+++ b/protocols/Telegram/tgl/gen_constants_h.awk
@@ -0,0 +1,37 @@
+BEGIN {
+ print "/*";
+ print " This file is part of telegram-client.";
+ print "";
+ print " Telegram-client is free software: you can redistribute it and/or modify";
+ print " it under the terms of the GNU General Public License as published by";
+ print " the Free Software Foundation, either version 2 of the License, or";
+ print " (at your option) any later version.";
+ print "";
+ print " Telegram-client is distributed in the hope that it will be useful,";
+ print " but WITHOUT ANY WARRANTY; without even the implied warranty of";
+ print " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the";
+ print " GNU General Public License for more details.";
+ print "";
+ print " You should have received a copy of the GNU General Public License";
+ print " along with this telegram-client. If not, see <http://www.gnu.org/licenses/>.";
+ print "";
+ print " Copyright Vitaly Valtman 2013";
+ print "*/";
+ print "#ifndef CONSTANTS_H";
+ print "#define CONSTANTS_H";
+}
+// {
+ if (split ($1, a, "#") == 2) {
+ gsub (/[ABCDEFGHIJKLMNOPQRSTUVWXYZ]/, "_&", a[1]);
+ gsub (/[.]/, "_", a[1]);
+ if (a[2] in h) {
+ print "ERROR: Duplicate magic " a[2] " for define " a[1] " and " h[a[2]] > "/dev/stderr"
+ exit 1;
+ }
+ h[a[2]] = a[1];
+ print "#define", "CODE_" tolower(a[1]), "0x" a[2];
+ }
+}
+END {
+ print "#endif";
+}
diff --git a/protocols/Telegram/tgl/generate.c b/protocols/Telegram/tgl/generate.c
new file mode 100644
index 0000000000..5a521d583e
--- /dev/null
+++ b/protocols/Telegram/tgl/generate.c
@@ -0,0 +1,3218 @@
+/*
+ This file is part of tgl-libary/generate
+
+ Tgl-library/generate is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+
+ Tgl-library/generate is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this tgl-library/generate. If not, see <http://www.gnu.org/licenses/>.
+
+ Copyright Vitaly Valtman 2014-2015
+
+ It is derivative work of VK/KittenPHP-DB-Engine (https://github.com/vk-com/kphp-kdb/)
+ Copyright 2012-2013 Vkontakte Ltd
+ 2012-2013 Vitaliy Valtman
+*/
+
+#define _GNU_SOURCE
+
+#include "config.h"
+#include <stdio.h>
+#include <signal.h>
+#ifdef HAVE_EXECINFO_H
+#include <execinfo.h>
+#endif
+#if defined(WIN32) || defined(_WIN32)
+#include <io.h>
+#include <stdint.h>
+#include <string.h>
+#ifndef __MINGW32__
+#include "wingetopt.h"
+#endif
+#else
+#include <unistd.h>
+#endif
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <assert.h>
+#include <string.h>
+
+#include "tl-parser/tl-tl.h"
+#include "generate.h"
+
+#include "tree.h"
+
+int header;
+
+#if defined(WIN32) || defined(_WIN32)
+char* strndup(const char* str, size_t n) {
+ size_t len = n;
+ const char *end = memchr(str, '\0', n);
+ if (end)
+ len = end - str;
+
+ char* dupstr = malloc(len + 1);
+ if (dupstr != NULL) {
+ memcpy(dupstr, str, len);
+ dupstr[len] = '\0';
+ }
+ return dupstr;
+}
+
+#define lrand48() rand()
+#define _PRINTF_INT64_ "I64"
+#else
+#define _PRINTF_INT64_ "ll"
+#endif
+
+#define tl_type_name_cmp(a,b) (a->name > b->name ? 1 : a->name < b->name ? -1 : 0)
+
+DEFINE_TREE (tl_type, struct tl_type *, tl_type_name_cmp, 0)
+DEFINE_TREE (tl_combinator, struct tl_combinator *, tl_type_name_cmp, 0)
+
+struct tree_tl_type *type_tree;
+struct tree_tl_combinator *function_tree;
+
+void tl_function_insert_by_name (struct tl_combinator *c) {
+ function_tree = tree_insert_tl_combinator (function_tree, c, lrand48 ());
+}
+
+struct tl_type *tl_type_get_by_name (int name) {
+ static struct tl_type t;
+ t.name = name;
+
+ return tree_lookup_tl_type (type_tree, &t);
+}
+
+void tl_type_insert_by_name (struct tl_type *t) {
+ type_tree = tree_insert_tl_type (type_tree, t, lrand48 ());
+}
+
+int is_empty (struct tl_type *t) {
+ if (t->name == NAME_INT || t->name == NAME_LONG || t->name == NAME_DOUBLE || t->name == NAME_STRING) { return 1; }
+ if (t->constructors_num != 1) { return 0; }
+ int count = 0;
+ int i;
+ struct tl_combinator *c = t->constructors[0];
+ for (i = 0; i < c->args_num; i++) {
+ if (!(c->args[i]->flags & FLAG_OPT_VAR)) { count ++; }
+ }
+ return count == 1;
+}
+
+
+static char buf[1 << 20];
+int buf_size;
+int *buf_ptr = (int *)buf;
+int *buf_end;
+#ifndef DISABLE_EXTF
+int skip_only = 0;
+#else
+int skip_only = 1;
+#endif
+
+int verbosity;
+
+int get_int (void) {
+ assert (buf_ptr < buf_end);
+ return *(buf_ptr ++);
+}
+
+long long get_long (void) {
+ assert (buf_ptr + 1 < buf_end);
+ long long r = *(long long *)buf_ptr;
+ buf_ptr += 2;
+ return r;
+}
+
+static void *malloc0 (int size) {
+ void *r = malloc (size);
+ assert (r);
+ memset (r, 0, size);
+ return r;
+}
+
+char *get_string (void) {
+ int l = *(unsigned char *)buf_ptr;
+ assert (l != 0xff);
+
+ char *res;
+ int tlen = 0;
+ if (l == 0xfe) {
+ l = ((unsigned)get_int ()) >> 8;
+ res = (char *)buf_ptr;
+ tlen = l;
+ } else {
+ res = ((char *)buf_ptr) + 1;
+ tlen = 1 + l;
+ }
+
+ int len = l;
+
+ tlen += ((-tlen) & 3);
+ assert (!(tlen & 3));
+
+ buf_ptr += tlen / 4;
+ assert (buf_ptr <= buf_end);
+
+ char *r = strndup (res, len);
+ assert (r);
+ return r;
+}
+
+
+int tn, fn, cn;
+struct tl_type **tps;
+struct tl_combinator **fns;
+
+struct tl_tree *read_tree (int *var_num);
+struct tl_tree *read_nat_expr (int *var_num);
+struct tl_tree *read_type_expr (int *var_num);
+int read_args_list (struct arg **args, int args_num, int *var_num);
+
+#define use_var_nat_full_form(x) 0
+
+void *int_to_var_nat_const_init (long long x) {
+ if (use_var_nat_full_form (x)) {
+ struct tl_tree_nat_const *T = malloc (sizeof (*T));
+ assert (T);
+ T->self.flags = 0;
+ T->self.methods = &tl_pnat_const_full_methods;
+ T->value = x;
+ return T;
+ } else {
+ return (void *)(long)(x * 2 - 0x80000001l);
+ }
+}
+
+long long var_nat_const_to_int (void *x) {
+ if (((long)x) & 1) {
+ return (((long)x) + 0x80000001l) / 2;
+ } else {
+ return ((struct tl_tree_nat_const *)x)->value;
+ }
+}
+
+int tl_tree_type_type (struct tl_tree *x) {
+ return NODE_TYPE_TYPE;
+}
+
+int tl_tree_type_array (struct tl_tree *x) {
+ return NODE_TYPE_ARRAY;
+}
+
+int tl_tree_type_nat_const (struct tl_tree *x) {
+ return NODE_TYPE_NAT_CONST;
+}
+
+int tl_tree_type_var_num (struct tl_tree *x) {
+ return NODE_TYPE_VAR_NUM;
+}
+
+int tl_tree_type_var_type (struct tl_tree *x) {
+ return NODE_TYPE_VAR_TYPE;
+}
+
+struct tl_tree_methods tl_var_num_methods = {
+ .type = tl_tree_type_var_num
+};
+
+struct tl_tree_methods tl_var_type_methods = {
+ .type = tl_tree_type_var_type
+};
+
+struct tl_tree_methods tl_type_methods = {
+ .type = tl_tree_type_type
+};
+
+struct tl_tree_methods tl_nat_const_methods = {
+ .type = tl_tree_type_nat_const
+};
+
+struct tl_tree_methods tl_array_methods = {
+ .type = tl_tree_type_array
+};
+
+struct tl_tree_methods tl_ptype_methods = {
+ .type = tl_tree_type_type
+};
+
+struct tl_tree_methods tl_parray_methods = {
+ .type = tl_tree_type_array
+};
+
+struct tl_tree_methods tl_pvar_num_methods = {
+ .type = tl_tree_type_var_num
+};
+
+struct tl_tree_methods tl_pvar_type_methods = {
+ .type = tl_tree_type_var_type
+};
+
+struct tl_tree_methods tl_nat_const_full_methods = {
+ .type = tl_tree_type_nat_const
+};
+
+struct tl_tree_methods tl_pnat_const_full_methods = {
+ .type = tl_tree_type_nat_const
+};
+
+struct tl_tree *read_num_const (int *var_num) {
+ return (void *)int_to_var_nat_const_init (get_int ());
+}
+
+
+void print_c_type_name (struct tl_tree *t, char *offset, int in) {
+ int x = TL_TREE_METHODS(t)->type (t);
+
+ if (x == NODE_TYPE_VAR_TYPE) {
+ printf ("void *");
+ return;
+ }
+
+ if (x == NODE_TYPE_ARRAY) {
+ struct tl_tree_array *a = (void *)t;
+ assert (a->args_num == 1);
+ print_c_type_name (a->args[0]->type, offset, in);
+ printf ("*");
+ return;
+ }
+
+ struct tl_type *T = ((struct tl_tree_type *)t)->type;
+ if (!strcmp (T->id, "Vector") && in) {
+ printf ("struct {\n");
+ printf ("%s int *cnt;\n", offset);
+ printf ("%s ", offset);
+ print_c_type_name (((struct tl_tree_type *)t)->children[0], offset, in);
+ printf ("*data;\n");
+ printf ("%s} *", offset);
+ return;
+ }
+ if (!strcmp (T->id, "Long")) {
+ printf ("long long *");
+ return;
+ }
+ if (!strcmp (T->id, "#") || !strcmp (T->id, "Int")) {
+ printf ("int *");
+ return;
+ }
+ if (!strcmp (T->id, "Double")) {
+ printf ("double *");
+ return;
+ }
+ if (!strcmp (T->id, "String") || !strcmp (T->id, "Bytes")) {
+ /*printf ("struct {\n");
+ printf ("%s int len;\n", offset);
+ printf ("%s char *data;\n", offset);
+ printf ("%s} *", offset);
+ return;*/
+
+ printf ("struct tl_ds_string *");
+ return;
+ }
+ printf ("struct tl_ds_%s *", T->print_id);
+}
+
+int gen_uni_skip (struct tl_tree *t, char *cur_name, int *vars, int first, int fun) {
+ assert (t);
+ int x = TL_TREE_METHODS (t)->type (t);
+ int l = 0;
+ int i;
+ int j;
+ struct tl_tree_type *t1;
+ struct tl_tree_array *t2;
+ int y;
+ int L = strlen (cur_name);
+ char *fail = fun == 1 ? "return 0;" : fun == -1 ? "return;" : "return -1;";
+ switch (x) {
+ case NODE_TYPE_TYPE:
+ t1 = (void *)t;
+ if (!first) {
+ printf (" if (ODDP(%s) || %s->type->name != 0x%08x) { %s }\n", cur_name, cur_name, t1->type->name, fail);
+ } else {
+ printf (" if (ODDP(%s) || (%s->type->name != 0x%08x && %s->type->name != 0x%08x)) { %s }\n", cur_name, cur_name, t1->type->name, cur_name, ~t1->type->name, fail);
+ }
+ for (i = 0; i < t1->children_num; i++) {
+#if defined(_MSC_VER)
+#pragma warning(disable : 4996)
+#endif
+ sprintf (cur_name + L, "->params[%d]", i);
+#if defined(_MSC_VER)
+#pragma warning(default : 4996)
+#endif
+ gen_uni_skip (t1->children[i], cur_name, vars, 0, fun);
+ cur_name[L] = 0;
+ }
+ return 0;
+ case NODE_TYPE_NAT_CONST:
+ printf (" if (EVENP(%s) || ((long)%s) != %"_PRINTF_INT64_"d) { %s }\n", cur_name, cur_name, var_nat_const_to_int (t) * 2 + 1, fail);
+ return 0;
+ case NODE_TYPE_ARRAY:
+ printf (" if (ODDP(%s) || %s->type->name != TL_TYPE_ARRAY) { %s }\n", cur_name, cur_name, fail);
+ t2 = (void *)t;
+
+#if defined(_MSC_VER)
+#pragma warning(disable : 4996)
+#endif
+ sprintf (cur_name + L, "->params[0]");
+#if defined(_MSC_VER)
+#pragma warning(default : 4996)
+#endif
+ y = gen_uni_skip (t2->multiplicity, cur_name, vars, 0, fun);
+ cur_name[L] = 0;
+
+#if defined(_MSC_VER)
+#pragma warning(disable : 4996)
+#endif
+ sprintf (cur_name + L, "->params[1]");
+#if defined(_MSC_VER)
+#pragma warning(default : 4996)
+#endif
+ y += gen_uni_skip (t2->args[0]->type, cur_name, vars, 0, fun);
+ cur_name[L] = 0;
+ return 0;
+ case NODE_TYPE_VAR_TYPE:
+ printf (" if (ODDP(%s)) { %s }\n", cur_name, fail);
+ i = ((struct tl_tree_var_type *)t)->var_num;
+ if (!vars[i]) {
+ printf (" struct paramed_type *var%d = %s; assert (var%d);\n", i, cur_name, i);
+ vars[i] = 1;
+ } else if (vars[i] == 1) {
+ printf (" if (compare_types (var%d, %s) < 0) { %s }\n", i, cur_name, fail);
+ } else {
+ assert (0);
+ return -1;
+ }
+ return l;
+ case NODE_TYPE_VAR_NUM:
+ printf (" if (EVENP(%s)) { %s }\n", cur_name, fail);
+ i = ((struct tl_tree_var_num *)t)->var_num;
+ j = ((struct tl_tree_var_num *)t)->dif;
+ if (!vars[i]) {
+ printf (" struct paramed_type *var%d = ((void *)%s) + %d; assert (var%d);\n", i, cur_name, 2 * j, i);
+ vars[i] = 2;
+ } else if (vars[i] == 2) {
+ printf (" if (var%d != ((void *)%s) + %d) { %s }\n", i, cur_name, 2 * j, fail);
+ } else {
+ assert (0);
+ return -1;
+ }
+ return 0;
+ default:
+ assert (0);
+ return -1;
+ }
+}
+
+void print_offset (int len) {
+ int i;
+ for (i = 0; i < len; i++) { printf (" "); }
+}
+
+int gen_create (struct tl_tree *t, int *vars, int offset) {
+ int x = TL_TREE_METHODS (t)->type (t);
+ int i;
+ struct tl_tree_type *t1;
+ struct tl_tree_array *t2;
+ switch (x) {
+ case NODE_TYPE_TYPE:
+ print_offset (offset);
+ printf ("&(struct paramed_type){\n");
+ print_offset (offset + 2);
+ t1 = (void *)t;
+ if (t1->self.flags & FLAG_BARE) {
+ printf (".type = &(struct tl_type_descr) {.name = 0x%08x, .id = \"Bare_%s\", .params_num = %d, .params_types = %"_PRINTF_INT64_"d},\n", ~t1->type->name, t1->type->id, t1->type->arity, t1->type->params_types);
+ } else {
+ printf (".type = &(struct tl_type_descr) {.name = 0x%08x, .id = \"%s\", .params_num = %d, .params_types = %"_PRINTF_INT64_"d},\n", t1->type->name, t1->type->id, t1->type->arity, t1->type->params_types);
+ }
+ if (t1->children_num) {
+ print_offset (offset + 2);
+ printf (".params = (struct paramed_type *[]){\n");
+ for (i = 0; i < t1->children_num; i++) {
+ assert (gen_create (t1->children[i], vars, offset + 4) >= 0);
+ printf (",\n");
+ }
+ print_offset (offset + 2);
+ printf ("}\n");
+ } else {
+ print_offset (offset + 2);
+ printf (".params = 0,\n");
+ }
+ print_offset (offset);
+ printf ("}");
+ return 0;
+ case NODE_TYPE_NAT_CONST:
+ print_offset (offset);
+ printf ("INT2PTR (%d)", (int)var_nat_const_to_int (t));
+ return 0;
+ case NODE_TYPE_ARRAY:
+ print_offset (offset);
+ printf ("&(struct paramed_type){\n");
+ print_offset (offset + 2);
+ t2 = (void *)t;
+ printf (".type = &(struct tl_type_descr) {.name = NAME_ARRAY, .id = \"array\", .params_num = 2, .params_types = 1},\n");
+ print_offset (offset + 2);
+ printf (".params = (struct paramed_type **){\n");
+ gen_create (t2->multiplicity, vars, offset + 4);
+ printf (",\n");
+ gen_create (t2->args[0]->type, vars, offset + 4);
+ printf (",\n");
+ print_offset (offset + 2);
+ printf ("}\n");
+ print_offset (offset);
+ printf ("}");
+ return 0;
+ case NODE_TYPE_VAR_TYPE:
+ print_offset (offset);
+ printf ("var%d", ((struct tl_tree_var_type *)t)->var_num);
+ return 0;
+ case NODE_TYPE_VAR_NUM:
+ print_offset (offset);
+ printf ("((void *)var%d) + %d", ((struct tl_tree_var_type *)t)->var_num, 2 * ((struct tl_tree_var_num *)t)->dif);
+ return 0;
+ default:
+ assert (0);
+ return -1;
+ }
+}
+
+int gen_field_skip (struct arg *arg, int *vars, int num) {
+ assert (arg);
+ char *offset = " ";
+ int o = 0;
+ if (arg->exist_var_num >= 0) {
+ printf (" if (PTR2INT (var%d) & (1 << %d)) {\n", arg->exist_var_num, arg->exist_var_bit);
+ offset = " ";
+ o = 2;
+ }
+ if (arg->var_num >= 0) {
+ assert (TL_TREE_METHODS (arg->type)->type (arg->type) == NODE_TYPE_TYPE);
+ int t = ((struct tl_tree_type *)arg->type)->type->name;
+ if (t == NAME_VAR_TYPE) {
+ fprintf (stderr, "Not supported yet\n");
+ assert (0);
+ } else {
+ assert (t == NAME_VAR_NUM);
+ if (vars[arg->var_num] == 0) {
+ printf ("%sif (in_remaining () < 4) { return -1;}\n", offset);
+ printf ("%sstruct paramed_type *var%d = INT2PTR (fetch_int ());\n", offset, arg->var_num);
+ vars[arg->var_num] = 2;
+ } else if (vars[arg->var_num] == 2) {
+ printf ("%sif (in_remaining () < 4) { return -1;}\n", offset);
+ printf ("%sif (vars%d != INT2PTR (fetch_int ())) { return -1; }\n", offset, arg->var_num);
+ } else {
+ assert (0);
+ return -1;
+ }
+ }
+ } else {
+ int t = TL_TREE_METHODS (arg->type)->type (arg->type);
+ if (t == NODE_TYPE_TYPE || t == NODE_TYPE_VAR_TYPE) {
+ printf ("%sstruct paramed_type *field%d = \n", offset, num);
+ assert (gen_create (arg->type, vars, 2 + o) >= 0);
+ printf (";\n");
+ int bare = arg->flags & FLAG_BARE;
+ if (!bare && t == NODE_TYPE_TYPE) {
+ bare = ((struct tl_tree_type *)arg->type)->self.flags & FLAG_BARE;
+ }
+ if (!bare) {
+ printf ("%sif (skip_type_%s (field%d) < 0) { return -1;}\n", offset, t == NODE_TYPE_VAR_TYPE ? "any" : ((struct tl_tree_type *)arg->type)->type->print_id, num);
+ } else {
+ printf ("%sif (skip_type_bare_%s (field%d) < 0) { return -1;}\n", offset, t == NODE_TYPE_VAR_TYPE ? "any" : ((struct tl_tree_type *)arg->type)->type->print_id, num);
+ }
+ } else {
+ assert (t == NODE_TYPE_ARRAY);
+ printf ("%sint multiplicity%d = PTR2INT (\n", offset, num);
+ assert (gen_create (((struct tl_tree_array *)arg->type)->multiplicity, vars, 2 + o) >= 0);
+ printf ("%s);\n", offset);
+ printf ("%sstruct paramed_type *field%d = \n", offset, num);
+ assert (gen_create (((struct tl_tree_array *)arg->type)->args[0]->type, vars, 2 + o) >= 0);
+ printf (";\n");
+ printf ("%swhile (multiplicity%d -- > 0) {\n", offset, num);
+ printf ("%s if (skip_type_%s (field%d) < 0) { return -1;}\n", offset, "any", num);
+ printf ("%s}\n", offset);
+ }
+ }
+ if (arg->exist_var_num >= 0) {
+ printf (" }\n");
+ }
+ return 0;
+}
+
+int gen_field_fetch (struct arg *arg, int *vars, int num, int empty) {
+ assert (arg);
+ char *offset = " ";
+ int o = 0;
+ if (arg->exist_var_num >= 0) {
+ printf (" if (PTR2INT (var%d) & (1 << %d)) {\n", arg->exist_var_num, arg->exist_var_bit);
+ offset = " ";
+ o = 2;
+ }
+ if (!empty) {
+ printf("%sif (multiline_output >= 2) { print_offset (); }\n", offset);
+ }
+ if (arg->id && strlen (arg->id) && !empty) {
+ printf ("%sif (!disable_field_names) { eprintf (\" %s :\"); }\n", offset, arg->id);
+ }
+ if (arg->var_num >= 0) {
+ assert (TL_TREE_METHODS (arg->type)->type (arg->type) == NODE_TYPE_TYPE);
+ int t = ((struct tl_tree_type *)arg->type)->type->name;
+ if (t == NAME_VAR_TYPE) {
+ fprintf (stderr, "Not supported yet\n");
+ assert (0);
+ } else {
+ assert (t == NAME_VAR_NUM);
+ if (vars[arg->var_num] == 0) {
+ printf ("%sif (in_remaining () < 4) { return -1;}\n", offset);
+ printf ("%seprintf (\" %%d\", prefetch_int ());\n", offset);
+ printf ("%sstruct paramed_type *var%d = INT2PTR (fetch_int ());\n", offset, arg->var_num);
+ vars[arg->var_num] = 2;
+ } else if (vars[arg->var_num] == 2) {
+ printf ("%sif (in_remaining () < 4) { return -1;}\n", offset);
+ printf ("%seprintf (\" %%d\", prefetch_int ());\n", offset);
+ printf ("%sif (vars%d != INT2PTR (fetch_int ())) { return -1; }\n", offset, arg->var_num);
+ } else {
+ assert (0);
+ return -1;
+ }
+ }
+ } else {
+ int t = TL_TREE_METHODS (arg->type)->type (arg->type);
+ if (t == NODE_TYPE_TYPE || t == NODE_TYPE_VAR_TYPE) {
+ printf ("%sstruct paramed_type *field%d = \n", offset, num);
+ assert (gen_create (arg->type, vars, 2 + o) >= 0);
+ printf (";\n");
+ int bare = arg->flags & FLAG_BARE;
+ if (!bare && t == NODE_TYPE_TYPE) {
+ bare = ((struct tl_tree_type *)arg->type)->self.flags & FLAG_BARE;
+ }
+ if (!bare) {
+ printf ("%sif (fetch_type_%s (field%d) < 0) { return -1;}\n", offset, t == NODE_TYPE_VAR_TYPE ? "any" : ((struct tl_tree_type *)arg->type)->type->print_id, num);
+ } else {
+ printf ("%sif (fetch_type_bare_%s (field%d) < 0) { return -1;}\n", offset, t == NODE_TYPE_VAR_TYPE ? "any" : ((struct tl_tree_type *)arg->type)->type->print_id, num);
+ }
+ } else {
+ assert (t == NODE_TYPE_ARRAY);
+ printf ("%sint multiplicity%d = PTR2INT (\n", offset, num);
+ assert (gen_create (((struct tl_tree_array *)arg->type)->multiplicity, vars, 2 + o) >= 0);
+ printf ("%s);\n", offset);
+ printf ("%sstruct paramed_type *field%d = \n", offset, num);
+ assert (gen_create (((struct tl_tree_array *)arg->type)->args[0]->type, vars, 2 + o) >= 0);
+ printf (";\n");
+ printf ("%seprintf (\" [\");\n", offset);
+ printf ("%sif (multiline_output >= 1) { eprintf (\"\\n\"); }\n", offset);
+ printf ("%sif (multiline_output >= 1) { multiline_offset += multiline_offset_size;}\n", offset);
+ printf ("%swhile (multiplicity%d -- > 0) {\n", offset, num);
+ printf ("%s if (multiline_output >= 1) { print_offset (); }\n", offset);
+ printf ("%s if (fetch_type_%s (field%d) < 0) { return -1;}\n", offset, "any", num);
+ printf ("%s if (multiline_output >= 1) { eprintf (\"\\n\"); }\n", offset);
+ printf ("%s}\n", offset);
+ printf ("%sif (multiline_output >= 1) { multiline_offset -= multiline_offset_size; print_offset ();}\n", offset);
+ printf ("%seprintf (\" ]\");\n", offset);
+ }
+ }
+ if (!empty) {
+ printf("%sif (multiline_output >= 2) { eprintf (\"\\n\"); }\n", offset);
+ }
+ if (arg->exist_var_num >= 0) {
+ printf (" }\n");
+ }
+ return 0;
+}
+
+int gen_field_store (struct arg *arg, int *vars, int num, int from_func, int empty) {
+ assert (arg);
+ char *offset = " ";
+ int o = 0;
+ if (arg->exist_var_num >= 0) {
+ printf (" if (PTR2INT (var%d) & (1 << %d)) {\n", arg->exist_var_num, arg->exist_var_bit);
+ offset = " ";
+ o = 2;
+ }
+ char *fail = from_func ? "0" : "-1";
+ char *expect = from_func ? "expect_token_ptr" : "expect_token";
+ if (arg->id && strlen (arg->id) > 0 && !empty) {
+ printf ("%sif (cur_token_len >= 0 && cur_token_len == %d && !cur_token_quoted && !memcmp (cur_token, \"%s\", cur_token_len)) {\n", offset, (int)(strlen (arg->id)), arg->id);
+ printf ("%s local_next_token ();\n", offset);
+ printf ("%s %s (\":\", 1);\n", offset, expect);
+ printf ("%s}\n", offset);
+ }
+ if (arg->var_num >= 0) {
+ printf ("%sif (cur_token_len < 0) { return %s; }\n", offset, fail);
+ assert (TL_TREE_METHODS (arg->type)->type (arg->type) == NODE_TYPE_TYPE);
+ int t = ((struct tl_tree_type *)arg->type)->type->name;
+ if (t == NAME_VAR_TYPE) {
+ fprintf (stderr, "Not supported yet\n");
+ assert (0);
+ } else {
+ assert (t == NAME_VAR_NUM);
+ if (vars[arg->var_num] == 0) {
+ printf ("%sif (!is_int ()) { return %s;}\n", offset, fail);
+ printf ("%sstruct paramed_type *var%d = INT2PTR (get_int ());\n", offset, arg->var_num);
+ printf ("%sout_int (get_int ());\n", offset);
+ printf ("%sassert (var%d);\n", offset, arg->var_num);
+ printf ("%slocal_next_token ();\n", offset);
+ vars[arg->var_num] = 2;
+ } else if (vars[arg->var_num] == 2) {
+ printf ("%sif (!is_int ()) { return %s;}\n", offset, fail);
+ printf ("%sif (vars%d != INT2PTR (get_int ())) { return %s; }\n", offset, arg->var_num, fail);
+ printf ("%sout_int (get_int ());\n", offset);
+ printf ("%slocal_next_token ();\n", offset);
+ } else {
+ assert (0);
+ return -1;
+ }
+ }
+ } else {
+ int t = TL_TREE_METHODS (arg->type)->type (arg->type);
+ if (t == NODE_TYPE_TYPE || t == NODE_TYPE_VAR_TYPE) {
+ printf ("%sstruct paramed_type *field%d = \n", offset, num);
+ assert (gen_create (arg->type, vars, 2 + o) >= 0);
+ printf (";\n");
+ int bare = arg->flags & FLAG_BARE;
+ if (!bare && t == NODE_TYPE_TYPE) {
+ bare = ((struct tl_tree_type *)arg->type)->self.flags & FLAG_BARE;
+ }
+ if (!bare) {
+ printf ("%sif (store_type_%s (field%d) < 0) { return %s;}\n", offset, t == NODE_TYPE_VAR_TYPE ? "any" : ((struct tl_tree_type *)arg->type)->type->print_id, num, fail);
+ } else {
+ printf ("%sif (store_type_bare_%s (field%d) < 0) { return %s;}\n", offset, t == NODE_TYPE_VAR_TYPE ? "any" : ((struct tl_tree_type *)arg->type)->type->print_id, num, fail);
+ }
+ } else {
+ printf ("%s%s (\"[\", 1);\n", offset, expect);
+
+ assert (t == NODE_TYPE_ARRAY);
+ printf ("%sint multiplicity%d = PTR2INT (\n", offset, num);
+ assert (gen_create (((struct tl_tree_array *)arg->type)->multiplicity, vars, 2 + o) >= 0);
+ printf ("%s);\n", offset);
+ printf ("%sstruct paramed_type *field%d = \n", offset, num);
+ assert (gen_create (((struct tl_tree_array *)arg->type)->args[0]->type, vars, 2 + o) >= 0);
+ printf (";\n");
+ printf ("%swhile (multiplicity%d -- > 0) {\n", offset, num);
+ printf ("%s if (store_type_%s (field%d) < 0) { return %s;}\n", offset, "any", num, fail);
+ printf ("%s}\n", offset);
+
+ printf ("%s%s (\"]\", 1);\n", offset, expect);
+ }
+ }
+ if (arg->exist_var_num >= 0) {
+ printf (" }\n");
+ }
+ return 0;
+}
+
+int gen_field_autocomplete (struct arg *arg, int *vars, int num, int from_func, int empty) {
+ assert (arg);
+ char *offset = " ";
+ int o = 0;
+ if (arg->exist_var_num >= 0) {
+ printf (" if (PTR2INT (var%d) & (1 << %d)) {\n", arg->exist_var_num, arg->exist_var_bit);
+ offset = " ";
+ o = 2;
+ }
+ char *fail = from_func ? "0" : "-1";
+ char *expect = from_func ? "expect_token_ptr_autocomplete" : "expect_token_autocomplete";
+ if (arg->id && strlen (arg->id) > 0 && !empty) {
+ printf ("%sif (cur_token_len == -3 && cur_token_real_len <= %d && !cur_token_quoted && !memcmp (cur_token, \"%s\", cur_token_real_len)) {\n", offset, (int)(strlen (arg->id)), arg->id);
+ printf ("%s set_autocomplete_string (\"%s\");\n", offset, arg->id);
+ printf ("%s return %s;\n", offset, fail);
+ printf ("%s}\n", offset);
+
+ printf ("%sif (cur_token_len >= 0 && cur_token_len == %d && !memcmp (cur_token, \"%s\", cur_token_len)) {\n", offset, (int)(strlen (arg->id)), arg->id);
+ printf ("%s local_next_token ();\n", offset);
+ printf ("%s %s (\":\", 1);\n", offset, expect);
+ printf ("%s}\n", offset);
+ }
+ if (arg->var_num >= 0) {
+ printf ("%sif (cur_token_len < 0) { return %s; }\n", offset, fail);
+ assert (TL_TREE_METHODS (arg->type)->type (arg->type) == NODE_TYPE_TYPE);
+ int t = ((struct tl_tree_type *)arg->type)->type->name;
+ if (t == NAME_VAR_TYPE) {
+ fprintf (stderr, "Not supported yet\n");
+ assert (0);
+ } else {
+ assert (t == NAME_VAR_NUM);
+ if (vars[arg->var_num] == 0) {
+ printf ("%sif (!is_int ()) { return %s;}\n", offset, fail);
+ printf ("%sstruct paramed_type *var%d = INT2PTR (get_int ());\n", offset, arg->var_num);
+ printf ("%sassert (var%d);\n", offset, arg->var_num);
+ printf ("%slocal_next_token ();\n", offset);
+ vars[arg->var_num] = 2;
+ } else if (vars[arg->var_num] == 2) {
+ printf ("%sif (!is_int ()) { return %s;}\n", offset, fail);
+ printf ("%sif (vars%d != INT2PTR (get_int ())) { return %s; }\n", offset, arg->var_num, fail);
+ printf ("%slocal_next_token ();\n", offset);
+ } else {
+ assert (0);
+ return -1;
+ }
+ }
+ } else {
+ int t = TL_TREE_METHODS (arg->type)->type (arg->type);
+ if (t == NODE_TYPE_TYPE || t == NODE_TYPE_VAR_TYPE) {
+ printf ("%sstruct paramed_type *field%d = \n", offset, num);
+ assert (gen_create (arg->type, vars, 2 + o) >= 0);
+ printf (";\n");
+ int bare = arg->flags & FLAG_BARE;
+ if (!bare && t == NODE_TYPE_TYPE) {
+ bare = ((struct tl_tree_type *)arg->type)->self.flags & FLAG_BARE;
+ }
+ if (!bare) {
+ printf ("%sif (autocomplete_type_%s (field%d) < 0) { return %s;}\n", offset, t == NODE_TYPE_VAR_TYPE ? "any" : ((struct tl_tree_type *)arg->type)->type->print_id, num, fail);
+ } else {
+ printf ("%sif (autocomplete_type_bare_%s (field%d) < 0) { return %s;}\n", offset, t == NODE_TYPE_VAR_TYPE ? "any" : ((struct tl_tree_type *)arg->type)->type->print_id, num, fail);
+ }
+ } else {
+ printf ("%s%s (\"[\", 1);\n", offset, expect);
+
+ assert (t == NODE_TYPE_ARRAY);
+ printf ("%sint multiplicity%d = PTR2INT (\n", offset, num);
+ assert (gen_create (((struct tl_tree_array *)arg->type)->multiplicity, vars, 2 + o) >= 0);
+ printf ("%s);\n", offset);
+ printf ("%sstruct paramed_type *field%d = \n", offset, num);
+ assert (gen_create (((struct tl_tree_array *)arg->type)->args[0]->type, vars, 2 + o) >= 0);
+ printf (";\n");
+ printf ("%swhile (multiplicity%d -- > 0) {\n", offset, num);
+ printf ("%s if (autocomplete_type_%s (field%d) < 0) { return %s;}\n", offset, "any", num, fail);
+ printf ("%s}\n", offset);
+
+ printf ("%s%s (\"]\", 1);\n", offset, expect);
+ }
+ }
+ if (arg->exist_var_num >= 0) {
+ printf (" }\n");
+ }
+ return 0;
+}
+
+int gen_field_fetch_ds (struct arg *arg, int *vars, int num, int empty) {
+ assert (arg);
+ char *offset = " ";
+ int o = 0;
+ if (arg->exist_var_num >= 0) {
+ printf (" if (PTR2INT (var%d) & (1 << %d)) {\n", arg->exist_var_num, arg->exist_var_bit);
+ offset = " ";
+ o = 2;
+ }
+ if (arg->var_num >= 0) {
+ assert (TL_TREE_METHODS (arg->type)->type (arg->type) == NODE_TYPE_TYPE);
+ int t = ((struct tl_tree_type *)arg->type)->type->name;
+ if (t == NAME_VAR_TYPE) {
+ fprintf (stderr, "Not supported yet\n");
+ assert (0);
+ } else {
+ assert (t == NAME_VAR_NUM);
+ printf ("%sassert (in_remaining () >= 4);\n", offset);
+ if (arg->id && strlen (arg->id)) {
+ printf ("%sresult->%s = talloc (4);", offset, arg->id);
+ printf ("%s*result->%s = prefetch_int ();", offset, arg->id);
+ } else {
+ printf ("%sresult->f%d = talloc (4);", offset, num - 1);
+ printf ("%s*result->f%d = prefetch_int ();", offset, num - 1);
+ }
+ if (vars[arg->var_num] == 0) {
+ printf ("%sstruct paramed_type *var%d = INT2PTR (fetch_int ());\n", offset, arg->var_num);
+ vars[arg->var_num] = 2;
+ } else if (vars[arg->var_num] == 2) {
+ printf ("%sassert (vars%d == INT2PTR (fetch_int ()));\n", offset, arg->var_num);
+ } else {
+ assert (0);
+ return -1;
+ }
+ }
+ } else {
+ int t = TL_TREE_METHODS (arg->type)->type (arg->type);
+ if (t == NODE_TYPE_TYPE || t == NODE_TYPE_VAR_TYPE) {
+ printf ("%sstruct paramed_type *field%d = \n", offset, num);
+ assert (gen_create (arg->type, vars, 2 + o) >= 0);
+ printf (";\n");
+ int bare = arg->flags & FLAG_BARE;
+ if (!bare && t == NODE_TYPE_TYPE) {
+ bare = ((struct tl_tree_type *)arg->type)->self.flags & FLAG_BARE;
+ }
+ if (arg->id && strlen (arg->id)) {
+ printf ("%sresult->%s = ", offset, arg->id);
+ } else {
+ printf ("%sresult->f%d = ", offset, num - 1);
+ }
+ if (t == NODE_TYPE_TYPE && !strcmp (((struct tl_tree_type *)arg->type)->type->id, "Vector")) {
+ printf ("(void *)");
+ }
+ if (!bare) {
+ printf ("fetch_ds_type_%s (field%d);\n", t == NODE_TYPE_VAR_TYPE ? "any" : ((struct tl_tree_type *)arg->type)->type->print_id, num);
+ } else {
+ printf ("fetch_ds_type_bare_%s (field%d);\n", t == NODE_TYPE_VAR_TYPE ? "any" : ((struct tl_tree_type *)arg->type)->type->print_id, num);
+ }
+ } else {
+ assert (t == NODE_TYPE_ARRAY);
+ printf ("%sint multiplicity%d = PTR2INT (\n", offset, num);
+ assert (gen_create (((struct tl_tree_array *)arg->type)->multiplicity, vars, 2 + o) >= 0);
+ printf ("%s);\n", offset);
+ printf ("%sstruct paramed_type *field%d = \n", offset, num);
+ assert (gen_create (((struct tl_tree_array *)arg->type)->args[0]->type, vars, 2 + o) >= 0);
+ printf (";\n");
+ if (arg->id && strlen (arg->id)) {
+ printf ("%sresult->%s = ", offset, arg->id);
+ } else {
+ printf ("%sresult->f%d = ", offset, num - 1);
+ }
+ printf ("talloc0 (multiplicity%d * sizeof (void *));\n", num);
+ printf ("%s{\n", offset);
+ printf ("%s int i = 0;\n", offset);
+ printf ("%s while (i < multiplicity%d) {\n", offset, num);
+ if (arg->id && strlen (arg->id)) {
+ printf ("%s result->%s[i ++] =", offset, arg->id);
+ } else {
+ printf ("%s result->f%d[i ++] = ", offset, num - 1);
+ }
+ printf ("fetch_ds_type_%s (field%d);\n", "any", num);
+ printf ("%s }\n", offset);
+ printf ("%s}\n", offset);
+ }
+ }
+ if (arg->exist_var_num >= 0) {
+ printf (" }\n");
+ }
+ return 0;
+}
+
+int gen_field_free_ds (struct arg *arg, int *vars, int num, int empty) {
+ assert (arg);
+ char *offset = " ";
+ int o = 0;
+ if (arg->exist_var_num >= 0) {
+ printf (" if (PTR2INT (var%d) & (1 << %d)) {\n", arg->exist_var_num, arg->exist_var_bit);
+ offset = " ";
+ o = 2;
+ }
+ if (arg->var_num >= 0) {
+ assert (TL_TREE_METHODS (arg->type)->type (arg->type) == NODE_TYPE_TYPE);
+ int t = ((struct tl_tree_type *)arg->type)->type->name;
+ if (t == NAME_VAR_TYPE) {
+ fprintf (stderr, "Not supported yet\n");
+ assert (0);
+ } else {
+ assert (t == NAME_VAR_NUM);
+ if (arg->id && strlen (arg->id)) {
+ if (vars[arg->var_num] == 0) {
+ printf ("%sstruct paramed_type *var%d = INT2PTR (*D->%s);\n", offset, arg->var_num, arg->id);
+ vars[arg->var_num] = 2;
+ } else if (vars[arg->var_num] == 2) {
+ printf ("%sassert (vars%d == INT2PTR (*D->%s));\n", offset, arg->var_num, arg->id);
+ }
+ printf ("%stfree (D->%s, sizeof (*D->%s));\n", offset, arg->id, arg->id);
+ } else {
+ if (vars[arg->var_num] == 0) {
+ printf ("%sstruct paramed_type *var%d = INT2PTR (*D->f%d);\n", offset, arg->var_num, num - 1);
+ vars[arg->var_num] = 2;
+ } else if (vars[arg->var_num] == 2) {
+ printf ("%sassert (vars%d == *D->f%d);\n", offset, arg->var_num, num - 1);
+ }
+ printf ("%stfree (D->f%d, sizeof (*D->f%d));\n", offset, num - 1, num - 1);
+ }
+ }
+ } else {
+ int t = TL_TREE_METHODS (arg->type)->type (arg->type);
+ if (t == NODE_TYPE_TYPE || t == NODE_TYPE_VAR_TYPE) {
+ printf ("%sstruct paramed_type *field%d = \n", offset, num);
+ assert (gen_create (arg->type, vars, 2 + o) >= 0);
+ printf (";\n");
+ int any = (t == NODE_TYPE_VAR_TYPE) || ((struct tl_tree_type *)arg->type)->type->name == NAME_VECTOR;
+ if (arg->id && strlen (arg->id)) {
+ printf ("%sfree_ds_type_%s (D->%s, field%d);\n", offset, any ? "any" : ((struct tl_tree_type *)arg->type)->type->print_id, arg->id, num);
+ } else {
+ printf ("%sfree_ds_type_%s (D->f%d, field%d);\n", offset, any ? "any" : ((struct tl_tree_type *)arg->type)->type->print_id, num - 1, num);
+ }
+ } else {
+ assert (t == NODE_TYPE_ARRAY);
+ printf ("%sint multiplicity%d = PTR2INT (\n", offset, num);
+ assert (gen_create (((struct tl_tree_array *)arg->type)->multiplicity, vars, 2 + o) >= 0);
+ printf ("%s);\n", offset);
+ printf ("%sstruct paramed_type *field%d = \n", offset, num);
+ assert (gen_create (((struct tl_tree_array *)arg->type)->args[0]->type, vars, 2 + o) >= 0);
+ printf (";\n");
+ printf ("%s{\n", offset);
+ printf ("%s int i = 0;\n", offset);
+ printf ("%s while (i < multiplicity%d) {\n", offset, num);
+ if (arg->id && strlen (arg->id)) {
+ printf ("%s free_ds_type_%s (D->%s[i ++], field%d);\n", offset, "any", arg->id, num);
+ } else {
+ printf ("%s free_ds_type_%s (D->f%d[i ++], field%d);\n", offset, "any", num - 1, num);
+ }
+ printf ("%s }\n", offset);
+ printf ("%s}\n", offset);
+ if (arg->id && strlen (arg->id)) {
+ printf ("%stfree (D->%s, sizeof (void *) * multiplicity%d);\n", offset, arg->id, num);
+ } else {
+ printf ("%stfree (D->f%d, sizeof (void *) * multiplicity%d);\n", offset, num - 1, num);
+ }
+ }
+ }
+ if (arg->exist_var_num >= 0) {
+ printf (" }\n");
+ }
+ return 0;
+}
+
+int gen_field_store_ds (struct arg *arg, int *vars, int num, int empty) {
+ assert (arg);
+ char *offset = " ";
+ int o = 0;
+ if (arg->exist_var_num >= 0) {
+ printf (" if (PTR2INT (var%d) & (1 << %d)) {\n", arg->exist_var_num, arg->exist_var_bit);
+ offset = " ";
+ o = 2;
+ }
+ if (arg->var_num >= 0) {
+ assert (TL_TREE_METHODS (arg->type)->type (arg->type) == NODE_TYPE_TYPE);
+ int t = ((struct tl_tree_type *)arg->type)->type->name;
+ if (t == NAME_VAR_TYPE) {
+ fprintf (stderr, "Not supported yet\n");
+ assert (0);
+ } else {
+ assert (t == NAME_VAR_NUM);
+ if (arg->id && strlen (arg->id)) {
+ if (vars[arg->var_num] == 0) {
+ printf ("%sstruct paramed_type *var%d = INT2PTR (*D->%s);\n", offset, arg->var_num, arg->id);
+ vars[arg->var_num] = 2;
+ } else if (vars[arg->var_num] == 2) {
+ printf ("%sassert (vars%d == INT2PTR (*D->%s));\n", offset, arg->var_num, arg->id);
+ }
+ printf ("%sout_int (PTR2INT (var%d));\n", offset, arg->var_num);
+ } else {
+ if (vars[arg->var_num] == 0) {
+ printf ("%sstruct paramed_type *var%d = INT2PTR (*D->f%d);\n", offset, arg->var_num, num - 1);
+ vars[arg->var_num] = 2;
+ } else if (vars[arg->var_num] == 2) {
+ printf ("%sassert (vars%d == *D->f%d);\n", offset, arg->var_num, num - 1);
+ }
+ printf ("%sout_int (PTR2INT (var%d));\n", offset, arg->var_num);
+ }
+ }
+ } else {
+ int t = TL_TREE_METHODS (arg->type)->type (arg->type);
+ if (t == NODE_TYPE_TYPE || t == NODE_TYPE_VAR_TYPE) {
+ int bare = arg->flags & FLAG_BARE;
+ if (!bare && t == NODE_TYPE_TYPE) {
+ bare = ((struct tl_tree_type *)arg->type)->self.flags & FLAG_BARE;
+ }
+ printf ("%sstruct paramed_type *field%d = \n", offset, num);
+ assert (gen_create (arg->type, vars, 2 + o) >= 0);
+ printf (";\n");
+ int any = (t == NODE_TYPE_VAR_TYPE);
+ int vec = ((struct tl_tree_type *)arg->type)->type->name == NAME_VECTOR;
+ if (arg->id && strlen (arg->id)) {
+ printf ("%sstore_ds_type_%s%s (%sD->%s, field%d);\n", offset, bare ? "bare_" : "", any ? "any" : ((struct tl_tree_type *)arg->type)->type->print_id, vec ? "(void *)" : "", arg->id, num);
+ } else {
+ printf ("%sstore_ds_type_%s%s (%sD->f%d, field%d);\n", offset, bare ? "bare_" : "", any ? "any" : ((struct tl_tree_type *)arg->type)->type->print_id, vec ? "(void *)" : "", num - 1, num);
+ }
+ } else {
+ assert (t == NODE_TYPE_ARRAY);
+ printf ("%sint multiplicity%d = PTR2INT (\n", offset, num);
+ assert (gen_create (((struct tl_tree_array *)arg->type)->multiplicity, vars, 2 + o) >= 0);
+ printf ("%s);\n", offset);
+ printf ("%sstruct paramed_type *field%d = \n", offset, num);
+ assert (gen_create (((struct tl_tree_array *)arg->type)->args[0]->type, vars, 2 + o) >= 0);
+ printf (";\n");
+ printf ("%s{\n", offset);
+ printf ("%s int i = 0;\n", offset);
+ printf ("%s while (i < multiplicity%d) {\n", offset, num);
+ if (arg->id && strlen (arg->id)) {
+ printf ("%s store_ds_type_%s (D->%s[i ++], field%d);\n", offset, "any", arg->id, num);
+ } else {
+ printf ("%s store_ds_type_%s (D->f%d[i ++], field%d);\n", offset, "any", num - 1, num);
+ }
+ printf ("%s }\n", offset);
+ printf ("%s}\n", offset);
+ }
+ }
+ if (arg->exist_var_num >= 0) {
+ printf (" }\n");
+ }
+ return 0;
+}
+
+int gen_field_print_ds (struct arg *arg, int *vars, int num, int empty) {
+ assert (arg);
+ char *offset = " ";
+ int o = 0;
+ if (arg->exist_var_num >= 0) {
+ printf (" if (PTR2INT (var%d) & (1 << %d)) {\n", arg->exist_var_num, arg->exist_var_bit);
+ offset = " ";
+ o = 2;
+ }
+ if (!empty) {
+ printf("%sif (multiline_output >= 2) { print_offset (); }\n", offset);
+ }
+ if (arg->id && strlen (arg->id) && !empty) {
+ printf ("%sif (!disable_field_names) { eprintf (\" %s :\"); }\n", offset, arg->id);
+ }
+ if (arg->var_num >= 0) {
+ assert (TL_TREE_METHODS (arg->type)->type (arg->type) == NODE_TYPE_TYPE);
+ int t = ((struct tl_tree_type *)arg->type)->type->name;
+ if (t == NAME_VAR_TYPE) {
+ fprintf (stderr, "Not supported yet\n");
+ assert (0);
+ } else {
+ if (arg->id && strlen (arg->id)) {
+ if (vars[arg->var_num] == 0) {
+ printf ("%sstruct paramed_type *var%d = INT2PTR (*DS->%s);\n", offset, arg->var_num, arg->id);
+ vars[arg->var_num] = 2;
+ } else if (vars[arg->var_num] == 2) {
+ printf ("%sassert (vars%d == INT2PTR (*DS->%s));\n", offset, arg->var_num, arg->id);
+ }
+ } else {
+ if (vars[arg->var_num] == 0) {
+ printf ("%sstruct paramed_type *var%d = INT2PTR (*DS->f%d);\n", offset, arg->var_num, num - 1);
+ vars[arg->var_num] = 2;
+ } else if (vars[arg->var_num] == 2) {
+ printf ("%sassert (vars%d == *DS->f%d);\n", offset, arg->var_num, num - 1);
+ }
+ }
+ printf ("%seprintf (\" %%d\", (int)PTR2INT (var%d));\n", offset, arg->var_num);
+ }
+ } else {
+ int t = TL_TREE_METHODS (arg->type)->type (arg->type);
+ if (t == NODE_TYPE_TYPE || t == NODE_TYPE_VAR_TYPE) {
+ printf ("%sstruct paramed_type *field%d = \n", offset, num);
+ assert (gen_create (arg->type, vars, 2 + o) >= 0);
+ printf (";\n");
+ int bare = arg->flags & FLAG_BARE;
+ if (!bare && t == NODE_TYPE_TYPE) {
+ bare = ((struct tl_tree_type *)arg->type)->self.flags & FLAG_BARE;
+ }
+ int any = (t == NODE_TYPE_VAR_TYPE);
+ int vec = ((struct tl_tree_type *)arg->type)->type->name == NAME_VECTOR;
+ if (arg->id && strlen (arg->id)) {
+ printf ("%sprint_ds_type_%s%s (%sDS->%s, field%d);\n", offset, bare ? "bare_" : "", any ? "any" : ((struct tl_tree_type *)arg->type)->type->print_id, vec ? "(void *)" : "", arg->id, num);
+ } else {
+ printf ("%sprint_ds_type_%s%s (%sDS->f%d, field%d);\n", offset, bare ? "bare_" : "", any ? "any" : ((struct tl_tree_type *)arg->type)->type->print_id, vec ? "(void *)" : "", num - 1, num);
+ }
+ } else {
+ assert (t == NODE_TYPE_ARRAY);
+ printf ("%sint multiplicity%d = PTR2INT (\n", offset, num);
+ assert (gen_create (((struct tl_tree_array *)arg->type)->multiplicity, vars, 2 + o) >= 0);
+ printf ("%s);\n", offset);
+ printf ("%sstruct paramed_type *field%d = \n", offset, num);
+ assert (gen_create (((struct tl_tree_array *)arg->type)->args[0]->type, vars, 2 + o) >= 0);
+ printf (";\n");
+ printf ("%seprintf (\" [\");\n", offset);
+ printf ("%sif (multiline_output >= 1) { eprintf (\"\\n\"); }\n", offset);
+ printf ("%sif (multiline_output >= 1) { multiline_offset += multiline_offset_size;}\n", offset);
+ printf ("%s{\n", offset);
+ printf ("%s int i = 0;\n", offset);
+ printf ("%s while (i < multiplicity%d) {\n", offset, num);
+ printf ("%s if (multiline_output >= 1) { print_offset (); }\n", offset);
+ if (arg->id && strlen (arg->id)) {
+ printf ("%s print_ds_type_%s (DS->%s[i ++], field%d);\n", offset, "any", arg->id, num);
+ } else {
+ printf ("%s print_ds_type_%s (DS->f%d[i ++], field%d);\n", offset, "any", num - 1, num);
+ }
+ printf ("%s if (multiline_output >= 1) { eprintf (\"\\n\"); }\n", offset);
+ printf ("%s }\n", offset);
+ printf ("%s}\n", offset);
+ printf ("%sif (multiline_output >= 1) { multiline_offset -= multiline_offset_size; print_offset ();}\n", offset);
+ printf ("%seprintf (\" ]\");\n", offset);
+ }
+ }
+ if (!empty) {
+ printf("%sif (multiline_output >= 2) { eprintf (\"\\n\"); }\n", offset);
+ }
+ if (arg->exist_var_num >= 0) {
+ printf (" }\n");
+ }
+ return 0;
+}
+
+int gen_field_autocomplete_excl (struct arg *arg, int *vars, int num, int from_func) {
+ assert (arg);
+ assert (arg->var_num < 0);
+ char *offset = " ";
+ if (arg->exist_var_num >= 0) {
+ printf (" if (PTR2INT (var%d) & (1 << %d)) {\n", arg->exist_var_num, arg->exist_var_bit);
+ offset = " ";
+ }
+ char *fail = from_func ? "0" : "-1";
+ char *expect = from_func ? "expect_token_ptr_autocomplete" : "expect_token_autocomplete";
+ if (arg->id && strlen (arg->id) > 0) {
+ printf ("%sif (cur_token_len == -3 && cur_token_real_len <= %d && !cur_token_quoted && !memcmp (cur_token, \"%s\", cur_token_real_len)) {\n", offset, (int)(strlen (arg->id)), arg->id);
+ printf ("%s set_autocomplete_string (\"%s\");\n", offset, arg->id);
+ printf ("%s return %s;\n", offset, fail);
+ printf ("%s}\n", offset);
+
+ printf ("%sif (cur_token_len >= 0 && cur_token_len == %d && !memcmp (cur_token, \"%s\", cur_token_len)) {\n", offset, (int)(strlen (arg->id)), arg->id);
+ printf ("%s local_next_token ();\n", offset);
+ printf ("%s %s (\":\", 1);\n", offset, expect);
+ printf ("%s}\n", offset);
+ }
+ int t = TL_TREE_METHODS (arg->type)->type (arg->type);
+ assert (t == NODE_TYPE_TYPE || t == NODE_TYPE_VAR_TYPE);
+ printf ("%sstruct paramed_type *field%d = autocomplete_function_any ();\n", offset, num);
+ printf ("%sif (!field%d) { return 0; }\n", offset, num);
+ printf ("%sadd_var_to_be_freed (field%d);\n", offset, num);
+ static char s[20];
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ sprintf_s (s, 20, "field%d", num);
+#else
+ sprintf (s, "field%d", num);
+#endif
+ gen_uni_skip (arg->type, s, vars, 1, 1);
+ if (arg->exist_var_num >= 0) {
+ printf (" }\n");
+ }
+ return 0;
+}
+
+int gen_field_store_excl (struct arg *arg, int *vars, int num, int from_func) {
+ assert (arg);
+ assert (arg->var_num < 0);
+ char *offset = " ";
+ if (arg->exist_var_num >= 0) {
+ printf (" if (PTR2INT (var%d) & (1 << %d)) {\n", arg->exist_var_num, arg->exist_var_bit);
+ offset = " ";
+ }
+ char *expect = from_func ? "expect_token_ptr" : "expect_token";
+ if (arg->id && strlen (arg->id) > 0) {
+ printf ("%sif (cur_token_len >= 0 && cur_token_len == %d && !cur_token_quoted && !memcmp (cur_token, \"%s\", cur_token_len)) {\n", offset, (int)(strlen (arg->id)), arg->id);
+ printf ("%s local_next_token ();\n", offset);
+ printf ("%s %s (\":\", 1);\n", offset, expect);
+ printf ("%s}\n", offset);
+ }
+ int t = TL_TREE_METHODS (arg->type)->type (arg->type);
+ assert (t == NODE_TYPE_TYPE || t == NODE_TYPE_VAR_TYPE);
+ printf ("%sstruct paramed_type *field%d = store_function_any ();\n", offset, num);
+ printf ("%sif (!field%d) { return 0; }\n", offset, num);
+ static char s[20];
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ sprintf_s (s, 20, "field%d", num);
+#else
+ sprintf (s, "field%d", num);
+#endif
+ gen_uni_skip (arg->type, s, vars, 1, 1);
+ if (arg->exist_var_num >= 0) {
+ printf (" }\n");
+ }
+ return 0;
+}
+
+void gen_constructor_skip (struct tl_combinator *c) {
+ printf ("int skip_constructor_%s (struct paramed_type *T) {\n", c->print_id);
+ int i;
+ for (i = 0; i < c->args_num; i++) if (c->args[i]->flags & FLAG_EXCL) {
+ printf (" return -1;\n");
+ printf ("}\n");
+ return;
+ }
+ static char s[10000];
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ sprintf_s (s, 10000, "T");
+#else
+ sprintf (s, "T");
+#endif
+
+ int *vars = malloc0 (c->var_num * 4);;
+ gen_uni_skip (c->result, s, vars, 1, 0);
+
+ if (c->name == NAME_INT) {
+ printf (" if (in_remaining () < 4) { return -1;}\n");
+ printf (" fetch_int ();\n");
+ printf (" return 0;\n");
+ printf ("}\n");
+ return;
+ } else if (c->name == NAME_LONG) {
+ printf (" if (in_remaining () < 8) { return -1;}\n");
+ printf (" fetch_long ();\n");
+ printf (" return 0;\n");
+ printf ("}\n");
+ return;
+ } else if (c->name == NAME_STRING) {
+ printf (" int l = prefetch_strlen ();\n");
+ printf (" if (l < 0) { return -1;}\n");
+ printf (" fetch_str (l);\n");
+ printf (" return 0;\n");
+ printf ("}\n");
+ return;
+ } else if (c->name == NAME_DOUBLE) {
+ printf (" if (in_remaining () < 8) { return -1;}\n");
+ printf (" fetch_double ();\n");
+ printf (" return 0;\n");
+ printf ("}\n");
+ return;
+ }
+
+ for (i = 0; i < c->args_num; i++) if (!(c->args[i]->flags & FLAG_OPT_VAR)) {
+ assert (gen_field_skip (c->args[i], vars, i + 1) >= 0);
+ }
+ free (vars);
+ printf (" return 0;\n");
+ printf ("}\n");
+}
+
+void gen_constructor_fetch (struct tl_combinator *c) {
+ printf ("int fetch_constructor_%s (struct paramed_type *T) {\n", c->print_id);
+ int i;
+ for (i = 0; i < c->args_num; i++) if (c->args[i]->flags & FLAG_EXCL) {
+ printf (" return -1;\n");
+ printf ("}\n");
+ return;
+ }
+ static char s[10000];
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ sprintf_s (s, 10000, "T");
+#else
+ sprintf (s, "T");
+#endif
+
+ int *vars = malloc0 (c->var_num * 4);;
+ gen_uni_skip (c->result, s, vars, 1, 0);
+
+ if (c->name == NAME_INT) {
+ printf (" if (in_remaining () < 4) { return -1;}\n");
+ printf (" eprintf (\" %%d\", fetch_int ());\n");
+ printf (" return 0;\n");
+ printf ("}\n");
+ return;
+ } else if (c->name == NAME_LONG) {
+ printf (" if (in_remaining () < 8) { return -1;}\n");
+ printf (" eprintf (\" %%"_PRINTF_INT64_"d\", fetch_long ());\n");
+ printf (" return 0;\n");
+ printf ("}\n");
+ return;
+ } else if (c->name == NAME_STRING) {
+ printf (" static char buf[1 << 22];\n");
+ printf (" int l = prefetch_strlen ();\n");
+ printf (" if (l < 0 || (l >= (1 << 22) - 2)) { return -1; }\n");
+ printf (" memcpy (buf, fetch_str (l), l);\n");
+ printf (" buf[l] = 0;\n");
+ printf (" print_escaped_string (buf, l);\n");
+ printf (" return 0;\n");
+ printf ("}\n");
+ return;
+ } else if (c->name == NAME_DOUBLE) {
+ printf (" if (in_remaining () < 8) { return -1;}\n");
+ printf (" eprintf (\" %%lf\", fetch_double ());\n");
+ printf (" return 0;\n");
+ printf ("}\n");
+ return;
+ }
+
+ assert (c->result->methods->type (c->result) == NODE_TYPE_TYPE);
+ int empty = is_empty (((struct tl_tree_type *)c->result)->type);
+ if (!empty) {
+ printf (" eprintf (\" %s\");\n", c->id);
+ printf (" if (multiline_output >= 2) { eprintf (\"\\n\"); }\n");
+ }
+
+
+ for (i = 0; i < c->args_num; i++) if (!(c->args[i]->flags & FLAG_OPT_VAR)) {
+ assert (gen_field_fetch (c->args[i], vars, i + 1, empty) >= 0);
+ }
+ free (vars);
+ printf (" return 0;\n");
+ printf ("}\n");
+}
+
+void gen_constructor_store (struct tl_combinator *c) {
+ printf ("int store_constructor_%s (struct paramed_type *T) {\n", c->print_id);
+ int i;
+ for (i = 0; i < c->args_num; i++) if (c->args[i]->flags & FLAG_EXCL) {
+ printf (" return -1;\n");
+ printf ("}\n");
+ return;
+ }
+ static char s[10000];
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ sprintf_s (s, 10000, "T");
+#else
+ sprintf (s, "T");
+#endif
+
+ int *vars = malloc0 (c->var_num * 4);;
+ assert (c->var_num <= 10);
+ gen_uni_skip (c->result, s, vars, 1, 0);
+
+ if (c->name == NAME_INT) {
+ printf (" if (is_int ()) {\n");
+ printf (" out_int (get_int ());\n");
+ printf (" local_next_token ();\n");
+ printf (" return 0;\n");
+ printf (" } else {\n");
+ printf (" return -1;\n");
+ printf (" }\n");
+ printf ("}\n");
+ return;
+ } else if (c->name == NAME_LONG) {
+ printf (" if (is_int ()) {\n");
+ printf (" out_long (get_int ());\n");
+ printf (" local_next_token ();\n");
+ printf (" return 0;\n");
+ printf (" } else {\n");
+ printf (" return -1;\n");
+ printf (" }\n");
+ printf ("}\n");
+ return;
+ } else if (c->name == NAME_STRING) {
+ printf (" if (cur_token_len >= 0) {\n");
+ printf (" out_cstring (cur_token, cur_token_len);\n");
+ printf (" local_next_token ();\n");
+ printf (" return 0;\n");
+ printf (" } else {\n");
+ printf (" return -1;\n");
+ printf (" }\n");
+ printf ("}\n");
+ return;
+ } else if (c->name == NAME_DOUBLE) {
+ printf (" if (is_double ()) {\n");
+ printf (" out_double (get_double());\n");
+ printf (" local_next_token ();\n");
+ printf (" return 0;\n");
+ printf (" } else {\n");
+ printf (" return -1;\n");
+ printf (" }\n");
+ printf ("}\n");
+ return;
+ }
+
+ int empty = is_empty (((struct tl_tree_type *)c->result)->type);
+ for (i = 0; i < c->args_num; i++) if (!(c->args[i]->flags & FLAG_OPT_VAR)) {
+ assert (gen_field_store (c->args[i], vars, i + 1, 0, empty) >= 0);
+ }
+
+ free (vars);
+ printf (" return 0;\n");
+ printf ("}\n");
+}
+
+void gen_constructor_autocomplete (struct tl_combinator *c) {
+ printf ("int autocomplete_constructor_%s (struct paramed_type *T) {\n", c->print_id);
+ int i;
+ for (i = 0; i < c->args_num; i++) if (c->args[i]->flags & FLAG_EXCL) {
+ printf (" return -1;\n");
+ printf ("}\n");
+ return;
+ }
+ static char s[10000];
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ sprintf_s (s, 10000, "T");
+#else
+ sprintf (s, "T");
+#endif
+
+ int *vars = malloc0 (c->var_num * 4);;
+ assert (c->var_num <= 10);
+ gen_uni_skip (c->result, s, vars, 1, 0);
+
+ if (c->name == NAME_INT) {
+ printf (" if (is_int ()) {\n");
+ printf (" local_next_token ();\n");
+ printf (" return 0;\n");
+ printf (" } else {\n");
+ printf (" return -1;\n");
+ printf (" }\n");
+ printf ("}\n");
+ return;
+ } else if (c->name == NAME_LONG) {
+ printf (" if (is_int ()) {\n");
+ printf (" local_next_token ();\n");
+ printf (" return 0;\n");
+ printf (" } else {\n");
+ printf (" return -1;\n");
+ printf (" }\n");
+ printf ("}\n");
+ return;
+ } else if (c->name == NAME_STRING) {
+ printf (" if (cur_token_len >= 0) {\n");
+ printf (" local_next_token ();\n");
+ printf (" return 0;\n");
+ printf (" } else {\n");
+ printf (" return -1;\n");
+ printf (" }\n");
+ printf ("}\n");
+ return;
+ } else if (c->name == NAME_DOUBLE) {
+ printf (" if (is_double ()) {\n");
+ printf (" local_next_token ();\n");
+ printf (" return 0;\n");
+ printf (" } else {\n");
+ printf (" return -1;\n");
+ printf (" }\n");
+ printf ("}\n");
+ return;
+ }
+
+ int empty = is_empty (((struct tl_tree_type *)c->result)->type);
+ for (i = 0; i < c->args_num; i++) if (!(c->args[i]->flags & FLAG_OPT_VAR)) {
+ assert (gen_field_autocomplete (c->args[i], vars, i + 1, 0, empty) >= 0);
+ }
+
+ free (vars);
+ printf (" return 0;\n");
+ printf ("}\n");
+}
+
+void gen_constructor_fetch_ds (struct tl_combinator *c) {
+ print_c_type_name (c->result, "", 0);
+ printf ("fetch_ds_constructor_%s (struct paramed_type *T) {\n", c->print_id);
+ int i;
+ for (i = 0; i < c->args_num; i++) if (c->args[i]->flags & FLAG_EXCL) {
+ printf (" assert (0);\n");
+ printf ("}\n");
+ return;
+ }
+ static char s[10000];
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ sprintf_s (s, 10000, "T");
+#else
+ sprintf (s, "T");
+#endif
+
+ int *vars = malloc0 (c->var_num * 4);;
+ gen_uni_skip (c->result, s, vars, 1, 1);
+
+ printf (" ");
+ print_c_type_name (c->result, " ", 0);
+ printf (" result = talloc0 (sizeof (*result));\n");
+
+ struct tl_type *T = ((struct tl_tree_type *)c->result)->type;
+ if (T->constructors_num > 1) {
+ printf (" result->magic = 0x%08x;\n", c->name);
+ }
+
+ if (c->name == NAME_INT) {
+ printf (" assert (in_remaining () >= 4);\n");
+ printf (" *result = fetch_int ();\n");
+ printf (" return result;\n");
+ printf ("}\n");
+ return;
+ } else if (c->name == NAME_LONG) {
+ printf (" assert (in_remaining () >= 8);\n");
+ printf (" *result = fetch_long ();\n");
+ printf (" return result;\n");
+ printf ("}\n");
+ return;
+ } else if (c->name == NAME_STRING || c->name == NAME_BYTES) {
+ printf (" assert (in_remaining () >= 4);\n");
+ printf (" int l = prefetch_strlen ();\n");
+ printf (" assert (l >= 0);\n");
+ printf (" result->len = l;\n");
+ printf (" result->data = talloc (l + 1);\n");
+ printf (" result->data[l] = 0;\n");
+ printf (" memcpy (result->data, fetch_str (l), l);\n");
+ printf (" return result;\n");
+ printf ("}\n");
+ return;
+ } else if (c->name == NAME_DOUBLE) {
+ printf (" assert (in_remaining () >= 8);\n");
+ printf (" *result = fetch_double ();\n");
+ printf (" return result;\n");
+ printf ("}\n");
+ return;
+ }
+
+ assert (c->result->methods->type (c->result) == NODE_TYPE_TYPE);
+ int empty = is_empty (((struct tl_tree_type *)c->result)->type);
+
+ for (i = 0; i < c->args_num; i++) if (!(c->args[i]->flags & FLAG_OPT_VAR)) {
+ assert (gen_field_fetch_ds (c->args[i], vars, i + 1, empty) >= 0);
+ }
+ free (vars);
+ printf (" return result;\n");
+ printf ("}\n");
+}
+
+void gen_constructor_free_ds (struct tl_combinator *c) {
+ printf ("void free_ds_constructor_%s (", c->print_id);
+ print_c_type_name (c->result, "", 0);
+ printf ("D, struct paramed_type *T) {\n");
+ int i;
+ for (i = 0; i < c->args_num; i++) if (c->args[i]->flags & FLAG_EXCL) {
+ printf (" assert (0);\n");
+ printf ("}\n");
+ return;
+ }
+
+ static char s[10000];
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ sprintf_s (s, 10000, "T");
+#else
+ sprintf (s, "T");
+#endif
+
+ int *vars = malloc0 (c->var_num * 4);;
+ gen_uni_skip (c->result, s, vars, 1, -1);
+
+ //printf (" ");
+ //print_c_type_name (c->result, " ", 0);
+ //printf (" result = talloc0 (sizeof (*result));\n");
+
+ //struct tl_type *T = ((struct tl_tree_type *)c->result)->type;
+
+ if (c->name == NAME_INT) {
+ printf (" tfree (D, sizeof (*D));\n");
+ printf ("}\n");
+ return;
+ } else if (c->name == NAME_LONG) {
+ printf (" tfree (D, sizeof (*D));\n");
+ printf ("}\n");
+ return;
+ } else if (c->name == NAME_STRING || c->name == NAME_BYTES) {
+ printf (" tfree (D->data, D->len + 1);\n");
+ printf (" tfree (D, sizeof (*D));\n");
+ printf ("}\n");
+ return;
+ } else if (c->name == NAME_DOUBLE) {
+ printf (" tfree (D, sizeof (*D));\n");
+ printf ("}\n");
+ return;
+ }
+
+ assert (c->result->methods->type (c->result) == NODE_TYPE_TYPE);
+ int empty = is_empty (((struct tl_tree_type *)c->result)->type);
+
+ for (i = 0; i < c->args_num; i++) if (!(c->args[i]->flags & FLAG_OPT_VAR)) {
+ assert (gen_field_free_ds (c->args[i], vars, i + 1, empty) >= 0);
+ }
+ free (vars);
+ printf ("}\n");
+}
+
+void gen_constructor_store_ds (struct tl_combinator *c) {
+ printf ("void store_ds_constructor_%s (", c->print_id);
+ print_c_type_name (c->result, "", 0);
+ printf ("D, struct paramed_type *T) {\n");
+ int i;
+ for (i = 0; i < c->args_num; i++) if (c->args[i]->flags & FLAG_EXCL) {
+ printf (" assert (0);\n");
+ printf ("}\n");
+ return;
+ }
+
+ static char s[10000];
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ sprintf_s (s, 10000, "T");
+#else
+ sprintf (s, "T");
+#endif
+
+ int *vars = malloc0 (c->var_num * 4);;
+ gen_uni_skip (c->result, s, vars, 1, -1);
+
+ //printf (" ");
+ //print_c_type_name (c->result, " ", 0);
+ //printf (" result = talloc0 (sizeof (*result));\n");
+
+ //struct tl_type *T = ((struct tl_tree_type *)c->result)->type;
+
+ if (c->name == NAME_INT) {
+ printf (" out_int (*D);\n");
+ printf ("}\n");
+ return;
+ } else if (c->name == NAME_LONG) {
+ printf (" out_long (*D);\n");
+ printf ("}\n");
+ return;
+ } else if (c->name == NAME_STRING || c->name == NAME_BYTES) {
+ printf (" out_cstring (D->data, D->len);\n");
+ printf ("}\n");
+ return;
+ } else if (c->name == NAME_DOUBLE) {
+ printf (" out_double (*D);\n");
+ printf ("}\n");
+ return;
+ }
+
+ assert (c->result->methods->type (c->result) == NODE_TYPE_TYPE);
+ int empty = is_empty (((struct tl_tree_type *)c->result)->type);
+
+ for (i = 0; i < c->args_num; i++) if (!(c->args[i]->flags & FLAG_OPT_VAR)) {
+ assert (gen_field_store_ds (c->args[i], vars, i + 1, empty) >= 0);
+ }
+ free (vars);
+ printf ("}\n");
+}
+
+void gen_constructor_print_ds (struct tl_combinator *c) {
+ printf ("int print_ds_constructor_%s (", c->print_id);
+ print_c_type_name (c->result, "", 0);
+ printf ("DS, struct paramed_type *T) {\n");
+ int i;
+ for (i = 0; i < c->args_num; i++) if (c->args[i]->flags & FLAG_EXCL) {
+ printf (" return -1;\n");
+ printf ("}\n");
+ return;
+ }
+ static char s[10000];
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ sprintf_s (s, 10000, "T");
+#else
+ sprintf (s, "T");
+#endif
+
+ int *vars = malloc0 (c->var_num * 4);;
+ gen_uni_skip (c->result, s, vars, 1, 0);
+
+ if (c->name == NAME_INT) {
+ printf (" eprintf (\" %%d\", *DS);\n");
+ printf (" return 0;\n");
+ printf ("}\n");
+ return;
+ } else if (c->name == NAME_LONG) {
+ printf (" eprintf (\" %%"_PRINTF_INT64_"d\", *DS);\n");
+ printf (" return 0;\n");
+ printf ("}\n");
+ return;
+ } else if (c->name == NAME_STRING || c->name == NAME_BYTES) {
+ printf (" print_escaped_string (DS->data, DS->len);\n");
+ printf (" return 0;\n");
+ printf ("}\n");
+ return;
+ } else if (c->name == NAME_DOUBLE) {
+ printf (" eprintf (\" %%lf\", *DS);\n");
+ printf (" return 0;\n");
+ printf ("}\n");
+ return;
+ }
+
+ assert (c->result->methods->type (c->result) == NODE_TYPE_TYPE);
+ int empty = is_empty (((struct tl_tree_type *)c->result)->type);
+ if (!empty) {
+ printf (" eprintf (\" %s\");\n", c->id);
+ printf (" if (multiline_output >= 2) { eprintf (\"\\n\"); }\n");
+ }
+
+
+ for (i = 0; i < c->args_num; i++) if (!(c->args[i]->flags & FLAG_OPT_VAR)) {
+ assert (gen_field_print_ds (c->args[i], vars, i + 1, empty) >= 0);
+ }
+ free (vars);
+ printf (" return 0;\n");
+ printf ("}\n");
+}
+
+void gen_type_skip (struct tl_type *t) {
+ printf ("int skip_type_%s (struct paramed_type *T) {\n", t->print_id);
+ printf (" if (in_remaining () < 4) { return -1;}\n");
+ printf (" int magic = fetch_int ();\n");
+ printf (" switch (magic) {\n");
+ int i;
+ for (i = 0; i < t->constructors_num; i++) {
+ printf (" case 0x%08x: return skip_constructor_%s (T);\n", t->constructors[i]->name, t->constructors[i]->print_id);
+ }
+ printf (" default: return -1;\n");
+ printf (" }\n");
+ printf ("}\n");
+ printf ("int skip_type_bare_%s (struct paramed_type *T) {\n", t->print_id);
+ if (t->constructors_num > 1) {
+ printf (" int *save_in_ptr = in_ptr;\n");
+ for (i = 0; i < t->constructors_num; i++) {
+ printf (" if (skip_constructor_%s (T) >= 0) { return 0; }\n", t->constructors[i]->print_id);
+ printf (" in_ptr = save_in_ptr;\n");
+ }
+ } else {
+ for (i = 0; i < t->constructors_num; i++) {
+ printf (" if (skip_constructor_%s (T) >= 0) { return 0; }\n", t->constructors[i]->print_id);
+ }
+ }
+ printf (" return -1;\n");
+ printf ("}\n");
+}
+
+void gen_type_fetch (struct tl_type *t) {
+ int empty = is_empty (t);;
+ printf ("int fetch_type_%s (struct paramed_type *T) {\n", t->print_id);
+ printf (" if (in_remaining () < 4) { return -1;}\n");
+ if (!empty) {
+ printf (" if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }\n");
+ printf (" eprintf (\" (\");\n");
+ }
+ printf (" int magic = fetch_int ();\n");
+ printf (" int res = -1;\n");
+ printf (" switch (magic) {\n");
+ int i;
+ for (i = 0; i < t->constructors_num; i++) {
+ printf (" case 0x%08x: res = fetch_constructor_%s (T); break;\n", t->constructors[i]->name, t->constructors[i]->print_id);
+ }
+ printf (" default: return -1;\n");
+ printf (" }\n");
+ if (!empty) {
+ printf (" if (res >= 0) {\n");
+ printf (" if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }\n");
+ printf (" eprintf (\" )\");\n");
+ //printf (" if (multiline_output >= 2) { printf (\"\\n\"); }\n");
+ printf (" }\n");
+ }
+ printf (" return res;\n");
+ printf ("}\n");
+ printf ("int fetch_type_bare_%s (struct paramed_type *T) {\n", t->print_id);
+ if (t->constructors_num > 1) {
+ printf (" int *save_in_ptr = in_ptr;\n");
+
+ if (!empty) {
+ printf (" if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }\n");
+ }
+ for (i = 0; i < t->constructors_num; i++) {
+ printf (" if (skip_constructor_%s (T) >= 0) { in_ptr = save_in_ptr; %sassert (!fetch_constructor_%s (T)); %sreturn 0; }\n", t->constructors[i]->print_id, empty ? "" : "eprintf (\" (\"); ", t->constructors[i]->print_id , empty ? "" : "if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (\" )\");");
+ printf (" in_ptr = save_in_ptr;\n");
+ }
+ } else {
+ for (i = 0; i < t->constructors_num; i++) {
+ if (!empty) {
+ printf (" if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }\n");
+ printf (" eprintf (\" (\");\n");
+ }
+ printf (" if (fetch_constructor_%s (T) >= 0) { %sreturn 0; }\n", t->constructors[i]->print_id, empty ? "" : "if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); } eprintf (\" )\");" );
+ }
+ }
+ printf (" return -1;\n");
+ printf ("}\n");
+}
+
+void gen_type_store (struct tl_type *t) {
+ int empty = is_empty (t);;
+ int k = 0;
+ for (k = 0; k < 2; k++) {
+ printf ("int store_type_%s%s (struct paramed_type *T) {\n", k == 0 ? "" : "bare_", t->print_id);
+ if (empty) {
+ if (!k) {
+ printf (" out_int (0x%08x);\n", t->constructors[0]->name);
+ }
+ printf (" if (store_constructor_%s (T) < 0) { return -1; }\n", t->constructors[0]->print_id);
+ printf (" return 0;\n");
+ printf ("}\n");
+ } else {
+ printf (" expect_token (\"(\", 1);\n");
+ printf (" if (cur_token_len < 0) { return -1; }\n");
+ printf (" if (cur_token_len < 0) { return -1; }\n");
+ int i;
+ for (i = 0; i < t->constructors_num; i++) {
+ printf (" if (cur_token_len == %d && !memcmp (cur_token, \"%s\", cur_token_len)) {\n", (int)strlen (t->constructors[i]->id), t->constructors[i]->id);
+ if (!k) {
+ printf (" out_int (0x%08x);\n", t->constructors[i]->name);
+ }
+ printf (" local_next_token ();\n");
+ printf (" if (store_constructor_%s (T) < 0) { return -1; }\n", t->constructors[i]->print_id);
+ printf (" expect_token (\")\", 1);\n");
+ printf (" return 0;\n");
+ printf (" }\n");
+ }
+ /*if (t->constructors_num == 1) {
+ printf (" if (!force) {\n");
+ if (!k) {
+ printf (" out_int (0x%08x);\n", t->constructors[0]->name);
+ }
+ printf (" if (store_constructor_%s (T) < 0) { return -1; }\n", t->constructors[0]->print_id);
+ printf (" expect_token (\")\", 1);\n");
+ printf (" return 0;\n");
+ printf (" }\n");
+ }*/
+ printf (" return -1;\n");
+ printf ("}\n");
+ }
+ }
+}
+
+void gen_type_autocomplete (struct tl_type *t) {
+ int empty = is_empty (t);;
+ int k = 0;
+ for (k = 0; k < 2; k++) {
+ printf ("int autocomplete_type_%s%s (struct paramed_type *T) {\n", k == 0 ? "" : "bare_", t->print_id);
+ if (empty) {
+ printf (" if (autocomplete_constructor_%s (T) < 0) { return -1; }\n", t->constructors[0]->print_id);
+ printf (" return 0;\n");
+ printf ("}\n");
+ } else {
+ printf (" expect_token_autocomplete (\"(\", 1);\n");
+ printf (" if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_type_%s); return -1; }\n", t->print_id);
+ printf (" if (cur_token_len < 0) { return -1; }\n");
+ int i;
+ for (i = 0; i < t->constructors_num; i++) {
+ printf (" if (cur_token_len == %d && !memcmp (cur_token, \"%s\", cur_token_len)) {\n", (int)strlen (t->constructors[i]->id), t->constructors[i]->id);
+ printf (" local_next_token ();\n");
+ printf (" if (autocomplete_constructor_%s (T) < 0) { return -1; }\n", t->constructors[i]->print_id);
+ printf (" expect_token_autocomplete (\")\", 1);\n");
+ printf (" return 0;\n");
+ printf (" }\n");
+ }
+ /*if (t->constructors_num == 1) {
+ printf (" if (!force) {\n");
+ printf (" if (autocomplete_constructor_%s (T) < 0) { return -1; }\n", t->constructors[0]->print_id);
+ printf (" expect_token_autocomplete (\")\", 1);\n");
+ printf (" return 0;\n");
+ printf (" }\n");
+ }*/
+ printf (" return -1;\n");
+ printf ("}\n");
+ }
+ }
+}
+
+void gen_type_fetch_ds (struct tl_type *t) {
+ //int empty = is_empty (t);;
+ print_c_type_name (t->constructors[0]->result, "", 0);
+
+ printf ("fetch_ds_type_%s (struct paramed_type *T) {\n", t->print_id);
+ printf (" assert (in_remaining () >= 4);\n");
+ printf (" int magic = fetch_int ();\n");
+ printf (" switch (magic) {\n");
+ int i;
+ for (i = 0; i < t->constructors_num; i++) {
+ printf (" case 0x%08x: return fetch_ds_constructor_%s (T); break;\n", t->constructors[i]->name, t->constructors[i]->print_id);
+ }
+ printf (" default: assert (0); return NULL;\n");
+ printf (" }\n");
+ printf ("}\n");
+ print_c_type_name (t->constructors[0]->result, "", 0);
+ printf ("fetch_ds_type_bare_%s (struct paramed_type *T) {\n", t->print_id);
+ if (t->constructors_num > 1) {
+ printf (" int *save_in_ptr = in_ptr;\n");
+
+ for (i = 0; i < t->constructors_num; i++) {
+ printf (" if (skip_constructor_%s (T) >= 0) { in_ptr = save_in_ptr; return fetch_ds_constructor_%s (T); }\n", t->constructors[i]->print_id, t->constructors[i]->print_id);
+ }
+ } else {
+ printf (" return fetch_ds_constructor_%s (T);\n", t->constructors[0]->print_id);
+ }
+ printf (" assert (0);\n");
+ printf (" return NULL;\n");
+ printf ("}\n");
+}
+
+void gen_type_free_ds (struct tl_type *t) {
+ printf ("void free_ds_type_%s (", t->print_id);
+ print_c_type_name (t->constructors[0]->result, "", 0);
+ printf ("D, struct paramed_type *T) {\n");
+
+ if (t->constructors_num > 1) {
+ printf (" switch (D->magic) {\n");
+ int i;
+ for (i = 0; i < t->constructors_num; i++) {
+ printf (" case 0x%08x: free_ds_constructor_%s (D, T); return; \n", t->constructors[i]->name, t->constructors[i]->print_id);
+ }
+ printf (" default: assert (0);\n");
+ printf (" }\n");
+ } else {
+ printf (" free_ds_constructor_%s (D, T); return; \n", t->constructors[0]->print_id);
+ }
+ printf ("}\n");
+}
+
+void gen_type_store_ds (struct tl_type *t) {
+ int k;
+ for (k = 0; k < 2; k++) {
+ if (k == 0) {
+ printf ("void store_ds_type_%s (", t->print_id);
+ } else {
+ printf ("void store_ds_type_bare_%s (", t->print_id);
+ }
+ print_c_type_name (t->constructors[0]->result, "", 0);
+ printf ("D, struct paramed_type *T) {\n");
+
+ if (t->constructors_num > 1) {
+ if (k == 0) {
+ printf (" out_int (D->magic);\n");
+ }
+ printf (" switch (D->magic) {\n");
+ int i;
+ for (i = 0; i < t->constructors_num; i++) {
+ printf (" case 0x%08x: store_ds_constructor_%s (D, T); return; \n", t->constructors[i]->name, t->constructors[i]->print_id);
+ }
+ printf (" default: assert (0);\n");
+ printf (" }\n");
+ } else {
+ if (k == 0) {
+ printf (" out_int (0x%08x);\n", t->constructors[0]->name);
+ }
+ printf (" store_ds_constructor_%s (D, T); return; \n", t->constructors[0]->print_id);
+ }
+ printf ("}\n");
+ }
+}
+
+void gen_type_print_ds (struct tl_type *t) {
+ int empty = is_empty (t);;
+ int k;
+ for (k = 0; k < 2; k++) {
+ printf ("int print_ds_type_%s%s (", k ? "bare_" : "", t->print_id);
+ print_c_type_name (t->constructors[0]->result, "", 0);
+ printf ("DS, struct paramed_type *T) {\n");
+ printf (" int res;\n");
+ if (!empty) {
+ printf (" if (multiline_output >= 2) { multiline_offset += multiline_offset_size; }\n");
+ printf (" eprintf (\" (\");\n");
+ }
+ if (t->constructors_num > 1) {
+ printf (" switch (DS->magic) {\n");
+ int i;
+ for (i = 0; i < t->constructors_num; i++) {
+ printf (" case 0x%08x: res = print_ds_constructor_%s (DS, T); break;\n", t->constructors[i]->name, t->constructors[i]->print_id);
+ }
+ printf (" default: return -1;\n");
+ printf (" }\n");
+ } else {
+ printf (" res = print_ds_constructor_%s (DS, T);\n", t->constructors[0]->print_id);
+ }
+ if (!empty) {
+ printf (" if (res >= 0) {\n");
+ printf (" if (multiline_output >= 2) { multiline_offset -= multiline_offset_size; print_offset (); }\n");
+ printf (" eprintf (\" )\");\n");
+ //printf (" if (multiline_output >= 2) { printf (\"\\n\"); }\n");
+ printf (" }\n");
+ }
+ printf (" return res;\n");
+ printf ("}\n");
+ }
+}
+
+void gen_function_store (struct tl_combinator *f) {
+ printf ("struct paramed_type *store_function_%s (void) {\n", f->print_id);
+ int i;
+
+ int *vars = malloc0 (f->var_num * 4);;
+ assert (f->var_num <= 10);
+
+ for (i = 0; i < f->args_num; i++) if (!(f->args[i]->flags & FLAG_OPT_VAR)) {
+ if (f->args[i]->flags & FLAG_EXCL) {
+ assert (gen_field_store_excl (f->args[i], vars, i + 1, 1) >= 0);
+ } else {
+ assert (gen_field_store (f->args[i], vars, i + 1, 1, 0) >= 0);
+ }
+ }
+
+
+ printf (" struct paramed_type *R = \n");
+ assert (gen_create (f->result, vars, 2) >= 0);
+ printf (";\n");
+
+ free (vars);
+ printf (" return paramed_type_dup (R);\n");
+ printf ("}\n");
+}
+
+void gen_function_autocomplete (struct tl_combinator *f) {
+ printf ("struct paramed_type *autocomplete_function_%s (void) {\n", f->print_id);
+ int i;
+
+ int *vars = malloc0 (f->var_num * 4);;
+ assert (f->var_num <= 10);
+
+ for (i = 0; i < f->args_num; i++) if (!(f->args[i]->flags & FLAG_OPT_VAR)) {
+ if (f->args[i]->flags & FLAG_EXCL) {
+ assert (gen_field_autocomplete_excl (f->args[i], vars, i + 1, 1) >= 0);
+ } else {
+ assert (gen_field_autocomplete (f->args[i], vars, i + 1, 1, 0) >= 0);
+ }
+ }
+
+ printf (" struct paramed_type *R = \n");
+ assert (gen_create (f->result, vars, 2) >= 0);
+ printf (";\n");
+
+ free (vars);
+ printf (" return paramed_type_dup (R);\n");
+ printf ("}\n");
+}
+
+void gen_type_do_autocomplete (struct tl_type *t) {
+ printf ("int do_autocomplete_type_%s (const char *text, int text_len, int index, char **R) {\n", t->print_id);
+ printf (" index ++;\n");
+ int i;
+ for (i = 0; i < t->constructors_num; i++) {
+ printf (" if (index == %d) { if (!strncmp (text, \"%s\", text_len)) { *R = tstrdup (\"%s\"); return index; } else { index ++; }}\n", i, t->constructors[i]->id, t->constructors[i]->id);
+ }
+ printf (" *R = 0;\n");
+ printf (" return 0;\n");
+ printf ("}\n");
+}
+
+struct tl_tree *read_num_var (int *var_num) {
+ struct tl_tree_var_num *T = malloc0 (sizeof (*T));
+ T->self.flags = 0;
+ T->self.methods = &tl_pvar_num_methods;;
+ T->dif = get_int ();
+ T->var_num = get_int ();
+
+ if (T->var_num >= *var_num) {
+ *var_num = T->var_num + 1;
+ }
+ assert (!(T->self.flags & FLAG_NOVAR));
+ return (void *)T;
+}
+
+struct tl_tree *read_type_var (int *var_num) {
+ struct tl_tree_var_type *T = malloc0 (sizeof (*T));
+ T->self.methods = &tl_pvar_type_methods;
+ T->var_num = get_int ();
+ T->self.flags = get_int ();
+ if (T->var_num >= *var_num) {
+ *var_num = T->var_num + 1;
+ }
+ assert (!(T->self.flags & (FLAG_NOVAR | FLAG_BARE)));
+ return (void *)T;
+}
+
+struct tl_tree *read_array (int *var_num) {
+ struct tl_tree_array *T = malloc0 (sizeof (*T));
+ T->self.methods = &tl_parray_methods;
+ T->self.flags = 0;
+ T->multiplicity = read_nat_expr (var_num);
+ assert (T->multiplicity);
+
+ T->args_num = get_int ();
+ assert (T->args_num >= 0 && T->args_num <= 1000);
+ T->args = malloc0 (sizeof (void *) * T->args_num);
+
+ assert (read_args_list (T->args, T->args_num, var_num) >= 0);
+ T->self.flags |= FLAG_NOVAR;
+ int i;
+ for (i = 0; i < T->args_num; i++) {
+ if (!(T->args[i]->flags & FLAG_NOVAR)) {
+ T->self.flags &= ~FLAG_NOVAR;
+ }
+ }
+ return (void *)T;
+}
+
+struct tl_tree *read_type (int *var_num) {
+ struct tl_tree_type *T = malloc0 (sizeof (*T));
+ T->self.methods = &tl_ptype_methods;
+
+ T->type = tl_type_get_by_name (get_int ());
+ assert (T->type);
+ T->self.flags = get_int ();
+ T->children_num = get_int ();
+ assert (T->type->arity == T->children_num);
+ T->children = malloc0 (sizeof (void *) * T->children_num);
+ int i;
+ T->self.flags |= FLAG_NOVAR;
+ for (i = 0; i < T->children_num; i++) {
+ int t = get_int ();
+ if (t == (int)TLS_EXPR_NAT) {
+#ifdef _MSC_VER
+ assert ((T->type->params_types & (1i64 << i)));
+#else
+ assert ((T->type->params_types & (1 << i)));
+#endif
+ T->children[i] = read_nat_expr (var_num);
+ } else if (t == (int)TLS_EXPR_TYPE) {
+#ifdef _MSC_VER
+ assert (!(T->type->params_types & (1i64 << i)));
+#else
+ assert (!(T->type->params_types & (1 << i)));
+#endif
+ T->children[i] = read_type_expr (var_num);
+ } else {
+ assert (0);
+ }
+ if (!TL_IS_NAT_VAR (T->children[i]) && !(T->children[i]->flags & FLAG_NOVAR)) {
+ T->self.flags &= ~FLAG_NOVAR;
+ }
+ }
+ return (void *)T;
+}
+
+struct tl_tree *read_tree (int *var_num) {
+ int x = get_int ();
+ if (verbosity >= 2) {
+ fprintf (stderr, "read_tree: constructor = 0x%08x\n", x);
+ }
+ switch (x) {
+ case TLS_TREE_NAT_CONST:
+ return read_num_const (var_num);
+ case TLS_TREE_NAT_VAR:
+ return read_num_var (var_num);
+ case TLS_TREE_TYPE_VAR:
+ return read_type_var (var_num);
+ case TLS_TREE_TYPE:
+ return read_type (var_num);
+ case TLS_TREE_ARRAY:
+ return read_array (var_num);
+ default:
+ if (verbosity) {
+ fprintf (stderr, "x = %d\n", x);
+ }
+ assert (0);
+ return 0;
+ }
+}
+
+struct tl_tree *read_type_expr (int *var_num) {
+ int x = get_int ();
+ if (verbosity >= 2) {
+ fprintf (stderr, "read_type_expr: constructor = 0x%08x\n", x);
+ }
+ switch (x) {
+ case TLS_TYPE_VAR:
+ return read_type_var (var_num);
+ case TLS_TYPE_EXPR:
+ return read_type (var_num);
+ case TLS_ARRAY:
+ return read_array (var_num);
+ default:
+ if (verbosity) {
+ fprintf (stderr, "x = %d\n", x);
+ }
+ assert (0);
+ return 0;
+ }
+}
+
+struct tl_tree *read_nat_expr (int *var_num) {
+ int x = get_int ();
+ if (verbosity >= 2) {
+ fprintf (stderr, "read_nat_expr: constructor = 0x%08x\n", x);
+ }
+ switch (x) {
+ case TLS_NAT_CONST:
+ return read_num_const (var_num);
+ case TLS_NAT_VAR:
+ return read_num_var (var_num);
+ default:
+ if (verbosity) {
+ fprintf (stderr, "x = %d\n", x);
+ }
+ assert (0);
+ return 0;
+ }
+}
+
+struct tl_tree *read_expr (int *var_num) {
+ int x = get_int ();
+ if (verbosity >= 2) {
+ fprintf (stderr, "read_nat_expr: constructor = 0x%08x\n", x);
+ }
+ switch (x) {
+ case TLS_EXPR_NAT:
+ return read_nat_expr (var_num);
+ case TLS_EXPR_TYPE:
+ return read_type_expr (var_num);
+ default:
+ if (verbosity) {
+ fprintf (stderr, "x = %d\n", x);
+ }
+ assert (0);
+ return 0;
+ }
+}
+
+int read_args_list (struct arg **args, int args_num, int *var_num) {
+ int i;
+ for (i = 0; i < args_num; i++) {
+ args[i] = malloc0 (sizeof (struct arg));
+ args[i]->exist_var_num = -1;
+ args[i]->exist_var_bit = 0;
+ assert (get_int () == TLS_ARG_V2);
+ args[i]->id = get_string ();
+ args[i]->flags = get_int ();
+
+ if (args[i]->flags & 2) {
+ args[i]->flags &= ~2;
+ args[i]->flags |= (1 << 20);
+ }
+ if (args[i]->flags & 4) {
+ args[i]->flags &= ~4;
+ args[i]->var_num = get_int ();
+ } else {
+ args[i]->var_num = -1;
+ }
+
+ int x = args[i]->flags & 6;
+ args[i]->flags &= ~6;
+ if (x & 2) { args[i]->flags |= 4; }
+ if (x & 4) { args[i]->flags |= 2; }
+
+ if (args[i]->var_num >= *var_num) {
+ *var_num = args[i]->var_num + 1;
+ }
+ if (args[i]->flags & FLAG_OPT_FIELD) {
+ args[i]->exist_var_num = get_int ();
+ args[i]->exist_var_bit = get_int ();
+ }
+ args[i]->type = read_type_expr (var_num);
+ assert (args[i]->type);
+
+ if (args[i]->var_num < 0 && args[i]->exist_var_num < 0 && (TL_IS_NAT_VAR(args[i]->type) || (args[i]->type->flags & FLAG_NOVAR))) {
+ args[i]->flags |= FLAG_NOVAR;
+ }
+ }
+ return 1;
+}
+
+int read_combinator_args_list (struct tl_combinator *c) {
+ c->args_num = get_int ();
+ if (verbosity >= 2) {
+ fprintf (stderr, "c->id = %s, c->args_num = %d\n", c->id, c->args_num);
+ }
+ assert (c->args_num >= 0 && c->args_num <= 1000);
+ c->args = malloc0 (sizeof (void *) * c->args_num);
+ c->var_num = 0;
+ return read_args_list (c->args, c->args_num, &c->var_num);
+}
+
+int read_combinator_right (struct tl_combinator *c) {
+ assert (get_int () == TLS_COMBINATOR_RIGHT_V2);
+ c->result = read_type_expr (&c->var_num);
+ assert (c->result);
+ return 1;
+}
+
+int read_combinator_left (struct tl_combinator *c) {
+ int x = get_int ();
+
+ if (x == (int)TLS_COMBINATOR_LEFT_BUILTIN) {
+ c->args_num = 0;
+ c->var_num = 0;
+ c->args = 0;
+ return 1;
+ } else if (x == TLS_COMBINATOR_LEFT) {
+ return read_combinator_args_list (c);
+ } else {
+ assert (0);
+ return -1;
+ }
+}
+
+char *gen_print_id (const char *id) {
+ static char s[1000];
+ char *ptr = s;
+ int first = 1;
+ while (*id) {
+ if (*id == '.') {
+ *(ptr ++) = '_';
+ } else if (*id >= 'A' && *id <= 'Z') {
+ if (!first && *(ptr - 1) != '_') {
+ *(ptr ++) = '_';
+ }
+ *(ptr ++) = *id - 'A' + 'a';
+ } else {
+ *(ptr ++) = *id;
+ }
+ id ++;
+ first = 0;
+ }
+ *ptr = 0;
+ return s;
+}
+
+struct tl_combinator *read_combinators (int v) {
+ struct tl_combinator *c = malloc0 (sizeof (*c));
+ c->name = get_int ();
+ c->id = get_string ();
+ c->print_id = strdup (gen_print_id (c->id));
+ assert (c->print_id);
+ //char *s = c->id;
+ //while (*s) { if (*s == '.') { *s = '_'; } ; s ++;}
+ int x = get_int ();
+ struct tl_type *t = tl_type_get_by_name (x);
+ assert (t || (!x && v == 3));
+
+ if (v == 2) {
+ assert (t->extra < t->constructors_num);
+ t->constructors[t->extra ++] = c;
+ c->is_fun = 0;
+ } else {
+ assert (v == 3);
+ tl_function_insert_by_name (c);
+ c->is_fun = 1;
+ }
+ assert (read_combinator_left (c) >= 0);
+ assert (read_combinator_right (c) >= 0);
+ return c;
+}
+
+struct tl_type *read_types (void) {
+ struct tl_type *t = malloc0 (sizeof (*t));
+ t->name = get_int ();
+ t->id = get_string ();
+ t->print_id = strdup (gen_print_id (t->id));
+ assert (t->print_id);
+
+ t->constructors_num = get_int ();
+ assert (t->constructors_num >= 0 && t->constructors_num <= 1000);
+
+ t->constructors = malloc0 (sizeof (void *) * t->constructors_num);
+ t->flags = get_int ();
+ t->arity = get_int ();
+ t->params_types = get_long (); // params_types
+ t->extra = 0;
+ tl_type_insert_by_name (t);
+ return t;
+}
+
+
+
+char *gen_what[1000];
+int gen_what_cnt;
+
+
+void gen_skip_header (void) {
+ printf ("#ifdef _MSC_VER\n");
+ printf ("#include \"..\\auto.h\"\n");
+ printf ("#else\n");
+ printf ("#include \"auto.h\"\n");
+ printf ("#endif\n");
+ printf ("#include <assert.h>\n");
+
+ int i, j;
+ for (i = 0; i < tn; i++) {
+ for (j = 0; j < tps[i]->constructors_num; j ++) {
+ printf ("int skip_constructor_%s (struct paramed_type *T);\n", tps[i]->constructors[j]->print_id);
+ }
+ }
+ for (i = 0; i < tn; i++) if (tps[i]->id[0] != '#' && strcmp (tps[i]->id, "Type")) {
+ printf ("int skip_type_%s (struct paramed_type *T);\n", tps[i]->print_id);
+ printf ("int skip_type_bare_%s (struct paramed_type *T);\n", tps[i]->print_id);
+ }
+ printf ("int skip_type_any (struct paramed_type *T);\n");
+}
+
+void gen_skip_source (void) {
+ printf ("#ifdef _MSC_VER\n");
+ printf ("#include \"..\\auto.h\"\n");
+ printf ("#include \"auto-skip.h\"\n");
+ printf ("#include \"..\\auto-static-skip.c\"\n");
+ printf ("#include \"..\\mtproto-common.h\"\n");
+ printf ("#else\n");
+ printf ("#include \"auto.h\"\n");
+
+ printf ("#include \"auto/auto-skip.h\"\n");
+ printf ("#include \"auto-static-skip.c\"\n");
+ printf ("#include \"mtproto-common.h\"\n");
+ printf ("#endif\n");
+ printf ("#include <assert.h>\n");
+
+ int i, j;
+ for (i = 0; i < tn; i++) {
+ for (j = 0; j < tps[i]->constructors_num; j ++) {
+ gen_constructor_skip (tps[i]->constructors[j]);
+ }
+ }
+ for (i = 0; i < tn; i++) if (tps[i]->id[0] != '#' && strcmp (tps[i]->id, "Type")) {
+ gen_type_skip (tps[i]);
+ }
+ printf ("int skip_type_any (struct paramed_type *T) {\n");
+ printf (" switch (T->type->name) {\n");
+ for (i = 0; i < tn; i++) if (tps[i]->id[0] != '#' && strcmp (tps[i]->id, "Type") && tps[i]->name) {
+ printf (" case 0x%08x: return skip_type_%s (T);\n", tps[i]->name, tps[i]->print_id);
+ printf (" case 0x%08x: return skip_type_bare_%s (T);\n", ~tps[i]->name, tps[i]->print_id);
+ }
+ printf (" default: return -1; }\n");
+ printf ("}\n");
+}
+
+void gen_fetch_header (void) {
+ printf ("#ifdef _MSC_VER\n");
+ printf ("#include \"..\\auto.h\"\n");
+ printf ("#else\n");
+ printf ("#include \"auto.h\"\n");
+ printf ("#endif\n");
+ printf ("#include <assert.h>\n");
+ printf ("#include <stdio.h>\n");
+
+ printf ("struct tgl_state;\n");
+ printf ("char *tglf_extf_fetch (struct tgl_state *TLS, struct paramed_type *T);\n");
+
+ int i, j;
+ for (i = 0; i < tn; i++) {
+ for (j = 0; j < tps[i]->constructors_num; j ++) {
+ printf ("int fetch_constructor_%s (struct paramed_type *T);\n", tps[i]->constructors[j]->print_id);
+ }
+ }
+ for (i = 0; i < tn; i++) if (tps[i]->id[0] != '#' && strcmp (tps[i]->id, "Type")) {
+ printf ("int fetch_type_%s (struct paramed_type *T);\n", tps[i]->print_id);
+ printf ("int fetch_type_bare_%s (struct paramed_type *T);\n", tps[i]->print_id);
+ }
+ printf ("int fetch_type_any (struct paramed_type *T);\n");
+}
+
+void gen_fetch_source (void) {
+ printf ("#ifdef _MSC_VER \n");
+ printf ("#include \"..\\auto.h\"\n");
+ printf ("#include \"auto-fetch.h\"\n");
+ printf ("#include \"auto-skip.h\"\n");
+ printf ("#include \"..\\auto-static-fetch.c\"\n");
+ printf ("#include \"..\\mtproto-common.h\"\n");
+ printf ("#else\n");
+ printf ("#include \"auto.h\"\n");
+
+ printf ("#include \"auto/auto-fetch.h\"\n");
+ printf ("#include \"auto/auto-skip.h\"\n");
+ printf ("#include \"auto-static-fetch.c\"\n");
+ printf ("#include \"mtproto-common.h\"\n");
+ printf ("#endif\n");
+ printf ("#include <assert.h>\n");
+ int i, j;
+ for (i = 0; i < tn; i++) {
+ for (j = 0; j < tps[i]->constructors_num; j ++) {
+ gen_constructor_fetch (tps[i]->constructors[j]);
+ }
+ }
+ for (i = 0; i < tn; i++) if (tps[i]->id[0] != '#' && strcmp (tps[i]->id, "Type")) {
+ gen_type_fetch (tps[i]);
+ }
+ printf ("int fetch_type_any (struct paramed_type *T) {\n");
+ printf (" switch (T->type->name) {\n");
+ for (i = 0; i < tn; i++) if (tps[i]->id[0] != '#' && strcmp (tps[i]->id, "Type") && tps[i]->name) {
+ printf (" case 0x%08x: return fetch_type_%s (T);\n", tps[i]->name, tps[i]->print_id);
+ printf (" case 0x%08x: return fetch_type_bare_%s (T);\n", ~tps[i]->name, tps[i]->print_id);
+ }
+ printf (" default: return -1; }\n");
+ printf ("}\n");
+}
+
+void gen_store_header (void) {
+ printf ("#ifdef _MSC_VER\n");
+ printf ("#include \"..\\auto.h\"\n");
+ printf ("#else\n");
+ printf ("#include \"auto.h\"\n");
+ printf ("#endif\n");
+ printf ("#include <assert.h>\n");
+
+
+ printf ("struct paramed_type *tglf_extf_store (struct tgl_state *TLS, const char *data, int data_len);\n");
+ printf ("int tglf_store_type (struct tgl_state *TLS, const char *work, int work_len, struct paramed_type *P);\n");
+
+ int i, j;
+ for (i = 0; i < tn; i++) {
+ for (j = 0; j < tps[i]->constructors_num; j ++) {
+ printf ("int store_constructor_%s (struct paramed_type *T);\n", tps[i]->constructors[j]->print_id);
+ }
+ }
+ for (i = 0; i < tn; i++) if (tps[i]->id[0] != '#' && strcmp (tps[i]->id, "Type")) {
+ printf ("int store_type_%s (struct paramed_type *T);\n", tps[i]->print_id);
+ printf ("int store_type_bare_%s (struct paramed_type *T);\n", tps[i]->print_id);
+ }
+ for (i = 0; i < fn; i++) {
+ printf ("struct paramed_type *store_function_%s (void);\n", fns[i]->print_id);
+ }
+ printf ("int store_type_any (struct paramed_type *T);\n");
+ printf ("struct paramed_type *store_function_any (void);\n");
+}
+
+void gen_store_source (void ) {
+ printf ("#ifdef _MSC_VER\n");
+ printf ("#include \"..\\auto.h\"\n");
+ printf ("#include \"..\\mtproto-common.h\"\n");
+ printf ("#include \"auto-store.h\"\n");
+ printf ("#include \"..\\auto-static-store.c\"\n");
+ printf ("#else\n");
+ printf ("#include \"auto.h\"\n");
+
+ printf ("#include \"mtproto-common.h\"\n");
+ printf ("#include \"auto/auto-store.h\"\n");
+ printf ("#include \"auto-static-store.c\"\n");
+ printf ("#endif\n");
+ printf ("#include <assert.h>\n");
+
+ int i, j;
+ for (i = 0; i < tn; i++) {
+ for (j = 0; j < tps[i]->constructors_num; j ++) {
+ gen_constructor_store (tps[i]->constructors[j]);
+ }
+ }
+ for (i = 0; i < tn; i++) if (tps[i]->id[0] != '#' && strcmp (tps[i]->id, "Type")) {
+ gen_type_store (tps[i]);
+ }
+ for (i = 0; i < fn; i++) {
+ gen_function_store (fns[i]);
+ }
+ printf ("int store_type_any (struct paramed_type *T) {\n");
+ printf (" switch (T->type->name) {\n");
+ for (i = 0; i < tn; i++) if (tps[i]->id[0] != '#' && strcmp (tps[i]->id, "Type") && tps[i]->name) {
+ printf (" case 0x%08x: return store_type_%s (T);\n", tps[i]->name, tps[i]->print_id);
+ printf (" case 0x%08x: return store_type_bare_%s (T);\n", ~tps[i]->name, tps[i]->print_id);
+ }
+ printf (" default: return -1; }\n");
+ printf ("}\n");
+ printf ("struct paramed_type *store_function_any (void) {\n");
+ printf (" if (cur_token_len != 1 || *cur_token != '(') { return 0; }\n");
+ printf (" local_next_token ();\n");
+ printf (" if (cur_token_len == 1 || *cur_token == '.') { \n");
+ printf (" local_next_token ();\n");
+ printf (" if (cur_token_len != 1 || *cur_token != '=') { return 0; }\n");
+ printf (" local_next_token ();\n");
+ printf (" };\n");
+ printf (" if (cur_token_len < 0) { return 0; }\n");
+ for (i = 0; i < fn; i++) {
+ printf (" if (cur_token_len == %d && !memcmp (cur_token, \"%s\", cur_token_len)) {\n", (int)strlen (fns[i]->id), fns[i]->id);
+ printf (" out_int (0x%08x);\n", fns[i]->name);
+ printf (" local_next_token ();\n");
+ printf (" struct paramed_type *P = store_function_%s ();\n", fns[i]->print_id);
+ printf (" if (!P) { return 0; }\n");
+ printf (" if (cur_token_len != 1 || *cur_token != ')') { return 0; }\n");
+ printf (" local_next_token ();\n");
+ printf (" return P;\n");
+ printf (" }\n");
+ }
+ printf (" return 0;\n");
+ printf ("}\n");
+}
+
+void gen_autocomplete_header (void) {
+ printf ("#ifdef _MSC_VER\n");
+ printf ("#include \"..\\auto.h\"\n");
+ printf ("#else\n");
+ printf ("#include \"auto.h\"\n");
+ printf ("#endif\n");
+ printf ("#include <assert.h>\n");
+
+ printf ("int tglf_extf_autocomplete (struct tgl_state *TLS, const char *text, int text_len, int index, char **R, char *data, int data_len);\n");
+
+ int i, j;
+ for (i = 0; i < tn; i++) {
+ for (j = 0; j < tps[i]->constructors_num; j ++) {
+ printf ("int autocomplete_constructor_%s (struct paramed_type *T);\n", tps[i]->constructors[j]->print_id);
+ }
+ }
+ for (i = 0; i < tn; i++) if (tps[i]->id[0] != '#' && strcmp (tps[i]->id, "Type")) {
+ printf ("int autocomplete_type_%s (struct paramed_type *T);\n", tps[i]->print_id);
+ printf ("int do_autocomplete_type_%s (const char *text, int len, int index, char **R);\n", tps[i]->print_id);
+ printf ("int autocomplete_type_bare_%s (struct paramed_type *T);\n", tps[i]->print_id);
+ }
+ printf ("int autocomplete_type_any (struct paramed_type *T);\n");
+ printf ("struct paramed_type *autocomplete_function_any (void);\n");
+}
+
+void gen_autocomplete_source (void) {
+ printf ("#ifdef _MSC_VER\n");
+ printf ("#include \"..\\auto.h\"\n");
+ printf ("#include \"..\\mtproto-common.h\"\n");
+ printf ("#include \"auto-autocomplete.h\"\n");
+ printf ("#include \"..\\auto-static-autocomplete.c\"\n");
+ printf ("#else\n");
+ printf ("#include \"auto.h\"\n");
+
+ printf ("#include \"mtproto-common.h\"\n");
+ printf ("#include \"auto/auto-autocomplete.h\"\n");
+ printf ("#include \"auto-static-autocomplete.c\"\n");
+ printf ("#endif\n");
+ printf ("#include <assert.h>\n");
+
+ int i, j;
+ for (i = 0; i < tn; i++) {
+ for (j = 0; j < tps[i]->constructors_num; j ++) {
+ gen_constructor_autocomplete (tps[i]->constructors[j]);
+ }
+ }
+ for (i = 0; i < tn; i++) if (tps[i]->id[0] != '#' && strcmp (tps[i]->id, "Type")) {
+ gen_type_autocomplete (tps[i]);
+ gen_type_do_autocomplete (tps[i]);
+ }
+ for (i = 0; i < fn; i++) {
+ gen_function_autocomplete (fns[i]);
+ }
+ printf ("int autocomplete_type_any (struct paramed_type *T) {\n");
+ printf (" switch (T->type->name) {\n");
+ for (i = 0; i < tn; i++) if (tps[i]->id[0] != '#' && strcmp (tps[i]->id, "Type") && tps[i]->name) {
+ printf (" case 0x%08x: return autocomplete_type_%s (T);\n", tps[i]->name, tps[i]->print_id);
+ printf (" case 0x%08x: return autocomplete_type_bare_%s (T);\n", ~tps[i]->name, tps[i]->print_id);
+ }
+ printf (" default: return -1; }\n");
+ printf ("}\n");
+ printf ("int do_autocomplete_function (const char *text, int text_len, int index, char **R) {\n");
+ printf (" index ++;\n");
+ for (i = 0; i < fn; i++) {
+ printf (" if (index == %d) { if (!strncmp (text, \"%s\", text_len)) { *R = tstrdup (\"%s\"); return index; } else { index ++; }}\n", i, fns[i]->id, fns[i]->id);
+ }
+ printf (" *R = 0;\n");
+ printf (" return 0;\n");
+ printf ("}\n");
+ printf ("struct paramed_type *autocomplete_function_any (void) {\n");
+ printf (" expect_token_ptr_autocomplete (\"(\", 1);\n");
+ printf (" if (cur_token_len == -3) { set_autocomplete_type (do_autocomplete_function); }\n");
+ printf (" if (cur_token_len < 0) { return 0; }\n");
+ for (i = 0; i < fn; i++) {
+ printf (" if (cur_token_len == %d && !memcmp (cur_token, \"%s\", cur_token_len)) {\n", (int)strlen (fns[i]->id), fns[i]->id);
+ printf (" local_next_token ();\n");
+ printf (" struct paramed_type *P = autocomplete_function_%s ();\n", fns[i]->print_id);
+ printf (" if (!P) { return 0; }\n");
+ printf (" expect_token_ptr_autocomplete (\")\", 1);\n");
+ printf (" return P;\n");
+ printf (" }\n");
+ }
+ printf (" return 0;\n");
+ printf ("}\n");
+}
+
+void gen_types_header (void) {
+ printf ("#ifndef __AUTO_TYPES_H__\n");
+ printf ("#define __AUTO_TYPES_H__\n");
+ printf ("#ifdef _MSC_VER\n");
+ printf ("#include \"..\\auto.h\"\n");
+ printf ("#else\n");
+ printf ("#include \"auto.h\"\n");
+ printf ("#endif\n");
+ int i;
+ for (i = 0; i < tn; i++) if (tps[i]->id[0] != '#' && strcmp (tps[i]->id, "Type")) {
+ printf ("extern struct tl_type_descr tl_type_%s;\n", tps[i]->print_id);
+ printf ("extern struct tl_type_descr tl_type_bare_%s;\n", tps[i]->print_id);
+ }
+ for (i = 0; i < tn; i++) if (tps[i]->id[0] != '#' && strcmp (tps[i]->id, "Type")) {
+ printf ("struct tl_ds_%s {\n", tps[i]->print_id);
+#if !defined(__STDC__) || __STDC_VERSION__ < 199901L
+ if (tps[i]->constructors_num == 1 && tps[i]->constructors[0]->args_num == 0 &&
+ !(!strcmp (tps[i]->id, "String") || !strcmp (tps[i]->id, "Bytes"))) {
+ printf (" int : 0;\n");
+ printf ("};\n");
+ continue;
+ }
+#endif
+
+ if (!strcmp (tps[i]->id, "String") || !strcmp (tps[i]->id, "Bytes")) {
+ printf (" int len;\n");
+ printf (" char *data;\n");
+ printf ("};\n");
+ continue;
+ }
+ int j;
+ if (tps[i]->constructors_num > 1) {
+ printf (" unsigned magic;\n");
+ }
+ for (j = 0; j < tps[i]->constructors_num; j++) {
+ struct tl_combinator *c = tps[i]->constructors[j];
+ int k;
+ for (k = 0; k < c->args_num; k++) {
+ if ((c->args[k]->flags & FLAG_OPT_VAR)) { continue; }
+ if (c->args[k]->id && strlen (c->args[k]->id) && j > 0) {
+ int l;
+ int ok = 1;
+ for (l = 0; l < j && ok; l++) {
+ int m;
+ struct tl_combinator *d = tps[i]->constructors[l];
+ for (m = 0; m < d->args_num && ok; m++) {
+ if (d->args[m]->id && !strcmp (d->args[m]->id, c->args[k]->id)) {
+ ok = 0;
+ }
+ }
+ }
+ if (!ok) { continue; }
+ }
+
+ printf (" ");
+ print_c_type_name (c->args[k]->type, " ", 1);
+
+ if (!c->args[k]->id || !strlen (c->args[k]->id)) {
+ assert (!j);
+
+ printf ("f%d;\n", k);
+ } else {
+ printf ("%s;\n", c->args[k]->id);
+ }
+ }
+ }
+ printf ("};\n");
+ }
+ printf ("#endif\n");
+}
+
+void gen_types_source (void) {
+ printf ("#ifdef _MSC_VER\n");
+ printf ("#include \"..\\auto.h\"\n");
+ printf ("#else\n");
+ printf ("#include \"auto.h\"\n");
+ printf ("#endif\n");
+ int i;
+ for (i = 0; i < tn; i++) if (tps[i]->id[0] != '#' && strcmp (tps[i]->id, "Type")) {
+ printf ("struct tl_type_descr tl_type_%s = {\n", tps[i]->print_id);
+ printf (" .name = 0x%08x,\n", tps[i]->name);
+ printf (" .id = \"%s\"\n,", tps[i]->id);
+ printf (" .params_num = %d,\n", tps[i]->arity);
+ printf (" .params_types = %"_PRINTF_INT64_"d\n", tps[i]->params_types);
+ printf ("};\n");
+ printf ("struct tl_type_descr tl_type_bare_%s = {\n", tps[i]->print_id);
+ printf (" .name = 0x%08x,\n", ~tps[i]->name);
+ printf (" .id = \"Bare_%s\",\n", tps[i]->id);
+ printf (" .params_num = %d,\n", tps[i]->arity);
+ printf (" .params_types = %"_PRINTF_INT64_"d\n", tps[i]->params_types);
+ printf ("};\n");
+ }
+}
+
+void gen_fetch_ds_source (void) {
+ printf ("#ifdef _MSC_VER\n");
+ printf ("#include \"..\\auto.h\"\n");
+ printf ("#include \"auto-fetch-ds.h\"\n");
+ printf ("#include \"auto-skip.h\"\n");
+ printf ("#include \"auto-types.h\"\n");
+ printf ("#include \"..\\auto-static-fetch-ds.c\"\n");
+ printf ("#include \"..\\mtproto-common.h\"\n");
+ printf ("#else\n");
+ printf ("#include \"auto.h\"\n");
+
+ printf ("#include \"auto/auto-fetch-ds.h\"\n");
+ printf ("#include \"auto/auto-skip.h\"\n");
+ printf ("#include \"auto/auto-types.h\"\n");
+ printf ("#include \"auto-static-fetch-ds.c\"\n");
+ printf ("#include \"mtproto-common.h\"\n");
+ printf ("#endif\n");
+ printf ("#include <assert.h>\n");
+ int i, j;
+ for (i = 0; i < tn; i++) {
+ for (j = 0; j < tps[i]->constructors_num; j ++) {
+ gen_constructor_fetch_ds (tps[i]->constructors[j]);
+ }
+ }
+ for (i = 0; i < tn; i++) if (tps[i]->id[0] != '#' && strcmp (tps[i]->id, "Type")) {
+ gen_type_fetch_ds (tps[i]);
+ }
+ printf ("void *fetch_ds_type_any (struct paramed_type *T) {\n");
+ printf (" switch (T->type->name) {\n");
+ for (i = 0; i < tn; i++) if (tps[i]->id[0] != '#' && strcmp (tps[i]->id, "Type") && tps[i]->name) {
+ printf (" case 0x%08x: return fetch_ds_type_%s (T);\n", tps[i]->name, tps[i]->print_id);
+ printf (" case 0x%08x: return fetch_ds_type_bare_%s (T);\n", ~tps[i]->name, tps[i]->print_id);
+ }
+ printf (" default: return NULL; }\n");
+ printf ("}\n");
+}
+
+void gen_fetch_ds_header (void) {
+ printf ("#ifdef _MSC_VER\n");
+ printf ("#include \"..\\auto.h\"\n");
+ printf ("#else\n");
+ printf ("#include \"auto.h\"\n");
+ printf ("#endif\n");
+ printf ("#include <assert.h>\n");
+ printf ("#include <stdio.h>\n");
+
+ printf ("struct tgl_state;\n");
+ //printf ("char *tglf_extf_fetch (struct tgl_state *TLS, struct paramed_type *T);\n");
+
+ int i, j;
+ for (i = 0; i < tn; i++) {
+ for (j = 0; j < tps[i]->constructors_num; j ++) {
+ print_c_type_name (tps[i]->constructors[j]->result, "", 0);
+ printf ("fetch_ds_constructor_%s (struct paramed_type *T);\n", tps[i]->constructors[j]->print_id);
+ }
+ }
+ for (i = 0; i < tn; i++) if (tps[i]->id[0] != '#' && strcmp (tps[i]->id, "Type")) {
+ print_c_type_name (tps[i]->constructors[0]->result, "", 0);
+ printf ("fetch_ds_type_%s (struct paramed_type *T);\n", tps[i]->print_id);
+ print_c_type_name (tps[i]->constructors[0]->result, "", 0);
+ printf ("fetch_ds_type_bare_%s (struct paramed_type *T);\n", tps[i]->print_id);
+ }
+ printf ("void *fetch_ds_type_any (struct paramed_type *T);\n");
+}
+
+void gen_free_ds_source (void) {
+ printf ("#ifdef _MSC_VER\n");
+ printf ("#include \"..\\auto.h\"\n");
+ printf ("#include \"auto-free-ds.h\"\n");
+ printf ("#include \"auto-skip.h\"\n");
+ printf ("#include \"auto-types.h\"\n");
+ printf ("#include \"..\\auto-static-free-ds.c\"\n");
+ printf ("#include \"..\\mtproto-common.h\"\n");
+ printf ("#else\n");
+ printf ("#include \"auto.h\"\n");
+
+ printf ("#include \"auto/auto-free-ds.h\"\n");
+ printf ("#include \"auto/auto-skip.h\"\n");
+ printf ("#include \"auto/auto-types.h\"\n");
+ printf ("#include \"auto-static-free-ds.c\"\n");
+ printf ("#include \"mtproto-common.h\"\n");
+ printf ("#endif\n");
+ printf ("#include <assert.h>\n");
+ int i, j;
+ for (i = 0; i < tn; i++) {
+ for (j = 0; j < tps[i]->constructors_num; j ++) {
+ gen_constructor_free_ds (tps[i]->constructors[j]);
+ }
+ }
+ for (i = 0; i < tn; i++) if (tps[i]->id[0] != '#' && strcmp (tps[i]->id, "Type")) {
+ gen_type_free_ds (tps[i]);
+ }
+ printf ("void free_ds_type_any (void *D, struct paramed_type *T) {\n");
+ printf (" switch (T->type->name) {\n");
+ for (i = 0; i < tn; i++) if (tps[i]->id[0] != '#' && strcmp (tps[i]->id, "Type") && tps[i]->name) {
+ printf (" case 0x%08x: free_ds_type_%s (D, T); return;\n", tps[i]->name, tps[i]->print_id);
+ printf (" case 0x%08x: free_ds_type_%s (D, T); return;\n", ~tps[i]->name, tps[i]->print_id);
+ }
+ printf (" default: return; }\n");
+ printf ("}\n");
+}
+
+void gen_free_ds_header (void) {
+ printf ("#ifdef _MSC_VER\n");
+ printf ("#include \"..\\auto.h\"\n");
+ printf ("#include \"auto-types.h\"\n");
+ printf ("#else\n");
+ printf ("#include \"auto.h\"\n");
+ printf ("#include \"auto/auto-types.h\"\n");
+ printf ("#endif\n");
+ printf ("#include <assert.h>\n");
+ printf ("#include <stdio.h>\n");
+
+ printf ("struct tgl_state;\n");
+ //printf ("char *tglf_extf_fetch (struct tgl_state *TLS, struct paramed_type *T);\n");
+
+ int i, j;
+ for (i = 0; i < tn; i++) {
+ for (j = 0; j < tps[i]->constructors_num; j ++) {
+ printf ("void free_ds_constructor_%s (", tps[i]->constructors[j]->print_id);
+ print_c_type_name (tps[i]->constructors[j]->result, "", 0);
+ printf ("D, struct paramed_type *T);\n");
+ }
+ }
+ for (i = 0; i < tn; i++) if (tps[i]->id[0] != '#' && strcmp (tps[i]->id, "Type")) {
+ printf ("void free_ds_type_%s (", tps[i]->print_id);
+ print_c_type_name (tps[i]->constructors[0]->result, "", 0);
+ printf ("D, struct paramed_type *T);\n");
+ }
+ printf ("void free_ds_type_any (void *D, struct paramed_type *T);\n");
+}
+
+void gen_store_ds_source (void) {
+ printf ("#ifdef _MSC_VER\n");
+ printf ("#include \"..\\auto.h\"\n");
+ printf ("#include \"auto-store-ds.h\"\n");
+ printf ("#include \"auto-skip.h\"\n");
+ printf ("#include \"auto-types.h\"\n");
+ printf ("#include \"..\\auto-static-store-ds.c\"\n");
+ printf ("#include \"..\\mtproto-common.h\"\n");
+ printf ("#else\n");
+ printf ("#include \"auto.h\"\n");
+
+ printf ("#include \"auto/auto-store-ds.h\"\n");
+ printf ("#include \"auto/auto-skip.h\"\n");
+ printf ("#include \"auto/auto-types.h\"\n");
+ printf ("#include \"auto-static-store-ds.c\"\n");
+ printf ("#include \"mtproto-common.h\"\n");
+ printf ("#endif\n");
+ printf ("#include <assert.h>\n");
+ int i, j;
+ for (i = 0; i < tn; i++) {
+ for (j = 0; j < tps[i]->constructors_num; j ++) {
+ gen_constructor_store_ds (tps[i]->constructors[j]);
+ }
+ }
+ for (i = 0; i < tn; i++) if (tps[i]->id[0] != '#' && strcmp (tps[i]->id, "Type")) {
+ gen_type_store_ds (tps[i]);
+ }
+ printf ("void store_ds_type_any (void *D, struct paramed_type *T) {\n");
+ printf (" switch (T->type->name) {\n");
+ for (i = 0; i < tn; i++) if (tps[i]->id[0] != '#' && strcmp (tps[i]->id, "Type") && tps[i]->name) {
+ printf (" case 0x%08x: store_ds_type_%s (D, T); return;\n", tps[i]->name, tps[i]->print_id);
+ printf (" case 0x%08x: store_ds_type_bare_%s (D, T); return;\n", ~tps[i]->name, tps[i]->print_id);
+ }
+ printf (" default: return; }\n");
+ printf ("}\n");
+}
+
+void gen_store_ds_header (void) {
+ printf ("#ifdef _MSC_VER\n");
+ printf ("#include \"..\\auto.h\"\n");
+ printf ("#include \"auto-types.h\"\n");
+ printf ("#else\n");
+ printf ("#include \"auto.h\"\n");
+ printf ("#include \"auto/auto-types.h\"\n");
+ printf ("#endif\n");
+ printf ("#include <assert.h>\n");
+ printf ("#include <stdio.h>\n");
+
+ printf ("struct tgl_state;\n");
+ //printf ("char *tglf_extf_fetch (struct tgl_state *TLS, struct paramed_type *T);\n");
+
+ int i, j;
+ for (i = 0; i < tn; i++) {
+ for (j = 0; j < tps[i]->constructors_num; j ++) {
+ printf ("void store_ds_constructor_%s (", tps[i]->constructors[j]->print_id);
+ print_c_type_name (tps[i]->constructors[j]->result, "", 0);
+ printf ("D, struct paramed_type *T);\n");
+ }
+ }
+ for (i = 0; i < tn; i++) if (tps[i]->id[0] != '#' && strcmp (tps[i]->id, "Type")) {
+ printf ("void store_ds_type_%s (", tps[i]->print_id);
+ print_c_type_name (tps[i]->constructors[0]->result, "", 0);
+ printf ("D, struct paramed_type *T);\n");
+ printf ("void store_ds_type_bare_%s (", tps[i]->print_id);
+ print_c_type_name (tps[i]->constructors[0]->result, "", 0);
+ printf ("D, struct paramed_type *T);\n");
+ }
+ printf ("void store_ds_type_any (void *D, struct paramed_type *T);\n");
+}
+
+void gen_print_ds_header (void) {
+ printf ("#ifdef _MSC_VER\n");
+ printf ("#include \"..\\auto.h\"\n");
+ printf ("#include \"auto-types.h\"\n");
+ printf ("#else\n");
+ printf ("#include \"auto.h\"\n");
+ printf ("#include \"auto-types.h\"\n");
+ printf ("#endif\n");
+ printf ("#include <assert.h>\n");
+ printf ("#include <stdio.h>\n");
+
+ printf ("struct tgl_state;\n");
+ printf ("char *tglf_extf_print_ds (struct tgl_state *TLS, void *DS, struct paramed_type *T);\n");
+
+ int i, j;
+ for (i = 0; i < tn; i++) {
+ for (j = 0; j < tps[i]->constructors_num; j ++) {
+ printf ("int print_ds_constructor_%s (", tps[i]->constructors[j]->print_id);
+ print_c_type_name (tps[i]->constructors[j]->result, "", 0);
+ printf ("DS, struct paramed_type *T);\n");
+ }
+ }
+ for (i = 0; i < tn; i++) if (tps[i]->id[0] != '#' && strcmp (tps[i]->id, "Type")) {
+ printf ("int print_ds_type_%s (", tps[i]->print_id);
+ print_c_type_name (tps[i]->constructors[0]->result, "", 0);
+ printf ("DS, struct paramed_type *T);\n");
+ printf ("int print_ds_type_bare_%s (", tps[i]->print_id);
+ print_c_type_name (tps[i]->constructors[0]->result, "", 0);
+ printf ("DS, struct paramed_type *T);\n");
+ }
+ printf ("int print_ds_type_any (void *DS, struct paramed_type *T);\n");
+}
+
+void gen_print_ds_source (void) {
+ printf ("#ifdef _MSC_VER\n");
+ printf ("#include \"..\\auto.h\"\n");
+ printf ("#include \"auto-print-ds.h\"\n");
+ printf ("#include \"auto-skip.h\"\n");
+ printf ("#include \"..\\auto-static-print-ds.c\"\n");
+ printf ("#include \"..\\mtproto-common.h\"\n");
+ printf ("#else\n");
+ printf ("#include \"auto.h\"\n");
+
+ printf ("#include \"auto/auto-print-ds.h\"\n");
+ printf ("#include \"auto/auto-skip.h\"\n");
+ printf ("#include \"auto-static-print-ds.c\"\n");
+ printf ("#include \"mtproto-common.h\"\n");
+ printf ("#endif\n");
+ printf ("#include <assert.h>\n");
+ int i, j;
+ for (i = 0; i < tn; i++) {
+ for (j = 0; j < tps[i]->constructors_num; j ++) {
+ gen_constructor_print_ds (tps[i]->constructors[j]);
+ }
+ }
+ for (i = 0; i < tn; i++) if (tps[i]->id[0] != '#' && strcmp (tps[i]->id, "Type")) {
+ gen_type_print_ds (tps[i]);
+ }
+ printf ("int print_ds_type_any (void *DS, struct paramed_type *T) {\n");
+ printf (" switch (T->type->name) {\n");
+ for (i = 0; i < tn; i++) if (tps[i]->id[0] != '#' && strcmp (tps[i]->id, "Type") && tps[i]->name) {
+ printf (" case 0x%08x: return print_ds_type_%s (DS, T);\n", tps[i]->name, tps[i]->print_id);
+ printf (" case 0x%08x: return print_ds_type_bare_%s (DS, T);\n", ~tps[i]->name, tps[i]->print_id);
+ }
+ printf (" default: return -1; }\n");
+ printf ("}\n");
+}
+
+int parse_tlo_file (void) {
+ buf_end = buf_ptr + (buf_size / 4);
+ assert (get_int () == TLS_SCHEMA_V2);
+
+ get_int (); // version
+ get_int (); // date
+
+ tn = 0;
+ fn = 0;
+ cn = 0;
+ int i;
+
+ tn = get_int ();
+ assert (tn >= 0 && tn < 10000);
+ tps = malloc0 (sizeof (void *) * tn);
+
+ if (verbosity >= 2) {
+ fprintf (stderr, "Found %d types\n", tn);
+ }
+
+ for (i = 0; i < tn; i++) {
+ assert (get_int () == TLS_TYPE);
+ tps[i] = read_types ();
+ assert (tps[i]);
+ }
+
+ cn = get_int ();
+ assert (cn >= 0);
+
+ if (verbosity >= 2) {
+ fprintf (stderr, "Found %d constructors\n", cn);
+ }
+
+ for (i = 0; i < cn; i++) {
+ assert (get_int () == TLS_COMBINATOR);
+ assert (read_combinators (2));
+ }
+
+ fn = get_int ();
+ assert (fn >= 0 && fn < 10000);
+
+ fns = malloc0 (sizeof (void *) * fn);
+
+ if (verbosity >= 2) {
+ fprintf (stderr, "Found %d functions\n", fn);
+ }
+
+ for (i = 0; i < fn; i++) {
+ assert (get_int () == TLS_COMBINATOR);
+ fns[i] = read_combinators (3);
+ assert (fns[i]);
+ }
+
+ assert (buf_ptr == buf_end);
+
+
+ int j;
+ for (i = 0; i < tn; i++) if (tps[i]->id[0] != '#' && strcmp (tps[i]->id, "Type")) {
+ tps[i]->name = 0;
+ for (j = 0; j < tps[i]->constructors_num; j ++) {
+ tps[i]->name ^= tps[i]->constructors[j]->name;
+ }
+ }
+
+
+ for (i = 0; i < gen_what_cnt; i++) {
+ if (!strcmp (gen_what[i], "fetch")) {
+ gen_fetch_source ();
+ } else if (!strcmp (gen_what[i], "fetch-header")) {
+ gen_fetch_header ();
+ } else if (!strcmp (gen_what[i], "skip")) {
+ gen_skip_source ();
+ } else if (!strcmp (gen_what[i], "skip-header")) {
+ gen_skip_header ();
+ } else if (!strcmp (gen_what[i], "store")) {
+ gen_store_source ();
+ } else if (!strcmp (gen_what[i], "store-header")) {
+ gen_store_header ();
+ } else if (!strcmp (gen_what[i], "autocomplete")) {
+ gen_autocomplete_source ();
+ } else if (!strcmp (gen_what[i], "autocomplete-header")) {
+ gen_autocomplete_header ();
+ } else if (!strcmp (gen_what[i], "types")) {
+ gen_types_source ();
+ } else if (!strcmp (gen_what[i], "types-header")) {
+ gen_types_header ();
+ } else if (!strcmp (gen_what[i], "fetch-ds")) {
+ gen_fetch_ds_source ();
+ } else if (!strcmp (gen_what[i], "fetch-ds-header")) {
+ gen_fetch_ds_header ();
+ } else if (!strcmp (gen_what[i], "free-ds")) {
+ gen_free_ds_source ();
+ } else if (!strcmp (gen_what[i], "free-ds-header")) {
+ gen_free_ds_header ();
+ } else if (!strcmp (gen_what[i], "store-ds")) {
+ gen_store_ds_source ();
+ } else if (!strcmp (gen_what[i], "store-ds-header")) {
+ gen_store_ds_header ();
+ } else if (!strcmp (gen_what[i], "print-ds")) {
+ gen_print_ds_source ();
+ } else if (!strcmp (gen_what[i], "print-ds-header")) {
+ gen_print_ds_header ();
+ } else {
+ assert (0);
+ }
+ }
+
+
+ return 0;
+}
+
+void usage (void) {
+ printf ("usage: generate [-v] [-h] <tlo-file>\n"
+ );
+ exit (2);
+}
+
+#ifndef _MSC_VER
+void logprintf (const char *format, ...) __attribute__ ((format (printf, 1, 2)));
+void logprintf (const char *format __attribute__ ((unused)), ...) {
+}
+#endif
+/*
+void hexdump (int *in_ptr, int *in_end) {
+ int *ptr = in_ptr;
+ while (ptr < in_end) { printf (" %08x", *(ptr ++)); }
+ printf ("\n");
+}*/
+
+#ifdef HAVE_EXECINFO_H
+void print_backtrace (void) {
+ void *buffer[255];
+ const int calls = backtrace (buffer, sizeof (buffer) / sizeof (void *));
+ backtrace_symbols_fd (buffer, calls, 1);
+}
+#else
+void print_backtrace (void) {
+ if (write (1, "No libexec. Backtrace disabled\n", 32) < 0) {
+ // Sad thing
+ }
+}
+#endif
+
+void sig_segv_handler (int signum __attribute__ ((unused))) {
+ if (write (1, "SIGSEGV received\n", 18) < 0) {
+ // Sad thing
+ }
+ print_backtrace ();
+ exit (EXIT_FAILURE);
+}
+
+void sig_abrt_handler (int signum __attribute__ ((unused))) {
+ if (write (1, "SIGABRT received\n", 18) < 0) {
+ // Sad thing
+ }
+ print_backtrace ();
+ exit (EXIT_FAILURE);
+}
+
+int main (int argc, char **argv) {
+ signal (SIGSEGV, sig_segv_handler);
+ signal (SIGABRT, sig_abrt_handler);
+ int i;
+ while ((i = getopt (argc, argv, "vhHg:")) != -1) {
+ switch (i) {
+ case 'h':
+ usage ();
+ return 2;
+ case 'v':
+ verbosity++;
+ break;
+ case 'H':
+ header ++;
+ break;
+ case 'g':
+ assert (gen_what_cnt < 1000);
+ gen_what[gen_what_cnt ++] = optarg;
+ break;
+ }
+ }
+
+ if (argc != optind + 1) {
+ usage ();
+ }
+
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ int fd = 0;
+ errno_t err = _sopen_s(&fd, argv[optind], _O_RDONLY | _O_BINARY, _SH_DENYNO, _S_IREAD | _S_IWRITE);
+ if(err != 0) {
+ char errnoStr[256] = { 0 };
+ strerror_s (errnoStr, 256, err);
+ fprintf (stderr, "Can not open file '%s'. Error %s\n", argv[optind], errnoStr);
+#elif defined(WIN32) || defined(_WIN32)
+ int fd = open (argv[optind], O_RDONLY | O_BINARY);
+ if (fd < 0) {
+ fprintf (stderr, "Can not open file '%s'. Error %s\n", argv[optind], strerror (errno));
+#else
+ int fd = open (argv[optind], O_RDONLY);
+ if (fd < 0) {
+ fprintf (stderr, "Can not open file '%s'. Error %m\n", argv[optind]);
+#endif
+ exit (1);
+ }
+ buf_size = read (fd, buf, (1 << 20));
+ if (fd == (1 << 20)) {
+ fprintf (stderr, "Too big tlo file\n");
+ exit (2);
+ }
+ return parse_tlo_file ();
+}
diff --git a/protocols/Telegram/tgl/generate.h b/protocols/Telegram/tgl/generate.h
new file mode 100644
index 0000000000..5d46a6c4ec
--- /dev/null
+++ b/protocols/Telegram/tgl/generate.h
@@ -0,0 +1,173 @@
+/*
+ This file is part of tgl-libary/generate
+
+ Tgl-library/generate is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+
+ Tgl-library/generate is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this tgl-library/generate. If not, see <http://www.gnu.org/licenses/>.
+
+ Copyright Vitaly Valtman 2014-2015
+
+ It is derivative work of VK/KittenPHP-DB-Engine (https://github.com/vk-com/kphp-kdb/)
+ Copyright 2012-2013 Vkontakte Ltd
+ 2012-2013 Vitaliy Valtman
+*/
+
+#ifndef __GENERATE_H__
+#define __GENERATE_H__
+
+struct tl_combinator;
+
+struct tl_type {
+// struct tl_type_methods *methods;
+ char *id;
+ char *print_id;
+ unsigned name;
+ int arity;
+ int flags;
+ int constructors_num;
+ struct tl_combinator **constructors;
+ long long params_types;
+ int extra;
+};
+
+#define NODE_TYPE_TYPE 1
+#define NODE_TYPE_NAT_CONST 2
+#define NODE_TYPE_VAR_TYPE 3
+#define NODE_TYPE_VAR_NUM 4
+#define NODE_TYPE_ARRAY 5
+
+#define MAX_COMBINATOR_VARS 64
+
+#define NAME_VAR_NUM 0x70659eff
+#define NAME_VAR_TYPE 0x2cecf817
+#define NAME_INT 0xa8509bda
+#define NAME_LONG 0x22076cba
+#define NAME_DOUBLE 0x2210c154
+#define NAME_STRING 0xb5286e24
+#define NAME_VECTOR 0x1cb5c415
+#define NAME_MAYBE_TRUE 0x3f9c8ef8
+#define NAME_MAYBE_FALSE 0x27930a7b
+#define NAME_BOOL_FALSE 0xbc799737
+#define NAME_BOOL_TRUE 0x997275b5
+#define NAME_BYTES 0x0ee1379f
+
+
+#define FLAG_OPT_VAR (1 << 17)
+#define FLAG_EXCL (1 << 18)
+#define FLAG_OPT_FIELD (1 << 20)
+#define FLAG_NOVAR (1 << 21)
+#define FLAG_BARE 1
+#define FLAGS_MASK ((1 << 16) - 1)
+#define FLAG_DEFAULT_CONSTRUCTOR (1 << 25)
+#define FLAG_NOCONS (1 << 1)
+
+extern struct tl_tree_methods tl_nat_const_methods;
+extern struct tl_tree_methods tl_nat_const_full_methods;
+extern struct tl_tree_methods tl_pnat_const_full_methods;
+extern struct tl_tree_methods tl_array_methods;
+extern struct tl_tree_methods tl_type_methods;
+extern struct tl_tree_methods tl_parray_methods;
+extern struct tl_tree_methods tl_ptype_methods;
+extern struct tl_tree_methods tl_var_num_methods;
+extern struct tl_tree_methods tl_var_type_methods;
+extern struct tl_tree_methods tl_pvar_num_methods;
+extern struct tl_tree_methods tl_pvar_type_methods;
+#define TL_IS_NAT_VAR(x) (((long)x) & 1)
+#define TL_TREE_METHODS(x) (TL_IS_NAT_VAR (x) ? &tl_nat_const_methods : ((struct tl_tree *)(x))->methods)
+
+#define DEC_REF(x) (TL_TREE_METHODS(x)->dec_ref ((void *)x))
+#define INC_REF(x) (TL_TREE_METHODS(x)->inc_ref ((void *)x))
+#define TYPE(x) (TL_TREE_METHODS(x)->type ((void *)x))
+
+typedef unsigned long long tl_tree_hash_t;
+struct tl_tree;
+
+struct tl_tree_methods {
+ int (*type)(struct tl_tree *T);
+ int (*eq)(struct tl_tree *T, struct tl_tree *U);
+ void (*inc_ref)(struct tl_tree *T);
+ void (*dec_ref)(struct tl_tree *T);
+};
+
+struct tl_tree {
+ int ref_cnt;
+ int flags;
+ //tl_tree_hash_t hash;
+ struct tl_tree_methods *methods;
+};
+/*
+struct tl_tree_nat_const {
+ struct tl_tree self;
+ int value;
+};*/
+
+struct tl_tree_type {
+ struct tl_tree self;
+
+ struct tl_type *type;
+ int children_num;
+ struct tl_tree **children;
+};
+
+struct tl_tree_array {
+ struct tl_tree self;
+
+ struct tl_tree *multiplicity;
+ int args_num;
+ struct arg **args;
+};
+
+struct tl_tree_var_type {
+ struct tl_tree self;
+
+ int var_num;
+};
+
+struct tl_tree_var_num {
+ struct tl_tree self;
+
+ int var_num;
+ int dif;
+};
+
+struct tl_tree_nat_const {
+ struct tl_tree self;
+
+ long long value;
+};
+
+struct arg {
+ char *id;
+ int var_num;
+ int flags;
+ int exist_var_num;
+ int exist_var_bit;
+ struct tl_tree *type;
+};
+
+struct tl_combinator {
+ //struct tl_combinator_methods *methods;
+ char *id;
+ char *print_id;
+ unsigned name;
+ int is_fun;
+ int var_num;
+ int args_num;
+ struct arg **args;
+ struct tl_tree *result;
+ void **IP;
+ void **fIP;
+ int IP_len;
+ int fIP_len;
+};
+
+#endif
diff --git a/protocols/Telegram/tgl/libevent/.gitignore b/protocols/Telegram/tgl/libevent/.gitignore
new file mode 100644
index 0000000000..01821fe1c5
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/.gitignore
@@ -0,0 +1,135 @@
+### These files should get ignored no matter where they appear.
+
+# Editors leave these lying around
+\#*\#
+.#*
+*~
+*.swp
+
+# C stuff
+*.o
+
+# Windows stuff
+*.obj
+*.exe
+*.lib
+
+# Patch leaves these lying arround
+*.orig
+*.rej
+
+# gcov stuff
+*.gcno
+*.gcov
+*.gcda
+
+# gdb stuff
+.gdb_history
+
+# Autotools stuff
+.deps
+.dirstamp
+Makefile
+Makefile.in
+
+# Libtool stuff
+.libs
+*.lo
+*.la
+
+# ctags stuff
+TAGS
+tags
+
+# Stuff made by our makefiles
+libevent.pc
+libevent_pthreads.pc
+libevent_openssl.pc
+*.log
+*.trs
+
+## The initial / makes these files only get ignored in particular directories.
+/autom4te.cache
+
+# Libtool adds these, at least sometimes
+/m4/libtool.m4
+/m4/ltoptions.m4
+/m4/ltsugar.m4
+/m4/ltversion.m4
+/m4/lt~obsolete.m4
+
+/aclocal.m4
+/compile
+/doxygen
+/config.cache
+/config.guess
+/config.log
+/config.status
+/config.sub
+/configure
+/configure.lineno
+/depcomp
+/config.h
+/config.h.in
+/install-sh
+/libtool
+/ltmain.sh
+/missing
+/stamp-h1
+/stamp-h2
+
+/include/event2/event-config.h
+/evconfig-private.h
+
+/sample/dns-example
+/sample/event-read-fifo
+/sample/hello-world
+/sample/http-server
+/sample/http-connect
+/sample/le-proxy
+/sample/https-client
+/sample/signal-test
+/sample/time-test
+/sample/event-test
+
+/test-driver
+/test/bench
+/test/bench_cascade
+/test/bench_http
+/test/bench_httpclient
+/test/regress
+/test/regress.gen.c
+/test/regress.gen.h
+/test/rpcgen-attempted
+/test/test-dumpevents
+/test/test-eof
+/test/test-closed
+/test/test-init
+/test/test-ratelim
+/test/test-script.sh
+/test/test-time
+/test/test-weof
+/test/test-changelist
+/test/test-fdleak
+
+
+# Files generated by cmake
+/CMakeCache.txt
+/CMakeFiles/
+/CTestTestfile.cmake
+/DartConfiguration.tcl
+/LibeventConfig.cmake
+/LibeventConfigVersion.cmake
+/LibeventTargets.cmake
+/bin/
+/cmake_install.cmake
+/include/evconfig-private.h
+/lib/
+/tmp/
+/verify_tests.sh
+/event.dir
+/event_core.dir
+/event_extra.dir
+*.vcxproj
+*.sln
+*.filters
diff --git a/protocols/Telegram/tgl/libevent/.travis.yml b/protocols/Telegram/tgl/libevent/.travis.yml
new file mode 100644
index 0000000000..f1d8141f5a
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/.travis.yml
@@ -0,0 +1,21 @@
+env:
+ matrix:
+ - EVENT_BUILD_METHOD=cmake EVENT_CMAKE_OPTIONS=""
+ - EVENT_BUILD_METHOD=cmake EVENT_CMAKE_OPTIONS="-DEVENT__DISABLE_OPENSSL=ON"
+ - EVENT_BUILD_METHOD=cmake EVENT_CMAKE_OPTIONS="-DEVENT__DISABLE_THREAD_SUPPORT=ON"
+ - EVENT_BUILD_METHOD=cmake EVENT_CMAKE_OPTIONS="-DEVENT__DISABLE_DEBUG_MODE=ON"
+ - EVENT_BUILD_METHOD=autotools EVENT_CONFIGURE_OPTIONS=""
+ - EVENT_BUILD_METHOD=autotools EVENT_CONFIGURE_OPTIONS="--disable-debug-mode"
+language: c
+compiler:
+ - gcc
+ - clang
+install:
+ - sudo apt-get update -qq
+ - sudo apt-get install -y -qq zlib1g-dev libssl-dev build-essential automake autoconf cmake
+script:
+ - if [ "$EVENT_BUILD_METHOD" = "autotools" ]; then ./autogen.sh && ./configure $EVENT_CONFIGURE_OPTIONS && make && make verify; fi
+ - if [ "$EVENT_BUILD_METHOD" = "cmake" ]; then mkdir build && cd build && cmake .. $EVENT_CMAKE_OPTIONS && cmake --build . && CTEST_OUTPUT_ON_FAILURE=1 cmake --build . --target verify; fi
+
+notifications:
+ irc: "irc.oftc.net#libevent"
diff --git a/protocols/Telegram/tgl/libevent/CMakeLists.txt b/protocols/Telegram/tgl/libevent/CMakeLists.txt
new file mode 100644
index 0000000000..708f8a1bfa
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/CMakeLists.txt
@@ -0,0 +1,1428 @@
+#
+# Libevent CMake project
+#
+# Based on initial work by:
+# Alexey Ozeritsky
+#
+# Additional changes:
+# Brodie Thiesfield
+# Joakim Soderberg
+# Trond Norbye
+# Sergei Nikulov
+#
+# Build example:
+#
+# cd libevent
+# md build
+# cd build
+# cmake -G "Visual Studio 10" ..
+# start libevent.sln
+#
+cmake_minimum_required(VERSION 2.8.0 FATAL_ERROR)
+
+if(NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE Release
+ CACHE STRING "Set build type to Debug o Release (default Release)" FORCE)
+endif()
+
+# get rid of the extra default configurations
+# what? why would you get id of other useful build types? - Ellzey
+set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Limited configurations" FORCE)
+
+project(libevent C)
+
+set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/")
+
+
+include(CheckTypeSize)
+include(CheckFunctionExistsEx)
+include(CheckFileOffsetBits)
+include(CheckFunctionExists)
+include(CheckIncludeFile)
+include(CheckIncludeFiles)
+include(CheckVariableExists)
+include(CheckSymbolExists)
+include(CheckStructHasMember)
+include(CheckCSourceCompiles)
+include(CheckPrototypeDefinition)
+include(CheckFunctionKeywords)
+include(AddCompilerFlags)
+include(VersionViaGit)
+
+event_fuzzy_version_from_git()
+
+set(EVENT_VERSION_MAJOR ${EVENT_GIT___VERSION_MAJOR})
+set(EVENT_VERSION_MINOR ${EVENT_GIT___VERSION_MINOR})
+set(EVENT_VERSION_PATCH ${EVENT_GIT___VERSION_PATCH})
+set(EVENT_VERSION_STAGE ${EVENT_GIT___VERSION_STAGE})
+
+
+set(EVENT_ABI_MAJOR ${EVENT_VERSION_MAJOR})
+set(EVENT_ABI_MINOR ${EVENT_VERSION_MINOR})
+set(EVENT_ABI_PATCH ${EVENT_VERSION_PATCH})
+
+set(EVENT_ABI_LIBVERSION
+ "${EVENT_ABI_MAJOR}.${EVENT_ABI_MINOR}.${EVENT_ABI_PATCH}")
+
+set(EVENT_PACKAGE_VERSION
+ "${EVENT_VERSION_MAJOR}.${EVENT_VERSION_MINOR}.${EVENT_VERSION_PATCH}")
+
+set(EVENT_NUMERIC_VERSION 0x02010500)
+
+# only a subset of names can be used, defaults to "beta"
+set(EVENT_STAGE_NAME ${EVENT_VERSION_STAGE}
+ CACHE STRING "set the stage name (beta|alpha|release)")
+
+# a list that defines what can set for EVENT_STAGE_VERSION
+set(EVENT__ALLOWED_STAGE_NAMES
+ rc
+ beta
+ alpha
+ release)
+
+# attempt to find the EVENT__STAGE_VERSION in the allowed list
+# of accepted stage names, the return value is stord in
+# EVENT__STAGE_RET
+
+list(FIND EVENT__ALLOWED_STAGE_NAMES
+ ${EVENT_STAGE_NAME}
+ EVENT__STAGE_RET)
+
+if (EVENT__STAGE_RET EQUAL "-1")
+ set(EVENT_STAGE_NAME beta)
+endif()
+
+set(EVENT_VERSION
+ "${EVENT_VERSION_MAJOR}.${EVENT_VERSION_MINOR}.${EVENT_VERSION_PATCH}-${EVENT_STAGE_NAME}")
+
+option(EVENT__BUILD_SHARED_LIBRARIES
+ "Define if libevent should be built with shared libraries instead of archives" OFF)
+
+option(EVENT__DISABLE_DEBUG_MODE
+ "Define if libevent should build without support for a debug mode" OFF)
+
+option(EVENT__ENABLE_VERBOSE_DEBUG
+ "Enables verbose debugging" OFF)
+
+option(EVENT__DISABLE_MM_REPLACEMENT
+ "Define if libevent should not allow replacing the mm functions" OFF)
+
+option(EVENT__DISABLE_THREAD_SUPPORT
+ "Define if libevent should not be compiled with thread support" OFF)
+
+option(EVENT__DISABLE_OPENSSL
+ "Define if libevent should build without support for OpenSSL encrpytion" OFF)
+
+option(EVENT__DISABLE_BENCHMARK
+ "Defines if libevent should build without the benchmark exectuables" OFF)
+
+option(EVENT__DISABLE_TESTS
+ "If tests should be compiled or not" OFF)
+
+option(EVENT__DISABLE_REGRESS
+ "Disable the regress tests" OFF)
+
+option(EVENT__DISABLE_SAMPLES
+ "Disable sample files" OFF)
+
+option(EVENT__FORCE_KQUEUE_CHECK
+ "When crosscompiling forces running a test program that verifies that Kqueue works with pipes. Note that this requires you to manually run the test program on the the cross compilation target to verify that it works. See cmake documentation for try_run for more details" OFF)
+
+# TODO: Add --disable-largefile omit support for large files
+option(EVENT__COVERAGE
+"Enable running gcov to get a test coverage report (only works with GCC/CLang). Make sure to enable -DCMAKE_BUILD_TYPE=Debug as well." OFF)
+
+# Put the libaries and binaries that get built into directories at the
+# top of the build tree rather than in hard-to-find leaf directories.
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
+
+if (EVENT__ENABLE_VERBOSE_DEBUG)
+ add_definitions(-DUSE_DBUG=1)
+endif()
+
+# Setup compiler flags for coverage.
+if (EVENT__COVERAGE)
+ if ((NOT CMAKE_COMPILER_IS_GNUCC) AND (NOT ${CMAKE_CXX_COMPILER_ID} STREQAL "Clang"))
+ message(FATAL_ERROR"Trying to compile coverage support, but compiler is not GNU gcc! Try CC=/usr/bin/gcc CXX=/usr/bin/g++ cmake <options> ..")
+ endif()
+
+ if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
+ message(FATAL_ERROR "Coverage requires -DCMAKE_BUILD_TYPE=Debug")
+ endif()
+
+ message(STATUS "Setting coverage compiler flags")
+ add_compiler_flags(-g -O0 -fprofile-arcs -ftest-coverage)
+endif()
+
+# GCC specific options.
+if (CMAKE_COMPILER_IS_GNUCC)
+ option(EVENT__DISABLE_GCC_WARNINGS "Disable verbose warnings with GCC" OFF)
+ option(EVENT__ENABLE_GCC_HARDENING "Enable compiler security checks" OFF)
+ option(EVENT__ENABLE_GCC_FUNCTION_SECTIONS "Enable gcc function sections" OFF)
+ option(EVENT__ENABLE_GCC_WARNINGS "Make all GCC warnings into errors" OFF)
+
+ list(APPEND __FLAGS -Wall)
+
+ if (EVENT__DISABLE_GCC_WARNINGS)
+ list(APPEND __FLAGS -w)
+ endif()
+
+ if (EVENT__ENABLE_GCC_HARDENING)
+ list(APPEND __FLAGS
+ -fstack-protector-all
+ -fwrapv
+ -fPIE
+ -Wstack-protector
+ "--param ssp-buffer-size=1")
+
+ add_definitions(-D_FORTIFY_SOURCE=2)
+ endif()
+
+ if (EVENT__ENABLE_GCC_FUNCTION_SECTIONS)
+ list(APPEND __FLAGS -ffunction-sections)
+ # TODO: Add --gc-sections support. We need some checks for NetBSD to ensure this works.
+ endif()
+
+ if (EVENT__ENABLE_GCC_WARNINGS)
+ list(APPEND __FLAGS -Werror)
+ endif()
+
+ # We need to test for at least gcc 2.95 here, because older versions don't
+ # have -fno-strict-aliasing
+ list(APPEND __FLAGS -fno-strict-aliasing)
+
+ add_compiler_flags(__FLAGS)
+endif()
+
+if (APPLE)
+ # Get rid of deprecated warnings for OpenSSL on OSX 10.7 and greater.
+ add_compiler_flags(
+ -Wno-error=deprecated-declarations
+ -Qunused-arguments)
+endif()
+
+# Winsock.
+if(WIN32)
+ set(CMAKE_EXTRA_INCLUDE_FILES winsock2.h ws2tcpip.h)
+ set(CMAKE_REQUIRED_LIBRARIES ws2_32.lib)
+ set(CMAKE_REQUIRED_DEFINITIONS -FIwinsock2.h -FIws2tcpip.h)
+endif()
+
+# Check if _GNU_SOURCE is available.
+CHECK_SYMBOL_EXISTS(__GNU_LIBRARY__ "features.h" _GNU_SOURCE)
+
+if (_GNU_SOURCE)
+ add_definitions(-D_GNU_SOURCE)
+endif()
+
+CHECK_INCLUDE_FILE(sys/types.h EVENT__HAVE_SYS_TYPES_H)
+if(EVENT__HAVE_SYS_TYPES_H)
+ list(APPEND CMAKE_EXTRA_INCLUDE_FILES sys/types.h)
+endif()
+
+CHECK_INCLUDE_FILE(sys/socket.h EVENT__HAVE_SYS_SOCKET_H)
+if(EVENT__HAVE_SYS_SOCKET_H)
+ list(APPEND CMAKE_EXTRA_INCLUDE_FILES sys/socket.h)
+endif()
+
+CHECK_INCLUDE_FILE(netinet/in.h EVENT__HAVE_NETINET_IN_H)
+if(EVENT__HAVE_NETINET_IN_H)
+ list(APPEND CMAKE_EXTRA_INCLUDE_FILES netinet/in.h)
+endif()
+
+CHECK_INCLUDE_FILE(netinet/in6.h EVENT__HAVE_NETINET_IN6_H)
+if(EVENT__HAVE_NETINET_IN6_H)
+ list(APPEND CMAKE_EXTRA_INCLUDE_FILES netinet/in6.h)
+endif()
+
+CHECK_INCLUDE_FILE(unistd.h EVENT__HAVE_UNISTD_H)
+CHECK_INCLUDE_FILE(netdb.h EVENT__HAVE_NETDB_H)
+CHECK_INCLUDE_FILE(dlfcn.h EVENT__HAVE_DLFCN_H)
+CHECK_INCLUDE_FILE(arpa/inet.h EVENT__HAVE_ARPA_INET_H)
+CHECK_INCLUDE_FILE(fcntl.h EVENT__HAVE_FCNTL_H)
+if(EVENT__HAVE_FCNTL_H)
+ list(APPEND CMAKE_EXTRA_INCLUDE_FILES fcntl.h)
+endif()
+CHECK_INCLUDE_FILE(inttypes.h EVENT__HAVE_INTTYPES_H)
+CHECK_INCLUDE_FILE(memory.h EVENT__HAVE_MEMORY_H)
+CHECK_INCLUDE_FILE(poll.h EVENT__HAVE_POLL_H)
+CHECK_INCLUDE_FILE(port.h EVENT__HAVE_PORT_H)
+if(EVENT__HAVE_PORT_H)
+ list(APPEND CMAKE_EXTRA_INCLUDE_FILES port.h)
+endif()
+CHECK_INCLUDE_FILE(signal.h EVENT__HAVE_SIGNAL_H)
+CHECK_INCLUDE_FILE(stdarg.h EVENT__HAVE_STDARG_H)
+CHECK_INCLUDE_FILE(stddef.h EVENT__HAVE_STDDEF_H)
+CHECK_INCLUDE_FILE(stdint.h EVENT__HAVE_STDINT_H)
+CHECK_INCLUDE_FILE(stdlib.h EVENT__HAVE_STDLIB_H)
+CHECK_INCLUDE_FILE(strings.h EVENT__HAVE_STRINGS_H)
+CHECK_INCLUDE_FILE(string.h EVENT__HAVE_STRING_H)
+CHECK_INCLUDE_FILE(sys/devpoll.h EVENT__HAVE_SYS_DEVPOLL_H)
+CHECK_INCLUDE_FILE(sys/epoll.h EVENT__HAVE_SYS_EPOLL_H)
+CHECK_INCLUDE_FILE(sys/eventfd.h EVENT__HAVE_SYS_EVENTFD_H)
+CHECK_INCLUDE_FILE(sys/event.h EVENT__HAVE_SYS_EVENT_H)
+CHECK_INCLUDE_FILE(sys/ioctl.h EVENT__HAVE_SYS_IOCTL_H)
+CHECK_INCLUDE_FILE(sys/mman.h EVENT__HAVE_SYS_MMAN_H)
+CHECK_INCLUDE_FILE(sys/param.h EVENT__HAVE_SYS_PARAM_H)
+CHECK_INCLUDE_FILE(sys/queue.h EVENT__HAVE_SYS_QUEUE_H)
+CHECK_INCLUDE_FILE(sys/select.h EVENT__HAVE_SYS_SELECT_H)
+CHECK_INCLUDE_FILE(sys/sendfile.h EVENT__HAVE_SYS_SENDFILE_H)
+CHECK_INCLUDE_FILE(sys/stat.h EVENT__HAVE_SYS_STAT_H)
+CHECK_INCLUDE_FILE(sys/time.h EVENT__HAVE_SYS_TIME_H)
+if(EVENT__HAVE_SYS_TIME_H)
+ list(APPEND CMAKE_EXTRA_INCLUDE_FILES sys/time.h)
+endif()
+CHECK_INCLUDE_FILE(sys/uio.h EVENT__HAVE_SYS_UIO_H)
+CHECK_INCLUDE_FILES("sys/types.h;ifaddrs.h" EVENT__HAVE_IFADDRS_H)
+CHECK_INCLUDE_FILE(mach/mach_time.h EVENT__HAVE_MACH_MACH_TIME_H)
+CHECK_INCLUDE_FILE(netdb.h EVENT__HAVE_NETDB_H)
+CHECK_INCLUDE_FILE(netinet/tcp.h EVENT__HAVE_NETINET_TCP_H)
+CHECK_INCLUDE_FILE(sys/wait.h EVENT__HAVE_SYS_WAIT_H)
+CHECK_INCLUDE_FILE(sys/resource.h EVENT__HAVE_SYS_RESOURCE_H)
+CHECK_INCLUDE_FILE(sys/sysctl.h EVENT__HAVE_SYS_SYSCTL_H)
+CHECK_INCLUDE_FILE(sys/timerfd.h EVENT__HAVE_SYS_TIMERFD_H)
+
+
+CHECK_FUNCTION_EXISTS_EX(epoll_create EVENT__HAVE_EPOLL)
+CHECK_FUNCTION_EXISTS_EX(epoll_ctl EVENT__HAVE_EPOLL_CTL)
+CHECK_FUNCTION_EXISTS_EX(eventfd EVENT__HAVE_EVENTFD)
+CHECK_FUNCTION_EXISTS_EX(clock_gettime EVENT__HAVE_CLOCK_GETTIME)
+CHECK_FUNCTION_EXISTS_EX(fcntl EVENT__HAVE_FCNTL)
+CHECK_FUNCTION_EXISTS_EX(getaddrinfo EVENT__HAVE_GETADDRINFO)
+CHECK_FUNCTION_EXISTS_EX(getnameinfo EVENT__HAVE_GETNAMEINFO)
+CHECK_FUNCTION_EXISTS_EX(gettimeofday EVENT__HAVE_GETTIMEOFDAY)
+CHECK_FUNCTION_EXISTS_EX(getprotobynumber EVENT__HAVE_GETPROTOBYNUMBER)
+CHECK_FUNCTION_EXISTS_EX(getservbyname EVENT__HAVE_GETSERVBYNAME)
+CHECK_FUNCTION_EXISTS_EX(inet_ntop EVENT__HAVE_INET_NTOP)
+CHECK_FUNCTION_EXISTS_EX(inet_pton EVENT__HAVE_INET_PTON)
+CHECK_FUNCTION_EXISTS_EX(kqueue EVENT__HAVE_KQUEUE)
+CHECK_FUNCTION_EXISTS_EX(mmap EVENT__HAVE_MMAP)
+CHECK_FUNCTION_EXISTS_EX(pipe EVENT__HAVE_PIPE)
+CHECK_FUNCTION_EXISTS_EX(pipe2 EVENT__HAVE_PIPE2)
+CHECK_FUNCTION_EXISTS_EX(poll EVENT__HAVE_POLL)
+CHECK_FUNCTION_EXISTS_EX(port_create EVENT__HAVE_PORT_CREATE)
+CHECK_FUNCTION_EXISTS_EX(sendfile EVENT__HAVE_SENDFILE)
+CHECK_FUNCTION_EXISTS_EX(sigaction EVENT__HAVE_SIGACTION)
+CHECK_FUNCTION_EXISTS_EX(signal EVENT__HAVE_SIGNAL)
+CHECK_FUNCTION_EXISTS_EX(splice EVENT__HAVE_SPLICE)
+CHECK_FUNCTION_EXISTS_EX(strlcpy EVENT__HAVE_STRLCPY)
+CHECK_FUNCTION_EXISTS_EX(strsep EVENT__HAVE_STRSEP)
+CHECK_FUNCTION_EXISTS_EX(strtok_r EVENT__HAVE_STRTOK_R)
+CHECK_FUNCTION_EXISTS_EX(strtoll EVENT__HAVE_STRTOLL)
+CHECK_FUNCTION_EXISTS_EX(vasprintf EVENT__HAVE_VASPRINTF)
+CHECK_FUNCTION_EXISTS_EX(sysctl EVENT__HAVE_SYSCTL)
+CHECK_FUNCTION_EXISTS_EX(accept4 EVENT__HAVE_ACCEPT4)
+CHECK_FUNCTION_EXISTS_EX(arc4random EVENT__HAVE_ARC4RANDOM)
+CHECK_FUNCTION_EXISTS_EX(arc4random_buf EVENT__HAVE_ARC4RANDOM_BUF)
+CHECK_FUNCTION_EXISTS_EX(epoll_create1 EVENT__HAVE_EPOLL_CREATE1)
+CHECK_FUNCTION_EXISTS_EX(getegid EVENT__HAVE_GETEGID)
+CHECK_FUNCTION_EXISTS_EX(geteuid EVENT__HAVE_GETEUID)
+CHECK_FUNCTION_EXISTS_EX(getifaddrs EVENT__HAVE_GETIFADDRS)
+CHECK_FUNCTION_EXISTS_EX(issetugid EVENT__HAVE_ISSETUGID)
+CHECK_FUNCTION_EXISTS_EX(mach_absolute_time EVENT__HAVE_MACH_ABSOLUTE_TIME)
+CHECK_FUNCTION_EXISTS_EX(nanosleep EVENT__HAVE_NANOSLEEP)
+CHECK_FUNCTION_EXISTS_EX(usleep EVENT__HAVE_USLEEP)
+CHECK_FUNCTION_EXISTS_EX(timeradd EVENT__HAVE_TIMERADD)
+CHECK_FUNCTION_EXISTS_EX(timerclear EVENT__HAVE_TIMERCLEAR)
+CHECK_FUNCTION_EXISTS_EX(timercmp EVENT__HAVE_TIMERCMP)
+CHECK_FUNCTION_EXISTS_EX(timerfd_create HAVE_TIMERFD_CREATE)
+CHECK_FUNCTION_EXISTS_EX(timerisset EVENT__HAVE_TIMERISSET)
+CHECK_FUNCTION_EXISTS_EX(putenv EVENT__HAVE_PUTENV)
+CHECK_FUNCTION_EXISTS_EX(setenv EVENT__HAVE_SETENV)
+CHECK_FUNCTION_EXISTS_EX(setrlimit EVENT__HAVE_SETRLIMIT)
+CHECK_FUNCTION_EXISTS_EX(umask EVENT__HAVE_UMASK)
+CHECK_FUNCTION_EXISTS_EX(unsetenv EVENT__HAVE_UNSETENV)
+
+# Get the gethostbyname_r prototype.
+CHECK_FUNCTION_EXISTS_EX(gethostbyname_r EVENT__HAVE_GETHOSTBYNAME_R)
+
+if(EVENT__HAVE_GETHOSTBYNAME_R)
+ CHECK_PROTOTYPE_DEFINITION(gethostbyname_r
+ "int gethostbyname_r(const char *name, struct hostent *hp, struct hostent_data *hdata)"
+ "0"
+ "netdb.h"
+ EVENT__HAVE_GETHOSTBYNAME_R_3_ARG)
+
+ CHECK_PROTOTYPE_DEFINITION(gethostbyname_r
+ "struct hostent *gethostbyname_r(const char *name, struct hostent *hp, char *buf, size_t buflen, int *herr)"
+ "NULL"
+ "netdb.h"
+ EVENT__HAVE_GETHOSTBYNAME_R_5_ARG)
+
+ CHECK_PROTOTYPE_DEFINITION(gethostbyname_r
+ "int gethostbyname_r(const char *name, struct hostent *hp, char *buf, size_t buflen, struct hostent **result, int *herr)"
+ "0"
+ "netdb.h"
+ EVENT__HAVE_GETHOSTBYNAME_R_6_ARG)
+endif()
+
+if(HAVE_PORT_H AND HAVE_PORT_CREATE)
+ set(EVENT__HAVE_EVENT_PORTS 1)
+endif()
+
+if(NOT WIN32)
+ CHECK_FUNCTION_EXISTS_EX(select EVENT__HAVE_SELECT)
+endif()
+
+CHECK_TYPE_SIZE("uint8_t" EVENT__HAVE_UINT8_T)
+CHECK_TYPE_SIZE("uint16_t" EVENT__HAVE_UINT16_T)
+CHECK_TYPE_SIZE("uint32_t" EVENT__HAVE_UINT32_T)
+CHECK_TYPE_SIZE("uint64_t" EVENT__HAVE_UINT64_T)
+CHECK_TYPE_SIZE("short" EVENT__SIZEOF_SHORT BUILTIN_TYPES_ONLY)
+CHECK_TYPE_SIZE("int" EVENT__SIZEOF_INT BUILTIN_TYPES_ONLY)
+CHECK_TYPE_SIZE("unsigned" EVENT__SIZEOF_UNSIGNED BUILTIN_TYPES_ONLY)
+CHECK_TYPE_SIZE("unsigned int" EVENT__SIZEOF_UNSIGNED_INT BUILTIN_TYPES_ONLY)
+CHECK_TYPE_SIZE("long" EVENT__SIZEOF_LONG BUILTIN_TYPES_ONLY)
+CHECK_TYPE_SIZE("long long" EVENT__SIZEOF_LONG_LONG BUILTIN_TYPES_ONLY)
+
+if(WIN32)
+ # These aren't available until Windows Vista.
+ # But you can still link them. They just won't be found when running the exe.
+ set(EVENT__HAVE_INET_NTOP 0)
+ set(EVENT__HAVE_INET_PTON 0)
+endif()
+
+# Check for different inline keyword versions.
+check_function_keywords("inline" "__inline" "__inline__")
+
+if (HAVE_INLINE)
+ set (EVENT__inline inline)
+elseif (HAVE___INLINE)
+ set(EVENT__inline __inline)
+elseif(HAVE___INLINE__)
+ set(EVENT__inline __inline__)
+else()
+ set(EVENT__inline)
+endif()
+
+CHECK_SYMBOL_EXISTS(TAILQ_FOREACH sys/queue.h EVENT__HAVE_TAILQFOREACH)
+CHECK_SYMBOL_EXISTS(CTL_KERN sys/sysctl.h EVENT__HAVE_DECL_CTL_KERN)
+CHECK_SYMBOL_EXISTS(KERN_ARND sys/sysctl.h EVENT__HAVE_DECL_KERN_ARND)
+CHECK_SYMBOL_EXISTS(KERN_RANDOM sys/sysctl.h EVENT__HAVE_DECL_KERN_RANDOM)
+CHECK_SYMBOL_EXISTS(RANDOM_UUID sys/sysctl.h EVENT__HAVE_DECL_RANDOM_UUID)
+CHECK_SYMBOL_EXISTS(F_SETFD fcntl.h EVENT__HAVE_SETFD)
+
+CHECK_TYPE_SIZE(fd_mask EVENT__HAVE_FD_MASK)
+
+CHECK_TYPE_SIZE(size_t EVENT__SIZEOF_SIZEE_T)
+if(NOT EVENT__SIZEOF_SIZE_T)
+ set(EVENT__size_t "unsigned")
+ set(EVENT__SIZEOF_SIZE_T ${EVENT__SIZEOF_UNSIGNED})
+else()
+ set(EVENT__size_t size_t)
+endif()
+
+CHECK_TYPE_SIZE("off_t" EVENT__SIZEOF_OFF_T LANGUAGE C)
+
+
+# XXX we should functionalize these size and type sets. --elley
+
+# Winssck.
+if (_MSC_VER)
+ list(APPEND CMAKE_EXTRA_INCLUDE_FILES BaseTsd.h)
+endif()
+CHECK_TYPE_SIZE("ssize_t" EVENT__SIZEOF_SSIZE_T_LOWER LANGUAGE C)
+CHECK_TYPE_SIZE("SSIZE_T" EVENT__SIZEOF_SSIZE_T_UPPER LANGUAGE C)
+
+if (EVENT__SIZEOF_SSIZE_T_LOWER)
+ set(EVENT__ssize_t "ssize_t")
+elseif (EVENT__SIZEOF_SSIZE_T_UPPER)
+ set(EVENT__ssize_t "SSIZE_T")
+else()
+ set(EVENT__ssize_t "int")
+ set(EVENT__SIZEOF_SSIZE_T ${EVENT__SIZEOF_INT})
+endif()
+
+
+CHECK_TYPE_SIZE(socklen_t EVENT__SIZEOF_SOCKLEN_T)
+if(NOT EVENT__SIZEOF_SOCKLEN_T)
+ set(EVENT__socklen_t "unsigned int")
+ set(EVENT__SIZEOF_SOCKLEN_T ${EVENT__SIZEOF_UNSIGNED_INT})
+else()
+ set(EVENT__socklen_t "socklen_t")
+endif()
+
+CHECK_TYPE_SIZE(pid_t EVENT__SIZEOF_PID_T)
+if(NOT EVENT__SIZEOF_PID_T)
+ set(EVENT__pid_t "int")
+ set(EVENT__SIZEOF_PID_T ${EVENT__SIZEOF_INT})
+else()
+ set(EVENT__pid_t "pid_t")
+ set(EVENT__SIZEOF_PID_T EVENT__SIZEOF_PID_T)
+endif()
+
+if (NOT EVENT__DISABLE_THREAD_SUPPORT)
+ CHECK_TYPE_SIZE(pthread_t EVENT__SIZEOF_PTHREAD_T)
+endif()
+
+if(EVENT__HAVE_CLOCK_GETTIME)
+ set(EVENT__DNS_USE_CPU_CLOCK_FOR_ID 1)
+endif()
+
+# we're just getting lazy now.
+CHECK_TYPE_SIZE("uintptr_t" EVENT__HAVE_UINTPTR_T)
+CHECK_TYPE_SIZE("void *" EVENT__SIZEOF_VOID_P)
+
+# Tests file offset bits.
+# TODO: Add AIX test for if -D_LARGE_FILES is needed.
+
+# XXX: Why is this here? we don't even use it. Well, we don't even use it
+# on top of that, why is it set in the config.h?! IT_MAKES_NO_SENSE
+# I'm commenting it out for now.
+# - ellzey
+
+#CHECK_FILE_OFFSET_BITS()
+#set(EVENT___FILE_OFFSET_BITS _FILE_OFFSET_BITS)
+
+# Verify kqueue works with pipes.
+if (EVENT__HAVE_KQUEUE)
+ if (CMAKE_CROSSCOMPILING AND NOT EVENT__FORCE_KQUEUE_CHECK)
+ message(WARNING "Cannot check if kqueue works with pipes when crosscompiling, use EVENT__FORCE_KQUEUE_CHECK to be sure (this requires manually running a test program on the cross compilation target)")
+ set(EVENT__HAVE_WORKING_KQUEUE 1)
+ else()
+ message(STATUS "Checking if kqueue works with pipes...")
+ include(CheckWorkingKqueue)
+ endif()
+endif()
+
+CHECK_SYMBOL_EXISTS(_MINIX "stdio.h" EVENT___MINIX)
+CHECK_SYMBOL_EXISTS(_POSIX_1_SOURCE "stdio.h" EVENT___POSIX_1_SOURCE)
+CHECK_SYMBOL_EXISTS(_POSIX_SOURCE "stdio.h" EVENT___POSIX_SOURCE)
+
+if(EVENT__HAVE_NETDB_H)
+ list(APPEND CMAKE_EXTRA_INCLUDE_FILES netdb.h)
+ CHECK_TYPE_SIZE("struct addrinfo" EVENT__HAVE_STRUCT_ADDRINFO)
+elseif(WIN32)
+ list(APPEND CMAKE_EXTRA_INCLUDE_FILES ws2tcpip.h)
+ CHECK_TYPE_SIZE("struct addrinfo" EVENT__HAVE_STRUCT_ADDRINFO)
+endif()
+
+# Check for sockaddr structure sizes.
+set(SOCKADDR_HEADERS)
+if (WIN32)
+ set(CMAKE_REQUIRED_DEFINITIONS "-DWIN32_LEAN_AND_MEAN")
+ if (_MSC_VER LESS 1300)
+ set(SOCKADDR_HEADERS winsock.h)
+ else()
+ set(SOCKADDR_HEADERS winsock2.h ws2tcpip.h)
+ endif()
+else()
+ if (EVENT__HAVE_NETINET_IN_H)
+ set(SOCKADDR_HEADERS ${SOCKADDR_HEADERS} netinet/in.h)
+ endif()
+
+ if (EVENT__HAVE_NETINET_IN6_H)
+ set(SOCKADDR_HEADERS ${SOCKADDR_HEADERS} netinet/in6.h)
+ endif()
+
+ if (EVENT__HAVE_SYS_SOCKET_H)
+ set(SOCKADDR_HEADERS ${SOCKADDR_HEADERS} sys/socket.h)
+ endif()
+
+ if (EVENT__HAVE_NETDB_H)
+ set(SOCKADDR_HEADERS ${SOCKADDR_HEADERS} netdb.h)
+ endif()
+endif()
+
+CHECK_TYPE_SIZE("struct in6_addr" EVENT__HAVE_STRUCT_IN6_ADDR)
+if(EVENT__HAVE_STRUCT_IN6_ADDR)
+ CHECK_STRUCT_HAS_MEMBER("struct in6_addr"
+ s6_addr16 "${SOCKADDR_HEADERS}"
+ EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR16)
+
+ CHECK_STRUCT_HAS_MEMBER("struct in6_addr"
+ s6_addr32 "${SOCKADDR_HEADERS}"
+ EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR32)
+endif()
+
+CHECK_TYPE_SIZE("sa_family_t" EVENT__HAVE_SA_FAMILY_T)
+CHECK_TYPE_SIZE("struct sockaddr_in6" EVENT__HAVE_STRUCT_SOCKADDR_IN6)
+
+if(EVENT__HAVE_STRUCT_SOCKADDR_IN6)
+ CHECK_STRUCT_HAS_MEMBER("struct sockaddr_in6"
+ sin6_len "${SOCKADDR_HEADERS}"
+ EVENT__HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN)
+
+ CHECK_STRUCT_HAS_MEMBER("struct sockaddr_in6"
+ sin_len "${SOCKADDR_HEADERS}"
+ EVENT__HAVE_STRUCT_SOCKADDR_IN_SIN_LEN)
+endif()
+
+CHECK_TYPE_SIZE("struct sockaddr_storage" EVENT__HAVE_STRUCT_SOCKADDR_STORAGE)
+if(EVENT__HAVE_STRUCT_SOCKADDR_STORAGE)
+ CHECK_STRUCT_HAS_MEMBER("struct sockaddr_storage"
+ ss_family "${SOCKADDR_HEADERS}"
+ EVENT__HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY)
+
+ CHECK_STRUCT_HAS_MEMBER("struct sockaddr_storage"
+ __ss_family "${SOCKADDR_HEADERS}" EVENT__HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY)
+endif()
+
+# Group the source files.
+set(HDR_PRIVATE
+ bufferevent-internal.h
+ changelist-internal.h
+ defer-internal.h
+ epolltable-internal.h
+ evbuffer-internal.h
+ event-internal.h
+ evmap-internal.h
+ evrpc-internal.h
+ evsignal-internal.h
+ evthread-internal.h
+ ht-internal.h
+ http-internal.h
+ iocp-internal.h
+ ipv6-internal.h
+ log-internal.h
+ minheap-internal.h
+ mm-internal.h
+ ratelim-internal.h
+ strlcpy-internal.h
+ util-internal.h
+ evconfig-private.h
+ compat/sys/queue.h)
+
+set(HDR_COMPAT
+ include/evdns.h
+ include/evrpc.h
+ include/event.h
+ include/evhttp.h
+ include/evutil.h)
+
+set(HDR_PUBLIC
+ include/event2/buffer.h
+ include/event2/bufferevent.h
+ include/event2/bufferevent_compat.h
+ include/event2/bufferevent_struct.h
+ include/event2/buffer_compat.h
+ include/event2/dns.h
+ include/event2/dns_compat.h
+ include/event2/dns_struct.h
+ include/event2/event.h
+ include/event2/event_compat.h
+ include/event2/event_struct.h
+ include/event2/http.h
+ include/event2/http_compat.h
+ include/event2/http_struct.h
+ include/event2/keyvalq_struct.h
+ include/event2/listener.h
+ include/event2/rpc.h
+ include/event2/rpc_compat.h
+ include/event2/rpc_struct.h
+ include/event2/tag.h
+ include/event2/tag_compat.h
+ include/event2/thread.h
+ include/event2/util.h
+ include/event2/visibility.h
+ ${PROJECT_BINARY_DIR}/include/event2/event-config.h)
+
+set(SRC_CORE
+ buffer.c
+ bufferevent.c
+ bufferevent_filter.c
+ bufferevent_pair.c
+ bufferevent_ratelim.c
+ bufferevent_sock.c
+ event.c
+ evmap.c
+ evthread.c
+ evutil.c
+ evutil_rand.c
+ evutil_time.c
+ listener.c
+ log.c
+ signal.c
+ strlcpy.c)
+
+if(EVENT__HAVE_SELECT)
+ list(APPEND SRC_CORE select.c)
+endif()
+
+if(EVENT__HAVE_POLL)
+ list(APPEND SRC_CORE poll.c)
+endif()
+
+if(EVENT__HAVE_KQUEUE)
+ list(APPEND SRC_CORE kqueue.c)
+endif()
+
+if(EVENT__HAVE_DEVPOLL)
+ list(APPEND SRC_CORE devpoll.c)
+endif()
+
+if(EVENT__HAVE_EPOLL)
+ list(APPEND SRC_CORE epoll_sub.c epoll.c)
+endif()
+
+if(EVENT__HAVE_EVENT_PORTS)
+ list(APPEND SRC_CORE evport.c)
+endif()
+
+if (NOT EVENT__DISABLE_OPENSSL)
+ find_package(OpenSSL REQUIRED)
+
+ set(EVENT__HAVE_OPENSSL 1)
+
+ message(STATUS "OpenSSL include: ${OPENSSL_INCLUDE_DIR}")
+ message(STATUS "OpenSSL lib: ${OPENSSL_LIBRARIES}")
+
+ include_directories(${OPENSSL_INCLUDE_DIR})
+
+ list(APPEND SRC_CORE bufferevent_openssl.c)
+ list(APPEND HDR_PUBLIC include/event2/bufferevent_ssl.h)
+ list(APPEND LIB_APPS ${OPENSSL_LIBRARIES})
+endif()
+
+if (NOT EVENT__DISABLE_THREAD_SUPPORT)
+ if (WIN32)
+ list(APPEND SRC_CORE evthread_win32.c)
+ else()
+ find_package(Threads REQUIRED)
+ if (NOT CMAKE_USE_PTHREADS_INIT)
+ message(FATAL_ERROR
+ "Failed to find Pthreads, set EVENT__DISABLE_THREAD_SUPPORT to disable")
+ endif()
+
+ set(EVENT__HAVE_PTHREADS 1)
+ list(APPEND SRC_CORE evthread_pthread.c)
+ list(APPEND LIB_APPS ${CMAKE_THREAD_LIBS_INIT})
+ endif()
+endif()
+
+if (NOT EVENT__DISABLE_TESTS)
+ # Zlib is only used for testing.
+ find_package(ZLIB)
+
+ if (ZLIB_LIBRARY)
+ include_directories(${ZLIB_INCLUDE_DIRS})
+
+ set(EVENT__HAVE_ZLIB 1)
+ set(EVENT__HAVE_ZLIB_H)
+ list(APPEND LIB_APPS ${ZLIB_LIBRARIES})
+ endif()
+endif()
+
+set(SRC_EXTRA
+ event_tagging.c
+ http.c
+ evdns.c
+ evrpc.c)
+
+add_definitions(-DHAVE_CONFIG_H)
+
+# We use BEFORE here so we don't accidentally look in system directories
+# first for some previous versions of the headers that are installed.
+include_directories(BEFORE ${PROJECT_SOURCE_DIR}
+ ${PROJECT_SOURCE_DIR}/compat
+ ${PROJECT_SOURCE_DIR}/include)
+
+if(WIN32)
+ list(APPEND SRC_CORE
+ buffer_iocp.c
+ bufferevent_async.c
+ event_iocp.c
+ evthread_win32.c
+ win32select.c)
+
+ list(APPEND HDR_PRIVATE WIN32-Code/getopt.h)
+
+ set(EVENT__DNS_USE_FTIME_FOR_ID 1)
+ set(LIB_PLATFORM ws2_32)
+ add_definitions(
+ -D_CRT_SECURE_NO_WARNINGS
+ -D_CRT_NONSTDC_NO_DEPRECATE)
+
+ include_directories(./WIN32-Code)
+endif()
+
+if (UNIX)
+ list(APPEND LIB_PLATFORM m)
+endif()
+
+source_group("Headers Private" FILES ${HDR_PRIVATE})
+source_group("Header Compat" FILES ${HDR_COMPAT})
+source_group("Headers Public" FILES ${HDR_PUBLIC})
+source_group("Source Core" FILES ${SRC_CORE})
+source_group("Source Extra" FILES ${SRC_EXTRA})
+
+# Generate the configure headers.
+# (Place them in the build dir so we don't polute the source tree with generated files).
+include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include)
+
+if (EVENT__BUILD_SHARED_LIBRARIES)
+ set(EVENT__LIBRARY_TYPE SHARED)
+
+ if ((CMAKE_COMPILER_IS_GNUCC) OR (${CMAKE_C_COMPILER_ID} STREQUAL "Clang"))
+ add_compiler_flags(-fvisibility=hidden)
+ elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "SunPro")
+ add_compiler_flags(-xldscope=hidden)
+ endif()
+
+ set(EVENT__NEED_DLLIMPORT 1)
+else (EVENT__BUILD_SHARED_LIBRARIES)
+ set(EVENT__LIBRARY_TYPE STATIC)
+endif (EVENT__BUILD_SHARED_LIBRARIES)
+
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/event-config.h.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/include/event2/event-config.h
+ NEWLINE_STYLE UNIX)
+
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/evconfig-private.h.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/include/evconfig-private.h)
+
+#
+# Create the libraries.
+#
+
+# TODO: Add dynamic versions of the libraries as well.
+add_library(event_core ${EVENT__LIBRARY_TYPE}
+ ${HDR_PRIVATE}
+ ${HDR_COMPAT}
+ ${HDR_PUBLIC}
+ ${SRC_CORE})
+
+add_library(event_extra ${EVENT__LIBRARY_TYPE}
+ ${HDR_PRIVATE}
+ ${HDR_COMPAT}
+ ${HDR_PUBLIC}
+ ${SRC_CORE}
+ ${SRC_EXTRA})
+
+# library exists for historical reasons; it contains the contents of
+# both libevent_core and libevent_extra. You shouldn’t use it; it may
+# go away in a future version of Libevent.
+add_library(event ${EVENT__LIBRARY_TYPE}
+ ${HDR_PRIVATE}
+ ${HDR_COMPAT}
+ ${HDR_PUBLIC}
+ ${SRC_CORE}
+ ${SRC_EXTRA})
+
+if (EVENT__BUILD_SHARED_LIBRARIES)
+ # Prepare static library to be linked to tests that need hidden symbols
+ add_library(event_extra_static STATIC
+ ${HDR_PRIVATE}
+ ${HDR_COMPAT}
+ ${HDR_PUBLIC}
+ ${SRC_CORE}
+ ${SRC_EXTRA})
+
+ set(EVENT_EXTRA_FOR_TEST event_extra_static)
+
+ target_link_libraries(event_core ${OPENSSL_LIBRARIES}
+ ${CMAKE_THREAD_LIBS_INIT}
+ ${LIB_PLATFORM})
+
+ target_link_libraries(event ${OPENSSL_LIBRARIES}
+ ${CMAKE_THREAD_LIBS_INIT}
+ ${LIB_PLATFORM})
+
+ target_link_libraries(event_extra ${OPENSSL_LIBRARIES}
+ ${CMAKE_THREAD_LIBS_INIT}
+ ${LIB_PLATFORM})
+
+ set_target_properties(event
+ PROPERTIES SOVERSION
+ ${EVENT_ABI_LIBVERSION})
+
+ set_target_properties(event_core
+ PROPERTIES SOVERSION
+ ${EVENT_ABI_LIBVERSION})
+
+ set_target_properties(event_extra
+ PROPERTIES SOVERSION
+ ${EVENT_ABI_LIBVERSION})
+
+else (EVENT__BUILD_SHARED_LIBRARIES)
+ set(EVENT_EXTRA_FOR_TEST event_extra)
+endif (EVENT__BUILD_SHARED_LIBRARIES)
+
+#
+# Samples.
+#
+
+if (NOT EVENT__DISABLE_SAMPLES)
+ set(SAMPLES
+ dns-example
+ event-read-fifo
+ hello-world
+ signal-test
+ http-server
+ http-connect
+ time-test)
+
+ if (NOT EVENT__DISABLE_OPENSSL AND OPENSSL_LIBRARIES)
+ set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES})
+ CHECK_FUNCTION_EXISTS_EX(ERR_remove_thread_state EVENT__HAVE_ERR_REMOVE_THREAD_STATE)
+ set(CMAKE_REQUIRED_LIBRARIES "")
+
+ # Special sample with more than one file.
+ add_executable(https-client
+ sample/https-client.c
+ sample/openssl_hostname_validation.c
+ sample/hostcheck.c)
+
+ target_link_libraries(https-client
+ event_extra
+ ${LIB_APPS}
+ ${LIB_PLATFORM})
+
+ add_dependencies(https-client event_extra)
+
+ # Requires OpenSSL.
+ list(APPEND SAMPLES le-proxy)
+ endif()
+
+ foreach(SAMPLE ${SAMPLES})
+ add_executable(${SAMPLE}
+ sample/${SAMPLE}.c)
+
+ target_link_libraries(${SAMPLE}
+ event_extra
+ ${LIB_APPS}
+ ${LIB_PLATFORM})
+
+ add_dependencies(${SAMPLE} event_extra)
+ endforeach()
+
+ if (WIN32)
+ target_sources(dns-example PUBLIC
+ WIN32-Code/getopt.c
+ WIN32-Code/getopt_long.c)
+ endif()
+endif()
+
+if (NOT EVENT__DISABLE_BENCHMARK)
+ foreach (BENCHMARK bench bench_cascade bench_http bench_httpclient)
+ set(BENCH_SRC test/${BENCHMARK}.c)
+
+ if (WIN32)
+ list(APPEND BENCH_SRC
+ WIN32-Code/getopt.c
+ WIN32-Code/getopt_long.c)
+ endif()
+
+ add_executable(${BENCHMARK} ${BENCH_SRC})
+
+ target_link_libraries(${BENCHMARK}
+ event_extra
+ ${LIB_PLATFORM})
+
+ add_dependencies(${BENCHMARK} event_extra)
+ endforeach()
+endif()
+
+if (NOT EVENT__DISABLE_TESTS)
+ #
+ # Generate Regress tests.
+ #
+ if (NOT EVENT__DISABLE_REGRESS)
+
+ # (We require python to generate the regress tests)
+ find_package(PythonInterp)
+
+ if (PYTHONINTERP_FOUND AND PYTHON_VERSION_STRING VERSION_LESS "3.0.0")
+ set(__FOUND_USABLE_PYTHON 1)
+ endif()
+
+ if (__FOUND_USABLE_PYTHON)
+ message(STATUS "Generating regress tests...")
+
+ add_definitions(-DTINYTEST_LOCAL)
+
+ add_custom_command(
+ OUTPUT
+ ${CMAKE_CURRENT_SOURCE_DIR}/test/regress.gen.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/test/regress.gen.h
+ DEPENDS
+ event_rpcgen.py
+ test/regress.rpc
+ COMMAND ${PYTHON_EXECUTABLE} ../event_rpcgen.py regress.rpc
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
+
+ list(APPEND SRC_REGRESS
+ test/regress.c
+ test/regress.gen.c
+ test/regress.gen.h
+ test/regress_buffer.c
+ test/regress_bufferevent.c
+ test/regress_dns.c
+ test/regress_et.c
+ test/regress_finalize.c
+ test/regress_http.c
+ test/regress_listener.c
+ test/regress_main.c
+ test/regress_minheap.c
+ test/regress_rpc.c
+ test/regress_testutils.c
+ test/regress_testutils.h
+ test/regress_util.c
+ test/tinytest.c
+ ${SRC_CORE}
+ ${SRC_EXTRA})
+
+ if (WIN32)
+ list(APPEND SRC_REGRESS test/regress_iocp.c)
+ list(APPEND SRC_REGRESS test/regress_thread.c)
+ endif()
+
+ if (CMAKE_USE_PTHREADS_INIT)
+ list(APPEND SRC_REGRESS test/regress_thread.c)
+ endif()
+
+ if (ZLIB_LIBRARY)
+ list(APPEND SRC_REGRESS test/regress_zlib.c)
+ endif()
+
+ if (OPENSSL_LIBRARIES)
+ list(APPEND SRC_REGRESS test/regress_ssl.c)
+ endif()
+
+ add_executable(regress ${SRC_REGRESS})
+
+ # While building the test suite we don't want the visibility
+ # header trying to "dllimport" the symbols on windows (it
+ # generates a ton of warnings due to different link
+ # attributes for all of the symbols)
+ SET_TARGET_PROPERTIES(regress
+ PROPERTIES COMPILE_DEFINITIONS
+ "EVENT_BUILDING_REGRESS_TEST=1")
+
+ target_link_libraries(regress
+ ${LIB_APPS}
+ ${LIB_PLATFORM})
+ else()
+ message(WARNING "No suitable Python interpreter found, cannot generate regress tests!")
+ endif()
+ endif()
+
+ #
+ # Test programs.
+ #
+ # all of these, including the cmakelists.txt should be moved
+ # into the dirctory 'tests' first.
+ #
+ # doing this, we can remove all the DISABLE_TESTS stuff, and simply
+ # do something like:
+ #
+ # add_custom_targets(tests)
+ # add_executable(... EXCLUDE_FROM_ALL ...c)
+ # add_dependencis(tests testa testb testc)
+ # add_test(....)
+ #
+ # then you can just run 'make tests' instead of them all
+ # auto-compile|running
+ # - ellzey
+ set(TESTPROGS test-changelist
+ test-eof
+ test-fdleak
+ test-init
+ test-time
+ test-weof)
+
+ set(ALL_TESTPROGS
+ ${TESTPROGS}
+ test-dumpevents
+ test-ratelim)
+
+ # Create test program executables.
+ foreach (TESTPROG ${ALL_TESTPROGS})
+ add_executable(${TESTPROG}
+ test/${TESTPROG}.c)
+
+ target_link_libraries(${TESTPROG}
+ ${EVENT_EXTRA_FOR_TEST}
+ ${LIB_PLATFORM})
+
+ add_dependencies(${TESTPROG}
+ ${EVENT_EXTRA_FOR_TEST})
+ endforeach()
+
+ #
+ # We run all tests with the different backends turned on one at a time.
+ #
+
+ # Add event backends based on system introspection result.
+ set(BACKENDS "")
+
+ if (EVENT__HAVE_EPOLL)
+ list(APPEND BACKENDS EPOLL)
+ endif()
+
+ if (EVENT__HAVE_SELECT)
+ list(APPEND BACKENDS SELECT)
+ endif()
+
+ if (EVENT__HAVE_POLL)
+ list(APPEND BACKENDS POLL)
+ endif()
+
+ if (EVENT__HAVE_KQUEUE)
+ list(APPEND BACKENDS KQUEUE)
+ endif()
+
+ if (EVENT__HAVE_EVENT_PORTS)
+ list(APPEND BACKENDS EVPORT)
+ endif()
+
+ if (EVENT__HAVE_DEVPOLL)
+ list(APPEND BACKENDS DEVPOLL)
+ endif()
+
+ if (WIN32)
+ list(APPEND BACKENDS WIN32)
+ endif()
+
+
+ # Default environment variables turns off all event systems,
+ # then we enable each one, one at a time when creating the tests.
+ set(DEFAULT_TEST_ENV_VARS "EVENT_SHOW_METHOD=1;")
+ foreach(BACKEND ${BACKENDS})
+ set(BACKEND_ENV_VAR "EVENT_NO${BACKEND}=1")
+ list(APPEND DEFAULT_TEST_ENV_VARS "${BACKEND_ENV_VAR}")
+ endforeach()
+
+ # Macro that creates the ctest test for a backend.
+ macro(add_backend_test BACKEND_TEST_NAME ENV_VARS)
+ set(TEST_NAMES "")
+
+ foreach (TESTPROG ${TESTPROGS})
+ set(TEST_NAME ${TESTPROG}__${BACKEND_TEST_NAME})
+
+ add_test(${TEST_NAME}
+ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTPROG})
+
+ list(APPEND TEST_NAMES ${TEST_NAME})
+
+ set_tests_properties(${TEST_NAME}
+ PROPERTIES ENVIRONMENT "${ENV_VARS}")
+ endforeach()
+
+ # Dump events test.
+ if (__FOUND_USABLE_PYTHON)
+ set(TEST_NAME test-dumpevents__${BACKEND_TEST_NAME})
+
+ add_test(${TEST_NAME}
+ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-dumpevents |
+ ${PYTHON_EXECUTABLE}
+ ${CMAKE_CURRENT_SOURCE_DIR}/test/check-dumpevents.py)
+
+ set_tests_properties(${TEST_NAME}
+ PROPERTIES ENVIRONMENT "${ENV_VARS}")
+ else()
+ message(WARNING "test-dumpevents will be run without output check since python was not found!")
+ set(TEST_NAME test-dumpevents__${BACKEND_TEST_NAME}_no_check)
+
+ add_test(${TEST_NAME}
+ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-dumpevents)
+
+ set_tests_properties(${TEST_NAME}
+ PROPERTIES ENVIRONMENT "${ENV_VARS}")
+ endif()
+
+ # Regress tests.
+ if (NOT EVENT__DISABLE_REGRESS AND __FOUND_USABLE_PYTHON)
+ set(TEST_NAME regress__${BACKEND_TEST_NAME})
+
+ add_test(${TEST_NAME}
+ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/regress)
+
+ set_tests_properties(${TEST_NAME}
+ PROPERTIES ENVIRONMENT "${ENV_VARS}")
+
+ add_test(${TEST_NAME}_debug
+ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/regress)
+
+ set_tests_properties(${TEST_NAME}_debug
+ PROPERTIES ENVIRONMENT "${ENV_VARS};EVENT_DEBUG_MODE=1")
+ endif()
+ endmacro()
+
+ # Add the tests for each backend.
+ foreach(BACKEND ${BACKENDS})
+ # Enable this backend only.
+ set(BACKEND_ENV_VARS ${DEFAULT_TEST_ENV_VARS})
+ list(REMOVE_ITEM BACKEND_ENV_VARS EVENT_NO${BACKEND}=1)
+
+ # Epoll has some extra settings.
+ if (${BACKEND} STREQUAL "EPOLL")
+ add_backend_test(timerfd_${BACKEND}
+ "${BACKEND_ENV_VARS};EVENT_PRECISE_TIMER=1")
+
+ add_backend_test(changelist_${BACKEND}
+ "${BACKEND_ENV_VARS};EVENT_EPOLL_USE_CHANGELIST=yes")
+
+ add_backend_test(timerfd_changelist_${BACKEND}
+ "${BACKEND_ENV_VARS};EVENT_EPOLL_USE_CHANGELIST=yes;EVENT_PRECISE_TIMER=1")
+ else()
+ add_backend_test(${BACKEND} "${BACKEND_ENV_VARS}")
+ endif()
+ endforeach()
+
+ #
+ # Rate limiter tests.
+ #
+
+ # Group limits, no connection limit.
+ set(RL_BIN ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-ratelim)
+
+ add_test(test-ratelim__group_lim
+ ${RL_BIN}
+ -g 30000
+ -n 30
+ -t 100
+ --check-grouplimit 1000
+ --check-stddev 100)
+
+ # Connection limit, no group limit.
+ add_test(test-ratelim__con_lim
+ ${RL_BIN}
+ -c 1000
+ -n 30
+ -t 100
+ --check-connlimit 50
+ --check-stddev 50)
+
+ # Connection limit and group limit.
+ add_test(test-ratelim__group_con_lim
+ ${RL_BIN}
+ -c 1000
+ -g 30000
+ -n 30
+ -t 100
+ --check-grouplimit 1000
+ --check-connlimit 50
+ --check-stddev 50)
+
+ # Connection limit and group limit with independent drain.
+ add_test(test-ratelim__group_con_lim_drain
+ ${RL_BIN}
+ -c 1000
+ -g 35000
+ -n 30
+ -t 100
+ -G 500
+ --check-grouplimit 1000
+ --check-connlimit 50
+ --check-stddev 50)
+
+ # Add a "make verify" target, same as for autoconf.
+ # (Important! This will unset all EVENT_NO* environment variables.
+ # If they are set in the shell the tests are running using simply "ctest" or "make test" will fail)
+ if (WIN32)
+ # Windows doesn't have "unset". But you can use "set VAR=" instead.
+ # We need to guard against the possibility taht EVENT_NOWIN32 is set, and all test failing
+ # since no event backend being available.
+ file(TO_NATIVE_PATH ${CMAKE_CTEST_COMMAND} WINDOWS_CTEST_COMMAND)
+
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp/verify_tests.bat
+ "
+ set EVENT_NOWIN32=
+ \"${WINDOWS_CTEST_COMMAND}\"
+ ")
+
+ message(STATUS "${WINDOWS_CTEST_COMMAND}")
+
+ file(COPY ${CMAKE_CURRENT_BINARY_DIR}/tmp/verify_tests.bat
+ DESTINATION
+ ${CMAKE_CURRENT_BINARY_DIR}
+ FILE_PERMISSIONS
+ OWNER_READ
+ OWNER_WRITE
+ OWNER_EXECUTE
+ GROUP_READ
+ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE)
+
+ file(TO_NATIVE_PATH
+ "${CMAKE_CURRENT_BINARY_DIR}/verify_tests.bat" VERIFY_PATH)
+
+ add_custom_target(verify COMMAND "${VERIFY_PATH}"
+ DEPENDS event ${ALL_TESTPROGS})
+ else()
+ # On some platforms doing exec(unset) as CMake does won't work, so make sure
+ # we run the unset command in a shell instead.
+ # First we write the script contents.
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp/verify_tests.sh
+ "
+ #!/bin/bash
+ unset EVENT_NOEPOLL; unset EVENT_NOPOLL; unset EVENT_NOSELECT; unset EVENT_NOWIN32; unset EVENT_NOEVPORT; unset EVENT_NOKQUEUE; unset EVENT_NODEVPOLL
+ ${CMAKE_CTEST_COMMAND}
+ ")
+
+ # Then we copy the file (this allows us to set execute permission on it)
+ file(COPY ${CMAKE_CURRENT_BINARY_DIR}/tmp/verify_tests.sh
+ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
+ FILE_PERMISSIONS
+ OWNER_READ
+ OWNER_WRITE
+ OWNER_EXECUTE
+ GROUP_READ
+ GROUP_EXECUTE
+ WORLD_READ
+ WORLD_EXECUTE)
+
+ # Create the target that runs the script.
+ add_custom_target(verify
+ COMMAND
+ ${CMAKE_CURRENT_BINARY_DIR}/verify_tests.sh
+ DEPENDS
+ event
+ ${ALL_TESTPROGS})
+ endif()
+
+ if (NOT EVENT__DISABLE_REGRESS AND __FOUND_USABLE_PYTHON)
+ add_dependencies(verify regress)
+ endif()
+
+ if (EVENT__COVERAGE)
+ include(CodeCoverage)
+
+ setup_target_for_coverage(
+ verify_coverage # Coverage target name "make verify_coverage"
+ make # Test runner.
+ coverage # Output directory.
+ verify) # Arguments passed to test runner. "make verify"
+ endif()
+
+ enable_testing()
+
+ include(CTest)
+endif()
+
+#
+# Installation preparation.
+#
+
+# Allow the user to override installation directories.
+set(EVENT_INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries")
+set(EVENT_INSTALL_BIN_DIR bin CACHE PATH "Installation directory for executables")
+set(EVENT_INSTALL_INCLUDE_DIR include CACHE PATH "Installation directory for header files")
+
+if(WIN32 AND NOT CYGWIN)
+ set(DEF_INSTALL_CMAKE_DIR cmake)
+else()
+ set(DEF_INSTALL_CMAKE_DIR lib/cmake/libevent)
+endif()
+
+set(EVENT_INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Installation directory for CMake files")
+
+# Make sure the paths are absolute.
+foreach(p LIB BIN INCLUDE CMAKE)
+ set(var EVENT_INSTALL_${p}_DIR)
+ if(NOT IS_ABSOLUTE "${${var}}")
+ set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
+ endif()
+endforeach()
+
+# Export targets (This is used for other CMake projects to easily find the libraries and include files).
+export(TARGETS event event_extra event_core
+ FILE "${PROJECT_BINARY_DIR}/LibeventTargets.cmake")
+export(PACKAGE libevent)
+
+# Generate the config file for the build-tree.
+set(EVENT__INCLUDE_DIRS
+ "${PROJECT_SOURCE_DIR}/include"
+ "${PROJECT_BINARY_DIR}/include")
+
+set(LIBEVENT_INCLUDE_DIRS
+ ${EVENT__INCLUDE_DIRS}
+ CACHE PATH "Libevent include directories")
+
+configure_file(${PROJECT_SOURCE_DIR}/cmake/LibeventConfigBuildTree.cmake.in
+ ${PROJECT_BINARY_DIR}/LibeventConfig.cmake
+ @ONLY)
+
+# Generate the config file for the installation tree.
+file(RELATIVE_PATH
+ REL_INCLUDE_DIR
+ "${EVENT_INSTALL_CMAKE_DIR}"
+ "${EVENT_INSTALL_INCLUDE_DIR}") # Calculate the relative directory from the Cmake dir.
+
+# Note the EVENT_CMAKE_DIR is defined in LibeventConfig.cmake.in,
+# we escape it here so it's evaluated when it is included instead
+# so that the include dirs are givenrelative to where the
+# config file is located.
+set(EVENT__INCLUDE_DIRS
+ "\${EVENT_CMAKE_DIR}/${REL_INCLUDE_DIR}")
+
+configure_file(${PROJECT_SOURCE_DIR}/cmake/LibeventConfig.cmake.in
+ ${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/LibeventConfig.cmake
+ @ONLY)
+
+# Generate version info for both build-tree and install-tree.
+configure_file(${PROJECT_SOURCE_DIR}/cmake/LibeventConfigVersion.cmake.in
+ ${PROJECT_BINARY_DIR}/LibeventConfigVersion.cmake
+ @ONLY)
+
+# Define the public headers.
+set_target_properties(event event_core event_extra
+ PROPERTIES PUBLIC_HEADER "${HDR_PUBLIC}")
+
+#
+# Install targets.
+#
+install(TARGETS event event_core event_extra
+ EXPORT LibeventTargets
+ RUNTIME DESTINATION "${EVENT_INSTALL_BIN_DIR}" COMPONENT bin
+ LIBRARY DESTINATION "${EVENT_INSTALL_LIB_DIR}" COMPONENT lib
+ ARCHIVE DESTINATION "${EVENT_INSTALL_LIB_DIR}" COMPONENT lib
+ PUBLIC_HEADER DESTINATION "${EVENT_INSTALL_INCLUDE_DIR}/event2" COMPONENT dev)
+
+# Install compat headers
+install(FILES ${HDR_COMPAT}
+ DESTINATION
+ "${EVENT_INSTALL_INCLUDE_DIR}"
+ COMPONENT dev)
+
+# Install the configs.
+install(FILES
+ ${PROJECT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/LibeventConfig.cmake
+ ${PROJECT_BINARY_DIR}/LibeventConfigVersion.cmake
+ DESTINATION
+ "${EVENT_INSTALL_CMAKE_DIR}"
+ COMPONENT dev)
+
+# Install exports for the install-tree.
+install(EXPORT LibeventTargets
+ DESTINATION
+ "${EVENT_INSTALL_CMAKE_DIR}"
+ COMPONENT dev)
+
+set(LIBEVENT_LIBRARIES
+ event
+ event_core
+ event_extra
+ CACHE STRING "Libevent libraries")
+
+message("")
+message(" ---( Libevent " ${EVENT_VERSION} " )---")
+message("")
+message(STATUS "Available event backends: ${BACKENDS}")
+message(STATUS "CMAKE_BINARY_DIR: " ${CMAKE_BINARY_DIR})
+message(STATUS "CMAKE_CURRENT_BINARY_DIR: " ${CMAKE_CURRENT_BINARY_DIR})
+message(STATUS "CMAKE_SOURCE_DIR: " ${CMAKE_SOURCE_DIR})
+message(STATUS "CMAKE_CURRENT_SOURCE_DIR: " ${CMAKE_CURRENT_SOURCE_DIR})
+message(STATUS "PROJECT_BINARY_DIR: " ${PROJECT_BINARY_DIR})
+message(STATUS "PROJECT_SOURCE_DIR: " ${PROJECT_SOURCE_DIR})
+message(STATUS "CMAKE_MODULE_PATH: " ${CMAKE_MODULE_PATH})
+message(STATUS "CMAKE_COMMAND: " ${CMAKE_COMMAND})
+message(STATUS "CMAKE_ROOT: " ${CMAKE_ROOT} )
+message(STATUS "CMAKE_SYSTEM: " ${CMAKE_SYSTEM} )
+message(STATUS "CMAKE_SYSTEM_NAME: " ${CMAKE_SYSTEM_NAME} )
+message(STATUS "CMAKE_SYSTEM_VERSION: " ${CMAKE_SYSTEM_VERSION} )
+message(STATUS "CMAKE_SYSTEM_PROCESSOR: " ${CMAKE_SYSTEM_PROCESSOR} )
+message(STATUS "CMAKE_SKIP_RPATH: " ${CMAKE_SKIP_RPATH} )
+message(STATUS "CMAKE_VERBOSE_MAKEFILE: " ${CMAKE_VERBOSE_MAKEFILE} )
+message(STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS} )
+message(STATUS "CMAKE_BUILD_TYPE: " ${CMAKE_BUILD_TYPE} )
+message(STATUS "CMAKE_C_COMPILER: " ${CMAKE_C_COMPILER} )
+message(STATUS "CMAKE_AR: " ${CMAKE_AR} )
+message(STATUS "CMAKE_RANLIB: " ${CMAKE_RANLIB} )
+message("")
+
diff --git a/protocols/Telegram/tgl/libevent/ChangeLog b/protocols/Telegram/tgl/libevent/ChangeLog
new file mode 100644
index 0000000000..1499637504
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/ChangeLog
@@ -0,0 +1,1402 @@
+Changes in version 2.1.5-beta (5 January 2015)
+
+ Security Fixes (evbuffers)
+ o Avoid integer overflow bugs in evbuffer_add() and related functions. See CVE-2014-6272 advisory for more information. (d49bc0e88b81a5812116074dc007f1db0ca1eecd)
+
+ New APIs (evconnlistener)
+ o Provide support for SO_REUSEPORT through LEV_OPT_REUSABLE_PORT (b625361 Maciej Soltysiak)
+
+ Bugfixes (core)
+ o Fix use-after-free error in EV_CLOSURE_EVENT callback (3cc0eac John Ohl)
+ o Fix race caused by event_active (3c7d6fc vjpai)
+
+ Bugfixes (evbuffer)
+ o Fix evbuffer_peek() with len==-1 and start_at non-NULL. (ba59923)
+ o Consistently check for failure from evbuffer_pullup() (60f8f72)
+ o Fix evbuffer_peek() with len==-1 and start_at non-NULL. (fb7e76a)
+
+ Bugfixes (windows, IOCP)
+ o be async: avoid double close() (f133b86 Azat Khuzhin)
+
+ Bugfixes (bufferevents)
+ o Fix issue #127, double free for filterevents that use BEV_OPT_CLOSE_ON_FREE (2c82aa0 John Ohl)
+ o make bufferevent_getwatermark api more robust (a21e510 ufo2243)
+ o [Bugfix] fix bufferevent setwatermark suspend_read (b34e4ac ufo2243)
+ o bufferevent_openssl: reset fd_is_set when setfd with -1 is called (3da84c2 Azat Khuzhin)
+ o Fix compilation for older OpenSSL versions. (5c7282f Joakim Soderberg)
+
+ New APIs (evhttp)
+ o Add evhttp_connection_set_family() to set addrinfo->family for DNS requests (12c29b0 Azat Khuzhin)
+ o Implement interface that provides the ability to have an outbound evhttp_connection free itself once all requests have completed (2b9ec4c,10fe4f John Ohl)
+
+ New APIs (core)
+ o Implement new/free for struct evutil_monotonic_timer and export monotonic time functions (f2645f8 Andrea Shepard)
+
+ Bugfixes (evdns)
+ o Load hosts file on Windows. (a0b247c Vilmos Nebehaj)
+ o Don't truncate hosts file path on Windows. (d0dc861 Vilmos Nebehaj)
+ o Fix a crash in evdns related to shutting down evdns (9f39c88,e8fe749)
+ o evdns: avoid read-after-free in evdns_request_timeout_callback() (61262a0 Azat Khuzhin)
+ o Correctly handle allocation failures in evdns_getaddrinfo (6a53d15)
+ o evdns: fix EVDNS_BASE_DISABLE_WHEN_INACTIVE in case retransmit/retry (74d0eee Azat Khuzhin)
+ o evdns: add retry/reissue tests for EVDNS_BASE_DISABLE_WHEN_INACTIVE (3ca9d43 Azat Khuzhin)
+ o evdns: fail ns after we are failing/retrasmitting request (97c750d Azat Khuzhin)
+
+ Bugfixes (evhttp)
+ o http: reset connection before installing retry timer (fix http retries handling) (bc79cc5 Azat Khuzhin)
+
+
+ Testing
+ o regress_dns: fix leaks in getaddrinfo_async{,_cancel_stress} tests (2fdc5f2 Azat Khuzhin)
+ o test: add family argument for http_connection_test_() (177b8a7 Azat Khuzhin)
+ o test: add regress for evhttp_connection_set_family() with AF_INET and AF_UNSPEC (42aefeb Azat Khuzhin)
+ o test/http: add regress test for set family to AF_INET6 (3fbf3cc Azat Khuzhin)
+ o Update to a more recent tinytest_macros. (8da5a18)
+ o test/regress: add simplestsignal: to track reorder bugs separately (b897bef Azat Khuzhin)
+ o test/evbuffer_peek: add regress in case we have first buffer greater (e2d139d Azat Khuzhin)
+ o More evbuffer_peek() test cases (154006a)
+ o use correct tt macro for pointer compare (08c88ea)
+ o regress_buffer: fix 'memcmp' compare size (79800df Maks Naumov)
+ o Fix a use-after-free in unit tests. CID 752027 (3739057)
+ o Fix a dead-code warning in unit tests. CID 1193548 (c119f24)
+ o Use evutil_weakrand() in unit tests. (a677b72, 364c110)
+ o Use a more precise calculation for max in time-ratelim.c (ca5b5c7)
+ o Make a buffer larger in the tests to avoid a scary evbuffer_copyout_from() (fb57b8b)
+ o Fix several memory leaks in the unit tests. (89c1a3b)
+ o Add test for evhttp_connection_free_on_completion (b0e9924 John Ohl)
+ o Fix annoying heisenbug in test-time.c (cb73704)
+
+ Sample code
+ o Make http-server.c output into good html5 (6d72bdc)
+ o Use FindClose for handle from FindFirstFile in http-server.c (6466e88)
+ o https-client: add -retries argument, for connection retries (d9da844 Azat Khuzhin)
+
+ Bugfixes (build)
+ o Add missing headerfile for cmake (15d90cc Trond Norbye)
+ o ignore one more test binary (b6593aa Michael Richardson)
+ o ignore config.cache/test-driver files (c83f333 Mike Frysinger)
+ o add a --disable-samples configure flag (0c492b3 Mike Frysinger)
+ o Add a few files created by "make verify" to .gitignore. (1a8295a Pierre Phaneuf)
+ o updates in cmake build (27bd9fa Sergey Nikulov)
+ o Fix cmake error when the Module path has more than one entry. (befbd13 Acer Yang)
+ o Fix CMake shared library build (e69d910 Nobuaki Sukegawa)
+ o Fix warnings when compiling with clang 3.5 (f5b4765 John Ohl)
+ o Fix mixed declarations and code (forbidden by ISO C90) (8afbdbc Thomas Bernard)
+
+ Bugfixes (miscellaneous)
+ o tree.h: drop duplicated content of tree.h (6193187 Azat Khuzhin)
+ o evdns: disable probing with EVDNS_BASE_DISABLE_WHEN_INACTIVE (610410b,ad0493e,fea86a6,d83b337,5ca9e97 Azat Khuzhin)
+ o [Bugfix] fix grammer error (3a4d249 ufo2243)
+ o Change return type of evutil_load_windows_system_library_ to HMODULE (f691389)
+ o Fix a c90 warning (76643dd)
+ o Fix a typo in a doxygen comment. Reported by 亦得. (be1aeff)
+ o remove trailing comma from enum (b361b8a Jean-Philippe Ouellet)
+
+ Bugfixes (FreeBSD)
+ o Handle ENOTCAPABLE from FreeBSD - this is returned if an event in the changelist is for an FD that has been closed. (6fd7394 Adrian Chadd)
+
+
+
+Changes in version 2.1.4-alpha (21 Mar 2014)
+
+ Libevent 2.1.4-alpha adds a number of new miscellaneous APIs to make
+ Libevent more useful, including support for early close detection with
+ epoll via EPOLLRDHUP, triggering bufferevent callbacks, adding more
+ evhttp callbacks, and more. There are also numerous bugfixes, including
+ a number for finalize-related issues from 2.1.3-alpha; and an
+ alternative (non-primary!) cmake-based build mechanism.
+
+ New APIs (core)
+ o Added event_base_get_num_events() (0fa107d Mobai Zhang)
+ o New event_base_active_by_fd API (865a142 Greg Hazel, 5c9da9a, 87fa2b0)
+ o Add event_base_active_by_signal by analogy (4865943)
+ o Add access to max event count stats (5173bef, efbd3dc, 26230a2
+ Andrew Sweeney)
+ o Implemented EV_CLOSED event for epoll backend
+ (EPOLLRDHUP). (b1b69ac Diego Giagio, 53d2793, 43ffcf6, dfe1e52
+ Marcin Juszkiewicz, ff26633 Joakim Soderberg, 3908a5e)
+
+ New APIs (evutil_secure_rng)
+ o Add evutil_secure_rng_set_urandom_device_file (2bbb5d7)
+
+ New APIs (bufferevents)
+ o Add function to fetch underlying ratelimit cfg (4b3d5af Mark Ellzey)
+ o Pass and return const for bufferevent_get_token_bucket_cfg (1c77fbb
+ Mark Ellzey)
+ o Add watermark introspection (4ce242b Ondřej Kuzník)
+ o Add an option to trigger bufferevent I/O callbacks (61ee18b Ondřej Kuzník)
+ o Add an option to trigger bufferevent event callbacks (a7384c7
+ Ondřej Kuzník)
+ o Clarifications in response to merge req. comments (bd41947 Ondřej
+ Kuzník)
+ o Minor optimizations on bufferevent_trigger options (a3172a4)
+
+ New APIs (evhttp)
+ o Add evhttp_connection_get_server(). (a7f82a3 Maxime Henrion)
+ o add a http default content type option (5a5acd9 Nicolas Martyanoff)
+ o http: implement new evhttp_connection_get_addr() api. (0c7f040 Azat
+ Khuzhin)
+ o Add a variant of evhttp_send_reply_chunk() with a callback on
+ evhttp_write_buffer() (8d8decf Julien BLACHE)
+ o Allow registering callback for parsing HTTP headers (b0bd7fe Balint Reczey)
+ o Provide on request complete callback facility (b083ca0 Andrew Sweeney)
+ o evhttp_request_set_on_complete_cb to be more specific about what
+ the function actually does and usage (da86dda Andrew Sweeney)
+ o Update unit test to make sure that the callback happens after the
+ output data is written (b85f398 Andrew Sweeney)
+
+ Features (evdns)
+ o bug fix for issues #293 evdns_base_load_hosts doesn't remove
+ outdated addresses (954d2f9, f03d353, 45eba6f Kuldeep Gupta)
+
+ Features: (cmake build support)
+ o Initial CMake commit. (e415196 Joakim Soderberg)
+ o Add all tests and benchmarks to CMake project. (e9fc014 Joakim Soderberg)
+ o More work on adding tests to CMake project (99c1dc3 Joakim Soderberg)
+ o Generate a dummy evconfig-private.h so things build
+ properly. (ce14def Joakim Soderberg)
+ o Link libm on unix platforms. (58fcd42 Joakim Soderberg)
+ o Added some GCC specific options. (19222e5 Joakim Soderberg)
+ o Use evutil_closesocket instead. (dbf2b51 Joakim Soderberg)
+ o Add copyright and licensing files for CMake modules. (c259d53
+ Joakim Soderberg)
+ o Only include WIN32 getopt where it is used. (9bbce0b Joakim Soderberg)
+ o Fix bench_cascade program on Windows. (78da644 Joakim Soderberg)
+ o Don't segfault on no found event backend. (8f2af50 Joakim Soderberg)
+ o Only test the event backends available on the system. (7ea4159
+ Joakim Soderberg)
+ o Added a "make verify" target. (e053c4f Joakim Soderberg)
+ o Fix the make "verify" target on Windows. (67e5d74 Joakim Soderberg)
+ o Get rid of deprecation warnings for OpenSSL on OSX 10.7+ (69c3516
+ Joakim Söderberg)
+ o Fix kqueue support. (a831f2f Joakim Söderberg)
+ o Added a test for testing if kqueue works with pipes. (2799b35
+ Joakim Söderberg)
+ o Change the BSD license from 4 to 3-clause. (86df3ed Joakim Soderberg)
+ o Minimum required python version is 2.4. (968e97b Joakim Soderberg)
+ o Get rid of unknown pragma warnings. (0ef1d04 Joakim Soderberg)
+ o Add a "make verify_coverage" target generation coverage
+ info. (f2483f8 Joakim Soderberg)
+ o Fix the "make verify" target on NetBSD (4ac086a Joakim Soderberg)
+ o Only look for ZLib when it is used (if tests are
+ included). (f780593 Joakim Soderberg)
+ o Added EVENT__ENABLE_GCC_WARNINGS, turns all warnings into
+ errors. (dd413bd Joakim Soderberg)
+ o Add CMake config and install targets. (f3446ed Joakim Soderberg)
+ o Fix typo (4b754df Joakim Soderberg)
+ o Some work on making it possible to simply do add_subdirectory() on
+ the project. (49ab363 Joakim Soderberg)
+ o Set USE_DEBUG=1 on EVENT__ENABLE_VERBOSE_DEBUG (fd42e70 Joakim Soderberg)
+ o Fix so that old nmake project still builds. (24d6466 Joakim
+ Soderberg)
+ o Rename README to README.md and use markdown to format. (d2bc39a
+ Joakim Soderberg)
+ o Update README with CMake build instructions. (604b8cc Joakim Soderberg)
+ o Clean up the README some. (8d4cb35 JoakimSoderberg)
+ o Forgotten headers for old nmake project compatability. (8697b99
+ Joakim Soderberg)
+ o Change all uses of WIN32 to _WIN32 (4e14395 Joakim Söderberg)
+ o Fix include bug. (2024467 Joakim Söderberg)
+ o Check if we're on OSX before disabling deprecation in le-proxy
+ (8b40a5b Joakim Söderberg)
+ o Fix broken autotools build. (ae1bd82 Joakim Söderberg)
+ o Disclaimerize cmake a little in the README (d03b5bf)
+ o Fix CMake compile when OpenSSL is disabled. (e423d42 Joakim
+ Söderberg)
+ o CMake: Get rid of python not found warning when regress tests
+ turned off. (d38d798 Joakim Söderberg)
+ o Fix https-client compilation on Windows. (d7be788 Joakim Soderberg)
+ o Guard against EVENT_NOWIN32 being set during testing. (f1715b4
+ Joakim Soderberg)
+ o Check for OSX when checking for clang. (e212c54 Joakim Soderberg)
+ o Added a Travis-CI configuration file. (8c0f0a9 Joakim Soderberg)
+ o Added -Qunused-arguments for clang on macosx (ed99d92 Trond Norbye)
+ o Rename event_extras to event_extra (a0dd5df Trond Norbye)
+ o Add option to build shared library (4545fa9 Trond Norbye)
+ o Add -Qunused-arguments for clang on macos (b56611d Trond Norbye)
+ o Add cmake-related files to .gitignore (e061321 Trond Norbye)
+ o Export event_extra not event_extras. (2b41bcf Joakim Söderberg)
+
+ Bugfixes (core)
+ o If evsel->del() fails, don't leave the evmap in an inconsistent
+ state (9b5a527 Maxime Henrion)
+ o Move event_debug_note_teardown_ before mm_free. (69b5c64)
+ o Check CLOCK_MONOTONIC_* at runtime if needed. (911abf3)
+ o Fix reinit of fds with EV_WRITE but not EV_READ. (ebfd8a8 maksqwe)
+ o Tweaked callbacks to prevent race condition
+ (https://github.com/libevent/libevent/issues/104) (40830f1, 2ea15ed
+ John Ohl)
+ o Move assert(ev) to before we use ev in EV_CLOSURE_EVENT_FINALIZE
+ case (9805972)
+
+ Bugfixes (evhttp)
+ o Fix a double close() bug in evhttp when the underlying bufferevent uses
+ BEV_OPT_CLOSE_ON_FREE. (31db8a0 Maxime Henrion)
+ o Fix an unlikely but possible error case for http connections (f22049e)
+ o Avoid racy bufferevent activation (5eb1788 Nate Rosenblum)
+
+ Bugfixes on 2.0 (Windows)
+ o Use windows vsnprintf fixup logic on all windows environments (e826f19)
+ o libevent/win32_dealloc() : fix sizeof(pointer) vs sizeof(*pointer)
+ (b8f5980 Frank Denis)
+
+ Bugfixes (evutil_secure_rng)
+ o When we seed from /proc/sys/kernel/random/uuid, count it as success
+ (e35b540)
+ o We should return after arc4random_buf() (1ea1f26 Makoto Kato)
+ o Avoid other RNG initialization FS reads when urandom file is
+ specified (9695e9c)
+ o Really remove RNG seeds from the stack (f5ced88)
+ o Fix another arc4random_buf-related warning (e64a2b0)
+
+ Bugfixes (bufferevents)
+ o Initialize async bufferevent timeout CBs unconditionally (af9b2a7)
+
+ Bugfixes (evdns)
+ o Checking request nameserver for NULL, before using it. (5c710c0
+ Belobrov Andrey)
+ o Fix SEGFAULT after evdns_base_resume if no nameservers
+ installed. (14971a8 Azat Khuzhin)
+ o Actually use the log facility for reporting evdns problems. (e1766a1)
+ o Fix SEGFAULT after evdns_base_resume if no nameservers
+ installed. (f8d7df8 Azat Khuzhin)
+ o fix for ServFail from RIPE Atlas release (62f596b Antony Antony)
+
+ Bugfixes (compilation)
+ o Fix test compilation with nmake: add the gdi.lib dependency (5ba8ab7)
+ o Whoops. It is gdi.lib, not gdi32.lib. (github issue #61) (8ab612e)
+ o Don't use return since return type is void and build error occurs
+ using clang (838161d Makoto Kato)
+ o Use void casts to suppress some "unchecked return value" warns (7080d55)
+ o rpcgen: Generate regress.gen.[c,h] in build rather than src dir
+ (243386c Ross Lagerwall)
+ o Fix a compiler warning when checking for arc4random_buf linker
+ breakage. (5cb3865)
+ o Fix 'make distcheck' by adding regress.gen.[ch] to DISTCLEANFILES
+ (239d834)
+
+ o Fix a c90 warning (c207682)
+ o Fix consts in WIN32-Code/getopt*.[ch] (57abb35)
+
+ Bugfixes (locks, synchronization)
+ o Missed lock acquire/release in event_base_cancel_single_callback_()
+ (d3d999a Azat Khuzhin)
+ o Fix locking in bufferevent_get_options_(). (dbc9cd4 Maxime Henrion)
+
+ Bugfixes (leaks)
+ o Avoid leaking segment mappings when offset is not a page multiple (d409514)
+
+ Testing
+ o Add tests for evdns_base_resume(). (1cd9ff5 Azat Khuzhin)
+ o Fix dns/leak_resume_send_err test. (7e876df Azat Khuzhin)
+ o Add checks for evhttp_connection_get_server() in unit
+ tests. (fbc323b Maxime Henrion)
+ o Fix a (failure-only) null dereference in the unit tests (1104d0b)
+ o Fix a logic error in test_evbuffer_freeze (7765884)
+ o Add missing check to test_evbuffer_file_segment_add_cleanup_cb (eba4506)
+ o Fix some crash-on-fail cases in DNS regression tests (87cd6f0)
+ o DNS tests: add a missing check (f314900)
+ o Finalize tests: add a missing check (82b6956)
+ o test_evutil_rtrim: add another missing check. (e193c95)
+ o regress_main: logging all if env EVENT_DEBUG_LOGGING_ALL isset
+ (611e28b Azat Khuzhin)
+ o regress_http: add tests for evhttp_connection_get_addr() (4dd500c
+ Azat Khuzhin)
+ o Update to the latest version of tinytest (7a80476)
+ o Heap-allocate zlib data structure in regress_zlib tests (4947c18)
+
+ Performance tweaks (core)
+ o Avoid redundant syscall to make a nonblocking socket nonblocking
+ (42c03da Maxime Henrion)
+ o Avoid redundant syscall if making a socket cloexec twice (1f29b18)
+ o Avoid redundant invocations of init_extension_functions for IOCP (3b77d62)
+
+ Documentation
+ o Document that arc4random is not a great cryptographic PRNG. (6e49696)
+ o Small doxygen tweaks (6e67b51)
+ o Try another doxygen tweak (ccf432b)
+ o Clarify event_base_loop exit conditions (031a803)
+ o Fix a typo (be7bf2c Ondřej Kuzník)
+ o Document deferred eventcb behaviour (13a9a02 Ondřej Kuzník)
+ o Typo fixes from Linus Nordberg (cec62cb, 8cd695b)
+ o Fix duplicate paragraph in evbuffer_ptr documentation (58408ee)
+
+ Code Improvements (coverity)
+ o Fix a pile of coverity warnings in the unit tests (867f401)
+ o Fix coverity warnings in benchmark tools. (ff7f739)
+ o Whoops; fix compilation in bench.c (544cf88)
+ o Remove spurious checks in evrpc.c error cases (coverity) (991b362)
+ o Fix a couple of compilation warnings in regress_http.c (860767e)
+ o Fix even more coverity warnings. (d240328)
+ o Stop checking for inet_aton; we don't use it. (f665d5c)
+ o Add an include to evrpc-internal to fix openbsd compilation warning
+ (5e161c6)
+
+ Cleanups
+ o Remove an unreachable return statement in minheap-internal.h (e639a9e)
+ o Refactor evmap_{io,signal}_active_() to tolerate bad inputs (974c60e)
+ o Fix needless bufferevent includes in evdns.c (254c04e)
+ o Fix a couple of "#ifdef WIN32" instances (88ecda3)
+ o Remove unneeded declaration in bufferevent-internal.h (4c8ebcd)
+
+ Sample code
+ o le-proxy: Fail more gracefully if opening listener fails (44b2491)
+ o http-server: drop uri_root from base_url in http-server. (6171e1c Azat Khuzhin)
+ o https-client: POST supported, args supported (c5887f7 Alexey Ozeritsky)
+ o https-client: code cleanup (29af65e Alexey Ozeritsky)
+ o https-client: Small tweaks to https-client.c (90786eb)
+ o https-client: Set hostname for SNI extension (by f69m) (d1976f8)
+ o https-client: add a cast to https-client.c (462e6b6)
+
+
+
+Changes in version 2.1.3-alpha (1 May 2013)
+
+ Libevent 2.1.3-alpha fixes various bugs, adds new unit tests, and cleans
+ up the code in a couple of places. It has a new callback in evhttp for
+ reporting errors during a request, a new feature for allowing evdns to
+ not keep the event_base looping when there are no requests inflight, and
+ example code for writing an https client.
+
+ Libevent 2.1.3-alpha also has an important new (experimental) event
+ finalization feature to allow safe event teardown in multithreaded
+ programs. This ought to fix the longstanding bug with deadlocks in
+ multithreaded use of SSL-based bufferevents that some people have been
+ experiencing since Libevent 2.0.
+
+
+ Core (event finalization)
+ o Implement event_finalize() and related functions to avoid certain
+ deadlocks (8eedeab)
+ o Use finalization feature so bufferevents can avoid deadlocks (02fbf68)
+ o Always run pending finalizers when event_base_free() is called (e9ebef8)
+ o Remove bufferevent_del_generic_timeout_cbs as now unused (4ea4c6a)
+ o More documentation for finalization feature (a800b91)
+ o Make the event_finalize* functions return an error code (5d11f4f)
+ o Mark the finalize stuff as experiemental in case it needs to
+ change (23e2e29)
+
+ Evdns
+ o evdns: New flag to make evdns not prevent the event loop from
+ exiting (6b7fa62 Azat Khuzhin)
+
+ Bugfixes (Core)
+ o Make event_remove_timer behave correctly with persistent timers (5623e80)
+ o Unit test for event_remove_timer with EV_PERSIST. (96150dd)
+ o Double-check next timeout when adding events (9443868 Nate Rosenblum)
+ o event_base_update_cache_time should be a no-op if the loop isn't
+ running (5e6fa2a)
+
+ Bugfixes (evhttp, crash fix, from 2.0)
+ o fix #73 and fix http_connection_fail_test to catch it (b618204 Greg Hazel)
+
+ Bugfixes (compilation and portability, from 2.0)
+ o Fix compilation with WIN32_HAVE_CONDITION_VARIABLES enabled (7e45739)
+ o Fix missing AC_PROG_SED on older Autoconfs (9ab2b3f Tay Ray Chuan)
+ o Backport libevent to vanilla Autoconf 2.59 (as used in RHEL5)
+ (74d4c44 Kevin Bowling)
+ o Use AC_CONFIG_HEADERS in place of AM_CONFIG_HEADERS for autmake
+ 1.13 compat (817ea36)
+ o Rename configure.in to configure.ac to appease newer autoconfs (0c79787)
+ o Avoid using top_srcdir in TESTS: new automakes do not like this (a55514e)
+
+ Bugfixes (resource leaks/lock errors on error, from 2.0)
+ o Avoid leaking fds on evconnlistener with no callback set (69db261)
+ o Avoid double-close on getsockname error in evutil_ersatz_socketpair
+ (0a822a6)
+ o Fix a locking error in bufferevent_socket_get_dns_error. (0a5eb2e)
+
+ Documentation Fixes (from 2.0)
+ o Fix a mistake in evbuffer_remove() arguments in example http server code
+ (c322c20 Gyepi Sam)
+ o Fix a typo in a comment in buffer.h. Spotted by Alt_F4 (773b0a5)
+
+ Documentation Fixes
+ o minor documentation typos (809586a Patrick Pelletier)
+ o Fix cut-and-paste err in whatsnew-2.1 (49905ac)
+ o Fix comment to refer to sample/include.am correctly (9e8cdf3 Sebastian
+ Hahn)
+ o Fix typo : Dispatching instead of Dispaching (0c2bacc Volker Lendecke)
+ o fix some hinky indentation in evhttp_make_request (80e220e Patrick
+ Pelletier)
+ o "buffer" spelling (a452811 Patrick Pelletier)
+ o Specify return behavior in header for evbuffer_pullup() in corner case
+ (cf8d1cd Dan Petro)
+ o Clarify an important point about event_base_foreach_event() (920a5e6)
+
+ Compilation Fixes/Tool Support
+ o avoid valgrind false positive by zeroing epoll_event (1258614 Patrick
+ Pelletier)
+ o Fix harmless clang enum warning (b452a43 Sebastian Hahn)
+ o remove all exes on "make clean", not just regress.exe (974bfa0 Patrick
+ Pelletier)
+ o Make --disable-libevent-regress work again (787fd74)
+ o Do not build strlcpy.c when it will have no code. (4914620)
+
+ Portability Fixes
+ o When EWOULDBLOCK is not EAGAIN, treat it as equivalent to it (bf7a0ff)
+ o Preliminary changes for Minix3. (0dda56a Nicholas Heath)
+ o Use AC_CONFIG_HEADERS in place of AM_CONFIG_HEADERS for autmake 1.13
+ compat (bf278b)
+ o Avoid using $(top_srcdir) in TESTS. (2863c83)
+ o build test/test-script.sh on systems with a less-featureful $< (f935e21)
+ o Implement EVUTIL_ERR_IS_EAGAIN on windows. (42aaf4d)
+
+ Evhttp changes:
+ o Fix ipv6 support for http. When URL contain domain, not IP
+ address. (71e709c Azat Khuzhin)
+ o uri decode: fix for warning "use of uninitialised value" (64b6ece Azat
+ Khuzhin)
+ o uri decode: changed the test for the existence of the next character
+ (e1903e3 Azat Khuzhin)
+ o Move prototype of evhttp_decode_uri_internal() to http-internal.h
+ (de8101a Azat Khuzhin)
+ o Test: decoding just part of string with evhttp_decode_uri_internal()
+ (1367653 Azat Khuzhin)
+ o Add new error_cb for actual reporting of HTTP request errors. (7b07719
+ Azat Khuzhin)
+ o Add test for EVREQ_HTTP_REQUEST_CANCEL into http_cancel_test() (862c217
+ Azat Khuzhin)
+ o Drop extra header http_struct.h from regress_http.c (54cc800 Azat Khuzhin)
+
+ Testing
+ o Add regress test ipv6_for_domain. (9ec88bd Azat Khuzhin)
+ o Add an environment variable (EVENT_DEBUG_MODE) to run unit tests in debug
+ mode (2fad0f3)
+ o Add a test with an active_later event at event_base_free time. (1c3147f)
+ o Make all tests pass under EVENT_DEBUG_MODE=1 (b1b054f)
+ o Add some verbose notes to bufferevent unit tests (9d893c9)
+ o New test for active_later->active transition on event_active (a153874)
+ o New tests for event_base_foreach_event() (0b096ef)
+ o Unit tests for event_base_gettimeofday_cached() and
+ event_base_update_cache_time() (30ea291)
+ o A test for event_get_assignment() (f09629e)
+ o More unit tests for initializing common timeouts. (d596739)
+ o Fix a bug in the new main/event_foreach test (702c9aa)
+
+ Windows:
+ o use FormatMessage for winsock errors (0c6ec5d, 2078e9b, 4ccdd53, c9ad3af
+ Patrick Pelletier)
+ o a program to print out the error strings for winsock errors (7296512
+ Patrick Pelletier)
+ o Fix a warning introduced in 0c6ec5d8 (eeb700c)
+ o Fix another warning introduced in 0c6ec5d8 (ed26561)
+
+ Examples (http)
+ o Add sample/https-client.c, an example of stacking evhttp as a client on
+ top of bufferevent_ssl. (be46c99 Catalin Patulea)
+ o use ${OPENSSL_LIBS} instead of -lssl -lcrypto (bf31fa5 Patrick Pelletier)
+ o https-client was putting newlines at 256-byte boundaries (42d7441 Patrick
+ Pelletier)
+ o better handling of OpenSSL errors (5754d96 Patrick Pelletier)
+ o use Debian's default root certificate location (aacd674 Patrick Pelletier)
+ o use iSECPartners code to validate hostname in certificate (64d9f16
+ Patrick Pelletier)
+ o avoid sign mismatch warning in openssl_hostname_validation.c (6021cb5
+ Patrick Pelletier)
+ o pull in wildcard matching code from cURL (4db9da6 Patrick Pelletier)
+ o Another tweak to https-client.c (95acdaa)
+ o Remove http_struct.h usage in sample/https-client.c (8a90a85)
+
+
+
+Changes in version 2.1.2-alpha (18 Nov 2012)
+
+ Libevent 2.1.2-alpha includes more portable for monotonic timers,
+ refactors much of Libevent's internal and external infrastructure,
+ closes some longstanding gaps in the interface, makde other
+ improvements. Ths log below tries to organize features by rough area of
+ effect. It omits a few commits which were pure bugfixes on other commits
+ listed below. For more detail, see the git changelogs. For more
+ insight, see the "whatsnew-2.1.txt" document included in the Libevent
+ 2.1.2-alpha distribution.
+
+ Libevent 2.1.2-alpha also includes all changes made in 2.0.19-stable
+ through 2.0.21-stable inclusive.
+
+ Performance (core):
+ o Replace pipe-based notification with EVFILT_USER where possible. This
+ should make multithreaded programs on OSX and *BSD alert the main thread a
+ little faster. (53a07fe)
+ o Make th_base_lock nonrecursive. (9cd5acb)
+
+ New/Changed API Functions:
+ o New event_get_priority() function to return an event's priority (f90e255)
+ o Add a bufferevent_get_priority() function (bd39554)
+ o Add an event_base_loopcontinue() to tell Libevent to rescan for more
+ events right away (7d6aa5e)
+ o Add a new callback to get called on evbuffer_file_segment free
+ (e9f8feb yangacer, 64051b9)
+ o Expose event_base_foreach_event() as a public API. (84fd6d7 Roman
+ Puls, 232055e, ffe1643)
+ o Add an event_remove_timer() to remove timer on an event without
+ deleting it (e3b2e08)
+ o Make bufferevent_set_timeouts(bev, NULL, NULL) have plausible
+ semantics (9dee36b)
+ o Rename event_enable_lock_debuging() to ..._debugging(). (The old name
+ should still work.) (07e132e)
+ o Add missing implementation for event_enable_debug_logging (3b3e21d)
+
+ PORTABLE MONOTONIC TIMERS:
+
+ Libevent 2.1.2 includes internal support for monotonic timers on
+ (nearly) all supported platforms, including Windows, and OSX. Libevent
+ applications should now be more resilient to jumps forwards or backwards
+ in the system clock. Also, on Linux systems with epoll, we now
+ optionally support microsecond-level timeouts (whereas epoll only
+ supports millisecond-precision timeouts).
+
+ o Use mach_absolute_time() for monotonic clock support on OSX. (b8fd6f9)
+ o Do not track use_monotonic field when is no monotonic clock (cb653a0)
+ o EVENT_BASE_FLAG_PRECISE_TIMER indicates we want fine timer precision
+ (ddd69d3)
+ o On Linux, use CLOCK_MONOTONIC_COARSE by default (55780a7)
+ o Implement a GetTickCount-based monotonic timer for Windows (d5e1d5a)
+ o Refactor monotonic timer handling into a new type and set of
+ functions; add a gettimeofday-based ratcheting implementation (f5e4eb0)
+ o Add EVENT_PRECISE_TIMER environment var for selecting precise-but-slow
+ timer (a2598ec)
+ o Implement fast/precise monotonic clocks on Windows (2c47045)
+ o Simple unit tests for monotonic timers (630f077)
+ o Improve the monotonic-time unit test: make it check the step size (7428c78)
+ o When PRECISE_TIMERS is set with epoll, use timerfd for microsecond
+ precision (26c7582)
+ o Split out time-related evutil functions into a new evutil_time.c (c419485)
+ o Split out time-related prototypes into time-internal.h (71bca50)
+ o Add evutil_time.obj to Makefile.nmake (0ba0683)
+ o Avoid giving a spurious warning when timerfd support is unavailable
+ (1aaf9f0 Dave Hart)
+ o Make test_evutil_monotonic a little more tolerant (def3b83)
+ o Avoid unused-var warning on systems with clock_gettime but without
+ CLOCK_MONOTONIC_COARSE (9be5468)
+
+EVENT_BASE_ONCE LEAKS:
+ If a callback added by event_base_once() is never invoked, Libevent no
+ longer leaks internal memory.
+
+ o Free dangling event_once objects on event_base_free() (c17dd59)
+ o Add a unit test in which an event is created with event_base_once()
+ but never fires (4343edf)
+
+TESTING SUPPORT, FIXES AND IMPROVEMENTS:
+
+ Libevent now disables by default its unit tests that would touch the
+ network, or that tend to fail on heavily-loaded systems. To re-enable
+ them, invoke the ./test/regress program with the @all alias.
+
+ o Simplify test.sh code significantly. (9b856fd Ross Lagerwall)
+ o Make all tests that hit the network disabled by default (f2cea87)
+ o Avoid a resource leak on error in http client benchmark (ea92fba)
+ o Update to latest tinytest (911b4f0349377) (ef7c4f7)
+ o Avoid (unlikely) overflow in bench_httpclient.c (5671033)
+ o Shave 700 msec off the persistent_timeout_jump test (21205b8)
+ o Check return value of write() in regress.c (c8009d2)
+ o Make load-dependent monotonic timer tests off-by-default (2b6fe8b)
+ o Add deferred_cb_skew to list of timing-dependent tests (34c8f31)
+ o Avoid test -e; older shs don't have one. (f1bd938)
+ o Fix renegotiation test to work around openssl 1.0.1 bug (c2f3086)
+ o Fix a couple of compile warnings in the unit tests (5a9a014)
+
+MISC:
+ o Change evutil_weakrand_() to avoid platform random() (e86af4b Nicholas
+ Marriott, 3aa4415)
+
+INFRASTRUCTURE (Active-later events):
+ As a simplification and optimization to Libevent's "deferred callback"
+ logic (introduced in 2.0 to avoid callback recursion), Libevent now
+ treats all of its deferrable callback types using the same logic it uses
+ for active events. Now deferred events no longer cause priority
+ inversion, no longer require special code to cancel them, and so on.
+
+ o Refactor the callback part of an event into its own event_callback
+ type (cba59e5)
+ o Add "active later" event_callbacks to supersede deferred (745a63d)
+ o event_base_assert_ok: check value of event_active_count for
+ correctness (fec8bae)
+ o Replace deferred_cbs with event_callback-based implementation. (ae2b84b)
+ o Replace more deferred_cb names with event_callback (a4079aa)
+ o Give event_base_process_active a single exit path (581b5be)
+ o Restore our priority-inversion-prevention code with deferreds (c0e425a)
+ o Refactor event_persist_closure: raise and extract some common logic
+ (bec22b4)
+ o Remove the unused bits from EVLIST_ALL (9889a3d)
+||||||| merged common ancestors
+Changes in version 2.0.22-stable (?? Dec 2013)
+
+ (As of 3b77d62829c4393bda6f9105a5d3b73b48a64b71.)
+
+BUGFIXES (evhttp)
+ o fix #73 and fix http_connection_fail_test to catch it (crash fix) (b618204 Greg Hazel)
+ o Avoid racy bufferevent activation (5eb1788 Nate Rosenblum)
+
+BUGFIXES (compilation and portability)
+ o Fix compilation with WIN32_HAVE_CONDITION_VARIABLES enabled (7e45739)
+ o Fix missing AC_PROG_SED on older Autoconfs (9ab2b3f Tay Ray Chuan)
+ o Backport libevent to vanilla Autoconf 2.59 (as used in RHEL5) (74d4c44 Kevin Bowling)
+ o Use AC_CONFIG_HEADERS in place of AM_CONFIG_HEADERS for autmake 1.13 compat (817ea36)
+ o Rename configure.in to configure.ac to appease newer autoconfs (0c79787)
+ o Avoid using top_srcdir in TESTS: new automakes do not like this (a55514e)
+ o Use windows vsnprintf fixup logic on all windows environments (e826f19)
+ o Fix a compiler warning when checking for arc4random_buf linker breakage. (5cb3865)
+ o Fix another arc4random_buf-related warning (e64a2b0)
+
+BUGFIXES (resource leaks/lock errors on error)
+ o Avoid leaking fds on evconnlistener with no callback set (69db261)
+ o Avoid double-close on getsockname error in evutil_ersatz_socketpair (0a822a6)
+ o Fix a locking error in bufferevent_socket_get_dns_error. (0a5eb2e)
+ o libevent/win32_dealloc() : fix sizeof(pointer) vs sizeof(*pointer) (b8f5980 Frank Denis)
+
+BUGFIXES (miscellaneous)
+ o Avoid other RNG initialization FS reads when urandom file is specified (9695e9c, bb52471)
+ o Avoid redundant invocations of init_extension_functions for IOCP (3b77d62)
+
+BUFGIXES (evdns)
+ o Checking request nameserver for NULL, before using it. (5c710c0 Belobrov Andrey)
+ o Fix SEGFAULT after evdns_base_resume if no nameservers installed. (f8d7df8 Azat Khuzhin)
+
+BUGFIXES (evutil_secure_random)
+ o When we seed from /proc/sys/kernel/random/uuid, count it as success (e35b540)
+ o Document that arc4random is not a great cryptographic PRNG. (6e49696)
+ o Add evutil_secure_rng_set_urandom_device_file (2bbb5d7)
+ o Really remove RNG seeds from the stack (f5ced88)
+
+
+DOCUMENTATION FIXES
+ o Fix a mistake in evbuffer_remove() arguments in example http server code (c322c20 Gyepi Sam)
+ o Fix a typo in a comment in buffer.h. Spotted by Alt_F4 (773b0a5)
+
+
+
+Changes in version 2.0.21-stable (18 Nov 2012)
+BUGFIXES:
+ o ssl: Don't discard SSL read event when timeout and read come close together (576b29f)
+ o ssl: Stop looping in "consider_reading" if reading is suspended. (f719b8a Joachim Bauch)
+ o ssl: No need to reserve space if reading is suspended. (1acf2eb Joachim Bauch)
+ o dns: Avoid a memory-leak on OOM in evdns. (73e85dd, f2bff75 George Danchev)
+ o build: Use python2 rather than python (0eb0109 Ross Lagerwall)
+ o build: Compile without warnings on mingw64 (94866c2)
+ o build: Fix compilation on mingw64 with -DUSE_DEBUG (62bd2c4)
+ o build: Make rpcgen_wrapper.sh work on systems without a "python2" binary (f3009e4)
+ o iocp: Close IOCP listener socket on free when LEV_OPT_CLOSE_ON_FREE is set (cb853ea Juan Pablo Fernandez)
+ o core: Avoid crash when event_pending() called with no event_base set on event (e3cccf3)
+ o misc: remove stray 'x' so print_err will compile when uncommented (ac35650 Patrick Pelletier)
+ o tests: Fix renegotiation test to work around openssl 1.0.1 bug (c2f3086)
+ o tests: Warn when openssl version in unit test mismatches compiled version. (ac009f9)
+
+
+Changes in version 2.0.20-stable (23 Aug 2012)
+BUGFIXES:
+ o core: Make event_pending() threadsafe. (be7a95c Simon Liu)
+ o win32: avoid crash when waiting forever on zero fds. (160e58b)
+ o evhttp: Fix a memory leak on error in evhttp_uriencode (11c8b31)
+ o evbuffer: Avoid possible needless call to writev. Found by coverity. (6a4ec5c)
+ o evdns: memset sockaddr_in before using it. Found by coverity. (a1a0e67)
+ o evhttp: Check more setsockopt return values when binding sockets. Found by coverity (a0912e3)
+ o evdns: Avoid segfault on weird timeout during name lookup. (dc32077 Greg Hazel)
+ o bufferevent_ssl: Correctly invoke callbacks when a SSL bufferevent reads some and then blocks. (606ac43)
+
+
+PORTABILITY FIXES:
+ o check for arc4random_buf at runtime, on OS X (bff5f94 Greg Hazel)
+ o Correctly check for arc4random_buf (fcec3e8 Sebastian Hahn)
+ o Add explicit AC_PROG_SED to configure.in so all autoconfs will expose $(SED) (ca80ea6)
+
+BUILD FIXES:
+ o Add GCC annotations so that the vsprintf functions get checked properly (117e327)
+ o Fix an unused variable warning on *BSD. (c0720c1)
+
+UNIT TEST FIXES:
+ o Fix a couple of memory leaks (found with Valgrind). (3b2529a Ross Lagerwall)
+ o Remove deadcode in http regression tests. Found by coverity. (5553346)
+ o Fix possible uninitialized read in dns regression tests. Found by coverity. (2259777)
+ o Set umask before calling mkstemp in unit tests. Found by coverity (f1ce15d)
+ o Fix various check-after-dereference issues in unit tests: found by coverity (4f3732d)
+ o Fix resource leaks in the unit tests; found by coverity (270f279)
+ o Add some missing null checks to unit tests; found by coverity (f021c3d)
+ o Avoid more crashes/bad calls in unit tests; found by coverity (3cde5bf)
+ o Remove unused variable; spotted by coverity (6355b2a)
+ o Add checks to various return values in unit tests. Found by coverity (b9e7329)
+ o Move assignment outside tt_assert in ssl unit tests. Appeases coverity. (a2006c0)
+
+
+
+Changes in version 2.0.19-stable (3 May 2012)
+BUGFIXES (CORE):
+ o Refactor event_persist_closure: raise and extract some common logic (bec22b4)
+ o If time has jumped so we'd reschedule a periodic event in the past, schedule it for the future instead (dfd808c)
+ o If a higher-priority event becomes active, don't continue running events of the current priority. (2bfda40)
+
+BUGFIXES (SSL):
+ o Fixed potential double-readcb execution with openssl bufferevents. (4e62cd1 Mark Ellzey)
+
+BUGFIXES (DNS):
+ o Cancel a probe request when the server is freed, and ignore cancelled probe callbacks (94d2336 Greg Hazel)
+ o Remove redundant DNS_ERR_CANCEL check, move comment (46b8060 Greg Hazel)
+ o When retransmitting a timed-out DNS request, pick a fresh nameserver. (3d9e52a)
+
+DOCUMENTATION FIXES:
+ o Fix a typo in the bufferevent documentation (98e9119)
+ o Add missing ) to changelog; spotted by rransom (4c7ee6b)
+ o Fix the website URL in the readme (f775521)
+
+COMPILATION FIXES:
+ o Fix a compilation error with MSVC 2005 due to use of mode_t (336dcae)
+ o Configure with gcc older than 2.95 (4a6fd43 Sebastian Hahn)
+ o Generate event-config.h with a single sed script (30b6f88 Zack Weinberg)
+
+FORWARD-COMPATIBILITY:
+ o Backport: provide EVENT_LOG_* names, and deprecate _EVENT_LOG_* (d1a03b2)
+
+TESTING/DEBUGGING SUPPORT:
+ o dns-example.c can now take a resolv.conf file on the commandline (6610fa5)
+ o Make some evdns.c debug logs more verbose (d873d67)
+ o Work-around a stupid gcov-breaking bug in OSX 10.6 (b3887cd)
+
+
+
+Changes in version 2.0.18-stable (22 Mar 2012)
+BUGFIXES (core):
+ o Make uses of open() close-on-exec safe by introducing an internal evutil_open_closeonexec. (d2b5f72 Ross Lagerwall, 03dce42)
+
+BUGFIXES (kqueue):
+ o Properly zero the kevent in kq_setup_kevent() (c2c7b39 Sebastian Hahn)
+
+BUILD FIXES:
+ o Added OPENSSL_LDFLAGS env variable which is appended to SSL checks. (9278196 Mark Ellzey)
+ o Changed OPENSSL_LDFLAGS to OPENSSL_LIBADD (2d67b63 Mark Ellzey)
+ o Don't do clang version detection when disabling some flags (083296b Sebastian Hahn)
+
+BUGFIXES (dns):
+ o Stop crashing in evdns when nameserver probes give a weird error (bec5068)
+
+
+Changes in version 2.0.17-stable (10 Feb 2012)
+
+BUGFIXES (core):
+ o Be absolutely sure to clear pncalls before leaving event_signal_closure (11f36a5)
+ o check for sysctl before we use it (358c745 Mike Frysinger)
+ o Remove bogus casts of socket to int before calling ev_callback (f032516)
+ o Make evconnlistener work around bug in older Linux when getting nmapped (ecfc720)
+ o Fix a list corruption bug when using event_reinit() with signals present (6e41cdc)
+ o Fix a fd leak in event_reinit() (3f18ad1)
+ o Do a memberwise comparison of threading function tables (c94a5f2 Nate R)
+ o Use C-style comments in C source files (for compatibility with compilers such as xlc on AIX). (d84d917 Greg Hewgill)
+ o Avoid crash when freeing event_iocp and using event_set_mem_functions (19715a6)
+ o In the kqueue backend, do not report EBADF as an EV_READ (5d7bfa1 Nicholas Marriott)
+
+BUGFIXES (evbuffer and bufferevents):
+ o Fix behavior of evbuffer_peek(buf,-1,NULL,NULL,0) (c986f23 Zack Weinberg)
+ o Loop on filtering SSL reads until we are blocked or exhausted. (5b4b812)
+
+BUGFIXES (evhttp):
+ o Force strict validation of HTTP version in response. (790f6b3 Catalin Patulea)
+
+BUGFIXES (evdns):
+ o evdns: fix a bug in circular-queue implementation (d6094b1)
+
+BUILD FIXES:
+ o Fix a silly compilation error with the sun compiler (1927776 Colin Watt)
+ o Suppress a gcc warning from ignoring fwrite return in http-sample.c (7206e8c)
+
+DOCUMENTATION FIXES:
+ o Slightly clarify evbuffer_peek documentation (7bbf6ca)
+ o Update copyright notices to 2012 (e49e289)
+
+NEW APIS:
+ o Backport evhttp_connection_get_bufferevent to Libevent 2.0 (da70fa7 Arno Bakker)
+
+TESTS AND TEST FIXES:
+ o Fix a race condition in the dns/bufferevent_connect_hostname test. (cba48c7)
+ o Add function to check referential integrity of an event_base (27737d5)
+ o Check event_base correctness at end of each unit test (3312b02)
+ o Workaround in the unit tests for an apparent epoll bug in Linux 3.2 (dab9187)
+ o Better workaround for Linux 3.2 edge-triggered epoll bug (9f9e259)
+
+Changes in version 2.0.16-stable (18 Nov 2011)
+BUGFIXES (core):
+ o More detailed message in case of libevent self-debugging failure. (9e6a4ef Leonid Evdokimov)
+ o epoll: close fd on alloc fail at initialization (1aee718 Jamie Iles)
+ o Fix compile warning from saying event2/*.h inside a comment (447b0ba)
+ o Warn when unable to construct base because of failing make_base_notifiable (4e797f3)
+ o Don't try to make notifiable event_base when no threading fns are configured (e787413)
+
+BUGFIXES (evbuffer):
+ o unit test for remove_buffer bug (90bd620 Greg Hazel)
+ o Fix an evbuffer crash in evbuffer_remove_buffer() (c37069c)
+
+BUGFIXES (bufferevent_openssl):
+ o Refactor amount-to-read calculations in buffervent_ssl consider_reading() (a186e73 Mark Ellzey)
+ o Move SSL rate-limit enforcement into bytes_to_read() (96c562f)
+ o Avoid spinning on OpenSSL reads (2aa036f Mark Ellzey)
+
+BUGFIXES (dns)
+ o Empty DNS reply with OK status is another way to say NODATA. (21a08d6 Leonid Evdokimov)
+
+TESTING:
+ o Tests for 94fba5b and f72e8f6 (d58c15e Leonid Evdokimov)
+ o Test for commit aff6ba1 (f7841bf Leonid Evdokimov)
+ o Style and comment tweaks for dns/leak* tests (5e42202)
+ o improve test to remove at least one buffer from src (7eb52eb Greg Hazel)
+
+DOCUMENTATION:
+ o Add note about evhttp_send_reply_end to its doxygen (724bfb5)
+ o Update copyright dates to 2011. (3c824bd)
+ o Fix typo in whatsnew-2.0.txt (674bc6a Mansour Moufid)
+ o Improve win32 behavior of dns-sample.c code (a3f320e Gisle Vanem)
+
+
+
+Changes in version 2.0.15-stable (12 Oct 2011)
+BUGFIXES (DNS):
+ o DNS: add ttl for negative answers using RFC 2308 idea. (f72e8f6 Leonid Evdokimov)
+ o Add DNS_ERR_NODATA error code to handle empty replies. (94fba5b Leonid Evdokimov)
+
+BUFGIXES (bufferevents and evbuffers):
+ o Make evbuffer callbacks get the right n_added value after evbuffer_add (1ef1f68 Alex)
+ o Prefer mmap to sendfile unless a DRAINS_TO_FD flag is set. Allows add_file to work with SSL. (0ba0af9)
+
+BUGFIXES (event loop):
+ o When a signal callback is activated to run multiple times, allow event_base_loopbreak to work even before they all have run. (4e8eb6a)
+
+DOCUMENTATION FIXES:
+ o Fix docstring in dns.h (2b6eae5 Leonid Evdokimov)
+ o refer to non-deprecated evdns functions in comments (ba5c27d Greg Hazel)
+
+BUILD AND TESTING FIXES:
+ o le-proxy and regress depend on openssl directly (9ae061a Sergey Avseyev)
+ o Use _SOURCES, not _sources, in sample/Makefile.am (7f82382)
+ o Fixed compiler warnings for unchecked read/write calls. (c3b62fd Mark Ellzey)
+ o Make write-checking fixes use tt_fail_perror (2b76847)
+ o Fix some "value never used" warnings with gcc 4.6.1 (39c0cf7)
+
+
+
+Changes in version 2.0.14-stable (31 Aug 2011)
+BUGFIXES (bufferevents and evbuffers):
+ o Propagate errors on the underlying bufferevent to the user. (4a34394 Joachim Bauch)
+ o Ignore OpenSSL deprecation warnings on OS X (5d1b255 Sebastian Hahn)
+ o Fix handling of group rate limits under 64 bytes of burst (6d5440e)
+ o Solaris sendfile: correctly detect amount of data sent (643922e Michael Herf)
+ o Make rate limiting work with common_timeout logic (5b18f13)
+ o clear read watermark on underlying bufferevent when creating filtering bev to fix potentially failing fragmented ssl handshakes (54f7e61 Joachim Bauch)
+
+BUGFIXES (IOCP):
+ o IOCP: don't launch reads or writes on an unconnected socket (495c227)
+ o Make IOCP rate-limiting group support stricter and less surprising. (a98da7b)
+ o Have test-ratelim.c support IOCP (0ff2c5a)
+ o Make overlapped reads result in evbuffer callbacks getting invoked (6acfbdd)
+ o Correctly terminate IO on an async bufferevent on bufferevent_free (e6af35d)
+
+BUGFIXES (other):
+ o Fix evsig_dealloc memory leak with debugging turned on. (9b724b2 Leonid Evdokimov)
+ o Fix request_finished memory leak with debugging turned on. (aff6ba1 Leonid Evdokimov)
+
+BUILD AND TESTING FIXES:
+ o Allow OS-neutral builds for platforms where some versions have arc4random_buf (b442302 Mitchell Livingston)
+ o Try to fix 'make distcheck' errors when building out-of-tree (04656ea Dave Hart)
+ o Clean up some problems identified by Coverity. (7c11e51 Harlan Stenn)
+
+
+Changes in version 2.0.13-stable (18 Jul 2011)
+BUGFIXES
+ o Avoid race-condition when initializing global locks (b683cae)
+ o Fix bug in SSL bufferevents backed by a bev with a write high-watermarks (e050703 Joachim Bauch)
+ o Speed up invoke_callbacks on evbuffers when there are no callbacks (f87f568 Mark Ellzey)
+ o Avoid a segfault when all methods are disabled or broken (27ce38b)
+ o Fix incorrect results from evbuffer_search_eol(EOL_LF) (4461f1a)
+ o Add some missing checks for mm_calloc failures (89d5e09)
+ o Replace an assertion for event_base_free(NULL) with a check-and-warn (09fe97d)
+ o Report kqueue ebadf, epipe, and eperm as EV_READ events (1fd34ab)
+ o Check if the `evhttp_new_object' function in `http.c' returns NULL. (446cc7a Mansour Moufid)
+ o Use the correct printf args when formatting size_t (3203f88)
+ o Complain if the caller tries to change threading cbs after setting them (cb6ecee)
+
+DOCUMENTATION FIXES AND IMPROVEMENTS
+ o Revise the event/evbuffer/bufferevent doxygen for clarity and accuracy (2888fac)
+ o Update Doxyfile to produce more useful output (aea0555)
+
+TEST FIXES
+ o Fix up test_evutil_snprintf (caf695a)
+ o Fix tinytest invocation from windows shell (57def34 Ed Day)
+
+BUILD FIXES
+ o Use AM_CPPFLAGS in sample/Makefile.am, not AM_CFLAGS (4a5c82d)
+ o Fix select.c compilation on systems with no NFDBITS (49d1136)
+ o Fix a few warnings on OpenBSD (8ee9f9c Nicholas Marriott)
+ o Don't break when building tests from git without python installed (b031adf)
+ o Don't install event_rpcgen.py when --disable-libevent-install is used (e23cda3 Harlan Stenn)
+ o Fix AIX build issue with TAILQ_FOREACH definition (e934096)
+
+
+Changes in version 2.0.12-stable (4 Jun 2011)
+BUGFIXES
+ o Fix a warn-and-fail bug in kqueue by providing kevent() room to report errors (28317a0)
+ o Fix an assert-inducing fencepost bug in the select backend (d90149d)
+ o Fix failing http assertion introducd in commit 0d6622e (0848814 Kevin Ko)
+ o Fix a bug that prevented us from configuring IPv6 nameservers. (74760f1)
+ o Prevent size_t overflow in evhttp_htmlescape. (06c51cd Mansour Moufid)
+ o Added several checks for under/overflow conditions in evhttp_handle_chunked_read (a279272 Mark Ellzey)
+ o Added overflow checks in evhttp_read_body and evhttp_get_body (84560fc Mark Ellzey)
+
+DOCUMENTATION:
+ o Add missing words to EVLOOP_NONBLOCK documentation (9556a7d)
+
+BUILD FIXES
+ o libssl depends on libcrypto, not the other way around. (274dd03 Peter Rosin)
+ o Libtool brings in the dependencies of libevent_openssl.la automatically (7b819f2 Peter Rosin)
+ o Use OPENSSL_LIBS in Makefile.am (292092e Sebastian Hahn)
+ o Move the win32 detection in configure.in (ceb03b9 Sebastian Hahn)
+ o Correctly detect openssl on windows (6619385 Sebastian Hahn)
+ o Fix a compile warning with zlib 1.2.4 and 1.2.5 (5786b91 Sebastian Hahn)
+ o Fix compilation with GCC 2, which had no __builtin_expect (09d39a1 Dave Hart)
+ o Fix new warnings from GCC 4.6 (06a714f)
+ o Link with -lshell32 and -ladvapi32 on Win32. (86090ee Peter Rosin)
+ o Make the tests build when OpenSSL is not available. (07c41be Peter Rosin)
+ o Bring in the compile script from automake, if needed. (f3c7a4c Peter Rosin)
+ o MSVC does not provide S_ISDIR, so provide it manually. (70be7d1 Peter Rosin)
+ o unistd.h and sys/time.h might not exist. (fe93022 Peter Rosin)
+ o Make sure TINYTEST_LOCAL is defined when building tinytest.c (8fa030c Peter Rosin)
+ o Fix winsock2.h #include issues with MSVC (3d768dc Peter Rosin)
+ o Use evutil_gettimeofday instead of relying on the system gettimeofday. (0de87fe Peter Rosin)
+ o Always use evutil_snprintf, even if OS provides it (d1b2d11 Sebastian Hahn)
+ o InitializeCriticalSectionAndSpinCount requires _WIN32_WINNT >= 0x0403. (816115a Peter Rosin)
+ o cygwin: make it possible to build DLLs (d54d3fc)
+
+
+
+Changes in version 2.0.11-stable (27 Apr 2011)
+ [Autogenerated from the Git log, sorted and cleaned by hand.]
+BUGFIXES:
+ o Fix evport handling of POLLHUP and POLLERR (b42ce4b)
+ o Fix compilation on Windows with NDEBUG (cb8059d)
+ o Check for POLLERR, POLLHUP and POLLNVAL for Solaris event ports (0144886 Trond Norbye)
+ o Detect and handle more allocation failures. (666b096 Jardel Weyrich)
+ o Use event_err() only if the failure is truly unrecoverable. (3f8d22a Jardel Weyrich)
+ o Handle resize failures in the select backend better. (83e805a)
+ o Correctly free selectop fields when select_resize fails in select_init (0c0ec0b)
+ o Make --enable-gcc-warnings a no-op if not using gcc (3267703)
+ o Fix a type error in our (unused) arc4random_stir() (f736198)
+ o Correctly detect and stop non-chunked http requests when the body is too long (63a715e)
+ o Have event_base_gettimeofday_cached() always return wall-clock time (a459ef7)
+ o Workaround for http crash bug 3078187 (5dc5662 Tomash Brechko)
+ o Fix incorrect assertions and possible use-after-free in evrpc_free() (4b8f02f Christophe Fillot)
+ o Reset outgoing http connection when read data in idle state. (272823f Tomash Brechko)
+ o Fix subtle recursion in evhttp_connection_cb_cleanup(). (218cf19 Tomash Brechko)
+ o Fix the case when failed evhttp_make_request() leaved request in the queue. (0d6622e Tomash Brechko)
+ o Fix a crash bug in evdns server circular list code (00e91b3)
+ o Handle calloc failure in evdns. (Found by Dave Hart) (364291e)
+ o Fix a memory leak on win32 socket->event map. (b4f89f0)
+ o Add a forgotten NULL check to evhttp_parse_headers (12311ff Sebastian Hahn)
+ o Fix possible NULL-deref in evdns_cancel_request (5208544 Sebastian Hahn)
+
+PORTABILITY:
+ o Fall back to sscanf if we have no other way to implement strtoll (453317b)
+ o Build correctly on platforms without sockaddr_storage (9184563)
+ o Try to build correctly on platforms with no IPv6 support (713c254)
+ o Build on systems without AI_PASSIVE (cb92113)
+ o Fix http unit test on non-windows platforms without getaddrinfo (6092f12)
+ o Do not check for gethostbyname_r versions if we have getaddrinfo (c1260b0)
+ o Include arpa/inet.h as needed on HPUX (10c834c Harlan Stenn)
+ o Include util-internal.h as needed to build on platforms with no sockaddr_storage (bbf5515 Harlan Stenn)
+ o Check for getservbyname even if not on win32. (af08a94 Harlan Stenn)
+ o Add -D_OSF_SOURCE to fix hpux builds (0b33479 Harlan Stenn)
+ o Check for allocation failures in apply_socktype_protocol_hack (637d17a)
+ o Fix the check for multicast or broadcast addresses in evutil_check_interfaces (1a21d7b)
+ o Avoid a free(NULL) if out-of-memory in evdns_getaddrinfo. Found by Dave Hart (3417f68)
+
+DEFENSIVE PROGRAMMING:
+ o Add compile-time check for AF_UNSPEC==PF_UNSPEC (3c8f4e7)
+
+BUGS IN TESTS:
+ o Fix test.sh output on solaris (b4f89b6 Dave Hart)
+ o Make test-eof fail with a timeout if we never get an eof. (05a2c22 Harlan Stenn)
+ o Use %s with printf in test.sh (039b9bd)
+ o Add an assert to appease clang's static analyzer (b0ff7eb Sebastian Hahn)
+ o Add a forgotten return value check in the unit tests (3819b62 Sebastian Hahn)
+ o Actually send NULL request in http_bad_request_test (b693c32 Sebastian Hahn)
+ o add some (void) casts for unused variables (65707d7 Sebastian Hahn)
+ o Refactor test_getaddrinfo_async_cancel_stress() (48c44a6 Sebastian Hahn)
+ o Be nice and "handle" error return values in sample code (4bac793 Sebastian Hahn)
+ o Check return value of evbuffer_add_cb in tests (93a1abb Sebastian Hahn)
+ o Remote some dead code from dns-example.c (744c745 Sebastian Hahn)
+ o Zero a struct sockaddr_in before using it (646f9fe Sebastian Hahn)
+
+BUILD FIXES:
+ o Fix warnings about AC_LANG_PROGRAM usage (f663112 Sebastian Hahn)
+ o Skip check for zlib if we have no zlib.h (a317c06 Harlan Stenn)
+ o Fix autoconf bracket issues; make check for getaddrinfo include netdb.h (833e5e9 Harlan Stenn)
+ o Correct an AM_CFLAGS to an AM_CPPFLAGS in test/Makefile.am (9c469db Dave Hart)
+ o Fix make distcheck & installation of libevent 1 headers (b5a1f9f Dave Hart)
+ o Fix compilation under LLVM/clang with --enable-gcc-warnings (ad9ff58 Sebastian Hahn)
+
+FEATURES:
+ o Make URI parser able to tolerate nonconformant URIs. (95060b5)
+
+DOCUMENTATION:
+ o Clarify event_set_mem_functions doc (926f816)
+ o Correct evhttp_del_accept_socket documentation on whether socket is closed (f665924)
+ o fix spelling mistake in whatsnew-2.0.txt (deb2f73)
+ o Fix sample/http-server ipv6 fixes (eb692be)
+ o Comment internal headers used in sample code. (4eb281c)
+ o Be explicit about how long event loops run in event.h documentation (f95bafb)
+ o Add comment to configure.in to explain gc-sections test logic (c621359)
+ o Fix a couple of memory leaks in samples/http-server.c. Found by Dave Hart. (2e9f665)
+
+
+
+BUILD IMPROVEMENTS:
+ Libevent 2.1.2-alpha modernizes Libevent's use of autotools, and makes
+ numerous other build system. Parallel builds should be faster, and all
+ builds should be quieter.
+
+ o Split long lists in Makefile.am into one-item-per-line (2711cda)
+ o Remove unnecessary code in configure.in. (e65914f Ross Lagerwall)
+ o attempt to support OpenSSL in Makefile.nmake (eba0eb2 Patrick Pelletier)
+ o Use newer syntax for autoconf/automake init (7d60ba8)
+ o Enable silent build rules by default. Override with V=1 (7b18e5c)
+ o Switch to non-recursive makefiles (7092f3b)
+ o Rename subordinate Makefile.ams to include.am (6cdfeeb)
+ o Make quiet build even quieter (371a123)
+ o New --quiet option for event_rpcgen.py (aa59c1e)
+ o Be quiet when making regress.gen.[ch] (607a8ff)
+ o Fix handling of no-python case for nonrecursive make (1e3123d)
+ o We now require automake 1.9 or later. Modernize! (b7f6e89)
+ o Rename configure.in to configure.ac. (b3fea67 Ross Lagerwall)
+ o Use correct openssl libs and includes in pkgconfig file (d70af27)
+ o Use the same CFLAGS for openssl when building unit tests as with
+ libevent (1d9d511)
+
+DOCUMENTATION
+ o Note that make_base_notifiable should not be necessary (26ee5f9)
+ o Be more clear that LEV_OPT_DEFERRED_ACCEPT has tricky prereqs (371efeb)
+ o Add caveat to docs about bufferevent_free() with data in outbuf (6fab9ee)
+ o Make it more clear that NOLOCK means "I promise, no multithreading"
+ (9444524)
+ o Fix a comment in test-fdleak after 077c7e949. (3881d8f Ross Lagerwall)
+ o Make the Makefile.nmake warning slightly less dire (e7bf4c8)
+ o Fix typo : events instead of evets (05f1aca Azat Khuzhin)
+ o Additional comments about OPENSSL_DIR variable, prompted by Dave Hart
+ (6bde2ef Patrick Pelletier)
+
+EVHTTP:
+ o ignore LWS after field-content in headers (370a2c0 Artem Germanov)
+ o Clean up rtrim implementation (aa59d80)
+ o Remove trailing tabs in HTTP headers as well. (ac42519)
+ o Remove internal ws from multiline http headers correctly (c6ff381)
+ o Move evutil_rtrim_lws_ to evutil.c where it belongs (61b93af)
+ o add evhttp_request_get_response_code_line (4f4d0c9 Jay R. Wren)
+ o Use EVUTIL_SOCKET_ERROR() wrapper to save/restore errno in
+ evhttp_connection_fail_ (7afbd60)
+ o preserve errno in evhttp_connection_fail_ for inspection by the
+ callback (36d0ee5 Patrick Pelletier)
+
+BUGFIXES:
+ o Correctly handle running on a system where accept4 doesn't work. (9fbfe9b)
+ o Avoid double-free on error in evbuffer_add_file. Found by
+ coverity. (6a81b1f)
+ o Fix another possible uninitialized read in dns regression tests. Found
+ by coverity. (13525c5)
+ o Add checks for functions in test-ratelim.c; found by Coverity (aa501e1)
+ o Avoid memory leak in test_event_calloc unit test; found by coverity
+ (92817a1)
+ o Fix a shadowed variable in addfile_test_readcb; found by coverity
+ (225344c)
+ o Check return value when using LEV_OPT_DEFERRED_ACCEPT. Found by
+ coverity (6487f63)
+ o Prevent reference leak of bufferevent if getaddrinfo fails. (b757786
+ Joachim Bauch)
+ o Make event_base_getnpriorities work with old "implicit base" code
+ (c46cb9c)
+ o Simplify and correct evutil_open_closeonexec_ (0de587f)
+ o Fix event_dlist definition when sys/queue not included (81b6209
+ Derrick Pallas)
+
+
+
+Changes in version 2.1.1-alpha (4 Apr 2012)
+
+ Libevent 2.1.1-alpha includes a number of new features and performance
+ improvements. The log below tries to organize them by rough area of
+ effect. It omits some commits which were pure bugfixes on other commits
+ listed below. For more detail, see the git changelogs. For more
+ insight, see the "whatsnew-2.1.txt" document included in the Libevent
+ 2.1.1-alpha distribution.
+
+ Performance: Core
+ o Replace several TAILQ users with LIST. LIST can be a little faster than
+ TAILQ for cases where we don't need queue-like behavior. (f9db33d,
+ 6494772, d313c29, 974d004)
+ o Disabled code to optimize the case where we reinsert an existing
+ timeout (e47042f, 09cbc3d)
+ o Remove a needless base-notify when rescheduling the first timeout (77a96fd)
+ o Save a needless comparison when removing/adjusting timeouts (dd5189b)
+ o Possible optimization: split event_queue_insert/remove into
+ separate functions. needs testing (efc4dc5)
+ o Make event_count maintenance branchless at the expense of an
+ extra shift. Needs benchmarking (d1cee3b)
+ o In the 2.1 branch, let's try out lazy gettimeofday/clock_gettime
+ comparison (2a83ecc)
+ o Optimization in event_process_active(): ignore maxcb & endtime
+ for highest priority events. (a9866aa Alexander Drozdov)
+ o Bypass event_add when using event_base_once() for a 0-sec timeout (35c5c95)
+ o Remove the eventqueue list and the ev_next pointers. (604569b 066775e)
+
+ Performance: Evbuffers
+ o Roughly 20% speed increase when line-draining a buffer using
+ EVBUFFER_EOL_CRLF (5dde0f0 Mina Naguib)
+ o Try to squeeze a little more speed out of EVBUFFER_EOL_CRLF (7b9d139)
+ o Fix a bug in the improved EOL_CRLF code (d927965)
+ o Remove a needless branch in evbuffer_drain() (d19a326)
+
+ Performance: Linux
+ o Infrastructure for using faster/fewer syscalls when creating
+ sockets (a1c042b)
+ o Minimize syscalls during socket creation in listener.c (7e9e289)
+ o Use a wrapper function to create the notification
+ pipe/socketpair/eventfd (ca76cd9)
+ o Use pipes for telling signals to main thread when possible (a35f396)
+ o Save syscalls when constructing listener sockets for evhttp (af6c9d8)
+ o Save some syscalls when creating evdns sockets (713e570)
+ o Save some syscalls when constructing a socket for a bufferevent (33fca62)
+ o Prefer epoll_create1 on Linuxen that have it (bac906c)
+
+ Performance: Epoll backend
+ o Use current event set rather than current pending change when
+ deciding whether to no-op a del (04ba27e Mike Smellie)
+ o Replace big chain of if/thens in epoll.c with a table lookup (8c83eb6)
+ o Clean up error handling in epoll_apply_one_change() a little (2d55a19)
+
+ Performance: Evport backend
+ o evport: use evmap_io to track fdinfo status. Should save time and
+ RAM. (4687ce4)
+ o evport: Remove a linear search over recent events when
+ reactivating them (0f77efe)
+ o evport: Use portev_user to remember fdinfo struct (276ec0e)
+ o evport: don't scan more events in ed_pending than needed (849a5cf)
+ o evport: Remove artificial low limit on max events per getn call (c04d927)
+ o Reenable main/many_events_slow_add for evport in 2.1 (e903db3)
+
+ Performance: Windows
+ o Use GetSystemTimeAsFileTime to implement gettimeofday on
+ win32. It's faster and more accurate than our old
+ approach. (b8b8aa5)
+
+ New functions and features: debugging
+ o Add event_enable_debug_logging() to control use of debug logs (e30a82f)
+
+ New functions and features: core
+ o Add event_config function to limit time/callbacks between calls
+ to dispatch (fd4de1e, 9fa56bd, a37a0c0, 3c63edd)
+ o New EVLOOP_NO_EXIT_ON_EMPTY option to keep looping even when no
+ events are pending (084e68f)
+ o Add event_base_get_npriorities() function. (ee3a4ee Alexander Drozdov)
+ o Make evbase_priority_init() and evbase_get_npriorities()
+ threadsafe (3c55b5e)
+ o New event_base_update_cache_time() to set cached_tv to current
+ time (212533e Abel Mathew)
+ o Add event_self_cbarg() to be used in conjunction with
+ event_new(). (ed36e6a Ross Lagerwall, fa931bb, 09a1906, 1338e6c,
+ 33e43ef)
+ o Add a new libevent_global_shutdown() to free all globals before
+ exiting. (041ca00 Mark Ellzey, f98c158, 15296d0, 55e991b)
+ o Use getifaddrs to detect our interfaces if possible (7085a45)
+ o Add event_base_get_running_event() to get the event* whose cb we
+ are in (c5732fd, 13dad99)
+
+ New functions and features: building
+ o Implement --enable-gcc-hardening configure option (7550267 Sebastian Hahn)
+
+ New functions and features: evbuffers
+ o Add evbuffer_add_file_segment() so one fd can be used efficiently
+ in more than one evbuffer_add_file at a time (e72afae, c2d9884,
+ 3f405d2, 0aad014)
+ o Fix windows file segment mappings (8254de7)
+ o Allow evbuffer_ptr_set to yield a point just after the end of the
+ buffer. (e6fe1da)
+ o Allow evbuffer_ptr to point to position 0 in an empty evbuffer
+ (7aeb2fd Nir Soffer)
+ o Set the special "not found" evbuffer_ptr consistently. (e3e97ae Nir Soffer)
+ o support adding buffers to other buffers non-destructively
+ (9d7368a Joachim Bauch)
+ o prevent nested multicast references, reworked locking (26041a8
+ Joachim Bauch)
+ o New EVBUFFER_EOL_NUL to read NUL-terminated strings from an
+ evbuffer (d7a8b36 Andrea Montefusco, 54142c9)
+ o Make evbuffer_file_segment_types adaptable (c6bbbf1)
+ o Added evbuffer_add_iovec and unit tests. (aaec5ac Mark Ellzey, 27b5398)
+ o Add evbuffer_copyout_from to copy data from the middle of a
+ buffer (27e2225)
+
+ New functions and features: bufferevents
+ o Allow users to set allow_dirty_shutdown (099d27d Catalin Patulea)
+ o Tweak allow_dirty_shutdown documentation (a44cd2b)
+ o Fix two issues in the allow_dirty_shutdown code. (f3b89de)
+ o Add a bufferevent_getcb() to find a bufferevent's current
+ callbacks (a650394)
+ o bufferevent: Add functions to set/get max_single_read/write
+ values. (998c813 Alexander Drozdov)
+ o bev_ssl: Be more specific in event callbacks. evhttp in particular gets
+ confused without at least one of BEV_EVENT_{READING|WRITING}. (f7eb69a
+ Catalin Patulea)
+
+ New functions and features: evconnlisteners
+ o Support TCP_DEFER_ACCEPT sockopts for listeners (5880e4a Mark Ellzey,
+ a270728)
+ o Add another caveat to the TCP_DEFER_ACCEPT documentation (a270728)
+ o Allow evconnlistener to be created in disabled state. (9593a33
+ Alexander Drozdov)
+ o The LEV_OPT_CLOSE_ON_EXEC flag now applies to accepted listener
+ sockets too (4970329)
+
+ Evhttp:
+ o Add new evhttp_{connection_}set_timeout_tv() functions to set
+ finger-grained http timeouts (6350e6c Constantine Verutin)
+ o Performance tweak to evhttp_parse_request_line. (aee1a97 Mark Ellzey)
+ o Add missing break to evhttp_parse_request_line (0fcc536)
+ o Add evhttp callback for bufferevent creation; this lets evhttp
+ support SSL. (8d3a850)
+ o Remove calls to deprecated bufferevent functions from evhttp.c (4d63758)
+ o evhttp: Add evhttp_foreach_bound_socket. (a2c48e3 Samy Al Bahra)
+
+ Build improvements:
+ o Add AC_USE_SYSTEM_EXTENSIONS to configure.in. Requires follow on
+ patches for correctness and robustness. (1fa7dbe Kevin Bowling)
+ o Filter '# define' statements from autoconf and generate
+ event-private.h (321b558 Kevin Bowling)
+ o Remove internal usage of _GNU_SOURCE (3b26541 Kevin Bowling)
+ o Eliminate a couple more manual internal _GNU_SOURCE defines (c51ef93
+ Kevin Bowling)
+ o Add AC_GNU_SOURCE to the fallback case. (ea8fa4c Kevin Bowling)
+ o Use a Configuration Header Template for evconfig-private.h (868f888
+ Kevin Bowling)
+ o Fix a comment warning and add evconfig-private.h to .gitignore
+ (f6d66bc Kevin Bowling)
+ o Include evconfig-private.h in internal files for great good. (0915ca0
+ Kevin Bowling)
+ o Backport libevent to vanilla Autoconf 2.59 (as used in RHEL5)
+ (ad03952 Kevin Bowling)
+ o Prefer the ./configure evconfig-private.h in MinGW, just in
+ case. (f964b72 Kevin Bowling)
+ o Shell hack for weird mkdir -p commands (fd7b5a8 Kevin Bowling)
+ o Add evconfig-private to remaining files (ded0a09 Kevin Bowling)
+ o Allow use of --enable-silent-rules for quieter compilation with
+ automake 1.11 (f1f8514 Dave Hart)
+ o Use "_WIN32", not WIN32: it's standard and we don't need to fake it
+ (9f560b)
+ o In configure, test for _WIN32 not WIN32. (85078b1 Peter Rosin)
+ o Do not define WIN32 in Makefile.nmake (d41f3ea Peter Rosin)
+ o Provide the autoconf m4 macros for the new OpenSSL via pkg-config
+ stuff. (674dc3d Harlan Stenn)
+ o Use pkg-config (if available) to handle OpenSSL. (1c63860 Harlan Stenn)
+ o We need AM_CPPFLAGS when compiling bufferevent_openssl.c (6d2613b
+ Harlan Stenn)
+ o Fix OSX build: $(OPENSSL_INCS) needs to be after
+ $(AM_CPPFLAGS). (46f1769 Zack Weinberg)
+ o Make gcc warnings on by default, and --enable-gcc-warnings only add
+ -Werror (d46517e Sebastian Hahn)
+ o Split up extra-long AC_CHECK_FUNCS/HEADERS lines in configure.in (88a30ad)
+ o Move libevent 1.x headers to include/, to put all public headers in
+ one place. (bbea8d6)
+ o Put #ifdef around some files to support alternate build
+ systems. (76d4c92 Ross Lagerwall)
+ o Also make win32select.c conditional for IDE users (bf2c5a7)
+
+ Debugging:
+ o Add a magic number to debug_locks to better catch lock-coding
+ errors. (b4a29c0 Dave Hart)
+ o munge the debug_lock signature before freeing it: it might help us
+ catch use-after-free (f28084d)
+ o Added --enable-event-debugging in configure (bc7b4e4, a9c2c9a Mark Ellzey)
+ o Debug addition for printing usec on TIMEOUT debugging. (ac43ce0 Mark Ellzey)
+ o Added usec debug in another area for debug (3baab0d Mark Ellzey)
+ o added timeout debug logs to include event ptr. (4b7d298 Mark Ellzey)
+ o more event dbg updates (6727543 Mark Ellzey)
+ o Clarify event_enable_debug_logging a little (6207826)
+ o Make --enable-verbose-debug option match its help text (10c3450)
+ o Add argument checks to some memory functions in `event.c'. (c8953d1
+ Mansour Moufid)
+
+ Testing:
+ o More abstraction in test.sh (cd74c4e)
+ o Add failing test for evbuffer_search_range. (8e26154 Nir Soffer)
+ o Tweaks to return types with end-of-buf ptrs (9ab8ab8)
+ o Add an (internal) usleep function for use by unit tests (f25d9d3)
+ o Synchronize with upstream tinytest (6c81be7)
+ o Make test-changelist faster (7622d26)
+ o Reduce the timeout in the main/fork test. (ab14f7c)
+ o New evhttp function to adjust initial retry timeout (350a3c4)
+ o Make regression tests run over 3x faster. (67a1763)
+ o Use test_timeval_diff_eq more consistently (b77b43f)
+ o Allow more slop in deferred_cb_skew test; freebsd needs it (b9f7e5f)
+ o When including an -internal.h header outside the main tree, do so
+ early (95e2455)
+ o Add a new test: test-fdleak which tests for fd leaks by creating many
+ sockets. (2ef9278 Ross Lagerwall, f7af194, 1c4288f, etc)
+ o Add a unit test for event_base_dump_events() (7afe48a, 8d08cce)
+ o Test more bufferevent_ratelim features (c24f91a)
+
+ Documentation:
+ o Improve evbuffer_ptr documentation (261ba63)
+ o added comments to describe refcounting of multicast chains (ba24f61
+ Joachim Bauch)
+ o Add doxygen for event_base_dump_events (cad5753)
+
+ OSX:
+ o Use "unlimited select" on OSX so that we can have more than
+ FD_SETSIZE fds (1fb5cc6)
+
+ KQueue:
+ o Use SIG_IGN instead of a do-nothing handler for signal events with
+ kqueue (148458e Zack Weinberg)
+
+ evprc:
+ o event_rpcgen.py now prints status information to stdout and errors to
+ stderr. (ffb0ba0 Ross Lagerwall)
+
+ Code improvement and refactoring:
+ o Make event_reinit() more robust and maintainable (272033e)
+ o Restore fast-path event_reinit() for slower backends (2c4b5de)
+ o Check changelist as part of checking representational integrity (39b3f38)
+ o Fix a compile warning in event_reinit (e4a56ed Sebastian Hahn)
+ o Refactor the functions that run over every event. (c89b4e6)
+ o Remove the last vestiges of _EVENT_USE_EVENTLIST (a3cec90)
+ o Make event-config.h depend on Makefile.am (2958a5c)
+
+ Build fixes:
+ o Don't do clang version detection when disabling some flags (083296b
+ Sebastian Hahn)
+
+ C standards conformance:
+ o Check for NULL return on win32 mm_calloc, and set ENOMEM. (af7ba69)
+ o Convert event-config.h macros to avoid reserved identifiers (68120d9)
+ o Generate event-config.h using the correct macros. (f82c57e)
+ o Convert include-guard macro convention to avoid reserved identifiers
+ (3f8c7cd)
+ o Make event_rpcgen.py output conform to identifier conventions (372bff1)
+ o Stop referring to an obsolete include guard in bench_http.h (5c0f7e0)
+ o Make the generated event-config.h use correct include guards (639383a)
+ o Fix all identifiers with names beginning with underscore. (cb9da0b)
+ o Make event_rpcgen.py output conform to identifier conventions, more
+ (bcefd24)
+ o Fix some problems introduced by automated identifier cleanup script
+ (c963534)
+ o Have all visible internal function names end with an underscore. (8ac3c4c)
+ o Apply the naming convention to our EVUTIL_IS* functions (c7848fa)
+ o Clean up lingering _identifiers. (946b584)
+ o Fix doxygen to use new macro conventions (da455e9)
+
+ Bugfixes:
+ o Do not use system EAI/AI values if we are not using the system
+ getaddrinfo. (7bcac07)
+
+ Sample Code:
+ o Fix up sample/event-test.c to use newer interfaces and make it
+ actually work. (19bab4f Ross Lagerwall)
+ o On Unix, remove event.fifo left by sample/event-test.c. (c0dacd2 Ross
+ Lagerwall)
+ o Rename event-test.c to event-read-fifo.c. (a5b370a Ross Lagerwall)
+ o event-read-fifo: Use EV_PERSIST appropriately (24dab0b)
+
+
+
+
diff --git a/protocols/Telegram/tgl/libevent/ChangeLog-1.4 b/protocols/Telegram/tgl/libevent/ChangeLog-1.4
new file mode 100644
index 0000000000..166d30872f
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/ChangeLog-1.4
@@ -0,0 +1,231 @@
+Changes in 1.4.14b-stable
+ o Set the VERSION_INFO correctly for 1.4.14
+
+Changes in 1.4.14-stable
+ o Add a .gitignore file for the 1.4 branch. (d014edb)
+ o Backport evbuffer_readln(). (b04cc60 Nicholas Marriott)
+ o Make the evbuffer_readln backport follow the current API (c545485)
+ o Valgrind fix: Clear struct kevent before checking for OSX bug. (5713d5d William Ahern)
+ o Fix a crash when reading badly formatted resolve.conf (5b10d00 Yasuoka Masahiko)
+ o Fix memory-leak of signal handler array with kqueue. [backport] (01f3775)
+ o Update sample/signal-test.c to use newer APIs and not leak. (891765c Evan Jones)
+ o Correct all versions in 1.4 branch (ac0d213)
+ o Make evutil_make_socket_nonblocking() leave any other flags alone. (81c26ba Jardel Weyrich)
+ o Adjusted fcntl() retval comparison on evutil_make_socket_nonblocking(). (5f2e250 Jardel Weyrich)
+ o Correct a debug message in evhttp_parse_request_line (35df59e)
+ o Merge branch 'readln-backport' into patches-1.4 (8771d5b)
+ o Do not send an HTTP error when we've already closed or responded. (4fd2dd9 Pavel Plesov)
+ o Re-add event_siglcb; some old code _was_ still using it. :( (bd03d06)
+ o Make Libevent 1.4 build on win32 with Unicode enabled. (bce58d6 Brodie Thiesfield)
+ o Distribute nmake makefile for 1.4 (20d706d)
+ o do not fail while sending on http connections the client closed. (5c8b446)
+ o make evhttp_send() safe against terminated connections, too (01ea0c5)
+ o Fix a free(NULL) in min_heap.h (2458934)
+ o Fix memory leak when setting up priorities; reported by Alexander Drozdov (cb1a722)
+ o Clean up properly when adding a signal handler fails. (ae6ece0 Gilad Benjamini)
+ o Do not abort HTTP requests missing a reason string. (29d7b32 Pierre Phaneuf)
+ o Fix compile warning in http.c (906d573)
+ o Define _REENTRANT as needed on Solaris, elsewhere (6cbea13)
+
+
+Changes in 1.4.13-stable:
+ o If the kernel tells us that there are a negative number of bytes to read from a socket, do not believe it. Fixes bug 2841177; found by Alexander Pronchenkov.
+ o Do not allocate the maximum event queue and fd array for the epoll backend at startup. Instead, start out accepting 32 events at a time, and double the queue's size when it seems that the OS is generating events faster than we're requesting them. Saves up to 512K per epoll-based event_base. Resolves bug 2839240.
+ o Fix compilation on Android, which forgot to define fd_mask in its sys/select.h
+ o Do not drop data from evbuffer when out of memory; reported by Jacek Masiulaniec
+ o Rename our replacement compat/sys/_time.h header to avoid build a conflict on HPUX; reported by Kathryn Hogg.
+ o Build kqueue.c correctly on GNU/kFreeBSD platforms. Patch pulled upstream from Debian.
+ o Fix a problem with excessive memory allocation when using multiple event priorities.
+ o When running set[ug]id, don't check the environment. Based on a patch from OpenBSD.
+
+
+Changes in 1.4.12-stable:
+ o Try to contain degree of failure when running on a win32 version so heavily firewalled that we can't fake a socketpair.
+ o Fix an obscure timing-dependent, allocator-dependent crash in the evdns code.
+ o Use __VA_ARGS__ syntax for varargs macros in event_rpcgen when compiler is not GCC.
+ o Activate fd events in a pseudorandom order with O(N) backends, so that we don't systematically favor low fds (select) or earlier-added fds (poll, win32).
+ o Fix another pair of fencepost bugs in epoll.c. [Patch from Adam Langley.]
+ o Do not break evdns connections to nameservers when our IP changes.
+ o Set truncated flag correctly in evdns server replies.
+ o Disable strict aliasing with GCC: our code is not compliant with it.
+
+Changes in 1.4.11-stable:
+ o Fix a bug when removing a timeout from the heap. [Patch from Marko Kreen]
+ o Remove the limit on size of HTTP headers by removing static buffers.
+ o Fix a nasty dangling pointer bug in epoll.c that could occur after epoll_recalc(). [Patch from Kevin Springborn]
+ o Distribute Win32-Code/event-config.h, not ./event-config.h
+
+Changes in 1.4.10-stable:
+ o clean up buffered http connection data on reset; reported by Brian O'Kelley
+ o bug fix and potential race condition in signal handling; from Alexander Drozdov
+ o rename the Solaris event ports backend to evport
+ o support compilation on Haiku
+ o fix signal processing when a signal callback delivers a signal; from Alexander Drozdov
+ o const-ify some arguments to evdns functions.
+ o off-by-one error in epoll_recalc; reported by Victor Goya
+ o include Doxyfile in tar ball; from Jeff Garzik
+ o correctly parse queries with encoded \r, \n or + characters
+
+Changes in 1.4.9-stable:
+ o event_add would not return error for some backends; from Dean McNamee
+ o Clear the timer cache on entering the event loop; reported by Victor Chang
+ o Only bind the socket on connect when a local address has been provided; reported by Alejo Sanchez
+ o Allow setting of local port for evhttp connections to support millions of connections from a single system; from Richard Jones.
+ o Clear the timer cache when leaving the event loop; reported by Robin Haberkorn
+ o Fix a typo in setting the global event base; reported by lance.
+ o Fix a memory leak when reading multi-line headers
+ o Fix a memory leak by not running explicit close detection for server connections
+
+Changes in 1.4.8-stable:
+ o Match the query in DNS replies to the query in the request; from Vsevolod Stakhov.
+ o Fix a merge problem in which name_from_addr returned pointers to the stack; found by Jiang Hong.
+ o Do not remove Accept-Encoding header
+
+Changes in 1.4.7-stable:
+ o Fix a bug where headers arriving in multiple packets were not parsed; fix from Jiang Hong; test by me.
+
+Changes in 1.4.6-stable:
+ o evutil.h now includes <stdarg.h> directly
+ o switch all uses of [v]snprintf over to evutil
+ o Correct handling of trailing headers in chunked replies; from Scott Lamb.
+ o Support multi-line HTTP headers; based on a patch from Moshe Litvin
+ o Reject negative Content-Length headers; anonymous bug report
+ o Detect CLOCK_MONOTONIC at runtime for evdns; anonymous bug report
+ o Fix a bug where deleting signals with the kqueue backend would cause subsequent adds to fail
+ o Support multiple events listening on the same signal; make signals regular events that go on the same event queue; problem report by Alexander Drozdov.
+ o Deal with evbuffer_read() returning -1 on EINTR|EAGAIN; from Adam Langley.
+ o Fix a bug in which the DNS server would incorrectly set the type of a cname reply to a.
+ o Fix a bug where setting the timeout on a bufferevent would take not effect if the event was already pending.
+ o Fix a memory leak when using signals for some event bases; reported by Alexander Drozdov.
+ o Add libevent.vcproj file to distribution to help with Windows build.
+ o Fix a problem with epoll() and reinit; problem report by Alexander Drozdov.
+ o Fix off-by-one errors in devpoll; from Ian Bell
+ o Make event_add not change any state if it fails; reported by Ian Bell.
+ o Do not warn on accept when errno is either EAGAIN or EINTR
+
+Changes in 1.4.5-stable:
+ o Fix connection keep-alive behavior for HTTP/1.0
+ o Fix use of freed memory in event_reinit; pointed out by Peter Postma
+ o Constify struct timeval * where possible; pointed out by Forest Wilkinson
+ o allow min_heap_erase to be called on removed members; from liusifan.
+ o Rename INPUT and OUTPUT to EVRPC_INPUT and EVRPC_OUTPUT. Retain INPUT/OUTPUT aliases on on-win32 platforms for backwards compatibility.
+ o Do not use SO_REUSEADDR when connecting
+ o Fix Windows build
+ o Fix a bug in event_rpcgen when generated fixed-sized entries
+
+Changes in 1.4.4-stable:
+ o Correct the documentation on buffer printf functions.
+ o Don't warn on unimplemented epoll_create(): this isn't a problem, just a reason to fall back to poll or select.
+ o Correctly handle timeouts larger than 35 minutes on Linux with epoll.c. This is probably a kernel defect, but we'll have to support old kernels anyway even if it gets fixed.
+ o Fix a potential stack corruption bug in tagging on 64-bit CPUs.
+ o expose bufferevent_setwatermark via header files and fix high watermark on read
+ o fix a bug in bufferevent read water marks and add a test for them
+ o introduce bufferevent_setcb and bufferevent_setfd to allow better manipulation of bufferevents
+ o use libevent's internal timercmp on all platforms, to avoid bugs on old platforms where timercmp(a,b,<=) is buggy.
+ o reduce system calls for getting current time by caching it.
+ o fix evhttp_bind_socket() so that multiple sockets can be bound by the same http server.
+ o Build test directory correctly with CPPFLAGS set.
+ o Fix build under Visual C++ 2005.
+ o Expose evhttp_accept_socket() API.
+ o Merge windows gettimeofday() replacement into a new evutil_gettimeofday() function.
+ o Fix autoconf script behavior on IRIX.
+ o Make sure winsock2.h include always comes before windows.h include.
+
+Changes in 1.4.3-stable:
+ o include Content-Length in reply for HTTP/1.0 requests with keep-alive
+ o Patch from Tani Hosokawa: make some functions in http.c threadsafe.
+ o Do not free the kqop file descriptor in other processes, also allow it to be 0; from Andrei Nigmatulin
+ o make event_rpcgen.py generate code include event-config.h; reported by Sam Banks.
+ o make event methods static so that they are not exported; from Andrei Nigmatulin
+ o make RPC replies use application/octet-stream as mime type
+ o do not delete uninitialized timeout event in evdns
+
+Changes in 1.4.2-rc:
+ o remove pending timeouts on event_base_free()
+ o also check EAGAIN for Solaris' event ports; from W.C.A. Wijngaards
+ o devpoll and evport need reinit; tested by W.C.A Wijngaards
+ o event_base_get_method; from Springande Ulv
+ o Send CRLF after each chunk in HTTP output, for compliance with RFC2626. Patch from "propanbutan". Fixes bug 1894184.
+ o Add a int64_t parsing function, with unit tests, so we can apply Scott Lamb's fix to allow large HTTP values.
+ o Use a 64-bit field to hold HTTP content-lengths. Patch from Scott Lamb.
+ o Allow regression code to build even without Python installed
+ o remove NDEBUG ifdefs from evdns.c
+ o update documentation of event_loop and event_base_loop; from Tani Hosokawa.
+ o detect integer types properly on platforms without stdint.h
+ o Remove "AM_MAINTAINER_MODE" declaration in configure.in: now makefiles and configure should get re-generated automatically when Makefile.am or configure.in chanes.
+ o do not insert event into list when evsel->add fails
+
+Changes in 1.4.1-beta:
+ o free minheap on event_base_free(); from Christopher Layne
+ o debug cleanups in signal.c; from Christopher Layne
+ o provide event_base_new() that does not set the current_base global
+ o bufferevent_write now uses a const source argument; report from Charles Kerr
+ o better documentation for event_base_loopexit; from Scott Lamb.
+ o Make kqueue have the same behavior as other backends when a signal is caught between event_add() and event_loop(). Previously, it would catch and ignore such signals.
+ o Make kqueue restore signal handlers correctly when event_del() is called.
+ o provide event_reinit() to reintialize an event_base after fork
+ o small improvements to evhttp documentation
+ o always generate Date and Content-Length headers for HTTP/1.1 replies
+ o set the correct event base for HTTP close events
+ o New function, event_{base_}loopbreak. Like event_loopexit, it makes an event loop stop executing and return. Unlike event_loopexit, it keeps subsequent pending events from getting executed. Patch from Scott Lamb
+ o Removed obsoleted recalc code
+ o pull setters/getters out of RPC structures into a base class to which we just need to store a pointer; this reduces the memory footprint of these structures.
+ o fix a bug with event_rpcgen for integers
+ o move EV_PERSIST handling out of the event backends
+ o support for 32-bit tag numbers in rpc structures; this is wire compatible, but changes the API slightly.
+ o prefix {encode,decode}_tag functions with evtag to avoid collisions
+ o Correctly handle DNS replies with no answers set (Fixes bug 1846282)
+ o The configure script now takes an --enable-gcc-warnigns option that turns on many optional gcc warnings. (Nick has been building with these for a while, but they might be useful to other developers.)
+ o When building with GCC, use the "format" attribute to verify type correctness of calls to printf-like functions.
+ o removed linger from http server socket; reported by Ilya Martynov
+ o allow \r or \n individually to separate HTTP headers instead of the standard "\r\n"; from Charles Kerr.
+ o demote most http warnings to debug messages
+ o Fix Solaris compilation; from Magne Mahre
+ o Add a "Date" header to HTTP responses, as required by HTTP 1.1.
+ o Support specifying the local address of an evhttp_connection using set_local_address
+ o Fix a memory leak in which failed HTTP connections would not free the request object
+ o Make adding of array members in event_rpcgen more efficient, but doubling memory allocation
+ o Fix a memory leak in the DNS server
+ o Fix compilation when DNS_USE_OPENSSL_FOR_ID is enabled
+ o Fix buffer size and string generation in evdns_resolve_reverse_ipv6().
+ o Respond to nonstandard DNS queries with "NOTIMPL" rather than by ignoring them.
+ o In DNS responses, the CD flag should be preserved, not the TC flag.
+ o Fix http.c to compile properly with USE_DEBUG; from Christopher Layne
+ o Handle NULL timeouts correctly on Solaris; from Trond Norbye
+ o Recalculate pending events properly when reallocating event array on Solaris; from Trond Norbye
+ o Add Doxygen documentation to header files; from Mark Heily
+ o Add a evdns_set_transaction_id_fn() function to override the default
+ transaction ID generation code.
+ o Add an evutil module (with header evutil.h) to implement our standard cross-platform hacks, on the theory that somebody else would like to use them too.
+ o Fix signals implementation on windows.
+ o Fix http module on windows to close sockets properly.
+ o Make autogen.sh script run correctly on systems where /bin/sh isn't bash. (Patch from Trond Norbye, rewritten by Hagne Mahre and then Hannah Schroeter.)
+ o Skip calling gettime() in timeout_process if we are not in fact waiting for any events. (Patch from Trond Norbye)
+ o Make test subdirectory compile under mingw.
+ o Fix win32 buffer.c behavior so that it is correct for sockets (which do not like ReadFile and WriteFile).
+ o Make the test.sh script run unit tests for the evpoll method.
+ o Make the entire evdns.h header enclosed in "extern C" as appropriate.
+ o Fix implementation of strsep on platforms that lack it
+ o Fix implementation of getaddrinfo on platforms that lack it; mainly, this will make Windows http.c work better. Original patch by Lubomir Marinov.
+ o Fix evport implementation: port_disassociate called on unassociated events resulting in bogus errors; more efficient memory management; from Trond Norbye and Prakash Sangappa
+ o support for hooks on rpc input and output; can be used to implement rpc independent processing such as compression or authentication.
+ o use a min heap instead of a red-black tree for timeouts; as a result finding the min is a O(1) operation now; from Maxim Yegorushkin
+ o associate an event base with an rpc pool
+ o added two additional libraries: libevent_core and libevent_extra in addition to the regular libevent. libevent_core contains only the event core whereas libevent_extra contains dns, http and rpc support
+ o Begin using libtool's library versioning support correctly. If we don't mess up, this will more or less guarantee binaries linked against old versions of libevent continue working when we make changes to libevent that do not break backward compatibility.
+ o Fix evhttp.h compilation when TAILQ_ENTRY is not defined.
+ o Small code cleanups in epoll_dispatch().
+ o Increase the maximum number of addresses read from a packet in evdns to 32.
+ o Remove support for the rtsig method: it hasn't compiled for a while, and nobody seems to miss it very much. Let us know if there's a good reason to put it back in.
+ o Rename the "class" field in evdns_server_request to dns_question_class, so that it won't break compilation under C++. Use a macro so that old code won't break. Mark the macro as deprecated.
+ o Fix DNS unit tests so that having a DNS server with broken IPv6 support is no longer cause for aborting the unit tests.
+ o Make event_base_free() succeed even if there are pending non-internal events on a base. This may still leak memory and fds, but at least it no longer crashes.
+ o Post-process the config.h file into a new, installed event-config.h file that we can install, and whose macros will be safe to include in header files.
+ o Remove the long-deprecated acconfig.h file.
+ o Do not require #include <sys/types.h> before #include <event.h>.
+ o Add new evutil_timer* functions to wrap (or replace) the regular timeval manipulation functions.
+ o Fix many build issues when using the Microsoft C compiler.
+ o Remove a bash-ism in autogen.sh
+ o When calling event_del on a signal, restore the signal handler's previous value rather than setting it to SIG_DFL. Patch from Christopher Layne.
+ o Make the logic for active events work better with internal events; patch from Christopher Layne.
+ o We do not need to specially remove a timeout before calling event_del; patch from Christopher Layne.
diff --git a/protocols/Telegram/tgl/libevent/ChangeLog-2.0 b/protocols/Telegram/tgl/libevent/ChangeLog-2.0
new file mode 100644
index 0000000000..a925d33b18
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/ChangeLog-2.0
@@ -0,0 +1,1280 @@
+Changes in version 2.0.21-stable (18 Nov 2012)
+BUGFIXES:
+ o ssl: Don't discard SSL read event when timeout and read come close together (576b29f)
+ o ssl: Stop looping in "consider_reading" if reading is suspended. (f719b8a Joachim Bauch)
+ o ssl: No need to reserve space if reading is suspended. (1acf2eb Joachim Bauch)
+ o dns: Avoid a memory-leak on OOM in evdns. (73e85dd, f2bff75 George Danchev)
+ o build: Use python2 rather than python (0eb0109 Ross Lagerwall)
+ o build: Compile without warnings on mingw64 (94866c2)
+ o build: Fix compilation on mingw64 with -DUSE_DEBUG (62bd2c4)
+ o build: Make rpcgen_wrapper.sh work on systems without a "python2" binary (f3009e4)
+ o iocp: Close IOCP listener socket on free when LEV_OPT_CLOSE_ON_FREE is set (cb853ea Juan Pablo Fernandez)
+ o core: Avoid crash when event_pending() called with no event_base set on event (e3cccf3)
+ o misc: remove stray 'x' so print_err will compile when uncommented (ac35650 Patrick Pelletier)
+ o tests: Fix renegotiation test to work around openssl 1.0.1 bug (c2f3086)
+ o tests: Warn when openssl version in unit test mismatches compiled version. (ac009f9)
+
+
+Changes in version 2.0.20-stable (23 Aug 2012)
+BUGFIXES:
+ o core: Make event_pending() threadsafe. (be7a95c Simon Liu)
+ o win32: avoid crash when waiting forever on zero fds. (160e58b)
+ o evhttp: Fix a memory leak on error in evhttp_uriencode (11c8b31)
+ o evbuffer: Avoid possible needless call to writev. Found by coverity. (6a4ec5c)
+ o evdns: memset sockaddr_in before using it. Found by coverity. (a1a0e67)
+ o evhttp: Check more setsockopt return values when binding sockets. Found by coverity (a0912e3)
+ o evdns: Avoid segfault on weird timeout during name lookup. (dc32077 Greg Hazel)
+ o bufferevent_ssl: Correctly invoke callbacks when a SSL bufferevent reads some and then blocks. (606ac43)
+
+
+PORTABILITY FIXES:
+ o check for arc4random_buf at runtime, on OS X (bff5f94 Greg Hazel)
+ o Correctly check for arc4random_buf (fcec3e8 Sebastian Hahn)
+ o Add explicit AC_PROG_SED to configure.in so all autoconfs will expose $(SED) (ca80ea6)
+
+BUILD FIXES:
+ o Add GCC annotations so that the vsprintf functions get checked properly (117e327)
+ o Fix an unused variable warning on *BSD. (c0720c1)
+
+UNIT TEST FIXES:
+ o Fix a couple of memory leaks (found with Valgrind). (3b2529a Ross Lagerwall)
+ o Remove deadcode in http regression tests. Found by coverity. (5553346)
+ o Fix possible uninitialized read in dns regression tests. Found by coverity. (2259777)
+ o Set umask before calling mkstemp in unit tests. Found by coverity (f1ce15d)
+ o Fix various check-after-dereference issues in unit tests: found by coverity (4f3732d)
+ o Fix resource leaks in the unit tests; found by coverity (270f279)
+ o Add some missing null checks to unit tests; found by coverity (f021c3d)
+ o Avoid more crashes/bad calls in unit tests; found by coverity (3cde5bf)
+ o Remove unused variable; spotted by coverity (6355b2a)
+ o Add checks to various return values in unit tests. Found by coverity (b9e7329)
+ o Move assignment outside tt_assert in ssl unit tests. Appeases coverity. (a2006c0)
+
+
+
+Changes in version 2.0.19-stable (3 May 2012)
+BUGFIXES (CORE):
+ o Refactor event_persist_closure: raise and extract some common logic (bec22b4)
+ o If time has jumped so we'd reschedule a periodic event in the past, schedule it for the future instead (dfd808c)
+ o If a higher-priority event becomes active, don't continue running events of the current priority. (2bfda40)
+
+BUGFIXES (SSL):
+ o Fixed potential double-readcb execution with openssl bufferevents. (4e62cd1 Mark Ellzey)
+
+BUGFIXES (DNS):
+ o Cancel a probe request when the server is freed, and ignore cancelled probe callbacks (94d2336 Greg Hazel)
+ o Remove redundant DNS_ERR_CANCEL check, move comment (46b8060 Greg Hazel)
+ o When retransmitting a timed-out DNS request, pick a fresh nameserver. (3d9e52a)
+
+DOCUMENTATION FIXES:
+ o Fix a typo in the bufferevent documentation (98e9119)
+ o Add missing ) to changelog; spotted by rransom (4c7ee6b)
+ o Fix the website URL in the readme (f775521)
+
+COMPILATION FIXES:
+ o Fix a compilation error with MSVC 2005 due to use of mode_t (336dcae)
+ o Configure with gcc older than 2.95 (4a6fd43 Sebastian Hahn)
+ o Generate event-config.h with a single sed script (30b6f88 Zack Weinberg)
+
+FORWARD-COMPATIBILITY:
+ o Backport: provide EVENT_LOG_* names, and deprecate _EVENT_LOG_* (d1a03b2)
+
+TESTING/DEBUGGING SUPPORT:
+ o dns-example.c can now take a resolv.conf file on the commandline (6610fa5)
+ o Make some evdns.c debug logs more verbose (d873d67)
+ o Work-around a stupid gcov-breaking bug in OSX 10.6 (b3887cd)
+
+
+
+Changes in version 2.0.18-stable (22 Mar 2012)
+BUGFIXES (core):
+ o Make uses of open() close-on-exec safe by introducing an internal evutil_open_closeonexec. (d2b5f72 Ross Lagerwall, 03dce42)
+
+BUGFIXES (kqueue):
+ o Properly zero the kevent in kq_setup_kevent() (c2c7b39 Sebastian Hahn)
+
+BUILD FIXES:
+ o Added OPENSSL_LDFLAGS env variable which is appended to SSL checks. (9278196 Mark Ellzey)
+ o Changed OPENSSL_LDFLAGS to OPENSSL_LIBADD (2d67b63 Mark Ellzey)
+ o Don't do clang version detection when disabling some flags (083296b Sebastian Hahn)
+
+BUGFIXES (dns):
+ o Stop crashing in evdns when nameserver probes give a weird error (bec5068)
+
+
+Changes in version 2.0.17-stable (10 Feb 2012)
+
+BUGFIXES (core):
+ o Be absolutely sure to clear pncalls before leaving event_signal_closure (11f36a5)
+ o check for sysctl before we use it (358c745 Mike Frysinger)
+ o Remove bogus casts of socket to int before calling ev_callback (f032516)
+ o Make evconnlistener work around bug in older Linux when getting nmapped (ecfc720)
+ o Fix a list corruption bug when using event_reinit() with signals present (6e41cdc)
+ o Fix a fd leak in event_reinit() (3f18ad1)
+ o Do a memberwise comparison of threading function tables (c94a5f2 Nate R)
+ o Use C-style comments in C source files (for compatibility with compilers such as xlc on AIX). (d84d917 Greg Hewgill)
+ o Avoid crash when freeing event_iocp and using event_set_mem_functions (19715a6)
+ o In the kqueue backend, do not report EBADF as an EV_READ (5d7bfa1 Nicholas Marriott)
+
+BUGFIXES (evbuffer and bufferevents):
+ o Fix behavior of evbuffer_peek(buf,-1,NULL,NULL,0) (c986f23 Zack Weinberg)
+ o Loop on filtering SSL reads until we are blocked or exhausted. (5b4b812)
+
+BUGFIXES (evhttp):
+ o Force strict validation of HTTP version in response. (790f6b3 Catalin Patulea)
+
+BUGFIXES (evdns):
+ o evdns: fix a bug in circular-queue implementation (d6094b1)
+
+BUILD FIXES:
+ o Fix a silly compilation error with the sun compiler (1927776 Colin Watt)
+ o Suppress a gcc warning from ignoring fwrite return in http-sample.c (7206e8c)
+
+DOCUMENTATION FIXES:
+ o Slightly clarify evbuffer_peek documentation (7bbf6ca)
+ o Update copyright notices to 2012 (e49e289)
+
+NEW APIS:
+ o Backport evhttp_connection_get_bufferevent to Libevent 2.0 (da70fa7 Arno Bakker)
+
+TESTS AND TEST FIXES:
+ o Fix a race condition in the dns/bufferevent_connect_hostname test. (cba48c7)
+ o Add function to check referential integrity of an event_base (27737d5)
+ o Check event_base correctness at end of each unit test (3312b02)
+ o Workaround in the unit tests for an apparent epoll bug in Linux 3.2 (dab9187)
+ o Better workaround for Linux 3.2 edge-triggered epoll bug (9f9e259)
+
+Changes in version 2.0.16-stable (18 Nov 2011)
+BUGFIXES (core):
+ o More detailed message in case of libevent self-debugging failure. (9e6a4ef Leonid Evdokimov)
+ o epoll: close fd on alloc fail at initialization (1aee718 Jamie Iles)
+ o Fix compile warning from saying event2/*.h inside a comment (447b0ba)
+ o Warn when unable to construct base because of failing make_base_notifiable (4e797f3)
+ o Don't try to make notifiable event_base when no threading fns are configured (e787413)
+
+BUGFIXES (evbuffer):
+ o unit test for remove_buffer bug (90bd620 Greg Hazel)
+ o Fix an evbuffer crash in evbuffer_remove_buffer() (c37069c)
+
+BUGFIXES (bufferevent_openssl):
+ o Refactor amount-to-read calculations in buffervent_ssl consider_reading() (a186e73 Mark Ellzey)
+ o Move SSL rate-limit enforcement into bytes_to_read() (96c562f)
+ o Avoid spinning on OpenSSL reads (2aa036f Mark Ellzey)
+
+BUGFIXES (dns)
+ o Empty DNS reply with OK status is another way to say NODATA. (21a08d6 Leonid Evdokimov)
+
+TESTING:
+ o Tests for 94fba5b and f72e8f6 (d58c15e Leonid Evdokimov)
+ o Test for commit aff6ba1 (f7841bf Leonid Evdokimov)
+ o Style and comment tweaks for dns/leak* tests (5e42202)
+ o improve test to remove at least one buffer from src (7eb52eb Greg Hazel)
+
+DOCUMENTATION:
+ o Add note about evhttp_send_reply_end to its doxygen (724bfb5)
+ o Update copyright dates to 2011. (3c824bd)
+ o Fix typo in whatsnew-2.0.txt (674bc6a Mansour Moufid)
+ o Improve win32 behavior of dns-sample.c code (a3f320e Gisle Vanem)
+
+
+
+Changes in version 2.0.15-stable (12 Oct 2011)
+BUGFIXES (DNS):
+ o DNS: add ttl for negative answers using RFC 2308 idea. (f72e8f6 Leonid Evdokimov)
+ o Add DNS_ERR_NODATA error code to handle empty replies. (94fba5b Leonid Evdokimov)
+
+BUFGIXES (bufferevents and evbuffers):
+ o Make evbuffer callbacks get the right n_added value after evbuffer_add (1ef1f68 Alex)
+ o Prefer mmap to sendfile unless a DRAINS_TO_FD flag is set. Allows add_file to work with SSL. (0ba0af9)
+
+BUGFIXES (event loop):
+ o When a signal callback is activated to run multiple times, allow event_base_loopbreak to work even before they all have run. (4e8eb6a)
+
+DOCUMENTATION FIXES:
+ o Fix docstring in dns.h (2b6eae5 Leonid Evdokimov)
+ o refer to non-deprecated evdns functions in comments (ba5c27d Greg Hazel)
+
+BUILD AND TESTING FIXES:
+ o le-proxy and regress depend on openssl directly (9ae061a Sergey Avseyev)
+ o Use _SOURCES, not _sources, in sample/Makefile.am (7f82382)
+ o Fixed compiler warnings for unchecked read/write calls. (c3b62fd Mark Ellzey)
+ o Make write-checking fixes use tt_fail_perror (2b76847)
+ o Fix some "value never used" warnings with gcc 4.6.1 (39c0cf7)
+
+
+
+Changes in version 2.0.14-stable (31 Aug 2011)
+BUGFIXES (bufferevents and evbuffers):
+ o Propagate errors on the underlying bufferevent to the user. (4a34394 Joachim Bauch)
+ o Ignore OpenSSL deprecation warnings on OS X (5d1b255 Sebastian Hahn)
+ o Fix handling of group rate limits under 64 bytes of burst (6d5440e)
+ o Solaris sendfile: correctly detect amount of data sent (643922e Michael Herf)
+ o Make rate limiting work with common_timeout logic (5b18f13)
+ o clear read watermark on underlying bufferevent when creating filtering bev to fix potentially failing fragmented ssl handshakes (54f7e61 Joachim Bauch)
+
+BUGFIXES (IOCP):
+ o IOCP: don't launch reads or writes on an unconnected socket (495c227)
+ o Make IOCP rate-limiting group support stricter and less surprising. (a98da7b)
+ o Have test-ratelim.c support IOCP (0ff2c5a)
+ o Make overlapped reads result in evbuffer callbacks getting invoked (6acfbdd)
+ o Correctly terminate IO on an async bufferevent on bufferevent_free (e6af35d)
+
+BUGFIXES (other):
+ o Fix evsig_dealloc memory leak with debugging turned on. (9b724b2 Leonid Evdokimov)
+ o Fix request_finished memory leak with debugging turned on. (aff6ba1 Leonid Evdokimov)
+
+BUILD AND TESTING FIXES:
+ o Allow OS-neutral builds for platforms where some versions have arc4random_buf (b442302 Mitchell Livingston)
+ o Try to fix 'make distcheck' errors when building out-of-tree (04656ea Dave Hart)
+ o Clean up some problems identified by Coverity. (7c11e51 Harlan Stenn)
+
+
+Changes in version 2.0.13-stable (18 Jul 2011)
+BUGFIXES
+ o Avoid race-condition when initializing global locks (b683cae)
+ o Fix bug in SSL bufferevents backed by a bev with a write high-watermarks (e050703 Joachim Bauch)
+ o Speed up invoke_callbacks on evbuffers when there are no callbacks (f87f568 Mark Ellzey)
+ o Avoid a segfault when all methods are disabled or broken (27ce38b)
+ o Fix incorrect results from evbuffer_search_eol(EOL_LF) (4461f1a)
+ o Add some missing checks for mm_calloc failures (89d5e09)
+ o Replace an assertion for event_base_free(NULL) with a check-and-warn (09fe97d)
+ o Report kqueue ebadf, epipe, and eperm as EV_READ events (1fd34ab)
+ o Check if the `evhttp_new_object' function in `http.c' returns NULL. (446cc7a Mansour Moufid)
+ o Use the correct printf args when formatting size_t (3203f88)
+ o Complain if the caller tries to change threading cbs after setting them (cb6ecee)
+
+DOCUMENTATION FIXES AND IMPROVEMENTS
+ o Revise the event/evbuffer/bufferevent doxygen for clarity and accuracy (2888fac)
+ o Update Doxyfile to produce more useful output (aea0555)
+
+TEST FIXES
+ o Fix up test_evutil_snprintf (caf695a)
+ o Fix tinytest invocation from windows shell (57def34 Ed Day)
+
+BUILD FIXES
+ o Use AM_CPPFLAGS in sample/Makefile.am, not AM_CFLAGS (4a5c82d)
+ o Fix select.c compilation on systems with no NFDBITS (49d1136)
+ o Fix a few warnings on OpenBSD (8ee9f9c Nicholas Marriott)
+ o Don't break when building tests from git without python installed (b031adf)
+ o Don't install event_rpcgen.py when --disable-libevent-install is used (e23cda3 Harlan Stenn)
+ o Fix AIX build issue with TAILQ_FOREACH definition (e934096)
+
+
+Changes in version 2.0.12-stable (4 Jun 2011)
+BUGFIXES
+ o Fix a warn-and-fail bug in kqueue by providing kevent() room to report errors (28317a0)
+ o Fix an assert-inducing fencepost bug in the select backend (d90149d)
+ o Fix failing http assertion introducd in commit 0d6622e (0848814 Kevin Ko)
+ o Fix a bug that prevented us from configuring IPv6 nameservers. (74760f1)
+ o Prevent size_t overflow in evhttp_htmlescape. (06c51cd Mansour Moufid)
+ o Added several checks for under/overflow conditions in evhttp_handle_chunked_read (a279272 Mark Ellzey)
+ o Added overflow checks in evhttp_read_body and evhttp_get_body (84560fc Mark Ellzey)
+
+DOCUMENTATION:
+ o Add missing words to EVLOOP_NONBLOCK documentation (9556a7d)
+
+BUILD FIXES
+ o libssl depends on libcrypto, not the other way around. (274dd03 Peter Rosin)
+ o Libtool brings in the dependencies of libevent_openssl.la automatically (7b819f2 Peter Rosin)
+ o Use OPENSSL_LIBS in Makefile.am (292092e Sebastian Hahn)
+ o Move the win32 detection in configure.in (ceb03b9 Sebastian Hahn)
+ o Correctly detect openssl on windows (6619385 Sebastian Hahn)
+ o Fix a compile warning with zlib 1.2.4 and 1.2.5 (5786b91 Sebastian Hahn)
+ o Fix compilation with GCC 2, which had no __builtin_expect (09d39a1 Dave Hart)
+ o Fix new warnings from GCC 4.6 (06a714f)
+ o Link with -lshell32 and -ladvapi32 on Win32. (86090ee Peter Rosin)
+ o Make the tests build when OpenSSL is not available. (07c41be Peter Rosin)
+ o Bring in the compile script from automake, if needed. (f3c7a4c Peter Rosin)
+ o MSVC does not provide S_ISDIR, so provide it manually. (70be7d1 Peter Rosin)
+ o unistd.h and sys/time.h might not exist. (fe93022 Peter Rosin)
+ o Make sure TINYTEST_LOCAL is defined when building tinytest.c (8fa030c Peter Rosin)
+ o Fix winsock2.h #include issues with MSVC (3d768dc Peter Rosin)
+ o Use evutil_gettimeofday instead of relying on the system gettimeofday. (0de87fe Peter Rosin)
+ o Always use evutil_snprintf, even if OS provides it (d1b2d11 Sebastian Hahn)
+ o InitializeCriticalSectionAndSpinCount requires _WIN32_WINNT >= 0x0403. (816115a Peter Rosin)
+ o cygwin: make it possible to build DLLs (d54d3fc)
+
+
+
+Changes in version 2.0.11-stable (27 Apr 2011)
+ [Autogenerated from the Git log, sorted and cleaned by hand.]
+BUGFIXES:
+ o Fix evport handling of POLLHUP and POLLERR (b42ce4b)
+ o Fix compilation on Windows with NDEBUG (cb8059d)
+ o Check for POLLERR, POLLHUP and POLLNVAL for Solaris event ports (0144886 Trond Norbye)
+ o Detect and handle more allocation failures. (666b096 Jardel Weyrich)
+ o Use event_err() only if the failure is truly unrecoverable. (3f8d22a Jardel Weyrich)
+ o Handle resize failures in the select backend better. (83e805a)
+ o Correctly free selectop fields when select_resize fails in select_init (0c0ec0b)
+ o Make --enable-gcc-warnings a no-op if not using gcc (3267703)
+ o Fix a type error in our (unused) arc4random_stir() (f736198)
+ o Correctly detect and stop non-chunked http requests when the body is too long (63a715e)
+ o Have event_base_gettimeofday_cached() always return wall-clock time (a459ef7)
+ o Workaround for http crash bug 3078187 (5dc5662 Tomash Brechko)
+ o Fix incorrect assertions and possible use-after-free in evrpc_free() (4b8f02f Christophe Fillot)
+ o Reset outgoing http connection when read data in idle state. (272823f Tomash Brechko)
+ o Fix subtle recursion in evhttp_connection_cb_cleanup(). (218cf19 Tomash Brechko)
+ o Fix the case when failed evhttp_make_request() leaved request in the queue. (0d6622e Tomash Brechko)
+ o Fix a crash bug in evdns server circular list code (00e91b3)
+ o Handle calloc failure in evdns. (Found by Dave Hart) (364291e)
+ o Fix a memory leak on win32 socket->event map. (b4f89f0)
+ o Add a forgotten NULL check to evhttp_parse_headers (12311ff Sebastian Hahn)
+ o Fix possible NULL-deref in evdns_cancel_request (5208544 Sebastian Hahn)
+
+PORTABILITY:
+ o Fall back to sscanf if we have no other way to implement strtoll (453317b)
+ o Build correctly on platforms without sockaddr_storage (9184563)
+ o Try to build correctly on platforms with no IPv6 support (713c254)
+ o Build on systems without AI_PASSIVE (cb92113)
+ o Fix http unit test on non-windows platforms without getaddrinfo (6092f12)
+ o Do not check for gethostbyname_r versions if we have getaddrinfo (c1260b0)
+ o Include arpa/inet.h as needed on HPUX (10c834c Harlan Stenn)
+ o Include util-internal.h as needed to build on platforms with no sockaddr_storage (bbf5515 Harlan Stenn)
+ o Check for getservbyname even if not on win32. (af08a94 Harlan Stenn)
+ o Add -D_OSF_SOURCE to fix hpux builds (0b33479 Harlan Stenn)
+ o Check for allocation failures in apply_socktype_protocol_hack (637d17a)
+ o Fix the check for multicast or broadcast addresses in evutil_check_interfaces (1a21d7b)
+ o Avoid a free(NULL) if out-of-memory in evdns_getaddrinfo. Found by Dave Hart (3417f68)
+
+DEFENSIVE PROGRAMMING:
+ o Add compile-time check for AF_UNSPEC==PF_UNSPEC (3c8f4e7)
+
+BUGS IN TESTS:
+ o Fix test.sh output on solaris (b4f89b6 Dave Hart)
+ o Make test-eof fail with a timeout if we never get an eof. (05a2c22 Harlan Stenn)
+ o Use %s with printf in test.sh (039b9bd)
+ o Add an assert to appease clang's static analyzer (b0ff7eb Sebastian Hahn)
+ o Add a forgotten return value check in the unit tests (3819b62 Sebastian Hahn)
+ o Actually send NULL request in http_bad_request_test (b693c32 Sebastian Hahn)
+ o add some (void) casts for unused variables (65707d7 Sebastian Hahn)
+ o Refactor test_getaddrinfo_async_cancel_stress() (48c44a6 Sebastian Hahn)
+ o Be nice and "handle" error return values in sample code (4bac793 Sebastian Hahn)
+ o Check return value of evbuffer_add_cb in tests (93a1abb Sebastian Hahn)
+ o Remote some dead code from dns-example.c (744c745 Sebastian Hahn)
+ o Zero a struct sockaddr_in before using it (646f9fe Sebastian Hahn)
+
+BUILD FIXES:
+ o Fix warnings about AC_LANG_PROGRAM usage (f663112 Sebastian Hahn)
+ o Skip check for zlib if we have no zlib.h (a317c06 Harlan Stenn)
+ o Fix autoconf bracket issues; make check for getaddrinfo include netdb.h (833e5e9 Harlan Stenn)
+ o Correct an AM_CFLAGS to an AM_CPPFLAGS in test/Makefile.am (9c469db Dave Hart)
+ o Fix make distcheck & installation of libevent 1 headers (b5a1f9f Dave Hart)
+ o Fix compilation under LLVM/clang with --enable-gcc-warnings (ad9ff58 Sebastian Hahn)
+
+FEATURES:
+ o Make URI parser able to tolerate nonconformant URIs. (95060b5)
+
+DOCUMENTATION:
+ o Clarify event_set_mem_functions doc (926f816)
+ o Correct evhttp_del_accept_socket documentation on whether socket is closed (f665924)
+ o fix spelling mistake in whatsnew-2.0.txt (deb2f73)
+ o Fix sample/http-server ipv6 fixes (eb692be)
+ o Comment internal headers used in sample code. (4eb281c)
+ o Be explicit about how long event loops run in event.h documentation (f95bafb)
+ o Add comment to configure.in to explain gc-sections test logic (c621359)
+ o Fix a couple of memory leaks in samples/http-server.c. Found by Dave Hart. (2e9f665)
+
+BUILD IMPROVEMENTS:
+ o Use the gcc -ffunction-segments feature to allow gc when linking with static libevent (0965c56 Dave Hart)
+ o Add configure options to disable installation, regression tests (49e9bb7 Dave Hart)
+
+
+
+Changes in version 2.0.10-stable (16 Dec 2010)
+ [Autogenerated from the Git log, sorted and cleaned by hand.]
+BUGFIXES
+ o Minor fix for IOCP shutdown handling fix (2599b2d Kelly Brock)
+ o Correctly notify the main thread when activating an event from a subthread (5beeec9)
+ o Reject overlong http requests early when Expect:100-continue is set (d23839f Constantine Verutin)
+ o EVUTIL_ASSERT: Use sizeof() to avoid "unused variable" warnings with -DNDEBUG. (b63ab17 Evan Jones)
+
+CODE CLEANUPS
+ o bufferevent-internal.h: Use the new event2/util.h header, not evutil.h (ef5e65a Evan Jones)
+ o Use relative includes instead of system includes consistently. (fbe64f2 Evan Jones)
+ o Make whitespace more consistent
+
+TESTING
+ o tests: Use new event2 headers instead of old compatibility headers. (4f33209 Evan Jones)
+
+DOCUMENTATION
+ o Document that the cpu_hint is only used on Windows with IOCP for now (57689c4)
+ o Add stuff to "whats new in 2.0" based on reading include changes since August. (18adc3f)
+
+
+Changes in 2.0.9-rc (30 Nov 2010):
+ [Autogenerated from the Git log, sorted and cleaned by hand.]
+NEW AND MODIFIED APIs
+ o Add a function to change a listener's callback. (46ee061)
+ o Make evbuffer_add_file take ev_off_t, not off_t (ac7e52d)
+ o Make rate-limits go up to SIZE_MAX/EV_SSIZE_MAX, not just INT32_MAX (2cbb1a1)
+ o Add a bufferevent_get_base function (aab49b6)
+
+MAJOR BUGFIXES
+ o Disable changelist for epoll by default because of Linux dup() bug; add an option and/or an envvar to reenable it for speed. (9531763)
+ o Fix a 100%-CPU bug where an SSL connection would sometimes never stop trying to write (1213d3d)
+ o Fix a nasty bug related to use of dup() with epoll on Linux (c281aba)
+ o Fix bugs in posix thread-id calculation when sizeof(pthread_t) != sizeof(long) (fbaf077)
+ o Fix some ints to evutil_socket_t; make tests pass on win64. (f817bfa Dimitre Piskyulev)
+ o Set _EVENT_SIZEOF_VOID_P correctly on win32 and win64 (1ae82cd Dimitre Piskyulev)
+ o Avoid double-invocation of user callback with EVUTIL_EAI_CANCEL (abf01ed)
+ o Set SO_UPDATE_ACCEPT_CONTEXT on sockets from AcceptEx so that shutdown() can work (52aa419)
+ o When closing a filtering bufferevent, clear callbacks on the underlying bufferevent (fc7b1b0)
+
+NEW AND MODIFIED HTTP APIs
+ o Add evhttp_parse_query_str to be used with evhttp_uri_parse. (2075fbc)
+ o Add evhttp_response_code to remove one more reason to include http_struct.h (22e0a9b)
+ o Define enumerators for all HTTP methods, including PATCH from RFC5789 (75a7341 Felix Nawothnig)
+ o Functions to actually use evhttp_bound_socket with/as evconnlistener. (006efa7)
+ o Add evhttp_request_get_command so code can tell GET from POST without peeking at the struct. (49f4bf7)
+ o Introduce absolute URI parsing helpers. (86dd720 Pavel Plesov)
+ o Revise evhttp_uri_parse implementation to handle more of RFC3986 (eaa5f1d)
+ o Add evhttp_connection_get_base() to get the event_base from an http connection (cd00079)
+ o Let evhttp_parse_query return -1 on failure (b1756d0)
+ o New evhttp_uri(encode|decode) functions to handle + and NUL characters right (a8148ce)
+ o Add evhttp_response_code to remove one more reason to include http_struct.h (22e0a9b)
+ o Tweak interface for allowed methods (f5b391e)
+ o Add evhttp server alias interface, correct flagging of proxy requests. (aab8c38 Christopher Davis)
+
+HTTP BUGFIXES
+ o Add some comments to http.c and make a few functions static. (90b3ed5)
+ o Fix Content-Length when trying send more than 100GB of data (!) on an evhttp. (525da3e)
+ o Fix a bug where we would read too much data in HTTP bodies or requests. (58a1cc6)
+ o Correctly count req->body_size on http usage without Content-Length (8e342e5)
+ o Avoid missed-request bug when entire http request arrives before data is flushed (74c0e86)
+ o reset "chunked" flag when sending non-chunked reply (aa5f55f Joachim Bauch)
+ o evhttp_encode_uri encodes all reserved characters, including !$'()*+,/:=@ (2e63a60)
+ o Replace exact-version checks for HTTP/1.1 with >= or < checks (647e094)
+ o evhttp: Return 501 when we get an unrecognized method, not 400. (536311a)
+ o Don't disable reading from the HTTP connection after sending the request to be notified of connection-close in time (c76640b Felix Nawothnig)
+ o Never call evhttp_readcb while writing. (0512487)
+ o Try to fix an assertion failure related to close detection (0faaa39)
+ o Correctly detect timeouts during http connects (04861d5)
+ o Preliminary support for Continue expectation in evhttp. (fa9305f Christopher Davis)
+
+OTHER BUGFIXES
+ o Correct logic for realigning a chain in evbuffer_add (e4f34e8)
+ o Fix a minor syntax error that most compilers didn't care about (e56ff65)
+ o Fix some uses of int for socket in regress (5d389dc)
+ o Check return value for ioctlsocket on win32 (f5ad31c Trond Norbye)
+ o Fix som event_warns that should have been event_warnx (19c71e7)
+ o Fix signal handler types for win64. (b81217f)
+ o Try to clear up more size_t vs int/long issues. (598d133)
+ o Make sure IOCP evconnlistener uses virtual events. (7b40a00 Christopher Davis)
+ o Don't free evdns_request handles until after the callback is invoked (9ed30de)
+ o Fix some more cancel-related bugs in getaddrinfo_async (c7cfbcf)
+ o Make evdns_getaddrinfo_cancel threadsafe (d51b2fc)
+ o Only clear underlying callbacks when the user hasn't reset them. (1ac5b23)
+ o Fix bug in bufferevent_connect on an openssl bufferevent that already had an fd (4f228a1)
+ o Resolve an evport bug in the thread/forking test (3a67d0b)
+ o Make sure the CLOEXEC flag is set on fds we open for base notification (3ab578f)
+ o Fix IRIX build. sa_family collides with a #define in sys/socket.h on IRIX. (e874982 Kevin Bowling)
+ o If not WIN32, include <sys/socket.h> in event2/util.h. (1cd45e5 Kevin Bowling)
+ o Fix some C99-style comments to work with the xlC compiler. (c2e5e22 Kevin Bowling)
+ o Add some checks since lack of TAILQ_FOREACH doesn't imply lack of FIRST, END, NEXT, or INSERT_BEFORE. Quiet some warnings in XL C. (c4dc335 Kevin Bowling)
+ o Reworked AIX __ss_family workaround to use AC_STRUCT_MEMBER. (2e2a3d7 Kevin Bowling)
+ o Take select from <sys/select.h> when testing in autoconf. AIX build fix. (a3a9f6b Kevin Bowling)
+ o Fix snprintf related failures on IRIX. (3239073 Kevin Bowling)
+ o Remove _event_initialized(); make event_initialized() a function(); make it consistent on windows and non-windows (652024b)
+ o Do not let EVLOOP_ONCE exit the loop until all deferred callbacks have run (2d5e1bd)
+ o Make EVLOOP_ONCE ignore internal events (0617a81)
+ o Possible crash fix when freeing an underlying bufferevent of an openssl bufferevent (29f7623)
+
+HTTP CLEANUPS
+ o Stop using Libevent-1 headers in regress_http (1f507d7)
+ o Modernize header usage in bench_http.c (e587069)
+ o fix signed/unsigned warnings in http.c (74a91e5)
+ o Update the HTTP regression tests to use Libevent2 apis for non-http stuff (d9ffa89)
+ o Start porting http tests to not use legacy interfaces (8505a74)
+ o Convert the rest of the http tests to be non-legacy unit tests. (9bb8239)
+ o Rename the confusing "base" static variable in regress_http.c (353402a)
+ o Stop accessing http request struct directly from in the unit tests. (0b137f4)
+ o Refactor http version parsing into a single function (a38140b)
+
+TESTING
+ o Improvements to tinytest_macros.h (ad923a1)
+ o Add a huge pile of tests for the new URI functions, and make them pass. (a5a76e6)
+ o Unit tests for evhttp_uri_set* (bc98f5e)
+ o Increase the skew tolerance to 2 seconds in thread/deferred_cb_skew (f806476 Christopher Davis)
+ o Reorder backends in test.sh to match preference order in event.c (ece974f)
+ o Add a stress test for getaddrinfo_cancel (da1bf52)
+ o Units test for unexpected evhttp methods. (75e3320)
+
+DOCUMENTATION
+ o Document behavior of URI parsing more thoroughly. (3a33462)
+ o Document that two bufferevent functions only work on socket bufferevents (70e1b60)
+ o add a requested docstring for event_rpcgen.CommandLine.__init__ (f1250eb)
+ o Fix a mistake in http documentation found by Julien Blache (229714d)
+ o Add a basic example of how to write a static HTTP server. (4e794d5)
+ o Document event_get_assignment (88be27d)
+ o Note that reentrant calls to libevent from logging cbs may fail badly (e431bcd)
+ o Clarify EVLOOP_* documentation to be more precise. (057a514)
+
+CLEANUPS
+ o Simplify the logic for choosing EPOLL_CTL_ADD vs EPOLL_CTL_MOD (2c66983)
+ o Rename "size" variables in win32select that were really fd counts. (b6a158c)
+ o Fix even more win64 warnings (7484df6)
+ o Fix even more win64 warnings: buffer, event_tagging, http, evdns, evrpc (545a611)
+ o Fix more wn64 warnings. (34b84b9 Christopher Davis)
+ o Use the label_len local variable in evdns instead of recalculating it over and over (ba01456)
+ o Fix some irix compilation warnings spotted by Kevin Bowling (7bcace2)
+
+
+
+Changes in 2.0.8-rc (14 Oct 2010):
+ [Autogenerated from the Git log, sorted and cleaned by hand.]
+NEW APIS
+ o Add error callback to evconnlistener (c4be8d8 Simon Perreault)
+ o Add a LEV_OPT_THREADSAFE option for threadsafe evconnlisteners (127d4f2)
+
+CHANGED BEHAVIOR
+ o Correct logic on disabling underlying bufferevents when disabling a filter (ac27eb8)
+
+BUGFIXES
+ o Obey enabled status when unsuspending (040a019 Simon Perreault)
+ o Warn when using the error-prone EV_SIGNAL interface in an error-prone way. Also, fix a couple of race conditions in signal.c (720bd93)
+ O Make default signal backend fully threadsafe (95a7d41)
+ o Put internal events at highest priority (90651b3)
+ o Fix warnings in the main codebase flagged by -Wsigned-compare (9c8db0, 5e4bafb, 5c214a, 6be589a, e06f514)
+ o Fix compile in kqueue.c (b395392 Sebastian Hahn)
+ o Do not search outside of the system directory for windows DLLs (d49b5e3)
+ o Fix a spurious-call bug on epoll.c (0faaee0)
+ o Send a shutdown(SHUT_WR) before closing an http connection (e0fd870 Christopher Davis)
+ o Fix warnings on mingw with gcc 4.5 (5b7a370)
+ o Fix an EINVAL on evbuffer_write_iovec on OpenSolaris. (fdc640b)
+ o Fix allocation error for IOCP listeners. Probably harmless, since struct event is big (481ef92)
+ o Make iocp/listener/error work; don't accept again if lev is disabled. (62b429a Christopher Davis)
+ o Handle rate-limiting for reading on OpenSSL bufferevents correctly. (819b171)
+ o Fix serious bugs in per-bufferevent rate-limiting code (34d64f8)
+ o Avoid spurious reads from just-created open openssl bufferevents (223ee40)
+ o Fix a case where an ssl bufferevent with CLOSE_ON_FREE didn't close its fd (93bb7d8)
+ o The corrected bufferevent filter semantics let us fix our openssl tests (34331e4)
+
+TESTING
+ o Make SSL tests cover enabling/disabling EV_READ. (a5ce9ad)
+ o Bump to the latest version of tinytest (f0bd83e)
+ o Unit tests for listener error callbacks (045eef4)
+ o New unit test for ssl bufferevents starting with connected SSLs. (02f6259)
+
+DEBUGGABILITY
+ o Make debugging output for epoll backend more comprehensive (ec2b05e)
+ o Make event.c debugging messages report fds (e119899)
+ o Make the --enable-gcc-warnings option include signed comparison warnings (d3b096c)
+
+DEADCODE REMOVAL
+ o Remove the now-useless evsig_caught and evsig_process (4858b79)
+ o Remove event_base.evsigbase; nothing used it. (38d0960)
+
+
+
+Changes in 2.0.7-rc (9 Sep 2010):
+ [Autogenerated from the Git log, sorted and cleaned by hand.]
+NEW APIS
+ o Expose a evdns_base_nameserver_sockaddr_add() function to add a nameserver by sockaddr (1952143)
+ o Add event_config_set_num_cpus_hint() for tuning win32 IOCP thread pools, etc. (2447fe8 Christopher Davis)
+
+BUGFIXES
+ o Fix a nasty dangling-event bug when using rate-limiting groups (0bffe43)
+ o Clean up syntax on TAILQ_ENTRY() usage to build correctly with recent MSVC (60433a0 Gilad Benjamini)
+ o Make definition of WIN32_LEAN_AND_MEAN in event.h conditional (3920172 Gilad Benjamini)
+ o Correctly detect failure to delete bufferevent read-timeout event (da6e7cd)
+ o Set close-on-exec bit for filedescriptors created by dns subsystem (d0b8843)
+ o Fix kqueue correctness test on x84_64 (6123d12)
+ o Detect events with no ev_base; warn instead of crashing (f1074b7)
+ o Fix an issue with forking and signal socketpairs in select/poll backends (d61b2f3)
+ o Stop using global arrays to implement the EVUTIL_ctype functions (1fdec20)
+ o On windows, make lock/thread function tables static (5de2bcb)
+ o Close th_notify_fds and open a new pair on reinit (495ed66)
+ o Declare signal handler function as "__cdecl" on Windows (f0056d0)
+ o Use the _func() replacements for open, fstat, etc in evutil.c on win32 (e50c0fc)
+ o Only process up to MAX_DEFERRED deferred_cbs at a time (17a14f1 Christopher Davis)
+
+THREADING BUGFIXES
+ o Avoid deadlock when activating signals (970e6ad)
+ o Add a condition variable backend, with implementations for pthreads and win32 (d4977b5)
+ o Use conditions instead of current_event_lock to fix a deadlock (e0972c2)
+ o Fix logic error in win32 TRY_LOCK that caused problems with rate-limiting (4c32b9d)
+ o Avoid needlessly calling evthread_notify_base() when the loop is not running (c7a06bf)
+ o Minimize calls to base_notify implementation functions, thereby avoiding needless syscalls (4632b78)
+
+IOCP BUGFIXES
+ o IOCP-related evbuffer fixes (03afa20 Christopher Davis)
+ o Stop IOCP when freeing the event_base (d844242 Christopher Davis)
+ o Some IOCP bufferevent tweaks (76f7e7a Christopher Davis)
+
+TESTS
+ o Make the regress_pthread.c tests work on windows with current test APIs (d74ae38)
+ o Add a unit test for conditions (5fb1095)
+ o Allow more than one copy of regression tests to run at once (a97320a)
+ o Fix event_del(0) instance in bench.c (b0f284c Shuo Chen)
+ o Fix a few memory leaks in the tests (1115366)
+ o IOCP-related unit test tweaks (499452f Christopher Davis)
+ o Improve testing of when thread-notification occurs (ce85280)
+
+BUILD AND DISTRIBUTION
+ o Add pkgconfig files for libevent_{openssl,pthreads} (ebcb1f0)
+ o Change include order in Makefile.nmake (4022b28)
+ o Make include/event2/event-config.h not included in source dist (a4af9be)
+ o Honor NDEBUG; build without warnings with NDEBUG; make NDEBUG always-off in unit test code (743f866)
+ o Declare evkeyvalq and event_list even if event_struct.h comes before sys/queue.h (d3ceca8)
+ o Move evkeyvalq into a separate header for evhttp_parse_query users (ca9048f)
+ o Prefer autoreconf -ivf to manual autogen.sh (7ea8e89)
+
+CLEANUP
+ o Completely remove the (mostly-removed) obsolete thread functions (3808168)
+ o Rename regress_pthread.c to regress_thread.c (041989f)
+ o Make defer-internal.h use lock macros, not direct calls to lock fns (5218d2a)
+
+DOCUMENTATION
+ o Document that DNS_NO_SEARCH is an obsolete alias for DNS_QUERY_NO_SEARCH (33200e7)
+ o Update the whatsnew-2.0.txt document (4991669)
+
+
+
+Changes in 2.0.6-rc (6 Aug 2010):
+ [Autogenerated from the Git log, sorted by hand.]
+DOCUMENTATION
+ o Document a change in the semantics of event_get_struct_event_size() (e21f5d1)
+ o Add a comment to describe our plan for library versioning (9659ece)
+ o Fix sentence fragment in docs for event_get_struct_event_size() (7b259b6)
+
+NEW FEATURES AND INTERFACE CHANGES
+ o Remove the obsolete evthread interfaces (c5bab56)
+ o Let evhttp_send_error infer the right error reasons (3990669)
+ o Add a function to retrieve the other side of a bufferevent pair (17a8e2d)
+ o Add bufferevent_lock()/bufferevent_unlock() (215e629)
+ o Stop asserting when asked for a (unsupported) TCP dns port. Just return NULL. (7e87a59)
+ o Replace (unused,always 0) is_tcp argument to evdns_add_server_port*() with flags (e1c1167)
+ o Constify a couple of arguments to evdns_server_request_add_*_reply (cc2379d)
+ o Add an interface to expose min_share in ratelimiting groups (6ae53d6)
+
+BUGFIXES
+ o Avoid event_del on uninitialized event in event_base_free (6d19510)
+ o Add some missing includes to fix Linux build again (75701e8)
+ o Avoid close of uninitialized socket in evbuffer unit test (bda21e7)
+ o Correctly recognize .255 addresses as link-local when looking for interfaces (8c3452b)
+ o If no evdns request can be launched, return NULL, not a handle (b14f151)
+ o Use generic win32 interfaces, not ASCII-only ones, where possible. (899b0a3)
+ o Fix the default HTTP error template (06bd056 Felix Nawothnig)
+ o Close the file in evutil_read_file whether there's an error or not. (0798dd1 Pierre Phaneuf)
+ o Fix possible nullptr dereference in evhttp_send_reply_end() (29b2e23 Felix Nawothnig)
+ o never let bufferevent_rlim functions return negative (0859870)
+ o Make sample/hello_world work on windows (d89fdba)
+ o Fix a deadlock related to event-base notification. Diagnosed by Zhou Li, Avi Bab, and Scott Lamb. (17522d2)
+ o Possible fix to 100% cpu usage with epoll and openssl (cf249e7 Mike Smellie)
+ o Don't race when calling event_active/event_add on a running signal event (fc5e0a2)
+ o Suppress a spurious EPERM warning in epoll.c (e73cbde)
+ o Fix wrong size calculation of iovec buffers when exact=1 (65abdc2 niks)
+ o Change bufferevent_openssl::do_write so it doesn't call SSL_write with a 0 length buffer (c991317 Mike Smellie)
+ o Fixed compilation of sample/le-proxy.c on win32 (13b912e Trond Norbye)
+ o Fix rate-limit calculation on openssl bufferevents. (009f300)
+ o Remember to initialize timeout events for bufferevent_async (de1f5d6 Christopher Davis)
+
+BUILD AND DISTRIBUTION CHANGES
+ o Test the unlocked-deferred callback case of bufferevents (dfb75ab)
+ o Remove the now-unusable EVTHREAD_LOCK/UNLOCK constants (fdfc3fc)
+ o Use -Wlogical-op on gcc 4.5 or higher (d14bb92)
+ o Add the libtool-generated /m4/* stuff to .gitignore (c21c663)
+ o Remove some automake-generated files from version control. (9b14911)
+ o Have autogen.sh pass --force-missing to automake (8a44062)
+ o Set library version for libevent_pthreads correctly (b2d7440)
+ o Really only add libevent_core.la to LIBADD on mingw (1425003 Sebastian Hahn)
+ o Build more cleanly with NetBSDs that dislike toupper(char) (42a8c71)
+ o Fix unit tests with -DUSE_DEBUG enabled (28f31a4)
+ o Fix evdns build with -DUNICODE (5fa30d2)
+ o Move event-config.h to include/event2 (ec347b9)
+
+TESTING
+ o Add options to test-ratelim.c to check its results (2b44dcc)
+ o Make test-ratelim clean up after itself better. (b5bfc44)
+ o Remove the now-obsolete setup_test() and cleanup_test() functions (e73f1d7)
+ o Remove all non-error prints from test/regress.c (8bc1e3d)
+ o Make test.sh exit with nonzero status if tests fail (faf2a04)
+ o Have the unit tests report errors from test.sh (3689bd2)
+ o Fix logic in correcting high values from FIONREAD (3467f2f)
+ o Add test for behavior on remote socket close (44d57ee)
+ o Unit test for event_get_struct_event_size() (7510aac)
+ o Make test/test.sh call test-changelist (7c92691)
+ o Fix badly-behaved subtest of dns/bufferevent_connect_hostname (840a72f Joachim Bauch)
+ o Add option to test-ratelim to test min_share (42f6b62)
+ o Fix an assertion bug in test-ratelim (b2c6202)
+ o Make tests quieter on local dns resolver failure (e996b3d)
+ o Increase the tolerance in our unit tests for sloppy clocks. (170ffd2)
+ o Use AF_INET socketpair to test sendfile on Solaris (9b60209)
+ o Make test-changelist count cpu usage right on win32 (ea1ea3d)
+
+INTERNALS, PERFORMANCE, AND CODE CLEANUPS
+ o Mark the event_err() functions as __attribute__((noreturn)) (33bbbed)
+ o Do not check that event_base is set in EVBASE_ACQUIRE_LOCK (218a3c3)
+ o Replace (safe) use of strcpy with memcpy to appease OpenBSD (caca2f4)
+ o Remove some dead assignments (47c5dfb)
+ o Fix a pedantic gcc 4.4 warning in event2/event.h (276e7ee)
+ o Drain th_notify_fd[0] more bytes at a time. (a5bc15b)
+ o Tidy up the code in evthread_make_base_notifiable a little (61e1eee)
+ o Pass flags to fcntl(F_SETFL) and fcntl(F_SETFD) as int, not long (7c2dea1)
+ o Remove unused variables in test/test-changelist.c (b00d4c0)
+ o Fix whitespace. (cb927a5)
+ o Improve error message for failed epoll to make debugging easier. (9e725f7)
+ o Turn our socketpair() replacement into its own function (57b30cd)
+
+
+
+Changes in 2.0.5-beta (10 May 2010):
+ [Autogenerated from the Git log, sorted by hand.]
+DOCUMENTATION
+ o Update all our copyright notices to say "2010" (17efc1c)
+ o Add Christopher Clark and Maxim Yegorushkin to the LICENSE file (38b7b57)
+ o Clarify Christopher Clark's status as writer of original ht code. (78772c3)
+ o Try to comment some of the event code more (cdd4c49)
+ o Add a few more evmap/changelist comments (c247adc)
+ o Add a comment to explain why evdns_request is now separte from request (ceefbe8)
+ o Document evutil_secure_rng_init() and evutil_secure_rng_add_bytes() (a5bf43a)
+ o Stop distributing and installing manpages: they were too inaccurate (7731ec8)
+
+NEW FEATURES AND INTERFACE CHANGES
+ o Remove signal_assign() and signal_new() macros. (2fac0f7)
+ o Make evdns use the regular logging system by default (b2f2be6)
+ o Allow evbuffer_read() to split across more than 2 iovecs (e470ad3)
+ o Functions to manipulate existing rate limiting groups. (ee41aca)
+ o Functions to track the total bytes sent over a rate limit group. (fb366c1)
+ o Detect and refuse reentrant event_base_loop() calls (b557b17)
+ o Limit the maximum number of events on each socket to 65535 (819f949)
+ o Add evbuffer_copyout to copy data from an evbuffer without draining (eb86c8c)
+ o Expose the request and reply members of rpc_req_generic() (07edf78 Shuo Chen)
+ o Add void* arguments to request_new and reply_new evrpc hooks (755fbf1 Shuo Chen)
+ o Seed the RNG using sysctl() as well as /dev/urandom (71fc3eb)
+ o Make evutil_secure_rng_init() work even with builtin arc4random (f980716)
+ o Report DNS error when lookup fails during bufferevent_socket_connect_hostname. (0ef4070 Christopher Davis)
+ o Release locks on bufferevents while executing callbacks (a5208fe Joachim Bauch) o Make debug mode catch mixed ET and non-ET events on an fd (cb67074)
+ o Catch attempts to enable debug_mode too late (9ecf0d4)
+ o Refuse null keys in evhttp_parse_query() (953e229 Frank Denis)
+
+BUGFIXES
+ o Avoid a spurious close(-1) on Linux (70a44b6)
+ o Do not close(-1) when freeing an uninitialized socket bufferevent (b34abf3)
+ o Free evdns_base->req_heads on evdns_base_free (859af67)
+ o Avoid an (untriggerable so far) crash bug in bufferevent_free() (0cf1431)
+ o Set mem_offset for every bufferevent type (657d1b6)
+ o Fix infrequent memory leak in bufferevent_init_common(). (8398641 Jardel Weyrich)
+ o Make evutil_signal_active() match declaration. (e1e703d Patrick Galbraith)
+ o Fix minheap code to use replacement malloc functions (a527618)
+ o Fix a free(NULL) in minheap-internal.h (6f20492)
+ o Fix critical bug in evbuffer_write when writev is not available (cda56ab)
+ o Make the no_iovecs case of write_atmost compile (8e227b0)
+ o Fix a memory leak when appending/prepending to a buffer with unused space. (45068a3)
+ o Clean up a mistake in pointer manipulation in evbuffer_remove (28bfed4 Christopher Davis)
+ o Always round up when there's a fractional number of msecs. (8f9e60c Christopher Davis)
+ o Fix compiler warnings under WIN32 (d469c50 Giuseppe Scrivano)
+ o Clean up properly when adding a signal handler fails. (b84b598 Gilad Benjamini) o Ensure that evdns_request is a persistent handle. (15bb82d Christopher Davis)
+ o Free search state when finished searching to avoid an infinite loop. (a625840 Christopher Davis)
+ o Assert for valid requests as necessary. (67072f3 Christopher Davis)
+ o do not leak the request object on persistent connections (9d8edf2)
+ o Make evdns logging threadsafe (b1c7950)
+ o Fix a couple of bugs in the BSD sysctl arc4seed logic (a47a4b7)
+ o Remove one last bug in last_with_datap logic. Found with valgrind (d49b92a)
+ o fix a leak when unpausing evrpc requests (94ee125)
+ o Fix a memory leak when unmarshalling RPC object arrays (f6ab2a2)
+ o Fix compilation when openssl support is disabled (40c301b)
+ o Allow empty reason line in HTTP status (739e688 Pierre Phaneuf)
+ o Fix a compile warning introduced in 739e688 (bd1ed5f Sebastian Hahn)
+ o Fix nonstandard TAILQ_FOREACH_REVERSE() definition (71afc52 Frank Denis)
+ o Try /proc on Linux as entropy fallback; use sysctl as last resort (20fda29)
+ o Fix symbol conflict between mm_*() macros and libmm (99e50e9)
+ o Fix some crazy macro mistakes in arc4random.c (90d4225)
+ o Make evbuffer_add_file() work on windows (dcdae6b)
+ o Fix unused-variable warning when building with threads disabled (ad811cd)
+ o Numerous opensolaris compilation fixes (c44de06)
+ o Fix getaddrinfo with protocol unset on Solaris 9. Found by Dagobert Michelsen (2cf2a28)
+ o Fix another nasty solaris getaddrinfo() behavior (3557071)
+ o Define _REENTRANT as needed on Solaris, elsewhere (c1cd32a)
+ o Fix some autoconf issues on OpenBSD (7c519df)
+
+BUILD AND DISTRIBUTION CHANGES
+ o Distribute libevent.pc.in, not libevent.pc (22aff04)
+ o Avoid errors in evutil.c when building with _UNICODE defined (b677032 Brodie Thiesfield)
+ o Avoid errors in http.c when building with VC 2003 .NET (13e4f3b Brodie Thiesfield)
+ o Support the standard 'make check' target in place of 'make verify' (426c8fb)
+ o Remove redundant stuff from EXTRA_DIST (b660edf)
+ o Switch to using AM conditionals in place of AC_LIBOBJ (2e898f5)
+ o Remove an orphaned RELEASE flag in Makefile.am (0794b0d)
+ o Give a better warning for bad automake versions. (77c917d)
+ o Use dist_bin_SCRIPTS, not EXTRA_DIST, to distribute scripts (9eb2fd7)
+ o Never test for select() on windows (3eb044d Trond Norbye)
+ o Do not inhibit automake dependencies generation (10c4c90 Giuseppe Scrivano)
+ o Create shared libraries under Windows (3cbca86 Giuseppe Scrivano)
+ o Add ctags/etags files to .gitignore (0861d17)
+ o Only specify -no-undefined on mingw (25433b9)
+ o Only add libevent_core.la to LIBADD on mingw (fdc6297)
+
+TESTING
+ o Get bench_http to work on Windows; add a switch to enable IOCP. (4ac38a5 Christopher Davis)
+ o VC has no getopt(), so do without in bench_http. (1273d2f Christopher Davis)
+ o Fix an obnoxious typo in the bufferevent_timeout_filter test (0d047c3)
+ o Fix a write of uninitialized RAM in regression tests (68dc742)
+ o Fix some memory leaks in the unit tests (274a7bd)
+ o Make 'main/many_events' test 70 fds, not 64. (33874b0)
+ o Unit-test every evbuffer_add_file() implementation. (06a4443)
+ o Add more unit tests for evbuffer_expand (8c83e99)
+ o Test another case of evbuffer_prepend (1234b95)
+ o Fix a possible double-free bug in SSL bufferevents with CLOSE_ON_FREE (7501895) o Add dns/search_cancel unit test. (39b870b Christopher Davis)
+ o Make http_base_test stop leaking an event_base. (96730d3)
+ o Detect broken unsetenv at unit-test runtime (f37cd4c)
+ o Implement regress_make_tempfile on win32 to test evbuffer_add_file (b4f12a1)
+ o add more (currently skipped) add_file tests on win32 (05de45d)
+ o Fix bench_http build on win32. (384d124)
+ o Make unit test for add_file able to tell "error" from "done" (88a543f)
+ o Make test for bufferevent_connect_hostname system-neutral (f89168e)
+ o Make test.sh support mingw/msys on win32 (0ee6f6c)
+ o Fix test.sh on freebsd (3d9e05b)
+
+INTERNALS, PERFORMANCE, AND AND CODE CLEANUPS
+ o Improve the speed of evbuffer_readln() (cc1600a)
+ o more whitespace normalization (2c2618d)
+ o Revise evbuffer to add last_with_data (2a6d2a1)
+ o Use last_with_data in place of previous_to_last (c8ac57f)
+ o Remove previous_to_last from evbuffer (6f47bd1)
+ o Fix last_with_data compilation on windows (1e7b986)
+ o Add some glass-box tests for the last_with_data code. (17da042)
+ o Improve robustness for refcounting (f1bc125)
+ o Remove a needless min_heap_shift_up_() call (7204b91)
+ o Increase MIN_BUFFER_SIZE to 512 (1024 on 64-bit) (2014ae4)
+ o Do not use evbuffer_expand() to add the first chain to a buffer (5c0ebb3)
+ o Make evbuffer_prepend handle empty buffers better (c87272b)
+ o Replace last_with_data with a slightly smarter version (b7442f8)
+ o Turn the increasingly complex *_CHAIN() macros into functions (96865c4)
+ o Rewrite evbuffer_expand and its users (d5ebcf3)
+ o Add evutil_tv_to_msec for safe conversion of timevals to milliseconds. (850c3ff Christopher Davis)
+ o Initialize last_with_datap correctly in evbuffer_overlapped (a0983b6)
+ o Replace EVUTIL_CLOSESOCKET macro with a function (899c1dc Sebastian Sjöberg)
+ o Move domain search state to evdns_request. (beaa14a Christopher Davis)
+ o Remove redundant checks for lock!=NULL before calling EVLOCK_LOCK (50ec59f)
+ o Rename current_base symbol to event_global_current_base_ (c16e684)
+ o Fix whitespace in evutil.c (935e150)
+ o Replace users of "int fd" with "evutil_socket_t fd" in portable code (c7cf6f0)
+
+
+
+Changes in 2.0.4-alpha (28 Feb 2010):
+ [Autogenerated from the Git log, sorted by hand.]
+DOCUMENTATION
+ o Add stub header for 2.0.4-alpha changelog. (94d0065)
+ o Improve the README with more information and links. (0b42726)
+ o Add more people who wrote patches to the acknowledgments (0af10d5)
+ o Add a warning about the use of event_initialized. (f32b575)
+ o Add a LICENSE file so people can find our license easily (7067006)
+ o Add a new "hello world" sample program (becb9f9)
+ o Clarify status of example programs (d60a1bd)
+ o Update time-test.c to use event2 (f4190bf)
+ o Add the arc4random.c license to the LICENSE file. (e15e1e9)
+
+NEW FEATURES AND INTERFACE CHANGES
+ o Improved optional lock debugging. (0cd3bb9)
+ o Rate-limiting for bufferevents; group and individual limits are supported. (737c9cd)
+ o Testing code for bufferevent rate-limiting. (f0c0124)
+ o Make the initial nameserver probe timeout configurable. (1e56a32)
+ o Revise the locking API: deprecate the old locking callbacks and add trylock. (347952f)
+ o Do not make bufferevent_setfd implicitly disable EV_READ and EV_WRITE. (8274379)
+ o Do not ignore bufferevent_enable(EV_READ) before bufferevent_connect(). (4a5b534)
+ o Introduced evutil_make_socket_closeonexec() to preserve fd flags for F_SETFD. (d0939d2 Jardel Weyrich)
+ o evdns_getaddrinfo() now supports the /etc/hosts file. (72dd666)
+ o Look at the proper /etc/hosts file on windows. (66c02c7)
+ o Allow http connections to use evdns for hostname looksups. (c698b77)
+ o Changelist code to defer event changes until just before dispatch (27308aa)
+ o do not use a function to assign the evdns base; instead assign it via evhttp_connection_base_new() which is a new function introduced in 2.0 (5032e52)
+ o Functions to access more fields of struct event. (0683950)
+ o Make kqueue use changelists. (45e5ae3)
+ o Remove kqueue->pend_changes. (3225dfb)
+ o Minimize epoll_ctl calls by using changelist (c8c6a89)
+ o Add support for a "debug mode" to try to catch common errors. (cd17c3a)
+ o Note a missing ratelim function (361da8f)
+ o Add ev_[u]intptr_t to include/event2/util.h (1fa4c81)
+ o const-ify a few more functions in event.h (d38a7a1)
+ o Deprecate EVENT_FD and EVENT_SIGNAL. (f6b2694)
+ o Remove EVUTIL_CHECK_FMT. (6c21c89)
+ o Add EV_*_MAX macros to event2/util.h to expose limits for ev_* types. (aba1fff) o Functions to view and manipulate rate-limiting buckets. (85047a6)
+ o Add the rest of the integer limits, and add a test for them. (60742d5)
+ o Remove the 'flags' argument from evdns_base_set_option() (1dd7e6d)
+ o Add an arc4random implementation for use by evdns (d4de062)
+ o Use off_t for the length parameter of evbuffer_add_file (3fe60fd)
+ o Construct Windows locks using InitializeCriticalSectionAndSpinCount (32c6f1b)
+ o Expose view of current rate limit as constrained by group limit (162ce8a)
+ o Provide consistent, tested semantics for bufferevent timeouts (d328829)
+
+BUGFIXES AND TESTS
+ o Tolerate code that returns from a fatal_cb. (91fe23f)
+ o Parenthesize macro arguments more aggressively (07e9e9b)
+ o Fix memory-leak of signal handler array with kqueue. (e1ffbb8)
+ o Stop passing EVTHREAD_READ and EVTHREAD_WRITE to non-rw locks. (76cd2b7)
+ o Fix two use-after-free bugs in unit tests spoted by lock debugging (d84d838)
+ o Fix a locking bug in event_base_loop() (da1718b)
+ o Fix an evdns lock violation. (2df1f82 Zhuang Yuyao)
+ o Valgrind fix: Clear struct kevent before checking for OSX bug. (56771a3 William Ahern)
+ o Fix up evthread compilation on windows (bd6f1ba Roman Puls)
+ o Fix regress_iocp.c usage of old lock allocation macros. (31687b4 unknown)
+ o Update nmake makefile to build evthread.c (b62d979 unknown)
+ o Fix a crash when reading badly formatted resolve.conf; from Yasuoka Masahiko (6c7c579 Yasuoka Masahiko)
+ o Fix a snow leopard compile warning in the unit tests. (7ae9445)
+ o Fix compile on Snow Leopard with gcc warnings enabled (70cdfe4 Sebastian Hahn)
+ o Only define _GNU_SOURCE if it is not already defined. (ea6b1df Joachim Bauch)
+ o Update sample/signal-test.c to use newer APIs and not leak. (f6430ac Evan Jones)
+ o Fix a segfault when writing a very fragmented evbuffer onto an SSL (a6adeca Joachim Bauch)
+ o Fix a segfault when freeing SSL bufferevents in an unusual order (a773df5 Joachim Bauch)
+ o Drop install-sh from our git repo: a mismatched version could break "make dist" (6799527)
+ o Set all instances of the version number correctly. (5a112d3)
+ o Fix a few locking issues on windows. (c51bb3c unknown)
+ o Use evutil_socket_t, not int, when logging socket errors. (292467c)
+ o Fix up behavior of never-defered callbacks a little (390e056)
+ o Replace some cases of uint32_t with ev_uint32_t. (a47d88d)
+ o Fix compilation of devpoll.c by adding missing thread includes. (fee2c77 Dagobert Michelsen)
+ o Make evutil_make_socket_nonblocking() leave any other flags alone. (4c8b7cd Jardel Weyrich)
+ o Fix an fd leak in evconnlistener_new_bind(). (24fb502 Jardel Weyrich)
+ o Fix a bogus free in evutil_new_addrinfo() (0d64051 Jardel Weyrich)
+ o Adjusted fcntl() retval comparison on evutil_make_socket_nonblocking(). (4df7dbc Jardel Weyrich)
+ o Fix the code that allowed DNS options to not end with : (ee4953f)
+ o Fix crash bugs when a bufferevent's eventcb is not set. (2e8eeea)
+ o Fix test-ratelim compilation on Linux. (885b427)
+ o Fix compilation of rate-limiting code on win32. (165d30e)
+ o Eradicated the last free() call. Let mm_free() take care of deallocation. (0546ce1 Jardel Weyrich)
+ o Fix byte counts when mixing deferred and non-deferred evbuffer callbacks. (29151e6)
+ o Fixed a memory leak on windows threads implementation. The CRITICAL_SECTION was not being free'd in evthread_win32_lock_free(). (2f33e00 Jardel Weyrich)
+ o Fixed a fd leak in start_accepting(), plus cosmetic changes (4367a33 Jardel Weyrich)
+ o Improved error handling in evconnlistener_new_async(). Also keeping the fd open because it is not opened by this function, so the caller is responsible for closing it. Additionally, since evconnlistener_new_bind() creates a socket and passes it to the function above, it required error checking to close the same socket. (fec66f9 Jardel Weyrich)
+ o Don't use a bind address for nameservers on loopback (8d4aaf9)
+ o Fix compilation of rate-limit code when threading support is disabled (97a8c79)
+ o Detect setenv/unsetenv; skip main/base_environ test if we can't fake them. (7296971)
+ o Check more internal event_add() calls for failure (ff3f6cd)
+ o Fix windows and msvc build (5c7a7bc)
+ o Call event_debug_unassign on internal events (a19b4a0)
+ o Try to fix a warning in hash_debug_entry (137f2c6)
+ o Fix a dumb typo in ev_intptr_t definitions. (27c9a40)
+ o do not fail while sending on http connections the client closed. (93d7369)
+ o make evhttp_send() safe against terminated connections, too (3978180)
+ o Make Libevent 1.4.12 build on win32 with Unicode enabled. (000a33e Brodie Thiesfield)
+ o Fix some additional -DUNICODE issues on win32. (a7a9431)
+ o Add a check to make soure our EVUTIL_AI flags do not conflict with the native ones (c18490e)
+ o Always use our own gai_strerror() replacement. (6810bdb)
+ o Make RNG work when we have arc4random() but not arc4random_buf() (4ec8fea)
+ o validate close cb on server when client connection closes (2f782af)
+ o Fix two unlocked reads in evbuffer. (7116bf2)
+ o When working without a current event base, don't try to use IOCP listeners (cb52838)
+ o Fix getpid() usage on Windows (ff2a134)
+ o Add a unit test for secure rng. (48a29b6)
+ o Add some headers to fix freebsd compilation (b72be50)
+ o When connect() succeeds immediately, don't invoke the callback immediately. (7515de9)
+ o Suspend read/write on bufferevents during hostname lookup (db08f64)
+ o Make bufferevent_free() clear all callbacks immediately. (b2fbeb3)
+ o Fix some race conditions in persistent events and event_reinit (e2642f0)
+ o Fix a bug in resetting timeouts on persistent events when IO triggers. (38ec0a7)
+ o Add a test for timeouts on filtering bufferevents. (c02bfe1)
+ o Add test for periodic timers that get activated for other reasons (8fcb7a1)
+ o Use new timeval diff comparison function in bufferevent test (f3dfe46)
+ o Delete stack-alloced event in new unit test before returning. (7ffd387)
+ o Fix mingw compilation (23170a6)
+ o Try to define a sane _EVENT_SIZEOF_SIZE_T for msvc compilation (1e14f82)
+ o Fix arc4random compilation on MSVC. (98edb89)
+ o deal with connect() failing immediately (7bc48bf)
+ o Small cleanups on freebsd-connect-refused patch. (57b7248)
+
+BUILD AND DISTRIBUTION CHANGES
+ o Remove the contents of WIN32-Prj as unmaintained. (c69d5a5)
+ o Allow the user to redirect the verbose output of test/test.sh to a file (c382de6)
+ o Allow test.sh to be run as ./test/test.sh (7dfbe94)
+ o Never believe that we have pthreads on win32, even if gcc thinks we do. (78ed097)
+ o Make it compile under gcc --std=c89. (e2ca403)
+ o Fix a number of warnings from gcc -pedantic (918e9c5)
+ o Add the msvc-generated .lib files to .gitignore. (e244a2e)
+ o Add the "compile" script to gitignore. (1ba6bed)
+
+INTERNALS AND CODE CLEANUPS
+ o Add a .gitignore file. (ba34071)
+ o New EVTHREAD_TRY_LOCK function to try to grab a lock. (689fc09)
+ o Add the abilitity to mark some buffer callbacks as never-deferred. (438f9ed)
+ o Refactor our 'suspend operation' logic on bufferevents. (0d744aa)
+ o Simplify the read high-watermark checking. (5846bf6)
+ o Improve readability of evutil_unparse_protoname() (5a43df8 Jardel Weyrich)
+ o Expose our cached gettimeofday value with a new interface (47854a8)
+ o Whitespace fixes in test.sh (0b151a9)
+ o Enable branch-prediction hints with EVUTIL_UNLIKELY. (eaaf27f)
+ o Refactor code from evdns into a new internal "read a file" function. (0f7144f)
+ o Comestic changes in evconnlistener_new(), new_accepting_socket(), accepted_socket_invoke_user_cb() and iocp_listener_enable(). (510ab6b Jardel Weyrich)
+ o Add unit-test for bad_request bug fixed in 1.4 recently. (6cc79c6 Pavel Plesov) o Add a comment on evthread_enable_lock_debuging. (b9f43b2)
+ o Fix test.sh on shells without echo -n (94131e9)
+ o More unit tests for getaddrinfo_async: v4timeout and cancel. (a334b31)
+ o Make http use evconnlistener. (ec34533)
+ o move dns utility functions into a separate file so that we can use them for http testing (b822639)
+ o add a test for evhttp_connection_base_new with a dns_base (26714ca)
+ o forgot to add void to test function (78a50fe)
+ o Add a forgotten header (changelist-internal.h) (4b9f307)
+ o Remove some commented-out code in evutil (26e1b6f)
+ o Remove a needless include of rpc_compat.h (70a4a3e)
+ o Use less memory for each entry in a hashtable (a66e947)
+ o Try to untangle the logic in server_port_flush(). (439aea0)
+ o Use ev_[u]intptr_t types in place of [u]intptr_t (cef61a2)
+ o Reduce windows header includes in our own headers. (da6135e)
+ o clean up terminate_chunked test (e8a9782)
+ o Increment the submicro version number. (63e868e)
+ o Update event-config.h version number to match configure.in (aae7db5)
+ o Clean up formatting: Disallow space-before-tab. (8fdf09c)
+ o Clean up formatting: use tabs, not 8-spaces, to indent. (e5bbd40)
+ o Clean up formatting: remove trailing spaces (e5cf987)
+ o Clean up formatting: function/keyword spacing consistency. (4faeaea)
+
+
+
+Changes in 2.0.3-alpha (20 Nov 2009):
+ o Add a new code to support SSL/TLS on bufferevents, using the OpenSSL library (where available).
+ o Fix a bug where we didn't allocate enough memory in event_get_supported_methods().
+ o Avoid segfault during failed allocation of locked evdns_base. (Found by Rocco Carbone.)
+ o Export new evutil_ascii_* functions to perform locale-independent character type operations.
+ o Try to compile better with MSVC: patches from Brodie Thiesfield
+ o New evconnlistener_get_fd function to expose a listener's associated socket.
+ o Expose an ev_socklen_t type for consistent use across platforms.
+ o Make bufferevent_socket_connect() work when the original fd was -1.
+ o Fix a bug in bufferevent_socket_connect() when the connection succeeds too quickly.
+ o Export an evutil_sockaddr_cmp() to compare to sockaddr objects for equality.
+ o Add a bufferevent_get_enabled() to tell what a bufferevent has been configured to do.
+ o Add an evbuffer_search_eol() function to locate the end of a line nondestructively.
+ o Add an evbuffer_search_range() function to search a bounded range of a buffer.
+ o Fix a rare crash bug in evdns.
+ o Have bufferevent_socket_connect() with no arguments put a bufferevent into connecting mode.
+ o Support sendfile on Solaris: patch from Caitlin Mercer.
+ o New functions to explicitly reference a socket used by an evhttp object. Patches from David Reiss.
+ o When we send a BEV_EVENT_CONNECTED to indicate connected status, we no longer invoke the write callback as well unless we actually wrote data too.
+ o If the kernel tells us that there are a negative number of bytes to read from a socket, do not believe it. Fixes bug 2841177; found by Alexander Pronchenkov.
+ o Do not detect whether we have monotonic clock support every time a new event base is created: instead do it only once. Patch taken from Chromium.
+ o Do not allocate the maximum event queue for the epoll backend at startup. Instead, start out accepting 32 events at a time, and double the queue's size when it seems that the OS is generating events faster than we're requesting them. Saves up to 374K per epoll-based event_base. Resolves bug 2839240.
+ o Treat an event with a negative fd as valid but untriggerable by Libevent. This is useful for applications that want to manually activate events.
+ o Fix compilation on Android, which forgot to define fd_mask in its sys/select.h
+ o Do not drop data from evbuffer when out of memory; reported by Jacek Masiulaniec
+ o New event_base_got_exit() and event_base_got_break() functions to tell whether an event loop exited because of an event_base_loopexit() or an event_base_loopbreak(). Patch from Ka-Hing Cheung.
+ o When adding or deleting an event from a non-main thread, only wake up the main thread when its behavior actually needs to change.
+ o Fix some bugs when using the old evdns interfaces to initialize the evdns module.
+ o Detect errors during bufferevent_connect(). Patch from Christopher Davis.
+ o Fix compilation for listener.h for C++ - missing extern "C". Patch from Ferenc Szalai.
+ o Make the event_base_loop() family of functions respect thread-safety better. This should clear up a few hard-to-debug race conditions.
+ o Fix a bug when using a specialized memory allocator on win32.
+ o Have the win32 select() backend label TCP-socket-connected events as EV_WRITE, not EV_READ. This should bring it in line with the other backends, and improve portability. Patch from Christopher Davis.
+ o Stop using enums as arguments or return values when what we mean is a bitfield of enum values. C++ doesn't believe that you can OR two enum values together and get another enum, and C++ takes its typing seriously. Patch from Christopher Davis.
+ o Add an API to replace all fatal calls to exit() with a user-provided panic function.
+ o Replace all assert() calls with a variant that is aware of the user-provided logging and panic functions.
+ o Add a return value to event_assign so that it can fail rather than asserting when the user gives it bad input. event_set still dies on bad input.
+ o The event_base_new() and event_base_new_with_config() functions now never call exit() on failure. For backward "compatibility", event_init() still does, but more consistently.
+ o Remove compat/sys/_time.h. It interfered with system headers on HPUX, and its functionality has been subsumed by event2/util.h and util-internal.h.
+ o Add a new bufferevent_socket_connect_hostname() to encapsulate the resolve-then-connect operation.
+ o Build kqueue.c correctly on GNU/kFreeBSD platforms. Patch pulled upstream from Debian.
+ o Alternative queue-based timeout algorithm for programs that use a large number of timeouts with the same value.
+ o New event_base_config option to disable the timeval cache entirely.
+ o Make EV_PERSIST timeouts more accurate: schedule the next event based on the scheduled time of the previous event, not based on the current time.
+ o Allow http.c to handle cases where getaddrinfo returns an IPv6 address. Patch from Ryan Phillips.
+ o Fix a problem with excessive memory allocation when using multiple event priorities.
+ o Default to using arc4random for DNS transaction IDs on systems that have it; from OpenBSD.
+ o Never check the environment when we're running setuid or setgid; from OpenBSD.
+ o Options passed to evdns_set_option() no longer need to end with a colon.
+ o Add an evutil_getaddrinfo() function to clone getaddrinfo on platforms that don't have it.
+ o Add an evdns_getaddrinfo() function to provide a nonblocking getaddrinfo using evdns, so programs can perform useful hostname lookup.
+ o Finally expose the IOCP-based bufferevent backend. It passes its unit tests, but probably still has some bugs remaining. Code by Nick Mathewson and Christopher Davis.
+ o Numerous other bugfixes.
+ o On FreeBSD and other OSes, connect can return ECONREFUSED immediately; instead of failing the function call, pretend with faileld in the callback.
+ o Fix a race condition in the pthreads test case; found by Nick Mathewson
+ o Remove most calls to event_err() in http and deal with memory errors instead
+
+
+
+Changes in 2.0.2-alpha (25 Jul 2009):
+ o Add a new flag to bufferevents to make all callbacks automatically deferred.
+ o Make evdns functionality locked, and automatically defer dns callbacks.
+ o Fix a possible free(NULL) when freeing an event_base with no signals.
+ o Add a flag to disable checking environment varibles when making an event_base
+ o Disallow setting less than 1 priority.
+ o Fix a bug when removing a timeout from the heap. [Patch from Marko Kreen]
+ o Use signal.h, not sys/signal.h. [Patch from mmadia]
+ o Try harder to build with certain older c99 compilers.
+ o Make sure that an event_config's flags field is always initialized to 0. [Bug report from Victor Goya]
+ o Avoid data corruption when reading data entirely into the second-to-last chain of an evbuffer. [Bug report from Victor Goya]
+ o Make sendfile work on FreeBSD
+ o Do not use vararg macros for accessing evrpc structures; this is not backwards compatible, but we did not promise any backwards compatibility for the rpc code.
+ o Actually define the event_config_set_flag() function.
+ o Try harder to compile with Visual C++.
+ o Move event_set() and its allies to event2/event_compat.h where they belong.
+ o Remove the event_gotsig code, which has long been deprecated and unused.
+ o Add an event_get_base() function to return the base assigned to an event.
+ o New function to automate connecting on a socket-based bufferevent.
+ o New functions to automate listening for incoming TCP connections.
+ o Do case-insensitive checks with a locale-independent comparison function.
+ o Rename the evbuffercb and everrorcb callbacks to bufferevent_data_cb and bufferevent_event_cb respectively. The old names are available in bufferevent_compat.h.
+ o Rename the EVBUFFER_* codes used by bufferevent event callbacks to BEV_EVENT_*, to avoid namespace collision with evbuffer flags. The old names are available in bufferevent_compat.h.
+ o Move the EVBUFFER_INPUT and EVBUFFER_OUTPUT macros to bufferevent_compat.h
+ o Add a bufferevent_getfd() function to mirror bufferevent_setfd()
+ o Make bufferevent_setfd() return an error code if the operation is not successful.
+ o Shave 22 bytes off struct event on 32-bit platforms by shrinking and re-ordering fields. The savings on 64-bit platforms is likely higher.
+ o Cap the maximum number of priorities at 256.
+ o Change the semantics of evbuffer_cb_set_flags() to be set-flag only; add a new evbuffer_cb_clear_flags() to remove set flags.
+ o Change the interface of evbuffer_add_reference so that the cleanup callback gets more information
+ o Revise the new evbuffer_reserve_space/evbuffer_commit_space() interfaces so that you can use them without causing extraneous copies or leaving gaps in the evbuffer.
+ o Add a new evbuffer_peek() interface to inspect data in an evbuffer without removing it.
+ o Fix a deadlock when suspending reads in a bufferevent due to a full buffer. (Spotted by Joachim Bauch.)
+ o Fix a memory error when freeing a thread-enabled event base with registered events. (Spotted by Joachim Bauch.)
+ o Try to contain degree of failure when running on a win32 version so heavily firewalled that we can't fake a socketpair.
+ o Activate fd events in a pseudorandom order with O(N) backends, so that we don't systematically favor low fds (select) or earlier-added fds (poll, win32).
+ o Replace some read()/write() instances with send()/recv() to work properly on win32.
+ o Set truncated flag correctly in evdns server replies.
+ o Raise RpcGenError in event_rpcgen.py; from jmanison and Zack Weinberg
+ o Fix preamble of rpcgen-generated files to rely on event2 includes; based on work by jmansion; patch from Zack Weinberg.
+ o Allow specifying the output filename for rpcgen; based on work by jmansion; patch from Zack Weinberg.
+ o Allow C identifiers as struct names; allow multiple comments in .rpc files; from Zack Weinberg
+ o Mitigate a race condition when using socket bufferevents in multiple threads.
+ o Use AC_SEARCH_LIBS, not AC_CHECK_LIB to avoid needless library use.
+ o Do not allow event_del(ev) to return while that event's callback is executing in another thread. This fixes a nasty race condition.
+ o event_get_supported_methods() now lists methods that have been disabled with the EVENT_NO* environment options.
+ o Rename encode_int[64] to evtag_encode_int[64] to avoid polluting the global namespace. The old method names are still available as macros in event2/tag_compat.h.
+
+
+
+Changes in 2.0.1-alpha (17 Apr 2009):
+ o free minheap on event_base_free(); from Christopher Layne
+ o debug cleanups in signal.c; from Christopher Layne
+ o provide event_base_new() that does not set the current_base global
+ o bufferevent_write now uses a const source argument; report from Charles Kerr
+ o improve documentation on event_base_loopexit; patch from Scott Lamb
+ o New function, event_{base_}loopbreak. Like event_loopexit, it makes an event loop stop executing and return. Unlike event_loopexit, it keeps subsequent pending events from getting executed. Patch from Scott Lamb
+ o Check return value of event_add in signal.c
+ o provide event_reinit() to reintialize an event_base after fork
+ o New function event_set_mem_functinons. It allows the user to give libevent replacement functions to use for memory management in place of malloc(), free(), etc. This should be generally useful for memory instrumentation, specialized allocators, and so on.
+ o The kqueue implementation now catches signals that are raised after event_add() is called but before the event_loop() call. This makes it match the other implementations.
+ o The kqueue implementation now restores original signal handlers correctly when its signal events are removed.
+ o Check return value of event_add in signal.c
+ o Add a more powerful evbuffer_readln as a replacement for evbuffer_readline. The new function handles more newline styles, and is more useful with buffers that may contain a nul characters.
+ o Do not mangle socket handles on 64-bit windows.
+ o The configure script now takes an --enable-gcc-warnigns option that turns on many optional gcc warnings. (Nick has been building with these for a while, but they might be useful to other developers.)
+ o move EV_PERSIST handling out of the event backends
+ o small improvements to evhttp documentation
+ o always generate Date and Content-Length headers for HTTP/1.1 replies
+ o set the correct event base for HTTP close events
+ o When building with GCC, use the "format" attribute to verify type correctness of calls to printf-like functions.
+ o Rewrite win32.c backend to be O(n lg n) rather than O(n^2).
+ o Removed obsoleted recalc code
+ o support for 32-bit tag numbers in rpc structures; this is wire compatible, but changes the API slightly.
+ o pull setters/getters out of RPC structures into a base class to which we just need to store a pointer; this reduces the memory footprint of these structures.
+ o prefix {encode,decode}_tag functions with evtag to avoid collisions
+ o fix a bug with event_rpcgen for integers
+ o Correctly handle DNS replies with no answers set (Fixes bug 1846282)
+ o add -Wstrict-aliasing to warnings and more cleanup
+ o removed linger from http server socket; reported by Ilya Martynov
+ o event_rpcgen now allows creating integer arrays
+ o support string arrays in event_rpcgen
+ o change evrpc hooking to allow pausing of RPCs; this will make it possible for the hook to do some meaning ful work; this is not backwards compatible.
+ o allow an http request callback to take ownership of a request structure
+ o allow association of meta data with RPC requests for hook processing
+ o associate more context for hooks to query such as the connection object
+ o remove pending timeouts on event_base_free()
+ o also check EAGAIN for Solaris' event ports; from W.C.A. Wijngaards
+ o devpoll and evport need reinit; tested by W.C.A Wijngaards
+ o event_base_get_method; from Springande Ulv
+ o Send CRLF after each chunk in HTTP output, for compliance with RFC2626. Patch from "propanbutan". Fixes bug 1894184.
+ o Add a int64_t parsing function, with unit tests, so we can apply Scott Lamb's fix to allow large HTTP values.
+ o Use a 64-bit field to hold HTTP content-lengths. Patch from Scott Lamb.
+ o Allow regression code to build even without Python installed
+ o remove NDEBUG ifdefs from evdns.c
+ o detect integer types properly on platforms without stdint.h
+ o udpate documentation of event_loop and event_base_loop; from Tani Hosokawa.
+ o simplify evbuffer by removing orig_buffer
+ o do not insert event into list when evsel->add fails
+ o add support for PUT/DELETE requests; from Josh Rotenberg
+ o introduce evhttp_accept_socket() to accept from an already created socket
+ o include Content-Length in reply for HTTP/1.0 requests with keep-alive
+ o increase listen queue for http sockets to 128; if that is not enough the evhttp_accpet_socket() api can be used with a prepared socket.
+ o Patch from Tani Hosokawa: make some functions in http.c threadsafe.
+ o test support for PUT/DELETE requests; from Josh Rotenberg
+ o rewrite of the evbuffer code to reduce memory copies
+ o Some older Solaris versions demand that _REENTRANT be defined to get strtok_r(); do so.
+ o Do not free the kqop file descriptor in other processes, also allow it to be 0; from Andrei Nigmatulin
+ o Provide OpenSSL style support for multiple threads accessing the same event_base
+ o make event_rpcgen.py generate code include event-config.h; reported by Sam Banks.
+ o switch thread support so that locks get allocated as they are needed.
+ o make event methods static so that they are not exported; from Andrei Nigmatulin
+ o make RPC replies use application/octet-stream as mime type
+ o do not delete uninitialized timeout event in evdns
+ o Correct the documentation on buffer printf functions.
+ o Don't warn on unimplemented epoll_create(): this isn't a problem, just a reason to fall back to poll or select.
+ o Correctly handle timeouts larger than 35 minutes on Linux with epoll.c. This is probably a kernel defect, but we'll have to support old kernels anyway even if it gets fixed.
+ o Make name_from_addr() threadsafe in http.c
+ o Add new thread-safe interfaces to evdns functions.
+ o Make all event_tagging interfaces threadsafe.
+ o Rename internal memory management functions.
+ o New functions (event_assign, event_new, event_free) for use by apps that want to be safely threadsafe, or want to remain ignorant of the contents of struct event.
+ o introduce bufferevent_read_buffer; allows reading without memory copy.
+ o expose bufferevent_setwatermark via header files and fix high watermark on read
+ o fix a bug in buffrevent read water marks and add a test for them
+ o fix a bug in which bufferevent_write_buffer would not schedule a write event
+ o provide bufferevent_input and bufferevent_output without requiring knowledge of the structure
+ o introduce bufferevent_setcb and bufferevent_setfd to allow better manipulation of bufferevents
+ o convert evhttp_connection to use bufferevents.
+ o use libevent's internal timercmp on all platforms, to avoid bugs on old platforms where timercmp(a,b,<=) is buggy.
+ o Remove the never-exported, never-used evhttp_hostportfile function.
+ o Support input/output filters for bufferevents; somewhat similar to libio's model. This will allow us to implement SSL, compression, etc, transparently to users of bufferevents such as the http layer.
+ o allow connections to be removed from an rpc pool
+ o add new evtimer_assign, signal_assign, evtimer_new, and signal_new functions to manipulate timer and signal events, analagous to the now-recommended event_assign and event_new
+ o switch internal uses of event_set over to use event_assign.
+ o introduce evbuffer_contiguous_space() api that tells a user how much data is available in the first buffer chain
+ o introduce evbuffer_reserve_space() and evbuffer_commit_space() to make processing in filters more efficient.
+ o reduce system calls for getting current time by caching it.
+ o separate signal events from io events; making the code less complex.
+ o support for periodic timeouts
+ o support for virtual HTTP hosts.
+ o turn event_initialized() into a function, and add function equivalents to EVENT_SIGNAL and EVENT_FD so that people don't need to include event_struct.h
+ o Build test directory correctly with CPPFLAGS set.
+ o Provide an API for retrieving the supported event mechanisms.
+ o event_base_new_with_config() and corresponding config APIs.
+ o migrate the evhttp header to event2/ but accessors are still missing.
+ o deprecate timeout_* event functions by moving them to event_compat.h
+ o Move windows gettimeofday replacement into a new evutil_gettimeofday().
+ o Make configure script work on IRIX.
+ o provide a method for canceling ongoing http requests.
+ o Make vsnprintf() returns consistent on win32.
+ o Fix connection keep-alive behavior for HTTP/1.0
+ o Fix use of freed memory in event_reinit; pointed out by Peter Postma
+ o constify struct timeval * where possible
+ o make event_get_supported_methods obey environment variables
+ o support for edge-triggered events on epoll and kqueue backends: patch from Valery Kholodkov
+ o support for selecting event backends by their features, and for querying the features of a backend.
+ o change failing behavior of event_base_new_with_config: if a config is provided and no backend is selected, return NULL instead of aborting.
+ o deliver partial data to request callbacks when chunked callback is set even if there is no chunking on the http level; allows cancelation of requests from within the chunked callback; from Scott Lamb.
+ o allow min_heap_erase to be called on removed members; from liusifan.
+ o Rename INPUT and OUTPUT to EVRPC_INPUT and EVRPC_OUTPUT. Retain INPUT/OUTPUT aliases on on-win32 platforms for backwards compatibility.
+ o Do not use SO_REUSEADDR when connecting
+ o Support 64-bit integers in RPC structs
+ o Correct handling of trailing headers in chunked replies; from Scott Lamb.
+ o Support multi-line HTTP headers; based on a patch from Moshe Litvin
+ o Reject negative Content-Length headers; anonymous bug report
+ o Detect CLOCK_MONOTONIC at runtime for evdns; anonymous bug report
+ o Various HTTP correctness fixes from Scott Lamb
+ o Fix a bug where deleting signals with the kqueue backend would cause subsequent adds to fail
+ o Support multiple events listening on the same signal; make signals regular events that go on the same event queue; problem report by Alexander Drozdov.
+ o Fix a problem with epoll() and reinit; problem report by Alexander Drozdov.
+ o Fix off-by-one errors in devpoll; from Ian Bell
+ o Make event_add not change any state if it fails; reported by Ian Bell.
+ o Fix a bug where headers arriving in multiple packets were not parsed; fix from Jiang Hong; test by me.
+ o Match the query in DNS replies to the query in the request; from Vsevolod Stakhov.
+ o Add new utility functions to correctly observe and log winsock errors.
+ o Do not remove Accept-Encoding header
+ o Clear the timer cache on entering the event loop; reported by Victor Chang
+ o Only bind the socket on connect when a local address has been provided; reported by Alejo Sanchez
+ o Allow setting of local port for evhttp connections to support millions of connections from a single system; from Richard Jones.
+ o Clear the timer cache when leaving the event loop; reported by Robin Haberkorn
+ o Fix a typo in setting the global event base; reported by lance.
+ o Set the 0x20 bit on outgoing alphabetic characters in DNS requests randomly, and insist on a match in replies. This helps resist DNS poisoning attacks.
+ o Make the http connection close detection work properly with bufferevents and fix a potential memory leak associated with it.
+ o Restructure the event backends so that they do not need to keep track of events themselves, as a side effect multiple events can use the same fd or signal.
+ o Add generic implementations for parsing and emiting IPv6 addresses on platforms that do not have inet_ntop and/or inet_pton.
+ o Allow DNS servers that have IPv6 addresses.
+ o Add an evbuffer_write_atmost() function to write a limited number of bytes to an fd.
+ o Refactor internal notify-main-thread logic to prefer eventfd to pipe, then pipe to socketpair, and only use socketpairs as a last resort.
+ o Try harder to pack all evbuffer reads into as few chains as possible, using readv/WSARecv as appropriate.
+ o New evthread_use_windows_threads() and evthread_use_pthreads() functions to set up the evthread callbacks with reasonable defaults.
+ o Change the semantics of timeouts in conjunction with EV_PERSIST; timeouts in that case will now repeat until deleted.
+ o sendfile, mmap and memory reference support for evbuffers.
+ o New evutil_make_listen_socket_reuseable() to abstract SO_REUSEADDR.
+ o New bind-to option to allow DNS clients to bind to an arbitrary port for outgoing requests.
+ o evbuffers can now be "frozen" to prevent operations at one or both ends.
+ o Bufferevents now notice external attempts to add data to an inbuf or remove it from an outbuf, and stop them.
+ o Fix parsing of queries where the encoded queries contained \r, \n or +
+ o Do not allow internal events to starve lower-priority events.
+
diff --git a/protocols/Telegram/tgl/libevent/Doxyfile b/protocols/Telegram/tgl/libevent/Doxyfile
new file mode 100644
index 0000000000..d9d6603459
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/Doxyfile
@@ -0,0 +1,257 @@
+# Doxyfile 1.5.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = libevent
+
+# Place all output under 'doxygen/'
+
+OUTPUT_DIRECTORY = doxygen/
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like the Qt-style comments (thus requiring an
+# explicit @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF = YES
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH = include/
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = \
+ include/event2/buffer.h \
+ include/event2/buffer_compat.h \
+ include/event2/bufferevent.h \
+ include/event2/bufferevent_compat.h \
+ include/event2/bufferevent_ssl.h \
+ include/event2/dns.h \
+ include/event2/dns_compat.h \
+ include/event2/event.h \
+ include/event2/event_compat.h \
+ include/event2/http.h \
+ include/event2/http_compat.h \
+ include/event2/listener.h \
+ include/event2/rpc.h \
+ include/event2/rpc_compat.h \
+ include/event2/tag.h \
+ include/event2/tag_compat.h \
+ include/event2/thread.h \
+ include/event2/util.h
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = YES
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = TAILQ_ENTRY RB_ENTRY EVENT_DEFINED_TQENTRY_ EVENT_IN_DOXYGEN_
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
diff --git a/protocols/Telegram/tgl/libevent/LICENSE b/protocols/Telegram/tgl/libevent/LICENSE
new file mode 100644
index 0000000000..402ca50896
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/LICENSE
@@ -0,0 +1,99 @@
+Libevent is available for use under the following license, commonly known
+as the 3-clause (or "modified") BSD license:
+
+==============================
+Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+
+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.
+==============================
+
+Portions of Libevent are based on works by others, also made available by
+them under the three-clause BSD license above. The copyright notices are
+available in the corresponding source files; the license is as above. Here's
+a list:
+
+log.c:
+ Copyright (c) 2000 Dug Song <dugsong@monkey.org>
+ Copyright (c) 1993 The Regents of the University of California.
+
+strlcpy.c:
+ Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
+
+win32select.c:
+ Copyright (c) 2003 Michael A. Davis <mike@datanerds.net>
+
+evport.c:
+ Copyright (c) 2007 Sun Microsystems
+
+ht-internal.h:
+ Copyright (c) 2002 Christopher Clark
+
+minheap-internal.h:
+ Copyright (c) 2006 Maxim Yegorushkin <maxim.yegorushkin@gmail.com>
+
+==============================
+
+The arc4module is available under the following, sometimes called the
+"OpenBSD" license:
+
+ Copyright (c) 1996, David Mazieres <dm@uun.org>
+ Copyright (c) 2008, Damien Miller <djm@openbsd.org>
+
+ Permission to use, copy, modify, and distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+==============================
+
+The Windows timer code is based on code from libutp, which is
+distributed under this license, sometimes called the "MIT" license.
+
+
+Copyright (c) 2010 BitTorrent, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/protocols/Telegram/tgl/libevent/Makefile.am b/protocols/Telegram/tgl/libevent/Makefile.am
new file mode 100644
index 0000000000..3053cc016a
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/Makefile.am
@@ -0,0 +1,303 @@
+# Makefile.am for libevent
+# Copyright 2000-2007 Niels Provos
+# Copyright 2007-2012 Niels Provos and Nick Mathewson
+#
+# See LICENSE for copying information.
+
+# 'foreign' means that we're not enforcing GNU package rules strictly.
+# '1.9' means that we need automake 1.9 or later (and we do).
+AUTOMAKE_OPTIONS = foreign 1.9 subdir-objects
+
+ACLOCAL_AMFLAGS = -I m4
+
+# This is the "Release" of the Libevent ABI. It takes precedence over
+# the VERSION_INFO, so that two versions of Libevent with the same
+# "Release" are never binary-compatible.
+#
+# This number incremented once for the 2.0 release candidate, and
+# will increment for each series until we revise our interfaces enough
+# that we can seriously expect ABI compatibility between series.
+#
+RELEASE = -release 2.1
+
+# This is the version info for the libevent binary API. It has three
+# numbers:
+# Current -- the number of the binary API that we're implementing
+# Revision -- which iteration of the implementation of the binary
+# API are we supplying?
+# Age -- How many previous binary API versions do we also
+# support?
+#
+# To increment a VERSION_INFO (current:revision:age):
+# If the ABI didn't change:
+# Return (current:revision+1:age)
+# If the ABI changed, but it's backward-compatible:
+# Return (current+1:0:age+1)
+# If the ABI changed and it isn't backward-compatible:
+# Return (current+1:0:0)
+#
+# Once an RC is out, DO NOT MAKE ANY ABI-BREAKING CHANGES IN THAT SERIES
+# UNLESS YOU REALLY REALLY HAVE TO.
+VERSION_INFO = 5:0:0
+
+# History: RELEASE VERSION_INFO
+# 2.0.1-alpha -- 2.0 1:0:0
+# 2.0.2-alpha -- 2:0:0
+# 2.0.3-alpha -- 2:0:0 (should have incremented; didn't.)
+# 2.0.4-alpha -- 3:0:0
+# 2.0.5-beta -- 4:0:0
+# 2.0.6-rc -- 2.0 2:0:0
+# 2.0.7-rc -- 2.0 3:0:1
+# 2.0.8-rc -- 2.0 4:0:2
+# 2.0.9-rc -- 2.0 5:0:0 (ABI changed slightly)
+# 2.0.10-stable-- 2.0 5:1:0 (No ABI change)
+# 2.0.11-stable-- 2.0 6:0:1 (ABI changed, backward-compatible)
+# 2.0.12-stable-- 2.0 6:1:1 (No ABI change)
+# 2.0.13-stable-- 2.0 6:2:1 (No ABI change)
+# 2.0.14-stable-- 2.0 6:3:1 (No ABI change)
+# 2.0.15-stable-- 2.0 6:3:1 (Forgot to update :( )
+# 2.0.16-stable-- 2.0 6:4:1 (No ABI change)
+# 2.0.17-stable-- 2.0 6:5:1 (No ABI change)
+# 2.0.18-stable-- 2.0 6:6:1 (No ABI change)
+# 2.0.19-stable-- 2.0 6:7:1 (No ABI change)
+# 2.0.20-stable-- 2.0 6:8:1 (No ABI change)
+# 2.0.21-stable-- 2.0 6:9:1 (No ABI change)
+#
+# For Libevent 2.1:
+# 2.1.1-alpha -- 2.1 1:0:0
+# 2.1.2-alpha -- 2.1 1:0:0 (should have been 2:0:1)
+# 2.1.3-alpha -- 2.1 3:0:0 (ABI changed slightly)
+# 2.1.4-alpha -- 2.1 4:0:0 (ABI changed slightly)
+# 2.1.5-beta -- 2.1 5:0:0 (ABI changed slightly)
+
+# ABI version history for this package effectively restarts every time
+# we change RELEASE. Version 1.4.x had RELEASE of 1.4.
+#
+# Ideally, we would not be using RELEASE at all; instead we could just
+# use the VERSION_INFO field to label our backward-incompatible ABI
+# changes, and those would be few and far between. Unfortunately,
+# Libevent still exposes far too many volatile structures in its
+# headers, so we pretty much have to assume that most development
+# series will break ABI compatibility. For now, it's simplest just to
+# keep incrementing the RELEASE between series and resetting VERSION_INFO.
+#
+# Eventually, when we get to the point where the structures in the
+# headers are all non-changing (or not there at all!), we can shift to
+# a more normal worldview where backward-incompatible ABI changes are
+# nice and rare. For the next couple of years, though, 'struct event'
+# is user-visible, and so we can pretty much guarantee that release
+# series won't be binary-compatible.
+
+if INSTALL_LIBEVENT
+dist_bin_SCRIPTS = event_rpcgen.py
+endif
+
+pkgconfigdir=$(libdir)/pkgconfig
+LIBEVENT_PKGCONFIG=libevent.pc
+
+# These sources are conditionally added by configure.ac or conditionally
+# included from other files.
+PLATFORM_DEPENDENT_SRC = \
+ arc4random.c \
+ epoll_sub.c
+
+EXTRA_DIST = \
+ ChangeLog-1.4 \
+ ChangeLog-2.0 \
+ Doxyfile \
+ LICENSE \
+ Makefile.nmake test/Makefile.nmake \
+ autogen.sh \
+ event_rpcgen.py \
+ libevent.pc.in \
+ make-event-config.sed \
+ whatsnew-2.0.txt \
+ whatsnew-2.1.txt \
+ $(PLATFORM_DEPENDENT_SRC)
+
+LIBEVENT_LIBS_LA = libevent.la libevent_core.la libevent_extra.la
+if PTHREADS
+LIBEVENT_LIBS_LA += libevent_pthreads.la
+LIBEVENT_PKGCONFIG += libevent_pthreads.pc
+endif
+if OPENSSL
+LIBEVENT_LIBS_LA += libevent_openssl.la
+LIBEVENT_PKGCONFIG += libevent_openssl.pc
+endif
+
+if INSTALL_LIBEVENT
+lib_LTLIBRARIES = $(LIBEVENT_LIBS_LA)
+pkgconfig_DATA = $(LIBEVENT_PKGCONFIG)
+else
+noinst_LTLIBRARIES = $(LIBEVENT_LIBS_LA)
+endif
+
+EXTRA_SOURCE=
+noinst_HEADERS=
+noinst_PROGRAMS=
+EXTRA_PROGRAMS=
+CLEANFILES=
+DISTCLEANFILES=
+BUILT_SOURCES =
+include include/include.am
+include sample/include.am
+include test/include.am
+
+if BUILD_WIN32
+
+SYS_LIBS = -lws2_32 -lshell32 -ladvapi32
+SYS_SRC = win32select.c evthread_win32.c buffer_iocp.c event_iocp.c \
+ bufferevent_async.c
+SYS_INCLUDES = -IWIN32-Code -IWIN32-Code/nmake
+
+else
+
+SYS_LIBS =
+SYS_SRC =
+SYS_INCLUDES =
+
+endif
+
+if STRLCPY_IMPL
+SYS_SRC += strlcpy.c
+endif
+if SELECT_BACKEND
+SYS_SRC += select.c
+endif
+if POLL_BACKEND
+SYS_SRC += poll.c
+endif
+if DEVPOLL_BACKEND
+SYS_SRC += devpoll.c
+endif
+if KQUEUE_BACKEND
+SYS_SRC += kqueue.c
+endif
+if EPOLL_BACKEND
+SYS_SRC += epoll.c
+endif
+if EVPORT_BACKEND
+SYS_SRC += evport.c
+endif
+if SIGNAL_SUPPORT
+SYS_SRC += signal.c
+endif
+
+BUILT_SOURCES += include/event2/event-config.h
+
+include/event2/event-config.h: config.h make-event-config.sed
+ $(AM_V_GEN)test -d include/event2 || $(MKDIR_P) include/event2
+ $(AM_V_at)$(SED) -f $(srcdir)/make-event-config.sed < config.h > $@T
+ $(AM_V_at)mv -f $@T $@
+
+CORE_SRC = \
+ buffer.c \
+ bufferevent.c \
+ bufferevent_filter.c \
+ bufferevent_pair.c \
+ bufferevent_ratelim.c \
+ bufferevent_sock.c \
+ event.c \
+ evmap.c \
+ evthread.c \
+ evutil.c \
+ evutil_rand.c \
+ evutil_time.c \
+ listener.c \
+ log.c \
+ $(SYS_SRC)
+
+EXTRAS_SRC = \
+ evdns.c \
+ event_tagging.c \
+ evrpc.c \
+ http.c
+
+if BUILD_WITH_NO_UNDEFINED
+NO_UNDEFINED = -no-undefined
+MAYBE_CORE = libevent_core.la
+else
+NO_UNDEFINED =
+MAYBE_CORE =
+endif
+
+GENERIC_LDFLAGS = -version-info $(VERSION_INFO) $(RELEASE) $(NO_UNDEFINED)
+
+libevent_la_SOURCES = $(CORE_SRC) $(EXTRAS_SRC)
+libevent_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
+libevent_la_LDFLAGS = $(GENERIC_LDFLAGS)
+
+libevent_core_la_SOURCES = $(CORE_SRC)
+libevent_core_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
+libevent_core_la_LDFLAGS = $(GENERIC_LDFLAGS)
+
+if PTHREADS
+libevent_pthreads_la_SOURCES = evthread_pthread.c
+libevent_pthreads_la_LIBADD = $(MAYBE_CORE)
+libevent_pthreads_la_LDFLAGS = $(GENERIC_LDFLAGS)
+endif
+
+libevent_extra_la_SOURCES = $(EXTRAS_SRC)
+libevent_extra_la_LIBADD = $(MAYBE_CORE) $(SYS_LIBS)
+libevent_extra_la_LDFLAGS = $(GENERIC_LDFLAGS)
+
+if OPENSSL
+libevent_openssl_la_SOURCES = bufferevent_openssl.c
+libevent_openssl_la_LIBADD = $(MAYBE_CORE) $(OPENSSL_LIBS)
+libevent_openssl_la_LDFLAGS = $(GENERIC_LDFLAGS)
+libevent_openssl_la_CPPFLAGS = $(AM_CPPFLAGS) $(OPENSSL_INCS)
+endif
+
+noinst_HEADERS += \
+ WIN32-Code/nmake/evconfig-private.h \
+ WIN32-Code/nmake/event2/event-config.h \
+ WIN32-Code/tree.h \
+ bufferevent-internal.h \
+ changelist-internal.h \
+ compat/sys/queue.h \
+ defer-internal.h \
+ epolltable-internal.h \
+ evbuffer-internal.h \
+ evconfig-private.h \
+ event-internal.h \
+ evmap-internal.h \
+ evrpc-internal.h \
+ evsignal-internal.h \
+ evthread-internal.h \
+ ht-internal.h \
+ http-internal.h \
+ iocp-internal.h \
+ ipv6-internal.h \
+ kqueue-internal.h \
+ log-internal.h \
+ minheap-internal.h \
+ mm-internal.h \
+ ratelim-internal.h \
+ ratelim-internal.h \
+ strlcpy-internal.h \
+ time-internal.h \
+ util-internal.h
+
+EVENT1_HDRS = \
+ include/evdns.h \
+ include/event.h \
+ include/evhttp.h \
+ include/evrpc.h \
+ include/evutil.h
+
+if INSTALL_LIBEVENT
+include_HEADERS = $(EVENT1_HDRS)
+else
+noinst_HEADERS += $(EVENT1_HDRS)
+endif
+
+AM_CPPFLAGS = -I$(srcdir)/compat -I$(srcdir)/include -I./include $(SYS_INCLUDES)
+
+verify: check
+
+doxygen: FORCE
+ doxygen $(srcdir)/Doxyfile
+FORCE:
+
+DISTCLEANFILES += *~ libevent.pc ./include/event2/event-config.h
+
diff --git a/protocols/Telegram/tgl/libevent/Makefile.nmake b/protocols/Telegram/tgl/libevent/Makefile.nmake
new file mode 100644
index 0000000000..f27cd61949
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/Makefile.nmake
@@ -0,0 +1,82 @@
+# WATCH OUT! This makefile is a work in progress. -*- makefile -*-
+#
+# I'm not very knowledgeable about MSVC and nmake beyond their most basic
+# aspects. If anything here looks wrong to you, please let me know.
+
+# If OPENSSL_DIR is not set, builds without OpenSSL support. If you want
+# OpenSSL support, you can set the OPENSSL_DIR variable to where you
+# installed OpenSSL. This can be done in the environment:
+# set OPENSSL_DIR=c:\openssl
+# Or on the nmake command line:
+# nmake OPENSSL_DIR=C:\openssl -f Makefile.nmake
+# Or by uncommenting the following line here in the makefile...
+
+# OPENSSL_DIR=c:\openssl
+
+!IFDEF OPENSSL_DIR
+SSL_CFLAGS=/I$(OPENSSL_DIR)\include /DEVENT__HAVE_OPENSSL
+!ELSE
+SSL_CFLAGS=
+!ENDIF
+
+# Needed for correctness
+CFLAGS=/IWIN32-Code /IWIN32-Code/nmake /Iinclude /Icompat /DHAVE_CONFIG_H /I. $(SSL_CFLAGS)
+
+# For optimization and warnings
+CFLAGS=$(CFLAGS) /Ox /W3 /wd4996 /nologo
+
+# XXXX have a debug mode
+
+LIBFLAGS=/nologo
+
+CORE_OBJS=event.obj buffer.obj bufferevent.obj bufferevent_sock.obj \
+ bufferevent_pair.obj listener.obj evmap.obj log.obj evutil.obj \
+ strlcpy.obj signal.obj bufferevent_filter.obj evthread.obj \
+ bufferevent_ratelim.obj evutil_rand.obj evutil_time.obj
+WIN_OBJS=win32select.obj evthread_win32.obj buffer_iocp.obj \
+ event_iocp.obj bufferevent_async.obj
+EXTRA_OBJS=event_tagging.obj http.obj evdns.obj evrpc.obj
+
+!IFDEF OPENSSL_DIR
+SSL_OBJS=bufferevent_openssl.obj
+SSL_LIBS=libevent_openssl.lib
+!ELSE
+SSL_OBJS=
+SSL_LIBS=
+!ENDIF
+
+ALL_OBJS=$(CORE_OBJS) $(WIN_OBJS) $(EXTRA_OBJS) $(SSL_OBJS)
+STATIC_LIBS=libevent_core.lib libevent_extras.lib libevent.lib $(SSL_LIBS)
+
+
+all: static_libs tests
+
+static_libs: $(STATIC_LIBS)
+
+libevent_core.lib: $(CORE_OBJS) $(WIN_OBJS)
+ lib $(LIBFLAGS) $(CORE_OBJS) $(WIN_OBJS) /out:libevent_core.lib
+
+libevent_extras.lib: $(EXTRA_OBJS)
+ lib $(LIBFLAGS) $(EXTRA_OBJS) /out:libevent_extras.lib
+
+libevent.lib: $(CORE_OBJS) $(WIN_OBJS) $(EXTRA_OBJS)
+ lib $(LIBFLAGS) $(CORE_OBJS) $(EXTRA_OBJS) $(WIN_OBJS) /out:libevent.lib
+
+libevent_openssl.lib: $(SSL_OBJS)
+ lib $(LIBFLAGS) $(SSL_OBJS) /out:libevent_openssl.lib
+
+clean:
+ del $(ALL_OBJS)
+ del $(STATIC_LIBS)
+ cd test
+ $(MAKE) /F Makefile.nmake clean
+ cd ..
+
+tests:
+ cd test
+!IFDEF OPENSSL_DIR
+ $(MAKE) OPENSSL_DIR=$(OPENSSL_DIR) /F Makefile.nmake
+!ELSE
+ $(MAKE) /F Makefile.nmake
+!ENDIF
+ cd ..
diff --git a/protocols/Telegram/tgl/libevent/README.md b/protocols/Telegram/tgl/libevent/README.md
new file mode 100644
index 0000000000..fdd777ee8d
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/README.md
@@ -0,0 +1,397 @@
+<p align="center">
+ <img src="https://strcpy.net/libevent3.png" alt="libevent logo"/>
+</p>
+
+
+
+[![Appveyor Win32 Build Status](https://ci.appveyor.com/api/projects/status/github/libevent/libevent?branch=master&svg=true)](https://ci.appveyor.com/project/nmathewson/libevent)
+[![Travis Build Status](https://travis-ci.org/libevent/libevent.svg?branch=master)](https://travis-ci.org/libevent/libevent)
+
+
+
+# 0. BUILDING AND INSTALLATION (Briefly)
+
+## Autoconf
+
+ $ ./configure
+ $ make
+ $ make verify # (optional)
+ $ sudo make install
+
+## Cmake (General)
+
+
+The following Libevent specific Cmake variables ar as follows (the values being
+the default).
+
+```
+# Installation directory for executables
+EVENT_INSTALL_BIN_DIR:PATH=bin
+
+# Installation directory for CMake files
+EVENT_INSTALL_CMAKE_DIR:PATH=lib/cmake/libevent
+
+## Installation directory for header files
+EVENT_INSTALL_INCLUDE_DIR:PATH=include
+
+## Installation directory for libraries
+EVENT_INSTALL_LIB_DIR:PATH=lib
+
+## Define if libevent should be built with shared libraries instead of archives
+EVENT__BUILD_SHARED_LIBRARIES:BOOL=OFF
+
+# Enable running gcov to get a test coverage report (only works with
+# GCC/CLang). Make sure to enable -DCMAKE_BUILD_TYPE=Debug as well.
+EVENT__COVERAGE:BOOL=OFF
+
+# Defines if libevent should build without the benchmark exectuables
+EVENT__DISABLE_BENCHMARK:BOOL=OFF
+
+# Define if libevent should build without support for a debug mode
+EVENT__DISABLE_DEBUG_MODE:BOOL=OFF
+
+# Define if libevent should not allow replacing the mm functions
+EVENT__DISABLE_MM_REPLACEMENT:BOOL=OFF
+
+# Define if libevent should build without support for OpenSSL encrpytion
+EVENT__DISABLE_OPENSSL:BOOL=ON
+
+# Disable the regress tests
+EVENT__DISABLE_REGRESS:BOOL=OFF
+
+# Disable sample files
+EVENT__DISABLE_SAMPLES:BOOL=OFF
+
+# If tests should be compiled or not
+EVENT__DISABLE_TESTS:BOOL=OFF
+
+# Define if libevent should not be compiled with thread support
+EVENT__DISABLE_THREAD_SUPPORT:BOOL=OFF
+
+# Enables verbose debugging
+EVENT__ENABLE_VERBOSE_DEBUG:BOOL=OFF
+
+# When crosscompiling forces running a test program that verifies that Kqueue
+# works with pipes. Note that this requires you to manually run the test program
+# on the the cross compilation target to verify that it works. See cmake
+# documentation for try_run for more details
+EVENT__FORCE_KQUEUE_CHECK:BOOL=OFF
+
+# set EVENT_STAGE_VERSION
+EVENT__STAGE_VERSION:STRING=beta
+```
+
+__More variables can be found by running `cmake -LAH <sourcedir_path>`__
+
+
+## CMake (Windows)
+
+Install CMake: <http://www.cmake.org>
+
+
+ $ md build && cd build
+ $ cmake -G "Visual Studio 10" .. # Or whatever generator you want to use cmake --help for a list.
+ $ start libevent.sln
+
+## CMake (Unix)
+
+ $ mkdir build && cd build
+ $ cmake .. # Default to Unix Makefiles.
+ $ make
+ $ make verify # (optional)
+
+
+# 1. BUILDING AND INSTALLATION (In Depth)
+
+## Autoconf
+
+To build libevent, type
+
+ $ ./configure && make
+
+
+ (If you got libevent from the git repository, you will
+ first need to run the included "autogen.sh" script in order to
+ generate the configure script.)
+
+You can run the regression tests by running
+
+ $ make verify
+
+Install as root via
+
+ $ make install
+
+Before reporting any problems, please run the regression tests.
+
+To enable the low-level tracing build the library as:
+
+ $ CFLAGS=-DUSE_DEBUG ./configure [...]
+
+Standard configure flags should work. In particular, see:
+
+ --disable-shared Only build static libraries
+ --prefix Install all files relative to this directory.
+
+
+The configure script also supports the following flags:
+
+ --enable-gcc-warnings Enable extra compiler checking with GCC.
+ --disable-malloc-replacement
+ Don't let applications replace our memory
+ management functions
+ --disable-openssl Disable support for OpenSSL encryption.
+ --disable-thread-support Don't support multithreaded environments.
+
+## CMake (Windows)
+
+(Note that autoconf is currently the most mature and supported build
+enviroment for libevent; the cmake instructions here are new and
+experimental, though they _should_ be solid. We hope that cmake will
+still be supported in future versions of Libevent, and will try to
+make sure that happens.)
+
+First of all install <http://www.cmake.org>.
+
+To build libevent using Microsoft Visual studio open the "Visual Studio Command prompt" and type:
+
+```
+$ cd <libevent source dir>
+$ mkdir build && cd build
+$ cmake -G "Visual Studio 10" .. # Or whatever generator you want to use cmake --help for a list.
+$ start libevent.sln
+```
+
+In the above, the ".." refers to the dir containing the Libevent source code.
+You can build multiple versions (with different compile time settings) from the same source tree
+by creating other build directories.
+
+It is highly recommended to build "out of source" when using
+CMake instead of "in source" like the normal behaviour of autoconf for this reason.
+
+The "NMake Makefiles" CMake generator can be used to build entirely via the command line.
+
+To get a list of settings available for the project you can type:
+
+```
+$ cmake -LH ..
+```
+
+### GUI
+
+CMake also provides a GUI that lets you specify the source directory and output (binary) directory
+that the build should be placed in.
+
+### OpenSSL support
+
+To build Libevent with OpenSSL support you will need to have OpenSSL binaries available when building,
+these can be found here: <http://www.openssl.org/related/binaries.html>
+
+# 2. USEFUL LINKS:
+
+For the latest released version of Libevent, see the official website at
+<http://libevent.org/> .
+
+There's a pretty good work-in-progress manual up at
+ <http://www.wangafu.net/~nickm/libevent-book/> .
+
+For the latest development versions of Libevent, access our Git repository
+via
+
+```
+$ git clone https://github.com/libevent/libevent.git
+```
+
+You can browse the git repository online at:
+
+<https://github.com/libevent/Libevent>
+
+To report bugs, issues, or ask for new features:
+
+__Patches__: https://github.com/libevent/libevent/pulls
+> OK, those are not really _patches_ You fork, modify, and hit the "Create Pull Request" button.
+> You can still submit normal git patchs via the mailing list.
+
+__Bugs, Features [RFC], and Issus__: https://github.com/libevent/libevent/issues
+> Or you can do it via the mailing list.
+
+There's also a libevent-users mailing list for talking about Libevent
+use and development:
+
+<http://archives.seul.org/libevent/users/>
+
+# 3. ACKNOWLEDGMENTS
+
+The following people have helped with suggestions, ideas, code or
+fixing bugs:
+
+ * Samy Al Bahra
+ * Antony Antony
+ * Jacob Appelbaum
+ * Arno Bakker
+ * Weston Andros Adamson
+ * William Ahern
+ * Ivan Andropov
+ * Sergey Avseyev
+ * Avi Bab
+ * Joachim Bauch
+ * Andrey Belobrov
+ * Gilad Benjamini
+ * Stas Bekman
+ * Denis Bilenko
+ * Julien Blache
+ * Kevin Bowling
+ * Tomash Brechko
+ * Kelly Brock
+ * Ralph Castain
+ * Adrian Chadd
+ * Lawnstein Chan
+ * Shuo Chen
+ * Ka-Hing Cheung
+ * Andrew Cox
+ * Paul Croome
+ * George Danchev
+ * Andrew Danforth
+ * Ed Day
+ * Christopher Davis
+ * Mike Davis
+ * Frank Denis
+ * Antony Dovgal
+ * Mihai Draghicioiu
+ * Alexander Drozdov
+ * Mark Ellzey
+ * Shie Erlich
+ * Leonid Evdokimov
+ * Juan Pablo Fernandez
+ * Christophe Fillot
+ * Mike Frysinger
+ * Remi Gacogne
+ * Artem Germanov
+ * Alexander von Gernler
+ * Diego Giagio
+ * Artur Grabowski
+ * Diwaker Gupta
+ * Kuldeep Gupta
+ * Sebastian Hahn
+ * Dave Hart
+ * Greg Hazel
+ * Nicholas Heath
+ * Michael Herf
+ * Sebastian Hahn
+ * Savg He
+ * Mark Heily
+ * Maxime Henrion
+ * Michael Herf
+ * Greg Hewgill
+ * Andrew Hochhaus
+ * Aaron Hopkins
+ * Tani Hosokawa
+ * Jamie Iles
+ * Xiuqiang Jiang
+ * Claudio Jeker
+ * Evan Jones
+ * Marcin Juszkiewicz
+ * George Kadianakis
+ * Makoto Kato
+ * Phua Keat
+ * Azat Khuzhin
+ * Alexander Klauer
+ * Kevin Ko
+ * Brian Koehmstedt
+ * Marko Kreen
+ * Ondřej Kuzník
+ * Valery Kyholodov
+ * Ross Lagerwall
+ * Scott Lamb
+ * Christopher Layne
+ * Adam Langley
+ * Graham Leggett
+ * Volker Lendecke
+ * Philip Lewis
+ * Zhou Li
+ * David Libenzi
+ * Yan Lin
+ * Moshe Litvin
+ * Simon Liu
+ * Mitchell Livingston
+ * Hagne Mahre
+ * Lubomir Marinov
+ * Abilio Marques
+ * Nicolas Martyanoff
+ * Abel Mathew
+ * Nick Mathewson
+ * James Mansion
+ * Nicholas Marriott
+ * Andrey Matveev
+ * Caitlin Mercer
+ * Dagobert Michelsen
+ * Andrea Montefusco
+ * Mansour Moufid
+ * Mina Naguib
+ * Felix Nawothnig
+ * Trond Norbye
+ * Linus Nordberg
+ * Richard Nyberg
+ * Jon Oberheide
+ * John Ohl
+ * Phil Oleson
+ * Alexey Ozeritsky
+ * Dave Pacheco
+ * Derrick Pallas
+ * Tassilo von Parseval
+ * Catalin Patulea
+ * Patrick Pelletier
+ * Simon Perreault
+ * Dan Petro
+ * Pierre Phaneuf
+ * Amarin Phaosawasdi
+ * Ryan Phillips
+ * Dimitre Piskyulev
+ * Pavel Plesov
+ * Jon Poland
+ * Roman Puls
+ * Nate R
+ * Robert Ransom
+ * Balint Reczey
+ * Bert JW Regeer
+ * Nate Rosenblum
+ * Peter Rosin
+ * Maseeb Abdul Qadir
+ * Wang Qin
+ * Alex S
+ * Gyepi Sam
+ * Hanna Schroeter
+ * Ralf Schmitt
+ * Mike Smellie
+ * Steve Snyder
+ * Nir Soffer
+ * Dug Song
+ * Dongsheng Song
+ * Hannes Sowa
+ * Joakim Soderberg
+ * Joseph Spadavecchia
+ * Kevin Springborn
+ * Harlan Stenn
+ * Andrew Sweeney
+ * Ferenc Szalai
+ * Brodie Thiesfield
+ * Jason Toffaletti
+ * Brian Utterback
+ * Gisle Vanem
+ * Bas Verhoeven
+ * Constantine Verutin
+ * Colin Watt
+ * Zack Weinberg
+ * Jardel Weyrich
+ * Jay R. Wren
+ * Zack Weinberg
+ * Mobai Zhang
+ * Alejo
+ * Alex
+ * Taral
+ * propanbutan
+ * masksqwe
+ * mmadia
+ * yangacer
+
+If we have forgotten your name, please contact us.
diff --git a/protocols/Telegram/tgl/libevent/WIN32-Code/getopt.c b/protocols/Telegram/tgl/libevent/WIN32-Code/getopt.c
new file mode 100644
index 0000000000..0fcba5d915
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/WIN32-Code/getopt.c
@@ -0,0 +1,149 @@
+/* $NetBSD: getopt.c,v 1.16 1999/12/02 13:15:56 kleink Exp $ */
+
+/*
+ * Copyright (c) 1987, 1993, 1994, 1995
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if 0
+static char sccsid[] = "@(#)getopt.c 8.3 (Berkeley) 4/27/95";
+#endif
+
+#include <assert.h>
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+
+#define __P(x) x
+#define _DIAGASSERT(x) assert(x)
+
+#ifdef __weak_alias
+__weak_alias(getopt,_getopt);
+#endif
+
+
+int opterr = 1, /* if error message should be printed */
+ optind = 1, /* index into parent argv vector */
+ optopt, /* character checked for validity */
+ optreset; /* reset getopt */
+char *optarg; /* argument associated with option */
+
+static char * _progname __P((char *));
+int getopt_internal __P((int, char * const *, const char *));
+
+static char *
+_progname(nargv0)
+ char * nargv0;
+{
+ char * tmp;
+
+ _DIAGASSERT(nargv0 != NULL);
+
+ tmp = strrchr(nargv0, '/');
+ if (tmp)
+ tmp++;
+ else
+ tmp = nargv0;
+ return(tmp);
+}
+
+#define BADCH (int)'?'
+#define BADARG (int)':'
+#define EMSG ""
+
+/*
+ * getopt --
+ * Parse argc/argv argument vector.
+ */
+int
+getopt(nargc, nargv, ostr)
+ int nargc;
+ char * const nargv[];
+ const char *ostr;
+{
+ static char *__progname = 0;
+ static char *place = EMSG; /* option letter processing */
+ char *oli; /* option letter list index */
+ __progname = __progname?__progname:_progname(*nargv);
+
+ _DIAGASSERT(nargv != NULL);
+ _DIAGASSERT(ostr != NULL);
+
+ if (optreset || !*place) { /* update scanning pointer */
+ optreset = 0;
+ if (optind >= nargc || *(place = nargv[optind]) != '-') {
+ place = EMSG;
+ return (-1);
+ }
+ if (place[1] && *++place == '-' /* found "--" */
+ && place[1] == '\0') {
+ ++optind;
+ place = EMSG;
+ return (-1);
+ }
+ } /* option letter okay? */
+ if ((optopt = (int)*place++) == (int)':' ||
+ !(oli = strchr(ostr, optopt))) {
+ /*
+ * if the user didn't specify '-' as an option,
+ * assume it means -1.
+ */
+ if (optopt == (int)'-')
+ return (-1);
+ if (!*place)
+ ++optind;
+ if (opterr && *ostr != ':')
+ (void)fprintf(stderr,
+ "%s: illegal option -- %c\n", __progname, optopt);
+ return (BADCH);
+ }
+ if (*++oli != ':') { /* don't need argument */
+ optarg = NULL;
+ if (!*place)
+ ++optind;
+ }
+ else { /* need an argument */
+ if (*place) /* no white space */
+ optarg = place;
+ else if (nargc <= ++optind) { /* no arg */
+ place = EMSG;
+ if (*ostr == ':')
+ return (BADARG);
+ if (opterr)
+ (void)fprintf(stderr,
+ "%s: option requires an argument -- %c\n",
+ __progname, optopt);
+ return (BADCH);
+ }
+ else /* white space */
+ optarg = nargv[optind];
+ place = EMSG;
+ ++optind;
+ }
+ return (optopt); /* dump back option letter */
+}
+
diff --git a/protocols/Telegram/tgl/libevent/WIN32-Code/getopt.h b/protocols/Telegram/tgl/libevent/WIN32-Code/getopt.h
new file mode 100644
index 0000000000..796f455050
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/WIN32-Code/getopt.h
@@ -0,0 +1,33 @@
+#ifndef __GETOPT_H__
+#define __GETOPT_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int opterr; /* if error message should be printed */
+extern int optind; /* index into parent argv vector */
+extern int optopt; /* character checked for validity */
+extern int optreset; /* reset getopt */
+extern char *optarg; /* argument associated with option */
+
+struct option
+{
+ const char *name;
+ int has_arg;
+ int *flag;
+ int val;
+};
+
+#define no_argument 0
+#define required_argument 1
+#define optional_argument 2
+
+int getopt(int, char**, const char*);
+int getopt_long(int, char**, const char*, const struct option*, int*);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __GETOPT_H__ */
diff --git a/protocols/Telegram/tgl/libevent/WIN32-Code/getopt_long.c b/protocols/Telegram/tgl/libevent/WIN32-Code/getopt_long.c
new file mode 100644
index 0000000000..03f0c01a15
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/WIN32-Code/getopt_long.c
@@ -0,0 +1,233 @@
+
+/*
+ * Copyright (c) 1987, 1993, 1994, 1996
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <assert.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "getopt.h"
+
+extern int opterr; /* if error message should be printed */
+extern int optind; /* index into parent argv vector */
+extern int optopt; /* character checked for validity */
+extern int optreset; /* reset getopt */
+extern char *optarg; /* argument associated with option */
+
+#define __P(x) x
+#define _DIAGASSERT(x) assert(x)
+
+static char * __progname __P((char *));
+int getopt_internal __P((int, char * const *, const char *));
+
+static char *
+__progname(nargv0)
+ char * nargv0;
+{
+ char * tmp;
+
+ _DIAGASSERT(nargv0 != NULL);
+
+ tmp = strrchr(nargv0, '/');
+ if (tmp)
+ tmp++;
+ else
+ tmp = nargv0;
+ return(tmp);
+}
+
+#define BADCH (int)'?'
+#define BADARG (int)':'
+#define EMSG ""
+
+/*
+ * getopt --
+ * Parse argc/argv argument vector.
+ */
+int
+getopt_internal(nargc, nargv, ostr)
+ int nargc;
+ char * const *nargv;
+ const char *ostr;
+{
+ static char *place = EMSG; /* option letter processing */
+ char *oli; /* option letter list index */
+
+ _DIAGASSERT(nargv != NULL);
+ _DIAGASSERT(ostr != NULL);
+
+ if (optreset || !*place) { /* update scanning pointer */
+ optreset = 0;
+ if (optind >= nargc || *(place = nargv[optind]) != '-') {
+ place = EMSG;
+ return (-1);
+ }
+ if (place[1] && *++place == '-') { /* found "--" */
+ /* ++optind; */
+ place = EMSG;
+ return (-2);
+ }
+ } /* option letter okay? */
+ if ((optopt = (int)*place++) == (int)':' ||
+ !(oli = strchr(ostr, optopt))) {
+ /*
+ * if the user didn't specify '-' as an option,
+ * assume it means -1.
+ */
+ if (optopt == (int)'-')
+ return (-1);
+ if (!*place)
+ ++optind;
+ if (opterr && *ostr != ':')
+ (void)fprintf(stderr,
+ "%s: illegal option -- %c\n", __progname(nargv[0]), optopt);
+ return (BADCH);
+ }
+ if (*++oli != ':') { /* don't need argument */
+ optarg = NULL;
+ if (!*place)
+ ++optind;
+ } else { /* need an argument */
+ if (*place) /* no white space */
+ optarg = place;
+ else if (nargc <= ++optind) { /* no arg */
+ place = EMSG;
+ if ((opterr) && (*ostr != ':'))
+ (void)fprintf(stderr,
+ "%s: option requires an argument -- %c\n",
+ __progname(nargv[0]), optopt);
+ return (BADARG);
+ } else /* white space */
+ optarg = nargv[optind];
+ place = EMSG;
+ ++optind;
+ }
+ return (optopt); /* dump back option letter */
+}
+
+#if 0
+/*
+ * getopt --
+ * Parse argc/argv argument vector.
+ */
+int
+getopt2(nargc, nargv, ostr)
+ int nargc;
+ char * const *nargv;
+ const char *ostr;
+{
+ int retval;
+
+ if ((retval = getopt_internal(nargc, nargv, ostr)) == -2) {
+ retval = -1;
+ ++optind;
+ }
+ return(retval);
+}
+#endif
+
+/*
+ * getopt_long --
+ * Parse argc/argv argument vector.
+ */
+int
+getopt_long(nargc, nargv, options, long_options, index)
+ int nargc;
+ char ** nargv;
+ const char * options;
+ const struct option * long_options;
+ int * index;
+{
+ int retval;
+
+ _DIAGASSERT(nargv != NULL);
+ _DIAGASSERT(options != NULL);
+ _DIAGASSERT(long_options != NULL);
+ /* index may be NULL */
+
+ if ((retval = getopt_internal(nargc, nargv, options)) == -2) {
+ char *current_argv = nargv[optind++] + 2, *has_equal;
+ int i, current_argv_len, match = -1;
+
+ if (*current_argv == '\0') {
+ return(-1);
+ }
+ if ((has_equal = strchr(current_argv, '=')) != NULL) {
+ current_argv_len = has_equal - current_argv;
+ has_equal++;
+ } else
+ current_argv_len = strlen(current_argv);
+
+ for (i = 0; long_options[i].name; i++) {
+ if (strncmp(current_argv, long_options[i].name, current_argv_len))
+ continue;
+
+ if (strlen(long_options[i].name) == (unsigned)current_argv_len) {
+ match = i;
+ break;
+ }
+ if (match == -1)
+ match = i;
+ }
+ if (match != -1) {
+ if (long_options[match].has_arg == required_argument ||
+ long_options[match].has_arg == optional_argument) {
+ if (has_equal)
+ optarg = has_equal;
+ else
+ optarg = nargv[optind++];
+ }
+ if ((long_options[match].has_arg == required_argument)
+ && (optarg == NULL)) {
+ /*
+ * Missing argument, leading :
+ * indicates no error should be generated
+ */
+ if ((opterr) && (*options != ':'))
+ (void)fprintf(stderr,
+ "%s: option requires an argument -- %s\n",
+ __progname(nargv[0]), current_argv);
+ return (BADARG);
+ }
+ } else { /* No matching argument */
+ if ((opterr) && (*options != ':'))
+ (void)fprintf(stderr,
+ "%s: illegal option -- %s\n", __progname(nargv[0]), current_argv);
+ return (BADCH);
+ }
+ if (long_options[match].flag) {
+ *long_options[match].flag = long_options[match].val;
+ retval = 0;
+ } else
+ retval = long_options[match].val;
+ if (index)
+ *index = match;
+ }
+ return(retval);
+}
diff --git a/protocols/Telegram/tgl/libevent/WIN32-Code/nmake/evconfig-private.h b/protocols/Telegram/tgl/libevent/WIN32-Code/nmake/evconfig-private.h
new file mode 100644
index 0000000000..88e206272b
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/WIN32-Code/nmake/evconfig-private.h
@@ -0,0 +1,6 @@
+#if !defined(EVENT_EVCONFIG__PRIVATE_H_) && !defined(__MINGW32__)
+#define EVENT_EVCONFIG__PRIVATE_H_
+
+/* Nothing to see here. Move along. */
+
+#endif
diff --git a/protocols/Telegram/tgl/libevent/WIN32-Code/nmake/event2/event-config.h b/protocols/Telegram/tgl/libevent/WIN32-Code/nmake/event2/event-config.h
new file mode 100644
index 0000000000..8cbf190289
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/WIN32-Code/nmake/event2/event-config.h
@@ -0,0 +1,360 @@
+/* event2/event-config.h
+ *
+ * This file was generated by autoconf when libevent was built, and post-
+ * processed by Libevent so that its macros would have a uniform prefix.
+ *
+ * DO NOT EDIT THIS FILE.
+ *
+ * Do not rely on macros in this file existing in later versions.
+ */
+#ifndef EVENT_CONFIG_H__
+#define EVENT_CONFIG_H__
+/* config.h. Generated by configure. */
+/* config.h.in. Generated from configure.in by autoheader. */
+
+/* Define if libevent should not allow replacing the mm functions */
+/* #undef EVENT__DISABLE_MM_REPLACEMENT */
+
+/* Define if libevent should not be compiled with thread support */
+/* #undef EVENT__DISABLE_THREAD_SUPPORT */
+
+/* Define if clock_gettime is available in libc */
+/* #undef _EVENT_DNS_USE_CPU_CLOCK_FOR_ID */
+
+/* Define is no secure id variant is available */
+/* #define _EVENT_DNS_USE_GETTIMEOFDAY_FOR_ID 1 */
+#define EVENT_DNS_USE_FTIME_FOR_ID_ 1
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+/* #undef EVENT__HAVE_ARPA_INET_H */
+
+/* Define to 1 if you have the `clock_gettime' function. */
+/* #undef EVENT__HAVE_CLOCK_GETTIME */
+
+/* Define if /dev/poll is available */
+/* #undef EVENT__HAVE_DEVPOLL */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+/* #undef EVENT__HAVE_DLFCN_H */
+
+/* Define if your system supports the epoll system calls */
+/* #undef EVENT__HAVE_EPOLL */
+
+/* Define to 1 if you have the `epoll_ctl' function. */
+/* #undef EVENT__HAVE_EPOLL_CTL */
+
+/* Define to 1 if you have the `eventfd' function. */
+/* #undef EVENT__HAVE_EVENTFD */
+
+/* Define if your system supports event ports */
+/* #undef EVENT__HAVE_EVENT_PORTS */
+
+/* Define to 1 if you have the `fcntl' function. */
+/* #undef EVENT__HAVE_FCNTL */
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define EVENT__HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the `getaddrinfo' function. */
+#define EVENT__HAVE_GETADDRINFO 1
+
+/* Define to 1 if you have the `getnameinfo' function. */
+#define EVENT__HAVE_GETNAMEINFO 1
+
+/* Define to 1 if you have the `getprotobynumber' function. */
+#define EVENT__HAVE_GETPROTOBYNUMBER 1
+
+/* Define to 1 if you have the `getservbyname' function. */
+#define EVENT__HAVE_GETSERVBYNAME 1
+
+/* Define to 1 if you have the `gettimeofday' function. */
+/* #define EVENT__HAVE_GETTIMEOFDAY 1 */
+
+/* Define to 1 if you have the `inet_ntop' function. */
+/* #undef EVENT__HAVE_INET_NTOP */
+
+/* Define to 1 if you have the `inet_pton' function. */
+/* #undef EVENT__HAVE_INET_PTON */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+/* #define EVENT__HAVE_INTTYPES_H 1 */
+
+/* Define to 1 if you have the `kqueue' function. */
+/* #undef EVENT__HAVE_KQUEUE */
+
+/* Define if the system has zlib */
+/* #undef EVENT__HAVE_LIBZ */
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define EVENT__HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `mmap' function. */
+/* #undef EVENT__HAVE_MMAP */
+
+/* Define to 1 if you have the <netinet/in6.h> header file. */
+/* #undef EVENT__HAVE_NETINET_IN6_H */
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+/* #undef EVENT__HAVE_NETINET_IN_H */
+
+/* Define to 1 if you have the `pipe' function. */
+/* #undef EVENT__HAVE_PIPE */
+
+/* Define to 1 if you have the `poll' function. */
+/* #undef EVENT__HAVE_POLL */
+
+/* Define to 1 if you have the <poll.h> header file. */
+/* #undef EVENT__HAVE_POLL_H */
+
+/* Define to 1 if you have the `port_create' function. */
+/* #undef EVENT__HAVE_PORT_CREATE */
+
+/* Define to 1 if you have the <port.h> header file. */
+/* #undef EVENT__HAVE_PORT_H */
+
+/* Define if you have POSIX threads libraries and header files. */
+/* #undef EVENT__HAVE_PTHREAD */
+
+/* Define if we have pthreads on this system */
+/* #undef EVENT__HAVE_PTHREADS */
+
+/* Define to 1 if the system has the type `sa_family_t'. */
+/* #undef EVENT__HAVE_SA_FAMILY_T */
+
+/* Define to 1 if you have the `select' function. */
+/* #undef EVENT__HAVE_SELECT */
+
+/* Define to 1 if you have the `sendfile' function. */
+/* #undef EVENT__HAVE_SENDFILE */
+
+/* Define if F_SETFD is defined in <fcntl.h> */
+/* #undef EVENT__HAVE_SETFD */
+
+/* Define to 1 if you have the `sigaction' function. */
+/* #undef EVENT__HAVE_SIGACTION */
+
+/* Define to 1 if you have the `signal' function. */
+#define EVENT__HAVE_SIGNAL 1
+
+/* Define to 1 if you have the `splice' function. */
+/* #undef EVENT__HAVE_SPLICE */
+
+/* Define to 1 if you have the <stdarg.h> header file. */
+#define EVENT__HAVE_STDARG_H 1
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#define EVENT__HAVE_STDDEF_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+/* #define EVENT__HAVE_STDINT_H 1 */
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define EVENT__HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define EVENT__HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define EVENT__HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strlcpy' function. */
+/* #undef EVENT__HAVE_STRLCPY */
+
+/* Define to 1 if you have the `strsep' function. */
+/* #undef EVENT__HAVE_STRSEP */
+
+/* Define to 1 if you have the `strtok_r' function. */
+/* #undef EVENT__HAVE_STRTOK_R */
+
+/* Define to 1 if you have the `strtoll' function. */
+/* #define EVENT__HAVE_STRTOLL 1 */
+
+#define EVENT__HAVE_STRUCT_ADDRINFO 1
+
+/* Define to 1 if the system has the type `struct in6_addr'. */
+#define EVENT__HAVE_STRUCT_IN6_ADDR 1
+
+/* Define to 1 if `s6_addr16' is member of `struct in6_addr'. */
+#define EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR16 1
+
+/* Define to 1 if `s6_addr32' is member of `struct in6_addr'. */
+#define EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR32 1
+
+/* Define to 1 if the system has the type `struct sockaddr_in6'. */
+#define EVENT__HAVE_STRUCT_SOCKADDR_IN6 1
+
+/* Define to 1 if `sin6_len' is member of `struct sockaddr_in6'. */
+/* #undef EVENT__HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN */
+
+/* Define to 1 if `sin_len' is member of `struct sockaddr_in'. */
+/* #undef EVENT__HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */
+
+/* Define to 1 if the system has the type `struct sockaddr_storage'. */
+#define EVENT__HAVE_STRUCT_SOCKADDR_STORAGE 1
+
+/* Define to 1 if you have the <sys/devpoll.h> header file. */
+/* #undef EVENT__HAVE_SYS_DEVPOLL_H */
+
+/* Define to 1 if you have the <sys/epoll.h> header file. */
+/* #undef EVENT__HAVE_SYS_EPOLL_H */
+
+/* Define to 1 if you have the <sys/eventfd.h> header file. */
+/* #undef EVENT__HAVE_SYS_EVENTFD_H */
+
+/* Define to 1 if you have the <sys/event.h> header file. */
+/* #undef EVENT__HAVE_SYS_EVENT_H */
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+/* #undef EVENT__HAVE_SYS_IOCTL_H */
+
+/* Define to 1 if you have the <sys/mman.h> header file. */
+/* #undef EVENT__HAVE_SYS_MMAN_H */
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+/* #define EVENT__HAVE_SYS_PARAM_H 1 */
+
+/* Define to 1 if you have the <sys/queue.h> header file. */
+/* #undef EVENT__HAVE_SYS_QUEUE_H */
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+/* #undef EVENT__HAVE_SYS_SELECT_H */
+
+/* Define to 1 if you have the <sys/sendfile.h> header file. */
+/* #undef EVENT__HAVE_SYS_SENDFILE_H */
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+/* #undef EVENT__HAVE_SYS_SOCKET_H */
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define EVENT__HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+/* #define EVENT__HAVE_SYS_TIME_H 1 */
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define EVENT__HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/uio.h> header file. */
+/* #undef EVENT__HAVE_SYS_UIO_H */
+
+/* Define if TAILQ_FOREACH is defined in <sys/queue.h> */
+/* #undef EVENT__HAVE_TAILQFOREACH */
+
+/* Define if timeradd is defined in <sys/time.h> */
+/* #undef EVENT__HAVE_TIMERADD */
+
+/* Define if timerclear is defined in <sys/time.h> */
+#define EVENT__HAVE_TIMERCLEAR 1
+
+/* Define if timercmp is defined in <sys/time.h> */
+#define EVENT__HAVE_TIMERCMP 1
+
+/* Define if timerisset is defined in <sys/time.h> */
+#define EVENT__HAVE_TIMERISSET 1
+
+/* Define to 1 if the system has the type `uint16_t'. */
+/* #define EVENT__HAVE_UINT16_T 1 */
+
+/* Define to 1 if the system has the type `uint32_t'. */
+/* #define EVENT__HAVE_UINT32_T 1 */
+
+/* Define to 1 if the system has the type `uint64_t'. */
+/* #define EVENT__HAVE_UINT64_T 1 */
+
+/* Define to 1 if the system has the type `uint8_t'. */
+/* #define EVENT__HAVE_UINT8_T 1 */
+
+/* Define to 1 if you have the <unistd.h> header file. */
+/* #define EVENT__HAVE_UNISTD_H 1 */
+
+/* Define to 1 if you have the `vasprintf' function. */
+/* #undef EVENT__HAVE_VASPRINTF */
+
+/* Define if kqueue works correctly with pipes */
+/* #undef EVENT__HAVE_WORKING_KQUEUE */
+
+/* Numeric representation of the version */
+#define EVENT__NUMERIC_VERSION 0x02010500
+
+/* Name of package */
+#define EVENT__PACKAGE "libevent"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define EVENT__PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define EVENT__PACKAGE_NAME ""
+
+/* Define to the full name and version of this package. */
+#define EVENT__PACKAGE_STRING ""
+
+/* Define to the one symbol short name of this package. */
+#define EVENT__PACKAGE_TARNAME ""
+
+/* Define to the version of this package. */
+#define EVENT__PACKAGE_VERSION ""
+
+/* Define to necessary symbol if this constant uses a non-standard name on
+ your system. */
+/* #undef EVENT__PTHREAD_CREATE_JOINABLE */
+
+/* The size of a `int', as computed by sizeof. */
+#define EVENT__SIZEOF_INT 4
+
+/* The size of a `long', as computed by sizeof. */
+#define EVENT__SIZEOF_LONG 4
+
+/* The size of a `long long', as computed by sizeof. */
+#define EVENT__SIZEOF_LONG_LONG 8
+
+/* The size of a `short', as computed by sizeof. */
+#define EVENT__SIZEOF_SHORT 2
+
+/* The size of `size_t', as computed by sizeof. */
+#ifdef _WIN64
+#define EVENT__SIZEOF_SIZE_T 8
+#else
+#define EVENT__SIZEOF_SIZE_T 4
+#endif
+
+/* The size of `void *', as computed by sizeof. */
+#ifdef _WIN64
+#define EVENT__SIZEOF_VOID_P 8
+#else
+#define EVENT__SIZEOF_VOID_P 4
+#endif
+
+/* Define to 1 if you have the ANSI C header files. */
+#define EVENT__STDC_HEADERS 1
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define EVENT__TIME_WITH_SYS_TIME 1
+
+/* Version number of package */
+#define EVENT__VERSION "2.1.5-beta"
+
+/* Define to appropriate substitue if compiler doesnt have __func__ */
+#define EVENT____func__ __FUNCTION__
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef EVENT__const */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef _EVENT___cplusplus
+#define EVENT__inline __inline
+#endif
+
+/* Define to `int' if <sys/types.h> does not define. */
+/* #undef EVENT__pid_t */
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+/* #undef EVENT__size_t */
+
+/* Define to unsigned int if you dont have it */
+#define EVENT__socklen_t unsigned int
+
+/* Define to `int' if <sys/types.h> does not define. */
+#define EVENT__ssize_t SSIZE_T
+
+#endif
diff --git a/protocols/Telegram/tgl/libevent/WIN32-Code/tree.h b/protocols/Telegram/tgl/libevent/WIN32-Code/tree.h
new file mode 100644
index 0000000000..2ccfbf20ac
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/WIN32-Code/tree.h
@@ -0,0 +1,677 @@
+/* $OpenBSD: tree.h,v 1.7 2002/10/17 21:51:54 art Exp $ */
+/*
+ * Copyright 2002 Niels Provos <provos@citi.umich.edu>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY 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.
+ */
+
+#ifndef _SYS_TREE_H_
+#define _SYS_TREE_H_
+
+/*
+ * This file defines data structures for different types of trees:
+ * splay trees and red-black trees.
+ *
+ * A splay tree is a self-organizing data structure. Every operation
+ * on the tree causes a splay to happen. The splay moves the requested
+ * node to the root of the tree and partly rebalances it.
+ *
+ * This has the benefit that request locality causes faster lookups as
+ * the requested nodes move to the top of the tree. On the other hand,
+ * every lookup causes memory writes.
+ *
+ * The Balance Theorem bounds the total access time for m operations
+ * and n inserts on an initially empty tree as O((m + n)lg n). The
+ * amortized cost for a sequence of m accesses to a splay tree is O(lg n);
+ *
+ * A red-black tree is a binary search tree with the node color as an
+ * extra attribute. It fulfills a set of conditions:
+ * - every search path from the root to a leaf consists of the
+ * same number of black nodes,
+ * - each red node (except for the root) has a black parent,
+ * - each leaf node is black.
+ *
+ * Every operation on a red-black tree is bounded as O(lg n).
+ * The maximum height of a red-black tree is 2lg (n+1).
+ */
+
+#define SPLAY_HEAD(name, type) \
+struct name { \
+ struct type *sph_root; /* root of the tree */ \
+}
+
+#define SPLAY_INITIALIZER(root) \
+ { NULL }
+
+#define SPLAY_INIT(root) do { \
+ (root)->sph_root = NULL; \
+} while (0)
+
+#define SPLAY_ENTRY(type) \
+struct { \
+ struct type *spe_left; /* left element */ \
+ struct type *spe_right; /* right element */ \
+}
+
+#define SPLAY_LEFT(elm, field) (elm)->field.spe_left
+#define SPLAY_RIGHT(elm, field) (elm)->field.spe_right
+#define SPLAY_ROOT(head) (head)->sph_root
+#define SPLAY_EMPTY(head) (SPLAY_ROOT(head) == NULL)
+
+/* SPLAY_ROTATE_{LEFT,RIGHT} expect that tmp hold SPLAY_{RIGHT,LEFT} */
+#define SPLAY_ROTATE_RIGHT(head, tmp, field) do { \
+ SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(tmp, field); \
+ SPLAY_RIGHT(tmp, field) = (head)->sph_root; \
+ (head)->sph_root = tmp; \
+} while (0)
+
+#define SPLAY_ROTATE_LEFT(head, tmp, field) do { \
+ SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(tmp, field); \
+ SPLAY_LEFT(tmp, field) = (head)->sph_root; \
+ (head)->sph_root = tmp; \
+} while (0)
+
+#define SPLAY_LINKLEFT(head, tmp, field) do { \
+ SPLAY_LEFT(tmp, field) = (head)->sph_root; \
+ tmp = (head)->sph_root; \
+ (head)->sph_root = SPLAY_LEFT((head)->sph_root, field); \
+} while (0)
+
+#define SPLAY_LINKRIGHT(head, tmp, field) do { \
+ SPLAY_RIGHT(tmp, field) = (head)->sph_root; \
+ tmp = (head)->sph_root; \
+ (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field); \
+} while (0)
+
+#define SPLAY_ASSEMBLE(head, node, left, right, field) do { \
+ SPLAY_RIGHT(left, field) = SPLAY_LEFT((head)->sph_root, field); \
+ SPLAY_LEFT(right, field) = SPLAY_RIGHT((head)->sph_root, field);\
+ SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(node, field); \
+ SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(node, field); \
+} while (0)
+
+/* Generates prototypes and inline functions */
+
+#define SPLAY_PROTOTYPE(name, type, field, cmp) \
+void name##_SPLAY(struct name *, struct type *); \
+void name##_SPLAY_MINMAX(struct name *, int); \
+struct type *name##_SPLAY_INSERT(struct name *, struct type *); \
+struct type *name##_SPLAY_REMOVE(struct name *, struct type *); \
+ \
+/* Finds the node with the same key as elm */ \
+static __inline struct type * \
+name##_SPLAY_FIND(struct name *head, struct type *elm) \
+{ \
+ if (SPLAY_EMPTY(head)) \
+ return(NULL); \
+ name##_SPLAY(head, elm); \
+ if ((cmp)(elm, (head)->sph_root) == 0) \
+ return (head->sph_root); \
+ return (NULL); \
+} \
+ \
+static __inline struct type * \
+name##_SPLAY_NEXT(struct name *head, struct type *elm) \
+{ \
+ name##_SPLAY(head, elm); \
+ if (SPLAY_RIGHT(elm, field) != NULL) { \
+ elm = SPLAY_RIGHT(elm, field); \
+ while (SPLAY_LEFT(elm, field) != NULL) { \
+ elm = SPLAY_LEFT(elm, field); \
+ } \
+ } else \
+ elm = NULL; \
+ return (elm); \
+} \
+ \
+static __inline struct type * \
+name##_SPLAY_MIN_MAX(struct name *head, int val) \
+{ \
+ name##_SPLAY_MINMAX(head, val); \
+ return (SPLAY_ROOT(head)); \
+}
+
+/* Main splay operation.
+ * Moves node close to the key of elm to top
+ */
+#define SPLAY_GENERATE(name, type, field, cmp) \
+struct type * \
+name##_SPLAY_INSERT(struct name *head, struct type *elm) \
+{ \
+ if (SPLAY_EMPTY(head)) { \
+ SPLAY_LEFT(elm, field) = SPLAY_RIGHT(elm, field) = NULL; \
+ } else { \
+ int __comp; \
+ name##_SPLAY(head, elm); \
+ __comp = (cmp)(elm, (head)->sph_root); \
+ if(__comp < 0) { \
+ SPLAY_LEFT(elm, field) = SPLAY_LEFT((head)->sph_root, field);\
+ SPLAY_RIGHT(elm, field) = (head)->sph_root; \
+ SPLAY_LEFT((head)->sph_root, field) = NULL; \
+ } else if (__comp > 0) { \
+ SPLAY_RIGHT(elm, field) = SPLAY_RIGHT((head)->sph_root, field);\
+ SPLAY_LEFT(elm, field) = (head)->sph_root; \
+ SPLAY_RIGHT((head)->sph_root, field) = NULL; \
+ } else \
+ return ((head)->sph_root); \
+ } \
+ (head)->sph_root = (elm); \
+ return (NULL); \
+} \
+ \
+struct type * \
+name##_SPLAY_REMOVE(struct name *head, struct type *elm) \
+{ \
+ struct type *__tmp; \
+ if (SPLAY_EMPTY(head)) \
+ return (NULL); \
+ name##_SPLAY(head, elm); \
+ if ((cmp)(elm, (head)->sph_root) == 0) { \
+ if (SPLAY_LEFT((head)->sph_root, field) == NULL) { \
+ (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field);\
+ } else { \
+ __tmp = SPLAY_RIGHT((head)->sph_root, field); \
+ (head)->sph_root = SPLAY_LEFT((head)->sph_root, field);\
+ name##_SPLAY(head, elm); \
+ SPLAY_RIGHT((head)->sph_root, field) = __tmp; \
+ } \
+ return (elm); \
+ } \
+ return (NULL); \
+} \
+ \
+void \
+name##_SPLAY(struct name *head, struct type *elm) \
+{ \
+ struct type __node, *__left, *__right, *__tmp; \
+ int __comp; \
+\
+ SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;\
+ __left = __right = &__node; \
+\
+ while ((__comp = (cmp)(elm, (head)->sph_root))) { \
+ if (__comp < 0) { \
+ __tmp = SPLAY_LEFT((head)->sph_root, field); \
+ if (__tmp == NULL) \
+ break; \
+ if ((cmp)(elm, __tmp) < 0){ \
+ SPLAY_ROTATE_RIGHT(head, __tmp, field); \
+ if (SPLAY_LEFT((head)->sph_root, field) == NULL)\
+ break; \
+ } \
+ SPLAY_LINKLEFT(head, __right, field); \
+ } else if (__comp > 0) { \
+ __tmp = SPLAY_RIGHT((head)->sph_root, field); \
+ if (__tmp == NULL) \
+ break; \
+ if ((cmp)(elm, __tmp) > 0){ \
+ SPLAY_ROTATE_LEFT(head, __tmp, field); \
+ if (SPLAY_RIGHT((head)->sph_root, field) == NULL)\
+ break; \
+ } \
+ SPLAY_LINKRIGHT(head, __left, field); \
+ } \
+ } \
+ SPLAY_ASSEMBLE(head, &__node, __left, __right, field); \
+} \
+ \
+/* Splay with either the minimum or the maximum element \
+ * Used to find minimum or maximum element in tree. \
+ */ \
+void name##_SPLAY_MINMAX(struct name *head, int __comp) \
+{ \
+ struct type __node, *__left, *__right, *__tmp; \
+\
+ SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;\
+ __left = __right = &__node; \
+\
+ while (1) { \
+ if (__comp < 0) { \
+ __tmp = SPLAY_LEFT((head)->sph_root, field); \
+ if (__tmp == NULL) \
+ break; \
+ if (__comp < 0){ \
+ SPLAY_ROTATE_RIGHT(head, __tmp, field); \
+ if (SPLAY_LEFT((head)->sph_root, field) == NULL)\
+ break; \
+ } \
+ SPLAY_LINKLEFT(head, __right, field); \
+ } else if (__comp > 0) { \
+ __tmp = SPLAY_RIGHT((head)->sph_root, field); \
+ if (__tmp == NULL) \
+ break; \
+ if (__comp > 0) { \
+ SPLAY_ROTATE_LEFT(head, __tmp, field); \
+ if (SPLAY_RIGHT((head)->sph_root, field) == NULL)\
+ break; \
+ } \
+ SPLAY_LINKRIGHT(head, __left, field); \
+ } \
+ } \
+ SPLAY_ASSEMBLE(head, &__node, __left, __right, field); \
+}
+
+#define SPLAY_NEGINF -1
+#define SPLAY_INF 1
+
+#define SPLAY_INSERT(name, x, y) name##_SPLAY_INSERT(x, y)
+#define SPLAY_REMOVE(name, x, y) name##_SPLAY_REMOVE(x, y)
+#define SPLAY_FIND(name, x, y) name##_SPLAY_FIND(x, y)
+#define SPLAY_NEXT(name, x, y) name##_SPLAY_NEXT(x, y)
+#define SPLAY_MIN(name, x) (SPLAY_EMPTY(x) ? NULL \
+ : name##_SPLAY_MIN_MAX(x, SPLAY_NEGINF))
+#define SPLAY_MAX(name, x) (SPLAY_EMPTY(x) ? NULL \
+ : name##_SPLAY_MIN_MAX(x, SPLAY_INF))
+
+#define SPLAY_FOREACH(x, name, head) \
+ for ((x) = SPLAY_MIN(name, head); \
+ (x) != NULL; \
+ (x) = SPLAY_NEXT(name, head, x))
+
+/* Macros that define a red-back tree */
+#define RB_HEAD(name, type) \
+struct name { \
+ struct type *rbh_root; /* root of the tree */ \
+}
+
+#define RB_INITIALIZER(root) \
+ { NULL }
+
+#define RB_INIT(root) do { \
+ (root)->rbh_root = NULL; \
+} while (0)
+
+#define RB_BLACK 0
+#define RB_RED 1
+#define RB_ENTRY(type) \
+struct { \
+ struct type *rbe_left; /* left element */ \
+ struct type *rbe_right; /* right element */ \
+ struct type *rbe_parent; /* parent element */ \
+ int rbe_color; /* node color */ \
+}
+
+#define RB_LEFT(elm, field) (elm)->field.rbe_left
+#define RB_RIGHT(elm, field) (elm)->field.rbe_right
+#define RB_PARENT(elm, field) (elm)->field.rbe_parent
+#define RB_COLOR(elm, field) (elm)->field.rbe_color
+#define RB_ROOT(head) (head)->rbh_root
+#define RB_EMPTY(head) (RB_ROOT(head) == NULL)
+
+#define RB_SET(elm, parent, field) do { \
+ RB_PARENT(elm, field) = parent; \
+ RB_LEFT(elm, field) = RB_RIGHT(elm, field) = NULL; \
+ RB_COLOR(elm, field) = RB_RED; \
+} while (0)
+
+#define RB_SET_BLACKRED(black, red, field) do { \
+ RB_COLOR(black, field) = RB_BLACK; \
+ RB_COLOR(red, field) = RB_RED; \
+} while (0)
+
+#ifndef RB_AUGMENT
+#define RB_AUGMENT(x)
+#endif
+
+#define RB_ROTATE_LEFT(head, elm, tmp, field) do { \
+ (tmp) = RB_RIGHT(elm, field); \
+ if ((RB_RIGHT(elm, field) = RB_LEFT(tmp, field))) { \
+ RB_PARENT(RB_LEFT(tmp, field), field) = (elm); \
+ } \
+ RB_AUGMENT(elm); \
+ if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field))) { \
+ if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \
+ RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \
+ else \
+ RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \
+ } else \
+ (head)->rbh_root = (tmp); \
+ RB_LEFT(tmp, field) = (elm); \
+ RB_PARENT(elm, field) = (tmp); \
+ RB_AUGMENT(tmp); \
+ if ((RB_PARENT(tmp, field))) \
+ RB_AUGMENT(RB_PARENT(tmp, field)); \
+} while (0)
+
+#define RB_ROTATE_RIGHT(head, elm, tmp, field) do { \
+ (tmp) = RB_LEFT(elm, field); \
+ if ((RB_LEFT(elm, field) = RB_RIGHT(tmp, field))) { \
+ RB_PARENT(RB_RIGHT(tmp, field), field) = (elm); \
+ } \
+ RB_AUGMENT(elm); \
+ if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field))) { \
+ if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \
+ RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \
+ else \
+ RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \
+ } else \
+ (head)->rbh_root = (tmp); \
+ RB_RIGHT(tmp, field) = (elm); \
+ RB_PARENT(elm, field) = (tmp); \
+ RB_AUGMENT(tmp); \
+ if ((RB_PARENT(tmp, field))) \
+ RB_AUGMENT(RB_PARENT(tmp, field)); \
+} while (0)
+
+/* Generates prototypes and inline functions */
+#define RB_PROTOTYPE(name, type, field, cmp) \
+void name##_RB_INSERT_COLOR(struct name *, struct type *); \
+void name##_RB_REMOVE_COLOR(struct name *, struct type *, struct type *);\
+struct type *name##_RB_REMOVE(struct name *, struct type *); \
+struct type *name##_RB_INSERT(struct name *, struct type *); \
+struct type *name##_RB_FIND(struct name *, struct type *); \
+struct type *name##_RB_NEXT(struct type *); \
+struct type *name##_RB_MINMAX(struct name *, int); \
+ \
+
+/* Main rb operation.
+ * Moves node close to the key of elm to top
+ */
+#define RB_GENERATE(name, type, field, cmp) \
+void \
+name##_RB_INSERT_COLOR(struct name *head, struct type *elm) \
+{ \
+ struct type *parent, *gparent, *tmp; \
+ while ((parent = RB_PARENT(elm, field)) && \
+ RB_COLOR(parent, field) == RB_RED) { \
+ gparent = RB_PARENT(parent, field); \
+ if (parent == RB_LEFT(gparent, field)) { \
+ tmp = RB_RIGHT(gparent, field); \
+ if (tmp && RB_COLOR(tmp, field) == RB_RED) { \
+ RB_COLOR(tmp, field) = RB_BLACK; \
+ RB_SET_BLACKRED(parent, gparent, field);\
+ elm = gparent; \
+ continue; \
+ } \
+ if (RB_RIGHT(parent, field) == elm) { \
+ RB_ROTATE_LEFT(head, parent, tmp, field);\
+ tmp = parent; \
+ parent = elm; \
+ elm = tmp; \
+ } \
+ RB_SET_BLACKRED(parent, gparent, field); \
+ RB_ROTATE_RIGHT(head, gparent, tmp, field); \
+ } else { \
+ tmp = RB_LEFT(gparent, field); \
+ if (tmp && RB_COLOR(tmp, field) == RB_RED) { \
+ RB_COLOR(tmp, field) = RB_BLACK; \
+ RB_SET_BLACKRED(parent, gparent, field);\
+ elm = gparent; \
+ continue; \
+ } \
+ if (RB_LEFT(parent, field) == elm) { \
+ RB_ROTATE_RIGHT(head, parent, tmp, field);\
+ tmp = parent; \
+ parent = elm; \
+ elm = tmp; \
+ } \
+ RB_SET_BLACKRED(parent, gparent, field); \
+ RB_ROTATE_LEFT(head, gparent, tmp, field); \
+ } \
+ } \
+ RB_COLOR(head->rbh_root, field) = RB_BLACK; \
+} \
+ \
+void \
+name##_RB_REMOVE_COLOR(struct name *head, struct type *parent, struct type *elm) \
+{ \
+ struct type *tmp; \
+ while ((elm == NULL || RB_COLOR(elm, field) == RB_BLACK) && \
+ elm != RB_ROOT(head)) { \
+ if (RB_LEFT(parent, field) == elm) { \
+ tmp = RB_RIGHT(parent, field); \
+ if (RB_COLOR(tmp, field) == RB_RED) { \
+ RB_SET_BLACKRED(tmp, parent, field); \
+ RB_ROTATE_LEFT(head, parent, tmp, field);\
+ tmp = RB_RIGHT(parent, field); \
+ } \
+ if ((RB_LEFT(tmp, field) == NULL || \
+ RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&\
+ (RB_RIGHT(tmp, field) == NULL || \
+ RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {\
+ RB_COLOR(tmp, field) = RB_RED; \
+ elm = parent; \
+ parent = RB_PARENT(elm, field); \
+ } else { \
+ if (RB_RIGHT(tmp, field) == NULL || \
+ RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK) {\
+ struct type *oleft; \
+ if ((oleft = RB_LEFT(tmp, field)))\
+ RB_COLOR(oleft, field) = RB_BLACK;\
+ RB_COLOR(tmp, field) = RB_RED; \
+ RB_ROTATE_RIGHT(head, tmp, oleft, field);\
+ tmp = RB_RIGHT(parent, field); \
+ } \
+ RB_COLOR(tmp, field) = RB_COLOR(parent, field);\
+ RB_COLOR(parent, field) = RB_BLACK; \
+ if (RB_RIGHT(tmp, field)) \
+ RB_COLOR(RB_RIGHT(tmp, field), field) = RB_BLACK;\
+ RB_ROTATE_LEFT(head, parent, tmp, field);\
+ elm = RB_ROOT(head); \
+ break; \
+ } \
+ } else { \
+ tmp = RB_LEFT(parent, field); \
+ if (RB_COLOR(tmp, field) == RB_RED) { \
+ RB_SET_BLACKRED(tmp, parent, field); \
+ RB_ROTATE_RIGHT(head, parent, tmp, field);\
+ tmp = RB_LEFT(parent, field); \
+ } \
+ if ((RB_LEFT(tmp, field) == NULL || \
+ RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&\
+ (RB_RIGHT(tmp, field) == NULL || \
+ RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {\
+ RB_COLOR(tmp, field) = RB_RED; \
+ elm = parent; \
+ parent = RB_PARENT(elm, field); \
+ } else { \
+ if (RB_LEFT(tmp, field) == NULL || \
+ RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) {\
+ struct type *oright; \
+ if ((oright = RB_RIGHT(tmp, field)))\
+ RB_COLOR(oright, field) = RB_BLACK;\
+ RB_COLOR(tmp, field) = RB_RED; \
+ RB_ROTATE_LEFT(head, tmp, oright, field);\
+ tmp = RB_LEFT(parent, field); \
+ } \
+ RB_COLOR(tmp, field) = RB_COLOR(parent, field);\
+ RB_COLOR(parent, field) = RB_BLACK; \
+ if (RB_LEFT(tmp, field)) \
+ RB_COLOR(RB_LEFT(tmp, field), field) = RB_BLACK;\
+ RB_ROTATE_RIGHT(head, parent, tmp, field);\
+ elm = RB_ROOT(head); \
+ break; \
+ } \
+ } \
+ } \
+ if (elm) \
+ RB_COLOR(elm, field) = RB_BLACK; \
+} \
+ \
+struct type * \
+name##_RB_REMOVE(struct name *head, struct type *elm) \
+{ \
+ struct type *child, *parent, *old = elm; \
+ int color; \
+ if (RB_LEFT(elm, field) == NULL) \
+ child = RB_RIGHT(elm, field); \
+ else if (RB_RIGHT(elm, field) == NULL) \
+ child = RB_LEFT(elm, field); \
+ else { \
+ struct type *left; \
+ elm = RB_RIGHT(elm, field); \
+ while ((left = RB_LEFT(elm, field))) \
+ elm = left; \
+ child = RB_RIGHT(elm, field); \
+ parent = RB_PARENT(elm, field); \
+ color = RB_COLOR(elm, field); \
+ if (child) \
+ RB_PARENT(child, field) = parent; \
+ if (parent) { \
+ if (RB_LEFT(parent, field) == elm) \
+ RB_LEFT(parent, field) = child; \
+ else \
+ RB_RIGHT(parent, field) = child; \
+ RB_AUGMENT(parent); \
+ } else \
+ RB_ROOT(head) = child; \
+ if (RB_PARENT(elm, field) == old) \
+ parent = elm; \
+ (elm)->field = (old)->field; \
+ if (RB_PARENT(old, field)) { \
+ if (RB_LEFT(RB_PARENT(old, field), field) == old)\
+ RB_LEFT(RB_PARENT(old, field), field) = elm;\
+ else \
+ RB_RIGHT(RB_PARENT(old, field), field) = elm;\
+ RB_AUGMENT(RB_PARENT(old, field)); \
+ } else \
+ RB_ROOT(head) = elm; \
+ RB_PARENT(RB_LEFT(old, field), field) = elm; \
+ if (RB_RIGHT(old, field)) \
+ RB_PARENT(RB_RIGHT(old, field), field) = elm; \
+ if (parent) { \
+ left = parent; \
+ do { \
+ RB_AUGMENT(left); \
+ } while ((left = RB_PARENT(left, field))); \
+ } \
+ goto color; \
+ } \
+ parent = RB_PARENT(elm, field); \
+ color = RB_COLOR(elm, field); \
+ if (child) \
+ RB_PARENT(child, field) = parent; \
+ if (parent) { \
+ if (RB_LEFT(parent, field) == elm) \
+ RB_LEFT(parent, field) = child; \
+ else \
+ RB_RIGHT(parent, field) = child; \
+ RB_AUGMENT(parent); \
+ } else \
+ RB_ROOT(head) = child; \
+color: \
+ if (color == RB_BLACK) \
+ name##_RB_REMOVE_COLOR(head, parent, child); \
+ return (old); \
+} \
+ \
+/* Inserts a node into the RB tree */ \
+struct type * \
+name##_RB_INSERT(struct name *head, struct type *elm) \
+{ \
+ struct type *tmp; \
+ struct type *parent = NULL; \
+ int comp = 0; \
+ tmp = RB_ROOT(head); \
+ while (tmp) { \
+ parent = tmp; \
+ comp = (cmp)(elm, parent); \
+ if (comp < 0) \
+ tmp = RB_LEFT(tmp, field); \
+ else if (comp > 0) \
+ tmp = RB_RIGHT(tmp, field); \
+ else \
+ return (tmp); \
+ } \
+ RB_SET(elm, parent, field); \
+ if (parent != NULL) { \
+ if (comp < 0) \
+ RB_LEFT(parent, field) = elm; \
+ else \
+ RB_RIGHT(parent, field) = elm; \
+ RB_AUGMENT(parent); \
+ } else \
+ RB_ROOT(head) = elm; \
+ name##_RB_INSERT_COLOR(head, elm); \
+ return (NULL); \
+} \
+ \
+/* Finds the node with the same key as elm */ \
+struct type * \
+name##_RB_FIND(struct name *head, struct type *elm) \
+{ \
+ struct type *tmp = RB_ROOT(head); \
+ int comp; \
+ while (tmp) { \
+ comp = cmp(elm, tmp); \
+ if (comp < 0) \
+ tmp = RB_LEFT(tmp, field); \
+ else if (comp > 0) \
+ tmp = RB_RIGHT(tmp, field); \
+ else \
+ return (tmp); \
+ } \
+ return (NULL); \
+} \
+ \
+struct type * \
+name##_RB_NEXT(struct type *elm) \
+{ \
+ if (RB_RIGHT(elm, field)) { \
+ elm = RB_RIGHT(elm, field); \
+ while (RB_LEFT(elm, field)) \
+ elm = RB_LEFT(elm, field); \
+ } else { \
+ if (RB_PARENT(elm, field) && \
+ (elm == RB_LEFT(RB_PARENT(elm, field), field))) \
+ elm = RB_PARENT(elm, field); \
+ else { \
+ while (RB_PARENT(elm, field) && \
+ (elm == RB_RIGHT(RB_PARENT(elm, field), field)))\
+ elm = RB_PARENT(elm, field); \
+ elm = RB_PARENT(elm, field); \
+ } \
+ } \
+ return (elm); \
+} \
+ \
+struct type * \
+name##_RB_MINMAX(struct name *head, int val) \
+{ \
+ struct type *tmp = RB_ROOT(head); \
+ struct type *parent = NULL; \
+ while (tmp) { \
+ parent = tmp; \
+ if (val < 0) \
+ tmp = RB_LEFT(tmp, field); \
+ else \
+ tmp = RB_RIGHT(tmp, field); \
+ } \
+ return (parent); \
+}
+
+#define RB_NEGINF -1
+#define RB_INF 1
+
+#define RB_INSERT(name, x, y) name##_RB_INSERT(x, y)
+#define RB_REMOVE(name, x, y) name##_RB_REMOVE(x, y)
+#define RB_FIND(name, x, y) name##_RB_FIND(x, y)
+#define RB_NEXT(name, x, y) name##_RB_NEXT(y)
+#define RB_MIN(name, x) name##_RB_MINMAX(x, RB_NEGINF)
+#define RB_MAX(name, x) name##_RB_MINMAX(x, RB_INF)
+
+#define RB_FOREACH(x, name, head) \
+ for ((x) = RB_MIN(name, head); \
+ (x) != NULL; \
+ (x) = name##_RB_NEXT(x))
+
+#endif /* _SYS_TREE_H_ */
diff --git a/protocols/Telegram/tgl/libevent/appveyor.yml b/protocols/Telegram/tgl/libevent/appveyor.yml
new file mode 100644
index 0000000000..f9af62d2db
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/appveyor.yml
@@ -0,0 +1,45 @@
+version: 2.1.5.{build}
+shallow_clone: true
+
+os: Visual Studio 2015 RC
+
+build:
+ verbosity: detailed
+
+environment:
+ global:
+ CYG_ROOT: C:/MinGW/msys/1.0
+
+init:
+ - 'echo Building libevent %version% for Windows'
+ - 'echo System architecture: %PLATFORM%'
+ - 'echo Repo build branch is: %APPVEYOR_REPO_BRANCH%'
+ - 'echo Build folder is: %APPVEYOR_BUILD_FOLDER%'
+
+install:
+ - set PATH=%PATH%;C:\MinGW\msys\1.0\bin;C:\MinGW\bin
+ - appveyor DownloadFile https://strcpy.net/packages/Win32OpenSSL-1_0_2a.exe
+ - Win32OpenSSL-1_0_2a.exe /silent /verysilent /sp- /suppressmsgboxes
+
+build_script:
+ - cmd: 'echo Cygwin root is: %CYG_ROOT%'
+ - cmd: 'echo Build folder is: %APPVEYOR_BUILD_FOLDER%'
+ - cmd: 'echo Repo build branch is: %APPVEYOR_REPO_BRANCH%'
+ - cmd: 'echo Repo build commit is: %APPVEYOR_REPO_COMMIT%'
+ - cmd: "echo installing stuff"
+ - cmd: 'echo "C:\MinGW /mingw" >%CYG_ROOT%/etc/fstab'
+ - cmd: 'C:\MinGW\bin\mingw-get install autotools autoconf automake python'
+ - cmd: 'echo Autogen running...'
+ - cmd: '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null;mount C:/MinGW /mingw; bash -x ./autogen.sh; ./configure; make; make verify"'
+
+#install:
+# - appveyor DownloadFile https://strcpy.net/packages/Win32OpenSSL-1_0_2a.exe
+# - Win32OpenSSL-1_0_2a.exe /silent /verysilent /sp- /suppressmsgboxes
+#build_script:
+# - md build
+# - cd build
+# - cmake ..
+# - cmake --build .
+# - ctest --output-on-failure
+cache:
+ - C:\OpenSSL-Win32
diff --git a/protocols/Telegram/tgl/libevent/arc4random.c b/protocols/Telegram/tgl/libevent/arc4random.c
new file mode 100644
index 0000000000..a2338e692a
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/arc4random.c
@@ -0,0 +1,556 @@
+/* Portable arc4random.c based on arc4random.c from OpenBSD.
+ * Portable version by Chris Davis, adapted for Libevent by Nick Mathewson
+ * Copyright (c) 2010 Chris Davis, Niels Provos, and Nick Mathewson
+ * Copyright (c) 2010-2012 Niels Provos and Nick Mathewson
+ *
+ * Note that in Libevent, this file isn't compiled directly. Instead,
+ * it's included from evutil_rand.c
+ */
+
+/*
+ * Copyright (c) 1996, David Mazieres <dm@uun.org>
+ * Copyright (c) 2008, Damien Miller <djm@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * Arc4 random number generator for OpenBSD.
+ *
+ * This code is derived from section 17.1 of Applied Cryptography,
+ * second edition, which describes a stream cipher allegedly
+ * compatible with RSA Labs "RC4" cipher (the actual description of
+ * which is a trade secret). The same algorithm is used as a stream
+ * cipher called "arcfour" in Tatu Ylonen's ssh package.
+ *
+ * Here the stream cipher has been modified always to include the time
+ * when initializing the state. That makes it impossible to
+ * regenerate the same random sequence twice, so this can't be used
+ * for encryption, but will generate good random numbers.
+ *
+ * RC4 is a registered trademark of RSA Laboratories.
+ */
+
+#ifndef ARC4RANDOM_EXPORT
+#define ARC4RANDOM_EXPORT
+#endif
+
+#ifndef ARC4RANDOM_UINT32
+#define ARC4RANDOM_UINT32 uint32_t
+#endif
+
+#ifndef ARC4RANDOM_NO_INCLUDES
+#include "evconfig-private.h"
+#ifdef _WIN32
+#include <wincrypt.h>
+#include <process.h>
+#else
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/param.h>
+#include <sys/time.h>
+#ifdef EVENT__HAVE_SYS_SYSCTL_H
+#include <sys/sysctl.h>
+#endif
+#endif
+#include <limits.h>
+#include <stdlib.h>
+#include <string.h>
+#endif
+
+/* Add platform entropy 32 bytes (256 bits) at a time. */
+#define ADD_ENTROPY 32
+
+/* Re-seed from the platform RNG after generating this many bytes. */
+#define BYTES_BEFORE_RESEED 1600000
+
+struct arc4_stream {
+ unsigned char i;
+ unsigned char j;
+ unsigned char s[256];
+};
+
+#ifdef _WIN32
+#define getpid _getpid
+#define pid_t int
+#endif
+
+static int rs_initialized;
+static struct arc4_stream rs;
+static pid_t arc4_stir_pid;
+static int arc4_count;
+static int arc4_seeded_ok;
+
+static inline unsigned char arc4_getbyte(void);
+
+static inline void
+arc4_init(void)
+{
+ int n;
+
+ for (n = 0; n < 256; n++)
+ rs.s[n] = n;
+ rs.i = 0;
+ rs.j = 0;
+}
+
+static inline void
+arc4_addrandom(const unsigned char *dat, int datlen)
+{
+ int n;
+ unsigned char si;
+
+ rs.i--;
+ for (n = 0; n < 256; n++) {
+ rs.i = (rs.i + 1);
+ si = rs.s[rs.i];
+ rs.j = (rs.j + si + dat[n % datlen]);
+ rs.s[rs.i] = rs.s[rs.j];
+ rs.s[rs.j] = si;
+ }
+ rs.j = rs.i;
+}
+
+#ifndef _WIN32
+static ssize_t
+read_all(int fd, unsigned char *buf, size_t count)
+{
+ size_t numread = 0;
+ ssize_t result;
+
+ while (numread < count) {
+ result = read(fd, buf+numread, count-numread);
+ if (result<0)
+ return -1;
+ else if (result == 0)
+ break;
+ numread += result;
+ }
+
+ return (ssize_t)numread;
+}
+#endif
+
+#ifdef _WIN32
+#define TRY_SEED_WIN32
+static int
+arc4_seed_win32(void)
+{
+ /* This is adapted from Tor's crypto_seed_rng() */
+ static int provider_set = 0;
+ static HCRYPTPROV provider;
+ unsigned char buf[ADD_ENTROPY];
+
+ if (!provider_set) {
+ if (!CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL,
+ CRYPT_VERIFYCONTEXT)) {
+ if (GetLastError() != (DWORD)NTE_BAD_KEYSET)
+ return -1;
+ }
+ provider_set = 1;
+ }
+ if (!CryptGenRandom(provider, sizeof(buf), buf))
+ return -1;
+ arc4_addrandom(buf, sizeof(buf));
+ evutil_memclear_(buf, sizeof(buf));
+ arc4_seeded_ok = 1;
+ return 0;
+}
+#endif
+
+#if defined(EVENT__HAVE_SYS_SYSCTL_H) && defined(EVENT__HAVE_SYSCTL)
+#if EVENT__HAVE_DECL_CTL_KERN && EVENT__HAVE_DECL_KERN_RANDOM && EVENT__HAVE_DECL_RANDOM_UUID
+#define TRY_SEED_SYSCTL_LINUX
+static int
+arc4_seed_sysctl_linux(void)
+{
+ /* Based on code by William Ahern, this function tries to use the
+ * RANDOM_UUID sysctl to get entropy from the kernel. This can work
+ * even if /dev/urandom is inaccessible for some reason (e.g., we're
+ * running in a chroot). */
+ int mib[] = { CTL_KERN, KERN_RANDOM, RANDOM_UUID };
+ unsigned char buf[ADD_ENTROPY];
+ size_t len, n;
+ unsigned i;
+ int any_set;
+
+ memset(buf, 0, sizeof(buf));
+
+ for (len = 0; len < sizeof(buf); len += n) {
+ n = sizeof(buf) - len;
+
+ if (0 != sysctl(mib, 3, &buf[len], &n, NULL, 0))
+ return -1;
+ }
+ /* make sure that the buffer actually got set. */
+ for (i=0,any_set=0; i<sizeof(buf); ++i) {
+ any_set |= buf[i];
+ }
+ if (!any_set)
+ return -1;
+
+ arc4_addrandom(buf, sizeof(buf));
+ evutil_memclear_(buf, sizeof(buf));
+ arc4_seeded_ok = 1;
+ return 0;
+}
+#endif
+
+#if EVENT__HAVE_DECL_CTL_KERN && EVENT__HAVE_DECL_KERN_ARND
+#define TRY_SEED_SYSCTL_BSD
+static int
+arc4_seed_sysctl_bsd(void)
+{
+ /* Based on code from William Ahern and from OpenBSD, this function
+ * tries to use the KERN_ARND syscall to get entropy from the kernel.
+ * This can work even if /dev/urandom is inaccessible for some reason
+ * (e.g., we're running in a chroot). */
+ int mib[] = { CTL_KERN, KERN_ARND };
+ unsigned char buf[ADD_ENTROPY];
+ size_t len, n;
+ int i, any_set;
+
+ memset(buf, 0, sizeof(buf));
+
+ len = sizeof(buf);
+ if (sysctl(mib, 2, buf, &len, NULL, 0) == -1) {
+ for (len = 0; len < sizeof(buf); len += sizeof(unsigned)) {
+ n = sizeof(unsigned);
+ if (n + len > sizeof(buf))
+ n = len - sizeof(buf);
+ if (sysctl(mib, 2, &buf[len], &n, NULL, 0) == -1)
+ return -1;
+ }
+ }
+ /* make sure that the buffer actually got set. */
+ for (i=any_set=0; i<sizeof(buf); ++i) {
+ any_set |= buf[i];
+ }
+ if (!any_set)
+ return -1;
+
+ arc4_addrandom(buf, sizeof(buf));
+ evutil_memclear_(buf, sizeof(buf));
+ arc4_seeded_ok = 1;
+ return 0;
+}
+#endif
+#endif /* defined(EVENT__HAVE_SYS_SYSCTL_H) */
+
+#ifdef __linux__
+#define TRY_SEED_PROC_SYS_KERNEL_RANDOM_UUID
+static int
+arc4_seed_proc_sys_kernel_random_uuid(void)
+{
+ /* Occasionally, somebody will make /proc/sys accessible in a chroot,
+ * but not /dev/urandom. Let's try /proc/sys/kernel/random/uuid.
+ * Its format is stupid, so we need to decode it from hex.
+ */
+ int fd;
+ char buf[128];
+ unsigned char entropy[64];
+ int bytes, n, i, nybbles;
+ for (bytes = 0; bytes<ADD_ENTROPY; ) {
+ fd = evutil_open_closeonexec_("/proc/sys/kernel/random/uuid", O_RDONLY, 0);
+ if (fd < 0)
+ return -1;
+ n = read(fd, buf, sizeof(buf));
+ close(fd);
+ if (n<=0)
+ return -1;
+ memset(entropy, 0, sizeof(entropy));
+ for (i=nybbles=0; i<n; ++i) {
+ if (EVUTIL_ISXDIGIT_(buf[i])) {
+ int nyb = evutil_hex_char_to_int_(buf[i]);
+ if (nybbles & 1) {
+ entropy[nybbles/2] |= nyb;
+ } else {
+ entropy[nybbles/2] |= nyb<<4;
+ }
+ ++nybbles;
+ }
+ }
+ if (nybbles < 2)
+ return -1;
+ arc4_addrandom(entropy, nybbles/2);
+ bytes += nybbles/2;
+ }
+ evutil_memclear_(entropy, sizeof(entropy));
+ evutil_memclear_(buf, sizeof(buf));
+ arc4_seeded_ok = 1;
+ return 0;
+}
+#endif
+
+#ifndef _WIN32
+#define TRY_SEED_URANDOM
+static char *arc4random_urandom_filename = NULL;
+
+static int arc4_seed_urandom_helper_(const char *fname)
+{
+ unsigned char buf[ADD_ENTROPY];
+ int fd;
+ size_t n;
+
+ fd = evutil_open_closeonexec_(fname, O_RDONLY, 0);
+ if (fd<0)
+ return -1;
+ n = read_all(fd, buf, sizeof(buf));
+ close(fd);
+ if (n != sizeof(buf))
+ return -1;
+ arc4_addrandom(buf, sizeof(buf));
+ evutil_memclear_(buf, sizeof(buf));
+ arc4_seeded_ok = 1;
+ return 0;
+}
+
+static int
+arc4_seed_urandom(void)
+{
+ /* This is adapted from Tor's crypto_seed_rng() */
+ static const char *filenames[] = {
+ "/dev/srandom", "/dev/urandom", "/dev/random", NULL
+ };
+ int i;
+ if (arc4random_urandom_filename)
+ return arc4_seed_urandom_helper_(arc4random_urandom_filename);
+
+ for (i = 0; filenames[i]; ++i) {
+ if (arc4_seed_urandom_helper_(filenames[i]) == 0) {
+ return 0;
+ }
+ }
+
+ return -1;
+}
+#endif
+
+static int
+arc4_seed(void)
+{
+ int ok = 0;
+ /* We try every method that might work, and don't give up even if one
+ * does seem to work. There's no real harm in over-seeding, and if
+ * one of these sources turns out to be broken, that would be bad. */
+#ifdef TRY_SEED_WIN32
+ if (0 == arc4_seed_win32())
+ ok = 1;
+#endif
+#ifdef TRY_SEED_URANDOM
+ if (0 == arc4_seed_urandom())
+ ok = 1;
+#endif
+#ifdef TRY_SEED_PROC_SYS_KERNEL_RANDOM_UUID
+ if (arc4random_urandom_filename == NULL &&
+ 0 == arc4_seed_proc_sys_kernel_random_uuid())
+ ok = 1;
+#endif
+#ifdef TRY_SEED_SYSCTL_LINUX
+ /* Apparently Linux is deprecating sysctl, and spewing warning
+ * messages when you try to use it. */
+ if (!ok && 0 == arc4_seed_sysctl_linux())
+ ok = 1;
+#endif
+#ifdef TRY_SEED_SYSCTL_BSD
+ if (0 == arc4_seed_sysctl_bsd())
+ ok = 1;
+#endif
+ return ok ? 0 : -1;
+}
+
+static int
+arc4_stir(void)
+{
+ int i;
+
+ if (!rs_initialized) {
+ arc4_init();
+ rs_initialized = 1;
+ }
+
+ arc4_seed();
+ if (!arc4_seeded_ok)
+ return -1;
+
+ /*
+ * Discard early keystream, as per recommendations in
+ * "Weaknesses in the Key Scheduling Algorithm of RC4" by
+ * Scott Fluhrer, Itsik Mantin, and Adi Shamir.
+ * http://www.wisdom.weizmann.ac.il/~itsik/RC4/Papers/Rc4_ksa.ps
+ *
+ * Ilya Mironov's "(Not So) Random Shuffles of RC4" suggests that
+ * we drop at least 2*256 bytes, with 12*256 as a conservative
+ * value.
+ *
+ * RFC4345 says to drop 6*256.
+ *
+ * At least some versions of this code drop 4*256, in a mistaken
+ * belief that "words" in the Fluhrer/Mantin/Shamir paper refers
+ * to processor words.
+ *
+ * We add another sect to the cargo cult, and choose 12*256.
+ */
+ for (i = 0; i < 12*256; i++)
+ (void)arc4_getbyte();
+
+ arc4_count = BYTES_BEFORE_RESEED;
+
+ return 0;
+}
+
+
+static void
+arc4_stir_if_needed(void)
+{
+ pid_t pid = getpid();
+
+ if (arc4_count <= 0 || !rs_initialized || arc4_stir_pid != pid)
+ {
+ arc4_stir_pid = pid;
+ arc4_stir();
+ }
+}
+
+static inline unsigned char
+arc4_getbyte(void)
+{
+ unsigned char si, sj;
+
+ rs.i = (rs.i + 1);
+ si = rs.s[rs.i];
+ rs.j = (rs.j + si);
+ sj = rs.s[rs.j];
+ rs.s[rs.i] = sj;
+ rs.s[rs.j] = si;
+ return (rs.s[(si + sj) & 0xff]);
+}
+
+static inline unsigned int
+arc4_getword(void)
+{
+ unsigned int val;
+
+ val = arc4_getbyte() << 24;
+ val |= arc4_getbyte() << 16;
+ val |= arc4_getbyte() << 8;
+ val |= arc4_getbyte();
+
+ return val;
+}
+
+#ifndef ARC4RANDOM_NOSTIR
+ARC4RANDOM_EXPORT int
+arc4random_stir(void)
+{
+ int val;
+ ARC4_LOCK_();
+ val = arc4_stir();
+ ARC4_UNLOCK_();
+ return val;
+}
+#endif
+
+#ifndef ARC4RANDOM_NOADDRANDOM
+ARC4RANDOM_EXPORT void
+arc4random_addrandom(const unsigned char *dat, int datlen)
+{
+ int j;
+ ARC4_LOCK_();
+ if (!rs_initialized)
+ arc4_stir();
+ for (j = 0; j < datlen; j += 256) {
+ /* arc4_addrandom() ignores all but the first 256 bytes of
+ * its input. We want to make sure to look at ALL the
+ * data in 'dat', just in case the user is doing something
+ * crazy like passing us all the files in /var/log. */
+ arc4_addrandom(dat + j, datlen - j);
+ }
+ ARC4_UNLOCK_();
+}
+#endif
+
+#ifndef ARC4RANDOM_NORANDOM
+ARC4RANDOM_EXPORT ARC4RANDOM_UINT32
+arc4random(void)
+{
+ ARC4RANDOM_UINT32 val;
+ ARC4_LOCK_();
+ arc4_count -= 4;
+ arc4_stir_if_needed();
+ val = arc4_getword();
+ ARC4_UNLOCK_();
+ return val;
+}
+#endif
+
+ARC4RANDOM_EXPORT void
+arc4random_buf(void *buf_, size_t n)
+{
+ unsigned char *buf = buf_;
+ ARC4_LOCK_();
+ arc4_stir_if_needed();
+ while (n--) {
+ if (--arc4_count <= 0)
+ arc4_stir();
+ buf[n] = arc4_getbyte();
+ }
+ ARC4_UNLOCK_();
+}
+
+#ifndef ARC4RANDOM_NOUNIFORM
+/*
+ * Calculate a uniformly distributed random number less than upper_bound
+ * avoiding "modulo bias".
+ *
+ * Uniformity is achieved by generating new random numbers until the one
+ * returned is outside the range [0, 2**32 % upper_bound). This
+ * guarantees the selected random number will be inside
+ * [2**32 % upper_bound, 2**32) which maps back to [0, upper_bound)
+ * after reduction modulo upper_bound.
+ */
+ARC4RANDOM_EXPORT unsigned int
+arc4random_uniform(unsigned int upper_bound)
+{
+ ARC4RANDOM_UINT32 r, min;
+
+ if (upper_bound < 2)
+ return 0;
+
+#if (UINT_MAX > 0xffffffffUL)
+ min = 0x100000000UL % upper_bound;
+#else
+ /* Calculate (2**32 % upper_bound) avoiding 64-bit math */
+ if (upper_bound > 0x80000000)
+ min = 1 + ~upper_bound; /* 2**32 - upper_bound */
+ else {
+ /* (2**32 - (x * 2)) % x == 2**32 % x when x <= 2**31 */
+ min = ((0xffffffff - (upper_bound * 2)) + 1) % upper_bound;
+ }
+#endif
+
+ /*
+ * This could theoretically loop forever but each retry has
+ * p > 0.5 (worst case, usually far better) of selecting a
+ * number inside the range we need, so it should rarely need
+ * to re-roll.
+ */
+ for (;;) {
+ r = arc4random();
+ if (r >= min)
+ break;
+ }
+
+ return r % upper_bound;
+}
+#endif
diff --git a/protocols/Telegram/tgl/libevent/autogen.sh b/protocols/Telegram/tgl/libevent/autogen.sh
new file mode 100644
index 0000000000..57eeb940b9
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/autogen.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+if [ -x "`which autoreconf 2>/dev/null`" ] ; then
+ exec autoreconf -ivf
+fi
+
+LIBTOOLIZE=libtoolize
+SYSNAME=`uname`
+if [ "x$SYSNAME" = "xDarwin" ] ; then
+ LIBTOOLIZE=glibtoolize
+fi
+aclocal -I m4 && \
+ autoheader && \
+ $LIBTOOLIZE && \
+ autoconf && \
+ automake --add-missing --force-missing --copy
diff --git a/protocols/Telegram/tgl/libevent/buffer.c b/protocols/Telegram/tgl/libevent/buffer.c
new file mode 100644
index 0000000000..7cca0e8a7d
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/buffer.c
@@ -0,0 +1,3439 @@
+/*
+ * Copyright (c) 2002-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#include <io.h>
+#endif
+
+#ifdef EVENT__HAVE_VASPRINTF
+/* If we have vasprintf, we need to define _GNU_SOURCE before we include
+ * stdio.h. This comes from evconfig-private.h.
+ */
+#endif
+
+#include <sys/types.h>
+
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#ifdef EVENT__HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+#ifdef EVENT__HAVE_SYS_UIO_H
+#include <sys/uio.h>
+#endif
+
+#ifdef EVENT__HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+
+#ifdef EVENT__HAVE_SYS_MMAN_H
+#include <sys/mman.h>
+#endif
+
+#ifdef EVENT__HAVE_SYS_SENDFILE_H
+#include <sys/sendfile.h>
+#endif
+#ifdef EVENT__HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef EVENT__HAVE_STDARG_H
+#include <stdarg.h>
+#endif
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <limits.h>
+
+#include "event2/event.h"
+#include "event2/buffer.h"
+#include "event2/buffer_compat.h"
+#include "event2/bufferevent.h"
+#include "event2/bufferevent_compat.h"
+#include "event2/bufferevent_struct.h"
+#include "event2/thread.h"
+#include "log-internal.h"
+#include "mm-internal.h"
+#include "util-internal.h"
+#include "evthread-internal.h"
+#include "evbuffer-internal.h"
+#include "bufferevent-internal.h"
+
+/* some systems do not have MAP_FAILED */
+#ifndef MAP_FAILED
+#define MAP_FAILED ((void *)-1)
+#endif
+
+/* send file support */
+#if defined(EVENT__HAVE_SYS_SENDFILE_H) && defined(EVENT__HAVE_SENDFILE) && defined(__linux__)
+#define USE_SENDFILE 1
+#define SENDFILE_IS_LINUX 1
+#elif defined(EVENT__HAVE_SENDFILE) && defined(__FreeBSD__)
+#define USE_SENDFILE 1
+#define SENDFILE_IS_FREEBSD 1
+#elif defined(EVENT__HAVE_SENDFILE) && defined(__APPLE__)
+#define USE_SENDFILE 1
+#define SENDFILE_IS_MACOSX 1
+#elif defined(EVENT__HAVE_SENDFILE) && defined(__sun__) && defined(__svr4__)
+#define USE_SENDFILE 1
+#define SENDFILE_IS_SOLARIS 1
+#endif
+
+/* Mask of user-selectable callback flags. */
+#define EVBUFFER_CB_USER_FLAGS 0xffff
+/* Mask of all internal-use-only flags. */
+#define EVBUFFER_CB_INTERNAL_FLAGS 0xffff0000
+
+/* Flag set if the callback is using the cb_obsolete function pointer */
+#define EVBUFFER_CB_OBSOLETE 0x00040000
+
+/* evbuffer_chain support */
+#define CHAIN_SPACE_PTR(ch) ((ch)->buffer + (ch)->misalign + (ch)->off)
+#define CHAIN_SPACE_LEN(ch) ((ch)->flags & EVBUFFER_IMMUTABLE ? \
+ 0 : (ch)->buffer_len - ((ch)->misalign + (ch)->off))
+
+#define CHAIN_PINNED(ch) (((ch)->flags & EVBUFFER_MEM_PINNED_ANY) != 0)
+#define CHAIN_PINNED_R(ch) (((ch)->flags & EVBUFFER_MEM_PINNED_R) != 0)
+
+/* evbuffer_ptr support */
+#define PTR_NOT_FOUND(ptr) do { \
+ (ptr)->pos = -1; \
+ (ptr)->internal_.chain = NULL; \
+ (ptr)->internal_.pos_in_chain = 0; \
+} while (0)
+
+static void evbuffer_chain_align(struct evbuffer_chain *chain);
+static int evbuffer_chain_should_realign(struct evbuffer_chain *chain,
+ size_t datalen);
+static void evbuffer_deferred_callback(struct event_callback *cb, void *arg);
+static int evbuffer_ptr_memcmp(const struct evbuffer *buf,
+ const struct evbuffer_ptr *pos, const char *mem, size_t len);
+static struct evbuffer_chain *evbuffer_expand_singlechain(struct evbuffer *buf,
+ size_t datlen);
+static int evbuffer_ptr_subtract(struct evbuffer *buf, struct evbuffer_ptr *pos,
+ size_t howfar);
+static int evbuffer_file_segment_materialize(struct evbuffer_file_segment *seg);
+static inline void evbuffer_chain_incref(struct evbuffer_chain *chain);
+
+static struct evbuffer_chain *
+evbuffer_chain_new(size_t size)
+{
+ struct evbuffer_chain *chain;
+ size_t to_alloc;
+
+ if (size > EVBUFFER_CHAIN_MAX - EVBUFFER_CHAIN_SIZE)
+ return (NULL);
+
+ size += EVBUFFER_CHAIN_SIZE;
+
+ /* get the next largest memory that can hold the buffer */
+ if (size < EVBUFFER_CHAIN_MAX / 2) {
+ to_alloc = MIN_BUFFER_SIZE;
+ while (to_alloc < size) {
+ to_alloc <<= 1;
+ }
+ } else {
+ to_alloc = size;
+ }
+
+ /* we get everything in one chunk */
+ if ((chain = mm_malloc(to_alloc)) == NULL)
+ return (NULL);
+
+ memset(chain, 0, EVBUFFER_CHAIN_SIZE);
+
+ chain->buffer_len = to_alloc - EVBUFFER_CHAIN_SIZE;
+
+ /* this way we can manipulate the buffer to different addresses,
+ * which is required for mmap for example.
+ */
+ chain->buffer = EVBUFFER_CHAIN_EXTRA(unsigned char, chain);
+
+ chain->refcnt = 1;
+
+ return (chain);
+}
+
+static inline void
+evbuffer_chain_free(struct evbuffer_chain *chain)
+{
+ EVUTIL_ASSERT(chain->refcnt > 0);
+ if (--chain->refcnt > 0) {
+ /* chain is still referenced by other chains */
+ return;
+ }
+
+ if (CHAIN_PINNED(chain)) {
+ /* will get freed once no longer dangling */
+ chain->refcnt++;
+ chain->flags |= EVBUFFER_DANGLING;
+ return;
+ }
+
+ /* safe to release chain, it's either a referencing
+ * chain or all references to it have been freed */
+ if (chain->flags & EVBUFFER_REFERENCE) {
+ struct evbuffer_chain_reference *info =
+ EVBUFFER_CHAIN_EXTRA(
+ struct evbuffer_chain_reference,
+ chain);
+ if (info->cleanupfn)
+ (*info->cleanupfn)(chain->buffer,
+ chain->buffer_len,
+ info->extra);
+ }
+ if (chain->flags & EVBUFFER_FILESEGMENT) {
+ struct evbuffer_chain_file_segment *info =
+ EVBUFFER_CHAIN_EXTRA(
+ struct evbuffer_chain_file_segment,
+ chain);
+ if (info->segment) {
+#ifdef _WIN32
+ if (info->segment->is_mapping)
+ UnmapViewOfFile(chain->buffer);
+#endif
+ evbuffer_file_segment_free(info->segment);
+ }
+ }
+ if (chain->flags & EVBUFFER_MULTICAST) {
+ struct evbuffer_multicast_parent *info =
+ EVBUFFER_CHAIN_EXTRA(
+ struct evbuffer_multicast_parent,
+ chain);
+ /* referencing chain is being freed, decrease
+ * refcounts of source chain and associated
+ * evbuffer (which get freed once both reach
+ * zero) */
+ EVUTIL_ASSERT(info->source != NULL);
+ EVUTIL_ASSERT(info->parent != NULL);
+ EVBUFFER_LOCK(info->source);
+ evbuffer_chain_free(info->parent);
+ evbuffer_decref_and_unlock_(info->source);
+ }
+
+ mm_free(chain);
+}
+
+static void
+evbuffer_free_all_chains(struct evbuffer_chain *chain)
+{
+ struct evbuffer_chain *next;
+ for (; chain; chain = next) {
+ next = chain->next;
+ evbuffer_chain_free(chain);
+ }
+}
+
+#ifndef NDEBUG
+static int
+evbuffer_chains_all_empty(struct evbuffer_chain *chain)
+{
+ for (; chain; chain = chain->next) {
+ if (chain->off)
+ return 0;
+ }
+ return 1;
+}
+#else
+/* The definition is needed for EVUTIL_ASSERT, which uses sizeof to avoid
+"unused variable" warnings. */
+static inline int evbuffer_chains_all_empty(struct evbuffer_chain *chain) {
+ return 1;
+}
+#endif
+
+/* Free all trailing chains in 'buf' that are neither pinned nor empty, prior
+ * to replacing them all with a new chain. Return a pointer to the place
+ * where the new chain will go.
+ *
+ * Internal; requires lock. The caller must fix up buf->last and buf->first
+ * as needed; they might have been freed.
+ */
+static struct evbuffer_chain **
+evbuffer_free_trailing_empty_chains(struct evbuffer *buf)
+{
+ struct evbuffer_chain **ch = buf->last_with_datap;
+ /* Find the first victim chain. It might be *last_with_datap */
+ while ((*ch) && ((*ch)->off != 0 || CHAIN_PINNED(*ch)))
+ ch = &(*ch)->next;
+ if (*ch) {
+ EVUTIL_ASSERT(evbuffer_chains_all_empty(*ch));
+ evbuffer_free_all_chains(*ch);
+ *ch = NULL;
+ }
+ return ch;
+}
+
+/* Add a single chain 'chain' to the end of 'buf', freeing trailing empty
+ * chains as necessary. Requires lock. Does not schedule callbacks.
+ */
+static void
+evbuffer_chain_insert(struct evbuffer *buf,
+ struct evbuffer_chain *chain)
+{
+ ASSERT_EVBUFFER_LOCKED(buf);
+ if (*buf->last_with_datap == NULL) {
+ /* There are no chains data on the buffer at all. */
+ EVUTIL_ASSERT(buf->last_with_datap == &buf->first);
+ EVUTIL_ASSERT(buf->first == NULL);
+ buf->first = buf->last = chain;
+ } else {
+ struct evbuffer_chain **chp;
+ chp = evbuffer_free_trailing_empty_chains(buf);
+ *chp = chain;
+ if (chain->off)
+ buf->last_with_datap = chp;
+ buf->last = chain;
+ }
+ buf->total_len += chain->off;
+}
+
+static inline struct evbuffer_chain *
+evbuffer_chain_insert_new(struct evbuffer *buf, size_t datlen)
+{
+ struct evbuffer_chain *chain;
+ if ((chain = evbuffer_chain_new(datlen)) == NULL)
+ return NULL;
+ evbuffer_chain_insert(buf, chain);
+ return chain;
+}
+
+void
+evbuffer_chain_pin_(struct evbuffer_chain *chain, unsigned flag)
+{
+ EVUTIL_ASSERT((chain->flags & flag) == 0);
+ chain->flags |= flag;
+}
+
+void
+evbuffer_chain_unpin_(struct evbuffer_chain *chain, unsigned flag)
+{
+ EVUTIL_ASSERT((chain->flags & flag) != 0);
+ chain->flags &= ~flag;
+ if (chain->flags & EVBUFFER_DANGLING)
+ evbuffer_chain_free(chain);
+}
+
+static inline void
+evbuffer_chain_incref(struct evbuffer_chain *chain)
+{
+ ++chain->refcnt;
+}
+
+struct evbuffer *
+evbuffer_new(void)
+{
+ struct evbuffer *buffer;
+
+ buffer = mm_calloc(1, sizeof(struct evbuffer));
+ if (buffer == NULL)
+ return (NULL);
+
+ LIST_INIT(&buffer->callbacks);
+ buffer->refcnt = 1;
+ buffer->last_with_datap = &buffer->first;
+
+ return (buffer);
+}
+
+int
+evbuffer_set_flags(struct evbuffer *buf, ev_uint64_t flags)
+{
+ EVBUFFER_LOCK(buf);
+ buf->flags |= (ev_uint32_t)flags;
+ EVBUFFER_UNLOCK(buf);
+ return 0;
+}
+
+int
+evbuffer_clear_flags(struct evbuffer *buf, ev_uint64_t flags)
+{
+ EVBUFFER_LOCK(buf);
+ buf->flags &= ~(ev_uint32_t)flags;
+ EVBUFFER_UNLOCK(buf);
+ return 0;
+}
+
+void
+evbuffer_incref_(struct evbuffer *buf)
+{
+ EVBUFFER_LOCK(buf);
+ ++buf->refcnt;
+ EVBUFFER_UNLOCK(buf);
+}
+
+void
+evbuffer_incref_and_lock_(struct evbuffer *buf)
+{
+ EVBUFFER_LOCK(buf);
+ ++buf->refcnt;
+}
+
+int
+evbuffer_defer_callbacks(struct evbuffer *buffer, struct event_base *base)
+{
+ EVBUFFER_LOCK(buffer);
+ buffer->cb_queue = base;
+ buffer->deferred_cbs = 1;
+ event_deferred_cb_init_(&buffer->deferred,
+ event_base_get_npriorities(base) / 2,
+ evbuffer_deferred_callback, buffer);
+ EVBUFFER_UNLOCK(buffer);
+ return 0;
+}
+
+int
+evbuffer_enable_locking(struct evbuffer *buf, void *lock)
+{
+#ifdef EVENT__DISABLE_THREAD_SUPPORT
+ return -1;
+#else
+ if (buf->lock)
+ return -1;
+
+ if (!lock) {
+ EVTHREAD_ALLOC_LOCK(lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+ if (!lock)
+ return -1;
+ buf->lock = lock;
+ buf->own_lock = 1;
+ } else {
+ buf->lock = lock;
+ buf->own_lock = 0;
+ }
+
+ return 0;
+#endif
+}
+
+void
+evbuffer_set_parent_(struct evbuffer *buf, struct bufferevent *bev)
+{
+ EVBUFFER_LOCK(buf);
+ buf->parent = bev;
+ EVBUFFER_UNLOCK(buf);
+}
+
+static void
+evbuffer_run_callbacks(struct evbuffer *buffer, int running_deferred)
+{
+ struct evbuffer_cb_entry *cbent, *next;
+ struct evbuffer_cb_info info;
+ size_t new_size;
+ ev_uint32_t mask, masked_val;
+ int clear = 1;
+
+ if (running_deferred) {
+ mask = EVBUFFER_CB_NODEFER|EVBUFFER_CB_ENABLED;
+ masked_val = EVBUFFER_CB_ENABLED;
+ } else if (buffer->deferred_cbs) {
+ mask = EVBUFFER_CB_NODEFER|EVBUFFER_CB_ENABLED;
+ masked_val = EVBUFFER_CB_NODEFER|EVBUFFER_CB_ENABLED;
+ /* Don't zero-out n_add/n_del, since the deferred callbacks
+ will want to see them. */
+ clear = 0;
+ } else {
+ mask = EVBUFFER_CB_ENABLED;
+ masked_val = EVBUFFER_CB_ENABLED;
+ }
+
+ ASSERT_EVBUFFER_LOCKED(buffer);
+
+ if (LIST_EMPTY(&buffer->callbacks)) {
+ buffer->n_add_for_cb = buffer->n_del_for_cb = 0;
+ return;
+ }
+ if (buffer->n_add_for_cb == 0 && buffer->n_del_for_cb == 0)
+ return;
+
+ new_size = buffer->total_len;
+ info.orig_size = new_size + buffer->n_del_for_cb - buffer->n_add_for_cb;
+ info.n_added = buffer->n_add_for_cb;
+ info.n_deleted = buffer->n_del_for_cb;
+ if (clear) {
+ buffer->n_add_for_cb = 0;
+ buffer->n_del_for_cb = 0;
+ }
+ for (cbent = LIST_FIRST(&buffer->callbacks);
+ cbent != LIST_END(&buffer->callbacks);
+ cbent = next) {
+ /* Get the 'next' pointer now in case this callback decides
+ * to remove itself or something. */
+ next = LIST_NEXT(cbent, next);
+
+ if ((cbent->flags & mask) != masked_val)
+ continue;
+
+ if ((cbent->flags & EVBUFFER_CB_OBSOLETE))
+ cbent->cb.cb_obsolete(buffer,
+ info.orig_size, new_size, cbent->cbarg);
+ else
+ cbent->cb.cb_func(buffer, &info, cbent->cbarg);
+ }
+}
+
+void
+evbuffer_invoke_callbacks_(struct evbuffer *buffer)
+{
+ if (LIST_EMPTY(&buffer->callbacks)) {
+ buffer->n_add_for_cb = buffer->n_del_for_cb = 0;
+ return;
+ }
+
+ if (buffer->deferred_cbs) {
+ if (event_deferred_cb_schedule_(buffer->cb_queue, &buffer->deferred)) {
+ evbuffer_incref_and_lock_(buffer);
+ if (buffer->parent)
+ bufferevent_incref_(buffer->parent);
+ }
+ EVBUFFER_UNLOCK(buffer);
+ }
+
+ evbuffer_run_callbacks(buffer, 0);
+}
+
+static void
+evbuffer_deferred_callback(struct event_callback *cb, void *arg)
+{
+ struct bufferevent *parent = NULL;
+ struct evbuffer *buffer = arg;
+
+ /* XXXX It would be better to run these callbacks without holding the
+ * lock */
+ EVBUFFER_LOCK(buffer);
+ parent = buffer->parent;
+ evbuffer_run_callbacks(buffer, 1);
+ evbuffer_decref_and_unlock_(buffer);
+ if (parent)
+ bufferevent_decref_(parent);
+}
+
+static void
+evbuffer_remove_all_callbacks(struct evbuffer *buffer)
+{
+ struct evbuffer_cb_entry *cbent;
+
+ while ((cbent = LIST_FIRST(&buffer->callbacks))) {
+ LIST_REMOVE(cbent, next);
+ mm_free(cbent);
+ }
+}
+
+void
+evbuffer_decref_and_unlock_(struct evbuffer *buffer)
+{
+ struct evbuffer_chain *chain, *next;
+ ASSERT_EVBUFFER_LOCKED(buffer);
+
+ EVUTIL_ASSERT(buffer->refcnt > 0);
+
+ if (--buffer->refcnt > 0) {
+ EVBUFFER_UNLOCK(buffer);
+ return;
+ }
+
+ for (chain = buffer->first; chain != NULL; chain = next) {
+ next = chain->next;
+ evbuffer_chain_free(chain);
+ }
+ evbuffer_remove_all_callbacks(buffer);
+ if (buffer->deferred_cbs)
+ event_deferred_cb_cancel_(buffer->cb_queue, &buffer->deferred);
+
+ EVBUFFER_UNLOCK(buffer);
+ if (buffer->own_lock)
+ EVTHREAD_FREE_LOCK(buffer->lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+ mm_free(buffer);
+}
+
+void
+evbuffer_free(struct evbuffer *buffer)
+{
+ EVBUFFER_LOCK(buffer);
+ evbuffer_decref_and_unlock_(buffer);
+}
+
+void
+evbuffer_lock(struct evbuffer *buf)
+{
+ EVBUFFER_LOCK(buf);
+}
+
+void
+evbuffer_unlock(struct evbuffer *buf)
+{
+ EVBUFFER_UNLOCK(buf);
+}
+
+size_t
+evbuffer_get_length(const struct evbuffer *buffer)
+{
+ size_t result;
+
+ EVBUFFER_LOCK(buffer);
+
+ result = (buffer->total_len);
+
+ EVBUFFER_UNLOCK(buffer);
+
+ return result;
+}
+
+size_t
+evbuffer_get_contiguous_space(const struct evbuffer *buf)
+{
+ struct evbuffer_chain *chain;
+ size_t result;
+
+ EVBUFFER_LOCK(buf);
+ chain = buf->first;
+ result = (chain != NULL ? chain->off : 0);
+ EVBUFFER_UNLOCK(buf);
+
+ return result;
+}
+
+size_t
+evbuffer_add_iovec(struct evbuffer * buf, struct evbuffer_iovec * vec, int n_vec) {
+ int n;
+ size_t res;
+ size_t to_alloc;
+
+ EVBUFFER_LOCK(buf);
+
+ res = to_alloc = 0;
+
+ for (n = 0; n < n_vec; n++) {
+ to_alloc += vec[n].iov_len;
+ }
+
+ if (evbuffer_expand_fast_(buf, to_alloc, 2) < 0) {
+ goto done;
+ }
+
+ for (n = 0; n < n_vec; n++) {
+ /* XXX each 'add' call here does a bunch of setup that's
+ * obviated by evbuffer_expand_fast_, and some cleanup that we
+ * would like to do only once. Instead we should just extract
+ * the part of the code that's needed. */
+
+ if (evbuffer_add(buf, vec[n].iov_base, vec[n].iov_len) < 0) {
+ goto done;
+ }
+
+ res += vec[n].iov_len;
+ }
+
+done:
+ EVBUFFER_UNLOCK(buf);
+ return res;
+}
+
+int
+evbuffer_reserve_space(struct evbuffer *buf, ev_ssize_t size,
+ struct evbuffer_iovec *vec, int n_vecs)
+{
+ struct evbuffer_chain *chain, **chainp;
+ int n = -1;
+
+ EVBUFFER_LOCK(buf);
+ if (buf->freeze_end)
+ goto done;
+ if (n_vecs < 1)
+ goto done;
+ if (n_vecs == 1) {
+ if ((chain = evbuffer_expand_singlechain(buf, size)) == NULL)
+ goto done;
+
+ vec[0].iov_base = CHAIN_SPACE_PTR(chain);
+ vec[0].iov_len = (size_t) CHAIN_SPACE_LEN(chain);
+ EVUTIL_ASSERT(size<0 || (size_t)vec[0].iov_len >= (size_t)size);
+ n = 1;
+ } else {
+ if (evbuffer_expand_fast_(buf, size, n_vecs)<0)
+ goto done;
+ n = evbuffer_read_setup_vecs_(buf, size, vec, n_vecs,
+ &chainp, 0);
+ }
+
+done:
+ EVBUFFER_UNLOCK(buf);
+ return n;
+
+}
+
+static int
+advance_last_with_data(struct evbuffer *buf)
+{
+ int n = 0;
+ ASSERT_EVBUFFER_LOCKED(buf);
+
+ if (!*buf->last_with_datap)
+ return 0;
+
+ while ((*buf->last_with_datap)->next && (*buf->last_with_datap)->next->off) {
+ buf->last_with_datap = &(*buf->last_with_datap)->next;
+ ++n;
+ }
+ return n;
+}
+
+int
+evbuffer_commit_space(struct evbuffer *buf,
+ struct evbuffer_iovec *vec, int n_vecs)
+{
+ struct evbuffer_chain *chain, **firstchainp, **chainp;
+ int result = -1;
+ size_t added = 0;
+ int i;
+
+ EVBUFFER_LOCK(buf);
+
+ if (buf->freeze_end)
+ goto done;
+ if (n_vecs == 0) {
+ result = 0;
+ goto done;
+ } else if (n_vecs == 1 &&
+ (buf->last && vec[0].iov_base == (void*)CHAIN_SPACE_PTR(buf->last))) {
+ /* The user only got or used one chain; it might not
+ * be the first one with space in it. */
+ if ((size_t)vec[0].iov_len > (size_t)CHAIN_SPACE_LEN(buf->last))
+ goto done;
+ buf->last->off += vec[0].iov_len;
+ added = vec[0].iov_len;
+ if (added)
+ advance_last_with_data(buf);
+ goto okay;
+ }
+
+ /* Advance 'firstchain' to the first chain with space in it. */
+ firstchainp = buf->last_with_datap;
+ if (!*firstchainp)
+ goto done;
+ if (CHAIN_SPACE_LEN(*firstchainp) == 0) {
+ firstchainp = &(*firstchainp)->next;
+ }
+
+ chain = *firstchainp;
+ /* pass 1: make sure that the pointers and lengths of vecs[] are in
+ * bounds before we try to commit anything. */
+ for (i=0; i<n_vecs; ++i) {
+ if (!chain)
+ goto done;
+ if (vec[i].iov_base != (void*)CHAIN_SPACE_PTR(chain) ||
+ (size_t)vec[i].iov_len > CHAIN_SPACE_LEN(chain))
+ goto done;
+ chain = chain->next;
+ }
+ /* pass 2: actually adjust all the chains. */
+ chainp = firstchainp;
+ for (i=0; i<n_vecs; ++i) {
+ (*chainp)->off += vec[i].iov_len;
+ added += vec[i].iov_len;
+ if (vec[i].iov_len) {
+ buf->last_with_datap = chainp;
+ }
+ chainp = &(*chainp)->next;
+ }
+
+okay:
+ buf->total_len += added;
+ buf->n_add_for_cb += added;
+ result = 0;
+ evbuffer_invoke_callbacks_(buf);
+
+done:
+ EVBUFFER_UNLOCK(buf);
+ return result;
+}
+
+static inline int
+HAS_PINNED_R(struct evbuffer *buf)
+{
+ return (buf->last && CHAIN_PINNED_R(buf->last));
+}
+
+static inline void
+ZERO_CHAIN(struct evbuffer *dst)
+{
+ ASSERT_EVBUFFER_LOCKED(dst);
+ dst->first = NULL;
+ dst->last = NULL;
+ dst->last_with_datap = &(dst)->first;
+ dst->total_len = 0;
+}
+
+/* Prepares the contents of src to be moved to another buffer by removing
+ * read-pinned chains. The first pinned chain is saved in first, and the
+ * last in last. If src has no read-pinned chains, first and last are set
+ * to NULL. */
+static int
+PRESERVE_PINNED(struct evbuffer *src, struct evbuffer_chain **first,
+ struct evbuffer_chain **last)
+{
+ struct evbuffer_chain *chain, **pinned;
+
+ ASSERT_EVBUFFER_LOCKED(src);
+
+ if (!HAS_PINNED_R(src)) {
+ *first = *last = NULL;
+ return 0;
+ }
+
+ pinned = src->last_with_datap;
+ if (!CHAIN_PINNED_R(*pinned))
+ pinned = &(*pinned)->next;
+ EVUTIL_ASSERT(CHAIN_PINNED_R(*pinned));
+ chain = *first = *pinned;
+ *last = src->last;
+
+ /* If there's data in the first pinned chain, we need to allocate
+ * a new chain and copy the data over. */
+ if (chain->off) {
+ struct evbuffer_chain *tmp;
+
+ EVUTIL_ASSERT(pinned == src->last_with_datap);
+ tmp = evbuffer_chain_new(chain->off);
+ if (!tmp)
+ return -1;
+ memcpy(tmp->buffer, chain->buffer + chain->misalign,
+ chain->off);
+ tmp->off = chain->off;
+ *src->last_with_datap = tmp;
+ src->last = tmp;
+ chain->misalign += chain->off;
+ chain->off = 0;
+ } else {
+ src->last = *src->last_with_datap;
+ *pinned = NULL;
+ }
+
+ return 0;
+}
+
+static inline void
+RESTORE_PINNED(struct evbuffer *src, struct evbuffer_chain *pinned,
+ struct evbuffer_chain *last)
+{
+ ASSERT_EVBUFFER_LOCKED(src);
+
+ if (!pinned) {
+ ZERO_CHAIN(src);
+ return;
+ }
+
+ src->first = pinned;
+ src->last = last;
+ src->last_with_datap = &src->first;
+ src->total_len = 0;
+}
+
+static inline void
+COPY_CHAIN(struct evbuffer *dst, struct evbuffer *src)
+{
+ ASSERT_EVBUFFER_LOCKED(dst);
+ ASSERT_EVBUFFER_LOCKED(src);
+ dst->first = src->first;
+ if (src->last_with_datap == &src->first)
+ dst->last_with_datap = &dst->first;
+ else
+ dst->last_with_datap = src->last_with_datap;
+ dst->last = src->last;
+ dst->total_len = src->total_len;
+}
+
+static void
+APPEND_CHAIN(struct evbuffer *dst, struct evbuffer *src)
+{
+ ASSERT_EVBUFFER_LOCKED(dst);
+ ASSERT_EVBUFFER_LOCKED(src);
+ dst->last->next = src->first;
+ if (src->last_with_datap == &src->first)
+ dst->last_with_datap = &dst->last->next;
+ else
+ dst->last_with_datap = src->last_with_datap;
+ dst->last = src->last;
+ dst->total_len += src->total_len;
+}
+
+static inline void
+APPEND_CHAIN_MULTICAST(struct evbuffer *dst, struct evbuffer *src)
+{
+ struct evbuffer_chain *tmp;
+ struct evbuffer_chain *chain = src->first;
+ struct evbuffer_multicast_parent *extra;
+
+ ASSERT_EVBUFFER_LOCKED(dst);
+ ASSERT_EVBUFFER_LOCKED(src);
+
+ for (; chain; chain = chain->next) {
+ if (!chain->off || chain->flags & EVBUFFER_DANGLING) {
+ /* skip empty chains */
+ continue;
+ }
+
+ tmp = evbuffer_chain_new(sizeof(struct evbuffer_multicast_parent));
+ if (!tmp) {
+ event_warn("%s: out of memory", __func__);
+ return;
+ }
+ extra = EVBUFFER_CHAIN_EXTRA(struct evbuffer_multicast_parent, tmp);
+ /* reference evbuffer containing source chain so it
+ * doesn't get released while the chain is still
+ * being referenced to */
+ evbuffer_incref_(src);
+ extra->source = src;
+ /* reference source chain which now becomes immutable */
+ evbuffer_chain_incref(chain);
+ extra->parent = chain;
+ chain->flags |= EVBUFFER_IMMUTABLE;
+ tmp->buffer_len = chain->buffer_len;
+ tmp->misalign = chain->misalign;
+ tmp->off = chain->off;
+ tmp->flags |= EVBUFFER_MULTICAST|EVBUFFER_IMMUTABLE;
+ tmp->buffer = chain->buffer;
+ evbuffer_chain_insert(dst, tmp);
+ }
+}
+
+static void
+PREPEND_CHAIN(struct evbuffer *dst, struct evbuffer *src)
+{
+ ASSERT_EVBUFFER_LOCKED(dst);
+ ASSERT_EVBUFFER_LOCKED(src);
+ src->last->next = dst->first;
+ dst->first = src->first;
+ dst->total_len += src->total_len;
+ if (*dst->last_with_datap == NULL) {
+ if (src->last_with_datap == &(src)->first)
+ dst->last_with_datap = &dst->first;
+ else
+ dst->last_with_datap = src->last_with_datap;
+ } else if (dst->last_with_datap == &dst->first) {
+ dst->last_with_datap = &src->last->next;
+ }
+}
+
+int
+evbuffer_add_buffer(struct evbuffer *outbuf, struct evbuffer *inbuf)
+{
+ struct evbuffer_chain *pinned, *last;
+ size_t in_total_len, out_total_len;
+ int result = 0;
+
+ EVBUFFER_LOCK2(inbuf, outbuf);
+ in_total_len = inbuf->total_len;
+ out_total_len = outbuf->total_len;
+
+ if (in_total_len == 0 || outbuf == inbuf)
+ goto done;
+
+ if (outbuf->freeze_end || inbuf->freeze_start) {
+ result = -1;
+ goto done;
+ }
+
+ if (PRESERVE_PINNED(inbuf, &pinned, &last) < 0) {
+ result = -1;
+ goto done;
+ }
+
+ if (out_total_len == 0) {
+ /* There might be an empty chain at the start of outbuf; free
+ * it. */
+ evbuffer_free_all_chains(outbuf->first);
+ COPY_CHAIN(outbuf, inbuf);
+ } else {
+ APPEND_CHAIN(outbuf, inbuf);
+ }
+
+ RESTORE_PINNED(inbuf, pinned, last);
+
+ inbuf->n_del_for_cb += in_total_len;
+ outbuf->n_add_for_cb += in_total_len;
+
+ evbuffer_invoke_callbacks_(inbuf);
+ evbuffer_invoke_callbacks_(outbuf);
+
+done:
+ EVBUFFER_UNLOCK2(inbuf, outbuf);
+ return result;
+}
+
+int
+evbuffer_add_buffer_reference(struct evbuffer *outbuf, struct evbuffer *inbuf)
+{
+ size_t in_total_len, out_total_len;
+ struct evbuffer_chain *chain;
+ int result = 0;
+
+ EVBUFFER_LOCK2(inbuf, outbuf);
+ in_total_len = inbuf->total_len;
+ out_total_len = outbuf->total_len;
+ chain = inbuf->first;
+
+ if (in_total_len == 0)
+ goto done;
+
+ if (outbuf->freeze_end || outbuf == inbuf) {
+ result = -1;
+ goto done;
+ }
+
+ for (; chain; chain = chain->next) {
+ if ((chain->flags & (EVBUFFER_FILESEGMENT|EVBUFFER_SENDFILE|EVBUFFER_MULTICAST)) != 0) {
+ /* chain type can not be referenced */
+ result = -1;
+ goto done;
+ }
+ }
+
+ if (out_total_len == 0) {
+ /* There might be an empty chain at the start of outbuf; free
+ * it. */
+ evbuffer_free_all_chains(outbuf->first);
+ }
+ APPEND_CHAIN_MULTICAST(outbuf, inbuf);
+
+ outbuf->n_add_for_cb += in_total_len;
+ evbuffer_invoke_callbacks_(outbuf);
+
+done:
+ EVBUFFER_UNLOCK2(inbuf, outbuf);
+ return result;
+}
+
+int
+evbuffer_prepend_buffer(struct evbuffer *outbuf, struct evbuffer *inbuf)
+{
+ struct evbuffer_chain *pinned, *last;
+ size_t in_total_len, out_total_len;
+ int result = 0;
+
+ EVBUFFER_LOCK2(inbuf, outbuf);
+
+ in_total_len = inbuf->total_len;
+ out_total_len = outbuf->total_len;
+
+ if (!in_total_len || inbuf == outbuf)
+ goto done;
+
+ if (outbuf->freeze_start || inbuf->freeze_start) {
+ result = -1;
+ goto done;
+ }
+
+ if (PRESERVE_PINNED(inbuf, &pinned, &last) < 0) {
+ result = -1;
+ goto done;
+ }
+
+ if (out_total_len == 0) {
+ /* There might be an empty chain at the start of outbuf; free
+ * it. */
+ evbuffer_free_all_chains(outbuf->first);
+ COPY_CHAIN(outbuf, inbuf);
+ } else {
+ PREPEND_CHAIN(outbuf, inbuf);
+ }
+
+ RESTORE_PINNED(inbuf, pinned, last);
+
+ inbuf->n_del_for_cb += in_total_len;
+ outbuf->n_add_for_cb += in_total_len;
+
+ evbuffer_invoke_callbacks_(inbuf);
+ evbuffer_invoke_callbacks_(outbuf);
+done:
+ EVBUFFER_UNLOCK2(inbuf, outbuf);
+ return result;
+}
+
+int
+evbuffer_drain(struct evbuffer *buf, size_t len)
+{
+ struct evbuffer_chain *chain, *next;
+ size_t remaining, old_len;
+ int result = 0;
+
+ EVBUFFER_LOCK(buf);
+ old_len = buf->total_len;
+
+ if (old_len == 0)
+ goto done;
+
+ if (buf->freeze_start) {
+ result = -1;
+ goto done;
+ }
+
+ if (len >= old_len && !HAS_PINNED_R(buf)) {
+ len = old_len;
+ for (chain = buf->first; chain != NULL; chain = next) {
+ next = chain->next;
+ evbuffer_chain_free(chain);
+ }
+
+ ZERO_CHAIN(buf);
+ } else {
+ if (len >= old_len)
+ len = old_len;
+
+ buf->total_len -= len;
+ remaining = len;
+ for (chain = buf->first;
+ remaining >= chain->off;
+ chain = next) {
+ next = chain->next;
+ remaining -= chain->off;
+
+ if (chain == *buf->last_with_datap) {
+ buf->last_with_datap = &buf->first;
+ }
+ if (&chain->next == buf->last_with_datap)
+ buf->last_with_datap = &buf->first;
+
+ if (CHAIN_PINNED_R(chain)) {
+ EVUTIL_ASSERT(remaining == 0);
+ chain->misalign += chain->off;
+ chain->off = 0;
+ break;
+ } else
+ evbuffer_chain_free(chain);
+ }
+
+ buf->first = chain;
+ EVUTIL_ASSERT(chain && remaining <= chain->off);
+ chain->misalign += remaining;
+ chain->off -= remaining;
+ }
+
+ buf->n_del_for_cb += len;
+ /* Tell someone about changes in this buffer */
+ evbuffer_invoke_callbacks_(buf);
+
+done:
+ EVBUFFER_UNLOCK(buf);
+ return result;
+}
+
+/* Reads data from an event buffer and drains the bytes read */
+int
+evbuffer_remove(struct evbuffer *buf, void *data_out, size_t datlen)
+{
+ ev_ssize_t n;
+ EVBUFFER_LOCK(buf);
+ n = evbuffer_copyout_from(buf, NULL, data_out, datlen);
+ if (n > 0) {
+ if (evbuffer_drain(buf, n)<0)
+ n = -1;
+ }
+ EVBUFFER_UNLOCK(buf);
+ return (int)n;
+}
+
+ev_ssize_t
+evbuffer_copyout(struct evbuffer *buf, void *data_out, size_t datlen)
+{
+ return evbuffer_copyout_from(buf, NULL, data_out, datlen);
+}
+
+ev_ssize_t
+evbuffer_copyout_from(struct evbuffer *buf, const struct evbuffer_ptr *pos,
+ void *data_out, size_t datlen)
+{
+ /*XXX fails badly on sendfile case. */
+ struct evbuffer_chain *chain;
+ char *data = data_out;
+ size_t nread;
+ ev_ssize_t result = 0;
+ size_t pos_in_chain;
+
+ EVBUFFER_LOCK(buf);
+
+ if (pos) {
+ if (datlen > (size_t)(EV_SSIZE_MAX - pos->pos)) {
+ result = -1;
+ goto done;
+ }
+ chain = pos->internal_.chain;
+ pos_in_chain = pos->internal_.pos_in_chain;
+ if (datlen + pos->pos > buf->total_len)
+ datlen = buf->total_len - pos->pos;
+ } else {
+ chain = buf->first;
+ pos_in_chain = 0;
+ if (datlen > buf->total_len)
+ datlen = buf->total_len;
+ }
+
+
+ if (datlen == 0)
+ goto done;
+
+ if (buf->freeze_start) {
+ result = -1;
+ goto done;
+ }
+
+ nread = datlen;
+
+ while (datlen && datlen >= chain->off - pos_in_chain) {
+ size_t copylen = chain->off - pos_in_chain;
+ memcpy(data,
+ chain->buffer + chain->misalign + pos_in_chain,
+ copylen);
+ data += copylen;
+ datlen -= copylen;
+
+ chain = chain->next;
+ pos_in_chain = 0;
+ EVUTIL_ASSERT(chain || datlen==0);
+ }
+
+ if (datlen) {
+ EVUTIL_ASSERT(chain);
+ EVUTIL_ASSERT(datlen+pos_in_chain <= chain->off);
+
+ memcpy(data, chain->buffer + chain->misalign + pos_in_chain,
+ datlen);
+ }
+
+ result = nread;
+done:
+ EVBUFFER_UNLOCK(buf);
+ return result;
+}
+
+/* reads data from the src buffer to the dst buffer, avoids memcpy as
+ * possible. */
+/* XXXX should return ev_ssize_t */
+int
+evbuffer_remove_buffer(struct evbuffer *src, struct evbuffer *dst,
+ size_t datlen)
+{
+ /*XXX We should have an option to force this to be zero-copy.*/
+
+ /*XXX can fail badly on sendfile case. */
+ struct evbuffer_chain *chain, *previous;
+ size_t nread = 0;
+ int result;
+
+ EVBUFFER_LOCK2(src, dst);
+
+ chain = previous = src->first;
+
+ if (datlen == 0 || dst == src) {
+ result = 0;
+ goto done;
+ }
+
+ if (dst->freeze_end || src->freeze_start) {
+ result = -1;
+ goto done;
+ }
+
+ /* short-cut if there is no more data buffered */
+ if (datlen >= src->total_len) {
+ datlen = src->total_len;
+ evbuffer_add_buffer(dst, src);
+ result = (int)datlen; /*XXXX should return ev_ssize_t*/
+ goto done;
+ }
+
+ /* removes chains if possible */
+ while (chain->off <= datlen) {
+ /* We can't remove the last with data from src unless we
+ * remove all chains, in which case we would have done the if
+ * block above */
+ EVUTIL_ASSERT(chain != *src->last_with_datap);
+ nread += chain->off;
+ datlen -= chain->off;
+ previous = chain;
+ if (src->last_with_datap == &chain->next)
+ src->last_with_datap = &src->first;
+ chain = chain->next;
+ }
+
+ if (nread) {
+ /* we can remove the chain */
+ struct evbuffer_chain **chp;
+ chp = evbuffer_free_trailing_empty_chains(dst);
+
+ if (dst->first == NULL) {
+ dst->first = src->first;
+ } else {
+ *chp = src->first;
+ }
+ dst->last = previous;
+ previous->next = NULL;
+ src->first = chain;
+ advance_last_with_data(dst);
+
+ dst->total_len += nread;
+ dst->n_add_for_cb += nread;
+ }
+
+ /* we know that there is more data in the src buffer than
+ * we want to read, so we manually drain the chain */
+ evbuffer_add(dst, chain->buffer + chain->misalign, datlen);
+ chain->misalign += datlen;
+ chain->off -= datlen;
+ nread += datlen;
+
+ /* You might think we would want to increment dst->n_add_for_cb
+ * here too. But evbuffer_add above already took care of that.
+ */
+ src->total_len -= nread;
+ src->n_del_for_cb += nread;
+
+ if (nread) {
+ evbuffer_invoke_callbacks_(dst);
+ evbuffer_invoke_callbacks_(src);
+ }
+ result = (int)nread;/*XXXX should change return type */
+
+done:
+ EVBUFFER_UNLOCK2(src, dst);
+ return result;
+}
+
+unsigned char *
+evbuffer_pullup(struct evbuffer *buf, ev_ssize_t size)
+{
+ struct evbuffer_chain *chain, *next, *tmp, *last_with_data;
+ unsigned char *buffer, *result = NULL;
+ ev_ssize_t remaining;
+ int removed_last_with_data = 0;
+ int removed_last_with_datap = 0;
+
+ EVBUFFER_LOCK(buf);
+
+ chain = buf->first;
+
+ if (size < 0)
+ size = buf->total_len;
+ /* if size > buf->total_len, we cannot guarantee to the user that she
+ * is going to have a long enough buffer afterwards; so we return
+ * NULL */
+ if (size == 0 || (size_t)size > buf->total_len)
+ goto done;
+
+ /* No need to pull up anything; the first size bytes are
+ * already here. */
+ if (chain->off >= (size_t)size) {
+ result = chain->buffer + chain->misalign;
+ goto done;
+ }
+
+ /* Make sure that none of the chains we need to copy from is pinned. */
+ remaining = size - chain->off;
+ EVUTIL_ASSERT(remaining >= 0);
+ for (tmp=chain->next; tmp; tmp=tmp->next) {
+ if (CHAIN_PINNED(tmp))
+ goto done;
+ if (tmp->off >= (size_t)remaining)
+ break;
+ remaining -= tmp->off;
+ }
+
+ if (CHAIN_PINNED(chain)) {
+ size_t old_off = chain->off;
+ if (CHAIN_SPACE_LEN(chain) < size - chain->off) {
+ /* not enough room at end of chunk. */
+ goto done;
+ }
+ buffer = CHAIN_SPACE_PTR(chain);
+ tmp = chain;
+ tmp->off = size;
+ size -= old_off;
+ chain = chain->next;
+ } else if (chain->buffer_len - chain->misalign >= (size_t)size) {
+ /* already have enough space in the first chain */
+ size_t old_off = chain->off;
+ buffer = chain->buffer + chain->misalign + chain->off;
+ tmp = chain;
+ tmp->off = size;
+ size -= old_off;
+ chain = chain->next;
+ } else {
+ if ((tmp = evbuffer_chain_new(size)) == NULL) {
+ event_warn("%s: out of memory", __func__);
+ goto done;
+ }
+ buffer = tmp->buffer;
+ tmp->off = size;
+ buf->first = tmp;
+ }
+
+ /* TODO(niels): deal with buffers that point to NULL like sendfile */
+
+ /* Copy and free every chunk that will be entirely pulled into tmp */
+ last_with_data = *buf->last_with_datap;
+ for (; chain != NULL && (size_t)size >= chain->off; chain = next) {
+ next = chain->next;
+
+ memcpy(buffer, chain->buffer + chain->misalign, chain->off);
+ size -= chain->off;
+ buffer += chain->off;
+ if (chain == last_with_data)
+ removed_last_with_data = 1;
+ if (&chain->next == buf->last_with_datap)
+ removed_last_with_datap = 1;
+
+ evbuffer_chain_free(chain);
+ }
+
+ if (chain != NULL) {
+ memcpy(buffer, chain->buffer + chain->misalign, size);
+ chain->misalign += size;
+ chain->off -= size;
+ } else {
+ buf->last = tmp;
+ }
+
+ tmp->next = chain;
+
+ if (removed_last_with_data) {
+ buf->last_with_datap = &buf->first;
+ } else if (removed_last_with_datap) {
+ if (buf->first->next && buf->first->next->off)
+ buf->last_with_datap = &buf->first->next;
+ else
+ buf->last_with_datap = &buf->first;
+ }
+
+ result = (tmp->buffer + tmp->misalign);
+
+done:
+ EVBUFFER_UNLOCK(buf);
+ return result;
+}
+
+/*
+ * Reads a line terminated by either '\r\n', '\n\r' or '\r' or '\n'.
+ * The returned buffer needs to be freed by the called.
+ */
+char *
+evbuffer_readline(struct evbuffer *buffer)
+{
+ return evbuffer_readln(buffer, NULL, EVBUFFER_EOL_ANY);
+}
+
+static inline ev_ssize_t
+evbuffer_strchr(struct evbuffer_ptr *it, const char chr)
+{
+ struct evbuffer_chain *chain = it->internal_.chain;
+ size_t i = it->internal_.pos_in_chain;
+ while (chain != NULL) {
+ char *buffer = (char *)chain->buffer + chain->misalign;
+ char *cp = memchr(buffer+i, chr, chain->off-i);
+ if (cp) {
+ it->internal_.chain = chain;
+ it->internal_.pos_in_chain = cp - buffer;
+ it->pos += (cp - buffer - i);
+ return it->pos;
+ }
+ it->pos += chain->off - i;
+ i = 0;
+ chain = chain->next;
+ }
+
+ return (-1);
+}
+
+static inline char *
+find_eol_char(char *s, size_t len)
+{
+#define CHUNK_SZ 128
+ /* Lots of benchmarking found this approach to be faster in practice
+ * than doing two memchrs over the whole buffer, doin a memchr on each
+ * char of the buffer, or trying to emulate memchr by hand. */
+ char *s_end, *cr, *lf;
+ s_end = s+len;
+ while (s < s_end) {
+ size_t chunk = (s + CHUNK_SZ < s_end) ? CHUNK_SZ : (s_end - s);
+ cr = memchr(s, '\r', chunk);
+ lf = memchr(s, '\n', chunk);
+ if (cr) {
+ if (lf && lf < cr)
+ return lf;
+ return cr;
+ } else if (lf) {
+ return lf;
+ }
+ s += CHUNK_SZ;
+ }
+
+ return NULL;
+#undef CHUNK_SZ
+}
+
+static ev_ssize_t
+evbuffer_find_eol_char(struct evbuffer_ptr *it)
+{
+ struct evbuffer_chain *chain = it->internal_.chain;
+ size_t i = it->internal_.pos_in_chain;
+ while (chain != NULL) {
+ char *buffer = (char *)chain->buffer + chain->misalign;
+ char *cp = find_eol_char(buffer+i, chain->off-i);
+ if (cp) {
+ it->internal_.chain = chain;
+ it->internal_.pos_in_chain = cp - buffer;
+ it->pos += (cp - buffer) - i;
+ return it->pos;
+ }
+ it->pos += chain->off - i;
+ i = 0;
+ chain = chain->next;
+ }
+
+ return (-1);
+}
+
+static inline int
+evbuffer_strspn(
+ struct evbuffer_ptr *ptr, const char *chrset)
+{
+ int count = 0;
+ struct evbuffer_chain *chain = ptr->internal_.chain;
+ size_t i = ptr->internal_.pos_in_chain;
+
+ if (!chain)
+ return 0;
+
+ while (1) {
+ char *buffer = (char *)chain->buffer + chain->misalign;
+ for (; i < chain->off; ++i) {
+ const char *p = chrset;
+ while (*p) {
+ if (buffer[i] == *p++)
+ goto next;
+ }
+ ptr->internal_.chain = chain;
+ ptr->internal_.pos_in_chain = i;
+ ptr->pos += count;
+ return count;
+ next:
+ ++count;
+ }
+ i = 0;
+
+ if (! chain->next) {
+ ptr->internal_.chain = chain;
+ ptr->internal_.pos_in_chain = i;
+ ptr->pos += count;
+ return count;
+ }
+
+ chain = chain->next;
+ }
+}
+
+
+static inline int
+evbuffer_getchr(struct evbuffer_ptr *it)
+{
+ struct evbuffer_chain *chain = it->internal_.chain;
+ size_t off = it->internal_.pos_in_chain;
+
+ if (chain == NULL)
+ return -1;
+
+ return (unsigned char)chain->buffer[chain->misalign + off];
+}
+
+struct evbuffer_ptr
+evbuffer_search_eol(struct evbuffer *buffer,
+ struct evbuffer_ptr *start, size_t *eol_len_out,
+ enum evbuffer_eol_style eol_style)
+{
+ struct evbuffer_ptr it, it2;
+ size_t extra_drain = 0;
+ int ok = 0;
+
+ /* Avoid locking in trivial edge cases */
+ if (start && start->internal_.chain == NULL) {
+ PTR_NOT_FOUND(&it);
+ if (eol_len_out)
+ *eol_len_out = extra_drain;
+ return it;
+ }
+
+ EVBUFFER_LOCK(buffer);
+
+ if (start) {
+ memcpy(&it, start, sizeof(it));
+ } else {
+ it.pos = 0;
+ it.internal_.chain = buffer->first;
+ it.internal_.pos_in_chain = 0;
+ }
+
+ /* the eol_style determines our first stop character and how many
+ * characters we are going to drain afterwards. */
+ switch (eol_style) {
+ case EVBUFFER_EOL_ANY:
+ if (evbuffer_find_eol_char(&it) < 0)
+ goto done;
+ memcpy(&it2, &it, sizeof(it));
+ extra_drain = evbuffer_strspn(&it2, "\r\n");
+ break;
+ case EVBUFFER_EOL_CRLF_STRICT: {
+ it = evbuffer_search(buffer, "\r\n", 2, &it);
+ if (it.pos < 0)
+ goto done;
+ extra_drain = 2;
+ break;
+ }
+ case EVBUFFER_EOL_CRLF: {
+ ev_ssize_t start_pos = it.pos;
+ /* Look for a LF ... */
+ if (evbuffer_strchr(&it, '\n') < 0)
+ goto done;
+ extra_drain = 1;
+ /* ... optionally preceeded by a CR. */
+ if (it.pos == start_pos)
+ break; /* If the first character is \n, don't back up */
+ /* This potentially does an extra linear walk over the first
+ * few chains. Probably, that's not too expensive unless you
+ * have a really pathological setup. */
+ memcpy(&it2, &it, sizeof(it));
+ if (evbuffer_ptr_subtract(buffer, &it2, 1)<0)
+ break;
+ if (evbuffer_getchr(&it2) == '\r') {
+ memcpy(&it, &it2, sizeof(it));
+ extra_drain = 2;
+ }
+ break;
+ }
+ case EVBUFFER_EOL_LF:
+ if (evbuffer_strchr(&it, '\n') < 0)
+ goto done;
+ extra_drain = 1;
+ break;
+ case EVBUFFER_EOL_NUL:
+ if (evbuffer_strchr(&it, '\0') < 0)
+ goto done;
+ extra_drain = 1;
+ break;
+ default:
+ goto done;
+ }
+
+ ok = 1;
+done:
+ EVBUFFER_UNLOCK(buffer);
+
+ if (!ok)
+ PTR_NOT_FOUND(&it);
+ if (eol_len_out)
+ *eol_len_out = extra_drain;
+
+ return it;
+}
+
+char *
+evbuffer_readln(struct evbuffer *buffer, size_t *n_read_out,
+ enum evbuffer_eol_style eol_style)
+{
+ struct evbuffer_ptr it;
+ char *line;
+ size_t n_to_copy=0, extra_drain=0;
+ char *result = NULL;
+
+ EVBUFFER_LOCK(buffer);
+
+ if (buffer->freeze_start) {
+ goto done;
+ }
+
+ it = evbuffer_search_eol(buffer, NULL, &extra_drain, eol_style);
+ if (it.pos < 0)
+ goto done;
+ n_to_copy = it.pos;
+
+ if ((line = mm_malloc(n_to_copy+1)) == NULL) {
+ event_warn("%s: out of memory", __func__);
+ goto done;
+ }
+
+ evbuffer_remove(buffer, line, n_to_copy);
+ line[n_to_copy] = '\0';
+
+ evbuffer_drain(buffer, extra_drain);
+ result = line;
+done:
+ EVBUFFER_UNLOCK(buffer);
+
+ if (n_read_out)
+ *n_read_out = result ? n_to_copy : 0;
+
+ return result;
+}
+
+#define EVBUFFER_CHAIN_MAX_AUTO_SIZE 4096
+
+/* Adds data to an event buffer */
+
+int
+evbuffer_add(struct evbuffer *buf, const void *data_in, size_t datlen)
+{
+ struct evbuffer_chain *chain, *tmp;
+ const unsigned char *data = data_in;
+ size_t remain, to_alloc;
+ int result = -1;
+
+ EVBUFFER_LOCK(buf);
+
+ if (buf->freeze_end) {
+ goto done;
+ }
+ /* Prevent buf->total_len overflow */
+ if (datlen > EV_SIZE_MAX - buf->total_len) {
+ goto done;
+ }
+
+ chain = buf->last;
+
+ /* If there are no chains allocated for this buffer, allocate one
+ * big enough to hold all the data. */
+ if (chain == NULL) {
+ chain = evbuffer_chain_new(datlen);
+ if (!chain)
+ goto done;
+ evbuffer_chain_insert(buf, chain);
+ }
+
+ if ((chain->flags & EVBUFFER_IMMUTABLE) == 0) {
+ /* Always true for mutable buffers */
+ EVUTIL_ASSERT(chain->misalign >= 0 &&
+ (ev_uint64_t)chain->misalign <= EVBUFFER_CHAIN_MAX);
+ remain = chain->buffer_len - (size_t)chain->misalign - chain->off;
+ if (remain >= datlen) {
+ /* there's enough space to hold all the data in the
+ * current last chain */
+ memcpy(chain->buffer + chain->misalign + chain->off,
+ data, datlen);
+ chain->off += datlen;
+ buf->total_len += datlen;
+ buf->n_add_for_cb += datlen;
+ goto out;
+ } else if (!CHAIN_PINNED(chain) &&
+ evbuffer_chain_should_realign(chain, datlen)) {
+ /* we can fit the data into the misalignment */
+ evbuffer_chain_align(chain);
+
+ memcpy(chain->buffer + chain->off, data, datlen);
+ chain->off += datlen;
+ buf->total_len += datlen;
+ buf->n_add_for_cb += datlen;
+ goto out;
+ }
+ } else {
+ /* we cannot write any data to the last chain */
+ remain = 0;
+ }
+
+ /* we need to add another chain */
+ to_alloc = chain->buffer_len;
+ if (to_alloc <= EVBUFFER_CHAIN_MAX_AUTO_SIZE/2)
+ to_alloc <<= 1;
+ if (datlen > to_alloc)
+ to_alloc = datlen;
+ tmp = evbuffer_chain_new(to_alloc);
+ if (tmp == NULL)
+ goto done;
+
+ if (remain) {
+ memcpy(chain->buffer + chain->misalign + chain->off,
+ data, remain);
+ chain->off += remain;
+ buf->total_len += remain;
+ buf->n_add_for_cb += remain;
+ }
+
+ data += remain;
+ datlen -= remain;
+
+ memcpy(tmp->buffer, data, datlen);
+ tmp->off = datlen;
+ evbuffer_chain_insert(buf, tmp);
+ buf->n_add_for_cb += datlen;
+
+out:
+ evbuffer_invoke_callbacks_(buf);
+ result = 0;
+done:
+ EVBUFFER_UNLOCK(buf);
+ return result;
+}
+
+int
+evbuffer_prepend(struct evbuffer *buf, const void *data, size_t datlen)
+{
+ struct evbuffer_chain *chain, *tmp;
+ int result = -1;
+
+ EVBUFFER_LOCK(buf);
+
+ if (buf->freeze_start) {
+ goto done;
+ }
+ if (datlen > EV_SIZE_MAX - buf->total_len) {
+ goto done;
+ }
+
+ chain = buf->first;
+
+ if (chain == NULL) {
+ chain = evbuffer_chain_new(datlen);
+ if (!chain)
+ goto done;
+ evbuffer_chain_insert(buf, chain);
+ }
+
+ /* we cannot touch immutable buffers */
+ if ((chain->flags & EVBUFFER_IMMUTABLE) == 0) {
+ /* Always true for mutable buffers */
+ EVUTIL_ASSERT(chain->misalign >= 0 &&
+ (ev_uint64_t)chain->misalign <= EVBUFFER_CHAIN_MAX);
+
+ /* If this chain is empty, we can treat it as
+ * 'empty at the beginning' rather than 'empty at the end' */
+ if (chain->off == 0)
+ chain->misalign = chain->buffer_len;
+
+ if ((size_t)chain->misalign >= datlen) {
+ /* we have enough space to fit everything */
+ memcpy(chain->buffer + chain->misalign - datlen,
+ data, datlen);
+ chain->off += datlen;
+ chain->misalign -= datlen;
+ buf->total_len += datlen;
+ buf->n_add_for_cb += datlen;
+ goto out;
+ } else if (chain->misalign) {
+ /* we can only fit some of the data. */
+ memcpy(chain->buffer,
+ (char*)data + datlen - chain->misalign,
+ (size_t)chain->misalign);
+ chain->off += (size_t)chain->misalign;
+ buf->total_len += (size_t)chain->misalign;
+ buf->n_add_for_cb += (size_t)chain->misalign;
+ datlen -= (size_t)chain->misalign;
+ chain->misalign = 0;
+ }
+ }
+
+ /* we need to add another chain */
+ if ((tmp = evbuffer_chain_new(datlen)) == NULL)
+ goto done;
+ buf->first = tmp;
+ if (buf->last_with_datap == &buf->first)
+ buf->last_with_datap = &tmp->next;
+
+ tmp->next = chain;
+
+ tmp->off = datlen;
+ EVUTIL_ASSERT(datlen <= tmp->buffer_len);
+ tmp->misalign = tmp->buffer_len - datlen;
+
+ memcpy(tmp->buffer + tmp->misalign, data, datlen);
+ buf->total_len += datlen;
+ buf->n_add_for_cb += (size_t)chain->misalign;
+
+out:
+ evbuffer_invoke_callbacks_(buf);
+ result = 0;
+done:
+ EVBUFFER_UNLOCK(buf);
+ return result;
+}
+
+/** Helper: realigns the memory in chain->buffer so that misalign is 0. */
+static void
+evbuffer_chain_align(struct evbuffer_chain *chain)
+{
+ EVUTIL_ASSERT(!(chain->flags & EVBUFFER_IMMUTABLE));
+ EVUTIL_ASSERT(!(chain->flags & EVBUFFER_MEM_PINNED_ANY));
+ memmove(chain->buffer, chain->buffer + chain->misalign, chain->off);
+ chain->misalign = 0;
+}
+
+#define MAX_TO_COPY_IN_EXPAND 4096
+#define MAX_TO_REALIGN_IN_EXPAND 2048
+
+/** Helper: return true iff we should realign chain to fit datalen bytes of
+ data in it. */
+static int
+evbuffer_chain_should_realign(struct evbuffer_chain *chain,
+ size_t datlen)
+{
+ return chain->buffer_len - chain->off >= datlen &&
+ (chain->off < chain->buffer_len / 2) &&
+ (chain->off <= MAX_TO_REALIGN_IN_EXPAND);
+}
+
+/* Expands the available space in the event buffer to at least datlen, all in
+ * a single chunk. Return that chunk. */
+static struct evbuffer_chain *
+evbuffer_expand_singlechain(struct evbuffer *buf, size_t datlen)
+{
+ struct evbuffer_chain *chain, **chainp;
+ struct evbuffer_chain *result = NULL;
+ ASSERT_EVBUFFER_LOCKED(buf);
+
+ chainp = buf->last_with_datap;
+
+ /* XXX If *chainp is no longer writeable, but has enough space in its
+ * misalign, this might be a bad idea: we could still use *chainp, not
+ * (*chainp)->next. */
+ if (*chainp && CHAIN_SPACE_LEN(*chainp) == 0)
+ chainp = &(*chainp)->next;
+
+ /* 'chain' now points to the first chain with writable space (if any)
+ * We will either use it, realign it, replace it, or resize it. */
+ chain = *chainp;
+
+ if (chain == NULL ||
+ (chain->flags & (EVBUFFER_IMMUTABLE|EVBUFFER_MEM_PINNED_ANY))) {
+ /* We can't use the last_with_data chain at all. Just add a
+ * new one that's big enough. */
+ goto insert_new;
+ }
+
+ /* If we can fit all the data, then we don't have to do anything */
+ if (CHAIN_SPACE_LEN(chain) >= datlen) {
+ result = chain;
+ goto ok;
+ }
+
+ /* If the chain is completely empty, just replace it by adding a new
+ * empty chain. */
+ if (chain->off == 0) {
+ goto insert_new;
+ }
+
+ /* If the misalignment plus the remaining space fulfills our data
+ * needs, we could just force an alignment to happen. Afterwards, we
+ * have enough space. But only do this if we're saving a lot of space
+ * and not moving too much data. Otherwise the space savings are
+ * probably offset by the time lost in copying.
+ */
+ if (evbuffer_chain_should_realign(chain, datlen)) {
+ evbuffer_chain_align(chain);
+ result = chain;
+ goto ok;
+ }
+
+ /* At this point, we can either resize the last chunk with space in
+ * it, use the next chunk after it, or If we add a new chunk, we waste
+ * CHAIN_SPACE_LEN(chain) bytes in the former last chunk. If we
+ * resize, we have to copy chain->off bytes.
+ */
+
+ /* Would expanding this chunk be affordable and worthwhile? */
+ if (CHAIN_SPACE_LEN(chain) < chain->buffer_len / 8 ||
+ chain->off > MAX_TO_COPY_IN_EXPAND ||
+ (datlen < EVBUFFER_CHAIN_MAX &&
+ EVBUFFER_CHAIN_MAX - datlen >= chain->off)) {
+ /* It's not worth resizing this chain. Can the next one be
+ * used? */
+ if (chain->next && CHAIN_SPACE_LEN(chain->next) >= datlen) {
+ /* Yes, we can just use the next chain (which should
+ * be empty. */
+ result = chain->next;
+ goto ok;
+ } else {
+ /* No; append a new chain (which will free all
+ * terminal empty chains.) */
+ goto insert_new;
+ }
+ } else {
+ /* Okay, we're going to try to resize this chain: Not doing so
+ * would waste at least 1/8 of its current allocation, and we
+ * can do so without having to copy more than
+ * MAX_TO_COPY_IN_EXPAND bytes. */
+ /* figure out how much space we need */
+ size_t length = chain->off + datlen;
+ struct evbuffer_chain *tmp = evbuffer_chain_new(length);
+ if (tmp == NULL)
+ goto err;
+
+ /* copy the data over that we had so far */
+ tmp->off = chain->off;
+ memcpy(tmp->buffer, chain->buffer + chain->misalign,
+ chain->off);
+ /* fix up the list */
+ EVUTIL_ASSERT(*chainp == chain);
+ result = *chainp = tmp;
+
+ if (buf->last == chain)
+ buf->last = tmp;
+
+ tmp->next = chain->next;
+ evbuffer_chain_free(chain);
+ goto ok;
+ }
+
+insert_new:
+ result = evbuffer_chain_insert_new(buf, datlen);
+ if (!result)
+ goto err;
+ok:
+ EVUTIL_ASSERT(result);
+ EVUTIL_ASSERT(CHAIN_SPACE_LEN(result) >= datlen);
+err:
+ return result;
+}
+
+/* Make sure that datlen bytes are available for writing in the last n
+ * chains. Never copies or moves data. */
+int
+evbuffer_expand_fast_(struct evbuffer *buf, size_t datlen, int n)
+{
+ struct evbuffer_chain *chain = buf->last, *tmp, *next;
+ size_t avail;
+ int used;
+
+ ASSERT_EVBUFFER_LOCKED(buf);
+ EVUTIL_ASSERT(n >= 2);
+
+ if (chain == NULL || (chain->flags & EVBUFFER_IMMUTABLE)) {
+ /* There is no last chunk, or we can't touch the last chunk.
+ * Just add a new chunk. */
+ chain = evbuffer_chain_new(datlen);
+ if (chain == NULL)
+ return (-1);
+
+ evbuffer_chain_insert(buf, chain);
+ return (0);
+ }
+
+ used = 0; /* number of chains we're using space in. */
+ avail = 0; /* how much space they have. */
+ /* How many bytes can we stick at the end of buffer as it is? Iterate
+ * over the chains at the end of the buffer, tring to see how much
+ * space we have in the first n. */
+ for (chain = *buf->last_with_datap; chain; chain = chain->next) {
+ if (chain->off) {
+ size_t space = (size_t) CHAIN_SPACE_LEN(chain);
+ EVUTIL_ASSERT(chain == *buf->last_with_datap);
+ if (space) {
+ avail += space;
+ ++used;
+ }
+ } else {
+ /* No data in chain; realign it. */
+ chain->misalign = 0;
+ avail += chain->buffer_len;
+ ++used;
+ }
+ if (avail >= datlen) {
+ /* There is already enough space. Just return */
+ return (0);
+ }
+ if (used == n)
+ break;
+ }
+
+ /* There wasn't enough space in the first n chains with space in
+ * them. Either add a new chain with enough space, or replace all
+ * empty chains with one that has enough space, depending on n. */
+ if (used < n) {
+ /* The loop ran off the end of the chains before it hit n
+ * chains; we can add another. */
+ EVUTIL_ASSERT(chain == NULL);
+
+ tmp = evbuffer_chain_new(datlen - avail);
+ if (tmp == NULL)
+ return (-1);
+
+ buf->last->next = tmp;
+ buf->last = tmp;
+ /* (we would only set last_with_data if we added the first
+ * chain. But if the buffer had no chains, we would have
+ * just allocated a new chain earlier) */
+ return (0);
+ } else {
+ /* Nuke _all_ the empty chains. */
+ int rmv_all = 0; /* True iff we removed last_with_data. */
+ chain = *buf->last_with_datap;
+ if (!chain->off) {
+ EVUTIL_ASSERT(chain == buf->first);
+ rmv_all = 1;
+ avail = 0;
+ } else {
+ /* can't overflow, since only mutable chains have
+ * huge misaligns. */
+ avail = (size_t) CHAIN_SPACE_LEN(chain);
+ chain = chain->next;
+ }
+
+
+ for (; chain; chain = next) {
+ next = chain->next;
+ EVUTIL_ASSERT(chain->off == 0);
+ evbuffer_chain_free(chain);
+ }
+ EVUTIL_ASSERT(datlen >= avail);
+ tmp = evbuffer_chain_new(datlen - avail);
+ if (tmp == NULL) {
+ if (rmv_all) {
+ ZERO_CHAIN(buf);
+ } else {
+ buf->last = *buf->last_with_datap;
+ (*buf->last_with_datap)->next = NULL;
+ }
+ return (-1);
+ }
+
+ if (rmv_all) {
+ buf->first = buf->last = tmp;
+ buf->last_with_datap = &buf->first;
+ } else {
+ (*buf->last_with_datap)->next = tmp;
+ buf->last = tmp;
+ }
+ return (0);
+ }
+}
+
+int
+evbuffer_expand(struct evbuffer *buf, size_t datlen)
+{
+ struct evbuffer_chain *chain;
+
+ EVBUFFER_LOCK(buf);
+ chain = evbuffer_expand_singlechain(buf, datlen);
+ EVBUFFER_UNLOCK(buf);
+ return chain ? 0 : -1;
+}
+
+/*
+ * Reads data from a file descriptor into a buffer.
+ */
+
+#if defined(EVENT__HAVE_SYS_UIO_H) || defined(_WIN32)
+#define USE_IOVEC_IMPL
+#endif
+
+#ifdef USE_IOVEC_IMPL
+
+#ifdef EVENT__HAVE_SYS_UIO_H
+/* number of iovec we use for writev, fragmentation is going to determine
+ * how much we end up writing */
+
+#define DEFAULT_WRITE_IOVEC 128
+
+#if defined(UIO_MAXIOV) && UIO_MAXIOV < DEFAULT_WRITE_IOVEC
+#define NUM_WRITE_IOVEC UIO_MAXIOV
+#elif defined(IOV_MAX) && IOV_MAX < DEFAULT_WRITE_IOVEC
+#define NUM_WRITE_IOVEC IOV_MAX
+#else
+#define NUM_WRITE_IOVEC DEFAULT_WRITE_IOVEC
+#endif
+
+#define IOV_TYPE struct iovec
+#define IOV_PTR_FIELD iov_base
+#define IOV_LEN_FIELD iov_len
+#define IOV_LEN_TYPE size_t
+#else
+#define NUM_WRITE_IOVEC 16
+#define IOV_TYPE WSABUF
+#define IOV_PTR_FIELD buf
+#define IOV_LEN_FIELD len
+#define IOV_LEN_TYPE unsigned long
+#endif
+#endif
+#define NUM_READ_IOVEC 4
+
+#define EVBUFFER_MAX_READ 4096
+
+/** Helper function to figure out which space to use for reading data into
+ an evbuffer. Internal use only.
+
+ @param buf The buffer to read into
+ @param howmuch How much we want to read.
+ @param vecs An array of two or more iovecs or WSABUFs.
+ @param n_vecs_avail The length of vecs
+ @param chainp A pointer to a variable to hold the first chain we're
+ reading into.
+ @param exact Boolean: if true, we do not provide more than 'howmuch'
+ space in the vectors, even if more space is available.
+ @return The number of buffers we're using.
+ */
+int
+evbuffer_read_setup_vecs_(struct evbuffer *buf, ev_ssize_t howmuch,
+ struct evbuffer_iovec *vecs, int n_vecs_avail,
+ struct evbuffer_chain ***chainp, int exact)
+{
+ struct evbuffer_chain *chain;
+ struct evbuffer_chain **firstchainp;
+ size_t so_far;
+ int i;
+ ASSERT_EVBUFFER_LOCKED(buf);
+
+ if (howmuch < 0)
+ return -1;
+
+ so_far = 0;
+ /* Let firstchain be the first chain with any space on it */
+ firstchainp = buf->last_with_datap;
+ if (CHAIN_SPACE_LEN(*firstchainp) == 0) {
+ firstchainp = &(*firstchainp)->next;
+ }
+
+ chain = *firstchainp;
+ for (i = 0; i < n_vecs_avail && so_far < (size_t)howmuch; ++i) {
+ size_t avail = (size_t) CHAIN_SPACE_LEN(chain);
+ if (avail > (howmuch - so_far) && exact)
+ avail = howmuch - so_far;
+ vecs[i].iov_base = CHAIN_SPACE_PTR(chain);
+ vecs[i].iov_len = avail;
+ so_far += avail;
+ chain = chain->next;
+ }
+
+ *chainp = firstchainp;
+ return i;
+}
+
+static int
+get_n_bytes_readable_on_socket(evutil_socket_t fd)
+{
+#if defined(FIONREAD) && defined(_WIN32)
+ unsigned long lng = EVBUFFER_MAX_READ;
+ if (ioctlsocket(fd, FIONREAD, &lng) < 0)
+ return -1;
+ /* Can overflow, but mostly harmlessly. XXXX */
+ return (int)lng;
+#elif defined(FIONREAD)
+ int n = EVBUFFER_MAX_READ;
+ if (ioctl(fd, FIONREAD, &n) < 0)
+ return -1;
+ return n;
+#else
+ return EVBUFFER_MAX_READ;
+#endif
+}
+
+/* TODO(niels): should this function return ev_ssize_t and take ev_ssize_t
+ * as howmuch? */
+int
+evbuffer_read(struct evbuffer *buf, evutil_socket_t fd, int howmuch)
+{
+ struct evbuffer_chain **chainp;
+ int n;
+ int result;
+
+#ifdef USE_IOVEC_IMPL
+ int nvecs, i, remaining;
+#else
+ struct evbuffer_chain *chain;
+ unsigned char *p;
+#endif
+
+ EVBUFFER_LOCK(buf);
+
+ if (buf->freeze_end) {
+ result = -1;
+ goto done;
+ }
+
+ n = get_n_bytes_readable_on_socket(fd);
+ if (n <= 0 || n > EVBUFFER_MAX_READ)
+ n = EVBUFFER_MAX_READ;
+ if (howmuch < 0 || howmuch > n)
+ howmuch = n;
+
+#ifdef USE_IOVEC_IMPL
+ /* Since we can use iovecs, we're willing to use the last
+ * NUM_READ_IOVEC chains. */
+ if (evbuffer_expand_fast_(buf, howmuch, NUM_READ_IOVEC) == -1) {
+ result = -1;
+ goto done;
+ } else {
+ IOV_TYPE vecs[NUM_READ_IOVEC];
+#ifdef EVBUFFER_IOVEC_IS_NATIVE_
+ nvecs = evbuffer_read_setup_vecs_(buf, howmuch, vecs,
+ NUM_READ_IOVEC, &chainp, 1);
+#else
+ /* We aren't using the native struct iovec. Therefore,
+ we are on win32. */
+ struct evbuffer_iovec ev_vecs[NUM_READ_IOVEC];
+ nvecs = evbuffer_read_setup_vecs_(buf, howmuch, ev_vecs, 2,
+ &chainp, 1);
+
+ for (i=0; i < nvecs; ++i)
+ WSABUF_FROM_EVBUFFER_IOV(&vecs[i], &ev_vecs[i]);
+#endif
+
+#ifdef _WIN32
+ {
+ DWORD bytesRead;
+ DWORD flags=0;
+ if (WSARecv(fd, vecs, nvecs, &bytesRead, &flags, NULL, NULL)) {
+ /* The read failed. It might be a close,
+ * or it might be an error. */
+ if (WSAGetLastError() == WSAECONNABORTED)
+ n = 0;
+ else
+ n = -1;
+ } else
+ n = bytesRead;
+ }
+#else
+ n = readv(fd, vecs, nvecs);
+#endif
+ }
+
+#else /*!USE_IOVEC_IMPL*/
+ /* If we don't have FIONREAD, we might waste some space here */
+ /* XXX we _will_ waste some space here if there is any space left
+ * over on buf->last. */
+ if ((chain = evbuffer_expand_singlechain(buf, howmuch)) == NULL) {
+ result = -1;
+ goto done;
+ }
+
+ /* We can append new data at this point */
+ p = chain->buffer + chain->misalign + chain->off;
+
+#ifndef _WIN32
+ n = read(fd, p, howmuch);
+#else
+ n = recv(fd, p, howmuch, 0);
+#endif
+#endif /* USE_IOVEC_IMPL */
+
+ if (n == -1) {
+ result = -1;
+ goto done;
+ }
+ if (n == 0) {
+ result = 0;
+ goto done;
+ }
+
+#ifdef USE_IOVEC_IMPL
+ remaining = n;
+ for (i=0; i < nvecs; ++i) {
+ /* can't overflow, since only mutable chains have
+ * huge misaligns. */
+ size_t space = (size_t) CHAIN_SPACE_LEN(*chainp);
+ /* XXXX This is a kludge that can waste space in perverse
+ * situations. */
+ if (space > EVBUFFER_CHAIN_MAX)
+ space = EVBUFFER_CHAIN_MAX;
+ if ((ev_ssize_t)space < remaining) {
+ (*chainp)->off += space;
+ remaining -= (int)space;
+ } else {
+ (*chainp)->off += remaining;
+ buf->last_with_datap = chainp;
+ break;
+ }
+ chainp = &(*chainp)->next;
+ }
+#else
+ chain->off += n;
+ advance_last_with_data(buf);
+#endif
+ buf->total_len += n;
+ buf->n_add_for_cb += n;
+
+ /* Tell someone about changes in this buffer */
+ evbuffer_invoke_callbacks_(buf);
+ result = n;
+done:
+ EVBUFFER_UNLOCK(buf);
+ return result;
+}
+
+#ifdef USE_IOVEC_IMPL
+static inline int
+evbuffer_write_iovec(struct evbuffer *buffer, evutil_socket_t fd,
+ ev_ssize_t howmuch)
+{
+ IOV_TYPE iov[NUM_WRITE_IOVEC];
+ struct evbuffer_chain *chain = buffer->first;
+ int n, i = 0;
+
+ if (howmuch < 0)
+ return -1;
+
+ ASSERT_EVBUFFER_LOCKED(buffer);
+ /* XXX make this top out at some maximal data length? if the
+ * buffer has (say) 1MB in it, split over 128 chains, there's
+ * no way it all gets written in one go. */
+ while (chain != NULL && i < NUM_WRITE_IOVEC && howmuch) {
+#ifdef USE_SENDFILE
+ /* we cannot write the file info via writev */
+ if (chain->flags & EVBUFFER_SENDFILE)
+ break;
+#endif
+ iov[i].IOV_PTR_FIELD = (void *) (chain->buffer + chain->misalign);
+ if ((size_t)howmuch >= chain->off) {
+ /* XXXcould be problematic when windows supports mmap*/
+ iov[i++].IOV_LEN_FIELD = (IOV_LEN_TYPE)chain->off;
+ howmuch -= chain->off;
+ } else {
+ /* XXXcould be problematic when windows supports mmap*/
+ iov[i++].IOV_LEN_FIELD = (IOV_LEN_TYPE)howmuch;
+ break;
+ }
+ chain = chain->next;
+ }
+ if (! i)
+ return 0;
+
+#ifdef _WIN32
+ {
+ DWORD bytesSent;
+ if (WSASend(fd, iov, i, &bytesSent, 0, NULL, NULL))
+ n = -1;
+ else
+ n = bytesSent;
+ }
+#else
+ n = writev(fd, iov, i);
+#endif
+ return (n);
+}
+#endif
+
+#ifdef USE_SENDFILE
+static inline int
+evbuffer_write_sendfile(struct evbuffer *buffer, evutil_socket_t dest_fd,
+ ev_ssize_t howmuch)
+{
+ struct evbuffer_chain *chain = buffer->first;
+ struct evbuffer_chain_file_segment *info =
+ EVBUFFER_CHAIN_EXTRA(struct evbuffer_chain_file_segment,
+ chain);
+ const int source_fd = info->segment->fd;
+#if defined(SENDFILE_IS_MACOSX) || defined(SENDFILE_IS_FREEBSD)
+ int res;
+ ev_off_t len = chain->off;
+#elif defined(SENDFILE_IS_LINUX) || defined(SENDFILE_IS_SOLARIS)
+ ev_ssize_t res;
+ ev_off_t offset = chain->misalign;
+#endif
+
+ ASSERT_EVBUFFER_LOCKED(buffer);
+
+#if defined(SENDFILE_IS_MACOSX)
+ res = sendfile(source_fd, dest_fd, chain->misalign, &len, NULL, 0);
+ if (res == -1 && !EVUTIL_ERR_RW_RETRIABLE(errno))
+ return (-1);
+
+ return (len);
+#elif defined(SENDFILE_IS_FREEBSD)
+ res = sendfile(source_fd, dest_fd, chain->misalign, chain->off, NULL, &len, 0);
+ if (res == -1 && !EVUTIL_ERR_RW_RETRIABLE(errno))
+ return (-1);
+
+ return (len);
+#elif defined(SENDFILE_IS_LINUX)
+ /* TODO(niels): implement splice */
+ res = sendfile(dest_fd, source_fd, &offset, chain->off);
+ if (res == -1 && EVUTIL_ERR_RW_RETRIABLE(errno)) {
+ /* if this is EAGAIN or EINTR return 0; otherwise, -1 */
+ return (0);
+ }
+ return (res);
+#elif defined(SENDFILE_IS_SOLARIS)
+ {
+ const off_t offset_orig = offset;
+ res = sendfile(dest_fd, source_fd, &offset, chain->off);
+ if (res == -1 && EVUTIL_ERR_RW_RETRIABLE(errno)) {
+ if (offset - offset_orig)
+ return offset - offset_orig;
+ /* if this is EAGAIN or EINTR and no bytes were
+ * written, return 0 */
+ return (0);
+ }
+ return (res);
+ }
+#endif
+}
+#endif
+
+int
+evbuffer_write_atmost(struct evbuffer *buffer, evutil_socket_t fd,
+ ev_ssize_t howmuch)
+{
+ int n = -1;
+
+ EVBUFFER_LOCK(buffer);
+
+ if (buffer->freeze_start) {
+ goto done;
+ }
+
+ if (howmuch < 0 || (size_t)howmuch > buffer->total_len)
+ howmuch = buffer->total_len;
+
+ if (howmuch > 0) {
+#ifdef USE_SENDFILE
+ struct evbuffer_chain *chain = buffer->first;
+ if (chain != NULL && (chain->flags & EVBUFFER_SENDFILE))
+ n = evbuffer_write_sendfile(buffer, fd, howmuch);
+ else {
+#endif
+#ifdef USE_IOVEC_IMPL
+ n = evbuffer_write_iovec(buffer, fd, howmuch);
+#elif defined(_WIN32)
+ /* XXX(nickm) Don't disable this code until we know if
+ * the WSARecv code above works. */
+ void *p = evbuffer_pullup(buffer, howmuch);
+ EVUTIL_ASSERT(p || !howmuch);
+ n = send(fd, p, howmuch, 0);
+#else
+ void *p = evbuffer_pullup(buffer, howmuch);
+ EVUTIL_ASSERT(p || !howmuch);
+ n = write(fd, p, howmuch);
+#endif
+#ifdef USE_SENDFILE
+ }
+#endif
+ }
+
+ if (n > 0)
+ evbuffer_drain(buffer, n);
+
+done:
+ EVBUFFER_UNLOCK(buffer);
+ return (n);
+}
+
+int
+evbuffer_write(struct evbuffer *buffer, evutil_socket_t fd)
+{
+ return evbuffer_write_atmost(buffer, fd, -1);
+}
+
+unsigned char *
+evbuffer_find(struct evbuffer *buffer, const unsigned char *what, size_t len)
+{
+ unsigned char *search;
+ struct evbuffer_ptr ptr;
+
+ EVBUFFER_LOCK(buffer);
+
+ ptr = evbuffer_search(buffer, (const char *)what, len, NULL);
+ if (ptr.pos < 0) {
+ search = NULL;
+ } else {
+ search = evbuffer_pullup(buffer, ptr.pos + len);
+ if (search)
+ search += ptr.pos;
+ }
+ EVBUFFER_UNLOCK(buffer);
+ return search;
+}
+
+/* Subract <b>howfar</b> from the position of <b>pos</b> within
+ * <b>buf</b>. Returns 0 on success, -1 on failure.
+ *
+ * This isn't exposed yet, because of potential inefficiency issues.
+ * Maybe it should be. */
+static int
+evbuffer_ptr_subtract(struct evbuffer *buf, struct evbuffer_ptr *pos,
+ size_t howfar)
+{
+ if (pos->pos < 0)
+ return -1;
+ if (howfar > (size_t)pos->pos)
+ return -1;
+ if (pos->internal_.chain && howfar <= pos->internal_.pos_in_chain) {
+ pos->internal_.pos_in_chain -= howfar;
+ pos->pos -= howfar;
+ return 0;
+ } else {
+ const size_t newpos = pos->pos - howfar;
+ /* Here's the inefficient part: it walks over the
+ * chains until we hit newpos. */
+ return evbuffer_ptr_set(buf, pos, newpos, EVBUFFER_PTR_SET);
+ }
+}
+
+int
+evbuffer_ptr_set(struct evbuffer *buf, struct evbuffer_ptr *pos,
+ size_t position, enum evbuffer_ptr_how how)
+{
+ size_t left = position;
+ struct evbuffer_chain *chain = NULL;
+ int result = 0;
+
+ EVBUFFER_LOCK(buf);
+
+ switch (how) {
+ case EVBUFFER_PTR_SET:
+ chain = buf->first;
+ pos->pos = position;
+ position = 0;
+ break;
+ case EVBUFFER_PTR_ADD:
+ /* this avoids iterating over all previous chains if
+ we just want to advance the position */
+ if (pos->pos < 0 || EV_SIZE_MAX - position < (size_t)pos->pos) {
+ EVBUFFER_UNLOCK(buf);
+ return -1;
+ }
+ chain = pos->internal_.chain;
+ pos->pos += position;
+ position = pos->internal_.pos_in_chain;
+ break;
+ }
+
+ EVUTIL_ASSERT(EV_SIZE_MAX - left >= position);
+ while (chain && position + left >= chain->off) {
+ left -= chain->off - position;
+ chain = chain->next;
+ position = 0;
+ }
+ if (chain) {
+ pos->internal_.chain = chain;
+ pos->internal_.pos_in_chain = position + left;
+ } else if (left == 0) {
+ /* The first byte in the (nonexistent) chain after the last chain */
+ pos->internal_.chain = NULL;
+ pos->internal_.pos_in_chain = 0;
+ } else {
+ PTR_NOT_FOUND(pos);
+ result = -1;
+ }
+
+ EVBUFFER_UNLOCK(buf);
+
+ return result;
+}
+
+/**
+ Compare the bytes in buf at position pos to the len bytes in mem. Return
+ less than 0, 0, or greater than 0 as memcmp.
+ */
+static int
+evbuffer_ptr_memcmp(const struct evbuffer *buf, const struct evbuffer_ptr *pos,
+ const char *mem, size_t len)
+{
+ struct evbuffer_chain *chain;
+ size_t position;
+ int r;
+
+ ASSERT_EVBUFFER_LOCKED(buf);
+
+ if (pos->pos < 0 ||
+ EV_SIZE_MAX - len < (size_t)pos->pos ||
+ pos->pos + len > buf->total_len)
+ return -1;
+
+ chain = pos->internal_.chain;
+ position = pos->internal_.pos_in_chain;
+ while (len && chain) {
+ size_t n_comparable;
+ if (len + position > chain->off)
+ n_comparable = chain->off - position;
+ else
+ n_comparable = len;
+ r = memcmp(chain->buffer + chain->misalign + position, mem,
+ n_comparable);
+ if (r)
+ return r;
+ mem += n_comparable;
+ len -= n_comparable;
+ position = 0;
+ chain = chain->next;
+ }
+
+ return 0;
+}
+
+struct evbuffer_ptr
+evbuffer_search(struct evbuffer *buffer, const char *what, size_t len, const struct evbuffer_ptr *start)
+{
+ return evbuffer_search_range(buffer, what, len, start, NULL);
+}
+
+struct evbuffer_ptr
+evbuffer_search_range(struct evbuffer *buffer, const char *what, size_t len, const struct evbuffer_ptr *start, const struct evbuffer_ptr *end)
+{
+ struct evbuffer_ptr pos;
+ struct evbuffer_chain *chain, *last_chain = NULL;
+ const unsigned char *p;
+ char first;
+
+ EVBUFFER_LOCK(buffer);
+
+ if (start) {
+ memcpy(&pos, start, sizeof(pos));
+ chain = pos.internal_.chain;
+ } else {
+ pos.pos = 0;
+ chain = pos.internal_.chain = buffer->first;
+ pos.internal_.pos_in_chain = 0;
+ }
+
+ if (end)
+ last_chain = end->internal_.chain;
+
+ if (!len || len > EV_SSIZE_MAX)
+ goto done;
+
+ first = what[0];
+
+ while (chain) {
+ const unsigned char *start_at =
+ chain->buffer + chain->misalign +
+ pos.internal_.pos_in_chain;
+ p = memchr(start_at, first,
+ chain->off - pos.internal_.pos_in_chain);
+ if (p) {
+ pos.pos += p - start_at;
+ pos.internal_.pos_in_chain += p - start_at;
+ if (!evbuffer_ptr_memcmp(buffer, &pos, what, len)) {
+ if (end && pos.pos + (ev_ssize_t)len > end->pos)
+ goto not_found;
+ else
+ goto done;
+ }
+ ++pos.pos;
+ ++pos.internal_.pos_in_chain;
+ if (pos.internal_.pos_in_chain == chain->off) {
+ chain = pos.internal_.chain = chain->next;
+ pos.internal_.pos_in_chain = 0;
+ }
+ } else {
+ if (chain == last_chain)
+ goto not_found;
+ pos.pos += chain->off - pos.internal_.pos_in_chain;
+ chain = pos.internal_.chain = chain->next;
+ pos.internal_.pos_in_chain = 0;
+ }
+ }
+
+not_found:
+ PTR_NOT_FOUND(&pos);
+done:
+ EVBUFFER_UNLOCK(buffer);
+ return pos;
+}
+
+int
+evbuffer_peek(struct evbuffer *buffer, ev_ssize_t len,
+ struct evbuffer_ptr *start_at,
+ struct evbuffer_iovec *vec, int n_vec)
+{
+ struct evbuffer_chain *chain;
+ int idx = 0;
+ ev_ssize_t len_so_far = 0;
+
+ /* Avoid locking in trivial edge cases */
+ if (start_at && start_at->internal_.chain == NULL)
+ return 0;
+
+ EVBUFFER_LOCK(buffer);
+
+ if (start_at) {
+ chain = start_at->internal_.chain;
+ len_so_far = chain->off
+ - start_at->internal_.pos_in_chain;
+ idx = 1;
+ if (n_vec > 0) {
+ vec[0].iov_base = chain->buffer + chain->misalign
+ + start_at->internal_.pos_in_chain;
+ vec[0].iov_len = len_so_far;
+ }
+ chain = chain->next;
+ } else {
+ chain = buffer->first;
+ }
+
+ if (n_vec == 0 && len < 0) {
+ /* If no vectors are provided and they asked for "everything",
+ * pretend they asked for the actual available amount. */
+ len = buffer->total_len;
+ if (start_at) {
+ len -= start_at->pos;
+ }
+ }
+
+ while (chain) {
+ if (len >= 0 && len_so_far >= len)
+ break;
+ if (idx<n_vec) {
+ vec[idx].iov_base = chain->buffer + chain->misalign;
+ vec[idx].iov_len = chain->off;
+ } else if (len<0) {
+ break;
+ }
+ ++idx;
+ len_so_far += chain->off;
+ chain = chain->next;
+ }
+
+ EVBUFFER_UNLOCK(buffer);
+
+ return idx;
+}
+
+
+int
+evbuffer_add_vprintf(struct evbuffer *buf, const char *fmt, va_list ap)
+{
+ char *buffer;
+ size_t space;
+ int sz, result = -1;
+ va_list aq;
+ struct evbuffer_chain *chain;
+
+
+ EVBUFFER_LOCK(buf);
+
+ if (buf->freeze_end) {
+ goto done;
+ }
+
+ /* make sure that at least some space is available */
+ if ((chain = evbuffer_expand_singlechain(buf, 64)) == NULL)
+ goto done;
+
+ for (;;) {
+#if 0
+ size_t used = chain->misalign + chain->off;
+ buffer = (char *)chain->buffer + chain->misalign + chain->off;
+ EVUTIL_ASSERT(chain->buffer_len >= used);
+ space = chain->buffer_len - used;
+#endif
+ buffer = (char*) CHAIN_SPACE_PTR(chain);
+ space = (size_t) CHAIN_SPACE_LEN(chain);
+
+#ifndef va_copy
+#define va_copy(dst, src) memcpy(&(dst), &(src), sizeof(va_list))
+#endif
+ va_copy(aq, ap);
+
+ sz = evutil_vsnprintf(buffer, space, fmt, aq);
+
+ va_end(aq);
+
+ if (sz < 0)
+ goto done;
+ if (INT_MAX >= EVBUFFER_CHAIN_MAX &&
+ (size_t)sz >= EVBUFFER_CHAIN_MAX)
+ goto done;
+ if ((size_t)sz < space) {
+ chain->off += sz;
+ buf->total_len += sz;
+ buf->n_add_for_cb += sz;
+
+ advance_last_with_data(buf);
+ evbuffer_invoke_callbacks_(buf);
+ result = sz;
+ goto done;
+ }
+ if ((chain = evbuffer_expand_singlechain(buf, sz + 1)) == NULL)
+ goto done;
+ }
+ /* NOTREACHED */
+
+done:
+ EVBUFFER_UNLOCK(buf);
+ return result;
+}
+
+int
+evbuffer_add_printf(struct evbuffer *buf, const char *fmt, ...)
+{
+ int res = -1;
+ va_list ap;
+
+ va_start(ap, fmt);
+ res = evbuffer_add_vprintf(buf, fmt, ap);
+ va_end(ap);
+
+ return (res);
+}
+
+int
+evbuffer_add_reference(struct evbuffer *outbuf,
+ const void *data, size_t datlen,
+ evbuffer_ref_cleanup_cb cleanupfn, void *extra)
+{
+ struct evbuffer_chain *chain;
+ struct evbuffer_chain_reference *info;
+ int result = -1;
+
+ chain = evbuffer_chain_new(sizeof(struct evbuffer_chain_reference));
+ if (!chain)
+ return (-1);
+ chain->flags |= EVBUFFER_REFERENCE | EVBUFFER_IMMUTABLE;
+ chain->buffer = (unsigned char *)data;
+ chain->buffer_len = datlen;
+ chain->off = datlen;
+
+ info = EVBUFFER_CHAIN_EXTRA(struct evbuffer_chain_reference, chain);
+ info->cleanupfn = cleanupfn;
+ info->extra = extra;
+
+ EVBUFFER_LOCK(outbuf);
+ if (outbuf->freeze_end) {
+ /* don't call chain_free; we do not want to actually invoke
+ * the cleanup function */
+ mm_free(chain);
+ goto done;
+ }
+ evbuffer_chain_insert(outbuf, chain);
+ outbuf->n_add_for_cb += datlen;
+
+ evbuffer_invoke_callbacks_(outbuf);
+
+ result = 0;
+done:
+ EVBUFFER_UNLOCK(outbuf);
+
+ return result;
+}
+
+/* TODO(niels): we may want to add to automagically convert to mmap, in
+ * case evbuffer_remove() or evbuffer_pullup() are being used.
+ */
+struct evbuffer_file_segment *
+evbuffer_file_segment_new(
+ int fd, ev_off_t offset, ev_off_t length, unsigned flags)
+{
+ struct evbuffer_file_segment *seg =
+ mm_calloc(sizeof(struct evbuffer_file_segment), 1);
+ if (!seg)
+ return NULL;
+ seg->refcnt = 1;
+ seg->fd = fd;
+ seg->flags = flags;
+ seg->file_offset = offset;
+ seg->cleanup_cb = NULL;
+ seg->cleanup_cb_arg = NULL;
+#ifdef _WIN32
+#ifndef lseek
+#define lseek _lseeki64
+#endif
+#ifndef fstat
+#define fstat _fstat
+#endif
+#ifndef stat
+#define stat _stat
+#endif
+#endif
+ if (length == -1) {
+ struct stat st;
+ if (fstat(fd, &st) < 0)
+ goto err;
+ length = st.st_size;
+ }
+ seg->length = length;
+
+ if (offset < 0 || length < 0 ||
+ ((ev_uint64_t)length > EVBUFFER_CHAIN_MAX) ||
+ (ev_uint64_t)offset > (ev_uint64_t)(EVBUFFER_CHAIN_MAX - length))
+ goto err;
+
+#if defined(USE_SENDFILE)
+ if (!(flags & EVBUF_FS_DISABLE_SENDFILE)) {
+ seg->can_sendfile = 1;
+ goto done;
+ }
+#endif
+
+ if (evbuffer_file_segment_materialize(seg)<0)
+ goto err;
+
+#if defined(USE_SENDFILE)
+done:
+#endif
+ if (!(flags & EVBUF_FS_DISABLE_LOCKING)) {
+ EVTHREAD_ALLOC_LOCK(seg->lock, 0);
+ }
+ return seg;
+err:
+ mm_free(seg);
+ return NULL;
+}
+
+#ifdef EVENT__HAVE_MMAP
+static long
+get_page_size(void)
+{
+#ifdef SC_PAGE_SIZE
+ return sysconf(SC_PAGE_SIZE);
+#elif defined(_SC_PAGE_SIZE)
+ return sysconf(_SC_PAGE_SIZE);
+#else
+ return 1;
+#endif
+}
+#endif
+
+/* DOCDOC */
+/* Requires lock */
+static int
+evbuffer_file_segment_materialize(struct evbuffer_file_segment *seg)
+{
+ const unsigned flags = seg->flags;
+ const int fd = seg->fd;
+ const ev_off_t length = seg->length;
+ const ev_off_t offset = seg->file_offset;
+
+ if (seg->contents)
+ return 0; /* already materialized */
+
+#if defined(EVENT__HAVE_MMAP)
+ if (!(flags & EVBUF_FS_DISABLE_MMAP)) {
+ off_t offset_rounded = 0, offset_leftover = 0;
+ void *mapped;
+ if (offset) {
+ /* mmap implementations don't generally like us
+ * to have an offset that isn't a round */
+ long page_size = get_page_size();
+ if (page_size == -1)
+ goto err;
+ offset_leftover = offset % page_size;
+ offset_rounded = offset - offset_leftover;
+ }
+ mapped = mmap(NULL, length + offset_leftover,
+ PROT_READ,
+#ifdef MAP_NOCACHE
+ MAP_NOCACHE | /* ??? */
+#endif
+#ifdef MAP_FILE
+ MAP_FILE |
+#endif
+ MAP_PRIVATE,
+ fd, offset_rounded);
+ if (mapped == MAP_FAILED) {
+ event_warn("%s: mmap(%d, %d, %zu) failed",
+ __func__, fd, 0, (size_t)(offset + length));
+ } else {
+ seg->mapping = mapped;
+ seg->contents = (char*)mapped+offset_leftover;
+ seg->mmap_offset = 0;
+ seg->is_mapping = 1;
+ goto done;
+ }
+ }
+#endif
+#ifdef _WIN32
+ if (!(flags & EVBUF_FS_DISABLE_MMAP)) {
+ intptr_t h = _get_osfhandle(fd);
+ HANDLE m;
+ ev_uint64_t total_size = length+offset;
+ if ((HANDLE)h == INVALID_HANDLE_VALUE)
+ goto err;
+ m = CreateFileMapping((HANDLE)h, NULL, PAGE_READONLY,
+ (total_size >> 32), total_size & 0xfffffffful,
+ NULL);
+ if (m != INVALID_HANDLE_VALUE) { /* Does h leak? */
+ seg->mapping_handle = m;
+ seg->mmap_offset = offset;
+ seg->is_mapping = 1;
+ goto done;
+ }
+ }
+#endif
+ {
+ ev_off_t start_pos = lseek(fd, 0, SEEK_CUR), pos;
+ ev_off_t read_so_far = 0;
+ char *mem;
+ int e;
+ ev_ssize_t n = 0;
+ if (!(mem = mm_malloc(length)))
+ goto err;
+ if (start_pos < 0) {
+ mm_free(mem);
+ goto err;
+ }
+ if (lseek(fd, offset, SEEK_SET) < 0) {
+ mm_free(mem);
+ goto err;
+ }
+ while (read_so_far < length) {
+ n = read(fd, mem+read_so_far, length-read_so_far);
+ if (n <= 0)
+ break;
+ read_so_far += n;
+ }
+
+ e = errno;
+ pos = lseek(fd, start_pos, SEEK_SET);
+ if (n < 0 || (n == 0 && length > read_so_far)) {
+ mm_free(mem);
+ errno = e;
+ goto err;
+ } else if (pos < 0) {
+ mm_free(mem);
+ goto err;
+ }
+
+ seg->contents = mem;
+ }
+
+done:
+ return 0;
+err:
+ return -1;
+}
+
+void evbuffer_file_segment_add_cleanup_cb(struct evbuffer_file_segment *seg,
+ evbuffer_file_segment_cleanup_cb cb, void* arg)
+{
+ EVUTIL_ASSERT(seg->refcnt > 0);
+ seg->cleanup_cb = cb;
+ seg->cleanup_cb_arg = arg;
+}
+
+void
+evbuffer_file_segment_free(struct evbuffer_file_segment *seg)
+{
+ int refcnt;
+ EVLOCK_LOCK(seg->lock, 0);
+ refcnt = --seg->refcnt;
+ EVLOCK_UNLOCK(seg->lock, 0);
+ if (refcnt > 0)
+ return;
+ EVUTIL_ASSERT(refcnt == 0);
+
+ if (seg->is_mapping) {
+#ifdef _WIN32
+ CloseHandle(seg->mapping_handle);
+#elif defined (EVENT__HAVE_MMAP)
+ off_t offset_leftover;
+ offset_leftover = seg->file_offset % get_page_size();
+ if (munmap(seg->mapping, seg->length + offset_leftover) == -1)
+ event_warn("%s: munmap failed", __func__);
+#endif
+ } else if (seg->contents) {
+ mm_free(seg->contents);
+ }
+
+ if ((seg->flags & EVBUF_FS_CLOSE_ON_FREE) && seg->fd >= 0) {
+ close(seg->fd);
+ }
+
+ if (seg->cleanup_cb) {
+ (*seg->cleanup_cb)((struct evbuffer_file_segment const*)seg,
+ seg->flags, seg->cleanup_cb_arg);
+ seg->cleanup_cb = NULL;
+ seg->cleanup_cb_arg = NULL;
+ }
+
+ EVTHREAD_FREE_LOCK(seg->lock, 0);
+ mm_free(seg);
+}
+
+int
+evbuffer_add_file_segment(struct evbuffer *buf,
+ struct evbuffer_file_segment *seg, ev_off_t offset, ev_off_t length)
+{
+ struct evbuffer_chain *chain;
+ struct evbuffer_chain_file_segment *extra;
+ int can_use_sendfile = 0;
+
+ EVBUFFER_LOCK(buf);
+ EVLOCK_LOCK(seg->lock, 0);
+ if (buf->flags & EVBUFFER_FLAG_DRAINS_TO_FD) {
+ can_use_sendfile = 1;
+ } else {
+ if (!seg->contents) {
+ if (evbuffer_file_segment_materialize(seg)<0) {
+ EVLOCK_UNLOCK(seg->lock, 0);
+ EVBUFFER_UNLOCK(buf);
+ return -1;
+ }
+ }
+ }
+ ++seg->refcnt;
+ EVLOCK_UNLOCK(seg->lock, 0);
+
+ if (buf->freeze_end)
+ goto err;
+
+ if (length < 0) {
+ if (offset > seg->length)
+ goto err;
+ length = seg->length - offset;
+ }
+
+ /* Can we actually add this? */
+ if (offset+length > seg->length)
+ goto err;
+
+ chain = evbuffer_chain_new(sizeof(struct evbuffer_chain_file_segment));
+ if (!chain)
+ goto err;
+ extra = EVBUFFER_CHAIN_EXTRA(struct evbuffer_chain_file_segment, chain);
+
+ chain->flags |= EVBUFFER_IMMUTABLE|EVBUFFER_FILESEGMENT;
+ if (can_use_sendfile && seg->can_sendfile) {
+ chain->flags |= EVBUFFER_SENDFILE;
+ chain->misalign = seg->file_offset + offset;
+ chain->off = length;
+ chain->buffer_len = chain->misalign + length;
+ } else if (seg->is_mapping) {
+#ifdef _WIN32
+ ev_uint64_t total_offset = seg->mmap_offset+offset;
+ ev_uint64_t offset_rounded=0, offset_remaining=0;
+ LPVOID data;
+ if (total_offset) {
+ SYSTEM_INFO si;
+ memset(&si, 0, sizeof(si)); /* cargo cult */
+ GetSystemInfo(&si);
+ offset_remaining = total_offset % si.dwAllocationGranularity;
+ offset_rounded = total_offset - offset_remaining;
+ }
+ data = MapViewOfFile(
+ seg->mapping_handle,
+ FILE_MAP_READ,
+ offset_rounded >> 32,
+ offset_rounded & 0xfffffffful,
+ length + offset_remaining);
+ if (data == NULL) {
+ mm_free(chain);
+ goto err;
+ }
+ chain->buffer = (unsigned char*) data;
+ chain->buffer_len = length+offset_remaining;
+ chain->misalign = offset_remaining;
+ chain->off = length;
+#else
+ chain->buffer = (unsigned char*)(seg->contents + offset);
+ chain->buffer_len = length;
+ chain->off = length;
+#endif
+ } else {
+ chain->buffer = (unsigned char*)(seg->contents + offset);
+ chain->buffer_len = length;
+ chain->off = length;
+ }
+
+ extra->segment = seg;
+ buf->n_add_for_cb += length;
+ evbuffer_chain_insert(buf, chain);
+
+ evbuffer_invoke_callbacks_(buf);
+
+ EVBUFFER_UNLOCK(buf);
+
+ return 0;
+err:
+ EVBUFFER_UNLOCK(buf);
+ evbuffer_file_segment_free(seg); /* Lowers the refcount */
+ return -1;
+}
+
+int
+evbuffer_add_file(struct evbuffer *buf, int fd, ev_off_t offset, ev_off_t length)
+{
+ struct evbuffer_file_segment *seg;
+ unsigned flags = EVBUF_FS_CLOSE_ON_FREE;
+ int r;
+
+ seg = evbuffer_file_segment_new(fd, offset, length, flags);
+ if (!seg)
+ return -1;
+ r = evbuffer_add_file_segment(buf, seg, 0, length);
+ if (r == 0)
+ evbuffer_file_segment_free(seg);
+ return r;
+}
+
+void
+evbuffer_setcb(struct evbuffer *buffer, evbuffer_cb cb, void *cbarg)
+{
+ EVBUFFER_LOCK(buffer);
+
+ if (!LIST_EMPTY(&buffer->callbacks))
+ evbuffer_remove_all_callbacks(buffer);
+
+ if (cb) {
+ struct evbuffer_cb_entry *ent =
+ evbuffer_add_cb(buffer, NULL, cbarg);
+ ent->cb.cb_obsolete = cb;
+ ent->flags |= EVBUFFER_CB_OBSOLETE;
+ }
+ EVBUFFER_UNLOCK(buffer);
+}
+
+struct evbuffer_cb_entry *
+evbuffer_add_cb(struct evbuffer *buffer, evbuffer_cb_func cb, void *cbarg)
+{
+ struct evbuffer_cb_entry *e;
+ if (! (e = mm_calloc(1, sizeof(struct evbuffer_cb_entry))))
+ return NULL;
+ EVBUFFER_LOCK(buffer);
+ e->cb.cb_func = cb;
+ e->cbarg = cbarg;
+ e->flags = EVBUFFER_CB_ENABLED;
+ LIST_INSERT_HEAD(&buffer->callbacks, e, next);
+ EVBUFFER_UNLOCK(buffer);
+ return e;
+}
+
+int
+evbuffer_remove_cb_entry(struct evbuffer *buffer,
+ struct evbuffer_cb_entry *ent)
+{
+ EVBUFFER_LOCK(buffer);
+ LIST_REMOVE(ent, next);
+ EVBUFFER_UNLOCK(buffer);
+ mm_free(ent);
+ return 0;
+}
+
+int
+evbuffer_remove_cb(struct evbuffer *buffer, evbuffer_cb_func cb, void *cbarg)
+{
+ struct evbuffer_cb_entry *cbent;
+ int result = -1;
+ EVBUFFER_LOCK(buffer);
+ LIST_FOREACH(cbent, &buffer->callbacks, next) {
+ if (cb == cbent->cb.cb_func && cbarg == cbent->cbarg) {
+ result = evbuffer_remove_cb_entry(buffer, cbent);
+ goto done;
+ }
+ }
+done:
+ EVBUFFER_UNLOCK(buffer);
+ return result;
+}
+
+int
+evbuffer_cb_set_flags(struct evbuffer *buffer,
+ struct evbuffer_cb_entry *cb, ev_uint32_t flags)
+{
+ /* the user isn't allowed to mess with these. */
+ flags &= ~EVBUFFER_CB_INTERNAL_FLAGS;
+ EVBUFFER_LOCK(buffer);
+ cb->flags |= flags;
+ EVBUFFER_UNLOCK(buffer);
+ return 0;
+}
+
+int
+evbuffer_cb_clear_flags(struct evbuffer *buffer,
+ struct evbuffer_cb_entry *cb, ev_uint32_t flags)
+{
+ /* the user isn't allowed to mess with these. */
+ flags &= ~EVBUFFER_CB_INTERNAL_FLAGS;
+ EVBUFFER_LOCK(buffer);
+ cb->flags &= ~flags;
+ EVBUFFER_UNLOCK(buffer);
+ return 0;
+}
+
+int
+evbuffer_freeze(struct evbuffer *buffer, int start)
+{
+ EVBUFFER_LOCK(buffer);
+ if (start)
+ buffer->freeze_start = 1;
+ else
+ buffer->freeze_end = 1;
+ EVBUFFER_UNLOCK(buffer);
+ return 0;
+}
+
+int
+evbuffer_unfreeze(struct evbuffer *buffer, int start)
+{
+ EVBUFFER_LOCK(buffer);
+ if (start)
+ buffer->freeze_start = 0;
+ else
+ buffer->freeze_end = 0;
+ EVBUFFER_UNLOCK(buffer);
+ return 0;
+}
+
+#if 0
+void
+evbuffer_cb_suspend(struct evbuffer *buffer, struct evbuffer_cb_entry *cb)
+{
+ if (!(cb->flags & EVBUFFER_CB_SUSPENDED)) {
+ cb->size_before_suspend = evbuffer_get_length(buffer);
+ cb->flags |= EVBUFFER_CB_SUSPENDED;
+ }
+}
+
+void
+evbuffer_cb_unsuspend(struct evbuffer *buffer, struct evbuffer_cb_entry *cb)
+{
+ if ((cb->flags & EVBUFFER_CB_SUSPENDED)) {
+ unsigned call = (cb->flags & EVBUFFER_CB_CALL_ON_UNSUSPEND);
+ size_t sz = cb->size_before_suspend;
+ cb->flags &= ~(EVBUFFER_CB_SUSPENDED|
+ EVBUFFER_CB_CALL_ON_UNSUSPEND);
+ cb->size_before_suspend = 0;
+ if (call && (cb->flags & EVBUFFER_CB_ENABLED)) {
+ cb->cb(buffer, sz, evbuffer_get_length(buffer), cb->cbarg);
+ }
+ }
+}
+#endif
+
+int
+evbuffer_get_callbacks_(struct evbuffer *buffer, struct event_callback **cbs,
+ int max_cbs)
+{
+ int r = 0;
+ EVBUFFER_LOCK(buffer);
+ if (buffer->deferred_cbs) {
+ if (max_cbs < 1) {
+ r = -1;
+ goto done;
+ }
+ cbs[0] = &buffer->deferred;
+ r = 1;
+ }
+done:
+ EVBUFFER_UNLOCK(buffer);
+ return r;
+}
diff --git a/protocols/Telegram/tgl/libevent/buffer.obj b/protocols/Telegram/tgl/libevent/buffer.obj
new file mode 100644
index 0000000000..231994448e
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/buffer.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/buffer_iocp.c b/protocols/Telegram/tgl/libevent/buffer_iocp.c
new file mode 100644
index 0000000000..2d76a90e77
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/buffer_iocp.c
@@ -0,0 +1,326 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+
+/**
+ @file buffer_iocp.c
+
+ This module implements overlapped read and write functions for evbuffer
+ objects on Windows.
+*/
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#include "event2/buffer.h"
+#include "event2/buffer_compat.h"
+#include "event2/util.h"
+#include "event2/thread.h"
+#include "util-internal.h"
+#include "evthread-internal.h"
+#include "evbuffer-internal.h"
+#include "iocp-internal.h"
+#include "mm-internal.h"
+
+#include <winsock2.h>
+#include <windows.h>
+#include <stdio.h>
+
+#define MAX_WSABUFS 16
+
+/** An evbuffer that can handle overlapped IO. */
+struct evbuffer_overlapped {
+ struct evbuffer buffer;
+ /** The socket that we're doing overlapped IO on. */
+ evutil_socket_t fd;
+
+ /** pending I/O type */
+ unsigned read_in_progress : 1;
+ unsigned write_in_progress : 1;
+
+ /** The first pinned chain in the buffer. */
+ struct evbuffer_chain *first_pinned;
+
+ /** How many chains are pinned; how many of the fields in buffers
+ * are we using. */
+ int n_buffers;
+ WSABUF buffers[MAX_WSABUFS];
+};
+
+/** Given an evbuffer, return the correponding evbuffer structure, or NULL if
+ * the evbuffer isn't overlapped. */
+static inline struct evbuffer_overlapped *
+upcast_evbuffer(struct evbuffer *buf)
+{
+ if (!buf || !buf->is_overlapped)
+ return NULL;
+ return EVUTIL_UPCAST(buf, struct evbuffer_overlapped, buffer);
+}
+
+/** Unpin all the chains noted as pinned in 'eo'. */
+static void
+pin_release(struct evbuffer_overlapped *eo, unsigned flag)
+{
+ int i;
+ struct evbuffer_chain *next, *chain = eo->first_pinned;
+
+ for (i = 0; i < eo->n_buffers; ++i) {
+ EVUTIL_ASSERT(chain);
+ next = chain->next;
+ evbuffer_chain_unpin_(chain, flag);
+ chain = next;
+ }
+}
+
+void
+evbuffer_commit_read_(struct evbuffer *evbuf, ev_ssize_t nBytes)
+{
+ struct evbuffer_overlapped *buf = upcast_evbuffer(evbuf);
+ struct evbuffer_chain **chainp;
+ size_t remaining, len;
+ unsigned i;
+
+ EVBUFFER_LOCK(evbuf);
+ EVUTIL_ASSERT(buf->read_in_progress && !buf->write_in_progress);
+ EVUTIL_ASSERT(nBytes >= 0); /* XXXX Can this be false? */
+
+ evbuffer_unfreeze(evbuf, 0);
+
+ chainp = evbuf->last_with_datap;
+ if (!((*chainp)->flags & EVBUFFER_MEM_PINNED_R))
+ chainp = &(*chainp)->next;
+ remaining = nBytes;
+ for (i = 0; remaining > 0 && i < (unsigned)buf->n_buffers; ++i) {
+ EVUTIL_ASSERT(*chainp);
+ len = buf->buffers[i].len;
+ if (remaining < len)
+ len = remaining;
+ (*chainp)->off += len;
+ evbuf->last_with_datap = chainp;
+ remaining -= len;
+ chainp = &(*chainp)->next;
+ }
+
+ pin_release(buf, EVBUFFER_MEM_PINNED_R);
+
+ buf->read_in_progress = 0;
+
+ evbuf->total_len += nBytes;
+ evbuf->n_add_for_cb += nBytes;
+
+ evbuffer_invoke_callbacks_(evbuf);
+
+ evbuffer_decref_and_unlock_(evbuf);
+}
+
+void
+evbuffer_commit_write_(struct evbuffer *evbuf, ev_ssize_t nBytes)
+{
+ struct evbuffer_overlapped *buf = upcast_evbuffer(evbuf);
+
+ EVBUFFER_LOCK(evbuf);
+ EVUTIL_ASSERT(buf->write_in_progress && !buf->read_in_progress);
+ evbuffer_unfreeze(evbuf, 1);
+ evbuffer_drain(evbuf, nBytes);
+ pin_release(buf,EVBUFFER_MEM_PINNED_W);
+ buf->write_in_progress = 0;
+ evbuffer_decref_and_unlock_(evbuf);
+}
+
+struct evbuffer *
+evbuffer_overlapped_new_(evutil_socket_t fd)
+{
+ struct evbuffer_overlapped *evo;
+
+ evo = mm_calloc(1, sizeof(struct evbuffer_overlapped));
+ if (!evo)
+ return NULL;
+
+ LIST_INIT(&evo->buffer.callbacks);
+ evo->buffer.refcnt = 1;
+ evo->buffer.last_with_datap = &evo->buffer.first;
+
+ evo->buffer.is_overlapped = 1;
+ evo->fd = fd;
+
+ return &evo->buffer;
+}
+
+int
+evbuffer_launch_write_(struct evbuffer *buf, ev_ssize_t at_most,
+ struct event_overlapped *ol)
+{
+ struct evbuffer_overlapped *buf_o = upcast_evbuffer(buf);
+ int r = -1;
+ int i;
+ struct evbuffer_chain *chain;
+ DWORD bytesSent;
+
+ if (!buf) {
+ /* No buffer, or it isn't overlapped */
+ return -1;
+ }
+
+ EVBUFFER_LOCK(buf);
+ EVUTIL_ASSERT(!buf_o->read_in_progress);
+ if (buf->freeze_start || buf_o->write_in_progress)
+ goto done;
+ if (!buf->total_len) {
+ /* Nothing to write */
+ r = 0;
+ goto done;
+ } else if (at_most < 0 || (size_t)at_most > buf->total_len) {
+ at_most = buf->total_len;
+ }
+ evbuffer_freeze(buf, 1);
+
+ buf_o->first_pinned = NULL;
+ buf_o->n_buffers = 0;
+ memset(buf_o->buffers, 0, sizeof(buf_o->buffers));
+
+ chain = buf_o->first_pinned = buf->first;
+
+ for (i=0; i < MAX_WSABUFS && chain; ++i, chain=chain->next) {
+ WSABUF *b = &buf_o->buffers[i];
+ b->buf = (char*)( chain->buffer + chain->misalign );
+ evbuffer_chain_pin_(chain, EVBUFFER_MEM_PINNED_W);
+
+ if ((size_t)at_most > chain->off) {
+ /* XXXX Cast is safe for now, since win32 has no
+ mmaped chains. But later, we need to have this
+ add more WSAbufs if chain->off is greater than
+ ULONG_MAX */
+ b->len = (unsigned long)chain->off;
+ at_most -= chain->off;
+ } else {
+ b->len = (unsigned long)at_most;
+ ++i;
+ break;
+ }
+ }
+
+ buf_o->n_buffers = i;
+ evbuffer_incref_(buf);
+ if (WSASend(buf_o->fd, buf_o->buffers, i, &bytesSent, 0,
+ &ol->overlapped, NULL)) {
+ int error = WSAGetLastError();
+ if (error != WSA_IO_PENDING) {
+ /* An actual error. */
+ pin_release(buf_o, EVBUFFER_MEM_PINNED_W);
+ evbuffer_unfreeze(buf, 1);
+ evbuffer_free(buf); /* decref */
+ goto done;
+ }
+ }
+
+ buf_o->write_in_progress = 1;
+ r = 0;
+done:
+ EVBUFFER_UNLOCK(buf);
+ return r;
+}
+
+int
+evbuffer_launch_read_(struct evbuffer *buf, size_t at_most,
+ struct event_overlapped *ol)
+{
+ struct evbuffer_overlapped *buf_o = upcast_evbuffer(buf);
+ int r = -1, i;
+ int nvecs;
+ int npin=0;
+ struct evbuffer_chain *chain=NULL, **chainp;
+ DWORD bytesRead;
+ DWORD flags = 0;
+ struct evbuffer_iovec vecs[MAX_WSABUFS];
+
+ if (!buf_o)
+ return -1;
+ EVBUFFER_LOCK(buf);
+ EVUTIL_ASSERT(!buf_o->write_in_progress);
+ if (buf->freeze_end || buf_o->read_in_progress)
+ goto done;
+
+ buf_o->first_pinned = NULL;
+ buf_o->n_buffers = 0;
+ memset(buf_o->buffers, 0, sizeof(buf_o->buffers));
+
+ if (evbuffer_expand_fast_(buf, at_most, MAX_WSABUFS) == -1)
+ goto done;
+ evbuffer_freeze(buf, 0);
+
+ nvecs = evbuffer_read_setup_vecs_(buf, at_most,
+ vecs, MAX_WSABUFS, &chainp, 1);
+ for (i=0;i<nvecs;++i) {
+ WSABUF_FROM_EVBUFFER_IOV(
+ &buf_o->buffers[i],
+ &vecs[i]);
+ }
+
+ buf_o->n_buffers = nvecs;
+ buf_o->first_pinned = chain = *chainp;
+
+ npin=0;
+ for ( ; chain; chain = chain->next) {
+ evbuffer_chain_pin_(chain, EVBUFFER_MEM_PINNED_R);
+ ++npin;
+ }
+ EVUTIL_ASSERT(npin == nvecs);
+
+ evbuffer_incref_(buf);
+ if (WSARecv(buf_o->fd, buf_o->buffers, nvecs, &bytesRead, &flags,
+ &ol->overlapped, NULL)) {
+ int error = WSAGetLastError();
+ if (error != WSA_IO_PENDING) {
+ /* An actual error. */
+ pin_release(buf_o, EVBUFFER_MEM_PINNED_R);
+ evbuffer_unfreeze(buf, 0);
+ evbuffer_free(buf); /* decref */
+ goto done;
+ }
+ }
+
+ buf_o->read_in_progress = 1;
+ r = 0;
+done:
+ EVBUFFER_UNLOCK(buf);
+ return r;
+}
+
+evutil_socket_t
+evbuffer_overlapped_get_fd_(struct evbuffer *buf)
+{
+ struct evbuffer_overlapped *buf_o = upcast_evbuffer(buf);
+ return buf_o ? buf_o->fd : -1;
+}
+
+void
+evbuffer_overlapped_set_fd_(struct evbuffer *buf, evutil_socket_t fd)
+{
+ struct evbuffer_overlapped *buf_o = upcast_evbuffer(buf);
+ EVBUFFER_LOCK(buf);
+ /* XXX is this right?, should it cancel current I/O operations? */
+ if (buf_o)
+ buf_o->fd = fd;
+ EVBUFFER_UNLOCK(buf);
+}
diff --git a/protocols/Telegram/tgl/libevent/buffer_iocp.obj b/protocols/Telegram/tgl/libevent/buffer_iocp.obj
new file mode 100644
index 0000000000..0fe943a60a
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/buffer_iocp.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/bufferevent-internal.h b/protocols/Telegram/tgl/libevent/bufferevent-internal.h
new file mode 100644
index 0000000000..d9d9e66640
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/bufferevent-internal.h
@@ -0,0 +1,480 @@
+/*
+ * Copyright (c) 2008-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef BUFFEREVENT_INTERNAL_H_INCLUDED_
+#define BUFFEREVENT_INTERNAL_H_INCLUDED_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "event2/event-config.h"
+#include "event2/event_struct.h"
+#include "evconfig-private.h"
+#include "event2/util.h"
+#include "defer-internal.h"
+#include "evthread-internal.h"
+#include "event2/thread.h"
+#include "ratelim-internal.h"
+#include "event2/bufferevent_struct.h"
+
+#include "ipv6-internal.h"
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#endif
+#ifdef EVENT__HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef EVENT__HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+
+/* These flags are reasons that we might be declining to actually enable
+ reading or writing on a bufferevent.
+ */
+
+/* On a all bufferevents, for reading: used when we have read up to the
+ watermark value.
+
+ On a filtering bufferevent, for writing: used when the underlying
+ bufferevent's write buffer has been filled up to its watermark
+ value.
+*/
+#define BEV_SUSPEND_WM 0x01
+/* On a base bufferevent: when we have emptied a bandwidth buckets */
+#define BEV_SUSPEND_BW 0x02
+/* On a base bufferevent: when we have emptied the group's bandwidth bucket. */
+#define BEV_SUSPEND_BW_GROUP 0x04
+/* On a socket bufferevent: can't do any operations while we're waiting for
+ * name lookup to finish. */
+#define BEV_SUSPEND_LOOKUP 0x08
+/* On a base bufferevent, for reading: used when a filter has choked this
+ * (underlying) bufferevent because it has stopped reading from it. */
+#define BEV_SUSPEND_FILT_READ 0x10
+
+typedef ev_uint16_t bufferevent_suspend_flags;
+
+struct bufferevent_rate_limit_group {
+ /** List of all members in the group */
+ LIST_HEAD(rlim_group_member_list, bufferevent_private) members;
+ /** Current limits for the group. */
+ struct ev_token_bucket rate_limit;
+ struct ev_token_bucket_cfg rate_limit_cfg;
+
+ /** True iff we don't want to read from any member of the group.until
+ * the token bucket refills. */
+ unsigned read_suspended : 1;
+ /** True iff we don't want to write from any member of the group.until
+ * the token bucket refills. */
+ unsigned write_suspended : 1;
+ /** True iff we were unable to suspend one of the bufferevents in the
+ * group for reading the last time we tried, and we should try
+ * again. */
+ unsigned pending_unsuspend_read : 1;
+ /** True iff we were unable to suspend one of the bufferevents in the
+ * group for writing the last time we tried, and we should try
+ * again. */
+ unsigned pending_unsuspend_write : 1;
+
+ /*@{*/
+ /** Total number of bytes read or written in this group since last
+ * reset. */
+ ev_uint64_t total_read;
+ ev_uint64_t total_written;
+ /*@}*/
+
+ /** The number of bufferevents in the group. */
+ int n_members;
+
+ /** The smallest number of bytes that any member of the group should
+ * be limited to read or write at a time. */
+ ev_ssize_t min_share;
+ ev_ssize_t configured_min_share;
+
+ /** Timeout event that goes off once a tick, when the bucket is ready
+ * to refill. */
+ struct event master_refill_event;
+
+ /** Seed for weak random number generator. Protected by 'lock' */
+ struct evutil_weakrand_state weakrand_seed;
+
+ /** Lock to protect the members of this group. This lock should nest
+ * within every bufferevent lock: if you are holding this lock, do
+ * not assume you can lock another bufferevent. */
+ void *lock;
+};
+
+/** Fields for rate-limiting a single bufferevent. */
+struct bufferevent_rate_limit {
+ /* Linked-list elements for storing this bufferevent_private in a
+ * group.
+ *
+ * Note that this field is supposed to be protected by the group
+ * lock */
+ LIST_ENTRY(bufferevent_private) next_in_group;
+ /** The rate-limiting group for this bufferevent, or NULL if it is
+ * only rate-limited on its own. */
+ struct bufferevent_rate_limit_group *group;
+
+ /* This bufferevent's current limits. */
+ struct ev_token_bucket limit;
+ /* Pointer to the rate-limit configuration for this bufferevent.
+ * Can be shared. XXX reference-count this? */
+ struct ev_token_bucket_cfg *cfg;
+
+ /* Timeout event used when one this bufferevent's buckets are
+ * empty. */
+ struct event refill_bucket_event;
+};
+
+/** Parts of the bufferevent structure that are shared among all bufferevent
+ * types, but not exposed in bufferevent_struct.h. */
+struct bufferevent_private {
+ /** The underlying bufferevent structure. */
+ struct bufferevent bev;
+
+ /** Evbuffer callback to enforce watermarks on input. */
+ struct evbuffer_cb_entry *read_watermarks_cb;
+
+ /** If set, we should free the lock when we free the bufferevent. */
+ unsigned own_lock : 1;
+
+ /** Flag: set if we have deferred callbacks and a read callback is
+ * pending. */
+ unsigned readcb_pending : 1;
+ /** Flag: set if we have deferred callbacks and a write callback is
+ * pending. */
+ unsigned writecb_pending : 1;
+ /** Flag: set if we are currently busy connecting. */
+ unsigned connecting : 1;
+ /** Flag: set if a connect failed prematurely; this is a hack for
+ * getting around the bufferevent abstraction. */
+ unsigned connection_refused : 1;
+ /** Set to the events pending if we have deferred callbacks and
+ * an events callback is pending. */
+ short eventcb_pending;
+
+ /** If set, read is suspended until one or more conditions are over.
+ * The actual value here is a bitfield of those conditions; see the
+ * BEV_SUSPEND_* flags above. */
+ bufferevent_suspend_flags read_suspended;
+
+ /** If set, writing is suspended until one or more conditions are over.
+ * The actual value here is a bitfield of those conditions; see the
+ * BEV_SUSPEND_* flags above. */
+ bufferevent_suspend_flags write_suspended;
+
+ /** Set to the current socket errno if we have deferred callbacks and
+ * an events callback is pending. */
+ int errno_pending;
+
+ /** The DNS error code for bufferevent_socket_connect_hostname */
+ int dns_error;
+
+ /** Used to implement deferred callbacks */
+ struct event_callback deferred;
+
+ /** The options this bufferevent was constructed with */
+ enum bufferevent_options options;
+
+ /** Current reference count for this bufferevent. */
+ int refcnt;
+
+ /** Lock for this bufferevent. Shared by the inbuf and the outbuf.
+ * If NULL, locking is disabled. */
+ void *lock;
+
+ /** No matter how big our bucket gets, don't try to read more than this
+ * much in a single read operation. */
+ ev_ssize_t max_single_read;
+
+ /** No matter how big our bucket gets, don't try to write more than this
+ * much in a single write operation. */
+ ev_ssize_t max_single_write;
+
+ /** Rate-limiting information for this bufferevent */
+ struct bufferevent_rate_limit *rate_limiting;
+
+ /* Saved conn_addr, to extract IP address from it.
+ *
+ * Because some servers may reset/close connection without waiting clients,
+ * in that case we can't extract IP address even in close_cb.
+ * So we need to save it, just after we connected to remote server, or
+ * after resolving (to avoid extra dns requests during retrying, since UDP
+ * is slow) */
+ union {
+ struct sockaddr_in6 in6;
+ struct sockaddr_in in;
+ } conn_address;
+};
+
+/** Possible operations for a control callback. */
+enum bufferevent_ctrl_op {
+ BEV_CTRL_SET_FD,
+ BEV_CTRL_GET_FD,
+ BEV_CTRL_GET_UNDERLYING,
+ BEV_CTRL_CANCEL_ALL
+};
+
+/** Possible data types for a control callback */
+union bufferevent_ctrl_data {
+ void *ptr;
+ evutil_socket_t fd;
+};
+
+/**
+ Implementation table for a bufferevent: holds function pointers and other
+ information to make the various bufferevent types work.
+*/
+struct bufferevent_ops {
+ /** The name of the bufferevent's type. */
+ const char *type;
+ /** At what offset into the implementation type will we find a
+ bufferevent structure?
+
+ Example: if the type is implemented as
+ struct bufferevent_x {
+ int extra_data;
+ struct bufferevent bev;
+ }
+ then mem_offset should be offsetof(struct bufferevent_x, bev)
+ */
+ off_t mem_offset;
+
+ /** Enables one or more of EV_READ|EV_WRITE on a bufferevent. Does
+ not need to adjust the 'enabled' field. Returns 0 on success, -1
+ on failure.
+ */
+ int (*enable)(struct bufferevent *, short);
+
+ /** Disables one or more of EV_READ|EV_WRITE on a bufferevent. Does
+ not need to adjust the 'enabled' field. Returns 0 on success, -1
+ on failure.
+ */
+ int (*disable)(struct bufferevent *, short);
+
+ /** Detatches the bufferevent from related data structures. Called as
+ * soon as its reference count reaches 0. */
+ void (*unlink)(struct bufferevent *);
+
+ /** Free any storage and deallocate any extra data or structures used
+ in this implementation. Called when the bufferevent is
+ finalized.
+ */
+ void (*destruct)(struct bufferevent *);
+
+ /** Called when the timeouts on the bufferevent have changed.*/
+ int (*adj_timeouts)(struct bufferevent *);
+
+ /** Called to flush data. */
+ int (*flush)(struct bufferevent *, short, enum bufferevent_flush_mode);
+
+ /** Called to access miscellaneous fields. */
+ int (*ctrl)(struct bufferevent *, enum bufferevent_ctrl_op, union bufferevent_ctrl_data *);
+
+};
+
+extern const struct bufferevent_ops bufferevent_ops_socket;
+extern const struct bufferevent_ops bufferevent_ops_filter;
+extern const struct bufferevent_ops bufferevent_ops_pair;
+
+#define BEV_IS_SOCKET(bevp) ((bevp)->be_ops == &bufferevent_ops_socket)
+#define BEV_IS_FILTER(bevp) ((bevp)->be_ops == &bufferevent_ops_filter)
+#define BEV_IS_PAIR(bevp) ((bevp)->be_ops == &bufferevent_ops_pair)
+
+#ifdef _WIN32
+extern const struct bufferevent_ops bufferevent_ops_async;
+#define BEV_IS_ASYNC(bevp) ((bevp)->be_ops == &bufferevent_ops_async)
+#else
+#define BEV_IS_ASYNC(bevp) 0
+#endif
+
+/** Initialize the shared parts of a bufferevent. */
+int bufferevent_init_common_(struct bufferevent_private *, struct event_base *, const struct bufferevent_ops *, enum bufferevent_options options);
+
+/** For internal use: temporarily stop all reads on bufev, until the conditions
+ * in 'what' are over. */
+void bufferevent_suspend_read_(struct bufferevent *bufev, bufferevent_suspend_flags what);
+/** For internal use: clear the conditions 'what' on bufev, and re-enable
+ * reading if there are no conditions left. */
+void bufferevent_unsuspend_read_(struct bufferevent *bufev, bufferevent_suspend_flags what);
+
+/** For internal use: temporarily stop all writes on bufev, until the conditions
+ * in 'what' are over. */
+void bufferevent_suspend_write_(struct bufferevent *bufev, bufferevent_suspend_flags what);
+/** For internal use: clear the conditions 'what' on bufev, and re-enable
+ * writing if there are no conditions left. */
+void bufferevent_unsuspend_write_(struct bufferevent *bufev, bufferevent_suspend_flags what);
+
+#define bufferevent_wm_suspend_read(b) \
+ bufferevent_suspend_read_((b), BEV_SUSPEND_WM)
+#define bufferevent_wm_unsuspend_read(b) \
+ bufferevent_unsuspend_read_((b), BEV_SUSPEND_WM)
+
+/*
+ Disable a bufferevent. Equivalent to bufferevent_disable(), but
+ first resets 'connecting' flag to force EV_WRITE down for sure.
+
+ XXXX this method will go away in the future; try not to add new users.
+ See comment in evhttp_connection_reset_() for discussion.
+
+ @param bufev the bufferevent to be disabled
+ @param event any combination of EV_READ | EV_WRITE.
+ @return 0 if successful, or -1 if an error occurred
+ @see bufferevent_disable()
+ */
+int bufferevent_disable_hard_(struct bufferevent *bufev, short event);
+
+/** Internal: Set up locking on a bufferevent. If lock is set, use it.
+ * Otherwise, use a new lock. */
+int bufferevent_enable_locking_(struct bufferevent *bufev, void *lock);
+/** Internal: backwards compat macro for the now public function
+ * Increment the reference count on bufev. */
+#define bufferevent_incref_(bufev) bufferevent_incref(bufev)
+/** Internal: Lock bufev and increase its reference count.
+ * unlocking it otherwise. */
+void bufferevent_incref_and_lock_(struct bufferevent *bufev);
+/** Internal: backwards compat macro for the now public function
+ * Decrement the reference count on bufev. Returns 1 if it freed
+ * the bufferevent.*/
+#define bufferevent_decref_(bufev) bufferevent_decref(bufev)
+
+/** Internal: Drop the reference count on bufev, freeing as necessary, and
+ * unlocking it otherwise. Returns 1 if it freed the bufferevent. */
+int bufferevent_decref_and_unlock_(struct bufferevent *bufev);
+
+/** Internal: If callbacks are deferred and we have a read callback, schedule
+ * a readcb. Otherwise just run the readcb. Ignores watermarks. */
+void bufferevent_run_readcb_(struct bufferevent *bufev, int options);
+/** Internal: If callbacks are deferred and we have a write callback, schedule
+ * a writecb. Otherwise just run the writecb. Ignores watermarks. */
+void bufferevent_run_writecb_(struct bufferevent *bufev, int options);
+/** Internal: If callbacks are deferred and we have an eventcb, schedule
+ * it to run with events "what". Otherwise just run the eventcb.
+ * See bufferevent_trigger_event for meaning of "options". */
+void bufferevent_run_eventcb_(struct bufferevent *bufev, short what, int options);
+
+/** Internal: Run or schedule (if deferred or options contain
+ * BEV_TRIG_DEFER_CALLBACKS) I/O callbacks specified in iotype.
+ * Must already hold the bufev lock. Honors watermarks unless
+ * BEV_TRIG_IGNORE_WATERMARKS is in options. */
+static inline void bufferevent_trigger_nolock_(struct bufferevent *bufev, short iotype, int options);
+
+/* Making this inline since all of the common-case calls to this function in
+ * libevent use constant arguments. */
+static inline void
+bufferevent_trigger_nolock_(struct bufferevent *bufev, short iotype, int options)
+{
+ if ((iotype & EV_READ) && ((options & BEV_TRIG_IGNORE_WATERMARKS) ||
+ evbuffer_get_length(bufev->input) >= bufev->wm_read.low))
+ bufferevent_run_readcb_(bufev, options);
+ if ((iotype & EV_WRITE) && ((options & BEV_TRIG_IGNORE_WATERMARKS) ||
+ evbuffer_get_length(bufev->output) <= bufev->wm_write.low))
+ bufferevent_run_writecb_(bufev, options);
+}
+
+/** Internal: Add the event 'ev' with timeout tv, unless tv is set to 0, in
+ * which case add ev with no timeout. */
+int bufferevent_add_event_(struct event *ev, const struct timeval *tv);
+
+/* =========
+ * These next functions implement timeouts for bufferevents that aren't doing
+ * anything else with ev_read and ev_write, to handle timeouts.
+ * ========= */
+/** Internal use: Set up the ev_read and ev_write callbacks so that
+ * the other "generic_timeout" functions will work on it. Call this from
+ * the constructor function. */
+void bufferevent_init_generic_timeout_cbs_(struct bufferevent *bev);
+/** Internal use: Add or delete the generic timeout events as appropriate.
+ * (If an event is enabled and a timeout is set, we add the event. Otherwise
+ * we delete it.) Call this from anything that changes the timeout values,
+ * that enabled EV_READ or EV_WRITE, or that disables EV_READ or EV_WRITE. */
+int bufferevent_generic_adj_timeouts_(struct bufferevent *bev);
+int bufferevent_generic_adj_existing_timeouts_(struct bufferevent *bev);
+
+enum bufferevent_options bufferevent_get_options_(struct bufferevent *bev);
+
+const struct sockaddr*
+bufferevent_socket_get_conn_address_(struct bufferevent *bev);
+
+/** Internal use: We have just successfully read data into an inbuf, so
+ * reset the read timeout (if any). */
+#define BEV_RESET_GENERIC_READ_TIMEOUT(bev) \
+ do { \
+ if (evutil_timerisset(&(bev)->timeout_read)) \
+ event_add(&(bev)->ev_read, &(bev)->timeout_read); \
+ } while (0)
+/** Internal use: We have just successfully written data from an inbuf, so
+ * reset the read timeout (if any). */
+#define BEV_RESET_GENERIC_WRITE_TIMEOUT(bev) \
+ do { \
+ if (evutil_timerisset(&(bev)->timeout_write)) \
+ event_add(&(bev)->ev_write, &(bev)->timeout_write); \
+ } while (0)
+#define BEV_DEL_GENERIC_READ_TIMEOUT(bev) \
+ event_del(&(bev)->ev_read)
+#define BEV_DEL_GENERIC_WRITE_TIMEOUT(bev) \
+ event_del(&(bev)->ev_write)
+
+
+/** Internal: Given a bufferevent, return its corresponding
+ * bufferevent_private. */
+#define BEV_UPCAST(b) EVUTIL_UPCAST((b), struct bufferevent_private, bev)
+
+#ifdef EVENT__DISABLE_THREAD_SUPPORT
+#define BEV_LOCK(b) EVUTIL_NIL_STMT_
+#define BEV_UNLOCK(b) EVUTIL_NIL_STMT_
+#else
+/** Internal: Grab the lock (if any) on a bufferevent */
+#define BEV_LOCK(b) do { \
+ struct bufferevent_private *locking = BEV_UPCAST(b); \
+ EVLOCK_LOCK(locking->lock, 0); \
+ } while (0)
+
+/** Internal: Release the lock (if any) on a bufferevent */
+#define BEV_UNLOCK(b) do { \
+ struct bufferevent_private *locking = BEV_UPCAST(b); \
+ EVLOCK_UNLOCK(locking->lock, 0); \
+ } while (0)
+#endif
+
+
+/* ==== For rate-limiting. */
+
+int bufferevent_decrement_write_buckets_(struct bufferevent_private *bev,
+ ev_ssize_t bytes);
+int bufferevent_decrement_read_buckets_(struct bufferevent_private *bev,
+ ev_ssize_t bytes);
+ev_ssize_t bufferevent_get_read_max_(struct bufferevent_private *bev);
+ev_ssize_t bufferevent_get_write_max_(struct bufferevent_private *bev);
+
+int bufferevent_ratelim_init_(struct bufferevent_private *bev);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* BUFFEREVENT_INTERNAL_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/bufferevent.c b/protocols/Telegram/tgl/libevent/bufferevent.c
new file mode 100644
index 0000000000..59ae24f143
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/bufferevent.c
@@ -0,0 +1,1016 @@
+/*
+ * Copyright (c) 2002-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos, Nick Mathewson
+ *
+ * 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 "event2/event-config.h"
+#include "evconfig-private.h"
+
+#include <sys/types.h>
+
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef EVENT__HAVE_STDARG_H
+#include <stdarg.h>
+#endif
+
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+#include <errno.h>
+
+#include "event2/util.h"
+#include "event2/buffer.h"
+#include "event2/buffer_compat.h"
+#include "event2/bufferevent.h"
+#include "event2/bufferevent_struct.h"
+#include "event2/bufferevent_compat.h"
+#include "event2/event.h"
+#include "event-internal.h"
+#include "log-internal.h"
+#include "mm-internal.h"
+#include "bufferevent-internal.h"
+#include "evbuffer-internal.h"
+#include "util-internal.h"
+
+static void bufferevent_cancel_all_(struct bufferevent *bev);
+static void bufferevent_finalize_cb_(struct event_callback *evcb, void *arg_);
+
+void
+bufferevent_suspend_read_(struct bufferevent *bufev, bufferevent_suspend_flags what)
+{
+ struct bufferevent_private *bufev_private =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+ BEV_LOCK(bufev);
+ if (!bufev_private->read_suspended)
+ bufev->be_ops->disable(bufev, EV_READ);
+ bufev_private->read_suspended |= what;
+ BEV_UNLOCK(bufev);
+}
+
+void
+bufferevent_unsuspend_read_(struct bufferevent *bufev, bufferevent_suspend_flags what)
+{
+ struct bufferevent_private *bufev_private =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+ BEV_LOCK(bufev);
+ bufev_private->read_suspended &= ~what;
+ if (!bufev_private->read_suspended && (bufev->enabled & EV_READ))
+ bufev->be_ops->enable(bufev, EV_READ);
+ BEV_UNLOCK(bufev);
+}
+
+void
+bufferevent_suspend_write_(struct bufferevent *bufev, bufferevent_suspend_flags what)
+{
+ struct bufferevent_private *bufev_private =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+ BEV_LOCK(bufev);
+ if (!bufev_private->write_suspended)
+ bufev->be_ops->disable(bufev, EV_WRITE);
+ bufev_private->write_suspended |= what;
+ BEV_UNLOCK(bufev);
+}
+
+void
+bufferevent_unsuspend_write_(struct bufferevent *bufev, bufferevent_suspend_flags what)
+{
+ struct bufferevent_private *bufev_private =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+ BEV_LOCK(bufev);
+ bufev_private->write_suspended &= ~what;
+ if (!bufev_private->write_suspended && (bufev->enabled & EV_WRITE))
+ bufev->be_ops->enable(bufev, EV_WRITE);
+ BEV_UNLOCK(bufev);
+}
+
+
+/* Callback to implement watermarks on the input buffer. Only enabled
+ * if the watermark is set. */
+static void
+bufferevent_inbuf_wm_cb(struct evbuffer *buf,
+ const struct evbuffer_cb_info *cbinfo,
+ void *arg)
+{
+ struct bufferevent *bufev = arg;
+ size_t size;
+
+ size = evbuffer_get_length(buf);
+
+ if (size >= bufev->wm_read.high)
+ bufferevent_wm_suspend_read(bufev);
+ else
+ bufferevent_wm_unsuspend_read(bufev);
+}
+
+static void
+bufferevent_run_deferred_callbacks_locked(struct event_callback *cb, void *arg)
+{
+ struct bufferevent_private *bufev_private = arg;
+ struct bufferevent *bufev = &bufev_private->bev;
+
+ BEV_LOCK(bufev);
+ if ((bufev_private->eventcb_pending & BEV_EVENT_CONNECTED) &&
+ bufev->errorcb) {
+ /* The "connected" happened before any reads or writes, so
+ send it first. */
+ bufev_private->eventcb_pending &= ~BEV_EVENT_CONNECTED;
+ bufev->errorcb(bufev, BEV_EVENT_CONNECTED, bufev->cbarg);
+ }
+ if (bufev_private->readcb_pending && bufev->readcb) {
+ bufev_private->readcb_pending = 0;
+ bufev->readcb(bufev, bufev->cbarg);
+ }
+ if (bufev_private->writecb_pending && bufev->writecb) {
+ bufev_private->writecb_pending = 0;
+ bufev->writecb(bufev, bufev->cbarg);
+ }
+ if (bufev_private->eventcb_pending && bufev->errorcb) {
+ short what = bufev_private->eventcb_pending;
+ int err = bufev_private->errno_pending;
+ bufev_private->eventcb_pending = 0;
+ bufev_private->errno_pending = 0;
+ EVUTIL_SET_SOCKET_ERROR(err);
+ bufev->errorcb(bufev, what, bufev->cbarg);
+ }
+ bufferevent_decref_and_unlock_(bufev);
+}
+
+static void
+bufferevent_run_deferred_callbacks_unlocked(struct event_callback *cb, void *arg)
+{
+ struct bufferevent_private *bufev_private = arg;
+ struct bufferevent *bufev = &bufev_private->bev;
+
+ BEV_LOCK(bufev);
+#define UNLOCKED(stmt) \
+ do { BEV_UNLOCK(bufev); stmt; BEV_LOCK(bufev); } while(0)
+
+ if ((bufev_private->eventcb_pending & BEV_EVENT_CONNECTED) &&
+ bufev->errorcb) {
+ /* The "connected" happened before any reads or writes, so
+ send it first. */
+ bufferevent_event_cb errorcb = bufev->errorcb;
+ void *cbarg = bufev->cbarg;
+ bufev_private->eventcb_pending &= ~BEV_EVENT_CONNECTED;
+ UNLOCKED(errorcb(bufev, BEV_EVENT_CONNECTED, cbarg));
+ }
+ if (bufev_private->readcb_pending && bufev->readcb) {
+ bufferevent_data_cb readcb = bufev->readcb;
+ void *cbarg = bufev->cbarg;
+ bufev_private->readcb_pending = 0;
+ UNLOCKED(readcb(bufev, cbarg));
+ }
+ if (bufev_private->writecb_pending && bufev->writecb) {
+ bufferevent_data_cb writecb = bufev->writecb;
+ void *cbarg = bufev->cbarg;
+ bufev_private->writecb_pending = 0;
+ UNLOCKED(writecb(bufev, cbarg));
+ }
+ if (bufev_private->eventcb_pending && bufev->errorcb) {
+ bufferevent_event_cb errorcb = bufev->errorcb;
+ void *cbarg = bufev->cbarg;
+ short what = bufev_private->eventcb_pending;
+ int err = bufev_private->errno_pending;
+ bufev_private->eventcb_pending = 0;
+ bufev_private->errno_pending = 0;
+ EVUTIL_SET_SOCKET_ERROR(err);
+ UNLOCKED(errorcb(bufev,what,cbarg));
+ }
+ bufferevent_decref_and_unlock_(bufev);
+#undef UNLOCKED
+}
+
+#define SCHEDULE_DEFERRED(bevp) \
+ do { \
+ if (event_deferred_cb_schedule_( \
+ (bevp)->bev.ev_base, \
+ &(bevp)->deferred)) \
+ bufferevent_incref_(&(bevp)->bev); \
+ } while (0)
+
+
+void
+bufferevent_run_readcb_(struct bufferevent *bufev, int options)
+{
+ /* Requires that we hold the lock and a reference */
+ struct bufferevent_private *p =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+ if (bufev->readcb == NULL)
+ return;
+ if ((p->options|options) & BEV_OPT_DEFER_CALLBACKS) {
+ p->readcb_pending = 1;
+ SCHEDULE_DEFERRED(p);
+ } else {
+ bufev->readcb(bufev, bufev->cbarg);
+ }
+}
+
+void
+bufferevent_run_writecb_(struct bufferevent *bufev, int options)
+{
+ /* Requires that we hold the lock and a reference */
+ struct bufferevent_private *p =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+ if (bufev->writecb == NULL)
+ return;
+ if ((p->options|options) & BEV_OPT_DEFER_CALLBACKS) {
+ p->writecb_pending = 1;
+ SCHEDULE_DEFERRED(p);
+ } else {
+ bufev->writecb(bufev, bufev->cbarg);
+ }
+}
+
+#define BEV_TRIG_ALL_OPTS ( \
+ BEV_TRIG_IGNORE_WATERMARKS| \
+ BEV_TRIG_DEFER_CALLBACKS \
+ )
+
+void
+bufferevent_trigger(struct bufferevent *bufev, short iotype, int options)
+{
+ bufferevent_incref_and_lock_(bufev);
+ bufferevent_trigger_nolock_(bufev, iotype, options&BEV_TRIG_ALL_OPTS);
+ bufferevent_decref_and_unlock_(bufev);
+}
+
+void
+bufferevent_run_eventcb_(struct bufferevent *bufev, short what, int options)
+{
+ /* Requires that we hold the lock and a reference */
+ struct bufferevent_private *p =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+ if (bufev->errorcb == NULL)
+ return;
+ if ((p->options|options) & BEV_OPT_DEFER_CALLBACKS) {
+ p->eventcb_pending |= what;
+ p->errno_pending = EVUTIL_SOCKET_ERROR();
+ SCHEDULE_DEFERRED(p);
+ } else {
+ bufev->errorcb(bufev, what, bufev->cbarg);
+ }
+}
+
+void
+bufferevent_trigger_event(struct bufferevent *bufev, short what, int options)
+{
+ bufferevent_incref_and_lock_(bufev);
+ bufferevent_run_eventcb_(bufev, what, options&BEV_TRIG_ALL_OPTS);
+ bufferevent_decref_and_unlock_(bufev);
+}
+
+int
+bufferevent_init_common_(struct bufferevent_private *bufev_private,
+ struct event_base *base,
+ const struct bufferevent_ops *ops,
+ enum bufferevent_options options)
+{
+ struct bufferevent *bufev = &bufev_private->bev;
+
+ if (!bufev->input) {
+ if ((bufev->input = evbuffer_new()) == NULL)
+ return -1;
+ }
+
+ if (!bufev->output) {
+ if ((bufev->output = evbuffer_new()) == NULL) {
+ evbuffer_free(bufev->input);
+ return -1;
+ }
+ }
+
+ bufev_private->refcnt = 1;
+ bufev->ev_base = base;
+
+ /* Disable timeouts. */
+ evutil_timerclear(&bufev->timeout_read);
+ evutil_timerclear(&bufev->timeout_write);
+
+ bufev->be_ops = ops;
+
+ bufferevent_ratelim_init_(bufev_private);
+
+ /*
+ * Set to EV_WRITE so that using bufferevent_write is going to
+ * trigger a callback. Reading needs to be explicitly enabled
+ * because otherwise no data will be available.
+ */
+ bufev->enabled = EV_WRITE;
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ if (options & BEV_OPT_THREADSAFE) {
+ if (bufferevent_enable_locking_(bufev, NULL) < 0) {
+ /* cleanup */
+ evbuffer_free(bufev->input);
+ evbuffer_free(bufev->output);
+ bufev->input = NULL;
+ bufev->output = NULL;
+ return -1;
+ }
+ }
+#endif
+ if ((options & (BEV_OPT_DEFER_CALLBACKS|BEV_OPT_UNLOCK_CALLBACKS))
+ == BEV_OPT_UNLOCK_CALLBACKS) {
+ event_warnx("UNLOCK_CALLBACKS requires DEFER_CALLBACKS");
+ return -1;
+ }
+ if (options & BEV_OPT_UNLOCK_CALLBACKS)
+ event_deferred_cb_init_(
+ &bufev_private->deferred,
+ event_base_get_npriorities(base) / 2,
+ bufferevent_run_deferred_callbacks_unlocked,
+ bufev_private);
+ else
+ event_deferred_cb_init_(
+ &bufev_private->deferred,
+ event_base_get_npriorities(base) / 2,
+ bufferevent_run_deferred_callbacks_locked,
+ bufev_private);
+
+ bufev_private->options = options;
+
+ evbuffer_set_parent_(bufev->input, bufev);
+ evbuffer_set_parent_(bufev->output, bufev);
+
+ return 0;
+}
+
+void
+bufferevent_setcb(struct bufferevent *bufev,
+ bufferevent_data_cb readcb, bufferevent_data_cb writecb,
+ bufferevent_event_cb eventcb, void *cbarg)
+{
+ BEV_LOCK(bufev);
+
+ bufev->readcb = readcb;
+ bufev->writecb = writecb;
+ bufev->errorcb = eventcb;
+
+ bufev->cbarg = cbarg;
+ BEV_UNLOCK(bufev);
+}
+
+void
+bufferevent_getcb(struct bufferevent *bufev,
+ bufferevent_data_cb *readcb_ptr,
+ bufferevent_data_cb *writecb_ptr,
+ bufferevent_event_cb *eventcb_ptr,
+ void **cbarg_ptr)
+{
+ BEV_LOCK(bufev);
+ if (readcb_ptr)
+ *readcb_ptr = bufev->readcb;
+ if (writecb_ptr)
+ *writecb_ptr = bufev->writecb;
+ if (eventcb_ptr)
+ *eventcb_ptr = bufev->errorcb;
+ if (cbarg_ptr)
+ *cbarg_ptr = bufev->cbarg;
+
+ BEV_UNLOCK(bufev);
+}
+
+struct evbuffer *
+bufferevent_get_input(struct bufferevent *bufev)
+{
+ return bufev->input;
+}
+
+struct evbuffer *
+bufferevent_get_output(struct bufferevent *bufev)
+{
+ return bufev->output;
+}
+
+struct event_base *
+bufferevent_get_base(struct bufferevent *bufev)
+{
+ return bufev->ev_base;
+}
+
+int
+bufferevent_get_priority(const struct bufferevent *bufev)
+{
+ if (event_initialized(&bufev->ev_read)) {
+ return event_get_priority(&bufev->ev_read);
+ } else {
+ return event_base_get_npriorities(bufev->ev_base) / 2;
+ }
+}
+
+int
+bufferevent_write(struct bufferevent *bufev, const void *data, size_t size)
+{
+ if (evbuffer_add(bufev->output, data, size) == -1)
+ return (-1);
+
+ return 0;
+}
+
+int
+bufferevent_write_buffer(struct bufferevent *bufev, struct evbuffer *buf)
+{
+ if (evbuffer_add_buffer(bufev->output, buf) == -1)
+ return (-1);
+
+ return 0;
+}
+
+size_t
+bufferevent_read(struct bufferevent *bufev, void *data, size_t size)
+{
+ return (evbuffer_remove(bufev->input, data, size));
+}
+
+int
+bufferevent_read_buffer(struct bufferevent *bufev, struct evbuffer *buf)
+{
+ return (evbuffer_add_buffer(buf, bufev->input));
+}
+
+int
+bufferevent_enable(struct bufferevent *bufev, short event)
+{
+ struct bufferevent_private *bufev_private =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+ short impl_events = event;
+ int r = 0;
+
+ bufferevent_incref_and_lock_(bufev);
+ if (bufev_private->read_suspended)
+ impl_events &= ~EV_READ;
+ if (bufev_private->write_suspended)
+ impl_events &= ~EV_WRITE;
+
+ bufev->enabled |= event;
+
+ if (impl_events && bufev->be_ops->enable(bufev, impl_events) < 0)
+ r = -1;
+
+ bufferevent_decref_and_unlock_(bufev);
+ return r;
+}
+
+int
+bufferevent_set_timeouts(struct bufferevent *bufev,
+ const struct timeval *tv_read,
+ const struct timeval *tv_write)
+{
+ int r = 0;
+ BEV_LOCK(bufev);
+ if (tv_read) {
+ bufev->timeout_read = *tv_read;
+ } else {
+ evutil_timerclear(&bufev->timeout_read);
+ }
+ if (tv_write) {
+ bufev->timeout_write = *tv_write;
+ } else {
+ evutil_timerclear(&bufev->timeout_write);
+ }
+
+ if (bufev->be_ops->adj_timeouts)
+ r = bufev->be_ops->adj_timeouts(bufev);
+ BEV_UNLOCK(bufev);
+
+ return r;
+}
+
+
+/* Obsolete; use bufferevent_set_timeouts */
+void
+bufferevent_settimeout(struct bufferevent *bufev,
+ int timeout_read, int timeout_write)
+{
+ struct timeval tv_read, tv_write;
+ struct timeval *ptv_read = NULL, *ptv_write = NULL;
+
+ memset(&tv_read, 0, sizeof(tv_read));
+ memset(&tv_write, 0, sizeof(tv_write));
+
+ if (timeout_read) {
+ tv_read.tv_sec = timeout_read;
+ ptv_read = &tv_read;
+ }
+ if (timeout_write) {
+ tv_write.tv_sec = timeout_write;
+ ptv_write = &tv_write;
+ }
+
+ bufferevent_set_timeouts(bufev, ptv_read, ptv_write);
+}
+
+
+int
+bufferevent_disable_hard_(struct bufferevent *bufev, short event)
+{
+ int r = 0;
+ struct bufferevent_private *bufev_private =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+
+ BEV_LOCK(bufev);
+ bufev->enabled &= ~event;
+
+ bufev_private->connecting = 0;
+ if (bufev->be_ops->disable(bufev, event) < 0)
+ r = -1;
+
+ BEV_UNLOCK(bufev);
+ return r;
+}
+
+int
+bufferevent_disable(struct bufferevent *bufev, short event)
+{
+ int r = 0;
+
+ BEV_LOCK(bufev);
+ bufev->enabled &= ~event;
+
+ if (bufev->be_ops->disable(bufev, event) < 0)
+ r = -1;
+
+ BEV_UNLOCK(bufev);
+ return r;
+}
+
+/*
+ * Sets the water marks
+ */
+
+void
+bufferevent_setwatermark(struct bufferevent *bufev, short events,
+ size_t lowmark, size_t highmark)
+{
+ struct bufferevent_private *bufev_private =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+
+ BEV_LOCK(bufev);
+ if (events & EV_WRITE) {
+ bufev->wm_write.low = lowmark;
+ bufev->wm_write.high = highmark;
+ }
+
+ if (events & EV_READ) {
+ bufev->wm_read.low = lowmark;
+ bufev->wm_read.high = highmark;
+
+ if (highmark) {
+ /* There is now a new high-water mark for read.
+ enable the callback if needed, and see if we should
+ suspend/bufferevent_wm_unsuspend. */
+
+ if (bufev_private->read_watermarks_cb == NULL) {
+ bufev_private->read_watermarks_cb =
+ evbuffer_add_cb(bufev->input,
+ bufferevent_inbuf_wm_cb,
+ bufev);
+ }
+ evbuffer_cb_set_flags(bufev->input,
+ bufev_private->read_watermarks_cb,
+ EVBUFFER_CB_ENABLED|EVBUFFER_CB_NODEFER);
+
+ if (evbuffer_get_length(bufev->input) >= highmark)
+ bufferevent_wm_suspend_read(bufev);
+ else if (evbuffer_get_length(bufev->input) < highmark)
+ bufferevent_wm_unsuspend_read(bufev);
+ } else {
+ /* There is now no high-water mark for read. */
+ if (bufev_private->read_watermarks_cb)
+ evbuffer_cb_clear_flags(bufev->input,
+ bufev_private->read_watermarks_cb,
+ EVBUFFER_CB_ENABLED);
+ bufferevent_wm_unsuspend_read(bufev);
+ }
+ }
+ BEV_UNLOCK(bufev);
+}
+
+int
+bufferevent_getwatermark(struct bufferevent *bufev, short events,
+ size_t *lowmark, size_t *highmark)
+{
+ if (events == EV_WRITE) {
+ BEV_LOCK(bufev);
+ if (lowmark)
+ *lowmark = bufev->wm_write.low;
+ if (highmark)
+ *highmark = bufev->wm_write.high;
+ BEV_UNLOCK(bufev);
+ return 0;
+ }
+
+ if (events == EV_READ) {
+ BEV_LOCK(bufev);
+ if (lowmark)
+ *lowmark = bufev->wm_read.low;
+ if (highmark)
+ *highmark = bufev->wm_read.high;
+ BEV_UNLOCK(bufev);
+ return 0;
+ }
+ return -1;
+}
+
+int
+bufferevent_flush(struct bufferevent *bufev,
+ short iotype,
+ enum bufferevent_flush_mode mode)
+{
+ int r = -1;
+ BEV_LOCK(bufev);
+ if (bufev->be_ops->flush)
+ r = bufev->be_ops->flush(bufev, iotype, mode);
+ BEV_UNLOCK(bufev);
+ return r;
+}
+
+void
+bufferevent_incref_and_lock_(struct bufferevent *bufev)
+{
+ struct bufferevent_private *bufev_private =
+ BEV_UPCAST(bufev);
+ BEV_LOCK(bufev);
+ ++bufev_private->refcnt;
+}
+
+#if 0
+static void
+bufferevent_transfer_lock_ownership_(struct bufferevent *donor,
+ struct bufferevent *recipient)
+{
+ struct bufferevent_private *d = BEV_UPCAST(donor);
+ struct bufferevent_private *r = BEV_UPCAST(recipient);
+ if (d->lock != r->lock)
+ return;
+ if (r->own_lock)
+ return;
+ if (d->own_lock) {
+ d->own_lock = 0;
+ r->own_lock = 1;
+ }
+}
+#endif
+
+int
+bufferevent_decref_and_unlock_(struct bufferevent *bufev)
+{
+ struct bufferevent_private *bufev_private =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+ int n_cbs = 0;
+#define MAX_CBS 16
+ struct event_callback *cbs[MAX_CBS];
+
+ EVUTIL_ASSERT(bufev_private->refcnt > 0);
+
+ if (--bufev_private->refcnt) {
+ BEV_UNLOCK(bufev);
+ return 0;
+ }
+
+ if (bufev->be_ops->unlink)
+ bufev->be_ops->unlink(bufev);
+
+ /* Okay, we're out of references. Let's finalize this once all the
+ * callbacks are done running. */
+ cbs[0] = &bufev->ev_read.ev_evcallback;
+ cbs[1] = &bufev->ev_write.ev_evcallback;
+ cbs[2] = &bufev_private->deferred;
+ n_cbs = 3;
+ if (bufev_private->rate_limiting) {
+ struct event *e = &bufev_private->rate_limiting->refill_bucket_event;
+ if (event_initialized(e))
+ cbs[n_cbs++] = &e->ev_evcallback;
+ }
+ n_cbs += evbuffer_get_callbacks_(bufev->input, cbs+n_cbs, MAX_CBS-n_cbs);
+ n_cbs += evbuffer_get_callbacks_(bufev->output, cbs+n_cbs, MAX_CBS-n_cbs);
+
+ event_callback_finalize_many_(bufev->ev_base, n_cbs, cbs,
+ bufferevent_finalize_cb_);
+
+#undef MAX_CBS
+ BEV_UNLOCK(bufev);
+
+ return 1;
+}
+
+static void
+bufferevent_finalize_cb_(struct event_callback *evcb, void *arg_)
+{
+ struct bufferevent *bufev = arg_;
+ struct bufferevent *underlying;
+ struct bufferevent_private *bufev_private =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+
+ BEV_LOCK(bufev);
+ underlying = bufferevent_get_underlying(bufev);
+
+ /* Clean up the shared info */
+ if (bufev->be_ops->destruct)
+ bufev->be_ops->destruct(bufev);
+
+ /* XXX what happens if refcnt for these buffers is > 1?
+ * The buffers can share a lock with this bufferevent object,
+ * but the lock might be destroyed below. */
+ /* evbuffer will free the callbacks */
+ evbuffer_free(bufev->input);
+ evbuffer_free(bufev->output);
+
+ if (bufev_private->rate_limiting) {
+ if (bufev_private->rate_limiting->group)
+ bufferevent_remove_from_rate_limit_group_internal_(bufev,0);
+ mm_free(bufev_private->rate_limiting);
+ bufev_private->rate_limiting = NULL;
+ }
+
+
+ BEV_UNLOCK(bufev);
+
+ if (bufev_private->own_lock)
+ EVTHREAD_FREE_LOCK(bufev_private->lock,
+ EVTHREAD_LOCKTYPE_RECURSIVE);
+
+ /* Free the actual allocated memory. */
+ mm_free(((char*)bufev) - bufev->be_ops->mem_offset);
+
+ /* Release the reference to underlying now that we no longer need the
+ * reference to it. We wait this long mainly in case our lock is
+ * shared with underlying.
+ *
+ * The 'destruct' function will also drop a reference to underlying
+ * if BEV_OPT_CLOSE_ON_FREE is set.
+ *
+ * XXX Should we/can we just refcount evbuffer/bufferevent locks?
+ * It would probably save us some headaches.
+ */
+ if (underlying)
+ bufferevent_decref_(underlying);
+}
+
+int
+bufferevent_decref(struct bufferevent *bufev)
+{
+ BEV_LOCK(bufev);
+ return bufferevent_decref_and_unlock_(bufev);
+}
+
+void
+bufferevent_free(struct bufferevent *bufev)
+{
+ BEV_LOCK(bufev);
+ bufferevent_setcb(bufev, NULL, NULL, NULL, NULL);
+ bufferevent_cancel_all_(bufev);
+ bufferevent_decref_and_unlock_(bufev);
+}
+
+void
+bufferevent_incref(struct bufferevent *bufev)
+{
+ struct bufferevent_private *bufev_private =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+
+ /* XXX: now that this function is public, we might want to
+ * - return the count from this function
+ * - create a new function to atomically grab the current refcount
+ */
+ BEV_LOCK(bufev);
+ ++bufev_private->refcnt;
+ BEV_UNLOCK(bufev);
+}
+
+int
+bufferevent_enable_locking_(struct bufferevent *bufev, void *lock)
+{
+#ifdef EVENT__DISABLE_THREAD_SUPPORT
+ return -1;
+#else
+ struct bufferevent *underlying;
+
+ if (BEV_UPCAST(bufev)->lock)
+ return -1;
+ underlying = bufferevent_get_underlying(bufev);
+
+ if (!lock && underlying && BEV_UPCAST(underlying)->lock) {
+ lock = BEV_UPCAST(underlying)->lock;
+ BEV_UPCAST(bufev)->lock = lock;
+ BEV_UPCAST(bufev)->own_lock = 0;
+ } else if (!lock) {
+ EVTHREAD_ALLOC_LOCK(lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+ if (!lock)
+ return -1;
+ BEV_UPCAST(bufev)->lock = lock;
+ BEV_UPCAST(bufev)->own_lock = 1;
+ } else {
+ BEV_UPCAST(bufev)->lock = lock;
+ BEV_UPCAST(bufev)->own_lock = 0;
+ }
+ evbuffer_enable_locking(bufev->input, lock);
+ evbuffer_enable_locking(bufev->output, lock);
+
+ if (underlying && !BEV_UPCAST(underlying)->lock)
+ bufferevent_enable_locking_(underlying, lock);
+
+ return 0;
+#endif
+}
+
+int
+bufferevent_setfd(struct bufferevent *bev, evutil_socket_t fd)
+{
+ union bufferevent_ctrl_data d;
+ int res = -1;
+ d.fd = fd;
+ BEV_LOCK(bev);
+ if (bev->be_ops->ctrl)
+ res = bev->be_ops->ctrl(bev, BEV_CTRL_SET_FD, &d);
+ BEV_UNLOCK(bev);
+ return res;
+}
+
+evutil_socket_t
+bufferevent_getfd(struct bufferevent *bev)
+{
+ union bufferevent_ctrl_data d;
+ int res = -1;
+ d.fd = -1;
+ BEV_LOCK(bev);
+ if (bev->be_ops->ctrl)
+ res = bev->be_ops->ctrl(bev, BEV_CTRL_GET_FD, &d);
+ BEV_UNLOCK(bev);
+ return (res<0) ? -1 : d.fd;
+}
+
+enum bufferevent_options
+bufferevent_get_options_(struct bufferevent *bev)
+{
+ struct bufferevent_private *bev_p =
+ EVUTIL_UPCAST(bev, struct bufferevent_private, bev);
+ enum bufferevent_options options;
+
+ BEV_LOCK(bev);
+ options = bev_p->options;
+ BEV_UNLOCK(bev);
+ return options;
+}
+
+
+static void
+bufferevent_cancel_all_(struct bufferevent *bev)
+{
+ union bufferevent_ctrl_data d;
+ memset(&d, 0, sizeof(d));
+ BEV_LOCK(bev);
+ if (bev->be_ops->ctrl)
+ bev->be_ops->ctrl(bev, BEV_CTRL_CANCEL_ALL, &d);
+ BEV_UNLOCK(bev);
+}
+
+short
+bufferevent_get_enabled(struct bufferevent *bufev)
+{
+ short r;
+ BEV_LOCK(bufev);
+ r = bufev->enabled;
+ BEV_UNLOCK(bufev);
+ return r;
+}
+
+struct bufferevent *
+bufferevent_get_underlying(struct bufferevent *bev)
+{
+ union bufferevent_ctrl_data d;
+ int res = -1;
+ d.ptr = NULL;
+ BEV_LOCK(bev);
+ if (bev->be_ops->ctrl)
+ res = bev->be_ops->ctrl(bev, BEV_CTRL_GET_UNDERLYING, &d);
+ BEV_UNLOCK(bev);
+ return (res<0) ? NULL : d.ptr;
+}
+
+static void
+bufferevent_generic_read_timeout_cb(evutil_socket_t fd, short event, void *ctx)
+{
+ struct bufferevent *bev = ctx;
+ bufferevent_incref_and_lock_(bev);
+ bufferevent_disable(bev, EV_READ);
+ bufferevent_run_eventcb_(bev, BEV_EVENT_TIMEOUT|BEV_EVENT_READING, 0);
+ bufferevent_decref_and_unlock_(bev);
+}
+static void
+bufferevent_generic_write_timeout_cb(evutil_socket_t fd, short event, void *ctx)
+{
+ struct bufferevent *bev = ctx;
+ bufferevent_incref_and_lock_(bev);
+ bufferevent_disable(bev, EV_WRITE);
+ bufferevent_run_eventcb_(bev, BEV_EVENT_TIMEOUT|BEV_EVENT_WRITING, 0);
+ bufferevent_decref_and_unlock_(bev);
+}
+
+void
+bufferevent_init_generic_timeout_cbs_(struct bufferevent *bev)
+{
+ event_assign(&bev->ev_read, bev->ev_base, -1, EV_FINALIZE,
+ bufferevent_generic_read_timeout_cb, bev);
+ event_assign(&bev->ev_write, bev->ev_base, -1, EV_FINALIZE,
+ bufferevent_generic_write_timeout_cb, bev);
+}
+
+int
+bufferevent_generic_adj_timeouts_(struct bufferevent *bev)
+{
+ const short enabled = bev->enabled;
+ struct bufferevent_private *bev_p =
+ EVUTIL_UPCAST(bev, struct bufferevent_private, bev);
+ int r1=0, r2=0;
+ if ((enabled & EV_READ) && !bev_p->read_suspended &&
+ evutil_timerisset(&bev->timeout_read))
+ r1 = event_add(&bev->ev_read, &bev->timeout_read);
+ else
+ r1 = event_del(&bev->ev_read);
+
+ if ((enabled & EV_WRITE) && !bev_p->write_suspended &&
+ evutil_timerisset(&bev->timeout_write) &&
+ evbuffer_get_length(bev->output))
+ r2 = event_add(&bev->ev_write, &bev->timeout_write);
+ else
+ r2 = event_del(&bev->ev_write);
+ if (r1 < 0 || r2 < 0)
+ return -1;
+ return 0;
+}
+
+int
+bufferevent_generic_adj_existing_timeouts_(struct bufferevent *bev)
+{
+ int r = 0;
+ if (event_pending(&bev->ev_read, EV_READ, NULL)) {
+ if (evutil_timerisset(&bev->timeout_read)) {
+ if (bufferevent_add_event_(&bev->ev_read, &bev->timeout_read) < 0)
+ r = -1;
+ } else {
+ event_remove_timer(&bev->ev_read);
+ }
+ }
+ if (event_pending(&bev->ev_write, EV_WRITE, NULL)) {
+ if (evutil_timerisset(&bev->timeout_write)) {
+ if (bufferevent_add_event_(&bev->ev_write, &bev->timeout_write) < 0)
+ r = -1;
+ } else {
+ event_remove_timer(&bev->ev_write);
+ }
+ }
+ return r;
+}
+
+int
+bufferevent_add_event_(struct event *ev, const struct timeval *tv)
+{
+ if (!evutil_timerisset(tv))
+ return event_add(ev, NULL);
+ else
+ return event_add(ev, tv);
+}
+
+/* For use by user programs only; internally, we should be calling
+ either bufferevent_incref_and_lock_(), or BEV_LOCK. */
+void
+bufferevent_lock(struct bufferevent *bev)
+{
+ bufferevent_incref_and_lock_(bev);
+}
+
+void
+bufferevent_unlock(struct bufferevent *bev)
+{
+ bufferevent_decref_and_unlock_(bev);
+}
diff --git a/protocols/Telegram/tgl/libevent/bufferevent.obj b/protocols/Telegram/tgl/libevent/bufferevent.obj
new file mode 100644
index 0000000000..ae232c3748
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/bufferevent.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/bufferevent_async.c b/protocols/Telegram/tgl/libevent/bufferevent_async.c
new file mode 100644
index 0000000000..6395e57a9f
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/bufferevent_async.c
@@ -0,0 +1,686 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 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 "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef EVENT__HAVE_STDARG_H
+#include <stdarg.h>
+#endif
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
+#include <sys/queue.h>
+
+#include "event2/util.h"
+#include "event2/bufferevent.h"
+#include "event2/buffer.h"
+#include "event2/bufferevent_struct.h"
+#include "event2/event.h"
+#include "event2/util.h"
+#include "event-internal.h"
+#include "log-internal.h"
+#include "mm-internal.h"
+#include "bufferevent-internal.h"
+#include "util-internal.h"
+#include "iocp-internal.h"
+
+#ifndef SO_UPDATE_CONNECT_CONTEXT
+/* Mingw is sometimes missing this */
+#define SO_UPDATE_CONNECT_CONTEXT 0x7010
+#endif
+
+/* prototypes */
+static int be_async_enable(struct bufferevent *, short);
+static int be_async_disable(struct bufferevent *, short);
+static void be_async_destruct(struct bufferevent *);
+static int be_async_flush(struct bufferevent *, short, enum bufferevent_flush_mode);
+static int be_async_ctrl(struct bufferevent *, enum bufferevent_ctrl_op, union bufferevent_ctrl_data *);
+
+struct bufferevent_async {
+ struct bufferevent_private bev;
+ struct event_overlapped connect_overlapped;
+ struct event_overlapped read_overlapped;
+ struct event_overlapped write_overlapped;
+ size_t read_in_progress;
+ size_t write_in_progress;
+ unsigned ok : 1;
+ unsigned read_added : 1;
+ unsigned write_added : 1;
+};
+
+const struct bufferevent_ops bufferevent_ops_async = {
+ "socket_async",
+ evutil_offsetof(struct bufferevent_async, bev.bev),
+ be_async_enable,
+ be_async_disable,
+ NULL, /* Unlink */
+ be_async_destruct,
+ bufferevent_generic_adj_timeouts_,
+ be_async_flush,
+ be_async_ctrl,
+};
+
+static inline struct bufferevent_async *
+upcast(struct bufferevent *bev)
+{
+ struct bufferevent_async *bev_a;
+ if (bev->be_ops != &bufferevent_ops_async)
+ return NULL;
+ bev_a = EVUTIL_UPCAST(bev, struct bufferevent_async, bev.bev);
+ return bev_a;
+}
+
+static inline struct bufferevent_async *
+upcast_connect(struct event_overlapped *eo)
+{
+ struct bufferevent_async *bev_a;
+ bev_a = EVUTIL_UPCAST(eo, struct bufferevent_async, connect_overlapped);
+ EVUTIL_ASSERT(BEV_IS_ASYNC(&bev_a->bev.bev));
+ return bev_a;
+}
+
+static inline struct bufferevent_async *
+upcast_read(struct event_overlapped *eo)
+{
+ struct bufferevent_async *bev_a;
+ bev_a = EVUTIL_UPCAST(eo, struct bufferevent_async, read_overlapped);
+ EVUTIL_ASSERT(BEV_IS_ASYNC(&bev_a->bev.bev));
+ return bev_a;
+}
+
+static inline struct bufferevent_async *
+upcast_write(struct event_overlapped *eo)
+{
+ struct bufferevent_async *bev_a;
+ bev_a = EVUTIL_UPCAST(eo, struct bufferevent_async, write_overlapped);
+ EVUTIL_ASSERT(BEV_IS_ASYNC(&bev_a->bev.bev));
+ return bev_a;
+}
+
+static void
+bev_async_del_write(struct bufferevent_async *beva)
+{
+ struct bufferevent *bev = &beva->bev.bev;
+
+ if (beva->write_added) {
+ beva->write_added = 0;
+ event_base_del_virtual_(bev->ev_base);
+ }
+}
+
+static void
+bev_async_del_read(struct bufferevent_async *beva)
+{
+ struct bufferevent *bev = &beva->bev.bev;
+
+ if (beva->read_added) {
+ beva->read_added = 0;
+ event_base_del_virtual_(bev->ev_base);
+ }
+}
+
+static void
+bev_async_add_write(struct bufferevent_async *beva)
+{
+ struct bufferevent *bev = &beva->bev.bev;
+
+ if (!beva->write_added) {
+ beva->write_added = 1;
+ event_base_add_virtual_(bev->ev_base);
+ }
+}
+
+static void
+bev_async_add_read(struct bufferevent_async *beva)
+{
+ struct bufferevent *bev = &beva->bev.bev;
+
+ if (!beva->read_added) {
+ beva->read_added = 1;
+ event_base_add_virtual_(bev->ev_base);
+ }
+}
+
+static void
+bev_async_consider_writing(struct bufferevent_async *beva)
+{
+ size_t at_most;
+ int limit;
+ struct bufferevent *bev = &beva->bev.bev;
+
+ /* Don't write if there's a write in progress, or we do not
+ * want to write, or when there's nothing left to write. */
+ if (beva->write_in_progress || beva->bev.connecting)
+ return;
+ if (!beva->ok || !(bev->enabled&EV_WRITE) ||
+ !evbuffer_get_length(bev->output)) {
+ bev_async_del_write(beva);
+ return;
+ }
+
+ at_most = evbuffer_get_length(bev->output);
+
+ /* This is safe so long as bufferevent_get_write_max never returns
+ * more than INT_MAX. That's true for now. XXXX */
+ limit = (int)bufferevent_get_write_max_(&beva->bev);
+ if (at_most >= (size_t)limit && limit >= 0)
+ at_most = limit;
+
+ if (beva->bev.write_suspended) {
+ bev_async_del_write(beva);
+ return;
+ }
+
+ /* XXXX doesn't respect low-water mark very well. */
+ bufferevent_incref_(bev);
+ if (evbuffer_launch_write_(bev->output, at_most,
+ &beva->write_overlapped)) {
+ bufferevent_decref_(bev);
+ beva->ok = 0;
+ bufferevent_run_eventcb_(bev, BEV_EVENT_ERROR, 0);
+ } else {
+ beva->write_in_progress = at_most;
+ bufferevent_decrement_write_buckets_(&beva->bev, at_most);
+ bev_async_add_write(beva);
+ }
+}
+
+static void
+bev_async_consider_reading(struct bufferevent_async *beva)
+{
+ size_t cur_size;
+ size_t read_high;
+ size_t at_most;
+ int limit;
+ struct bufferevent *bev = &beva->bev.bev;
+
+ /* Don't read if there is a read in progress, or we do not
+ * want to read. */
+ if (beva->read_in_progress || beva->bev.connecting)
+ return;
+ if (!beva->ok || !(bev->enabled&EV_READ)) {
+ bev_async_del_read(beva);
+ return;
+ }
+
+ /* Don't read if we're full */
+ cur_size = evbuffer_get_length(bev->input);
+ read_high = bev->wm_read.high;
+ if (read_high) {
+ if (cur_size >= read_high) {
+ bev_async_del_read(beva);
+ return;
+ }
+ at_most = read_high - cur_size;
+ } else {
+ at_most = 16384; /* FIXME totally magic. */
+ }
+
+ /* XXXX This over-commits. */
+ /* XXXX see also not above on cast on bufferevent_get_write_max_() */
+ limit = (int)bufferevent_get_read_max_(&beva->bev);
+ if (at_most >= (size_t)limit && limit >= 0)
+ at_most = limit;
+
+ if (beva->bev.read_suspended) {
+ bev_async_del_read(beva);
+ return;
+ }
+
+ bufferevent_incref_(bev);
+ if (evbuffer_launch_read_(bev->input, at_most, &beva->read_overlapped)) {
+ beva->ok = 0;
+ bufferevent_run_eventcb_(bev, BEV_EVENT_ERROR, 0);
+ bufferevent_decref_(bev);
+ } else {
+ beva->read_in_progress = at_most;
+ bufferevent_decrement_read_buckets_(&beva->bev, at_most);
+ bev_async_add_read(beva);
+ }
+
+ return;
+}
+
+static void
+be_async_outbuf_callback(struct evbuffer *buf,
+ const struct evbuffer_cb_info *cbinfo,
+ void *arg)
+{
+ struct bufferevent *bev = arg;
+ struct bufferevent_async *bev_async = upcast(bev);
+
+ /* If we added data to the outbuf and were not writing before,
+ * we may want to write now. */
+
+ bufferevent_incref_and_lock_(bev);
+
+ if (cbinfo->n_added)
+ bev_async_consider_writing(bev_async);
+
+ bufferevent_decref_and_unlock_(bev);
+}
+
+static void
+be_async_inbuf_callback(struct evbuffer *buf,
+ const struct evbuffer_cb_info *cbinfo,
+ void *arg)
+{
+ struct bufferevent *bev = arg;
+ struct bufferevent_async *bev_async = upcast(bev);
+
+ /* If we drained data from the inbuf and were not reading before,
+ * we may want to read now */
+
+ bufferevent_incref_and_lock_(bev);
+
+ if (cbinfo->n_deleted)
+ bev_async_consider_reading(bev_async);
+
+ bufferevent_decref_and_unlock_(bev);
+}
+
+static int
+be_async_enable(struct bufferevent *buf, short what)
+{
+ struct bufferevent_async *bev_async = upcast(buf);
+
+ if (!bev_async->ok)
+ return -1;
+
+ if (bev_async->bev.connecting) {
+ /* Don't launch anything during connection attempts. */
+ return 0;
+ }
+
+ if (what & EV_READ)
+ BEV_RESET_GENERIC_READ_TIMEOUT(buf);
+ if (what & EV_WRITE)
+ BEV_RESET_GENERIC_WRITE_TIMEOUT(buf);
+
+ /* If we newly enable reading or writing, and we aren't reading or
+ writing already, consider launching a new read or write. */
+
+ if (what & EV_READ)
+ bev_async_consider_reading(bev_async);
+ if (what & EV_WRITE)
+ bev_async_consider_writing(bev_async);
+ return 0;
+}
+
+static int
+be_async_disable(struct bufferevent *bev, short what)
+{
+ struct bufferevent_async *bev_async = upcast(bev);
+ /* XXXX If we disable reading or writing, we may want to consider
+ * canceling any in-progress read or write operation, though it might
+ * not work. */
+
+ if (what & EV_READ) {
+ BEV_DEL_GENERIC_READ_TIMEOUT(bev);
+ bev_async_del_read(bev_async);
+ }
+ if (what & EV_WRITE) {
+ BEV_DEL_GENERIC_WRITE_TIMEOUT(bev);
+ bev_async_del_write(bev_async);
+ }
+
+ return 0;
+}
+
+static void
+be_async_destruct(struct bufferevent *bev)
+{
+ struct bufferevent_async *bev_async = upcast(bev);
+ struct bufferevent_private *bev_p = BEV_UPCAST(bev);
+ evutil_socket_t fd;
+
+ EVUTIL_ASSERT(!upcast(bev)->write_in_progress &&
+ !upcast(bev)->read_in_progress);
+
+ bev_async_del_read(bev_async);
+ bev_async_del_write(bev_async);
+
+ fd = evbuffer_overlapped_get_fd_(bev->input);
+ if (fd != (evutil_socket_t)INVALID_SOCKET &&
+ (bev_p->options & BEV_OPT_CLOSE_ON_FREE)) {
+ evutil_closesocket(fd);
+ evbuffer_overlapped_set_fd_(bev->input, INVALID_SOCKET);
+ }
+}
+
+/* GetQueuedCompletionStatus doesn't reliably yield WSA error codes, so
+ * we use WSAGetOverlappedResult to translate. */
+static void
+bev_async_set_wsa_error(struct bufferevent *bev, struct event_overlapped *eo)
+{
+ DWORD bytes, flags;
+ evutil_socket_t fd;
+
+ fd = evbuffer_overlapped_get_fd_(bev->input);
+ WSAGetOverlappedResult(fd, &eo->overlapped, &bytes, FALSE, &flags);
+}
+
+static int
+be_async_flush(struct bufferevent *bev, short what,
+ enum bufferevent_flush_mode mode)
+{
+ return 0;
+}
+
+static void
+connect_complete(struct event_overlapped *eo, ev_uintptr_t key,
+ ev_ssize_t nbytes, int ok)
+{
+ struct bufferevent_async *bev_a = upcast_connect(eo);
+ struct bufferevent *bev = &bev_a->bev.bev;
+ evutil_socket_t sock;
+
+ BEV_LOCK(bev);
+
+ EVUTIL_ASSERT(bev_a->bev.connecting);
+ bev_a->bev.connecting = 0;
+ sock = evbuffer_overlapped_get_fd_(bev_a->bev.bev.input);
+ /* XXXX Handle error? */
+ setsockopt(sock, SOL_SOCKET, SO_UPDATE_CONNECT_CONTEXT, NULL, 0);
+
+ if (ok)
+ bufferevent_async_set_connected_(bev);
+ else
+ bev_async_set_wsa_error(bev, eo);
+
+ bufferevent_run_eventcb_(bev,
+ ok? BEV_EVENT_CONNECTED : BEV_EVENT_ERROR, 0);
+
+ event_base_del_virtual_(bev->ev_base);
+
+ bufferevent_decref_and_unlock_(bev);
+}
+
+static void
+read_complete(struct event_overlapped *eo, ev_uintptr_t key,
+ ev_ssize_t nbytes, int ok)
+{
+ struct bufferevent_async *bev_a = upcast_read(eo);
+ struct bufferevent *bev = &bev_a->bev.bev;
+ short what = BEV_EVENT_READING;
+ ev_ssize_t amount_unread;
+ BEV_LOCK(bev);
+ EVUTIL_ASSERT(bev_a->read_in_progress);
+
+ amount_unread = bev_a->read_in_progress - nbytes;
+ evbuffer_commit_read_(bev->input, nbytes);
+ bev_a->read_in_progress = 0;
+ if (amount_unread)
+ bufferevent_decrement_read_buckets_(&bev_a->bev, -amount_unread);
+
+ if (!ok)
+ bev_async_set_wsa_error(bev, eo);
+
+ if (bev_a->ok) {
+ if (ok && nbytes) {
+ BEV_RESET_GENERIC_READ_TIMEOUT(bev);
+ bufferevent_trigger_nolock_(bev, EV_READ, 0);
+ bev_async_consider_reading(bev_a);
+ } else if (!ok) {
+ what |= BEV_EVENT_ERROR;
+ bev_a->ok = 0;
+ bufferevent_run_eventcb_(bev, what, 0);
+ } else if (!nbytes) {
+ what |= BEV_EVENT_EOF;
+ bev_a->ok = 0;
+ bufferevent_run_eventcb_(bev, what, 0);
+ }
+ }
+
+ bufferevent_decref_and_unlock_(bev);
+}
+
+static void
+write_complete(struct event_overlapped *eo, ev_uintptr_t key,
+ ev_ssize_t nbytes, int ok)
+{
+ struct bufferevent_async *bev_a = upcast_write(eo);
+ struct bufferevent *bev = &bev_a->bev.bev;
+ short what = BEV_EVENT_WRITING;
+ ev_ssize_t amount_unwritten;
+
+ BEV_LOCK(bev);
+ EVUTIL_ASSERT(bev_a->write_in_progress);
+
+ amount_unwritten = bev_a->write_in_progress - nbytes;
+ evbuffer_commit_write_(bev->output, nbytes);
+ bev_a->write_in_progress = 0;
+
+ if (amount_unwritten)
+ bufferevent_decrement_write_buckets_(&bev_a->bev,
+ -amount_unwritten);
+
+
+ if (!ok)
+ bev_async_set_wsa_error(bev, eo);
+
+ if (bev_a->ok) {
+ if (ok && nbytes) {
+ BEV_RESET_GENERIC_WRITE_TIMEOUT(bev);
+ bufferevent_trigger_nolock_(bev, EV_WRITE, 0);
+ bev_async_consider_writing(bev_a);
+ } else if (!ok) {
+ what |= BEV_EVENT_ERROR;
+ bev_a->ok = 0;
+ bufferevent_run_eventcb_(bev, what, 0);
+ } else if (!nbytes) {
+ what |= BEV_EVENT_EOF;
+ bev_a->ok = 0;
+ bufferevent_run_eventcb_(bev, what, 0);
+ }
+ }
+
+ bufferevent_decref_and_unlock_(bev);
+}
+
+struct bufferevent *
+bufferevent_async_new_(struct event_base *base,
+ evutil_socket_t fd, int options)
+{
+ struct bufferevent_async *bev_a;
+ struct bufferevent *bev;
+ struct event_iocp_port *iocp;
+
+ options |= BEV_OPT_THREADSAFE;
+
+ if (!(iocp = event_base_get_iocp_(base)))
+ return NULL;
+
+ if (fd >= 0 && event_iocp_port_associate_(iocp, fd, 1)<0) {
+ int err = GetLastError();
+ /* We may have alrady associated this fd with a port.
+ * Let's hope it's this port, and that the error code
+ * for doing this neer changes. */
+ if (err != ERROR_INVALID_PARAMETER)
+ return NULL;
+ }
+
+ if (!(bev_a = mm_calloc(1, sizeof(struct bufferevent_async))))
+ return NULL;
+
+ bev = &bev_a->bev.bev;
+ if (!(bev->input = evbuffer_overlapped_new_(fd))) {
+ mm_free(bev_a);
+ return NULL;
+ }
+ if (!(bev->output = evbuffer_overlapped_new_(fd))) {
+ evbuffer_free(bev->input);
+ mm_free(bev_a);
+ return NULL;
+ }
+
+ if (bufferevent_init_common_(&bev_a->bev, base, &bufferevent_ops_async,
+ options)<0)
+ goto err;
+
+ evbuffer_add_cb(bev->input, be_async_inbuf_callback, bev);
+ evbuffer_add_cb(bev->output, be_async_outbuf_callback, bev);
+
+ event_overlapped_init_(&bev_a->connect_overlapped, connect_complete);
+ event_overlapped_init_(&bev_a->read_overlapped, read_complete);
+ event_overlapped_init_(&bev_a->write_overlapped, write_complete);
+
+ bufferevent_init_generic_timeout_cbs_(bev);
+
+ bev_a->ok = fd >= 0;
+
+ return bev;
+err:
+ bufferevent_free(&bev_a->bev.bev);
+ return NULL;
+}
+
+void
+bufferevent_async_set_connected_(struct bufferevent *bev)
+{
+ struct bufferevent_async *bev_async = upcast(bev);
+ bev_async->ok = 1;
+ bufferevent_init_generic_timeout_cbs_(bev);
+ /* Now's a good time to consider reading/writing */
+ be_async_enable(bev, bev->enabled);
+}
+
+int
+bufferevent_async_can_connect_(struct bufferevent *bev)
+{
+ const struct win32_extension_fns *ext =
+ event_get_win32_extension_fns_();
+
+ if (BEV_IS_ASYNC(bev) &&
+ event_base_get_iocp_(bev->ev_base) &&
+ ext && ext->ConnectEx)
+ return 1;
+
+ return 0;
+}
+
+int
+bufferevent_async_connect_(struct bufferevent *bev, evutil_socket_t fd,
+ const struct sockaddr *sa, int socklen)
+{
+ BOOL rc;
+ struct bufferevent_async *bev_async = upcast(bev);
+ struct sockaddr_storage ss;
+ const struct win32_extension_fns *ext =
+ event_get_win32_extension_fns_();
+
+ EVUTIL_ASSERT(ext && ext->ConnectEx && fd >= 0 && sa != NULL);
+
+ /* ConnectEx() requires that the socket be bound to an address
+ * with bind() before using, otherwise it will fail. We attempt
+ * to issue a bind() here, taking into account that the error
+ * code is set to WSAEINVAL when the socket is already bound. */
+ memset(&ss, 0, sizeof(ss));
+ if (sa->sa_family == AF_INET) {
+ struct sockaddr_in *sin = (struct sockaddr_in *)&ss;
+ sin->sin_family = AF_INET;
+ sin->sin_addr.s_addr = INADDR_ANY;
+ } else if (sa->sa_family == AF_INET6) {
+ struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)&ss;
+ sin6->sin6_family = AF_INET6;
+ sin6->sin6_addr = in6addr_any;
+ } else {
+ /* Well, the user will have to bind() */
+ return -1;
+ }
+ if (bind(fd, (struct sockaddr *)&ss, sizeof(ss)) < 0 &&
+ WSAGetLastError() != WSAEINVAL)
+ return -1;
+
+ event_base_add_virtual_(bev->ev_base);
+ bufferevent_incref_(bev);
+ rc = ext->ConnectEx(fd, sa, socklen, NULL, 0, NULL,
+ &bev_async->connect_overlapped.overlapped);
+ if (rc || WSAGetLastError() == ERROR_IO_PENDING)
+ return 0;
+
+ event_base_del_virtual_(bev->ev_base);
+ bufferevent_decref_(bev);
+
+ return -1;
+}
+
+static int
+be_async_ctrl(struct bufferevent *bev, enum bufferevent_ctrl_op op,
+ union bufferevent_ctrl_data *data)
+{
+ switch (op) {
+ case BEV_CTRL_GET_FD:
+ data->fd = evbuffer_overlapped_get_fd_(bev->input);
+ return 0;
+ case BEV_CTRL_SET_FD: {
+ struct event_iocp_port *iocp;
+
+ if (data->fd == evbuffer_overlapped_get_fd_(bev->input))
+ return 0;
+ if (!(iocp = event_base_get_iocp_(bev->ev_base)))
+ return -1;
+ if (event_iocp_port_associate_(iocp, data->fd, 1) < 0)
+ return -1;
+ evbuffer_overlapped_set_fd_(bev->input, data->fd);
+ evbuffer_overlapped_set_fd_(bev->output, data->fd);
+ return 0;
+ }
+ case BEV_CTRL_CANCEL_ALL: {
+ struct bufferevent_async *bev_a = upcast(bev);
+ evutil_socket_t fd = evbuffer_overlapped_get_fd_(bev->input);
+ if (fd != (evutil_socket_t)INVALID_SOCKET &&
+ (bev_a->bev.options & BEV_OPT_CLOSE_ON_FREE)) {
+ closesocket(fd);
+ evbuffer_overlapped_set_fd_(bev->input, INVALID_SOCKET);
+ }
+ bev_a->ok = 0;
+ return 0;
+ }
+ case BEV_CTRL_GET_UNDERLYING:
+ default:
+ return -1;
+ }
+}
+
+
diff --git a/protocols/Telegram/tgl/libevent/bufferevent_async.obj b/protocols/Telegram/tgl/libevent/bufferevent_async.obj
new file mode 100644
index 0000000000..2318267d42
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/bufferevent_async.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/bufferevent_filter.c b/protocols/Telegram/tgl/libevent/bufferevent_filter.c
new file mode 100644
index 0000000000..6c3ffc4f2d
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/bufferevent_filter.c
@@ -0,0 +1,555 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ * Copyright (c) 2002-2006 Niels Provos <provos@citi.umich.edu>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 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 "evconfig-private.h"
+
+#include <sys/types.h>
+
+#include "event2/event-config.h"
+
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef EVENT__HAVE_STDARG_H
+#include <stdarg.h>
+#endif
+
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+
+#include "event2/util.h"
+#include "event2/bufferevent.h"
+#include "event2/buffer.h"
+#include "event2/bufferevent_struct.h"
+#include "event2/event.h"
+#include "log-internal.h"
+#include "mm-internal.h"
+#include "bufferevent-internal.h"
+#include "util-internal.h"
+
+/* prototypes */
+static int be_filter_enable(struct bufferevent *, short);
+static int be_filter_disable(struct bufferevent *, short);
+static void be_filter_unlink(struct bufferevent *);
+static void be_filter_destruct(struct bufferevent *);
+
+static void be_filter_readcb(struct bufferevent *, void *);
+static void be_filter_writecb(struct bufferevent *, void *);
+static void be_filter_eventcb(struct bufferevent *, short, void *);
+static int be_filter_flush(struct bufferevent *bufev,
+ short iotype, enum bufferevent_flush_mode mode);
+static int be_filter_ctrl(struct bufferevent *, enum bufferevent_ctrl_op, union bufferevent_ctrl_data *);
+
+static void bufferevent_filtered_outbuf_cb(struct evbuffer *buf,
+ const struct evbuffer_cb_info *info, void *arg);
+
+struct bufferevent_filtered {
+ struct bufferevent_private bev;
+
+ /** The bufferevent that we read/write filtered data from/to. */
+ struct bufferevent *underlying;
+ /** A callback on our outbuf to notice when somebody adds data */
+ struct evbuffer_cb_entry *outbuf_cb;
+ /** True iff we have received an EOF callback from the underlying
+ * bufferevent. */
+ unsigned got_eof;
+
+ /** Function to free context when we're done. */
+ void (*free_context)(void *);
+ /** Input filter */
+ bufferevent_filter_cb process_in;
+ /** Output filter */
+ bufferevent_filter_cb process_out;
+ /** User-supplied argument to the filters. */
+ void *context;
+};
+
+const struct bufferevent_ops bufferevent_ops_filter = {
+ "filter",
+ evutil_offsetof(struct bufferevent_filtered, bev.bev),
+ be_filter_enable,
+ be_filter_disable,
+ be_filter_unlink,
+ be_filter_destruct,
+ bufferevent_generic_adj_timeouts_,
+ be_filter_flush,
+ be_filter_ctrl,
+};
+
+/* Given a bufferevent that's really the bev filter of a bufferevent_filtered,
+ * return that bufferevent_filtered. Returns NULL otherwise.*/
+static inline struct bufferevent_filtered *
+upcast(struct bufferevent *bev)
+{
+ struct bufferevent_filtered *bev_f;
+ if (bev->be_ops != &bufferevent_ops_filter)
+ return NULL;
+ bev_f = (void*)( ((char*)bev) -
+ evutil_offsetof(struct bufferevent_filtered, bev.bev));
+ EVUTIL_ASSERT(bev_f->bev.bev.be_ops == &bufferevent_ops_filter);
+ return bev_f;
+}
+
+#define downcast(bev_f) (&(bev_f)->bev.bev)
+
+/** Return 1 iff bevf's underlying bufferevent's output buffer is at or
+ * over its high watermark such that we should not write to it in a given
+ * flush mode. */
+static int
+be_underlying_writebuf_full(struct bufferevent_filtered *bevf,
+ enum bufferevent_flush_mode state)
+{
+ struct bufferevent *u = bevf->underlying;
+ return state == BEV_NORMAL &&
+ u->wm_write.high &&
+ evbuffer_get_length(u->output) >= u->wm_write.high;
+}
+
+/** Return 1 if our input buffer is at or over its high watermark such that we
+ * should not write to it in a given flush mode. */
+static int
+be_readbuf_full(struct bufferevent_filtered *bevf,
+ enum bufferevent_flush_mode state)
+{
+ struct bufferevent *bufev = downcast(bevf);
+ return state == BEV_NORMAL &&
+ bufev->wm_read.high &&
+ evbuffer_get_length(bufev->input) >= bufev->wm_read.high;
+}
+
+
+/* Filter to use when we're created with a NULL filter. */
+static enum bufferevent_filter_result
+be_null_filter(struct evbuffer *src, struct evbuffer *dst, ev_ssize_t lim,
+ enum bufferevent_flush_mode state, void *ctx)
+{
+ (void)state;
+ if (evbuffer_remove_buffer(src, dst, lim) == 0)
+ return BEV_OK;
+ else
+ return BEV_ERROR;
+}
+
+struct bufferevent *
+bufferevent_filter_new(struct bufferevent *underlying,
+ bufferevent_filter_cb input_filter,
+ bufferevent_filter_cb output_filter,
+ int options,
+ void (*free_context)(void *),
+ void *ctx)
+{
+ struct bufferevent_filtered *bufev_f;
+ int tmp_options = options & ~BEV_OPT_THREADSAFE;
+
+ if (!underlying)
+ return NULL;
+
+ if (!input_filter)
+ input_filter = be_null_filter;
+ if (!output_filter)
+ output_filter = be_null_filter;
+
+ bufev_f = mm_calloc(1, sizeof(struct bufferevent_filtered));
+ if (!bufev_f)
+ return NULL;
+
+ if (bufferevent_init_common_(&bufev_f->bev, underlying->ev_base,
+ &bufferevent_ops_filter, tmp_options) < 0) {
+ mm_free(bufev_f);
+ return NULL;
+ }
+ if (options & BEV_OPT_THREADSAFE) {
+ bufferevent_enable_locking_(downcast(bufev_f), NULL);
+ }
+
+ bufev_f->underlying = underlying;
+
+ bufev_f->process_in = input_filter;
+ bufev_f->process_out = output_filter;
+ bufev_f->free_context = free_context;
+ bufev_f->context = ctx;
+
+ bufferevent_setcb(bufev_f->underlying,
+ be_filter_readcb, be_filter_writecb, be_filter_eventcb, bufev_f);
+
+ bufev_f->outbuf_cb = evbuffer_add_cb(downcast(bufev_f)->output,
+ bufferevent_filtered_outbuf_cb, bufev_f);
+
+ bufferevent_init_generic_timeout_cbs_(downcast(bufev_f));
+ bufferevent_incref_(underlying);
+
+ bufferevent_enable(underlying, EV_READ|EV_WRITE);
+ bufferevent_suspend_read_(underlying, BEV_SUSPEND_FILT_READ);
+
+ return downcast(bufev_f);
+}
+
+static void
+be_filter_unlink(struct bufferevent *bev)
+{
+ struct bufferevent_filtered *bevf = upcast(bev);
+ EVUTIL_ASSERT(bevf);
+
+ if (bevf->bev.options & BEV_OPT_CLOSE_ON_FREE) {
+ /* Yes, there is also a decref in bufferevent_decref_.
+ * That decref corresponds to the incref when we set
+ * underlying for the first time. This decref is an
+ * extra one to remove the last reference.
+ */
+ if (BEV_UPCAST(bevf->underlying)->refcnt < 2) {
+ event_warnx("BEV_OPT_CLOSE_ON_FREE set on an "
+ "bufferevent with too few references");
+ } else {
+ bufferevent_free(bevf->underlying);
+ }
+ } else {
+ if (bevf->underlying) {
+ if (bevf->underlying->errorcb == be_filter_eventcb)
+ bufferevent_setcb(bevf->underlying,
+ NULL, NULL, NULL, NULL);
+ bufferevent_unsuspend_read_(bevf->underlying,
+ BEV_SUSPEND_FILT_READ);
+ }
+ }
+}
+
+static void
+be_filter_destruct(struct bufferevent *bev)
+{
+ struct bufferevent_filtered *bevf = upcast(bev);
+ EVUTIL_ASSERT(bevf);
+ if (bevf->free_context)
+ bevf->free_context(bevf->context);
+}
+
+static int
+be_filter_enable(struct bufferevent *bev, short event)
+{
+ struct bufferevent_filtered *bevf = upcast(bev);
+ if (event & EV_WRITE)
+ BEV_RESET_GENERIC_WRITE_TIMEOUT(bev);
+
+ if (event & EV_READ) {
+ BEV_RESET_GENERIC_READ_TIMEOUT(bev);
+ bufferevent_unsuspend_read_(bevf->underlying,
+ BEV_SUSPEND_FILT_READ);
+ }
+ return 0;
+}
+
+static int
+be_filter_disable(struct bufferevent *bev, short event)
+{
+ struct bufferevent_filtered *bevf = upcast(bev);
+ if (event & EV_WRITE)
+ BEV_DEL_GENERIC_WRITE_TIMEOUT(bev);
+ if (event & EV_READ) {
+ BEV_DEL_GENERIC_READ_TIMEOUT(bev);
+ bufferevent_suspend_read_(bevf->underlying,
+ BEV_SUSPEND_FILT_READ);
+ }
+ return 0;
+}
+
+static enum bufferevent_filter_result
+be_filter_process_input(struct bufferevent_filtered *bevf,
+ enum bufferevent_flush_mode state,
+ int *processed_out)
+{
+ enum bufferevent_filter_result res;
+ struct bufferevent *bev = downcast(bevf);
+
+ if (state == BEV_NORMAL) {
+ /* If we're in 'normal' mode, don't urge data on the filter
+ * unless we're reading data and under our high-water mark.*/
+ if (!(bev->enabled & EV_READ) ||
+ be_readbuf_full(bevf, state))
+ return BEV_OK;
+ }
+
+ do {
+ ev_ssize_t limit = -1;
+ if (state == BEV_NORMAL && bev->wm_read.high)
+ limit = bev->wm_read.high -
+ evbuffer_get_length(bev->input);
+
+ res = bevf->process_in(bevf->underlying->input,
+ bev->input, limit, state, bevf->context);
+
+ if (res == BEV_OK)
+ *processed_out = 1;
+ } while (res == BEV_OK &&
+ (bev->enabled & EV_READ) &&
+ evbuffer_get_length(bevf->underlying->input) &&
+ !be_readbuf_full(bevf, state));
+
+ if (*processed_out)
+ BEV_RESET_GENERIC_READ_TIMEOUT(bev);
+
+ return res;
+}
+
+
+static enum bufferevent_filter_result
+be_filter_process_output(struct bufferevent_filtered *bevf,
+ enum bufferevent_flush_mode state,
+ int *processed_out)
+{
+ /* Requires references and lock: might call writecb */
+ enum bufferevent_filter_result res = BEV_OK;
+ struct bufferevent *bufev = downcast(bevf);
+ int again = 0;
+
+ if (state == BEV_NORMAL) {
+ /* If we're in 'normal' mode, don't urge data on the
+ * filter unless we're writing data, and the underlying
+ * bufferevent is accepting data, and we have data to
+ * give the filter. If we're in 'flush' or 'finish',
+ * call the filter no matter what. */
+ if (!(bufev->enabled & EV_WRITE) ||
+ be_underlying_writebuf_full(bevf, state) ||
+ !evbuffer_get_length(bufev->output))
+ return BEV_OK;
+ }
+
+ /* disable the callback that calls this function
+ when the user adds to the output buffer. */
+ evbuffer_cb_set_flags(bufev->output, bevf->outbuf_cb, 0);
+
+ do {
+ int processed = 0;
+ again = 0;
+
+ do {
+ ev_ssize_t limit = -1;
+ if (state == BEV_NORMAL &&
+ bevf->underlying->wm_write.high)
+ limit = bevf->underlying->wm_write.high -
+ evbuffer_get_length(bevf->underlying->output);
+
+ res = bevf->process_out(downcast(bevf)->output,
+ bevf->underlying->output,
+ limit,
+ state,
+ bevf->context);
+
+ if (res == BEV_OK)
+ processed = *processed_out = 1;
+ } while (/* Stop if the filter wasn't successful...*/
+ res == BEV_OK &&
+ /* Or if we aren't writing any more. */
+ (bufev->enabled & EV_WRITE) &&
+ /* Of if we have nothing more to write and we are
+ * not flushing. */
+ evbuffer_get_length(bufev->output) &&
+ /* Or if we have filled the underlying output buffer. */
+ !be_underlying_writebuf_full(bevf,state));
+
+ if (processed) {
+ /* call the write callback.*/
+ bufferevent_trigger_nolock_(bufev, EV_WRITE, 0);
+
+ if (res == BEV_OK &&
+ (bufev->enabled & EV_WRITE) &&
+ evbuffer_get_length(bufev->output) &&
+ !be_underlying_writebuf_full(bevf, state)) {
+ again = 1;
+ }
+ }
+ } while (again);
+
+ /* reenable the outbuf_cb */
+ evbuffer_cb_set_flags(bufev->output,bevf->outbuf_cb,
+ EVBUFFER_CB_ENABLED);
+
+ if (*processed_out)
+ BEV_RESET_GENERIC_WRITE_TIMEOUT(bufev);
+
+ return res;
+}
+
+/* Called when the size of our outbuf changes. */
+static void
+bufferevent_filtered_outbuf_cb(struct evbuffer *buf,
+ const struct evbuffer_cb_info *cbinfo, void *arg)
+{
+ struct bufferevent_filtered *bevf = arg;
+ struct bufferevent *bev = downcast(bevf);
+
+ if (cbinfo->n_added) {
+ int processed_any = 0;
+ /* Somebody added more data to the output buffer. Try to
+ * process it, if we should. */
+ bufferevent_incref_and_lock_(bev);
+ be_filter_process_output(bevf, BEV_NORMAL, &processed_any);
+ bufferevent_decref_and_unlock_(bev);
+ }
+}
+
+/* Called when the underlying socket has read. */
+static void
+be_filter_readcb(struct bufferevent *underlying, void *me_)
+{
+ struct bufferevent_filtered *bevf = me_;
+ enum bufferevent_filter_result res;
+ enum bufferevent_flush_mode state;
+ struct bufferevent *bufev = downcast(bevf);
+ struct bufferevent_private *bufev_private = BEV_UPCAST(bufev);
+ int processed_any = 0;
+
+ BEV_LOCK(bufev);
+
+ // It's possible our refcount is 0 at this point if another thread free'd our filterevent
+ EVUTIL_ASSERT(bufev_private->refcnt >= 0);
+
+ // If our refcount is > 0
+ if (bufev_private->refcnt > 0) {
+
+ if (bevf->got_eof)
+ state = BEV_FINISHED;
+ else
+ state = BEV_NORMAL;
+
+ /* XXXX use return value */
+ res = be_filter_process_input(bevf, state, &processed_any);
+ (void)res;
+
+ /* XXX This should be in process_input, not here. There are
+ * other places that can call process-input, and they should
+ * force readcb calls as needed. */
+ if (processed_any)
+ bufferevent_trigger_nolock_(bufev, EV_READ, 0);
+ }
+
+ BEV_UNLOCK(bufev);
+}
+
+/* Called when the underlying socket has drained enough that we can write to
+ it. */
+static void
+be_filter_writecb(struct bufferevent *underlying, void *me_)
+{
+ struct bufferevent_filtered *bevf = me_;
+ struct bufferevent *bev = downcast(bevf);
+ struct bufferevent_private *bufev_private = BEV_UPCAST(bev);
+ int processed_any = 0;
+
+ BEV_LOCK(bev);
+
+ // It's possible our refcount is 0 at this point if another thread free'd our filterevent
+ EVUTIL_ASSERT(bufev_private->refcnt >= 0);
+
+ // If our refcount is > 0
+ if (bufev_private->refcnt > 0) {
+ be_filter_process_output(bevf, BEV_NORMAL, &processed_any);
+ }
+
+ BEV_UNLOCK(bev);
+}
+
+/* Called when the underlying socket has given us an error */
+static void
+be_filter_eventcb(struct bufferevent *underlying, short what, void *me_)
+{
+ struct bufferevent_filtered *bevf = me_;
+ struct bufferevent *bev = downcast(bevf);
+ struct bufferevent_private *bufev_private = BEV_UPCAST(bev);
+
+ BEV_LOCK(bev);
+
+ // It's possible our refcount is 0 at this point if another thread free'd our filterevent
+ EVUTIL_ASSERT(bufev_private->refcnt >= 0);
+
+ // If our refcount is > 0
+ if (bufev_private->refcnt > 0) {
+
+ /* All we can really to is tell our own eventcb. */
+ bufferevent_run_eventcb_(bev, what, 0);
+ }
+
+ BEV_UNLOCK(bev);
+}
+
+static int
+be_filter_flush(struct bufferevent *bufev,
+ short iotype, enum bufferevent_flush_mode mode)
+{
+ struct bufferevent_filtered *bevf = upcast(bufev);
+ int processed_any = 0;
+ EVUTIL_ASSERT(bevf);
+
+ bufferevent_incref_and_lock_(bufev);
+
+ if (iotype & EV_READ) {
+ be_filter_process_input(bevf, mode, &processed_any);
+ }
+ if (iotype & EV_WRITE) {
+ be_filter_process_output(bevf, mode, &processed_any);
+ }
+ /* XXX check the return value? */
+ /* XXX does this want to recursively call lower-level flushes? */
+ bufferevent_flush(bevf->underlying, iotype, mode);
+
+ bufferevent_decref_and_unlock_(bufev);
+
+ return processed_any;
+}
+
+static int
+be_filter_ctrl(struct bufferevent *bev, enum bufferevent_ctrl_op op,
+ union bufferevent_ctrl_data *data)
+{
+ struct bufferevent_filtered *bevf;
+ switch (op) {
+ case BEV_CTRL_GET_UNDERLYING:
+ bevf = upcast(bev);
+ data->ptr = bevf->underlying;
+ return 0;
+ case BEV_CTRL_SET_FD:
+ bevf = upcast(bev);
+
+ if (bevf->underlying &&
+ bevf->underlying->be_ops &&
+ bevf->underlying->be_ops->ctrl) {
+ return (bevf->underlying->be_ops->ctrl)(bevf->underlying, op, data);
+ }
+
+ case BEV_CTRL_GET_FD:
+ case BEV_CTRL_CANCEL_ALL:
+ default:
+ return -1;
+ }
+
+ return -1;
+}
diff --git a/protocols/Telegram/tgl/libevent/bufferevent_filter.obj b/protocols/Telegram/tgl/libevent/bufferevent_filter.obj
new file mode 100644
index 0000000000..b9e202e3cf
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/bufferevent_filter.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/bufferevent_openssl.c b/protocols/Telegram/tgl/libevent/bufferevent_openssl.c
new file mode 100644
index 0000000000..37478b6a83
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/bufferevent_openssl.c
@@ -0,0 +1,1484 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+
+// Get rid of OSX 10.7 and greater deprecation warnings.
+#if defined(__APPLE__) && defined(__clang__)
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#include <sys/types.h>
+
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef EVENT__HAVE_STDARG_H
+#include <stdarg.h>
+#endif
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+
+#include "event2/bufferevent.h"
+#include "event2/bufferevent_struct.h"
+#include "event2/bufferevent_ssl.h"
+#include "event2/buffer.h"
+#include "event2/event.h"
+
+#include "mm-internal.h"
+#include "bufferevent-internal.h"
+#include "log-internal.h"
+
+#include <openssl/bio.h>
+#include <openssl/ssl.h>
+#include <openssl/err.h>
+
+/*
+ * Define an OpenSSL bio that targets a bufferevent.
+ */
+
+/* --------------------
+ A BIO is an OpenSSL abstraction that handles reading and writing data. The
+ library will happily speak SSL over anything that implements a BIO
+ interface.
+
+ Here we define a BIO implementation that directs its output to a
+ bufferevent. We'll want to use this only when none of OpenSSL's built-in
+ IO mechanisms work for us.
+ -------------------- */
+
+/* every BIO type needs its own integer type value. */
+#define BIO_TYPE_LIBEVENT 57
+/* ???? Arguably, we should set BIO_TYPE_FILTER or BIO_TYPE_SOURCE_SINK on
+ * this. */
+
+#if 0
+static void
+print_err(int val)
+{
+ int err;
+ printf("Error was %d\n", val);
+
+ while ((err = ERR_get_error())) {
+ const char *msg = (const char*)ERR_reason_error_string(err);
+ const char *lib = (const char*)ERR_lib_error_string(err);
+ const char *func = (const char*)ERR_func_error_string(err);
+
+ printf("%s in %s %s\n", msg, lib, func);
+ }
+}
+#else
+#define print_err(v) ((void)0)
+#endif
+
+/* Called to initialize a new BIO */
+static int
+bio_bufferevent_new(BIO *b)
+{
+ b->init = 0;
+ b->num = -1;
+ b->ptr = NULL; /* We'll be putting the bufferevent in this field.*/
+ b->flags = 0;
+ return 1;
+}
+
+/* Called to uninitialize the BIO. */
+static int
+bio_bufferevent_free(BIO *b)
+{
+ if (!b)
+ return 0;
+ if (b->shutdown) {
+ if (b->init && b->ptr)
+ bufferevent_free(b->ptr);
+ b->init = 0;
+ b->flags = 0;
+ b->ptr = NULL;
+ }
+ return 1;
+}
+
+/* Called to extract data from the BIO. */
+static int
+bio_bufferevent_read(BIO *b, char *out, int outlen)
+{
+ int r = 0;
+ struct evbuffer *input;
+
+ BIO_clear_retry_flags(b);
+
+ if (!out)
+ return 0;
+ if (!b->ptr)
+ return -1;
+
+ input = bufferevent_get_input(b->ptr);
+ if (evbuffer_get_length(input) == 0) {
+ /* If there's no data to read, say so. */
+ BIO_set_retry_read(b);
+ return -1;
+ } else {
+ r = evbuffer_remove(input, out, outlen);
+ }
+
+ return r;
+}
+
+/* Called to write data info the BIO */
+static int
+bio_bufferevent_write(BIO *b, const char *in, int inlen)
+{
+ struct bufferevent *bufev = b->ptr;
+ struct evbuffer *output;
+ size_t outlen;
+
+ BIO_clear_retry_flags(b);
+
+ if (!b->ptr)
+ return -1;
+
+ output = bufferevent_get_output(bufev);
+ outlen = evbuffer_get_length(output);
+
+ /* Copy only as much data onto the output buffer as can fit under the
+ * high-water mark. */
+ if (bufev->wm_write.high && bufev->wm_write.high <= (outlen+inlen)) {
+ if (bufev->wm_write.high <= outlen) {
+ /* If no data can fit, we'll need to retry later. */
+ BIO_set_retry_write(b);
+ return -1;
+ }
+ inlen = bufev->wm_write.high - outlen;
+ }
+
+ EVUTIL_ASSERT(inlen > 0);
+ evbuffer_add(output, in, inlen);
+ return inlen;
+}
+
+/* Called to handle various requests */
+static long
+bio_bufferevent_ctrl(BIO *b, int cmd, long num, void *ptr)
+{
+ struct bufferevent *bufev = b->ptr;
+ long ret = 1;
+
+ switch (cmd) {
+ case BIO_CTRL_GET_CLOSE:
+ ret = b->shutdown;
+ break;
+ case BIO_CTRL_SET_CLOSE:
+ b->shutdown = (int)num;
+ break;
+ case BIO_CTRL_PENDING:
+ ret = evbuffer_get_length(bufferevent_get_input(bufev)) != 0;
+ break;
+ case BIO_CTRL_WPENDING:
+ ret = evbuffer_get_length(bufferevent_get_output(bufev)) != 0;
+ break;
+ /* XXXX These two are given a special-case treatment because
+ * of cargo-cultism. I should come up with a better reason. */
+ case BIO_CTRL_DUP:
+ case BIO_CTRL_FLUSH:
+ ret = 1;
+ break;
+ default:
+ ret = 0;
+ break;
+ }
+ return ret;
+}
+
+/* Called to write a string to the BIO */
+static int
+bio_bufferevent_puts(BIO *b, const char *s)
+{
+ return bio_bufferevent_write(b, s, strlen(s));
+}
+
+/* Method table for the bufferevent BIO */
+static BIO_METHOD methods_bufferevent = {
+ BIO_TYPE_LIBEVENT, "bufferevent",
+ bio_bufferevent_write,
+ bio_bufferevent_read,
+ bio_bufferevent_puts,
+ NULL /* bio_bufferevent_gets */,
+ bio_bufferevent_ctrl,
+ bio_bufferevent_new,
+ bio_bufferevent_free,
+ NULL /* callback_ctrl */,
+};
+
+/* Return the method table for the bufferevents BIO */
+static BIO_METHOD *
+BIO_s_bufferevent(void)
+{
+ return &methods_bufferevent;
+}
+
+/* Create a new BIO to wrap communication around a bufferevent. If close_flag
+ * is true, the bufferevent will be freed when the BIO is closed. */
+static BIO *
+BIO_new_bufferevent(struct bufferevent *bufferevent, int close_flag)
+{
+ BIO *result;
+ if (!bufferevent)
+ return NULL;
+ if (!(result = BIO_new(BIO_s_bufferevent())))
+ return NULL;
+ result->init = 1;
+ result->ptr = bufferevent;
+ result->shutdown = close_flag ? 1 : 0;
+ return result;
+}
+
+/* --------------------
+ Now, here's the OpenSSL-based implementation of bufferevent.
+
+ The implementation comes in two flavors: one that connects its SSL object
+ to an underlying bufferevent using a BIO_bufferevent, and one that has the
+ SSL object connect to a socket directly. The latter should generally be
+ faster, except on Windows, where your best bet is using a
+ bufferevent_async.
+
+ (OpenSSL supports many other BIO types, too. But we can't use any unless
+ we have a good way to get notified when they become readable/writable.)
+ -------------------- */
+
+struct bio_data_counts {
+ unsigned long n_written;
+ unsigned long n_read;
+};
+
+struct bufferevent_openssl {
+ /* Shared fields with common bufferevent implementation code.
+ If we were set up with an underlying bufferevent, we use the
+ events here as timers only. If we have an SSL, then we use
+ the events as socket events.
+ */
+ struct bufferevent_private bev;
+ /* An underlying bufferevent that we're directing our output to.
+ If it's NULL, then we're connected to an fd, not an evbuffer. */
+ struct bufferevent *underlying;
+ /* The SSL object doing our encryption. */
+ SSL *ssl;
+
+ /* A callback that's invoked when data arrives on our outbuf so we
+ know to write data to the SSL. */
+ struct evbuffer_cb_entry *outbuf_cb;
+
+ /* A count of how much data the bios have read/written total. Used
+ for rate-limiting. */
+ struct bio_data_counts counts;
+
+ /* If this value is greater than 0, then the last SSL_write blocked,
+ * and we need to try it again with this many bytes. */
+ ev_ssize_t last_write;
+
+#define NUM_ERRORS 3
+ ev_uint32_t errors[NUM_ERRORS];
+
+ /* When we next get available space, we should say "read" instead of
+ "write". This can happen if there's a renegotiation during a read
+ operation. */
+ unsigned read_blocked_on_write : 1;
+ /* When we next get data, we should say "write" instead of "read". */
+ unsigned write_blocked_on_read : 1;
+ /* Treat TCP close before SSL close on SSL >= v3 as clean EOF. */
+ unsigned allow_dirty_shutdown : 1;
+ /* XXX */
+ unsigned n_errors : 2;
+
+ /* Are we currently connecting, accepting, or doing IO? */
+ unsigned state : 2;
+};
+
+static int be_openssl_enable(struct bufferevent *, short);
+static int be_openssl_disable(struct bufferevent *, short);
+static void be_openssl_unlink(struct bufferevent *);
+static void be_openssl_destruct(struct bufferevent *);
+static int be_openssl_adj_timeouts(struct bufferevent *);
+static int be_openssl_flush(struct bufferevent *bufev,
+ short iotype, enum bufferevent_flush_mode mode);
+static int be_openssl_ctrl(struct bufferevent *, enum bufferevent_ctrl_op, union bufferevent_ctrl_data *);
+
+const struct bufferevent_ops bufferevent_ops_openssl = {
+ "ssl",
+ evutil_offsetof(struct bufferevent_openssl, bev.bev),
+ be_openssl_enable,
+ be_openssl_disable,
+ be_openssl_unlink,
+ be_openssl_destruct,
+ be_openssl_adj_timeouts,
+ be_openssl_flush,
+ be_openssl_ctrl,
+};
+
+/* Given a bufferevent, return a pointer to the bufferevent_openssl that
+ * contains it, if any. */
+static inline struct bufferevent_openssl *
+upcast(struct bufferevent *bev)
+{
+ struct bufferevent_openssl *bev_o;
+ if (bev->be_ops != &bufferevent_ops_openssl)
+ return NULL;
+ bev_o = (void*)( ((char*)bev) -
+ evutil_offsetof(struct bufferevent_openssl, bev.bev));
+ EVUTIL_ASSERT(bev_o->bev.bev.be_ops == &bufferevent_ops_openssl);
+ return bev_o;
+}
+
+static inline void
+put_error(struct bufferevent_openssl *bev_ssl, unsigned long err)
+{
+ if (bev_ssl->n_errors == NUM_ERRORS)
+ return;
+ /* The error type according to openssl is "unsigned long", but
+ openssl never uses more than 32 bits of it. It _can't_ use more
+ than 32 bits of it, since it needs to report errors on systems
+ where long is only 32 bits.
+ */
+ bev_ssl->errors[bev_ssl->n_errors++] = (ev_uint32_t) err;
+}
+
+/* Have the base communications channel (either the underlying bufferevent or
+ * ev_read and ev_write) start reading. Take the read-blocked-on-write flag
+ * into account. */
+static int
+start_reading(struct bufferevent_openssl *bev_ssl)
+{
+ if (bev_ssl->underlying) {
+ bufferevent_unsuspend_read_(bev_ssl->underlying,
+ BEV_SUSPEND_FILT_READ);
+ return 0;
+ } else {
+ struct bufferevent *bev = &bev_ssl->bev.bev;
+ int r;
+ r = bufferevent_add_event_(&bev->ev_read, &bev->timeout_read);
+ if (r == 0 && bev_ssl->read_blocked_on_write)
+ r = bufferevent_add_event_(&bev->ev_write,
+ &bev->timeout_write);
+ return r;
+ }
+}
+
+/* Have the base communications channel (either the underlying bufferevent or
+ * ev_read and ev_write) start writing. Take the write-blocked-on-read flag
+ * into account. */
+static int
+start_writing(struct bufferevent_openssl *bev_ssl)
+{
+ int r = 0;
+ if (bev_ssl->underlying) {
+ ;
+ } else {
+ struct bufferevent *bev = &bev_ssl->bev.bev;
+ r = bufferevent_add_event_(&bev->ev_write, &bev->timeout_write);
+ if (!r && bev_ssl->write_blocked_on_read)
+ r = bufferevent_add_event_(&bev->ev_read,
+ &bev->timeout_read);
+ }
+ return r;
+}
+
+static void
+stop_reading(struct bufferevent_openssl *bev_ssl)
+{
+ if (bev_ssl->write_blocked_on_read)
+ return;
+ if (bev_ssl->underlying) {
+ bufferevent_suspend_read_(bev_ssl->underlying,
+ BEV_SUSPEND_FILT_READ);
+ } else {
+ struct bufferevent *bev = &bev_ssl->bev.bev;
+ event_del(&bev->ev_read);
+ }
+}
+
+static void
+stop_writing(struct bufferevent_openssl *bev_ssl)
+{
+ if (bev_ssl->read_blocked_on_write)
+ return;
+ if (bev_ssl->underlying) {
+ ;
+ } else {
+ struct bufferevent *bev = &bev_ssl->bev.bev;
+ event_del(&bev->ev_write);
+ }
+}
+
+static int
+set_rbow(struct bufferevent_openssl *bev_ssl)
+{
+ if (!bev_ssl->underlying)
+ stop_reading(bev_ssl);
+ bev_ssl->read_blocked_on_write = 1;
+ return start_writing(bev_ssl);
+}
+
+static int
+set_wbor(struct bufferevent_openssl *bev_ssl)
+{
+ if (!bev_ssl->underlying)
+ stop_writing(bev_ssl);
+ bev_ssl->write_blocked_on_read = 1;
+ return start_reading(bev_ssl);
+}
+
+static int
+clear_rbow(struct bufferevent_openssl *bev_ssl)
+{
+ struct bufferevent *bev = &bev_ssl->bev.bev;
+ int r = 0;
+ bev_ssl->read_blocked_on_write = 0;
+ if (!(bev->enabled & EV_WRITE))
+ stop_writing(bev_ssl);
+ if (bev->enabled & EV_READ)
+ r = start_reading(bev_ssl);
+ return r;
+}
+
+
+static int
+clear_wbor(struct bufferevent_openssl *bev_ssl)
+{
+ struct bufferevent *bev = &bev_ssl->bev.bev;
+ int r = 0;
+ bev_ssl->write_blocked_on_read = 0;
+ if (!(bev->enabled & EV_READ))
+ stop_reading(bev_ssl);
+ if (bev->enabled & EV_WRITE)
+ r = start_writing(bev_ssl);
+ return r;
+}
+
+static void
+conn_closed(struct bufferevent_openssl *bev_ssl, int when, int errcode, int ret)
+{
+ int event = BEV_EVENT_ERROR;
+ int dirty_shutdown = 0;
+ unsigned long err;
+
+ switch (errcode) {
+ case SSL_ERROR_ZERO_RETURN:
+ /* Possibly a clean shutdown. */
+ if (SSL_get_shutdown(bev_ssl->ssl) & SSL_RECEIVED_SHUTDOWN)
+ event = BEV_EVENT_EOF;
+ else
+ dirty_shutdown = 1;
+ break;
+ case SSL_ERROR_SYSCALL:
+ /* IO error; possibly a dirty shutdown. */
+ if (ret == 0 && ERR_peek_error() == 0)
+ dirty_shutdown = 1;
+ break;
+ case SSL_ERROR_SSL:
+ /* Protocol error. */
+ break;
+ case SSL_ERROR_WANT_X509_LOOKUP:
+ /* XXXX handle this. */
+ break;
+ case SSL_ERROR_NONE:
+ case SSL_ERROR_WANT_READ:
+ case SSL_ERROR_WANT_WRITE:
+ case SSL_ERROR_WANT_CONNECT:
+ case SSL_ERROR_WANT_ACCEPT:
+ default:
+ /* should be impossible; treat as normal error. */
+ event_warnx("BUG: Unexpected OpenSSL error code %d", errcode);
+ break;
+ }
+
+ while ((err = ERR_get_error())) {
+ put_error(bev_ssl, err);
+ }
+
+ if (dirty_shutdown && bev_ssl->allow_dirty_shutdown)
+ event = BEV_EVENT_EOF;
+
+ stop_reading(bev_ssl);
+ stop_writing(bev_ssl);
+
+ /* when is BEV_EVENT_{READING|WRITING} */
+ event = when | event;
+ bufferevent_run_eventcb_(&bev_ssl->bev.bev, event, 0);
+}
+
+static void
+init_bio_counts(struct bufferevent_openssl *bev_ssl)
+{
+ bev_ssl->counts.n_written =
+ BIO_number_written(SSL_get_wbio(bev_ssl->ssl));
+ bev_ssl->counts.n_read =
+ BIO_number_read(SSL_get_rbio(bev_ssl->ssl));
+}
+
+static inline void
+decrement_buckets(struct bufferevent_openssl *bev_ssl)
+{
+ unsigned long num_w = BIO_number_written(SSL_get_wbio(bev_ssl->ssl));
+ unsigned long num_r = BIO_number_read(SSL_get_rbio(bev_ssl->ssl));
+ /* These next two subtractions can wrap around. That's okay. */
+ unsigned long w = num_w - bev_ssl->counts.n_written;
+ unsigned long r = num_r - bev_ssl->counts.n_read;
+ if (w)
+ bufferevent_decrement_write_buckets_(&bev_ssl->bev, w);
+ if (r)
+ bufferevent_decrement_read_buckets_(&bev_ssl->bev, r);
+ bev_ssl->counts.n_written = num_w;
+ bev_ssl->counts.n_read = num_r;
+}
+
+#define OP_MADE_PROGRESS 1
+#define OP_BLOCKED 2
+#define OP_ERR 4
+
+/* Return a bitmask of OP_MADE_PROGRESS (if we read anything); OP_BLOCKED (if
+ we're now blocked); and OP_ERR (if an error occurred). */
+static int
+do_read(struct bufferevent_openssl *bev_ssl, int n_to_read) {
+ /* Requires lock */
+ struct bufferevent *bev = &bev_ssl->bev.bev;
+ struct evbuffer *input = bev->input;
+ int r, n, i, n_used = 0, atmost;
+ struct evbuffer_iovec space[2];
+ int result = 0;
+
+ if (bev_ssl->bev.read_suspended)
+ return 0;
+
+ atmost = bufferevent_get_read_max_(&bev_ssl->bev);
+ if (n_to_read > atmost)
+ n_to_read = atmost;
+
+ n = evbuffer_reserve_space(input, n_to_read, space, 2);
+ if (n < 0)
+ return OP_ERR;
+
+ for (i=0; i<n; ++i) {
+ if (bev_ssl->bev.read_suspended)
+ break;
+ r = SSL_read(bev_ssl->ssl, space[i].iov_base, space[i].iov_len);
+ if (r>0) {
+ result |= OP_MADE_PROGRESS;
+ if (bev_ssl->read_blocked_on_write)
+ if (clear_rbow(bev_ssl) < 0)
+ return OP_ERR | result;
+ ++n_used;
+ space[i].iov_len = r;
+ decrement_buckets(bev_ssl);
+ } else {
+ int err = SSL_get_error(bev_ssl->ssl, r);
+ print_err(err);
+ switch (err) {
+ case SSL_ERROR_WANT_READ:
+ /* Can't read until underlying has more data. */
+ if (bev_ssl->read_blocked_on_write)
+ if (clear_rbow(bev_ssl) < 0)
+ return OP_ERR | result;
+ break;
+ case SSL_ERROR_WANT_WRITE:
+ /* This read operation requires a write, and the
+ * underlying is full */
+ if (!bev_ssl->read_blocked_on_write)
+ if (set_rbow(bev_ssl) < 0)
+ return OP_ERR | result;
+ break;
+ default:
+ conn_closed(bev_ssl, BEV_EVENT_READING, err, r);
+ break;
+ }
+ result |= OP_BLOCKED;
+ break; /* out of the loop */
+ }
+ }
+
+ if (n_used) {
+ evbuffer_commit_space(input, space, n_used);
+ if (bev_ssl->underlying)
+ BEV_RESET_GENERIC_READ_TIMEOUT(bev);
+ }
+
+ return result;
+}
+
+/* Return a bitmask of OP_MADE_PROGRESS (if we wrote anything); OP_BLOCKED (if
+ we're now blocked); and OP_ERR (if an error occurred). */
+static int
+do_write(struct bufferevent_openssl *bev_ssl, int atmost)
+{
+ int i, r, n, n_written = 0;
+ struct bufferevent *bev = &bev_ssl->bev.bev;
+ struct evbuffer *output = bev->output;
+ struct evbuffer_iovec space[8];
+ int result = 0;
+
+ if (bev_ssl->last_write > 0)
+ atmost = bev_ssl->last_write;
+ else
+ atmost = bufferevent_get_write_max_(&bev_ssl->bev);
+
+ n = evbuffer_peek(output, atmost, NULL, space, 8);
+ if (n < 0)
+ return OP_ERR | result;
+
+ if (n > 8)
+ n = 8;
+ for (i=0; i < n; ++i) {
+ if (bev_ssl->bev.write_suspended)
+ break;
+
+ /* SSL_write will (reasonably) return 0 if we tell it to
+ send 0 data. Skip this case so we don't interpret the
+ result as an error */
+ if (space[i].iov_len == 0)
+ continue;
+
+ r = SSL_write(bev_ssl->ssl, space[i].iov_base,
+ space[i].iov_len);
+ if (r > 0) {
+ result |= OP_MADE_PROGRESS;
+ if (bev_ssl->write_blocked_on_read)
+ if (clear_wbor(bev_ssl) < 0)
+ return OP_ERR | result;
+ n_written += r;
+ bev_ssl->last_write = -1;
+ decrement_buckets(bev_ssl);
+ } else {
+ int err = SSL_get_error(bev_ssl->ssl, r);
+ print_err(err);
+ switch (err) {
+ case SSL_ERROR_WANT_WRITE:
+ /* Can't read until underlying has more data. */
+ if (bev_ssl->write_blocked_on_read)
+ if (clear_wbor(bev_ssl) < 0)
+ return OP_ERR | result;
+ bev_ssl->last_write = space[i].iov_len;
+ break;
+ case SSL_ERROR_WANT_READ:
+ /* This read operation requires a write, and the
+ * underlying is full */
+ if (!bev_ssl->write_blocked_on_read)
+ if (set_wbor(bev_ssl) < 0)
+ return OP_ERR | result;
+ bev_ssl->last_write = space[i].iov_len;
+ break;
+ default:
+ conn_closed(bev_ssl, BEV_EVENT_WRITING, err, r);
+ bev_ssl->last_write = -1;
+ break;
+ }
+ result |= OP_BLOCKED;
+ break;
+ }
+ }
+ if (n_written) {
+ evbuffer_drain(output, n_written);
+ if (bev_ssl->underlying)
+ BEV_RESET_GENERIC_WRITE_TIMEOUT(bev);
+
+ bufferevent_trigger_nolock_(bev, EV_WRITE, 0);
+ }
+ return result;
+}
+
+#define WRITE_FRAME 15000
+
+#define READ_DEFAULT 4096
+
+/* Try to figure out how many bytes to read; return 0 if we shouldn't be
+ * reading. */
+static int
+bytes_to_read(struct bufferevent_openssl *bev)
+{
+ struct evbuffer *input = bev->bev.bev.input;
+ struct event_watermark *wm = &bev->bev.bev.wm_read;
+ int result = READ_DEFAULT;
+ ev_ssize_t limit;
+ /* XXX 99% of this is generic code that nearly all bufferevents will
+ * want. */
+
+ if (bev->write_blocked_on_read) {
+ return 0;
+ }
+
+ if (! (bev->bev.bev.enabled & EV_READ)) {
+ return 0;
+ }
+
+ if (bev->bev.read_suspended) {
+ return 0;
+ }
+
+ if (wm->high) {
+ if (evbuffer_get_length(input) >= wm->high) {
+ return 0;
+ }
+
+ result = wm->high - evbuffer_get_length(input);
+ } else {
+ result = READ_DEFAULT;
+ }
+
+ /* Respect the rate limit */
+ limit = bufferevent_get_read_max_(&bev->bev);
+ if (result > limit) {
+ result = limit;
+ }
+
+ return result;
+}
+
+
+/* Things look readable. If write is blocked on read, write till it isn't.
+ * Read from the underlying buffer until we block or we hit our high-water
+ * mark.
+ */
+static void
+consider_reading(struct bufferevent_openssl *bev_ssl)
+{
+ int r;
+ int n_to_read;
+ int all_result_flags = 0;
+
+ while (bev_ssl->write_blocked_on_read) {
+ r = do_write(bev_ssl, WRITE_FRAME);
+ if (r & (OP_BLOCKED|OP_ERR))
+ break;
+ }
+ if (bev_ssl->write_blocked_on_read)
+ return;
+
+ n_to_read = bytes_to_read(bev_ssl);
+
+ while (n_to_read) {
+ r = do_read(bev_ssl, n_to_read);
+ all_result_flags |= r;
+
+ if (r & (OP_BLOCKED|OP_ERR))
+ break;
+
+ if (bev_ssl->bev.read_suspended)
+ break;
+
+ /* Read all pending data. This won't hit the network
+ * again, and will (most importantly) put us in a state
+ * where we don't need to read anything else until the
+ * socket is readable again. It'll potentially make us
+ * overrun our read high-watermark (somewhat
+ * regrettable). The damage to the rate-limit has
+ * already been done, since OpenSSL went and read a
+ * whole SSL record anyway. */
+ n_to_read = SSL_pending(bev_ssl->ssl);
+
+ /* XXX This if statement is actually a bad bug, added to avoid
+ * XXX a worse bug.
+ *
+ * The bad bug: It can potentially cause resource unfairness
+ * by reading too much data from the underlying bufferevent;
+ * it can potentially cause read looping if the underlying
+ * bufferevent is a bufferevent_pair and deferred callbacks
+ * aren't used.
+ *
+ * The worse bug: If we didn't do this, then we would
+ * potentially not read any more from bev_ssl->underlying
+ * until more data arrived there, which could lead to us
+ * waiting forever.
+ */
+ if (!n_to_read && bev_ssl->underlying)
+ n_to_read = bytes_to_read(bev_ssl);
+ }
+
+ if (all_result_flags & OP_MADE_PROGRESS) {
+ struct bufferevent *bev = &bev_ssl->bev.bev;
+
+ bufferevent_trigger_nolock_(bev, EV_READ, 0);
+ }
+
+ if (!bev_ssl->underlying) {
+ /* Should be redundant, but let's avoid busy-looping */
+ if (bev_ssl->bev.read_suspended ||
+ !(bev_ssl->bev.bev.enabled & EV_READ)) {
+ event_del(&bev_ssl->bev.bev.ev_read);
+ }
+ }
+}
+
+static void
+consider_writing(struct bufferevent_openssl *bev_ssl)
+{
+ int r;
+ struct evbuffer *output = bev_ssl->bev.bev.output;
+ struct evbuffer *target = NULL;
+ struct event_watermark *wm = NULL;
+
+ while (bev_ssl->read_blocked_on_write) {
+ r = do_read(bev_ssl, 1024); /* XXXX 1024 is a hack */
+ if (r & OP_MADE_PROGRESS) {
+ struct bufferevent *bev = &bev_ssl->bev.bev;
+
+ bufferevent_trigger_nolock_(bev, EV_READ, 0);
+ }
+ if (r & (OP_ERR|OP_BLOCKED))
+ break;
+ }
+ if (bev_ssl->read_blocked_on_write)
+ return;
+ if (bev_ssl->underlying) {
+ target = bev_ssl->underlying->output;
+ wm = &bev_ssl->underlying->wm_write;
+ }
+ while ((bev_ssl->bev.bev.enabled & EV_WRITE) &&
+ (! bev_ssl->bev.write_suspended) &&
+ evbuffer_get_length(output) &&
+ (!target || (! wm->high || evbuffer_get_length(target) < wm->high))) {
+ int n_to_write;
+ if (wm && wm->high)
+ n_to_write = wm->high - evbuffer_get_length(target);
+ else
+ n_to_write = WRITE_FRAME;
+ r = do_write(bev_ssl, n_to_write);
+ if (r & (OP_BLOCKED|OP_ERR))
+ break;
+ }
+
+ if (!bev_ssl->underlying) {
+ if (evbuffer_get_length(output) == 0) {
+ event_del(&bev_ssl->bev.bev.ev_write);
+ } else if (bev_ssl->bev.write_suspended ||
+ !(bev_ssl->bev.bev.enabled & EV_WRITE)) {
+ /* Should be redundant, but let's avoid busy-looping */
+ event_del(&bev_ssl->bev.bev.ev_write);
+ }
+ }
+}
+
+static void
+be_openssl_readcb(struct bufferevent *bev_base, void *ctx)
+{
+ struct bufferevent_openssl *bev_ssl = ctx;
+ consider_reading(bev_ssl);
+}
+
+static void
+be_openssl_writecb(struct bufferevent *bev_base, void *ctx)
+{
+ struct bufferevent_openssl *bev_ssl = ctx;
+ consider_writing(bev_ssl);
+}
+
+static void
+be_openssl_eventcb(struct bufferevent *bev_base, short what, void *ctx)
+{
+ struct bufferevent_openssl *bev_ssl = ctx;
+ int event = 0;
+
+ if (what & BEV_EVENT_EOF) {
+ if (bev_ssl->allow_dirty_shutdown)
+ event = BEV_EVENT_EOF;
+ else
+ event = BEV_EVENT_ERROR;
+ } else if (what & BEV_EVENT_TIMEOUT) {
+ /* We sure didn't set this. Propagate it to the user. */
+ event = what;
+ } else if (what & BEV_EVENT_ERROR) {
+ /* An error occurred on the connection. Propagate it to the user. */
+ event = what;
+ } else if (what & BEV_EVENT_CONNECTED) {
+ /* Ignore it. We're saying SSL_connect() already, which will
+ eat it. */
+ }
+ if (event)
+ bufferevent_run_eventcb_(&bev_ssl->bev.bev, event, 0);
+}
+
+static void
+be_openssl_readeventcb(evutil_socket_t fd, short what, void *ptr)
+{
+ struct bufferevent_openssl *bev_ssl = ptr;
+ bufferevent_incref_and_lock_(&bev_ssl->bev.bev);
+ if (what == EV_TIMEOUT) {
+ bufferevent_run_eventcb_(&bev_ssl->bev.bev,
+ BEV_EVENT_TIMEOUT|BEV_EVENT_READING, 0);
+ } else {
+ consider_reading(bev_ssl);
+ }
+ bufferevent_decref_and_unlock_(&bev_ssl->bev.bev);
+}
+
+static void
+be_openssl_writeeventcb(evutil_socket_t fd, short what, void *ptr)
+{
+ struct bufferevent_openssl *bev_ssl = ptr;
+ bufferevent_incref_and_lock_(&bev_ssl->bev.bev);
+ if (what == EV_TIMEOUT) {
+ bufferevent_run_eventcb_(&bev_ssl->bev.bev,
+ BEV_EVENT_TIMEOUT|BEV_EVENT_WRITING, 0);
+ } else {
+ consider_writing(bev_ssl);
+ }
+ bufferevent_decref_and_unlock_(&bev_ssl->bev.bev);
+}
+
+static int
+be_openssl_auto_fd(struct bufferevent_openssl *bev_ssl, int fd)
+{
+ if (!bev_ssl->underlying) {
+ struct bufferevent *bev = &bev_ssl->bev.bev;
+ if (event_initialized(&bev->ev_read) && fd < 0) {
+ fd = event_get_fd(&bev->ev_read);
+ }
+ }
+ return fd;
+}
+
+static int
+set_open_callbacks(struct bufferevent_openssl *bev_ssl, evutil_socket_t fd)
+{
+ if (bev_ssl->underlying) {
+ bufferevent_setcb(bev_ssl->underlying,
+ be_openssl_readcb, be_openssl_writecb, be_openssl_eventcb,
+ bev_ssl);
+ return 0;
+ } else {
+ struct bufferevent *bev = &bev_ssl->bev.bev;
+ int rpending=0, wpending=0, r1=0, r2=0;
+
+ if (event_initialized(&bev->ev_read)) {
+ rpending = event_pending(&bev->ev_read, EV_READ, NULL);
+ wpending = event_pending(&bev->ev_write, EV_WRITE, NULL);
+
+ event_del(&bev->ev_read);
+ event_del(&bev->ev_write);
+ }
+
+ event_assign(&bev->ev_read, bev->ev_base, fd,
+ EV_READ|EV_PERSIST|EV_FINALIZE,
+ be_openssl_readeventcb, bev_ssl);
+ event_assign(&bev->ev_write, bev->ev_base, fd,
+ EV_WRITE|EV_PERSIST|EV_FINALIZE,
+ be_openssl_writeeventcb, bev_ssl);
+
+ if (rpending)
+ r1 = bufferevent_add_event_(&bev->ev_read, &bev->timeout_read);
+ if (wpending)
+ r2 = bufferevent_add_event_(&bev->ev_write, &bev->timeout_write);
+
+ return (r1<0 || r2<0) ? -1 : 0;
+ }
+}
+static int
+set_open_callbacks_auto(struct bufferevent_openssl *bev_ssl, evutil_socket_t fd)
+{
+ fd = be_openssl_auto_fd(bev_ssl, fd);
+ return set_open_callbacks(bev_ssl, fd);
+}
+
+static int
+do_handshake(struct bufferevent_openssl *bev_ssl)
+{
+ int r;
+
+ switch (bev_ssl->state) {
+ default:
+ case BUFFEREVENT_SSL_OPEN:
+ EVUTIL_ASSERT(0);
+ return -1;
+ case BUFFEREVENT_SSL_CONNECTING:
+ case BUFFEREVENT_SSL_ACCEPTING:
+ r = SSL_do_handshake(bev_ssl->ssl);
+ break;
+ }
+ decrement_buckets(bev_ssl);
+
+ if (r==1) {
+ int fd = event_get_fd(&bev_ssl->bev.bev.ev_read);
+ /* We're done! */
+ bev_ssl->state = BUFFEREVENT_SSL_OPEN;
+ set_open_callbacks(bev_ssl, fd); /* XXXX handle failure */
+ /* Call do_read and do_write as needed */
+ bufferevent_enable(&bev_ssl->bev.bev, bev_ssl->bev.bev.enabled);
+ bufferevent_run_eventcb_(&bev_ssl->bev.bev,
+ BEV_EVENT_CONNECTED, 0);
+ return 1;
+ } else {
+ int err = SSL_get_error(bev_ssl->ssl, r);
+ print_err(err);
+ switch (err) {
+ case SSL_ERROR_WANT_WRITE:
+ if (!bev_ssl->underlying) {
+ stop_reading(bev_ssl);
+ return start_writing(bev_ssl);
+ }
+ return 0;
+ case SSL_ERROR_WANT_READ:
+ if (!bev_ssl->underlying) {
+ stop_writing(bev_ssl);
+ return start_reading(bev_ssl);
+ }
+ return 0;
+ default:
+ conn_closed(bev_ssl, BEV_EVENT_READING, err, r);
+ return -1;
+ }
+ }
+}
+
+static void
+be_openssl_handshakecb(struct bufferevent *bev_base, void *ctx)
+{
+ struct bufferevent_openssl *bev_ssl = ctx;
+ do_handshake(bev_ssl);/* XXX handle failure */
+}
+
+static void
+be_openssl_handshakeeventcb(evutil_socket_t fd, short what, void *ptr)
+{
+ struct bufferevent_openssl *bev_ssl = ptr;
+
+ bufferevent_incref_and_lock_(&bev_ssl->bev.bev);
+ if (what & EV_TIMEOUT) {
+ bufferevent_run_eventcb_(&bev_ssl->bev.bev, BEV_EVENT_TIMEOUT, 0);
+ } else
+ do_handshake(bev_ssl);/* XXX handle failure */
+ bufferevent_decref_and_unlock_(&bev_ssl->bev.bev);
+}
+
+static int
+set_handshake_callbacks(struct bufferevent_openssl *bev_ssl, evutil_socket_t fd)
+{
+ if (bev_ssl->underlying) {
+ bufferevent_setcb(bev_ssl->underlying,
+ be_openssl_handshakecb, be_openssl_handshakecb,
+ be_openssl_eventcb,
+ bev_ssl);
+ return do_handshake(bev_ssl);
+ } else {
+ struct bufferevent *bev = &bev_ssl->bev.bev;
+
+ if (event_initialized(&bev->ev_read)) {
+ event_del(&bev->ev_read);
+ event_del(&bev->ev_write);
+ }
+
+ event_assign(&bev->ev_read, bev->ev_base, fd,
+ EV_READ|EV_PERSIST|EV_FINALIZE,
+ be_openssl_handshakeeventcb, bev_ssl);
+ event_assign(&bev->ev_write, bev->ev_base, fd,
+ EV_WRITE|EV_PERSIST|EV_FINALIZE,
+ be_openssl_handshakeeventcb, bev_ssl);
+ if (fd >= 0)
+ bufferevent_enable(bev, bev->enabled);
+ return 0;
+ }
+}
+
+static int
+set_handshake_callbacks_auto(struct bufferevent_openssl *bev_ssl, evutil_socket_t fd)
+{
+ fd = be_openssl_auto_fd(bev_ssl, fd);
+ return set_handshake_callbacks(bev_ssl, fd);
+}
+
+int
+bufferevent_ssl_renegotiate(struct bufferevent *bev)
+{
+ struct bufferevent_openssl *bev_ssl = upcast(bev);
+ if (!bev_ssl)
+ return -1;
+ if (SSL_renegotiate(bev_ssl->ssl) < 0)
+ return -1;
+ bev_ssl->state = BUFFEREVENT_SSL_CONNECTING;
+ if (set_handshake_callbacks_auto(bev_ssl, -1) < 0)
+ return -1;
+ if (!bev_ssl->underlying)
+ return do_handshake(bev_ssl);
+ return 0;
+}
+
+static void
+be_openssl_outbuf_cb(struct evbuffer *buf,
+ const struct evbuffer_cb_info *cbinfo, void *arg)
+{
+ struct bufferevent_openssl *bev_ssl = arg;
+ int r = 0;
+ /* XXX need to hold a reference here. */
+
+ if (cbinfo->n_added && bev_ssl->state == BUFFEREVENT_SSL_OPEN &&
+ cbinfo->orig_size == 0) {
+ r = bufferevent_add_event_(&bev_ssl->bev.bev.ev_write,
+ &bev_ssl->bev.bev.timeout_write);
+ }
+ /* XXX Handle r < 0 */
+ (void)r;
+}
+
+
+static int
+be_openssl_enable(struct bufferevent *bev, short events)
+{
+ struct bufferevent_openssl *bev_ssl = upcast(bev);
+ int r1 = 0, r2 = 0;
+
+ if (events & EV_READ)
+ r1 = start_reading(bev_ssl);
+ if (events & EV_WRITE)
+ r2 = start_writing(bev_ssl);
+
+ if (bev_ssl->underlying) {
+ if (events & EV_READ)
+ BEV_RESET_GENERIC_READ_TIMEOUT(bev);
+ if (events & EV_WRITE)
+ BEV_RESET_GENERIC_WRITE_TIMEOUT(bev);
+
+ if (events & EV_READ)
+ consider_reading(bev_ssl);
+ if (events & EV_WRITE)
+ consider_writing(bev_ssl);
+ }
+ return (r1 < 0 || r2 < 0) ? -1 : 0;
+}
+
+static int
+be_openssl_disable(struct bufferevent *bev, short events)
+{
+ struct bufferevent_openssl *bev_ssl = upcast(bev);
+
+ if (events & EV_READ)
+ stop_reading(bev_ssl);
+ if (events & EV_WRITE)
+ stop_writing(bev_ssl);
+
+ if (bev_ssl->underlying) {
+ if (events & EV_READ)
+ BEV_DEL_GENERIC_READ_TIMEOUT(bev);
+ if (events & EV_WRITE)
+ BEV_DEL_GENERIC_WRITE_TIMEOUT(bev);
+ }
+ return 0;
+}
+
+static void
+be_openssl_unlink(struct bufferevent *bev)
+{
+ struct bufferevent_openssl *bev_ssl = upcast(bev);
+
+ if (bev_ssl->bev.options & BEV_OPT_CLOSE_ON_FREE) {
+ if (bev_ssl->underlying) {
+ if (BEV_UPCAST(bev_ssl->underlying)->refcnt < 2) {
+ event_warnx("BEV_OPT_CLOSE_ON_FREE set on an "
+ "bufferevent with too few references");
+ } else {
+ bufferevent_free(bev_ssl->underlying);
+ /* We still have a reference to it, via our
+ * BIO. So we don't drop this. */
+ // bev_ssl->underlying = NULL;
+ }
+ }
+ } else {
+ if (bev_ssl->underlying) {
+ if (bev_ssl->underlying->errorcb == be_openssl_eventcb)
+ bufferevent_setcb(bev_ssl->underlying,
+ NULL,NULL,NULL,NULL);
+ bufferevent_unsuspend_read_(bev_ssl->underlying,
+ BEV_SUSPEND_FILT_READ);
+ }
+ }
+}
+
+static void
+be_openssl_destruct(struct bufferevent *bev)
+{
+ struct bufferevent_openssl *bev_ssl = upcast(bev);
+
+ if (bev_ssl->bev.options & BEV_OPT_CLOSE_ON_FREE) {
+ if (! bev_ssl->underlying) {
+ evutil_socket_t fd = -1;
+ BIO *bio = SSL_get_wbio(bev_ssl->ssl);
+ if (bio)
+ fd = BIO_get_fd(bio, NULL);
+ if (fd >= 0)
+ evutil_closesocket(fd);
+ }
+ SSL_free(bev_ssl->ssl);
+ }
+}
+
+static int
+be_openssl_adj_timeouts(struct bufferevent *bev)
+{
+ struct bufferevent_openssl *bev_ssl = upcast(bev);
+
+ if (bev_ssl->underlying) {
+ return bufferevent_generic_adj_timeouts_(bev);
+ } else {
+ return bufferevent_generic_adj_existing_timeouts_(bev);
+ }
+}
+
+static int
+be_openssl_flush(struct bufferevent *bufev,
+ short iotype, enum bufferevent_flush_mode mode)
+{
+ /* XXXX Implement this. */
+ return 0;
+}
+
+static int
+be_openssl_ctrl(struct bufferevent *bev,
+ enum bufferevent_ctrl_op op, union bufferevent_ctrl_data *data)
+{
+ struct bufferevent_openssl *bev_ssl = upcast(bev);
+ switch (op) {
+ case BEV_CTRL_SET_FD:
+ if (bev_ssl->underlying)
+ return -1;
+ {
+ BIO *bio;
+ bio = BIO_new_socket(data->fd, 0);
+ SSL_set_bio(bev_ssl->ssl, bio, bio);
+ }
+ if (bev_ssl->state == BUFFEREVENT_SSL_OPEN && data->fd >= 0)
+ return set_open_callbacks(bev_ssl, data->fd);
+ else {
+ return set_handshake_callbacks(bev_ssl, data->fd);
+ }
+ case BEV_CTRL_GET_FD:
+ data->fd = event_get_fd(&bev->ev_read);
+ return 0;
+ case BEV_CTRL_GET_UNDERLYING:
+ data->ptr = bev_ssl->underlying;
+ return 0;
+ case BEV_CTRL_CANCEL_ALL:
+ default:
+ return -1;
+ }
+}
+
+SSL *
+bufferevent_openssl_get_ssl(struct bufferevent *bufev)
+{
+ struct bufferevent_openssl *bev_ssl = upcast(bufev);
+ if (!bev_ssl)
+ return NULL;
+ return bev_ssl->ssl;
+}
+
+static struct bufferevent *
+bufferevent_openssl_new_impl(struct event_base *base,
+ struct bufferevent *underlying,
+ evutil_socket_t fd,
+ SSL *ssl,
+ enum bufferevent_ssl_state state,
+ int options)
+{
+ struct bufferevent_openssl *bev_ssl = NULL;
+ struct bufferevent_private *bev_p = NULL;
+ int tmp_options = options & ~BEV_OPT_THREADSAFE;
+
+ if (underlying != NULL && fd >= 0)
+ return NULL; /* Only one can be set. */
+
+ if (!(bev_ssl = mm_calloc(1, sizeof(struct bufferevent_openssl))))
+ goto err;
+
+ bev_p = &bev_ssl->bev;
+
+ if (bufferevent_init_common_(bev_p, base,
+ &bufferevent_ops_openssl, tmp_options) < 0)
+ goto err;
+
+ /* Don't explode if we decide to realloc a chunk we're writing from in
+ * the output buffer. */
+ SSL_set_mode(ssl, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
+
+ bev_ssl->underlying = underlying;
+ bev_ssl->ssl = ssl;
+
+ bev_ssl->outbuf_cb = evbuffer_add_cb(bev_p->bev.output,
+ be_openssl_outbuf_cb, bev_ssl);
+
+ if (options & BEV_OPT_THREADSAFE)
+ bufferevent_enable_locking_(&bev_ssl->bev.bev, NULL);
+
+ if (underlying) {
+ bufferevent_init_generic_timeout_cbs_(&bev_ssl->bev.bev);
+ bufferevent_incref_(underlying);
+ }
+
+ bev_ssl->state = state;
+ bev_ssl->last_write = -1;
+
+ init_bio_counts(bev_ssl);
+
+ switch (state) {
+ case BUFFEREVENT_SSL_ACCEPTING:
+ SSL_set_accept_state(bev_ssl->ssl);
+ if (set_handshake_callbacks_auto(bev_ssl, fd) < 0)
+ goto err;
+ break;
+ case BUFFEREVENT_SSL_CONNECTING:
+ SSL_set_connect_state(bev_ssl->ssl);
+ if (set_handshake_callbacks_auto(bev_ssl, fd) < 0)
+ goto err;
+ break;
+ case BUFFEREVENT_SSL_OPEN:
+ if (set_open_callbacks_auto(bev_ssl, fd) < 0)
+ goto err;
+ break;
+ default:
+ goto err;
+ }
+
+ if (underlying) {
+ bufferevent_setwatermark(underlying, EV_READ, 0, 0);
+ bufferevent_enable(underlying, EV_READ|EV_WRITE);
+ if (state == BUFFEREVENT_SSL_OPEN)
+ bufferevent_suspend_read_(underlying,
+ BEV_SUSPEND_FILT_READ);
+ }
+
+ return &bev_ssl->bev.bev;
+err:
+ if (bev_ssl)
+ bufferevent_free(&bev_ssl->bev.bev);
+ return NULL;
+}
+
+struct bufferevent *
+bufferevent_openssl_filter_new(struct event_base *base,
+ struct bufferevent *underlying,
+ SSL *ssl,
+ enum bufferevent_ssl_state state,
+ int options)
+{
+ /* We don't tell the BIO to close the bufferevent; we do it ourselves
+ * on be_openssl_destruct */
+ int close_flag = 0; /* options & BEV_OPT_CLOSE_ON_FREE; */
+ BIO *bio;
+ if (!underlying)
+ return NULL;
+ if (!(bio = BIO_new_bufferevent(underlying, close_flag)))
+ return NULL;
+
+ SSL_set_bio(ssl, bio, bio);
+
+ return bufferevent_openssl_new_impl(
+ base, underlying, -1, ssl, state, options);
+}
+
+struct bufferevent *
+bufferevent_openssl_socket_new(struct event_base *base,
+ evutil_socket_t fd,
+ SSL *ssl,
+ enum bufferevent_ssl_state state,
+ int options)
+{
+ /* Does the SSL already have an fd? */
+ BIO *bio = SSL_get_wbio(ssl);
+ long have_fd = -1;
+
+ if (bio)
+ have_fd = BIO_get_fd(bio, NULL);
+
+ if (have_fd >= 0) {
+ /* The SSL is already configured with an fd. */
+ if (fd < 0) {
+ /* We should learn the fd from the SSL. */
+ fd = (evutil_socket_t) have_fd;
+ } else if (have_fd == (long)fd) {
+ /* We already know the fd from the SSL; do nothing */
+ } else {
+ /* We specified an fd different from that of the SSL.
+ This is probably an error on our part. Fail. */
+ return NULL;
+ }
+ (void) BIO_set_close(bio, 0);
+ } else {
+ /* The SSL isn't configured with a BIO with an fd. */
+ if (fd >= 0) {
+ /* ... and we have an fd we want to use. */
+ bio = BIO_new_socket(fd, 0);
+ SSL_set_bio(ssl, bio, bio);
+ } else {
+ /* Leave the fd unset. */
+ }
+ }
+
+ return bufferevent_openssl_new_impl(
+ base, NULL, fd, ssl, state, options);
+}
+
+int
+bufferevent_openssl_get_allow_dirty_shutdown(struct bufferevent *bev)
+{
+ int allow_dirty_shutdown = -1;
+ struct bufferevent_openssl *bev_ssl;
+ BEV_LOCK(bev);
+ bev_ssl = upcast(bev);
+ if (bev_ssl)
+ allow_dirty_shutdown = bev_ssl->allow_dirty_shutdown;
+ BEV_UNLOCK(bev);
+ return allow_dirty_shutdown;
+}
+
+void
+bufferevent_openssl_set_allow_dirty_shutdown(struct bufferevent *bev,
+ int allow_dirty_shutdown)
+{
+ struct bufferevent_openssl *bev_ssl;
+ BEV_LOCK(bev);
+ bev_ssl = upcast(bev);
+ if (bev_ssl)
+ bev_ssl->allow_dirty_shutdown = !!allow_dirty_shutdown;
+ BEV_UNLOCK(bev);
+}
+
+unsigned long
+bufferevent_get_openssl_error(struct bufferevent *bev)
+{
+ unsigned long err = 0;
+ struct bufferevent_openssl *bev_ssl;
+ BEV_LOCK(bev);
+ bev_ssl = upcast(bev);
+ if (bev_ssl && bev_ssl->n_errors) {
+ err = bev_ssl->errors[--bev_ssl->n_errors];
+ }
+ BEV_UNLOCK(bev);
+ return err;
+}
diff --git a/protocols/Telegram/tgl/libevent/bufferevent_pair.c b/protocols/Telegram/tgl/libevent/bufferevent_pair.c
new file mode 100644
index 0000000000..d80e5f81d6
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/bufferevent_pair.c
@@ -0,0 +1,360 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos, Nick Mathewson
+ *
+ * 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 "event2/event-config.h"
+#include "evconfig-private.h"
+
+#include <sys/types.h>
+
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+
+#include "event2/util.h"
+#include "event2/buffer.h"
+#include "event2/bufferevent.h"
+#include "event2/bufferevent_struct.h"
+#include "event2/event.h"
+#include "defer-internal.h"
+#include "bufferevent-internal.h"
+#include "mm-internal.h"
+#include "util-internal.h"
+
+struct bufferevent_pair {
+ struct bufferevent_private bev;
+ struct bufferevent_pair *partner;
+ /* For ->destruct() lock checking */
+ struct bufferevent_pair *unlinked_partner;
+};
+
+
+/* Given a bufferevent that's really a bev part of a bufferevent_pair,
+ * return that bufferevent_filtered. Returns NULL otherwise.*/
+static inline struct bufferevent_pair *
+upcast(struct bufferevent *bev)
+{
+ struct bufferevent_pair *bev_p;
+ if (bev->be_ops != &bufferevent_ops_pair)
+ return NULL;
+ bev_p = EVUTIL_UPCAST(bev, struct bufferevent_pair, bev.bev);
+ EVUTIL_ASSERT(bev_p->bev.bev.be_ops == &bufferevent_ops_pair);
+ return bev_p;
+}
+
+#define downcast(bev_pair) (&(bev_pair)->bev.bev)
+
+static inline void
+incref_and_lock(struct bufferevent *b)
+{
+ struct bufferevent_pair *bevp;
+ bufferevent_incref_and_lock_(b);
+ bevp = upcast(b);
+ if (bevp->partner)
+ bufferevent_incref_and_lock_(downcast(bevp->partner));
+}
+
+static inline void
+decref_and_unlock(struct bufferevent *b)
+{
+ struct bufferevent_pair *bevp = upcast(b);
+ if (bevp->partner)
+ bufferevent_decref_and_unlock_(downcast(bevp->partner));
+ bufferevent_decref_and_unlock_(b);
+}
+
+/* XXX Handle close */
+
+static void be_pair_outbuf_cb(struct evbuffer *,
+ const struct evbuffer_cb_info *, void *);
+
+static struct bufferevent_pair *
+bufferevent_pair_elt_new(struct event_base *base,
+ int options)
+{
+ struct bufferevent_pair *bufev;
+ if (! (bufev = mm_calloc(1, sizeof(struct bufferevent_pair))))
+ return NULL;
+ if (bufferevent_init_common_(&bufev->bev, base, &bufferevent_ops_pair,
+ options)) {
+ mm_free(bufev);
+ return NULL;
+ }
+ if (!evbuffer_add_cb(bufev->bev.bev.output, be_pair_outbuf_cb, bufev)) {
+ bufferevent_free(downcast(bufev));
+ return NULL;
+ }
+
+ bufferevent_init_generic_timeout_cbs_(&bufev->bev.bev);
+
+ return bufev;
+}
+
+int
+bufferevent_pair_new(struct event_base *base, int options,
+ struct bufferevent *pair[2])
+{
+ struct bufferevent_pair *bufev1 = NULL, *bufev2 = NULL;
+ int tmp_options;
+
+ options |= BEV_OPT_DEFER_CALLBACKS;
+ tmp_options = options & ~BEV_OPT_THREADSAFE;
+
+ bufev1 = bufferevent_pair_elt_new(base, options);
+ if (!bufev1)
+ return -1;
+ bufev2 = bufferevent_pair_elt_new(base, tmp_options);
+ if (!bufev2) {
+ bufferevent_free(downcast(bufev1));
+ return -1;
+ }
+
+ if (options & BEV_OPT_THREADSAFE) {
+ /*XXXX check return */
+ bufferevent_enable_locking_(downcast(bufev2), bufev1->bev.lock);
+ }
+
+ bufev1->partner = bufev2;
+ bufev2->partner = bufev1;
+
+ evbuffer_freeze(downcast(bufev1)->input, 0);
+ evbuffer_freeze(downcast(bufev1)->output, 1);
+ evbuffer_freeze(downcast(bufev2)->input, 0);
+ evbuffer_freeze(downcast(bufev2)->output, 1);
+
+ pair[0] = downcast(bufev1);
+ pair[1] = downcast(bufev2);
+
+ return 0;
+}
+
+static void
+be_pair_transfer(struct bufferevent *src, struct bufferevent *dst,
+ int ignore_wm)
+{
+ size_t dst_size;
+ size_t n;
+
+ evbuffer_unfreeze(src->output, 1);
+ evbuffer_unfreeze(dst->input, 0);
+
+ if (dst->wm_read.high) {
+ dst_size = evbuffer_get_length(dst->input);
+ if (dst_size < dst->wm_read.high) {
+ n = dst->wm_read.high - dst_size;
+ evbuffer_remove_buffer(src->output, dst->input, n);
+ } else {
+ if (!ignore_wm)
+ goto done;
+ n = evbuffer_get_length(src->output);
+ evbuffer_add_buffer(dst->input, src->output);
+ }
+ } else {
+ n = evbuffer_get_length(src->output);
+ evbuffer_add_buffer(dst->input, src->output);
+ }
+
+ if (n) {
+ BEV_RESET_GENERIC_READ_TIMEOUT(dst);
+
+ if (evbuffer_get_length(dst->output))
+ BEV_RESET_GENERIC_WRITE_TIMEOUT(dst);
+ else
+ BEV_DEL_GENERIC_WRITE_TIMEOUT(dst);
+ }
+
+ bufferevent_trigger_nolock_(dst, EV_READ, 0);
+ bufferevent_trigger_nolock_(src, EV_WRITE, 0);
+done:
+ evbuffer_freeze(src->output, 1);
+ evbuffer_freeze(dst->input, 0);
+}
+
+static inline int
+be_pair_wants_to_talk(struct bufferevent_pair *src,
+ struct bufferevent_pair *dst)
+{
+ return (downcast(src)->enabled & EV_WRITE) &&
+ (downcast(dst)->enabled & EV_READ) &&
+ !dst->bev.read_suspended &&
+ evbuffer_get_length(downcast(src)->output);
+}
+
+static void
+be_pair_outbuf_cb(struct evbuffer *outbuf,
+ const struct evbuffer_cb_info *info, void *arg)
+{
+ struct bufferevent_pair *bev_pair = arg;
+ struct bufferevent_pair *partner = bev_pair->partner;
+
+ incref_and_lock(downcast(bev_pair));
+
+ if (info->n_added > info->n_deleted && partner) {
+ /* We got more data. If the other side's reading, then
+ hand it over. */
+ if (be_pair_wants_to_talk(bev_pair, partner)) {
+ be_pair_transfer(downcast(bev_pair), downcast(partner), 0);
+ }
+ }
+
+ decref_and_unlock(downcast(bev_pair));
+}
+
+static int
+be_pair_enable(struct bufferevent *bufev, short events)
+{
+ struct bufferevent_pair *bev_p = upcast(bufev);
+ struct bufferevent_pair *partner = bev_p->partner;
+
+ incref_and_lock(bufev);
+
+ if (events & EV_READ) {
+ BEV_RESET_GENERIC_READ_TIMEOUT(bufev);
+ }
+ if ((events & EV_WRITE) && evbuffer_get_length(bufev->output))
+ BEV_RESET_GENERIC_WRITE_TIMEOUT(bufev);
+
+ /* We're starting to read! Does the other side have anything to write?*/
+ if ((events & EV_READ) && partner &&
+ be_pair_wants_to_talk(partner, bev_p)) {
+ be_pair_transfer(downcast(partner), bufev, 0);
+ }
+ /* We're starting to write! Does the other side want to read? */
+ if ((events & EV_WRITE) && partner &&
+ be_pair_wants_to_talk(bev_p, partner)) {
+ be_pair_transfer(bufev, downcast(partner), 0);
+ }
+ decref_and_unlock(bufev);
+ return 0;
+}
+
+static int
+be_pair_disable(struct bufferevent *bev, short events)
+{
+ if (events & EV_READ) {
+ BEV_DEL_GENERIC_READ_TIMEOUT(bev);
+ }
+ if (events & EV_WRITE) {
+ BEV_DEL_GENERIC_WRITE_TIMEOUT(bev);
+ }
+ return 0;
+}
+
+static void
+be_pair_unlink(struct bufferevent *bev)
+{
+ struct bufferevent_pair *bev_p = upcast(bev);
+
+ if (bev_p->partner) {
+ bev_p->unlinked_partner = bev_p->partner;
+ bev_p->partner->partner = NULL;
+ bev_p->partner = NULL;
+ }
+}
+
+/* Free *shared* lock in the latest be (since we share it between two of them). */
+static void
+be_pair_destruct(struct bufferevent *bev)
+{
+ struct bufferevent_pair *bev_p = upcast(bev);
+
+ /* Transfer ownership of the lock into partner, otherwise we will use
+ * already free'd lock during freeing second bev, see next example:
+ *
+ * bev1->own_lock = 1
+ * bev2->own_lock = 0
+ * bev2->lock = bev1->lock
+ *
+ * bufferevent_free(bev1) # refcnt == 0 -> unlink
+ * bufferevent_free(bev2) # refcnt == 0 -> unlink
+ *
+ * event_base_free() -> finilizers -> EVTHREAD_FREE_LOCK(bev1->lock)
+ * -> BEV_LOCK(bev2->lock) <-- already freed
+ *
+ * Where bev1 == pair[0], bev2 == pair[1].
+ */
+ if (bev_p->unlinked_partner && bev_p->bev.own_lock) {
+ bev_p->unlinked_partner->bev.own_lock = 1;
+ bev_p->bev.own_lock = 0;
+ }
+ bev_p->unlinked_partner = NULL;
+}
+
+static int
+be_pair_flush(struct bufferevent *bev, short iotype,
+ enum bufferevent_flush_mode mode)
+{
+ struct bufferevent_pair *bev_p = upcast(bev);
+ struct bufferevent *partner;
+
+ if (!bev_p->partner)
+ return -1;
+
+ if (mode == BEV_NORMAL)
+ return 0;
+
+ incref_and_lock(bev);
+
+ partner = downcast(bev_p->partner);
+
+ if ((iotype & EV_READ) != 0)
+ be_pair_transfer(partner, bev, 1);
+
+ if ((iotype & EV_WRITE) != 0)
+ be_pair_transfer(bev, partner, 1);
+
+ if (mode == BEV_FINISHED) {
+ bufferevent_run_eventcb_(partner, iotype|BEV_EVENT_EOF, 0);
+ }
+ decref_and_unlock(bev);
+ return 0;
+}
+
+struct bufferevent *
+bufferevent_pair_get_partner(struct bufferevent *bev)
+{
+ struct bufferevent_pair *bev_p;
+ struct bufferevent *partner = NULL;
+ bev_p = upcast(bev);
+ if (! bev_p)
+ return NULL;
+
+ incref_and_lock(bev);
+ if (bev_p->partner)
+ partner = downcast(bev_p->partner);
+ decref_and_unlock(bev);
+ return partner;
+}
+
+const struct bufferevent_ops bufferevent_ops_pair = {
+ "pair_elt",
+ evutil_offsetof(struct bufferevent_pair, bev.bev),
+ be_pair_enable,
+ be_pair_disable,
+ be_pair_unlink,
+ be_pair_destruct,
+ bufferevent_generic_adj_timeouts_,
+ be_pair_flush,
+ NULL, /* ctrl */
+};
diff --git a/protocols/Telegram/tgl/libevent/bufferevent_pair.obj b/protocols/Telegram/tgl/libevent/bufferevent_pair.obj
new file mode 100644
index 0000000000..99d0ab332c
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/bufferevent_pair.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/bufferevent_ratelim.c b/protocols/Telegram/tgl/libevent/bufferevent_ratelim.c
new file mode 100644
index 0000000000..bde192021b
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/bufferevent_ratelim.c
@@ -0,0 +1,1092 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ * Copyright (c) 2002-2006 Niels Provos <provos@citi.umich.edu>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 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 "evconfig-private.h"
+
+#include <sys/types.h>
+#include <limits.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "event2/event.h"
+#include "event2/event_struct.h"
+#include "event2/util.h"
+#include "event2/bufferevent.h"
+#include "event2/bufferevent_struct.h"
+#include "event2/buffer.h"
+
+#include "ratelim-internal.h"
+
+#include "bufferevent-internal.h"
+#include "mm-internal.h"
+#include "util-internal.h"
+#include "event-internal.h"
+
+int
+ev_token_bucket_init_(struct ev_token_bucket *bucket,
+ const struct ev_token_bucket_cfg *cfg,
+ ev_uint32_t current_tick,
+ int reinitialize)
+{
+ if (reinitialize) {
+ /* on reinitialization, we only clip downwards, since we've
+ already used who-knows-how-much bandwidth this tick. We
+ leave "last_updated" as it is; the next update will add the
+ appropriate amount of bandwidth to the bucket.
+ */
+ if (bucket->read_limit > (ev_int64_t) cfg->read_maximum)
+ bucket->read_limit = cfg->read_maximum;
+ if (bucket->write_limit > (ev_int64_t) cfg->write_maximum)
+ bucket->write_limit = cfg->write_maximum;
+ } else {
+ bucket->read_limit = cfg->read_rate;
+ bucket->write_limit = cfg->write_rate;
+ bucket->last_updated = current_tick;
+ }
+ return 0;
+}
+
+int
+ev_token_bucket_update_(struct ev_token_bucket *bucket,
+ const struct ev_token_bucket_cfg *cfg,
+ ev_uint32_t current_tick)
+{
+ /* It's okay if the tick number overflows, since we'll just
+ * wrap around when we do the unsigned substraction. */
+ unsigned n_ticks = current_tick - bucket->last_updated;
+
+ /* Make sure some ticks actually happened, and that time didn't
+ * roll back. */
+ if (n_ticks == 0 || n_ticks > INT_MAX)
+ return 0;
+
+ /* Naively, we would say
+ bucket->limit += n_ticks * cfg->rate;
+
+ if (bucket->limit > cfg->maximum)
+ bucket->limit = cfg->maximum;
+
+ But we're worried about overflow, so we do it like this:
+ */
+
+ if ((cfg->read_maximum - bucket->read_limit) / n_ticks < cfg->read_rate)
+ bucket->read_limit = cfg->read_maximum;
+ else
+ bucket->read_limit += n_ticks * cfg->read_rate;
+
+
+ if ((cfg->write_maximum - bucket->write_limit) / n_ticks < cfg->write_rate)
+ bucket->write_limit = cfg->write_maximum;
+ else
+ bucket->write_limit += n_ticks * cfg->write_rate;
+
+
+ bucket->last_updated = current_tick;
+
+ return 1;
+}
+
+static inline void
+bufferevent_update_buckets(struct bufferevent_private *bev)
+{
+ /* Must hold lock on bev. */
+ struct timeval now;
+ unsigned tick;
+ event_base_gettimeofday_cached(bev->bev.ev_base, &now);
+ tick = ev_token_bucket_get_tick_(&now, bev->rate_limiting->cfg);
+ if (tick != bev->rate_limiting->limit.last_updated)
+ ev_token_bucket_update_(&bev->rate_limiting->limit,
+ bev->rate_limiting->cfg, tick);
+}
+
+ev_uint32_t
+ev_token_bucket_get_tick_(const struct timeval *tv,
+ const struct ev_token_bucket_cfg *cfg)
+{
+ /* This computation uses two multiplies and a divide. We could do
+ * fewer if we knew that the tick length was an integer number of
+ * seconds, or if we knew it divided evenly into a second. We should
+ * investigate that more.
+ */
+
+ /* We cast to an ev_uint64_t first, since we don't want to overflow
+ * before we do the final divide. */
+ ev_uint64_t msec = (ev_uint64_t)tv->tv_sec * 1000 + tv->tv_usec / 1000;
+ return (unsigned)(msec / cfg->msec_per_tick);
+}
+
+struct ev_token_bucket_cfg *
+ev_token_bucket_cfg_new(size_t read_rate, size_t read_burst,
+ size_t write_rate, size_t write_burst,
+ const struct timeval *tick_len)
+{
+ struct ev_token_bucket_cfg *r;
+ struct timeval g;
+ if (! tick_len) {
+ g.tv_sec = 1;
+ g.tv_usec = 0;
+ tick_len = &g;
+ }
+ if (read_rate > read_burst || write_rate > write_burst ||
+ read_rate < 1 || write_rate < 1)
+ return NULL;
+ if (read_rate > EV_RATE_LIMIT_MAX ||
+ write_rate > EV_RATE_LIMIT_MAX ||
+ read_burst > EV_RATE_LIMIT_MAX ||
+ write_burst > EV_RATE_LIMIT_MAX)
+ return NULL;
+ r = mm_calloc(1, sizeof(struct ev_token_bucket_cfg));
+ if (!r)
+ return NULL;
+ r->read_rate = read_rate;
+ r->write_rate = write_rate;
+ r->read_maximum = read_burst;
+ r->write_maximum = write_burst;
+ memcpy(&r->tick_timeout, tick_len, sizeof(struct timeval));
+ r->msec_per_tick = (tick_len->tv_sec * 1000) +
+ (tick_len->tv_usec & COMMON_TIMEOUT_MICROSECONDS_MASK)/1000;
+ return r;
+}
+
+void
+ev_token_bucket_cfg_free(struct ev_token_bucket_cfg *cfg)
+{
+ mm_free(cfg);
+}
+
+/* Default values for max_single_read & max_single_write variables. */
+#define MAX_SINGLE_READ_DEFAULT 16384
+#define MAX_SINGLE_WRITE_DEFAULT 16384
+
+#define LOCK_GROUP(g) EVLOCK_LOCK((g)->lock, 0)
+#define UNLOCK_GROUP(g) EVLOCK_UNLOCK((g)->lock, 0)
+
+static int bev_group_suspend_reading_(struct bufferevent_rate_limit_group *g);
+static int bev_group_suspend_writing_(struct bufferevent_rate_limit_group *g);
+static void bev_group_unsuspend_reading_(struct bufferevent_rate_limit_group *g);
+static void bev_group_unsuspend_writing_(struct bufferevent_rate_limit_group *g);
+
+/** Helper: figure out the maximum amount we should write if is_write, or
+ the maximum amount we should read if is_read. Return that maximum, or
+ 0 if our bucket is wholly exhausted.
+ */
+static inline ev_ssize_t
+bufferevent_get_rlim_max_(struct bufferevent_private *bev, int is_write)
+{
+ /* needs lock on bev. */
+ ev_ssize_t max_so_far = is_write?bev->max_single_write:bev->max_single_read;
+
+#define LIM(x) \
+ (is_write ? (x).write_limit : (x).read_limit)
+
+#define GROUP_SUSPENDED(g) \
+ (is_write ? (g)->write_suspended : (g)->read_suspended)
+
+ /* Sets max_so_far to MIN(x, max_so_far) */
+#define CLAMPTO(x) \
+ do { \
+ if (max_so_far > (x)) \
+ max_so_far = (x); \
+ } while (0);
+
+ if (!bev->rate_limiting)
+ return max_so_far;
+
+ /* If rate-limiting is enabled at all, update the appropriate
+ bucket, and take the smaller of our rate limit and the group
+ rate limit.
+ */
+
+ if (bev->rate_limiting->cfg) {
+ bufferevent_update_buckets(bev);
+ max_so_far = LIM(bev->rate_limiting->limit);
+ }
+ if (bev->rate_limiting->group) {
+ struct bufferevent_rate_limit_group *g =
+ bev->rate_limiting->group;
+ ev_ssize_t share;
+ LOCK_GROUP(g);
+ if (GROUP_SUSPENDED(g)) {
+ /* We can get here if we failed to lock this
+ * particular bufferevent while suspending the whole
+ * group. */
+ if (is_write)
+ bufferevent_suspend_write_(&bev->bev,
+ BEV_SUSPEND_BW_GROUP);
+ else
+ bufferevent_suspend_read_(&bev->bev,
+ BEV_SUSPEND_BW_GROUP);
+ share = 0;
+ } else {
+ /* XXXX probably we should divide among the active
+ * members, not the total members. */
+ share = LIM(g->rate_limit) / g->n_members;
+ if (share < g->min_share)
+ share = g->min_share;
+ }
+ UNLOCK_GROUP(g);
+ CLAMPTO(share);
+ }
+
+ if (max_so_far < 0)
+ max_so_far = 0;
+ return max_so_far;
+}
+
+ev_ssize_t
+bufferevent_get_read_max_(struct bufferevent_private *bev)
+{
+ return bufferevent_get_rlim_max_(bev, 0);
+}
+
+ev_ssize_t
+bufferevent_get_write_max_(struct bufferevent_private *bev)
+{
+ return bufferevent_get_rlim_max_(bev, 1);
+}
+
+int
+bufferevent_decrement_read_buckets_(struct bufferevent_private *bev, ev_ssize_t bytes)
+{
+ /* XXXXX Make sure all users of this function check its return value */
+ int r = 0;
+ /* need to hold lock on bev */
+ if (!bev->rate_limiting)
+ return 0;
+
+ if (bev->rate_limiting->cfg) {
+ bev->rate_limiting->limit.read_limit -= bytes;
+ if (bev->rate_limiting->limit.read_limit <= 0) {
+ bufferevent_suspend_read_(&bev->bev, BEV_SUSPEND_BW);
+ if (event_add(&bev->rate_limiting->refill_bucket_event,
+ &bev->rate_limiting->cfg->tick_timeout) < 0)
+ r = -1;
+ } else if (bev->read_suspended & BEV_SUSPEND_BW) {
+ if (!(bev->write_suspended & BEV_SUSPEND_BW))
+ event_del(&bev->rate_limiting->refill_bucket_event);
+ bufferevent_unsuspend_read_(&bev->bev, BEV_SUSPEND_BW);
+ }
+ }
+
+ if (bev->rate_limiting->group) {
+ LOCK_GROUP(bev->rate_limiting->group);
+ bev->rate_limiting->group->rate_limit.read_limit -= bytes;
+ bev->rate_limiting->group->total_read += bytes;
+ if (bev->rate_limiting->group->rate_limit.read_limit <= 0) {
+ bev_group_suspend_reading_(bev->rate_limiting->group);
+ } else if (bev->rate_limiting->group->read_suspended) {
+ bev_group_unsuspend_reading_(bev->rate_limiting->group);
+ }
+ UNLOCK_GROUP(bev->rate_limiting->group);
+ }
+
+ return r;
+}
+
+int
+bufferevent_decrement_write_buckets_(struct bufferevent_private *bev, ev_ssize_t bytes)
+{
+ /* XXXXX Make sure all users of this function check its return value */
+ int r = 0;
+ /* need to hold lock */
+ if (!bev->rate_limiting)
+ return 0;
+
+ if (bev->rate_limiting->cfg) {
+ bev->rate_limiting->limit.write_limit -= bytes;
+ if (bev->rate_limiting->limit.write_limit <= 0) {
+ bufferevent_suspend_write_(&bev->bev, BEV_SUSPEND_BW);
+ if (event_add(&bev->rate_limiting->refill_bucket_event,
+ &bev->rate_limiting->cfg->tick_timeout) < 0)
+ r = -1;
+ } else if (bev->write_suspended & BEV_SUSPEND_BW) {
+ if (!(bev->read_suspended & BEV_SUSPEND_BW))
+ event_del(&bev->rate_limiting->refill_bucket_event);
+ bufferevent_unsuspend_write_(&bev->bev, BEV_SUSPEND_BW);
+ }
+ }
+
+ if (bev->rate_limiting->group) {
+ LOCK_GROUP(bev->rate_limiting->group);
+ bev->rate_limiting->group->rate_limit.write_limit -= bytes;
+ bev->rate_limiting->group->total_written += bytes;
+ if (bev->rate_limiting->group->rate_limit.write_limit <= 0) {
+ bev_group_suspend_writing_(bev->rate_limiting->group);
+ } else if (bev->rate_limiting->group->write_suspended) {
+ bev_group_unsuspend_writing_(bev->rate_limiting->group);
+ }
+ UNLOCK_GROUP(bev->rate_limiting->group);
+ }
+
+ return r;
+}
+
+/** Stop reading on every bufferevent in <b>g</b> */
+static int
+bev_group_suspend_reading_(struct bufferevent_rate_limit_group *g)
+{
+ /* Needs group lock */
+ struct bufferevent_private *bev;
+ g->read_suspended = 1;
+ g->pending_unsuspend_read = 0;
+
+ /* Note that in this loop we call EVLOCK_TRY_LOCK_ instead of BEV_LOCK,
+ to prevent a deadlock. (Ordinarily, the group lock nests inside
+ the bufferevent locks. If we are unable to lock any individual
+ bufferevent, it will find out later when it looks at its limit
+ and sees that its group is suspended.)
+ */
+ LIST_FOREACH(bev, &g->members, rate_limiting->next_in_group) {
+ if (EVLOCK_TRY_LOCK_(bev->lock)) {
+ bufferevent_suspend_read_(&bev->bev,
+ BEV_SUSPEND_BW_GROUP);
+ EVLOCK_UNLOCK(bev->lock, 0);
+ }
+ }
+ return 0;
+}
+
+/** Stop writing on every bufferevent in <b>g</b> */
+static int
+bev_group_suspend_writing_(struct bufferevent_rate_limit_group *g)
+{
+ /* Needs group lock */
+ struct bufferevent_private *bev;
+ g->write_suspended = 1;
+ g->pending_unsuspend_write = 0;
+ LIST_FOREACH(bev, &g->members, rate_limiting->next_in_group) {
+ if (EVLOCK_TRY_LOCK_(bev->lock)) {
+ bufferevent_suspend_write_(&bev->bev,
+ BEV_SUSPEND_BW_GROUP);
+ EVLOCK_UNLOCK(bev->lock, 0);
+ }
+ }
+ return 0;
+}
+
+/** Timer callback invoked on a single bufferevent with one or more exhausted
+ buckets when they are ready to refill. */
+static void
+bev_refill_callback_(evutil_socket_t fd, short what, void *arg)
+{
+ unsigned tick;
+ struct timeval now;
+ struct bufferevent_private *bev = arg;
+ int again = 0;
+ BEV_LOCK(&bev->bev);
+ if (!bev->rate_limiting || !bev->rate_limiting->cfg) {
+ BEV_UNLOCK(&bev->bev);
+ return;
+ }
+
+ /* First, update the bucket */
+ event_base_gettimeofday_cached(bev->bev.ev_base, &now);
+ tick = ev_token_bucket_get_tick_(&now,
+ bev->rate_limiting->cfg);
+ ev_token_bucket_update_(&bev->rate_limiting->limit,
+ bev->rate_limiting->cfg,
+ tick);
+
+ /* Now unsuspend any read/write operations as appropriate. */
+ if ((bev->read_suspended & BEV_SUSPEND_BW)) {
+ if (bev->rate_limiting->limit.read_limit > 0)
+ bufferevent_unsuspend_read_(&bev->bev, BEV_SUSPEND_BW);
+ else
+ again = 1;
+ }
+ if ((bev->write_suspended & BEV_SUSPEND_BW)) {
+ if (bev->rate_limiting->limit.write_limit > 0)
+ bufferevent_unsuspend_write_(&bev->bev, BEV_SUSPEND_BW);
+ else
+ again = 1;
+ }
+ if (again) {
+ /* One or more of the buckets may need another refill if they
+ started negative.
+
+ XXXX if we need to be quiet for more ticks, we should
+ maybe figure out what timeout we really want.
+ */
+ /* XXXX Handle event_add failure somehow */
+ event_add(&bev->rate_limiting->refill_bucket_event,
+ &bev->rate_limiting->cfg->tick_timeout);
+ }
+ BEV_UNLOCK(&bev->bev);
+}
+
+/** Helper: grab a random element from a bufferevent group.
+ *
+ * Requires that we hold the lock on the group.
+ */
+static struct bufferevent_private *
+bev_group_random_element_(struct bufferevent_rate_limit_group *group)
+{
+ int which;
+ struct bufferevent_private *bev;
+
+ /* requires group lock */
+
+ if (!group->n_members)
+ return NULL;
+
+ EVUTIL_ASSERT(! LIST_EMPTY(&group->members));
+
+ which = evutil_weakrand_range_(&group->weakrand_seed, group->n_members);
+
+ bev = LIST_FIRST(&group->members);
+ while (which--)
+ bev = LIST_NEXT(bev, rate_limiting->next_in_group);
+
+ return bev;
+}
+
+/** Iterate over the elements of a rate-limiting group 'g' with a random
+ starting point, assigning each to the variable 'bev', and executing the
+ block 'block'.
+
+ We do this in a half-baked effort to get fairness among group members.
+ XXX Round-robin or some kind of priority queue would be even more fair.
+ */
+#define FOREACH_RANDOM_ORDER(block) \
+ do { \
+ first = bev_group_random_element_(g); \
+ for (bev = first; bev != LIST_END(&g->members); \
+ bev = LIST_NEXT(bev, rate_limiting->next_in_group)) { \
+ block ; \
+ } \
+ for (bev = LIST_FIRST(&g->members); bev && bev != first; \
+ bev = LIST_NEXT(bev, rate_limiting->next_in_group)) { \
+ block ; \
+ } \
+ } while (0)
+
+static void
+bev_group_unsuspend_reading_(struct bufferevent_rate_limit_group *g)
+{
+ int again = 0;
+ struct bufferevent_private *bev, *first;
+
+ g->read_suspended = 0;
+ FOREACH_RANDOM_ORDER({
+ if (EVLOCK_TRY_LOCK_(bev->lock)) {
+ bufferevent_unsuspend_read_(&bev->bev,
+ BEV_SUSPEND_BW_GROUP);
+ EVLOCK_UNLOCK(bev->lock, 0);
+ } else {
+ again = 1;
+ }
+ });
+ g->pending_unsuspend_read = again;
+}
+
+static void
+bev_group_unsuspend_writing_(struct bufferevent_rate_limit_group *g)
+{
+ int again = 0;
+ struct bufferevent_private *bev, *first;
+ g->write_suspended = 0;
+
+ FOREACH_RANDOM_ORDER({
+ if (EVLOCK_TRY_LOCK_(bev->lock)) {
+ bufferevent_unsuspend_write_(&bev->bev,
+ BEV_SUSPEND_BW_GROUP);
+ EVLOCK_UNLOCK(bev->lock, 0);
+ } else {
+ again = 1;
+ }
+ });
+ g->pending_unsuspend_write = again;
+}
+
+/** Callback invoked every tick to add more elements to the group bucket
+ and unsuspend group members as needed.
+ */
+static void
+bev_group_refill_callback_(evutil_socket_t fd, short what, void *arg)
+{
+ struct bufferevent_rate_limit_group *g = arg;
+ unsigned tick;
+ struct timeval now;
+
+ event_base_gettimeofday_cached(event_get_base(&g->master_refill_event), &now);
+
+ LOCK_GROUP(g);
+
+ tick = ev_token_bucket_get_tick_(&now, &g->rate_limit_cfg);
+ ev_token_bucket_update_(&g->rate_limit, &g->rate_limit_cfg, tick);
+
+ if (g->pending_unsuspend_read ||
+ (g->read_suspended && (g->rate_limit.read_limit >= g->min_share))) {
+ bev_group_unsuspend_reading_(g);
+ }
+ if (g->pending_unsuspend_write ||
+ (g->write_suspended && (g->rate_limit.write_limit >= g->min_share))){
+ bev_group_unsuspend_writing_(g);
+ }
+
+ /* XXXX Rather than waiting to the next tick to unsuspend stuff
+ * with pending_unsuspend_write/read, we should do it on the
+ * next iteration of the mainloop.
+ */
+
+ UNLOCK_GROUP(g);
+}
+
+int
+bufferevent_set_rate_limit(struct bufferevent *bev,
+ struct ev_token_bucket_cfg *cfg)
+{
+ struct bufferevent_private *bevp =
+ EVUTIL_UPCAST(bev, struct bufferevent_private, bev);
+ int r = -1;
+ struct bufferevent_rate_limit *rlim;
+ struct timeval now;
+ ev_uint32_t tick;
+ int reinit = 0, suspended = 0;
+ /* XXX reference-count cfg */
+
+ BEV_LOCK(bev);
+
+ if (cfg == NULL) {
+ if (bevp->rate_limiting) {
+ rlim = bevp->rate_limiting;
+ rlim->cfg = NULL;
+ bufferevent_unsuspend_read_(bev, BEV_SUSPEND_BW);
+ bufferevent_unsuspend_write_(bev, BEV_SUSPEND_BW);
+ if (event_initialized(&rlim->refill_bucket_event))
+ event_del(&rlim->refill_bucket_event);
+ }
+ r = 0;
+ goto done;
+ }
+
+ event_base_gettimeofday_cached(bev->ev_base, &now);
+ tick = ev_token_bucket_get_tick_(&now, cfg);
+
+ if (bevp->rate_limiting && bevp->rate_limiting->cfg == cfg) {
+ /* no-op */
+ r = 0;
+ goto done;
+ }
+ if (bevp->rate_limiting == NULL) {
+ rlim = mm_calloc(1, sizeof(struct bufferevent_rate_limit));
+ if (!rlim)
+ goto done;
+ bevp->rate_limiting = rlim;
+ } else {
+ rlim = bevp->rate_limiting;
+ }
+ reinit = rlim->cfg != NULL;
+
+ rlim->cfg = cfg;
+ ev_token_bucket_init_(&rlim->limit, cfg, tick, reinit);
+
+ if (reinit) {
+ EVUTIL_ASSERT(event_initialized(&rlim->refill_bucket_event));
+ event_del(&rlim->refill_bucket_event);
+ }
+ event_assign(&rlim->refill_bucket_event, bev->ev_base,
+ -1, EV_FINALIZE, bev_refill_callback_, bevp);
+
+ if (rlim->limit.read_limit > 0) {
+ bufferevent_unsuspend_read_(bev, BEV_SUSPEND_BW);
+ } else {
+ bufferevent_suspend_read_(bev, BEV_SUSPEND_BW);
+ suspended=1;
+ }
+ if (rlim->limit.write_limit > 0) {
+ bufferevent_unsuspend_write_(bev, BEV_SUSPEND_BW);
+ } else {
+ bufferevent_suspend_write_(bev, BEV_SUSPEND_BW);
+ suspended = 1;
+ }
+
+ if (suspended)
+ event_add(&rlim->refill_bucket_event, &cfg->tick_timeout);
+
+ r = 0;
+
+done:
+ BEV_UNLOCK(bev);
+ return r;
+}
+
+struct bufferevent_rate_limit_group *
+bufferevent_rate_limit_group_new(struct event_base *base,
+ const struct ev_token_bucket_cfg *cfg)
+{
+ struct bufferevent_rate_limit_group *g;
+ struct timeval now;
+ ev_uint32_t tick;
+
+ event_base_gettimeofday_cached(base, &now);
+ tick = ev_token_bucket_get_tick_(&now, cfg);
+
+ g = mm_calloc(1, sizeof(struct bufferevent_rate_limit_group));
+ if (!g)
+ return NULL;
+ memcpy(&g->rate_limit_cfg, cfg, sizeof(g->rate_limit_cfg));
+ LIST_INIT(&g->members);
+
+ ev_token_bucket_init_(&g->rate_limit, cfg, tick, 0);
+
+ event_assign(&g->master_refill_event, base, -1, EV_PERSIST|EV_FINALIZE,
+ bev_group_refill_callback_, g);
+ /*XXXX handle event_add failure */
+ event_add(&g->master_refill_event, &cfg->tick_timeout);
+
+ EVTHREAD_ALLOC_LOCK(g->lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+
+ bufferevent_rate_limit_group_set_min_share(g, 64);
+
+ evutil_weakrand_seed_(&g->weakrand_seed,
+ (ev_uint32_t) ((now.tv_sec + now.tv_usec) + (ev_intptr_t)g));
+
+ return g;
+}
+
+int
+bufferevent_rate_limit_group_set_cfg(
+ struct bufferevent_rate_limit_group *g,
+ const struct ev_token_bucket_cfg *cfg)
+{
+ int same_tick;
+ if (!g || !cfg)
+ return -1;
+
+ LOCK_GROUP(g);
+ same_tick = evutil_timercmp(
+ &g->rate_limit_cfg.tick_timeout, &cfg->tick_timeout, ==);
+ memcpy(&g->rate_limit_cfg, cfg, sizeof(g->rate_limit_cfg));
+
+ if (g->rate_limit.read_limit > (ev_ssize_t)cfg->read_maximum)
+ g->rate_limit.read_limit = cfg->read_maximum;
+ if (g->rate_limit.write_limit > (ev_ssize_t)cfg->write_maximum)
+ g->rate_limit.write_limit = cfg->write_maximum;
+
+ if (!same_tick) {
+ /* This can cause a hiccup in the schedule */
+ event_add(&g->master_refill_event, &cfg->tick_timeout);
+ }
+
+ /* The new limits might force us to adjust min_share differently. */
+ bufferevent_rate_limit_group_set_min_share(g, g->configured_min_share);
+
+ UNLOCK_GROUP(g);
+ return 0;
+}
+
+int
+bufferevent_rate_limit_group_set_min_share(
+ struct bufferevent_rate_limit_group *g,
+ size_t share)
+{
+ if (share > EV_SSIZE_MAX)
+ return -1;
+
+ g->configured_min_share = share;
+
+ /* Can't set share to less than the one-tick maximum. IOW, at steady
+ * state, at least one connection can go per tick. */
+ if (share > g->rate_limit_cfg.read_rate)
+ share = g->rate_limit_cfg.read_rate;
+ if (share > g->rate_limit_cfg.write_rate)
+ share = g->rate_limit_cfg.write_rate;
+
+ g->min_share = share;
+ return 0;
+}
+
+void
+bufferevent_rate_limit_group_free(struct bufferevent_rate_limit_group *g)
+{
+ LOCK_GROUP(g);
+ EVUTIL_ASSERT(0 == g->n_members);
+ event_del(&g->master_refill_event);
+ UNLOCK_GROUP(g);
+ EVTHREAD_FREE_LOCK(g->lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+ mm_free(g);
+}
+
+int
+bufferevent_add_to_rate_limit_group(struct bufferevent *bev,
+ struct bufferevent_rate_limit_group *g)
+{
+ int wsuspend, rsuspend;
+ struct bufferevent_private *bevp =
+ EVUTIL_UPCAST(bev, struct bufferevent_private, bev);
+ BEV_LOCK(bev);
+
+ if (!bevp->rate_limiting) {
+ struct bufferevent_rate_limit *rlim;
+ rlim = mm_calloc(1, sizeof(struct bufferevent_rate_limit));
+ if (!rlim) {
+ BEV_UNLOCK(bev);
+ return -1;
+ }
+ event_assign(&rlim->refill_bucket_event, bev->ev_base,
+ -1, EV_FINALIZE, bev_refill_callback_, bevp);
+ bevp->rate_limiting = rlim;
+ }
+
+ if (bevp->rate_limiting->group == g) {
+ BEV_UNLOCK(bev);
+ return 0;
+ }
+ if (bevp->rate_limiting->group)
+ bufferevent_remove_from_rate_limit_group(bev);
+
+ LOCK_GROUP(g);
+ bevp->rate_limiting->group = g;
+ ++g->n_members;
+ LIST_INSERT_HEAD(&g->members, bevp, rate_limiting->next_in_group);
+
+ rsuspend = g->read_suspended;
+ wsuspend = g->write_suspended;
+
+ UNLOCK_GROUP(g);
+
+ if (rsuspend)
+ bufferevent_suspend_read_(bev, BEV_SUSPEND_BW_GROUP);
+ if (wsuspend)
+ bufferevent_suspend_write_(bev, BEV_SUSPEND_BW_GROUP);
+
+ BEV_UNLOCK(bev);
+ return 0;
+}
+
+int
+bufferevent_remove_from_rate_limit_group(struct bufferevent *bev)
+{
+ return bufferevent_remove_from_rate_limit_group_internal_(bev, 1);
+}
+
+int
+bufferevent_remove_from_rate_limit_group_internal_(struct bufferevent *bev,
+ int unsuspend)
+{
+ struct bufferevent_private *bevp =
+ EVUTIL_UPCAST(bev, struct bufferevent_private, bev);
+ BEV_LOCK(bev);
+ if (bevp->rate_limiting && bevp->rate_limiting->group) {
+ struct bufferevent_rate_limit_group *g =
+ bevp->rate_limiting->group;
+ LOCK_GROUP(g);
+ bevp->rate_limiting->group = NULL;
+ --g->n_members;
+ LIST_REMOVE(bevp, rate_limiting->next_in_group);
+ UNLOCK_GROUP(g);
+ }
+ if (unsuspend) {
+ bufferevent_unsuspend_read_(bev, BEV_SUSPEND_BW_GROUP);
+ bufferevent_unsuspend_write_(bev, BEV_SUSPEND_BW_GROUP);
+ }
+ BEV_UNLOCK(bev);
+ return 0;
+}
+
+/* ===
+ * API functions to expose rate limits.
+ *
+ * Don't use these from inside Libevent; they're meant to be for use by
+ * the program.
+ * === */
+
+/* Mostly you don't want to use this function from inside libevent;
+ * bufferevent_get_read_max_() is more likely what you want*/
+ev_ssize_t
+bufferevent_get_read_limit(struct bufferevent *bev)
+{
+ ev_ssize_t r;
+ struct bufferevent_private *bevp;
+ BEV_LOCK(bev);
+ bevp = BEV_UPCAST(bev);
+ if (bevp->rate_limiting && bevp->rate_limiting->cfg) {
+ bufferevent_update_buckets(bevp);
+ r = bevp->rate_limiting->limit.read_limit;
+ } else {
+ r = EV_SSIZE_MAX;
+ }
+ BEV_UNLOCK(bev);
+ return r;
+}
+
+/* Mostly you don't want to use this function from inside libevent;
+ * bufferevent_get_write_max_() is more likely what you want*/
+ev_ssize_t
+bufferevent_get_write_limit(struct bufferevent *bev)
+{
+ ev_ssize_t r;
+ struct bufferevent_private *bevp;
+ BEV_LOCK(bev);
+ bevp = BEV_UPCAST(bev);
+ if (bevp->rate_limiting && bevp->rate_limiting->cfg) {
+ bufferevent_update_buckets(bevp);
+ r = bevp->rate_limiting->limit.write_limit;
+ } else {
+ r = EV_SSIZE_MAX;
+ }
+ BEV_UNLOCK(bev);
+ return r;
+}
+
+int
+bufferevent_set_max_single_read(struct bufferevent *bev, size_t size)
+{
+ struct bufferevent_private *bevp;
+ BEV_LOCK(bev);
+ bevp = BEV_UPCAST(bev);
+ if (size == 0 || size > EV_SSIZE_MAX)
+ bevp->max_single_read = MAX_SINGLE_READ_DEFAULT;
+ else
+ bevp->max_single_read = size;
+ BEV_UNLOCK(bev);
+ return 0;
+}
+
+int
+bufferevent_set_max_single_write(struct bufferevent *bev, size_t size)
+{
+ struct bufferevent_private *bevp;
+ BEV_LOCK(bev);
+ bevp = BEV_UPCAST(bev);
+ if (size == 0 || size > EV_SSIZE_MAX)
+ bevp->max_single_write = MAX_SINGLE_WRITE_DEFAULT;
+ else
+ bevp->max_single_write = size;
+ BEV_UNLOCK(bev);
+ return 0;
+}
+
+ev_ssize_t
+bufferevent_get_max_single_read(struct bufferevent *bev)
+{
+ ev_ssize_t r;
+
+ BEV_LOCK(bev);
+ r = BEV_UPCAST(bev)->max_single_read;
+ BEV_UNLOCK(bev);
+ return r;
+}
+
+ev_ssize_t
+bufferevent_get_max_single_write(struct bufferevent *bev)
+{
+ ev_ssize_t r;
+
+ BEV_LOCK(bev);
+ r = BEV_UPCAST(bev)->max_single_write;
+ BEV_UNLOCK(bev);
+ return r;
+}
+
+ev_ssize_t
+bufferevent_get_max_to_read(struct bufferevent *bev)
+{
+ ev_ssize_t r;
+ BEV_LOCK(bev);
+ r = bufferevent_get_read_max_(BEV_UPCAST(bev));
+ BEV_UNLOCK(bev);
+ return r;
+}
+
+ev_ssize_t
+bufferevent_get_max_to_write(struct bufferevent *bev)
+{
+ ev_ssize_t r;
+ BEV_LOCK(bev);
+ r = bufferevent_get_write_max_(BEV_UPCAST(bev));
+ BEV_UNLOCK(bev);
+ return r;
+}
+
+const struct ev_token_bucket_cfg *
+bufferevent_get_token_bucket_cfg(const struct bufferevent *bev) {
+ struct bufferevent_private *bufev_private = BEV_UPCAST(bev);
+ struct ev_token_bucket_cfg *cfg;
+
+ BEV_LOCK(bev);
+
+ if (bufev_private->rate_limiting) {
+ cfg = bufev_private->rate_limiting->cfg;
+ } else {
+ cfg = NULL;
+ }
+
+ BEV_UNLOCK(bev);
+
+ return cfg;
+}
+
+/* Mostly you don't want to use this function from inside libevent;
+ * bufferevent_get_read_max_() is more likely what you want*/
+ev_ssize_t
+bufferevent_rate_limit_group_get_read_limit(
+ struct bufferevent_rate_limit_group *grp)
+{
+ ev_ssize_t r;
+ LOCK_GROUP(grp);
+ r = grp->rate_limit.read_limit;
+ UNLOCK_GROUP(grp);
+ return r;
+}
+
+/* Mostly you don't want to use this function from inside libevent;
+ * bufferevent_get_write_max_() is more likely what you want. */
+ev_ssize_t
+bufferevent_rate_limit_group_get_write_limit(
+ struct bufferevent_rate_limit_group *grp)
+{
+ ev_ssize_t r;
+ LOCK_GROUP(grp);
+ r = grp->rate_limit.write_limit;
+ UNLOCK_GROUP(grp);
+ return r;
+}
+
+int
+bufferevent_decrement_read_limit(struct bufferevent *bev, ev_ssize_t decr)
+{
+ int r = 0;
+ ev_ssize_t old_limit, new_limit;
+ struct bufferevent_private *bevp;
+ BEV_LOCK(bev);
+ bevp = BEV_UPCAST(bev);
+ EVUTIL_ASSERT(bevp->rate_limiting && bevp->rate_limiting->cfg);
+ old_limit = bevp->rate_limiting->limit.read_limit;
+
+ new_limit = (bevp->rate_limiting->limit.read_limit -= decr);
+ if (old_limit > 0 && new_limit <= 0) {
+ bufferevent_suspend_read_(bev, BEV_SUSPEND_BW);
+ if (event_add(&bevp->rate_limiting->refill_bucket_event,
+ &bevp->rate_limiting->cfg->tick_timeout) < 0)
+ r = -1;
+ } else if (old_limit <= 0 && new_limit > 0) {
+ if (!(bevp->write_suspended & BEV_SUSPEND_BW))
+ event_del(&bevp->rate_limiting->refill_bucket_event);
+ bufferevent_unsuspend_read_(bev, BEV_SUSPEND_BW);
+ }
+
+ BEV_UNLOCK(bev);
+ return r;
+}
+
+int
+bufferevent_decrement_write_limit(struct bufferevent *bev, ev_ssize_t decr)
+{
+ /* XXXX this is mostly copy-and-paste from
+ * bufferevent_decrement_read_limit */
+ int r = 0;
+ ev_ssize_t old_limit, new_limit;
+ struct bufferevent_private *bevp;
+ BEV_LOCK(bev);
+ bevp = BEV_UPCAST(bev);
+ EVUTIL_ASSERT(bevp->rate_limiting && bevp->rate_limiting->cfg);
+ old_limit = bevp->rate_limiting->limit.write_limit;
+
+ new_limit = (bevp->rate_limiting->limit.write_limit -= decr);
+ if (old_limit > 0 && new_limit <= 0) {
+ bufferevent_suspend_write_(bev, BEV_SUSPEND_BW);
+ if (event_add(&bevp->rate_limiting->refill_bucket_event,
+ &bevp->rate_limiting->cfg->tick_timeout) < 0)
+ r = -1;
+ } else if (old_limit <= 0 && new_limit > 0) {
+ if (!(bevp->read_suspended & BEV_SUSPEND_BW))
+ event_del(&bevp->rate_limiting->refill_bucket_event);
+ bufferevent_unsuspend_write_(bev, BEV_SUSPEND_BW);
+ }
+
+ BEV_UNLOCK(bev);
+ return r;
+}
+
+int
+bufferevent_rate_limit_group_decrement_read(
+ struct bufferevent_rate_limit_group *grp, ev_ssize_t decr)
+{
+ int r = 0;
+ ev_ssize_t old_limit, new_limit;
+ LOCK_GROUP(grp);
+ old_limit = grp->rate_limit.read_limit;
+ new_limit = (grp->rate_limit.read_limit -= decr);
+
+ if (old_limit > 0 && new_limit <= 0) {
+ bev_group_suspend_reading_(grp);
+ } else if (old_limit <= 0 && new_limit > 0) {
+ bev_group_unsuspend_reading_(grp);
+ }
+
+ UNLOCK_GROUP(grp);
+ return r;
+}
+
+int
+bufferevent_rate_limit_group_decrement_write(
+ struct bufferevent_rate_limit_group *grp, ev_ssize_t decr)
+{
+ int r = 0;
+ ev_ssize_t old_limit, new_limit;
+ LOCK_GROUP(grp);
+ old_limit = grp->rate_limit.write_limit;
+ new_limit = (grp->rate_limit.write_limit -= decr);
+
+ if (old_limit > 0 && new_limit <= 0) {
+ bev_group_suspend_writing_(grp);
+ } else if (old_limit <= 0 && new_limit > 0) {
+ bev_group_unsuspend_writing_(grp);
+ }
+
+ UNLOCK_GROUP(grp);
+ return r;
+}
+
+void
+bufferevent_rate_limit_group_get_totals(struct bufferevent_rate_limit_group *grp,
+ ev_uint64_t *total_read_out, ev_uint64_t *total_written_out)
+{
+ EVUTIL_ASSERT(grp != NULL);
+ if (total_read_out)
+ *total_read_out = grp->total_read;
+ if (total_written_out)
+ *total_written_out = grp->total_written;
+}
+
+void
+bufferevent_rate_limit_group_reset_totals(struct bufferevent_rate_limit_group *grp)
+{
+ grp->total_read = grp->total_written = 0;
+}
+
+int
+bufferevent_ratelim_init_(struct bufferevent_private *bev)
+{
+ bev->rate_limiting = NULL;
+ bev->max_single_read = MAX_SINGLE_READ_DEFAULT;
+ bev->max_single_write = MAX_SINGLE_WRITE_DEFAULT;
+
+ return 0;
+}
diff --git a/protocols/Telegram/tgl/libevent/bufferevent_ratelim.obj b/protocols/Telegram/tgl/libevent/bufferevent_ratelim.obj
new file mode 100644
index 0000000000..1e481e49f1
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/bufferevent_ratelim.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/bufferevent_sock.c b/protocols/Telegram/tgl/libevent/bufferevent_sock.c
new file mode 100644
index 0000000000..a2b381ac4d
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/bufferevent_sock.c
@@ -0,0 +1,707 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ * Copyright (c) 2002-2006 Niels Provos <provos@citi.umich.edu>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 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 "event2/event-config.h"
+#include "evconfig-private.h"
+
+#include <sys/types.h>
+
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef EVENT__HAVE_STDARG_H
+#include <stdarg.h>
+#endif
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
+#ifdef EVENT__HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef EVENT__HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef EVENT__HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+
+#include "event2/util.h"
+#include "event2/bufferevent.h"
+#include "event2/buffer.h"
+#include "event2/bufferevent_struct.h"
+#include "event2/bufferevent_compat.h"
+#include "event2/event.h"
+#include "log-internal.h"
+#include "mm-internal.h"
+#include "bufferevent-internal.h"
+#include "util-internal.h"
+#ifdef _WIN32
+#include "iocp-internal.h"
+#endif
+
+/* prototypes */
+static int be_socket_enable(struct bufferevent *, short);
+static int be_socket_disable(struct bufferevent *, short);
+static void be_socket_destruct(struct bufferevent *);
+static int be_socket_flush(struct bufferevent *, short, enum bufferevent_flush_mode);
+static int be_socket_ctrl(struct bufferevent *, enum bufferevent_ctrl_op, union bufferevent_ctrl_data *);
+
+static void be_socket_setfd(struct bufferevent *, evutil_socket_t);
+
+const struct bufferevent_ops bufferevent_ops_socket = {
+ "socket",
+ evutil_offsetof(struct bufferevent_private, bev),
+ be_socket_enable,
+ be_socket_disable,
+ NULL, /* unlink */
+ be_socket_destruct,
+ bufferevent_generic_adj_existing_timeouts_,
+ be_socket_flush,
+ be_socket_ctrl,
+};
+
+const struct sockaddr*
+bufferevent_socket_get_conn_address_(struct bufferevent *bev)
+{
+ struct bufferevent_private *bev_p =
+ EVUTIL_UPCAST(bev, struct bufferevent_private, bev);
+
+ return (struct sockaddr *)&bev_p->conn_address;
+}
+static void
+bufferevent_socket_set_conn_address_fd(struct bufferevent_private *bev_p, int fd)
+{
+ socklen_t len = sizeof(bev_p->conn_address);
+
+ struct sockaddr *addr = (struct sockaddr *)&bev_p->conn_address;
+ if (addr->sa_family != AF_UNSPEC)
+ getpeername(fd, addr, &len);
+}
+static void
+bufferevent_socket_set_conn_address(struct bufferevent_private *bev_p,
+ struct sockaddr *addr, size_t addrlen)
+{
+ EVUTIL_ASSERT(addrlen <= sizeof(bev_p->conn_address));
+ memcpy(&bev_p->conn_address, addr, addrlen);
+}
+
+static void
+bufferevent_socket_outbuf_cb(struct evbuffer *buf,
+ const struct evbuffer_cb_info *cbinfo,
+ void *arg)
+{
+ struct bufferevent *bufev = arg;
+ struct bufferevent_private *bufev_p =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+
+ if (cbinfo->n_added &&
+ (bufev->enabled & EV_WRITE) &&
+ !event_pending(&bufev->ev_write, EV_WRITE, NULL) &&
+ !bufev_p->write_suspended) {
+ /* Somebody added data to the buffer, and we would like to
+ * write, and we were not writing. So, start writing. */
+ if (bufferevent_add_event_(&bufev->ev_write, &bufev->timeout_write) == -1) {
+ /* Should we log this? */
+ }
+ }
+}
+
+static void
+bufferevent_readcb(evutil_socket_t fd, short event, void *arg)
+{
+ struct bufferevent *bufev = arg;
+ struct bufferevent_private *bufev_p =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+ struct evbuffer *input;
+ int res = 0;
+ short what = BEV_EVENT_READING;
+ ev_ssize_t howmuch = -1, readmax=-1;
+
+ bufferevent_incref_and_lock_(bufev);
+
+ if (event == EV_TIMEOUT) {
+ /* Note that we only check for event==EV_TIMEOUT. If
+ * event==EV_TIMEOUT|EV_READ, we can safely ignore the
+ * timeout, since a read has occurred */
+ what |= BEV_EVENT_TIMEOUT;
+ goto error;
+ }
+
+ input = bufev->input;
+
+ /*
+ * If we have a high watermark configured then we don't want to
+ * read more data than would make us reach the watermark.
+ */
+ if (bufev->wm_read.high != 0) {
+ howmuch = bufev->wm_read.high - evbuffer_get_length(input);
+ /* we somehow lowered the watermark, stop reading */
+ if (howmuch <= 0) {
+ bufferevent_wm_suspend_read(bufev);
+ goto done;
+ }
+ }
+ readmax = bufferevent_get_read_max_(bufev_p);
+ if (howmuch < 0 || howmuch > readmax) /* The use of -1 for "unlimited"
+ * uglifies this code. XXXX */
+ howmuch = readmax;
+ if (bufev_p->read_suspended)
+ goto done;
+
+ evbuffer_unfreeze(input, 0);
+ res = evbuffer_read(input, fd, (int)howmuch); /* XXXX evbuffer_read would do better to take and return ev_ssize_t */
+ evbuffer_freeze(input, 0);
+
+ if (res == -1) {
+ int err = evutil_socket_geterror(fd);
+ if (EVUTIL_ERR_RW_RETRIABLE(err))
+ goto reschedule;
+ /* error case */
+ what |= BEV_EVENT_ERROR;
+ } else if (res == 0) {
+ /* eof case */
+ what |= BEV_EVENT_EOF;
+ }
+
+ if (res <= 0)
+ goto error;
+
+ bufferevent_decrement_read_buckets_(bufev_p, res);
+
+ /* Invoke the user callback - must always be called last */
+ bufferevent_trigger_nolock_(bufev, EV_READ, 0);
+
+ goto done;
+
+ reschedule:
+ goto done;
+
+ error:
+ bufferevent_disable(bufev, EV_READ);
+ bufferevent_run_eventcb_(bufev, what, 0);
+
+ done:
+ bufferevent_decref_and_unlock_(bufev);
+}
+
+static void
+bufferevent_writecb(evutil_socket_t fd, short event, void *arg)
+{
+ struct bufferevent *bufev = arg;
+ struct bufferevent_private *bufev_p =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+ int res = 0;
+ short what = BEV_EVENT_WRITING;
+ int connected = 0;
+ ev_ssize_t atmost = -1;
+
+ bufferevent_incref_and_lock_(bufev);
+
+ if (event == EV_TIMEOUT) {
+ /* Note that we only check for event==EV_TIMEOUT. If
+ * event==EV_TIMEOUT|EV_WRITE, we can safely ignore the
+ * timeout, since a read has occurred */
+ what |= BEV_EVENT_TIMEOUT;
+ goto error;
+ }
+ if (bufev_p->connecting) {
+ int c = evutil_socket_finished_connecting_(fd);
+ /* we need to fake the error if the connection was refused
+ * immediately - usually connection to localhost on BSD */
+ if (bufev_p->connection_refused) {
+ bufev_p->connection_refused = 0;
+ c = -1;
+ }
+
+ if (c == 0)
+ goto done;
+
+ bufev_p->connecting = 0;
+ if (c < 0) {
+ event_del(&bufev->ev_write);
+ event_del(&bufev->ev_read);
+ bufferevent_run_eventcb_(bufev, BEV_EVENT_ERROR, 0);
+ goto done;
+ } else {
+ connected = 1;
+ bufferevent_socket_set_conn_address_fd(bufev_p, fd);
+#ifdef _WIN32
+ if (BEV_IS_ASYNC(bufev)) {
+ event_del(&bufev->ev_write);
+ bufferevent_async_set_connected_(bufev);
+ bufferevent_run_eventcb_(bufev,
+ BEV_EVENT_CONNECTED, 0);
+ goto done;
+ }
+#endif
+ bufferevent_run_eventcb_(bufev,
+ BEV_EVENT_CONNECTED, 0);
+ if (!(bufev->enabled & EV_WRITE) ||
+ bufev_p->write_suspended) {
+ event_del(&bufev->ev_write);
+ goto done;
+ }
+ }
+ }
+
+ atmost = bufferevent_get_write_max_(bufev_p);
+
+ if (bufev_p->write_suspended)
+ goto done;
+
+ if (evbuffer_get_length(bufev->output)) {
+ evbuffer_unfreeze(bufev->output, 1);
+ res = evbuffer_write_atmost(bufev->output, fd, atmost);
+ evbuffer_freeze(bufev->output, 1);
+ if (res == -1) {
+ int err = evutil_socket_geterror(fd);
+ if (EVUTIL_ERR_RW_RETRIABLE(err))
+ goto reschedule;
+ what |= BEV_EVENT_ERROR;
+ } else if (res == 0) {
+ /* eof case
+ XXXX Actually, a 0 on write doesn't indicate
+ an EOF. An ECONNRESET might be more typical.
+ */
+ what |= BEV_EVENT_EOF;
+ }
+ if (res <= 0)
+ goto error;
+
+ bufferevent_decrement_write_buckets_(bufev_p, res);
+ }
+
+ if (evbuffer_get_length(bufev->output) == 0) {
+ event_del(&bufev->ev_write);
+ }
+
+ /*
+ * Invoke the user callback if our buffer is drained or below the
+ * low watermark.
+ */
+ if (res || !connected) {
+ bufferevent_trigger_nolock_(bufev, EV_WRITE, 0);
+ }
+
+ goto done;
+
+ reschedule:
+ if (evbuffer_get_length(bufev->output) == 0) {
+ event_del(&bufev->ev_write);
+ }
+ goto done;
+
+ error:
+ bufferevent_disable(bufev, EV_WRITE);
+ bufferevent_run_eventcb_(bufev, what, 0);
+
+ done:
+ bufferevent_decref_and_unlock_(bufev);
+}
+
+struct bufferevent *
+bufferevent_socket_new(struct event_base *base, evutil_socket_t fd,
+ int options)
+{
+ struct bufferevent_private *bufev_p;
+ struct bufferevent *bufev;
+
+#ifdef _WIN32
+ if (base && event_base_get_iocp_(base))
+ return bufferevent_async_new_(base, fd, options);
+#endif
+
+ if ((bufev_p = mm_calloc(1, sizeof(struct bufferevent_private)))== NULL)
+ return NULL;
+
+ if (bufferevent_init_common_(bufev_p, base, &bufferevent_ops_socket,
+ options) < 0) {
+ mm_free(bufev_p);
+ return NULL;
+ }
+ bufev = &bufev_p->bev;
+ evbuffer_set_flags(bufev->output, EVBUFFER_FLAG_DRAINS_TO_FD);
+
+ event_assign(&bufev->ev_read, bufev->ev_base, fd,
+ EV_READ|EV_PERSIST|EV_FINALIZE, bufferevent_readcb, bufev);
+ event_assign(&bufev->ev_write, bufev->ev_base, fd,
+ EV_WRITE|EV_PERSIST|EV_FINALIZE, bufferevent_writecb, bufev);
+
+ evbuffer_add_cb(bufev->output, bufferevent_socket_outbuf_cb, bufev);
+
+ evbuffer_freeze(bufev->input, 0);
+ evbuffer_freeze(bufev->output, 1);
+
+ return bufev;
+}
+
+int
+bufferevent_socket_connect(struct bufferevent *bev,
+ const struct sockaddr *sa, int socklen)
+{
+ struct bufferevent_private *bufev_p =
+ EVUTIL_UPCAST(bev, struct bufferevent_private, bev);
+
+ evutil_socket_t fd;
+ int r = 0;
+ int result=-1;
+ int ownfd = 0;
+
+ bufferevent_incref_and_lock_(bev);
+
+ if (!bufev_p)
+ goto done;
+
+ fd = bufferevent_getfd(bev);
+ if (fd < 0) {
+ if (!sa)
+ goto done;
+ fd = evutil_socket_(sa->sa_family,
+ SOCK_STREAM|EVUTIL_SOCK_NONBLOCK, 0);
+ if (fd < 0)
+ goto done;
+ ownfd = 1;
+ }
+ if (sa) {
+#ifdef _WIN32
+ if (bufferevent_async_can_connect_(bev)) {
+ bufferevent_setfd(bev, fd);
+ r = bufferevent_async_connect_(bev, fd, sa, socklen);
+ if (r < 0)
+ goto freesock;
+ bufev_p->connecting = 1;
+ result = 0;
+ goto done;
+ } else
+#endif
+ r = evutil_socket_connect_(&fd, sa, socklen);
+ if (r < 0)
+ goto freesock;
+ }
+#ifdef _WIN32
+ /* ConnectEx() isn't always around, even when IOCP is enabled.
+ * Here, we borrow the socket object's write handler to fall back
+ * on a non-blocking connect() when ConnectEx() is unavailable. */
+ if (BEV_IS_ASYNC(bev)) {
+ event_assign(&bev->ev_write, bev->ev_base, fd,
+ EV_WRITE|EV_PERSIST|EV_FINALIZE, bufferevent_writecb, bev);
+ }
+#endif
+ bufferevent_setfd(bev, fd);
+ if (r == 0) {
+ if (! be_socket_enable(bev, EV_WRITE)) {
+ bufev_p->connecting = 1;
+ result = 0;
+ goto done;
+ }
+ } else if (r == 1) {
+ /* The connect succeeded already. How very BSD of it. */
+ result = 0;
+ bufev_p->connecting = 1;
+ event_active(&bev->ev_write, EV_WRITE, 1);
+ } else {
+ /* The connect failed already. How very BSD of it. */
+ bufev_p->connection_refused = 1;
+ bufev_p->connecting = 1;
+ result = 0;
+ event_active(&bev->ev_write, EV_WRITE, 1);
+ }
+
+ goto done;
+
+freesock:
+ bufferevent_run_eventcb_(bev, BEV_EVENT_ERROR, 0);
+ if (ownfd)
+ evutil_closesocket(fd);
+ /* do something about the error? */
+done:
+ bufferevent_decref_and_unlock_(bev);
+ return result;
+}
+
+static void
+bufferevent_connect_getaddrinfo_cb(int result, struct evutil_addrinfo *ai,
+ void *arg)
+{
+ struct bufferevent *bev = arg;
+ struct bufferevent_private *bev_p =
+ EVUTIL_UPCAST(bev, struct bufferevent_private, bev);
+ int r;
+ BEV_LOCK(bev);
+
+ bufferevent_unsuspend_write_(bev, BEV_SUSPEND_LOOKUP);
+ bufferevent_unsuspend_read_(bev, BEV_SUSPEND_LOOKUP);
+
+ if (result != 0) {
+ bev_p->dns_error = result;
+ bufferevent_run_eventcb_(bev, BEV_EVENT_ERROR, 0);
+ bufferevent_decref_and_unlock_(bev);
+ if (ai)
+ evutil_freeaddrinfo(ai);
+ return;
+ }
+
+ /* XXX use the other addrinfos? */
+ /* XXX use this return value */
+ bufferevent_socket_set_conn_address(bev_p, ai->ai_addr, (int)ai->ai_addrlen);
+ r = bufferevent_socket_connect(bev, ai->ai_addr, (int)ai->ai_addrlen);
+ (void)r;
+ bufferevent_decref_and_unlock_(bev);
+ evutil_freeaddrinfo(ai);
+}
+
+int
+bufferevent_socket_connect_hostname(struct bufferevent *bev,
+ struct evdns_base *evdns_base, int family, const char *hostname, int port)
+{
+ char portbuf[10];
+ struct evutil_addrinfo hint;
+ int err;
+ struct bufferevent_private *bev_p =
+ EVUTIL_UPCAST(bev, struct bufferevent_private, bev);
+
+ if (family != AF_INET && family != AF_INET6 && family != AF_UNSPEC)
+ return -1;
+ if (port < 1 || port > 65535)
+ return -1;
+
+ memset(&hint, 0, sizeof(hint));
+ hint.ai_family = family;
+ hint.ai_protocol = IPPROTO_TCP;
+ hint.ai_socktype = SOCK_STREAM;
+
+ evutil_snprintf(portbuf, sizeof(portbuf), "%d", port);
+
+ BEV_LOCK(bev);
+ bev_p->dns_error = 0;
+
+ bufferevent_suspend_write_(bev, BEV_SUSPEND_LOOKUP);
+ bufferevent_suspend_read_(bev, BEV_SUSPEND_LOOKUP);
+
+ bufferevent_incref_(bev);
+ err = evutil_getaddrinfo_async_(evdns_base, hostname, portbuf,
+ &hint, bufferevent_connect_getaddrinfo_cb, bev);
+ BEV_UNLOCK(bev);
+
+ if (err == 0) {
+ return 0;
+ } else {
+ bufferevent_unsuspend_write_(bev, BEV_SUSPEND_LOOKUP);
+ bufferevent_unsuspend_read_(bev, BEV_SUSPEND_LOOKUP);
+ bufferevent_decref_(bev);
+ return -1;
+ }
+}
+
+int
+bufferevent_socket_get_dns_error(struct bufferevent *bev)
+{
+ int rv;
+ struct bufferevent_private *bev_p =
+ EVUTIL_UPCAST(bev, struct bufferevent_private, bev);
+
+ BEV_LOCK(bev);
+ rv = bev_p->dns_error;
+ BEV_UNLOCK(bev);
+
+ return rv;
+}
+
+/*
+ * Create a new buffered event object.
+ *
+ * The read callback is invoked whenever we read new data.
+ * The write callback is invoked whenever the output buffer is drained.
+ * The error callback is invoked on a write/read error or on EOF.
+ *
+ * Both read and write callbacks maybe NULL. The error callback is not
+ * allowed to be NULL and have to be provided always.
+ */
+
+struct bufferevent *
+bufferevent_new(evutil_socket_t fd,
+ bufferevent_data_cb readcb, bufferevent_data_cb writecb,
+ bufferevent_event_cb eventcb, void *cbarg)
+{
+ struct bufferevent *bufev;
+
+ if (!(bufev = bufferevent_socket_new(NULL, fd, 0)))
+ return NULL;
+
+ bufferevent_setcb(bufev, readcb, writecb, eventcb, cbarg);
+
+ return bufev;
+}
+
+
+static int
+be_socket_enable(struct bufferevent *bufev, short event)
+{
+ if (event & EV_READ &&
+ bufferevent_add_event_(&bufev->ev_read, &bufev->timeout_read) == -1)
+ return -1;
+ if (event & EV_WRITE &&
+ bufferevent_add_event_(&bufev->ev_write, &bufev->timeout_write) == -1)
+ return -1;
+ return 0;
+}
+
+static int
+be_socket_disable(struct bufferevent *bufev, short event)
+{
+ struct bufferevent_private *bufev_p =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+ if (event & EV_READ) {
+ if (event_del(&bufev->ev_read) == -1)
+ return -1;
+ }
+ /* Don't actually disable the write if we are trying to connect. */
+ if ((event & EV_WRITE) && ! bufev_p->connecting) {
+ if (event_del(&bufev->ev_write) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+static void
+be_socket_destruct(struct bufferevent *bufev)
+{
+ struct bufferevent_private *bufev_p =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+ evutil_socket_t fd;
+ EVUTIL_ASSERT(bufev->be_ops == &bufferevent_ops_socket);
+
+ fd = event_get_fd(&bufev->ev_read);
+
+ if ((bufev_p->options & BEV_OPT_CLOSE_ON_FREE) && fd >= 0)
+ EVUTIL_CLOSESOCKET(fd);
+}
+
+static int
+be_socket_flush(struct bufferevent *bev, short iotype,
+ enum bufferevent_flush_mode mode)
+{
+ return 0;
+}
+
+
+static void
+be_socket_setfd(struct bufferevent *bufev, evutil_socket_t fd)
+{
+ BEV_LOCK(bufev);
+ EVUTIL_ASSERT(bufev->be_ops == &bufferevent_ops_socket);
+
+ event_del(&bufev->ev_read);
+ event_del(&bufev->ev_write);
+
+ event_assign(&bufev->ev_read, bufev->ev_base, fd,
+ EV_READ|EV_PERSIST|EV_FINALIZE, bufferevent_readcb, bufev);
+ event_assign(&bufev->ev_write, bufev->ev_base, fd,
+ EV_WRITE|EV_PERSIST|EV_FINALIZE, bufferevent_writecb, bufev);
+
+ if (fd >= 0)
+ bufferevent_enable(bufev, bufev->enabled);
+
+ BEV_UNLOCK(bufev);
+}
+
+/* XXXX Should non-socket bufferevents support this? */
+int
+bufferevent_priority_set(struct bufferevent *bufev, int priority)
+{
+ int r = -1;
+ struct bufferevent_private *bufev_p =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+
+ BEV_LOCK(bufev);
+ if (bufev->be_ops != &bufferevent_ops_socket)
+ goto done;
+
+ if (event_priority_set(&bufev->ev_read, priority) == -1)
+ goto done;
+ if (event_priority_set(&bufev->ev_write, priority) == -1)
+ goto done;
+
+ event_deferred_cb_set_priority_(&bufev_p->deferred, priority);
+
+ r = 0;
+done:
+ BEV_UNLOCK(bufev);
+ return r;
+}
+
+/* XXXX Should non-socket bufferevents support this? */
+int
+bufferevent_base_set(struct event_base *base, struct bufferevent *bufev)
+{
+ int res = -1;
+
+ BEV_LOCK(bufev);
+ if (bufev->be_ops != &bufferevent_ops_socket)
+ goto done;
+
+ bufev->ev_base = base;
+
+ res = event_base_set(base, &bufev->ev_read);
+ if (res == -1)
+ goto done;
+
+ res = event_base_set(base, &bufev->ev_write);
+done:
+ BEV_UNLOCK(bufev);
+ return res;
+}
+
+static int
+be_socket_ctrl(struct bufferevent *bev, enum bufferevent_ctrl_op op,
+ union bufferevent_ctrl_data *data)
+{
+ switch (op) {
+ case BEV_CTRL_SET_FD:
+ be_socket_setfd(bev, data->fd);
+ return 0;
+ case BEV_CTRL_GET_FD:
+ data->fd = event_get_fd(&bev->ev_read);
+ return 0;
+ case BEV_CTRL_GET_UNDERLYING:
+ case BEV_CTRL_CANCEL_ALL:
+ default:
+ return -1;
+ }
+}
diff --git a/protocols/Telegram/tgl/libevent/bufferevent_sock.obj b/protocols/Telegram/tgl/libevent/bufferevent_sock.obj
new file mode 100644
index 0000000000..f7d3083037
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/bufferevent_sock.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/changelist-internal.h b/protocols/Telegram/tgl/libevent/changelist-internal.h
new file mode 100644
index 0000000000..98fc52aebf
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/changelist-internal.h
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef CHANGELIST_INTERNAL_H_INCLUDED_
+#define CHANGELIST_INTERNAL_H_INCLUDED_
+
+/*
+ A "changelist" is a list of all the fd status changes that should be made
+ between calls to the backend's dispatch function. There are a few reasons
+ that a backend would want to queue changes like this rather than processing
+ them immediately.
+
+ 1) Sometimes applications will add and delete the same event more than
+ once between calls to dispatch. Processing these changes immediately
+ is needless, and potentially expensive (especially if we're on a system
+ that makes one syscall per changed event).
+
+ 2) Sometimes we can coalesce multiple changes on the same fd into a single
+ syscall if we know about them in advance. For example, epoll can do an
+ add and a delete at the same time, but only if we have found out about
+ both of them before we tell epoll.
+
+ 3) Sometimes adding an event that we immediately delete can cause
+ unintended consequences: in kqueue, this makes pending events get
+ reported spuriously.
+ */
+
+#include "event2/util.h"
+
+/** Represents a */
+struct event_change {
+ /** The fd or signal whose events are to be changed */
+ evutil_socket_t fd;
+ /* The events that were enabled on the fd before any of these changes
+ were made. May include EV_READ or EV_WRITE. */
+ short old_events;
+
+ /* The changes that we want to make in reading and writing on this fd.
+ * If this is a signal, then read_change has EV_CHANGE_SIGNAL set,
+ * and write_change is unused. */
+ ev_uint8_t read_change;
+ ev_uint8_t write_change;
+ ev_uint8_t close_change;
+};
+
+/* Flags for read_change and write_change. */
+
+/* If set, add the event. */
+#define EV_CHANGE_ADD 0x01
+/* If set, delete the event. Exclusive with EV_CHANGE_ADD */
+#define EV_CHANGE_DEL 0x02
+/* If set, this event refers a signal, not an fd. */
+#define EV_CHANGE_SIGNAL EV_SIGNAL
+/* Set for persistent events. Currently not used. */
+#define EV_CHANGE_PERSIST EV_PERSIST
+/* Set for adding edge-triggered events. */
+#define EV_CHANGE_ET EV_ET
+
+/* The value of fdinfo_size that a backend should use if it is letting
+ * changelist handle its add and delete functions. */
+#define EVENT_CHANGELIST_FDINFO_SIZE sizeof(int)
+
+/** Set up the data fields in a changelist. */
+void event_changelist_init_(struct event_changelist *changelist);
+/** Remove every change in the changelist, and make corresponding changes
+ * in the event maps in the base. This function is generally used right
+ * after making all the changes in the changelist. */
+void event_changelist_remove_all_(struct event_changelist *changelist,
+ struct event_base *base);
+/** Free all memory held in a changelist. */
+void event_changelist_freemem_(struct event_changelist *changelist);
+
+/** Implementation of eventop_add that queues the event in a changelist. */
+int event_changelist_add_(struct event_base *base, evutil_socket_t fd, short old, short events,
+ void *p);
+/** Implementation of eventop_del that queues the event in a changelist. */
+int event_changelist_del_(struct event_base *base, evutil_socket_t fd, short old, short events,
+ void *p);
+
+#endif
diff --git a/protocols/Telegram/tgl/libevent/cmake/AddCompilerFlags.cmake b/protocols/Telegram/tgl/libevent/cmake/AddCompilerFlags.cmake
new file mode 100644
index 0000000000..c7da188b7a
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/cmake/AddCompilerFlags.cmake
@@ -0,0 +1,15 @@
+include(CheckCCompilerFlag)
+
+macro(add_compiler_flags _flags)
+ foreach(flag ${_flags})
+ string(REGEX REPLACE "[-.+/:= ]" "_" _flag_esc "${flag}")
+
+ check_c_compiler_flag("${flag}" check_c_compiler_flag_${_flag_esc})
+
+ if (check_c_compiler_flag_${_flag_esc})
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
+ endif()
+ endforeach()
+endmacro()
+
+
diff --git a/protocols/Telegram/tgl/libevent/cmake/COPYING-CMAKE-SCRIPTS b/protocols/Telegram/tgl/libevent/cmake/COPYING-CMAKE-SCRIPTS
new file mode 100644
index 0000000000..ab3c4d25d1
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/cmake/COPYING-CMAKE-SCRIPTS
@@ -0,0 +1,22 @@
+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 copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the 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. \ No newline at end of file
diff --git a/protocols/Telegram/tgl/libevent/cmake/CheckFileOffsetBits.c b/protocols/Telegram/tgl/libevent/cmake/CheckFileOffsetBits.c
new file mode 100644
index 0000000000..d948fecf2b
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/cmake/CheckFileOffsetBits.c
@@ -0,0 +1,14 @@
+#include <sys/types.h>
+
+#define KB ((off_t)1024)
+#define MB ((off_t)1024 * KB)
+#define GB ((off_t)1024 * MB)
+#define TB ((off_t)1024 * GB)
+int t2[(((64 * GB -1) % 671088649) == 268434537)
+ && (((TB - (64 * GB -1) + 255) % 1792151290) == 305159546)? 1: -1];
+
+int main()
+{
+ ;
+ return 0;
+}
diff --git a/protocols/Telegram/tgl/libevent/cmake/CheckFileOffsetBits.cmake b/protocols/Telegram/tgl/libevent/cmake/CheckFileOffsetBits.cmake
new file mode 100644
index 0000000000..1253440160
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/cmake/CheckFileOffsetBits.cmake
@@ -0,0 +1,43 @@
+# - Check if _FILE_OFFSET_BITS macro needed for large files
+# CHECK_FILE_OFFSET_BITS ()
+#
+# The following variables may be set before calling this macro to
+# modify the way the check is run:
+#
+# CMAKE_REQUIRED_FLAGS = string of compile command line flags
+# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+# CMAKE_REQUIRED_INCLUDES = list of include directories
+# Copyright (c) 2009, Michihiro NAKAJIMA
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+#INCLUDE(CheckCSourceCompiles)
+
+GET_FILENAME_COMPONENT(_selfdir_CheckFileOffsetBits
+ "${CMAKE_CURRENT_LIST_FILE}" PATH)
+
+MACRO (CHECK_FILE_OFFSET_BITS)
+ IF(NOT DEFINED _FILE_OFFSET_BITS)
+ MESSAGE(STATUS "Cheking _FILE_OFFSET_BITS for large files")
+ TRY_COMPILE(__WITHOUT_FILE_OFFSET_BITS_64
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${_selfdir_CheckFileOffsetBits}/CheckFileOffsetBits.c
+ COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS})
+ IF(NOT __WITHOUT_FILE_OFFSET_BITS_64)
+ TRY_COMPILE(__WITH_FILE_OFFSET_BITS_64
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${_selfdir_CheckFileOffsetBits}/CheckFileOffsetBits.c
+ COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -D_FILE_OFFSET_BITS=64)
+ ENDIF(NOT __WITHOUT_FILE_OFFSET_BITS_64)
+
+ IF(NOT __WITHOUT_FILE_OFFSET_BITS_64 AND __WITH_FILE_OFFSET_BITS_64)
+ SET(_FILE_OFFSET_BITS 64 CACHE INTERNAL "_FILE_OFFSET_BITS macro needed for large files")
+ MESSAGE(STATUS "Cheking _FILE_OFFSET_BITS for large files - needed")
+ ELSE(NOT __WITHOUT_FILE_OFFSET_BITS_64 AND __WITH_FILE_OFFSET_BITS_64)
+ SET(_FILE_OFFSET_BITS "" CACHE INTERNAL "_FILE_OFFSET_BITS macro needed for large files")
+ MESSAGE(STATUS "Cheking _FILE_OFFSET_BITS for large files - not needed")
+ ENDIF(NOT __WITHOUT_FILE_OFFSET_BITS_64 AND __WITH_FILE_OFFSET_BITS_64)
+ ENDIF(NOT DEFINED _FILE_OFFSET_BITS)
+
+ENDMACRO (CHECK_FILE_OFFSET_BITS)
diff --git a/protocols/Telegram/tgl/libevent/cmake/CheckFunctionExistsEx.c b/protocols/Telegram/tgl/libevent/cmake/CheckFunctionExistsEx.c
new file mode 100644
index 0000000000..5ee3e5913a
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/cmake/CheckFunctionExistsEx.c
@@ -0,0 +1,30 @@
+#ifdef CHECK_FUNCTION_EXISTS
+
+#ifndef _WIN32
+char CHECK_FUNCTION_EXISTS();
+#endif
+
+#ifdef __CLASSIC_C__
+int main(){
+ int ac;
+ char*av[];
+#else
+int main(int ac, char*av[]){
+#endif
+#ifdef _WIN32
+ void * p = &CHECK_FUNCTION_EXISTS;
+#else
+ CHECK_FUNCTION_EXISTS();
+#endif
+ if(ac > 1000)
+ {
+ return *av[0];
+ }
+ return 0;
+}
+
+#else /* CHECK_FUNCTION_EXISTS */
+
+# error "CHECK_FUNCTION_EXISTS has to specify the function"
+
+#endif /* CHECK_FUNCTION_EXISTS */
diff --git a/protocols/Telegram/tgl/libevent/cmake/CheckFunctionExistsEx.cmake b/protocols/Telegram/tgl/libevent/cmake/CheckFunctionExistsEx.cmake
new file mode 100644
index 0000000000..f513f4e108
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/cmake/CheckFunctionExistsEx.cmake
@@ -0,0 +1,69 @@
+# - Check if a C function can be linked
+# CHECK_FUNCTION_EXISTS(<function> <variable>)
+#
+# Check that the <function> is provided by libraries on the system and
+# store the result in a <variable>. This does not verify that any
+# system header file declares the function, only that it can be found
+# at link time (considure using CheckSymbolExists).
+#
+# The following variables may be set before calling this macro to
+# modify the way the check is run:
+#
+# CMAKE_REQUIRED_FLAGS = string of compile command line flags
+# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+# CMAKE_REQUIRED_INCLUDES = list of include directories
+# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
+
+#=============================================================================
+# Copyright 2002-2011 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+MACRO(CHECK_FUNCTION_EXISTS_EX FUNCTION VARIABLE)
+ IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
+ SET(MACRO_CHECK_FUNCTION_DEFINITIONS
+ "-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}")
+ MESSAGE(STATUS "Looking for ${FUNCTION}")
+ IF(CMAKE_REQUIRED_LIBRARIES)
+ SET(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
+ "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
+ ELSE(CMAKE_REQUIRED_LIBRARIES)
+ SET(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES)
+ ENDIF(CMAKE_REQUIRED_LIBRARIES)
+ IF(CMAKE_REQUIRED_INCLUDES)
+ SET(CHECK_FUNCTION_EXISTS_ADD_INCLUDES
+ "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
+ ELSE(CMAKE_REQUIRED_INCLUDES)
+ SET(CHECK_FUNCTION_EXISTS_ADD_INCLUDES)
+ ENDIF(CMAKE_REQUIRED_INCLUDES)
+ TRY_COMPILE(${VARIABLE}
+ ${CMAKE_BINARY_DIR}
+ ${PROJECT_SOURCE_DIR}/cmake/CheckFunctionExistsEx.c
+ COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
+ "${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}"
+ "${CHECK_FUNCTION_EXISTS_ADD_INCLUDES}"
+ OUTPUT_VARIABLE OUTPUT)
+ IF(${VARIABLE})
+ SET(${VARIABLE} 1 CACHE INTERNAL "Have function ${FUNCTION}")
+ MESSAGE(STATUS "Looking for ${FUNCTION} - found")
+ FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Determining if the function ${FUNCTION} exists passed with the following output:\n"
+ "${OUTPUT}\n\n")
+ ELSE(${VARIABLE})
+ MESSAGE(STATUS "Looking for ${FUNCTION} - not found")
+ SET(${VARIABLE} "" CACHE INTERNAL "Have function ${FUNCTION}")
+ FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Determining if the function ${FUNCTION} exists failed with the following output:\n"
+ "${OUTPUT}\n\n")
+ ENDIF(${VARIABLE})
+ ENDIF("${VARIABLE}" MATCHES "^${VARIABLE}$")
+ENDMACRO(CHECK_FUNCTION_EXISTS_EX)
diff --git a/protocols/Telegram/tgl/libevent/cmake/CheckFunctionKeywords.cmake b/protocols/Telegram/tgl/libevent/cmake/CheckFunctionKeywords.cmake
new file mode 100644
index 0000000000..3d968b8a6b
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/cmake/CheckFunctionKeywords.cmake
@@ -0,0 +1,14 @@
+include(CheckCSourceCompiles)
+
+macro(check_function_keywords _wordlist)
+ set(${_result} "")
+ foreach(flag ${_wordlist})
+ string(REGEX REPLACE "[-+/ ()]" "_" flagname "${flag}")
+ string(TOUPPER "${flagname}" flagname)
+ set(have_flag "HAVE_${flagname}")
+ check_c_source_compiles("${flag} void func(); void func() { } int main() { func(); return 0; }" ${have_flag})
+ if(${have_flag} AND NOT ${_result})
+ set(${_result} "${flag}")
+ endif(${have_flag} AND NOT ${_result})
+ endforeach(flag)
+endmacro(check_function_keywords)
diff --git a/protocols/Telegram/tgl/libevent/cmake/CheckPrototypeDefinition.c.in b/protocols/Telegram/tgl/libevent/cmake/CheckPrototypeDefinition.c.in
new file mode 100644
index 0000000000..a97344ac3e
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/cmake/CheckPrototypeDefinition.c.in
@@ -0,0 +1,29 @@
+@CHECK_PROTOTYPE_DEFINITION_HEADER@
+
+static void cmakeRequireSymbol(int dummy, ...) {
+ (void) dummy;
+}
+
+static void checkSymbol(void) {
+#ifndef @CHECK_PROTOTYPE_DEFINITION_SYMBOL@
+ cmakeRequireSymbol(0, &@CHECK_PROTOTYPE_DEFINITION_SYMBOL@);
+#endif
+}
+
+@CHECK_PROTOTYPE_DEFINITION_PROTO@ {
+ return @CHECK_PROTOTYPE_DEFINITION_RETURN@;
+}
+
+#ifdef __CLASSIC_C__
+int main() {
+ int ac;
+ char*av[];
+#else
+int main(int ac, char *av[]) {
+#endif
+ checkSymbol();
+ if (ac > 1000) {
+ return *av[0];
+ }
+ return 0;
+}
diff --git a/protocols/Telegram/tgl/libevent/cmake/CheckPrototypeDefinition.cmake b/protocols/Telegram/tgl/libevent/cmake/CheckPrototypeDefinition.cmake
new file mode 100644
index 0000000000..e0c6a572c0
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/cmake/CheckPrototypeDefinition.cmake
@@ -0,0 +1,84 @@
+# - Check if the protoype we expect is correct.
+# check_prototype_definition(FUNCTION PROTOTYPE RETURN HEADER VARIABLE)
+#
+# FUNCTION - The name of the function (used to check if prototype exists)
+# PROTOTYPE- The prototype to check.
+# RETURN - The return value of the function.
+# HEADER - The header files required.
+# VARIABLE - The variable to store the result.
+#
+# Example:
+#
+# check_prototype_definition(getpwent_r
+# "struct passwd *getpwent_r(struct passwd *src, char *buf, int buflen)"
+# "NULL"
+# "unistd.h;pwd.h"
+# SOLARIS_GETPWENT_R)
+#
+# The following variables may be set before calling this macro to
+# modify the way the check is run:
+#
+# CMAKE_REQUIRED_FLAGS = string of compile command line flags
+# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+# CMAKE_REQUIRED_INCLUDES = list of include directories
+# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
+
+
+function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIABLE)
+
+ if ("${_VARIABLE}" MATCHES "^${_VARIABLE}$")
+ set(CHECK_PROTOTYPE_DEFINITION_CONTENT "/* */\n")
+
+ set(CHECK_PROTOTYPE_DEFINITION_FLAGS ${CMAKE_REQUIRED_FLAGS})
+ if (CMAKE_REQUIRED_LIBRARIES)
+ set(CHECK_PROTOTYPE_DEFINITION_LIBS
+ "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
+ else(CMAKE_REQUIRED_LIBRARIES)
+ set(CHECK_PROTOTYPE_DEFINITION_LIBS)
+ endif(CMAKE_REQUIRED_LIBRARIES)
+ if (CMAKE_REQUIRED_INCLUDES)
+ set(CMAKE_SYMBOL_EXISTS_INCLUDES
+ "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
+ else(CMAKE_REQUIRED_INCLUDES)
+ set(CMAKE_SYMBOL_EXISTS_INCLUDES)
+ endif(CMAKE_REQUIRED_INCLUDES)
+
+ foreach(_FILE ${_HEADER})
+ set(CHECK_PROTOTYPE_DEFINITION_HEADER
+ "${CHECK_PROTOTYPE_DEFINITION_HEADER}#include <${_FILE}>\n")
+ endforeach(_FILE)
+
+ set(CHECK_PROTOTYPE_DEFINITION_SYMBOL ${_FUNCTION})
+ set(CHECK_PROTOTYPE_DEFINITION_PROTO ${_PROTOTYPE})
+ set(CHECK_PROTOTYPE_DEFINITION_RETURN ${_RETURN})
+
+ configure_file("${PROJECT_SOURCE_DIR}/cmake/CheckPrototypeDefinition.c.in"
+ "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckPrototypeDefinition.c" @ONLY)
+
+ file(READ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckPrototypeDefinition.c _SOURCE)
+
+ try_compile(${_VARIABLE}
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckPrototypeDefinition.c
+ COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CHECK_PROTOTYPE_DEFINITION_FLAGS}
+ "${CHECK_PROTOTYPE_DEFINITION_LIBS}"
+ "${CMAKE_SYMBOL_EXISTS_INCLUDES}"
+ OUTPUT_VARIABLE OUTPUT)
+
+ if (${_VARIABLE})
+ set(${_VARIABLE} 1 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}")
+ message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - True")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} passed with the following output:\n"
+ "${OUTPUT}\n\n")
+ else (${_VARIABLE})
+ message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - False")
+ set(${_VARIABLE} 0 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} failed with the following output:\n"
+ "${OUTPUT}\n\n${_SOURCE}\n\n")
+ endif (${_VARIABLE})
+ endif("${_VARIABLE}" MATCHES "^${_VARIABLE}$")
+
+endfunction(CHECK_PROTOTYPE_DEFINITION)
diff --git a/protocols/Telegram/tgl/libevent/cmake/CheckWorkingKqueue.cmake b/protocols/Telegram/tgl/libevent/cmake/CheckWorkingKqueue.cmake
new file mode 100644
index 0000000000..47bf4e838a
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/cmake/CheckWorkingKqueue.cmake
@@ -0,0 +1,52 @@
+include(CheckCSourceRuns)
+
+check_c_source_runs(
+"
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/event.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+int
+main(int argc, char **argv)
+{
+ int kq;
+ int n;
+ int fd[2];
+ struct kevent ev;
+ struct timespec ts;
+ char buf[8000];
+
+ if (pipe(fd) == -1)
+ exit(1);
+ if (fcntl(fd[1], F_SETFL, O_NONBLOCK) == -1)
+ exit(1);
+
+ while ((n = write(fd[1], buf, sizeof(buf))) == sizeof(buf))
+ ;
+
+ if ((kq = kqueue()) == -1)
+ exit(1);
+
+ memset(&ev, 0, sizeof(ev));
+ ev.ident = fd[1];
+ ev.filter = EVFILT_WRITE;
+ ev.flags = EV_ADD | EV_ENABLE;
+ n = kevent(kq, &ev, 1, NULL, 0, NULL);
+ if (n == -1)
+ exit(1);
+
+ read(fd[0], buf, sizeof(buf));
+
+ ts.tv_sec = 0;
+ ts.tv_nsec = 0;
+ n = kevent(kq, NULL, 0, &ev, 1, &ts);
+ if (n == -1 || n == 0)
+ exit(1);
+
+ exit(0);
+}
+
+" EVENT__HAVE_WORKING_KQUEUE) \ No newline at end of file
diff --git a/protocols/Telegram/tgl/libevent/cmake/CodeCoverage.cmake b/protocols/Telegram/tgl/libevent/cmake/CodeCoverage.cmake
new file mode 100644
index 0000000000..969f273253
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/cmake/CodeCoverage.cmake
@@ -0,0 +1,162 @@
+#
+# Boost Software License - Version 1.0 - August 17th, 2003
+#
+# Permission is hereby granted, free of charge, to any person or organization
+# obtaining a copy of the software and accompanying documentation covered by
+# this license (the "Software") to use, reproduce, display, distribute,
+# execute, and transmit the Software, and to prepare derivative works of the
+# Software, and to permit third-parties to whom the Software is furnished to
+# do so, all subject to the following:
+#
+# The copyright notices in the Software and this entire statement, including
+# the above license grant, this restriction and the following disclaimer,
+# must be included in all copies of the Software, in whole or in part, and
+# all derivative works of the Software, unless such copies or derivative
+# works are solely in the form of machine-executable object code generated by
+# a source language processor.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+# SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+# FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+#
+# 2012-01-31, Lars Bilke
+# - Enable Code Coverage
+#
+# 2013-09-17, Joakim Söderberg
+# - Added support for Clang.
+# - Some additional usage instructions.
+#
+# USAGE:
+# 1. Copy this file into your cmake modules path.
+#
+# 2. Add the following line to your CMakeLists.txt:
+# INCLUDE(CodeCoverage)
+#
+# 3. Set compiler flags to turn off optimization and enable coverage:
+# SET(CMAKE_CXX_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
+# SET(CMAKE_C_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
+#
+# 3. Use the function SETUP_TARGET_FOR_COVERAGE to create a custom make target
+# which runs your test executable and produces a lcov code coverage report:
+# Example:
+# SETUP_TARGET_FOR_COVERAGE(
+# my_coverage_target # Name for custom target.
+# test_driver # Name of the test driver executable that runs the tests.
+# # NOTE! This should always have a ZERO as exit code
+# # otherwise the coverage generation will not complete.
+# coverage # Name of output directory.
+# )
+#
+# 4. Build a Debug build:
+# cmake -DCMAKE_BUILD_TYPE=Debug ..
+# make
+# make my_coverage_target
+#
+#
+
+# Check prereqs
+FIND_PROGRAM( GCOV_PATH gcov )
+FIND_PROGRAM( LCOV_PATH lcov )
+FIND_PROGRAM( GENHTML_PATH genhtml )
+FIND_PROGRAM( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/tests)
+
+IF(NOT GCOV_PATH)
+ MESSAGE(FATAL_ERROR "gcov not found! Aborting...")
+ENDIF() # NOT GCOV_PATH
+
+IF(NOT CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_COMPILER_IS_GNUCXX)
+ # Clang version 3.0.0 and greater now supports gcov as well.
+ MESSAGE(WARNING "Compiler is not GNU gcc! Clang Version 3.0.0 and greater supports gcov as well, but older versions don't.")
+
+ IF(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ MESSAGE(FATAL_ERROR "Compiler is not GNU gcc! Aborting...")
+ ENDIF()
+ENDIF() # NOT CMAKE_COMPILER_IS_GNUCC
+
+IF ( NOT CMAKE_BUILD_TYPE STREQUAL "Debug" )
+ MESSAGE( WARNING "Code coverage results with an optimized (non-Debug) build may be misleading" )
+ENDIF() # NOT CMAKE_BUILD_TYPE STREQUAL "Debug"
+
+
+# Param _targetname The name of new the custom make target
+# Param _testrunner The name of the target which runs the tests.
+# MUST return ZERO always, even on errors.
+# If not, no coverage report will be created!
+# Param _outputname lcov output is generated as _outputname.info
+# HTML report is generated in _outputname/index.html
+# Optional fourth parameter is passed as arguments to _testrunner
+# Pass them in list form, e.g.: "-j;2" for -j 2
+FUNCTION(SETUP_TARGET_FOR_COVERAGE _targetname _testrunner _outputname)
+
+ IF(NOT LCOV_PATH)
+ MESSAGE(FATAL_ERROR "lcov not found! Aborting...")
+ ENDIF() # NOT LCOV_PATH
+
+ IF(NOT GENHTML_PATH)
+ MESSAGE(FATAL_ERROR "genhtml not found! Aborting...")
+ ENDIF() # NOT GENHTML_PATH
+
+ # Setup target
+ ADD_CUSTOM_TARGET(${_targetname}
+
+ # Cleanup lcov
+ ${LCOV_PATH} --directory . --zerocounters
+
+ # Run tests
+ COMMAND ${_testrunner} ${ARGV3}
+
+ # Capturing lcov counters and generating report
+ COMMAND ${LCOV_PATH} --directory . --capture --output-file ${_outputname}.info
+ COMMAND ${LCOV_PATH} --remove ${_outputname}.info 'tests/*' '/usr/*' --output-file ${_outputname}.info.cleaned
+ COMMAND ${GENHTML_PATH} -o ${_outputname} ${_outputname}.info.cleaned
+ COMMAND ${CMAKE_COMMAND} -E remove ${_outputname}.info ${_outputname}.info.cleaned
+
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+ COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report."
+ )
+
+ # Show info where to find the report
+ ADD_CUSTOM_COMMAND(TARGET ${_targetname} POST_BUILD
+ COMMAND ;
+ COMMENT "Open ./${_outputname}/index.html in your browser to view the coverage report."
+ )
+
+ENDFUNCTION() # SETUP_TARGET_FOR_COVERAGE
+
+# Param _targetname The name of new the custom make target
+# Param _testrunner The name of the target which runs the tests
+# Param _outputname cobertura output is generated as _outputname.xml
+# Optional fourth parameter is passed as arguments to _testrunner
+# Pass them in list form, e.g.: "-j;2" for -j 2
+FUNCTION(SETUP_TARGET_FOR_COVERAGE_COBERTURA _targetname _testrunner _outputname)
+
+ IF(NOT PYTHON_EXECUTABLE)
+ MESSAGE(FATAL_ERROR "Python not found! Aborting...")
+ ENDIF() # NOT PYTHON_EXECUTABLE
+
+ IF(NOT GCOVR_PATH)
+ MESSAGE(FATAL_ERROR "gcovr not found! Aborting...")
+ ENDIF() # NOT GCOVR_PATH
+
+ ADD_CUSTOM_TARGET(${_targetname}
+
+ # Run tests
+ ${_testrunner} ${ARGV3}
+
+ # Running gcovr
+ COMMAND ${GCOVR_PATH} -x -r ${CMAKE_SOURCE_DIR} -e '${CMAKE_SOURCE_DIR}/tests/' -o ${_outputname}.xml
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+ COMMENT "Running gcovr to produce Cobertura code coverage report."
+ )
+
+ # Show info where to find the report
+ ADD_CUSTOM_COMMAND(TARGET ${_targetname} POST_BUILD
+ COMMAND ;
+ COMMENT "Cobertura code coverage report saved in ${_outputname}.xml."
+ )
+
+ENDFUNCTION() # SETUP_TARGET_FOR_COVERAGE_COBERTURA
diff --git a/protocols/Telegram/tgl/libevent/cmake/Copyright.txt b/protocols/Telegram/tgl/libevent/cmake/Copyright.txt
new file mode 100644
index 0000000000..813124f02e
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/cmake/Copyright.txt
@@ -0,0 +1,57 @@
+CMake - Cross Platform Makefile Generator
+Copyright 2000-2013 Kitware, Inc.
+Copyright 2000-2011 Insight Software Consortium
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+* Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+* 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.
+
+* Neither the names of Kitware, Inc., the Insight Software Consortium,
+ nor the names of their contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"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 COPYRIGHT
+HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+------------------------------------------------------------------------------
+
+The above copyright and license notice applies to distributions of
+CMake in source and binary form. Some source files contain additional
+notices of original copyright by their contributors; see each source
+for details. Third-party software packages supplied with CMake under
+compatible licenses provide their own copyright notices documented in
+corresponding subdirectories.
+
+------------------------------------------------------------------------------
+
+CMake was initially developed by Kitware with the following sponsorship:
+
+ * National Library of Medicine at the National Institutes of Health
+ as part of the Insight Segmentation and Registration Toolkit (ITK).
+
+ * US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel
+ Visualization Initiative.
+
+ * National Alliance for Medical Image Computing (NAMIC) is funded by the
+ National Institutes of Health through the NIH Roadmap for Medical Research,
+ Grant U54 EB005149.
+
+ * Kitware, Inc. \ No newline at end of file
diff --git a/protocols/Telegram/tgl/libevent/cmake/FindGit.cmake b/protocols/Telegram/tgl/libevent/cmake/FindGit.cmake
new file mode 100644
index 0000000000..2abbfe4e9d
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/cmake/FindGit.cmake
@@ -0,0 +1,45 @@
+# The module defines the following variables:
+# GIT_EXECUTABLE - path to git command line client
+# GIT_FOUND - true if the command line client was found
+# Example usage:
+# find_package(Git)
+# if(GIT_FOUND)
+# message("git found: ${GIT_EXECUTABLE}")
+# endif()
+
+#=============================================================================
+# Copyright 2010 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distributed this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+# Look for 'git' or 'eg' (easy git)
+set(git_names git eg)
+
+# Prefer .cmd variants on Windows unless running in a Makefile
+# in the MSYS shell.
+if(WIN32)
+ if(NOT CMAKE_GENERATOR MATCHES "MSYS")
+ set(git_names git.cmd git eg.cmd eg)
+ endif()
+endif()
+
+find_program(GIT_EXECUTABLE
+ NAMES ${git_names}
+ DOC "git command line client")
+
+mark_as_advanced(GIT_EXECUTABLE)
+
+# Handle the QUIETLY and REQUIRED arguments and set GIT_FOUND to TRUE if
+# all listed variables are TRUE
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Git DEFAULT_MSG GIT_EXECUTABLE)
+
diff --git a/protocols/Telegram/tgl/libevent/cmake/LibeventConfig.cmake.in b/protocols/Telegram/tgl/libevent/cmake/LibeventConfig.cmake.in
new file mode 100644
index 0000000000..b28cacb5fb
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/cmake/LibeventConfig.cmake.in
@@ -0,0 +1,17 @@
+# - Config file for the Libevent package
+# It defines the following variables
+# LIBEVENT_INCLUDE_DIRS - include directories for FooBar
+# LIBEVENT_LIBRARIES - libraries to link against
+
+# Get the path of the current file.
+get_filename_component(LIBEVENT_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
+
+# Set the include directories.
+set(LIBEVENT_INCLUDE_DIRS "@EVENT_INSTALL_INCLUDE_DIR@")
+
+# Include the project Targets file, this contains definitions for IMPORTED targets.
+include(${LIBEVENT_CMAKE_DIR}/LibeventTargets.cmake)
+
+# IMPORTED targets from LibeventTargets.cmake
+set(LIBEVENT_LIBRARIES event event_core event_extra)
+
diff --git a/protocols/Telegram/tgl/libevent/cmake/LibeventConfigBuildTree.cmake.in b/protocols/Telegram/tgl/libevent/cmake/LibeventConfigBuildTree.cmake.in
new file mode 100644
index 0000000000..02edef32fc
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/cmake/LibeventConfigBuildTree.cmake.in
@@ -0,0 +1,17 @@
+# - Config file for the Libevent package
+# It defines the following variables
+# LIBEVENT_INCLUDE_DIRS - include directories for FooBar
+# LIBEVENT_LIBRARIES - libraries to link against
+
+# Get the path of the current file.
+get_filename_component(LIBEVENT_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
+
+# Set the include directories.
+set(LIBEVENT_INCLUDE_DIRS "@EVENT__INCLUDE_DIRS@")
+
+# Include the project Targets file, this contains definitions for IMPORTED targets.
+include(${LIBEVENT_CMAKE_DIR}/LibeventTargets.cmake)
+
+# IMPORTED targets from LibeventTargets.cmake
+set(LIBEVENT_LIBRARIES event event_core event_extra)
+
diff --git a/protocols/Telegram/tgl/libevent/cmake/LibeventConfigVersion.cmake.in b/protocols/Telegram/tgl/libevent/cmake/LibeventConfigVersion.cmake.in
new file mode 100644
index 0000000000..56371a8fee
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/cmake/LibeventConfigVersion.cmake.in
@@ -0,0 +1,11 @@
+set(PACKAGE_VERSION "@EVENT_PACKAGE_VERSION@")
+
+# Check whether the requested PACKAGE_FIND_VERSION is compatible
+if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
+else()
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
+ if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
+ set(PACKAGE_VERSION_EXACT TRUE)
+ endif()
+endif()
diff --git a/protocols/Telegram/tgl/libevent/cmake/VersionViaGit.cmake b/protocols/Telegram/tgl/libevent/cmake/VersionViaGit.cmake
new file mode 100644
index 0000000000..f183a64713
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/cmake/VersionViaGit.cmake
@@ -0,0 +1,53 @@
+# This module defines the following variables utilizing
+# git to determine the parent tag. And if found the macro
+# will attempt to parse them in the github tag fomat
+#
+# Usful for auto-versionin in ou CMakeLists
+#
+# EVENT_GIT___VERSION_FOUND - Version variables foud
+# EVENT_GIT___VERSION_MAJOR - Major version.
+# EVENT_GIT___VERSION_MINOR - Minor version
+# EVENT_GIT___VERSION_STAGE - Stage version
+#
+# Example usage:
+#
+# event_fuzzy_version_from_git()
+# if (EVENT_GIT___VERSION_FOUND)
+# message("Libvent major=${EVENT_GIT___VERSION_MAJOR}")
+# message(" minor=${EVENT_GIT___VERSION_MINOR}")
+# message(" patch=${EVENT_GIT___VERSION_PATCH}")
+# message(" stage=${EVENT_GIT___VERSION_STAGE}")
+# endif()
+
+include(FindGit)
+
+macro(event_fuzzy_version_from_git)
+ set(EVENT_GIT___VERSION_FOUND FALSE)
+
+ # set our defaults.
+ set(EVENT_GIT___VERSION_MAJOR 2)
+ set(EVENT_GIT___VERSION_MINOR 1)
+ set(EVENT_GIT___VERSION_PATCH 5)
+ set(EVENT_GIT___VERSION_STAGE "beta")
+
+ find_package(Git)
+
+ if (GIT_FOUND)
+ execute_process(
+ COMMAND
+ ${GIT_EXECUTABLE} describe --abbrev=0
+ WORKING_DIRECTORY
+ ${PROJECT_SOURCE_DIR}
+ RESULT_VARIABLE
+ GITRET
+ OUTPUT_VARIABLE
+ GITVERSION)
+
+ if (GITRET EQUAL 0)
+ string(REGEX REPLACE "^release-([0-9]+)\\.([0-9]+)\\.([0-9]+)-(.*)" "\\1" EVENT_GIT___VERSION_MAJOR ${GITVERSION})
+ string(REGEX REPLACE "^release-([0-9]+)\\.([0-9]+)\\.([0-9]+)-(.*)" "\\2" EVENT_GIT___VERSION_MINOR ${GITVERSION})
+ string(REGEX REPLACE "^release-([0-9]+)\\.([0-9]+)\\.([0-9]+)-(.*)" "\\3" EVENT_GIT___VERSION_PATCH ${GITVERSION})
+ string(REGEX REPLACE "^release-([0-9]+)\\.([0-9]+)\\.([0-9]+)-([aA-zZ]+)" "\\4" EVENT_GIT___VERSION_STAGE ${GITVERSION})
+ endif()
+ endif()
+endmacro()
diff --git a/protocols/Telegram/tgl/libevent/compat/sys/queue.h b/protocols/Telegram/tgl/libevent/compat/sys/queue.h
new file mode 100644
index 0000000000..c387bdcf50
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/compat/sys/queue.h
@@ -0,0 +1,488 @@
+/* $OpenBSD: queue.h,v 1.16 2000/09/07 19:47:59 art Exp $ */
+/* $NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $ */
+
+/*
+ * Copyright (c) 1991, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)queue.h 8.5 (Berkeley) 8/20/94
+ */
+
+#ifndef SYS_QUEUE_H__
+#define SYS_QUEUE_H__
+
+/*
+ * This file defines five types of data structures: singly-linked lists,
+ * lists, simple queues, tail queues, and circular queues.
+ *
+ *
+ * A singly-linked list is headed by a single forward pointer. The elements
+ * are singly linked for minimum space and pointer manipulation overhead at
+ * the expense of O(n) removal for arbitrary elements. New elements can be
+ * added to the list after an existing element or at the head of the list.
+ * Elements being removed from the head of the list should use the explicit
+ * macro for this purpose for optimum efficiency. A singly-linked list may
+ * only be traversed in the forward direction. Singly-linked lists are ideal
+ * for applications with large datasets and few or no removals or for
+ * implementing a LIFO queue.
+ *
+ * A list is headed by a single forward pointer (or an array of forward
+ * pointers for a hash table header). The elements are doubly linked
+ * so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before
+ * or after an existing element or at the head of the list. A list
+ * may only be traversed in the forward direction.
+ *
+ * A simple queue is headed by a pair of pointers, one the head of the
+ * list and the other to the tail of the list. The elements are singly
+ * linked to save space, so elements can only be removed from the
+ * head of the list. New elements can be added to the list before or after
+ * an existing element, at the head of the list, or at the end of the
+ * list. A simple queue may only be traversed in the forward direction.
+ *
+ * A tail queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or
+ * after an existing element, at the head of the list, or at the end of
+ * the list. A tail queue may be traversed in either direction.
+ *
+ * A circle queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or after
+ * an existing element, at the head of the list, or at the end of the list.
+ * A circle queue may be traversed in either direction, but has a more
+ * complex end of list detection.
+ *
+ * For details on the use of these macros, see the queue(3) manual page.
+ */
+
+/*
+ * Singly-linked List definitions.
+ */
+#define SLIST_HEAD(name, type) \
+struct name { \
+ struct type *slh_first; /* first element */ \
+}
+
+#define SLIST_HEAD_INITIALIZER(head) \
+ { NULL }
+
+#ifndef _WIN32
+#define SLIST_ENTRY(type) \
+struct { \
+ struct type *sle_next; /* next element */ \
+}
+#endif
+
+/*
+ * Singly-linked List access methods.
+ */
+#define SLIST_FIRST(head) ((head)->slh_first)
+#define SLIST_END(head) NULL
+#define SLIST_EMPTY(head) (SLIST_FIRST(head) == SLIST_END(head))
+#define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
+
+#define SLIST_FOREACH(var, head, field) \
+ for((var) = SLIST_FIRST(head); \
+ (var) != SLIST_END(head); \
+ (var) = SLIST_NEXT(var, field))
+
+/*
+ * Singly-linked List functions.
+ */
+#define SLIST_INIT(head) { \
+ SLIST_FIRST(head) = SLIST_END(head); \
+}
+
+#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \
+ (elm)->field.sle_next = (slistelm)->field.sle_next; \
+ (slistelm)->field.sle_next = (elm); \
+} while (0)
+
+#define SLIST_INSERT_HEAD(head, elm, field) do { \
+ (elm)->field.sle_next = (head)->slh_first; \
+ (head)->slh_first = (elm); \
+} while (0)
+
+#define SLIST_REMOVE_HEAD(head, field) do { \
+ (head)->slh_first = (head)->slh_first->field.sle_next; \
+} while (0)
+
+/*
+ * List definitions.
+ */
+#define LIST_HEAD(name, type) \
+struct name { \
+ struct type *lh_first; /* first element */ \
+}
+
+#define LIST_HEAD_INITIALIZER(head) \
+ { NULL }
+
+#define LIST_ENTRY(type) \
+struct { \
+ struct type *le_next; /* next element */ \
+ struct type **le_prev; /* address of previous next element */ \
+}
+
+/*
+ * List access methods
+ */
+#define LIST_FIRST(head) ((head)->lh_first)
+#define LIST_END(head) NULL
+#define LIST_EMPTY(head) (LIST_FIRST(head) == LIST_END(head))
+#define LIST_NEXT(elm, field) ((elm)->field.le_next)
+
+#define LIST_FOREACH(var, head, field) \
+ for((var) = LIST_FIRST(head); \
+ (var)!= LIST_END(head); \
+ (var) = LIST_NEXT(var, field))
+
+/*
+ * List functions.
+ */
+#define LIST_INIT(head) do { \
+ LIST_FIRST(head) = LIST_END(head); \
+} while (0)
+
+#define LIST_INSERT_AFTER(listelm, elm, field) do { \
+ if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \
+ (listelm)->field.le_next->field.le_prev = \
+ &(elm)->field.le_next; \
+ (listelm)->field.le_next = (elm); \
+ (elm)->field.le_prev = &(listelm)->field.le_next; \
+} while (0)
+
+#define LIST_INSERT_BEFORE(listelm, elm, field) do { \
+ (elm)->field.le_prev = (listelm)->field.le_prev; \
+ (elm)->field.le_next = (listelm); \
+ *(listelm)->field.le_prev = (elm); \
+ (listelm)->field.le_prev = &(elm)->field.le_next; \
+} while (0)
+
+#define LIST_INSERT_HEAD(head, elm, field) do { \
+ if (((elm)->field.le_next = (head)->lh_first) != NULL) \
+ (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
+ (head)->lh_first = (elm); \
+ (elm)->field.le_prev = &(head)->lh_first; \
+} while (0)
+
+#define LIST_REMOVE(elm, field) do { \
+ if ((elm)->field.le_next != NULL) \
+ (elm)->field.le_next->field.le_prev = \
+ (elm)->field.le_prev; \
+ *(elm)->field.le_prev = (elm)->field.le_next; \
+} while (0)
+
+#define LIST_REPLACE(elm, elm2, field) do { \
+ if (((elm2)->field.le_next = (elm)->field.le_next) != NULL) \
+ (elm2)->field.le_next->field.le_prev = \
+ &(elm2)->field.le_next; \
+ (elm2)->field.le_prev = (elm)->field.le_prev; \
+ *(elm2)->field.le_prev = (elm2); \
+} while (0)
+
+/*
+ * Simple queue definitions.
+ */
+#define SIMPLEQ_HEAD(name, type) \
+struct name { \
+ struct type *sqh_first; /* first element */ \
+ struct type **sqh_last; /* addr of last next element */ \
+}
+
+#define SIMPLEQ_HEAD_INITIALIZER(head) \
+ { NULL, &(head).sqh_first }
+
+#define SIMPLEQ_ENTRY(type) \
+struct { \
+ struct type *sqe_next; /* next element */ \
+}
+
+/*
+ * Simple queue access methods.
+ */
+#define SIMPLEQ_FIRST(head) ((head)->sqh_first)
+#define SIMPLEQ_END(head) NULL
+#define SIMPLEQ_EMPTY(head) (SIMPLEQ_FIRST(head) == SIMPLEQ_END(head))
+#define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next)
+
+#define SIMPLEQ_FOREACH(var, head, field) \
+ for((var) = SIMPLEQ_FIRST(head); \
+ (var) != SIMPLEQ_END(head); \
+ (var) = SIMPLEQ_NEXT(var, field))
+
+/*
+ * Simple queue functions.
+ */
+#define SIMPLEQ_INIT(head) do { \
+ (head)->sqh_first = NULL; \
+ (head)->sqh_last = &(head)->sqh_first; \
+} while (0)
+
+#define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \
+ if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \
+ (head)->sqh_last = &(elm)->field.sqe_next; \
+ (head)->sqh_first = (elm); \
+} while (0)
+
+#define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \
+ (elm)->field.sqe_next = NULL; \
+ *(head)->sqh_last = (elm); \
+ (head)->sqh_last = &(elm)->field.sqe_next; \
+} while (0)
+
+#define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\
+ (head)->sqh_last = &(elm)->field.sqe_next; \
+ (listelm)->field.sqe_next = (elm); \
+} while (0)
+
+#define SIMPLEQ_REMOVE_HEAD(head, elm, field) do { \
+ if (((head)->sqh_first = (elm)->field.sqe_next) == NULL) \
+ (head)->sqh_last = &(head)->sqh_first; \
+} while (0)
+
+/*
+ * Tail queue definitions.
+ */
+#define TAILQ_HEAD(name, type) \
+struct name { \
+ struct type *tqh_first; /* first element */ \
+ struct type **tqh_last; /* addr of last next element */ \
+}
+
+#define TAILQ_HEAD_INITIALIZER(head) \
+ { NULL, &(head).tqh_first }
+
+#define TAILQ_ENTRY(type) \
+struct { \
+ struct type *tqe_next; /* next element */ \
+ struct type **tqe_prev; /* address of previous next element */ \
+}
+
+/*
+ * tail queue access methods
+ */
+#define TAILQ_FIRST(head) ((head)->tqh_first)
+#define TAILQ_END(head) NULL
+#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
+#define TAILQ_LAST(head, headname) \
+ (*(((struct headname *)((head)->tqh_last))->tqh_last))
+/* XXX */
+#define TAILQ_PREV(elm, headname, field) \
+ (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
+#define TAILQ_EMPTY(head) \
+ (TAILQ_FIRST(head) == TAILQ_END(head))
+
+#define TAILQ_FOREACH(var, head, field) \
+ for((var) = TAILQ_FIRST(head); \
+ (var) != TAILQ_END(head); \
+ (var) = TAILQ_NEXT(var, field))
+
+#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
+ for((var) = TAILQ_LAST(head, headname); \
+ (var) != TAILQ_END(head); \
+ (var) = TAILQ_PREV(var, headname, field))
+
+/*
+ * Tail queue functions.
+ */
+#define TAILQ_INIT(head) do { \
+ (head)->tqh_first = NULL; \
+ (head)->tqh_last = &(head)->tqh_first; \
+} while (0)
+
+#define TAILQ_INSERT_HEAD(head, elm, field) do { \
+ if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
+ (head)->tqh_first->field.tqe_prev = \
+ &(elm)->field.tqe_next; \
+ else \
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+ (head)->tqh_first = (elm); \
+ (elm)->field.tqe_prev = &(head)->tqh_first; \
+} while (0)
+
+#define TAILQ_INSERT_TAIL(head, elm, field) do { \
+ (elm)->field.tqe_next = NULL; \
+ (elm)->field.tqe_prev = (head)->tqh_last; \
+ *(head)->tqh_last = (elm); \
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+} while (0)
+
+#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
+ (elm)->field.tqe_next->field.tqe_prev = \
+ &(elm)->field.tqe_next; \
+ else \
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+ (listelm)->field.tqe_next = (elm); \
+ (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
+} while (0)
+
+#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
+ (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
+ (elm)->field.tqe_next = (listelm); \
+ *(listelm)->field.tqe_prev = (elm); \
+ (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
+} while (0)
+
+#define TAILQ_REMOVE(head, elm, field) do { \
+ if (((elm)->field.tqe_next) != NULL) \
+ (elm)->field.tqe_next->field.tqe_prev = \
+ (elm)->field.tqe_prev; \
+ else \
+ (head)->tqh_last = (elm)->field.tqe_prev; \
+ *(elm)->field.tqe_prev = (elm)->field.tqe_next; \
+} while (0)
+
+#define TAILQ_REPLACE(head, elm, elm2, field) do { \
+ if (((elm2)->field.tqe_next = (elm)->field.tqe_next) != NULL) \
+ (elm2)->field.tqe_next->field.tqe_prev = \
+ &(elm2)->field.tqe_next; \
+ else \
+ (head)->tqh_last = &(elm2)->field.tqe_next; \
+ (elm2)->field.tqe_prev = (elm)->field.tqe_prev; \
+ *(elm2)->field.tqe_prev = (elm2); \
+} while (0)
+
+/*
+ * Circular queue definitions.
+ */
+#define CIRCLEQ_HEAD(name, type) \
+struct name { \
+ struct type *cqh_first; /* first element */ \
+ struct type *cqh_last; /* last element */ \
+}
+
+#define CIRCLEQ_HEAD_INITIALIZER(head) \
+ { CIRCLEQ_END(&head), CIRCLEQ_END(&head) }
+
+#define CIRCLEQ_ENTRY(type) \
+struct { \
+ struct type *cqe_next; /* next element */ \
+ struct type *cqe_prev; /* previous element */ \
+}
+
+/*
+ * Circular queue access methods
+ */
+#define CIRCLEQ_FIRST(head) ((head)->cqh_first)
+#define CIRCLEQ_LAST(head) ((head)->cqh_last)
+#define CIRCLEQ_END(head) ((void *)(head))
+#define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next)
+#define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev)
+#define CIRCLEQ_EMPTY(head) \
+ (CIRCLEQ_FIRST(head) == CIRCLEQ_END(head))
+
+#define CIRCLEQ_FOREACH(var, head, field) \
+ for((var) = CIRCLEQ_FIRST(head); \
+ (var) != CIRCLEQ_END(head); \
+ (var) = CIRCLEQ_NEXT(var, field))
+
+#define CIRCLEQ_FOREACH_REVERSE(var, head, field) \
+ for((var) = CIRCLEQ_LAST(head); \
+ (var) != CIRCLEQ_END(head); \
+ (var) = CIRCLEQ_PREV(var, field))
+
+/*
+ * Circular queue functions.
+ */
+#define CIRCLEQ_INIT(head) do { \
+ (head)->cqh_first = CIRCLEQ_END(head); \
+ (head)->cqh_last = CIRCLEQ_END(head); \
+} while (0)
+
+#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ (elm)->field.cqe_next = (listelm)->field.cqe_next; \
+ (elm)->field.cqe_prev = (listelm); \
+ if ((listelm)->field.cqe_next == CIRCLEQ_END(head)) \
+ (head)->cqh_last = (elm); \
+ else \
+ (listelm)->field.cqe_next->field.cqe_prev = (elm); \
+ (listelm)->field.cqe_next = (elm); \
+} while (0)
+
+#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \
+ (elm)->field.cqe_next = (listelm); \
+ (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
+ if ((listelm)->field.cqe_prev == CIRCLEQ_END(head)) \
+ (head)->cqh_first = (elm); \
+ else \
+ (listelm)->field.cqe_prev->field.cqe_next = (elm); \
+ (listelm)->field.cqe_prev = (elm); \
+} while (0)
+
+#define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \
+ (elm)->field.cqe_next = (head)->cqh_first; \
+ (elm)->field.cqe_prev = CIRCLEQ_END(head); \
+ if ((head)->cqh_last == CIRCLEQ_END(head)) \
+ (head)->cqh_last = (elm); \
+ else \
+ (head)->cqh_first->field.cqe_prev = (elm); \
+ (head)->cqh_first = (elm); \
+} while (0)
+
+#define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \
+ (elm)->field.cqe_next = CIRCLEQ_END(head); \
+ (elm)->field.cqe_prev = (head)->cqh_last; \
+ if ((head)->cqh_first == CIRCLEQ_END(head)) \
+ (head)->cqh_first = (elm); \
+ else \
+ (head)->cqh_last->field.cqe_next = (elm); \
+ (head)->cqh_last = (elm); \
+} while (0)
+
+#define CIRCLEQ_REMOVE(head, elm, field) do { \
+ if ((elm)->field.cqe_next == CIRCLEQ_END(head)) \
+ (head)->cqh_last = (elm)->field.cqe_prev; \
+ else \
+ (elm)->field.cqe_next->field.cqe_prev = \
+ (elm)->field.cqe_prev; \
+ if ((elm)->field.cqe_prev == CIRCLEQ_END(head)) \
+ (head)->cqh_first = (elm)->field.cqe_next; \
+ else \
+ (elm)->field.cqe_prev->field.cqe_next = \
+ (elm)->field.cqe_next; \
+} while (0)
+
+#define CIRCLEQ_REPLACE(head, elm, elm2, field) do { \
+ if (((elm2)->field.cqe_next = (elm)->field.cqe_next) == \
+ CIRCLEQ_END(head)) \
+ (head).cqh_last = (elm2); \
+ else \
+ (elm2)->field.cqe_next->field.cqe_prev = (elm2); \
+ if (((elm2)->field.cqe_prev = (elm)->field.cqe_prev) == \
+ CIRCLEQ_END(head)) \
+ (head).cqh_first = (elm2); \
+ else \
+ (elm2)->field.cqe_prev->field.cqe_next = (elm2); \
+} while (0)
+
+#endif /* !SYS_QUEUE_H__ */
diff --git a/protocols/Telegram/tgl/libevent/configure.ac b/protocols/Telegram/tgl/libevent/configure.ac
new file mode 100644
index 0000000000..6a669fb701
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/configure.ac
@@ -0,0 +1,919 @@
+dnl Copyright 2000-2007 Niels Provos
+dnl Copyright 2007-2012 Niels Provos and Nick Mathewson
+dnl
+dnl See LICENSE for copying information.
+dnl
+dnl Original version Dug Song <dugsong@monkey.org>
+
+AC_INIT(libevent,2.1.5-beta)
+AC_PREREQ(2.59)
+AC_CONFIG_SRCDIR(event.c)
+
+AC_CONFIG_MACRO_DIR([m4])
+AM_INIT_AUTOMAKE
+dnl AM_SILENT_RULES req. automake 1.11. [no] defaults V=1
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+AC_CONFIG_HEADERS(config.h evconfig-private.h:evconfig-private.h.in)
+AC_DEFINE(NUMERIC_VERSION, 0x02010500, [Numeric representation of the version])
+
+dnl Initialize prefix.
+if test "$prefix" = "NONE"; then
+ prefix="/usr/local"
+fi
+
+dnl Try and get a full POSIX environment on obscure systems
+ifdef([AC_USE_SYSTEM_EXTENSIONS], [
+AC_USE_SYSTEM_EXTENSIONS
+], [
+AC_AIX
+AC_GNU_SOURCE
+AC_MINIX
+])
+
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
+dnl the 'build' machine is where we run configure and compile
+dnl the 'host' machine is where the resulting stuff runs.
+
+#case "$host_os" in
+#
+# osf5*)
+# CFLAGS="$CFLAGS -D_OSF_SOURCE"
+# ;;
+#esac
+
+dnl Checks for programs.
+AM_PROG_CC_C_O
+AC_PROG_INSTALL
+AC_PROG_LN_S
+# AC_PROG_MKDIR_P - $(MKDIR_P) should be defined by AM_INIT_AUTOMAKE
+
+# AC_PROG_SED is only available in Autoconf >= 2.59b; workaround for older
+# versions
+ifdef([AC_PROG_SED], [AC_PROG_SED], [
+AC_CHECK_PROGS(SED, [gsed sed])
+])
+
+AC_PROG_GCC_TRADITIONAL
+
+# We need to test for at least gcc 2.95 here, because older versions don't
+# have -fno-strict-aliasing
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
+#if !defined(__GNUC__) || (__GNUC__ < 2) || (__GNUC__ == 2 && __GNUC_MINOR__ < 95)
+#error
+#endif])], have_gcc295=yes, have_gcc295=no)
+
+if test "$GCC" = "yes" ; then
+ # Enable many gcc warnings by default...
+ CFLAGS="$CFLAGS -Wall"
+ # And disable the strict-aliasing optimization, since it breaks
+ # our sockaddr-handling code in strange ways.
+ if test x$have_gcc295 = xyes; then
+ CFLAGS="$CFLAGS -fno-strict-aliasing"
+ fi
+fi
+
+# OS X Lion started deprecating the system openssl. Let's just disable
+# all deprecation warnings on OS X.
+case "$host_os" in
+
+ darwin*)
+ CFLAGS="$CFLAGS -Wno-deprecated-declarations"
+ ;;
+esac
+
+AC_ARG_ENABLE(gcc-warnings,
+ AS_HELP_STRING(--disable-gcc-warnings, disable verbose warnings with GCC))
+
+AC_ARG_ENABLE(gcc-hardening,
+ AS_HELP_STRING(--enable-gcc-hardening, enable compiler security checks),
+[if test x$enableval = xyes; then
+ CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector-all"
+ CFLAGS="$CFLAGS -fwrapv -fPIE -Wstack-protector"
+ CFLAGS="$CFLAGS --param ssp-buffer-size=1"
+fi])
+
+AC_ARG_ENABLE(thread-support,
+ AS_HELP_STRING(--disable-thread-support, disable support for threading),
+ [], [enable_thread_support=yes])
+AC_ARG_ENABLE(malloc-replacement,
+ AS_HELP_STRING(--disable-malloc-replacement, disable support for replacing the memory mgt functions),
+ [], [enable_malloc_replacement=yes])
+AC_ARG_ENABLE(openssl,
+ AS_HELP_STRING(--disable-openssl, disable support for openssl encryption),
+ [], [enable_openssl=yes])
+AC_ARG_ENABLE(debug-mode,
+ AS_HELP_STRING(--disable-debug-mode, disable support for running in debug mode),
+ [], [enable_debug_mode=yes])
+AC_ARG_ENABLE([libevent-install],
+ AS_HELP_STRING([--disable-libevent-install, disable installation of libevent]),
+ [], [enable_libevent_install=yes])
+AC_ARG_ENABLE([libevent-regress],
+ AS_HELP_STRING([--disable-libevent-regress, skip regress in make check]),
+ [], [enable_libevent_regress=yes])
+AC_ARG_ENABLE([samples],
+ AS_HELP_STRING([--disable-samples, skip building of sample programs]),
+ [], [enable_samples=yes])
+AC_ARG_ENABLE([function-sections],
+ AS_HELP_STRING([--enable-function-sections, make static library allow smaller binaries with --gc-sections]),
+ [], [enable_function_sections=no])
+AC_ARG_ENABLE([verbose-debug],
+ AS_HELP_STRING([--enable-verbose-debug, verbose debug logging]),
+ [], [enable_verbose_debug=no])
+
+
+AC_PROG_LIBTOOL
+
+dnl Uncomment "AC_DISABLE_SHARED" to make shared libraries not get
+dnl built by default. You can also turn shared libs on and off from
+dnl the command line with --enable-shared and --disable-shared.
+dnl AC_DISABLE_SHARED
+AC_SUBST(LIBTOOL_DEPS)
+
+AM_CONDITIONAL([BUILD_SAMPLES], [test "$enable_samples" = "yes"])
+AM_CONDITIONAL([BUILD_REGRESS], [test "$enable_libevent_regress" = "yes"])
+
+dnl Checks for libraries.
+AC_SEARCH_LIBS([inet_ntoa], [nsl])
+AC_SEARCH_LIBS([socket], [socket])
+AC_SEARCH_LIBS([inet_aton], [resolv])
+AC_SEARCH_LIBS([clock_gettime], [rt])
+AC_SEARCH_LIBS([sendfile], [sendfile])
+
+dnl - check if the macro _WIN32 is defined on this compiler.
+dnl - (this is how we check for a windows compiler)
+AC_MSG_CHECKING(for WIN32)
+AC_TRY_COMPILE(,
+ [
+#ifndef _WIN32
+die horribly
+#endif
+ ],
+ bwin32=true; AC_MSG_RESULT(yes),
+ bwin32=false; AC_MSG_RESULT(no),
+)
+
+dnl - check if the macro __CYGWIN__ is defined on this compiler.
+dnl - (this is how we check for a cygwin version of GCC)
+AC_MSG_CHECKING(for CYGWIN)
+AC_TRY_COMPILE(,
+ [
+#ifndef __CYGWIN__
+die horribly
+#endif
+ ],
+ cygwin=true; AC_MSG_RESULT(yes),
+ cygwin=false; AC_MSG_RESULT(no),
+)
+
+AC_CHECK_HEADERS([zlib.h])
+
+if test "x$ac_cv_header_zlib_h" = "xyes"; then
+dnl Determine if we have zlib for regression tests
+dnl Don't put this one in LIBS
+save_LIBS="$LIBS"
+LIBS=""
+ZLIB_LIBS=""
+have_zlib=no
+AC_SEARCH_LIBS([inflateEnd], [z],
+ [have_zlib=yes
+ ZLIB_LIBS="$LIBS"
+ AC_DEFINE(HAVE_LIBZ, 1, [Define if the system has zlib])])
+LIBS="$save_LIBS"
+AC_SUBST(ZLIB_LIBS)
+fi
+AM_CONDITIONAL(ZLIB_REGRESS, [test "$have_zlib" = "yes"])
+
+dnl See if we have openssl. This doesn't go in LIBS either.
+if test "$bwin32" = true; then
+ EV_LIB_WS32=-lws2_32
+ EV_LIB_GDI=-lgdi32
+else
+ EV_LIB_WS32=
+ EV_LIB_GDI=
+fi
+AC_SUBST(EV_LIB_WS32)
+AC_SUBST(EV_LIB_GDI)
+AC_SUBST(OPENSSL_LIBADD)
+
+AC_SYS_LARGEFILE
+
+LIBEVENT_OPENSSL
+
+dnl Checks for header files.
+AC_CHECK_HEADERS([ \
+ arpa/inet.h \
+ fcntl.h \
+ ifaddrs.h \
+ mach/mach_time.h \
+ netdb.h \
+ netinet/in.h \
+ netinet/in6.h \
+ netinet/tcp.h \
+ poll.h \
+ port.h \
+ stdarg.h \
+ stddef.h \
+ sys/devpoll.h \
+ sys/epoll.h \
+ sys/event.h \
+ sys/eventfd.h \
+ sys/ioctl.h \
+ sys/mman.h \
+ sys/param.h \
+ sys/queue.h \
+ sys/resource.h \
+ sys/select.h \
+ sys/sendfile.h \
+ sys/socket.h \
+ sys/stat.h \
+ sys/time.h \
+ sys/timerfd.h \
+ sys/uio.h \
+ sys/wait.h \
+])
+
+AC_CHECK_HEADERS(sys/sysctl.h, [], [], [
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+])
+if test "x$ac_cv_header_sys_queue_h" = "xyes"; then
+ AC_MSG_CHECKING(for TAILQ_FOREACH in sys/queue.h)
+ AC_EGREP_CPP(yes,
+[
+#include <sys/queue.h>
+#ifdef TAILQ_FOREACH
+ yes
+#endif
+], [AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_TAILQFOREACH, 1,
+ [Define if TAILQ_FOREACH is defined in <sys/queue.h>])],
+ AC_MSG_RESULT(no)
+ )
+fi
+
+if test "x$ac_cv_header_sys_time_h" = "xyes"; then
+ AC_MSG_CHECKING(for timeradd in sys/time.h)
+ AC_EGREP_CPP(yes,
+[
+#include <sys/time.h>
+#ifdef timeradd
+ yes
+#endif
+], [ AC_DEFINE(HAVE_TIMERADD, 1,
+ [Define if timeradd is defined in <sys/time.h>])
+ AC_MSG_RESULT(yes)] ,AC_MSG_RESULT(no)
+)
+fi
+
+if test "x$ac_cv_header_sys_time_h" = "xyes"; then
+ AC_MSG_CHECKING(for timercmp in sys/time.h)
+ AC_EGREP_CPP(yes,
+[
+#include <sys/time.h>
+#ifdef timercmp
+ yes
+#endif
+], [ AC_DEFINE(HAVE_TIMERCMP, 1,
+ [Define if timercmp is defined in <sys/time.h>])
+ AC_MSG_RESULT(yes)] ,AC_MSG_RESULT(no)
+)
+fi
+
+if test "x$ac_cv_header_sys_time_h" = "xyes"; then
+ AC_MSG_CHECKING(for timerclear in sys/time.h)
+ AC_EGREP_CPP(yes,
+[
+#include <sys/time.h>
+#ifdef timerclear
+ yes
+#endif
+], [ AC_DEFINE(HAVE_TIMERCLEAR, 1,
+ [Define if timerclear is defined in <sys/time.h>])
+ AC_MSG_RESULT(yes)] ,AC_MSG_RESULT(no)
+)
+fi
+
+if test "x$ac_cv_header_sys_time_h" = "xyes"; then
+ AC_MSG_CHECKING(for timerisset in sys/time.h)
+ AC_EGREP_CPP(yes,
+[
+#include <sys/time.h>
+#ifdef timerisset
+ yes
+#endif
+], [ AC_DEFINE(HAVE_TIMERISSET, 1,
+ [Define if timerisset is defined in <sys/time.h>])
+ AC_MSG_RESULT(yes)] ,AC_MSG_RESULT(no)
+)
+fi
+
+if test "x$ac_cv_header_sys_sysctl_h" = "xyes"; then
+ AC_CHECK_DECLS([CTL_KERN, KERN_RANDOM, RANDOM_UUID, KERN_ARND], [], [],
+ [[#include <sys/types.h>
+ #include <sys/sysctl.h>]]
+ )
+fi
+
+AM_CONDITIONAL(BUILD_WIN32, test x$bwin32 = xtrue)
+AM_CONDITIONAL(BUILD_CYGWIN, test x$cygwin = xtrue)
+AM_CONDITIONAL(BUILD_WITH_NO_UNDEFINED, test x$bwin32 = xtrue || test x$cygwin = xtrue)
+
+if test x$bwin32 = xtrue; then
+ AC_SEARCH_LIBS([getservbyname],[ws2_32])
+fi
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_C_INLINE
+AC_HEADER_TIME
+
+dnl Checks for library functions.
+AC_CHECK_FUNCS([ \
+ accept4 \
+ arc4random \
+ arc4random_buf \
+ clock_gettime \
+ eventfd \
+ epoll_create1 \
+ fcntl \
+ getegid \
+ geteuid \
+ getifaddrs \
+ getnameinfo \
+ getprotobynumber \
+ gettimeofday \
+ inet_ntop \
+ inet_pton \
+ issetugid \
+ mach_absolute_time \
+ mmap \
+ nanosleep \
+ pipe \
+ pipe2 \
+ putenv \
+ sendfile \
+ setenv \
+ setrlimit \
+ sigaction \
+ signal \
+ splice \
+ strlcpy \
+ strsep \
+ strtok_r \
+ strtoll \
+ sysctl \
+ timerfd_create \
+ umask \
+ unsetenv \
+ usleep \
+ vasprintf \
+ getservbyname \
+])
+AM_CONDITIONAL(STRLCPY_IMPL, [test x"$ac_cv_func_strlcpy" = xno])
+
+AC_CACHE_CHECK(
+ [for getaddrinfo],
+ [libevent_cv_getaddrinfo],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #ifdef HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+ ]],
+ [[
+ getaddrinfo;
+ ]]
+ )],
+ [libevent_cv_getaddrinfo=yes],
+ [libevent_cv_getaddrinfo=no]
+ )]
+)
+if test "$libevent_cv_getaddrinfo" = "yes" ; then
+ AC_DEFINE([HAVE_GETADDRINFO], [1], [Do we have getaddrinfo()?])
+else
+
+# Check for gethostbyname_r in all its glorious incompatible versions.
+# (This is cut-and-pasted from Tor, which based its logic on
+# Python's configure.in.)
+AH_TEMPLATE(HAVE_GETHOSTBYNAME_R,
+ [Define this if you have any gethostbyname_r()])
+
+AC_CHECK_FUNC(gethostbyname_r, [
+ AC_MSG_CHECKING([how many arguments gethostbyname_r() wants])
+ OLD_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+#include <netdb.h>
+ ], [[
+ char *cp1, *cp2;
+ struct hostent *h1, *h2;
+ int i1, i2;
+ (void)gethostbyname_r(cp1,h1,cp2,i1,&h2,&i2);
+ ]])],[
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R)
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R_6_ARG, 1,
+ [Define this if gethostbyname_r takes 6 arguments])
+ AC_MSG_RESULT(6)
+ ], [
+ AC_TRY_COMPILE([
+#include <netdb.h>
+ ], [
+ char *cp1, *cp2;
+ struct hostent *h1;
+ int i1, i2;
+ (void)gethostbyname_r(cp1,h1,cp2,i1,&i2);
+ ], [
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R)
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R_5_ARG, 1,
+ [Define this if gethostbyname_r takes 5 arguments])
+ AC_MSG_RESULT(5)
+ ], [
+ AC_TRY_COMPILE([
+#include <netdb.h>
+ ], [
+ char *cp1;
+ struct hostent *h1;
+ struct hostent_data hd;
+ (void) gethostbyname_r(cp1,h1,&hd);
+ ], [
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R)
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R_3_ARG, 1,
+ [Define this if gethostbyname_r takes 3 arguments])
+ AC_MSG_RESULT(3)
+ ], [
+ AC_MSG_RESULT(0)
+ ])
+ ])
+ ])
+ CFLAGS=$OLD_CFLAGS
+])
+
+fi
+
+AC_MSG_CHECKING(for F_SETFD in fcntl.h)
+AC_EGREP_CPP(yes,
+[
+#define _GNU_SOURCE
+#include <fcntl.h>
+#ifdef F_SETFD
+yes
+#endif
+], [ AC_DEFINE(HAVE_SETFD, 1,
+ [Define if F_SETFD is defined in <fcntl.h>])
+ AC_MSG_RESULT(yes) ], AC_MSG_RESULT(no))
+
+needsignal=no
+haveselect=no
+if test x$bwin32 != xtrue; then
+ AC_CHECK_FUNCS(select, [haveselect=yes], )
+ if test "x$haveselect" = "xyes" ; then
+ needsignal=yes
+ fi
+fi
+AM_CONDITIONAL(SELECT_BACKEND, [test "x$haveselect" = "xyes"])
+
+havepoll=no
+AC_CHECK_FUNCS(poll, [havepoll=yes], )
+if test "x$havepoll" = "xyes" ; then
+ needsignal=yes
+fi
+AM_CONDITIONAL(POLL_BACKEND, [test "x$havepoll" = "xyes"])
+
+havedevpoll=no
+if test "x$ac_cv_header_sys_devpoll_h" = "xyes"; then
+ AC_DEFINE(HAVE_DEVPOLL, 1,
+ [Define if /dev/poll is available])
+fi
+AM_CONDITIONAL(DEVPOLL_BACKEND, [test "x$ac_cv_header_sys_devpoll_h" = "xyes"])
+
+havekqueue=no
+if test "x$ac_cv_header_sys_event_h" = "xyes"; then
+ AC_CHECK_FUNCS(kqueue, [havekqueue=yes], )
+ if test "x$havekqueue" = "xyes" ; then
+ AC_MSG_CHECKING(for working kqueue)
+ AC_TRY_RUN(
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/event.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+int
+main(int argc, char **argv)
+{
+ int kq;
+ int n;
+ int fd[[2]];
+ struct kevent ev;
+ struct timespec ts;
+ char buf[[8000]];
+
+ if (pipe(fd) == -1)
+ exit(1);
+ if (fcntl(fd[[1]], F_SETFL, O_NONBLOCK) == -1)
+ exit(1);
+
+ while ((n = write(fd[[1]], buf, sizeof(buf))) == sizeof(buf))
+ ;
+
+ if ((kq = kqueue()) == -1)
+ exit(1);
+
+ memset(&ev, 0, sizeof(ev));
+ ev.ident = fd[[1]];
+ ev.filter = EVFILT_WRITE;
+ ev.flags = EV_ADD | EV_ENABLE;
+ n = kevent(kq, &ev, 1, NULL, 0, NULL);
+ if (n == -1)
+ exit(1);
+
+ read(fd[[0]], buf, sizeof(buf));
+
+ ts.tv_sec = 0;
+ ts.tv_nsec = 0;
+ n = kevent(kq, NULL, 0, &ev, 1, &ts);
+ if (n == -1 || n == 0)
+ exit(1);
+
+ exit(0);
+}, [AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_WORKING_KQUEUE, 1,
+ [Define if kqueue works correctly with pipes])
+ havekqueue=yes
+ ], AC_MSG_RESULT(no), AC_MSG_RESULT(no))
+ fi
+fi
+AM_CONDITIONAL(KQUEUE_BACKEND, [test "x$havekqueue" = "xyes"])
+
+haveepollsyscall=no
+haveepoll=no
+AC_CHECK_FUNCS(epoll_ctl, [haveepoll=yes], )
+if test "x$haveepoll" = "xyes" ; then
+ AC_DEFINE(HAVE_EPOLL, 1,
+ [Define if your system supports the epoll system calls])
+ needsignal=yes
+fi
+if test "x$ac_cv_header_sys_epoll_h" = "xyes"; then
+ if test "x$haveepoll" = "xno" ; then
+ AC_MSG_CHECKING(for epoll system call)
+ AC_TRY_RUN(
+#include <stdint.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <sys/epoll.h>
+#include <unistd.h>
+
+int
+epoll_create(int size)
+{
+ return (syscall(__NR_epoll_create, size));
+}
+
+int
+main(int argc, char **argv)
+{
+ int epfd;
+
+ epfd = epoll_create(256);
+ exit (epfd == -1 ? 1 : 0);
+}, [AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_EPOLL, 1,
+ [Define if your system supports the epoll system calls])
+ needsignal=yes
+ have_epoll=yes
+ AC_LIBOBJ(epoll_sub)
+ ], AC_MSG_RESULT(no), AC_MSG_RESULT(no))
+ fi
+fi
+AM_CONDITIONAL(EPOLL_BACKEND, [test "x$haveepoll" = "xyes"])
+
+haveeventports=no
+AC_CHECK_FUNCS(port_create, [haveeventports=yes], )
+if test "x$haveeventports" = "xyes" ; then
+ AC_DEFINE(HAVE_EVENT_PORTS, 1,
+ [Define if your system supports event ports])
+ needsignal=yes
+fi
+AM_CONDITIONAL(EVPORT_BACKEND, [test "x$haveeventports" = "xyes"])
+
+if test "x$bwin32" = "xtrue"; then
+ needsignal=yes
+fi
+
+AM_CONDITIONAL(SIGNAL_SUPPORT, [test "x$needsignal" = "xyes"])
+
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+AC_TYPE_SSIZE_T
+
+AC_CHECK_TYPES([uint64_t, uint32_t, uint16_t, uint8_t, uintptr_t], , ,
+[#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#elif defined(HAVE_INTTYPES_H)
+#include <inttypes.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif])
+
+AC_CHECK_TYPES([fd_mask], , ,
+[#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif])
+
+AC_CHECK_SIZEOF(long long)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(size_t)
+AC_CHECK_SIZEOF(void *)
+AC_CHECK_SIZEOF(off_t)
+
+AC_CHECK_TYPES([struct in6_addr, struct sockaddr_in6, sa_family_t, struct addrinfo, struct sockaddr_storage], , ,
+[#define _GNU_SOURCE
+#include <sys/types.h>
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef _WIN32
+#define WIN32_WINNT 0x400
+#define _WIN32_WINNT 0x400
+#define WIN32_LEAN_AND_MEAN
+#if defined(_MSC_VER) && (_MSC_VER < 1300)
+#include <winsock.h>
+#else
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+#endif
+])
+AC_CHECK_MEMBERS([struct in6_addr.s6_addr32, struct in6_addr.s6_addr16, struct sockaddr_in.sin_len, struct sockaddr_in6.sin6_len, struct sockaddr_storage.ss_family, struct sockaddr_storage.__ss_family], , ,
+[#include <sys/types.h>
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef _WIN32
+#define WIN32_WINNT 0x400
+#define _WIN32_WINNT 0x400
+#define WIN32_LEAN_AND_MEAN
+#if defined(_MSC_VER) && (_MSC_VER < 1300)
+#include <winsock.h>
+#else
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+#endif
+])
+
+AC_CHECK_TYPES([struct so_linger],
+[#define HAVE_SO_LINGER], ,
+[
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+])
+
+AC_MSG_CHECKING([for socklen_t])
+AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #include <sys/socket.h>],
+ [socklen_t x;],
+ AC_MSG_RESULT([yes]),
+ [AC_MSG_RESULT([no])
+ AC_DEFINE(socklen_t, unsigned int,
+ [Define to unsigned int if you dont have it])]
+)
+
+AC_MSG_CHECKING([whether our compiler supports __func__])
+AC_TRY_COMPILE([],
+ [ const char *cp = __func__; ],
+ AC_MSG_RESULT([yes]),
+ AC_MSG_RESULT([no])
+ AC_MSG_CHECKING([whether our compiler supports __FUNCTION__])
+ AC_TRY_COMPILE([],
+ [ const char *cp = __FUNCTION__; ],
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(__func__, __FUNCTION__,
+ [Define to appropriate substitue if compiler doesnt have __func__]),
+ AC_MSG_RESULT([no])
+ AC_DEFINE(__func__, __FILE__,
+ [Define to appropriate substitue if compiler doesnt have __func__])))
+
+
+# check if we can compile with pthreads
+have_pthreads=no
+if test x$bwin32 != xtrue && test "$enable_thread_support" != "no"; then
+ ACX_PTHREAD([
+ AC_DEFINE(HAVE_PTHREADS, 1,
+ [Define if we have pthreads on this system])
+ have_pthreads=yes])
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ AC_CHECK_SIZEOF(pthread_t, ,
+ [AC_INCLUDES_DEFAULT()
+ #include <pthread.h> ]
+ )
+fi
+AM_CONDITIONAL(PTHREADS, [test "$have_pthreads" != "no" && test "$enable_thread_support" != "no"])
+
+# check if we should compile locking into the library
+if test x$enable_thread_support = xno; then
+ AC_DEFINE(DISABLE_THREAD_SUPPORT, 1,
+ [Define if libevent should not be compiled with thread support])
+fi
+
+# check if we should hard-code the mm functions.
+if test x$enable_malloc_replacement = xno; then
+ AC_DEFINE(DISABLE_MM_REPLACEMENT, 1,
+ [Define if libevent should not allow replacing the mm functions])
+fi
+
+# check if we should hard-code debugging out
+if test x$enable_debug_mode = xno; then
+ AC_DEFINE(DISABLE_DEBUG_MODE, 1,
+ [Define if libevent should build without support for a debug mode])
+fi
+
+# check if we should enable verbose debugging
+if test x$enable_verbose_debug = xyes; then
+ CFLAGS="$CFLAGS -DUSE_DEBUG"
+fi
+
+# check if we have and should use openssl
+AM_CONDITIONAL(OPENSSL, [test "$enable_openssl" != "no" && test "$have_openssl" = "yes"])
+if test "x$enable_openssl" = "xyes"; then
+ AC_SEARCH_LIBS([ERR_remove_thread_state], [crypto],
+ [AC_DEFINE(HAVE_ERR_REMOVE_THREAD_STATE, 1, [Define to 1 if you have ERR_remove_thread_stat().])])
+fi
+
+# Add some more warnings which we use in development but not in the
+# released versions. (Some relevant gcc versions can't handle these.)
+if test x$enable_gcc_warnings != xno && test "$GCC" = "yes"; then
+
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
+#if !defined(__GNUC__) || (__GNUC__ < 4)
+#error
+#endif])], have_gcc4=yes, have_gcc4=no)
+
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
+#if !defined(__GNUC__) || (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 2)
+#error
+#endif])], have_gcc42=yes, have_gcc42=no)
+
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
+#if !defined(__GNUC__) || (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
+#error
+#endif])], have_gcc45=yes, have_gcc45=no)
+
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
+#if !defined(__clang__)
+#error
+#endif])], have_clang=yes, have_clang=no)
+
+ CFLAGS="$CFLAGS -W -Wfloat-equal -Wundef -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wbad-function-cast -Wswitch-enum"
+ if test x$enable_gcc_warnings = xyes; then
+ CFLAGS="$CFLAGS -Werror"
+ fi
+
+ CFLAGS="$CFLAGS -Wno-unused-parameter -Wstrict-aliasing"
+
+ if test x$have_gcc4 = xyes ; then
+ # These warnings break gcc 3.3.5 and work on gcc 4.0.2
+ CFLAGS="$CFLAGS -Winit-self -Wmissing-field-initializers -Wdeclaration-after-statement"
+ #CFLAGS="$CFLAGS -Wold-style-definition"
+ fi
+
+ if test x$have_gcc42 = xyes ; then
+ # These warnings break gcc 4.0.2 and work on gcc 4.2
+ CFLAGS="$CFLAGS -Waddress"
+ fi
+
+ if test x$have_gcc42 = xyes && test x$have_clang = xno; then
+ # These warnings break gcc 4.0.2 and clang, but work on gcc 4.2
+ CFLAGS="$CFLAGS -Wnormalized=id -Woverride-init"
+ fi
+
+ if test x$have_gcc45 = xyes ; then
+ # These warnings work on gcc 4.5
+ CFLAGS="$CFLAGS -Wlogical-op"
+ fi
+
+ if test x$have_clang = xyes; then
+ # Disable the unused-function warnings, because these trigger
+ # for minheap-internal.h related code.
+ CFLAGS="$CFLAGS -Wno-unused-function"
+
+ # clang on macosx emits warnigns for each directory specified which
+ # isn't "used" generating a lot of build noise (typically 3 warnings
+ # per file
+ case "$host_os" in
+ darwin*)
+ CFLAGS="$CFLAGS -Qunused-arguments"
+ ;;
+ esac
+ fi
+
+##This will break the world on some 64-bit architectures
+# CFLAGS="$CFLAGS -Winline"
+
+fi
+
+LIBEVENT_GC_SECTIONS=
+if test "$GCC" = yes && test "$enable_function_sections" = yes ; then
+ AC_CACHE_CHECK(
+ [if linker supports omitting unused code and data],
+ [libevent_cv_gc_sections_runs],
+ [
+ dnl NetBSD will link but likely not run with --gc-sections
+ dnl http://bugs.ntp.org/1844
+ dnl http://gnats.netbsd.org/40401
+ dnl --gc-sections causes attempt to load as linux elf, with
+ dnl wrong syscalls in place. Test a little gauntlet of
+ dnl simple stdio read code checking for errors, expecting
+ dnl enough syscall differences that the NetBSD code will
+ dnl fail even with Linux emulation working as designed.
+ dnl A shorter test could be refined by someone with access
+ dnl to a NetBSD host with Linux emulation working.
+ origCFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Wl,--gc-sections"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <stdlib.h>
+ #include <stdio.h>
+ ]],
+ [[
+ FILE * fpC;
+ char buf[32];
+ size_t cch;
+ int read_success_once;
+
+ fpC = fopen("conftest.c", "r");
+ if (NULL == fpC)
+ exit(1);
+ do {
+ cch = fread(buf, sizeof(buf), 1, fpC);
+ read_success_once |= (0 != cch);
+ } while (0 != cch);
+ if (!read_success_once)
+ exit(2);
+ if (!feof(fpC))
+ exit(3);
+ if (0 != fclose(fpC))
+ exit(4);
+
+ exit(EXIT_SUCCESS);
+ ]]
+ )],
+ [
+ dnl We have to do this invocation manually so that we can
+ dnl get the output of conftest.err to make sure it doesn't
+ dnl mention gc-sections.
+ if test "X$cross_compiling" = "Xyes" || grep gc-sections conftest.err ; then
+ libevent_cv_gc_sections_runs=no
+ else
+ libevent_cv_gc_sections_runs=no
+ ./conftest >/dev/null 2>&1 && libevent_cv_gc_sections_runs=yes
+ fi
+ ],
+ [libevent_cv_gc_sections_runs=no]
+ )
+ CFLAGS="$origCFLAGS"
+ AS_UNSET([origCFLAGS])
+ ]
+ )
+ case "$libevent_cv_gc_sections_runs" in
+ yes)
+ CFLAGS="-ffunction-sections -fdata-sections $CFLAGS"
+ LIBEVENT_GC_SECTIONS="-Wl,--gc-sections"
+ ;;
+ esac
+fi
+AC_SUBST([LIBEVENT_GC_SECTIONS])
+
+AM_CONDITIONAL([INSTALL_LIBEVENT], [test "$enable_libevent_install" = "yes"])
+
+AC_CONFIG_FILES( [libevent.pc libevent_openssl.pc libevent_pthreads.pc] )
+AC_OUTPUT(Makefile)
diff --git a/protocols/Telegram/tgl/libevent/defer-internal.h b/protocols/Telegram/tgl/libevent/defer-internal.h
new file mode 100644
index 0000000000..e3c7d7da5b
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/defer-internal.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef DEFER_INTERNAL_H_INCLUDED_
+#define DEFER_INTERNAL_H_INCLUDED_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#include <sys/queue.h>
+
+struct event_callback;
+typedef void (*deferred_cb_fn)(struct event_callback *, void *);
+
+/**
+ Initialize an empty, non-pending event_callback.
+
+ @param deferred The struct event_callback structure to initialize.
+ @param priority The priority that the callback should run at.
+ @param cb The function to run when the struct event_callback executes.
+ @param arg The function's second argument.
+ */
+void event_deferred_cb_init_(struct event_callback *, ev_uint8_t, deferred_cb_fn, void *);
+/**
+ Change the priority of a non-pending event_callback.
+ */
+void event_deferred_cb_set_priority_(struct event_callback *, ev_uint8_t);
+/**
+ Cancel a struct event_callback if it is currently scheduled in an event_base.
+ */
+void event_deferred_cb_cancel_(struct event_base *, struct event_callback *);
+/**
+ Activate a struct event_callback if it is not currently scheduled in an event_base.
+
+ Return true if it was not previously scheduled.
+ */
+int event_deferred_cb_schedule_(struct event_base *, struct event_callback *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT_INTERNAL_H_INCLUDED_ */
+
diff --git a/protocols/Telegram/tgl/libevent/devpoll.c b/protocols/Telegram/tgl/libevent/devpoll.c
new file mode 100644
index 0000000000..3a2f86d6f1
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/devpoll.c
@@ -0,0 +1,311 @@
+/*
+ * Copyright 2000-2009 Niels Provos <provos@citi.umich.edu>
+ * Copyright 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef EVENT__HAVE_DEVPOLL
+
+#include <sys/types.h>
+#include <sys/resource.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#include <sys/devpoll.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+
+#include "event2/event.h"
+#include "event2/event_struct.h"
+#include "event2/thread.h"
+#include "event-internal.h"
+#include "evsignal-internal.h"
+#include "log-internal.h"
+#include "evmap-internal.h"
+#include "evthread-internal.h"
+
+struct devpollop {
+ struct pollfd *events;
+ int nevents;
+ int dpfd;
+ struct pollfd *changes;
+ int nchanges;
+};
+
+static void *devpoll_init(struct event_base *);
+static int devpoll_add(struct event_base *, int fd, short old, short events, void *);
+static int devpoll_del(struct event_base *, int fd, short old, short events, void *);
+static int devpoll_dispatch(struct event_base *, struct timeval *);
+static void devpoll_dealloc(struct event_base *);
+
+const struct eventop devpollops = {
+ "devpoll",
+ devpoll_init,
+ devpoll_add,
+ devpoll_del,
+ devpoll_dispatch,
+ devpoll_dealloc,
+ 1, /* need reinit */
+ EV_FEATURE_FDS|EV_FEATURE_O1,
+ 0
+};
+
+#define NEVENT 32000
+
+static int
+devpoll_commit(struct devpollop *devpollop)
+{
+ /*
+ * Due to a bug in Solaris, we have to use pwrite with an offset of 0.
+ * Write is limited to 2GB of data, until it will fail.
+ */
+ if (pwrite(devpollop->dpfd, devpollop->changes,
+ sizeof(struct pollfd) * devpollop->nchanges, 0) == -1)
+ return (-1);
+
+ devpollop->nchanges = 0;
+ return (0);
+}
+
+static int
+devpoll_queue(struct devpollop *devpollop, int fd, int events) {
+ struct pollfd *pfd;
+
+ if (devpollop->nchanges >= devpollop->nevents) {
+ /*
+ * Change buffer is full, must commit it to /dev/poll before
+ * adding more
+ */
+ if (devpoll_commit(devpollop) != 0)
+ return (-1);
+ }
+
+ pfd = &devpollop->changes[devpollop->nchanges++];
+ pfd->fd = fd;
+ pfd->events = events;
+ pfd->revents = 0;
+
+ return (0);
+}
+
+static void *
+devpoll_init(struct event_base *base)
+{
+ int dpfd, nfiles = NEVENT;
+ struct rlimit rl;
+ struct devpollop *devpollop;
+
+ if (!(devpollop = mm_calloc(1, sizeof(struct devpollop))))
+ return (NULL);
+
+ if (getrlimit(RLIMIT_NOFILE, &rl) == 0 &&
+ rl.rlim_cur != RLIM_INFINITY)
+ nfiles = rl.rlim_cur;
+
+ /* Initialize the kernel queue */
+ if ((dpfd = evutil_open_closeonexec_("/dev/poll", O_RDWR, 0)) == -1) {
+ event_warn("open: /dev/poll");
+ mm_free(devpollop);
+ return (NULL);
+ }
+
+ devpollop->dpfd = dpfd;
+
+ /* Initialize fields */
+ /* FIXME: allocating 'nfiles' worth of space here can be
+ * expensive and unnecessary. See how epoll.c does it instead. */
+ devpollop->events = mm_calloc(nfiles, sizeof(struct pollfd));
+ if (devpollop->events == NULL) {
+ mm_free(devpollop);
+ close(dpfd);
+ return (NULL);
+ }
+ devpollop->nevents = nfiles;
+
+ devpollop->changes = mm_calloc(nfiles, sizeof(struct pollfd));
+ if (devpollop->changes == NULL) {
+ mm_free(devpollop->events);
+ mm_free(devpollop);
+ close(dpfd);
+ return (NULL);
+ }
+
+ evsig_init_(base);
+
+ return (devpollop);
+}
+
+static int
+devpoll_dispatch(struct event_base *base, struct timeval *tv)
+{
+ struct devpollop *devpollop = base->evbase;
+ struct pollfd *events = devpollop->events;
+ struct dvpoll dvp;
+ int i, res, timeout = -1;
+
+ if (devpollop->nchanges)
+ devpoll_commit(devpollop);
+
+ if (tv != NULL)
+ timeout = tv->tv_sec * 1000 + (tv->tv_usec + 999) / 1000;
+
+ dvp.dp_fds = devpollop->events;
+ dvp.dp_nfds = devpollop->nevents;
+ dvp.dp_timeout = timeout;
+
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+
+ res = ioctl(devpollop->dpfd, DP_POLL, &dvp);
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+
+ if (res == -1) {
+ if (errno != EINTR) {
+ event_warn("ioctl: DP_POLL");
+ return (-1);
+ }
+
+ return (0);
+ }
+
+ event_debug(("%s: devpoll_wait reports %d", __func__, res));
+
+ for (i = 0; i < res; i++) {
+ int which = 0;
+ int what = events[i].revents;
+
+ if (what & POLLHUP)
+ what |= POLLIN | POLLOUT;
+ else if (what & POLLERR)
+ what |= POLLIN | POLLOUT;
+
+ if (what & POLLIN)
+ which |= EV_READ;
+ if (what & POLLOUT)
+ which |= EV_WRITE;
+
+ if (!which)
+ continue;
+
+ /* XXX(niels): not sure if this works for devpoll */
+ evmap_io_active_(base, events[i].fd, which);
+ }
+
+ return (0);
+}
+
+
+static int
+devpoll_add(struct event_base *base, int fd, short old, short events, void *p)
+{
+ struct devpollop *devpollop = base->evbase;
+ int res;
+ (void)p;
+
+ /*
+ * It's not necessary to OR the existing read/write events that we
+ * are currently interested in with the new event we are adding.
+ * The /dev/poll driver ORs any new events with the existing events
+ * that it has cached for the fd.
+ */
+
+ res = 0;
+ if (events & EV_READ)
+ res |= POLLIN;
+ if (events & EV_WRITE)
+ res |= POLLOUT;
+
+ if (devpoll_queue(devpollop, fd, res) != 0)
+ return (-1);
+
+ return (0);
+}
+
+static int
+devpoll_del(struct event_base *base, int fd, short old, short events, void *p)
+{
+ struct devpollop *devpollop = base->evbase;
+ int res;
+ (void)p;
+
+ res = 0;
+ if (events & EV_READ)
+ res |= POLLIN;
+ if (events & EV_WRITE)
+ res |= POLLOUT;
+
+ /*
+ * The only way to remove an fd from the /dev/poll monitored set is
+ * to use POLLREMOVE by itself. This removes ALL events for the fd
+ * provided so if we care about two events and are only removing one
+ * we must re-add the other event after POLLREMOVE.
+ */
+
+ if (devpoll_queue(devpollop, fd, POLLREMOVE) != 0)
+ return (-1);
+
+ if ((res & (POLLIN|POLLOUT)) != (POLLIN|POLLOUT)) {
+ /*
+ * We're not deleting all events, so we must resubmit the
+ * event that we are still interested in if one exists.
+ */
+
+ if ((res & POLLIN) && (old & EV_WRITE)) {
+ /* Deleting read, still care about write */
+ devpoll_queue(devpollop, fd, POLLOUT);
+ } else if ((res & POLLOUT) && (old & EV_READ)) {
+ /* Deleting write, still care about read */
+ devpoll_queue(devpollop, fd, POLLIN);
+ }
+ }
+
+ return (0);
+}
+
+static void
+devpoll_dealloc(struct event_base *base)
+{
+ struct devpollop *devpollop = base->evbase;
+
+ evsig_dealloc_(base);
+ if (devpollop->events)
+ mm_free(devpollop->events);
+ if (devpollop->changes)
+ mm_free(devpollop->changes);
+ if (devpollop->dpfd >= 0)
+ close(devpollop->dpfd);
+
+ memset(devpollop, 0, sizeof(struct devpollop));
+ mm_free(devpollop);
+}
+
+#endif /* EVENT__HAVE_DEVPOLL */
diff --git a/protocols/Telegram/tgl/libevent/epoll.c b/protocols/Telegram/tgl/libevent/epoll.c
new file mode 100644
index 0000000000..bf730b23db
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/epoll.c
@@ -0,0 +1,540 @@
+/*
+ * Copyright 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright 2007-2012 Niels Provos, Nick Mathewson
+ *
+ * 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 "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef EVENT__HAVE_EPOLL
+
+#include <stdint.h>
+#include <sys/types.h>
+#include <sys/resource.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#include <sys/epoll.h>
+#include <signal.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#ifdef EVENT__HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TIMERFD_H
+#include <sys/timerfd.h>
+#endif
+
+#include "event-internal.h"
+#include "evsignal-internal.h"
+#include "event2/thread.h"
+#include "evthread-internal.h"
+#include "log-internal.h"
+#include "evmap-internal.h"
+#include "changelist-internal.h"
+#include "time-internal.h"
+
+/* Since Linux 2.6.17, epoll is able to report about peer half-closed connection
+ using special EPOLLRDHUP flag on a read event.
+*/
+#if !defined(EPOLLRDHUP)
+#define EPOLLRDHUP 0
+#define EARLY_CLOSE_IF_HAVE_RDHUP 0
+#else
+#define EARLY_CLOSE_IF_HAVE_RDHUP EV_FEATURE_EARLY_CLOSE
+#endif
+
+#include "epolltable-internal.h"
+
+#if defined(EVENT__HAVE_SYS_TIMERFD_H) && \
+ defined(EVENT__HAVE_TIMERFD_CREATE) && \
+ defined(HAVE_POSIX_MONOTONIC) && defined(TFD_NONBLOCK) && \
+ defined(TFD_CLOEXEC)
+/* Note that we only use timerfd if TFD_NONBLOCK and TFD_CLOEXEC are available
+ and working. This means that we can't support it on 2.6.25 (where timerfd
+ was introduced) or 2.6.26, since 2.6.27 introduced those flags.
+ */
+#define USING_TIMERFD
+#endif
+
+struct epollop {
+ struct epoll_event *events;
+ int nevents;
+ int epfd;
+#ifdef USING_TIMERFD
+ int timerfd;
+#endif
+};
+
+static void *epoll_init(struct event_base *);
+static int epoll_dispatch(struct event_base *, struct timeval *);
+static void epoll_dealloc(struct event_base *);
+
+static const struct eventop epollops_changelist = {
+ "epoll (with changelist)",
+ epoll_init,
+ event_changelist_add_,
+ event_changelist_del_,
+ epoll_dispatch,
+ epoll_dealloc,
+ 1, /* need reinit */
+ EV_FEATURE_ET|EV_FEATURE_O1| EARLY_CLOSE_IF_HAVE_RDHUP,
+ EVENT_CHANGELIST_FDINFO_SIZE
+};
+
+
+static int epoll_nochangelist_add(struct event_base *base, evutil_socket_t fd,
+ short old, short events, void *p);
+static int epoll_nochangelist_del(struct event_base *base, evutil_socket_t fd,
+ short old, short events, void *p);
+
+const struct eventop epollops = {
+ "epoll",
+ epoll_init,
+ epoll_nochangelist_add,
+ epoll_nochangelist_del,
+ epoll_dispatch,
+ epoll_dealloc,
+ 1, /* need reinit */
+ EV_FEATURE_ET|EV_FEATURE_O1|EV_FEATURE_EARLY_CLOSE,
+ 0
+};
+
+#define INITIAL_NEVENT 32
+#define MAX_NEVENT 4096
+
+/* On Linux kernels at least up to 2.6.24.4, epoll can't handle timeout
+ * values bigger than (LONG_MAX - 999ULL)/HZ. HZ in the wild can be
+ * as big as 1000, and LONG_MAX can be as small as (1<<31)-1, so the
+ * largest number of msec we can support here is 2147482. Let's
+ * round that down by 47 seconds.
+ */
+#define MAX_EPOLL_TIMEOUT_MSEC (35*60*1000)
+
+static void *
+epoll_init(struct event_base *base)
+{
+ int epfd = -1;
+ struct epollop *epollop;
+
+#ifdef EVENT__HAVE_EPOLL_CREATE1
+ /* First, try the shiny new epoll_create1 interface, if we have it. */
+ epfd = epoll_create1(EPOLL_CLOEXEC);
+#endif
+ if (epfd == -1) {
+ /* Initialize the kernel queue using the old interface. (The
+ size field is ignored since 2.6.8.) */
+ if ((epfd = epoll_create(32000)) == -1) {
+ if (errno != ENOSYS)
+ event_warn("epoll_create");
+ return (NULL);
+ }
+ evutil_make_socket_closeonexec(epfd);
+ }
+
+ if (!(epollop = mm_calloc(1, sizeof(struct epollop)))) {
+ close(epfd);
+ return (NULL);
+ }
+
+ epollop->epfd = epfd;
+
+ /* Initialize fields */
+ epollop->events = mm_calloc(INITIAL_NEVENT, sizeof(struct epoll_event));
+ if (epollop->events == NULL) {
+ mm_free(epollop);
+ close(epfd);
+ return (NULL);
+ }
+ epollop->nevents = INITIAL_NEVENT;
+
+ if ((base->flags & EVENT_BASE_FLAG_EPOLL_USE_CHANGELIST) != 0 ||
+ ((base->flags & EVENT_BASE_FLAG_IGNORE_ENV) == 0 &&
+ evutil_getenv_("EVENT_EPOLL_USE_CHANGELIST") != NULL)) {
+
+ base->evsel = &epollops_changelist;
+ }
+
+#ifdef USING_TIMERFD
+ /*
+ The epoll interface ordinarily gives us one-millisecond precision,
+ so on Linux it makes perfect sense to use the CLOCK_MONOTONIC_COARSE
+ timer. But when the user has set the new PRECISE_TIMER flag for an
+ event_base, we can try to use timerfd to give them finer granularity.
+ */
+ if ((base->flags & EVENT_BASE_FLAG_PRECISE_TIMER) &&
+ base->monotonic_timer.monotonic_clock == CLOCK_MONOTONIC) {
+ int fd;
+ fd = epollop->timerfd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK|TFD_CLOEXEC);
+ if (epollop->timerfd >= 0) {
+ struct epoll_event epev;
+ memset(&epev, 0, sizeof(epev));
+ epev.data.fd = epollop->timerfd;
+ epev.events = EPOLLIN;
+ if (epoll_ctl(epollop->epfd, EPOLL_CTL_ADD, fd, &epev) < 0) {
+ event_warn("epoll_ctl(timerfd)");
+ close(fd);
+ epollop->timerfd = -1;
+ }
+ } else {
+ if (errno != EINVAL && errno != ENOSYS) {
+ /* These errors probably mean that we were
+ * compiled with timerfd/TFD_* support, but
+ * we're running on a kernel that lacks those.
+ */
+ event_warn("timerfd_create");
+ }
+ epollop->timerfd = -1;
+ }
+ } else {
+ epollop->timerfd = -1;
+ }
+#endif
+
+ evsig_init_(base);
+
+ return (epollop);
+}
+
+static const char *
+change_to_string(int change)
+{
+ change &= (EV_CHANGE_ADD|EV_CHANGE_DEL);
+ if (change == EV_CHANGE_ADD) {
+ return "add";
+ } else if (change == EV_CHANGE_DEL) {
+ return "del";
+ } else if (change == 0) {
+ return "none";
+ } else {
+ return "???";
+ }
+}
+
+static const char *
+epoll_op_to_string(int op)
+{
+ return op == EPOLL_CTL_ADD?"ADD":
+ op == EPOLL_CTL_DEL?"DEL":
+ op == EPOLL_CTL_MOD?"MOD":
+ "???";
+}
+
+#define PRINT_CHANGES(op, events, ch, status) \
+ "Epoll %s(%d) on fd %d " status ". " \
+ "Old events were %d; " \
+ "read change was %d (%s); " \
+ "write change was %d (%s); " \
+ "close change was %d (%s)", \
+ epoll_op_to_string(op), \
+ events, \
+ ch->fd, \
+ ch->old_events, \
+ ch->read_change, \
+ change_to_string(ch->read_change), \
+ ch->write_change, \
+ change_to_string(ch->write_change), \
+ ch->close_change, \
+ change_to_string(ch->close_change)
+
+static int
+epoll_apply_one_change(struct event_base *base,
+ struct epollop *epollop,
+ const struct event_change *ch)
+{
+ struct epoll_event epev;
+ int op, events = 0;
+ int idx;
+
+ idx = EPOLL_OP_TABLE_INDEX(ch);
+ op = epoll_op_table[idx].op;
+ events = epoll_op_table[idx].events;
+
+ if (!events) {
+ EVUTIL_ASSERT(op == 0);
+ return 0;
+ }
+
+ if ((ch->read_change|ch->write_change) & EV_CHANGE_ET)
+ events |= EPOLLET;
+
+ memset(&epev, 0, sizeof(epev));
+ epev.data.fd = ch->fd;
+ epev.events = events;
+ if (epoll_ctl(epollop->epfd, op, ch->fd, &epev) == 0) {
+ event_debug((PRINT_CHANGES(op, epev.events, ch, "okay")));
+ return 0;
+ }
+
+ switch (op) {
+ case EPOLL_CTL_MOD:
+ if (errno == ENOENT) {
+ /* If a MOD operation fails with ENOENT, the
+ * fd was probably closed and re-opened. We
+ * should retry the operation as an ADD.
+ */
+ if (epoll_ctl(epollop->epfd, EPOLL_CTL_ADD, ch->fd, &epev) == -1) {
+ event_warn("Epoll MOD(%d) on %d retried as ADD; that failed too",
+ (int)epev.events, ch->fd);
+ return -1;
+ } else {
+ event_debug(("Epoll MOD(%d) on %d retried as ADD; succeeded.",
+ (int)epev.events,
+ ch->fd));
+ return 0;
+ }
+ }
+ break;
+ case EPOLL_CTL_ADD:
+ if (errno == EEXIST) {
+ /* If an ADD operation fails with EEXIST,
+ * either the operation was redundant (as with a
+ * precautionary add), or we ran into a fun
+ * kernel bug where using dup*() to duplicate the
+ * same file into the same fd gives you the same epitem
+ * rather than a fresh one. For the second case,
+ * we must retry with MOD. */
+ if (epoll_ctl(epollop->epfd, EPOLL_CTL_MOD, ch->fd, &epev) == -1) {
+ event_warn("Epoll ADD(%d) on %d retried as MOD; that failed too",
+ (int)epev.events, ch->fd);
+ return -1;
+ } else {
+ event_debug(("Epoll ADD(%d) on %d retried as MOD; succeeded.",
+ (int)epev.events,
+ ch->fd));
+ return 0;
+ }
+ }
+ break;
+ case EPOLL_CTL_DEL:
+ if (errno == ENOENT || errno == EBADF || errno == EPERM) {
+ /* If a delete fails with one of these errors,
+ * that's fine too: we closed the fd before we
+ * got around to calling epoll_dispatch. */
+ event_debug(("Epoll DEL(%d) on fd %d gave %s: DEL was unnecessary.",
+ (int)epev.events,
+ ch->fd,
+ strerror(errno)));
+ return 0;
+ }
+ break;
+ default:
+ break;
+ }
+
+ event_warn(PRINT_CHANGES(op, epev.events, ch, "failed"));
+ return -1;
+}
+
+static int
+epoll_apply_changes(struct event_base *base)
+{
+ struct event_changelist *changelist = &base->changelist;
+ struct epollop *epollop = base->evbase;
+ struct event_change *ch;
+
+ int r = 0;
+ int i;
+
+ for (i = 0; i < changelist->n_changes; ++i) {
+ ch = &changelist->changes[i];
+ if (epoll_apply_one_change(base, epollop, ch) < 0)
+ r = -1;
+ }
+
+ return (r);
+}
+
+static int
+epoll_nochangelist_add(struct event_base *base, evutil_socket_t fd,
+ short old, short events, void *p)
+{
+ struct event_change ch;
+ ch.fd = fd;
+ ch.old_events = old;
+ ch.read_change = ch.write_change = ch.close_change = 0;
+ if (events & EV_WRITE)
+ ch.write_change = EV_CHANGE_ADD |
+ (events & EV_ET);
+ if (events & EV_READ)
+ ch.read_change = EV_CHANGE_ADD |
+ (events & EV_ET);
+ if (events & EV_CLOSED)
+ ch.close_change = EV_CHANGE_ADD |
+ (events & EV_ET);
+
+ return epoll_apply_one_change(base, base->evbase, &ch);
+}
+
+static int
+epoll_nochangelist_del(struct event_base *base, evutil_socket_t fd,
+ short old, short events, void *p)
+{
+ struct event_change ch;
+ ch.fd = fd;
+ ch.old_events = old;
+ ch.read_change = ch.write_change = ch.close_change = 0;
+ if (events & EV_WRITE)
+ ch.write_change = EV_CHANGE_DEL;
+ if (events & EV_READ)
+ ch.read_change = EV_CHANGE_DEL;
+ if (events & EV_CLOSED)
+ ch.close_change = EV_CHANGE_DEL;
+
+ return epoll_apply_one_change(base, base->evbase, &ch);
+}
+
+static int
+epoll_dispatch(struct event_base *base, struct timeval *tv)
+{
+ struct epollop *epollop = base->evbase;
+ struct epoll_event *events = epollop->events;
+ int i, res;
+ long timeout = -1;
+
+#ifdef USING_TIMERFD
+ if (epollop->timerfd >= 0) {
+ struct itimerspec is;
+ is.it_interval.tv_sec = 0;
+ is.it_interval.tv_nsec = 0;
+ if (tv == NULL) {
+ /* No timeout; disarm the timer. */
+ is.it_value.tv_sec = 0;
+ is.it_value.tv_nsec = 0;
+ } else {
+ if (tv->tv_sec == 0 && tv->tv_usec == 0) {
+ /* we need to exit immediately; timerfd can't
+ * do that. */
+ timeout = 0;
+ }
+ is.it_value.tv_sec = tv->tv_sec;
+ is.it_value.tv_nsec = tv->tv_usec * 1000;
+ }
+ /* TODO: we could avoid unnecessary syscalls here by only
+ calling timerfd_settime when the top timeout changes, or
+ when we're called with a different timeval.
+ */
+ if (timerfd_settime(epollop->timerfd, 0, &is, NULL) < 0) {
+ event_warn("timerfd_settime");
+ }
+ } else
+#endif
+ if (tv != NULL) {
+ timeout = evutil_tv_to_msec_(tv);
+ if (timeout < 0 || timeout > MAX_EPOLL_TIMEOUT_MSEC) {
+ /* Linux kernels can wait forever if the timeout is
+ * too big; see comment on MAX_EPOLL_TIMEOUT_MSEC. */
+ timeout = MAX_EPOLL_TIMEOUT_MSEC;
+ }
+ }
+
+ epoll_apply_changes(base);
+ event_changelist_remove_all_(&base->changelist, base);
+
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+
+ res = epoll_wait(epollop->epfd, events, epollop->nevents, timeout);
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+
+ if (res == -1) {
+ if (errno != EINTR) {
+ event_warn("epoll_wait");
+ return (-1);
+ }
+
+ return (0);
+ }
+
+ event_debug(("%s: epoll_wait reports %d", __func__, res));
+ EVUTIL_ASSERT(res <= epollop->nevents);
+
+ for (i = 0; i < res; i++) {
+ int what = events[i].events;
+ short ev = 0;
+#ifdef USING_TIMERFD
+ if (events[i].data.fd == epollop->timerfd)
+ continue;
+#endif
+
+ if (what & (EPOLLHUP|EPOLLERR)) {
+ ev = EV_READ | EV_WRITE;
+ } else {
+ if (what & EPOLLIN)
+ ev |= EV_READ;
+ if (what & EPOLLOUT)
+ ev |= EV_WRITE;
+ if (what & EPOLLRDHUP)
+ ev |= EV_CLOSED;
+ }
+
+ if (!ev)
+ continue;
+
+ evmap_io_active_(base, events[i].data.fd, ev | EV_ET);
+ }
+
+ if (res == epollop->nevents && epollop->nevents < MAX_NEVENT) {
+ /* We used all of the event space this time. We should
+ be ready for more events next time. */
+ int new_nevents = epollop->nevents * 2;
+ struct epoll_event *new_events;
+
+ new_events = mm_realloc(epollop->events,
+ new_nevents * sizeof(struct epoll_event));
+ if (new_events) {
+ epollop->events = new_events;
+ epollop->nevents = new_nevents;
+ }
+ }
+
+ return (0);
+}
+
+
+static void
+epoll_dealloc(struct event_base *base)
+{
+ struct epollop *epollop = base->evbase;
+
+ evsig_dealloc_(base);
+ if (epollop->events)
+ mm_free(epollop->events);
+ if (epollop->epfd >= 0)
+ close(epollop->epfd);
+#ifdef USING_TIMERFD
+ if (epollop->timerfd >= 0)
+ close(epollop->timerfd);
+#endif
+
+ memset(epollop, 0, sizeof(struct epollop));
+ mm_free(epollop);
+}
+
+#endif /* EVENT__HAVE_EPOLL */
diff --git a/protocols/Telegram/tgl/libevent/epoll_sub.c b/protocols/Telegram/tgl/libevent/epoll_sub.c
new file mode 100644
index 0000000000..3f01f6a699
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/epoll_sub.c
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2003-2009 Niels Provos <provos@citi.umich.edu>
+ * Copyright 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "evconfig-private.h"
+#include <stdint.h>
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <sys/epoll.h>
+#include <unistd.h>
+#include <errno.h>
+
+int
+epoll_create(int size)
+{
+#if !defined(__NR_epoll_create) && defined(__NR_epoll_create1)
+ if (size <= 0) {
+ errno = EINVAL;
+ return -1;
+ }
+ return (syscall(__NR_epoll_create1, 0));
+#else
+ return (syscall(__NR_epoll_create, size));
+#endif
+}
+
+int
+epoll_ctl(int epfd, int op, int fd, struct epoll_event *event)
+{
+
+ return (syscall(__NR_epoll_ctl, epfd, op, fd, event));
+}
+
+int
+epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout)
+{
+#if !defined(__NR_epoll_wait) && defined(__NR_epoll_pwait)
+ return (syscall(__NR_epoll_pwait, epfd, events, maxevents, timeout, NULL, 0));
+#else
+ return (syscall(__NR_epoll_wait, epfd, events, maxevents, timeout));
+#endif
+}
diff --git a/protocols/Telegram/tgl/libevent/epolltable-internal.h b/protocols/Telegram/tgl/libevent/epolltable-internal.h
new file mode 100644
index 0000000000..da30e0973a
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/epolltable-internal.h
@@ -0,0 +1,1166 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EPOLLTABLE_INTERNAL_H_INCLUDED_
+#define EPOLLTABLE_INTERNAL_H_INCLUDED_
+
+/*
+ Here are the values we're masking off to decide what operations to do.
+ Note that since EV_READ|EV_WRITE.
+
+ Note also that this table is a little sparse, since ADD+DEL is
+ nonsensical ("xxx" in the list below.)
+
+ Note also also that we are shifting old_events by only 5 bits, since
+ EV_READ is 2 and EV_WRITE is 4.
+
+ The table was auto-generated with a python script, according to this
+ pseudocode:[*0]
+
+ If either the read or the write change is add+del:
+ This is impossible; Set op==-1, events=0.
+ Else, if either the read or the write change is add:
+ Set events to 0.
+ If the read change is add, or
+ (the read change is not del, and ev_read is in old_events):
+ Add EPOLLIN to events.
+ If the write change is add, or
+ (the write change is not del, and ev_write is in old_events):
+ Add EPOLLOUT to events.
+
+ If old_events is set:
+ Set op to EPOLL_CTL_MOD [*1,*2]
+ Else:
+ Set op to EPOLL_CTL_ADD [*3]
+
+ Else, if the read or the write change is del:
+ Set op to EPOLL_CTL_DEL.
+ If the read change is del:
+ If the write change is del:
+ Set events to EPOLLIN|EPOLLOUT
+ Else if ev_write is in old_events:
+ Set events to EPOLLOUT
+ Set op to EPOLL_CTL_MOD
+ Else
+ Set events to EPOLLIN
+ Else:
+ {The write change is del.}
+ If ev_read is in old_events:
+ Set events to EPOLLIN
+ Set op to EPOLL_CTL_MOD
+ Else:
+ Set the events to EPOLLOUT
+
+ Else:
+ There is no read or write change; set op to 0 and events to 0.
+
+ The logic is a little tricky, since we had no events set on the fd before,
+ we need to set op="ADD" and set events=the events we want to add. If we
+ had any events set on the fd before, and we want any events to remain on
+ the fd, we need to say op="MOD" and set events=the events we want to
+ remain. But if we want to delete the last event, we say op="DEL" and
+ set events=(any non-null pointer).
+
+ [*0] Actually, the Python script has gotten a bit more complicated, to
+ support EPOLLRDHUP.
+
+ [*1] This MOD is only a guess. MOD might fail with ENOENT if the file was
+ closed and a new file was opened with the same fd. If so, we'll retry
+ with ADD.
+
+ [*2] We can't replace this with a no-op even if old_events is the same as
+ the new events: if the file was closed and reopened, we need to retry
+ with an ADD. (We do a MOD in this case since "no change" is more
+ common than "close and reopen", so we'll usually wind up doing 1
+ syscalls instead of 2.)
+
+ [*3] This ADD is only a guess. There is a fun Linux kernel issue where if
+ you have two fds for the same file (via dup) and you ADD one to an
+ epfd, then close it, then re-create it with the same fd (via dup2 or an
+ unlucky dup), then try to ADD it again, you'll get an EEXIST, since the
+ struct epitem is not actually removed from the struct eventpoll until
+ the file itself is closed.
+
+ EV_CHANGE_ADD==1
+ EV_CHANGE_DEL==2
+ EV_READ ==2
+ EV_WRITE ==4
+ EV_CLOSED ==0x80
+
+ Bit 0: close change is add
+ Bit 1: close change is del
+ Bit 2: read change is add
+ Bit 3: read change is del
+ Bit 4: write change is add
+ Bit 5: write change is del
+ Bit 6: old events had EV_READ
+ Bit 7: old events had EV_WRITE
+ Bit 8: old events had EV_CLOSED
+*/
+
+#define EPOLL_OP_TABLE_INDEX(c) \
+ ( (((c)->close_change&(EV_CHANGE_ADD|EV_CHANGE_DEL))) | \
+ (((c)->read_change&(EV_CHANGE_ADD|EV_CHANGE_DEL)) << 2) | \
+ (((c)->write_change&(EV_CHANGE_ADD|EV_CHANGE_DEL)) << 4) | \
+ (((c)->old_events&(EV_READ|EV_WRITE)) << 5) | \
+ (((c)->old_events&(EV_CLOSED)) << 1) \
+ )
+
+#if EV_READ != 2 || EV_WRITE != 4 || EV_CLOSED != 0x80 || EV_CHANGE_ADD != 1 || EV_CHANGE_DEL != 2
+#error "Libevent's internals changed! Regenerate the op_table in epolltable-internal.h"
+#endif
+
+static const struct operation {
+ int events;
+ int op;
+} epoll_op_table[] = {
+ /* old= 0, write: 0, read: 0, close: 0 */
+ { 0, 0 },
+ /* old= 0, write: 0, read: 0, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_ADD },
+ /* old= 0, write: 0, read: 0, close:del */
+ { EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= 0, write: 0, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= 0, write: 0, read:add, close: 0 */
+ { EPOLLIN, EPOLL_CTL_ADD },
+ /* old= 0, write: 0, read:add, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_ADD },
+ /* old= 0, write: 0, read:add, close:del */
+ { EPOLLIN, EPOLL_CTL_ADD },
+ /* old= 0, write: 0, read:add, close:xxx */
+ { 0, 255 },
+ /* old= 0, write: 0, read:del, close: 0 */
+ { EPOLLIN, EPOLL_CTL_DEL },
+ /* old= 0, write: 0, read:del, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_ADD },
+ /* old= 0, write: 0, read:del, close:del */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= 0, write: 0, read:del, close:xxx */
+ { 0, 255 },
+ /* old= 0, write: 0, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= 0, write: 0, read:xxx, close:add */
+ { 0, 255 },
+ /* old= 0, write: 0, read:xxx, close:del */
+ { 0, 255 },
+ /* old= 0, write: 0, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= 0, write:add, read: 0, close: 0 */
+ { EPOLLOUT, EPOLL_CTL_ADD },
+ /* old= 0, write:add, read: 0, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_ADD },
+ /* old= 0, write:add, read: 0, close:del */
+ { EPOLLOUT, EPOLL_CTL_ADD },
+ /* old= 0, write:add, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= 0, write:add, read:add, close: 0 */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_ADD },
+ /* old= 0, write:add, read:add, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_ADD },
+ /* old= 0, write:add, read:add, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_ADD },
+ /* old= 0, write:add, read:add, close:xxx */
+ { 0, 255 },
+ /* old= 0, write:add, read:del, close: 0 */
+ { EPOLLOUT, EPOLL_CTL_ADD },
+ /* old= 0, write:add, read:del, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_ADD },
+ /* old= 0, write:add, read:del, close:del */
+ { EPOLLOUT, EPOLL_CTL_ADD },
+ /* old= 0, write:add, read:del, close:xxx */
+ { 0, 255 },
+ /* old= 0, write:add, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= 0, write:add, read:xxx, close:add */
+ { 0, 255 },
+ /* old= 0, write:add, read:xxx, close:del */
+ { 0, 255 },
+ /* old= 0, write:add, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= 0, write:del, read: 0, close: 0 */
+ { EPOLLOUT, EPOLL_CTL_DEL },
+ /* old= 0, write:del, read: 0, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_ADD },
+ /* old= 0, write:del, read: 0, close:del */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= 0, write:del, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= 0, write:del, read:add, close: 0 */
+ { EPOLLIN, EPOLL_CTL_ADD },
+ /* old= 0, write:del, read:add, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_ADD },
+ /* old= 0, write:del, read:add, close:del */
+ { EPOLLIN, EPOLL_CTL_ADD },
+ /* old= 0, write:del, read:add, close:xxx */
+ { 0, 255 },
+ /* old= 0, write:del, read:del, close: 0 */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_DEL },
+ /* old= 0, write:del, read:del, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_ADD },
+ /* old= 0, write:del, read:del, close:del */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= 0, write:del, read:del, close:xxx */
+ { 0, 255 },
+ /* old= 0, write:del, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= 0, write:del, read:xxx, close:add */
+ { 0, 255 },
+ /* old= 0, write:del, read:xxx, close:del */
+ { 0, 255 },
+ /* old= 0, write:del, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= 0, write:xxx, read: 0, close: 0 */
+ { 0, 255 },
+ /* old= 0, write:xxx, read: 0, close:add */
+ { 0, 255 },
+ /* old= 0, write:xxx, read: 0, close:del */
+ { 0, 255 },
+ /* old= 0, write:xxx, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= 0, write:xxx, read:add, close: 0 */
+ { 0, 255 },
+ /* old= 0, write:xxx, read:add, close:add */
+ { 0, 255 },
+ /* old= 0, write:xxx, read:add, close:del */
+ { 0, 255 },
+ /* old= 0, write:xxx, read:add, close:xxx */
+ { 0, 255 },
+ /* old= 0, write:xxx, read:del, close: 0 */
+ { 0, 255 },
+ /* old= 0, write:xxx, read:del, close:add */
+ { 0, 255 },
+ /* old= 0, write:xxx, read:del, close:del */
+ { 0, 255 },
+ /* old= 0, write:xxx, read:del, close:xxx */
+ { 0, 255 },
+ /* old= 0, write:xxx, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= 0, write:xxx, read:xxx, close:add */
+ { 0, 255 },
+ /* old= 0, write:xxx, read:xxx, close:del */
+ { 0, 255 },
+ /* old= 0, write:xxx, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= r, write: 0, read: 0, close: 0 */
+ { 0, 0 },
+ /* old= r, write: 0, read: 0, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= r, write: 0, read: 0, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= r, write: 0, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= r, write: 0, read:add, close: 0 */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= r, write: 0, read:add, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= r, write: 0, read:add, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= r, write: 0, read:add, close:xxx */
+ { 0, 255 },
+ /* old= r, write: 0, read:del, close: 0 */
+ { EPOLLIN, EPOLL_CTL_DEL },
+ /* old= r, write: 0, read:del, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= r, write: 0, read:del, close:del */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= r, write: 0, read:del, close:xxx */
+ { 0, 255 },
+ /* old= r, write: 0, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= r, write: 0, read:xxx, close:add */
+ { 0, 255 },
+ /* old= r, write: 0, read:xxx, close:del */
+ { 0, 255 },
+ /* old= r, write: 0, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= r, write:add, read: 0, close: 0 */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= r, write:add, read: 0, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= r, write:add, read: 0, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= r, write:add, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= r, write:add, read:add, close: 0 */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= r, write:add, read:add, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= r, write:add, read:add, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= r, write:add, read:add, close:xxx */
+ { 0, 255 },
+ /* old= r, write:add, read:del, close: 0 */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= r, write:add, read:del, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= r, write:add, read:del, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= r, write:add, read:del, close:xxx */
+ { 0, 255 },
+ /* old= r, write:add, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= r, write:add, read:xxx, close:add */
+ { 0, 255 },
+ /* old= r, write:add, read:xxx, close:del */
+ { 0, 255 },
+ /* old= r, write:add, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= r, write:del, read: 0, close: 0 */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= r, write:del, read: 0, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= r, write:del, read: 0, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= r, write:del, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= r, write:del, read:add, close: 0 */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= r, write:del, read:add, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= r, write:del, read:add, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= r, write:del, read:add, close:xxx */
+ { 0, 255 },
+ /* old= r, write:del, read:del, close: 0 */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_DEL },
+ /* old= r, write:del, read:del, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= r, write:del, read:del, close:del */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= r, write:del, read:del, close:xxx */
+ { 0, 255 },
+ /* old= r, write:del, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= r, write:del, read:xxx, close:add */
+ { 0, 255 },
+ /* old= r, write:del, read:xxx, close:del */
+ { 0, 255 },
+ /* old= r, write:del, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= r, write:xxx, read: 0, close: 0 */
+ { 0, 255 },
+ /* old= r, write:xxx, read: 0, close:add */
+ { 0, 255 },
+ /* old= r, write:xxx, read: 0, close:del */
+ { 0, 255 },
+ /* old= r, write:xxx, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= r, write:xxx, read:add, close: 0 */
+ { 0, 255 },
+ /* old= r, write:xxx, read:add, close:add */
+ { 0, 255 },
+ /* old= r, write:xxx, read:add, close:del */
+ { 0, 255 },
+ /* old= r, write:xxx, read:add, close:xxx */
+ { 0, 255 },
+ /* old= r, write:xxx, read:del, close: 0 */
+ { 0, 255 },
+ /* old= r, write:xxx, read:del, close:add */
+ { 0, 255 },
+ /* old= r, write:xxx, read:del, close:del */
+ { 0, 255 },
+ /* old= r, write:xxx, read:del, close:xxx */
+ { 0, 255 },
+ /* old= r, write:xxx, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= r, write:xxx, read:xxx, close:add */
+ { 0, 255 },
+ /* old= r, write:xxx, read:xxx, close:del */
+ { 0, 255 },
+ /* old= r, write:xxx, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= w, write: 0, read: 0, close: 0 */
+ { 0, 0 },
+ /* old= w, write: 0, read: 0, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= w, write: 0, read: 0, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= w, write: 0, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= w, write: 0, read:add, close: 0 */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= w, write: 0, read:add, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= w, write: 0, read:add, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= w, write: 0, read:add, close:xxx */
+ { 0, 255 },
+ /* old= w, write: 0, read:del, close: 0 */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= w, write: 0, read:del, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= w, write: 0, read:del, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= w, write: 0, read:del, close:xxx */
+ { 0, 255 },
+ /* old= w, write: 0, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= w, write: 0, read:xxx, close:add */
+ { 0, 255 },
+ /* old= w, write: 0, read:xxx, close:del */
+ { 0, 255 },
+ /* old= w, write: 0, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= w, write:add, read: 0, close: 0 */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= w, write:add, read: 0, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= w, write:add, read: 0, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= w, write:add, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= w, write:add, read:add, close: 0 */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= w, write:add, read:add, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= w, write:add, read:add, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= w, write:add, read:add, close:xxx */
+ { 0, 255 },
+ /* old= w, write:add, read:del, close: 0 */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= w, write:add, read:del, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= w, write:add, read:del, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= w, write:add, read:del, close:xxx */
+ { 0, 255 },
+ /* old= w, write:add, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= w, write:add, read:xxx, close:add */
+ { 0, 255 },
+ /* old= w, write:add, read:xxx, close:del */
+ { 0, 255 },
+ /* old= w, write:add, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= w, write:del, read: 0, close: 0 */
+ { EPOLLOUT, EPOLL_CTL_DEL },
+ /* old= w, write:del, read: 0, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= w, write:del, read: 0, close:del */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= w, write:del, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= w, write:del, read:add, close: 0 */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= w, write:del, read:add, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= w, write:del, read:add, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= w, write:del, read:add, close:xxx */
+ { 0, 255 },
+ /* old= w, write:del, read:del, close: 0 */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_DEL },
+ /* old= w, write:del, read:del, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= w, write:del, read:del, close:del */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= w, write:del, read:del, close:xxx */
+ { 0, 255 },
+ /* old= w, write:del, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= w, write:del, read:xxx, close:add */
+ { 0, 255 },
+ /* old= w, write:del, read:xxx, close:del */
+ { 0, 255 },
+ /* old= w, write:del, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= w, write:xxx, read: 0, close: 0 */
+ { 0, 255 },
+ /* old= w, write:xxx, read: 0, close:add */
+ { 0, 255 },
+ /* old= w, write:xxx, read: 0, close:del */
+ { 0, 255 },
+ /* old= w, write:xxx, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= w, write:xxx, read:add, close: 0 */
+ { 0, 255 },
+ /* old= w, write:xxx, read:add, close:add */
+ { 0, 255 },
+ /* old= w, write:xxx, read:add, close:del */
+ { 0, 255 },
+ /* old= w, write:xxx, read:add, close:xxx */
+ { 0, 255 },
+ /* old= w, write:xxx, read:del, close: 0 */
+ { 0, 255 },
+ /* old= w, write:xxx, read:del, close:add */
+ { 0, 255 },
+ /* old= w, write:xxx, read:del, close:del */
+ { 0, 255 },
+ /* old= w, write:xxx, read:del, close:xxx */
+ { 0, 255 },
+ /* old= w, write:xxx, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= w, write:xxx, read:xxx, close:add */
+ { 0, 255 },
+ /* old= w, write:xxx, read:xxx, close:del */
+ { 0, 255 },
+ /* old= w, write:xxx, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= rw, write: 0, read: 0, close: 0 */
+ { 0, 0 },
+ /* old= rw, write: 0, read: 0, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= rw, write: 0, read: 0, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= rw, write: 0, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= rw, write: 0, read:add, close: 0 */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= rw, write: 0, read:add, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= rw, write: 0, read:add, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= rw, write: 0, read:add, close:xxx */
+ { 0, 255 },
+ /* old= rw, write: 0, read:del, close: 0 */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= rw, write: 0, read:del, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= rw, write: 0, read:del, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= rw, write: 0, read:del, close:xxx */
+ { 0, 255 },
+ /* old= rw, write: 0, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= rw, write: 0, read:xxx, close:add */
+ { 0, 255 },
+ /* old= rw, write: 0, read:xxx, close:del */
+ { 0, 255 },
+ /* old= rw, write: 0, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= rw, write:add, read: 0, close: 0 */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= rw, write:add, read: 0, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= rw, write:add, read: 0, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= rw, write:add, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= rw, write:add, read:add, close: 0 */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= rw, write:add, read:add, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= rw, write:add, read:add, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= rw, write:add, read:add, close:xxx */
+ { 0, 255 },
+ /* old= rw, write:add, read:del, close: 0 */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= rw, write:add, read:del, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= rw, write:add, read:del, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= rw, write:add, read:del, close:xxx */
+ { 0, 255 },
+ /* old= rw, write:add, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= rw, write:add, read:xxx, close:add */
+ { 0, 255 },
+ /* old= rw, write:add, read:xxx, close:del */
+ { 0, 255 },
+ /* old= rw, write:add, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= rw, write:del, read: 0, close: 0 */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= rw, write:del, read: 0, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= rw, write:del, read: 0, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= rw, write:del, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= rw, write:del, read:add, close: 0 */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= rw, write:del, read:add, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= rw, write:del, read:add, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= rw, write:del, read:add, close:xxx */
+ { 0, 255 },
+ /* old= rw, write:del, read:del, close: 0 */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_DEL },
+ /* old= rw, write:del, read:del, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= rw, write:del, read:del, close:del */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= rw, write:del, read:del, close:xxx */
+ { 0, 255 },
+ /* old= rw, write:del, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= rw, write:del, read:xxx, close:add */
+ { 0, 255 },
+ /* old= rw, write:del, read:xxx, close:del */
+ { 0, 255 },
+ /* old= rw, write:del, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= rw, write:xxx, read: 0, close: 0 */
+ { 0, 255 },
+ /* old= rw, write:xxx, read: 0, close:add */
+ { 0, 255 },
+ /* old= rw, write:xxx, read: 0, close:del */
+ { 0, 255 },
+ /* old= rw, write:xxx, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= rw, write:xxx, read:add, close: 0 */
+ { 0, 255 },
+ /* old= rw, write:xxx, read:add, close:add */
+ { 0, 255 },
+ /* old= rw, write:xxx, read:add, close:del */
+ { 0, 255 },
+ /* old= rw, write:xxx, read:add, close:xxx */
+ { 0, 255 },
+ /* old= rw, write:xxx, read:del, close: 0 */
+ { 0, 255 },
+ /* old= rw, write:xxx, read:del, close:add */
+ { 0, 255 },
+ /* old= rw, write:xxx, read:del, close:del */
+ { 0, 255 },
+ /* old= rw, write:xxx, read:del, close:xxx */
+ { 0, 255 },
+ /* old= rw, write:xxx, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= rw, write:xxx, read:xxx, close:add */
+ { 0, 255 },
+ /* old= rw, write:xxx, read:xxx, close:del */
+ { 0, 255 },
+ /* old= rw, write:xxx, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= c, write: 0, read: 0, close: 0 */
+ { 0, 0 },
+ /* old= c, write: 0, read: 0, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write: 0, read: 0, close:del */
+ { EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= c, write: 0, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= c, write: 0, read:add, close: 0 */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write: 0, read:add, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write: 0, read:add, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= c, write: 0, read:add, close:xxx */
+ { 0, 255 },
+ /* old= c, write: 0, read:del, close: 0 */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write: 0, read:del, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write: 0, read:del, close:del */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= c, write: 0, read:del, close:xxx */
+ { 0, 255 },
+ /* old= c, write: 0, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= c, write: 0, read:xxx, close:add */
+ { 0, 255 },
+ /* old= c, write: 0, read:xxx, close:del */
+ { 0, 255 },
+ /* old= c, write: 0, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= c, write:add, read: 0, close: 0 */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write:add, read: 0, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write:add, read: 0, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= c, write:add, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= c, write:add, read:add, close: 0 */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write:add, read:add, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write:add, read:add, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= c, write:add, read:add, close:xxx */
+ { 0, 255 },
+ /* old= c, write:add, read:del, close: 0 */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write:add, read:del, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write:add, read:del, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= c, write:add, read:del, close:xxx */
+ { 0, 255 },
+ /* old= c, write:add, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= c, write:add, read:xxx, close:add */
+ { 0, 255 },
+ /* old= c, write:add, read:xxx, close:del */
+ { 0, 255 },
+ /* old= c, write:add, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= c, write:del, read: 0, close: 0 */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write:del, read: 0, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write:del, read: 0, close:del */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= c, write:del, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= c, write:del, read:add, close: 0 */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write:del, read:add, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write:del, read:add, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= c, write:del, read:add, close:xxx */
+ { 0, 255 },
+ /* old= c, write:del, read:del, close: 0 */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write:del, read:del, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write:del, read:del, close:del */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= c, write:del, read:del, close:xxx */
+ { 0, 255 },
+ /* old= c, write:del, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= c, write:del, read:xxx, close:add */
+ { 0, 255 },
+ /* old= c, write:del, read:xxx, close:del */
+ { 0, 255 },
+ /* old= c, write:del, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= c, write:xxx, read: 0, close: 0 */
+ { 0, 255 },
+ /* old= c, write:xxx, read: 0, close:add */
+ { 0, 255 },
+ /* old= c, write:xxx, read: 0, close:del */
+ { 0, 255 },
+ /* old= c, write:xxx, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= c, write:xxx, read:add, close: 0 */
+ { 0, 255 },
+ /* old= c, write:xxx, read:add, close:add */
+ { 0, 255 },
+ /* old= c, write:xxx, read:add, close:del */
+ { 0, 255 },
+ /* old= c, write:xxx, read:add, close:xxx */
+ { 0, 255 },
+ /* old= c, write:xxx, read:del, close: 0 */
+ { 0, 255 },
+ /* old= c, write:xxx, read:del, close:add */
+ { 0, 255 },
+ /* old= c, write:xxx, read:del, close:del */
+ { 0, 255 },
+ /* old= c, write:xxx, read:del, close:xxx */
+ { 0, 255 },
+ /* old= c, write:xxx, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= c, write:xxx, read:xxx, close:add */
+ { 0, 255 },
+ /* old= c, write:xxx, read:xxx, close:del */
+ { 0, 255 },
+ /* old= c, write:xxx, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= cr, write: 0, read: 0, close: 0 */
+ { 0, 0 },
+ /* old= cr, write: 0, read: 0, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write: 0, read: 0, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= cr, write: 0, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= cr, write: 0, read:add, close: 0 */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write: 0, read:add, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write: 0, read:add, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= cr, write: 0, read:add, close:xxx */
+ { 0, 255 },
+ /* old= cr, write: 0, read:del, close: 0 */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write: 0, read:del, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write: 0, read:del, close:del */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= cr, write: 0, read:del, close:xxx */
+ { 0, 255 },
+ /* old= cr, write: 0, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= cr, write: 0, read:xxx, close:add */
+ { 0, 255 },
+ /* old= cr, write: 0, read:xxx, close:del */
+ { 0, 255 },
+ /* old= cr, write: 0, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= cr, write:add, read: 0, close: 0 */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write:add, read: 0, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write:add, read: 0, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= cr, write:add, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= cr, write:add, read:add, close: 0 */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write:add, read:add, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write:add, read:add, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= cr, write:add, read:add, close:xxx */
+ { 0, 255 },
+ /* old= cr, write:add, read:del, close: 0 */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write:add, read:del, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write:add, read:del, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= cr, write:add, read:del, close:xxx */
+ { 0, 255 },
+ /* old= cr, write:add, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= cr, write:add, read:xxx, close:add */
+ { 0, 255 },
+ /* old= cr, write:add, read:xxx, close:del */
+ { 0, 255 },
+ /* old= cr, write:add, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= cr, write:del, read: 0, close: 0 */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write:del, read: 0, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write:del, read: 0, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= cr, write:del, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= cr, write:del, read:add, close: 0 */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write:del, read:add, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write:del, read:add, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= cr, write:del, read:add, close:xxx */
+ { 0, 255 },
+ /* old= cr, write:del, read:del, close: 0 */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write:del, read:del, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write:del, read:del, close:del */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= cr, write:del, read:del, close:xxx */
+ { 0, 255 },
+ /* old= cr, write:del, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= cr, write:del, read:xxx, close:add */
+ { 0, 255 },
+ /* old= cr, write:del, read:xxx, close:del */
+ { 0, 255 },
+ /* old= cr, write:del, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= cr, write:xxx, read: 0, close: 0 */
+ { 0, 255 },
+ /* old= cr, write:xxx, read: 0, close:add */
+ { 0, 255 },
+ /* old= cr, write:xxx, read: 0, close:del */
+ { 0, 255 },
+ /* old= cr, write:xxx, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= cr, write:xxx, read:add, close: 0 */
+ { 0, 255 },
+ /* old= cr, write:xxx, read:add, close:add */
+ { 0, 255 },
+ /* old= cr, write:xxx, read:add, close:del */
+ { 0, 255 },
+ /* old= cr, write:xxx, read:add, close:xxx */
+ { 0, 255 },
+ /* old= cr, write:xxx, read:del, close: 0 */
+ { 0, 255 },
+ /* old= cr, write:xxx, read:del, close:add */
+ { 0, 255 },
+ /* old= cr, write:xxx, read:del, close:del */
+ { 0, 255 },
+ /* old= cr, write:xxx, read:del, close:xxx */
+ { 0, 255 },
+ /* old= cr, write:xxx, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= cr, write:xxx, read:xxx, close:add */
+ { 0, 255 },
+ /* old= cr, write:xxx, read:xxx, close:del */
+ { 0, 255 },
+ /* old= cr, write:xxx, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= cw, write: 0, read: 0, close: 0 */
+ { 0, 0 },
+ /* old= cw, write: 0, read: 0, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write: 0, read: 0, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= cw, write: 0, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= cw, write: 0, read:add, close: 0 */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write: 0, read:add, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write: 0, read:add, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= cw, write: 0, read:add, close:xxx */
+ { 0, 255 },
+ /* old= cw, write: 0, read:del, close: 0 */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write: 0, read:del, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write: 0, read:del, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= cw, write: 0, read:del, close:xxx */
+ { 0, 255 },
+ /* old= cw, write: 0, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= cw, write: 0, read:xxx, close:add */
+ { 0, 255 },
+ /* old= cw, write: 0, read:xxx, close:del */
+ { 0, 255 },
+ /* old= cw, write: 0, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= cw, write:add, read: 0, close: 0 */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write:add, read: 0, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write:add, read: 0, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= cw, write:add, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= cw, write:add, read:add, close: 0 */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write:add, read:add, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write:add, read:add, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= cw, write:add, read:add, close:xxx */
+ { 0, 255 },
+ /* old= cw, write:add, read:del, close: 0 */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write:add, read:del, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write:add, read:del, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= cw, write:add, read:del, close:xxx */
+ { 0, 255 },
+ /* old= cw, write:add, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= cw, write:add, read:xxx, close:add */
+ { 0, 255 },
+ /* old= cw, write:add, read:xxx, close:del */
+ { 0, 255 },
+ /* old= cw, write:add, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= cw, write:del, read: 0, close: 0 */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write:del, read: 0, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write:del, read: 0, close:del */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= cw, write:del, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= cw, write:del, read:add, close: 0 */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write:del, read:add, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write:del, read:add, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= cw, write:del, read:add, close:xxx */
+ { 0, 255 },
+ /* old= cw, write:del, read:del, close: 0 */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write:del, read:del, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write:del, read:del, close:del */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= cw, write:del, read:del, close:xxx */
+ { 0, 255 },
+ /* old= cw, write:del, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= cw, write:del, read:xxx, close:add */
+ { 0, 255 },
+ /* old= cw, write:del, read:xxx, close:del */
+ { 0, 255 },
+ /* old= cw, write:del, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= cw, write:xxx, read: 0, close: 0 */
+ { 0, 255 },
+ /* old= cw, write:xxx, read: 0, close:add */
+ { 0, 255 },
+ /* old= cw, write:xxx, read: 0, close:del */
+ { 0, 255 },
+ /* old= cw, write:xxx, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= cw, write:xxx, read:add, close: 0 */
+ { 0, 255 },
+ /* old= cw, write:xxx, read:add, close:add */
+ { 0, 255 },
+ /* old= cw, write:xxx, read:add, close:del */
+ { 0, 255 },
+ /* old= cw, write:xxx, read:add, close:xxx */
+ { 0, 255 },
+ /* old= cw, write:xxx, read:del, close: 0 */
+ { 0, 255 },
+ /* old= cw, write:xxx, read:del, close:add */
+ { 0, 255 },
+ /* old= cw, write:xxx, read:del, close:del */
+ { 0, 255 },
+ /* old= cw, write:xxx, read:del, close:xxx */
+ { 0, 255 },
+ /* old= cw, write:xxx, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= cw, write:xxx, read:xxx, close:add */
+ { 0, 255 },
+ /* old= cw, write:xxx, read:xxx, close:del */
+ { 0, 255 },
+ /* old= cw, write:xxx, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old=crw, write: 0, read: 0, close: 0 */
+ { 0, 0 },
+ /* old=crw, write: 0, read: 0, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write: 0, read: 0, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old=crw, write: 0, read: 0, close:xxx */
+ { 0, 255 },
+ /* old=crw, write: 0, read:add, close: 0 */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write: 0, read:add, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write: 0, read:add, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old=crw, write: 0, read:add, close:xxx */
+ { 0, 255 },
+ /* old=crw, write: 0, read:del, close: 0 */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write: 0, read:del, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write: 0, read:del, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old=crw, write: 0, read:del, close:xxx */
+ { 0, 255 },
+ /* old=crw, write: 0, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old=crw, write: 0, read:xxx, close:add */
+ { 0, 255 },
+ /* old=crw, write: 0, read:xxx, close:del */
+ { 0, 255 },
+ /* old=crw, write: 0, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old=crw, write:add, read: 0, close: 0 */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write:add, read: 0, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write:add, read: 0, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old=crw, write:add, read: 0, close:xxx */
+ { 0, 255 },
+ /* old=crw, write:add, read:add, close: 0 */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write:add, read:add, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write:add, read:add, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old=crw, write:add, read:add, close:xxx */
+ { 0, 255 },
+ /* old=crw, write:add, read:del, close: 0 */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write:add, read:del, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write:add, read:del, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old=crw, write:add, read:del, close:xxx */
+ { 0, 255 },
+ /* old=crw, write:add, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old=crw, write:add, read:xxx, close:add */
+ { 0, 255 },
+ /* old=crw, write:add, read:xxx, close:del */
+ { 0, 255 },
+ /* old=crw, write:add, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old=crw, write:del, read: 0, close: 0 */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write:del, read: 0, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write:del, read: 0, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old=crw, write:del, read: 0, close:xxx */
+ { 0, 255 },
+ /* old=crw, write:del, read:add, close: 0 */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write:del, read:add, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write:del, read:add, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old=crw, write:del, read:add, close:xxx */
+ { 0, 255 },
+ /* old=crw, write:del, read:del, close: 0 */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write:del, read:del, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write:del, read:del, close:del */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old=crw, write:del, read:del, close:xxx */
+ { 0, 255 },
+ /* old=crw, write:del, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old=crw, write:del, read:xxx, close:add */
+ { 0, 255 },
+ /* old=crw, write:del, read:xxx, close:del */
+ { 0, 255 },
+ /* old=crw, write:del, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old=crw, write:xxx, read: 0, close: 0 */
+ { 0, 255 },
+ /* old=crw, write:xxx, read: 0, close:add */
+ { 0, 255 },
+ /* old=crw, write:xxx, read: 0, close:del */
+ { 0, 255 },
+ /* old=crw, write:xxx, read: 0, close:xxx */
+ { 0, 255 },
+ /* old=crw, write:xxx, read:add, close: 0 */
+ { 0, 255 },
+ /* old=crw, write:xxx, read:add, close:add */
+ { 0, 255 },
+ /* old=crw, write:xxx, read:add, close:del */
+ { 0, 255 },
+ /* old=crw, write:xxx, read:add, close:xxx */
+ { 0, 255 },
+ /* old=crw, write:xxx, read:del, close: 0 */
+ { 0, 255 },
+ /* old=crw, write:xxx, read:del, close:add */
+ { 0, 255 },
+ /* old=crw, write:xxx, read:del, close:del */
+ { 0, 255 },
+ /* old=crw, write:xxx, read:del, close:xxx */
+ { 0, 255 },
+ /* old=crw, write:xxx, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old=crw, write:xxx, read:xxx, close:add */
+ { 0, 255 },
+ /* old=crw, write:xxx, read:xxx, close:del */
+ { 0, 255 },
+ /* old=crw, write:xxx, read:xxx, close:xxx */
+ { 0, 255 },
+};
+
+#endif
diff --git a/protocols/Telegram/tgl/libevent/evbuffer-internal.h b/protocols/Telegram/tgl/libevent/evbuffer-internal.h
new file mode 100644
index 0000000000..cf4bddc80e
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/evbuffer-internal.h
@@ -0,0 +1,351 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVBUFFER_INTERNAL_H_INCLUDED_
+#define EVBUFFER_INTERNAL_H_INCLUDED_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+#include "event2/util.h"
+#include "event2/event_struct.h"
+#include "util-internal.h"
+#include "defer-internal.h"
+
+/* Experimental cb flag: "never deferred." Implementation note:
+ * these callbacks may get an inaccurate view of n_del/n_added in their
+ * arguments. */
+#define EVBUFFER_CB_NODEFER 2
+
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+#include <sys/queue.h>
+
+/* Minimum allocation for a chain. We define this so that we're burning no
+ * more than 5% of each allocation on overhead. It would be nice to lose even
+ * less space, though. */
+#if EVENT__SIZEOF_VOID_P < 8
+#define MIN_BUFFER_SIZE 512
+#else
+#define MIN_BUFFER_SIZE 1024
+#endif
+
+/** A single evbuffer callback for an evbuffer. This function will be invoked
+ * when bytes are added to or removed from the evbuffer. */
+struct evbuffer_cb_entry {
+ /** Structures to implement a doubly-linked queue of callbacks */
+ LIST_ENTRY(evbuffer_cb_entry) next;
+ /** The callback function to invoke when this callback is called.
+ If EVBUFFER_CB_OBSOLETE is set in flags, the cb_obsolete field is
+ valid; otherwise, cb_func is valid. */
+ union {
+ evbuffer_cb_func cb_func;
+ evbuffer_cb cb_obsolete;
+ } cb;
+ /** Argument to pass to cb. */
+ void *cbarg;
+ /** Currently set flags on this callback. */
+ ev_uint32_t flags;
+};
+
+struct bufferevent;
+struct evbuffer_chain;
+struct evbuffer {
+ /** The first chain in this buffer's linked list of chains. */
+ struct evbuffer_chain *first;
+ /** The last chain in this buffer's linked list of chains. */
+ struct evbuffer_chain *last;
+
+ /** Pointer to the next pointer pointing at the 'last_with_data' chain.
+ *
+ * To unpack:
+ *
+ * The last_with_data chain is the last chain that has any data in it.
+ * If all chains in the buffer are empty, it is the first chain.
+ * If the buffer has no chains, it is NULL.
+ *
+ * The last_with_datap pointer points at _whatever 'next' pointer_
+ * points at the last_with_datap chain. If the last_with_data chain
+ * is the first chain, or it is NULL, then the last_with_datap pointer
+ * is &buf->first.
+ */
+ struct evbuffer_chain **last_with_datap;
+
+ /** Total amount of bytes stored in all chains.*/
+ size_t total_len;
+
+ /** Number of bytes we have added to the buffer since we last tried to
+ * invoke callbacks. */
+ size_t n_add_for_cb;
+ /** Number of bytes we have removed from the buffer since we last
+ * tried to invoke callbacks. */
+ size_t n_del_for_cb;
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ /** A lock used to mediate access to this buffer. */
+ void *lock;
+#endif
+ /** True iff we should free the lock field when we free this
+ * evbuffer. */
+ unsigned own_lock : 1;
+ /** True iff we should not allow changes to the front of the buffer
+ * (drains or prepends). */
+ unsigned freeze_start : 1;
+ /** True iff we should not allow changes to the end of the buffer
+ * (appends) */
+ unsigned freeze_end : 1;
+ /** True iff this evbuffer's callbacks are not invoked immediately
+ * upon a change in the buffer, but instead are deferred to be invoked
+ * from the event_base's loop. Useful for preventing enormous stack
+ * overflows when we have mutually recursive callbacks, and for
+ * serializing callbacks in a single thread. */
+ unsigned deferred_cbs : 1;
+#ifdef _WIN32
+ /** True iff this buffer is set up for overlapped IO. */
+ unsigned is_overlapped : 1;
+#endif
+ /** Zero or more EVBUFFER_FLAG_* bits */
+ ev_uint32_t flags;
+
+ /** Used to implement deferred callbacks. */
+ struct event_base *cb_queue;
+
+ /** A reference count on this evbuffer. When the reference count
+ * reaches 0, the buffer is destroyed. Manipulated with
+ * evbuffer_incref and evbuffer_decref_and_unlock and
+ * evbuffer_free. */
+ int refcnt;
+
+ /** A struct event_callback handle to make all of this buffer's callbacks
+ * invoked from the event loop. */
+ struct event_callback deferred;
+
+ /** A doubly-linked-list of callback functions */
+ LIST_HEAD(evbuffer_cb_queue, evbuffer_cb_entry) callbacks;
+
+ /** The parent bufferevent object this evbuffer belongs to.
+ * NULL if the evbuffer stands alone. */
+ struct bufferevent *parent;
+};
+
+#if EVENT__SIZEOF_OFF_T < EVENT__SIZEOF_SIZE_T
+typedef ev_ssize_t ev_misalign_t;
+#define EVBUFFER_CHAIN_MAX ((size_t)EV_SSIZE_MAX)
+#else
+typedef ev_off_t ev_misalign_t;
+#if EVENT__SIZEOF_OFF_T > EVENT__SIZEOF_SIZE_T
+#define EVBUFFER_CHAIN_MAX EV_SIZE_MAX
+#else
+#define EVBUFFER_CHAIN_MAX ((size_t)EV_SSIZE_MAX)
+#endif
+#endif
+
+/** A single item in an evbuffer. */
+struct evbuffer_chain {
+ /** points to next buffer in the chain */
+ struct evbuffer_chain *next;
+
+ /** total allocation available in the buffer field. */
+ size_t buffer_len;
+
+ /** unused space at the beginning of buffer or an offset into a
+ * file for sendfile buffers. */
+ ev_misalign_t misalign;
+
+ /** Offset into buffer + misalign at which to start writing.
+ * In other words, the total number of bytes actually stored
+ * in buffer. */
+ size_t off;
+
+ /** Set if special handling is required for this chain */
+ unsigned flags;
+#define EVBUFFER_FILESEGMENT 0x0001 /**< A chain used for a file segment */
+#define EVBUFFER_SENDFILE 0x0002 /**< a chain used with sendfile */
+#define EVBUFFER_REFERENCE 0x0004 /**< a chain with a mem reference */
+#define EVBUFFER_IMMUTABLE 0x0008 /**< read-only chain */
+ /** a chain that mustn't be reallocated or freed, or have its contents
+ * memmoved, until the chain is un-pinned. */
+#define EVBUFFER_MEM_PINNED_R 0x0010
+#define EVBUFFER_MEM_PINNED_W 0x0020
+#define EVBUFFER_MEM_PINNED_ANY (EVBUFFER_MEM_PINNED_R|EVBUFFER_MEM_PINNED_W)
+ /** a chain that should be freed, but can't be freed until it is
+ * un-pinned. */
+#define EVBUFFER_DANGLING 0x0040
+ /** a chain that is a referenced copy of another chain */
+#define EVBUFFER_MULTICAST 0x0080
+
+ /** number of references to this chain */
+ int refcnt;
+
+ /** Usually points to the read-write memory belonging to this
+ * buffer allocated as part of the evbuffer_chain allocation.
+ * For mmap, this can be a read-only buffer and
+ * EVBUFFER_IMMUTABLE will be set in flags. For sendfile, it
+ * may point to NULL.
+ */
+ unsigned char *buffer;
+};
+
+/** callback for a reference chain; lets us know what to do with it when
+ * we're done with it. Lives at the end of an evbuffer_chain with the
+ * EVBUFFER_REFERENCE flag set */
+struct evbuffer_chain_reference {
+ evbuffer_ref_cleanup_cb cleanupfn;
+ void *extra;
+};
+
+/** File segment for a file-segment chain. Lives at the end of an
+ * evbuffer_chain with the EVBUFFER_FILESEGMENT flag set. */
+struct evbuffer_chain_file_segment {
+ struct evbuffer_file_segment *segment;
+#ifdef _WIN32
+ /** If we're using CreateFileMapping, this is the handle to the view. */
+ HANDLE view_handle;
+#endif
+};
+
+/* Declared in event2/buffer.h; defined here. */
+struct evbuffer_file_segment {
+ void *lock; /**< lock prevent concurrent access to refcnt */
+ int refcnt; /**< Reference count for this file segment */
+ unsigned flags; /**< combination of EVBUF_FS_* flags */
+
+ /** What kind of file segment is this? */
+ unsigned can_sendfile : 1;
+ unsigned is_mapping : 1;
+
+ /** The fd that we read the data from. */
+ int fd;
+ /** If we're using mmap, this is the raw mapped memory. */
+ void *mapping;
+#ifdef _WIN32
+ /** If we're using CreateFileMapping, this is the mapping */
+ HANDLE mapping_handle;
+#endif
+ /** If we're using mmap or IO, this is the content of the file
+ * segment. */
+ char *contents;
+ /** Position of this segment within the file. */
+ ev_off_t file_offset;
+ /** If we're using mmap, this is the offset within 'mapping' where
+ * this data segment begins. */
+ ev_off_t mmap_offset;
+ /** The length of this segment. */
+ ev_off_t length;
+ /** Cleanup callback function */
+ evbuffer_file_segment_cleanup_cb cleanup_cb;
+ /** Argument to be pass to cleanup callback function */
+ void *cleanup_cb_arg;
+};
+
+/** Information about the multicast parent of a chain. Lives at the
+ * end of an evbuffer_chain with the EVBUFFER_MULTICAST flag set. */
+struct evbuffer_multicast_parent {
+ /** source buffer the multicast parent belongs to */
+ struct evbuffer *source;
+ /** multicast parent for this chain */
+ struct evbuffer_chain *parent;
+};
+
+#define EVBUFFER_CHAIN_SIZE sizeof(struct evbuffer_chain)
+/** Return a pointer to extra data allocated along with an evbuffer. */
+#define EVBUFFER_CHAIN_EXTRA(t, c) (t *)((struct evbuffer_chain *)(c) + 1)
+
+/** Assert that we are holding the lock on an evbuffer */
+#define ASSERT_EVBUFFER_LOCKED(buffer) \
+ EVLOCK_ASSERT_LOCKED((buffer)->lock)
+
+#define EVBUFFER_LOCK(buffer) \
+ do { \
+ EVLOCK_LOCK((buffer)->lock, 0); \
+ } while (0)
+#define EVBUFFER_UNLOCK(buffer) \
+ do { \
+ EVLOCK_UNLOCK((buffer)->lock, 0); \
+ } while (0)
+#define EVBUFFER_LOCK2(buffer1, buffer2) \
+ do { \
+ EVLOCK_LOCK2((buffer1)->lock, (buffer2)->lock, 0, 0); \
+ } while (0)
+#define EVBUFFER_UNLOCK2(buffer1, buffer2) \
+ do { \
+ EVLOCK_UNLOCK2((buffer1)->lock, (buffer2)->lock, 0, 0); \
+ } while (0)
+
+/** Increase the reference count of buf by one. */
+void evbuffer_incref_(struct evbuffer *buf);
+/** Increase the reference count of buf by one and acquire the lock. */
+void evbuffer_incref_and_lock_(struct evbuffer *buf);
+/** Pin a single buffer chain using a given flag. A pinned chunk may not be
+ * moved or freed until it is unpinned. */
+void evbuffer_chain_pin_(struct evbuffer_chain *chain, unsigned flag);
+/** Unpin a single buffer chain using a given flag. */
+void evbuffer_chain_unpin_(struct evbuffer_chain *chain, unsigned flag);
+/** As evbuffer_free, but requires that we hold a lock on the buffer, and
+ * releases the lock before freeing it and the buffer. */
+void evbuffer_decref_and_unlock_(struct evbuffer *buffer);
+
+/** As evbuffer_expand, but does not guarantee that the newly allocated memory
+ * is contiguous. Instead, it may be split across two or more chunks. */
+int evbuffer_expand_fast_(struct evbuffer *, size_t, int);
+
+/** Helper: prepares for a readv/WSARecv call by expanding the buffer to
+ * hold enough memory to read 'howmuch' bytes in possibly noncontiguous memory.
+ * Sets up the one or two iovecs in 'vecs' to point to the free memory and its
+ * extent, and *chainp to point to the first chain that we'll try to read into.
+ * Returns the number of vecs used.
+ */
+int evbuffer_read_setup_vecs_(struct evbuffer *buf, ev_ssize_t howmuch,
+ struct evbuffer_iovec *vecs, int n_vecs, struct evbuffer_chain ***chainp,
+ int exact);
+
+/* Helper macro: copies an evbuffer_iovec in ei to a win32 WSABUF in i. */
+#define WSABUF_FROM_EVBUFFER_IOV(i,ei) do { \
+ (i)->buf = (ei)->iov_base; \
+ (i)->len = (unsigned long)(ei)->iov_len; \
+ } while (0)
+/* XXXX the cast above is safe for now, but not if we allow mmaps on win64.
+ * See note in buffer_iocp's launch_write function */
+
+/** Set the parent bufferevent object for buf to bev */
+void evbuffer_set_parent_(struct evbuffer *buf, struct bufferevent *bev);
+
+void evbuffer_invoke_callbacks_(struct evbuffer *buf);
+
+
+int evbuffer_get_callbacks_(struct evbuffer *buffer,
+ struct event_callback **cbs,
+ int max_cbs);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVBUFFER_INTERNAL_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/evconfig-private.h.cmake b/protocols/Telegram/tgl/libevent/evconfig-private.h.cmake
new file mode 100644
index 0000000000..32f04794d2
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/evconfig-private.h.cmake
@@ -0,0 +1,35 @@
+
+#ifndef EVCONFIG_PRIVATE_H_INCLUDED_
+#define EVCONFIG_PRIVATE_H_INCLUDED_
+
+/* Enable extensions on AIX 3, Interix. */
+#cmakedefine _ALL_SOURCE
+
+/* Enable GNU extensions on systems that have them. */
+#cmakedefine _GNU_SOURCE 1
+
+/* Enable threading extensions on Solaris. */
+#cmakedefine _POSIX_PTHREAD_SEMANTICS 1
+
+/* Enable extensions on HP NonStop. */
+#cmakedefine _TANDEM_SOURCE 1
+
+/* Enable general extensions on Solaris. */
+#cmakedefine __EXTENSIONS__
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#cmakedefine _FILE_OFFSET_BITS 1
+/* Define for large files, on AIX-style hosts. */
+#cmakedefine _LARGE_FILES 1
+
+/* Define to 1 if on MINIX. */
+#cmakedefine _MINIX 1
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+ this defined. */
+#cmakedefine _POSIX_1_SOURCE 1
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#cmakedefine _POSIX_SOURCE 1
+
+#endif
diff --git a/protocols/Telegram/tgl/libevent/evconfig-private.h.in b/protocols/Telegram/tgl/libevent/evconfig-private.h.in
new file mode 100644
index 0000000000..7b3dfdb10e
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/evconfig-private.h.in
@@ -0,0 +1,48 @@
+/* evconfig-private.h template - see "Configuration Header Templates" */
+/* in AC manual. Kevin Bowling <kevin.bowling@kev009.com */
+#ifndef EVCONFIG_PRIVATE_H_INCLUDED_
+#define EVCONFIG_PRIVATE_H_INCLUDED_
+
+/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+/* Define to 1 if on MINIX. */
+#ifndef _MINIX
+#undef _MINIX
+#endif
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+ this defined. */
+#ifndef _POSIX_1_SOURCE
+#undef _POSIX_1_SOURCE
+#endif
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#ifndef _POSIX_SOURCE
+#undef _POSIX_SOURCE
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/libevent/evdns.3 b/protocols/Telegram/tgl/libevent/evdns.3
new file mode 100644
index 0000000000..10414fa2ef
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/evdns.3
@@ -0,0 +1,322 @@
+.\"
+.\" Copyright (c) 2006 Niels Provos <provos@citi.umich.edu>
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\"
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 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 ``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.
+.\"
+.Dd October 7, 2006
+.Dt EVDNS 3
+.Os
+.Sh NAME
+.Nm evdns_init
+.Nm evdns_shutdown
+.Nm evdns_err_to_string
+.Nm evdns_nameserver_add
+.Nm evdns_count_nameservers
+.Nm evdns_clear_nameservers_and_suspend
+.Nm evdns_resume
+.Nm evdns_nameserver_ip_add
+.Nm evdns_resolve_ipv4
+.Nm evdns_resolve_reverse
+.Nm evdns_resolv_conf_parse
+.Nm evdns_config_windows_nameservers
+.Nm evdns_search_clear
+.Nm evdns_search_add
+.Nm evdns_search_ndots_set
+.Nm evdns_set_log_fn
+.Nd asynchronous functions for DNS resolution.
+.Sh SYNOPSIS
+.Fd #include <sys/time.h>
+.Fd #include <event.h>
+.Fd #include <evdns.h>
+.Ft int
+.Fn evdns_init
+.Ft void
+.Fn evdns_shutdown "int fail_requests"
+.Ft "const char *"
+.Fn evdns_err_to_string "int err"
+.Ft int
+.Fn evdns_nameserver_add "unsigned long int address"
+.Ft int
+.Fn evdns_count_nameservers
+.Ft int
+.Fn evdns_clear_nameservers_and_suspend
+.Ft int
+.Fn evdns_resume
+.Ft int
+.Fn evdns_nameserver_ip_add(const char *ip_as_string);
+.Ft int
+.Fn evdns_resolve_ipv4 "const char *name" "int flags" "evdns_callback_type callback" "void *ptr"
+.Ft int
+.Fn evdns_resolve_reverse "struct in_addr *in" "int flags" "evdns_callback_type callback" "void *ptr"
+.Ft int
+.Fn evdns_resolv_conf_parse "int flags" "const char *"
+.Ft void
+.Fn evdns_search_clear
+.Ft void
+.Fn evdns_search_add "const char *domain"
+.Ft void
+.Fn evdns_search_ndots_set "const int ndots"
+.Ft void
+.Fn evdns_set_log_fn "evdns_debug_log_fn_type fn"
+.Ft int
+.Fn evdns_config_windows_nameservers
+.Sh DESCRIPTION
+Welcome, gentle reader
+.Pp
+Async DNS lookups are really a whole lot harder than they should be,
+mostly stemming from the fact that the libc resolver has never been
+very good at them. Before you use this library you should see if libc
+can do the job for you with the modern async call getaddrinfo_a
+(see http://www.imperialviolet.org/page25.html#e498). Otherwise,
+please continue.
+.Pp
+This code is based on libevent and you must call event_init before
+any of the APIs in this file. You must also seed the OpenSSL random
+source if you are using OpenSSL for ids (see below).
+.Pp
+This library is designed to be included and shipped with your source
+code. You statically link with it. You should also test for the
+existence of strtok_r and define HAVE_STRTOK_R if you have it.
+.Pp
+The DNS protocol requires a good source of id numbers and these
+numbers should be unpredictable for spoofing reasons. There are
+three methods for generating them here and you must define exactly
+one of them. In increasing order of preference:
+.Pp
+.Bl -tag -width "DNS_USE_GETTIMEOFDAY_FOR_ID" -compact -offset indent
+.It DNS_USE_GETTIMEOFDAY_FOR_ID
+Using the bottom 16 bits of the usec result from gettimeofday. This
+is a pretty poor solution but should work anywhere.
+.It DNS_USE_CPU_CLOCK_FOR_ID
+Using the bottom 16 bits of the nsec result from the CPU's time
+counter. This is better, but may not work everywhere. Requires
+POSIX realtime support and you'll need to link against -lrt on
+glibc systems at least.
+.It DNS_USE_OPENSSL_FOR_ID
+Uses the OpenSSL RAND_bytes call to generate the data. You must
+have seeded the pool before making any calls to this library.
+.El
+.Pp
+The library keeps track of the state of nameservers and will avoid
+them when they go down. Otherwise it will round robin between them.
+.Pp
+Quick start guide:
+ #include "evdns.h"
+ void callback(int result, char type, int count, int ttl,
+ void *addresses, void *arg);
+ evdns_resolv_conf_parse(DNS_OPTIONS_ALL, "/etc/resolv.conf");
+ evdns_resolve("www.hostname.com", 0, callback, NULL);
+.Pp
+When the lookup is complete the callback function is called. The
+first argument will be one of the DNS_ERR_* defines in evdns.h.
+Hopefully it will be DNS_ERR_NONE, in which case type will be
+DNS_IPv4_A, count will be the number of IP addresses, ttl is the time
+which the data can be cached for (in seconds), addresses will point
+to an array of uint32_t's and arg will be whatever you passed to
+evdns_resolve.
+.Pp
+Searching:
+.Pp
+In order for this library to be a good replacement for glibc's resolver it
+supports searching. This involves setting a list of default domains, in
+which names will be queried for. The number of dots in the query name
+determines the order in which this list is used.
+.Pp
+Searching appears to be a single lookup from the point of view of the API,
+although many DNS queries may be generated from a single call to
+evdns_resolve. Searching can also drastically slow down the resolution
+of names.
+.Pp
+To disable searching:
+.Bl -enum -compact -offset indent
+.It
+Never set it up. If you never call
+.Fn evdns_resolv_conf_parse,
+.Fn evdns_init,
+or
+.Fn evdns_search_add
+then no searching will occur.
+.It
+If you do call
+.Fn evdns_resolv_conf_parse
+then don't pass
+.Va DNS_OPTION_SEARCH
+(or
+.Va DNS_OPTIONS_ALL,
+which implies it).
+.It
+When calling
+.Fn evdns_resolve,
+pass the
+.Va DNS_QUERY_NO_SEARCH
+flag.
+.El
+.Pp
+The order of searches depends on the number of dots in the name. If the
+number is greater than the ndots setting then the names is first tried
+globally. Otherwise each search domain is appended in turn.
+.Pp
+The ndots setting can either be set from a resolv.conf, or by calling
+evdns_search_ndots_set.
+.Pp
+For example, with ndots set to 1 (the default) and a search domain list of
+["myhome.net"]:
+ Query: www
+ Order: www.myhome.net, www.
+.Pp
+ Query: www.abc
+ Order: www.abc., www.abc.myhome.net
+.Pp
+.Sh API reference
+.Pp
+.Bl -tag -width 0123456
+.It Ft int Fn evdns_init
+Initializes support for non-blocking name resolution by calling
+.Fn evdns_resolv_conf_parse
+on UNIX and
+.Fn evdns_config_windows_nameservers
+on Windows.
+.It Ft int Fn evdns_nameserver_add "unsigned long int address"
+Add a nameserver. The address should be an IP address in
+network byte order. The type of address is chosen so that
+it matches in_addr.s_addr.
+Returns non-zero on error.
+.It Ft int Fn evdns_nameserver_ip_add "const char *ip_as_string"
+This wraps the above function by parsing a string as an IP
+address and adds it as a nameserver.
+Returns non-zero on error
+.It Ft int Fn evdns_resolve "const char *name" "int flags" "evdns_callback_type callback" "void *ptr"
+Resolve a name. The name parameter should be a DNS name.
+The flags parameter should be 0, or DNS_QUERY_NO_SEARCH
+which disables searching for this query. (see defn of
+searching above).
+.Pp
+The callback argument is a function which is called when
+this query completes and ptr is an argument which is passed
+to that callback function.
+.Pp
+Returns non-zero on error
+.It Ft void Fn evdns_search_clear
+Clears the list of search domains
+.It Ft void Fn evdns_search_add "const char *domain"
+Add a domain to the list of search domains
+.It Ft void Fn evdns_search_ndots_set "int ndots"
+Set the number of dots which, when found in a name, causes
+the first query to be without any search domain.
+.It Ft int Fn evdns_count_nameservers "void"
+Return the number of configured nameservers (not necessarily the
+number of running nameservers). This is useful for double-checking
+whether our calls to the various nameserver configuration functions
+have been successful.
+.It Ft int Fn evdns_clear_nameservers_and_suspend "void"
+Remove all currently configured nameservers, and suspend all pending
+resolves. Resolves will not necessarily be re-attempted until
+evdns_resume() is called.
+.It Ft int Fn evdns_resume "void"
+Re-attempt resolves left in limbo after an earlier call to
+evdns_clear_nameservers_and_suspend().
+.It Ft int Fn evdns_config_windows_nameservers "void"
+Attempt to configure a set of nameservers based on platform settings on
+a win32 host. Preferentially tries to use GetNetworkParams; if that fails,
+looks in the registry. Returns 0 on success, nonzero on failure.
+.It Ft int Fn evdns_resolv_conf_parse "int flags" "const char *filename"
+Parse a resolv.conf like file from the given filename.
+.Pp
+See the man page for resolv.conf for the format of this file.
+The flags argument determines what information is parsed from
+this file:
+.Bl -tag -width "DNS_OPTION_NAMESERVERS" -offset indent -compact -nested
+.It DNS_OPTION_SEARCH
+domain, search and ndots options
+.It DNS_OPTION_NAMESERVERS
+nameserver lines
+.It DNS_OPTION_MISC
+timeout and attempts options
+.It DNS_OPTIONS_ALL
+all of the above
+.El
+.Pp
+The following directives are not parsed from the file:
+ sortlist, rotate, no-check-names, inet6, debug
+.Pp
+Returns non-zero on error:
+.Bl -tag -width "0" -offset indent -compact -nested
+.It 0
+no errors
+.It 1
+failed to open file
+.It 2
+failed to stat file
+.It 3
+file too large
+.It 4
+out of memory
+.It 5
+short read from file
+.El
+.El
+.Sh Internals:
+Requests are kept in two queues. The first is the inflight queue. In
+this queue requests have an allocated transaction id and nameserver.
+They will soon be transmitted if they haven't already been.
+.Pp
+The second is the waiting queue. The size of the inflight ring is
+limited and all other requests wait in waiting queue for space. This
+bounds the number of concurrent requests so that we don't flood the
+nameserver. Several algorithms require a full walk of the inflight
+queue and so bounding its size keeps thing going nicely under huge
+(many thousands of requests) loads.
+.Pp
+If a nameserver loses too many requests it is considered down and we
+try not to use it. After a while we send a probe to that nameserver
+(a lookup for google.com) and, if it replies, we consider it working
+again. If the nameserver fails a probe we wait longer to try again
+with the next probe.
+.Sh SEE ALSO
+.Xr event 3 ,
+.Xr gethostbyname 3 ,
+.Xr resolv.conf 5
+.Sh HISTORY
+The
+.Nm evdns
+API was developed by Adam Langley on top of the
+.Nm libevent
+API.
+The code was integrate into
+.Nm Tor
+by Nick Mathewson and finally put into
+.Nm libevent
+itself by Niels Provos.
+.Sh AUTHORS
+The
+.Nm evdns
+API and code was written by Adam Langley with significant
+contributions by Nick Mathewson.
+.Sh BUGS
+This documentation is neither complete nor authoritative.
+If you are in doubt about the usage of this API then
+check the source code to find out how it works, write
+up the missing piece of documentation and send it to
+me for inclusion in this man page.
diff --git a/protocols/Telegram/tgl/libevent/evdns.c b/protocols/Telegram/tgl/libevent/evdns.c
new file mode 100644
index 0000000000..c4112330a9
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/evdns.c
@@ -0,0 +1,4761 @@
+/* Copyright 2006-2007 Niels Provos
+ * Copyright 2007-2012 Nick Mathewson and Niels Provos
+ *
+ * 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.
+ */
+
+/* Based on software by Adam Langly. Adam's original message:
+ *
+ * Async DNS Library
+ * Adam Langley <agl@imperialviolet.org>
+ * http://www.imperialviolet.org/eventdns.html
+ * Public Domain code
+ *
+ * This software is Public Domain. To view a copy of the public domain dedication,
+ * visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
+ * Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
+ *
+ * I ask and expect, but do not require, that all derivative works contain an
+ * attribution similar to:
+ * Parts developed by Adam Langley <agl@imperialviolet.org>
+ *
+ * You may wish to replace the word "Parts" with something else depending on
+ * the amount of original code.
+ *
+ * (Derivative works does not include programs which link against, run or include
+ * the source verbatim in their source distributions)
+ *
+ * Version: 0.1b
+ */
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#include <sys/types.h>
+
+#ifndef _FORTIFY_SOURCE
+#define _FORTIFY_SOURCE 3
+#endif
+
+#include <string.h>
+#include <fcntl.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef EVENT__HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <limits.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <stdarg.h>
+#ifdef _WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#ifndef _WIN32_IE
+#define _WIN32_IE 0x400
+#endif
+#include <shlobj.h>
+#endif
+
+#include "event2/dns.h"
+#include "event2/dns_struct.h"
+#include "event2/dns_compat.h"
+#include "event2/util.h"
+#include "event2/event.h"
+#include "event2/event_struct.h"
+#include "event2/thread.h"
+
+#include "defer-internal.h"
+#include "log-internal.h"
+#include "mm-internal.h"
+#include "strlcpy-internal.h"
+#include "ipv6-internal.h"
+#include "util-internal.h"
+#include "evthread-internal.h"
+#ifdef _WIN32
+#include <ctype.h>
+#include <winsock2.h>
+#include <windows.h>
+#include <iphlpapi.h>
+#include <io.h>
+#else
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#endif
+
+#ifdef EVENT__HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+
+#define EVDNS_LOG_DEBUG EVENT_LOG_DEBUG
+#define EVDNS_LOG_WARN EVENT_LOG_WARN
+#define EVDNS_LOG_MSG EVENT_LOG_MSG
+
+#ifndef HOST_NAME_MAX
+#define HOST_NAME_MAX 255
+#endif
+
+#include <stdio.h>
+
+#undef MIN
+#define MIN(a,b) ((a)<(b)?(a):(b))
+
+#define ASSERT_VALID_REQUEST(req) \
+ EVUTIL_ASSERT((req)->handle && (req)->handle->current_req == (req))
+
+#define u64 ev_uint64_t
+#define u32 ev_uint32_t
+#define u16 ev_uint16_t
+#define u8 ev_uint8_t
+
+/* maximum number of addresses from a single packet */
+/* that we bother recording */
+#define MAX_V4_ADDRS 32
+#define MAX_V6_ADDRS 32
+
+
+#define TYPE_A EVDNS_TYPE_A
+#define TYPE_CNAME 5
+#define TYPE_PTR EVDNS_TYPE_PTR
+#define TYPE_SOA EVDNS_TYPE_SOA
+#define TYPE_AAAA EVDNS_TYPE_AAAA
+
+#define CLASS_INET EVDNS_CLASS_INET
+
+/* Persistent handle. We keep this separate from 'struct request' since we
+ * need some object to last for as long as an evdns_request is outstanding so
+ * that it can be canceled, whereas a search request can lead to multiple
+ * 'struct request' instances being created over its lifetime. */
+struct evdns_request {
+ struct request *current_req;
+ struct evdns_base *base;
+
+ int pending_cb; /* Waiting for its callback to be invoked; not
+ * owned by event base any more. */
+
+ /* elements used by the searching code */
+ int search_index;
+ struct search_state *search_state;
+ char *search_origname; /* needs to be free()ed */
+ int search_flags;
+};
+
+struct request {
+ u8 *request; /* the dns packet data */
+ u8 request_type; /* TYPE_PTR or TYPE_A or TYPE_AAAA */
+ unsigned int request_len;
+ int reissue_count;
+ int tx_count; /* the number of times that this packet has been sent */
+ void *user_pointer; /* the pointer given to us for this request */
+ evdns_callback_type user_callback;
+ struct nameserver *ns; /* the server which we last sent it */
+
+ /* these objects are kept in a circular list */
+ /* XXX We could turn this into a CIRCLEQ. */
+ struct request *next, *prev;
+
+ struct event timeout_event;
+
+ u16 trans_id; /* the transaction id */
+ unsigned request_appended :1; /* true if the request pointer is data which follows this struct */
+ unsigned transmit_me :1; /* needs to be transmitted */
+
+ /* XXXX This is a horrible hack. */
+ char **put_cname_in_ptr; /* store the cname here if we get one. */
+
+ struct evdns_base *base;
+
+ struct evdns_request *handle;
+};
+
+struct reply {
+ unsigned int type;
+ unsigned int have_answer : 1;
+ union {
+ struct {
+ u32 addrcount;
+ u32 addresses[MAX_V4_ADDRS];
+ } a;
+ struct {
+ u32 addrcount;
+ struct in6_addr addresses[MAX_V6_ADDRS];
+ } aaaa;
+ struct {
+ char name[HOST_NAME_MAX];
+ } ptr;
+ } data;
+};
+
+struct nameserver {
+ evutil_socket_t socket; /* a connected UDP socket */
+ struct sockaddr_storage address;
+ ev_socklen_t addrlen;
+ int failed_times; /* number of times which we have given this server a chance */
+ int timedout; /* number of times in a row a request has timed out */
+ struct event event;
+ /* these objects are kept in a circular list */
+ struct nameserver *next, *prev;
+ struct event timeout_event; /* used to keep the timeout for */
+ /* when we next probe this server. */
+ /* Valid if state == 0 */
+ /* Outstanding probe request for this nameserver, if any */
+ struct evdns_request *probe_request;
+ char state; /* zero if we think that this server is down */
+ char choked; /* true if we have an EAGAIN from this server's socket */
+ char write_waiting; /* true if we are waiting for EV_WRITE events */
+ struct evdns_base *base;
+
+ /* Number of currently inflight requests: used
+ * to track when we should add/del the event. */
+ int requests_inflight;
+};
+
+
+/* Represents a local port where we're listening for DNS requests. Right now, */
+/* only UDP is supported. */
+struct evdns_server_port {
+ evutil_socket_t socket; /* socket we use to read queries and write replies. */
+ int refcnt; /* reference count. */
+ char choked; /* Are we currently blocked from writing? */
+ char closing; /* Are we trying to close this port, pending writes? */
+ evdns_request_callback_fn_type user_callback; /* Fn to handle requests */
+ void *user_data; /* Opaque pointer passed to user_callback */
+ struct event event; /* Read/write event */
+ /* circular list of replies that we want to write. */
+ struct server_request *pending_replies;
+ struct event_base *event_base;
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ void *lock;
+#endif
+};
+
+/* Represents part of a reply being built. (That is, a single RR.) */
+struct server_reply_item {
+ struct server_reply_item *next; /* next item in sequence. */
+ char *name; /* name part of the RR */
+ u16 type; /* The RR type */
+ u16 class; /* The RR class (usually CLASS_INET) */
+ u32 ttl; /* The RR TTL */
+ char is_name; /* True iff data is a label */
+ u16 datalen; /* Length of data; -1 if data is a label */
+ void *data; /* The contents of the RR */
+};
+
+/* Represents a request that we've received as a DNS server, and holds */
+/* the components of the reply as we're constructing it. */
+struct server_request {
+ /* Pointers to the next and previous entries on the list of replies */
+ /* that we're waiting to write. Only set if we have tried to respond */
+ /* and gotten EAGAIN. */
+ struct server_request *next_pending;
+ struct server_request *prev_pending;
+
+ u16 trans_id; /* Transaction id. */
+ struct evdns_server_port *port; /* Which port received this request on? */
+ struct sockaddr_storage addr; /* Where to send the response */
+ ev_socklen_t addrlen; /* length of addr */
+
+ int n_answer; /* how many answer RRs have been set? */
+ int n_authority; /* how many authority RRs have been set? */
+ int n_additional; /* how many additional RRs have been set? */
+
+ struct server_reply_item *answer; /* linked list of answer RRs */
+ struct server_reply_item *authority; /* linked list of authority RRs */
+ struct server_reply_item *additional; /* linked list of additional RRs */
+
+ /* Constructed response. Only set once we're ready to send a reply. */
+ /* Once this is set, the RR fields are cleared, and no more should be set. */
+ char *response;
+ size_t response_len;
+
+ /* Caller-visible fields: flags, questions. */
+ struct evdns_server_request base;
+};
+
+struct evdns_base {
+ /* An array of n_req_heads circular lists for inflight requests.
+ * Each inflight request req is in req_heads[req->trans_id % n_req_heads].
+ */
+ struct request **req_heads;
+ /* A circular list of requests that we're waiting to send, but haven't
+ * sent yet because there are too many requests inflight */
+ struct request *req_waiting_head;
+ /* A circular list of nameservers. */
+ struct nameserver *server_head;
+ int n_req_heads;
+
+ struct event_base *event_base;
+
+ /* The number of good nameservers that we have */
+ int global_good_nameservers;
+
+ /* inflight requests are contained in the req_head list */
+ /* and are actually going out across the network */
+ int global_requests_inflight;
+ /* requests which aren't inflight are in the waiting list */
+ /* and are counted here */
+ int global_requests_waiting;
+
+ int global_max_requests_inflight;
+
+ struct timeval global_timeout; /* 5 seconds by default */
+ int global_max_reissues; /* a reissue occurs when we get some errors from the server */
+ int global_max_retransmits; /* number of times we'll retransmit a request which timed out */
+ /* number of timeouts in a row before we consider this server to be down */
+ int global_max_nameserver_timeout;
+ /* true iff we will use the 0x20 hack to prevent poisoning attacks. */
+ int global_randomize_case;
+
+ /* The first time that a nameserver fails, how long do we wait before
+ * probing to see if it has returned? */
+ struct timeval global_nameserver_probe_initial_timeout;
+
+ /** Port to bind to for outgoing DNS packets. */
+ struct sockaddr_storage global_outgoing_address;
+ /** ev_socklen_t for global_outgoing_address. 0 if it isn't set. */
+ ev_socklen_t global_outgoing_addrlen;
+
+ struct timeval global_getaddrinfo_allow_skew;
+
+ int getaddrinfo_ipv4_timeouts;
+ int getaddrinfo_ipv6_timeouts;
+ int getaddrinfo_ipv4_answered;
+ int getaddrinfo_ipv6_answered;
+
+ struct search_state *global_search_state;
+
+ TAILQ_HEAD(hosts_list, hosts_entry) hostsdb;
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ void *lock;
+#endif
+
+ int disable_when_inactive;
+};
+
+struct hosts_entry {
+ TAILQ_ENTRY(hosts_entry) next;
+ union {
+ struct sockaddr sa;
+ struct sockaddr_in sin;
+ struct sockaddr_in6 sin6;
+ } addr;
+ int addrlen;
+ char hostname[1];
+};
+
+static struct evdns_base *current_base = NULL;
+
+struct evdns_base *
+evdns_get_global_base(void)
+{
+ return current_base;
+}
+
+/* Given a pointer to an evdns_server_request, get the corresponding */
+/* server_request. */
+#define TO_SERVER_REQUEST(base_ptr) \
+ ((struct server_request*) \
+ (((char*)(base_ptr) - evutil_offsetof(struct server_request, base))))
+
+#define REQ_HEAD(base, id) ((base)->req_heads[id % (base)->n_req_heads])
+
+static struct nameserver *nameserver_pick(struct evdns_base *base);
+static void evdns_request_insert(struct request *req, struct request **head);
+static void evdns_request_remove(struct request *req, struct request **head);
+static void nameserver_ready_callback(evutil_socket_t fd, short events, void *arg);
+static int evdns_transmit(struct evdns_base *base);
+static int evdns_request_transmit(struct request *req);
+static void nameserver_send_probe(struct nameserver *const ns);
+static void search_request_finished(struct evdns_request *const);
+static int search_try_next(struct evdns_request *const req);
+static struct request *search_request_new(struct evdns_base *base, struct evdns_request *handle, int type, const char *const name, int flags, evdns_callback_type user_callback, void *user_arg);
+static void evdns_requests_pump_waiting_queue(struct evdns_base *base);
+static u16 transaction_id_pick(struct evdns_base *base);
+static struct request *request_new(struct evdns_base *base, struct evdns_request *handle, int type, const char *name, int flags, evdns_callback_type callback, void *ptr);
+static void request_submit(struct request *const req);
+
+static int server_request_free(struct server_request *req);
+static void server_request_free_answers(struct server_request *req);
+static void server_port_free(struct evdns_server_port *port);
+static void server_port_ready_callback(evutil_socket_t fd, short events, void *arg);
+static int evdns_base_resolv_conf_parse_impl(struct evdns_base *base, int flags, const char *const filename);
+static int evdns_base_set_option_impl(struct evdns_base *base,
+ const char *option, const char *val, int flags);
+static void evdns_base_free_and_unlock(struct evdns_base *base, int fail_requests);
+static void evdns_request_timeout_callback(evutil_socket_t fd, short events, void *arg);
+
+static int strtoint(const char *const str);
+
+#ifdef EVENT__DISABLE_THREAD_SUPPORT
+#define EVDNS_LOCK(base) EVUTIL_NIL_STMT_
+#define EVDNS_UNLOCK(base) EVUTIL_NIL_STMT_
+#define ASSERT_LOCKED(base) EVUTIL_NIL_STMT_
+#else
+#define EVDNS_LOCK(base) \
+ EVLOCK_LOCK((base)->lock, 0)
+#define EVDNS_UNLOCK(base) \
+ EVLOCK_UNLOCK((base)->lock, 0)
+#define ASSERT_LOCKED(base) \
+ EVLOCK_ASSERT_LOCKED((base)->lock)
+#endif
+
+static evdns_debug_log_fn_type evdns_log_fn = NULL;
+
+void
+evdns_set_log_fn(evdns_debug_log_fn_type fn)
+{
+ evdns_log_fn = fn;
+}
+
+#ifdef __GNUC__
+#define EVDNS_LOG_CHECK __attribute__ ((format(printf, 2, 3)))
+#else
+#define EVDNS_LOG_CHECK
+#endif
+
+static void evdns_log_(int severity, const char *fmt, ...) EVDNS_LOG_CHECK;
+static void
+evdns_log_(int severity, const char *fmt, ...)
+{
+ va_list args;
+ va_start(args,fmt);
+ if (evdns_log_fn) {
+ char buf[512];
+ int is_warn = (severity == EVDNS_LOG_WARN);
+ evutil_vsnprintf(buf, sizeof(buf), fmt, args);
+ evdns_log_fn(is_warn, buf);
+ } else {
+ event_logv_(severity, NULL, fmt, args);
+ }
+ va_end(args);
+}
+
+#define log evdns_log_
+
+/* This walks the list of inflight requests to find the */
+/* one with a matching transaction id. Returns NULL on */
+/* failure */
+static struct request *
+request_find_from_trans_id(struct evdns_base *base, u16 trans_id) {
+ struct request *req = REQ_HEAD(base, trans_id);
+ struct request *const started_at = req;
+
+ ASSERT_LOCKED(base);
+
+ if (req) {
+ do {
+ if (req->trans_id == trans_id) return req;
+ req = req->next;
+ } while (req != started_at);
+ }
+
+ return NULL;
+}
+
+/* a libevent callback function which is called when a nameserver */
+/* has gone down and we want to test if it has came back to life yet */
+static void
+nameserver_prod_callback(evutil_socket_t fd, short events, void *arg) {
+ struct nameserver *const ns = (struct nameserver *) arg;
+ (void)fd;
+ (void)events;
+
+ EVDNS_LOCK(ns->base);
+ nameserver_send_probe(ns);
+ EVDNS_UNLOCK(ns->base);
+}
+
+/* a libevent callback which is called when a nameserver probe (to see if */
+/* it has come back to life) times out. We increment the count of failed_times */
+/* and wait longer to send the next probe packet. */
+static void
+nameserver_probe_failed(struct nameserver *const ns) {
+ struct timeval timeout;
+ int i;
+
+ ASSERT_LOCKED(ns->base);
+ (void) evtimer_del(&ns->timeout_event);
+ if (ns->state == 1) {
+ /* This can happen if the nameserver acts in a way which makes us mark */
+ /* it as bad and then starts sending good replies. */
+ return;
+ }
+
+#define MAX_PROBE_TIMEOUT 3600
+#define TIMEOUT_BACKOFF_FACTOR 3
+
+ memcpy(&timeout, &ns->base->global_nameserver_probe_initial_timeout,
+ sizeof(struct timeval));
+ for (i=ns->failed_times; i > 0 && timeout.tv_sec < MAX_PROBE_TIMEOUT; --i) {
+ timeout.tv_sec *= TIMEOUT_BACKOFF_FACTOR;
+ timeout.tv_usec *= TIMEOUT_BACKOFF_FACTOR;
+ if (timeout.tv_usec > 1000000) {
+ timeout.tv_sec += timeout.tv_usec / 1000000;
+ timeout.tv_usec %= 1000000;
+ }
+ }
+ if (timeout.tv_sec > MAX_PROBE_TIMEOUT) {
+ timeout.tv_sec = MAX_PROBE_TIMEOUT;
+ timeout.tv_usec = 0;
+ }
+
+ ns->failed_times++;
+
+ if (evtimer_add(&ns->timeout_event, &timeout) < 0) {
+ char addrbuf[128];
+ log(EVDNS_LOG_WARN,
+ "Error from libevent when adding timer event for %s",
+ evutil_format_sockaddr_port_(
+ (struct sockaddr *)&ns->address,
+ addrbuf, sizeof(addrbuf)));
+ }
+}
+
+static void
+request_swap_ns(struct request *req, struct nameserver *ns) {
+ if (ns && req->ns != ns) {
+ EVUTIL_ASSERT(req->ns->requests_inflight > 0);
+ req->ns->requests_inflight--;
+ ns->requests_inflight++;
+
+ req->ns = ns;
+ }
+}
+
+/* called when a nameserver has been deemed to have failed. For example, too */
+/* many packets have timed out etc */
+static void
+nameserver_failed(struct nameserver *const ns, const char *msg) {
+ struct request *req, *started_at;
+ struct evdns_base *base = ns->base;
+ int i;
+ char addrbuf[128];
+
+ ASSERT_LOCKED(base);
+ /* if this nameserver has already been marked as failed */
+ /* then don't do anything */
+ if (!ns->state) return;
+
+ log(EVDNS_LOG_MSG, "Nameserver %s has failed: %s",
+ evutil_format_sockaddr_port_(
+ (struct sockaddr *)&ns->address,
+ addrbuf, sizeof(addrbuf)),
+ msg);
+
+ base->global_good_nameservers--;
+ EVUTIL_ASSERT(base->global_good_nameservers >= 0);
+ if (base->global_good_nameservers == 0) {
+ log(EVDNS_LOG_MSG, "All nameservers have failed");
+ }
+
+ ns->state = 0;
+ ns->failed_times = 1;
+
+ if (evtimer_add(&ns->timeout_event,
+ &base->global_nameserver_probe_initial_timeout) < 0) {
+ log(EVDNS_LOG_WARN,
+ "Error from libevent when adding timer event for %s",
+ evutil_format_sockaddr_port_(
+ (struct sockaddr *)&ns->address,
+ addrbuf, sizeof(addrbuf)));
+ /* ???? Do more? */
+ }
+
+ /* walk the list of inflight requests to see if any can be reassigned to */
+ /* a different server. Requests in the waiting queue don't have a */
+ /* nameserver assigned yet */
+
+ /* if we don't have *any* good nameservers then there's no point */
+ /* trying to reassign requests to one */
+ if (!base->global_good_nameservers) return;
+
+ for (i = 0; i < base->n_req_heads; ++i) {
+ req = started_at = base->req_heads[i];
+ if (req) {
+ do {
+ if (req->tx_count == 0 && req->ns == ns) {
+ /* still waiting to go out, can be moved */
+ /* to another server */
+ request_swap_ns(req, nameserver_pick(base));
+ }
+ req = req->next;
+ } while (req != started_at);
+ }
+ }
+}
+
+static void
+nameserver_up(struct nameserver *const ns)
+{
+ char addrbuf[128];
+ ASSERT_LOCKED(ns->base);
+ if (ns->state) return;
+ log(EVDNS_LOG_MSG, "Nameserver %s is back up",
+ evutil_format_sockaddr_port_(
+ (struct sockaddr *)&ns->address,
+ addrbuf, sizeof(addrbuf)));
+ evtimer_del(&ns->timeout_event);
+ if (ns->probe_request) {
+ evdns_cancel_request(ns->base, ns->probe_request);
+ ns->probe_request = NULL;
+ }
+ ns->state = 1;
+ ns->failed_times = 0;
+ ns->timedout = 0;
+ ns->base->global_good_nameservers++;
+}
+
+static void
+request_trans_id_set(struct request *const req, const u16 trans_id) {
+ req->trans_id = trans_id;
+ *((u16 *) req->request) = htons(trans_id);
+}
+
+/* Called to remove a request from a list and dealloc it. */
+/* head is a pointer to the head of the list it should be */
+/* removed from or NULL if the request isn't in a list. */
+/* when free_handle is one, free the handle as well. */
+static void
+request_finished(struct request *const req, struct request **head, int free_handle) {
+ struct evdns_base *base = req->base;
+ int was_inflight = (head != &base->req_waiting_head);
+ EVDNS_LOCK(base);
+ ASSERT_VALID_REQUEST(req);
+
+ if (head)
+ evdns_request_remove(req, head);
+
+ log(EVDNS_LOG_DEBUG, "Removing timeout for request %p", req);
+ if (was_inflight) {
+ evtimer_del(&req->timeout_event);
+ base->global_requests_inflight--;
+ req->ns->requests_inflight--;
+ } else {
+ base->global_requests_waiting--;
+ }
+ /* it was initialized during request_new / evtimer_assign */
+ event_debug_unassign(&req->timeout_event);
+
+ if (req->ns &&
+ req->ns->requests_inflight == 0 &&
+ req->base->disable_when_inactive) {
+ event_del(&req->ns->event);
+ evtimer_del(&req->ns->timeout_event);
+ }
+
+ if (!req->request_appended) {
+ /* need to free the request data on it's own */
+ mm_free(req->request);
+ } else {
+ /* the request data is appended onto the header */
+ /* so everything gets free()ed when we: */
+ }
+
+ if (req->handle) {
+ EVUTIL_ASSERT(req->handle->current_req == req);
+
+ if (free_handle) {
+ search_request_finished(req->handle);
+ req->handle->current_req = NULL;
+ if (! req->handle->pending_cb) {
+ /* If we're planning to run the callback,
+ * don't free the handle until later. */
+ mm_free(req->handle);
+ }
+ req->handle = NULL; /* If we have a bug, let's crash
+ * early */
+ } else {
+ req->handle->current_req = NULL;
+ }
+ }
+
+ mm_free(req);
+
+ evdns_requests_pump_waiting_queue(base);
+ EVDNS_UNLOCK(base);
+}
+
+/* This is called when a server returns a funny error code. */
+/* We try the request again with another server. */
+/* */
+/* return: */
+/* 0 ok */
+/* 1 failed/reissue is pointless */
+static int
+request_reissue(struct request *req) {
+ const struct nameserver *const last_ns = req->ns;
+ ASSERT_LOCKED(req->base);
+ ASSERT_VALID_REQUEST(req);
+ /* the last nameserver should have been marked as failing */
+ /* by the caller of this function, therefore pick will try */
+ /* not to return it */
+ request_swap_ns(req, nameserver_pick(req->base));
+ if (req->ns == last_ns) {
+ /* ... but pick did return it */
+ /* not a lot of point in trying again with the */
+ /* same server */
+ return 1;
+ }
+
+ req->reissue_count++;
+ req->tx_count = 0;
+ req->transmit_me = 1;
+
+ return 0;
+}
+
+/* this function looks for space on the inflight queue and promotes */
+/* requests from the waiting queue if it can. */
+/* */
+/* TODO: */
+/* add return code, see at nameserver_pick() and other functions. */
+static void
+evdns_requests_pump_waiting_queue(struct evdns_base *base) {
+ ASSERT_LOCKED(base);
+ while (base->global_requests_inflight < base->global_max_requests_inflight &&
+ base->global_requests_waiting) {
+ struct request *req;
+
+ EVUTIL_ASSERT(base->req_waiting_head);
+ req = base->req_waiting_head;
+
+ req->ns = nameserver_pick(base);
+ if (!req->ns)
+ return;
+
+ /* move a request from the waiting queue to the inflight queue */
+ req->ns->requests_inflight++;
+
+ evdns_request_remove(req, &base->req_waiting_head);
+
+ base->global_requests_waiting--;
+ base->global_requests_inflight++;
+
+ request_trans_id_set(req, transaction_id_pick(base));
+
+ evdns_request_insert(req, &REQ_HEAD(base, req->trans_id));
+ evdns_request_transmit(req);
+ evdns_transmit(base);
+ }
+}
+
+/* TODO(nickm) document */
+struct deferred_reply_callback {
+ struct event_callback deferred;
+ struct evdns_request *handle;
+ u8 request_type;
+ u8 have_reply;
+ u32 ttl;
+ u32 err;
+ evdns_callback_type user_callback;
+ struct reply reply;
+};
+
+static void
+reply_run_callback(struct event_callback *d, void *user_pointer)
+{
+ struct deferred_reply_callback *cb =
+ EVUTIL_UPCAST(d, struct deferred_reply_callback, deferred);
+
+ switch (cb->request_type) {
+ case TYPE_A:
+ if (cb->have_reply)
+ cb->user_callback(DNS_ERR_NONE, DNS_IPv4_A,
+ cb->reply.data.a.addrcount, cb->ttl,
+ cb->reply.data.a.addresses,
+ user_pointer);
+ else
+ cb->user_callback(cb->err, 0, 0, cb->ttl, NULL, user_pointer);
+ break;
+ case TYPE_PTR:
+ if (cb->have_reply) {
+ char *name = cb->reply.data.ptr.name;
+ cb->user_callback(DNS_ERR_NONE, DNS_PTR, 1, cb->ttl,
+ &name, user_pointer);
+ } else {
+ cb->user_callback(cb->err, 0, 0, cb->ttl, NULL, user_pointer);
+ }
+ break;
+ case TYPE_AAAA:
+ if (cb->have_reply)
+ cb->user_callback(DNS_ERR_NONE, DNS_IPv6_AAAA,
+ cb->reply.data.aaaa.addrcount, cb->ttl,
+ cb->reply.data.aaaa.addresses,
+ user_pointer);
+ else
+ cb->user_callback(cb->err, 0, 0, cb->ttl, NULL, user_pointer);
+ break;
+ default:
+ EVUTIL_ASSERT(0);
+ }
+
+ if (cb->handle && cb->handle->pending_cb) {
+ mm_free(cb->handle);
+ }
+
+ mm_free(cb);
+}
+
+static void
+reply_schedule_callback(struct request *const req, u32 ttl, u32 err, struct reply *reply)
+{
+ struct deferred_reply_callback *d = mm_calloc(1, sizeof(*d));
+
+ if (!d) {
+ event_warn("%s: Couldn't allocate space for deferred callback.",
+ __func__);
+ return;
+ }
+
+ ASSERT_LOCKED(req->base);
+
+ d->request_type = req->request_type;
+ d->user_callback = req->user_callback;
+ d->ttl = ttl;
+ d->err = err;
+ if (reply) {
+ d->have_reply = 1;
+ memcpy(&d->reply, reply, sizeof(struct reply));
+ }
+
+ if (req->handle) {
+ req->handle->pending_cb = 1;
+ d->handle = req->handle;
+ }
+
+ event_deferred_cb_init_(
+ &d->deferred,
+ event_get_priority(&req->timeout_event),
+ reply_run_callback,
+ req->user_pointer);
+ event_deferred_cb_schedule_(
+ req->base->event_base,
+ &d->deferred);
+}
+
+/* this processes a parsed reply packet */
+static void
+reply_handle(struct request *const req, u16 flags, u32 ttl, struct reply *reply) {
+ int error;
+ char addrbuf[128];
+ static const int error_codes[] = {
+ DNS_ERR_FORMAT, DNS_ERR_SERVERFAILED, DNS_ERR_NOTEXIST,
+ DNS_ERR_NOTIMPL, DNS_ERR_REFUSED
+ };
+
+ ASSERT_LOCKED(req->base);
+ ASSERT_VALID_REQUEST(req);
+
+ if (flags & 0x020f || !reply || !reply->have_answer) {
+ /* there was an error */
+ if (flags & 0x0200) {
+ error = DNS_ERR_TRUNCATED;
+ } else if (flags & 0x000f) {
+ u16 error_code = (flags & 0x000f) - 1;
+ if (error_code > 4) {
+ error = DNS_ERR_UNKNOWN;
+ } else {
+ error = error_codes[error_code];
+ }
+ } else if (reply && !reply->have_answer) {
+ error = DNS_ERR_NODATA;
+ } else {
+ error = DNS_ERR_UNKNOWN;
+ }
+
+ switch (error) {
+ case DNS_ERR_NOTIMPL:
+ case DNS_ERR_REFUSED:
+ /* we regard these errors as marking a bad nameserver */
+ if (req->reissue_count < req->base->global_max_reissues) {
+ char msg[64];
+ evutil_snprintf(msg, sizeof(msg), "Bad response %d (%s)",
+ error, evdns_err_to_string(error));
+ nameserver_failed(req->ns, msg);
+ if (!request_reissue(req)) return;
+ }
+ break;
+ case DNS_ERR_SERVERFAILED:
+ /* rcode 2 (servfailed) sometimes means "we
+ * are broken" and sometimes (with some binds)
+ * means "that request was very confusing."
+ * Treat this as a timeout, not a failure.
+ */
+ log(EVDNS_LOG_DEBUG, "Got a SERVERFAILED from nameserver"
+ "at %s; will allow the request to time out.",
+ evutil_format_sockaddr_port_(
+ (struct sockaddr *)&req->ns->address,
+ addrbuf, sizeof(addrbuf)));
+ /* Call the timeout function */
+ evdns_request_timeout_callback(0, 0, req);
+ return;
+ default:
+ /* we got a good reply from the nameserver: it is up. */
+ if (req->handle == req->ns->probe_request) {
+ /* Avoid double-free */
+ req->ns->probe_request = NULL;
+ }
+
+ nameserver_up(req->ns);
+ }
+
+ if (req->handle->search_state &&
+ req->request_type != TYPE_PTR) {
+ /* if we have a list of domains to search in,
+ * try the next one */
+ if (!search_try_next(req->handle)) {
+ /* a new request was issued so this
+ * request is finished and */
+ /* the user callback will be made when
+ * that request (or a */
+ /* child of it) finishes. */
+ return;
+ }
+ }
+
+ /* all else failed. Pass the failure up */
+ reply_schedule_callback(req, ttl, error, NULL);
+ request_finished(req, &REQ_HEAD(req->base, req->trans_id), 1);
+ } else {
+ /* all ok, tell the user */
+ reply_schedule_callback(req, ttl, 0, reply);
+ if (req->handle == req->ns->probe_request)
+ req->ns->probe_request = NULL; /* Avoid double-free */
+ nameserver_up(req->ns);
+ request_finished(req, &REQ_HEAD(req->base, req->trans_id), 1);
+ }
+}
+
+static int
+name_parse(u8 *packet, int length, int *idx, char *name_out, int name_out_len) {
+ int name_end = -1;
+ int j = *idx;
+ int ptr_count = 0;
+#define GET32(x) do { if (j + 4 > length) goto err; memcpy(&t32_, packet + j, 4); j += 4; x = ntohl(t32_); } while (0)
+#define GET16(x) do { if (j + 2 > length) goto err; memcpy(&t_, packet + j, 2); j += 2; x = ntohs(t_); } while (0)
+#define GET8(x) do { if (j >= length) goto err; x = packet[j++]; } while (0)
+
+ char *cp = name_out;
+ const char *const end = name_out + name_out_len;
+
+ /* Normally, names are a series of length prefixed strings terminated */
+ /* with a length of 0 (the lengths are u8's < 63). */
+ /* However, the length can start with a pair of 1 bits and that */
+ /* means that the next 14 bits are a pointer within the current */
+ /* packet. */
+
+ for (;;) {
+ u8 label_len;
+ GET8(label_len);
+ if (!label_len) break;
+ if (label_len & 0xc0) {
+ u8 ptr_low;
+ GET8(ptr_low);
+ if (name_end < 0) name_end = j;
+ j = (((int)label_len & 0x3f) << 8) + ptr_low;
+ /* Make sure that the target offset is in-bounds. */
+ if (j < 0 || j >= length) return -1;
+ /* If we've jumped more times than there are characters in the
+ * message, we must have a loop. */
+ if (++ptr_count > length) return -1;
+ continue;
+ }
+ if (label_len > 63) return -1;
+ if (cp != name_out) {
+ if (cp + 1 >= end) return -1;
+ *cp++ = '.';
+ }
+ if (cp + label_len >= end) return -1;
+ if (j + label_len > length) return -1;
+ memcpy(cp, packet + j, label_len);
+ cp += label_len;
+ j += label_len;
+ }
+ if (cp >= end) return -1;
+ *cp = '\0';
+ if (name_end < 0)
+ *idx = j;
+ else
+ *idx = name_end;
+ return 0;
+ err:
+ return -1;
+}
+
+/* parses a raw request from a nameserver */
+static int
+reply_parse(struct evdns_base *base, u8 *packet, int length) {
+ int j = 0, k = 0; /* index into packet */
+ u16 t_; /* used by the macros */
+ u32 t32_; /* used by the macros */
+ char tmp_name[256], cmp_name[256]; /* used by the macros */
+ int name_matches = 0;
+
+ u16 trans_id, questions, answers, authority, additional, datalength;
+ u16 flags = 0;
+ u32 ttl, ttl_r = 0xffffffff;
+ struct reply reply;
+ struct request *req = NULL;
+ unsigned int i;
+
+ ASSERT_LOCKED(base);
+
+ GET16(trans_id);
+ GET16(flags);
+ GET16(questions);
+ GET16(answers);
+ GET16(authority);
+ GET16(additional);
+ (void) authority; /* suppress "unused variable" warnings. */
+ (void) additional; /* suppress "unused variable" warnings. */
+
+ req = request_find_from_trans_id(base, trans_id);
+ if (!req) return -1;
+ EVUTIL_ASSERT(req->base == base);
+
+ memset(&reply, 0, sizeof(reply));
+
+ /* If it's not an answer, it doesn't correspond to any request. */
+ if (!(flags & 0x8000)) return -1; /* must be an answer */
+ if ((flags & 0x020f) && (flags & 0x020f) != DNS_ERR_NOTEXIST) {
+ /* there was an error and it's not NXDOMAIN */
+ goto err;
+ }
+ /* if (!answers) return; */ /* must have an answer of some form */
+
+ /* This macro skips a name in the DNS reply. */
+#define SKIP_NAME \
+ do { tmp_name[0] = '\0'; \
+ if (name_parse(packet, length, &j, tmp_name, \
+ sizeof(tmp_name))<0) \
+ goto err; \
+ } while (0)
+
+ reply.type = req->request_type;
+
+ /* skip over each question in the reply */
+ for (i = 0; i < questions; ++i) {
+ /* the question looks like
+ * <label:name><u16:type><u16:class>
+ */
+ tmp_name[0] = '\0';
+ cmp_name[0] = '\0';
+ k = j;
+ if (name_parse(packet, length, &j, tmp_name, sizeof(tmp_name)) < 0)
+ goto err;
+ if (name_parse(req->request, req->request_len, &k,
+ cmp_name, sizeof(cmp_name))<0)
+ goto err;
+ if (!base->global_randomize_case) {
+ if (strcmp(tmp_name, cmp_name) == 0)
+ name_matches = 1;
+ } else {
+ if (evutil_ascii_strcasecmp(tmp_name, cmp_name) == 0)
+ name_matches = 1;
+ }
+
+ j += 4;
+ if (j > length)
+ goto err;
+ }
+
+ if (!name_matches)
+ goto err;
+
+ /* now we have the answer section which looks like
+ * <label:name><u16:type><u16:class><u32:ttl><u16:len><data...>
+ */
+
+ for (i = 0; i < answers; ++i) {
+ u16 type, class;
+
+ SKIP_NAME;
+ GET16(type);
+ GET16(class);
+ GET32(ttl);
+ GET16(datalength);
+
+ if (type == TYPE_A && class == CLASS_INET) {
+ int addrcount, addrtocopy;
+ if (req->request_type != TYPE_A) {
+ j += datalength; continue;
+ }
+ if ((datalength & 3) != 0) /* not an even number of As. */
+ goto err;
+ addrcount = datalength >> 2;
+ addrtocopy = MIN(MAX_V4_ADDRS - reply.data.a.addrcount, (unsigned)addrcount);
+
+ ttl_r = MIN(ttl_r, ttl);
+ /* we only bother with the first four addresses. */
+ if (j + 4*addrtocopy > length) goto err;
+ memcpy(&reply.data.a.addresses[reply.data.a.addrcount],
+ packet + j, 4*addrtocopy);
+ j += 4*addrtocopy;
+ reply.data.a.addrcount += addrtocopy;
+ reply.have_answer = 1;
+ if (reply.data.a.addrcount == MAX_V4_ADDRS) break;
+ } else if (type == TYPE_PTR && class == CLASS_INET) {
+ if (req->request_type != TYPE_PTR) {
+ j += datalength; continue;
+ }
+ if (name_parse(packet, length, &j, reply.data.ptr.name,
+ sizeof(reply.data.ptr.name))<0)
+ goto err;
+ ttl_r = MIN(ttl_r, ttl);
+ reply.have_answer = 1;
+ break;
+ } else if (type == TYPE_CNAME) {
+ char cname[HOST_NAME_MAX];
+ if (!req->put_cname_in_ptr || *req->put_cname_in_ptr) {
+ j += datalength; continue;
+ }
+ if (name_parse(packet, length, &j, cname,
+ sizeof(cname))<0)
+ goto err;
+ *req->put_cname_in_ptr = mm_strdup(cname);
+ } else if (type == TYPE_AAAA && class == CLASS_INET) {
+ int addrcount, addrtocopy;
+ if (req->request_type != TYPE_AAAA) {
+ j += datalength; continue;
+ }
+ if ((datalength & 15) != 0) /* not an even number of AAAAs. */
+ goto err;
+ addrcount = datalength >> 4; /* each address is 16 bytes long */
+ addrtocopy = MIN(MAX_V6_ADDRS - reply.data.aaaa.addrcount, (unsigned)addrcount);
+ ttl_r = MIN(ttl_r, ttl);
+
+ /* we only bother with the first four addresses. */
+ if (j + 16*addrtocopy > length) goto err;
+ memcpy(&reply.data.aaaa.addresses[reply.data.aaaa.addrcount],
+ packet + j, 16*addrtocopy);
+ reply.data.aaaa.addrcount += addrtocopy;
+ j += 16*addrtocopy;
+ reply.have_answer = 1;
+ if (reply.data.aaaa.addrcount == MAX_V6_ADDRS) break;
+ } else {
+ /* skip over any other type of resource */
+ j += datalength;
+ }
+ }
+
+ if (!reply.have_answer) {
+ for (i = 0; i < authority; ++i) {
+ u16 type, class;
+ SKIP_NAME;
+ GET16(type);
+ GET16(class);
+ GET32(ttl);
+ GET16(datalength);
+ if (type == TYPE_SOA && class == CLASS_INET) {
+ u32 serial, refresh, retry, expire, minimum;
+ SKIP_NAME;
+ SKIP_NAME;
+ GET32(serial);
+ GET32(refresh);
+ GET32(retry);
+ GET32(expire);
+ GET32(minimum);
+ (void)expire;
+ (void)retry;
+ (void)refresh;
+ (void)serial;
+ ttl_r = MIN(ttl_r, ttl);
+ ttl_r = MIN(ttl_r, minimum);
+ } else {
+ /* skip over any other type of resource */
+ j += datalength;
+ }
+ }
+ }
+
+ if (ttl_r == 0xffffffff)
+ ttl_r = 0;
+
+ reply_handle(req, flags, ttl_r, &reply);
+ return 0;
+ err:
+ if (req)
+ reply_handle(req, flags, 0, NULL);
+ return -1;
+}
+
+/* Parse a raw request (packet,length) sent to a nameserver port (port) from */
+/* a DNS client (addr,addrlen), and if it's well-formed, call the corresponding */
+/* callback. */
+static int
+request_parse(u8 *packet, int length, struct evdns_server_port *port, struct sockaddr *addr, ev_socklen_t addrlen)
+{
+ int j = 0; /* index into packet */
+ u16 t_; /* used by the macros */
+ char tmp_name[256]; /* used by the macros */
+
+ int i;
+ u16 trans_id, flags, questions, answers, authority, additional;
+ struct server_request *server_req = NULL;
+
+ ASSERT_LOCKED(port);
+
+ /* Get the header fields */
+ GET16(trans_id);
+ GET16(flags);
+ GET16(questions);
+ GET16(answers);
+ GET16(authority);
+ GET16(additional);
+ (void)answers;
+ (void)additional;
+ (void)authority;
+
+ if (flags & 0x8000) return -1; /* Must not be an answer. */
+ flags &= 0x0110; /* Only RD and CD get preserved. */
+
+ server_req = mm_malloc(sizeof(struct server_request));
+ if (server_req == NULL) return -1;
+ memset(server_req, 0, sizeof(struct server_request));
+
+ server_req->trans_id = trans_id;
+ memcpy(&server_req->addr, addr, addrlen);
+ server_req->addrlen = addrlen;
+
+ server_req->base.flags = flags;
+ server_req->base.nquestions = 0;
+ server_req->base.questions = mm_calloc(sizeof(struct evdns_server_question *), questions);
+ if (server_req->base.questions == NULL)
+ goto err;
+
+ for (i = 0; i < questions; ++i) {
+ u16 type, class;
+ struct evdns_server_question *q;
+ int namelen;
+ if (name_parse(packet, length, &j, tmp_name, sizeof(tmp_name))<0)
+ goto err;
+ GET16(type);
+ GET16(class);
+ namelen = (int)strlen(tmp_name);
+ q = mm_malloc(sizeof(struct evdns_server_question) + namelen);
+ if (!q)
+ goto err;
+ q->type = type;
+ q->dns_question_class = class;
+ memcpy(q->name, tmp_name, namelen+1);
+ server_req->base.questions[server_req->base.nquestions++] = q;
+ }
+
+ /* Ignore answers, authority, and additional. */
+
+ server_req->port = port;
+ port->refcnt++;
+
+ /* Only standard queries are supported. */
+ if (flags & 0x7800) {
+ evdns_server_request_respond(&(server_req->base), DNS_ERR_NOTIMPL);
+ return -1;
+ }
+
+ port->user_callback(&(server_req->base), port->user_data);
+
+ return 0;
+err:
+ if (server_req) {
+ if (server_req->base.questions) {
+ for (i = 0; i < server_req->base.nquestions; ++i)
+ mm_free(server_req->base.questions[i]);
+ mm_free(server_req->base.questions);
+ }
+ mm_free(server_req);
+ }
+ return -1;
+
+#undef SKIP_NAME
+#undef GET32
+#undef GET16
+#undef GET8
+}
+
+
+void
+evdns_set_transaction_id_fn(ev_uint16_t (*fn)(void))
+{
+}
+
+void
+evdns_set_random_bytes_fn(void (*fn)(char *, size_t))
+{
+}
+
+/* Try to choose a strong transaction id which isn't already in flight */
+static u16
+transaction_id_pick(struct evdns_base *base) {
+ ASSERT_LOCKED(base);
+ for (;;) {
+ u16 trans_id;
+ evutil_secure_rng_get_bytes(&trans_id, sizeof(trans_id));
+
+ if (trans_id == 0xffff) continue;
+ /* now check to see if that id is already inflight */
+ if (request_find_from_trans_id(base, trans_id) == NULL)
+ return trans_id;
+ }
+}
+
+/* choose a namesever to use. This function will try to ignore */
+/* nameservers which we think are down and load balance across the rest */
+/* by updating the server_head global each time. */
+static struct nameserver *
+nameserver_pick(struct evdns_base *base) {
+ struct nameserver *started_at = base->server_head, *picked;
+ ASSERT_LOCKED(base);
+ if (!base->server_head) return NULL;
+
+ /* if we don't have any good nameservers then there's no */
+ /* point in trying to find one. */
+ if (!base->global_good_nameservers) {
+ base->server_head = base->server_head->next;
+ return base->server_head;
+ }
+
+ /* remember that nameservers are in a circular list */
+ for (;;) {
+ if (base->server_head->state) {
+ /* we think this server is currently good */
+ picked = base->server_head;
+ base->server_head = base->server_head->next;
+ return picked;
+ }
+
+ base->server_head = base->server_head->next;
+ if (base->server_head == started_at) {
+ /* all the nameservers seem to be down */
+ /* so we just return this one and hope for the */
+ /* best */
+ EVUTIL_ASSERT(base->global_good_nameservers == 0);
+ picked = base->server_head;
+ base->server_head = base->server_head->next;
+ return picked;
+ }
+ }
+}
+
+/* this is called when a namesever socket is ready for reading */
+static void
+nameserver_read(struct nameserver *ns) {
+ struct sockaddr_storage ss;
+ ev_socklen_t addrlen = sizeof(ss);
+ u8 packet[1500];
+ char addrbuf[128];
+ ASSERT_LOCKED(ns->base);
+
+ for (;;) {
+ const int r = recvfrom(ns->socket, (void*)packet,
+ sizeof(packet), 0,
+ (struct sockaddr*)&ss, &addrlen);
+ if (r < 0) {
+ int err = evutil_socket_geterror(ns->socket);
+ if (EVUTIL_ERR_RW_RETRIABLE(err))
+ return;
+ nameserver_failed(ns,
+ evutil_socket_error_to_string(err));
+ return;
+ }
+ if (evutil_sockaddr_cmp((struct sockaddr*)&ss,
+ (struct sockaddr*)&ns->address, 0)) {
+ log(EVDNS_LOG_WARN, "Address mismatch on received "
+ "DNS packet. Apparent source was %s",
+ evutil_format_sockaddr_port_(
+ (struct sockaddr *)&ss,
+ addrbuf, sizeof(addrbuf)));
+ return;
+ }
+
+ ns->timedout = 0;
+ reply_parse(ns->base, packet, r);
+ }
+}
+
+/* Read a packet from a DNS client on a server port s, parse it, and */
+/* act accordingly. */
+static void
+server_port_read(struct evdns_server_port *s) {
+ u8 packet[1500];
+ struct sockaddr_storage addr;
+ ev_socklen_t addrlen;
+ int r;
+ ASSERT_LOCKED(s);
+
+ for (;;) {
+ addrlen = sizeof(struct sockaddr_storage);
+ r = recvfrom(s->socket, (void*)packet, sizeof(packet), 0,
+ (struct sockaddr*) &addr, &addrlen);
+ if (r < 0) {
+ int err = evutil_socket_geterror(s->socket);
+ if (EVUTIL_ERR_RW_RETRIABLE(err))
+ return;
+ log(EVDNS_LOG_WARN,
+ "Error %s (%d) while reading request.",
+ evutil_socket_error_to_string(err), err);
+ return;
+ }
+ request_parse(packet, r, s, (struct sockaddr*) &addr, addrlen);
+ }
+}
+
+/* Try to write all pending replies on a given DNS server port. */
+static void
+server_port_flush(struct evdns_server_port *port)
+{
+ struct server_request *req = port->pending_replies;
+ ASSERT_LOCKED(port);
+ while (req) {
+ int r = sendto(port->socket, req->response, (int)req->response_len, 0,
+ (struct sockaddr*) &req->addr, (ev_socklen_t)req->addrlen);
+ if (r < 0) {
+ int err = evutil_socket_geterror(port->socket);
+ if (EVUTIL_ERR_RW_RETRIABLE(err))
+ return;
+ log(EVDNS_LOG_WARN, "Error %s (%d) while writing response to port; dropping", evutil_socket_error_to_string(err), err);
+ }
+ if (server_request_free(req)) {
+ /* we released the last reference to req->port. */
+ return;
+ } else {
+ EVUTIL_ASSERT(req != port->pending_replies);
+ req = port->pending_replies;
+ }
+ }
+
+ /* We have no more pending requests; stop listening for 'writeable' events. */
+ (void) event_del(&port->event);
+ event_assign(&port->event, port->event_base,
+ port->socket, EV_READ | EV_PERSIST,
+ server_port_ready_callback, port);
+
+ if (event_add(&port->event, NULL) < 0) {
+ log(EVDNS_LOG_WARN, "Error from libevent when adding event for DNS server.");
+ /* ???? Do more? */
+ }
+}
+
+/* set if we are waiting for the ability to write to this server. */
+/* if waiting is true then we ask libevent for EV_WRITE events, otherwise */
+/* we stop these events. */
+static void
+nameserver_write_waiting(struct nameserver *ns, char waiting) {
+ ASSERT_LOCKED(ns->base);
+ if (ns->write_waiting == waiting) return;
+
+ ns->write_waiting = waiting;
+ (void) event_del(&ns->event);
+ event_assign(&ns->event, ns->base->event_base,
+ ns->socket, EV_READ | (waiting ? EV_WRITE : 0) | EV_PERSIST,
+ nameserver_ready_callback, ns);
+ if (event_add(&ns->event, NULL) < 0) {
+ char addrbuf[128];
+ log(EVDNS_LOG_WARN, "Error from libevent when adding event for %s",
+ evutil_format_sockaddr_port_(
+ (struct sockaddr *)&ns->address,
+ addrbuf, sizeof(addrbuf)));
+ /* ???? Do more? */
+ }
+}
+
+/* a callback function. Called by libevent when the kernel says that */
+/* a nameserver socket is ready for writing or reading */
+static void
+nameserver_ready_callback(evutil_socket_t fd, short events, void *arg) {
+ struct nameserver *ns = (struct nameserver *) arg;
+ (void)fd;
+
+ EVDNS_LOCK(ns->base);
+ if (events & EV_WRITE) {
+ ns->choked = 0;
+ if (!evdns_transmit(ns->base)) {
+ nameserver_write_waiting(ns, 0);
+ }
+ }
+ if (events & EV_READ) {
+ nameserver_read(ns);
+ }
+ EVDNS_UNLOCK(ns->base);
+}
+
+/* a callback function. Called by libevent when the kernel says that */
+/* a server socket is ready for writing or reading. */
+static void
+server_port_ready_callback(evutil_socket_t fd, short events, void *arg) {
+ struct evdns_server_port *port = (struct evdns_server_port *) arg;
+ (void) fd;
+
+ EVDNS_LOCK(port);
+ if (events & EV_WRITE) {
+ port->choked = 0;
+ server_port_flush(port);
+ }
+ if (events & EV_READ) {
+ server_port_read(port);
+ }
+ EVDNS_UNLOCK(port);
+}
+
+/* This is an inefficient representation; only use it via the dnslabel_table_*
+ * functions, so that is can be safely replaced with something smarter later. */
+#define MAX_LABELS 128
+/* Structures used to implement name compression */
+struct dnslabel_entry { char *v; off_t pos; };
+struct dnslabel_table {
+ int n_labels; /* number of current entries */
+ /* map from name to position in message */
+ struct dnslabel_entry labels[MAX_LABELS];
+};
+
+/* Initialize dnslabel_table. */
+static void
+dnslabel_table_init(struct dnslabel_table *table)
+{
+ table->n_labels = 0;
+}
+
+/* Free all storage held by table, but not the table itself. */
+static void
+dnslabel_clear(struct dnslabel_table *table)
+{
+ int i;
+ for (i = 0; i < table->n_labels; ++i)
+ mm_free(table->labels[i].v);
+ table->n_labels = 0;
+}
+
+/* return the position of the label in the current message, or -1 if the label */
+/* hasn't been used yet. */
+static int
+dnslabel_table_get_pos(const struct dnslabel_table *table, const char *label)
+{
+ int i;
+ for (i = 0; i < table->n_labels; ++i) {
+ if (!strcmp(label, table->labels[i].v))
+ return table->labels[i].pos;
+ }
+ return -1;
+}
+
+/* remember that we've used the label at position pos */
+static int
+dnslabel_table_add(struct dnslabel_table *table, const char *label, off_t pos)
+{
+ char *v;
+ int p;
+ if (table->n_labels == MAX_LABELS)
+ return (-1);
+ v = mm_strdup(label);
+ if (v == NULL)
+ return (-1);
+ p = table->n_labels++;
+ table->labels[p].v = v;
+ table->labels[p].pos = pos;
+
+ return (0);
+}
+
+/* Converts a string to a length-prefixed set of DNS labels, starting */
+/* at buf[j]. name and buf must not overlap. name_len should be the length */
+/* of name. table is optional, and is used for compression. */
+/* */
+/* Input: abc.def */
+/* Output: <3>abc<3>def<0> */
+/* */
+/* Returns the first index after the encoded name, or negative on error. */
+/* -1 label was > 63 bytes */
+/* -2 name too long to fit in buffer. */
+/* */
+static off_t
+dnsname_to_labels(u8 *const buf, size_t buf_len, off_t j,
+ const char *name, const size_t name_len,
+ struct dnslabel_table *table) {
+ const char *end = name + name_len;
+ int ref = 0;
+ u16 t_;
+
+#define APPEND16(x) do { \
+ if (j + 2 > (off_t)buf_len) \
+ goto overflow; \
+ t_ = htons(x); \
+ memcpy(buf + j, &t_, 2); \
+ j += 2; \
+ } while (0)
+#define APPEND32(x) do { \
+ if (j + 4 > (off_t)buf_len) \
+ goto overflow; \
+ t32_ = htonl(x); \
+ memcpy(buf + j, &t32_, 4); \
+ j += 4; \
+ } while (0)
+
+ if (name_len > 255) return -2;
+
+ for (;;) {
+ const char *const start = name;
+ if (table && (ref = dnslabel_table_get_pos(table, name)) >= 0) {
+ APPEND16(ref | 0xc000);
+ return j;
+ }
+ name = strchr(name, '.');
+ if (!name) {
+ const size_t label_len = end - start;
+ if (label_len > 63) return -1;
+ if ((size_t)(j+label_len+1) > buf_len) return -2;
+ if (table) dnslabel_table_add(table, start, j);
+ buf[j++] = (ev_uint8_t)label_len;
+
+ memcpy(buf + j, start, label_len);
+ j += (int) label_len;
+ break;
+ } else {
+ /* append length of the label. */
+ const size_t label_len = name - start;
+ if (label_len > 63) return -1;
+ if ((size_t)(j+label_len+1) > buf_len) return -2;
+ if (table) dnslabel_table_add(table, start, j);
+ buf[j++] = (ev_uint8_t)label_len;
+
+ memcpy(buf + j, start, label_len);
+ j += (int) label_len;
+ /* hop over the '.' */
+ name++;
+ }
+ }
+
+ /* the labels must be terminated by a 0. */
+ /* It's possible that the name ended in a . */
+ /* in which case the zero is already there */
+ if (!j || buf[j-1]) buf[j++] = 0;
+ return j;
+ overflow:
+ return (-2);
+}
+
+/* Finds the length of a dns request for a DNS name of the given */
+/* length. The actual request may be smaller than the value returned */
+/* here */
+static size_t
+evdns_request_len(const size_t name_len) {
+ return 96 + /* length of the DNS standard header */
+ name_len + 2 +
+ 4; /* space for the resource type */
+}
+
+/* build a dns request packet into buf. buf should be at least as long */
+/* as evdns_request_len told you it should be. */
+/* */
+/* Returns the amount of space used. Negative on error. */
+static int
+evdns_request_data_build(const char *const name, const size_t name_len,
+ const u16 trans_id, const u16 type, const u16 class,
+ u8 *const buf, size_t buf_len) {
+ off_t j = 0; /* current offset into buf */
+ u16 t_; /* used by the macros */
+
+ APPEND16(trans_id);
+ APPEND16(0x0100); /* standard query, recusion needed */
+ APPEND16(1); /* one question */
+ APPEND16(0); /* no answers */
+ APPEND16(0); /* no authority */
+ APPEND16(0); /* no additional */
+
+ j = dnsname_to_labels(buf, buf_len, j, name, name_len, NULL);
+ if (j < 0) {
+ return (int)j;
+ }
+
+ APPEND16(type);
+ APPEND16(class);
+
+ return (int)j;
+ overflow:
+ return (-1);
+}
+
+/* exported function */
+struct evdns_server_port *
+evdns_add_server_port_with_base(struct event_base *base, evutil_socket_t socket, int flags, evdns_request_callback_fn_type cb, void *user_data)
+{
+ struct evdns_server_port *port;
+ if (flags)
+ return NULL; /* flags not yet implemented */
+ if (!(port = mm_malloc(sizeof(struct evdns_server_port))))
+ return NULL;
+ memset(port, 0, sizeof(struct evdns_server_port));
+
+
+ port->socket = socket;
+ port->refcnt = 1;
+ port->choked = 0;
+ port->closing = 0;
+ port->user_callback = cb;
+ port->user_data = user_data;
+ port->pending_replies = NULL;
+ port->event_base = base;
+
+ event_assign(&port->event, port->event_base,
+ port->socket, EV_READ | EV_PERSIST,
+ server_port_ready_callback, port);
+ if (event_add(&port->event, NULL) < 0) {
+ mm_free(port);
+ return NULL;
+ }
+ EVTHREAD_ALLOC_LOCK(port->lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+ return port;
+}
+
+struct evdns_server_port *
+evdns_add_server_port(evutil_socket_t socket, int flags, evdns_request_callback_fn_type cb, void *user_data)
+{
+ return evdns_add_server_port_with_base(NULL, socket, flags, cb, user_data);
+}
+
+/* exported function */
+void
+evdns_close_server_port(struct evdns_server_port *port)
+{
+ EVDNS_LOCK(port);
+ if (--port->refcnt == 0) {
+ EVDNS_UNLOCK(port);
+ server_port_free(port);
+ } else {
+ port->closing = 1;
+ }
+}
+
+/* exported function */
+int
+evdns_server_request_add_reply(struct evdns_server_request *req_, int section, const char *name, int type, int class, int ttl, int datalen, int is_name, const char *data)
+{
+ struct server_request *req = TO_SERVER_REQUEST(req_);
+ struct server_reply_item **itemp, *item;
+ int *countp;
+ int result = -1;
+
+ EVDNS_LOCK(req->port);
+ if (req->response) /* have we already answered? */
+ goto done;
+
+ switch (section) {
+ case EVDNS_ANSWER_SECTION:
+ itemp = &req->answer;
+ countp = &req->n_answer;
+ break;
+ case EVDNS_AUTHORITY_SECTION:
+ itemp = &req->authority;
+ countp = &req->n_authority;
+ break;
+ case EVDNS_ADDITIONAL_SECTION:
+ itemp = &req->additional;
+ countp = &req->n_additional;
+ break;
+ default:
+ goto done;
+ }
+ while (*itemp) {
+ itemp = &((*itemp)->next);
+ }
+ item = mm_malloc(sizeof(struct server_reply_item));
+ if (!item)
+ goto done;
+ item->next = NULL;
+ if (!(item->name = mm_strdup(name))) {
+ mm_free(item);
+ goto done;
+ }
+ item->type = type;
+ item->dns_question_class = class;
+ item->ttl = ttl;
+ item->is_name = is_name != 0;
+ item->datalen = 0;
+ item->data = NULL;
+ if (data) {
+ if (item->is_name) {
+ if (!(item->data = mm_strdup(data))) {
+ mm_free(item->name);
+ mm_free(item);
+ goto done;
+ }
+ item->datalen = (u16)-1;
+ } else {
+ if (!(item->data = mm_malloc(datalen))) {
+ mm_free(item->name);
+ mm_free(item);
+ goto done;
+ }
+ item->datalen = datalen;
+ memcpy(item->data, data, datalen);
+ }
+ }
+
+ *itemp = item;
+ ++(*countp);
+ result = 0;
+done:
+ EVDNS_UNLOCK(req->port);
+ return result;
+}
+
+/* exported function */
+int
+evdns_server_request_add_a_reply(struct evdns_server_request *req, const char *name, int n, const void *addrs, int ttl)
+{
+ return evdns_server_request_add_reply(
+ req, EVDNS_ANSWER_SECTION, name, TYPE_A, CLASS_INET,
+ ttl, n*4, 0, addrs);
+}
+
+/* exported function */
+int
+evdns_server_request_add_aaaa_reply(struct evdns_server_request *req, const char *name, int n, const void *addrs, int ttl)
+{
+ return evdns_server_request_add_reply(
+ req, EVDNS_ANSWER_SECTION, name, TYPE_AAAA, CLASS_INET,
+ ttl, n*16, 0, addrs);
+}
+
+/* exported function */
+int
+evdns_server_request_add_ptr_reply(struct evdns_server_request *req, struct in_addr *in, const char *inaddr_name, const char *hostname, int ttl)
+{
+ u32 a;
+ char buf[32];
+ if (in && inaddr_name)
+ return -1;
+ else if (!in && !inaddr_name)
+ return -1;
+ if (in) {
+ a = ntohl(in->s_addr);
+ evutil_snprintf(buf, sizeof(buf), "%d.%d.%d.%d.in-addr.arpa",
+ (int)(u8)((a )&0xff),
+ (int)(u8)((a>>8 )&0xff),
+ (int)(u8)((a>>16)&0xff),
+ (int)(u8)((a>>24)&0xff));
+ inaddr_name = buf;
+ }
+ return evdns_server_request_add_reply(
+ req, EVDNS_ANSWER_SECTION, inaddr_name, TYPE_PTR, CLASS_INET,
+ ttl, -1, 1, hostname);
+}
+
+/* exported function */
+int
+evdns_server_request_add_cname_reply(struct evdns_server_request *req, const char *name, const char *cname, int ttl)
+{
+ return evdns_server_request_add_reply(
+ req, EVDNS_ANSWER_SECTION, name, TYPE_CNAME, CLASS_INET,
+ ttl, -1, 1, cname);
+}
+
+/* exported function */
+void
+evdns_server_request_set_flags(struct evdns_server_request *exreq, int flags)
+{
+ struct server_request *req = TO_SERVER_REQUEST(exreq);
+ req->base.flags &= ~(EVDNS_FLAGS_AA|EVDNS_FLAGS_RD);
+ req->base.flags |= flags;
+}
+
+static int
+evdns_server_request_format_response(struct server_request *req, int err)
+{
+ unsigned char buf[1500];
+ size_t buf_len = sizeof(buf);
+ off_t j = 0, r;
+ u16 t_;
+ u32 t32_;
+ int i;
+ u16 flags;
+ struct dnslabel_table table;
+
+ if (err < 0 || err > 15) return -1;
+
+ /* Set response bit and error code; copy OPCODE and RD fields from
+ * question; copy RA and AA if set by caller. */
+ flags = req->base.flags;
+ flags |= (0x8000 | err);
+
+ dnslabel_table_init(&table);
+ APPEND16(req->trans_id);
+ APPEND16(flags);
+ APPEND16(req->base.nquestions);
+ APPEND16(req->n_answer);
+ APPEND16(req->n_authority);
+ APPEND16(req->n_additional);
+
+ /* Add questions. */
+ for (i=0; i < req->base.nquestions; ++i) {
+ const char *s = req->base.questions[i]->name;
+ j = dnsname_to_labels(buf, buf_len, j, s, strlen(s), &table);
+ if (j < 0) {
+ dnslabel_clear(&table);
+ return (int) j;
+ }
+ APPEND16(req->base.questions[i]->type);
+ APPEND16(req->base.questions[i]->dns_question_class);
+ }
+
+ /* Add answer, authority, and additional sections. */
+ for (i=0; i<3; ++i) {
+ struct server_reply_item *item;
+ if (i==0)
+ item = req->answer;
+ else if (i==1)
+ item = req->authority;
+ else
+ item = req->additional;
+ while (item) {
+ r = dnsname_to_labels(buf, buf_len, j, item->name, strlen(item->name), &table);
+ if (r < 0)
+ goto overflow;
+ j = r;
+
+ APPEND16(item->type);
+ APPEND16(item->dns_question_class);
+ APPEND32(item->ttl);
+ if (item->is_name) {
+ off_t len_idx = j, name_start;
+ j += 2;
+ name_start = j;
+ r = dnsname_to_labels(buf, buf_len, j, item->data, strlen(item->data), &table);
+ if (r < 0)
+ goto overflow;
+ j = r;
+ t_ = htons( (short) (j-name_start) );
+ memcpy(buf+len_idx, &t_, 2);
+ } else {
+ APPEND16(item->datalen);
+ if (j+item->datalen > (off_t)buf_len)
+ goto overflow;
+ memcpy(buf+j, item->data, item->datalen);
+ j += item->datalen;
+ }
+ item = item->next;
+ }
+ }
+
+ if (j > 512) {
+overflow:
+ j = 512;
+ buf[2] |= 0x02; /* set the truncated bit. */
+ }
+
+ req->response_len = j;
+
+ if (!(req->response = mm_malloc(req->response_len))) {
+ server_request_free_answers(req);
+ dnslabel_clear(&table);
+ return (-1);
+ }
+ memcpy(req->response, buf, req->response_len);
+ server_request_free_answers(req);
+ dnslabel_clear(&table);
+ return (0);
+}
+
+/* exported function */
+int
+evdns_server_request_respond(struct evdns_server_request *req_, int err)
+{
+ struct server_request *req = TO_SERVER_REQUEST(req_);
+ struct evdns_server_port *port = req->port;
+ int r = -1;
+
+ EVDNS_LOCK(port);
+ if (!req->response) {
+ if ((r = evdns_server_request_format_response(req, err))<0)
+ goto done;
+ }
+
+ r = sendto(port->socket, req->response, (int)req->response_len, 0,
+ (struct sockaddr*) &req->addr, (ev_socklen_t)req->addrlen);
+ if (r<0) {
+ int sock_err = evutil_socket_geterror(port->socket);
+ if (EVUTIL_ERR_RW_RETRIABLE(sock_err))
+ goto done;
+
+ if (port->pending_replies) {
+ req->prev_pending = port->pending_replies->prev_pending;
+ req->next_pending = port->pending_replies;
+ req->prev_pending->next_pending =
+ req->next_pending->prev_pending = req;
+ } else {
+ req->prev_pending = req->next_pending = req;
+ port->pending_replies = req;
+ port->choked = 1;
+
+ (void) event_del(&port->event);
+ event_assign(&port->event, port->event_base, port->socket, (port->closing?0:EV_READ) | EV_WRITE | EV_PERSIST, server_port_ready_callback, port);
+
+ if (event_add(&port->event, NULL) < 0) {
+ log(EVDNS_LOG_WARN, "Error from libevent when adding event for DNS server");
+ }
+
+ }
+
+ r = 1;
+ goto done;
+ }
+ if (server_request_free(req)) {
+ r = 0;
+ goto done;
+ }
+
+ if (port->pending_replies)
+ server_port_flush(port);
+
+ r = 0;
+done:
+ EVDNS_UNLOCK(port);
+ return r;
+}
+
+/* Free all storage held by RRs in req. */
+static void
+server_request_free_answers(struct server_request *req)
+{
+ struct server_reply_item *victim, *next, **list;
+ int i;
+ for (i = 0; i < 3; ++i) {
+ if (i==0)
+ list = &req->answer;
+ else if (i==1)
+ list = &req->authority;
+ else
+ list = &req->additional;
+
+ victim = *list;
+ while (victim) {
+ next = victim->next;
+ mm_free(victim->name);
+ if (victim->data)
+ mm_free(victim->data);
+ mm_free(victim);
+ victim = next;
+ }
+ *list = NULL;
+ }
+}
+
+/* Free all storage held by req, and remove links to it. */
+/* return true iff we just wound up freeing the server_port. */
+static int
+server_request_free(struct server_request *req)
+{
+ int i, rc=1, lock=0;
+ if (req->base.questions) {
+ for (i = 0; i < req->base.nquestions; ++i)
+ mm_free(req->base.questions[i]);
+ mm_free(req->base.questions);
+ }
+
+ if (req->port) {
+ EVDNS_LOCK(req->port);
+ lock=1;
+ if (req->port->pending_replies == req) {
+ if (req->next_pending && req->next_pending != req)
+ req->port->pending_replies = req->next_pending;
+ else
+ req->port->pending_replies = NULL;
+ }
+ rc = --req->port->refcnt;
+ }
+
+ if (req->response) {
+ mm_free(req->response);
+ }
+
+ server_request_free_answers(req);
+
+ if (req->next_pending && req->next_pending != req) {
+ req->next_pending->prev_pending = req->prev_pending;
+ req->prev_pending->next_pending = req->next_pending;
+ }
+
+ if (rc == 0) {
+ EVDNS_UNLOCK(req->port); /* ????? nickm */
+ server_port_free(req->port);
+ mm_free(req);
+ return (1);
+ }
+ if (lock)
+ EVDNS_UNLOCK(req->port);
+ mm_free(req);
+ return (0);
+}
+
+/* Free all storage held by an evdns_server_port. Only called when */
+static void
+server_port_free(struct evdns_server_port *port)
+{
+ EVUTIL_ASSERT(port);
+ EVUTIL_ASSERT(!port->refcnt);
+ EVUTIL_ASSERT(!port->pending_replies);
+ if (port->socket > 0) {
+ evutil_closesocket(port->socket);
+ port->socket = -1;
+ }
+ (void) event_del(&port->event);
+ event_debug_unassign(&port->event);
+ EVTHREAD_FREE_LOCK(port->lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+ mm_free(port);
+}
+
+/* exported function */
+int
+evdns_server_request_drop(struct evdns_server_request *req_)
+{
+ struct server_request *req = TO_SERVER_REQUEST(req_);
+ server_request_free(req);
+ return 0;
+}
+
+/* exported function */
+int
+evdns_server_request_get_requesting_addr(struct evdns_server_request *req_, struct sockaddr *sa, int addr_len)
+{
+ struct server_request *req = TO_SERVER_REQUEST(req_);
+ if (addr_len < (int)req->addrlen)
+ return -1;
+ memcpy(sa, &(req->addr), req->addrlen);
+ return req->addrlen;
+}
+
+#undef APPEND16
+#undef APPEND32
+
+/* this is a libevent callback function which is called when a request */
+/* has timed out. */
+static void
+evdns_request_timeout_callback(evutil_socket_t fd, short events, void *arg) {
+ struct request *const req = (struct request *) arg;
+ struct evdns_base *base = req->base;
+
+ (void) fd;
+ (void) events;
+
+ log(EVDNS_LOG_DEBUG, "Request %p timed out", arg);
+ EVDNS_LOCK(base);
+
+ if (req->tx_count >= req->base->global_max_retransmits) {
+ struct nameserver *ns = req->ns;
+ /* this request has failed */
+ log(EVDNS_LOG_DEBUG, "Giving up on request %p; tx_count==%d",
+ arg, req->tx_count);
+ reply_schedule_callback(req, 0, DNS_ERR_TIMEOUT, NULL);
+
+ request_finished(req, &REQ_HEAD(req->base, req->trans_id), 1);
+ nameserver_failed(ns, "request timed out.");
+ } else {
+ /* retransmit it */
+ log(EVDNS_LOG_DEBUG, "Retransmitting request %p; tx_count==%d",
+ arg, req->tx_count);
+ (void) evtimer_del(&req->timeout_event);
+ request_swap_ns(req, nameserver_pick(base));
+ evdns_request_transmit(req);
+
+ req->ns->timedout++;
+ if (req->ns->timedout > req->base->global_max_nameserver_timeout) {
+ req->ns->timedout = 0;
+ nameserver_failed(req->ns, "request timed out.");
+ }
+ }
+
+ EVDNS_UNLOCK(base);
+}
+
+/* try to send a request to a given server. */
+/* */
+/* return: */
+/* 0 ok */
+/* 1 temporary failure */
+/* 2 other failure */
+static int
+evdns_request_transmit_to(struct request *req, struct nameserver *server) {
+ int r;
+ ASSERT_LOCKED(req->base);
+ ASSERT_VALID_REQUEST(req);
+
+ if (server->requests_inflight == 1 &&
+ req->base->disable_when_inactive &&
+ event_add(&server->event, NULL) < 0) {
+ return 1;
+ }
+
+ r = sendto(server->socket, (void*)req->request, req->request_len, 0,
+ (struct sockaddr *)&server->address, server->addrlen);
+ if (r < 0) {
+ int err = evutil_socket_geterror(server->socket);
+ if (EVUTIL_ERR_RW_RETRIABLE(err))
+ return 1;
+ nameserver_failed(req->ns, evutil_socket_error_to_string(err));
+ return 2;
+ } else if (r != (int)req->request_len) {
+ return 1; /* short write */
+ } else {
+ return 0;
+ }
+}
+
+/* try to send a request, updating the fields of the request */
+/* as needed */
+/* */
+/* return: */
+/* 0 ok */
+/* 1 failed */
+static int
+evdns_request_transmit(struct request *req) {
+ int retcode = 0, r;
+
+ ASSERT_LOCKED(req->base);
+ ASSERT_VALID_REQUEST(req);
+ /* if we fail to send this packet then this flag marks it */
+ /* for evdns_transmit */
+ req->transmit_me = 1;
+ EVUTIL_ASSERT(req->trans_id != 0xffff);
+
+ if (!req->ns)
+ {
+ /* unable to transmit request if no nameservers */
+ return 1;
+ }
+
+ if (req->ns->choked) {
+ /* don't bother trying to write to a socket */
+ /* which we have had EAGAIN from */
+ return 1;
+ }
+
+ r = evdns_request_transmit_to(req, req->ns);
+ switch (r) {
+ case 1:
+ /* temp failure */
+ req->ns->choked = 1;
+ nameserver_write_waiting(req->ns, 1);
+ return 1;
+ case 2:
+ /* failed to transmit the request entirely. */
+ retcode = 1;
+ /* fall through: we'll set a timeout, which will time out,
+ * and make us retransmit the request anyway. */
+ default:
+ /* all ok */
+ log(EVDNS_LOG_DEBUG,
+ "Setting timeout for request %p, sent to nameserver %p", req, req->ns);
+ if (evtimer_add(&req->timeout_event, &req->base->global_timeout) < 0) {
+ log(EVDNS_LOG_WARN,
+ "Error from libevent when adding timer for request %p",
+ req);
+ /* ???? Do more? */
+ }
+ req->tx_count++;
+ req->transmit_me = 0;
+ return retcode;
+ }
+}
+
+static void
+nameserver_probe_callback(int result, char type, int count, int ttl, void *addresses, void *arg) {
+ struct nameserver *const ns = (struct nameserver *) arg;
+ (void) type;
+ (void) count;
+ (void) ttl;
+ (void) addresses;
+
+ if (result == DNS_ERR_CANCEL) {
+ /* We canceled this request because the nameserver came up
+ * for some other reason. Do not change our opinion about
+ * the nameserver. */
+ return;
+ }
+
+ EVDNS_LOCK(ns->base);
+ ns->probe_request = NULL;
+ if (result == DNS_ERR_NONE || result == DNS_ERR_NOTEXIST) {
+ /* this is a good reply */
+ nameserver_up(ns);
+ } else {
+ nameserver_probe_failed(ns);
+ }
+ EVDNS_UNLOCK(ns->base);
+}
+
+static void
+nameserver_send_probe(struct nameserver *const ns) {
+ struct evdns_request *handle;
+ struct request *req;
+ char addrbuf[128];
+ /* here we need to send a probe to a given nameserver */
+ /* in the hope that it is up now. */
+
+ ASSERT_LOCKED(ns->base);
+ log(EVDNS_LOG_DEBUG, "Sending probe to %s",
+ evutil_format_sockaddr_port_(
+ (struct sockaddr *)&ns->address,
+ addrbuf, sizeof(addrbuf)));
+ handle = mm_calloc(1, sizeof(*handle));
+ if (!handle) return;
+ req = request_new(ns->base, handle, TYPE_A, "google.com", DNS_QUERY_NO_SEARCH, nameserver_probe_callback, ns);
+ if (!req) {
+ mm_free(handle);
+ return;
+ }
+ ns->probe_request = handle;
+ /* we force this into the inflight queue no matter what */
+ request_trans_id_set(req, transaction_id_pick(ns->base));
+ req->ns = ns;
+ request_submit(req);
+}
+
+/* returns: */
+/* 0 didn't try to transmit anything */
+/* 1 tried to transmit something */
+static int
+evdns_transmit(struct evdns_base *base) {
+ char did_try_to_transmit = 0;
+ int i;
+
+ ASSERT_LOCKED(base);
+ for (i = 0; i < base->n_req_heads; ++i) {
+ if (base->req_heads[i]) {
+ struct request *const started_at = base->req_heads[i], *req = started_at;
+ /* first transmit all the requests which are currently waiting */
+ do {
+ if (req->transmit_me) {
+ did_try_to_transmit = 1;
+ evdns_request_transmit(req);
+ }
+
+ req = req->next;
+ } while (req != started_at);
+ }
+ }
+
+ return did_try_to_transmit;
+}
+
+/* exported function */
+int
+evdns_base_count_nameservers(struct evdns_base *base)
+{
+ const struct nameserver *server;
+ int n = 0;
+
+ EVDNS_LOCK(base);
+ server = base->server_head;
+ if (!server)
+ goto done;
+ do {
+ ++n;
+ server = server->next;
+ } while (server != base->server_head);
+done:
+ EVDNS_UNLOCK(base);
+ return n;
+}
+
+int
+evdns_count_nameservers(void)
+{
+ return evdns_base_count_nameservers(current_base);
+}
+
+/* exported function */
+int
+evdns_base_clear_nameservers_and_suspend(struct evdns_base *base)
+{
+ struct nameserver *server, *started_at;
+ int i;
+
+ EVDNS_LOCK(base);
+ server = base->server_head;
+ started_at = base->server_head;
+ if (!server) {
+ EVDNS_UNLOCK(base);
+ return 0;
+ }
+ while (1) {
+ struct nameserver *next = server->next;
+ (void) event_del(&server->event);
+ if (evtimer_initialized(&server->timeout_event))
+ (void) evtimer_del(&server->timeout_event);
+ if (server->probe_request) {
+ evdns_cancel_request(server->base, server->probe_request);
+ server->probe_request = NULL;
+ }
+ if (server->socket >= 0)
+ evutil_closesocket(server->socket);
+ mm_free(server);
+ if (next == started_at)
+ break;
+ server = next;
+ }
+ base->server_head = NULL;
+ base->global_good_nameservers = 0;
+
+ for (i = 0; i < base->n_req_heads; ++i) {
+ struct request *req, *req_started_at;
+ req = req_started_at = base->req_heads[i];
+ while (req) {
+ struct request *next = req->next;
+ req->tx_count = req->reissue_count = 0;
+ req->ns = NULL;
+ /* ???? What to do about searches? */
+ (void) evtimer_del(&req->timeout_event);
+ req->trans_id = 0;
+ req->transmit_me = 0;
+
+ base->global_requests_waiting++;
+ evdns_request_insert(req, &base->req_waiting_head);
+ /* We want to insert these suspended elements at the front of
+ * the waiting queue, since they were pending before any of
+ * the waiting entries were added. This is a circular list,
+ * so we can just shift the start back by one.*/
+ base->req_waiting_head = base->req_waiting_head->prev;
+
+ if (next == req_started_at)
+ break;
+ req = next;
+ }
+ base->req_heads[i] = NULL;
+ }
+
+ base->global_requests_inflight = 0;
+
+ EVDNS_UNLOCK(base);
+ return 0;
+}
+
+int
+evdns_clear_nameservers_and_suspend(void)
+{
+ return evdns_base_clear_nameservers_and_suspend(current_base);
+}
+
+
+/* exported function */
+int
+evdns_base_resume(struct evdns_base *base)
+{
+ EVDNS_LOCK(base);
+ evdns_requests_pump_waiting_queue(base);
+ EVDNS_UNLOCK(base);
+
+ return 0;
+}
+
+int
+evdns_resume(void)
+{
+ return evdns_base_resume(current_base);
+}
+
+static int
+evdns_nameserver_add_impl_(struct evdns_base *base, const struct sockaddr *address, int addrlen) {
+ /* first check to see if we already have this nameserver */
+
+ const struct nameserver *server = base->server_head, *const started_at = base->server_head;
+ struct nameserver *ns;
+ int err = 0;
+ char addrbuf[128];
+
+ ASSERT_LOCKED(base);
+ if (server) {
+ do {
+ if (!evutil_sockaddr_cmp((struct sockaddr*)&server->address, address, 1)) return 3;
+ server = server->next;
+ } while (server != started_at);
+ }
+ if (addrlen > (int)sizeof(ns->address)) {
+ log(EVDNS_LOG_DEBUG, "Addrlen %d too long.", (int)addrlen);
+ return 2;
+ }
+
+ ns = (struct nameserver *) mm_malloc(sizeof(struct nameserver));
+ if (!ns) return -1;
+
+ memset(ns, 0, sizeof(struct nameserver));
+ ns->base = base;
+
+ evtimer_assign(&ns->timeout_event, ns->base->event_base, nameserver_prod_callback, ns);
+
+ ns->socket = evutil_socket_(address->sa_family,
+ SOCK_DGRAM|EVUTIL_SOCK_NONBLOCK|EVUTIL_SOCK_CLOEXEC, 0);
+ if (ns->socket < 0) { err = 1; goto out1; }
+
+ if (base->global_outgoing_addrlen &&
+ !evutil_sockaddr_is_loopback_(address)) {
+ if (bind(ns->socket,
+ (struct sockaddr*)&base->global_outgoing_address,
+ base->global_outgoing_addrlen) < 0) {
+ log(EVDNS_LOG_WARN,"Couldn't bind to outgoing address");
+ err = 2;
+ goto out2;
+ }
+ }
+
+ memcpy(&ns->address, address, addrlen);
+ ns->addrlen = addrlen;
+ ns->state = 1;
+ event_assign(&ns->event, ns->base->event_base, ns->socket,
+ EV_READ | EV_PERSIST, nameserver_ready_callback, ns);
+ if (!base->disable_when_inactive && event_add(&ns->event, NULL) < 0) {
+ err = 2;
+ goto out2;
+ }
+
+ log(EVDNS_LOG_DEBUG, "Added nameserver %s as %p",
+ evutil_format_sockaddr_port_(address, addrbuf, sizeof(addrbuf)), ns);
+
+ /* insert this nameserver into the list of them */
+ if (!base->server_head) {
+ ns->next = ns->prev = ns;
+ base->server_head = ns;
+ } else {
+ ns->next = base->server_head->next;
+ ns->prev = base->server_head;
+ base->server_head->next = ns;
+ ns->next->prev = ns;
+ }
+
+ base->global_good_nameservers++;
+
+ return 0;
+
+out2:
+ evutil_closesocket(ns->socket);
+out1:
+ event_debug_unassign(&ns->event);
+ mm_free(ns);
+ log(EVDNS_LOG_WARN, "Unable to add nameserver %s: error %d",
+ evutil_format_sockaddr_port_(address, addrbuf, sizeof(addrbuf)), err);
+ return err;
+}
+
+/* exported function */
+int
+evdns_base_nameserver_add(struct evdns_base *base, unsigned long int address)
+{
+ struct sockaddr_in sin;
+ int res;
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_addr.s_addr = address;
+ sin.sin_port = htons(53);
+ sin.sin_family = AF_INET;
+ EVDNS_LOCK(base);
+ res = evdns_nameserver_add_impl_(base, (struct sockaddr*)&sin, sizeof(sin));
+ EVDNS_UNLOCK(base);
+ return res;
+}
+
+int
+evdns_nameserver_add(unsigned long int address) {
+ if (!current_base)
+ current_base = evdns_base_new(NULL, 0);
+ return evdns_base_nameserver_add(current_base, address);
+}
+
+static void
+sockaddr_setport(struct sockaddr *sa, ev_uint16_t port)
+{
+ if (sa->sa_family == AF_INET) {
+ ((struct sockaddr_in *)sa)->sin_port = htons(port);
+ } else if (sa->sa_family == AF_INET6) {
+ ((struct sockaddr_in6 *)sa)->sin6_port = htons(port);
+ }
+}
+
+static ev_uint16_t
+sockaddr_getport(struct sockaddr *sa)
+{
+ if (sa->sa_family == AF_INET) {
+ return ntohs(((struct sockaddr_in *)sa)->sin_port);
+ } else if (sa->sa_family == AF_INET6) {
+ return ntohs(((struct sockaddr_in6 *)sa)->sin6_port);
+ } else {
+ return 0;
+ }
+}
+
+/* exported function */
+int
+evdns_base_nameserver_ip_add(struct evdns_base *base, const char *ip_as_string) {
+ struct sockaddr_storage ss;
+ struct sockaddr *sa;
+ int len = sizeof(ss);
+ int res;
+ if (evutil_parse_sockaddr_port(ip_as_string, (struct sockaddr *)&ss,
+ &len)) {
+ log(EVDNS_LOG_WARN, "Unable to parse nameserver address %s",
+ ip_as_string);
+ return 4;
+ }
+ sa = (struct sockaddr *) &ss;
+ if (sockaddr_getport(sa) == 0)
+ sockaddr_setport(sa, 53);
+
+ EVDNS_LOCK(base);
+ res = evdns_nameserver_add_impl_(base, sa, len);
+ EVDNS_UNLOCK(base);
+ return res;
+}
+
+int
+evdns_nameserver_ip_add(const char *ip_as_string) {
+ if (!current_base)
+ current_base = evdns_base_new(NULL, 0);
+ return evdns_base_nameserver_ip_add(current_base, ip_as_string);
+}
+
+int
+evdns_base_nameserver_sockaddr_add(struct evdns_base *base,
+ const struct sockaddr *sa, ev_socklen_t len, unsigned flags)
+{
+ int res;
+ EVUTIL_ASSERT(base);
+ EVDNS_LOCK(base);
+ res = evdns_nameserver_add_impl_(base, sa, len);
+ EVDNS_UNLOCK(base);
+ return res;
+}
+
+int
+evdns_base_get_nameserver_addr(struct evdns_base *base, int idx,
+ struct sockaddr *sa, ev_socklen_t len)
+{
+ int result = -1;
+ int i;
+ struct nameserver *server;
+ EVDNS_LOCK(base);
+ server = base->server_head;
+ for (i = 0; i < idx && server; ++i, server = server->next) {
+ if (server->next == base->server_head)
+ goto done;
+ }
+ if (! server)
+ goto done;
+
+ if (server->addrlen > len) {
+ result = (int) server->addrlen;
+ goto done;
+ }
+
+ memcpy(sa, &server->address, server->addrlen);
+ result = (int) server->addrlen;
+done:
+ EVDNS_UNLOCK(base);
+ return result;
+}
+
+/* remove from the queue */
+static void
+evdns_request_remove(struct request *req, struct request **head)
+{
+ ASSERT_LOCKED(req->base);
+ ASSERT_VALID_REQUEST(req);
+
+#if 0
+ {
+ struct request *ptr;
+ int found = 0;
+ EVUTIL_ASSERT(*head != NULL);
+
+ ptr = *head;
+ do {
+ if (ptr == req) {
+ found = 1;
+ break;
+ }
+ ptr = ptr->next;
+ } while (ptr != *head);
+ EVUTIL_ASSERT(found);
+
+ EVUTIL_ASSERT(req->next);
+ }
+#endif
+
+ if (req->next == req) {
+ /* only item in the list */
+ *head = NULL;
+ } else {
+ req->next->prev = req->prev;
+ req->prev->next = req->next;
+ if (*head == req) *head = req->next;
+ }
+ req->next = req->prev = NULL;
+}
+
+/* insert into the tail of the queue */
+static void
+evdns_request_insert(struct request *req, struct request **head) {
+ ASSERT_LOCKED(req->base);
+ ASSERT_VALID_REQUEST(req);
+ if (!*head) {
+ *head = req;
+ req->next = req->prev = req;
+ return;
+ }
+
+ req->prev = (*head)->prev;
+ req->prev->next = req;
+ req->next = *head;
+ (*head)->prev = req;
+}
+
+static int
+string_num_dots(const char *s) {
+ int count = 0;
+ while ((s = strchr(s, '.'))) {
+ s++;
+ count++;
+ }
+ return count;
+}
+
+static struct request *
+request_new(struct evdns_base *base, struct evdns_request *handle, int type,
+ const char *name, int flags, evdns_callback_type callback,
+ void *user_ptr) {
+
+ const char issuing_now =
+ (base->global_requests_inflight < base->global_max_requests_inflight) ? 1 : 0;
+
+ const size_t name_len = strlen(name);
+ const size_t request_max_len = evdns_request_len(name_len);
+ const u16 trans_id = issuing_now ? transaction_id_pick(base) : 0xffff;
+ /* the request data is alloced in a single block with the header */
+ struct request *const req =
+ mm_malloc(sizeof(struct request) + request_max_len);
+ int rlen;
+ char namebuf[256];
+ (void) flags;
+
+ ASSERT_LOCKED(base);
+
+ if (!req) return NULL;
+
+ if (name_len >= sizeof(namebuf)) {
+ mm_free(req);
+ return NULL;
+ }
+
+ memset(req, 0, sizeof(struct request));
+ req->base = base;
+
+ evtimer_assign(&req->timeout_event, req->base->event_base, evdns_request_timeout_callback, req);
+
+ if (base->global_randomize_case) {
+ unsigned i;
+ char randbits[(sizeof(namebuf)+7)/8];
+ strlcpy(namebuf, name, sizeof(namebuf));
+ evutil_secure_rng_get_bytes(randbits, (name_len+7)/8);
+ for (i = 0; i < name_len; ++i) {
+ if (EVUTIL_ISALPHA_(namebuf[i])) {
+ if ((randbits[i >> 3] & (1<<(i & 7))))
+ namebuf[i] |= 0x20;
+ else
+ namebuf[i] &= ~0x20;
+ }
+ }
+ name = namebuf;
+ }
+
+ /* request data lives just after the header */
+ req->request = ((u8 *) req) + sizeof(struct request);
+ /* denotes that the request data shouldn't be free()ed */
+ req->request_appended = 1;
+ rlen = evdns_request_data_build(name, name_len, trans_id,
+ type, CLASS_INET, req->request, request_max_len);
+ if (rlen < 0)
+ goto err1;
+
+ req->request_len = rlen;
+ req->trans_id = trans_id;
+ req->tx_count = 0;
+ req->request_type = type;
+ req->user_pointer = user_ptr;
+ req->user_callback = callback;
+ req->ns = issuing_now ? nameserver_pick(base) : NULL;
+ req->next = req->prev = NULL;
+ req->handle = handle;
+ if (handle) {
+ handle->current_req = req;
+ handle->base = base;
+ }
+
+ return req;
+err1:
+ mm_free(req);
+ return NULL;
+}
+
+static void
+request_submit(struct request *const req) {
+ struct evdns_base *base = req->base;
+ ASSERT_LOCKED(base);
+ ASSERT_VALID_REQUEST(req);
+ if (req->ns) {
+ /* if it has a nameserver assigned then this is going */
+ /* straight into the inflight queue */
+ evdns_request_insert(req, &REQ_HEAD(base, req->trans_id));
+
+ base->global_requests_inflight++;
+ req->ns->requests_inflight++;
+
+ evdns_request_transmit(req);
+ } else {
+ evdns_request_insert(req, &base->req_waiting_head);
+ base->global_requests_waiting++;
+ }
+}
+
+/* exported function */
+void
+evdns_cancel_request(struct evdns_base *base, struct evdns_request *handle)
+{
+ struct request *req;
+
+ if (!handle->current_req)
+ return;
+
+ if (!base) {
+ /* This redundancy is silly; can we fix it? (Not for 2.0) XXXX */
+ base = handle->base;
+ if (!base)
+ base = handle->current_req->base;
+ }
+
+ EVDNS_LOCK(base);
+ if (handle->pending_cb) {
+ EVDNS_UNLOCK(base);
+ return;
+ }
+
+ req = handle->current_req;
+ ASSERT_VALID_REQUEST(req);
+
+ reply_schedule_callback(req, 0, DNS_ERR_CANCEL, NULL);
+ if (req->ns) {
+ /* remove from inflight queue */
+ request_finished(req, &REQ_HEAD(base, req->trans_id), 1);
+ } else {
+ /* remove from global_waiting head */
+ request_finished(req, &base->req_waiting_head, 1);
+ }
+ EVDNS_UNLOCK(base);
+}
+
+/* exported function */
+struct evdns_request *
+evdns_base_resolve_ipv4(struct evdns_base *base, const char *name, int flags,
+ evdns_callback_type callback, void *ptr) {
+ struct evdns_request *handle;
+ struct request *req;
+ log(EVDNS_LOG_DEBUG, "Resolve requested for %s", name);
+ handle = mm_calloc(1, sizeof(*handle));
+ if (handle == NULL)
+ return NULL;
+ EVDNS_LOCK(base);
+ if (flags & DNS_QUERY_NO_SEARCH) {
+ req =
+ request_new(base, handle, TYPE_A, name, flags,
+ callback, ptr);
+ if (req)
+ request_submit(req);
+ } else {
+ search_request_new(base, handle, TYPE_A, name, flags,
+ callback, ptr);
+ }
+ if (handle->current_req == NULL) {
+ mm_free(handle);
+ handle = NULL;
+ }
+ EVDNS_UNLOCK(base);
+ return handle;
+}
+
+int evdns_resolve_ipv4(const char *name, int flags,
+ evdns_callback_type callback, void *ptr)
+{
+ return evdns_base_resolve_ipv4(current_base, name, flags, callback, ptr)
+ ? 0 : -1;
+}
+
+
+/* exported function */
+struct evdns_request *
+evdns_base_resolve_ipv6(struct evdns_base *base,
+ const char *name, int flags,
+ evdns_callback_type callback, void *ptr)
+{
+ struct evdns_request *handle;
+ struct request *req;
+ log(EVDNS_LOG_DEBUG, "Resolve requested for %s", name);
+ handle = mm_calloc(1, sizeof(*handle));
+ if (handle == NULL)
+ return NULL;
+ EVDNS_LOCK(base);
+ if (flags & DNS_QUERY_NO_SEARCH) {
+ req = request_new(base, handle, TYPE_AAAA, name, flags,
+ callback, ptr);
+ if (req)
+ request_submit(req);
+ } else {
+ search_request_new(base, handle, TYPE_AAAA, name, flags,
+ callback, ptr);
+ }
+ if (handle->current_req == NULL) {
+ mm_free(handle);
+ handle = NULL;
+ }
+ EVDNS_UNLOCK(base);
+ return handle;
+}
+
+int evdns_resolve_ipv6(const char *name, int flags,
+ evdns_callback_type callback, void *ptr) {
+ return evdns_base_resolve_ipv6(current_base, name, flags, callback, ptr)
+ ? 0 : -1;
+}
+
+struct evdns_request *
+evdns_base_resolve_reverse(struct evdns_base *base, const struct in_addr *in, int flags, evdns_callback_type callback, void *ptr) {
+ char buf[32];
+ struct evdns_request *handle;
+ struct request *req;
+ u32 a;
+ EVUTIL_ASSERT(in);
+ a = ntohl(in->s_addr);
+ evutil_snprintf(buf, sizeof(buf), "%d.%d.%d.%d.in-addr.arpa",
+ (int)(u8)((a )&0xff),
+ (int)(u8)((a>>8 )&0xff),
+ (int)(u8)((a>>16)&0xff),
+ (int)(u8)((a>>24)&0xff));
+ handle = mm_calloc(1, sizeof(*handle));
+ if (handle == NULL)
+ return NULL;
+ log(EVDNS_LOG_DEBUG, "Resolve requested for %s (reverse)", buf);
+ EVDNS_LOCK(base);
+ req = request_new(base, handle, TYPE_PTR, buf, flags, callback, ptr);
+ if (req)
+ request_submit(req);
+ if (handle->current_req == NULL) {
+ mm_free(handle);
+ handle = NULL;
+ }
+ EVDNS_UNLOCK(base);
+ return (handle);
+}
+
+int evdns_resolve_reverse(const struct in_addr *in, int flags, evdns_callback_type callback, void *ptr) {
+ return evdns_base_resolve_reverse(current_base, in, flags, callback, ptr)
+ ? 0 : -1;
+}
+
+struct evdns_request *
+evdns_base_resolve_reverse_ipv6(struct evdns_base *base, const struct in6_addr *in, int flags, evdns_callback_type callback, void *ptr) {
+ /* 32 nybbles, 32 periods, "ip6.arpa", NUL. */
+ char buf[73];
+ char *cp;
+ struct evdns_request *handle;
+ struct request *req;
+ int i;
+ EVUTIL_ASSERT(in);
+ cp = buf;
+ for (i=15; i >= 0; --i) {
+ u8 byte = in->s6_addr[i];
+ *cp++ = "0123456789abcdef"[byte & 0x0f];
+ *cp++ = '.';
+ *cp++ = "0123456789abcdef"[byte >> 4];
+ *cp++ = '.';
+ }
+ EVUTIL_ASSERT(cp + strlen("ip6.arpa") < buf+sizeof(buf));
+ memcpy(cp, "ip6.arpa", strlen("ip6.arpa")+1);
+ handle = mm_calloc(1, sizeof(*handle));
+ if (handle == NULL)
+ return NULL;
+ log(EVDNS_LOG_DEBUG, "Resolve requested for %s (reverse)", buf);
+ EVDNS_LOCK(base);
+ req = request_new(base, handle, TYPE_PTR, buf, flags, callback, ptr);
+ if (req)
+ request_submit(req);
+ if (handle->current_req == NULL) {
+ mm_free(handle);
+ handle = NULL;
+ }
+ EVDNS_UNLOCK(base);
+ return (handle);
+}
+
+int evdns_resolve_reverse_ipv6(const struct in6_addr *in, int flags, evdns_callback_type callback, void *ptr) {
+ return evdns_base_resolve_reverse_ipv6(current_base, in, flags, callback, ptr)
+ ? 0 : -1;
+}
+
+/* ================================================================= */
+/* Search support */
+/* */
+/* the libc resolver has support for searching a number of domains */
+/* to find a name. If nothing else then it takes the single domain */
+/* from the gethostname() call. */
+/* */
+/* It can also be configured via the domain and search options in a */
+/* resolv.conf. */
+/* */
+/* The ndots option controls how many dots it takes for the resolver */
+/* to decide that a name is non-local and so try a raw lookup first. */
+
+struct search_domain {
+ int len;
+ struct search_domain *next;
+ /* the text string is appended to this structure */
+};
+
+struct search_state {
+ int refcount;
+ int ndots;
+ int num_domains;
+ struct search_domain *head;
+};
+
+static void
+search_state_decref(struct search_state *const state) {
+ if (!state) return;
+ state->refcount--;
+ if (!state->refcount) {
+ struct search_domain *next, *dom;
+ for (dom = state->head; dom; dom = next) {
+ next = dom->next;
+ mm_free(dom);
+ }
+ mm_free(state);
+ }
+}
+
+static struct search_state *
+search_state_new(void) {
+ struct search_state *state = (struct search_state *) mm_malloc(sizeof(struct search_state));
+ if (!state) return NULL;
+ memset(state, 0, sizeof(struct search_state));
+ state->refcount = 1;
+ state->ndots = 1;
+
+ return state;
+}
+
+static void
+search_postfix_clear(struct evdns_base *base) {
+ search_state_decref(base->global_search_state);
+
+ base->global_search_state = search_state_new();
+}
+
+/* exported function */
+void
+evdns_base_search_clear(struct evdns_base *base)
+{
+ EVDNS_LOCK(base);
+ search_postfix_clear(base);
+ EVDNS_UNLOCK(base);
+}
+
+void
+evdns_search_clear(void) {
+ evdns_base_search_clear(current_base);
+}
+
+static void
+search_postfix_add(struct evdns_base *base, const char *domain) {
+ size_t domain_len;
+ struct search_domain *sdomain;
+ while (domain[0] == '.') domain++;
+ domain_len = strlen(domain);
+
+ ASSERT_LOCKED(base);
+ if (!base->global_search_state) base->global_search_state = search_state_new();
+ if (!base->global_search_state) return;
+ base->global_search_state->num_domains++;
+
+ sdomain = (struct search_domain *) mm_malloc(sizeof(struct search_domain) + domain_len);
+ if (!sdomain) return;
+ memcpy( ((u8 *) sdomain) + sizeof(struct search_domain), domain, domain_len);
+ sdomain->next = base->global_search_state->head;
+ sdomain->len = (int) domain_len;
+
+ base->global_search_state->head = sdomain;
+}
+
+/* reverse the order of members in the postfix list. This is needed because, */
+/* when parsing resolv.conf we push elements in the wrong order */
+static void
+search_reverse(struct evdns_base *base) {
+ struct search_domain *cur, *prev = NULL, *next;
+ ASSERT_LOCKED(base);
+ cur = base->global_search_state->head;
+ while (cur) {
+ next = cur->next;
+ cur->next = prev;
+ prev = cur;
+ cur = next;
+ }
+
+ base->global_search_state->head = prev;
+}
+
+/* exported function */
+void
+evdns_base_search_add(struct evdns_base *base, const char *domain) {
+ EVDNS_LOCK(base);
+ search_postfix_add(base, domain);
+ EVDNS_UNLOCK(base);
+}
+void
+evdns_search_add(const char *domain) {
+ evdns_base_search_add(current_base, domain);
+}
+
+/* exported function */
+void
+evdns_base_search_ndots_set(struct evdns_base *base, const int ndots) {
+ EVDNS_LOCK(base);
+ if (!base->global_search_state) base->global_search_state = search_state_new();
+ if (base->global_search_state)
+ base->global_search_state->ndots = ndots;
+ EVDNS_UNLOCK(base);
+}
+void
+evdns_search_ndots_set(const int ndots) {
+ evdns_base_search_ndots_set(current_base, ndots);
+}
+
+static void
+search_set_from_hostname(struct evdns_base *base) {
+ char hostname[HOST_NAME_MAX + 1], *domainname;
+
+ ASSERT_LOCKED(base);
+ search_postfix_clear(base);
+ if (gethostname(hostname, sizeof(hostname))) return;
+ domainname = strchr(hostname, '.');
+ if (!domainname) return;
+ search_postfix_add(base, domainname);
+}
+
+/* warning: returns malloced string */
+static char *
+search_make_new(const struct search_state *const state, int n, const char *const base_name) {
+ const size_t base_len = strlen(base_name);
+ const char need_to_append_dot = base_name[base_len - 1] == '.' ? 0 : 1;
+ struct search_domain *dom;
+
+ for (dom = state->head; dom; dom = dom->next) {
+ if (!n--) {
+ /* this is the postfix we want */
+ /* the actual postfix string is kept at the end of the structure */
+ const u8 *const postfix = ((u8 *) dom) + sizeof(struct search_domain);
+ const int postfix_len = dom->len;
+ char *const newname = (char *) mm_malloc(base_len + need_to_append_dot + postfix_len + 1);
+ if (!newname) return NULL;
+ memcpy(newname, base_name, base_len);
+ if (need_to_append_dot) newname[base_len] = '.';
+ memcpy(newname + base_len + need_to_append_dot, postfix, postfix_len);
+ newname[base_len + need_to_append_dot + postfix_len] = 0;
+ return newname;
+ }
+ }
+
+ /* we ran off the end of the list and still didn't find the requested string */
+ EVUTIL_ASSERT(0);
+ return NULL; /* unreachable; stops warnings in some compilers. */
+}
+
+static struct request *
+search_request_new(struct evdns_base *base, struct evdns_request *handle,
+ int type, const char *const name, int flags,
+ evdns_callback_type user_callback, void *user_arg) {
+ ASSERT_LOCKED(base);
+ EVUTIL_ASSERT(type == TYPE_A || type == TYPE_AAAA);
+ EVUTIL_ASSERT(handle->current_req == NULL);
+ if ( ((flags & DNS_QUERY_NO_SEARCH) == 0) &&
+ base->global_search_state &&
+ base->global_search_state->num_domains) {
+ /* we have some domains to search */
+ struct request *req;
+ if (string_num_dots(name) >= base->global_search_state->ndots) {
+ req = request_new(base, handle, type, name, flags, user_callback, user_arg);
+ if (!req) return NULL;
+ handle->search_index = -1;
+ } else {
+ char *const new_name = search_make_new(base->global_search_state, 0, name);
+ if (!new_name) return NULL;
+ req = request_new(base, handle, type, new_name, flags, user_callback, user_arg);
+ mm_free(new_name);
+ if (!req) return NULL;
+ handle->search_index = 0;
+ }
+ EVUTIL_ASSERT(handle->search_origname == NULL);
+ handle->search_origname = mm_strdup(name);
+ if (handle->search_origname == NULL) {
+ /* XXX Should we dealloc req? If yes, how? */
+ if (req)
+ mm_free(req);
+ return NULL;
+ }
+ handle->search_state = base->global_search_state;
+ handle->search_flags = flags;
+ base->global_search_state->refcount++;
+ request_submit(req);
+ return req;
+ } else {
+ struct request *const req = request_new(base, handle, type, name, flags, user_callback, user_arg);
+ if (!req) return NULL;
+ request_submit(req);
+ return req;
+ }
+}
+
+/* this is called when a request has failed to find a name. We need to check */
+/* if it is part of a search and, if so, try the next name in the list */
+/* returns: */
+/* 0 another request has been submitted */
+/* 1 no more requests needed */
+static int
+search_try_next(struct evdns_request *const handle) {
+ struct request *req = handle->current_req;
+ struct evdns_base *base = req->base;
+ struct request *newreq;
+ ASSERT_LOCKED(base);
+ if (handle->search_state) {
+ /* it is part of a search */
+ char *new_name;
+ handle->search_index++;
+ if (handle->search_index >= handle->search_state->num_domains) {
+ /* no more postfixes to try, however we may need to try */
+ /* this name without a postfix */
+ if (string_num_dots(handle->search_origname) < handle->search_state->ndots) {
+ /* yep, we need to try it raw */
+ newreq = request_new(base, NULL, req->request_type, handle->search_origname, handle->search_flags, req->user_callback, req->user_pointer);
+ log(EVDNS_LOG_DEBUG, "Search: trying raw query %s", handle->search_origname);
+ if (newreq) {
+ search_request_finished(handle);
+ goto submit_next;
+ }
+ }
+ return 1;
+ }
+
+ new_name = search_make_new(handle->search_state, handle->search_index, handle->search_origname);
+ if (!new_name) return 1;
+ log(EVDNS_LOG_DEBUG, "Search: now trying %s (%d)", new_name, handle->search_index);
+ newreq = request_new(base, NULL, req->request_type, new_name, handle->search_flags, req->user_callback, req->user_pointer);
+ mm_free(new_name);
+ if (!newreq) return 1;
+ goto submit_next;
+ }
+ return 1;
+
+submit_next:
+ request_finished(req, &REQ_HEAD(req->base, req->trans_id), 0);
+ handle->current_req = newreq;
+ newreq->handle = handle;
+ request_submit(newreq);
+ return 0;
+}
+
+static void
+search_request_finished(struct evdns_request *const handle) {
+ ASSERT_LOCKED(handle->current_req->base);
+ if (handle->search_state) {
+ search_state_decref(handle->search_state);
+ handle->search_state = NULL;
+ }
+ if (handle->search_origname) {
+ mm_free(handle->search_origname);
+ handle->search_origname = NULL;
+ }
+}
+
+/* ================================================================= */
+/* Parsing resolv.conf files */
+
+static void
+evdns_resolv_set_defaults(struct evdns_base *base, int flags) {
+ /* if the file isn't found then we assume a local resolver */
+ ASSERT_LOCKED(base);
+ if (flags & DNS_OPTION_SEARCH) search_set_from_hostname(base);
+ if (flags & DNS_OPTION_NAMESERVERS) evdns_base_nameserver_ip_add(base,"127.0.0.1");
+}
+
+#ifndef EVENT__HAVE_STRTOK_R
+static char *
+strtok_r(char *s, const char *delim, char **state) {
+ char *cp, *start;
+ start = cp = s ? s : *state;
+ if (!cp)
+ return NULL;
+ while (*cp && !strchr(delim, *cp))
+ ++cp;
+ if (!*cp) {
+ if (cp == start)
+ return NULL;
+ *state = NULL;
+ return start;
+ } else {
+ *cp++ = '\0';
+ *state = cp;
+ return start;
+ }
+}
+#endif
+
+/* helper version of atoi which returns -1 on error */
+static int
+strtoint(const char *const str)
+{
+ char *endptr;
+ const int r = strtol(str, &endptr, 10);
+ if (*endptr) return -1;
+ return r;
+}
+
+/* Parse a number of seconds into a timeval; return -1 on error. */
+static int
+evdns_strtotimeval(const char *const str, struct timeval *out)
+{
+ double d;
+ char *endptr;
+ d = strtod(str, &endptr);
+ if (*endptr) return -1;
+ if (d < 0) return -1;
+ out->tv_sec = (int) d;
+ out->tv_usec = (int) ((d - (int) d)*1000000);
+ if (out->tv_sec == 0 && out->tv_usec < 1000) /* less than 1 msec */
+ return -1;
+ return 0;
+}
+
+/* helper version of atoi that returns -1 on error and clips to bounds. */
+static int
+strtoint_clipped(const char *const str, int min, int max)
+{
+ int r = strtoint(str);
+ if (r == -1)
+ return r;
+ else if (r<min)
+ return min;
+ else if (r>max)
+ return max;
+ else
+ return r;
+}
+
+static int
+evdns_base_set_max_requests_inflight(struct evdns_base *base, int maxinflight)
+{
+ int old_n_heads = base->n_req_heads, n_heads;
+ struct request **old_heads = base->req_heads, **new_heads, *req;
+ int i;
+
+ ASSERT_LOCKED(base);
+ if (maxinflight < 1)
+ maxinflight = 1;
+ n_heads = (maxinflight+4) / 5;
+ EVUTIL_ASSERT(n_heads > 0);
+ new_heads = mm_calloc(n_heads, sizeof(struct request*));
+ if (!new_heads)
+ return (-1);
+ if (old_heads) {
+ for (i = 0; i < old_n_heads; ++i) {
+ while (old_heads[i]) {
+ req = old_heads[i];
+ evdns_request_remove(req, &old_heads[i]);
+ evdns_request_insert(req, &new_heads[req->trans_id % n_heads]);
+ }
+ }
+ mm_free(old_heads);
+ }
+ base->req_heads = new_heads;
+ base->n_req_heads = n_heads;
+ base->global_max_requests_inflight = maxinflight;
+ return (0);
+}
+
+/* exported function */
+int
+evdns_base_set_option(struct evdns_base *base,
+ const char *option, const char *val)
+{
+ int res;
+ EVDNS_LOCK(base);
+ res = evdns_base_set_option_impl(base, option, val, DNS_OPTIONS_ALL);
+ EVDNS_UNLOCK(base);
+ return res;
+}
+
+static inline int
+str_matches_option(const char *s1, const char *optionname)
+{
+ /* Option names are given as "option:" We accept either 'option' in
+ * s1, or 'option:randomjunk'. The latter form is to implement the
+ * resolv.conf parser. */
+ size_t optlen = strlen(optionname);
+ size_t slen = strlen(s1);
+ if (slen == optlen || slen == optlen - 1)
+ return !strncmp(s1, optionname, slen);
+ else if (slen > optlen)
+ return !strncmp(s1, optionname, optlen);
+ else
+ return 0;
+}
+
+static int
+evdns_base_set_option_impl(struct evdns_base *base,
+ const char *option, const char *val, int flags)
+{
+ ASSERT_LOCKED(base);
+ if (str_matches_option(option, "ndots:")) {
+ const int ndots = strtoint(val);
+ if (ndots == -1) return -1;
+ if (!(flags & DNS_OPTION_SEARCH)) return 0;
+ log(EVDNS_LOG_DEBUG, "Setting ndots to %d", ndots);
+ if (!base->global_search_state) base->global_search_state = search_state_new();
+ if (!base->global_search_state) return -1;
+ base->global_search_state->ndots = ndots;
+ } else if (str_matches_option(option, "timeout:")) {
+ struct timeval tv;
+ if (evdns_strtotimeval(val, &tv) == -1) return -1;
+ if (!(flags & DNS_OPTION_MISC)) return 0;
+ log(EVDNS_LOG_DEBUG, "Setting timeout to %s", val);
+ memcpy(&base->global_timeout, &tv, sizeof(struct timeval));
+ } else if (str_matches_option(option, "getaddrinfo-allow-skew:")) {
+ struct timeval tv;
+ if (evdns_strtotimeval(val, &tv) == -1) return -1;
+ if (!(flags & DNS_OPTION_MISC)) return 0;
+ log(EVDNS_LOG_DEBUG, "Setting getaddrinfo-allow-skew to %s",
+ val);
+ memcpy(&base->global_getaddrinfo_allow_skew, &tv,
+ sizeof(struct timeval));
+ } else if (str_matches_option(option, "max-timeouts:")) {
+ const int maxtimeout = strtoint_clipped(val, 1, 255);
+ if (maxtimeout == -1) return -1;
+ if (!(flags & DNS_OPTION_MISC)) return 0;
+ log(EVDNS_LOG_DEBUG, "Setting maximum allowed timeouts to %d",
+ maxtimeout);
+ base->global_max_nameserver_timeout = maxtimeout;
+ } else if (str_matches_option(option, "max-inflight:")) {
+ const int maxinflight = strtoint_clipped(val, 1, 65000);
+ if (maxinflight == -1) return -1;
+ if (!(flags & DNS_OPTION_MISC)) return 0;
+ log(EVDNS_LOG_DEBUG, "Setting maximum inflight requests to %d",
+ maxinflight);
+ evdns_base_set_max_requests_inflight(base, maxinflight);
+ } else if (str_matches_option(option, "attempts:")) {
+ int retries = strtoint(val);
+ if (retries == -1) return -1;
+ if (retries > 255) retries = 255;
+ if (!(flags & DNS_OPTION_MISC)) return 0;
+ log(EVDNS_LOG_DEBUG, "Setting retries to %d", retries);
+ base->global_max_retransmits = retries;
+ } else if (str_matches_option(option, "randomize-case:")) {
+ int randcase = strtoint(val);
+ if (!(flags & DNS_OPTION_MISC)) return 0;
+ base->global_randomize_case = randcase;
+ } else if (str_matches_option(option, "bind-to:")) {
+ /* XXX This only applies to successive nameservers, not
+ * to already-configured ones. We might want to fix that. */
+ int len = sizeof(base->global_outgoing_address);
+ if (!(flags & DNS_OPTION_NAMESERVERS)) return 0;
+ if (evutil_parse_sockaddr_port(val,
+ (struct sockaddr*)&base->global_outgoing_address, &len))
+ return -1;
+ base->global_outgoing_addrlen = len;
+ } else if (str_matches_option(option, "initial-probe-timeout:")) {
+ struct timeval tv;
+ if (evdns_strtotimeval(val, &tv) == -1) return -1;
+ if (tv.tv_sec > 3600)
+ tv.tv_sec = 3600;
+ if (!(flags & DNS_OPTION_MISC)) return 0;
+ log(EVDNS_LOG_DEBUG, "Setting initial probe timeout to %s",
+ val);
+ memcpy(&base->global_nameserver_probe_initial_timeout, &tv,
+ sizeof(tv));
+ }
+ return 0;
+}
+
+int
+evdns_set_option(const char *option, const char *val, int flags)
+{
+ if (!current_base)
+ current_base = evdns_base_new(NULL, 0);
+ return evdns_base_set_option(current_base, option, val);
+}
+
+static void
+resolv_conf_parse_line(struct evdns_base *base, char *const start, int flags) {
+ char *strtok_state;
+ static const char *const delims = " \t";
+#define NEXT_TOKEN strtok_r(NULL, delims, &strtok_state)
+
+
+ char *const first_token = strtok_r(start, delims, &strtok_state);
+ ASSERT_LOCKED(base);
+ if (!first_token) return;
+
+ if (!strcmp(first_token, "nameserver") && (flags & DNS_OPTION_NAMESERVERS)) {
+ const char *const nameserver = NEXT_TOKEN;
+
+ if (nameserver)
+ evdns_base_nameserver_ip_add(base, nameserver);
+ } else if (!strcmp(first_token, "domain") && (flags & DNS_OPTION_SEARCH)) {
+ const char *const domain = NEXT_TOKEN;
+ if (domain) {
+ search_postfix_clear(base);
+ search_postfix_add(base, domain);
+ }
+ } else if (!strcmp(first_token, "search") && (flags & DNS_OPTION_SEARCH)) {
+ const char *domain;
+ search_postfix_clear(base);
+
+ while ((domain = NEXT_TOKEN)) {
+ search_postfix_add(base, domain);
+ }
+ search_reverse(base);
+ } else if (!strcmp(first_token, "options")) {
+ const char *option;
+ while ((option = NEXT_TOKEN)) {
+ const char *val = strchr(option, ':');
+ evdns_base_set_option_impl(base, option, val ? val+1 : "", flags);
+ }
+ }
+#undef NEXT_TOKEN
+}
+
+/* exported function */
+/* returns: */
+/* 0 no errors */
+/* 1 failed to open file */
+/* 2 failed to stat file */
+/* 3 file too large */
+/* 4 out of memory */
+/* 5 short read from file */
+int
+evdns_base_resolv_conf_parse(struct evdns_base *base, int flags, const char *const filename) {
+ int res;
+ EVDNS_LOCK(base);
+ res = evdns_base_resolv_conf_parse_impl(base, flags, filename);
+ EVDNS_UNLOCK(base);
+ return res;
+}
+
+static char *
+evdns_get_default_hosts_filename(void)
+{
+#ifdef _WIN32
+ /* Windows is a little coy about where it puts its configuration
+ * files. Sure, they're _usually_ in C:\windows\system32, but
+ * there's no reason in principle they couldn't be in
+ * W:\hoboken chicken emergency\
+ */
+ char path[MAX_PATH+1];
+ static const char hostfile[] = "\\drivers\\etc\\hosts";
+ char *path_out;
+ size_t len_out;
+
+ if (! SHGetSpecialFolderPathA(NULL, path, CSIDL_SYSTEM, 0))
+ return NULL;
+ len_out = strlen(path)+strlen(hostfile)+1;
+ path_out = mm_malloc(len_out);
+ evutil_snprintf(path_out, len_out, "%s%s", path, hostfile);
+ return path_out;
+#else
+ return mm_strdup("/etc/hosts");
+#endif
+}
+
+static int
+evdns_base_resolv_conf_parse_impl(struct evdns_base *base, int flags, const char *const filename) {
+ size_t n;
+ char *resolv;
+ char *start;
+ int err = 0;
+
+ log(EVDNS_LOG_DEBUG, "Parsing resolv.conf file %s", filename);
+
+ if (flags & DNS_OPTION_HOSTSFILE) {
+ char *fname = evdns_get_default_hosts_filename();
+ evdns_base_load_hosts(base, fname);
+ if (fname)
+ mm_free(fname);
+ }
+
+ if ((err = evutil_read_file_(filename, &resolv, &n, 0)) < 0) {
+ if (err == -1) {
+ /* No file. */
+ evdns_resolv_set_defaults(base, flags);
+ return 1;
+ } else {
+ return 2;
+ }
+ }
+
+ start = resolv;
+ for (;;) {
+ char *const newline = strchr(start, '\n');
+ if (!newline) {
+ resolv_conf_parse_line(base, start, flags);
+ break;
+ } else {
+ *newline = 0;
+ resolv_conf_parse_line(base, start, flags);
+ start = newline + 1;
+ }
+ }
+
+ if (!base->server_head && (flags & DNS_OPTION_NAMESERVERS)) {
+ /* no nameservers were configured. */
+ evdns_base_nameserver_ip_add(base, "127.0.0.1");
+ err = 6;
+ }
+ if (flags & DNS_OPTION_SEARCH && (!base->global_search_state || base->global_search_state->num_domains == 0)) {
+ search_set_from_hostname(base);
+ }
+
+ mm_free(resolv);
+ return err;
+}
+
+int
+evdns_resolv_conf_parse(int flags, const char *const filename) {
+ if (!current_base)
+ current_base = evdns_base_new(NULL, 0);
+ return evdns_base_resolv_conf_parse(current_base, flags, filename);
+}
+
+
+#ifdef _WIN32
+/* Add multiple nameservers from a space-or-comma-separated list. */
+static int
+evdns_nameserver_ip_add_line(struct evdns_base *base, const char *ips) {
+ const char *addr;
+ char *buf;
+ int r;
+ ASSERT_LOCKED(base);
+ while (*ips) {
+ while (isspace(*ips) || *ips == ',' || *ips == '\t')
+ ++ips;
+ addr = ips;
+ while (isdigit(*ips) || *ips == '.' || *ips == ':' ||
+ *ips=='[' || *ips==']')
+ ++ips;
+ buf = mm_malloc(ips-addr+1);
+ if (!buf) return 4;
+ memcpy(buf, addr, ips-addr);
+ buf[ips-addr] = '\0';
+ r = evdns_base_nameserver_ip_add(base, buf);
+ mm_free(buf);
+ if (r) return r;
+ }
+ return 0;
+}
+
+typedef DWORD(WINAPI *GetNetworkParams_fn_t)(FIXED_INFO *, DWORD*);
+
+/* Use the windows GetNetworkParams interface in iphlpapi.dll to */
+/* figure out what our nameservers are. */
+static int
+load_nameservers_with_getnetworkparams(struct evdns_base *base)
+{
+ /* Based on MSDN examples and inspection of c-ares code. */
+ FIXED_INFO *fixed;
+ HMODULE handle = 0;
+ ULONG size = sizeof(FIXED_INFO);
+ void *buf = NULL;
+ int status = 0, r, added_any;
+ IP_ADDR_STRING *ns;
+ GetNetworkParams_fn_t fn;
+
+ ASSERT_LOCKED(base);
+ if (!(handle = evutil_load_windows_system_library_(
+ TEXT("iphlpapi.dll")))) {
+ log(EVDNS_LOG_WARN, "Could not open iphlpapi.dll");
+ status = -1;
+ goto done;
+ }
+ if (!(fn = (GetNetworkParams_fn_t) GetProcAddress(handle, "GetNetworkParams"))) {
+ log(EVDNS_LOG_WARN, "Could not get address of function.");
+ status = -1;
+ goto done;
+ }
+
+ buf = mm_malloc(size);
+ if (!buf) { status = 4; goto done; }
+ fixed = buf;
+ r = fn(fixed, &size);
+ if (r != ERROR_SUCCESS && r != ERROR_BUFFER_OVERFLOW) {
+ status = -1;
+ goto done;
+ }
+ if (r != ERROR_SUCCESS) {
+ mm_free(buf);
+ buf = mm_malloc(size);
+ if (!buf) { status = 4; goto done; }
+ fixed = buf;
+ r = fn(fixed, &size);
+ if (r != ERROR_SUCCESS) {
+ log(EVDNS_LOG_DEBUG, "fn() failed.");
+ status = -1;
+ goto done;
+ }
+ }
+
+ EVUTIL_ASSERT(fixed);
+ added_any = 0;
+ ns = &(fixed->DnsServerList);
+ while (ns) {
+ r = evdns_nameserver_ip_add_line(base, ns->IpAddress.String);
+ if (r) {
+ log(EVDNS_LOG_DEBUG,"Could not add nameserver %s to list,error: %d",
+ (ns->IpAddress.String),(int)GetLastError());
+ status = r;
+ } else {
+ ++added_any;
+ log(EVDNS_LOG_DEBUG,"Successfully added %s as nameserver",ns->IpAddress.String);
+ }
+
+ ns = ns->Next;
+ }
+
+ if (!added_any) {
+ log(EVDNS_LOG_DEBUG, "No nameservers added.");
+ if (status == 0)
+ status = -1;
+ } else {
+ status = 0;
+ }
+
+ done:
+ if (buf)
+ mm_free(buf);
+ if (handle)
+ FreeLibrary(handle);
+ return status;
+}
+
+static int
+config_nameserver_from_reg_key(struct evdns_base *base, HKEY key, const TCHAR *subkey)
+{
+ char *buf;
+ DWORD bufsz = 0, type = 0;
+ int status = 0;
+
+ ASSERT_LOCKED(base);
+ if (RegQueryValueEx(key, subkey, 0, &type, NULL, &bufsz)
+ != ERROR_MORE_DATA)
+ return -1;
+ if (!(buf = mm_malloc(bufsz)))
+ return -1;
+
+ if (RegQueryValueEx(key, subkey, 0, &type, (LPBYTE)buf, &bufsz)
+ == ERROR_SUCCESS && bufsz > 1) {
+ status = evdns_nameserver_ip_add_line(base,buf);
+ }
+
+ mm_free(buf);
+ return status;
+}
+
+#define SERVICES_KEY TEXT("System\\CurrentControlSet\\Services\\")
+#define WIN_NS_9X_KEY SERVICES_KEY TEXT("VxD\\MSTCP")
+#define WIN_NS_NT_KEY SERVICES_KEY TEXT("Tcpip\\Parameters")
+
+static int
+load_nameservers_from_registry(struct evdns_base *base)
+{
+ int found = 0;
+ int r;
+#define TRY(k, name) \
+ if (!found && config_nameserver_from_reg_key(base,k,TEXT(name)) == 0) { \
+ log(EVDNS_LOG_DEBUG,"Found nameservers in %s/%s",#k,name); \
+ found = 1; \
+ } else if (!found) { \
+ log(EVDNS_LOG_DEBUG,"Didn't find nameservers in %s/%s", \
+ #k,#name); \
+ }
+
+ ASSERT_LOCKED(base);
+
+ if (((int)GetVersion()) > 0) { /* NT */
+ HKEY nt_key = 0, interfaces_key = 0;
+
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0,
+ KEY_READ, &nt_key) != ERROR_SUCCESS) {
+ log(EVDNS_LOG_DEBUG,"Couldn't open nt key, %d",(int)GetLastError());
+ return -1;
+ }
+ r = RegOpenKeyEx(nt_key, TEXT("Interfaces"), 0,
+ KEY_QUERY_VALUE|KEY_ENUMERATE_SUB_KEYS,
+ &interfaces_key);
+ if (r != ERROR_SUCCESS) {
+ log(EVDNS_LOG_DEBUG,"Couldn't open interfaces key, %d",(int)GetLastError());
+ return -1;
+ }
+ TRY(nt_key, "NameServer");
+ TRY(nt_key, "DhcpNameServer");
+ TRY(interfaces_key, "NameServer");
+ TRY(interfaces_key, "DhcpNameServer");
+ RegCloseKey(interfaces_key);
+ RegCloseKey(nt_key);
+ } else {
+ HKEY win_key = 0;
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_NS_9X_KEY, 0,
+ KEY_READ, &win_key) != ERROR_SUCCESS) {
+ log(EVDNS_LOG_DEBUG, "Couldn't open registry key, %d", (int)GetLastError());
+ return -1;
+ }
+ TRY(win_key, "NameServer");
+ RegCloseKey(win_key);
+ }
+
+ if (found == 0) {
+ log(EVDNS_LOG_WARN,"Didn't find any nameservers.");
+ }
+
+ return found ? 0 : -1;
+#undef TRY
+}
+
+int
+evdns_base_config_windows_nameservers(struct evdns_base *base)
+{
+ int r;
+ char *fname;
+ if (base == NULL)
+ base = current_base;
+ if (base == NULL)
+ return -1;
+ EVDNS_LOCK(base);
+ fname = evdns_get_default_hosts_filename();
+ log(EVDNS_LOG_DEBUG, "Loading hosts entries from %s", fname);
+ evdns_base_load_hosts(base, fname);
+ if (fname)
+ mm_free(fname);
+
+ if (load_nameservers_with_getnetworkparams(base) == 0) {
+ EVDNS_UNLOCK(base);
+ return 0;
+ }
+ r = load_nameservers_from_registry(base);
+
+ EVDNS_UNLOCK(base);
+ return r;
+}
+
+int
+evdns_config_windows_nameservers(void)
+{
+ if (!current_base) {
+ current_base = evdns_base_new(NULL, 1);
+ return current_base == NULL ? -1 : 0;
+ } else {
+ return evdns_base_config_windows_nameservers(current_base);
+ }
+}
+#endif
+
+struct evdns_base *
+evdns_base_new(struct event_base *event_base, int flags)
+{
+ struct evdns_base *base;
+
+ if (evutil_secure_rng_init() < 0) {
+ log(EVDNS_LOG_WARN, "Unable to seed random number generator; "
+ "DNS can't run.");
+ return NULL;
+ }
+
+ /* Give the evutil library a hook into its evdns-enabled
+ * functionality. We can't just call evdns_getaddrinfo directly or
+ * else libevent-core will depend on libevent-extras. */
+ evutil_set_evdns_getaddrinfo_fn_(evdns_getaddrinfo);
+
+ base = mm_malloc(sizeof(struct evdns_base));
+ if (base == NULL)
+ return (NULL);
+ memset(base, 0, sizeof(struct evdns_base));
+ base->req_waiting_head = NULL;
+
+ EVTHREAD_ALLOC_LOCK(base->lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+ EVDNS_LOCK(base);
+
+ /* Set max requests inflight and allocate req_heads. */
+ base->req_heads = NULL;
+
+ evdns_base_set_max_requests_inflight(base, 64);
+
+ base->server_head = NULL;
+ base->event_base = event_base;
+ base->global_good_nameservers = base->global_requests_inflight =
+ base->global_requests_waiting = 0;
+
+ base->global_timeout.tv_sec = 5;
+ base->global_timeout.tv_usec = 0;
+ base->global_max_reissues = 1;
+ base->global_max_retransmits = 3;
+ base->global_max_nameserver_timeout = 3;
+ base->global_search_state = NULL;
+ base->global_randomize_case = 1;
+ base->global_getaddrinfo_allow_skew.tv_sec = 3;
+ base->global_getaddrinfo_allow_skew.tv_usec = 0;
+ base->global_nameserver_probe_initial_timeout.tv_sec = 10;
+ base->global_nameserver_probe_initial_timeout.tv_usec = 0;
+
+ TAILQ_INIT(&base->hostsdb);
+
+#define EVDNS_BASE_ALL_FLAGS (0x8001)
+ if (flags & ~EVDNS_BASE_ALL_FLAGS) {
+ flags = EVDNS_BASE_INITIALIZE_NAMESERVERS;
+ log(EVDNS_LOG_WARN,
+ "Unrecognized flag passed to evdns_base_new(). Assuming "
+ "you meant EVDNS_BASE_INITIALIZE_NAMESERVERS.");
+ }
+#undef EVDNS_BASE_ALL_FLAGS
+
+ if (flags & EVDNS_BASE_INITIALIZE_NAMESERVERS) {
+ int r;
+#ifdef _WIN32
+ r = evdns_base_config_windows_nameservers(base);
+#else
+ r = evdns_base_resolv_conf_parse(base, DNS_OPTIONS_ALL, "/etc/resolv.conf");
+#endif
+ if (r == -1) {
+ evdns_base_free_and_unlock(base, 0);
+ return NULL;
+ }
+ }
+ if (flags & EVDNS_BASE_DISABLE_WHEN_INACTIVE) {
+ base->disable_when_inactive = 1;
+ }
+
+ EVDNS_UNLOCK(base);
+ return base;
+}
+
+int
+evdns_init(void)
+{
+ struct evdns_base *base = evdns_base_new(NULL, 1);
+ if (base) {
+ current_base = base;
+ return 0;
+ } else {
+ return -1;
+ }
+}
+
+const char *
+evdns_err_to_string(int err)
+{
+ switch (err) {
+ case DNS_ERR_NONE: return "no error";
+ case DNS_ERR_FORMAT: return "misformatted query";
+ case DNS_ERR_SERVERFAILED: return "server failed";
+ case DNS_ERR_NOTEXIST: return "name does not exist";
+ case DNS_ERR_NOTIMPL: return "query not implemented";
+ case DNS_ERR_REFUSED: return "refused";
+
+ case DNS_ERR_TRUNCATED: return "reply truncated or ill-formed";
+ case DNS_ERR_UNKNOWN: return "unknown";
+ case DNS_ERR_TIMEOUT: return "request timed out";
+ case DNS_ERR_SHUTDOWN: return "dns subsystem shut down";
+ case DNS_ERR_CANCEL: return "dns request canceled";
+ case DNS_ERR_NODATA: return "no records in the reply";
+ default: return "[Unknown error code]";
+ }
+}
+
+static void
+evdns_nameserver_free(struct nameserver *server)
+{
+ if (server->socket >= 0)
+ evutil_closesocket(server->socket);
+ (void) event_del(&server->event);
+ event_debug_unassign(&server->event);
+ if (server->state == 0)
+ (void) event_del(&server->timeout_event);
+ if (server->probe_request) {
+ evdns_cancel_request(server->base, server->probe_request);
+ server->probe_request = NULL;
+ }
+ event_debug_unassign(&server->timeout_event);
+ mm_free(server);
+}
+
+static void
+evdns_base_free_and_unlock(struct evdns_base *base, int fail_requests)
+{
+ struct nameserver *server, *server_next;
+ struct search_domain *dom, *dom_next;
+ int i;
+
+ /* Requires that we hold the lock. */
+
+ /* TODO(nickm) we might need to refcount here. */
+
+ for (i = 0; i < base->n_req_heads; ++i) {
+ while (base->req_heads[i]) {
+ if (fail_requests)
+ reply_schedule_callback(base->req_heads[i], 0, DNS_ERR_SHUTDOWN, NULL);
+ request_finished(base->req_heads[i], &REQ_HEAD(base, base->req_heads[i]->trans_id), 1);
+ }
+ }
+ while (base->req_waiting_head) {
+ if (fail_requests)
+ reply_schedule_callback(base->req_waiting_head, 0, DNS_ERR_SHUTDOWN, NULL);
+ request_finished(base->req_waiting_head, &base->req_waiting_head, 1);
+ }
+ base->global_requests_inflight = base->global_requests_waiting = 0;
+
+ for (server = base->server_head; server; server = server_next) {
+ server_next = server->next;
+ evdns_nameserver_free(server);
+ if (server_next == base->server_head)
+ break;
+ }
+ base->server_head = NULL;
+ base->global_good_nameservers = 0;
+
+ if (base->global_search_state) {
+ for (dom = base->global_search_state->head; dom; dom = dom_next) {
+ dom_next = dom->next;
+ mm_free(dom);
+ }
+ mm_free(base->global_search_state);
+ base->global_search_state = NULL;
+ }
+
+ {
+ struct hosts_entry *victim;
+ while ((victim = TAILQ_FIRST(&base->hostsdb))) {
+ TAILQ_REMOVE(&base->hostsdb, victim, next);
+ mm_free(victim);
+ }
+ }
+
+ mm_free(base->req_heads);
+
+ EVDNS_UNLOCK(base);
+ EVTHREAD_FREE_LOCK(base->lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+
+ mm_free(base);
+}
+
+void
+evdns_base_free(struct evdns_base *base, int fail_requests)
+{
+ EVDNS_LOCK(base);
+ evdns_base_free_and_unlock(base, fail_requests);
+}
+
+void
+evdns_base_clear_host_addresses(struct evdns_base *base)
+{
+ struct hosts_entry *victim;
+ EVDNS_LOCK(base);
+ while ((victim = TAILQ_FIRST(&base->hostsdb))) {
+ TAILQ_REMOVE(&base->hostsdb, victim, next);
+ mm_free(victim);
+ }
+ EVDNS_UNLOCK(base);
+}
+
+void
+evdns_shutdown(int fail_requests)
+{
+ if (current_base) {
+ struct evdns_base *b = current_base;
+ current_base = NULL;
+ evdns_base_free(b, fail_requests);
+ }
+ evdns_log_fn = NULL;
+}
+
+static int
+evdns_base_parse_hosts_line(struct evdns_base *base, char *line)
+{
+ char *strtok_state;
+ static const char *const delims = " \t";
+ char *const addr = strtok_r(line, delims, &strtok_state);
+ char *hostname, *hash;
+ struct sockaddr_storage ss;
+ int socklen = sizeof(ss);
+ ASSERT_LOCKED(base);
+
+#define NEXT_TOKEN strtok_r(NULL, delims, &strtok_state)
+
+ if (!addr || *addr == '#')
+ return 0;
+
+ memset(&ss, 0, sizeof(ss));
+ if (evutil_parse_sockaddr_port(addr, (struct sockaddr*)&ss, &socklen)<0)
+ return -1;
+ if (socklen > (int)sizeof(struct sockaddr_in6))
+ return -1;
+
+ if (sockaddr_getport((struct sockaddr*)&ss))
+ return -1;
+
+ while ((hostname = NEXT_TOKEN)) {
+ struct hosts_entry *he;
+ size_t namelen;
+ if ((hash = strchr(hostname, '#'))) {
+ if (hash == hostname)
+ return 0;
+ *hash = '\0';
+ }
+
+ namelen = strlen(hostname);
+
+ he = mm_calloc(1, sizeof(struct hosts_entry)+namelen);
+ if (!he)
+ return -1;
+ EVUTIL_ASSERT(socklen <= (int)sizeof(he->addr));
+ memcpy(&he->addr, &ss, socklen);
+ memcpy(he->hostname, hostname, namelen+1);
+ he->addrlen = socklen;
+
+ TAILQ_INSERT_TAIL(&base->hostsdb, he, next);
+
+ if (hash)
+ return 0;
+ }
+
+ return 0;
+#undef NEXT_TOKEN
+}
+
+static int
+evdns_base_load_hosts_impl(struct evdns_base *base, const char *hosts_fname)
+{
+ char *str=NULL, *cp, *eol;
+ size_t len;
+ int err=0;
+
+ ASSERT_LOCKED(base);
+
+ if (hosts_fname == NULL ||
+ (err = evutil_read_file_(hosts_fname, &str, &len, 0)) < 0) {
+ char tmp[64];
+ strlcpy(tmp, "127.0.0.1 localhost", sizeof(tmp));
+ evdns_base_parse_hosts_line(base, tmp);
+ strlcpy(tmp, "::1 localhost", sizeof(tmp));
+ evdns_base_parse_hosts_line(base, tmp);
+ return err ? -1 : 0;
+ }
+
+ /* This will break early if there is a NUL in the hosts file.
+ * Probably not a problem.*/
+ cp = str;
+ for (;;) {
+ eol = strchr(cp, '\n');
+
+ if (eol) {
+ *eol = '\0';
+ evdns_base_parse_hosts_line(base, cp);
+ cp = eol+1;
+ } else {
+ evdns_base_parse_hosts_line(base, cp);
+ break;
+ }
+ }
+
+ mm_free(str);
+ return 0;
+}
+
+int
+evdns_base_load_hosts(struct evdns_base *base, const char *hosts_fname)
+{
+ int res;
+ if (!base)
+ base = current_base;
+ EVDNS_LOCK(base);
+ res = evdns_base_load_hosts_impl(base, hosts_fname);
+ EVDNS_UNLOCK(base);
+ return res;
+}
+
+/* A single request for a getaddrinfo, either v4 or v6. */
+struct getaddrinfo_subrequest {
+ struct evdns_request *r;
+ ev_uint32_t type;
+};
+
+/* State data used to implement an in-progress getaddrinfo. */
+struct evdns_getaddrinfo_request {
+ struct evdns_base *evdns_base;
+ /* Copy of the modified 'hints' data that we'll use to build
+ * answers. */
+ struct evutil_addrinfo hints;
+ /* The callback to invoke when we're done */
+ evdns_getaddrinfo_cb user_cb;
+ /* User-supplied data to give to the callback. */
+ void *user_data;
+ /* The port to use when building sockaddrs. */
+ ev_uint16_t port;
+ /* The sub_request for an A record (if any) */
+ struct getaddrinfo_subrequest ipv4_request;
+ /* The sub_request for an AAAA record (if any) */
+ struct getaddrinfo_subrequest ipv6_request;
+
+ /* The cname result that we were told (if any) */
+ char *cname_result;
+
+ /* If we have one request answered and one request still inflight,
+ * then this field holds the answer from the first request... */
+ struct evutil_addrinfo *pending_result;
+ /* And this event is a timeout that will tell us to cancel the second
+ * request if it's taking a long time. */
+ struct event timeout;
+
+ /* And this field holds the error code from the first request... */
+ int pending_error;
+ /* If this is set, the user canceled this request. */
+ unsigned user_canceled : 1;
+ /* If this is set, the user can no longer cancel this request; we're
+ * just waiting for the free. */
+ unsigned request_done : 1;
+};
+
+/* Convert an evdns errors to the equivalent getaddrinfo error. */
+static int
+evdns_err_to_getaddrinfo_err(int e1)
+{
+ /* XXX Do this better! */
+ if (e1 == DNS_ERR_NONE)
+ return 0;
+ else if (e1 == DNS_ERR_NOTEXIST)
+ return EVUTIL_EAI_NONAME;
+ else
+ return EVUTIL_EAI_FAIL;
+}
+
+/* Return the more informative of two getaddrinfo errors. */
+static int
+getaddrinfo_merge_err(int e1, int e2)
+{
+ /* XXXX be cleverer here. */
+ if (e1 == 0)
+ return e2;
+ else
+ return e1;
+}
+
+static void
+free_getaddrinfo_request(struct evdns_getaddrinfo_request *data)
+{
+ /* DO NOT CALL this if either of the requests is pending. Only once
+ * both callbacks have been invoked is it safe to free the request */
+ if (data->pending_result)
+ evutil_freeaddrinfo(data->pending_result);
+ if (data->cname_result)
+ mm_free(data->cname_result);
+ event_del(&data->timeout);
+ mm_free(data);
+ return;
+}
+
+static void
+add_cname_to_reply(struct evdns_getaddrinfo_request *data,
+ struct evutil_addrinfo *ai)
+{
+ if (data->cname_result && ai) {
+ ai->ai_canonname = data->cname_result;
+ data->cname_result = NULL;
+ }
+}
+
+/* Callback: invoked when one request in a mixed-format A/AAAA getaddrinfo
+ * request has finished, but the other one took too long to answer. Pass
+ * along the answer we got, and cancel the other request.
+ */
+static void
+evdns_getaddrinfo_timeout_cb(evutil_socket_t fd, short what, void *ptr)
+{
+ int v4_timedout = 0, v6_timedout = 0;
+ struct evdns_getaddrinfo_request *data = ptr;
+
+ /* Cancel any pending requests, and note which one */
+ if (data->ipv4_request.r) {
+ /* XXXX This does nothing if the request's callback is already
+ * running (pending_cb is set). */
+ evdns_cancel_request(NULL, data->ipv4_request.r);
+ v4_timedout = 1;
+ EVDNS_LOCK(data->evdns_base);
+ ++data->evdns_base->getaddrinfo_ipv4_timeouts;
+ EVDNS_UNLOCK(data->evdns_base);
+ }
+ if (data->ipv6_request.r) {
+ /* XXXX This does nothing if the request's callback is already
+ * running (pending_cb is set). */
+ evdns_cancel_request(NULL, data->ipv6_request.r);
+ v6_timedout = 1;
+ EVDNS_LOCK(data->evdns_base);
+ ++data->evdns_base->getaddrinfo_ipv6_timeouts;
+ EVDNS_UNLOCK(data->evdns_base);
+ }
+
+ /* We only use this timeout callback when we have an answer for
+ * one address. */
+ EVUTIL_ASSERT(!v4_timedout || !v6_timedout);
+
+ /* Report the outcome of the other request that didn't time out. */
+ if (data->pending_result) {
+ add_cname_to_reply(data, data->pending_result);
+ data->user_cb(0, data->pending_result, data->user_data);
+ data->pending_result = NULL;
+ } else {
+ int e = data->pending_error;
+ if (!e)
+ e = EVUTIL_EAI_AGAIN;
+ data->user_cb(e, NULL, data->user_data);
+ }
+
+ data->user_cb = NULL; /* prevent double-call if evdns callbacks are
+ * in-progress. XXXX It would be better if this
+ * weren't necessary. */
+
+ if (!v4_timedout && !v6_timedout) {
+ /* should be impossible? XXXX */
+ free_getaddrinfo_request(data);
+ }
+}
+
+static int
+evdns_getaddrinfo_set_timeout(struct evdns_base *evdns_base,
+ struct evdns_getaddrinfo_request *data)
+{
+ return event_add(&data->timeout, &evdns_base->global_getaddrinfo_allow_skew);
+}
+
+static inline int
+evdns_result_is_answer(int result)
+{
+ return (result != DNS_ERR_NOTIMPL && result != DNS_ERR_REFUSED &&
+ result != DNS_ERR_SERVERFAILED && result != DNS_ERR_CANCEL);
+}
+
+static void
+evdns_getaddrinfo_gotresolve(int result, char type, int count,
+ int ttl, void *addresses, void *arg)
+{
+ int i;
+ struct getaddrinfo_subrequest *req = arg;
+ struct getaddrinfo_subrequest *other_req;
+ struct evdns_getaddrinfo_request *data;
+
+ struct evutil_addrinfo *res;
+
+ struct sockaddr_in sin;
+ struct sockaddr_in6 sin6;
+ struct sockaddr *sa;
+ int socklen, addrlen;
+ void *addrp;
+ int err;
+ int user_canceled;
+
+ EVUTIL_ASSERT(req->type == DNS_IPv4_A || req->type == DNS_IPv6_AAAA);
+ if (req->type == DNS_IPv4_A) {
+ data = EVUTIL_UPCAST(req, struct evdns_getaddrinfo_request, ipv4_request);
+ other_req = &data->ipv6_request;
+ } else {
+ data = EVUTIL_UPCAST(req, struct evdns_getaddrinfo_request, ipv6_request);
+ other_req = &data->ipv4_request;
+ }
+
+ /** Called from evdns_base_free() with @fail_requests == 1 */
+ if (result != DNS_ERR_SHUTDOWN) {
+ EVDNS_LOCK(data->evdns_base);
+ if (evdns_result_is_answer(result)) {
+ if (req->type == DNS_IPv4_A)
+ ++data->evdns_base->getaddrinfo_ipv4_answered;
+ else
+ ++data->evdns_base->getaddrinfo_ipv6_answered;
+ }
+ user_canceled = data->user_canceled;
+ if (other_req->r == NULL)
+ data->request_done = 1;
+ EVDNS_UNLOCK(data->evdns_base);
+ } else {
+ data->evdns_base = NULL;
+ user_canceled = data->user_canceled;
+ }
+
+ req->r = NULL;
+
+ if (result == DNS_ERR_CANCEL && ! user_canceled) {
+ /* Internal cancel request from timeout or internal error.
+ * we already answered the user. */
+ if (other_req->r == NULL)
+ free_getaddrinfo_request(data);
+ return;
+ }
+
+ if (data->user_cb == NULL) {
+ /* We already answered. XXXX This shouldn't be needed; see
+ * comments in evdns_getaddrinfo_timeout_cb */
+ free_getaddrinfo_request(data);
+ return;
+ }
+
+ if (result == DNS_ERR_NONE) {
+ if (count == 0)
+ err = EVUTIL_EAI_NODATA;
+ else
+ err = 0;
+ } else {
+ err = evdns_err_to_getaddrinfo_err(result);
+ }
+
+ if (err) {
+ /* Looks like we got an error. */
+ if (other_req->r) {
+ /* The other request is still working; maybe it will
+ * succeed. */
+ /* XXXX handle failure from set_timeout */
+ if (result != DNS_ERR_SHUTDOWN) {
+ evdns_getaddrinfo_set_timeout(data->evdns_base, data);
+ }
+ data->pending_error = err;
+ return;
+ }
+
+ if (user_canceled) {
+ data->user_cb(EVUTIL_EAI_CANCEL, NULL, data->user_data);
+ } else if (data->pending_result) {
+ /* If we have an answer waiting, and we weren't
+ * canceled, ignore this error. */
+ add_cname_to_reply(data, data->pending_result);
+ data->user_cb(0, data->pending_result, data->user_data);
+ data->pending_result = NULL;
+ } else {
+ if (data->pending_error)
+ err = getaddrinfo_merge_err(err,
+ data->pending_error);
+ data->user_cb(err, NULL, data->user_data);
+ }
+ free_getaddrinfo_request(data);
+ return;
+ } else if (user_canceled) {
+ if (other_req->r) {
+ /* The other request is still working; let it hit this
+ * callback with EVUTIL_EAI_CANCEL callback and report
+ * the failure. */
+ return;
+ }
+ data->user_cb(EVUTIL_EAI_CANCEL, NULL, data->user_data);
+ free_getaddrinfo_request(data);
+ return;
+ }
+
+ /* Looks like we got some answers. We should turn them into addrinfos
+ * and then either queue those or return them all. */
+ EVUTIL_ASSERT(type == DNS_IPv4_A || type == DNS_IPv6_AAAA);
+
+ if (type == DNS_IPv4_A) {
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_port = htons(data->port);
+
+ sa = (struct sockaddr *)&sin;
+ socklen = sizeof(sin);
+ addrlen = 4;
+ addrp = &sin.sin_addr.s_addr;
+ } else {
+ memset(&sin6, 0, sizeof(sin6));
+ sin6.sin6_family = AF_INET6;
+ sin6.sin6_port = htons(data->port);
+
+ sa = (struct sockaddr *)&sin6;
+ socklen = sizeof(sin6);
+ addrlen = 16;
+ addrp = &sin6.sin6_addr.s6_addr;
+ }
+
+ res = NULL;
+ for (i=0; i < count; ++i) {
+ struct evutil_addrinfo *ai;
+ memcpy(addrp, ((char*)addresses)+i*addrlen, addrlen);
+ ai = evutil_new_addrinfo_(sa, socklen, &data->hints);
+ if (!ai) {
+ if (other_req->r) {
+ evdns_cancel_request(NULL, other_req->r);
+ }
+ data->user_cb(EVUTIL_EAI_MEMORY, NULL, data->user_data);
+ if (res)
+ evutil_freeaddrinfo(res);
+
+ if (other_req->r == NULL)
+ free_getaddrinfo_request(data);
+ return;
+ }
+ res = evutil_addrinfo_append_(res, ai);
+ }
+
+ if (other_req->r) {
+ /* The other request is still in progress; wait for it */
+ /* XXXX handle failure from set_timeout */
+ evdns_getaddrinfo_set_timeout(data->evdns_base, data);
+ data->pending_result = res;
+ return;
+ } else {
+ /* The other request is done or never started; append its
+ * results (if any) and return them. */
+ if (data->pending_result) {
+ if (req->type == DNS_IPv4_A)
+ res = evutil_addrinfo_append_(res,
+ data->pending_result);
+ else
+ res = evutil_addrinfo_append_(
+ data->pending_result, res);
+ data->pending_result = NULL;
+ }
+
+ /* Call the user callback. */
+ add_cname_to_reply(data, res);
+ data->user_cb(0, res, data->user_data);
+
+ /* Free data. */
+ free_getaddrinfo_request(data);
+ }
+}
+
+static struct hosts_entry *
+find_hosts_entry(struct evdns_base *base, const char *hostname,
+ struct hosts_entry *find_after)
+{
+ struct hosts_entry *e;
+
+ if (find_after)
+ e = TAILQ_NEXT(find_after, next);
+ else
+ e = TAILQ_FIRST(&base->hostsdb);
+
+ for (; e; e = TAILQ_NEXT(e, next)) {
+ if (!evutil_ascii_strcasecmp(e->hostname, hostname))
+ return e;
+ }
+ return NULL;
+}
+
+static int
+evdns_getaddrinfo_fromhosts(struct evdns_base *base,
+ const char *nodename, struct evutil_addrinfo *hints, ev_uint16_t port,
+ struct evutil_addrinfo **res)
+{
+ int n_found = 0;
+ struct hosts_entry *e;
+ struct evutil_addrinfo *ai=NULL;
+ int f = hints->ai_family;
+
+ EVDNS_LOCK(base);
+ for (e = find_hosts_entry(base, nodename, NULL); e;
+ e = find_hosts_entry(base, nodename, e)) {
+ struct evutil_addrinfo *ai_new;
+ ++n_found;
+ if ((e->addr.sa.sa_family == AF_INET && f == PF_INET6) ||
+ (e->addr.sa.sa_family == AF_INET6 && f == PF_INET))
+ continue;
+ ai_new = evutil_new_addrinfo_(&e->addr.sa, e->addrlen, hints);
+ if (!ai_new) {
+ n_found = 0;
+ goto out;
+ }
+ sockaddr_setport(ai_new->ai_addr, port);
+ ai = evutil_addrinfo_append_(ai, ai_new);
+ }
+ EVDNS_UNLOCK(base);
+out:
+ if (n_found) {
+ /* Note that we return an empty answer if we found entries for
+ * this hostname but none were of the right address type. */
+ *res = ai;
+ return 0;
+ } else {
+ if (ai)
+ evutil_freeaddrinfo(ai);
+ return -1;
+ }
+}
+
+struct evdns_getaddrinfo_request *
+evdns_getaddrinfo(struct evdns_base *dns_base,
+ const char *nodename, const char *servname,
+ const struct evutil_addrinfo *hints_in,
+ evdns_getaddrinfo_cb cb, void *arg)
+{
+ struct evdns_getaddrinfo_request *data;
+ struct evutil_addrinfo hints;
+ struct evutil_addrinfo *res = NULL;
+ int err;
+ int port = 0;
+ int want_cname = 0;
+
+ if (!dns_base) {
+ dns_base = current_base;
+ if (!dns_base) {
+ log(EVDNS_LOG_WARN,
+ "Call to getaddrinfo_async with no "
+ "evdns_base configured.");
+ cb(EVUTIL_EAI_FAIL, NULL, arg); /* ??? better error? */
+ return NULL;
+ }
+ }
+
+ /* If we _must_ answer this immediately, do so. */
+ if ((hints_in && (hints_in->ai_flags & EVUTIL_AI_NUMERICHOST))) {
+ res = NULL;
+ err = evutil_getaddrinfo(nodename, servname, hints_in, &res);
+ cb(err, res, arg);
+ return NULL;
+ }
+
+ if (hints_in) {
+ memcpy(&hints, hints_in, sizeof(hints));
+ } else {
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ }
+
+ evutil_adjust_hints_for_addrconfig_(&hints);
+
+ /* Now try to see if we _can_ answer immediately. */
+ /* (It would be nice to do this by calling getaddrinfo directly, with
+ * AI_NUMERICHOST, on plaforms that have it, but we can't: there isn't
+ * a reliable way to distinguish the "that wasn't a numeric host!" case
+ * from any other EAI_NONAME cases.) */
+ err = evutil_getaddrinfo_common_(nodename, servname, &hints, &res, &port);
+ if (err != EVUTIL_EAI_NEED_RESOLVE) {
+ cb(err, res, arg);
+ return NULL;
+ }
+
+ /* If there is an entry in the hosts file, we should give it now. */
+ if (!evdns_getaddrinfo_fromhosts(dns_base, nodename, &hints, port, &res)) {
+ cb(0, res, arg);
+ return NULL;
+ }
+
+ /* Okay, things are serious now. We're going to need to actually
+ * launch a request.
+ */
+ data = mm_calloc(1,sizeof(struct evdns_getaddrinfo_request));
+ if (!data) {
+ cb(EVUTIL_EAI_MEMORY, NULL, arg);
+ return NULL;
+ }
+
+ memcpy(&data->hints, &hints, sizeof(data->hints));
+ data->port = (ev_uint16_t)port;
+ data->ipv4_request.type = DNS_IPv4_A;
+ data->ipv6_request.type = DNS_IPv6_AAAA;
+ data->user_cb = cb;
+ data->user_data = arg;
+ data->evdns_base = dns_base;
+
+ want_cname = (hints.ai_flags & EVUTIL_AI_CANONNAME);
+
+ /* If we are asked for a PF_UNSPEC address, we launch two requests in
+ * parallel: one for an A address and one for an AAAA address. We
+ * can't send just one request, since many servers only answer one
+ * question per DNS request.
+ *
+ * Once we have the answer to one request, we allow for a short
+ * timeout before we report it, to see if the other one arrives. If
+ * they both show up in time, then we report both the answers.
+ *
+ * If too many addresses of one type time out or fail, we should stop
+ * launching those requests. (XXX we don't do that yet.)
+ */
+
+ if (hints.ai_family != PF_INET6) {
+ log(EVDNS_LOG_DEBUG, "Sending request for %s on ipv4 as %p",
+ nodename, &data->ipv4_request);
+
+ data->ipv4_request.r = evdns_base_resolve_ipv4(dns_base,
+ nodename, 0, evdns_getaddrinfo_gotresolve,
+ &data->ipv4_request);
+ if (want_cname && data->ipv4_request.r)
+ data->ipv4_request.r->current_req->put_cname_in_ptr =
+ &data->cname_result;
+ }
+ if (hints.ai_family != PF_INET) {
+ log(EVDNS_LOG_DEBUG, "Sending request for %s on ipv6 as %p",
+ nodename, &data->ipv6_request);
+
+ data->ipv6_request.r = evdns_base_resolve_ipv6(dns_base,
+ nodename, 0, evdns_getaddrinfo_gotresolve,
+ &data->ipv6_request);
+ if (want_cname && data->ipv6_request.r)
+ data->ipv6_request.r->current_req->put_cname_in_ptr =
+ &data->cname_result;
+ }
+
+ evtimer_assign(&data->timeout, dns_base->event_base,
+ evdns_getaddrinfo_timeout_cb, data);
+
+ if (data->ipv4_request.r || data->ipv6_request.r) {
+ return data;
+ } else {
+ mm_free(data);
+ cb(EVUTIL_EAI_FAIL, NULL, arg);
+ return NULL;
+ }
+}
+
+void
+evdns_getaddrinfo_cancel(struct evdns_getaddrinfo_request *data)
+{
+ EVDNS_LOCK(data->evdns_base);
+ if (data->request_done) {
+ EVDNS_UNLOCK(data->evdns_base);
+ return;
+ }
+ event_del(&data->timeout);
+ data->user_canceled = 1;
+ if (data->ipv4_request.r)
+ evdns_cancel_request(data->evdns_base, data->ipv4_request.r);
+ if (data->ipv6_request.r)
+ evdns_cancel_request(data->evdns_base, data->ipv6_request.r);
+ EVDNS_UNLOCK(data->evdns_base);
+}
diff --git a/protocols/Telegram/tgl/libevent/evdns.obj b/protocols/Telegram/tgl/libevent/evdns.obj
new file mode 100644
index 0000000000..354cf6a3da
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/evdns.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/event-config.h.cmake b/protocols/Telegram/tgl/libevent/event-config.h.cmake
new file mode 100644
index 0000000000..76e0d1f981
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/event-config.h.cmake
@@ -0,0 +1,534 @@
+/* event-config.h
+ *
+ * This file was generated by cmake when the makefiles were generated.
+ *
+ * DO NOT EDIT THIS FILE.
+ *
+ * Do not rely on macros in this file existing in later versions.
+ */
+#ifndef EVENT2_EVENT_CONFIG_H_INCLUDED_
+#define EVENT2_EVENT_CONFIG_H_INCLUDED_
+
+/* Numeric representation of the version */
+#define EVENT__NUMERIC_VERSION @EVENT_NUMERIC_VERSION@
+#define EVENT__PACKAGE_VERSION "@EVENT_PACKAGE_VERSION@"
+
+#define EVENT__VERSION_MAJOR @EVENT_VERSION_MAJOR@
+#define EVENT__VERSION_MINOR @EVENT_VERSION_MINOR@
+#define EVENT__VERSION_PATCH @EVENT_VERSION_PATCH@
+
+/* Version number of package */
+#define EVENT__VERSION "@EVENT_VERSION@"
+
+/* Name of package */
+#define EVENT__PACKAGE "libevent"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define EVENT__PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define EVENT__PACKAGE_NAME ""
+
+/* Define to the full name and version of this package. */
+#define EVENT__PACKAGE_STRING ""
+
+/* Define to the one symbol short name of this package. */
+#define EVENT__PACKAGE_TARNAME ""
+
+/* Define if libevent should build without support for a debug mode */
+#cmakedefine EVENT__DISABLE_DEBUG_MODE
+
+/* Define if libevent should not allow replacing the mm functions */
+#cmakedefine EVENT__DISABLE_MM_REPLACEMENT
+
+/* Define if libevent should not be compiled with thread support */
+#cmakedefine EVENT__DISABLE_THREAD_SUPPORT
+
+/* Define to 1 if you have the `accept4' function. */
+#cmakedefine EVENT__HAVE_ACCEPT4
+
+/* Define to 1 if you have the `arc4random' function. */
+#cmakedefine EVENT__HAVE_ARC4RANDOM
+
+/* Define to 1 if you have the `arc4random_buf' function. */
+#cmakedefine EVENT__HAVE_ARC4RANDOM_BUF
+
+/* Define if clock_gettime is available in libc */
+#cmakedefine EVENT__DNS_USE_CPU_CLOCK_FOR_ID
+
+/* Define is no secure id variant is available */
+#cmakedefine EVENT__DNS_USE_GETTIMEOFDAY_FOR_ID
+#cmakedefine EVENT__DNS_USE_FTIME_FOR_ID
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#cmakedefine EVENT__HAVE_ARPA_INET_H
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#cmakedefine EVENT__HAVE_CLOCK_GETTIME
+
+/* Define to 1 if you have the declaration of `CTL_KERN'. */
+#cmakedefine EVENT__HAVE_DECL_CTL_KERN
+
+/* Define to 1 if you have the declaration of `KERN_ARND'. */
+#cmakedefine EVENT__HAVE_DECL_KERN_ARND
+
+/* Define to 1 if you have the declaration of `KERN_RANDOM'. */
+#cmakedefine EVENT__HAVE_DECL_KERN_RANDOM
+
+/* Define if /dev/poll is available */
+#cmakedefine EVENT__HAVE_DEVPOLL
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#cmakedefine EVENT__HAVE_NETDB_H
+
+/* Define to 1 if fd_mask type is defined */
+#cmakedefine EVENT__HAVE_FD_MASK
+
+/* Define to 1 if the <sys/queue.h> header file defines TAILQ_FOREACH. */
+#cmakedefine EVENT__HAVE_TAILQFOREACH
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#cmakedefine EVENT__HAVE_DLFCN_H
+
+/* Define if your system supports the epoll system calls */
+#cmakedefine EVENT__HAVE_EPOLL
+
+/* Define to 1 if you have the `epoll_create1' function. */
+#cmakedefine EVENT__HAVE_EPOLL_CREATE1
+
+/* Define to 1 if you have the `epoll_ctl' function. */
+#cmakedefine EVENT__HAVE_EPOLL_CTL
+
+/* Define to 1 if you have the `eventfd' function. */
+#cmakedefine EVENT__HAVE_EVENTFD
+
+/* Define if your system supports event ports */
+#cmakedefine EVENT__HAVE_EVENT_PORTS
+
+/* Define to 1 if you have the `fcntl' function. */
+#cmakedefine EVENT__HAVE_FCNTL
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#cmakedefine EVENT__HAVE_FCNTL_H
+
+/* Define to 1 if you have the `getaddrinfo' function. */
+#cmakedefine EVENT__HAVE_GETADDRINFO
+
+/* Define to 1 if you have the `getegid' function. */
+#cmakedefine EVENT__HAVE_GETEGID
+
+/* Define to 1 if you have the `geteuid' function. */
+#cmakedefine EVENT__HAVE_GETEUID
+
+/* TODO: Check for different gethostname argument counts. CheckPrototypeDefinition.cmake can be used. */
+/* Define this if you have any gethostbyname_r() */
+#cmakedefine EVENT__HAVE_GETHOSTBYNAME_R
+
+/* Define this if gethostbyname_r takes 3 arguments */
+#cmakedefine EVENT__HAVE_GETHOSTBYNAME_R_3_ARG
+
+/* Define this if gethostbyname_r takes 5 arguments */
+#cmakedefine EVENT__HAVE_GETHOSTBYNAME_R_5_ARG
+
+/* Define this if gethostbyname_r takes 6 arguments */
+#cmakedefine EVENT__HAVE_GETHOSTBYNAME_R_6_ARG
+
+/* Define to 1 if you have the `getifaddrs' function. */
+#cmakedefine EVENT__HAVE_GETIFADDRS
+
+/* Define to 1 if you have the `getnameinfo' function. */
+#cmakedefine EVENT__HAVE_GETNAMEINFO
+
+/* Define to 1 if you have the `getprotobynumber' function. */
+#cmakedefine EVENT__HAVE_GETPROTOBYNUMBER
+
+/* Define to 1 if you have the `getservbyname' function. */
+#cmakedefine EVENT__HAVE_GETSERVBYNAME
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#cmakedefine EVENT__HAVE_GETTIMEOFDAY
+
+/* Define to 1 if you have the <ifaddrs.h> header file. */
+#cmakedefine EVENT__HAVE_IFADDRS_H
+
+/* Define to 1 if you have the `inet_ntop' function. */
+#cmakedefine EVENT__HAVE_INET_NTOP
+
+/* Define to 1 if you have the `inet_pton' function. */
+#cmakedefine EVENT__HAVE_INET_PTON
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#cmakedefine EVENT__HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `issetugid' function. */
+#cmakedefine EVENT__HAVE_ISSETUGID
+
+/* Define to 1 if you have the `kqueue' function. */
+#cmakedefine EVENT__HAVE_KQUEUE
+
+/* Define if the system has zlib */
+#cmakedefine EVENT__HAVE_LIBZ
+
+/* Define to 1 if you have the `mach_absolute_time' function. */
+#cmakedefine EVENT__HAVE_MACH_ABSOLUTE_TIME
+
+/* Define to 1 if you have the <mach/mach_time.h> header file. */
+#cmakedefine EVENT__HAVE_MACH_MACH_TIME_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#cmakedefine EVENT__HAVE_MEMORY_H
+
+/* Define to 1 if you have the `mmap' function. */
+#cmakedefine EVENT__HAVE_MMAP
+
+/* Define to 1 if you have the `nanosleep' function. */
+#cmakedefine EVENT__HAVE_NANOSLEEP
+
+/* Define to 1 if you have the `usleep' function. */
+#cmakedefine EVENT__HAVE_USLEEP
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#cmakedefine EVENT__HAVE_NETDB_H
+
+/* Define to 1 if you have the <netinet/in6.h> header file. */
+#cmakedefine EVENT__HAVE_NETINET_IN6_H
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#cmakedefine EVENT__HAVE_NETINET_IN_H
+
+/* Define to 1 if you have the <netinet/tcp.h> header file. */
+#cmakedefine EVENT__HAVE_NETINET_TCP_H
+
+/* Define if the system has openssl */
+#cmakedefine EVENT__HAVE_OPENSSL
+
+/* Defines if the system has zlib */
+#cmakedefine EVENT__HAVE_ZLIB
+
+/* Define to 1 if you have the `pipe' function. */
+#cmakedefine EVENT__HAVE_PIPE
+
+/* Define to 1 if you have the `pipe2' function. */
+#cmakedefine EVENT__HAVE_PIPE2
+
+/* Define to 1 if you have the `poll' function. */
+#cmakedefine EVENT__HAVE_POLL
+
+/* Define to 1 if you have the <poll.h> header file. */
+#cmakedefine EVENT__HAVE_POLL_H
+
+/* Define to 1 if you have the `port_create' function. */
+#cmakedefine EVENT__HAVE_PORT_CREATE
+
+/* Define to 1 if you have the <port.h> header file. */
+#cmakedefine EVENT__HAVE_PORT_H
+
+/* Define if you have POSIX threads libraries and header files. */
+#cmakedefine EVENT__HAVE_PTHREAD
+
+/* Define if we have pthreads on this system */
+#cmakedefine EVENT__HAVE_PTHREADS
+
+/* Define to 1 if you have the `putenv' function. */
+#cmakedefine EVENT__HAVE_PUTENV
+
+/* Define to 1 if the system has the type `sa_family_t'. */
+#cmakedefine EVENT__HAVE_SA_FAMILY_T
+
+/* Define to 1 if you have the `select' function. */
+#cmakedefine EVENT__HAVE_SELECT
+
+/* Define to 1 if you have the `setenv' function. */
+#cmakedefine EVENT__HAVE_SETENV
+
+/* Define if F_SETFD is defined in <fcntl.h> */
+#cmakedefine EVENT__HAVE_SETFD
+
+/* Define to 1 if you have the `setrlimit' function. */
+#cmakedefine EVENT__HAVE_SETRLIMIT
+
+/* Define to 1 if you have the `sendfile' function. */
+#cmakedefine EVENT__HAVE_SENDFILE
+
+/* Define if F_SETFD is defined in <fcntl.h> */
+#cmakedefine EVENT__HAVE_SETFD
+
+/* Define to 1 if you have the `sigaction' function. */
+#cmakedefine EVENT__HAVE_SIGACTION
+
+/* Define to 1 if you have the `signal' function. */
+#cmakedefine EVENT__HAVE_SIGNAL
+
+/* Define to 1 if you have the `splice' function. */
+#cmakedefine EVENT__HAVE_SPLICE
+
+/* Define to 1 if you have the <stdarg.h> header file. */
+#cmakedefine EVENT__HAVE_STDARG_H
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#cmakedefine EVENT__HAVE_STDDEF_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#cmakedefine EVENT__HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#cmakedefine EVENT__HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#cmakedefine EVENT__HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#cmakedefine EVENT__HAVE_STRING_H
+
+/* Define to 1 if you have the `strlcpy' function. */
+#cmakedefine EVENT__HAVE_STRLCPY
+
+/* Define to 1 if you have the `strsep' function. */
+#cmakedefine EVENT__HAVE_STRSEP
+
+/* Define to 1 if you have the `strtok_r' function. */
+#cmakedefine EVENT__HAVE_STRTOK_R
+
+/* Define to 1 if you have the `strtoll' function. */
+#cmakedefine EVENT__HAVE_STRTOLL
+
+/* Define to 1 if the system has the type `struct addrinfo'. */
+#cmakedefine EVENT__HAVE_STRUCT_ADDRINFO
+
+/* Define to 1 if the system has the type `struct in6_addr'. */
+#cmakedefine EVENT__HAVE_STRUCT_IN6_ADDR
+
+/* Define to 1 if `s6_addr16' is member of `struct in6_addr'. */
+#cmakedefine EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR16
+
+/* Define to 1 if `s6_addr32' is member of `struct in6_addr'. */
+#cmakedefine EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR32
+
+/* Define to 1 if the system has the type `struct sockaddr_in6'. */
+#cmakedefine EVENT__HAVE_STRUCT_SOCKADDR_IN6
+
+/* Define to 1 if `sin6_len' is member of `struct sockaddr_in6'. */
+#cmakedefine EVENT__HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN
+
+/* Define to 1 if `sin_len' is member of `struct sockaddr_in'. */
+#cmakedefine EVENT__HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
+
+/* Define to 1 if the system has the type `struct sockaddr_storage'. */
+#cmakedefine EVENT__HAVE_STRUCT_SOCKADDR_STORAGE
+
+/* Define to 1 if `ss_family' is a member of `struct sockaddr_storage'. */
+#cmakedefine EVENT__HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY
+
+/* Define to 1 if `__ss_family' is a member of `struct sockaddr_storage'. */
+#cmakedefine EVENT__HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY
+
+/* Define to 1 if you have the `sysctl' function. */
+#cmakedefine EVENT__HAVE_SYSCTL
+
+/* Define to 1 if you have the <sys/devpoll.h> header file. */
+#cmakedefine EVENT__HAVE_SYS_DEVPOLL_H
+
+/* Define to 1 if you have the <sys/epoll.h> header file. */
+#cmakedefine EVENT__HAVE_SYS_EPOLL_H
+
+/* Define to 1 if you have the <sys/eventfd.h> header file. */
+#cmakedefine EVENT__HAVE_SYS_EVENTFD_H
+
+/* Define to 1 if you have the <sys/event.h> header file. */
+#cmakedefine EVENT__HAVE_SYS_EVENT_H
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#cmakedefine EVENT__HAVE_SYS_IOCTL_H
+
+/* Define to 1 if you have the <sys/mman.h> header file. */
+#cmakedefine EVENT__HAVE_SYS_MMAN_H
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#cmakedefine EVENT__HAVE_SYS_PARAM_H
+
+/* Define to 1 if you have the <sys/queue.h> header file. */
+#cmakedefine EVENT__HAVE_SYS_QUEUE_H
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#cmakedefine EVENT__HAVE_SYS_RESOURCE_H
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#cmakedefine EVENT__HAVE_SYS_SELECT_H
+
+/* Define to 1 if you have the <sys/sendfile.h> header file. */
+#cmakedefine EVENT__HAVE_SYS_SENDFILE_H
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#cmakedefine EVENT__HAVE_SYS_SOCKET_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#cmakedefine EVENT__HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/sysctl.h> header file. */
+#cmakedefine EVENT__HAVE_SYS_SYSCTL_H
+
+/* Define to 1 if you have the <sys/timerfd.h> header file. */
+#cmakedefine EVENT__HAVE_SYS_TIMERFD_H */
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#cmakedefine EVENT__HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#cmakedefine EVENT__HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <sys/uio.h> header file. */
+#cmakedefine EVENT__HAVE_SYS_UIO_H
+
+/* Define to 1 if you have the <sys/wait.h> header file. */
+#cmakedefine EVENT__HAVE_SYS_WAIT_H
+
+/* Define if TAILQ_FOREACH is defined in <sys/queue.h> */
+#cmakedefine EVENT__HAVE_TAILQFOREACH
+
+/* Define if timeradd is defined in <sys/time.h> */
+#cmakedefine EVENT__HAVE_TIMERADD
+
+/* Define if timerclear is defined in <sys/time.h> */
+#cmakedefine EVENT__HAVE_TIMERCLEAR
+
+/* Define if timercmp is defined in <sys/time.h> */
+#cmakedefine EVENT__HAVE_TIMERCMP
+
+/* Define to 1 if you have the `timerfd_create' function. */
+#cmakedefine EVENT__HAVE_TIMERFD_CREATE
+
+/* Define if timerisset is defined in <sys/time.h> */
+#cmakedefine EVENT__HAVE_TIMERISSET
+
+/* Define to 1 if the system has the type `uint8_t'. */
+#cmakedefine EVENT__HAVE_UINT8_T
+
+/* Define to 1 if the system has the type `uint16_t'. */
+#cmakedefine EVENT__HAVE_UINT16_T
+
+/* Define to 1 if the system has the type `uint32_t'. */
+#cmakedefine EVENT__HAVE_UINT32_T
+
+/* Define to 1 if the system has the type `uint64_t'. */
+#cmakedefine EVENT__HAVE_UINT64_T
+
+/* Define to 1 if the system has the type `uintptr_t'. */
+#cmakedefine EVENT__HAVE_UINTPTR_T
+
+/* Define to 1 if you have the `umask' function. */
+#cmakedefine EVENT__HAVE_UMASK
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#cmakedefine EVENT__HAVE_UNISTD_H
+
+/* Define to 1 if you have the `unsetenv' function. */
+#cmakedefine EVENT__HAVE_UNSETENV
+
+/* Define to 1 if you have the `vasprintf' function. */
+#cmakedefine EVENT__HAVE_VASPRINTF
+
+/* Define if kqueue works correctly with pipes */
+#cmakedefine EVENT__HAVE_WORKING_KQUEUE
+
+#ifdef __USE_UNUSED_DEFINITIONS__
+/* Define to necessary symbol if this constant uses a non-standard name on your system. */
+/* XXX: Hello, this isn't even used, nor is it defined anywhere... - Ellzey */
+#define EVENT__PTHREAD_CREATE_JOINABLE ${EVENT__PTHREAD_CREATE_JOINABLE}
+#endif
+
+/* The size of `pthread_t', as computed by sizeof. */
+#define EVENT__SIZEOF_PTHREAD_T @EVENT__SIZEOF_PTHREAD_T@
+
+/* The size of a `int', as computed by sizeof. */
+#define EVENT__SIZEOF_INT @EVENT__SIZEOF_INT@
+
+/* The size of a `long', as computed by sizeof. */
+#define EVENT__SIZEOF_LONG @EVENT__SIZEOF_LONG@
+
+/* The size of a `long long', as computed by sizeof. */
+#define EVENT__SIZEOF_LONG_LONG @EVENT__SIZEOF_LONG_LONG@
+
+/* The size of `off_t', as computed by sizeof. */
+#define EVENT__SIZEOF_OFF_T @EVENT__SIZEOF_OFF_T@
+
+#define EVENT__SIZEOF_SSIZE_T @EVENT__SIZEOF_SSIZE_T@
+
+
+/* The size of a `short', as computed by sizeof. */
+#define EVENT__SIZEOF_SHORT @EVENT__SIZEOF_SHORT@
+
+/* The size of `size_t', as computed by sizeof. */
+#define EVENT__SIZEOF_SIZE_T @EVENT__SIZEOF_SIZE_T@
+
+/* Define to 1 if you have the ANSI C header files. */
+#cmakedefine EVENT__STDC_HEADERS
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#cmakedefine EVENT__TIME_WITH_SYS_TIME
+
+/* The size of `socklen_t', as computed by sizeof. */
+#define EVENT__SIZEOF_SOCKLEN_T @EVENT__SIZEOF_SOCKLEN_T@
+
+/* The size of 'void *', as computer by sizeof */
+#define EVENT__SIZEOF_VOID_P @EVENT__SIZEOF_VOID_P@
+
+/* set an alias for whatever __func__ __FUNCTION__ is, what sillyness */
+#if defined (__func__)
+#define EVENT____func__ __func__
+#elif defined(__FUNCTION__)
+#define EVENT____func__ __FUNCTION__
+#else
+#define EVENT____func__ __FILE__
+#endif
+
+
+#ifdef __THESE_ARE_NOT_CONFIG_H_THINGS_THEY_ARE_DASH_D_THINGS__
+/* Number of bits in a file offset, on hosts where this is settable. */
+/* Ellzey is not satisfied */
+#define EVENT___FILE_OFFSET_BITS @EVENT___FILE_OFFSET_BITS@
+
+/* Define for large files, on AIX-style hosts. */
+#define @_LARGE_FILES@
+#endif
+
+#ifdef _WhAT_DOES_THIS_EVEN_DO_
+/* Define to empty if `const' does not conform to ANSI C. */
+/* lolwut? - ellzey */
+#undef EVENT__const
+#endif
+
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+/* why not c++?
+ *
+ * and are we really expected to use EVENT__inline everywhere,
+ * shouldn't we just do:
+ * ifdef EVENT__inline
+ * define inline EVENT__inline
+ *
+ * - Ellzey
+ */
+
+#define EVENT__inline @EVENT__inline@
+#endif
+
+/* Define to `int' if <sys/tyes.h> does not define. */
+#define EVENT__pid_t @EVENT__pid_t@
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+#define EVENT__size_t @EVENT__size_t@
+
+/* Define to unsigned int if you dont have it */
+#define EVENT__socklen_t @EVENT__socklen_t@
+
+/* Define to `int' if <sys/types.h> does not define. */
+#define EVENT__ssize_t @EVENT__ssize_t@
+
+#cmakedefine EVENT__NEED_DLLIMPORT
+
+/* Define to 1 if you have ERR_remove_thread_stat(). */
+#cmakedefine EVENT__HAVE_ERR_REMOVE_THREAD_STATE
+
+#endif
diff --git a/protocols/Telegram/tgl/libevent/event-internal.h b/protocols/Telegram/tgl/libevent/event-internal.h
new file mode 100644
index 0000000000..66dcfc329c
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/event-internal.h
@@ -0,0 +1,479 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVENT_INTERNAL_H_INCLUDED_
+#define EVENT_INTERNAL_H_INCLUDED_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#include <time.h>
+#include <sys/queue.h>
+#include "event2/event_struct.h"
+#include "minheap-internal.h"
+#include "evsignal-internal.h"
+#include "mm-internal.h"
+#include "defer-internal.h"
+
+/* map union members back */
+
+/* mutually exclusive */
+#define ev_signal_next ev_.ev_signal.ev_signal_next
+#define ev_io_next ev_.ev_io.ev_io_next
+#define ev_io_timeout ev_.ev_io.ev_timeout
+
+/* used only by signals */
+#define ev_ncalls ev_.ev_signal.ev_ncalls
+#define ev_pncalls ev_.ev_signal.ev_pncalls
+
+#define ev_pri ev_evcallback.evcb_pri
+#define ev_flags ev_evcallback.evcb_flags
+#define ev_closure ev_evcallback.evcb_closure
+#define ev_callback ev_evcallback.evcb_cb_union.evcb_callback
+#define ev_arg ev_evcallback.evcb_arg
+
+/** @name Event closure codes
+
+ Possible values for evcb_closure in struct event_callback
+
+ @{
+ */
+/** A regular event. Uses the evcb_callback callback */
+#define EV_CLOSURE_EVENT 0
+/** A signal event. Uses the evcb_callback callback */
+#define EV_CLOSURE_EVENT_SIGNAL 1
+/** A persistent non-signal event. Uses the evcb_callback callback */
+#define EV_CLOSURE_EVENT_PERSIST 2
+/** A simple callback. Uses the evcb_selfcb callback. */
+#define EV_CLOSURE_CB_SELF 3
+/** A finalizing callback. Uses the evcb_cbfinalize callback. */
+#define EV_CLOSURE_CB_FINALIZE 4
+/** A finalizing event. Uses the evcb_evfinalize callback. */
+#define EV_CLOSURE_EVENT_FINALIZE 5
+/** A finalizing event that should get freed after. Uses the evcb_evfinalize
+ * callback. */
+#define EV_CLOSURE_EVENT_FINALIZE_FREE 6
+/** @} */
+
+/** Structure to define the backend of a given event_base. */
+struct eventop {
+ /** The name of this backend. */
+ const char *name;
+ /** Function to set up an event_base to use this backend. It should
+ * create a new structure holding whatever information is needed to
+ * run the backend, and return it. The returned pointer will get
+ * stored by event_init into the event_base.evbase field. On failure,
+ * this function should return NULL. */
+ void *(*init)(struct event_base *);
+ /** Enable reading/writing on a given fd or signal. 'events' will be
+ * the events that we're trying to enable: one or more of EV_READ,
+ * EV_WRITE, EV_SIGNAL, and EV_ET. 'old' will be those events that
+ * were enabled on this fd previously. 'fdinfo' will be a structure
+ * associated with the fd by the evmap; its size is defined by the
+ * fdinfo field below. It will be set to 0 the first time the fd is
+ * added. The function should return 0 on success and -1 on error.
+ */
+ int (*add)(struct event_base *, evutil_socket_t fd, short old, short events, void *fdinfo);
+ /** As "add", except 'events' contains the events we mean to disable. */
+ int (*del)(struct event_base *, evutil_socket_t fd, short old, short events, void *fdinfo);
+ /** Function to implement the core of an event loop. It must see which
+ added events are ready, and cause event_active to be called for each
+ active event (usually via event_io_active or such). It should
+ return 0 on success and -1 on error.
+ */
+ int (*dispatch)(struct event_base *, struct timeval *);
+ /** Function to clean up and free our data from the event_base. */
+ void (*dealloc)(struct event_base *);
+ /** Flag: set if we need to reinitialize the event base after we fork.
+ */
+ int need_reinit;
+ /** Bit-array of supported event_method_features that this backend can
+ * provide. */
+ enum event_method_feature features;
+ /** Length of the extra information we should record for each fd that
+ has one or more active events. This information is recorded
+ as part of the evmap entry for each fd, and passed as an argument
+ to the add and del functions above.
+ */
+ size_t fdinfo_len;
+};
+
+#ifdef _WIN32
+/* If we're on win32, then file descriptors are not nice low densely packed
+ integers. Instead, they are pointer-like windows handles, and we want to
+ use a hashtable instead of an array to map fds to events.
+*/
+#define EVMAP_USE_HT
+#endif
+
+/* #define HT_CACHE_HASH_VALS */
+
+#ifdef EVMAP_USE_HT
+#define HT_NO_CACHE_HASH_VALUES
+#include "ht-internal.h"
+struct event_map_entry;
+HT_HEAD(event_io_map, event_map_entry);
+#else
+#define event_io_map event_signal_map
+#endif
+
+/* Used to map signal numbers to a list of events. If EVMAP_USE_HT is not
+ defined, this structure is also used as event_io_map, which maps fds to a
+ list of events.
+*/
+struct event_signal_map {
+ /* An array of evmap_io * or of evmap_signal *; empty entries are
+ * set to NULL. */
+ void **entries;
+ /* The number of entries available in entries */
+ int nentries;
+};
+
+/* A list of events waiting on a given 'common' timeout value. Ordinarily,
+ * events waiting for a timeout wait on a minheap. Sometimes, however, a
+ * queue can be faster.
+ **/
+struct common_timeout_list {
+ /* List of events currently waiting in the queue. */
+ struct event_list events;
+ /* 'magic' timeval used to indicate the duration of events in this
+ * queue. */
+ struct timeval duration;
+ /* Event that triggers whenever one of the events in the queue is
+ * ready to activate */
+ struct event timeout_event;
+ /* The event_base that this timeout list is part of */
+ struct event_base *base;
+};
+
+/** Mask used to get the real tv_usec value from a common timeout. */
+#define COMMON_TIMEOUT_MICROSECONDS_MASK 0x000fffff
+
+struct event_change;
+
+/* List of 'changes' since the last call to eventop.dispatch. Only maintained
+ * if the backend is using changesets. */
+struct event_changelist {
+ struct event_change *changes;
+ int n_changes;
+ int changes_size;
+};
+
+#ifndef EVENT__DISABLE_DEBUG_MODE
+/* Global internal flag: set to one if debug mode is on. */
+extern int event_debug_mode_on_;
+#define EVENT_DEBUG_MODE_IS_ON() (event_debug_mode_on_)
+#else
+#define EVENT_DEBUG_MODE_IS_ON() (0)
+#endif
+
+TAILQ_HEAD(evcallback_list, event_callback);
+
+/* Sets up an event for processing once */
+struct event_once {
+ LIST_ENTRY(event_once) next_once;
+ struct event ev;
+
+ void (*cb)(evutil_socket_t, short, void *);
+ void *arg;
+};
+
+struct event_base {
+ /** Function pointers and other data to describe this event_base's
+ * backend. */
+ const struct eventop *evsel;
+ /** Pointer to backend-specific data. */
+ void *evbase;
+
+ /** List of changes to tell backend about at next dispatch. Only used
+ * by the O(1) backends. */
+ struct event_changelist changelist;
+
+ /** Function pointers used to describe the backend that this event_base
+ * uses for signals */
+ const struct eventop *evsigsel;
+ /** Data to implement the common signal handelr code. */
+ struct evsig_info sig;
+
+ /** Number of virtual events */
+ int virtual_event_count;
+ /** Maximum number of virtual events active */
+ int virtual_event_count_max;
+ /** Number of total events added to this event_base */
+ int event_count;
+ /** Maximum number of total events added to this event_base */
+ int event_count_max;
+ /** Number of total events active in this event_base */
+ int event_count_active;
+ /** Maximum number of total events active in this event_base */
+ int event_count_active_max;
+
+ /** Set if we should terminate the loop once we're done processing
+ * events. */
+ int event_gotterm;
+ /** Set if we should terminate the loop immediately */
+ int event_break;
+ /** Set if we should start a new instance of the loop immediately. */
+ int event_continue;
+
+ /** The currently running priority of events */
+ int event_running_priority;
+
+ /** Set if we're running the event_base_loop function, to prevent
+ * reentrant invocation. */
+ int running_loop;
+
+ /** Set to the number of deferred_cbs we've made 'active' in the
+ * loop. This is a hack to prevent starvation; it would be smarter
+ * to just use event_config_set_max_dispatch_interval's max_callbacks
+ * feature */
+ int n_deferreds_queued;
+
+ /* Active event management. */
+ /** An array of nactivequeues queues for active event_callbacks (ones
+ * that have triggered, and whose callbacks need to be called). Low
+ * priority numbers are more important, and stall higher ones.
+ */
+ struct evcallback_list *activequeues;
+ /** The length of the activequeues array */
+ int nactivequeues;
+ /** A list of event_callbacks that should become active the next time
+ * we process events, but not this time. */
+ struct evcallback_list active_later_queue;
+
+ /* common timeout logic */
+
+ /** An array of common_timeout_list* for all of the common timeout
+ * values we know. */
+ struct common_timeout_list **common_timeout_queues;
+ /** The number of entries used in common_timeout_queues */
+ int n_common_timeouts;
+ /** The total size of common_timeout_queues. */
+ int n_common_timeouts_allocated;
+
+ /** Mapping from file descriptors to enabled (added) events */
+ struct event_io_map io;
+
+ /** Mapping from signal numbers to enabled (added) events. */
+ struct event_signal_map sigmap;
+
+ /** Priority queue of events with timeouts. */
+ struct min_heap timeheap;
+
+ /** Stored timeval: used to avoid calling gettimeofday/clock_gettime
+ * too often. */
+ struct timeval tv_cache;
+
+ struct evutil_monotonic_timer monotonic_timer;
+
+ /** Difference between internal time (maybe from clock_gettime) and
+ * gettimeofday. */
+ struct timeval tv_clock_diff;
+ /** Second in which we last updated tv_clock_diff, in monotonic time. */
+ time_t last_updated_clock_diff;
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ /* threading support */
+ /** The thread currently running the event_loop for this base */
+ unsigned long th_owner_id;
+ /** A lock to prevent conflicting accesses to this event_base */
+ void *th_base_lock;
+ /** A condition that gets signalled when we're done processing an
+ * event with waiters on it. */
+ void *current_event_cond;
+ /** Number of threads blocking on current_event_cond. */
+ int current_event_waiters;
+#endif
+ /** The event whose callback is executing right now */
+ struct event_callback *current_event;
+
+#ifdef _WIN32
+ /** IOCP support structure, if IOCP is enabled. */
+ struct event_iocp_port *iocp;
+#endif
+
+ /** Flags that this base was configured with */
+ enum event_base_config_flag flags;
+
+ struct timeval max_dispatch_time;
+ int max_dispatch_callbacks;
+ int limit_callbacks_after_prio;
+
+ /* Notify main thread to wake up break, etc. */
+ /** True if the base already has a pending notify, and we don't need
+ * to add any more. */
+ int is_notify_pending;
+ /** A socketpair used by some th_notify functions to wake up the main
+ * thread. */
+ evutil_socket_t th_notify_fd[2];
+ /** An event used by some th_notify functions to wake up the main
+ * thread. */
+ struct event th_notify;
+ /** A function used to wake up the main thread from another thread. */
+ int (*th_notify_fn)(struct event_base *base);
+
+ /** Saved seed for weak random number generator. Some backends use
+ * this to produce fairness among sockets. Protected by th_base_lock. */
+ struct evutil_weakrand_state weakrand_seed;
+
+ /** List of event_onces that have not yet fired. */
+ LIST_HEAD(once_event_list, event_once) once_events;
+
+};
+
+struct event_config_entry {
+ TAILQ_ENTRY(event_config_entry) next;
+
+ const char *avoid_method;
+};
+
+/** Internal structure: describes the configuration we want for an event_base
+ * that we're about to allocate. */
+struct event_config {
+ TAILQ_HEAD(event_configq, event_config_entry) entries;
+
+ int n_cpus_hint;
+ struct timeval max_dispatch_interval;
+ int max_dispatch_callbacks;
+ int limit_callbacks_after_prio;
+ enum event_method_feature require_features;
+ enum event_base_config_flag flags;
+};
+
+/* Internal use only: Functions that might be missing from <sys/queue.h> */
+#ifndef TAILQ_FIRST
+#define TAILQ_FIRST(head) ((head)->tqh_first)
+#endif
+#ifndef TAILQ_END
+#define TAILQ_END(head) NULL
+#endif
+#ifndef TAILQ_NEXT
+#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
+#endif
+
+#ifndef TAILQ_FOREACH
+#define TAILQ_FOREACH(var, head, field) \
+ for ((var) = TAILQ_FIRST(head); \
+ (var) != TAILQ_END(head); \
+ (var) = TAILQ_NEXT(var, field))
+#endif
+
+#ifndef TAILQ_INSERT_BEFORE
+#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
+ (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
+ (elm)->field.tqe_next = (listelm); \
+ *(listelm)->field.tqe_prev = (elm); \
+ (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
+} while (0)
+#endif
+
+#define N_ACTIVE_CALLBACKS(base) \
+ ((base)->event_count_active)
+
+int evsig_set_handler_(struct event_base *base, int evsignal,
+ void (*fn)(int));
+int evsig_restore_handler_(struct event_base *base, int evsignal);
+
+int event_add_nolock_(struct event *ev,
+ const struct timeval *tv, int tv_is_absolute);
+/** Argument for event_del_nolock_. Tells event_del not to block on the event
+ * if it's running in another thread. */
+#define EVENT_DEL_NOBLOCK 0
+/** Argument for event_del_nolock_. Tells event_del to block on the event
+ * if it's running in another thread, regardless of its value for EV_FINALIZE
+ */
+#define EVENT_DEL_BLOCK 1
+/** Argument for event_del_nolock_. Tells event_del to block on the event
+ * if it is running in another thread and it doesn't have EV_FINALIZE set.
+ */
+#define EVENT_DEL_AUTOBLOCK 2
+/** Argument for event_del_nolock_. Tells event_del to procede even if the
+ * event is set up for finalization rather for regular use.*/
+#define EVENT_DEL_EVEN_IF_FINALIZING 3
+int event_del_nolock_(struct event *ev, int blocking);
+int event_remove_timer_nolock_(struct event *ev);
+
+void event_active_nolock_(struct event *ev, int res, short count);
+int event_callback_activate_(struct event_base *, struct event_callback *);
+int event_callback_activate_nolock_(struct event_base *, struct event_callback *);
+int event_callback_cancel_(struct event_base *base,
+ struct event_callback *evcb);
+
+void event_callback_finalize_nolock_(struct event_base *base, unsigned flags, struct event_callback *evcb, void (*cb)(struct event_callback *, void *));
+void event_callback_finalize_(struct event_base *base, unsigned flags, struct event_callback *evcb, void (*cb)(struct event_callback *, void *));
+int event_callback_finalize_many_(struct event_base *base, int n_cbs, struct event_callback **evcb, void (*cb)(struct event_callback *, void *));
+
+
+void event_active_later_(struct event *ev, int res);
+void event_active_later_nolock_(struct event *ev, int res);
+int event_callback_activate_later_nolock_(struct event_base *base,
+ struct event_callback *evcb);
+int event_callback_cancel_nolock_(struct event_base *base,
+ struct event_callback *evcb, int even_if_finalizing);
+void event_callback_init_(struct event_base *base,
+ struct event_callback *cb);
+
+/* FIXME document. */
+void event_base_add_virtual_(struct event_base *base);
+void event_base_del_virtual_(struct event_base *base);
+
+/** For debugging: unless assertions are disabled, verify the referential
+ integrity of the internal data structures of 'base'. This operation can
+ be expensive.
+
+ Returns on success; aborts on failure.
+*/
+void event_base_assert_ok_(struct event_base *base);
+void event_base_assert_ok_nolock_(struct event_base *base);
+
+
+/* Helper function: Call 'fn' exactly once every inserted or active event in
+ * the event_base 'base'.
+ *
+ * If fn returns 0, continue on to the next event. Otherwise, return the same
+ * value that fn returned.
+ *
+ * Requires that 'base' be locked.
+ */
+int event_base_foreach_event_nolock_(struct event_base *base,
+ event_base_foreach_event_cb cb, void *arg);
+
+/* Cleanup function to reset debug mode during shutdown.
+ *
+ * Calling this function doesn't mean it'll be possible to re-enable
+ * debug mode if any events were added.
+ */
+void event_disable_debug_mode(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT_INTERNAL_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/event.3 b/protocols/Telegram/tgl/libevent/event.3
new file mode 100644
index 0000000000..655a823efe
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/event.3
@@ -0,0 +1,624 @@
+.\" $OpenBSD: event.3,v 1.4 2002/07/12 18:50:48 provos Exp $
+.\"
+.\" Copyright (c) 2000 Artur Grabowski <art@openbsd.org>
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\"
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 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 ``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.
+.\"
+.Dd August 8, 2000
+.Dt EVENT 3
+.Os
+.Sh NAME
+.Nm event_init ,
+.Nm event_dispatch ,
+.Nm event_loop ,
+.Nm event_loopexit ,
+.Nm event_loopbreak ,
+.Nm event_set ,
+.Nm event_base_dispatch ,
+.Nm event_base_loop ,
+.Nm event_base_loopexit ,
+.Nm event_base_loopbreak ,
+.Nm event_base_set ,
+.Nm event_base_free ,
+.Nm event_add ,
+.Nm event_del ,
+.Nm event_once ,
+.Nm event_base_once ,
+.Nm event_pending ,
+.Nm event_initialized ,
+.Nm event_priority_init ,
+.Nm event_priority_set ,
+.Nm evtimer_set ,
+.Nm evtimer_add ,
+.Nm evtimer_del ,
+.Nm evtimer_pending ,
+.Nm evtimer_initialized ,
+.Nm signal_set ,
+.Nm signal_add ,
+.Nm signal_del ,
+.Nm signal_pending ,
+.Nm signal_initialized ,
+.Nm bufferevent_new ,
+.Nm bufferevent_free ,
+.Nm bufferevent_write ,
+.Nm bufferevent_write_buffer ,
+.Nm bufferevent_read ,
+.Nm bufferevent_enable ,
+.Nm bufferevent_disable ,
+.Nm bufferevent_settimeout ,
+.Nm bufferevent_base_set ,
+.Nm evbuffer_new ,
+.Nm evbuffer_free ,
+.Nm evbuffer_add ,
+.Nm evbuffer_add_buffer ,
+.Nm evbuffer_add_printf ,
+.Nm evbuffer_add_vprintf ,
+.Nm evbuffer_drain ,
+.Nm evbuffer_write ,
+.Nm evbuffer_read ,
+.Nm evbuffer_find ,
+.Nm evbuffer_readline ,
+.Nm evhttp_new ,
+.Nm evhttp_bind_socket ,
+.Nm evhttp_free
+.Nd execute a function when a specific event occurs
+.Sh SYNOPSIS
+.Fd #include <sys/time.h>
+.Fd #include <event.h>
+.Ft "struct event_base *"
+.Fn "event_init" "void"
+.Ft int
+.Fn "event_dispatch" "void"
+.Ft int
+.Fn "event_loop" "int flags"
+.Ft int
+.Fn "event_loopexit" "struct timeval *tv"
+.Ft int
+.Fn "event_loopbreak" "void"
+.Ft void
+.Fn "event_set" "struct event *ev" "int fd" "short event" "void (*fn)(int, short, void *)" "void *arg"
+.Ft int
+.Fn "event_base_dispatch" "struct event_base *base"
+.Ft int
+.Fn "event_base_loop" "struct event_base *base" "int flags"
+.Ft int
+.Fn "event_base_loopexit" "struct event_base *base" "struct timeval *tv"
+.Ft int
+.Fn "event_base_loopbreak" "struct event_base *base"
+.Ft int
+.Fn "event_base_set" "struct event_base *base" "struct event *"
+.Ft void
+.Fn "event_base_free" "struct event_base *base"
+.Ft int
+.Fn "event_add" "struct event *ev" "struct timeval *tv"
+.Ft int
+.Fn "event_del" "struct event *ev"
+.Ft int
+.Fn "event_once" "int fd" "short event" "void (*fn)(int, short, void *)" "void *arg" "struct timeval *tv"
+.Ft int
+.Fn "event_base_once" "struct event_base *base" "int fd" "short event" "void (*fn)(int, short, void *)" "void *arg" "struct timeval *tv"
+.Ft int
+.Fn "event_pending" "struct event *ev" "short event" "struct timeval *tv"
+.Ft int
+.Fn "event_initialized" "struct event *ev"
+.Ft int
+.Fn "event_priority_init" "int npriorities"
+.Ft int
+.Fn "event_priority_set" "struct event *ev" "int priority"
+.Ft void
+.Fn "evtimer_set" "struct event *ev" "void (*fn)(int, short, void *)" "void *arg"
+.Ft void
+.Fn "evtimer_add" "struct event *ev" "struct timeval *"
+.Ft void
+.Fn "evtimer_del" "struct event *ev"
+.Ft int
+.Fn "evtimer_pending" "struct event *ev" "struct timeval *tv"
+.Ft int
+.Fn "evtimer_initialized" "struct event *ev"
+.Ft void
+.Fn "signal_set" "struct event *ev" "int signal" "void (*fn)(int, short, void *)" "void *arg"
+.Ft void
+.Fn "signal_add" "struct event *ev" "struct timeval *"
+.Ft void
+.Fn "signal_del" "struct event *ev"
+.Ft int
+.Fn "signal_pending" "struct event *ev" "struct timeval *tv"
+.Ft int
+.Fn "signal_initialized" "struct event *ev"
+.Ft "struct bufferevent *"
+.Fn "bufferevent_new" "int fd" "evbuffercb readcb" "evbuffercb writecb" "everrorcb" "void *cbarg"
+.Ft void
+.Fn "bufferevent_free" "struct bufferevent *bufev"
+.Ft int
+.Fn "bufferevent_write" "struct bufferevent *bufev" "void *data" "size_t size"
+.Ft int
+.Fn "bufferevent_write_buffer" "struct bufferevent *bufev" "struct evbuffer *buf"
+.Ft size_t
+.Fn "bufferevent_read" "struct bufferevent *bufev" "void *data" "size_t size"
+.Ft int
+.Fn "bufferevent_enable" "struct bufferevent *bufev" "short event"
+.Ft int
+.Fn "bufferevent_disable" "struct bufferevent *bufev" "short event"
+.Ft void
+.Fn "bufferevent_settimeout" "struct bufferevent *bufev" "int timeout_read" "int timeout_write"
+.Ft int
+.Fn "bufferevent_base_set" "struct event_base *base" "struct bufferevent *bufev"
+.Ft "struct evbuffer *"
+.Fn "evbuffer_new" "void"
+.Ft void
+.Fn "evbuffer_free" "struct evbuffer *buf"
+.Ft int
+.Fn "evbuffer_add" "struct evbuffer *buf" "const void *data" "size_t size"
+.Ft int
+.Fn "evbuffer_add_buffer" "struct evbuffer *dst" "struct evbuffer *src"
+.Ft int
+.Fn "evbuffer_add_printf" "struct evbuffer *buf" "const char *fmt" "..."
+.Ft int
+.Fn "evbuffer_add_vprintf" "struct evbuffer *buf" "const char *fmt" "va_list ap"
+.Ft void
+.Fn "evbuffer_drain" "struct evbuffer *buf" "size_t size"
+.Ft int
+.Fn "evbuffer_write" "struct evbuffer *buf" "int fd"
+.Ft int
+.Fn "evbuffer_read" "struct evbuffer *buf" "int fd" "int size"
+.Ft "unsigned char *"
+.Fn "evbuffer_find" "struct evbuffer *buf" "const unsigned char *data" "size_t size"
+.Ft "char *"
+.Fn "evbuffer_readline" "struct evbuffer *buf"
+.Ft "struct evhttp *"
+.Fn "evhttp_new" "struct event_base *base"
+.Ft int
+.Fn "evhttp_bind_socket" "struct evhttp *http" "const char *address" "unsigned short port"
+.Ft "void"
+.Fn "evhttp_free" "struct evhttp *http"
+.Ft int
+.Fa (*event_sigcb)(void) ;
+.Ft volatile sig_atomic_t
+.Fa event_gotsig ;
+.Sh DESCRIPTION
+The
+.Nm event
+API provides a mechanism to execute a function when a specific event
+on a file descriptor occurs or after a given time has passed.
+.Pp
+The
+.Nm event
+API needs to be initialized with
+.Fn event_init
+before it can be used.
+.Pp
+In order to process events, an application needs to call
+.Fn event_dispatch .
+This function only returns on error, and should replace the event core
+of the application program.
+.Pp
+The function
+.Fn event_set
+prepares the event structure
+.Fa ev
+to be used in future calls to
+.Fn event_add
+and
+.Fn event_del .
+The event will be prepared to call the function specified by the
+.Fa fn
+argument with an
+.Fa int
+argument indicating the file descriptor, a
+.Fa short
+argument indicating the type of event, and a
+.Fa void *
+argument given in the
+.Fa arg
+argument.
+The
+.Fa fd
+indicates the file descriptor that should be monitored for events.
+The events can be either
+.Va EV_READ ,
+.Va EV_WRITE ,
+or both,
+indicating that an application can read or write from the file descriptor
+respectively without blocking.
+.Pp
+The function
+.Fa fn
+will be called with the file descriptor that triggered the event and
+the type of event which will be either
+.Va EV_TIMEOUT ,
+.Va EV_SIGNAL ,
+.Va EV_READ ,
+or
+.Va EV_WRITE .
+Additionally, an event which has registered interest in more than one of the
+preceeding events, via bitwise-OR to
+.Fn event_set ,
+can provide its callback function with a bitwise-OR of more than one triggered
+event.
+The additional flag
+.Va EV_PERSIST
+makes an
+.Fn event_add
+persistent until
+.Fn event_del
+has been called.
+.Pp
+Once initialized, the
+.Fa ev
+structure can be used repeatedly with
+.Fn event_add
+and
+.Fn event_del
+and does not need to be reinitialized unless the function called and/or
+the argument to it are to be changed.
+However, when an
+.Fa ev
+structure has been added to libevent using
+.Fn event_add
+the structure must persist until the event occurs (assuming
+.Fa EV_PERSIST
+is not set) or is removed
+using
+.Fn event_del .
+You may not reuse the same
+.Fa ev
+structure for multiple monitored descriptors; each descriptor
+needs its own
+.Fa ev .
+.Pp
+The function
+.Fn event_add
+schedules the execution of the
+.Fa ev
+event when the event specified in
+.Fn event_set
+occurs or in at least the time specified in the
+.Fa tv .
+If
+.Fa tv
+is
+.Dv NULL ,
+no timeout occurs and the function will only be called
+if a matching event occurs on the file descriptor.
+The event in the
+.Fa ev
+argument must be already initialized by
+.Fn event_set
+and may not be used in calls to
+.Fn event_set
+until it has timed out or been removed with
+.Fn event_del .
+If the event in the
+.Fa ev
+argument already has a scheduled timeout, the old timeout will be
+replaced by the new one.
+.Pp
+The function
+.Fn event_del
+will cancel the event in the argument
+.Fa ev .
+If the event has already executed or has never been added
+the call will have no effect.
+.Pp
+The functions
+.Fn evtimer_set ,
+.Fn evtimer_add ,
+.Fn evtimer_del ,
+.Fn evtimer_initialized ,
+and
+.Fn evtimer_pending
+are abbreviations for common situations where only a timeout is required.
+The file descriptor passed will be \-1, and the event type will be
+.Va EV_TIMEOUT .
+.Pp
+The functions
+.Fn signal_set ,
+.Fn signal_add ,
+.Fn signal_del ,
+.Fn signal_initialized ,
+and
+.Fn signal_pending
+are abbreviations.
+The event type will be a persistent
+.Va EV_SIGNAL .
+That means
+.Fn signal_set
+adds
+.Va EV_PERSIST .
+.Pp
+In order to avoid races in signal handlers, the
+.Nm event
+API provides two variables:
+.Va event_sigcb
+and
+.Va event_gotsig .
+A signal handler
+sets
+.Va event_gotsig
+to indicate that a signal has been received.
+The application sets
+.Va event_sigcb
+to a callback function.
+After the signal handler sets
+.Va event_gotsig ,
+.Nm event_dispatch
+will execute the callback function to process received signals.
+The callback returns 1 when no events are registered any more.
+It can return \-1 to indicate an error to the
+.Nm event
+library, causing
+.Fn event_dispatch
+to terminate with
+.Va errno
+set to
+.Er EINTR .
+.Pp
+The function
+.Fn event_once
+is similar to
+.Fn event_set .
+However, it schedules a callback to be called exactly once and does not
+require the caller to prepare an
+.Fa event
+structure.
+This function supports
+.Fa EV_TIMEOUT ,
+.Fa EV_READ ,
+and
+.Fa EV_WRITE .
+.Pp
+The
+.Fn event_pending
+function can be used to check if the event specified by
+.Fa event
+is pending to run.
+If
+.Va EV_TIMEOUT
+was specified and
+.Fa tv
+is not
+.Dv NULL ,
+the expiration time of the event will be returned in
+.Fa tv .
+.Pp
+The
+.Fn event_initialized
+macro can be used to check if an event has been initialized.
+.Pp
+The
+.Nm event_loop
+function provides an interface for single pass execution of pending
+events.
+The flags
+.Va EVLOOP_ONCE
+and
+.Va EVLOOP_NONBLOCK
+are recognized.
+The
+.Nm event_loopexit
+function exits from the event loop. The next
+.Fn event_loop
+iteration after the
+given timer expires will complete normally (handling all queued events) then
+exit without blocking for events again. Subsequent invocations of
+.Fn event_loop
+will proceed normally.
+The
+.Nm event_loopbreak
+function exits from the event loop immediately.
+.Fn event_loop
+will abort after the next event is completed;
+.Fn event_loopbreak
+is typically invoked from this event's callback. This behavior is analogous
+to the "break;" statement. Subsequent invocations of
+.Fn event_loop
+will proceed normally.
+.Pp
+It is the responsibility of the caller to provide these functions with
+pre-allocated event structures.
+.Pp
+.Sh EVENT PRIORITIES
+By default
+.Nm libevent
+schedules all active events with the same priority.
+However, sometimes it is desirable to process some events with a higher
+priority than others.
+For that reason,
+.Nm libevent
+supports strict priority queues.
+Active events with a lower priority are always processed before events
+with a higher priority.
+.Pp
+The number of different priorities can be set initially with the
+.Fn event_priority_init
+function.
+This function should be called before the first call to
+.Fn event_dispatch .
+The
+.Fn event_priority_set
+function can be used to assign a priority to an event.
+By default,
+.Nm libevent
+assigns the middle priority to all events unless their priority
+is explicitly set.
+.Sh THREAD SAFE EVENTS
+.Nm Libevent
+has experimental support for thread-safe events.
+When initializing the library via
+.Fn event_init ,
+an event base is returned.
+This event base can be used in conjunction with calls to
+.Fn event_base_set ,
+.Fn event_base_dispatch ,
+.Fn event_base_loop ,
+.Fn event_base_loopexit ,
+.Fn bufferevent_base_set
+and
+.Fn event_base_free .
+.Fn event_base_set
+should be called after preparing an event with
+.Fn event_set ,
+as
+.Fn event_set
+assigns the provided event to the most recently created event base.
+.Fn bufferevent_base_set
+should be called after preparing a bufferevent with
+.Fn bufferevent_new .
+.Fn event_base_free
+should be used to free memory associated with the event base
+when it is no longer needed.
+.Sh BUFFERED EVENTS
+.Nm libevent
+provides an abstraction on top of the regular event callbacks.
+This abstraction is called a
+.Va "buffered event" .
+A buffered event provides input and output buffers that get filled
+and drained automatically.
+The user of a buffered event no longer deals directly with the IO,
+but instead is reading from input and writing to output buffers.
+.Pp
+A new bufferevent is created by
+.Fn bufferevent_new .
+The parameter
+.Fa fd
+specifies the file descriptor from which data is read and written to.
+This file descriptor is not allowed to be a
+.Xr pipe 2 .
+The next three parameters are callbacks.
+The read and write callback have the following form:
+.Ft void
+.Fn "(*cb)" "struct bufferevent *bufev" "void *arg" .
+The error callback has the following form:
+.Ft void
+.Fn "(*cb)" "struct bufferevent *bufev" "short what" "void *arg" .
+The argument is specified by the fourth parameter
+.Fa "cbarg" .
+A
+.Fa bufferevent struct
+pointer is returned on success, NULL on error.
+Both the read and the write callback may be NULL.
+The error callback has to be always provided.
+.Pp
+Once initialized, the bufferevent structure can be used repeatedly with
+bufferevent_enable() and bufferevent_disable().
+The flags parameter can be a combination of
+.Va EV_READ
+and
+.Va EV_WRITE .
+When read enabled the bufferevent will try to read from the file
+descriptor and call the read callback.
+The write callback is executed
+whenever the output buffer is drained below the write low watermark,
+which is
+.Va 0
+by default.
+.Pp
+The
+.Fn bufferevent_write
+function can be used to write data to the file descriptor.
+The data is appended to the output buffer and written to the descriptor
+automatically as it becomes available for writing.
+.Fn bufferevent_write
+returns 0 on success or \-1 on failure.
+The
+.Fn bufferevent_read
+function is used to read data from the input buffer,
+returning the amount of data read.
+.Pp
+If multiple bases are in use, bufferevent_base_set() must be called before
+enabling the bufferevent for the first time.
+.Sh NON-BLOCKING HTTP SUPPORT
+.Nm libevent
+provides a very thin HTTP layer that can be used both to host an HTTP
+server and also to make HTTP requests.
+An HTTP server can be created by calling
+.Fn evhttp_new .
+It can be bound to any port and address with the
+.Fn evhttp_bind_socket
+function.
+When the HTTP server is no longer used, it can be freed via
+.Fn evhttp_free .
+.Pp
+To be notified of HTTP requests, a user needs to register callbacks with the
+HTTP server.
+This can be done by calling
+.Fn evhttp_set_cb .
+The second argument is the URI for which a callback is being registered.
+The corresponding callback will receive an
+.Va struct evhttp_request
+object that contains all information about the request.
+.Pp
+This section does not document all the possible function calls; please
+check
+.Va event.h
+for the public interfaces.
+.Sh ADDITIONAL NOTES
+It is possible to disable support for
+.Va epoll , kqueue , devpoll , poll
+or
+.Va select
+by setting the environment variable
+.Va EVENT_NOEPOLL , EVENT_NOKQUEUE , EVENT_NODEVPOLL , EVENT_NOPOLL
+or
+.Va EVENT_NOSELECT ,
+respectively.
+By setting the environment variable
+.Va EVENT_SHOW_METHOD ,
+.Nm libevent
+displays the kernel notification method that it uses.
+.Sh RETURN VALUES
+Upon successful completion
+.Fn event_add
+and
+.Fn event_del
+return 0.
+Otherwise, \-1 is returned and the global variable errno is
+set to indicate the error.
+.Sh SEE ALSO
+.Xr kqueue 2 ,
+.Xr poll 2 ,
+.Xr select 2 ,
+.Xr evdns 3 ,
+.Xr timeout 9
+.Sh HISTORY
+The
+.Nm event
+API manpage is based on the
+.Xr timeout 9
+manpage by Artur Grabowski.
+The port of
+.Nm libevent
+to Windows is due to Michael A. Davis.
+Support for real-time signals is due to Taral.
+.Sh AUTHORS
+The
+.Nm event
+library was written by Niels Provos.
+.Sh BUGS
+This documentation is neither complete nor authoritative.
+If you are in doubt about the usage of this API then
+check the source code to find out how it works, write
+up the missing piece of documentation and send it to
+me for inclusion in this man page.
diff --git a/protocols/Telegram/tgl/libevent/event.c b/protocols/Telegram/tgl/libevent/event.c
new file mode 100644
index 0000000000..503003e249
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/event.c
@@ -0,0 +1,3940 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#endif
+#include <sys/types.h>
+#if !defined(_WIN32) && defined(EVENT__HAVE_SYS_TIME_H)
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#ifdef EVENT__HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <ctype.h>
+#include <errno.h>
+#include <signal.h>
+#include <string.h>
+#include <time.h>
+#include <limits.h>
+
+#include "event2/event.h"
+#include "event2/event_struct.h"
+#include "event2/event_compat.h"
+#include "event-internal.h"
+#include "defer-internal.h"
+#include "evthread-internal.h"
+#include "event2/thread.h"
+#include "event2/util.h"
+#include "log-internal.h"
+#include "evmap-internal.h"
+#include "iocp-internal.h"
+#include "changelist-internal.h"
+#define HT_NO_CACHE_HASH_VALUES
+#include "ht-internal.h"
+#include "util-internal.h"
+
+
+#ifdef EVENT__HAVE_WORKING_KQUEUE
+#include "kqueue-internal.h"
+#endif
+
+#ifdef EVENT__HAVE_EVENT_PORTS
+extern const struct eventop evportops;
+#endif
+#ifdef EVENT__HAVE_SELECT
+extern const struct eventop selectops;
+#endif
+#ifdef EVENT__HAVE_POLL
+extern const struct eventop pollops;
+#endif
+#ifdef EVENT__HAVE_EPOLL
+extern const struct eventop epollops;
+#endif
+#ifdef EVENT__HAVE_WORKING_KQUEUE
+extern const struct eventop kqops;
+#endif
+#ifdef EVENT__HAVE_DEVPOLL
+extern const struct eventop devpollops;
+#endif
+#ifdef _WIN32
+extern const struct eventop win32ops;
+#endif
+
+/* Array of backends in order of preference. */
+static const struct eventop *eventops[] = {
+#ifdef EVENT__HAVE_EVENT_PORTS
+ &evportops,
+#endif
+#ifdef EVENT__HAVE_WORKING_KQUEUE
+ &kqops,
+#endif
+#ifdef EVENT__HAVE_EPOLL
+ &epollops,
+#endif
+#ifdef EVENT__HAVE_DEVPOLL
+ &devpollops,
+#endif
+#ifdef EVENT__HAVE_POLL
+ &pollops,
+#endif
+#ifdef EVENT__HAVE_SELECT
+ &selectops,
+#endif
+#ifdef _WIN32
+ &win32ops,
+#endif
+ NULL
+};
+
+/* Global state; deprecated */
+struct event_base *event_global_current_base_ = NULL;
+#define current_base event_global_current_base_
+
+/* Global state */
+
+static void *event_self_cbarg_ptr_ = NULL;
+
+/* Prototypes */
+static void event_queue_insert_active(struct event_base *, struct event_callback *);
+static void event_queue_insert_active_later(struct event_base *, struct event_callback *);
+static void event_queue_insert_timeout(struct event_base *, struct event *);
+static void event_queue_insert_inserted(struct event_base *, struct event *);
+static void event_queue_remove_active(struct event_base *, struct event_callback *);
+static void event_queue_remove_active_later(struct event_base *, struct event_callback *);
+static void event_queue_remove_timeout(struct event_base *, struct event *);
+static void event_queue_remove_inserted(struct event_base *, struct event *);
+static void event_queue_make_later_events_active(struct event_base *base);
+
+static int evthread_make_base_notifiable_nolock_(struct event_base *base);
+static int event_del_(struct event *ev, int blocking);
+
+#ifdef USE_REINSERT_TIMEOUT
+/* This code seems buggy; only turn it on if we find out what the trouble is. */
+static void event_queue_reinsert_timeout(struct event_base *,struct event *, int was_common, int is_common, int old_timeout_idx);
+#endif
+
+static int event_haveevents(struct event_base *);
+
+static int event_process_active(struct event_base *);
+
+static int timeout_next(struct event_base *, struct timeval **);
+static void timeout_process(struct event_base *);
+
+static inline void event_signal_closure(struct event_base *, struct event *ev);
+static inline void event_persist_closure(struct event_base *, struct event *ev);
+
+static int evthread_notify_base(struct event_base *base);
+
+static void insert_common_timeout_inorder(struct common_timeout_list *ctl,
+ struct event *ev);
+
+#ifndef EVENT__DISABLE_DEBUG_MODE
+/* These functions implement a hashtable of which 'struct event *' structures
+ * have been setup or added. We don't want to trust the content of the struct
+ * event itself, since we're trying to work through cases where an event gets
+ * clobbered or freed. Instead, we keep a hashtable indexed by the pointer.
+ */
+
+struct event_debug_entry {
+ HT_ENTRY(event_debug_entry) node;
+ const struct event *ptr;
+ unsigned added : 1;
+};
+
+static inline unsigned
+hash_debug_entry(const struct event_debug_entry *e)
+{
+ /* We need to do this silliness to convince compilers that we
+ * honestly mean to cast e->ptr to an integer, and discard any
+ * part of it that doesn't fit in an unsigned.
+ */
+ unsigned u = (unsigned) ((ev_uintptr_t) e->ptr);
+ /* Our hashtable implementation is pretty sensitive to low bits,
+ * and every struct event is over 64 bytes in size, so we can
+ * just say >>6. */
+ return (u >> 6);
+}
+
+static inline int
+eq_debug_entry(const struct event_debug_entry *a,
+ const struct event_debug_entry *b)
+{
+ return a->ptr == b->ptr;
+}
+
+int event_debug_mode_on_ = 0;
+
+
+#if !defined(EVENT__DISABLE_THREAD_SUPPORT) && !defined(EVENT__DISABLE_DEBUG_MODE)
+/**
+ * @brief debug mode variable which is set for any function/structure that needs
+ * to be shared across threads (if thread support is enabled).
+ *
+ * When and if evthreads are initialized, this variable will be evaluated,
+ * and if set to something other than zero, this means the evthread setup
+ * functions were called out of order.
+ *
+ * See: "Locks and threading" in the documentation.
+ */
+int event_debug_created_threadable_ctx_ = 0;
+#endif
+
+/* Set if it's too late to enable event_debug_mode. */
+static int event_debug_mode_too_late = 0;
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+static void *event_debug_map_lock_ = NULL;
+#endif
+static HT_HEAD(event_debug_map, event_debug_entry) global_debug_map =
+ HT_INITIALIZER();
+
+HT_PROTOTYPE(event_debug_map, event_debug_entry, node, hash_debug_entry,
+ eq_debug_entry)
+HT_GENERATE(event_debug_map, event_debug_entry, node, hash_debug_entry,
+ eq_debug_entry, 0.5, mm_malloc, mm_realloc, mm_free)
+
+/* Macro: record that ev is now setup (that is, ready for an add) */
+#define event_debug_note_setup_(ev) do { \
+ if (event_debug_mode_on_) { \
+ struct event_debug_entry *dent,find; \
+ find.ptr = (ev); \
+ EVLOCK_LOCK(event_debug_map_lock_, 0); \
+ dent = HT_FIND(event_debug_map, &global_debug_map, &find); \
+ if (dent) { \
+ dent->added = 0; \
+ } else { \
+ dent = mm_malloc(sizeof(*dent)); \
+ if (!dent) \
+ event_err(1, \
+ "Out of memory in debugging code"); \
+ dent->ptr = (ev); \
+ dent->added = 0; \
+ HT_INSERT(event_debug_map, &global_debug_map, dent); \
+ } \
+ EVLOCK_UNLOCK(event_debug_map_lock_, 0); \
+ } \
+ event_debug_mode_too_late = 1; \
+ } while (0)
+/* Macro: record that ev is no longer setup */
+#define event_debug_note_teardown_(ev) do { \
+ if (event_debug_mode_on_) { \
+ struct event_debug_entry *dent,find; \
+ find.ptr = (ev); \
+ EVLOCK_LOCK(event_debug_map_lock_, 0); \
+ dent = HT_REMOVE(event_debug_map, &global_debug_map, &find); \
+ if (dent) \
+ mm_free(dent); \
+ EVLOCK_UNLOCK(event_debug_map_lock_, 0); \
+ } \
+ event_debug_mode_too_late = 1; \
+ } while (0)
+/* Macro: record that ev is now added */
+#define event_debug_note_add_(ev) do { \
+ if (event_debug_mode_on_) { \
+ struct event_debug_entry *dent,find; \
+ find.ptr = (ev); \
+ EVLOCK_LOCK(event_debug_map_lock_, 0); \
+ dent = HT_FIND(event_debug_map, &global_debug_map, &find); \
+ if (dent) { \
+ dent->added = 1; \
+ } else { \
+ event_errx(EVENT_ERR_ABORT_, \
+ "%s: noting an add on a non-setup event %p" \
+ " (events: 0x%x, fd: "EV_SOCK_FMT \
+ ", flags: 0x%x)", \
+ __func__, (ev), (ev)->ev_events, \
+ EV_SOCK_ARG((ev)->ev_fd), (ev)->ev_flags); \
+ } \
+ EVLOCK_UNLOCK(event_debug_map_lock_, 0); \
+ } \
+ event_debug_mode_too_late = 1; \
+ } while (0)
+/* Macro: record that ev is no longer added */
+#define event_debug_note_del_(ev) do { \
+ if (event_debug_mode_on_) { \
+ struct event_debug_entry *dent,find; \
+ find.ptr = (ev); \
+ EVLOCK_LOCK(event_debug_map_lock_, 0); \
+ dent = HT_FIND(event_debug_map, &global_debug_map, &find); \
+ if (dent) { \
+ dent->added = 0; \
+ } else { \
+ event_errx(EVENT_ERR_ABORT_, \
+ "%s: noting a del on a non-setup event %p" \
+ " (events: 0x%x, fd: "EV_SOCK_FMT \
+ ", flags: 0x%x)", \
+ __func__, (ev), (ev)->ev_events, \
+ EV_SOCK_ARG((ev)->ev_fd), (ev)->ev_flags); \
+ } \
+ EVLOCK_UNLOCK(event_debug_map_lock_, 0); \
+ } \
+ event_debug_mode_too_late = 1; \
+ } while (0)
+/* Macro: assert that ev is setup (i.e., okay to add or inspect) */
+#define event_debug_assert_is_setup_(ev) do { \
+ if (event_debug_mode_on_) { \
+ struct event_debug_entry *dent,find; \
+ find.ptr = (ev); \
+ EVLOCK_LOCK(event_debug_map_lock_, 0); \
+ dent = HT_FIND(event_debug_map, &global_debug_map, &find); \
+ if (!dent) { \
+ event_errx(EVENT_ERR_ABORT_, \
+ "%s called on a non-initialized event %p" \
+ " (events: 0x%x, fd: "EV_SOCK_FMT\
+ ", flags: 0x%x)", \
+ __func__, (ev), (ev)->ev_events, \
+ EV_SOCK_ARG((ev)->ev_fd), (ev)->ev_flags); \
+ } \
+ EVLOCK_UNLOCK(event_debug_map_lock_, 0); \
+ } \
+ } while (0)
+/* Macro: assert that ev is not added (i.e., okay to tear down or set
+ * up again) */
+#define event_debug_assert_not_added_(ev) do { \
+ if (event_debug_mode_on_) { \
+ struct event_debug_entry *dent,find; \
+ find.ptr = (ev); \
+ EVLOCK_LOCK(event_debug_map_lock_, 0); \
+ dent = HT_FIND(event_debug_map, &global_debug_map, &find); \
+ if (dent && dent->added) { \
+ event_errx(EVENT_ERR_ABORT_, \
+ "%s called on an already added event %p" \
+ " (events: 0x%x, fd: "EV_SOCK_FMT", " \
+ "flags: 0x%x)", \
+ __func__, (ev), (ev)->ev_events, \
+ EV_SOCK_ARG((ev)->ev_fd), (ev)->ev_flags); \
+ } \
+ EVLOCK_UNLOCK(event_debug_map_lock_, 0); \
+ } \
+ } while (0)
+#else
+#define event_debug_note_setup_(ev) \
+ ((void)0)
+#define event_debug_note_teardown_(ev) \
+ ((void)0)
+#define event_debug_note_add_(ev) \
+ ((void)0)
+#define event_debug_note_del_(ev) \
+ ((void)0)
+#define event_debug_assert_is_setup_(ev) \
+ ((void)0)
+#define event_debug_assert_not_added_(ev) \
+ ((void)0)
+#endif
+
+#define EVENT_BASE_ASSERT_LOCKED(base) \
+ EVLOCK_ASSERT_LOCKED((base)->th_base_lock)
+
+/* How often (in seconds) do we check for changes in wall clock time relative
+ * to monotonic time? Set this to -1 for 'never.' */
+#define CLOCK_SYNC_INTERVAL 5
+
+/** Set 'tp' to the current time according to 'base'. We must hold the lock
+ * on 'base'. If there is a cached time, return it. Otherwise, use
+ * clock_gettime or gettimeofday as appropriate to find out the right time.
+ * Return 0 on success, -1 on failure.
+ */
+static int
+gettime(struct event_base *base, struct timeval *tp)
+{
+ EVENT_BASE_ASSERT_LOCKED(base);
+
+ if (base->tv_cache.tv_sec) {
+ *tp = base->tv_cache;
+ return (0);
+ }
+
+ if (evutil_gettime_monotonic_(&base->monotonic_timer, tp) == -1) {
+ return -1;
+ }
+
+ if (base->last_updated_clock_diff + CLOCK_SYNC_INTERVAL
+ < tp->tv_sec) {
+ struct timeval tv;
+ evutil_gettimeofday(&tv,NULL);
+ evutil_timersub(&tv, tp, &base->tv_clock_diff);
+ base->last_updated_clock_diff = tp->tv_sec;
+ }
+
+ return 0;
+}
+
+int
+event_base_gettimeofday_cached(struct event_base *base, struct timeval *tv)
+{
+ int r;
+ if (!base) {
+ base = current_base;
+ if (!current_base)
+ return evutil_gettimeofday(tv, NULL);
+ }
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ if (base->tv_cache.tv_sec == 0) {
+ r = evutil_gettimeofday(tv, NULL);
+ } else {
+ evutil_timeradd(&base->tv_cache, &base->tv_clock_diff, tv);
+ r = 0;
+ }
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return r;
+}
+
+/** Make 'base' have no current cached time. */
+static inline void
+clear_time_cache(struct event_base *base)
+{
+ base->tv_cache.tv_sec = 0;
+}
+
+/** Replace the cached time in 'base' with the current time. */
+static inline void
+update_time_cache(struct event_base *base)
+{
+ base->tv_cache.tv_sec = 0;
+ if (!(base->flags & EVENT_BASE_FLAG_NO_CACHE_TIME))
+ gettime(base, &base->tv_cache);
+}
+
+int
+event_base_update_cache_time(struct event_base *base)
+{
+
+ if (!base) {
+ base = current_base;
+ if (!current_base)
+ return -1;
+ }
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ if (base->running_loop)
+ update_time_cache(base);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return 0;
+}
+
+static inline struct event *
+event_callback_to_event(struct event_callback *evcb)
+{
+ EVUTIL_ASSERT((evcb->evcb_flags & EVLIST_INIT));
+ return EVUTIL_UPCAST(evcb, struct event, ev_evcallback);
+}
+
+static inline struct event_callback *
+event_to_event_callback(struct event *ev)
+{
+ return &ev->ev_evcallback;
+}
+
+struct event_base *
+event_init(void)
+{
+ struct event_base *base = event_base_new_with_config(NULL);
+
+ if (base == NULL) {
+ event_errx(1, "%s: Unable to construct event_base", __func__);
+ return NULL;
+ }
+
+ current_base = base;
+
+ return (base);
+}
+
+struct event_base *
+event_base_new(void)
+{
+ struct event_base *base = NULL;
+ struct event_config *cfg = event_config_new();
+ if (cfg) {
+ base = event_base_new_with_config(cfg);
+ event_config_free(cfg);
+ }
+ return base;
+}
+
+/** Return true iff 'method' is the name of a method that 'cfg' tells us to
+ * avoid. */
+static int
+event_config_is_avoided_method(const struct event_config *cfg,
+ const char *method)
+{
+ struct event_config_entry *entry;
+
+ TAILQ_FOREACH(entry, &cfg->entries, next) {
+ if (entry->avoid_method != NULL &&
+ strcmp(entry->avoid_method, method) == 0)
+ return (1);
+ }
+
+ return (0);
+}
+
+/** Return true iff 'method' is disabled according to the environment. */
+static int
+event_is_method_disabled(const char *name)
+{
+ char environment[64];
+ int i;
+
+ evutil_snprintf(environment, sizeof(environment), "EVENT_NO%s", name);
+ for (i = 8; environment[i] != '\0'; ++i)
+ environment[i] = EVUTIL_TOUPPER_(environment[i]);
+ /* Note that evutil_getenv_() ignores the environment entirely if
+ * we're setuid */
+ return (evutil_getenv_(environment) != NULL);
+}
+
+int
+event_base_get_features(const struct event_base *base)
+{
+ return base->evsel->features;
+}
+
+void
+event_enable_debug_mode(void)
+{
+#ifndef EVENT__DISABLE_DEBUG_MODE
+ if (event_debug_mode_on_)
+ event_errx(1, "%s was called twice!", __func__);
+ if (event_debug_mode_too_late)
+ event_errx(1, "%s must be called *before* creating any events "
+ "or event_bases",__func__);
+
+ event_debug_mode_on_ = 1;
+
+ HT_INIT(event_debug_map, &global_debug_map);
+#endif
+}
+
+void
+event_disable_debug_mode(void)
+{
+#ifndef EVENT__DISABLE_DEBUG_MODE
+ struct event_debug_entry **ent, *victim;
+
+ EVLOCK_LOCK(event_debug_map_lock_, 0);
+ for (ent = HT_START(event_debug_map, &global_debug_map); ent; ) {
+ victim = *ent;
+ ent = HT_NEXT_RMV(event_debug_map, &global_debug_map, ent);
+ mm_free(victim);
+ }
+ HT_CLEAR(event_debug_map, &global_debug_map);
+ EVLOCK_UNLOCK(event_debug_map_lock_ , 0);
+
+ event_debug_mode_on_ = 0;
+#endif
+}
+
+struct event_base *
+event_base_new_with_config(const struct event_config *cfg)
+{
+ int i;
+ struct event_base *base;
+ int should_check_environment;
+
+#ifndef EVENT__DISABLE_DEBUG_MODE
+ event_debug_mode_too_late = 1;
+#endif
+
+ if ((base = mm_calloc(1, sizeof(struct event_base))) == NULL) {
+ event_warn("%s: calloc", __func__);
+ return NULL;
+ }
+
+ if (cfg)
+ base->flags = cfg->flags;
+
+ should_check_environment =
+ !(cfg && (cfg->flags & EVENT_BASE_FLAG_IGNORE_ENV));
+
+ {
+ struct timeval tmp;
+ int precise_time =
+ cfg && (cfg->flags & EVENT_BASE_FLAG_PRECISE_TIMER);
+ int flags;
+ if (should_check_environment && !precise_time) {
+ precise_time = evutil_getenv_("EVENT_PRECISE_TIMER") != NULL;
+ base->flags |= EVENT_BASE_FLAG_PRECISE_TIMER;
+ }
+ flags = precise_time ? EV_MONOT_PRECISE : 0;
+ evutil_configure_monotonic_time_(&base->monotonic_timer, flags);
+
+ gettime(base, &tmp);
+ }
+
+ min_heap_ctor_(&base->timeheap);
+
+ base->sig.ev_signal_pair[0] = -1;
+ base->sig.ev_signal_pair[1] = -1;
+ base->th_notify_fd[0] = -1;
+ base->th_notify_fd[1] = -1;
+
+ TAILQ_INIT(&base->active_later_queue);
+
+ evmap_io_initmap_(&base->io);
+ evmap_signal_initmap_(&base->sigmap);
+ event_changelist_init_(&base->changelist);
+
+ base->evbase = NULL;
+
+ if (cfg) {
+ memcpy(&base->max_dispatch_time,
+ &cfg->max_dispatch_interval, sizeof(struct timeval));
+ base->limit_callbacks_after_prio =
+ cfg->limit_callbacks_after_prio;
+ } else {
+ base->max_dispatch_time.tv_sec = -1;
+ base->limit_callbacks_after_prio = 1;
+ }
+ if (cfg && cfg->max_dispatch_callbacks >= 0) {
+ base->max_dispatch_callbacks = cfg->max_dispatch_callbacks;
+ } else {
+ base->max_dispatch_callbacks = INT_MAX;
+ }
+ if (base->max_dispatch_callbacks == INT_MAX &&
+ base->max_dispatch_time.tv_sec == -1)
+ base->limit_callbacks_after_prio = INT_MAX;
+
+ for (i = 0; eventops[i] && !base->evbase; i++) {
+ if (cfg != NULL) {
+ /* determine if this backend should be avoided */
+ if (event_config_is_avoided_method(cfg,
+ eventops[i]->name))
+ continue;
+ if ((eventops[i]->features & cfg->require_features)
+ != cfg->require_features)
+ continue;
+ }
+
+ /* also obey the environment variables */
+ if (should_check_environment &&
+ event_is_method_disabled(eventops[i]->name))
+ continue;
+
+ base->evsel = eventops[i];
+
+ base->evbase = base->evsel->init(base);
+ }
+
+ if (base->evbase == NULL) {
+ event_warnx("%s: no event mechanism available",
+ __func__);
+ base->evsel = NULL;
+ event_base_free(base);
+ return NULL;
+ }
+
+ if (evutil_getenv_("EVENT_SHOW_METHOD"))
+ event_msgx("libevent using: %s", base->evsel->name);
+
+ /* allocate a single active event queue */
+ if (event_base_priority_init(base, 1) < 0) {
+ event_base_free(base);
+ return NULL;
+ }
+
+ /* prepare for threading */
+
+#if !defined(EVENT__DISABLE_THREAD_SUPPORT) && !defined(EVENT__DISABLE_DEBUG_MODE)
+ event_debug_created_threadable_ctx_ = 1;
+#endif
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ if (EVTHREAD_LOCKING_ENABLED() &&
+ (!cfg || !(cfg->flags & EVENT_BASE_FLAG_NOLOCK))) {
+ int r;
+ EVTHREAD_ALLOC_LOCK(base->th_base_lock, 0);
+ EVTHREAD_ALLOC_COND(base->current_event_cond);
+ r = evthread_make_base_notifiable(base);
+ if (r<0) {
+ event_warnx("%s: Unable to make base notifiable.", __func__);
+ event_base_free(base);
+ return NULL;
+ }
+ }
+#endif
+
+#ifdef _WIN32
+ if (cfg && (cfg->flags & EVENT_BASE_FLAG_STARTUP_IOCP))
+ event_base_start_iocp_(base, cfg->n_cpus_hint);
+#endif
+
+ return (base);
+}
+
+int
+event_base_start_iocp_(struct event_base *base, int n_cpus)
+{
+#ifdef _WIN32
+ if (base->iocp)
+ return 0;
+ base->iocp = event_iocp_port_launch_(n_cpus);
+ if (!base->iocp) {
+ event_warnx("%s: Couldn't launch IOCP", __func__);
+ return -1;
+ }
+ return 0;
+#else
+ return -1;
+#endif
+}
+
+void
+event_base_stop_iocp_(struct event_base *base)
+{
+#ifdef _WIN32
+ int rv;
+
+ if (!base->iocp)
+ return;
+ rv = event_iocp_shutdown_(base->iocp, -1);
+ EVUTIL_ASSERT(rv >= 0);
+ base->iocp = NULL;
+#endif
+}
+
+static int
+event_base_cancel_single_callback_(struct event_base *base,
+ struct event_callback *evcb,
+ int run_finalizers)
+{
+ int result = 0;
+
+ if (evcb->evcb_flags & EVLIST_INIT) {
+ struct event *ev = event_callback_to_event(evcb);
+ if (!(ev->ev_flags & EVLIST_INTERNAL)) {
+ event_del_(ev, EVENT_DEL_EVEN_IF_FINALIZING);
+ result = 1;
+ }
+ } else {
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ event_callback_cancel_nolock_(base, evcb, 1);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ result = 1;
+ }
+
+ if (run_finalizers && (evcb->evcb_flags & EVLIST_FINALIZING)) {
+ switch (evcb->evcb_closure) {
+ case EV_CLOSURE_EVENT_FINALIZE:
+ case EV_CLOSURE_EVENT_FINALIZE_FREE: {
+ struct event *ev = event_callback_to_event(evcb);
+ ev->ev_evcallback.evcb_cb_union.evcb_evfinalize(ev, ev->ev_arg);
+ if (evcb->evcb_closure == EV_CLOSURE_EVENT_FINALIZE_FREE)
+ mm_free(ev);
+ break;
+ }
+ case EV_CLOSURE_CB_FINALIZE:
+ evcb->evcb_cb_union.evcb_cbfinalize(evcb, evcb->evcb_arg);
+ break;
+ default:
+ break;
+ }
+ }
+ return result;
+}
+
+static int event_base_free_queues_(struct event_base *base, int run_finalizers)
+{
+ int deleted = 0, i;
+
+ for (i = 0; i < base->nactivequeues; ++i) {
+ struct event_callback *evcb, *next;
+ for (evcb = TAILQ_FIRST(&base->activequeues[i]); evcb; ) {
+ next = TAILQ_NEXT(evcb, evcb_active_next);
+ deleted += event_base_cancel_single_callback_(base, evcb, run_finalizers);
+ evcb = next;
+ }
+ }
+
+ {
+ struct event_callback *evcb;
+ while ((evcb = TAILQ_FIRST(&base->active_later_queue))) {
+ deleted += event_base_cancel_single_callback_(base, evcb, run_finalizers);
+ }
+ }
+
+ return deleted;
+}
+
+static void
+event_base_free_(struct event_base *base, int run_finalizers)
+{
+ int i, n_deleted=0;
+ struct event *ev;
+ /* XXXX grab the lock? If there is contention when one thread frees
+ * the base, then the contending thread will be very sad soon. */
+
+ /* event_base_free(NULL) is how to free the current_base if we
+ * made it with event_init and forgot to hold a reference to it. */
+ if (base == NULL && current_base)
+ base = current_base;
+ /* Don't actually free NULL. */
+ if (base == NULL) {
+ event_warnx("%s: no base to free", __func__);
+ return;
+ }
+ /* XXX(niels) - check for internal events first */
+
+#ifdef _WIN32
+ event_base_stop_iocp_(base);
+#endif
+
+ /* threading fds if we have them */
+ if (base->th_notify_fd[0] != -1) {
+ event_del(&base->th_notify);
+ EVUTIL_CLOSESOCKET(base->th_notify_fd[0]);
+ if (base->th_notify_fd[1] != -1)
+ EVUTIL_CLOSESOCKET(base->th_notify_fd[1]);
+ base->th_notify_fd[0] = -1;
+ base->th_notify_fd[1] = -1;
+ event_debug_unassign(&base->th_notify);
+ }
+
+ /* Delete all non-internal events. */
+ evmap_delete_all_(base);
+
+ while ((ev = min_heap_top_(&base->timeheap)) != NULL) {
+ event_del(ev);
+ ++n_deleted;
+ }
+ for (i = 0; i < base->n_common_timeouts; ++i) {
+ struct common_timeout_list *ctl =
+ base->common_timeout_queues[i];
+ event_del(&ctl->timeout_event); /* Internal; doesn't count */
+ event_debug_unassign(&ctl->timeout_event);
+ for (ev = TAILQ_FIRST(&ctl->events); ev; ) {
+ struct event *next = TAILQ_NEXT(ev,
+ ev_timeout_pos.ev_next_with_common_timeout);
+ if (!(ev->ev_flags & EVLIST_INTERNAL)) {
+ event_del(ev);
+ ++n_deleted;
+ }
+ ev = next;
+ }
+ mm_free(ctl);
+ }
+ if (base->common_timeout_queues)
+ mm_free(base->common_timeout_queues);
+
+ for (;;) {
+ /* For finalizers we can register yet another finalizer out from
+ * finalizer, and iff finalizer will be in active_later_queue we can
+ * add finalizer to activequeues, and we will have events in
+ * activequeues after this function returns, which is not what we want
+ * (we even have an assertion for this).
+ *
+ * A simple case is bufferevent with underlying (i.e. filters).
+ */
+ int i = event_base_free_queues_(base, run_finalizers);
+ if (!i) {
+ break;
+ }
+ n_deleted += i;
+ }
+
+ if (n_deleted)
+ event_debug(("%s: %d events were still set in base",
+ __func__, n_deleted));
+
+ while (LIST_FIRST(&base->once_events)) {
+ struct event_once *eonce = LIST_FIRST(&base->once_events);
+ LIST_REMOVE(eonce, next_once);
+ mm_free(eonce);
+ }
+
+ if (base->evsel != NULL && base->evsel->dealloc != NULL)
+ base->evsel->dealloc(base);
+
+ for (i = 0; i < base->nactivequeues; ++i)
+ EVUTIL_ASSERT(TAILQ_EMPTY(&base->activequeues[i]));
+
+ EVUTIL_ASSERT(min_heap_empty_(&base->timeheap));
+ min_heap_dtor_(&base->timeheap);
+
+ mm_free(base->activequeues);
+
+ evmap_io_clear_(&base->io);
+ evmap_signal_clear_(&base->sigmap);
+ event_changelist_freemem_(&base->changelist);
+
+ EVTHREAD_FREE_LOCK(base->th_base_lock, 0);
+ EVTHREAD_FREE_COND(base->current_event_cond);
+
+ /* If we're freeing current_base, there won't be a current_base. */
+ if (base == current_base)
+ current_base = NULL;
+ mm_free(base);
+}
+
+void
+event_base_free_nofinalize(struct event_base *base)
+{
+ event_base_free_(base, 0);
+}
+
+void
+event_base_free(struct event_base *base)
+{
+ event_base_free_(base, 1);
+}
+
+/* Fake eventop; used to disable the backend temporarily inside event_reinit
+ * so that we can call event_del() on an event without telling the backend.
+ */
+static int
+nil_backend_del(struct event_base *b, evutil_socket_t fd, short old,
+ short events, void *fdinfo)
+{
+ return 0;
+}
+const struct eventop nil_eventop = {
+ "nil",
+ NULL, /* init: unused. */
+ NULL, /* add: unused. */
+ nil_backend_del, /* del: used, so needs to be killed. */
+ NULL, /* dispatch: unused. */
+ NULL, /* dealloc: unused. */
+ 0, 0, 0
+};
+
+/* reinitialize the event base after a fork */
+int
+event_reinit(struct event_base *base)
+{
+ const struct eventop *evsel;
+ int res = 0;
+ int was_notifiable = 0;
+ int had_signal_added = 0;
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+
+ evsel = base->evsel;
+
+ /* check if this event mechanism requires reinit on the backend */
+ if (evsel->need_reinit) {
+ /* We're going to call event_del() on our notify events (the
+ * ones that tell about signals and wakeup events). But we
+ * don't actually want to tell the backend to change its
+ * state, since it might still share some resource (a kqueue,
+ * an epoll fd) with the parent process, and we don't want to
+ * delete the fds from _that_ backend, we temporarily stub out
+ * the evsel with a replacement.
+ */
+ base->evsel = &nil_eventop;
+ }
+
+ /* We need to re-create a new signal-notification fd and a new
+ * thread-notification fd. Otherwise, we'll still share those with
+ * the parent process, which would make any notification sent to them
+ * get received by one or both of the event loops, more or less at
+ * random.
+ */
+ if (base->sig.ev_signal_added) {
+ event_del_nolock_(&base->sig.ev_signal, EVENT_DEL_AUTOBLOCK);
+ event_debug_unassign(&base->sig.ev_signal);
+ memset(&base->sig.ev_signal, 0, sizeof(base->sig.ev_signal));
+ had_signal_added = 1;
+ base->sig.ev_signal_added = 0;
+ }
+ if (base->sig.ev_signal_pair[0] != -1)
+ EVUTIL_CLOSESOCKET(base->sig.ev_signal_pair[0]);
+ if (base->sig.ev_signal_pair[1] != -1)
+ EVUTIL_CLOSESOCKET(base->sig.ev_signal_pair[1]);
+ if (base->th_notify_fn != NULL) {
+ was_notifiable = 1;
+ base->th_notify_fn = NULL;
+ }
+ if (base->th_notify_fd[0] != -1) {
+ event_del_nolock_(&base->th_notify, EVENT_DEL_AUTOBLOCK);
+ EVUTIL_CLOSESOCKET(base->th_notify_fd[0]);
+ if (base->th_notify_fd[1] != -1)
+ EVUTIL_CLOSESOCKET(base->th_notify_fd[1]);
+ base->th_notify_fd[0] = -1;
+ base->th_notify_fd[1] = -1;
+ event_debug_unassign(&base->th_notify);
+ }
+
+ /* Replace the original evsel. */
+ base->evsel = evsel;
+
+ if (evsel->need_reinit) {
+ /* Reconstruct the backend through brute-force, so that we do
+ * not share any structures with the parent process. For some
+ * backends, this is necessary: epoll and kqueue, for
+ * instance, have events associated with a kernel
+ * structure. If didn't reinitialize, we'd share that
+ * structure with the parent process, and any changes made by
+ * the parent would affect our backend's behavior (and vice
+ * versa).
+ */
+ if (base->evsel->dealloc != NULL)
+ base->evsel->dealloc(base);
+ base->evbase = evsel->init(base);
+ if (base->evbase == NULL) {
+ event_errx(1,
+ "%s: could not reinitialize event mechanism",
+ __func__);
+ res = -1;
+ goto done;
+ }
+
+ /* Empty out the changelist (if any): we are starting from a
+ * blank slate. */
+ event_changelist_freemem_(&base->changelist);
+
+ /* Tell the event maps to re-inform the backend about all
+ * pending events. This will make the signal notification
+ * event get re-created if necessary. */
+ if (evmap_reinit_(base) < 0)
+ res = -1;
+ } else {
+ res = evsig_init_(base);
+ if (res == 0 && had_signal_added) {
+ res = event_add_nolock_(&base->sig.ev_signal, NULL, 0);
+ if (res == 0)
+ base->sig.ev_signal_added = 1;
+ }
+ }
+
+ /* If we were notifiable before, and nothing just exploded, become
+ * notifiable again. */
+ if (was_notifiable && res == 0)
+ res = evthread_make_base_notifiable_nolock_(base);
+
+done:
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return (res);
+}
+
+/* Get the monotonic time for this event_base' timer */
+int
+event_gettime_monotonic(struct event_base *base, struct timeval *tv)
+{
+ int rv = -1;
+
+ if (base && tv) {
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ rv = evutil_gettime_monotonic_(&(base->monotonic_timer), tv);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ }
+
+ return rv;
+}
+
+const char **
+event_get_supported_methods(void)
+{
+ static const char **methods = NULL;
+ const struct eventop **method;
+ const char **tmp;
+ int i = 0, k;
+
+ /* count all methods */
+ for (method = &eventops[0]; *method != NULL; ++method) {
+ ++i;
+ }
+
+ /* allocate one more than we need for the NULL pointer */
+ tmp = mm_calloc((i + 1), sizeof(char *));
+ if (tmp == NULL)
+ return (NULL);
+
+ /* populate the array with the supported methods */
+ for (k = 0, i = 0; eventops[k] != NULL; ++k) {
+ tmp[i++] = eventops[k]->name;
+ }
+ tmp[i] = NULL;
+
+ if (methods != NULL)
+ mm_free((char**)methods);
+
+ methods = tmp;
+
+ return (methods);
+}
+
+struct event_config *
+event_config_new(void)
+{
+ struct event_config *cfg = mm_calloc(1, sizeof(*cfg));
+
+ if (cfg == NULL)
+ return (NULL);
+
+ TAILQ_INIT(&cfg->entries);
+ cfg->max_dispatch_interval.tv_sec = -1;
+ cfg->max_dispatch_callbacks = INT_MAX;
+ cfg->limit_callbacks_after_prio = 1;
+
+ return (cfg);
+}
+
+static void
+event_config_entry_free(struct event_config_entry *entry)
+{
+ if (entry->avoid_method != NULL)
+ mm_free((char *)entry->avoid_method);
+ mm_free(entry);
+}
+
+void
+event_config_free(struct event_config *cfg)
+{
+ struct event_config_entry *entry;
+
+ while ((entry = TAILQ_FIRST(&cfg->entries)) != NULL) {
+ TAILQ_REMOVE(&cfg->entries, entry, next);
+ event_config_entry_free(entry);
+ }
+ mm_free(cfg);
+}
+
+int
+event_config_set_flag(struct event_config *cfg, int flag)
+{
+ if (!cfg)
+ return -1;
+ cfg->flags |= flag;
+ return 0;
+}
+
+int
+event_config_avoid_method(struct event_config *cfg, const char *method)
+{
+ struct event_config_entry *entry = mm_malloc(sizeof(*entry));
+ if (entry == NULL)
+ return (-1);
+
+ if ((entry->avoid_method = mm_strdup(method)) == NULL) {
+ mm_free(entry);
+ return (-1);
+ }
+
+ TAILQ_INSERT_TAIL(&cfg->entries, entry, next);
+
+ return (0);
+}
+
+int
+event_config_require_features(struct event_config *cfg,
+ int features)
+{
+ if (!cfg)
+ return (-1);
+ cfg->require_features = features;
+ return (0);
+}
+
+int
+event_config_set_num_cpus_hint(struct event_config *cfg, int cpus)
+{
+ if (!cfg)
+ return (-1);
+ cfg->n_cpus_hint = cpus;
+ return (0);
+}
+
+int
+event_config_set_max_dispatch_interval(struct event_config *cfg,
+ const struct timeval *max_interval, int max_callbacks, int min_priority)
+{
+ if (max_interval)
+ memcpy(&cfg->max_dispatch_interval, max_interval,
+ sizeof(struct timeval));
+ else
+ cfg->max_dispatch_interval.tv_sec = -1;
+ cfg->max_dispatch_callbacks =
+ max_callbacks >= 0 ? max_callbacks : INT_MAX;
+ if (min_priority < 0)
+ min_priority = 0;
+ cfg->limit_callbacks_after_prio = min_priority;
+ return (0);
+}
+
+int
+event_priority_init(int npriorities)
+{
+ return event_base_priority_init(current_base, npriorities);
+}
+
+int
+event_base_priority_init(struct event_base *base, int npriorities)
+{
+ int i, r;
+ r = -1;
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+
+ if (N_ACTIVE_CALLBACKS(base) || npriorities < 1
+ || npriorities >= EVENT_MAX_PRIORITIES)
+ goto err;
+
+ if (npriorities == base->nactivequeues)
+ goto ok;
+
+ if (base->nactivequeues) {
+ mm_free(base->activequeues);
+ base->nactivequeues = 0;
+ }
+
+ /* Allocate our priority queues */
+ base->activequeues = (struct evcallback_list *)
+ mm_calloc(npriorities, sizeof(struct evcallback_list));
+ if (base->activequeues == NULL) {
+ event_warn("%s: calloc", __func__);
+ goto err;
+ }
+ base->nactivequeues = npriorities;
+
+ for (i = 0; i < base->nactivequeues; ++i) {
+ TAILQ_INIT(&base->activequeues[i]);
+ }
+
+ok:
+ r = 0;
+err:
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return (r);
+}
+
+int
+event_base_get_npriorities(struct event_base *base)
+{
+
+ int n;
+ if (base == NULL)
+ base = current_base;
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ n = base->nactivequeues;
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return (n);
+}
+
+int
+event_base_get_num_events(struct event_base *base, unsigned int type)
+{
+ int r = 0;
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+
+ if (type & EVENT_BASE_COUNT_ACTIVE)
+ r += base->event_count_active;
+
+ if (type & EVENT_BASE_COUNT_VIRTUAL)
+ r += base->virtual_event_count;
+
+ if (type & EVENT_BASE_COUNT_ADDED)
+ r += base->event_count;
+
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+
+ return r;
+}
+
+int
+event_base_get_max_events(struct event_base *base, unsigned int type, int clear)
+{
+ int r = 0;
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+
+ if (type & EVENT_BASE_COUNT_ACTIVE) {
+ r += base->event_count_active_max;
+ if (clear)
+ base->event_count_active_max = 0;
+ }
+
+ if (type & EVENT_BASE_COUNT_VIRTUAL) {
+ r += base->virtual_event_count_max;
+ if (clear)
+ base->virtual_event_count_max = 0;
+ }
+
+ if (type & EVENT_BASE_COUNT_ADDED) {
+ r += base->event_count_max;
+ if (clear)
+ base->event_count_max = 0;
+ }
+
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+
+ return r;
+}
+
+/* Returns true iff we're currently watching any events. */
+static int
+event_haveevents(struct event_base *base)
+{
+ /* Caller must hold th_base_lock */
+ return (base->virtual_event_count > 0 || base->event_count > 0);
+}
+
+/* "closure" function called when processing active signal events */
+static inline void
+event_signal_closure(struct event_base *base, struct event *ev)
+{
+ short ncalls;
+ int should_break;
+
+ /* Allows deletes to work */
+ ncalls = ev->ev_ncalls;
+ if (ncalls != 0)
+ ev->ev_pncalls = &ncalls;
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ while (ncalls) {
+ ncalls--;
+ ev->ev_ncalls = ncalls;
+ if (ncalls == 0)
+ ev->ev_pncalls = NULL;
+ (*ev->ev_callback)(ev->ev_fd, ev->ev_res, ev->ev_arg);
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ should_break = base->event_break;
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+
+ if (should_break) {
+ if (ncalls != 0)
+ ev->ev_pncalls = NULL;
+ return;
+ }
+ }
+}
+
+/* Common timeouts are special timeouts that are handled as queues rather than
+ * in the minheap. This is more efficient than the minheap if we happen to
+ * know that we're going to get several thousands of timeout events all with
+ * the same timeout value.
+ *
+ * Since all our timeout handling code assumes timevals can be copied,
+ * assigned, etc, we can't use "magic pointer" to encode these common
+ * timeouts. Searching through a list to see if every timeout is common could
+ * also get inefficient. Instead, we take advantage of the fact that tv_usec
+ * is 32 bits long, but only uses 20 of those bits (since it can never be over
+ * 999999.) We use the top bits to encode 4 bites of magic number, and 8 bits
+ * of index into the event_base's aray of common timeouts.
+ */
+
+#define MICROSECONDS_MASK COMMON_TIMEOUT_MICROSECONDS_MASK
+#define COMMON_TIMEOUT_IDX_MASK 0x0ff00000
+#define COMMON_TIMEOUT_IDX_SHIFT 20
+#define COMMON_TIMEOUT_MASK 0xf0000000
+#define COMMON_TIMEOUT_MAGIC 0x50000000
+
+#define COMMON_TIMEOUT_IDX(tv) \
+ (((tv)->tv_usec & COMMON_TIMEOUT_IDX_MASK)>>COMMON_TIMEOUT_IDX_SHIFT)
+
+/** Return true iff if 'tv' is a common timeout in 'base' */
+static inline int
+is_common_timeout(const struct timeval *tv,
+ const struct event_base *base)
+{
+ int idx;
+ if ((tv->tv_usec & COMMON_TIMEOUT_MASK) != COMMON_TIMEOUT_MAGIC)
+ return 0;
+ idx = COMMON_TIMEOUT_IDX(tv);
+ return idx < base->n_common_timeouts;
+}
+
+/* True iff tv1 and tv2 have the same common-timeout index, or if neither
+ * one is a common timeout. */
+static inline int
+is_same_common_timeout(const struct timeval *tv1, const struct timeval *tv2)
+{
+ return (tv1->tv_usec & ~MICROSECONDS_MASK) ==
+ (tv2->tv_usec & ~MICROSECONDS_MASK);
+}
+
+/** Requires that 'tv' is a common timeout. Return the corresponding
+ * common_timeout_list. */
+static inline struct common_timeout_list *
+get_common_timeout_list(struct event_base *base, const struct timeval *tv)
+{
+ return base->common_timeout_queues[COMMON_TIMEOUT_IDX(tv)];
+}
+
+#if 0
+static inline int
+common_timeout_ok(const struct timeval *tv,
+ struct event_base *base)
+{
+ const struct timeval *expect =
+ &get_common_timeout_list(base, tv)->duration;
+ return tv->tv_sec == expect->tv_sec &&
+ tv->tv_usec == expect->tv_usec;
+}
+#endif
+
+/* Add the timeout for the first event in given common timeout list to the
+ * event_base's minheap. */
+static void
+common_timeout_schedule(struct common_timeout_list *ctl,
+ const struct timeval *now, struct event *head)
+{
+ struct timeval timeout = head->ev_timeout;
+ timeout.tv_usec &= MICROSECONDS_MASK;
+ event_add_nolock_(&ctl->timeout_event, &timeout, 1);
+}
+
+/* Callback: invoked when the timeout for a common timeout queue triggers.
+ * This means that (at least) the first event in that queue should be run,
+ * and the timeout should be rescheduled if there are more events. */
+static void
+common_timeout_callback(evutil_socket_t fd, short what, void *arg)
+{
+ struct timeval now;
+ struct common_timeout_list *ctl = arg;
+ struct event_base *base = ctl->base;
+ struct event *ev = NULL;
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ gettime(base, &now);
+ while (1) {
+ ev = TAILQ_FIRST(&ctl->events);
+ if (!ev || ev->ev_timeout.tv_sec > now.tv_sec ||
+ (ev->ev_timeout.tv_sec == now.tv_sec &&
+ (ev->ev_timeout.tv_usec&MICROSECONDS_MASK) > now.tv_usec))
+ break;
+ event_del_nolock_(ev, EVENT_DEL_NOBLOCK);
+ event_active_nolock_(ev, EV_TIMEOUT, 1);
+ }
+ if (ev)
+ common_timeout_schedule(ctl, &now, ev);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+}
+
+#define MAX_COMMON_TIMEOUTS 256
+
+const struct timeval *
+event_base_init_common_timeout(struct event_base *base,
+ const struct timeval *duration)
+{
+ int i;
+ struct timeval tv;
+ const struct timeval *result=NULL;
+ struct common_timeout_list *new_ctl;
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ if (duration->tv_usec > 1000000) {
+ memcpy(&tv, duration, sizeof(struct timeval));
+ if (is_common_timeout(duration, base))
+ tv.tv_usec &= MICROSECONDS_MASK;
+ tv.tv_sec += tv.tv_usec / 1000000;
+ tv.tv_usec %= 1000000;
+ duration = &tv;
+ }
+ for (i = 0; i < base->n_common_timeouts; ++i) {
+ const struct common_timeout_list *ctl =
+ base->common_timeout_queues[i];
+ if (duration->tv_sec == ctl->duration.tv_sec &&
+ duration->tv_usec ==
+ (ctl->duration.tv_usec & MICROSECONDS_MASK)) {
+ EVUTIL_ASSERT(is_common_timeout(&ctl->duration, base));
+ result = &ctl->duration;
+ goto done;
+ }
+ }
+ if (base->n_common_timeouts == MAX_COMMON_TIMEOUTS) {
+ event_warnx("%s: Too many common timeouts already in use; "
+ "we only support %d per event_base", __func__,
+ MAX_COMMON_TIMEOUTS);
+ goto done;
+ }
+ if (base->n_common_timeouts_allocated == base->n_common_timeouts) {
+ int n = base->n_common_timeouts < 16 ? 16 :
+ base->n_common_timeouts*2;
+ struct common_timeout_list **newqueues =
+ mm_realloc(base->common_timeout_queues,
+ n*sizeof(struct common_timeout_queue *));
+ if (!newqueues) {
+ event_warn("%s: realloc",__func__);
+ goto done;
+ }
+ base->n_common_timeouts_allocated = n;
+ base->common_timeout_queues = newqueues;
+ }
+ new_ctl = mm_calloc(1, sizeof(struct common_timeout_list));
+ if (!new_ctl) {
+ event_warn("%s: calloc",__func__);
+ goto done;
+ }
+ TAILQ_INIT(&new_ctl->events);
+ new_ctl->duration.tv_sec = duration->tv_sec;
+ new_ctl->duration.tv_usec =
+ duration->tv_usec | COMMON_TIMEOUT_MAGIC |
+ (base->n_common_timeouts << COMMON_TIMEOUT_IDX_SHIFT);
+ evtimer_assign(&new_ctl->timeout_event, base,
+ common_timeout_callback, new_ctl);
+ new_ctl->timeout_event.ev_flags |= EVLIST_INTERNAL;
+ event_priority_set(&new_ctl->timeout_event, 0);
+ new_ctl->base = base;
+ base->common_timeout_queues[base->n_common_timeouts++] = new_ctl;
+ result = &new_ctl->duration;
+
+done:
+ if (result)
+ EVUTIL_ASSERT(is_common_timeout(result, base));
+
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return result;
+}
+
+/* Closure function invoked when we're activating a persistent event. */
+static inline void
+event_persist_closure(struct event_base *base, struct event *ev)
+{
+ void (*evcb_callback)(evutil_socket_t, short, void *);
+
+ // Other fields of *ev that must be stored before executing
+ evutil_socket_t evcb_fd;
+ short evcb_res;
+ void *evcb_arg;
+
+ /* reschedule the persistent event if we have a timeout. */
+ if (ev->ev_io_timeout.tv_sec || ev->ev_io_timeout.tv_usec) {
+ /* If there was a timeout, we want it to run at an interval of
+ * ev_io_timeout after the last time it was _scheduled_ for,
+ * not ev_io_timeout after _now_. If it fired for another
+ * reason, though, the timeout ought to start ticking _now_. */
+ struct timeval run_at, relative_to, delay, now;
+ ev_uint32_t usec_mask = 0;
+ EVUTIL_ASSERT(is_same_common_timeout(&ev->ev_timeout,
+ &ev->ev_io_timeout));
+ gettime(base, &now);
+ if (is_common_timeout(&ev->ev_timeout, base)) {
+ delay = ev->ev_io_timeout;
+ usec_mask = delay.tv_usec & ~MICROSECONDS_MASK;
+ delay.tv_usec &= MICROSECONDS_MASK;
+ if (ev->ev_res & EV_TIMEOUT) {
+ relative_to = ev->ev_timeout;
+ relative_to.tv_usec &= MICROSECONDS_MASK;
+ } else {
+ relative_to = now;
+ }
+ } else {
+ delay = ev->ev_io_timeout;
+ if (ev->ev_res & EV_TIMEOUT) {
+ relative_to = ev->ev_timeout;
+ } else {
+ relative_to = now;
+ }
+ }
+ evutil_timeradd(&relative_to, &delay, &run_at);
+ if (evutil_timercmp(&run_at, &now, <)) {
+ /* Looks like we missed at least one invocation due to
+ * a clock jump, not running the event loop for a
+ * while, really slow callbacks, or
+ * something. Reschedule relative to now.
+ */
+ evutil_timeradd(&now, &delay, &run_at);
+ }
+ run_at.tv_usec |= usec_mask;
+ event_add_nolock_(ev, &run_at, 1);
+ }
+
+ // Save our callback before we release the lock
+ evcb_callback = ev->ev_callback;
+ evcb_fd = ev->ev_fd;
+ evcb_res = ev->ev_res;
+ evcb_arg = ev->ev_arg;
+
+ // Release the lock
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+
+ // Execute the callback
+ (evcb_callback)(evcb_fd, evcb_res, evcb_arg);
+}
+
+/*
+ Helper for event_process_active to process all the events in a single queue,
+ releasing the lock as we go. This function requires that the lock be held
+ when it's invoked. Returns -1 if we get a signal or an event_break that
+ means we should stop processing any active events now. Otherwise returns
+ the number of non-internal event_callbacks that we processed.
+*/
+static int
+event_process_active_single_queue(struct event_base *base,
+ struct evcallback_list *activeq,
+ int max_to_process, const struct timeval *endtime)
+{
+ struct event_callback *evcb;
+ int count = 0;
+
+ EVUTIL_ASSERT(activeq != NULL);
+
+ for (evcb = TAILQ_FIRST(activeq); evcb; evcb = TAILQ_FIRST(activeq)) {
+ struct event *ev=NULL;
+ if (evcb->evcb_flags & EVLIST_INIT) {
+ ev = event_callback_to_event(evcb);
+
+ if (ev->ev_events & EV_PERSIST || ev->ev_flags & EVLIST_FINALIZING)
+ event_queue_remove_active(base, evcb);
+ else
+ event_del_nolock_(ev, EVENT_DEL_NOBLOCK);
+ event_debug((
+ "event_process_active: event: %p, %s%s%scall %p",
+ ev,
+ ev->ev_res & EV_READ ? "EV_READ " : " ",
+ ev->ev_res & EV_WRITE ? "EV_WRITE " : " ",
+ ev->ev_res & EV_CLOSED ? "EV_CLOSED " : " ",
+ ev->ev_callback));
+ } else {
+ event_queue_remove_active(base, evcb);
+ event_debug(("event_process_active: event_callback %p, "
+ "closure %d, call %p",
+ evcb, evcb->evcb_closure, evcb->evcb_cb_union.evcb_callback));
+ }
+
+ if (!(evcb->evcb_flags & EVLIST_INTERNAL))
+ ++count;
+
+
+ base->current_event = evcb;
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ base->current_event_waiters = 0;
+#endif
+
+ switch (evcb->evcb_closure) {
+ case EV_CLOSURE_EVENT_SIGNAL:
+ EVUTIL_ASSERT(ev != NULL);
+ event_signal_closure(base, ev);
+ break;
+ case EV_CLOSURE_EVENT_PERSIST:
+ EVUTIL_ASSERT(ev != NULL);
+ event_persist_closure(base, ev);
+ break;
+ case EV_CLOSURE_EVENT: {
+ void (*evcb_callback)(evutil_socket_t, short, void *);
+ EVUTIL_ASSERT(ev != NULL);
+ evcb_callback = *ev->ev_callback;
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ evcb_callback(ev->ev_fd, ev->ev_res, ev->ev_arg);
+ }
+ break;
+ case EV_CLOSURE_CB_SELF: {
+ void (*evcb_selfcb)(struct event_callback *, void *) = evcb->evcb_cb_union.evcb_selfcb;
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ evcb_selfcb(evcb, evcb->evcb_arg);
+ }
+ break;
+ case EV_CLOSURE_EVENT_FINALIZE:
+ case EV_CLOSURE_EVENT_FINALIZE_FREE: {
+ void (*evcb_evfinalize)(struct event *, void *);
+ int evcb_closure = evcb->evcb_closure;
+ EVUTIL_ASSERT(ev != NULL);
+ base->current_event = NULL;
+ evcb_evfinalize = ev->ev_evcallback.evcb_cb_union.evcb_evfinalize;
+ EVUTIL_ASSERT((evcb->evcb_flags & EVLIST_FINALIZING));
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ evcb_evfinalize(ev, ev->ev_arg);
+ event_debug_note_teardown_(ev);
+ if (evcb_closure == EV_CLOSURE_EVENT_FINALIZE_FREE)
+ mm_free(ev);
+ }
+ break;
+ case EV_CLOSURE_CB_FINALIZE: {
+ void (*evcb_cbfinalize)(struct event_callback *, void *) = evcb->evcb_cb_union.evcb_cbfinalize;
+ base->current_event = NULL;
+ EVUTIL_ASSERT((evcb->evcb_flags & EVLIST_FINALIZING));
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ evcb_cbfinalize(evcb, evcb->evcb_arg);
+ }
+ break;
+ default:
+ EVUTIL_ASSERT(0);
+ }
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ base->current_event = NULL;
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ if (base->current_event_waiters) {
+ base->current_event_waiters = 0;
+ EVTHREAD_COND_BROADCAST(base->current_event_cond);
+ }
+#endif
+
+ if (base->event_break)
+ return -1;
+ if (count >= max_to_process)
+ return count;
+ if (count && endtime) {
+ struct timeval now;
+ update_time_cache(base);
+ gettime(base, &now);
+ if (evutil_timercmp(&now, endtime, >=))
+ return count;
+ }
+ if (base->event_continue)
+ break;
+ }
+ return count;
+}
+
+/*
+ * Active events are stored in priority queues. Lower priorities are always
+ * process before higher priorities. Low priority events can starve high
+ * priority ones.
+ */
+
+static int
+event_process_active(struct event_base *base)
+{
+ /* Caller must hold th_base_lock */
+ struct evcallback_list *activeq = NULL;
+ int i, c = 0;
+ const struct timeval *endtime;
+ struct timeval tv;
+ const int maxcb = base->max_dispatch_callbacks;
+ const int limit_after_prio = base->limit_callbacks_after_prio;
+ if (base->max_dispatch_time.tv_sec >= 0) {
+ update_time_cache(base);
+ gettime(base, &tv);
+ evutil_timeradd(&base->max_dispatch_time, &tv, &tv);
+ endtime = &tv;
+ } else {
+ endtime = NULL;
+ }
+
+ for (i = 0; i < base->nactivequeues; ++i) {
+ if (TAILQ_FIRST(&base->activequeues[i]) != NULL) {
+ base->event_running_priority = i;
+ activeq = &base->activequeues[i];
+ if (i < limit_after_prio)
+ c = event_process_active_single_queue(base, activeq,
+ INT_MAX, NULL);
+ else
+ c = event_process_active_single_queue(base, activeq,
+ maxcb, endtime);
+ if (c < 0) {
+ goto done;
+ } else if (c > 0)
+ break; /* Processed a real event; do not
+ * consider lower-priority events */
+ /* If we get here, all of the events we processed
+ * were internal. Continue. */
+ }
+ }
+
+done:
+ base->event_running_priority = -1;
+
+ return c;
+}
+
+/*
+ * Wait continuously for events. We exit only if no events are left.
+ */
+
+int
+event_dispatch(void)
+{
+ return (event_loop(0));
+}
+
+int
+event_base_dispatch(struct event_base *event_base)
+{
+ return (event_base_loop(event_base, 0));
+}
+
+const char *
+event_base_get_method(const struct event_base *base)
+{
+ EVUTIL_ASSERT(base);
+ return (base->evsel->name);
+}
+
+/** Callback: used to implement event_base_loopexit by telling the event_base
+ * that it's time to exit its loop. */
+static void
+event_loopexit_cb(evutil_socket_t fd, short what, void *arg)
+{
+ struct event_base *base = arg;
+ base->event_gotterm = 1;
+}
+
+int
+event_loopexit(const struct timeval *tv)
+{
+ return (event_once(-1, EV_TIMEOUT, event_loopexit_cb,
+ current_base, tv));
+}
+
+int
+event_base_loopexit(struct event_base *event_base, const struct timeval *tv)
+{
+ return (event_base_once(event_base, -1, EV_TIMEOUT, event_loopexit_cb,
+ event_base, tv));
+}
+
+int
+event_loopbreak(void)
+{
+ return (event_base_loopbreak(current_base));
+}
+
+int
+event_base_loopbreak(struct event_base *event_base)
+{
+ int r = 0;
+ if (event_base == NULL)
+ return (-1);
+
+ EVBASE_ACQUIRE_LOCK(event_base, th_base_lock);
+ event_base->event_break = 1;
+
+ if (EVBASE_NEED_NOTIFY(event_base)) {
+ r = evthread_notify_base(event_base);
+ } else {
+ r = (0);
+ }
+ EVBASE_RELEASE_LOCK(event_base, th_base_lock);
+ return r;
+}
+
+int
+event_base_loopcontinue(struct event_base *event_base)
+{
+ int r = 0;
+ if (event_base == NULL)
+ return (-1);
+
+ EVBASE_ACQUIRE_LOCK(event_base, th_base_lock);
+ event_base->event_continue = 1;
+
+ if (EVBASE_NEED_NOTIFY(event_base)) {
+ r = evthread_notify_base(event_base);
+ } else {
+ r = (0);
+ }
+ EVBASE_RELEASE_LOCK(event_base, th_base_lock);
+ return r;
+}
+
+int
+event_base_got_break(struct event_base *event_base)
+{
+ int res;
+ EVBASE_ACQUIRE_LOCK(event_base, th_base_lock);
+ res = event_base->event_break;
+ EVBASE_RELEASE_LOCK(event_base, th_base_lock);
+ return res;
+}
+
+int
+event_base_got_exit(struct event_base *event_base)
+{
+ int res;
+ EVBASE_ACQUIRE_LOCK(event_base, th_base_lock);
+ res = event_base->event_gotterm;
+ EVBASE_RELEASE_LOCK(event_base, th_base_lock);
+ return res;
+}
+
+/* not thread safe */
+
+int
+event_loop(int flags)
+{
+ return event_base_loop(current_base, flags);
+}
+
+int
+event_base_loop(struct event_base *base, int flags)
+{
+ const struct eventop *evsel = base->evsel;
+ struct timeval tv;
+ struct timeval *tv_p;
+ int res, done, retval = 0;
+
+ /* Grab the lock. We will release it inside evsel.dispatch, and again
+ * as we invoke user callbacks. */
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+
+ if (base->running_loop) {
+ event_warnx("%s: reentrant invocation. Only one event_base_loop"
+ " can run on each event_base at once.", __func__);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return -1;
+ }
+
+ base->running_loop = 1;
+
+ clear_time_cache(base);
+
+ if (base->sig.ev_signal_added && base->sig.ev_n_signals_added)
+ evsig_set_base_(base);
+
+ done = 0;
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ base->th_owner_id = EVTHREAD_GET_ID();
+#endif
+
+ base->event_gotterm = base->event_break = 0;
+
+ while (!done) {
+ base->event_continue = 0;
+ base->n_deferreds_queued = 0;
+
+ /* Terminate the loop if we have been asked to */
+ if (base->event_gotterm) {
+ break;
+ }
+
+ if (base->event_break) {
+ break;
+ }
+
+ tv_p = &tv;
+ if (!N_ACTIVE_CALLBACKS(base) && !(flags & EVLOOP_NONBLOCK)) {
+ timeout_next(base, &tv_p);
+ } else {
+ /*
+ * if we have active events, we just poll new events
+ * without waiting.
+ */
+ evutil_timerclear(&tv);
+ }
+
+ /* If we have no events, we just exit */
+ if (0==(flags&EVLOOP_NO_EXIT_ON_EMPTY) &&
+ !event_haveevents(base) && !N_ACTIVE_CALLBACKS(base)) {
+ event_debug(("%s: no events registered.", __func__));
+ retval = 1;
+ goto done;
+ }
+
+ event_queue_make_later_events_active(base);
+
+ clear_time_cache(base);
+
+ res = evsel->dispatch(base, tv_p);
+
+ if (res == -1) {
+ event_debug(("%s: dispatch returned unsuccessfully.",
+ __func__));
+ retval = -1;
+ goto done;
+ }
+
+ update_time_cache(base);
+
+ timeout_process(base);
+
+ if (N_ACTIVE_CALLBACKS(base)) {
+ int n = event_process_active(base);
+ if ((flags & EVLOOP_ONCE)
+ && N_ACTIVE_CALLBACKS(base) == 0
+ && n != 0)
+ done = 1;
+ } else if (flags & EVLOOP_NONBLOCK)
+ done = 1;
+ }
+ event_debug(("%s: asked to terminate loop.", __func__));
+
+done:
+ clear_time_cache(base);
+ base->running_loop = 0;
+
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+
+ return (retval);
+}
+
+/* One-time callback to implement event_base_once: invokes the user callback,
+ * then deletes the allocated storage */
+static void
+event_once_cb(evutil_socket_t fd, short events, void *arg)
+{
+ struct event_once *eonce = arg;
+
+ (*eonce->cb)(fd, events, eonce->arg);
+ EVBASE_ACQUIRE_LOCK(eonce->ev.ev_base, th_base_lock);
+ LIST_REMOVE(eonce, next_once);
+ EVBASE_RELEASE_LOCK(eonce->ev.ev_base, th_base_lock);
+ event_debug_unassign(&eonce->ev);
+ mm_free(eonce);
+}
+
+/* not threadsafe, event scheduled once. */
+int
+event_once(evutil_socket_t fd, short events,
+ void (*callback)(evutil_socket_t, short, void *),
+ void *arg, const struct timeval *tv)
+{
+ return event_base_once(current_base, fd, events, callback, arg, tv);
+}
+
+/* Schedules an event once */
+int
+event_base_once(struct event_base *base, evutil_socket_t fd, short events,
+ void (*callback)(evutil_socket_t, short, void *),
+ void *arg, const struct timeval *tv)
+{
+ struct event_once *eonce;
+ int res = 0;
+ int activate = 0;
+
+ /* We cannot support signals that just fire once, or persistent
+ * events. */
+ if (events & (EV_SIGNAL|EV_PERSIST))
+ return (-1);
+
+ if ((eonce = mm_calloc(1, sizeof(struct event_once))) == NULL)
+ return (-1);
+
+ eonce->cb = callback;
+ eonce->arg = arg;
+
+ if ((events & (EV_TIMEOUT|EV_SIGNAL|EV_READ|EV_WRITE|EV_CLOSED)) == EV_TIMEOUT) {
+ evtimer_assign(&eonce->ev, base, event_once_cb, eonce);
+
+ if (tv == NULL || ! evutil_timerisset(tv)) {
+ /* If the event is going to become active immediately,
+ * don't put it on the timeout queue. This is one
+ * idiom for scheduling a callback, so let's make
+ * it fast (and order-preserving). */
+ activate = 1;
+ }
+ } else if (events & (EV_READ|EV_WRITE|EV_CLOSED)) {
+ events &= EV_READ|EV_WRITE|EV_CLOSED;
+
+ event_assign(&eonce->ev, base, fd, events, event_once_cb, eonce);
+ } else {
+ /* Bad event combination */
+ mm_free(eonce);
+ return (-1);
+ }
+
+ if (res == 0) {
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ if (activate)
+ event_active_nolock_(&eonce->ev, EV_TIMEOUT, 1);
+ else
+ res = event_add_nolock_(&eonce->ev, tv, 0);
+
+ if (res != 0) {
+ mm_free(eonce);
+ return (res);
+ } else {
+ LIST_INSERT_HEAD(&base->once_events, eonce, next_once);
+ }
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ }
+
+ return (0);
+}
+
+int
+event_assign(struct event *ev, struct event_base *base, evutil_socket_t fd, short events, void (*callback)(evutil_socket_t, short, void *), void *arg)
+{
+ if (!base)
+ base = current_base;
+ if (arg == &event_self_cbarg_ptr_)
+ arg = ev;
+
+ event_debug_assert_not_added_(ev);
+
+ ev->ev_base = base;
+
+ ev->ev_callback = callback;
+ ev->ev_arg = arg;
+ ev->ev_fd = fd;
+ ev->ev_events = events;
+ ev->ev_res = 0;
+ ev->ev_flags = EVLIST_INIT;
+ ev->ev_ncalls = 0;
+ ev->ev_pncalls = NULL;
+
+ if (events & EV_SIGNAL) {
+ if ((events & (EV_READ|EV_WRITE|EV_CLOSED)) != 0) {
+ event_warnx("%s: EV_SIGNAL is not compatible with "
+ "EV_READ, EV_WRITE or EV_CLOSED", __func__);
+ return -1;
+ }
+ ev->ev_closure = EV_CLOSURE_EVENT_SIGNAL;
+ } else {
+ if (events & EV_PERSIST) {
+ evutil_timerclear(&ev->ev_io_timeout);
+ ev->ev_closure = EV_CLOSURE_EVENT_PERSIST;
+ } else {
+ ev->ev_closure = EV_CLOSURE_EVENT;
+ }
+ }
+
+ min_heap_elem_init_(ev);
+
+ if (base != NULL) {
+ /* by default, we put new events into the middle priority */
+ ev->ev_pri = base->nactivequeues / 2;
+ }
+
+ event_debug_note_setup_(ev);
+
+ return 0;
+}
+
+int
+event_base_set(struct event_base *base, struct event *ev)
+{
+ /* Only innocent events may be assigned to a different base */
+ if (ev->ev_flags != EVLIST_INIT)
+ return (-1);
+
+ event_debug_assert_is_setup_(ev);
+
+ ev->ev_base = base;
+ ev->ev_pri = base->nactivequeues/2;
+
+ return (0);
+}
+
+void
+event_set(struct event *ev, evutil_socket_t fd, short events,
+ void (*callback)(evutil_socket_t, short, void *), void *arg)
+{
+ int r;
+ r = event_assign(ev, current_base, fd, events, callback, arg);
+ EVUTIL_ASSERT(r == 0);
+}
+
+void *
+event_self_cbarg(void)
+{
+ return &event_self_cbarg_ptr_;
+}
+
+struct event *
+event_base_get_running_event(struct event_base *base)
+{
+ struct event *ev = NULL;
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ if (EVBASE_IN_THREAD(base)) {
+ struct event_callback *evcb = base->current_event;
+ if (evcb->evcb_flags & EVLIST_INIT)
+ ev = event_callback_to_event(evcb);
+ }
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return ev;
+}
+
+struct event *
+event_new(struct event_base *base, evutil_socket_t fd, short events, void (*cb)(evutil_socket_t, short, void *), void *arg)
+{
+ struct event *ev;
+ ev = mm_malloc(sizeof(struct event));
+ if (ev == NULL)
+ return (NULL);
+ if (event_assign(ev, base, fd, events, cb, arg) < 0) {
+ mm_free(ev);
+ return (NULL);
+ }
+
+ return (ev);
+}
+
+void
+event_free(struct event *ev)
+{
+ /* This is disabled, so that events which have been finalized be a
+ * valid target for event_free(). That's */
+ // event_debug_assert_is_setup_(ev);
+
+ /* make sure that this event won't be coming back to haunt us. */
+ event_del(ev);
+ event_debug_note_teardown_(ev);
+ mm_free(ev);
+
+}
+
+void
+event_debug_unassign(struct event *ev)
+{
+ event_debug_assert_not_added_(ev);
+ event_debug_note_teardown_(ev);
+
+ ev->ev_flags &= ~EVLIST_INIT;
+}
+
+#define EVENT_FINALIZE_FREE_ 0x10000
+static int
+event_finalize_nolock_(struct event_base *base, unsigned flags, struct event *ev, event_finalize_callback_fn cb)
+{
+ ev_uint8_t closure = (flags & EVENT_FINALIZE_FREE_) ?
+ EV_CLOSURE_EVENT_FINALIZE_FREE : EV_CLOSURE_EVENT_FINALIZE;
+
+ event_del_nolock_(ev, EVENT_DEL_NOBLOCK);
+ ev->ev_closure = closure;
+ ev->ev_evcallback.evcb_cb_union.evcb_evfinalize = cb;
+ event_active_nolock_(ev, EV_FINALIZE, 1);
+ ev->ev_flags |= EVLIST_FINALIZING;
+ return 0;
+}
+
+static int
+event_finalize_impl_(unsigned flags, struct event *ev, event_finalize_callback_fn cb)
+{
+ int r;
+ struct event_base *base = ev->ev_base;
+ if (EVUTIL_FAILURE_CHECK(!base)) {
+ event_warnx("%s: event has no event_base set.", __func__);
+ return -1;
+ }
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ r = event_finalize_nolock_(base, flags, ev, cb);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return r;
+}
+
+int
+event_finalize(unsigned flags, struct event *ev, event_finalize_callback_fn cb)
+{
+ return event_finalize_impl_(flags, ev, cb);
+}
+
+int
+event_free_finalize(unsigned flags, struct event *ev, event_finalize_callback_fn cb)
+{
+ return event_finalize_impl_(flags|EVENT_FINALIZE_FREE_, ev, cb);
+}
+
+void
+event_callback_finalize_nolock_(struct event_base *base, unsigned flags, struct event_callback *evcb, void (*cb)(struct event_callback *, void *))
+{
+ struct event *ev = NULL;
+ if (evcb->evcb_flags & EVLIST_INIT) {
+ ev = event_callback_to_event(evcb);
+ event_del_nolock_(ev, EVENT_DEL_NOBLOCK);
+ } else {
+ event_callback_cancel_nolock_(base, evcb, 0); /*XXX can this fail?*/
+ }
+
+ evcb->evcb_closure = EV_CLOSURE_CB_FINALIZE;
+ evcb->evcb_cb_union.evcb_cbfinalize = cb;
+ event_callback_activate_nolock_(base, evcb); /* XXX can this really fail?*/
+ evcb->evcb_flags |= EVLIST_FINALIZING;
+}
+
+void
+event_callback_finalize_(struct event_base *base, unsigned flags, struct event_callback *evcb, void (*cb)(struct event_callback *, void *))
+{
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ event_callback_finalize_nolock_(base, flags, evcb, cb);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+}
+
+/** Internal: Finalize all of the n_cbs callbacks in evcbs. The provided
+ * callback will be invoked on *one of them*, after they have *all* been
+ * finalized. */
+int
+event_callback_finalize_many_(struct event_base *base, int n_cbs, struct event_callback **evcbs, void (*cb)(struct event_callback *, void *))
+{
+ int n_pending = 0, i;
+
+ if (base == NULL)
+ base = current_base;
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+
+ event_debug(("%s: %d events finalizing", __func__, n_cbs));
+
+ /* At most one can be currently executing; the rest we just
+ * cancel... But we always make sure that the finalize callback
+ * runs. */
+ for (i = 0; i < n_cbs; ++i) {
+ struct event_callback *evcb = evcbs[i];
+ if (evcb == base->current_event) {
+ event_callback_finalize_nolock_(base, 0, evcb, cb);
+ ++n_pending;
+ } else {
+ event_callback_cancel_nolock_(base, evcb, 0);
+ }
+ }
+
+ if (n_pending == 0) {
+ /* Just do the first one. */
+ event_callback_finalize_nolock_(base, 0, evcbs[0], cb);
+ }
+
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return 0;
+}
+
+/*
+ * Set's the priority of an event - if an event is already scheduled
+ * changing the priority is going to fail.
+ */
+
+int
+event_priority_set(struct event *ev, int pri)
+{
+ event_debug_assert_is_setup_(ev);
+
+ if (ev->ev_flags & EVLIST_ACTIVE)
+ return (-1);
+ if (pri < 0 || pri >= ev->ev_base->nactivequeues)
+ return (-1);
+
+ ev->ev_pri = pri;
+
+ return (0);
+}
+
+/*
+ * Checks if a specific event is pending or scheduled.
+ */
+
+int
+event_pending(const struct event *ev, short event, struct timeval *tv)
+{
+ int flags = 0;
+
+ if (EVUTIL_FAILURE_CHECK(ev->ev_base == NULL)) {
+ event_warnx("%s: event has no event_base set.", __func__);
+ return 0;
+ }
+
+ EVBASE_ACQUIRE_LOCK(ev->ev_base, th_base_lock);
+ event_debug_assert_is_setup_(ev);
+
+ if (ev->ev_flags & EVLIST_INSERTED)
+ flags |= (ev->ev_events & (EV_READ|EV_WRITE|EV_CLOSED|EV_SIGNAL));
+ if (ev->ev_flags & (EVLIST_ACTIVE|EVLIST_ACTIVE_LATER))
+ flags |= ev->ev_res;
+ if (ev->ev_flags & EVLIST_TIMEOUT)
+ flags |= EV_TIMEOUT;
+
+ event &= (EV_TIMEOUT|EV_READ|EV_WRITE|EV_CLOSED|EV_SIGNAL);
+
+ /* See if there is a timeout that we should report */
+ if (tv != NULL && (flags & event & EV_TIMEOUT)) {
+ struct timeval tmp = ev->ev_timeout;
+ tmp.tv_usec &= MICROSECONDS_MASK;
+ /* correctly remamp to real time */
+ evutil_timeradd(&ev->ev_base->tv_clock_diff, &tmp, tv);
+ }
+
+ EVBASE_RELEASE_LOCK(ev->ev_base, th_base_lock);
+
+ return (flags & event);
+}
+
+int
+event_initialized(const struct event *ev)
+{
+ if (!(ev->ev_flags & EVLIST_INIT))
+ return 0;
+
+ return 1;
+}
+
+void
+event_get_assignment(const struct event *event, struct event_base **base_out, evutil_socket_t *fd_out, short *events_out, event_callback_fn *callback_out, void **arg_out)
+{
+ event_debug_assert_is_setup_(event);
+
+ if (base_out)
+ *base_out = event->ev_base;
+ if (fd_out)
+ *fd_out = event->ev_fd;
+ if (events_out)
+ *events_out = event->ev_events;
+ if (callback_out)
+ *callback_out = event->ev_callback;
+ if (arg_out)
+ *arg_out = event->ev_arg;
+}
+
+size_t
+event_get_struct_event_size(void)
+{
+ return sizeof(struct event);
+}
+
+evutil_socket_t
+event_get_fd(const struct event *ev)
+{
+ event_debug_assert_is_setup_(ev);
+ return ev->ev_fd;
+}
+
+struct event_base *
+event_get_base(const struct event *ev)
+{
+ event_debug_assert_is_setup_(ev);
+ return ev->ev_base;
+}
+
+short
+event_get_events(const struct event *ev)
+{
+ event_debug_assert_is_setup_(ev);
+ return ev->ev_events;
+}
+
+event_callback_fn
+event_get_callback(const struct event *ev)
+{
+ event_debug_assert_is_setup_(ev);
+ return ev->ev_callback;
+}
+
+void *
+event_get_callback_arg(const struct event *ev)
+{
+ event_debug_assert_is_setup_(ev);
+ return ev->ev_arg;
+}
+
+int
+event_get_priority(const struct event *ev)
+{
+ event_debug_assert_is_setup_(ev);
+ return ev->ev_pri;
+}
+
+int
+event_add(struct event *ev, const struct timeval *tv)
+{
+ int res;
+
+ if (EVUTIL_FAILURE_CHECK(!ev->ev_base)) {
+ event_warnx("%s: event has no event_base set.", __func__);
+ return -1;
+ }
+
+ EVBASE_ACQUIRE_LOCK(ev->ev_base, th_base_lock);
+
+ res = event_add_nolock_(ev, tv, 0);
+
+ EVBASE_RELEASE_LOCK(ev->ev_base, th_base_lock);
+
+ return (res);
+}
+
+/* Helper callback: wake an event_base from another thread. This version
+ * works by writing a byte to one end of a socketpair, so that the event_base
+ * listening on the other end will wake up as the corresponding event
+ * triggers */
+static int
+evthread_notify_base_default(struct event_base *base)
+{
+ char buf[1];
+ int r;
+ buf[0] = (char) 0;
+#ifdef _WIN32
+ r = send(base->th_notify_fd[1], buf, 1, 0);
+#else
+ r = write(base->th_notify_fd[1], buf, 1);
+#endif
+ return (r < 0 && ! EVUTIL_ERR_IS_EAGAIN(errno)) ? -1 : 0;
+}
+
+#ifdef EVENT__HAVE_EVENTFD
+/* Helper callback: wake an event_base from another thread. This version
+ * assumes that you have a working eventfd() implementation. */
+static int
+evthread_notify_base_eventfd(struct event_base *base)
+{
+ ev_uint64_t msg = 1;
+ int r;
+ do {
+ r = write(base->th_notify_fd[0], (void*) &msg, sizeof(msg));
+ } while (r < 0 && errno == EAGAIN);
+
+ return (r < 0) ? -1 : 0;
+}
+#endif
+
+
+/** Tell the thread currently running the event_loop for base (if any) that it
+ * needs to stop waiting in its dispatch function (if it is) and process all
+ * active callbacks. */
+static int
+evthread_notify_base(struct event_base *base)
+{
+ EVENT_BASE_ASSERT_LOCKED(base);
+ if (!base->th_notify_fn)
+ return -1;
+ if (base->is_notify_pending)
+ return 0;
+ base->is_notify_pending = 1;
+ return base->th_notify_fn(base);
+}
+
+/* Implementation function to remove a timeout on a currently pending event.
+ */
+int
+event_remove_timer_nolock_(struct event *ev)
+{
+ struct event_base *base = ev->ev_base;
+
+ EVENT_BASE_ASSERT_LOCKED(base);
+ event_debug_assert_is_setup_(ev);
+
+ event_debug(("event_remove_timer_nolock: event: %p", ev));
+
+ /* If it's not pending on a timeout, we don't need to do anything. */
+ if (ev->ev_flags & EVLIST_TIMEOUT) {
+ event_queue_remove_timeout(base, ev);
+ evutil_timerclear(&ev->ev_.ev_io.ev_timeout);
+ }
+
+ return (0);
+}
+
+int
+event_remove_timer(struct event *ev)
+{
+ int res;
+
+ if (EVUTIL_FAILURE_CHECK(!ev->ev_base)) {
+ event_warnx("%s: event has no event_base set.", __func__);
+ return -1;
+ }
+
+ EVBASE_ACQUIRE_LOCK(ev->ev_base, th_base_lock);
+
+ res = event_remove_timer_nolock_(ev);
+
+ EVBASE_RELEASE_LOCK(ev->ev_base, th_base_lock);
+
+ return (res);
+}
+
+/* Implementation function to add an event. Works just like event_add,
+ * except: 1) it requires that we have the lock. 2) if tv_is_absolute is set,
+ * we treat tv as an absolute time, not as an interval to add to the current
+ * time */
+int
+event_add_nolock_(struct event *ev, const struct timeval *tv,
+ int tv_is_absolute)
+{
+ struct event_base *base = ev->ev_base;
+ int res = 0;
+ int notify = 0;
+
+ EVENT_BASE_ASSERT_LOCKED(base);
+ event_debug_assert_is_setup_(ev);
+
+ event_debug((
+ "event_add: event: %p (fd "EV_SOCK_FMT"), %s%s%s%scall %p",
+ ev,
+ EV_SOCK_ARG(ev->ev_fd),
+ ev->ev_events & EV_READ ? "EV_READ " : " ",
+ ev->ev_events & EV_WRITE ? "EV_WRITE " : " ",
+ ev->ev_events & EV_CLOSED ? "EV_CLOSED " : " ",
+ tv ? "EV_TIMEOUT " : " ",
+ ev->ev_callback));
+
+ EVUTIL_ASSERT(!(ev->ev_flags & ~EVLIST_ALL));
+
+ if (ev->ev_flags & EVLIST_FINALIZING) {
+ /* XXXX debug */
+ return (-1);
+ }
+
+ /*
+ * prepare for timeout insertion further below, if we get a
+ * failure on any step, we should not change any state.
+ */
+ if (tv != NULL && !(ev->ev_flags & EVLIST_TIMEOUT)) {
+ if (min_heap_reserve_(&base->timeheap,
+ 1 + min_heap_size_(&base->timeheap)) == -1)
+ return (-1); /* ENOMEM == errno */
+ }
+
+ /* If the main thread is currently executing a signal event's
+ * callback, and we are not the main thread, then we want to wait
+ * until the callback is done before we mess with the event, or else
+ * we can race on ev_ncalls and ev_pncalls below. */
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ if (base->current_event == event_to_event_callback(ev) &&
+ (ev->ev_events & EV_SIGNAL)
+ && !EVBASE_IN_THREAD(base)) {
+ ++base->current_event_waiters;
+ EVTHREAD_COND_WAIT(base->current_event_cond, base->th_base_lock);
+ }
+#endif
+
+ if ((ev->ev_events & (EV_READ|EV_WRITE|EV_CLOSED|EV_SIGNAL)) &&
+ !(ev->ev_flags & (EVLIST_INSERTED|EVLIST_ACTIVE|EVLIST_ACTIVE_LATER))) {
+ if (ev->ev_events & (EV_READ|EV_WRITE|EV_CLOSED))
+ res = evmap_io_add_(base, ev->ev_fd, ev);
+ else if (ev->ev_events & EV_SIGNAL)
+ res = evmap_signal_add_(base, (int)ev->ev_fd, ev);
+ if (res != -1)
+ event_queue_insert_inserted(base, ev);
+ if (res == 1) {
+ /* evmap says we need to notify the main thread. */
+ notify = 1;
+ res = 0;
+ }
+ }
+
+ /*
+ * we should change the timeout state only if the previous event
+ * addition succeeded.
+ */
+ if (res != -1 && tv != NULL) {
+ struct timeval now;
+ int common_timeout;
+#ifdef USE_REINSERT_TIMEOUT
+ int was_common;
+ int old_timeout_idx;
+#endif
+
+ /*
+ * for persistent timeout events, we remember the
+ * timeout value and re-add the event.
+ *
+ * If tv_is_absolute, this was already set.
+ */
+ if (ev->ev_closure == EV_CLOSURE_EVENT_PERSIST && !tv_is_absolute)
+ ev->ev_io_timeout = *tv;
+
+#ifndef USE_REINSERT_TIMEOUT
+ if (ev->ev_flags & EVLIST_TIMEOUT) {
+ event_queue_remove_timeout(base, ev);
+ }
+#endif
+
+ /* Check if it is active due to a timeout. Rescheduling
+ * this timeout before the callback can be executed
+ * removes it from the active list. */
+ if ((ev->ev_flags & EVLIST_ACTIVE) &&
+ (ev->ev_res & EV_TIMEOUT)) {
+ if (ev->ev_events & EV_SIGNAL) {
+ /* See if we are just active executing
+ * this event in a loop
+ */
+ if (ev->ev_ncalls && ev->ev_pncalls) {
+ /* Abort loop */
+ *ev->ev_pncalls = 0;
+ }
+ }
+
+ event_queue_remove_active(base, event_to_event_callback(ev));
+ }
+
+ gettime(base, &now);
+
+ common_timeout = is_common_timeout(tv, base);
+#ifdef USE_REINSERT_TIMEOUT
+ was_common = is_common_timeout(&ev->ev_timeout, base);
+ old_timeout_idx = COMMON_TIMEOUT_IDX(&ev->ev_timeout);
+#endif
+
+ if (tv_is_absolute) {
+ ev->ev_timeout = *tv;
+ } else if (common_timeout) {
+ struct timeval tmp = *tv;
+ tmp.tv_usec &= MICROSECONDS_MASK;
+ evutil_timeradd(&now, &tmp, &ev->ev_timeout);
+ ev->ev_timeout.tv_usec |=
+ (tv->tv_usec & ~MICROSECONDS_MASK);
+ } else {
+ evutil_timeradd(&now, tv, &ev->ev_timeout);
+ }
+
+ event_debug((
+ "event_add: event %p, timeout in %d seconds %d useconds, call %p",
+ ev, (int)tv->tv_sec, (int)tv->tv_usec, ev->ev_callback));
+
+#ifdef USE_REINSERT_TIMEOUT
+ event_queue_reinsert_timeout(base, ev, was_common, common_timeout, old_timeout_idx);
+#else
+ event_queue_insert_timeout(base, ev);
+#endif
+
+ if (common_timeout) {
+ struct common_timeout_list *ctl =
+ get_common_timeout_list(base, &ev->ev_timeout);
+ if (ev == TAILQ_FIRST(&ctl->events)) {
+ common_timeout_schedule(ctl, &now, ev);
+ }
+ } else {
+ struct event* top = NULL;
+ /* See if the earliest timeout is now earlier than it
+ * was before: if so, we will need to tell the main
+ * thread to wake up earlier than it would otherwise.
+ * We double check the timeout of the top element to
+ * handle time distortions due to system suspension.
+ */
+ if (min_heap_elt_is_top_(ev))
+ notify = 1;
+ else if ((top = min_heap_top_(&base->timeheap)) != NULL &&
+ evutil_timercmp(&top->ev_timeout, &now, <))
+ notify = 1;
+ }
+ }
+
+ /* if we are not in the right thread, we need to wake up the loop */
+ if (res != -1 && notify && EVBASE_NEED_NOTIFY(base))
+ evthread_notify_base(base);
+
+ event_debug_note_add_(ev);
+
+ return (res);
+}
+
+static int
+event_del_(struct event *ev, int blocking)
+{
+ int res;
+
+ if (EVUTIL_FAILURE_CHECK(!ev->ev_base)) {
+ event_warnx("%s: event has no event_base set.", __func__);
+ return -1;
+ }
+
+ EVBASE_ACQUIRE_LOCK(ev->ev_base, th_base_lock);
+
+ res = event_del_nolock_(ev, blocking);
+
+ EVBASE_RELEASE_LOCK(ev->ev_base, th_base_lock);
+
+ return (res);
+}
+
+int
+event_del(struct event *ev)
+{
+ return event_del_(ev, EVENT_DEL_AUTOBLOCK);
+}
+
+int
+event_del_block(struct event *ev)
+{
+ return event_del_(ev, EVENT_DEL_BLOCK);
+}
+
+int
+event_del_noblock(struct event *ev)
+{
+ return event_del_(ev, EVENT_DEL_NOBLOCK);
+}
+
+/** Helper for event_del: always called with th_base_lock held.
+ *
+ * "blocking" must be one of the EVENT_DEL_{BLOCK, NOBLOCK, AUTOBLOCK,
+ * EVEN_IF_FINALIZING} values. See those for more information.
+ */
+int
+event_del_nolock_(struct event *ev, int blocking)
+{
+ struct event_base *base;
+ int res = 0, notify = 0;
+
+ event_debug(("event_del: %p (fd "EV_SOCK_FMT"), callback %p",
+ ev, EV_SOCK_ARG(ev->ev_fd), ev->ev_callback));
+
+ /* An event without a base has not been added */
+ if (ev->ev_base == NULL)
+ return (-1);
+
+ EVENT_BASE_ASSERT_LOCKED(ev->ev_base);
+
+ if (blocking != EVENT_DEL_EVEN_IF_FINALIZING) {
+ if (ev->ev_flags & EVLIST_FINALIZING) {
+ /* XXXX Debug */
+ return 0;
+ }
+ }
+
+ /* If the main thread is currently executing this event's callback,
+ * and we are not the main thread, then we want to wait until the
+ * callback is done before we start removing the event. That way,
+ * when this function returns, it will be safe to free the
+ * user-supplied argument. */
+ base = ev->ev_base;
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ if (blocking != EVENT_DEL_NOBLOCK &&
+ base->current_event == event_to_event_callback(ev) &&
+ !EVBASE_IN_THREAD(base) &&
+ (blocking == EVENT_DEL_BLOCK || !(ev->ev_events & EV_FINALIZE))) {
+ ++base->current_event_waiters;
+ EVTHREAD_COND_WAIT(base->current_event_cond, base->th_base_lock);
+ }
+#endif
+
+ EVUTIL_ASSERT(!(ev->ev_flags & ~EVLIST_ALL));
+
+ /* See if we are just active executing this event in a loop */
+ if (ev->ev_events & EV_SIGNAL) {
+ if (ev->ev_ncalls && ev->ev_pncalls) {
+ /* Abort loop */
+ *ev->ev_pncalls = 0;
+ }
+ }
+
+ if (ev->ev_flags & EVLIST_TIMEOUT) {
+ /* NOTE: We never need to notify the main thread because of a
+ * deleted timeout event: all that could happen if we don't is
+ * that the dispatch loop might wake up too early. But the
+ * point of notifying the main thread _is_ to wake up the
+ * dispatch loop early anyway, so we wouldn't gain anything by
+ * doing it.
+ */
+ event_queue_remove_timeout(base, ev);
+ }
+
+ if (ev->ev_flags & EVLIST_ACTIVE)
+ event_queue_remove_active(base, event_to_event_callback(ev));
+ else if (ev->ev_flags & EVLIST_ACTIVE_LATER)
+ event_queue_remove_active_later(base, event_to_event_callback(ev));
+
+ if (ev->ev_flags & EVLIST_INSERTED) {
+ event_queue_remove_inserted(base, ev);
+ if (ev->ev_events & (EV_READ|EV_WRITE|EV_CLOSED))
+ res = evmap_io_del_(base, ev->ev_fd, ev);
+ else
+ res = evmap_signal_del_(base, (int)ev->ev_fd, ev);
+ if (res == 1) {
+ /* evmap says we need to notify the main thread. */
+ notify = 1;
+ res = 0;
+ }
+ }
+
+ /* if we are not in the right thread, we need to wake up the loop */
+ if (res != -1 && notify && EVBASE_NEED_NOTIFY(base))
+ evthread_notify_base(base);
+
+ event_debug_note_del_(ev);
+
+ return (res);
+}
+
+void
+event_active(struct event *ev, int res, short ncalls)
+{
+ if (EVUTIL_FAILURE_CHECK(!ev->ev_base)) {
+ event_warnx("%s: event has no event_base set.", __func__);
+ return;
+ }
+
+ EVBASE_ACQUIRE_LOCK(ev->ev_base, th_base_lock);
+
+ event_debug_assert_is_setup_(ev);
+
+ event_active_nolock_(ev, res, ncalls);
+
+ EVBASE_RELEASE_LOCK(ev->ev_base, th_base_lock);
+}
+
+
+void
+event_active_nolock_(struct event *ev, int res, short ncalls)
+{
+ struct event_base *base;
+
+ event_debug(("event_active: %p (fd "EV_SOCK_FMT"), res %d, callback %p",
+ ev, EV_SOCK_ARG(ev->ev_fd), (int)res, ev->ev_callback));
+
+ base = ev->ev_base;
+ EVENT_BASE_ASSERT_LOCKED(base);
+
+ if (ev->ev_flags & EVLIST_FINALIZING) {
+ /* XXXX debug */
+ return;
+ }
+
+ switch ((ev->ev_flags & (EVLIST_ACTIVE|EVLIST_ACTIVE_LATER))) {
+ default:
+ case EVLIST_ACTIVE|EVLIST_ACTIVE_LATER:
+ EVUTIL_ASSERT(0);
+ break;
+ case EVLIST_ACTIVE:
+ /* We get different kinds of events, add them together */
+ ev->ev_res |= res;
+ return;
+ case EVLIST_ACTIVE_LATER:
+ ev->ev_res |= res;
+ break;
+ case 0:
+ ev->ev_res = res;
+ break;
+ }
+
+ if (ev->ev_pri < base->event_running_priority)
+ base->event_continue = 1;
+
+ if (ev->ev_events & EV_SIGNAL) {
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ if (base->current_event == event_to_event_callback(ev) &&
+ !EVBASE_IN_THREAD(base)) {
+ ++base->current_event_waiters;
+ EVTHREAD_COND_WAIT(base->current_event_cond, base->th_base_lock);
+ }
+#endif
+ ev->ev_ncalls = ncalls;
+ ev->ev_pncalls = NULL;
+ }
+
+ event_callback_activate_nolock_(base, event_to_event_callback(ev));
+}
+
+void
+event_active_later_(struct event *ev, int res)
+{
+ EVBASE_ACQUIRE_LOCK(ev->ev_base, th_base_lock);
+ event_active_later_nolock_(ev, res);
+ EVBASE_RELEASE_LOCK(ev->ev_base, th_base_lock);
+}
+
+void
+event_active_later_nolock_(struct event *ev, int res)
+{
+ struct event_base *base = ev->ev_base;
+ EVENT_BASE_ASSERT_LOCKED(base);
+
+ if (ev->ev_flags & (EVLIST_ACTIVE|EVLIST_ACTIVE_LATER)) {
+ /* We get different kinds of events, add them together */
+ ev->ev_res |= res;
+ return;
+ }
+
+ ev->ev_res = res;
+
+ event_callback_activate_later_nolock_(base, event_to_event_callback(ev));
+}
+
+int
+event_callback_activate_(struct event_base *base,
+ struct event_callback *evcb)
+{
+ int r;
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ r = event_callback_activate_nolock_(base, evcb);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return r;
+}
+
+int
+event_callback_activate_nolock_(struct event_base *base,
+ struct event_callback *evcb)
+{
+ int r = 1;
+
+ if (evcb->evcb_flags & EVLIST_FINALIZING)
+ return 0;
+
+ switch (evcb->evcb_flags & (EVLIST_ACTIVE|EVLIST_ACTIVE_LATER)) {
+ default:
+ EVUTIL_ASSERT(0);
+ case EVLIST_ACTIVE_LATER:
+ event_queue_remove_active_later(base, evcb);
+ r = 0;
+ break;
+ case EVLIST_ACTIVE:
+ return 0;
+ case 0:
+ break;
+ }
+
+ event_queue_insert_active(base, evcb);
+
+ if (EVBASE_NEED_NOTIFY(base))
+ evthread_notify_base(base);
+
+ return r;
+}
+
+int
+event_callback_activate_later_nolock_(struct event_base *base,
+ struct event_callback *evcb)
+{
+ if (evcb->evcb_flags & (EVLIST_ACTIVE|EVLIST_ACTIVE_LATER))
+ return 0;
+
+ event_queue_insert_active_later(base, evcb);
+ if (EVBASE_NEED_NOTIFY(base))
+ evthread_notify_base(base);
+ return 1;
+}
+
+void
+event_callback_init_(struct event_base *base,
+ struct event_callback *cb)
+{
+ memset(cb, 0, sizeof(*cb));
+ cb->evcb_pri = base->nactivequeues - 1;
+}
+
+int
+event_callback_cancel_(struct event_base *base,
+ struct event_callback *evcb)
+{
+ int r;
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ r = event_callback_cancel_nolock_(base, evcb, 0);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return r;
+}
+
+int
+event_callback_cancel_nolock_(struct event_base *base,
+ struct event_callback *evcb, int even_if_finalizing)
+{
+ if ((evcb->evcb_flags & EVLIST_FINALIZING) && !even_if_finalizing)
+ return 0;
+
+ if (evcb->evcb_flags & EVLIST_INIT)
+ return event_del_nolock_(event_callback_to_event(evcb),
+ even_if_finalizing ? EVENT_DEL_EVEN_IF_FINALIZING : EVENT_DEL_AUTOBLOCK);
+
+ switch ((evcb->evcb_flags & (EVLIST_ACTIVE|EVLIST_ACTIVE_LATER))) {
+ default:
+ case EVLIST_ACTIVE|EVLIST_ACTIVE_LATER:
+ EVUTIL_ASSERT(0);
+ break;
+ case EVLIST_ACTIVE:
+ /* We get different kinds of events, add them together */
+ event_queue_remove_active(base, evcb);
+ return 0;
+ case EVLIST_ACTIVE_LATER:
+ event_queue_remove_active_later(base, evcb);
+ break;
+ case 0:
+ break;
+ }
+
+ return 0;
+}
+
+void
+event_deferred_cb_init_(struct event_callback *cb, ev_uint8_t priority, deferred_cb_fn fn, void *arg)
+{
+ memset(cb, 0, sizeof(*cb));
+ cb->evcb_cb_union.evcb_selfcb = fn;
+ cb->evcb_arg = arg;
+ cb->evcb_pri = priority;
+ cb->evcb_closure = EV_CLOSURE_CB_SELF;
+}
+
+void
+event_deferred_cb_set_priority_(struct event_callback *cb, ev_uint8_t priority)
+{
+ cb->evcb_pri = priority;
+}
+
+void
+event_deferred_cb_cancel_(struct event_base *base, struct event_callback *cb)
+{
+ if (!base)
+ base = current_base;
+ event_callback_cancel_(base, cb);
+}
+
+#define MAX_DEFERREDS_QUEUED 32
+int
+event_deferred_cb_schedule_(struct event_base *base, struct event_callback *cb)
+{
+ int r = 1;
+ if (!base)
+ base = current_base;
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ if (base->n_deferreds_queued > MAX_DEFERREDS_QUEUED) {
+ r = event_callback_activate_later_nolock_(base, cb);
+ } else {
+ r = event_callback_activate_nolock_(base, cb);
+ if (r) {
+ ++base->n_deferreds_queued;
+ }
+ }
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return r;
+}
+
+static int
+timeout_next(struct event_base *base, struct timeval **tv_p)
+{
+ /* Caller must hold th_base_lock */
+ struct timeval now;
+ struct event *ev;
+ struct timeval *tv = *tv_p;
+ int res = 0;
+
+ ev = min_heap_top_(&base->timeheap);
+
+ if (ev == NULL) {
+ /* if no time-based events are active wait for I/O */
+ *tv_p = NULL;
+ goto out;
+ }
+
+ if (gettime(base, &now) == -1) {
+ res = -1;
+ goto out;
+ }
+
+ if (evutil_timercmp(&ev->ev_timeout, &now, <=)) {
+ evutil_timerclear(tv);
+ goto out;
+ }
+
+ evutil_timersub(&ev->ev_timeout, &now, tv);
+
+ EVUTIL_ASSERT(tv->tv_sec >= 0);
+ EVUTIL_ASSERT(tv->tv_usec >= 0);
+ event_debug(("timeout_next: event: %p, in %d seconds, %d useconds", ev, (int)tv->tv_sec, (int)tv->tv_usec));
+
+out:
+ return (res);
+}
+
+/* Activate every event whose timeout has elapsed. */
+static void
+timeout_process(struct event_base *base)
+{
+ /* Caller must hold lock. */
+ struct timeval now;
+ struct event *ev;
+
+ if (min_heap_empty_(&base->timeheap)) {
+ return;
+ }
+
+ gettime(base, &now);
+
+ while ((ev = min_heap_top_(&base->timeheap))) {
+ if (evutil_timercmp(&ev->ev_timeout, &now, >))
+ break;
+
+ /* delete this event from the I/O queues */
+ event_del_nolock_(ev, EVENT_DEL_NOBLOCK);
+
+ event_debug(("timeout_process: event: %p, call %p",
+ ev, ev->ev_callback));
+ event_active_nolock_(ev, EV_TIMEOUT, 1);
+ }
+}
+
+#if (EVLIST_INTERNAL >> 4) != 1
+#error "Mismatch for value of EVLIST_INTERNAL"
+#endif
+
+#ifndef MAX
+#define MAX(a,b) (((a)>(b))?(a):(b))
+#endif
+
+#define MAX_EVENT_COUNT(var, v) var = MAX(var, v)
+
+/* These are a fancy way to spell
+ if (flags & EVLIST_INTERNAL)
+ base->event_count--/++;
+*/
+#define DECR_EVENT_COUNT(base,flags) \
+ ((base)->event_count -= (~((flags) >> 4) & 1))
+#define INCR_EVENT_COUNT(base,flags) do { \
+ ((base)->event_count += (~((flags) >> 4) & 1)); \
+ MAX_EVENT_COUNT((base)->event_count_max, (base)->event_count); \
+} while (0)
+
+static void
+event_queue_remove_inserted(struct event_base *base, struct event *ev)
+{
+ EVENT_BASE_ASSERT_LOCKED(base);
+ if (EVUTIL_FAILURE_CHECK(!(ev->ev_flags & EVLIST_INSERTED))) {
+ event_errx(1, "%s: %p(fd "EV_SOCK_FMT") not on queue %x", __func__,
+ ev, EV_SOCK_ARG(ev->ev_fd), EVLIST_INSERTED);
+ return;
+ }
+ DECR_EVENT_COUNT(base, ev->ev_flags);
+ ev->ev_flags &= ~EVLIST_INSERTED;
+}
+static void
+event_queue_remove_active(struct event_base *base, struct event_callback *evcb)
+{
+ EVENT_BASE_ASSERT_LOCKED(base);
+ if (EVUTIL_FAILURE_CHECK(!(evcb->evcb_flags & EVLIST_ACTIVE))) {
+ event_errx(1, "%s: %p not on queue %x", __func__,
+ evcb, EVLIST_ACTIVE);
+ return;
+ }
+ DECR_EVENT_COUNT(base, evcb->evcb_flags);
+ evcb->evcb_flags &= ~EVLIST_ACTIVE;
+ base->event_count_active--;
+
+ TAILQ_REMOVE(&base->activequeues[evcb->evcb_pri],
+ evcb, evcb_active_next);
+}
+static void
+event_queue_remove_active_later(struct event_base *base, struct event_callback *evcb)
+{
+ EVENT_BASE_ASSERT_LOCKED(base);
+ if (EVUTIL_FAILURE_CHECK(!(evcb->evcb_flags & EVLIST_ACTIVE_LATER))) {
+ event_errx(1, "%s: %p not on queue %x", __func__,
+ evcb, EVLIST_ACTIVE_LATER);
+ return;
+ }
+ DECR_EVENT_COUNT(base, evcb->evcb_flags);
+ evcb->evcb_flags &= ~EVLIST_ACTIVE_LATER;
+ base->event_count_active--;
+
+ TAILQ_REMOVE(&base->active_later_queue, evcb, evcb_active_next);
+}
+static void
+event_queue_remove_timeout(struct event_base *base, struct event *ev)
+{
+ EVENT_BASE_ASSERT_LOCKED(base);
+ if (EVUTIL_FAILURE_CHECK(!(ev->ev_flags & EVLIST_TIMEOUT))) {
+ event_errx(1, "%s: %p(fd "EV_SOCK_FMT") not on queue %x", __func__,
+ ev, EV_SOCK_ARG(ev->ev_fd), EVLIST_TIMEOUT);
+ return;
+ }
+ DECR_EVENT_COUNT(base, ev->ev_flags);
+ ev->ev_flags &= ~EVLIST_TIMEOUT;
+
+ if (is_common_timeout(&ev->ev_timeout, base)) {
+ struct common_timeout_list *ctl =
+ get_common_timeout_list(base, &ev->ev_timeout);
+ TAILQ_REMOVE(&ctl->events, ev,
+ ev_timeout_pos.ev_next_with_common_timeout);
+ } else {
+ min_heap_erase_(&base->timeheap, ev);
+ }
+}
+
+#ifdef USE_REINSERT_TIMEOUT
+/* Remove and reinsert 'ev' into the timeout queue. */
+static void
+event_queue_reinsert_timeout(struct event_base *base, struct event *ev,
+ int was_common, int is_common, int old_timeout_idx)
+{
+ struct common_timeout_list *ctl;
+ if (!(ev->ev_flags & EVLIST_TIMEOUT)) {
+ event_queue_insert_timeout(base, ev);
+ return;
+ }
+
+ switch ((was_common<<1) | is_common) {
+ case 3: /* Changing from one common timeout to another */
+ ctl = base->common_timeout_queues[old_timeout_idx];
+ TAILQ_REMOVE(&ctl->events, ev,
+ ev_timeout_pos.ev_next_with_common_timeout);
+ ctl = get_common_timeout_list(base, &ev->ev_timeout);
+ insert_common_timeout_inorder(ctl, ev);
+ break;
+ case 2: /* Was common; is no longer common */
+ ctl = base->common_timeout_queues[old_timeout_idx];
+ TAILQ_REMOVE(&ctl->events, ev,
+ ev_timeout_pos.ev_next_with_common_timeout);
+ min_heap_push_(&base->timeheap, ev);
+ break;
+ case 1: /* Wasn't common; has become common. */
+ min_heap_erase_(&base->timeheap, ev);
+ ctl = get_common_timeout_list(base, &ev->ev_timeout);
+ insert_common_timeout_inorder(ctl, ev);
+ break;
+ case 0: /* was in heap; is still on heap. */
+ min_heap_adjust_(&base->timeheap, ev);
+ break;
+ default:
+ EVUTIL_ASSERT(0); /* unreachable */
+ break;
+ }
+}
+#endif
+
+/* Add 'ev' to the common timeout list in 'ev'. */
+static void
+insert_common_timeout_inorder(struct common_timeout_list *ctl,
+ struct event *ev)
+{
+ struct event *e;
+ /* By all logic, we should just be able to append 'ev' to the end of
+ * ctl->events, since the timeout on each 'ev' is set to {the common
+ * timeout} + {the time when we add the event}, and so the events
+ * should arrive in order of their timeeouts. But just in case
+ * there's some wacky threading issue going on, we do a search from
+ * the end of 'ev' to find the right insertion point.
+ */
+ TAILQ_FOREACH_REVERSE(e, &ctl->events,
+ event_list, ev_timeout_pos.ev_next_with_common_timeout) {
+ /* This timercmp is a little sneaky, since both ev and e have
+ * magic values in tv_usec. Fortunately, they ought to have
+ * the _same_ magic values in tv_usec. Let's assert for that.
+ */
+ EVUTIL_ASSERT(
+ is_same_common_timeout(&e->ev_timeout, &ev->ev_timeout));
+ if (evutil_timercmp(&ev->ev_timeout, &e->ev_timeout, >=)) {
+ TAILQ_INSERT_AFTER(&ctl->events, e, ev,
+ ev_timeout_pos.ev_next_with_common_timeout);
+ return;
+ }
+ }
+ TAILQ_INSERT_HEAD(&ctl->events, ev,
+ ev_timeout_pos.ev_next_with_common_timeout);
+}
+
+static void
+event_queue_insert_inserted(struct event_base *base, struct event *ev)
+{
+ EVENT_BASE_ASSERT_LOCKED(base);
+
+ if (EVUTIL_FAILURE_CHECK(ev->ev_flags & EVLIST_INSERTED)) {
+ event_errx(1, "%s: %p(fd "EV_SOCK_FMT") already inserted", __func__,
+ ev, EV_SOCK_ARG(ev->ev_fd));
+ return;
+ }
+
+ INCR_EVENT_COUNT(base, ev->ev_flags);
+
+ ev->ev_flags |= EVLIST_INSERTED;
+}
+
+static void
+event_queue_insert_active(struct event_base *base, struct event_callback *evcb)
+{
+ EVENT_BASE_ASSERT_LOCKED(base);
+
+ if (evcb->evcb_flags & EVLIST_ACTIVE) {
+ /* Double insertion is possible for active events */
+ return;
+ }
+
+ INCR_EVENT_COUNT(base, evcb->evcb_flags);
+
+ evcb->evcb_flags |= EVLIST_ACTIVE;
+
+ base->event_count_active++;
+ MAX_EVENT_COUNT(base->event_count_active_max, base->event_count_active);
+ EVUTIL_ASSERT(evcb->evcb_pri < base->nactivequeues);
+ TAILQ_INSERT_TAIL(&base->activequeues[evcb->evcb_pri],
+ evcb, evcb_active_next);
+}
+
+static void
+event_queue_insert_active_later(struct event_base *base, struct event_callback *evcb)
+{
+ EVENT_BASE_ASSERT_LOCKED(base);
+ if (evcb->evcb_flags & (EVLIST_ACTIVE_LATER|EVLIST_ACTIVE)) {
+ /* Double insertion is possible */
+ return;
+ }
+
+ INCR_EVENT_COUNT(base, evcb->evcb_flags);
+ evcb->evcb_flags |= EVLIST_ACTIVE_LATER;
+ base->event_count_active++;
+ MAX_EVENT_COUNT(base->event_count_active_max, base->event_count_active);
+ EVUTIL_ASSERT(evcb->evcb_pri < base->nactivequeues);
+ TAILQ_INSERT_TAIL(&base->active_later_queue, evcb, evcb_active_next);
+}
+
+static void
+event_queue_insert_timeout(struct event_base *base, struct event *ev)
+{
+ EVENT_BASE_ASSERT_LOCKED(base);
+
+ if (EVUTIL_FAILURE_CHECK(ev->ev_flags & EVLIST_TIMEOUT)) {
+ event_errx(1, "%s: %p(fd "EV_SOCK_FMT") already on timeout", __func__,
+ ev, EV_SOCK_ARG(ev->ev_fd));
+ return;
+ }
+
+ INCR_EVENT_COUNT(base, ev->ev_flags);
+
+ ev->ev_flags |= EVLIST_TIMEOUT;
+
+ if (is_common_timeout(&ev->ev_timeout, base)) {
+ struct common_timeout_list *ctl =
+ get_common_timeout_list(base, &ev->ev_timeout);
+ insert_common_timeout_inorder(ctl, ev);
+ } else {
+ min_heap_push_(&base->timeheap, ev);
+ }
+}
+
+static void
+event_queue_make_later_events_active(struct event_base *base)
+{
+ struct event_callback *evcb;
+ EVENT_BASE_ASSERT_LOCKED(base);
+
+ while ((evcb = TAILQ_FIRST(&base->active_later_queue))) {
+ TAILQ_REMOVE(&base->active_later_queue, evcb, evcb_active_next);
+ evcb->evcb_flags = (evcb->evcb_flags & ~EVLIST_ACTIVE_LATER) | EVLIST_ACTIVE;
+ EVUTIL_ASSERT(evcb->evcb_pri < base->nactivequeues);
+ TAILQ_INSERT_TAIL(&base->activequeues[evcb->evcb_pri], evcb, evcb_active_next);
+ base->n_deferreds_queued += (evcb->evcb_closure == EV_CLOSURE_CB_SELF);
+ }
+}
+
+/* Functions for debugging */
+
+const char *
+event_get_version(void)
+{
+ return (EVENT__VERSION);
+}
+
+ev_uint32_t
+event_get_version_number(void)
+{
+ return (EVENT__NUMERIC_VERSION);
+}
+
+/*
+ * No thread-safe interface needed - the information should be the same
+ * for all threads.
+ */
+
+const char *
+event_get_method(void)
+{
+ return (current_base->evsel->name);
+}
+
+#ifndef EVENT__DISABLE_MM_REPLACEMENT
+static void *(*mm_malloc_fn_)(size_t sz) = NULL;
+static void *(*mm_realloc_fn_)(void *p, size_t sz) = NULL;
+static void (*mm_free_fn_)(void *p) = NULL;
+
+void *
+event_mm_malloc_(size_t sz)
+{
+ if (sz == 0)
+ return NULL;
+
+ if (mm_malloc_fn_)
+ return mm_malloc_fn_(sz);
+ else
+ return malloc(sz);
+}
+
+void *
+event_mm_calloc_(size_t count, size_t size)
+{
+ if (count == 0 || size == 0)
+ return NULL;
+
+ if (mm_malloc_fn_) {
+ size_t sz = count * size;
+ void *p = NULL;
+ if (count > EV_SIZE_MAX / size)
+ goto error;
+ p = mm_malloc_fn_(sz);
+ if (p)
+ return memset(p, 0, sz);
+ } else {
+ void *p = calloc(count, size);
+#ifdef _WIN32
+ /* Windows calloc doesn't reliably set ENOMEM */
+ if (p == NULL)
+ goto error;
+#endif
+ return p;
+ }
+
+error:
+ errno = ENOMEM;
+ return NULL;
+}
+
+char *
+event_mm_strdup_(const char *str)
+{
+ if (!str) {
+ errno = EINVAL;
+ return NULL;
+ }
+
+ if (mm_malloc_fn_) {
+ size_t ln = strlen(str);
+ void *p = NULL;
+ if (ln == EV_SIZE_MAX)
+ goto error;
+ p = mm_malloc_fn_(ln+1);
+ if (p)
+ return memcpy(p, str, ln+1);
+ } else
+#ifdef _WIN32
+ return _strdup(str);
+#else
+ return strdup(str);
+#endif
+
+error:
+ errno = ENOMEM;
+ return NULL;
+}
+
+void *
+event_mm_realloc_(void *ptr, size_t sz)
+{
+ if (mm_realloc_fn_)
+ return mm_realloc_fn_(ptr, sz);
+ else
+ return realloc(ptr, sz);
+}
+
+void
+event_mm_free_(void *ptr)
+{
+ if (mm_free_fn_)
+ mm_free_fn_(ptr);
+ else
+ free(ptr);
+}
+
+void
+event_set_mem_functions(void *(*malloc_fn)(size_t sz),
+ void *(*realloc_fn)(void *ptr, size_t sz),
+ void (*free_fn)(void *ptr))
+{
+ mm_malloc_fn_ = malloc_fn;
+ mm_realloc_fn_ = realloc_fn;
+ mm_free_fn_ = free_fn;
+}
+#endif
+
+#ifdef EVENT__HAVE_EVENTFD
+static void
+evthread_notify_drain_eventfd(evutil_socket_t fd, short what, void *arg)
+{
+ ev_uint64_t msg;
+ ev_ssize_t r;
+ struct event_base *base = arg;
+
+ r = read(fd, (void*) &msg, sizeof(msg));
+ if (r<0 && errno != EAGAIN) {
+ event_sock_warn(fd, "Error reading from eventfd");
+ }
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ base->is_notify_pending = 0;
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+}
+#endif
+
+static void
+evthread_notify_drain_default(evutil_socket_t fd, short what, void *arg)
+{
+ unsigned char buf[1024];
+ struct event_base *base = arg;
+#ifdef _WIN32
+ while (recv(fd, (char*)buf, sizeof(buf), 0) > 0)
+ ;
+#else
+ while (read(fd, (char*)buf, sizeof(buf)) > 0)
+ ;
+#endif
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ base->is_notify_pending = 0;
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+}
+
+int
+evthread_make_base_notifiable(struct event_base *base)
+{
+ int r;
+ if (!base)
+ return -1;
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ r = evthread_make_base_notifiable_nolock_(base);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return r;
+}
+
+static int
+evthread_make_base_notifiable_nolock_(struct event_base *base)
+{
+ void (*cb)(evutil_socket_t, short, void *);
+ int (*notify)(struct event_base *);
+
+ if (base->th_notify_fn != NULL) {
+ /* The base is already notifiable: we're doing fine. */
+ return 0;
+ }
+
+#if defined(EVENT__HAVE_WORKING_KQUEUE)
+ if (base->evsel == &kqops && event_kq_add_notify_event_(base) == 0) {
+ base->th_notify_fn = event_kq_notify_base_;
+ /* No need to add an event here; the backend can wake
+ * itself up just fine. */
+ return 0;
+ }
+#endif
+
+#ifdef EVENT__HAVE_EVENTFD
+ base->th_notify_fd[0] = evutil_eventfd_(0,
+ EVUTIL_EFD_CLOEXEC|EVUTIL_EFD_NONBLOCK);
+ if (base->th_notify_fd[0] >= 0) {
+ base->th_notify_fd[1] = -1;
+ notify = evthread_notify_base_eventfd;
+ cb = evthread_notify_drain_eventfd;
+ } else
+#endif
+ if (evutil_make_internal_pipe_(base->th_notify_fd) == 0) {
+ notify = evthread_notify_base_default;
+ cb = evthread_notify_drain_default;
+ } else {
+ return -1;
+ }
+
+ base->th_notify_fn = notify;
+
+ /* prepare an event that we can use for wakeup */
+ event_assign(&base->th_notify, base, base->th_notify_fd[0],
+ EV_READ|EV_PERSIST, cb, base);
+
+ /* we need to mark this as internal event */
+ base->th_notify.ev_flags |= EVLIST_INTERNAL;
+ event_priority_set(&base->th_notify, 0);
+
+ return event_add_nolock_(&base->th_notify, NULL, 0);
+}
+
+int
+event_base_foreach_event_nolock_(struct event_base *base,
+ event_base_foreach_event_cb fn, void *arg)
+{
+ int r, i;
+ unsigned u;
+ struct event *ev;
+
+ /* Start out with all the EVLIST_INSERTED events. */
+ if ((r = evmap_foreach_event_(base, fn, arg)))
+ return r;
+
+ /* Okay, now we deal with those events that have timeouts and are in
+ * the min-heap. */
+ for (u = 0; u < base->timeheap.n; ++u) {
+ ev = base->timeheap.p[u];
+ if (ev->ev_flags & EVLIST_INSERTED) {
+ /* we already processed this one */
+ continue;
+ }
+ if ((r = fn(base, ev, arg)))
+ return r;
+ }
+
+ /* Now for the events in one of the timeout queues.
+ * the min-heap. */
+ for (i = 0; i < base->n_common_timeouts; ++i) {
+ struct common_timeout_list *ctl =
+ base->common_timeout_queues[i];
+ TAILQ_FOREACH(ev, &ctl->events,
+ ev_timeout_pos.ev_next_with_common_timeout) {
+ if (ev->ev_flags & EVLIST_INSERTED) {
+ /* we already processed this one */
+ continue;
+ }
+ if ((r = fn(base, ev, arg)))
+ return r;
+ }
+ }
+
+ /* Finally, we deal wit all the active events that we haven't touched
+ * yet. */
+ for (i = 0; i < base->nactivequeues; ++i) {
+ struct event_callback *evcb;
+ TAILQ_FOREACH(evcb, &base->activequeues[i], evcb_active_next) {
+ if ((evcb->evcb_flags & (EVLIST_INIT|EVLIST_INSERTED|EVLIST_TIMEOUT)) != EVLIST_INIT) {
+ /* This isn't an event (evlist_init clear), or
+ * we already processed it. (inserted or
+ * timeout set */
+ continue;
+ }
+ ev = event_callback_to_event(evcb);
+ if ((r = fn(base, ev, arg)))
+ return r;
+ }
+ }
+
+ return 0;
+}
+
+/* Helper for event_base_dump_events: called on each event in the event base;
+ * dumps only the inserted events. */
+static int
+dump_inserted_event_fn(const struct event_base *base, const struct event *e, void *arg)
+{
+ FILE *output = arg;
+ const char *gloss = (e->ev_events & EV_SIGNAL) ?
+ "sig" : "fd ";
+
+ if (! (e->ev_flags & (EVLIST_INSERTED|EVLIST_TIMEOUT)))
+ return 0;
+
+ fprintf(output, " %p [%s "EV_SOCK_FMT"]%s%s%s%s%s%s",
+ (void*)e, gloss, EV_SOCK_ARG(e->ev_fd),
+ (e->ev_events&EV_READ)?" Read":"",
+ (e->ev_events&EV_WRITE)?" Write":"",
+ (e->ev_events&EV_CLOSED)?" EOF":"",
+ (e->ev_events&EV_SIGNAL)?" Signal":"",
+ (e->ev_events&EV_PERSIST)?" Persist":"",
+ (e->ev_flags&EVLIST_INTERNAL)?" Internal":"");
+ if (e->ev_flags & EVLIST_TIMEOUT) {
+ struct timeval tv;
+ tv.tv_sec = e->ev_timeout.tv_sec;
+ tv.tv_usec = e->ev_timeout.tv_usec & MICROSECONDS_MASK;
+ evutil_timeradd(&tv, &base->tv_clock_diff, &tv);
+ fprintf(output, " Timeout=%ld.%06d",
+ (long)tv.tv_sec, (int)(tv.tv_usec & MICROSECONDS_MASK));
+ }
+ fputc('\n', output);
+
+ return 0;
+}
+
+/* Helper for event_base_dump_events: called on each event in the event base;
+ * dumps only the active events. */
+static int
+dump_active_event_fn(const struct event_base *base, const struct event *e, void *arg)
+{
+ FILE *output = arg;
+ const char *gloss = (e->ev_events & EV_SIGNAL) ?
+ "sig" : "fd ";
+
+ if (! (e->ev_flags & (EVLIST_ACTIVE|EVLIST_ACTIVE_LATER)))
+ return 0;
+
+ fprintf(output, " %p [%s "EV_SOCK_FMT", priority=%d]%s%s%s%s%s active%s%s\n",
+ (void*)e, gloss, EV_SOCK_ARG(e->ev_fd), e->ev_pri,
+ (e->ev_res&EV_READ)?" Read":"",
+ (e->ev_res&EV_WRITE)?" Write":"",
+ (e->ev_res&EV_CLOSED)?" EOF":"",
+ (e->ev_res&EV_SIGNAL)?" Signal":"",
+ (e->ev_res&EV_TIMEOUT)?" Timeout":"",
+ (e->ev_flags&EVLIST_INTERNAL)?" [Internal]":"",
+ (e->ev_flags&EVLIST_ACTIVE_LATER)?" [NextTime]":"");
+
+ return 0;
+}
+
+int
+event_base_foreach_event(struct event_base *base,
+ event_base_foreach_event_cb fn, void *arg)
+{
+ int r;
+ if ((!fn) || (!base)) {
+ return -1;
+ }
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ r = event_base_foreach_event_nolock_(base, fn, arg);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return r;
+}
+
+
+void
+event_base_dump_events(struct event_base *base, FILE *output)
+{
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ fprintf(output, "Inserted events:\n");
+ event_base_foreach_event_nolock_(base, dump_inserted_event_fn, output);
+
+ fprintf(output, "Active events:\n");
+ event_base_foreach_event_nolock_(base, dump_active_event_fn, output);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+}
+
+void
+event_base_active_by_fd(struct event_base *base, evutil_socket_t fd, short events)
+{
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ evmap_io_active_(base, fd, events & (EV_READ|EV_WRITE|EV_CLOSED));
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+}
+
+void
+event_base_active_by_signal(struct event_base *base, int sig)
+{
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ evmap_signal_active_(base, sig, 1);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+}
+
+
+void
+event_base_add_virtual_(struct event_base *base)
+{
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ base->virtual_event_count++;
+ MAX_EVENT_COUNT(base->virtual_event_count_max, base->virtual_event_count);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+}
+
+void
+event_base_del_virtual_(struct event_base *base)
+{
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ EVUTIL_ASSERT(base->virtual_event_count > 0);
+ base->virtual_event_count--;
+ if (base->virtual_event_count == 0 && EVBASE_NEED_NOTIFY(base))
+ evthread_notify_base(base);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+}
+
+static void
+event_free_debug_globals_locks(void)
+{
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+#ifndef EVENT__DISABLE_DEBUG_MODE
+ if (event_debug_map_lock_ != NULL) {
+ EVTHREAD_FREE_LOCK(event_debug_map_lock_, 0);
+ event_debug_map_lock_ = NULL;
+ evthreadimpl_disable_lock_debugging_();
+ }
+#endif /* EVENT__DISABLE_DEBUG_MODE */
+#endif /* EVENT__DISABLE_THREAD_SUPPORT */
+ return;
+}
+
+static void
+event_free_debug_globals(void)
+{
+ event_free_debug_globals_locks();
+}
+
+static void
+event_free_evsig_globals(void)
+{
+ evsig_free_globals_();
+}
+
+static void
+event_free_evutil_globals(void)
+{
+ evutil_free_globals_();
+}
+
+static void
+event_free_globals(void)
+{
+ event_free_debug_globals();
+ event_free_evsig_globals();
+ event_free_evutil_globals();
+}
+
+void
+libevent_global_shutdown(void)
+{
+ event_disable_debug_mode();
+ event_free_globals();
+}
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+int
+event_global_setup_locks_(const int enable_locks)
+{
+#ifndef EVENT__DISABLE_DEBUG_MODE
+ EVTHREAD_SETUP_GLOBAL_LOCK(event_debug_map_lock_, 0);
+#endif
+ if (evsig_global_setup_locks_(enable_locks) < 0)
+ return -1;
+ if (evutil_global_setup_locks_(enable_locks) < 0)
+ return -1;
+ if (evutil_secure_rng_global_setup_locks_(enable_locks) < 0)
+ return -1;
+ return 0;
+}
+#endif
+
+void
+event_base_assert_ok_(struct event_base *base)
+{
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ event_base_assert_ok_nolock_(base);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+}
+
+void
+event_base_assert_ok_nolock_(struct event_base *base)
+{
+ int i;
+ int count;
+
+ /* First do checks on the per-fd and per-signal lists */
+ evmap_check_integrity_(base);
+
+ /* Check the heap property */
+ for (i = 1; i < (int)base->timeheap.n; ++i) {
+ int parent = (i - 1) / 2;
+ struct event *ev, *p_ev;
+ ev = base->timeheap.p[i];
+ p_ev = base->timeheap.p[parent];
+ EVUTIL_ASSERT(ev->ev_flags & EVLIST_TIMEOUT);
+ EVUTIL_ASSERT(evutil_timercmp(&p_ev->ev_timeout, &ev->ev_timeout, <=));
+ EVUTIL_ASSERT(ev->ev_timeout_pos.min_heap_idx == i);
+ }
+
+ /* Check that the common timeouts are fine */
+ for (i = 0; i < base->n_common_timeouts; ++i) {
+ struct common_timeout_list *ctl = base->common_timeout_queues[i];
+ struct event *last=NULL, *ev;
+
+ EVUTIL_ASSERT_TAILQ_OK(&ctl->events, event, ev_timeout_pos.ev_next_with_common_timeout);
+
+ TAILQ_FOREACH(ev, &ctl->events, ev_timeout_pos.ev_next_with_common_timeout) {
+ if (last)
+ EVUTIL_ASSERT(evutil_timercmp(&last->ev_timeout, &ev->ev_timeout, <=));
+ EVUTIL_ASSERT(ev->ev_flags & EVLIST_TIMEOUT);
+ EVUTIL_ASSERT(is_common_timeout(&ev->ev_timeout,base));
+ EVUTIL_ASSERT(COMMON_TIMEOUT_IDX(&ev->ev_timeout) == i);
+ last = ev;
+ }
+ }
+
+ /* Check the active queues. */
+ count = 0;
+ for (i = 0; i < base->nactivequeues; ++i) {
+ struct event_callback *evcb;
+ EVUTIL_ASSERT_TAILQ_OK(&base->activequeues[i], event_callback, evcb_active_next);
+ TAILQ_FOREACH(evcb, &base->activequeues[i], evcb_active_next) {
+ EVUTIL_ASSERT((evcb->evcb_flags & (EVLIST_ACTIVE|EVLIST_ACTIVE_LATER)) == EVLIST_ACTIVE);
+ EVUTIL_ASSERT(evcb->evcb_pri == i);
+ ++count;
+ }
+ }
+
+ {
+ struct event_callback *evcb;
+ TAILQ_FOREACH(evcb, &base->active_later_queue, evcb_active_next) {
+ EVUTIL_ASSERT((evcb->evcb_flags & (EVLIST_ACTIVE|EVLIST_ACTIVE_LATER)) == EVLIST_ACTIVE_LATER);
+ ++count;
+ }
+ }
+ EVUTIL_ASSERT(count == base->event_count_active);
+}
diff --git a/protocols/Telegram/tgl/libevent/event.obj b/protocols/Telegram/tgl/libevent/event.obj
new file mode 100644
index 0000000000..dfc99f232e
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/event.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/event_iocp.c b/protocols/Telegram/tgl/libevent/event_iocp.c
new file mode 100644
index 0000000000..a9902fbc42
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/event_iocp.c
@@ -0,0 +1,294 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos, Nick Mathewson
+ *
+ * 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 "evconfig-private.h"
+
+#ifndef _WIN32_WINNT
+/* Minimum required for InitializeCriticalSectionAndSpinCount */
+#define _WIN32_WINNT 0x0403
+#endif
+#include <winsock2.h>
+#include <windows.h>
+#include <process.h>
+#include <stdio.h>
+#include <mswsock.h>
+
+#include "event2/util.h"
+#include "util-internal.h"
+#include "iocp-internal.h"
+#include "log-internal.h"
+#include "mm-internal.h"
+#include "event-internal.h"
+#include "evthread-internal.h"
+
+#define NOTIFICATION_KEY ((ULONG_PTR)-1)
+
+void
+event_overlapped_init_(struct event_overlapped *o, iocp_callback cb)
+{
+ memset(o, 0, sizeof(struct event_overlapped));
+ o->cb = cb;
+}
+
+static void
+handle_entry(OVERLAPPED *o, ULONG_PTR completion_key, DWORD nBytes, int ok)
+{
+ struct event_overlapped *eo =
+ EVUTIL_UPCAST(o, struct event_overlapped, overlapped);
+ eo->cb(eo, completion_key, nBytes, ok);
+}
+
+static void
+loop(void *port_)
+{
+ struct event_iocp_port *port = port_;
+ long ms = port->ms;
+ HANDLE p = port->port;
+
+ if (ms <= 0)
+ ms = INFINITE;
+
+ while (1) {
+ OVERLAPPED *overlapped=NULL;
+ ULONG_PTR key=0;
+ DWORD bytes=0;
+ int ok = GetQueuedCompletionStatus(p, &bytes, &key,
+ &overlapped, ms);
+ EnterCriticalSection(&port->lock);
+ if (port->shutdown) {
+ if (--port->n_live_threads == 0)
+ ReleaseSemaphore(port->shutdownSemaphore, 1,
+ NULL);
+ LeaveCriticalSection(&port->lock);
+ return;
+ }
+ LeaveCriticalSection(&port->lock);
+
+ if (key != NOTIFICATION_KEY && overlapped)
+ handle_entry(overlapped, key, bytes, ok);
+ else if (!overlapped)
+ break;
+ }
+ event_warnx("GetQueuedCompletionStatus exited with no event.");
+ EnterCriticalSection(&port->lock);
+ if (--port->n_live_threads == 0)
+ ReleaseSemaphore(port->shutdownSemaphore, 1, NULL);
+ LeaveCriticalSection(&port->lock);
+}
+
+int
+event_iocp_port_associate_(struct event_iocp_port *port, evutil_socket_t fd,
+ ev_uintptr_t key)
+{
+ HANDLE h;
+ h = CreateIoCompletionPort((HANDLE)fd, port->port, key, port->n_threads);
+ if (!h)
+ return -1;
+ return 0;
+}
+
+static void *
+get_extension_function(SOCKET s, const GUID *which_fn)
+{
+ void *ptr = NULL;
+ DWORD bytes=0;
+ WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER,
+ (GUID*)which_fn, sizeof(*which_fn),
+ &ptr, sizeof(ptr),
+ &bytes, NULL, NULL);
+
+ /* No need to detect errors here: if ptr is set, then we have a good
+ function pointer. Otherwise, we should behave as if we had no
+ function pointer.
+ */
+ return ptr;
+}
+
+/* Mingw doesn't have these in its mswsock.h. The values are copied from
+ wine.h. Perhaps if we copy them exactly, the cargo will come again.
+*/
+#ifndef WSAID_ACCEPTEX
+#define WSAID_ACCEPTEX \
+ {0xb5367df1,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}}
+#endif
+#ifndef WSAID_CONNECTEX
+#define WSAID_CONNECTEX \
+ {0x25a207b9,0xddf3,0x4660,{0x8e,0xe9,0x76,0xe5,0x8c,0x74,0x06,0x3e}}
+#endif
+#ifndef WSAID_GETACCEPTEXSOCKADDRS
+#define WSAID_GETACCEPTEXSOCKADDRS \
+ {0xb5367df2,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}}
+#endif
+
+static int extension_fns_initialized = 0;
+
+static void
+init_extension_functions(struct win32_extension_fns *ext)
+{
+ const GUID acceptex = WSAID_ACCEPTEX;
+ const GUID connectex = WSAID_CONNECTEX;
+ const GUID getacceptexsockaddrs = WSAID_GETACCEPTEXSOCKADDRS;
+ SOCKET s = socket(AF_INET, SOCK_STREAM, 0);
+ if (s == INVALID_SOCKET)
+ return;
+ ext->AcceptEx = get_extension_function(s, &acceptex);
+ ext->ConnectEx = get_extension_function(s, &connectex);
+ ext->GetAcceptExSockaddrs = get_extension_function(s,
+ &getacceptexsockaddrs);
+ closesocket(s);
+
+ extension_fns_initialized = 1;
+}
+
+static struct win32_extension_fns the_extension_fns;
+
+const struct win32_extension_fns *
+event_get_win32_extension_fns_(void)
+{
+ return &the_extension_fns;
+}
+
+#define N_CPUS_DEFAULT 2
+
+struct event_iocp_port *
+event_iocp_port_launch_(int n_cpus)
+{
+ struct event_iocp_port *port;
+ int i;
+
+ if (!extension_fns_initialized)
+ init_extension_functions(&the_extension_fns);
+
+ if (!(port = mm_calloc(1, sizeof(struct event_iocp_port))))
+ return NULL;
+
+ if (n_cpus <= 0)
+ n_cpus = N_CPUS_DEFAULT;
+ port->n_threads = n_cpus * 2;
+ port->threads = mm_calloc(port->n_threads, sizeof(HANDLE));
+ if (!port->threads)
+ goto err;
+
+ port->port = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0,
+ n_cpus);
+ port->ms = -1;
+ if (!port->port)
+ goto err;
+
+ port->shutdownSemaphore = CreateSemaphore(NULL, 0, 1, NULL);
+ if (!port->shutdownSemaphore)
+ goto err;
+
+ for (i=0; i<port->n_threads; ++i) {
+ ev_uintptr_t th = _beginthread(loop, 0, port);
+ if (th == (ev_uintptr_t)-1)
+ goto err;
+ port->threads[i] = (HANDLE)th;
+ ++port->n_live_threads;
+ }
+
+ InitializeCriticalSectionAndSpinCount(&port->lock, 1000);
+
+ return port;
+err:
+ if (port->port)
+ CloseHandle(port->port);
+ if (port->threads)
+ mm_free(port->threads);
+ if (port->shutdownSemaphore)
+ CloseHandle(port->shutdownSemaphore);
+ mm_free(port);
+ return NULL;
+}
+
+static void
+event_iocp_port_unlock_and_free_(struct event_iocp_port *port)
+{
+ DeleteCriticalSection(&port->lock);
+ CloseHandle(port->port);
+ CloseHandle(port->shutdownSemaphore);
+ mm_free(port->threads);
+ mm_free(port);
+}
+
+static int
+event_iocp_notify_all(struct event_iocp_port *port)
+{
+ int i, r, ok=1;
+ for (i=0; i<port->n_threads; ++i) {
+ r = PostQueuedCompletionStatus(port->port, 0, NOTIFICATION_KEY,
+ NULL);
+ if (!r)
+ ok = 0;
+ }
+ return ok ? 0 : -1;
+}
+
+int
+event_iocp_shutdown_(struct event_iocp_port *port, long waitMsec)
+{
+ DWORD ms = INFINITE;
+ int n;
+
+ EnterCriticalSection(&port->lock);
+ port->shutdown = 1;
+ LeaveCriticalSection(&port->lock);
+ event_iocp_notify_all(port);
+
+ if (waitMsec >= 0)
+ ms = waitMsec;
+
+ WaitForSingleObject(port->shutdownSemaphore, ms);
+ EnterCriticalSection(&port->lock);
+ n = port->n_live_threads;
+ LeaveCriticalSection(&port->lock);
+ if (n == 0) {
+ event_iocp_port_unlock_and_free_(port);
+ return 0;
+ } else {
+ return -1;
+ }
+}
+
+int
+event_iocp_activate_overlapped_(
+ struct event_iocp_port *port, struct event_overlapped *o,
+ ev_uintptr_t key, ev_uint32_t n)
+{
+ BOOL r;
+
+ r = PostQueuedCompletionStatus(port->port, n, key, &o->overlapped);
+ return (r==0) ? -1 : 0;
+}
+
+struct event_iocp_port *
+event_base_get_iocp_(struct event_base *base)
+{
+#ifdef _WIN32
+ return base->iocp;
+#else
+ return NULL;
+#endif
+}
diff --git a/protocols/Telegram/tgl/libevent/event_iocp.obj b/protocols/Telegram/tgl/libevent/event_iocp.obj
new file mode 100644
index 0000000000..3a32d6e6cd
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/event_iocp.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/event_rpcgen.py b/protocols/Telegram/tgl/libevent/event_rpcgen.py
new file mode 100644
index 0000000000..c537565696
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/event_rpcgen.py
@@ -0,0 +1,1728 @@
+#!/usr/bin/env python2
+#
+# Copyright (c) 2005-2007 Niels Provos <provos@citi.umich.edu>
+# Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+# All rights reserved.
+#
+# Generates marshaling code based on libevent.
+
+# TODO:
+# 1) use optparse to allow the strategy shell to parse options, and
+# to allow the instantiated factory (for the specific output language)
+# to parse remaining options
+# 2) move the globals into a class that manages execution (including the
+# progress outputs that space stderr at the moment)
+# 3) emit other languages
+
+import sys
+import re
+
+_NAME = "event_rpcgen.py"
+_VERSION = "0.1"
+
+# Globals
+line_count = 0
+
+white = re.compile(r'\s+')
+cppcomment = re.compile(r'\/\/.*$')
+nonident = re.compile(r'[^a-zA-Z0-9_]')
+structref = re.compile(r'^struct\[([a-zA-Z_][a-zA-Z0-9_]*)\]$')
+structdef = re.compile(r'^struct +[a-zA-Z_][a-zA-Z0-9_]* *{$')
+
+headerdirect = []
+cppdirect = []
+
+QUIETLY = 0
+
+def declare(s):
+ if not QUIETLY:
+ print s
+
+def TranslateList(mylist, mydict):
+ return map(lambda x: x % mydict, mylist)
+
+# Exception class for parse errors
+class RpcGenError(Exception):
+ def __init__(self, why):
+ self.why = why
+ def __str__(self):
+ return str(self.why)
+
+# Holds everything that makes a struct
+class Struct:
+ def __init__(self, name):
+ self._name = name
+ self._entries = []
+ self._tags = {}
+ declare(' Created struct: %s' % name)
+
+ def AddEntry(self, entry):
+ if self._tags.has_key(entry.Tag()):
+ raise RpcGenError(
+ 'Entry "%s" duplicates tag number %d from "%s" '
+ 'around line %d' % (entry.Name(), entry.Tag(),
+ self._tags[entry.Tag()], line_count))
+ self._entries.append(entry)
+ self._tags[entry.Tag()] = entry.Name()
+ declare(' Added entry: %s' % entry.Name())
+
+ def Name(self):
+ return self._name
+
+ def EntryTagName(self, entry):
+ """Creates the name inside an enumeration for distinguishing data
+ types."""
+ name = "%s_%s" % (self._name, entry.Name())
+ return name.upper()
+
+ def PrintIndented(self, file, ident, code):
+ """Takes an array, add indentation to each entry and prints it."""
+ for entry in code:
+ print >>file, '%s%s' % (ident, entry)
+
+class StructCCode(Struct):
+ """ Knows how to generate C code for a struct """
+
+ def __init__(self, name):
+ Struct.__init__(self, name)
+
+ def PrintTags(self, file):
+ """Prints the tag definitions for a structure."""
+ print >>file, '/* Tag definition for %s */' % self._name
+ print >>file, 'enum %s_ {' % self._name.lower()
+ for entry in self._entries:
+ print >>file, ' %s=%d,' % (self.EntryTagName(entry),
+ entry.Tag())
+ print >>file, ' %s_MAX_TAGS' % (self._name.upper())
+ print >>file, '};\n'
+
+ def PrintForwardDeclaration(self, file):
+ print >>file, 'struct %s;' % self._name
+
+ def PrintDeclaration(self, file):
+ print >>file, '/* Structure declaration for %s */' % self._name
+ print >>file, 'struct %s_access_ {' % self._name
+ for entry in self._entries:
+ dcl = entry.AssignDeclaration('(*%s_assign)' % entry.Name())
+ dcl.extend(
+ entry.GetDeclaration('(*%s_get)' % entry.Name()))
+ if entry.Array():
+ dcl.extend(
+ entry.AddDeclaration('(*%s_add)' % entry.Name()))
+ self.PrintIndented(file, ' ', dcl)
+ print >>file, '};\n'
+
+ print >>file, 'struct %s {' % self._name
+ print >>file, ' struct %s_access_ *base;\n' % self._name
+ for entry in self._entries:
+ dcl = entry.Declaration()
+ self.PrintIndented(file, ' ', dcl)
+ print >>file, ''
+ for entry in self._entries:
+ print >>file, ' ev_uint8_t %s_set;' % entry.Name()
+ print >>file, '};\n'
+
+ print >>file, \
+"""struct %(name)s *%(name)s_new(void);
+struct %(name)s *%(name)s_new_with_arg(void *);
+void %(name)s_free(struct %(name)s *);
+void %(name)s_clear(struct %(name)s *);
+void %(name)s_marshal(struct evbuffer *, const struct %(name)s *);
+int %(name)s_unmarshal(struct %(name)s *, struct evbuffer *);
+int %(name)s_complete(struct %(name)s *);
+void evtag_marshal_%(name)s(struct evbuffer *, ev_uint32_t,
+ const struct %(name)s *);
+int evtag_unmarshal_%(name)s(struct evbuffer *, ev_uint32_t,
+ struct %(name)s *);""" % { 'name' : self._name }
+
+
+ # Write a setting function of every variable
+ for entry in self._entries:
+ self.PrintIndented(file, '', entry.AssignDeclaration(
+ entry.AssignFuncName()))
+ self.PrintIndented(file, '', entry.GetDeclaration(
+ entry.GetFuncName()))
+ if entry.Array():
+ self.PrintIndented(file, '', entry.AddDeclaration(
+ entry.AddFuncName()))
+
+ print >>file, '/* --- %s done --- */\n' % self._name
+
+ def PrintCode(self, file):
+ print >>file, ('/*\n'
+ ' * Implementation of %s\n'
+ ' */\n') % self._name
+
+ print >>file, \
+ 'static struct %(name)s_access_ %(name)s_base__ = {' % \
+ { 'name' : self._name }
+ for entry in self._entries:
+ self.PrintIndented(file, ' ', entry.CodeBase())
+ print >>file, '};\n'
+
+ # Creation
+ print >>file, (
+ 'struct %(name)s *\n'
+ '%(name)s_new(void)\n'
+ '{\n'
+ ' return %(name)s_new_with_arg(NULL);\n'
+ '}\n'
+ '\n'
+ 'struct %(name)s *\n'
+ '%(name)s_new_with_arg(void *unused)\n'
+ '{\n'
+ ' struct %(name)s *tmp;\n'
+ ' if ((tmp = malloc(sizeof(struct %(name)s))) == NULL) {\n'
+ ' event_warn("%%s: malloc", __func__);\n'
+ ' return (NULL);\n'
+ ' }\n'
+ ' tmp->base = &%(name)s_base__;\n') % { 'name' : self._name }
+
+ for entry in self._entries:
+ self.PrintIndented(file, ' ', entry.CodeInitialize('tmp'))
+ print >>file, ' tmp->%s_set = 0;\n' % entry.Name()
+
+ print >>file, (
+ ' return (tmp);\n'
+ '}\n')
+
+ # Adding
+ for entry in self._entries:
+ if entry.Array():
+ self.PrintIndented(file, '', entry.CodeAdd())
+ print >>file, ''
+
+ # Assigning
+ for entry in self._entries:
+ self.PrintIndented(file, '', entry.CodeAssign())
+ print >>file, ''
+
+ # Getting
+ for entry in self._entries:
+ self.PrintIndented(file, '', entry.CodeGet())
+ print >>file, ''
+
+ # Clearing
+ print >>file, ( 'void\n'
+ '%(name)s_clear(struct %(name)s *tmp)\n'
+ '{'
+ ) % { 'name' : self._name }
+ for entry in self._entries:
+ self.PrintIndented(file, ' ', entry.CodeClear('tmp'))
+
+ print >>file, '}\n'
+
+ # Freeing
+ print >>file, ( 'void\n'
+ '%(name)s_free(struct %(name)s *tmp)\n'
+ '{'
+ ) % { 'name' : self._name }
+
+ for entry in self._entries:
+ self.PrintIndented(file, ' ', entry.CodeFree('tmp'))
+
+ print >>file, (' free(tmp);\n'
+ '}\n')
+
+ # Marshaling
+ print >>file, ('void\n'
+ '%(name)s_marshal(struct evbuffer *evbuf, '
+ 'const struct %(name)s *tmp)'
+ '{') % { 'name' : self._name }
+ for entry in self._entries:
+ indent = ' '
+ # Optional entries do not have to be set
+ if entry.Optional():
+ indent += ' '
+ print >>file, ' if (tmp->%s_set) {' % entry.Name()
+ self.PrintIndented(
+ file, indent,
+ entry.CodeMarshal('evbuf', self.EntryTagName(entry),
+ entry.GetVarName('tmp'),
+ entry.GetVarLen('tmp')))
+ if entry.Optional():
+ print >>file, ' }'
+
+ print >>file, '}\n'
+
+ # Unmarshaling
+ print >>file, ('int\n'
+ '%(name)s_unmarshal(struct %(name)s *tmp, '
+ ' struct evbuffer *evbuf)\n'
+ '{\n'
+ ' ev_uint32_t tag;\n'
+ ' while (evbuffer_get_length(evbuf) > 0) {\n'
+ ' if (evtag_peek(evbuf, &tag) == -1)\n'
+ ' return (-1);\n'
+ ' switch (tag) {\n'
+ ) % { 'name' : self._name }
+ for entry in self._entries:
+ print >>file, ' case %s:\n' % self.EntryTagName(entry)
+ if not entry.Array():
+ print >>file, (
+ ' if (tmp->%s_set)\n'
+ ' return (-1);'
+ ) % (entry.Name())
+
+ self.PrintIndented(
+ file, ' ',
+ entry.CodeUnmarshal('evbuf',
+ self.EntryTagName(entry),
+ entry.GetVarName('tmp'),
+ entry.GetVarLen('tmp')))
+
+ print >>file, ( ' tmp->%s_set = 1;\n' % entry.Name() +
+ ' break;\n' )
+ print >>file, ( ' default:\n'
+ ' return -1;\n'
+ ' }\n'
+ ' }\n' )
+ # Check if it was decoded completely
+ print >>file, ( ' if (%(name)s_complete(tmp) == -1)\n'
+ ' return (-1);'
+ ) % { 'name' : self._name }
+
+ # Successfully decoded
+ print >>file, ( ' return (0);\n'
+ '}\n')
+
+ # Checking if a structure has all the required data
+ print >>file, (
+ 'int\n'
+ '%(name)s_complete(struct %(name)s *msg)\n'
+ '{' ) % { 'name' : self._name }
+ for entry in self._entries:
+ if not entry.Optional():
+ code = [
+ 'if (!msg->%(name)s_set)',
+ ' return (-1);' ]
+ code = TranslateList(code, entry.GetTranslation())
+ self.PrintIndented(
+ file, ' ', code)
+
+ self.PrintIndented(
+ file, ' ',
+ entry.CodeComplete('msg', entry.GetVarName('msg')))
+ print >>file, (
+ ' return (0);\n'
+ '}\n' )
+
+ # Complete message unmarshaling
+ print >>file, (
+ 'int\n'
+ 'evtag_unmarshal_%(name)s(struct evbuffer *evbuf, '
+ 'ev_uint32_t need_tag, struct %(name)s *msg)\n'
+ '{\n'
+ ' ev_uint32_t tag;\n'
+ ' int res = -1;\n'
+ '\n'
+ ' struct evbuffer *tmp = evbuffer_new();\n'
+ '\n'
+ ' if (evtag_unmarshal(evbuf, &tag, tmp) == -1'
+ ' || tag != need_tag)\n'
+ ' goto error;\n'
+ '\n'
+ ' if (%(name)s_unmarshal(msg, tmp) == -1)\n'
+ ' goto error;\n'
+ '\n'
+ ' res = 0;\n'
+ '\n'
+ ' error:\n'
+ ' evbuffer_free(tmp);\n'
+ ' return (res);\n'
+ '}\n' ) % { 'name' : self._name }
+
+ # Complete message marshaling
+ print >>file, (
+ 'void\n'
+ 'evtag_marshal_%(name)s(struct evbuffer *evbuf, ev_uint32_t tag, '
+ 'const struct %(name)s *msg)\n'
+ '{\n'
+ ' struct evbuffer *buf_ = evbuffer_new();\n'
+ ' assert(buf_ != NULL);\n'
+ ' %(name)s_marshal(buf_, msg);\n'
+ ' evtag_marshal_buffer(evbuf, tag, buf_);\n '
+ ' evbuffer_free(buf_);\n'
+ '}\n' ) % { 'name' : self._name }
+
+class Entry:
+ def __init__(self, type, name, tag):
+ self._type = type
+ self._name = name
+ self._tag = int(tag)
+ self._ctype = type
+ self._optional = 0
+ self._can_be_array = 0
+ self._array = 0
+ self._line_count = -1
+ self._struct = None
+ self._refname = None
+
+ self._optpointer = True
+ self._optaddarg = True
+
+ def GetInitializer(self):
+ assert 0, "Entry does not provide initializer"
+
+ def SetStruct(self, struct):
+ self._struct = struct
+
+ def LineCount(self):
+ assert self._line_count != -1
+ return self._line_count
+
+ def SetLineCount(self, number):
+ self._line_count = number
+
+ def Array(self):
+ return self._array
+
+ def Optional(self):
+ return self._optional
+
+ def Tag(self):
+ return self._tag
+
+ def Name(self):
+ return self._name
+
+ def Type(self):
+ return self._type
+
+ def MakeArray(self, yes=1):
+ self._array = yes
+
+ def MakeOptional(self):
+ self._optional = 1
+
+ def Verify(self):
+ if self.Array() and not self._can_be_array:
+ raise RpcGenError(
+ 'Entry "%s" cannot be created as an array '
+ 'around line %d' % (self._name, self.LineCount()))
+ if not self._struct:
+ raise RpcGenError(
+ 'Entry "%s" does not know which struct it belongs to '
+ 'around line %d' % (self._name, self.LineCount()))
+ if self._optional and self._array:
+ raise RpcGenError(
+ 'Entry "%s" has illegal combination of optional and array '
+ 'around line %d' % (self._name, self.LineCount()))
+
+ def GetTranslation(self, extradict = {}):
+ mapping = {
+ "parent_name" : self._struct.Name(),
+ "name" : self._name,
+ "ctype" : self._ctype,
+ "refname" : self._refname,
+ "optpointer" : self._optpointer and "*" or "",
+ "optreference" : self._optpointer and "&" or "",
+ "optaddarg" :
+ self._optaddarg and ", const %s value" % self._ctype or ""
+ }
+ for (k, v) in extradict.items():
+ mapping[k] = v
+
+ return mapping
+
+ def GetVarName(self, var):
+ return '%(var)s->%(name)s_data' % self.GetTranslation({ 'var' : var })
+
+ def GetVarLen(self, var):
+ return 'sizeof(%s)' % self._ctype
+
+ def GetFuncName(self):
+ return '%s_%s_get' % (self._struct.Name(), self._name)
+
+ def GetDeclaration(self, funcname):
+ code = [ 'int %s(struct %s *, %s *);' % (
+ funcname, self._struct.Name(), self._ctype ) ]
+ return code
+
+ def CodeGet(self):
+ code = (
+ 'int',
+ '%(parent_name)s_%(name)s_get(struct %(parent_name)s *msg, '
+ '%(ctype)s *value)',
+ '{',
+ ' if (msg->%(name)s_set != 1)',
+ ' return (-1);',
+ ' *value = msg->%(name)s_data;',
+ ' return (0);',
+ '}' )
+ code = '\n'.join(code)
+ code = code % self.GetTranslation()
+ return code.split('\n')
+
+ def AssignFuncName(self):
+ return '%s_%s_assign' % (self._struct.Name(), self._name)
+
+ def AddFuncName(self):
+ return '%s_%s_add' % (self._struct.Name(), self._name)
+
+ def AssignDeclaration(self, funcname):
+ code = [ 'int %s(struct %s *, const %s);' % (
+ funcname, self._struct.Name(), self._ctype ) ]
+ return code
+
+ def CodeAssign(self):
+ code = [ 'int',
+ '%(parent_name)s_%(name)s_assign(struct %(parent_name)s *msg,'
+ ' const %(ctype)s value)',
+ '{',
+ ' msg->%(name)s_set = 1;',
+ ' msg->%(name)s_data = value;',
+ ' return (0);',
+ '}' ]
+ code = '\n'.join(code)
+ code = code % self.GetTranslation()
+ return code.split('\n')
+
+ def CodeClear(self, structname):
+ code = [ '%s->%s_set = 0;' % (structname, self.Name()) ]
+
+ return code
+
+ def CodeComplete(self, structname, var_name):
+ return []
+
+ def CodeFree(self, name):
+ return []
+
+ def CodeBase(self):
+ code = [
+ '%(parent_name)s_%(name)s_assign,',
+ '%(parent_name)s_%(name)s_get,'
+ ]
+ if self.Array():
+ code.append('%(parent_name)s_%(name)s_add,')
+
+ code = '\n'.join(code)
+ code = code % self.GetTranslation()
+ return code.split('\n')
+
+class EntryBytes(Entry):
+ def __init__(self, type, name, tag, length):
+ # Init base class
+ Entry.__init__(self, type, name, tag)
+
+ self._length = length
+ self._ctype = 'ev_uint8_t'
+
+ def GetInitializer(self):
+ return "NULL"
+
+ def GetVarLen(self, var):
+ return '(%s)' % self._length
+
+ def CodeArrayAdd(self, varname, value):
+ # XXX: copy here
+ return [ '%(varname)s = NULL;' % { 'varname' : varname } ]
+
+ def GetDeclaration(self, funcname):
+ code = [ 'int %s(struct %s *, %s **);' % (
+ funcname, self._struct.Name(), self._ctype ) ]
+ return code
+
+ def AssignDeclaration(self, funcname):
+ code = [ 'int %s(struct %s *, const %s *);' % (
+ funcname, self._struct.Name(), self._ctype ) ]
+ return code
+
+ def Declaration(self):
+ dcl = ['ev_uint8_t %s_data[%s];' % (self._name, self._length)]
+
+ return dcl
+
+ def CodeGet(self):
+ name = self._name
+ code = [ 'int',
+ '%s_%s_get(struct %s *msg, %s **value)' % (
+ self._struct.Name(), name,
+ self._struct.Name(), self._ctype),
+ '{',
+ ' if (msg->%s_set != 1)' % name,
+ ' return (-1);',
+ ' *value = msg->%s_data;' % name,
+ ' return (0);',
+ '}' ]
+ return code
+
+ def CodeAssign(self):
+ name = self._name
+ code = [ 'int',
+ '%s_%s_assign(struct %s *msg, const %s *value)' % (
+ self._struct.Name(), name,
+ self._struct.Name(), self._ctype),
+ '{',
+ ' msg->%s_set = 1;' % name,
+ ' memcpy(msg->%s_data, value, %s);' % (
+ name, self._length),
+ ' return (0);',
+ '}' ]
+ return code
+
+ def CodeUnmarshal(self, buf, tag_name, var_name, var_len):
+ code = [ 'if (evtag_unmarshal_fixed(%(buf)s, %(tag)s, '
+ '%(var)s, %(varlen)s) == -1) {',
+ ' event_warnx("%%s: failed to unmarshal %(name)s", __func__);',
+ ' return (-1);',
+ '}'
+ ]
+ return TranslateList(code,
+ self.GetTranslation({
+ 'var' : var_name,
+ 'varlen' : var_len,
+ 'buf' : buf,
+ 'tag' : tag_name }))
+
+ def CodeMarshal(self, buf, tag_name, var_name, var_len):
+ code = ['evtag_marshal(%s, %s, %s, %s);' % (
+ buf, tag_name, var_name, var_len)]
+ return code
+
+ def CodeClear(self, structname):
+ code = [ '%s->%s_set = 0;' % (structname, self.Name()),
+ 'memset(%s->%s_data, 0, sizeof(%s->%s_data));' % (
+ structname, self._name, structname, self._name)]
+
+ return code
+
+ def CodeInitialize(self, name):
+ code = ['memset(%s->%s_data, 0, sizeof(%s->%s_data));' % (
+ name, self._name, name, self._name)]
+ return code
+
+ def Verify(self):
+ if not self._length:
+ raise RpcGenError(
+ 'Entry "%s" needs a length '
+ 'around line %d' % (self._name, self.LineCount()))
+
+ Entry.Verify(self)
+
+class EntryInt(Entry):
+ def __init__(self, type, name, tag, bits=32):
+ # Init base class
+ Entry.__init__(self, type, name, tag)
+
+ self._can_be_array = 1
+ if bits == 32:
+ self._ctype = 'ev_uint32_t'
+ self._marshal_type = 'int'
+ if bits == 64:
+ self._ctype = 'ev_uint64_t'
+ self._marshal_type = 'int64'
+
+ def GetInitializer(self):
+ return "0"
+
+ def CodeArrayFree(self, var):
+ return []
+
+ def CodeArrayAssign(self, varname, srcvar):
+ return [ '%(varname)s = %(srcvar)s;' % { 'varname' : varname,
+ 'srcvar' : srcvar } ]
+
+ def CodeArrayAdd(self, varname, value):
+ """Returns a new entry of this type."""
+ return [ '%(varname)s = %(value)s;' % { 'varname' : varname,
+ 'value' : value } ]
+
+ def CodeUnmarshal(self, buf, tag_name, var_name, var_len):
+ code = [
+ 'if (evtag_unmarshal_%(ma)s(%(buf)s, %(tag)s, &%(var)s) == -1) {',
+ ' event_warnx("%%s: failed to unmarshal %(name)s", __func__);',
+ ' return (-1);',
+ '}' ]
+ code = '\n'.join(code) % self.GetTranslation({
+ 'ma' : self._marshal_type,
+ 'buf' : buf,
+ 'tag' : tag_name,
+ 'var' : var_name })
+ return code.split('\n')
+
+ def CodeMarshal(self, buf, tag_name, var_name, var_len):
+ code = [
+ 'evtag_marshal_%s(%s, %s, %s);' % (
+ self._marshal_type, buf, tag_name, var_name)]
+ return code
+
+ def Declaration(self):
+ dcl = ['%s %s_data;' % (self._ctype, self._name)]
+
+ return dcl
+
+ def CodeInitialize(self, name):
+ code = ['%s->%s_data = 0;' % (name, self._name)]
+ return code
+
+class EntryString(Entry):
+ def __init__(self, type, name, tag):
+ # Init base class
+ Entry.__init__(self, type, name, tag)
+
+ self._can_be_array = 1
+ self._ctype = 'char *'
+
+ def GetInitializer(self):
+ return "NULL"
+
+ def CodeArrayFree(self, varname):
+ code = [
+ 'if (%(var)s != NULL) free(%(var)s);' ]
+
+ return TranslateList(code, { 'var' : varname })
+
+ def CodeArrayAssign(self, varname, srcvar):
+ code = [
+ 'if (%(var)s != NULL)',
+ ' free(%(var)s);',
+ '%(var)s = strdup(%(srcvar)s);',
+ 'if (%(var)s == NULL) {',
+ ' event_warnx("%%s: strdup", __func__);',
+ ' return (-1);',
+ '}' ]
+
+ return TranslateList(code, { 'var' : varname,
+ 'srcvar' : srcvar })
+
+ def CodeArrayAdd(self, varname, value):
+ code = [
+ 'if (%(value)s != NULL) {',
+ ' %(var)s = strdup(%(value)s);',
+ ' if (%(var)s == NULL) {',
+ ' goto error;',
+ ' }',
+ '} else {',
+ ' %(var)s = NULL;',
+ '}' ]
+
+ return TranslateList(code, { 'var' : varname,
+ 'value' : value })
+
+ def GetVarLen(self, var):
+ return 'strlen(%s)' % self.GetVarName(var)
+
+ def CodeMakeInitalize(self, varname):
+ return '%(varname)s = NULL;' % { 'varname' : varname }
+
+ def CodeAssign(self):
+ name = self._name
+ code = """int
+%(parent_name)s_%(name)s_assign(struct %(parent_name)s *msg,
+ const %(ctype)s value)
+{
+ if (msg->%(name)s_data != NULL)
+ free(msg->%(name)s_data);
+ if ((msg->%(name)s_data = strdup(value)) == NULL)
+ return (-1);
+ msg->%(name)s_set = 1;
+ return (0);
+}""" % self.GetTranslation()
+
+ return code.split('\n')
+
+ def CodeUnmarshal(self, buf, tag_name, var_name, var_len):
+ code = ['if (evtag_unmarshal_string(%(buf)s, %(tag)s, &%(var)s) == -1) {',
+ ' event_warnx("%%s: failed to unmarshal %(name)s", __func__);',
+ ' return (-1);',
+ '}'
+ ]
+ code = '\n'.join(code) % self.GetTranslation({
+ 'buf' : buf,
+ 'tag' : tag_name,
+ 'var' : var_name })
+ return code.split('\n')
+
+ def CodeMarshal(self, buf, tag_name, var_name, var_len):
+ code = ['evtag_marshal_string(%s, %s, %s);' % (
+ buf, tag_name, var_name)]
+ return code
+
+ def CodeClear(self, structname):
+ code = [ 'if (%s->%s_set == 1) {' % (structname, self.Name()),
+ ' free(%s->%s_data);' % (structname, self.Name()),
+ ' %s->%s_data = NULL;' % (structname, self.Name()),
+ ' %s->%s_set = 0;' % (structname, self.Name()),
+ '}'
+ ]
+
+ return code
+
+ def CodeInitialize(self, name):
+ code = ['%s->%s_data = NULL;' % (name, self._name)]
+ return code
+
+ def CodeFree(self, name):
+ code = ['if (%s->%s_data != NULL)' % (name, self._name),
+ ' free (%s->%s_data);' % (name, self._name)]
+
+ return code
+
+ def Declaration(self):
+ dcl = ['char *%s_data;' % self._name]
+
+ return dcl
+
+class EntryStruct(Entry):
+ def __init__(self, type, name, tag, refname):
+ # Init base class
+ Entry.__init__(self, type, name, tag)
+
+ self._optpointer = False
+ self._can_be_array = 1
+ self._refname = refname
+ self._ctype = 'struct %s*' % refname
+ self._optaddarg = False
+
+ def GetInitializer(self):
+ return "NULL"
+
+ def GetVarLen(self, var):
+ return '-1'
+
+ def CodeArrayAdd(self, varname, value):
+ code = [
+ '%(varname)s = %(refname)s_new();',
+ 'if (%(varname)s == NULL)',
+ ' goto error;' ]
+
+ return TranslateList(code, self.GetTranslation({ 'varname' : varname }))
+
+ def CodeArrayFree(self, var):
+ code = [ '%(refname)s_free(%(var)s);' % self.GetTranslation(
+ { 'var' : var }) ]
+ return code
+
+ def CodeArrayAssign(self, var, srcvar):
+ code = [
+ 'int had_error = 0;',
+ 'struct evbuffer *tmp = NULL;',
+ '%(refname)s_clear(%(var)s);',
+ 'if ((tmp = evbuffer_new()) == NULL) {',
+ ' event_warn("%%s: evbuffer_new()", __func__);',
+ ' had_error = 1;',
+ ' goto done;',
+ '}',
+ '%(refname)s_marshal(tmp, %(srcvar)s);',
+ 'if (%(refname)s_unmarshal(%(var)s, tmp) == -1) {',
+ ' event_warnx("%%s: %(refname)s_unmarshal", __func__);',
+ ' had_error = 1;',
+ ' goto done;',
+ '}',
+ 'done:'
+ 'if (tmp != NULL)',
+ ' evbuffer_free(tmp);',
+ 'if (had_error) {',
+ ' %(refname)s_clear(%(var)s);',
+ ' return (-1);',
+ '}' ]
+
+ return TranslateList(code, self.GetTranslation({
+ 'var' : var,
+ 'srcvar' : srcvar}))
+
+ def CodeGet(self):
+ name = self._name
+ code = [ 'int',
+ '%s_%s_get(struct %s *msg, %s *value)' % (
+ self._struct.Name(), name,
+ self._struct.Name(), self._ctype),
+ '{',
+ ' if (msg->%s_set != 1) {' % name,
+ ' msg->%s_data = %s_new();' % (name, self._refname),
+ ' if (msg->%s_data == NULL)' % name,
+ ' return (-1);',
+ ' msg->%s_set = 1;' % name,
+ ' }',
+ ' *value = msg->%s_data;' % name,
+ ' return (0);',
+ '}' ]
+ return code
+
+ def CodeAssign(self):
+ name = self._name
+ code = """int
+%(parent_name)s_%(name)s_assign(struct %(parent_name)s *msg,
+ const %(ctype)s value)
+{
+ struct evbuffer *tmp = NULL;
+ if (msg->%(name)s_set) {
+ %(refname)s_clear(msg->%(name)s_data);
+ msg->%(name)s_set = 0;
+ } else {
+ msg->%(name)s_data = %(refname)s_new();
+ if (msg->%(name)s_data == NULL) {
+ event_warn("%%s: %(refname)s_new()", __func__);
+ goto error;
+ }
+ }
+ if ((tmp = evbuffer_new()) == NULL) {
+ event_warn("%%s: evbuffer_new()", __func__);
+ goto error;
+ }
+ %(refname)s_marshal(tmp, value);
+ if (%(refname)s_unmarshal(msg->%(name)s_data, tmp) == -1) {
+ event_warnx("%%s: %(refname)s_unmarshal", __func__);
+ goto error;
+ }
+ msg->%(name)s_set = 1;
+ evbuffer_free(tmp);
+ return (0);
+ error:
+ if (tmp != NULL)
+ evbuffer_free(tmp);
+ if (msg->%(name)s_data != NULL) {
+ %(refname)s_free(msg->%(name)s_data);
+ msg->%(name)s_data = NULL;
+ }
+ return (-1);
+}""" % self.GetTranslation()
+ return code.split('\n')
+
+ def CodeComplete(self, structname, var_name):
+ code = [ 'if (%(structname)s->%(name)s_set && '
+ '%(refname)s_complete(%(var)s) == -1)',
+ ' return (-1);' ]
+
+ return TranslateList(code, self.GetTranslation({
+ 'structname' : structname,
+ 'var' : var_name }))
+
+ def CodeUnmarshal(self, buf, tag_name, var_name, var_len):
+ code = ['%(var)s = %(refname)s_new();',
+ 'if (%(var)s == NULL)',
+ ' return (-1);',
+ 'if (evtag_unmarshal_%(refname)s(%(buf)s, %(tag)s, '
+ '%(var)s) == -1) {',
+ ' event_warnx("%%s: failed to unmarshal %(name)s", __func__);',
+ ' return (-1);',
+ '}'
+ ]
+ code = '\n'.join(code) % self.GetTranslation({
+ 'buf' : buf,
+ 'tag' : tag_name,
+ 'var' : var_name })
+ return code.split('\n')
+
+ def CodeMarshal(self, buf, tag_name, var_name, var_len):
+ code = ['evtag_marshal_%s(%s, %s, %s);' % (
+ self._refname, buf, tag_name, var_name)]
+ return code
+
+ def CodeClear(self, structname):
+ code = [ 'if (%s->%s_set == 1) {' % (structname, self.Name()),
+ ' %s_free(%s->%s_data);' % (
+ self._refname, structname, self.Name()),
+ ' %s->%s_data = NULL;' % (structname, self.Name()),
+ ' %s->%s_set = 0;' % (structname, self.Name()),
+ '}'
+ ]
+
+ return code
+
+ def CodeInitialize(self, name):
+ code = ['%s->%s_data = NULL;' % (name, self._name)]
+ return code
+
+ def CodeFree(self, name):
+ code = ['if (%s->%s_data != NULL)' % (name, self._name),
+ ' %s_free(%s->%s_data);' % (
+ self._refname, name, self._name)]
+
+ return code
+
+ def Declaration(self):
+ dcl = ['%s %s_data;' % (self._ctype, self._name)]
+
+ return dcl
+
+class EntryVarBytes(Entry):
+ def __init__(self, type, name, tag):
+ # Init base class
+ Entry.__init__(self, type, name, tag)
+
+ self._ctype = 'ev_uint8_t *'
+
+ def GetInitializer(self):
+ return "NULL"
+
+ def GetVarLen(self, var):
+ return '%(var)s->%(name)s_length' % self.GetTranslation({ 'var' : var })
+
+ def CodeArrayAdd(self, varname, value):
+ # xxx: copy
+ return [ '%(varname)s = NULL;' % { 'varname' : varname } ]
+
+ def GetDeclaration(self, funcname):
+ code = [ 'int %s(struct %s *, %s *, ev_uint32_t *);' % (
+ funcname, self._struct.Name(), self._ctype ) ]
+ return code
+
+ def AssignDeclaration(self, funcname):
+ code = [ 'int %s(struct %s *, const %s, ev_uint32_t);' % (
+ funcname, self._struct.Name(), self._ctype ) ]
+ return code
+
+ def CodeAssign(self):
+ name = self._name
+ code = [ 'int',
+ '%s_%s_assign(struct %s *msg, '
+ 'const %s value, ev_uint32_t len)' % (
+ self._struct.Name(), name,
+ self._struct.Name(), self._ctype),
+ '{',
+ ' if (msg->%s_data != NULL)' % name,
+ ' free (msg->%s_data);' % name,
+ ' msg->%s_data = malloc(len);' % name,
+ ' if (msg->%s_data == NULL)' % name,
+ ' return (-1);',
+ ' msg->%s_set = 1;' % name,
+ ' msg->%s_length = len;' % name,
+ ' memcpy(msg->%s_data, value, len);' % name,
+ ' return (0);',
+ '}' ]
+ return code
+
+ def CodeGet(self):
+ name = self._name
+ code = [ 'int',
+ '%s_%s_get(struct %s *msg, %s *value, ev_uint32_t *plen)' % (
+ self._struct.Name(), name,
+ self._struct.Name(), self._ctype),
+ '{',
+ ' if (msg->%s_set != 1)' % name,
+ ' return (-1);',
+ ' *value = msg->%s_data;' % name,
+ ' *plen = msg->%s_length;' % name,
+ ' return (0);',
+ '}' ]
+ return code
+
+ def CodeUnmarshal(self, buf, tag_name, var_name, var_len):
+ code = ['if (evtag_payload_length(%(buf)s, &%(varlen)s) == -1)',
+ ' return (-1);',
+ # We do not want DoS opportunities
+ 'if (%(varlen)s > evbuffer_get_length(%(buf)s))',
+ ' return (-1);',
+ 'if ((%(var)s = malloc(%(varlen)s)) == NULL)',
+ ' return (-1);',
+ 'if (evtag_unmarshal_fixed(%(buf)s, %(tag)s, %(var)s, '
+ '%(varlen)s) == -1) {',
+ ' event_warnx("%%s: failed to unmarshal %(name)s", __func__);',
+ ' return (-1);',
+ '}'
+ ]
+ code = '\n'.join(code) % self.GetTranslation({
+ 'buf' : buf,
+ 'tag' : tag_name,
+ 'var' : var_name,
+ 'varlen' : var_len })
+ return code.split('\n')
+
+ def CodeMarshal(self, buf, tag_name, var_name, var_len):
+ code = ['evtag_marshal(%s, %s, %s, %s);' % (
+ buf, tag_name, var_name, var_len)]
+ return code
+
+ def CodeClear(self, structname):
+ code = [ 'if (%s->%s_set == 1) {' % (structname, self.Name()),
+ ' free (%s->%s_data);' % (structname, self.Name()),
+ ' %s->%s_data = NULL;' % (structname, self.Name()),
+ ' %s->%s_length = 0;' % (structname, self.Name()),
+ ' %s->%s_set = 0;' % (structname, self.Name()),
+ '}'
+ ]
+
+ return code
+
+ def CodeInitialize(self, name):
+ code = ['%s->%s_data = NULL;' % (name, self._name),
+ '%s->%s_length = 0;' % (name, self._name) ]
+ return code
+
+ def CodeFree(self, name):
+ code = ['if (%s->%s_data != NULL)' % (name, self._name),
+ ' free(%s->%s_data);' % (name, self._name)]
+
+ return code
+
+ def Declaration(self):
+ dcl = ['ev_uint8_t *%s_data;' % self._name,
+ 'ev_uint32_t %s_length;' % self._name]
+
+ return dcl
+
+class EntryArray(Entry):
+ def __init__(self, entry):
+ # Init base class
+ Entry.__init__(self, entry._type, entry._name, entry._tag)
+
+ self._entry = entry
+ self._refname = entry._refname
+ self._ctype = self._entry._ctype
+ self._optional = True
+ self._optpointer = self._entry._optpointer
+ self._optaddarg = self._entry._optaddarg
+
+ # provide a new function for accessing the variable name
+ def GetVarName(var_name):
+ return '%(var)s->%(name)s_data[%(index)s]' % \
+ self._entry.GetTranslation({'var' : var_name,
+ 'index' : self._index})
+ self._entry.GetVarName = GetVarName
+
+ def GetInitializer(self):
+ return "NULL"
+
+ def GetVarName(self, var_name):
+ return var_name
+
+ def GetVarLen(self, var_name):
+ return '-1'
+
+ def GetDeclaration(self, funcname):
+ """Allows direct access to elements of the array."""
+ code = [
+ 'int %(funcname)s(struct %(parent_name)s *, int, %(ctype)s *);' %
+ self.GetTranslation({ 'funcname' : funcname }) ]
+ return code
+
+ def AssignDeclaration(self, funcname):
+ code = [ 'int %s(struct %s *, int, const %s);' % (
+ funcname, self._struct.Name(), self._ctype ) ]
+ return code
+
+ def AddDeclaration(self, funcname):
+ code = [
+ '%(ctype)s %(optpointer)s '
+ '%(funcname)s(struct %(parent_name)s *msg%(optaddarg)s);' % \
+ self.GetTranslation({ 'funcname' : funcname }) ]
+ return code
+
+ def CodeGet(self):
+ code = """int
+%(parent_name)s_%(name)s_get(struct %(parent_name)s *msg, int offset,
+ %(ctype)s *value)
+{
+ if (!msg->%(name)s_set || offset < 0 || offset >= msg->%(name)s_length)
+ return (-1);
+ *value = msg->%(name)s_data[offset];
+ return (0);
+}""" % self.GetTranslation()
+
+ return code.split('\n')
+
+ def CodeAssign(self):
+ code = [
+ 'int',
+ '%(parent_name)s_%(name)s_assign(struct %(parent_name)s *msg, int off,',
+ ' const %(ctype)s value)',
+ '{',
+ ' if (!msg->%(name)s_set || off < 0 || off >= msg->%(name)s_length)',
+ ' return (-1);\n',
+ ' {' ]
+ code = TranslateList(code, self.GetTranslation())
+
+ codearrayassign = self._entry.CodeArrayAssign(
+ 'msg->%(name)s_data[off]' % self.GetTranslation(), 'value')
+ code += map(lambda x: ' ' + x, codearrayassign)
+
+ code += TranslateList([
+ ' }',
+ ' return (0);',
+ '}' ], self.GetTranslation())
+
+ return code
+
+ def CodeAdd(self):
+ codearrayadd = self._entry.CodeArrayAdd(
+ 'msg->%(name)s_data[msg->%(name)s_length - 1]' % self.GetTranslation(),
+ 'value')
+ code = [
+ 'static int',
+ '%(parent_name)s_%(name)s_expand_to_hold_more('
+ 'struct %(parent_name)s *msg)',
+ '{',
+ ' int tobe_allocated = msg->%(name)s_num_allocated;',
+ ' %(ctype)s* new_data = NULL;',
+ ' tobe_allocated = !tobe_allocated ? 1 : tobe_allocated << 1;',
+ ' new_data = (%(ctype)s*) realloc(msg->%(name)s_data,',
+ ' tobe_allocated * sizeof(%(ctype)s));',
+ ' if (new_data == NULL)',
+ ' return -1;',
+ ' msg->%(name)s_data = new_data;',
+ ' msg->%(name)s_num_allocated = tobe_allocated;',
+ ' return 0;'
+ '}',
+ '',
+ '%(ctype)s %(optpointer)s',
+ '%(parent_name)s_%(name)s_add('
+ 'struct %(parent_name)s *msg%(optaddarg)s)',
+ '{',
+ ' if (++msg->%(name)s_length >= msg->%(name)s_num_allocated) {',
+ ' if (%(parent_name)s_%(name)s_expand_to_hold_more(msg)<0)',
+ ' goto error;',
+ ' }' ]
+
+ code = TranslateList(code, self.GetTranslation())
+
+ code += map(lambda x: ' ' + x, codearrayadd)
+
+ code += TranslateList([
+ ' msg->%(name)s_set = 1;',
+ ' return %(optreference)s(msg->%(name)s_data['
+ 'msg->%(name)s_length - 1]);',
+ 'error:',
+ ' --msg->%(name)s_length;',
+ ' return (NULL);',
+ '}' ], self.GetTranslation())
+
+ return code
+
+ def CodeComplete(self, structname, var_name):
+ self._index = 'i'
+ tmp = self._entry.CodeComplete(structname, self._entry.GetVarName(var_name))
+ # skip the whole loop if there is nothing to check
+ if not tmp:
+ return []
+
+ translate = self.GetTranslation({ 'structname' : structname })
+ code = [
+ '{',
+ ' int i;',
+ ' for (i = 0; i < %(structname)s->%(name)s_length; ++i) {' ]
+
+ code = TranslateList(code, translate)
+
+ code += map(lambda x: ' ' + x, tmp)
+
+ code += [
+ ' }',
+ '}' ]
+
+ return code
+
+ def CodeUnmarshal(self, buf, tag_name, var_name, var_len):
+ translate = self.GetTranslation({ 'var' : var_name,
+ 'buf' : buf,
+ 'tag' : tag_name,
+ 'init' : self._entry.GetInitializer()})
+ code = [
+ 'if (%(var)s->%(name)s_length >= %(var)s->%(name)s_num_allocated &&',
+ ' %(parent_name)s_%(name)s_expand_to_hold_more(%(var)s) < 0) {',
+ ' puts("HEY NOW");',
+ ' return (-1);',
+ '}']
+
+ # the unmarshal code directly returns
+ code = TranslateList(code, translate)
+
+ self._index = '%(var)s->%(name)s_length' % translate
+ code += self._entry.CodeUnmarshal(buf, tag_name,
+ self._entry.GetVarName(var_name),
+ self._entry.GetVarLen(var_name))
+
+ code += [ '++%(var)s->%(name)s_length;' % translate ]
+
+ return code
+
+ def CodeMarshal(self, buf, tag_name, var_name, var_len):
+ code = ['{',
+ ' int i;',
+ ' for (i = 0; i < %(var)s->%(name)s_length; ++i) {' ]
+
+ self._index = 'i'
+ code += self._entry.CodeMarshal(buf, tag_name,
+ self._entry.GetVarName(var_name),
+ self._entry.GetVarLen(var_name))
+ code += [' }',
+ '}'
+ ]
+
+ code = "\n".join(code) % self.GetTranslation({ 'var' : var_name })
+
+ return code.split('\n')
+
+ def CodeClear(self, structname):
+ translate = self.GetTranslation({ 'structname' : structname })
+ codearrayfree = self._entry.CodeArrayFree(
+ '%(structname)s->%(name)s_data[i]' % self.GetTranslation(
+ { 'structname' : structname } ))
+
+ code = [ 'if (%(structname)s->%(name)s_set == 1) {' ]
+
+ if codearrayfree:
+ code += [
+ ' int i;',
+ ' for (i = 0; i < %(structname)s->%(name)s_length; ++i) {' ]
+
+ code = TranslateList(code, translate)
+
+ if codearrayfree:
+ code += map(lambda x: ' ' + x, codearrayfree)
+ code += [
+ ' }' ]
+
+ code += TranslateList([
+ ' free(%(structname)s->%(name)s_data);',
+ ' %(structname)s->%(name)s_data = NULL;',
+ ' %(structname)s->%(name)s_set = 0;',
+ ' %(structname)s->%(name)s_length = 0;',
+ ' %(structname)s->%(name)s_num_allocated = 0;',
+ '}'
+ ], translate)
+
+ return code
+
+ def CodeInitialize(self, name):
+ code = ['%s->%s_data = NULL;' % (name, self._name),
+ '%s->%s_length = 0;' % (name, self._name),
+ '%s->%s_num_allocated = 0;' % (name, self._name)]
+ return code
+
+ def CodeFree(self, structname):
+ code = self.CodeClear(structname);
+
+ code += TranslateList([
+ 'free(%(structname)s->%(name)s_data);' ],
+ self.GetTranslation({'structname' : structname }))
+
+ return code
+
+ def Declaration(self):
+ dcl = ['%s *%s_data;' % (self._ctype, self._name),
+ 'int %s_length;' % self._name,
+ 'int %s_num_allocated;' % self._name ]
+
+ return dcl
+
+def NormalizeLine(line):
+ global white
+ global cppcomment
+
+ line = cppcomment.sub('', line)
+ line = line.strip()
+ line = white.sub(' ', line)
+
+ return line
+
+def ProcessOneEntry(factory, newstruct, entry):
+ optional = 0
+ array = 0
+ entry_type = ''
+ name = ''
+ tag = ''
+ tag_set = None
+ separator = ''
+ fixed_length = ''
+
+ tokens = entry.split(' ')
+ while tokens:
+ token = tokens[0]
+ tokens = tokens[1:]
+
+ if not entry_type:
+ if not optional and token == 'optional':
+ optional = 1
+ continue
+
+ if not array and token == 'array':
+ array = 1
+ continue
+
+ if not entry_type:
+ entry_type = token
+ continue
+
+ if not name:
+ res = re.match(r'^([^\[\]]+)(\[.*\])?$', token)
+ if not res:
+ raise RpcGenError(
+ 'Cannot parse name: \"%s\" '
+ 'around line %d' % (entry, line_count))
+ name = res.group(1)
+ fixed_length = res.group(2)
+ if fixed_length:
+ fixed_length = fixed_length[1:-1]
+ continue
+
+ if not separator:
+ separator = token
+ if separator != '=':
+ raise RpcGenError('Expected "=" after name \"%s\" got %s'
+ % (name, token))
+ continue
+
+ if not tag_set:
+ tag_set = 1
+ if not re.match(r'^(0x)?[0-9]+$', token):
+ raise RpcGenError('Expected tag number: \"%s\"' % entry)
+ tag = int(token, 0)
+ continue
+
+ raise RpcGenError('Cannot parse \"%s\"' % entry)
+
+ if not tag_set:
+ raise RpcGenError('Need tag number: \"%s\"' % entry)
+
+ # Create the right entry
+ if entry_type == 'bytes':
+ if fixed_length:
+ newentry = factory.EntryBytes(entry_type, name, tag, fixed_length)
+ else:
+ newentry = factory.EntryVarBytes(entry_type, name, tag)
+ elif entry_type == 'int' and not fixed_length:
+ newentry = factory.EntryInt(entry_type, name, tag)
+ elif entry_type == 'int64' and not fixed_length:
+ newentry = factory.EntryInt(entry_type, name, tag, bits=64)
+ elif entry_type == 'string' and not fixed_length:
+ newentry = factory.EntryString(entry_type, name, tag)
+ else:
+ res = structref.match(entry_type)
+ if res:
+ # References another struct defined in our file
+ newentry = factory.EntryStruct(entry_type, name, tag, res.group(1))
+ else:
+ raise RpcGenError('Bad type: "%s" in "%s"' % (entry_type, entry))
+
+ structs = []
+
+ if optional:
+ newentry.MakeOptional()
+ if array:
+ newentry.MakeArray()
+
+ newentry.SetStruct(newstruct)
+ newentry.SetLineCount(line_count)
+ newentry.Verify()
+
+ if array:
+ # We need to encapsulate this entry into a struct
+ newname = newentry.Name()+ '_array'
+
+ # Now borgify the new entry.
+ newentry = factory.EntryArray(newentry)
+ newentry.SetStruct(newstruct)
+ newentry.SetLineCount(line_count)
+ newentry.MakeArray()
+
+ newstruct.AddEntry(newentry)
+
+ return structs
+
+def ProcessStruct(factory, data):
+ tokens = data.split(' ')
+
+ # First three tokens are: 'struct' 'name' '{'
+ newstruct = factory.Struct(tokens[1])
+
+ inside = ' '.join(tokens[3:-1])
+
+ tokens = inside.split(';')
+
+ structs = []
+
+ for entry in tokens:
+ entry = NormalizeLine(entry)
+ if not entry:
+ continue
+
+ # It's possible that new structs get defined in here
+ structs.extend(ProcessOneEntry(factory, newstruct, entry))
+
+ structs.append(newstruct)
+ return structs
+
+def GetNextStruct(file):
+ global line_count
+ global cppdirect
+
+ got_struct = 0
+
+ processed_lines = []
+
+ have_c_comment = 0
+ data = ''
+ while 1:
+ line = file.readline()
+ if not line:
+ break
+
+ line_count += 1
+ line = line[:-1]
+
+ if not have_c_comment and re.search(r'/\*', line):
+ if re.search(r'/\*.*?\*/', line):
+ line = re.sub(r'/\*.*?\*/', '', line)
+ else:
+ line = re.sub(r'/\*.*$', '', line)
+ have_c_comment = 1
+
+ if have_c_comment:
+ if not re.search(r'\*/', line):
+ continue
+ have_c_comment = 0
+ line = re.sub(r'^.*\*/', '', line)
+
+ line = NormalizeLine(line)
+
+ if not line:
+ continue
+
+ if not got_struct:
+ if re.match(r'#include ["<].*[>"]', line):
+ cppdirect.append(line)
+ continue
+
+ if re.match(r'^#(if( |def)|endif)', line):
+ cppdirect.append(line)
+ continue
+
+ if re.match(r'^#define', line):
+ headerdirect.append(line)
+ continue
+
+ if not structdef.match(line):
+ raise RpcGenError('Missing struct on line %d: %s'
+ % (line_count, line))
+ else:
+ got_struct = 1
+ data += line
+ continue
+
+ # We are inside the struct
+ tokens = line.split('}')
+ if len(tokens) == 1:
+ data += ' ' + line
+ continue
+
+ if len(tokens[1]):
+ raise RpcGenError('Trailing garbage after struct on line %d'
+ % line_count)
+
+ # We found the end of the struct
+ data += ' %s}' % tokens[0]
+ break
+
+ # Remove any comments, that might be in there
+ data = re.sub(r'/\*.*\*/', '', data)
+
+ return data
+
+
+def Parse(factory, file):
+ """
+ Parses the input file and returns C code and corresponding header file.
+ """
+
+ entities = []
+
+ while 1:
+ # Just gets the whole struct nicely formatted
+ data = GetNextStruct(file)
+
+ if not data:
+ break
+
+ entities.extend(ProcessStruct(factory, data))
+
+ return entities
+
+class CCodeGenerator:
+ def __init__(self):
+ pass
+
+ def GuardName(self, name):
+ # Use the complete provided path to the input file, with all
+ # non-identifier characters replaced with underscores, to
+ # reduce the chance of a collision between guard macros.
+ return 'EVENT_RPCOUT_' + nonident.sub('_', name).upper() + '_'
+
+ def HeaderPreamble(self, name):
+ guard = self.GuardName(name)
+ pre = (
+ '/*\n'
+ ' * Automatically generated from %s\n'
+ ' */\n\n'
+ '#ifndef %s\n'
+ '#define %s\n\n' ) % (
+ name, guard, guard)
+
+ for statement in headerdirect:
+ pre += '%s\n' % statement
+ if headerdirect:
+ pre += '\n'
+
+ pre += (
+ '#include <event2/util.h> /* for ev_uint*_t */\n'
+ '#include <event2/rpc.h>\n'
+ )
+
+ return pre
+
+ def HeaderPostamble(self, name):
+ guard = self.GuardName(name)
+ return '#endif /* %s */' % guard
+
+ def BodyPreamble(self, name, header_file):
+ global _NAME
+ global _VERSION
+
+ slash = header_file.rfind('/')
+ if slash != -1:
+ header_file = header_file[slash+1:]
+
+ pre = ( '/*\n'
+ ' * Automatically generated from %s\n'
+ ' * by %s/%s. DO NOT EDIT THIS FILE.\n'
+ ' */\n\n' ) % (name, _NAME, _VERSION)
+ pre += ( '#include <stdlib.h>\n'
+ '#include <string.h>\n'
+ '#include <assert.h>\n'
+ '#include <event2/event-config.h>\n'
+ '#include <event2/event.h>\n'
+ '#include <event2/buffer.h>\n'
+ '#include <event2/tag.h>\n\n'
+ '#ifdef EVENT____func__\n'
+ '#define __func__ EVENT____func__\n'
+ '#endif\n\n'
+ )
+
+ for statement in cppdirect:
+ pre += '%s\n' % statement
+
+ pre += '\n#include "%s"\n\n' % header_file
+
+ pre += 'void event_warn(const char *fmt, ...);\n'
+ pre += 'void event_warnx(const char *fmt, ...);\n\n'
+
+ return pre
+
+ def HeaderFilename(self, filename):
+ return '.'.join(filename.split('.')[:-1]) + '.h'
+
+ def CodeFilename(self, filename):
+ return '.'.join(filename.split('.')[:-1]) + '.gen.c'
+
+ def Struct(self, name):
+ return StructCCode(name)
+
+ def EntryBytes(self, entry_type, name, tag, fixed_length):
+ return EntryBytes(entry_type, name, tag, fixed_length)
+
+ def EntryVarBytes(self, entry_type, name, tag):
+ return EntryVarBytes(entry_type, name, tag)
+
+ def EntryInt(self, entry_type, name, tag, bits=32):
+ return EntryInt(entry_type, name, tag, bits)
+
+ def EntryString(self, entry_type, name, tag):
+ return EntryString(entry_type, name, tag)
+
+ def EntryStruct(self, entry_type, name, tag, struct_name):
+ return EntryStruct(entry_type, name, tag, struct_name)
+
+ def EntryArray(self, entry):
+ return EntryArray(entry)
+
+class Usage(RpcGenError):
+ def __init__(self, argv0):
+ RpcGenError.__init__("usage: %s input.rpc [[output.h] output.c]"
+ % argv0)
+
+class CommandLine:
+ def __init__(self, argv):
+ """Initialize a command-line to launch event_rpcgen, as if
+ from a command-line with CommandLine(sys.argv). If you're
+ calling this directly, remember to provide a dummy value
+ for sys.argv[0]
+ """
+ self.filename = None
+ self.header_file = None
+ self.impl_file = None
+ self.factory = CCodeGenerator()
+
+ if len(argv) >= 2 and argv[1] == '--quiet':
+ global QUIETLY
+ QUIETLY = 1
+ del argv[1]
+
+ if len(argv) < 2 or len(argv) > 4:
+ raise Usage(argv[0])
+
+ self.filename = argv[1].replace('\\', '/')
+ if len(argv) == 3:
+ self.impl_file = argv[2].replace('\\', '/')
+ if len(argv) == 4:
+ self.header_file = argv[2].replace('\\', '/')
+ self.impl_file = argv[3].replace('\\', '/')
+
+ if not self.filename:
+ raise Usage(argv[0])
+
+ if not self.impl_file:
+ self.impl_file = self.factory.CodeFilename(self.filename)
+
+ if not self.header_file:
+ self.header_file = self.factory.HeaderFilename(self.impl_file)
+
+ if not self.impl_file.endswith('.c'):
+ raise RpcGenError("can only generate C implementation files")
+ if not self.header_file.endswith('.h'):
+ raise RpcGenError("can only generate C header files")
+
+ def run(self):
+ filename = self.filename
+ header_file = self.header_file
+ impl_file = self.impl_file
+ factory = self.factory
+
+ declare('Reading \"%s\"' % filename)
+
+ fp = open(filename, 'r')
+ entities = Parse(factory, fp)
+ fp.close()
+
+ declare('... creating "%s"' % header_file)
+ header_fp = open(header_file, 'w')
+ print >>header_fp, factory.HeaderPreamble(filename)
+
+ # Create forward declarations: allows other structs to reference
+ # each other
+ for entry in entities:
+ entry.PrintForwardDeclaration(header_fp)
+ print >>header_fp, ''
+
+ for entry in entities:
+ entry.PrintTags(header_fp)
+ entry.PrintDeclaration(header_fp)
+ print >>header_fp, factory.HeaderPostamble(filename)
+ header_fp.close()
+
+ declare('... creating "%s"' % impl_file)
+ impl_fp = open(impl_file, 'w')
+ print >>impl_fp, factory.BodyPreamble(filename, header_file)
+ for entry in entities:
+ entry.PrintCode(impl_fp)
+ impl_fp.close()
+
+if __name__ == '__main__':
+ try:
+ CommandLine(sys.argv).run()
+ sys.exit(0)
+
+ except RpcGenError, e:
+ print >>sys.stderr, e
+ sys.exit(1)
+
+ except EnvironmentError, e:
+ if e.filename and e.strerror:
+ print >>sys.stderr, "%s: %s" % (e.filename, e.strerror)
+ sys.exit(1)
+ elif e.strerror:
+ print >> sys.stderr, e.strerror
+ sys.exit(1)
+ else:
+ raise
diff --git a/protocols/Telegram/tgl/libevent/event_tagging.c b/protocols/Telegram/tgl/libevent/event_tagging.c
new file mode 100644
index 0000000000..6459dfa72e
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/event_tagging.c
@@ -0,0 +1,605 @@
+/*
+ * Copyright (c) 2003-2009 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef EVENT__HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
+#ifdef _WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <winsock2.h>
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#endif
+
+#ifdef EVENT__HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+#include <sys/queue.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifndef _WIN32
+#include <syslog.h>
+#endif
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <limits.h>
+
+#include "event2/event.h"
+#include "event2/tag.h"
+#include "event2/buffer.h"
+#include "log-internal.h"
+#include "mm-internal.h"
+#include "util-internal.h"
+
+/*
+ Here's our wire format:
+
+ Stream = TaggedData*
+
+ TaggedData = Tag Length Data
+ where the integer value of 'Length' is the length of 'data'.
+
+ Tag = HByte* LByte
+ where HByte is a byte with the high bit set, and LByte is a byte
+ with the high bit clear. The integer value of the tag is taken
+ by concatenating the lower 7 bits from all the tags. So for example,
+ the tag 0x66 is encoded as [66], whereas the tag 0x166 is encoded as
+ [82 66]
+
+ Length = Integer
+
+ Integer = NNibbles Nibble* Padding?
+ where NNibbles is a 4-bit value encoding the number of nibbles-1,
+ and each Nibble is 4 bits worth of encoded integer, in big-endian
+ order. If the total encoded integer size is an odd number of nibbles,
+ a final padding nibble with value 0 is appended.
+*/
+
+int evtag_decode_int(ev_uint32_t *pnumber, struct evbuffer *evbuf);
+int evtag_decode_int64(ev_uint64_t *pnumber, struct evbuffer *evbuf);
+int evtag_encode_tag(struct evbuffer *evbuf, ev_uint32_t tag);
+int evtag_decode_tag(ev_uint32_t *ptag, struct evbuffer *evbuf);
+
+void
+evtag_init(void)
+{
+}
+
+/*
+ * We encode integers by nibbles; the first nibble contains the number
+ * of significant nibbles - 1; this allows us to encode up to 64-bit
+ * integers. This function is byte-order independent.
+ *
+ * @param number a 32-bit unsigned integer to encode
+ * @param data a pointer to where the data should be written. Must
+ * have at least 5 bytes free.
+ * @return the number of bytes written into data.
+ */
+
+#define ENCODE_INT_INTERNAL(data, number) do { \
+ int off = 1, nibbles = 0; \
+ \
+ memset(data, 0, sizeof(number)+1); \
+ while (number) { \
+ if (off & 0x1) \
+ data[off/2] = (data[off/2] & 0xf0) | (number & 0x0f); \
+ else \
+ data[off/2] = (data[off/2] & 0x0f) | \
+ ((number & 0x0f) << 4); \
+ number >>= 4; \
+ off++; \
+ } \
+ \
+ if (off > 2) \
+ nibbles = off - 2; \
+ \
+ /* Off - 1 is the number of encoded nibbles */ \
+ data[0] = (data[0] & 0x0f) | ((nibbles & 0x0f) << 4); \
+ \
+ return ((off + 1) / 2); \
+} while (0)
+
+static inline int
+encode_int_internal(ev_uint8_t *data, ev_uint32_t number)
+{
+ ENCODE_INT_INTERNAL(data, number);
+}
+
+static inline int
+encode_int64_internal(ev_uint8_t *data, ev_uint64_t number)
+{
+ ENCODE_INT_INTERNAL(data, number);
+}
+
+void
+evtag_encode_int(struct evbuffer *evbuf, ev_uint32_t number)
+{
+ ev_uint8_t data[5];
+ int len = encode_int_internal(data, number);
+ evbuffer_add(evbuf, data, len);
+}
+
+void
+evtag_encode_int64(struct evbuffer *evbuf, ev_uint64_t number)
+{
+ ev_uint8_t data[9];
+ int len = encode_int64_internal(data, number);
+ evbuffer_add(evbuf, data, len);
+}
+
+/*
+ * Support variable length encoding of tags; we use the high bit in each
+ * octet as a continuation signal.
+ */
+
+int
+evtag_encode_tag(struct evbuffer *evbuf, ev_uint32_t tag)
+{
+ int bytes = 0;
+ ev_uint8_t data[5];
+
+ memset(data, 0, sizeof(data));
+ do {
+ ev_uint8_t lower = tag & 0x7f;
+ tag >>= 7;
+
+ if (tag)
+ lower |= 0x80;
+
+ data[bytes++] = lower;
+ } while (tag);
+
+ if (evbuf != NULL)
+ evbuffer_add(evbuf, data, bytes);
+
+ return (bytes);
+}
+
+static int
+decode_tag_internal(ev_uint32_t *ptag, struct evbuffer *evbuf, int dodrain)
+{
+ ev_uint32_t number = 0;
+ size_t len = evbuffer_get_length(evbuf);
+ ev_uint8_t *data;
+ size_t count = 0;
+ int shift = 0, done = 0;
+
+ /*
+ * the encoding of a number is at most one byte more than its
+ * storage size. however, it may also be much smaller.
+ */
+ data = evbuffer_pullup(
+ evbuf, len < sizeof(number) + 1 ? len : sizeof(number) + 1);
+ if (!data)
+ return (-1);
+
+ while (count++ < len) {
+ ev_uint8_t lower = *data++;
+ if (shift >= 28) {
+ /* Make sure it fits into 32 bits */
+ if (shift > 28)
+ return (-1);
+ if ((lower & 0x7f) > 15)
+ return (-1);
+ }
+ number |= (lower & (unsigned)0x7f) << shift;
+ shift += 7;
+
+ if (!(lower & 0x80)) {
+ done = 1;
+ break;
+ }
+ }
+
+ if (!done)
+ return (-1);
+
+ if (dodrain)
+ evbuffer_drain(evbuf, count);
+
+ if (ptag != NULL)
+ *ptag = number;
+
+ return count > INT_MAX ? INT_MAX : (int)(count);
+}
+
+int
+evtag_decode_tag(ev_uint32_t *ptag, struct evbuffer *evbuf)
+{
+ return (decode_tag_internal(ptag, evbuf, 1 /* dodrain */));
+}
+
+/*
+ * Marshal a data type, the general format is as follows:
+ *
+ * tag number: one byte; length: var bytes; payload: var bytes
+ */
+
+void
+evtag_marshal(struct evbuffer *evbuf, ev_uint32_t tag,
+ const void *data, ev_uint32_t len)
+{
+ evtag_encode_tag(evbuf, tag);
+ evtag_encode_int(evbuf, len);
+ evbuffer_add(evbuf, (void *)data, len);
+}
+
+void
+evtag_marshal_buffer(struct evbuffer *evbuf, ev_uint32_t tag,
+ struct evbuffer *data)
+{
+ evtag_encode_tag(evbuf, tag);
+ /* XXX support more than UINT32_MAX data */
+ evtag_encode_int(evbuf, (ev_uint32_t)evbuffer_get_length(data));
+ evbuffer_add_buffer(evbuf, data);
+}
+
+/* Marshaling for integers */
+void
+evtag_marshal_int(struct evbuffer *evbuf, ev_uint32_t tag, ev_uint32_t integer)
+{
+ ev_uint8_t data[5];
+ int len = encode_int_internal(data, integer);
+
+ evtag_encode_tag(evbuf, tag);
+ evtag_encode_int(evbuf, len);
+ evbuffer_add(evbuf, data, len);
+}
+
+void
+evtag_marshal_int64(struct evbuffer *evbuf, ev_uint32_t tag,
+ ev_uint64_t integer)
+{
+ ev_uint8_t data[9];
+ int len = encode_int64_internal(data, integer);
+
+ evtag_encode_tag(evbuf, tag);
+ evtag_encode_int(evbuf, len);
+ evbuffer_add(evbuf, data, len);
+}
+
+void
+evtag_marshal_string(struct evbuffer *buf, ev_uint32_t tag, const char *string)
+{
+ /* TODO support strings longer than UINT32_MAX ? */
+ evtag_marshal(buf, tag, string, (ev_uint32_t)strlen(string));
+}
+
+void
+evtag_marshal_timeval(struct evbuffer *evbuf, ev_uint32_t tag, struct timeval *tv)
+{
+ ev_uint8_t data[10];
+ int len = encode_int_internal(data, tv->tv_sec);
+ len += encode_int_internal(data + len, tv->tv_usec);
+ evtag_marshal(evbuf, tag, data, len);
+}
+
+#define DECODE_INT_INTERNAL(number, maxnibbles, pnumber, evbuf, offset) \
+do { \
+ ev_uint8_t *data; \
+ ev_ssize_t len = evbuffer_get_length(evbuf) - offset; \
+ int nibbles = 0; \
+ \
+ if (len <= 0) \
+ return (-1); \
+ \
+ /* XXX(niels): faster? */ \
+ data = evbuffer_pullup(evbuf, offset + 1) + offset; \
+ if (!data) \
+ return (-1); \
+ \
+ nibbles = ((data[0] & 0xf0) >> 4) + 1; \
+ if (nibbles > maxnibbles || (nibbles >> 1) + 1 > len) \
+ return (-1); \
+ len = (nibbles >> 1) + 1; \
+ \
+ data = evbuffer_pullup(evbuf, offset + len) + offset; \
+ if (!data) \
+ return (-1); \
+ \
+ while (nibbles > 0) { \
+ number <<= 4; \
+ if (nibbles & 0x1) \
+ number |= data[nibbles >> 1] & 0x0f; \
+ else \
+ number |= (data[nibbles >> 1] & 0xf0) >> 4; \
+ nibbles--; \
+ } \
+ \
+ *pnumber = number; \
+ \
+ return (int)(len); \
+} while (0)
+
+/* Internal: decode an integer from an evbuffer, without draining it.
+ * Only integers up to 32-bits are supported.
+ *
+ * @param evbuf the buffer to read from
+ * @param offset an index into the buffer at which we should start reading.
+ * @param pnumber a pointer to receive the integer.
+ * @return The length of the number as encoded, or -1 on error.
+ */
+
+static int
+decode_int_internal(ev_uint32_t *pnumber, struct evbuffer *evbuf, int offset)
+{
+ ev_uint32_t number = 0;
+ DECODE_INT_INTERNAL(number, 8, pnumber, evbuf, offset);
+}
+
+static int
+decode_int64_internal(ev_uint64_t *pnumber, struct evbuffer *evbuf, int offset)
+{
+ ev_uint64_t number = 0;
+ DECODE_INT_INTERNAL(number, 16, pnumber, evbuf, offset);
+}
+
+int
+evtag_decode_int(ev_uint32_t *pnumber, struct evbuffer *evbuf)
+{
+ int res = decode_int_internal(pnumber, evbuf, 0);
+ if (res != -1)
+ evbuffer_drain(evbuf, res);
+
+ return (res == -1 ? -1 : 0);
+}
+
+int
+evtag_decode_int64(ev_uint64_t *pnumber, struct evbuffer *evbuf)
+{
+ int res = decode_int64_internal(pnumber, evbuf, 0);
+ if (res != -1)
+ evbuffer_drain(evbuf, res);
+
+ return (res == -1 ? -1 : 0);
+}
+
+int
+evtag_peek(struct evbuffer *evbuf, ev_uint32_t *ptag)
+{
+ return (decode_tag_internal(ptag, evbuf, 0 /* dodrain */));
+}
+
+int
+evtag_peek_length(struct evbuffer *evbuf, ev_uint32_t *plength)
+{
+ int res, len;
+
+ len = decode_tag_internal(NULL, evbuf, 0 /* dodrain */);
+ if (len == -1)
+ return (-1);
+
+ res = decode_int_internal(plength, evbuf, len);
+ if (res == -1)
+ return (-1);
+
+ *plength += res + len;
+
+ return (0);
+}
+
+int
+evtag_payload_length(struct evbuffer *evbuf, ev_uint32_t *plength)
+{
+ int res, len;
+
+ len = decode_tag_internal(NULL, evbuf, 0 /* dodrain */);
+ if (len == -1)
+ return (-1);
+
+ res = decode_int_internal(plength, evbuf, len);
+ if (res == -1)
+ return (-1);
+
+ return (0);
+}
+
+/* just unmarshals the header and returns the length of the remaining data */
+
+int
+evtag_unmarshal_header(struct evbuffer *evbuf, ev_uint32_t *ptag)
+{
+ ev_uint32_t len;
+
+ if (decode_tag_internal(ptag, evbuf, 1 /* dodrain */) == -1)
+ return (-1);
+ if (evtag_decode_int(&len, evbuf) == -1)
+ return (-1);
+
+ if (evbuffer_get_length(evbuf) < len)
+ return (-1);
+
+ return (len);
+}
+
+int
+evtag_consume(struct evbuffer *evbuf)
+{
+ int len;
+ if ((len = evtag_unmarshal_header(evbuf, NULL)) == -1)
+ return (-1);
+ evbuffer_drain(evbuf, len);
+
+ return (0);
+}
+
+/* Reads the data type from an event buffer */
+
+int
+evtag_unmarshal(struct evbuffer *src, ev_uint32_t *ptag, struct evbuffer *dst)
+{
+ int len;
+
+ if ((len = evtag_unmarshal_header(src, ptag)) == -1)
+ return (-1);
+
+ if (evbuffer_add(dst, evbuffer_pullup(src, len), len) == -1)
+ return (-1);
+
+ evbuffer_drain(src, len);
+
+ return (len);
+}
+
+/* Marshaling for integers */
+
+int
+evtag_unmarshal_int(struct evbuffer *evbuf, ev_uint32_t need_tag,
+ ev_uint32_t *pinteger)
+{
+ ev_uint32_t tag;
+ ev_uint32_t len;
+ int result;
+
+ if (decode_tag_internal(&tag, evbuf, 1 /* dodrain */) == -1)
+ return (-1);
+ if (need_tag != tag)
+ return (-1);
+ if (evtag_decode_int(&len, evbuf) == -1)
+ return (-1);
+
+ if (evbuffer_get_length(evbuf) < len)
+ return (-1);
+
+ result = decode_int_internal(pinteger, evbuf, 0);
+ evbuffer_drain(evbuf, len);
+ if (result < 0 || (size_t)result > len) /* XXX Should this be != rather than > ?*/
+ return (-1);
+ else
+ return result;
+}
+
+int
+evtag_unmarshal_int64(struct evbuffer *evbuf, ev_uint32_t need_tag,
+ ev_uint64_t *pinteger)
+{
+ ev_uint32_t tag;
+ ev_uint32_t len;
+ int result;
+
+ if (decode_tag_internal(&tag, evbuf, 1 /* dodrain */) == -1)
+ return (-1);
+ if (need_tag != tag)
+ return (-1);
+ if (evtag_decode_int(&len, evbuf) == -1)
+ return (-1);
+
+ if (evbuffer_get_length(evbuf) < len)
+ return (-1);
+
+ result = decode_int64_internal(pinteger, evbuf, 0);
+ evbuffer_drain(evbuf, len);
+ if (result < 0 || (size_t)result > len) /* XXX Should this be != rather than > ?*/
+ return (-1);
+ else
+ return result;
+}
+
+/* Unmarshal a fixed length tag */
+
+int
+evtag_unmarshal_fixed(struct evbuffer *src, ev_uint32_t need_tag, void *data,
+ size_t len)
+{
+ ev_uint32_t tag;
+ int tag_len;
+
+ /* Now unmarshal a tag and check that it matches the tag we want */
+ if ((tag_len = evtag_unmarshal_header(src, &tag)) < 0 ||
+ tag != need_tag)
+ return (-1);
+
+ if ((size_t)tag_len != len)
+ return (-1);
+
+ evbuffer_remove(src, data, len);
+ return (0);
+}
+
+int
+evtag_unmarshal_string(struct evbuffer *evbuf, ev_uint32_t need_tag,
+ char **pstring)
+{
+ ev_uint32_t tag;
+ int tag_len;
+
+ if ((tag_len = evtag_unmarshal_header(evbuf, &tag)) == -1 ||
+ tag != need_tag)
+ return (-1);
+
+ *pstring = mm_malloc(tag_len + 1);
+ if (*pstring == NULL) {
+ event_warn("%s: malloc", __func__);
+ return -1;
+ }
+ evbuffer_remove(evbuf, *pstring, tag_len);
+ (*pstring)[tag_len] = '\0';
+
+ return (0);
+}
+
+int
+evtag_unmarshal_timeval(struct evbuffer *evbuf, ev_uint32_t need_tag,
+ struct timeval *ptv)
+{
+ ev_uint32_t tag;
+ ev_uint32_t integer;
+ int len, offset, offset2;
+ int result = -1;
+
+ if ((len = evtag_unmarshal_header(evbuf, &tag)) == -1)
+ return (-1);
+ if (tag != need_tag)
+ goto done;
+ if ((offset = decode_int_internal(&integer, evbuf, 0)) == -1)
+ goto done;
+ ptv->tv_sec = integer;
+ if ((offset2 = decode_int_internal(&integer, evbuf, offset)) == -1)
+ goto done;
+ ptv->tv_usec = integer;
+ if (offset + offset2 > len) /* XXX Should this be != instead of > ? */
+ goto done;
+
+ result = 0;
+ done:
+ evbuffer_drain(evbuf, len);
+ return result;
+}
diff --git a/protocols/Telegram/tgl/libevent/event_tagging.obj b/protocols/Telegram/tgl/libevent/event_tagging.obj
new file mode 100644
index 0000000000..920a698e34
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/event_tagging.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/evmap-internal.h b/protocols/Telegram/tgl/libevent/evmap-internal.h
new file mode 100644
index 0000000000..dfc81d5087
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/evmap-internal.h
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVMAP_INTERNAL_H_INCLUDED_
+#define EVMAP_INTERNAL_H_INCLUDED_
+
+/** @file evmap-internal.h
+ *
+ * An event_map is a utility structure to map each fd or signal to zero or
+ * more events. Functions to manipulate event_maps should only be used from
+ * inside libevent. They generally need to hold the lock on the corresponding
+ * event_base.
+ **/
+
+struct event_base;
+struct event;
+
+/** Initialize an event_map for use.
+ */
+void evmap_io_initmap_(struct event_io_map* ctx);
+void evmap_signal_initmap_(struct event_signal_map* ctx);
+
+/** Remove all entries from an event_map.
+
+ @param ctx the map to clear.
+ */
+void evmap_io_clear_(struct event_io_map* ctx);
+void evmap_signal_clear_(struct event_signal_map* ctx);
+
+/** Add an IO event (some combination of EV_READ or EV_WRITE) to an
+ event_base's list of events on a given file descriptor, and tell the
+ underlying eventops about the fd if its state has changed.
+
+ Requires that ev is not already added.
+
+ @param base the event_base to operate on.
+ @param fd the file descriptor corresponding to ev.
+ @param ev the event to add.
+*/
+int evmap_io_add_(struct event_base *base, evutil_socket_t fd, struct event *ev);
+/** Remove an IO event (some combination of EV_READ or EV_WRITE) to an
+ event_base's list of events on a given file descriptor, and tell the
+ underlying eventops about the fd if its state has changed.
+
+ @param base the event_base to operate on.
+ @param fd the file descriptor corresponding to ev.
+ @param ev the event to remove.
+ */
+int evmap_io_del_(struct event_base *base, evutil_socket_t fd, struct event *ev);
+/** Active the set of events waiting on an event_base for a given fd.
+
+ @param base the event_base to operate on.
+ @param fd the file descriptor that has become active.
+ @param events a bitmask of EV_READ|EV_WRITE|EV_ET.
+*/
+void evmap_io_active_(struct event_base *base, evutil_socket_t fd, short events);
+
+
+/* These functions behave in the same way as evmap_io_*, except they work on
+ * signals rather than fds. signals use a linear map everywhere; fds use
+ * either a linear map or a hashtable. */
+int evmap_signal_add_(struct event_base *base, int signum, struct event *ev);
+int evmap_signal_del_(struct event_base *base, int signum, struct event *ev);
+void evmap_signal_active_(struct event_base *base, evutil_socket_t signum, int ncalls);
+
+/* Return the fdinfo object associated with a given fd. If the fd has no
+ * events associated with it, the result may be NULL.
+ */
+void *evmap_io_get_fdinfo_(struct event_io_map *ctx, evutil_socket_t fd);
+
+/* Helper for event_reinit(): Tell the backend to re-add every fd and signal
+ * for which we have a pending event.
+ */
+int evmap_reinit_(struct event_base *base);
+
+/* Helper for event_base_free(): Call event_del() on every pending fd and
+ * signal event.
+ */
+void evmap_delete_all_(struct event_base *base);
+
+/* Helper for event_base_assert_ok_(): Check referential integrity of the
+ * evmaps.
+ */
+void evmap_check_integrity_(struct event_base *base);
+
+/* Helper: Call fn on every fd or signal event, passing as its arguments the
+ * provided event_base, the event, and arg. If fn returns 0, process the next
+ * event. If it returns any other value, return that value and process no
+ * more events.
+ */
+int evmap_foreach_event_(struct event_base *base,
+ event_base_foreach_event_cb fn,
+ void *arg);
+
+#endif /* EVMAP_INTERNAL_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/evmap.c b/protocols/Telegram/tgl/libevent/evmap.c
new file mode 100644
index 0000000000..3f76dd0ae1
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/evmap.c
@@ -0,0 +1,1055 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#endif
+#include <sys/types.h>
+#if !defined(_WIN32) && defined(EVENT__HAVE_SYS_TIME_H)
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#include <stdio.h>
+#include <stdlib.h>
+#ifndef _WIN32
+#include <unistd.h>
+#endif
+#include <errno.h>
+#include <signal.h>
+#include <string.h>
+#include <time.h>
+
+#include "event-internal.h"
+#include "evmap-internal.h"
+#include "mm-internal.h"
+#include "changelist-internal.h"
+
+/** An entry for an evmap_io list: notes all the events that want to read or
+ write on a given fd, and the number of each.
+ */
+struct evmap_io {
+ struct event_dlist events;
+ ev_uint16_t nread;
+ ev_uint16_t nwrite;
+ ev_uint16_t nclose;
+};
+
+/* An entry for an evmap_signal list: notes all the events that want to know
+ when a signal triggers. */
+struct evmap_signal {
+ struct event_dlist events;
+};
+
+/* On some platforms, fds start at 0 and increment by 1 as they are
+ allocated, and old numbers get used. For these platforms, we
+ implement io maps just like signal maps: as an array of pointers to
+ struct evmap_io. But on other platforms (windows), sockets are not
+ 0-indexed, not necessarily consecutive, and not necessarily reused.
+ There, we use a hashtable to implement evmap_io.
+*/
+#ifdef EVMAP_USE_HT
+struct event_map_entry {
+ HT_ENTRY(event_map_entry) map_node;
+ evutil_socket_t fd;
+ union { /* This is a union in case we need to make more things that can
+ be in the hashtable. */
+ struct evmap_io evmap_io;
+ } ent;
+};
+
+/* Helper used by the event_io_map hashtable code; tries to return a good hash
+ * of the fd in e->fd. */
+static inline unsigned
+hashsocket(struct event_map_entry *e)
+{
+ /* On win32, in practice, the low 2-3 bits of a SOCKET seem not to
+ * matter. Our hashtable implementation really likes low-order bits,
+ * though, so let's do the rotate-and-add trick. */
+ unsigned h = (unsigned) e->fd;
+ h += (h >> 2) | (h << 30);
+ return h;
+}
+
+/* Helper used by the event_io_map hashtable code; returns true iff e1 and e2
+ * have the same e->fd. */
+static inline int
+eqsocket(struct event_map_entry *e1, struct event_map_entry *e2)
+{
+ return e1->fd == e2->fd;
+}
+
+HT_PROTOTYPE(event_io_map, event_map_entry, map_node, hashsocket, eqsocket)
+HT_GENERATE(event_io_map, event_map_entry, map_node, hashsocket, eqsocket,
+ 0.5, mm_malloc, mm_realloc, mm_free)
+
+#define GET_IO_SLOT(x, map, slot, type) \
+ do { \
+ struct event_map_entry key_, *ent_; \
+ key_.fd = slot; \
+ ent_ = HT_FIND(event_io_map, map, &key_); \
+ (x) = ent_ ? &ent_->ent.type : NULL; \
+ } while (0);
+
+#define GET_IO_SLOT_AND_CTOR(x, map, slot, type, ctor, fdinfo_len) \
+ do { \
+ struct event_map_entry key_, *ent_; \
+ key_.fd = slot; \
+ HT_FIND_OR_INSERT_(event_io_map, map_node, hashsocket, map, \
+ event_map_entry, &key_, ptr, \
+ { \
+ ent_ = *ptr; \
+ }, \
+ { \
+ ent_ = mm_calloc(1,sizeof(struct event_map_entry)+fdinfo_len); \
+ if (EVUTIL_UNLIKELY(ent_ == NULL)) \
+ return (-1); \
+ ent_->fd = slot; \
+ (ctor)(&ent_->ent.type); \
+ HT_FOI_INSERT_(map_node, map, &key_, ent_, ptr) \
+ }); \
+ (x) = &ent_->ent.type; \
+ } while (0)
+
+void evmap_io_initmap_(struct event_io_map *ctx)
+{
+ HT_INIT(event_io_map, ctx);
+}
+
+void evmap_io_clear_(struct event_io_map *ctx)
+{
+ struct event_map_entry **ent, **next, *this;
+ for (ent = HT_START(event_io_map, ctx); ent; ent = next) {
+ this = *ent;
+ next = HT_NEXT_RMV(event_io_map, ctx, ent);
+ mm_free(this);
+ }
+ HT_CLEAR(event_io_map, ctx); /* remove all storage held by the ctx. */
+}
+#endif
+
+/* Set the variable 'x' to the field in event_map 'map' with fields of type
+ 'struct type *' corresponding to the fd or signal 'slot'. Set 'x' to NULL
+ if there are no entries for 'slot'. Does no bounds-checking. */
+#define GET_SIGNAL_SLOT(x, map, slot, type) \
+ (x) = (struct type *)((map)->entries[slot])
+/* As GET_SLOT, but construct the entry for 'slot' if it is not present,
+ by allocating enough memory for a 'struct type', and initializing the new
+ value by calling the function 'ctor' on it. Makes the function
+ return -1 on allocation failure.
+ */
+#define GET_SIGNAL_SLOT_AND_CTOR(x, map, slot, type, ctor, fdinfo_len) \
+ do { \
+ if ((map)->entries[slot] == NULL) { \
+ (map)->entries[slot] = \
+ mm_calloc(1,sizeof(struct type)+fdinfo_len); \
+ if (EVUTIL_UNLIKELY((map)->entries[slot] == NULL)) \
+ return (-1); \
+ (ctor)((struct type *)(map)->entries[slot]); \
+ } \
+ (x) = (struct type *)((map)->entries[slot]); \
+ } while (0)
+
+/* If we aren't using hashtables, then define the IO_SLOT macros and functions
+ as thin aliases over the SIGNAL_SLOT versions. */
+#ifndef EVMAP_USE_HT
+#define GET_IO_SLOT(x,map,slot,type) GET_SIGNAL_SLOT(x,map,slot,type)
+#define GET_IO_SLOT_AND_CTOR(x,map,slot,type,ctor,fdinfo_len) \
+ GET_SIGNAL_SLOT_AND_CTOR(x,map,slot,type,ctor,fdinfo_len)
+#define FDINFO_OFFSET sizeof(struct evmap_io)
+void
+evmap_io_initmap_(struct event_io_map* ctx)
+{
+ evmap_signal_initmap_(ctx);
+}
+void
+evmap_io_clear_(struct event_io_map* ctx)
+{
+ evmap_signal_clear_(ctx);
+}
+#endif
+
+
+/** Expand 'map' with new entries of width 'msize' until it is big enough
+ to store a value in 'slot'.
+ */
+static int
+evmap_make_space(struct event_signal_map *map, int slot, int msize)
+{
+ if (map->nentries <= slot) {
+ int nentries = map->nentries ? map->nentries : 32;
+ void **tmp;
+
+ while (nentries <= slot)
+ nentries <<= 1;
+
+ tmp = (void **)mm_realloc(map->entries, nentries * msize);
+ if (tmp == NULL)
+ return (-1);
+
+ memset(&tmp[map->nentries], 0,
+ (nentries - map->nentries) * msize);
+
+ map->nentries = nentries;
+ map->entries = tmp;
+ }
+
+ return (0);
+}
+
+void
+evmap_signal_initmap_(struct event_signal_map *ctx)
+{
+ ctx->nentries = 0;
+ ctx->entries = NULL;
+}
+
+void
+evmap_signal_clear_(struct event_signal_map *ctx)
+{
+ if (ctx->entries != NULL) {
+ int i;
+ for (i = 0; i < ctx->nentries; ++i) {
+ if (ctx->entries[i] != NULL)
+ mm_free(ctx->entries[i]);
+ }
+ mm_free(ctx->entries);
+ ctx->entries = NULL;
+ }
+ ctx->nentries = 0;
+}
+
+
+/* code specific to file descriptors */
+
+/** Constructor for struct evmap_io */
+static void
+evmap_io_init(struct evmap_io *entry)
+{
+ LIST_INIT(&entry->events);
+ entry->nread = 0;
+ entry->nwrite = 0;
+ entry->nclose = 0;
+}
+
+
+/* return -1 on error, 0 on success if nothing changed in the event backend,
+ * and 1 on success if something did. */
+int
+evmap_io_add_(struct event_base *base, evutil_socket_t fd, struct event *ev)
+{
+ const struct eventop *evsel = base->evsel;
+ struct event_io_map *io = &base->io;
+ struct evmap_io *ctx = NULL;
+ int nread, nwrite, nclose, retval = 0;
+ short res = 0, old = 0;
+ struct event *old_ev;
+
+ EVUTIL_ASSERT(fd == ev->ev_fd);
+
+ if (fd < 0)
+ return 0;
+
+#ifndef EVMAP_USE_HT
+ if (fd >= io->nentries) {
+ if (evmap_make_space(io, fd, sizeof(struct evmap_io *)) == -1)
+ return (-1);
+ }
+#endif
+ GET_IO_SLOT_AND_CTOR(ctx, io, fd, evmap_io, evmap_io_init,
+ evsel->fdinfo_len);
+
+ nread = ctx->nread;
+ nwrite = ctx->nwrite;
+ nclose = ctx->nclose;
+
+ if (nread)
+ old |= EV_READ;
+ if (nwrite)
+ old |= EV_WRITE;
+ if (nclose)
+ old |= EV_CLOSED;
+
+ if (ev->ev_events & EV_READ) {
+ if (++nread == 1)
+ res |= EV_READ;
+ }
+ if (ev->ev_events & EV_WRITE) {
+ if (++nwrite == 1)
+ res |= EV_WRITE;
+ }
+ if (ev->ev_events & EV_CLOSED) {
+ if (++nclose == 1)
+ res |= EV_CLOSED;
+ }
+ if (EVUTIL_UNLIKELY(nread > 0xffff || nwrite > 0xffff || nclose > 0xffff)) {
+ event_warnx("Too many events reading or writing on fd %d",
+ (int)fd);
+ return -1;
+ }
+ if (EVENT_DEBUG_MODE_IS_ON() &&
+ (old_ev = LIST_FIRST(&ctx->events)) &&
+ (old_ev->ev_events&EV_ET) != (ev->ev_events&EV_ET)) {
+ event_warnx("Tried to mix edge-triggered and non-edge-triggered"
+ " events on fd %d", (int)fd);
+ return -1;
+ }
+
+ if (res) {
+ void *extra = ((char*)ctx) + sizeof(struct evmap_io);
+ /* XXX(niels): we cannot mix edge-triggered and
+ * level-triggered, we should probably assert on
+ * this. */
+ if (evsel->add(base, ev->ev_fd,
+ old, (ev->ev_events & EV_ET) | res, extra) == -1)
+ return (-1);
+ retval = 1;
+ }
+
+ ctx->nread = (ev_uint16_t) nread;
+ ctx->nwrite = (ev_uint16_t) nwrite;
+ ctx->nclose = (ev_uint16_t) nclose;
+ LIST_INSERT_HEAD(&ctx->events, ev, ev_io_next);
+
+ return (retval);
+}
+
+/* return -1 on error, 0 on success if nothing changed in the event backend,
+ * and 1 on success if something did. */
+int
+evmap_io_del_(struct event_base *base, evutil_socket_t fd, struct event *ev)
+{
+ const struct eventop *evsel = base->evsel;
+ struct event_io_map *io = &base->io;
+ struct evmap_io *ctx;
+ int nread, nwrite, nclose, retval = 0;
+ short res = 0, old = 0;
+
+ if (fd < 0)
+ return 0;
+
+ EVUTIL_ASSERT(fd == ev->ev_fd);
+
+#ifndef EVMAP_USE_HT
+ if (fd >= io->nentries)
+ return (-1);
+#endif
+
+ GET_IO_SLOT(ctx, io, fd, evmap_io);
+
+ nread = ctx->nread;
+ nwrite = ctx->nwrite;
+ nclose = ctx->nclose;
+
+ if (nread)
+ old |= EV_READ;
+ if (nwrite)
+ old |= EV_WRITE;
+ if (nclose)
+ old |= EV_CLOSED;
+
+ if (ev->ev_events & EV_READ) {
+ if (--nread == 0)
+ res |= EV_READ;
+ EVUTIL_ASSERT(nread >= 0);
+ }
+ if (ev->ev_events & EV_WRITE) {
+ if (--nwrite == 0)
+ res |= EV_WRITE;
+ EVUTIL_ASSERT(nwrite >= 0);
+ }
+ if (ev->ev_events & EV_CLOSED) {
+ if (--nclose == 0)
+ res |= EV_CLOSED;
+ EVUTIL_ASSERT(nclose >= 0);
+ }
+
+ if (res) {
+ void *extra = ((char*)ctx) + sizeof(struct evmap_io);
+ if (evsel->del(base, ev->ev_fd, old, res, extra) == -1) {
+ retval = -1;
+ } else {
+ retval = 1;
+ }
+ }
+
+ ctx->nread = nread;
+ ctx->nwrite = nwrite;
+ ctx->nclose = nclose;
+ LIST_REMOVE(ev, ev_io_next);
+
+ return (retval);
+}
+
+void
+evmap_io_active_(struct event_base *base, evutil_socket_t fd, short events)
+{
+ struct event_io_map *io = &base->io;
+ struct evmap_io *ctx;
+ struct event *ev;
+
+#ifndef EVMAP_USE_HT
+ if (fd < 0 || fd >= io->nentries)
+ return;
+#endif
+ GET_IO_SLOT(ctx, io, fd, evmap_io);
+
+ if (NULL == ctx)
+ return;
+ LIST_FOREACH(ev, &ctx->events, ev_io_next) {
+ if (ev->ev_events & events)
+ event_active_nolock_(ev, ev->ev_events & events, 1);
+ }
+}
+
+/* code specific to signals */
+
+static void
+evmap_signal_init(struct evmap_signal *entry)
+{
+ LIST_INIT(&entry->events);
+}
+
+
+int
+evmap_signal_add_(struct event_base *base, int sig, struct event *ev)
+{
+ const struct eventop *evsel = base->evsigsel;
+ struct event_signal_map *map = &base->sigmap;
+ struct evmap_signal *ctx = NULL;
+
+ if (sig >= map->nentries) {
+ if (evmap_make_space(
+ map, sig, sizeof(struct evmap_signal *)) == -1)
+ return (-1);
+ }
+ GET_SIGNAL_SLOT_AND_CTOR(ctx, map, sig, evmap_signal, evmap_signal_init,
+ base->evsigsel->fdinfo_len);
+
+ if (LIST_EMPTY(&ctx->events)) {
+ if (evsel->add(base, ev->ev_fd, 0, EV_SIGNAL, NULL)
+ == -1)
+ return (-1);
+ }
+
+ LIST_INSERT_HEAD(&ctx->events, ev, ev_signal_next);
+
+ return (1);
+}
+
+int
+evmap_signal_del_(struct event_base *base, int sig, struct event *ev)
+{
+ const struct eventop *evsel = base->evsigsel;
+ struct event_signal_map *map = &base->sigmap;
+ struct evmap_signal *ctx;
+
+ if (sig >= map->nentries)
+ return (-1);
+
+ GET_SIGNAL_SLOT(ctx, map, sig, evmap_signal);
+
+ LIST_REMOVE(ev, ev_signal_next);
+
+ if (LIST_FIRST(&ctx->events) == NULL) {
+ if (evsel->del(base, ev->ev_fd, 0, EV_SIGNAL, NULL) == -1)
+ return (-1);
+ }
+
+ return (1);
+}
+
+void
+evmap_signal_active_(struct event_base *base, evutil_socket_t sig, int ncalls)
+{
+ struct event_signal_map *map = &base->sigmap;
+ struct evmap_signal *ctx;
+ struct event *ev;
+
+ if (sig < 0 || sig >= map->nentries)
+ return;
+ GET_SIGNAL_SLOT(ctx, map, sig, evmap_signal);
+
+ if (!ctx)
+ return;
+ LIST_FOREACH(ev, &ctx->events, ev_signal_next)
+ event_active_nolock_(ev, EV_SIGNAL, ncalls);
+}
+
+void *
+evmap_io_get_fdinfo_(struct event_io_map *map, evutil_socket_t fd)
+{
+ struct evmap_io *ctx;
+ GET_IO_SLOT(ctx, map, fd, evmap_io);
+ if (ctx)
+ return ((char*)ctx) + sizeof(struct evmap_io);
+ else
+ return NULL;
+}
+
+/* Callback type for evmap_io_foreach_fd */
+typedef int (*evmap_io_foreach_fd_cb)(
+ struct event_base *, evutil_socket_t, struct evmap_io *, void *);
+
+/* Multipurpose helper function: Iterate over every file descriptor event_base
+ * for which we could have EV_READ or EV_WRITE events. For each such fd, call
+ * fn(base, signum, evmap_io, arg), where fn is the user-provided
+ * function, base is the event_base, signum is the signal number, evmap_io
+ * is an evmap_io structure containing a list of events pending on the
+ * file descriptor, and arg is the user-supplied argument.
+ *
+ * If fn returns 0, continue on to the next signal. Otherwise, return the same
+ * value that fn returned.
+ *
+ * Note that there is no guarantee that the file descriptors will be processed
+ * in any particular order.
+ */
+static int
+evmap_io_foreach_fd(struct event_base *base,
+ evmap_io_foreach_fd_cb fn,
+ void *arg)
+{
+ evutil_socket_t fd;
+ struct event_io_map *iomap = &base->io;
+ int r = 0;
+#ifdef EVMAP_USE_HT
+ struct event_map_entry **mapent;
+ HT_FOREACH(mapent, event_io_map, iomap) {
+ struct evmap_io *ctx = &(*mapent)->ent.evmap_io;
+ fd = (*mapent)->fd;
+#else
+ for (fd = 0; fd < iomap->nentries; ++fd) {
+ struct evmap_io *ctx = iomap->entries[fd];
+ if (!ctx)
+ continue;
+#endif
+ if ((r = fn(base, fd, ctx, arg)))
+ break;
+ }
+ return r;
+}
+
+/* Callback type for evmap_signal_foreach_signal */
+typedef int (*evmap_signal_foreach_signal_cb)(
+ struct event_base *, int, struct evmap_signal *, void *);
+
+/* Multipurpose helper function: Iterate over every signal number in the
+ * event_base for which we could have signal events. For each such signal,
+ * call fn(base, signum, evmap_signal, arg), where fn is the user-provided
+ * function, base is the event_base, signum is the signal number, evmap_signal
+ * is an evmap_signal structure containing a list of events pending on the
+ * signal, and arg is the user-supplied argument.
+ *
+ * If fn returns 0, continue on to the next signal. Otherwise, return the same
+ * value that fn returned.
+ */
+static int
+evmap_signal_foreach_signal(struct event_base *base,
+ evmap_signal_foreach_signal_cb fn,
+ void *arg)
+{
+ struct event_signal_map *sigmap = &base->sigmap;
+ int r = 0;
+ int signum;
+
+ for (signum = 0; signum < sigmap->nentries; ++signum) {
+ struct evmap_signal *ctx = sigmap->entries[signum];
+ if (!ctx)
+ continue;
+ if ((r = fn(base, signum, ctx, arg)))
+ break;
+ }
+ return r;
+}
+
+/* Helper for evmap_reinit_: tell the backend to add every fd for which we have
+ * pending events, with the appropriate combination of EV_READ, EV_WRITE, and
+ * EV_ET. */
+static int
+evmap_io_reinit_iter_fn(struct event_base *base, evutil_socket_t fd,
+ struct evmap_io *ctx, void *arg)
+{
+ const struct eventop *evsel = base->evsel;
+ void *extra;
+ int *result = arg;
+ short events = 0;
+ struct event *ev;
+ EVUTIL_ASSERT(ctx);
+
+ extra = ((char*)ctx) + sizeof(struct evmap_io);
+ if (ctx->nread)
+ events |= EV_READ;
+ if (ctx->nwrite)
+ events |= EV_WRITE;
+ if (ctx->nclose)
+ events |= EV_CLOSED;
+ if (evsel->fdinfo_len)
+ memset(extra, 0, evsel->fdinfo_len);
+ if (events &&
+ (ev = LIST_FIRST(&ctx->events)) &&
+ (ev->ev_events & EV_ET))
+ events |= EV_ET;
+ if (evsel->add(base, fd, 0, events, extra) == -1)
+ *result = -1;
+
+ return 0;
+}
+
+/* Helper for evmap_reinit_: tell the backend to add every signal for which we
+ * have pending events. */
+static int
+evmap_signal_reinit_iter_fn(struct event_base *base,
+ int signum, struct evmap_signal *ctx, void *arg)
+{
+ const struct eventop *evsel = base->evsigsel;
+ int *result = arg;
+
+ if (!LIST_EMPTY(&ctx->events)) {
+ if (evsel->add(base, signum, 0, EV_SIGNAL, NULL) == -1)
+ *result = -1;
+ }
+ return 0;
+}
+
+int
+evmap_reinit_(struct event_base *base)
+{
+ int result = 0;
+
+ evmap_io_foreach_fd(base, evmap_io_reinit_iter_fn, &result);
+ if (result < 0)
+ return -1;
+ evmap_signal_foreach_signal(base, evmap_signal_reinit_iter_fn, &result);
+ if (result < 0)
+ return -1;
+ return 0;
+}
+
+/* Helper for evmap_delete_all_: delete every event in an event_dlist. */
+static int
+delete_all_in_dlist(struct event_dlist *dlist)
+{
+ struct event *ev;
+ while ((ev = LIST_FIRST(dlist)))
+ event_del(ev);
+ return 0;
+}
+
+/* Helper for evmap_delete_all_: delete every event pending on an fd. */
+static int
+evmap_io_delete_all_iter_fn(struct event_base *base, evutil_socket_t fd,
+ struct evmap_io *io_info, void *arg)
+{
+ return delete_all_in_dlist(&io_info->events);
+}
+
+/* Helper for evmap_delete_all_: delete every event pending on a signal. */
+static int
+evmap_signal_delete_all_iter_fn(struct event_base *base, int signum,
+ struct evmap_signal *sig_info, void *arg)
+{
+ return delete_all_in_dlist(&sig_info->events);
+}
+
+void
+evmap_delete_all_(struct event_base *base)
+{
+ evmap_signal_foreach_signal(base, evmap_signal_delete_all_iter_fn, NULL);
+ evmap_io_foreach_fd(base, evmap_io_delete_all_iter_fn, NULL);
+}
+
+/** Per-fd structure for use with changelists. It keeps track, for each fd or
+ * signal using the changelist, of where its entry in the changelist is.
+ */
+struct event_changelist_fdinfo {
+ int idxplus1; /* this is the index +1, so that memset(0) will make it
+ * a no-such-element */
+};
+
+void
+event_changelist_init_(struct event_changelist *changelist)
+{
+ changelist->changes = NULL;
+ changelist->changes_size = 0;
+ changelist->n_changes = 0;
+}
+
+/** Helper: return the changelist_fdinfo corresponding to a given change. */
+static inline struct event_changelist_fdinfo *
+event_change_get_fdinfo(struct event_base *base,
+ const struct event_change *change)
+{
+ char *ptr;
+ if (change->read_change & EV_CHANGE_SIGNAL) {
+ struct evmap_signal *ctx;
+ GET_SIGNAL_SLOT(ctx, &base->sigmap, change->fd, evmap_signal);
+ ptr = ((char*)ctx) + sizeof(struct evmap_signal);
+ } else {
+ struct evmap_io *ctx;
+ GET_IO_SLOT(ctx, &base->io, change->fd, evmap_io);
+ ptr = ((char*)ctx) + sizeof(struct evmap_io);
+ }
+ return (void*)ptr;
+}
+
+/** Callback helper for event_changelist_assert_ok */
+static int
+event_changelist_assert_ok_foreach_iter_fn(
+ struct event_base *base,
+ evutil_socket_t fd, struct evmap_io *io, void *arg)
+{
+ struct event_changelist *changelist = &base->changelist;
+ struct event_changelist_fdinfo *f;
+ f = (void*)
+ ( ((char*)io) + sizeof(struct evmap_io) );
+ if (f->idxplus1) {
+ struct event_change *c = &changelist->changes[f->idxplus1 - 1];
+ EVUTIL_ASSERT(c->fd == fd);
+ }
+ return 0;
+}
+
+/** Make sure that the changelist is consistent with the evmap structures. */
+static void
+event_changelist_assert_ok(struct event_base *base)
+{
+ int i;
+ struct event_changelist *changelist = &base->changelist;
+
+ EVUTIL_ASSERT(changelist->changes_size >= changelist->n_changes);
+ for (i = 0; i < changelist->n_changes; ++i) {
+ struct event_change *c = &changelist->changes[i];
+ struct event_changelist_fdinfo *f;
+ EVUTIL_ASSERT(c->fd >= 0);
+ f = event_change_get_fdinfo(base, c);
+ EVUTIL_ASSERT(f);
+ EVUTIL_ASSERT(f->idxplus1 == i + 1);
+ }
+
+ evmap_io_foreach_fd(base,
+ event_changelist_assert_ok_foreach_iter_fn,
+ NULL);
+}
+
+#ifdef DEBUG_CHANGELIST
+#define event_changelist_check(base) event_changelist_assert_ok((base))
+#else
+#define event_changelist_check(base) ((void)0)
+#endif
+
+void
+event_changelist_remove_all_(struct event_changelist *changelist,
+ struct event_base *base)
+{
+ int i;
+
+ event_changelist_check(base);
+
+ for (i = 0; i < changelist->n_changes; ++i) {
+ struct event_change *ch = &changelist->changes[i];
+ struct event_changelist_fdinfo *fdinfo =
+ event_change_get_fdinfo(base, ch);
+ EVUTIL_ASSERT(fdinfo->idxplus1 == i + 1);
+ fdinfo->idxplus1 = 0;
+ }
+
+ changelist->n_changes = 0;
+
+ event_changelist_check(base);
+}
+
+void
+event_changelist_freemem_(struct event_changelist *changelist)
+{
+ if (changelist->changes)
+ mm_free(changelist->changes);
+ event_changelist_init_(changelist); /* zero it all out. */
+}
+
+/** Increase the size of 'changelist' to hold more changes. */
+static int
+event_changelist_grow(struct event_changelist *changelist)
+{
+ int new_size;
+ struct event_change *new_changes;
+ if (changelist->changes_size < 64)
+ new_size = 64;
+ else
+ new_size = changelist->changes_size * 2;
+
+ new_changes = mm_realloc(changelist->changes,
+ new_size * sizeof(struct event_change));
+
+ if (EVUTIL_UNLIKELY(new_changes == NULL))
+ return (-1);
+
+ changelist->changes = new_changes;
+ changelist->changes_size = new_size;
+
+ return (0);
+}
+
+/** Return a pointer to the changelist entry for the file descriptor or signal
+ * 'fd', whose fdinfo is 'fdinfo'. If none exists, construct it, setting its
+ * old_events field to old_events.
+ */
+static struct event_change *
+event_changelist_get_or_construct(struct event_changelist *changelist,
+ evutil_socket_t fd,
+ short old_events,
+ struct event_changelist_fdinfo *fdinfo)
+{
+ struct event_change *change;
+
+ if (fdinfo->idxplus1 == 0) {
+ int idx;
+ EVUTIL_ASSERT(changelist->n_changes <= changelist->changes_size);
+
+ if (changelist->n_changes == changelist->changes_size) {
+ if (event_changelist_grow(changelist) < 0)
+ return NULL;
+ }
+
+ idx = changelist->n_changes++;
+ change = &changelist->changes[idx];
+ fdinfo->idxplus1 = idx + 1;
+
+ memset(change, 0, sizeof(struct event_change));
+ change->fd = fd;
+ change->old_events = old_events;
+ } else {
+ change = &changelist->changes[fdinfo->idxplus1 - 1];
+ EVUTIL_ASSERT(change->fd == fd);
+ }
+ return change;
+}
+
+int
+event_changelist_add_(struct event_base *base, evutil_socket_t fd, short old, short events,
+ void *p)
+{
+ struct event_changelist *changelist = &base->changelist;
+ struct event_changelist_fdinfo *fdinfo = p;
+ struct event_change *change;
+
+ event_changelist_check(base);
+
+ change = event_changelist_get_or_construct(changelist, fd, old, fdinfo);
+ if (!change)
+ return -1;
+
+ /* An add replaces any previous delete, but doesn't result in a no-op,
+ * since the delete might fail (because the fd had been closed since
+ * the last add, for instance. */
+
+ if (events & (EV_READ|EV_SIGNAL)) {
+ change->read_change = EV_CHANGE_ADD |
+ (events & (EV_ET|EV_PERSIST|EV_SIGNAL));
+ }
+ if (events & EV_WRITE) {
+ change->write_change = EV_CHANGE_ADD |
+ (events & (EV_ET|EV_PERSIST|EV_SIGNAL));
+ }
+ if (events & EV_CLOSED) {
+ change->close_change = EV_CHANGE_ADD |
+ (events & (EV_ET|EV_PERSIST|EV_SIGNAL));
+ }
+
+ event_changelist_check(base);
+ return (0);
+}
+
+int
+event_changelist_del_(struct event_base *base, evutil_socket_t fd, short old, short events,
+ void *p)
+{
+ struct event_changelist *changelist = &base->changelist;
+ struct event_changelist_fdinfo *fdinfo = p;
+ struct event_change *change;
+
+ event_changelist_check(base);
+ change = event_changelist_get_or_construct(changelist, fd, old, fdinfo);
+ event_changelist_check(base);
+ if (!change)
+ return -1;
+
+ /* A delete on an event set that doesn't contain the event to be
+ deleted produces a no-op. This effectively emoves any previous
+ uncommitted add, rather than replacing it: on those platforms where
+ "add, delete, dispatch" is not the same as "no-op, dispatch", we
+ want the no-op behavior.
+
+ If we have a no-op item, we could remove it it from the list
+ entirely, but really there's not much point: skipping the no-op
+ change when we do the dispatch later is far cheaper than rejuggling
+ the array now.
+
+ As this stands, it also lets through deletions of events that are
+ not currently set.
+ */
+
+ if (events & (EV_READ|EV_SIGNAL)) {
+ if (!(change->old_events & (EV_READ | EV_SIGNAL)))
+ change->read_change = 0;
+ else
+ change->read_change = EV_CHANGE_DEL;
+ }
+ if (events & EV_WRITE) {
+ if (!(change->old_events & EV_WRITE))
+ change->write_change = 0;
+ else
+ change->write_change = EV_CHANGE_DEL;
+ }
+ if (events & EV_CLOSED) {
+ if (!(change->old_events & EV_CLOSED))
+ change->close_change = 0;
+ else
+ change->close_change = EV_CHANGE_DEL;
+ }
+
+ event_changelist_check(base);
+ return (0);
+}
+
+/* Helper for evmap_check_integrity_: verify that all of the events pending on
+ * given fd are set up correctly, and that the nread and nwrite counts on that
+ * fd are correct. */
+static int
+evmap_io_check_integrity_fn(struct event_base *base, evutil_socket_t fd,
+ struct evmap_io *io_info, void *arg)
+{
+ struct event *ev;
+ int n_read = 0, n_write = 0, n_close = 0;
+
+ /* First, make sure the list itself isn't corrupt. Otherwise,
+ * running LIST_FOREACH could be an exciting adventure. */
+ EVUTIL_ASSERT_LIST_OK(&io_info->events, event, ev_io_next);
+
+ LIST_FOREACH(ev, &io_info->events, ev_io_next) {
+ EVUTIL_ASSERT(ev->ev_flags & EVLIST_INSERTED);
+ EVUTIL_ASSERT(ev->ev_fd == fd);
+ EVUTIL_ASSERT(!(ev->ev_events & EV_SIGNAL));
+ EVUTIL_ASSERT((ev->ev_events & (EV_READ|EV_WRITE|EV_CLOSED)));
+ if (ev->ev_events & EV_READ)
+ ++n_read;
+ if (ev->ev_events & EV_WRITE)
+ ++n_write;
+ if (ev->ev_events & EV_CLOSED)
+ ++n_close;
+ }
+
+ EVUTIL_ASSERT(n_read == io_info->nread);
+ EVUTIL_ASSERT(n_write == io_info->nwrite);
+ EVUTIL_ASSERT(n_close == io_info->nclose);
+
+ return 0;
+}
+
+/* Helper for evmap_check_integrity_: verify that all of the events pending
+ * on given signal are set up correctly. */
+static int
+evmap_signal_check_integrity_fn(struct event_base *base,
+ int signum, struct evmap_signal *sig_info, void *arg)
+{
+ struct event *ev;
+ /* First, make sure the list itself isn't corrupt. */
+ EVUTIL_ASSERT_LIST_OK(&sig_info->events, event, ev_signal_next);
+
+ LIST_FOREACH(ev, &sig_info->events, ev_io_next) {
+ EVUTIL_ASSERT(ev->ev_flags & EVLIST_INSERTED);
+ EVUTIL_ASSERT(ev->ev_fd == signum);
+ EVUTIL_ASSERT((ev->ev_events & EV_SIGNAL));
+ EVUTIL_ASSERT(!(ev->ev_events & (EV_READ|EV_WRITE|EV_CLOSED)));
+ }
+ return 0;
+}
+
+void
+evmap_check_integrity_(struct event_base *base)
+{
+ evmap_io_foreach_fd(base, evmap_io_check_integrity_fn, NULL);
+ evmap_signal_foreach_signal(base, evmap_signal_check_integrity_fn, NULL);
+
+ if (base->evsel->add == event_changelist_add_)
+ event_changelist_assert_ok(base);
+}
+
+/* Helper type for evmap_foreach_event_: Bundles a function to call on every
+ * event, and the user-provided void* to use as its third argument. */
+struct evmap_foreach_event_helper {
+ event_base_foreach_event_cb fn;
+ void *arg;
+};
+
+/* Helper for evmap_foreach_event_: calls a provided function on every event
+ * pending on a given fd. */
+static int
+evmap_io_foreach_event_fn(struct event_base *base, evutil_socket_t fd,
+ struct evmap_io *io_info, void *arg)
+{
+ struct evmap_foreach_event_helper *h = arg;
+ struct event *ev;
+ int r;
+ LIST_FOREACH(ev, &io_info->events, ev_io_next) {
+ if ((r = h->fn(base, ev, h->arg)))
+ return r;
+ }
+ return 0;
+}
+
+/* Helper for evmap_foreach_event_: calls a provided function on every event
+ * pending on a given signal. */
+static int
+evmap_signal_foreach_event_fn(struct event_base *base, int signum,
+ struct evmap_signal *sig_info, void *arg)
+{
+ struct event *ev;
+ struct evmap_foreach_event_helper *h = arg;
+ int r;
+ LIST_FOREACH(ev, &sig_info->events, ev_signal_next) {
+ if ((r = h->fn(base, ev, h->arg)))
+ return r;
+ }
+ return 0;
+}
+
+int
+evmap_foreach_event_(struct event_base *base,
+ event_base_foreach_event_cb fn, void *arg)
+{
+ struct evmap_foreach_event_helper h;
+ int r;
+ h.fn = fn;
+ h.arg = arg;
+ if ((r = evmap_io_foreach_fd(base, evmap_io_foreach_event_fn, &h)))
+ return r;
+ return evmap_signal_foreach_signal(base, evmap_signal_foreach_event_fn, &h);
+}
+
diff --git a/protocols/Telegram/tgl/libevent/evmap.obj b/protocols/Telegram/tgl/libevent/evmap.obj
new file mode 100644
index 0000000000..7b16cf4a94
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/evmap.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/evport.c b/protocols/Telegram/tgl/libevent/evport.c
new file mode 100644
index 0000000000..a014386bfe
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/evport.c
@@ -0,0 +1,451 @@
+/*
+ * Submitted by David Pacheco (dp.spambait@gmail.com)
+ *
+ * Copyright 2006-2007 Niels Provos
+ * Copyright 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 SUN MICROSYSTEMS, INC. ``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 SUN MICROSYSTEMS, INC. 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.
+ */
+
+/*
+ * Copyright (c) 2007 Sun Microsystems. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * evport.c: event backend using Solaris 10 event ports. See port_create(3C).
+ * This implementation is loosely modeled after the one used for select(2) (in
+ * select.c).
+ *
+ * The outstanding events are tracked in a data structure called evport_data.
+ * Each entry in the ed_fds array corresponds to a file descriptor, and contains
+ * pointers to the read and write events that correspond to that fd. (That is,
+ * when the file is readable, the "read" event should handle it, etc.)
+ *
+ * evport_add and evport_del update this data structure. evport_dispatch uses it
+ * to determine where to callback when an event occurs (which it gets from
+ * port_getn).
+ *
+ * Helper functions are used: grow() grows the file descriptor array as
+ * necessary when large fd's come in. reassociate() takes care of maintaining
+ * the proper file-descriptor/event-port associations.
+ *
+ * As in the select(2) implementation, signals are handled by evsignal.
+ */
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef EVENT__HAVE_EVENT_PORTS
+
+#include <sys/time.h>
+#include <sys/queue.h>
+#include <errno.h>
+#include <poll.h>
+#include <port.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+
+#include "event2/thread.h"
+
+#include "evthread-internal.h"
+#include "event-internal.h"
+#include "log-internal.h"
+#include "evsignal-internal.h"
+#include "evmap-internal.h"
+
+#define INITIAL_EVENTS_PER_GETN 8
+#define MAX_EVENTS_PER_GETN 4096
+
+/*
+ * Per-file-descriptor information about what events we're subscribed to. These
+ * fields are NULL if no event is subscribed to either of them.
+ */
+
+struct fd_info {
+ /* combinations of EV_READ and EV_WRITE */
+ short fdi_what;
+ /* Index of this fd within ed_pending, plus 1. Zero if this fd is
+ * not in ed_pending. (The +1 is a hack so that memset(0) will set
+ * it to a nil index. */
+ int pending_idx_plus_1;
+};
+
+#define FDI_HAS_READ(fdi) ((fdi)->fdi_what & EV_READ)
+#define FDI_HAS_WRITE(fdi) ((fdi)->fdi_what & EV_WRITE)
+#define FDI_HAS_EVENTS(fdi) (FDI_HAS_READ(fdi) || FDI_HAS_WRITE(fdi))
+#define FDI_TO_SYSEVENTS(fdi) (FDI_HAS_READ(fdi) ? POLLIN : 0) | \
+ (FDI_HAS_WRITE(fdi) ? POLLOUT : 0)
+
+struct evport_data {
+ int ed_port; /* event port for system events */
+ /* How many elements of ed_pending should we look at? */
+ int ed_npending;
+ /* How many elements are allocated in ed_pending and pevtlist? */
+ int ed_maxevents;
+ /* fdi's that we need to reassoc */
+ int *ed_pending;
+ /* storage space for incoming events. */
+ port_event_t *ed_pevtlist;
+
+};
+
+static void* evport_init(struct event_base *);
+static int evport_add(struct event_base *, int fd, short old, short events, void *);
+static int evport_del(struct event_base *, int fd, short old, short events, void *);
+static int evport_dispatch(struct event_base *, struct timeval *);
+static void evport_dealloc(struct event_base *);
+static int grow(struct evport_data *, int min_events);
+
+const struct eventop evportops = {
+ "evport",
+ evport_init,
+ evport_add,
+ evport_del,
+ evport_dispatch,
+ evport_dealloc,
+ 1, /* need reinit */
+ 0, /* features */
+ sizeof(struct fd_info), /* fdinfo length */
+};
+
+/*
+ * Initialize the event port implementation.
+ */
+
+static void*
+evport_init(struct event_base *base)
+{
+ struct evport_data *evpd;
+
+ if (!(evpd = mm_calloc(1, sizeof(struct evport_data))))
+ return (NULL);
+
+ if ((evpd->ed_port = port_create()) == -1) {
+ mm_free(evpd);
+ return (NULL);
+ }
+
+ if (grow(evpd, INITIAL_EVENTS_PER_GETN) < 0) {
+ close(evpd->ed_port);
+ mm_free(evpd);
+ return NULL;
+ }
+
+ evpd->ed_npending = 0;
+
+ evsig_init_(base);
+
+ return (evpd);
+}
+
+static int
+grow(struct evport_data *data, int min_events)
+{
+ int newsize;
+ int *new_pending;
+ port_event_t *new_pevtlist;
+ if (data->ed_maxevents) {
+ newsize = data->ed_maxevents;
+ do {
+ newsize *= 2;
+ } while (newsize < min_events);
+ } else {
+ newsize = min_events;
+ }
+
+ new_pending = mm_realloc(data->ed_pending, sizeof(int)*newsize);
+ if (new_pending == NULL)
+ return -1;
+ data->ed_pending = new_pending;
+ new_pevtlist = mm_realloc(data->ed_pevtlist, sizeof(port_event_t)*newsize);
+ if (new_pevtlist == NULL)
+ return -1;
+ data->ed_pevtlist = new_pevtlist;
+
+ data->ed_maxevents = newsize;
+ return 0;
+}
+
+#ifdef CHECK_INVARIANTS
+/*
+ * Checks some basic properties about the evport_data structure. Because it
+ * checks all file descriptors, this function can be expensive when the maximum
+ * file descriptor ever used is rather large.
+ */
+
+static void
+check_evportop(struct evport_data *evpd)
+{
+ EVUTIL_ASSERT(evpd);
+ EVUTIL_ASSERT(evpd->ed_port > 0);
+}
+
+/*
+ * Verifies very basic integrity of a given port_event.
+ */
+static void
+check_event(port_event_t* pevt)
+{
+ /*
+ * We've only registered for PORT_SOURCE_FD events. The only
+ * other thing we can legitimately receive is PORT_SOURCE_ALERT,
+ * but since we're not using port_alert either, we can assume
+ * PORT_SOURCE_FD.
+ */
+ EVUTIL_ASSERT(pevt->portev_source == PORT_SOURCE_FD);
+}
+
+#else
+#define check_evportop(epop)
+#define check_event(pevt)
+#endif /* CHECK_INVARIANTS */
+
+/*
+ * (Re)associates the given file descriptor with the event port. The OS events
+ * are specified (implicitly) from the fd_info struct.
+ */
+static int
+reassociate(struct evport_data *epdp, struct fd_info *fdip, int fd)
+{
+ int sysevents = FDI_TO_SYSEVENTS(fdip);
+
+ if (sysevents != 0) {
+ if (port_associate(epdp->ed_port, PORT_SOURCE_FD,
+ fd, sysevents, fdip) == -1) {
+ event_warn("port_associate");
+ return (-1);
+ }
+ }
+
+ check_evportop(epdp);
+
+ return (0);
+}
+
+/*
+ * Main event loop - polls port_getn for some number of events, and processes
+ * them.
+ */
+
+static int
+evport_dispatch(struct event_base *base, struct timeval *tv)
+{
+ int i, res;
+ struct evport_data *epdp = base->evbase;
+ port_event_t *pevtlist = epdp->ed_pevtlist;
+
+ /*
+ * port_getn will block until it has at least nevents events. It will
+ * also return how many it's given us (which may be more than we asked
+ * for, as long as it's less than our maximum (ed_maxevents)) in
+ * nevents.
+ */
+ int nevents = 1;
+
+ /*
+ * We have to convert a struct timeval to a struct timespec
+ * (only difference is nanoseconds vs. microseconds). If no time-based
+ * events are active, we should wait for I/O (and tv == NULL).
+ */
+ struct timespec ts;
+ struct timespec *ts_p = NULL;
+ if (tv != NULL) {
+ ts.tv_sec = tv->tv_sec;
+ ts.tv_nsec = tv->tv_usec * 1000;
+ ts_p = &ts;
+ }
+
+ /*
+ * Before doing anything else, we need to reassociate the events we hit
+ * last time which need reassociation. See comment at the end of the
+ * loop below.
+ */
+ for (i = 0; i < epdp->ed_npending; ++i) {
+ struct fd_info *fdi = NULL;
+ const int fd = epdp->ed_pending[i];
+ if (fd != -1) {
+ /* We might have cleared out this event; we need
+ * to be sure that it's still set. */
+ fdi = evmap_io_get_fdinfo_(&base->io, fd);
+ }
+
+ if (fdi != NULL && FDI_HAS_EVENTS(fdi)) {
+ reassociate(epdp, fdi, fd);
+ /* epdp->ed_pending[i] = -1; */
+ fdi->pending_idx_plus_1 = 0;
+ }
+ }
+
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+
+ res = port_getn(epdp->ed_port, pevtlist, epdp->ed_maxevents,
+ (unsigned int *) &nevents, ts_p);
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+
+ if (res == -1) {
+ if (errno == EINTR || errno == EAGAIN) {
+ return (0);
+ } else if (errno == ETIME) {
+ if (nevents == 0)
+ return (0);
+ } else {
+ event_warn("port_getn");
+ return (-1);
+ }
+ }
+
+ event_debug(("%s: port_getn reports %d events", __func__, nevents));
+
+ for (i = 0; i < nevents; ++i) {
+ port_event_t *pevt = &pevtlist[i];
+ int fd = (int) pevt->portev_object;
+ struct fd_info *fdi = pevt->portev_user;
+ /*EVUTIL_ASSERT(evmap_io_get_fdinfo_(&base->io, fd) == fdi);*/
+
+ check_evportop(epdp);
+ check_event(pevt);
+ epdp->ed_pending[i] = fd;
+ fdi->pending_idx_plus_1 = i + 1;
+
+ /*
+ * Figure out what kind of event it was
+ * (because we have to pass this to the callback)
+ */
+ res = 0;
+ if (pevt->portev_events & (POLLERR|POLLHUP)) {
+ res = EV_READ | EV_WRITE;
+ } else {
+ if (pevt->portev_events & POLLIN)
+ res |= EV_READ;
+ if (pevt->portev_events & POLLOUT)
+ res |= EV_WRITE;
+ }
+
+ /*
+ * Check for the error situations or a hangup situation
+ */
+ if (pevt->portev_events & (POLLERR|POLLHUP|POLLNVAL))
+ res |= EV_READ|EV_WRITE;
+
+ evmap_io_active_(base, fd, res);
+ } /* end of all events gotten */
+ epdp->ed_npending = nevents;
+
+ if (nevents == epdp->ed_maxevents &&
+ epdp->ed_maxevents < MAX_EVENTS_PER_GETN) {
+ /* we used all the space this time. We should be ready
+ * for more events next time around. */
+ grow(epdp, epdp->ed_maxevents * 2);
+ }
+
+ check_evportop(epdp);
+
+ return (0);
+}
+
+
+/*
+ * Adds the given event (so that you will be notified when it happens via
+ * the callback function).
+ */
+
+static int
+evport_add(struct event_base *base, int fd, short old, short events, void *p)
+{
+ struct evport_data *evpd = base->evbase;
+ struct fd_info *fdi = p;
+
+ check_evportop(evpd);
+
+ fdi->fdi_what |= events;
+
+ return reassociate(evpd, fdi, fd);
+}
+
+/*
+ * Removes the given event from the list of events to wait for.
+ */
+
+static int
+evport_del(struct event_base *base, int fd, short old, short events, void *p)
+{
+ struct evport_data *evpd = base->evbase;
+ struct fd_info *fdi = p;
+ int associated = ! fdi->pending_idx_plus_1;
+
+ check_evportop(evpd);
+
+ fdi->fdi_what &= ~(events &(EV_READ|EV_WRITE));
+
+ if (associated) {
+ if (!FDI_HAS_EVENTS(fdi) &&
+ port_dissociate(evpd->ed_port, PORT_SOURCE_FD, fd) == -1) {
+ /*
+ * Ignore EBADFD error the fd could have been closed
+ * before event_del() was called.
+ */
+ if (errno != EBADFD) {
+ event_warn("port_dissociate");
+ return (-1);
+ }
+ } else {
+ if (FDI_HAS_EVENTS(fdi)) {
+ return (reassociate(evpd, fdi, fd));
+ }
+ }
+ } else {
+ if ((fdi->fdi_what & (EV_READ|EV_WRITE)) == 0) {
+ const int i = fdi->pending_idx_plus_1 - 1;
+ EVUTIL_ASSERT(evpd->ed_pending[i] == fd);
+ evpd->ed_pending[i] = -1;
+ fdi->pending_idx_plus_1 = 0;
+ }
+ }
+ return 0;
+}
+
+
+static void
+evport_dealloc(struct event_base *base)
+{
+ struct evport_data *evpd = base->evbase;
+
+ evsig_dealloc_(base);
+
+ close(evpd->ed_port);
+
+ if (evpd->ed_pending)
+ mm_free(evpd->ed_pending);
+ if (evpd->ed_pevtlist)
+ mm_free(evpd->ed_pevtlist);
+
+ mm_free(evpd);
+}
+
+#endif /* EVENT__HAVE_EVENT_PORTS */
diff --git a/protocols/Telegram/tgl/libevent/evrpc-internal.h b/protocols/Telegram/tgl/libevent/evrpc-internal.h
new file mode 100644
index 0000000000..9eb376386d
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/evrpc-internal.h
@@ -0,0 +1,205 @@
+/*
+ * Copyright (c) 2006-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVRPC_INTERNAL_H_INCLUDED_
+#define EVRPC_INTERNAL_H_INCLUDED_
+
+#include "event2/http.h"
+#include "http-internal.h"
+
+struct evrpc;
+struct evrpc_request_wrapper;
+
+#define EVRPC_URI_PREFIX "/.rpc."
+
+struct evrpc_hook {
+ TAILQ_ENTRY(evrpc_hook) next;
+
+ /* returns EVRPC_TERMINATE; if the rpc should be aborted.
+ * a hook is is allowed to rewrite the evbuffer
+ */
+ int (*process)(void *, struct evhttp_request *,
+ struct evbuffer *, void *);
+ void *process_arg;
+};
+
+TAILQ_HEAD(evrpc_hook_list, evrpc_hook);
+
+/*
+ * this is shared between the base and the pool, so that we can reuse
+ * the hook adding functions; we alias both evrpc_pool and evrpc_base
+ * to this common structure.
+ */
+
+struct evrpc_hook_ctx;
+TAILQ_HEAD(evrpc_pause_list, evrpc_hook_ctx);
+
+struct evrpc_hooks_ {
+ /* hooks for processing outbound and inbound rpcs */
+ struct evrpc_hook_list in_hooks;
+ struct evrpc_hook_list out_hooks;
+
+ struct evrpc_pause_list pause_requests;
+};
+
+#define input_hooks common.in_hooks
+#define output_hooks common.out_hooks
+#define paused_requests common.pause_requests
+
+struct evrpc_base {
+ struct evrpc_hooks_ common;
+
+ /* the HTTP server under which we register our RPC calls */
+ struct evhttp* http_server;
+
+ /* a list of all RPCs registered with us */
+ TAILQ_HEAD(evrpc_list, evrpc) registered_rpcs;
+};
+
+struct evrpc_req_generic;
+void evrpc_reqstate_free_(struct evrpc_req_generic* rpc_state);
+
+/* A pool for holding evhttp_connection objects */
+struct evrpc_pool {
+ struct evrpc_hooks_ common;
+
+ struct event_base *base;
+
+ struct evconq connections;
+
+ int timeout;
+
+ TAILQ_HEAD(evrpc_requestq, evrpc_request_wrapper) (requests);
+};
+
+struct evrpc_hook_ctx {
+ TAILQ_ENTRY(evrpc_hook_ctx) next;
+
+ void *ctx;
+ void (*cb)(void *, enum EVRPC_HOOK_RESULT);
+};
+
+struct evrpc_meta {
+ TAILQ_ENTRY(evrpc_meta) next;
+ char *key;
+
+ void *data;
+ size_t data_size;
+};
+
+TAILQ_HEAD(evrpc_meta_list, evrpc_meta);
+
+struct evrpc_hook_meta {
+ struct evrpc_meta_list meta_data;
+ struct evhttp_connection *evcon;
+};
+
+/* allows association of meta data with a request */
+static void evrpc_hook_associate_meta_(struct evrpc_hook_meta **pctx,
+ struct evhttp_connection *evcon);
+
+/* creates a new meta data store */
+static struct evrpc_hook_meta *evrpc_hook_meta_new_(void);
+
+/* frees the meta data associated with a request */
+static void evrpc_hook_context_free_(struct evrpc_hook_meta *ctx);
+
+/* the server side of an rpc */
+
+/* We alias the RPC specific structs to this voided one */
+struct evrpc_req_generic {
+ /*
+ * allows association of meta data via hooks - needs to be
+ * synchronized with evrpc_request_wrapper
+ */
+ struct evrpc_hook_meta *hook_meta;
+
+ /* the unmarshaled request object */
+ void *request;
+
+ /* the empty reply object that needs to be filled in */
+ void *reply;
+
+ /*
+ * the static structure for this rpc; that can be used to
+ * automatically unmarshal and marshal the http buffers.
+ */
+ struct evrpc *rpc;
+
+ /*
+ * the http request structure on which we need to answer.
+ */
+ struct evhttp_request* http_req;
+
+ /*
+ * Temporary data store for marshaled data
+ */
+ struct evbuffer* rpc_data;
+};
+
+/* the client side of an rpc request */
+struct evrpc_request_wrapper {
+ /*
+ * allows association of meta data via hooks - needs to be
+ * synchronized with evrpc_req_generic.
+ */
+ struct evrpc_hook_meta *hook_meta;
+
+ TAILQ_ENTRY(evrpc_request_wrapper) next;
+
+ /* pool on which this rpc request is being made */
+ struct evrpc_pool *pool;
+
+ /* connection on which the request is being sent */
+ struct evhttp_connection *evcon;
+
+ /* the actual request */
+ struct evhttp_request *req;
+
+ /* event for implementing request timeouts */
+ struct event ev_timeout;
+
+ /* the name of the rpc */
+ char *name;
+
+ /* callback */
+ void (*cb)(struct evrpc_status*, void *request, void *reply, void *arg);
+ void *cb_arg;
+
+ void *request;
+ void *reply;
+
+ /* unmarshals the buffer into the proper request structure */
+ void (*request_marshal)(struct evbuffer *, void *);
+
+ /* removes all stored state in the reply */
+ void (*reply_clear)(void *);
+
+ /* marshals the reply into a buffer */
+ int (*reply_unmarshal)(void *, struct evbuffer*);
+};
+
+#endif /* EVRPC_INTERNAL_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/evrpc.c b/protocols/Telegram/tgl/libevent/evrpc.c
new file mode 100644
index 0000000000..2443ab2793
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/evrpc.c
@@ -0,0 +1,1171 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef _WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <winsock2.h>
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#endif
+
+#include <sys/types.h>
+#ifndef _WIN32
+#include <sys/socket.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#include <stdio.h>
+#include <stdlib.h>
+#ifndef _WIN32
+#include <unistd.h>
+#endif
+#include <errno.h>
+#include <signal.h>
+#include <string.h>
+
+#include <sys/queue.h>
+
+#include "event2/event.h"
+#include "event2/event_struct.h"
+#include "event2/rpc.h"
+#include "event2/rpc_struct.h"
+#include "evrpc-internal.h"
+#include "event2/http.h"
+#include "event2/buffer.h"
+#include "event2/tag.h"
+#include "event2/http_struct.h"
+#include "event2/http_compat.h"
+#include "event2/util.h"
+#include "util-internal.h"
+#include "log-internal.h"
+#include "mm-internal.h"
+
+struct evrpc_base *
+evrpc_init(struct evhttp *http_server)
+{
+ struct evrpc_base* base = mm_calloc(1, sizeof(struct evrpc_base));
+ if (base == NULL)
+ return (NULL);
+
+ /* we rely on the tagging sub system */
+ evtag_init();
+
+ TAILQ_INIT(&base->registered_rpcs);
+ TAILQ_INIT(&base->input_hooks);
+ TAILQ_INIT(&base->output_hooks);
+
+ TAILQ_INIT(&base->paused_requests);
+
+ base->http_server = http_server;
+
+ return (base);
+}
+
+void
+evrpc_free(struct evrpc_base *base)
+{
+ struct evrpc *rpc;
+ struct evrpc_hook *hook;
+ struct evrpc_hook_ctx *pause;
+ int r;
+
+ while ((rpc = TAILQ_FIRST(&base->registered_rpcs)) != NULL) {
+ r = evrpc_unregister_rpc(base, rpc->uri);
+ EVUTIL_ASSERT(r == 0);
+ }
+ while ((pause = TAILQ_FIRST(&base->paused_requests)) != NULL) {
+ TAILQ_REMOVE(&base->paused_requests, pause, next);
+ mm_free(pause);
+ }
+ while ((hook = TAILQ_FIRST(&base->input_hooks)) != NULL) {
+ r = evrpc_remove_hook(base, EVRPC_INPUT, hook);
+ EVUTIL_ASSERT(r);
+ }
+ while ((hook = TAILQ_FIRST(&base->output_hooks)) != NULL) {
+ r = evrpc_remove_hook(base, EVRPC_OUTPUT, hook);
+ EVUTIL_ASSERT(r);
+ }
+ mm_free(base);
+}
+
+void *
+evrpc_add_hook(void *vbase,
+ enum EVRPC_HOOK_TYPE hook_type,
+ int (*cb)(void *, struct evhttp_request *, struct evbuffer *, void *),
+ void *cb_arg)
+{
+ struct evrpc_hooks_ *base = vbase;
+ struct evrpc_hook_list *head = NULL;
+ struct evrpc_hook *hook = NULL;
+ switch (hook_type) {
+ case EVRPC_INPUT:
+ head = &base->in_hooks;
+ break;
+ case EVRPC_OUTPUT:
+ head = &base->out_hooks;
+ break;
+ default:
+ EVUTIL_ASSERT(hook_type == EVRPC_INPUT || hook_type == EVRPC_OUTPUT);
+ }
+
+ hook = mm_calloc(1, sizeof(struct evrpc_hook));
+ EVUTIL_ASSERT(hook != NULL);
+
+ hook->process = cb;
+ hook->process_arg = cb_arg;
+ TAILQ_INSERT_TAIL(head, hook, next);
+
+ return (hook);
+}
+
+static int
+evrpc_remove_hook_internal(struct evrpc_hook_list *head, void *handle)
+{
+ struct evrpc_hook *hook = NULL;
+ TAILQ_FOREACH(hook, head, next) {
+ if (hook == handle) {
+ TAILQ_REMOVE(head, hook, next);
+ mm_free(hook);
+ return (1);
+ }
+ }
+
+ return (0);
+}
+
+/*
+ * remove the hook specified by the handle
+ */
+
+int
+evrpc_remove_hook(void *vbase, enum EVRPC_HOOK_TYPE hook_type, void *handle)
+{
+ struct evrpc_hooks_ *base = vbase;
+ struct evrpc_hook_list *head = NULL;
+ switch (hook_type) {
+ case EVRPC_INPUT:
+ head = &base->in_hooks;
+ break;
+ case EVRPC_OUTPUT:
+ head = &base->out_hooks;
+ break;
+ default:
+ EVUTIL_ASSERT(hook_type == EVRPC_INPUT || hook_type == EVRPC_OUTPUT);
+ }
+
+ return (evrpc_remove_hook_internal(head, handle));
+}
+
+static int
+evrpc_process_hooks(struct evrpc_hook_list *head, void *ctx,
+ struct evhttp_request *req, struct evbuffer *evbuf)
+{
+ struct evrpc_hook *hook;
+ TAILQ_FOREACH(hook, head, next) {
+ int res = hook->process(ctx, req, evbuf, hook->process_arg);
+ if (res != EVRPC_CONTINUE)
+ return (res);
+ }
+
+ return (EVRPC_CONTINUE);
+}
+
+static void evrpc_pool_schedule(struct evrpc_pool *pool);
+static void evrpc_request_cb(struct evhttp_request *, void *);
+
+/*
+ * Registers a new RPC with the HTTP server. The evrpc object is expected
+ * to have been filled in via the EVRPC_REGISTER_OBJECT macro which in turn
+ * calls this function.
+ */
+
+static char *
+evrpc_construct_uri(const char *uri)
+{
+ char *constructed_uri;
+ size_t constructed_uri_len;
+
+ constructed_uri_len = strlen(EVRPC_URI_PREFIX) + strlen(uri) + 1;
+ if ((constructed_uri = mm_malloc(constructed_uri_len)) == NULL)
+ event_err(1, "%s: failed to register rpc at %s",
+ __func__, uri);
+ memcpy(constructed_uri, EVRPC_URI_PREFIX, strlen(EVRPC_URI_PREFIX));
+ memcpy(constructed_uri + strlen(EVRPC_URI_PREFIX), uri, strlen(uri));
+ constructed_uri[constructed_uri_len - 1] = '\0';
+
+ return (constructed_uri);
+}
+
+int
+evrpc_register_rpc(struct evrpc_base *base, struct evrpc *rpc,
+ void (*cb)(struct evrpc_req_generic *, void *), void *cb_arg)
+{
+ char *constructed_uri = evrpc_construct_uri(rpc->uri);
+
+ rpc->base = base;
+ rpc->cb = cb;
+ rpc->cb_arg = cb_arg;
+
+ TAILQ_INSERT_TAIL(&base->registered_rpcs, rpc, next);
+
+ evhttp_set_cb(base->http_server,
+ constructed_uri,
+ evrpc_request_cb,
+ rpc);
+
+ mm_free(constructed_uri);
+
+ return (0);
+}
+
+int
+evrpc_unregister_rpc(struct evrpc_base *base, const char *name)
+{
+ char *registered_uri = NULL;
+ struct evrpc *rpc;
+ int r;
+
+ /* find the right rpc; linear search might be slow */
+ TAILQ_FOREACH(rpc, &base->registered_rpcs, next) {
+ if (strcmp(rpc->uri, name) == 0)
+ break;
+ }
+ if (rpc == NULL) {
+ /* We did not find an RPC with this name */
+ return (-1);
+ }
+ TAILQ_REMOVE(&base->registered_rpcs, rpc, next);
+
+ registered_uri = evrpc_construct_uri(name);
+
+ /* remove the http server callback */
+ r = evhttp_del_cb(base->http_server, registered_uri);
+ EVUTIL_ASSERT(r == 0);
+
+ mm_free(registered_uri);
+
+ mm_free((char *)rpc->uri);
+ mm_free(rpc);
+ return (0);
+}
+
+static int evrpc_pause_request(void *vbase, void *ctx,
+ void (*cb)(void *, enum EVRPC_HOOK_RESULT));
+static void evrpc_request_cb_closure(void *, enum EVRPC_HOOK_RESULT);
+
+static void
+evrpc_request_cb(struct evhttp_request *req, void *arg)
+{
+ struct evrpc *rpc = arg;
+ struct evrpc_req_generic *rpc_state = NULL;
+
+ /* let's verify the outside parameters */
+ if (req->type != EVHTTP_REQ_POST ||
+ evbuffer_get_length(req->input_buffer) <= 0)
+ goto error;
+
+ rpc_state = mm_calloc(1, sizeof(struct evrpc_req_generic));
+ if (rpc_state == NULL)
+ goto error;
+ rpc_state->rpc = rpc;
+ rpc_state->http_req = req;
+ rpc_state->rpc_data = NULL;
+
+ if (TAILQ_FIRST(&rpc->base->input_hooks) != NULL) {
+ int hook_res;
+
+ evrpc_hook_associate_meta_(&rpc_state->hook_meta, req->evcon);
+
+ /*
+ * allow hooks to modify the outgoing request
+ */
+ hook_res = evrpc_process_hooks(&rpc->base->input_hooks,
+ rpc_state, req, req->input_buffer);
+ switch (hook_res) {
+ case EVRPC_TERMINATE:
+ goto error;
+ case EVRPC_PAUSE:
+ evrpc_pause_request(rpc->base, rpc_state,
+ evrpc_request_cb_closure);
+ return;
+ case EVRPC_CONTINUE:
+ break;
+ default:
+ EVUTIL_ASSERT(hook_res == EVRPC_TERMINATE ||
+ hook_res == EVRPC_CONTINUE ||
+ hook_res == EVRPC_PAUSE);
+ }
+ }
+
+ evrpc_request_cb_closure(rpc_state, EVRPC_CONTINUE);
+ return;
+
+error:
+ evrpc_reqstate_free_(rpc_state);
+ evhttp_send_error(req, HTTP_SERVUNAVAIL, NULL);
+ return;
+}
+
+static void
+evrpc_request_cb_closure(void *arg, enum EVRPC_HOOK_RESULT hook_res)
+{
+ struct evrpc_req_generic *rpc_state = arg;
+ struct evrpc *rpc;
+ struct evhttp_request *req;
+
+ EVUTIL_ASSERT(rpc_state);
+ rpc = rpc_state->rpc;
+ req = rpc_state->http_req;
+
+ if (hook_res == EVRPC_TERMINATE)
+ goto error;
+
+ /* let's check that we can parse the request */
+ rpc_state->request = rpc->request_new(rpc->request_new_arg);
+ if (rpc_state->request == NULL)
+ goto error;
+
+ if (rpc->request_unmarshal(
+ rpc_state->request, req->input_buffer) == -1) {
+ /* we failed to parse the request; that's a bummer */
+ goto error;
+ }
+
+ /* at this point, we have a well formed request, prepare the reply */
+
+ rpc_state->reply = rpc->reply_new(rpc->reply_new_arg);
+ if (rpc_state->reply == NULL)
+ goto error;
+
+ /* give the rpc to the user; they can deal with it */
+ rpc->cb(rpc_state, rpc->cb_arg);
+
+ return;
+
+error:
+ evrpc_reqstate_free_(rpc_state);
+ evhttp_send_error(req, HTTP_SERVUNAVAIL, NULL);
+ return;
+}
+
+
+void
+evrpc_reqstate_free_(struct evrpc_req_generic* rpc_state)
+{
+ struct evrpc *rpc;
+ EVUTIL_ASSERT(rpc_state != NULL);
+ rpc = rpc_state->rpc;
+
+ /* clean up all memory */
+ if (rpc_state->hook_meta != NULL)
+ evrpc_hook_context_free_(rpc_state->hook_meta);
+ if (rpc_state->request != NULL)
+ rpc->request_free(rpc_state->request);
+ if (rpc_state->reply != NULL)
+ rpc->reply_free(rpc_state->reply);
+ if (rpc_state->rpc_data != NULL)
+ evbuffer_free(rpc_state->rpc_data);
+ mm_free(rpc_state);
+}
+
+static void
+evrpc_request_done_closure(void *, enum EVRPC_HOOK_RESULT);
+
+void
+evrpc_request_done(struct evrpc_req_generic *rpc_state)
+{
+ struct evhttp_request *req;
+ struct evrpc *rpc;
+
+ EVUTIL_ASSERT(rpc_state);
+
+ req = rpc_state->http_req;
+ rpc = rpc_state->rpc;
+
+ if (rpc->reply_complete(rpc_state->reply) == -1) {
+ /* the reply was not completely filled in. error out */
+ goto error;
+ }
+
+ if ((rpc_state->rpc_data = evbuffer_new()) == NULL) {
+ /* out of memory */
+ goto error;
+ }
+
+ /* serialize the reply */
+ rpc->reply_marshal(rpc_state->rpc_data, rpc_state->reply);
+
+ if (TAILQ_FIRST(&rpc->base->output_hooks) != NULL) {
+ int hook_res;
+
+ evrpc_hook_associate_meta_(&rpc_state->hook_meta, req->evcon);
+
+ /* do hook based tweaks to the request */
+ hook_res = evrpc_process_hooks(&rpc->base->output_hooks,
+ rpc_state, req, rpc_state->rpc_data);
+ switch (hook_res) {
+ case EVRPC_TERMINATE:
+ goto error;
+ case EVRPC_PAUSE:
+ if (evrpc_pause_request(rpc->base, rpc_state,
+ evrpc_request_done_closure) == -1)
+ goto error;
+ return;
+ case EVRPC_CONTINUE:
+ break;
+ default:
+ EVUTIL_ASSERT(hook_res == EVRPC_TERMINATE ||
+ hook_res == EVRPC_CONTINUE ||
+ hook_res == EVRPC_PAUSE);
+ }
+ }
+
+ evrpc_request_done_closure(rpc_state, EVRPC_CONTINUE);
+ return;
+
+error:
+ evrpc_reqstate_free_(rpc_state);
+ evhttp_send_error(req, HTTP_SERVUNAVAIL, NULL);
+ return;
+}
+
+void *
+evrpc_get_request(struct evrpc_req_generic *req)
+{
+ return req->request;
+}
+
+void *
+evrpc_get_reply(struct evrpc_req_generic *req)
+{
+ return req->reply;
+}
+
+static void
+evrpc_request_done_closure(void *arg, enum EVRPC_HOOK_RESULT hook_res)
+{
+ struct evrpc_req_generic *rpc_state = arg;
+ struct evhttp_request *req;
+ EVUTIL_ASSERT(rpc_state);
+ req = rpc_state->http_req;
+
+ if (hook_res == EVRPC_TERMINATE)
+ goto error;
+
+ /* on success, we are going to transmit marshaled binary data */
+ if (evhttp_find_header(req->output_headers, "Content-Type") == NULL) {
+ evhttp_add_header(req->output_headers,
+ "Content-Type", "application/octet-stream");
+ }
+ evhttp_send_reply(req, HTTP_OK, "OK", rpc_state->rpc_data);
+
+ evrpc_reqstate_free_(rpc_state);
+
+ return;
+
+error:
+ evrpc_reqstate_free_(rpc_state);
+ evhttp_send_error(req, HTTP_SERVUNAVAIL, NULL);
+ return;
+}
+
+
+/* Client implementation of RPC site */
+
+static int evrpc_schedule_request(struct evhttp_connection *connection,
+ struct evrpc_request_wrapper *ctx);
+
+struct evrpc_pool *
+evrpc_pool_new(struct event_base *base)
+{
+ struct evrpc_pool *pool = mm_calloc(1, sizeof(struct evrpc_pool));
+ if (pool == NULL)
+ return (NULL);
+
+ TAILQ_INIT(&pool->connections);
+ TAILQ_INIT(&pool->requests);
+
+ TAILQ_INIT(&pool->paused_requests);
+
+ TAILQ_INIT(&pool->input_hooks);
+ TAILQ_INIT(&pool->output_hooks);
+
+ pool->base = base;
+ pool->timeout = -1;
+
+ return (pool);
+}
+
+static void
+evrpc_request_wrapper_free(struct evrpc_request_wrapper *request)
+{
+ if (request->hook_meta != NULL)
+ evrpc_hook_context_free_(request->hook_meta);
+ mm_free(request->name);
+ mm_free(request);
+}
+
+void
+evrpc_pool_free(struct evrpc_pool *pool)
+{
+ struct evhttp_connection *connection;
+ struct evrpc_request_wrapper *request;
+ struct evrpc_hook_ctx *pause;
+ struct evrpc_hook *hook;
+ int r;
+
+ while ((request = TAILQ_FIRST(&pool->requests)) != NULL) {
+ TAILQ_REMOVE(&pool->requests, request, next);
+ evrpc_request_wrapper_free(request);
+ }
+
+ while ((pause = TAILQ_FIRST(&pool->paused_requests)) != NULL) {
+ TAILQ_REMOVE(&pool->paused_requests, pause, next);
+ mm_free(pause);
+ }
+
+ while ((connection = TAILQ_FIRST(&pool->connections)) != NULL) {
+ TAILQ_REMOVE(&pool->connections, connection, next);
+ evhttp_connection_free(connection);
+ }
+
+ while ((hook = TAILQ_FIRST(&pool->input_hooks)) != NULL) {
+ r = evrpc_remove_hook(pool, EVRPC_INPUT, hook);
+ EVUTIL_ASSERT(r);
+ }
+
+ while ((hook = TAILQ_FIRST(&pool->output_hooks)) != NULL) {
+ r = evrpc_remove_hook(pool, EVRPC_OUTPUT, hook);
+ EVUTIL_ASSERT(r);
+ }
+
+ mm_free(pool);
+}
+
+/*
+ * Add a connection to the RPC pool. A request scheduled on the pool
+ * may use any available connection.
+ */
+
+void
+evrpc_pool_add_connection(struct evrpc_pool *pool,
+ struct evhttp_connection *connection)
+{
+ EVUTIL_ASSERT(connection->http_server == NULL);
+ TAILQ_INSERT_TAIL(&pool->connections, connection, next);
+
+ /*
+ * associate an event base with this connection
+ */
+ if (pool->base != NULL)
+ evhttp_connection_set_base(connection, pool->base);
+
+ /*
+ * unless a timeout was specifically set for a connection,
+ * the connection inherits the timeout from the pool.
+ */
+ if (!evutil_timerisset(&connection->timeout))
+ evhttp_connection_set_timeout(connection, pool->timeout);
+
+ /*
+ * if we have any requests pending, schedule them with the new
+ * connections.
+ */
+
+ if (TAILQ_FIRST(&pool->requests) != NULL) {
+ struct evrpc_request_wrapper *request =
+ TAILQ_FIRST(&pool->requests);
+ TAILQ_REMOVE(&pool->requests, request, next);
+ evrpc_schedule_request(connection, request);
+ }
+}
+
+void
+evrpc_pool_remove_connection(struct evrpc_pool *pool,
+ struct evhttp_connection *connection)
+{
+ TAILQ_REMOVE(&pool->connections, connection, next);
+}
+
+void
+evrpc_pool_set_timeout(struct evrpc_pool *pool, int timeout_in_secs)
+{
+ struct evhttp_connection *evcon;
+ TAILQ_FOREACH(evcon, &pool->connections, next) {
+ evhttp_connection_set_timeout(evcon, timeout_in_secs);
+ }
+ pool->timeout = timeout_in_secs;
+}
+
+
+static void evrpc_reply_done(struct evhttp_request *, void *);
+static void evrpc_request_timeout(evutil_socket_t, short, void *);
+
+/*
+ * Finds a connection object associated with the pool that is currently
+ * idle and can be used to make a request.
+ */
+static struct evhttp_connection *
+evrpc_pool_find_connection(struct evrpc_pool *pool)
+{
+ struct evhttp_connection *connection;
+ TAILQ_FOREACH(connection, &pool->connections, next) {
+ if (TAILQ_FIRST(&connection->requests) == NULL)
+ return (connection);
+ }
+
+ return (NULL);
+}
+
+/*
+ * Prototypes responsible for evrpc scheduling and hooking
+ */
+
+static void evrpc_schedule_request_closure(void *ctx, enum EVRPC_HOOK_RESULT);
+
+/*
+ * We assume that the ctx is no longer queued on the pool.
+ */
+static int
+evrpc_schedule_request(struct evhttp_connection *connection,
+ struct evrpc_request_wrapper *ctx)
+{
+ struct evhttp_request *req = NULL;
+ struct evrpc_pool *pool = ctx->pool;
+ struct evrpc_status status;
+
+ if ((req = evhttp_request_new(evrpc_reply_done, ctx)) == NULL)
+ goto error;
+
+ /* serialize the request data into the output buffer */
+ ctx->request_marshal(req->output_buffer, ctx->request);
+
+ /* we need to know the connection that we might have to abort */
+ ctx->evcon = connection;
+
+ /* if we get paused we also need to know the request */
+ ctx->req = req;
+
+ if (TAILQ_FIRST(&pool->output_hooks) != NULL) {
+ int hook_res;
+
+ evrpc_hook_associate_meta_(&ctx->hook_meta, connection);
+
+ /* apply hooks to the outgoing request */
+ hook_res = evrpc_process_hooks(&pool->output_hooks,
+ ctx, req, req->output_buffer);
+
+ switch (hook_res) {
+ case EVRPC_TERMINATE:
+ goto error;
+ case EVRPC_PAUSE:
+ /* we need to be explicitly resumed */
+ if (evrpc_pause_request(pool, ctx,
+ evrpc_schedule_request_closure) == -1)
+ goto error;
+ return (0);
+ case EVRPC_CONTINUE:
+ /* we can just continue */
+ break;
+ default:
+ EVUTIL_ASSERT(hook_res == EVRPC_TERMINATE ||
+ hook_res == EVRPC_CONTINUE ||
+ hook_res == EVRPC_PAUSE);
+ }
+ }
+
+ evrpc_schedule_request_closure(ctx, EVRPC_CONTINUE);
+ return (0);
+
+error:
+ memset(&status, 0, sizeof(status));
+ status.error = EVRPC_STATUS_ERR_UNSTARTED;
+ (*ctx->cb)(&status, ctx->request, ctx->reply, ctx->cb_arg);
+ evrpc_request_wrapper_free(ctx);
+ return (-1);
+}
+
+static void
+evrpc_schedule_request_closure(void *arg, enum EVRPC_HOOK_RESULT hook_res)
+{
+ struct evrpc_request_wrapper *ctx = arg;
+ struct evhttp_connection *connection = ctx->evcon;
+ struct evhttp_request *req = ctx->req;
+ struct evrpc_pool *pool = ctx->pool;
+ struct evrpc_status status;
+ char *uri = NULL;
+ int res = 0;
+
+ if (hook_res == EVRPC_TERMINATE)
+ goto error;
+
+ uri = evrpc_construct_uri(ctx->name);
+ if (uri == NULL)
+ goto error;
+
+ if (pool->timeout > 0) {
+ /*
+ * a timeout after which the whole rpc is going to be aborted.
+ */
+ struct timeval tv;
+ evutil_timerclear(&tv);
+ tv.tv_sec = pool->timeout;
+ evtimer_add(&ctx->ev_timeout, &tv);
+ }
+
+ /* start the request over the connection */
+ res = evhttp_make_request(connection, req, EVHTTP_REQ_POST, uri);
+ mm_free(uri);
+
+ if (res == -1)
+ goto error;
+
+ return;
+
+error:
+ memset(&status, 0, sizeof(status));
+ status.error = EVRPC_STATUS_ERR_UNSTARTED;
+ (*ctx->cb)(&status, ctx->request, ctx->reply, ctx->cb_arg);
+ evrpc_request_wrapper_free(ctx);
+}
+
+/* we just queue the paused request on the pool under the req object */
+static int
+evrpc_pause_request(void *vbase, void *ctx,
+ void (*cb)(void *, enum EVRPC_HOOK_RESULT))
+{
+ struct evrpc_hooks_ *base = vbase;
+ struct evrpc_hook_ctx *pause = mm_malloc(sizeof(*pause));
+ if (pause == NULL)
+ return (-1);
+
+ pause->ctx = ctx;
+ pause->cb = cb;
+
+ TAILQ_INSERT_TAIL(&base->pause_requests, pause, next);
+ return (0);
+}
+
+int
+evrpc_resume_request(void *vbase, void *ctx, enum EVRPC_HOOK_RESULT res)
+{
+ struct evrpc_hooks_ *base = vbase;
+ struct evrpc_pause_list *head = &base->pause_requests;
+ struct evrpc_hook_ctx *pause;
+
+ TAILQ_FOREACH(pause, head, next) {
+ if (pause->ctx == ctx)
+ break;
+ }
+
+ if (pause == NULL)
+ return (-1);
+
+ (*pause->cb)(pause->ctx, res);
+ TAILQ_REMOVE(head, pause, next);
+ mm_free(pause);
+ return (0);
+}
+
+int
+evrpc_make_request(struct evrpc_request_wrapper *ctx)
+{
+ struct evrpc_pool *pool = ctx->pool;
+
+ /* initialize the event structure for this rpc */
+ evtimer_assign(&ctx->ev_timeout, pool->base, evrpc_request_timeout, ctx);
+
+ /* we better have some available connections on the pool */
+ EVUTIL_ASSERT(TAILQ_FIRST(&pool->connections) != NULL);
+
+ /*
+ * if no connection is available, we queue the request on the pool,
+ * the next time a connection is empty, the rpc will be send on that.
+ */
+ TAILQ_INSERT_TAIL(&pool->requests, ctx, next);
+
+ evrpc_pool_schedule(pool);
+
+ return (0);
+}
+
+
+struct evrpc_request_wrapper *
+evrpc_make_request_ctx(
+ struct evrpc_pool *pool, void *request, void *reply,
+ const char *rpcname,
+ void (*req_marshal)(struct evbuffer*, void *),
+ void (*rpl_clear)(void *),
+ int (*rpl_unmarshal)(void *, struct evbuffer *),
+ void (*cb)(struct evrpc_status *, void *, void *, void *),
+ void *cbarg)
+{
+ struct evrpc_request_wrapper *ctx = (struct evrpc_request_wrapper *)
+ mm_malloc(sizeof(struct evrpc_request_wrapper));
+ if (ctx == NULL)
+ return (NULL);
+
+ ctx->pool = pool;
+ ctx->hook_meta = NULL;
+ ctx->evcon = NULL;
+ ctx->name = mm_strdup(rpcname);
+ if (ctx->name == NULL) {
+ mm_free(ctx);
+ return (NULL);
+ }
+ ctx->cb = cb;
+ ctx->cb_arg = cbarg;
+ ctx->request = request;
+ ctx->reply = reply;
+ ctx->request_marshal = req_marshal;
+ ctx->reply_clear = rpl_clear;
+ ctx->reply_unmarshal = rpl_unmarshal;
+
+ return (ctx);
+}
+
+static void
+evrpc_reply_done_closure(void *, enum EVRPC_HOOK_RESULT);
+
+static void
+evrpc_reply_done(struct evhttp_request *req, void *arg)
+{
+ struct evrpc_request_wrapper *ctx = arg;
+ struct evrpc_pool *pool = ctx->pool;
+ int hook_res = EVRPC_CONTINUE;
+
+ /* cancel any timeout we might have scheduled */
+ event_del(&ctx->ev_timeout);
+
+ ctx->req = req;
+
+ /* we need to get the reply now */
+ if (req == NULL) {
+ evrpc_reply_done_closure(ctx, EVRPC_CONTINUE);
+ return;
+ }
+
+ if (TAILQ_FIRST(&pool->input_hooks) != NULL) {
+ evrpc_hook_associate_meta_(&ctx->hook_meta, ctx->evcon);
+
+ /* apply hooks to the incoming request */
+ hook_res = evrpc_process_hooks(&pool->input_hooks,
+ ctx, req, req->input_buffer);
+
+ switch (hook_res) {
+ case EVRPC_TERMINATE:
+ case EVRPC_CONTINUE:
+ break;
+ case EVRPC_PAUSE:
+ /*
+ * if we get paused we also need to know the
+ * request. unfortunately, the underlying
+ * layer is going to free it. we need to
+ * request ownership explicitly
+ */
+ if (req != NULL)
+ evhttp_request_own(req);
+
+ evrpc_pause_request(pool, ctx,
+ evrpc_reply_done_closure);
+ return;
+ default:
+ EVUTIL_ASSERT(hook_res == EVRPC_TERMINATE ||
+ hook_res == EVRPC_CONTINUE ||
+ hook_res == EVRPC_PAUSE);
+ }
+ }
+
+ evrpc_reply_done_closure(ctx, hook_res);
+
+ /* http request is being freed by underlying layer */
+}
+
+static void
+evrpc_reply_done_closure(void *arg, enum EVRPC_HOOK_RESULT hook_res)
+{
+ struct evrpc_request_wrapper *ctx = arg;
+ struct evhttp_request *req = ctx->req;
+ struct evrpc_pool *pool = ctx->pool;
+ struct evrpc_status status;
+ int res = -1;
+
+ memset(&status, 0, sizeof(status));
+ status.http_req = req;
+
+ /* we need to get the reply now */
+ if (req == NULL) {
+ status.error = EVRPC_STATUS_ERR_TIMEOUT;
+ } else if (hook_res == EVRPC_TERMINATE) {
+ status.error = EVRPC_STATUS_ERR_HOOKABORTED;
+ } else {
+ res = ctx->reply_unmarshal(ctx->reply, req->input_buffer);
+ if (res == -1)
+ status.error = EVRPC_STATUS_ERR_BADPAYLOAD;
+ }
+
+ if (res == -1) {
+ /* clear everything that we might have written previously */
+ ctx->reply_clear(ctx->reply);
+ }
+
+ (*ctx->cb)(&status, ctx->request, ctx->reply, ctx->cb_arg);
+
+ evrpc_request_wrapper_free(ctx);
+
+ /* the http layer owned the original request structure, but if we
+ * got paused, we asked for ownership and need to free it here. */
+ if (req != NULL && evhttp_request_is_owned(req))
+ evhttp_request_free(req);
+
+ /* see if we can schedule another request */
+ evrpc_pool_schedule(pool);
+}
+
+static void
+evrpc_pool_schedule(struct evrpc_pool *pool)
+{
+ struct evrpc_request_wrapper *ctx = TAILQ_FIRST(&pool->requests);
+ struct evhttp_connection *evcon;
+
+ /* if no requests are pending, we have no work */
+ if (ctx == NULL)
+ return;
+
+ if ((evcon = evrpc_pool_find_connection(pool)) != NULL) {
+ TAILQ_REMOVE(&pool->requests, ctx, next);
+ evrpc_schedule_request(evcon, ctx);
+ }
+}
+
+static void
+evrpc_request_timeout(evutil_socket_t fd, short what, void *arg)
+{
+ struct evrpc_request_wrapper *ctx = arg;
+ struct evhttp_connection *evcon = ctx->evcon;
+ EVUTIL_ASSERT(evcon != NULL);
+
+ evhttp_connection_fail_(evcon, EVREQ_HTTP_TIMEOUT);
+}
+
+/*
+ * frees potential meta data associated with a request.
+ */
+
+static void
+evrpc_meta_data_free(struct evrpc_meta_list *meta_data)
+{
+ struct evrpc_meta *entry;
+ EVUTIL_ASSERT(meta_data != NULL);
+
+ while ((entry = TAILQ_FIRST(meta_data)) != NULL) {
+ TAILQ_REMOVE(meta_data, entry, next);
+ mm_free(entry->key);
+ mm_free(entry->data);
+ mm_free(entry);
+ }
+}
+
+static struct evrpc_hook_meta *
+evrpc_hook_meta_new_(void)
+{
+ struct evrpc_hook_meta *ctx;
+ ctx = mm_malloc(sizeof(struct evrpc_hook_meta));
+ EVUTIL_ASSERT(ctx != NULL);
+
+ TAILQ_INIT(&ctx->meta_data);
+ ctx->evcon = NULL;
+
+ return (ctx);
+}
+
+static void
+evrpc_hook_associate_meta_(struct evrpc_hook_meta **pctx,
+ struct evhttp_connection *evcon)
+{
+ struct evrpc_hook_meta *ctx = *pctx;
+ if (ctx == NULL)
+ *pctx = ctx = evrpc_hook_meta_new_();
+ ctx->evcon = evcon;
+}
+
+static void
+evrpc_hook_context_free_(struct evrpc_hook_meta *ctx)
+{
+ evrpc_meta_data_free(&ctx->meta_data);
+ mm_free(ctx);
+}
+
+/* Adds meta data */
+void
+evrpc_hook_add_meta(void *ctx, const char *key,
+ const void *data, size_t data_size)
+{
+ struct evrpc_request_wrapper *req = ctx;
+ struct evrpc_hook_meta *store = NULL;
+ struct evrpc_meta *meta = NULL;
+
+ if ((store = req->hook_meta) == NULL)
+ store = req->hook_meta = evrpc_hook_meta_new_();
+
+ meta = mm_malloc(sizeof(struct evrpc_meta));
+ EVUTIL_ASSERT(meta != NULL);
+ meta->key = mm_strdup(key);
+ EVUTIL_ASSERT(meta->key != NULL);
+ meta->data_size = data_size;
+ meta->data = mm_malloc(data_size);
+ EVUTIL_ASSERT(meta->data != NULL);
+ memcpy(meta->data, data, data_size);
+
+ TAILQ_INSERT_TAIL(&store->meta_data, meta, next);
+}
+
+int
+evrpc_hook_find_meta(void *ctx, const char *key, void **data, size_t *data_size)
+{
+ struct evrpc_request_wrapper *req = ctx;
+ struct evrpc_meta *meta = NULL;
+
+ if (req->hook_meta == NULL)
+ return (-1);
+
+ TAILQ_FOREACH(meta, &req->hook_meta->meta_data, next) {
+ if (strcmp(meta->key, key) == 0) {
+ *data = meta->data;
+ *data_size = meta->data_size;
+ return (0);
+ }
+ }
+
+ return (-1);
+}
+
+struct evhttp_connection *
+evrpc_hook_get_connection(void *ctx)
+{
+ struct evrpc_request_wrapper *req = ctx;
+ return (req->hook_meta != NULL ? req->hook_meta->evcon : NULL);
+}
+
+int
+evrpc_send_request_generic(struct evrpc_pool *pool,
+ void *request, void *reply,
+ void (*cb)(struct evrpc_status *, void *, void *, void *),
+ void *cb_arg,
+ const char *rpcname,
+ void (*req_marshal)(struct evbuffer *, void *),
+ void (*rpl_clear)(void *),
+ int (*rpl_unmarshal)(void *, struct evbuffer *))
+{
+ struct evrpc_status status;
+ struct evrpc_request_wrapper *ctx;
+ ctx = evrpc_make_request_ctx(pool, request, reply,
+ rpcname, req_marshal, rpl_clear, rpl_unmarshal, cb, cb_arg);
+ if (ctx == NULL)
+ goto error;
+ return (evrpc_make_request(ctx));
+error:
+ memset(&status, 0, sizeof(status));
+ status.error = EVRPC_STATUS_ERR_UNSTARTED;
+ (*(cb))(&status, request, reply, cb_arg);
+ return (-1);
+}
+
+/** Takes a request object and fills it in with the right magic */
+static struct evrpc *
+evrpc_register_object(const char *name,
+ void *(*req_new)(void*), void *req_new_arg, void (*req_free)(void *),
+ int (*req_unmarshal)(void *, struct evbuffer *),
+ void *(*rpl_new)(void*), void *rpl_new_arg, void (*rpl_free)(void *),
+ int (*rpl_complete)(void *),
+ void (*rpl_marshal)(struct evbuffer *, void *))
+{
+ struct evrpc* rpc = (struct evrpc *)mm_calloc(1, sizeof(struct evrpc));
+ if (rpc == NULL)
+ return (NULL);
+ rpc->uri = mm_strdup(name);
+ if (rpc->uri == NULL) {
+ mm_free(rpc);
+ return (NULL);
+ }
+ rpc->request_new = req_new;
+ rpc->request_new_arg = req_new_arg;
+ rpc->request_free = req_free;
+ rpc->request_unmarshal = req_unmarshal;
+ rpc->reply_new = rpl_new;
+ rpc->reply_new_arg = rpl_new_arg;
+ rpc->reply_free = rpl_free;
+ rpc->reply_complete = rpl_complete;
+ rpc->reply_marshal = rpl_marshal;
+ return (rpc);
+}
+
+int
+evrpc_register_generic(struct evrpc_base *base, const char *name,
+ void (*callback)(struct evrpc_req_generic *, void *), void *cbarg,
+ void *(*req_new)(void *), void *req_new_arg, void (*req_free)(void *),
+ int (*req_unmarshal)(void *, struct evbuffer *),
+ void *(*rpl_new)(void *), void *rpl_new_arg, void (*rpl_free)(void *),
+ int (*rpl_complete)(void *),
+ void (*rpl_marshal)(struct evbuffer *, void *))
+{
+ struct evrpc* rpc =
+ evrpc_register_object(name, req_new, req_new_arg, req_free, req_unmarshal,
+ rpl_new, rpl_new_arg, rpl_free, rpl_complete, rpl_marshal);
+ if (rpc == NULL)
+ return (-1);
+ evrpc_register_rpc(base, rpc,
+ (void (*)(struct evrpc_req_generic*, void *))callback, cbarg);
+ return (0);
+}
+
+/** accessors for obscure and undocumented functionality */
+struct evrpc_pool *
+evrpc_request_get_pool(struct evrpc_request_wrapper *ctx)
+{
+ return (ctx->pool);
+}
+
+void
+evrpc_request_set_pool(struct evrpc_request_wrapper *ctx,
+ struct evrpc_pool *pool)
+{
+ ctx->pool = pool;
+}
+
+void
+evrpc_request_set_cb(struct evrpc_request_wrapper *ctx,
+ void (*cb)(struct evrpc_status*, void *request, void *reply, void *arg),
+ void *cb_arg)
+{
+ ctx->cb = cb;
+ ctx->cb_arg = cb_arg;
+}
diff --git a/protocols/Telegram/tgl/libevent/evrpc.obj b/protocols/Telegram/tgl/libevent/evrpc.obj
new file mode 100644
index 0000000000..4733bf298b
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/evrpc.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/evsignal-internal.h b/protocols/Telegram/tgl/libevent/evsignal-internal.h
new file mode 100644
index 0000000000..5cff03b525
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/evsignal-internal.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVSIGNAL_INTERNAL_H_INCLUDED_
+#define EVSIGNAL_INTERNAL_H_INCLUDED_
+
+#ifndef evutil_socket_t
+#include "event2/util.h"
+#endif
+#include <signal.h>
+
+typedef void (*ev_sighandler_t)(int);
+
+/* Data structure for the default signal-handling implementation in signal.c
+ */
+struct evsig_info {
+ /* Event watching ev_signal_pair[1] */
+ struct event ev_signal;
+ /* Socketpair used to send notifications from the signal handler */
+ evutil_socket_t ev_signal_pair[2];
+ /* True iff we've added the ev_signal event yet. */
+ int ev_signal_added;
+ /* Count of the number of signals we're currently watching. */
+ int ev_n_signals_added;
+
+ /* Array of previous signal handler objects before Libevent started
+ * messing with them. Used to restore old signal handlers. */
+#ifdef EVENT__HAVE_SIGACTION
+ struct sigaction **sh_old;
+#else
+ ev_sighandler_t **sh_old;
+#endif
+ /* Size of sh_old. */
+ int sh_old_max;
+};
+int evsig_init_(struct event_base *);
+void evsig_dealloc_(struct event_base *);
+
+void evsig_set_base_(struct event_base *base);
+void evsig_free_globals_(void);
+
+#endif /* EVSIGNAL_INTERNAL_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/evthread-internal.h b/protocols/Telegram/tgl/libevent/evthread-internal.h
new file mode 100644
index 0000000000..efdecf81e7
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/evthread-internal.h
@@ -0,0 +1,392 @@
+/*
+ * Copyright (c) 2008-2012 Niels Provos, Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVTHREAD_INTERNAL_H_INCLUDED_
+#define EVTHREAD_INTERNAL_H_INCLUDED_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#include "event2/thread.h"
+#include "util-internal.h"
+
+struct event_base;
+
+#ifndef _WIN32
+/* On Windows, the way we currently make DLLs, it's not allowed for us to
+ * have shared global structures. Thus, we only do the direct-call-to-function
+ * code path if we know that the local shared library system supports it.
+ */
+#define EVTHREAD_EXPOSE_STRUCTS
+#endif
+
+#if ! defined(EVENT__DISABLE_THREAD_SUPPORT) && defined(EVTHREAD_EXPOSE_STRUCTS)
+/* Global function pointers to lock-related functions. NULL if locking isn't
+ enabled. */
+extern struct evthread_lock_callbacks evthread_lock_fns_;
+extern struct evthread_condition_callbacks evthread_cond_fns_;
+extern unsigned long (*evthread_id_fn_)(void);
+extern int evthread_lock_debugging_enabled_;
+
+/** Return the ID of the current thread, or 1 if threading isn't enabled. */
+#define EVTHREAD_GET_ID() \
+ (evthread_id_fn_ ? evthread_id_fn_() : 1)
+
+/** Return true iff we're in the thread that is currently (or most recently)
+ * running a given event_base's loop. Requires lock. */
+#define EVBASE_IN_THREAD(base) \
+ (evthread_id_fn_ == NULL || \
+ (base)->th_owner_id == evthread_id_fn_())
+
+/** Return true iff we need to notify the base's main thread about changes to
+ * its state, because it's currently running the main loop in another
+ * thread. Requires lock. */
+#define EVBASE_NEED_NOTIFY(base) \
+ (evthread_id_fn_ != NULL && \
+ (base)->running_loop && \
+ (base)->th_owner_id != evthread_id_fn_())
+
+/** Allocate a new lock, and store it in lockvar, a void*. Sets lockvar to
+ NULL if locking is not enabled. */
+#define EVTHREAD_ALLOC_LOCK(lockvar, locktype) \
+ ((lockvar) = evthread_lock_fns_.alloc ? \
+ evthread_lock_fns_.alloc(locktype) : NULL)
+
+/** Free a given lock, if it is present and locking is enabled. */
+#define EVTHREAD_FREE_LOCK(lockvar, locktype) \
+ do { \
+ void *lock_tmp_ = (lockvar); \
+ if (lock_tmp_ && evthread_lock_fns_.free) \
+ evthread_lock_fns_.free(lock_tmp_, (locktype)); \
+ } while (0)
+
+/** Acquire a lock. */
+#define EVLOCK_LOCK(lockvar,mode) \
+ do { \
+ if (lockvar) \
+ evthread_lock_fns_.lock(mode, lockvar); \
+ } while (0)
+
+/** Release a lock */
+#define EVLOCK_UNLOCK(lockvar,mode) \
+ do { \
+ if (lockvar) \
+ evthread_lock_fns_.unlock(mode, lockvar); \
+ } while (0)
+
+/** Helper: put lockvar1 and lockvar2 into pointerwise ascending order. */
+#define EVLOCK_SORTLOCKS_(lockvar1, lockvar2) \
+ do { \
+ if (lockvar1 && lockvar2 && lockvar1 > lockvar2) { \
+ void *tmp = lockvar1; \
+ lockvar1 = lockvar2; \
+ lockvar2 = tmp; \
+ } \
+ } while (0)
+
+/** Lock an event_base, if it is set up for locking. Acquires the lock
+ in the base structure whose field is named 'lockvar'. */
+#define EVBASE_ACQUIRE_LOCK(base, lockvar) do { \
+ EVLOCK_LOCK((base)->lockvar, 0); \
+ } while (0)
+
+/** Unlock an event_base, if it is set up for locking. */
+#define EVBASE_RELEASE_LOCK(base, lockvar) do { \
+ EVLOCK_UNLOCK((base)->lockvar, 0); \
+ } while (0)
+
+/** If lock debugging is enabled, and lock is non-null, assert that 'lock' is
+ * locked and held by us. */
+#define EVLOCK_ASSERT_LOCKED(lock) \
+ do { \
+ if ((lock) && evthread_lock_debugging_enabled_) { \
+ EVUTIL_ASSERT(evthread_is_debug_lock_held_(lock)); \
+ } \
+ } while (0)
+
+/** Try to grab the lock for 'lockvar' without blocking, and return 1 if we
+ * manage to get it. */
+static inline int EVLOCK_TRY_LOCK_(void *lock);
+static inline int
+EVLOCK_TRY_LOCK_(void *lock)
+{
+ if (lock && evthread_lock_fns_.lock) {
+ int r = evthread_lock_fns_.lock(EVTHREAD_TRY, lock);
+ return !r;
+ } else {
+ /* Locking is disabled either globally or for this thing;
+ * of course we count as having the lock. */
+ return 1;
+ }
+}
+
+/** Allocate a new condition variable and store it in the void *, condvar */
+#define EVTHREAD_ALLOC_COND(condvar) \
+ do { \
+ (condvar) = evthread_cond_fns_.alloc_condition ? \
+ evthread_cond_fns_.alloc_condition(0) : NULL; \
+ } while (0)
+/** Deallocate and free a condition variable in condvar */
+#define EVTHREAD_FREE_COND(cond) \
+ do { \
+ if (cond) \
+ evthread_cond_fns_.free_condition((cond)); \
+ } while (0)
+/** Signal one thread waiting on cond */
+#define EVTHREAD_COND_SIGNAL(cond) \
+ ( (cond) ? evthread_cond_fns_.signal_condition((cond), 0) : 0 )
+/** Signal all threads waiting on cond */
+#define EVTHREAD_COND_BROADCAST(cond) \
+ ( (cond) ? evthread_cond_fns_.signal_condition((cond), 1) : 0 )
+/** Wait until the condition 'cond' is signalled. Must be called while
+ * holding 'lock'. The lock will be released until the condition is
+ * signalled, at which point it will be acquired again. Returns 0 for
+ * success, -1 for failure. */
+#define EVTHREAD_COND_WAIT(cond, lock) \
+ ( (cond) ? evthread_cond_fns_.wait_condition((cond), (lock), NULL) : 0 )
+/** As EVTHREAD_COND_WAIT, but gives up after 'tv' has elapsed. Returns 1
+ * on timeout. */
+#define EVTHREAD_COND_WAIT_TIMED(cond, lock, tv) \
+ ( (cond) ? evthread_cond_fns_.wait_condition((cond), (lock), (tv)) : 0 )
+
+/** True iff locking functions have been configured. */
+#define EVTHREAD_LOCKING_ENABLED() \
+ (evthread_lock_fns_.lock != NULL)
+
+#elif ! defined(EVENT__DISABLE_THREAD_SUPPORT)
+
+unsigned long evthreadimpl_get_id_(void);
+int evthreadimpl_is_lock_debugging_enabled_(void);
+void *evthreadimpl_lock_alloc_(unsigned locktype);
+void evthreadimpl_lock_free_(void *lock, unsigned locktype);
+int evthreadimpl_lock_lock_(unsigned mode, void *lock);
+int evthreadimpl_lock_unlock_(unsigned mode, void *lock);
+void *evthreadimpl_cond_alloc_(unsigned condtype);
+void evthreadimpl_cond_free_(void *cond);
+int evthreadimpl_cond_signal_(void *cond, int broadcast);
+int evthreadimpl_cond_wait_(void *cond, void *lock, const struct timeval *tv);
+int evthreadimpl_locking_enabled_(void);
+
+#define EVTHREAD_GET_ID() evthreadimpl_get_id_()
+#define EVBASE_IN_THREAD(base) \
+ ((base)->th_owner_id == evthreadimpl_get_id_())
+#define EVBASE_NEED_NOTIFY(base) \
+ ((base)->running_loop && \
+ ((base)->th_owner_id != evthreadimpl_get_id_()))
+
+#define EVTHREAD_ALLOC_LOCK(lockvar, locktype) \
+ ((lockvar) = evthreadimpl_lock_alloc_(locktype))
+
+#define EVTHREAD_FREE_LOCK(lockvar, locktype) \
+ do { \
+ void *lock_tmp_ = (lockvar); \
+ if (lock_tmp_) \
+ evthreadimpl_lock_free_(lock_tmp_, (locktype)); \
+ } while (0)
+
+/** Acquire a lock. */
+#define EVLOCK_LOCK(lockvar,mode) \
+ do { \
+ if (lockvar) \
+ evthreadimpl_lock_lock_(mode, lockvar); \
+ } while (0)
+
+/** Release a lock */
+#define EVLOCK_UNLOCK(lockvar,mode) \
+ do { \
+ if (lockvar) \
+ evthreadimpl_lock_unlock_(mode, lockvar); \
+ } while (0)
+
+/** Lock an event_base, if it is set up for locking. Acquires the lock
+ in the base structure whose field is named 'lockvar'. */
+#define EVBASE_ACQUIRE_LOCK(base, lockvar) do { \
+ EVLOCK_LOCK((base)->lockvar, 0); \
+ } while (0)
+
+/** Unlock an event_base, if it is set up for locking. */
+#define EVBASE_RELEASE_LOCK(base, lockvar) do { \
+ EVLOCK_UNLOCK((base)->lockvar, 0); \
+ } while (0)
+
+/** If lock debugging is enabled, and lock is non-null, assert that 'lock' is
+ * locked and held by us. */
+#define EVLOCK_ASSERT_LOCKED(lock) \
+ do { \
+ if ((lock) && evthreadimpl_is_lock_debugging_enabled_()) { \
+ EVUTIL_ASSERT(evthread_is_debug_lock_held_(lock)); \
+ } \
+ } while (0)
+
+/** Try to grab the lock for 'lockvar' without blocking, and return 1 if we
+ * manage to get it. */
+static inline int EVLOCK_TRY_LOCK_(void *lock);
+static inline int
+EVLOCK_TRY_LOCK_(void *lock)
+{
+ if (lock) {
+ int r = evthreadimpl_lock_lock_(EVTHREAD_TRY, lock);
+ return !r;
+ } else {
+ /* Locking is disabled either globally or for this thing;
+ * of course we count as having the lock. */
+ return 1;
+ }
+}
+
+/** Allocate a new condition variable and store it in the void *, condvar */
+#define EVTHREAD_ALLOC_COND(condvar) \
+ do { \
+ (condvar) = evthreadimpl_cond_alloc_(0); \
+ } while (0)
+/** Deallocate and free a condition variable in condvar */
+#define EVTHREAD_FREE_COND(cond) \
+ do { \
+ if (cond) \
+ evthreadimpl_cond_free_((cond)); \
+ } while (0)
+/** Signal one thread waiting on cond */
+#define EVTHREAD_COND_SIGNAL(cond) \
+ ( (cond) ? evthreadimpl_cond_signal_((cond), 0) : 0 )
+/** Signal all threads waiting on cond */
+#define EVTHREAD_COND_BROADCAST(cond) \
+ ( (cond) ? evthreadimpl_cond_signal_((cond), 1) : 0 )
+/** Wait until the condition 'cond' is signalled. Must be called while
+ * holding 'lock'. The lock will be released until the condition is
+ * signalled, at which point it will be acquired again. Returns 0 for
+ * success, -1 for failure. */
+#define EVTHREAD_COND_WAIT(cond, lock) \
+ ( (cond) ? evthreadimpl_cond_wait_((cond), (lock), NULL) : 0 )
+/** As EVTHREAD_COND_WAIT, but gives up after 'tv' has elapsed. Returns 1
+ * on timeout. */
+#define EVTHREAD_COND_WAIT_TIMED(cond, lock, tv) \
+ ( (cond) ? evthreadimpl_cond_wait_((cond), (lock), (tv)) : 0 )
+
+#define EVTHREAD_LOCKING_ENABLED() \
+ (evthreadimpl_locking_enabled_())
+
+#else /* EVENT__DISABLE_THREAD_SUPPORT */
+
+#define EVTHREAD_GET_ID() 1
+#define EVTHREAD_ALLOC_LOCK(lockvar, locktype) EVUTIL_NIL_STMT_
+#define EVTHREAD_FREE_LOCK(lockvar, locktype) EVUTIL_NIL_STMT_
+
+#define EVLOCK_LOCK(lockvar, mode) EVUTIL_NIL_STMT_
+#define EVLOCK_UNLOCK(lockvar, mode) EVUTIL_NIL_STMT_
+#define EVLOCK_LOCK2(lock1,lock2,mode1,mode2) EVUTIL_NIL_STMT_
+#define EVLOCK_UNLOCK2(lock1,lock2,mode1,mode2) EVUTIL_NIL_STMT_
+
+#define EVBASE_IN_THREAD(base) 1
+#define EVBASE_NEED_NOTIFY(base) 0
+#define EVBASE_ACQUIRE_LOCK(base, lock) EVUTIL_NIL_STMT_
+#define EVBASE_RELEASE_LOCK(base, lock) EVUTIL_NIL_STMT_
+#define EVLOCK_ASSERT_LOCKED(lock) EVUTIL_NIL_STMT_
+
+#define EVLOCK_TRY_LOCK_(lock) 1
+
+#define EVTHREAD_ALLOC_COND(condvar) EVUTIL_NIL_STMT_
+#define EVTHREAD_FREE_COND(cond) EVUTIL_NIL_STMT_
+#define EVTHREAD_COND_SIGNAL(cond) EVUTIL_NIL_STMT_
+#define EVTHREAD_COND_BROADCAST(cond) EVUTIL_NIL_STMT_
+#define EVTHREAD_COND_WAIT(cond, lock) EVUTIL_NIL_STMT_
+#define EVTHREAD_COND_WAIT_TIMED(cond, lock, howlong) EVUTIL_NIL_STMT_
+
+#define EVTHREAD_LOCKING_ENABLED() 0
+
+#endif
+
+/* This code is shared between both lock impls */
+#if ! defined(EVENT__DISABLE_THREAD_SUPPORT)
+/** Helper: put lockvar1 and lockvar2 into pointerwise ascending order. */
+#define EVLOCK_SORTLOCKS_(lockvar1, lockvar2) \
+ do { \
+ if (lockvar1 && lockvar2 && lockvar1 > lockvar2) { \
+ void *tmp = lockvar1; \
+ lockvar1 = lockvar2; \
+ lockvar2 = tmp; \
+ } \
+ } while (0)
+
+/** Acquire both lock1 and lock2. Always allocates locks in the same order,
+ * so that two threads locking two locks with LOCK2 will not deadlock. */
+#define EVLOCK_LOCK2(lock1,lock2,mode1,mode2) \
+ do { \
+ void *lock1_tmplock_ = (lock1); \
+ void *lock2_tmplock_ = (lock2); \
+ EVLOCK_SORTLOCKS_(lock1_tmplock_,lock2_tmplock_); \
+ EVLOCK_LOCK(lock1_tmplock_,mode1); \
+ if (lock2_tmplock_ != lock1_tmplock_) \
+ EVLOCK_LOCK(lock2_tmplock_,mode2); \
+ } while (0)
+/** Release both lock1 and lock2. */
+#define EVLOCK_UNLOCK2(lock1,lock2,mode1,mode2) \
+ do { \
+ void *lock1_tmplock_ = (lock1); \
+ void *lock2_tmplock_ = (lock2); \
+ EVLOCK_SORTLOCKS_(lock1_tmplock_,lock2_tmplock_); \
+ if (lock2_tmplock_ != lock1_tmplock_) \
+ EVLOCK_UNLOCK(lock2_tmplock_,mode2); \
+ EVLOCK_UNLOCK(lock1_tmplock_,mode1); \
+ } while (0)
+
+int evthread_is_debug_lock_held_(void *lock);
+void *evthread_debug_get_real_lock_(void *lock);
+
+void *evthread_setup_global_lock_(void *lock_, unsigned locktype,
+ int enable_locks);
+
+#define EVTHREAD_SETUP_GLOBAL_LOCK(lockvar, locktype) \
+ do { \
+ lockvar = evthread_setup_global_lock_(lockvar, \
+ (locktype), enable_locks); \
+ if (!lockvar) { \
+ event_warn("Couldn't allocate %s", #lockvar); \
+ return -1; \
+ } \
+ } while (0);
+
+int event_global_setup_locks_(const int enable_locks);
+int evsig_global_setup_locks_(const int enable_locks);
+int evutil_global_setup_locks_(const int enable_locks);
+int evutil_secure_rng_global_setup_locks_(const int enable_locks);
+
+/** Return current evthread_lock_callbacks */
+struct evthread_lock_callbacks *evthread_get_lock_callbacks(void);
+/** Return current evthread_condition_callbacks */
+struct evthread_condition_callbacks *evthread_get_condition_callbacks(void);
+/** Disable locking for internal usage (like global shutdown) */
+void evthreadimpl_disable_lock_debugging_(void);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVTHREAD_INTERNAL_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/evthread.c b/protocols/Telegram/tgl/libevent/evthread.c
new file mode 100644
index 0000000000..f3f1eddc89
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/evthread.c
@@ -0,0 +1,509 @@
+/*
+ * Copyright (c) 2008-2012 Niels Provos, Nick Mathewson
+ *
+ * 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 "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+
+#include "event2/thread.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "log-internal.h"
+#include "mm-internal.h"
+#include "util-internal.h"
+#include "evthread-internal.h"
+
+#ifdef EVTHREAD_EXPOSE_STRUCTS
+#define GLOBAL
+#else
+#define GLOBAL static
+#endif
+
+#ifndef EVENT__DISABLE_DEBUG_MODE
+extern int event_debug_created_threadable_ctx_;
+extern int event_debug_mode_on_;
+#endif
+
+/* globals */
+GLOBAL int evthread_lock_debugging_enabled_ = 0;
+GLOBAL struct evthread_lock_callbacks evthread_lock_fns_ = {
+ 0, 0, NULL, NULL, NULL, NULL
+};
+GLOBAL unsigned long (*evthread_id_fn_)(void) = NULL;
+GLOBAL struct evthread_condition_callbacks evthread_cond_fns_ = {
+ 0, NULL, NULL, NULL, NULL
+};
+
+/* Used for debugging */
+static struct evthread_lock_callbacks original_lock_fns_ = {
+ 0, 0, NULL, NULL, NULL, NULL
+};
+static struct evthread_condition_callbacks original_cond_fns_ = {
+ 0, NULL, NULL, NULL, NULL
+};
+
+void
+evthread_set_id_callback(unsigned long (*id_fn)(void))
+{
+ evthread_id_fn_ = id_fn;
+}
+
+struct evthread_lock_callbacks *evthread_get_lock_callbacks()
+{
+ return evthread_lock_debugging_enabled_
+ ? &original_lock_fns_ : &evthread_lock_fns_;
+}
+struct evthread_condition_callbacks *evthread_get_condition_callbacks()
+{
+ return evthread_lock_debugging_enabled_
+ ? &original_cond_fns_ : &evthread_cond_fns_;
+}
+void evthreadimpl_disable_lock_debugging_(void)
+{
+ evthread_lock_debugging_enabled_ = 0;
+}
+
+int
+evthread_set_lock_callbacks(const struct evthread_lock_callbacks *cbs)
+{
+ struct evthread_lock_callbacks *target = evthread_get_lock_callbacks();
+
+#ifndef EVENT__DISABLE_DEBUG_MODE
+ if (event_debug_mode_on_) {
+ if (event_debug_created_threadable_ctx_) {
+ event_errx(1, "evthread initialization must be called BEFORE anything else!");
+ }
+ }
+#endif
+
+ if (!cbs) {
+ if (target->alloc)
+ event_warnx("Trying to disable lock functions after "
+ "they have been set up will probaby not work.");
+ memset(target, 0, sizeof(evthread_lock_fns_));
+ return 0;
+ }
+ if (target->alloc) {
+ /* Uh oh; we already had locking callbacks set up.*/
+ if (target->lock_api_version == cbs->lock_api_version &&
+ target->supported_locktypes == cbs->supported_locktypes &&
+ target->alloc == cbs->alloc &&
+ target->free == cbs->free &&
+ target->lock == cbs->lock &&
+ target->unlock == cbs->unlock) {
+ /* no change -- allow this. */
+ return 0;
+ }
+ event_warnx("Can't change lock callbacks once they have been "
+ "initialized.");
+ return -1;
+ }
+ if (cbs->alloc && cbs->free && cbs->lock && cbs->unlock) {
+ memcpy(target, cbs, sizeof(evthread_lock_fns_));
+ return event_global_setup_locks_(1);
+ } else {
+ return -1;
+ }
+}
+
+int
+evthread_set_condition_callbacks(const struct evthread_condition_callbacks *cbs)
+{
+ struct evthread_condition_callbacks *target = evthread_get_condition_callbacks();
+
+#ifndef EVENT__DISABLE_DEBUG_MODE
+ if (event_debug_mode_on_) {
+ if (event_debug_created_threadable_ctx_) {
+ event_errx(1, "evthread initialization must be called BEFORE anything else!");
+ }
+ }
+#endif
+
+ if (!cbs) {
+ if (target->alloc_condition)
+ event_warnx("Trying to disable condition functions "
+ "after they have been set up will probaby not "
+ "work.");
+ memset(target, 0, sizeof(evthread_cond_fns_));
+ return 0;
+ }
+ if (target->alloc_condition) {
+ /* Uh oh; we already had condition callbacks set up.*/
+ if (target->condition_api_version == cbs->condition_api_version &&
+ target->alloc_condition == cbs->alloc_condition &&
+ target->free_condition == cbs->free_condition &&
+ target->signal_condition == cbs->signal_condition &&
+ target->wait_condition == cbs->wait_condition) {
+ /* no change -- allow this. */
+ return 0;
+ }
+ event_warnx("Can't change condition callbacks once they "
+ "have been initialized.");
+ return -1;
+ }
+ if (cbs->alloc_condition && cbs->free_condition &&
+ cbs->signal_condition && cbs->wait_condition) {
+ memcpy(target, cbs, sizeof(evthread_cond_fns_));
+ }
+ if (evthread_lock_debugging_enabled_) {
+ evthread_cond_fns_.alloc_condition = cbs->alloc_condition;
+ evthread_cond_fns_.free_condition = cbs->free_condition;
+ evthread_cond_fns_.signal_condition = cbs->signal_condition;
+ }
+ return 0;
+}
+
+#define DEBUG_LOCK_SIG 0xdeb0b10c
+
+struct debug_lock {
+ unsigned signature;
+ unsigned locktype;
+ unsigned long held_by;
+ /* XXXX if we ever use read-write locks, we will need a separate
+ * lock to protect count. */
+ int count;
+ void *lock;
+};
+
+static void *
+debug_lock_alloc(unsigned locktype)
+{
+ struct debug_lock *result = mm_malloc(sizeof(struct debug_lock));
+ if (!result)
+ return NULL;
+ if (original_lock_fns_.alloc) {
+ if (!(result->lock = original_lock_fns_.alloc(
+ locktype|EVTHREAD_LOCKTYPE_RECURSIVE))) {
+ mm_free(result);
+ return NULL;
+ }
+ } else {
+ result->lock = NULL;
+ }
+ result->signature = DEBUG_LOCK_SIG;
+ result->locktype = locktype;
+ result->count = 0;
+ result->held_by = 0;
+ return result;
+}
+
+static void
+debug_lock_free(void *lock_, unsigned locktype)
+{
+ struct debug_lock *lock = lock_;
+ EVUTIL_ASSERT(lock->count == 0);
+ EVUTIL_ASSERT(locktype == lock->locktype);
+ EVUTIL_ASSERT(DEBUG_LOCK_SIG == lock->signature);
+ if (original_lock_fns_.free) {
+ original_lock_fns_.free(lock->lock,
+ lock->locktype|EVTHREAD_LOCKTYPE_RECURSIVE);
+ }
+ lock->lock = NULL;
+ lock->count = -100;
+ lock->signature = 0x12300fda;
+ mm_free(lock);
+}
+
+static void
+evthread_debug_lock_mark_locked(unsigned mode, struct debug_lock *lock)
+{
+ EVUTIL_ASSERT(DEBUG_LOCK_SIG == lock->signature);
+ ++lock->count;
+ if (!(lock->locktype & EVTHREAD_LOCKTYPE_RECURSIVE))
+ EVUTIL_ASSERT(lock->count == 1);
+ if (evthread_id_fn_) {
+ unsigned long me;
+ me = evthread_id_fn_();
+ if (lock->count > 1)
+ EVUTIL_ASSERT(lock->held_by == me);
+ lock->held_by = me;
+ }
+}
+
+static int
+debug_lock_lock(unsigned mode, void *lock_)
+{
+ struct debug_lock *lock = lock_;
+ int res = 0;
+ if (lock->locktype & EVTHREAD_LOCKTYPE_READWRITE)
+ EVUTIL_ASSERT(mode & (EVTHREAD_READ|EVTHREAD_WRITE));
+ else
+ EVUTIL_ASSERT((mode & (EVTHREAD_READ|EVTHREAD_WRITE)) == 0);
+ if (original_lock_fns_.lock)
+ res = original_lock_fns_.lock(mode, lock->lock);
+ if (!res) {
+ evthread_debug_lock_mark_locked(mode, lock);
+ }
+ return res;
+}
+
+static void
+evthread_debug_lock_mark_unlocked(unsigned mode, struct debug_lock *lock)
+{
+ EVUTIL_ASSERT(DEBUG_LOCK_SIG == lock->signature);
+ if (lock->locktype & EVTHREAD_LOCKTYPE_READWRITE)
+ EVUTIL_ASSERT(mode & (EVTHREAD_READ|EVTHREAD_WRITE));
+ else
+ EVUTIL_ASSERT((mode & (EVTHREAD_READ|EVTHREAD_WRITE)) == 0);
+ if (evthread_id_fn_) {
+ unsigned long me;
+ me = evthread_id_fn_();
+ EVUTIL_ASSERT(lock->held_by == me);
+ if (lock->count == 1)
+ lock->held_by = 0;
+ }
+ --lock->count;
+ EVUTIL_ASSERT(lock->count >= 0);
+}
+
+static int
+debug_lock_unlock(unsigned mode, void *lock_)
+{
+ struct debug_lock *lock = lock_;
+ int res = 0;
+ evthread_debug_lock_mark_unlocked(mode, lock);
+ if (original_lock_fns_.unlock)
+ res = original_lock_fns_.unlock(mode, lock->lock);
+ return res;
+}
+
+static int
+debug_cond_wait(void *cond_, void *lock_, const struct timeval *tv)
+{
+ int r;
+ struct debug_lock *lock = lock_;
+ EVUTIL_ASSERT(lock);
+ EVUTIL_ASSERT(DEBUG_LOCK_SIG == lock->signature);
+ EVLOCK_ASSERT_LOCKED(lock_);
+ evthread_debug_lock_mark_unlocked(0, lock);
+ r = original_cond_fns_.wait_condition(cond_, lock->lock, tv);
+ evthread_debug_lock_mark_locked(0, lock);
+ return r;
+}
+
+/* misspelled version for backward compatibility */
+void
+evthread_enable_lock_debuging(void)
+{
+ evthread_enable_lock_debugging();
+}
+
+void
+evthread_enable_lock_debugging(void)
+{
+ struct evthread_lock_callbacks cbs = {
+ EVTHREAD_LOCK_API_VERSION,
+ EVTHREAD_LOCKTYPE_RECURSIVE,
+ debug_lock_alloc,
+ debug_lock_free,
+ debug_lock_lock,
+ debug_lock_unlock
+ };
+ if (evthread_lock_debugging_enabled_)
+ return;
+ memcpy(&original_lock_fns_, &evthread_lock_fns_,
+ sizeof(struct evthread_lock_callbacks));
+ memcpy(&evthread_lock_fns_, &cbs,
+ sizeof(struct evthread_lock_callbacks));
+
+ memcpy(&original_cond_fns_, &evthread_cond_fns_,
+ sizeof(struct evthread_condition_callbacks));
+ evthread_cond_fns_.wait_condition = debug_cond_wait;
+ evthread_lock_debugging_enabled_ = 1;
+
+ /* XXX return value should get checked. */
+ event_global_setup_locks_(0);
+}
+
+int
+evthread_is_debug_lock_held_(void *lock_)
+{
+ struct debug_lock *lock = lock_;
+ if (! lock->count)
+ return 0;
+ if (evthread_id_fn_) {
+ unsigned long me = evthread_id_fn_();
+ if (lock->held_by != me)
+ return 0;
+ }
+ return 1;
+}
+
+void *
+evthread_debug_get_real_lock_(void *lock_)
+{
+ struct debug_lock *lock = lock_;
+ return lock->lock;
+}
+
+void *
+evthread_setup_global_lock_(void *lock_, unsigned locktype, int enable_locks)
+{
+ /* there are four cases here:
+ 1) we're turning on debugging; locking is not on.
+ 2) we're turning on debugging; locking is on.
+ 3) we're turning on locking; debugging is not on.
+ 4) we're turning on locking; debugging is on. */
+
+ if (!enable_locks && original_lock_fns_.alloc == NULL) {
+ /* Case 1: allocate a debug lock. */
+ EVUTIL_ASSERT(lock_ == NULL);
+ return debug_lock_alloc(locktype);
+ } else if (!enable_locks && original_lock_fns_.alloc != NULL) {
+ /* Case 2: wrap the lock in a debug lock. */
+ struct debug_lock *lock;
+ EVUTIL_ASSERT(lock_ != NULL);
+
+ if (!(locktype & EVTHREAD_LOCKTYPE_RECURSIVE)) {
+ /* We can't wrap it: We need a recursive lock */
+ original_lock_fns_.free(lock_, locktype);
+ return debug_lock_alloc(locktype);
+ }
+ lock = mm_malloc(sizeof(struct debug_lock));
+ if (!lock) {
+ original_lock_fns_.free(lock_, locktype);
+ return NULL;
+ }
+ lock->lock = lock_;
+ lock->locktype = locktype;
+ lock->count = 0;
+ lock->held_by = 0;
+ return lock;
+ } else if (enable_locks && ! evthread_lock_debugging_enabled_) {
+ /* Case 3: allocate a regular lock */
+ EVUTIL_ASSERT(lock_ == NULL);
+ return evthread_lock_fns_.alloc(locktype);
+ } else {
+ /* Case 4: Fill in a debug lock with a real lock */
+ struct debug_lock *lock = lock_ ? lock_ : debug_lock_alloc(locktype);
+ EVUTIL_ASSERT(enable_locks &&
+ evthread_lock_debugging_enabled_);
+ EVUTIL_ASSERT(lock->locktype == locktype);
+ if (!lock->lock) {
+ lock->lock = original_lock_fns_.alloc(
+ locktype|EVTHREAD_LOCKTYPE_RECURSIVE);
+ if (!lock->lock) {
+ lock->count = -200;
+ mm_free(lock);
+ return NULL;
+ }
+ }
+ return lock;
+ }
+}
+
+
+#ifndef EVTHREAD_EXPOSE_STRUCTS
+unsigned long
+evthreadimpl_get_id_()
+{
+ return evthread_id_fn_ ? evthread_id_fn_() : 1;
+}
+void *
+evthreadimpl_lock_alloc_(unsigned locktype)
+{
+#ifndef EVENT__DISABLE_DEBUG_MODE
+ if (event_debug_mode_on_) {
+ event_debug_created_threadable_ctx_ = 1;
+ }
+#endif
+
+ return evthread_lock_fns_.alloc ?
+ evthread_lock_fns_.alloc(locktype) : NULL;
+}
+void
+evthreadimpl_lock_free_(void *lock, unsigned locktype)
+{
+ if (evthread_lock_fns_.free)
+ evthread_lock_fns_.free(lock, locktype);
+}
+int
+evthreadimpl_lock_lock_(unsigned mode, void *lock)
+{
+ if (evthread_lock_fns_.lock)
+ return evthread_lock_fns_.lock(mode, lock);
+ else
+ return 0;
+}
+int
+evthreadimpl_lock_unlock_(unsigned mode, void *lock)
+{
+ if (evthread_lock_fns_.unlock)
+ return evthread_lock_fns_.unlock(mode, lock);
+ else
+ return 0;
+}
+void *
+evthreadimpl_cond_alloc_(unsigned condtype)
+{
+#ifndef EVENT__DISABLE_DEBUG_MODE
+ if (event_debug_mode_on_) {
+ event_debug_created_threadable_ctx_ = 1;
+ }
+#endif
+
+ return evthread_cond_fns_.alloc_condition ?
+ evthread_cond_fns_.alloc_condition(condtype) : NULL;
+}
+void
+evthreadimpl_cond_free_(void *cond)
+{
+ if (evthread_cond_fns_.free_condition)
+ evthread_cond_fns_.free_condition(cond);
+}
+int
+evthreadimpl_cond_signal_(void *cond, int broadcast)
+{
+ if (evthread_cond_fns_.signal_condition)
+ return evthread_cond_fns_.signal_condition(cond, broadcast);
+ else
+ return 0;
+}
+int
+evthreadimpl_cond_wait_(void *cond, void *lock, const struct timeval *tv)
+{
+ if (evthread_cond_fns_.wait_condition)
+ return evthread_cond_fns_.wait_condition(cond, lock, tv);
+ else
+ return 0;
+}
+int
+evthreadimpl_is_lock_debugging_enabled_(void)
+{
+ return evthread_lock_debugging_enabled_;
+}
+
+int
+evthreadimpl_locking_enabled_(void)
+{
+ return evthread_lock_fns_.lock != NULL;
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/libevent/evthread.obj b/protocols/Telegram/tgl/libevent/evthread.obj
new file mode 100644
index 0000000000..e956cc88ae
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/evthread.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/evthread_pthread.c b/protocols/Telegram/tgl/libevent/evthread_pthread.c
new file mode 100644
index 0000000000..4e11f74970
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/evthread_pthread.c
@@ -0,0 +1,191 @@
+/*
+ * Copyright 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "event2/event-config.h"
+#include "evconfig-private.h"
+
+/* With glibc we need to define _GNU_SOURCE to get PTHREAD_MUTEX_RECURSIVE.
+ * This comes from evconfig-private.h
+ */
+#include <pthread.h>
+
+struct event_base;
+#include "event2/thread.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include "mm-internal.h"
+#include "evthread-internal.h"
+
+static pthread_mutexattr_t attr_recursive;
+
+static void *
+evthread_posix_lock_alloc(unsigned locktype)
+{
+ pthread_mutexattr_t *attr = NULL;
+ pthread_mutex_t *lock = mm_malloc(sizeof(pthread_mutex_t));
+ if (!lock)
+ return NULL;
+ if (locktype & EVTHREAD_LOCKTYPE_RECURSIVE)
+ attr = &attr_recursive;
+ if (pthread_mutex_init(lock, attr)) {
+ mm_free(lock);
+ return NULL;
+ }
+ return lock;
+}
+
+static void
+evthread_posix_lock_free(void *lock_, unsigned locktype)
+{
+ pthread_mutex_t *lock = lock_;
+ pthread_mutex_destroy(lock);
+ mm_free(lock);
+}
+
+static int
+evthread_posix_lock(unsigned mode, void *lock_)
+{
+ pthread_mutex_t *lock = lock_;
+ if (mode & EVTHREAD_TRY)
+ return pthread_mutex_trylock(lock);
+ else
+ return pthread_mutex_lock(lock);
+}
+
+static int
+evthread_posix_unlock(unsigned mode, void *lock_)
+{
+ pthread_mutex_t *lock = lock_;
+ return pthread_mutex_unlock(lock);
+}
+
+static unsigned long
+evthread_posix_get_id(void)
+{
+ union {
+ pthread_t thr;
+#if EVENT__SIZEOF_PTHREAD_T > EVENT__SIZEOF_LONG
+ ev_uint64_t id;
+#else
+ unsigned long id;
+#endif
+ } r;
+#if EVENT__SIZEOF_PTHREAD_T < EVENT__SIZEOF_LONG
+ memset(&r, 0, sizeof(r));
+#endif
+ r.thr = pthread_self();
+ return (unsigned long)r.id;
+}
+
+static void *
+evthread_posix_cond_alloc(unsigned condflags)
+{
+ pthread_cond_t *cond = mm_malloc(sizeof(pthread_cond_t));
+ if (!cond)
+ return NULL;
+ if (pthread_cond_init(cond, NULL)) {
+ mm_free(cond);
+ return NULL;
+ }
+ return cond;
+}
+
+static void
+evthread_posix_cond_free(void *cond_)
+{
+ pthread_cond_t *cond = cond_;
+ pthread_cond_destroy(cond);
+ mm_free(cond);
+}
+
+static int
+evthread_posix_cond_signal(void *cond_, int broadcast)
+{
+ pthread_cond_t *cond = cond_;
+ int r;
+ if (broadcast)
+ r = pthread_cond_broadcast(cond);
+ else
+ r = pthread_cond_signal(cond);
+ return r ? -1 : 0;
+}
+
+static int
+evthread_posix_cond_wait(void *cond_, void *lock_, const struct timeval *tv)
+{
+ int r;
+ pthread_cond_t *cond = cond_;
+ pthread_mutex_t *lock = lock_;
+
+ if (tv) {
+ struct timeval now, abstime;
+ struct timespec ts;
+ evutil_gettimeofday(&now, NULL);
+ evutil_timeradd(&now, tv, &abstime);
+ ts.tv_sec = abstime.tv_sec;
+ ts.tv_nsec = abstime.tv_usec*1000;
+ r = pthread_cond_timedwait(cond, lock, &ts);
+ if (r == ETIMEDOUT)
+ return 1;
+ else if (r)
+ return -1;
+ else
+ return 0;
+ } else {
+ r = pthread_cond_wait(cond, lock);
+ return r ? -1 : 0;
+ }
+}
+
+int
+evthread_use_pthreads(void)
+{
+ struct evthread_lock_callbacks cbs = {
+ EVTHREAD_LOCK_API_VERSION,
+ EVTHREAD_LOCKTYPE_RECURSIVE,
+ evthread_posix_lock_alloc,
+ evthread_posix_lock_free,
+ evthread_posix_lock,
+ evthread_posix_unlock
+ };
+ struct evthread_condition_callbacks cond_cbs = {
+ EVTHREAD_CONDITION_API_VERSION,
+ evthread_posix_cond_alloc,
+ evthread_posix_cond_free,
+ evthread_posix_cond_signal,
+ evthread_posix_cond_wait
+ };
+ /* Set ourselves up to get recursive locks. */
+ if (pthread_mutexattr_init(&attr_recursive))
+ return -1;
+ if (pthread_mutexattr_settype(&attr_recursive, PTHREAD_MUTEX_RECURSIVE))
+ return -1;
+
+ evthread_set_lock_callbacks(&cbs);
+ evthread_set_condition_callbacks(&cond_cbs);
+ evthread_set_id_callback(evthread_posix_get_id);
+ return 0;
+}
diff --git a/protocols/Telegram/tgl/libevent/evthread_win32.c b/protocols/Telegram/tgl/libevent/evthread_win32.c
new file mode 100644
index 0000000000..2ec80560a5
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/evthread_win32.c
@@ -0,0 +1,341 @@
+/*
+ * Copyright 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef _WIN32
+#ifndef _WIN32_WINNT
+/* Minimum required for InitializeCriticalSectionAndSpinCount */
+#define _WIN32_WINNT 0x0403
+#endif
+#include <winsock2.h>
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#include <sys/locking.h>
+#endif
+
+struct event_base;
+#include "event2/thread.h"
+
+#include "mm-internal.h"
+#include "evthread-internal.h"
+#include "time-internal.h"
+
+#define SPIN_COUNT 2000
+
+static void *
+evthread_win32_lock_create(unsigned locktype)
+{
+ CRITICAL_SECTION *lock = mm_malloc(sizeof(CRITICAL_SECTION));
+ if (!lock)
+ return NULL;
+ if (InitializeCriticalSectionAndSpinCount(lock, SPIN_COUNT) == 0) {
+ mm_free(lock);
+ return NULL;
+ }
+ return lock;
+}
+
+static void
+evthread_win32_lock_free(void *lock_, unsigned locktype)
+{
+ CRITICAL_SECTION *lock = lock_;
+ DeleteCriticalSection(lock);
+ mm_free(lock);
+}
+
+static int
+evthread_win32_lock(unsigned mode, void *lock_)
+{
+ CRITICAL_SECTION *lock = lock_;
+ if ((mode & EVTHREAD_TRY)) {
+ return ! TryEnterCriticalSection(lock);
+ } else {
+ EnterCriticalSection(lock);
+ return 0;
+ }
+}
+
+static int
+evthread_win32_unlock(unsigned mode, void *lock_)
+{
+ CRITICAL_SECTION *lock = lock_;
+ LeaveCriticalSection(lock);
+ return 0;
+}
+
+static unsigned long
+evthread_win32_get_id(void)
+{
+ return (unsigned long) GetCurrentThreadId();
+}
+
+#ifdef WIN32_HAVE_CONDITION_VARIABLES
+static void WINAPI (*InitializeConditionVariable_fn)(PCONDITION_VARIABLE)
+ = NULL;
+static BOOL WINAPI (*SleepConditionVariableCS_fn)(
+ PCONDITION_VARIABLE, PCRITICAL_SECTION, DWORD) = NULL;
+static void WINAPI (*WakeAllConditionVariable_fn)(PCONDITION_VARIABLE) = NULL;
+static void WINAPI (*WakeConditionVariable_fn)(PCONDITION_VARIABLE) = NULL;
+
+static int
+evthread_win32_condvar_init(void)
+{
+ HANDLE lib;
+
+ lib = GetModuleHandle(TEXT("kernel32.dll"));
+ if (lib == NULL)
+ return 0;
+
+#define LOAD(name) \
+ name##_fn = GetProcAddress(lib, #name)
+ LOAD(InitializeConditionVariable);
+ LOAD(SleepConditionVariableCS);
+ LOAD(WakeAllConditionVariable);
+ LOAD(WakeConditionVariable);
+
+ return InitializeConditionVariable_fn && SleepConditionVariableCS_fn &&
+ WakeAllConditionVariable_fn && WakeConditionVariable_fn;
+}
+
+/* XXXX Even if we can build this, we don't necessarily want to: the functions
+ * in question didn't exist before Vista, so we'd better LoadProc them. */
+static void *
+evthread_win32_condvar_alloc(unsigned condflags)
+{
+ CONDITION_VARIABLE *cond = mm_malloc(sizeof(CONDITION_VARIABLE));
+ if (!cond)
+ return NULL;
+ InitializeConditionVariable_fn(cond);
+ return cond;
+}
+
+static void
+evthread_win32_condvar_free(void *cond_)
+{
+ CONDITION_VARIABLE *cond = cond_;
+ /* There doesn't _seem_ to be a cleaup fn here... */
+ mm_free(cond);
+}
+
+static int
+evthread_win32_condvar_signal(void *cond, int broadcast)
+{
+ CONDITION_VARIABLE *cond = cond_;
+ if (broadcast)
+ WakeAllConditionVariable_fn(cond);
+ else
+ WakeConditionVariable_fn(cond);
+ return 0;
+}
+
+static int
+evthread_win32_condvar_wait(void *cond_, void *lock_, const struct timeval *tv)
+{
+ CONDITION_VARIABLE *cond = cond_;
+ CRITICAL_SECTION *lock = lock_;
+ DWORD ms, err;
+ BOOL result;
+
+ if (tv)
+ ms = evutil_tv_to_msec_(tv);
+ else
+ ms = INFINITE;
+ result = SleepConditionVariableCS_fn(cond, lock, ms);
+ if (result) {
+ if (GetLastError() == WAIT_TIMEOUT)
+ return 1;
+ else
+ return -1;
+ } else {
+ return 0;
+ }
+}
+#endif
+
+struct evthread_win32_cond {
+ HANDLE event;
+
+ CRITICAL_SECTION lock;
+ int n_waiting;
+ int n_to_wake;
+ int generation;
+};
+
+static void *
+evthread_win32_cond_alloc(unsigned flags)
+{
+ struct evthread_win32_cond *cond;
+ if (!(cond = mm_malloc(sizeof(struct evthread_win32_cond))))
+ return NULL;
+ if (InitializeCriticalSectionAndSpinCount(&cond->lock, SPIN_COUNT)==0) {
+ mm_free(cond);
+ return NULL;
+ }
+ if ((cond->event = CreateEvent(NULL,TRUE,FALSE,NULL)) == NULL) {
+ DeleteCriticalSection(&cond->lock);
+ mm_free(cond);
+ return NULL;
+ }
+ cond->n_waiting = cond->n_to_wake = cond->generation = 0;
+ return cond;
+}
+
+static void
+evthread_win32_cond_free(void *cond_)
+{
+ struct evthread_win32_cond *cond = cond_;
+ DeleteCriticalSection(&cond->lock);
+ CloseHandle(cond->event);
+ mm_free(cond);
+}
+
+static int
+evthread_win32_cond_signal(void *cond_, int broadcast)
+{
+ struct evthread_win32_cond *cond = cond_;
+ EnterCriticalSection(&cond->lock);
+ if (broadcast)
+ cond->n_to_wake = cond->n_waiting;
+ else
+ ++cond->n_to_wake;
+ cond->generation++;
+ SetEvent(cond->event);
+ LeaveCriticalSection(&cond->lock);
+ return 0;
+}
+
+static int
+evthread_win32_cond_wait(void *cond_, void *lock_, const struct timeval *tv)
+{
+ struct evthread_win32_cond *cond = cond_;
+ CRITICAL_SECTION *lock = lock_;
+ int generation_at_start;
+ int waiting = 1;
+ int result = -1;
+ DWORD ms = INFINITE, ms_orig = INFINITE, startTime, endTime;
+ if (tv)
+ ms_orig = ms = evutil_tv_to_msec_(tv);
+
+ EnterCriticalSection(&cond->lock);
+ ++cond->n_waiting;
+ generation_at_start = cond->generation;
+ LeaveCriticalSection(&cond->lock);
+
+ LeaveCriticalSection(lock);
+
+ startTime = GetTickCount();
+ do {
+ DWORD res;
+ res = WaitForSingleObject(cond->event, ms);
+ EnterCriticalSection(&cond->lock);
+ if (cond->n_to_wake &&
+ cond->generation != generation_at_start) {
+ --cond->n_to_wake;
+ --cond->n_waiting;
+ result = 0;
+ waiting = 0;
+ goto out;
+ } else if (res != WAIT_OBJECT_0) {
+ result = (res==WAIT_TIMEOUT) ? 1 : -1;
+ --cond->n_waiting;
+ waiting = 0;
+ goto out;
+ } else if (ms != INFINITE) {
+ endTime = GetTickCount();
+ if (startTime + ms_orig <= endTime) {
+ result = 1; /* Timeout */
+ --cond->n_waiting;
+ waiting = 0;
+ goto out;
+ } else {
+ ms = startTime + ms_orig - endTime;
+ }
+ }
+ /* If we make it here, we are still waiting. */
+ if (cond->n_to_wake == 0) {
+ /* There is nobody else who should wake up; reset
+ * the event. */
+ ResetEvent(cond->event);
+ }
+ out:
+ LeaveCriticalSection(&cond->lock);
+ } while (waiting);
+
+ EnterCriticalSection(lock);
+
+ EnterCriticalSection(&cond->lock);
+ if (!cond->n_waiting)
+ ResetEvent(cond->event);
+ LeaveCriticalSection(&cond->lock);
+
+ return result;
+}
+
+int
+evthread_use_windows_threads(void)
+{
+ struct evthread_lock_callbacks cbs = {
+ EVTHREAD_LOCK_API_VERSION,
+ EVTHREAD_LOCKTYPE_RECURSIVE,
+ evthread_win32_lock_create,
+ evthread_win32_lock_free,
+ evthread_win32_lock,
+ evthread_win32_unlock
+ };
+
+
+ struct evthread_condition_callbacks cond_cbs = {
+ EVTHREAD_CONDITION_API_VERSION,
+ evthread_win32_cond_alloc,
+ evthread_win32_cond_free,
+ evthread_win32_cond_signal,
+ evthread_win32_cond_wait
+ };
+#ifdef WIN32_HAVE_CONDITION_VARIABLES
+ struct evthread_condition_callbacks condvar_cbs = {
+ EVTHREAD_CONDITION_API_VERSION,
+ evthread_win32_condvar_alloc,
+ evthread_win32_condvar_free,
+ evthread_win32_condvar_signal,
+ evthread_win32_condvar_wait
+ };
+#endif
+
+ evthread_set_lock_callbacks(&cbs);
+ evthread_set_id_callback(evthread_win32_get_id);
+#ifdef WIN32_HAVE_CONDITION_VARIABLES
+ if (evthread_win32_condvar_init()) {
+ evthread_set_condition_callbacks(&condvar_cbs);
+ return 0;
+ }
+#endif
+ evthread_set_condition_callbacks(&cond_cbs);
+
+ return 0;
+}
+
diff --git a/protocols/Telegram/tgl/libevent/evthread_win32.obj b/protocols/Telegram/tgl/libevent/evthread_win32.obj
new file mode 100644
index 0000000000..f50cf71184
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/evthread_win32.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/evutil.c b/protocols/Telegram/tgl/libevent/evutil.c
new file mode 100644
index 0000000000..495bfcc029
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/evutil.c
@@ -0,0 +1,2667 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#include <io.h>
+#include <tchar.h>
+#include <process.h>
+#undef _WIN32_WINNT
+/* For structs needed by GetAdaptersAddresses */
+#define _WIN32_WINNT 0x0501
+#include <iphlpapi.h>
+#endif
+
+#include <sys/types.h>
+#ifdef EVENT__HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef EVENT__HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#ifdef EVENT__HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#include <errno.h>
+#include <limits.h>
+#include <stdio.h>
+#include <string.h>
+#ifdef EVENT__HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef EVENT__HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+#ifdef EVENT__HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif
+#ifdef EVENT__HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#include <time.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_IFADDRS_H
+#include <ifaddrs.h>
+#endif
+
+#include "event2/util.h"
+#include "util-internal.h"
+#include "log-internal.h"
+#include "mm-internal.h"
+#include "evthread-internal.h"
+
+#include "strlcpy-internal.h"
+#include "ipv6-internal.h"
+
+#ifdef _WIN32
+#define HT_NO_CACHE_HASH_VALUES
+#include "ht-internal.h"
+#define open _open
+#define read _read
+#define close _close
+#ifndef fstat
+#define fstat _fstati64
+#endif
+#ifndef stat
+#define stat _stati64
+#endif
+#define mode_t int
+#endif
+
+int
+evutil_open_closeonexec_(const char *pathname, int flags, unsigned mode)
+{
+ int fd;
+
+#ifdef O_CLOEXEC
+ fd = open(pathname, flags|O_CLOEXEC, (mode_t)mode);
+ if (fd >= 0 || errno == EINVAL)
+ return fd;
+ /* If we got an EINVAL, fall through and try without O_CLOEXEC */
+#endif
+ fd = open(pathname, flags, (mode_t)mode);
+ if (fd < 0)
+ return -1;
+
+#if defined(FD_CLOEXEC)
+ if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0) {
+ close(fd);
+ return -1;
+ }
+#endif
+
+ return fd;
+}
+
+/**
+ Read the contents of 'filename' into a newly allocated NUL-terminated
+ string. Set *content_out to hold this string, and *len_out to hold its
+ length (not including the appended NUL). If 'is_binary', open the file in
+ binary mode.
+
+ Returns 0 on success, -1 if the open fails, and -2 for all other failures.
+
+ Used internally only; may go away in a future version.
+ */
+int
+evutil_read_file_(const char *filename, char **content_out, size_t *len_out,
+ int is_binary)
+{
+ int fd, r;
+ struct stat st;
+ char *mem;
+ size_t read_so_far=0;
+ int mode = O_RDONLY;
+
+ EVUTIL_ASSERT(content_out);
+ EVUTIL_ASSERT(len_out);
+ *content_out = NULL;
+ *len_out = 0;
+
+#ifdef O_BINARY
+ if (is_binary)
+ mode |= O_BINARY;
+#endif
+
+ fd = evutil_open_closeonexec_(filename, mode, 0);
+ if (fd < 0)
+ return -1;
+ if (fstat(fd, &st) || st.st_size < 0 ||
+ st.st_size > EV_SSIZE_MAX-1 ) {
+ close(fd);
+ return -2;
+ }
+ mem = mm_malloc((size_t)st.st_size + 1);
+ if (!mem) {
+ close(fd);
+ return -2;
+ }
+ read_so_far = 0;
+#ifdef _WIN32
+#define N_TO_READ(x) ((x) > INT_MAX) ? INT_MAX : ((int)(x))
+#else
+#define N_TO_READ(x) (x)
+#endif
+ while ((r = read(fd, mem+read_so_far, N_TO_READ(st.st_size - read_so_far))) > 0) {
+ read_so_far += r;
+ if (read_so_far >= (size_t)st.st_size)
+ break;
+ EVUTIL_ASSERT(read_so_far < (size_t)st.st_size);
+ }
+ close(fd);
+ if (r < 0) {
+ mm_free(mem);
+ return -2;
+ }
+ mem[read_so_far] = 0;
+
+ *len_out = read_so_far;
+ *content_out = mem;
+ return 0;
+}
+
+int
+evutil_socketpair(int family, int type, int protocol, evutil_socket_t fd[2])
+{
+#ifndef _WIN32
+ return socketpair(family, type, protocol, fd);
+#else
+ return evutil_ersatz_socketpair_(family, type, protocol, fd);
+#endif
+}
+
+int
+evutil_ersatz_socketpair_(int family, int type, int protocol,
+ evutil_socket_t fd[2])
+{
+ /* This code is originally from Tor. Used with permission. */
+
+ /* This socketpair does not work when localhost is down. So
+ * it's really not the same thing at all. But it's close enough
+ * for now, and really, when localhost is down sometimes, we
+ * have other problems too.
+ */
+#ifdef _WIN32
+#define ERR(e) WSA##e
+#else
+#define ERR(e) e
+#endif
+ evutil_socket_t listener = -1;
+ evutil_socket_t connector = -1;
+ evutil_socket_t acceptor = -1;
+ struct sockaddr_in listen_addr;
+ struct sockaddr_in connect_addr;
+ ev_socklen_t size;
+ int saved_errno = -1;
+ int family_test;
+
+ family_test = family != AF_INET;
+#ifdef AF_UNIX
+ family_test = family_test && (family != AF_UNIX);
+#endif
+ if (protocol || family_test) {
+ EVUTIL_SET_SOCKET_ERROR(ERR(EAFNOSUPPORT));
+ return -1;
+ }
+
+ if (!fd) {
+ EVUTIL_SET_SOCKET_ERROR(ERR(EINVAL));
+ return -1;
+ }
+
+ listener = socket(AF_INET, type, 0);
+ if (listener < 0)
+ return -1;
+ memset(&listen_addr, 0, sizeof(listen_addr));
+ listen_addr.sin_family = AF_INET;
+ listen_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+ listen_addr.sin_port = 0; /* kernel chooses port. */
+ if (bind(listener, (struct sockaddr *) &listen_addr, sizeof (listen_addr))
+ == -1)
+ goto tidy_up_and_fail;
+ if (listen(listener, 1) == -1)
+ goto tidy_up_and_fail;
+
+ connector = socket(AF_INET, type, 0);
+ if (connector < 0)
+ goto tidy_up_and_fail;
+
+ memset(&connect_addr, 0, sizeof(connect_addr));
+
+ /* We want to find out the port number to connect to. */
+ size = sizeof(connect_addr);
+ if (getsockname(listener, (struct sockaddr *) &connect_addr, &size) == -1)
+ goto tidy_up_and_fail;
+ if (size != sizeof (connect_addr))
+ goto abort_tidy_up_and_fail;
+ if (connect(connector, (struct sockaddr *) &connect_addr,
+ sizeof(connect_addr)) == -1)
+ goto tidy_up_and_fail;
+
+ size = sizeof(listen_addr);
+ acceptor = accept(listener, (struct sockaddr *) &listen_addr, &size);
+ if (acceptor < 0)
+ goto tidy_up_and_fail;
+ if (size != sizeof(listen_addr))
+ goto abort_tidy_up_and_fail;
+ /* Now check we are talking to ourself by matching port and host on the
+ two sockets. */
+ if (getsockname(connector, (struct sockaddr *) &connect_addr, &size) == -1)
+ goto tidy_up_and_fail;
+ if (size != sizeof (connect_addr)
+ || listen_addr.sin_family != connect_addr.sin_family
+ || listen_addr.sin_addr.s_addr != connect_addr.sin_addr.s_addr
+ || listen_addr.sin_port != connect_addr.sin_port)
+ goto abort_tidy_up_and_fail;
+ evutil_closesocket(listener);
+ fd[0] = connector;
+ fd[1] = acceptor;
+
+ return 0;
+
+ abort_tidy_up_and_fail:
+ saved_errno = ERR(ECONNABORTED);
+ tidy_up_and_fail:
+ if (saved_errno < 0)
+ saved_errno = EVUTIL_SOCKET_ERROR();
+ if (listener != -1)
+ evutil_closesocket(listener);
+ if (connector != -1)
+ evutil_closesocket(connector);
+ if (acceptor != -1)
+ evutil_closesocket(acceptor);
+
+ EVUTIL_SET_SOCKET_ERROR(saved_errno);
+ return -1;
+#undef ERR
+}
+
+int
+evutil_make_socket_nonblocking(evutil_socket_t fd)
+{
+#ifdef _WIN32
+ {
+ unsigned long nonblocking = 1;
+ if (ioctlsocket(fd, FIONBIO, &nonblocking) == SOCKET_ERROR) {
+ event_sock_warn(fd, "fcntl(%d, F_GETFL)", (int)fd);
+ return -1;
+ }
+ }
+#else
+ {
+ int flags;
+ if ((flags = fcntl(fd, F_GETFL, NULL)) < 0) {
+ event_warn("fcntl(%d, F_GETFL)", fd);
+ return -1;
+ }
+ if (!(flags & O_NONBLOCK)) {
+ if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) == -1) {
+ event_warn("fcntl(%d, F_SETFL)", fd);
+ return -1;
+ }
+ }
+ }
+#endif
+ return 0;
+}
+
+/* Faster version of evutil_make_socket_nonblocking for internal use.
+ *
+ * Requires that no F_SETFL flags were previously set on the fd.
+ */
+static int
+evutil_fast_socket_nonblocking(evutil_socket_t fd)
+{
+#ifdef _WIN32
+ return evutil_make_socket_nonblocking(fd);
+#else
+ if (fcntl(fd, F_SETFL, O_NONBLOCK) == -1) {
+ event_warn("fcntl(%d, F_SETFL)", fd);
+ return -1;
+ }
+ return 0;
+#endif
+}
+
+int
+evutil_make_listen_socket_reuseable(evutil_socket_t sock)
+{
+#if defined(SO_REUSEADDR) && !defined(_WIN32)
+ int one = 1;
+ /* REUSEADDR on Unix means, "don't hang on to this address after the
+ * listener is closed." On Windows, though, it means "don't keep other
+ * processes from binding to this address while we're using it. */
+ return setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void*) &one,
+ (ev_socklen_t)sizeof(one));
+#else
+ return 0;
+#endif
+}
+
+int
+evutil_make_listen_socket_reuseable_port(evutil_socket_t sock)
+{
+#if defined __linux__ && defined(SO_REUSEPORT)
+ int one = 1;
+ /* REUSEPORT on Linux 3.9+ means, "Multiple servers (processes or
+ * threads) can bind to the same port if they each set the option. */
+ return setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, (void*) &one,
+ (ev_socklen_t)sizeof(one));
+#else
+ return 0;
+#endif
+}
+
+int
+evutil_make_tcp_listen_socket_deferred(evutil_socket_t sock)
+{
+#if defined(EVENT__HAVE_NETINET_TCP_H) && defined(TCP_DEFER_ACCEPT)
+ int one = 1;
+
+ /* TCP_DEFER_ACCEPT tells the kernel to call defer accept() only after data
+ * has arrived and ready to read */
+ return setsockopt(sock, IPPROTO_TCP, TCP_DEFER_ACCEPT, &one,
+ (ev_socklen_t)sizeof(one));
+#endif
+ return 0;
+}
+
+int
+evutil_make_socket_closeonexec(evutil_socket_t fd)
+{
+#if !defined(_WIN32) && defined(EVENT__HAVE_SETFD)
+ int flags;
+ if ((flags = fcntl(fd, F_GETFD, NULL)) < 0) {
+ event_warn("fcntl(%d, F_GETFD)", fd);
+ return -1;
+ }
+ if (!(flags & FD_CLOEXEC)) {
+ if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) == -1) {
+ event_warn("fcntl(%d, F_SETFD)", fd);
+ return -1;
+ }
+ }
+#endif
+ return 0;
+}
+
+/* Faster version of evutil_make_socket_closeonexec for internal use.
+ *
+ * Requires that no F_SETFD flags were previously set on the fd.
+ */
+static int
+evutil_fast_socket_closeonexec(evutil_socket_t fd)
+{
+#if !defined(_WIN32) && defined(EVENT__HAVE_SETFD)
+ if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) {
+ event_warn("fcntl(%d, F_SETFD)", fd);
+ return -1;
+ }
+#endif
+ return 0;
+}
+
+int
+evutil_closesocket(evutil_socket_t sock)
+{
+#ifndef _WIN32
+ return close(sock);
+#else
+ return closesocket(sock);
+#endif
+}
+
+ev_int64_t
+evutil_strtoll(const char *s, char **endptr, int base)
+{
+#ifdef EVENT__HAVE_STRTOLL
+ return (ev_int64_t)strtoll(s, endptr, base);
+#elif EVENT__SIZEOF_LONG == 8
+ return (ev_int64_t)strtol(s, endptr, base);
+#elif defined(_WIN32) && defined(_MSC_VER) && _MSC_VER < 1300
+ /* XXXX on old versions of MS APIs, we only support base
+ * 10. */
+ ev_int64_t r;
+ if (base != 10)
+ return 0;
+ r = (ev_int64_t) _atoi64(s);
+ while (isspace(*s))
+ ++s;
+ if (*s == '-')
+ ++s;
+ while (isdigit(*s))
+ ++s;
+ if (endptr)
+ *endptr = (char*) s;
+ return r;
+#elif defined(_WIN32)
+ return (ev_int64_t) _strtoi64(s, endptr, base);
+#elif defined(EVENT__SIZEOF_LONG_LONG) && EVENT__SIZEOF_LONG_LONG == 8
+ long long r;
+ int n;
+ if (base != 10 && base != 16)
+ return 0;
+ if (base == 10) {
+ n = sscanf(s, "%lld", &r);
+ } else {
+ unsigned long long ru=0;
+ n = sscanf(s, "%llx", &ru);
+ if (ru > EV_INT64_MAX)
+ return 0;
+ r = (long long) ru;
+ }
+ if (n != 1)
+ return 0;
+ while (EVUTIL_ISSPACE_(*s))
+ ++s;
+ if (*s == '-')
+ ++s;
+ if (base == 10) {
+ while (EVUTIL_ISDIGIT_(*s))
+ ++s;
+ } else {
+ while (EVUTIL_ISXDIGIT_(*s))
+ ++s;
+ }
+ if (endptr)
+ *endptr = (char*) s;
+ return r;
+#else
+#error "I don't know how to parse 64-bit integers."
+#endif
+}
+
+#ifdef _WIN32
+int
+evutil_socket_geterror(evutil_socket_t sock)
+{
+ int optval, optvallen=sizeof(optval);
+ int err = WSAGetLastError();
+ if (err == WSAEWOULDBLOCK && sock >= 0) {
+ if (getsockopt(sock, SOL_SOCKET, SO_ERROR, (void*)&optval,
+ &optvallen))
+ return err;
+ if (optval)
+ return optval;
+ }
+ return err;
+}
+#endif
+
+/* XXX we should use an enum here. */
+/* 2 for connection refused, 1 for connected, 0 for not yet, -1 for error. */
+int
+evutil_socket_connect_(evutil_socket_t *fd_ptr, const struct sockaddr *sa, int socklen)
+{
+ int made_fd = 0;
+
+ if (*fd_ptr < 0) {
+ if ((*fd_ptr = socket(sa->sa_family, SOCK_STREAM, 0)) < 0)
+ goto err;
+ made_fd = 1;
+ if (evutil_make_socket_nonblocking(*fd_ptr) < 0) {
+ goto err;
+ }
+ }
+
+ if (connect(*fd_ptr, sa, socklen) < 0) {
+ int e = evutil_socket_geterror(*fd_ptr);
+ if (EVUTIL_ERR_CONNECT_RETRIABLE(e))
+ return 0;
+ if (EVUTIL_ERR_CONNECT_REFUSED(e))
+ return 2;
+ goto err;
+ } else {
+ return 1;
+ }
+
+err:
+ if (made_fd) {
+ evutil_closesocket(*fd_ptr);
+ *fd_ptr = -1;
+ }
+ return -1;
+}
+
+/* Check whether a socket on which we called connect() is done
+ connecting. Return 1 for connected, 0 for not yet, -1 for error. In the
+ error case, set the current socket errno to the error that happened during
+ the connect operation. */
+int
+evutil_socket_finished_connecting_(evutil_socket_t fd)
+{
+ int e;
+ ev_socklen_t elen = sizeof(e);
+
+ if (getsockopt(fd, SOL_SOCKET, SO_ERROR, (void*)&e, &elen) < 0)
+ return -1;
+
+ if (e) {
+ if (EVUTIL_ERR_CONNECT_RETRIABLE(e))
+ return 0;
+ EVUTIL_SET_SOCKET_ERROR(e);
+ return -1;
+ }
+
+ return 1;
+}
+
+#if (EVUTIL_AI_PASSIVE|EVUTIL_AI_CANONNAME|EVUTIL_AI_NUMERICHOST| \
+ EVUTIL_AI_NUMERICSERV|EVUTIL_AI_V4MAPPED|EVUTIL_AI_ALL| \
+ EVUTIL_AI_ADDRCONFIG) != \
+ (EVUTIL_AI_PASSIVE^EVUTIL_AI_CANONNAME^EVUTIL_AI_NUMERICHOST^ \
+ EVUTIL_AI_NUMERICSERV^EVUTIL_AI_V4MAPPED^EVUTIL_AI_ALL^ \
+ EVUTIL_AI_ADDRCONFIG)
+#error "Some of our EVUTIL_AI_* flags seem to overlap with system AI_* flags"
+#endif
+
+/* We sometimes need to know whether we have an ipv4 address and whether we
+ have an ipv6 address. If 'have_checked_interfaces', then we've already done
+ the test. If 'had_ipv4_address', then it turns out we had an ipv4 address.
+ If 'had_ipv6_address', then it turns out we had an ipv6 address. These are
+ set by evutil_check_interfaces. */
+static int have_checked_interfaces, had_ipv4_address, had_ipv6_address;
+
+/* Macro: True iff the IPv4 address 'addr', in host order, is in 127.0.0.0/8
+ */
+#define EVUTIL_V4ADDR_IS_LOCALHOST(addr) (((addr)>>24) == 127)
+
+/* Macro: True iff the IPv4 address 'addr', in host order, is a class D
+ * (multiclass) address.
+ */
+#define EVUTIL_V4ADDR_IS_CLASSD(addr) ((((addr)>>24) & 0xf0) == 0xe0)
+
+static void
+evutil_found_ifaddr(const struct sockaddr *sa)
+{
+ const char ZEROES[] = "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00";
+
+ if (sa->sa_family == AF_INET) {
+ const struct sockaddr_in *sin = (struct sockaddr_in *)sa;
+ ev_uint32_t addr = ntohl(sin->sin_addr.s_addr);
+ if (addr == 0 ||
+ EVUTIL_V4ADDR_IS_LOCALHOST(addr) ||
+ EVUTIL_V4ADDR_IS_CLASSD(addr)) {
+ /* Not actually a usable external address. */
+ } else {
+ event_debug(("Detected an IPv4 interface"));
+ had_ipv4_address = 1;
+ }
+ } else if (sa->sa_family == AF_INET6) {
+ const struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa;
+ const unsigned char *addr =
+ (unsigned char*)sin6->sin6_addr.s6_addr;
+ if (!memcmp(addr, ZEROES, 8) ||
+ ((addr[0] & 0xfe) == 0xfc) ||
+ (addr[0] == 0xfe && (addr[1] & 0xc0) == 0x80) ||
+ (addr[0] == 0xfe && (addr[1] & 0xc0) == 0xc0) ||
+ (addr[0] == 0xff)) {
+ /* This is a reserved, ipv4compat, ipv4map, loopback,
+ * link-local, multicast, or unspecified address. */
+ } else {
+ event_debug(("Detected an IPv6 interface"));
+ had_ipv6_address = 1;
+ }
+ }
+}
+
+#ifdef _WIN32
+typedef ULONG (WINAPI *GetAdaptersAddresses_fn_t)(
+ ULONG, ULONG, PVOID, PIP_ADAPTER_ADDRESSES, PULONG);
+#endif
+
+static int
+evutil_check_ifaddrs(void)
+{
+#if defined(EVENT__HAVE_GETIFADDRS)
+ /* Most free Unixy systems provide getifaddrs, which gives us a linked list
+ * of struct ifaddrs. */
+ struct ifaddrs *ifa = NULL;
+ const struct ifaddrs *i;
+ if (getifaddrs(&ifa) < 0) {
+ event_warn("Unable to call getifaddrs()");
+ return -1;
+ }
+
+ for (i = ifa; i; i = i->ifa_next) {
+ if (!i->ifa_addr)
+ continue;
+ evutil_found_ifaddr(i->ifa_addr);
+ }
+
+ freeifaddrs(ifa);
+ return 0;
+#elif defined(_WIN32)
+ /* Windows XP began to provide GetAdaptersAddresses. Windows 2000 had a
+ "GetAdaptersInfo", but that's deprecated; let's just try
+ GetAdaptersAddresses and fall back to connect+getsockname.
+ */
+ HMODULE lib = evutil_load_windows_system_library_(TEXT("ihplapi.dll"));
+ GetAdaptersAddresses_fn_t fn;
+ ULONG size, res;
+ IP_ADAPTER_ADDRESSES *addresses = NULL, *address;
+ int result = -1;
+
+#define FLAGS (GAA_FLAG_SKIP_ANYCAST | \
+ GAA_FLAG_SKIP_MULTICAST | \
+ GAA_FLAG_SKIP_DNS_SERVER)
+
+ if (!lib)
+ goto done;
+
+ if (!(fn = (GetAdaptersAddresses_fn_t) GetProcAddress(lib, "GetAdaptersAddresses")))
+ goto done;
+
+ /* Guess how much space we need. */
+ size = 15*1024;
+ addresses = mm_malloc(size);
+ if (!addresses)
+ goto done;
+ res = fn(AF_UNSPEC, FLAGS, NULL, addresses, &size);
+ if (res == ERROR_BUFFER_OVERFLOW) {
+ /* we didn't guess that we needed enough space; try again */
+ mm_free(addresses);
+ addresses = mm_malloc(size);
+ if (!addresses)
+ goto done;
+ res = fn(AF_UNSPEC, FLAGS, NULL, addresses, &size);
+ }
+ if (res != NO_ERROR)
+ goto done;
+
+ for (address = addresses; address; address = address->Next) {
+ IP_ADAPTER_UNICAST_ADDRESS *a;
+ for (a = address->FirstUnicastAddress; a; a = a->Next) {
+ /* Yes, it's a linked list inside a linked list */
+ struct sockaddr *sa = a->Address.lpSockaddr;
+ evutil_found_ifaddr(sa);
+ }
+ }
+
+ result = 0;
+done:
+ if (lib)
+ FreeLibrary(lib);
+ if (addresses)
+ mm_free(addresses);
+ return result;
+#else
+ return -1;
+#endif
+}
+
+/* Test whether we have an ipv4 interface and an ipv6 interface. Return 0 if
+ * the test seemed successful. */
+static int
+evutil_check_interfaces(int force_recheck)
+{
+ evutil_socket_t fd = -1;
+ struct sockaddr_in sin, sin_out;
+ struct sockaddr_in6 sin6, sin6_out;
+ ev_socklen_t sin_out_len = sizeof(sin_out);
+ ev_socklen_t sin6_out_len = sizeof(sin6_out);
+ int r;
+ if (have_checked_interfaces && !force_recheck)
+ return 0;
+
+ if (evutil_check_ifaddrs() == 0) {
+ /* Use a nice sane interface, if this system has one. */
+ return 0;
+ }
+
+ /* Ugh. There was no nice sane interface. So to check whether we have
+ * an interface open for a given protocol, will try to make a UDP
+ * 'connection' to a remote host on the internet. We don't actually
+ * use it, so the address doesn't matter, but we want to pick one that
+ * keep us from using a host- or link-local interface. */
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_port = htons(53);
+ r = evutil_inet_pton(AF_INET, "18.244.0.188", &sin.sin_addr);
+ EVUTIL_ASSERT(r);
+
+ memset(&sin6, 0, sizeof(sin6));
+ sin6.sin6_family = AF_INET6;
+ sin6.sin6_port = htons(53);
+ r = evutil_inet_pton(AF_INET6, "2001:4860:b002::68", &sin6.sin6_addr);
+ EVUTIL_ASSERT(r);
+
+ memset(&sin_out, 0, sizeof(sin_out));
+ memset(&sin6_out, 0, sizeof(sin6_out));
+
+ /* XXX some errnos mean 'no address'; some mean 'not enough sockets'. */
+ if ((fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) >= 0 &&
+ connect(fd, (struct sockaddr*)&sin, sizeof(sin)) == 0 &&
+ getsockname(fd, (struct sockaddr*)&sin_out, &sin_out_len) == 0) {
+ /* We might have an IPv4 interface. */
+ evutil_found_ifaddr((struct sockaddr*) &sin_out);
+ }
+ if (fd >= 0)
+ evutil_closesocket(fd);
+
+ if ((fd = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP)) >= 0 &&
+ connect(fd, (struct sockaddr*)&sin6, sizeof(sin6)) == 0 &&
+ getsockname(fd, (struct sockaddr*)&sin6_out, &sin6_out_len) == 0) {
+ /* We might have an IPv6 interface. */
+ evutil_found_ifaddr((struct sockaddr*) &sin6_out);
+ }
+
+ if (fd >= 0)
+ evutil_closesocket(fd);
+
+ return 0;
+}
+
+/* Internal addrinfo flag. This one is set when we allocate the addrinfo from
+ * inside libevent. Otherwise, the built-in getaddrinfo() function allocated
+ * it, and we should trust what they said.
+ **/
+#define EVUTIL_AI_LIBEVENT_ALLOCATED 0x80000000
+
+/* Helper: construct a new addrinfo containing the socket address in
+ * 'sa', which must be a sockaddr_in or a sockaddr_in6. Take the
+ * socktype and protocol info from hints. If they weren't set, then
+ * allocate both a TCP and a UDP addrinfo.
+ */
+struct evutil_addrinfo *
+evutil_new_addrinfo_(struct sockaddr *sa, ev_socklen_t socklen,
+ const struct evutil_addrinfo *hints)
+{
+ struct evutil_addrinfo *res;
+ EVUTIL_ASSERT(hints);
+
+ if (hints->ai_socktype == 0 && hints->ai_protocol == 0) {
+ /* Indecisive user! Give them a UDP and a TCP. */
+ struct evutil_addrinfo *r1, *r2;
+ struct evutil_addrinfo tmp;
+ memcpy(&tmp, hints, sizeof(tmp));
+ tmp.ai_socktype = SOCK_STREAM; tmp.ai_protocol = IPPROTO_TCP;
+ r1 = evutil_new_addrinfo_(sa, socklen, &tmp);
+ if (!r1)
+ return NULL;
+ tmp.ai_socktype = SOCK_DGRAM; tmp.ai_protocol = IPPROTO_UDP;
+ r2 = evutil_new_addrinfo_(sa, socklen, &tmp);
+ if (!r2) {
+ evutil_freeaddrinfo(r1);
+ return NULL;
+ }
+ r1->ai_next = r2;
+ return r1;
+ }
+
+ /* We're going to allocate extra space to hold the sockaddr. */
+ res = mm_calloc(1,sizeof(struct evutil_addrinfo)+socklen);
+ if (!res)
+ return NULL;
+ res->ai_addr = (struct sockaddr*)
+ (((char*)res) + sizeof(struct evutil_addrinfo));
+ memcpy(res->ai_addr, sa, socklen);
+ res->ai_addrlen = socklen;
+ res->ai_family = sa->sa_family; /* Same or not? XXX */
+ res->ai_flags = EVUTIL_AI_LIBEVENT_ALLOCATED;
+ res->ai_socktype = hints->ai_socktype;
+ res->ai_protocol = hints->ai_protocol;
+
+ return res;
+}
+
+/* Append the addrinfo 'append' to the end of 'first', and return the start of
+ * the list. Either element can be NULL, in which case we return the element
+ * that is not NULL. */
+struct evutil_addrinfo *
+evutil_addrinfo_append_(struct evutil_addrinfo *first,
+ struct evutil_addrinfo *append)
+{
+ struct evutil_addrinfo *ai = first;
+ if (!ai)
+ return append;
+ while (ai->ai_next)
+ ai = ai->ai_next;
+ ai->ai_next = append;
+
+ return first;
+}
+
+static int
+parse_numeric_servname(const char *servname)
+{
+ int n;
+ char *endptr=NULL;
+ n = (int) strtol(servname, &endptr, 10);
+ if (n>=0 && n <= 65535 && servname[0] && endptr && !endptr[0])
+ return n;
+ else
+ return -1;
+}
+
+/** Parse a service name in 'servname', which can be a decimal port.
+ * Return the port number, or -1 on error.
+ */
+static int
+evutil_parse_servname(const char *servname, const char *protocol,
+ const struct evutil_addrinfo *hints)
+{
+ int n = parse_numeric_servname(servname);
+ if (n>=0)
+ return n;
+#if defined(EVENT__HAVE_GETSERVBYNAME) || defined(_WIN32)
+ if (!(hints->ai_flags & EVUTIL_AI_NUMERICSERV)) {
+ struct servent *ent = getservbyname(servname, protocol);
+ if (ent) {
+ return ntohs(ent->s_port);
+ }
+ }
+#endif
+ return -1;
+}
+
+/* Return a string corresponding to a protocol number that we can pass to
+ * getservyname. */
+static const char *
+evutil_unparse_protoname(int proto)
+{
+ switch (proto) {
+ case 0:
+ return NULL;
+ case IPPROTO_TCP:
+ return "tcp";
+ case IPPROTO_UDP:
+ return "udp";
+#ifdef IPPROTO_SCTP
+ case IPPROTO_SCTP:
+ return "sctp";
+#endif
+ default:
+#ifdef EVENT__HAVE_GETPROTOBYNUMBER
+ {
+ struct protoent *ent = getprotobynumber(proto);
+ if (ent)
+ return ent->p_name;
+ }
+#endif
+ return NULL;
+ }
+}
+
+static void
+evutil_getaddrinfo_infer_protocols(struct evutil_addrinfo *hints)
+{
+ /* If we can guess the protocol from the socktype, do so. */
+ if (!hints->ai_protocol && hints->ai_socktype) {
+ if (hints->ai_socktype == SOCK_DGRAM)
+ hints->ai_protocol = IPPROTO_UDP;
+ else if (hints->ai_socktype == SOCK_STREAM)
+ hints->ai_protocol = IPPROTO_TCP;
+ }
+
+ /* Set the socktype if it isn't set. */
+ if (!hints->ai_socktype && hints->ai_protocol) {
+ if (hints->ai_protocol == IPPROTO_UDP)
+ hints->ai_socktype = SOCK_DGRAM;
+ else if (hints->ai_protocol == IPPROTO_TCP)
+ hints->ai_socktype = SOCK_STREAM;
+#ifdef IPPROTO_SCTP
+ else if (hints->ai_protocol == IPPROTO_SCTP)
+ hints->ai_socktype = SOCK_STREAM;
+#endif
+ }
+}
+
+#if AF_UNSPEC != PF_UNSPEC
+#error "I cannot build on a system where AF_UNSPEC != PF_UNSPEC"
+#endif
+
+/** Implements the part of looking up hosts by name that's common to both
+ * the blocking and nonblocking resolver:
+ * - Adjust 'hints' to have a reasonable socktype and protocol.
+ * - Look up the port based on 'servname', and store it in *portnum,
+ * - Handle the nodename==NULL case
+ * - Handle some invalid arguments cases.
+ * - Handle the cases where nodename is an IPv4 or IPv6 address.
+ *
+ * If we need the resolver to look up the hostname, we return
+ * EVUTIL_EAI_NEED_RESOLVE. Otherwise, we can completely implement
+ * getaddrinfo: we return 0 or an appropriate EVUTIL_EAI_* error, and
+ * set *res as getaddrinfo would.
+ */
+int
+evutil_getaddrinfo_common_(const char *nodename, const char *servname,
+ struct evutil_addrinfo *hints, struct evutil_addrinfo **res, int *portnum)
+{
+ int port = 0;
+ const char *pname;
+
+ if (nodename == NULL && servname == NULL)
+ return EVUTIL_EAI_NONAME;
+
+ /* We only understand 3 families */
+ if (hints->ai_family != PF_UNSPEC && hints->ai_family != PF_INET &&
+ hints->ai_family != PF_INET6)
+ return EVUTIL_EAI_FAMILY;
+
+ evutil_getaddrinfo_infer_protocols(hints);
+
+ /* Look up the port number and protocol, if possible. */
+ pname = evutil_unparse_protoname(hints->ai_protocol);
+ if (servname) {
+ /* XXXX We could look at the protocol we got back from
+ * getservbyname, but it doesn't seem too useful. */
+ port = evutil_parse_servname(servname, pname, hints);
+ if (port < 0) {
+ return EVUTIL_EAI_NONAME;
+ }
+ }
+
+ /* If we have no node name, then we're supposed to bind to 'any' and
+ * connect to localhost. */
+ if (nodename == NULL) {
+ struct evutil_addrinfo *res4=NULL, *res6=NULL;
+ if (hints->ai_family != PF_INET) { /* INET6 or UNSPEC. */
+ struct sockaddr_in6 sin6;
+ memset(&sin6, 0, sizeof(sin6));
+ sin6.sin6_family = AF_INET6;
+ sin6.sin6_port = htons(port);
+ if (hints->ai_flags & EVUTIL_AI_PASSIVE) {
+ /* Bind to :: */
+ } else {
+ /* connect to ::1 */
+ sin6.sin6_addr.s6_addr[15] = 1;
+ }
+ res6 = evutil_new_addrinfo_((struct sockaddr*)&sin6,
+ sizeof(sin6), hints);
+ if (!res6)
+ return EVUTIL_EAI_MEMORY;
+ }
+
+ if (hints->ai_family != PF_INET6) { /* INET or UNSPEC */
+ struct sockaddr_in sin;
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_port = htons(port);
+ if (hints->ai_flags & EVUTIL_AI_PASSIVE) {
+ /* Bind to 0.0.0.0 */
+ } else {
+ /* connect to 127.0.0.1 */
+ sin.sin_addr.s_addr = htonl(0x7f000001);
+ }
+ res4 = evutil_new_addrinfo_((struct sockaddr*)&sin,
+ sizeof(sin), hints);
+ if (!res4) {
+ if (res6)
+ evutil_freeaddrinfo(res6);
+ return EVUTIL_EAI_MEMORY;
+ }
+ }
+ *res = evutil_addrinfo_append_(res4, res6);
+ return 0;
+ }
+
+ /* If we can, we should try to parse the hostname without resolving
+ * it. */
+ /* Try ipv6. */
+ if (hints->ai_family == PF_INET6 || hints->ai_family == PF_UNSPEC) {
+ struct sockaddr_in6 sin6;
+ memset(&sin6, 0, sizeof(sin6));
+ if (1==evutil_inet_pton(AF_INET6, nodename, &sin6.sin6_addr)) {
+ /* Got an ipv6 address. */
+ sin6.sin6_family = AF_INET6;
+ sin6.sin6_port = htons(port);
+ *res = evutil_new_addrinfo_((struct sockaddr*)&sin6,
+ sizeof(sin6), hints);
+ if (!*res)
+ return EVUTIL_EAI_MEMORY;
+ return 0;
+ }
+ }
+
+ /* Try ipv4. */
+ if (hints->ai_family == PF_INET || hints->ai_family == PF_UNSPEC) {
+ struct sockaddr_in sin;
+ memset(&sin, 0, sizeof(sin));
+ if (1==evutil_inet_pton(AF_INET, nodename, &sin.sin_addr)) {
+ /* Got an ipv6 address. */
+ sin.sin_family = AF_INET;
+ sin.sin_port = htons(port);
+ *res = evutil_new_addrinfo_((struct sockaddr*)&sin,
+ sizeof(sin), hints);
+ if (!*res)
+ return EVUTIL_EAI_MEMORY;
+ return 0;
+ }
+ }
+
+
+ /* If we have reached this point, we definitely need to do a DNS
+ * lookup. */
+ if ((hints->ai_flags & EVUTIL_AI_NUMERICHOST)) {
+ /* If we're not allowed to do one, then say so. */
+ return EVUTIL_EAI_NONAME;
+ }
+ *portnum = port;
+ return EVUTIL_EAI_NEED_RESOLVE;
+}
+
+#ifdef EVENT__HAVE_GETADDRINFO
+#define USE_NATIVE_GETADDRINFO
+#endif
+
+#ifdef USE_NATIVE_GETADDRINFO
+/* A mask of all the flags that we declare, so we can clear them before calling
+ * the native getaddrinfo */
+static const unsigned int ALL_NONNATIVE_AI_FLAGS =
+#ifndef AI_PASSIVE
+ EVUTIL_AI_PASSIVE |
+#endif
+#ifndef AI_CANONNAME
+ EVUTIL_AI_CANONNAME |
+#endif
+#ifndef AI_NUMERICHOST
+ EVUTIL_AI_NUMERICHOST |
+#endif
+#ifndef AI_NUMERICSERV
+ EVUTIL_AI_NUMERICSERV |
+#endif
+#ifndef AI_ADDRCONFIG
+ EVUTIL_AI_ADDRCONFIG |
+#endif
+#ifndef AI_ALL
+ EVUTIL_AI_ALL |
+#endif
+#ifndef AI_V4MAPPED
+ EVUTIL_AI_V4MAPPED |
+#endif
+ EVUTIL_AI_LIBEVENT_ALLOCATED;
+
+static const unsigned int ALL_NATIVE_AI_FLAGS =
+#ifdef AI_PASSIVE
+ AI_PASSIVE |
+#endif
+#ifdef AI_CANONNAME
+ AI_CANONNAME |
+#endif
+#ifdef AI_NUMERICHOST
+ AI_NUMERICHOST |
+#endif
+#ifdef AI_NUMERICSERV
+ AI_NUMERICSERV |
+#endif
+#ifdef AI_ADDRCONFIG
+ AI_ADDRCONFIG |
+#endif
+#ifdef AI_ALL
+ AI_ALL |
+#endif
+#ifdef AI_V4MAPPED
+ AI_V4MAPPED |
+#endif
+ 0;
+#endif
+
+#ifndef USE_NATIVE_GETADDRINFO
+/* Helper for systems with no getaddrinfo(): make one or more addrinfos out of
+ * a struct hostent.
+ */
+static struct evutil_addrinfo *
+addrinfo_from_hostent(const struct hostent *ent,
+ int port, const struct evutil_addrinfo *hints)
+{
+ int i;
+ struct sockaddr_in sin;
+ struct sockaddr_in6 sin6;
+ struct sockaddr *sa;
+ int socklen;
+ struct evutil_addrinfo *res=NULL, *ai;
+ void *addrp;
+
+ if (ent->h_addrtype == PF_INET) {
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_port = htons(port);
+ sa = (struct sockaddr *)&sin;
+ socklen = sizeof(struct sockaddr_in);
+ addrp = &sin.sin_addr;
+ if (ent->h_length != sizeof(sin.sin_addr)) {
+ event_warnx("Weird h_length from gethostbyname");
+ return NULL;
+ }
+ } else if (ent->h_addrtype == PF_INET6) {
+ memset(&sin6, 0, sizeof(sin6));
+ sin6.sin6_family = AF_INET6;
+ sin6.sin6_port = htons(port);
+ sa = (struct sockaddr *)&sin6;
+ socklen = sizeof(struct sockaddr_in6);
+ addrp = &sin6.sin6_addr;
+ if (ent->h_length != sizeof(sin6.sin6_addr)) {
+ event_warnx("Weird h_length from gethostbyname");
+ return NULL;
+ }
+ } else
+ return NULL;
+
+ for (i = 0; ent->h_addr_list[i]; ++i) {
+ memcpy(addrp, ent->h_addr_list[i], ent->h_length);
+ ai = evutil_new_addrinfo_(sa, socklen, hints);
+ if (!ai) {
+ evutil_freeaddrinfo(res);
+ return NULL;
+ }
+ res = evutil_addrinfo_append_(res, ai);
+ }
+
+ if (res && ((hints->ai_flags & EVUTIL_AI_CANONNAME) && ent->h_name)) {
+ res->ai_canonname = mm_strdup(ent->h_name);
+ if (res->ai_canonname == NULL) {
+ evutil_freeaddrinfo(res);
+ return NULL;
+ }
+ }
+
+ return res;
+}
+#endif
+
+/* If the EVUTIL_AI_ADDRCONFIG flag is set on hints->ai_flags, and
+ * hints->ai_family is PF_UNSPEC, then revise the value of hints->ai_family so
+ * that we'll only get addresses we could maybe connect to.
+ */
+void
+evutil_adjust_hints_for_addrconfig_(struct evutil_addrinfo *hints)
+{
+ if (!(hints->ai_flags & EVUTIL_AI_ADDRCONFIG))
+ return;
+ if (hints->ai_family != PF_UNSPEC)
+ return;
+ if (!have_checked_interfaces)
+ evutil_check_interfaces(0);
+ if (had_ipv4_address && !had_ipv6_address) {
+ hints->ai_family = PF_INET;
+ } else if (!had_ipv4_address && had_ipv6_address) {
+ hints->ai_family = PF_INET6;
+ }
+}
+
+#ifdef USE_NATIVE_GETADDRINFO
+static int need_numeric_port_hack_=0;
+static int need_socktype_protocol_hack_=0;
+static int tested_for_getaddrinfo_hacks=0;
+
+/* Some older BSDs (like OpenBSD up to 4.6) used to believe that
+ giving a numeric port without giving an ai_socktype was verboten.
+ We test for this so we can apply an appropriate workaround. If it
+ turns out that the bug is present, then:
+
+ - If nodename==NULL and servname is numeric, we build an answer
+ ourselves using evutil_getaddrinfo_common_().
+
+ - If nodename!=NULL and servname is numeric, then we set
+ servname=NULL when calling getaddrinfo, and post-process the
+ result to set the ports on it.
+
+ We test for this bug at runtime, since otherwise we can't have the
+ same binary run on multiple BSD versions.
+
+ - Some versions of Solaris believe that it's nice to leave to protocol
+ field set to 0. We test for this so we can apply an appropriate
+ workaround.
+*/
+static void
+test_for_getaddrinfo_hacks(void)
+{
+ int r, r2;
+ struct evutil_addrinfo *ai=NULL, *ai2=NULL;
+ struct evutil_addrinfo hints;
+
+ memset(&hints,0,sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_flags =
+#ifdef AI_NUMERICHOST
+ AI_NUMERICHOST |
+#endif
+#ifdef AI_NUMERICSERV
+ AI_NUMERICSERV |
+#endif
+ 0;
+ r = getaddrinfo("1.2.3.4", "80", &hints, &ai);
+ hints.ai_socktype = SOCK_STREAM;
+ r2 = getaddrinfo("1.2.3.4", "80", &hints, &ai2);
+ if (r2 == 0 && r != 0) {
+ need_numeric_port_hack_=1;
+ }
+ if (ai2 && ai2->ai_protocol == 0) {
+ need_socktype_protocol_hack_=1;
+ }
+
+ if (ai)
+ freeaddrinfo(ai);
+ if (ai2)
+ freeaddrinfo(ai2);
+ tested_for_getaddrinfo_hacks=1;
+}
+
+static inline int
+need_numeric_port_hack(void)
+{
+ if (!tested_for_getaddrinfo_hacks)
+ test_for_getaddrinfo_hacks();
+ return need_numeric_port_hack_;
+}
+
+static inline int
+need_socktype_protocol_hack(void)
+{
+ if (!tested_for_getaddrinfo_hacks)
+ test_for_getaddrinfo_hacks();
+ return need_socktype_protocol_hack_;
+}
+
+static void
+apply_numeric_port_hack(int port, struct evutil_addrinfo **ai)
+{
+ /* Now we run through the list and set the ports on all of the
+ * results where ports would make sense. */
+ for ( ; *ai; ai = &(*ai)->ai_next) {
+ struct sockaddr *sa = (*ai)->ai_addr;
+ if (sa && sa->sa_family == AF_INET) {
+ struct sockaddr_in *sin = (struct sockaddr_in*)sa;
+ sin->sin_port = htons(port);
+ } else if (sa && sa->sa_family == AF_INET6) {
+ struct sockaddr_in6 *sin6 = (struct sockaddr_in6*)sa;
+ sin6->sin6_port = htons(port);
+ } else {
+ /* A numeric port makes no sense here; remove this one
+ * from the list. */
+ struct evutil_addrinfo *victim = *ai;
+ *ai = victim->ai_next;
+ victim->ai_next = NULL;
+ freeaddrinfo(victim);
+ }
+ }
+}
+
+static int
+apply_socktype_protocol_hack(struct evutil_addrinfo *ai)
+{
+ struct evutil_addrinfo *ai_new;
+ for (; ai; ai = ai->ai_next) {
+ evutil_getaddrinfo_infer_protocols(ai);
+ if (ai->ai_socktype || ai->ai_protocol)
+ continue;
+ ai_new = mm_malloc(sizeof(*ai_new));
+ if (!ai_new)
+ return -1;
+ memcpy(ai_new, ai, sizeof(*ai_new));
+ ai->ai_socktype = SOCK_STREAM;
+ ai->ai_protocol = IPPROTO_TCP;
+ ai_new->ai_socktype = SOCK_DGRAM;
+ ai_new->ai_protocol = IPPROTO_UDP;
+
+ ai_new->ai_next = ai->ai_next;
+ ai->ai_next = ai_new;
+ }
+ return 0;
+}
+#endif
+
+int
+evutil_getaddrinfo(const char *nodename, const char *servname,
+ const struct evutil_addrinfo *hints_in, struct evutil_addrinfo **res)
+{
+#ifdef USE_NATIVE_GETADDRINFO
+ struct evutil_addrinfo hints;
+ int portnum=-1, need_np_hack, err;
+
+ if (hints_in) {
+ memcpy(&hints, hints_in, sizeof(hints));
+ } else {
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ }
+
+#ifndef AI_ADDRCONFIG
+ /* Not every system has AI_ADDRCONFIG, so fake it. */
+ if (hints.ai_family == PF_UNSPEC &&
+ (hints.ai_flags & EVUTIL_AI_ADDRCONFIG)) {
+ evutil_adjust_hints_for_addrconfig_(&hints);
+ }
+#endif
+
+#ifndef AI_NUMERICSERV
+ /* Not every system has AI_NUMERICSERV, so fake it. */
+ if (hints.ai_flags & EVUTIL_AI_NUMERICSERV) {
+ if (servname && parse_numeric_servname(servname)<0)
+ return EVUTIL_EAI_NONAME;
+ }
+#endif
+
+ /* Enough operating systems handle enough common non-resolve
+ * cases here weirdly enough that we are better off just
+ * overriding them. For example:
+ *
+ * - Windows doesn't like to infer the protocol from the
+ * socket type, or fill in socket or protocol types much at
+ * all. It also seems to do its own broken implicit
+ * always-on version of AI_ADDRCONFIG that keeps it from
+ * ever resolving even a literal IPv6 address when
+ * ai_addrtype is PF_UNSPEC.
+ */
+#ifdef _WIN32
+ {
+ int tmp_port;
+ err = evutil_getaddrinfo_common_(nodename,servname,&hints,
+ res, &tmp_port);
+ if (err == 0 ||
+ err == EVUTIL_EAI_MEMORY ||
+ err == EVUTIL_EAI_NONAME)
+ return err;
+ /* If we make it here, the system getaddrinfo can
+ * have a crack at it. */
+ }
+#endif
+
+ /* See documentation for need_numeric_port_hack above.*/
+ need_np_hack = need_numeric_port_hack() && servname && !hints.ai_socktype
+ && ((portnum=parse_numeric_servname(servname)) >= 0);
+ if (need_np_hack) {
+ if (!nodename)
+ return evutil_getaddrinfo_common_(
+ NULL,servname,&hints, res, &portnum);
+ servname = NULL;
+ }
+
+ if (need_socktype_protocol_hack()) {
+ evutil_getaddrinfo_infer_protocols(&hints);
+ }
+
+ /* Make sure that we didn't actually steal any AI_FLAGS values that
+ * the system is using. (This is a constant expression, and should ge
+ * optimized out.)
+ *
+ * XXXX Turn this into a compile-time failure rather than a run-time
+ * failure.
+ */
+ EVUTIL_ASSERT((ALL_NONNATIVE_AI_FLAGS & ALL_NATIVE_AI_FLAGS) == 0);
+
+ /* Clear any flags that only libevent understands. */
+ hints.ai_flags &= ~ALL_NONNATIVE_AI_FLAGS;
+
+ err = getaddrinfo(nodename, servname, &hints, res);
+ if (need_np_hack)
+ apply_numeric_port_hack(portnum, res);
+
+ if (need_socktype_protocol_hack()) {
+ if (apply_socktype_protocol_hack(*res) < 0) {
+ evutil_freeaddrinfo(*res);
+ *res = NULL;
+ return EVUTIL_EAI_MEMORY;
+ }
+ }
+ return err;
+#else
+ int port=0, err;
+ struct hostent *ent = NULL;
+ struct evutil_addrinfo hints;
+
+ if (hints_in) {
+ memcpy(&hints, hints_in, sizeof(hints));
+ } else {
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ }
+
+ evutil_adjust_hints_for_addrconfig_(&hints);
+
+ err = evutil_getaddrinfo_common_(nodename, servname, &hints, res, &port);
+ if (err != EVUTIL_EAI_NEED_RESOLVE) {
+ /* We either succeeded or failed. No need to continue */
+ return err;
+ }
+
+ err = 0;
+ /* Use any of the various gethostbyname_r variants as available. */
+ {
+#ifdef EVENT__HAVE_GETHOSTBYNAME_R_6_ARG
+ /* This one is what glibc provides. */
+ char buf[2048];
+ struct hostent hostent;
+ int r;
+ r = gethostbyname_r(nodename, &hostent, buf, sizeof(buf), &ent,
+ &err);
+#elif defined(EVENT__HAVE_GETHOSTBYNAME_R_5_ARG)
+ char buf[2048];
+ struct hostent hostent;
+ ent = gethostbyname_r(nodename, &hostent, buf, sizeof(buf),
+ &err);
+#elif defined(EVENT__HAVE_GETHOSTBYNAME_R_3_ARG)
+ struct hostent_data data;
+ struct hostent hostent;
+ memset(&data, 0, sizeof(data));
+ err = gethostbyname_r(nodename, &hostent, &data);
+ ent = err ? NULL : &hostent;
+#else
+ /* fall back to gethostbyname. */
+ /* XXXX This needs a lock everywhere but Windows. */
+ ent = gethostbyname(nodename);
+#ifdef _WIN32
+ err = WSAGetLastError();
+#else
+ err = h_errno;
+#endif
+#endif
+
+ /* Now we have either ent or err set. */
+ if (!ent) {
+ /* XXX is this right for windows ? */
+ switch (err) {
+ case TRY_AGAIN:
+ return EVUTIL_EAI_AGAIN;
+ case NO_RECOVERY:
+ default:
+ return EVUTIL_EAI_FAIL;
+ case HOST_NOT_FOUND:
+ return EVUTIL_EAI_NONAME;
+ case NO_ADDRESS:
+#if NO_DATA != NO_ADDRESS
+ case NO_DATA:
+#endif
+ return EVUTIL_EAI_NODATA;
+ }
+ }
+
+ if (ent->h_addrtype != hints.ai_family &&
+ hints.ai_family != PF_UNSPEC) {
+ /* This wasn't the type we were hoping for. Too bad
+ * we never had a chance to ask gethostbyname for what
+ * we wanted. */
+ return EVUTIL_EAI_NONAME;
+ }
+
+ /* Make sure we got _some_ answers. */
+ if (ent->h_length == 0)
+ return EVUTIL_EAI_NODATA;
+
+ /* If we got an address type we don't know how to make a
+ sockaddr for, give up. */
+ if (ent->h_addrtype != PF_INET && ent->h_addrtype != PF_INET6)
+ return EVUTIL_EAI_FAMILY;
+
+ *res = addrinfo_from_hostent(ent, port, &hints);
+ if (! *res)
+ return EVUTIL_EAI_MEMORY;
+ }
+
+ return 0;
+#endif
+}
+
+void
+evutil_freeaddrinfo(struct evutil_addrinfo *ai)
+{
+#ifdef EVENT__HAVE_GETADDRINFO
+ if (!(ai->ai_flags & EVUTIL_AI_LIBEVENT_ALLOCATED)) {
+ freeaddrinfo(ai);
+ return;
+ }
+#endif
+ while (ai) {
+ struct evutil_addrinfo *next = ai->ai_next;
+ if (ai->ai_canonname)
+ mm_free(ai->ai_canonname);
+ mm_free(ai);
+ ai = next;
+ }
+}
+
+static evdns_getaddrinfo_fn evdns_getaddrinfo_impl = NULL;
+
+void
+evutil_set_evdns_getaddrinfo_fn_(evdns_getaddrinfo_fn fn)
+{
+ if (!evdns_getaddrinfo_impl)
+ evdns_getaddrinfo_impl = fn;
+}
+
+/* Internal helper function: act like evdns_getaddrinfo if dns_base is set;
+ * otherwise do a blocking resolve and pass the result to the callback in the
+ * way that evdns_getaddrinfo would.
+ */
+int
+evutil_getaddrinfo_async_(struct evdns_base *dns_base,
+ const char *nodename, const char *servname,
+ const struct evutil_addrinfo *hints_in,
+ void (*cb)(int, struct evutil_addrinfo *, void *), void *arg)
+{
+ if (dns_base && evdns_getaddrinfo_impl) {
+ evdns_getaddrinfo_impl(
+ dns_base, nodename, servname, hints_in, cb, arg);
+ } else {
+ struct evutil_addrinfo *ai=NULL;
+ int err;
+ err = evutil_getaddrinfo(nodename, servname, hints_in, &ai);
+ cb(err, ai, arg);
+ }
+ return 0;
+}
+
+const char *
+evutil_gai_strerror(int err)
+{
+ /* As a sneaky side-benefit, this case statement will get most
+ * compilers to tell us if any of the error codes we defined
+ * conflict with the platform's native error codes. */
+ switch (err) {
+ case EVUTIL_EAI_CANCEL:
+ return "Request canceled";
+ case 0:
+ return "No error";
+
+ case EVUTIL_EAI_ADDRFAMILY:
+ return "address family for nodename not supported";
+ case EVUTIL_EAI_AGAIN:
+ return "temporary failure in name resolution";
+ case EVUTIL_EAI_BADFLAGS:
+ return "invalid value for ai_flags";
+ case EVUTIL_EAI_FAIL:
+ return "non-recoverable failure in name resolution";
+ case EVUTIL_EAI_FAMILY:
+ return "ai_family not supported";
+ case EVUTIL_EAI_MEMORY:
+ return "memory allocation failure";
+ case EVUTIL_EAI_NODATA:
+ return "no address associated with nodename";
+ case EVUTIL_EAI_NONAME:
+ return "nodename nor servname provided, or not known";
+ case EVUTIL_EAI_SERVICE:
+ return "servname not supported for ai_socktype";
+ case EVUTIL_EAI_SOCKTYPE:
+ return "ai_socktype not supported";
+ case EVUTIL_EAI_SYSTEM:
+ return "system error";
+ default:
+#if defined(USE_NATIVE_GETADDRINFO) && defined(_WIN32)
+ return gai_strerrorA(err);
+#elif defined(USE_NATIVE_GETADDRINFO)
+ return gai_strerror(err);
+#else
+ return "Unknown error code";
+#endif
+ }
+}
+
+#ifdef _WIN32
+/* destructively remove a trailing line terminator from s */
+static void
+chomp (char *s)
+{
+ size_t len;
+ if (s && (len = strlen (s)) > 0 && s[len - 1] == '\n') {
+ s[--len] = 0;
+ if (len > 0 && s[len - 1] == '\r')
+ s[--len] = 0;
+ }
+}
+
+/* FormatMessage returns allocated strings, but evutil_socket_error_to_string
+ * is supposed to return a string which is good indefinitely without having
+ * to be freed. To make this work without leaking memory, we cache the
+ * string the first time FormatMessage is called on a particular error
+ * code, and then return the cached string on subsequent calls with the
+ * same code. The strings aren't freed until libevent_global_shutdown
+ * (or never). We use a linked list to cache the errors, because we
+ * only expect there to be a few dozen, and that should be fast enough.
+ */
+
+struct cached_sock_errs_entry {
+ HT_ENTRY(cached_sock_errs_entry) node;
+ DWORD code;
+ char *msg; /* allocated with LocalAlloc; free with LocalFree */
+};
+
+static inline unsigned
+hash_cached_sock_errs(const struct cached_sock_errs_entry *e)
+{
+ /* Use Murmur3's 32-bit finalizer as an integer hash function */
+ DWORD h = e->code;
+ h ^= h >> 16;
+ h *= 0x85ebca6b;
+ h ^= h >> 13;
+ h *= 0xc2b2ae35;
+ h ^= h >> 16;
+ return h;
+}
+
+static inline int
+eq_cached_sock_errs(const struct cached_sock_errs_entry *a,
+ const struct cached_sock_errs_entry *b)
+{
+ return a->code == b->code;
+}
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+static void *windows_socket_errors_lock_ = NULL;
+#endif
+
+static HT_HEAD(cached_sock_errs_map, cached_sock_errs_entry)
+ windows_socket_errors = HT_INITIALIZER();
+
+HT_PROTOTYPE(cached_sock_errs_map,
+ cached_sock_errs_entry,
+ node,
+ hash_cached_sock_errs,
+ eq_cached_sock_errs);
+
+HT_GENERATE(cached_sock_errs_map,
+ cached_sock_errs_entry,
+ node,
+ hash_cached_sock_errs,
+ eq_cached_sock_errs,
+ 0.5,
+ mm_malloc,
+ mm_realloc,
+ mm_free);
+
+/** Equivalent to strerror, but for windows socket errors. */
+const char *
+evutil_socket_error_to_string(int errcode)
+{
+ struct cached_sock_errs_entry *errs, *newerr, find;
+ char *msg = NULL;
+
+ EVLOCK_LOCK(windows_socket_errors_lock_, 0);
+
+ find.code = errcode;
+ errs = HT_FIND(cached_sock_errs_map, &windows_socket_errors, &find);
+ if (errs) {
+ msg = errs->msg;
+ goto done;
+ }
+
+ if (0 != FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS |
+ FORMAT_MESSAGE_ALLOCATE_BUFFER,
+ NULL, errcode, 0, (char *)&msg, 0, NULL))
+ chomp (msg); /* because message has trailing newline */
+ else {
+ size_t len = 50;
+ /* use LocalAlloc because FormatMessage does */
+ msg = LocalAlloc(LMEM_FIXED, len);
+ if (!msg) {
+ msg = (char *)"LocalAlloc failed during Winsock error";
+ goto done;
+ }
+ evutil_snprintf(msg, len, "winsock error 0x%08x", errcode);
+ }
+
+ newerr = (struct cached_sock_errs_entry *)
+ mm_malloc(sizeof (struct cached_sock_errs_entry));
+
+ if (!newerr) {
+ LocalFree(msg);
+ msg = (char *)"malloc failed during Winsock error";
+ goto done;
+ }
+
+ newerr->code = errcode;
+ newerr->msg = msg;
+ HT_INSERT(cached_sock_errs_map, &windows_socket_errors, newerr);
+
+ done:
+ EVLOCK_UNLOCK(windows_socket_errors_lock_, 0);
+
+ return msg;
+}
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+int
+evutil_global_setup_locks_(const int enable_locks)
+{
+ EVTHREAD_SETUP_GLOBAL_LOCK(windows_socket_errors_lock_, 0);
+ return 0;
+}
+#endif
+
+static void
+evutil_free_sock_err_globals(void)
+{
+ struct cached_sock_errs_entry **errs, *tofree;
+
+ for (errs = HT_START(cached_sock_errs_map, &windows_socket_errors)
+ ; errs; ) {
+ tofree = *errs;
+ errs = HT_NEXT_RMV(cached_sock_errs_map,
+ &windows_socket_errors,
+ errs);
+ LocalFree(tofree->msg);
+ mm_free(tofree);
+ }
+
+ HT_CLEAR(cached_sock_errs_map, &windows_socket_errors);
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ if (windows_socket_errors_lock_ != NULL) {
+ EVTHREAD_FREE_LOCK(windows_socket_errors_lock_, 0);
+ windows_socket_errors_lock_ = NULL;
+ }
+#endif
+}
+
+#else
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+int
+evutil_global_setup_locks_(const int enable_locks)
+{
+ return 0;
+}
+#endif
+
+static void
+evutil_free_sock_err_globals(void)
+{
+}
+
+#endif
+
+int
+evutil_snprintf(char *buf, size_t buflen, const char *format, ...)
+{
+ int r;
+ va_list ap;
+ va_start(ap, format);
+ r = evutil_vsnprintf(buf, buflen, format, ap);
+ va_end(ap);
+ return r;
+}
+
+int
+evutil_vsnprintf(char *buf, size_t buflen, const char *format, va_list ap)
+{
+ int r;
+ if (!buflen)
+ return 0;
+#if defined(_MSC_VER) || defined(_WIN32)
+ r = _vsnprintf(buf, buflen, format, ap);
+ if (r < 0)
+ r = _vscprintf(format, ap);
+#elif defined(sgi)
+ /* Make sure we always use the correct vsnprintf on IRIX */
+ extern int _xpg5_vsnprintf(char * __restrict,
+ __SGI_LIBC_NAMESPACE_QUALIFIER size_t,
+ const char * __restrict, /* va_list */ char *);
+
+ r = _xpg5_vsnprintf(buf, buflen, format, ap);
+#else
+ r = vsnprintf(buf, buflen, format, ap);
+#endif
+ buf[buflen-1] = '\0';
+ return r;
+}
+
+#define USE_INTERNAL_NTOP
+#define USE_INTERNAL_PTON
+
+const char *
+evutil_inet_ntop(int af, const void *src, char *dst, size_t len)
+{
+#if defined(EVENT__HAVE_INET_NTOP) && !defined(USE_INTERNAL_NTOP)
+ return inet_ntop(af, src, dst, len);
+#else
+ if (af == AF_INET) {
+ const struct in_addr *in = src;
+ const ev_uint32_t a = ntohl(in->s_addr);
+ int r;
+ r = evutil_snprintf(dst, len, "%d.%d.%d.%d",
+ (int)(ev_uint8_t)((a>>24)&0xff),
+ (int)(ev_uint8_t)((a>>16)&0xff),
+ (int)(ev_uint8_t)((a>>8 )&0xff),
+ (int)(ev_uint8_t)((a )&0xff));
+ if (r<0||(size_t)r>=len)
+ return NULL;
+ else
+ return dst;
+#ifdef AF_INET6
+ } else if (af == AF_INET6) {
+ const struct in6_addr *addr = src;
+ char buf[64], *cp;
+ int longestGapLen = 0, longestGapPos = -1, i,
+ curGapPos = -1, curGapLen = 0;
+ ev_uint16_t words[8];
+ for (i = 0; i < 8; ++i) {
+ words[i] =
+ (((ev_uint16_t)addr->s6_addr[2*i])<<8) + addr->s6_addr[2*i+1];
+ }
+ if (words[0] == 0 && words[1] == 0 && words[2] == 0 && words[3] == 0 &&
+ words[4] == 0 && ((words[5] == 0 && words[6] && words[7]) ||
+ (words[5] == 0xffff))) {
+ /* This is an IPv4 address. */
+ if (words[5] == 0) {
+ evutil_snprintf(buf, sizeof(buf), "::%d.%d.%d.%d",
+ addr->s6_addr[12], addr->s6_addr[13],
+ addr->s6_addr[14], addr->s6_addr[15]);
+ } else {
+ evutil_snprintf(buf, sizeof(buf), "::%x:%d.%d.%d.%d", words[5],
+ addr->s6_addr[12], addr->s6_addr[13],
+ addr->s6_addr[14], addr->s6_addr[15]);
+ }
+ if (strlen(buf) > len)
+ return NULL;
+ strlcpy(dst, buf, len);
+ return dst;
+ }
+ i = 0;
+ while (i < 8) {
+ if (words[i] == 0) {
+ curGapPos = i++;
+ curGapLen = 1;
+ while (i<8 && words[i] == 0) {
+ ++i; ++curGapLen;
+ }
+ if (curGapLen > longestGapLen) {
+ longestGapPos = curGapPos;
+ longestGapLen = curGapLen;
+ }
+ } else {
+ ++i;
+ }
+ }
+ if (longestGapLen<=1)
+ longestGapPos = -1;
+
+ cp = buf;
+ for (i = 0; i < 8; ++i) {
+ if (words[i] == 0 && longestGapPos == i) {
+ if (i == 0)
+ *cp++ = ':';
+ *cp++ = ':';
+ while (i < 8 && words[i] == 0)
+ ++i;
+ --i; /* to compensate for loop increment. */
+ } else {
+ evutil_snprintf(cp,
+ sizeof(buf)-(cp-buf), "%x", (unsigned)words[i]);
+ cp += strlen(cp);
+ if (i != 7)
+ *cp++ = ':';
+ }
+ }
+ *cp = '\0';
+ if (strlen(buf) > len)
+ return NULL;
+ strlcpy(dst, buf, len);
+ return dst;
+#endif
+ } else {
+ return NULL;
+ }
+#endif
+}
+
+int
+evutil_inet_pton(int af, const char *src, void *dst)
+{
+#if defined(EVENT__HAVE_INET_PTON) && !defined(USE_INTERNAL_PTON)
+ return inet_pton(af, src, dst);
+#else
+ if (af == AF_INET) {
+ unsigned a,b,c,d;
+ char more;
+ struct in_addr *addr = dst;
+ if (sscanf(src, "%u.%u.%u.%u%c", &a,&b,&c,&d,&more) != 4)
+ return 0;
+ if (a > 255) return 0;
+ if (b > 255) return 0;
+ if (c > 255) return 0;
+ if (d > 255) return 0;
+ addr->s_addr = htonl((a<<24) | (b<<16) | (c<<8) | d);
+ return 1;
+#ifdef AF_INET6
+ } else if (af == AF_INET6) {
+ struct in6_addr *out = dst;
+ ev_uint16_t words[8];
+ int gapPos = -1, i, setWords=0;
+ const char *dot = strchr(src, '.');
+ const char *eow; /* end of words. */
+ if (dot == src)
+ return 0;
+ else if (!dot)
+ eow = src+strlen(src);
+ else {
+ unsigned byte1,byte2,byte3,byte4;
+ char more;
+ for (eow = dot-1; eow >= src && EVUTIL_ISDIGIT_(*eow); --eow)
+ ;
+ ++eow;
+
+ /* We use "scanf" because some platform inet_aton()s are too lax
+ * about IPv4 addresses of the form "1.2.3" */
+ if (sscanf(eow, "%u.%u.%u.%u%c",
+ &byte1,&byte2,&byte3,&byte4,&more) != 4)
+ return 0;
+
+ if (byte1 > 255 ||
+ byte2 > 255 ||
+ byte3 > 255 ||
+ byte4 > 255)
+ return 0;
+
+ words[6] = (byte1<<8) | byte2;
+ words[7] = (byte3<<8) | byte4;
+ setWords += 2;
+ }
+
+ i = 0;
+ while (src < eow) {
+ if (i > 7)
+ return 0;
+ if (EVUTIL_ISXDIGIT_(*src)) {
+ char *next;
+ long r = strtol(src, &next, 16);
+ if (next > 4+src)
+ return 0;
+ if (next == src)
+ return 0;
+ if (r<0 || r>65536)
+ return 0;
+
+ words[i++] = (ev_uint16_t)r;
+ setWords++;
+ src = next;
+ if (*src != ':' && src != eow)
+ return 0;
+ ++src;
+ } else if (*src == ':' && i > 0 && gapPos==-1) {
+ gapPos = i;
+ ++src;
+ } else if (*src == ':' && i == 0 && src[1] == ':' && gapPos==-1) {
+ gapPos = i;
+ src += 2;
+ } else {
+ return 0;
+ }
+ }
+
+ if (setWords > 8 ||
+ (setWords == 8 && gapPos != -1) ||
+ (setWords < 8 && gapPos == -1))
+ return 0;
+
+ if (gapPos >= 0) {
+ int nToMove = setWords - (dot ? 2 : 0) - gapPos;
+ int gapLen = 8 - setWords;
+ /* assert(nToMove >= 0); */
+ if (nToMove < 0)
+ return -1; /* should be impossible */
+ memmove(&words[gapPos+gapLen], &words[gapPos],
+ sizeof(ev_uint16_t)*nToMove);
+ memset(&words[gapPos], 0, sizeof(ev_uint16_t)*gapLen);
+ }
+ for (i = 0; i < 8; ++i) {
+ out->s6_addr[2*i ] = words[i] >> 8;
+ out->s6_addr[2*i+1] = words[i] & 0xff;
+ }
+
+ return 1;
+#endif
+ } else {
+ return -1;
+ }
+#endif
+}
+
+int
+evutil_parse_sockaddr_port(const char *ip_as_string, struct sockaddr *out, int *outlen)
+{
+ int port;
+ char buf[128];
+ const char *cp, *addr_part, *port_part;
+ int is_ipv6;
+ /* recognized formats are:
+ * [ipv6]:port
+ * ipv6
+ * [ipv6]
+ * ipv4:port
+ * ipv4
+ */
+
+ cp = strchr(ip_as_string, ':');
+ if (*ip_as_string == '[') {
+ size_t len;
+ if (!(cp = strchr(ip_as_string, ']'))) {
+ return -1;
+ }
+ len = ( cp-(ip_as_string + 1) );
+ if (len > sizeof(buf)-1) {
+ return -1;
+ }
+ memcpy(buf, ip_as_string+1, len);
+ buf[len] = '\0';
+ addr_part = buf;
+ if (cp[1] == ':')
+ port_part = cp+2;
+ else
+ port_part = NULL;
+ is_ipv6 = 1;
+ } else if (cp && strchr(cp+1, ':')) {
+ is_ipv6 = 1;
+ addr_part = ip_as_string;
+ port_part = NULL;
+ } else if (cp) {
+ is_ipv6 = 0;
+ if (cp - ip_as_string > (int)sizeof(buf)-1) {
+ return -1;
+ }
+ memcpy(buf, ip_as_string, cp-ip_as_string);
+ buf[cp-ip_as_string] = '\0';
+ addr_part = buf;
+ port_part = cp+1;
+ } else {
+ addr_part = ip_as_string;
+ port_part = NULL;
+ is_ipv6 = 0;
+ }
+
+ if (port_part == NULL) {
+ port = 0;
+ } else {
+ port = atoi(port_part);
+ if (port <= 0 || port > 65535) {
+ return -1;
+ }
+ }
+
+ if (!addr_part)
+ return -1; /* Should be impossible. */
+#ifdef AF_INET6
+ if (is_ipv6)
+ {
+ struct sockaddr_in6 sin6;
+ memset(&sin6, 0, sizeof(sin6));
+#ifdef EVENT__HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN
+ sin6.sin6_len = sizeof(sin6);
+#endif
+ sin6.sin6_family = AF_INET6;
+ sin6.sin6_port = htons(port);
+ if (1 != evutil_inet_pton(AF_INET6, addr_part, &sin6.sin6_addr))
+ return -1;
+ if ((int)sizeof(sin6) > *outlen)
+ return -1;
+ memset(out, 0, *outlen);
+ memcpy(out, &sin6, sizeof(sin6));
+ *outlen = sizeof(sin6);
+ return 0;
+ }
+ else
+#endif
+ {
+ struct sockaddr_in sin;
+ memset(&sin, 0, sizeof(sin));
+#ifdef EVENT__HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
+ sin.sin_len = sizeof(sin);
+#endif
+ sin.sin_family = AF_INET;
+ sin.sin_port = htons(port);
+ if (1 != evutil_inet_pton(AF_INET, addr_part, &sin.sin_addr))
+ return -1;
+ if ((int)sizeof(sin) > *outlen)
+ return -1;
+ memset(out, 0, *outlen);
+ memcpy(out, &sin, sizeof(sin));
+ *outlen = sizeof(sin);
+ return 0;
+ }
+}
+
+const char *
+evutil_format_sockaddr_port_(const struct sockaddr *sa, char *out, size_t outlen)
+{
+ char b[128];
+ const char *res=NULL;
+ int port;
+ if (sa->sa_family == AF_INET) {
+ const struct sockaddr_in *sin = (const struct sockaddr_in*)sa;
+ res = evutil_inet_ntop(AF_INET, &sin->sin_addr,b,sizeof(b));
+ port = ntohs(sin->sin_port);
+ if (res) {
+ evutil_snprintf(out, outlen, "%s:%d", b, port);
+ return out;
+ }
+ } else if (sa->sa_family == AF_INET6) {
+ const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6*)sa;
+ res = evutil_inet_ntop(AF_INET6, &sin6->sin6_addr,b,sizeof(b));
+ port = ntohs(sin6->sin6_port);
+ if (res) {
+ evutil_snprintf(out, outlen, "[%s]:%d", b, port);
+ return out;
+ }
+ }
+
+ evutil_snprintf(out, outlen, "<addr with socktype %d>",
+ (int)sa->sa_family);
+ return out;
+}
+
+int
+evutil_sockaddr_cmp(const struct sockaddr *sa1, const struct sockaddr *sa2,
+ int include_port)
+{
+ int r;
+ if (0 != (r = (sa1->sa_family - sa2->sa_family)))
+ return r;
+
+ if (sa1->sa_family == AF_INET) {
+ const struct sockaddr_in *sin1, *sin2;
+ sin1 = (const struct sockaddr_in *)sa1;
+ sin2 = (const struct sockaddr_in *)sa2;
+ if (sin1->sin_addr.s_addr < sin2->sin_addr.s_addr)
+ return -1;
+ else if (sin1->sin_addr.s_addr > sin2->sin_addr.s_addr)
+ return 1;
+ else if (include_port &&
+ (r = ((int)sin1->sin_port - (int)sin2->sin_port)))
+ return r;
+ else
+ return 0;
+ }
+#ifdef AF_INET6
+ else if (sa1->sa_family == AF_INET6) {
+ const struct sockaddr_in6 *sin1, *sin2;
+ sin1 = (const struct sockaddr_in6 *)sa1;
+ sin2 = (const struct sockaddr_in6 *)sa2;
+ if ((r = memcmp(sin1->sin6_addr.s6_addr, sin2->sin6_addr.s6_addr, 16)))
+ return r;
+ else if (include_port &&
+ (r = ((int)sin1->sin6_port - (int)sin2->sin6_port)))
+ return r;
+ else
+ return 0;
+ }
+#endif
+ return 1;
+}
+
+/* Tables to implement ctypes-replacement EVUTIL_IS*() functions. Each table
+ * has 256 bits to look up whether a character is in some set or not. This
+ * fails on non-ASCII platforms, but so does every other place where we
+ * take a char and write it onto the network.
+ **/
+static const ev_uint32_t EVUTIL_ISALPHA_TABLE[8] =
+ { 0, 0, 0x7fffffe, 0x7fffffe, 0, 0, 0, 0 };
+static const ev_uint32_t EVUTIL_ISALNUM_TABLE[8] =
+ { 0, 0x3ff0000, 0x7fffffe, 0x7fffffe, 0, 0, 0, 0 };
+static const ev_uint32_t EVUTIL_ISSPACE_TABLE[8] = { 0x3e00, 0x1, 0, 0, 0, 0, 0, 0 };
+static const ev_uint32_t EVUTIL_ISXDIGIT_TABLE[8] =
+ { 0, 0x3ff0000, 0x7e, 0x7e, 0, 0, 0, 0 };
+static const ev_uint32_t EVUTIL_ISDIGIT_TABLE[8] = { 0, 0x3ff0000, 0, 0, 0, 0, 0, 0 };
+static const ev_uint32_t EVUTIL_ISPRINT_TABLE[8] =
+ { 0, 0xffffffff, 0xffffffff, 0x7fffffff, 0, 0, 0, 0x0 };
+static const ev_uint32_t EVUTIL_ISUPPER_TABLE[8] = { 0, 0, 0x7fffffe, 0, 0, 0, 0, 0 };
+static const ev_uint32_t EVUTIL_ISLOWER_TABLE[8] = { 0, 0, 0, 0x7fffffe, 0, 0, 0, 0 };
+/* Upper-casing and lowercasing tables to map characters to upper/lowercase
+ * equivalents. */
+static const unsigned char EVUTIL_TOUPPER_TABLE[256] = {
+ 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
+ 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,
+ 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,
+ 48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,
+ 64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,
+ 80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,
+ 96,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,
+ 80,81,82,83,84,85,86,87,88,89,90,123,124,125,126,127,
+ 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
+ 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,
+ 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
+ 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
+ 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
+ 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
+ 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
+ 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,
+};
+static const unsigned char EVUTIL_TOLOWER_TABLE[256] = {
+ 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
+ 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,
+ 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,
+ 48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,
+ 64,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,
+ 112,113,114,115,116,117,118,119,120,121,122,91,92,93,94,95,
+ 96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,
+ 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,
+ 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
+ 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,
+ 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
+ 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
+ 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
+ 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
+ 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
+ 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,
+};
+
+#define IMPL_CTYPE_FN(name) \
+ int EVUTIL_##name##_(char c) { \
+ ev_uint8_t u = c; \
+ return !!(EVUTIL_##name##_TABLE[(u >> 5) & 7] & (1 << (u & 31))); \
+ }
+IMPL_CTYPE_FN(ISALPHA)
+IMPL_CTYPE_FN(ISALNUM)
+IMPL_CTYPE_FN(ISSPACE)
+IMPL_CTYPE_FN(ISDIGIT)
+IMPL_CTYPE_FN(ISXDIGIT)
+IMPL_CTYPE_FN(ISPRINT)
+IMPL_CTYPE_FN(ISLOWER)
+IMPL_CTYPE_FN(ISUPPER)
+
+char EVUTIL_TOLOWER_(char c)
+{
+ return ((char)EVUTIL_TOLOWER_TABLE[(ev_uint8_t)c]);
+}
+char EVUTIL_TOUPPER_(char c)
+{
+ return ((char)EVUTIL_TOUPPER_TABLE[(ev_uint8_t)c]);
+}
+int
+evutil_ascii_strcasecmp(const char *s1, const char *s2)
+{
+ char c1, c2;
+ while (1) {
+ c1 = EVUTIL_TOLOWER_(*s1++);
+ c2 = EVUTIL_TOLOWER_(*s2++);
+ if (c1 < c2)
+ return -1;
+ else if (c1 > c2)
+ return 1;
+ else if (c1 == 0)
+ return 0;
+ }
+}
+int evutil_ascii_strncasecmp(const char *s1, const char *s2, size_t n)
+{
+ char c1, c2;
+ while (n--) {
+ c1 = EVUTIL_TOLOWER_(*s1++);
+ c2 = EVUTIL_TOLOWER_(*s2++);
+ if (c1 < c2)
+ return -1;
+ else if (c1 > c2)
+ return 1;
+ else if (c1 == 0)
+ return 0;
+ }
+ return 0;
+}
+
+void
+evutil_rtrim_lws_(char *str)
+{
+ char *cp;
+
+ if (str == NULL)
+ return;
+
+ if ((cp = strchr(str, '\0')) == NULL || (cp == str))
+ return;
+
+ --cp;
+
+ while (*cp == ' ' || *cp == '\t') {
+ *cp = '\0';
+ if (cp == str)
+ break;
+ --cp;
+ }
+}
+
+static int
+evutil_issetugid(void)
+{
+#ifdef EVENT__HAVE_ISSETUGID
+ return issetugid();
+#else
+
+#ifdef EVENT__HAVE_GETEUID
+ if (getuid() != geteuid())
+ return 1;
+#endif
+#ifdef EVENT__HAVE_GETEGID
+ if (getgid() != getegid())
+ return 1;
+#endif
+ return 0;
+#endif
+}
+
+const char *
+evutil_getenv_(const char *varname)
+{
+ if (evutil_issetugid())
+ return NULL;
+
+ return getenv(varname);
+}
+
+ev_uint32_t
+evutil_weakrand_seed_(struct evutil_weakrand_state *state, ev_uint32_t seed)
+{
+ if (seed == 0) {
+ struct timeval tv;
+ evutil_gettimeofday(&tv, NULL);
+ seed = (ev_uint32_t)tv.tv_sec + (ev_uint32_t)tv.tv_usec;
+#ifdef _WIN32
+ seed += (ev_uint32_t) _getpid();
+#else
+ seed += (ev_uint32_t) getpid();
+#endif
+ }
+ state->seed = seed;
+ return seed;
+}
+
+ev_int32_t
+evutil_weakrand_(struct evutil_weakrand_state *state)
+{
+ /* This RNG implementation is a linear congruential generator, with
+ * modulus 2^31, multiplier 1103515245, and addend 12345. It's also
+ * used by OpenBSD, and by Glibc's TYPE_0 RNG.
+ *
+ * The linear congruential generator is not an industrial-strength
+ * RNG! It's fast, but it can have higher-order patterns. Notably,
+ * the low bits tend to have periodicity.
+ */
+ state->seed = ((state->seed) * 1103515245 + 12345) & 0x7fffffff;
+ return (ev_int32_t)(state->seed);
+}
+
+ev_int32_t
+evutil_weakrand_range_(struct evutil_weakrand_state *state, ev_int32_t top)
+{
+ ev_int32_t divisor, result;
+
+ /* We can't just do weakrand() % top, since the low bits of the LCG
+ * are less random than the high ones. (Specifically, since the LCG
+ * modulus is 2^N, every 2^m for m<N will divide the modulus, and so
+ * therefore the low m bits of the LCG will have period 2^m.) */
+ divisor = EVUTIL_WEAKRAND_MAX / top;
+ do {
+ result = evutil_weakrand_(state) / divisor;
+ } while (result >= top);
+ return result;
+}
+
+/**
+ * Volatile pointer to memset: we use this to keep the compiler from
+ * eliminating our call to memset.
+ */
+void * (*volatile evutil_memset_volatile_)(void *, int, size_t) = memset;
+
+void
+evutil_memclear_(void *mem, size_t len)
+{
+ evutil_memset_volatile_(mem, 0, len);
+}
+
+int
+evutil_sockaddr_is_loopback_(const struct sockaddr *addr)
+{
+ static const char LOOPBACK_S6[16] =
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1";
+ if (addr->sa_family == AF_INET) {
+ struct sockaddr_in *sin = (struct sockaddr_in *)addr;
+ return (ntohl(sin->sin_addr.s_addr) & 0xff000000) == 0x7f000000;
+ } else if (addr->sa_family == AF_INET6) {
+ struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)addr;
+ return !memcmp(sin6->sin6_addr.s6_addr, LOOPBACK_S6, 16);
+ }
+ return 0;
+}
+
+int
+evutil_hex_char_to_int_(char c)
+{
+ switch(c)
+ {
+ case '0': return 0;
+ case '1': return 1;
+ case '2': return 2;
+ case '3': return 3;
+ case '4': return 4;
+ case '5': return 5;
+ case '6': return 6;
+ case '7': return 7;
+ case '8': return 8;
+ case '9': return 9;
+ case 'A': case 'a': return 10;
+ case 'B': case 'b': return 11;
+ case 'C': case 'c': return 12;
+ case 'D': case 'd': return 13;
+ case 'E': case 'e': return 14;
+ case 'F': case 'f': return 15;
+ }
+ return -1;
+}
+
+#ifdef _WIN32
+HMODULE
+evutil_load_windows_system_library_(const TCHAR *library_name)
+{
+ TCHAR path[MAX_PATH];
+ unsigned n;
+ n = GetSystemDirectory(path, MAX_PATH);
+ if (n == 0 || n + _tcslen(library_name) + 2 >= MAX_PATH)
+ return 0;
+ _tcscat(path, TEXT("\\"));
+ _tcscat(path, library_name);
+ return LoadLibrary(path);
+}
+#endif
+
+/* Internal wrapper around 'socket' to provide Linux-style support for
+ * syscall-saving methods where available.
+ *
+ * In addition to regular socket behavior, you can use a bitwise or to set the
+ * flags EVUTIL_SOCK_NONBLOCK and EVUTIL_SOCK_CLOEXEC in the 'type' argument,
+ * to make the socket nonblocking or close-on-exec with as few syscalls as
+ * possible.
+ */
+evutil_socket_t
+evutil_socket_(int domain, int type, int protocol)
+{
+ evutil_socket_t r;
+#if defined(SOCK_NONBLOCK) && defined(SOCK_CLOEXEC)
+ r = socket(domain, type, protocol);
+ if (r >= 0)
+ return r;
+ else if ((type & (SOCK_NONBLOCK|SOCK_CLOEXEC)) == 0)
+ return -1;
+#endif
+#define SOCKET_TYPE_MASK (~(EVUTIL_SOCK_NONBLOCK|EVUTIL_SOCK_CLOEXEC))
+ r = socket(domain, type & SOCKET_TYPE_MASK, protocol);
+ if (r < 0)
+ return -1;
+ if (type & EVUTIL_SOCK_NONBLOCK) {
+ if (evutil_fast_socket_nonblocking(r) < 0) {
+ evutil_closesocket(r);
+ return -1;
+ }
+ }
+ if (type & EVUTIL_SOCK_CLOEXEC) {
+ if (evutil_fast_socket_closeonexec(r) < 0) {
+ evutil_closesocket(r);
+ return -1;
+ }
+ }
+ return r;
+}
+
+/* Internal wrapper around 'accept' or 'accept4' to provide Linux-style
+ * support for syscall-saving methods where available.
+ *
+ * In addition to regular accept behavior, you can set one or more of flags
+ * EVUTIL_SOCK_NONBLOCK and EVUTIL_SOCK_CLOEXEC in the 'flags' argument, to
+ * make the socket nonblocking or close-on-exec with as few syscalls as
+ * possible.
+ */
+evutil_socket_t
+evutil_accept4_(evutil_socket_t sockfd, struct sockaddr *addr,
+ ev_socklen_t *addrlen, int flags)
+{
+ evutil_socket_t result;
+#if defined(EVENT__HAVE_ACCEPT4) && defined(SOCK_CLOEXEC) && defined(SOCK_NONBLOCK)
+ result = accept4(sockfd, addr, addrlen, flags);
+ if (result >= 0 || (errno != EINVAL && errno != ENOSYS)) {
+ /* A nonnegative result means that we succeeded, so return.
+ * Failing with EINVAL means that an option wasn't supported,
+ * and failing with ENOSYS means that the syscall wasn't
+ * there: in those cases we want to fall back. Otherwise, we
+ * got a real error, and we should return. */
+ return result;
+ }
+#endif
+ result = accept(sockfd, addr, addrlen);
+ if (result < 0)
+ return result;
+
+ if (flags & EVUTIL_SOCK_CLOEXEC) {
+ if (evutil_fast_socket_closeonexec(result) < 0) {
+ evutil_closesocket(result);
+ return -1;
+ }
+ }
+ if (flags & EVUTIL_SOCK_NONBLOCK) {
+ if (evutil_fast_socket_nonblocking(result) < 0) {
+ evutil_closesocket(result);
+ return -1;
+ }
+ }
+ return result;
+}
+
+/* Internal function: Set fd[0] and fd[1] to a pair of fds such that writes on
+ * fd[0] get read from fd[1]. Make both fds nonblocking and close-on-exec.
+ * Return 0 on success, -1 on failure.
+ */
+int
+evutil_make_internal_pipe_(evutil_socket_t fd[2])
+{
+ /*
+ Making the second socket nonblocking is a bit subtle, given that we
+ ignore any EAGAIN returns when writing to it, and you don't usally
+ do that for a nonblocking socket. But if the kernel gives us EAGAIN,
+ then there's no need to add any more data to the buffer, since
+ the main thread is already either about to wake up and drain it,
+ or woken up and in the process of draining it.
+ */
+
+#if defined(EVENT__HAVE_PIPE2)
+ if (pipe2(fd, O_NONBLOCK|O_CLOEXEC) == 0)
+ return 0;
+#endif
+#if defined(EVENT__HAVE_PIPE)
+ if (pipe(fd) == 0) {
+ if (evutil_fast_socket_nonblocking(fd[0]) < 0 ||
+ evutil_fast_socket_nonblocking(fd[1]) < 0 ||
+ evutil_fast_socket_closeonexec(fd[0]) < 0 ||
+ evutil_fast_socket_closeonexec(fd[1]) < 0) {
+ close(fd[0]);
+ close(fd[1]);
+ fd[0] = fd[1] = -1;
+ return -1;
+ }
+ return 0;
+ } else {
+ event_warn("%s: pipe", __func__);
+ }
+#endif
+
+#ifdef _WIN32
+#define LOCAL_SOCKETPAIR_AF AF_INET
+#else
+#define LOCAL_SOCKETPAIR_AF AF_UNIX
+#endif
+ if (evutil_socketpair(LOCAL_SOCKETPAIR_AF, SOCK_STREAM, 0, fd) == 0) {
+ if (evutil_fast_socket_nonblocking(fd[0]) < 0 ||
+ evutil_fast_socket_nonblocking(fd[1]) < 0 ||
+ evutil_fast_socket_closeonexec(fd[0]) < 0 ||
+ evutil_fast_socket_closeonexec(fd[1]) < 0) {
+ evutil_closesocket(fd[0]);
+ evutil_closesocket(fd[1]);
+ fd[0] = fd[1] = -1;
+ return -1;
+ }
+ return 0;
+ }
+ fd[0] = fd[1] = -1;
+ return -1;
+}
+
+/* Wrapper around eventfd on systems that provide it. Unlike the system
+ * eventfd, it always supports EVUTIL_EFD_CLOEXEC and EVUTIL_EFD_NONBLOCK as
+ * flags. Returns -1 on error or if eventfd is not supported.
+ */
+evutil_socket_t
+evutil_eventfd_(unsigned initval, int flags)
+{
+#if defined(EVENT__HAVE_EVENTFD) && defined(EVENT__HAVE_SYS_EVENTFD_H)
+ int r;
+#if defined(EFD_CLOEXEC) && defined(EFD_NONBLOCK)
+ r = eventfd(initval, flags);
+ if (r >= 0 || flags == 0)
+ return r;
+#endif
+ r = eventfd(initval, 0);
+ if (r < 0)
+ return r;
+ if (flags & EVUTIL_EFD_CLOEXEC) {
+ if (evutil_fast_socket_closeonexec(r) < 0) {
+ evutil_closesocket(r);
+ return -1;
+ }
+ }
+ if (flags & EVUTIL_EFD_NONBLOCK) {
+ if (evutil_fast_socket_nonblocking(r) < 0) {
+ evutil_closesocket(r);
+ return -1;
+ }
+ }
+ return r;
+#else
+ return -1;
+#endif
+}
+
+void
+evutil_free_globals_(void)
+{
+ evutil_free_secure_rng_globals_();
+ evutil_free_sock_err_globals();
+}
diff --git a/protocols/Telegram/tgl/libevent/evutil.obj b/protocols/Telegram/tgl/libevent/evutil.obj
new file mode 100644
index 0000000000..6beedbadef
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/evutil.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/evutil_rand.c b/protocols/Telegram/tgl/libevent/evutil_rand.c
new file mode 100644
index 0000000000..046a14b07a
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/evutil_rand.c
@@ -0,0 +1,206 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+
+/* This file has our secure PRNG code. On platforms that have arc4random(),
+ * we just use that. Otherwise, we include arc4random.c as a bunch of static
+ * functions, and wrap it lightly. We don't expose the arc4random*() APIs
+ * because A) they aren't in our namespace, and B) it's not nice to name your
+ * APIs after their implementations. We keep them in a separate file
+ * so that other people can rip it out and use it for whatever.
+ */
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#include <limits.h>
+
+#include "util-internal.h"
+#include "evthread-internal.h"
+
+#ifdef EVENT__HAVE_ARC4RANDOM
+#include <stdlib.h>
+#include <string.h>
+int
+evutil_secure_rng_set_urandom_device_file(char *fname)
+{
+ (void) fname;
+ return -1;
+}
+int
+evutil_secure_rng_init(void)
+{
+ /* call arc4random() now to force it to self-initialize */
+ (void) arc4random();
+ return 0;
+}
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+int
+evutil_secure_rng_global_setup_locks_(const int enable_locks)
+{
+ return 0;
+}
+#endif
+static void
+evutil_free_secure_rng_globals_locks(void)
+{
+}
+
+static void
+ev_arc4random_buf(void *buf, size_t n)
+{
+#if defined(EVENT__HAVE_ARC4RANDOM_BUF) && !defined(__APPLE__)
+ arc4random_buf(buf, n);
+ return;
+#else
+ unsigned char *b = buf;
+
+#if defined(EVENT__HAVE_ARC4RANDOM_BUF)
+ /* OSX 10.7 introducd arc4random_buf, so if you build your program
+ * there, you'll get surprised when older versions of OSX fail to run.
+ * To solve this, we can check whether the function pointer is set,
+ * and fall back otherwise. (OSX does this using some linker
+ * trickery.)
+ */
+ {
+ void (*tptr)(void *,size_t) =
+ (void (*)(void*,size_t))arc4random_buf;
+ if (tptr != NULL) {
+ arc4random_buf(buf, n);
+ return;
+ }
+ }
+#endif
+ /* Make sure that we start out with b at a 4-byte alignment; plenty
+ * of CPUs care about this for 32-bit access. */
+ if (n >= 4 && ((ev_uintptr_t)b) & 3) {
+ ev_uint32_t u = arc4random();
+ int n_bytes = 4 - (((ev_uintptr_t)b) & 3);
+ memcpy(b, &u, n_bytes);
+ b += n_bytes;
+ n -= n_bytes;
+ }
+ while (n >= 4) {
+ *(ev_uint32_t*)b = arc4random();
+ b += 4;
+ n -= 4;
+ }
+ if (n) {
+ ev_uint32_t u = arc4random();
+ memcpy(b, &u, n);
+ }
+#endif
+}
+
+#else /* !EVENT__HAVE_ARC4RANDOM { */
+
+#ifdef EVENT__ssize_t
+#define ssize_t EVENT__ssize_t
+#endif
+#define ARC4RANDOM_EXPORT static
+#define ARC4_LOCK_() EVLOCK_LOCK(arc4rand_lock, 0)
+#define ARC4_UNLOCK_() EVLOCK_UNLOCK(arc4rand_lock, 0)
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+static void *arc4rand_lock;
+#endif
+
+#define ARC4RANDOM_UINT32 ev_uint32_t
+#define ARC4RANDOM_NOSTIR
+#define ARC4RANDOM_NORANDOM
+#define ARC4RANDOM_NOUNIFORM
+
+#include "./arc4random.c"
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+int
+evutil_secure_rng_global_setup_locks_(const int enable_locks)
+{
+ EVTHREAD_SETUP_GLOBAL_LOCK(arc4rand_lock, 0);
+ return 0;
+}
+#endif
+
+static void
+evutil_free_secure_rng_globals_locks(void)
+{
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ if (arc4rand_lock != NULL) {
+ EVTHREAD_FREE_LOCK(arc4rand_lock, 0);
+ arc4rand_lock = NULL;
+ }
+#endif
+ return;
+}
+
+int
+evutil_secure_rng_set_urandom_device_file(char *fname)
+{
+#ifdef TRY_SEED_URANDOM
+ ARC4_LOCK_();
+ arc4random_urandom_filename = fname;
+ ARC4_UNLOCK_();
+#endif
+ return 0;
+}
+
+int
+evutil_secure_rng_init(void)
+{
+ int val;
+
+ ARC4_LOCK_();
+ if (!arc4_seeded_ok)
+ arc4_stir();
+ val = arc4_seeded_ok ? 0 : -1;
+ ARC4_UNLOCK_();
+ return val;
+}
+
+static void
+ev_arc4random_buf(void *buf, size_t n)
+{
+ arc4random_buf(buf, n);
+}
+
+#endif /* } !EVENT__HAVE_ARC4RANDOM */
+
+void
+evutil_secure_rng_get_bytes(void *buf, size_t n)
+{
+ ev_arc4random_buf(buf, n);
+}
+
+void
+evutil_secure_rng_add_bytes(const char *buf, size_t n)
+{
+ arc4random_addrandom((unsigned char*)buf,
+ n>(size_t)INT_MAX ? INT_MAX : (int)n);
+}
+
+void
+evutil_free_secure_rng_globals_(void)
+{
+ evutil_free_secure_rng_globals_locks();
+}
diff --git a/protocols/Telegram/tgl/libevent/evutil_rand.obj b/protocols/Telegram/tgl/libevent/evutil_rand.obj
new file mode 100644
index 0000000000..576e3d79a1
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/evutil_rand.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/evutil_time.c b/protocols/Telegram/tgl/libevent/evutil_time.c
new file mode 100644
index 0000000000..8f53c66b68
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/evutil_time.c
@@ -0,0 +1,538 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#endif
+
+#include <sys/types.h>
+#ifdef EVENT__HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#include <errno.h>
+#include <limits.h>
+#ifndef EVENT__HAVE_GETTIMEOFDAY
+#include <sys/timeb.h>
+#endif
+#if !defined(EVENT__HAVE_NANOSLEEP) && !defined(EVENT_HAVE_USLEEP) && \
+ !defined(_WIN32)
+#include <sys/select.h>
+#endif
+#include <time.h>
+#include <sys/stat.h>
+#include <string.h>
+
+#include "event2/util.h"
+#include "util-internal.h"
+#include "log-internal.h"
+#include "mm-internal.h"
+
+#ifndef EVENT__HAVE_GETTIMEOFDAY
+/* No gettimeofday; this must be windows. */
+int
+evutil_gettimeofday(struct timeval *tv, struct timezone *tz)
+{
+#ifdef _MSC_VER
+#define U64_LITERAL(n) n##ui64
+#else
+#define U64_LITERAL(n) n##llu
+#endif
+
+ /* Conversion logic taken from Tor, which in turn took it
+ * from Perl. GetSystemTimeAsFileTime returns its value as
+ * an unaligned (!) 64-bit value containing the number of
+ * 100-nanosecond intervals since 1 January 1601 UTC. */
+#define EPOCH_BIAS U64_LITERAL(116444736000000000)
+#define UNITS_PER_SEC U64_LITERAL(10000000)
+#define USEC_PER_SEC U64_LITERAL(1000000)
+#define UNITS_PER_USEC U64_LITERAL(10)
+ union {
+ FILETIME ft_ft;
+ ev_uint64_t ft_64;
+ } ft;
+
+ if (tv == NULL)
+ return -1;
+
+ GetSystemTimeAsFileTime(&ft.ft_ft);
+
+ if (EVUTIL_UNLIKELY(ft.ft_64 < EPOCH_BIAS)) {
+ /* Time before the unix epoch. */
+ return -1;
+ }
+ ft.ft_64 -= EPOCH_BIAS;
+ tv->tv_sec = (long) (ft.ft_64 / UNITS_PER_SEC);
+ tv->tv_usec = (long) ((ft.ft_64 / UNITS_PER_USEC) % USEC_PER_SEC);
+ return 0;
+}
+#endif
+
+#define MAX_SECONDS_IN_MSEC_LONG \
+ (((LONG_MAX) - 999) / 1000)
+
+long
+evutil_tv_to_msec_(const struct timeval *tv)
+{
+ if (tv->tv_usec > 1000000 || tv->tv_sec > MAX_SECONDS_IN_MSEC_LONG)
+ return -1;
+
+ return (tv->tv_sec * 1000) + ((tv->tv_usec + 999) / 1000);
+}
+
+/*
+ Replacement for usleep on platforms that don't have one. Not guaranteed to
+ be any more finegrained than 1 msec.
+ */
+void
+evutil_usleep_(const struct timeval *tv)
+{
+ if (!tv)
+ return;
+#if defined(_WIN32)
+ {
+ long msec = evutil_tv_to_msec_(tv);
+ Sleep((DWORD)msec);
+ }
+#elif defined(EVENT__HAVE_NANOSLEEP)
+ {
+ struct timespec ts;
+ ts.tv_sec = tv->tv_sec;
+ ts.tv_nsec = tv->tv_usec*1000;
+ nanosleep(&ts, NULL);
+ }
+#elif defined(EVENT__HAVE_USLEEP)
+ /* Some systems don't like to usleep more than 999999 usec */
+ sleep(tv->tv_sec);
+ usleep(tv->tv_usec);
+#else
+ select(0, NULL, NULL, NULL, tv);
+#endif
+}
+
+/*
+ This function assumes it's called repeatedly with a
+ not-actually-so-monotonic time source whose outputs are in 'tv'. It
+ implements a trivial ratcheting mechanism so that the values never go
+ backwards.
+ */
+static void
+adjust_monotonic_time(struct evutil_monotonic_timer *base,
+ struct timeval *tv)
+{
+ evutil_timeradd(tv, &base->adjust_monotonic_clock, tv);
+
+ if (evutil_timercmp(tv, &base->last_time, <)) {
+ /* Guess it wasn't monotonic after all. */
+ struct timeval adjust;
+ evutil_timersub(&base->last_time, tv, &adjust);
+ evutil_timeradd(&adjust, &base->adjust_monotonic_clock,
+ &base->adjust_monotonic_clock);
+ *tv = base->last_time;
+ }
+ base->last_time = *tv;
+}
+
+/*
+ Allocate a new struct evutil_monotonic_timer
+ */
+struct evutil_monotonic_timer *
+evutil_monotonic_timer_new(void)
+{
+ struct evutil_monotonic_timer *p = NULL;
+
+ p = mm_malloc(sizeof(*p));
+ if (!p) goto done;
+
+ memset(p, 0, sizeof(*p));
+
+ done:
+ return p;
+}
+
+/*
+ Free a struct evutil_monotonic_timer
+ */
+void
+evutil_monotonic_timer_free(struct evutil_monotonic_timer *timer)
+{
+ if (timer) {
+ mm_free(timer);
+ }
+}
+
+/*
+ Set up a struct evutil_monotonic_timer for initial use
+ */
+int
+evutil_configure_monotonic_time(struct evutil_monotonic_timer *timer,
+ int flags)
+{
+ return evutil_configure_monotonic_time_(timer, flags);
+}
+
+/*
+ Query the current monotonic time
+ */
+int
+evutil_gettime_monotonic(struct evutil_monotonic_timer *timer,
+ struct timeval *tp)
+{
+ return evutil_gettime_monotonic_(timer, tp);
+}
+
+
+#if defined(HAVE_POSIX_MONOTONIC)
+/* =====
+ The POSIX clock_gettime() interface provides a few ways to get at a
+ monotonic clock. CLOCK_MONOTONIC is most widely supported. Linux also
+ provides a CLOCK_MONOTONIC_COARSE with accuracy of about 1-4 msec.
+
+ On all platforms I'm aware of, CLOCK_MONOTONIC really is monotonic.
+ Platforms don't agree about whether it should jump on a sleep/resume.
+ */
+
+int
+evutil_configure_monotonic_time_(struct evutil_monotonic_timer *base,
+ int flags)
+{
+ /* CLOCK_MONOTONIC exists on FreeBSD, Linux, and Solaris. You need to
+ * check for it at runtime, because some older kernel versions won't
+ * have it working. */
+#ifdef CLOCK_MONOTONIC_COARSE
+ const int precise = flags & EV_MONOT_PRECISE;
+#endif
+ const int fallback = flags & EV_MONOT_FALLBACK;
+ struct timespec ts;
+
+#ifdef CLOCK_MONOTONIC_COARSE
+ if (CLOCK_MONOTONIC_COARSE < 0) {
+ /* Technically speaking, nothing keeps CLOCK_* from being
+ * negative (as far as I know). This check and the one below
+ * make sure that it's safe for us to use -1 as an "unset"
+ * value. */
+ event_errx(1,"I didn't expect CLOCK_MONOTONIC_COARSE to be < 0");
+ }
+ if (! precise && ! fallback) {
+ if (clock_gettime(CLOCK_MONOTONIC_COARSE, &ts) == 0) {
+ base->monotonic_clock = CLOCK_MONOTONIC_COARSE;
+ return 0;
+ }
+ }
+#endif
+ if (!fallback && clock_gettime(CLOCK_MONOTONIC, &ts) == 0) {
+ base->monotonic_clock = CLOCK_MONOTONIC;
+ return 0;
+ }
+
+ if (CLOCK_MONOTONIC < 0) {
+ event_errx(1,"I didn't expect CLOCK_MONOTONIC to be < 0");
+ }
+
+ base->monotonic_clock = -1;
+ return 0;
+}
+
+int
+evutil_gettime_monotonic_(struct evutil_monotonic_timer *base,
+ struct timeval *tp)
+{
+ struct timespec ts;
+
+ if (base->monotonic_clock < 0) {
+ if (evutil_gettimeofday(tp, NULL) < 0)
+ return -1;
+ adjust_monotonic_time(base, tp);
+ return 0;
+ }
+
+ if (clock_gettime(base->monotonic_clock, &ts) == -1)
+ return -1;
+ tp->tv_sec = ts.tv_sec;
+ tp->tv_usec = ts.tv_nsec / 1000;
+
+ return 0;
+}
+#endif
+
+#if defined(HAVE_MACH_MONOTONIC)
+/* ======
+ Apple is a little late to the POSIX party. And why not? Instead of
+ clock_gettime(), they provide mach_absolute_time(). Its units are not
+ fixed; we need to use mach_timebase_info() to get the right functions to
+ convert its units into nanoseconds.
+
+ To all appearances, mach_absolute_time() seems to be honest-to-goodness
+ monotonic. Whether it stops during sleep or not is unspecified in
+ principle, and dependent on CPU architecture in practice.
+ */
+
+int
+evutil_configure_monotonic_time_(struct evutil_monotonic_timer *base,
+ int flags)
+{
+ const int fallback = flags & EV_MONOT_FALLBACK;
+ struct mach_timebase_info mi;
+ memset(base, 0, sizeof(*base));
+ /* OSX has mach_absolute_time() */
+ if (!fallback &&
+ mach_timebase_info(&mi) == 0 &&
+ mach_absolute_time() != 0) {
+ /* mach_timebase_info tells us how to convert
+ * mach_absolute_time() into nanoseconds, but we
+ * want to use microseconds instead. */
+ mi.denom *= 1000;
+ memcpy(&base->mach_timebase_units, &mi, sizeof(mi));
+ } else {
+ base->mach_timebase_units.numer = 0;
+ }
+ return 0;
+}
+
+int
+evutil_gettime_monotonic_(struct evutil_monotonic_timer *base,
+ struct timeval *tp)
+{
+ ev_uint64_t abstime, usec;
+ if (base->mach_timebase_units.numer == 0) {
+ if (evutil_gettimeofday(tp, NULL) < 0)
+ return -1;
+ adjust_monotonic_time(base, tp);
+ return 0;
+ }
+
+ abstime = mach_absolute_time();
+ usec = (abstime * base->mach_timebase_units.numer)
+ / (base->mach_timebase_units.denom);
+ tp->tv_sec = usec / 1000000;
+ tp->tv_usec = usec % 1000000;
+
+ return 0;
+}
+#endif
+
+#if defined(HAVE_WIN32_MONOTONIC)
+/* =====
+ Turn we now to Windows. Want monontonic time on Windows?
+
+ Windows has QueryPerformanceCounter(), which gives time most high-
+ resolution time. It's a pity it's not so monotonic in practice; it's
+ also got some fun bugs, especially: with older Windowses, under
+ virtualizations, with funny hardware, on multiprocessor systems, and so
+ on. PEP418 [1] has a nice roundup of the issues here.
+
+ There's GetTickCount64() on Vista and later, which gives a number of 1-msec
+ ticks since startup. The accuracy here might be as bad as 10-20 msec, I
+ hear. There's an undocumented function (NtSetTimerResolution) that
+ allegedly increases the accuracy. Good luck!
+
+ There's also GetTickCount(), which is only 32 bits, but seems to be
+ supported on pre-Vista versions of Windows. Apparently, you can coax
+ another 14 bits out of it, giving you 2231 years before rollover.
+
+ The less said about timeGetTime() the better.
+
+ "We don't care. We don't have to. We're the Phone Company."
+ -- Lily Tomlin, SNL
+
+ Our strategy, if precise timers are turned off, is to just use the best
+ GetTickCount equivalent available. If we've been asked for precise timing,
+ then we mostly[2] assume that GetTickCount is monotonic, and correct
+ GetPerformanceCounter to approximate it.
+
+ [1] http://www.python.org/dev/peps/pep-0418
+ [2] Of course, we feed the Windows stuff into adjust_monotonic_time()
+ anyway, just in case it isn't.
+
+ */
+/*
+ Parts of our logic in the win32 timer code here are closely based on
+ BitTorrent's libUTP library. That code is subject to the following
+ license:
+
+ Copyright (c) 2010 BitTorrent, Inc.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+static ev_uint64_t
+evutil_GetTickCount_(struct evutil_monotonic_timer *base)
+{
+ if (base->GetTickCount64_fn) {
+ /* Let's just use GetTickCount64 if we can. */
+ return base->GetTickCount64_fn();
+ } else if (base->GetTickCount_fn) {
+ /* Greg Hazel assures me that this works, that BitTorrent has
+ * done it for years, and this it won't turn around and
+ * bite us. He says they found it on some game programmers'
+ * forum some time around 2007.
+ */
+ ev_uint64_t v = base->GetTickCount_fn();
+ return (DWORD)v | ((v >> 18) & 0xFFFFFFFF00000000);
+ } else {
+ /* Here's the fallback implementation. We have to use
+ * GetTickCount() with its given signature, so we only get
+ * 32 bits worth of milliseconds, which will roll ove every
+ * 49 days or so. */
+ DWORD ticks = GetTickCount();
+ if (ticks < base->last_tick_count) {
+ base->adjust_tick_count += ((ev_uint64_t)1) << 32;
+ }
+ base->last_tick_count = ticks;
+ return ticks + base->adjust_tick_count;
+ }
+}
+
+int
+evutil_configure_monotonic_time_(struct evutil_monotonic_timer *base,
+ int flags)
+{
+ const int precise = flags & EV_MONOT_PRECISE;
+ const int fallback = flags & EV_MONOT_FALLBACK;
+ HANDLE h;
+ memset(base, 0, sizeof(*base));
+
+ h = evutil_load_windows_system_library_(TEXT("kernel32.dll"));
+ if (h != NULL && !fallback) {
+ base->GetTickCount64_fn = (ev_GetTickCount_func)GetProcAddress(h, "GetTickCount64");
+ base->GetTickCount_fn = (ev_GetTickCount_func)GetProcAddress(h, "GetTickCount");
+ }
+
+ base->first_tick = base->last_tick_count = evutil_GetTickCount_(base);
+ if (precise && !fallback) {
+ LARGE_INTEGER freq;
+ if (QueryPerformanceFrequency(&freq)) {
+ LARGE_INTEGER counter;
+ QueryPerformanceCounter(&counter);
+ base->first_counter = counter.QuadPart;
+ base->usec_per_count = 1.0e6 / freq.QuadPart;
+ base->use_performance_counter = 1;
+ }
+ }
+
+ return 0;
+}
+
+static inline ev_int64_t
+abs64(ev_int64_t i)
+{
+ return i < 0 ? -i : i;
+}
+
+
+int
+evutil_gettime_monotonic_(struct evutil_monotonic_timer *base,
+ struct timeval *tp)
+{
+ ev_uint64_t ticks = evutil_GetTickCount_(base);
+ if (base->use_performance_counter) {
+ /* Here's a trick we took from BitTorrent's libutp, at Greg
+ * Hazel's recommendation. We use QueryPerformanceCounter for
+ * our high-resolution timer, but use GetTickCount*() to keep
+ * it sane, and adjust_monotonic_time() to keep it monotonic.
+ */
+ LARGE_INTEGER counter;
+ ev_int64_t counter_elapsed, counter_usec_elapsed, ticks_elapsed;
+ QueryPerformanceCounter(&counter);
+ counter_elapsed = (ev_int64_t)
+ (counter.QuadPart - base->first_counter);
+ ticks_elapsed = ticks - base->first_tick;
+ /* TODO: This may upset VC6. If you need this to work with
+ * VC6, please supply an appropriate patch. */
+ counter_usec_elapsed = (ev_int64_t)
+ (counter_elapsed * base->usec_per_count);
+
+ if (abs64(ticks_elapsed*1000 - counter_usec_elapsed) > 1000000) {
+ /* It appears that the QueryPerformanceCounter()
+ * result is more than 1 second away from
+ * GetTickCount() result. Let's adjust it to be as
+ * accurate as we can; adjust_monotnonic_time() below
+ * will keep it monotonic. */
+ counter_usec_elapsed = ticks_elapsed * 1000;
+ base->first_counter = (ev_uint64_t) (counter.QuadPart - counter_usec_elapsed / base->usec_per_count);
+ }
+ tp->tv_sec = (time_t) (counter_usec_elapsed / 1000000);
+ tp->tv_usec = counter_usec_elapsed % 1000000;
+
+ } else {
+ /* We're just using GetTickCount(). */
+ tp->tv_sec = (time_t) (ticks / 1000);
+ tp->tv_usec = (ticks % 1000) * 1000;
+ }
+ adjust_monotonic_time(base, tp);
+
+ return 0;
+}
+#endif
+
+#if defined(HAVE_FALLBACK_MONOTONIC)
+/* =====
+ And if none of the other options work, let's just use gettimeofday(), and
+ ratchet it forward so that it acts like a monotonic timer, whether it
+ wants to or not.
+ */
+
+int
+evutil_configure_monotonic_time_(struct evutil_monotonic_timer *base,
+ int precise)
+{
+ memset(base, 0, sizeof(*base));
+ return 0;
+}
+
+int
+evutil_gettime_monotonic_(struct evutil_monotonic_timer *base,
+ struct timeval *tp)
+{
+ if (evutil_gettimeofday(tp, NULL) < 0)
+ return -1;
+ adjust_monotonic_time(base, tp);
+ return 0;
+
+}
+#endif
diff --git a/protocols/Telegram/tgl/libevent/evutil_time.obj b/protocols/Telegram/tgl/libevent/evutil_time.obj
new file mode 100644
index 0000000000..3b4a859019
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/evutil_time.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/ht-internal.h b/protocols/Telegram/tgl/libevent/ht-internal.h
new file mode 100644
index 0000000000..50375bbaa9
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/ht-internal.h
@@ -0,0 +1,487 @@
+/* Copyright 2002 Christopher Clark */
+/* Copyright 2005-2012 Nick Mathewson */
+/* Copyright 2009-2012 Niels Provos and Nick Mathewson */
+/* See license at end. */
+
+/* Based on ideas by Christopher Clark and interfaces from Niels Provos. */
+
+#ifndef HT_INTERNAL_H_INCLUDED_
+#define HT_INTERNAL_H_INCLUDED_
+
+#define HT_HEAD(name, type) \
+ struct name { \
+ /* The hash table itself. */ \
+ struct type **hth_table; \
+ /* How long is the hash table? */ \
+ unsigned hth_table_length; \
+ /* How many elements does the table contain? */ \
+ unsigned hth_n_entries; \
+ /* How many elements will we allow in the table before resizing it? */ \
+ unsigned hth_load_limit; \
+ /* Position of hth_table_length in the primes table. */ \
+ int hth_prime_idx; \
+ }
+
+#define HT_INITIALIZER() \
+ { NULL, 0, 0, 0, -1 }
+
+#ifdef HT_NO_CACHE_HASH_VALUES
+#define HT_ENTRY(type) \
+ struct { \
+ struct type *hte_next; \
+ }
+#else
+#define HT_ENTRY(type) \
+ struct { \
+ struct type *hte_next; \
+ unsigned hte_hash; \
+ }
+#endif
+
+#define HT_EMPTY(head) \
+ ((head)->hth_n_entries == 0)
+
+/* How many elements in 'head'? */
+#define HT_SIZE(head) \
+ ((head)->hth_n_entries)
+
+/* Return memory usage for a hashtable (not counting the entries themselves) */
+#define HT_MEM_USAGE(head) \
+ (sizeof(*head) + (head)->hth_table_length * sizeof(void*))
+
+#define HT_FIND(name, head, elm) name##_HT_FIND((head), (elm))
+#define HT_INSERT(name, head, elm) name##_HT_INSERT((head), (elm))
+#define HT_REPLACE(name, head, elm) name##_HT_REPLACE((head), (elm))
+#define HT_REMOVE(name, head, elm) name##_HT_REMOVE((head), (elm))
+#define HT_START(name, head) name##_HT_START(head)
+#define HT_NEXT(name, head, elm) name##_HT_NEXT((head), (elm))
+#define HT_NEXT_RMV(name, head, elm) name##_HT_NEXT_RMV((head), (elm))
+#define HT_CLEAR(name, head) name##_HT_CLEAR(head)
+#define HT_INIT(name, head) name##_HT_INIT(head)
+/* Helper: */
+static inline unsigned
+ht_improve_hash_(unsigned h)
+{
+ /* Aim to protect against poor hash functions by adding logic here
+ * - logic taken from java 1.4 hashtable source */
+ h += ~(h << 9);
+ h ^= ((h >> 14) | (h << 18)); /* >>> */
+ h += (h << 4);
+ h ^= ((h >> 10) | (h << 22)); /* >>> */
+ return h;
+}
+
+#if 0
+/** Basic string hash function, from Java standard String.hashCode(). */
+static inline unsigned
+ht_string_hash_(const char *s)
+{
+ unsigned h = 0;
+ int m = 1;
+ while (*s) {
+ h += ((signed char)*s++)*m;
+ m = (m<<5)-1; /* m *= 31 */
+ }
+ return h;
+}
+#endif
+
+/** Basic string hash function, from Python's str.__hash__() */
+static inline unsigned
+ht_string_hash_(const char *s)
+{
+ unsigned h;
+ const unsigned char *cp = (const unsigned char *)s;
+ h = *cp << 7;
+ while (*cp) {
+ h = (1000003*h) ^ *cp++;
+ }
+ /* This conversion truncates the length of the string, but that's ok. */
+ h ^= (unsigned)(cp-(const unsigned char*)s);
+ return h;
+}
+
+#ifndef HT_NO_CACHE_HASH_VALUES
+#define HT_SET_HASH_(elm, field, hashfn) \
+ do { (elm)->field.hte_hash = hashfn(elm); } while (0)
+#define HT_SET_HASHVAL_(elm, field, val) \
+ do { (elm)->field.hte_hash = (val); } while (0)
+#define HT_ELT_HASH_(elm, field, hashfn) \
+ ((elm)->field.hte_hash)
+#else
+#define HT_SET_HASH_(elm, field, hashfn) \
+ ((void)0)
+#define HT_ELT_HASH_(elm, field, hashfn) \
+ (hashfn(elm))
+#define HT_SET_HASHVAL_(elm, field, val) \
+ ((void)0)
+#endif
+
+/* Helper: alias for the bucket containing 'elm'. */
+#define HT_BUCKET_(head, field, elm, hashfn) \
+ ((head)->hth_table[HT_ELT_HASH_(elm,field,hashfn) % head->hth_table_length])
+
+#define HT_FOREACH(x, name, head) \
+ for ((x) = HT_START(name, head); \
+ (x) != NULL; \
+ (x) = HT_NEXT(name, head, x))
+
+#define HT_PROTOTYPE(name, type, field, hashfn, eqfn) \
+ int name##_HT_GROW(struct name *ht, unsigned min_capacity); \
+ void name##_HT_CLEAR(struct name *ht); \
+ int name##_HT_REP_IS_BAD_(const struct name *ht); \
+ static inline void \
+ name##_HT_INIT(struct name *head) { \
+ head->hth_table_length = 0; \
+ head->hth_table = NULL; \
+ head->hth_n_entries = 0; \
+ head->hth_load_limit = 0; \
+ head->hth_prime_idx = -1; \
+ } \
+ /* Helper: returns a pointer to the right location in the table \
+ * 'head' to find or insert the element 'elm'. */ \
+ static inline struct type ** \
+ name##_HT_FIND_P_(struct name *head, struct type *elm) \
+ { \
+ struct type **p; \
+ if (!head->hth_table) \
+ return NULL; \
+ p = &HT_BUCKET_(head, field, elm, hashfn); \
+ while (*p) { \
+ if (eqfn(*p, elm)) \
+ return p; \
+ p = &(*p)->field.hte_next; \
+ } \
+ return p; \
+ } \
+ /* Return a pointer to the element in the table 'head' matching 'elm', \
+ * or NULL if no such element exists */ \
+ static inline struct type * \
+ name##_HT_FIND(const struct name *head, struct type *elm) \
+ { \
+ struct type **p; \
+ struct name *h = (struct name *) head; \
+ HT_SET_HASH_(elm, field, hashfn); \
+ p = name##_HT_FIND_P_(h, elm); \
+ return p ? *p : NULL; \
+ } \
+ /* Insert the element 'elm' into the table 'head'. Do not call this \
+ * function if the table might already contain a matching element. */ \
+ static inline void \
+ name##_HT_INSERT(struct name *head, struct type *elm) \
+ { \
+ struct type **p; \
+ if (!head->hth_table || head->hth_n_entries >= head->hth_load_limit) \
+ name##_HT_GROW(head, head->hth_n_entries+1); \
+ ++head->hth_n_entries; \
+ HT_SET_HASH_(elm, field, hashfn); \
+ p = &HT_BUCKET_(head, field, elm, hashfn); \
+ elm->field.hte_next = *p; \
+ *p = elm; \
+ } \
+ /* Insert the element 'elm' into the table 'head'. If there already \
+ * a matching element in the table, replace that element and return \
+ * it. */ \
+ static inline struct type * \
+ name##_HT_REPLACE(struct name *head, struct type *elm) \
+ { \
+ struct type **p, *r; \
+ if (!head->hth_table || head->hth_n_entries >= head->hth_load_limit) \
+ name##_HT_GROW(head, head->hth_n_entries+1); \
+ HT_SET_HASH_(elm, field, hashfn); \
+ p = name##_HT_FIND_P_(head, elm); \
+ r = *p; \
+ *p = elm; \
+ if (r && (r!=elm)) { \
+ elm->field.hte_next = r->field.hte_next; \
+ r->field.hte_next = NULL; \
+ return r; \
+ } else { \
+ ++head->hth_n_entries; \
+ return NULL; \
+ } \
+ } \
+ /* Remove any element matching 'elm' from the table 'head'. If such \
+ * an element is found, return it; otherwise return NULL. */ \
+ static inline struct type * \
+ name##_HT_REMOVE(struct name *head, struct type *elm) \
+ { \
+ struct type **p, *r; \
+ HT_SET_HASH_(elm, field, hashfn); \
+ p = name##_HT_FIND_P_(head,elm); \
+ if (!p || !*p) \
+ return NULL; \
+ r = *p; \
+ *p = r->field.hte_next; \
+ r->field.hte_next = NULL; \
+ --head->hth_n_entries; \
+ return r; \
+ } \
+ /* Invoke the function 'fn' on every element of the table 'head', \
+ * using 'data' as its second argument. If the function returns \
+ * nonzero, remove the most recently examined element before invoking \
+ * the function again. */ \
+ static inline void \
+ name##_HT_FOREACH_FN(struct name *head, \
+ int (*fn)(struct type *, void *), \
+ void *data) \
+ { \
+ unsigned idx; \
+ struct type **p, **nextp, *next; \
+ if (!head->hth_table) \
+ return; \
+ for (idx=0; idx < head->hth_table_length; ++idx) { \
+ p = &head->hth_table[idx]; \
+ while (*p) { \
+ nextp = &(*p)->field.hte_next; \
+ next = *nextp; \
+ if (fn(*p, data)) { \
+ --head->hth_n_entries; \
+ *p = next; \
+ } else { \
+ p = nextp; \
+ } \
+ } \
+ } \
+ } \
+ /* Return a pointer to the first element in the table 'head', under \
+ * an arbitrary order. This order is stable under remove operations, \
+ * but not under others. If the table is empty, return NULL. */ \
+ static inline struct type ** \
+ name##_HT_START(struct name *head) \
+ { \
+ unsigned b = 0; \
+ while (b < head->hth_table_length) { \
+ if (head->hth_table[b]) \
+ return &head->hth_table[b]; \
+ ++b; \
+ } \
+ return NULL; \
+ } \
+ /* Return the next element in 'head' after 'elm', under the arbitrary \
+ * order used by HT_START. If there are no more elements, return \
+ * NULL. If 'elm' is to be removed from the table, you must call \
+ * this function for the next value before you remove it. \
+ */ \
+ static inline struct type ** \
+ name##_HT_NEXT(struct name *head, struct type **elm) \
+ { \
+ if ((*elm)->field.hte_next) { \
+ return &(*elm)->field.hte_next; \
+ } else { \
+ unsigned b = (HT_ELT_HASH_(*elm, field, hashfn) % head->hth_table_length)+1; \
+ while (b < head->hth_table_length) { \
+ if (head->hth_table[b]) \
+ return &head->hth_table[b]; \
+ ++b; \
+ } \
+ return NULL; \
+ } \
+ } \
+ static inline struct type ** \
+ name##_HT_NEXT_RMV(struct name *head, struct type **elm) \
+ { \
+ unsigned h = HT_ELT_HASH_(*elm, field, hashfn); \
+ *elm = (*elm)->field.hte_next; \
+ --head->hth_n_entries; \
+ if (*elm) { \
+ return elm; \
+ } else { \
+ unsigned b = (h % head->hth_table_length)+1; \
+ while (b < head->hth_table_length) { \
+ if (head->hth_table[b]) \
+ return &head->hth_table[b]; \
+ ++b; \
+ } \
+ return NULL; \
+ } \
+ }
+
+#define HT_GENERATE(name, type, field, hashfn, eqfn, load, mallocfn, \
+ reallocfn, freefn) \
+ static unsigned name##_PRIMES[] = { \
+ 53, 97, 193, 389, \
+ 769, 1543, 3079, 6151, \
+ 12289, 24593, 49157, 98317, \
+ 196613, 393241, 786433, 1572869, \
+ 3145739, 6291469, 12582917, 25165843, \
+ 50331653, 100663319, 201326611, 402653189, \
+ 805306457, 1610612741 \
+ }; \
+ static unsigned name##_N_PRIMES = \
+ (unsigned)(sizeof(name##_PRIMES)/sizeof(name##_PRIMES[0])); \
+ /* Expand the internal table of 'head' until it is large enough to \
+ * hold 'size' elements. Return 0 on success, -1 on allocation \
+ * failure. */ \
+ int \
+ name##_HT_GROW(struct name *head, unsigned size) \
+ { \
+ unsigned new_len, new_load_limit; \
+ int prime_idx; \
+ struct type **new_table; \
+ if (head->hth_prime_idx == (int)name##_N_PRIMES - 1) \
+ return 0; \
+ if (head->hth_load_limit > size) \
+ return 0; \
+ prime_idx = head->hth_prime_idx; \
+ do { \
+ new_len = name##_PRIMES[++prime_idx]; \
+ new_load_limit = (unsigned)(load*new_len); \
+ } while (new_load_limit <= size && \
+ prime_idx < (int)name##_N_PRIMES); \
+ if ((new_table = mallocfn(new_len*sizeof(struct type*)))) { \
+ unsigned b; \
+ memset(new_table, 0, new_len*sizeof(struct type*)); \
+ for (b = 0; b < head->hth_table_length; ++b) { \
+ struct type *elm, *next; \
+ unsigned b2; \
+ elm = head->hth_table[b]; \
+ while (elm) { \
+ next = elm->field.hte_next; \
+ b2 = HT_ELT_HASH_(elm, field, hashfn) % new_len; \
+ elm->field.hte_next = new_table[b2]; \
+ new_table[b2] = elm; \
+ elm = next; \
+ } \
+ } \
+ if (head->hth_table) \
+ freefn(head->hth_table); \
+ head->hth_table = new_table; \
+ } else { \
+ unsigned b, b2; \
+ new_table = reallocfn(head->hth_table, new_len*sizeof(struct type*)); \
+ if (!new_table) return -1; \
+ memset(new_table + head->hth_table_length, 0, \
+ (new_len - head->hth_table_length)*sizeof(struct type*)); \
+ for (b=0; b < head->hth_table_length; ++b) { \
+ struct type *e, **pE; \
+ for (pE = &new_table[b], e = *pE; e != NULL; e = *pE) { \
+ b2 = HT_ELT_HASH_(e, field, hashfn) % new_len; \
+ if (b2 == b) { \
+ pE = &e->field.hte_next; \
+ } else { \
+ *pE = e->field.hte_next; \
+ e->field.hte_next = new_table[b2]; \
+ new_table[b2] = e; \
+ } \
+ } \
+ } \
+ head->hth_table = new_table; \
+ } \
+ head->hth_table_length = new_len; \
+ head->hth_prime_idx = prime_idx; \
+ head->hth_load_limit = new_load_limit; \
+ return 0; \
+ } \
+ /* Free all storage held by 'head'. Does not free 'head' itself, or \
+ * individual elements. */ \
+ void \
+ name##_HT_CLEAR(struct name *head) \
+ { \
+ if (head->hth_table) \
+ freefn(head->hth_table); \
+ name##_HT_INIT(head); \
+ } \
+ /* Debugging helper: return false iff the representation of 'head' is \
+ * internally consistent. */ \
+ int \
+ name##_HT_REP_IS_BAD_(const struct name *head) \
+ { \
+ unsigned n, i; \
+ struct type *elm; \
+ if (!head->hth_table_length) { \
+ if (!head->hth_table && !head->hth_n_entries && \
+ !head->hth_load_limit && head->hth_prime_idx == -1) \
+ return 0; \
+ else \
+ return 1; \
+ } \
+ if (!head->hth_table || head->hth_prime_idx < 0 || \
+ !head->hth_load_limit) \
+ return 2; \
+ if (head->hth_n_entries > head->hth_load_limit) \
+ return 3; \
+ if (head->hth_table_length != name##_PRIMES[head->hth_prime_idx]) \
+ return 4; \
+ if (head->hth_load_limit != (unsigned)(load*head->hth_table_length)) \
+ return 5; \
+ for (n = i = 0; i < head->hth_table_length; ++i) { \
+ for (elm = head->hth_table[i]; elm; elm = elm->field.hte_next) { \
+ if (HT_ELT_HASH_(elm, field, hashfn) != hashfn(elm)) \
+ return 1000 + i; \
+ if ((HT_ELT_HASH_(elm, field, hashfn) % head->hth_table_length) != i) \
+ return 10000 + i; \
+ ++n; \
+ } \
+ } \
+ if (n != head->hth_n_entries) \
+ return 6; \
+ return 0; \
+ }
+
+/** Implements an over-optimized "find and insert if absent" block;
+ * not meant for direct usage by typical code, or usage outside the critical
+ * path.*/
+#define HT_FIND_OR_INSERT_(name, field, hashfn, head, eltype, elm, var, y, n) \
+ { \
+ struct name *var##_head_ = head; \
+ struct eltype **var; \
+ if (!var##_head_->hth_table || \
+ var##_head_->hth_n_entries >= var##_head_->hth_load_limit) \
+ name##_HT_GROW(var##_head_, var##_head_->hth_n_entries+1); \
+ HT_SET_HASH_((elm), field, hashfn); \
+ var = name##_HT_FIND_P_(var##_head_, (elm)); \
+ if (*var) { \
+ y; \
+ } else { \
+ n; \
+ } \
+ }
+#define HT_FOI_INSERT_(field, head, elm, newent, var) \
+ { \
+ HT_SET_HASHVAL_(newent, field, (elm)->field.hte_hash); \
+ newent->field.hte_next = NULL; \
+ *var = newent; \
+ ++((head)->hth_n_entries); \
+ }
+
+/*
+ * Copyright 2005, Nick Mathewson. Implementation logic is adapted from code
+ * by Christopher Clark, retrofit to allow drop-in memory management, and to
+ * use the same interface as Niels Provos's tree.h. This is probably still
+ * a derived work, so the original license below still applies.
+ *
+ * Copyright (c) 2002, Christopher Clark
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * 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.
+ *
+ * * Neither the name of the original author; nor the names of any contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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 COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#endif
+
diff --git a/protocols/Telegram/tgl/libevent/http-internal.h b/protocols/Telegram/tgl/libevent/http-internal.h
new file mode 100644
index 0000000000..ba6e49ef9b
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/http-internal.h
@@ -0,0 +1,200 @@
+/*
+ * Copyright 2001-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * This header file contains definitions for dealing with HTTP requests
+ * that are internal to libevent. As user of the library, you should not
+ * need to know about these.
+ */
+
+#ifndef HTTP_INTERNAL_H_INCLUDED_
+#define HTTP_INTERNAL_H_INCLUDED_
+
+#include "event2/event_struct.h"
+#include "util-internal.h"
+#include "defer-internal.h"
+
+#define HTTP_CONNECT_TIMEOUT 45
+#define HTTP_WRITE_TIMEOUT 50
+#define HTTP_READ_TIMEOUT 50
+
+#define HTTP_PREFIX "http://"
+#define HTTP_DEFAULTPORT 80
+
+enum message_read_status {
+ ALL_DATA_READ = 1,
+ MORE_DATA_EXPECTED = 0,
+ DATA_CORRUPTED = -1,
+ REQUEST_CANCELED = -2,
+ DATA_TOO_LONG = -3
+};
+
+struct evbuffer;
+struct addrinfo;
+struct evhttp_request;
+
+/* Indicates an unknown request method. */
+#define EVHTTP_REQ_UNKNOWN_ (1<<15)
+
+enum evhttp_connection_state {
+ EVCON_DISCONNECTED, /**< not currently connected not trying either*/
+ EVCON_CONNECTING, /**< tries to currently connect */
+ EVCON_IDLE, /**< connection is established */
+ EVCON_READING_FIRSTLINE,/**< reading Request-Line (incoming conn) or
+ **< Status-Line (outgoing conn) */
+ EVCON_READING_HEADERS, /**< reading request/response headers */
+ EVCON_READING_BODY, /**< reading request/response body */
+ EVCON_READING_TRAILER, /**< reading request/response chunked trailer */
+ EVCON_WRITING /**< writing request/response headers/body */
+};
+
+struct event_base;
+
+/* A client or server connection. */
+struct evhttp_connection {
+ /* we use this tailq only if this connection was created for an http
+ * server */
+ TAILQ_ENTRY(evhttp_connection) next;
+
+ evutil_socket_t fd;
+ struct bufferevent *bufev;
+
+ struct event retry_ev; /* for retrying connects */
+
+ char *bind_address; /* address to use for binding the src */
+ unsigned short bind_port; /* local port for binding the src */
+
+ char *address; /* address to connect to */
+ unsigned short port;
+
+ size_t max_headers_size;
+ ev_uint64_t max_body_size;
+
+ int flags;
+#define EVHTTP_CON_INCOMING 0x0001 /* only one request on it ever */
+#define EVHTTP_CON_OUTGOING 0x0002 /* multiple requests possible */
+#define EVHTTP_CON_CLOSEDETECT 0x0004 /* detecting if persistent close */
+/* set when we want to auto free the connection */
+#define EVHTTP_CON_AUTOFREE EVHTTP_CON_PUBLIC_FLAGS_END
+
+ struct timeval timeout; /* timeout for events */
+ int retry_cnt; /* retry count */
+ int retry_max; /* maximum number of retries */
+ struct timeval initial_retry_timeout; /* Timeout for low long to wait
+ * after first failing attempt
+ * before retry */
+
+ enum evhttp_connection_state state;
+
+ /* for server connections, the http server they are connected with */
+ struct evhttp *http_server;
+
+ TAILQ_HEAD(evcon_requestq, evhttp_request) requests;
+
+ void (*cb)(struct evhttp_connection *, void *);
+ void *cb_arg;
+
+ void (*closecb)(struct evhttp_connection *, void *);
+ void *closecb_arg;
+
+ struct event_callback read_more_deferred_cb;
+
+ struct event_base *base;
+ struct evdns_base *dns_base;
+ int ai_family;
+};
+
+/* A callback for an http server */
+struct evhttp_cb {
+ TAILQ_ENTRY(evhttp_cb) next;
+
+ char *what;
+
+ void (*cb)(struct evhttp_request *req, void *);
+ void *cbarg;
+};
+
+/* both the http server as well as the rpc system need to queue connections */
+TAILQ_HEAD(evconq, evhttp_connection);
+
+/* each bound socket is stored in one of these */
+struct evhttp_bound_socket {
+ TAILQ_ENTRY(evhttp_bound_socket) next;
+
+ struct evconnlistener *listener;
+};
+
+/* server alias list item. */
+struct evhttp_server_alias {
+ TAILQ_ENTRY(evhttp_server_alias) next;
+
+ char *alias; /* the server alias. */
+};
+
+struct evhttp {
+ /* Next vhost, if this is a vhost. */
+ TAILQ_ENTRY(evhttp) next_vhost;
+
+ /* All listeners for this host */
+ TAILQ_HEAD(boundq, evhttp_bound_socket) sockets;
+
+ TAILQ_HEAD(httpcbq, evhttp_cb) callbacks;
+
+ /* All live connections on this host. */
+ struct evconq connections;
+
+ TAILQ_HEAD(vhostsq, evhttp) virtualhosts;
+
+ TAILQ_HEAD(aliasq, evhttp_server_alias) aliases;
+
+ /* NULL if this server is not a vhost */
+ char *vhost_pattern;
+
+ struct timeval timeout;
+
+ size_t default_max_headers_size;
+ ev_uint64_t default_max_body_size;
+ const char *default_content_type;
+
+ /* Bitmask of all HTTP methods that we accept and pass to user
+ * callbacks. */
+ ev_uint16_t allowed_methods;
+
+ /* Fallback callback if all the other callbacks for this connection
+ don't match. */
+ void (*gencb)(struct evhttp_request *req, void *);
+ void *gencbarg;
+ struct bufferevent* (*bevcb)(struct event_base *, void *);
+ void *bevcbarg;
+
+ struct event_base *base;
+};
+
+/* XXX most of these functions could be static. */
+
+/* resets the connection; can be reused for more requests */
+void evhttp_connection_reset_(struct evhttp_connection *);
+
+/* connects if necessary */
+int evhttp_connection_connect_(struct evhttp_connection *);
+
+enum evhttp_request_error;
+/* notifies the current request that it failed; resets connection */
+void evhttp_connection_fail_(struct evhttp_connection *,
+ enum evhttp_request_error error);
+
+enum message_read_status;
+
+enum message_read_status evhttp_parse_firstline_(struct evhttp_request *, struct evbuffer*);
+enum message_read_status evhttp_parse_headers_(struct evhttp_request *, struct evbuffer*);
+
+void evhttp_start_read_(struct evhttp_connection *);
+
+/* response sending HTML the data in the buffer */
+void evhttp_response_code_(struct evhttp_request *, int, const char *);
+void evhttp_send_page_(struct evhttp_request *, struct evbuffer *);
+
+int evhttp_decode_uri_internal(const char *uri, size_t length,
+ char *ret, int decode_plus);
+
+#endif /* _HTTP_H */
diff --git a/protocols/Telegram/tgl/libevent/http.c b/protocols/Telegram/tgl/libevent/http.c
new file mode 100644
index 0000000000..fd7ce3cbf2
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/http.c
@@ -0,0 +1,4892 @@
+/*
+ * Copyright (c) 2002-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef EVENT__HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_SYS_IOCCOM_H
+#include <sys/ioccom.h>
+#endif
+#ifdef EVENT__HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef EVENT__HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+
+#ifndef _WIN32
+#include <sys/socket.h>
+#include <sys/stat.h>
+#else
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
+#include <sys/queue.h>
+
+#ifdef EVENT__HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef EVENT__HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#ifdef EVENT__HAVE_NETDB_H
+#include <netdb.h>
+#endif
+
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifndef _WIN32
+#include <syslog.h>
+#endif
+#include <signal.h>
+#include <time.h>
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef EVENT__HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#undef timeout_pending
+#undef timeout_initialized
+
+#include "strlcpy-internal.h"
+#include "event2/http.h"
+#include "event2/event.h"
+#include "event2/buffer.h"
+#include "event2/bufferevent.h"
+#include "event2/http_struct.h"
+#include "event2/http_compat.h"
+#include "event2/util.h"
+#include "event2/listener.h"
+#include "log-internal.h"
+#include "util-internal.h"
+#include "http-internal.h"
+#include "mm-internal.h"
+#include "bufferevent-internal.h"
+
+#ifndef EVENT__HAVE_GETNAMEINFO
+#define NI_MAXSERV 32
+#define NI_MAXHOST 1025
+
+#ifndef NI_NUMERICHOST
+#define NI_NUMERICHOST 1
+#endif
+
+#ifndef NI_NUMERICSERV
+#define NI_NUMERICSERV 2
+#endif
+
+static int
+fake_getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
+ size_t hostlen, char *serv, size_t servlen, int flags)
+{
+ struct sockaddr_in *sin = (struct sockaddr_in *)sa;
+
+ if (serv != NULL) {
+ char tmpserv[16];
+ evutil_snprintf(tmpserv, sizeof(tmpserv),
+ "%d", ntohs(sin->sin_port));
+ if (strlcpy(serv, tmpserv, servlen) >= servlen)
+ return (-1);
+ }
+
+ if (host != NULL) {
+ if (flags & NI_NUMERICHOST) {
+ if (strlcpy(host, inet_ntoa(sin->sin_addr),
+ hostlen) >= hostlen)
+ return (-1);
+ else
+ return (0);
+ } else {
+ struct hostent *hp;
+ hp = gethostbyaddr((char *)&sin->sin_addr,
+ sizeof(struct in_addr), AF_INET);
+ if (hp == NULL)
+ return (-2);
+
+ if (strlcpy(host, hp->h_name, hostlen) >= hostlen)
+ return (-1);
+ else
+ return (0);
+ }
+ }
+ return (0);
+}
+
+#endif
+
+#define REQ_VERSION_BEFORE(req, major_v, minor_v) \
+ ((req)->major < (major_v) || \
+ ((req)->major == (major_v) && (req)->minor < (minor_v)))
+
+#define REQ_VERSION_ATLEAST(req, major_v, minor_v) \
+ ((req)->major > (major_v) || \
+ ((req)->major == (major_v) && (req)->minor >= (minor_v)))
+
+#ifndef MIN
+#define MIN(a,b) (((a)<(b))?(a):(b))
+#endif
+
+extern int debug;
+
+static evutil_socket_t bind_socket_ai(struct evutil_addrinfo *, int reuse);
+static evutil_socket_t bind_socket(const char *, ev_uint16_t, int reuse);
+static void name_from_addr(struct sockaddr *, ev_socklen_t, char **, char **);
+static int evhttp_associate_new_request_with_connection(
+ struct evhttp_connection *evcon);
+static void evhttp_connection_start_detectclose(
+ struct evhttp_connection *evcon);
+static void evhttp_connection_stop_detectclose(
+ struct evhttp_connection *evcon);
+static void evhttp_request_dispatch(struct evhttp_connection* evcon);
+static void evhttp_read_firstline(struct evhttp_connection *evcon,
+ struct evhttp_request *req);
+static void evhttp_read_header(struct evhttp_connection *evcon,
+ struct evhttp_request *req);
+static int evhttp_add_header_internal(struct evkeyvalq *headers,
+ const char *key, const char *value);
+static const char *evhttp_response_phrase_internal(int code);
+static void evhttp_get_request(struct evhttp *, evutil_socket_t, struct sockaddr *, ev_socklen_t);
+static void evhttp_write_buffer(struct evhttp_connection *,
+ void (*)(struct evhttp_connection *, void *), void *);
+static void evhttp_make_header(struct evhttp_connection *, struct evhttp_request *);
+
+/* callbacks for bufferevent */
+static void evhttp_read_cb(struct bufferevent *, void *);
+static void evhttp_write_cb(struct bufferevent *, void *);
+static void evhttp_error_cb(struct bufferevent *bufev, short what, void *arg);
+static int evhttp_find_vhost(struct evhttp *http, struct evhttp **outhttp,
+ const char *hostname);
+
+#ifndef EVENT__HAVE_STRSEP
+/* strsep replacement for platforms that lack it. Only works if
+ * del is one character long. */
+static char *
+strsep(char **s, const char *del)
+{
+ char *d, *tok;
+ EVUTIL_ASSERT(strlen(del) == 1);
+ if (!s || !*s)
+ return NULL;
+ tok = *s;
+ d = strstr(tok, del);
+ if (d) {
+ *d = '\0';
+ *s = d + 1;
+ } else
+ *s = NULL;
+ return tok;
+}
+#endif
+
+static size_t
+html_replace(const char ch, const char **escaped)
+{
+ switch (ch) {
+ case '<':
+ *escaped = "&lt;";
+ return 4;
+ case '>':
+ *escaped = "&gt;";
+ return 4;
+ case '"':
+ *escaped = "&quot;";
+ return 6;
+ case '\'':
+ *escaped = "&#039;";
+ return 6;
+ case '&':
+ *escaped = "&amp;";
+ return 5;
+ default:
+ break;
+ }
+
+ return 1;
+}
+
+/*
+ * Replaces <, >, ", ' and & with &lt;, &gt;, &quot;,
+ * &#039; and &amp; correspondingly.
+ *
+ * The returned string needs to be freed by the caller.
+ */
+
+char *
+evhttp_htmlescape(const char *html)
+{
+ size_t i;
+ size_t new_size = 0, old_size = 0;
+ char *escaped_html, *p;
+
+ if (html == NULL)
+ return (NULL);
+
+ old_size = strlen(html);
+ for (i = 0; i < old_size; ++i) {
+ const char *replaced = NULL;
+ const size_t replace_size = html_replace(html[i], &replaced);
+ if (replace_size > EV_SIZE_MAX - new_size) {
+ event_warn("%s: html_replace overflow", __func__);
+ return (NULL);
+ }
+ new_size += replace_size;
+ }
+
+ if (new_size == EV_SIZE_MAX)
+ return (NULL);
+ p = escaped_html = mm_malloc(new_size + 1);
+ if (escaped_html == NULL) {
+ event_warn("%s: malloc(%lu)", __func__,
+ (unsigned long)(new_size + 1));
+ return (NULL);
+ }
+ for (i = 0; i < old_size; ++i) {
+ const char *replaced = &html[i];
+ const size_t len = html_replace(html[i], &replaced);
+ memcpy(p, replaced, len);
+ p += len;
+ }
+
+ *p = '\0';
+
+ return (escaped_html);
+}
+
+/** Given an evhttp_cmd_type, returns a constant string containing the
+ * equivalent HTTP command, or NULL if the evhttp_command_type is
+ * unrecognized. */
+static const char *
+evhttp_method(enum evhttp_cmd_type type)
+{
+ const char *method;
+
+ switch (type) {
+ case EVHTTP_REQ_GET:
+ method = "GET";
+ break;
+ case EVHTTP_REQ_POST:
+ method = "POST";
+ break;
+ case EVHTTP_REQ_HEAD:
+ method = "HEAD";
+ break;
+ case EVHTTP_REQ_PUT:
+ method = "PUT";
+ break;
+ case EVHTTP_REQ_DELETE:
+ method = "DELETE";
+ break;
+ case EVHTTP_REQ_OPTIONS:
+ method = "OPTIONS";
+ break;
+ case EVHTTP_REQ_TRACE:
+ method = "TRACE";
+ break;
+ case EVHTTP_REQ_CONNECT:
+ method = "CONNECT";
+ break;
+ case EVHTTP_REQ_PATCH:
+ method = "PATCH";
+ break;
+ default:
+ method = NULL;
+ break;
+ }
+
+ return (method);
+}
+
+/**
+ * Determines if a response should have a body.
+ * Follows the rules in RFC 2616 section 4.3.
+ * @return 1 if the response MUST have a body; 0 if the response MUST NOT have
+ * a body.
+ */
+static int
+evhttp_response_needs_body(struct evhttp_request *req)
+{
+ return (req->response_code != HTTP_NOCONTENT &&
+ req->response_code != HTTP_NOTMODIFIED &&
+ (req->response_code < 100 || req->response_code >= 200) &&
+ req->type != EVHTTP_REQ_HEAD);
+}
+
+/** Helper: called after we've added some data to an evcon's bufferevent's
+ * output buffer. Sets the evconn's writing-is-done callback, and puts
+ * the bufferevent into writing mode.
+ */
+static void
+evhttp_write_buffer(struct evhttp_connection *evcon,
+ void (*cb)(struct evhttp_connection *, void *), void *arg)
+{
+ event_debug(("%s: preparing to write buffer\n", __func__));
+
+ /* Set call back */
+ evcon->cb = cb;
+ evcon->cb_arg = arg;
+
+ /* Disable the read callback: we don't actually care about data;
+ * we only care about close detection. (We don't disable reading,
+ * since we *do* want to learn about any close events.) */
+ bufferevent_setcb(evcon->bufev,
+ NULL, /*read*/
+ evhttp_write_cb,
+ evhttp_error_cb,
+ evcon);
+
+ bufferevent_enable(evcon->bufev, EV_WRITE);
+}
+
+static void
+evhttp_send_continue_done(struct evhttp_connection *evcon, void *arg)
+{
+ bufferevent_disable(evcon->bufev, EV_WRITE);
+}
+
+static void
+evhttp_send_continue(struct evhttp_connection *evcon,
+ struct evhttp_request *req)
+{
+ bufferevent_enable(evcon->bufev, EV_WRITE);
+ evbuffer_add_printf(bufferevent_get_output(evcon->bufev),
+ "HTTP/%d.%d 100 Continue\r\n\r\n",
+ req->major, req->minor);
+ evcon->cb = evhttp_send_continue_done;
+ evcon->cb_arg = NULL;
+ bufferevent_setcb(evcon->bufev,
+ evhttp_read_cb,
+ evhttp_write_cb,
+ evhttp_error_cb,
+ evcon);
+}
+
+/** Helper: returns true iff evconn is in any connected state. */
+static int
+evhttp_connected(struct evhttp_connection *evcon)
+{
+ switch (evcon->state) {
+ case EVCON_DISCONNECTED:
+ case EVCON_CONNECTING:
+ return (0);
+ case EVCON_IDLE:
+ case EVCON_READING_FIRSTLINE:
+ case EVCON_READING_HEADERS:
+ case EVCON_READING_BODY:
+ case EVCON_READING_TRAILER:
+ case EVCON_WRITING:
+ default:
+ return (1);
+ }
+}
+
+/* Create the headers needed for an outgoing HTTP request, adds them to
+ * the request's header list, and writes the request line to the
+ * connection's output buffer.
+ */
+static void
+evhttp_make_header_request(struct evhttp_connection *evcon,
+ struct evhttp_request *req)
+{
+ const char *method;
+
+ evhttp_remove_header(req->output_headers, "Proxy-Connection");
+
+ /* Generate request line */
+ method = evhttp_method(req->type);
+ evbuffer_add_printf(bufferevent_get_output(evcon->bufev),
+ "%s %s HTTP/%d.%d\r\n",
+ method, req->uri, req->major, req->minor);
+
+ /* Add the content length on a post or put request if missing */
+ if ((req->type == EVHTTP_REQ_POST || req->type == EVHTTP_REQ_PUT) &&
+ evhttp_find_header(req->output_headers, "Content-Length") == NULL){
+ char size[22];
+ evutil_snprintf(size, sizeof(size), EV_SIZE_FMT,
+ EV_SIZE_ARG(evbuffer_get_length(req->output_buffer)));
+ evhttp_add_header(req->output_headers, "Content-Length", size);
+ }
+}
+
+/** Return true if the list of headers in 'headers', intepreted with respect
+ * to flags, means that we should send a "connection: close" when the request
+ * is done. */
+static int
+evhttp_is_connection_close(int flags, struct evkeyvalq* headers)
+{
+ if (flags & EVHTTP_PROXY_REQUEST) {
+ /* proxy connection */
+ const char *connection = evhttp_find_header(headers, "Proxy-Connection");
+ return (connection == NULL || evutil_ascii_strcasecmp(connection, "keep-alive") != 0);
+ } else {
+ const char *connection = evhttp_find_header(headers, "Connection");
+ return (connection != NULL && evutil_ascii_strcasecmp(connection, "close") == 0);
+ }
+}
+static int
+evhttp_is_request_connection_close(struct evhttp_request *req)
+{
+ return
+ evhttp_is_connection_close(req->flags, req->input_headers) ||
+ evhttp_is_connection_close(req->flags, req->output_headers);
+}
+
+/* Return true iff 'headers' contains 'Connection: keep-alive' */
+static int
+evhttp_is_connection_keepalive(struct evkeyvalq* headers)
+{
+ const char *connection = evhttp_find_header(headers, "Connection");
+ return (connection != NULL
+ && evutil_ascii_strncasecmp(connection, "keep-alive", 10) == 0);
+}
+
+/* Add a correct "Date" header to headers, unless it already has one. */
+static void
+evhttp_maybe_add_date_header(struct evkeyvalq *headers)
+{
+ if (evhttp_find_header(headers, "Date") == NULL) {
+ char date[50];
+#ifndef _WIN32
+ struct tm cur;
+#endif
+ struct tm *cur_p;
+ time_t t = time(NULL);
+#ifdef _WIN32
+ cur_p = gmtime(&t);
+#else
+ gmtime_r(&t, &cur);
+ cur_p = &cur;
+#endif
+ if (strftime(date, sizeof(date),
+ "%a, %d %b %Y %H:%M:%S GMT", cur_p) != 0) {
+ evhttp_add_header(headers, "Date", date);
+ }
+ }
+}
+
+/* Add a "Content-Length" header with value 'content_length' to headers,
+ * unless it already has a content-length or transfer-encoding header. */
+static void
+evhttp_maybe_add_content_length_header(struct evkeyvalq *headers,
+ size_t content_length)
+{
+ if (evhttp_find_header(headers, "Transfer-Encoding") == NULL &&
+ evhttp_find_header(headers, "Content-Length") == NULL) {
+ char len[22];
+ evutil_snprintf(len, sizeof(len), EV_SIZE_FMT,
+ EV_SIZE_ARG(content_length));
+ evhttp_add_header(headers, "Content-Length", len);
+ }
+}
+
+/*
+ * Create the headers needed for an HTTP reply in req->output_headers,
+ * and write the first HTTP response for req line to evcon.
+ */
+static void
+evhttp_make_header_response(struct evhttp_connection *evcon,
+ struct evhttp_request *req)
+{
+ int is_keepalive = evhttp_is_connection_keepalive(req->input_headers);
+ evbuffer_add_printf(bufferevent_get_output(evcon->bufev),
+ "HTTP/%d.%d %d %s\r\n",
+ req->major, req->minor, req->response_code,
+ req->response_code_line);
+
+ if (req->major == 1) {
+ if (req->minor >= 1)
+ evhttp_maybe_add_date_header(req->output_headers);
+
+ /*
+ * if the protocol is 1.0; and the connection was keep-alive
+ * we need to add a keep-alive header, too.
+ */
+ if (req->minor == 0 && is_keepalive)
+ evhttp_add_header(req->output_headers,
+ "Connection", "keep-alive");
+
+ if ((req->minor >= 1 || is_keepalive) &&
+ evhttp_response_needs_body(req)) {
+ /*
+ * we need to add the content length if the
+ * user did not give it, this is required for
+ * persistent connections to work.
+ */
+ evhttp_maybe_add_content_length_header(
+ req->output_headers,
+ evbuffer_get_length(req->output_buffer));
+ }
+ }
+
+ /* Potentially add headers for unidentified content. */
+ if (evhttp_response_needs_body(req)) {
+ if (evhttp_find_header(req->output_headers,
+ "Content-Type") == NULL
+ && evcon->http_server->default_content_type) {
+ evhttp_add_header(req->output_headers,
+ "Content-Type",
+ evcon->http_server->default_content_type);
+ }
+ }
+
+ /* if the request asked for a close, we send a close, too */
+ if (evhttp_is_connection_close(req->flags, req->input_headers)) {
+ evhttp_remove_header(req->output_headers, "Connection");
+ if (!(req->flags & EVHTTP_PROXY_REQUEST))
+ evhttp_add_header(req->output_headers, "Connection", "close");
+ evhttp_remove_header(req->output_headers, "Proxy-Connection");
+ }
+}
+
+/** Generate all headers appropriate for sending the http request in req (or
+ * the response, if we're sending a response), and write them to evcon's
+ * bufferevent. Also writes all data from req->output_buffer */
+static void
+evhttp_make_header(struct evhttp_connection *evcon, struct evhttp_request *req)
+{
+ struct evkeyval *header;
+ struct evbuffer *output = bufferevent_get_output(evcon->bufev);
+
+ /*
+ * Depending if this is a HTTP request or response, we might need to
+ * add some new headers or remove existing headers.
+ */
+ if (req->kind == EVHTTP_REQUEST) {
+ evhttp_make_header_request(evcon, req);
+ } else {
+ evhttp_make_header_response(evcon, req);
+ }
+
+ TAILQ_FOREACH(header, req->output_headers, next) {
+ evbuffer_add_printf(output, "%s: %s\r\n",
+ header->key, header->value);
+ }
+ evbuffer_add(output, "\r\n", 2);
+
+ if (evbuffer_get_length(req->output_buffer) > 0) {
+ /*
+ * For a request, we add the POST data, for a reply, this
+ * is the regular data.
+ */
+ /* XXX We might want to support waiting (a limited amount of
+ time) for a continue status line from the server before
+ sending POST/PUT message bodies. */
+ evbuffer_add_buffer(output, req->output_buffer);
+ }
+}
+
+void
+evhttp_connection_set_max_headers_size(struct evhttp_connection *evcon,
+ ev_ssize_t new_max_headers_size)
+{
+ if (new_max_headers_size<0)
+ evcon->max_headers_size = EV_SIZE_MAX;
+ else
+ evcon->max_headers_size = new_max_headers_size;
+}
+void
+evhttp_connection_set_max_body_size(struct evhttp_connection* evcon,
+ ev_ssize_t new_max_body_size)
+{
+ if (new_max_body_size<0)
+ evcon->max_body_size = EV_UINT64_MAX;
+ else
+ evcon->max_body_size = new_max_body_size;
+}
+
+static int
+evhttp_connection_incoming_fail(struct evhttp_request *req,
+ enum evhttp_request_error error)
+{
+ switch (error) {
+ case EVREQ_HTTP_TIMEOUT:
+ case EVREQ_HTTP_EOF:
+ /*
+ * these are cases in which we probably should just
+ * close the connection and not send a reply. this
+ * case may happen when a browser keeps a persistent
+ * connection open and we timeout on the read. when
+ * the request is still being used for sending, we
+ * need to disassociated it from the connection here.
+ */
+ if (!req->userdone) {
+ /* remove it so that it will not be freed */
+ TAILQ_REMOVE(&req->evcon->requests, req, next);
+ /* indicate that this request no longer has a
+ * connection object
+ */
+ req->evcon = NULL;
+ }
+ return (-1);
+ case EVREQ_HTTP_INVALID_HEADER:
+ case EVREQ_HTTP_BUFFER_ERROR:
+ case EVREQ_HTTP_REQUEST_CANCEL:
+ case EVREQ_HTTP_DATA_TOO_LONG:
+ default: /* xxx: probably should just error on default */
+ /* the callback looks at the uri to determine errors */
+ if (req->uri) {
+ mm_free(req->uri);
+ req->uri = NULL;
+ }
+ if (req->uri_elems) {
+ evhttp_uri_free(req->uri_elems);
+ req->uri_elems = NULL;
+ }
+
+ /*
+ * the callback needs to send a reply, once the reply has
+ * been send, the connection should get freed.
+ */
+ (*req->cb)(req, req->cb_arg);
+ }
+
+ return (0);
+}
+
+/* Free connection ownership of which can be acquired by user using
+ * evhttp_request_own(). */
+static inline void
+evhttp_request_free_auto(struct evhttp_request *req)
+{
+ if (!(req->flags & EVHTTP_USER_OWNED))
+ evhttp_request_free(req);
+}
+
+static void
+evhttp_request_free_(struct evhttp_connection *evcon, struct evhttp_request *req)
+{
+ TAILQ_REMOVE(&evcon->requests, req, next);
+ evhttp_request_free_auto(req);
+}
+
+/* Called when evcon has experienced a (non-recoverable? -NM) error, as
+ * given in error. If it's an outgoing connection, reset the connection,
+ * retry any pending requests, and inform the user. If it's incoming,
+ * delegates to evhttp_connection_incoming_fail(). */
+void
+evhttp_connection_fail_(struct evhttp_connection *evcon,
+ enum evhttp_request_error error)
+{
+ const int errsave = EVUTIL_SOCKET_ERROR();
+ struct evhttp_request* req = TAILQ_FIRST(&evcon->requests);
+ void (*cb)(struct evhttp_request *, void *);
+ void *cb_arg;
+ void (*error_cb)(enum evhttp_request_error, void *);
+ void *error_cb_arg;
+ EVUTIL_ASSERT(req != NULL);
+
+ bufferevent_disable(evcon->bufev, EV_READ|EV_WRITE);
+
+ if (evcon->flags & EVHTTP_CON_INCOMING) {
+ /*
+ * for incoming requests, there are two different
+ * failure cases. it's either a network level error
+ * or an http layer error. for problems on the network
+ * layer like timeouts we just drop the connections.
+ * For HTTP problems, we might have to send back a
+ * reply before the connection can be freed.
+ */
+ if (evhttp_connection_incoming_fail(req, error) == -1)
+ evhttp_connection_free(evcon);
+ return;
+ }
+
+ error_cb = req->error_cb;
+ error_cb_arg = req->cb_arg;
+ /* when the request was canceled, the callback is not executed */
+ if (error != EVREQ_HTTP_REQUEST_CANCEL) {
+ /* save the callback for later; the cb might free our object */
+ cb = req->cb;
+ cb_arg = req->cb_arg;
+ } else {
+ cb = NULL;
+ cb_arg = NULL;
+ }
+
+ /* do not fail all requests; the next request is going to get
+ * send over a new connection. when a user cancels a request,
+ * all other pending requests should be processed as normal
+ */
+ evhttp_request_free_(evcon, req);
+
+ /* reset the connection */
+ evhttp_connection_reset_(evcon);
+
+ /* We are trying the next request that was queued on us */
+ if (TAILQ_FIRST(&evcon->requests) != NULL)
+ evhttp_connection_connect_(evcon);
+
+ /* The call to evhttp_connection_reset_ overwrote errno.
+ * Let's restore the original errno, so that the user's
+ * callback can have a better idea of what the error was.
+ */
+ EVUTIL_SET_SOCKET_ERROR(errsave);
+
+ /* inform the user */
+ if (error_cb != NULL)
+ error_cb(error, error_cb_arg);
+ if (cb != NULL)
+ (*cb)(NULL, cb_arg);
+}
+
+/* Bufferevent callback: invoked when any data has been written from an
+ * http connection's bufferevent */
+static void
+evhttp_write_cb(struct bufferevent *bufev, void *arg)
+{
+ struct evhttp_connection *evcon = arg;
+
+ /* Activate our call back */
+ if (evcon->cb != NULL)
+ (*evcon->cb)(evcon, evcon->cb_arg);
+}
+
+/**
+ * Advance the connection state.
+ * - If this is an outgoing connection, we've just processed the response;
+ * idle or close the connection.
+ * - If this is an incoming connection, we've just processed the request;
+ * respond.
+ */
+static void
+evhttp_connection_done(struct evhttp_connection *evcon)
+{
+ struct evhttp_request *req = TAILQ_FIRST(&evcon->requests);
+ int con_outgoing = evcon->flags & EVHTTP_CON_OUTGOING;
+ int free_evcon = 0;
+
+ if (con_outgoing) {
+ /* idle or close the connection */
+ int need_close = evhttp_is_request_connection_close(req);
+ TAILQ_REMOVE(&evcon->requests, req, next);
+ req->evcon = NULL;
+
+ evcon->state = EVCON_IDLE;
+
+ /* check if we got asked to close the connection */
+ if (need_close)
+ evhttp_connection_reset_(evcon);
+
+ if (TAILQ_FIRST(&evcon->requests) != NULL) {
+ /*
+ * We have more requests; reset the connection
+ * and deal with the next request.
+ */
+ if (!evhttp_connected(evcon))
+ evhttp_connection_connect_(evcon);
+ else
+ evhttp_request_dispatch(evcon);
+ } else if (!need_close) {
+ /*
+ * The connection is going to be persistent, but we
+ * need to detect if the other side closes it.
+ */
+ evhttp_connection_start_detectclose(evcon);
+ } else if ((evcon->flags & EVHTTP_CON_AUTOFREE)) {
+ /*
+ * If we have no more requests that need completion
+ * and we're not waiting for the connection to close
+ */
+ free_evcon = 1;
+ }
+ } else {
+ /*
+ * incoming connection - we need to leave the request on the
+ * connection so that we can reply to it.
+ */
+ evcon->state = EVCON_WRITING;
+ }
+
+ /* notify the user of the request */
+ (*req->cb)(req, req->cb_arg);
+
+ /* if this was an outgoing request, we own and it's done. so free it. */
+ if (con_outgoing) {
+ evhttp_request_free_auto(req);
+ }
+
+ /* If this was the last request of an outgoing connection and we're
+ * not waiting to receive a connection close event and we want to
+ * automatically free the connection. We check to ensure our request
+ * list is empty one last time just in case our callback added a
+ * new request.
+ */
+ if (free_evcon && TAILQ_FIRST(&evcon->requests) == NULL) {
+ evhttp_connection_free(evcon);
+ }
+}
+
+/*
+ * Handles reading from a chunked request.
+ * return ALL_DATA_READ:
+ * all data has been read
+ * return MORE_DATA_EXPECTED:
+ * more data is expected
+ * return DATA_CORRUPTED:
+ * data is corrupted
+ * return REQUEST_CANCELED:
+ * request was canceled by the user calling evhttp_cancel_request
+ * return DATA_TOO_LONG:
+ * ran over the maximum limit
+ */
+
+static enum message_read_status
+evhttp_handle_chunked_read(struct evhttp_request *req, struct evbuffer *buf)
+{
+ if (req == NULL || buf == NULL) {
+ return DATA_CORRUPTED;
+ }
+
+ while (1) {
+ size_t buflen;
+
+ if ((buflen = evbuffer_get_length(buf)) == 0) {
+ break;
+ }
+
+ /* evbuffer_get_length returns size_t, but len variable is ssize_t,
+ * check for overflow conditions */
+ if (buflen > EV_SSIZE_MAX) {
+ return DATA_CORRUPTED;
+ }
+
+ if (req->ntoread < 0) {
+ /* Read chunk size */
+ ev_int64_t ntoread;
+ char *p = evbuffer_readln(buf, NULL, EVBUFFER_EOL_CRLF);
+ char *endp;
+ int error;
+ if (p == NULL)
+ break;
+ /* the last chunk is on a new line? */
+ if (strlen(p) == 0) {
+ mm_free(p);
+ continue;
+ }
+ ntoread = evutil_strtoll(p, &endp, 16);
+ error = (*p == '\0' ||
+ (*endp != '\0' && *endp != ' ') ||
+ ntoread < 0);
+ mm_free(p);
+ if (error) {
+ /* could not get chunk size */
+ return (DATA_CORRUPTED);
+ }
+
+ /* ntoread is signed int64, body_size is unsigned size_t, check for under/overflow conditions */
+ if ((ev_uint64_t)ntoread > EV_SIZE_MAX - req->body_size) {
+ return DATA_CORRUPTED;
+ }
+
+ if (req->body_size + (size_t)ntoread > req->evcon->max_body_size) {
+ /* failed body length test */
+ event_debug(("Request body is too long"));
+ return (DATA_TOO_LONG);
+ }
+
+ req->body_size += (size_t)ntoread;
+ req->ntoread = ntoread;
+ if (req->ntoread == 0) {
+ /* Last chunk */
+ return (ALL_DATA_READ);
+ }
+ continue;
+ }
+
+ /* req->ntoread is signed int64, len is ssize_t, based on arch,
+ * ssize_t could only be 32b, check for these conditions */
+ if (req->ntoread > EV_SSIZE_MAX) {
+ return DATA_CORRUPTED;
+ }
+
+ /* don't have enough to complete a chunk; wait for more */
+ if (req->ntoread > 0 && buflen < (ev_uint64_t)req->ntoread)
+ return (MORE_DATA_EXPECTED);
+
+ /* Completed chunk */
+ evbuffer_remove_buffer(buf, req->input_buffer, (size_t)req->ntoread);
+ req->ntoread = -1;
+ if (req->chunk_cb != NULL) {
+ req->flags |= EVHTTP_REQ_DEFER_FREE;
+ (*req->chunk_cb)(req, req->cb_arg);
+ evbuffer_drain(req->input_buffer,
+ evbuffer_get_length(req->input_buffer));
+ req->flags &= ~EVHTTP_REQ_DEFER_FREE;
+ if ((req->flags & EVHTTP_REQ_NEEDS_FREE) != 0) {
+ return (REQUEST_CANCELED);
+ }
+ }
+ }
+
+ return (MORE_DATA_EXPECTED);
+}
+
+static void
+evhttp_read_trailer(struct evhttp_connection *evcon, struct evhttp_request *req)
+{
+ struct evbuffer *buf = bufferevent_get_input(evcon->bufev);
+
+ switch (evhttp_parse_headers_(req, buf)) {
+ case DATA_CORRUPTED:
+ case DATA_TOO_LONG:
+ evhttp_connection_fail_(evcon, EVREQ_HTTP_DATA_TOO_LONG);
+ break;
+ case ALL_DATA_READ:
+ bufferevent_disable(evcon->bufev, EV_READ);
+ evhttp_connection_done(evcon);
+ break;
+ case MORE_DATA_EXPECTED:
+ case REQUEST_CANCELED: /* ??? */
+ default:
+ break;
+ }
+}
+
+static void
+evhttp_read_body(struct evhttp_connection *evcon, struct evhttp_request *req)
+{
+ struct evbuffer *buf = bufferevent_get_input(evcon->bufev);
+
+ if (req->chunked) {
+ switch (evhttp_handle_chunked_read(req, buf)) {
+ case ALL_DATA_READ:
+ /* finished last chunk */
+ evcon->state = EVCON_READING_TRAILER;
+ evhttp_read_trailer(evcon, req);
+ return;
+ case DATA_CORRUPTED:
+ case DATA_TOO_LONG:
+ /* corrupted data */
+ evhttp_connection_fail_(evcon,
+ EVREQ_HTTP_DATA_TOO_LONG);
+ return;
+ case REQUEST_CANCELED:
+ /* request canceled */
+ evhttp_request_free_auto(req);
+ return;
+ case MORE_DATA_EXPECTED:
+ default:
+ break;
+ }
+ } else if (req->ntoread < 0) {
+ /* Read until connection close. */
+ if ((size_t)(req->body_size + evbuffer_get_length(buf)) < req->body_size) {
+ evhttp_connection_fail_(evcon, EVREQ_HTTP_INVALID_HEADER);
+ return;
+ }
+
+ req->body_size += evbuffer_get_length(buf);
+ evbuffer_add_buffer(req->input_buffer, buf);
+ } else if (req->chunk_cb != NULL || evbuffer_get_length(buf) >= (size_t)req->ntoread) {
+ /* XXX: the above get_length comparison has to be fixed for overflow conditions! */
+ /* We've postponed moving the data until now, but we're
+ * about to use it. */
+ size_t n = evbuffer_get_length(buf);
+
+ if (n > (size_t) req->ntoread)
+ n = (size_t) req->ntoread;
+ req->ntoread -= n;
+ req->body_size += n;
+ evbuffer_remove_buffer(buf, req->input_buffer, n);
+ }
+
+ if (req->body_size > req->evcon->max_body_size ||
+ (!req->chunked && req->ntoread >= 0 &&
+ (size_t)req->ntoread > req->evcon->max_body_size)) {
+ /* XXX: The above casted comparison must checked for overflow */
+ /* failed body length test */
+ event_debug(("Request body is too long"));
+ evhttp_connection_fail_(evcon,
+ EVREQ_HTTP_DATA_TOO_LONG);
+ return;
+ }
+
+ if (evbuffer_get_length(req->input_buffer) > 0 && req->chunk_cb != NULL) {
+ req->flags |= EVHTTP_REQ_DEFER_FREE;
+ (*req->chunk_cb)(req, req->cb_arg);
+ req->flags &= ~EVHTTP_REQ_DEFER_FREE;
+ evbuffer_drain(req->input_buffer,
+ evbuffer_get_length(req->input_buffer));
+ if ((req->flags & EVHTTP_REQ_NEEDS_FREE) != 0) {
+ evhttp_request_free_auto(req);
+ return;
+ }
+ }
+
+ if (req->ntoread == 0) {
+ bufferevent_disable(evcon->bufev, EV_READ);
+ /* Completed content length */
+ evhttp_connection_done(evcon);
+ return;
+ }
+}
+
+#define get_deferred_queue(evcon) \
+ ((evcon)->base)
+
+/*
+ * Gets called when more data becomes available
+ */
+
+static void
+evhttp_read_cb(struct bufferevent *bufev, void *arg)
+{
+ struct evhttp_connection *evcon = arg;
+ struct evhttp_request *req = TAILQ_FIRST(&evcon->requests);
+
+ /* Cancel if it's pending. */
+ event_deferred_cb_cancel_(get_deferred_queue(evcon),
+ &evcon->read_more_deferred_cb);
+
+ switch (evcon->state) {
+ case EVCON_READING_FIRSTLINE:
+ evhttp_read_firstline(evcon, req);
+ /* note the request may have been freed in
+ * evhttp_read_body */
+ break;
+ case EVCON_READING_HEADERS:
+ evhttp_read_header(evcon, req);
+ /* note the request may have been freed in
+ * evhttp_read_body */
+ break;
+ case EVCON_READING_BODY:
+ evhttp_read_body(evcon, req);
+ /* note the request may have been freed in
+ * evhttp_read_body */
+ break;
+ case EVCON_READING_TRAILER:
+ evhttp_read_trailer(evcon, req);
+ break;
+ case EVCON_IDLE:
+ {
+#ifdef USE_DEBUG
+ struct evbuffer *input;
+ size_t total_len;
+
+ input = bufferevent_get_input(evcon->bufev);
+ total_len = evbuffer_get_length(input);
+ event_debug(("%s: read "EV_SIZE_FMT
+ " bytes in EVCON_IDLE state,"
+ " resetting connection",
+ __func__, EV_SIZE_ARG(total_len)));
+#endif
+
+ evhttp_connection_reset_(evcon);
+ }
+ break;
+ case EVCON_DISCONNECTED:
+ case EVCON_CONNECTING:
+ case EVCON_WRITING:
+ default:
+ event_errx(1, "%s: illegal connection state %d",
+ __func__, evcon->state);
+ }
+}
+
+static void
+evhttp_deferred_read_cb(struct event_callback *cb, void *data)
+{
+ struct evhttp_connection *evcon = data;
+ evhttp_read_cb(evcon->bufev, evcon);
+}
+
+static void
+evhttp_write_connectioncb(struct evhttp_connection *evcon, void *arg)
+{
+ /* This is after writing the request to the server */
+ struct evhttp_request *req = TAILQ_FIRST(&evcon->requests);
+ EVUTIL_ASSERT(req != NULL);
+
+ EVUTIL_ASSERT(evcon->state == EVCON_WRITING);
+
+ /* We need to wait until we've written all of our output data before we can continue */
+ if (evbuffer_get_length(bufferevent_get_output(evcon->bufev)) > 0) { return; }
+
+ /* We are done writing our header and are now expecting the response */
+ req->kind = EVHTTP_RESPONSE;
+
+ evhttp_start_read_(evcon);
+}
+
+/*
+ * Clean up a connection object
+ */
+
+void
+evhttp_connection_free(struct evhttp_connection *evcon)
+{
+ struct evhttp_request *req;
+
+ /* notify interested parties that this connection is going down */
+ if (evcon->fd != -1) {
+ if (evhttp_connected(evcon) && evcon->closecb != NULL)
+ (*evcon->closecb)(evcon, evcon->closecb_arg);
+ }
+
+ /* remove all requests that might be queued on this
+ * connection. for server connections, this should be empty.
+ * because it gets dequeued either in evhttp_connection_done or
+ * evhttp_connection_fail_.
+ */
+ while ((req = TAILQ_FIRST(&evcon->requests)) != NULL) {
+ evhttp_request_free_(evcon, req);
+ }
+
+ if (evcon->http_server != NULL) {
+ struct evhttp *http = evcon->http_server;
+ TAILQ_REMOVE(&http->connections, evcon, next);
+ }
+
+ if (event_initialized(&evcon->retry_ev)) {
+ event_del(&evcon->retry_ev);
+ event_debug_unassign(&evcon->retry_ev);
+ }
+
+ if (evcon->bufev != NULL)
+ bufferevent_free(evcon->bufev);
+
+ event_deferred_cb_cancel_(get_deferred_queue(evcon),
+ &evcon->read_more_deferred_cb);
+
+ if (evcon->fd != -1) {
+ bufferevent_disable(evcon->bufev, EV_READ|EV_WRITE);
+ shutdown(evcon->fd, EVUTIL_SHUT_WR);
+ if (!(bufferevent_get_options_(evcon->bufev) & BEV_OPT_CLOSE_ON_FREE)) {
+ evutil_closesocket(evcon->fd);
+ }
+ }
+
+ if (evcon->bind_address != NULL)
+ mm_free(evcon->bind_address);
+
+ if (evcon->address != NULL)
+ mm_free(evcon->address);
+
+ mm_free(evcon);
+}
+
+void
+evhttp_connection_free_on_completion(struct evhttp_connection *evcon) {
+ evcon->flags |= EVHTTP_CON_AUTOFREE;
+}
+
+void
+evhttp_connection_set_local_address(struct evhttp_connection *evcon,
+ const char *address)
+{
+ EVUTIL_ASSERT(evcon->state == EVCON_DISCONNECTED);
+ if (evcon->bind_address)
+ mm_free(evcon->bind_address);
+ if ((evcon->bind_address = mm_strdup(address)) == NULL)
+ event_warn("%s: strdup", __func__);
+}
+
+void
+evhttp_connection_set_local_port(struct evhttp_connection *evcon,
+ ev_uint16_t port)
+{
+ EVUTIL_ASSERT(evcon->state == EVCON_DISCONNECTED);
+ evcon->bind_port = port;
+}
+
+static void
+evhttp_request_dispatch(struct evhttp_connection* evcon)
+{
+ struct evhttp_request *req = TAILQ_FIRST(&evcon->requests);
+
+ /* this should not usually happy but it's possible */
+ if (req == NULL)
+ return;
+
+ /* delete possible close detection events */
+ evhttp_connection_stop_detectclose(evcon);
+
+ /* we assume that the connection is connected already */
+ EVUTIL_ASSERT(evcon->state == EVCON_IDLE);
+
+ evcon->state = EVCON_WRITING;
+
+ /* Create the header from the store arguments */
+ evhttp_make_header(evcon, req);
+
+ evhttp_write_buffer(evcon, evhttp_write_connectioncb, NULL);
+}
+
+/* Reset our connection state: disables reading/writing, closes our fd (if
+* any), clears out buffers, and puts us in state DISCONNECTED. */
+void
+evhttp_connection_reset_(struct evhttp_connection *evcon)
+{
+ struct evbuffer *tmp;
+
+ /* XXXX This is not actually an optimal fix. Instead we ought to have
+ an API for "stop connecting", or use bufferevent_setfd to turn off
+ connecting. But for Libevent 2.0, this seems like a minimal change
+ least likely to disrupt the rest of the bufferevent and http code.
+
+ Why is this here? If the fd is set in the bufferevent, and the
+ bufferevent is connecting, then you can't actually stop the
+ bufferevent from trying to connect with bufferevent_disable(). The
+ connect will never trigger, since we close the fd, but the timeout
+ might. That caused an assertion failure in evhttp_connection_fail_.
+ */
+ bufferevent_disable_hard_(evcon->bufev, EV_READ|EV_WRITE);
+
+ if (evcon->fd != -1) {
+ /* inform interested parties about connection close */
+ if (evhttp_connected(evcon) && evcon->closecb != NULL)
+ (*evcon->closecb)(evcon, evcon->closecb_arg);
+
+ shutdown(evcon->fd, EVUTIL_SHUT_WR);
+ evutil_closesocket(evcon->fd);
+ bufferevent_setfd(evcon->bufev, -1);
+ evcon->fd = -1;
+ }
+
+ /* we need to clean up any buffered data */
+ tmp = bufferevent_get_output(evcon->bufev);
+ evbuffer_drain(tmp, evbuffer_get_length(tmp));
+ tmp = bufferevent_get_input(evcon->bufev);
+ evbuffer_drain(tmp, evbuffer_get_length(tmp));
+
+ evcon->state = EVCON_DISCONNECTED;
+}
+
+static void
+evhttp_connection_start_detectclose(struct evhttp_connection *evcon)
+{
+ evcon->flags |= EVHTTP_CON_CLOSEDETECT;
+
+ bufferevent_enable(evcon->bufev, EV_READ);
+}
+
+static void
+evhttp_connection_stop_detectclose(struct evhttp_connection *evcon)
+{
+ evcon->flags &= ~EVHTTP_CON_CLOSEDETECT;
+
+ bufferevent_disable(evcon->bufev, EV_READ);
+}
+
+static void
+evhttp_connection_retry(evutil_socket_t fd, short what, void *arg)
+{
+ struct evhttp_connection *evcon = arg;
+
+ evcon->state = EVCON_DISCONNECTED;
+ evhttp_connection_connect_(evcon);
+}
+
+static void
+evhttp_connection_cb_cleanup(struct evhttp_connection *evcon)
+{
+ struct evcon_requestq requests;
+
+ evhttp_connection_reset_(evcon);
+ if (evcon->retry_max < 0 || evcon->retry_cnt < evcon->retry_max) {
+ struct timeval tv_retry = evcon->initial_retry_timeout;
+ int i;
+ evtimer_assign(&evcon->retry_ev, evcon->base, evhttp_connection_retry, evcon);
+ /* XXXX handle failure from evhttp_add_event */
+ for (i=0; i < evcon->retry_cnt; ++i) {
+ tv_retry.tv_usec *= 2;
+ if (tv_retry.tv_usec > 1000000) {
+ tv_retry.tv_usec -= 1000000;
+ tv_retry.tv_sec += 1;
+ }
+ tv_retry.tv_sec *= 2;
+ if (tv_retry.tv_sec > 3600) {
+ tv_retry.tv_sec = 3600;
+ tv_retry.tv_usec = 0;
+ }
+ }
+ event_add(&evcon->retry_ev, &tv_retry);
+ evcon->retry_cnt++;
+ return;
+ }
+
+ /*
+ * User callback can do evhttp_make_request() on the same
+ * evcon so new request will be added to evcon->requests. To
+ * avoid freeing it prematurely we iterate over the copy of
+ * the queue.
+ */
+ TAILQ_INIT(&requests);
+ while (TAILQ_FIRST(&evcon->requests) != NULL) {
+ struct evhttp_request *request = TAILQ_FIRST(&evcon->requests);
+ TAILQ_REMOVE(&evcon->requests, request, next);
+ TAILQ_INSERT_TAIL(&requests, request, next);
+ }
+
+ /* for now, we just signal all requests by executing their callbacks */
+ while (TAILQ_FIRST(&requests) != NULL) {
+ struct evhttp_request *request = TAILQ_FIRST(&requests);
+ TAILQ_REMOVE(&requests, request, next);
+ request->evcon = NULL;
+
+ /* we might want to set an error here */
+ request->cb(request, request->cb_arg);
+ evhttp_request_free_auto(request);
+ }
+}
+
+static void
+evhttp_error_cb(struct bufferevent *bufev, short what, void *arg)
+{
+ struct evhttp_connection *evcon = arg;
+ struct evhttp_request *req = TAILQ_FIRST(&evcon->requests);
+
+ if (evcon->fd == -1)
+ evcon->fd = bufferevent_getfd(bufev);
+
+ switch (evcon->state) {
+ case EVCON_CONNECTING:
+ if (what & BEV_EVENT_TIMEOUT) {
+ event_debug(("%s: connection timeout for \"%s:%d\" on "
+ EV_SOCK_FMT,
+ __func__, evcon->address, evcon->port,
+ EV_SOCK_ARG(evcon->fd)));
+ evhttp_connection_cb_cleanup(evcon);
+ return;
+ }
+ break;
+
+ case EVCON_READING_BODY:
+ if (!req->chunked && req->ntoread < 0
+ && what == (BEV_EVENT_READING|BEV_EVENT_EOF)) {
+ /* EOF on read can be benign */
+ evhttp_connection_done(evcon);
+ return;
+ }
+ break;
+
+ case EVCON_DISCONNECTED:
+ case EVCON_IDLE:
+ case EVCON_READING_FIRSTLINE:
+ case EVCON_READING_HEADERS:
+ case EVCON_READING_TRAILER:
+ case EVCON_WRITING:
+ default:
+ break;
+ }
+
+ /* when we are in close detect mode, a read error means that
+ * the other side closed their connection.
+ */
+ if (evcon->flags & EVHTTP_CON_CLOSEDETECT) {
+ evcon->flags &= ~EVHTTP_CON_CLOSEDETECT;
+ EVUTIL_ASSERT(evcon->http_server == NULL);
+ /* For connections from the client, we just
+ * reset the connection so that it becomes
+ * disconnected.
+ */
+ EVUTIL_ASSERT(evcon->state == EVCON_IDLE);
+ evhttp_connection_reset_(evcon);
+
+ /*
+ * If we have no more requests that need completion
+ * and we want to auto-free the connection when all
+ * requests have been completed.
+ */
+ if (TAILQ_FIRST(&evcon->requests) == NULL
+ && (evcon->flags & EVHTTP_CON_OUTGOING)
+ && (evcon->flags & EVHTTP_CON_AUTOFREE)) {
+ evhttp_connection_free(evcon);
+ }
+ return;
+ }
+
+ if (what & BEV_EVENT_TIMEOUT) {
+ evhttp_connection_fail_(evcon, EVREQ_HTTP_TIMEOUT);
+ } else if (what & (BEV_EVENT_EOF|BEV_EVENT_ERROR)) {
+ evhttp_connection_fail_(evcon, EVREQ_HTTP_EOF);
+ } else if (what == BEV_EVENT_CONNECTED) {
+ } else {
+ evhttp_connection_fail_(evcon, EVREQ_HTTP_BUFFER_ERROR);
+ }
+}
+
+/*
+ * Event callback for asynchronous connection attempt.
+ */
+static void
+evhttp_connection_cb(struct bufferevent *bufev, short what, void *arg)
+{
+ struct evhttp_connection *evcon = arg;
+ int error;
+ ev_socklen_t errsz = sizeof(error);
+
+ if (evcon->fd == -1)
+ evcon->fd = bufferevent_getfd(bufev);
+
+ if (!(what & BEV_EVENT_CONNECTED)) {
+ /* some operating systems return ECONNREFUSED immediately
+ * when connecting to a local address. the cleanup is going
+ * to reschedule this function call.
+ */
+#ifndef _WIN32
+ if (errno == ECONNREFUSED)
+ goto cleanup;
+#endif
+ evhttp_error_cb(bufev, what, arg);
+ return;
+ }
+
+ if (evcon->fd == -1) {
+ event_debug(("%s: bufferevent_getfd returned -1",
+ __func__));
+ goto cleanup;
+ }
+
+ /* Check if the connection completed */
+ if (getsockopt(evcon->fd, SOL_SOCKET, SO_ERROR, (void*)&error,
+ &errsz) == -1) {
+ event_debug(("%s: getsockopt for \"%s:%d\" on "EV_SOCK_FMT,
+ __func__, evcon->address, evcon->port,
+ EV_SOCK_ARG(evcon->fd)));
+ goto cleanup;
+ }
+
+ if (error) {
+ event_debug(("%s: connect failed for \"%s:%d\" on "
+ EV_SOCK_FMT": %s",
+ __func__, evcon->address, evcon->port,
+ EV_SOCK_ARG(evcon->fd),
+ evutil_socket_error_to_string(error)));
+ goto cleanup;
+ }
+
+ /* We are connected to the server now */
+ event_debug(("%s: connected to \"%s:%d\" on "EV_SOCK_FMT"\n",
+ __func__, evcon->address, evcon->port,
+ EV_SOCK_ARG(evcon->fd)));
+
+ /* Reset the retry count as we were successful in connecting */
+ evcon->retry_cnt = 0;
+ evcon->state = EVCON_IDLE;
+
+ /* reset the bufferevent cbs */
+ bufferevent_setcb(evcon->bufev,
+ evhttp_read_cb,
+ evhttp_write_cb,
+ evhttp_error_cb,
+ evcon);
+
+ if (!evutil_timerisset(&evcon->timeout)) {
+ const struct timeval read_tv = { HTTP_READ_TIMEOUT, 0 };
+ const struct timeval write_tv = { HTTP_WRITE_TIMEOUT, 0 };
+ bufferevent_set_timeouts(evcon->bufev, &read_tv, &write_tv);
+ } else {
+ bufferevent_set_timeouts(evcon->bufev, &evcon->timeout, &evcon->timeout);
+ }
+
+ /* try to start requests that have queued up on this connection */
+ evhttp_request_dispatch(evcon);
+ return;
+
+ cleanup:
+ evhttp_connection_cb_cleanup(evcon);
+}
+
+/*
+ * Check if we got a valid response code.
+ */
+
+static int
+evhttp_valid_response_code(int code)
+{
+ if (code == 0)
+ return (0);
+
+ return (1);
+}
+
+static int
+evhttp_parse_http_version(const char *version, struct evhttp_request *req)
+{
+ int major, minor;
+ char ch;
+ int n = sscanf(version, "HTTP/%d.%d%c", &major, &minor, &ch);
+ if (n != 2 || major > 1) {
+ event_debug(("%s: bad version %s on message %p from %s",
+ __func__, version, req, req->remote_host));
+ return (-1);
+ }
+ req->major = major;
+ req->minor = minor;
+ return (0);
+}
+
+/* Parses the status line of a web server */
+
+static int
+evhttp_parse_response_line(struct evhttp_request *req, char *line)
+{
+ char *protocol;
+ char *number;
+ const char *readable = "";
+
+ protocol = strsep(&line, " ");
+ if (line == NULL)
+ return (-1);
+ number = strsep(&line, " ");
+ if (line != NULL)
+ readable = line;
+
+ if (evhttp_parse_http_version(protocol, req) < 0)
+ return (-1);
+
+ req->response_code = atoi(number);
+ if (!evhttp_valid_response_code(req->response_code)) {
+ event_debug(("%s: bad response code \"%s\"",
+ __func__, number));
+ return (-1);
+ }
+
+ if ((req->response_code_line = mm_strdup(readable)) == NULL) {
+ event_warn("%s: strdup", __func__);
+ return (-1);
+ }
+
+ return (0);
+}
+
+/* Parse the first line of a HTTP request */
+
+static int
+evhttp_parse_request_line(struct evhttp_request *req, char *line)
+{
+ char *method;
+ char *uri;
+ char *version;
+ const char *hostname;
+ const char *scheme;
+ size_t method_len;
+ enum evhttp_cmd_type type;
+
+ /* Parse the request line */
+ method = strsep(&line, " ");
+ if (line == NULL)
+ return (-1);
+ uri = strsep(&line, " ");
+ if (line == NULL)
+ return (-1);
+ version = strsep(&line, " ");
+ if (line != NULL)
+ return (-1);
+
+ method_len = (uri - method) - 1;
+ type = EVHTTP_REQ_UNKNOWN_;
+
+ /* First line */
+ switch (method_len) {
+ case 3:
+ /* The length of the method string is 3, meaning it can only be one of two methods: GET or PUT */
+
+ /* Since both GET and PUT share the same character 'T' at the end,
+ * if the string doesn't have 'T', we can immediately determine this
+ * is an invalid HTTP method */
+
+ if (method[2] != 'T') {
+ break;
+ }
+
+ switch (*method) {
+ case 'G':
+ /* This first byte is 'G', so make sure the next byte is
+ * 'E', if it isn't then this isn't a valid method */
+
+ if (method[1] == 'E') {
+ type = EVHTTP_REQ_GET;
+ }
+
+ break;
+ case 'P':
+ /* First byte is P, check second byte for 'U', if not,
+ * we know it's an invalid method */
+ if (method[1] == 'U') {
+ type = EVHTTP_REQ_PUT;
+ }
+ break;
+ default:
+ break;
+ }
+ break;
+ case 4:
+ /* The method length is 4 bytes, leaving only the methods "POST" and "HEAD" */
+ switch (*method) {
+ case 'P':
+ if (method[3] == 'T' && method[2] == 'S' && method[1] == 'O') {
+ type = EVHTTP_REQ_POST;
+ }
+ break;
+ case 'H':
+ if (method[3] == 'D' && method[2] == 'A' && method[1] == 'E') {
+ type = EVHTTP_REQ_HEAD;
+ }
+ break;
+ default:
+ break;
+ }
+ break;
+ case 5:
+ /* Method length is 5 bytes, which can only encompass PATCH and TRACE */
+ switch (*method) {
+ case 'P':
+ if (method[4] == 'H' && method[3] == 'C' && method[2] == 'T' && method[1] == 'A') {
+ type = EVHTTP_REQ_PATCH;
+ }
+ break;
+ case 'T':
+ if (method[4] == 'E' && method[3] == 'C' && method[2] == 'A' && method[1] == 'R') {
+ type = EVHTTP_REQ_TRACE;
+ }
+
+ break;
+ default:
+ break;
+ }
+ break;
+ case 6:
+ /* Method length is 6, only valid method 6 bytes in length is DELEte */
+
+ /* If the first byte isn't 'D' then it's invalid */
+ if (*method != 'D') {
+ break;
+ }
+
+ if (method[5] == 'E' && method[4] == 'T' && method[3] == 'E' && method[2] == 'L' && method[1] == 'E') {
+ type = EVHTTP_REQ_DELETE;
+ }
+
+ break;
+ case 7:
+ /* Method length is 7, only valid methods are "OPTIONS" and "CONNECT" */
+ switch (*method) {
+ case 'O':
+ if (method[6] == 'S' && method[5] == 'N' && method[4] == 'O' &&
+ method[3] == 'I' && method[2] == 'T' && method[1] == 'P') {
+ type = EVHTTP_REQ_OPTIONS;
+ }
+
+ break;
+ case 'C':
+ if (method[6] == 'T' && method[5] == 'C' && method[4] == 'E' &&
+ method[3] == 'N' && method[2] == 'N' && method[1] == 'O') {
+ type = EVHTTP_REQ_CONNECT;
+ }
+
+ break;
+ default:
+ break;
+ }
+ break;
+ } /* switch */
+
+ if ((int)type == EVHTTP_REQ_UNKNOWN_) {
+ event_debug(("%s: bad method %s on request %p from %s",
+ __func__, method, req, req->remote_host));
+ /* No error yet; we'll give a better error later when
+ * we see that req->type is unsupported. */
+ }
+
+ req->type = type;
+
+ if (evhttp_parse_http_version(version, req) < 0)
+ return (-1);
+
+ if ((req->uri = mm_strdup(uri)) == NULL) {
+ event_debug(("%s: mm_strdup", __func__));
+ return (-1);
+ }
+
+ if ((req->uri_elems = evhttp_uri_parse_with_flags(req->uri,
+ EVHTTP_URI_NONCONFORMANT)) == NULL) {
+ return -1;
+ }
+
+ /* If we have an absolute-URI, check to see if it is an http request
+ for a known vhost or server alias. If we don't know about this
+ host, we consider it a proxy request. */
+ scheme = evhttp_uri_get_scheme(req->uri_elems);
+ hostname = evhttp_uri_get_host(req->uri_elems);
+ if (scheme && (!evutil_ascii_strcasecmp(scheme, "http") ||
+ !evutil_ascii_strcasecmp(scheme, "https")) &&
+ hostname &&
+ !evhttp_find_vhost(req->evcon->http_server, NULL, hostname))
+ req->flags |= EVHTTP_PROXY_REQUEST;
+
+ return (0);
+}
+
+const char *
+evhttp_find_header(const struct evkeyvalq *headers, const char *key)
+{
+ struct evkeyval *header;
+
+ TAILQ_FOREACH(header, headers, next) {
+ if (evutil_ascii_strcasecmp(header->key, key) == 0)
+ return (header->value);
+ }
+
+ return (NULL);
+}
+
+void
+evhttp_clear_headers(struct evkeyvalq *headers)
+{
+ struct evkeyval *header;
+
+ for (header = TAILQ_FIRST(headers);
+ header != NULL;
+ header = TAILQ_FIRST(headers)) {
+ TAILQ_REMOVE(headers, header, next);
+ mm_free(header->key);
+ mm_free(header->value);
+ mm_free(header);
+ }
+}
+
+/*
+ * Returns 0, if the header was successfully removed.
+ * Returns -1, if the header could not be found.
+ */
+
+int
+evhttp_remove_header(struct evkeyvalq *headers, const char *key)
+{
+ struct evkeyval *header;
+
+ TAILQ_FOREACH(header, headers, next) {
+ if (evutil_ascii_strcasecmp(header->key, key) == 0)
+ break;
+ }
+
+ if (header == NULL)
+ return (-1);
+
+ /* Free and remove the header that we found */
+ TAILQ_REMOVE(headers, header, next);
+ mm_free(header->key);
+ mm_free(header->value);
+ mm_free(header);
+
+ return (0);
+}
+
+static int
+evhttp_header_is_valid_value(const char *value)
+{
+ const char *p = value;
+
+ while ((p = strpbrk(p, "\r\n")) != NULL) {
+ /* we really expect only one new line */
+ p += strspn(p, "\r\n");
+ /* we expect a space or tab for continuation */
+ if (*p != ' ' && *p != '\t')
+ return (0);
+ }
+ return (1);
+}
+
+int
+evhttp_add_header(struct evkeyvalq *headers,
+ const char *key, const char *value)
+{
+ event_debug(("%s: key: %s val: %s\n", __func__, key, value));
+
+ if (strchr(key, '\r') != NULL || strchr(key, '\n') != NULL) {
+ /* drop illegal headers */
+ event_debug(("%s: dropping illegal header key\n", __func__));
+ return (-1);
+ }
+
+ if (!evhttp_header_is_valid_value(value)) {
+ event_debug(("%s: dropping illegal header value\n", __func__));
+ return (-1);
+ }
+
+ return (evhttp_add_header_internal(headers, key, value));
+}
+
+static int
+evhttp_add_header_internal(struct evkeyvalq *headers,
+ const char *key, const char *value)
+{
+ struct evkeyval *header = mm_calloc(1, sizeof(struct evkeyval));
+ if (header == NULL) {
+ event_warn("%s: calloc", __func__);
+ return (-1);
+ }
+ if ((header->key = mm_strdup(key)) == NULL) {
+ mm_free(header);
+ event_warn("%s: strdup", __func__);
+ return (-1);
+ }
+ if ((header->value = mm_strdup(value)) == NULL) {
+ mm_free(header->key);
+ mm_free(header);
+ event_warn("%s: strdup", __func__);
+ return (-1);
+ }
+
+ TAILQ_INSERT_TAIL(headers, header, next);
+
+ return (0);
+}
+
+/*
+ * Parses header lines from a request or a response into the specified
+ * request object given an event buffer.
+ *
+ * Returns
+ * DATA_CORRUPTED on error
+ * MORE_DATA_EXPECTED when we need to read more headers
+ * ALL_DATA_READ when all headers have been read.
+ */
+
+enum message_read_status
+evhttp_parse_firstline_(struct evhttp_request *req, struct evbuffer *buffer)
+{
+ char *line;
+ enum message_read_status status = ALL_DATA_READ;
+
+ size_t line_length;
+ /* XXX try */
+ line = evbuffer_readln(buffer, &line_length, EVBUFFER_EOL_CRLF);
+ if (line == NULL) {
+ if (req->evcon != NULL &&
+ evbuffer_get_length(buffer) > req->evcon->max_headers_size)
+ return (DATA_TOO_LONG);
+ else
+ return (MORE_DATA_EXPECTED);
+ }
+
+ if (req->evcon != NULL &&
+ line_length > req->evcon->max_headers_size) {
+ mm_free(line);
+ return (DATA_TOO_LONG);
+ }
+
+ req->headers_size = line_length;
+
+ switch (req->kind) {
+ case EVHTTP_REQUEST:
+ if (evhttp_parse_request_line(req, line) == -1)
+ status = DATA_CORRUPTED;
+ break;
+ case EVHTTP_RESPONSE:
+ if (evhttp_parse_response_line(req, line) == -1)
+ status = DATA_CORRUPTED;
+ break;
+ default:
+ status = DATA_CORRUPTED;
+ }
+
+ mm_free(line);
+ return (status);
+}
+
+static int
+evhttp_append_to_last_header(struct evkeyvalq *headers, char *line)
+{
+ struct evkeyval *header = TAILQ_LAST(headers, evkeyvalq);
+ char *newval;
+ size_t old_len, line_len;
+
+ if (header == NULL)
+ return (-1);
+
+ old_len = strlen(header->value);
+
+ /* Strip space from start and end of line. */
+ while (*line == ' ' || *line == '\t')
+ ++line;
+ evutil_rtrim_lws_(line);
+
+ line_len = strlen(line);
+
+ newval = mm_realloc(header->value, old_len + line_len + 2);
+ if (newval == NULL)
+ return (-1);
+
+ newval[old_len] = ' ';
+ memcpy(newval + old_len + 1, line, line_len + 1);
+ header->value = newval;
+
+ return (0);
+}
+
+enum message_read_status
+evhttp_parse_headers_(struct evhttp_request *req, struct evbuffer* buffer)
+{
+ enum message_read_status errcode = DATA_CORRUPTED;
+ char *line;
+ enum message_read_status status = MORE_DATA_EXPECTED;
+
+ struct evkeyvalq* headers = req->input_headers;
+ size_t line_length;
+ while ((line = evbuffer_readln(buffer, &line_length, EVBUFFER_EOL_CRLF))
+ != NULL) {
+ char *skey, *svalue;
+
+ req->headers_size += line_length;
+
+ if (req->evcon != NULL &&
+ req->headers_size > req->evcon->max_headers_size) {
+ errcode = DATA_TOO_LONG;
+ goto error;
+ }
+
+ if (*line == '\0') { /* Last header - Done */
+ status = ALL_DATA_READ;
+ mm_free(line);
+ break;
+ }
+
+ /* Check if this is a continuation line */
+ if (*line == ' ' || *line == '\t') {
+ if (evhttp_append_to_last_header(headers, line) == -1)
+ goto error;
+ mm_free(line);
+ continue;
+ }
+
+ /* Processing of header lines */
+ svalue = line;
+ skey = strsep(&svalue, ":");
+ if (svalue == NULL)
+ goto error;
+
+ svalue += strspn(svalue, " ");
+ evutil_rtrim_lws_(svalue);
+
+ if (evhttp_add_header(headers, skey, svalue) == -1)
+ goto error;
+
+ mm_free(line);
+ }
+
+ if (status == MORE_DATA_EXPECTED) {
+ if (req->evcon != NULL &&
+ req->headers_size + evbuffer_get_length(buffer) > req->evcon->max_headers_size)
+ return (DATA_TOO_LONG);
+ }
+
+ return (status);
+
+ error:
+ mm_free(line);
+ return (errcode);
+}
+
+static int
+evhttp_get_body_length(struct evhttp_request *req)
+{
+ struct evkeyvalq *headers = req->input_headers;
+ const char *content_length;
+ const char *connection;
+
+ content_length = evhttp_find_header(headers, "Content-Length");
+ connection = evhttp_find_header(headers, "Connection");
+
+ if (content_length == NULL && connection == NULL)
+ req->ntoread = -1;
+ else if (content_length == NULL &&
+ evutil_ascii_strcasecmp(connection, "Close") != 0) {
+ /* Bad combination, we don't know when it will end */
+ event_warnx("%s: we got no content length, but the "
+ "server wants to keep the connection open: %s.",
+ __func__, connection);
+ return (-1);
+ } else if (content_length == NULL) {
+ req->ntoread = -1;
+ } else {
+ char *endp;
+ ev_int64_t ntoread = evutil_strtoll(content_length, &endp, 10);
+ if (*content_length == '\0' || *endp != '\0' || ntoread < 0) {
+ event_debug(("%s: illegal content length: %s",
+ __func__, content_length));
+ return (-1);
+ }
+ req->ntoread = ntoread;
+ }
+
+ event_debug(("%s: bytes to read: "EV_I64_FMT" (in buffer "EV_SIZE_FMT")\n",
+ __func__, EV_I64_ARG(req->ntoread),
+ EV_SIZE_ARG(evbuffer_get_length(bufferevent_get_input(req->evcon->bufev)))));
+
+ return (0);
+}
+
+static int
+evhttp_method_may_have_body(enum evhttp_cmd_type type)
+{
+ switch (type) {
+ case EVHTTP_REQ_POST:
+ case EVHTTP_REQ_PUT:
+ case EVHTTP_REQ_PATCH:
+ return 1;
+ case EVHTTP_REQ_TRACE:
+ return 0;
+ /* XXX May any of the below methods have a body? */
+ case EVHTTP_REQ_GET:
+ case EVHTTP_REQ_HEAD:
+ case EVHTTP_REQ_DELETE:
+ case EVHTTP_REQ_OPTIONS:
+ case EVHTTP_REQ_CONNECT:
+ return 0;
+ default:
+ return 0;
+ }
+}
+
+static void
+evhttp_get_body(struct evhttp_connection *evcon, struct evhttp_request *req)
+{
+ const char *xfer_enc;
+
+ /* If this is a request without a body, then we are done */
+ if (req->kind == EVHTTP_REQUEST &&
+ !evhttp_method_may_have_body(req->type)) {
+ evhttp_connection_done(evcon);
+ return;
+ }
+ evcon->state = EVCON_READING_BODY;
+ xfer_enc = evhttp_find_header(req->input_headers, "Transfer-Encoding");
+ if (xfer_enc != NULL && evutil_ascii_strcasecmp(xfer_enc, "chunked") == 0) {
+ req->chunked = 1;
+ req->ntoread = -1;
+ } else {
+ if (evhttp_get_body_length(req) == -1) {
+ evhttp_connection_fail_(evcon,
+ EVREQ_HTTP_INVALID_HEADER);
+ return;
+ }
+ if (req->kind == EVHTTP_REQUEST && req->ntoread < 1) {
+ /* An incoming request with no content-length and no
+ * transfer-encoding has no body. */
+ evhttp_connection_done(evcon);
+ return;
+ }
+ }
+
+ /* Should we send a 100 Continue status line? */
+ if (req->kind == EVHTTP_REQUEST && REQ_VERSION_ATLEAST(req, 1, 1)) {
+ const char *expect;
+
+ expect = evhttp_find_header(req->input_headers, "Expect");
+ if (expect) {
+ if (!evutil_ascii_strcasecmp(expect, "100-continue")) {
+ /* XXX It would be nice to do some sanity
+ checking here. Does the resource exist?
+ Should the resource accept post requests? If
+ no, we should respond with an error. For
+ now, just optimistically tell the client to
+ send their message body. */
+ if (req->ntoread > 0) {
+ /* ntoread is ev_int64_t, max_body_size is ev_uint64_t */
+ if ((req->evcon->max_body_size <= EV_INT64_MAX) && (ev_uint64_t)req->ntoread > req->evcon->max_body_size) {
+ evhttp_send_error(req, HTTP_ENTITYTOOLARGE, NULL);
+ return;
+ }
+ }
+ if (!evbuffer_get_length(bufferevent_get_input(evcon->bufev)))
+ evhttp_send_continue(evcon, req);
+ } else {
+ evhttp_send_error(req, HTTP_EXPECTATIONFAILED,
+ NULL);
+ return;
+ }
+ }
+ }
+
+ evhttp_read_body(evcon, req);
+ /* note the request may have been freed in evhttp_read_body */
+}
+
+static void
+evhttp_read_firstline(struct evhttp_connection *evcon,
+ struct evhttp_request *req)
+{
+ enum message_read_status res;
+
+ res = evhttp_parse_firstline_(req, bufferevent_get_input(evcon->bufev));
+ if (res == DATA_CORRUPTED || res == DATA_TOO_LONG) {
+ /* Error while reading, terminate */
+ event_debug(("%s: bad header lines on "EV_SOCK_FMT"\n",
+ __func__, EV_SOCK_ARG(evcon->fd)));
+ evhttp_connection_fail_(evcon, EVREQ_HTTP_INVALID_HEADER);
+ return;
+ } else if (res == MORE_DATA_EXPECTED) {
+ /* Need more header lines */
+ return;
+ }
+
+ evcon->state = EVCON_READING_HEADERS;
+ evhttp_read_header(evcon, req);
+}
+
+static void
+evhttp_read_header(struct evhttp_connection *evcon,
+ struct evhttp_request *req)
+{
+ enum message_read_status res;
+ evutil_socket_t fd = evcon->fd;
+
+ res = evhttp_parse_headers_(req, bufferevent_get_input(evcon->bufev));
+ if (res == DATA_CORRUPTED || res == DATA_TOO_LONG) {
+ /* Error while reading, terminate */
+ event_debug(("%s: bad header lines on "EV_SOCK_FMT"\n",
+ __func__, EV_SOCK_ARG(fd)));
+ evhttp_connection_fail_(evcon, EVREQ_HTTP_INVALID_HEADER);
+ return;
+ } else if (res == MORE_DATA_EXPECTED) {
+ /* Need more header lines */
+ return;
+ }
+
+ /* Callback can shut down connection with negative return value */
+ if (req->header_cb != NULL) {
+ if ((*req->header_cb)(req, req->cb_arg) < 0) {
+ evhttp_connection_fail_(evcon, EVREQ_HTTP_EOF);
+ return;
+ }
+ }
+
+ /* Done reading headers, do the real work */
+ switch (req->kind) {
+ case EVHTTP_REQUEST:
+ event_debug(("%s: checking for post data on "EV_SOCK_FMT"\n",
+ __func__, EV_SOCK_ARG(fd)));
+ evhttp_get_body(evcon, req);
+ /* note the request may have been freed in evhttp_get_body */
+ break;
+
+ case EVHTTP_RESPONSE:
+ /* Start over if we got a 100 Continue response. */
+ if (req->response_code == 100) {
+ evhttp_start_read_(evcon);
+ return;
+ }
+ if (!evhttp_response_needs_body(req)) {
+ event_debug(("%s: skipping body for code %d\n",
+ __func__, req->response_code));
+ evhttp_connection_done(evcon);
+ } else {
+ event_debug(("%s: start of read body for %s on "
+ EV_SOCK_FMT"\n",
+ __func__, req->remote_host, EV_SOCK_ARG(fd)));
+ evhttp_get_body(evcon, req);
+ /* note the request may have been freed in
+ * evhttp_get_body */
+ }
+ break;
+
+ default:
+ event_warnx("%s: bad header on "EV_SOCK_FMT, __func__,
+ EV_SOCK_ARG(fd));
+ evhttp_connection_fail_(evcon, EVREQ_HTTP_INVALID_HEADER);
+ break;
+ }
+ /* request may have been freed above */
+}
+
+/*
+ * Creates a TCP connection to the specified port and executes a callback
+ * when finished. Failure or success is indicate by the passed connection
+ * object.
+ *
+ * Although this interface accepts a hostname, it is intended to take
+ * only numeric hostnames so that non-blocking DNS resolution can
+ * happen elsewhere.
+ */
+
+struct evhttp_connection *
+evhttp_connection_new(const char *address, unsigned short port)
+{
+ return (evhttp_connection_base_new(NULL, NULL, address, port));
+}
+
+struct evhttp_connection *
+evhttp_connection_base_bufferevent_new(struct event_base *base, struct evdns_base *dnsbase, struct bufferevent* bev,
+ const char *address, unsigned short port)
+{
+ struct evhttp_connection *evcon = NULL;
+
+ event_debug(("Attempting connection to %s:%d\n", address, port));
+
+ if ((evcon = mm_calloc(1, sizeof(struct evhttp_connection))) == NULL) {
+ event_warn("%s: calloc failed", __func__);
+ goto error;
+ }
+
+ evcon->fd = -1;
+ evcon->port = port;
+
+ evcon->max_headers_size = EV_SIZE_MAX;
+ evcon->max_body_size = EV_SIZE_MAX;
+
+ evutil_timerclear(&evcon->timeout);
+ evcon->retry_cnt = evcon->retry_max = 0;
+
+ if ((evcon->address = mm_strdup(address)) == NULL) {
+ event_warn("%s: strdup failed", __func__);
+ goto error;
+ }
+
+ if (bev == NULL) {
+ if (!(bev = bufferevent_socket_new(base, -1, 0))) {
+ event_warn("%s: bufferevent_socket_new failed", __func__);
+ goto error;
+ }
+ }
+
+ bufferevent_setcb(bev, evhttp_read_cb, evhttp_write_cb, evhttp_error_cb, evcon);
+ evcon->bufev = bev;
+
+ evcon->state = EVCON_DISCONNECTED;
+ TAILQ_INIT(&evcon->requests);
+
+ evcon->initial_retry_timeout.tv_sec = 2;
+ evcon->initial_retry_timeout.tv_usec = 0;
+
+ if (base != NULL) {
+ evcon->base = base;
+ if (bufferevent_get_base(bev) != base)
+ bufferevent_base_set(base, evcon->bufev);
+ }
+
+ event_deferred_cb_init_(
+ &evcon->read_more_deferred_cb,
+ bufferevent_get_priority(bev),
+ evhttp_deferred_read_cb, evcon);
+
+ evcon->dns_base = dnsbase;
+ evcon->ai_family = AF_UNSPEC;
+
+ return (evcon);
+
+ error:
+ if (evcon != NULL)
+ evhttp_connection_free(evcon);
+ return (NULL);
+}
+
+struct bufferevent* evhttp_connection_get_bufferevent(struct evhttp_connection *evcon)
+{
+ return evcon->bufev;
+}
+
+struct evhttp *
+evhttp_connection_get_server(struct evhttp_connection *evcon)
+{
+ return evcon->http_server;
+}
+
+struct evhttp_connection *
+evhttp_connection_base_new(struct event_base *base, struct evdns_base *dnsbase,
+ const char *address, unsigned short port)
+{
+ return evhttp_connection_base_bufferevent_new(base, dnsbase, NULL, address, port);
+}
+
+void evhttp_connection_set_family(struct evhttp_connection *evcon,
+ int family)
+{
+ evcon->ai_family = family;
+}
+
+int evhttp_connection_set_flags(struct evhttp_connection *evcon,
+ int flags)
+{
+ int avail_flags = 0;
+ avail_flags |= EVHTTP_CON_REUSE_CONNECTED_ADDR;
+
+ if (flags & ~avail_flags || flags > EVHTTP_CON_PUBLIC_FLAGS_END)
+ return 1;
+ evcon->flags &= ~avail_flags;
+
+ evcon->flags |= flags;
+
+ return 0;
+}
+
+void
+evhttp_connection_set_base(struct evhttp_connection *evcon,
+ struct event_base *base)
+{
+ EVUTIL_ASSERT(evcon->base == NULL);
+ EVUTIL_ASSERT(evcon->state == EVCON_DISCONNECTED);
+ evcon->base = base;
+ bufferevent_base_set(base, evcon->bufev);
+}
+
+void
+evhttp_connection_set_timeout(struct evhttp_connection *evcon,
+ int timeout_in_secs)
+{
+ if (timeout_in_secs == -1)
+ evhttp_connection_set_timeout_tv(evcon, NULL);
+ else {
+ struct timeval tv;
+ tv.tv_sec = timeout_in_secs;
+ tv.tv_usec = 0;
+ evhttp_connection_set_timeout_tv(evcon, &tv);
+ }
+}
+
+void
+evhttp_connection_set_timeout_tv(struct evhttp_connection *evcon,
+ const struct timeval* tv)
+{
+ if (tv) {
+ evcon->timeout = *tv;
+ bufferevent_set_timeouts(evcon->bufev, &evcon->timeout, &evcon->timeout);
+ } else {
+ const struct timeval read_tv = { HTTP_READ_TIMEOUT, 0 };
+ const struct timeval write_tv = { HTTP_WRITE_TIMEOUT, 0 };
+ evutil_timerclear(&evcon->timeout);
+ bufferevent_set_timeouts(evcon->bufev, &read_tv, &write_tv);
+ }
+}
+
+void
+evhttp_connection_set_initial_retry_tv(struct evhttp_connection *evcon,
+ const struct timeval *tv)
+{
+ if (tv) {
+ evcon->initial_retry_timeout = *tv;
+ } else {
+ evutil_timerclear(&evcon->initial_retry_timeout);
+ evcon->initial_retry_timeout.tv_sec = 2;
+ }
+}
+
+void
+evhttp_connection_set_retries(struct evhttp_connection *evcon,
+ int retry_max)
+{
+ evcon->retry_max = retry_max;
+}
+
+void
+evhttp_connection_set_closecb(struct evhttp_connection *evcon,
+ void (*cb)(struct evhttp_connection *, void *), void *cbarg)
+{
+ evcon->closecb = cb;
+ evcon->closecb_arg = cbarg;
+}
+
+void
+evhttp_connection_get_peer(struct evhttp_connection *evcon,
+ char **address, ev_uint16_t *port)
+{
+ *address = evcon->address;
+ *port = evcon->port;
+}
+
+const struct sockaddr*
+evhttp_connection_get_addr(struct evhttp_connection *evcon)
+{
+ return bufferevent_socket_get_conn_address_(evcon->bufev);
+}
+
+int
+evhttp_connection_connect_(struct evhttp_connection *evcon)
+{
+ int old_state = evcon->state;
+ const char *address = evcon->address;
+ const struct sockaddr *sa = evhttp_connection_get_addr(evcon);
+ int ret;
+
+ if (evcon->state == EVCON_CONNECTING)
+ return (0);
+
+ evhttp_connection_reset_(evcon);
+
+ EVUTIL_ASSERT(!(evcon->flags & EVHTTP_CON_INCOMING));
+ evcon->flags |= EVHTTP_CON_OUTGOING;
+
+ if (evcon->bind_address || evcon->bind_port) {
+ evcon->fd = bind_socket(
+ evcon->bind_address, evcon->bind_port, 0 /*reuse*/);
+ if (evcon->fd == -1) {
+ event_debug(("%s: failed to bind to \"%s\"",
+ __func__, evcon->bind_address));
+ return (-1);
+ }
+
+ bufferevent_setfd(evcon->bufev, evcon->fd);
+ } else {
+ bufferevent_setfd(evcon->bufev, -1);
+ }
+
+ /* Set up a callback for successful connection setup */
+ bufferevent_setcb(evcon->bufev,
+ NULL /* evhttp_read_cb */,
+ NULL /* evhttp_write_cb */,
+ evhttp_connection_cb,
+ evcon);
+ if (!evutil_timerisset(&evcon->timeout)) {
+ const struct timeval conn_tv = { HTTP_CONNECT_TIMEOUT, 0 };
+ bufferevent_set_timeouts(evcon->bufev, &conn_tv, &conn_tv);
+ } else {
+ bufferevent_set_timeouts(evcon->bufev, &evcon->timeout, &evcon->timeout);
+ }
+ /* make sure that we get a write callback */
+ bufferevent_enable(evcon->bufev, EV_WRITE);
+
+ evcon->state = EVCON_CONNECTING;
+
+ if (evcon->flags & EVHTTP_CON_REUSE_CONNECTED_ADDR &&
+ sa &&
+ (sa->sa_family == AF_INET || sa->sa_family == AF_INET6)) {
+ int socklen = sizeof(struct sockaddr_in);
+ if (sa->sa_family == AF_INET6) {
+ socklen = sizeof(struct sockaddr_in6);
+ }
+ ret = bufferevent_socket_connect(evcon->bufev, sa, socklen);
+ } else {
+ ret = bufferevent_socket_connect_hostname(evcon->bufev,
+ evcon->dns_base, evcon->ai_family, address, evcon->port);
+ }
+
+ if (ret < 0) {
+ evcon->state = old_state;
+ event_sock_warn(evcon->fd, "%s: connection to \"%s\" failed",
+ __func__, evcon->address);
+ /* some operating systems return ECONNREFUSED immediately
+ * when connecting to a local address. the cleanup is going
+ * to reschedule this function call.
+ */
+ evhttp_connection_cb_cleanup(evcon);
+ return (0);
+ }
+
+ return (0);
+}
+
+/*
+ * Starts an HTTP request on the provided evhttp_connection object.
+ * If the connection object is not connected to the web server already,
+ * this will start the connection.
+ */
+
+int
+evhttp_make_request(struct evhttp_connection *evcon,
+ struct evhttp_request *req,
+ enum evhttp_cmd_type type, const char *uri)
+{
+ /* We are making a request */
+ req->kind = EVHTTP_REQUEST;
+ req->type = type;
+ if (req->uri != NULL)
+ mm_free(req->uri);
+ if ((req->uri = mm_strdup(uri)) == NULL) {
+ event_warn("%s: strdup", __func__);
+ evhttp_request_free_auto(req);
+ return (-1);
+ }
+
+ /* Set the protocol version if it is not supplied */
+ if (!req->major && !req->minor) {
+ req->major = 1;
+ req->minor = 1;
+ }
+
+ EVUTIL_ASSERT(req->evcon == NULL);
+ req->evcon = evcon;
+ EVUTIL_ASSERT(!(req->flags & EVHTTP_REQ_OWN_CONNECTION));
+
+ TAILQ_INSERT_TAIL(&evcon->requests, req, next);
+
+ /* If the connection object is not connected; make it so */
+ if (!evhttp_connected(evcon)) {
+ int res = evhttp_connection_connect_(evcon);
+ /* evhttp_connection_fail_(), which is called through
+ * evhttp_connection_connect_(), assumes that req lies in
+ * evcon->requests. Thus, enqueue the request in advance and
+ * remove it in the error case. */
+ if (res != 0)
+ TAILQ_REMOVE(&evcon->requests, req, next);
+
+ return res;
+ }
+
+ /*
+ * If it's connected already and we are the first in the queue,
+ * then we can dispatch this request immediately. Otherwise, it
+ * will be dispatched once the pending requests are completed.
+ */
+ if (TAILQ_FIRST(&evcon->requests) == req)
+ evhttp_request_dispatch(evcon);
+
+ return (0);
+}
+
+void
+evhttp_cancel_request(struct evhttp_request *req)
+{
+ struct evhttp_connection *evcon = req->evcon;
+ if (evcon != NULL) {
+ /* We need to remove it from the connection */
+ if (TAILQ_FIRST(&evcon->requests) == req) {
+ /* it's currently being worked on, so reset
+ * the connection.
+ */
+ evhttp_connection_fail_(evcon,
+ EVREQ_HTTP_REQUEST_CANCEL);
+
+ /* connection fail freed the request */
+ return;
+ } else {
+ /* otherwise, we can just remove it from the
+ * queue
+ */
+ TAILQ_REMOVE(&evcon->requests, req, next);
+ }
+ }
+
+ evhttp_request_free_auto(req);
+}
+
+/*
+ * Reads data from file descriptor into request structure
+ * Request structure needs to be set up correctly.
+ */
+
+void
+evhttp_start_read_(struct evhttp_connection *evcon)
+{
+ bufferevent_disable(evcon->bufev, EV_WRITE);
+ bufferevent_enable(evcon->bufev, EV_READ);
+
+ evcon->state = EVCON_READING_FIRSTLINE;
+ /* Reset the bufferevent callbacks */
+ bufferevent_setcb(evcon->bufev,
+ evhttp_read_cb,
+ evhttp_write_cb,
+ evhttp_error_cb,
+ evcon);
+
+ /* If there's still data pending, process it next time through the
+ * loop. Don't do it now; that could get recusive. */
+ if (evbuffer_get_length(bufferevent_get_input(evcon->bufev))) {
+ event_deferred_cb_schedule_(get_deferred_queue(evcon),
+ &evcon->read_more_deferred_cb);
+ }
+}
+
+static void
+evhttp_send_done(struct evhttp_connection *evcon, void *arg)
+{
+ int need_close;
+ struct evhttp_request *req = TAILQ_FIRST(&evcon->requests);
+ TAILQ_REMOVE(&evcon->requests, req, next);
+
+ if (req->on_complete_cb != NULL) {
+ req->on_complete_cb(req, req->on_complete_cb_arg);
+ }
+
+ need_close =
+ (REQ_VERSION_BEFORE(req, 1, 1) &&
+ !evhttp_is_connection_keepalive(req->input_headers)) ||
+ evhttp_is_request_connection_close(req);
+
+ EVUTIL_ASSERT(req->flags & EVHTTP_REQ_OWN_CONNECTION);
+ evhttp_request_free(req);
+
+ if (need_close) {
+ evhttp_connection_free(evcon);
+ return;
+ }
+
+ /* we have a persistent connection; try to accept another request. */
+ if (evhttp_associate_new_request_with_connection(evcon) == -1) {
+ evhttp_connection_free(evcon);
+ }
+}
+
+/*
+ * Returns an error page.
+ */
+
+void
+evhttp_send_error(struct evhttp_request *req, int error, const char *reason)
+{
+
+#define ERR_FORMAT "<HTML><HEAD>\n" \
+ "<TITLE>%d %s</TITLE>\n" \
+ "</HEAD><BODY>\n" \
+ "<H1>%s</H1>\n" \
+ "</BODY></HTML>\n"
+
+ struct evbuffer *buf = evbuffer_new();
+ if (buf == NULL) {
+ /* if we cannot allocate memory; we just drop the connection */
+ evhttp_connection_free(req->evcon);
+ return;
+ }
+ if (reason == NULL) {
+ reason = evhttp_response_phrase_internal(error);
+ }
+
+ evhttp_response_code_(req, error, reason);
+
+ evbuffer_add_printf(buf, ERR_FORMAT, error, reason, reason);
+
+ evhttp_send_page_(req, buf);
+
+ evbuffer_free(buf);
+#undef ERR_FORMAT
+}
+
+/* Requires that headers and response code are already set up */
+
+static inline void
+evhttp_send(struct evhttp_request *req, struct evbuffer *databuf)
+{
+ struct evhttp_connection *evcon = req->evcon;
+
+ if (evcon == NULL) {
+ evhttp_request_free(req);
+ return;
+ }
+
+ EVUTIL_ASSERT(TAILQ_FIRST(&evcon->requests) == req);
+
+ /* we expect no more calls form the user on this request */
+ req->userdone = 1;
+
+ /* xxx: not sure if we really should expose the data buffer this way */
+ if (databuf != NULL)
+ evbuffer_add_buffer(req->output_buffer, databuf);
+
+ /* Adds headers to the response */
+ evhttp_make_header(evcon, req);
+
+ evhttp_write_buffer(evcon, evhttp_send_done, NULL);
+}
+
+void
+evhttp_send_reply(struct evhttp_request *req, int code, const char *reason,
+ struct evbuffer *databuf)
+{
+ evhttp_response_code_(req, code, reason);
+
+ evhttp_send(req, databuf);
+}
+
+void
+evhttp_send_reply_start(struct evhttp_request *req, int code,
+ const char *reason)
+{
+ evhttp_response_code_(req, code, reason);
+ if (evhttp_find_header(req->output_headers, "Content-Length") == NULL &&
+ REQ_VERSION_ATLEAST(req, 1, 1) &&
+ evhttp_response_needs_body(req)) {
+ /*
+ * prefer HTTP/1.1 chunked encoding to closing the connection;
+ * note RFC 2616 section 4.4 forbids it with Content-Length:
+ * and it's not necessary then anyway.
+ */
+ evhttp_add_header(req->output_headers, "Transfer-Encoding",
+ "chunked");
+ req->chunked = 1;
+ } else {
+ req->chunked = 0;
+ }
+ evhttp_make_header(req->evcon, req);
+ evhttp_write_buffer(req->evcon, NULL, NULL);
+}
+
+void
+evhttp_send_reply_chunk_with_cb(struct evhttp_request *req, struct evbuffer *databuf,
+ void (*cb)(struct evhttp_connection *, void *), void *arg)
+{
+ struct evhttp_connection *evcon = req->evcon;
+ struct evbuffer *output;
+
+ if (evcon == NULL)
+ return;
+
+ output = bufferevent_get_output(evcon->bufev);
+
+ if (evbuffer_get_length(databuf) == 0)
+ return;
+ if (!evhttp_response_needs_body(req))
+ return;
+ if (req->chunked) {
+ evbuffer_add_printf(output, "%x\r\n",
+ (unsigned)evbuffer_get_length(databuf));
+ }
+ evbuffer_add_buffer(output, databuf);
+ if (req->chunked) {
+ evbuffer_add(output, "\r\n", 2);
+ }
+ evhttp_write_buffer(evcon, cb, arg);
+}
+
+void
+evhttp_send_reply_chunk(struct evhttp_request *req, struct evbuffer *databuf)
+{
+ evhttp_send_reply_chunk_with_cb(req, databuf, NULL, NULL);
+}
+void
+evhttp_send_reply_end(struct evhttp_request *req)
+{
+ struct evhttp_connection *evcon = req->evcon;
+ struct evbuffer *output;
+
+ if (evcon == NULL) {
+ evhttp_request_free(req);
+ return;
+ }
+
+ output = bufferevent_get_output(evcon->bufev);
+
+ /* we expect no more calls form the user on this request */
+ req->userdone = 1;
+
+ if (req->chunked) {
+ evbuffer_add(output, "0\r\n\r\n", 5);
+ evhttp_write_buffer(req->evcon, evhttp_send_done, NULL);
+ req->chunked = 0;
+ } else if (evbuffer_get_length(output) == 0) {
+ /* let the connection know that we are done with the request */
+ evhttp_send_done(evcon, NULL);
+ } else {
+ /* make the callback execute after all data has been written */
+ evcon->cb = evhttp_send_done;
+ evcon->cb_arg = NULL;
+ }
+}
+
+static const char *informational_phrases[] = {
+ /* 100 */ "Continue",
+ /* 101 */ "Switching Protocols"
+};
+
+static const char *success_phrases[] = {
+ /* 200 */ "OK",
+ /* 201 */ "Created",
+ /* 202 */ "Accepted",
+ /* 203 */ "Non-Authoritative Information",
+ /* 204 */ "No Content",
+ /* 205 */ "Reset Content",
+ /* 206 */ "Partial Content"
+};
+
+static const char *redirection_phrases[] = {
+ /* 300 */ "Multiple Choices",
+ /* 301 */ "Moved Permanently",
+ /* 302 */ "Found",
+ /* 303 */ "See Other",
+ /* 304 */ "Not Modified",
+ /* 305 */ "Use Proxy",
+ /* 307 */ "Temporary Redirect"
+};
+
+static const char *client_error_phrases[] = {
+ /* 400 */ "Bad Request",
+ /* 401 */ "Unauthorized",
+ /* 402 */ "Payment Required",
+ /* 403 */ "Forbidden",
+ /* 404 */ "Not Found",
+ /* 405 */ "Method Not Allowed",
+ /* 406 */ "Not Acceptable",
+ /* 407 */ "Proxy Authentication Required",
+ /* 408 */ "Request Time-out",
+ /* 409 */ "Conflict",
+ /* 410 */ "Gone",
+ /* 411 */ "Length Required",
+ /* 412 */ "Precondition Failed",
+ /* 413 */ "Request Entity Too Large",
+ /* 414 */ "Request-URI Too Large",
+ /* 415 */ "Unsupported Media Type",
+ /* 416 */ "Requested range not satisfiable",
+ /* 417 */ "Expectation Failed"
+};
+
+static const char *server_error_phrases[] = {
+ /* 500 */ "Internal Server Error",
+ /* 501 */ "Not Implemented",
+ /* 502 */ "Bad Gateway",
+ /* 503 */ "Service Unavailable",
+ /* 504 */ "Gateway Time-out",
+ /* 505 */ "HTTP Version not supported"
+};
+
+struct response_class {
+ const char *name;
+ size_t num_responses;
+ const char **responses;
+};
+
+#ifndef MEMBERSOF
+#define MEMBERSOF(x) (sizeof(x)/sizeof(x[0]))
+#endif
+
+static const struct response_class response_classes[] = {
+ /* 1xx */ { "Informational", MEMBERSOF(informational_phrases), informational_phrases },
+ /* 2xx */ { "Success", MEMBERSOF(success_phrases), success_phrases },
+ /* 3xx */ { "Redirection", MEMBERSOF(redirection_phrases), redirection_phrases },
+ /* 4xx */ { "Client Error", MEMBERSOF(client_error_phrases), client_error_phrases },
+ /* 5xx */ { "Server Error", MEMBERSOF(server_error_phrases), server_error_phrases }
+};
+
+static const char *
+evhttp_response_phrase_internal(int code)
+{
+ int klass = code / 100 - 1;
+ int subcode = code % 100;
+
+ /* Unknown class - can't do any better here */
+ if (klass < 0 || klass >= (int) MEMBERSOF(response_classes))
+ return "Unknown Status Class";
+
+ /* Unknown sub-code, return class name at least */
+ if (subcode >= (int) response_classes[klass].num_responses)
+ return response_classes[klass].name;
+
+ return response_classes[klass].responses[subcode];
+}
+
+void
+evhttp_response_code_(struct evhttp_request *req, int code, const char *reason)
+{
+ req->kind = EVHTTP_RESPONSE;
+ req->response_code = code;
+ if (req->response_code_line != NULL)
+ mm_free(req->response_code_line);
+ if (reason == NULL)
+ reason = evhttp_response_phrase_internal(code);
+ req->response_code_line = mm_strdup(reason);
+ if (req->response_code_line == NULL) {
+ event_warn("%s: strdup", __func__);
+ /* XXX what else can we do? */
+ }
+}
+
+void
+evhttp_send_page_(struct evhttp_request *req, struct evbuffer *databuf)
+{
+ if (!req->major || !req->minor) {
+ req->major = 1;
+ req->minor = 1;
+ }
+
+ if (req->kind != EVHTTP_RESPONSE)
+ evhttp_response_code_(req, 200, "OK");
+
+ evhttp_clear_headers(req->output_headers);
+ evhttp_add_header(req->output_headers, "Content-Type", "text/html");
+ evhttp_add_header(req->output_headers, "Connection", "close");
+
+ evhttp_send(req, databuf);
+}
+
+static const char uri_chars[256] = {
+ /* 0 */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
+ /* 64 */
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1,
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0,
+ /* 128 */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ /* 192 */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+};
+
+#define CHAR_IS_UNRESERVED(c) \
+ (uri_chars[(unsigned char)(c)])
+
+/*
+ * Helper functions to encode/decode a string for inclusion in a URI.
+ * The returned string must be freed by the caller.
+ */
+char *
+evhttp_uriencode(const char *uri, ev_ssize_t len, int space_as_plus)
+{
+ struct evbuffer *buf = evbuffer_new();
+ const char *p, *end;
+ char *result;
+
+ if (buf == NULL)
+ return (NULL);
+
+ if (len >= 0)
+ end = uri+len;
+ else
+ end = uri+strlen(uri);
+
+ for (p = uri; p < end; p++) {
+ if (CHAR_IS_UNRESERVED(*p)) {
+ evbuffer_add(buf, p, 1);
+ } else if (*p == ' ' && space_as_plus) {
+ evbuffer_add(buf, "+", 1);
+ } else {
+ evbuffer_add_printf(buf, "%%%02X", (unsigned char)(*p));
+ }
+ }
+ evbuffer_add(buf, "", 1); /* NUL-terminator. */
+ result = mm_malloc(evbuffer_get_length(buf));
+ if (result)
+ evbuffer_remove(buf, result, evbuffer_get_length(buf));
+ evbuffer_free(buf);
+
+ return (result);
+}
+
+char *
+evhttp_encode_uri(const char *str)
+{
+ return evhttp_uriencode(str, -1, 0);
+}
+
+/*
+ * @param decode_plus_ctl: if 1, we decode plus into space. If 0, we don't.
+ * If -1, when true we transform plus to space only after we've seen
+ * a ?. -1 is deprecated.
+ * @return the number of bytes written to 'ret'.
+ */
+int
+evhttp_decode_uri_internal(
+ const char *uri, size_t length, char *ret, int decode_plus_ctl)
+{
+ char c;
+ int j;
+ int decode_plus = (decode_plus_ctl == 1) ? 1: 0;
+ unsigned i;
+
+ for (i = j = 0; i < length; i++) {
+ c = uri[i];
+ if (c == '?') {
+ if (decode_plus_ctl < 0)
+ decode_plus = 1;
+ } else if (c == '+' && decode_plus) {
+ c = ' ';
+ } else if ((i + 2) < length && c == '%' &&
+ EVUTIL_ISXDIGIT_(uri[i+1]) && EVUTIL_ISXDIGIT_(uri[i+2])) {
+ char tmp[3];
+ tmp[0] = uri[i+1];
+ tmp[1] = uri[i+2];
+ tmp[2] = '\0';
+ c = (char)strtol(tmp, NULL, 16);
+ i += 2;
+ }
+ ret[j++] = c;
+ }
+ ret[j] = '\0';
+
+ return (j);
+}
+
+/* deprecated */
+char *
+evhttp_decode_uri(const char *uri)
+{
+ char *ret;
+
+ if ((ret = mm_malloc(strlen(uri) + 1)) == NULL) {
+ event_warn("%s: malloc(%lu)", __func__,
+ (unsigned long)(strlen(uri) + 1));
+ return (NULL);
+ }
+
+ evhttp_decode_uri_internal(uri, strlen(uri),
+ ret, -1 /*always_decode_plus*/);
+
+ return (ret);
+}
+
+char *
+evhttp_uridecode(const char *uri, int decode_plus, size_t *size_out)
+{
+ char *ret;
+ int n;
+
+ if ((ret = mm_malloc(strlen(uri) + 1)) == NULL) {
+ event_warn("%s: malloc(%lu)", __func__,
+ (unsigned long)(strlen(uri) + 1));
+ return (NULL);
+ }
+
+ n = evhttp_decode_uri_internal(uri, strlen(uri),
+ ret, !!decode_plus/*always_decode_plus*/);
+
+ if (size_out) {
+ EVUTIL_ASSERT(n >= 0);
+ *size_out = (size_t)n;
+ }
+
+ return (ret);
+}
+
+/*
+ * Helper function to parse out arguments in a query.
+ * The arguments are separated by key and value.
+ */
+
+static int
+evhttp_parse_query_impl(const char *str, struct evkeyvalq *headers,
+ int is_whole_uri)
+{
+ char *line=NULL;
+ char *argument;
+ char *p;
+ const char *query_part;
+ int result = -1;
+ struct evhttp_uri *uri=NULL;
+
+ TAILQ_INIT(headers);
+
+ if (is_whole_uri) {
+ uri = evhttp_uri_parse(str);
+ if (!uri)
+ goto error;
+ query_part = evhttp_uri_get_query(uri);
+ } else {
+ query_part = str;
+ }
+
+ /* No arguments - we are done */
+ if (!query_part || !strlen(query_part)) {
+ result = 0;
+ goto done;
+ }
+
+ if ((line = mm_strdup(query_part)) == NULL) {
+ event_warn("%s: strdup", __func__);
+ goto error;
+ }
+
+ p = argument = line;
+ while (p != NULL && *p != '\0') {
+ char *key, *value, *decoded_value;
+ argument = strsep(&p, "&");
+
+ value = argument;
+ key = strsep(&value, "=");
+ if (value == NULL || *key == '\0') {
+ goto error;
+ }
+
+ if ((decoded_value = mm_malloc(strlen(value) + 1)) == NULL) {
+ event_warn("%s: mm_malloc", __func__);
+ goto error;
+ }
+ evhttp_decode_uri_internal(value, strlen(value),
+ decoded_value, 1 /*always_decode_plus*/);
+ event_debug(("Query Param: %s -> %s\n", key, decoded_value));
+ evhttp_add_header_internal(headers, key, decoded_value);
+ mm_free(decoded_value);
+ }
+
+ result = 0;
+ goto done;
+error:
+ evhttp_clear_headers(headers);
+done:
+ if (line)
+ mm_free(line);
+ if (uri)
+ evhttp_uri_free(uri);
+ return result;
+}
+
+int
+evhttp_parse_query(const char *uri, struct evkeyvalq *headers)
+{
+ return evhttp_parse_query_impl(uri, headers, 1);
+}
+int
+evhttp_parse_query_str(const char *uri, struct evkeyvalq *headers)
+{
+ return evhttp_parse_query_impl(uri, headers, 0);
+}
+
+static struct evhttp_cb *
+evhttp_dispatch_callback(struct httpcbq *callbacks, struct evhttp_request *req)
+{
+ struct evhttp_cb *cb;
+ size_t offset = 0;
+ char *translated;
+ const char *path;
+
+ /* Test for different URLs */
+ path = evhttp_uri_get_path(req->uri_elems);
+ offset = strlen(path);
+ if ((translated = mm_malloc(offset + 1)) == NULL)
+ return (NULL);
+ evhttp_decode_uri_internal(path, offset, translated,
+ 0 /* decode_plus */);
+
+ TAILQ_FOREACH(cb, callbacks, next) {
+ if (!strcmp(cb->what, translated)) {
+ mm_free(translated);
+ return (cb);
+ }
+ }
+
+ mm_free(translated);
+ return (NULL);
+}
+
+
+static int
+prefix_suffix_match(const char *pattern, const char *name, int ignorecase)
+{
+ char c;
+
+ while (1) {
+ switch (c = *pattern++) {
+ case '\0':
+ return *name == '\0';
+
+ case '*':
+ while (*name != '\0') {
+ if (prefix_suffix_match(pattern, name,
+ ignorecase))
+ return (1);
+ ++name;
+ }
+ return (0);
+ default:
+ if (c != *name) {
+ if (!ignorecase ||
+ EVUTIL_TOLOWER_(c) != EVUTIL_TOLOWER_(*name))
+ return (0);
+ }
+ ++name;
+ }
+ }
+ /* NOTREACHED */
+}
+
+/*
+ Search the vhost hierarchy beginning with http for a server alias
+ matching hostname. If a match is found, and outhttp is non-null,
+ outhttp is set to the matching http object and 1 is returned.
+*/
+
+static int
+evhttp_find_alias(struct evhttp *http, struct evhttp **outhttp,
+ const char *hostname)
+{
+ struct evhttp_server_alias *alias;
+ struct evhttp *vhost;
+
+ TAILQ_FOREACH(alias, &http->aliases, next) {
+ /* XXX Do we need to handle IP addresses? */
+ if (!evutil_ascii_strcasecmp(alias->alias, hostname)) {
+ if (outhttp)
+ *outhttp = http;
+ return 1;
+ }
+ }
+
+ /* XXX It might be good to avoid recursion here, but I don't
+ see a way to do that w/o a list. */
+ TAILQ_FOREACH(vhost, &http->virtualhosts, next_vhost) {
+ if (evhttp_find_alias(vhost, outhttp, hostname))
+ return 1;
+ }
+
+ return 0;
+}
+
+/*
+ Attempts to find the best http object to handle a request for a hostname.
+ All aliases for the root http object and vhosts are searched for an exact
+ match. Then, the vhost hierarchy is traversed again for a matching
+ pattern.
+
+ If an alias or vhost is matched, 1 is returned, and outhttp, if non-null,
+ is set with the best matching http object. If there are no matches, the
+ root http object is stored in outhttp and 0 is returned.
+*/
+
+static int
+evhttp_find_vhost(struct evhttp *http, struct evhttp **outhttp,
+ const char *hostname)
+{
+ struct evhttp *vhost;
+ struct evhttp *oldhttp;
+ int match_found = 0;
+
+ if (evhttp_find_alias(http, outhttp, hostname))
+ return 1;
+
+ do {
+ oldhttp = http;
+ TAILQ_FOREACH(vhost, &http->virtualhosts, next_vhost) {
+ if (prefix_suffix_match(vhost->vhost_pattern,
+ hostname, 1 /* ignorecase */)) {
+ http = vhost;
+ match_found = 1;
+ break;
+ }
+ }
+ } while (oldhttp != http);
+
+ if (outhttp)
+ *outhttp = http;
+
+ return match_found;
+}
+
+static void
+evhttp_handle_request(struct evhttp_request *req, void *arg)
+{
+ struct evhttp *http = arg;
+ struct evhttp_cb *cb = NULL;
+ const char *hostname;
+
+ /* we have a new request on which the user needs to take action */
+ req->userdone = 0;
+
+ if (req->type == 0 || req->uri == NULL) {
+ evhttp_send_error(req, HTTP_BADREQUEST, NULL);
+ return;
+ }
+
+ if ((http->allowed_methods & req->type) == 0) {
+ event_debug(("Rejecting disallowed method %x (allowed: %x)\n",
+ (unsigned)req->type, (unsigned)http->allowed_methods));
+ evhttp_send_error(req, HTTP_NOTIMPLEMENTED, NULL);
+ return;
+ }
+
+ /* handle potential virtual hosts */
+ hostname = evhttp_request_get_host(req);
+ if (hostname != NULL) {
+ evhttp_find_vhost(http, &http, hostname);
+ }
+
+ if ((cb = evhttp_dispatch_callback(&http->callbacks, req)) != NULL) {
+ (*cb->cb)(req, cb->cbarg);
+ return;
+ }
+
+ /* Generic call back */
+ if (http->gencb) {
+ (*http->gencb)(req, http->gencbarg);
+ return;
+ } else {
+ /* We need to send a 404 here */
+#define ERR_FORMAT "<html><head>" \
+ "<title>404 Not Found</title>" \
+ "</head><body>" \
+ "<h1>Not Found</h1>" \
+ "<p>The requested URL %s was not found on this server.</p>"\
+ "</body></html>\n"
+
+ char *escaped_html;
+ struct evbuffer *buf;
+
+ if ((escaped_html = evhttp_htmlescape(req->uri)) == NULL) {
+ evhttp_connection_free(req->evcon);
+ return;
+ }
+
+ if ((buf = evbuffer_new()) == NULL) {
+ mm_free(escaped_html);
+ evhttp_connection_free(req->evcon);
+ return;
+ }
+
+ evhttp_response_code_(req, HTTP_NOTFOUND, "Not Found");
+
+ evbuffer_add_printf(buf, ERR_FORMAT, escaped_html);
+
+ mm_free(escaped_html);
+
+ evhttp_send_page_(req, buf);
+
+ evbuffer_free(buf);
+#undef ERR_FORMAT
+ }
+}
+
+/* Listener callback when a connection arrives at a server. */
+static void
+accept_socket_cb(struct evconnlistener *listener, evutil_socket_t nfd, struct sockaddr *peer_sa, int peer_socklen, void *arg)
+{
+ struct evhttp *http = arg;
+
+ evhttp_get_request(http, nfd, peer_sa, peer_socklen);
+}
+
+int
+evhttp_bind_socket(struct evhttp *http, const char *address, ev_uint16_t port)
+{
+ struct evhttp_bound_socket *bound =
+ evhttp_bind_socket_with_handle(http, address, port);
+ if (bound == NULL)
+ return (-1);
+ return (0);
+}
+
+struct evhttp_bound_socket *
+evhttp_bind_socket_with_handle(struct evhttp *http, const char *address, ev_uint16_t port)
+{
+ evutil_socket_t fd;
+ struct evhttp_bound_socket *bound;
+
+ if ((fd = bind_socket(address, port, 1 /*reuse*/)) == -1)
+ return (NULL);
+
+ if (listen(fd, 128) == -1) {
+ event_sock_warn(fd, "%s: listen", __func__);
+ evutil_closesocket(fd);
+ return (NULL);
+ }
+
+ bound = evhttp_accept_socket_with_handle(http, fd);
+
+ if (bound != NULL) {
+ event_debug(("Bound to port %d - Awaiting connections ... ",
+ port));
+ return (bound);
+ }
+
+ return (NULL);
+}
+
+int
+evhttp_accept_socket(struct evhttp *http, evutil_socket_t fd)
+{
+ struct evhttp_bound_socket *bound =
+ evhttp_accept_socket_with_handle(http, fd);
+ if (bound == NULL)
+ return (-1);
+ return (0);
+}
+
+void
+evhttp_foreach_bound_socket(struct evhttp *http,
+ evhttp_bound_socket_foreach_fn *function,
+ void *argument)
+{
+ struct evhttp_bound_socket *bound;
+
+ TAILQ_FOREACH(bound, &http->sockets, next)
+ function(bound, argument);
+}
+
+struct evhttp_bound_socket *
+evhttp_accept_socket_with_handle(struct evhttp *http, evutil_socket_t fd)
+{
+ struct evhttp_bound_socket *bound;
+ struct evconnlistener *listener;
+ const int flags =
+ LEV_OPT_REUSEABLE|LEV_OPT_CLOSE_ON_EXEC|LEV_OPT_CLOSE_ON_FREE;
+
+ listener = evconnlistener_new(http->base, NULL, NULL,
+ flags,
+ 0, /* Backlog is '0' because we already said 'listen' */
+ fd);
+ if (!listener)
+ return (NULL);
+
+ bound = evhttp_bind_listener(http, listener);
+ if (!bound) {
+ evconnlistener_free(listener);
+ return (NULL);
+ }
+ return (bound);
+}
+
+struct evhttp_bound_socket *
+evhttp_bind_listener(struct evhttp *http, struct evconnlistener *listener)
+{
+ struct evhttp_bound_socket *bound;
+
+ bound = mm_malloc(sizeof(struct evhttp_bound_socket));
+ if (bound == NULL)
+ return (NULL);
+
+ bound->listener = listener;
+ TAILQ_INSERT_TAIL(&http->sockets, bound, next);
+
+ evconnlistener_set_cb(listener, accept_socket_cb, http);
+ return bound;
+}
+
+evutil_socket_t
+evhttp_bound_socket_get_fd(struct evhttp_bound_socket *bound)
+{
+ return evconnlistener_get_fd(bound->listener);
+}
+
+struct evconnlistener *
+evhttp_bound_socket_get_listener(struct evhttp_bound_socket *bound)
+{
+ return bound->listener;
+}
+
+void
+evhttp_del_accept_socket(struct evhttp *http, struct evhttp_bound_socket *bound)
+{
+ TAILQ_REMOVE(&http->sockets, bound, next);
+ evconnlistener_free(bound->listener);
+ mm_free(bound);
+}
+
+static struct evhttp*
+evhttp_new_object(void)
+{
+ struct evhttp *http = NULL;
+
+ if ((http = mm_calloc(1, sizeof(struct evhttp))) == NULL) {
+ event_warn("%s: calloc", __func__);
+ return (NULL);
+ }
+
+ evutil_timerclear(&http->timeout);
+ evhttp_set_max_headers_size(http, EV_SIZE_MAX);
+ evhttp_set_max_body_size(http, EV_SIZE_MAX);
+ evhttp_set_default_content_type(http, "text/html; charset=ISO-8859-1");
+ evhttp_set_allowed_methods(http,
+ EVHTTP_REQ_GET |
+ EVHTTP_REQ_POST |
+ EVHTTP_REQ_HEAD |
+ EVHTTP_REQ_PUT |
+ EVHTTP_REQ_DELETE);
+
+ TAILQ_INIT(&http->sockets);
+ TAILQ_INIT(&http->callbacks);
+ TAILQ_INIT(&http->connections);
+ TAILQ_INIT(&http->virtualhosts);
+ TAILQ_INIT(&http->aliases);
+
+ return (http);
+}
+
+struct evhttp *
+evhttp_new(struct event_base *base)
+{
+ struct evhttp *http = NULL;
+
+ http = evhttp_new_object();
+ if (http == NULL)
+ return (NULL);
+ http->base = base;
+
+ return (http);
+}
+
+/*
+ * Start a web server on the specified address and port.
+ */
+
+struct evhttp *
+evhttp_start(const char *address, unsigned short port)
+{
+ struct evhttp *http = NULL;
+
+ http = evhttp_new_object();
+ if (http == NULL)
+ return (NULL);
+ if (evhttp_bind_socket(http, address, port) == -1) {
+ mm_free(http);
+ return (NULL);
+ }
+
+ return (http);
+}
+
+void
+evhttp_free(struct evhttp* http)
+{
+ struct evhttp_cb *http_cb;
+ struct evhttp_connection *evcon;
+ struct evhttp_bound_socket *bound;
+ struct evhttp* vhost;
+ struct evhttp_server_alias *alias;
+
+ /* Remove the accepting part */
+ while ((bound = TAILQ_FIRST(&http->sockets)) != NULL) {
+ TAILQ_REMOVE(&http->sockets, bound, next);
+
+ evconnlistener_free(bound->listener);
+
+ mm_free(bound);
+ }
+
+ while ((evcon = TAILQ_FIRST(&http->connections)) != NULL) {
+ /* evhttp_connection_free removes the connection */
+ evhttp_connection_free(evcon);
+ }
+
+ while ((http_cb = TAILQ_FIRST(&http->callbacks)) != NULL) {
+ TAILQ_REMOVE(&http->callbacks, http_cb, next);
+ mm_free(http_cb->what);
+ mm_free(http_cb);
+ }
+
+ while ((vhost = TAILQ_FIRST(&http->virtualhosts)) != NULL) {
+ TAILQ_REMOVE(&http->virtualhosts, vhost, next_vhost);
+
+ evhttp_free(vhost);
+ }
+
+ if (http->vhost_pattern != NULL)
+ mm_free(http->vhost_pattern);
+
+ while ((alias = TAILQ_FIRST(&http->aliases)) != NULL) {
+ TAILQ_REMOVE(&http->aliases, alias, next);
+ mm_free(alias->alias);
+ mm_free(alias);
+ }
+
+ mm_free(http);
+}
+
+int
+evhttp_add_virtual_host(struct evhttp* http, const char *pattern,
+ struct evhttp* vhost)
+{
+ /* a vhost can only be a vhost once and should not have bound sockets */
+ if (vhost->vhost_pattern != NULL ||
+ TAILQ_FIRST(&vhost->sockets) != NULL)
+ return (-1);
+
+ vhost->vhost_pattern = mm_strdup(pattern);
+ if (vhost->vhost_pattern == NULL)
+ return (-1);
+
+ TAILQ_INSERT_TAIL(&http->virtualhosts, vhost, next_vhost);
+
+ return (0);
+}
+
+int
+evhttp_remove_virtual_host(struct evhttp* http, struct evhttp* vhost)
+{
+ if (vhost->vhost_pattern == NULL)
+ return (-1);
+
+ TAILQ_REMOVE(&http->virtualhosts, vhost, next_vhost);
+
+ mm_free(vhost->vhost_pattern);
+ vhost->vhost_pattern = NULL;
+
+ return (0);
+}
+
+int
+evhttp_add_server_alias(struct evhttp *http, const char *alias)
+{
+ struct evhttp_server_alias *evalias;
+
+ evalias = mm_calloc(1, sizeof(*evalias));
+ if (!evalias)
+ return -1;
+
+ evalias->alias = mm_strdup(alias);
+ if (!evalias->alias) {
+ mm_free(evalias);
+ return -1;
+ }
+
+ TAILQ_INSERT_TAIL(&http->aliases, evalias, next);
+
+ return 0;
+}
+
+int
+evhttp_remove_server_alias(struct evhttp *http, const char *alias)
+{
+ struct evhttp_server_alias *evalias;
+
+ TAILQ_FOREACH(evalias, &http->aliases, next) {
+ if (evutil_ascii_strcasecmp(evalias->alias, alias) == 0) {
+ TAILQ_REMOVE(&http->aliases, evalias, next);
+ mm_free(evalias->alias);
+ mm_free(evalias);
+ return 0;
+ }
+ }
+
+ return -1;
+}
+
+void
+evhttp_set_timeout(struct evhttp* http, int timeout_in_secs)
+{
+ if (timeout_in_secs == -1) {
+ evhttp_set_timeout_tv(http, NULL);
+ } else {
+ struct timeval tv;
+ tv.tv_sec = timeout_in_secs;
+ tv.tv_usec = 0;
+ evhttp_set_timeout_tv(http, &tv);
+ }
+}
+
+void
+evhttp_set_timeout_tv(struct evhttp* http, const struct timeval* tv)
+{
+ if (tv) {
+ http->timeout = *tv;
+ } else {
+ evutil_timerclear(&http->timeout);
+ }
+}
+
+void
+evhttp_set_max_headers_size(struct evhttp* http, ev_ssize_t max_headers_size)
+{
+ if (max_headers_size < 0)
+ http->default_max_headers_size = EV_SIZE_MAX;
+ else
+ http->default_max_headers_size = max_headers_size;
+}
+
+void
+evhttp_set_max_body_size(struct evhttp* http, ev_ssize_t max_body_size)
+{
+ if (max_body_size < 0)
+ http->default_max_body_size = EV_UINT64_MAX;
+ else
+ http->default_max_body_size = max_body_size;
+}
+
+void
+evhttp_set_default_content_type(struct evhttp *http,
+ const char *content_type) {
+ http->default_content_type = content_type;
+}
+
+void
+evhttp_set_allowed_methods(struct evhttp* http, ev_uint16_t methods)
+{
+ http->allowed_methods = methods;
+}
+
+int
+evhttp_set_cb(struct evhttp *http, const char *uri,
+ void (*cb)(struct evhttp_request *, void *), void *cbarg)
+{
+ struct evhttp_cb *http_cb;
+
+ TAILQ_FOREACH(http_cb, &http->callbacks, next) {
+ if (strcmp(http_cb->what, uri) == 0)
+ return (-1);
+ }
+
+ if ((http_cb = mm_calloc(1, sizeof(struct evhttp_cb))) == NULL) {
+ event_warn("%s: calloc", __func__);
+ return (-2);
+ }
+
+ http_cb->what = mm_strdup(uri);
+ if (http_cb->what == NULL) {
+ event_warn("%s: strdup", __func__);
+ mm_free(http_cb);
+ return (-3);
+ }
+ http_cb->cb = cb;
+ http_cb->cbarg = cbarg;
+
+ TAILQ_INSERT_TAIL(&http->callbacks, http_cb, next);
+
+ return (0);
+}
+
+int
+evhttp_del_cb(struct evhttp *http, const char *uri)
+{
+ struct evhttp_cb *http_cb;
+
+ TAILQ_FOREACH(http_cb, &http->callbacks, next) {
+ if (strcmp(http_cb->what, uri) == 0)
+ break;
+ }
+ if (http_cb == NULL)
+ return (-1);
+
+ TAILQ_REMOVE(&http->callbacks, http_cb, next);
+ mm_free(http_cb->what);
+ mm_free(http_cb);
+
+ return (0);
+}
+
+void
+evhttp_set_gencb(struct evhttp *http,
+ void (*cb)(struct evhttp_request *, void *), void *cbarg)
+{
+ http->gencb = cb;
+ http->gencbarg = cbarg;
+}
+
+void
+evhttp_set_bevcb(struct evhttp *http,
+ struct bufferevent* (*cb)(struct event_base *, void *), void *cbarg)
+{
+ http->bevcb = cb;
+ http->bevcbarg = cbarg;
+}
+
+/*
+ * Request related functions
+ */
+
+struct evhttp_request *
+evhttp_request_new(void (*cb)(struct evhttp_request *, void *), void *arg)
+{
+ struct evhttp_request *req = NULL;
+
+ /* Allocate request structure */
+ if ((req = mm_calloc(1, sizeof(struct evhttp_request))) == NULL) {
+ event_warn("%s: calloc", __func__);
+ goto error;
+ }
+
+ req->headers_size = 0;
+ req->body_size = 0;
+
+ req->kind = EVHTTP_RESPONSE;
+ req->input_headers = mm_calloc(1, sizeof(struct evkeyvalq));
+ if (req->input_headers == NULL) {
+ event_warn("%s: calloc", __func__);
+ goto error;
+ }
+ TAILQ_INIT(req->input_headers);
+
+ req->output_headers = mm_calloc(1, sizeof(struct evkeyvalq));
+ if (req->output_headers == NULL) {
+ event_warn("%s: calloc", __func__);
+ goto error;
+ }
+ TAILQ_INIT(req->output_headers);
+
+ if ((req->input_buffer = evbuffer_new()) == NULL) {
+ event_warn("%s: evbuffer_new", __func__);
+ goto error;
+ }
+
+ if ((req->output_buffer = evbuffer_new()) == NULL) {
+ event_warn("%s: evbuffer_new", __func__);
+ goto error;
+ }
+
+ req->cb = cb;
+ req->cb_arg = arg;
+
+ return (req);
+
+ error:
+ if (req != NULL)
+ evhttp_request_free(req);
+ return (NULL);
+}
+
+void
+evhttp_request_free(struct evhttp_request *req)
+{
+ if ((req->flags & EVHTTP_REQ_DEFER_FREE) != 0) {
+ req->flags |= EVHTTP_REQ_NEEDS_FREE;
+ return;
+ }
+
+ if (req->remote_host != NULL)
+ mm_free(req->remote_host);
+ if (req->uri != NULL)
+ mm_free(req->uri);
+ if (req->uri_elems != NULL)
+ evhttp_uri_free(req->uri_elems);
+ if (req->response_code_line != NULL)
+ mm_free(req->response_code_line);
+ if (req->host_cache != NULL)
+ mm_free(req->host_cache);
+
+ evhttp_clear_headers(req->input_headers);
+ mm_free(req->input_headers);
+
+ evhttp_clear_headers(req->output_headers);
+ mm_free(req->output_headers);
+
+ if (req->input_buffer != NULL)
+ evbuffer_free(req->input_buffer);
+
+ if (req->output_buffer != NULL)
+ evbuffer_free(req->output_buffer);
+
+ mm_free(req);
+}
+
+void
+evhttp_request_own(struct evhttp_request *req)
+{
+ req->flags |= EVHTTP_USER_OWNED;
+}
+
+int
+evhttp_request_is_owned(struct evhttp_request *req)
+{
+ return (req->flags & EVHTTP_USER_OWNED) != 0;
+}
+
+struct evhttp_connection *
+evhttp_request_get_connection(struct evhttp_request *req)
+{
+ return req->evcon;
+}
+
+struct event_base *
+evhttp_connection_get_base(struct evhttp_connection *conn)
+{
+ return conn->base;
+}
+
+void
+evhttp_request_set_chunked_cb(struct evhttp_request *req,
+ void (*cb)(struct evhttp_request *, void *))
+{
+ req->chunk_cb = cb;
+}
+
+void
+evhttp_request_set_header_cb(struct evhttp_request *req,
+ int (*cb)(struct evhttp_request *, void *))
+{
+ req->header_cb = cb;
+}
+
+void
+evhttp_request_set_error_cb(struct evhttp_request *req,
+ void (*cb)(enum evhttp_request_error, void *))
+{
+ req->error_cb = cb;
+}
+
+void
+evhttp_request_set_on_complete_cb(struct evhttp_request *req,
+ void (*cb)(struct evhttp_request *, void *), void *cb_arg)
+{
+ req->on_complete_cb = cb;
+ req->on_complete_cb_arg = cb_arg;
+}
+
+/*
+ * Allows for inspection of the request URI
+ */
+
+const char *
+evhttp_request_get_uri(const struct evhttp_request *req) {
+ if (req->uri == NULL)
+ event_debug(("%s: request %p has no uri\n", __func__, req));
+ return (req->uri);
+}
+
+const struct evhttp_uri *
+evhttp_request_get_evhttp_uri(const struct evhttp_request *req) {
+ if (req->uri_elems == NULL)
+ event_debug(("%s: request %p has no uri elems\n",
+ __func__, req));
+ return (req->uri_elems);
+}
+
+const char *
+evhttp_request_get_host(struct evhttp_request *req)
+{
+ const char *host = NULL;
+
+ if (req->host_cache)
+ return req->host_cache;
+
+ if (req->uri_elems)
+ host = evhttp_uri_get_host(req->uri_elems);
+ if (!host && req->input_headers) {
+ const char *p;
+ size_t len;
+
+ host = evhttp_find_header(req->input_headers, "Host");
+ /* The Host: header may include a port. Remove it here
+ to be consistent with uri_elems case above. */
+ if (host) {
+ p = host + strlen(host) - 1;
+ while (p > host && EVUTIL_ISDIGIT_(*p))
+ --p;
+ if (p > host && *p == ':') {
+ len = p - host;
+ req->host_cache = mm_malloc(len + 1);
+ if (!req->host_cache) {
+ event_warn("%s: malloc", __func__);
+ return NULL;
+ }
+ memcpy(req->host_cache, host, len);
+ req->host_cache[len] = '\0';
+ host = req->host_cache;
+ }
+ }
+ }
+
+ return host;
+}
+
+enum evhttp_cmd_type
+evhttp_request_get_command(const struct evhttp_request *req) {
+ return (req->type);
+}
+
+int
+evhttp_request_get_response_code(const struct evhttp_request *req)
+{
+ return req->response_code;
+}
+
+const char *
+evhttp_request_get_response_code_line(const struct evhttp_request *req)
+{
+ return req->response_code_line;
+}
+
+/** Returns the input headers */
+struct evkeyvalq *evhttp_request_get_input_headers(struct evhttp_request *req)
+{
+ return (req->input_headers);
+}
+
+/** Returns the output headers */
+struct evkeyvalq *evhttp_request_get_output_headers(struct evhttp_request *req)
+{
+ return (req->output_headers);
+}
+
+/** Returns the input buffer */
+struct evbuffer *evhttp_request_get_input_buffer(struct evhttp_request *req)
+{
+ return (req->input_buffer);
+}
+
+/** Returns the output buffer */
+struct evbuffer *evhttp_request_get_output_buffer(struct evhttp_request *req)
+{
+ return (req->output_buffer);
+}
+
+
+/*
+ * Takes a file descriptor to read a request from.
+ * The callback is executed once the whole request has been read.
+ */
+
+static struct evhttp_connection*
+evhttp_get_request_connection(
+ struct evhttp* http,
+ evutil_socket_t fd, struct sockaddr *sa, ev_socklen_t salen)
+{
+ struct evhttp_connection *evcon;
+ char *hostname = NULL, *portname = NULL;
+ struct bufferevent* bev = NULL;
+
+ name_from_addr(sa, salen, &hostname, &portname);
+ if (hostname == NULL || portname == NULL) {
+ if (hostname) mm_free(hostname);
+ if (portname) mm_free(portname);
+ return (NULL);
+ }
+
+ event_debug(("%s: new request from %s:%s on "EV_SOCK_FMT"\n",
+ __func__, hostname, portname, EV_SOCK_ARG(fd)));
+
+ /* we need a connection object to put the http request on */
+ if (http->bevcb != NULL) {
+ bev = (*http->bevcb)(http->base, http->bevcbarg);
+ }
+ evcon = evhttp_connection_base_bufferevent_new(
+ http->base, NULL, bev, hostname, atoi(portname));
+ mm_free(hostname);
+ mm_free(portname);
+ if (evcon == NULL)
+ return (NULL);
+
+ evcon->max_headers_size = http->default_max_headers_size;
+ evcon->max_body_size = http->default_max_body_size;
+
+ evcon->flags |= EVHTTP_CON_INCOMING;
+ evcon->state = EVCON_READING_FIRSTLINE;
+
+ evcon->fd = fd;
+
+ bufferevent_enable(evcon->bufev, EV_READ);
+ bufferevent_disable(evcon->bufev, EV_WRITE);
+ bufferevent_setfd(evcon->bufev, fd);
+
+ return (evcon);
+}
+
+static int
+evhttp_associate_new_request_with_connection(struct evhttp_connection *evcon)
+{
+ struct evhttp *http = evcon->http_server;
+ struct evhttp_request *req;
+ if ((req = evhttp_request_new(evhttp_handle_request, http)) == NULL)
+ return (-1);
+
+ if ((req->remote_host = mm_strdup(evcon->address)) == NULL) {
+ event_warn("%s: strdup", __func__);
+ evhttp_request_free(req);
+ return (-1);
+ }
+ req->remote_port = evcon->port;
+
+ req->evcon = evcon; /* the request ends up owning the connection */
+ req->flags |= EVHTTP_REQ_OWN_CONNECTION;
+
+ /* We did not present the request to the user user yet, so treat it as
+ * if the user was done with the request. This allows us to free the
+ * request on a persistent connection if the client drops it without
+ * sending a request.
+ */
+ req->userdone = 1;
+
+ TAILQ_INSERT_TAIL(&evcon->requests, req, next);
+
+ req->kind = EVHTTP_REQUEST;
+
+
+ evhttp_start_read_(evcon);
+
+ return (0);
+}
+
+static void
+evhttp_get_request(struct evhttp *http, evutil_socket_t fd,
+ struct sockaddr *sa, ev_socklen_t salen)
+{
+ struct evhttp_connection *evcon;
+
+ evcon = evhttp_get_request_connection(http, fd, sa, salen);
+ if (evcon == NULL) {
+ event_sock_warn(fd, "%s: cannot get connection on "EV_SOCK_FMT,
+ __func__, EV_SOCK_ARG(fd));
+ evutil_closesocket(fd);
+ return;
+ }
+
+ /* the timeout can be used by the server to close idle connections */
+ if (evutil_timerisset(&http->timeout))
+ evhttp_connection_set_timeout_tv(evcon, &http->timeout);
+
+ /*
+ * if we want to accept more than one request on a connection,
+ * we need to know which http server it belongs to.
+ */
+ evcon->http_server = http;
+ TAILQ_INSERT_TAIL(&http->connections, evcon, next);
+
+ if (evhttp_associate_new_request_with_connection(evcon) == -1)
+ evhttp_connection_free(evcon);
+}
+
+
+/*
+ * Network helper functions that we do not want to export to the rest of
+ * the world.
+ */
+
+static void
+name_from_addr(struct sockaddr *sa, ev_socklen_t salen,
+ char **phost, char **pport)
+{
+ char ntop[NI_MAXHOST];
+ char strport[NI_MAXSERV];
+ int ni_result;
+
+#ifdef EVENT__HAVE_GETNAMEINFO
+ ni_result = getnameinfo(sa, salen,
+ ntop, sizeof(ntop), strport, sizeof(strport),
+ NI_NUMERICHOST|NI_NUMERICSERV);
+
+ if (ni_result != 0) {
+#ifdef EAI_SYSTEM
+ /* Windows doesn't have an EAI_SYSTEM. */
+ if (ni_result == EAI_SYSTEM)
+ event_err(1, "getnameinfo failed");
+ else
+#endif
+ event_errx(1, "getnameinfo failed: %s", gai_strerror(ni_result));
+ return;
+ }
+#else
+ ni_result = fake_getnameinfo(sa, salen,
+ ntop, sizeof(ntop), strport, sizeof(strport),
+ NI_NUMERICHOST|NI_NUMERICSERV);
+ if (ni_result != 0)
+ return;
+#endif
+
+ *phost = mm_strdup(ntop);
+ *pport = mm_strdup(strport);
+}
+
+/* Create a non-blocking socket and bind it */
+/* todo: rename this function */
+static evutil_socket_t
+bind_socket_ai(struct evutil_addrinfo *ai, int reuse)
+{
+ evutil_socket_t fd;
+
+ int on = 1, r;
+ int serrno;
+
+ /* Create listen socket */
+ fd = evutil_socket_(ai ? ai->ai_family : AF_INET,
+ SOCK_STREAM|EVUTIL_SOCK_NONBLOCK|EVUTIL_SOCK_CLOEXEC, 0);
+ if (fd == -1) {
+ event_sock_warn(-1, "socket");
+ return (-1);
+ }
+
+ if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (void *)&on, sizeof(on))<0)
+ goto out;
+ if (reuse) {
+ if (evutil_make_listen_socket_reuseable(fd) < 0)
+ goto out;
+ }
+
+ if (ai != NULL) {
+ r = bind(fd, ai->ai_addr, (ev_socklen_t)ai->ai_addrlen);
+ if (r == -1)
+ goto out;
+ }
+
+ return (fd);
+
+ out:
+ serrno = EVUTIL_SOCKET_ERROR();
+ evutil_closesocket(fd);
+ EVUTIL_SET_SOCKET_ERROR(serrno);
+ return (-1);
+}
+
+static struct evutil_addrinfo *
+make_addrinfo(const char *address, ev_uint16_t port)
+{
+ struct evutil_addrinfo *ai = NULL;
+
+ struct evutil_addrinfo hints;
+ char strport[NI_MAXSERV];
+ int ai_result;
+
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ /* turn NULL hostname into INADDR_ANY, and skip looking up any address
+ * types we don't have an interface to connect to. */
+ hints.ai_flags = EVUTIL_AI_PASSIVE|EVUTIL_AI_ADDRCONFIG;
+ evutil_snprintf(strport, sizeof(strport), "%d", port);
+ if ((ai_result = evutil_getaddrinfo(address, strport, &hints, &ai))
+ != 0) {
+ if (ai_result == EVUTIL_EAI_SYSTEM)
+ event_warn("getaddrinfo");
+ else
+ event_warnx("getaddrinfo: %s",
+ evutil_gai_strerror(ai_result));
+ return (NULL);
+ }
+
+ return (ai);
+}
+
+static evutil_socket_t
+bind_socket(const char *address, ev_uint16_t port, int reuse)
+{
+ evutil_socket_t fd;
+ struct evutil_addrinfo *aitop = NULL;
+
+ /* just create an unbound socket */
+ if (address == NULL && port == 0)
+ return bind_socket_ai(NULL, 0);
+
+ aitop = make_addrinfo(address, port);
+
+ if (aitop == NULL)
+ return (-1);
+
+ fd = bind_socket_ai(aitop, reuse);
+
+ evutil_freeaddrinfo(aitop);
+
+ return (fd);
+}
+
+struct evhttp_uri {
+ unsigned flags;
+ char *scheme; /* scheme; e.g http, ftp etc */
+ char *userinfo; /* userinfo (typically username:pass), or NULL */
+ char *host; /* hostname, IP address, or NULL */
+ int port; /* port, or zero */
+ char *path; /* path, or "". */
+ char *query; /* query, or NULL */
+ char *fragment; /* fragment or NULL */
+};
+
+struct evhttp_uri *
+evhttp_uri_new(void)
+{
+ struct evhttp_uri *uri = mm_calloc(sizeof(struct evhttp_uri), 1);
+ if (uri)
+ uri->port = -1;
+ return uri;
+}
+
+void
+evhttp_uri_set_flags(struct evhttp_uri *uri, unsigned flags)
+{
+ uri->flags = flags;
+}
+
+/* Return true if the string starting at s and ending immediately before eos
+ * is a valid URI scheme according to RFC3986
+ */
+static int
+scheme_ok(const char *s, const char *eos)
+{
+ /* scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) */
+ EVUTIL_ASSERT(eos >= s);
+ if (s == eos)
+ return 0;
+ if (!EVUTIL_ISALPHA_(*s))
+ return 0;
+ while (++s < eos) {
+ if (! EVUTIL_ISALNUM_(*s) &&
+ *s != '+' && *s != '-' && *s != '.')
+ return 0;
+ }
+ return 1;
+}
+
+#define SUBDELIMS "!$&'()*+,;="
+
+/* Return true iff [s..eos) is a valid userinfo */
+static int
+userinfo_ok(const char *s, const char *eos)
+{
+ while (s < eos) {
+ if (CHAR_IS_UNRESERVED(*s) ||
+ strchr(SUBDELIMS, *s) ||
+ *s == ':')
+ ++s;
+ else if (*s == '%' && s+2 < eos &&
+ EVUTIL_ISXDIGIT_(s[1]) &&
+ EVUTIL_ISXDIGIT_(s[2]))
+ s += 3;
+ else
+ return 0;
+ }
+ return 1;
+}
+
+static int
+regname_ok(const char *s, const char *eos)
+{
+ while (s && s<eos) {
+ if (CHAR_IS_UNRESERVED(*s) ||
+ strchr(SUBDELIMS, *s))
+ ++s;
+ else if (*s == '%' &&
+ EVUTIL_ISXDIGIT_(s[1]) &&
+ EVUTIL_ISXDIGIT_(s[2]))
+ s += 3;
+ else
+ return 0;
+ }
+ return 1;
+}
+
+static int
+parse_port(const char *s, const char *eos)
+{
+ int portnum = 0;
+ while (s < eos) {
+ if (! EVUTIL_ISDIGIT_(*s))
+ return -1;
+ portnum = (portnum * 10) + (*s - '0');
+ if (portnum < 0)
+ return -1;
+ if (portnum > 65535)
+ return -1;
+ ++s;
+ }
+ return portnum;
+}
+
+/* returns 0 for bad, 1 for ipv6, 2 for IPvFuture */
+static int
+bracket_addr_ok(const char *s, const char *eos)
+{
+ if (s + 3 > eos || *s != '[' || *(eos-1) != ']')
+ return 0;
+ if (s[1] == 'v') {
+ /* IPvFuture, or junk.
+ "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
+ */
+ s += 2; /* skip [v */
+ --eos;
+ if (!EVUTIL_ISXDIGIT_(*s)) /*require at least one*/
+ return 0;
+ while (s < eos && *s != '.') {
+ if (EVUTIL_ISXDIGIT_(*s))
+ ++s;
+ else
+ return 0;
+ }
+ if (*s != '.')
+ return 0;
+ ++s;
+ while (s < eos) {
+ if (CHAR_IS_UNRESERVED(*s) ||
+ strchr(SUBDELIMS, *s) ||
+ *s == ':')
+ ++s;
+ else
+ return 0;
+ }
+ return 2;
+ } else {
+ /* IPv6, or junk */
+ char buf[64];
+ ev_ssize_t n_chars = eos-s-2;
+ struct in6_addr in6;
+ if (n_chars >= 64) /* way too long */
+ return 0;
+ memcpy(buf, s+1, n_chars);
+ buf[n_chars]='\0';
+ return (evutil_inet_pton(AF_INET6,buf,&in6)==1) ? 1 : 0;
+ }
+}
+
+static int
+parse_authority(struct evhttp_uri *uri, char *s, char *eos)
+{
+ char *cp, *port;
+ EVUTIL_ASSERT(eos);
+ if (eos == s) {
+ uri->host = mm_strdup("");
+ if (uri->host == NULL) {
+ event_warn("%s: strdup", __func__);
+ return -1;
+ }
+ return 0;
+ }
+
+ /* Optionally, we start with "userinfo@" */
+
+ cp = strchr(s, '@');
+ if (cp && cp < eos) {
+ if (! userinfo_ok(s,cp))
+ return -1;
+ *cp++ = '\0';
+ uri->userinfo = mm_strdup(s);
+ if (uri->userinfo == NULL) {
+ event_warn("%s: strdup", __func__);
+ return -1;
+ }
+ } else {
+ cp = s;
+ }
+ /* Optionally, we end with ":port" */
+ for (port=eos-1; port >= cp && EVUTIL_ISDIGIT_(*port); --port)
+ ;
+ if (port >= cp && *port == ':') {
+ if (port+1 == eos) /* Leave port unspecified; the RFC allows a
+ * nil port */
+ uri->port = -1;
+ else if ((uri->port = parse_port(port+1, eos))<0)
+ return -1;
+ eos = port;
+ }
+ /* Now, cp..eos holds the "host" port, which can be an IPv4Address,
+ * an IP-Literal, or a reg-name */
+ EVUTIL_ASSERT(eos >= cp);
+ if (*cp == '[' && eos >= cp+2 && *(eos-1) == ']') {
+ /* IPv6address, IP-Literal, or junk. */
+ if (! bracket_addr_ok(cp, eos))
+ return -1;
+ } else {
+ /* Make sure the host part is ok. */
+ if (! regname_ok(cp,eos)) /* Match IPv4Address or reg-name */
+ return -1;
+ }
+ uri->host = mm_malloc(eos-cp+1);
+ if (uri->host == NULL) {
+ event_warn("%s: malloc", __func__);
+ return -1;
+ }
+ memcpy(uri->host, cp, eos-cp);
+ uri->host[eos-cp] = '\0';
+ return 0;
+
+}
+
+static char *
+end_of_authority(char *cp)
+{
+ while (*cp) {
+ if (*cp == '?' || *cp == '#' || *cp == '/')
+ return cp;
+ ++cp;
+ }
+ return cp;
+}
+
+enum uri_part {
+ PART_PATH,
+ PART_QUERY,
+ PART_FRAGMENT
+};
+
+/* Return the character after the longest prefix of 'cp' that matches...
+ * *pchar / "/" if allow_qchars is false, or
+ * *(pchar / "/" / "?") if allow_qchars is true.
+ */
+static char *
+end_of_path(char *cp, enum uri_part part, unsigned flags)
+{
+ if (flags & EVHTTP_URI_NONCONFORMANT) {
+ /* If NONCONFORMANT:
+ * Path is everything up to a # or ? or nul.
+ * Query is everything up a # or nul
+ * Fragment is everything up to a nul.
+ */
+ switch (part) {
+ case PART_PATH:
+ while (*cp && *cp != '#' && *cp != '?')
+ ++cp;
+ break;
+ case PART_QUERY:
+ while (*cp && *cp != '#')
+ ++cp;
+ break;
+ case PART_FRAGMENT:
+ cp += strlen(cp);
+ break;
+ };
+ return cp;
+ }
+
+ while (*cp) {
+ if (CHAR_IS_UNRESERVED(*cp) ||
+ strchr(SUBDELIMS, *cp) ||
+ *cp == ':' || *cp == '@' || *cp == '/')
+ ++cp;
+ else if (*cp == '%' && EVUTIL_ISXDIGIT_(cp[1]) &&
+ EVUTIL_ISXDIGIT_(cp[2]))
+ cp += 3;
+ else if (*cp == '?' && part != PART_PATH)
+ ++cp;
+ else
+ return cp;
+ }
+ return cp;
+}
+
+static int
+path_matches_noscheme(const char *cp)
+{
+ while (*cp) {
+ if (*cp == ':')
+ return 0;
+ else if (*cp == '/')
+ return 1;
+ ++cp;
+ }
+ return 1;
+}
+
+struct evhttp_uri *
+evhttp_uri_parse(const char *source_uri)
+{
+ return evhttp_uri_parse_with_flags(source_uri, 0);
+}
+
+struct evhttp_uri *
+evhttp_uri_parse_with_flags(const char *source_uri, unsigned flags)
+{
+ char *readbuf = NULL, *readp = NULL, *token = NULL, *query = NULL;
+ char *path = NULL, *fragment = NULL;
+ int got_authority = 0;
+
+ struct evhttp_uri *uri = mm_calloc(1, sizeof(struct evhttp_uri));
+ if (uri == NULL) {
+ event_warn("%s: calloc", __func__);
+ goto err;
+ }
+ uri->port = -1;
+ uri->flags = flags;
+
+ readbuf = mm_strdup(source_uri);
+ if (readbuf == NULL) {
+ event_warn("%s: strdup", __func__);
+ goto err;
+ }
+
+ readp = readbuf;
+ token = NULL;
+
+ /* We try to follow RFC3986 here as much as we can, and match
+ the productions
+
+ URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
+
+ relative-ref = relative-part [ "?" query ] [ "#" fragment ]
+ */
+
+ /* 1. scheme: */
+ token = strchr(readp, ':');
+ if (token && scheme_ok(readp,token)) {
+ *token = '\0';
+ uri->scheme = mm_strdup(readp);
+ if (uri->scheme == NULL) {
+ event_warn("%s: strdup", __func__);
+ goto err;
+ }
+ readp = token+1; /* eat : */
+ }
+
+ /* 2. Optionally, "//" then an 'authority' part. */
+ if (readp[0]=='/' && readp[1] == '/') {
+ char *authority;
+ readp += 2;
+ authority = readp;
+ path = end_of_authority(readp);
+ if (parse_authority(uri, authority, path) < 0)
+ goto err;
+ readp = path;
+ got_authority = 1;
+ }
+
+ /* 3. Query: path-abempty, path-absolute, path-rootless, or path-empty
+ */
+ path = readp;
+ readp = end_of_path(path, PART_PATH, flags);
+
+ /* Query */
+ if (*readp == '?') {
+ *readp = '\0';
+ ++readp;
+ query = readp;
+ readp = end_of_path(readp, PART_QUERY, flags);
+ }
+ /* fragment */
+ if (*readp == '#') {
+ *readp = '\0';
+ ++readp;
+ fragment = readp;
+ readp = end_of_path(readp, PART_FRAGMENT, flags);
+ }
+ if (*readp != '\0') {
+ goto err;
+ }
+
+ /* These next two cases may be unreachable; I'm leaving them
+ * in to be defensive. */
+ /* If you didn't get an authority, the path can't begin with "//" */
+ if (!got_authority && path[0]=='/' && path[1]=='/')
+ goto err;
+ /* If you did get an authority, the path must begin with "/" or be
+ * empty. */
+ if (got_authority && path[0] != '/' && path[0] != '\0')
+ goto err;
+ /* (End of maybe-unreachable cases) */
+
+ /* If there was no scheme, the first part of the path (if any) must
+ * have no colon in it. */
+ if (! uri->scheme && !path_matches_noscheme(path))
+ goto err;
+
+ EVUTIL_ASSERT(path);
+ uri->path = mm_strdup(path);
+ if (uri->path == NULL) {
+ event_warn("%s: strdup", __func__);
+ goto err;
+ }
+
+ if (query) {
+ uri->query = mm_strdup(query);
+ if (uri->query == NULL) {
+ event_warn("%s: strdup", __func__);
+ goto err;
+ }
+ }
+ if (fragment) {
+ uri->fragment = mm_strdup(fragment);
+ if (uri->fragment == NULL) {
+ event_warn("%s: strdup", __func__);
+ goto err;
+ }
+ }
+
+ mm_free(readbuf);
+
+ return uri;
+err:
+ if (uri)
+ evhttp_uri_free(uri);
+ if (readbuf)
+ mm_free(readbuf);
+ return NULL;
+}
+
+void
+evhttp_uri_free(struct evhttp_uri *uri)
+{
+#define URI_FREE_STR_(f) \
+ if (uri->f) { \
+ mm_free(uri->f); \
+ }
+
+ URI_FREE_STR_(scheme);
+ URI_FREE_STR_(userinfo);
+ URI_FREE_STR_(host);
+ URI_FREE_STR_(path);
+ URI_FREE_STR_(query);
+ URI_FREE_STR_(fragment);
+
+ mm_free(uri);
+#undef URI_FREE_STR_
+}
+
+char *
+evhttp_uri_join(struct evhttp_uri *uri, char *buf, size_t limit)
+{
+ struct evbuffer *tmp = 0;
+ size_t joined_size = 0;
+ char *output = NULL;
+
+#define URI_ADD_(f) evbuffer_add(tmp, uri->f, strlen(uri->f))
+
+ if (!uri || !buf || !limit)
+ return NULL;
+
+ tmp = evbuffer_new();
+ if (!tmp)
+ return NULL;
+
+ if (uri->scheme) {
+ URI_ADD_(scheme);
+ evbuffer_add(tmp, ":", 1);
+ }
+ if (uri->host) {
+ evbuffer_add(tmp, "//", 2);
+ if (uri->userinfo)
+ evbuffer_add_printf(tmp,"%s@", uri->userinfo);
+ URI_ADD_(host);
+ if (uri->port >= 0)
+ evbuffer_add_printf(tmp,":%d", uri->port);
+
+ if (uri->path && uri->path[0] != '/' && uri->path[0] != '\0')
+ goto err;
+ }
+
+ if (uri->path)
+ URI_ADD_(path);
+
+ if (uri->query) {
+ evbuffer_add(tmp, "?", 1);
+ URI_ADD_(query);
+ }
+
+ if (uri->fragment) {
+ evbuffer_add(tmp, "#", 1);
+ URI_ADD_(fragment);
+ }
+
+ evbuffer_add(tmp, "\0", 1); /* NUL */
+
+ joined_size = evbuffer_get_length(tmp);
+
+ if (joined_size > limit) {
+ /* It doesn't fit. */
+ evbuffer_free(tmp);
+ return NULL;
+ }
+ evbuffer_remove(tmp, buf, joined_size);
+
+ output = buf;
+err:
+ evbuffer_free(tmp);
+
+ return output;
+#undef URI_ADD_
+}
+
+const char *
+evhttp_uri_get_scheme(const struct evhttp_uri *uri)
+{
+ return uri->scheme;
+}
+const char *
+evhttp_uri_get_userinfo(const struct evhttp_uri *uri)
+{
+ return uri->userinfo;
+}
+const char *
+evhttp_uri_get_host(const struct evhttp_uri *uri)
+{
+ return uri->host;
+}
+int
+evhttp_uri_get_port(const struct evhttp_uri *uri)
+{
+ return uri->port;
+}
+const char *
+evhttp_uri_get_path(const struct evhttp_uri *uri)
+{
+ return uri->path;
+}
+const char *
+evhttp_uri_get_query(const struct evhttp_uri *uri)
+{
+ return uri->query;
+}
+const char *
+evhttp_uri_get_fragment(const struct evhttp_uri *uri)
+{
+ return uri->fragment;
+}
+
+#define URI_SET_STR_(f) do { \
+ if (uri->f) \
+ mm_free(uri->f); \
+ if (f) { \
+ if ((uri->f = mm_strdup(f)) == NULL) { \
+ event_warn("%s: strdup()", __func__); \
+ return -1; \
+ } \
+ } else { \
+ uri->f = NULL; \
+ } \
+ } while(0)
+
+int
+evhttp_uri_set_scheme(struct evhttp_uri *uri, const char *scheme)
+{
+ if (scheme && !scheme_ok(scheme, scheme+strlen(scheme)))
+ return -1;
+
+ URI_SET_STR_(scheme);
+ return 0;
+}
+int
+evhttp_uri_set_userinfo(struct evhttp_uri *uri, const char *userinfo)
+{
+ if (userinfo && !userinfo_ok(userinfo, userinfo+strlen(userinfo)))
+ return -1;
+ URI_SET_STR_(userinfo);
+ return 0;
+}
+int
+evhttp_uri_set_host(struct evhttp_uri *uri, const char *host)
+{
+ if (host) {
+ if (host[0] == '[') {
+ if (! bracket_addr_ok(host, host+strlen(host)))
+ return -1;
+ } else {
+ if (! regname_ok(host, host+strlen(host)))
+ return -1;
+ }
+ }
+
+ URI_SET_STR_(host);
+ return 0;
+}
+int
+evhttp_uri_set_port(struct evhttp_uri *uri, int port)
+{
+ if (port < -1)
+ return -1;
+ uri->port = port;
+ return 0;
+}
+#define end_of_cpath(cp,p,f) \
+ ((const char*)(end_of_path(((char*)(cp)), (p), (f))))
+
+int
+evhttp_uri_set_path(struct evhttp_uri *uri, const char *path)
+{
+ if (path && end_of_cpath(path, PART_PATH, uri->flags) != path+strlen(path))
+ return -1;
+
+ URI_SET_STR_(path);
+ return 0;
+}
+int
+evhttp_uri_set_query(struct evhttp_uri *uri, const char *query)
+{
+ if (query && end_of_cpath(query, PART_QUERY, uri->flags) != query+strlen(query))
+ return -1;
+ URI_SET_STR_(query);
+ return 0;
+}
+int
+evhttp_uri_set_fragment(struct evhttp_uri *uri, const char *fragment)
+{
+ if (fragment && end_of_cpath(fragment, PART_FRAGMENT, uri->flags) != fragment+strlen(fragment))
+ return -1;
+ URI_SET_STR_(fragment);
+ return 0;
+}
diff --git a/protocols/Telegram/tgl/libevent/http.obj b/protocols/Telegram/tgl/libevent/http.obj
new file mode 100644
index 0000000000..203f779154
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/http.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/include/evdns.h b/protocols/Telegram/tgl/libevent/include/evdns.h
new file mode 100644
index 0000000000..8672db0369
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/evdns.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVENT1_EVDNS_H_INCLUDED_
+#define EVENT1_EVDNS_H_INCLUDED_
+
+/** @file evdns.h
+
+ A dns subsystem for Libevent.
+
+ The <evdns.h> header is deprecated in Libevent 2.0 and later; please
+ use <event2/evdns.h> instead. Depending on what functionality you
+ need, you may also want to include more of the other <event2/...>
+ headers.
+ */
+
+#include <event.h>
+#include <event2/dns.h>
+#include <event2/dns_compat.h>
+#include <event2/dns_struct.h>
+
+#endif /* EVENT1_EVDNS_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/include/event.h b/protocols/Telegram/tgl/libevent/include/event.h
new file mode 100644
index 0000000000..ba5186713b
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/event.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVENT1_EVENT_H_INCLUDED_
+#define EVENT1_EVENT_H_INCLUDED_
+
+/** @file event.h
+
+ A library for writing event-driven network servers.
+
+ The <event.h> header is deprecated in Libevent 2.0 and later; please
+ use <event2/event.h> instead. Depending on what functionality you
+ need, you may also want to include more of the other event2/
+ headers.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event-config.h>
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef EVENT__HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#include <stdarg.h>
+
+/* For int types. */
+#include <evutil.h>
+
+#ifdef _WIN32
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
+#endif
+#include <winsock2.h>
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#endif
+
+#include <event2/event_struct.h>
+#include <event2/event.h>
+#include <event2/event_compat.h>
+#include <event2/buffer.h>
+#include <event2/buffer_compat.h>
+#include <event2/bufferevent.h>
+#include <event2/bufferevent_struct.h>
+#include <event2/bufferevent_compat.h>
+#include <event2/tag.h>
+#include <event2/tag_compat.h>
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT1_EVENT_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/include/event2/buffer.h b/protocols/Telegram/tgl/libevent/include/event2/buffer.h
new file mode 100644
index 0000000000..468588b9f1
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/event2/buffer.h
@@ -0,0 +1,1076 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVENT2_BUFFER_H_INCLUDED_
+#define EVENT2_BUFFER_H_INCLUDED_
+
+/** @file event2/buffer.h
+
+ Functions for buffering data for network sending or receiving.
+
+ An evbuffer can be used for preparing data before sending it to
+ the network or conversely for reading data from the network.
+ Evbuffers try to avoid memory copies as much as possible. As a
+ result, evbuffers can be used to pass data around without actually
+ incurring the overhead of copying the data.
+
+ A new evbuffer can be allocated with evbuffer_new(), and can be
+ freed with evbuffer_free(). Most users will be using evbuffers via
+ the bufferevent interface. To access a bufferevent's evbuffers, use
+ bufferevent_get_input() and bufferevent_get_output().
+
+ There are several guidelines for using evbuffers.
+
+ - if you already know how much data you are going to add as a result
+ of calling evbuffer_add() multiple times, it makes sense to use
+ evbuffer_expand() first to make sure that enough memory is allocated
+ before hand.
+
+ - evbuffer_add_buffer() adds the contents of one buffer to the other
+ without incurring any unnecessary memory copies.
+
+ - evbuffer_add() and evbuffer_add_buffer() do not mix very well:
+ if you use them, you will wind up with fragmented memory in your
+ buffer.
+
+ - For high-performance code, you may want to avoid copying data into and out
+ of buffers. You can skip the copy step by using
+ evbuffer_reserve_space()/evbuffer_commit_space() when writing into a
+ buffer, and evbuffer_peek() when reading.
+
+ In Libevent 2.0 and later, evbuffers are represented using a linked
+ list of memory chunks, with pointers to the first and last chunk in
+ the chain.
+
+ As the contents of an evbuffer can be stored in multiple different
+ memory blocks, it cannot be accessed directly. Instead, evbuffer_pullup()
+ can be used to force a specified number of bytes to be contiguous. This
+ will cause memory reallocation and memory copies if the data is split
+ across multiple blocks. It is more efficient, however, to use
+ evbuffer_peek() if you don't require that the memory to be contiguous.
+ */
+
+#include <event2/visibility.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event-config.h>
+#include <stdarg.h>
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef EVENT__HAVE_SYS_UIO_H
+#include <sys/uio.h>
+#endif
+#include <event2/util.h>
+
+/**
+ An evbuffer is an opaque data type for efficiently buffering data to be
+ sent or received on the network.
+
+ @see event2/event.h for more information
+*/
+struct evbuffer
+#ifdef EVENT_IN_DOXYGEN_
+{}
+#endif
+;
+
+/**
+ Pointer to a position within an evbuffer.
+
+ Used when repeatedly searching through a buffer. Calling any function
+ that modifies or re-packs the buffer contents may invalidate all
+ evbuffer_ptrs for that buffer. Do not modify or contruct these values
+ except with evbuffer_ptr_set.
+
+ An evbuffer_ptr can represent any position from the start of a buffer up
+ to a position immediately after the end of a buffer.
+
+ @see evbuffer_ptr_set()
+ */
+struct evbuffer_ptr {
+ ev_ssize_t pos;
+
+ /* Do not alter or rely on the values of fields: they are for internal
+ * use */
+ struct {
+ void *chain;
+ size_t pos_in_chain;
+ } internal_;
+};
+
+/** Describes a single extent of memory inside an evbuffer. Used for
+ direct-access functions.
+
+ @see evbuffer_reserve_space, evbuffer_commit_space, evbuffer_peek
+ */
+#ifdef EVENT__HAVE_SYS_UIO_H
+#define evbuffer_iovec iovec
+/* Internal use -- defined only if we are using the native struct iovec */
+#define EVBUFFER_IOVEC_IS_NATIVE_
+#else
+struct evbuffer_iovec {
+ /** The start of the extent of memory. */
+ void *iov_base;
+ /** The length of the extent of memory. */
+ size_t iov_len;
+};
+#endif
+
+/**
+ Allocate storage for a new evbuffer.
+
+ @return a pointer to a newly allocated evbuffer struct, or NULL if an error
+ occurred
+ */
+EVENT2_EXPORT_SYMBOL
+struct evbuffer *evbuffer_new(void);
+/**
+ Deallocate storage for an evbuffer.
+
+ @param buf pointer to the evbuffer to be freed
+ */
+EVENT2_EXPORT_SYMBOL
+void evbuffer_free(struct evbuffer *buf);
+
+/**
+ Enable locking on an evbuffer so that it can safely be used by multiple
+ threads at the same time.
+
+ NOTE: when locking is enabled, the lock will be held when callbacks are
+ invoked. This could result in deadlock if you aren't careful. Plan
+ accordingly!
+
+ @param buf An evbuffer to make lockable.
+ @param lock A lock object, or NULL if we should allocate our own.
+ @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_enable_locking(struct evbuffer *buf, void *lock);
+
+/**
+ Acquire the lock on an evbuffer. Has no effect if locking was not enabled
+ with evbuffer_enable_locking.
+*/
+EVENT2_EXPORT_SYMBOL
+void evbuffer_lock(struct evbuffer *buf);
+
+/**
+ Release the lock on an evbuffer. Has no effect if locking was not enabled
+ with evbuffer_enable_locking.
+*/
+EVENT2_EXPORT_SYMBOL
+void evbuffer_unlock(struct evbuffer *buf);
+
+
+/** If this flag is set, then we will not use evbuffer_peek(),
+ * evbuffer_remove(), evbuffer_remove_buffer(), and so on to read bytes
+ * from this buffer: we'll only take bytes out of this buffer by
+ * writing them to the network (as with evbuffer_write_atmost), by
+ * removing them without observing them (as with evbuffer_drain),
+ * or by copying them all out at once (as with evbuffer_add_buffer).
+ *
+ * Using this option allows the implementation to use sendfile-based
+ * operations for evbuffer_add_file(); see that function for more
+ * information.
+ *
+ * This flag is on by default for bufferevents that can take advantage
+ * of it; you should never actually need to set it on a bufferevent's
+ * output buffer.
+ */
+#define EVBUFFER_FLAG_DRAINS_TO_FD 1
+
+/** Change the flags that are set for an evbuffer by adding more.
+ *
+ * @param buffer the evbuffer that the callback is watching.
+ * @param cb the callback whose status we want to change.
+ * @param flags One or more EVBUFFER_FLAG_* options
+ * @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_set_flags(struct evbuffer *buf, ev_uint64_t flags);
+/** Change the flags that are set for an evbuffer by removing some.
+ *
+ * @param buffer the evbuffer that the callback is watching.
+ * @param cb the callback whose status we want to change.
+ * @param flags One or more EVBUFFER_FLAG_* options
+ * @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_clear_flags(struct evbuffer *buf, ev_uint64_t flags);
+
+/**
+ Returns the total number of bytes stored in the evbuffer
+
+ @param buf pointer to the evbuffer
+ @return the number of bytes stored in the evbuffer
+*/
+EVENT2_EXPORT_SYMBOL
+size_t evbuffer_get_length(const struct evbuffer *buf);
+
+/**
+ Returns the number of contiguous available bytes in the first buffer chain.
+
+ This is useful when processing data that might be split into multiple
+ chains, or that might all be in the first chain. Calls to
+ evbuffer_pullup() that cause reallocation and copying of data can thus be
+ avoided.
+
+ @param buf pointer to the evbuffer
+ @return 0 if no data is available, otherwise the number of available bytes
+ in the first buffer chain.
+*/
+EVENT2_EXPORT_SYMBOL
+size_t evbuffer_get_contiguous_space(const struct evbuffer *buf);
+
+/**
+ Expands the available space in an evbuffer.
+
+ Expands the available space in the evbuffer to at least datlen, so that
+ appending datlen additional bytes will not require any new allocations.
+
+ @param buf the evbuffer to be expanded
+ @param datlen the new minimum length requirement
+ @return 0 if successful, or -1 if an error occurred
+*/
+EVENT2_EXPORT_SYMBOL
+int evbuffer_expand(struct evbuffer *buf, size_t datlen);
+
+/**
+ Reserves space in the last chain or chains of an evbuffer.
+
+ Makes space available in the last chain or chains of an evbuffer that can
+ be arbitrarily written to by a user. The space does not become
+ available for reading until it has been committed with
+ evbuffer_commit_space().
+
+ The space is made available as one or more extents, represented by
+ an initial pointer and a length. You can force the memory to be
+ available as only one extent. Allowing more extents, however, makes the
+ function more efficient.
+
+ Multiple subsequent calls to this function will make the same space
+ available until evbuffer_commit_space() has been called.
+
+ It is an error to do anything that moves around the buffer's internal
+ memory structures before committing the space.
+
+ NOTE: The code currently does not ever use more than two extents.
+ This may change in future versions.
+
+ @param buf the evbuffer in which to reserve space.
+ @param size how much space to make available, at minimum. The
+ total length of the extents may be greater than the requested
+ length.
+ @param vec an array of one or more evbuffer_iovec structures to
+ hold pointers to the reserved extents of memory.
+ @param n_vec The length of the vec array. Must be at least 1;
+ 2 is more efficient.
+ @return the number of provided extents, or -1 on error.
+ @see evbuffer_commit_space()
+*/
+EVENT2_EXPORT_SYMBOL
+int
+evbuffer_reserve_space(struct evbuffer *buf, ev_ssize_t size,
+ struct evbuffer_iovec *vec, int n_vec);
+
+/**
+ Commits previously reserved space.
+
+ Commits some of the space previously reserved with
+ evbuffer_reserve_space(). It then becomes available for reading.
+
+ This function may return an error if the pointer in the extents do
+ not match those returned from evbuffer_reserve_space, or if data
+ has been added to the buffer since the space was reserved.
+
+ If you want to commit less data than you got reserved space for,
+ modify the iov_len pointer of the appropriate extent to a smaller
+ value. Note that you may have received more space than you
+ requested if it was available!
+
+ @param buf the evbuffer in which to reserve space.
+ @param vec one or two extents returned by evbuffer_reserve_space.
+ @param n_vecs the number of extents.
+ @return 0 on success, -1 on error
+ @see evbuffer_reserve_space()
+*/
+EVENT2_EXPORT_SYMBOL
+int evbuffer_commit_space(struct evbuffer *buf,
+ struct evbuffer_iovec *vec, int n_vecs);
+
+/**
+ Append data to the end of an evbuffer.
+
+ @param buf the evbuffer to be appended to
+ @param data pointer to the beginning of the data buffer
+ @param datlen the number of bytes to be copied from the data buffer
+ @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_add(struct evbuffer *buf, const void *data, size_t datlen);
+
+
+/**
+ Read data from an evbuffer and drain the bytes read.
+
+ If more bytes are requested than are available in the evbuffer, we
+ only extract as many bytes as were available.
+
+ @param buf the evbuffer to be read from
+ @param data the destination buffer to store the result
+ @param datlen the maximum size of the destination buffer
+ @return the number of bytes read, or -1 if we can't drain the buffer.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_remove(struct evbuffer *buf, void *data, size_t datlen);
+
+/**
+ Read data from an evbuffer, and leave the buffer unchanged.
+
+ If more bytes are requested than are available in the evbuffer, we
+ only extract as many bytes as were available.
+
+ @param buf the evbuffer to be read from
+ @param data_out the destination buffer to store the result
+ @param datlen the maximum size of the destination buffer
+ @return the number of bytes read, or -1 if we can't drain the buffer.
+ */
+EVENT2_EXPORT_SYMBOL
+ev_ssize_t evbuffer_copyout(struct evbuffer *buf, void *data_out, size_t datlen);
+
+/**
+ Read data from the middle of an evbuffer, and leave the buffer unchanged.
+
+ If more bytes are requested than are available in the evbuffer, we
+ only extract as many bytes as were available.
+
+ @param buf the evbuffer to be read from
+ @param pos the position to start reading from
+ @param data_out the destination buffer to store the result
+ @param datlen the maximum size of the destination buffer
+ @return the number of bytes read, or -1 if we can't drain the buffer.
+ */
+EVENT2_EXPORT_SYMBOL
+ev_ssize_t evbuffer_copyout_from(struct evbuffer *buf, const struct evbuffer_ptr *pos, void *data_out, size_t datlen);
+
+/**
+ Read data from an evbuffer into another evbuffer, draining
+ the bytes from the source buffer. This function avoids copy
+ operations to the extent possible.
+
+ If more bytes are requested than are available in src, the src
+ buffer is drained completely.
+
+ @param src the evbuffer to be read from
+ @param dst the destination evbuffer to store the result into
+ @param datlen the maximum numbers of bytes to transfer
+ @return the number of bytes read
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_remove_buffer(struct evbuffer *src, struct evbuffer *dst,
+ size_t datlen);
+
+/** Used to tell evbuffer_readln what kind of line-ending to look for.
+ */
+enum evbuffer_eol_style {
+ /** Any sequence of CR and LF characters is acceptable as an
+ * EOL.
+ *
+ * Note that this style can produce ambiguous results: the
+ * sequence "CRLF" will be treated as a single EOL if it is
+ * all in the buffer at once, but if you first read a CR from
+ * the network and later read an LF from the network, it will
+ * be treated as two EOLs.
+ */
+ EVBUFFER_EOL_ANY,
+ /** An EOL is an LF, optionally preceded by a CR. This style is
+ * most useful for implementing text-based internet protocols. */
+ EVBUFFER_EOL_CRLF,
+ /** An EOL is a CR followed by an LF. */
+ EVBUFFER_EOL_CRLF_STRICT,
+ /** An EOL is a LF. */
+ EVBUFFER_EOL_LF,
+ /** An EOL is a NUL character (that is, a single byte with value 0) */
+ EVBUFFER_EOL_NUL
+};
+
+/**
+ * Read a single line from an evbuffer.
+ *
+ * Reads a line terminated by an EOL as determined by the evbuffer_eol_style
+ * argument. Returns a newly allocated nul-terminated string; the caller must
+ * free the returned value. The EOL is not included in the returned string.
+ *
+ * @param buffer the evbuffer to read from
+ * @param n_read_out if non-NULL, points to a size_t that is set to the
+ * number of characters in the returned string. This is useful for
+ * strings that can contain NUL characters.
+ * @param eol_style the style of line-ending to use.
+ * @return pointer to a single line, or NULL if an error occurred
+ */
+EVENT2_EXPORT_SYMBOL
+char *evbuffer_readln(struct evbuffer *buffer, size_t *n_read_out,
+ enum evbuffer_eol_style eol_style);
+
+/**
+ Move all data from one evbuffer into another evbuffer.
+
+ This is a destructive add. The data from one buffer moves into
+ the other buffer. However, no unnecessary memory copies occur.
+
+ @param outbuf the output buffer
+ @param inbuf the input buffer
+ @return 0 if successful, or -1 if an error occurred
+
+ @see evbuffer_remove_buffer()
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_add_buffer(struct evbuffer *outbuf, struct evbuffer *inbuf);
+
+/**
+ Copy data from one evbuffer into another evbuffer.
+
+ This is a non-destructive add. The data from one buffer is copied
+ into the other buffer. However, no unnecessary memory copies occur.
+
+ Note that buffers already containing buffer references can't be added
+ to other buffers.
+
+ @param outbuf the output buffer
+ @param inbuf the input buffer
+ @return 0 if successful, or -1 if an error occurred
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_add_buffer_reference(struct evbuffer *outbuf,
+ struct evbuffer *inbuf);
+
+/**
+ A cleanup function for a piece of memory added to an evbuffer by
+ reference.
+
+ @see evbuffer_add_reference()
+ */
+typedef void (*evbuffer_ref_cleanup_cb)(const void *data,
+ size_t datalen, void *extra);
+
+/**
+ Reference memory into an evbuffer without copying.
+
+ The memory needs to remain valid until all the added data has been
+ read. This function keeps just a reference to the memory without
+ actually incurring the overhead of a copy.
+
+ @param outbuf the output buffer
+ @param data the memory to reference
+ @param datlen how memory to reference
+ @param cleanupfn callback to be invoked when the memory is no longer
+ referenced by this evbuffer.
+ @param cleanupfn_arg optional argument to the cleanup callback
+ @return 0 if successful, or -1 if an error occurred
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_add_reference(struct evbuffer *outbuf,
+ const void *data, size_t datlen,
+ evbuffer_ref_cleanup_cb cleanupfn, void *cleanupfn_arg);
+
+/**
+ Copy data from a file into the evbuffer for writing to a socket.
+
+ This function avoids unnecessary data copies between userland and
+ kernel. If sendfile is available and the EVBUFFER_FLAG_DRAINS_TO_FD
+ flag is set, it uses those functions. Otherwise, it tries to use
+ mmap (or CreateFileMapping on Windows).
+
+ The function owns the resulting file descriptor and will close it
+ when finished transferring data.
+
+ The results of using evbuffer_remove() or evbuffer_pullup() on
+ evbuffers whose data was added using this function are undefined.
+
+ For more fine-grained control, use evbuffer_add_file_segment.
+
+ @param outbuf the output buffer
+ @param fd the file descriptor
+ @param offset the offset from which to read data
+ @param length how much data to read, or -1 to read as much as possible.
+ (-1 requires that 'fd' support fstat.)
+ @return 0 if successful, or -1 if an error occurred
+*/
+
+EVENT2_EXPORT_SYMBOL
+int evbuffer_add_file(struct evbuffer *outbuf, int fd, ev_off_t offset,
+ ev_off_t length);
+
+/**
+ An evbuffer_file_segment holds a reference to a range of a file --
+ possibly the whole file! -- for use in writing from an evbuffer to a
+ socket. It could be implemented with mmap, sendfile, splice, or (if all
+ else fails) by just pulling all the data into RAM. A single
+ evbuffer_file_segment can be added more than once, and to more than one
+ evbuffer.
+ */
+struct evbuffer_file_segment;
+
+/**
+ Flag for creating evbuffer_file_segment: If this flag is set, then when
+ the evbuffer_file_segment is freed and no longer in use by any
+ evbuffer, the underlying fd is closed.
+ */
+#define EVBUF_FS_CLOSE_ON_FREE 0x01
+/**
+ Flag for creating evbuffer_file_segment: Disable memory-map based
+ implementations.
+ */
+#define EVBUF_FS_DISABLE_MMAP 0x02
+/**
+ Flag for creating evbuffer_file_segment: Disable direct fd-to-fd
+ implementations (including sendfile and splice).
+
+ You might want to use this option if data needs to be taken from the
+ evbuffer by any means other than writing it to the network: the sendfile
+ backend is fast, but it only works for sending files directly to the
+ network.
+ */
+#define EVBUF_FS_DISABLE_SENDFILE 0x04
+/**
+ Flag for creating evbuffer_file_segment: Do not allocate a lock for this
+ segment. If this option is set, then neither the segment nor any
+ evbuffer it is added to may ever be accessed from more than one thread
+ at a time.
+ */
+#define EVBUF_FS_DISABLE_LOCKING 0x08
+
+/**
+ A cleanup function for a evbuffer_file_segment added to an evbuffer
+ for reference.
+ */
+typedef void (*evbuffer_file_segment_cleanup_cb)(
+ struct evbuffer_file_segment const* seg, int flags, void* arg);
+
+/**
+ Create and return a new evbuffer_file_segment for reading data from a
+ file and sending it out via an evbuffer.
+
+ This function avoids unnecessary data copies between userland and
+ kernel. Where available, it uses sendfile or splice.
+
+ The file descriptor must not be closed so long as any evbuffer is using
+ this segment.
+
+ The results of using evbuffer_remove() or evbuffer_pullup() or any other
+ function that reads bytes from an evbuffer on any evbuffer containing
+ the newly returned segment are undefined, unless you pass the
+ EVBUF_FS_DISABLE_SENDFILE flag to this function.
+
+ @param fd an open file to read from.
+ @param offset an index within the file at which to start reading
+ @param length how much data to read, or -1 to read as much as possible.
+ (-1 requires that 'fd' support fstat.)
+ @param flags any number of the EVBUF_FS_* flags
+ @return a new evbuffer_file_segment, or NULL on failure.
+ **/
+EVENT2_EXPORT_SYMBOL
+struct evbuffer_file_segment *evbuffer_file_segment_new(
+ int fd, ev_off_t offset, ev_off_t length, unsigned flags);
+
+/**
+ Free an evbuffer_file_segment
+
+ It is safe to call this function even if the segment has been added to
+ one or more evbuffers. The evbuffer_file_segment will not be freed
+ until no more references to it exist.
+ */
+EVENT2_EXPORT_SYMBOL
+void evbuffer_file_segment_free(struct evbuffer_file_segment *seg);
+
+/**
+ Add cleanup callback and argument for the callback to an
+ evbuffer_file_segment.
+
+ The cleanup callback will be invoked when no more references to the
+ evbuffer_file_segment exist.
+ **/
+EVENT2_EXPORT_SYMBOL
+void evbuffer_file_segment_add_cleanup_cb(struct evbuffer_file_segment *seg,
+ evbuffer_file_segment_cleanup_cb cb, void* arg);
+
+/**
+ Insert some or all of an evbuffer_file_segment at the end of an evbuffer
+
+ Note that the offset and length parameters of this function have a
+ different meaning from those provided to evbuffer_file_segment_new: When
+ you create the segment, the offset is the offset _within the file_, and
+ the length is the length _of the segment_, whereas when you add a
+ segment to an evbuffer, the offset is _within the segment_ and the
+ length is the length of the _part of the segment you want to use.
+
+ In other words, if you have a 10 KiB file, and you create an
+ evbuffer_file_segment for it with offset 20 and length 1000, it will
+ refer to bytes 20..1019 inclusive. If you then pass this segment to
+ evbuffer_add_file_segment and specify an offset of 20 and a length of
+ 50, you will be adding bytes 40..99 inclusive.
+
+ @param buf the evbuffer to append to
+ @param seg the segment to add
+ @param offset the offset within the segment to start from
+ @param length the amount of data to add, or -1 to add it all.
+ @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_add_file_segment(struct evbuffer *buf,
+ struct evbuffer_file_segment *seg, ev_off_t offset, ev_off_t length);
+
+/**
+ Append a formatted string to the end of an evbuffer.
+
+ The string is formated as printf.
+
+ @param buf the evbuffer that will be appended to
+ @param fmt a format string
+ @param ... arguments that will be passed to printf(3)
+ @return The number of bytes added if successful, or -1 if an error occurred.
+
+ @see evutil_printf(), evbuffer_add_vprintf()
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_add_printf(struct evbuffer *buf, const char *fmt, ...)
+#ifdef __GNUC__
+ __attribute__((format(printf, 2, 3)))
+#endif
+;
+
+/**
+ Append a va_list formatted string to the end of an evbuffer.
+
+ @param buf the evbuffer that will be appended to
+ @param fmt a format string
+ @param ap a varargs va_list argument array that will be passed to vprintf(3)
+ @return The number of bytes added if successful, or -1 if an error occurred.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_add_vprintf(struct evbuffer *buf, const char *fmt, va_list ap)
+#ifdef __GNUC__
+ __attribute__((format(printf, 2, 0)))
+#endif
+;
+
+
+/**
+ Remove a specified number of bytes data from the beginning of an evbuffer.
+
+ @param buf the evbuffer to be drained
+ @param len the number of bytes to drain from the beginning of the buffer
+ @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_drain(struct evbuffer *buf, size_t len);
+
+
+/**
+ Write the contents of an evbuffer to a file descriptor.
+
+ The evbuffer will be drained after the bytes have been successfully written.
+
+ @param buffer the evbuffer to be written and drained
+ @param fd the file descriptor to be written to
+ @return the number of bytes written, or -1 if an error occurred
+ @see evbuffer_read()
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_write(struct evbuffer *buffer, evutil_socket_t fd);
+
+/**
+ Write some of the contents of an evbuffer to a file descriptor.
+
+ The evbuffer will be drained after the bytes have been successfully written.
+
+ @param buffer the evbuffer to be written and drained
+ @param fd the file descriptor to be written to
+ @param howmuch the largest allowable number of bytes to write, or -1
+ to write as many bytes as we can.
+ @return the number of bytes written, or -1 if an error occurred
+ @see evbuffer_read()
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_write_atmost(struct evbuffer *buffer, evutil_socket_t fd,
+ ev_ssize_t howmuch);
+
+/**
+ Read from a file descriptor and store the result in an evbuffer.
+
+ @param buffer the evbuffer to store the result
+ @param fd the file descriptor to read from
+ @param howmuch the number of bytes to be read
+ @return the number of bytes read, or -1 if an error occurred
+ @see evbuffer_write()
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_read(struct evbuffer *buffer, evutil_socket_t fd, int howmuch);
+
+/**
+ Search for a string within an evbuffer.
+
+ @param buffer the evbuffer to be searched
+ @param what the string to be searched for
+ @param len the length of the search string
+ @param start NULL or a pointer to a valid struct evbuffer_ptr.
+ @return a struct evbuffer_ptr whose 'pos' field has the offset of the
+ first occurrence of the string in the buffer after 'start'. The 'pos'
+ field of the result is -1 if the string was not found.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evbuffer_ptr evbuffer_search(struct evbuffer *buffer, const char *what, size_t len, const struct evbuffer_ptr *start);
+
+/**
+ Search for a string within part of an evbuffer.
+
+ @param buffer the evbuffer to be searched
+ @param what the string to be searched for
+ @param len the length of the search string
+ @param start NULL or a pointer to a valid struct evbuffer_ptr that
+ indicates where we should start searching.
+ @param end NULL or a pointer to a valid struct evbuffer_ptr that
+ indicates where we should stop searching.
+ @return a struct evbuffer_ptr whose 'pos' field has the offset of the
+ first occurrence of the string in the buffer after 'start'. The 'pos'
+ field of the result is -1 if the string was not found.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evbuffer_ptr evbuffer_search_range(struct evbuffer *buffer, const char *what, size_t len, const struct evbuffer_ptr *start, const struct evbuffer_ptr *end);
+
+/**
+ Defines how to adjust an evbuffer_ptr by evbuffer_ptr_set()
+
+ @see evbuffer_ptr_set() */
+enum evbuffer_ptr_how {
+ /** Sets the pointer to the position; can be called on with an
+ uninitialized evbuffer_ptr. */
+ EVBUFFER_PTR_SET,
+ /** Advances the pointer by adding to the current position. */
+ EVBUFFER_PTR_ADD
+};
+
+/**
+ Sets the search pointer in the buffer to position.
+
+ There are two ways to use this function: you can call
+ evbuffer_ptr_set(buf, &pos, N, EVBUFFER_PTR_SET)
+ to move 'pos' to a position 'N' bytes after the start of the buffer, or
+ evbuffer_ptr_set(buf, &pos, N, EVBUFFER_PTR_ADD)
+ to move 'pos' forward by 'N' bytes.
+
+ If evbuffer_ptr is not initialized, this function can only be called
+ with EVBUFFER_PTR_SET.
+
+ An evbuffer_ptr can represent any position from the start of the buffer to
+ a position immediately after the end of the buffer.
+
+ @param buffer the evbuffer to be search
+ @param ptr a pointer to a struct evbuffer_ptr
+ @param position the position at which to start the next search
+ @param how determines how the pointer should be manipulated.
+ @returns 0 on success or -1 otherwise
+*/
+EVENT2_EXPORT_SYMBOL
+int
+evbuffer_ptr_set(struct evbuffer *buffer, struct evbuffer_ptr *ptr,
+ size_t position, enum evbuffer_ptr_how how);
+
+/**
+ Search for an end-of-line string within an evbuffer.
+
+ @param buffer the evbuffer to be searched
+ @param start NULL or a pointer to a valid struct evbuffer_ptr to start
+ searching at.
+ @param eol_len_out If non-NULL, the pointed-to value will be set to
+ the length of the end-of-line string.
+ @param eol_style The kind of EOL to look for; see evbuffer_readln() for
+ more information
+ @return a struct evbuffer_ptr whose 'pos' field has the offset of the
+ first occurrence EOL in the buffer after 'start'. The 'pos'
+ field of the result is -1 if the string was not found.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evbuffer_ptr evbuffer_search_eol(struct evbuffer *buffer,
+ struct evbuffer_ptr *start, size_t *eol_len_out,
+ enum evbuffer_eol_style eol_style);
+
+/** Function to peek at data inside an evbuffer without removing it or
+ copying it out.
+
+ Pointers to the data are returned by filling the 'vec_out' array
+ with pointers to one or more extents of data inside the buffer.
+
+ The total data in the extents that you get back may be more than
+ you requested (if there is more data last extent than you asked
+ for), or less (if you do not provide enough evbuffer_iovecs, or if
+ the buffer does not have as much data as you asked to see).
+
+ @param buffer the evbuffer to peek into,
+ @param len the number of bytes to try to peek. If len is negative, we
+ will try to fill as much of vec_out as we can. If len is negative
+ and vec_out is not provided, we return the number of evbuffer_iovecs
+ that would be needed to get all the data in the buffer.
+ @param start_at an evbuffer_ptr indicating the point at which we
+ should start looking for data. NULL means, "At the start of the
+ buffer."
+ @param vec_out an array of evbuffer_iovec
+ @param n_vec the length of vec_out. If 0, we only count how many
+ extents would be necessary to point to the requested amount of
+ data.
+ @return The number of extents needed. This may be less than n_vec
+ if we didn't need all the evbuffer_iovecs we were given, or more
+ than n_vec if we would need more to return all the data that was
+ requested.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_peek(struct evbuffer *buffer, ev_ssize_t len,
+ struct evbuffer_ptr *start_at,
+ struct evbuffer_iovec *vec_out, int n_vec);
+
+
+/** Structure passed to an evbuffer_cb_func evbuffer callback
+
+ @see evbuffer_cb_func, evbuffer_add_cb()
+ */
+struct evbuffer_cb_info {
+ /** The number of bytes in this evbuffer when callbacks were last
+ * invoked. */
+ size_t orig_size;
+ /** The number of bytes added since callbacks were last invoked. */
+ size_t n_added;
+ /** The number of bytes removed since callbacks were last invoked. */
+ size_t n_deleted;
+};
+
+/** Type definition for a callback that is invoked whenever data is added or
+ removed from an evbuffer.
+
+ An evbuffer may have one or more callbacks set at a time. The order
+ in which they are executed is undefined.
+
+ A callback function may add more callbacks, or remove itself from the
+ list of callbacks, or add or remove data from the buffer. It may not
+ remove another callback from the list.
+
+ If a callback adds or removes data from the buffer or from another
+ buffer, this can cause a recursive invocation of your callback or
+ other callbacks. If you ask for an infinite loop, you might just get
+ one: watch out!
+
+ @param buffer the buffer whose size has changed
+ @param info a structure describing how the buffer changed.
+ @param arg a pointer to user data
+*/
+typedef void (*evbuffer_cb_func)(struct evbuffer *buffer, const struct evbuffer_cb_info *info, void *arg);
+
+struct evbuffer_cb_entry;
+/** Add a new callback to an evbuffer.
+
+ Subsequent calls to evbuffer_add_cb() add new callbacks. To remove this
+ callback, call evbuffer_remove_cb or evbuffer_remove_cb_entry.
+
+ @param buffer the evbuffer to be monitored
+ @param cb the callback function to invoke when the evbuffer is modified,
+ or NULL to remove all callbacks.
+ @param cbarg an argument to be provided to the callback function
+ @return a handle to the callback on success, or NULL on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evbuffer_cb_entry *evbuffer_add_cb(struct evbuffer *buffer, evbuffer_cb_func cb, void *cbarg);
+
+/** Remove a callback from an evbuffer, given a handle returned from
+ evbuffer_add_cb.
+
+ Calling this function invalidates the handle.
+
+ @return 0 if a callback was removed, or -1 if no matching callback was
+ found.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_remove_cb_entry(struct evbuffer *buffer,
+ struct evbuffer_cb_entry *ent);
+
+/** Remove a callback from an evbuffer, given the function and argument
+ used to add it.
+
+ @return 0 if a callback was removed, or -1 if no matching callback was
+ found.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_remove_cb(struct evbuffer *buffer, evbuffer_cb_func cb, void *cbarg);
+
+/** If this flag is not set, then a callback is temporarily disabled, and
+ * should not be invoked.
+ *
+ * @see evbuffer_cb_set_flags(), evbuffer_cb_clear_flags()
+ */
+#define EVBUFFER_CB_ENABLED 1
+
+/** Change the flags that are set for a callback on a buffer by adding more.
+
+ @param buffer the evbuffer that the callback is watching.
+ @param cb the callback whose status we want to change.
+ @param flags EVBUFFER_CB_ENABLED to re-enable the callback.
+ @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_cb_set_flags(struct evbuffer *buffer,
+ struct evbuffer_cb_entry *cb, ev_uint32_t flags);
+
+/** Change the flags that are set for a callback on a buffer by removing some
+
+ @param buffer the evbuffer that the callback is watching.
+ @param cb the callback whose status we want to change.
+ @param flags EVBUFFER_CB_ENABLED to disable the callback.
+ @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_cb_clear_flags(struct evbuffer *buffer,
+ struct evbuffer_cb_entry *cb, ev_uint32_t flags);
+
+#if 0
+/** Postpone calling a given callback until unsuspend is called later.
+
+ This is different from disabling the callback, since the callback will get
+ invoked later if the buffer size changes between now and when we unsuspend
+ it.
+
+ @param the buffer that the callback is watching.
+ @param cb the callback we want to suspend.
+ */
+EVENT2_EXPORT_SYMBOL
+void evbuffer_cb_suspend(struct evbuffer *buffer, struct evbuffer_cb_entry *cb);
+/** Stop postponing a callback that we postponed with evbuffer_cb_suspend.
+
+ If data was added to or removed from the buffer while the callback was
+ suspended, the callback will get called once now.
+
+ @param the buffer that the callback is watching.
+ @param cb the callback we want to stop suspending.
+ */
+EVENT2_EXPORT_SYMBOL
+void evbuffer_cb_unsuspend(struct evbuffer *buffer, struct evbuffer_cb_entry *cb);
+#endif
+
+/**
+ Makes the data at the beginning of an evbuffer contiguous.
+
+ @param buf the evbuffer to make contiguous
+ @param size the number of bytes to make contiguous, or -1 to make the
+ entire buffer contiguous.
+ @return a pointer to the contiguous memory array, or NULL if param size
+ requested more data than is present in the buffer.
+*/
+
+EVENT2_EXPORT_SYMBOL
+unsigned char *evbuffer_pullup(struct evbuffer *buf, ev_ssize_t size);
+
+/**
+ Prepends data to the beginning of the evbuffer
+
+ @param buf the evbuffer to which to prepend data
+ @param data a pointer to the memory to prepend
+ @param size the number of bytes to prepend
+ @return 0 if successful, or -1 otherwise
+*/
+
+EVENT2_EXPORT_SYMBOL
+int evbuffer_prepend(struct evbuffer *buf, const void *data, size_t size);
+
+/**
+ Prepends all data from the src evbuffer to the beginning of the dst
+ evbuffer.
+
+ @param dst the evbuffer to which to prepend data
+ @param src the evbuffer to prepend; it will be emptied as a result
+ @return 0 if successful, or -1 otherwise
+*/
+EVENT2_EXPORT_SYMBOL
+int evbuffer_prepend_buffer(struct evbuffer *dst, struct evbuffer* src);
+
+/**
+ Prevent calls that modify an evbuffer from succeeding. A buffer may
+ frozen at the front, at the back, or at both the front and the back.
+
+ If the front of a buffer is frozen, operations that drain data from
+ the front of the buffer, or that prepend data to the buffer, will
+ fail until it is unfrozen. If the back a buffer is frozen, operations
+ that append data from the buffer will fail until it is unfrozen.
+
+ @param buf The buffer to freeze
+ @param at_front If true, we freeze the front of the buffer. If false,
+ we freeze the back.
+ @return 0 on success, -1 on failure.
+*/
+EVENT2_EXPORT_SYMBOL
+int evbuffer_freeze(struct evbuffer *buf, int at_front);
+/**
+ Re-enable calls that modify an evbuffer.
+
+ @param buf The buffer to un-freeze
+ @param at_front If true, we unfreeze the front of the buffer. If false,
+ we unfreeze the back.
+ @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_unfreeze(struct evbuffer *buf, int at_front);
+
+struct event_base;
+/**
+ Force all the callbacks on an evbuffer to be run, not immediately after
+ the evbuffer is altered, but instead from inside the event loop.
+
+ This can be used to serialize all the callbacks to a single thread
+ of execution.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_defer_callbacks(struct evbuffer *buffer, struct event_base *base);
+
+/**
+ Append data from 1 or more iovec's to an evbuffer
+
+ Calculates the number of bytes needed for an iovec structure and guarantees
+ all data will fit into a single chain. Can be used in lieu of functionality
+ which calls evbuffer_add() constantly before being used to increase
+ performance.
+
+ @param buffer the destination buffer
+ @param vec the source iovec
+ @param n_vec the number of iovec structures.
+ @return the number of bytes successfully written to the output buffer.
+*/
+EVENT2_EXPORT_SYMBOL
+size_t evbuffer_add_iovec(struct evbuffer * buffer, struct evbuffer_iovec * vec, int n_vec);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_BUFFER_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/include/event2/buffer_compat.h b/protocols/Telegram/tgl/libevent/include/event2/buffer_compat.h
new file mode 100644
index 0000000000..24f828c210
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/event2/buffer_compat.h
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+
+#ifndef EVENT2_BUFFER_COMPAT_H_INCLUDED_
+#define EVENT2_BUFFER_COMPAT_H_INCLUDED_
+
+#include <event2/visibility.h>
+
+/** @file event2/buffer_compat.h
+
+ Obsolete and deprecated versions of the functions in buffer.h: provided
+ only for backward compatibility.
+ */
+
+
+/**
+ Obsolete alias for evbuffer_readln(buffer, NULL, EVBUFFER_EOL_ANY).
+
+ @deprecated This function is deprecated because its behavior is not correct
+ for almost any protocol, and also because it's wholly subsumed by
+ evbuffer_readln().
+
+ @param buffer the evbuffer to read from
+ @return pointer to a single line, or NULL if an error occurred
+
+*/
+EVENT2_EXPORT_SYMBOL
+char *evbuffer_readline(struct evbuffer *buffer);
+
+/** Type definition for a callback that is invoked whenever data is added or
+ removed from an evbuffer.
+
+ An evbuffer may have one or more callbacks set at a time. The order
+ in which they are executed is undefined.
+
+ A callback function may add more callbacks, or remove itself from the
+ list of callbacks, or add or remove data from the buffer. It may not
+ remove another callback from the list.
+
+ If a callback adds or removes data from the buffer or from another
+ buffer, this can cause a recursive invocation of your callback or
+ other callbacks. If you ask for an infinite loop, you might just get
+ one: watch out!
+
+ @param buffer the buffer whose size has changed
+ @param old_len the previous length of the buffer
+ @param new_len the current length of the buffer
+ @param arg a pointer to user data
+*/
+typedef void (*evbuffer_cb)(struct evbuffer *buffer, size_t old_len, size_t new_len, void *arg);
+
+/**
+ Replace all callbacks on an evbuffer with a single new callback, or
+ remove them.
+
+ Subsequent calls to evbuffer_setcb() replace callbacks set by previous
+ calls. Setting the callback to NULL removes any previously set callback.
+
+ @deprecated This function is deprecated because it clears all previous
+ callbacks set on the evbuffer, which can cause confusing behavior if
+ multiple parts of the code all want to add their own callbacks on a
+ buffer. Instead, use evbuffer_add(), evbuffer_del(), and
+ evbuffer_setflags() to manage your own evbuffer callbacks without
+ interfering with callbacks set by others.
+
+ @param buffer the evbuffer to be monitored
+ @param cb the callback function to invoke when the evbuffer is modified,
+ or NULL to remove all callbacks.
+ @param cbarg an argument to be provided to the callback function
+ */
+EVENT2_EXPORT_SYMBOL
+void evbuffer_setcb(struct evbuffer *buffer, evbuffer_cb cb, void *cbarg);
+
+
+/**
+ Find a string within an evbuffer.
+
+ @param buffer the evbuffer to be searched
+ @param what the string to be searched for
+ @param len the length of the search string
+ @return a pointer to the beginning of the search string, or NULL if the search failed.
+ */
+EVENT2_EXPORT_SYMBOL
+unsigned char *evbuffer_find(struct evbuffer *buffer, const unsigned char *what, size_t len);
+
+/** deprecated in favor of calling the functions directly */
+#define EVBUFFER_LENGTH(x) evbuffer_get_length(x)
+/** deprecated in favor of calling the functions directly */
+#define EVBUFFER_DATA(x) evbuffer_pullup((x), -1)
+
+#endif
+
diff --git a/protocols/Telegram/tgl/libevent/include/event2/bufferevent.h b/protocols/Telegram/tgl/libevent/include/event2/bufferevent.h
new file mode 100644
index 0000000000..825918e3a4
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/event2/bufferevent.h
@@ -0,0 +1,1021 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVENT2_BUFFEREVENT_H_INCLUDED_
+#define EVENT2_BUFFEREVENT_H_INCLUDED_
+
+/**
+ @file event2/bufferevent.h
+
+ Functions for buffering data for network sending or receiving. Bufferevents
+ are higher level than evbuffers: each has an underlying evbuffer for reading
+ and one for writing, and callbacks that are invoked under certain
+ circumstances.
+
+ A bufferevent provides input and output buffers that get filled and
+ drained automatically. The user of a bufferevent no longer deals
+ directly with the I/O, but instead is reading from input and writing
+ to output buffers.
+
+ Once initialized, the bufferevent structure can be used repeatedly
+ with bufferevent_enable() and bufferevent_disable().
+
+ When reading is enabled, the bufferevent will try to read from the
+ file descriptor onto its input buffer, and call the read callback.
+ When writing is enabled, the bufferevent will try to write data onto its
+ file descriptor when the output buffer has enough data, and call the write
+ callback when the output buffer is sufficiently drained.
+
+ Bufferevents come in several flavors, including:
+
+ <dl>
+ <dt>Socket-based bufferevents</dt>
+ <dd>A bufferevent that reads and writes data onto a network
+ socket. Created with bufferevent_socket_new().</dd>
+
+ <dt>Paired bufferevents</dt>
+ <dd>A pair of bufferevents that send and receive data to one
+ another without touching the network. Created with
+ bufferevent_pair_new().</dd>
+
+ <dt>Filtering bufferevents</dt>
+ <dd>A bufferevent that transforms data, and sends or receives it
+ over another underlying bufferevent. Created with
+ bufferevent_filter_new().</dd>
+
+ <dt>SSL-backed bufferevents</dt>
+ <dd>A bufferevent that uses the openssl library to send and
+ receive data over an encrypted connection. Created with
+ bufferevent_openssl_socket_new() or
+ bufferevent_openssl_filter_new().</dd>
+ </dl>
+ */
+
+#include <event2/visibility.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event-config.h>
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+/* For int types. */
+#include <event2/util.h>
+
+/** @name Bufferevent event codes
+
+ These flags are passed as arguments to a bufferevent's event callback.
+
+ @{
+*/
+#define BEV_EVENT_READING 0x01 /**< error encountered while reading */
+#define BEV_EVENT_WRITING 0x02 /**< error encountered while writing */
+#define BEV_EVENT_EOF 0x10 /**< eof file reached */
+#define BEV_EVENT_ERROR 0x20 /**< unrecoverable error encountered */
+#define BEV_EVENT_TIMEOUT 0x40 /**< user-specified timeout reached */
+#define BEV_EVENT_CONNECTED 0x80 /**< connect operation finished. */
+/**@}*/
+
+/**
+ An opaque type for handling buffered IO
+
+ @see event2/bufferevent.h
+ */
+struct bufferevent
+#ifdef EVENT_IN_DOXYGEN_
+{}
+#endif
+;
+struct event_base;
+struct evbuffer;
+struct sockaddr;
+
+/**
+ A read or write callback for a bufferevent.
+
+ The read callback is triggered when new data arrives in the input
+ buffer and the amount of readable data exceed the low watermark
+ which is 0 by default.
+
+ The write callback is triggered if the write buffer has been
+ exhausted or fell below its low watermark.
+
+ @param bev the bufferevent that triggered the callback
+ @param ctx the user-specified context for this bufferevent
+ */
+typedef void (*bufferevent_data_cb)(struct bufferevent *bev, void *ctx);
+
+/**
+ An event/error callback for a bufferevent.
+
+ The event callback is triggered if either an EOF condition or another
+ unrecoverable error was encountered.
+
+ For bufferevents with deferred callbacks, this is a bitwise OR of all errors
+ that have happened on the bufferevent since the last callback invocation.
+
+ @param bev the bufferevent for which the error condition was reached
+ @param what a conjunction of flags: BEV_EVENT_READING or BEV_EVENT_WRITING
+ to indicate if the error was encountered on the read or write path,
+ and one of the following flags: BEV_EVENT_EOF, BEV_EVENT_ERROR,
+ BEV_EVENT_TIMEOUT, BEV_EVENT_CONNECTED.
+
+ @param ctx the user-specified context for this bufferevent
+*/
+typedef void (*bufferevent_event_cb)(struct bufferevent *bev, short what, void *ctx);
+
+/** Options that can be specified when creating a bufferevent */
+enum bufferevent_options {
+ /** If set, we close the underlying file
+ * descriptor/bufferevent/whatever when this bufferevent is freed. */
+ BEV_OPT_CLOSE_ON_FREE = (1<<0),
+
+ /** If set, and threading is enabled, operations on this bufferevent
+ * are protected by a lock */
+ BEV_OPT_THREADSAFE = (1<<1),
+
+ /** If set, callbacks are run deferred in the event loop. */
+ BEV_OPT_DEFER_CALLBACKS = (1<<2),
+
+ /** If set, callbacks are executed without locks being held on the
+ * bufferevent. This option currently requires that
+ * BEV_OPT_DEFER_CALLBACKS also be set; a future version of Libevent
+ * might remove the requirement.*/
+ BEV_OPT_UNLOCK_CALLBACKS = (1<<3)
+};
+
+/**
+ Create a new socket bufferevent over an existing socket.
+
+ @param base the event base to associate with the new bufferevent.
+ @param fd the file descriptor from which data is read and written to.
+ This file descriptor is not allowed to be a pipe(2).
+ It is safe to set the fd to -1, so long as you later
+ set it with bufferevent_setfd or bufferevent_socket_connect().
+ @param options Zero or more BEV_OPT_* flags
+ @return a pointer to a newly allocated bufferevent struct, or NULL if an
+ error occurred
+ @see bufferevent_free()
+ */
+EVENT2_EXPORT_SYMBOL
+struct bufferevent *bufferevent_socket_new(struct event_base *base, evutil_socket_t fd, int options);
+
+/**
+ Launch a connect() attempt with a socket-based bufferevent.
+
+ When the connect succeeds, the eventcb will be invoked with
+ BEV_EVENT_CONNECTED set.
+
+ If the bufferevent does not already have a socket set, we allocate a new
+ socket here and make it nonblocking before we begin.
+
+ If no address is provided, we assume that the socket is already connecting,
+ and configure the bufferevent so that a BEV_EVENT_CONNECTED event will be
+ yielded when it is done connecting.
+
+ @param bufev an existing bufferevent allocated with
+ bufferevent_socket_new().
+ @param addr the address we should connect to
+ @param socklen The length of the address
+ @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_socket_connect(struct bufferevent *, const struct sockaddr *, int);
+
+struct evdns_base;
+/**
+ Resolve the hostname 'hostname' and connect to it as with
+ bufferevent_socket_connect().
+
+ @param bufev An existing bufferevent allocated with bufferevent_socket_new()
+ @param evdns_base Optionally, an evdns_base to use for resolving hostnames
+ asynchronously. May be set to NULL for a blocking resolve.
+ @param family A preferred address family to resolve addresses to, or
+ AF_UNSPEC for no preference. Only AF_INET, AF_INET6, and AF_UNSPEC are
+ supported.
+ @param hostname The hostname to resolve; see below for notes on recognized
+ formats
+ @param port The port to connect to on the resolved address.
+ @return 0 if successful, -1 on failure.
+
+ Recognized hostname formats are:
+
+ www.example.com (hostname)
+ 1.2.3.4 (ipv4address)
+ ::1 (ipv6address)
+ [::1] ([ipv6address])
+
+ Performance note: If you do not provide an evdns_base, this function
+ may block while it waits for a DNS response. This is probably not
+ what you want.
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_socket_connect_hostname(struct bufferevent *,
+ struct evdns_base *, int, const char *, int);
+
+/**
+ Return the error code for the last failed DNS lookup attempt made by
+ bufferevent_socket_connect_hostname().
+
+ @param bev The bufferevent object.
+ @return DNS error code.
+ @see evutil_gai_strerror()
+*/
+EVENT2_EXPORT_SYMBOL
+int bufferevent_socket_get_dns_error(struct bufferevent *bev);
+
+/**
+ Assign a bufferevent to a specific event_base.
+
+ NOTE that only socket bufferevents support this function.
+
+ @param base an event_base returned by event_init()
+ @param bufev a bufferevent struct returned by bufferevent_new()
+ or bufferevent_socket_new()
+ @return 0 if successful, or -1 if an error occurred
+ @see bufferevent_new()
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_base_set(struct event_base *base, struct bufferevent *bufev);
+
+/**
+ Return the event_base used by a bufferevent
+*/
+EVENT2_EXPORT_SYMBOL
+struct event_base *bufferevent_get_base(struct bufferevent *bev);
+
+/**
+ Assign a priority to a bufferevent.
+
+ Only supported for socket bufferevents.
+
+ @param bufev a bufferevent struct
+ @param pri the priority to be assigned
+ @return 0 if successful, or -1 if an error occurred
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_priority_set(struct bufferevent *bufev, int pri);
+
+/**
+ Return the priority of a bufferevent.
+
+ Only supported for socket bufferevents
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_get_priority(const struct bufferevent *bufev);
+
+/**
+ Deallocate the storage associated with a bufferevent structure.
+
+ If there is pending data to write on the bufferevent, it probably won't be
+ flushed before the bufferevent is freed.
+
+ @param bufev the bufferevent structure to be freed.
+ */
+EVENT2_EXPORT_SYMBOL
+void bufferevent_free(struct bufferevent *bufev);
+
+
+/**
+ Changes the callbacks for a bufferevent.
+
+ @param bufev the bufferevent object for which to change callbacks
+ @param readcb callback to invoke when there is data to be read, or NULL if
+ no callback is desired
+ @param writecb callback to invoke when the file descriptor is ready for
+ writing, or NULL if no callback is desired
+ @param eventcb callback to invoke when there is an event on the file
+ descriptor
+ @param cbarg an argument that will be supplied to each of the callbacks
+ (readcb, writecb, and errorcb)
+ @see bufferevent_new()
+ */
+EVENT2_EXPORT_SYMBOL
+void bufferevent_setcb(struct bufferevent *bufev,
+ bufferevent_data_cb readcb, bufferevent_data_cb writecb,
+ bufferevent_event_cb eventcb, void *cbarg);
+
+/**
+ Retrieves the callbacks for a bufferevent.
+
+ @param bufev the bufferevent to examine.
+ @param readcb_ptr if readcb_ptr is nonnull, *readcb_ptr is set to the current
+ read callback for the bufferevent.
+ @param writecb_ptr if writecb_ptr is nonnull, *writecb_ptr is set to the
+ current write callback for the bufferevent.
+ @param eventcb_ptr if eventcb_ptr is nonnull, *eventcb_ptr is set to the
+ current event callback for the bufferevent.
+ @param cbarg_ptr if cbarg_ptr is nonnull, *cbarg_ptr is set to the current
+ callback argument for the bufferevent.
+ @see buffervent_setcb()
+*/
+EVENT2_EXPORT_SYMBOL
+void bufferevent_getcb(struct bufferevent *bufev,
+ bufferevent_data_cb *readcb_ptr,
+ bufferevent_data_cb *writecb_ptr,
+ bufferevent_event_cb *eventcb_ptr,
+ void **cbarg_ptr);
+
+/**
+ Changes the file descriptor on which the bufferevent operates.
+ Not supported for all bufferevent types.
+
+ @param bufev the bufferevent object for which to change the file descriptor
+ @param fd the file descriptor to operate on
+*/
+EVENT2_EXPORT_SYMBOL
+int bufferevent_setfd(struct bufferevent *bufev, evutil_socket_t fd);
+
+/**
+ Returns the file descriptor associated with a bufferevent, or -1 if
+ no file descriptor is associated with the bufferevent.
+ */
+EVENT2_EXPORT_SYMBOL
+evutil_socket_t bufferevent_getfd(struct bufferevent *bufev);
+
+/**
+ Returns the underlying bufferevent associated with a bufferevent (if
+ the bufferevent is a wrapper), or NULL if there is no underlying bufferevent.
+ */
+EVENT2_EXPORT_SYMBOL
+struct bufferevent *bufferevent_get_underlying(struct bufferevent *bufev);
+
+/**
+ Write data to a bufferevent buffer.
+
+ The bufferevent_write() function can be used to write data to the file
+ descriptor. The data is appended to the output buffer and written to the
+ descriptor automatically as it becomes available for writing.
+
+ @param bufev the bufferevent to be written to
+ @param data a pointer to the data to be written
+ @param size the length of the data, in bytes
+ @return 0 if successful, or -1 if an error occurred
+ @see bufferevent_write_buffer()
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_write(struct bufferevent *bufev,
+ const void *data, size_t size);
+
+
+/**
+ Write data from an evbuffer to a bufferevent buffer. The evbuffer is
+ being drained as a result.
+
+ @param bufev the bufferevent to be written to
+ @param buf the evbuffer to be written
+ @return 0 if successful, or -1 if an error occurred
+ @see bufferevent_write()
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_write_buffer(struct bufferevent *bufev, struct evbuffer *buf);
+
+
+/**
+ Read data from a bufferevent buffer.
+
+ The bufferevent_read() function is used to read data from the input buffer.
+
+ @param bufev the bufferevent to be read from
+ @param data pointer to a buffer that will store the data
+ @param size the size of the data buffer, in bytes
+ @return the amount of data read, in bytes.
+ */
+EVENT2_EXPORT_SYMBOL
+size_t bufferevent_read(struct bufferevent *bufev, void *data, size_t size);
+
+/**
+ Read data from a bufferevent buffer into an evbuffer. This avoids
+ memory copies.
+
+ @param bufev the bufferevent to be read from
+ @param buf the evbuffer to which to add data
+ @return 0 if successful, or -1 if an error occurred.
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_read_buffer(struct bufferevent *bufev, struct evbuffer *buf);
+
+/**
+ Returns the input buffer.
+
+ The user MUST NOT set the callback on this buffer.
+
+ @param bufev the bufferevent from which to get the evbuffer
+ @return the evbuffer object for the input buffer
+ */
+
+EVENT2_EXPORT_SYMBOL
+struct evbuffer *bufferevent_get_input(struct bufferevent *bufev);
+
+/**
+ Returns the output buffer.
+
+ The user MUST NOT set the callback on this buffer.
+
+ When filters are being used, the filters need to be manually
+ triggered if the output buffer was manipulated.
+
+ @param bufev the bufferevent from which to get the evbuffer
+ @return the evbuffer object for the output buffer
+ */
+
+EVENT2_EXPORT_SYMBOL
+struct evbuffer *bufferevent_get_output(struct bufferevent *bufev);
+
+/**
+ Enable a bufferevent.
+
+ @param bufev the bufferevent to be enabled
+ @param event any combination of EV_READ | EV_WRITE.
+ @return 0 if successful, or -1 if an error occurred
+ @see bufferevent_disable()
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_enable(struct bufferevent *bufev, short event);
+
+/**
+ Disable a bufferevent.
+
+ @param bufev the bufferevent to be disabled
+ @param event any combination of EV_READ | EV_WRITE.
+ @return 0 if successful, or -1 if an error occurred
+ @see bufferevent_enable()
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_disable(struct bufferevent *bufev, short event);
+
+/**
+ Return the events that are enabled on a given bufferevent.
+
+ @param bufev the bufferevent to inspect
+ @return A combination of EV_READ | EV_WRITE
+ */
+EVENT2_EXPORT_SYMBOL
+short bufferevent_get_enabled(struct bufferevent *bufev);
+
+/**
+ Set the read and write timeout for a bufferevent.
+
+ A bufferevent's timeout will fire the first time that the indicated
+ amount of time has elapsed since a successful read or write operation,
+ during which the bufferevent was trying to read or write.
+
+ (In other words, if reading or writing is disabled, or if the
+ bufferevent's read or write operation has been suspended because
+ there's no data to write, or not enough banwidth, or so on, the
+ timeout isn't active. The timeout only becomes active when we we're
+ willing to actually read or write.)
+
+ Calling bufferevent_enable or setting a timeout for a bufferevent
+ whose timeout is already pending resets its timeout.
+
+ If the timeout elapses, the corresponding operation (EV_READ or
+ EV_WRITE) becomes disabled until you re-enable it again. The
+ bufferevent's event callback is called with the
+ BEV_EVENT_TIMEOUT|BEV_EVENT_READING or
+ BEV_EVENT_TIMEOUT|BEV_EVENT_WRITING.
+
+ @param bufev the bufferevent to be modified
+ @param timeout_read the read timeout, or NULL
+ @param timeout_write the write timeout, or NULL
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_set_timeouts(struct bufferevent *bufev,
+ const struct timeval *timeout_read, const struct timeval *timeout_write);
+
+/**
+ Sets the watermarks for read and write events.
+
+ On input, a bufferevent does not invoke the user read callback unless
+ there is at least low watermark data in the buffer. If the read buffer
+ is beyond the high watermark, the bufferevent stops reading from the network.
+
+ On output, the user write callback is invoked whenever the buffered data
+ falls below the low watermark. Filters that write to this bufev will try
+ not to write more bytes to this buffer than the high watermark would allow,
+ except when flushing.
+
+ @param bufev the bufferevent to be modified
+ @param events EV_READ, EV_WRITE or both
+ @param lowmark the lower watermark to set
+ @param highmark the high watermark to set
+*/
+
+EVENT2_EXPORT_SYMBOL
+void bufferevent_setwatermark(struct bufferevent *bufev, short events,
+ size_t lowmark, size_t highmark);
+
+/**
+ Retrieves the watermarks for read or write events.
+ Returns non-zero if events contains not only EV_READ or EV_WRITE.
+ Returns zero if events equal EV_READ or EV_WRITE
+
+ @param bufev the bufferevent to be examined
+ @param events EV_READ or EV_WRITE
+ @param lowmark receives the lower watermark if not NULL
+ @param highmark receives the high watermark if not NULL
+*/
+EVENT2_EXPORT_SYMBOL
+int bufferevent_getwatermark(struct bufferevent *bufev, short events,
+ size_t *lowmark, size_t *highmark);
+
+/**
+ Acquire the lock on a bufferevent. Has no effect if locking was not
+ enabled with BEV_OPT_THREADSAFE.
+ */
+EVENT2_EXPORT_SYMBOL
+void bufferevent_lock(struct bufferevent *bufev);
+
+/**
+ Release the lock on a bufferevent. Has no effect if locking was not
+ enabled with BEV_OPT_THREADSAFE.
+ */
+EVENT2_EXPORT_SYMBOL
+void bufferevent_unlock(struct bufferevent *bufev);
+
+
+/**
+ * Public interface to manually increase the reference count of a bufferevent
+ * this is useful in situations where a user may reference the bufferevent
+ * somewhere eles (unknown to libevent)
+ *
+ * @param bufev the bufferevent to increase the refcount on
+ *
+ */
+EVENT2_EXPORT_SYMBOL
+void bufferevent_incref(struct bufferevent *bufev);
+
+/**
+ * Public interface to manually decrement the reference count of a bufferevent
+ *
+ * Warning: make sure you know what you're doing. This is mainly used in
+ * conjunction with bufferevent_incref(). This will free up all data associated
+ * with a bufferevent if the reference count hits 0.
+ *
+ * @param bufev the bufferevent to decrement the refcount on
+ *
+ * @return 1 if the bufferevent was freed, otherwise 0 (still referenced)
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_decref(struct bufferevent *bufev);
+
+/**
+ Flags that can be passed into filters to let them know how to
+ deal with the incoming data.
+*/
+enum bufferevent_flush_mode {
+ /** usually set when processing data */
+ BEV_NORMAL = 0,
+
+ /** want to checkpoint all data sent. */
+ BEV_FLUSH = 1,
+
+ /** encountered EOF on read or done sending data */
+ BEV_FINISHED = 2
+};
+
+/**
+ Triggers the bufferevent to produce more data if possible.
+
+ @param bufev the bufferevent object
+ @param iotype either EV_READ or EV_WRITE or both.
+ @param mode either BEV_NORMAL or BEV_FLUSH or BEV_FINISHED
+ @return -1 on failure, 0 if no data was produces, 1 if data was produced
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_flush(struct bufferevent *bufev,
+ short iotype,
+ enum bufferevent_flush_mode mode);
+
+/**
+ Flags for bufferevent_trigger(_event) that modify when and how to trigger
+ the callback.
+*/
+enum bufferevent_trigger_options {
+ /** trigger the callback regardless of the watermarks */
+ BEV_TRIG_IGNORE_WATERMARKS = (1<<16),
+
+ /** defer even if the callbacks are not */
+ BEV_TRIG_DEFER_CALLBACKS = BEV_OPT_DEFER_CALLBACKS
+
+ /* (Note: for internal reasons, these need to be disjoint from
+ * bufferevent_options, except when they mean the same thing. */
+};
+
+/**
+ Triggers bufferevent data callbacks.
+
+ The function will honor watermarks unless options contain
+ BEV_TRIG_IGNORE_WATERMARKS. If the options contain BEV_OPT_DEFER_CALLBACKS,
+ the callbacks are deferred.
+
+ @param bufev the bufferevent object
+ @param iotype either EV_READ or EV_WRITE or both.
+ @param options
+ */
+EVENT2_EXPORT_SYMBOL
+void bufferevent_trigger(struct bufferevent *bufev, short iotype,
+ int options);
+
+/**
+ Triggers the bufferevent event callback.
+
+ If the options contain BEV_OPT_DEFER_CALLBACKS, the callbacks are deferred.
+
+ @param bufev the bufferevent object
+ @param what the flags to pass onto the event callback
+ @param options
+ */
+EVENT2_EXPORT_SYMBOL
+void bufferevent_trigger_event(struct bufferevent *bufev, short what,
+ int options);
+
+/**
+ @name Filtering support
+
+ @{
+*/
+/**
+ Values that filters can return.
+ */
+enum bufferevent_filter_result {
+ /** everything is okay */
+ BEV_OK = 0,
+
+ /** the filter needs to read more data before output */
+ BEV_NEED_MORE = 1,
+
+ /** the filter encountered a critical error, no further data
+ can be processed. */
+ BEV_ERROR = 2
+};
+
+/** A callback function to implement a filter for a bufferevent.
+
+ @param src An evbuffer to drain data from.
+ @param dst An evbuffer to add data to.
+ @param limit A suggested upper bound of bytes to write to dst.
+ The filter may ignore this value, but doing so means that
+ it will overflow the high-water mark associated with dst.
+ -1 means "no limit".
+ @param mode Whether we should write data as may be convenient
+ (BEV_NORMAL), or flush as much data as we can (BEV_FLUSH),
+ or flush as much as we can, possibly including an end-of-stream
+ marker (BEV_FINISH).
+ @param ctx A user-supplied pointer.
+
+ @return BEV_OK if we wrote some data; BEV_NEED_MORE if we can't
+ produce any more output until we get some input; and BEV_ERROR
+ on an error.
+ */
+typedef enum bufferevent_filter_result (*bufferevent_filter_cb)(
+ struct evbuffer *src, struct evbuffer *dst, ev_ssize_t dst_limit,
+ enum bufferevent_flush_mode mode, void *ctx);
+
+/**
+ Allocate a new filtering bufferevent on top of an existing bufferevent.
+
+ @param underlying the underlying bufferevent.
+ @param input_filter The filter to apply to data we read from the underlying
+ bufferevent
+ @param output_filter The filer to apply to data we write to the underlying
+ bufferevent
+ @param options A bitfield of bufferevent options.
+ @param free_context A function to use to free the filter context when
+ this bufferevent is freed.
+ @param ctx A context pointer to pass to the filter functions.
+ */
+EVENT2_EXPORT_SYMBOL
+struct bufferevent *
+bufferevent_filter_new(struct bufferevent *underlying,
+ bufferevent_filter_cb input_filter,
+ bufferevent_filter_cb output_filter,
+ int options,
+ void (*free_context)(void *),
+ void *ctx);
+/**@}*/
+
+/**
+ Allocate a pair of linked bufferevents. The bufferevents behave as would
+ two bufferevent_sock instances connected to opposite ends of a
+ socketpair(), except that no internal socketpair is allocated.
+
+ @param base The event base to associate with the socketpair.
+ @param options A set of options for this bufferevent
+ @param pair A pointer to an array to hold the two new bufferevent objects.
+ @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_pair_new(struct event_base *base, int options,
+ struct bufferevent *pair[2]);
+
+/**
+ Given one bufferevent returned by bufferevent_pair_new(), returns the
+ other one if it still exists. Otherwise returns NULL.
+ */
+EVENT2_EXPORT_SYMBOL
+struct bufferevent *bufferevent_pair_get_partner(struct bufferevent *bev);
+
+/**
+ Abstract type used to configure rate-limiting on a bufferevent or a group
+ of bufferevents.
+ */
+struct ev_token_bucket_cfg;
+
+/**
+ A group of bufferevents which are configured to respect the same rate
+ limit.
+*/
+struct bufferevent_rate_limit_group;
+
+/** Maximum configurable rate- or burst-limit. */
+#define EV_RATE_LIMIT_MAX EV_SSIZE_MAX
+
+/**
+ Initialize and return a new object to configure the rate-limiting behavior
+ of bufferevents.
+
+ @param read_rate The maximum number of bytes to read per tick on
+ average.
+ @param read_burst The maximum number of bytes to read in any single tick.
+ @param write_rate The maximum number of bytes to write per tick on
+ average.
+ @param write_burst The maximum number of bytes to write in any single tick.
+ @param tick_len The length of a single tick. Defaults to one second.
+ Any fractions of a millisecond are ignored.
+
+ Note that all rate-limits hare are currently best-effort: future versions
+ of Libevent may implement them more tightly.
+ */
+EVENT2_EXPORT_SYMBOL
+struct ev_token_bucket_cfg *ev_token_bucket_cfg_new(
+ size_t read_rate, size_t read_burst,
+ size_t write_rate, size_t write_burst,
+ const struct timeval *tick_len);
+
+/** Free all storage held in 'cfg'.
+
+ Note: 'cfg' is not currently reference-counted; it is not safe to free it
+ until no bufferevent is using it.
+ */
+EVENT2_EXPORT_SYMBOL
+void ev_token_bucket_cfg_free(struct ev_token_bucket_cfg *cfg);
+
+/**
+ Set the rate-limit of a the bufferevent 'bev' to the one specified in
+ 'cfg'. If 'cfg' is NULL, disable any per-bufferevent rate-limiting on
+ 'bev'.
+
+ Note that only some bufferevent types currently respect rate-limiting.
+ They are: socket-based bufferevents (normal and IOCP-based), and SSL-based
+ bufferevents.
+
+ Return 0 on sucess, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_set_rate_limit(struct bufferevent *bev,
+ struct ev_token_bucket_cfg *cfg);
+
+/**
+ Create a new rate-limit group for bufferevents. A rate-limit group
+ constrains the maximum number of bytes sent and received, in toto,
+ by all of its bufferevents.
+
+ @param base An event_base to run any necessary timeouts for the group.
+ Note that all bufferevents in the group do not necessarily need to share
+ this event_base.
+ @param cfg The rate-limit for this group.
+
+ Note that all rate-limits hare are currently best-effort: future versions
+ of Libevent may implement them more tightly.
+
+ Note also that only some bufferevent types currently respect rate-limiting.
+ They are: socket-based bufferevents (normal and IOCP-based), and SSL-based
+ bufferevents.
+ */
+EVENT2_EXPORT_SYMBOL
+struct bufferevent_rate_limit_group *bufferevent_rate_limit_group_new(
+ struct event_base *base,
+ const struct ev_token_bucket_cfg *cfg);
+/**
+ Change the rate-limiting settings for a given rate-limiting group.
+
+ Return 0 on success, -1 on failure.
+*/
+EVENT2_EXPORT_SYMBOL
+int bufferevent_rate_limit_group_set_cfg(
+ struct bufferevent_rate_limit_group *,
+ const struct ev_token_bucket_cfg *);
+
+/**
+ Change the smallest quantum we're willing to allocate to any single
+ bufferevent in a group for reading or writing at a time.
+
+ The rationale is that, because of TCP/IP protocol overheads and kernel
+ behavior, if a rate-limiting group is so tight on bandwidth that you're
+ only willing to send 1 byte per tick per bufferevent, you might instead
+ want to batch up the reads and writes so that you send N bytes per
+ 1/N of the bufferevents (chosen at random) each tick, so you still wind
+ up send 1 byte per tick per bufferevent on average, but you don't send
+ so many tiny packets.
+
+ The default min-share is currently 64 bytes.
+
+ Returns 0 on success, -1 on faulre.
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_rate_limit_group_set_min_share(
+ struct bufferevent_rate_limit_group *, size_t);
+
+/**
+ Free a rate-limiting group. The group must have no members when
+ this function is called.
+*/
+EVENT2_EXPORT_SYMBOL
+void bufferevent_rate_limit_group_free(struct bufferevent_rate_limit_group *);
+
+/**
+ Add 'bev' to the list of bufferevents whose aggregate reading and writing
+ is restricted by 'g'. If 'g' is NULL, remove 'bev' from its current group.
+
+ A bufferevent may belong to no more than one rate-limit group at a time.
+ If 'bev' is already a member of a group, it will be removed from its old
+ group before being added to 'g'.
+
+ Return 0 on success and -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_add_to_rate_limit_group(struct bufferevent *bev,
+ struct bufferevent_rate_limit_group *g);
+
+/** Remove 'bev' from its current rate-limit group (if any). */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_remove_from_rate_limit_group(struct bufferevent *bev);
+
+/**
+ Set the size limit for single read operation.
+
+ Set to 0 for a reasonable default.
+
+ Return 0 on success and -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_set_max_single_read(struct bufferevent *bev, size_t size);
+
+/**
+ Set the size limit for single write operation.
+
+ Set to 0 for a reasonable default.
+
+ Return 0 on success and -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_set_max_single_write(struct bufferevent *bev, size_t size);
+
+/** Get the current size limit for single read operation. */
+EVENT2_EXPORT_SYMBOL
+ev_ssize_t bufferevent_get_max_single_read(struct bufferevent *bev);
+
+/** Get the current size limit for single write operation. */
+EVENT2_EXPORT_SYMBOL
+ev_ssize_t bufferevent_get_max_single_write(struct bufferevent *bev);
+
+/**
+ @name Rate limit inspection
+
+ Return the current read or write bucket size for a bufferevent.
+ If it is not configured with a per-bufferevent ratelimit, return
+ EV_SSIZE_MAX. This function does not inspect the group limit, if any.
+ Note that it can return a negative value if the bufferevent has been
+ made to read or write more than its limit.
+
+ @{
+ */
+EVENT2_EXPORT_SYMBOL
+ev_ssize_t bufferevent_get_read_limit(struct bufferevent *bev);
+EVENT2_EXPORT_SYMBOL
+ev_ssize_t bufferevent_get_write_limit(struct bufferevent *bev);
+/*@}*/
+
+EVENT2_EXPORT_SYMBOL
+ev_ssize_t bufferevent_get_max_to_read(struct bufferevent *bev);
+EVENT2_EXPORT_SYMBOL
+ev_ssize_t bufferevent_get_max_to_write(struct bufferevent *bev);
+
+EVENT2_EXPORT_SYMBOL
+const struct ev_token_bucket_cfg *bufferevent_get_token_bucket_cfg(const struct bufferevent * bev);
+
+/**
+ @name Group Rate limit inspection
+
+ Return the read or write bucket size for a bufferevent rate limit
+ group. Note that it can return a negative value if bufferevents in
+ the group have been made to read or write more than their limits.
+
+ @{
+ */
+EVENT2_EXPORT_SYMBOL
+ev_ssize_t bufferevent_rate_limit_group_get_read_limit(
+ struct bufferevent_rate_limit_group *);
+EVENT2_EXPORT_SYMBOL
+ev_ssize_t bufferevent_rate_limit_group_get_write_limit(
+ struct bufferevent_rate_limit_group *);
+/*@}*/
+
+/**
+ @name Rate limit manipulation
+
+ Subtract a number of bytes from a bufferevent's read or write bucket.
+ The decrement value can be negative, if you want to manually refill
+ the bucket. If the change puts the bucket above or below zero, the
+ bufferevent will resume or suspend reading writing as appropriate.
+ These functions make no change in the buckets for the bufferevent's
+ group, if any.
+
+ Returns 0 on success, -1 on internal error.
+
+ @{
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_decrement_read_limit(struct bufferevent *bev, ev_ssize_t decr);
+EVENT2_EXPORT_SYMBOL
+int bufferevent_decrement_write_limit(struct bufferevent *bev, ev_ssize_t decr);
+/*@}*/
+
+/**
+ @name Group rate limit manipulation
+
+ Subtract a number of bytes from a bufferevent rate-limiting group's
+ read or write bucket. The decrement value can be negative, if you
+ want to manually refill the bucket. If the change puts the bucket
+ above or below zero, the bufferevents in the group will resume or
+ suspend reading writing as appropriate.
+
+ Returns 0 on success, -1 on internal error.
+
+ @{
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_rate_limit_group_decrement_read(
+ struct bufferevent_rate_limit_group *, ev_ssize_t);
+EVENT2_EXPORT_SYMBOL
+int bufferevent_rate_limit_group_decrement_write(
+ struct bufferevent_rate_limit_group *, ev_ssize_t);
+/*@}*/
+
+
+/**
+ * Inspect the total bytes read/written on a group.
+ *
+ * Set the variable pointed to by total_read_out to the total number of bytes
+ * ever read on grp, and the variable pointed to by total_written_out to the
+ * total number of bytes ever written on grp. */
+EVENT2_EXPORT_SYMBOL
+void bufferevent_rate_limit_group_get_totals(
+ struct bufferevent_rate_limit_group *grp,
+ ev_uint64_t *total_read_out, ev_uint64_t *total_written_out);
+
+/**
+ * Reset the total bytes read/written on a group.
+ *
+ * Reset the number of bytes read or written on grp as given by
+ * bufferevent_rate_limit_group_reset_totals(). */
+EVENT2_EXPORT_SYMBOL
+void
+bufferevent_rate_limit_group_reset_totals(
+ struct bufferevent_rate_limit_group *grp);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_BUFFEREVENT_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/include/event2/bufferevent_compat.h b/protocols/Telegram/tgl/libevent/include/event2/bufferevent_compat.h
new file mode 100644
index 0000000000..65482042f9
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/event2/bufferevent_compat.h
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos, Nick Mathewson
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 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.
+ */
+#ifndef EVENT2_BUFFEREVENT_COMPAT_H_INCLUDED_
+#define EVENT2_BUFFEREVENT_COMPAT_H_INCLUDED_
+
+#define evbuffercb bufferevent_data_cb
+#define everrorcb bufferevent_event_cb
+
+/**
+ Create a new bufferevent for an fd.
+
+ This function is deprecated. Use bufferevent_socket_new and
+ bufferevent_set_callbacks instead.
+
+ Libevent provides an abstraction on top of the regular event callbacks.
+ This abstraction is called a buffered event. A buffered event provides
+ input and output buffers that get filled and drained automatically. The
+ user of a buffered event no longer deals directly with the I/O, but
+ instead is reading from input and writing to output buffers.
+
+ Once initialized, the bufferevent structure can be used repeatedly with
+ bufferevent_enable() and bufferevent_disable().
+
+ When read enabled the bufferevent will try to read from the file descriptor
+ and call the read callback. The write callback is executed whenever the
+ output buffer is drained below the write low watermark, which is 0 by
+ default.
+
+ If multiple bases are in use, bufferevent_base_set() must be called before
+ enabling the bufferevent for the first time.
+
+ @deprecated This function is deprecated because it uses the current
+ event base, and as such can be error prone for multithreaded programs.
+ Use bufferevent_socket_new() instead.
+
+ @param fd the file descriptor from which data is read and written to.
+ This file descriptor is not allowed to be a pipe(2).
+ @param readcb callback to invoke when there is data to be read, or NULL if
+ no callback is desired
+ @param writecb callback to invoke when the file descriptor is ready for
+ writing, or NULL if no callback is desired
+ @param errorcb callback to invoke when there is an error on the file
+ descriptor
+ @param cbarg an argument that will be supplied to each of the callbacks
+ (readcb, writecb, and errorcb)
+ @return a pointer to a newly allocated bufferevent struct, or NULL if an
+ error occurred
+ @see bufferevent_base_set(), bufferevent_free()
+ */
+struct bufferevent *bufferevent_new(evutil_socket_t fd,
+ evbuffercb readcb, evbuffercb writecb, everrorcb errorcb, void *cbarg);
+
+
+/**
+ Set the read and write timeout for a buffered event.
+
+ @param bufev the bufferevent to be modified
+ @param timeout_read the read timeout
+ @param timeout_write the write timeout
+ */
+void bufferevent_settimeout(struct bufferevent *bufev,
+ int timeout_read, int timeout_write);
+
+#define EVBUFFER_READ BEV_EVENT_READING
+#define EVBUFFER_WRITE BEV_EVENT_WRITING
+#define EVBUFFER_EOF BEV_EVENT_EOF
+#define EVBUFFER_ERROR BEV_EVENT_ERROR
+#define EVBUFFER_TIMEOUT BEV_EVENT_TIMEOUT
+
+/** macro for getting access to the input buffer of a bufferevent */
+#define EVBUFFER_INPUT(x) bufferevent_get_input(x)
+/** macro for getting access to the output buffer of a bufferevent */
+#define EVBUFFER_OUTPUT(x) bufferevent_get_output(x)
+
+#endif
diff --git a/protocols/Telegram/tgl/libevent/include/event2/bufferevent_ssl.h b/protocols/Telegram/tgl/libevent/include/event2/bufferevent_ssl.h
new file mode 100644
index 0000000000..bf39b844a9
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/event2/bufferevent_ssl.h
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVENT2_BUFFEREVENT_SSL_H_INCLUDED_
+#define EVENT2_BUFFEREVENT_SSL_H_INCLUDED_
+
+/** @file event2/bufferevent_ssl.h
+
+ OpenSSL support for bufferevents.
+ */
+#include <event2/visibility.h>
+#include <event2/event-config.h>
+#include <event2/bufferevent.h>
+#include <event2/util.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* This is what openssl's SSL objects are underneath. */
+struct ssl_st;
+
+/**
+ The state of an SSL object to be used when creating a new
+ SSL bufferevent.
+ */
+enum bufferevent_ssl_state {
+ BUFFEREVENT_SSL_OPEN = 0,
+ BUFFEREVENT_SSL_CONNECTING = 1,
+ BUFFEREVENT_SSL_ACCEPTING = 2
+};
+
+#if defined(EVENT__HAVE_OPENSSL) || defined(EVENT_IN_DOXYGEN_)
+/**
+ Create a new SSL bufferevent to send its data over another bufferevent.
+
+ @param base An event_base to use to detect reading and writing. It
+ must also be the base for the underlying bufferevent.
+ @param underlying A socket to use for this SSL
+ @param ssl A SSL* object from openssl.
+ @param state The current state of the SSL connection
+ @param options One or more bufferevent_options
+ @return A new bufferevent on success, or NULL on failure
+*/
+EVENT2_EXPORT_SYMBOL
+struct bufferevent *
+bufferevent_openssl_filter_new(struct event_base *base,
+ struct bufferevent *underlying,
+ struct ssl_st *ssl,
+ enum bufferevent_ssl_state state,
+ int options);
+
+/**
+ Create a new SSL bufferevent to send its data over an SSL * on a socket.
+
+ @param base An event_base to use to detect reading and writing
+ @param fd A socket to use for this SSL
+ @param ssl A SSL* object from openssl.
+ @param state The current state of the SSL connection
+ @param options One or more bufferevent_options
+ @return A new bufferevent on success, or NULL on failure.
+*/
+EVENT2_EXPORT_SYMBOL
+struct bufferevent *
+bufferevent_openssl_socket_new(struct event_base *base,
+ evutil_socket_t fd,
+ struct ssl_st *ssl,
+ enum bufferevent_ssl_state state,
+ int options);
+
+/** Control how to report dirty SSL shutdowns.
+
+ If the peer (or the network, or an attacker) closes the TCP
+ connection before closing the SSL channel, and the protocol is SSL >= v3,
+ this is a "dirty" shutdown. If allow_dirty_shutdown is 0 (default),
+ this is reported as BEV_EVENT_ERROR.
+
+ If instead allow_dirty_shutdown=1, a dirty shutdown is reported as
+ BEV_EVENT_EOF.
+
+ (Note that if the protocol is < SSLv3, you will always receive
+ BEV_EVENT_EOF, since SSL 2 and earlier cannot distinguish a secure
+ connection close from a dirty one. This is one reason (among many)
+ not to use SSL 2.)
+*/
+
+EVENT2_EXPORT_SYMBOL
+int bufferevent_openssl_get_allow_dirty_shutdown(struct bufferevent *bev);
+EVENT2_EXPORT_SYMBOL
+void bufferevent_openssl_set_allow_dirty_shutdown(struct bufferevent *bev,
+ int allow_dirty_shutdown);
+
+/** Return the underlying openssl SSL * object for an SSL bufferevent. */
+EVENT2_EXPORT_SYMBOL
+struct ssl_st *
+bufferevent_openssl_get_ssl(struct bufferevent *bufev);
+
+/** Tells a bufferevent to begin SSL renegotiation. */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_ssl_renegotiate(struct bufferevent *bev);
+
+/** Return the most recent OpenSSL error reported on an SSL bufferevent. */
+EVENT2_EXPORT_SYMBOL
+unsigned long bufferevent_get_openssl_error(struct bufferevent *bev);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_BUFFEREVENT_SSL_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/include/event2/bufferevent_struct.h b/protocols/Telegram/tgl/libevent/include/event2/bufferevent_struct.h
new file mode 100644
index 0000000000..e84c082c30
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/event2/bufferevent_struct.h
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVENT2_BUFFEREVENT_STRUCT_H_INCLUDED_
+#define EVENT2_BUFFEREVENT_STRUCT_H_INCLUDED_
+
+/** @file event2/bufferevent_struct.h
+
+ Data structures for bufferevents. Using these structures may hurt forward
+ compatibility with later versions of Libevent: be careful!
+
+ @deprecated Use of bufferevent_struct.h is completely deprecated; these
+ structures are only exposed for backward compatibility with programs
+ written before Libevent 2.0 that used them.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event-config.h>
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+/* For int types. */
+#include <event2/util.h>
+/* For struct event */
+#include <event2/event_struct.h>
+
+struct event_watermark {
+ size_t low;
+ size_t high;
+};
+
+/**
+ Shared implementation of a bufferevent.
+
+ This type is exposed only because it was exposed in previous versions,
+ and some people's code may rely on manipulating it. Otherwise, you
+ should really not rely on the layout, size, or contents of this structure:
+ it is fairly volatile, and WILL change in future versions of the code.
+**/
+struct bufferevent {
+ /** Event base for which this bufferevent was created. */
+ struct event_base *ev_base;
+ /** Pointer to a table of function pointers to set up how this
+ bufferevent behaves. */
+ const struct bufferevent_ops *be_ops;
+
+ /** A read event that triggers when a timeout has happened or a socket
+ is ready to read data. Only used by some subtypes of
+ bufferevent. */
+ struct event ev_read;
+ /** A write event that triggers when a timeout has happened or a socket
+ is ready to write data. Only used by some subtypes of
+ bufferevent. */
+ struct event ev_write;
+
+ /** An input buffer. Only the bufferevent is allowed to add data to
+ this buffer, though the user is allowed to drain it. */
+ struct evbuffer *input;
+
+ /** An input buffer. Only the bufferevent is allowed to drain data
+ from this buffer, though the user is allowed to add it. */
+ struct evbuffer *output;
+
+ struct event_watermark wm_read;
+ struct event_watermark wm_write;
+
+ bufferevent_data_cb readcb;
+ bufferevent_data_cb writecb;
+ /* This should be called 'eventcb', but renaming it would break
+ * backward compatibility */
+ bufferevent_event_cb errorcb;
+ void *cbarg;
+
+ struct timeval timeout_read;
+ struct timeval timeout_write;
+
+ /** Events that are currently enabled: currently EV_READ and EV_WRITE
+ are supported. */
+ short enabled;
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_BUFFEREVENT_STRUCT_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/include/event2/dns.h b/protocols/Telegram/tgl/libevent/include/event2/dns.h
new file mode 100644
index 0000000000..17cd86a2ec
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/event2/dns.h
@@ -0,0 +1,717 @@
+/*
+ * Copyright (c) 2006-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * The original DNS code is due to Adam Langley with heavy
+ * modifications by Nick Mathewson. Adam put his DNS software in the
+ * public domain. You can find his original copyright below. Please,
+ * aware that the code as part of Libevent is governed by the 3-clause
+ * BSD license above.
+ *
+ * This software is Public Domain. To view a copy of the public domain dedication,
+ * visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
+ * Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
+ *
+ * I ask and expect, but do not require, that all derivative works contain an
+ * attribution similar to:
+ * Parts developed by Adam Langley <agl@imperialviolet.org>
+ *
+ * You may wish to replace the word "Parts" with something else depending on
+ * the amount of original code.
+ *
+ * (Derivative works does not include programs which link against, run or include
+ * the source verbatim in their source distributions)
+ */
+
+/** @file event2/dns.h
+ *
+ * Welcome, gentle reader
+ *
+ * Async DNS lookups are really a whole lot harder than they should be,
+ * mostly stemming from the fact that the libc resolver has never been
+ * very good at them. Before you use this library you should see if libc
+ * can do the job for you with the modern async call getaddrinfo_a
+ * (see http://www.imperialviolet.org/page25.html#e498). Otherwise,
+ * please continue.
+ *
+ * The library keeps track of the state of nameservers and will avoid
+ * them when they go down. Otherwise it will round robin between them.
+ *
+ * Quick start guide:
+ * #include "evdns.h"
+ * void callback(int result, char type, int count, int ttl,
+ * void *addresses, void *arg);
+ * evdns_resolv_conf_parse(DNS_OPTIONS_ALL, "/etc/resolv.conf");
+ * evdns_resolve("www.hostname.com", 0, callback, NULL);
+ *
+ * When the lookup is complete the callback function is called. The
+ * first argument will be one of the DNS_ERR_* defines in evdns.h.
+ * Hopefully it will be DNS_ERR_NONE, in which case type will be
+ * DNS_IPv4_A, count will be the number of IP addresses, ttl is the time
+ * which the data can be cached for (in seconds), addresses will point
+ * to an array of uint32_t's and arg will be whatever you passed to
+ * evdns_resolve.
+ *
+ * Searching:
+ *
+ * In order for this library to be a good replacement for glibc's resolver it
+ * supports searching. This involves setting a list of default domains, in
+ * which names will be queried for. The number of dots in the query name
+ * determines the order in which this list is used.
+ *
+ * Searching appears to be a single lookup from the point of view of the API,
+ * although many DNS queries may be generated from a single call to
+ * evdns_resolve. Searching can also drastically slow down the resolution
+ * of names.
+ *
+ * To disable searching:
+ * 1. Never set it up. If you never call evdns_resolv_conf_parse or
+ * evdns_search_add then no searching will occur.
+ *
+ * 2. If you do call evdns_resolv_conf_parse then don't pass
+ * DNS_OPTION_SEARCH (or DNS_OPTIONS_ALL, which implies it).
+ *
+ * 3. When calling evdns_resolve, pass the DNS_QUERY_NO_SEARCH flag.
+ *
+ * The order of searches depends on the number of dots in the name. If the
+ * number is greater than the ndots setting then the names is first tried
+ * globally. Otherwise each search domain is appended in turn.
+ *
+ * The ndots setting can either be set from a resolv.conf, or by calling
+ * evdns_search_ndots_set.
+ *
+ * For example, with ndots set to 1 (the default) and a search domain list of
+ * ["myhome.net"]:
+ * Query: www
+ * Order: www.myhome.net, www.
+ *
+ * Query: www.abc
+ * Order: www.abc., www.abc.myhome.net
+ *
+ * Internals:
+ *
+ * Requests are kept in two queues. The first is the inflight queue. In
+ * this queue requests have an allocated transaction id and nameserver.
+ * They will soon be transmitted if they haven't already been.
+ *
+ * The second is the waiting queue. The size of the inflight ring is
+ * limited and all other requests wait in waiting queue for space. This
+ * bounds the number of concurrent requests so that we don't flood the
+ * nameserver. Several algorithms require a full walk of the inflight
+ * queue and so bounding its size keeps thing going nicely under huge
+ * (many thousands of requests) loads.
+ *
+ * If a nameserver loses too many requests it is considered down and we
+ * try not to use it. After a while we send a probe to that nameserver
+ * (a lookup for google.com) and, if it replies, we consider it working
+ * again. If the nameserver fails a probe we wait longer to try again
+ * with the next probe.
+ */
+
+#ifndef EVENT2_DNS_H_INCLUDED_
+#define EVENT2_DNS_H_INCLUDED_
+
+#include <event2/visibility.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* For integer types. */
+#include <event2/util.h>
+
+/** Error codes 0-5 are as described in RFC 1035. */
+#define DNS_ERR_NONE 0
+/** The name server was unable to interpret the query */
+#define DNS_ERR_FORMAT 1
+/** The name server was unable to process this query due to a problem with the
+ * name server */
+#define DNS_ERR_SERVERFAILED 2
+/** The domain name does not exist */
+#define DNS_ERR_NOTEXIST 3
+/** The name server does not support the requested kind of query */
+#define DNS_ERR_NOTIMPL 4
+/** The name server refuses to reform the specified operation for policy
+ * reasons */
+#define DNS_ERR_REFUSED 5
+/** The reply was truncated or ill-formatted */
+#define DNS_ERR_TRUNCATED 65
+/** An unknown error occurred */
+#define DNS_ERR_UNKNOWN 66
+/** Communication with the server timed out */
+#define DNS_ERR_TIMEOUT 67
+/** The request was canceled because the DNS subsystem was shut down. */
+#define DNS_ERR_SHUTDOWN 68
+/** The request was canceled via a call to evdns_cancel_request */
+#define DNS_ERR_CANCEL 69
+/** There were no answers and no error condition in the DNS packet.
+ * This can happen when you ask for an address that exists, but a record
+ * type that doesn't. */
+#define DNS_ERR_NODATA 70
+
+#define DNS_IPv4_A 1
+#define DNS_PTR 2
+#define DNS_IPv6_AAAA 3
+
+#define DNS_QUERY_NO_SEARCH 1
+
+#define DNS_OPTION_SEARCH 1
+#define DNS_OPTION_NAMESERVERS 2
+#define DNS_OPTION_MISC 4
+#define DNS_OPTION_HOSTSFILE 8
+#define DNS_OPTIONS_ALL 15
+
+/* Obsolete name for DNS_QUERY_NO_SEARCH */
+#define DNS_NO_SEARCH DNS_QUERY_NO_SEARCH
+
+/**
+ * The callback that contains the results from a lookup.
+ * - result is one of the DNS_ERR_* values (DNS_ERR_NONE for success)
+ * - type is either DNS_IPv4_A or DNS_PTR or DNS_IPv6_AAAA
+ * - count contains the number of addresses of form type
+ * - ttl is the number of seconds the resolution may be cached for.
+ * - addresses needs to be cast according to type. It will be an array of
+ * 4-byte sequences for ipv4, or an array of 16-byte sequences for ipv6,
+ * or a nul-terminated string for PTR.
+ */
+typedef void (*evdns_callback_type) (int result, char type, int count, int ttl, void *addresses, void *arg);
+
+struct evdns_base;
+struct event_base;
+
+/** Flag for evdns_base_new: process resolv.conf. */
+#define EVDNS_BASE_INITIALIZE_NAMESERVERS 1
+/** Flag for evdns_base_new: Do not prevent the libevent event loop from
+ * exiting when we have no active dns requests. */
+#define EVDNS_BASE_DISABLE_WHEN_INACTIVE 0x8000
+
+/**
+ Initialize the asynchronous DNS library.
+
+ This function initializes support for non-blocking name resolution by
+ calling evdns_resolv_conf_parse() on UNIX and
+ evdns_config_windows_nameservers() on Windows.
+
+ @param event_base the event base to associate the dns client with
+ @param flags any of EVDNS_BASE_INITIALIZE_NAMESERVERS|
+ EVDNS_BASE_DISABLE_WHEN_INACTIVE
+ @return evdns_base object if successful, or NULL if an error occurred.
+ @see evdns_base_free()
+ */
+EVENT2_EXPORT_SYMBOL
+struct evdns_base * evdns_base_new(struct event_base *event_base, int initialize_nameservers);
+
+
+/**
+ Shut down the asynchronous DNS resolver and terminate all active requests.
+
+ If the 'fail_requests' option is enabled, all active requests will return
+ an empty result with the error flag set to DNS_ERR_SHUTDOWN. Otherwise,
+ the requests will be silently discarded.
+
+ @param evdns_base the evdns base to free
+ @param fail_requests if zero, active requests will be aborted; if non-zero,
+ active requests will return DNS_ERR_SHUTDOWN.
+ @see evdns_base_new()
+ */
+EVENT2_EXPORT_SYMBOL
+void evdns_base_free(struct evdns_base *base, int fail_requests);
+
+/**
+ Remove all hosts entries that have been loaded into the event_base via
+ evdns_base_load_hosts or via event_base_resolv_conf_parse.
+
+ @param evdns_base the evdns base to remove outdated host addresses from
+ */
+EVENT2_EXPORT_SYMBOL
+void evdns_base_clear_host_addresses(struct evdns_base *base);
+
+/**
+ Convert a DNS error code to a string.
+
+ @param err the DNS error code
+ @return a string containing an explanation of the error code
+*/
+EVENT2_EXPORT_SYMBOL
+const char *evdns_err_to_string(int err);
+
+
+/**
+ Add a nameserver.
+
+ The address should be an IPv4 address in network byte order.
+ The type of address is chosen so that it matches in_addr.s_addr.
+
+ @param base the evdns_base to which to add the name server
+ @param address an IP address in network byte order
+ @return 0 if successful, or -1 if an error occurred
+ @see evdns_base_nameserver_ip_add()
+ */
+EVENT2_EXPORT_SYMBOL
+int evdns_base_nameserver_add(struct evdns_base *base,
+ unsigned long int address);
+
+/**
+ Get the number of configured nameservers.
+
+ This returns the number of configured nameservers (not necessarily the
+ number of running nameservers). This is useful for double-checking
+ whether our calls to the various nameserver configuration functions
+ have been successful.
+
+ @param base the evdns_base to which to apply this operation
+ @return the number of configured nameservers
+ @see evdns_base_nameserver_add()
+ */
+EVENT2_EXPORT_SYMBOL
+int evdns_base_count_nameservers(struct evdns_base *base);
+
+/**
+ Remove all configured nameservers, and suspend all pending resolves.
+
+ Resolves will not necessarily be re-attempted until evdns_base_resume() is called.
+
+ @param base the evdns_base to which to apply this operation
+ @return 0 if successful, or -1 if an error occurred
+ @see evdns_base_resume()
+ */
+EVENT2_EXPORT_SYMBOL
+int evdns_base_clear_nameservers_and_suspend(struct evdns_base *base);
+
+
+/**
+ Resume normal operation and continue any suspended resolve requests.
+
+ Re-attempt resolves left in limbo after an earlier call to
+ evdns_base_clear_nameservers_and_suspend().
+
+ @param base the evdns_base to which to apply this operation
+ @return 0 if successful, or -1 if an error occurred
+ @see evdns_base_clear_nameservers_and_suspend()
+ */
+EVENT2_EXPORT_SYMBOL
+int evdns_base_resume(struct evdns_base *base);
+
+/**
+ Add a nameserver by string address.
+
+ This function parses a n IPv4 or IPv6 address from a string and adds it as a
+ nameserver. It supports the following formats:
+ - [IPv6Address]:port
+ - [IPv6Address]
+ - IPv6Address
+ - IPv4Address:port
+ - IPv4Address
+
+ If no port is specified, it defaults to 53.
+
+ @param base the evdns_base to which to apply this operation
+ @return 0 if successful, or -1 if an error occurred
+ @see evdns_base_nameserver_add()
+ */
+EVENT2_EXPORT_SYMBOL
+int evdns_base_nameserver_ip_add(struct evdns_base *base,
+ const char *ip_as_string);
+
+/**
+ Add a nameserver by sockaddr.
+ **/
+EVENT2_EXPORT_SYMBOL
+int
+evdns_base_nameserver_sockaddr_add(struct evdns_base *base,
+ const struct sockaddr *sa, ev_socklen_t len, unsigned flags);
+
+struct evdns_request;
+
+/**
+ Lookup an A record for a given name.
+
+ @param base the evdns_base to which to apply this operation
+ @param name a DNS hostname
+ @param flags either 0, or DNS_QUERY_NO_SEARCH to disable searching for this query.
+ @param callback a callback function to invoke when the request is completed
+ @param ptr an argument to pass to the callback function
+ @return an evdns_request object if successful, or NULL if an error occurred.
+ @see evdns_resolve_ipv6(), evdns_resolve_reverse(), evdns_resolve_reverse_ipv6(), evdns_cancel_request()
+ */
+EVENT2_EXPORT_SYMBOL
+struct evdns_request *evdns_base_resolve_ipv4(struct evdns_base *base, const char *name, int flags, evdns_callback_type callback, void *ptr);
+
+/**
+ Lookup an AAAA record for a given name.
+
+ @param base the evdns_base to which to apply this operation
+ @param name a DNS hostname
+ @param flags either 0, or DNS_QUERY_NO_SEARCH to disable searching for this query.
+ @param callback a callback function to invoke when the request is completed
+ @param ptr an argument to pass to the callback function
+ @return an evdns_request object if successful, or NULL if an error occurred.
+ @see evdns_resolve_ipv4(), evdns_resolve_reverse(), evdns_resolve_reverse_ipv6(), evdns_cancel_request()
+ */
+EVENT2_EXPORT_SYMBOL
+struct evdns_request *evdns_base_resolve_ipv6(struct evdns_base *base, const char *name, int flags, evdns_callback_type callback, void *ptr);
+
+struct in_addr;
+struct in6_addr;
+
+/**
+ Lookup a PTR record for a given IP address.
+
+ @param base the evdns_base to which to apply this operation
+ @param in an IPv4 address
+ @param flags either 0, or DNS_QUERY_NO_SEARCH to disable searching for this query.
+ @param callback a callback function to invoke when the request is completed
+ @param ptr an argument to pass to the callback function
+ @return an evdns_request object if successful, or NULL if an error occurred.
+ @see evdns_resolve_reverse_ipv6(), evdns_cancel_request()
+ */
+EVENT2_EXPORT_SYMBOL
+struct evdns_request *evdns_base_resolve_reverse(struct evdns_base *base, const struct in_addr *in, int flags, evdns_callback_type callback, void *ptr);
+
+
+/**
+ Lookup a PTR record for a given IPv6 address.
+
+ @param base the evdns_base to which to apply this operation
+ @param in an IPv6 address
+ @param flags either 0, or DNS_QUERY_NO_SEARCH to disable searching for this query.
+ @param callback a callback function to invoke when the request is completed
+ @param ptr an argument to pass to the callback function
+ @return an evdns_request object if successful, or NULL if an error occurred.
+ @see evdns_resolve_reverse_ipv6(), evdns_cancel_request()
+ */
+EVENT2_EXPORT_SYMBOL
+struct evdns_request *evdns_base_resolve_reverse_ipv6(struct evdns_base *base, const struct in6_addr *in, int flags, evdns_callback_type callback, void *ptr);
+
+/**
+ Cancels a pending DNS resolution request.
+
+ @param base the evdns_base that was used to make the request
+ @param req the evdns_request that was returned by calling a resolve function
+ @see evdns_base_resolve_ipv4(), evdns_base_resolve_ipv6, evdns_base_resolve_reverse
+*/
+EVENT2_EXPORT_SYMBOL
+void evdns_cancel_request(struct evdns_base *base, struct evdns_request *req);
+
+/**
+ Set the value of a configuration option.
+
+ The currently available configuration options are:
+
+ ndots, timeout, max-timeouts, max-inflight, attempts, randomize-case,
+ bind-to, initial-probe-timeout, getaddrinfo-allow-skew.
+
+ In versions before Libevent 2.0.3-alpha, the option name needed to end with
+ a colon.
+
+ @param base the evdns_base to which to apply this operation
+ @param option the name of the configuration option to be modified
+ @param val the value to be set
+ @return 0 if successful, or -1 if an error occurred
+ */
+EVENT2_EXPORT_SYMBOL
+int evdns_base_set_option(struct evdns_base *base, const char *option, const char *val);
+
+
+/**
+ Parse a resolv.conf file.
+
+ The 'flags' parameter determines what information is parsed from the
+ resolv.conf file. See the man page for resolv.conf for the format of this
+ file.
+
+ The following directives are not parsed from the file: sortlist, rotate,
+ no-check-names, inet6, debug.
+
+ If this function encounters an error, the possible return values are: 1 =
+ failed to open file, 2 = failed to stat file, 3 = file too large, 4 = out of
+ memory, 5 = short read from file, 6 = no nameservers listed in the file
+
+ @param base the evdns_base to which to apply this operation
+ @param flags any of DNS_OPTION_NAMESERVERS|DNS_OPTION_SEARCH|DNS_OPTION_MISC|
+ DNS_OPTION_HOSTSFILE|DNS_OPTIONS_ALL
+ @param filename the path to the resolv.conf file
+ @return 0 if successful, or various positive error codes if an error
+ occurred (see above)
+ @see resolv.conf(3), evdns_config_windows_nameservers()
+ */
+EVENT2_EXPORT_SYMBOL
+int evdns_base_resolv_conf_parse(struct evdns_base *base, int flags, const char *const filename);
+
+/**
+ Load an /etc/hosts-style file from 'hosts_fname' into 'base'.
+
+ If hosts_fname is NULL, add minimal entries for localhost, and nothing
+ else.
+
+ Note that only evdns_getaddrinfo uses the /etc/hosts entries.
+
+ This function does not replace previously loaded hosts entries; to do that,
+ call evdns_base_clear_host_addresses first.
+
+ Return 0 on success, negative on failure.
+*/
+EVENT2_EXPORT_SYMBOL
+int evdns_base_load_hosts(struct evdns_base *base, const char *hosts_fname);
+
+/**
+ Obtain nameserver information using the Windows API.
+
+ Attempt to configure a set of nameservers based on platform settings on
+ a win32 host. Preferentially tries to use GetNetworkParams; if that fails,
+ looks in the registry.
+
+ @return 0 if successful, or -1 if an error occurred
+ @see evdns_resolv_conf_parse()
+ */
+#ifdef _WIN32
+EVENT2_EXPORT_SYMBOL
+int evdns_base_config_windows_nameservers(struct evdns_base *);
+#define EVDNS_BASE_CONFIG_WINDOWS_NAMESERVERS_IMPLEMENTED
+#endif
+
+
+/**
+ Clear the list of search domains.
+ */
+EVENT2_EXPORT_SYMBOL
+void evdns_base_search_clear(struct evdns_base *base);
+
+
+/**
+ Add a domain to the list of search domains
+
+ @param domain the domain to be added to the search list
+ */
+EVENT2_EXPORT_SYMBOL
+void evdns_base_search_add(struct evdns_base *base, const char *domain);
+
+
+/**
+ Set the 'ndots' parameter for searches.
+
+ Sets the number of dots which, when found in a name, causes
+ the first query to be without any search domain.
+
+ @param ndots the new ndots parameter
+ */
+EVENT2_EXPORT_SYMBOL
+void evdns_base_search_ndots_set(struct evdns_base *base, const int ndots);
+
+/**
+ A callback that is invoked when a log message is generated
+
+ @param is_warning indicates if the log message is a 'warning'
+ @param msg the content of the log message
+ */
+typedef void (*evdns_debug_log_fn_type)(int is_warning, const char *msg);
+
+
+/**
+ Set the callback function to handle DNS log messages. If this
+ callback is not set, evdns log messages are handled with the regular
+ Libevent logging system.
+
+ @param fn the callback to be invoked when a log message is generated
+ */
+EVENT2_EXPORT_SYMBOL
+void evdns_set_log_fn(evdns_debug_log_fn_type fn);
+
+/**
+ Set a callback that will be invoked to generate transaction IDs. By
+ default, we pick transaction IDs based on the current clock time, which
+ is bad for security.
+
+ @param fn the new callback, or NULL to use the default.
+
+ NOTE: This function has no effect in Libevent 2.0.4-alpha and later,
+ since Libevent now provides its own secure RNG.
+ */
+EVENT2_EXPORT_SYMBOL
+void evdns_set_transaction_id_fn(ev_uint16_t (*fn)(void));
+
+/**
+ Set a callback used to generate random bytes. By default, we use
+ the same function as passed to evdns_set_transaction_id_fn to generate
+ bytes two at a time. If a function is provided here, it's also used
+ to generate transaction IDs.
+
+ NOTE: This function has no effect in Libevent 2.0.4-alpha and later,
+ since Libevent now provides its own secure RNG.
+*/
+EVENT2_EXPORT_SYMBOL
+void evdns_set_random_bytes_fn(void (*fn)(char *, size_t));
+
+/*
+ * Functions used to implement a DNS server.
+ */
+
+struct evdns_server_request;
+struct evdns_server_question;
+
+/**
+ A callback to implement a DNS server. The callback function receives a DNS
+ request. It should then optionally add a number of answers to the reply
+ using the evdns_server_request_add_*_reply functions, before calling either
+ evdns_server_request_respond to send the reply back, or
+ evdns_server_request_drop to decline to answer the request.
+
+ @param req A newly received request
+ @param user_data A pointer that was passed to
+ evdns_add_server_port_with_base().
+ */
+typedef void (*evdns_request_callback_fn_type)(struct evdns_server_request *, void *);
+#define EVDNS_ANSWER_SECTION 0
+#define EVDNS_AUTHORITY_SECTION 1
+#define EVDNS_ADDITIONAL_SECTION 2
+
+#define EVDNS_TYPE_A 1
+#define EVDNS_TYPE_NS 2
+#define EVDNS_TYPE_CNAME 5
+#define EVDNS_TYPE_SOA 6
+#define EVDNS_TYPE_PTR 12
+#define EVDNS_TYPE_MX 15
+#define EVDNS_TYPE_TXT 16
+#define EVDNS_TYPE_AAAA 28
+
+#define EVDNS_QTYPE_AXFR 252
+#define EVDNS_QTYPE_ALL 255
+
+#define EVDNS_CLASS_INET 1
+
+/* flags that can be set in answers; as part of the err parameter */
+#define EVDNS_FLAGS_AA 0x400
+#define EVDNS_FLAGS_RD 0x080
+
+/** Create a new DNS server port.
+
+ @param base The event base to handle events for the server port.
+ @param socket A UDP socket to accept DNS requests.
+ @param flags Always 0 for now.
+ @param callback A function to invoke whenever we get a DNS request
+ on the socket.
+ @param user_data Data to pass to the callback.
+ @return an evdns_server_port structure for this server port.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evdns_server_port *evdns_add_server_port_with_base(struct event_base *base, evutil_socket_t socket, int flags, evdns_request_callback_fn_type callback, void *user_data);
+/** Close down a DNS server port, and free associated structures. */
+EVENT2_EXPORT_SYMBOL
+void evdns_close_server_port(struct evdns_server_port *port);
+
+/** Sets some flags in a reply we're building.
+ Allows setting of the AA or RD flags
+ */
+EVENT2_EXPORT_SYMBOL
+void evdns_server_request_set_flags(struct evdns_server_request *req, int flags);
+
+/* Functions to add an answer to an in-progress DNS reply.
+ */
+EVENT2_EXPORT_SYMBOL
+int evdns_server_request_add_reply(struct evdns_server_request *req, int section, const char *name, int type, int dns_class, int ttl, int datalen, int is_name, const char *data);
+EVENT2_EXPORT_SYMBOL
+int evdns_server_request_add_a_reply(struct evdns_server_request *req, const char *name, int n, const void *addrs, int ttl);
+EVENT2_EXPORT_SYMBOL
+int evdns_server_request_add_aaaa_reply(struct evdns_server_request *req, const char *name, int n, const void *addrs, int ttl);
+EVENT2_EXPORT_SYMBOL
+int evdns_server_request_add_ptr_reply(struct evdns_server_request *req, struct in_addr *in, const char *inaddr_name, const char *hostname, int ttl);
+EVENT2_EXPORT_SYMBOL
+int evdns_server_request_add_cname_reply(struct evdns_server_request *req, const char *name, const char *cname, int ttl);
+
+/**
+ Send back a response to a DNS request, and free the request structure.
+*/
+EVENT2_EXPORT_SYMBOL
+int evdns_server_request_respond(struct evdns_server_request *req, int err);
+/**
+ Free a DNS request without sending back a reply.
+*/
+EVENT2_EXPORT_SYMBOL
+int evdns_server_request_drop(struct evdns_server_request *req);
+struct sockaddr;
+/**
+ Get the address that made a DNS request.
+ */
+EVENT2_EXPORT_SYMBOL
+int evdns_server_request_get_requesting_addr(struct evdns_server_request *req, struct sockaddr *sa, int addr_len);
+
+/** Callback for evdns_getaddrinfo. */
+typedef void (*evdns_getaddrinfo_cb)(int result, struct evutil_addrinfo *res, void *arg);
+
+struct evdns_base;
+struct evdns_getaddrinfo_request;
+/** Make a non-blocking getaddrinfo request using the dns_base in 'dns_base'.
+ *
+ * If we can answer the request immediately (with an error or not!), then we
+ * invoke cb immediately and return NULL. Otherwise we return
+ * an evdns_getaddrinfo_request and invoke cb later.
+ *
+ * When the callback is invoked, we pass as its first argument the error code
+ * that getaddrinfo would return (or 0 for no error). As its second argument,
+ * we pass the evutil_addrinfo structures we found (or NULL on error). We
+ * pass 'arg' as the third argument.
+ *
+ * Limitations:
+ *
+ * - The AI_V4MAPPED and AI_ALL flags are not currently implemented.
+ * - For ai_socktype, we only handle SOCKTYPE_STREAM, SOCKTYPE_UDP, and 0.
+ * - For ai_protocol, we only handle IPPROTO_TCP, IPPROTO_UDP, and 0.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evdns_getaddrinfo_request *evdns_getaddrinfo(
+ struct evdns_base *dns_base,
+ const char *nodename, const char *servname,
+ const struct evutil_addrinfo *hints_in,
+ evdns_getaddrinfo_cb cb, void *arg);
+
+/* Cancel an in-progress evdns_getaddrinfo. This MUST NOT be called after the
+ * getaddrinfo's callback has been invoked. The resolves will be canceled,
+ * and the callback will be invoked with the error EVUTIL_EAI_CANCEL. */
+EVENT2_EXPORT_SYMBOL
+void evdns_getaddrinfo_cancel(struct evdns_getaddrinfo_request *req);
+
+/**
+ Retrieve the address of the 'idx'th configured nameserver.
+
+ @param base The evdns_base to examine.
+ @param idx The index of the nameserver to get the address of.
+ @param sa A location to receive the server's address.
+ @param len The number of bytes available at sa.
+
+ @return the number of bytes written into sa on success. On failure, returns
+ -1 if idx is greater than the number of configured nameservers, or a
+ value greater than 'len' if len was not high enough.
+ */
+EVENT2_EXPORT_SYMBOL
+int evdns_base_get_nameserver_addr(struct evdns_base *base, int idx,
+ struct sockaddr *sa, ev_socklen_t len);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !EVENT2_DNS_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/include/event2/dns_compat.h b/protocols/Telegram/tgl/libevent/include/event2/dns_compat.h
new file mode 100644
index 0000000000..965fd65445
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/event2/dns_compat.h
@@ -0,0 +1,336 @@
+/*
+ * Copyright (c) 2006-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVENT2_DNS_COMPAT_H_INCLUDED_
+#define EVENT2_DNS_COMPAT_H_INCLUDED_
+
+/** @file event2/dns_compat.h
+
+ Potentially non-threadsafe versions of the functions in dns.h: provided
+ only for backwards compatibility.
+
+
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event-config.h>
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+/* For int types. */
+#include <event2/util.h>
+
+/**
+ Initialize the asynchronous DNS library.
+
+ This function initializes support for non-blocking name resolution by
+ calling evdns_resolv_conf_parse() on UNIX and
+ evdns_config_windows_nameservers() on Windows.
+
+ @deprecated This function is deprecated because it always uses the current
+ event base, and is easily confused by multiple calls to event_init(), and
+ so is not safe for multithreaded use. Additionally, it allocates a global
+ structure that only one thread can use. The replacement is
+ evdns_base_new().
+
+ @return 0 if successful, or -1 if an error occurred
+ @see evdns_shutdown()
+ */
+int evdns_init(void);
+
+struct evdns_base;
+/**
+ Return the global evdns_base created by event_init() and used by the other
+ deprecated functions.
+
+ @deprecated This function is deprecated because use of the global
+ evdns_base is error-prone.
+ */
+struct evdns_base *evdns_get_global_base(void);
+
+/**
+ Shut down the asynchronous DNS resolver and terminate all active requests.
+
+ If the 'fail_requests' option is enabled, all active requests will return
+ an empty result with the error flag set to DNS_ERR_SHUTDOWN. Otherwise,
+ the requests will be silently discarded.
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which evdns_base it applies to. The recommended
+ function is evdns_base_shutdown().
+
+ @param fail_requests if zero, active requests will be aborted; if non-zero,
+ active requests will return DNS_ERR_SHUTDOWN.
+ @see evdns_init()
+ */
+void evdns_shutdown(int fail_requests);
+
+/**
+ Add a nameserver.
+
+ The address should be an IPv4 address in network byte order.
+ The type of address is chosen so that it matches in_addr.s_addr.
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which evdns_base it applies to. The recommended
+ function is evdns_base_nameserver_add().
+
+ @param address an IP address in network byte order
+ @return 0 if successful, or -1 if an error occurred
+ @see evdns_nameserver_ip_add()
+ */
+int evdns_nameserver_add(unsigned long int address);
+
+/**
+ Get the number of configured nameservers.
+
+ This returns the number of configured nameservers (not necessarily the
+ number of running nameservers). This is useful for double-checking
+ whether our calls to the various nameserver configuration functions
+ have been successful.
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which evdns_base it applies to. The recommended
+ function is evdns_base_count_nameservers().
+
+ @return the number of configured nameservers
+ @see evdns_nameserver_add()
+ */
+int evdns_count_nameservers(void);
+
+/**
+ Remove all configured nameservers, and suspend all pending resolves.
+
+ Resolves will not necessarily be re-attempted until evdns_resume() is called.
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which evdns_base it applies to. The recommended
+ function is evdns_base_clear_nameservers_and_suspend().
+
+ @return 0 if successful, or -1 if an error occurred
+ @see evdns_resume()
+ */
+int evdns_clear_nameservers_and_suspend(void);
+
+/**
+ Resume normal operation and continue any suspended resolve requests.
+
+ Re-attempt resolves left in limbo after an earlier call to
+ evdns_clear_nameservers_and_suspend().
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which evdns_base it applies to. The recommended
+ function is evdns_base_resume().
+
+ @return 0 if successful, or -1 if an error occurred
+ @see evdns_clear_nameservers_and_suspend()
+ */
+int evdns_resume(void);
+
+/**
+ Add a nameserver.
+
+ This wraps the evdns_nameserver_add() function by parsing a string as an IP
+ address and adds it as a nameserver.
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which evdns_base it applies to. The recommended
+ function is evdns_base_nameserver_ip_add().
+
+ @return 0 if successful, or -1 if an error occurred
+ @see evdns_nameserver_add()
+ */
+int evdns_nameserver_ip_add(const char *ip_as_string);
+
+/**
+ Lookup an A record for a given name.
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which evdns_base it applies to. The recommended
+ function is evdns_base_resolve_ipv4().
+
+ @param name a DNS hostname
+ @param flags either 0, or DNS_QUERY_NO_SEARCH to disable searching for this query.
+ @param callback a callback function to invoke when the request is completed
+ @param ptr an argument to pass to the callback function
+ @return 0 if successful, or -1 if an error occurred
+ @see evdns_resolve_ipv6(), evdns_resolve_reverse(), evdns_resolve_reverse_ipv6()
+ */
+int evdns_resolve_ipv4(const char *name, int flags, evdns_callback_type callback, void *ptr);
+
+/**
+ Lookup an AAAA record for a given name.
+
+ @param name a DNS hostname
+ @param flags either 0, or DNS_QUERY_NO_SEARCH to disable searching for this query.
+ @param callback a callback function to invoke when the request is completed
+ @param ptr an argument to pass to the callback function
+ @return 0 if successful, or -1 if an error occurred
+ @see evdns_resolve_ipv4(), evdns_resolve_reverse(), evdns_resolve_reverse_ipv6()
+ */
+int evdns_resolve_ipv6(const char *name, int flags, evdns_callback_type callback, void *ptr);
+
+struct in_addr;
+struct in6_addr;
+
+/**
+ Lookup a PTR record for a given IP address.
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which evdns_base it applies to. The recommended
+ function is evdns_base_resolve_reverse().
+
+ @param in an IPv4 address
+ @param flags either 0, or DNS_QUERY_NO_SEARCH to disable searching for this query.
+ @param callback a callback function to invoke when the request is completed
+ @param ptr an argument to pass to the callback function
+ @return 0 if successful, or -1 if an error occurred
+ @see evdns_resolve_reverse_ipv6()
+ */
+int evdns_resolve_reverse(const struct in_addr *in, int flags, evdns_callback_type callback, void *ptr);
+
+/**
+ Lookup a PTR record for a given IPv6 address.
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which evdns_base it applies to. The recommended
+ function is evdns_base_resolve_reverse_ipv6().
+
+ @param in an IPv6 address
+ @param flags either 0, or DNS_QUERY_NO_SEARCH to disable searching for this query.
+ @param callback a callback function to invoke when the request is completed
+ @param ptr an argument to pass to the callback function
+ @return 0 if successful, or -1 if an error occurred
+ @see evdns_resolve_reverse_ipv6()
+ */
+int evdns_resolve_reverse_ipv6(const struct in6_addr *in, int flags, evdns_callback_type callback, void *ptr);
+
+/**
+ Set the value of a configuration option.
+
+ The currently available configuration options are:
+
+ ndots, timeout, max-timeouts, max-inflight, and attempts
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which evdns_base it applies to. The recommended
+ function is evdns_base_set_option().
+
+ @param option the name of the configuration option to be modified
+ @param val the value to be set
+ @param flags Ignored.
+ @return 0 if successful, or -1 if an error occurred
+ */
+int evdns_set_option(const char *option, const char *val, int flags);
+
+/**
+ Parse a resolv.conf file.
+
+ The 'flags' parameter determines what information is parsed from the
+ resolv.conf file. See the man page for resolv.conf for the format of this
+ file.
+
+ The following directives are not parsed from the file: sortlist, rotate,
+ no-check-names, inet6, debug.
+
+ If this function encounters an error, the possible return values are: 1 =
+ failed to open file, 2 = failed to stat file, 3 = file too large, 4 = out of
+ memory, 5 = short read from file, 6 = no nameservers listed in the file
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which evdns_base it applies to. The recommended
+ function is evdns_base_resolv_conf_parse().
+
+ @param flags any of DNS_OPTION_NAMESERVERS|DNS_OPTION_SEARCH|DNS_OPTION_MISC|
+ DNS_OPTIONS_ALL
+ @param filename the path to the resolv.conf file
+ @return 0 if successful, or various positive error codes if an error
+ occurred (see above)
+ @see resolv.conf(3), evdns_config_windows_nameservers()
+ */
+int evdns_resolv_conf_parse(int flags, const char *const filename);
+
+/**
+ Clear the list of search domains.
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which evdns_base it applies to. The recommended
+ function is evdns_base_search_clear().
+ */
+void evdns_search_clear(void);
+
+/**
+ Add a domain to the list of search domains
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which evdns_base it applies to. The recommended
+ function is evdns_base_search_add().
+
+ @param domain the domain to be added to the search list
+ */
+void evdns_search_add(const char *domain);
+
+/**
+ Set the 'ndots' parameter for searches.
+
+ Sets the number of dots which, when found in a name, causes
+ the first query to be without any search domain.
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which evdns_base it applies to. The recommended
+ function is evdns_base_search_ndots_set().
+
+ @param ndots the new ndots parameter
+ */
+void evdns_search_ndots_set(const int ndots);
+
+/**
+ As evdns_server_new_with_base.
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which even_base it uses. The recommended
+ function is evdns_add_server_port_with_base().
+
+*/
+struct evdns_server_port *evdns_add_server_port(evutil_socket_t socket, int flags, evdns_request_callback_fn_type callback, void *user_data);
+
+#ifdef _WIN32
+int evdns_config_windows_nameservers(void);
+#define EVDNS_CONFIG_WINDOWS_NAMESERVERS_IMPLEMENTED
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_EVENT_COMPAT_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/include/event2/dns_struct.h b/protocols/Telegram/tgl/libevent/include/event2/dns_struct.h
new file mode 100644
index 0000000000..593a8a70b6
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/event2/dns_struct.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVENT2_DNS_STRUCT_H_INCLUDED_
+#define EVENT2_DNS_STRUCT_H_INCLUDED_
+
+/** @file event2/dns_struct.h
+
+ Data structures for dns. Using these structures may hurt forward
+ compatibility with later versions of Libevent: be careful!
+
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event-config.h>
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+/* For int types. */
+#include <event2/util.h>
+
+/*
+ * Structures used to implement a DNS server.
+ */
+
+struct evdns_server_request {
+ int flags;
+ int nquestions;
+ struct evdns_server_question **questions;
+};
+struct evdns_server_question {
+ int type;
+#ifdef __cplusplus
+ int dns_question_class;
+#else
+ /* You should refer to this field as "dns_question_class". The
+ * name "class" works in C for backward compatibility, and will be
+ * removed in a future version. (1.5 or later). */
+ int class;
+#define dns_question_class class
+#endif
+ char name[1];
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_DNS_STRUCT_H_INCLUDED_ */
+
diff --git a/protocols/Telegram/tgl/libevent/include/event2/event.h b/protocols/Telegram/tgl/libevent/include/event2/event.h
new file mode 100644
index 0000000000..6e0a4f04c7
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/event2/event.h
@@ -0,0 +1,1675 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVENT2_EVENT_H_INCLUDED_
+#define EVENT2_EVENT_H_INCLUDED_
+
+/**
+ @mainpage
+
+ @section intro Introduction
+
+ Libevent is an event notification library for developing scalable network
+ servers. The Libevent API provides a mechanism to execute a callback
+ function when a specific event occurs on a file descriptor or after a
+ timeout has been reached. Furthermore, Libevent also support callbacks due
+ to signals or regular timeouts.
+
+ Libevent is meant to replace the event loop found in event driven network
+ servers. An application just needs to call event_base_dispatch() and then add or
+ remove events dynamically without having to change the event loop.
+
+
+ Currently, Libevent supports /dev/poll, kqueue(2), select(2), poll(2),
+ epoll(4), and evports. The internal event mechanism is completely
+ independent of the exposed event API, and a simple update of Libevent can
+ provide new functionality without having to redesign the applications. As a
+ result, Libevent allows for portable application development and provides
+ the most scalable event notification mechanism available on an operating
+ system. Libevent can also be used for multithreaded programs. Libevent
+ should compile on Linux, *BSD, Mac OS X, Solaris and, Windows.
+
+ @section usage Standard usage
+
+ Every program that uses Libevent must include the <event2/event.h>
+ header, and pass the -levent flag to the linker. (You can instead link
+ -levent_core if you only want the main event and buffered IO-based code,
+ and don't want to link any protocol code.)
+
+ @section setup Library setup
+
+ Before you call any other Libevent functions, you need to set up the
+ library. If you're going to use Libevent from multiple threads in a
+ multithreaded application, you need to initialize thread support --
+ typically by using evthread_use_pthreads() or
+ evthread_use_windows_threads(). See <event2/thread.h> for more
+ information.
+
+ This is also the point where you can replace Libevent's memory
+ management functions with event_set_mem_functions, and enable debug mode
+ with event_enable_debug_mode().
+
+ @section base Creating an event base
+
+ Next, you need to create an event_base structure, using event_base_new()
+ or event_base_new_with_config(). The event_base is responsible for
+ keeping track of which events are "pending" (that is to say, being
+ watched to see if they become active) and which events are "active".
+ Every event is associated with a single event_base.
+
+ @section event Event notification
+
+ For each file descriptor that you wish to monitor, you must create an
+ event structure with event_new(). (You may also declare an event
+ structure and call event_assign() to initialize the members of the
+ structure.) To enable notification, you add the structure to the list
+ of monitored events by calling event_add(). The event structure must
+ remain allocated as long as it is active, so it should generally be
+ allocated on the heap.
+
+ @section loop Dispatching events.
+
+ Finally, you call event_base_dispatch() to loop and dispatch events.
+ You can also use event_base_loop() for more fine-grained control.
+
+ Currently, only one thread can be dispatching a given event_base at a
+ time. If you want to run events in multiple threads at once, you can
+ either have a single event_base whose events add work to a work queue,
+ or you can create multiple event_base objects.
+
+ @section bufferevent I/O Buffers
+
+ Libevent provides a buffered I/O abstraction on top of the regular event
+ callbacks. This abstraction is called a bufferevent. A bufferevent
+ provides input and output buffers that get filled and drained
+ automatically. The user of a buffered event no longer deals directly
+ with the I/O, but instead is reading from input and writing to output
+ buffers.
+
+ Once initialized via bufferevent_socket_new(), the bufferevent structure
+ can be used repeatedly with bufferevent_enable() and
+ bufferevent_disable(). Instead of reading and writing directly to a
+ socket, you would call bufferevent_read() and bufferevent_write().
+
+ When read enabled the bufferevent will try to read from the file descriptor
+ and call the read callback. The write callback is executed whenever the
+ output buffer is drained below the write low watermark, which is 0 by
+ default.
+
+ See <event2/bufferevent*.h> for more information.
+
+ @section timers Timers
+
+ Libevent can also be used to create timers that invoke a callback after a
+ certain amount of time has expired. The evtimer_new() macro returns
+ an event struct to use as a timer. To activate the timer, call
+ evtimer_add(). Timers can be deactivated by calling evtimer_del().
+ (These macros are thin wrappers around event_new(), event_add(),
+ and event_del(); you can also use those instead.)
+
+ @section evdns Asynchronous DNS resolution
+
+ Libevent provides an asynchronous DNS resolver that should be used instead
+ of the standard DNS resolver functions. See the <event2/dns.h>
+ functions for more detail.
+
+ @section evhttp Event-driven HTTP servers
+
+ Libevent provides a very simple event-driven HTTP server that can be
+ embedded in your program and used to service HTTP requests.
+
+ To use this capability, you need to include the <event2/http.h> header in your
+ program. See that header for more information.
+
+ @section evrpc A framework for RPC servers and clients
+
+ Libevent provides a framework for creating RPC servers and clients. It
+ takes care of marshaling and unmarshaling all data structures.
+
+ @section api API Reference
+
+ To browse the complete documentation of the libevent API, click on any of
+ the following links.
+
+ event2/event.h
+ The primary libevent header
+
+ event2/thread.h
+ Functions for use by multithreaded programs
+
+ event2/buffer.h and event2/bufferevent.h
+ Buffer management for network reading and writing
+
+ event2/util.h
+ Utility functions for portable nonblocking network code
+
+ event2/dns.h
+ Asynchronous DNS resolution
+
+ event2/http.h
+ An embedded libevent-based HTTP server
+
+ event2/rpc.h
+ A framework for creating RPC servers and clients
+
+ */
+
+/** @file event2/event.h
+
+ Core functions for waiting for and receiving events, and using event bases.
+*/
+
+#include <event2/visibility.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event-config.h>
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#include <stdio.h>
+
+/* For int types. */
+#include <event2/util.h>
+
+/**
+ * Structure to hold information and state for a Libevent dispatch loop.
+ *
+ * The event_base lies at the center of Libevent; every application will
+ * have one. It keeps track of all pending and active events, and
+ * notifies your application of the active ones.
+ *
+ * This is an opaque structure; you can allocate one using
+ * event_base_new() or event_base_new_with_config().
+ *
+ * @see event_base_new(), event_base_free(), event_base_loop(),
+ * event_base_new_with_config()
+ */
+struct event_base
+#ifdef EVENT_IN_DOXYGEN_
+{/*Empty body so that doxygen will generate documentation here.*/}
+#endif
+;
+
+/**
+ * @struct event
+ *
+ * Structure to represent a single event.
+ *
+ * An event can have some underlying condition it represents: a socket
+ * becoming readable or writeable (or both), or a signal becoming raised.
+ * (An event that represents no underlying condition is still useful: you
+ * can use one to implement a timer, or to communicate between threads.)
+ *
+ * Generally, you can create events with event_new(), then make them
+ * pending with event_add(). As your event_base runs, it will run the
+ * callbacks of an events whose conditions are triggered. When you
+ * longer want the event, free it with event_free().
+ *
+ * In more depth:
+ *
+ * An event may be "pending" (one whose condition we are watching),
+ * "active" (one whose condition has triggered and whose callback is about
+ * to run), neither, or both. Events come into existence via
+ * event_assign() or event_new(), and are then neither active nor pending.
+ *
+ * To make an event pending, pass it to event_add(). When doing so, you
+ * can also set a timeout for the event.
+ *
+ * Events become active during an event_base_loop() call when either their
+ * condition has triggered, or when their timeout has elapsed. You can
+ * also activate an event manually using event_active(). The even_base
+ * loop will run the callbacks of active events; after it has done so, it
+ * marks them as no longer active.
+ *
+ * You can make an event non-pending by passing it to event_del(). This
+ * also makes the event non-active.
+ *
+ * Events can be "persistent" or "non-persistent". A non-persistent event
+ * becomes non-pending as soon as it is triggered: thus, it only runs at
+ * most once per call to event_add(). A persistent event remains pending
+ * even when it becomes active: you'll need to event_del() it manually in
+ * order to make it non-pending. When a persistent event with a timeout
+ * becomes active, its timeout is reset: this means you can use persistent
+ * events to implement periodic timeouts.
+ *
+ * This should be treated as an opaque structure; you should never read or
+ * write any of its fields directly. For backward compatibility with old
+ * code, it is defined in the event2/event_struct.h header; including this
+ * header may make your code incompatible with other versions of Libevent.
+ *
+ * @see event_new(), event_free(), event_assign(), event_get_assignment(),
+ * event_add(), event_del(), event_active(), event_pending(),
+ * event_get_fd(), event_get_base(), event_get_events(),
+ * event_get_callback(), event_get_callback_arg(),
+ * event_priority_set()
+ */
+struct event
+#ifdef EVENT_IN_DOXYGEN_
+{/*Empty body so that doxygen will generate documentation here.*/}
+#endif
+;
+
+/**
+ * Configuration for an event_base.
+ *
+ * There are many options that can be used to alter the behavior and
+ * implementation of an event_base. To avoid having to pass them all in a
+ * complex many-argument constructor, we provide an abstract data type
+ * wrhere you set up configation information before passing it to
+ * event_base_new_with_config().
+ *
+ * @see event_config_new(), event_config_free(), event_base_new_with_config(),
+ * event_config_avoid_method(), event_config_require_features(),
+ * event_config_set_flag(), event_config_set_num_cpus_hint()
+ */
+struct event_config
+#ifdef EVENT_IN_DOXYGEN_
+{/*Empty body so that doxygen will generate documentation here.*/}
+#endif
+;
+
+/**
+ * Enable some relatively expensive debugging checks in Libevent that
+ * would normally be turned off. Generally, these checks cause code that
+ * would otherwise crash mysteriously to fail earlier with an assertion
+ * failure. Note that this method MUST be called before any events or
+ * event_bases have been created.
+ *
+ * Debug mode can currently catch the following errors:
+ * An event is re-assigned while it is added
+ * Any function is called on a non-assigned event
+ *
+ * Note that debugging mode uses memory to track every event that has been
+ * initialized (via event_assign, event_set, or event_new) but not yet
+ * released (via event_free or event_debug_unassign). If you want to use
+ * debug mode, and you find yourself running out of memory, you will need
+ * to use event_debug_unassign to explicitly stop tracking events that
+ * are no longer considered set-up.
+ *
+ * @see event_debug_unassign()
+ */
+EVENT2_EXPORT_SYMBOL
+void event_enable_debug_mode(void);
+
+/**
+ * When debugging mode is enabled, informs Libevent that an event should no
+ * longer be considered as assigned. When debugging mode is not enabled, does
+ * nothing.
+ *
+ * This function must only be called on a non-added event.
+ *
+ * @see event_enable_debug_mode()
+ */
+EVENT2_EXPORT_SYMBOL
+void event_debug_unassign(struct event *);
+
+/**
+ * Create and return a new event_base to use with the rest of Libevent.
+ *
+ * @return a new event_base on success, or NULL on failure.
+ *
+ * @see event_base_free(), event_base_new_with_config()
+ */
+EVENT2_EXPORT_SYMBOL
+struct event_base *event_base_new(void);
+
+/**
+ Reinitialize the event base after a fork
+
+ Some event mechanisms do not survive across fork. The event base needs
+ to be reinitialized with the event_reinit() function.
+
+ @param base the event base that needs to be re-initialized
+ @return 0 if successful, or -1 if some events could not be re-added.
+ @see event_base_new()
+*/
+EVENT2_EXPORT_SYMBOL
+int event_reinit(struct event_base *base);
+
+/**
+ Event dispatching loop
+
+ This loop will run the event base until either there are no more pending or
+ active, or until something calls event_base_loopbreak() or
+ event_base_loopexit().
+
+ @param base the event_base structure returned by event_base_new() or
+ event_base_new_with_config()
+ @return 0 if successful, -1 if an error occurred, or 1 if we exited because
+ no events were pending or active.
+ @see event_base_loop()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_dispatch(struct event_base *);
+
+/**
+ Get the kernel event notification mechanism used by Libevent.
+
+ @param eb the event_base structure returned by event_base_new()
+ @return a string identifying the kernel event mechanism (kqueue, epoll, etc.)
+ */
+EVENT2_EXPORT_SYMBOL
+const char *event_base_get_method(const struct event_base *);
+
+/**
+ Gets all event notification mechanisms supported by Libevent.
+
+ This functions returns the event mechanism in order preferred by
+ Libevent. Note that this list will include all backends that
+ Libevent has compiled-in support for, and will not necessarily check
+ your OS to see whether it has the required resources.
+
+ @return an array with pointers to the names of support methods.
+ The end of the array is indicated by a NULL pointer. If an
+ error is encountered NULL is returned.
+*/
+EVENT2_EXPORT_SYMBOL
+const char **event_get_supported_methods(void);
+
+/** Query the current monotonic time from a the timer for a struct
+ * event_base.
+ */
+EVENT2_EXPORT_SYMBOL
+int event_gettime_monotonic(struct event_base *base, struct timeval *tp);
+
+/**
+ @name event type flag
+
+ Flags to pass to event_base_get_num_events() to specify the kinds of events
+ we want to aggregate counts for
+*/
+/**@{*/
+/** count the number of active events, which have been triggered.*/
+#define EVENT_BASE_COUNT_ACTIVE 1U
+/** count the number of virtual events, which is used to represent an internal
+ * condition, other than a pending event, that keeps the loop from exiting. */
+#define EVENT_BASE_COUNT_VIRTUAL 2U
+/** count the number of events which have been added to event base, including
+ * internal events. */
+#define EVENT_BASE_COUNT_ADDED 4U
+/**@}*/
+
+/**
+ Gets the number of events in event_base, as specified in the flags.
+
+ Since event base has some internal events added to make some of its
+ functionalities work, EVENT_BASE_COUNT_ADDED may return more than the
+ number of events you added using event_add().
+
+ If you pass EVENT_BASE_COUNT_ACTIVE and EVENT_BASE_COUNT_ADDED together, an
+ active event will be counted twice. However, this might not be the case in
+ future libevent versions. The return value is an indication of the work
+ load, but the user shouldn't rely on the exact value as this may change in
+ the future.
+
+ @param eb the event_base structure returned by event_base_new()
+ @param flags a bitwise combination of the kinds of events to aggregate
+ counts for
+ @return the number of events specified in the flags
+*/
+EVENT2_EXPORT_SYMBOL
+int event_base_get_num_events(struct event_base *, unsigned int);
+
+/**
+ Get the maximum number of events in a given event_base as specified in the
+ flags.
+
+ @param eb the event_base structure returned by event_base_new()
+ @param flags a bitwise combination of the kinds of events to aggregate
+ counts for
+ @param clear option used to reset the maximum count.
+ @return the number of events specified in the flags
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_get_max_events(struct event_base *, unsigned int, int);
+
+/**
+ Allocates a new event configuration object.
+
+ The event configuration object can be used to change the behavior of
+ an event base.
+
+ @return an event_config object that can be used to store configuration, or
+ NULL if an error is encountered.
+ @see event_base_new_with_config(), event_config_free(), event_config
+*/
+EVENT2_EXPORT_SYMBOL
+struct event_config *event_config_new(void);
+
+/**
+ Deallocates all memory associated with an event configuration object
+
+ @param cfg the event configuration object to be freed.
+*/
+EVENT2_EXPORT_SYMBOL
+void event_config_free(struct event_config *cfg);
+
+/**
+ Enters an event method that should be avoided into the configuration.
+
+ This can be used to avoid event mechanisms that do not support certain
+ file descriptor types, or for debugging to avoid certain event
+ mechanisms. An application can make use of multiple event bases to
+ accommodate incompatible file descriptor types.
+
+ @param cfg the event configuration object
+ @param method the name of the event method to avoid
+ @return 0 on success, -1 on failure.
+*/
+EVENT2_EXPORT_SYMBOL
+int event_config_avoid_method(struct event_config *cfg, const char *method);
+
+/**
+ A flag used to describe which features an event_base (must) provide.
+
+ Because of OS limitations, not every Libevent backend supports every
+ possible feature. You can use this type with
+ event_config_require_features() to tell Libevent to only proceed if your
+ event_base implements a given feature, and you can receive this type from
+ event_base_get_features() to see which features are available.
+*/
+enum event_method_feature {
+ /** Require an event method that allows edge-triggered events with EV_ET. */
+ EV_FEATURE_ET = 0x01,
+ /** Require an event method where having one event triggered among
+ * many is [approximately] an O(1) operation. This excludes (for
+ * example) select and poll, which are approximately O(N) for N
+ * equal to the total number of possible events. */
+ EV_FEATURE_O1 = 0x02,
+ /** Require an event method that allows file descriptors as well as
+ * sockets. */
+ EV_FEATURE_FDS = 0x04,
+ /** Require an event method that allows you to use EV_CLOSED to detect
+ * connection close without the necessity of reading all the pending data.
+ *
+ * Methods that do support EV_CLOSED may not be able to provide support on
+ * all kernel versions.
+ **/
+ EV_FEATURE_EARLY_CLOSE = 0x08
+};
+
+/**
+ A flag passed to event_config_set_flag().
+
+ These flags change the behavior of an allocated event_base.
+
+ @see event_config_set_flag(), event_base_new_with_config(),
+ event_method_feature
+ */
+enum event_base_config_flag {
+ /** Do not allocate a lock for the event base, even if we have
+ locking set up.
+
+ Setting this option will make it unsafe and nonfunctional to call
+ functions on the base concurrently from multiple threads.
+ */
+ EVENT_BASE_FLAG_NOLOCK = 0x01,
+ /** Do not check the EVENT_* environment variables when configuring
+ an event_base */
+ EVENT_BASE_FLAG_IGNORE_ENV = 0x02,
+ /** Windows only: enable the IOCP dispatcher at startup
+
+ If this flag is set then bufferevent_socket_new() and
+ evconn_listener_new() will use IOCP-backed implementations
+ instead of the usual select-based one on Windows.
+ */
+ EVENT_BASE_FLAG_STARTUP_IOCP = 0x04,
+ /** Instead of checking the current time every time the event loop is
+ ready to run timeout callbacks, check after each timeout callback.
+ */
+ EVENT_BASE_FLAG_NO_CACHE_TIME = 0x08,
+
+ /** If we are using the epoll backend, this flag says that it is
+ safe to use Libevent's internal change-list code to batch up
+ adds and deletes in order to try to do as few syscalls as
+ possible. Setting this flag can make your code run faster, but
+ it may trigger a Linux bug: it is not safe to use this flag
+ if you have any fds cloned by dup() or its variants. Doing so
+ will produce strange and hard-to-diagnose bugs.
+
+ This flag can also be activated by setting the
+ EVENT_EPOLL_USE_CHANGELIST environment variable.
+
+ This flag has no effect if you wind up using a backend other than
+ epoll.
+ */
+ EVENT_BASE_FLAG_EPOLL_USE_CHANGELIST = 0x10,
+
+ /** Ordinarily, Libevent implements its time and timeout code using
+ the fastest monotonic timer that we have. If this flag is set,
+ however, we use less efficient more precise timer, assuming one is
+ present.
+ */
+ EVENT_BASE_FLAG_PRECISE_TIMER = 0x20
+};
+
+/**
+ Return a bitmask of the features implemented by an event base. This
+ will be a bitwise OR of one or more of the values of
+ event_method_feature
+
+ @see event_method_feature
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_get_features(const struct event_base *base);
+
+/**
+ Enters a required event method feature that the application demands.
+
+ Note that not every feature or combination of features is supported
+ on every platform. Code that requests features should be prepared
+ to handle the case where event_base_new_with_config() returns NULL, as in:
+ <pre>
+ event_config_require_features(cfg, EV_FEATURE_ET);
+ base = event_base_new_with_config(cfg);
+ if (base == NULL) {
+ // We can't get edge-triggered behavior here.
+ event_config_require_features(cfg, 0);
+ base = event_base_new_with_config(cfg);
+ }
+ </pre>
+
+ @param cfg the event configuration object
+ @param feature a bitfield of one or more event_method_feature values.
+ Replaces values from previous calls to this function.
+ @return 0 on success, -1 on failure.
+ @see event_method_feature, event_base_new_with_config()
+*/
+EVENT2_EXPORT_SYMBOL
+int event_config_require_features(struct event_config *cfg, int feature);
+
+/**
+ * Sets one or more flags to configure what parts of the eventual event_base
+ * will be initialized, and how they'll work.
+ *
+ * @see event_base_config_flags, event_base_new_with_config()
+ **/
+EVENT2_EXPORT_SYMBOL
+int event_config_set_flag(struct event_config *cfg, int flag);
+
+/**
+ * Records a hint for the number of CPUs in the system. This is used for
+ * tuning thread pools, etc, for optimal performance. In Libevent 2.0,
+ * it is only on Windows, and only when IOCP is in use.
+ *
+ * @param cfg the event configuration object
+ * @param cpus the number of cpus
+ * @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int event_config_set_num_cpus_hint(struct event_config *cfg, int cpus);
+
+/**
+ * Record an interval and/or a number of callbacks after which the event base
+ * should check for new events. By default, the event base will run as many
+ * events are as activated at the higest activated priority before checking
+ * for new events. If you configure it by setting max_interval, it will check
+ * the time after each callback, and not allow more than max_interval to
+ * elapse before checking for new events. If you configure it by setting
+ * max_callbacks to a value >= 0, it will run no more than max_callbacks
+ * callbacks before checking for new events.
+ *
+ * This option can decrease the latency of high-priority events, and
+ * avoid priority inversions where multiple low-priority events keep us from
+ * polling for high-priority events, but at the expense of slightly decreasing
+ * the throughput. Use it with caution!
+ *
+ * @param cfg The event_base configuration object.
+ * @param max_interval An interval after which Libevent should stop running
+ * callbacks and check for more events, or NULL if there should be
+ * no such interval.
+ * @param max_callbacks A number of callbacks after which Libevent should
+ * stop running callbacks and check for more events, or -1 if there
+ * should be no such limit.
+ * @param min_priority A priority below which max_interval and max_callbacks
+ * should not be enforced. If this is set to 0, they are enforced
+ * for events of every priority; if it's set to 1, they're enforced
+ * for events of priority 1 and above, and so on.
+ * @return 0 on success, -1 on failure.
+ **/
+EVENT2_EXPORT_SYMBOL
+int event_config_set_max_dispatch_interval(struct event_config *cfg,
+ const struct timeval *max_interval, int max_callbacks,
+ int min_priority);
+
+/**
+ Initialize the event API.
+
+ Use event_base_new_with_config() to initialize a new event base, taking
+ the specified configuration under consideration. The configuration object
+ can currently be used to avoid certain event notification mechanisms.
+
+ @param cfg the event configuration object
+ @return an initialized event_base that can be used to registering events,
+ or NULL if no event base can be created with the requested event_config.
+ @see event_base_new(), event_base_free(), event_init(), event_assign()
+*/
+EVENT2_EXPORT_SYMBOL
+struct event_base *event_base_new_with_config(const struct event_config *);
+
+/**
+ Deallocate all memory associated with an event_base, and free the base.
+
+ Note that this function will not close any fds or free any memory passed
+ to event_new as the argument to callback.
+
+ If there are any pending finalizer callbacks, this function will invoke
+ them.
+
+ @param eb an event_base to be freed
+ */
+EVENT2_EXPORT_SYMBOL
+void event_base_free(struct event_base *);
+
+/**
+ As event_free, but do not run finalizers.
+
+ THIS IS AN EXPERIMENTAL API. IT MIGHT CHANGE BEFORE THE LIBEVENT 2.1 SERIES
+ BECOMES STABLE.
+ */
+EVENT2_EXPORT_SYMBOL
+void event_base_free_nofinalize(struct event_base *);
+
+/** @name Log severities
+ */
+/**@{*/
+#define EVENT_LOG_DEBUG 0
+#define EVENT_LOG_MSG 1
+#define EVENT_LOG_WARN 2
+#define EVENT_LOG_ERR 3
+/**@}*/
+
+/* Obsolete names: these are deprecated, but older programs might use them.
+ * They violate the reserved-identifier namespace. */
+#define _EVENT_LOG_DEBUG EVENT_LOG_DEBUG
+#define _EVENT_LOG_MSG EVENT_LOG_MSG
+#define _EVENT_LOG_WARN EVENT_LOG_WARN
+#define _EVENT_LOG_ERR EVENT_LOG_ERR
+
+/**
+ A callback function used to intercept Libevent's log messages.
+
+ @see event_set_log_callback
+ */
+typedef void (*event_log_cb)(int severity, const char *msg);
+/**
+ Redirect Libevent's log messages.
+
+ @param cb a function taking two arguments: an integer severity between
+ EVENT_LOG_DEBUG and EVENT_LOG_ERR, and a string. If cb is NULL,
+ then the default log is used.
+
+ NOTE: The function you provide *must not* call any other libevent
+ functionality. Doing so can produce undefined behavior.
+ */
+EVENT2_EXPORT_SYMBOL
+void event_set_log_callback(event_log_cb cb);
+
+/**
+ A function to be called if Libevent encounters a fatal internal error.
+
+ @see event_set_fatal_callback
+ */
+typedef void (*event_fatal_cb)(int err);
+
+/**
+ Override Libevent's behavior in the event of a fatal internal error.
+
+ By default, Libevent will call exit(1) if a programming error makes it
+ impossible to continue correct operation. This function allows you to supply
+ another callback instead. Note that if the function is ever invoked,
+ something is wrong with your program, or with Libevent: any subsequent calls
+ to Libevent may result in undefined behavior.
+
+ Libevent will (almost) always log an EVENT_LOG_ERR message before calling
+ this function; look at the last log message to see why Libevent has died.
+ */
+EVENT2_EXPORT_SYMBOL
+void event_set_fatal_callback(event_fatal_cb cb);
+
+#define EVENT_DBG_ALL 0xffffffffu
+#define EVENT_DBG_NONE 0
+
+/**
+ Turn on debugging logs and have them sent to the default log handler.
+
+ This is a global setting; if you are going to call it, you must call this
+ before any calls that create an event-base. You must call it before any
+ multithreaded use of Libevent.
+
+ Debug logs are verbose.
+
+ @param which Controls which debug messages are turned on. This option is
+ unused for now; for forward compatibility, you must pass in the constant
+ "EVENT_DBG_ALL" to turn debugging logs on, or "EVENT_DBG_NONE" to turn
+ debugging logs off.
+ */
+EVENT2_EXPORT_SYMBOL
+void event_enable_debug_logging(ev_uint32_t which);
+
+/**
+ Associate a different event base with an event.
+
+ The event to be associated must not be currently active or pending.
+
+ @param eb the event base
+ @param ev the event
+ @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_set(struct event_base *, struct event *);
+
+/** @name Loop flags
+
+ These flags control the behavior of event_base_loop().
+ */
+/**@{*/
+/** Block until we have an active event, then exit once all active events
+ * have had their callbacks run. */
+#define EVLOOP_ONCE 0x01
+/** Do not block: see which events are ready now, run the callbacks
+ * of the highest-priority ones, then exit. */
+#define EVLOOP_NONBLOCK 0x02
+/** Do not exit the loop because we have no pending events. Instead, keep
+ * running until event_base_loopexit() or event_base_loopbreak() makes us
+ * stop.
+ */
+#define EVLOOP_NO_EXIT_ON_EMPTY 0x04
+/**@}*/
+
+/**
+ Wait for events to become active, and run their callbacks.
+
+ This is a more flexible version of event_base_dispatch().
+
+ By default, this loop will run the event base until either there are no more
+ pending or active events, or until something calls event_base_loopbreak() or
+ event_base_loopexit(). You can override this behavior with the 'flags'
+ argument.
+
+ @param eb the event_base structure returned by event_base_new() or
+ event_base_new_with_config()
+ @param flags any combination of EVLOOP_ONCE | EVLOOP_NONBLOCK
+ @return 0 if successful, -1 if an error occurred, or 1 if we exited because
+ no events were pending or active.
+ @see event_base_loopexit(), event_base_dispatch(), EVLOOP_ONCE,
+ EVLOOP_NONBLOCK
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_loop(struct event_base *, int);
+
+/**
+ Exit the event loop after the specified time
+
+ The next event_base_loop() iteration after the given timer expires will
+ complete normally (handling all queued events) then exit without
+ blocking for events again.
+
+ Subsequent invocations of event_base_loop() will proceed normally.
+
+ @param eb the event_base structure returned by event_init()
+ @param tv the amount of time after which the loop should terminate,
+ or NULL to exit after running all currently active events.
+ @return 0 if successful, or -1 if an error occurred
+ @see event_base_loopbreak()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_loopexit(struct event_base *, const struct timeval *);
+
+/**
+ Abort the active event_base_loop() immediately.
+
+ event_base_loop() will abort the loop after the next event is completed;
+ event_base_loopbreak() is typically invoked from this event's callback.
+ This behavior is analogous to the "break;" statement.
+
+ Subsequent invocations of event_base_loop() will proceed normally.
+
+ @param eb the event_base structure returned by event_init()
+ @return 0 if successful, or -1 if an error occurred
+ @see event_base_loopexit()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_loopbreak(struct event_base *);
+
+/**
+ Tell the active event_base_loop() to scan for new events immediately.
+
+ Calling this function makes the currently active event_base_loop()
+ start the loop over again (scanning for new events) after the current
+ event callback finishes. If the event loop is not running, this
+ function has no effect.
+
+ event_base_loopbreak() is typically invoked from this event's callback.
+ This behavior is analogous to the "continue;" statement.
+
+ Subsequent invocations of event loop will proceed normally.
+
+ @param eb the event_base structure returned by event_init()
+ @return 0 if successful, or -1 if an error occurred
+ @see event_base_loopbreak()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_loopcontinue(struct event_base *);
+
+/**
+ Checks if the event loop was told to exit by event_base_loopexit().
+
+ This function will return true for an event_base at every point after
+ event_loopexit() is called, until the event loop is next entered.
+
+ @param eb the event_base structure returned by event_init()
+ @return true if event_base_loopexit() was called on this event base,
+ or 0 otherwise
+ @see event_base_loopexit()
+ @see event_base_got_break()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_got_exit(struct event_base *);
+
+/**
+ Checks if the event loop was told to abort immediately by event_base_loopbreak().
+
+ This function will return true for an event_base at every point after
+ event_base_loopbreak() is called, until the event loop is next entered.
+
+ @param eb the event_base structure returned by event_init()
+ @return true if event_base_loopbreak() was called on this event base,
+ or 0 otherwise
+ @see event_base_loopbreak()
+ @see event_base_got_exit()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_got_break(struct event_base *);
+
+/**
+ * @name event flags
+ *
+ * Flags to pass to event_new(), event_assign(), event_pending(), and
+ * anything else with an argument of the form "short events"
+ */
+/**@{*/
+/** Indicates that a timeout has occurred. It's not necessary to pass
+ * this flag to event_for new()/event_assign() to get a timeout. */
+#define EV_TIMEOUT 0x01
+/** Wait for a socket or FD to become readable */
+#define EV_READ 0x02
+/** Wait for a socket or FD to become writeable */
+#define EV_WRITE 0x04
+/** Wait for a POSIX signal to be raised*/
+#define EV_SIGNAL 0x08
+/**
+ * Persistent event: won't get removed automatically when activated.
+ *
+ * When a persistent event with a timeout becomes activated, its timeout
+ * is reset to 0.
+ */
+#define EV_PERSIST 0x10
+/** Select edge-triggered behavior, if supported by the backend. */
+#define EV_ET 0x20
+/**
+ * If this option is provided, then event_del() will not block in one thread
+ * while waiting for the event callback to complete in another thread.
+ *
+ * To use this option safely, you may need to use event_finalize() or
+ * event_free_finalize() in order to safely tear down an event in a
+ * multithreaded application. See those functions for more information.
+ *
+ * THIS IS AN EXPERIMENTAL API. IT MIGHT CHANGE BEFORE THE LIBEVENT 2.1 SERIES
+ * BECOMES STABLE.
+ **/
+#define EV_FINALIZE 0x40
+/**
+ * Detects connection close events. You can use this to detect when a
+ * connection has been closed, without having to read all the pending data
+ * from a connection.
+ *
+ * Not all backends support EV_CLOSED. To detect or require it, use the
+ * feature flag EV_FEATURE_EARLY_CLOSE.
+ **/
+#define EV_CLOSED 0x80
+/**@}*/
+
+/**
+ @name evtimer_* macros
+
+ Aliases for working with one-shot timer events */
+/**@{*/
+#define evtimer_assign(ev, b, cb, arg) \
+ event_assign((ev), (b), -1, 0, (cb), (arg))
+#define evtimer_new(b, cb, arg) event_new((b), -1, 0, (cb), (arg))
+#define evtimer_add(ev, tv) event_add((ev), (tv))
+#define evtimer_del(ev) event_del(ev)
+#define evtimer_pending(ev, tv) event_pending((ev), EV_TIMEOUT, (tv))
+#define evtimer_initialized(ev) event_initialized(ev)
+/**@}*/
+
+/**
+ @name evsignal_* macros
+
+ Aliases for working with signal events
+ */
+/**@{*/
+#define evsignal_add(ev, tv) event_add((ev), (tv))
+#define evsignal_assign(ev, b, x, cb, arg) \
+ event_assign((ev), (b), (x), EV_SIGNAL|EV_PERSIST, cb, (arg))
+#define evsignal_new(b, x, cb, arg) \
+ event_new((b), (x), EV_SIGNAL|EV_PERSIST, (cb), (arg))
+#define evsignal_del(ev) event_del(ev)
+#define evsignal_pending(ev, tv) event_pending((ev), EV_SIGNAL, (tv))
+#define evsignal_initialized(ev) event_initialized(ev)
+/**@}*/
+
+/**
+ A callback function for an event.
+
+ It receives three arguments:
+
+ @param fd An fd or signal
+ @param events One or more EV_* flags
+ @param arg A user-supplied argument.
+
+ @see event_new()
+ */
+typedef void (*event_callback_fn)(evutil_socket_t, short, void *);
+
+/**
+ Return a value used to specify that the event itself must be used as the callback argument.
+
+ The function event_new() takes a callback argument which is passed
+ to the event's callback function. To specify that the argument to be
+ passed to the callback function is the event that event_new() returns,
+ pass in the return value of event_self_cbarg() as the callback argument
+ for event_new().
+
+ For example:
+ <pre>
+ struct event *ev = event_new(base, sock, events, callback, %event_self_cbarg());
+ </pre>
+
+ For consistency with event_new(), it is possible to pass the return value
+ of this function as the callback argument for event_assign() &ndash; this
+ achieves the same result as passing the event in directly.
+
+ @return a value to be passed as the callback argument to event_new() or
+ event_assign().
+ @see event_new(), event_assign()
+ */
+EVENT2_EXPORT_SYMBOL
+void *event_self_cbarg(void);
+
+/**
+ Allocate and asssign a new event structure, ready to be added.
+
+ The function event_new() returns a new event that can be used in
+ future calls to event_add() and event_del(). The fd and events
+ arguments determine which conditions will trigger the event; the
+ callback and callback_arg arguments tell Libevent what to do when the
+ event becomes active.
+
+ If events contains one of EV_READ, EV_WRITE, or EV_READ|EV_WRITE, then
+ fd is a file descriptor or socket that should get monitored for
+ readiness to read, readiness to write, or readiness for either operation
+ (respectively). If events contains EV_SIGNAL, then fd is a signal
+ number to wait for. If events contains none of those flags, then the
+ event can be triggered only by a timeout or by manual activation with
+ event_active(): In this case, fd must be -1.
+
+ The EV_PERSIST flag can also be passed in the events argument: it makes
+ event_add() persistent until event_del() is called.
+
+ The EV_ET flag is compatible with EV_READ and EV_WRITE, and supported
+ only by certain backends. It tells Libevent to use edge-triggered
+ events.
+
+ The EV_TIMEOUT flag has no effect here.
+
+ It is okay to have multiple events all listening on the same fds; but
+ they must either all be edge-triggered, or all not be edge triggerd.
+
+ When the event becomes active, the event loop will run the provided
+ callbuck function, with three arguments. The first will be the provided
+ fd value. The second will be a bitfield of the events that triggered:
+ EV_READ, EV_WRITE, or EV_SIGNAL. Here the EV_TIMEOUT flag indicates
+ that a timeout occurred, and EV_ET indicates that an edge-triggered
+ event occurred. The third event will be the callback_arg pointer that
+ you provide.
+
+ @param base the event base to which the event should be attached.
+ @param fd the file descriptor or signal to be monitored, or -1.
+ @param events desired events to monitor: bitfield of EV_READ, EV_WRITE,
+ EV_SIGNAL, EV_PERSIST, EV_ET.
+ @param callback callback function to be invoked when the event occurs
+ @param callback_arg an argument to be passed to the callback function
+
+ @return a newly allocated struct event that must later be freed with
+ event_free().
+ @see event_free(), event_add(), event_del(), event_assign()
+ */
+EVENT2_EXPORT_SYMBOL
+struct event *event_new(struct event_base *, evutil_socket_t, short, event_callback_fn, void *);
+
+
+/**
+ Prepare a new, already-allocated event structure to be added.
+
+ The function event_assign() prepares the event structure ev to be used
+ in future calls to event_add() and event_del(). Unlike event_new(), it
+ doesn't allocate memory itself: it requires that you have already
+ allocated a struct event, probably on the heap. Doing this will
+ typically make your code depend on the size of the event structure, and
+ thereby create incompatibility with future versions of Libevent.
+
+ The easiest way to avoid this problem is just to use event_new() and
+ event_free() instead.
+
+ A slightly harder way to future-proof your code is to use
+ event_get_struct_event_size() to determine the required size of an event
+ at runtime.
+
+ Note that it is NOT safe to call this function on an event that is
+ active or pending. Doing so WILL corrupt internal data structures in
+ Libevent, and lead to strange, hard-to-diagnose bugs. You _can_ use
+ event_assign to change an existing event, but only if it is not active
+ or pending!
+
+ The arguments for this function, and the behavior of the events that it
+ makes, are as for event_new().
+
+ @param ev an event struct to be modified
+ @param base the event base to which ev should be attached.
+ @param fd the file descriptor to be monitored
+ @param events desired events to monitor; can be EV_READ and/or EV_WRITE
+ @param callback callback function to be invoked when the event occurs
+ @param callback_arg an argument to be passed to the callback function
+
+ @return 0 if success, or -1 on invalid arguments.
+
+ @see event_new(), event_add(), event_del(), event_base_once(),
+ event_get_struct_event_size()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_assign(struct event *, struct event_base *, evutil_socket_t, short, event_callback_fn, void *);
+
+/**
+ Deallocate a struct event * returned by event_new().
+
+ If the event is pending or active, first make it non-pending and
+ non-active.
+ */
+EVENT2_EXPORT_SYMBOL
+void event_free(struct event *);
+
+/**
+ * Callback type for event_finalize and event_free_finalize().
+ *
+ * THIS IS AN EXPERIMENTAL API. IT MIGHT CHANGE BEFORE THE LIBEVENT 2.1 SERIES
+ * BECOMES STABLE.
+ *
+ **/
+typedef void (*event_finalize_callback_fn)(struct event *, void *);
+/**
+ @name Finalization functions
+
+ These functions are used to safely tear down an event in a multithreaded
+ application. If you construct your events with EV_FINALIZE to avoid
+ deadlocks, you will need a way to remove an event in the certainty that
+ it will definitely not be running its callback when you deallocate it
+ and its callback argument.
+
+ To do this, call one of event_finalize() or event_free_finalize with
+ 0 for its first argument, the event to tear down as its second argument,
+ and a callback function as its third argument. The callback will be
+ invoked as part of the event loop, with the event's priority.
+
+ After you call a finalizer function, event_add() and event_active() will
+ no longer work on the event, and event_del() will produce a no-op. You
+ must not try to change the event's fields with event_assign() or
+ event_set() while the finalize callback is in progress. Once the
+ callback has been invoked, you should treat the event structure as
+ containing uninitialized memory.
+
+ The event_free_finalize() function frees the event after it's finalized;
+ event_finalize() does not.
+
+ A finalizer callback must not make events pending or active. It must not
+ add events, activate events, or attempt to "resucitate" the event being
+ finalized in any way.
+
+ THIS IS AN EXPERIMENTAL API. IT MIGHT CHANGE BEFORE THE LIBEVENT 2.1 SERIES
+ BECOMES STABLE.
+
+ @return 0 on succes, -1 on failure.
+ */
+/**@{*/
+EVENT2_EXPORT_SYMBOL
+int event_finalize(unsigned, struct event *, event_finalize_callback_fn);
+EVENT2_EXPORT_SYMBOL
+int event_free_finalize(unsigned, struct event *, event_finalize_callback_fn);
+/**@}*/
+
+/**
+ Schedule a one-time event
+
+ The function event_base_once() is similar to event_new(). However, it
+ schedules a callback to be called exactly once, and does not require the
+ caller to prepare an event structure.
+
+ Note that in Libevent 2.0 and earlier, if the event is never triggered, the
+ internal memory used to hold it will never be freed. In Libevent 2.1,
+ the internal memory will get freed by event_base_free() if the event
+ is never triggered. The 'arg' value, however, will not get freed in either
+ case--you'll need to free that on your own if you want it to go away.
+
+ @param base an event_base
+ @param fd a file descriptor to monitor, or -1 for no fd.
+ @param events event(s) to monitor; can be any of EV_READ |
+ EV_WRITE, or EV_TIMEOUT
+ @param callback callback function to be invoked when the event occurs
+ @param arg an argument to be passed to the callback function
+ @param timeout the maximum amount of time to wait for the event. NULL
+ makes an EV_READ/EV_WRITE event make forever; NULL makes an
+ EV_TIMEOUT event succees immediately.
+ @return 0 if successful, or -1 if an error occurred
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_once(struct event_base *, evutil_socket_t, short, event_callback_fn, void *, const struct timeval *);
+
+/**
+ Add an event to the set of pending events.
+
+ The function event_add() schedules the execution of the event 'ev' when the
+ condition specified by event_assign() or event_new() occurs, or when the time
+ specified in timeout has elapesed. If atimeout is NULL, no timeout
+ occurs and the function will only be
+ called if a matching event occurs. The event in the
+ ev argument must be already initialized by event_assign() or event_new()
+ and may not be used
+ in calls to event_assign() until it is no longer pending.
+
+ If the event in the ev argument already has a scheduled timeout, calling
+ event_add() replaces the old timeout with the new one if tv is non-NULL.
+
+ @param ev an event struct initialized via event_assign() or event_new()
+ @param timeout the maximum amount of time to wait for the event, or NULL
+ to wait forever
+ @return 0 if successful, or -1 if an error occurred
+ @see event_del(), event_assign(), event_new()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_add(struct event *ev, const struct timeval *timeout);
+
+/**
+ Remove a timer from a pending event without removing the event itself.
+
+ If the event has a scheduled timeout, this function unschedules it but
+ leaves the event otherwise pending.
+
+ @param ev an event struct initialized via event_assign() or event_new()
+ @return 0 on success, or -1 if an error occurrect.
+*/
+EVENT2_EXPORT_SYMBOL
+int event_remove_timer(struct event *ev);
+
+/**
+ Remove an event from the set of monitored events.
+
+ The function event_del() will cancel the event in the argument ev. If the
+ event has already executed or has never been added the call will have no
+ effect.
+
+ @param ev an event struct to be removed from the working set
+ @return 0 if successful, or -1 if an error occurred
+ @see event_add()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_del(struct event *);
+
+/**
+ As event_del(), but never blocks while the event's callback is running
+ in another thread, even if the event was constructed without the
+ EV_FINALIZE flag.
+
+ THIS IS AN EXPERIMENTAL API. IT MIGHT CHANGE BEFORE THE LIBEVENT 2.1 SERIES
+ BECOMES STABLE.
+ */
+EVENT2_EXPORT_SYMBOL
+int event_del_noblock(struct event *ev);
+/**
+ As event_del(), but always blocks while the event's callback is running
+ in another thread, even if the event was constructed with the
+ EV_FINALIZE flag.
+
+ THIS IS AN EXPERIMENTAL API. IT MIGHT CHANGE BEFORE THE LIBEVENT 2.1 SERIES
+ BECOMES STABLE.
+ */
+EVENT2_EXPORT_SYMBOL
+int event_del_block(struct event *ev);
+
+/**
+ Make an event active.
+
+ You can use this function on a pending or a non-pending event to make it
+ active, so that its callback will be run by event_base_dispatch() or
+ event_base_loop().
+
+ One common use in multithreaded programs is to wake the thread running
+ event_base_loop() from another thread.
+
+ @param ev an event to make active.
+ @param res a set of flags to pass to the event's callback.
+ @param ncalls an obsolete argument: this is ignored.
+ **/
+EVENT2_EXPORT_SYMBOL
+void event_active(struct event *ev, int res, short ncalls);
+
+/**
+ Checks if a specific event is pending or scheduled.
+
+ @param ev an event struct previously passed to event_add()
+ @param events the requested event type; any of EV_TIMEOUT|EV_READ|
+ EV_WRITE|EV_SIGNAL
+ @param tv if this field is not NULL, and the event has a timeout,
+ this field is set to hold the time at which the timeout will
+ expire.
+
+ @return true if the event is pending on any of the events in 'what', (that
+ is to say, it has been added), or 0 if the event is not added.
+ */
+EVENT2_EXPORT_SYMBOL
+int event_pending(const struct event *ev, short events, struct timeval *tv);
+
+/**
+ If called from within the callback for an event, returns that event.
+
+ The behavior of this function is not defined when called from outside the
+ callback function for an event.
+ */
+EVENT2_EXPORT_SYMBOL
+struct event *event_base_get_running_event(struct event_base *base);
+
+/**
+ Test if an event structure might be initialized.
+
+ The event_initialized() function can be used to check if an event has been
+ initialized.
+
+ Warning: This function is only useful for distinguishing a a zeroed-out
+ piece of memory from an initialized event, it can easily be confused by
+ uninitialized memory. Thus, it should ONLY be used to distinguish an
+ initialized event from zero.
+
+ @param ev an event structure to be tested
+ @return 1 if the structure might be initialized, or 0 if it has not been
+ initialized
+ */
+EVENT2_EXPORT_SYMBOL
+int event_initialized(const struct event *ev);
+
+/**
+ Get the signal number assigned to a signal event
+*/
+#define event_get_signal(ev) ((int)event_get_fd(ev))
+
+/**
+ Get the socket or signal assigned to an event, or -1 if the event has
+ no socket.
+*/
+EVENT2_EXPORT_SYMBOL
+evutil_socket_t event_get_fd(const struct event *ev);
+
+/**
+ Get the event_base associated with an event.
+*/
+EVENT2_EXPORT_SYMBOL
+struct event_base *event_get_base(const struct event *ev);
+
+/**
+ Return the events (EV_READ, EV_WRITE, etc) assigned to an event.
+*/
+EVENT2_EXPORT_SYMBOL
+short event_get_events(const struct event *ev);
+
+/**
+ Return the callback assigned to an event.
+*/
+EVENT2_EXPORT_SYMBOL
+event_callback_fn event_get_callback(const struct event *ev);
+
+/**
+ Return the callback argument assigned to an event.
+*/
+EVENT2_EXPORT_SYMBOL
+void *event_get_callback_arg(const struct event *ev);
+
+/**
+ Return the priority of an event.
+ @see event_priority_init(), event_get_priority()
+*/
+EVENT2_EXPORT_SYMBOL
+int event_get_priority(const struct event *ev);
+
+/**
+ Extract _all_ of arguments given to construct a given event. The
+ event_base is copied into *base_out, the fd is copied into *fd_out, and so
+ on.
+
+ If any of the "_out" arguments is NULL, it will be ignored.
+ */
+EVENT2_EXPORT_SYMBOL
+void event_get_assignment(const struct event *event,
+ struct event_base **base_out, evutil_socket_t *fd_out, short *events_out,
+ event_callback_fn *callback_out, void **arg_out);
+
+/**
+ Return the size of struct event that the Libevent library was compiled
+ with.
+
+ This will be NO GREATER than sizeof(struct event) if you're running with
+ the same version of Libevent that your application was built with, but
+ otherwise might not.
+
+ Note that it might be SMALLER than sizeof(struct event) if some future
+ version of Libevent adds extra padding to the end of struct event.
+ We might do this to help ensure ABI-compatibility between different
+ versions of Libevent.
+ */
+EVENT2_EXPORT_SYMBOL
+size_t event_get_struct_event_size(void);
+
+/**
+ Get the Libevent version.
+
+ Note that this will give you the version of the library that you're
+ currently linked against, not the version of the headers that you've
+ compiled against.
+
+ @return a string containing the version number of Libevent
+*/
+EVENT2_EXPORT_SYMBOL
+const char *event_get_version(void);
+
+/**
+ Return a numeric representation of Libevent's version.
+
+ Note that this will give you the version of the library that you're
+ currently linked against, not the version of the headers you've used to
+ compile.
+
+ The format uses one byte each for the major, minor, and patchlevel parts of
+ the version number. The low-order byte is unused. For example, version
+ 2.0.1-alpha has a numeric representation of 0x02000100
+*/
+EVENT2_EXPORT_SYMBOL
+ev_uint32_t event_get_version_number(void);
+
+/** As event_get_version, but gives the version of Libevent's headers. */
+#define LIBEVENT_VERSION EVENT__VERSION
+/** As event_get_version_number, but gives the version number of Libevent's
+ * headers. */
+#define LIBEVENT_VERSION_NUMBER EVENT__NUMERIC_VERSION
+
+/** Largest number of priorities that Libevent can support. */
+#define EVENT_MAX_PRIORITIES 256
+/**
+ Set the number of different event priorities
+
+ By default Libevent schedules all active events with the same priority.
+ However, some time it is desirable to process some events with a higher
+ priority than others. For that reason, Libevent supports strict priority
+ queues. Active events with a lower priority are always processed before
+ events with a higher priority.
+
+ The number of different priorities can be set initially with the
+ event_base_priority_init() function. This function should be called
+ before the first call to event_base_dispatch(). The
+ event_priority_set() function can be used to assign a priority to an
+ event. By default, Libevent assigns the middle priority to all events
+ unless their priority is explicitly set.
+
+ Note that urgent-priority events can starve less-urgent events: after
+ running all urgent-priority callbacks, Libevent checks for more urgent
+ events again, before running less-urgent events. Less-urgent events
+ will not have their callbacks run until there are no events more urgent
+ than them that want to be active.
+
+ @param eb the event_base structure returned by event_base_new()
+ @param npriorities the maximum number of priorities
+ @return 0 if successful, or -1 if an error occurred
+ @see event_priority_set()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_priority_init(struct event_base *, int);
+
+/**
+ Get the number of different event priorities.
+
+ @param eb the event_base structure returned by event_base_new()
+ @return Number of different event priorities
+ @see event_base_priority_init()
+*/
+EVENT2_EXPORT_SYMBOL
+int event_base_get_npriorities(struct event_base *eb);
+
+/**
+ Assign a priority to an event.
+
+ @param ev an event struct
+ @param priority the new priority to be assigned
+ @return 0 if successful, or -1 if an error occurred
+ @see event_priority_init(), event_get_priority()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_priority_set(struct event *, int);
+
+/**
+ Prepare an event_base to use a large number of timeouts with the same
+ duration.
+
+ Libevent's default scheduling algorithm is optimized for having a large
+ number of timeouts with their durations more or less randomly
+ distributed. But if you have a large number of timeouts that all have
+ the same duration (for example, if you have a large number of
+ connections that all have a 10-second timeout), then you can improve
+ Libevent's performance by telling Libevent about it.
+
+ To do this, call this function with the common duration. It will return a
+ pointer to a different, opaque timeout value. (Don't depend on its actual
+ contents!) When you use this timeout value in event_add(), Libevent will
+ schedule the event more efficiently.
+
+ (This optimization probably will not be worthwhile until you have thousands
+ or tens of thousands of events with the same timeout.)
+ */
+EVENT2_EXPORT_SYMBOL
+const struct timeval *event_base_init_common_timeout(struct event_base *base,
+ const struct timeval *duration);
+
+#if !defined(EVENT__DISABLE_MM_REPLACEMENT) || defined(EVENT_IN_DOXYGEN_)
+/**
+ Override the functions that Libevent uses for memory management.
+
+ Usually, Libevent uses the standard libc functions malloc, realloc, and
+ free to allocate memory. Passing replacements for those functions to
+ event_set_mem_functions() overrides this behavior.
+
+ Note that all memory returned from Libevent will be allocated by the
+ replacement functions rather than by malloc() and realloc(). Thus, if you
+ have replaced those functions, it will not be appropriate to free() memory
+ that you get from Libevent. Instead, you must use the free_fn replacement
+ that you provided.
+
+ Note also that if you are going to call this function, you should do so
+ before any call to any Libevent function that does allocation.
+ Otherwise, those funtions will allocate their memory using malloc(), but
+ then later free it using your provided free_fn.
+
+ @param malloc_fn A replacement for malloc.
+ @param realloc_fn A replacement for realloc
+ @param free_fn A replacement for free.
+ **/
+EVENT2_EXPORT_SYMBOL
+void event_set_mem_functions(
+ void *(*malloc_fn)(size_t sz),
+ void *(*realloc_fn)(void *ptr, size_t sz),
+ void (*free_fn)(void *ptr));
+/** This definition is present if Libevent was built with support for
+ event_set_mem_functions() */
+#define EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED
+#endif
+
+/**
+ Writes a human-readable description of all inserted and/or active
+ events to a provided stdio stream.
+
+ This is intended for debugging; its format is not guaranteed to be the same
+ between libevent versions.
+
+ @param base An event_base on which to scan the events.
+ @param output A stdio file to write on.
+ */
+EVENT2_EXPORT_SYMBOL
+void event_base_dump_events(struct event_base *, FILE *);
+
+
+/**
+ Activates all pending events for the given fd and event mask.
+
+ This function activates pending events only. Events which have not been
+ added will not become active.
+
+ @param base the event_base on which to activate the events.
+ @param fd An fd to active events on.
+ @param events One or more of EV_{READ,WRITE}.
+ */
+EVENT2_EXPORT_SYMBOL
+void event_base_active_by_fd(struct event_base *base, evutil_socket_t fd, short events);
+
+/**
+ Activates all pending signals with a given signal number
+
+ This function activates pending events only. Events which have not been
+ added will not become active.
+
+ @param base the event_base on which to activate the events.
+ @param fd The signal to active events on.
+ */
+EVENT2_EXPORT_SYMBOL
+void event_base_active_by_signal(struct event_base *base, int sig);
+
+/**
+ * Callback for iterating events in an event base via event_base_foreach_event
+ */
+typedef int (*event_base_foreach_event_cb)(const struct event_base *, const struct event *, void *);
+
+/**
+ Iterate over all added or active events events in an event loop, and invoke
+ a given callback on each one.
+
+ The callback must not call any function that modifies the event base, that
+ modifies any event in the event base, or that adds or removes any event to
+ the event base. Doing so is unsupported and will lead to undefined
+ behavior -- likely, to crashes.
+
+ event_base_foreach_event() holds a lock on the event_base() for the whole
+ time it's running: slow callbacks are not advisable.
+
+ Note that Libevent adds some events of its own to make pieces of its
+ functionality work. You must not assume that the only events you'll
+ encounter will be the ones you added yourself.
+
+ The callback function must return 0 to continue iteration, or some other
+ integer to stop iterating.
+
+ @param base An event_base on which to scan the events.
+ @param fn A callback function to receive the events.
+ @param arg An argument passed to the callback function.
+ @return 0 if we iterated over every event, or the value returned by the
+ callback function if the loop exited early.
+*/
+EVENT2_EXPORT_SYMBOL
+int event_base_foreach_event(struct event_base *base, event_base_foreach_event_cb fn, void *arg);
+
+
+/** Sets 'tv' to the current time (as returned by gettimeofday()),
+ looking at the cached value in 'base' if possible, and calling
+ gettimeofday() or clock_gettime() as appropriate if there is no
+ cached time.
+
+ Generally, this value will only be cached while actually
+ processing event callbacks, and may be very inaccuate if your
+ callbacks take a long time to execute.
+
+ Returns 0 on success, negative on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_gettimeofday_cached(struct event_base *base,
+ struct timeval *tv);
+
+/** Update cached_tv in the 'base' to the current time
+ *
+ * You can use this function is useful for selectively increasing
+ * the accuracy of the cached time value in 'base' during callbacks
+ * that take a long time to execute.
+ *
+ * This function has no effect if the base is currently not in its
+ * event loop, or if timeval caching is disabled via
+ * EVENT_BASE_FLAG_NO_CACHE_TIME.
+ *
+ * @return 0 on success, -1 on failure
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_update_cache_time(struct event_base *base);
+
+/** Release up all globally-allocated resources allocated by Libevent.
+
+ This function does not free developer-controlled resources like
+ event_bases, events, bufferevents, listeners, and so on. It only releases
+ resources like global locks that there is no other way to free.
+
+ It is not actually necessary to call this function before exit: every
+ resource that it frees would be released anyway on exit. It mainly exists
+ so that resource-leak debugging tools don't see Libevent as holding
+ resources at exit.
+
+ You should only call this function when no other Libevent functions will
+ be invoked -- e.g., when cleanly exiting a program.
+ */
+EVENT2_EXPORT_SYMBOL
+void libevent_global_shutdown(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_EVENT_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/include/event2/event_compat.h b/protocols/Telegram/tgl/libevent/include/event2/event_compat.h
new file mode 100644
index 0000000000..5110175a1b
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/event2/event_compat.h
@@ -0,0 +1,230 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVENT2_EVENT_COMPAT_H_INCLUDED_
+#define EVENT2_EVENT_COMPAT_H_INCLUDED_
+
+/** @file event2/event_compat.h
+
+ Potentially non-threadsafe versions of the functions in event.h: provided
+ only for backwards compatibility.
+
+ In the oldest versions of Libevent, event_base was not a first-class
+ structure. Instead, there was a single event base that every function
+ manipulated. Later, when separate event bases were added, the old functions
+ that didn't take an event_base argument needed to work by manipulating the
+ "current" event base. This could lead to thread-safety issues, and obscure,
+ hard-to-diagnose bugs.
+
+ @deprecated All functions in this file are by definition deprecated.
+ */
+#include <event2/visibility.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event-config.h>
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+/* For int types. */
+#include <event2/util.h>
+
+/**
+ Initialize the event API.
+
+ The event API needs to be initialized with event_init() before it can be
+ used. Sets the global current base that gets used for events that have no
+ base associated with them.
+
+ @deprecated This function is deprecated because it replaces the "current"
+ event_base, and is totally unsafe for multithreaded use. The replacement
+ is event_base_new().
+
+ @see event_base_set(), event_base_new()
+ */
+EVENT2_EXPORT_SYMBOL
+struct event_base *event_init(void);
+
+/**
+ Loop to process events.
+
+ Like event_base_dispatch(), but uses the "current" base.
+
+ @deprecated This function is deprecated because it is easily confused by
+ multiple calls to event_init(), and because it is not safe for
+ multithreaded use. The replacement is event_base_dispatch().
+
+ @see event_base_dispatch(), event_init()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_dispatch(void);
+
+/**
+ Handle events.
+
+ This function behaves like event_base_loop(), but uses the "current" base
+
+ @deprecated This function is deprecated because it uses the event base from
+ the last call to event_init, and is therefore not safe for multithreaded
+ use. The replacement is event_base_loop().
+
+ @see event_base_loop(), event_init()
+*/
+EVENT2_EXPORT_SYMBOL
+int event_loop(int);
+
+
+/**
+ Exit the event loop after the specified time.
+
+ This function behaves like event_base_loopexit(), except that it uses the
+ "current" base.
+
+ @deprecated This function is deprecated because it uses the event base from
+ the last call to event_init, and is therefore not safe for multithreaded
+ use. The replacement is event_base_loopexit().
+
+ @see event_init, event_base_loopexit()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_loopexit(const struct timeval *);
+
+
+/**
+ Abort the active event_loop() immediately.
+
+ This function behaves like event_base_loopbreakt(), except that it uses the
+ "current" base.
+
+ @deprecated This function is deprecated because it uses the event base from
+ the last call to event_init, and is therefore not safe for multithreaded
+ use. The replacement is event_base_loopbreak().
+
+ @see event_base_loopbreak(), event_init()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_loopbreak(void);
+
+/**
+ Schedule a one-time event to occur.
+
+ @deprecated This function is obsolete, and has been replaced by
+ event_base_once(). Its use is deprecated because it relies on the
+ "current" base configured by event_init().
+
+ @see event_base_once()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_once(evutil_socket_t , short,
+ void (*)(evutil_socket_t, short, void *), void *, const struct timeval *);
+
+
+/**
+ Get the kernel event notification mechanism used by Libevent.
+
+ @deprecated This function is obsolete, and has been replaced by
+ event_base_get_method(). Its use is deprecated because it relies on the
+ "current" base configured by event_init().
+
+ @see event_base_get_method()
+ */
+EVENT2_EXPORT_SYMBOL
+const char *event_get_method(void);
+
+
+/**
+ Set the number of different event priorities.
+
+ @deprecated This function is deprecated because it is easily confused by
+ multiple calls to event_init(), and because it is not safe for
+ multithreaded use. The replacement is event_base_priority_init().
+
+ @see event_base_priority_init()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_priority_init(int);
+
+/**
+ Prepare an event structure to be added.
+
+ @deprecated event_set() is not recommended for new code, because it requires
+ a subsequent call to event_base_set() to be safe under most circumstances.
+ Use event_assign() or event_new() instead.
+ */
+EVENT2_EXPORT_SYMBOL
+void event_set(struct event *, evutil_socket_t, short, void (*)(evutil_socket_t, short, void *), void *);
+
+#define evtimer_set(ev, cb, arg) event_set((ev), -1, 0, (cb), (arg))
+#define evsignal_set(ev, x, cb, arg) \
+ event_set((ev), (x), EV_SIGNAL|EV_PERSIST, (cb), (arg))
+
+
+/**
+ @name timeout_* macros
+
+ @deprecated These macros are deprecated because their naming is inconsistent
+ with the rest of Libevent. Use the evtimer_* macros instead.
+ @{
+ */
+#define timeout_add(ev, tv) event_add((ev), (tv))
+#define timeout_set(ev, cb, arg) event_set((ev), -1, 0, (cb), (arg))
+#define timeout_del(ev) event_del(ev)
+#define timeout_pending(ev, tv) event_pending((ev), EV_TIMEOUT, (tv))
+#define timeout_initialized(ev) event_initialized(ev)
+/**@}*/
+
+/**
+ @name signal_* macros
+
+ @deprecated These macros are deprecated because their naming is inconsistent
+ with the rest of Libevent. Use the evsignal_* macros instead.
+ @{
+ */
+#define signal_add(ev, tv) event_add((ev), (tv))
+#define signal_set(ev, x, cb, arg) \
+ event_set((ev), (x), EV_SIGNAL|EV_PERSIST, (cb), (arg))
+#define signal_del(ev) event_del(ev)
+#define signal_pending(ev, tv) event_pending((ev), EV_SIGNAL, (tv))
+#define signal_initialized(ev) event_initialized(ev)
+/**@}*/
+
+#ifndef EVENT_FD
+/* These macros are obsolete; use event_get_fd and event_get_signal instead. */
+#define EVENT_FD(ev) ((int)event_get_fd(ev))
+#define EVENT_SIGNAL(ev) event_get_signal(ev)
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_EVENT_COMPAT_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/include/event2/event_struct.h b/protocols/Telegram/tgl/libevent/include/event2/event_struct.h
new file mode 100644
index 0000000000..1c8b71b6b0
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/event2/event_struct.h
@@ -0,0 +1,180 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVENT2_EVENT_STRUCT_H_INCLUDED_
+#define EVENT2_EVENT_STRUCT_H_INCLUDED_
+
+/** @file event2/event_struct.h
+
+ Structures used by event.h. Using these structures directly WILL harm
+ forward compatibility: be careful.
+
+ No field declared in this file should be used directly in user code. Except
+ for historical reasons, these fields would not be exposed at all.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event-config.h>
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+/* For int types. */
+#include <event2/util.h>
+
+/* For evkeyvalq */
+#include <event2/keyvalq_struct.h>
+
+#define EVLIST_TIMEOUT 0x01
+#define EVLIST_INSERTED 0x02
+#define EVLIST_SIGNAL 0x04
+#define EVLIST_ACTIVE 0x08
+#define EVLIST_INTERNAL 0x10
+#define EVLIST_ACTIVE_LATER 0x20
+#define EVLIST_FINALIZING 0x40
+#define EVLIST_INIT 0x80
+
+#define EVLIST_ALL 0xff
+
+/* Fix so that people don't have to run with <sys/queue.h> */
+#ifndef TAILQ_ENTRY
+#define EVENT_DEFINED_TQENTRY_
+#define TAILQ_ENTRY(type) \
+struct { \
+ struct type *tqe_next; /* next element */ \
+ struct type **tqe_prev; /* address of previous next element */ \
+}
+#endif /* !TAILQ_ENTRY */
+
+#ifndef TAILQ_HEAD
+#define EVENT_DEFINED_TQHEAD_
+#define TAILQ_HEAD(name, type) \
+struct name { \
+ struct type *tqh_first; \
+ struct type **tqh_last; \
+}
+#endif
+
+/* Fix so that people don't have to run with <sys/queue.h> */
+#ifndef LIST_ENTRY
+#define EVENT_DEFINED_LISTENTRY_
+#define LIST_ENTRY(type) \
+struct { \
+ struct type *le_next; /* next element */ \
+ struct type **le_prev; /* address of previous next element */ \
+}
+#endif /* !LIST_ENTRY */
+
+#ifndef LIST_HEAD
+#define EVENT_DEFINED_LISTHEAD_
+#define LIST_HEAD(name, type) \
+struct name { \
+ struct type *lh_first; /* first element */ \
+ }
+#endif /* !LIST_HEAD */
+
+struct event;
+
+struct event_callback {
+ TAILQ_ENTRY(event_callback) evcb_active_next;
+ short evcb_flags;
+ ev_uint8_t evcb_pri; /* smaller numbers are higher priority */
+ ev_uint8_t evcb_closure;
+ /* allows us to adopt for different types of events */
+ union {
+ void (*evcb_callback)(evutil_socket_t, short, void *);
+ void (*evcb_selfcb)(struct event_callback *, void *);
+ void (*evcb_evfinalize)(struct event *, void *);
+ void (*evcb_cbfinalize)(struct event_callback *, void *);
+ } evcb_cb_union;
+ void *evcb_arg;
+};
+
+struct event_base;
+struct event {
+ struct event_callback ev_evcallback;
+
+ /* for managing timeouts */
+ union {
+ TAILQ_ENTRY(event) ev_next_with_common_timeout;
+ int min_heap_idx;
+ } ev_timeout_pos;
+ evutil_socket_t ev_fd;
+
+ struct event_base *ev_base;
+
+ union {
+ /* used for io events */
+ struct {
+ LIST_ENTRY (event) ev_io_next;
+ struct timeval ev_timeout;
+ } ev_io;
+
+ /* used by signal events */
+ struct {
+ LIST_ENTRY (event) ev_signal_next;
+ short ev_ncalls;
+ /* Allows deletes in callback */
+ short *ev_pncalls;
+ } ev_signal;
+ } ev_;
+
+ short ev_events;
+ short ev_res; /* result passed to event callback */
+ struct timeval ev_timeout;
+};
+
+TAILQ_HEAD (event_list, event);
+
+#ifdef EVENT_DEFINED_TQENTRY_
+#undef TAILQ_ENTRY
+#endif
+
+#ifdef EVENT_DEFINED_TQHEAD_
+#undef TAILQ_HEAD
+#endif
+
+LIST_HEAD (event_dlist, event);
+
+#ifdef EVENT_DEFINED_LISTENTRY_
+#undef LIST_ENTRY
+#endif
+
+#ifdef EVENT_DEFINED_LISTHEAD_
+#undef LIST_HEAD
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_EVENT_STRUCT_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/include/event2/http.h b/protocols/Telegram/tgl/libevent/include/event2/http.h
new file mode 100644
index 0000000000..e99782073f
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/event2/http.h
@@ -0,0 +1,1170 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVENT2_HTTP_H_INCLUDED_
+#define EVENT2_HTTP_H_INCLUDED_
+
+/* For int types. */
+#include <event2/util.h>
+#include <event2/visibility.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* In case we haven't included the right headers yet. */
+struct evbuffer;
+struct event_base;
+struct bufferevent;
+struct evhttp_connection;
+
+/** @file event2/http.h
+ *
+ * Basic support for HTTP serving.
+ *
+ * As Libevent is a library for dealing with event notification and most
+ * interesting applications are networked today, I have often found the
+ * need to write HTTP code. The following prototypes and definitions provide
+ * an application with a minimal interface for making HTTP requests and for
+ * creating a very simple HTTP server.
+ */
+
+/* Response codes */
+#define HTTP_OK 200 /**< request completed ok */
+#define HTTP_NOCONTENT 204 /**< request does not have content */
+#define HTTP_MOVEPERM 301 /**< the uri moved permanently */
+#define HTTP_MOVETEMP 302 /**< the uri moved temporarily */
+#define HTTP_NOTMODIFIED 304 /**< page was not modified from last */
+#define HTTP_BADREQUEST 400 /**< invalid http request was made */
+#define HTTP_NOTFOUND 404 /**< could not find content for uri */
+#define HTTP_BADMETHOD 405 /**< method not allowed for this uri */
+#define HTTP_ENTITYTOOLARGE 413 /**< */
+#define HTTP_EXPECTATIONFAILED 417 /**< we can't handle this expectation */
+#define HTTP_INTERNAL 500 /**< internal error */
+#define HTTP_NOTIMPLEMENTED 501 /**< not implemented */
+#define HTTP_SERVUNAVAIL 503 /**< the server is not available */
+
+struct evhttp;
+struct evhttp_request;
+struct evkeyvalq;
+struct evhttp_bound_socket;
+struct evconnlistener;
+struct evdns_base;
+
+/**
+ * Create a new HTTP server.
+ *
+ * @param base (optional) the event base to receive the HTTP events
+ * @return a pointer to a newly initialized evhttp server structure
+ * @see evhttp_free()
+ */
+EVENT2_EXPORT_SYMBOL
+struct evhttp *evhttp_new(struct event_base *base);
+
+/**
+ * Binds an HTTP server on the specified address and port.
+ *
+ * Can be called multiple times to bind the same http server
+ * to multiple different ports.
+ *
+ * @param http a pointer to an evhttp object
+ * @param address a string containing the IP address to listen(2) on
+ * @param port the port number to listen on
+ * @return 0 on success, -1 on failure.
+ * @see evhttp_accept_socket()
+ */
+EVENT2_EXPORT_SYMBOL
+int evhttp_bind_socket(struct evhttp *http, const char *address, ev_uint16_t port);
+
+/**
+ * Like evhttp_bind_socket(), but returns a handle for referencing the socket.
+ *
+ * The returned pointer is not valid after \a http is freed.
+ *
+ * @param http a pointer to an evhttp object
+ * @param address a string containing the IP address to listen(2) on
+ * @param port the port number to listen on
+ * @return Handle for the socket on success, NULL on failure.
+ * @see evhttp_bind_socket(), evhttp_del_accept_socket()
+ */
+EVENT2_EXPORT_SYMBOL
+struct evhttp_bound_socket *evhttp_bind_socket_with_handle(struct evhttp *http, const char *address, ev_uint16_t port);
+
+/**
+ * Makes an HTTP server accept connections on the specified socket.
+ *
+ * This may be useful to create a socket and then fork multiple instances
+ * of an http server, or when a socket has been communicated via file
+ * descriptor passing in situations where an http servers does not have
+ * permissions to bind to a low-numbered port.
+ *
+ * Can be called multiple times to have the http server listen to
+ * multiple different sockets.
+ *
+ * @param http a pointer to an evhttp object
+ * @param fd a socket fd that is ready for accepting connections
+ * @return 0 on success, -1 on failure.
+ * @see evhttp_bind_socket()
+ */
+EVENT2_EXPORT_SYMBOL
+int evhttp_accept_socket(struct evhttp *http, evutil_socket_t fd);
+
+/**
+ * Like evhttp_accept_socket(), but returns a handle for referencing the socket.
+ *
+ * The returned pointer is not valid after \a http is freed.
+ *
+ * @param http a pointer to an evhttp object
+ * @param fd a socket fd that is ready for accepting connections
+ * @return Handle for the socket on success, NULL on failure.
+ * @see evhttp_accept_socket(), evhttp_del_accept_socket()
+ */
+EVENT2_EXPORT_SYMBOL
+struct evhttp_bound_socket *evhttp_accept_socket_with_handle(struct evhttp *http, evutil_socket_t fd);
+
+/**
+ * The most low-level evhttp_bind/accept method: takes an evconnlistener, and
+ * returns an evhttp_bound_socket. The listener will be freed when the bound
+ * socket is freed.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evhttp_bound_socket *evhttp_bind_listener(struct evhttp *http, struct evconnlistener *listener);
+
+/**
+ * Return the listener used to implement a bound socket.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evconnlistener *evhttp_bound_socket_get_listener(struct evhttp_bound_socket *bound);
+
+typedef void evhttp_bound_socket_foreach_fn(struct evhttp_bound_socket *, void *);
+/**
+ * Applies the function specified in the first argument to all
+ * evhttp_bound_sockets associated with "http". The user must not
+ * attempt to free or remove any connections, sockets or listeners
+ * in the callback "function".
+ *
+ * @param http pointer to an evhttp object
+ * @param function function to apply to every bound socket
+ * @param argument pointer value passed to function for every socket iterated
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_foreach_bound_socket(struct evhttp *http, evhttp_bound_socket_foreach_fn *function, void *argument);
+
+/**
+ * Makes an HTTP server stop accepting connections on the specified socket
+ *
+ * This may be useful when a socket has been sent via file descriptor passing
+ * and is no longer needed by the current process.
+ *
+ * If you created this bound socket with evhttp_bind_socket_with_handle or
+ * evhttp_accept_socket_with_handle, this function closes the fd you provided.
+ * If you created this bound socket with evhttp_bind_listener, this function
+ * frees the listener you provided.
+ *
+ * \a bound_socket is an invalid pointer after this call returns.
+ *
+ * @param http a pointer to an evhttp object
+ * @param bound_socket a handle returned by evhttp_{bind,accept}_socket_with_handle
+ * @see evhttp_bind_socket_with_handle(), evhttp_accept_socket_with_handle()
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_del_accept_socket(struct evhttp *http, struct evhttp_bound_socket *bound_socket);
+
+/**
+ * Get the raw file descriptor referenced by an evhttp_bound_socket.
+ *
+ * @param bound_socket a handle returned by evhttp_{bind,accept}_socket_with_handle
+ * @return the file descriptor used by the bound socket
+ * @see evhttp_bind_socket_with_handle(), evhttp_accept_socket_with_handle()
+ */
+EVENT2_EXPORT_SYMBOL
+evutil_socket_t evhttp_bound_socket_get_fd(struct evhttp_bound_socket *bound_socket);
+
+/**
+ * Free the previously created HTTP server.
+ *
+ * Works only if no requests are currently being served.
+ *
+ * @param http the evhttp server object to be freed
+ * @see evhttp_start()
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_free(struct evhttp* http);
+
+/** XXX Document. */
+EVENT2_EXPORT_SYMBOL
+void evhttp_set_max_headers_size(struct evhttp* http, ev_ssize_t max_headers_size);
+/** XXX Document. */
+EVENT2_EXPORT_SYMBOL
+void evhttp_set_max_body_size(struct evhttp* http, ev_ssize_t max_body_size);
+
+/**
+ Set the value to use for the Content-Type header when none was provided. If
+ the content type string is NULL, the Content-Type header will not be
+ automatically added.
+
+ @param http the http server on which to set the default content type
+ @param content_type the value for the Content-Type header
+*/
+EVENT2_EXPORT_SYMBOL
+void evhttp_set_default_content_type(struct evhttp *http,
+ const char *content_type);
+
+/**
+ Sets the what HTTP methods are supported in requests accepted by this
+ server, and passed to user callbacks.
+
+ If not supported they will generate a "405 Method not allowed" response.
+
+ By default this includes the following methods: GET, POST, HEAD, PUT, DELETE
+
+ @param http the http server on which to set the methods
+ @param methods bit mask constructed from evhttp_cmd_type values
+*/
+EVENT2_EXPORT_SYMBOL
+void evhttp_set_allowed_methods(struct evhttp* http, ev_uint16_t methods);
+
+/**
+ Set a callback for a specified URI
+
+ @param http the http sever on which to set the callback
+ @param path the path for which to invoke the callback
+ @param cb the callback function that gets invoked on requesting path
+ @param cb_arg an additional context argument for the callback
+ @return 0 on success, -1 if the callback existed already, -2 on failure
+*/
+EVENT2_EXPORT_SYMBOL
+int evhttp_set_cb(struct evhttp *http, const char *path,
+ void (*cb)(struct evhttp_request *, void *), void *cb_arg);
+
+/** Removes the callback for a specified URI */
+EVENT2_EXPORT_SYMBOL
+int evhttp_del_cb(struct evhttp *, const char *);
+
+/**
+ Set a callback for all requests that are not caught by specific callbacks
+
+ Invokes the specified callback for all requests that do not match any of
+ the previously specified request paths. This is catchall for requests not
+ specifically configured with evhttp_set_cb().
+
+ @param http the evhttp server object for which to set the callback
+ @param cb the callback to invoke for any unmatched requests
+ @param arg an context argument for the callback
+*/
+EVENT2_EXPORT_SYMBOL
+void evhttp_set_gencb(struct evhttp *http,
+ void (*cb)(struct evhttp_request *, void *), void *arg);
+
+/**
+ Set a callback used to create new bufferevents for connections
+ to a given evhttp object.
+
+ You can use this to override the default bufferevent type -- for example,
+ to make this evhttp object use SSL bufferevents rather than unencrypted
+ ones.
+
+ New bufferevents must be allocated with no fd set on them.
+
+ @param http the evhttp server object for which to set the callback
+ @param cb the callback to invoke for incoming connections
+ @param arg an context argument for the callback
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_set_bevcb(struct evhttp *http,
+ struct bufferevent *(*cb)(struct event_base *, void *), void *arg);
+
+/**
+ Adds a virtual host to the http server.
+
+ A virtual host is a newly initialized evhttp object that has request
+ callbacks set on it via evhttp_set_cb() or evhttp_set_gencb(). It
+ most not have any listing sockets associated with it.
+
+ If the virtual host has not been removed by the time that evhttp_free()
+ is called on the main http server, it will be automatically freed, too.
+
+ It is possible to have hierarchical vhosts. For example: A vhost
+ with the pattern *.example.com may have other vhosts with patterns
+ foo.example.com and bar.example.com associated with it.
+
+ @param http the evhttp object to which to add a virtual host
+ @param pattern the glob pattern against which the hostname is matched.
+ The match is case insensitive and follows otherwise regular shell
+ matching.
+ @param vhost the virtual host to add the regular http server.
+ @return 0 on success, -1 on failure
+ @see evhttp_remove_virtual_host()
+*/
+EVENT2_EXPORT_SYMBOL
+int evhttp_add_virtual_host(struct evhttp* http, const char *pattern,
+ struct evhttp* vhost);
+
+/**
+ Removes a virtual host from the http server.
+
+ @param http the evhttp object from which to remove the virtual host
+ @param vhost the virtual host to remove from the regular http server.
+ @return 0 on success, -1 on failure
+ @see evhttp_add_virtual_host()
+*/
+EVENT2_EXPORT_SYMBOL
+int evhttp_remove_virtual_host(struct evhttp* http, struct evhttp* vhost);
+
+/**
+ Add a server alias to an http object. The http object can be a virtual
+ host or the main server.
+
+ @param http the evhttp object
+ @param alias the alias to add
+ @see evhttp_add_remove_alias()
+*/
+EVENT2_EXPORT_SYMBOL
+int evhttp_add_server_alias(struct evhttp *http, const char *alias);
+
+/**
+ Remove a server alias from an http object.
+
+ @param http the evhttp object
+ @param alias the alias to remove
+ @see evhttp_add_server_alias()
+*/
+EVENT2_EXPORT_SYMBOL
+int evhttp_remove_server_alias(struct evhttp *http, const char *alias);
+
+/**
+ * Set the timeout for an HTTP request.
+ *
+ * @param http an evhttp object
+ * @param timeout_in_secs the timeout, in seconds
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_set_timeout(struct evhttp *http, int timeout_in_secs);
+
+/**
+ * Set the timeout for an HTTP request.
+ *
+ * @param http an evhttp object
+ * @param tv the timeout, or NULL
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_set_timeout_tv(struct evhttp *http, const struct timeval* tv);
+
+/* Request/Response functionality */
+
+/**
+ * Send an HTML error message to the client.
+ *
+ * @param req a request object
+ * @param error the HTTP error code
+ * @param reason a brief explanation of the error. If this is NULL, we'll
+ * just use the standard meaning of the error code.
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_send_error(struct evhttp_request *req, int error,
+ const char *reason);
+
+/**
+ * Send an HTML reply to the client.
+ *
+ * The body of the reply consists of the data in databuf. After calling
+ * evhttp_send_reply() databuf will be empty, but the buffer is still
+ * owned by the caller and needs to be deallocated by the caller if
+ * necessary.
+ *
+ * @param req a request object
+ * @param code the HTTP response code to send
+ * @param reason a brief message to send with the response code
+ * @param databuf the body of the response
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_send_reply(struct evhttp_request *req, int code,
+ const char *reason, struct evbuffer *databuf);
+
+/* Low-level response interface, for streaming/chunked replies */
+
+/**
+ Initiate a reply that uses Transfer-Encoding chunked.
+
+ This allows the caller to stream the reply back to the client and is
+ useful when either not all of the reply data is immediately available
+ or when sending very large replies.
+
+ The caller needs to supply data chunks with evhttp_send_reply_chunk()
+ and complete the reply by calling evhttp_send_reply_end().
+
+ @param req a request object
+ @param code the HTTP response code to send
+ @param reason a brief message to send with the response code
+*/
+EVENT2_EXPORT_SYMBOL
+void evhttp_send_reply_start(struct evhttp_request *req, int code,
+ const char *reason);
+
+/**
+ Send another data chunk as part of an ongoing chunked reply.
+
+ The reply chunk consists of the data in databuf. After calling
+ evhttp_send_reply_chunk() databuf will be empty, but the buffer is
+ still owned by the caller and needs to be deallocated by the caller
+ if necessary.
+
+ @param req a request object
+ @param databuf the data chunk to send as part of the reply.
+*/
+EVENT2_EXPORT_SYMBOL
+void evhttp_send_reply_chunk(struct evhttp_request *req,
+ struct evbuffer *databuf);
+
+/**
+ Send another data chunk as part of an ongoing chunked reply.
+
+ The reply chunk consists of the data in databuf. After calling
+ evhttp_send_reply_chunk() databuf will be empty, but the buffer is
+ still owned by the caller and needs to be deallocated by the caller
+ if necessary.
+
+ @param req a request object
+ @param databuf the data chunk to send as part of the reply.
+ @param cb callback funcion
+ @param call back's argument.
+*/
+EVENT2_EXPORT_SYMBOL
+void evhttp_send_reply_chunk_with_cb(struct evhttp_request *, struct evbuffer *,
+ void (*cb)(struct evhttp_connection *, void *), void *arg);
+
+/**
+ Complete a chunked reply, freeing the request as appropriate.
+
+ @param req a request object
+*/
+EVENT2_EXPORT_SYMBOL
+void evhttp_send_reply_end(struct evhttp_request *req);
+
+/*
+ * Interfaces for making requests
+ */
+
+/** The different request types supported by evhttp. These are as specified
+ * in RFC2616, except for PATCH which is specified by RFC5789.
+ *
+ * By default, only some of these methods are accepted and passed to user
+ * callbacks; use evhttp_set_allowed_methods() to change which methods
+ * are allowed.
+ */
+enum evhttp_cmd_type {
+ EVHTTP_REQ_GET = 1 << 0,
+ EVHTTP_REQ_POST = 1 << 1,
+ EVHTTP_REQ_HEAD = 1 << 2,
+ EVHTTP_REQ_PUT = 1 << 3,
+ EVHTTP_REQ_DELETE = 1 << 4,
+ EVHTTP_REQ_OPTIONS = 1 << 5,
+ EVHTTP_REQ_TRACE = 1 << 6,
+ EVHTTP_REQ_CONNECT = 1 << 7,
+ EVHTTP_REQ_PATCH = 1 << 8
+};
+
+/** a request object can represent either a request or a reply */
+enum evhttp_request_kind { EVHTTP_REQUEST, EVHTTP_RESPONSE };
+
+/**
+ * Create and return a connection object that can be used to for making HTTP
+ * requests. The connection object tries to resolve address and establish the
+ * connection when it is given an http request object.
+ *
+ * @param base the event_base to use for handling the connection
+ * @param dnsbase the dns_base to use for resolving host names; if not
+ * specified host name resolution will block.
+ * @param bev a bufferevent to use for connecting to the server; if NULL, a
+ * socket-based bufferevent will be created. This buffrevent will be freed
+ * when the connection closes. It must have no fd set on it.
+ * @param address the address to which to connect
+ * @param port the port to connect to
+ * @return an evhttp_connection object that can be used for making requests
+ */
+EVENT2_EXPORT_SYMBOL
+struct evhttp_connection *evhttp_connection_base_bufferevent_new(
+ struct event_base *base, struct evdns_base *dnsbase, struct bufferevent* bev, const char *address, unsigned short port);
+
+/**
+ * Return the bufferevent that an evhttp_connection is using.
+ */
+EVENT2_EXPORT_SYMBOL
+struct bufferevent* evhttp_connection_get_bufferevent(struct evhttp_connection *evcon);
+
+/**
+ * Return the HTTP server associated with this connection, or NULL.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evhttp *evhttp_connection_get_server(struct evhttp_connection *evcon);
+
+/**
+ * Creates a new request object that needs to be filled in with the request
+ * parameters. The callback is executed when the request completed or an
+ * error occurred.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evhttp_request *evhttp_request_new(
+ void (*cb)(struct evhttp_request *, void *), void *arg);
+
+/**
+ * Enable delivery of chunks to requestor.
+ * @param cb will be called after every read of data with the same argument
+ * as the completion callback. Will never be called on an empty
+ * response. May drain the input buffer; it will be drained
+ * automatically on return.
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_request_set_chunked_cb(struct evhttp_request *,
+ void (*cb)(struct evhttp_request *, void *));
+
+/**
+ * Register callback for additional parsing of request headers.
+ * @param cb will be called after receiving and parsing the full header.
+ * It allows analyzing the header and possibly closing the connection
+ * by returning a value < 0.
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_request_set_header_cb(struct evhttp_request *,
+ int (*cb)(struct evhttp_request *, void *));
+
+/**
+ * The different error types supported by evhttp
+ *
+ * @see evhttp_request_set_error_cb()
+ */
+enum evhttp_request_error {
+ /**
+ * Timeout reached, also @see evhttp_connection_set_timeout()
+ */
+ EVREQ_HTTP_TIMEOUT,
+ /**
+ * EOF reached
+ */
+ EVREQ_HTTP_EOF,
+ /**
+ * Error while reading header, or invalid header
+ */
+ EVREQ_HTTP_INVALID_HEADER,
+ /**
+ * Error encountered while reading or writing
+ */
+ EVREQ_HTTP_BUFFER_ERROR,
+ /**
+ * The evhttp_cancel_request() called on this request.
+ */
+ EVREQ_HTTP_REQUEST_CANCEL,
+ /**
+ * Body is greater then evhttp_connection_set_max_body_size()
+ */
+ EVREQ_HTTP_DATA_TOO_LONG
+};
+/**
+ * Set a callback for errors
+ * @see evhttp_request_error for error types.
+ *
+ * On error, both the error callback and the regular callback will be called,
+ * error callback is called before the regular callback.
+ **/
+EVENT2_EXPORT_SYMBOL
+void evhttp_request_set_error_cb(struct evhttp_request *,
+ void (*)(enum evhttp_request_error, void *));
+
+/**
+ * Set a callback to be called on request completion of evhttp_send_* function.
+ *
+ * The callback function will be called on the completion of the request after
+ * the output data has been written and before the evhttp_request object
+ * is destroyed. This can be useful for tracking resources associated with a
+ * request (ex: timing metrics).
+ *
+ * @param req a request object
+ * @param cb callback function that will be called on request completion
+ * @param cb_arg an additional context argument for the callback
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_request_set_on_complete_cb(struct evhttp_request *req,
+ void (*cb)(struct evhttp_request *, void *), void *cb_arg);
+
+/** Frees the request object and removes associated events. */
+EVENT2_EXPORT_SYMBOL
+void evhttp_request_free(struct evhttp_request *req);
+
+/**
+ * Create and return a connection object that can be used to for making HTTP
+ * requests. The connection object tries to resolve address and establish the
+ * connection when it is given an http request object.
+ *
+ * @param base the event_base to use for handling the connection
+ * @param dnsbase the dns_base to use for resolving host names; if not
+ * specified host name resolution will block.
+ * @param address the address to which to connect
+ * @param port the port to connect to
+ * @return an evhttp_connection object that can be used for making requests
+ */
+EVENT2_EXPORT_SYMBOL
+struct evhttp_connection *evhttp_connection_base_new(
+ struct event_base *base, struct evdns_base *dnsbase,
+ const char *address, unsigned short port);
+
+/**
+ * Set family hint for DNS requests.
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_set_family(struct evhttp_connection *evcon,
+ int family);
+
+/* reuse connection address on retry */
+#define EVHTTP_CON_REUSE_CONNECTED_ADDR 0x0008
+/* Padding for public flags, @see EVHTTP_CON_* in http-internal.h */
+#define EVHTTP_CON_PUBLIC_FLAGS_END 0x100000
+/**
+ * Set connection flags.
+ *
+ * @see EVHTTP_CON_*
+ * @return 0 on success, otherwise non zero (for example if flag doesn't
+ * supported).
+ */
+EVENT2_EXPORT_SYMBOL
+int evhttp_connection_set_flags(struct evhttp_connection *evcon,
+ int flags);
+
+/** Takes ownership of the request object
+ *
+ * Can be used in a request callback to keep onto the request until
+ * evhttp_request_free() is explicitly called by the user.
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_request_own(struct evhttp_request *req);
+
+/** Returns 1 if the request is owned by the user */
+EVENT2_EXPORT_SYMBOL
+int evhttp_request_is_owned(struct evhttp_request *req);
+
+/**
+ * Returns the connection object associated with the request or NULL
+ *
+ * The user needs to either free the request explicitly or call
+ * evhttp_send_reply_end().
+ */
+EVENT2_EXPORT_SYMBOL
+struct evhttp_connection *evhttp_request_get_connection(struct evhttp_request *req);
+
+/**
+ * Returns the underlying event_base for this connection
+ */
+EVENT2_EXPORT_SYMBOL
+struct event_base *evhttp_connection_get_base(struct evhttp_connection *req);
+
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_set_max_headers_size(struct evhttp_connection *evcon,
+ ev_ssize_t new_max_headers_size);
+
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_set_max_body_size(struct evhttp_connection* evcon,
+ ev_ssize_t new_max_body_size);
+
+/** Frees an http connection */
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_free(struct evhttp_connection *evcon);
+
+/** Disowns a given connection object
+ *
+ * Can be used to tell libevent to free the connection object after
+ * the last request has completed or failed.
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_free_on_completion(struct evhttp_connection *evcon);
+
+/** sets the ip address from which http connections are made */
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_set_local_address(struct evhttp_connection *evcon,
+ const char *address);
+
+/** sets the local port from which http connections are made */
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_set_local_port(struct evhttp_connection *evcon,
+ ev_uint16_t port);
+
+/** Sets the timeout in seconds for events related to this connection */
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_set_timeout(struct evhttp_connection *evcon,
+ int timeout_in_secs);
+
+/** Sets the timeout for events related to this connection. Takes a struct
+ * timeval. */
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_set_timeout_tv(struct evhttp_connection *evcon,
+ const struct timeval *tv);
+
+/** Sets the delay before retrying requests on this connection. This is only
+ * used if evhttp_connection_set_retries is used to make the number of retries
+ * at least one. Each retry after the first is twice as long as the one before
+ * it. */
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_set_initial_retry_tv(struct evhttp_connection *evcon,
+ const struct timeval *tv);
+
+/** Sets the retry limit for this connection - -1 repeats indefinitely */
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_set_retries(struct evhttp_connection *evcon,
+ int retry_max);
+
+/** Set a callback for connection close. */
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_set_closecb(struct evhttp_connection *evcon,
+ void (*)(struct evhttp_connection *, void *), void *);
+
+/** Get the remote address and port associated with this connection. */
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_get_peer(struct evhttp_connection *evcon,
+ char **address, ev_uint16_t *port);
+
+/** Get the remote address associated with this connection.
+ * extracted from getpeername() OR from nameserver.
+ *
+ * @return NULL if getpeername() return non success,
+ * or connection is not connected,
+ * otherwise it return pointer to struct sockaddr_storage */
+EVENT2_EXPORT_SYMBOL
+const struct sockaddr*
+evhttp_connection_get_addr(struct evhttp_connection *evcon);
+
+/**
+ Make an HTTP request over the specified connection.
+
+ The connection gets ownership of the request. On failure, the
+ request object is no longer valid as it has been freed.
+
+ @param evcon the evhttp_connection object over which to send the request
+ @param req the previously created and configured request object
+ @param type the request type EVHTTP_REQ_GET, EVHTTP_REQ_POST, etc.
+ @param uri the URI associated with the request
+ @return 0 on success, -1 on failure
+ @see evhttp_cancel_request()
+*/
+EVENT2_EXPORT_SYMBOL
+int evhttp_make_request(struct evhttp_connection *evcon,
+ struct evhttp_request *req,
+ enum evhttp_cmd_type type, const char *uri);
+
+/**
+ Cancels a pending HTTP request.
+
+ Cancels an ongoing HTTP request. The callback associated with this request
+ is not executed and the request object is freed. If the request is
+ currently being processed, e.g. it is ongoing, the corresponding
+ evhttp_connection object is going to get reset.
+
+ A request cannot be canceled if its callback has executed already. A request
+ may be canceled reentrantly from its chunked callback.
+
+ @param req the evhttp_request to cancel; req becomes invalid after this call.
+*/
+EVENT2_EXPORT_SYMBOL
+void evhttp_cancel_request(struct evhttp_request *req);
+
+/**
+ * A structure to hold a parsed URI or Relative-Ref conforming to RFC3986.
+ */
+struct evhttp_uri;
+
+/** Returns the request URI */
+EVENT2_EXPORT_SYMBOL
+const char *evhttp_request_get_uri(const struct evhttp_request *req);
+/** Returns the request URI (parsed) */
+EVENT2_EXPORT_SYMBOL
+const struct evhttp_uri *evhttp_request_get_evhttp_uri(const struct evhttp_request *req);
+/** Returns the request command */
+EVENT2_EXPORT_SYMBOL
+enum evhttp_cmd_type evhttp_request_get_command(const struct evhttp_request *req);
+
+EVENT2_EXPORT_SYMBOL
+int evhttp_request_get_response_code(const struct evhttp_request *req);
+EVENT2_EXPORT_SYMBOL
+const char * evhttp_request_get_response_code_line(const struct evhttp_request *req);
+
+/** Returns the input headers */
+EVENT2_EXPORT_SYMBOL
+struct evkeyvalq *evhttp_request_get_input_headers(struct evhttp_request *req);
+/** Returns the output headers */
+EVENT2_EXPORT_SYMBOL
+struct evkeyvalq *evhttp_request_get_output_headers(struct evhttp_request *req);
+/** Returns the input buffer */
+EVENT2_EXPORT_SYMBOL
+struct evbuffer *evhttp_request_get_input_buffer(struct evhttp_request *req);
+/** Returns the output buffer */
+EVENT2_EXPORT_SYMBOL
+struct evbuffer *evhttp_request_get_output_buffer(struct evhttp_request *req);
+/** Returns the host associated with the request. If a client sends an absolute
+ URI, the host part of that is preferred. Otherwise, the input headers are
+ searched for a Host: header. NULL is returned if no absolute URI or Host:
+ header is provided. */
+EVENT2_EXPORT_SYMBOL
+const char *evhttp_request_get_host(struct evhttp_request *req);
+
+/* Interfaces for dealing with HTTP headers */
+
+/**
+ Finds the value belonging to a header.
+
+ @param headers the evkeyvalq object in which to find the header
+ @param key the name of the header to find
+ @returns a pointer to the value for the header or NULL if the header
+ could not be found.
+ @see evhttp_add_header(), evhttp_remove_header()
+*/
+EVENT2_EXPORT_SYMBOL
+const char *evhttp_find_header(const struct evkeyvalq *headers,
+ const char *key);
+
+/**
+ Removes a header from a list of existing headers.
+
+ @param headers the evkeyvalq object from which to remove a header
+ @param key the name of the header to remove
+ @returns 0 if the header was removed, -1 otherwise.
+ @see evhttp_find_header(), evhttp_add_header()
+*/
+EVENT2_EXPORT_SYMBOL
+int evhttp_remove_header(struct evkeyvalq *headers, const char *key);
+
+/**
+ Adds a header to a list of existing headers.
+
+ @param headers the evkeyvalq object to which to add a header
+ @param key the name of the header
+ @param value the value belonging to the header
+ @returns 0 on success, -1 otherwise.
+ @see evhttp_find_header(), evhttp_clear_headers()
+*/
+EVENT2_EXPORT_SYMBOL
+int evhttp_add_header(struct evkeyvalq *headers, const char *key, const char *value);
+
+/**
+ Removes all headers from the header list.
+
+ @param headers the evkeyvalq object from which to remove all headers
+*/
+EVENT2_EXPORT_SYMBOL
+void evhttp_clear_headers(struct evkeyvalq *headers);
+
+/* Miscellaneous utility functions */
+
+
+/**
+ Helper function to encode a string for inclusion in a URI. All
+ characters are replaced by their hex-escaped (%22) equivalents,
+ except for characters explicitly unreserved by RFC3986 -- that is,
+ ASCII alphanumeric characters, hyphen, dot, underscore, and tilde.
+
+ The returned string must be freed by the caller.
+
+ @param str an unencoded string
+ @return a newly allocated URI-encoded string or NULL on failure
+ */
+EVENT2_EXPORT_SYMBOL
+char *evhttp_encode_uri(const char *str);
+
+/**
+ As evhttp_encode_uri, but if 'size' is nonnegative, treat the string
+ as being 'size' bytes long. This allows you to encode strings that
+ may contain 0-valued bytes.
+
+ The returned string must be freed by the caller.
+
+ @param str an unencoded string
+ @param size the length of the string to encode, or -1 if the string
+ is NUL-terminated
+ @param space_to_plus if true, space characters in 'str' are encoded
+ as +, not %20.
+ @return a newly allocate URI-encoded string, or NULL on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+char *evhttp_uriencode(const char *str, ev_ssize_t size, int space_to_plus);
+
+/**
+ Helper function to sort of decode a URI-encoded string. Unlike
+ evhttp_get_decoded_uri, it decodes all plus characters that appear
+ _after_ the first question mark character, but no plusses that occur
+ before. This is not a good way to decode URIs in whole or in part.
+
+ The returned string must be freed by the caller
+
+ @deprecated This function is deprecated; you probably want to use
+ evhttp_get_decoded_uri instead.
+
+ @param uri an encoded URI
+ @return a newly allocated unencoded URI or NULL on failure
+ */
+EVENT2_EXPORT_SYMBOL
+char *evhttp_decode_uri(const char *uri);
+
+/**
+ Helper function to decode a URI-escaped string or HTTP parameter.
+
+ If 'decode_plus' is 1, then we decode the string as an HTTP parameter
+ value, and convert all plus ('+') characters to spaces. If
+ 'decode_plus' is 0, we leave all plus characters unchanged.
+
+ The returned string must be freed by the caller.
+
+ @param uri a URI-encode encoded URI
+ @param decode_plus determines whether we convert '+' to space.
+ @param size_out if size_out is not NULL, *size_out is set to the size of the
+ returned string
+ @return a newly allocated unencoded URI or NULL on failure
+ */
+EVENT2_EXPORT_SYMBOL
+char *evhttp_uridecode(const char *uri, int decode_plus,
+ size_t *size_out);
+
+/**
+ Helper function to parse out arguments in a query.
+
+ Parsing a URI like
+
+ http://foo.com/?q=test&s=some+thing
+
+ will result in two entries in the key value queue.
+
+ The first entry is: key="q", value="test"
+ The second entry is: key="s", value="some thing"
+
+ @deprecated This function is deprecated as of Libevent 2.0.9. Use
+ evhttp_uri_parse and evhttp_parse_query_str instead.
+
+ @param uri the request URI
+ @param headers the head of the evkeyval queue
+ @return 0 on success, -1 on failure
+ */
+EVENT2_EXPORT_SYMBOL
+int evhttp_parse_query(const char *uri, struct evkeyvalq *headers);
+
+/**
+ Helper function to parse out arguments from the query portion of an
+ HTTP URI.
+
+ Parsing a query string like
+
+ q=test&s=some+thing
+
+ will result in two entries in the key value queue.
+
+ The first entry is: key="q", value="test"
+ The second entry is: key="s", value="some thing"
+
+ @param query_parse the query portion of the URI
+ @param headers the head of the evkeyval queue
+ @return 0 on success, -1 on failure
+ */
+EVENT2_EXPORT_SYMBOL
+int evhttp_parse_query_str(const char *uri, struct evkeyvalq *headers);
+
+/**
+ * Escape HTML character entities in a string.
+ *
+ * Replaces <, >, ", ' and & with &lt;, &gt;, &quot;,
+ * &#039; and &amp; correspondingly.
+ *
+ * The returned string needs to be freed by the caller.
+ *
+ * @param html an unescaped HTML string
+ * @return an escaped HTML string or NULL on error
+ */
+EVENT2_EXPORT_SYMBOL
+char *evhttp_htmlescape(const char *html);
+
+/**
+ * Return a new empty evhttp_uri with no fields set.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evhttp_uri *evhttp_uri_new(void);
+
+/**
+ * Changes the flags set on a given URI. See EVHTTP_URI_* for
+ * a list of flags.
+ **/
+EVENT2_EXPORT_SYMBOL
+void evhttp_uri_set_flags(struct evhttp_uri *uri, unsigned flags);
+
+/** Return the scheme of an evhttp_uri, or NULL if there is no scheme has
+ * been set and the evhttp_uri contains a Relative-Ref. */
+EVENT2_EXPORT_SYMBOL
+const char *evhttp_uri_get_scheme(const struct evhttp_uri *uri);
+/**
+ * Return the userinfo part of an evhttp_uri, or NULL if it has no userinfo
+ * set.
+ */
+EVENT2_EXPORT_SYMBOL
+const char *evhttp_uri_get_userinfo(const struct evhttp_uri *uri);
+/**
+ * Return the host part of an evhttp_uri, or NULL if it has no host set.
+ * The host may either be a regular hostname (conforming to the RFC 3986
+ * "regname" production), or an IPv4 address, or the empty string, or a
+ * bracketed IPv6 address, or a bracketed 'IP-Future' address.
+ *
+ * Note that having a NULL host means that the URI has no authority
+ * section, but having an empty-string host means that the URI has an
+ * authority section with no host part. For example,
+ * "mailto:user@example.com" has a host of NULL, but "file:///etc/motd"
+ * has a host of "".
+ */
+EVENT2_EXPORT_SYMBOL
+const char *evhttp_uri_get_host(const struct evhttp_uri *uri);
+/** Return the port part of an evhttp_uri, or -1 if there is no port set. */
+EVENT2_EXPORT_SYMBOL
+int evhttp_uri_get_port(const struct evhttp_uri *uri);
+/** Return the path part of an evhttp_uri, or NULL if it has no path set */
+EVENT2_EXPORT_SYMBOL
+const char *evhttp_uri_get_path(const struct evhttp_uri *uri);
+/** Return the query part of an evhttp_uri (excluding the leading "?"), or
+ * NULL if it has no query set */
+EVENT2_EXPORT_SYMBOL
+const char *evhttp_uri_get_query(const struct evhttp_uri *uri);
+/** Return the fragment part of an evhttp_uri (excluding the leading "#"),
+ * or NULL if it has no fragment set */
+EVENT2_EXPORT_SYMBOL
+const char *evhttp_uri_get_fragment(const struct evhttp_uri *uri);
+
+/** Set the scheme of an evhttp_uri, or clear the scheme if scheme==NULL.
+ * Returns 0 on success, -1 if scheme is not well-formed. */
+EVENT2_EXPORT_SYMBOL
+int evhttp_uri_set_scheme(struct evhttp_uri *uri, const char *scheme);
+/** Set the userinfo of an evhttp_uri, or clear the userinfo if userinfo==NULL.
+ * Returns 0 on success, -1 if userinfo is not well-formed. */
+EVENT2_EXPORT_SYMBOL
+int evhttp_uri_set_userinfo(struct evhttp_uri *uri, const char *userinfo);
+/** Set the host of an evhttp_uri, or clear the host if host==NULL.
+ * Returns 0 on success, -1 if host is not well-formed. */
+EVENT2_EXPORT_SYMBOL
+int evhttp_uri_set_host(struct evhttp_uri *uri, const char *host);
+/** Set the port of an evhttp_uri, or clear the port if port==-1.
+ * Returns 0 on success, -1 if port is not well-formed. */
+EVENT2_EXPORT_SYMBOL
+int evhttp_uri_set_port(struct evhttp_uri *uri, int port);
+/** Set the path of an evhttp_uri, or clear the path if path==NULL.
+ * Returns 0 on success, -1 if path is not well-formed. */
+EVENT2_EXPORT_SYMBOL
+int evhttp_uri_set_path(struct evhttp_uri *uri, const char *path);
+/** Set the query of an evhttp_uri, or clear the query if query==NULL.
+ * The query should not include a leading "?".
+ * Returns 0 on success, -1 if query is not well-formed. */
+EVENT2_EXPORT_SYMBOL
+int evhttp_uri_set_query(struct evhttp_uri *uri, const char *query);
+/** Set the fragment of an evhttp_uri, or clear the fragment if fragment==NULL.
+ * The fragment should not include a leading "#".
+ * Returns 0 on success, -1 if fragment is not well-formed. */
+EVENT2_EXPORT_SYMBOL
+int evhttp_uri_set_fragment(struct evhttp_uri *uri, const char *fragment);
+
+/**
+ * Helper function to parse a URI-Reference as specified by RFC3986.
+ *
+ * This function matches the URI-Reference production from RFC3986,
+ * which includes both URIs like
+ *
+ * scheme://[[userinfo]@]foo.com[:port]]/[path][?query][#fragment]
+ *
+ * and relative-refs like
+ *
+ * [path][?query][#fragment]
+ *
+ * Any optional elements portions not present in the original URI are
+ * left set to NULL in the resulting evhttp_uri. If no port is
+ * specified, the port is set to -1.
+ *
+ * Note that no decoding is performed on percent-escaped characters in
+ * the string; if you want to parse them, use evhttp_uridecode or
+ * evhttp_parse_query_str as appropriate.
+ *
+ * Note also that most URI schemes will have additional constraints that
+ * this function does not know about, and cannot check. For example,
+ * mailto://www.example.com/cgi-bin/fortune.pl is not a reasonable
+ * mailto url, http://www.example.com:99999/ is not a reasonable HTTP
+ * URL, and ftp:username@example.com is not a reasonable FTP URL.
+ * Nevertheless, all of these URLs conform to RFC3986, and this function
+ * accepts all of them as valid.
+ *
+ * @param source_uri the request URI
+ * @param flags Zero or more EVHTTP_URI_* flags to affect the behavior
+ * of the parser.
+ * @return uri container to hold parsed data, or NULL if there is error
+ * @see evhttp_uri_free()
+ */
+EVENT2_EXPORT_SYMBOL
+struct evhttp_uri *evhttp_uri_parse_with_flags(const char *source_uri,
+ unsigned flags);
+
+/** Tolerate URIs that do not conform to RFC3986.
+ *
+ * Unfortunately, some HTTP clients generate URIs that, according to RFC3986,
+ * are not conformant URIs. If you need to support these URIs, you can
+ * do so by passing this flag to evhttp_uri_parse_with_flags.
+ *
+ * Currently, these changes are:
+ * <ul>
+ * <li> Nonconformant URIs are allowed to contain otherwise unreasonable
+ * characters in their path, query, and fragment components.
+ * </ul>
+ */
+#define EVHTTP_URI_NONCONFORMANT 0x01
+
+/** Alias for evhttp_uri_parse_with_flags(source_uri, 0) */
+EVENT2_EXPORT_SYMBOL
+struct evhttp_uri *evhttp_uri_parse(const char *source_uri);
+
+/**
+ * Free all memory allocated for a parsed uri. Only use this for URIs
+ * generated by evhttp_uri_parse.
+ *
+ * @param uri container with parsed data
+ * @see evhttp_uri_parse()
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_uri_free(struct evhttp_uri *uri);
+
+/**
+ * Join together the uri parts from parsed data to form a URI-Reference.
+ *
+ * Note that no escaping of reserved characters is done on the members
+ * of the evhttp_uri, so the generated string might not be a valid URI
+ * unless the members of evhttp_uri are themselves valid.
+ *
+ * @param uri container with parsed data
+ * @param buf destination buffer
+ * @param limit destination buffer size
+ * @return an joined uri as string or NULL on error
+ * @see evhttp_uri_parse()
+ */
+EVENT2_EXPORT_SYMBOL
+char *evhttp_uri_join(struct evhttp_uri *uri, char *buf, size_t limit);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_HTTP_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/include/event2/http_compat.h b/protocols/Telegram/tgl/libevent/include/event2/http_compat.h
new file mode 100644
index 0000000000..0d9af17f3f
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/event2/http_compat.h
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVENT2_HTTP_COMPAT_H_INCLUDED_
+#define EVENT2_HTTP_COMPAT_H_INCLUDED_
+
+/** @file event2/http_compat.h
+
+ Potentially non-threadsafe versions of the functions in http.h: provided
+ only for backwards compatibility.
+
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event-config.h>
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+/* For int types. */
+#include <event2/util.h>
+
+/**
+ * Start an HTTP server on the specified address and port
+ *
+ * @deprecated It does not allow an event base to be specified
+ *
+ * @param address the address to which the HTTP server should be bound
+ * @param port the port number on which the HTTP server should listen
+ * @return an struct evhttp object
+ */
+struct evhttp *evhttp_start(const char *address, unsigned short port);
+
+/**
+ * A connection object that can be used to for making HTTP requests. The
+ * connection object tries to establish the connection when it is given an
+ * http request object.
+ *
+ * @deprecated It does not allow an event base to be specified
+ */
+struct evhttp_connection *evhttp_connection_new(
+ const char *address, unsigned short port);
+
+/**
+ * Associates an event base with the connection - can only be called
+ * on a freshly created connection object that has not been used yet.
+ *
+ * @deprecated XXXX Why?
+ */
+void evhttp_connection_set_base(struct evhttp_connection *evcon,
+ struct event_base *base);
+
+
+/** Returns the request URI */
+#define evhttp_request_uri evhttp_request_get_uri
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_EVENT_COMPAT_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/include/event2/http_struct.h b/protocols/Telegram/tgl/libevent/include/event2/http_struct.h
new file mode 100644
index 0000000000..4bf5b1ff60
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/event2/http_struct.h
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVENT2_HTTP_STRUCT_H_INCLUDED_
+#define EVENT2_HTTP_STRUCT_H_INCLUDED_
+
+/** @file event2/http_struct.h
+
+ Data structures for http. Using these structures may hurt forward
+ compatibility with later versions of Libevent: be careful!
+
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event-config.h>
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+/* For int types. */
+#include <event2/util.h>
+
+/**
+ * the request structure that a server receives.
+ * WARNING: expect this structure to change. I will try to provide
+ * reasonable accessors.
+ */
+struct evhttp_request {
+#if defined(TAILQ_ENTRY)
+ TAILQ_ENTRY(evhttp_request) next;
+#else
+struct {
+ struct evhttp_request *tqe_next;
+ struct evhttp_request **tqe_prev;
+} next;
+#endif
+
+ /* the connection object that this request belongs to */
+ struct evhttp_connection *evcon;
+ int flags;
+/** The request obj owns the evhttp connection and needs to free it */
+#define EVHTTP_REQ_OWN_CONNECTION 0x0001
+/** Request was made via a proxy */
+#define EVHTTP_PROXY_REQUEST 0x0002
+/** The request object is owned by the user; the user must free it */
+#define EVHTTP_USER_OWNED 0x0004
+/** The request will be used again upstack; freeing must be deferred */
+#define EVHTTP_REQ_DEFER_FREE 0x0008
+/** The request should be freed upstack */
+#define EVHTTP_REQ_NEEDS_FREE 0x0010
+
+ struct evkeyvalq *input_headers;
+ struct evkeyvalq *output_headers;
+
+ /* address of the remote host and the port connection came from */
+ char *remote_host;
+ ev_uint16_t remote_port;
+
+ /* cache of the hostname for evhttp_request_get_host */
+ char *host_cache;
+
+ enum evhttp_request_kind kind;
+ enum evhttp_cmd_type type;
+
+ size_t headers_size;
+ size_t body_size;
+
+ char *uri; /* uri after HTTP request was parsed */
+ struct evhttp_uri *uri_elems; /* uri elements */
+
+ char major; /* HTTP Major number */
+ char minor; /* HTTP Minor number */
+
+ int response_code; /* HTTP Response code */
+ char *response_code_line; /* Readable response */
+
+ struct evbuffer *input_buffer; /* read data */
+ ev_int64_t ntoread;
+ unsigned chunked:1, /* a chunked request */
+ userdone:1; /* the user has sent all data */
+
+ struct evbuffer *output_buffer; /* outgoing post or data */
+
+ /* Callback */
+ void (*cb)(struct evhttp_request *, void *);
+ void *cb_arg;
+
+ /*
+ * Chunked data callback - call for each completed chunk if
+ * specified. If not specified, all the data is delivered via
+ * the regular callback.
+ */
+ void (*chunk_cb)(struct evhttp_request *, void *);
+
+ /*
+ * Callback added for forked-daapd so they can collect ICY
+ * (shoutcast) metadata from the http header. If return
+ * int is negative the connection will be closed.
+ */
+ int (*header_cb)(struct evhttp_request *, void *);
+
+ /*
+ * Error callback - called when error is occured.
+ * @see evhttp_request_error for error types.
+ *
+ * @see evhttp_request_set_error_cb()
+ */
+ void (*error_cb)(enum evhttp_request_error, void *);
+
+ /*
+ * Send complete callback - called when the request is actually
+ * sent and completed.
+ */
+ void (*on_complete_cb)(struct evhttp_request *, void *);
+ void *on_complete_cb_arg;
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_HTTP_STRUCT_H_INCLUDED_ */
+
diff --git a/protocols/Telegram/tgl/libevent/include/event2/keyvalq_struct.h b/protocols/Telegram/tgl/libevent/include/event2/keyvalq_struct.h
new file mode 100644
index 0000000000..bffa54b3a7
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/event2/keyvalq_struct.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVENT2_KEYVALQ_STRUCT_H_INCLUDED_
+#define EVENT2_KEYVALQ_STRUCT_H_INCLUDED_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Fix so that people don't have to run with <sys/queue.h> */
+/* XXXX This code is duplicated with event_struct.h */
+#ifndef TAILQ_ENTRY
+#define EVENT_DEFINED_TQENTRY_
+#define TAILQ_ENTRY(type) \
+struct { \
+ struct type *tqe_next; /* next element */ \
+ struct type **tqe_prev; /* address of previous next element */ \
+}
+#endif /* !TAILQ_ENTRY */
+
+#ifndef TAILQ_HEAD
+#define EVENT_DEFINED_TQHEAD_
+#define TAILQ_HEAD(name, type) \
+struct name { \
+ struct type *tqh_first; \
+ struct type **tqh_last; \
+}
+#endif
+
+/*
+ * Key-Value pairs. Can be used for HTTP headers but also for
+ * query argument parsing.
+ */
+struct evkeyval {
+ TAILQ_ENTRY(evkeyval) next;
+
+ char *key;
+ char *value;
+};
+
+TAILQ_HEAD (evkeyvalq, evkeyval);
+
+/* XXXX This code is duplicated with event_struct.h */
+#ifdef EVENT_DEFINED_TQENTRY_
+#undef TAILQ_ENTRY
+#endif
+
+#ifdef EVENT_DEFINED_TQHEAD_
+#undef TAILQ_HEAD
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/libevent/include/event2/listener.h b/protocols/Telegram/tgl/libevent/include/event2/listener.h
new file mode 100644
index 0000000000..84b4da055d
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/event2/listener.h
@@ -0,0 +1,180 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVENT2_LISTENER_H_INCLUDED_
+#define EVENT2_LISTENER_H_INCLUDED_
+
+#include <event2/visibility.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event.h>
+
+struct sockaddr;
+struct evconnlistener;
+
+/**
+ A callback that we invoke when a listener has a new connection.
+
+ @param listener The evconnlistener
+ @param fd The new file descriptor
+ @param addr The source address of the connection
+ @param socklen The length of addr
+ @param user_arg the pointer passed to evconnlistener_new()
+ */
+typedef void (*evconnlistener_cb)(struct evconnlistener *, evutil_socket_t, struct sockaddr *, int socklen, void *);
+
+/**
+ A callback that we invoke when a listener encounters a non-retriable error.
+
+ @param listener The evconnlistener
+ @param user_arg the pointer passed to evconnlistener_new()
+ */
+typedef void (*evconnlistener_errorcb)(struct evconnlistener *, void *);
+
+/** Flag: Indicates that we should not make incoming sockets nonblocking
+ * before passing them to the callback. */
+#define LEV_OPT_LEAVE_SOCKETS_BLOCKING (1u<<0)
+/** Flag: Indicates that freeing the listener should close the underlying
+ * socket. */
+#define LEV_OPT_CLOSE_ON_FREE (1u<<1)
+/** Flag: Indicates that we should set the close-on-exec flag, if possible */
+#define LEV_OPT_CLOSE_ON_EXEC (1u<<2)
+/** Flag: Indicates that we should disable the timeout (if any) between when
+ * this socket is closed and when we can listen again on the same port. */
+#define LEV_OPT_REUSEABLE (1u<<3)
+/** Flag: Indicates that the listener should be locked so it's safe to use
+ * from multiple threadcs at once. */
+#define LEV_OPT_THREADSAFE (1u<<4)
+/** Flag: Indicates that the listener should be created in disabled
+ * state. Use evconnlistener_enable() to enable it later. */
+#define LEV_OPT_DISABLED (1u<<5)
+/** Flag: Indicates that the listener should defer accept() until data is
+ * available, if possible. Ignored on platforms that do not support this.
+ *
+ * This option can help performance for protocols where the client transmits
+ * immediately after connecting. Do not use this option if your protocol
+ * _doesn't_ start out with the client transmitting data, since in that case
+ * this option will sometimes cause the kernel to never tell you about the
+ * connection.
+ *
+ * This option is only supported by evconnlistener_new_bind(): it can't
+ * work with evconnlistener_new_fd(), since the listener needs to be told
+ * to use the option before it is actually bound.
+ */
+#define LEV_OPT_DEFERRED_ACCEPT (1u<<6)
+/** Flag: Indicates that we ask to allow multiple servers (processes or
+ * threads) to bind to the same port if they each set the option.
+ *
+ * SO_REUSEPORT is what most people would expect SO_REUSEADDR to be, however
+ * SO_REUSEPORT does not imply SO_REUSEADDR.
+ *
+ * This is only available on Linux and kernel 3.9+
+ */
+#define LEV_OPT_REUSEABLE_PORT (1u<<7)
+
+/**
+ Allocate a new evconnlistener object to listen for incoming TCP connections
+ on a given file descriptor.
+
+ @param base The event base to associate the listener with.
+ @param cb A callback to be invoked when a new connection arrives. If the
+ callback is NULL, the listener will be treated as disabled until the
+ callback is set.
+ @param ptr A user-supplied pointer to give to the callback.
+ @param flags Any number of LEV_OPT_* flags
+ @param backlog Passed to the listen() call to determine the length of the
+ acceptable connection backlog. Set to -1 for a reasonable default.
+ Set to 0 if the socket is already listening.
+ @param fd The file descriptor to listen on. It must be a nonblocking
+ file descriptor, and it should already be bound to an appropriate
+ port and address.
+*/
+EVENT2_EXPORT_SYMBOL
+struct evconnlistener *evconnlistener_new(struct event_base *base,
+ evconnlistener_cb cb, void *ptr, unsigned flags, int backlog,
+ evutil_socket_t fd);
+/**
+ Allocate a new evconnlistener object to listen for incoming TCP connections
+ on a given address.
+
+ @param base The event base to associate the listener with.
+ @param cb A callback to be invoked when a new connection arrives. If the
+ callback is NULL, the listener will be treated as disabled until the
+ callback is set.
+ @param ptr A user-supplied pointer to give to the callback.
+ @param flags Any number of LEV_OPT_* flags
+ @param backlog Passed to the listen() call to determine the length of the
+ acceptable connection backlog. Set to -1 for a reasonable default.
+ @param addr The address to listen for connections on.
+ @param socklen The length of the address.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evconnlistener *evconnlistener_new_bind(struct event_base *base,
+ evconnlistener_cb cb, void *ptr, unsigned flags, int backlog,
+ const struct sockaddr *sa, int socklen);
+/**
+ Disable and deallocate an evconnlistener.
+ */
+EVENT2_EXPORT_SYMBOL
+void evconnlistener_free(struct evconnlistener *lev);
+/**
+ Re-enable an evconnlistener that has been disabled.
+ */
+EVENT2_EXPORT_SYMBOL
+int evconnlistener_enable(struct evconnlistener *lev);
+/**
+ Stop listening for connections on an evconnlistener.
+ */
+EVENT2_EXPORT_SYMBOL
+int evconnlistener_disable(struct evconnlistener *lev);
+
+/** Return an evconnlistener's associated event_base. */
+EVENT2_EXPORT_SYMBOL
+struct event_base *evconnlistener_get_base(struct evconnlistener *lev);
+
+/** Return the socket that an evconnlistner is listening on. */
+EVENT2_EXPORT_SYMBOL
+evutil_socket_t evconnlistener_get_fd(struct evconnlistener *lev);
+
+/** Change the callback on the listener to cb and its user_data to arg.
+ */
+EVENT2_EXPORT_SYMBOL
+void evconnlistener_set_cb(struct evconnlistener *lev,
+ evconnlistener_cb cb, void *arg);
+
+/** Set an evconnlistener's error callback. */
+EVENT2_EXPORT_SYMBOL
+void evconnlistener_set_error_cb(struct evconnlistener *lev,
+ evconnlistener_errorcb errorcb);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/libevent/include/event2/rpc.h b/protocols/Telegram/tgl/libevent/include/event2/rpc.h
new file mode 100644
index 0000000000..dd43df266a
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/event2/rpc.h
@@ -0,0 +1,596 @@
+/*
+ * Copyright (c) 2006-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVENT2_RPC_H_INCLUDED_
+#define EVENT2_RPC_H_INCLUDED_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @file rpc.h
+ *
+ * This header files provides basic support for an RPC server and client.
+ *
+ * To support RPCs in a server, every supported RPC command needs to be
+ * defined and registered.
+ *
+ * EVRPC_HEADER(SendCommand, Request, Reply);
+ *
+ * SendCommand is the name of the RPC command.
+ * Request is the name of a structure generated by event_rpcgen.py.
+ * It contains all parameters relating to the SendCommand RPC. The
+ * server needs to fill in the Reply structure.
+ * Reply is the name of a structure generated by event_rpcgen.py. It
+ * contains the answer to the RPC.
+ *
+ * To register an RPC with an HTTP server, you need to first create an RPC
+ * base with:
+ *
+ * struct evrpc_base *base = evrpc_init(http);
+ *
+ * A specific RPC can then be registered with
+ *
+ * EVRPC_REGISTER(base, SendCommand, Request, Reply, FunctionCB, arg);
+ *
+ * when the server receives an appropriately formatted RPC, the user callback
+ * is invoked. The callback needs to fill in the reply structure.
+ *
+ * void FunctionCB(EVRPC_STRUCT(SendCommand)* rpc, void *arg);
+ *
+ * To send the reply, call EVRPC_REQUEST_DONE(rpc);
+ *
+ * See the regression test for an example.
+ */
+
+/**
+ Determines if the member has been set in the message
+
+ @param msg the message to inspect
+ @param member the member variable to test for presences
+ @return 1 if it's present or 0 otherwise.
+*/
+#define EVTAG_HAS(msg, member) \
+ ((msg)->member##_set == 1)
+
+#ifndef EVENT2_RPC_COMPAT_H_INCLUDED_
+
+/**
+ Assigns a value to the member in the message.
+
+ @param msg the message to which to assign a value
+ @param member the name of the member variable
+ @param value the value to assign
+*/
+#define EVTAG_ASSIGN(msg, member, value) \
+ (*(msg)->base->member##_assign)((msg), (value))
+/**
+ Assigns a value to the member in the message.
+
+ @param msg the message to which to assign a value
+ @param member the name of the member variable
+ @param value the value to assign
+ @param len the length of the value
+*/
+#define EVTAG_ASSIGN_WITH_LEN(msg, member, value, len) \
+ (*(msg)->base->member##_assign)((msg), (value), (len))
+/**
+ Returns the value for a member.
+
+ @param msg the message from which to get the value
+ @param member the name of the member variable
+ @param pvalue a pointer to the variable to hold the value
+ @return 0 on success, -1 otherwise.
+*/
+#define EVTAG_GET(msg, member, pvalue) \
+ (*(msg)->base->member##_get)((msg), (pvalue))
+/**
+ Returns the value for a member.
+
+ @param msg the message from which to get the value
+ @param member the name of the member variable
+ @param pvalue a pointer to the variable to hold the value
+ @param plen a pointer to the length of the value
+ @return 0 on success, -1 otherwise.
+*/
+#define EVTAG_GET_WITH_LEN(msg, member, pvalue, plen) \
+ (*(msg)->base->member##_get)((msg), (pvalue), (plen))
+
+#endif /* EVENT2_RPC_COMPAT_H_INCLUDED_ */
+
+/**
+ Adds a value to an array.
+*/
+#define EVTAG_ARRAY_ADD_VALUE(msg, member, value) \
+ (*(msg)->base->member##_add)((msg), (value))
+/**
+ Allocates a new entry in the array and returns it.
+*/
+#define EVTAG_ARRAY_ADD(msg, member) \
+ (*(msg)->base->member##_add)(msg)
+/**
+ Gets a variable at the specified offset from the array.
+*/
+#define EVTAG_ARRAY_GET(msg, member, offset, pvalue) \
+ (*(msg)->base->member##_get)((msg), (offset), (pvalue))
+/**
+ Returns the number of entries in the array.
+*/
+#define EVTAG_ARRAY_LEN(msg, member) ((msg)->member##_length)
+
+
+struct evbuffer;
+struct event_base;
+struct evrpc_req_generic;
+struct evrpc_request_wrapper;
+struct evrpc;
+
+/** The type of a specific RPC Message
+ *
+ * @param rpcname the name of the RPC message
+ */
+#define EVRPC_STRUCT(rpcname) struct evrpc_req__##rpcname
+
+struct evhttp_request;
+struct evrpc_status;
+struct evrpc_hook_meta;
+
+/** Creates the definitions and prototypes for an RPC
+ *
+ * You need to use EVRPC_HEADER to create structures and function prototypes
+ * needed by the server and client implementation. The structures have to be
+ * defined in an .rpc file and converted to source code via event_rpcgen.py
+ *
+ * @param rpcname the name of the RPC
+ * @param reqstruct the name of the RPC request structure
+ * @param replystruct the name of the RPC reply structure
+ * @see EVRPC_GENERATE()
+ */
+#define EVRPC_HEADER(rpcname, reqstruct, rplystruct) \
+EVRPC_STRUCT(rpcname) { \
+ struct evrpc_hook_meta *hook_meta; \
+ struct reqstruct* request; \
+ struct rplystruct* reply; \
+ struct evrpc* rpc; \
+ struct evhttp_request* http_req; \
+ struct evbuffer* rpc_data; \
+}; \
+int evrpc_send_request_##rpcname(struct evrpc_pool *, \
+ struct reqstruct *, struct rplystruct *, \
+ void (*)(struct evrpc_status *, \
+ struct reqstruct *, struct rplystruct *, void *cbarg), \
+ void *);
+
+struct evrpc_pool;
+
+/** use EVRPC_GENERATE instead */
+struct evrpc_request_wrapper *evrpc_make_request_ctx(
+ struct evrpc_pool *pool, void *request, void *reply,
+ const char *rpcname,
+ void (*req_marshal)(struct evbuffer*, void *),
+ void (*rpl_clear)(void *),
+ int (*rpl_unmarshal)(void *, struct evbuffer *),
+ void (*cb)(struct evrpc_status *, void *, void *, void *),
+ void *cbarg);
+
+/** Creates a context structure that contains rpc specific information.
+ *
+ * EVRPC_MAKE_CTX is used to populate a RPC specific context that
+ * contains information about marshaling the RPC data types.
+ *
+ * @param rpcname the name of the RPC
+ * @param reqstruct the name of the RPC request structure
+ * @param replystruct the name of the RPC reply structure
+ * @param pool the evrpc_pool over which to make the request
+ * @param request a pointer to the RPC request structure object
+ * @param reply a pointer to the RPC reply structure object
+ * @param cb the callback function to call when the RPC has completed
+ * @param cbarg the argument to supply to the callback
+ */
+#define EVRPC_MAKE_CTX(rpcname, reqstruct, rplystruct, \
+ pool, request, reply, cb, cbarg) \
+ evrpc_make_request_ctx(pool, request, reply, \
+ #rpcname, \
+ (void (*)(struct evbuffer *, void *))reqstruct##_marshal, \
+ (void (*)(void *))rplystruct##_clear, \
+ (int (*)(void *, struct evbuffer *))rplystruct##_unmarshal, \
+ (void (*)(struct evrpc_status *, void *, void *, void *))cb, \
+ cbarg)
+
+/** Generates the code for receiving and sending an RPC message
+ *
+ * EVRPC_GENERATE is used to create the code corresponding to sending
+ * and receiving a particular RPC message
+ *
+ * @param rpcname the name of the RPC
+ * @param reqstruct the name of the RPC request structure
+ * @param replystruct the name of the RPC reply structure
+ * @see EVRPC_HEADER()
+ */
+#define EVRPC_GENERATE(rpcname, reqstruct, rplystruct) \
+ int evrpc_send_request_##rpcname(struct evrpc_pool *pool, \
+ struct reqstruct *request, struct rplystruct *reply, \
+ void (*cb)(struct evrpc_status *, \
+ struct reqstruct *, struct rplystruct *, void *cbarg), \
+ void *cbarg) { \
+ return evrpc_send_request_generic(pool, request, reply, \
+ (void (*)(struct evrpc_status *, void *, void *, void *))cb, \
+ cbarg, \
+ #rpcname, \
+ (void (*)(struct evbuffer *, void *))reqstruct##_marshal, \
+ (void (*)(void *))rplystruct##_clear, \
+ (int (*)(void *, struct evbuffer *))rplystruct##_unmarshal); \
+}
+
+/** Provides access to the HTTP request object underlying an RPC
+ *
+ * Access to the underlying http object; can be used to look at headers or
+ * for getting the remote ip address
+ *
+ * @param rpc_req the rpc request structure provided to the server callback
+ * @return an struct evhttp_request object that can be inspected for
+ * HTTP headers or sender information.
+ */
+#define EVRPC_REQUEST_HTTP(rpc_req) (rpc_req)->http_req
+
+/** completes the server response to an rpc request */
+void evrpc_request_done(struct evrpc_req_generic *req);
+
+/** accessors for request and reply */
+void *evrpc_get_request(struct evrpc_req_generic *req);
+void *evrpc_get_reply(struct evrpc_req_generic *req);
+
+/** Creates the reply to an RPC request
+ *
+ * EVRPC_REQUEST_DONE is used to answer a request; the reply is expected
+ * to have been filled in. The request and reply pointers become invalid
+ * after this call has finished.
+ *
+ * @param rpc_req the rpc request structure provided to the server callback
+ */
+#define EVRPC_REQUEST_DONE(rpc_req) do { \
+ struct evrpc_req_generic *req_ = (struct evrpc_req_generic *)(rpc_req); \
+ evrpc_request_done(req_); \
+} while (0)
+
+
+struct evrpc_base;
+struct evhttp;
+
+/* functions to start up the rpc system */
+
+/** Creates a new rpc base from which RPC requests can be received
+ *
+ * @param server a pointer to an existing HTTP server
+ * @return a newly allocated evrpc_base struct
+ * @see evrpc_free()
+ */
+struct evrpc_base *evrpc_init(struct evhttp *server);
+
+/**
+ * Frees the evrpc base
+ *
+ * For now, you are responsible for making sure that no rpcs are ongoing.
+ *
+ * @param base the evrpc_base object to be freed
+ * @see evrpc_init
+ */
+void evrpc_free(struct evrpc_base *base);
+
+/** register RPCs with the HTTP Server
+ *
+ * registers a new RPC with the HTTP server, each RPC needs to have
+ * a unique name under which it can be identified.
+ *
+ * @param base the evrpc_base structure in which the RPC should be
+ * registered.
+ * @param name the name of the RPC
+ * @param request the name of the RPC request structure
+ * @param reply the name of the RPC reply structure
+ * @param callback the callback that should be invoked when the RPC
+ * is received. The callback has the following prototype
+ * void (*callback)(EVRPC_STRUCT(Message)* rpc, void *arg)
+ * @param cbarg an additional parameter that can be passed to the callback.
+ * The parameter can be used to carry around state.
+ */
+#define EVRPC_REGISTER(base, name, request, reply, callback, cbarg) \
+ evrpc_register_generic(base, #name, \
+ (void (*)(struct evrpc_req_generic *, void *))callback, cbarg, \
+ (void *(*)(void *))request##_new, NULL, \
+ (void (*)(void *))request##_free, \
+ (int (*)(void *, struct evbuffer *))request##_unmarshal, \
+ (void *(*)(void *))reply##_new, NULL, \
+ (void (*)(void *))reply##_free, \
+ (int (*)(void *))reply##_complete, \
+ (void (*)(struct evbuffer *, void *))reply##_marshal)
+
+/**
+ Low level function for registering an RPC with a server.
+
+ Use EVRPC_REGISTER() instead.
+
+ @see EVRPC_REGISTER()
+*/
+int evrpc_register_rpc(struct evrpc_base *, struct evrpc *,
+ void (*)(struct evrpc_req_generic*, void *), void *);
+
+/**
+ * Unregisters an already registered RPC
+ *
+ * @param base the evrpc_base object from which to unregister an RPC
+ * @param name the name of the rpc to unregister
+ * @return -1 on error or 0 when successful.
+ * @see EVRPC_REGISTER()
+ */
+#define EVRPC_UNREGISTER(base, name) evrpc_unregister_rpc((base), #name)
+
+int evrpc_unregister_rpc(struct evrpc_base *base, const char *name);
+
+/*
+ * Client-side RPC support
+ */
+
+struct evhttp_connection;
+struct evrpc_status;
+
+/** launches an RPC and sends it to the server
+ *
+ * EVRPC_MAKE_REQUEST() is used by the client to send an RPC to the server.
+ *
+ * @param name the name of the RPC
+ * @param pool the evrpc_pool that contains the connection objects over which
+ * the request should be sent.
+ * @param request a pointer to the RPC request structure - it contains the
+ * data to be sent to the server.
+ * @param reply a pointer to the RPC reply structure. It is going to be filled
+ * if the request was answered successfully
+ * @param cb the callback to invoke when the RPC request has been answered
+ * @param cbarg an additional argument to be passed to the client
+ * @return 0 on success, -1 on failure
+ */
+#define EVRPC_MAKE_REQUEST(name, pool, request, reply, cb, cbarg) \
+ evrpc_send_request_##name((pool), (request), (reply), (cb), (cbarg))
+
+/**
+ Makes an RPC request based on the provided context.
+
+ This is a low-level function and should not be used directly
+ unless a custom context object is provided. Use EVRPC_MAKE_REQUEST()
+ instead.
+
+ @param ctx a context from EVRPC_MAKE_CTX()
+ @returns 0 on success, -1 otherwise.
+ @see EVRPC_MAKE_REQUEST(), EVRPC_MAKE_CTX()
+*/
+int evrpc_make_request(struct evrpc_request_wrapper *ctx);
+
+/** creates an rpc connection pool
+ *
+ * a pool has a number of connections associated with it.
+ * rpc requests are always made via a pool.
+ *
+ * @param base a pointer to an struct event_based object; can be left NULL
+ * in singled-threaded applications
+ * @return a newly allocated struct evrpc_pool object
+ * @see evrpc_pool_free()
+ */
+struct evrpc_pool *evrpc_pool_new(struct event_base *base);
+/** frees an rpc connection pool
+ *
+ * @param pool a pointer to an evrpc_pool allocated via evrpc_pool_new()
+ * @see evrpc_pool_new()
+ */
+void evrpc_pool_free(struct evrpc_pool *pool);
+
+/**
+ * Adds a connection over which rpc can be dispatched to the pool.
+ *
+ * The connection object must have been newly created.
+ *
+ * @param pool the pool to which to add the connection
+ * @param evcon the connection to add to the pool.
+ */
+void evrpc_pool_add_connection(struct evrpc_pool *pool,
+ struct evhttp_connection *evcon);
+
+/**
+ * Removes a connection from the pool.
+ *
+ * The connection object must have been newly created.
+ *
+ * @param pool the pool from which to remove the connection
+ * @param evcon the connection to remove from the pool.
+ */
+void evrpc_pool_remove_connection(struct evrpc_pool *pool,
+ struct evhttp_connection *evcon);
+
+/**
+ * Sets the timeout in secs after which a request has to complete. The
+ * RPC is completely aborted if it does not complete by then. Setting
+ * the timeout to 0 means that it never timeouts and can be used to
+ * implement callback type RPCs.
+ *
+ * Any connection already in the pool will be updated with the new
+ * timeout. Connections added to the pool after set_timeout has be
+ * called receive the pool timeout only if no timeout has been set
+ * for the connection itself.
+ *
+ * @param pool a pointer to a struct evrpc_pool object
+ * @param timeout_in_secs the number of seconds after which a request should
+ * timeout and a failure be returned to the callback.
+ */
+void evrpc_pool_set_timeout(struct evrpc_pool *pool, int timeout_in_secs);
+
+/**
+ * Hooks for changing the input and output of RPCs; this can be used to
+ * implement compression, authentication, encryption, ...
+ */
+
+enum EVRPC_HOOK_TYPE {
+ EVRPC_INPUT, /**< apply the function to an input hook */
+ EVRPC_OUTPUT /**< apply the function to an output hook */
+};
+
+#ifndef _WIN32
+/** Deprecated alias for EVRPC_INPUT. Not available on windows, where it
+ * conflicts with platform headers. */
+#define INPUT EVRPC_INPUT
+/** Deprecated alias for EVRPC_OUTPUT. Not available on windows, where it
+ * conflicts with platform headers. */
+#define OUTPUT EVRPC_OUTPUT
+#endif
+
+/**
+ * Return value from hook processing functions
+ */
+
+enum EVRPC_HOOK_RESULT {
+ EVRPC_TERMINATE = -1, /**< indicates the rpc should be terminated */
+ EVRPC_CONTINUE = 0, /**< continue processing the rpc */
+ EVRPC_PAUSE = 1 /**< pause processing request until resumed */
+};
+
+/** adds a processing hook to either an rpc base or rpc pool
+ *
+ * If a hook returns TERMINATE, the processing is aborted. On CONTINUE,
+ * the request is immediately processed after the hook returns. If the
+ * hook returns PAUSE, request processing stops until evrpc_resume_request()
+ * has been called.
+ *
+ * The add functions return handles that can be used for removing hooks.
+ *
+ * @param vbase a pointer to either struct evrpc_base or struct evrpc_pool
+ * @param hook_type either INPUT or OUTPUT
+ * @param cb the callback to call when the hook is activated
+ * @param cb_arg an additional argument for the callback
+ * @return a handle to the hook so it can be removed later
+ * @see evrpc_remove_hook()
+ */
+void *evrpc_add_hook(void *vbase,
+ enum EVRPC_HOOK_TYPE hook_type,
+ int (*cb)(void *, struct evhttp_request *, struct evbuffer *, void *),
+ void *cb_arg);
+
+/** removes a previously added hook
+ *
+ * @param vbase a pointer to either struct evrpc_base or struct evrpc_pool
+ * @param hook_type either INPUT or OUTPUT
+ * @param handle a handle returned by evrpc_add_hook()
+ * @return 1 on success or 0 on failure
+ * @see evrpc_add_hook()
+ */
+int evrpc_remove_hook(void *vbase,
+ enum EVRPC_HOOK_TYPE hook_type,
+ void *handle);
+
+/** resume a paused request
+ *
+ * @param vbase a pointer to either struct evrpc_base or struct evrpc_pool
+ * @param ctx the context pointer provided to the original hook call
+ */
+int
+evrpc_resume_request(void *vbase, void *ctx, enum EVRPC_HOOK_RESULT res);
+
+/** adds meta data to request
+ *
+ * evrpc_hook_add_meta() allows hooks to add meta data to a request. for
+ * a client request, the meta data can be inserted by an outgoing request hook
+ * and retrieved by the incoming request hook.
+ *
+ * @param ctx the context provided to the hook call
+ * @param key a NUL-terminated c-string
+ * @param data the data to be associated with the key
+ * @param data_size the size of the data
+ */
+void evrpc_hook_add_meta(void *ctx, const char *key,
+ const void *data, size_t data_size);
+
+/** retrieves meta data previously associated
+ *
+ * evrpc_hook_find_meta() can be used to retrieve meta data associated to a
+ * request by a previous hook.
+ * @param ctx the context provided to the hook call
+ * @param key a NUL-terminated c-string
+ * @param data pointer to a data pointer that will contain the retrieved data
+ * @param data_size pointer to the size of the data
+ * @return 0 on success or -1 on failure
+ */
+int evrpc_hook_find_meta(void *ctx, const char *key,
+ void **data, size_t *data_size);
+
+/**
+ * returns the connection object associated with the request
+ *
+ * @param ctx the context provided to the hook call
+ * @return a pointer to the evhttp_connection object
+ */
+struct evhttp_connection *evrpc_hook_get_connection(void *ctx);
+
+/**
+ Function for sending a generic RPC request.
+
+ Do not call this function directly, use EVRPC_MAKE_REQUEST() instead.
+
+ @see EVRPC_MAKE_REQUEST()
+ */
+int evrpc_send_request_generic(struct evrpc_pool *pool,
+ void *request, void *reply,
+ void (*cb)(struct evrpc_status *, void *, void *, void *),
+ void *cb_arg,
+ const char *rpcname,
+ void (*req_marshal)(struct evbuffer *, void *),
+ void (*rpl_clear)(void *),
+ int (*rpl_unmarshal)(void *, struct evbuffer *));
+
+/**
+ Function for registering a generic RPC with the RPC base.
+
+ Do not call this function directly, use EVRPC_REGISTER() instead.
+
+ @see EVRPC_REGISTER()
+ */
+int
+evrpc_register_generic(struct evrpc_base *base, const char *name,
+ void (*callback)(struct evrpc_req_generic *, void *), void *cbarg,
+ void *(*req_new)(void *), void *req_new_arg, void (*req_free)(void *),
+ int (*req_unmarshal)(void *, struct evbuffer *),
+ void *(*rpl_new)(void *), void *rpl_new_arg, void (*rpl_free)(void *),
+ int (*rpl_complete)(void *),
+ void (*rpl_marshal)(struct evbuffer *, void *));
+
+/** accessors for obscure and undocumented functionality */
+struct evrpc_pool* evrpc_request_get_pool(struct evrpc_request_wrapper *ctx);
+void evrpc_request_set_pool(struct evrpc_request_wrapper *ctx,
+ struct evrpc_pool *pool);
+void evrpc_request_set_cb(struct evrpc_request_wrapper *ctx,
+ void (*cb)(struct evrpc_status*, void *request, void *reply, void *arg),
+ void *cb_arg);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_RPC_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/include/event2/rpc_compat.h b/protocols/Telegram/tgl/libevent/include/event2/rpc_compat.h
new file mode 100644
index 0000000000..8d8334d25f
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/event2/rpc_compat.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2006-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVENT2_RPC_COMPAT_H_INCLUDED_
+#define EVENT2_RPC_COMPAT_H_INCLUDED_
+
+/** @file event2/rpc_compat.h
+
+ Deprecated versions of the functions in rpc.h: provided only for
+ backwards compatibility.
+
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** backwards compatible accessors that work only with gcc */
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+
+#undef EVTAG_ASSIGN
+#undef EVTAG_GET
+#undef EVTAG_ADD
+
+#define EVTAG_ASSIGN(msg, member, args...) \
+ (*(msg)->base->member##_assign)(msg, ## args)
+#define EVTAG_GET(msg, member, args...) \
+ (*(msg)->base->member##_get)(msg, ## args)
+#define EVTAG_ADD(msg, member, args...) \
+ (*(msg)->base->member##_add)(msg, ## args)
+#endif
+#define EVTAG_LEN(msg, member) ((msg)->member##_length)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_EVENT_COMPAT_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/include/event2/rpc_struct.h b/protocols/Telegram/tgl/libevent/include/event2/rpc_struct.h
new file mode 100644
index 0000000000..8f691f49fb
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/event2/rpc_struct.h
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2006-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVENT2_RPC_STRUCT_H_INCLUDED_
+#define EVENT2_RPC_STRUCT_H_INCLUDED_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @file event2/rpc_struct.h
+
+ Structures used by rpc.h. Using these structures directly may harm
+ forward compatibility: be careful!
+
+ */
+
+/**
+ * provides information about the completed RPC request.
+ */
+struct evrpc_status {
+#define EVRPC_STATUS_ERR_NONE 0
+#define EVRPC_STATUS_ERR_TIMEOUT 1
+#define EVRPC_STATUS_ERR_BADPAYLOAD 2
+#define EVRPC_STATUS_ERR_UNSTARTED 3
+#define EVRPC_STATUS_ERR_HOOKABORTED 4
+ int error;
+
+ /* for looking at headers or other information */
+ struct evhttp_request *http_req;
+};
+
+/* the structure below needs to be synchronized with evrpc_req_generic */
+
+/* Encapsulates a request */
+struct evrpc {
+ TAILQ_ENTRY(evrpc) next;
+
+ /* the URI at which the request handler lives */
+ const char* uri;
+
+ /* creates a new request structure */
+ void *(*request_new)(void *);
+ void *request_new_arg;
+
+ /* frees the request structure */
+ void (*request_free)(void *);
+
+ /* unmarshals the buffer into the proper request structure */
+ int (*request_unmarshal)(void *, struct evbuffer *);
+
+ /* creates a new reply structure */
+ void *(*reply_new)(void *);
+ void *reply_new_arg;
+
+ /* frees the reply structure */
+ void (*reply_free)(void *);
+
+ /* verifies that the reply is valid */
+ int (*reply_complete)(void *);
+
+ /* marshals the reply into a buffer */
+ void (*reply_marshal)(struct evbuffer*, void *);
+
+ /* the callback invoked for each received rpc */
+ void (*cb)(struct evrpc_req_generic *, void *);
+ void *cb_arg;
+
+ /* reference for further configuration */
+ struct evrpc_base *base;
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_RPC_STRUCT_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/include/event2/tag.h b/protocols/Telegram/tgl/libevent/include/event2/tag.h
new file mode 100644
index 0000000000..2f73bfc00e
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/event2/tag.h
@@ -0,0 +1,146 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVENT2_TAG_H_INCLUDED_
+#define EVENT2_TAG_H_INCLUDED_
+
+/** @file event2/tag.h
+
+ Helper functions for reading and writing tagged data onto buffers.
+
+ */
+
+#include <event2/visibility.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event-config.h>
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+/* For int types. */
+#include <event2/util.h>
+
+struct evbuffer;
+
+/*
+ * Marshaling tagged data - We assume that all tags are inserted in their
+ * numeric order - so that unknown tags will always be higher than the
+ * known ones - and we can just ignore the end of an event buffer.
+ */
+
+EVENT2_EXPORT_SYMBOL
+void evtag_init(void);
+
+/**
+ Unmarshals the header and returns the length of the payload
+
+ @param evbuf the buffer from which to unmarshal data
+ @param ptag a pointer in which the tag id is being stored
+ @returns -1 on failure or the number of bytes in the remaining payload.
+*/
+EVENT2_EXPORT_SYMBOL
+int evtag_unmarshal_header(struct evbuffer *evbuf, ev_uint32_t *ptag);
+
+EVENT2_EXPORT_SYMBOL
+void evtag_marshal(struct evbuffer *evbuf, ev_uint32_t tag, const void *data,
+ ev_uint32_t len);
+EVENT2_EXPORT_SYMBOL
+void evtag_marshal_buffer(struct evbuffer *evbuf, ev_uint32_t tag,
+ struct evbuffer *data);
+
+/**
+ Encode an integer and store it in an evbuffer.
+
+ We encode integers by nybbles; the first nibble contains the number
+ of significant nibbles - 1; this allows us to encode up to 64-bit
+ integers. This function is byte-order independent.
+
+ @param evbuf evbuffer to store the encoded number
+ @param number a 32-bit integer
+ */
+EVENT2_EXPORT_SYMBOL
+void evtag_encode_int(struct evbuffer *evbuf, ev_uint32_t number);
+EVENT2_EXPORT_SYMBOL
+void evtag_encode_int64(struct evbuffer *evbuf, ev_uint64_t number);
+
+EVENT2_EXPORT_SYMBOL
+void evtag_marshal_int(struct evbuffer *evbuf, ev_uint32_t tag,
+ ev_uint32_t integer);
+EVENT2_EXPORT_SYMBOL
+void evtag_marshal_int64(struct evbuffer *evbuf, ev_uint32_t tag,
+ ev_uint64_t integer);
+
+EVENT2_EXPORT_SYMBOL
+void evtag_marshal_string(struct evbuffer *buf, ev_uint32_t tag,
+ const char *string);
+
+EVENT2_EXPORT_SYMBOL
+void evtag_marshal_timeval(struct evbuffer *evbuf, ev_uint32_t tag,
+ struct timeval *tv);
+
+EVENT2_EXPORT_SYMBOL
+int evtag_unmarshal(struct evbuffer *src, ev_uint32_t *ptag,
+ struct evbuffer *dst);
+EVENT2_EXPORT_SYMBOL
+int evtag_peek(struct evbuffer *evbuf, ev_uint32_t *ptag);
+EVENT2_EXPORT_SYMBOL
+int evtag_peek_length(struct evbuffer *evbuf, ev_uint32_t *plength);
+EVENT2_EXPORT_SYMBOL
+int evtag_payload_length(struct evbuffer *evbuf, ev_uint32_t *plength);
+EVENT2_EXPORT_SYMBOL
+int evtag_consume(struct evbuffer *evbuf);
+
+EVENT2_EXPORT_SYMBOL
+int evtag_unmarshal_int(struct evbuffer *evbuf, ev_uint32_t need_tag,
+ ev_uint32_t *pinteger);
+EVENT2_EXPORT_SYMBOL
+int evtag_unmarshal_int64(struct evbuffer *evbuf, ev_uint32_t need_tag,
+ ev_uint64_t *pinteger);
+
+EVENT2_EXPORT_SYMBOL
+int evtag_unmarshal_fixed(struct evbuffer *src, ev_uint32_t need_tag,
+ void *data, size_t len);
+
+EVENT2_EXPORT_SYMBOL
+int evtag_unmarshal_string(struct evbuffer *evbuf, ev_uint32_t need_tag,
+ char **pstring);
+
+EVENT2_EXPORT_SYMBOL
+int evtag_unmarshal_timeval(struct evbuffer *evbuf, ev_uint32_t need_tag,
+ struct timeval *ptv);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_TAG_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/include/event2/tag_compat.h b/protocols/Telegram/tgl/libevent/include/event2/tag_compat.h
new file mode 100644
index 0000000000..a276c0d35b
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/event2/tag_compat.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVENT2_TAG_COMPAT_H_INCLUDED_
+#define EVENT2_TAG_COMPAT_H_INCLUDED_
+
+/** @file event2/tag_compat.h
+
+ Obsolete/deprecated functions from tag.h; provided only for backwards
+ compatibility.
+ */
+
+/**
+ @name Misnamed functions
+
+ @deprecated These macros are deprecated because their names don't follow
+ Libevent's naming conventions. Use evtag_encode_int and
+ evtag_encode_int64 instead.
+
+ @{
+*/
+#define encode_int(evbuf, number) evtag_encode_int((evbuf), (number))
+#define encode_int64(evbuf, number) evtag_encode_int64((evbuf), (number))
+/**@}*/
+
+#endif /* EVENT2_TAG_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/include/event2/thread.h b/protocols/Telegram/tgl/libevent/include/event2/thread.h
new file mode 100644
index 0000000000..b51998631b
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/event2/thread.h
@@ -0,0 +1,253 @@
+/*
+ * Copyright (c) 2008-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVENT2_THREAD_H_INCLUDED_
+#define EVENT2_THREAD_H_INCLUDED_
+
+/** @file event2/thread.h
+
+ Functions for multi-threaded applications using Libevent.
+
+ When using a multi-threaded application in which multiple threads
+ add and delete events from a single event base, Libevent needs to
+ lock its data structures.
+
+ Like the memory-management function hooks, all of the threading functions
+ _must_ be set up before an event_base is created if you want the base to
+ use them.
+
+ Most programs will either be using Windows threads or Posix threads. You
+ can configure Libevent to use one of these event_use_windows_threads() or
+ event_use_pthreads() respectively. If you're using another threading
+ library, you'll need to configure threading functions manually using
+ evthread_set_lock_callbacks() and evthread_set_condition_callbacks().
+
+ */
+
+#include <event2/visibility.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event-config.h>
+
+/**
+ @name Flags passed to lock functions
+
+ @{
+*/
+/** A flag passed to a locking callback when the lock was allocated as a
+ * read-write lock, and we want to acquire or release the lock for writing. */
+#define EVTHREAD_WRITE 0x04
+/** A flag passed to a locking callback when the lock was allocated as a
+ * read-write lock, and we want to acquire or release the lock for reading. */
+#define EVTHREAD_READ 0x08
+/** A flag passed to a locking callback when we don't want to block waiting
+ * for the lock; if we can't get the lock immediately, we will instead
+ * return nonzero from the locking callback. */
+#define EVTHREAD_TRY 0x10
+/**@}*/
+
+#if !defined(EVENT__DISABLE_THREAD_SUPPORT) || defined(EVENT_IN_DOXYGEN_)
+
+#define EVTHREAD_LOCK_API_VERSION 1
+
+/**
+ @name Types of locks
+
+ @{*/
+/** A recursive lock is one that can be acquired multiple times at once by the
+ * same thread. No other process can allocate the lock until the thread that
+ * has been holding it has unlocked it as many times as it locked it. */
+#define EVTHREAD_LOCKTYPE_RECURSIVE 1
+/* A read-write lock is one that allows multiple simultaneous readers, but
+ * where any one writer excludes all other writers and readers. */
+#define EVTHREAD_LOCKTYPE_READWRITE 2
+/**@}*/
+
+/** This structure describes the interface a threading library uses for
+ * locking. It's used to tell evthread_set_lock_callbacks() how to use
+ * locking on this platform.
+ */
+struct evthread_lock_callbacks {
+ /** The current version of the locking API. Set this to
+ * EVTHREAD_LOCK_API_VERSION */
+ int lock_api_version;
+ /** Which kinds of locks does this version of the locking API
+ * support? A bitfield of EVTHREAD_LOCKTYPE_RECURSIVE and
+ * EVTHREAD_LOCKTYPE_READWRITE.
+ *
+ * (Note that RECURSIVE locks are currently mandatory, and
+ * READWRITE locks are not currently used.)
+ **/
+ unsigned supported_locktypes;
+ /** Function to allocate and initialize new lock of type 'locktype'.
+ * Returns NULL on failure. */
+ void *(*alloc)(unsigned locktype);
+ /** Funtion to release all storage held in 'lock', which was created
+ * with type 'locktype'. */
+ void (*free)(void *lock, unsigned locktype);
+ /** Acquire an already-allocated lock at 'lock' with mode 'mode'.
+ * Returns 0 on success, and nonzero on failure. */
+ int (*lock)(unsigned mode, void *lock);
+ /** Release a lock at 'lock' using mode 'mode'. Returns 0 on success,
+ * and nonzero on failure. */
+ int (*unlock)(unsigned mode, void *lock);
+};
+
+/** Sets a group of functions that Libevent should use for locking.
+ * For full information on the required callback API, see the
+ * documentation for the individual members of evthread_lock_callbacks.
+ *
+ * Note that if you're using Windows or the Pthreads threading library, you
+ * probably shouldn't call this function; instead, use
+ * evthread_use_windows_threads() or evthread_use_posix_threads() if you can.
+ */
+EVENT2_EXPORT_SYMBOL
+int evthread_set_lock_callbacks(const struct evthread_lock_callbacks *);
+
+#define EVTHREAD_CONDITION_API_VERSION 1
+
+struct timeval;
+
+/** This structure describes the interface a threading library uses for
+ * condition variables. It's used to tell evthread_set_condition_callbacks
+ * how to use locking on this platform.
+ */
+struct evthread_condition_callbacks {
+ /** The current version of the conditions API. Set this to
+ * EVTHREAD_CONDITION_API_VERSION */
+ int condition_api_version;
+ /** Function to allocate and initialize a new condition variable.
+ * Returns the condition variable on success, and NULL on failure.
+ * The 'condtype' argument will be 0 with this API version.
+ */
+ void *(*alloc_condition)(unsigned condtype);
+ /** Function to free a condition variable. */
+ void (*free_condition)(void *cond);
+ /** Function to signal a condition variable. If 'broadcast' is 1, all
+ * threads waiting on 'cond' should be woken; otherwise, only on one
+ * thread is worken. Should return 0 on success, -1 on failure.
+ * This function will only be called while holding the associated
+ * lock for the condition.
+ */
+ int (*signal_condition)(void *cond, int broadcast);
+ /** Function to wait for a condition variable. The lock 'lock'
+ * will be held when this function is called; should be released
+ * while waiting for the condition to be come signalled, and
+ * should be held again when this function returns.
+ * If timeout is provided, it is interval of seconds to wait for
+ * the event to become signalled; if it is NULL, the function
+ * should wait indefinitely.
+ *
+ * The function should return -1 on error; 0 if the condition
+ * was signalled, or 1 on a timeout. */
+ int (*wait_condition)(void *cond, void *lock,
+ const struct timeval *timeout);
+};
+
+/** Sets a group of functions that Libevent should use for condition variables.
+ * For full information on the required callback API, see the
+ * documentation for the individual members of evthread_condition_callbacks.
+ *
+ * Note that if you're using Windows or the Pthreads threading library, you
+ * probably shouldn't call this function; instead, use
+ * evthread_use_windows_threads() or evthread_use_pthreads() if you can.
+ */
+EVENT2_EXPORT_SYMBOL
+int evthread_set_condition_callbacks(
+ const struct evthread_condition_callbacks *);
+
+/**
+ Sets the function for determining the thread id.
+
+ @param base the event base for which to set the id function
+ @param id_fn the identify function Libevent should invoke to
+ determine the identity of a thread.
+*/
+EVENT2_EXPORT_SYMBOL
+void evthread_set_id_callback(
+ unsigned long (*id_fn)(void));
+
+#if (defined(_WIN32) && !defined(EVENT__DISABLE_THREAD_SUPPORT)) || defined(EVENT_IN_DOXYGEN_)
+/** Sets up Libevent for use with Windows builtin locking and thread ID
+ functions. Unavailable if Libevent is not built for Windows.
+
+ @return 0 on success, -1 on failure. */
+EVENT2_EXPORT_SYMBOL
+int evthread_use_windows_threads(void);
+/**
+ Defined if Libevent was built with support for evthread_use_windows_threads()
+*/
+#define EVTHREAD_USE_WINDOWS_THREADS_IMPLEMENTED 1
+#endif
+
+#if defined(EVENT__HAVE_PTHREADS) || defined(EVENT_IN_DOXYGEN_)
+/** Sets up Libevent for use with Pthreads locking and thread ID functions.
+ Unavailable if Libevent is not build for use with pthreads. Requires
+ libraries to link against Libevent_pthreads as well as Libevent.
+
+ @return 0 on success, -1 on failure. */
+EVENT2_EXPORT_SYMBOL
+int evthread_use_pthreads(void);
+/** Defined if Libevent was built with support for evthread_use_pthreads() */
+#define EVTHREAD_USE_PTHREADS_IMPLEMENTED 1
+
+#endif
+
+/** Enable debugging wrappers around the current lock callbacks. If Libevent
+ * makes one of several common locking errors, exit with an assertion failure.
+ *
+ * If you're going to call this function, you must do so before any locks are
+ * allocated.
+ **/
+EVENT2_EXPORT_SYMBOL
+void evthread_enable_lock_debugging(void);
+
+/* Old (misspelled) version: This is deprecated; use
+ * evthread_enable_log_debugging instead. */
+EVENT2_EXPORT_SYMBOL
+void evthread_enable_lock_debuging(void);
+
+#endif /* EVENT__DISABLE_THREAD_SUPPORT */
+
+struct event_base;
+/** Make sure it's safe to tell an event base to wake up from another thread
+ or a signal handler.
+
+ You shouldn't need to call this by hand; configuring the base with thread
+ support should be necessary and sufficient.
+
+ @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int evthread_make_base_notifiable(struct event_base *base);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_THREAD_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/include/event2/util.h b/protocols/Telegram/tgl/libevent/include/event2/util.h
new file mode 100644
index 0000000000..3936786ec9
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/event2/util.h
@@ -0,0 +1,852 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVENT2_UTIL_H_INCLUDED_
+#define EVENT2_UTIL_H_INCLUDED_
+
+/** @file event2/util.h
+
+ Common convenience functions for cross-platform portability and
+ related socket manipulations.
+
+ */
+#include <event2/visibility.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event-config.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef EVENT__HAVE_STDINT_H
+#include <stdint.h>
+#elif defined(EVENT__HAVE_INTTYPES_H)
+#include <inttypes.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef EVENT__HAVE_STDDEF_H
+#include <stddef.h>
+#endif
+#ifdef _MSC_VER
+#include <BaseTsd.h>
+#endif
+#include <stdarg.h>
+#ifdef EVENT__HAVE_NETDB_H
+#if !defined(_GNU_SOURCE)
+#define _GNU_SOURCE
+#endif
+#include <netdb.h>
+#endif
+
+#ifdef _WIN32
+#include <winsock2.h>
+#ifdef EVENT__HAVE_GETADDRINFO
+/* for EAI_* definitions. */
+#include <ws2tcpip.h>
+#endif
+#else
+#include <sys/socket.h>
+#endif
+
+/* Some openbsd autoconf versions get the name of this macro wrong. */
+#if defined(EVENT__SIZEOF_VOID__) && !defined(EVENT__SIZEOF_VOID_P)
+#define EVENT__SIZEOF_VOID_P EVENT__SIZEOF_VOID__
+#endif
+
+/**
+ * @name Standard integer types.
+ *
+ * Integer type definitions for types that are supposed to be defined in the
+ * C99-specified stdint.h. Shamefully, some platforms do not include
+ * stdint.h, so we need to replace it. (If you are on a platform like this,
+ * your C headers are now over 10 years out of date. You should bug them to
+ * do something about this.)
+ *
+ * We define:
+ *
+ * <dl>
+ * <dt>ev_uint64_t, ev_uint32_t, ev_uint16_t, ev_uint8_t</dt>
+ * <dd>unsigned integer types of exactly 64, 32, 16, and 8 bits
+ * respectively.</dd>
+ * <dt>ev_int64_t, ev_int32_t, ev_int16_t, ev_int8_t</dt>
+ * <dd>signed integer types of exactly 64, 32, 16, and 8 bits
+ * respectively.</dd>
+ * <dt>ev_uintptr_t, ev_intptr_t</dt>
+ * <dd>unsigned/signed integers large enough
+ * to hold a pointer without loss of bits.</dd>
+ * <dt>ev_ssize_t</dt>
+ * <dd>A signed type of the same size as size_t</dd>
+ * <dt>ev_off_t</dt>
+ * <dd>A signed type typically used to represent offsets within a
+ * (potentially large) file</dd>
+ *
+ * @{
+ */
+#ifdef EVENT__HAVE_UINT64_T
+#define ev_uint64_t uint64_t
+#define ev_int64_t int64_t
+#elif defined(_WIN32)
+#define ev_uint64_t unsigned __int64
+#define ev_int64_t signed __int64
+#elif EVENT__SIZEOF_LONG_LONG == 8
+#define ev_uint64_t unsigned long long
+#define ev_int64_t long long
+#elif EVENT__SIZEOF_LONG == 8
+#define ev_uint64_t unsigned long
+#define ev_int64_t long
+#elif defined(EVENT_IN_DOXYGEN_)
+#define ev_uint64_t ...
+#define ev_int64_t ...
+#else
+#error "No way to define ev_uint64_t"
+#endif
+
+#ifdef EVENT__HAVE_UINT32_T
+#define ev_uint32_t uint32_t
+#define ev_int32_t int32_t
+#elif defined(_WIN32)
+#define ev_uint32_t unsigned int
+#define ev_int32_t signed int
+#elif EVENT__SIZEOF_LONG == 4
+#define ev_uint32_t unsigned long
+#define ev_int32_t signed long
+#elif EVENT__SIZEOF_INT == 4
+#define ev_uint32_t unsigned int
+#define ev_int32_t signed int
+#elif defined(EVENT_IN_DOXYGEN_)
+#define ev_uint32_t ...
+#define ev_int32_t ...
+#else
+#error "No way to define ev_uint32_t"
+#endif
+
+#ifdef EVENT__HAVE_UINT16_T
+#define ev_uint16_t uint16_t
+#define ev_int16_t int16_t
+#elif defined(_WIN32)
+#define ev_uint16_t unsigned short
+#define ev_int16_t signed short
+#elif EVENT__SIZEOF_INT == 2
+#define ev_uint16_t unsigned int
+#define ev_int16_t signed int
+#elif EVENT__SIZEOF_SHORT == 2
+#define ev_uint16_t unsigned short
+#define ev_int16_t signed short
+#elif defined(EVENT_IN_DOXYGEN_)
+#define ev_uint16_t ...
+#define ev_int16_t ...
+#else
+#error "No way to define ev_uint16_t"
+#endif
+
+#ifdef EVENT__HAVE_UINT8_T
+#define ev_uint8_t uint8_t
+#define ev_int8_t int8_t
+#elif defined(EVENT_IN_DOXYGEN_)
+#define ev_uint8_t ...
+#define ev_int8_t ...
+#else
+#define ev_uint8_t unsigned char
+#define ev_int8_t signed char
+#endif
+
+#ifdef EVENT__HAVE_UINTPTR_T
+#define ev_uintptr_t uintptr_t
+#define ev_intptr_t intptr_t
+#elif EVENT__SIZEOF_VOID_P <= 4
+#define ev_uintptr_t ev_uint32_t
+#define ev_intptr_t ev_int32_t
+#elif EVENT__SIZEOF_VOID_P <= 8
+#define ev_uintptr_t ev_uint64_t
+#define ev_intptr_t ev_int64_t
+#elif defined(EVENT_IN_DOXYGEN_)
+#define ev_uintptr_t ...
+#define ev_intptr_t ...
+#else
+#error "No way to define ev_uintptr_t"
+#endif
+
+#ifdef EVENT__ssize_t
+#define ev_ssize_t EVENT__ssize_t
+#else
+#define ev_ssize_t ssize_t
+#endif
+
+/* Note that we define ev_off_t based on the compile-time size of off_t that
+ * we used to build Libevent, and not based on the current size of off_t.
+ * (For example, we don't define ev_off_t to off_t.). We do this because
+ * some systems let you build your software with different off_t sizes
+ * at runtime, and so putting in any dependency on off_t would risk API
+ * mismatch.
+ */
+#ifdef _WIN32
+#define ev_off_t ev_int64_t
+#elif EVENT__SIZEOF_OFF_T == 8
+#define ev_off_t ev_int64_t
+#elif EVENT__SIZEOF_OFF_T == 4
+#define ev_off_t ev_int32_t
+#elif defined(EVENT_IN_DOXYGEN_)
+#define ev_off_t ...
+#else
+#define ev_off_t off_t
+#endif
+/**@}*/
+
+/* Limits for integer types.
+
+ We're making two assumptions here:
+ - The compiler does constant folding properly.
+ - The platform does signed arithmetic in two's complement.
+*/
+
+/**
+ @name Limits for integer types
+
+ These macros hold the largest or smallest values possible for the
+ ev_[u]int*_t types.
+
+ @{
+*/
+#ifndef EVENT__HAVE_STDINT_H
+#define EV_UINT64_MAX ((((ev_uint64_t)0xffffffffUL) << 32) | 0xffffffffUL)
+#define EV_INT64_MAX ((((ev_int64_t) 0x7fffffffL) << 32) | 0xffffffffL)
+#define EV_INT64_MIN ((-EV_INT64_MAX) - 1)
+#define EV_UINT32_MAX ((ev_uint32_t)0xffffffffUL)
+#define EV_INT32_MAX ((ev_int32_t) 0x7fffffffL)
+#define EV_INT32_MIN ((-EV_INT32_MAX) - 1)
+#define EV_UINT16_MAX ((ev_uint16_t)0xffffUL)
+#define EV_INT16_MAX ((ev_int16_t) 0x7fffL)
+#define EV_INT16_MIN ((-EV_INT16_MAX) - 1)
+#define EV_UINT8_MAX 255
+#define EV_INT8_MAX 127
+#define EV_INT8_MIN ((-EV_INT8_MAX) - 1)
+#else
+#define EV_UINT64_MAX UINT64_MAX
+#define EV_INT64_MAX INT64_MAX
+#define EV_INT64_MIN INT64_MIN
+#define EV_UINT32_MAX UINT32_MAX
+#define EV_INT32_MAX INT32_MAX
+#define EV_INT32_MIN INT32_MIN
+#define EV_UINT16_MAX UINT16_MAX
+#define EV_INT16_MAX INT16_MAX
+#define EV_UINT8_MAX UINT8_MAX
+#define EV_INT8_MAX INT8_MAX
+#define EV_INT8_MIN INT8_MIN
+/** @} */
+#endif
+
+
+/**
+ @name Limits for SIZE_T and SSIZE_T
+
+ @{
+*/
+#if EVENT__SIZEOF_SIZE_T == 8
+#define EV_SIZE_MAX EV_UINT64_MAX
+#define EV_SSIZE_MAX EV_INT64_MAX
+#elif EVENT__SIZEOF_SIZE_T == 4
+#define EV_SIZE_MAX EV_UINT32_MAX
+#define EV_SSIZE_MAX EV_INT32_MAX
+#elif defined(EVENT_IN_DOXYGEN_)
+#define EV_SIZE_MAX ...
+#define EV_SSIZE_MAX ...
+#else
+#error "No way to define SIZE_MAX"
+#endif
+
+#define EV_SSIZE_MIN ((-EV_SSIZE_MAX) - 1)
+/**@}*/
+
+#ifdef _WIN32
+#define ev_socklen_t int
+#elif defined(EVENT__socklen_t)
+#define ev_socklen_t EVENT__socklen_t
+#else
+#define ev_socklen_t socklen_t
+#endif
+
+#ifdef EVENT__HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY
+#if !defined(EVENT__HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY) \
+ && !defined(ss_family)
+#define ss_family __ss_family
+#endif
+#endif
+
+/**
+ * A type wide enough to hold the output of "socket()" or "accept()". On
+ * Windows, this is an intptr_t; elsewhere, it is an int. */
+#ifdef _WIN32
+#define evutil_socket_t intptr_t
+#else
+#define evutil_socket_t int
+#endif
+
+/**
+ * Structure to hold information about a monotonic timer
+ *
+ * Use this with evutil_configure_monotonic_time() and
+ * evutil_gettime_monotonic().
+ *
+ * This is an opaque structure; you can allocate one using
+ * evutil_monotonic_timer_new().
+ *
+ * @see evutil_monotonic_timer_new(), evutil_monotonic_timer_free(),
+ * evutil_configure_monotonic_time(), evutil_gettime_monotonic()
+ */
+struct evutil_monotonic_timer
+#ifdef EVENT_IN_DOXYGEN_
+{/*Empty body so that doxygen will generate documentation here.*/}
+#endif
+;
+
+#define EV_MONOT_PRECISE 1
+#define EV_MONOT_FALLBACK 2
+
+/** Allocate a new struct evutil_monotonic_timer for use with the
+ * evutil_configure_monotonic_time() and evutil_gettime_monotonic()
+ * functions. You must configure the timer with
+ * evutil_configure_monotonic_time() before using it.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evutil_monotonic_timer * evutil_monotonic_timer_new(void);
+
+/** Free a struct evutil_monotonic_timer that was allocated using
+ * evutil_monotonic_timer_new().
+ */
+EVENT2_EXPORT_SYMBOL
+void evutil_monotonic_timer_free(struct evutil_monotonic_timer *timer);
+
+/** Set up a struct evutil_monotonic_timer; flags can include
+ * EV_MONOT_PRECISE and EV_MONOT_FALLBACK.
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_configure_monotonic_time(struct evutil_monotonic_timer *timer,
+ int flags);
+
+/** Query the current monotonic time from a struct evutil_monotonic_timer
+ * previously configured with evutil_configure_monotonic_time(). Monotonic
+ * time is guaranteed never to run in reverse, but is not necessarily epoch-
+ * based, or relative to any other definite point. Use it to make reliable
+ * measurements of elapsed time between events even when the system time
+ * may be changed.
+ *
+ * It is not safe to use this funtion on the same timer from multiple
+ * threads.
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_gettime_monotonic(struct evutil_monotonic_timer *timer,
+ struct timeval *tp);
+
+/** Create two new sockets that are connected to each other.
+
+ On Unix, this simply calls socketpair(). On Windows, it uses the
+ loopback network interface on 127.0.0.1, and only
+ AF_INET,SOCK_STREAM are supported.
+
+ (This may fail on some Windows hosts where firewall software has cleverly
+ decided to keep 127.0.0.1 from talking to itself.)
+
+ Parameters and return values are as for socketpair()
+*/
+EVENT2_EXPORT_SYMBOL
+int evutil_socketpair(int d, int type, int protocol, evutil_socket_t sv[2]);
+/** Do platform-specific operations as needed to make a socket nonblocking.
+
+ @param sock The socket to make nonblocking
+ @return 0 on success, -1 on failure
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_make_socket_nonblocking(evutil_socket_t sock);
+
+/** Do platform-specific operations to make a listener socket reusable.
+
+ Specifically, we want to make sure that another program will be able
+ to bind this address right after we've closed the listener.
+
+ This differs from Windows's interpretation of "reusable", which
+ allows multiple listeners to bind the same address at the same time.
+
+ @param sock The socket to make reusable
+ @return 0 on success, -1 on failure
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_make_listen_socket_reuseable(evutil_socket_t sock);
+
+/** Do platform-specific operations to make a listener port reusable.
+
+ Specifically, we want to make sure that multiple programs which also
+ set the same socket option will be able to bind, listen at the same time.
+
+ This is a feature available only to Linux 3.9+
+
+ @param sock The socket to make reusable
+ @return 0 on success, -1 on failure
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_make_listen_socket_reuseable_port(evutil_socket_t sock);
+
+/** Do platform-specific operations as needed to close a socket upon a
+ successful execution of one of the exec*() functions.
+
+ @param sock The socket to be closed
+ @return 0 on success, -1 on failure
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_make_socket_closeonexec(evutil_socket_t sock);
+
+/** Do the platform-specific call needed to close a socket returned from
+ socket() or accept().
+
+ @param sock The socket to be closed
+ @return 0 on success, -1 on failure
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_closesocket(evutil_socket_t sock);
+#define EVUTIL_CLOSESOCKET(s) evutil_closesocket(s)
+
+/** Do platform-specific operations, if possible, to make a tcp listener
+ * socket defer accept()s until there is data to read.
+ *
+ * Not all platforms support this. You don't want to do this for every
+ * listener socket: only the ones that implement a protocol where the
+ * client transmits before the server needs to respond.
+ *
+ * @param sock The listening socket to to make deferred
+ * @return 0 on success (whether the operation is supported or not),
+ * -1 on failure
+*/
+EVENT2_EXPORT_SYMBOL
+int evutil_make_tcp_listen_socket_deferred(evutil_socket_t sock);
+
+#ifdef _WIN32
+/** Return the most recent socket error. Not idempotent on all platforms. */
+#define EVUTIL_SOCKET_ERROR() WSAGetLastError()
+/** Replace the most recent socket error with errcode */
+#define EVUTIL_SET_SOCKET_ERROR(errcode) \
+ do { WSASetLastError(errcode); } while (0)
+/** Return the most recent socket error to occur on sock. */
+EVENT2_EXPORT_SYMBOL
+int evutil_socket_geterror(evutil_socket_t sock);
+/** Convert a socket error to a string. */
+EVENT2_EXPORT_SYMBOL
+const char *evutil_socket_error_to_string(int errcode);
+#elif defined(EVENT_IN_DOXYGEN_)
+/**
+ @name Socket error functions
+
+ These functions are needed for making programs compatible between
+ Windows and Unix-like platforms.
+
+ You see, Winsock handles socket errors differently from the rest of
+ the world. Elsewhere, a socket error is like any other error and is
+ stored in errno. But winsock functions require you to retrieve the
+ error with a special function, and don't let you use strerror for
+ the error codes. And handling EWOULDBLOCK is ... different.
+
+ @{
+*/
+/** Return the most recent socket error. Not idempotent on all platforms. */
+#define EVUTIL_SOCKET_ERROR() ...
+/** Replace the most recent socket error with errcode */
+#define EVUTIL_SET_SOCKET_ERROR(errcode) ...
+/** Return the most recent socket error to occur on sock. */
+#define evutil_socket_geterror(sock) ...
+/** Convert a socket error to a string. */
+#define evutil_socket_error_to_string(errcode) ...
+/**@}*/
+#else
+#define EVUTIL_SOCKET_ERROR() (errno)
+#define EVUTIL_SET_SOCKET_ERROR(errcode) \
+ do { errno = (errcode); } while (0)
+#define evutil_socket_geterror(sock) (errno)
+#define evutil_socket_error_to_string(errcode) (strerror(errcode))
+#endif
+
+
+/**
+ * @name Manipulation macros for struct timeval.
+ *
+ * We define replacements
+ * for timeradd, timersub, timerclear, timercmp, and timerisset.
+ *
+ * @{
+ */
+#ifdef EVENT__HAVE_TIMERADD
+#define evutil_timeradd(tvp, uvp, vvp) timeradd((tvp), (uvp), (vvp))
+#define evutil_timersub(tvp, uvp, vvp) timersub((tvp), (uvp), (vvp))
+#else
+#define evutil_timeradd(tvp, uvp, vvp) \
+ do { \
+ (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \
+ (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \
+ if ((vvp)->tv_usec >= 1000000) { \
+ (vvp)->tv_sec++; \
+ (vvp)->tv_usec -= 1000000; \
+ } \
+ } while (0)
+#define evutil_timersub(tvp, uvp, vvp) \
+ do { \
+ (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \
+ (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
+ if ((vvp)->tv_usec < 0) { \
+ (vvp)->tv_sec--; \
+ (vvp)->tv_usec += 1000000; \
+ } \
+ } while (0)
+#endif /* !EVENT__HAVE_TIMERADD */
+
+#ifdef EVENT__HAVE_TIMERCLEAR
+#define evutil_timerclear(tvp) timerclear(tvp)
+#else
+#define evutil_timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
+#endif
+/**@}*/
+
+/** Return true iff the tvp is related to uvp according to the relational
+ * operator cmp. Recognized values for cmp are ==, <=, <, >=, and >. */
+#define evutil_timercmp(tvp, uvp, cmp) \
+ (((tvp)->tv_sec == (uvp)->tv_sec) ? \
+ ((tvp)->tv_usec cmp (uvp)->tv_usec) : \
+ ((tvp)->tv_sec cmp (uvp)->tv_sec))
+
+#ifdef EVENT__HAVE_TIMERISSET
+#define evutil_timerisset(tvp) timerisset(tvp)
+#else
+#define evutil_timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
+#endif
+
+/** Replacement for offsetof on platforms that don't define it. */
+#ifdef offsetof
+#define evutil_offsetof(type, field) offsetof(type, field)
+#else
+#define evutil_offsetof(type, field) ((off_t)(&((type *)0)->field))
+#endif
+
+/* big-int related functions */
+/** Parse a 64-bit value from a string. Arguments are as for strtol. */
+EVENT2_EXPORT_SYMBOL
+ev_int64_t evutil_strtoll(const char *s, char **endptr, int base);
+
+/** Replacement for gettimeofday on platforms that lack it. */
+#ifdef EVENT__HAVE_GETTIMEOFDAY
+#define evutil_gettimeofday(tv, tz) gettimeofday((tv), (tz))
+#else
+struct timezone;
+EVENT2_EXPORT_SYMBOL
+int evutil_gettimeofday(struct timeval *tv, struct timezone *tz);
+#endif
+
+/** Replacement for snprintf to get consistent behavior on platforms for
+ which the return value of snprintf does not conform to C99.
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_snprintf(char *buf, size_t buflen, const char *format, ...)
+#ifdef __GNUC__
+ __attribute__((format(printf, 3, 4)))
+#endif
+;
+/** Replacement for vsnprintf to get consistent behavior on platforms for
+ which the return value of snprintf does not conform to C99.
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_vsnprintf(char *buf, size_t buflen, const char *format, va_list ap)
+#ifdef __GNUC__
+ __attribute__((format(printf, 3, 0)))
+#endif
+;
+
+/** Replacement for inet_ntop for platforms which lack it. */
+EVENT2_EXPORT_SYMBOL
+const char *evutil_inet_ntop(int af, const void *src, char *dst, size_t len);
+/** Replacement for inet_pton for platforms which lack it. */
+EVENT2_EXPORT_SYMBOL
+int evutil_inet_pton(int af, const char *src, void *dst);
+struct sockaddr;
+
+/** Parse an IPv4 or IPv6 address, with optional port, from a string.
+
+ Recognized formats are:
+ - [IPv6Address]:port
+ - [IPv6Address]
+ - IPv6Address
+ - IPv4Address:port
+ - IPv4Address
+
+ If no port is specified, the port in the output is set to 0.
+
+ @param str The string to parse.
+ @param out A struct sockaddr to hold the result. This should probably be
+ a struct sockaddr_storage.
+ @param outlen A pointer to the number of bytes that that 'out' can safely
+ hold. Set to the number of bytes used in 'out' on success.
+ @return -1 if the address is not well-formed, if the port is out of range,
+ or if out is not large enough to hold the result. Otherwise returns
+ 0 on success.
+*/
+EVENT2_EXPORT_SYMBOL
+int evutil_parse_sockaddr_port(const char *str, struct sockaddr *out, int *outlen);
+
+/** Compare two sockaddrs; return 0 if they are equal, or less than 0 if sa1
+ * preceeds sa2, or greater than 0 if sa1 follows sa2. If include_port is
+ * true, consider the port as well as the address. Only implemented for
+ * AF_INET and AF_INET6 addresses. The ordering is not guaranteed to remain
+ * the same between Libevent versions. */
+EVENT2_EXPORT_SYMBOL
+int evutil_sockaddr_cmp(const struct sockaddr *sa1, const struct sockaddr *sa2,
+ int include_port);
+
+/** As strcasecmp, but always compares the characters in locale-independent
+ ASCII. That's useful if you're handling data in ASCII-based protocols.
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_ascii_strcasecmp(const char *str1, const char *str2);
+/** As strncasecmp, but always compares the characters in locale-independent
+ ASCII. That's useful if you're handling data in ASCII-based protocols.
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_ascii_strncasecmp(const char *str1, const char *str2, size_t n);
+
+/* Here we define evutil_addrinfo to the native addrinfo type, or redefine it
+ * if this system has no getaddrinfo(). */
+#ifdef EVENT__HAVE_STRUCT_ADDRINFO
+#define evutil_addrinfo addrinfo
+#else
+/** A definition of struct addrinfo for systems that lack it.
+
+ (This is just an alias for struct addrinfo if the system defines
+ struct addrinfo.)
+*/
+struct evutil_addrinfo {
+ int ai_flags; /* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */
+ int ai_family; /* PF_xxx */
+ int ai_socktype; /* SOCK_xxx */
+ int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
+ size_t ai_addrlen; /* length of ai_addr */
+ char *ai_canonname; /* canonical name for nodename */
+ struct sockaddr *ai_addr; /* binary address */
+ struct evutil_addrinfo *ai_next; /* next structure in linked list */
+};
+#endif
+/** @name evutil_getaddrinfo() error codes
+
+ These values are possible error codes for evutil_getaddrinfo() and
+ related functions.
+
+ @{
+*/
+#if defined(EAI_ADDRFAMILY) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_EAI_ADDRFAMILY EAI_ADDRFAMILY
+#else
+#define EVUTIL_EAI_ADDRFAMILY -901
+#endif
+#if defined(EAI_AGAIN) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_EAI_AGAIN EAI_AGAIN
+#else
+#define EVUTIL_EAI_AGAIN -902
+#endif
+#if defined(EAI_BADFLAGS) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_EAI_BADFLAGS EAI_BADFLAGS
+#else
+#define EVUTIL_EAI_BADFLAGS -903
+#endif
+#if defined(EAI_FAIL) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_EAI_FAIL EAI_FAIL
+#else
+#define EVUTIL_EAI_FAIL -904
+#endif
+#if defined(EAI_FAMILY) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_EAI_FAMILY EAI_FAMILY
+#else
+#define EVUTIL_EAI_FAMILY -905
+#endif
+#if defined(EAI_MEMORY) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_EAI_MEMORY EAI_MEMORY
+#else
+#define EVUTIL_EAI_MEMORY -906
+#endif
+/* This test is a bit complicated, since some MS SDKs decide to
+ * remove NODATA or redefine it to be the same as NONAME, in a
+ * fun interpretation of RFC 2553 and RFC 3493. */
+#if defined(EAI_NODATA) && defined(EVENT__HAVE_GETADDRINFO) && (!defined(EAI_NONAME) || EAI_NODATA != EAI_NONAME)
+#define EVUTIL_EAI_NODATA EAI_NODATA
+#else
+#define EVUTIL_EAI_NODATA -907
+#endif
+#if defined(EAI_NONAME) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_EAI_NONAME EAI_NONAME
+#else
+#define EVUTIL_EAI_NONAME -908
+#endif
+#if defined(EAI_SERVICE) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_EAI_SERVICE EAI_SERVICE
+#else
+#define EVUTIL_EAI_SERVICE -909
+#endif
+#if defined(EAI_SOCKTYPE) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_EAI_SOCKTYPE EAI_SOCKTYPE
+#else
+#define EVUTIL_EAI_SOCKTYPE -910
+#endif
+#if defined(EAI_SYSTEM) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_EAI_SYSTEM EAI_SYSTEM
+#else
+#define EVUTIL_EAI_SYSTEM -911
+#endif
+
+#define EVUTIL_EAI_CANCEL -90001
+
+#if defined(AI_PASSIVE) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_AI_PASSIVE AI_PASSIVE
+#else
+#define EVUTIL_AI_PASSIVE 0x1000
+#endif
+#if defined(AI_CANONNAME) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_AI_CANONNAME AI_CANONNAME
+#else
+#define EVUTIL_AI_CANONNAME 0x2000
+#endif
+#if defined(AI_NUMERICHOST) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_AI_NUMERICHOST AI_NUMERICHOST
+#else
+#define EVUTIL_AI_NUMERICHOST 0x4000
+#endif
+#if defined(AI_NUMERICSERV) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_AI_NUMERICSERV AI_NUMERICSERV
+#else
+#define EVUTIL_AI_NUMERICSERV 0x8000
+#endif
+#if defined(AI_V4MAPPED) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_AI_V4MAPPED AI_V4MAPPED
+#else
+#define EVUTIL_AI_V4MAPPED 0x10000
+#endif
+#if defined(AI_ALL) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_AI_ALL AI_ALL
+#else
+#define EVUTIL_AI_ALL 0x20000
+#endif
+#if defined(AI_ADDRCONFIG) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_AI_ADDRCONFIG AI_ADDRCONFIG
+#else
+#define EVUTIL_AI_ADDRCONFIG 0x40000
+#endif
+/**@}*/
+
+struct evutil_addrinfo;
+/**
+ * This function clones getaddrinfo for systems that don't have it. For full
+ * details, see RFC 3493, section 6.1.
+ *
+ * Limitations:
+ * - When the system has no getaddrinfo, we fall back to gethostbyname_r or
+ * gethostbyname, with their attendant issues.
+ * - The AI_V4MAPPED and AI_ALL flags are not currently implemented.
+ *
+ * For a nonblocking variant, see evdns_getaddrinfo.
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_getaddrinfo(const char *nodename, const char *servname,
+ const struct evutil_addrinfo *hints_in, struct evutil_addrinfo **res);
+
+/** Release storage allocated by evutil_getaddrinfo or evdns_getaddrinfo. */
+EVENT2_EXPORT_SYMBOL
+void evutil_freeaddrinfo(struct evutil_addrinfo *ai);
+
+EVENT2_EXPORT_SYMBOL
+const char *evutil_gai_strerror(int err);
+
+/** Generate n bytes of secure pseudorandom data, and store them in buf.
+ *
+ * Current versions of Libevent use an ARC4-based random number generator,
+ * seeded using the platform's entropy source (/dev/urandom on Unix-like
+ * systems; CryptGenRandom on Windows). This is not actually as secure as it
+ * should be: ARC4 is a pretty lousy cipher, and the current implementation
+ * provides only rudimentary prediction- and backtracking-resistance. Don't
+ * use this for serious cryptographic applications.
+ */
+EVENT2_EXPORT_SYMBOL
+void evutil_secure_rng_get_bytes(void *buf, size_t n);
+
+/**
+ * Seed the secure random number generator if needed, and return 0 on
+ * success or -1 on failure.
+ *
+ * It is okay to call this function more than once; it will still return
+ * 0 if the RNG has been successfully seeded and -1 if it can't be
+ * seeded.
+ *
+ * Ordinarily you don't need to call this function from your own code;
+ * Libevent will seed the RNG itself the first time it needs good random
+ * numbers. You only need to call it if (a) you want to double-check
+ * that one of the seeding methods did succeed, or (b) you plan to drop
+ * the capability to seed (by chrooting, or dropping capabilities, or
+ * whatever), and you want to make sure that seeding happens before your
+ * program loses the ability to do it.
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_secure_rng_init(void);
+
+/**
+ * Set a filename to use in place of /dev/urandom for seeding the secure
+ * PRNG. Return 0 on success, -1 on failure.
+ *
+ * Call this function BEFORE calling any other initialization or RNG
+ * functions.
+ *
+ * (This string will _NOT_ be copied internally. Do not free it while any
+ * user of the secure RNG might be running. Don't pass anything other than a
+ * real /dev/...random device file here, or you might lose security.)
+ *
+ * This API is unstable, and might change in a future libevent version.
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_secure_rng_set_urandom_device_file(char *fname);
+
+/** Seed the random number generator with extra random bytes.
+
+ You should almost never need to call this function; it should be
+ sufficient to invoke evutil_secure_rng_init(), or let Libevent take
+ care of calling evutil_secure_rng_init() on its own.
+
+ If you call this function as a _replacement_ for the regular
+ entropy sources, then you need to be sure that your input
+ contains a fairly large amount of strong entropy. Doing so is
+ notoriously hard: most people who try get it wrong. Watch out!
+
+ @param dat a buffer full of a strong source of random numbers
+ @param datlen the number of bytes to read from datlen
+ */
+EVENT2_EXPORT_SYMBOL
+void evutil_secure_rng_add_bytes(const char *dat, size_t datlen);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT1_EVUTIL_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/include/event2/visibility.h b/protocols/Telegram/tgl/libevent/include/event2/visibility.h
new file mode 100644
index 0000000000..fb16dbeedd
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/event2/visibility.h
@@ -0,0 +1,50 @@
+/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVENT2_VISIBILITY_H_INCLUDED_
+#define EVENT2_VISIBILITY_H_INCLUDED_
+
+#include <event2/event-config.h>
+
+#if defined(event_EXPORTS) || defined(event_extra_EXPORTS) || defined(event_core_EXPORTS)
+# if defined (__SUNPRO_C) && (__SUNPRO_C >= 0x550)
+# define EVENT2_EXPORT_SYMBOL __global
+# elif defined __GNUC__
+# define EVENT2_EXPORT_SYMBOL __attribute__ ((visibility("default")))
+# elif defined(_MSC_VER)
+# define EVENT2_EXPORT_SYMBOL extern __declspec(dllexport)
+# else
+# define EVENT2_EXPORT_SYMBOL /* unknown compiler */
+# endif
+#else
+# if defined(EVENT__NEED_DLLIMPORT) && defined(_MSC_VER) && !defined(EVENT_BUILDING_REGRESS_TEST)
+# define EVENT2_EXPORT_SYMBOL extern __declspec(dllimport)
+# else
+# define EVENT2_EXPORT_SYMBOL
+# endif
+#endif
+
+#endif /* EVENT2_VISIBILITY_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/include/evhttp.h b/protocols/Telegram/tgl/libevent/include/evhttp.h
new file mode 100644
index 0000000000..549bc9b14a
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/evhttp.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVENT1_EVHTTP_H_INCLUDED_
+#define EVENT1_EVHTTP_H_INCLUDED_
+
+/** @file evhttp.h
+
+ An http implementation subsystem for Libevent.
+
+ The <evhttp.h> header is deprecated in Libevent 2.0 and later; please
+ use <event2/http.h> instead. Depending on what functionality you
+ need, you may also want to include more of the other <event2/...>
+ headers.
+ */
+
+#include <event.h>
+#include <event2/http.h>
+#include <event2/http_struct.h>
+#include <event2/http_compat.h>
+
+#endif /* EVENT1_EVHTTP_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/include/evrpc.h b/protocols/Telegram/tgl/libevent/include/evrpc.h
new file mode 100644
index 0000000000..7e986f7dab
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/evrpc.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVENT1_EVRPC_H_INCLUDED_
+#define EVENT1_EVRPC_H_INCLUDED_
+
+/** @file evrpc.h
+
+ An RPC system for Libevent.
+
+ The <evrpc.h> header is deprecated in Libevent 2.0 and later; please
+ use <event2/rpc.h> instead. Depending on what functionality you
+ need, you may also want to include more of the other <event2/...>
+ headers.
+ */
+
+#include <event.h>
+#include <event2/rpc.h>
+#include <event2/rpc_struct.h>
+#include <event2/rpc_compat.h>
+
+#endif /* EVENT1_EVRPC_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/include/evutil.h b/protocols/Telegram/tgl/libevent/include/evutil.h
new file mode 100644
index 0000000000..12c137d745
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/evutil.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef EVENT1_EVUTIL_H_INCLUDED_
+#define EVENT1_EVUTIL_H_INCLUDED_
+
+/** @file evutil.h
+
+ Utility and compatibility functions for Libevent.
+
+ The <evutil.h> header is deprecated in Libevent 2.0 and later; please
+ use <event2/util.h> instead.
+*/
+
+#include <event2/util.h>
+
+#endif /* EVENT1_EVUTIL_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/include/include.am b/protocols/Telegram/tgl/libevent/include/include.am
new file mode 100644
index 0000000000..9aad2dba4a
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/include/include.am
@@ -0,0 +1,46 @@
+# include/Makefile.am for libevent
+# Copyright 2000-2007 Niels Provos
+# Copyright 2007-2012 Niels Provos and Nick Mathewson
+#
+# See LICENSE for copying information.
+
+include_event2dir = $(includedir)/event2
+
+EVENT2_EXPORT = \
+ include/event2/buffer.h \
+ include/event2/buffer_compat.h \
+ include/event2/bufferevent.h \
+ include/event2/bufferevent_compat.h \
+ include/event2/bufferevent_ssl.h \
+ include/event2/bufferevent_struct.h \
+ include/event2/dns.h \
+ include/event2/dns_compat.h \
+ include/event2/dns_struct.h \
+ include/event2/event.h \
+ include/event2/event_compat.h \
+ include/event2/event_struct.h \
+ include/event2/http.h \
+ include/event2/http_compat.h \
+ include/event2/http_struct.h \
+ include/event2/keyvalq_struct.h \
+ include/event2/listener.h \
+ include/event2/rpc.h \
+ include/event2/rpc_compat.h \
+ include/event2/rpc_struct.h \
+ include/event2/tag.h \
+ include/event2/tag_compat.h \
+ include/event2/thread.h \
+ include/event2/util.h \
+ include/event2/visibility.h
+
+## Without the nobase_ prefixing, Automake would strip "include/event2/" from
+## the source header filename to derive the installed header filename.
+## With nobase_ the installed path is $(includedir)/include/event2/ev*.h.
+
+if INSTALL_LIBEVENT
+include_event2_HEADERS = $(EVENT2_EXPORT)
+nodist_include_event2_HEADERS = include/event2/event-config.h
+else
+noinst_HEADERS += $(EVENT2_EXPORT)
+nodist_noinst_HEADERS = include/event2/event-config.h
+endif
diff --git a/protocols/Telegram/tgl/libevent/iocp-internal.h b/protocols/Telegram/tgl/libevent/iocp-internal.h
new file mode 100644
index 0000000000..93dbe2b1a4
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/iocp-internal.h
@@ -0,0 +1,201 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+
+#ifndef IOCP_INTERNAL_H_INCLUDED_
+#define IOCP_INTERNAL_H_INCLUDED_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct event_overlapped;
+struct event_iocp_port;
+struct evbuffer;
+typedef void (*iocp_callback)(struct event_overlapped *, ev_uintptr_t, ev_ssize_t, int success);
+
+/* This whole file is actually win32 only. We wrap the structures in a win32
+ * ifdef so that we can test-compile code that uses these interfaces on
+ * non-win32 platforms. */
+#ifdef _WIN32
+
+/**
+ Internal use only. Wraps an OVERLAPPED that we're using for libevent
+ functionality. Whenever an event_iocp_port gets an event for a given
+ OVERLAPPED*, it upcasts the pointer to an event_overlapped, and calls the
+ iocp_callback function with the event_overlapped, the iocp key, and the
+ number of bytes transferred as arguments.
+ */
+struct event_overlapped {
+ OVERLAPPED overlapped;
+ iocp_callback cb;
+};
+
+/* Mingw's headers don't define LPFN_ACCEPTEX. */
+
+typedef BOOL (WINAPI *AcceptExPtr)(SOCKET, SOCKET, PVOID, DWORD, DWORD, DWORD, LPDWORD, LPOVERLAPPED);
+typedef BOOL (WINAPI *ConnectExPtr)(SOCKET, const struct sockaddr *, int, PVOID, DWORD, LPDWORD, LPOVERLAPPED);
+typedef void (WINAPI *GetAcceptExSockaddrsPtr)(PVOID, DWORD, DWORD, DWORD, LPSOCKADDR *, LPINT, LPSOCKADDR *, LPINT);
+
+/** Internal use only. Holds pointers to functions that only some versions of
+ Windows provide.
+ */
+struct win32_extension_fns {
+ AcceptExPtr AcceptEx;
+ ConnectExPtr ConnectEx;
+ GetAcceptExSockaddrsPtr GetAcceptExSockaddrs;
+};
+
+/**
+ Internal use only. Stores a Windows IO Completion port, along with
+ related data.
+ */
+struct event_iocp_port {
+ /** The port itself */
+ HANDLE port;
+ /* A lock to cover internal structures. */
+ CRITICAL_SECTION lock;
+ /** Number of threads ever open on the port. */
+ short n_threads;
+ /** True iff we're shutting down all the threads on this port */
+ short shutdown;
+ /** How often the threads on this port check for shutdown and other
+ * conditions */
+ long ms;
+ /* The threads that are waiting for events. */
+ HANDLE *threads;
+ /** Number of threads currently open on this port. */
+ short n_live_threads;
+ /** A semaphore to signal when we are done shutting down. */
+ HANDLE *shutdownSemaphore;
+};
+
+const struct win32_extension_fns *event_get_win32_extension_fns_(void);
+#else
+/* Dummy definition so we can test-compile more things on unix. */
+struct event_overlapped {
+ iocp_callback cb;
+};
+#endif
+
+/** Initialize the fields in an event_overlapped.
+
+ @param overlapped The struct event_overlapped to initialize
+ @param cb The callback that should be invoked once the IO operation has
+ finished.
+ */
+void event_overlapped_init_(struct event_overlapped *, iocp_callback cb);
+
+/** Allocate and return a new evbuffer that supports overlapped IO on a given
+ socket. The socket must be associated with an IO completion port using
+ event_iocp_port_associate_.
+*/
+struct evbuffer *evbuffer_overlapped_new_(evutil_socket_t fd);
+
+/** XXXX Document (nickm) */
+evutil_socket_t evbuffer_overlapped_get_fd_(struct evbuffer *buf);
+
+void evbuffer_overlapped_set_fd_(struct evbuffer *buf, evutil_socket_t fd);
+
+/** Start reading data onto the end of an overlapped evbuffer.
+
+ An evbuffer can only have one read pending at a time. While the read
+ is in progress, no other data may be added to the end of the buffer.
+ The buffer must be created with event_overlapped_init_().
+ evbuffer_commit_read_() must be called in the completion callback.
+
+ @param buf The buffer to read onto
+ @param n The number of bytes to try to read.
+ @param ol Overlapped object with associated completion callback.
+ @return 0 on success, -1 on error.
+ */
+int evbuffer_launch_read_(struct evbuffer *buf, size_t n, struct event_overlapped *ol);
+
+/** Start writing data from the start of an evbuffer.
+
+ An evbuffer can only have one write pending at a time. While the write is
+ in progress, no other data may be removed from the front of the buffer.
+ The buffer must be created with event_overlapped_init_().
+ evbuffer_commit_write_() must be called in the completion callback.
+
+ @param buf The buffer to read onto
+ @param n The number of bytes to try to read.
+ @param ol Overlapped object with associated completion callback.
+ @return 0 on success, -1 on error.
+ */
+int evbuffer_launch_write_(struct evbuffer *buf, ev_ssize_t n, struct event_overlapped *ol);
+
+/** XXX document */
+void evbuffer_commit_read_(struct evbuffer *, ev_ssize_t);
+void evbuffer_commit_write_(struct evbuffer *, ev_ssize_t);
+
+/** Create an IOCP, and launch its worker threads. Internal use only.
+
+ This interface is unstable, and will change.
+ */
+struct event_iocp_port *event_iocp_port_launch_(int n_cpus);
+
+/** Associate a file descriptor with an iocp, such that overlapped IO on the
+ fd will happen on one of the iocp's worker threads.
+*/
+int event_iocp_port_associate_(struct event_iocp_port *port, evutil_socket_t fd,
+ ev_uintptr_t key);
+
+/** Tell all threads serving an iocp to stop. Wait for up to waitMsec for all
+ the threads to finish whatever they're doing. If waitMsec is -1, wait
+ as long as required. If all the threads are done, free the port and return
+ 0. Otherwise, return -1. If you get a -1 return value, it is safe to call
+ this function again.
+*/
+int event_iocp_shutdown_(struct event_iocp_port *port, long waitMsec);
+
+/* FIXME document. */
+int event_iocp_activate_overlapped_(struct event_iocp_port *port,
+ struct event_overlapped *o,
+ ev_uintptr_t key, ev_uint32_t n_bytes);
+
+struct event_base;
+/* FIXME document. */
+struct event_iocp_port *event_base_get_iocp_(struct event_base *base);
+
+/* FIXME document. */
+int event_base_start_iocp_(struct event_base *base, int n_cpus);
+void event_base_stop_iocp_(struct event_base *base);
+
+/* FIXME document. */
+struct bufferevent *bufferevent_async_new_(struct event_base *base,
+ evutil_socket_t fd, int options);
+
+/* FIXME document. */
+void bufferevent_async_set_connected_(struct bufferevent *bev);
+int bufferevent_async_can_connect_(struct bufferevent *bev);
+int bufferevent_async_connect_(struct bufferevent *bev, evutil_socket_t fd,
+ const struct sockaddr *sa, int socklen);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/libevent/ipv6-internal.h b/protocols/Telegram/tgl/libevent/ipv6-internal.h
new file mode 100644
index 0000000000..0c207377b8
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/ipv6-internal.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+
+/* Internal use only: Fake IPv6 structures and values on platforms that
+ * do not have them */
+
+#ifndef IPV6_INTERNAL_H_INCLUDED_
+#define IPV6_INTERNAL_H_INCLUDED_
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#include <sys/types.h>
+#ifdef EVENT__HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#include "event2/util.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @file ipv6-internal.h
+ *
+ * Replacement types and functions for platforms that don't support ipv6
+ * properly.
+ */
+
+#ifndef EVENT__HAVE_STRUCT_IN6_ADDR
+struct in6_addr {
+ ev_uint8_t s6_addr[16];
+};
+#endif
+
+#ifndef EVENT__HAVE_SA_FAMILY_T
+typedef int sa_family_t;
+#endif
+
+#ifndef EVENT__HAVE_STRUCT_SOCKADDR_IN6
+struct sockaddr_in6 {
+ /* This will fail if we find a struct sockaddr that doesn't have
+ * sa_family as the first element. */
+ sa_family_t sin6_family;
+ ev_uint16_t sin6_port;
+ struct in6_addr sin6_addr;
+};
+#endif
+
+#ifndef AF_INET6
+#define AF_INET6 3333
+#endif
+#ifndef PF_INET6
+#define PF_INET6 AF_INET6
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/libevent/kqueue-internal.h b/protocols/Telegram/tgl/libevent/kqueue-internal.h
new file mode 100644
index 0000000000..02c5a3606c
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/kqueue-internal.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef KQUEUE_INTERNAL_H_INCLUDED_
+#define KQUEUE_INTERNAL_H_INCLUDED_
+
+/** Notification function, used to tell an event base to wake up from another
+ * thread. Only works when event_kq_add_notify_event_() has previously been
+ * called successfully on that base. */
+int event_kq_notify_base_(struct event_base *base);
+
+/** Prepare a kqueue-using event base to receive notifications via an internal
+ * EVFILT_USER event. Return 0 on sucess, -1 on failure.
+ */
+int event_kq_add_notify_event_(struct event_base *base);
+
+#endif
diff --git a/protocols/Telegram/tgl/libevent/kqueue.c b/protocols/Telegram/tgl/libevent/kqueue.c
new file mode 100644
index 0000000000..1f41b5a768
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/kqueue.c
@@ -0,0 +1,567 @@
+/* $OpenBSD: kqueue.c,v 1.5 2002/07/10 14:41:31 art Exp $ */
+
+/*
+ * Copyright 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef EVENT__HAVE_KQUEUE
+
+#include <sys/types.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#include <sys/event.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#ifdef EVENT__HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+
+/* Some platforms apparently define the udata field of struct kevent as
+ * intptr_t, whereas others define it as void*. There doesn't seem to be an
+ * easy way to tell them apart via autoconf, so we need to use OS macros. */
+#if defined(EVENT__HAVE_INTTYPES_H) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__darwin__) && !defined(__APPLE__) && !defined(__CloudABI__)
+#define PTR_TO_UDATA(x) ((intptr_t)(x))
+#define INT_TO_UDATA(x) ((intptr_t)(x))
+#else
+#define PTR_TO_UDATA(x) (x)
+#define INT_TO_UDATA(x) ((void*)(x))
+#endif
+
+#include "event-internal.h"
+#include "log-internal.h"
+#include "evmap-internal.h"
+#include "event2/thread.h"
+#include "evthread-internal.h"
+#include "changelist-internal.h"
+
+#include "kqueue-internal.h"
+
+#define NEVENT 64
+
+struct kqop {
+ struct kevent *changes;
+ int changes_size;
+
+ struct kevent *events;
+ int events_size;
+ int kq;
+ int notify_event_added;
+ pid_t pid;
+};
+
+static void kqop_free(struct kqop *kqop);
+
+static void *kq_init(struct event_base *);
+static int kq_sig_add(struct event_base *, int, short, short, void *);
+static int kq_sig_del(struct event_base *, int, short, short, void *);
+static int kq_dispatch(struct event_base *, struct timeval *);
+static void kq_dealloc(struct event_base *);
+
+const struct eventop kqops = {
+ "kqueue",
+ kq_init,
+ event_changelist_add_,
+ event_changelist_del_,
+ kq_dispatch,
+ kq_dealloc,
+ 1 /* need reinit */,
+ EV_FEATURE_ET|EV_FEATURE_O1|EV_FEATURE_FDS,
+ EVENT_CHANGELIST_FDINFO_SIZE
+};
+
+static const struct eventop kqsigops = {
+ "kqueue_signal",
+ NULL,
+ kq_sig_add,
+ kq_sig_del,
+ NULL,
+ NULL,
+ 1 /* need reinit */,
+ 0,
+ 0
+};
+
+static void *
+kq_init(struct event_base *base)
+{
+ int kq = -1;
+ struct kqop *kqueueop = NULL;
+
+ if (!(kqueueop = mm_calloc(1, sizeof(struct kqop))))
+ return (NULL);
+
+/* Initialize the kernel queue */
+
+ if ((kq = kqueue()) == -1) {
+ event_warn("kqueue");
+ goto err;
+ }
+
+ kqueueop->kq = kq;
+
+ kqueueop->pid = getpid();
+
+ /* Initialize fields */
+ kqueueop->changes = mm_calloc(NEVENT, sizeof(struct kevent));
+ if (kqueueop->changes == NULL)
+ goto err;
+ kqueueop->events = mm_calloc(NEVENT, sizeof(struct kevent));
+ if (kqueueop->events == NULL)
+ goto err;
+ kqueueop->events_size = kqueueop->changes_size = NEVENT;
+
+ /* Check for Mac OS X kqueue bug. */
+ memset(&kqueueop->changes[0], 0, sizeof kqueueop->changes[0]);
+ kqueueop->changes[0].ident = -1;
+ kqueueop->changes[0].filter = EVFILT_READ;
+ kqueueop->changes[0].flags = EV_ADD;
+ /*
+ * If kqueue works, then kevent will succeed, and it will
+ * stick an error in events[0]. If kqueue is broken, then
+ * kevent will fail.
+ */
+ if (kevent(kq,
+ kqueueop->changes, 1, kqueueop->events, NEVENT, NULL) != 1 ||
+ (int)kqueueop->events[0].ident != -1 ||
+ kqueueop->events[0].flags != EV_ERROR) {
+ event_warn("%s: detected broken kqueue; not using.", __func__);
+ goto err;
+ }
+
+ base->evsigsel = &kqsigops;
+
+ return (kqueueop);
+err:
+ if (kqueueop)
+ kqop_free(kqueueop);
+
+ return (NULL);
+}
+
+#define ADD_UDATA 0x30303
+
+static void
+kq_setup_kevent(struct kevent *out, evutil_socket_t fd, int filter, short change)
+{
+ memset(out, 0, sizeof(struct kevent));
+ out->ident = fd;
+ out->filter = filter;
+
+ if (change & EV_CHANGE_ADD) {
+ out->flags = EV_ADD;
+ /* We set a magic number here so that we can tell 'add'
+ * errors from 'del' errors. */
+ out->udata = INT_TO_UDATA(ADD_UDATA);
+ if (change & EV_ET)
+ out->flags |= EV_CLEAR;
+#ifdef NOTE_EOF
+ /* Make it behave like select() and poll() */
+ if (filter == EVFILT_READ)
+ out->fflags = NOTE_EOF;
+#endif
+ } else {
+ EVUTIL_ASSERT(change & EV_CHANGE_DEL);
+ out->flags = EV_DELETE;
+ }
+}
+
+static int
+kq_build_changes_list(const struct event_changelist *changelist,
+ struct kqop *kqop)
+{
+ int i;
+ int n_changes = 0;
+
+ for (i = 0; i < changelist->n_changes; ++i) {
+ struct event_change *in_ch = &changelist->changes[i];
+ struct kevent *out_ch;
+ if (n_changes >= kqop->changes_size - 1) {
+ int newsize = kqop->changes_size * 2;
+ struct kevent *newchanges;
+
+ newchanges = mm_realloc(kqop->changes,
+ newsize * sizeof(struct kevent));
+ if (newchanges == NULL) {
+ event_warn("%s: realloc", __func__);
+ return (-1);
+ }
+ kqop->changes = newchanges;
+ kqop->changes_size = newsize;
+ }
+ if (in_ch->read_change) {
+ out_ch = &kqop->changes[n_changes++];
+ kq_setup_kevent(out_ch, in_ch->fd, EVFILT_READ,
+ in_ch->read_change);
+ }
+ if (in_ch->write_change) {
+ out_ch = &kqop->changes[n_changes++];
+ kq_setup_kevent(out_ch, in_ch->fd, EVFILT_WRITE,
+ in_ch->write_change);
+ }
+ }
+ return n_changes;
+}
+
+static int
+kq_grow_events(struct kqop *kqop, size_t new_size)
+{
+ struct kevent *newresult;
+
+ newresult = mm_realloc(kqop->events,
+ new_size * sizeof(struct kevent));
+
+ if (newresult) {
+ kqop->events = newresult;
+ kqop->events_size = new_size;
+ return 0;
+ } else {
+ return -1;
+ }
+}
+
+static int
+kq_dispatch(struct event_base *base, struct timeval *tv)
+{
+ struct kqop *kqop = base->evbase;
+ struct kevent *events = kqop->events;
+ struct kevent *changes;
+ struct timespec ts, *ts_p = NULL;
+ int i, n_changes, res;
+
+ if (tv != NULL) {
+ ts.tv_sec = tv->tv_sec;
+ ts.tv_nsec = tv->tv_usec * 1000;
+ ts_p = &ts;
+ }
+
+ /* Build "changes" from "base->changes" */
+ EVUTIL_ASSERT(kqop->changes);
+ n_changes = kq_build_changes_list(&base->changelist, kqop);
+ if (n_changes < 0)
+ return -1;
+
+ event_changelist_remove_all_(&base->changelist, base);
+
+ /* steal the changes array in case some broken code tries to call
+ * dispatch twice at once. */
+ changes = kqop->changes;
+ kqop->changes = NULL;
+
+ /* Make sure that 'events' is at least as long as the list of changes:
+ * otherwise errors in the changes can get reported as a -1 return
+ * value from kevent() rather than as EV_ERROR events in the events
+ * array.
+ *
+ * (We could instead handle -1 return values from kevent() by
+ * retrying with a smaller changes array or a larger events array,
+ * but this approach seems less risky for now.)
+ */
+ if (kqop->events_size < n_changes) {
+ int new_size = kqop->events_size;
+ do {
+ new_size *= 2;
+ } while (new_size < n_changes);
+
+ kq_grow_events(kqop, new_size);
+ events = kqop->events;
+ }
+
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+
+ res = kevent(kqop->kq, changes, n_changes,
+ events, kqop->events_size, ts_p);
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+
+ EVUTIL_ASSERT(kqop->changes == NULL);
+ kqop->changes = changes;
+
+ if (res == -1) {
+ if (errno != EINTR) {
+ event_warn("kevent");
+ return (-1);
+ }
+
+ return (0);
+ }
+
+ event_debug(("%s: kevent reports %d", __func__, res));
+
+ for (i = 0; i < res; i++) {
+ int which = 0;
+
+ if (events[i].flags & EV_ERROR) {
+ switch (events[i].data) {
+
+ /* Can occur on delete if we are not currently
+ * watching any events on this fd. That can
+ * happen when the fd was closed and another
+ * file was opened with that fd. */
+ case ENOENT:
+ /* Can occur for reasons not fully understood
+ * on FreeBSD. */
+ case EINVAL:
+ continue;
+#if defined(__FreeBSD__)
+ /*
+ * This currently occurs if an FD is closed
+ * before the EV_DELETE makes it out via kevent().
+ * The FreeBSD capabilities code sees the blank
+ * capability set and rejects the request to
+ * modify an event.
+ *
+ * To be strictly correct - when an FD is closed,
+ * all the registered events are also removed.
+ * Queuing EV_DELETE to a closed FD is wrong.
+ * The event(s) should just be deleted from
+ * the pending changelist.
+ */
+ case ENOTCAPABLE:
+ continue;
+#endif
+
+ /* Can occur on a delete if the fd is closed. */
+ case EBADF:
+ /* XXXX On NetBSD, we can also get EBADF if we
+ * try to add the write side of a pipe, but
+ * the read side has already been closed.
+ * Other BSDs call this situation 'EPIPE'. It
+ * would be good if we had a way to report
+ * this situation. */
+ continue;
+ /* These two can occur on an add if the fd was one side
+ * of a pipe, and the other side was closed. */
+ case EPERM:
+ case EPIPE:
+ /* Report read events, if we're listening for
+ * them, so that the user can learn about any
+ * add errors. (If the operation was a
+ * delete, then udata should be cleared.) */
+ if (events[i].udata) {
+ /* The operation was an add:
+ * report the error as a read. */
+ which |= EV_READ;
+ break;
+ } else {
+ /* The operation was a del:
+ * report nothing. */
+ continue;
+ }
+
+ /* Other errors shouldn't occur. */
+ default:
+ errno = events[i].data;
+ return (-1);
+ }
+ } else if (events[i].filter == EVFILT_READ) {
+ which |= EV_READ;
+ } else if (events[i].filter == EVFILT_WRITE) {
+ which |= EV_WRITE;
+ } else if (events[i].filter == EVFILT_SIGNAL) {
+ which |= EV_SIGNAL;
+#ifdef EVFILT_USER
+ } else if (events[i].filter == EVFILT_USER) {
+ base->is_notify_pending = 0;
+#endif
+ }
+
+ if (!which)
+ continue;
+
+ if (events[i].filter == EVFILT_SIGNAL) {
+ evmap_signal_active_(base, events[i].ident, 1);
+ } else {
+ evmap_io_active_(base, events[i].ident, which | EV_ET);
+ }
+ }
+
+ if (res == kqop->events_size) {
+ /* We used all the events space that we have. Maybe we should
+ make it bigger. */
+ kq_grow_events(kqop, kqop->events_size * 2);
+ }
+
+ return (0);
+}
+
+static void
+kqop_free(struct kqop *kqop)
+{
+ if (kqop->changes)
+ mm_free(kqop->changes);
+ if (kqop->events)
+ mm_free(kqop->events);
+ if (kqop->kq >= 0 && kqop->pid == getpid())
+ close(kqop->kq);
+ memset(kqop, 0, sizeof(struct kqop));
+ mm_free(kqop);
+}
+
+static void
+kq_dealloc(struct event_base *base)
+{
+ struct kqop *kqop = base->evbase;
+ evsig_dealloc_(base);
+ kqop_free(kqop);
+}
+
+/* signal handling */
+static int
+kq_sig_add(struct event_base *base, int nsignal, short old, short events, void *p)
+{
+ struct kqop *kqop = base->evbase;
+ struct kevent kev;
+ struct timespec timeout = { 0, 0 };
+ (void)p;
+
+ EVUTIL_ASSERT(nsignal >= 0 && nsignal < NSIG);
+
+ memset(&kev, 0, sizeof(kev));
+ kev.ident = nsignal;
+ kev.filter = EVFILT_SIGNAL;
+ kev.flags = EV_ADD;
+
+ /* Be ready for the signal if it is sent any
+ * time between now and the next call to
+ * kq_dispatch. */
+ if (kevent(kqop->kq, &kev, 1, NULL, 0, &timeout) == -1)
+ return (-1);
+
+ /* We can set the handler for most signals to SIG_IGN and
+ * still have them reported to us in the queue. However,
+ * if the handler for SIGCHLD is SIG_IGN, the system reaps
+ * zombie processes for us, and we don't get any notification.
+ * This appears to be the only signal with this quirk. */
+ if (evsig_set_handler_(base, nsignal,
+ nsignal == SIGCHLD ? SIG_DFL : SIG_IGN) == -1)
+ return (-1);
+
+ return (0);
+}
+
+static int
+kq_sig_del(struct event_base *base, int nsignal, short old, short events, void *p)
+{
+ struct kqop *kqop = base->evbase;
+ struct kevent kev;
+
+ struct timespec timeout = { 0, 0 };
+ (void)p;
+
+ EVUTIL_ASSERT(nsignal >= 0 && nsignal < NSIG);
+
+ memset(&kev, 0, sizeof(kev));
+ kev.ident = nsignal;
+ kev.filter = EVFILT_SIGNAL;
+ kev.flags = EV_DELETE;
+
+ /* Because we insert signal events
+ * immediately, we need to delete them
+ * immediately, too */
+ if (kevent(kqop->kq, &kev, 1, NULL, 0, &timeout) == -1)
+ return (-1);
+
+ if (evsig_restore_handler_(base, nsignal) == -1)
+ return (-1);
+
+ return (0);
+}
+
+
+/* OSX 10.6 and FreeBSD 8.1 add support for EVFILT_USER, which we can use
+ * to wake up the event loop from another thread. */
+
+/* Magic number we use for our filter ID. */
+#define NOTIFY_IDENT 42
+
+int
+event_kq_add_notify_event_(struct event_base *base)
+{
+ struct kqop *kqop = base->evbase;
+#if defined(EVFILT_USER) && defined(NOTE_TRIGGER)
+ struct kevent kev;
+ struct timespec timeout = { 0, 0 };
+#endif
+
+ if (kqop->notify_event_added)
+ return 0;
+
+#if defined(EVFILT_USER) && defined(NOTE_TRIGGER)
+ memset(&kev, 0, sizeof(kev));
+ kev.ident = NOTIFY_IDENT;
+ kev.filter = EVFILT_USER;
+ kev.flags = EV_ADD | EV_CLEAR;
+
+ if (kevent(kqop->kq, &kev, 1, NULL, 0, &timeout) == -1) {
+ event_warn("kevent: adding EVFILT_USER event");
+ return -1;
+ }
+
+ kqop->notify_event_added = 1;
+
+ return 0;
+#else
+ return -1;
+#endif
+}
+
+int
+event_kq_notify_base_(struct event_base *base)
+{
+ struct kqop *kqop = base->evbase;
+#if defined(EVFILT_USER) && defined(NOTE_TRIGGER)
+ struct kevent kev;
+ struct timespec timeout = { 0, 0 };
+#endif
+ if (! kqop->notify_event_added)
+ return -1;
+
+#if defined(EVFILT_USER) && defined(NOTE_TRIGGER)
+ memset(&kev, 0, sizeof(kev));
+ kev.ident = NOTIFY_IDENT;
+ kev.filter = EVFILT_USER;
+ kev.fflags = NOTE_TRIGGER;
+
+ if (kevent(kqop->kq, &kev, 1, NULL, 0, &timeout) == -1) {
+ event_warn("kevent: triggering EVFILT_USER event");
+ return -1;
+ }
+
+ return 0;
+#else
+ return -1;
+#endif
+}
+
+#endif /* EVENT__HAVE_KQUEUE */
diff --git a/protocols/Telegram/tgl/libevent/libevent.lib b/protocols/Telegram/tgl/libevent/libevent.lib
new file mode 100644
index 0000000000..c1beefd6af
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/libevent.lib
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/libevent.pc.in b/protocols/Telegram/tgl/libevent/libevent.pc.in
new file mode 100644
index 0000000000..7030884eeb
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/libevent.pc.in
@@ -0,0 +1,16 @@
+#libevent pkg-config source file
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libevent
+Description: libevent is an asynchronous notification event loop library
+Version: @VERSION@
+Requires:
+Conflicts:
+Libs: -L${libdir} -levent
+Libs.private: @LIBS@
+Cflags: -I${includedir}
+
diff --git a/protocols/Telegram/tgl/libevent/libevent_core.lib b/protocols/Telegram/tgl/libevent/libevent_core.lib
new file mode 100644
index 0000000000..36bcb0e417
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/libevent_core.lib
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/libevent_extras.lib b/protocols/Telegram/tgl/libevent/libevent_extras.lib
new file mode 100644
index 0000000000..44f6619eaf
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/libevent_extras.lib
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/libevent_openssl.pc.in b/protocols/Telegram/tgl/libevent/libevent_openssl.pc.in
new file mode 100644
index 0000000000..a65d1e0668
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/libevent_openssl.pc.in
@@ -0,0 +1,16 @@
+#libevent pkg-config source file
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libevent_openssl
+Description: libevent_openssl adds openssl-based TLS support to libevent
+Version: @VERSION@
+Requires: libevent
+Conflicts:
+Libs: -L${libdir} -levent_openssl
+Libs.private: @LIBS@ @OPENSSL_LIBS@
+Cflags: -I${includedir} @OPENSSL_INCS@
+
diff --git a/protocols/Telegram/tgl/libevent/libevent_pthreads.pc.in b/protocols/Telegram/tgl/libevent/libevent_pthreads.pc.in
new file mode 100644
index 0000000000..9bc2392b34
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/libevent_pthreads.pc.in
@@ -0,0 +1,16 @@
+#libevent pkg-config source file
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libevent_pthreads
+Description: libevent_pthreads adds pthreads-based threading support to libevent
+Version: @VERSION@
+Requires: libevent
+Conflicts:
+Libs: -L${libdir} -levent_pthreads
+Libs.private: @LIBS@ @PTHREAD_LIBS@
+Cflags: -I${includedir} @PTHREAD_CFLAGS@
+
diff --git a/protocols/Telegram/tgl/libevent/listener.c b/protocols/Telegram/tgl/libevent/listener.c
new file mode 100644
index 0000000000..2af14e3a7b
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/listener.c
@@ -0,0 +1,889 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos, Nick Mathewson
+ *
+ * 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 "event2/event-config.h"
+#include "evconfig-private.h"
+
+#include <sys/types.h>
+
+#ifdef _WIN32
+#ifndef _WIN32_WINNT
+/* Minimum required for InitializeCriticalSectionAndSpinCount */
+#define _WIN32_WINNT 0x0403
+#endif
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#include <mswsock.h>
+#endif
+#include <errno.h>
+#ifdef EVENT__HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef EVENT__HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include "event2/listener.h"
+#include "event2/util.h"
+#include "event2/event.h"
+#include "event2/event_struct.h"
+#include "mm-internal.h"
+#include "util-internal.h"
+#include "log-internal.h"
+#include "evthread-internal.h"
+#ifdef _WIN32
+#include "iocp-internal.h"
+#include "defer-internal.h"
+#include "event-internal.h"
+#endif
+
+struct evconnlistener_ops {
+ int (*enable)(struct evconnlistener *);
+ int (*disable)(struct evconnlistener *);
+ void (*destroy)(struct evconnlistener *);
+ void (*shutdown)(struct evconnlistener *);
+ evutil_socket_t (*getfd)(struct evconnlistener *);
+ struct event_base *(*getbase)(struct evconnlistener *);
+};
+
+struct evconnlistener {
+ const struct evconnlistener_ops *ops;
+ void *lock;
+ evconnlistener_cb cb;
+ evconnlistener_errorcb errorcb;
+ void *user_data;
+ unsigned flags;
+ short refcnt;
+ int accept4_flags;
+ unsigned enabled : 1;
+};
+
+struct evconnlistener_event {
+ struct evconnlistener base;
+ struct event listener;
+};
+
+#ifdef _WIN32
+struct evconnlistener_iocp {
+ struct evconnlistener base;
+ evutil_socket_t fd;
+ struct event_base *event_base;
+ struct event_iocp_port *port;
+ short n_accepting;
+ unsigned shutting_down : 1;
+ unsigned event_added : 1;
+ struct accepting_socket **accepting;
+};
+#endif
+
+#define LOCK(listener) EVLOCK_LOCK((listener)->lock, 0)
+#define UNLOCK(listener) EVLOCK_UNLOCK((listener)->lock, 0)
+
+struct evconnlistener *
+evconnlistener_new_async(struct event_base *base,
+ evconnlistener_cb cb, void *ptr, unsigned flags, int backlog,
+ evutil_socket_t fd); /* XXXX export this? */
+
+static int event_listener_enable(struct evconnlistener *);
+static int event_listener_disable(struct evconnlistener *);
+static void event_listener_destroy(struct evconnlistener *);
+static evutil_socket_t event_listener_getfd(struct evconnlistener *);
+static struct event_base *event_listener_getbase(struct evconnlistener *);
+
+#if 0
+static void
+listener_incref_and_lock(struct evconnlistener *listener)
+{
+ LOCK(listener);
+ ++listener->refcnt;
+}
+#endif
+
+static int
+listener_decref_and_unlock(struct evconnlistener *listener)
+{
+ int refcnt = --listener->refcnt;
+ if (refcnt == 0) {
+ listener->ops->destroy(listener);
+ UNLOCK(listener);
+ EVTHREAD_FREE_LOCK(listener->lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+ mm_free(listener);
+ return 1;
+ } else {
+ UNLOCK(listener);
+ return 0;
+ }
+}
+
+static const struct evconnlistener_ops evconnlistener_event_ops = {
+ event_listener_enable,
+ event_listener_disable,
+ event_listener_destroy,
+ NULL, /* shutdown */
+ event_listener_getfd,
+ event_listener_getbase
+};
+
+static void listener_read_cb(evutil_socket_t, short, void *);
+
+struct evconnlistener *
+evconnlistener_new(struct event_base *base,
+ evconnlistener_cb cb, void *ptr, unsigned flags, int backlog,
+ evutil_socket_t fd)
+{
+ struct evconnlistener_event *lev;
+
+#ifdef _WIN32
+ if (base && event_base_get_iocp_(base)) {
+ const struct win32_extension_fns *ext =
+ event_get_win32_extension_fns_();
+ if (ext->AcceptEx && ext->GetAcceptExSockaddrs)
+ return evconnlistener_new_async(base, cb, ptr, flags,
+ backlog, fd);
+ }
+#endif
+
+ if (backlog > 0) {
+ if (listen(fd, backlog) < 0)
+ return NULL;
+ } else if (backlog < 0) {
+ if (listen(fd, 128) < 0)
+ return NULL;
+ }
+
+ lev = mm_calloc(1, sizeof(struct evconnlistener_event));
+ if (!lev)
+ return NULL;
+
+ lev->base.ops = &evconnlistener_event_ops;
+ lev->base.cb = cb;
+ lev->base.user_data = ptr;
+ lev->base.flags = flags;
+ lev->base.refcnt = 1;
+
+ lev->base.accept4_flags = 0;
+ if (!(flags & LEV_OPT_LEAVE_SOCKETS_BLOCKING))
+ lev->base.accept4_flags |= EVUTIL_SOCK_NONBLOCK;
+ if (flags & LEV_OPT_CLOSE_ON_EXEC)
+ lev->base.accept4_flags |= EVUTIL_SOCK_CLOEXEC;
+
+ if (flags & LEV_OPT_THREADSAFE) {
+ EVTHREAD_ALLOC_LOCK(lev->base.lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+ }
+
+ event_assign(&lev->listener, base, fd, EV_READ|EV_PERSIST,
+ listener_read_cb, lev);
+
+ if (!(flags & LEV_OPT_DISABLED))
+ evconnlistener_enable(&lev->base);
+
+ return &lev->base;
+}
+
+struct evconnlistener *
+evconnlistener_new_bind(struct event_base *base, evconnlistener_cb cb,
+ void *ptr, unsigned flags, int backlog, const struct sockaddr *sa,
+ int socklen)
+{
+ struct evconnlistener *listener;
+ evutil_socket_t fd;
+ int on = 1;
+ int family = sa ? sa->sa_family : AF_UNSPEC;
+ int socktype = SOCK_STREAM | EVUTIL_SOCK_NONBLOCK;
+
+ if (backlog == 0)
+ return NULL;
+
+ if (flags & LEV_OPT_CLOSE_ON_EXEC)
+ socktype |= EVUTIL_SOCK_CLOEXEC;
+
+ fd = evutil_socket_(family, socktype, 0);
+ if (fd == -1)
+ return NULL;
+
+ if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (void*)&on, sizeof(on))<0)
+ goto err;
+
+ if (flags & LEV_OPT_REUSEABLE) {
+ if (evutil_make_listen_socket_reuseable(fd) < 0)
+ goto err;
+ }
+
+ if (flags & LEV_OPT_REUSEABLE_PORT) {
+ if (evutil_make_listen_socket_reuseable_port(fd) < 0)
+ goto err;
+ }
+
+ if (flags & LEV_OPT_DEFERRED_ACCEPT) {
+ if (evutil_make_tcp_listen_socket_deferred(fd) < 0)
+ goto err;
+ }
+
+ if (sa) {
+ if (bind(fd, sa, socklen)<0)
+ goto err;
+ }
+
+ listener = evconnlistener_new(base, cb, ptr, flags, backlog, fd);
+ if (!listener)
+ goto err;
+
+ return listener;
+err:
+ evutil_closesocket(fd);
+ return NULL;
+}
+
+void
+evconnlistener_free(struct evconnlistener *lev)
+{
+ LOCK(lev);
+ lev->cb = NULL;
+ lev->errorcb = NULL;
+ if (lev->ops->shutdown)
+ lev->ops->shutdown(lev);
+ listener_decref_and_unlock(lev);
+}
+
+static void
+event_listener_destroy(struct evconnlistener *lev)
+{
+ struct evconnlistener_event *lev_e =
+ EVUTIL_UPCAST(lev, struct evconnlistener_event, base);
+
+ event_del(&lev_e->listener);
+ if (lev->flags & LEV_OPT_CLOSE_ON_FREE)
+ evutil_closesocket(event_get_fd(&lev_e->listener));
+ event_debug_unassign(&lev_e->listener);
+}
+
+int
+evconnlistener_enable(struct evconnlistener *lev)
+{
+ int r;
+ LOCK(lev);
+ lev->enabled = 1;
+ if (lev->cb)
+ r = lev->ops->enable(lev);
+ else
+ r = 0;
+ UNLOCK(lev);
+ return r;
+}
+
+int
+evconnlistener_disable(struct evconnlistener *lev)
+{
+ int r;
+ LOCK(lev);
+ lev->enabled = 0;
+ r = lev->ops->disable(lev);
+ UNLOCK(lev);
+ return r;
+}
+
+static int
+event_listener_enable(struct evconnlistener *lev)
+{
+ struct evconnlistener_event *lev_e =
+ EVUTIL_UPCAST(lev, struct evconnlistener_event, base);
+ return event_add(&lev_e->listener, NULL);
+}
+
+static int
+event_listener_disable(struct evconnlistener *lev)
+{
+ struct evconnlistener_event *lev_e =
+ EVUTIL_UPCAST(lev, struct evconnlistener_event, base);
+ return event_del(&lev_e->listener);
+}
+
+evutil_socket_t
+evconnlistener_get_fd(struct evconnlistener *lev)
+{
+ evutil_socket_t fd;
+ LOCK(lev);
+ fd = lev->ops->getfd(lev);
+ UNLOCK(lev);
+ return fd;
+}
+
+static evutil_socket_t
+event_listener_getfd(struct evconnlistener *lev)
+{
+ struct evconnlistener_event *lev_e =
+ EVUTIL_UPCAST(lev, struct evconnlistener_event, base);
+ return event_get_fd(&lev_e->listener);
+}
+
+struct event_base *
+evconnlistener_get_base(struct evconnlistener *lev)
+{
+ struct event_base *base;
+ LOCK(lev);
+ base = lev->ops->getbase(lev);
+ UNLOCK(lev);
+ return base;
+}
+
+static struct event_base *
+event_listener_getbase(struct evconnlistener *lev)
+{
+ struct evconnlistener_event *lev_e =
+ EVUTIL_UPCAST(lev, struct evconnlistener_event, base);
+ return event_get_base(&lev_e->listener);
+}
+
+void
+evconnlistener_set_cb(struct evconnlistener *lev,
+ evconnlistener_cb cb, void *arg)
+{
+ int enable = 0;
+ LOCK(lev);
+ if (lev->enabled && !lev->cb)
+ enable = 1;
+ lev->cb = cb;
+ lev->user_data = arg;
+ if (enable)
+ evconnlistener_enable(lev);
+ UNLOCK(lev);
+}
+
+void
+evconnlistener_set_error_cb(struct evconnlistener *lev,
+ evconnlistener_errorcb errorcb)
+{
+ LOCK(lev);
+ lev->errorcb = errorcb;
+ UNLOCK(lev);
+}
+
+static void
+listener_read_cb(evutil_socket_t fd, short what, void *p)
+{
+ struct evconnlistener *lev = p;
+ int err;
+ evconnlistener_cb cb;
+ evconnlistener_errorcb errorcb;
+ void *user_data;
+ LOCK(lev);
+ while (1) {
+ struct sockaddr_storage ss;
+ ev_socklen_t socklen = sizeof(ss);
+ evutil_socket_t new_fd = evutil_accept4_(fd, (struct sockaddr*)&ss, &socklen, lev->accept4_flags);
+ if (new_fd < 0)
+ break;
+ if (socklen == 0) {
+ /* This can happen with some older linux kernels in
+ * response to nmap. */
+ evutil_closesocket(new_fd);
+ continue;
+ }
+
+ if (lev->cb == NULL) {
+ evutil_closesocket(new_fd);
+ UNLOCK(lev);
+ return;
+ }
+ ++lev->refcnt;
+ cb = lev->cb;
+ user_data = lev->user_data;
+ UNLOCK(lev);
+ cb(lev, new_fd, (struct sockaddr*)&ss, (int)socklen,
+ user_data);
+ LOCK(lev);
+ if (lev->refcnt == 1) {
+ int freed = listener_decref_and_unlock(lev);
+ EVUTIL_ASSERT(freed);
+
+ evutil_closesocket(new_fd);
+ return;
+ }
+ --lev->refcnt;
+ }
+ err = evutil_socket_geterror(fd);
+ if (EVUTIL_ERR_ACCEPT_RETRIABLE(err)) {
+ UNLOCK(lev);
+ return;
+ }
+ if (lev->errorcb != NULL) {
+ ++lev->refcnt;
+ errorcb = lev->errorcb;
+ user_data = lev->user_data;
+ UNLOCK(lev);
+ errorcb(lev, user_data);
+ LOCK(lev);
+ listener_decref_and_unlock(lev);
+ } else {
+ event_sock_warn(fd, "Error from accept() call");
+ }
+}
+
+#ifdef _WIN32
+struct accepting_socket {
+ CRITICAL_SECTION lock;
+ struct event_overlapped overlapped;
+ SOCKET s;
+ int error;
+ struct event_callback deferred;
+ struct evconnlistener_iocp *lev;
+ ev_uint8_t buflen;
+ ev_uint8_t family;
+ unsigned free_on_cb:1;
+ char addrbuf[1];
+};
+
+static void accepted_socket_cb(struct event_overlapped *o, ev_uintptr_t key,
+ ev_ssize_t n, int ok);
+static void accepted_socket_invoke_user_cb(struct event_callback *cb, void *arg);
+
+static void
+iocp_listener_event_add(struct evconnlistener_iocp *lev)
+{
+ if (lev->event_added)
+ return;
+
+ lev->event_added = 1;
+ event_base_add_virtual_(lev->event_base);
+}
+
+static void
+iocp_listener_event_del(struct evconnlistener_iocp *lev)
+{
+ if (!lev->event_added)
+ return;
+
+ lev->event_added = 0;
+ event_base_del_virtual_(lev->event_base);
+}
+
+static struct accepting_socket *
+new_accepting_socket(struct evconnlistener_iocp *lev, int family)
+{
+ struct accepting_socket *res;
+ int addrlen;
+ int buflen;
+
+ if (family == AF_INET)
+ addrlen = sizeof(struct sockaddr_in);
+ else if (family == AF_INET6)
+ addrlen = sizeof(struct sockaddr_in6);
+ else
+ return NULL;
+ buflen = (addrlen+16)*2;
+
+ res = mm_calloc(1,sizeof(struct accepting_socket)-1+buflen);
+ if (!res)
+ return NULL;
+
+ event_overlapped_init_(&res->overlapped, accepted_socket_cb);
+ res->s = INVALID_SOCKET;
+ res->lev = lev;
+ res->buflen = buflen;
+ res->family = family;
+
+ event_deferred_cb_init_(&res->deferred,
+ event_base_get_npriorities(lev->event_base) / 2,
+ accepted_socket_invoke_user_cb, res);
+
+ InitializeCriticalSectionAndSpinCount(&res->lock, 1000);
+
+ return res;
+}
+
+static void
+free_and_unlock_accepting_socket(struct accepting_socket *as)
+{
+ /* requires lock. */
+ if (as->s != INVALID_SOCKET)
+ closesocket(as->s);
+
+ LeaveCriticalSection(&as->lock);
+ DeleteCriticalSection(&as->lock);
+ mm_free(as);
+}
+
+static int
+start_accepting(struct accepting_socket *as)
+{
+ /* requires lock */
+ const struct win32_extension_fns *ext = event_get_win32_extension_fns_();
+ DWORD pending = 0;
+ SOCKET s = socket(as->family, SOCK_STREAM, 0);
+ int error = 0;
+
+ if (!as->lev->base.enabled)
+ return 0;
+
+ if (s == INVALID_SOCKET) {
+ error = WSAGetLastError();
+ goto report_err;
+ }
+
+ /* XXXX It turns out we need to do this again later. Does this call
+ * have any effect? */
+ setsockopt(s, SOL_SOCKET, SO_UPDATE_ACCEPT_CONTEXT,
+ (char *)&as->lev->fd, sizeof(&as->lev->fd));
+
+ if (!(as->lev->base.flags & LEV_OPT_LEAVE_SOCKETS_BLOCKING))
+ evutil_make_socket_nonblocking(s);
+
+ if (event_iocp_port_associate_(as->lev->port, s, 1) < 0) {
+ closesocket(s);
+ return -1;
+ }
+
+ as->s = s;
+
+ if (ext->AcceptEx(as->lev->fd, s, as->addrbuf, 0,
+ as->buflen/2, as->buflen/2, &pending, &as->overlapped.overlapped))
+ {
+ /* Immediate success! */
+ accepted_socket_cb(&as->overlapped, 1, 0, 1);
+ } else {
+ error = WSAGetLastError();
+ if (error != ERROR_IO_PENDING) {
+ goto report_err;
+ }
+ }
+
+ return 0;
+
+report_err:
+ as->error = error;
+ event_deferred_cb_schedule_(
+ as->lev->event_base,
+ &as->deferred);
+ return 0;
+}
+
+static void
+stop_accepting(struct accepting_socket *as)
+{
+ /* requires lock. */
+ SOCKET s = as->s;
+ as->s = INVALID_SOCKET;
+ closesocket(s);
+}
+
+static void
+accepted_socket_invoke_user_cb(struct event_callback *dcb, void *arg)
+{
+ struct accepting_socket *as = arg;
+
+ struct sockaddr *sa_local=NULL, *sa_remote=NULL;
+ int socklen_local=0, socklen_remote=0;
+ const struct win32_extension_fns *ext = event_get_win32_extension_fns_();
+ struct evconnlistener *lev = &as->lev->base;
+ evutil_socket_t sock=-1;
+ void *data;
+ evconnlistener_cb cb=NULL;
+ evconnlistener_errorcb errorcb=NULL;
+ int error;
+
+ EVUTIL_ASSERT(ext->GetAcceptExSockaddrs);
+
+ LOCK(lev);
+ EnterCriticalSection(&as->lock);
+ if (as->free_on_cb) {
+ free_and_unlock_accepting_socket(as);
+ listener_decref_and_unlock(lev);
+ return;
+ }
+
+ ++lev->refcnt;
+
+ error = as->error;
+ if (error) {
+ as->error = 0;
+ errorcb = lev->errorcb;
+ } else {
+ ext->GetAcceptExSockaddrs(
+ as->addrbuf, 0, as->buflen/2, as->buflen/2,
+ &sa_local, &socklen_local, &sa_remote,
+ &socklen_remote);
+ sock = as->s;
+ cb = lev->cb;
+ as->s = INVALID_SOCKET;
+
+ /* We need to call this so getsockname, getpeername, and
+ * shutdown work correctly on the accepted socket. */
+ /* XXXX handle error? */
+ setsockopt(sock, SOL_SOCKET, SO_UPDATE_ACCEPT_CONTEXT,
+ (char *)&as->lev->fd, sizeof(&as->lev->fd));
+ }
+ data = lev->user_data;
+
+ LeaveCriticalSection(&as->lock);
+ UNLOCK(lev);
+
+ if (errorcb) {
+ WSASetLastError(error);
+ errorcb(lev, data);
+ } else if (cb) {
+ cb(lev, sock, sa_remote, socklen_remote, data);
+ }
+
+ LOCK(lev);
+ if (listener_decref_and_unlock(lev))
+ return;
+
+ EnterCriticalSection(&as->lock);
+ start_accepting(as);
+ LeaveCriticalSection(&as->lock);
+}
+
+static void
+accepted_socket_cb(struct event_overlapped *o, ev_uintptr_t key, ev_ssize_t n, int ok)
+{
+ struct accepting_socket *as =
+ EVUTIL_UPCAST(o, struct accepting_socket, overlapped);
+
+ LOCK(&as->lev->base);
+ EnterCriticalSection(&as->lock);
+ if (ok) {
+ /* XXXX Don't do this if some EV_MT flag is set. */
+ event_deferred_cb_schedule_(
+ as->lev->event_base,
+ &as->deferred);
+ LeaveCriticalSection(&as->lock);
+ } else if (as->free_on_cb) {
+ struct evconnlistener *lev = &as->lev->base;
+ free_and_unlock_accepting_socket(as);
+ listener_decref_and_unlock(lev);
+ return;
+ } else if (as->s == INVALID_SOCKET) {
+ /* This is okay; we were disabled by iocp_listener_disable. */
+ LeaveCriticalSection(&as->lock);
+ } else {
+ /* Some error on accept that we couldn't actually handle. */
+ BOOL ok;
+ DWORD transfer = 0, flags=0;
+ event_sock_warn(as->s, "Unexpected error on AcceptEx");
+ ok = WSAGetOverlappedResult(as->s, &o->overlapped,
+ &transfer, FALSE, &flags);
+ if (ok) {
+ /* well, that was confusing! */
+ as->error = 1;
+ } else {
+ as->error = WSAGetLastError();
+ }
+ event_deferred_cb_schedule_(
+ as->lev->event_base,
+ &as->deferred);
+ LeaveCriticalSection(&as->lock);
+ }
+ UNLOCK(&as->lev->base);
+}
+
+static int
+iocp_listener_enable(struct evconnlistener *lev)
+{
+ int i;
+ struct evconnlistener_iocp *lev_iocp =
+ EVUTIL_UPCAST(lev, struct evconnlistener_iocp, base);
+
+ LOCK(lev);
+ iocp_listener_event_add(lev_iocp);
+ for (i = 0; i < lev_iocp->n_accepting; ++i) {
+ struct accepting_socket *as = lev_iocp->accepting[i];
+ if (!as)
+ continue;
+ EnterCriticalSection(&as->lock);
+ if (!as->free_on_cb && as->s == INVALID_SOCKET)
+ start_accepting(as);
+ LeaveCriticalSection(&as->lock);
+ }
+ UNLOCK(lev);
+ return 0;
+}
+
+static int
+iocp_listener_disable_impl(struct evconnlistener *lev, int shutdown)
+{
+ int i;
+ struct evconnlistener_iocp *lev_iocp =
+ EVUTIL_UPCAST(lev, struct evconnlistener_iocp, base);
+
+ LOCK(lev);
+ iocp_listener_event_del(lev_iocp);
+ for (i = 0; i < lev_iocp->n_accepting; ++i) {
+ struct accepting_socket *as = lev_iocp->accepting[i];
+ if (!as)
+ continue;
+ EnterCriticalSection(&as->lock);
+ if (!as->free_on_cb && as->s != INVALID_SOCKET) {
+ if (shutdown)
+ as->free_on_cb = 1;
+ stop_accepting(as);
+ }
+ LeaveCriticalSection(&as->lock);
+ }
+
+ if (shutdown && lev->flags & LEV_OPT_CLOSE_ON_FREE)
+ evutil_closesocket(lev_iocp->fd);
+
+ UNLOCK(lev);
+ return 0;
+}
+
+static int
+iocp_listener_disable(struct evconnlistener *lev)
+{
+ return iocp_listener_disable_impl(lev,0);
+}
+
+static void
+iocp_listener_destroy(struct evconnlistener *lev)
+{
+ struct evconnlistener_iocp *lev_iocp =
+ EVUTIL_UPCAST(lev, struct evconnlistener_iocp, base);
+
+ if (! lev_iocp->shutting_down) {
+ lev_iocp->shutting_down = 1;
+ iocp_listener_disable_impl(lev,1);
+ }
+
+}
+
+static evutil_socket_t
+iocp_listener_getfd(struct evconnlistener *lev)
+{
+ struct evconnlistener_iocp *lev_iocp =
+ EVUTIL_UPCAST(lev, struct evconnlistener_iocp, base);
+ return lev_iocp->fd;
+}
+static struct event_base *
+iocp_listener_getbase(struct evconnlistener *lev)
+{
+ struct evconnlistener_iocp *lev_iocp =
+ EVUTIL_UPCAST(lev, struct evconnlistener_iocp, base);
+ return lev_iocp->event_base;
+}
+
+static const struct evconnlistener_ops evconnlistener_iocp_ops = {
+ iocp_listener_enable,
+ iocp_listener_disable,
+ iocp_listener_destroy,
+ iocp_listener_destroy, /* shutdown */
+ iocp_listener_getfd,
+ iocp_listener_getbase
+};
+
+/* XXX define some way to override this. */
+#define N_SOCKETS_PER_LISTENER 4
+
+struct evconnlistener *
+evconnlistener_new_async(struct event_base *base,
+ evconnlistener_cb cb, void *ptr, unsigned flags, int backlog,
+ evutil_socket_t fd)
+{
+ struct sockaddr_storage ss;
+ int socklen = sizeof(ss);
+ struct evconnlistener_iocp *lev;
+ int i;
+
+ flags |= LEV_OPT_THREADSAFE;
+
+ if (!base || !event_base_get_iocp_(base))
+ goto err;
+
+ /* XXXX duplicate code */
+ if (backlog > 0) {
+ if (listen(fd, backlog) < 0)
+ goto err;
+ } else if (backlog < 0) {
+ if (listen(fd, 128) < 0)
+ goto err;
+ }
+ if (getsockname(fd, (struct sockaddr*)&ss, &socklen)) {
+ event_sock_warn(fd, "getsockname");
+ goto err;
+ }
+ lev = mm_calloc(1, sizeof(struct evconnlistener_iocp));
+ if (!lev) {
+ event_warn("calloc");
+ goto err;
+ }
+ lev->base.ops = &evconnlistener_iocp_ops;
+ lev->base.cb = cb;
+ lev->base.user_data = ptr;
+ lev->base.flags = flags;
+ lev->base.refcnt = 1;
+ lev->base.enabled = 1;
+
+ lev->port = event_base_get_iocp_(base);
+ lev->fd = fd;
+ lev->event_base = base;
+
+
+ if (event_iocp_port_associate_(lev->port, fd, 1) < 0)
+ goto err_free_lev;
+
+ EVTHREAD_ALLOC_LOCK(lev->base.lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+
+ lev->n_accepting = N_SOCKETS_PER_LISTENER;
+ lev->accepting = mm_calloc(lev->n_accepting,
+ sizeof(struct accepting_socket *));
+ if (!lev->accepting) {
+ event_warn("calloc");
+ goto err_delete_lock;
+ }
+ for (i = 0; i < lev->n_accepting; ++i) {
+ lev->accepting[i] = new_accepting_socket(lev, ss.ss_family);
+ if (!lev->accepting[i]) {
+ event_warnx("Couldn't create accepting socket");
+ goto err_free_accepting;
+ }
+ if (cb && start_accepting(lev->accepting[i]) < 0) {
+ event_warnx("Couldn't start accepting on socket");
+ EnterCriticalSection(&lev->accepting[i]->lock);
+ free_and_unlock_accepting_socket(lev->accepting[i]);
+ goto err_free_accepting;
+ }
+ ++lev->base.refcnt;
+ }
+
+ iocp_listener_event_add(lev);
+
+ return &lev->base;
+
+err_free_accepting:
+ mm_free(lev->accepting);
+ /* XXXX free the other elements. */
+err_delete_lock:
+ EVTHREAD_FREE_LOCK(lev->base.lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+err_free_lev:
+ mm_free(lev);
+err:
+ /* Don't close the fd, it is caller's responsibility. */
+ return NULL;
+}
+
+#endif
diff --git a/protocols/Telegram/tgl/libevent/listener.obj b/protocols/Telegram/tgl/libevent/listener.obj
new file mode 100644
index 0000000000..5791e090eb
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/listener.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/log-internal.h b/protocols/Telegram/tgl/libevent/log-internal.h
new file mode 100644
index 0000000000..330478a9ed
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/log-internal.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef LOG_INTERNAL_H_INCLUDED_
+#define LOG_INTERNAL_H_INCLUDED_
+
+#include "event2/util.h"
+
+#ifdef __GNUC__
+#define EV_CHECK_FMT(a,b) __attribute__((format(printf, a, b)))
+#define EV_NORETURN __attribute__((noreturn))
+#else
+#define EV_CHECK_FMT(a,b)
+#define EV_NORETURN
+#endif
+
+#define EVENT_ERR_ABORT_ ((int)0xdeaddead)
+
+#define USE_GLOBAL_FOR_DEBUG_LOGGING
+
+#if !defined(EVENT__DISABLE_DEBUG_MODE) || defined(USE_DEBUG)
+#define EVENT_DEBUG_LOGGING_ENABLED
+#endif
+
+#ifdef EVENT_DEBUG_LOGGING_ENABLED
+#ifdef USE_GLOBAL_FOR_DEBUG_LOGGING
+extern ev_uint32_t event_debug_logging_mask_;
+#define event_debug_get_logging_mask_() (event_debug_logging_mask_)
+#else
+ev_uint32_t event_debug_get_logging_mask_(void);
+#endif
+#else
+#define event_debug_get_logging_mask_() (0)
+#endif
+
+void event_err(int eval, const char *fmt, ...) EV_CHECK_FMT(2,3) EV_NORETURN;
+void event_warn(const char *fmt, ...) EV_CHECK_FMT(1,2);
+void event_sock_err(int eval, evutil_socket_t sock, const char *fmt, ...) EV_CHECK_FMT(3,4) EV_NORETURN;
+void event_sock_warn(evutil_socket_t sock, const char *fmt, ...) EV_CHECK_FMT(2,3);
+void event_errx(int eval, const char *fmt, ...) EV_CHECK_FMT(2,3) EV_NORETURN;
+void event_warnx(const char *fmt, ...) EV_CHECK_FMT(1,2);
+void event_msgx(const char *fmt, ...) EV_CHECK_FMT(1,2);
+void event_debugx_(const char *fmt, ...) EV_CHECK_FMT(1,2);
+
+void event_logv_(int severity, const char *errstr, const char *fmt, va_list ap)
+ EV_CHECK_FMT(3,0);
+
+#ifdef EVENT_DEBUG_LOGGING_ENABLED
+#define event_debug(x) do { \
+ if (event_debug_get_logging_mask_()) { \
+ event_debugx_ x; \
+ } \
+ } while (0)
+#else
+#define event_debug(x) ((void)0)
+#endif
+
+#undef EV_CHECK_FMT
+
+#endif
diff --git a/protocols/Telegram/tgl/libevent/log.c b/protocols/Telegram/tgl/libevent/log.c
new file mode 100644
index 0000000000..e8ae9fdc31
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/log.c
@@ -0,0 +1,253 @@
+/* $OpenBSD: err.c,v 1.2 2002/06/25 15:50:15 mickey Exp $ */
+
+/*
+ * log.c
+ *
+ * Based on err.c, which was adapted from OpenBSD libc *err* *warn* code.
+ *
+ * Copyright (c) 2005-2012 Niels Provos and Nick Mathewson
+ *
+ * Copyright (c) 2000 Dug Song <dugsong@monkey.org>
+ *
+ * Copyright (c) 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#endif
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <errno.h>
+#include "event2/event.h"
+#include "event2/util.h"
+
+#include "log-internal.h"
+
+static void event_log(int severity, const char *msg);
+static void event_exit(int errcode) EV_NORETURN;
+
+static event_fatal_cb fatal_fn = NULL;
+
+#ifdef EVENT_DEBUG_LOGGING_ENABLED
+#ifdef USE_DEBUG
+#define DEFAULT_MASK EVENT_DBG_ALL
+#else
+#define DEFAULT_MASK 0
+#endif
+
+#ifdef USE_GLOBAL_FOR_DEBUG_LOGGING
+ev_uint32_t event_debug_logging_mask_ = DEFAULT_MASK;
+#else
+static ev_uint32_t event_debug_logging_mask_ = DEFAULT_MASK;
+ev_uint32_t
+event_debug_get_logging_mask_(void)
+{
+ return event_debug_logging_mask_;
+}
+#endif
+#endif /* EVENT_DEBUG_LOGGING_ENABLED */
+
+void
+event_enable_debug_logging(ev_uint32_t which)
+{
+#ifdef EVENT_DEBUG_LOGGING_ENABLED
+ event_debug_logging_mask_ = which;
+#endif
+}
+
+void
+event_set_fatal_callback(event_fatal_cb cb)
+{
+ fatal_fn = cb;
+}
+
+static void
+event_exit(int errcode)
+{
+ if (fatal_fn) {
+ fatal_fn(errcode);
+ exit(errcode); /* should never be reached */
+ } else if (errcode == EVENT_ERR_ABORT_)
+ abort();
+ else
+ exit(errcode);
+}
+
+void
+event_err(int eval, const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ event_logv_(EVENT_LOG_ERR, strerror(errno), fmt, ap);
+ va_end(ap);
+ event_exit(eval);
+}
+
+void
+event_warn(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ event_logv_(EVENT_LOG_WARN, strerror(errno), fmt, ap);
+ va_end(ap);
+}
+
+void
+event_sock_err(int eval, evutil_socket_t sock, const char *fmt, ...)
+{
+ va_list ap;
+ int err = evutil_socket_geterror(sock);
+
+ va_start(ap, fmt);
+ event_logv_(EVENT_LOG_ERR, evutil_socket_error_to_string(err), fmt, ap);
+ va_end(ap);
+ event_exit(eval);
+}
+
+void
+event_sock_warn(evutil_socket_t sock, const char *fmt, ...)
+{
+ va_list ap;
+ int err = evutil_socket_geterror(sock);
+
+ va_start(ap, fmt);
+ event_logv_(EVENT_LOG_WARN, evutil_socket_error_to_string(err), fmt, ap);
+ va_end(ap);
+}
+
+void
+event_errx(int eval, const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ event_logv_(EVENT_LOG_ERR, NULL, fmt, ap);
+ va_end(ap);
+ event_exit(eval);
+}
+
+void
+event_warnx(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ event_logv_(EVENT_LOG_WARN, NULL, fmt, ap);
+ va_end(ap);
+}
+
+void
+event_msgx(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ event_logv_(EVENT_LOG_MSG, NULL, fmt, ap);
+ va_end(ap);
+}
+
+void
+event_debugx_(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ event_logv_(EVENT_LOG_DEBUG, NULL, fmt, ap);
+ va_end(ap);
+}
+
+void
+event_logv_(int severity, const char *errstr, const char *fmt, va_list ap)
+{
+ char buf[1024];
+ size_t len;
+
+ if (severity == EVENT_LOG_DEBUG && !event_debug_get_logging_mask_())
+ return;
+
+ if (fmt != NULL)
+ evutil_vsnprintf(buf, sizeof(buf), fmt, ap);
+ else
+ buf[0] = '\0';
+
+ if (errstr) {
+ len = strlen(buf);
+ if (len < sizeof(buf) - 3) {
+ evutil_snprintf(buf + len, sizeof(buf) - len, ": %s", errstr);
+ }
+ }
+
+ event_log(severity, buf);
+}
+
+static event_log_cb log_fn = NULL;
+
+void
+event_set_log_callback(event_log_cb cb)
+{
+ log_fn = cb;
+}
+
+static void
+event_log(int severity, const char *msg)
+{
+ if (log_fn)
+ log_fn(severity, msg);
+ else {
+ const char *severity_str;
+ switch (severity) {
+ case EVENT_LOG_DEBUG:
+ severity_str = "debug";
+ break;
+ case EVENT_LOG_MSG:
+ severity_str = "msg";
+ break;
+ case EVENT_LOG_WARN:
+ severity_str = "warn";
+ break;
+ case EVENT_LOG_ERR:
+ severity_str = "err";
+ break;
+ default:
+ severity_str = "???";
+ break;
+ }
+ (void)fprintf(stderr, "[%s] %s\n", severity_str, msg);
+ }
+}
diff --git a/protocols/Telegram/tgl/libevent/log.obj b/protocols/Telegram/tgl/libevent/log.obj
new file mode 100644
index 0000000000..4a0dff73c4
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/log.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/m4/ac_backport_259_ssizet.m4 b/protocols/Telegram/tgl/libevent/m4/ac_backport_259_ssizet.m4
new file mode 100644
index 0000000000..75fde386cb
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/m4/ac_backport_259_ssizet.m4
@@ -0,0 +1,3 @@
+AN_IDENTIFIER([ssize_t], [AC_TYPE_SSIZE_T])
+AC_DEFUN([AC_TYPE_SSIZE_T], [AC_CHECK_TYPE(ssize_t, int)])
+
diff --git a/protocols/Telegram/tgl/libevent/m4/acx_pthread.m4 b/protocols/Telegram/tgl/libevent/m4/acx_pthread.m4
new file mode 100644
index 0000000000..d2b116945f
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/m4/acx_pthread.m4
@@ -0,0 +1,279 @@
+##### http://autoconf-archive.cryp.to/acx_pthread.html
+#
+# SYNOPSIS
+#
+# ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# This macro figures out how to build C programs using POSIX threads.
+# It sets the PTHREAD_LIBS output variable to the threads library and
+# linker flags, and the PTHREAD_CFLAGS output variable to any special
+# C compiler flags that are needed. (The user can also force certain
+# compiler flags/libs to be tested by setting these environment
+# variables.)
+#
+# Also sets PTHREAD_CC to any special C compiler that is needed for
+# multi-threaded programs (defaults to the value of CC otherwise).
+# (This is necessary on AIX to use the special cc_r compiler alias.)
+#
+# NOTE: You are assumed to not only compile your program with these
+# flags, but also link it with them as well. e.g. you should link
+# with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS
+# $LIBS
+#
+# If you are only building threads programs, you may wish to use
+# these variables in your default LIBS, CFLAGS, and CC:
+#
+# LIBS="$PTHREAD_LIBS $LIBS"
+# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+# CC="$PTHREAD_CC"
+#
+# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute
+# constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to
+# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
+#
+# ACTION-IF-FOUND is a list of shell commands to run if a threads
+# library is found, and ACTION-IF-NOT-FOUND is a list of commands to
+# run it if it is not found. If ACTION-IF-FOUND is not specified, the
+# default action will define HAVE_PTHREAD.
+#
+# Please let the authors know if this macro fails on any platform, or
+# if you have any other suggestions or comments. This macro was based
+# on work by SGJ on autoconf scripts for FFTW (http://www.fftw.org/)
+# (with help from M. Frigo), as well as ac_pthread and hb_pthread
+# macros posted by Alejandro Forero Cuervo to the autoconf macro
+# repository. We are also grateful for the helpful feedback of
+# numerous users.
+#
+# LAST MODIFICATION
+#
+# 2007-07-29
+#
+# COPYLEFT
+#
+# Copyright (c) 2007 Steven G. Johnson <stevenj@alum.mit.edu>
+#
+# This program is free software: you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see
+# <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright
+# owner gives unlimited permission to copy, distribute and modify the
+# configure scripts that are the output of Autoconf when processing
+# the Macro. You need not follow the terms of the GNU General Public
+# License when using or distributing such scripts, even though
+# portions of the text of the Macro appear in them. The GNU General
+# Public License (GPL) does govern all other use of the material that
+# constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the
+# Autoconf Macro released by the Autoconf Macro Archive. When you
+# make and distribute a modified version of the Autoconf Macro, you
+# may extend this special exception to the GPL to apply to your
+# modified version as well.
+
+AC_DEFUN([ACX_PTHREAD], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_LANG_SAVE
+AC_LANG_C
+acx_pthread_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on True64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ save_LIBS="$LIBS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
+ AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
+ AC_MSG_RESULT($acx_pthread_ok)
+ if test x"$acx_pthread_ok" = xno; then
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+ fi
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try. Items starting with a "-" are
+# C compiler flags, and other items are library names, except for "none"
+# which indicates that we try without any flags at all, and "pthread-config"
+# which is a program returning the flags for the Pth emulation library.
+
+acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+
+# The ordering *is* (sometimes) important. Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+# other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
+# -pthreads: Solaris/gcc
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+# doesn't hurt to check since this sometimes defines pthreads too;
+# also defines -D_REENTRANT)
+# ... -mt is also the pthreads flag for HP/aCC
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+# pthread-config: use pthread-config program (for GNU Pth library)
+
+case "${host_cpu}-${host_os}" in
+ *solaris*)
+
+ # On Solaris (at least, for some versions), libc contains stubbed
+ # (non-functional) versions of the pthreads routines, so link-based
+ # tests will erroneously succeed. (We need to link with -pthreads/-mt/
+ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
+ # a function called by this macro, so we could check for that, but
+ # who knows whether they'll stub that too in a future libc.) So,
+ # we'll just look for -pthreads and -lpthread first:
+
+ acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
+ ;;
+esac
+
+if test x"$acx_pthread_ok" = xno; then
+for flag in $acx_pthread_flags; do
+
+ case $flag in
+ none)
+ AC_MSG_CHECKING([whether pthreads work without any flags])
+ ;;
+
+ -*)
+ AC_MSG_CHECKING([whether pthreads work with $flag])
+ PTHREAD_CFLAGS="$flag"
+ ;;
+
+ pthread-config)
+ AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
+ if test x"$acx_pthread_config" = xno; then continue; fi
+ PTHREAD_CFLAGS="`pthread-config --cflags`"
+ PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+ ;;
+
+ *)
+ AC_MSG_CHECKING([for the pthreads library -l$flag])
+ PTHREAD_LIBS="-l$flag"
+ ;;
+ esac
+
+ save_LIBS="$LIBS"
+ save_CFLAGS="$CFLAGS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+ # Check for various functions. We must include pthread.h,
+ # since some functions may be macros. (On the Sequent, we
+ # need a special flag -Kthread to make this header compile.)
+ # We check for pthread_join because it is in -lpthread on IRIX
+ # while pthread_create is in libc. We check for pthread_attr_init
+ # due to DEC craziness with -lpthreads. We check for
+ # pthread_cleanup_push because it is one of the few pthread
+ # functions on Solaris that doesn't have a non-functional libc stub.
+ # We try pthread_create on general principles.
+ AC_TRY_LINK([#include <pthread.h>],
+ [pthread_t th; pthread_join(th, 0);
+ pthread_attr_init(0); pthread_cleanup_push(0, 0);
+ pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
+ [acx_pthread_ok=yes])
+
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+
+ AC_MSG_RESULT($acx_pthread_ok)
+ if test "x$acx_pthread_ok" = xyes; then
+ break;
+ fi
+
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+done
+fi
+
+# Various other checks:
+if test "x$acx_pthread_ok" = xyes; then
+ save_LIBS="$LIBS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+ # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
+ AC_MSG_CHECKING([for joinable pthread attribute])
+ attr_name=unknown
+ for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+ AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
+ [attr_name=$attr; break])
+ done
+ AC_MSG_RESULT($attr_name)
+ if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
+ AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
+ [Define to necessary symbol if this constant
+ uses a non-standard name on your system.])
+ fi
+
+ AC_MSG_CHECKING([if more special flags are required for pthreads])
+ flag=no
+ case "${host_cpu}-${host_os}" in
+ *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
+ *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
+ esac
+ AC_MSG_RESULT(${flag})
+ if test "x$flag" != xno; then
+ PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
+ fi
+
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+
+ # More AIX lossage: must compile with xlc_r or cc_r
+ if test x"$GCC" != xyes; then
+ AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
+ else
+ PTHREAD_CC=$CC
+ fi
+else
+ PTHREAD_CC="$CC"
+fi
+
+AC_SUBST(PTHREAD_LIBS)
+AC_SUBST(PTHREAD_CFLAGS)
+AC_SUBST(PTHREAD_CC)
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$acx_pthread_ok" = xyes; then
+ ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
+ :
+else
+ acx_pthread_ok=no
+ $2
+fi
+AC_LANG_RESTORE
+])dnl ACX_PTHREAD
diff --git a/protocols/Telegram/tgl/libevent/m4/libevent_openssl.m4 b/protocols/Telegram/tgl/libevent/m4/libevent_openssl.m4
new file mode 100644
index 0000000000..3cb064a0bd
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/m4/libevent_openssl.m4
@@ -0,0 +1,47 @@
+dnl ######################################################################
+dnl OpenSSL support
+AC_DEFUN([LIBEVENT_OPENSSL], [
+AC_REQUIRE([NTP_PKG_CONFIG])dnl
+
+case "$enable_openssl" in
+ yes)
+ have_openssl=no
+ case "$PKG_CONFIG" in
+ '')
+ ;;
+ *)
+ OPENSSL_LIBS=`$PKG_CONFIG --libs openssl 2>/dev/null`
+ case "$OPENSSL_LIBS" in
+ '') ;;
+ *) OPENSSL_LIBS="$OPENSSL_LIBS $EV_LIB_GDI $EV_LIB_WS32 $OPENSSL_LIBADD"
+ have_openssl=yes
+ ;;
+ esac
+ OPENSSL_INCS=`$PKG_CONFIG --cflags openssl 2>/dev/null`
+ ;;
+ esac
+ case "$have_openssl" in
+ yes) ;;
+ *)
+ save_LIBS="$LIBS"
+ LIBS=""
+ OPENSSL_LIBS=""
+ AC_SEARCH_LIBS([SSL_new], [ssl],
+ [have_openssl=yes
+ OPENSSL_LIBS="$LIBS -lcrypto $EV_LIB_GDI $EV_LIB_WS32 $OPENSSL_LIBADD"],
+ [have_openssl=no],
+ [-lcrypto $EV_LIB_GDI $EV_LIB_WS32 $OPENSSL_LIBADD])
+ LIBS="$save_LIBS"
+ ;;
+ esac
+ AC_SUBST(OPENSSL_INCS)
+ AC_SUBST(OPENSSL_LIBS)
+ case "$have_openssl" in
+ yes) AC_DEFINE(HAVE_OPENSSL, 1, [Define if the system has openssl]) ;;
+ esac
+ ;;
+esac
+
+# check if we have and should use openssl
+AM_CONDITIONAL(OPENSSL, [test "$enable_openssl" != "no" && test "$have_openssl" = "yes"])
+])
diff --git a/protocols/Telegram/tgl/libevent/m4/ntp_pkg_config.m4 b/protocols/Telegram/tgl/libevent/m4/ntp_pkg_config.m4
new file mode 100644
index 0000000000..1bce8a6e4d
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/m4/ntp_pkg_config.m4
@@ -0,0 +1,27 @@
+dnl NTP_PKG_CONFIG -*- Autoconf -*-
+dnl
+dnl Look for pkg-config, which must be at least
+dnl $ntp_pkgconfig_min_version.
+dnl
+AC_DEFUN([NTP_PKG_CONFIG], [
+
+dnl lower the minimum version if you find an earlier one works
+ntp_pkgconfig_min_version='0.15.0'
+AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+AS_UNSET([ac_cv_path_PKG_CONFIG])
+AS_UNSET([ac_cv_path_ac_pt_PKG_CONFIG])
+
+case "$PKG_CONFIG" in
+ /*)
+ AC_MSG_CHECKING([if pkg-config is at least version $ntp_pkgconfig_min_version])
+ if $PKG_CONFIG --atleast-pkgconfig-version $ntp_pkgconfig_min_version; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ PKG_CONFIG=""
+ fi
+ ;;
+esac
+
+]) dnl NTP_PKG_CONFIG
+
diff --git a/protocols/Telegram/tgl/libevent/make-event-config.sed b/protocols/Telegram/tgl/libevent/make-event-config.sed
new file mode 100644
index 0000000000..e31018a2dd
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/make-event-config.sed
@@ -0,0 +1,23 @@
+# Sed script to postprocess config.h into event-config.h.
+
+1i\
+/* event2/event-config.h\
+ *\
+ * This file was generated by autoconf when libevent was built, and post-\
+ * processed by Libevent so that its macros would have a uniform prefix.\
+ *\
+ * DO NOT EDIT THIS FILE.\
+ *\
+ * Do not rely on macros in this file existing in later versions.\
+ */\
+\
+#ifndef EVENT2_EVENT_CONFIG_H_INCLUDED_\
+#define EVENT2_EVENT_CONFIG_H_INCLUDED_\
+
+$a\
+\
+#endif /* event2/event-config.h */
+
+s/#\( *\)define /#\1define EVENT__/
+s/#\( *\)undef /#\1undef EVENT__/
+s/#\( *\)if\(n*\)def /#\1if\2def EVENT__/
diff --git a/protocols/Telegram/tgl/libevent/make_epoll_table.py b/protocols/Telegram/tgl/libevent/make_epoll_table.py
new file mode 100644
index 0000000000..1b15a91a67
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/make_epoll_table.py
@@ -0,0 +1,63 @@
+#!/usr/bin/python2
+
+def get(old,wc,rc,cc):
+ if ('xxx' in (rc, wc, cc)):
+ return "0",255
+
+ if ('add' in (rc, wc, cc)):
+ events = []
+ if rc == 'add' or (rc != 'del' and 'r' in old):
+ events.append("EPOLLIN")
+ if wc == 'add' or (wc != 'del' and 'w' in old):
+ events.append("EPOLLOUT")
+ if cc == 'add' or (cc != 'del' and 'c' in old):
+ events.append("EPOLLRDHUP")
+
+ if old == "0":
+ op = "EPOLL_CTL_ADD"
+ else:
+ op = "EPOLL_CTL_MOD"
+ return "|".join(events), op
+
+ if ('del' in (rc, wc, cc)):
+ delevents = []
+ modevents = []
+ op = "EPOLL_CTL_DEL"
+
+ if 'r' in old:
+ modevents.append("EPOLLIN")
+ if 'w' in old:
+ modevents.append("EPOLLOUT")
+ if 'c' in old:
+ modevents.append("EPOLLRDHUP")
+
+ for item, event in [(rc,"EPOLLIN"),
+ (wc,"EPOLLOUT"),
+ (cc,"EPOLLRDHUP")]:
+ if item == 'del':
+ delevents.append(event)
+ if event in modevents:
+ modevents.remove(event)
+
+ if modevents:
+ return "|".join(modevents), "EPOLL_CTL_MOD"
+ else:
+ return "|".join(delevents), "EPOLL_CTL_DEL"
+
+ return 0, 0
+
+
+def fmt(op, ev, old, wc, rc, cc):
+ entry = "{ %s, %s },"%(op, ev)
+ print "\t/* old=%3s, write:%3s, read:%3s, close:%3s */\n\t%s" % (
+ old, wc, rc, cc, entry)
+ return len(entry)
+
+for old in ('0','r','w','rw','c','cr','cw','crw'):
+ for wc in ('0', 'add', 'del', 'xxx'):
+ for rc in ('0', 'add', 'del', 'xxx'):
+ for cc in ('0', 'add', 'del', 'xxx'):
+
+ op,ev = get(old,wc,rc,cc)
+
+ fmt(op, ev, old, wc, rc, cc)
diff --git a/protocols/Telegram/tgl/libevent/minheap-internal.h b/protocols/Telegram/tgl/libevent/minheap-internal.h
new file mode 100644
index 0000000000..b3b6f1fd49
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/minheap-internal.h
@@ -0,0 +1,188 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Copyright (c) 2006 Maxim Yegorushkin <maxim.yegorushkin@gmail.com>
+ *
+ * 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.
+ */
+#ifndef MINHEAP_INTERNAL_H_INCLUDED_
+#define MINHEAP_INTERNAL_H_INCLUDED_
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+#include "event2/event.h"
+#include "event2/event_struct.h"
+#include "event2/util.h"
+#include "util-internal.h"
+#include "mm-internal.h"
+
+typedef struct min_heap
+{
+ struct event** p;
+ unsigned n, a;
+} min_heap_t;
+
+static inline void min_heap_ctor_(min_heap_t* s);
+static inline void min_heap_dtor_(min_heap_t* s);
+static inline void min_heap_elem_init_(struct event* e);
+static inline int min_heap_elt_is_top_(const struct event *e);
+static inline int min_heap_empty_(min_heap_t* s);
+static inline unsigned min_heap_size_(min_heap_t* s);
+static inline struct event* min_heap_top_(min_heap_t* s);
+static inline int min_heap_reserve_(min_heap_t* s, unsigned n);
+static inline int min_heap_push_(min_heap_t* s, struct event* e);
+static inline struct event* min_heap_pop_(min_heap_t* s);
+static inline int min_heap_adjust_(min_heap_t *s, struct event* e);
+static inline int min_heap_erase_(min_heap_t* s, struct event* e);
+static inline void min_heap_shift_up_(min_heap_t* s, unsigned hole_index, struct event* e);
+static inline void min_heap_shift_up_unconditional_(min_heap_t* s, unsigned hole_index, struct event* e);
+static inline void min_heap_shift_down_(min_heap_t* s, unsigned hole_index, struct event* e);
+
+#define min_heap_elem_greater(a, b) \
+ (evutil_timercmp(&(a)->ev_timeout, &(b)->ev_timeout, >))
+
+void min_heap_ctor_(min_heap_t* s) { s->p = 0; s->n = 0; s->a = 0; }
+void min_heap_dtor_(min_heap_t* s) { if (s->p) mm_free(s->p); }
+void min_heap_elem_init_(struct event* e) { e->ev_timeout_pos.min_heap_idx = -1; }
+int min_heap_empty_(min_heap_t* s) { return 0u == s->n; }
+unsigned min_heap_size_(min_heap_t* s) { return s->n; }
+struct event* min_heap_top_(min_heap_t* s) { return s->n ? *s->p : 0; }
+
+int min_heap_push_(min_heap_t* s, struct event* e)
+{
+ if (min_heap_reserve_(s, s->n + 1))
+ return -1;
+ min_heap_shift_up_(s, s->n++, e);
+ return 0;
+}
+
+struct event* min_heap_pop_(min_heap_t* s)
+{
+ if (s->n)
+ {
+ struct event* e = *s->p;
+ min_heap_shift_down_(s, 0u, s->p[--s->n]);
+ e->ev_timeout_pos.min_heap_idx = -1;
+ return e;
+ }
+ return 0;
+}
+
+int min_heap_elt_is_top_(const struct event *e)
+{
+ return e->ev_timeout_pos.min_heap_idx == 0;
+}
+
+int min_heap_erase_(min_heap_t* s, struct event* e)
+{
+ if (-1 != e->ev_timeout_pos.min_heap_idx)
+ {
+ struct event *last = s->p[--s->n];
+ unsigned parent = (e->ev_timeout_pos.min_heap_idx - 1) / 2;
+ /* we replace e with the last element in the heap. We might need to
+ shift it upward if it is less than its parent, or downward if it is
+ greater than one or both its children. Since the children are known
+ to be less than the parent, it can't need to shift both up and
+ down. */
+ if (e->ev_timeout_pos.min_heap_idx > 0 && min_heap_elem_greater(s->p[parent], last))
+ min_heap_shift_up_unconditional_(s, e->ev_timeout_pos.min_heap_idx, last);
+ else
+ min_heap_shift_down_(s, e->ev_timeout_pos.min_heap_idx, last);
+ e->ev_timeout_pos.min_heap_idx = -1;
+ return 0;
+ }
+ return -1;
+}
+
+int min_heap_adjust_(min_heap_t *s, struct event *e)
+{
+ if (-1 == e->ev_timeout_pos.min_heap_idx) {
+ return min_heap_push_(s, e);
+ } else {
+ unsigned parent = (e->ev_timeout_pos.min_heap_idx - 1) / 2;
+ /* The position of e has changed; we shift it up or down
+ * as needed. We can't need to do both. */
+ if (e->ev_timeout_pos.min_heap_idx > 0 && min_heap_elem_greater(s->p[parent], e))
+ min_heap_shift_up_unconditional_(s, e->ev_timeout_pos.min_heap_idx, e);
+ else
+ min_heap_shift_down_(s, e->ev_timeout_pos.min_heap_idx, e);
+ return 0;
+ }
+}
+
+int min_heap_reserve_(min_heap_t* s, unsigned n)
+{
+ if (s->a < n)
+ {
+ struct event** p;
+ unsigned a = s->a ? s->a * 2 : 8;
+ if (a < n)
+ a = n;
+ if (!(p = (struct event**)mm_realloc(s->p, a * sizeof *p)))
+ return -1;
+ s->p = p;
+ s->a = a;
+ }
+ return 0;
+}
+
+void min_heap_shift_up_unconditional_(min_heap_t* s, unsigned hole_index, struct event* e)
+{
+ unsigned parent = (hole_index - 1) / 2;
+ do
+ {
+ (s->p[hole_index] = s->p[parent])->ev_timeout_pos.min_heap_idx = hole_index;
+ hole_index = parent;
+ parent = (hole_index - 1) / 2;
+ } while (hole_index && min_heap_elem_greater(s->p[parent], e));
+ (s->p[hole_index] = e)->ev_timeout_pos.min_heap_idx = hole_index;
+}
+
+void min_heap_shift_up_(min_heap_t* s, unsigned hole_index, struct event* e)
+{
+ unsigned parent = (hole_index - 1) / 2;
+ while (hole_index && min_heap_elem_greater(s->p[parent], e))
+ {
+ (s->p[hole_index] = s->p[parent])->ev_timeout_pos.min_heap_idx = hole_index;
+ hole_index = parent;
+ parent = (hole_index - 1) / 2;
+ }
+ (s->p[hole_index] = e)->ev_timeout_pos.min_heap_idx = hole_index;
+}
+
+void min_heap_shift_down_(min_heap_t* s, unsigned hole_index, struct event* e)
+{
+ unsigned min_child = 2 * (hole_index + 1);
+ while (min_child <= s->n)
+ {
+ min_child -= min_child == s->n || min_heap_elem_greater(s->p[min_child], s->p[min_child - 1]);
+ if (!(min_heap_elem_greater(e, s->p[min_child])))
+ break;
+ (s->p[hole_index] = s->p[min_child])->ev_timeout_pos.min_heap_idx = hole_index;
+ hole_index = min_child;
+ min_child = 2 * (hole_index + 1);
+ }
+ (s->p[hole_index] = e)->ev_timeout_pos.min_heap_idx = hole_index;
+}
+
+#endif /* MINHEAP_INTERNAL_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/mm-internal.h b/protocols/Telegram/tgl/libevent/mm-internal.h
new file mode 100644
index 0000000000..4ba6fce4ad
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/mm-internal.h
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef MM_INTERNAL_H_INCLUDED_
+#define MM_INTERNAL_H_INCLUDED_
+
+#include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef EVENT__DISABLE_MM_REPLACEMENT
+/* Internal use only: Memory allocation functions. We give them nice short
+ * mm_names for our own use, but make sure that the symbols have longer names
+ * so they don't conflict with other libraries (like, say, libmm). */
+
+/** Allocate uninitialized memory.
+ *
+ * @return On success, return a pointer to sz newly allocated bytes.
+ * On failure, set errno to ENOMEM and return NULL.
+ * If the argument sz is 0, simply return NULL.
+ */
+void *event_mm_malloc_(size_t sz);
+
+/** Allocate memory initialized to zero.
+ *
+ * @return On success, return a pointer to (count * size) newly allocated
+ * bytes, initialized to zero.
+ * On failure, or if the product would result in an integer overflow,
+ * set errno to ENOMEM and return NULL.
+ * If either arguments are 0, simply return NULL.
+ */
+void *event_mm_calloc_(size_t count, size_t size);
+
+/** Duplicate a string.
+ *
+ * @return On success, return a pointer to a newly allocated duplicate
+ * of a string.
+ * Set errno to ENOMEM and return NULL if a memory allocation error
+ * occurs (or would occur) in the process.
+ * If the argument str is NULL, set errno to EINVAL and return NULL.
+ */
+char *event_mm_strdup_(const char *str);
+
+void *event_mm_realloc_(void *p, size_t sz);
+void event_mm_free_(void *p);
+#define mm_malloc(sz) event_mm_malloc_(sz)
+#define mm_calloc(count, size) event_mm_calloc_((count), (size))
+#define mm_strdup(s) event_mm_strdup_(s)
+#define mm_realloc(p, sz) event_mm_realloc_((p), (sz))
+#define mm_free(p) event_mm_free_(p)
+#else
+#define mm_malloc(sz) malloc(sz)
+#define mm_calloc(n, sz) calloc((n), (sz))
+#define mm_strdup(s) strdup(s)
+#define mm_realloc(p, sz) realloc((p), (sz))
+#define mm_free(p) free(p)
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/libevent/poll.c b/protocols/Telegram/tgl/libevent/poll.c
new file mode 100644
index 0000000000..51475934b3
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/poll.c
@@ -0,0 +1,341 @@
+/* $OpenBSD: poll.c,v 1.2 2002/06/25 15:50:15 mickey Exp $ */
+
+/*
+ * Copyright 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef EVENT__HAVE_POLL
+
+#include <sys/types.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#include <poll.h>
+#include <signal.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include "event-internal.h"
+#include "evsignal-internal.h"
+#include "log-internal.h"
+#include "evmap-internal.h"
+#include "event2/thread.h"
+#include "evthread-internal.h"
+#include "time-internal.h"
+
+struct pollidx {
+ int idxplus1;
+};
+
+struct pollop {
+ int event_count; /* Highest number alloc */
+ int nfds; /* Highest number used */
+ int realloc_copy; /* True iff we must realloc
+ * event_set_copy */
+ struct pollfd *event_set;
+ struct pollfd *event_set_copy;
+};
+
+static void *poll_init(struct event_base *);
+static int poll_add(struct event_base *, int, short old, short events, void *idx);
+static int poll_del(struct event_base *, int, short old, short events, void *idx);
+static int poll_dispatch(struct event_base *, struct timeval *);
+static void poll_dealloc(struct event_base *);
+
+const struct eventop pollops = {
+ "poll",
+ poll_init,
+ poll_add,
+ poll_del,
+ poll_dispatch,
+ poll_dealloc,
+ 0, /* doesn't need_reinit */
+ EV_FEATURE_FDS,
+ sizeof(struct pollidx),
+};
+
+static void *
+poll_init(struct event_base *base)
+{
+ struct pollop *pollop;
+
+ if (!(pollop = mm_calloc(1, sizeof(struct pollop))))
+ return (NULL);
+
+ evsig_init_(base);
+
+ evutil_weakrand_seed_(&base->weakrand_seed, 0);
+
+ return (pollop);
+}
+
+#ifdef CHECK_INVARIANTS
+static void
+poll_check_ok(struct pollop *pop)
+{
+ int i, idx;
+ struct event *ev;
+
+ for (i = 0; i < pop->fd_count; ++i) {
+ idx = pop->idxplus1_by_fd[i]-1;
+ if (idx < 0)
+ continue;
+ EVUTIL_ASSERT(pop->event_set[idx].fd == i);
+ }
+ for (i = 0; i < pop->nfds; ++i) {
+ struct pollfd *pfd = &pop->event_set[i];
+ EVUTIL_ASSERT(pop->idxplus1_by_fd[pfd->fd] == i+1);
+ }
+}
+#else
+#define poll_check_ok(pop)
+#endif
+
+static int
+poll_dispatch(struct event_base *base, struct timeval *tv)
+{
+ int res, i, j, nfds;
+ long msec = -1;
+ struct pollop *pop = base->evbase;
+ struct pollfd *event_set;
+
+ poll_check_ok(pop);
+
+ nfds = pop->nfds;
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ if (base->th_base_lock) {
+ /* If we're using this backend in a multithreaded setting,
+ * then we need to work on a copy of event_set, so that we can
+ * let other threads modify the main event_set while we're
+ * polling. If we're not multithreaded, then we'll skip the
+ * copy step here to save memory and time. */
+ if (pop->realloc_copy) {
+ struct pollfd *tmp = mm_realloc(pop->event_set_copy,
+ pop->event_count * sizeof(struct pollfd));
+ if (tmp == NULL) {
+ event_warn("realloc");
+ return -1;
+ }
+ pop->event_set_copy = tmp;
+ pop->realloc_copy = 0;
+ }
+ memcpy(pop->event_set_copy, pop->event_set,
+ sizeof(struct pollfd)*nfds);
+ event_set = pop->event_set_copy;
+ } else {
+ event_set = pop->event_set;
+ }
+#else
+ event_set = pop->event_set;
+#endif
+
+ if (tv != NULL) {
+ msec = evutil_tv_to_msec_(tv);
+ if (msec < 0 || msec > INT_MAX)
+ msec = INT_MAX;
+ }
+
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+
+ res = poll(event_set, nfds, msec);
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+
+ if (res == -1) {
+ if (errno != EINTR) {
+ event_warn("poll");
+ return (-1);
+ }
+
+ return (0);
+ }
+
+ event_debug(("%s: poll reports %d", __func__, res));
+
+ if (res == 0 || nfds == 0)
+ return (0);
+
+ i = evutil_weakrand_range_(&base->weakrand_seed, nfds);
+ for (j = 0; j < nfds; j++) {
+ int what;
+ if (++i == nfds)
+ i = 0;
+ what = event_set[i].revents;
+ if (!what)
+ continue;
+
+ res = 0;
+
+ /* If the file gets closed notify */
+ if (what & (POLLHUP|POLLERR))
+ what |= POLLIN|POLLOUT;
+ if (what & POLLIN)
+ res |= EV_READ;
+ if (what & POLLOUT)
+ res |= EV_WRITE;
+ if (res == 0)
+ continue;
+
+ evmap_io_active_(base, event_set[i].fd, res);
+ }
+
+ return (0);
+}
+
+static int
+poll_add(struct event_base *base, int fd, short old, short events, void *idx_)
+{
+ struct pollop *pop = base->evbase;
+ struct pollfd *pfd = NULL;
+ struct pollidx *idx = idx_;
+ int i;
+
+ EVUTIL_ASSERT((events & EV_SIGNAL) == 0);
+ if (!(events & (EV_READ|EV_WRITE)))
+ return (0);
+
+ poll_check_ok(pop);
+ if (pop->nfds + 1 >= pop->event_count) {
+ struct pollfd *tmp_event_set;
+ int tmp_event_count;
+
+ if (pop->event_count < 32)
+ tmp_event_count = 32;
+ else
+ tmp_event_count = pop->event_count * 2;
+
+ /* We need more file descriptors */
+ tmp_event_set = mm_realloc(pop->event_set,
+ tmp_event_count * sizeof(struct pollfd));
+ if (tmp_event_set == NULL) {
+ event_warn("realloc");
+ return (-1);
+ }
+ pop->event_set = tmp_event_set;
+
+ pop->event_count = tmp_event_count;
+ pop->realloc_copy = 1;
+ }
+
+ i = idx->idxplus1 - 1;
+
+ if (i >= 0) {
+ pfd = &pop->event_set[i];
+ } else {
+ i = pop->nfds++;
+ pfd = &pop->event_set[i];
+ pfd->events = 0;
+ pfd->fd = fd;
+ idx->idxplus1 = i + 1;
+ }
+
+ pfd->revents = 0;
+ if (events & EV_WRITE)
+ pfd->events |= POLLOUT;
+ if (events & EV_READ)
+ pfd->events |= POLLIN;
+ poll_check_ok(pop);
+
+ return (0);
+}
+
+/*
+ * Nothing to be done here.
+ */
+
+static int
+poll_del(struct event_base *base, int fd, short old, short events, void *idx_)
+{
+ struct pollop *pop = base->evbase;
+ struct pollfd *pfd = NULL;
+ struct pollidx *idx = idx_;
+ int i;
+
+ EVUTIL_ASSERT((events & EV_SIGNAL) == 0);
+ if (!(events & (EV_READ|EV_WRITE)))
+ return (0);
+
+ poll_check_ok(pop);
+ i = idx->idxplus1 - 1;
+ if (i < 0)
+ return (-1);
+
+ /* Do we still want to read or write? */
+ pfd = &pop->event_set[i];
+ if (events & EV_READ)
+ pfd->events &= ~POLLIN;
+ if (events & EV_WRITE)
+ pfd->events &= ~POLLOUT;
+ poll_check_ok(pop);
+ if (pfd->events)
+ /* Another event cares about that fd. */
+ return (0);
+
+ /* Okay, so we aren't interested in that fd anymore. */
+ idx->idxplus1 = 0;
+
+ --pop->nfds;
+ if (i != pop->nfds) {
+ /*
+ * Shift the last pollfd down into the now-unoccupied
+ * position.
+ */
+ memcpy(&pop->event_set[i], &pop->event_set[pop->nfds],
+ sizeof(struct pollfd));
+ idx = evmap_io_get_fdinfo_(&base->io, pop->event_set[i].fd);
+ EVUTIL_ASSERT(idx);
+ EVUTIL_ASSERT(idx->idxplus1 == pop->nfds + 1);
+ idx->idxplus1 = i + 1;
+ }
+
+ poll_check_ok(pop);
+ return (0);
+}
+
+static void
+poll_dealloc(struct event_base *base)
+{
+ struct pollop *pop = base->evbase;
+
+ evsig_dealloc_(base);
+ if (pop->event_set)
+ mm_free(pop->event_set);
+ if (pop->event_set_copy)
+ mm_free(pop->event_set_copy);
+
+ memset(pop, 0, sizeof(struct pollop));
+ mm_free(pop);
+}
+
+#endif /* EVENT__HAVE_POLL */
diff --git a/protocols/Telegram/tgl/libevent/ratelim-internal.h b/protocols/Telegram/tgl/libevent/ratelim-internal.h
new file mode 100644
index 0000000000..6cc1cdde2c
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/ratelim-internal.h
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef RATELIM_INTERNAL_H_INCLUDED_
+#define RATELIM_INTERNAL_H_INCLUDED_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "event2/util.h"
+
+/** A token bucket is an internal structure that tracks how many bytes we are
+ * currently willing to read or write on a given bufferevent or group of
+ * bufferevents */
+struct ev_token_bucket {
+ /** How many bytes are we willing to read or write right now? These
+ * values are signed so that we can do "defecit spending" */
+ ev_ssize_t read_limit, write_limit;
+ /** When was this bucket last updated? Measured in abstract 'ticks'
+ * relative to the token bucket configuration. */
+ ev_uint32_t last_updated;
+};
+
+/** Configuration info for a token bucket or set of token buckets. */
+struct ev_token_bucket_cfg {
+ /** How many bytes are we willing to read on average per tick? */
+ size_t read_rate;
+ /** How many bytes are we willing to read at most in any one tick? */
+ size_t read_maximum;
+ /** How many bytes are we willing to write on average per tick? */
+ size_t write_rate;
+ /** How many bytes are we willing to write at most in any one tick? */
+ size_t write_maximum;
+
+ /* How long is a tick? Note that fractions of a millisecond are
+ * ignored. */
+ struct timeval tick_timeout;
+
+ /* How long is a tick, in milliseconds? Derived from tick_timeout. */
+ unsigned msec_per_tick;
+};
+
+/** The current tick is 'current_tick': add bytes to 'bucket' as specified in
+ * 'cfg'. */
+int ev_token_bucket_update_(struct ev_token_bucket *bucket,
+ const struct ev_token_bucket_cfg *cfg,
+ ev_uint32_t current_tick);
+
+/** In which tick does 'tv' fall according to 'cfg'? Note that ticks can
+ * overflow easily; your code needs to handle this. */
+ev_uint32_t ev_token_bucket_get_tick_(const struct timeval *tv,
+ const struct ev_token_bucket_cfg *cfg);
+
+/** Adjust 'bucket' to respect 'cfg', and note that it was last updated in
+ * 'current_tick'. If 'reinitialize' is true, we are changing the
+ * configuration of 'bucket'; otherwise, we are setting it up for the first
+ * time.
+ */
+int ev_token_bucket_init_(struct ev_token_bucket *bucket,
+ const struct ev_token_bucket_cfg *cfg,
+ ev_uint32_t current_tick,
+ int reinitialize);
+
+int bufferevent_remove_from_rate_limit_group_internal_(struct bufferevent *bev,
+ int unsuspend);
+
+/** Decrease the read limit of 'b' by 'n' bytes */
+#define ev_token_bucket_decrement_read(b,n) \
+ do { \
+ (b)->read_limit -= (n); \
+ } while (0)
+/** Decrease the write limit of 'b' by 'n' bytes */
+#define ev_token_bucket_decrement_write(b,n) \
+ do { \
+ (b)->write_limit -= (n); \
+ } while (0)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/libevent/sample/dns-example.c b/protocols/Telegram/tgl/libevent/sample/dns-example.c
new file mode 100644
index 0000000000..fb705664aa
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/sample/dns-example.c
@@ -0,0 +1,257 @@
+/*
+ This example code shows how to use the high-level, low-level, and
+ server-level interfaces of evdns.
+
+ XXX It's pretty ugly and should probably be cleaned up.
+ */
+
+#include <event2/event-config.h>
+
+/* Compatibility for possible missing IPv6 declarations */
+#include "../ipv6-internal.h"
+
+#include <sys/types.h>
+
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#include <getopt.h>
+#else
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#endif
+
+#include <event2/event.h>
+#include <event2/dns.h>
+#include <event2/dns_struct.h>
+#include <event2/util.h>
+
+#ifdef EVENT__HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define u32 ev_uint32_t
+#define u8 ev_uint8_t
+
+static const char *
+debug_ntoa(u32 address)
+{
+ static char buf[32];
+ u32 a = ntohl(address);
+ evutil_snprintf(buf, sizeof(buf), "%d.%d.%d.%d",
+ (int)(u8)((a>>24)&0xff),
+ (int)(u8)((a>>16)&0xff),
+ (int)(u8)((a>>8 )&0xff),
+ (int)(u8)((a )&0xff));
+ return buf;
+}
+
+static void
+main_callback(int result, char type, int count, int ttl,
+ void *addrs, void *orig) {
+ char *n = (char*)orig;
+ int i;
+ for (i = 0; i < count; ++i) {
+ if (type == DNS_IPv4_A) {
+ printf("%s: %s\n", n, debug_ntoa(((u32*)addrs)[i]));
+ } else if (type == DNS_PTR) {
+ printf("%s: %s\n", n, ((char**)addrs)[i]);
+ }
+ }
+ if (!count) {
+ printf("%s: No answer (%d)\n", n, result);
+ }
+ fflush(stdout);
+}
+
+static void
+gai_callback(int err, struct evutil_addrinfo *ai, void *arg)
+{
+ const char *name = arg;
+ int i;
+ if (err) {
+ printf("%s: %s\n", name, evutil_gai_strerror(err));
+ }
+ if (ai && ai->ai_canonname)
+ printf(" %s ==> %s\n", name, ai->ai_canonname);
+ for (i=0; ai; ai = ai->ai_next, ++i) {
+ char buf[128];
+ if (ai->ai_family == PF_INET) {
+ struct sockaddr_in *sin =
+ (struct sockaddr_in*)ai->ai_addr;
+ evutil_inet_ntop(AF_INET, &sin->sin_addr, buf,
+ sizeof(buf));
+ printf("[%d] %s: %s\n",i,name,buf);
+ } else {
+ struct sockaddr_in6 *sin6 =
+ (struct sockaddr_in6*)ai->ai_addr;
+ evutil_inet_ntop(AF_INET6, &sin6->sin6_addr, buf,
+ sizeof(buf));
+ printf("[%d] %s: %s\n",i,name,buf);
+ }
+ }
+}
+
+static void
+evdns_server_callback(struct evdns_server_request *req, void *data)
+{
+ int i, r;
+ (void)data;
+ /* dummy; give 192.168.11.11 as an answer for all A questions,
+ * give foo.bar.example.com as an answer for all PTR questions. */
+ for (i = 0; i < req->nquestions; ++i) {
+ u32 ans = htonl(0xc0a80b0bUL);
+ if (req->questions[i]->type == EVDNS_TYPE_A &&
+ req->questions[i]->dns_question_class == EVDNS_CLASS_INET) {
+ printf(" -- replying for %s (A)\n", req->questions[i]->name);
+ r = evdns_server_request_add_a_reply(req, req->questions[i]->name,
+ 1, &ans, 10);
+ if (r<0)
+ printf("eeep, didn't work.\n");
+ } else if (req->questions[i]->type == EVDNS_TYPE_PTR &&
+ req->questions[i]->dns_question_class == EVDNS_CLASS_INET) {
+ printf(" -- replying for %s (PTR)\n", req->questions[i]->name);
+ r = evdns_server_request_add_ptr_reply(req, NULL, req->questions[i]->name,
+ "foo.bar.example.com", 10);
+ if (r<0)
+ printf("ugh, no luck");
+ } else {
+ printf(" -- skipping %s [%d %d]\n", req->questions[i]->name,
+ req->questions[i]->type, req->questions[i]->dns_question_class);
+ }
+ }
+
+ r = evdns_server_request_respond(req, 0);
+ if (r<0)
+ printf("eeek, couldn't send reply.\n");
+}
+
+static int verbose = 0;
+
+static void
+logfn(int is_warn, const char *msg) {
+ if (!is_warn && !verbose)
+ return;
+ fprintf(stderr, "%s: %s\n", is_warn?"WARN":"INFO", msg);
+}
+
+int
+main(int c, char **v) {
+ struct options {
+ int reverse;
+ int use_getaddrinfo;
+ int servertest;
+ const char *resolv_conf;
+ const char *ns;
+ };
+ struct options o;
+ char opt;
+ struct event_base *event_base = NULL;
+ struct evdns_base *evdns_base = NULL;
+
+ memset(&o, 0, sizeof(o));
+
+ if (c < 2) {
+ fprintf(stderr, "syntax: %s [-x] [-v] [-c resolv.conf] [-s ns] hostname\n", v[0]);
+ fprintf(stderr, "syntax: %s [-T]\n", v[0]);
+ return 1;
+ }
+
+ while ((opt = getopt(c, v, "xvc:Ts:")) != -1) {
+ switch (opt) {
+ case 'x': o.reverse = 1; break;
+ case 'v': ++verbose; break;
+ case 'g': o.use_getaddrinfo = 1; break;
+ case 'T': o.servertest = 1; break;
+ case 'c': o.resolv_conf = optarg; break;
+ case 's': o.ns = optarg; break;
+ default : fprintf(stderr, "Unknown option %c\n", opt); break;
+ }
+ }
+
+#ifdef _WIN32
+ {
+ WSADATA WSAData;
+ WSAStartup(0x101, &WSAData);
+ }
+#endif
+
+ event_base = event_base_new();
+ evdns_base = evdns_base_new(event_base, EVDNS_BASE_DISABLE_WHEN_INACTIVE);
+ evdns_set_log_fn(logfn);
+
+ if (o.servertest) {
+ evutil_socket_t sock;
+ struct sockaddr_in my_addr;
+ sock = socket(PF_INET, SOCK_DGRAM, 0);
+ if (sock == -1) {
+ perror("socket");
+ exit(1);
+ }
+ evutil_make_socket_nonblocking(sock);
+ my_addr.sin_family = AF_INET;
+ my_addr.sin_port = htons(10053);
+ my_addr.sin_addr.s_addr = INADDR_ANY;
+ if (bind(sock, (struct sockaddr*)&my_addr, sizeof(my_addr))<0) {
+ perror("bind");
+ exit(1);
+ }
+ evdns_add_server_port_with_base(event_base, sock, 0, evdns_server_callback, NULL);
+ }
+ if (optind < c) {
+ int res;
+#ifdef _WIN32
+ if (o.resolv_conf == NULL && !o.ns)
+ res = evdns_base_config_windows_nameservers(evdns_base);
+ else
+#endif
+ if (o.ns)
+ res = evdns_base_nameserver_ip_add(evdns_base, o.ns);
+ else
+ res = evdns_base_resolv_conf_parse(evdns_base,
+ DNS_OPTION_NAMESERVERS, o.resolv_conf);
+
+ if (res < 0) {
+ fprintf(stderr, "Couldn't configure nameservers");
+ return 1;
+ }
+ }
+
+ printf("EVUTIL_AI_CANONNAME in example = %d\n", EVUTIL_AI_CANONNAME);
+ for (; optind < c; ++optind) {
+ if (o.reverse) {
+ struct in_addr addr;
+ if (evutil_inet_pton(AF_INET, v[optind], &addr)!=1) {
+ fprintf(stderr, "Skipping non-IP %s\n", v[optind]);
+ continue;
+ }
+ fprintf(stderr, "resolving %s...\n",v[optind]);
+ evdns_base_resolve_reverse(evdns_base, &addr, 0, main_callback, v[optind]);
+ } else if (o.use_getaddrinfo) {
+ struct evutil_addrinfo hints;
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_protocol = IPPROTO_TCP;
+ hints.ai_flags = EVUTIL_AI_CANONNAME;
+ fprintf(stderr, "resolving (fwd) %s...\n",v[optind]);
+ evdns_getaddrinfo(evdns_base, v[optind], NULL, &hints,
+ gai_callback, v[optind]);
+ } else {
+ fprintf(stderr, "resolving (fwd) %s...\n",v[optind]);
+ evdns_base_resolve_ipv4(evdns_base, v[optind], 0, main_callback, v[optind]);
+ }
+ }
+ fflush(stdout);
+ event_base_dispatch(event_base);
+ return 0;
+}
+
diff --git a/protocols/Telegram/tgl/libevent/sample/event-read-fifo.c b/protocols/Telegram/tgl/libevent/sample/event-read-fifo.c
new file mode 100644
index 0000000000..27b0b530d5
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/sample/event-read-fifo.c
@@ -0,0 +1,162 @@
+/*
+ * This sample code shows how to use Libevent to read from a named pipe.
+ * XXX This code could make better use of the Libevent interfaces.
+ *
+ * XXX This does not work on Windows; ignore everything inside the _WIN32 block.
+ *
+ * On UNIX, compile with:
+ * cc -I/usr/local/include -o event-read-fifo event-read-fifo.c \
+ * -L/usr/local/lib -levent
+ */
+
+#include <event2/event-config.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifndef _WIN32
+#include <sys/queue.h>
+#include <unistd.h>
+#include <sys/time.h>
+#include <signal.h>
+#else
+#include <winsock2.h>
+#include <windows.h>
+#endif
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#include <event2/event.h>
+
+static void
+fifo_read(evutil_socket_t fd, short event, void *arg)
+{
+ char buf[255];
+ int len;
+ struct event *ev = arg;
+#ifdef _WIN32
+ DWORD dwBytesRead;
+#endif
+
+ fprintf(stderr, "fifo_read called with fd: %d, event: %d, arg: %p\n",
+ (int)fd, event, arg);
+#ifdef _WIN32
+ len = ReadFile((HANDLE)fd, buf, sizeof(buf) - 1, &dwBytesRead, NULL);
+
+ /* Check for end of file. */
+ if (len && dwBytesRead == 0) {
+ fprintf(stderr, "End Of File");
+ event_del(ev);
+ return;
+ }
+
+ buf[dwBytesRead] = '\0';
+#else
+ len = read(fd, buf, sizeof(buf) - 1);
+
+ if (len <= 0) {
+ if (len == -1)
+ perror("read");
+ else if (len == 0)
+ fprintf(stderr, "Connection closed\n");
+ event_del(ev);
+ event_base_loopbreak(event_get_base(ev));
+ return;
+ }
+
+ buf[len] = '\0';
+#endif
+ fprintf(stdout, "Read: %s\n", buf);
+}
+
+/* On Unix, cleanup event.fifo if SIGINT is received. */
+#ifndef _WIN32
+static void
+signal_cb(evutil_socket_t fd, short event, void *arg)
+{
+ struct event_base *base = arg;
+ event_base_loopbreak(base);
+}
+#endif
+
+int
+main(int argc, char **argv)
+{
+ struct event *evfifo;
+ struct event_base* base;
+#ifdef _WIN32
+ HANDLE socket;
+ /* Open a file. */
+ socket = CreateFileA("test.txt", /* open File */
+ GENERIC_READ, /* open for reading */
+ 0, /* do not share */
+ NULL, /* no security */
+ OPEN_EXISTING, /* existing file only */
+ FILE_ATTRIBUTE_NORMAL, /* normal file */
+ NULL); /* no attr. template */
+
+ if (socket == INVALID_HANDLE_VALUE)
+ return 1;
+
+#else
+ struct event *signal_int;
+ struct stat st;
+ const char *fifo = "event.fifo";
+ int socket;
+
+ if (lstat(fifo, &st) == 0) {
+ if ((st.st_mode & S_IFMT) == S_IFREG) {
+ errno = EEXIST;
+ perror("lstat");
+ exit(1);
+ }
+ }
+
+ unlink(fifo);
+ if (mkfifo(fifo, 0600) == -1) {
+ perror("mkfifo");
+ exit(1);
+ }
+
+ socket = open(fifo, O_RDONLY | O_NONBLOCK, 0);
+
+ if (socket == -1) {
+ perror("open");
+ exit(1);
+ }
+
+ fprintf(stderr, "Write data to %s\n", fifo);
+#endif
+ /* Initalize the event library */
+ base = event_base_new();
+
+ /* Initalize one event */
+#ifdef _WIN32
+ evfifo = event_new(base, (evutil_socket_t)socket, EV_READ|EV_PERSIST, fifo_read,
+ event_self_cbarg());
+#else
+ /* catch SIGINT so that event.fifo can be cleaned up */
+ signal_int = evsignal_new(base, SIGINT, signal_cb, base);
+ event_add(signal_int, NULL);
+
+ evfifo = event_new(base, socket, EV_READ|EV_PERSIST, fifo_read,
+ event_self_cbarg());
+#endif
+
+ /* Add it to the active events, without a timeout */
+ event_add(evfifo, NULL);
+
+ event_base_dispatch(base);
+ event_base_free(base);
+#ifdef _WIN32
+ CloseHandle(socket);
+#else
+ close(socket);
+ unlink(fifo);
+#endif
+ libevent_global_shutdown();
+ return (0);
+}
+
diff --git a/protocols/Telegram/tgl/libevent/sample/hello-world.c b/protocols/Telegram/tgl/libevent/sample/hello-world.c
new file mode 100644
index 0000000000..d3cf058a8b
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/sample/hello-world.c
@@ -0,0 +1,141 @@
+/*
+ This exmple program provides a trivial server program that listens for TCP
+ connections on port 9995. When they arrive, it writes a short message to
+ each client connection, and closes each connection once it is flushed.
+
+ Where possible, it exits cleanly in response to a SIGINT (ctrl-c).
+*/
+
+
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <signal.h>
+#ifndef _WIN32
+#include <netinet/in.h>
+# ifdef _XOPEN_SOURCE_EXTENDED
+# include <arpa/inet.h>
+# endif
+#include <sys/socket.h>
+#endif
+
+#include <event2/bufferevent.h>
+#include <event2/buffer.h>
+#include <event2/listener.h>
+#include <event2/util.h>
+#include <event2/event.h>
+
+static const char MESSAGE[] = "Hello, World!\n";
+
+static const int PORT = 9995;
+
+static void listener_cb(struct evconnlistener *, evutil_socket_t,
+ struct sockaddr *, int socklen, void *);
+static void conn_writecb(struct bufferevent *, void *);
+static void conn_eventcb(struct bufferevent *, short, void *);
+static void signal_cb(evutil_socket_t, short, void *);
+
+int
+main(int argc, char **argv)
+{
+ struct event_base *base;
+ struct evconnlistener *listener;
+ struct event *signal_event;
+
+ struct sockaddr_in sin;
+#ifdef _WIN32
+ WSADATA wsa_data;
+ WSAStartup(0x0201, &wsa_data);
+#endif
+
+ base = event_base_new();
+ if (!base) {
+ fprintf(stderr, "Could not initialize libevent!\n");
+ return 1;
+ }
+
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_port = htons(PORT);
+
+ listener = evconnlistener_new_bind(base, listener_cb, (void *)base,
+ LEV_OPT_REUSEABLE|LEV_OPT_CLOSE_ON_FREE, -1,
+ (struct sockaddr*)&sin,
+ sizeof(sin));
+
+ if (!listener) {
+ fprintf(stderr, "Could not create a listener!\n");
+ return 1;
+ }
+
+ signal_event = evsignal_new(base, SIGINT, signal_cb, (void *)base);
+
+ if (!signal_event || event_add(signal_event, NULL)<0) {
+ fprintf(stderr, "Could not create/add a signal event!\n");
+ return 1;
+ }
+
+ event_base_dispatch(base);
+
+ evconnlistener_free(listener);
+ event_free(signal_event);
+ event_base_free(base);
+
+ printf("done\n");
+ return 0;
+}
+
+static void
+listener_cb(struct evconnlistener *listener, evutil_socket_t fd,
+ struct sockaddr *sa, int socklen, void *user_data)
+{
+ struct event_base *base = user_data;
+ struct bufferevent *bev;
+
+ bev = bufferevent_socket_new(base, fd, BEV_OPT_CLOSE_ON_FREE);
+ if (!bev) {
+ fprintf(stderr, "Error constructing bufferevent!");
+ event_base_loopbreak(base);
+ return;
+ }
+ bufferevent_setcb(bev, NULL, conn_writecb, conn_eventcb, NULL);
+ bufferevent_enable(bev, EV_WRITE);
+ bufferevent_disable(bev, EV_READ);
+
+ bufferevent_write(bev, MESSAGE, strlen(MESSAGE));
+}
+
+static void
+conn_writecb(struct bufferevent *bev, void *user_data)
+{
+ struct evbuffer *output = bufferevent_get_output(bev);
+ if (evbuffer_get_length(output) == 0) {
+ printf("flushed answer\n");
+ bufferevent_free(bev);
+ }
+}
+
+static void
+conn_eventcb(struct bufferevent *bev, short events, void *user_data)
+{
+ if (events & BEV_EVENT_EOF) {
+ printf("Connection closed.\n");
+ } else if (events & BEV_EVENT_ERROR) {
+ printf("Got an error on the connection: %s\n",
+ strerror(errno));/*XXX win32*/
+ }
+ /* None of the other events can happen here, since we haven't enabled
+ * timeouts */
+ bufferevent_free(bev);
+}
+
+static void
+signal_cb(evutil_socket_t sig, short events, void *user_data)
+{
+ struct event_base *base = user_data;
+ struct timeval delay = { 2, 0 };
+
+ printf("Caught an interrupt signal; exiting cleanly in two seconds.\n");
+
+ event_base_loopexit(base, &delay);
+}
diff --git a/protocols/Telegram/tgl/libevent/sample/hostcheck.c b/protocols/Telegram/tgl/libevent/sample/hostcheck.c
new file mode 100644
index 0000000000..50709369c0
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/sample/hostcheck.c
@@ -0,0 +1,217 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+
+/* This file is an amalgamation of hostcheck.c and most of rawstr.c
+ from cURL. The contents of the COPYING file mentioned above are:
+
+COPYRIGHT AND PERMISSION NOTICE
+
+Copyright (c) 1996 - 2013, Daniel Stenberg, <daniel@haxx.se>.
+
+All rights reserved.
+
+Permission to use, copy, modify, and distribute this software for any purpose
+with or without fee is hereby granted, provided that the above copyright
+notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
+NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
+OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder shall not
+be used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization of the copyright holder.
+*/
+
+#include "hostcheck.h"
+#include <string.h>
+
+/* Portable, consistent toupper (remember EBCDIC). Do not use toupper() because
+ its behavior is altered by the current locale. */
+static char Curl_raw_toupper(char in)
+{
+ switch (in) {
+ case 'a':
+ return 'A';
+ case 'b':
+ return 'B';
+ case 'c':
+ return 'C';
+ case 'd':
+ return 'D';
+ case 'e':
+ return 'E';
+ case 'f':
+ return 'F';
+ case 'g':
+ return 'G';
+ case 'h':
+ return 'H';
+ case 'i':
+ return 'I';
+ case 'j':
+ return 'J';
+ case 'k':
+ return 'K';
+ case 'l':
+ return 'L';
+ case 'm':
+ return 'M';
+ case 'n':
+ return 'N';
+ case 'o':
+ return 'O';
+ case 'p':
+ return 'P';
+ case 'q':
+ return 'Q';
+ case 'r':
+ return 'R';
+ case 's':
+ return 'S';
+ case 't':
+ return 'T';
+ case 'u':
+ return 'U';
+ case 'v':
+ return 'V';
+ case 'w':
+ return 'W';
+ case 'x':
+ return 'X';
+ case 'y':
+ return 'Y';
+ case 'z':
+ return 'Z';
+ }
+ return in;
+}
+
+/*
+ * Curl_raw_equal() is for doing "raw" case insensitive strings. This is meant
+ * to be locale independent and only compare strings we know are safe for
+ * this. See http://daniel.haxx.se/blog/2008/10/15/strcasecmp-in-turkish/ for
+ * some further explanation to why this function is necessary.
+ *
+ * The function is capable of comparing a-z case insensitively even for
+ * non-ascii.
+ */
+
+static int Curl_raw_equal(const char *first, const char *second)
+{
+ while(*first && *second) {
+ if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second))
+ /* get out of the loop as soon as they don't match */
+ break;
+ first++;
+ second++;
+ }
+ /* we do the comparison here (possibly again), just to make sure that if the
+ loop above is skipped because one of the strings reached zero, we must not
+ return this as a successful match */
+ return (Curl_raw_toupper(*first) == Curl_raw_toupper(*second));
+}
+
+static int Curl_raw_nequal(const char *first, const char *second, size_t max)
+{
+ while(*first && *second && max) {
+ if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second)) {
+ break;
+ }
+ max--;
+ first++;
+ second++;
+ }
+ if(0 == max)
+ return 1; /* they are equal this far */
+
+ return Curl_raw_toupper(*first) == Curl_raw_toupper(*second);
+}
+
+/*
+ * Match a hostname against a wildcard pattern.
+ * E.g.
+ * "foo.host.com" matches "*.host.com".
+ *
+ * We use the matching rule described in RFC6125, section 6.4.3.
+ * http://tools.ietf.org/html/rfc6125#section-6.4.3
+ */
+
+static int hostmatch(const char *hostname, const char *pattern)
+{
+ const char *pattern_label_end, *pattern_wildcard, *hostname_label_end;
+ int wildcard_enabled;
+ size_t prefixlen, suffixlen;
+ pattern_wildcard = strchr(pattern, '*');
+ if(pattern_wildcard == NULL)
+ return Curl_raw_equal(pattern, hostname) ?
+ CURL_HOST_MATCH : CURL_HOST_NOMATCH;
+
+ /* We require at least 2 dots in pattern to avoid too wide wildcard
+ match. */
+ wildcard_enabled = 1;
+ pattern_label_end = strchr(pattern, '.');
+ if(pattern_label_end == NULL || strchr(pattern_label_end+1, '.') == NULL ||
+ pattern_wildcard > pattern_label_end ||
+ Curl_raw_nequal(pattern, "xn--", 4)) {
+ wildcard_enabled = 0;
+ }
+ if(!wildcard_enabled)
+ return Curl_raw_equal(pattern, hostname) ?
+ CURL_HOST_MATCH : CURL_HOST_NOMATCH;
+
+ hostname_label_end = strchr(hostname, '.');
+ if(hostname_label_end == NULL ||
+ !Curl_raw_equal(pattern_label_end, hostname_label_end))
+ return CURL_HOST_NOMATCH;
+
+ /* The wildcard must match at least one character, so the left-most
+ label of the hostname is at least as large as the left-most label
+ of the pattern. */
+ if(hostname_label_end - hostname < pattern_label_end - pattern)
+ return CURL_HOST_NOMATCH;
+
+ prefixlen = pattern_wildcard - pattern;
+ suffixlen = pattern_label_end - (pattern_wildcard+1);
+ return Curl_raw_nequal(pattern, hostname, prefixlen) &&
+ Curl_raw_nequal(pattern_wildcard+1, hostname_label_end - suffixlen,
+ suffixlen) ?
+ CURL_HOST_MATCH : CURL_HOST_NOMATCH;
+}
+
+int Curl_cert_hostcheck(const char *match_pattern, const char *hostname)
+{
+ if(!match_pattern || !*match_pattern ||
+ !hostname || !*hostname) /* sanity check */
+ return 0;
+
+ if(Curl_raw_equal(hostname, match_pattern)) /* trivial case */
+ return 1;
+
+ if(hostmatch(hostname,match_pattern) == CURL_HOST_MATCH)
+ return 1;
+ return 0;
+}
diff --git a/protocols/Telegram/tgl/libevent/sample/hostcheck.h b/protocols/Telegram/tgl/libevent/sample/hostcheck.h
new file mode 100644
index 0000000000..f40bc43435
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/sample/hostcheck.h
@@ -0,0 +1,30 @@
+#ifndef HEADER_CURL_HOSTCHECK_H
+#define HEADER_CURL_HOSTCHECK_H
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+
+#define CURL_HOST_NOMATCH 0
+#define CURL_HOST_MATCH 1
+int Curl_cert_hostcheck(const char *match_pattern, const char *hostname);
+
+#endif /* HEADER_CURL_HOSTCHECK_H */
+
diff --git a/protocols/Telegram/tgl/libevent/sample/http-connect.c b/protocols/Telegram/tgl/libevent/sample/http-connect.c
new file mode 100644
index 0000000000..d6c7b5ea0b
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/sample/http-connect.c
@@ -0,0 +1,119 @@
+#include "event2/event-config.h"
+
+#include <event2/event.h>
+#include <event2/http.h>
+#include <event2/http_struct.h>
+#include <event2/buffer.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <limits.h>
+
+#define VERIFY(cond) do { \
+ if (!(cond)) { \
+ fprintf(stderr, "[error] %s\n", #cond); \
+ } \
+} while (0); \
+
+#define URL_MAX 4096
+
+struct connect_base
+{
+ struct evhttp_connection *evcon;
+ struct evhttp_uri *location;
+};
+
+static void get_cb(struct evhttp_request *req, void *arg)
+{
+ ev_ssize_t len;
+ struct evbuffer *evbuf;
+
+ VERIFY(req);
+
+ evbuf = evhttp_request_get_input_buffer(req);
+ len = evbuffer_get_length(evbuf);
+ fwrite(evbuffer_pullup(evbuf, len), len, 1, stdout);
+ evbuffer_drain(evbuf, len);
+}
+
+static void connect_cb(struct evhttp_request *proxy_req, void *arg)
+{
+ char buffer[URL_MAX];
+
+ struct connect_base *base = arg;
+ struct evhttp_connection *evcon = base->evcon;
+ struct evhttp_uri *location = base->location;
+
+ VERIFY(proxy_req);
+ if (evcon) {
+ struct evhttp_request *req = evhttp_request_new(get_cb, NULL);
+ evhttp_add_header(req->output_headers, "Connection", "close");
+ VERIFY(!evhttp_make_request(evcon, req, EVHTTP_REQ_GET,
+ evhttp_uri_join(location, buffer, URL_MAX)));
+ }
+}
+
+int main(int argc, const char **argv)
+{
+ char buffer[URL_MAX];
+
+ struct evhttp_uri *host_port;
+ struct evhttp_uri *location;
+ struct evhttp_uri *proxy;
+
+ struct event_base *base;
+ struct evhttp_connection *evcon;
+ struct evhttp_request *req;
+
+ struct connect_base connect_base;
+
+ if (argc != 3) {
+ printf("Usage: %s proxy url\n", argv[0]);
+ return 1;
+ }
+
+ {
+ proxy = evhttp_uri_parse(argv[1]);
+ VERIFY(evhttp_uri_get_host(proxy));
+ VERIFY(evhttp_uri_get_port(proxy) > 0);
+ }
+ {
+ host_port = evhttp_uri_parse(argv[2]);
+ evhttp_uri_set_scheme(host_port, NULL);
+ evhttp_uri_set_userinfo(host_port, NULL);
+ evhttp_uri_set_path(host_port, NULL);
+ evhttp_uri_set_query(host_port, NULL);
+ evhttp_uri_set_fragment(host_port, NULL);
+ VERIFY(evhttp_uri_get_host(host_port));
+ VERIFY(evhttp_uri_get_port(host_port) > 0);
+ }
+ {
+ location = evhttp_uri_parse(argv[2]);
+ evhttp_uri_set_scheme(location, NULL);
+ evhttp_uri_set_userinfo(location, 0);
+ evhttp_uri_set_host(location, NULL);
+ evhttp_uri_set_port(location, -1);
+ }
+
+ VERIFY(base = event_base_new());
+ VERIFY(evcon = evhttp_connection_base_new(base, NULL,
+ evhttp_uri_get_host(proxy), evhttp_uri_get_port(proxy)));
+ connect_base = (struct connect_base){
+ .evcon = evcon,
+ .location = location,
+ };
+ VERIFY(req = evhttp_request_new(connect_cb, &connect_base));
+
+ evhttp_add_header(req->output_headers, "Connection", "keep-alive");
+ evhttp_add_header(req->output_headers, "Proxy-Connection", "keep-alive");
+ evutil_snprintf(buffer, URL_MAX, "%s:%d",
+ evhttp_uri_get_host(host_port), evhttp_uri_get_port(host_port));
+ evhttp_make_request(evcon, req, EVHTTP_REQ_CONNECT, buffer);
+
+ event_base_dispatch(base);
+ evhttp_connection_free(evcon);
+ event_base_free(base);
+ evhttp_uri_free(proxy);
+ evhttp_uri_free(host_port);
+ evhttp_uri_free(location);
+ return 0;
+}
diff --git a/protocols/Telegram/tgl/libevent/sample/http-server.c b/protocols/Telegram/tgl/libevent/sample/http-server.c
new file mode 100644
index 0000000000..cbb9c914dd
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/sample/http-server.c
@@ -0,0 +1,418 @@
+/*
+ A trivial static http webserver using Libevent's evhttp.
+
+ This is not the best code in the world, and it does some fairly stupid stuff
+ that you would never want to do in a production webserver. Caveat hackor!
+
+ */
+
+/* Compatibility for possible missing IPv6 declarations */
+#include "../util-internal.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#include <windows.h>
+#include <io.h>
+#include <fcntl.h>
+#ifndef S_ISDIR
+#define S_ISDIR(x) (((x) & S_IFMT) == S_IFDIR)
+#endif
+#else
+#include <sys/stat.h>
+#include <sys/socket.h>
+#include <signal.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <dirent.h>
+#endif
+
+#include <event2/event.h>
+#include <event2/http.h>
+#include <event2/buffer.h>
+#include <event2/util.h>
+#include <event2/keyvalq_struct.h>
+
+#ifdef EVENT__HAVE_NETINET_IN_H
+#include <netinet/in.h>
+# ifdef _XOPEN_SOURCE_EXTENDED
+# include <arpa/inet.h>
+# endif
+#endif
+
+#ifdef _WIN32
+#ifndef stat
+#define stat _stat
+#endif
+#ifndef fstat
+#define fstat _fstat
+#endif
+#ifndef open
+#define open _open
+#endif
+#ifndef close
+#define close _close
+#endif
+#ifndef O_RDONLY
+#define O_RDONLY _O_RDONLY
+#endif
+#endif
+
+char uri_root[512];
+
+static const struct table_entry {
+ const char *extension;
+ const char *content_type;
+} content_type_table[] = {
+ { "txt", "text/plain" },
+ { "c", "text/plain" },
+ { "h", "text/plain" },
+ { "html", "text/html" },
+ { "htm", "text/htm" },
+ { "css", "text/css" },
+ { "gif", "image/gif" },
+ { "jpg", "image/jpeg" },
+ { "jpeg", "image/jpeg" },
+ { "png", "image/png" },
+ { "pdf", "application/pdf" },
+ { "ps", "application/postsript" },
+ { NULL, NULL },
+};
+
+/* Try to guess a good content-type for 'path' */
+static const char *
+guess_content_type(const char *path)
+{
+ const char *last_period, *extension;
+ const struct table_entry *ent;
+ last_period = strrchr(path, '.');
+ if (!last_period || strchr(last_period, '/'))
+ goto not_found; /* no exension */
+ extension = last_period + 1;
+ for (ent = &content_type_table[0]; ent->extension; ++ent) {
+ if (!evutil_ascii_strcasecmp(ent->extension, extension))
+ return ent->content_type;
+ }
+
+not_found:
+ return "application/misc";
+}
+
+/* Callback used for the /dump URI, and for every non-GET request:
+ * dumps all information to stdout and gives back a trivial 200 ok */
+static void
+dump_request_cb(struct evhttp_request *req, void *arg)
+{
+ const char *cmdtype;
+ struct evkeyvalq *headers;
+ struct evkeyval *header;
+ struct evbuffer *buf;
+
+ switch (evhttp_request_get_command(req)) {
+ case EVHTTP_REQ_GET: cmdtype = "GET"; break;
+ case EVHTTP_REQ_POST: cmdtype = "POST"; break;
+ case EVHTTP_REQ_HEAD: cmdtype = "HEAD"; break;
+ case EVHTTP_REQ_PUT: cmdtype = "PUT"; break;
+ case EVHTTP_REQ_DELETE: cmdtype = "DELETE"; break;
+ case EVHTTP_REQ_OPTIONS: cmdtype = "OPTIONS"; break;
+ case EVHTTP_REQ_TRACE: cmdtype = "TRACE"; break;
+ case EVHTTP_REQ_CONNECT: cmdtype = "CONNECT"; break;
+ case EVHTTP_REQ_PATCH: cmdtype = "PATCH"; break;
+ default: cmdtype = "unknown"; break;
+ }
+
+ printf("Received a %s request for %s\nHeaders:\n",
+ cmdtype, evhttp_request_get_uri(req));
+
+ headers = evhttp_request_get_input_headers(req);
+ for (header = headers->tqh_first; header;
+ header = header->next.tqe_next) {
+ printf(" %s: %s\n", header->key, header->value);
+ }
+
+ buf = evhttp_request_get_input_buffer(req);
+ puts("Input data: <<<");
+ while (evbuffer_get_length(buf)) {
+ int n;
+ char cbuf[128];
+ n = evbuffer_remove(buf, cbuf, sizeof(cbuf));
+ if (n > 0)
+ (void) fwrite(cbuf, 1, n, stdout);
+ }
+ puts(">>>");
+
+ evhttp_send_reply(req, 200, "OK", NULL);
+}
+
+/* This callback gets invoked when we get any http request that doesn't match
+ * any other callback. Like any evhttp server callback, it has a simple job:
+ * it must eventually call evhttp_send_error() or evhttp_send_reply().
+ */
+static void
+send_document_cb(struct evhttp_request *req, void *arg)
+{
+ struct evbuffer *evb = NULL;
+ const char *docroot = arg;
+ const char *uri = evhttp_request_get_uri(req);
+ struct evhttp_uri *decoded = NULL;
+ const char *path;
+ char *decoded_path;
+ char *whole_path = NULL;
+ size_t len;
+ int fd = -1;
+ struct stat st;
+
+ if (evhttp_request_get_command(req) != EVHTTP_REQ_GET) {
+ dump_request_cb(req, arg);
+ return;
+ }
+
+ printf("Got a GET request for <%s>\n", uri);
+
+ /* Decode the URI */
+ decoded = evhttp_uri_parse(uri);
+ if (!decoded) {
+ printf("It's not a good URI. Sending BADREQUEST\n");
+ evhttp_send_error(req, HTTP_BADREQUEST, 0);
+ return;
+ }
+
+ /* Let's see what path the user asked for. */
+ path = evhttp_uri_get_path(decoded);
+ if (!path) path = "/";
+
+ /* We need to decode it, to see what path the user really wanted. */
+ decoded_path = evhttp_uridecode(path, 0, NULL);
+ if (decoded_path == NULL)
+ goto err;
+ /* Don't allow any ".."s in the path, to avoid exposing stuff outside
+ * of the docroot. This test is both overzealous and underzealous:
+ * it forbids aceptable paths like "/this/one..here", but it doesn't
+ * do anything to prevent symlink following." */
+ if (strstr(decoded_path, ".."))
+ goto err;
+
+ len = strlen(decoded_path)+strlen(docroot)+2;
+ if (!(whole_path = malloc(len))) {
+ perror("malloc");
+ goto err;
+ }
+ evutil_snprintf(whole_path, len, "%s/%s", docroot, decoded_path);
+
+ if (stat(whole_path, &st)<0) {
+ goto err;
+ }
+
+ /* This holds the content we're sending. */
+ evb = evbuffer_new();
+
+ if (S_ISDIR(st.st_mode)) {
+ /* If it's a directory, read the comments and make a little
+ * index page */
+#ifdef _WIN32
+ HANDLE d;
+ WIN32_FIND_DATAA ent;
+ char *pattern;
+ size_t dirlen;
+#else
+ DIR *d;
+ struct dirent *ent;
+#endif
+ const char *trailing_slash = "";
+
+ if (!strlen(path) || path[strlen(path)-1] != '/')
+ trailing_slash = "/";
+
+#ifdef _WIN32
+ dirlen = strlen(whole_path);
+ pattern = malloc(dirlen+3);
+ memcpy(pattern, whole_path, dirlen);
+ pattern[dirlen] = '\\';
+ pattern[dirlen+1] = '*';
+ pattern[dirlen+2] = '\0';
+ d = FindFirstFileA(pattern, &ent);
+ free(pattern);
+ if (d == INVALID_HANDLE_VALUE)
+ goto err;
+#else
+ if (!(d = opendir(whole_path)))
+ goto err;
+#endif
+
+ evbuffer_add_printf(evb,
+ "<!DOCTYPE html>\n"
+ "<html>\n <head>\n"
+ " <meta charset='utf-8'>\n"
+ " <title>%s</title>\n"
+ " <base href='%s%s'>\n"
+ " </head>\n"
+ " <body>\n"
+ " <h1>%s</h1>\n"
+ " <ul>\n",
+ decoded_path, /* XXX html-escape this. */
+ path, /* XXX html-escape this? */
+ trailing_slash,
+ decoded_path /* XXX html-escape this */);
+#ifdef _WIN32
+ do {
+ const char *name = ent.cFileName;
+#else
+ while ((ent = readdir(d))) {
+ const char *name = ent->d_name;
+#endif
+ evbuffer_add_printf(evb,
+ " <li><a href=\"%s\">%s</a>\n",
+ name, name);/* XXX escape this */
+#ifdef _WIN32
+ } while (FindNextFileA(d, &ent));
+#else
+ }
+#endif
+ evbuffer_add_printf(evb, "</ul></body></html>\n");
+#ifdef _WIN32
+ FindClose(d);
+#else
+ closedir(d);
+#endif
+ evhttp_add_header(evhttp_request_get_output_headers(req),
+ "Content-Type", "text/html");
+ } else {
+ /* Otherwise it's a file; add it to the buffer to get
+ * sent via sendfile */
+ const char *type = guess_content_type(decoded_path);
+ if ((fd = open(whole_path, O_RDONLY)) < 0) {
+ perror("open");
+ goto err;
+ }
+
+ if (fstat(fd, &st)<0) {
+ /* Make sure the length still matches, now that we
+ * opened the file :/ */
+ perror("fstat");
+ goto err;
+ }
+ evhttp_add_header(evhttp_request_get_output_headers(req),
+ "Content-Type", type);
+ evbuffer_add_file(evb, fd, 0, st.st_size);
+ }
+
+ evhttp_send_reply(req, 200, "OK", evb);
+ goto done;
+err:
+ evhttp_send_error(req, 404, "Document was not found");
+ if (fd>=0)
+ close(fd);
+done:
+ if (decoded)
+ evhttp_uri_free(decoded);
+ if (decoded_path)
+ free(decoded_path);
+ if (whole_path)
+ free(whole_path);
+ if (evb)
+ evbuffer_free(evb);
+}
+
+static void
+syntax(void)
+{
+ fprintf(stdout, "Syntax: http-server <docroot>\n");
+}
+
+int
+main(int argc, char **argv)
+{
+ struct event_base *base;
+ struct evhttp *http;
+ struct evhttp_bound_socket *handle;
+
+ unsigned short port = 0;
+#ifdef _WIN32
+ WSADATA WSAData;
+ WSAStartup(0x101, &WSAData);
+#else
+ if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
+ return (1);
+#endif
+ if (argc < 2) {
+ syntax();
+ return 1;
+ }
+
+ base = event_base_new();
+ if (!base) {
+ fprintf(stderr, "Couldn't create an event_base: exiting\n");
+ return 1;
+ }
+
+ /* Create a new evhttp object to handle requests. */
+ http = evhttp_new(base);
+ if (!http) {
+ fprintf(stderr, "couldn't create evhttp. Exiting.\n");
+ return 1;
+ }
+
+ /* The /dump URI will dump all requests to stdout and say 200 ok. */
+ evhttp_set_cb(http, "/dump", dump_request_cb, NULL);
+
+ /* We want to accept arbitrary requests, so we need to set a "generic"
+ * cb. We can also add callbacks for specific paths. */
+ evhttp_set_gencb(http, send_document_cb, argv[1]);
+
+ /* Now we tell the evhttp what port to listen on */
+ handle = evhttp_bind_socket_with_handle(http, "0.0.0.0", port);
+ if (!handle) {
+ fprintf(stderr, "couldn't bind to port %d. Exiting.\n",
+ (int)port);
+ return 1;
+ }
+
+ {
+ /* Extract and display the address we're listening on. */
+ struct sockaddr_storage ss;
+ evutil_socket_t fd;
+ ev_socklen_t socklen = sizeof(ss);
+ char addrbuf[128];
+ void *inaddr;
+ const char *addr;
+ int got_port = -1;
+ fd = evhttp_bound_socket_get_fd(handle);
+ memset(&ss, 0, sizeof(ss));
+ if (getsockname(fd, (struct sockaddr *)&ss, &socklen)) {
+ perror("getsockname() failed");
+ return 1;
+ }
+ if (ss.ss_family == AF_INET) {
+ got_port = ntohs(((struct sockaddr_in*)&ss)->sin_port);
+ inaddr = &((struct sockaddr_in*)&ss)->sin_addr;
+ } else if (ss.ss_family == AF_INET6) {
+ got_port = ntohs(((struct sockaddr_in6*)&ss)->sin6_port);
+ inaddr = &((struct sockaddr_in6*)&ss)->sin6_addr;
+ } else {
+ fprintf(stderr, "Weird address family %d\n",
+ ss.ss_family);
+ return 1;
+ }
+ addr = evutil_inet_ntop(ss.ss_family, inaddr, addrbuf,
+ sizeof(addrbuf));
+ if (addr) {
+ printf("Listening on %s:%d\n", addr, got_port);
+ evutil_snprintf(uri_root, sizeof(uri_root),
+ "http://%s:%d",addr,got_port);
+ } else {
+ fprintf(stderr, "evutil_inet_ntop failed\n");
+ return 1;
+ }
+ }
+
+ event_base_dispatch(base);
+
+ return 0;
+}
diff --git a/protocols/Telegram/tgl/libevent/sample/https-client.c b/protocols/Telegram/tgl/libevent/sample/https-client.c
new file mode 100644
index 0000000000..029cd19c75
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/sample/https-client.c
@@ -0,0 +1,494 @@
+/*
+ This is an example of how to hook up evhttp with bufferevent_ssl
+
+ It just GETs an https URL given on the command-line and prints the response
+ body to stdout.
+
+ Actually, it also accepts plain http URLs to make it easy to compare http vs
+ https code paths.
+
+ Loosely based on le-proxy.c.
+ */
+
+// Get rid of OSX 10.7 and greater deprecation warnings.
+#if defined(__APPLE__) && defined(__clang__)
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
+#include <stdio.h>
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+
+#define snprintf _snprintf
+#define strcasecmp _stricmp
+#else
+#include <sys/socket.h>
+#include <netinet/in.h>
+#endif
+
+#include <event2/bufferevent_ssl.h>
+#include <event2/bufferevent.h>
+#include <event2/buffer.h>
+#include <event2/listener.h>
+#include <event2/util.h>
+#include <event2/http.h>
+
+#include <openssl/ssl.h>
+#include <openssl/err.h>
+#include <openssl/rand.h>
+
+#include "openssl_hostname_validation.h"
+
+static struct event_base *base;
+static int ignore_cert = 0;
+
+static void
+http_request_done(struct evhttp_request *req, void *ctx)
+{
+ char buffer[256];
+ int nread;
+
+ if (req == NULL) {
+ /* If req is NULL, it means an error occurred, but
+ * sadly we are mostly left guessing what the error
+ * might have been. We'll do our best... */
+ struct bufferevent *bev = (struct bufferevent *) ctx;
+ unsigned long oslerr;
+ int printed_err = 0;
+ int errcode = EVUTIL_SOCKET_ERROR();
+ fprintf(stderr, "some request failed - no idea which one though!\n");
+ /* Print out the OpenSSL error queue that libevent
+ * squirreled away for us, if any. */
+ while ((oslerr = bufferevent_get_openssl_error(bev))) {
+ ERR_error_string_n(oslerr, buffer, sizeof(buffer));
+ fprintf(stderr, "%s\n", buffer);
+ printed_err = 1;
+ }
+ /* If the OpenSSL error queue was empty, maybe it was a
+ * socket error; let's try printing that. */
+ if (! printed_err)
+ fprintf(stderr, "socket error = %s (%d)\n",
+ evutil_socket_error_to_string(errcode),
+ errcode);
+ return;
+ }
+
+ fprintf(stderr, "Response line: %d %s\n",
+ evhttp_request_get_response_code(req),
+ evhttp_request_get_response_code_line(req));
+
+ while ((nread = evbuffer_remove(evhttp_request_get_input_buffer(req),
+ buffer, sizeof(buffer)))
+ > 0) {
+ /* These are just arbitrary chunks of 256 bytes.
+ * They are not lines, so we can't treat them as such. */
+ fwrite(buffer, nread, 1, stdout);
+ }
+}
+
+static void
+syntax(void)
+{
+ fputs("Syntax:\n", stderr);
+ fputs(" https-client -url <https-url> [-data data-file.bin] [-ignore-cert] [-retries num] [-timeout sec] [-crt crt]\n", stderr);
+ fputs("Example:\n", stderr);
+ fputs(" https-client -url https://ip.appspot.com/\n", stderr);
+}
+
+static void
+err(const char *msg)
+{
+ fputs(msg, stderr);
+}
+
+static void
+err_openssl(const char *func)
+{
+ fprintf (stderr, "%s failed:\n", func);
+
+ /* This is the OpenSSL function that prints the contents of the
+ * error stack to the specified file handle. */
+ ERR_print_errors_fp (stderr);
+
+ exit(1);
+}
+
+/* See http://archives.seul.org/libevent/users/Jan-2013/msg00039.html */
+static int cert_verify_callback(X509_STORE_CTX *x509_ctx, void *arg)
+{
+ char cert_str[256];
+ const char *host = (const char *) arg;
+ const char *res_str = "X509_verify_cert failed";
+ HostnameValidationResult res = Error;
+
+ /* This is the function that OpenSSL would call if we hadn't called
+ * SSL_CTX_set_cert_verify_callback(). Therefore, we are "wrapping"
+ * the default functionality, rather than replacing it. */
+ int ok_so_far = 0;
+
+ X509 *server_cert = NULL;
+
+ if (ignore_cert) {
+ return 1;
+ }
+
+ ok_so_far = X509_verify_cert(x509_ctx);
+
+ server_cert = X509_STORE_CTX_get_current_cert(x509_ctx);
+
+ if (ok_so_far) {
+ res = validate_hostname(host, server_cert);
+
+ switch (res) {
+ case MatchFound:
+ res_str = "MatchFound";
+ break;
+ case MatchNotFound:
+ res_str = "MatchNotFound";
+ break;
+ case NoSANPresent:
+ res_str = "NoSANPresent";
+ break;
+ case MalformedCertificate:
+ res_str = "MalformedCertificate";
+ break;
+ case Error:
+ res_str = "Error";
+ break;
+ default:
+ res_str = "WTF!";
+ break;
+ }
+ }
+
+ X509_NAME_oneline(X509_get_subject_name (server_cert),
+ cert_str, sizeof (cert_str));
+
+ if (res == MatchFound) {
+ printf("https server '%s' has this certificate, "
+ "which looks good to me:\n%s\n",
+ host, cert_str);
+ return 1;
+ } else {
+ printf("Got '%s' for hostname '%s' and certificate:\n%s\n",
+ res_str, host, cert_str);
+ return 0;
+ }
+}
+
+int
+main(int argc, char **argv)
+{
+ int r;
+
+ struct evhttp_uri *http_uri = NULL;
+ const char *url = NULL, *data_file = NULL;
+ const char *crt = "/etc/ssl/certs/ca-certificates.crt";
+ const char *scheme, *host, *path, *query;
+ char uri[256];
+ int port;
+ int retries = 0;
+ int timeout = -1;
+
+ SSL_CTX *ssl_ctx = NULL;
+ SSL *ssl = NULL;
+ struct bufferevent *bev;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req;
+ struct evkeyvalq *output_headers;
+ struct evbuffer *output_buffer;
+
+ int i;
+ int ret = 0;
+ enum { HTTP, HTTPS } type = HTTP;
+
+ for (i = 1; i < argc; i++) {
+ if (!strcmp("-url", argv[i])) {
+ if (i < argc - 1) {
+ url = argv[i + 1];
+ } else {
+ syntax();
+ goto error;
+ }
+ } else if (!strcmp("-crt", argv[i])) {
+ if (i < argc - 1) {
+ crt = argv[i + 1];
+ } else {
+ syntax();
+ goto error;
+ }
+ } else if (!strcmp("-ignore-cert", argv[i])) {
+ ignore_cert = 1;
+ } else if (!strcmp("-data", argv[i])) {
+ if (i < argc - 1) {
+ data_file = argv[i + 1];
+ } else {
+ syntax();
+ goto error;
+ }
+ } else if (!strcmp("-retries", argv[i])) {
+ if (i < argc - 1) {
+ retries = atoi(argv[i + 1]);
+ } else {
+ syntax();
+ goto error;
+ }
+ } else if (!strcmp("-timeout", argv[i])) {
+ if (i < argc - 1) {
+ timeout = atoi(argv[i + 1]);
+ } else {
+ syntax();
+ goto error;
+ }
+ } else if (!strcmp("-help", argv[i])) {
+ syntax();
+ goto error;
+ }
+ }
+
+ if (!url) {
+ syntax();
+ goto error;
+ }
+
+#ifdef _WIN32
+ {
+ WORD wVersionRequested;
+ WSADATA wsaData;
+ int err;
+
+ wVersionRequested = MAKEWORD(2, 2);
+
+ err = WSAStartup(wVersionRequested, &wsaData);
+ if (err != 0) {
+ printf("WSAStartup failed with error: %d\n", err);
+ goto error;
+ }
+ }
+#endif // _WIN32
+
+ http_uri = evhttp_uri_parse(url);
+ if (http_uri == NULL) {
+ err("malformed url");
+ goto error;
+ }
+
+ scheme = evhttp_uri_get_scheme(http_uri);
+ if (scheme == NULL || (strcasecmp(scheme, "https") != 0 &&
+ strcasecmp(scheme, "http") != 0)) {
+ err("url must be http or https");
+ goto error;
+ }
+
+ host = evhttp_uri_get_host(http_uri);
+ if (host == NULL) {
+ err("url must have a host");
+ goto error;
+ }
+
+ port = evhttp_uri_get_port(http_uri);
+ if (port == -1) {
+ port = (strcasecmp(scheme, "http") == 0) ? 80 : 443;
+ }
+
+ path = evhttp_uri_get_path(http_uri);
+ if (strlen(path) == 0) {
+ path = "/";
+ }
+
+ query = evhttp_uri_get_query(http_uri);
+ if (query == NULL) {
+ snprintf(uri, sizeof(uri) - 1, "%s", path);
+ } else {
+ snprintf(uri, sizeof(uri) - 1, "%s?%s", path, query);
+ }
+ uri[sizeof(uri) - 1] = '\0';
+
+ // Initialize OpenSSL
+ SSL_library_init();
+ ERR_load_crypto_strings();
+ SSL_load_error_strings();
+ OpenSSL_add_all_algorithms();
+
+ /* This isn't strictly necessary... OpenSSL performs RAND_poll
+ * automatically on first use of random number generator. */
+ r = RAND_poll();
+ if (r == 0) {
+ err_openssl("RAND_poll");
+ goto error;
+ }
+
+ /* Create a new OpenSSL context */
+ ssl_ctx = SSL_CTX_new(SSLv23_method());
+ if (!ssl_ctx) {
+ err_openssl("SSL_CTX_new");
+ goto error;
+ }
+
+#ifndef _WIN32
+ /* TODO: Add certificate loading on Windows as well */
+
+ /* Attempt to use the system's trusted root certificates.
+ * (This path is only valid for Debian-based systems.) */
+ if (1 != SSL_CTX_load_verify_locations(ssl_ctx, crt, NULL)) {
+ err_openssl("SSL_CTX_load_verify_locations");
+ goto error;
+ }
+ /* Ask OpenSSL to verify the server certificate. Note that this
+ * does NOT include verifying that the hostname is correct.
+ * So, by itself, this means anyone with any legitimate
+ * CA-issued certificate for any website, can impersonate any
+ * other website in the world. This is not good. See "The
+ * Most Dangerous Code in the World" article at
+ * https://crypto.stanford.edu/~dabo/pubs/abstracts/ssl-client-bugs.html
+ */
+ SSL_CTX_set_verify(ssl_ctx, SSL_VERIFY_PEER, NULL);
+ /* This is how we solve the problem mentioned in the previous
+ * comment. We "wrap" OpenSSL's validation routine in our
+ * own routine, which also validates the hostname by calling
+ * the code provided by iSECPartners. Note that even though
+ * the "Everything You've Always Wanted to Know About
+ * Certificate Validation With OpenSSL (But Were Afraid to
+ * Ask)" paper from iSECPartners says very explicitly not to
+ * call SSL_CTX_set_cert_verify_callback (at the bottom of
+ * page 2), what we're doing here is safe because our
+ * cert_verify_callback() calls X509_verify_cert(), which is
+ * OpenSSL's built-in routine which would have been called if
+ * we hadn't set the callback. Therefore, we're just
+ * "wrapping" OpenSSL's routine, not replacing it. */
+ SSL_CTX_set_cert_verify_callback(ssl_ctx, cert_verify_callback,
+ (void *) host);
+#endif // not _WIN32
+
+ // Create event base
+ base = event_base_new();
+ if (!base) {
+ perror("event_base_new()");
+ goto error;
+ }
+
+ // Create OpenSSL bufferevent and stack evhttp on top of it
+ ssl = SSL_new(ssl_ctx);
+ if (ssl == NULL) {
+ err_openssl("SSL_new()");
+ goto error;
+ }
+
+ #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
+ // Set hostname for SNI extension
+ SSL_set_tlsext_host_name(ssl, host);
+ #endif
+
+ if (strcasecmp(scheme, "http") == 0) {
+ bev = bufferevent_socket_new(base, -1, BEV_OPT_CLOSE_ON_FREE);
+ } else {
+ type = HTTPS;
+ bev = bufferevent_openssl_socket_new(base, -1, ssl,
+ BUFFEREVENT_SSL_CONNECTING,
+ BEV_OPT_CLOSE_ON_FREE|BEV_OPT_DEFER_CALLBACKS);
+ }
+
+ if (bev == NULL) {
+ fprintf(stderr, "bufferevent_openssl_socket_new() failed\n");
+ goto error;
+ }
+
+ bufferevent_openssl_set_allow_dirty_shutdown(bev, 1);
+
+ // For simplicity, we let DNS resolution block. Everything else should be
+ // asynchronous though.
+ evcon = evhttp_connection_base_bufferevent_new(base, NULL, bev,
+ host, port);
+ if (evcon == NULL) {
+ fprintf(stderr, "evhttp_connection_base_bufferevent_new() failed\n");
+ goto error;
+ }
+
+ if (retries > 0) {
+ evhttp_connection_set_retries(evcon, retries);
+ }
+ if (timeout >= 0) {
+ evhttp_connection_set_timeout(evcon, timeout);
+ }
+
+ // Fire off the request
+ req = evhttp_request_new(http_request_done, bev);
+ if (req == NULL) {
+ fprintf(stderr, "evhttp_request_new() failed\n");
+ goto error;
+ }
+
+ output_headers = evhttp_request_get_output_headers(req);
+ evhttp_add_header(output_headers, "Host", host);
+ evhttp_add_header(output_headers, "Connection", "close");
+
+ if (data_file) {
+ /* NOTE: In production code, you'd probably want to use
+ * evbuffer_add_file() or evbuffer_add_file_segment(), to
+ * avoid needless copying. */
+ FILE * f = fopen(data_file, "rb");
+ char buf[1024];
+ size_t s;
+ size_t bytes = 0;
+
+ if (!f) {
+ syntax();
+ goto error;
+ }
+
+ output_buffer = evhttp_request_get_output_buffer(req);
+ while ((s = fread(buf, 1, sizeof(buf), f)) > 0) {
+ evbuffer_add(output_buffer, buf, s);
+ bytes += s;
+ }
+ evutil_snprintf(buf, sizeof(buf)-1, "%lu", (unsigned long)bytes);
+ evhttp_add_header(output_headers, "Content-Length", buf);
+ fclose(f);
+ }
+
+ r = evhttp_make_request(evcon, req, data_file ? EVHTTP_REQ_POST : EVHTTP_REQ_GET, uri);
+ if (r != 0) {
+ fprintf(stderr, "evhttp_make_request() failed\n");
+ goto error;
+ }
+
+ event_base_dispatch(base);
+ goto cleanup;
+
+error:
+ ret = 1;
+cleanup:
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http_uri)
+ evhttp_uri_free(http_uri);
+ event_base_free(base);
+
+ if (ssl_ctx)
+ SSL_CTX_free(ssl_ctx);
+ if (type == HTTP && ssl)
+ SSL_free(ssl);
+ EVP_cleanup();
+ ERR_free_strings();
+
+#ifdef EVENT__HAVE_ERR_REMOVE_THREAD_STATE
+ ERR_remove_thread_state(NULL);
+#else
+ ERR_remove_state(0);
+#endif
+ CRYPTO_cleanup_all_ex_data();
+
+ sk_SSL_COMP_free(SSL_COMP_get_compression_methods());
+
+#ifdef _WIN32
+ WSACleanup();
+#endif
+
+ return ret;
+}
diff --git a/protocols/Telegram/tgl/libevent/sample/include.am b/protocols/Telegram/tgl/libevent/sample/include.am
new file mode 100644
index 0000000000..d1a7242f7c
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/sample/include.am
@@ -0,0 +1,53 @@
+# sample/include.am for libevent
+# Copyright 2000-2007 Niels Provos
+# Copyright 2007-2012 Niels Provos and Nick Mathewson
+#
+# See LICENSE for copying information.
+
+SAMPLES = \
+ sample/dns-example \
+ sample/event-read-fifo \
+ sample/hello-world \
+ sample/http-server \
+ sample/http-connect \
+ sample/signal-test \
+ sample/time-test
+
+if OPENSSL
+SAMPLES += sample/le-proxy
+sample_le_proxy_SOURCES = sample/le-proxy.c
+sample_le_proxy_LDADD = libevent.la libevent_openssl.la ${OPENSSL_LIBS} ${OPENSSL_LIBADD}
+sample_le_proxy_INCLUDES = $(OPENSSL_INCS)
+
+SAMPLES += sample/https-client
+sample_https_client_SOURCES = \
+ sample/https-client.c \
+ sample/hostcheck.c \
+ sample/openssl_hostname_validation.c
+sample_https_client_LDADD = libevent.la libevent_openssl.la ${OPENSSL_LIBS} ${OPENSSL_LIBADD}
+sample_https_client_INCLUDES = $(OPENSSL_INCS)
+noinst_HEADERS += \
+ sample/hostcheck.h \
+ sample/openssl_hostname_validation.h
+endif
+
+if BUILD_SAMPLES
+noinst_PROGRAMS += $(SAMPLES)
+endif
+
+$(SAMPLES) : libevent.la
+
+sample_event_read_fifo_SOURCES = sample/event-read-fifo.c
+sample_event_read_fifo_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
+sample_time_test_SOURCES = sample/time-test.c
+sample_time_test_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
+sample_signal_test_SOURCES = sample/signal-test.c
+sample_signal_test_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
+sample_dns_example_SOURCES = sample/dns-example.c
+sample_dns_example_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
+sample_hello_world_SOURCES = sample/hello-world.c
+sample_hello_world_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
+sample_http_server_SOURCES = sample/http-server.c
+sample_http_server_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
+sample_http_connect_SOURCES = sample/http-connect.c
+sample_http_connect_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
diff --git a/protocols/Telegram/tgl/libevent/sample/le-proxy.c b/protocols/Telegram/tgl/libevent/sample/le-proxy.c
new file mode 100644
index 0000000000..30e0a5f6b9
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/sample/le-proxy.c
@@ -0,0 +1,288 @@
+/*
+ This example code shows how to write an (optionally encrypting) SSL proxy
+ with Libevent's bufferevent layer.
+
+ XXX It's a little ugly and should probably be cleaned up.
+ */
+
+// Get rid of OSX 10.7 and greater deprecation warnings.
+#if defined(__APPLE__) && defined(__clang__)
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
+#include <stdio.h>
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#else
+#include <sys/socket.h>
+#include <netinet/in.h>
+#endif
+
+#include <event2/bufferevent_ssl.h>
+#include <event2/bufferevent.h>
+#include <event2/buffer.h>
+#include <event2/listener.h>
+#include <event2/util.h>
+
+#include <openssl/ssl.h>
+#include <openssl/err.h>
+#include <openssl/rand.h>
+
+static struct event_base *base;
+static struct sockaddr_storage listen_on_addr;
+static struct sockaddr_storage connect_to_addr;
+static int connect_to_addrlen;
+static int use_wrapper = 1;
+
+static SSL_CTX *ssl_ctx = NULL;
+
+#define MAX_OUTPUT (512*1024)
+
+static void drained_writecb(struct bufferevent *bev, void *ctx);
+static void eventcb(struct bufferevent *bev, short what, void *ctx);
+
+static void
+readcb(struct bufferevent *bev, void *ctx)
+{
+ struct bufferevent *partner = ctx;
+ struct evbuffer *src, *dst;
+ size_t len;
+ src = bufferevent_get_input(bev);
+ len = evbuffer_get_length(src);
+ if (!partner) {
+ evbuffer_drain(src, len);
+ return;
+ }
+ dst = bufferevent_get_output(partner);
+ evbuffer_add_buffer(dst, src);
+
+ if (evbuffer_get_length(dst) >= MAX_OUTPUT) {
+ /* We're giving the other side data faster than it can
+ * pass it on. Stop reading here until we have drained the
+ * other side to MAX_OUTPUT/2 bytes. */
+ bufferevent_setcb(partner, readcb, drained_writecb,
+ eventcb, bev);
+ bufferevent_setwatermark(partner, EV_WRITE, MAX_OUTPUT/2,
+ MAX_OUTPUT);
+ bufferevent_disable(bev, EV_READ);
+ }
+}
+
+static void
+drained_writecb(struct bufferevent *bev, void *ctx)
+{
+ struct bufferevent *partner = ctx;
+
+ /* We were choking the other side until we drained our outbuf a bit.
+ * Now it seems drained. */
+ bufferevent_setcb(bev, readcb, NULL, eventcb, partner);
+ bufferevent_setwatermark(bev, EV_WRITE, 0, 0);
+ if (partner)
+ bufferevent_enable(partner, EV_READ);
+}
+
+static void
+close_on_finished_writecb(struct bufferevent *bev, void *ctx)
+{
+ struct evbuffer *b = bufferevent_get_output(bev);
+
+ if (evbuffer_get_length(b) == 0) {
+ bufferevent_free(bev);
+ }
+}
+
+static void
+eventcb(struct bufferevent *bev, short what, void *ctx)
+{
+ struct bufferevent *partner = ctx;
+
+ if (what & (BEV_EVENT_EOF|BEV_EVENT_ERROR)) {
+ if (what & BEV_EVENT_ERROR) {
+ unsigned long err;
+ while ((err = (bufferevent_get_openssl_error(bev)))) {
+ const char *msg = (const char*)
+ ERR_reason_error_string(err);
+ const char *lib = (const char*)
+ ERR_lib_error_string(err);
+ const char *func = (const char*)
+ ERR_func_error_string(err);
+ fprintf(stderr,
+ "%s in %s %s\n", msg, lib, func);
+ }
+ if (errno)
+ perror("connection error");
+ }
+
+ if (partner) {
+ /* Flush all pending data */
+ readcb(bev, ctx);
+
+ if (evbuffer_get_length(
+ bufferevent_get_output(partner))) {
+ /* We still have to flush data from the other
+ * side, but when that's done, close the other
+ * side. */
+ bufferevent_setcb(partner,
+ NULL, close_on_finished_writecb,
+ eventcb, NULL);
+ bufferevent_disable(partner, EV_READ);
+ } else {
+ /* We have nothing left to say to the other
+ * side; close it. */
+ bufferevent_free(partner);
+ }
+ }
+ bufferevent_free(bev);
+ }
+}
+
+static void
+syntax(void)
+{
+ fputs("Syntax:\n", stderr);
+ fputs(" le-proxy [-s] [-W] <listen-on-addr> <connect-to-addr>\n", stderr);
+ fputs("Example:\n", stderr);
+ fputs(" le-proxy 127.0.0.1:8888 1.2.3.4:80\n", stderr);
+
+ exit(1);
+}
+
+static void
+accept_cb(struct evconnlistener *listener, evutil_socket_t fd,
+ struct sockaddr *a, int slen, void *p)
+{
+ struct bufferevent *b_out, *b_in;
+ /* Create two linked bufferevent objects: one to connect, one for the
+ * new connection */
+ b_in = bufferevent_socket_new(base, fd,
+ BEV_OPT_CLOSE_ON_FREE|BEV_OPT_DEFER_CALLBACKS);
+
+ if (!ssl_ctx || use_wrapper)
+ b_out = bufferevent_socket_new(base, -1,
+ BEV_OPT_CLOSE_ON_FREE|BEV_OPT_DEFER_CALLBACKS);
+ else {
+ SSL *ssl = SSL_new(ssl_ctx);
+ b_out = bufferevent_openssl_socket_new(base, -1, ssl,
+ BUFFEREVENT_SSL_CONNECTING,
+ BEV_OPT_CLOSE_ON_FREE|BEV_OPT_DEFER_CALLBACKS);
+ }
+
+ assert(b_in && b_out);
+
+ if (bufferevent_socket_connect(b_out,
+ (struct sockaddr*)&connect_to_addr, connect_to_addrlen)<0) {
+ perror("bufferevent_socket_connect");
+ bufferevent_free(b_out);
+ bufferevent_free(b_in);
+ return;
+ }
+
+ if (ssl_ctx && use_wrapper) {
+ struct bufferevent *b_ssl;
+ SSL *ssl = SSL_new(ssl_ctx);
+ b_ssl = bufferevent_openssl_filter_new(base,
+ b_out, ssl, BUFFEREVENT_SSL_CONNECTING,
+ BEV_OPT_CLOSE_ON_FREE|BEV_OPT_DEFER_CALLBACKS);
+ if (!b_ssl) {
+ perror("Bufferevent_openssl_new");
+ bufferevent_free(b_out);
+ bufferevent_free(b_in);
+ }
+ b_out = b_ssl;
+ }
+
+ bufferevent_setcb(b_in, readcb, NULL, eventcb, b_out);
+ bufferevent_setcb(b_out, readcb, NULL, eventcb, b_in);
+
+ bufferevent_enable(b_in, EV_READ|EV_WRITE);
+ bufferevent_enable(b_out, EV_READ|EV_WRITE);
+}
+
+int
+main(int argc, char **argv)
+{
+ int i;
+ int socklen;
+
+ int use_ssl = 0;
+ struct evconnlistener *listener;
+
+ if (argc < 3)
+ syntax();
+
+ for (i=1; i < argc; ++i) {
+ if (!strcmp(argv[i], "-s")) {
+ use_ssl = 1;
+ } else if (!strcmp(argv[i], "-W")) {
+ use_wrapper = 0;
+ } else if (argv[i][0] == '-') {
+ syntax();
+ } else
+ break;
+ }
+
+ if (i+2 != argc)
+ syntax();
+
+ memset(&listen_on_addr, 0, sizeof(listen_on_addr));
+ socklen = sizeof(listen_on_addr);
+ if (evutil_parse_sockaddr_port(argv[i],
+ (struct sockaddr*)&listen_on_addr, &socklen)<0) {
+ int p = atoi(argv[i]);
+ struct sockaddr_in *sin = (struct sockaddr_in*)&listen_on_addr;
+ if (p < 1 || p > 65535)
+ syntax();
+ sin->sin_port = htons(p);
+ sin->sin_addr.s_addr = htonl(0x7f000001);
+ sin->sin_family = AF_INET;
+ socklen = sizeof(struct sockaddr_in);
+ }
+
+ memset(&connect_to_addr, 0, sizeof(connect_to_addr));
+ connect_to_addrlen = sizeof(connect_to_addr);
+ if (evutil_parse_sockaddr_port(argv[i+1],
+ (struct sockaddr*)&connect_to_addr, &connect_to_addrlen)<0)
+ syntax();
+
+ base = event_base_new();
+ if (!base) {
+ perror("event_base_new()");
+ return 1;
+ }
+
+ if (use_ssl) {
+ int r;
+ SSL_library_init();
+ ERR_load_crypto_strings();
+ SSL_load_error_strings();
+ OpenSSL_add_all_algorithms();
+ r = RAND_poll();
+ if (r == 0) {
+ fprintf(stderr, "RAND_poll() failed.\n");
+ return 1;
+ }
+ ssl_ctx = SSL_CTX_new(SSLv23_method());
+ }
+
+ listener = evconnlistener_new_bind(base, accept_cb, NULL,
+ LEV_OPT_CLOSE_ON_FREE|LEV_OPT_CLOSE_ON_EXEC|LEV_OPT_REUSEABLE,
+ -1, (struct sockaddr*)&listen_on_addr, socklen);
+
+ if (! listener) {
+ fprintf(stderr, "Couldn't open listener.\n");
+ event_base_free(base);
+ return 1;
+ }
+ event_base_dispatch(base);
+
+ evconnlistener_free(listener);
+ event_base_free(base);
+
+ return 0;
+}
diff --git a/protocols/Telegram/tgl/libevent/sample/openssl_hostname_validation.c b/protocols/Telegram/tgl/libevent/sample/openssl_hostname_validation.c
new file mode 100644
index 0000000000..00e63d1e15
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/sample/openssl_hostname_validation.c
@@ -0,0 +1,173 @@
+/* Obtained from: https://github.com/iSECPartners/ssl-conservatory */
+
+/*
+Copyright (C) 2012, iSEC Partners.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+ */
+
+/*
+ * Helper functions to perform basic hostname validation using OpenSSL.
+ *
+ * Please read "everything-you-wanted-to-know-about-openssl.pdf" before
+ * attempting to use this code. This whitepaper describes how the code works,
+ * how it should be used, and what its limitations are.
+ *
+ * Author: Alban Diquet
+ * License: See LICENSE
+ *
+ */
+
+// Get rid of OSX 10.7 and greater deprecation warnings.
+#if defined(__APPLE__) && defined(__clang__)
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
+#include <openssl/x509v3.h>
+#include <openssl/ssl.h>
+#include <string.h>
+
+#include "openssl_hostname_validation.h"
+#include "hostcheck.h"
+
+#define HOSTNAME_MAX_SIZE 255
+
+/**
+* Tries to find a match for hostname in the certificate's Common Name field.
+*
+* Returns MatchFound if a match was found.
+* Returns MatchNotFound if no matches were found.
+* Returns MalformedCertificate if the Common Name had a NUL character embedded in it.
+* Returns Error if the Common Name could not be extracted.
+*/
+static HostnameValidationResult matches_common_name(const char *hostname, const X509 *server_cert) {
+ int common_name_loc = -1;
+ X509_NAME_ENTRY *common_name_entry = NULL;
+ ASN1_STRING *common_name_asn1 = NULL;
+ char *common_name_str = NULL;
+
+ // Find the position of the CN field in the Subject field of the certificate
+ common_name_loc = X509_NAME_get_index_by_NID(X509_get_subject_name((X509 *) server_cert), NID_commonName, -1);
+ if (common_name_loc < 0) {
+ return Error;
+ }
+
+ // Extract the CN field
+ common_name_entry = X509_NAME_get_entry(X509_get_subject_name((X509 *) server_cert), common_name_loc);
+ if (common_name_entry == NULL) {
+ return Error;
+ }
+
+ // Convert the CN field to a C string
+ common_name_asn1 = X509_NAME_ENTRY_get_data(common_name_entry);
+ if (common_name_asn1 == NULL) {
+ return Error;
+ }
+ common_name_str = (char *) ASN1_STRING_data(common_name_asn1);
+
+ // Make sure there isn't an embedded NUL character in the CN
+ if ((size_t)ASN1_STRING_length(common_name_asn1) != strlen(common_name_str)) {
+ return MalformedCertificate;
+ }
+
+ // Compare expected hostname with the CN
+ if (Curl_cert_hostcheck(common_name_str, hostname) == CURL_HOST_MATCH) {
+ return MatchFound;
+ }
+ else {
+ return MatchNotFound;
+ }
+}
+
+
+/**
+* Tries to find a match for hostname in the certificate's Subject Alternative Name extension.
+*
+* Returns MatchFound if a match was found.
+* Returns MatchNotFound if no matches were found.
+* Returns MalformedCertificate if any of the hostnames had a NUL character embedded in it.
+* Returns NoSANPresent if the SAN extension was not present in the certificate.
+*/
+static HostnameValidationResult matches_subject_alternative_name(const char *hostname, const X509 *server_cert) {
+ HostnameValidationResult result = MatchNotFound;
+ int i;
+ int san_names_nb = -1;
+ STACK_OF(GENERAL_NAME) *san_names = NULL;
+
+ // Try to extract the names within the SAN extension from the certificate
+ san_names = X509_get_ext_d2i((X509 *) server_cert, NID_subject_alt_name, NULL, NULL);
+ if (san_names == NULL) {
+ return NoSANPresent;
+ }
+ san_names_nb = sk_GENERAL_NAME_num(san_names);
+
+ // Check each name within the extension
+ for (i=0; i<san_names_nb; i++) {
+ const GENERAL_NAME *current_name = sk_GENERAL_NAME_value(san_names, i);
+
+ if (current_name->type == GEN_DNS) {
+ // Current name is a DNS name, let's check it
+ char *dns_name = (char *) ASN1_STRING_data(current_name->d.dNSName);
+
+ // Make sure there isn't an embedded NUL character in the DNS name
+ if ((size_t)ASN1_STRING_length(current_name->d.dNSName) != strlen(dns_name)) {
+ result = MalformedCertificate;
+ break;
+ }
+ else { // Compare expected hostname with the DNS name
+ if (Curl_cert_hostcheck(dns_name, hostname)
+ == CURL_HOST_MATCH) {
+ result = MatchFound;
+ break;
+ }
+ }
+ }
+ }
+ sk_GENERAL_NAME_pop_free(san_names, GENERAL_NAME_free);
+
+ return result;
+}
+
+
+/**
+* Validates the server's identity by looking for the expected hostname in the
+* server's certificate. As described in RFC 6125, it first tries to find a match
+* in the Subject Alternative Name extension. If the extension is not present in
+* the certificate, it checks the Common Name instead.
+*
+* Returns MatchFound if a match was found.
+* Returns MatchNotFound if no matches were found.
+* Returns MalformedCertificate if any of the hostnames had a NUL character embedded in it.
+* Returns Error if there was an error.
+*/
+HostnameValidationResult validate_hostname(const char *hostname, const X509 *server_cert) {
+ HostnameValidationResult result;
+
+ if((hostname == NULL) || (server_cert == NULL))
+ return Error;
+
+ // First try the Subject Alternative Names extension
+ result = matches_subject_alternative_name(hostname, server_cert);
+ if (result == NoSANPresent) {
+ // Extension was not found: try the Common Name
+ result = matches_common_name(hostname, server_cert);
+ }
+
+ return result;
+}
diff --git a/protocols/Telegram/tgl/libevent/sample/openssl_hostname_validation.h b/protocols/Telegram/tgl/libevent/sample/openssl_hostname_validation.h
new file mode 100644
index 0000000000..54aa1c436d
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/sample/openssl_hostname_validation.h
@@ -0,0 +1,56 @@
+/* Obtained from: https://github.com/iSECPartners/ssl-conservatory */
+
+/*
+Copyright (C) 2012, iSEC Partners.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+ */
+
+/*
+ * Helper functions to perform basic hostname validation using OpenSSL.
+ *
+ * Please read "everything-you-wanted-to-know-about-openssl.pdf" before
+ * attempting to use this code. This whitepaper describes how the code works,
+ * how it should be used, and what its limitations are.
+ *
+ * Author: Alban Diquet
+ * License: See LICENSE
+ *
+ */
+
+typedef enum {
+ MatchFound,
+ MatchNotFound,
+ NoSANPresent,
+ MalformedCertificate,
+ Error
+} HostnameValidationResult;
+
+/**
+* Validates the server's identity by looking for the expected hostname in the
+* server's certificate. As described in RFC 6125, it first tries to find a match
+* in the Subject Alternative Name extension. If the extension is not present in
+* the certificate, it checks the Common Name instead.
+*
+* Returns MatchFound if a match was found.
+* Returns MatchNotFound if no matches were found.
+* Returns MalformedCertificate if any of the hostnames had a NUL character embedded in it.
+* Returns Error if there was an error.
+*/
+HostnameValidationResult validate_hostname(const char *hostname, const X509 *server_cert);
diff --git a/protocols/Telegram/tgl/libevent/sample/signal-test.c b/protocols/Telegram/tgl/libevent/sample/signal-test.c
new file mode 100644
index 0000000000..a61642f325
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/sample/signal-test.c
@@ -0,0 +1,75 @@
+/*
+ * Compile with:
+ * cc -I/usr/local/include -o signal-test \
+ * signal-test.c -L/usr/local/lib -levent
+ */
+
+#include <sys/types.h>
+
+#include <event2/event-config.h>
+
+#include <sys/stat.h>
+#ifndef _WIN32
+#include <sys/queue.h>
+#include <unistd.h>
+#include <sys/time.h>
+#else
+#include <winsock2.h>
+#include <windows.h>
+#endif
+#include <signal.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#include <event2/event.h>
+
+#ifdef EVENT____func__
+#define __func__ EVENT____func__
+#endif
+
+int called = 0;
+
+static void
+signal_cb(evutil_socket_t fd, short event, void *arg)
+{
+ struct event *signal = arg;
+
+ printf("%s: got signal %d\n", __func__, event_get_signal(signal));
+
+ if (called >= 2)
+ event_del(signal);
+
+ called++;
+}
+
+int
+main(int argc, char **argv)
+{
+ struct event *signal_int;
+ struct event_base* base;
+#ifdef _WIN32
+ WORD wVersionRequested;
+ WSADATA wsaData;
+
+ wVersionRequested = MAKEWORD(2, 2);
+
+ (void) WSAStartup(wVersionRequested, &wsaData);
+#endif
+
+ /* Initalize the event library */
+ base = event_base_new();
+
+ /* Initalize one event */
+ signal_int = evsignal_new(base, SIGINT, signal_cb, event_self_cbarg());
+
+ event_add(signal_int, NULL);
+
+ event_base_dispatch(base);
+ event_base_free(base);
+
+ return (0);
+}
+
diff --git a/protocols/Telegram/tgl/libevent/sample/time-test.c b/protocols/Telegram/tgl/libevent/sample/time-test.c
new file mode 100644
index 0000000000..c94c18a500
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/sample/time-test.c
@@ -0,0 +1,107 @@
+/*
+ * XXX This sample code was once meant to show how to use the basic Libevent
+ * interfaces, but it never worked on non-Unix platforms, and some of the
+ * interfaces have changed since it was first written. It should probably
+ * be removed or replaced with something better.
+ *
+ * Compile with:
+ * cc -I/usr/local/include -o time-test time-test.c -L/usr/local/lib -levent
+ */
+
+#include <sys/types.h>
+
+#include <event2/event-config.h>
+
+#include <sys/stat.h>
+#ifndef _WIN32
+#include <sys/queue.h>
+#include <unistd.h>
+#endif
+#include <time.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#include <event2/event.h>
+#include <event2/event_struct.h>
+#include <event2/util.h>
+
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+
+struct timeval lasttime;
+
+int event_is_persistent;
+
+static void
+timeout_cb(evutil_socket_t fd, short event, void *arg)
+{
+ struct timeval newtime, difference;
+ struct event *timeout = arg;
+ double elapsed;
+
+ evutil_gettimeofday(&newtime, NULL);
+ evutil_timersub(&newtime, &lasttime, &difference);
+ elapsed = difference.tv_sec +
+ (difference.tv_usec / 1.0e6);
+
+ printf("timeout_cb called at %d: %.3f seconds elapsed.\n",
+ (int)newtime.tv_sec, elapsed);
+ lasttime = newtime;
+
+ if (! event_is_persistent) {
+ struct timeval tv;
+ evutil_timerclear(&tv);
+ tv.tv_sec = 2;
+ event_add(timeout, &tv);
+ }
+}
+
+int
+main(int argc, char **argv)
+{
+ struct event timeout;
+ struct timeval tv;
+ struct event_base *base;
+ int flags;
+
+#ifdef _WIN32
+ WORD wVersionRequested;
+ WSADATA wsaData;
+
+ wVersionRequested = MAKEWORD(2, 2);
+
+ (void)WSAStartup(wVersionRequested, &wsaData);
+#endif
+
+ if (argc == 2 && !strcmp(argv[1], "-p")) {
+ event_is_persistent = 1;
+ flags = EV_PERSIST;
+ } else {
+ event_is_persistent = 0;
+ flags = 0;
+ }
+
+ /* Initalize the event library */
+ base = event_base_new();
+
+ /* Initalize one event */
+ event_assign(&timeout, base, -1, flags, timeout_cb, (void*) &timeout);
+
+ evutil_timerclear(&tv);
+ tv.tv_sec = 2;
+ event_add(&timeout, &tv);
+
+ evutil_gettimeofday(&lasttime, NULL);
+
+ event_base_dispatch(base);
+
+ return (0);
+}
+
diff --git a/protocols/Telegram/tgl/libevent/select.c b/protocols/Telegram/tgl/libevent/select.c
new file mode 100644
index 0000000000..8ae53cc11e
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/select.c
@@ -0,0 +1,346 @@
+/* $OpenBSD: select.c,v 1.2 2002/06/25 15:50:15 mickey Exp $ */
+
+/*
+ * Copyright 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef EVENT__HAVE_SELECT
+
+#ifdef __APPLE__
+/* Apple wants us to define this if we might ever pass more than
+ * FD_SETSIZE bits to select(). */
+#define _DARWIN_UNLIMITED_SELECT
+#endif
+
+#include <sys/types.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef EVENT__HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#include <sys/queue.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include "event-internal.h"
+#include "evsignal-internal.h"
+#include "event2/thread.h"
+#include "evthread-internal.h"
+#include "log-internal.h"
+#include "evmap-internal.h"
+
+#ifndef EVENT__HAVE_FD_MASK
+/* This type is mandatory, but Android doesn't define it. */
+typedef unsigned long fd_mask;
+#endif
+
+#ifndef NFDBITS
+#define NFDBITS (sizeof(fd_mask)*8)
+#endif
+
+/* Divide positive x by y, rounding up. */
+#define DIV_ROUNDUP(x, y) (((x)+((y)-1))/(y))
+
+/* How many bytes to allocate for N fds? */
+#define SELECT_ALLOC_SIZE(n) \
+ (DIV_ROUNDUP(n, NFDBITS) * sizeof(fd_mask))
+
+struct selectop {
+ int event_fds; /* Highest fd in fd set */
+ int event_fdsz;
+ int resize_out_sets;
+ fd_set *event_readset_in;
+ fd_set *event_writeset_in;
+ fd_set *event_readset_out;
+ fd_set *event_writeset_out;
+};
+
+static void *select_init(struct event_base *);
+static int select_add(struct event_base *, int, short old, short events, void*);
+static int select_del(struct event_base *, int, short old, short events, void*);
+static int select_dispatch(struct event_base *, struct timeval *);
+static void select_dealloc(struct event_base *);
+
+const struct eventop selectops = {
+ "select",
+ select_init,
+ select_add,
+ select_del,
+ select_dispatch,
+ select_dealloc,
+ 0, /* doesn't need reinit. */
+ EV_FEATURE_FDS,
+ 0,
+};
+
+static int select_resize(struct selectop *sop, int fdsz);
+static void select_free_selectop(struct selectop *sop);
+
+static void *
+select_init(struct event_base *base)
+{
+ struct selectop *sop;
+
+ if (!(sop = mm_calloc(1, sizeof(struct selectop))))
+ return (NULL);
+
+ if (select_resize(sop, SELECT_ALLOC_SIZE(32 + 1))) {
+ select_free_selectop(sop);
+ return (NULL);
+ }
+
+ evsig_init_(base);
+
+ evutil_weakrand_seed_(&base->weakrand_seed, 0);
+
+ return (sop);
+}
+
+#ifdef CHECK_INVARIANTS
+static void
+check_selectop(struct selectop *sop)
+{
+ /* nothing to be done here */
+}
+#else
+#define check_selectop(sop) do { (void) sop; } while (0)
+#endif
+
+static int
+select_dispatch(struct event_base *base, struct timeval *tv)
+{
+ int res=0, i, j, nfds;
+ struct selectop *sop = base->evbase;
+
+ check_selectop(sop);
+ if (sop->resize_out_sets) {
+ fd_set *readset_out=NULL, *writeset_out=NULL;
+ size_t sz = sop->event_fdsz;
+ if (!(readset_out = mm_realloc(sop->event_readset_out, sz)))
+ return (-1);
+ sop->event_readset_out = readset_out;
+ if (!(writeset_out = mm_realloc(sop->event_writeset_out, sz))) {
+ /* We don't free readset_out here, since it was
+ * already successfully reallocated. The next time
+ * we call select_dispatch, the realloc will be a
+ * no-op. */
+ return (-1);
+ }
+ sop->event_writeset_out = writeset_out;
+ sop->resize_out_sets = 0;
+ }
+
+ memcpy(sop->event_readset_out, sop->event_readset_in,
+ sop->event_fdsz);
+ memcpy(sop->event_writeset_out, sop->event_writeset_in,
+ sop->event_fdsz);
+
+ nfds = sop->event_fds+1;
+
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+
+ res = select(nfds, sop->event_readset_out,
+ sop->event_writeset_out, NULL, tv);
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+
+ check_selectop(sop);
+
+ if (res == -1) {
+ if (errno != EINTR) {
+ event_warn("select");
+ return (-1);
+ }
+
+ return (0);
+ }
+
+ event_debug(("%s: select reports %d", __func__, res));
+
+ check_selectop(sop);
+ i = evutil_weakrand_range_(&base->weakrand_seed, nfds);
+ for (j = 0; j < nfds; ++j) {
+ if (++i >= nfds)
+ i = 0;
+ res = 0;
+ if (FD_ISSET(i, sop->event_readset_out))
+ res |= EV_READ;
+ if (FD_ISSET(i, sop->event_writeset_out))
+ res |= EV_WRITE;
+
+ if (res == 0)
+ continue;
+
+ evmap_io_active_(base, i, res);
+ }
+ check_selectop(sop);
+
+ return (0);
+}
+
+static int
+select_resize(struct selectop *sop, int fdsz)
+{
+ fd_set *readset_in = NULL;
+ fd_set *writeset_in = NULL;
+
+ if (sop->event_readset_in)
+ check_selectop(sop);
+
+ if ((readset_in = mm_realloc(sop->event_readset_in, fdsz)) == NULL)
+ goto error;
+ sop->event_readset_in = readset_in;
+ if ((writeset_in = mm_realloc(sop->event_writeset_in, fdsz)) == NULL) {
+ /* Note that this will leave event_readset_in expanded.
+ * That's okay; we wouldn't want to free it, since that would
+ * change the semantics of select_resize from "expand the
+ * readset_in and writeset_in, or return -1" to "expand the
+ * *set_in members, or trash them and return -1."
+ */
+ goto error;
+ }
+ sop->event_writeset_in = writeset_in;
+ sop->resize_out_sets = 1;
+
+ memset((char *)sop->event_readset_in + sop->event_fdsz, 0,
+ fdsz - sop->event_fdsz);
+ memset((char *)sop->event_writeset_in + sop->event_fdsz, 0,
+ fdsz - sop->event_fdsz);
+
+ sop->event_fdsz = fdsz;
+ check_selectop(sop);
+
+ return (0);
+
+ error:
+ event_warn("malloc");
+ return (-1);
+}
+
+
+static int
+select_add(struct event_base *base, int fd, short old, short events, void *p)
+{
+ struct selectop *sop = base->evbase;
+ (void) p;
+
+ EVUTIL_ASSERT((events & EV_SIGNAL) == 0);
+ check_selectop(sop);
+ /*
+ * Keep track of the highest fd, so that we can calculate the size
+ * of the fd_sets for select(2)
+ */
+ if (sop->event_fds < fd) {
+ int fdsz = sop->event_fdsz;
+
+ if (fdsz < (int)sizeof(fd_mask))
+ fdsz = (int)sizeof(fd_mask);
+
+ /* In theory we should worry about overflow here. In
+ * reality, though, the highest fd on a unixy system will
+ * not overflow here. XXXX */
+ while (fdsz < (int) SELECT_ALLOC_SIZE(fd + 1))
+ fdsz *= 2;
+
+ if (fdsz != sop->event_fdsz) {
+ if (select_resize(sop, fdsz)) {
+ check_selectop(sop);
+ return (-1);
+ }
+ }
+
+ sop->event_fds = fd;
+ }
+
+ if (events & EV_READ)
+ FD_SET(fd, sop->event_readset_in);
+ if (events & EV_WRITE)
+ FD_SET(fd, sop->event_writeset_in);
+ check_selectop(sop);
+
+ return (0);
+}
+
+/*
+ * Nothing to be done here.
+ */
+
+static int
+select_del(struct event_base *base, int fd, short old, short events, void *p)
+{
+ struct selectop *sop = base->evbase;
+ (void)p;
+
+ EVUTIL_ASSERT((events & EV_SIGNAL) == 0);
+ check_selectop(sop);
+
+ if (sop->event_fds < fd) {
+ check_selectop(sop);
+ return (0);
+ }
+
+ if (events & EV_READ)
+ FD_CLR(fd, sop->event_readset_in);
+
+ if (events & EV_WRITE)
+ FD_CLR(fd, sop->event_writeset_in);
+
+ check_selectop(sop);
+ return (0);
+}
+
+static void
+select_free_selectop(struct selectop *sop)
+{
+ if (sop->event_readset_in)
+ mm_free(sop->event_readset_in);
+ if (sop->event_writeset_in)
+ mm_free(sop->event_writeset_in);
+ if (sop->event_readset_out)
+ mm_free(sop->event_readset_out);
+ if (sop->event_writeset_out)
+ mm_free(sop->event_writeset_out);
+
+ memset(sop, 0, sizeof(struct selectop));
+ mm_free(sop);
+}
+
+static void
+select_dealloc(struct event_base *base)
+{
+ evsig_dealloc_(base);
+
+ select_free_selectop(base->evbase);
+}
+
+#endif /* EVENT__HAVE_SELECT */
diff --git a/protocols/Telegram/tgl/libevent/signal.c b/protocols/Telegram/tgl/libevent/signal.c
new file mode 100644
index 0000000000..3f46295024
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/signal.c
@@ -0,0 +1,479 @@
+/* $OpenBSD: select.c,v 1.2 2002/06/25 15:50:15 mickey Exp $ */
+
+/*
+ * Copyright 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef _WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <winsock2.h>
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#endif
+#include <sys/types.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#ifdef EVENT__HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <errno.h>
+#ifdef EVENT__HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#include "event2/event.h"
+#include "event2/event_struct.h"
+#include "event-internal.h"
+#include "event2/util.h"
+#include "evsignal-internal.h"
+#include "log-internal.h"
+#include "evmap-internal.h"
+#include "evthread-internal.h"
+
+/*
+ signal.c
+
+ This is the signal-handling implementation we use for backends that don't
+ have a better way to do signal handling. It uses sigaction() or signal()
+ to set a signal handler, and a socket pair to tell the event base when
+
+ Note that I said "the event base" : only one event base can be set up to use
+ this at a time. For historical reasons and backward compatibility, if you
+ add an event for a signal to event_base A, then add an event for a signal
+ (any signal!) to event_base B, event_base B will get informed about the
+ signal, but event_base A won't.
+
+ It would be neat to change this behavior in some future version of Libevent.
+ kqueue already does something far more sensible. We can make all backends
+ on Linux do a reasonable thing using signalfd.
+*/
+
+#ifndef _WIN32
+/* Windows wants us to call our signal handlers as __cdecl. Nobody else
+ * expects you to do anything crazy like this. */
+#define __cdecl
+#endif
+
+static int evsig_add(struct event_base *, evutil_socket_t, short, short, void *);
+static int evsig_del(struct event_base *, evutil_socket_t, short, short, void *);
+
+static const struct eventop evsigops = {
+ "signal",
+ NULL,
+ evsig_add,
+ evsig_del,
+ NULL,
+ NULL,
+ 0, 0, 0
+};
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+/* Lock for evsig_base and evsig_base_n_signals_added fields. */
+static void *evsig_base_lock = NULL;
+#endif
+/* The event base that's currently getting informed about signals. */
+static struct event_base *evsig_base = NULL;
+/* A copy of evsig_base->sigev_n_signals_added. */
+static int evsig_base_n_signals_added = 0;
+static evutil_socket_t evsig_base_fd = -1;
+
+static void __cdecl evsig_handler(int sig);
+
+#define EVSIGBASE_LOCK() EVLOCK_LOCK(evsig_base_lock, 0)
+#define EVSIGBASE_UNLOCK() EVLOCK_UNLOCK(evsig_base_lock, 0)
+
+void
+evsig_set_base_(struct event_base *base)
+{
+ EVSIGBASE_LOCK();
+ evsig_base = base;
+ evsig_base_n_signals_added = base->sig.ev_n_signals_added;
+ evsig_base_fd = base->sig.ev_signal_pair[1];
+ EVSIGBASE_UNLOCK();
+}
+
+/* Callback for when the signal handler write a byte to our signaling socket */
+static void
+evsig_cb(evutil_socket_t fd, short what, void *arg)
+{
+ static char signals[1024];
+ ev_ssize_t n;
+ int i;
+ int ncaught[NSIG];
+ struct event_base *base;
+
+ base = arg;
+
+ memset(&ncaught, 0, sizeof(ncaught));
+
+ while (1) {
+#ifdef _WIN32
+ n = recv(fd, signals, sizeof(signals), 0);
+#else
+ n = read(fd, signals, sizeof(signals));
+#endif
+ if (n == -1) {
+ int err = evutil_socket_geterror(fd);
+ if (! EVUTIL_ERR_RW_RETRIABLE(err))
+ event_sock_err(1, fd, "%s: recv", __func__);
+ break;
+ } else if (n == 0) {
+ /* XXX warn? */
+ break;
+ }
+ for (i = 0; i < n; ++i) {
+ ev_uint8_t sig = signals[i];
+ if (sig < NSIG)
+ ncaught[sig]++;
+ }
+ }
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ for (i = 0; i < NSIG; ++i) {
+ if (ncaught[i])
+ evmap_signal_active_(base, i, ncaught[i]);
+ }
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+}
+
+int
+evsig_init_(struct event_base *base)
+{
+ /*
+ * Our signal handler is going to write to one end of the socket
+ * pair to wake up our event loop. The event loop then scans for
+ * signals that got delivered.
+ */
+ if (evutil_make_internal_pipe_(base->sig.ev_signal_pair) == -1) {
+#ifdef _WIN32
+ /* Make this nonfatal on win32, where sometimes people
+ have localhost firewalled. */
+ event_sock_warn(-1, "%s: socketpair", __func__);
+#else
+ event_sock_err(1, -1, "%s: socketpair", __func__);
+#endif
+ return -1;
+ }
+
+ if (base->sig.sh_old) {
+ mm_free(base->sig.sh_old);
+ }
+ base->sig.sh_old = NULL;
+ base->sig.sh_old_max = 0;
+
+ event_assign(&base->sig.ev_signal, base, base->sig.ev_signal_pair[0],
+ EV_READ | EV_PERSIST, evsig_cb, base);
+
+ base->sig.ev_signal.ev_flags |= EVLIST_INTERNAL;
+ event_priority_set(&base->sig.ev_signal, 0);
+
+ base->evsigsel = &evsigops;
+
+ return 0;
+}
+
+/* Helper: set the signal handler for evsignal to handler in base, so that
+ * we can restore the original handler when we clear the current one. */
+int
+evsig_set_handler_(struct event_base *base,
+ int evsignal, void (__cdecl *handler)(int))
+{
+#ifdef EVENT__HAVE_SIGACTION
+ struct sigaction sa;
+#else
+ ev_sighandler_t sh;
+#endif
+ struct evsig_info *sig = &base->sig;
+ void *p;
+
+ /*
+ * resize saved signal handler array up to the highest signal number.
+ * a dynamic array is used to keep footprint on the low side.
+ */
+ if (evsignal >= sig->sh_old_max) {
+ int new_max = evsignal + 1;
+ event_debug(("%s: evsignal (%d) >= sh_old_max (%d), resizing",
+ __func__, evsignal, sig->sh_old_max));
+ p = mm_realloc(sig->sh_old, new_max * sizeof(*sig->sh_old));
+ if (p == NULL) {
+ event_warn("realloc");
+ return (-1);
+ }
+
+ memset((char *)p + sig->sh_old_max * sizeof(*sig->sh_old),
+ 0, (new_max - sig->sh_old_max) * sizeof(*sig->sh_old));
+
+ sig->sh_old_max = new_max;
+ sig->sh_old = p;
+ }
+
+ /* allocate space for previous handler out of dynamic array */
+ sig->sh_old[evsignal] = mm_malloc(sizeof *sig->sh_old[evsignal]);
+ if (sig->sh_old[evsignal] == NULL) {
+ event_warn("malloc");
+ return (-1);
+ }
+
+ /* save previous handler and setup new handler */
+#ifdef EVENT__HAVE_SIGACTION
+ memset(&sa, 0, sizeof(sa));
+ sa.sa_handler = handler;
+ sa.sa_flags |= SA_RESTART;
+ sigfillset(&sa.sa_mask);
+
+ if (sigaction(evsignal, &sa, sig->sh_old[evsignal]) == -1) {
+ event_warn("sigaction");
+ mm_free(sig->sh_old[evsignal]);
+ sig->sh_old[evsignal] = NULL;
+ return (-1);
+ }
+#else
+ if ((sh = signal(evsignal, handler)) == SIG_ERR) {
+ event_warn("signal");
+ mm_free(sig->sh_old[evsignal]);
+ sig->sh_old[evsignal] = NULL;
+ return (-1);
+ }
+ *sig->sh_old[evsignal] = sh;
+#endif
+
+ return (0);
+}
+
+static int
+evsig_add(struct event_base *base, evutil_socket_t evsignal, short old, short events, void *p)
+{
+ struct evsig_info *sig = &base->sig;
+ (void)p;
+
+ EVUTIL_ASSERT(evsignal >= 0 && evsignal < NSIG);
+
+ /* catch signals if they happen quickly */
+ EVSIGBASE_LOCK();
+ if (evsig_base != base && evsig_base_n_signals_added) {
+ event_warnx("Added a signal to event base %p with signals "
+ "already added to event_base %p. Only one can have "
+ "signals at a time with the %s backend. The base with "
+ "the most recently added signal or the most recent "
+ "event_base_loop() call gets preference; do "
+ "not rely on this behavior in future Libevent versions.",
+ base, evsig_base, base->evsel->name);
+ }
+ evsig_base = base;
+ evsig_base_n_signals_added = ++sig->ev_n_signals_added;
+ evsig_base_fd = base->sig.ev_signal_pair[1];
+ EVSIGBASE_UNLOCK();
+
+ event_debug(("%s: %d: changing signal handler", __func__, (int)evsignal));
+ if (evsig_set_handler_(base, (int)evsignal, evsig_handler) == -1) {
+ goto err;
+ }
+
+
+ if (!sig->ev_signal_added) {
+ if (event_add_nolock_(&sig->ev_signal, NULL, 0))
+ goto err;
+ sig->ev_signal_added = 1;
+ }
+
+ return (0);
+
+err:
+ EVSIGBASE_LOCK();
+ --evsig_base_n_signals_added;
+ --sig->ev_n_signals_added;
+ EVSIGBASE_UNLOCK();
+ return (-1);
+}
+
+int
+evsig_restore_handler_(struct event_base *base, int evsignal)
+{
+ int ret = 0;
+ struct evsig_info *sig = &base->sig;
+#ifdef EVENT__HAVE_SIGACTION
+ struct sigaction *sh;
+#else
+ ev_sighandler_t *sh;
+#endif
+
+ if (evsignal >= sig->sh_old_max) {
+ /* Can't actually restore. */
+ /* XXXX.*/
+ return 0;
+ }
+
+ /* restore previous handler */
+ sh = sig->sh_old[evsignal];
+ sig->sh_old[evsignal] = NULL;
+#ifdef EVENT__HAVE_SIGACTION
+ if (sigaction(evsignal, sh, NULL) == -1) {
+ event_warn("sigaction");
+ ret = -1;
+ }
+#else
+ if (signal(evsignal, *sh) == SIG_ERR) {
+ event_warn("signal");
+ ret = -1;
+ }
+#endif
+
+ mm_free(sh);
+
+ return ret;
+}
+
+static int
+evsig_del(struct event_base *base, evutil_socket_t evsignal, short old, short events, void *p)
+{
+ EVUTIL_ASSERT(evsignal >= 0 && evsignal < NSIG);
+
+ event_debug(("%s: "EV_SOCK_FMT": restoring signal handler",
+ __func__, EV_SOCK_ARG(evsignal)));
+
+ EVSIGBASE_LOCK();
+ --evsig_base_n_signals_added;
+ --base->sig.ev_n_signals_added;
+ EVSIGBASE_UNLOCK();
+
+ return (evsig_restore_handler_(base, (int)evsignal));
+}
+
+static void __cdecl
+evsig_handler(int sig)
+{
+ int save_errno = errno;
+#ifdef _WIN32
+ int socket_errno = EVUTIL_SOCKET_ERROR();
+#endif
+ ev_uint8_t msg;
+
+ if (evsig_base == NULL) {
+ event_warnx(
+ "%s: received signal %d, but have no base configured",
+ __func__, sig);
+ return;
+ }
+
+#ifndef EVENT__HAVE_SIGACTION
+ signal(sig, evsig_handler);
+#endif
+
+ /* Wake up our notification mechanism */
+ msg = sig;
+#ifdef _WIN32
+ send(evsig_base_fd, (char*)&msg, 1, 0);
+#else
+ {
+ int r = write(evsig_base_fd, (char*)&msg, 1);
+ (void)r; /* Suppress 'unused return value' and 'unused var' */
+ }
+#endif
+ errno = save_errno;
+#ifdef _WIN32
+ EVUTIL_SET_SOCKET_ERROR(socket_errno);
+#endif
+}
+
+void
+evsig_dealloc_(struct event_base *base)
+{
+ int i = 0;
+ if (base->sig.ev_signal_added) {
+ event_del(&base->sig.ev_signal);
+ base->sig.ev_signal_added = 0;
+ }
+ /* debug event is created in evsig_init_/event_assign even when
+ * ev_signal_added == 0, so unassign is required */
+ event_debug_unassign(&base->sig.ev_signal);
+
+ for (i = 0; i < NSIG; ++i) {
+ if (i < base->sig.sh_old_max && base->sig.sh_old[i] != NULL)
+ evsig_restore_handler_(base, i);
+ }
+ EVSIGBASE_LOCK();
+ if (base == evsig_base) {
+ evsig_base = NULL;
+ evsig_base_n_signals_added = 0;
+ evsig_base_fd = -1;
+ }
+ EVSIGBASE_UNLOCK();
+
+ if (base->sig.ev_signal_pair[0] != -1) {
+ evutil_closesocket(base->sig.ev_signal_pair[0]);
+ base->sig.ev_signal_pair[0] = -1;
+ }
+ if (base->sig.ev_signal_pair[1] != -1) {
+ evutil_closesocket(base->sig.ev_signal_pair[1]);
+ base->sig.ev_signal_pair[1] = -1;
+ }
+ base->sig.sh_old_max = 0;
+
+ /* per index frees are handled in evsig_del() */
+ if (base->sig.sh_old) {
+ mm_free(base->sig.sh_old);
+ base->sig.sh_old = NULL;
+ }
+}
+
+static void
+evsig_free_globals_locks(void)
+{
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ if (evsig_base_lock != NULL) {
+ EVTHREAD_FREE_LOCK(evsig_base_lock, 0);
+ evsig_base_lock = NULL;
+ }
+#endif
+ return;
+}
+
+void
+evsig_free_globals_(void)
+{
+ evsig_free_globals_locks();
+}
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+int
+evsig_global_setup_locks_(const int enable_locks)
+{
+ EVTHREAD_SETUP_GLOBAL_LOCK(evsig_base_lock, 0);
+ return 0;
+}
+
+#endif
diff --git a/protocols/Telegram/tgl/libevent/signal.obj b/protocols/Telegram/tgl/libevent/signal.obj
new file mode 100644
index 0000000000..97a9c944b5
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/signal.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/strlcpy-internal.h b/protocols/Telegram/tgl/libevent/strlcpy-internal.h
new file mode 100644
index 0000000000..cfc27ec662
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/strlcpy-internal.h
@@ -0,0 +1,22 @@
+#ifndef STRLCPY_INTERNAL_H_INCLUDED_
+#define STRLCPY_INTERNAL_H_INCLUDED_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifndef EVENT__HAVE_STRLCPY
+#include <string.h>
+size_t event_strlcpy_(char *dst, const char *src, size_t siz);
+#define strlcpy event_strlcpy_
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/protocols/Telegram/tgl/libevent/strlcpy.c b/protocols/Telegram/tgl/libevent/strlcpy.c
new file mode 100644
index 0000000000..3876475f5a
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/strlcpy.c
@@ -0,0 +1,75 @@
+/* $OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp $ */
+
+/*
+ * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 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 ``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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char *rcsid = "$OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#include <sys/types.h>
+
+#ifndef EVENT__HAVE_STRLCPY
+#include "strlcpy-internal.h"
+
+/*
+ * Copy src to string dst of size siz. At most siz-1 characters
+ * will be copied. Always NUL terminates (unless siz == 0).
+ * Returns strlen(src); if retval >= siz, truncation occurred.
+ */
+size_t
+event_strlcpy_(dst, src, siz)
+ char *dst;
+ const char *src;
+ size_t siz;
+{
+ register char *d = dst;
+ register const char *s = src;
+ register size_t n = siz;
+
+ /* Copy as many bytes as will fit */
+ if (n != 0 && --n != 0) {
+ do {
+ if ((*d++ = *s++) == 0)
+ break;
+ } while (--n != 0);
+ }
+
+ /* Not enough room in dst, add NUL and traverse rest of src */
+ if (n == 0) {
+ if (siz != 0)
+ *d = '\0'; /* NUL-terminate dst */
+ while (*s++)
+ ;
+ }
+
+ return (s - src - 1); /* count does not include NUL */
+}
+#endif
diff --git a/protocols/Telegram/tgl/libevent/strlcpy.obj b/protocols/Telegram/tgl/libevent/strlcpy.obj
new file mode 100644
index 0000000000..2bc0f36f3e
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/strlcpy.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/Makefile.nmake b/protocols/Telegram/tgl/libevent/test/Makefile.nmake
new file mode 100644
index 0000000000..30c3eb792b
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/Makefile.nmake
@@ -0,0 +1,79 @@
+# WATCH OUT! This makefile is a work in progress. -*- makefile -*-
+
+!IFDEF OPENSSL_DIR
+SSL_CFLAGS=/I$(OPENSSL_DIR)\include /DEVENT__HAVE_OPENSSL
+SSL_OBJS=regress_ssl.obj
+SSL_LIBS=..\libevent_openssl.lib $(OPENSSL_DIR)\lib\libeay32.lib $(OPENSSL_DIR)\lib\ssleay32.lib gdi32.lib User32.lib
+!ELSE
+SSL_CFLAGS=
+SSL_OBJS=
+SSL_LIBS=
+!ENDIF
+
+CFLAGS=/I.. /I../WIN32-Code /I../WIN32-Code/nmake /I../include /I../compat /DHAVE_CONFIG_H /DTINYTEST_LOCAL $(SSL_CFLAGS)
+
+CFLAGS=$(CFLAGS) /Ox /W3 /wd4996 /nologo
+
+REGRESS_OBJS=regress.obj regress_buffer.obj regress_http.obj regress_dns.obj \
+ regress_testutils.obj \
+ regress_rpc.obj regress.gen.obj \
+ regress_et.obj regress_bufferevent.obj \
+ regress_listener.obj regress_util.obj tinytest.obj \
+ regress_main.obj regress_minheap.obj regress_iocp.obj \
+ regress_thread.obj regress_finalize.obj $(SSL_OBJS)
+
+OTHER_OBJS=test-init.obj test-eof.obj test-closed.obj test-weof.obj test-time.obj \
+ bench.obj bench_cascade.obj bench_http.obj bench_httpclient.obj \
+ test-changelist.obj \
+ print-winsock-errors.obj
+
+PROGRAMS=regress.exe \
+ test-init.exe test-eof.exe test-closed.exe test-weof.exe test-time.exe \
+ test-changelist.exe \
+ print-winsock-errors.exe
+
+# Disabled for now:
+# bench.exe bench_cascade.exe bench_http.exe bench_httpclient.exe
+
+
+LIBS=..\libevent.lib ws2_32.lib shell32.lib advapi32.lib
+
+all: $(PROGRAMS)
+
+regress.exe: $(REGRESS_OBJS)
+ $(CC) $(CFLAGS) $(LIBS) $(SSL_LIBS) $(REGRESS_OBJS)
+
+test-init.exe: test-init.obj
+ $(CC) $(CFLAGS) $(LIBS) test-init.obj
+test-eof.exe: test-eof.obj
+ $(CC) $(CFLAGS) $(LIBS) test-eof.obj
+test-closed.exe: test-closed.obj
+ $(CC) $(CFLAGS) $(LIBS) test-closed.obj
+test-changelist.exe: test-changelist.obj
+ $(CC) $(CFLAGS) $(LIBS) test-changelist.obj
+test-weof.exe: test-weof.obj
+ $(CC) $(CFLAGS) $(LIBS) test-weof.obj
+test-time.exe: test-time.obj
+ $(CC) $(CFLAGS) $(LIBS) test-time.obj
+
+print-winsock-errors.exe: print-winsock-errors.obj
+ $(CC) $(CFLAGS) $(LIBS) print-winsock-errors.obj
+
+bench.exe: bench.obj
+ $(CC) $(CFLAGS) $(LIBS) bench.obj
+bench_cascade.exe: bench_cascade.obj
+ $(CC) $(CFLAGS) $(LIBS) bench_cascade.obj
+bench_http.exe: bench_http.obj
+ $(CC) $(CFLAGS) $(LIBS) bench_http.obj
+bench_httpclient.exe: bench_httpclient.obj
+ $(CC) $(CFLAGS) $(LIBS) bench_httpclient.obj
+
+regress.gen.c regress.gen.h: regress.rpc ../event_rpcgen.py
+ echo // > regress.gen.c
+ echo #define NO_PYTHON_EXISTS > regress.gen.h
+ -python ..\event_rpcgen.py regress.rpc
+
+clean:
+ -del $(REGRESS_OBJS)
+ -del $(OTHER_OBJS)
+ -del $(PROGRAMS)
diff --git a/protocols/Telegram/tgl/libevent/test/bench.c b/protocols/Telegram/tgl/libevent/test/bench.c
new file mode 100644
index 0000000000..214479c1ff
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/bench.c
@@ -0,0 +1,207 @@
+/*
+ * Copyright 2003-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ * 4. 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.
+ *
+ *
+ * Mon 03/10/2003 - Modified by Davide Libenzi <davidel@xmailserver.org>
+ *
+ * Added chain event propagation to improve the sensitivity of
+ * the measure respect to the event loop efficency.
+ *
+ *
+ */
+
+#include "event2/event-config.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef _WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#else
+#include <sys/socket.h>
+#include <signal.h>
+#include <sys/resource.h>
+#endif
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <errno.h>
+
+#ifdef _WIN32
+#include <getopt.h>
+#endif
+
+#include <event.h>
+#include <evutil.h>
+
+static int count, writes, fired, failures;
+static evutil_socket_t *pipes;
+static int num_pipes, num_active, num_writes;
+static struct event *events;
+
+
+static void
+read_cb(evutil_socket_t fd, short which, void *arg)
+{
+ ev_intptr_t idx = (ev_intptr_t) arg, widx = idx + 1;
+ unsigned char ch;
+ ev_ssize_t n;
+
+ n = recv(fd, (char*)&ch, sizeof(ch), 0);
+ if (n >= 0)
+ count += n;
+ else
+ failures++;
+ if (writes) {
+ if (widx >= num_pipes)
+ widx -= num_pipes;
+ n = send(pipes[2 * widx + 1], "e", 1, 0);
+ if (n != 1)
+ failures++;
+ writes--;
+ fired++;
+ }
+}
+
+static struct timeval *
+run_once(void)
+{
+ evutil_socket_t *cp, space;
+ long i;
+ static struct timeval ts, te;
+
+ for (cp = pipes, i = 0; i < num_pipes; i++, cp += 2) {
+ if (event_initialized(&events[i]))
+ event_del(&events[i]);
+ event_set(&events[i], cp[0], EV_READ | EV_PERSIST, read_cb, (void *)(ev_intptr_t) i);
+ event_add(&events[i], NULL);
+ }
+
+ event_loop(EVLOOP_ONCE | EVLOOP_NONBLOCK);
+
+ fired = 0;
+ space = num_pipes / num_active;
+ space = space * 2;
+ for (i = 0; i < num_active; i++, fired++)
+ (void) send(pipes[i * space + 1], "e", 1, 0);
+
+ count = 0;
+ writes = num_writes;
+ { int xcount = 0;
+ evutil_gettimeofday(&ts, NULL);
+ do {
+ event_loop(EVLOOP_ONCE | EVLOOP_NONBLOCK);
+ xcount++;
+ } while (count != fired);
+ evutil_gettimeofday(&te, NULL);
+
+ if (xcount != count) fprintf(stderr, "Xcount: %d, Rcount: %d\n", xcount, count);
+ }
+
+ evutil_timersub(&te, &ts, &te);
+
+ return (&te);
+}
+
+int
+main(int argc, char **argv)
+{
+#ifdef HAVE_SETRLIMIT
+ struct rlimit rl;
+#endif
+ int i, c;
+ struct timeval *tv;
+ evutil_socket_t *cp;
+
+#ifdef _WIN32
+ WSADATA WSAData;
+ WSAStartup(0x101, &WSAData);
+#endif
+ num_pipes = 100;
+ num_active = 1;
+ num_writes = num_pipes;
+ while ((c = getopt(argc, argv, "n:a:w:")) != -1) {
+ switch (c) {
+ case 'n':
+ num_pipes = atoi(optarg);
+ break;
+ case 'a':
+ num_active = atoi(optarg);
+ break;
+ case 'w':
+ num_writes = atoi(optarg);
+ break;
+ default:
+ fprintf(stderr, "Illegal argument \"%c\"\n", c);
+ exit(1);
+ }
+ }
+
+#ifdef HAVE_SETRLIMIT
+ rl.rlim_cur = rl.rlim_max = num_pipes * 2 + 50;
+ if (setrlimit(RLIMIT_NOFILE, &rl) == -1) {
+ perror("setrlimit");
+ exit(1);
+ }
+#endif
+
+ events = calloc(num_pipes, sizeof(struct event));
+ pipes = calloc(num_pipes * 2, sizeof(evutil_socket_t));
+ if (events == NULL || pipes == NULL) {
+ perror("malloc");
+ exit(1);
+ }
+
+ event_init();
+
+ for (cp = pipes, i = 0; i < num_pipes; i++, cp += 2) {
+#ifdef USE_PIPES
+ if (pipe(cp) == -1) {
+#else
+ if (evutil_socketpair(AF_UNIX, SOCK_STREAM, 0, cp) == -1) {
+#endif
+ perror("pipe");
+ exit(1);
+ }
+ }
+
+ for (i = 0; i < 25; i++) {
+ tv = run_once();
+ if (tv == NULL)
+ exit(1);
+ fprintf(stdout, "%ld\n",
+ tv->tv_sec * 1000000L + tv->tv_usec);
+ }
+
+ exit(0);
+}
diff --git a/protocols/Telegram/tgl/libevent/test/bench_cascade.c b/protocols/Telegram/tgl/libevent/test/bench_cascade.c
new file mode 100644
index 0000000000..2d85cc1f10
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/bench_cascade.c
@@ -0,0 +1,188 @@
+/*
+ * Copyright 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ * 4. 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 "event2/event-config.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef _WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#else
+#include <sys/socket.h>
+#include <sys/resource.h>
+#endif
+#include <signal.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <errno.h>
+#include <getopt.h>
+#include <event.h>
+#include <evutil.h>
+
+/*
+ * This benchmark tests how quickly we can propagate a write down a chain
+ * of socket pairs. We start by writing to the first socket pair and all
+ * events will fire subsequently until the last socket pair has been reached
+ * and the benchmark terminates.
+ */
+
+static int fired;
+static evutil_socket_t *pipes;
+static struct event *events;
+
+static void
+read_cb(evutil_socket_t fd, short which, void *arg)
+{
+ char ch;
+ evutil_socket_t sock = (evutil_socket_t)(ev_intptr_t)arg;
+
+ (void) recv(fd, &ch, sizeof(ch), 0);
+ if (sock >= 0) {
+ if (send(sock, "e", 1, 0) < 0)
+ perror("send");
+ }
+ fired++;
+}
+
+static struct timeval *
+run_once(int num_pipes)
+{
+ int i;
+ evutil_socket_t *cp;
+ static struct timeval ts, te, tv_timeout;
+
+ events = (struct event *)calloc(num_pipes, sizeof(struct event));
+ pipes = (evutil_socket_t *)calloc(num_pipes * 2, sizeof(evutil_socket_t));
+
+ if (events == NULL || pipes == NULL) {
+ perror("malloc");
+ exit(1);
+ }
+
+ for (cp = pipes, i = 0; i < num_pipes; i++, cp += 2) {
+ if (evutil_socketpair(AF_UNIX, SOCK_STREAM, 0, cp) == -1) {
+ perror("socketpair");
+ exit(1);
+ }
+ }
+
+ /* measurements includes event setup */
+ evutil_gettimeofday(&ts, NULL);
+
+ /* provide a default timeout for events */
+ evutil_timerclear(&tv_timeout);
+ tv_timeout.tv_sec = 60;
+
+ for (cp = pipes, i = 0; i < num_pipes; i++, cp += 2) {
+ evutil_socket_t fd = i < num_pipes - 1 ? cp[3] : -1;
+ event_set(&events[i], cp[0], EV_READ, read_cb,
+ (void *)(ev_intptr_t)fd);
+ event_add(&events[i], &tv_timeout);
+ }
+
+ fired = 0;
+
+ /* kick everything off with a single write */
+ if (send(pipes[1], "e", 1, 0) < 0)
+ perror("send");
+
+ event_dispatch();
+
+ evutil_gettimeofday(&te, NULL);
+ evutil_timersub(&te, &ts, &te);
+
+ for (cp = pipes, i = 0; i < num_pipes; i++, cp += 2) {
+ event_del(&events[i]);
+ evutil_closesocket(cp[0]);
+ evutil_closesocket(cp[1]);
+ }
+
+ free(pipes);
+ free(events);
+
+ return (&te);
+}
+
+int
+main(int argc, char **argv)
+{
+#ifdef HAVE_SETRLIMIT
+ struct rlimit rl;
+#endif
+ int i, c;
+ struct timeval *tv;
+
+ int num_pipes = 100;
+#ifdef _WIN32
+ WSADATA WSAData;
+ WSAStartup(0x101, &WSAData);
+#endif
+
+ while ((c = getopt(argc, argv, "n:")) != -1) {
+ switch (c) {
+ case 'n':
+ num_pipes = atoi(optarg);
+ break;
+ default:
+ fprintf(stderr, "Illegal argument \"%c\"\n", c);
+ exit(1);
+ }
+ }
+
+#ifdef HAVE_SETRLIMIT
+ rl.rlim_cur = rl.rlim_max = num_pipes * 2 + 50;
+ if (setrlimit(RLIMIT_NOFILE, &rl) == -1) {
+ perror("setrlimit");
+ exit(1);
+ }
+#endif
+
+ event_init();
+
+ for (i = 0; i < 25; i++) {
+ tv = run_once(num_pipes);
+ if (tv == NULL)
+ exit(1);
+ fprintf(stdout, "%ld\n",
+ tv->tv_sec * 1000000L + tv->tv_usec);
+ }
+
+#ifdef _WIN32
+ WSACleanup();
+#endif
+
+ exit(0);
+}
diff --git a/protocols/Telegram/tgl/libevent/test/bench_http.c b/protocols/Telegram/tgl/libevent/test/bench_http.c
new file mode 100644
index 0000000000..6d0d971799
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/bench_http.c
@@ -0,0 +1,195 @@
+/*
+ * Copyright 2008-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ * 4. 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 <sys/types.h>
+#include <sys/stat.h>
+#ifdef _WIN32
+#include <winsock2.h>
+#else
+#include <sys/socket.h>
+#include <sys/resource.h>
+#include <sys/time.h>
+#include <unistd.h>
+#endif
+#include <fcntl.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#include "event2/event.h"
+#include "event2/buffer.h"
+#include "event2/util.h"
+#include "event2/http.h"
+#include "event2/thread.h"
+
+static void http_basic_cb(struct evhttp_request *req, void *arg);
+
+static char *content;
+static size_t content_len = 0;
+
+static void
+http_basic_cb(struct evhttp_request *req, void *arg)
+{
+ struct evbuffer *evb = evbuffer_new();
+
+ evbuffer_add(evb, content, content_len);
+
+ /* allow sending of an empty reply */
+ evhttp_send_reply(req, HTTP_OK, "Everything is fine", evb);
+
+ evbuffer_free(evb);
+}
+
+#if LIBEVENT_VERSION_NUMBER >= 0x02000200
+static void
+http_ref_cb(struct evhttp_request *req, void *arg)
+{
+ struct evbuffer *evb = evbuffer_new();
+
+ evbuffer_add_reference(evb, content, content_len, NULL, NULL);
+
+ /* allow sending of an empty reply */
+ evhttp_send_reply(req, HTTP_OK, "Everything is fine", evb);
+
+ evbuffer_free(evb);
+}
+#endif
+
+int
+main(int argc, char **argv)
+{
+ struct event_config *cfg = event_config_new();
+ struct event_base *base;
+ struct evhttp *http;
+ int i;
+ int c;
+ int use_iocp = 0;
+ unsigned short port = 8080;
+ char *endptr = NULL;
+
+#ifdef _WIN32
+ WSADATA WSAData;
+ WSAStartup(0x101, &WSAData);
+#else
+ if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
+ return (1);
+#endif
+
+ for (i = 1; i < argc; ++i) {
+ if (*argv[i] != '-')
+ continue;
+
+ c = argv[i][1];
+
+ if ((c == 'p' || c == 'l') && i + 1 >= argc) {
+ fprintf(stderr, "-%c requires argument.\n", c);
+ exit(1);
+ }
+
+ switch (c) {
+ case 'p':
+ if (i+1 >= argc || !argv[i+1]) {
+ fprintf(stderr, "Missing port\n");
+ exit(1);
+ }
+ port = (int)strtol(argv[i+1], &endptr, 10);
+ if (*endptr != '\0') {
+ fprintf(stderr, "Bad port\n");
+ exit(1);
+ }
+ break;
+ case 'l':
+ if (i+1 >= argc || !argv[i+1]) {
+ fprintf(stderr, "Missing content length\n");
+ exit(1);
+ }
+ content_len = (size_t)strtol(argv[i+1], &endptr, 10);
+ if (*endptr != '\0' || content_len == 0) {
+ fprintf(stderr, "Bad content length\n");
+ exit(1);
+ }
+ break;
+#ifdef _WIN32
+ case 'i':
+ use_iocp = 1;
+ evthread_use_windows_threads();
+ event_config_set_flag(cfg,EVENT_BASE_FLAG_STARTUP_IOCP);
+ break;
+#endif
+ default:
+ fprintf(stderr, "Illegal argument \"%c\"\n", c);
+ exit(1);
+ }
+ }
+
+ base = event_base_new_with_config(cfg);
+ if (!base) {
+ fprintf(stderr, "creating event_base failed. Exiting.\n");
+ return 1;
+ }
+
+ http = evhttp_new(base);
+
+ content = malloc(content_len);
+ if (content == NULL) {
+ fprintf(stderr, "Cannot allocate content\n");
+ exit(1);
+ } else {
+ int i = 0;
+ for (i = 0; i < (int)content_len; ++i)
+ content[i] = (i & 255);
+ }
+
+ evhttp_set_cb(http, "/ind", http_basic_cb, NULL);
+ fprintf(stderr, "/ind - basic content (memory copy)\n");
+
+ evhttp_set_cb(http, "/ref", http_ref_cb, NULL);
+ fprintf(stderr, "/ref - basic content (reference)\n");
+
+ fprintf(stderr, "Serving %d bytes on port %d using %s\n",
+ (int)content_len, port,
+ use_iocp? "IOCP" : event_base_get_method(base));
+
+ evhttp_bind_socket(http, "0.0.0.0", port);
+
+#ifdef _WIN32
+ if (use_iocp) {
+ struct timeval tv={99999999,0};
+ event_base_loopexit(base, &tv);
+ }
+#endif
+ event_base_dispatch(base);
+
+#ifdef _WIN32
+ WSACleanup();
+#endif
+
+ /* NOTREACHED */
+ return (0);
+}
diff --git a/protocols/Telegram/tgl/libevent/test/bench_httpclient.c b/protocols/Telegram/tgl/libevent/test/bench_httpclient.c
new file mode 100644
index 0000000000..bcddc95f43
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/bench_httpclient.c
@@ -0,0 +1,239 @@
+/*
+ * Copyright 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ * 4. 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.
+ *
+ */
+
+/* for EVUTIL_ERR_CONNECT_RETRIABLE macro */
+#include "util-internal.h"
+
+#include <sys/types.h>
+#ifdef _WIN32
+#include <winsock2.h>
+#else
+#include <sys/socket.h>
+#include <netinet/in.h>
+# ifdef _XOPEN_SOURCE_EXTENDED
+# include <arpa/inet.h>
+# endif
+#endif
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+#include "event2/event.h"
+#include "event2/bufferevent.h"
+#include "event2/buffer.h"
+#include "event2/util.h"
+
+const char *resource = NULL;
+struct event_base *base = NULL;
+
+int total_n_handled = 0;
+int total_n_errors = 0;
+int total_n_launched = 0;
+size_t total_n_bytes = 0;
+struct timeval total_time = {0,0};
+int n_errors = 0;
+
+const int PARALLELISM = 200;
+const int N_REQUESTS = 20000;
+
+struct request_info {
+ size_t n_read;
+ struct timeval started;
+};
+
+static int launch_request(void);
+static void readcb(struct bufferevent *b, void *arg);
+static void errorcb(struct bufferevent *b, short what, void *arg);
+
+static void
+readcb(struct bufferevent *b, void *arg)
+{
+ struct request_info *ri = arg;
+ struct evbuffer *input = bufferevent_get_input(b);
+ size_t n = evbuffer_get_length(input);
+
+ ri->n_read += n;
+ evbuffer_drain(input, n);
+}
+
+static void
+errorcb(struct bufferevent *b, short what, void *arg)
+{
+ struct request_info *ri = arg;
+ struct timeval now, diff;
+ if (what & BEV_EVENT_EOF) {
+ ++total_n_handled;
+ total_n_bytes += ri->n_read;
+ evutil_gettimeofday(&now, NULL);
+ evutil_timersub(&now, &ri->started, &diff);
+ evutil_timeradd(&diff, &total_time, &total_time);
+
+ if (total_n_handled && (total_n_handled%1000)==0)
+ printf("%d requests done\n",total_n_handled);
+
+ if (total_n_launched < N_REQUESTS) {
+ if (launch_request() < 0)
+ perror("Can't launch");
+ }
+ } else {
+ ++total_n_errors;
+ perror("Unexpected error");
+ }
+
+ bufferevent_setcb(b, NULL, NULL, NULL, NULL);
+ free(ri);
+ bufferevent_disable(b, EV_READ|EV_WRITE);
+ bufferevent_free(b);
+}
+
+static void
+frob_socket(evutil_socket_t sock)
+{
+#ifdef HAVE_SO_LINGER
+ struct linger l;
+#endif
+ int one = 1;
+ if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void*)&one, sizeof(one))<0)
+ perror("setsockopt(SO_REUSEADDR)");
+#ifdef HAVE_SO_LINGER
+ l.l_onoff = 1;
+ l.l_linger = 0;
+ if (setsockopt(sock, SOL_SOCKET, SO_LINGER, (void*)&l, sizeof(l))<0)
+ perror("setsockopt(SO_LINGER)");
+#endif
+}
+
+static int
+launch_request(void)
+{
+ evutil_socket_t sock;
+ struct sockaddr_in sin;
+ struct bufferevent *b;
+
+ struct request_info *ri;
+
+ memset(&sin, 0, sizeof(sin));
+
+ ++total_n_launched;
+
+ sin.sin_family = AF_INET;
+ sin.sin_addr.s_addr = htonl(0x7f000001);
+ sin.sin_port = htons(8080);
+ if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0)
+ return -1;
+ if (evutil_make_socket_nonblocking(sock) < 0) {
+ evutil_closesocket(sock);
+ return -1;
+ }
+ frob_socket(sock);
+ if (connect(sock, (struct sockaddr*)&sin, sizeof(sin)) < 0) {
+ int e = evutil_socket_geterror(sock);
+ if (! EVUTIL_ERR_CONNECT_RETRIABLE(e)) {
+ evutil_closesocket(sock);
+ return -1;
+ }
+ }
+
+ ri = malloc(sizeof(*ri));
+ ri->n_read = 0;
+ evutil_gettimeofday(&ri->started, NULL);
+
+ b = bufferevent_socket_new(base, sock, BEV_OPT_CLOSE_ON_FREE);
+
+ bufferevent_setcb(b, readcb, NULL, errorcb, ri);
+ bufferevent_enable(b, EV_READ|EV_WRITE);
+
+ evbuffer_add_printf(bufferevent_get_output(b),
+ "GET %s HTTP/1.0\r\n\r\n", resource);
+
+ return 0;
+}
+
+
+int
+main(int argc, char **argv)
+{
+ int i;
+ struct timeval start, end, total;
+ long long usec;
+ double throughput;
+ resource = "/ref";
+
+#ifdef _WIN32
+ WSADATA WSAData;
+ WSAStartup(0x101, &WSAData);
+#endif
+
+ setvbuf(stdout, NULL, _IONBF, 0);
+
+ base = event_base_new();
+
+ for (i=0; i < PARALLELISM; ++i) {
+ if (launch_request() < 0)
+ perror("launch");
+ }
+
+ evutil_gettimeofday(&start, NULL);
+
+ event_base_dispatch(base);
+
+ evutil_gettimeofday(&end, NULL);
+ evutil_timersub(&end, &start, &total);
+ usec = total_time.tv_sec * (long long)1000000 + total_time.tv_usec;
+
+ if (!total_n_handled) {
+ puts("Nothing worked. You probably did something dumb.");
+ return 0;
+ }
+
+
+ throughput = total_n_handled /
+ (total.tv_sec+ ((double)total.tv_usec)/1000000.0);
+
+#ifdef _WIN32
+#define I64_FMT "%I64d"
+#define I64_TYP __int64
+#else
+#define I64_FMT "%lld"
+#define I64_TYP long long int
+#endif
+
+ printf("\n%d requests in %d.%06d sec. (%.2f throughput)\n"
+ "Each took about %.02f msec latency\n"
+ I64_FMT "bytes read. %d errors.\n",
+ total_n_handled,
+ (int)total.tv_sec, (int)total.tv_usec,
+ throughput,
+ (double)(usec/1000) / total_n_handled,
+ (I64_TYP)total_n_bytes, n_errors);
+
+#ifdef _WIN32
+ WSACleanup();
+#endif
+
+ return 0;
+}
diff --git a/protocols/Telegram/tgl/libevent/test/check-dumpevents.py b/protocols/Telegram/tgl/libevent/test/check-dumpevents.py
new file mode 100644
index 0000000000..16fe9bc92f
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/check-dumpevents.py
@@ -0,0 +1,54 @@
+#!/usr/bin/python2
+#
+# Post-process the output of test-dumpevents and check it for correctness.
+#
+
+import math
+import re
+import sys
+
+text = sys.stdin.readlines()
+
+try:
+ expect_inserted_pos = text.index("Inserted:\n")
+ expect_active_pos = text.index("Active:\n")
+ got_inserted_pos = text.index("Inserted events:\n")
+ got_active_pos = text.index("Active events:\n")
+except ValueError:
+ print >>sys.stderr, "Missing expected dividing line in dumpevents output"
+ sys.exit(1)
+
+if not (expect_inserted_pos < expect_active_pos <
+ got_inserted_pos < got_active_pos):
+ print >>sys.stderr, "Sections out of order in dumpevents output"
+ sys.exit(1)
+
+now,T= text[1].split()
+T = float(T)
+
+want_inserted = set(text[expect_inserted_pos+1:expect_active_pos])
+want_active = set(text[expect_active_pos+1:got_inserted_pos-1])
+got_inserted = set(text[got_inserted_pos+1:got_active_pos])
+got_active = set(text[got_active_pos+1:])
+
+pat = re.compile(r'Timeout=([0-9\.]+)')
+def replace_time(m):
+ t = float(m.group(1))
+ if .9 < abs(t-T) < 1.1:
+ return "Timeout=T+1"
+ elif 2.4 < abs(t-T) < 2.6:
+ return "Timeout=T+2.5"
+ else:
+ return m.group(0)
+
+cleaned_inserted = set( pat.sub(replace_time, s) for s in got_inserted
+ if "Internal" not in s)
+
+if cleaned_inserted != want_inserted:
+ print >>sys.stderr, "Inserted event lists were not as expected!"
+ sys.exit(1)
+
+if set(got_active) != set(want_active):
+ print >>sys.stderr, "Active event lists were not as expected!"
+ sys.exit(1)
+
diff --git a/protocols/Telegram/tgl/libevent/test/include.am b/protocols/Telegram/tgl/libevent/test/include.am
new file mode 100644
index 0000000000..4cd49ef630
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/include.am
@@ -0,0 +1,146 @@
+# test/Makefile.am for libevent
+# Copyright 2000-2007 Niels Provos
+# Copyright 2007-2012 Niels Provos and Nick Mathewson
+#
+# See LICENSE for copying information.
+
+regress_CPPFLAGS = -DTINYTEST_LOCAL
+
+EXTRA_DIST+= \
+ test/check-dumpevents.py \
+ test/regress.gen.c \
+ test/regress.gen.h \
+ test/regress.rpc \
+ test/rpcgen_wrapper.sh \
+ test/test.sh
+
+TESTPROGRAMS = \
+ test/bench \
+ test/bench_cascade \
+ test/bench_http \
+ test/bench_httpclient \
+ test/test-changelist \
+ test/test-dumpevents \
+ test/test-eof \
+ test/test-closed \
+ test/test-fdleak \
+ test/test-init \
+ test/test-ratelim \
+ test/test-time \
+ test/test-weof \
+ test/regress
+
+if BUILD_REGRESS
+noinst_PROGRAMS += $(TESTPROGRAMS)
+EXTRA_PROGRAMS+= test/regress
+endif
+
+noinst_HEADERS+= \
+ test/regress.h \
+ test/regress_thread.h \
+ test/tinytest.h \
+ test/tinytest_local.h \
+ test/tinytest_macros.h
+
+# We need to copy this file, since automake doesn't want us to use top_srcdir
+# in TESTS.
+TESTS = test/test-script.sh
+
+test/test-script.sh: test/test.sh
+ cp $(top_srcdir)/test/test.sh $@
+
+DISTCLEANFILES += test/test-script.sh
+DISTCLEANFILES += test/regress.gen.c test/regress.gen.h
+
+if BUILD_REGRESS
+BUILT_SOURCES += test/regress.gen.c test/regress.gen.h
+endif
+
+test_test_init_SOURCES = test/test-init.c
+test_test_init_LDADD = libevent_core.la
+test_test_dumpevents_SOURCES = test/test-dumpevents.c
+test_test_dumpevents_LDADD = libevent_core.la
+test_test_eof_SOURCES = test/test-eof.c
+test_test_eof_LDADD = libevent_core.la
+test_test_closed_SOURCES = test/test-closed.c
+test_test_closed_LDADD = libevent_core.la
+test_test_changelist_SOURCES = test/test-changelist.c
+test_test_changelist_LDADD = libevent_core.la
+test_test_weof_SOURCES = test/test-weof.c
+test_test_weof_LDADD = libevent_core.la
+test_test_time_SOURCES = test/test-time.c
+test_test_time_LDADD = libevent_core.la
+test_test_ratelim_SOURCES = test/test-ratelim.c
+test_test_ratelim_LDADD = libevent_core.la -lm
+test_test_fdleak_SOURCES = test/test-fdleak.c
+test_test_fdleak_LDADD = libevent_core.la
+
+test_regress_SOURCES = \
+ test/regress.c \
+ test/regress.gen.c \
+ test/regress.gen.h \
+ test/regress_buffer.c \
+ test/regress_bufferevent.c \
+ test/regress_dns.c \
+ test/regress_et.c \
+ test/regress_finalize.c \
+ test/regress_http.c \
+ test/regress_listener.c \
+ test/regress_main.c \
+ test/regress_minheap.c \
+ test/regress_rpc.c \
+ test/regress_testutils.c \
+ test/regress_testutils.h \
+ test/regress_util.c \
+ test/tinytest.c \
+ $(regress_thread_SOURCES) \
+ $(regress_zlib_SOURCES)
+
+if PTHREADS
+regress_thread_SOURCES = test/regress_thread.c
+PTHREAD_LIBS += libevent_pthreads.la
+endif
+if BUILD_WIN32
+regress_thread_SOURCES = test/regress_thread.c
+endif
+if ZLIB_REGRESS
+regress_zlib_SOURCES = test/regress_zlib.c
+endif
+if BUILD_WIN32
+test_regress_SOURCES += test/regress_iocp.c
+endif
+
+test_regress_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la $(PTHREAD_LIBS) $(ZLIB_LIBS)
+test_regress_CPPFLAGS = $(AM_CPPFLAGS) $(PTHREAD_CFLAGS) $(ZLIB_CFLAGS) -Itest
+test_regress_LDFLAGS = $(PTHREAD_CFLAGS)
+
+if OPENSSL
+test_regress_SOURCES += test/regress_ssl.c
+test_regress_CPPFLAGS += $(OPENSSL_INCS)
+test_regress_LDADD += libevent_openssl.la $(OPENSSL_LIBS) ${OPENSSL_LIBADD}
+endif
+
+test_bench_SOURCES = test/bench.c
+test_bench_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
+test_bench_cascade_SOURCES = test/bench_cascade.c
+test_bench_cascade_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
+test_bench_http_SOURCES = test/bench_http.c
+test_bench_http_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
+test_bench_httpclient_SOURCES = test/bench_httpclient.c
+test_bench_httpclient_LDADD = $(LIBEVENT_GC_SECTIONS) libevent_core.la
+
+test/regress.gen.c test/regress.gen.h: test/rpcgen-attempted
+
+test/rpcgen-attempted: test/regress.rpc event_rpcgen.py test/rpcgen_wrapper.sh
+ $(AM_V_GEN)date -u > $@
+ $(AM_V_at)if $(srcdir)/test/rpcgen_wrapper.sh $(srcdir)/test; then \
+ true; \
+ else \
+ echo "No Python installed; stubbing out RPC test." >&2; \
+ echo " "> test/regress.gen.c; \
+ echo "#define NO_PYTHON_EXISTS" > test/regress.gen.h; \
+ fi
+
+CLEANFILES += test/rpcgen-attempted
+
+$(TESTPROGRAMS) : libevent.la
diff --git a/protocols/Telegram/tgl/libevent/test/print-winsock-errors.c b/protocols/Telegram/tgl/libevent/test/print-winsock-errors.c
new file mode 100644
index 0000000000..ab6e610e84
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/print-winsock-errors.c
@@ -0,0 +1,84 @@
+#include <winsock2.h>
+#include <windows.h>
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "event2/event.h"
+#include "event2/util.h"
+#include "event2/thread.h"
+
+#define E(x) printf (#x " -> \"%s\"\n", evutil_socket_error_to_string (x));
+
+int main (int argc, char **argv)
+{
+ int i, j;
+ const char *s1, *s2;
+
+ evthread_use_windows_threads ();
+
+ s1 = evutil_socket_error_to_string (WSAEINTR);
+
+ for (i = 0; i < 3; i++) {
+ printf ("\niteration %d:\n\n", i);
+ E(WSAEINTR);
+ E(WSAEACCES);
+ E(WSAEFAULT);
+ E(WSAEINVAL);
+ E(WSAEMFILE);
+ E(WSAEWOULDBLOCK);
+ E(WSAEINPROGRESS);
+ E(WSAEALREADY);
+ E(WSAENOTSOCK);
+ E(WSAEDESTADDRREQ);
+ E(WSAEMSGSIZE);
+ E(WSAEPROTOTYPE);
+ E(WSAENOPROTOOPT);
+ E(WSAEPROTONOSUPPORT);
+ E(WSAESOCKTNOSUPPORT);
+ E(WSAEOPNOTSUPP);
+ E(WSAEPFNOSUPPORT);
+ E(WSAEAFNOSUPPORT);
+ E(WSAEADDRINUSE);
+ E(WSAEADDRNOTAVAIL);
+ E(WSAENETDOWN);
+ E(WSAENETUNREACH);
+ E(WSAENETRESET);
+ E(WSAECONNABORTED);
+ E(WSAECONNRESET);
+ E(WSAENOBUFS);
+ E(WSAEISCONN);
+ E(WSAENOTCONN);
+ E(WSAESHUTDOWN);
+ E(WSAETIMEDOUT);
+ E(WSAECONNREFUSED);
+ E(WSAEHOSTDOWN);
+ E(WSAEHOSTUNREACH);
+ E(WSAEPROCLIM);
+ E(WSASYSNOTREADY);
+ E(WSAVERNOTSUPPORTED);
+ E(WSANOTINITIALISED);
+ E(WSAEDISCON);
+ E(WSATYPE_NOT_FOUND);
+ E(WSAHOST_NOT_FOUND);
+ E(WSATRY_AGAIN);
+ E(WSANO_RECOVERY);
+ E(WSANO_DATA);
+ E(0xdeadbeef); /* test the case where no message is available */
+
+ /* fill up the hash table a bit to make sure it grows properly */
+ for (j = 0; j < 50; j++) {
+ int err;
+ evutil_secure_rng_get_bytes(&err, sizeof(err));
+ evutil_socket_error_to_string(err);
+ }
+ }
+
+ s2 = evutil_socket_error_to_string (WSAEINTR);
+ if (s1 != s2)
+ printf ("caching failed!\n");
+
+ libevent_global_shutdown ();
+
+ return EXIT_SUCCESS;
+}
diff --git a/protocols/Telegram/tgl/libevent/test/print-winsock-errors.exe b/protocols/Telegram/tgl/libevent/test/print-winsock-errors.exe
new file mode 100644
index 0000000000..7bdbd19034
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/print-winsock-errors.exe
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/print-winsock-errors.obj b/protocols/Telegram/tgl/libevent/test/print-winsock-errors.obj
new file mode 100644
index 0000000000..ca803f6340
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/print-winsock-errors.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/regress.c b/protocols/Telegram/tgl/libevent/test/regress.c
new file mode 100644
index 0000000000..b12c66dfa0
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress.c
@@ -0,0 +1,3401 @@
+/*
+ * Copyright (c) 2003-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "util-internal.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+#ifdef EVENT__HAVE_PTHREADS
+#include <pthread.h>
+#endif
+
+#include "event2/event-config.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#ifndef _WIN32
+#include <sys/socket.h>
+#include <sys/wait.h>
+#include <signal.h>
+#include <unistd.h>
+#include <netdb.h>
+#endif
+#include <fcntl.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "event2/event.h"
+#include "event2/event_struct.h"
+#include "event2/event_compat.h"
+#include "event2/tag.h"
+#include "event2/buffer.h"
+#include "event2/buffer_compat.h"
+#include "event2/util.h"
+#include "event-internal.h"
+#include "evthread-internal.h"
+#include "log-internal.h"
+#include "time-internal.h"
+
+#include "regress.h"
+
+#ifndef _WIN32
+#include "regress.gen.h"
+#endif
+
+evutil_socket_t pair[2];
+int test_ok;
+int called;
+struct event_base *global_base;
+
+static char wbuf[4096];
+static char rbuf[4096];
+static int woff;
+static int roff;
+static int usepersist;
+static struct timeval tset;
+static struct timeval tcalled;
+
+
+#define TEST1 "this is a test"
+
+#ifndef SHUT_WR
+#define SHUT_WR 1
+#endif
+
+#ifdef _WIN32
+#define write(fd,buf,len) send((fd),(buf),(int)(len),0)
+#define read(fd,buf,len) recv((fd),(buf),(int)(len),0)
+#endif
+
+struct basic_cb_args
+{
+ struct event_base *eb;
+ struct event *ev;
+ unsigned int callcount;
+};
+
+static void
+simple_read_cb(evutil_socket_t fd, short event, void *arg)
+{
+ char buf[256];
+ int len;
+
+ len = read(fd, buf, sizeof(buf));
+
+ if (len) {
+ if (!called) {
+ if (event_add(arg, NULL) == -1)
+ exit(1);
+ }
+ } else if (called == 1)
+ test_ok = 1;
+
+ called++;
+}
+
+static void
+basic_read_cb(evutil_socket_t fd, short event, void *data)
+{
+ char buf[256];
+ int len;
+ struct basic_cb_args *arg = data;
+
+ len = read(fd, buf, sizeof(buf));
+
+ if (len < 0) {
+ tt_fail_perror("read (callback)");
+ } else {
+ switch (arg->callcount++) {
+ case 0: /* first call: expect to read data; cycle */
+ if (len > 0)
+ return;
+
+ tt_fail_msg("EOF before data read");
+ break;
+
+ case 1: /* second call: expect EOF; stop */
+ if (len > 0)
+ tt_fail_msg("not all data read on first cycle");
+ break;
+
+ default: /* third call: should not happen */
+ tt_fail_msg("too many cycles");
+ }
+ }
+
+ event_del(arg->ev);
+ event_base_loopexit(arg->eb, NULL);
+}
+
+static void
+dummy_read_cb(evutil_socket_t fd, short event, void *arg)
+{
+}
+
+static void
+simple_write_cb(evutil_socket_t fd, short event, void *arg)
+{
+ int len;
+
+ len = write(fd, TEST1, strlen(TEST1) + 1);
+ if (len == -1)
+ test_ok = 0;
+ else
+ test_ok = 1;
+}
+
+static void
+multiple_write_cb(evutil_socket_t fd, short event, void *arg)
+{
+ struct event *ev = arg;
+ int len;
+
+ len = 128;
+ if (woff + len >= (int)sizeof(wbuf))
+ len = sizeof(wbuf) - woff;
+
+ len = write(fd, wbuf + woff, len);
+ if (len == -1) {
+ fprintf(stderr, "%s: write\n", __func__);
+ if (usepersist)
+ event_del(ev);
+ return;
+ }
+
+ woff += len;
+
+ if (woff >= (int)sizeof(wbuf)) {
+ shutdown(fd, SHUT_WR);
+ if (usepersist)
+ event_del(ev);
+ return;
+ }
+
+ if (!usepersist) {
+ if (event_add(ev, NULL) == -1)
+ exit(1);
+ }
+}
+
+static void
+multiple_read_cb(evutil_socket_t fd, short event, void *arg)
+{
+ struct event *ev = arg;
+ int len;
+
+ len = read(fd, rbuf + roff, sizeof(rbuf) - roff);
+ if (len == -1)
+ fprintf(stderr, "%s: read\n", __func__);
+ if (len <= 0) {
+ if (usepersist)
+ event_del(ev);
+ return;
+ }
+
+ roff += len;
+ if (!usepersist) {
+ if (event_add(ev, NULL) == -1)
+ exit(1);
+ }
+}
+
+static void
+timeout_cb(evutil_socket_t fd, short event, void *arg)
+{
+ evutil_gettimeofday(&tcalled, NULL);
+}
+
+struct both {
+ struct event ev;
+ int nread;
+};
+
+static void
+combined_read_cb(evutil_socket_t fd, short event, void *arg)
+{
+ struct both *both = arg;
+ char buf[128];
+ int len;
+
+ len = read(fd, buf, sizeof(buf));
+ if (len == -1)
+ fprintf(stderr, "%s: read\n", __func__);
+ if (len <= 0)
+ return;
+
+ both->nread += len;
+ if (event_add(&both->ev, NULL) == -1)
+ exit(1);
+}
+
+static void
+combined_write_cb(evutil_socket_t fd, short event, void *arg)
+{
+ struct both *both = arg;
+ char buf[128];
+ int len;
+
+ len = sizeof(buf);
+ if (len > both->nread)
+ len = both->nread;
+
+ memset(buf, 'q', len);
+
+ len = write(fd, buf, len);
+ if (len == -1)
+ fprintf(stderr, "%s: write\n", __func__);
+ if (len <= 0) {
+ shutdown(fd, SHUT_WR);
+ return;
+ }
+
+ both->nread -= len;
+ if (event_add(&both->ev, NULL) == -1)
+ exit(1);
+}
+
+/* These macros used to replicate the work of the legacy test wrapper code */
+#define setup_test(x) do { \
+ if (!in_legacy_test_wrapper) { \
+ TT_FAIL(("Legacy test %s not wrapped properly", x)); \
+ return; \
+ } \
+ } while (0)
+#define cleanup_test() setup_test("cleanup")
+
+static void
+test_simpleread(void)
+{
+ struct event ev;
+
+ /* Very simple read test */
+ setup_test("Simple read: ");
+
+ if (write(pair[0], TEST1, strlen(TEST1)+1) < 0) {
+ tt_fail_perror("write");
+ }
+
+ shutdown(pair[0], SHUT_WR);
+
+ event_set(&ev, pair[1], EV_READ, simple_read_cb, &ev);
+ if (event_add(&ev, NULL) == -1)
+ exit(1);
+ event_dispatch();
+
+ cleanup_test();
+}
+
+static void
+test_simplewrite(void)
+{
+ struct event ev;
+
+ /* Very simple write test */
+ setup_test("Simple write: ");
+
+ event_set(&ev, pair[0], EV_WRITE, simple_write_cb, &ev);
+ if (event_add(&ev, NULL) == -1)
+ exit(1);
+ event_dispatch();
+
+ cleanup_test();
+}
+
+static void
+simpleread_multiple_cb(evutil_socket_t fd, short event, void *arg)
+{
+ if (++called == 2)
+ test_ok = 1;
+}
+
+static void
+test_simpleread_multiple(void)
+{
+ struct event one, two;
+
+ /* Very simple read test */
+ setup_test("Simple read to multiple evens: ");
+
+ if (write(pair[0], TEST1, strlen(TEST1)+1) < 0) {
+ tt_fail_perror("write");
+ }
+
+ shutdown(pair[0], SHUT_WR);
+
+ event_set(&one, pair[1], EV_READ, simpleread_multiple_cb, NULL);
+ if (event_add(&one, NULL) == -1)
+ exit(1);
+ event_set(&two, pair[1], EV_READ, simpleread_multiple_cb, NULL);
+ if (event_add(&two, NULL) == -1)
+ exit(1);
+ event_dispatch();
+
+ cleanup_test();
+}
+
+static int have_closed = 0;
+static int premature_event = 0;
+static void
+simpleclose_close_fd_cb(evutil_socket_t s, short what, void *ptr)
+{
+ evutil_socket_t **fds = ptr;
+ TT_BLATHER(("Closing"));
+ evutil_closesocket(*fds[0]);
+ evutil_closesocket(*fds[1]);
+ *fds[0] = -1;
+ *fds[1] = -1;
+ have_closed = 1;
+}
+
+static void
+record_event_cb(evutil_socket_t s, short what, void *ptr)
+{
+ short *whatp = ptr;
+ if (!have_closed)
+ premature_event = 1;
+ *whatp = what;
+ TT_BLATHER(("Recorded %d on socket %d", (int)what, (int)s));
+}
+
+static void
+test_simpleclose(void *ptr)
+{
+ /* Test that a close of FD is detected as a read and as a write. */
+ struct event_base *base = event_base_new();
+ evutil_socket_t pair1[2]={-1,-1}, pair2[2] = {-1, -1};
+ evutil_socket_t *to_close[2];
+ struct event *rev=NULL, *wev=NULL, *closeev=NULL;
+ struct timeval tv;
+ short got_read_on_close = 0, got_write_on_close = 0;
+ char buf[1024];
+ memset(buf, 99, sizeof(buf));
+#ifdef _WIN32
+#define LOCAL_SOCKETPAIR_AF AF_INET
+#else
+#define LOCAL_SOCKETPAIR_AF AF_UNIX
+#endif
+ if (evutil_socketpair(LOCAL_SOCKETPAIR_AF, SOCK_STREAM, 0, pair1)<0)
+ TT_DIE(("socketpair: %s", strerror(errno)));
+ if (evutil_socketpair(LOCAL_SOCKETPAIR_AF, SOCK_STREAM, 0, pair2)<0)
+ TT_DIE(("socketpair: %s", strerror(errno)));
+ if (evutil_make_socket_nonblocking(pair1[1]) < 0)
+ TT_DIE(("make_socket_nonblocking"));
+ if (evutil_make_socket_nonblocking(pair2[1]) < 0)
+ TT_DIE(("make_socket_nonblocking"));
+
+ /** Stuff pair2[1] full of data, until write fails */
+ while (1) {
+ int r = write(pair2[1], buf, sizeof(buf));
+ if (r<0) {
+ int err = evutil_socket_geterror(pair2[1]);
+ if (! EVUTIL_ERR_RW_RETRIABLE(err))
+ TT_DIE(("write failed strangely: %s",
+ evutil_socket_error_to_string(err)));
+ break;
+ }
+ }
+ to_close[0] = &pair1[0];
+ to_close[1] = &pair2[0];
+
+ closeev = event_new(base, -1, EV_TIMEOUT, simpleclose_close_fd_cb,
+ to_close);
+ rev = event_new(base, pair1[1], EV_READ, record_event_cb,
+ &got_read_on_close);
+ TT_BLATHER(("Waiting for read on %d", (int)pair1[1]));
+ wev = event_new(base, pair2[1], EV_WRITE, record_event_cb,
+ &got_write_on_close);
+ TT_BLATHER(("Waiting for write on %d", (int)pair2[1]));
+ tv.tv_sec = 0;
+ tv.tv_usec = 100*1000; /* Close pair1[0] after a little while, and make
+ * sure we get a read event. */
+ event_add(closeev, &tv);
+ event_add(rev, NULL);
+ event_add(wev, NULL);
+ /* Don't let the test go on too long. */
+ tv.tv_sec = 0;
+ tv.tv_usec = 200*1000;
+ event_base_loopexit(base, &tv);
+ event_base_loop(base, 0);
+
+ tt_int_op(got_read_on_close, ==, EV_READ);
+ tt_int_op(got_write_on_close, ==, EV_WRITE);
+ tt_int_op(premature_event, ==, 0);
+
+end:
+ if (pair1[0] >= 0)
+ evutil_closesocket(pair1[0]);
+ if (pair1[1] >= 0)
+ evutil_closesocket(pair1[1]);
+ if (pair2[0] >= 0)
+ evutil_closesocket(pair2[0]);
+ if (pair2[1] >= 0)
+ evutil_closesocket(pair2[1]);
+ if (rev)
+ event_free(rev);
+ if (wev)
+ event_free(wev);
+ if (closeev)
+ event_free(closeev);
+ if (base)
+ event_base_free(base);
+}
+
+
+static void
+test_multiple(void)
+{
+ struct event ev, ev2;
+ int i;
+
+ /* Multiple read and write test */
+ setup_test("Multiple read/write: ");
+ memset(rbuf, 0, sizeof(rbuf));
+ for (i = 0; i < (int)sizeof(wbuf); i++)
+ wbuf[i] = i;
+
+ roff = woff = 0;
+ usepersist = 0;
+
+ event_set(&ev, pair[0], EV_WRITE, multiple_write_cb, &ev);
+ if (event_add(&ev, NULL) == -1)
+ exit(1);
+ event_set(&ev2, pair[1], EV_READ, multiple_read_cb, &ev2);
+ if (event_add(&ev2, NULL) == -1)
+ exit(1);
+ event_dispatch();
+
+ if (roff == woff)
+ test_ok = memcmp(rbuf, wbuf, sizeof(wbuf)) == 0;
+
+ cleanup_test();
+}
+
+static void
+test_persistent(void)
+{
+ struct event ev, ev2;
+ int i;
+
+ /* Multiple read and write test with persist */
+ setup_test("Persist read/write: ");
+ memset(rbuf, 0, sizeof(rbuf));
+ for (i = 0; i < (int)sizeof(wbuf); i++)
+ wbuf[i] = i;
+
+ roff = woff = 0;
+ usepersist = 1;
+
+ event_set(&ev, pair[0], EV_WRITE|EV_PERSIST, multiple_write_cb, &ev);
+ if (event_add(&ev, NULL) == -1)
+ exit(1);
+ event_set(&ev2, pair[1], EV_READ|EV_PERSIST, multiple_read_cb, &ev2);
+ if (event_add(&ev2, NULL) == -1)
+ exit(1);
+ event_dispatch();
+
+ if (roff == woff)
+ test_ok = memcmp(rbuf, wbuf, sizeof(wbuf)) == 0;
+
+ cleanup_test();
+}
+
+static void
+test_combined(void)
+{
+ struct both r1, r2, w1, w2;
+
+ setup_test("Combined read/write: ");
+ memset(&r1, 0, sizeof(r1));
+ memset(&r2, 0, sizeof(r2));
+ memset(&w1, 0, sizeof(w1));
+ memset(&w2, 0, sizeof(w2));
+
+ w1.nread = 4096;
+ w2.nread = 8192;
+
+ event_set(&r1.ev, pair[0], EV_READ, combined_read_cb, &r1);
+ event_set(&w1.ev, pair[0], EV_WRITE, combined_write_cb, &w1);
+ event_set(&r2.ev, pair[1], EV_READ, combined_read_cb, &r2);
+ event_set(&w2.ev, pair[1], EV_WRITE, combined_write_cb, &w2);
+ tt_assert(event_add(&r1.ev, NULL) != -1);
+ tt_assert(!event_add(&w1.ev, NULL));
+ tt_assert(!event_add(&r2.ev, NULL));
+ tt_assert(!event_add(&w2.ev, NULL));
+ event_dispatch();
+
+ if (r1.nread == 8192 && r2.nread == 4096)
+ test_ok = 1;
+
+end:
+ cleanup_test();
+}
+
+static void
+test_simpletimeout(void)
+{
+ struct timeval tv;
+ struct event ev;
+
+ setup_test("Simple timeout: ");
+
+ tv.tv_usec = 200*1000;
+ tv.tv_sec = 0;
+ evutil_timerclear(&tcalled);
+ evtimer_set(&ev, timeout_cb, NULL);
+ evtimer_add(&ev, &tv);
+
+ evutil_gettimeofday(&tset, NULL);
+ event_dispatch();
+ test_timeval_diff_eq(&tset, &tcalled, 200);
+
+ test_ok = 1;
+end:
+ cleanup_test();
+}
+
+static void
+periodic_timeout_cb(evutil_socket_t fd, short event, void *arg)
+{
+ int *count = arg;
+
+ (*count)++;
+ if (*count == 6) {
+ /* call loopexit only once - on slow machines(?), it is
+ * apparently possible for this to get called twice. */
+ test_ok = 1;
+ event_base_loopexit(global_base, NULL);
+ }
+}
+
+static void
+test_persistent_timeout(void)
+{
+ struct timeval tv;
+ struct event ev;
+ int count = 0;
+
+ evutil_timerclear(&tv);
+ tv.tv_usec = 10000;
+
+ event_assign(&ev, global_base, -1, EV_TIMEOUT|EV_PERSIST,
+ periodic_timeout_cb, &count);
+ event_add(&ev, &tv);
+
+ event_dispatch();
+
+ event_del(&ev);
+}
+
+static void
+test_persistent_timeout_jump(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct event ev;
+ int count = 0;
+ struct timeval msec100 = { 0, 100 * 1000 };
+ struct timeval msec50 = { 0, 50 * 1000 };
+ struct timeval msec300 = { 0, 300 * 1000 };
+
+ event_assign(&ev, data->base, -1, EV_PERSIST, periodic_timeout_cb, &count);
+ event_add(&ev, &msec100);
+ /* Wait for a bit */
+ evutil_usleep_(&msec300);
+ event_base_loopexit(data->base, &msec50);
+ event_base_dispatch(data->base);
+ tt_int_op(count, ==, 1);
+
+end:
+ event_del(&ev);
+}
+
+struct persist_active_timeout_called {
+ int n;
+ short events[16];
+ struct timeval tvs[16];
+};
+
+static void
+activate_cb(evutil_socket_t fd, short event, void *arg)
+{
+ struct event *ev = arg;
+ event_active(ev, EV_READ, 1);
+}
+
+static void
+persist_active_timeout_cb(evutil_socket_t fd, short event, void *arg)
+{
+ struct persist_active_timeout_called *c = arg;
+ if (c->n < 15) {
+ c->events[c->n] = event;
+ evutil_gettimeofday(&c->tvs[c->n], NULL);
+ ++c->n;
+ }
+}
+
+static void
+test_persistent_active_timeout(void *ptr)
+{
+ struct timeval tv, tv2, tv_exit, start;
+ struct event ev;
+ struct persist_active_timeout_called res;
+
+ struct basic_test_data *data = ptr;
+ struct event_base *base = data->base;
+
+ memset(&res, 0, sizeof(res));
+
+ tv.tv_sec = 0;
+ tv.tv_usec = 200 * 1000;
+ event_assign(&ev, base, -1, EV_TIMEOUT|EV_PERSIST,
+ persist_active_timeout_cb, &res);
+ event_add(&ev, &tv);
+
+ tv2.tv_sec = 0;
+ tv2.tv_usec = 100 * 1000;
+ event_base_once(base, -1, EV_TIMEOUT, activate_cb, &ev, &tv2);
+
+ tv_exit.tv_sec = 0;
+ tv_exit.tv_usec = 600 * 1000;
+ event_base_loopexit(base, &tv_exit);
+
+ event_base_assert_ok_(base);
+ evutil_gettimeofday(&start, NULL);
+
+ event_base_dispatch(base);
+ event_base_assert_ok_(base);
+
+ tt_int_op(res.n, ==, 3);
+ tt_int_op(res.events[0], ==, EV_READ);
+ tt_int_op(res.events[1], ==, EV_TIMEOUT);
+ tt_int_op(res.events[2], ==, EV_TIMEOUT);
+ test_timeval_diff_eq(&start, &res.tvs[0], 100);
+ test_timeval_diff_eq(&start, &res.tvs[1], 300);
+ test_timeval_diff_eq(&start, &res.tvs[2], 500);
+end:
+ event_del(&ev);
+}
+
+struct common_timeout_info {
+ struct event ev;
+ struct timeval called_at;
+ int which;
+ int count;
+};
+
+static void
+common_timeout_cb(evutil_socket_t fd, short event, void *arg)
+{
+ struct common_timeout_info *ti = arg;
+ ++ti->count;
+ evutil_gettimeofday(&ti->called_at, NULL);
+ if (ti->count >= 4)
+ event_del(&ti->ev);
+}
+
+static void
+test_common_timeout(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+
+ struct event_base *base = data->base;
+ int i;
+ struct common_timeout_info info[100];
+
+ struct timeval start;
+ struct timeval tmp_100_ms = { 0, 100*1000 };
+ struct timeval tmp_200_ms = { 0, 200*1000 };
+ struct timeval tmp_5_sec = { 5, 0 };
+ struct timeval tmp_5M_usec = { 0, 5*1000*1000 };
+
+ const struct timeval *ms_100, *ms_200, *sec_5;
+
+ ms_100 = event_base_init_common_timeout(base, &tmp_100_ms);
+ ms_200 = event_base_init_common_timeout(base, &tmp_200_ms);
+ sec_5 = event_base_init_common_timeout(base, &tmp_5_sec);
+ tt_assert(ms_100);
+ tt_assert(ms_200);
+ tt_assert(sec_5);
+ tt_ptr_op(event_base_init_common_timeout(base, &tmp_200_ms),
+ ==, ms_200);
+ tt_ptr_op(event_base_init_common_timeout(base, ms_200), ==, ms_200);
+ tt_ptr_op(event_base_init_common_timeout(base, &tmp_5M_usec), ==, sec_5);
+ tt_int_op(ms_100->tv_sec, ==, 0);
+ tt_int_op(ms_200->tv_sec, ==, 0);
+ tt_int_op(sec_5->tv_sec, ==, 5);
+ tt_int_op(ms_100->tv_usec, ==, 100000|0x50000000);
+ tt_int_op(ms_200->tv_usec, ==, 200000|0x50100000);
+ tt_int_op(sec_5->tv_usec, ==, 0|0x50200000);
+
+ memset(info, 0, sizeof(info));
+
+ for (i=0; i<100; ++i) {
+ info[i].which = i;
+ event_assign(&info[i].ev, base, -1, EV_TIMEOUT|EV_PERSIST,
+ common_timeout_cb, &info[i]);
+ if (i % 2) {
+ if ((i%20)==1) {
+ /* Glass-box test: Make sure we survive the
+ * transition to non-common timeouts. It's
+ * a little tricky. */
+ event_add(&info[i].ev, ms_200);
+ event_add(&info[i].ev, &tmp_100_ms);
+ } else if ((i%20)==3) {
+ /* Check heap-to-common too. */
+ event_add(&info[i].ev, &tmp_200_ms);
+ event_add(&info[i].ev, ms_100);
+ } else if ((i%20)==5) {
+ /* Also check common-to-common. */
+ event_add(&info[i].ev, ms_200);
+ event_add(&info[i].ev, ms_100);
+ } else {
+ event_add(&info[i].ev, ms_100);
+ }
+ } else {
+ event_add(&info[i].ev, ms_200);
+ }
+ }
+
+ event_base_assert_ok_(base);
+ evutil_gettimeofday(&start, NULL);
+ event_base_dispatch(base);
+
+ event_base_assert_ok_(base);
+
+ for (i=0; i<10; ++i) {
+ tt_int_op(info[i].count, ==, 4);
+ if (i % 2) {
+ test_timeval_diff_eq(&start, &info[i].called_at, 400);
+ } else {
+ test_timeval_diff_eq(&start, &info[i].called_at, 800);
+ }
+ }
+
+ /* Make sure we can free the base with some events in. */
+ for (i=0; i<100; ++i) {
+ if (i % 2) {
+ event_add(&info[i].ev, ms_100);
+ } else {
+ event_add(&info[i].ev, ms_200);
+ }
+ }
+
+end:
+ event_base_free(data->base); /* need to do this here before info is
+ * out-of-scope */
+ data->base = NULL;
+}
+
+#ifndef _WIN32
+
+#define current_base event_global_current_base_
+extern struct event_base *current_base;
+
+static void
+fork_signal_cb(evutil_socket_t fd, short events, void *arg)
+{
+ event_del(arg);
+}
+
+
+static void
+test_fork(void)
+{
+ int status;
+ struct event ev, sig_ev, usr_ev, existing_ev;
+ pid_t pid;
+
+ setup_test("After fork: ");
+
+ tt_assert(current_base);
+ evthread_make_base_notifiable(current_base);
+
+ if (write(pair[0], TEST1, strlen(TEST1)+1) < 0) {
+ tt_fail_perror("write");
+ }
+
+ event_set(&ev, pair[1], EV_READ, simple_read_cb, &ev);
+ if (event_add(&ev, NULL) == -1)
+ exit(1);
+
+ evsignal_set(&sig_ev, SIGCHLD, fork_signal_cb, &sig_ev);
+ evsignal_add(&sig_ev, NULL);
+
+ evsignal_set(&existing_ev, SIGUSR2, fork_signal_cb, &existing_ev);
+ evsignal_add(&existing_ev, NULL);
+
+ event_base_assert_ok_(current_base);
+ TT_BLATHER(("Before fork"));
+ if ((pid = regress_fork()) == 0) {
+ /* in the child */
+ TT_BLATHER(("In child, before reinit"));
+ event_base_assert_ok_(current_base);
+ if (event_reinit(current_base) == -1) {
+ fprintf(stdout, "FAILED (reinit)\n");
+ exit(1);
+ }
+ TT_BLATHER(("After reinit"));
+ event_base_assert_ok_(current_base);
+ TT_BLATHER(("After assert-ok"));
+
+ evsignal_del(&sig_ev);
+
+ evsignal_set(&usr_ev, SIGUSR1, fork_signal_cb, &usr_ev);
+ evsignal_add(&usr_ev, NULL);
+ raise(SIGUSR1);
+ raise(SIGUSR2);
+
+ called = 0;
+
+ event_dispatch();
+
+ event_base_free(current_base);
+
+ /* we do not send an EOF; simple_read_cb requires an EOF
+ * to set test_ok. we just verify that the callback was
+ * called. */
+ exit(test_ok != 0 || called != 2 ? -2 : 76);
+ }
+
+ /* wait for the child to read the data */
+ {
+ const struct timeval tv = { 0, 100000 };
+ evutil_usleep_(&tv);
+ }
+
+ if (write(pair[0], TEST1, strlen(TEST1)+1) < 0) {
+ tt_fail_perror("write");
+ }
+
+ TT_BLATHER(("Before waitpid"));
+ if (waitpid(pid, &status, 0) == -1) {
+ fprintf(stdout, "FAILED (fork)\n");
+ exit(1);
+ }
+ TT_BLATHER(("After waitpid"));
+
+ if (WEXITSTATUS(status) != 76) {
+ fprintf(stdout, "FAILED (exit): %d\n", WEXITSTATUS(status));
+ exit(1);
+ }
+
+ /* test that the current event loop still works */
+ if (write(pair[0], TEST1, strlen(TEST1)+1) < 0) {
+ fprintf(stderr, "%s: write\n", __func__);
+ }
+
+ shutdown(pair[0], SHUT_WR);
+
+ evsignal_set(&usr_ev, SIGUSR1, fork_signal_cb, &usr_ev);
+ evsignal_add(&usr_ev, NULL);
+ raise(SIGUSR1);
+ raise(SIGUSR2);
+
+ event_dispatch();
+
+ evsignal_del(&sig_ev);
+
+ end:
+ cleanup_test();
+}
+
+#ifdef EVENT__HAVE_PTHREADS
+static void* del_wait_thread(void *arg)
+{
+ struct timeval tv_start, tv_end;
+
+ evutil_gettimeofday(&tv_start, NULL);
+ event_dispatch();
+ evutil_gettimeofday(&tv_end, NULL);
+
+ test_timeval_diff_eq(&tv_start, &tv_end, 300);
+
+ end:
+ return NULL;
+}
+
+static void
+del_wait_cb(evutil_socket_t fd, short event, void *arg)
+{
+ struct timeval delay = { 0, 300*1000 };
+ TT_BLATHER(("Sleeping"));
+ evutil_usleep_(&delay);
+ test_ok = 1;
+}
+
+static void
+test_del_wait(void)
+{
+ struct event ev;
+ pthread_t thread;
+
+ setup_test("event_del will wait: ");
+
+ event_set(&ev, pair[1], EV_READ, del_wait_cb, &ev);
+ event_add(&ev, NULL);
+
+ pthread_create(&thread, NULL, del_wait_thread, NULL);
+
+ if (write(pair[0], TEST1, strlen(TEST1)+1) < 0) {
+ tt_fail_perror("write");
+ }
+
+ {
+ struct timeval delay = { 0, 30*1000 };
+ evutil_usleep_(&delay);
+ }
+
+ {
+ struct timeval tv_start, tv_end;
+ evutil_gettimeofday(&tv_start, NULL);
+ event_del(&ev);
+ evutil_gettimeofday(&tv_end, NULL);
+ test_timeval_diff_eq(&tv_start, &tv_end, 270);
+ }
+
+ pthread_join(thread, NULL);
+
+ end:
+ ;
+}
+#endif
+
+static void
+signal_cb_sa(int sig)
+{
+ test_ok = 2;
+}
+
+static void
+signal_cb(evutil_socket_t fd, short event, void *arg)
+{
+ struct event *ev = arg;
+
+ evsignal_del(ev);
+ test_ok = 1;
+}
+
+static void
+test_simplesignal_impl(int find_reorder)
+{
+ struct event ev;
+ struct itimerval itv;
+
+ evsignal_set(&ev, SIGALRM, signal_cb, &ev);
+ evsignal_add(&ev, NULL);
+ /* find bugs in which operations are re-ordered */
+ if (find_reorder) {
+ evsignal_del(&ev);
+ evsignal_add(&ev, NULL);
+ }
+
+ memset(&itv, 0, sizeof(itv));
+ itv.it_value.tv_sec = 0;
+ itv.it_value.tv_usec = 100000;
+ if (setitimer(ITIMER_REAL, &itv, NULL) == -1)
+ goto skip_simplesignal;
+
+ event_dispatch();
+ skip_simplesignal:
+ if (evsignal_del(&ev) == -1)
+ test_ok = 0;
+
+ cleanup_test();
+}
+
+static void
+test_simplestsignal(void)
+{
+ setup_test("Simplest one signal: ");
+ test_simplesignal_impl(0);
+}
+
+static void
+test_simplesignal(void)
+{
+ setup_test("Simple signal: ");
+ test_simplesignal_impl(1);
+}
+
+static void
+test_multiplesignal(void)
+{
+ struct event ev_one, ev_two;
+ struct itimerval itv;
+
+ setup_test("Multiple signal: ");
+
+ evsignal_set(&ev_one, SIGALRM, signal_cb, &ev_one);
+ evsignal_add(&ev_one, NULL);
+
+ evsignal_set(&ev_two, SIGALRM, signal_cb, &ev_two);
+ evsignal_add(&ev_two, NULL);
+
+ memset(&itv, 0, sizeof(itv));
+ itv.it_value.tv_sec = 0;
+ itv.it_value.tv_usec = 100000;
+ if (setitimer(ITIMER_REAL, &itv, NULL) == -1)
+ goto skip_simplesignal;
+
+ event_dispatch();
+
+ skip_simplesignal:
+ if (evsignal_del(&ev_one) == -1)
+ test_ok = 0;
+ if (evsignal_del(&ev_two) == -1)
+ test_ok = 0;
+
+ cleanup_test();
+}
+
+static void
+test_immediatesignal(void)
+{
+ struct event ev;
+
+ test_ok = 0;
+ evsignal_set(&ev, SIGUSR1, signal_cb, &ev);
+ evsignal_add(&ev, NULL);
+ raise(SIGUSR1);
+ event_loop(EVLOOP_NONBLOCK);
+ evsignal_del(&ev);
+ cleanup_test();
+}
+
+static void
+test_signal_dealloc(void)
+{
+ /* make sure that evsignal_event is event_del'ed and pipe closed */
+ struct event ev;
+ struct event_base *base = event_init();
+ evsignal_set(&ev, SIGUSR1, signal_cb, &ev);
+ evsignal_add(&ev, NULL);
+ evsignal_del(&ev);
+ event_base_free(base);
+ /* If we got here without asserting, we're fine. */
+ test_ok = 1;
+ cleanup_test();
+}
+
+static void
+test_signal_pipeloss(void)
+{
+ /* make sure that the base1 pipe is closed correctly. */
+ struct event_base *base1, *base2;
+ int pipe1;
+ test_ok = 0;
+ base1 = event_init();
+ pipe1 = base1->sig.ev_signal_pair[0];
+ base2 = event_init();
+ event_base_free(base2);
+ event_base_free(base1);
+ if (close(pipe1) != -1 || errno!=EBADF) {
+ /* fd must be closed, so second close gives -1, EBADF */
+ printf("signal pipe not closed. ");
+ test_ok = 0;
+ } else {
+ test_ok = 1;
+ }
+ cleanup_test();
+}
+
+/*
+ * make two bases to catch signals, use both of them. this only works
+ * for event mechanisms that use our signal pipe trick. kqueue handles
+ * signals internally, and all interested kqueues get all the signals.
+ */
+static void
+test_signal_switchbase(void)
+{
+ struct event ev1, ev2;
+ struct event_base *base1, *base2;
+ int is_kqueue;
+ test_ok = 0;
+ base1 = event_init();
+ base2 = event_init();
+ is_kqueue = !strcmp(event_get_method(),"kqueue");
+ evsignal_set(&ev1, SIGUSR1, signal_cb, &ev1);
+ evsignal_set(&ev2, SIGUSR1, signal_cb, &ev2);
+ if (event_base_set(base1, &ev1) ||
+ event_base_set(base2, &ev2) ||
+ event_add(&ev1, NULL) ||
+ event_add(&ev2, NULL)) {
+ fprintf(stderr, "%s: cannot set base, add\n", __func__);
+ exit(1);
+ }
+
+ tt_ptr_op(event_get_base(&ev1), ==, base1);
+ tt_ptr_op(event_get_base(&ev2), ==, base2);
+
+ test_ok = 0;
+ /* can handle signal before loop is called */
+ raise(SIGUSR1);
+ event_base_loop(base2, EVLOOP_NONBLOCK);
+ if (is_kqueue) {
+ if (!test_ok)
+ goto end;
+ test_ok = 0;
+ }
+ event_base_loop(base1, EVLOOP_NONBLOCK);
+ if (test_ok && !is_kqueue) {
+ test_ok = 0;
+
+ /* set base1 to handle signals */
+ event_base_loop(base1, EVLOOP_NONBLOCK);
+ raise(SIGUSR1);
+ event_base_loop(base1, EVLOOP_NONBLOCK);
+ event_base_loop(base2, EVLOOP_NONBLOCK);
+ }
+end:
+ event_base_free(base1);
+ event_base_free(base2);
+ cleanup_test();
+}
+
+/*
+ * assert that a signal event removed from the event queue really is
+ * removed - with no possibility of it's parent handler being fired.
+ */
+static void
+test_signal_assert(void)
+{
+ struct event ev;
+ struct event_base *base = event_init();
+ test_ok = 0;
+ /* use SIGCONT so we don't kill ourselves when we signal to nowhere */
+ evsignal_set(&ev, SIGCONT, signal_cb, &ev);
+ evsignal_add(&ev, NULL);
+ /*
+ * if evsignal_del() fails to reset the handler, it's current handler
+ * will still point to evsig_handler().
+ */
+ evsignal_del(&ev);
+
+ raise(SIGCONT);
+#if 0
+ /* only way to verify we were in evsig_handler() */
+ /* XXXX Now there's no longer a good way. */
+ if (base->sig.evsig_caught)
+ test_ok = 0;
+ else
+ test_ok = 1;
+#else
+ test_ok = 1;
+#endif
+
+ event_base_free(base);
+ cleanup_test();
+ return;
+}
+
+/*
+ * assert that we restore our previous signal handler properly.
+ */
+static void
+test_signal_restore(void)
+{
+ struct event ev;
+ struct event_base *base = event_init();
+#ifdef EVENT__HAVE_SIGACTION
+ struct sigaction sa;
+#endif
+
+ test_ok = 0;
+#ifdef EVENT__HAVE_SIGACTION
+ sa.sa_handler = signal_cb_sa;
+ sa.sa_flags = 0x0;
+ sigemptyset(&sa.sa_mask);
+ if (sigaction(SIGUSR1, &sa, NULL) == -1)
+ goto out;
+#else
+ if (signal(SIGUSR1, signal_cb_sa) == SIG_ERR)
+ goto out;
+#endif
+ evsignal_set(&ev, SIGUSR1, signal_cb, &ev);
+ evsignal_add(&ev, NULL);
+ evsignal_del(&ev);
+
+ raise(SIGUSR1);
+ /* 1 == signal_cb, 2 == signal_cb_sa, we want our previous handler */
+ if (test_ok != 2)
+ test_ok = 0;
+out:
+ event_base_free(base);
+ cleanup_test();
+ return;
+}
+
+static void
+signal_cb_swp(int sig, short event, void *arg)
+{
+ called++;
+ if (called < 5)
+ raise(sig);
+ else
+ event_loopexit(NULL);
+}
+static void
+timeout_cb_swp(evutil_socket_t fd, short event, void *arg)
+{
+ if (called == -1) {
+ struct timeval tv = {5, 0};
+
+ called = 0;
+ evtimer_add((struct event *)arg, &tv);
+ raise(SIGUSR1);
+ return;
+ }
+ test_ok = 0;
+ event_loopexit(NULL);
+}
+
+static void
+test_signal_while_processing(void)
+{
+ struct event_base *base = event_init();
+ struct event ev, ev_timer;
+ struct timeval tv = {0, 0};
+
+ setup_test("Receiving a signal while processing other signal: ");
+
+ called = -1;
+ test_ok = 1;
+ signal_set(&ev, SIGUSR1, signal_cb_swp, NULL);
+ signal_add(&ev, NULL);
+ evtimer_set(&ev_timer, timeout_cb_swp, &ev_timer);
+ evtimer_add(&ev_timer, &tv);
+ event_dispatch();
+
+ event_base_free(base);
+ cleanup_test();
+ return;
+}
+#endif
+
+static void
+test_free_active_base(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct event_base *base1;
+ struct event ev1;
+
+ base1 = event_init();
+ if (base1) {
+ event_assign(&ev1, base1, data->pair[1], EV_READ,
+ dummy_read_cb, NULL);
+ event_add(&ev1, NULL);
+ event_base_free(base1); /* should not crash */
+ } else {
+ tt_fail_msg("failed to create event_base for test");
+ }
+
+ base1 = event_init();
+ tt_assert(base1);
+ event_assign(&ev1, base1, 0, 0, dummy_read_cb, NULL);
+ event_active(&ev1, EV_READ, 1);
+ event_base_free(base1);
+end:
+ ;
+}
+
+static void
+test_manipulate_active_events(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct event_base *base = data->base;
+ struct event ev1;
+
+ event_assign(&ev1, base, -1, EV_TIMEOUT, dummy_read_cb, NULL);
+
+ /* Make sure an active event is pending. */
+ event_active(&ev1, EV_READ, 1);
+ tt_int_op(event_pending(&ev1, EV_READ|EV_TIMEOUT|EV_WRITE, NULL),
+ ==, EV_READ);
+
+ /* Make sure that activating an event twice works. */
+ event_active(&ev1, EV_WRITE, 1);
+ tt_int_op(event_pending(&ev1, EV_READ|EV_TIMEOUT|EV_WRITE, NULL),
+ ==, EV_READ|EV_WRITE);
+
+end:
+ event_del(&ev1);
+}
+
+static void
+event_selfarg_cb(evutil_socket_t fd, short event, void *arg)
+{
+ struct event *ev = arg;
+ struct event_base *base = event_get_base(ev);
+ event_base_assert_ok_(base);
+ event_base_loopexit(base, NULL);
+ tt_want(ev == event_base_get_running_event(base));
+}
+
+static void
+test_event_new_selfarg(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct event_base *base = data->base;
+ struct event *ev = event_new(base, -1, EV_READ, event_selfarg_cb,
+ event_self_cbarg());
+
+ event_active(ev, EV_READ, 1);
+ event_base_dispatch(base);
+
+ event_free(ev);
+}
+
+static void
+test_event_assign_selfarg(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct event_base *base = data->base;
+ struct event ev;
+
+ event_assign(&ev, base, -1, EV_READ, event_selfarg_cb,
+ event_self_cbarg());
+ event_active(&ev, EV_READ, 1);
+ event_base_dispatch(base);
+}
+
+static void
+test_event_base_get_num_events(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct event_base *base = data->base;
+ struct event ev;
+ int event_count_active;
+ int event_count_virtual;
+ int event_count_added;
+ int event_count_active_virtual;
+ int event_count_active_added;
+ int event_count_virtual_added;
+ int event_count_active_added_virtual;
+
+ struct timeval qsec = {0, 100000};
+
+ event_assign(&ev, base, -1, EV_READ, event_selfarg_cb,
+ event_self_cbarg());
+
+ event_add(&ev, &qsec);
+ event_count_active = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE);
+ event_count_virtual = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_VIRTUAL);
+ event_count_added = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ADDED);
+ event_count_active_virtual = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE|EVENT_BASE_COUNT_VIRTUAL);
+ event_count_active_added = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE|EVENT_BASE_COUNT_ADDED);
+ event_count_virtual_added = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_VIRTUAL|EVENT_BASE_COUNT_ADDED);
+ event_count_active_added_virtual = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE|
+ EVENT_BASE_COUNT_ADDED|
+ EVENT_BASE_COUNT_VIRTUAL);
+ tt_int_op(event_count_active, ==, 0);
+ tt_int_op(event_count_virtual, ==, 0);
+ /* libevent itself adds a timeout event, so the event_count is 2 here */
+ tt_int_op(event_count_added, ==, 2);
+ tt_int_op(event_count_active_virtual, ==, 0);
+ tt_int_op(event_count_active_added, ==, 2);
+ tt_int_op(event_count_virtual_added, ==, 2);
+ tt_int_op(event_count_active_added_virtual, ==, 2);
+
+ event_active(&ev, EV_READ, 1);
+ event_count_active = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE);
+ event_count_virtual = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_VIRTUAL);
+ event_count_added = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ADDED);
+ event_count_active_virtual = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE|EVENT_BASE_COUNT_VIRTUAL);
+ event_count_active_added = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE|EVENT_BASE_COUNT_ADDED);
+ event_count_virtual_added = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_VIRTUAL|EVENT_BASE_COUNT_ADDED);
+ event_count_active_added_virtual = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE|
+ EVENT_BASE_COUNT_ADDED|
+ EVENT_BASE_COUNT_VIRTUAL);
+ tt_int_op(event_count_active, ==, 1);
+ tt_int_op(event_count_virtual, ==, 0);
+ tt_int_op(event_count_added, ==, 3);
+ tt_int_op(event_count_active_virtual, ==, 1);
+ tt_int_op(event_count_active_added, ==, 4);
+ tt_int_op(event_count_virtual_added, ==, 3);
+ tt_int_op(event_count_active_added_virtual, ==, 4);
+
+ event_base_loop(base, 0);
+ event_count_active = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE);
+ event_count_virtual = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_VIRTUAL);
+ event_count_added = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ADDED);
+ event_count_active_virtual = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE|EVENT_BASE_COUNT_VIRTUAL);
+ event_count_active_added = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE|EVENT_BASE_COUNT_ADDED);
+ event_count_virtual_added = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_VIRTUAL|EVENT_BASE_COUNT_ADDED);
+ event_count_active_added_virtual = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE|
+ EVENT_BASE_COUNT_ADDED|
+ EVENT_BASE_COUNT_VIRTUAL);
+ tt_int_op(event_count_active, ==, 0);
+ tt_int_op(event_count_virtual, ==, 0);
+ tt_int_op(event_count_added, ==, 0);
+ tt_int_op(event_count_active_virtual, ==, 0);
+ tt_int_op(event_count_active_added, ==, 0);
+ tt_int_op(event_count_virtual_added, ==, 0);
+ tt_int_op(event_count_active_added_virtual, ==, 0);
+
+ event_base_add_virtual_(base);
+ event_count_active = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE);
+ event_count_virtual = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_VIRTUAL);
+ event_count_added = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ADDED);
+ event_count_active_virtual = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE|EVENT_BASE_COUNT_VIRTUAL);
+ event_count_active_added = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE|EVENT_BASE_COUNT_ADDED);
+ event_count_virtual_added = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_VIRTUAL|EVENT_BASE_COUNT_ADDED);
+ event_count_active_added_virtual = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE|
+ EVENT_BASE_COUNT_ADDED|
+ EVENT_BASE_COUNT_VIRTUAL);
+ tt_int_op(event_count_active, ==, 0);
+ tt_int_op(event_count_virtual, ==, 1);
+ tt_int_op(event_count_added, ==, 0);
+ tt_int_op(event_count_active_virtual, ==, 1);
+ tt_int_op(event_count_active_added, ==, 0);
+ tt_int_op(event_count_virtual_added, ==, 1);
+ tt_int_op(event_count_active_added_virtual, ==, 1);
+
+end:
+ ;
+}
+
+static void
+test_event_base_get_max_events(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct event_base *base = data->base;
+ struct event ev;
+ struct event ev2;
+ int event_count_active;
+ int event_count_virtual;
+ int event_count_added;
+ int event_count_active_virtual;
+ int event_count_active_added;
+ int event_count_virtual_added;
+ int event_count_active_added_virtual;
+
+ struct timeval qsec = {0, 100000};
+
+ event_assign(&ev, base, -1, EV_READ, event_selfarg_cb,
+ event_self_cbarg());
+ event_assign(&ev2, base, -1, EV_READ, event_selfarg_cb,
+ event_self_cbarg());
+
+ event_add(&ev, &qsec);
+ event_add(&ev2, &qsec);
+ event_del(&ev2);
+
+ event_count_active = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE, 0);
+ event_count_virtual = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_VIRTUAL, 0);
+ event_count_added = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ADDED, 0);
+ event_count_active_virtual = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE | EVENT_BASE_COUNT_VIRTUAL, 0);
+ event_count_active_added = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE | EVENT_BASE_COUNT_ADDED, 0);
+ event_count_virtual_added = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_VIRTUAL | EVENT_BASE_COUNT_ADDED, 0);
+ event_count_active_added_virtual = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE |
+ EVENT_BASE_COUNT_ADDED |
+ EVENT_BASE_COUNT_VIRTUAL, 0);
+
+ tt_int_op(event_count_active, ==, 0);
+ tt_int_op(event_count_virtual, ==, 0);
+ /* libevent itself adds a timeout event, so the event_count is 4 here */
+ tt_int_op(event_count_added, ==, 4);
+ tt_int_op(event_count_active_virtual, ==, 0);
+ tt_int_op(event_count_active_added, ==, 4);
+ tt_int_op(event_count_virtual_added, ==, 4);
+ tt_int_op(event_count_active_added_virtual, ==, 4);
+
+ event_active(&ev, EV_READ, 1);
+ event_count_active = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE, 0);
+ event_count_virtual = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_VIRTUAL, 0);
+ event_count_added = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ADDED, 0);
+ event_count_active_virtual = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE | EVENT_BASE_COUNT_VIRTUAL, 0);
+ event_count_active_added = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE | EVENT_BASE_COUNT_ADDED, 0);
+ event_count_virtual_added = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_VIRTUAL | EVENT_BASE_COUNT_ADDED, 0);
+ event_count_active_added_virtual = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE |
+ EVENT_BASE_COUNT_ADDED |
+ EVENT_BASE_COUNT_VIRTUAL, 0);
+
+ tt_int_op(event_count_active, ==, 1);
+ tt_int_op(event_count_virtual, ==, 0);
+ tt_int_op(event_count_added, ==, 4);
+ tt_int_op(event_count_active_virtual, ==, 1);
+ tt_int_op(event_count_active_added, ==, 5);
+ tt_int_op(event_count_virtual_added, ==, 4);
+ tt_int_op(event_count_active_added_virtual, ==, 5);
+
+ event_base_loop(base, 0);
+ event_count_active = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE, 1);
+ event_count_virtual = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_VIRTUAL, 1);
+ event_count_added = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ADDED, 1);
+ event_count_active_virtual = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE | EVENT_BASE_COUNT_VIRTUAL, 0);
+ event_count_active_added = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE | EVENT_BASE_COUNT_ADDED, 0);
+ event_count_virtual_added = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_VIRTUAL | EVENT_BASE_COUNT_ADDED, 0);
+ event_count_active_added_virtual = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE |
+ EVENT_BASE_COUNT_ADDED |
+ EVENT_BASE_COUNT_VIRTUAL, 1);
+
+ tt_int_op(event_count_active, ==, 1);
+ tt_int_op(event_count_virtual, ==, 0);
+ tt_int_op(event_count_added, ==, 4);
+ tt_int_op(event_count_active_virtual, ==, 0);
+ tt_int_op(event_count_active_added, ==, 0);
+ tt_int_op(event_count_virtual_added, ==, 0);
+ tt_int_op(event_count_active_added_virtual, ==, 0);
+
+ event_count_active = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE, 0);
+ event_count_virtual = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_VIRTUAL, 0);
+ event_count_added = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ADDED, 0);
+ tt_int_op(event_count_active, ==, 0);
+ tt_int_op(event_count_virtual, ==, 0);
+ tt_int_op(event_count_added, ==, 0);
+
+ event_base_add_virtual_(base);
+ event_count_active = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE, 0);
+ event_count_virtual = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_VIRTUAL, 0);
+ event_count_added = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ADDED, 0);
+ event_count_active_virtual = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE | EVENT_BASE_COUNT_VIRTUAL, 0);
+ event_count_active_added = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE | EVENT_BASE_COUNT_ADDED, 0);
+ event_count_virtual_added = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_VIRTUAL | EVENT_BASE_COUNT_ADDED, 0);
+ event_count_active_added_virtual = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE |
+ EVENT_BASE_COUNT_ADDED |
+ EVENT_BASE_COUNT_VIRTUAL, 0);
+
+ tt_int_op(event_count_active, ==, 0);
+ tt_int_op(event_count_virtual, ==, 1);
+ tt_int_op(event_count_added, ==, 0);
+ tt_int_op(event_count_active_virtual, ==, 1);
+ tt_int_op(event_count_active_added, ==, 0);
+ tt_int_op(event_count_virtual_added, ==, 1);
+ tt_int_op(event_count_active_added_virtual, ==, 1);
+
+end:
+ ;
+}
+
+static void
+test_bad_assign(void *ptr)
+{
+ struct event ev;
+ int r;
+ /* READ|SIGNAL is not allowed */
+ r = event_assign(&ev, NULL, -1, EV_SIGNAL|EV_READ, dummy_read_cb, NULL);
+ tt_int_op(r,==,-1);
+
+end:
+ ;
+}
+
+static int reentrant_cb_run = 0;
+
+static void
+bad_reentrant_run_loop_cb(evutil_socket_t fd, short what, void *ptr)
+{
+ struct event_base *base = ptr;
+ int r;
+ reentrant_cb_run = 1;
+ /* This reentrant call to event_base_loop should be detected and
+ * should fail */
+ r = event_base_loop(base, 0);
+ tt_int_op(r, ==, -1);
+end:
+ ;
+}
+
+static void
+test_bad_reentrant(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct event_base *base = data->base;
+ struct event ev;
+ int r;
+ event_assign(&ev, base, -1,
+ 0, bad_reentrant_run_loop_cb, base);
+
+ event_active(&ev, EV_WRITE, 1);
+ r = event_base_loop(base, 0);
+ tt_int_op(r, ==, 1);
+ tt_int_op(reentrant_cb_run, ==, 1);
+end:
+ ;
+}
+
+static int n_write_a_byte_cb=0;
+static int n_read_and_drain_cb=0;
+static int n_activate_other_event_cb=0;
+static void
+write_a_byte_cb(evutil_socket_t fd, short what, void *arg)
+{
+ char buf[] = "x";
+ if (write(fd, buf, 1) == 1)
+ ++n_write_a_byte_cb;
+}
+static void
+read_and_drain_cb(evutil_socket_t fd, short what, void *arg)
+{
+ char buf[128];
+ int n;
+ ++n_read_and_drain_cb;
+ while ((n = read(fd, buf, sizeof(buf))) > 0)
+ ;
+}
+
+static void
+activate_other_event_cb(evutil_socket_t fd, short what, void *other_)
+{
+ struct event *ev_activate = other_;
+ ++n_activate_other_event_cb;
+ event_active_later_(ev_activate, EV_READ);
+}
+
+static void
+test_active_later(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct event *ev1 = NULL, *ev2 = NULL;
+ struct event ev3, ev4;
+ struct timeval qsec = {0, 100000};
+ ev1 = event_new(data->base, data->pair[0], EV_READ|EV_PERSIST, read_and_drain_cb, NULL);
+ ev2 = event_new(data->base, data->pair[1], EV_WRITE|EV_PERSIST, write_a_byte_cb, NULL);
+ event_assign(&ev3, data->base, -1, 0, activate_other_event_cb, &ev4);
+ event_assign(&ev4, data->base, -1, 0, activate_other_event_cb, &ev3);
+ event_add(ev1, NULL);
+ event_add(ev2, NULL);
+ event_active_later_(&ev3, EV_READ);
+
+ event_base_loopexit(data->base, &qsec);
+
+ event_base_loop(data->base, 0);
+
+ TT_BLATHER(("%d write calls, %d read calls, %d activate-other calls.",
+ n_write_a_byte_cb, n_read_and_drain_cb, n_activate_other_event_cb));
+ event_del(&ev3);
+ event_del(&ev4);
+
+ tt_int_op(n_write_a_byte_cb, ==, n_activate_other_event_cb);
+ tt_int_op(n_write_a_byte_cb, >, 100);
+ tt_int_op(n_read_and_drain_cb, >, 100);
+ tt_int_op(n_activate_other_event_cb, >, 100);
+
+ event_active_later_(&ev4, EV_READ);
+ event_active(&ev4, EV_READ, 1); /* This should make the event
+ active immediately. */
+ tt_assert((ev4.ev_flags & EVLIST_ACTIVE) != 0);
+ tt_assert((ev4.ev_flags & EVLIST_ACTIVE_LATER) == 0);
+
+ /* Now leave this one around, so that event_free sees it and removes
+ * it. */
+ event_active_later_(&ev3, EV_READ);
+ event_base_assert_ok_(data->base);
+
+end:
+ if (ev1)
+ event_free(ev1);
+ if (ev2)
+ event_free(ev2);
+
+ event_base_free(data->base);
+ data->base = NULL;
+}
+
+
+static void incr_arg_cb(evutil_socket_t fd, short what, void *arg)
+{
+ int *intptr = arg;
+ (void) fd; (void) what;
+ ++*intptr;
+}
+static void remove_timers_cb(evutil_socket_t fd, short what, void *arg)
+{
+ struct event **ep = arg;
+ (void) fd; (void) what;
+ event_remove_timer(ep[0]);
+ event_remove_timer(ep[1]);
+}
+static void send_a_byte_cb(evutil_socket_t fd, short what, void *arg)
+{
+ evutil_socket_t *sockp = arg;
+ (void) fd; (void) what;
+ (void) write(*sockp, "A", 1);
+}
+struct read_not_timeout_param
+{
+ struct event **ev;
+ int events;
+ int count;
+};
+static void read_not_timeout_cb(evutil_socket_t fd, short what, void *arg)
+{
+ struct read_not_timeout_param *rntp = arg;
+ char c;
+ ev_ssize_t n;
+ (void) fd; (void) what;
+ n = read(fd, &c, 1);
+ tt_int_op(n, ==, 1);
+ rntp->events |= what;
+ ++rntp->count;
+ if(2 == rntp->count) event_del(rntp->ev[0]);
+end:
+ ;
+}
+
+static void
+test_event_remove_timeout(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct event_base *base = data->base;
+ struct event *ev[5];
+ int ev1_fired=0;
+ struct timeval ms25 = { 0, 25*1000 },
+ ms40 = { 0, 40*1000 },
+ ms75 = { 0, 75*1000 },
+ ms125 = { 0, 125*1000 };
+ struct read_not_timeout_param rntp = { ev, 0, 0 };
+
+ event_base_assert_ok_(base);
+
+ ev[0] = event_new(base, data->pair[0], EV_READ|EV_PERSIST,
+ read_not_timeout_cb, &rntp);
+ ev[1] = evtimer_new(base, incr_arg_cb, &ev1_fired);
+ ev[2] = evtimer_new(base, remove_timers_cb, ev);
+ ev[3] = evtimer_new(base, send_a_byte_cb, &data->pair[1]);
+ ev[4] = evtimer_new(base, send_a_byte_cb, &data->pair[1]);
+ tt_assert(base);
+ event_add(ev[2], &ms25); /* remove timers */
+ event_add(ev[4], &ms40); /* write to test if timer re-activates */
+ event_add(ev[0], &ms75); /* read */
+ event_add(ev[1], &ms75); /* timer */
+ event_add(ev[3], &ms125); /* timeout. */
+ event_base_assert_ok_(base);
+
+ event_base_dispatch(base);
+
+ tt_int_op(ev1_fired, ==, 0);
+ tt_int_op(rntp.events, ==, EV_READ);
+
+ event_base_assert_ok_(base);
+end:
+ event_free(ev[0]);
+ event_free(ev[1]);
+ event_free(ev[2]);
+ event_free(ev[3]);
+ event_free(ev[4]);
+}
+
+static void
+test_event_base_new(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct event_base *base = 0;
+ struct event ev1;
+ struct basic_cb_args args;
+
+ int towrite = (int)strlen(TEST1)+1;
+ int len = write(data->pair[0], TEST1, towrite);
+
+ if (len < 0)
+ tt_abort_perror("initial write");
+ else if (len != towrite)
+ tt_abort_printf(("initial write fell short (%d of %d bytes)",
+ len, towrite));
+
+ if (shutdown(data->pair[0], SHUT_WR))
+ tt_abort_perror("initial write shutdown");
+
+ base = event_base_new();
+ if (!base)
+ tt_abort_msg("failed to create event base");
+
+ args.eb = base;
+ args.ev = &ev1;
+ args.callcount = 0;
+ event_assign(&ev1, base, data->pair[1],
+ EV_READ|EV_PERSIST, basic_read_cb, &args);
+
+ if (event_add(&ev1, NULL))
+ tt_abort_perror("initial event_add");
+
+ if (event_base_loop(base, 0))
+ tt_abort_msg("unsuccessful exit from event loop");
+
+end:
+ if (base)
+ event_base_free(base);
+}
+
+static void
+test_loopexit(void)
+{
+ struct timeval tv, tv_start, tv_end;
+ struct event ev;
+
+ setup_test("Loop exit: ");
+
+ tv.tv_usec = 0;
+ tv.tv_sec = 60*60*24;
+ evtimer_set(&ev, timeout_cb, NULL);
+ evtimer_add(&ev, &tv);
+
+ tv.tv_usec = 300*1000;
+ tv.tv_sec = 0;
+ event_loopexit(&tv);
+
+ evutil_gettimeofday(&tv_start, NULL);
+ event_dispatch();
+ evutil_gettimeofday(&tv_end, NULL);
+
+ evtimer_del(&ev);
+
+ tt_assert(event_base_got_exit(global_base));
+ tt_assert(!event_base_got_break(global_base));
+
+ test_timeval_diff_eq(&tv_start, &tv_end, 300);
+
+ test_ok = 1;
+end:
+ cleanup_test();
+}
+
+static void
+test_loopexit_multiple(void)
+{
+ struct timeval tv, tv_start, tv_end;
+ struct event_base *base;
+
+ setup_test("Loop Multiple exit: ");
+
+ base = event_base_new();
+
+ tv.tv_usec = 200*1000;
+ tv.tv_sec = 0;
+ event_base_loopexit(base, &tv);
+
+ tv.tv_usec = 0;
+ tv.tv_sec = 3;
+ event_base_loopexit(base, &tv);
+
+ evutil_gettimeofday(&tv_start, NULL);
+ event_base_dispatch(base);
+ evutil_gettimeofday(&tv_end, NULL);
+
+ tt_assert(event_base_got_exit(base));
+ tt_assert(!event_base_got_break(base));
+
+ event_base_free(base);
+
+ test_timeval_diff_eq(&tv_start, &tv_end, 200);
+
+ test_ok = 1;
+
+end:
+ cleanup_test();
+}
+
+static void
+break_cb(evutil_socket_t fd, short events, void *arg)
+{
+ test_ok = 1;
+ event_loopbreak();
+}
+
+static void
+fail_cb(evutil_socket_t fd, short events, void *arg)
+{
+ test_ok = 0;
+}
+
+static void
+test_loopbreak(void)
+{
+ struct event ev1, ev2;
+ struct timeval tv;
+
+ setup_test("Loop break: ");
+
+ tv.tv_sec = 0;
+ tv.tv_usec = 0;
+ evtimer_set(&ev1, break_cb, NULL);
+ evtimer_add(&ev1, &tv);
+ evtimer_set(&ev2, fail_cb, NULL);
+ evtimer_add(&ev2, &tv);
+
+ event_dispatch();
+
+ tt_assert(!event_base_got_exit(global_base));
+ tt_assert(event_base_got_break(global_base));
+
+ evtimer_del(&ev1);
+ evtimer_del(&ev2);
+
+end:
+ cleanup_test();
+}
+
+static struct event *readd_test_event_last_added = NULL;
+static void
+re_add_read_cb(evutil_socket_t fd, short event, void *arg)
+{
+ char buf[256];
+ struct event *ev_other = arg;
+ ev_ssize_t n_read;
+
+ readd_test_event_last_added = ev_other;
+
+ n_read = read(fd, buf, sizeof(buf));
+
+ if (n_read < 0) {
+ tt_fail_perror("read");
+ event_base_loopbreak(event_get_base(ev_other));
+ return;
+ } else {
+ event_add(ev_other, NULL);
+ ++test_ok;
+ }
+}
+
+static void
+test_nonpersist_readd(void)
+{
+ struct event ev1, ev2;
+
+ setup_test("Re-add nonpersistent events: ");
+ event_set(&ev1, pair[0], EV_READ, re_add_read_cb, &ev2);
+ event_set(&ev2, pair[1], EV_READ, re_add_read_cb, &ev1);
+
+ if (write(pair[0], "Hello", 5) < 0) {
+ tt_fail_perror("write(pair[0])");
+ }
+
+ if (write(pair[1], "Hello", 5) < 0) {
+ tt_fail_perror("write(pair[1])\n");
+ }
+
+ if (event_add(&ev1, NULL) == -1 ||
+ event_add(&ev2, NULL) == -1) {
+ test_ok = 0;
+ }
+ if (test_ok != 0)
+ exit(1);
+ event_loop(EVLOOP_ONCE);
+ if (test_ok != 2)
+ exit(1);
+ /* At this point, we executed both callbacks. Whichever one got
+ * called first added the second, but the second then immediately got
+ * deleted before its callback was called. At this point, though, it
+ * re-added the first.
+ */
+ if (!readd_test_event_last_added) {
+ test_ok = 0;
+ } else if (readd_test_event_last_added == &ev1) {
+ if (!event_pending(&ev1, EV_READ, NULL) ||
+ event_pending(&ev2, EV_READ, NULL))
+ test_ok = 0;
+ } else {
+ if (event_pending(&ev1, EV_READ, NULL) ||
+ !event_pending(&ev2, EV_READ, NULL))
+ test_ok = 0;
+ }
+
+ event_del(&ev1);
+ event_del(&ev2);
+
+ cleanup_test();
+}
+
+struct test_pri_event {
+ struct event ev;
+ int count;
+};
+
+static void
+test_priorities_cb(evutil_socket_t fd, short what, void *arg)
+{
+ struct test_pri_event *pri = arg;
+ struct timeval tv;
+
+ if (pri->count == 3) {
+ event_loopexit(NULL);
+ return;
+ }
+
+ pri->count++;
+
+ evutil_timerclear(&tv);
+ event_add(&pri->ev, &tv);
+}
+
+static void
+test_priorities_impl(int npriorities)
+{
+ struct test_pri_event one, two;
+ struct timeval tv;
+
+ TT_BLATHER(("Testing Priorities %d: ", npriorities));
+
+ event_base_priority_init(global_base, npriorities);
+
+ memset(&one, 0, sizeof(one));
+ memset(&two, 0, sizeof(two));
+
+ timeout_set(&one.ev, test_priorities_cb, &one);
+ if (event_priority_set(&one.ev, 0) == -1) {
+ fprintf(stderr, "%s: failed to set priority", __func__);
+ exit(1);
+ }
+
+ timeout_set(&two.ev, test_priorities_cb, &two);
+ if (event_priority_set(&two.ev, npriorities - 1) == -1) {
+ fprintf(stderr, "%s: failed to set priority", __func__);
+ exit(1);
+ }
+
+ evutil_timerclear(&tv);
+
+ if (event_add(&one.ev, &tv) == -1)
+ exit(1);
+ if (event_add(&two.ev, &tv) == -1)
+ exit(1);
+
+ event_dispatch();
+
+ event_del(&one.ev);
+ event_del(&two.ev);
+
+ if (npriorities == 1) {
+ if (one.count == 3 && two.count == 3)
+ test_ok = 1;
+ } else if (npriorities == 2) {
+ /* Two is called once because event_loopexit is priority 1 */
+ if (one.count == 3 && two.count == 1)
+ test_ok = 1;
+ } else {
+ if (one.count == 3 && two.count == 0)
+ test_ok = 1;
+ }
+}
+
+static void
+test_priorities(void)
+{
+ test_priorities_impl(1);
+ if (test_ok)
+ test_priorities_impl(2);
+ if (test_ok)
+ test_priorities_impl(3);
+}
+
+/* priority-active-inversion: activate a higher-priority event, and make sure
+ * it keeps us from running a lower-priority event first. */
+static int n_pai_calls = 0;
+static struct event pai_events[3];
+
+static void
+prio_active_inversion_cb(evutil_socket_t fd, short what, void *arg)
+{
+ int *call_order = arg;
+ *call_order = n_pai_calls++;
+ if (n_pai_calls == 1) {
+ /* This should activate later, even though it shares a
+ priority with us. */
+ event_active(&pai_events[1], EV_READ, 1);
+ /* This should activate next, since its priority is higher,
+ even though we activated it second. */
+ event_active(&pai_events[2], EV_TIMEOUT, 1);
+ }
+}
+
+static void
+test_priority_active_inversion(void *data_)
+{
+ struct basic_test_data *data = data_;
+ struct event_base *base = data->base;
+ int call_order[3];
+ int i;
+ tt_int_op(event_base_priority_init(base, 8), ==, 0);
+
+ n_pai_calls = 0;
+ memset(call_order, 0, sizeof(call_order));
+
+ for (i=0;i<3;++i) {
+ event_assign(&pai_events[i], data->base, -1, 0,
+ prio_active_inversion_cb, &call_order[i]);
+ }
+
+ event_priority_set(&pai_events[0], 4);
+ event_priority_set(&pai_events[1], 4);
+ event_priority_set(&pai_events[2], 0);
+
+ event_active(&pai_events[0], EV_WRITE, 1);
+
+ event_base_dispatch(base);
+ tt_int_op(n_pai_calls, ==, 3);
+ tt_int_op(call_order[0], ==, 0);
+ tt_int_op(call_order[1], ==, 2);
+ tt_int_op(call_order[2], ==, 1);
+end:
+ ;
+}
+
+
+static void
+test_multiple_cb(evutil_socket_t fd, short event, void *arg)
+{
+ if (event & EV_READ)
+ test_ok |= 1;
+ else if (event & EV_WRITE)
+ test_ok |= 2;
+}
+
+static void
+test_multiple_events_for_same_fd(void)
+{
+ struct event e1, e2;
+
+ setup_test("Multiple events for same fd: ");
+
+ event_set(&e1, pair[0], EV_READ, test_multiple_cb, NULL);
+ event_add(&e1, NULL);
+ event_set(&e2, pair[0], EV_WRITE, test_multiple_cb, NULL);
+ event_add(&e2, NULL);
+ event_loop(EVLOOP_ONCE);
+ event_del(&e2);
+
+ if (write(pair[1], TEST1, strlen(TEST1)+1) < 0) {
+ tt_fail_perror("write");
+ }
+
+ event_loop(EVLOOP_ONCE);
+ event_del(&e1);
+
+ if (test_ok != 3)
+ test_ok = 0;
+
+ cleanup_test();
+}
+
+int evtag_decode_int(ev_uint32_t *pnumber, struct evbuffer *evbuf);
+int evtag_decode_int64(ev_uint64_t *pnumber, struct evbuffer *evbuf);
+int evtag_encode_tag(struct evbuffer *evbuf, ev_uint32_t number);
+int evtag_decode_tag(ev_uint32_t *pnumber, struct evbuffer *evbuf);
+
+static void
+read_once_cb(evutil_socket_t fd, short event, void *arg)
+{
+ char buf[256];
+ int len;
+
+ len = read(fd, buf, sizeof(buf));
+
+ if (called) {
+ test_ok = 0;
+ } else if (len) {
+ /* Assumes global pair[0] can be used for writing */
+ if (write(pair[0], TEST1, strlen(TEST1)+1) < 0) {
+ tt_fail_perror("write");
+ test_ok = 0;
+ } else {
+ test_ok = 1;
+ }
+ }
+
+ called++;
+}
+
+static void
+test_want_only_once(void)
+{
+ struct event ev;
+ struct timeval tv;
+
+ /* Very simple read test */
+ setup_test("Want read only once: ");
+
+ if (write(pair[0], TEST1, strlen(TEST1)+1) < 0) {
+ tt_fail_perror("write");
+ }
+
+ /* Setup the loop termination */
+ evutil_timerclear(&tv);
+ tv.tv_usec = 300*1000;
+ event_loopexit(&tv);
+
+ event_set(&ev, pair[1], EV_READ, read_once_cb, &ev);
+ if (event_add(&ev, NULL) == -1)
+ exit(1);
+ event_dispatch();
+
+ cleanup_test();
+}
+
+#define TEST_MAX_INT 6
+
+static void
+evtag_int_test(void *ptr)
+{
+ struct evbuffer *tmp = evbuffer_new();
+ ev_uint32_t integers[TEST_MAX_INT] = {
+ 0xaf0, 0x1000, 0x1, 0xdeadbeef, 0x00, 0xbef000
+ };
+ ev_uint32_t integer;
+ ev_uint64_t big_int;
+ int i;
+
+ evtag_init();
+
+ for (i = 0; i < TEST_MAX_INT; i++) {
+ int oldlen, newlen;
+ oldlen = (int)EVBUFFER_LENGTH(tmp);
+ evtag_encode_int(tmp, integers[i]);
+ newlen = (int)EVBUFFER_LENGTH(tmp);
+ TT_BLATHER(("encoded 0x%08x with %d bytes",
+ (unsigned)integers[i], newlen - oldlen));
+ big_int = integers[i];
+ big_int *= 1000000000; /* 1 billion */
+ evtag_encode_int64(tmp, big_int);
+ }
+
+ for (i = 0; i < TEST_MAX_INT; i++) {
+ tt_int_op(evtag_decode_int(&integer, tmp), !=, -1);
+ tt_uint_op(integer, ==, integers[i]);
+ tt_int_op(evtag_decode_int64(&big_int, tmp), !=, -1);
+ tt_assert((big_int / 1000000000) == integers[i]);
+ }
+
+ tt_uint_op(EVBUFFER_LENGTH(tmp), ==, 0);
+end:
+ evbuffer_free(tmp);
+}
+
+static void
+evtag_fuzz(void *ptr)
+{
+ unsigned char buffer[4096];
+ struct evbuffer *tmp = evbuffer_new();
+ struct timeval tv;
+ int i, j;
+
+ int not_failed = 0;
+
+ evtag_init();
+
+ for (j = 0; j < 100; j++) {
+ for (i = 0; i < (int)sizeof(buffer); i++)
+ buffer[i] = test_weakrand();
+ evbuffer_drain(tmp, -1);
+ evbuffer_add(tmp, buffer, sizeof(buffer));
+
+ if (evtag_unmarshal_timeval(tmp, 0, &tv) != -1)
+ not_failed++;
+ }
+
+ /* The majority of decodes should fail */
+ tt_int_op(not_failed, <, 10);
+
+ /* Now insert some corruption into the tag length field */
+ evbuffer_drain(tmp, -1);
+ evutil_timerclear(&tv);
+ tv.tv_sec = 1;
+ evtag_marshal_timeval(tmp, 0, &tv);
+ evbuffer_add(tmp, buffer, sizeof(buffer));
+
+ ((char *)EVBUFFER_DATA(tmp))[1] = '\xff';
+ if (evtag_unmarshal_timeval(tmp, 0, &tv) != -1) {
+ tt_abort_msg("evtag_unmarshal_timeval should have failed");
+ }
+
+end:
+ evbuffer_free(tmp);
+}
+
+static void
+evtag_tag_encoding(void *ptr)
+{
+ struct evbuffer *tmp = evbuffer_new();
+ ev_uint32_t integers[TEST_MAX_INT] = {
+ 0xaf0, 0x1000, 0x1, 0xdeadbeef, 0x00, 0xbef000
+ };
+ ev_uint32_t integer;
+ int i;
+
+ evtag_init();
+
+ for (i = 0; i < TEST_MAX_INT; i++) {
+ int oldlen, newlen;
+ oldlen = (int)EVBUFFER_LENGTH(tmp);
+ evtag_encode_tag(tmp, integers[i]);
+ newlen = (int)EVBUFFER_LENGTH(tmp);
+ TT_BLATHER(("encoded 0x%08x with %d bytes",
+ (unsigned)integers[i], newlen - oldlen));
+ }
+
+ for (i = 0; i < TEST_MAX_INT; i++) {
+ tt_int_op(evtag_decode_tag(&integer, tmp), !=, -1);
+ tt_uint_op(integer, ==, integers[i]);
+ }
+
+ tt_uint_op(EVBUFFER_LENGTH(tmp), ==, 0);
+
+end:
+ evbuffer_free(tmp);
+}
+
+static void
+evtag_test_peek(void *ptr)
+{
+ struct evbuffer *tmp = evbuffer_new();
+ ev_uint32_t u32;
+
+ evtag_marshal_int(tmp, 30, 0);
+ evtag_marshal_string(tmp, 40, "Hello world");
+
+ tt_int_op(evtag_peek(tmp, &u32), ==, 1);
+ tt_int_op(u32, ==, 30);
+ tt_int_op(evtag_peek_length(tmp, &u32), ==, 0);
+ tt_int_op(u32, ==, 1+1+1);
+ tt_int_op(evtag_consume(tmp), ==, 0);
+
+ tt_int_op(evtag_peek(tmp, &u32), ==, 1);
+ tt_int_op(u32, ==, 40);
+ tt_int_op(evtag_peek_length(tmp, &u32), ==, 0);
+ tt_int_op(u32, ==, 1+1+11);
+ tt_int_op(evtag_payload_length(tmp, &u32), ==, 0);
+ tt_int_op(u32, ==, 11);
+
+end:
+ evbuffer_free(tmp);
+}
+
+
+static void
+test_methods(void *ptr)
+{
+ const char **methods = event_get_supported_methods();
+ struct event_config *cfg = NULL;
+ struct event_base *base = NULL;
+ const char *backend;
+ int n_methods = 0;
+
+ tt_assert(methods);
+
+ backend = methods[0];
+ while (*methods != NULL) {
+ TT_BLATHER(("Support method: %s", *methods));
+ ++methods;
+ ++n_methods;
+ }
+
+ cfg = event_config_new();
+ assert(cfg != NULL);
+
+ tt_int_op(event_config_avoid_method(cfg, backend), ==, 0);
+ event_config_set_flag(cfg, EVENT_BASE_FLAG_IGNORE_ENV);
+
+ base = event_base_new_with_config(cfg);
+ if (n_methods > 1) {
+ tt_assert(base);
+ tt_str_op(backend, !=, event_base_get_method(base));
+ } else {
+ tt_assert(base == NULL);
+ }
+
+end:
+ if (base)
+ event_base_free(base);
+ if (cfg)
+ event_config_free(cfg);
+}
+
+static void
+test_version(void *arg)
+{
+ const char *vstr;
+ ev_uint32_t vint;
+ int major, minor, patch, n;
+
+ vstr = event_get_version();
+ vint = event_get_version_number();
+
+ tt_assert(vstr);
+ tt_assert(vint);
+
+ tt_str_op(vstr, ==, LIBEVENT_VERSION);
+ tt_int_op(vint, ==, LIBEVENT_VERSION_NUMBER);
+
+ n = sscanf(vstr, "%d.%d.%d", &major, &minor, &patch);
+ tt_assert(3 == n);
+ tt_int_op((vint&0xffffff00), ==, ((major<<24)|(minor<<16)|(patch<<8)));
+end:
+ ;
+}
+
+static void
+test_base_features(void *arg)
+{
+ struct event_base *base = NULL;
+ struct event_config *cfg = NULL;
+
+ cfg = event_config_new();
+
+ tt_assert(0 == event_config_require_features(cfg, EV_FEATURE_ET));
+
+ base = event_base_new_with_config(cfg);
+ if (base) {
+ tt_int_op(EV_FEATURE_ET, ==,
+ event_base_get_features(base) & EV_FEATURE_ET);
+ } else {
+ base = event_base_new();
+ tt_int_op(0, ==, event_base_get_features(base) & EV_FEATURE_ET);
+ }
+
+end:
+ if (base)
+ event_base_free(base);
+ if (cfg)
+ event_config_free(cfg);
+}
+
+#ifdef EVENT__HAVE_SETENV
+#define SETENV_OK
+#elif !defined(EVENT__HAVE_SETENV) && defined(EVENT__HAVE_PUTENV)
+static void setenv(const char *k, const char *v, int o_)
+{
+ char b[256];
+ evutil_snprintf(b, sizeof(b), "%s=%s",k,v);
+ putenv(b);
+}
+#define SETENV_OK
+#endif
+
+#ifdef EVENT__HAVE_UNSETENV
+#define UNSETENV_OK
+#elif !defined(EVENT__HAVE_UNSETENV) && defined(EVENT__HAVE_PUTENV)
+static void unsetenv(const char *k)
+{
+ char b[256];
+ evutil_snprintf(b, sizeof(b), "%s=",k);
+ putenv(b);
+}
+#define UNSETENV_OK
+#endif
+
+#if defined(SETENV_OK) && defined(UNSETENV_OK)
+static void
+methodname_to_envvar(const char *mname, char *buf, size_t buflen)
+{
+ char *cp;
+ evutil_snprintf(buf, buflen, "EVENT_NO%s", mname);
+ for (cp = buf; *cp; ++cp) {
+ *cp = EVUTIL_TOUPPER_(*cp);
+ }
+}
+#endif
+
+static void
+test_base_environ(void *arg)
+{
+ struct event_base *base = NULL;
+ struct event_config *cfg = NULL;
+
+#if defined(SETENV_OK) && defined(UNSETENV_OK)
+ const char **basenames;
+ int i, n_methods=0;
+ char varbuf[128];
+ const char *defaultname, *ignoreenvname;
+
+ /* See if unsetenv works before we rely on it. */
+ setenv("EVENT_NOWAFFLES", "1", 1);
+ unsetenv("EVENT_NOWAFFLES");
+ if (getenv("EVENT_NOWAFFLES") != NULL) {
+#ifndef EVENT__HAVE_UNSETENV
+ TT_DECLARE("NOTE", ("Can't fake unsetenv; skipping test"));
+#else
+ TT_DECLARE("NOTE", ("unsetenv doesn't work; skipping test"));
+#endif
+ tt_skip();
+ }
+
+ basenames = event_get_supported_methods();
+ for (i = 0; basenames[i]; ++i) {
+ methodname_to_envvar(basenames[i], varbuf, sizeof(varbuf));
+ unsetenv(varbuf);
+ ++n_methods;
+ }
+
+ base = event_base_new();
+ tt_assert(base);
+
+ defaultname = event_base_get_method(base);
+ TT_BLATHER(("default is <%s>", defaultname));
+ event_base_free(base);
+ base = NULL;
+
+ /* Can we disable the method with EVENT_NOfoo ? */
+ if (!strcmp(defaultname, "epoll (with changelist)")) {
+ setenv("EVENT_NOEPOLL", "1", 1);
+ ignoreenvname = "epoll";
+ } else {
+ methodname_to_envvar(defaultname, varbuf, sizeof(varbuf));
+ setenv(varbuf, "1", 1);
+ ignoreenvname = defaultname;
+ }
+
+ /* Use an empty cfg rather than NULL so a failure doesn't exit() */
+ cfg = event_config_new();
+ base = event_base_new_with_config(cfg);
+ event_config_free(cfg);
+ cfg = NULL;
+ if (n_methods == 1) {
+ tt_assert(!base);
+ } else {
+ tt_assert(base);
+ tt_str_op(defaultname, !=, event_base_get_method(base));
+ event_base_free(base);
+ base = NULL;
+ }
+
+ /* Can we disable looking at the environment with IGNORE_ENV ? */
+ cfg = event_config_new();
+ event_config_set_flag(cfg, EVENT_BASE_FLAG_IGNORE_ENV);
+ base = event_base_new_with_config(cfg);
+ tt_assert(base);
+ tt_str_op(ignoreenvname, ==, event_base_get_method(base));
+#else
+ tt_skip();
+#endif
+
+end:
+ if (base)
+ event_base_free(base);
+ if (cfg)
+ event_config_free(cfg);
+}
+
+static void
+read_called_once_cb(evutil_socket_t fd, short event, void *arg)
+{
+ tt_int_op(event, ==, EV_READ);
+ called += 1;
+end:
+ ;
+}
+
+static void
+timeout_called_once_cb(evutil_socket_t fd, short event, void *arg)
+{
+ tt_int_op(event, ==, EV_TIMEOUT);
+ called += 100;
+end:
+ ;
+}
+
+static void
+immediate_called_twice_cb(evutil_socket_t fd, short event, void *arg)
+{
+ tt_int_op(event, ==, EV_TIMEOUT);
+ called += 1000;
+end:
+ ;
+}
+
+static void
+test_event_once(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct timeval tv;
+ int r;
+
+ tv.tv_sec = 0;
+ tv.tv_usec = 50*1000;
+ called = 0;
+ r = event_base_once(data->base, data->pair[0], EV_READ,
+ read_called_once_cb, NULL, NULL);
+ tt_int_op(r, ==, 0);
+ r = event_base_once(data->base, -1, EV_TIMEOUT,
+ timeout_called_once_cb, NULL, &tv);
+ tt_int_op(r, ==, 0);
+ r = event_base_once(data->base, -1, 0, NULL, NULL, NULL);
+ tt_int_op(r, <, 0);
+ r = event_base_once(data->base, -1, EV_TIMEOUT,
+ immediate_called_twice_cb, NULL, NULL);
+ tt_int_op(r, ==, 0);
+ tv.tv_sec = 0;
+ tv.tv_usec = 0;
+ r = event_base_once(data->base, -1, EV_TIMEOUT,
+ immediate_called_twice_cb, NULL, &tv);
+ tt_int_op(r, ==, 0);
+
+ if (write(data->pair[1], TEST1, strlen(TEST1)+1) < 0) {
+ tt_fail_perror("write");
+ }
+
+ shutdown(data->pair[1], SHUT_WR);
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(called, ==, 2101);
+end:
+ ;
+}
+
+static void
+test_event_once_never(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct timeval tv;
+
+ /* Have one trigger in 10 seconds (don't worry, because) */
+ tv.tv_sec = 10;
+ tv.tv_usec = 0;
+ called = 0;
+ event_base_once(data->base, -1, EV_TIMEOUT,
+ timeout_called_once_cb, NULL, &tv);
+
+ /* But shut down the base in 75 msec. */
+ tv.tv_sec = 0;
+ tv.tv_usec = 75*1000;
+ event_base_loopexit(data->base, &tv);
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(called, ==, 0);
+end:
+ ;
+}
+
+static void
+test_event_pending(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct event *r=NULL, *w=NULL, *t=NULL;
+ struct timeval tv, now, tv2;
+
+ tv.tv_sec = 0;
+ tv.tv_usec = 500 * 1000;
+ r = event_new(data->base, data->pair[0], EV_READ, simple_read_cb,
+ NULL);
+ w = event_new(data->base, data->pair[1], EV_WRITE, simple_write_cb,
+ NULL);
+ t = evtimer_new(data->base, timeout_cb, NULL);
+
+ tt_assert(r);
+ tt_assert(w);
+ tt_assert(t);
+
+ evutil_gettimeofday(&now, NULL);
+ event_add(r, NULL);
+ event_add(t, &tv);
+
+ tt_assert( event_pending(r, EV_READ, NULL));
+ tt_assert(!event_pending(w, EV_WRITE, NULL));
+ tt_assert(!event_pending(r, EV_WRITE, NULL));
+ tt_assert( event_pending(r, EV_READ|EV_WRITE, NULL));
+ tt_assert(!event_pending(r, EV_TIMEOUT, NULL));
+ tt_assert( event_pending(t, EV_TIMEOUT, NULL));
+ tt_assert( event_pending(t, EV_TIMEOUT, &tv2));
+
+ tt_assert(evutil_timercmp(&tv2, &now, >));
+
+ test_timeval_diff_eq(&now, &tv2, 500);
+
+end:
+ if (r) {
+ event_del(r);
+ event_free(r);
+ }
+ if (w) {
+ event_del(w);
+ event_free(w);
+ }
+ if (t) {
+ event_del(t);
+ event_free(t);
+ }
+}
+
+#ifndef _WIN32
+/* You can't do this test on windows, since dup2 doesn't work on sockets */
+
+static void
+dfd_cb(evutil_socket_t fd, short e, void *data)
+{
+ *(int*)data = (int)e;
+}
+
+/* Regression test for our workaround for a fun epoll/linux related bug
+ * where fd2 = dup(fd1); add(fd2); close(fd2); dup2(fd1,fd2); add(fd2)
+ * will get you an EEXIST */
+static void
+test_dup_fd(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+ struct event *ev1=NULL, *ev2=NULL;
+ int fd, dfd=-1;
+ int ev1_got, ev2_got;
+
+ tt_int_op(write(data->pair[0], "Hello world",
+ strlen("Hello world")), >, 0);
+ fd = data->pair[1];
+
+ dfd = dup(fd);
+ tt_int_op(dfd, >=, 0);
+
+ ev1 = event_new(base, fd, EV_READ|EV_PERSIST, dfd_cb, &ev1_got);
+ ev2 = event_new(base, dfd, EV_READ|EV_PERSIST, dfd_cb, &ev2_got);
+ ev1_got = ev2_got = 0;
+ event_add(ev1, NULL);
+ event_add(ev2, NULL);
+ event_base_loop(base, EVLOOP_ONCE);
+ tt_int_op(ev1_got, ==, EV_READ);
+ tt_int_op(ev2_got, ==, EV_READ);
+
+ /* Now close and delete dfd then dispatch. We need to do the
+ * dispatch here so that when we add it later, we think there
+ * was an intermediate delete. */
+ close(dfd);
+ event_del(ev2);
+ ev1_got = ev2_got = 0;
+ event_base_loop(base, EVLOOP_ONCE);
+ tt_want_int_op(ev1_got, ==, EV_READ);
+ tt_int_op(ev2_got, ==, 0);
+
+ /* Re-duplicate the fd. We need to get the same duplicated
+ * value that we closed to provoke the epoll quirk. Also, we
+ * need to change the events to write, or else the old lingering
+ * read event will make the test pass whether the change was
+ * successful or not. */
+ tt_int_op(dup2(fd, dfd), ==, dfd);
+ event_free(ev2);
+ ev2 = event_new(base, dfd, EV_WRITE|EV_PERSIST, dfd_cb, &ev2_got);
+ event_add(ev2, NULL);
+ ev1_got = ev2_got = 0;
+ event_base_loop(base, EVLOOP_ONCE);
+ tt_want_int_op(ev1_got, ==, EV_READ);
+ tt_int_op(ev2_got, ==, EV_WRITE);
+
+end:
+ if (ev1)
+ event_free(ev1);
+ if (ev2)
+ event_free(ev2);
+ if (dfd >= 0)
+ close(dfd);
+}
+#endif
+
+#ifdef EVENT__DISABLE_MM_REPLACEMENT
+static void
+test_mm_functions(void *arg)
+{
+ tinytest_set_test_skipped_();
+}
+#else
+static int
+check_dummy_mem_ok(void *mem_)
+{
+ char *mem = mem_;
+ mem -= 16;
+ return !memcmp(mem, "{[<guardedram>]}", 16);
+}
+
+static void *
+dummy_malloc(size_t len)
+{
+ char *mem = malloc(len+16);
+ memcpy(mem, "{[<guardedram>]}", 16);
+ return mem+16;
+}
+
+static void *
+dummy_realloc(void *mem_, size_t len)
+{
+ char *mem = mem_;
+ if (!mem)
+ return dummy_malloc(len);
+ tt_want(check_dummy_mem_ok(mem_));
+ mem -= 16;
+ mem = realloc(mem, len+16);
+ return mem+16;
+}
+
+static void
+dummy_free(void *mem_)
+{
+ char *mem = mem_;
+ tt_want(check_dummy_mem_ok(mem_));
+ mem -= 16;
+ free(mem);
+}
+
+static void
+test_mm_functions(void *arg)
+{
+ struct event_base *b = NULL;
+ struct event_config *cfg = NULL;
+ event_set_mem_functions(dummy_malloc, dummy_realloc, dummy_free);
+ cfg = event_config_new();
+ event_config_avoid_method(cfg, "Nonesuch");
+ b = event_base_new_with_config(cfg);
+ tt_assert(b);
+ tt_assert(check_dummy_mem_ok(b));
+end:
+ if (cfg)
+ event_config_free(cfg);
+ if (b)
+ event_base_free(b);
+}
+#endif
+
+static void
+many_event_cb(evutil_socket_t fd, short event, void *arg)
+{
+ int *calledp = arg;
+ *calledp += 1;
+}
+
+static void
+test_many_events(void *arg)
+{
+ /* Try 70 events that should all be ready at once. This will
+ * exercise the "resize" code on most of the backends, and will make
+ * sure that we can get past the 64-handle limit of some windows
+ * functions. */
+#define MANY 70
+
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+ int one_at_a_time = data->setup_data != NULL;
+ evutil_socket_t sock[MANY];
+ struct event *ev[MANY];
+ int called[MANY];
+ int i;
+ int loopflags = EVLOOP_NONBLOCK, evflags=0;
+ if (one_at_a_time) {
+ loopflags |= EVLOOP_ONCE;
+ evflags = EV_PERSIST;
+ }
+
+ memset(sock, 0xff, sizeof(sock));
+ memset(ev, 0, sizeof(ev));
+ memset(called, 0, sizeof(called));
+
+ for (i = 0; i < MANY; ++i) {
+ /* We need an event that will hit the backend, and that will
+ * be ready immediately. "Send a datagram" is an easy
+ * instance of that. */
+ sock[i] = socket(AF_INET, SOCK_DGRAM, 0);
+ tt_assert(sock[i] >= 0);
+ called[i] = 0;
+ ev[i] = event_new(base, sock[i], EV_WRITE|evflags,
+ many_event_cb, &called[i]);
+ event_add(ev[i], NULL);
+ if (one_at_a_time)
+ event_base_loop(base, EVLOOP_NONBLOCK|EVLOOP_ONCE);
+ }
+
+ event_base_loop(base, loopflags);
+
+ for (i = 0; i < MANY; ++i) {
+ if (one_at_a_time)
+ tt_int_op(called[i], ==, MANY - i + 1);
+ else
+ tt_int_op(called[i], ==, 1);
+ }
+
+end:
+ for (i = 0; i < MANY; ++i) {
+ if (ev[i])
+ event_free(ev[i]);
+ if (sock[i] >= 0)
+ evutil_closesocket(sock[i]);
+ }
+#undef MANY
+}
+
+static void
+test_struct_event_size(void *arg)
+{
+ tt_int_op(event_get_struct_event_size(), <=, sizeof(struct event));
+end:
+ ;
+}
+
+static void
+test_get_assignment(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+ struct event *ev1 = NULL;
+ const char *str = "foo";
+
+ struct event_base *b;
+ evutil_socket_t s;
+ short what;
+ event_callback_fn cb;
+ void *cb_arg;
+
+ ev1 = event_new(base, data->pair[1], EV_READ, dummy_read_cb, (void*)str);
+ event_get_assignment(ev1, &b, &s, &what, &cb, &cb_arg);
+
+ tt_ptr_op(b, ==, base);
+ tt_int_op(s, ==, data->pair[1]);
+ tt_int_op(what, ==, EV_READ);
+ tt_ptr_op(cb, ==, dummy_read_cb);
+ tt_ptr_op(cb_arg, ==, str);
+
+ /* Now make sure this doesn't crash. */
+ event_get_assignment(ev1, NULL, NULL, NULL, NULL, NULL);
+
+end:
+ if (ev1)
+ event_free(ev1);
+}
+
+struct foreach_helper {
+ int count;
+ const struct event *ev;
+};
+
+static int
+foreach_count_cb(const struct event_base *base, const struct event *ev, void *arg)
+{
+ struct foreach_helper *h = event_get_callback_arg(ev);
+ struct timeval *tv = arg;
+ if (event_get_callback(ev) != timeout_cb)
+ return 0;
+ tt_ptr_op(event_get_base(ev), ==, base);
+ tt_int_op(tv->tv_sec, ==, 10);
+ h->ev = ev;
+ h->count++;
+ return 0;
+end:
+ return -1;
+}
+
+static int
+foreach_find_cb(const struct event_base *base, const struct event *ev, void *arg)
+{
+ const struct event **ev_out = arg;
+ struct foreach_helper *h = event_get_callback_arg(ev);
+ if (event_get_callback(ev) != timeout_cb)
+ return 0;
+ if (h->count == 99) {
+ *ev_out = ev;
+ return 101;
+ }
+ return 0;
+}
+
+static void
+test_event_foreach(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+ struct event *ev[5];
+ struct foreach_helper visited[5];
+ int i;
+ struct timeval ten_sec = {10,0};
+ const struct event *ev_found = NULL;
+
+ for (i = 0; i < 5; ++i) {
+ visited[i].count = 0;
+ visited[i].ev = NULL;
+ ev[i] = event_new(base, -1, 0, timeout_cb, &visited[i]);
+ }
+
+ tt_int_op(-1, ==, event_base_foreach_event(NULL, foreach_count_cb, NULL));
+ tt_int_op(-1, ==, event_base_foreach_event(base, NULL, NULL));
+
+ event_add(ev[0], &ten_sec);
+ event_add(ev[1], &ten_sec);
+ event_active(ev[1], EV_TIMEOUT, 1);
+ event_active(ev[2], EV_TIMEOUT, 1);
+ event_add(ev[3], &ten_sec);
+ /* Don't touch ev[4]. */
+
+ tt_int_op(0, ==, event_base_foreach_event(base, foreach_count_cb,
+ &ten_sec));
+ tt_int_op(1, ==, visited[0].count);
+ tt_int_op(1, ==, visited[1].count);
+ tt_int_op(1, ==, visited[2].count);
+ tt_int_op(1, ==, visited[3].count);
+ tt_ptr_op(ev[0], ==, visited[0].ev);
+ tt_ptr_op(ev[1], ==, visited[1].ev);
+ tt_ptr_op(ev[2], ==, visited[2].ev);
+ tt_ptr_op(ev[3], ==, visited[3].ev);
+
+ visited[2].count = 99;
+ tt_int_op(101, ==, event_base_foreach_event(base, foreach_find_cb,
+ &ev_found));
+ tt_ptr_op(ev_found, ==, ev[2]);
+
+end:
+ for (i=0; i<5; ++i) {
+ event_free(ev[i]);
+ }
+}
+
+static struct event_base *cached_time_base = NULL;
+static int cached_time_reset = 0;
+static int cached_time_sleep = 0;
+static void
+cache_time_cb(evutil_socket_t fd, short what, void *arg)
+{
+ struct timeval *tv = arg;
+ tt_int_op(0, ==, event_base_gettimeofday_cached(cached_time_base, tv));
+ if (cached_time_sleep) {
+ struct timeval delay = { 0, 30*1000 };
+ evutil_usleep_(&delay);
+ }
+ if (cached_time_reset) {
+ event_base_update_cache_time(cached_time_base);
+ }
+end:
+ ;
+}
+
+static void
+test_gettimeofday_cached(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_config *cfg = NULL;
+ struct event_base *base = NULL;
+ struct timeval tv1, tv2, tv3, now;
+ struct event *ev1=NULL, *ev2=NULL, *ev3=NULL;
+ int cached_time_disable = strstr(data->setup_data, "disable") != NULL;
+
+ cfg = event_config_new();
+ if (cached_time_disable) {
+ event_config_set_flag(cfg, EVENT_BASE_FLAG_NO_CACHE_TIME);
+ }
+ cached_time_base = base = event_base_new_with_config(cfg);
+ tt_assert(base);
+
+ /* Try gettimeofday_cached outside of an event loop. */
+ evutil_gettimeofday(&now, NULL);
+ tt_int_op(0, ==, event_base_gettimeofday_cached(NULL, &tv1));
+ tt_int_op(0, ==, event_base_gettimeofday_cached(base, &tv2));
+ tt_int_op(timeval_msec_diff(&tv1, &tv2), <, 10);
+ tt_int_op(timeval_msec_diff(&tv1, &now), <, 10);
+
+ cached_time_reset = strstr(data->setup_data, "reset") != NULL;
+ cached_time_sleep = strstr(data->setup_data, "sleep") != NULL;
+
+ ev1 = event_new(base, -1, 0, cache_time_cb, &tv1);
+ ev2 = event_new(base, -1, 0, cache_time_cb, &tv2);
+ ev3 = event_new(base, -1, 0, cache_time_cb, &tv3);
+
+ event_active(ev1, EV_TIMEOUT, 1);
+ event_active(ev2, EV_TIMEOUT, 1);
+ event_active(ev3, EV_TIMEOUT, 1);
+
+ event_base_dispatch(base);
+
+ if (cached_time_reset && cached_time_sleep) {
+ tt_int_op(labs(timeval_msec_diff(&tv1,&tv2)), >, 10);
+ tt_int_op(labs(timeval_msec_diff(&tv2,&tv3)), >, 10);
+ } else if (cached_time_disable && cached_time_sleep) {
+ tt_int_op(labs(timeval_msec_diff(&tv1,&tv2)), >, 10);
+ tt_int_op(labs(timeval_msec_diff(&tv2,&tv3)), >, 10);
+ } else if (! cached_time_disable) {
+ tt_assert(evutil_timercmp(&tv1, &tv2, ==));
+ tt_assert(evutil_timercmp(&tv2, &tv3, ==));
+ }
+
+end:
+ if (ev1)
+ event_free(ev1);
+ if (ev2)
+ event_free(ev2);
+ if (ev3)
+ event_free(ev3);
+ if (base)
+ event_base_free(base);
+ if (cfg)
+ event_config_free(cfg);
+}
+
+static void
+tabf_cb(evutil_socket_t fd, short what, void *arg)
+{
+ int *ptr = arg;
+ *ptr = what;
+ *ptr += 0x10000;
+}
+
+static void
+test_active_by_fd(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+ struct event *ev1 = NULL, *ev2 = NULL, *ev3 = NULL, *ev4 = NULL;
+ int e1,e2,e3,e4;
+#ifndef _WIN32
+ struct event *evsig = NULL;
+ int es;
+#endif
+ struct timeval tenmin = { 600, 0 };
+
+ /* Ensure no crash on nonexistent FD. */
+ event_base_active_by_fd(base, 1000, EV_READ);
+
+ /* Ensure no crash on bogus FD. */
+ event_base_active_by_fd(base, -1, EV_READ);
+
+ /* Ensure no crash on nonexistent/bogus signal. */
+ event_base_active_by_signal(base, 1000);
+ event_base_active_by_signal(base, -1);
+
+ event_base_assert_ok_(base);
+
+ e1 = e2 = e3 = e4 = 0;
+ ev1 = event_new(base, data->pair[0], EV_READ, tabf_cb, &e1);
+ ev2 = event_new(base, data->pair[0], EV_WRITE, tabf_cb, &e2);
+ ev3 = event_new(base, data->pair[1], EV_READ, tabf_cb, &e3);
+ ev4 = event_new(base, data->pair[1], EV_READ, tabf_cb, &e4);
+ tt_assert(ev1);
+ tt_assert(ev2);
+ tt_assert(ev3);
+ tt_assert(ev4);
+#ifndef _WIN32
+ evsig = event_new(base, SIGHUP, EV_SIGNAL, tabf_cb, &es);
+ tt_assert(evsig);
+ event_add(evsig, &tenmin);
+#endif
+
+ event_add(ev1, &tenmin);
+ event_add(ev2, NULL);
+ event_add(ev3, NULL);
+ event_add(ev4, &tenmin);
+
+
+ event_base_assert_ok_(base);
+
+ /* Trigger 2, 3, 4 */
+ event_base_active_by_fd(base, data->pair[0], EV_WRITE);
+ event_base_active_by_fd(base, data->pair[1], EV_READ);
+#ifndef _WIN32
+ event_base_active_by_signal(base, SIGHUP);
+#endif
+
+ event_base_assert_ok_(base);
+
+ event_base_loop(base, EVLOOP_ONCE);
+
+ tt_int_op(e1, ==, 0);
+ tt_int_op(e2, ==, EV_WRITE | 0x10000);
+ tt_int_op(e3, ==, EV_READ | 0x10000);
+ /* Mask out EV_WRITE here, since it could be genuinely writeable. */
+ tt_int_op((e4 & ~EV_WRITE), ==, EV_READ | 0x10000);
+#ifndef _WIN32
+ tt_int_op(es, ==, EV_SIGNAL | 0x10000);
+#endif
+
+end:
+ if (ev1)
+ event_free(ev1);
+ if (ev2)
+ event_free(ev2);
+ if (ev3)
+ event_free(ev3);
+ if (ev4)
+ event_free(ev4);
+#ifndef _WIN32
+ if (evsig)
+ event_free(evsig);
+#endif
+}
+
+struct testcase_t main_testcases[] = {
+ /* Some converted-over tests */
+ { "methods", test_methods, TT_FORK, NULL, NULL },
+ { "version", test_version, 0, NULL, NULL },
+ BASIC(base_features, TT_FORK|TT_NO_LOGS),
+ { "base_environ", test_base_environ, TT_FORK, NULL, NULL },
+
+ BASIC(event_base_new, TT_FORK|TT_NEED_SOCKETPAIR),
+ BASIC(free_active_base, TT_FORK|TT_NEED_SOCKETPAIR),
+
+ BASIC(manipulate_active_events, TT_FORK|TT_NEED_BASE),
+ BASIC(event_new_selfarg, TT_FORK|TT_NEED_BASE),
+ BASIC(event_assign_selfarg, TT_FORK|TT_NEED_BASE),
+ BASIC(event_base_get_num_events, TT_FORK|TT_NEED_BASE),
+ BASIC(event_base_get_max_events, TT_FORK|TT_NEED_BASE),
+
+ BASIC(bad_assign, TT_FORK|TT_NEED_BASE|TT_NO_LOGS),
+ BASIC(bad_reentrant, TT_FORK|TT_NEED_BASE|TT_NO_LOGS),
+ BASIC(active_later, TT_FORK|TT_NEED_BASE|TT_NEED_SOCKETPAIR),
+ BASIC(event_remove_timeout, TT_FORK|TT_NEED_BASE|TT_NEED_SOCKETPAIR),
+
+ /* These are still using the old API */
+ LEGACY(persistent_timeout, TT_FORK|TT_NEED_BASE),
+ { "persistent_timeout_jump", test_persistent_timeout_jump, TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
+ { "persistent_active_timeout", test_persistent_active_timeout,
+ TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
+ LEGACY(priorities, TT_FORK|TT_NEED_BASE),
+ BASIC(priority_active_inversion, TT_FORK|TT_NEED_BASE),
+ { "common_timeout", test_common_timeout, TT_FORK|TT_NEED_BASE,
+ &basic_setup, NULL },
+
+ /* These legacy tests may not all need all of these flags. */
+ LEGACY(simpleread, TT_ISOLATED),
+ LEGACY(simpleread_multiple, TT_ISOLATED),
+ LEGACY(simplewrite, TT_ISOLATED),
+ { "simpleclose", test_simpleclose, TT_FORK, &basic_setup,
+ NULL },
+ LEGACY(multiple, TT_ISOLATED),
+ LEGACY(persistent, TT_ISOLATED),
+ LEGACY(combined, TT_ISOLATED),
+ LEGACY(simpletimeout, TT_ISOLATED),
+ LEGACY(loopbreak, TT_ISOLATED),
+ LEGACY(loopexit, TT_ISOLATED),
+ LEGACY(loopexit_multiple, TT_ISOLATED),
+ LEGACY(nonpersist_readd, TT_ISOLATED),
+ LEGACY(multiple_events_for_same_fd, TT_ISOLATED),
+ LEGACY(want_only_once, TT_ISOLATED),
+ { "event_once", test_event_once, TT_ISOLATED, &basic_setup, NULL },
+ { "event_once_never", test_event_once_never, TT_ISOLATED, &basic_setup, NULL },
+ { "event_pending", test_event_pending, TT_ISOLATED, &basic_setup,
+ NULL },
+#ifndef _WIN32
+ { "dup_fd", test_dup_fd, TT_ISOLATED, &basic_setup, NULL },
+#endif
+ { "mm_functions", test_mm_functions, TT_FORK, NULL, NULL },
+ { "many_events", test_many_events, TT_ISOLATED, &basic_setup, NULL },
+ { "many_events_slow_add", test_many_events, TT_ISOLATED, &basic_setup, (void*)1 },
+
+ { "struct_event_size", test_struct_event_size, 0, NULL, NULL },
+ BASIC(get_assignment, TT_FORK|TT_NEED_BASE|TT_NEED_SOCKETPAIR),
+
+ BASIC(event_foreach, TT_FORK|TT_NEED_BASE),
+ { "gettimeofday_cached", test_gettimeofday_cached, TT_FORK, &basic_setup, (void*)"" },
+ { "gettimeofday_cached_sleep", test_gettimeofday_cached, TT_FORK, &basic_setup, (void*)"sleep" },
+ { "gettimeofday_cached_reset", test_gettimeofday_cached, TT_FORK, &basic_setup, (void*)"sleep reset" },
+ { "gettimeofday_cached_disabled", test_gettimeofday_cached, TT_FORK, &basic_setup, (void*)"sleep disable" },
+ { "gettimeofday_cached_disabled_nosleep", test_gettimeofday_cached, TT_FORK, &basic_setup, (void*)"disable" },
+
+ BASIC(active_by_fd, TT_FORK|TT_NEED_BASE|TT_NEED_SOCKETPAIR),
+
+#ifndef _WIN32
+ LEGACY(fork, TT_ISOLATED),
+#endif
+#ifdef EVENT__HAVE_PTHREADS
+ /** TODO: support win32 */
+ LEGACY(del_wait, TT_ISOLATED|TT_NEED_THREADS),
+#endif
+
+ END_OF_TESTCASES
+};
+
+struct testcase_t evtag_testcases[] = {
+ { "int", evtag_int_test, TT_FORK, NULL, NULL },
+ { "fuzz", evtag_fuzz, TT_FORK, NULL, NULL },
+ { "encoding", evtag_tag_encoding, TT_FORK, NULL, NULL },
+ { "peek", evtag_test_peek, 0, NULL, NULL },
+
+ END_OF_TESTCASES
+};
+
+struct testcase_t signal_testcases[] = {
+#ifndef _WIN32
+ LEGACY(simplestsignal, TT_ISOLATED),
+ LEGACY(simplesignal, TT_ISOLATED),
+ LEGACY(multiplesignal, TT_ISOLATED),
+ LEGACY(immediatesignal, TT_ISOLATED),
+ LEGACY(signal_dealloc, TT_ISOLATED),
+ LEGACY(signal_pipeloss, TT_ISOLATED),
+ LEGACY(signal_switchbase, TT_ISOLATED|TT_NO_LOGS),
+ LEGACY(signal_restore, TT_ISOLATED),
+ LEGACY(signal_assert, TT_ISOLATED),
+ LEGACY(signal_while_processing, TT_ISOLATED),
+#endif
+ END_OF_TESTCASES
+};
+
diff --git a/protocols/Telegram/tgl/libevent/test/regress.exe b/protocols/Telegram/tgl/libevent/test/regress.exe
new file mode 100644
index 0000000000..651b62c564
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress.exe
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/regress.gen.c b/protocols/Telegram/tgl/libevent/test/regress.gen.c
new file mode 100644
index 0000000000..2cf8925e9a
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress.gen.c
@@ -0,0 +1 @@
+//
diff --git a/protocols/Telegram/tgl/libevent/test/regress.gen.h b/protocols/Telegram/tgl/libevent/test/regress.gen.h
new file mode 100644
index 0000000000..4578e5f7f3
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress.gen.h
@@ -0,0 +1 @@
+#define NO_PYTHON_EXISTS
diff --git a/protocols/Telegram/tgl/libevent/test/regress.gen.obj b/protocols/Telegram/tgl/libevent/test/regress.gen.obj
new file mode 100644
index 0000000000..ba20c4cca8
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress.gen.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/regress.h b/protocols/Telegram/tgl/libevent/test/regress.h
new file mode 100644
index 0000000000..de1aed3089
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress.h
@@ -0,0 +1,144 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef REGRESS_H_INCLUDED_
+#define REGRESS_H_INCLUDED_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "tinytest.h"
+#include "tinytest_macros.h"
+
+extern struct testcase_t main_testcases[];
+extern struct testcase_t evtag_testcases[];
+extern struct testcase_t evbuffer_testcases[];
+extern struct testcase_t finalize_testcases[];
+extern struct testcase_t bufferevent_testcases[];
+extern struct testcase_t bufferevent_iocp_testcases[];
+extern struct testcase_t util_testcases[];
+extern struct testcase_t signal_testcases[];
+extern struct testcase_t http_testcases[];
+extern struct testcase_t dns_testcases[];
+extern struct testcase_t rpc_testcases[];
+extern struct testcase_t edgetriggered_testcases[];
+extern struct testcase_t minheap_testcases[];
+extern struct testcase_t iocp_testcases[];
+extern struct testcase_t ssl_testcases[];
+extern struct testcase_t listener_testcases[];
+extern struct testcase_t listener_iocp_testcases[];
+extern struct testcase_t thread_testcases[];
+
+extern struct evutil_weakrand_state test_weakrand_state;
+
+#define test_weakrand() (evutil_weakrand_(&test_weakrand_state))
+
+void regress_threads(void *);
+void test_bufferevent_zlib(void *);
+
+/* Helpers to wrap old testcases */
+extern evutil_socket_t pair[2];
+extern int test_ok;
+extern int called;
+extern struct event_base *global_base;
+extern int in_legacy_test_wrapper;
+
+int regress_make_tmpfile(const void *data, size_t datalen, char **filename_out);
+
+struct basic_test_data {
+ struct event_base *base;
+ evutil_socket_t pair[2];
+
+ void (*legacy_test_fn)(void);
+
+ void *setup_data;
+};
+extern const struct testcase_setup_t basic_setup;
+
+
+extern const struct testcase_setup_t legacy_setup;
+void run_legacy_test_fn(void *ptr);
+
+extern int libevent_tests_running_in_debug_mode;
+
+/* A couple of flags that basic/legacy_setup can support. */
+#define TT_NEED_SOCKETPAIR TT_FIRST_USER_FLAG
+#define TT_NEED_BASE (TT_FIRST_USER_FLAG<<1)
+#define TT_NEED_DNS (TT_FIRST_USER_FLAG<<2)
+#define TT_LEGACY (TT_FIRST_USER_FLAG<<3)
+#define TT_NEED_THREADS (TT_FIRST_USER_FLAG<<4)
+#define TT_NO_LOGS (TT_FIRST_USER_FLAG<<5)
+#define TT_ENABLE_IOCP_FLAG (TT_FIRST_USER_FLAG<<6)
+#define TT_ENABLE_IOCP (TT_ENABLE_IOCP_FLAG|TT_NEED_THREADS)
+
+/* All the flags that a legacy test needs. */
+#define TT_ISOLATED TT_FORK|TT_NEED_SOCKETPAIR|TT_NEED_BASE
+
+
+#define BASIC(name,flags) \
+ { #name, test_## name, flags, &basic_setup, NULL }
+
+#define LEGACY(name,flags) \
+ { #name, run_legacy_test_fn, flags|TT_LEGACY, &legacy_setup, \
+ test_## name }
+
+struct evutil_addrinfo;
+struct evutil_addrinfo *ai_find_by_family(struct evutil_addrinfo *ai, int f);
+struct evutil_addrinfo *ai_find_by_protocol(struct evutil_addrinfo *ai, int p);
+int test_ai_eq_(const struct evutil_addrinfo *ai, const char *sockaddr_port,
+ int socktype, int protocol, int line);
+
+#define test_ai_eq(ai, str, s, p) do { \
+ if (test_ai_eq_((ai), (str), (s), (p), __LINE__)<0) \
+ goto end; \
+ } while (0)
+
+#define test_timeval_diff_leq(tv1, tv2, diff, tolerance) \
+ tt_int_op(labs(timeval_msec_diff((tv1), (tv2)) - diff), <=, tolerance)
+
+#define test_timeval_diff_eq(tv1, tv2, diff) \
+ test_timeval_diff_leq((tv1), (tv2), (diff), 50)
+
+long timeval_msec_diff(const struct timeval *start, const struct timeval *end);
+
+#ifndef _WIN32
+pid_t regress_fork(void);
+#endif
+
+#ifdef EVENT__HAVE_OPENSSL
+#include <openssl/ssl.h>
+EVP_PKEY *ssl_getkey(void);
+X509 *ssl_getcert(void);
+SSL_CTX *get_ssl_ctx(void);
+void init_ssl(void);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* REGRESS_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/test/regress.obj b/protocols/Telegram/tgl/libevent/test/regress.obj
new file mode 100644
index 0000000000..b3832b8411
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/regress.rpc b/protocols/Telegram/tgl/libevent/test/regress.rpc
new file mode 100644
index 0000000000..0ee904e913
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress.rpc
@@ -0,0 +1,25 @@
+/* tests data packing and unpacking */
+
+struct msg {
+ string /* sender */ from_name = 1; /* be verbose */
+ string to_name = 2;
+ optional struct[kill] attack = 3;
+ array struct[run] run = 4;
+}
+
+struct kill {
+ string weapon = 0x10121;
+ string action = 2;
+ array int how_often = 3;
+}
+
+struct run {
+ string how = 1;
+ optional bytes some_bytes = 2;
+
+ bytes fixed_bytes[24] = 3;
+ array string notes = 4;
+
+ optional int64 large_number = 5;
+ array int other_numbers = 6;
+}
diff --git a/protocols/Telegram/tgl/libevent/test/regress_buffer.c b/protocols/Telegram/tgl/libevent/test/regress_buffer.c
new file mode 100644
index 0000000000..957e59f178
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_buffer.c
@@ -0,0 +1,2281 @@
+/*
+ * Copyright (c) 2003-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "util-internal.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+#include "event2/event-config.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#ifndef _WIN32
+#include <sys/socket.h>
+#include <sys/wait.h>
+#include <signal.h>
+#include <unistd.h>
+#include <netdb.h>
+#endif
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <assert.h>
+
+#include "event2/event.h"
+#include "event2/buffer.h"
+#include "event2/buffer_compat.h"
+#include "event2/util.h"
+
+#include "defer-internal.h"
+#include "evbuffer-internal.h"
+#include "log-internal.h"
+
+#include "regress.h"
+
+/* Validates that an evbuffer is good. Returns false if it isn't, true if it
+ * is*/
+static int
+evbuffer_validate_(struct evbuffer *buf)
+{
+ struct evbuffer_chain *chain;
+ size_t sum = 0;
+ int found_last_with_datap = 0;
+
+ if (buf->first == NULL) {
+ tt_assert(buf->last == NULL);
+ tt_assert(buf->total_len == 0);
+ }
+
+ chain = buf->first;
+
+ tt_assert(buf->last_with_datap);
+ if (buf->last_with_datap == &buf->first)
+ found_last_with_datap = 1;
+
+ while (chain != NULL) {
+ if (&chain->next == buf->last_with_datap)
+ found_last_with_datap = 1;
+ sum += chain->off;
+ if (chain->next == NULL) {
+ tt_assert(buf->last == chain);
+ }
+ tt_assert(chain->buffer_len >= chain->misalign + chain->off);
+ chain = chain->next;
+ }
+
+ if (buf->first)
+ tt_assert(*buf->last_with_datap);
+
+ if (*buf->last_with_datap) {
+ chain = *buf->last_with_datap;
+ if (chain->off == 0 || buf->total_len == 0) {
+ tt_assert(chain->off == 0)
+ tt_assert(chain == buf->first);
+ tt_assert(buf->total_len == 0);
+ }
+ chain = chain->next;
+ while (chain != NULL) {
+ tt_assert(chain->off == 0);
+ chain = chain->next;
+ }
+ } else {
+ tt_assert(buf->last_with_datap == &buf->first);
+ }
+ tt_assert(found_last_with_datap);
+
+ tt_assert(sum == buf->total_len);
+ return 1;
+ end:
+ return 0;
+}
+
+static void
+evbuffer_get_waste(struct evbuffer *buf, size_t *allocatedp, size_t *wastedp, size_t *usedp)
+{
+ struct evbuffer_chain *chain;
+ size_t a, w, u;
+ int n = 0;
+ u = a = w = 0;
+
+ chain = buf->first;
+ /* skip empty at start */
+ while (chain && chain->off==0) {
+ ++n;
+ a += chain->buffer_len;
+ chain = chain->next;
+ }
+ /* first nonempty chain: stuff at the end only is wasted. */
+ if (chain) {
+ ++n;
+ a += chain->buffer_len;
+ u += chain->off;
+ if (chain->next && chain->next->off)
+ w += (size_t)(chain->buffer_len - (chain->misalign + chain->off));
+ chain = chain->next;
+ }
+ /* subsequent nonempty chains */
+ while (chain && chain->off) {
+ ++n;
+ a += chain->buffer_len;
+ w += (size_t)chain->misalign;
+ u += chain->off;
+ if (chain->next && chain->next->off)
+ w += (size_t) (chain->buffer_len - (chain->misalign + chain->off));
+ chain = chain->next;
+ }
+ /* subsequent empty chains */
+ while (chain) {
+ ++n;
+ a += chain->buffer_len;
+ }
+ *allocatedp = a;
+ *wastedp = w;
+ *usedp = u;
+}
+
+#define evbuffer_validate(buf) \
+ TT_STMT_BEGIN if (!evbuffer_validate_(buf)) TT_DIE(("Buffer format invalid")); TT_STMT_END
+
+static void
+test_evbuffer(void *ptr)
+{
+ static char buffer[512], *tmp;
+ struct evbuffer *evb = evbuffer_new();
+ struct evbuffer *evb_two = evbuffer_new();
+ size_t sz_tmp;
+ int i;
+
+ evbuffer_validate(evb);
+ evbuffer_add_printf(evb, "%s/%d", "hello", 1);
+ evbuffer_validate(evb);
+
+ tt_assert(evbuffer_get_length(evb) == 7);
+ tt_assert(!memcmp((char*)EVBUFFER_DATA(evb), "hello/1", 1));
+
+ evbuffer_add_buffer(evb, evb_two);
+ evbuffer_validate(evb);
+
+ evbuffer_drain(evb, strlen("hello/"));
+ evbuffer_validate(evb);
+ tt_assert(evbuffer_get_length(evb) == 1);
+ tt_assert(!memcmp((char*)EVBUFFER_DATA(evb), "1", 1));
+
+ evbuffer_add_printf(evb_two, "%s", "/hello");
+ evbuffer_validate(evb);
+ evbuffer_add_buffer(evb, evb_two);
+ evbuffer_validate(evb);
+
+ tt_assert(evbuffer_get_length(evb_two) == 0);
+ tt_assert(evbuffer_get_length(evb) == 7);
+ tt_assert(!memcmp((char*)EVBUFFER_DATA(evb), "1/hello", 7));
+
+ memset(buffer, 0, sizeof(buffer));
+ evbuffer_add(evb, buffer, sizeof(buffer));
+ evbuffer_validate(evb);
+ tt_assert(evbuffer_get_length(evb) == 7 + 512);
+
+ tmp = (char *)evbuffer_pullup(evb, 7 + 512);
+ tt_assert(tmp);
+ tt_assert(!strncmp(tmp, "1/hello", 7));
+ tt_assert(!memcmp(tmp + 7, buffer, sizeof(buffer)));
+ evbuffer_validate(evb);
+
+ evbuffer_prepend(evb, "something", 9);
+ evbuffer_validate(evb);
+ evbuffer_prepend(evb, "else", 4);
+ evbuffer_validate(evb);
+
+ tmp = (char *)evbuffer_pullup(evb, 4 + 9 + 7);
+ tt_assert(!strncmp(tmp, "elsesomething1/hello", 4 + 9 + 7));
+ evbuffer_validate(evb);
+
+ evbuffer_drain(evb, -1);
+ evbuffer_validate(evb);
+ evbuffer_drain(evb_two, -1);
+ evbuffer_validate(evb);
+
+ for (i = 0; i < 3; ++i) {
+ evbuffer_add(evb_two, buffer, sizeof(buffer));
+ evbuffer_validate(evb_two);
+ evbuffer_add_buffer(evb, evb_two);
+ evbuffer_validate(evb);
+ evbuffer_validate(evb_two);
+ }
+
+ tt_assert(evbuffer_get_length(evb_two) == 0);
+ tt_assert(evbuffer_get_length(evb) == i * sizeof(buffer));
+
+ /* test remove buffer */
+ sz_tmp = (size_t)(sizeof(buffer)*2.5);
+ evbuffer_remove_buffer(evb, evb_two, sz_tmp);
+ tt_assert(evbuffer_get_length(evb_two) == sz_tmp);
+ tt_assert(evbuffer_get_length(evb) == sizeof(buffer) / 2);
+ evbuffer_validate(evb);
+
+ if (memcmp(evbuffer_pullup(
+ evb, -1), buffer, sizeof(buffer) / 2) != 0 ||
+ memcmp(evbuffer_pullup(
+ evb_two, -1), buffer, sizeof(buffer)) != 0)
+ tt_abort_msg("Pullup did not preserve content");
+
+ evbuffer_validate(evb);
+
+
+ /* testing one-vector reserve and commit */
+ {
+ struct evbuffer_iovec v[1];
+ char *buf;
+ int i, j, r;
+
+ for (i = 0; i < 3; ++i) {
+ r = evbuffer_reserve_space(evb, 10000, v, 1);
+ tt_int_op(r, ==, 1);
+ tt_assert(v[0].iov_len >= 10000);
+ tt_assert(v[0].iov_base != NULL);
+
+ evbuffer_validate(evb);
+ buf = v[0].iov_base;
+ for (j = 0; j < 10000; ++j) {
+ buf[j] = j;
+ }
+ evbuffer_validate(evb);
+
+ tt_int_op(evbuffer_commit_space(evb, v, 1), ==, 0);
+ evbuffer_validate(evb);
+
+ tt_assert(evbuffer_get_length(evb) >= 10000);
+
+ evbuffer_drain(evb, j * 5000);
+ evbuffer_validate(evb);
+ }
+ }
+
+ end:
+ evbuffer_free(evb);
+ evbuffer_free(evb_two);
+}
+
+static void
+no_cleanup(const void *data, size_t datalen, void *extra)
+{
+}
+
+static void
+test_evbuffer_remove_buffer_with_empty(void *ptr)
+{
+ struct evbuffer *src = evbuffer_new();
+ struct evbuffer *dst = evbuffer_new();
+ char buf[2];
+
+ evbuffer_validate(src);
+ evbuffer_validate(dst);
+
+ /* setup the buffers */
+ /* we need more data in src than we will move later */
+ evbuffer_add_reference(src, buf, sizeof(buf), no_cleanup, NULL);
+ evbuffer_add_reference(src, buf, sizeof(buf), no_cleanup, NULL);
+ /* we need one buffer in dst and one empty buffer at the end */
+ evbuffer_add(dst, buf, sizeof(buf));
+ evbuffer_add_reference(dst, buf, 0, no_cleanup, NULL);
+
+ evbuffer_validate(src);
+ evbuffer_validate(dst);
+
+ /* move three bytes over */
+ evbuffer_remove_buffer(src, dst, 3);
+
+ evbuffer_validate(src);
+ evbuffer_validate(dst);
+
+end:
+ evbuffer_free(src);
+ evbuffer_free(dst);
+}
+
+static void
+test_evbuffer_reserve2(void *ptr)
+{
+ /* Test the two-vector cases of reserve/commit. */
+ struct evbuffer *buf = evbuffer_new();
+ int n, i;
+ struct evbuffer_iovec v[2];
+ size_t remaining;
+ char *cp, *cp2;
+
+ /* First chunk will necessarily be one chunk. Use 512 bytes of it.*/
+ n = evbuffer_reserve_space(buf, 1024, v, 2);
+ tt_int_op(n, ==, 1);
+ tt_int_op(evbuffer_get_length(buf), ==, 0);
+ tt_assert(v[0].iov_base != NULL);
+ tt_int_op(v[0].iov_len, >=, 1024);
+ memset(v[0].iov_base, 'X', 512);
+ cp = v[0].iov_base;
+ remaining = v[0].iov_len - 512;
+ v[0].iov_len = 512;
+ evbuffer_validate(buf);
+ tt_int_op(0, ==, evbuffer_commit_space(buf, v, 1));
+ tt_int_op(evbuffer_get_length(buf), ==, 512);
+ evbuffer_validate(buf);
+
+ /* Ask for another same-chunk request, in an existing chunk. Use 8
+ * bytes of it. */
+ n = evbuffer_reserve_space(buf, 32, v, 2);
+ tt_int_op(n, ==, 1);
+ tt_assert(cp + 512 == v[0].iov_base);
+ tt_int_op(remaining, ==, v[0].iov_len);
+ memset(v[0].iov_base, 'Y', 8);
+ v[0].iov_len = 8;
+ tt_int_op(0, ==, evbuffer_commit_space(buf, v, 1));
+ tt_int_op(evbuffer_get_length(buf), ==, 520);
+ remaining -= 8;
+ evbuffer_validate(buf);
+
+ /* Now ask for a request that will be split. Use only one byte of it,
+ though. */
+ n = evbuffer_reserve_space(buf, remaining+64, v, 2);
+ tt_int_op(n, ==, 2);
+ tt_assert(cp + 520 == v[0].iov_base);
+ tt_int_op(remaining, ==, v[0].iov_len);
+ tt_assert(v[1].iov_base);
+ tt_assert(v[1].iov_len >= 64);
+ cp2 = v[1].iov_base;
+ memset(v[0].iov_base, 'Z', 1);
+ v[0].iov_len = 1;
+ tt_int_op(0, ==, evbuffer_commit_space(buf, v, 1));
+ tt_int_op(evbuffer_get_length(buf), ==, 521);
+ remaining -= 1;
+ evbuffer_validate(buf);
+
+ /* Now ask for a request that will be split. Use some of the first
+ * part and some of the second. */
+ n = evbuffer_reserve_space(buf, remaining+64, v, 2);
+ evbuffer_validate(buf);
+ tt_int_op(n, ==, 2);
+ tt_assert(cp + 521 == v[0].iov_base);
+ tt_int_op(remaining, ==, v[0].iov_len);
+ tt_assert(v[1].iov_base == cp2);
+ tt_assert(v[1].iov_len >= 64);
+ memset(v[0].iov_base, 'W', 400);
+ v[0].iov_len = 400;
+ memset(v[1].iov_base, 'x', 60);
+ v[1].iov_len = 60;
+ tt_int_op(0, ==, evbuffer_commit_space(buf, v, 2));
+ tt_int_op(evbuffer_get_length(buf), ==, 981);
+ evbuffer_validate(buf);
+
+ /* Now peek to make sure stuff got made how we like. */
+ memset(v,0,sizeof(v));
+ n = evbuffer_peek(buf, -1, NULL, v, 2);
+ tt_int_op(n, ==, 2);
+ tt_int_op(v[0].iov_len, ==, 921);
+ tt_int_op(v[1].iov_len, ==, 60);
+
+ cp = v[0].iov_base;
+ for (i=0; i<512; ++i)
+ tt_int_op(cp[i], ==, 'X');
+ for (i=512; i<520; ++i)
+ tt_int_op(cp[i], ==, 'Y');
+ for (i=520; i<521; ++i)
+ tt_int_op(cp[i], ==, 'Z');
+ for (i=521; i<921; ++i)
+ tt_int_op(cp[i], ==, 'W');
+
+ cp = v[1].iov_base;
+ for (i=0; i<60; ++i)
+ tt_int_op(cp[i], ==, 'x');
+
+end:
+ evbuffer_free(buf);
+}
+
+static void
+test_evbuffer_reserve_many(void *ptr)
+{
+ /* This is a glass-box test to handle expanding a buffer with more
+ * chunks and reallocating chunks as needed */
+ struct evbuffer *buf = evbuffer_new();
+ struct evbuffer_iovec v[8];
+ int n;
+ size_t sz;
+ int add_data = ptr && !strcmp(ptr, "add");
+ int fill_first = ptr && !strcmp(ptr, "fill");
+ char *cp1, *cp2;
+
+ /* When reserving the the first chunk, we just allocate it */
+ n = evbuffer_reserve_space(buf, 128, v, 2);
+ evbuffer_validate(buf);
+ tt_int_op(n, ==, 1);
+ tt_assert(v[0].iov_len >= 128);
+ sz = v[0].iov_len;
+ cp1 = v[0].iov_base;
+ if (add_data) {
+ *(char*)v[0].iov_base = 'X';
+ v[0].iov_len = 1;
+ n = evbuffer_commit_space(buf, v, 1);
+ tt_int_op(n, ==, 0);
+ } else if (fill_first) {
+ memset(v[0].iov_base, 'X', v[0].iov_len);
+ n = evbuffer_commit_space(buf, v, 1);
+ tt_int_op(n, ==, 0);
+ n = evbuffer_reserve_space(buf, 128, v, 2);
+ tt_int_op(n, ==, 1);
+ sz = v[0].iov_len;
+ tt_assert(v[0].iov_base != cp1);
+ cp1 = v[0].iov_base;
+ }
+
+ /* Make another chunk get added. */
+ n = evbuffer_reserve_space(buf, sz+128, v, 2);
+ evbuffer_validate(buf);
+ tt_int_op(n, ==, 2);
+ sz = v[0].iov_len + v[1].iov_len;
+ tt_int_op(sz, >=, v[0].iov_len+128);
+ if (add_data) {
+ tt_assert(v[0].iov_base == cp1 + 1);
+ } else {
+ tt_assert(v[0].iov_base == cp1);
+ }
+ cp1 = v[0].iov_base;
+ cp2 = v[1].iov_base;
+
+ /* And a third chunk. */
+ n = evbuffer_reserve_space(buf, sz+128, v, 3);
+ evbuffer_validate(buf);
+ tt_int_op(n, ==, 3);
+ tt_assert(cp1 == v[0].iov_base);
+ tt_assert(cp2 == v[1].iov_base);
+ sz = v[0].iov_len + v[1].iov_len + v[2].iov_len;
+
+ /* Now force a reallocation by asking for more space in only 2
+ * buffers. */
+ n = evbuffer_reserve_space(buf, sz+128, v, 2);
+ evbuffer_validate(buf);
+ if (add_data) {
+ tt_int_op(n, ==, 2);
+ tt_assert(cp1 == v[0].iov_base);
+ } else {
+ tt_int_op(n, ==, 1);
+ }
+
+end:
+ evbuffer_free(buf);
+}
+
+static void
+test_evbuffer_expand(void *ptr)
+{
+ char data[4096];
+ struct evbuffer *buf;
+ size_t a,w,u;
+ void *buffer;
+
+ memset(data, 'X', sizeof(data));
+
+ /* Make sure that expand() works on an empty buffer */
+ buf = evbuffer_new();
+ tt_int_op(evbuffer_expand(buf, 20000), ==, 0);
+ evbuffer_validate(buf);
+ a=w=u=0;
+ evbuffer_get_waste(buf, &a,&w,&u);
+ tt_assert(w == 0);
+ tt_assert(u == 0);
+ tt_assert(a >= 20000);
+ tt_assert(buf->first);
+ tt_assert(buf->first == buf->last);
+ tt_assert(buf->first->off == 0);
+ tt_assert(buf->first->buffer_len >= 20000);
+
+ /* Make sure that expand() works as a no-op when there's enough
+ * contiguous space already. */
+ buffer = buf->first->buffer;
+ evbuffer_add(buf, data, 1024);
+ tt_int_op(evbuffer_expand(buf, 1024), ==, 0);
+ tt_assert(buf->first->buffer == buffer);
+ evbuffer_validate(buf);
+ evbuffer_free(buf);
+
+ /* Make sure that expand() can work by moving misaligned data
+ * when it makes sense to do so. */
+ buf = evbuffer_new();
+ evbuffer_add(buf, data, 400);
+ {
+ int n = (int)(buf->first->buffer_len - buf->first->off - 1);
+ tt_assert(n < (int)sizeof(data));
+ evbuffer_add(buf, data, n);
+ }
+ tt_assert(buf->first == buf->last);
+ tt_assert(buf->first->off == buf->first->buffer_len - 1);
+ evbuffer_drain(buf, buf->first->off - 1);
+ tt_assert(1 == evbuffer_get_length(buf));
+ tt_assert(buf->first->misalign > 0);
+ tt_assert(buf->first->off == 1);
+ buffer = buf->first->buffer;
+ tt_assert(evbuffer_expand(buf, 40) == 0);
+ tt_assert(buf->first == buf->last);
+ tt_assert(buf->first->off == 1);
+ tt_assert(buf->first->buffer == buffer);
+ tt_assert(buf->first->misalign == 0);
+ evbuffer_validate(buf);
+ evbuffer_free(buf);
+
+ /* add, expand, pull-up: This used to crash libevent. */
+ buf = evbuffer_new();
+
+ evbuffer_add(buf, data, sizeof(data));
+ evbuffer_add(buf, data, sizeof(data));
+ evbuffer_add(buf, data, sizeof(data));
+
+ evbuffer_validate(buf);
+ evbuffer_expand(buf, 1024);
+ evbuffer_validate(buf);
+ evbuffer_pullup(buf, -1);
+ evbuffer_validate(buf);
+
+end:
+ evbuffer_free(buf);
+}
+
+
+static int reference_cb_called;
+static void
+reference_cb(const void *data, size_t len, void *extra)
+{
+ tt_str_op(data, ==, "this is what we add as read-only memory.");
+ tt_int_op(len, ==, strlen(data));
+ tt_want(extra == (void *)0xdeadaffe);
+ ++reference_cb_called;
+end:
+ ;
+}
+
+static void
+test_evbuffer_reference(void *ptr)
+{
+ struct evbuffer *src = evbuffer_new();
+ struct evbuffer *dst = evbuffer_new();
+ struct evbuffer_iovec v[1];
+ const char *data = "this is what we add as read-only memory.";
+ reference_cb_called = 0;
+
+ tt_assert(evbuffer_add_reference(src, data, strlen(data),
+ reference_cb, (void *)0xdeadaffe) != -1);
+
+ evbuffer_reserve_space(dst, strlen(data), v, 1);
+ tt_assert(evbuffer_remove(src, v[0].iov_base, 10) != -1);
+
+ evbuffer_validate(src);
+ evbuffer_validate(dst);
+
+ /* make sure that we don't write data at the beginning */
+ evbuffer_prepend(src, "aaaaa", 5);
+ evbuffer_validate(src);
+ evbuffer_drain(src, 5);
+
+ tt_assert(evbuffer_remove(src, ((char*)(v[0].iov_base)) + 10,
+ strlen(data) - 10) != -1);
+
+ v[0].iov_len = strlen(data);
+
+ evbuffer_commit_space(dst, v, 1);
+ evbuffer_validate(src);
+ evbuffer_validate(dst);
+
+ tt_int_op(reference_cb_called, ==, 1);
+
+ tt_assert(!memcmp(evbuffer_pullup(dst, strlen(data)),
+ data, strlen(data)));
+ evbuffer_validate(dst);
+
+ end:
+ evbuffer_free(dst);
+ evbuffer_free(src);
+}
+
+static struct event_base *addfile_test_event_base = NULL;
+static int addfile_test_done_writing = 0;
+static int addfile_test_total_written = 0;
+static int addfile_test_total_read = 0;
+
+static void
+addfile_test_writecb(evutil_socket_t fd, short what, void *arg)
+{
+ struct evbuffer *b = arg;
+ int r;
+ evbuffer_validate(b);
+ while (evbuffer_get_length(b)) {
+ r = evbuffer_write(b, fd);
+ if (r > 0) {
+ addfile_test_total_written += r;
+ TT_BLATHER(("Wrote %d/%d bytes", r, addfile_test_total_written));
+ } else {
+ int e = evutil_socket_geterror(fd);
+ if (EVUTIL_ERR_RW_RETRIABLE(e))
+ return;
+ tt_fail_perror("write");
+ event_base_loopexit(addfile_test_event_base,NULL);
+ }
+ evbuffer_validate(b);
+ }
+ addfile_test_done_writing = 1;
+ return;
+end:
+ event_base_loopexit(addfile_test_event_base,NULL);
+}
+
+static void
+addfile_test_readcb(evutil_socket_t fd, short what, void *arg)
+{
+ struct evbuffer *b = arg;
+ int e, r = 0;
+ do {
+ r = evbuffer_read(b, fd, 1024);
+ if (r > 0) {
+ addfile_test_total_read += r;
+ TT_BLATHER(("Read %d/%d bytes", r, addfile_test_total_read));
+ }
+ } while (r > 0);
+ if (r < 0) {
+ e = evutil_socket_geterror(fd);
+ if (! EVUTIL_ERR_RW_RETRIABLE(e)) {
+ tt_fail_perror("read");
+ event_base_loopexit(addfile_test_event_base,NULL);
+ }
+ }
+ if (addfile_test_done_writing &&
+ addfile_test_total_read >= addfile_test_total_written) {
+ event_base_loopexit(addfile_test_event_base,NULL);
+ }
+}
+
+static void
+test_evbuffer_add_file(void *ptr)
+{
+ struct basic_test_data *testdata = ptr;
+ const char *impl = testdata->setup_data;
+ struct evbuffer *src = evbuffer_new(), *dest = evbuffer_new();
+ char *tmpfilename = NULL;
+ char *data = NULL;
+ const char *expect_data;
+ size_t datalen, expect_len;
+ const char *compare;
+ int fd = -1;
+ int want_ismapping = -1, want_cansendfile = -1;
+ unsigned flags = 0;
+ int use_segment = 1, use_bigfile = 0, map_from_offset = 0,
+ view_from_offset = 0;
+ struct evbuffer_file_segment *seg = NULL;
+ ev_off_t starting_offset = 0, mapping_len = -1;
+ ev_off_t segment_offset = 0, segment_len = -1;
+ struct event *rev=NULL, *wev=NULL;
+ struct event_base *base = testdata->base;
+ evutil_socket_t pair[2] = {-1, -1};
+ struct evutil_weakrand_state seed = { 123456789U };
+
+ /* This test is highly parameterized based on substrings of its
+ * argument. The strings are: */
+ tt_assert(impl);
+ if (strstr(impl, "nosegment")) {
+ /* If nosegment is set, use the older evbuffer_add_file
+ * interface */
+ use_segment = 0;
+ }
+ if (strstr(impl, "bigfile")) {
+ /* If bigfile is set, use a 512K file. Else use a smaller
+ * one. */
+ use_bigfile = 1;
+ }
+ if (strstr(impl, "map_offset")) {
+ /* If map_offset is set, we build the file segment starting
+ * from a point other than byte 0 and ending somewhere other
+ * than the last byte. Otherwise we map the whole thing */
+ map_from_offset = 1;
+ }
+ if (strstr(impl, "offset_in_segment")) {
+ /* If offset_in_segment is set, we add a subsection of the
+ * file semgment starting from a point other than byte 0 of
+ * the segment. */
+ view_from_offset = 1;
+ }
+ if (strstr(impl, "sendfile")) {
+ /* If sendfile is set, we try to use a sendfile/splice style
+ * backend. */
+ flags = EVBUF_FS_DISABLE_MMAP;
+ want_cansendfile = 1;
+ want_ismapping = 0;
+ } else if (strstr(impl, "mmap")) {
+ /* If sendfile is set, we try to use a mmap/CreateFileMapping
+ * style backend. */
+ flags = EVBUF_FS_DISABLE_SENDFILE;
+ want_ismapping = 1;
+ want_cansendfile = 0;
+ } else if (strstr(impl, "linear")) {
+ /* If linear is set, we try to use a read-the-whole-thing
+ * backend. */
+ flags = EVBUF_FS_DISABLE_SENDFILE|EVBUF_FS_DISABLE_MMAP;
+ want_ismapping = 0;
+ want_cansendfile = 0;
+ } else if (strstr(impl, "default")) {
+ /* The caller doesn't care which backend we use. */
+ ;
+ } else {
+ /* The caller must choose a backend. */
+ TT_DIE(("Didn't recognize the implementation"));
+ }
+
+ if (use_bigfile) {
+ unsigned int i;
+ datalen = 1024*512;
+ data = malloc(1024*512);
+ tt_assert(data);
+ for (i = 0; i < datalen; ++i)
+ data[i] = (char)evutil_weakrand_(&seed);
+ } else {
+ data = strdup("here is a relatively small string.");
+ tt_assert(data);
+ datalen = strlen(data);
+ }
+
+ fd = regress_make_tmpfile(data, datalen, &tmpfilename);
+
+ if (map_from_offset) {
+ starting_offset = datalen/4 + 1;
+ mapping_len = datalen / 2 - 1;
+ expect_data = data + starting_offset;
+ expect_len = mapping_len;
+ } else {
+ expect_data = data;
+ expect_len = datalen;
+ }
+ if (view_from_offset) {
+ tt_assert(use_segment); /* Can't do this with add_file*/
+ segment_offset = expect_len / 3;
+ segment_len = expect_len / 2;
+ expect_data = expect_data + segment_offset;
+ expect_len = segment_len;
+ }
+
+ if (use_segment) {
+ seg = evbuffer_file_segment_new(fd, starting_offset,
+ mapping_len, flags);
+ tt_assert(seg);
+ if (want_ismapping >= 0) {
+ if (seg->is_mapping != (unsigned)want_ismapping)
+ tt_skip();
+ }
+ if (want_cansendfile >= 0) {
+ if (seg->can_sendfile != (unsigned)want_cansendfile)
+ tt_skip();
+ }
+ }
+
+ /* Say that it drains to a fd so that we can use sendfile. */
+ evbuffer_set_flags(src, EVBUFFER_FLAG_DRAINS_TO_FD);
+
+#if defined(EVENT__HAVE_SENDFILE) && defined(__sun__) && defined(__svr4__)
+ /* We need to use a pair of AF_INET sockets, since Solaris
+ doesn't support sendfile() over AF_UNIX. */
+ if (evutil_ersatz_socketpair_(AF_INET, SOCK_STREAM, 0, pair) == -1)
+ tt_abort_msg("ersatz_socketpair failed");
+#else
+ if (evutil_socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1)
+ tt_abort_msg("socketpair failed");
+#endif
+ evutil_make_socket_nonblocking(pair[0]);
+ evutil_make_socket_nonblocking(pair[1]);
+
+ tt_assert(fd != -1);
+
+ if (use_segment) {
+ tt_assert(evbuffer_add_file_segment(src, seg,
+ segment_offset, segment_len)!=-1);
+ } else {
+ tt_assert(evbuffer_add_file(src, fd, starting_offset,
+ mapping_len) != -1);
+ }
+
+ evbuffer_validate(src);
+
+ addfile_test_event_base = base;
+ wev = event_new(base, pair[0], EV_WRITE|EV_PERSIST,
+ addfile_test_writecb, src);
+ rev = event_new(base, pair[1], EV_READ|EV_PERSIST,
+ addfile_test_readcb, dest);
+
+ event_add(wev, NULL);
+ event_add(rev, NULL);
+ event_base_dispatch(base);
+
+ evbuffer_validate(src);
+ evbuffer_validate(dest);
+
+ tt_assert(addfile_test_done_writing);
+ tt_int_op(addfile_test_total_written, ==, expect_len);
+ tt_int_op(addfile_test_total_read, ==, expect_len);
+
+ compare = (char *)evbuffer_pullup(dest, expect_len);
+ tt_assert(compare != NULL);
+ if (memcmp(compare, expect_data, expect_len)) {
+ tt_abort_msg("Data from add_file differs.");
+ }
+
+ evbuffer_validate(dest);
+ end:
+ if (data)
+ free(data);
+ if (seg)
+ evbuffer_file_segment_free(seg);
+ if (src)
+ evbuffer_free(src);
+ if (dest)
+ evbuffer_free(dest);
+ if (pair[0] >= 0)
+ evutil_closesocket(pair[0]);
+ if (pair[1] >= 0)
+ evutil_closesocket(pair[1]);
+ if (wev)
+ event_free(wev);
+ if (rev)
+ event_free(rev);
+ if (tmpfilename) {
+ unlink(tmpfilename);
+ free(tmpfilename);
+ }
+}
+
+static int file_segment_cleanup_cb_called_count = 0;
+static struct evbuffer_file_segment const* file_segment_cleanup_cb_called_with = NULL;
+static int file_segment_cleanup_cb_called_with_flags = 0;
+static void* file_segment_cleanup_cb_called_with_arg = NULL;
+static void
+file_segment_cleanup_cp(struct evbuffer_file_segment const* seg, int flags, void* arg)
+{
+ ++file_segment_cleanup_cb_called_count;
+ file_segment_cleanup_cb_called_with = seg;
+ file_segment_cleanup_cb_called_with_flags = flags;
+ file_segment_cleanup_cb_called_with_arg = arg;
+}
+
+static void
+test_evbuffer_file_segment_add_cleanup_cb(void* ptr)
+{
+ char *tmpfilename = NULL;
+ int fd = -1;
+ struct evbuffer *evb = NULL;
+ struct evbuffer_file_segment *seg = NULL, *segptr;
+ char const* arg = "token";
+
+ fd = regress_make_tmpfile("file_segment_test_file", 22, &tmpfilename);
+ tt_int_op(fd, >=, 0);
+
+ evb = evbuffer_new();
+ tt_assert(evb);
+
+ segptr = seg = evbuffer_file_segment_new(fd, 0, -1, 0);
+ tt_assert(seg);
+
+ evbuffer_file_segment_add_cleanup_cb(
+ seg, &file_segment_cleanup_cp, (void*)arg);
+
+ tt_assert(fd != -1);
+
+ tt_assert(evbuffer_add_file_segment(evb, seg, 0, -1)!=-1);
+
+ evbuffer_validate(evb);
+
+ tt_int_op(file_segment_cleanup_cb_called_count, ==, 0);
+ evbuffer_file_segment_free(seg);
+ seg = NULL; /* Prevent double-free. */
+
+ tt_int_op(file_segment_cleanup_cb_called_count, ==, 0);
+ evbuffer_free(evb);
+ evb = NULL; /* pevent double-free */
+
+ tt_int_op(file_segment_cleanup_cb_called_count, ==, 1);
+ tt_assert(file_segment_cleanup_cb_called_with == segptr);
+ tt_assert(file_segment_cleanup_cb_called_with_flags == 0);
+ tt_assert(file_segment_cleanup_cb_called_with_arg == (void*)arg);
+
+end:
+ if (evb)
+ evbuffer_free(evb);
+ if (seg)
+ evbuffer_file_segment_free(seg);
+ if (tmpfilename) {
+ unlink(tmpfilename);
+ free(tmpfilename);
+ }
+}
+
+#ifndef EVENT__DISABLE_MM_REPLACEMENT
+static void *
+failing_malloc(size_t how_much)
+{
+ errno = ENOMEM;
+ return NULL;
+}
+#endif
+
+static void
+test_evbuffer_readln(void *ptr)
+{
+ struct evbuffer *evb = evbuffer_new();
+ struct evbuffer *evb_tmp = evbuffer_new();
+ const char *s;
+ char *cp = NULL;
+ size_t sz;
+
+#define tt_line_eq(content) \
+ TT_STMT_BEGIN \
+ if (!cp || sz != strlen(content) || strcmp(cp, content)) { \
+ TT_DIE(("Wanted %s; got %s [%d]", content, cp, (int)sz)); \
+ } \
+ TT_STMT_END
+
+ /* Test EOL_ANY. */
+ s = "complex silly newline\r\n\n\r\n\n\rmore\0\n";
+ evbuffer_add(evb, s, strlen(s)+2);
+ evbuffer_validate(evb);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_ANY);
+ tt_line_eq("complex silly newline");
+ free(cp);
+ evbuffer_validate(evb);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_ANY);
+ if (!cp || sz != 5 || memcmp(cp, "more\0\0", 6))
+ tt_abort_msg("Not as expected");
+ tt_uint_op(evbuffer_get_length(evb), ==, 0);
+ evbuffer_validate(evb);
+ s = "\nno newline";
+ evbuffer_add(evb, s, strlen(s));
+ free(cp);
+ evbuffer_validate(evb);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_ANY);
+ tt_line_eq("");
+ free(cp);
+ evbuffer_validate(evb);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_ANY);
+ tt_assert(!cp);
+ evbuffer_validate(evb);
+ evbuffer_drain(evb, evbuffer_get_length(evb));
+ tt_assert(evbuffer_get_length(evb) == 0);
+ evbuffer_validate(evb);
+
+ /* Test EOL_CRLF */
+ s = "Line with\rin the middle\nLine with good crlf\r\n\nfinal\n";
+ evbuffer_add(evb, s, strlen(s));
+ evbuffer_validate(evb);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF);
+ tt_line_eq("Line with\rin the middle");
+ free(cp);
+ evbuffer_validate(evb);
+
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF);
+ tt_line_eq("Line with good crlf");
+ free(cp);
+ evbuffer_validate(evb);
+
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF);
+ tt_line_eq("");
+ free(cp);
+ evbuffer_validate(evb);
+
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF);
+ tt_line_eq("final");
+ s = "x";
+ evbuffer_validate(evb);
+ evbuffer_add(evb, s, 1);
+ evbuffer_validate(evb);
+ free(cp);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF);
+ tt_assert(!cp);
+ evbuffer_validate(evb);
+
+ /* Test CRLF_STRICT */
+ s = " and a bad crlf\nand a good one\r\n\r\nMore\r";
+ evbuffer_add(evb, s, strlen(s));
+ evbuffer_validate(evb);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT);
+ tt_line_eq("x and a bad crlf\nand a good one");
+ free(cp);
+ evbuffer_validate(evb);
+
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT);
+ tt_line_eq("");
+ free(cp);
+ evbuffer_validate(evb);
+
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT);
+ tt_assert(!cp);
+ evbuffer_validate(evb);
+ evbuffer_add(evb, "\n", 1);
+ evbuffer_validate(evb);
+
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT);
+ tt_line_eq("More");
+ free(cp);
+ tt_assert(evbuffer_get_length(evb) == 0);
+ evbuffer_validate(evb);
+
+ s = "An internal CR\r is not an eol\r\nNor is a lack of one";
+ evbuffer_add(evb, s, strlen(s));
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT);
+ tt_line_eq("An internal CR\r is not an eol");
+ free(cp);
+ evbuffer_validate(evb);
+
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT);
+ tt_assert(!cp);
+ evbuffer_validate(evb);
+
+ evbuffer_add(evb, "\r\n", 2);
+ evbuffer_validate(evb);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT);
+ tt_line_eq("Nor is a lack of one");
+ free(cp);
+ tt_assert(evbuffer_get_length(evb) == 0);
+ evbuffer_validate(evb);
+
+ /* Test LF */
+ s = "An\rand a nl\n\nText";
+ evbuffer_add(evb, s, strlen(s));
+ evbuffer_validate(evb);
+
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_LF);
+ tt_line_eq("An\rand a nl");
+ free(cp);
+ evbuffer_validate(evb);
+
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_LF);
+ tt_line_eq("");
+ free(cp);
+ evbuffer_validate(evb);
+
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_LF);
+ tt_assert(!cp);
+ free(cp);
+ evbuffer_add(evb, "\n", 1);
+ evbuffer_validate(evb);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_LF);
+ tt_line_eq("Text");
+ free(cp);
+ evbuffer_validate(evb);
+
+ /* Test NUL */
+ tt_int_op(evbuffer_get_length(evb), ==, 0);
+ {
+ char x[] =
+ "NUL\n\0\0"
+ "The all-zeros character which may serve\0"
+ "to accomplish time fill\0and media fill";
+ /* Add all but the final NUL of x. */
+ evbuffer_add(evb, x, sizeof(x)-1);
+ }
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_NUL);
+ tt_line_eq("NUL\n");
+ free(cp);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_NUL);
+ tt_line_eq("");
+ free(cp);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_NUL);
+ tt_line_eq("The all-zeros character which may serve");
+ free(cp);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_NUL);
+ tt_line_eq("to accomplish time fill");
+ free(cp);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_NUL);
+ tt_ptr_op(cp, ==, NULL);
+ evbuffer_drain(evb, -1);
+
+ /* Test CRLF_STRICT - across boundaries*/
+ s = " and a bad crlf\nand a good one\r";
+ evbuffer_add(evb_tmp, s, strlen(s));
+ evbuffer_validate(evb);
+ evbuffer_add_buffer(evb, evb_tmp);
+ evbuffer_validate(evb);
+ s = "\n\r";
+ evbuffer_add(evb_tmp, s, strlen(s));
+ evbuffer_validate(evb);
+ evbuffer_add_buffer(evb, evb_tmp);
+ evbuffer_validate(evb);
+ s = "\nMore\r";
+ evbuffer_add(evb_tmp, s, strlen(s));
+ evbuffer_validate(evb);
+ evbuffer_add_buffer(evb, evb_tmp);
+ evbuffer_validate(evb);
+
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT);
+ tt_line_eq(" and a bad crlf\nand a good one");
+ free(cp);
+ evbuffer_validate(evb);
+
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT);
+ tt_line_eq("");
+ free(cp);
+ evbuffer_validate(evb);
+
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT);
+ tt_assert(!cp);
+ free(cp);
+ evbuffer_validate(evb);
+ evbuffer_add(evb, "\n", 1);
+ evbuffer_validate(evb);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT);
+ tt_line_eq("More");
+ free(cp); cp = NULL;
+ evbuffer_validate(evb);
+ tt_assert(evbuffer_get_length(evb) == 0);
+
+ /* Test memory problem*/
+ s = "one line\ntwo line\nblue line";
+ evbuffer_add(evb_tmp, s, strlen(s));
+ evbuffer_validate(evb);
+ evbuffer_add_buffer(evb, evb_tmp);
+ evbuffer_validate(evb);
+
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_LF);
+ tt_line_eq("one line");
+ free(cp); cp = NULL;
+ evbuffer_validate(evb);
+
+ /* the next call to readline should fail */
+#ifndef EVENT__DISABLE_MM_REPLACEMENT
+ event_set_mem_functions(failing_malloc, realloc, free);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_LF);
+ tt_assert(cp == NULL);
+ evbuffer_validate(evb);
+
+ /* now we should get the next line back */
+ event_set_mem_functions(malloc, realloc, free);
+#endif
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_LF);
+ tt_line_eq("two line");
+ free(cp); cp = NULL;
+ evbuffer_validate(evb);
+
+ end:
+ evbuffer_free(evb);
+ evbuffer_free(evb_tmp);
+ if (cp) free(cp);
+}
+
+static void
+test_evbuffer_search_eol(void *ptr)
+{
+ struct evbuffer *buf = evbuffer_new();
+ struct evbuffer_ptr ptr1, ptr2;
+ const char *s;
+ size_t eol_len;
+
+ s = "string! \r\n\r\nx\n";
+ evbuffer_add(buf, s, strlen(s));
+ eol_len = -1;
+ ptr1 = evbuffer_search_eol(buf, NULL, &eol_len, EVBUFFER_EOL_CRLF);
+ tt_int_op(ptr1.pos, ==, 8);
+ tt_int_op(eol_len, ==, 2);
+
+ eol_len = -1;
+ ptr2 = evbuffer_search_eol(buf, &ptr1, &eol_len, EVBUFFER_EOL_CRLF);
+ tt_int_op(ptr2.pos, ==, 8);
+ tt_int_op(eol_len, ==, 2);
+
+ evbuffer_ptr_set(buf, &ptr1, 1, EVBUFFER_PTR_ADD);
+ eol_len = -1;
+ ptr2 = evbuffer_search_eol(buf, &ptr1, &eol_len, EVBUFFER_EOL_CRLF);
+ tt_int_op(ptr2.pos, ==, 9);
+ tt_int_op(eol_len, ==, 1);
+
+ eol_len = -1;
+ ptr2 = evbuffer_search_eol(buf, &ptr1, &eol_len, EVBUFFER_EOL_CRLF_STRICT);
+ tt_int_op(ptr2.pos, ==, 10);
+ tt_int_op(eol_len, ==, 2);
+
+ eol_len = -1;
+ ptr1 = evbuffer_search_eol(buf, NULL, &eol_len, EVBUFFER_EOL_LF);
+ tt_int_op(ptr1.pos, ==, 9);
+ tt_int_op(eol_len, ==, 1);
+
+ eol_len = -1;
+ ptr2 = evbuffer_search_eol(buf, &ptr1, &eol_len, EVBUFFER_EOL_LF);
+ tt_int_op(ptr2.pos, ==, 9);
+ tt_int_op(eol_len, ==, 1);
+
+ evbuffer_ptr_set(buf, &ptr1, 1, EVBUFFER_PTR_ADD);
+ eol_len = -1;
+ ptr2 = evbuffer_search_eol(buf, &ptr1, &eol_len, EVBUFFER_EOL_LF);
+ tt_int_op(ptr2.pos, ==, 11);
+ tt_int_op(eol_len, ==, 1);
+
+ tt_assert(evbuffer_ptr_set(buf, &ptr1, evbuffer_get_length(buf), EVBUFFER_PTR_SET) == 0);
+ eol_len = -1;
+ ptr2 = evbuffer_search_eol(buf, &ptr1, &eol_len, EVBUFFER_EOL_LF);
+ tt_int_op(ptr2.pos, ==, -1);
+ tt_int_op(eol_len, ==, 0);
+
+end:
+ evbuffer_free(buf);
+}
+
+static void
+test_evbuffer_iterative(void *ptr)
+{
+ struct evbuffer *buf = evbuffer_new();
+ const char *abc = "abcdefghijklmnopqrstvuwxyzabcdefghijklmnopqrstvuwxyzabcdefghijklmnopqrstvuwxyzabcdefghijklmnopqrstvuwxyz";
+ unsigned i, j, sum, n;
+
+ sum = 0;
+ n = 0;
+ for (i = 0; i < 1000; ++i) {
+ for (j = 1; j < strlen(abc); ++j) {
+ char format[32];
+ evutil_snprintf(format, sizeof(format), "%%%u.%us", j, j);
+ evbuffer_add_printf(buf, format, abc);
+
+ /* Only check for rep violations every so often.
+ Walking over the whole list of chains can get
+ pretty expensive as it gets long.
+ */
+ if ((n % 337) == 0)
+ evbuffer_validate(buf);
+
+ sum += j;
+ n++;
+ }
+ }
+ evbuffer_validate(buf);
+
+ tt_uint_op(sum, ==, evbuffer_get_length(buf));
+
+ {
+ size_t a,w,u;
+ a=w=u=0;
+ evbuffer_get_waste(buf, &a, &w, &u);
+ if (0)
+ printf("Allocated: %u.\nWasted: %u.\nUsed: %u.",
+ (unsigned)a, (unsigned)w, (unsigned)u);
+ tt_assert( ((double)w)/a < .125);
+ }
+ end:
+ evbuffer_free(buf);
+
+}
+
+static void
+test_evbuffer_find(void *ptr)
+{
+ unsigned char* p;
+ const char* test1 = "1234567890\r\n";
+ const char* test2 = "1234567890\r";
+#define EVBUFFER_INITIAL_LENGTH 256
+ char test3[EVBUFFER_INITIAL_LENGTH];
+ unsigned int i;
+ struct evbuffer * buf = evbuffer_new();
+
+ tt_assert(buf);
+
+ /* make sure evbuffer_find doesn't match past the end of the buffer */
+ evbuffer_add(buf, (unsigned char*)test1, strlen(test1));
+ evbuffer_validate(buf);
+ evbuffer_drain(buf, strlen(test1));
+ evbuffer_validate(buf);
+ evbuffer_add(buf, (unsigned char*)test2, strlen(test2));
+ evbuffer_validate(buf);
+ p = evbuffer_find(buf, (unsigned char*)"\r\n", 2);
+ tt_want(p == NULL);
+
+ /*
+ * drain the buffer and do another find; in r309 this would
+ * read past the allocated buffer causing a valgrind error.
+ */
+ evbuffer_drain(buf, strlen(test2));
+ evbuffer_validate(buf);
+ for (i = 0; i < EVBUFFER_INITIAL_LENGTH; ++i)
+ test3[i] = 'a';
+ test3[EVBUFFER_INITIAL_LENGTH - 1] = 'x';
+ evbuffer_add(buf, (unsigned char *)test3, EVBUFFER_INITIAL_LENGTH);
+ evbuffer_validate(buf);
+ p = evbuffer_find(buf, (unsigned char *)"xy", 2);
+ tt_want(p == NULL);
+
+ /* simple test for match at end of allocated buffer */
+ p = evbuffer_find(buf, (unsigned char *)"ax", 2);
+ tt_assert(p != NULL);
+ tt_want(strncmp((char*)p, "ax", 2) == 0);
+
+end:
+ if (buf)
+ evbuffer_free(buf);
+}
+
+static void
+test_evbuffer_ptr_set(void *ptr)
+{
+ struct evbuffer *buf = evbuffer_new();
+ struct evbuffer_ptr pos;
+ struct evbuffer_iovec v[1];
+
+ tt_assert(buf);
+
+ tt_int_op(evbuffer_get_length(buf), ==, 0);
+
+ tt_assert(evbuffer_ptr_set(buf, &pos, 0, EVBUFFER_PTR_SET) == 0);
+ tt_assert(pos.pos == 0);
+ tt_assert(evbuffer_ptr_set(buf, &pos, 1, EVBUFFER_PTR_ADD) == -1);
+ tt_assert(pos.pos == -1);
+ tt_assert(evbuffer_ptr_set(buf, &pos, 1, EVBUFFER_PTR_SET) == -1);
+ tt_assert(pos.pos == -1);
+
+ /* create some chains */
+ evbuffer_reserve_space(buf, 5000, v, 1);
+ v[0].iov_len = 5000;
+ memset(v[0].iov_base, 1, v[0].iov_len);
+ evbuffer_commit_space(buf, v, 1);
+ evbuffer_validate(buf);
+
+ evbuffer_reserve_space(buf, 4000, v, 1);
+ v[0].iov_len = 4000;
+ memset(v[0].iov_base, 2, v[0].iov_len);
+ evbuffer_commit_space(buf, v, 1);
+
+ evbuffer_reserve_space(buf, 3000, v, 1);
+ v[0].iov_len = 3000;
+ memset(v[0].iov_base, 3, v[0].iov_len);
+ evbuffer_commit_space(buf, v, 1);
+ evbuffer_validate(buf);
+
+ tt_int_op(evbuffer_get_length(buf), ==, 12000);
+
+ tt_assert(evbuffer_ptr_set(buf, &pos, 13000, EVBUFFER_PTR_SET) == -1);
+ tt_assert(pos.pos == -1);
+ tt_assert(evbuffer_ptr_set(buf, &pos, 0, EVBUFFER_PTR_SET) == 0);
+ tt_assert(pos.pos == 0);
+ tt_assert(evbuffer_ptr_set(buf, &pos, 13000, EVBUFFER_PTR_ADD) == -1);
+
+ tt_assert(evbuffer_ptr_set(buf, &pos, 0, EVBUFFER_PTR_SET) == 0);
+ tt_assert(pos.pos == 0);
+ tt_assert(evbuffer_ptr_set(buf, &pos, 10000, EVBUFFER_PTR_ADD) == 0);
+ tt_assert(pos.pos == 10000);
+ tt_assert(evbuffer_ptr_set(buf, &pos, 1000, EVBUFFER_PTR_ADD) == 0);
+ tt_assert(pos.pos == 11000);
+ tt_assert(evbuffer_ptr_set(buf, &pos, 1000, EVBUFFER_PTR_ADD) == 0);
+ tt_assert(pos.pos == 12000);
+ tt_assert(evbuffer_ptr_set(buf, &pos, 1000, EVBUFFER_PTR_ADD) == -1);
+ tt_assert(pos.pos == -1);
+
+end:
+ if (buf)
+ evbuffer_free(buf);
+}
+
+static void
+test_evbuffer_search(void *ptr)
+{
+ struct evbuffer *buf = evbuffer_new();
+ struct evbuffer *tmp = evbuffer_new();
+ struct evbuffer_ptr pos, end;
+
+ tt_assert(buf);
+ tt_assert(tmp);
+
+ pos = evbuffer_search(buf, "x", 1, NULL);
+ tt_int_op(pos.pos, ==, -1);
+ tt_assert(evbuffer_ptr_set(buf, &pos, 0, EVBUFFER_PTR_SET) == 0);
+ pos = evbuffer_search(buf, "x", 1, &pos);
+ tt_int_op(pos.pos, ==, -1);
+ tt_assert(evbuffer_ptr_set(buf, &pos, 0, EVBUFFER_PTR_SET) == 0);
+ pos = evbuffer_search_range(buf, "x", 1, &pos, &pos);
+ tt_int_op(pos.pos, ==, -1);
+ tt_assert(evbuffer_ptr_set(buf, &pos, 0, EVBUFFER_PTR_SET) == 0);
+ pos = evbuffer_search_range(buf, "x", 1, &pos, NULL);
+ tt_int_op(pos.pos, ==, -1);
+
+ /* set up our chains */
+ evbuffer_add_printf(tmp, "hello"); /* 5 chars */
+ evbuffer_add_buffer(buf, tmp);
+ evbuffer_add_printf(tmp, "foo"); /* 3 chars */
+ evbuffer_add_buffer(buf, tmp);
+ evbuffer_add_printf(tmp, "cat"); /* 3 chars */
+ evbuffer_add_buffer(buf, tmp);
+ evbuffer_add_printf(tmp, "attack");
+ evbuffer_add_buffer(buf, tmp);
+
+ pos = evbuffer_search(buf, "attack", 6, NULL);
+ tt_int_op(pos.pos, ==, 11);
+ pos = evbuffer_search(buf, "attacker", 8, NULL);
+ tt_int_op(pos.pos, ==, -1);
+
+ /* test continuing search */
+ pos = evbuffer_search(buf, "oc", 2, NULL);
+ tt_int_op(pos.pos, ==, 7);
+ pos = evbuffer_search(buf, "cat", 3, &pos);
+ tt_int_op(pos.pos, ==, 8);
+ pos = evbuffer_search(buf, "tacking", 7, &pos);
+ tt_int_op(pos.pos, ==, -1);
+
+ evbuffer_ptr_set(buf, &pos, 5, EVBUFFER_PTR_SET);
+ pos = evbuffer_search(buf, "foo", 3, &pos);
+ tt_int_op(pos.pos, ==, 5);
+
+ evbuffer_ptr_set(buf, &pos, 2, EVBUFFER_PTR_ADD);
+ pos = evbuffer_search(buf, "tat", 3, &pos);
+ tt_int_op(pos.pos, ==, 10);
+
+ /* test bounded search. */
+ /* Set "end" to the first t in "attack". */
+ evbuffer_ptr_set(buf, &end, 12, EVBUFFER_PTR_SET);
+ pos = evbuffer_search_range(buf, "foo", 3, NULL, &end);
+ tt_int_op(pos.pos, ==, 5);
+ pos = evbuffer_search_range(buf, "foocata", 7, NULL, &end);
+ tt_int_op(pos.pos, ==, 5);
+ pos = evbuffer_search_range(buf, "foocatat", 8, NULL, &end);
+ tt_int_op(pos.pos, ==, -1);
+ pos = evbuffer_search_range(buf, "ack", 3, NULL, &end);
+ tt_int_op(pos.pos, ==, -1);
+
+ /* Set "end" after the last byte in the buffer. */
+ tt_assert(evbuffer_ptr_set(buf, &end, 17, EVBUFFER_PTR_SET) == 0);
+
+ pos = evbuffer_search_range(buf, "attack", 6, NULL, &end);
+ tt_int_op(pos.pos, ==, 11);
+ tt_assert(evbuffer_ptr_set(buf, &pos, 11, EVBUFFER_PTR_SET) == 0);
+ pos = evbuffer_search_range(buf, "attack", 6, &pos, &end);
+ tt_int_op(pos.pos, ==, 11);
+ tt_assert(evbuffer_ptr_set(buf, &pos, 17, EVBUFFER_PTR_SET) == 0);
+ pos = evbuffer_search_range(buf, "attack", 6, &pos, &end);
+ tt_int_op(pos.pos, ==, -1);
+ tt_assert(evbuffer_ptr_set(buf, &pos, 17, EVBUFFER_PTR_SET) == 0);
+ pos = evbuffer_search_range(buf, "attack", 6, &pos, NULL);
+ tt_int_op(pos.pos, ==, -1);
+
+end:
+ if (buf)
+ evbuffer_free(buf);
+ if (tmp)
+ evbuffer_free(tmp);
+}
+
+static void
+log_change_callback(struct evbuffer *buffer,
+ const struct evbuffer_cb_info *cbinfo,
+ void *arg)
+{
+
+ size_t old_len = cbinfo->orig_size;
+ size_t new_len = old_len + cbinfo->n_added - cbinfo->n_deleted;
+ struct evbuffer *out = arg;
+ evbuffer_add_printf(out, "%lu->%lu; ", (unsigned long)old_len,
+ (unsigned long)new_len);
+}
+static void
+self_draining_callback(struct evbuffer *evbuffer, size_t old_len,
+ size_t new_len, void *arg)
+{
+ if (new_len > old_len)
+ evbuffer_drain(evbuffer, new_len);
+}
+
+static void
+test_evbuffer_callbacks(void *ptr)
+{
+ struct evbuffer *buf = evbuffer_new();
+ struct evbuffer *buf_out1 = evbuffer_new();
+ struct evbuffer *buf_out2 = evbuffer_new();
+ struct evbuffer_cb_entry *cb1, *cb2;
+
+ tt_assert(buf);
+ tt_assert(buf_out1);
+ tt_assert(buf_out2);
+
+ cb1 = evbuffer_add_cb(buf, log_change_callback, buf_out1);
+ cb2 = evbuffer_add_cb(buf, log_change_callback, buf_out2);
+
+ /* Let's run through adding and deleting some stuff from the buffer
+ * and turning the callbacks on and off and removing them. The callback
+ * adds a summary of length changes to buf_out1/buf_out2 when called. */
+ /* size: 0-> 36. */
+ evbuffer_add_printf(buf, "The %d magic words are spotty pudding", 2);
+ evbuffer_validate(buf);
+ evbuffer_cb_clear_flags(buf, cb2, EVBUFFER_CB_ENABLED);
+ evbuffer_drain(buf, 10); /*36->26*/
+ evbuffer_validate(buf);
+ evbuffer_prepend(buf, "Hello", 5);/*26->31*/
+ evbuffer_cb_set_flags(buf, cb2, EVBUFFER_CB_ENABLED);
+ evbuffer_add_reference(buf, "Goodbye", 7, NULL, NULL); /*31->38*/
+ evbuffer_remove_cb_entry(buf, cb1);
+ evbuffer_validate(buf);
+ evbuffer_drain(buf, evbuffer_get_length(buf)); /*38->0*/;
+ tt_assert(-1 == evbuffer_remove_cb(buf, log_change_callback, NULL));
+ evbuffer_add(buf, "X", 1); /* 0->1 */
+ tt_assert(!evbuffer_remove_cb(buf, log_change_callback, buf_out2));
+ evbuffer_validate(buf);
+
+ tt_str_op((const char *) evbuffer_pullup(buf_out1, -1), ==,
+ "0->36; 36->26; 26->31; 31->38; ");
+ tt_str_op((const char *) evbuffer_pullup(buf_out2, -1), ==,
+ "0->36; 31->38; 38->0; 0->1; ");
+ evbuffer_drain(buf_out1, evbuffer_get_length(buf_out1));
+ evbuffer_drain(buf_out2, evbuffer_get_length(buf_out2));
+ /* Let's test the obsolete buffer_setcb function too. */
+ cb1 = evbuffer_add_cb(buf, log_change_callback, buf_out1);
+ tt_assert(cb1 != NULL);
+ cb2 = evbuffer_add_cb(buf, log_change_callback, buf_out2);
+ tt_assert(cb2 != NULL);
+ evbuffer_setcb(buf, self_draining_callback, NULL);
+ evbuffer_add_printf(buf, "This should get drained right away.");
+ tt_uint_op(evbuffer_get_length(buf), ==, 0);
+ tt_uint_op(evbuffer_get_length(buf_out1), ==, 0);
+ tt_uint_op(evbuffer_get_length(buf_out2), ==, 0);
+ evbuffer_setcb(buf, NULL, NULL);
+ evbuffer_add_printf(buf, "This will not.");
+ tt_str_op((const char *) evbuffer_pullup(buf, -1), ==, "This will not.");
+ evbuffer_validate(buf);
+ evbuffer_drain(buf, evbuffer_get_length(buf));
+ evbuffer_validate(buf);
+#if 0
+ /* Now let's try a suspended callback. */
+ cb1 = evbuffer_add_cb(buf, log_change_callback, buf_out1);
+ cb2 = evbuffer_add_cb(buf, log_change_callback, buf_out2);
+ evbuffer_cb_suspend(buf,cb2);
+ evbuffer_prepend(buf,"Hello world",11); /*0->11*/
+ evbuffer_validate(buf);
+ evbuffer_cb_suspend(buf,cb1);
+ evbuffer_add(buf,"more",4); /* 11->15 */
+ evbuffer_cb_unsuspend(buf,cb2);
+ evbuffer_drain(buf, 4); /* 15->11 */
+ evbuffer_cb_unsuspend(buf,cb1);
+ evbuffer_drain(buf, evbuffer_get_length(buf)); /* 11->0 */
+
+ tt_str_op(evbuffer_pullup(buf_out1, -1), ==,
+ "0->11; 11->11; 11->0; ");
+ tt_str_op(evbuffer_pullup(buf_out2, -1), ==,
+ "0->15; 15->11; 11->0; ");
+#endif
+
+ end:
+ if (buf)
+ evbuffer_free(buf);
+ if (buf_out1)
+ evbuffer_free(buf_out1);
+ if (buf_out2)
+ evbuffer_free(buf_out2);
+}
+
+static int ref_done_cb_called_count = 0;
+static void *ref_done_cb_called_with = NULL;
+static const void *ref_done_cb_called_with_data = NULL;
+static size_t ref_done_cb_called_with_len = 0;
+static void ref_done_cb(const void *data, size_t len, void *info)
+{
+ ++ref_done_cb_called_count;
+ ref_done_cb_called_with = info;
+ ref_done_cb_called_with_data = data;
+ ref_done_cb_called_with_len = len;
+}
+
+static void
+test_evbuffer_add_reference(void *ptr)
+{
+ const char chunk1[] = "If you have found the answer to such a problem";
+ const char chunk2[] = "you ought to write it up for publication";
+ /* -- Knuth's "Notes on the Exercises" from TAOCP */
+ char tmp[16];
+ size_t len1 = strlen(chunk1), len2=strlen(chunk2);
+
+ struct evbuffer *buf1 = NULL, *buf2 = NULL;
+
+ buf1 = evbuffer_new();
+ tt_assert(buf1);
+
+ evbuffer_add_reference(buf1, chunk1, len1, ref_done_cb, (void*)111);
+ evbuffer_add(buf1, ", ", 2);
+ evbuffer_add_reference(buf1, chunk2, len2, ref_done_cb, (void*)222);
+ tt_int_op(evbuffer_get_length(buf1), ==, len1+len2+2);
+
+ /* Make sure we can drain a little from a reference. */
+ tt_int_op(evbuffer_remove(buf1, tmp, 6), ==, 6);
+ tt_int_op(memcmp(tmp, "If you", 6), ==, 0);
+ tt_int_op(evbuffer_remove(buf1, tmp, 5), ==, 5);
+ tt_int_op(memcmp(tmp, " have", 5), ==, 0);
+
+ /* Make sure that prepending does not meddle with immutable data */
+ tt_int_op(evbuffer_prepend(buf1, "I have ", 7), ==, 0);
+ tt_int_op(memcmp(chunk1, "If you", 6), ==, 0);
+ evbuffer_validate(buf1);
+
+ /* Make sure that when the chunk is over, the callback is invoked. */
+ evbuffer_drain(buf1, 7); /* Remove prepended stuff. */
+ evbuffer_drain(buf1, len1-11-1); /* remove all but one byte of chunk1 */
+ tt_int_op(ref_done_cb_called_count, ==, 0);
+ evbuffer_remove(buf1, tmp, 1);
+ tt_int_op(tmp[0], ==, 'm');
+ tt_assert(ref_done_cb_called_with == (void*)111);
+ tt_assert(ref_done_cb_called_with_data == chunk1);
+ tt_assert(ref_done_cb_called_with_len == len1);
+ tt_int_op(ref_done_cb_called_count, ==, 1);
+ evbuffer_validate(buf1);
+
+ /* Drain some of the remaining chunk, then add it to another buffer */
+ evbuffer_drain(buf1, 6); /* Remove the ", you ". */
+ buf2 = evbuffer_new();
+ tt_assert(buf2);
+ tt_int_op(ref_done_cb_called_count, ==, 1);
+ evbuffer_add(buf2, "I ", 2);
+
+ evbuffer_add_buffer(buf2, buf1);
+ tt_int_op(ref_done_cb_called_count, ==, 1);
+ evbuffer_remove(buf2, tmp, 16);
+ tt_int_op(memcmp("I ought to write", tmp, 16), ==, 0);
+ evbuffer_drain(buf2, evbuffer_get_length(buf2));
+ tt_int_op(ref_done_cb_called_count, ==, 2);
+ tt_assert(ref_done_cb_called_with == (void*)222);
+ evbuffer_validate(buf2);
+
+ /* Now add more stuff to buf1 and make sure that it gets removed on
+ * free. */
+ evbuffer_add(buf1, "You shake and shake the ", 24);
+ evbuffer_add_reference(buf1, "ketchup bottle", 14, ref_done_cb,
+ (void*)3333);
+ evbuffer_add(buf1, ". Nothing comes and then a lot'll.", 35);
+ evbuffer_free(buf1);
+ buf1 = NULL;
+ tt_int_op(ref_done_cb_called_count, ==, 3);
+ tt_assert(ref_done_cb_called_with == (void*)3333);
+
+end:
+ if (buf1)
+ evbuffer_free(buf1);
+ if (buf2)
+ evbuffer_free(buf2);
+}
+
+static void
+test_evbuffer_multicast(void *ptr)
+{
+ const char chunk1[] = "If you have found the answer to such a problem";
+ const char chunk2[] = "you ought to write it up for publication";
+ /* -- Knuth's "Notes on the Exercises" from TAOCP */
+ char tmp[16];
+ size_t len1 = strlen(chunk1), len2=strlen(chunk2);
+
+ struct evbuffer *buf1 = NULL, *buf2 = NULL;
+
+ buf1 = evbuffer_new();
+ tt_assert(buf1);
+
+ evbuffer_add(buf1, chunk1, len1);
+ evbuffer_add(buf1, ", ", 2);
+ evbuffer_add(buf1, chunk2, len2);
+ tt_int_op(evbuffer_get_length(buf1), ==, len1+len2+2);
+
+ buf2 = evbuffer_new();
+ tt_assert(buf2);
+
+ tt_int_op(evbuffer_add_buffer_reference(buf2, buf1), ==, 0);
+ /* nested references are not allowed */
+ tt_int_op(evbuffer_add_buffer_reference(buf2, buf2), ==, -1);
+ tt_int_op(evbuffer_add_buffer_reference(buf1, buf2), ==, -1);
+
+ /* both buffers contain the same amount of data */
+ tt_int_op(evbuffer_get_length(buf1), ==, evbuffer_get_length(buf1));
+
+ /* Make sure we can drain a little from the first buffer. */
+ tt_int_op(evbuffer_remove(buf1, tmp, 6), ==, 6);
+ tt_int_op(memcmp(tmp, "If you", 6), ==, 0);
+ tt_int_op(evbuffer_remove(buf1, tmp, 5), ==, 5);
+ tt_int_op(memcmp(tmp, " have", 5), ==, 0);
+
+ /* Make sure that prepending does not meddle with immutable data */
+ tt_int_op(evbuffer_prepend(buf1, "I have ", 7), ==, 0);
+ tt_int_op(memcmp(chunk1, "If you", 6), ==, 0);
+ evbuffer_validate(buf1);
+
+ /* Make sure we can drain a little from the second buffer. */
+ tt_int_op(evbuffer_remove(buf2, tmp, 6), ==, 6);
+ tt_int_op(memcmp(tmp, "If you", 6), ==, 0);
+ tt_int_op(evbuffer_remove(buf2, tmp, 5), ==, 5);
+ tt_int_op(memcmp(tmp, " have", 5), ==, 0);
+
+ /* Make sure that prepending does not meddle with immutable data */
+ tt_int_op(evbuffer_prepend(buf2, "I have ", 7), ==, 0);
+ tt_int_op(memcmp(chunk1, "If you", 6), ==, 0);
+ evbuffer_validate(buf2);
+
+ /* Make sure the data can be read from the second buffer when the first is freed */
+ evbuffer_free(buf1);
+ buf1 = NULL;
+
+ tt_int_op(evbuffer_remove(buf2, tmp, 6), ==, 6);
+ tt_int_op(memcmp(tmp, "I have", 6), ==, 0);
+
+ tt_int_op(evbuffer_remove(buf2, tmp, 6), ==, 6);
+ tt_int_op(memcmp(tmp, " foun", 6), ==, 0);
+
+end:
+ if (buf1)
+ evbuffer_free(buf1);
+ if (buf2)
+ evbuffer_free(buf2);
+}
+
+static void
+test_evbuffer_multicast_drain(void *ptr)
+{
+ const char chunk1[] = "If you have found the answer to such a problem";
+ const char chunk2[] = "you ought to write it up for publication";
+ /* -- Knuth's "Notes on the Exercises" from TAOCP */
+ size_t len1 = strlen(chunk1), len2=strlen(chunk2);
+
+ struct evbuffer *buf1 = NULL, *buf2 = NULL;
+
+ buf1 = evbuffer_new();
+ tt_assert(buf1);
+
+ evbuffer_add(buf1, chunk1, len1);
+ evbuffer_add(buf1, ", ", 2);
+ evbuffer_add(buf1, chunk2, len2);
+ tt_int_op(evbuffer_get_length(buf1), ==, len1+len2+2);
+
+ buf2 = evbuffer_new();
+ tt_assert(buf2);
+
+ tt_int_op(evbuffer_add_buffer_reference(buf2, buf1), ==, 0);
+ tt_int_op(evbuffer_get_length(buf2), ==, len1+len2+2);
+ tt_int_op(evbuffer_drain(buf1, evbuffer_get_length(buf1)), ==, 0);
+ tt_int_op(evbuffer_get_length(buf2), ==, len1+len2+2);
+ tt_int_op(evbuffer_drain(buf2, evbuffer_get_length(buf2)), ==, 0);
+ evbuffer_validate(buf1);
+ evbuffer_validate(buf2);
+
+end:
+ if (buf1)
+ evbuffer_free(buf1);
+ if (buf2)
+ evbuffer_free(buf2);
+}
+
+/* Some cases that we didn't get in test_evbuffer() above, for more coverage. */
+static void
+test_evbuffer_prepend(void *ptr)
+{
+ struct evbuffer *buf1 = NULL, *buf2 = NULL;
+ char tmp[128];
+ int n;
+
+ buf1 = evbuffer_new();
+ tt_assert(buf1);
+
+ /* Case 0: The evbuffer is entirely empty. */
+ evbuffer_prepend(buf1, "This string has 29 characters", 29);
+ evbuffer_validate(buf1);
+
+ /* Case 1: Prepend goes entirely in new chunk. */
+ evbuffer_prepend(buf1, "Short.", 6);
+ evbuffer_validate(buf1);
+
+ /* Case 2: prepend goes entirely in first chunk. */
+ evbuffer_drain(buf1, 6+11);
+ evbuffer_prepend(buf1, "it", 2);
+ evbuffer_validate(buf1);
+ tt_assert(!memcmp(buf1->first->buffer+buf1->first->misalign,
+ "it has", 6));
+
+ /* Case 3: prepend is split over multiple chunks. */
+ evbuffer_prepend(buf1, "It is no longer true to say ", 28);
+ evbuffer_validate(buf1);
+ n = evbuffer_remove(buf1, tmp, sizeof(tmp)-1);
+ tt_int_op(n, >=, 0);
+ tmp[n]='\0';
+ tt_str_op(tmp,==,"It is no longer true to say it has 29 characters");
+
+ buf2 = evbuffer_new();
+ tt_assert(buf2);
+
+ /* Case 4: prepend a buffer to an empty buffer. */
+ n = 999;
+ evbuffer_add_printf(buf1, "Here is string %d. ", n++);
+ evbuffer_prepend_buffer(buf2, buf1);
+ evbuffer_validate(buf2);
+
+ /* Case 5: prepend a buffer to a nonempty buffer. */
+ evbuffer_add_printf(buf1, "Here is string %d. ", n++);
+ evbuffer_prepend_buffer(buf2, buf1);
+ evbuffer_validate(buf2);
+ evbuffer_validate(buf1);
+ n = evbuffer_remove(buf2, tmp, sizeof(tmp)-1);
+ tt_int_op(n, >=, 0);
+ tmp[n]='\0';
+ tt_str_op(tmp,==,"Here is string 1000. Here is string 999. ");
+
+end:
+ if (buf1)
+ evbuffer_free(buf1);
+ if (buf2)
+ evbuffer_free(buf2);
+
+}
+
+static void
+test_evbuffer_peek_first_gt(void *info)
+{
+ struct evbuffer *buf = NULL, *tmp_buf = NULL;
+ struct evbuffer_ptr ptr;
+ struct evbuffer_iovec v[2];
+
+ buf = evbuffer_new();
+ tmp_buf = evbuffer_new();
+ evbuffer_add_printf(tmp_buf, "Contents of chunk 100\n");
+ evbuffer_add_buffer(buf, tmp_buf);
+ evbuffer_add_printf(tmp_buf, "Contents of chunk 1\n");
+ evbuffer_add_buffer(buf, tmp_buf);
+
+ evbuffer_ptr_set(buf, &ptr, 0, EVBUFFER_PTR_SET);
+
+ /** The only case that matters*/
+ tt_int_op(evbuffer_peek(buf, -1, &ptr, NULL, 0), ==, 2);
+ /** Just in case */
+ tt_int_op(evbuffer_peek(buf, -1, &ptr, v, 2), ==, 2);
+
+ evbuffer_ptr_set(buf, &ptr, 20, EVBUFFER_PTR_ADD);
+ tt_int_op(evbuffer_peek(buf, -1, &ptr, NULL, 0), ==, 2);
+ tt_int_op(evbuffer_peek(buf, -1, &ptr, v, 2), ==, 2);
+ tt_int_op(evbuffer_peek(buf, 2, &ptr, NULL, 0), ==, 1);
+ tt_int_op(evbuffer_peek(buf, 2, &ptr, v, 2), ==, 1);
+ tt_int_op(evbuffer_peek(buf, 3, &ptr, NULL, 0), ==, 2);
+ tt_int_op(evbuffer_peek(buf, 3, &ptr, v, 2), ==, 2);
+
+end:
+ if (buf)
+ evbuffer_free(buf);
+ if (tmp_buf)
+ evbuffer_free(tmp_buf);
+}
+
+static void
+test_evbuffer_peek(void *info)
+{
+ struct evbuffer *buf = NULL, *tmp_buf = NULL;
+ int i;
+ struct evbuffer_iovec v[20];
+ struct evbuffer_ptr ptr;
+
+#define tt_iov_eq(v, s) \
+ tt_int_op((v)->iov_len, ==, strlen(s)); \
+ tt_assert(!memcmp((v)->iov_base, (s), strlen(s)))
+
+ /* Let's make a very fragmented buffer. */
+ buf = evbuffer_new();
+ tmp_buf = evbuffer_new();
+ for (i = 0; i < 16; ++i) {
+ evbuffer_add_printf(tmp_buf, "Contents of chunk [%d]\n", i);
+ evbuffer_add_buffer(buf, tmp_buf);
+ }
+
+ /* How many chunks do we need for everything? */
+ i = evbuffer_peek(buf, -1, NULL, NULL, 0);
+ tt_int_op(i, ==, 16);
+
+ /* Simple peek: get everything. */
+ i = evbuffer_peek(buf, -1, NULL, v, 20);
+ tt_int_op(i, ==, 16); /* we used only 16 chunks. */
+ tt_iov_eq(&v[0], "Contents of chunk [0]\n");
+ tt_iov_eq(&v[3], "Contents of chunk [3]\n");
+ tt_iov_eq(&v[12], "Contents of chunk [12]\n");
+ tt_iov_eq(&v[15], "Contents of chunk [15]\n");
+
+ /* Just get one chunk worth. */
+ memset(v, 0, sizeof(v));
+ i = evbuffer_peek(buf, -1, NULL, v, 1);
+ tt_int_op(i, ==, 1);
+ tt_iov_eq(&v[0], "Contents of chunk [0]\n");
+ tt_assert(v[1].iov_base == NULL);
+
+ /* Suppose we want at least the first 40 bytes. */
+ memset(v, 0, sizeof(v));
+ i = evbuffer_peek(buf, 40, NULL, v, 16);
+ tt_int_op(i, ==, 2);
+ tt_iov_eq(&v[0], "Contents of chunk [0]\n");
+ tt_iov_eq(&v[1], "Contents of chunk [1]\n");
+ tt_assert(v[2].iov_base == NULL);
+
+ /* How many chunks do we need for 100 bytes? */
+ memset(v, 0, sizeof(v));
+ i = evbuffer_peek(buf, 100, NULL, NULL, 0);
+ tt_int_op(i, ==, 5);
+ tt_assert(v[0].iov_base == NULL);
+
+ /* Now we ask for more bytes than we provide chunks for */
+ memset(v, 0, sizeof(v));
+ i = evbuffer_peek(buf, 60, NULL, v, 1);
+ tt_int_op(i, ==, 3);
+ tt_iov_eq(&v[0], "Contents of chunk [0]\n");
+ tt_assert(v[1].iov_base == NULL);
+
+ /* Now we ask for more bytes than the buffer has. */
+ memset(v, 0, sizeof(v));
+ i = evbuffer_peek(buf, 65536, NULL, v, 20);
+ tt_int_op(i, ==, 16); /* we used only 16 chunks. */
+ tt_iov_eq(&v[0], "Contents of chunk [0]\n");
+ tt_iov_eq(&v[3], "Contents of chunk [3]\n");
+ tt_iov_eq(&v[12], "Contents of chunk [12]\n");
+ tt_iov_eq(&v[15], "Contents of chunk [15]\n");
+ tt_assert(v[16].iov_base == NULL);
+
+ /* What happens if we try an empty buffer? */
+ memset(v, 0, sizeof(v));
+ i = evbuffer_peek(tmp_buf, -1, NULL, v, 20);
+ tt_int_op(i, ==, 0);
+ tt_assert(v[0].iov_base == NULL);
+ memset(v, 0, sizeof(v));
+ i = evbuffer_peek(tmp_buf, 50, NULL, v, 20);
+ tt_int_op(i, ==, 0);
+ tt_assert(v[0].iov_base == NULL);
+
+ /* Okay, now time to have fun with pointers. */
+ memset(v, 0, sizeof(v));
+ evbuffer_ptr_set(buf, &ptr, 30, EVBUFFER_PTR_SET);
+ i = evbuffer_peek(buf, 50, &ptr, v, 20);
+ tt_int_op(i, ==, 3);
+ tt_iov_eq(&v[0], " of chunk [1]\n");
+ tt_iov_eq(&v[1], "Contents of chunk [2]\n");
+ tt_iov_eq(&v[2], "Contents of chunk [3]\n"); /*more than we asked for*/
+
+ /* advance to the start of another chain. */
+ memset(v, 0, sizeof(v));
+ evbuffer_ptr_set(buf, &ptr, 14, EVBUFFER_PTR_ADD);
+ i = evbuffer_peek(buf, 44, &ptr, v, 20);
+ tt_int_op(i, ==, 2);
+ tt_iov_eq(&v[0], "Contents of chunk [2]\n");
+ tt_iov_eq(&v[1], "Contents of chunk [3]\n"); /*more than we asked for*/
+
+ /* peek at the end of the buffer */
+ memset(v, 0, sizeof(v));
+ tt_assert(evbuffer_ptr_set(buf, &ptr, evbuffer_get_length(buf), EVBUFFER_PTR_SET) == 0);
+ i = evbuffer_peek(buf, 44, &ptr, v, 20);
+ tt_int_op(i, ==, 0);
+ tt_assert(v[0].iov_base == NULL);
+
+end:
+ if (buf)
+ evbuffer_free(buf);
+ if (tmp_buf)
+ evbuffer_free(tmp_buf);
+}
+
+/* Check whether evbuffer freezing works right. This is called twice,
+ once with the argument "start" and once with the argument "end".
+ When we test "start", we freeze the start of an evbuffer and make sure
+ that modifying the start of the buffer doesn't work. When we test
+ "end", we freeze the end of an evbuffer and make sure that modifying
+ the end of the buffer doesn't work.
+ */
+static void
+test_evbuffer_freeze(void *ptr)
+{
+ struct evbuffer *buf = NULL, *tmp_buf=NULL;
+ const char string[] = /* Year's End, Richard Wilbur */
+ "I've known the wind by water banks to shake\n"
+ "The late leaves down, which frozen where they fell\n"
+ "And held in ice as dancers in a spell\n"
+ "Fluttered all winter long into a lake...";
+ const int start = !strcmp(ptr, "start");
+ char *cp;
+ char charbuf[128];
+ int r;
+ size_t orig_length;
+ struct evbuffer_iovec v[1];
+
+ if (!start)
+ tt_str_op(ptr, ==, "end");
+
+ buf = evbuffer_new();
+ tmp_buf = evbuffer_new();
+ tt_assert(tmp_buf);
+
+ evbuffer_add(buf, string, strlen(string));
+ evbuffer_freeze(buf, start); /* Freeze the start or the end.*/
+
+#define FREEZE_EQ(a, startcase, endcase) \
+ do { \
+ if (start) { \
+ tt_int_op((a), ==, (startcase)); \
+ } else { \
+ tt_int_op((a), ==, (endcase)); \
+ } \
+ } while (0)
+
+
+ orig_length = evbuffer_get_length(buf);
+
+ /* These functions all manipulate the end of buf. */
+ r = evbuffer_add(buf, "abc", 0);
+ FREEZE_EQ(r, 0, -1);
+ r = evbuffer_reserve_space(buf, 10, v, 1);
+ FREEZE_EQ(r, 1, -1);
+ if (r == 1) {
+ memset(v[0].iov_base, 'X', 10);
+ v[0].iov_len = 10;
+ }
+ r = evbuffer_commit_space(buf, v, 1);
+ FREEZE_EQ(r, 0, -1);
+ r = evbuffer_add_reference(buf, string, 5, NULL, NULL);
+ FREEZE_EQ(r, 0, -1);
+ r = evbuffer_add_printf(buf, "Hello %s", "world");
+ FREEZE_EQ(r, 11, -1);
+ /* TODO: test add_buffer, add_file, read */
+
+ if (!start)
+ tt_int_op(orig_length, ==, evbuffer_get_length(buf));
+
+ orig_length = evbuffer_get_length(buf);
+
+ /* These functions all manipulate the start of buf. */
+ r = evbuffer_remove(buf, charbuf, 1);
+ FREEZE_EQ(r, -1, 1);
+ r = evbuffer_drain(buf, 3);
+ FREEZE_EQ(r, -1, 0);
+ r = evbuffer_prepend(buf, "dummy", 5);
+ FREEZE_EQ(r, -1, 0);
+ cp = evbuffer_readln(buf, NULL, EVBUFFER_EOL_LF);
+ FREEZE_EQ(cp==NULL, 1, 0);
+ if (cp)
+ free(cp);
+ /* TODO: Test remove_buffer, add_buffer, write, prepend_buffer */
+
+ if (start)
+ tt_int_op(orig_length, ==, evbuffer_get_length(buf));
+
+end:
+ if (buf)
+ evbuffer_free(buf);
+
+ if (tmp_buf)
+ evbuffer_free(tmp_buf);
+}
+
+static void
+test_evbuffer_add_iovec(void * ptr)
+{
+ struct evbuffer * buf = NULL;
+ struct evbuffer_iovec vec[4];
+ const char * data[] = {
+ "Guilt resembles a sword with two edges.",
+ "On the one hand, it cuts for Justice, imposing practical morality upon those who fear it.",
+ "Conscience does not always adhere to rational judgment.",
+ "Guilt is always a self-imposed burden, but it is not always rightly imposed."
+ /* -- R.A. Salvatore, _Sojurn_ */
+ };
+ size_t expected_length = 0;
+ size_t returned_length = 0;
+ int i;
+
+ buf = evbuffer_new();
+
+ tt_assert(buf);
+
+ for (i = 0; i < 4; i++) {
+ vec[i].iov_len = strlen(data[i]);
+ vec[i].iov_base = (char*) data[i];
+ expected_length += vec[i].iov_len;
+ }
+
+ returned_length = evbuffer_add_iovec(buf, vec, 4);
+
+ tt_int_op(returned_length, ==, evbuffer_get_length(buf));
+ tt_int_op(evbuffer_get_length(buf), ==, expected_length);
+
+ for (i = 0; i < 4; i++) {
+ char charbuf[1024];
+
+ memset(charbuf, 0, 1024);
+ evbuffer_remove(buf, charbuf, strlen(data[i]));
+ tt_assert(strcmp(charbuf, data[i]) == 0);
+ }
+
+ tt_assert(evbuffer_get_length(buf) == 0);
+end:
+ if (buf) {
+ evbuffer_free(buf);
+ }
+}
+
+static void
+test_evbuffer_copyout(void *dummy)
+{
+ const char string[] =
+ "Still they skirmish to and fro, men my messmates on the snow "
+ "When we headed off the aurochs turn for turn; "
+ "When the rich Allobrogenses never kept amanuenses, "
+ "And our only plots were piled in lakes at Berne.";
+ /* -- Kipling, "In The Neolithic Age" */
+ char tmp[1024];
+ struct evbuffer_ptr ptr;
+ struct evbuffer *buf;
+
+ (void)dummy;
+
+ buf = evbuffer_new();
+ tt_assert(buf);
+
+ tt_int_op(strlen(string), ==, 206);
+
+ /* Ensure separate chains */
+ evbuffer_add_reference(buf, string, 80, no_cleanup, NULL);
+ evbuffer_add_reference(buf, string+80, 80, no_cleanup, NULL);
+ evbuffer_add(buf, string+160, strlen(string)-160);
+
+ tt_int_op(206, ==, evbuffer_get_length(buf));
+
+ /* First, let's test plain old copyout. */
+
+ /* Copy a little from the beginning. */
+ tt_int_op(10, ==, evbuffer_copyout(buf, tmp, 10));
+ tt_int_op(0, ==, memcmp(tmp, "Still they", 10));
+
+ /* Now copy more than a little from the beginning */
+ memset(tmp, 0, sizeof(tmp));
+ tt_int_op(100, ==, evbuffer_copyout(buf, tmp, 100));
+ tt_int_op(0, ==, memcmp(tmp, string, 100));
+
+ /* Copy too much; ensure truncation. */
+ memset(tmp, 0, sizeof(tmp));
+ tt_int_op(206, ==, evbuffer_copyout(buf, tmp, 230));
+ tt_int_op(0, ==, memcmp(tmp, string, 206));
+
+ /* That was supposed to be nondestructive, btw */
+ tt_int_op(206, ==, evbuffer_get_length(buf));
+
+ /* Now it's time to test copyout_from! First, let's start in the
+ * first chain. */
+ evbuffer_ptr_set(buf, &ptr, 15, EVBUFFER_PTR_SET);
+ memset(tmp, 0, sizeof(tmp));
+ tt_int_op(10, ==, evbuffer_copyout_from(buf, &ptr, tmp, 10));
+ tt_int_op(0, ==, memcmp(tmp, "mish to an", 10));
+
+ /* Right up to the end of the first chain */
+ memset(tmp, 0, sizeof(tmp));
+ tt_int_op(65, ==, evbuffer_copyout_from(buf, &ptr, tmp, 65));
+ tt_int_op(0, ==, memcmp(tmp, string+15, 65));
+
+ /* Span into the second chain */
+ memset(tmp, 0, sizeof(tmp));
+ tt_int_op(90, ==, evbuffer_copyout_from(buf, &ptr, tmp, 90));
+ tt_int_op(0, ==, memcmp(tmp, string+15, 90));
+
+ /* Span into the third chain */
+ memset(tmp, 0, sizeof(tmp));
+ tt_int_op(160, ==, evbuffer_copyout_from(buf, &ptr, tmp, 160));
+ tt_int_op(0, ==, memcmp(tmp, string+15, 160));
+
+ /* Overrun */
+ memset(tmp, 0, sizeof(tmp));
+ tt_int_op(206-15, ==, evbuffer_copyout_from(buf, &ptr, tmp, 999));
+ tt_int_op(0, ==, memcmp(tmp, string+15, 206-15));
+
+ /* That was supposed to be nondestructive, too */
+ tt_int_op(206, ==, evbuffer_get_length(buf));
+
+end:
+ if (buf)
+ evbuffer_free(buf);
+}
+
+static void *
+setup_passthrough(const struct testcase_t *testcase)
+{
+ return testcase->setup_data;
+}
+static int
+cleanup_passthrough(const struct testcase_t *testcase, void *ptr)
+{
+ (void) ptr;
+ return 1;
+}
+
+static const struct testcase_setup_t nil_setup = {
+ setup_passthrough,
+ cleanup_passthrough
+};
+
+struct testcase_t evbuffer_testcases[] = {
+ { "evbuffer", test_evbuffer, 0, NULL, NULL },
+ { "remove_buffer_with_empty", test_evbuffer_remove_buffer_with_empty, 0, NULL, NULL },
+ { "reserve2", test_evbuffer_reserve2, 0, NULL, NULL },
+ { "reserve_many", test_evbuffer_reserve_many, 0, NULL, NULL },
+ { "reserve_many2", test_evbuffer_reserve_many, 0, &nil_setup, (void*)"add" },
+ { "reserve_many3", test_evbuffer_reserve_many, 0, &nil_setup, (void*)"fill" },
+ { "expand", test_evbuffer_expand, 0, NULL, NULL },
+ { "reference", test_evbuffer_reference, 0, NULL, NULL },
+ { "iterative", test_evbuffer_iterative, 0, NULL, NULL },
+ { "readln", test_evbuffer_readln, TT_NO_LOGS, &basic_setup, NULL },
+ { "search_eol", test_evbuffer_search_eol, 0, NULL, NULL },
+ { "find", test_evbuffer_find, 0, NULL, NULL },
+ { "ptr_set", test_evbuffer_ptr_set, 0, NULL, NULL },
+ { "search", test_evbuffer_search, 0, NULL, NULL },
+ { "callbacks", test_evbuffer_callbacks, 0, NULL, NULL },
+ { "add_reference", test_evbuffer_add_reference, 0, NULL, NULL },
+ { "multicast", test_evbuffer_multicast, 0, NULL, NULL },
+ { "multicast_drain", test_evbuffer_multicast_drain, 0, NULL, NULL },
+ { "prepend", test_evbuffer_prepend, TT_FORK, NULL, NULL },
+ { "peek", test_evbuffer_peek, 0, NULL, NULL },
+ { "peek_first_gt", test_evbuffer_peek_first_gt, 0, NULL, NULL },
+ { "freeze_start", test_evbuffer_freeze, 0, &nil_setup, (void*)"start" },
+ { "freeze_end", test_evbuffer_freeze, 0, &nil_setup, (void*)"end" },
+ { "add_iovec", test_evbuffer_add_iovec, 0, NULL, NULL},
+ { "copyout", test_evbuffer_copyout, 0, NULL, NULL},
+ { "file_segment_add_cleanup_cb", test_evbuffer_file_segment_add_cleanup_cb, 0, NULL, NULL },
+
+#define ADDFILE_TEST(name, parameters) \
+ { name, test_evbuffer_add_file, TT_FORK|TT_NEED_BASE, \
+ &basic_setup, (void*)(parameters) }
+
+#define ADDFILE_TEST_GROUP(name, parameters) \
+ ADDFILE_TEST(name "_sendfile", "sendfile " parameters), \
+ ADDFILE_TEST(name "_mmap", "mmap " parameters), \
+ ADDFILE_TEST(name "_linear", "linear " parameters)
+
+ ADDFILE_TEST_GROUP("add_file", ""),
+ ADDFILE_TEST("add_file_nosegment", "default nosegment"),
+
+ ADDFILE_TEST_GROUP("add_big_file", "bigfile"),
+ ADDFILE_TEST("add_big_file_nosegment", "default nosegment bigfile"),
+
+ ADDFILE_TEST_GROUP("add_file_offset", "bigfile map_offset"),
+ ADDFILE_TEST("add_file_offset_nosegment",
+ "default nosegment bigfile map_offset"),
+
+ ADDFILE_TEST_GROUP("add_file_offset2", "bigfile offset_in_segment"),
+
+ ADDFILE_TEST_GROUP("add_file_offset3",
+ "bigfile offset_in_segment map_offset"),
+
+ END_OF_TESTCASES
+};
diff --git a/protocols/Telegram/tgl/libevent/test/regress_buffer.obj b/protocols/Telegram/tgl/libevent/test/regress_buffer.obj
new file mode 100644
index 0000000000..a2db69f000
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_buffer.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/regress_bufferevent.c b/protocols/Telegram/tgl/libevent/test/regress_bufferevent.c
new file mode 100644
index 0000000000..68e6876405
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_bufferevent.c
@@ -0,0 +1,1284 @@
+/*
+ * Copyright (c) 2003-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "util-internal.h"
+
+/* The old tests here need assertions to work. */
+#undef NDEBUG
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+#include "event2/event-config.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#ifndef _WIN32
+#include <sys/socket.h>
+#include <sys/wait.h>
+#include <signal.h>
+#include <unistd.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#endif
+#include <fcntl.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <assert.h>
+
+#ifdef EVENT__HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#include "event2/event-config.h"
+#include "event2/event.h"
+#include "event2/event_struct.h"
+#include "event2/event_compat.h"
+#include "event2/tag.h"
+#include "event2/buffer.h"
+#include "event2/bufferevent.h"
+#include "event2/bufferevent_compat.h"
+#include "event2/bufferevent_struct.h"
+#include "event2/listener.h"
+#include "event2/util.h"
+
+#include "bufferevent-internal.h"
+#include "evthread-internal.h"
+#include "util-internal.h"
+#ifdef _WIN32
+#include "iocp-internal.h"
+#endif
+
+#include "regress.h"
+#include "regress_testutils.h"
+
+/*
+ * simple bufferevent test
+ */
+
+static void
+readcb(struct bufferevent *bev, void *arg)
+{
+ if (evbuffer_get_length(bev->input) == 8333) {
+ struct evbuffer *evbuf = evbuffer_new();
+ assert(evbuf != NULL);
+
+ /* gratuitous test of bufferevent_read_buffer */
+ bufferevent_read_buffer(bev, evbuf);
+
+ bufferevent_disable(bev, EV_READ);
+
+ if (evbuffer_get_length(evbuf) == 8333) {
+ test_ok++;
+ }
+
+ evbuffer_free(evbuf);
+ }
+}
+
+static void
+writecb(struct bufferevent *bev, void *arg)
+{
+ if (evbuffer_get_length(bev->output) == 0) {
+ test_ok++;
+ }
+}
+
+static void
+errorcb(struct bufferevent *bev, short what, void *arg)
+{
+ test_ok = -2;
+}
+
+static void
+test_bufferevent_impl(int use_pair, int flush)
+{
+ struct bufferevent *bev1 = NULL, *bev2 = NULL;
+ char buffer[8333];
+ int i;
+ int expected = 2;
+
+ if (use_pair) {
+ struct bufferevent *pair[2];
+ tt_assert(0 == bufferevent_pair_new(NULL, 0, pair));
+ bev1 = pair[0];
+ bev2 = pair[1];
+ bufferevent_setcb(bev1, readcb, writecb, errorcb, bev1);
+ bufferevent_setcb(bev2, readcb, writecb, errorcb, NULL);
+ tt_int_op(bufferevent_getfd(bev1), ==, -1);
+ tt_ptr_op(bufferevent_get_underlying(bev1), ==, NULL);
+ tt_ptr_op(bufferevent_pair_get_partner(bev1), ==, bev2);
+ tt_ptr_op(bufferevent_pair_get_partner(bev2), ==, bev1);
+ } else {
+ bev1 = bufferevent_new(pair[0], readcb, writecb, errorcb, NULL);
+ bev2 = bufferevent_new(pair[1], readcb, writecb, errorcb, NULL);
+ tt_int_op(bufferevent_getfd(bev1), ==, pair[0]);
+ tt_ptr_op(bufferevent_get_underlying(bev1), ==, NULL);
+ tt_ptr_op(bufferevent_pair_get_partner(bev1), ==, NULL);
+ tt_ptr_op(bufferevent_pair_get_partner(bev2), ==, NULL);
+ }
+
+ {
+ /* Test getcb. */
+ bufferevent_data_cb r, w;
+ bufferevent_event_cb e;
+ void *a;
+ bufferevent_getcb(bev1, &r, &w, &e, &a);
+ tt_ptr_op(r, ==, readcb);
+ tt_ptr_op(w, ==, writecb);
+ tt_ptr_op(e, ==, errorcb);
+ tt_ptr_op(a, ==, use_pair ? bev1 : NULL);
+ }
+
+ bufferevent_disable(bev1, EV_READ);
+ bufferevent_enable(bev2, EV_READ);
+
+ tt_int_op(bufferevent_get_enabled(bev1), ==, EV_WRITE);
+ tt_int_op(bufferevent_get_enabled(bev2), ==, EV_WRITE|EV_READ);
+
+ for (i = 0; i < (int)sizeof(buffer); i++)
+ buffer[i] = i;
+
+ bufferevent_write(bev1, buffer, sizeof(buffer));
+ if (flush >= 0) {
+ tt_int_op(bufferevent_flush(bev1, EV_WRITE, flush), >=, 0);
+ }
+
+ event_dispatch();
+
+ bufferevent_free(bev2);
+ tt_ptr_op(bufferevent_pair_get_partner(bev1), ==, NULL);
+ bufferevent_free(bev1);
+
+ /** Only pair call errorcb for BEV_FINISHED */
+ if (use_pair && flush == BEV_FINISHED) {
+ expected = -1;
+ }
+ if (test_ok != expected)
+ test_ok = 0;
+end:
+ ;
+}
+
+static void test_bufferevent(void) { test_bufferevent_impl(0, -1); }
+static void test_bufferevent_pair(void) { test_bufferevent_impl(1, -1); }
+
+static void test_bufferevent_flush_normal(void) { test_bufferevent_impl(0, BEV_NORMAL); }
+static void test_bufferevent_flush_flush(void) { test_bufferevent_impl(0, BEV_FLUSH); }
+static void test_bufferevent_flush_finished(void) { test_bufferevent_impl(0, BEV_FINISHED); }
+
+static void test_bufferevent_pair_flush_normal(void) { test_bufferevent_impl(1, BEV_NORMAL); }
+static void test_bufferevent_pair_flush_flush(void) { test_bufferevent_impl(1, BEV_FLUSH); }
+static void test_bufferevent_pair_flush_finished(void) { test_bufferevent_impl(1, BEV_FINISHED); }
+
+#if defined(EVTHREAD_USE_PTHREADS_IMPLEMENTED)
+/**
+ * Trace lock/unlock/alloc/free for locks.
+ * (More heavier then evthread_debug*)
+ */
+typedef struct
+{
+ void *lock;
+ enum {
+ ALLOC, FREE,
+ } status;
+ size_t locked /** allow recursive locking */;
+} lock_wrapper;
+struct lock_unlock_base
+{
+ /* Original callbacks */
+ struct evthread_lock_callbacks cbs;
+ /* Map of locks */
+ lock_wrapper *locks;
+ size_t nr_locks;
+} lu_base = {
+ .locks = NULL,
+};
+
+static lock_wrapper *lu_find(void *lock_)
+{
+ size_t i;
+ for (i = 0; i < lu_base.nr_locks; ++i) {
+ lock_wrapper *lock = &lu_base.locks[i];
+ if (lock->lock == lock_)
+ return lock;
+ }
+ return NULL;
+}
+
+static void *trace_lock_alloc(unsigned locktype)
+{
+ void *lock;
+ ++lu_base.nr_locks;
+ lu_base.locks = realloc(lu_base.locks,
+ sizeof(lock_wrapper) * lu_base.nr_locks);
+ lock = lu_base.cbs.alloc(locktype);
+ lu_base.locks[lu_base.nr_locks - 1] = (lock_wrapper){ lock, ALLOC, 0 };
+ return lock;
+}
+static void trace_lock_free(void *lock_, unsigned locktype)
+{
+ lock_wrapper *lock = lu_find(lock_);
+ if (!lock || lock->status == FREE || lock->locked) {
+ TT_FAIL(("lock: free error"));
+ } else {
+ lock->status = FREE;
+ lu_base.cbs.free(lock_, locktype);
+ }
+}
+static int trace_lock_lock(unsigned mode, void *lock_)
+{
+ lock_wrapper *lock = lu_find(lock_);
+ if (!lock || lock->status == FREE) {
+ TT_FAIL(("lock: lock error"));
+ return -1;
+ } else {
+ ++lock->locked;
+ return lu_base.cbs.lock(mode, lock_);
+ }
+}
+static int trace_lock_unlock(unsigned mode, void *lock_)
+{
+ lock_wrapper *lock = lu_find(lock_);
+ if (!lock || lock->status == FREE || !lock->locked) {
+ TT_FAIL(("lock: unlock error"));
+ return -1;
+ } else {
+ --lock->locked;
+ return lu_base.cbs.unlock(mode, lock_);
+ }
+}
+static void lock_unlock_free_thread_cbs(void)
+{
+ event_base_free(NULL);
+
+ if (libevent_tests_running_in_debug_mode)
+ libevent_global_shutdown();
+
+ /** drop immutable flag */
+ evthread_set_lock_callbacks(NULL);
+ /** avoid calling of event_global_setup_locks_() for new cbs */
+ libevent_global_shutdown();
+ /** drop immutable flag for non-debug ops (since called after shutdown) */
+ evthread_set_lock_callbacks(NULL);
+}
+
+static int use_lock_unlock_profiler(void)
+{
+ struct evthread_lock_callbacks cbs = {
+ EVTHREAD_LOCK_API_VERSION,
+ EVTHREAD_LOCKTYPE_RECURSIVE,
+ trace_lock_alloc,
+ trace_lock_free,
+ trace_lock_lock,
+ trace_lock_unlock,
+ };
+ memcpy(&lu_base.cbs, evthread_get_lock_callbacks(),
+ sizeof(lu_base.cbs));
+ {
+ lock_unlock_free_thread_cbs();
+
+ evthread_set_lock_callbacks(&cbs);
+ /** re-create debug locks correctly */
+ evthread_enable_lock_debugging();
+
+ event_init();
+ }
+ return 0;
+}
+static void free_lock_unlock_profiler(struct basic_test_data *data)
+{
+ /** fix "held_by" for kqueue */
+ evthread_set_lock_callbacks(NULL);
+
+ lock_unlock_free_thread_cbs();
+ free(lu_base.locks);
+ data->base = NULL;
+}
+
+static void test_bufferevent_pair_release_lock(void *arg)
+{
+ struct basic_test_data *data = arg;
+ use_lock_unlock_profiler();
+ {
+ struct bufferevent *pair[2];
+ if (!bufferevent_pair_new(NULL, BEV_OPT_THREADSAFE, pair)) {
+ bufferevent_free(pair[0]);
+ bufferevent_free(pair[1]);
+ } else
+ tt_abort_perror("bufferevent_pair_new");
+ }
+ free_lock_unlock_profiler(data);
+end:
+ ;
+}
+#endif
+
+/*
+ * test watermarks and bufferevent
+ */
+
+static void
+wm_readcb(struct bufferevent *bev, void *arg)
+{
+ struct evbuffer *evbuf = evbuffer_new();
+ int len = (int)evbuffer_get_length(bev->input);
+ static int nread;
+
+ assert(len >= 10 && len <= 20);
+
+ assert(evbuf != NULL);
+
+ /* gratuitous test of bufferevent_read_buffer */
+ bufferevent_read_buffer(bev, evbuf);
+
+ nread += len;
+ if (nread == 65000) {
+ bufferevent_disable(bev, EV_READ);
+ test_ok++;
+ }
+
+ evbuffer_free(evbuf);
+}
+
+static void
+wm_writecb(struct bufferevent *bev, void *arg)
+{
+ assert(evbuffer_get_length(bev->output) <= 100);
+ if (evbuffer_get_length(bev->output) == 0) {
+ evbuffer_drain(bev->output, evbuffer_get_length(bev->output));
+ test_ok++;
+ }
+}
+
+static void
+wm_errorcb(struct bufferevent *bev, short what, void *arg)
+{
+ test_ok = -2;
+}
+
+static void
+test_bufferevent_watermarks_impl(int use_pair)
+{
+ struct bufferevent *bev1 = NULL, *bev2 = NULL;
+ char buffer[65000];
+ size_t low, high;
+ int i;
+ test_ok = 0;
+
+ if (use_pair) {
+ struct bufferevent *pair[2];
+ tt_assert(0 == bufferevent_pair_new(NULL, 0, pair));
+ bev1 = pair[0];
+ bev2 = pair[1];
+ bufferevent_setcb(bev1, NULL, wm_writecb, errorcb, NULL);
+ bufferevent_setcb(bev2, wm_readcb, NULL, errorcb, NULL);
+ } else {
+ bev1 = bufferevent_new(pair[0], NULL, wm_writecb, wm_errorcb, NULL);
+ bev2 = bufferevent_new(pair[1], wm_readcb, NULL, wm_errorcb, NULL);
+ }
+ tt_assert(bev1);
+ tt_assert(bev2);
+ bufferevent_disable(bev1, EV_READ);
+ bufferevent_enable(bev2, EV_READ);
+
+ /* By default, low watermarks are set to 0 */
+ bufferevent_getwatermark(bev1, EV_READ, &low, NULL);
+ tt_int_op(low, ==, 0);
+ bufferevent_getwatermark(bev2, EV_WRITE, &low, NULL);
+ tt_int_op(low, ==, 0);
+
+ for (i = 0; i < (int)sizeof(buffer); i++)
+ buffer[i] = (char)i;
+
+ /* limit the reading on the receiving bufferevent */
+ bufferevent_setwatermark(bev2, EV_READ, 10, 20);
+
+ bufferevent_getwatermark(bev2, EV_READ, &low, &high);
+ tt_int_op(low, ==, 10);
+ tt_int_op(high, ==, 20);
+
+ /* Tell the sending bufferevent not to notify us till it's down to
+ 100 bytes. */
+ bufferevent_setwatermark(bev1, EV_WRITE, 100, 2000);
+
+ bufferevent_getwatermark(bev1, EV_WRITE, &low, &high);
+ tt_int_op(low, ==, 100);
+ tt_int_op(high, ==, 2000);
+
+ {
+ int r = bufferevent_getwatermark(bev1, EV_WRITE | EV_READ, &low, &high);
+ tt_int_op(r, !=, 0);
+ }
+
+ bufferevent_write(bev1, buffer, sizeof(buffer));
+
+ event_dispatch();
+
+ tt_int_op(test_ok, ==, 2);
+
+ /* The write callback drained all the data from outbuf, so we
+ * should have removed the write event... */
+ tt_assert(!event_pending(&bev2->ev_write, EV_WRITE, NULL));
+
+end:
+ if (bev1)
+ bufferevent_free(bev1);
+ if (bev2)
+ bufferevent_free(bev2);
+}
+
+static void
+test_bufferevent_watermarks(void)
+{
+ test_bufferevent_watermarks_impl(0);
+}
+
+static void
+test_bufferevent_pair_watermarks(void)
+{
+ test_bufferevent_watermarks_impl(1);
+}
+
+/*
+ * Test bufferevent filters
+ */
+
+/* strip an 'x' from each byte */
+
+static enum bufferevent_filter_result
+bufferevent_input_filter(struct evbuffer *src, struct evbuffer *dst,
+ ev_ssize_t lim, enum bufferevent_flush_mode state, void *ctx)
+{
+ const unsigned char *buffer;
+ unsigned i;
+
+ buffer = evbuffer_pullup(src, evbuffer_get_length(src));
+ for (i = 0; i < evbuffer_get_length(src); i += 2) {
+ assert(buffer[i] == 'x');
+ evbuffer_add(dst, buffer + i + 1, 1);
+
+ if (i + 2 > evbuffer_get_length(src))
+ break;
+ }
+
+ evbuffer_drain(src, i);
+ return (BEV_OK);
+}
+
+/* add an 'x' before each byte */
+
+static enum bufferevent_filter_result
+bufferevent_output_filter(struct evbuffer *src, struct evbuffer *dst,
+ ev_ssize_t lim, enum bufferevent_flush_mode state, void *ctx)
+{
+ const unsigned char *buffer;
+ unsigned i;
+
+ buffer = evbuffer_pullup(src, evbuffer_get_length(src));
+ for (i = 0; i < evbuffer_get_length(src); ++i) {
+ evbuffer_add(dst, "x", 1);
+ evbuffer_add(dst, buffer + i, 1);
+ }
+
+ evbuffer_drain(src, evbuffer_get_length(src));
+ return (BEV_OK);
+}
+
+static void
+test_bufferevent_filters_impl(int use_pair)
+{
+ struct bufferevent *bev1 = NULL, *bev2 = NULL;
+ struct bufferevent *bev1_base = NULL, *bev2_base = NULL;
+ char buffer[8333];
+ int i;
+
+ test_ok = 0;
+
+ if (use_pair) {
+ struct bufferevent *pair[2];
+ tt_assert(0 == bufferevent_pair_new(NULL, 0, pair));
+ bev1 = pair[0];
+ bev2 = pair[1];
+ } else {
+ bev1 = bufferevent_socket_new(NULL, pair[0], 0);
+ bev2 = bufferevent_socket_new(NULL, pair[1], 0);
+ }
+ bev1_base = bev1;
+ bev2_base = bev2;
+
+ for (i = 0; i < (int)sizeof(buffer); i++)
+ buffer[i] = i;
+
+ bev1 = bufferevent_filter_new(bev1, NULL, bufferevent_output_filter,
+ BEV_OPT_CLOSE_ON_FREE, NULL, NULL);
+
+ bev2 = bufferevent_filter_new(bev2, bufferevent_input_filter,
+ NULL, BEV_OPT_CLOSE_ON_FREE, NULL, NULL);
+ bufferevent_setcb(bev1, NULL, writecb, errorcb, NULL);
+ bufferevent_setcb(bev2, readcb, NULL, errorcb, NULL);
+
+ tt_ptr_op(bufferevent_get_underlying(bev1), ==, bev1_base);
+ tt_ptr_op(bufferevent_get_underlying(bev2), ==, bev2_base);
+ tt_int_op(bufferevent_getfd(bev1), ==, -1);
+ tt_int_op(bufferevent_getfd(bev2), ==, -1);
+
+ bufferevent_disable(bev1, EV_READ);
+ bufferevent_enable(bev2, EV_READ);
+ /* insert some filters */
+ bufferevent_write(bev1, buffer, sizeof(buffer));
+
+ event_dispatch();
+
+ if (test_ok != 2)
+ test_ok = 0;
+
+end:
+ if (bev1)
+ bufferevent_free(bev1);
+ if (bev2)
+ bufferevent_free(bev2);
+
+}
+
+static void
+test_bufferevent_filters(void)
+{
+ test_bufferevent_filters_impl(0);
+}
+
+static void
+test_bufferevent_pair_filters(void)
+{
+ test_bufferevent_filters_impl(1);
+}
+
+
+static void
+sender_writecb(struct bufferevent *bev, void *ctx)
+{
+ if (evbuffer_get_length(bufferevent_get_output(bev)) == 0) {
+ bufferevent_disable(bev,EV_READ|EV_WRITE);
+ TT_BLATHER(("Flushed %d: freeing it.", (int)bufferevent_getfd(bev)));
+ bufferevent_free(bev);
+ }
+}
+
+static void
+sender_errorcb(struct bufferevent *bev, short what, void *ctx)
+{
+ TT_FAIL(("Got sender error %d",(int)what));
+}
+
+static int bufferevent_connect_test_flags = 0;
+static int bufferevent_trigger_test_flags = 0;
+static int n_strings_read = 0;
+static int n_reads_invoked = 0;
+static int n_events_invoked = 0;
+
+#define TEST_STR "Now is the time for all good events to signal for " \
+ "the good of their protocol"
+static void
+listen_cb(struct evconnlistener *listener, evutil_socket_t fd,
+ struct sockaddr *sa, int socklen, void *arg)
+{
+ struct event_base *base = arg;
+ struct bufferevent *bev;
+ const char s[] = TEST_STR;
+ TT_BLATHER(("Got a request on socket %d", (int)fd ));
+ bev = bufferevent_socket_new(base, fd, bufferevent_connect_test_flags);
+ tt_assert(bev);
+ bufferevent_setcb(bev, NULL, sender_writecb, sender_errorcb, NULL);
+ bufferevent_write(bev, s, sizeof(s));
+end:
+ ;
+}
+
+static int
+fake_listener_create(struct sockaddr_in *localhost)
+{
+ struct sockaddr *sa = (struct sockaddr *)localhost;
+ evutil_socket_t fd = -1;
+ ev_socklen_t slen = sizeof(*localhost);
+
+ memset(localhost, 0, sizeof(*localhost));
+ localhost->sin_port = 0; /* have the kernel pick a port */
+ localhost->sin_addr.s_addr = htonl(0x7f000001L);
+ localhost->sin_family = AF_INET;
+
+ /* bind, but don't listen or accept. should trigger
+ "Connection refused" reliably on most platforms. */
+ fd = socket(localhost->sin_family, SOCK_STREAM, 0);
+ tt_assert(fd >= 0);
+ tt_assert(bind(fd, sa, slen) == 0);
+ tt_assert(getsockname(fd, sa, &slen) == 0);
+
+ return fd;
+
+end:
+ return -1;
+}
+
+static void
+reader_eventcb(struct bufferevent *bev, short what, void *ctx)
+{
+ struct event_base *base = ctx;
+ if (what & BEV_EVENT_ERROR) {
+ perror("foobar");
+ TT_FAIL(("got connector error %d", (int)what));
+ return;
+ }
+ if (what & BEV_EVENT_CONNECTED) {
+ TT_BLATHER(("connected on %d", (int)bufferevent_getfd(bev)));
+ bufferevent_enable(bev, EV_READ);
+ }
+ if (what & BEV_EVENT_EOF) {
+ char buf[512];
+ size_t n;
+ n = bufferevent_read(bev, buf, sizeof(buf)-1);
+ tt_int_op(n, >=, 0);
+ buf[n] = '\0';
+ tt_str_op(buf, ==, TEST_STR);
+ if (++n_strings_read == 2)
+ event_base_loopexit(base, NULL);
+ TT_BLATHER(("EOF on %d: %d strings read.",
+ (int)bufferevent_getfd(bev), n_strings_read));
+ }
+end:
+ ;
+}
+
+static void
+reader_eventcb_simple(struct bufferevent *bev, short what, void *ctx)
+{
+ TT_BLATHER(("Read eventcb simple invoked on %d.",
+ (int)bufferevent_getfd(bev)));
+ n_events_invoked++;
+}
+
+static void
+reader_readcb(struct bufferevent *bev, void *ctx)
+{
+ TT_BLATHER(("Read invoked on %d.", (int)bufferevent_getfd(bev)));
+ n_reads_invoked++;
+}
+
+static void
+test_bufferevent_connect(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct evconnlistener *lev=NULL;
+ struct bufferevent *bev1=NULL, *bev2=NULL;
+ struct sockaddr_in localhost;
+ struct sockaddr_storage ss;
+ struct sockaddr *sa;
+ ev_socklen_t slen;
+
+ int be_flags=BEV_OPT_CLOSE_ON_FREE;
+
+ if (strstr((char*)data->setup_data, "defer")) {
+ be_flags |= BEV_OPT_DEFER_CALLBACKS;
+ }
+ if (strstr((char*)data->setup_data, "unlocked")) {
+ be_flags |= BEV_OPT_UNLOCK_CALLBACKS;
+ }
+ if (strstr((char*)data->setup_data, "lock")) {
+ be_flags |= BEV_OPT_THREADSAFE;
+ }
+ bufferevent_connect_test_flags = be_flags;
+#ifdef _WIN32
+ if (!strcmp((char*)data->setup_data, "unset_connectex")) {
+ struct win32_extension_fns *ext =
+ (struct win32_extension_fns *)
+ event_get_win32_extension_fns_();
+ ext->ConnectEx = NULL;
+ }
+#endif
+
+ memset(&localhost, 0, sizeof(localhost));
+
+ localhost.sin_port = 0; /* pick-a-port */
+ localhost.sin_addr.s_addr = htonl(0x7f000001L);
+ localhost.sin_family = AF_INET;
+ sa = (struct sockaddr *)&localhost;
+ lev = evconnlistener_new_bind(data->base, listen_cb, data->base,
+ LEV_OPT_CLOSE_ON_FREE|LEV_OPT_REUSEABLE,
+ 16, sa, sizeof(localhost));
+ tt_assert(lev);
+
+ sa = (struct sockaddr *)&ss;
+ slen = sizeof(ss);
+ if (regress_get_listener_addr(lev, sa, &slen) < 0) {
+ tt_abort_perror("getsockname");
+ }
+
+ tt_assert(!evconnlistener_enable(lev));
+ bev1 = bufferevent_socket_new(data->base, -1, be_flags);
+ bev2 = bufferevent_socket_new(data->base, -1, be_flags);
+ tt_assert(bev1);
+ tt_assert(bev2);
+ bufferevent_setcb(bev1, reader_readcb,NULL, reader_eventcb, data->base);
+ bufferevent_setcb(bev2, reader_readcb,NULL, reader_eventcb, data->base);
+
+ bufferevent_enable(bev1, EV_READ);
+ bufferevent_enable(bev2, EV_READ);
+
+ tt_want(!bufferevent_socket_connect(bev1, sa, sizeof(localhost)));
+ tt_want(!bufferevent_socket_connect(bev2, sa, sizeof(localhost)));
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(n_strings_read, ==, 2);
+ tt_int_op(n_reads_invoked, >=, 2);
+end:
+ if (lev)
+ evconnlistener_free(lev);
+
+ if (bev1)
+ bufferevent_free(bev1);
+
+ if (bev2)
+ bufferevent_free(bev2);
+}
+
+static void
+test_bufferevent_connect_fail_eventcb(void *arg)
+{
+ struct basic_test_data *data = arg;
+ int flags = BEV_OPT_CLOSE_ON_FREE | (long)data->setup_data;
+ struct bufferevent *bev = NULL;
+ struct evconnlistener *lev = NULL;
+ struct sockaddr_in localhost;
+ ev_socklen_t slen = sizeof(localhost);
+ evutil_socket_t fake_listener = -1;
+
+ fake_listener = fake_listener_create(&localhost);
+
+ tt_int_op(n_events_invoked, ==, 0);
+
+ bev = bufferevent_socket_new(data->base, -1, flags);
+ tt_assert(bev);
+ bufferevent_setcb(bev, reader_readcb, reader_readcb,
+ reader_eventcb_simple, data->base);
+ bufferevent_enable(bev, EV_READ|EV_WRITE);
+ tt_int_op(n_events_invoked, ==, 0);
+ tt_int_op(n_reads_invoked, ==, 0);
+ /** @see also test_bufferevent_connect_fail() */
+ bufferevent_socket_connect(bev, (struct sockaddr *)&localhost, slen);
+ tt_int_op(n_events_invoked, ==, 0);
+ tt_int_op(n_reads_invoked, ==, 0);
+ event_base_dispatch(data->base);
+ tt_int_op(n_events_invoked, ==, 1);
+ tt_int_op(n_reads_invoked, ==, 0);
+
+end:
+ if (lev)
+ evconnlistener_free(lev);
+ if (bev)
+ bufferevent_free(bev);
+ if (fake_listener >= 0)
+ evutil_closesocket(fake_listener);
+}
+
+static void
+want_fail_eventcb(struct bufferevent *bev, short what, void *ctx)
+{
+ struct event_base *base = ctx;
+ const char *err;
+ evutil_socket_t s;
+
+ if (what & BEV_EVENT_ERROR) {
+ s = bufferevent_getfd(bev);
+ err = evutil_socket_error_to_string(evutil_socket_geterror(s));
+ TT_BLATHER(("connection failure on "EV_SOCK_FMT": %s",
+ EV_SOCK_ARG(s), err));
+ test_ok = 1;
+ } else {
+ TT_FAIL(("didn't fail? what %hd", what));
+ }
+
+ event_base_loopexit(base, NULL);
+}
+
+static void
+close_socket_cb(evutil_socket_t fd, short what, void *arg)
+{
+ evutil_socket_t *fdp = arg;
+ if (*fdp >= 0) {
+ evutil_closesocket(*fdp);
+ *fdp = -1;
+ }
+}
+
+static void
+test_bufferevent_connect_fail(void *arg)
+{
+ struct basic_test_data *data = (struct basic_test_data *)arg;
+ struct bufferevent *bev=NULL;
+ struct event close_listener_event;
+ int close_listener_event_added = 0;
+ struct timeval one_second = { 1, 0 };
+ struct sockaddr_in localhost;
+ ev_socklen_t slen = sizeof(localhost);
+ evutil_socket_t fake_listener = -1;
+ int r;
+
+ test_ok = 0;
+
+ fake_listener = fake_listener_create(&localhost);
+ bev = bufferevent_socket_new(data->base, -1,
+ BEV_OPT_CLOSE_ON_FREE | BEV_OPT_DEFER_CALLBACKS);
+ tt_assert(bev);
+ bufferevent_setcb(bev, NULL, NULL, want_fail_eventcb, data->base);
+
+ r = bufferevent_socket_connect(bev, (struct sockaddr *)&localhost, slen);
+ /* XXXX we'd like to test the '0' case everywhere, but FreeBSD tells
+ * detects the error immediately, which is not really wrong of it. */
+ tt_want(r == 0 || r == -1);
+
+ /* Close the listener socket after a second. This should trigger
+ "connection refused" on some other platforms, including OSX. */
+ evtimer_assign(&close_listener_event, data->base, close_socket_cb,
+ &fake_listener);
+ event_add(&close_listener_event, &one_second);
+ close_listener_event_added = 1;
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(test_ok, ==, 1);
+
+end:
+ if (fake_listener >= 0)
+ evutil_closesocket(fake_listener);
+
+ if (bev)
+ bufferevent_free(bev);
+
+ if (close_listener_event_added)
+ event_del(&close_listener_event);
+}
+
+struct timeout_cb_result {
+ struct timeval read_timeout_at;
+ struct timeval write_timeout_at;
+ struct timeval last_wrote_at;
+ int n_read_timeouts;
+ int n_write_timeouts;
+ int total_calls;
+};
+
+static void
+bev_timeout_write_cb(struct bufferevent *bev, void *arg)
+{
+ struct timeout_cb_result *res = arg;
+ evutil_gettimeofday(&res->last_wrote_at, NULL);
+}
+
+static void
+bev_timeout_event_cb(struct bufferevent *bev, short what, void *arg)
+{
+ struct timeout_cb_result *res = arg;
+ ++res->total_calls;
+
+ if ((what & (BEV_EVENT_READING|BEV_EVENT_TIMEOUT))
+ == (BEV_EVENT_READING|BEV_EVENT_TIMEOUT)) {
+ evutil_gettimeofday(&res->read_timeout_at, NULL);
+ ++res->n_read_timeouts;
+ }
+ if ((what & (BEV_EVENT_WRITING|BEV_EVENT_TIMEOUT))
+ == (BEV_EVENT_WRITING|BEV_EVENT_TIMEOUT)) {
+ evutil_gettimeofday(&res->write_timeout_at, NULL);
+ ++res->n_write_timeouts;
+ }
+}
+
+static void
+test_bufferevent_timeouts(void *arg)
+{
+ /* "arg" is a string containing "pair" and/or "filter". */
+ struct bufferevent *bev1 = NULL, *bev2 = NULL;
+ struct basic_test_data *data = arg;
+ int use_pair = 0, use_filter = 0;
+ struct timeval tv_w, tv_r, started_at;
+ struct timeout_cb_result res1, res2;
+ char buf[1024];
+
+ memset(&res1, 0, sizeof(res1));
+ memset(&res2, 0, sizeof(res2));
+
+ if (strstr((char*)data->setup_data, "pair"))
+ use_pair = 1;
+ if (strstr((char*)data->setup_data, "filter"))
+ use_filter = 1;
+
+ if (use_pair) {
+ struct bufferevent *p[2];
+ tt_int_op(0, ==, bufferevent_pair_new(data->base, 0, p));
+ bev1 = p[0];
+ bev2 = p[1];
+ } else {
+ bev1 = bufferevent_socket_new(data->base, data->pair[0], 0);
+ bev2 = bufferevent_socket_new(data->base, data->pair[1], 0);
+ }
+
+ tt_assert(bev1);
+ tt_assert(bev2);
+
+ if (use_filter) {
+ struct bufferevent *bevf1, *bevf2;
+ bevf1 = bufferevent_filter_new(bev1, NULL, NULL,
+ BEV_OPT_CLOSE_ON_FREE, NULL, NULL);
+ bevf2 = bufferevent_filter_new(bev2, NULL, NULL,
+ BEV_OPT_CLOSE_ON_FREE, NULL, NULL);
+ tt_assert(bevf1);
+ tt_assert(bevf2);
+ bev1 = bevf1;
+ bev2 = bevf2;
+ }
+
+ /* Do this nice and early. */
+ bufferevent_disable(bev2, EV_READ);
+
+ /* bev1 will try to write and read. Both will time out. */
+ evutil_gettimeofday(&started_at, NULL);
+ tv_w.tv_sec = tv_r.tv_sec = 0;
+ tv_w.tv_usec = 100*1000;
+ tv_r.tv_usec = 150*1000;
+ bufferevent_setcb(bev1, NULL, bev_timeout_write_cb,
+ bev_timeout_event_cb, &res1);
+ bufferevent_setwatermark(bev1, EV_WRITE, 1024*1024+10, 0);
+ bufferevent_set_timeouts(bev1, &tv_r, &tv_w);
+ if (use_pair) {
+ /* For a pair, the fact that the other side isn't reading
+ * makes the writer stall */
+ bufferevent_write(bev1, "ABCDEFG", 7);
+ } else {
+ /* For a real socket, the kernel's TCP buffers can eat a
+ * fair number of bytes; make sure that at some point we
+ * have some bytes that will stall. */
+ struct evbuffer *output = bufferevent_get_output(bev1);
+ int i;
+ memset(buf, 0xbb, sizeof(buf));
+ for (i=0;i<1024;++i) {
+ evbuffer_add_reference(output, buf, sizeof(buf),
+ NULL, NULL);
+ }
+ }
+ bufferevent_enable(bev1, EV_READ|EV_WRITE);
+
+ /* bev2 has nothing to say, and isn't listening. */
+ bufferevent_setcb(bev2, NULL, bev_timeout_write_cb,
+ bev_timeout_event_cb, &res2);
+ tv_w.tv_sec = tv_r.tv_sec = 0;
+ tv_w.tv_usec = 200*1000;
+ tv_r.tv_usec = 100*1000;
+ bufferevent_set_timeouts(bev2, &tv_r, &tv_w);
+ bufferevent_enable(bev2, EV_WRITE);
+
+ tv_r.tv_sec = 0;
+ tv_r.tv_usec = 350000;
+
+ event_base_loopexit(data->base, &tv_r);
+ event_base_dispatch(data->base);
+
+ /* XXXX Test that actually reading or writing a little resets the
+ * timeouts. */
+
+ /* Each buf1 timeout happens, and happens only once. */
+ tt_want(res1.n_read_timeouts);
+ tt_want(res1.n_write_timeouts);
+ tt_want(res1.n_read_timeouts == 1);
+ tt_want(res1.n_write_timeouts == 1);
+
+ test_timeval_diff_eq(&started_at, &res1.read_timeout_at, 150);
+ test_timeval_diff_eq(&started_at, &res1.write_timeout_at, 100);
+
+end:
+ if (bev1)
+ bufferevent_free(bev1);
+ if (bev2)
+ bufferevent_free(bev2);
+}
+
+static void
+trigger_failure_cb(evutil_socket_t fd, short what, void *ctx)
+{
+ TT_FAIL(("The triggered callback did not fire or the machine is really slow (try increasing timeout)."));
+}
+
+static void
+trigger_eventcb(struct bufferevent *bev, short what, void *ctx)
+{
+ struct event_base *base = ctx;
+ if (what == ~0) {
+ TT_BLATHER(("Event successfully triggered."));
+ event_base_loopexit(base, NULL);
+ return;
+ }
+ reader_eventcb(bev, what, ctx);
+}
+
+static void
+trigger_readcb_triggered(struct bufferevent *bev, void *ctx)
+{
+ TT_BLATHER(("Read successfully triggered."));
+ n_reads_invoked++;
+ bufferevent_trigger_event(bev, ~0, bufferevent_trigger_test_flags);
+}
+
+static void
+trigger_readcb(struct bufferevent *bev, void *ctx)
+{
+ struct timeval timeout = { 30, 0 };
+ struct event_base *base = ctx;
+ size_t low, high, len;
+ int expected_reads;
+
+ TT_BLATHER(("Read invoked on %d.", (int)bufferevent_getfd(bev)));
+ expected_reads = ++n_reads_invoked;
+
+ bufferevent_setcb(bev, trigger_readcb_triggered, NULL, trigger_eventcb, ctx);
+
+ bufferevent_getwatermark(bev, EV_READ, &low, &high);
+ len = evbuffer_get_length(bufferevent_get_input(bev));
+
+ bufferevent_setwatermark(bev, EV_READ, len + 1, 0);
+ bufferevent_trigger(bev, EV_READ, bufferevent_trigger_test_flags);
+ /* no callback expected */
+ tt_int_op(n_reads_invoked, ==, expected_reads);
+
+ if ((bufferevent_trigger_test_flags & BEV_TRIG_DEFER_CALLBACKS) ||
+ (bufferevent_connect_test_flags & BEV_OPT_DEFER_CALLBACKS)) {
+ /* will be deferred */
+ } else {
+ expected_reads++;
+ }
+
+ event_base_once(base, -1, EV_TIMEOUT, trigger_failure_cb, NULL, &timeout);
+
+ bufferevent_trigger(bev, EV_READ,
+ bufferevent_trigger_test_flags | BEV_TRIG_IGNORE_WATERMARKS);
+ tt_int_op(n_reads_invoked, ==, expected_reads);
+
+ bufferevent_setwatermark(bev, EV_READ, low, high);
+end:
+ ;
+}
+
+static void
+test_bufferevent_trigger(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct evconnlistener *lev=NULL;
+ struct bufferevent *bev=NULL;
+ struct sockaddr_in localhost;
+ struct sockaddr_storage ss;
+ struct sockaddr *sa;
+ ev_socklen_t slen;
+
+ int be_flags=BEV_OPT_CLOSE_ON_FREE;
+ int trig_flags=0;
+
+ if (strstr((char*)data->setup_data, "defer")) {
+ be_flags |= BEV_OPT_DEFER_CALLBACKS;
+ }
+ bufferevent_connect_test_flags = be_flags;
+
+ if (strstr((char*)data->setup_data, "postpone")) {
+ trig_flags |= BEV_TRIG_DEFER_CALLBACKS;
+ }
+ bufferevent_trigger_test_flags = trig_flags;
+
+ memset(&localhost, 0, sizeof(localhost));
+
+ localhost.sin_port = 0; /* pick-a-port */
+ localhost.sin_addr.s_addr = htonl(0x7f000001L);
+ localhost.sin_family = AF_INET;
+ sa = (struct sockaddr *)&localhost;
+ lev = evconnlistener_new_bind(data->base, listen_cb, data->base,
+ LEV_OPT_CLOSE_ON_FREE|LEV_OPT_REUSEABLE,
+ 16, sa, sizeof(localhost));
+ tt_assert(lev);
+
+ sa = (struct sockaddr *)&ss;
+ slen = sizeof(ss);
+ if (regress_get_listener_addr(lev, sa, &slen) < 0) {
+ tt_abort_perror("getsockname");
+ }
+
+ tt_assert(!evconnlistener_enable(lev));
+ bev = bufferevent_socket_new(data->base, -1, be_flags);
+ tt_assert(bev);
+ bufferevent_setcb(bev, trigger_readcb, NULL, trigger_eventcb, data->base);
+
+ bufferevent_enable(bev, EV_READ);
+
+ tt_want(!bufferevent_socket_connect(bev, sa, sizeof(localhost)));
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(n_reads_invoked, ==, 2);
+end:
+ if (lev)
+ evconnlistener_free(lev);
+
+ if (bev)
+ bufferevent_free(bev);
+}
+
+static void
+test_bufferevent_socket_filter_inactive(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct bufferevent *bev = NULL, *bevf = NULL;
+
+ bev = bufferevent_socket_new(data->base, -1, 0);
+ tt_assert(bev);
+ bevf = bufferevent_filter_new(bev, NULL, NULL, 0, NULL, NULL);
+ tt_assert(bevf);
+
+end:
+ if (bevf)
+ bufferevent_free(bevf);
+ if (bev)
+ bufferevent_free(bev);
+}
+
+
+struct testcase_t bufferevent_testcases[] = {
+
+ LEGACY(bufferevent, TT_ISOLATED),
+ LEGACY(bufferevent_pair, TT_ISOLATED),
+ LEGACY(bufferevent_flush_normal, TT_ISOLATED),
+ LEGACY(bufferevent_flush_flush, TT_ISOLATED),
+ LEGACY(bufferevent_flush_finished, TT_ISOLATED),
+ LEGACY(bufferevent_pair_flush_normal, TT_ISOLATED),
+ LEGACY(bufferevent_pair_flush_flush, TT_ISOLATED),
+ LEGACY(bufferevent_pair_flush_finished, TT_ISOLATED),
+#if defined(EVTHREAD_USE_PTHREADS_IMPLEMENTED)
+ { "bufferevent_pair_release_lock", test_bufferevent_pair_release_lock,
+ TT_FORK|TT_ISOLATED|TT_NEED_THREADS|TT_NEED_BASE|TT_LEGACY,
+ &basic_setup, NULL },
+#endif
+ LEGACY(bufferevent_watermarks, TT_ISOLATED),
+ LEGACY(bufferevent_pair_watermarks, TT_ISOLATED),
+ LEGACY(bufferevent_filters, TT_ISOLATED),
+ LEGACY(bufferevent_pair_filters, TT_ISOLATED),
+ { "bufferevent_connect", test_bufferevent_connect, TT_FORK|TT_NEED_BASE,
+ &basic_setup, (void*)"" },
+ { "bufferevent_connect_defer", test_bufferevent_connect,
+ TT_FORK|TT_NEED_BASE, &basic_setup, (void*)"defer" },
+ { "bufferevent_connect_lock", test_bufferevent_connect,
+ TT_FORK|TT_NEED_BASE|TT_NEED_THREADS, &basic_setup, (void*)"lock" },
+ { "bufferevent_connect_lock_defer", test_bufferevent_connect,
+ TT_FORK|TT_NEED_BASE|TT_NEED_THREADS, &basic_setup,
+ (void*)"defer lock" },
+ { "bufferevent_connect_unlocked_cbs", test_bufferevent_connect,
+ TT_FORK|TT_NEED_BASE|TT_NEED_THREADS, &basic_setup,
+ (void*)"lock defer unlocked" },
+ { "bufferevent_connect_fail", test_bufferevent_connect_fail,
+ TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
+ { "bufferevent_timeout", test_bufferevent_timeouts,
+ TT_FORK|TT_NEED_BASE|TT_NEED_SOCKETPAIR, &basic_setup, (void*)"" },
+ { "bufferevent_timeout_pair", test_bufferevent_timeouts,
+ TT_FORK|TT_NEED_BASE, &basic_setup, (void*)"pair" },
+ { "bufferevent_timeout_filter", test_bufferevent_timeouts,
+ TT_FORK|TT_NEED_BASE, &basic_setup, (void*)"filter" },
+ { "bufferevent_timeout_filter_pair", test_bufferevent_timeouts,
+ TT_FORK|TT_NEED_BASE, &basic_setup, (void*)"filter pair" },
+ { "bufferevent_trigger", test_bufferevent_trigger, TT_FORK|TT_NEED_BASE,
+ &basic_setup, (void*)"" },
+ { "bufferevent_trigger_defer", test_bufferevent_trigger,
+ TT_FORK|TT_NEED_BASE, &basic_setup, (void*)"defer" },
+ { "bufferevent_trigger_postpone", test_bufferevent_trigger,
+ TT_FORK|TT_NEED_BASE|TT_NEED_THREADS, &basic_setup,
+ (void*)"postpone" },
+ { "bufferevent_trigger_defer_postpone", test_bufferevent_trigger,
+ TT_FORK|TT_NEED_BASE|TT_NEED_THREADS, &basic_setup,
+ (void*)"defer postpone" },
+#ifdef EVENT__HAVE_LIBZ
+ LEGACY(bufferevent_zlib, TT_ISOLATED),
+#else
+ { "bufferevent_zlib", NULL, TT_SKIP, NULL, NULL },
+#endif
+
+ { "bufferevent_connect_fail_eventcb_defer",
+ test_bufferevent_connect_fail_eventcb,
+ TT_FORK|TT_NEED_BASE, &basic_setup, (void*)BEV_OPT_DEFER_CALLBACKS },
+ { "bufferevent_connect_fail_eventcb",
+ test_bufferevent_connect_fail_eventcb,
+ TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
+
+ { "bufferevent_socket_filter_inactive",
+ test_bufferevent_socket_filter_inactive,
+ TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
+
+ END_OF_TESTCASES,
+};
+
+struct testcase_t bufferevent_iocp_testcases[] = {
+
+ LEGACY(bufferevent, TT_ISOLATED|TT_ENABLE_IOCP),
+ LEGACY(bufferevent_flush_normal, TT_ISOLATED),
+ LEGACY(bufferevent_flush_flush, TT_ISOLATED),
+ LEGACY(bufferevent_flush_finished, TT_ISOLATED),
+ LEGACY(bufferevent_watermarks, TT_ISOLATED|TT_ENABLE_IOCP),
+ LEGACY(bufferevent_filters, TT_ISOLATED|TT_ENABLE_IOCP),
+ { "bufferevent_connect", test_bufferevent_connect,
+ TT_FORK|TT_NEED_BASE|TT_ENABLE_IOCP, &basic_setup, (void*)"" },
+ { "bufferevent_connect_defer", test_bufferevent_connect,
+ TT_FORK|TT_NEED_BASE|TT_ENABLE_IOCP, &basic_setup, (void*)"defer" },
+ { "bufferevent_connect_lock", test_bufferevent_connect,
+ TT_FORK|TT_NEED_BASE|TT_NEED_THREADS|TT_ENABLE_IOCP, &basic_setup,
+ (void*)"lock" },
+ { "bufferevent_connect_lock_defer", test_bufferevent_connect,
+ TT_FORK|TT_NEED_BASE|TT_NEED_THREADS|TT_ENABLE_IOCP, &basic_setup,
+ (void*)"defer lock" },
+ { "bufferevent_connect_fail", test_bufferevent_connect_fail,
+ TT_FORK|TT_NEED_BASE|TT_ENABLE_IOCP, &basic_setup, NULL },
+ { "bufferevent_connect_nonblocking", test_bufferevent_connect,
+ TT_FORK|TT_NEED_BASE|TT_ENABLE_IOCP, &basic_setup,
+ (void*)"unset_connectex" },
+
+ { "bufferevent_connect_fail_eventcb_defer",
+ test_bufferevent_connect_fail_eventcb,
+ TT_FORK|TT_NEED_BASE|TT_ENABLE_IOCP, &basic_setup,
+ (void*)BEV_OPT_DEFER_CALLBACKS },
+ { "bufferevent_connect_fail",
+ test_bufferevent_connect_fail_eventcb,
+ TT_FORK|TT_NEED_BASE|TT_ENABLE_IOCP, &basic_setup, NULL },
+
+ END_OF_TESTCASES,
+};
diff --git a/protocols/Telegram/tgl/libevent/test/regress_bufferevent.obj b/protocols/Telegram/tgl/libevent/test/regress_bufferevent.obj
new file mode 100644
index 0000000000..1142945e51
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_bufferevent.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/regress_dns.c b/protocols/Telegram/tgl/libevent/test/regress_dns.c
new file mode 100644
index 0000000000..1873636245
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_dns.c
@@ -0,0 +1,2151 @@
+/*
+ * Copyright (c) 2003-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "../util-internal.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#include <ws2tcpip.h>
+#endif
+
+#include "event2/event-config.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#ifndef _WIN32
+#include <sys/socket.h>
+#include <signal.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <unistd.h>
+#endif
+#ifdef EVENT__HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#include "event2/dns.h"
+#include "event2/dns_compat.h"
+#include "event2/dns_struct.h"
+#include "event2/event.h"
+#include "event2/event_compat.h"
+#include "event2/event_struct.h"
+#include "event2/util.h"
+#include "event2/listener.h"
+#include "event2/bufferevent.h"
+#include "log-internal.h"
+#include "regress.h"
+#include "regress_testutils.h"
+
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
+
+static int dns_ok = 0;
+static int dns_got_cancel = 0;
+static int dns_err = 0;
+
+
+static void
+dns_gethostbyname_cb(int result, char type, int count, int ttl,
+ void *addresses, void *arg)
+{
+ dns_ok = dns_err = 0;
+
+ if (result == DNS_ERR_TIMEOUT) {
+ printf("[Timed out] ");
+ dns_err = result;
+ goto out;
+ }
+
+ if (result != DNS_ERR_NONE) {
+ printf("[Error code %d] ", result);
+ goto out;
+ }
+
+ TT_BLATHER(("type: %d, count: %d, ttl: %d: ", type, count, ttl));
+
+ switch (type) {
+ case DNS_IPv6_AAAA: {
+#if defined(EVENT__HAVE_STRUCT_IN6_ADDR) && defined(EVENT__HAVE_INET_NTOP) && defined(INET6_ADDRSTRLEN)
+ struct in6_addr *in6_addrs = addresses;
+ char buf[INET6_ADDRSTRLEN+1];
+ int i;
+ /* a resolution that's not valid does not help */
+ if (ttl < 0)
+ goto out;
+ for (i = 0; i < count; ++i) {
+ const char *b = evutil_inet_ntop(AF_INET6, &in6_addrs[i], buf,sizeof(buf));
+ if (b)
+ TT_BLATHER(("%s ", b));
+ else
+ TT_BLATHER(("%s ", strerror(errno)));
+ }
+#endif
+ break;
+ }
+ case DNS_IPv4_A: {
+ struct in_addr *in_addrs = addresses;
+ int i;
+ /* a resolution that's not valid does not help */
+ if (ttl < 0)
+ goto out;
+ for (i = 0; i < count; ++i)
+ TT_BLATHER(("%s ", inet_ntoa(in_addrs[i])));
+ break;
+ }
+ case DNS_PTR:
+ /* may get at most one PTR */
+ if (count != 1)
+ goto out;
+
+ TT_BLATHER(("%s ", *(char **)addresses));
+ break;
+ default:
+ goto out;
+ }
+
+ dns_ok = type;
+
+out:
+ if (arg == NULL)
+ event_loopexit(NULL);
+ else
+ event_base_loopexit((struct event_base *)arg, NULL);
+}
+
+static void
+dns_gethostbyname(void)
+{
+ dns_ok = 0;
+ evdns_resolve_ipv4("www.monkey.org", 0, dns_gethostbyname_cb, NULL);
+ event_dispatch();
+
+ tt_int_op(dns_ok, ==, DNS_IPv4_A);
+ test_ok = dns_ok;
+end:
+ ;
+}
+
+static void
+dns_gethostbyname6(void)
+{
+ dns_ok = 0;
+ evdns_resolve_ipv6("www.ietf.org", 0, dns_gethostbyname_cb, NULL);
+ event_dispatch();
+
+ if (!dns_ok && dns_err == DNS_ERR_TIMEOUT) {
+ tt_skip();
+ }
+
+ tt_int_op(dns_ok, ==, DNS_IPv6_AAAA);
+ test_ok = 1;
+end:
+ ;
+}
+
+static void
+dns_gethostbyaddr(void)
+{
+ struct in_addr in;
+ in.s_addr = htonl(0x7f000001ul); /* 127.0.0.1 */
+ dns_ok = 0;
+ evdns_resolve_reverse(&in, 0, dns_gethostbyname_cb, NULL);
+ event_dispatch();
+
+ tt_int_op(dns_ok, ==, DNS_PTR);
+ test_ok = dns_ok;
+end:
+ ;
+}
+
+static void
+dns_resolve_reverse(void *ptr)
+{
+ struct in_addr in;
+ struct event_base *base = event_base_new();
+ struct evdns_base *dns = evdns_base_new(base, 1/* init name servers */);
+ struct evdns_request *req = NULL;
+
+ tt_assert(base);
+ tt_assert(dns);
+ in.s_addr = htonl(0x7f000001ul); /* 127.0.0.1 */
+ dns_ok = 0;
+
+ req = evdns_base_resolve_reverse(
+ dns, &in, 0, dns_gethostbyname_cb, base);
+ tt_assert(req);
+
+ event_base_dispatch(base);
+
+ tt_int_op(dns_ok, ==, DNS_PTR);
+
+end:
+ if (dns)
+ evdns_base_free(dns, 0);
+ if (base)
+ event_base_free(base);
+}
+
+static int n_server_responses = 0;
+
+static void
+dns_server_request_cb(struct evdns_server_request *req, void *data)
+{
+ int i, r;
+ const char TEST_ARPA[] = "11.11.168.192.in-addr.arpa";
+ const char TEST_IN6[] =
+ "f.e.f.e." "0.0.0.0." "0.0.0.0." "1.1.1.1."
+ "a.a.a.a." "0.0.0.0." "0.0.0.0." "0.f.f.f.ip6.arpa";
+
+ for (i = 0; i < req->nquestions; ++i) {
+ const int qtype = req->questions[i]->type;
+ const int qclass = req->questions[i]->dns_question_class;
+ const char *qname = req->questions[i]->name;
+
+ struct in_addr ans;
+ ans.s_addr = htonl(0xc0a80b0bUL); /* 192.168.11.11 */
+ if (qtype == EVDNS_TYPE_A &&
+ qclass == EVDNS_CLASS_INET &&
+ !evutil_ascii_strcasecmp(qname, "zz.example.com")) {
+ r = evdns_server_request_add_a_reply(req, qname,
+ 1, &ans.s_addr, 12345);
+ if (r<0)
+ dns_ok = 0;
+ } else if (qtype == EVDNS_TYPE_AAAA &&
+ qclass == EVDNS_CLASS_INET &&
+ !evutil_ascii_strcasecmp(qname, "zz.example.com")) {
+ char addr6[17] = "abcdefghijklmnop";
+ r = evdns_server_request_add_aaaa_reply(req,
+ qname, 1, addr6, 123);
+ if (r<0)
+ dns_ok = 0;
+ } else if (qtype == EVDNS_TYPE_PTR &&
+ qclass == EVDNS_CLASS_INET &&
+ !evutil_ascii_strcasecmp(qname, TEST_ARPA)) {
+ r = evdns_server_request_add_ptr_reply(req, NULL,
+ qname, "ZZ.EXAMPLE.COM", 54321);
+ if (r<0)
+ dns_ok = 0;
+ } else if (qtype == EVDNS_TYPE_PTR &&
+ qclass == EVDNS_CLASS_INET &&
+ !evutil_ascii_strcasecmp(qname, TEST_IN6)){
+ r = evdns_server_request_add_ptr_reply(req, NULL,
+ qname,
+ "ZZ-INET6.EXAMPLE.COM", 54322);
+ if (r<0)
+ dns_ok = 0;
+ } else if (qtype == EVDNS_TYPE_A &&
+ qclass == EVDNS_CLASS_INET &&
+ !evutil_ascii_strcasecmp(qname, "drop.example.com")) {
+ if (evdns_server_request_drop(req)<0)
+ dns_ok = 0;
+ return;
+ } else {
+ printf("Unexpected question %d %d \"%s\" ",
+ qtype, qclass, qname);
+ dns_ok = 0;
+ }
+ }
+ r = evdns_server_request_respond(req, 0);
+ if (r<0) {
+ printf("Couldn't send reply. ");
+ dns_ok = 0;
+ }
+}
+
+static void
+dns_server_gethostbyname_cb(int result, char type, int count, int ttl,
+ void *addresses, void *arg)
+{
+ if (result == DNS_ERR_CANCEL) {
+ if (arg != (void*)(char*)90909) {
+ printf("Unexpected cancelation");
+ dns_ok = 0;
+ }
+ dns_got_cancel = 1;
+ goto out;
+ }
+ if (result != DNS_ERR_NONE) {
+ printf("Unexpected result %d. ", result);
+ dns_ok = 0;
+ goto out;
+ }
+ if (count != 1) {
+ printf("Unexpected answer count %d. ", count);
+ dns_ok = 0;
+ goto out;
+ }
+ switch (type) {
+ case DNS_IPv4_A: {
+ struct in_addr *in_addrs = addresses;
+ if (in_addrs[0].s_addr != htonl(0xc0a80b0bUL) || ttl != 12345) {
+ printf("Bad IPv4 response \"%s\" %d. ",
+ inet_ntoa(in_addrs[0]), ttl);
+ dns_ok = 0;
+ goto out;
+ }
+ break;
+ }
+ case DNS_IPv6_AAAA: {
+#if defined (EVENT__HAVE_STRUCT_IN6_ADDR) && defined(EVENT__HAVE_INET_NTOP) && defined(INET6_ADDRSTRLEN)
+ struct in6_addr *in6_addrs = addresses;
+ char buf[INET6_ADDRSTRLEN+1];
+ if (memcmp(&in6_addrs[0].s6_addr, "abcdefghijklmnop", 16)
+ || ttl != 123) {
+ const char *b = evutil_inet_ntop(AF_INET6, &in6_addrs[0],buf,sizeof(buf));
+ printf("Bad IPv6 response \"%s\" %d. ", b, ttl);
+ dns_ok = 0;
+ goto out;
+ }
+#endif
+ break;
+ }
+ case DNS_PTR: {
+ char **addrs = addresses;
+ if (arg != (void*)6) {
+ if (strcmp(addrs[0], "ZZ.EXAMPLE.COM") ||
+ ttl != 54321) {
+ printf("Bad PTR response \"%s\" %d. ",
+ addrs[0], ttl);
+ dns_ok = 0;
+ goto out;
+ }
+ } else {
+ if (strcmp(addrs[0], "ZZ-INET6.EXAMPLE.COM") ||
+ ttl != 54322) {
+ printf("Bad ipv6 PTR response \"%s\" %d. ",
+ addrs[0], ttl);
+ dns_ok = 0;
+ goto out;
+ }
+ }
+ break;
+ }
+ default:
+ printf("Bad response type %d. ", type);
+ dns_ok = 0;
+ }
+ out:
+ if (++n_server_responses == 3) {
+ event_loopexit(NULL);
+ }
+}
+
+static void
+dns_server(void)
+{
+ evutil_socket_t sock=-1;
+ struct sockaddr_in my_addr;
+ struct sockaddr_storage ss;
+ ev_socklen_t slen;
+ struct evdns_server_port *port=NULL;
+ struct in_addr resolve_addr;
+ struct in6_addr resolve_addr6;
+ struct evdns_base *base=NULL;
+ struct evdns_request *req=NULL;
+
+ dns_ok = 1;
+
+ base = evdns_base_new(NULL, 0);
+
+ /* Now configure a nameserver port. */
+ sock = socket(AF_INET, SOCK_DGRAM, 0);
+ if (sock<0) {
+ tt_abort_perror("socket");
+ }
+
+ evutil_make_socket_nonblocking(sock);
+
+ memset(&my_addr, 0, sizeof(my_addr));
+ my_addr.sin_family = AF_INET;
+ my_addr.sin_port = 0; /* kernel picks */
+ my_addr.sin_addr.s_addr = htonl(0x7f000001UL);
+ if (bind(sock, (struct sockaddr*)&my_addr, sizeof(my_addr)) < 0) {
+ tt_abort_perror("bind");
+ }
+ slen = sizeof(ss);
+ if (getsockname(sock, (struct sockaddr*)&ss, &slen) < 0) {
+ tt_abort_perror("getsockname");
+ }
+
+ port = evdns_add_server_port(sock, 0, dns_server_request_cb, NULL);
+
+ /* Add ourself as the only nameserver, and make sure we really are
+ * the only nameserver. */
+ evdns_base_nameserver_sockaddr_add(base, (struct sockaddr*)&ss, slen, 0);
+ tt_int_op(evdns_base_count_nameservers(base), ==, 1);
+ {
+ struct sockaddr_storage ss2;
+ int slen2;
+
+ memset(&ss2, 0, sizeof(ss2));
+
+ slen2 = evdns_base_get_nameserver_addr(base, 0, (struct sockaddr *)&ss2, 3);
+ tt_int_op(slen2, ==, slen);
+ tt_int_op(ss2.ss_family, ==, 0);
+ slen2 = evdns_base_get_nameserver_addr(base, 0, (struct sockaddr *)&ss2, sizeof(ss2));
+ tt_int_op(slen2, ==, slen);
+ tt_mem_op(&ss2, ==, &ss, slen);
+
+ slen2 = evdns_base_get_nameserver_addr(base, 1, (struct sockaddr *)&ss2, sizeof(ss2));
+ tt_int_op(-1, ==, slen2);
+ }
+
+ /* Send some queries. */
+ evdns_base_resolve_ipv4(base, "zz.example.com", DNS_QUERY_NO_SEARCH,
+ dns_server_gethostbyname_cb, NULL);
+ evdns_base_resolve_ipv6(base, "zz.example.com", DNS_QUERY_NO_SEARCH,
+ dns_server_gethostbyname_cb, NULL);
+ resolve_addr.s_addr = htonl(0xc0a80b0bUL); /* 192.168.11.11 */
+ evdns_base_resolve_reverse(base, &resolve_addr, 0,
+ dns_server_gethostbyname_cb, NULL);
+ memcpy(resolve_addr6.s6_addr,
+ "\xff\xf0\x00\x00\x00\x00\xaa\xaa"
+ "\x11\x11\x00\x00\x00\x00\xef\xef", 16);
+ evdns_base_resolve_reverse_ipv6(base, &resolve_addr6, 0,
+ dns_server_gethostbyname_cb, (void*)6);
+
+ req = evdns_base_resolve_ipv4(base,
+ "drop.example.com", DNS_QUERY_NO_SEARCH,
+ dns_server_gethostbyname_cb, (void*)(char*)90909);
+
+ evdns_cancel_request(base, req);
+
+ event_dispatch();
+
+ tt_assert(dns_got_cancel);
+ test_ok = dns_ok;
+
+end:
+ if (port)
+ evdns_close_server_port(port);
+ if (sock >= 0)
+ evutil_closesocket(sock);
+ if (base)
+ evdns_base_free(base, 0);
+}
+
+static int n_replies_left;
+static struct event_base *exit_base;
+static struct evdns_server_port *exit_port;
+
+struct generic_dns_callback_result {
+ int result;
+ char type;
+ int count;
+ int ttl;
+ size_t addrs_len;
+ void *addrs;
+ char addrs_buf[256];
+};
+
+static void
+generic_dns_callback(int result, char type, int count, int ttl, void *addresses,
+ void *arg)
+{
+ size_t len;
+ struct generic_dns_callback_result *res = arg;
+ res->result = result;
+ res->type = type;
+ res->count = count;
+ res->ttl = ttl;
+
+ if (type == DNS_IPv4_A)
+ len = count * 4;
+ else if (type == DNS_IPv6_AAAA)
+ len = count * 16;
+ else if (type == DNS_PTR)
+ len = strlen(addresses)+1;
+ else {
+ res->addrs_len = len = 0;
+ res->addrs = NULL;
+ }
+ if (len) {
+ res->addrs_len = len;
+ if (len > 256)
+ len = 256;
+ memcpy(res->addrs_buf, addresses, len);
+ res->addrs = res->addrs_buf;
+ }
+
+ --n_replies_left;
+ if (n_replies_left == 0) {
+ if (exit_port) {
+ evdns_close_server_port(exit_port);
+ exit_port = NULL;
+ } else
+ event_base_loopexit(exit_base, NULL);
+ }
+}
+
+static struct regress_dns_server_table search_table[] = {
+ { "host.a.example.com", "err", "3", 0, 0 },
+ { "host.b.example.com", "err", "3", 0, 0 },
+ { "host.c.example.com", "A", "11.22.33.44", 0, 0 },
+ { "host2.a.example.com", "err", "3", 0, 0 },
+ { "host2.b.example.com", "A", "200.100.0.100", 0, 0 },
+ { "host2.c.example.com", "err", "3", 0, 0 },
+ { "hostn.a.example.com", "errsoa", "0", 0, 0 },
+ { "hostn.b.example.com", "errsoa", "3", 0, 0 },
+ { "hostn.c.example.com", "err", "0", 0, 0 },
+
+ { "host", "err", "3", 0, 0 },
+ { "host2", "err", "3", 0, 0 },
+ { "*", "err", "3", 0, 0 },
+ { NULL, NULL, NULL, 0, 0 }
+};
+static void
+dns_search_test_impl(void *arg, int lower)
+{
+ struct regress_dns_server_table table[ARRAY_SIZE(search_table)];
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+ struct evdns_base *dns = NULL;
+ ev_uint16_t portnum = 0;
+ char buf[64];
+
+ struct generic_dns_callback_result r[8];
+ size_t i;
+
+ for (i = 0; i < ARRAY_SIZE(table); ++i) {
+ table[i] = search_table[i];
+ table[i].lower = lower;
+ }
+
+ tt_assert(regress_dnsserver(base, &portnum, table));
+ evutil_snprintf(buf, sizeof(buf), "127.0.0.1:%d", (int)portnum);
+
+ dns = evdns_base_new(base, 0);
+ tt_assert(!evdns_base_nameserver_ip_add(dns, buf));
+
+ evdns_base_search_add(dns, "a.example.com");
+ evdns_base_search_add(dns, "b.example.com");
+ evdns_base_search_add(dns, "c.example.com");
+
+ n_replies_left = ARRAY_SIZE(r);
+ exit_base = base;
+
+ evdns_base_resolve_ipv4(dns, "host", 0, generic_dns_callback, &r[0]);
+ evdns_base_resolve_ipv4(dns, "host2", 0, generic_dns_callback, &r[1]);
+ evdns_base_resolve_ipv4(dns, "host", DNS_NO_SEARCH, generic_dns_callback, &r[2]);
+ evdns_base_resolve_ipv4(dns, "host2", DNS_NO_SEARCH, generic_dns_callback, &r[3]);
+ evdns_base_resolve_ipv4(dns, "host3", 0, generic_dns_callback, &r[4]);
+ evdns_base_resolve_ipv4(dns, "hostn.a.example.com", DNS_NO_SEARCH, generic_dns_callback, &r[5]);
+ evdns_base_resolve_ipv4(dns, "hostn.b.example.com", DNS_NO_SEARCH, generic_dns_callback, &r[6]);
+ evdns_base_resolve_ipv4(dns, "hostn.c.example.com", DNS_NO_SEARCH, generic_dns_callback, &r[7]);
+
+ event_base_dispatch(base);
+
+ tt_int_op(r[0].type, ==, DNS_IPv4_A);
+ tt_int_op(r[0].count, ==, 1);
+ tt_int_op(((ev_uint32_t*)r[0].addrs)[0], ==, htonl(0x0b16212c));
+ tt_int_op(r[1].type, ==, DNS_IPv4_A);
+ tt_int_op(r[1].count, ==, 1);
+ tt_int_op(((ev_uint32_t*)r[1].addrs)[0], ==, htonl(0xc8640064));
+ tt_int_op(r[2].result, ==, DNS_ERR_NOTEXIST);
+ tt_int_op(r[3].result, ==, DNS_ERR_NOTEXIST);
+ tt_int_op(r[4].result, ==, DNS_ERR_NOTEXIST);
+ tt_int_op(r[5].result, ==, DNS_ERR_NODATA);
+ tt_int_op(r[5].ttl, ==, 42);
+ tt_int_op(r[6].result, ==, DNS_ERR_NOTEXIST);
+ tt_int_op(r[6].ttl, ==, 42);
+ tt_int_op(r[7].result, ==, DNS_ERR_NODATA);
+ tt_int_op(r[7].ttl, ==, 0);
+
+end:
+ if (dns)
+ evdns_base_free(dns, 0);
+
+ regress_clean_dnsserver();
+}
+static void
+dns_search_test(void *arg)
+{
+ return dns_search_test_impl(arg, 0);
+}
+static void
+dns_search_lower_test(void *arg)
+{
+ return dns_search_test_impl(arg, 1);
+}
+
+static int request_count = 0;
+static struct evdns_request *current_req = NULL;
+
+static void
+search_cancel_server_cb(struct evdns_server_request *req, void *data)
+{
+ const char *question;
+
+ if (req->nquestions != 1)
+ TT_DIE(("Only handling one question at a time; got %d",
+ req->nquestions));
+
+ question = req->questions[0]->name;
+
+ TT_BLATHER(("got question, %s", question));
+
+ tt_assert(request_count > 0);
+ tt_assert(!evdns_server_request_respond(req, 3));
+
+ if (!--request_count)
+ evdns_cancel_request(NULL, current_req);
+
+end:
+ ;
+}
+
+static void
+dns_search_cancel_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+ struct evdns_base *dns = NULL;
+ struct evdns_server_port *port = NULL;
+ ev_uint16_t portnum = 0;
+ struct generic_dns_callback_result r1;
+ char buf[64];
+
+ port = regress_get_dnsserver(base, &portnum, NULL,
+ search_cancel_server_cb, NULL);
+ tt_assert(port);
+ evutil_snprintf(buf, sizeof(buf), "127.0.0.1:%d", (int)portnum);
+
+ dns = evdns_base_new(base, 0);
+ tt_assert(!evdns_base_nameserver_ip_add(dns, buf));
+
+ evdns_base_search_add(dns, "a.example.com");
+ evdns_base_search_add(dns, "b.example.com");
+ evdns_base_search_add(dns, "c.example.com");
+ evdns_base_search_add(dns, "d.example.com");
+
+ exit_base = base;
+ request_count = 3;
+ n_replies_left = 1;
+
+ current_req = evdns_base_resolve_ipv4(dns, "host", 0,
+ generic_dns_callback, &r1);
+ event_base_dispatch(base);
+
+ tt_int_op(r1.result, ==, DNS_ERR_CANCEL);
+
+end:
+ if (port)
+ evdns_close_server_port(port);
+ if (dns)
+ evdns_base_free(dns, 0);
+}
+
+static void
+fail_server_cb(struct evdns_server_request *req, void *data)
+{
+ const char *question;
+ int *count = data;
+ struct in_addr in;
+
+ /* Drop the first N requests that we get. */
+ if (*count > 0) {
+ --*count;
+ tt_want(! evdns_server_request_drop(req));
+ return;
+ }
+
+ if (req->nquestions != 1)
+ TT_DIE(("Only handling one question at a time; got %d",
+ req->nquestions));
+
+ question = req->questions[0]->name;
+
+ if (!evutil_ascii_strcasecmp(question, "google.com")) {
+ /* Detect a probe, and get out of the loop. */
+ event_base_loopexit(exit_base, NULL);
+ }
+
+ tt_assert(evutil_inet_pton(AF_INET, "16.32.64.128", &in));
+ evdns_server_request_add_a_reply(req, question, 1, &in.s_addr,
+ 100);
+ tt_assert(! evdns_server_request_respond(req, 0))
+ return;
+end:
+ tt_want(! evdns_server_request_drop(req));
+}
+
+static void
+dns_retry_test_impl(void *arg, int flags)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+ struct evdns_server_port *port = NULL;
+ struct evdns_base *dns = NULL;
+ int drop_count = 2;
+ ev_uint16_t portnum = 0;
+ char buf[64];
+
+ struct generic_dns_callback_result r1;
+
+ port = regress_get_dnsserver(base, &portnum, NULL,
+ fail_server_cb, &drop_count);
+ tt_assert(port);
+ evutil_snprintf(buf, sizeof(buf), "127.0.0.1:%d", (int)portnum);
+
+ dns = evdns_base_new(base, flags);
+ tt_assert(!evdns_base_nameserver_ip_add(dns, buf));
+ tt_assert(! evdns_base_set_option(dns, "timeout", "0.2"));
+ tt_assert(! evdns_base_set_option(dns, "max-timeouts:", "10"));
+ tt_assert(! evdns_base_set_option(dns, "initial-probe-timeout", "0.1"));
+
+ evdns_base_resolve_ipv4(dns, "host.example.com", 0,
+ generic_dns_callback, &r1);
+
+ n_replies_left = 1;
+ exit_base = base;
+
+ event_base_dispatch(base);
+
+ tt_int_op(drop_count, ==, 0);
+
+ tt_int_op(r1.type, ==, DNS_IPv4_A);
+ tt_int_op(r1.count, ==, 1);
+ tt_int_op(((ev_uint32_t*)r1.addrs)[0], ==, htonl(0x10204080));
+
+ /* Now try again, but this time have the server get treated as
+ * failed, so we can send it a test probe. */
+ drop_count = 4;
+ tt_assert(! evdns_base_set_option(dns, "max-timeouts:", "2"));
+ tt_assert(! evdns_base_set_option(dns, "attempts:", "3"));
+ memset(&r1, 0, sizeof(r1));
+
+ evdns_base_resolve_ipv4(dns, "host.example.com", 0,
+ generic_dns_callback, &r1);
+
+ n_replies_left = 2;
+
+ /* This will run until it answers the "google.com" probe request. */
+ event_base_dispatch(base);
+
+ /* We'll treat the server as failed here. */
+ tt_int_op(r1.result, ==, DNS_ERR_TIMEOUT);
+
+ /* It should work this time. */
+ tt_int_op(drop_count, ==, 0);
+ evdns_base_resolve_ipv4(dns, "host.example.com", 0,
+ generic_dns_callback, &r1);
+
+ event_base_dispatch(base);
+ tt_int_op(r1.result, ==, DNS_ERR_NONE);
+ tt_int_op(r1.type, ==, DNS_IPv4_A);
+ tt_int_op(r1.count, ==, 1);
+ tt_int_op(((ev_uint32_t*)r1.addrs)[0], ==, htonl(0x10204080));
+
+end:
+ if (dns)
+ evdns_base_free(dns, 0);
+ if (port)
+ evdns_close_server_port(port);
+}
+static void
+dns_retry_test(void *arg)
+{
+ dns_retry_test_impl(arg, 0);
+}
+static void
+dns_retry_disable_when_inactive_test(void *arg)
+{
+ dns_retry_test_impl(arg, EVDNS_BASE_DISABLE_WHEN_INACTIVE);
+}
+
+static struct regress_dns_server_table internal_error_table[] = {
+ /* Error 4 (NOTIMPL) makes us reissue the request to another server
+ if we can.
+
+ XXXX we should reissue under a much wider set of circumstances!
+ */
+ { "foof.example.com", "err", "4", 0, 0 },
+ { NULL, NULL, NULL, 0, 0 }
+};
+
+static struct regress_dns_server_table reissue_table[] = {
+ { "foof.example.com", "A", "240.15.240.15", 0, 0 },
+ { NULL, NULL, NULL, 0, 0 }
+};
+
+static void
+dns_reissue_test_impl(void *arg, int flags)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+ struct evdns_server_port *port1 = NULL, *port2 = NULL;
+ struct evdns_base *dns = NULL;
+ struct generic_dns_callback_result r1;
+ ev_uint16_t portnum1 = 0, portnum2=0;
+ char buf1[64], buf2[64];
+
+ port1 = regress_get_dnsserver(base, &portnum1, NULL,
+ regress_dns_server_cb, internal_error_table);
+ tt_assert(port1);
+ port2 = regress_get_dnsserver(base, &portnum2, NULL,
+ regress_dns_server_cb, reissue_table);
+ tt_assert(port2);
+ evutil_snprintf(buf1, sizeof(buf1), "127.0.0.1:%d", (int)portnum1);
+ evutil_snprintf(buf2, sizeof(buf2), "127.0.0.1:%d", (int)portnum2);
+
+ dns = evdns_base_new(base, flags);
+ tt_assert(!evdns_base_nameserver_ip_add(dns, buf1));
+ tt_assert(! evdns_base_set_option(dns, "timeout:", "0.3"));
+ tt_assert(! evdns_base_set_option(dns, "max-timeouts:", "2"));
+ tt_assert(! evdns_base_set_option(dns, "attempts:", "5"));
+
+ memset(&r1, 0, sizeof(r1));
+ evdns_base_resolve_ipv4(dns, "foof.example.com", 0,
+ generic_dns_callback, &r1);
+
+ /* Add this after, so that we are sure to get a reissue. */
+ tt_assert(!evdns_base_nameserver_ip_add(dns, buf2));
+
+ n_replies_left = 1;
+ exit_base = base;
+
+ event_base_dispatch(base);
+ tt_int_op(r1.result, ==, DNS_ERR_NONE);
+ tt_int_op(r1.type, ==, DNS_IPv4_A);
+ tt_int_op(r1.count, ==, 1);
+ tt_int_op(((ev_uint32_t*)r1.addrs)[0], ==, htonl(0xf00ff00f));
+
+ /* Make sure we dropped at least once. */
+ tt_int_op(internal_error_table[0].seen, >, 0);
+
+end:
+ if (dns)
+ evdns_base_free(dns, 0);
+ if (port1)
+ evdns_close_server_port(port1);
+ if (port2)
+ evdns_close_server_port(port2);
+}
+static void
+dns_reissue_test(void *arg)
+{
+ dns_reissue_test_impl(arg, 0);
+}
+static void
+dns_reissue_disable_when_inactive_test(void *arg)
+{
+ dns_reissue_test_impl(arg, EVDNS_BASE_DISABLE_WHEN_INACTIVE);
+}
+
+#if 0
+static void
+dumb_bytes_fn(char *p, size_t n)
+{
+ unsigned i;
+ /* This gets us 6 bits of entropy per transaction ID, which means we
+ * will have probably have collisions and need to pick again. */
+ for (i=0;i<n;++i)
+ p[i] = (char)(rand() & 7);
+}
+#endif
+
+static void
+dns_inflight_test_impl(void *arg, int flags)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+ struct evdns_base *dns = NULL;
+ struct evdns_server_port *dns_port = NULL;
+ ev_uint16_t portnum = 0;
+ char buf[64];
+ int disable_when_inactive = flags & EVDNS_BASE_DISABLE_WHEN_INACTIVE;
+
+ struct generic_dns_callback_result r[20];
+ int i;
+
+ dns_port = regress_get_dnsserver(base, &portnum, NULL,
+ regress_dns_server_cb, reissue_table);
+ tt_assert(dns_port);
+ if (disable_when_inactive) {
+ exit_port = dns_port;
+ }
+
+ evutil_snprintf(buf, sizeof(buf), "127.0.0.1:%d", (int)portnum);
+
+ dns = evdns_base_new(base, flags);
+ tt_assert(!evdns_base_nameserver_ip_add(dns, buf));
+ tt_assert(! evdns_base_set_option(dns, "max-inflight:", "3"));
+ tt_assert(! evdns_base_set_option(dns, "randomize-case:", "0"));
+
+ for (i=0;i<20;++i)
+ evdns_base_resolve_ipv4(dns, "foof.example.com", 0, generic_dns_callback, &r[i]);
+
+ n_replies_left = 20;
+ exit_base = base;
+
+ event_base_dispatch(base);
+
+ for (i=0;i<20;++i) {
+ tt_int_op(r[i].type, ==, DNS_IPv4_A);
+ tt_int_op(r[i].count, ==, 1);
+ tt_int_op(((ev_uint32_t*)r[i].addrs)[0], ==, htonl(0xf00ff00f));
+ }
+
+end:
+ if (dns)
+ evdns_base_free(dns, 0);
+ if (exit_port) {
+ evdns_close_server_port(exit_port);
+ exit_port = NULL;
+ } else if (! disable_when_inactive) {
+ evdns_close_server_port(dns_port);
+ }
+}
+
+static void
+dns_inflight_test(void *arg)
+{
+ dns_inflight_test_impl(arg, 0);
+}
+
+static void
+dns_disable_when_inactive_test(void *arg)
+{
+ dns_inflight_test_impl(arg, EVDNS_BASE_DISABLE_WHEN_INACTIVE);
+}
+
+static void
+dns_disable_when_inactive_no_ns_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base, *inactive_base;
+ struct evdns_base *dns = NULL;
+ ev_uint16_t portnum = 0;
+ char buf[64];
+ struct generic_dns_callback_result r;
+
+ inactive_base = event_base_new();
+ tt_assert(inactive_base);
+
+ /** Create dns server with inactive base, to avoid replying to clients */
+ tt_assert(regress_dnsserver(inactive_base, &portnum, search_table));
+ evutil_snprintf(buf, sizeof(buf), "127.0.0.1:%d", (int)portnum);
+
+ dns = evdns_base_new(base, EVDNS_BASE_DISABLE_WHEN_INACTIVE);
+ tt_assert(!evdns_base_nameserver_ip_add(dns, buf));
+ tt_assert(! evdns_base_set_option(dns, "timeout:", "0.1"));
+
+ evdns_base_resolve_ipv4(dns, "foof.example.com", 0, generic_dns_callback, &r);
+ n_replies_left = 1;
+ exit_base = base;
+
+ event_base_dispatch(base);
+
+ tt_int_op(n_replies_left, ==, 0);
+
+ tt_int_op(r.result, ==, DNS_ERR_TIMEOUT);
+ tt_int_op(r.count, ==, 0);
+ tt_ptr_op(r.addrs, ==, NULL);
+
+end:
+ if (dns)
+ evdns_base_free(dns, 0);
+ regress_clean_dnsserver();
+ if (inactive_base)
+ event_base_free(inactive_base);
+}
+
+/* === Test for bufferevent_socket_connect_hostname */
+
+static int total_connected_or_failed = 0;
+static int total_n_accepted = 0;
+static struct event_base *be_connect_hostname_base = NULL;
+
+/* Implements a DNS server for the connect_hostname test and the
+ * getaddrinfo_async test */
+static void
+be_getaddrinfo_server_cb(struct evdns_server_request *req, void *data)
+{
+ int i;
+ int *n_got_p=data;
+ int added_any=0;
+ ++*n_got_p;
+
+ for (i=0;i<req->nquestions;++i) {
+ const int qtype = req->questions[i]->type;
+ const int qclass = req->questions[i]->dns_question_class;
+ const char *qname = req->questions[i]->name;
+ struct in_addr ans;
+ struct in6_addr ans6;
+ memset(&ans6, 0, sizeof(ans6));
+
+ TT_BLATHER(("Got question about %s, type=%d", qname, qtype));
+
+ if (qtype == EVDNS_TYPE_A &&
+ qclass == EVDNS_CLASS_INET &&
+ !evutil_ascii_strcasecmp(qname, "nobodaddy.example.com")) {
+ ans.s_addr = htonl(0x7f000001);
+ evdns_server_request_add_a_reply(req, qname,
+ 1, &ans.s_addr, 2000);
+ added_any = 1;
+ } else if (!evutil_ascii_strcasecmp(qname,
+ "nosuchplace.example.com")) {
+ /* ok, just say notfound. */
+ } else if (!evutil_ascii_strcasecmp(qname,
+ "both.example.com")) {
+ if (qtype == EVDNS_TYPE_A) {
+ ans.s_addr = htonl(0x50502020);
+ evdns_server_request_add_a_reply(req, qname,
+ 1, &ans.s_addr, 2000);
+ added_any = 1;
+ } else if (qtype == EVDNS_TYPE_AAAA) {
+ ans6.s6_addr[0] = 0x80;
+ ans6.s6_addr[1] = 0xff;
+ ans6.s6_addr[14] = 0xbb;
+ ans6.s6_addr[15] = 0xbb;
+ evdns_server_request_add_aaaa_reply(req, qname,
+ 1, &ans6.s6_addr, 2000);
+ added_any = 1;
+ }
+ evdns_server_request_add_cname_reply(req, qname,
+ "both-canonical.example.com", 1000);
+ } else if (!evutil_ascii_strcasecmp(qname,
+ "v4only.example.com") ||
+ !evutil_ascii_strcasecmp(qname, "v4assert.example.com")) {
+ if (qtype == EVDNS_TYPE_A) {
+ ans.s_addr = htonl(0x12345678);
+ evdns_server_request_add_a_reply(req, qname,
+ 1, &ans.s_addr, 2000);
+ added_any = 1;
+ } else if (!evutil_ascii_strcasecmp(qname,
+ "v4assert.example.com")) {
+ TT_FAIL(("Got an AAAA request for v4assert"));
+ }
+ } else if (!evutil_ascii_strcasecmp(qname,
+ "v6only.example.com") ||
+ !evutil_ascii_strcasecmp(qname, "v6assert.example.com")) {
+ if (qtype == EVDNS_TYPE_AAAA) {
+ ans6.s6_addr[0] = 0x0b;
+ ans6.s6_addr[1] = 0x0b;
+ ans6.s6_addr[14] = 0xf0;
+ ans6.s6_addr[15] = 0x0d;
+ evdns_server_request_add_aaaa_reply(req, qname,
+ 1, &ans6.s6_addr, 2000);
+ added_any = 1;
+ } else if (!evutil_ascii_strcasecmp(qname,
+ "v6assert.example.com")) {
+ TT_FAIL(("Got a A request for v6assert"));
+ }
+ } else if (!evutil_ascii_strcasecmp(qname,
+ "v6timeout.example.com")) {
+ if (qtype == EVDNS_TYPE_A) {
+ ans.s_addr = htonl(0xabcdef01);
+ evdns_server_request_add_a_reply(req, qname,
+ 1, &ans.s_addr, 2000);
+ added_any = 1;
+ } else if (qtype == EVDNS_TYPE_AAAA) {
+ /* Let the v6 request time out.*/
+ evdns_server_request_drop(req);
+ return;
+ }
+ } else if (!evutil_ascii_strcasecmp(qname,
+ "v4timeout.example.com")) {
+ if (qtype == EVDNS_TYPE_AAAA) {
+ ans6.s6_addr[0] = 0x0a;
+ ans6.s6_addr[1] = 0x0a;
+ ans6.s6_addr[14] = 0xff;
+ ans6.s6_addr[15] = 0x01;
+ evdns_server_request_add_aaaa_reply(req, qname,
+ 1, &ans6.s6_addr, 2000);
+ added_any = 1;
+ } else if (qtype == EVDNS_TYPE_A) {
+ /* Let the v4 request time out.*/
+ evdns_server_request_drop(req);
+ return;
+ }
+ } else if (!evutil_ascii_strcasecmp(qname,
+ "v6timeout-nonexist.example.com")) {
+ if (qtype == EVDNS_TYPE_A) {
+ /* Fall through, give an nexist. */
+ } else if (qtype == EVDNS_TYPE_AAAA) {
+ /* Let the v6 request time out.*/
+ evdns_server_request_drop(req);
+ return;
+ }
+ } else if (!evutil_ascii_strcasecmp(qname,
+ "all-timeout.example.com")) {
+ /* drop all requests */
+ evdns_server_request_drop(req);
+ return;
+ } else {
+ TT_GRIPE(("Got weird request for %s",qname));
+ }
+ }
+ if (added_any) {
+ TT_BLATHER(("answering"));
+ evdns_server_request_respond(req, 0);
+ } else {
+ TT_BLATHER(("saying nexist."));
+ evdns_server_request_respond(req, 3);
+ }
+}
+
+/* Implements a listener for connect_hostname test. */
+static void
+nil_accept_cb(struct evconnlistener *l, evutil_socket_t fd, struct sockaddr *s,
+ int socklen, void *arg)
+{
+ int *p = arg;
+ (*p)++;
+ ++total_n_accepted;
+ /* don't do anything with the socket; let it close when we exit() */
+ if (total_n_accepted >= 3 && total_connected_or_failed >= 5)
+ event_base_loopexit(be_connect_hostname_base,
+ NULL);
+}
+
+struct be_conn_hostname_result {
+ int dnserr;
+ int what;
+};
+
+/* Bufferevent event callback for the connect_hostname test: remembers what
+ * event we got. */
+static void
+be_connect_hostname_event_cb(struct bufferevent *bev, short what, void *ctx)
+{
+ struct be_conn_hostname_result *got = ctx;
+ if (!got->what) {
+ TT_BLATHER(("Got a bufferevent event %d", what));
+ got->what = what;
+
+ if ((what & BEV_EVENT_CONNECTED) || (what & BEV_EVENT_ERROR)) {
+ int r;
+ if ((r = bufferevent_socket_get_dns_error(bev))) {
+ got->dnserr = r;
+ TT_BLATHER(("DNS error %d: %s", r,
+ evutil_gai_strerror(r)));
+ } ++total_connected_or_failed;
+ TT_BLATHER(("Got %d connections or errors.", total_connected_or_failed));
+
+ if (total_n_accepted >= 3 && total_connected_or_failed >= 5)
+ event_base_loopexit(be_connect_hostname_base,
+ NULL);
+ }
+ } else {
+ TT_FAIL(("Two events on one bufferevent. %d,%d",
+ got->what, (int)what));
+ }
+}
+
+static void
+test_bufferevent_connect_hostname(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct evconnlistener *listener = NULL;
+ struct bufferevent *be1=NULL, *be2=NULL, *be3=NULL, *be4=NULL, *be5=NULL;
+ struct be_conn_hostname_result be1_outcome={0,0}, be2_outcome={0,0},
+ be3_outcome={0,0}, be4_outcome={0,0}, be5_outcome={0,0};
+ int expect_err5;
+ struct evdns_base *dns=NULL;
+ struct evdns_server_port *port=NULL;
+ struct sockaddr_in sin;
+ int listener_port=-1;
+ ev_uint16_t dns_port=0;
+ int n_accept=0, n_dns=0;
+ char buf[128];
+
+ be_connect_hostname_base = data->base;
+
+ /* Bind an address and figure out what port it's on. */
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_addr.s_addr = htonl(0x7f000001); /* 127.0.0.1 */
+ sin.sin_port = 0;
+ listener = evconnlistener_new_bind(data->base, nil_accept_cb,
+ &n_accept,
+ LEV_OPT_REUSEABLE|LEV_OPT_CLOSE_ON_EXEC,
+ -1, (struct sockaddr *)&sin, sizeof(sin));
+ tt_assert(listener);
+ listener_port = regress_get_socket_port(
+ evconnlistener_get_fd(listener));
+
+ port = regress_get_dnsserver(data->base, &dns_port, NULL,
+ be_getaddrinfo_server_cb, &n_dns);
+ tt_assert(port);
+ tt_int_op(dns_port, >=, 0);
+
+ /* Start an evdns_base that uses the server as its resolver. */
+ dns = evdns_base_new(data->base, 0);
+ evutil_snprintf(buf, sizeof(buf), "127.0.0.1:%d", (int)dns_port);
+ evdns_base_nameserver_ip_add(dns, buf);
+
+ /* Now, finally, at long last, launch the bufferevents. One should do
+ * a failing lookup IP, one should do a successful lookup by IP,
+ * and one should do a successful lookup by hostname. */
+ be1 = bufferevent_socket_new(data->base, -1, BEV_OPT_CLOSE_ON_FREE);
+ be2 = bufferevent_socket_new(data->base, -1, BEV_OPT_CLOSE_ON_FREE);
+ be3 = bufferevent_socket_new(data->base, -1, BEV_OPT_CLOSE_ON_FREE);
+ be4 = bufferevent_socket_new(data->base, -1, BEV_OPT_CLOSE_ON_FREE);
+ be5 = bufferevent_socket_new(data->base, -1, BEV_OPT_CLOSE_ON_FREE);
+
+ bufferevent_setcb(be1, NULL, NULL, be_connect_hostname_event_cb,
+ &be1_outcome);
+ bufferevent_setcb(be2, NULL, NULL, be_connect_hostname_event_cb,
+ &be2_outcome);
+ bufferevent_setcb(be3, NULL, NULL, be_connect_hostname_event_cb,
+ &be3_outcome);
+ bufferevent_setcb(be4, NULL, NULL, be_connect_hostname_event_cb,
+ &be4_outcome);
+ bufferevent_setcb(be5, NULL, NULL, be_connect_hostname_event_cb,
+ &be5_outcome);
+
+ /* Launch an async resolve that will fail. */
+ tt_assert(!bufferevent_socket_connect_hostname(be1, dns, AF_INET,
+ "nosuchplace.example.com", listener_port));
+ /* Connect to the IP without resolving. */
+ tt_assert(!bufferevent_socket_connect_hostname(be2, dns, AF_INET,
+ "127.0.0.1", listener_port));
+ /* Launch an async resolve that will succeed. */
+ tt_assert(!bufferevent_socket_connect_hostname(be3, dns, AF_INET,
+ "nobodaddy.example.com", listener_port));
+ /* Use the blocking resolver. This one will fail if your resolver
+ * can't resolve localhost to 127.0.0.1 */
+ tt_assert(!bufferevent_socket_connect_hostname(be4, NULL, AF_INET,
+ "localhost", listener_port));
+ /* Use the blocking resolver with a nonexistent hostname. */
+ tt_assert(!bufferevent_socket_connect_hostname(be5, NULL, AF_INET,
+ "nonesuch.nowhere.example.com", 80));
+ {
+ /* The blocking resolver will use the system nameserver, which
+ * might tell us anything. (Yes, some twits even pretend that
+ * example.com is real.) Let's see what answer to expect. */
+ struct evutil_addrinfo hints, *ai = NULL;
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = AF_INET;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_protocol = IPPROTO_TCP;
+ expect_err5 = evutil_getaddrinfo(
+ "nonesuch.nowhere.example.com", "80", &hints, &ai);
+ }
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(be1_outcome.what, ==, BEV_EVENT_ERROR);
+ tt_int_op(be1_outcome.dnserr, ==, EVUTIL_EAI_NONAME);
+ tt_int_op(be2_outcome.what, ==, BEV_EVENT_CONNECTED);
+ tt_int_op(be2_outcome.dnserr, ==, 0);
+ tt_int_op(be3_outcome.what, ==, BEV_EVENT_CONNECTED);
+ tt_int_op(be3_outcome.dnserr, ==, 0);
+ tt_int_op(be4_outcome.what, ==, BEV_EVENT_CONNECTED);
+ tt_int_op(be4_outcome.dnserr, ==, 0);
+ if (expect_err5) {
+ tt_int_op(be5_outcome.what, ==, BEV_EVENT_ERROR);
+ tt_int_op(be5_outcome.dnserr, ==, expect_err5);
+ }
+
+ tt_int_op(n_accept, ==, 3);
+ tt_int_op(n_dns, ==, 2);
+
+end:
+ if (listener)
+ evconnlistener_free(listener);
+ if (port)
+ evdns_close_server_port(port);
+ if (dns)
+ evdns_base_free(dns, 0);
+ if (be1)
+ bufferevent_free(be1);
+ if (be2)
+ bufferevent_free(be2);
+ if (be3)
+ bufferevent_free(be3);
+ if (be4)
+ bufferevent_free(be4);
+ if (be5)
+ bufferevent_free(be5);
+}
+
+
+struct gai_outcome {
+ int err;
+ struct evutil_addrinfo *ai;
+};
+
+static int n_gai_results_pending = 0;
+static struct event_base *exit_base_on_no_pending_results = NULL;
+
+static void
+gai_cb(int err, struct evutil_addrinfo *res, void *ptr)
+{
+ struct gai_outcome *go = ptr;
+ go->err = err;
+ go->ai = res;
+ if (--n_gai_results_pending <= 0 && exit_base_on_no_pending_results)
+ event_base_loopexit(exit_base_on_no_pending_results, NULL);
+ if (n_gai_results_pending < 900)
+ TT_BLATHER(("Got an answer; expecting %d more.",
+ n_gai_results_pending));
+}
+
+static void
+cancel_gai_cb(evutil_socket_t fd, short what, void *ptr)
+{
+ struct evdns_getaddrinfo_request *r = ptr;
+ evdns_getaddrinfo_cancel(r);
+}
+
+static void
+test_getaddrinfo_async(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct evutil_addrinfo hints, *a;
+ struct gai_outcome local_outcome;
+ struct gai_outcome a_out[12];
+ int i;
+ struct evdns_getaddrinfo_request *r;
+ char buf[128];
+ struct evdns_server_port *port = NULL;
+ ev_uint16_t dns_port = 0;
+ int n_dns_questions = 0;
+ struct evdns_base *dns_base;
+
+ memset(a_out, 0, sizeof(a_out));
+ memset(&local_outcome, 0, sizeof(local_outcome));
+
+ dns_base = evdns_base_new(data->base, 0);
+ tt_assert(dns_base);
+
+ /* for localhost */
+ evdns_base_load_hosts(dns_base, NULL);
+
+ tt_assert(! evdns_base_set_option(dns_base, "timeout", "0.3"));
+ tt_assert(! evdns_base_set_option(dns_base, "getaddrinfo-allow-skew", "0.2"));
+
+ n_gai_results_pending = 10000; /* don't think about exiting yet. */
+
+ /* 1. Try some cases that will never hit the asynchronous resolver. */
+ /* 1a. Simple case with a symbolic service name */
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ memset(&local_outcome, 0, sizeof(local_outcome));
+ r = evdns_getaddrinfo(dns_base, "1.2.3.4", "http",
+ &hints, gai_cb, &local_outcome);
+ tt_assert(! r);
+ if (!local_outcome.err) {
+ tt_ptr_op(local_outcome.ai,!=,NULL);
+ test_ai_eq(local_outcome.ai, "1.2.3.4:80", SOCK_STREAM, IPPROTO_TCP);
+ evutil_freeaddrinfo(local_outcome.ai);
+ local_outcome.ai = NULL;
+ } else {
+ TT_BLATHER(("Apparently we have no getservbyname."));
+ }
+
+ /* 1b. EVUTIL_AI_NUMERICHOST is set */
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_flags = EVUTIL_AI_NUMERICHOST;
+ memset(&local_outcome, 0, sizeof(local_outcome));
+ r = evdns_getaddrinfo(dns_base, "www.google.com", "80",
+ &hints, gai_cb, &local_outcome);
+ tt_ptr_op(r,==,NULL);
+ tt_int_op(local_outcome.err,==,EVUTIL_EAI_NONAME);
+ tt_ptr_op(local_outcome.ai,==,NULL);
+
+ /* 1c. We give a numeric address (ipv6) */
+ memset(&hints, 0, sizeof(hints));
+ memset(&local_outcome, 0, sizeof(local_outcome));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_protocol = IPPROTO_TCP;
+ r = evdns_getaddrinfo(dns_base, "f::f", "8008",
+ &hints, gai_cb, &local_outcome);
+ tt_assert(!r);
+ tt_int_op(local_outcome.err,==,0);
+ tt_assert(local_outcome.ai);
+ tt_ptr_op(local_outcome.ai->ai_next,==,NULL);
+ test_ai_eq(local_outcome.ai, "[f::f]:8008", SOCK_STREAM, IPPROTO_TCP);
+ evutil_freeaddrinfo(local_outcome.ai);
+ local_outcome.ai = NULL;
+
+ /* 1d. We give a numeric address (ipv4) */
+ memset(&hints, 0, sizeof(hints));
+ memset(&local_outcome, 0, sizeof(local_outcome));
+ hints.ai_family = PF_UNSPEC;
+ r = evdns_getaddrinfo(dns_base, "5.6.7.8", NULL,
+ &hints, gai_cb, &local_outcome);
+ tt_assert(!r);
+ tt_int_op(local_outcome.err,==,0);
+ tt_assert(local_outcome.ai);
+ a = ai_find_by_protocol(local_outcome.ai, IPPROTO_TCP);
+ tt_assert(a);
+ test_ai_eq(a, "5.6.7.8", SOCK_STREAM, IPPROTO_TCP);
+ a = ai_find_by_protocol(local_outcome.ai, IPPROTO_UDP);
+ tt_assert(a);
+ test_ai_eq(a, "5.6.7.8", SOCK_DGRAM, IPPROTO_UDP);
+ evutil_freeaddrinfo(local_outcome.ai);
+ local_outcome.ai = NULL;
+
+ /* 1e. nodename is NULL (bind) */
+ memset(&hints, 0, sizeof(hints));
+ memset(&local_outcome, 0, sizeof(local_outcome));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_socktype = SOCK_DGRAM;
+ hints.ai_flags = EVUTIL_AI_PASSIVE;
+ r = evdns_getaddrinfo(dns_base, NULL, "9090",
+ &hints, gai_cb, &local_outcome);
+ tt_assert(!r);
+ tt_int_op(local_outcome.err,==,0);
+ tt_assert(local_outcome.ai);
+ /* we should get a v4 address of 0.0.0.0... */
+ a = ai_find_by_family(local_outcome.ai, PF_INET);
+ tt_assert(a);
+ test_ai_eq(a, "0.0.0.0:9090", SOCK_DGRAM, IPPROTO_UDP);
+ /* ... and a v6 address of ::0 */
+ a = ai_find_by_family(local_outcome.ai, PF_INET6);
+ tt_assert(a);
+ test_ai_eq(a, "[::]:9090", SOCK_DGRAM, IPPROTO_UDP);
+ evutil_freeaddrinfo(local_outcome.ai);
+ local_outcome.ai = NULL;
+
+ /* 1f. nodename is NULL (connect) */
+ memset(&hints, 0, sizeof(hints));
+ memset(&local_outcome, 0, sizeof(local_outcome));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ r = evdns_getaddrinfo(dns_base, NULL, "2",
+ &hints, gai_cb, &local_outcome);
+ tt_assert(!r);
+ tt_int_op(local_outcome.err,==,0);
+ tt_assert(local_outcome.ai);
+ /* we should get a v4 address of 127.0.0.1 .... */
+ a = ai_find_by_family(local_outcome.ai, PF_INET);
+ tt_assert(a);
+ test_ai_eq(a, "127.0.0.1:2", SOCK_STREAM, IPPROTO_TCP);
+ /* ... and a v6 address of ::1 */
+ a = ai_find_by_family(local_outcome.ai, PF_INET6);
+ tt_assert(a);
+ test_ai_eq(a, "[::1]:2", SOCK_STREAM, IPPROTO_TCP);
+ evutil_freeaddrinfo(local_outcome.ai);
+ local_outcome.ai = NULL;
+
+ /* 1g. We find localhost immediately. (pf_unspec) */
+ memset(&hints, 0, sizeof(hints));
+ memset(&local_outcome, 0, sizeof(local_outcome));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ r = evdns_getaddrinfo(dns_base, "LOCALHOST", "80",
+ &hints, gai_cb, &local_outcome);
+ tt_assert(!r);
+ tt_int_op(local_outcome.err,==,0);
+ tt_assert(local_outcome.ai);
+ /* we should get a v4 address of 127.0.0.1 .... */
+ a = ai_find_by_family(local_outcome.ai, PF_INET);
+ tt_assert(a);
+ test_ai_eq(a, "127.0.0.1:80", SOCK_STREAM, IPPROTO_TCP);
+ /* ... and a v6 address of ::1 */
+ a = ai_find_by_family(local_outcome.ai, PF_INET6);
+ tt_assert(a);
+ test_ai_eq(a, "[::1]:80", SOCK_STREAM, IPPROTO_TCP);
+ evutil_freeaddrinfo(local_outcome.ai);
+ local_outcome.ai = NULL;
+
+ /* 1g. We find localhost immediately. (pf_inet6) */
+ memset(&hints, 0, sizeof(hints));
+ memset(&local_outcome, 0, sizeof(local_outcome));
+ hints.ai_family = PF_INET6;
+ hints.ai_socktype = SOCK_STREAM;
+ r = evdns_getaddrinfo(dns_base, "LOCALHOST", "9999",
+ &hints, gai_cb, &local_outcome);
+ tt_assert(! r);
+ tt_int_op(local_outcome.err,==,0);
+ tt_assert(local_outcome.ai);
+ a = local_outcome.ai;
+ test_ai_eq(a, "[::1]:9999", SOCK_STREAM, IPPROTO_TCP);
+ tt_ptr_op(a->ai_next, ==, NULL);
+ evutil_freeaddrinfo(local_outcome.ai);
+ local_outcome.ai = NULL;
+
+ /* 2. Okay, now we can actually test the asynchronous resolver. */
+ /* Start a dummy local dns server... */
+ port = regress_get_dnsserver(data->base, &dns_port, NULL,
+ be_getaddrinfo_server_cb, &n_dns_questions);
+ tt_assert(port);
+ tt_int_op(dns_port, >=, 0);
+ /* ... and tell the evdns_base about it. */
+ evutil_snprintf(buf, sizeof(buf), "127.0.0.1:%d", dns_port);
+ evdns_base_nameserver_ip_add(dns_base, buf);
+
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_flags = EVUTIL_AI_CANONNAME;
+ /* 0: Request for both.example.com should return both addresses. */
+ r = evdns_getaddrinfo(dns_base, "both.example.com", "8000",
+ &hints, gai_cb, &a_out[0]);
+ tt_assert(r);
+
+ /* 1: Request for v4only.example.com should return one address. */
+ r = evdns_getaddrinfo(dns_base, "v4only.example.com", "8001",
+ &hints, gai_cb, &a_out[1]);
+ tt_assert(r);
+
+ /* 2: Request for v6only.example.com should return one address. */
+ hints.ai_flags = 0;
+ r = evdns_getaddrinfo(dns_base, "v6only.example.com", "8002",
+ &hints, gai_cb, &a_out[2]);
+ tt_assert(r);
+
+ /* 3: PF_INET request for v4assert.example.com should not generate a
+ * v6 request. The server will fail the test if it does. */
+ hints.ai_family = PF_INET;
+ r = evdns_getaddrinfo(dns_base, "v4assert.example.com", "8003",
+ &hints, gai_cb, &a_out[3]);
+ tt_assert(r);
+
+ /* 4: PF_INET6 request for v6assert.example.com should not generate a
+ * v4 request. The server will fail the test if it does. */
+ hints.ai_family = PF_INET6;
+ r = evdns_getaddrinfo(dns_base, "v6assert.example.com", "8004",
+ &hints, gai_cb, &a_out[4]);
+ tt_assert(r);
+
+ /* 5: PF_INET request for nosuchplace.example.com should give NEXIST. */
+ hints.ai_family = PF_INET;
+ r = evdns_getaddrinfo(dns_base, "nosuchplace.example.com", "8005",
+ &hints, gai_cb, &a_out[5]);
+ tt_assert(r);
+
+ /* 6: PF_UNSPEC request for nosuchplace.example.com should give NEXIST.
+ */
+ hints.ai_family = PF_UNSPEC;
+ r = evdns_getaddrinfo(dns_base, "nosuchplace.example.com", "8006",
+ &hints, gai_cb, &a_out[6]);
+ tt_assert(r);
+
+ /* 7: PF_UNSPEC request for v6timeout.example.com should give an ipv4
+ * address only. */
+ hints.ai_family = PF_UNSPEC;
+ r = evdns_getaddrinfo(dns_base, "v6timeout.example.com", "8007",
+ &hints, gai_cb, &a_out[7]);
+ tt_assert(r);
+
+ /* 8: PF_UNSPEC request for v6timeout-nonexist.example.com should give
+ * a NEXIST */
+ hints.ai_family = PF_UNSPEC;
+ r = evdns_getaddrinfo(dns_base, "v6timeout-nonexist.example.com",
+ "8008", &hints, gai_cb, &a_out[8]);
+ tt_assert(r);
+
+ /* 9: AI_ADDRCONFIG should at least not crash. Can't test it more
+ * without knowing what kind of internet we have. */
+ hints.ai_flags |= EVUTIL_AI_ADDRCONFIG;
+ r = evdns_getaddrinfo(dns_base, "both.example.com",
+ "8009", &hints, gai_cb, &a_out[9]);
+ tt_assert(r);
+
+ /* 10: PF_UNSPEC for v4timeout.example.com should give an ipv6 address
+ * only. */
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_flags = 0;
+ r = evdns_getaddrinfo(dns_base, "v4timeout.example.com", "8010",
+ &hints, gai_cb, &a_out[10]);
+ tt_assert(r);
+
+ /* 11: timeout.example.com: cancel it after 100 msec. */
+ r = evdns_getaddrinfo(dns_base, "all-timeout.example.com", "8011",
+ &hints, gai_cb, &a_out[11]);
+ tt_assert(r);
+ {
+ struct timeval tv;
+ tv.tv_sec = 0;
+ tv.tv_usec = 100*1000; /* 100 msec */
+ event_base_once(data->base, -1, EV_TIMEOUT, cancel_gai_cb,
+ r, &tv);
+ }
+
+ /* XXXXX There are more tests we could do, including:
+
+ - A test to elicit NODATA.
+
+ */
+
+ n_gai_results_pending = 12;
+ exit_base_on_no_pending_results = data->base;
+
+ event_base_dispatch(data->base);
+
+ /* 0: both.example.com */
+ tt_int_op(a_out[0].err, ==, 0);
+ tt_assert(a_out[0].ai);
+ tt_assert(a_out[0].ai->ai_next);
+ tt_assert(!a_out[0].ai->ai_next->ai_next);
+ a = ai_find_by_family(a_out[0].ai, PF_INET);
+ tt_assert(a);
+ test_ai_eq(a, "80.80.32.32:8000", SOCK_STREAM, IPPROTO_TCP);
+ a = ai_find_by_family(a_out[0].ai, PF_INET6);
+ tt_assert(a);
+ test_ai_eq(a, "[80ff::bbbb]:8000", SOCK_STREAM, IPPROTO_TCP);
+ tt_assert(a_out[0].ai->ai_canonname);
+ tt_str_op(a_out[0].ai->ai_canonname, ==, "both-canonical.example.com");
+
+ /* 1: v4only.example.com */
+ tt_int_op(a_out[1].err, ==, 0);
+ tt_assert(a_out[1].ai);
+ tt_assert(! a_out[1].ai->ai_next);
+ test_ai_eq(a_out[1].ai, "18.52.86.120:8001", SOCK_STREAM, IPPROTO_TCP);
+ tt_assert(a_out[1].ai->ai_canonname == NULL);
+
+
+ /* 2: v6only.example.com */
+ tt_int_op(a_out[2].err, ==, 0);
+ tt_assert(a_out[2].ai);
+ tt_assert(! a_out[2].ai->ai_next);
+ test_ai_eq(a_out[2].ai, "[b0b::f00d]:8002", SOCK_STREAM, IPPROTO_TCP);
+
+ /* 3: v4assert.example.com */
+ tt_int_op(a_out[3].err, ==, 0);
+ tt_assert(a_out[3].ai);
+ tt_assert(! a_out[3].ai->ai_next);
+ test_ai_eq(a_out[3].ai, "18.52.86.120:8003", SOCK_STREAM, IPPROTO_TCP);
+
+ /* 4: v6assert.example.com */
+ tt_int_op(a_out[4].err, ==, 0);
+ tt_assert(a_out[4].ai);
+ tt_assert(! a_out[4].ai->ai_next);
+ test_ai_eq(a_out[4].ai, "[b0b::f00d]:8004", SOCK_STREAM, IPPROTO_TCP);
+
+ /* 5: nosuchplace.example.com (inet) */
+ tt_int_op(a_out[5].err, ==, EVUTIL_EAI_NONAME);
+ tt_assert(! a_out[5].ai);
+
+ /* 6: nosuchplace.example.com (unspec) */
+ tt_int_op(a_out[6].err, ==, EVUTIL_EAI_NONAME);
+ tt_assert(! a_out[6].ai);
+
+ /* 7: v6timeout.example.com */
+ tt_int_op(a_out[7].err, ==, 0);
+ tt_assert(a_out[7].ai);
+ tt_assert(! a_out[7].ai->ai_next);
+ test_ai_eq(a_out[7].ai, "171.205.239.1:8007", SOCK_STREAM, IPPROTO_TCP);
+
+ /* 8: v6timeout-nonexist.example.com */
+ tt_int_op(a_out[8].err, ==, EVUTIL_EAI_NONAME);
+ tt_assert(! a_out[8].ai);
+
+ /* 9: both (ADDRCONFIG) */
+ tt_int_op(a_out[9].err, ==, 0);
+ tt_assert(a_out[9].ai);
+ a = ai_find_by_family(a_out[9].ai, PF_INET);
+ if (a)
+ test_ai_eq(a, "80.80.32.32:8009", SOCK_STREAM, IPPROTO_TCP);
+ else
+ tt_assert(ai_find_by_family(a_out[9].ai, PF_INET6));
+ a = ai_find_by_family(a_out[9].ai, PF_INET6);
+ if (a)
+ test_ai_eq(a, "[80ff::bbbb]:8009", SOCK_STREAM, IPPROTO_TCP);
+ else
+ tt_assert(ai_find_by_family(a_out[9].ai, PF_INET));
+
+ /* 10: v4timeout.example.com */
+ tt_int_op(a_out[10].err, ==, 0);
+ tt_assert(a_out[10].ai);
+ tt_assert(! a_out[10].ai->ai_next);
+ test_ai_eq(a_out[10].ai, "[a0a::ff01]:8010", SOCK_STREAM, IPPROTO_TCP);
+
+ /* 11: cancelled request. */
+ tt_int_op(a_out[11].err, ==, EVUTIL_EAI_CANCEL);
+ tt_assert(a_out[11].ai == NULL);
+
+end:
+ if (local_outcome.ai)
+ evutil_freeaddrinfo(local_outcome.ai);
+ for (i=0;i<(int)ARRAY_SIZE(a_out);++i) {
+ if (a_out[i].ai)
+ evutil_freeaddrinfo(a_out[i].ai);
+ }
+ if (port)
+ evdns_close_server_port(port);
+ if (dns_base)
+ evdns_base_free(dns_base, 0);
+}
+
+struct gaic_request_status {
+ int magic;
+ struct event_base *base;
+ struct evdns_base *dns_base;
+ struct evdns_getaddrinfo_request *request;
+ struct event cancel_event;
+ int canceled;
+};
+
+#define GAIC_MAGIC 0x1234abcd
+
+static int pending = 0;
+
+static void
+gaic_cancel_request_cb(evutil_socket_t fd, short what, void *arg)
+{
+ struct gaic_request_status *status = arg;
+
+ tt_assert(status->magic == GAIC_MAGIC);
+ status->canceled = 1;
+ evdns_getaddrinfo_cancel(status->request);
+ return;
+end:
+ event_base_loopexit(status->base, NULL);
+}
+
+static void
+gaic_server_cb(struct evdns_server_request *req, void *arg)
+{
+ ev_uint32_t answer = 0x7f000001;
+ tt_assert(req->nquestions);
+ evdns_server_request_add_a_reply(req, req->questions[0]->name, 1,
+ &answer, 100);
+ evdns_server_request_respond(req, 0);
+ return;
+end:
+ evdns_server_request_respond(req, DNS_ERR_REFUSED);
+}
+
+
+static void
+gaic_getaddrinfo_cb(int result, struct evutil_addrinfo *res, void *arg)
+{
+ struct gaic_request_status *status = arg;
+ struct event_base *base = status->base;
+ tt_assert(status->magic == GAIC_MAGIC);
+
+ if (result == EVUTIL_EAI_CANCEL) {
+ tt_assert(status->canceled);
+ }
+ event_del(&status->cancel_event);
+
+ memset(status, 0xf0, sizeof(*status));
+ free(status);
+
+end:
+ if (--pending <= 0)
+ event_base_loopexit(base, NULL);
+}
+
+static void
+gaic_launch(struct event_base *base, struct evdns_base *dns_base)
+{
+ struct gaic_request_status *status = calloc(1,sizeof(*status));
+ struct timeval tv = { 0, 10000 };
+ status->magic = GAIC_MAGIC;
+ status->base = base;
+ status->dns_base = dns_base;
+ event_assign(&status->cancel_event, base, -1, 0, gaic_cancel_request_cb,
+ status);
+ status->request = evdns_getaddrinfo(dns_base,
+ "foobar.bazquux.example.com", "80", NULL, gaic_getaddrinfo_cb,
+ status);
+ event_add(&status->cancel_event, &tv);
+ ++pending;
+}
+
+#ifdef EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED
+/* FIXME: We should move this to regress_main.c if anything else needs it.*/
+
+/* Trivial replacements for malloc/free/realloc to check for memory leaks.
+ * Not threadsafe. */
+static int allocated_chunks = 0;
+
+static void *
+cnt_malloc(size_t sz)
+{
+ allocated_chunks += 1;
+ return malloc(sz);
+}
+
+static void *
+cnt_realloc(void *old, size_t sz)
+{
+ if (!old)
+ allocated_chunks += 1;
+ if (!sz)
+ allocated_chunks -= 1;
+ return realloc(old, sz);
+}
+
+static void
+cnt_free(void *ptr)
+{
+ allocated_chunks -= 1;
+ free(ptr);
+}
+
+struct testleak_env_t {
+ struct event_base *base;
+ struct evdns_base *dns_base;
+ struct evdns_request *req;
+ struct generic_dns_callback_result r;
+};
+
+static void *
+testleak_setup(const struct testcase_t *testcase)
+{
+ struct testleak_env_t *env;
+
+ allocated_chunks = 0;
+
+ /* Reset allocation counter, to start allocations from the very beginning.
+ * (this will avoid false-positive negative numbers for allocated_chunks)
+ */
+ libevent_global_shutdown();
+
+ event_set_mem_functions(cnt_malloc, cnt_realloc, cnt_free);
+
+ event_enable_debug_mode();
+
+ /* not mm_calloc: we don't want to mess with the count. */
+ env = calloc(1, sizeof(struct testleak_env_t));
+ env->base = event_base_new();
+ env->dns_base = evdns_base_new(env->base, 0);
+ env->req = evdns_base_resolve_ipv4(
+ env->dns_base, "example.com", DNS_QUERY_NO_SEARCH,
+ generic_dns_callback, &env->r);
+ return env;
+}
+
+static int
+testleak_cleanup(const struct testcase_t *testcase, void *env_)
+{
+ int ok = 0;
+ struct testleak_env_t *env = env_;
+ tt_assert(env);
+#ifdef EVENT__DISABLE_DEBUG_MODE
+ tt_int_op(allocated_chunks, ==, 0);
+#else
+ libevent_global_shutdown();
+ tt_int_op(allocated_chunks, ==, 0);
+#endif
+ ok = 1;
+end:
+ if (env) {
+ if (env->dns_base)
+ evdns_base_free(env->dns_base, 0);
+ if (env->base)
+ event_base_free(env->base);
+ free(env);
+ }
+ return ok;
+}
+
+static struct testcase_setup_t testleak_funcs = {
+ testleak_setup, testleak_cleanup
+};
+
+static void
+test_dbg_leak_cancel(void *env_)
+{
+ /* cancel, loop, free/dns, free/base */
+ struct testleak_env_t *env = env_;
+ int send_err_shutdown = 1;
+ evdns_cancel_request(env->dns_base, env->req);
+ env->req = 0;
+
+ /* `req` is freed in callback, that's why one loop is required. */
+ event_base_loop(env->base, EVLOOP_NONBLOCK);
+
+ /* send_err_shutdown means nothing as soon as our request is
+ * already canceled */
+ evdns_base_free(env->dns_base, send_err_shutdown);
+ env->dns_base = 0;
+ event_base_free(env->base);
+ env->base = 0;
+}
+
+static void
+dbg_leak_resume(void *env_, int cancel, int send_err_shutdown)
+{
+ /* cancel, loop, free/dns, free/base */
+ struct testleak_env_t *env = env_;
+ if (cancel) {
+ evdns_cancel_request(env->dns_base, env->req);
+ tt_assert(!evdns_base_resume(env->dns_base));
+ } else {
+ /* TODO: No nameservers, request can't be processed, must be errored */
+ tt_assert(!evdns_base_resume(env->dns_base));
+ }
+
+ event_base_loop(env->base, EVLOOP_NONBLOCK);
+ /**
+ * Because we don't cancel request, and want our callback to recieve
+ * DNS_ERR_SHUTDOWN, we use deferred callback, and there was:
+ * - one extra malloc(),
+ * @see reply_schedule_callback()
+ * - and one missing free
+ * @see request_finished() (req->handle->pending_cb = 1)
+ * than we don't need to count in testleak_cleanup(), but we can clean them
+ * if we will run loop once again, but *after* evdns base freed.
+ */
+ evdns_base_free(env->dns_base, send_err_shutdown);
+ env->dns_base = 0;
+ event_base_loop(env->base, EVLOOP_NONBLOCK);
+
+end:
+ event_base_free(env->base);
+ env->base = 0;
+}
+
+#define IMPL_DBG_LEAK_RESUME(name, cancel, send_err_shutdown) \
+ static void \
+ test_dbg_leak_##name##_(void *env_) \
+ { \
+ dbg_leak_resume(env_, cancel, send_err_shutdown); \
+ }
+IMPL_DBG_LEAK_RESUME(resume, 0, 0)
+IMPL_DBG_LEAK_RESUME(cancel_and_resume, 1, 0)
+IMPL_DBG_LEAK_RESUME(resume_send_err, 0, 1)
+IMPL_DBG_LEAK_RESUME(cancel_and_resume_send_err, 1, 1)
+
+static void
+test_dbg_leak_shutdown(void *env_)
+{
+ /* free/dns, loop, free/base */
+ struct testleak_env_t *env = env_;
+ int send_err_shutdown = 1;
+
+ /* `req` is freed both with `send_err_shutdown` and without it,
+ * the only difference is `evdns_callback` call */
+ env->req = 0;
+
+ evdns_base_free(env->dns_base, send_err_shutdown);
+ env->dns_base = 0;
+
+ /* `req` is freed in callback, that's why one loop is required */
+ event_base_loop(env->base, EVLOOP_NONBLOCK);
+ event_base_free(env->base);
+ env->base = 0;
+}
+#endif
+
+static void
+test_getaddrinfo_async_cancel_stress(void *ptr)
+{
+ struct event_base *base;
+ struct evdns_base *dns_base = NULL;
+ struct evdns_server_port *server = NULL;
+ evutil_socket_t fd = -1;
+ struct sockaddr_in sin;
+ struct sockaddr_storage ss;
+ ev_socklen_t slen;
+ int i;
+
+ base = event_base_new();
+ dns_base = evdns_base_new(base, 0);
+
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_port = 0;
+ sin.sin_addr.s_addr = htonl(0x7f000001);
+ if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+ tt_abort_perror("socket");
+ }
+ evutil_make_socket_nonblocking(fd);
+ if (bind(fd, (struct sockaddr*)&sin, sizeof(sin))<0) {
+ tt_abort_perror("bind");
+ }
+ server = evdns_add_server_port_with_base(base, fd, 0, gaic_server_cb,
+ base);
+
+ memset(&ss, 0, sizeof(ss));
+ slen = sizeof(ss);
+ if (getsockname(fd, (struct sockaddr*)&ss, &slen)<0) {
+ tt_abort_perror("getsockname");
+ }
+ evdns_base_nameserver_sockaddr_add(dns_base,
+ (struct sockaddr*)&ss, slen, 0);
+
+ for (i = 0; i < 1000; ++i) {
+ gaic_launch(base, dns_base);
+ }
+
+ event_base_dispatch(base);
+
+end:
+ if (dns_base)
+ evdns_base_free(dns_base, 1);
+ if (server)
+ evdns_close_server_port(server);
+ if (base)
+ event_base_free(base);
+ if (fd >= 0)
+ evutil_closesocket(fd);
+}
+
+static void
+dns_client_fail_requests_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+ struct evdns_base *dns = NULL;
+ struct evdns_server_port *dns_port = NULL;
+ ev_uint16_t portnum = 0;
+ char buf[64];
+
+ struct generic_dns_callback_result r[20];
+ int i;
+
+ dns_port = regress_get_dnsserver(base, &portnum, NULL,
+ regress_dns_server_cb, reissue_table);
+ tt_assert(dns_port);
+
+ evutil_snprintf(buf, sizeof(buf), "127.0.0.1:%d", (int)portnum);
+
+ dns = evdns_base_new(base, EVDNS_BASE_DISABLE_WHEN_INACTIVE);
+ tt_assert(!evdns_base_nameserver_ip_add(dns, buf));
+
+ for (i = 0; i < 20; ++i)
+ evdns_base_resolve_ipv4(dns, "foof.example.com", 0, generic_dns_callback, &r[i]);
+
+ n_replies_left = 20;
+ exit_base = base;
+
+ evdns_base_free(dns, 1 /** fail requests */);
+ /** run defered callbacks, to trigger UAF */
+ event_base_dispatch(base);
+
+ tt_int_op(n_replies_left, ==, 0);
+ for (i = 0; i < 20; ++i)
+ tt_int_op(r[i].result, ==, DNS_ERR_SHUTDOWN);
+
+end:
+ evdns_close_server_port(dns_port);
+}
+
+static void
+getaddrinfo_cb(int err, struct evutil_addrinfo *res, void *ptr)
+{
+ generic_dns_callback(err, 0, 0, 0, NULL, ptr);
+}
+static void
+dns_client_fail_requests_getaddrinfo_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+ struct evdns_base *dns = NULL;
+ struct evdns_server_port *dns_port = NULL;
+ ev_uint16_t portnum = 0;
+ char buf[64];
+
+ struct generic_dns_callback_result r[20];
+ int i;
+
+ dns_port = regress_get_dnsserver(base, &portnum, NULL,
+ regress_dns_server_cb, reissue_table);
+ tt_assert(dns_port);
+
+ evutil_snprintf(buf, sizeof(buf), "127.0.0.1:%d", (int)portnum);
+
+ dns = evdns_base_new(base, EVDNS_BASE_DISABLE_WHEN_INACTIVE);
+ tt_assert(!evdns_base_nameserver_ip_add(dns, buf));
+
+ for (i = 0; i < 20; ++i)
+ tt_assert(evdns_getaddrinfo(dns, "foof.example.com", "http", NULL, getaddrinfo_cb, &r[i]));
+
+ n_replies_left = 20;
+ exit_base = base;
+
+ evdns_base_free(dns, 1 /** fail requests */);
+ /** run defered callbacks, to trigger UAF */
+ event_base_dispatch(base);
+
+ tt_int_op(n_replies_left, ==, 0);
+ for (i = 0; i < 20; ++i)
+ tt_int_op(r[i].result, ==, EVUTIL_EAI_FAIL);
+
+end:
+ evdns_close_server_port(dns_port);
+}
+
+
+#define DNS_LEGACY(name, flags) \
+ { #name, run_legacy_test_fn, flags|TT_LEGACY, &legacy_setup, \
+ dns_##name }
+
+struct testcase_t dns_testcases[] = {
+ DNS_LEGACY(server, TT_FORK|TT_NEED_BASE),
+ DNS_LEGACY(gethostbyname, TT_FORK|TT_NEED_BASE|TT_NEED_DNS|TT_OFF_BY_DEFAULT),
+ DNS_LEGACY(gethostbyname6, TT_FORK|TT_NEED_BASE|TT_NEED_DNS|TT_OFF_BY_DEFAULT),
+ DNS_LEGACY(gethostbyaddr, TT_FORK|TT_NEED_BASE|TT_NEED_DNS|TT_OFF_BY_DEFAULT),
+ { "resolve_reverse", dns_resolve_reverse, TT_FORK|TT_OFF_BY_DEFAULT, NULL, NULL },
+ { "search", dns_search_test, TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
+ { "search_lower", dns_search_lower_test, TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
+ { "search_cancel", dns_search_cancel_test,
+ TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
+ { "retry", dns_retry_test, TT_FORK|TT_NEED_BASE|TT_NO_LOGS, &basic_setup, NULL },
+ { "retry_disable_when_inactive", dns_retry_disable_when_inactive_test,
+ TT_FORK|TT_NEED_BASE|TT_NO_LOGS, &basic_setup, NULL },
+ { "reissue", dns_reissue_test, TT_FORK|TT_NEED_BASE|TT_NO_LOGS, &basic_setup, NULL },
+ { "reissue_disable_when_inactive", dns_reissue_disable_when_inactive_test,
+ TT_FORK|TT_NEED_BASE|TT_NO_LOGS, &basic_setup, NULL },
+ { "inflight", dns_inflight_test, TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
+ { "bufferevent_connect_hostname", test_bufferevent_connect_hostname,
+ TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
+ { "disable_when_inactive", dns_disable_when_inactive_test,
+ TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
+ { "disable_when_inactive_no_ns", dns_disable_when_inactive_no_ns_test,
+ TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
+
+ { "getaddrinfo_async", test_getaddrinfo_async,
+ TT_FORK|TT_NEED_BASE, &basic_setup, (char*)"" },
+ { "getaddrinfo_cancel_stress", test_getaddrinfo_async_cancel_stress,
+ TT_FORK, NULL, NULL },
+
+#ifdef EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED
+ { "leak_shutdown", test_dbg_leak_shutdown, TT_FORK, &testleak_funcs, NULL },
+ { "leak_cancel", test_dbg_leak_cancel, TT_FORK, &testleak_funcs, NULL },
+
+ { "leak_resume", test_dbg_leak_resume_, TT_FORK, &testleak_funcs, NULL },
+ { "leak_cancel_and_resume", test_dbg_leak_cancel_and_resume_,
+ TT_FORK, &testleak_funcs, NULL },
+ { "leak_resume_send_err", test_dbg_leak_resume_send_err_,
+ TT_FORK, &testleak_funcs, NULL },
+ { "leak_cancel_and_resume_send_err", test_dbg_leak_cancel_and_resume_send_err_,
+ TT_FORK, &testleak_funcs, NULL },
+#endif
+
+ { "client_fail_requests", dns_client_fail_requests_test,
+ TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
+ { "client_fail_requests_getaddrinfo",
+ dns_client_fail_requests_getaddrinfo_test,
+ TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
+
+ END_OF_TESTCASES
+};
+
diff --git a/protocols/Telegram/tgl/libevent/test/regress_dns.obj b/protocols/Telegram/tgl/libevent/test/regress_dns.obj
new file mode 100644
index 0000000000..4406585f06
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_dns.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/regress_et.c b/protocols/Telegram/tgl/libevent/test/regress_et.c
new file mode 100644
index 0000000000..229a78e2d4
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_et.c
@@ -0,0 +1,208 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "../util-internal.h"
+#include "event2/event-config.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#ifndef _WIN32
+#include <sys/time.h>
+#include <unistd.h>
+#endif
+#include <errno.h>
+
+#include "event2/event.h"
+#include "event2/util.h"
+
+#include "regress.h"
+
+static int was_et = 0;
+
+static void
+read_cb(evutil_socket_t fd, short event, void *arg)
+{
+ char buf;
+ int len;
+
+ len = recv(fd, &buf, sizeof(buf), 0);
+
+ called++;
+ if (event & EV_ET)
+ was_et = 1;
+
+ if (!len)
+ event_del(arg);
+}
+
+#ifndef SHUT_WR
+#define SHUT_WR 1
+#endif
+
+#ifdef _WIN32
+#define LOCAL_SOCKETPAIR_AF AF_INET
+#else
+#define LOCAL_SOCKETPAIR_AF AF_UNIX
+#endif
+
+static void
+test_edgetriggered(void *et)
+{
+ struct event *ev = NULL;
+ struct event_base *base = NULL;
+ const char *test = "test string";
+ evutil_socket_t pair[2] = {-1,-1};
+ int supports_et;
+
+ /* On Linux 3.2.1 (at least, as patched by Fedora and tested by Nick),
+ * doing a "recv" on an AF_UNIX socket resets the readability of the
+ * socket, even though there is no state change, so we don't actually
+ * get edge-triggered behavior. Yuck! Linux 3.1.9 didn't have this
+ * problem.
+ */
+#ifdef __linux__
+ if (evutil_ersatz_socketpair_(AF_INET, SOCK_STREAM, 0, pair) == -1) {
+ tt_abort_perror("socketpair");
+ }
+#else
+ if (evutil_socketpair(LOCAL_SOCKETPAIR_AF, SOCK_STREAM, 0, pair) == -1) {
+ tt_abort_perror("socketpair");
+ }
+#endif
+
+ called = was_et = 0;
+
+ tt_int_op(send(pair[0], test, (int)strlen(test)+1, 0), >, 0);
+ shutdown(pair[0], SHUT_WR);
+
+ /* Initalize the event library */
+ base = event_base_new();
+
+ if (!strcmp(event_base_get_method(base), "epoll") ||
+ !strcmp(event_base_get_method(base), "epoll (with changelist)") ||
+ !strcmp(event_base_get_method(base), "kqueue"))
+ supports_et = 1;
+ else
+ supports_et = 0;
+
+ TT_BLATHER(("Checking for edge-triggered events with %s, which should %s"
+ "support edge-triggering", event_base_get_method(base),
+ supports_et?"":"not "));
+
+ /* Initalize one event */
+ ev = event_new(base, pair[1], EV_READ|EV_ET|EV_PERSIST, read_cb, &ev);
+
+ event_add(ev, NULL);
+
+ /* We're going to call the dispatch function twice. The first invocation
+ * will read a single byte from pair[1] in either case. If we're edge
+ * triggered, we'll only see the event once (since we only see transitions
+ * from no data to data), so the second invocation of event_base_loop will
+ * do nothing. If we're level triggered, the second invocation of
+ * event_base_loop will also activate the event (because there's still
+ * data to read). */
+ event_base_loop(base,EVLOOP_NONBLOCK|EVLOOP_ONCE);
+ event_base_loop(base,EVLOOP_NONBLOCK|EVLOOP_ONCE);
+
+ if (supports_et) {
+ tt_int_op(called, ==, 1);
+ tt_assert(was_et);
+ } else {
+ tt_int_op(called, ==, 2);
+ tt_assert(!was_et);
+ }
+
+ end:
+ if (ev) {
+ event_del(ev);
+ event_free(ev);
+ }
+ if (base)
+ event_base_free(base);
+ evutil_closesocket(pair[0]);
+ evutil_closesocket(pair[1]);
+}
+
+static void
+test_edgetriggered_mix_error(void *data_)
+{
+ struct basic_test_data *data = data_;
+ struct event_base *base = NULL;
+ struct event *ev_et=NULL, *ev_lt=NULL;
+
+#ifdef EVENT__DISABLE_DEBUG_MODE
+ if (1)
+ tt_skip();
+#endif
+
+ if (!libevent_tests_running_in_debug_mode)
+ event_enable_debug_mode();
+
+ base = event_base_new();
+
+ /* try mixing edge-triggered and level-triggered to make sure it fails*/
+ ev_et = event_new(base, data->pair[0], EV_READ|EV_ET, read_cb, ev_et);
+ tt_assert(ev_et);
+ ev_lt = event_new(base, data->pair[0], EV_READ, read_cb, ev_lt);
+ tt_assert(ev_lt);
+
+ /* Add edge-triggered, then level-triggered. Get an error. */
+ tt_int_op(0, ==, event_add(ev_et, NULL));
+ tt_int_op(-1, ==, event_add(ev_lt, NULL));
+ tt_int_op(EV_READ, ==, event_pending(ev_et, EV_READ, NULL));
+ tt_int_op(0, ==, event_pending(ev_lt, EV_READ, NULL));
+
+ tt_int_op(0, ==, event_del(ev_et));
+ /* Add level-triggered, then edge-triggered. Get an error. */
+ tt_int_op(0, ==, event_add(ev_lt, NULL));
+ tt_int_op(-1, ==, event_add(ev_et, NULL));
+ tt_int_op(EV_READ, ==, event_pending(ev_lt, EV_READ, NULL));
+ tt_int_op(0, ==, event_pending(ev_et, EV_READ, NULL));
+
+end:
+ if (ev_et)
+ event_free(ev_et);
+ if (ev_lt)
+ event_free(ev_lt);
+ if (base)
+ event_base_free(base);
+}
+
+struct testcase_t edgetriggered_testcases[] = {
+ { "et", test_edgetriggered, TT_FORK, NULL, NULL },
+ { "et_mix_error", test_edgetriggered_mix_error,
+ TT_FORK|TT_NEED_SOCKETPAIR|TT_NO_LOGS, &basic_setup, NULL },
+ END_OF_TESTCASES
+};
diff --git a/protocols/Telegram/tgl/libevent/test/regress_et.obj b/protocols/Telegram/tgl/libevent/test/regress_et.obj
new file mode 100644
index 0000000000..e745dc87e6
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_et.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/regress_finalize.c b/protocols/Telegram/tgl/libevent/test/regress_finalize.c
new file mode 100644
index 0000000000..552210fe9d
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_finalize.c
@@ -0,0 +1,347 @@
+/*
+ * Copyright (c) 2013 Niels Provos and Nick Mathewson
+ *
+ * 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 "event2/event-config.h"
+#include "evconfig-private.h"
+#include "tinytest.h"
+#include "tinytest_macros.h"
+#include <stdlib.h>
+
+#include "event2/event.h"
+#include "event2/util.h"
+#include "event-internal.h"
+#include "defer-internal.h"
+
+#include "regress.h"
+#include "regress_thread.h"
+
+static void
+timer_callback(evutil_socket_t fd, short what, void *arg)
+{
+ int *int_arg = arg;
+ *int_arg += 1;
+ (void)fd;
+ (void)what;
+}
+static void
+simple_callback(struct event_callback *evcb, void *arg)
+{
+ int *int_arg = arg;
+ *int_arg += 1;
+ (void)evcb;
+}
+static void
+event_finalize_callback_1(struct event *ev, void *arg)
+{
+ int *int_arg = arg;
+ *int_arg += 100;
+ (void)ev;
+}
+static void
+callback_finalize_callback_1(struct event_callback *evcb, void *arg)
+{
+ int *int_arg = arg;
+ *int_arg += 100;
+ (void)evcb;
+}
+
+
+static void
+test_fin_cb_invoked(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+
+ struct event *ev;
+ struct event ev2;
+ struct event_callback evcb;
+ int cb_called = 0;
+ int ev_called = 0;
+
+ const struct timeval ten_sec = {10,0};
+
+ event_deferred_cb_init_(&evcb, 0, simple_callback, &cb_called);
+ ev = evtimer_new(base, timer_callback, &ev_called);
+ /* Just finalize them; don't bother adding. */
+ event_free_finalize(0, ev, event_finalize_callback_1);
+ event_callback_finalize_(base, 0, &evcb, callback_finalize_callback_1);
+
+ event_base_dispatch(base);
+
+ tt_int_op(cb_called, ==, 100);
+ tt_int_op(ev_called, ==, 100);
+
+ ev_called = cb_called = 0;
+ event_base_assert_ok_(base);
+
+ /* Now try it when they're active. (actually, don't finalize: make
+ * sure activation can happen! */
+ ev = evtimer_new(base, timer_callback, &ev_called);
+ event_deferred_cb_init_(&evcb, 0, simple_callback, &cb_called);
+
+ event_active(ev, EV_TIMEOUT, 1);
+ event_callback_activate_(base, &evcb);
+
+ event_base_dispatch(base);
+ tt_int_op(cb_called, ==, 1);
+ tt_int_op(ev_called, ==, 1);
+
+ ev_called = cb_called = 0;
+ event_base_assert_ok_(base);
+
+ /* Great, it worked. Now activate and finalize and make sure only
+ * finalizing happens. */
+ event_active(ev, EV_TIMEOUT, 1);
+ event_callback_activate_(base, &evcb);
+ event_free_finalize(0, ev, event_finalize_callback_1);
+ event_callback_finalize_(base, 0, &evcb, callback_finalize_callback_1);
+
+ event_base_dispatch(base);
+ tt_int_op(cb_called, ==, 100);
+ tt_int_op(ev_called, ==, 100);
+
+ ev_called = 0;
+
+ event_base_assert_ok_(base);
+
+ /* Okay, now add but don't have it become active, and make sure *that*
+ * works. */
+ ev = evtimer_new(base, timer_callback, &ev_called);
+ event_add(ev, &ten_sec);
+ event_free_finalize(0, ev, event_finalize_callback_1);
+
+ event_base_dispatch(base);
+ tt_int_op(ev_called, ==, 100);
+
+ ev_called = 0;
+ event_base_assert_ok_(base);
+
+ /* Now try adding and deleting after finalizing. */
+ ev = evtimer_new(base, timer_callback, &ev_called);
+ evtimer_assign(&ev2, base, timer_callback, &ev_called);
+ event_add(ev, &ten_sec);
+ event_free_finalize(0, ev, event_finalize_callback_1);
+ event_finalize(0, &ev2, event_finalize_callback_1);
+
+ event_add(&ev2, &ten_sec);
+ event_del(ev);
+ event_active(&ev2, EV_TIMEOUT, 1);
+
+ event_base_dispatch(base);
+ tt_int_op(ev_called, ==, 200);
+
+ event_base_assert_ok_(base);
+
+end:
+ ;
+}
+
+#ifndef EVENT__DISABLE_MM_REPLACEMENT
+static void *
+tfff_malloc(size_t n)
+{
+ return malloc(n);
+}
+static void *tfff_p1=NULL, *tfff_p2=NULL;
+static int tfff_p1_freed=0, tfff_p2_freed=0;
+static void
+tfff_free(void *p)
+{
+ if (! p)
+ return;
+ if (p == tfff_p1)
+ ++tfff_p1_freed;
+ if (p == tfff_p2)
+ ++tfff_p2_freed;
+ free(p);
+}
+static void *
+tfff_realloc(void *p, size_t sz)
+{
+ return realloc(p,sz);
+}
+#endif
+
+static void
+test_fin_free_finalize(void *arg)
+{
+#ifdef EVENT__DISABLE_MM_REPLACEMENT
+ tinytest_set_test_skipped_();
+#else
+ struct event_base *base = NULL;
+ struct event *ev, *ev2;
+ int ev_called = 0;
+ int ev2_called = 0;
+
+ (void)arg;
+
+ event_set_mem_functions(tfff_malloc, tfff_realloc, tfff_free);
+
+ base = event_base_new();
+ tt_assert(base);
+
+ ev = evtimer_new(base, timer_callback, &ev_called);
+ ev2 = evtimer_new(base, timer_callback, &ev2_called);
+ tfff_p1 = ev;
+ tfff_p2 = ev2;
+ event_free_finalize(0, ev, event_finalize_callback_1);
+ event_finalize(0, ev2, event_finalize_callback_1);
+
+ event_base_dispatch(base);
+
+ tt_int_op(ev_called, ==, 100);
+ tt_int_op(ev2_called, ==, 100);
+
+ event_base_assert_ok_(base);
+ tt_int_op(tfff_p1_freed, ==, 1);
+ tt_int_op(tfff_p2_freed, ==, 0);
+
+ event_free(ev2);
+
+end:
+ if (base)
+ event_base_free(base);
+#endif
+}
+
+/* For test_fin_within_cb */
+struct event_and_count {
+ struct event *ev;
+ struct event *ev2;
+ int count;
+};
+static void
+event_finalize_callback_2(struct event *ev, void *arg)
+{
+ struct event_and_count *evc = arg;
+ evc->count += 100;
+ event_free(ev);
+}
+static void
+timer_callback_2(evutil_socket_t fd, short what, void *arg)
+{
+ struct event_and_count *evc = arg;
+ event_finalize(0, evc->ev, event_finalize_callback_2);
+ event_finalize(0, evc->ev2, event_finalize_callback_2);
+ ++ evc->count;
+ (void)fd;
+ (void)what;
+}
+
+static void
+test_fin_within_cb(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+
+ struct event_and_count evc1, evc2;
+ evc1.count = evc2.count = 0;
+ evc2.ev2 = evc1.ev = evtimer_new(base, timer_callback_2, &evc1);
+ evc1.ev2 = evc2.ev = evtimer_new(base, timer_callback_2, &evc2);
+
+ /* Activate both. The first one will have its callback run, which
+ * will finalize both of them, preventing the second one's callback
+ * from running. */
+ event_active(evc1.ev, EV_TIMEOUT, 1);
+ event_active(evc2.ev, EV_TIMEOUT, 1);
+
+ event_base_dispatch(base);
+ tt_int_op(evc1.count, ==, 101);
+ tt_int_op(evc2.count, ==, 100);
+
+ event_base_assert_ok_(base);
+ /* Now try with EV_PERSIST events. */
+ evc1.count = evc2.count = 0;
+ evc2.ev2 = evc1.ev = event_new(base, -1, EV_PERSIST, timer_callback_2, &evc1);
+ evc1.ev2 = evc2.ev = event_new(base, -1, EV_PERSIST, timer_callback_2, &evc2);
+
+ event_active(evc1.ev, EV_TIMEOUT, 1);
+ event_active(evc2.ev, EV_TIMEOUT, 1);
+
+ event_base_dispatch(base);
+ tt_int_op(evc1.count, ==, 101);
+ tt_int_op(evc2.count, ==, 100);
+
+ event_base_assert_ok_(base);
+end:
+ ;
+}
+
+#if 0
+static void
+timer_callback_3(evutil_socket_t *fd, short what, void *arg)
+{
+ (void)fd;
+ (void)what;
+
+}
+static void
+test_fin_many(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+
+ struct event *ev1, *ev2;
+ struct event_callback evcb1, evcb2;
+ int ev1_count = 0, ev2_count = 0;
+ int evcb1_count = 0, evcb2_count = 0;
+ struct event_callback *array[4];
+
+ int n;
+
+ /* First attempt: call finalize_many with no events running */
+ ev1 = evtimer_new(base, timer_callback, &ev1_count);
+ ev1 = evtimer_new(base, timer_callback, &ev2_count);
+ event_deferred_cb_init_(&evcb1, 0, simple_callback, &evcb1_called);
+ event_deferred_cb_init_(&evcb2, 0, simple_callback, &evcb2_called);
+ array[0] = &ev1->ev_evcallback;
+ array[1] = &ev2->ev_evcallback;
+ array[2] = &evcb1;
+ array[3] = &evcb2;
+
+
+
+ n = event_callback_finalize_many(base, 4, array,
+ callback_finalize_callback_1);
+
+}
+#endif
+
+
+#define TEST(name, flags) \
+ { #name, test_fin_##name, (flags), &basic_setup, NULL }
+
+struct testcase_t finalize_testcases[] = {
+
+ TEST(cb_invoked, TT_FORK|TT_NEED_BASE),
+ TEST(free_finalize, TT_FORK),
+ TEST(within_cb, TT_FORK|TT_NEED_BASE),
+// TEST(many, TT_FORK|TT_NEED_BASE),
+
+
+ END_OF_TESTCASES
+};
+
diff --git a/protocols/Telegram/tgl/libevent/test/regress_finalize.obj b/protocols/Telegram/tgl/libevent/test/regress_finalize.obj
new file mode 100644
index 0000000000..765fd66e38
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_finalize.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/regress_http.c b/protocols/Telegram/tgl/libevent/test/regress_http.c
new file mode 100644
index 0000000000..cbe7aea34c
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_http.c
@@ -0,0 +1,4335 @@
+/*
+ * Copyright (c) 2003-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "util-internal.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#include <windows.h>
+#endif
+
+#include "event2/event-config.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#ifndef _WIN32
+#include <sys/socket.h>
+#include <signal.h>
+#include <unistd.h>
+#include <netdb.h>
+#endif
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#include "event2/dns.h"
+
+#include "event2/event.h"
+#include "event2/http.h"
+#include "event2/buffer.h"
+#include "event2/bufferevent.h"
+#include "event2/bufferevent_ssl.h"
+#include "event2/util.h"
+#include "event2/listener.h"
+#include "log-internal.h"
+#include "http-internal.h"
+#include "regress.h"
+#include "regress_testutils.h"
+
+static struct evhttp *http;
+/* set if a test needs to call loopexit on a base */
+static struct event_base *exit_base;
+
+static char const BASIC_REQUEST_BODY[] = "This is funny";
+
+#define IMPL_HTTP_REQUEST_ERROR_CB(name, expecting_error) \
+ static void \
+ http_request_error_cb_with_##name##_(enum evhttp_request_error error, \
+ void *arg) \
+ { \
+ if (error != expecting_error) { \
+ fprintf(stderr, "FAILED\n"); \
+ exit(1); \
+ } \
+ test_ok = 1; \
+ }
+IMPL_HTTP_REQUEST_ERROR_CB(cancel, EVREQ_HTTP_REQUEST_CANCEL)
+
+static void http_basic_cb(struct evhttp_request *req, void *arg);
+static void http_large_cb(struct evhttp_request *req, void *arg);
+static void http_chunked_cb(struct evhttp_request *req, void *arg);
+static void http_post_cb(struct evhttp_request *req, void *arg);
+static void http_put_cb(struct evhttp_request *req, void *arg);
+static void http_delete_cb(struct evhttp_request *req, void *arg);
+static void http_delay_cb(struct evhttp_request *req, void *arg);
+static void http_large_delay_cb(struct evhttp_request *req, void *arg);
+static void http_badreq_cb(struct evhttp_request *req, void *arg);
+static void http_dispatcher_cb(struct evhttp_request *req, void *arg);
+static void http_on_complete_cb(struct evhttp_request *req, void *arg);
+
+#define HTTP_BIND_IPV6 1
+#define HTTP_BIND_SSL 2
+static int
+http_bind(struct evhttp *myhttp, ev_uint16_t *pport, int mask)
+{
+ int port;
+ struct evhttp_bound_socket *sock;
+ int ipv6 = mask & HTTP_BIND_IPV6;
+
+ if (ipv6)
+ sock = evhttp_bind_socket_with_handle(myhttp, "::1", *pport);
+ else
+ sock = evhttp_bind_socket_with_handle(myhttp, "127.0.0.1", *pport);
+
+ if (sock == NULL) {
+ if (ipv6)
+ return -1;
+ else
+ event_errx(1, "Could not start web server");
+ }
+
+ port = regress_get_socket_port(evhttp_bound_socket_get_fd(sock));
+ if (port < 0)
+ return -1;
+ *pport = (ev_uint16_t) port;
+
+ return 0;
+}
+
+#ifdef EVENT__HAVE_OPENSSL
+static struct bufferevent *
+https_bev(struct event_base *base, void *arg)
+{
+ SSL *ssl = SSL_new(get_ssl_ctx());
+
+ SSL_use_certificate(ssl, ssl_getcert());
+ SSL_use_PrivateKey(ssl, ssl_getkey());
+
+ return bufferevent_openssl_socket_new(
+ base, -1, ssl, BUFFEREVENT_SSL_ACCEPTING,
+ BEV_OPT_CLOSE_ON_FREE);
+}
+#endif
+static struct evhttp *
+http_setup(ev_uint16_t *pport, struct event_base *base, int mask)
+{
+ struct evhttp *myhttp;
+
+ /* Try a few different ports */
+ myhttp = evhttp_new(base);
+
+ if (http_bind(myhttp, pport, mask) < 0)
+ return NULL;
+#ifdef EVENT__HAVE_OPENSSL
+ if (mask & HTTP_BIND_SSL) {
+ init_ssl();
+ evhttp_set_bevcb(myhttp, https_bev, NULL);
+ }
+#endif
+
+ /* Register a callback for certain types of requests */
+ evhttp_set_cb(myhttp, "/test", http_basic_cb, base);
+ evhttp_set_cb(myhttp, "/large", http_large_cb, base);
+ evhttp_set_cb(myhttp, "/chunked", http_chunked_cb, base);
+ evhttp_set_cb(myhttp, "/streamed", http_chunked_cb, base);
+ evhttp_set_cb(myhttp, "/postit", http_post_cb, base);
+ evhttp_set_cb(myhttp, "/putit", http_put_cb, base);
+ evhttp_set_cb(myhttp, "/deleteit", http_delete_cb, base);
+ evhttp_set_cb(myhttp, "/delay", http_delay_cb, base);
+ evhttp_set_cb(myhttp, "/largedelay", http_large_delay_cb, base);
+ evhttp_set_cb(myhttp, "/badrequest", http_badreq_cb, base);
+ evhttp_set_cb(myhttp, "/oncomplete", http_on_complete_cb, base);
+ evhttp_set_cb(myhttp, "/", http_dispatcher_cb, base);
+ return (myhttp);
+}
+
+#ifndef NI_MAXSERV
+#define NI_MAXSERV 1024
+#endif
+
+static evutil_socket_t
+http_connect(const char *address, unsigned short port)
+{
+ /* Stupid code for connecting */
+ struct evutil_addrinfo ai, *aitop;
+ char strport[NI_MAXSERV];
+
+ struct sockaddr *sa;
+ int slen;
+ evutil_socket_t fd;
+
+ memset(&ai, 0, sizeof(ai));
+ ai.ai_family = AF_INET;
+ ai.ai_socktype = SOCK_STREAM;
+ evutil_snprintf(strport, sizeof(strport), "%d", port);
+ if (evutil_getaddrinfo(address, strport, &ai, &aitop) != 0) {
+ event_warn("getaddrinfo");
+ return (-1);
+ }
+ sa = aitop->ai_addr;
+ slen = aitop->ai_addrlen;
+
+ fd = socket(AF_INET, SOCK_STREAM, 0);
+ if (fd == -1)
+ event_err(1, "socket failed");
+
+ evutil_make_socket_nonblocking(fd);
+ if (connect(fd, sa, slen) == -1) {
+#ifdef _WIN32
+ int tmp_err = WSAGetLastError();
+ if (tmp_err != WSAEINPROGRESS && tmp_err != WSAEINVAL &&
+ tmp_err != WSAEWOULDBLOCK)
+ event_err(1, "connect failed");
+#else
+ if (errno != EINPROGRESS)
+ event_err(1, "connect failed");
+#endif
+ }
+
+ evutil_freeaddrinfo(aitop);
+
+ return (fd);
+}
+
+/* Helper: do a strcmp on the contents of buf and the string s. */
+static int
+evbuffer_datacmp(struct evbuffer *buf, const char *s)
+{
+ size_t b_sz = evbuffer_get_length(buf);
+ size_t s_sz = strlen(s);
+ unsigned char *d;
+ int r;
+
+ if (b_sz < s_sz)
+ return -1;
+
+ d = evbuffer_pullup(buf, s_sz);
+ if ((r = memcmp(d, s, s_sz)))
+ return r;
+
+ if (b_sz > s_sz)
+ return 1;
+ else
+ return 0;
+}
+
+/* Helper: Return true iff buf contains s */
+static int
+evbuffer_contains(struct evbuffer *buf, const char *s)
+{
+ struct evbuffer_ptr ptr;
+ ptr = evbuffer_search(buf, s, strlen(s), NULL);
+ return ptr.pos != -1;
+}
+
+static void
+http_readcb(struct bufferevent *bev, void *arg)
+{
+ const char *what = BASIC_REQUEST_BODY;
+ struct event_base *my_base = arg;
+
+ if (evbuffer_contains(bufferevent_get_input(bev), what)) {
+ struct evhttp_request *req = evhttp_request_new(NULL, NULL);
+ enum message_read_status done;
+
+ /* req->kind = EVHTTP_RESPONSE; */
+ done = evhttp_parse_firstline_(req, bufferevent_get_input(bev));
+ if (done != ALL_DATA_READ)
+ goto out;
+
+ done = evhttp_parse_headers_(req, bufferevent_get_input(bev));
+ if (done != ALL_DATA_READ)
+ goto out;
+
+ if (done == 1 &&
+ evhttp_find_header(evhttp_request_get_input_headers(req),
+ "Content-Type") != NULL)
+ test_ok++;
+
+ out:
+ evhttp_request_free(req);
+ bufferevent_disable(bev, EV_READ);
+ if (exit_base)
+ event_base_loopexit(exit_base, NULL);
+ else if (my_base)
+ event_base_loopexit(my_base, NULL);
+ else {
+ fprintf(stderr, "No way to exit loop!\n");
+ exit(1);
+ }
+ }
+}
+
+static void
+http_writecb(struct bufferevent *bev, void *arg)
+{
+ if (evbuffer_get_length(bufferevent_get_output(bev)) == 0) {
+ /* enable reading of the reply */
+ bufferevent_enable(bev, EV_READ);
+ test_ok++;
+ }
+}
+
+static void
+http_errorcb(struct bufferevent *bev, short what, void *arg)
+{
+ /** For ssl */
+ if (what & BEV_EVENT_CONNECTED)
+ return;
+ test_ok = -2;
+ event_base_loopexit(arg, NULL);
+}
+
+static int found_multi = 0;
+static int found_multi2 = 0;
+
+static void
+http_basic_cb(struct evhttp_request *req, void *arg)
+{
+ struct evbuffer *evb = evbuffer_new();
+ struct evhttp_connection *evcon;
+ int empty = evhttp_find_header(evhttp_request_get_input_headers(req), "Empty") != NULL;
+ event_debug(("%s: called\n", __func__));
+ evbuffer_add_printf(evb, BASIC_REQUEST_BODY);
+
+ evcon = evhttp_request_get_connection(req);
+ tt_assert(evhttp_connection_get_server(evcon) == http);
+
+ /* For multi-line headers test */
+ {
+ const char *multi =
+ evhttp_find_header(evhttp_request_get_input_headers(req),"X-Multi");
+ if (multi) {
+ found_multi = !strcmp(multi,"aaaaaaaa a END");
+ if (strcmp("END", multi + strlen(multi) - 3) == 0)
+ test_ok++;
+ if (evhttp_find_header(evhttp_request_get_input_headers(req), "X-Last"))
+ test_ok++;
+ }
+ }
+ {
+ const char *multi2 =
+ evhttp_find_header(evhttp_request_get_input_headers(req),"X-Multi-Extra-WS");
+ if (multi2) {
+ found_multi2 = !strcmp(multi2,"libevent 2.1");
+ }
+ }
+
+
+ /* injecting a bad content-length */
+ if (evhttp_find_header(evhttp_request_get_input_headers(req), "X-Negative"))
+ evhttp_add_header(evhttp_request_get_output_headers(req),
+ "Content-Length", "-100");
+
+ /* allow sending of an empty reply */
+ evhttp_send_reply(req, HTTP_OK, "Everything is fine",
+ !empty ? evb : NULL);
+
+end:
+ evbuffer_free(evb);
+}
+
+static void
+http_large_cb(struct evhttp_request *req, void *arg)
+{
+ struct evbuffer *evb = evbuffer_new();
+ int i;
+
+ for (i = 0; i < 1<<20; ++i) {
+ evbuffer_add_printf(evb, BASIC_REQUEST_BODY);
+ }
+ evhttp_send_reply(req, HTTP_OK, "Everything is fine", evb);
+ evbuffer_free(evb);
+}
+
+static char const* const CHUNKS[] = {
+ "This is funny",
+ "but not hilarious.",
+ "bwv 1052"
+};
+
+struct chunk_req_state {
+ struct event_base *base;
+ struct evhttp_request *req;
+ int i;
+};
+
+static void
+http_chunked_trickle_cb(evutil_socket_t fd, short events, void *arg)
+{
+ struct evbuffer *evb = evbuffer_new();
+ struct chunk_req_state *state = arg;
+ struct timeval when = { 0, 0 };
+
+ evbuffer_add_printf(evb, "%s", CHUNKS[state->i]);
+ evhttp_send_reply_chunk(state->req, evb);
+ evbuffer_free(evb);
+
+ if (++state->i < (int) (sizeof(CHUNKS)/sizeof(CHUNKS[0]))) {
+ event_base_once(state->base, -1, EV_TIMEOUT,
+ http_chunked_trickle_cb, state, &when);
+ } else {
+ evhttp_send_reply_end(state->req);
+ free(state);
+ }
+}
+
+static void
+http_chunked_cb(struct evhttp_request *req, void *arg)
+{
+ struct timeval when = { 0, 0 };
+ struct chunk_req_state *state = malloc(sizeof(struct chunk_req_state));
+ event_debug(("%s: called\n", __func__));
+
+ memset(state, 0, sizeof(struct chunk_req_state));
+ state->req = req;
+ state->base = arg;
+
+ if (strcmp(evhttp_request_get_uri(req), "/streamed") == 0) {
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Content-Length", "39");
+ }
+
+ /* generate a chunked/streamed reply */
+ evhttp_send_reply_start(req, HTTP_OK, "Everything is fine");
+
+ /* but trickle it across several iterations to ensure we're not
+ * assuming it comes all at once */
+ event_base_once(arg, -1, EV_TIMEOUT, http_chunked_trickle_cb, state, &when);
+}
+
+static void
+http_complete_write(evutil_socket_t fd, short what, void *arg)
+{
+ struct bufferevent *bev = arg;
+ const char *http_request = "host\r\n"
+ "Connection: close\r\n"
+ "\r\n";
+ bufferevent_write(bev, http_request, strlen(http_request));
+}
+
+static struct bufferevent *
+create_bev(struct event_base *base, int fd, int ssl)
+{
+ int flags = BEV_OPT_DEFER_CALLBACKS;
+ struct bufferevent *bev = NULL;
+
+ if (!ssl) {
+ bev = bufferevent_socket_new(base, fd, flags);
+ } else {
+#ifdef EVENT__HAVE_OPENSSL
+ SSL *ssl = SSL_new(get_ssl_ctx());
+ bev = bufferevent_openssl_socket_new(
+ base, fd, ssl, BUFFEREVENT_SSL_CONNECTING, flags);
+ bufferevent_openssl_set_allow_dirty_shutdown(bev, 1);
+#endif
+ }
+
+ return bev;
+}
+
+static void
+http_basic_test_impl(void *arg, int ssl)
+{
+ struct basic_test_data *data = arg;
+ struct timeval tv;
+ struct bufferevent *bev = NULL;
+ evutil_socket_t fd;
+ const char *http_request;
+ ev_uint16_t port = 0, port2 = 0;
+ int server_flags = ssl ? HTTP_BIND_SSL : 0;
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, server_flags);
+
+ /* bind to a second socket */
+ if (http_bind(http, &port2, server_flags) == -1) {
+ fprintf(stdout, "FAILED (bind)\n");
+ exit(1);
+ }
+
+ fd = http_connect("127.0.0.1", port);
+
+ /* Stupid thing to send a request */
+ bev = create_bev(data->base, fd, ssl);
+ bufferevent_setcb(bev, http_readcb, http_writecb,
+ http_errorcb, data->base);
+
+ /* first half of the http request */
+ http_request =
+ "GET /test HTTP/1.1\r\n"
+ "Host: some";
+
+ bufferevent_write(bev, http_request, strlen(http_request));
+ evutil_timerclear(&tv);
+ tv.tv_usec = 10000;
+ event_base_once(data->base,
+ -1, EV_TIMEOUT, http_complete_write, bev, &tv);
+
+ event_base_dispatch(data->base);
+
+ tt_assert(test_ok == 3);
+
+ /* connect to the second port */
+ bufferevent_free(bev);
+ evutil_closesocket(fd);
+
+ fd = http_connect("127.0.0.1", port2);
+
+ /* Stupid thing to send a request */
+ bev = create_bev(data->base, fd, ssl);
+ bufferevent_setcb(bev, http_readcb, http_writecb,
+ http_errorcb, data->base);
+
+ http_request =
+ "GET /test HTTP/1.1\r\n"
+ "Host: somehost\r\n"
+ "Connection: close\r\n"
+ "\r\n";
+
+ bufferevent_write(bev, http_request, strlen(http_request));
+
+ event_base_dispatch(data->base);
+
+ tt_assert(test_ok == 5);
+
+ /* Connect to the second port again. This time, send an absolute uri. */
+ bufferevent_free(bev);
+ evutil_closesocket(fd);
+
+ fd = http_connect("127.0.0.1", port2);
+
+ /* Stupid thing to send a request */
+ bev = create_bev(data->base, fd, ssl);
+ bufferevent_setcb(bev, http_readcb, http_writecb,
+ http_errorcb, data->base);
+
+ http_request =
+ "GET http://somehost.net/test HTTP/1.1\r\n"
+ "Host: somehost\r\n"
+ "Connection: close\r\n"
+ "\r\n";
+
+ bufferevent_write(bev, http_request, strlen(http_request));
+
+ event_base_dispatch(data->base);
+
+ tt_assert(test_ok == 7);
+
+ evhttp_free(http);
+ end:
+ if (bev)
+ bufferevent_free(bev);
+}
+static void http_basic_test(void *arg)
+{ return http_basic_test_impl(arg, 0); }
+
+
+static void
+http_delay_reply(evutil_socket_t fd, short what, void *arg)
+{
+ struct evhttp_request *req = arg;
+
+ evhttp_send_reply(req, HTTP_OK, "Everything is fine", NULL);
+
+ ++test_ok;
+}
+
+static void
+http_delay_cb(struct evhttp_request *req, void *arg)
+{
+ struct timeval tv;
+ evutil_timerclear(&tv);
+ tv.tv_sec = 0;
+ tv.tv_usec = 200 * 1000;
+
+ event_base_once(arg, -1, EV_TIMEOUT, http_delay_reply, req, &tv);
+}
+
+static void
+http_badreq_cb(struct evhttp_request *req, void *arg)
+{
+ struct evbuffer *buf = evbuffer_new();
+
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Content-Type", "text/xml; charset=UTF-8");
+ evbuffer_add_printf(buf, "Hello, %s!", "127.0.0.1");
+
+ evhttp_send_reply(req, HTTP_OK, "OK", buf);
+ evbuffer_free(buf);
+}
+
+static void
+http_badreq_errorcb(struct bufferevent *bev, short what, void *arg)
+{
+ event_debug(("%s: called (what=%04x, arg=%p)", __func__, what, arg));
+ /* ignore */
+}
+
+#ifndef SHUT_WR
+#ifdef _WIN32
+#define SHUT_WR SD_SEND
+#else
+#define SHUT_WR 1
+#endif
+#endif
+
+static void
+http_badreq_readcb(struct bufferevent *bev, void *arg)
+{
+ const char *what = "Hello, 127.0.0.1";
+ const char *bad_request = "400 Bad Request";
+
+ if (evbuffer_contains(bufferevent_get_input(bev), bad_request)) {
+ TT_FAIL(("%s:bad request detected", __func__));
+ bufferevent_disable(bev, EV_READ);
+ event_base_loopexit(arg, NULL);
+ return;
+ }
+
+ if (evbuffer_contains(bufferevent_get_input(bev), what)) {
+ struct evhttp_request *req = evhttp_request_new(NULL, NULL);
+ enum message_read_status done;
+
+ /* req->kind = EVHTTP_RESPONSE; */
+ done = evhttp_parse_firstline_(req, bufferevent_get_input(bev));
+ if (done != ALL_DATA_READ)
+ goto out;
+
+ done = evhttp_parse_headers_(req, bufferevent_get_input(bev));
+ if (done != ALL_DATA_READ)
+ goto out;
+
+ if (done == 1 &&
+ evhttp_find_header(evhttp_request_get_input_headers(req),
+ "Content-Type") != NULL)
+ test_ok++;
+
+ out:
+ evhttp_request_free(req);
+ evbuffer_drain(bufferevent_get_input(bev), evbuffer_get_length(bufferevent_get_input(bev)));
+ }
+
+ shutdown(bufferevent_getfd(bev), SHUT_WR);
+}
+
+static void
+http_badreq_successcb(evutil_socket_t fd, short what, void *arg)
+{
+ event_debug(("%s: called (what=%04x, arg=%p)", __func__, what, arg));
+ event_base_loopexit(exit_base, NULL);
+}
+
+static void
+http_bad_request_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct timeval tv;
+ struct bufferevent *bev = NULL;
+ evutil_socket_t fd = -1;
+ const char *http_request;
+ ev_uint16_t port=0, port2=0;
+
+ test_ok = 0;
+ exit_base = data->base;
+
+ http = http_setup(&port, data->base, 0);
+
+ /* bind to a second socket */
+ if (http_bind(http, &port2, 0) == -1)
+ TT_DIE(("Bind socket failed"));
+
+ /* NULL request test */
+ fd = http_connect("127.0.0.1", port);
+ tt_int_op(fd, >=, 0);
+
+ /* Stupid thing to send a request */
+ bev = bufferevent_socket_new(data->base, fd, 0);
+ bufferevent_setcb(bev, http_badreq_readcb, http_writecb,
+ http_badreq_errorcb, data->base);
+ bufferevent_enable(bev, EV_READ);
+
+ /* real NULL request */
+ http_request = "";
+
+ bufferevent_write(bev, http_request, strlen(http_request));
+
+ shutdown(fd, SHUT_WR);
+ timerclear(&tv);
+ tv.tv_usec = 10000;
+ event_base_once(data->base, -1, EV_TIMEOUT, http_badreq_successcb, bev, &tv);
+
+ event_base_dispatch(data->base);
+
+ bufferevent_free(bev);
+ evutil_closesocket(fd);
+
+ if (test_ok != 0) {
+ fprintf(stdout, "FAILED\n");
+ exit(1);
+ }
+
+ /* Second answer (BAD REQUEST) on connection close */
+
+ /* connect to the second port */
+ fd = http_connect("127.0.0.1", port2);
+
+ /* Stupid thing to send a request */
+ bev = bufferevent_socket_new(data->base, fd, 0);
+ bufferevent_setcb(bev, http_badreq_readcb, http_writecb,
+ http_badreq_errorcb, data->base);
+ bufferevent_enable(bev, EV_READ);
+
+ /* first half of the http request */
+ http_request =
+ "GET /badrequest HTTP/1.0\r\n" \
+ "Connection: Keep-Alive\r\n" \
+ "\r\n";
+
+ bufferevent_write(bev, http_request, strlen(http_request));
+
+ timerclear(&tv);
+ tv.tv_usec = 10000;
+ event_base_once(data->base, -1, EV_TIMEOUT, http_badreq_successcb, bev, &tv);
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(test_ok, ==, 2);
+
+end:
+ evhttp_free(http);
+ if (bev)
+ bufferevent_free(bev);
+ if (fd >= 0)
+ evutil_closesocket(fd);
+}
+
+static struct evhttp_connection *delayed_client;
+
+static void
+http_large_delay_cb(struct evhttp_request *req, void *arg)
+{
+ struct timeval tv;
+ evutil_timerclear(&tv);
+ tv.tv_usec = 500000;
+
+ event_base_once(arg, -1, EV_TIMEOUT, http_delay_reply, req, &tv);
+ evhttp_connection_fail_(delayed_client, EVREQ_HTTP_EOF);
+}
+
+/*
+ * HTTP DELETE test, just piggyback on the basic test
+ */
+
+static void
+http_delete_cb(struct evhttp_request *req, void *arg)
+{
+ struct evbuffer *evb = evbuffer_new();
+ int empty = evhttp_find_header(evhttp_request_get_input_headers(req), "Empty") != NULL;
+
+ /* Expecting a DELETE request */
+ if (evhttp_request_get_command(req) != EVHTTP_REQ_DELETE) {
+ fprintf(stdout, "FAILED (delete type)\n");
+ exit(1);
+ }
+
+ event_debug(("%s: called\n", __func__));
+ evbuffer_add_printf(evb, BASIC_REQUEST_BODY);
+
+ /* allow sending of an empty reply */
+ evhttp_send_reply(req, HTTP_OK, "Everything is fine",
+ !empty ? evb : NULL);
+
+ evbuffer_free(evb);
+}
+
+static void
+http_delete_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct bufferevent *bev;
+ evutil_socket_t fd = -1;
+ const char *http_request;
+ ev_uint16_t port = 0;
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+
+ tt_assert(http);
+ fd = http_connect("127.0.0.1", port);
+ tt_int_op(fd, >=, 0);
+
+ /* Stupid thing to send a request */
+ bev = bufferevent_socket_new(data->base, fd, 0);
+ bufferevent_setcb(bev, http_readcb, http_writecb,
+ http_errorcb, data->base);
+
+ http_request =
+ "DELETE /deleteit HTTP/1.1\r\n"
+ "Host: somehost\r\n"
+ "Connection: close\r\n"
+ "\r\n";
+
+ bufferevent_write(bev, http_request, strlen(http_request));
+
+ event_base_dispatch(data->base);
+
+ bufferevent_free(bev);
+ evutil_closesocket(fd);
+ fd = -1;
+
+ evhttp_free(http);
+
+ tt_int_op(test_ok, ==, 2);
+ end:
+ if (fd >= 0)
+ evutil_closesocket(fd);
+}
+
+static void
+http_sent_cb(struct evhttp_request *req, void *arg)
+{
+ ev_uintptr_t val = (ev_uintptr_t)arg;
+ struct evbuffer *b;
+
+ if (val != 0xDEADBEEF) {
+ fprintf(stdout, "FAILED on_complete_cb argument\n");
+ exit(1);
+ }
+
+ b = evhttp_request_get_output_buffer(req);
+ if (evbuffer_get_length(b) != 0) {
+ fprintf(stdout, "FAILED on_complete_cb output buffer not written\n");
+ exit(1);
+ }
+
+ event_debug(("%s: called\n", __func__));
+
+ ++test_ok;
+}
+
+static void
+http_on_complete_cb(struct evhttp_request *req, void *arg)
+{
+ struct evbuffer *evb = evbuffer_new();
+
+ evhttp_request_set_on_complete_cb(req, http_sent_cb, (void *)0xDEADBEEF);
+
+ event_debug(("%s: called\n", __func__));
+ evbuffer_add_printf(evb, BASIC_REQUEST_BODY);
+
+ /* allow sending of an empty reply */
+ evhttp_send_reply(req, HTTP_OK, "Everything is fine", evb);
+
+ evbuffer_free(evb);
+
+ ++test_ok;
+}
+
+static void
+http_on_complete_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct bufferevent *bev;
+ evutil_socket_t fd = -1;
+ const char *http_request;
+ ev_uint16_t port = 0;
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+
+ fd = http_connect("127.0.0.1", port);
+ tt_int_op(fd, >=, 0);
+
+ /* Stupid thing to send a request */
+ bev = bufferevent_socket_new(data->base, fd, 0);
+ bufferevent_setcb(bev, http_readcb, http_writecb,
+ http_errorcb, data->base);
+
+ http_request =
+ "GET /oncomplete HTTP/1.1\r\n"
+ "Host: somehost\r\n"
+ "Connection: close\r\n"
+ "\r\n";
+
+ bufferevent_write(bev, http_request, strlen(http_request));
+
+ event_base_dispatch(data->base);
+
+ bufferevent_free(bev);
+
+ evhttp_free(http);
+
+ tt_int_op(test_ok, ==, 4);
+ end:
+ if (fd >= 0)
+ evutil_closesocket(fd);
+}
+
+static void
+http_allowed_methods_eventcb(struct bufferevent *bev, short what, void *arg)
+{
+ char **output = arg;
+ if ((what & (BEV_EVENT_ERROR|BEV_EVENT_EOF))) {
+ char buf[4096];
+ int n;
+ n = evbuffer_remove(bufferevent_get_input(bev), buf,
+ sizeof(buf)-1);
+ if (n >= 0) {
+ buf[n]='\0';
+ if (*output)
+ free(*output);
+ *output = strdup(buf);
+ }
+ event_base_loopexit(exit_base, NULL);
+ }
+}
+
+static void
+http_allowed_methods_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct bufferevent *bev1, *bev2, *bev3;
+ evutil_socket_t fd1=-1, fd2=-1, fd3=-1;
+ const char *http_request;
+ char *result1=NULL, *result2=NULL, *result3=NULL;
+ ev_uint16_t port = 0;
+
+ exit_base = data->base;
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+
+ fd1 = http_connect("127.0.0.1", port);
+ tt_int_op(fd1, >=, 0);
+
+ /* GET is out; PATCH is in. */
+ evhttp_set_allowed_methods(http, EVHTTP_REQ_PATCH);
+
+ /* Stupid thing to send a request */
+ bev1 = bufferevent_socket_new(data->base, fd1, 0);
+ bufferevent_enable(bev1, EV_READ|EV_WRITE);
+ bufferevent_setcb(bev1, NULL, NULL,
+ http_allowed_methods_eventcb, &result1);
+
+ http_request =
+ "GET /index.html HTTP/1.1\r\n"
+ "Host: somehost\r\n"
+ "Connection: close\r\n"
+ "\r\n";
+
+ bufferevent_write(bev1, http_request, strlen(http_request));
+
+ event_base_dispatch(data->base);
+
+ fd2 = http_connect("127.0.0.1", port);
+ tt_int_op(fd2, >=, 0);
+
+ bev2 = bufferevent_socket_new(data->base, fd2, 0);
+ bufferevent_enable(bev2, EV_READ|EV_WRITE);
+ bufferevent_setcb(bev2, NULL, NULL,
+ http_allowed_methods_eventcb, &result2);
+
+ http_request =
+ "PATCH /test HTTP/1.1\r\n"
+ "Host: somehost\r\n"
+ "Connection: close\r\n"
+ "\r\n";
+
+ bufferevent_write(bev2, http_request, strlen(http_request));
+
+ event_base_dispatch(data->base);
+
+ fd3 = http_connect("127.0.0.1", port);
+ tt_int_op(fd3, >=, 0);
+
+ bev3 = bufferevent_socket_new(data->base, fd3, 0);
+ bufferevent_enable(bev3, EV_READ|EV_WRITE);
+ bufferevent_setcb(bev3, NULL, NULL,
+ http_allowed_methods_eventcb, &result3);
+
+ http_request =
+ "FLOOP /test HTTP/1.1\r\n"
+ "Host: somehost\r\n"
+ "Connection: close\r\n"
+ "\r\n";
+
+ bufferevent_write(bev3, http_request, strlen(http_request));
+
+ event_base_dispatch(data->base);
+
+ bufferevent_free(bev1);
+ bufferevent_free(bev2);
+ bufferevent_free(bev3);
+
+ evhttp_free(http);
+
+ /* Method known but disallowed */
+ tt_assert(result1);
+ tt_assert(!strncmp(result1, "HTTP/1.1 501 ", strlen("HTTP/1.1 501 ")));
+
+ /* Method known and allowed */
+ tt_assert(result2);
+ tt_assert(!strncmp(result2, "HTTP/1.1 200 ", strlen("HTTP/1.1 200 ")));
+
+ /* Method unknown */
+ tt_assert(result3);
+ tt_assert(!strncmp(result3, "HTTP/1.1 501 ", strlen("HTTP/1.1 501 ")));
+
+ end:
+ if (result1)
+ free(result1);
+ if (result2)
+ free(result2);
+ if (result3)
+ free(result3);
+ if (fd1 >= 0)
+ evutil_closesocket(fd1);
+ if (fd2 >= 0)
+ evutil_closesocket(fd2);
+ if (fd3 >= 0)
+ evutil_closesocket(fd3);
+}
+
+static void http_request_no_action_done(struct evhttp_request *, void *);
+static void http_request_done(struct evhttp_request *, void *);
+static void http_request_empty_done(struct evhttp_request *, void *);
+
+static void
+http_connection_test_(struct basic_test_data *data, int persistent,
+ const char *address, struct evdns_base *dnsbase, int ipv6, int family)
+{
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, ipv6);
+ if (!http && ipv6) {
+ tt_skip();
+ }
+ tt_assert(http);
+
+ evcon = evhttp_connection_base_new(data->base, dnsbase, address, port);
+ tt_assert(evcon);
+ evhttp_connection_set_family(evcon, family);
+
+ tt_assert(evhttp_connection_get_base(evcon) == data->base);
+
+ exit_base = data->base;
+
+ tt_assert(evhttp_connection_get_server(evcon) == NULL);
+
+ /*
+ * At this point, we want to schedule a request to the HTTP
+ * server using our make request method.
+ */
+ req = evhttp_request_new(http_request_done, (void*) BASIC_REQUEST_BODY);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) {
+ fprintf(stdout, "FAILED\n");
+ exit(1);
+ }
+
+ event_base_dispatch(data->base);
+
+ tt_assert(test_ok);
+
+ /* try to make another request over the same connection */
+ test_ok = 0;
+
+ req = evhttp_request_new(http_request_done, (void*) BASIC_REQUEST_BODY);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ /*
+ * if our connections are not supposed to be persistent; request
+ * a close from the server.
+ */
+ if (!persistent)
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Connection", "close");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) {
+ tt_abort_msg("couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ /* make another request: request empty reply */
+ test_ok = 0;
+
+ req = evhttp_request_new(http_request_empty_done, data->base);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Empty", "itis");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ end:
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http)
+ evhttp_free(http);
+}
+
+static void
+http_connection_test(void *arg)
+{
+ http_connection_test_(arg, 0, "127.0.0.1", NULL, 0, AF_UNSPEC);
+}
+static void
+http_persist_connection_test(void *arg)
+{
+ http_connection_test_(arg, 1, "127.0.0.1", NULL, 0, AF_UNSPEC);
+}
+
+static struct regress_dns_server_table search_table[] = {
+ { "localhost", "A", "127.0.0.1", 0, 0 },
+ { NULL, NULL, NULL, 0, 0 }
+};
+
+static void
+http_connection_async_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+ struct evdns_base *dns_base = NULL;
+ ev_uint16_t portnum = 0;
+ char address[64];
+
+ exit_base = data->base;
+ tt_assert(regress_dnsserver(data->base, &portnum, search_table));
+
+ dns_base = evdns_base_new(data->base, 0/* init name servers */);
+ tt_assert(dns_base);
+
+ /* Add ourself as the only nameserver, and make sure we really are
+ * the only nameserver. */
+ evutil_snprintf(address, sizeof(address), "127.0.0.1:%d", portnum);
+ evdns_base_nameserver_ip_add(dns_base, address);
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+
+ evcon = evhttp_connection_base_new(data->base, dns_base, "127.0.0.1", port);
+ tt_assert(evcon);
+
+ /*
+ * At this point, we want to schedule a request to the HTTP
+ * server using our make request method.
+ */
+
+ req = evhttp_request_new(http_request_done, (void*) BASIC_REQUEST_BODY);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) {
+ fprintf(stdout, "FAILED\n");
+ exit(1);
+ }
+
+ event_base_dispatch(data->base);
+
+ tt_assert(test_ok);
+
+ /* try to make another request over the same connection */
+ test_ok = 0;
+
+ req = evhttp_request_new(http_request_done, (void*) BASIC_REQUEST_BODY);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ /*
+ * if our connections are not supposed to be persistent; request
+ * a close from the server.
+ */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Connection", "close");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) {
+ tt_abort_msg("couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ /* make another request: request empty reply */
+ test_ok = 0;
+
+ req = evhttp_request_new(http_request_empty_done, data->base);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Empty", "itis");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ end:
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http)
+ evhttp_free(http);
+ if (dns_base)
+ evdns_base_free(dns_base, 0);
+ regress_clean_dnsserver();
+}
+
+static void
+http_autofree_connection_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req[2] = { NULL };
+
+ test_ok = 0;
+ http = http_setup(&port, data->base, 0);
+
+ evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port);
+ tt_assert(evcon);
+
+ /*
+ * At this point, we want to schedule two request to the HTTP
+ * server using our make request method.
+ */
+ req[0] = evhttp_request_new(http_request_empty_done, data->base);
+ req[1] = evhttp_request_new(http_request_empty_done, data->base);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req[0]), "Host", "somehost");
+ evhttp_add_header(evhttp_request_get_output_headers(req[0]), "Connection", "close");
+ evhttp_add_header(evhttp_request_get_output_headers(req[0]), "Empty", "itis");
+ evhttp_add_header(evhttp_request_get_output_headers(req[1]), "Host", "somehost");
+ evhttp_add_header(evhttp_request_get_output_headers(req[1]), "Connection", "close");
+ evhttp_add_header(evhttp_request_get_output_headers(req[1]), "Empty", "itis");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req[0], EVHTTP_REQ_GET, "/test") == -1) {
+ tt_abort_msg("couldn't make request");
+ }
+ if (evhttp_make_request(evcon, req[1], EVHTTP_REQ_GET, "/test") == -1) {
+ tt_abort_msg("couldn't make request");
+ }
+
+ /*
+ * Tell libevent to free the connection when the request completes
+ * We then set the evcon pointer to NULL since we don't want to free it
+ * when this function ends.
+ */
+ evhttp_connection_free_on_completion(evcon);
+ evcon = NULL;
+
+ event_base_dispatch(data->base);
+
+ /* at this point, the http server should have no connection */
+ tt_assert(TAILQ_FIRST(&http->connections) == NULL);
+
+ end:
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http)
+ evhttp_free(http);
+}
+
+static void
+http_request_never_call(struct evhttp_request *req, void *arg)
+{
+ fprintf(stdout, "FAILED\n");
+ exit(1);
+}
+
+static void
+http_do_cancel(evutil_socket_t fd, short what, void *arg)
+{
+ struct evhttp_request *req = arg;
+ struct timeval tv;
+ struct event_base *base;
+ evutil_timerclear(&tv);
+ tv.tv_sec = 0;
+ tv.tv_usec = 500 * 1000;
+
+ base = evhttp_connection_get_base(evhttp_request_get_connection(req));
+ evhttp_cancel_request(req);
+
+ event_base_loopexit(base, &tv);
+
+ ++test_ok;
+}
+
+static void
+http_cancel_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+ struct timeval tv;
+
+ exit_base = data->base;
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+
+ evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port);
+ tt_assert(evcon);
+
+ /*
+ * At this point, we want to schedule a request to the HTTP
+ * server using our make request method.
+ */
+
+ req = evhttp_request_new(http_request_never_call, NULL);
+ evhttp_request_set_error_cb(req, http_request_error_cb_with_cancel_);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ /* We give ownership of the request to the connection */
+ tt_int_op(evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/delay"),
+ !=, -1);
+
+ evutil_timerclear(&tv);
+ tv.tv_sec = 0;
+ tv.tv_usec = 100 * 1000;
+
+ event_base_once(data->base, -1, EV_TIMEOUT, http_do_cancel, req, &tv);
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(test_ok, ==, 3);
+
+ /* try to make another request over the same connection */
+ test_ok = 0;
+
+ req = evhttp_request_new(http_request_done, (void*) BASIC_REQUEST_BODY);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ /* We give ownership of the request to the connection */
+ tt_int_op(evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test"),
+ !=, -1);
+
+ event_base_dispatch(data->base);
+
+ /* make another request: request empty reply */
+ test_ok = 0;
+
+ req = evhttp_request_new(http_request_empty_done, data->base);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Empty", "itis");
+
+ /* We give ownership of the request to the connection */
+ tt_int_op(evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test"),
+ !=, -1);
+
+ event_base_dispatch(data->base);
+
+ end:
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http)
+ evhttp_free(http);
+}
+
+static void
+http_request_no_action_done(struct evhttp_request *req, void *arg)
+{
+ EVUTIL_ASSERT(exit_base);
+ event_base_loopexit(exit_base, NULL);
+}
+
+static void
+http_request_done(struct evhttp_request *req, void *arg)
+{
+ const char *what = arg;
+
+ if (evhttp_request_get_response_code(req) != HTTP_OK) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ if (evhttp_find_header(evhttp_request_get_input_headers(req), "Content-Type") == NULL) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ if (evbuffer_get_length(evhttp_request_get_input_buffer(req)) != strlen(what)) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ if (evbuffer_datacmp(evhttp_request_get_input_buffer(req), what) != 0) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ test_ok = 1;
+ EVUTIL_ASSERT(exit_base);
+ event_base_loopexit(exit_base, NULL);
+}
+
+static void
+http_request_expect_error(struct evhttp_request *req, void *arg)
+{
+ if (evhttp_request_get_response_code(req) == HTTP_OK) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ test_ok = 1;
+ EVUTIL_ASSERT(arg);
+ event_base_loopexit(arg, NULL);
+}
+
+/* test virtual hosts */
+static void
+http_virtual_host_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+ struct evhttp *second = NULL, *third = NULL;
+ evutil_socket_t fd;
+ struct bufferevent *bev;
+ const char *http_request;
+
+ exit_base = data->base;
+
+ http = http_setup(&port, data->base, 0);
+
+ /* virtual host */
+ second = evhttp_new(NULL);
+ evhttp_set_cb(second, "/funnybunny", http_basic_cb, NULL);
+ third = evhttp_new(NULL);
+ evhttp_set_cb(third, "/blackcoffee", http_basic_cb, NULL);
+
+ if (evhttp_add_virtual_host(http, "foo.com", second) == -1) {
+ tt_abort_msg("Couldn't add vhost");
+ }
+
+ if (evhttp_add_virtual_host(http, "bar.*.foo.com", third) == -1) {
+ tt_abort_msg("Couldn't add wildcarded vhost");
+ }
+
+ /* add some aliases to the vhosts */
+ tt_assert(evhttp_add_server_alias(second, "manolito.info") == 0);
+ tt_assert(evhttp_add_server_alias(third, "bonkers.org") == 0);
+
+ evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port);
+ tt_assert(evcon);
+
+ /* make a request with a different host and expect an error */
+ req = evhttp_request_new(http_request_expect_error, data->base);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET,
+ "/funnybunny") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ tt_assert(test_ok == 1);
+
+ test_ok = 0;
+
+ /* make a request with the right host and expect a response */
+ req = evhttp_request_new(http_request_done, (void*) BASIC_REQUEST_BODY);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "foo.com");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET,
+ "/funnybunny") == -1) {
+ fprintf(stdout, "FAILED\n");
+ exit(1);
+ }
+
+ event_base_dispatch(data->base);
+
+ tt_assert(test_ok == 1);
+
+ test_ok = 0;
+
+ /* make a request with the right host and expect a response */
+ req = evhttp_request_new(http_request_done, (void*) BASIC_REQUEST_BODY);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "bar.magic.foo.com");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET,
+ "/blackcoffee") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ tt_assert(test_ok == 1)
+
+ test_ok = 0;
+
+ /* make a request with the right host and expect a response */
+ req = evhttp_request_new(http_request_done, (void*) BASIC_REQUEST_BODY);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "manolito.info");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET,
+ "/funnybunny") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ tt_assert(test_ok == 1)
+
+ test_ok = 0;
+
+ /* make a request with the right host and expect a response */
+ req = evhttp_request_new(http_request_done, (void*) BASIC_REQUEST_BODY);
+
+ /* Add the Host header. This time with the optional port. */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "bonkers.org:8000");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET,
+ "/blackcoffee") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ tt_assert(test_ok == 1)
+
+ test_ok = 0;
+
+ /* Now make a raw request with an absolute URI. */
+ fd = http_connect("127.0.0.1", port);
+
+ /* Stupid thing to send a request */
+ bev = bufferevent_socket_new(data->base, fd, 0);
+ bufferevent_setcb(bev, http_readcb, http_writecb,
+ http_errorcb, NULL);
+
+ /* The host in the URI should override the Host: header */
+ http_request =
+ "GET http://manolito.info/funnybunny HTTP/1.1\r\n"
+ "Host: somehost\r\n"
+ "Connection: close\r\n"
+ "\r\n";
+
+ bufferevent_write(bev, http_request, strlen(http_request));
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(test_ok, ==, 2);
+
+ bufferevent_free(bev);
+ evutil_closesocket(fd);
+
+ end:
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http)
+ evhttp_free(http);
+}
+
+
+/* test date header and content length */
+
+static void
+http_request_empty_done(struct evhttp_request *req, void *arg)
+{
+ if (evhttp_request_get_response_code(req) != HTTP_OK) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ if (evhttp_find_header(evhttp_request_get_input_headers(req), "Date") == NULL) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+
+ if (evhttp_find_header(evhttp_request_get_input_headers(req), "Content-Length") == NULL) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ if (strcmp(evhttp_find_header(evhttp_request_get_input_headers(req), "Content-Length"),
+ "0")) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ if (evbuffer_get_length(evhttp_request_get_input_buffer(req)) != 0) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ test_ok = 1;
+ EVUTIL_ASSERT(arg);
+ event_base_loopexit(arg, NULL);
+}
+
+/*
+ * HTTP DISPATCHER test
+ */
+
+void
+http_dispatcher_cb(struct evhttp_request *req, void *arg)
+{
+
+ struct evbuffer *evb = evbuffer_new();
+ event_debug(("%s: called\n", __func__));
+ evbuffer_add_printf(evb, "DISPATCHER_TEST");
+
+ evhttp_send_reply(req, HTTP_OK, "Everything is fine", evb);
+
+ evbuffer_free(evb);
+}
+
+static void
+http_dispatcher_test_done(struct evhttp_request *req, void *arg)
+{
+ struct event_base *base = arg;
+ const char *what = "DISPATCHER_TEST";
+
+ if (!req) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ if (evhttp_request_get_response_code(req) != HTTP_OK) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ if (evhttp_find_header(evhttp_request_get_input_headers(req), "Content-Type") == NULL) {
+ fprintf(stderr, "FAILED (content type)\n");
+ exit(1);
+ }
+
+ if (evbuffer_get_length(evhttp_request_get_input_buffer(req)) != strlen(what)) {
+ fprintf(stderr, "FAILED (length %lu vs %lu)\n",
+ (unsigned long)evbuffer_get_length(evhttp_request_get_input_buffer(req)), (unsigned long)strlen(what));
+ exit(1);
+ }
+
+ if (evbuffer_datacmp(evhttp_request_get_input_buffer(req), what) != 0) {
+ fprintf(stderr, "FAILED (data)\n");
+ exit(1);
+ }
+
+ test_ok = 1;
+ event_base_loopexit(base, NULL);
+}
+
+static void
+http_dispatcher_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+
+ evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port);
+ tt_assert(evcon);
+
+ /* also bind to local host */
+ evhttp_connection_set_local_address(evcon, "127.0.0.1");
+
+ /*
+ * At this point, we want to schedule an HTTP GET request
+ * server using our make request method.
+ */
+
+ req = evhttp_request_new(http_dispatcher_test_done, data->base);
+ tt_assert(req);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/?arg=val") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ end:
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http)
+ evhttp_free(http);
+}
+
+/*
+ * HTTP POST test.
+ */
+
+void http_postrequest_done(struct evhttp_request *, void *);
+
+#define POST_DATA "Okay. Not really printf"
+
+static void
+http_post_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+
+ evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port);
+ tt_assert(evcon);
+
+ /*
+ * At this point, we want to schedule an HTTP POST request
+ * server using our make request method.
+ */
+
+ req = evhttp_request_new(http_postrequest_done, data->base);
+ tt_assert(req);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+ evbuffer_add_printf(evhttp_request_get_output_buffer(req), POST_DATA);
+
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_POST, "/postit") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(test_ok, ==, 1);
+
+ test_ok = 0;
+
+ req = evhttp_request_new(http_postrequest_done, data->base);
+ tt_assert(req);
+
+ /* Now try with 100-continue. */
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Expect", "100-continue");
+ evbuffer_add_printf(evhttp_request_get_output_buffer(req), POST_DATA);
+
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_POST, "/postit") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(test_ok, ==, 1);
+
+ evhttp_connection_free(evcon);
+ evhttp_free(http);
+
+ end:
+ ;
+}
+
+void
+http_post_cb(struct evhttp_request *req, void *arg)
+{
+ struct evbuffer *evb;
+ event_debug(("%s: called\n", __func__));
+
+ /* Yes, we are expecting a post request */
+ if (evhttp_request_get_command(req) != EVHTTP_REQ_POST) {
+ fprintf(stdout, "FAILED (post type)\n");
+ exit(1);
+ }
+
+ if (evbuffer_get_length(evhttp_request_get_input_buffer(req)) != strlen(POST_DATA)) {
+ fprintf(stdout, "FAILED (length: %lu vs %lu)\n",
+ (unsigned long) evbuffer_get_length(evhttp_request_get_input_buffer(req)), (unsigned long) strlen(POST_DATA));
+ exit(1);
+ }
+
+ if (evbuffer_datacmp(evhttp_request_get_input_buffer(req), POST_DATA) != 0) {
+ fprintf(stdout, "FAILED (data)\n");
+ fprintf(stdout, "Got :%s\n", evbuffer_pullup(evhttp_request_get_input_buffer(req),-1));
+ fprintf(stdout, "Want:%s\n", POST_DATA);
+ exit(1);
+ }
+
+ evb = evbuffer_new();
+ evbuffer_add_printf(evb, BASIC_REQUEST_BODY);
+
+ evhttp_send_reply(req, HTTP_OK, "Everything is fine", evb);
+
+ evbuffer_free(evb);
+}
+
+void
+http_postrequest_done(struct evhttp_request *req, void *arg)
+{
+ const char *what = BASIC_REQUEST_BODY;
+ struct event_base *base = arg;
+
+ if (req == NULL) {
+ fprintf(stderr, "FAILED (timeout)\n");
+ exit(1);
+ }
+
+ if (evhttp_request_get_response_code(req) != HTTP_OK) {
+
+ fprintf(stderr, "FAILED (response code)\n");
+ exit(1);
+ }
+
+ if (evhttp_find_header(evhttp_request_get_input_headers(req), "Content-Type") == NULL) {
+ fprintf(stderr, "FAILED (content type)\n");
+ exit(1);
+ }
+
+ if (evbuffer_get_length(evhttp_request_get_input_buffer(req)) != strlen(what)) {
+ fprintf(stderr, "FAILED (length %lu vs %lu)\n",
+ (unsigned long)evbuffer_get_length(evhttp_request_get_input_buffer(req)), (unsigned long)strlen(what));
+ exit(1);
+ }
+
+ if (evbuffer_datacmp(evhttp_request_get_input_buffer(req), what) != 0) {
+ fprintf(stderr, "FAILED (data)\n");
+ exit(1);
+ }
+
+ test_ok = 1;
+ event_base_loopexit(base, NULL);
+}
+
+/*
+ * HTTP PUT test, basically just like POST, but ...
+ */
+
+void http_putrequest_done(struct evhttp_request *, void *);
+
+#define PUT_DATA "Hi, I'm some PUT data"
+
+static void
+http_put_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+
+ evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port);
+ tt_assert(evcon);
+
+ /*
+ * Schedule the HTTP PUT request
+ */
+
+ req = evhttp_request_new(http_putrequest_done, data->base);
+ tt_assert(req);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "someotherhost");
+ evbuffer_add_printf(evhttp_request_get_output_buffer(req), PUT_DATA);
+
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_PUT, "/putit") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ evhttp_connection_free(evcon);
+ evhttp_free(http);
+
+ tt_int_op(test_ok, ==, 1);
+ end:
+ ;
+}
+
+void
+http_put_cb(struct evhttp_request *req, void *arg)
+{
+ struct evbuffer *evb;
+ event_debug(("%s: called\n", __func__));
+
+ /* Expecting a PUT request */
+ if (evhttp_request_get_command(req) != EVHTTP_REQ_PUT) {
+ fprintf(stdout, "FAILED (put type)\n");
+ exit(1);
+ }
+
+ if (evbuffer_get_length(evhttp_request_get_input_buffer(req)) != strlen(PUT_DATA)) {
+ fprintf(stdout, "FAILED (length: %lu vs %lu)\n",
+ (unsigned long)evbuffer_get_length(evhttp_request_get_input_buffer(req)), (unsigned long)strlen(PUT_DATA));
+ exit(1);
+ }
+
+ if (evbuffer_datacmp(evhttp_request_get_input_buffer(req), PUT_DATA) != 0) {
+ fprintf(stdout, "FAILED (data)\n");
+ fprintf(stdout, "Got :%s\n", evbuffer_pullup(evhttp_request_get_input_buffer(req),-1));
+ fprintf(stdout, "Want:%s\n", PUT_DATA);
+ exit(1);
+ }
+
+ evb = evbuffer_new();
+ evbuffer_add_printf(evb, "That ain't funny");
+
+ evhttp_send_reply(req, HTTP_OK, "Everything is great", evb);
+
+ evbuffer_free(evb);
+}
+
+void
+http_putrequest_done(struct evhttp_request *req, void *arg)
+{
+ struct event_base *base = arg;
+ const char *what = "That ain't funny";
+
+ if (req == NULL) {
+ fprintf(stderr, "FAILED (timeout)\n");
+ exit(1);
+ }
+
+ if (evhttp_request_get_response_code(req) != HTTP_OK) {
+
+ fprintf(stderr, "FAILED (response code)\n");
+ exit(1);
+ }
+
+ if (evhttp_find_header(evhttp_request_get_input_headers(req), "Content-Type") == NULL) {
+ fprintf(stderr, "FAILED (content type)\n");
+ exit(1);
+ }
+
+ if (evbuffer_get_length(evhttp_request_get_input_buffer(req)) != strlen(what)) {
+ fprintf(stderr, "FAILED (length %lu vs %lu)\n",
+ (unsigned long)evbuffer_get_length(evhttp_request_get_input_buffer(req)), (unsigned long)strlen(what));
+ exit(1);
+ }
+
+
+ if (evbuffer_datacmp(evhttp_request_get_input_buffer(req), what) != 0) {
+ fprintf(stderr, "FAILED (data)\n");
+ exit(1);
+ }
+
+ test_ok = 1;
+ event_base_loopexit(base, NULL);
+}
+
+static void
+http_failure_readcb(struct bufferevent *bev, void *arg)
+{
+ const char *what = "400 Bad Request";
+ if (evbuffer_contains(bufferevent_get_input(bev), what)) {
+ test_ok = 2;
+ bufferevent_disable(bev, EV_READ);
+ event_base_loopexit(arg, NULL);
+ }
+}
+
+/*
+ * Testing that the HTTP server can deal with a malformed request.
+ */
+static void
+http_failure_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct bufferevent *bev;
+ evutil_socket_t fd = -1;
+ const char *http_request;
+ ev_uint16_t port = 0;
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+
+ fd = http_connect("127.0.0.1", port);
+ tt_int_op(fd, >=, 0);
+
+ /* Stupid thing to send a request */
+ bev = bufferevent_socket_new(data->base, fd, 0);
+ bufferevent_setcb(bev, http_failure_readcb, http_writecb,
+ http_errorcb, data->base);
+
+ http_request = "illegal request\r\n";
+
+ bufferevent_write(bev, http_request, strlen(http_request));
+
+ event_base_dispatch(data->base);
+
+ bufferevent_free(bev);
+
+ evhttp_free(http);
+
+ tt_int_op(test_ok, ==, 2);
+ end:
+ if (fd >= 0)
+ evutil_closesocket(fd);
+}
+
+static void
+close_detect_done(struct evhttp_request *req, void *arg)
+{
+ struct timeval tv;
+ tt_assert(req);
+ tt_assert(evhttp_request_get_response_code(req) == HTTP_OK);
+
+ test_ok = 1;
+
+ end:
+ evutil_timerclear(&tv);
+ tv.tv_usec = 150000;
+ event_base_loopexit(arg, &tv);
+}
+
+static void
+close_detect_launch(evutil_socket_t fd, short what, void *arg)
+{
+ struct evhttp_connection *evcon = arg;
+ struct event_base *base = evhttp_connection_get_base(evcon);
+ struct evhttp_request *req;
+
+ req = evhttp_request_new(close_detect_done, base);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) {
+ tt_fail_msg("Couldn't make request");
+ }
+}
+
+static void
+close_detect_cb(struct evhttp_request *req, void *arg)
+{
+ struct evhttp_connection *evcon = arg;
+ struct event_base *base = evhttp_connection_get_base(evcon);
+ struct timeval tv;
+
+ if (req != NULL && evhttp_request_get_response_code(req) != HTTP_OK) {
+ tt_abort_msg("Failed");
+ }
+
+ evutil_timerclear(&tv);
+ tv.tv_sec = 0; /* longer than the http time out */
+ tv.tv_usec = 600000; /* longer than the http time out */
+
+ /* launch a new request on the persistent connection in .3 seconds */
+ event_base_once(base, -1, EV_TIMEOUT, close_detect_launch, evcon, &tv);
+ end:
+ ;
+}
+
+
+static void
+http_close_detection_(struct basic_test_data *data, int with_delay)
+{
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+ const struct timeval sec_tenth = { 0, 100000 };
+
+ test_ok = 0;
+ http = http_setup(&port, data->base, 0);
+
+ /* .1 second timeout */
+ evhttp_set_timeout_tv(http, &sec_tenth);
+
+ evcon = evhttp_connection_base_new(data->base, NULL,
+ "127.0.0.1", port);
+ tt_assert(evcon);
+ evhttp_connection_set_timeout_tv(evcon, &sec_tenth);
+
+
+ tt_assert(evcon);
+ delayed_client = evcon;
+
+ /*
+ * At this point, we want to schedule a request to the HTTP
+ * server using our make request method.
+ */
+
+ req = evhttp_request_new(close_detect_cb, evcon);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon,
+ req, EVHTTP_REQ_GET, with_delay ? "/largedelay" : "/test") == -1) {
+ tt_abort_msg("couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ /* at this point, the http server should have no connection */
+ tt_assert(TAILQ_FIRST(&http->connections) == NULL);
+
+ end:
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http)
+ evhttp_free(http);
+}
+static void
+http_close_detection_test(void *arg)
+{
+ http_close_detection_(arg, 0);
+}
+static void
+http_close_detection_delay_test(void *arg)
+{
+ http_close_detection_(arg, 1);
+}
+
+static void
+http_highport_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ int i = -1;
+ struct evhttp *myhttp = NULL;
+
+ /* Try a few different ports */
+ for (i = 0; i < 50; ++i) {
+ myhttp = evhttp_new(data->base);
+ if (evhttp_bind_socket(myhttp, "127.0.0.1", 65535 - i) == 0) {
+ test_ok = 1;
+ evhttp_free(myhttp);
+ return;
+ }
+ evhttp_free(myhttp);
+ }
+
+ tt_fail_msg("Couldn't get a high port");
+}
+
+static void
+http_bad_header_test(void *ptr)
+{
+ struct evkeyvalq headers;
+
+ TAILQ_INIT(&headers);
+
+ tt_want(evhttp_add_header(&headers, "One", "Two") == 0);
+ tt_want(evhttp_add_header(&headers, "One", "Two\r\n Three") == 0);
+ tt_want(evhttp_add_header(&headers, "One\r", "Two") == -1);
+ tt_want(evhttp_add_header(&headers, "One\n", "Two") == -1);
+ tt_want(evhttp_add_header(&headers, "One", "Two\r") == -1);
+ tt_want(evhttp_add_header(&headers, "One", "Two\n") == -1);
+
+ evhttp_clear_headers(&headers);
+}
+
+static int validate_header(
+ const struct evkeyvalq* headers,
+ const char *key, const char *value)
+{
+ const char *real_val = evhttp_find_header(headers, key);
+ tt_assert(real_val != NULL);
+ tt_want(strcmp(real_val, value) == 0);
+end:
+ return (0);
+}
+
+static void
+http_parse_query_test(void *ptr)
+{
+ struct evkeyvalq headers;
+ int r;
+
+ TAILQ_INIT(&headers);
+
+ r = evhttp_parse_query("http://www.test.com/?q=test", &headers);
+ tt_want(validate_header(&headers, "q", "test") == 0);
+ tt_int_op(r, ==, 0);
+ evhttp_clear_headers(&headers);
+
+ r = evhttp_parse_query("http://www.test.com/?q=test&foo=bar", &headers);
+ tt_want(validate_header(&headers, "q", "test") == 0);
+ tt_want(validate_header(&headers, "foo", "bar") == 0);
+ tt_int_op(r, ==, 0);
+ evhttp_clear_headers(&headers);
+
+ r = evhttp_parse_query("http://www.test.com/?q=test+foo", &headers);
+ tt_want(validate_header(&headers, "q", "test foo") == 0);
+ tt_int_op(r, ==, 0);
+ evhttp_clear_headers(&headers);
+
+ r = evhttp_parse_query("http://www.test.com/?q=test%0Afoo", &headers);
+ tt_want(validate_header(&headers, "q", "test\nfoo") == 0);
+ tt_int_op(r, ==, 0);
+ evhttp_clear_headers(&headers);
+
+ r = evhttp_parse_query("http://www.test.com/?q=test%0Dfoo", &headers);
+ tt_want(validate_header(&headers, "q", "test\rfoo") == 0);
+ tt_int_op(r, ==, 0);
+ evhttp_clear_headers(&headers);
+
+ r = evhttp_parse_query("http://www.test.com/?q=test&&q2", &headers);
+ tt_int_op(r, ==, -1);
+ evhttp_clear_headers(&headers);
+
+ r = evhttp_parse_query("http://www.test.com/?q=test+this", &headers);
+ tt_want(validate_header(&headers, "q", "test this") == 0);
+ tt_int_op(r, ==, 0);
+ evhttp_clear_headers(&headers);
+
+ r = evhttp_parse_query("http://www.test.com/?q=test&q2=foo", &headers);
+ tt_int_op(r, ==, 0);
+ tt_want(validate_header(&headers, "q", "test") == 0);
+ tt_want(validate_header(&headers, "q2", "foo") == 0);
+ evhttp_clear_headers(&headers);
+
+ r = evhttp_parse_query("http://www.test.com/?q&q2=foo", &headers);
+ tt_int_op(r, ==, -1);
+ evhttp_clear_headers(&headers);
+
+ r = evhttp_parse_query("http://www.test.com/?q=foo&q2", &headers);
+ tt_int_op(r, ==, -1);
+ evhttp_clear_headers(&headers);
+
+ r = evhttp_parse_query("http://www.test.com/?q=foo&q2&q3=x", &headers);
+ tt_int_op(r, ==, -1);
+ evhttp_clear_headers(&headers);
+
+ r = evhttp_parse_query("http://www.test.com/?q=&q2=&q3=", &headers);
+ tt_int_op(r, ==, 0);
+ tt_want(validate_header(&headers, "q", "") == 0);
+ tt_want(validate_header(&headers, "q2", "") == 0);
+ tt_want(validate_header(&headers, "q3", "") == 0);
+ evhttp_clear_headers(&headers);
+
+end:
+ evhttp_clear_headers(&headers);
+}
+
+static void
+http_parse_uri_test(void *ptr)
+{
+ const int nonconform = (ptr != NULL);
+ const unsigned parse_flags =
+ nonconform ? EVHTTP_URI_NONCONFORMANT : 0;
+ struct evhttp_uri *uri = NULL;
+ char url_tmp[4096];
+#define URI_PARSE(uri) \
+ evhttp_uri_parse_with_flags((uri), parse_flags)
+
+#define TT_URI(want) do { \
+ char *ret = evhttp_uri_join(uri, url_tmp, sizeof(url_tmp)); \
+ tt_want(ret != NULL); \
+ tt_want(ret == url_tmp); \
+ if (strcmp(ret,want) != 0) \
+ TT_FAIL(("\"%s\" != \"%s\"",ret,want)); \
+ } while(0)
+
+ tt_want(evhttp_uri_join(NULL, 0, 0) == NULL);
+ tt_want(evhttp_uri_join(NULL, url_tmp, 0) == NULL);
+ tt_want(evhttp_uri_join(NULL, url_tmp, sizeof(url_tmp)) == NULL);
+
+ /* bad URIs: parsing */
+#define BAD(s) do { \
+ if (URI_PARSE(s) != NULL) \
+ TT_FAIL(("Expected error parsing \"%s\"",s)); \
+ } while(0)
+ /* Nonconformant URIs we can parse: parsing */
+#define NCF(s) do { \
+ uri = URI_PARSE(s); \
+ if (uri != NULL && !nonconform) { \
+ TT_FAIL(("Expected error parsing \"%s\"",s)); \
+ } else if (uri == NULL && nonconform) { \
+ TT_FAIL(("Couldn't parse nonconformant URI \"%s\"", \
+ s)); \
+ } \
+ if (uri) { \
+ tt_want(evhttp_uri_join(uri, url_tmp, \
+ sizeof(url_tmp))); \
+ evhttp_uri_free(uri); \
+ } \
+ } while(0)
+
+ NCF("http://www.test.com/ why hello");
+ NCF("http://www.test.com/why-hello\x01");
+ NCF("http://www.test.com/why-hello?\x01");
+ NCF("http://www.test.com/why-hello#\x01");
+ BAD("http://www.\x01.test.com/why-hello");
+ BAD("http://www.%7test.com/why-hello");
+ NCF("http://www.test.com/why-hell%7o");
+ BAD("h%3ttp://www.test.com/why-hello");
+ NCF("http://www.test.com/why-hello%7");
+ NCF("http://www.test.com/why-hell%7o");
+ NCF("http://www.test.com/foo?ba%r");
+ NCF("http://www.test.com/foo#ba%r");
+ BAD("99:99/foo");
+ BAD("http://www.test.com:999x/");
+ BAD("http://www.test.com:x/");
+ BAD("http://[hello-there]/");
+ BAD("http://[::1]]/");
+ BAD("http://[::1/");
+ BAD("http://[foob/");
+ BAD("http://[/");
+ BAD("http://[ffff:ffff:ffff:ffff:Ffff:ffff:ffff:"
+ "ffff:ffff:ffff:ffff:ffff:ffff:ffff]/");
+ BAD("http://[vX.foo]/");
+ BAD("http://[vX.foo]/");
+ BAD("http://[v.foo]/");
+ BAD("http://[v5.fo%o]/");
+ BAD("http://[v5X]/");
+ BAD("http://[v5]/");
+ BAD("http://[]/");
+ BAD("http://f\x01red@www.example.com/");
+ BAD("http://f%0red@www.example.com/");
+ BAD("http://www.example.com:9999999999999999999999999999999999999/");
+ BAD("http://www.example.com:hihi/");
+ BAD("://www.example.com/");
+
+ /* bad URIs: joining */
+ uri = evhttp_uri_new();
+ tt_want(0==evhttp_uri_set_host(uri, "www.example.com"));
+ tt_want(evhttp_uri_join(uri, url_tmp, sizeof(url_tmp)) != NULL);
+ /* not enough space: */
+ tt_want(evhttp_uri_join(uri, url_tmp, 3) == NULL);
+ /* host is set, but path doesn't start with "/": */
+ tt_want(0==evhttp_uri_set_path(uri, "hi_mom"));
+ tt_want(evhttp_uri_join(uri, url_tmp, sizeof(url_tmp)) == NULL);
+ tt_want(evhttp_uri_join(uri, NULL, sizeof(url_tmp))==NULL);
+ tt_want(evhttp_uri_join(uri, url_tmp, 0)==NULL);
+ evhttp_uri_free(uri);
+ uri = URI_PARSE("mailto:foo@bar");
+ tt_want(uri != NULL);
+ tt_want(evhttp_uri_get_host(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(!strcmp(evhttp_uri_get_scheme(uri), "mailto"));
+ tt_want(!strcmp(evhttp_uri_get_path(uri), "foo@bar"));
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("mailto:foo@bar");
+ evhttp_uri_free(uri);
+
+ uri = evhttp_uri_new();
+ /* Bad URI usage: setting invalid values */
+ tt_want(-1 == evhttp_uri_set_scheme(uri,""));
+ tt_want(-1 == evhttp_uri_set_scheme(uri,"33"));
+ tt_want(-1 == evhttp_uri_set_scheme(uri,"hi!"));
+ tt_want(-1 == evhttp_uri_set_userinfo(uri,"hello@"));
+ tt_want(-1 == evhttp_uri_set_host(uri,"[1.2.3.4]"));
+ tt_want(-1 == evhttp_uri_set_host(uri,"["));
+ tt_want(-1 == evhttp_uri_set_host(uri,"www.[foo].com"));
+ tt_want(-1 == evhttp_uri_set_port(uri,-3));
+ tt_want(-1 == evhttp_uri_set_path(uri,"hello?world"));
+ tt_want(-1 == evhttp_uri_set_query(uri,"hello#world"));
+ tt_want(-1 == evhttp_uri_set_fragment(uri,"hello#world"));
+ /* Valid URI usage: setting valid values */
+ tt_want(0 == evhttp_uri_set_scheme(uri,"http"));
+ tt_want(0 == evhttp_uri_set_scheme(uri,NULL));
+ tt_want(0 == evhttp_uri_set_userinfo(uri,"username:pass"));
+ tt_want(0 == evhttp_uri_set_userinfo(uri,NULL));
+ tt_want(0 == evhttp_uri_set_host(uri,"www.example.com"));
+ tt_want(0 == evhttp_uri_set_host(uri,"1.2.3.4"));
+ tt_want(0 == evhttp_uri_set_host(uri,"[1:2:3:4::]"));
+ tt_want(0 == evhttp_uri_set_host(uri,"[v7.wobblewobble]"));
+ tt_want(0 == evhttp_uri_set_host(uri,NULL));
+ tt_want(0 == evhttp_uri_set_host(uri,""));
+ tt_want(0 == evhttp_uri_set_port(uri, -1));
+ tt_want(0 == evhttp_uri_set_port(uri, 80));
+ tt_want(0 == evhttp_uri_set_port(uri, 65535));
+ tt_want(0 == evhttp_uri_set_path(uri, ""));
+ tt_want(0 == evhttp_uri_set_path(uri, "/documents/public/index.html"));
+ tt_want(0 == evhttp_uri_set_path(uri, NULL));
+ tt_want(0 == evhttp_uri_set_query(uri, "key=val&key2=val2"));
+ tt_want(0 == evhttp_uri_set_query(uri, "keyvalblarg"));
+ tt_want(0 == evhttp_uri_set_query(uri, ""));
+ tt_want(0 == evhttp_uri_set_query(uri, NULL));
+ tt_want(0 == evhttp_uri_set_fragment(uri, ""));
+ tt_want(0 == evhttp_uri_set_fragment(uri, "here?i?am"));
+ tt_want(0 == evhttp_uri_set_fragment(uri, NULL));
+ evhttp_uri_free(uri);
+
+ /* Valid parsing */
+ uri = URI_PARSE("http://www.test.com/?q=t%33est");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "www.test.com") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(strcmp(evhttp_uri_get_query(uri), "q=t%33est") == 0);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("http://www.test.com/?q=t%33est");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("http://%77ww.test.com");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "%77ww.test.com") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("http://%77ww.test.com");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("http://www.test.com?q=test");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "www.test.com") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "") == 0);
+ tt_want(strcmp(evhttp_uri_get_query(uri), "q=test") == 0);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("http://www.test.com?q=test");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("http://www.test.com#fragment");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "www.test.com") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want_str_op(evhttp_uri_get_fragment(uri), ==, "fragment");
+ TT_URI("http://www.test.com#fragment");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("http://8000/");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "8000") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("http://8000/");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("http://:8000/");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == 8000);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("http://:8000/");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("http://www.test.com:/"); /* empty port */
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "www.test.com") == 0);
+ tt_want_str_op(evhttp_uri_get_path(uri), ==, "/");
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("http://www.test.com/");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("http://www.test.com:"); /* empty port 2 */
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "www.test.com") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("http://www.test.com");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("ftp://www.test.com/?q=test");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "ftp") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "www.test.com") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(strcmp(evhttp_uri_get_query(uri), "q=test") == 0);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("ftp://www.test.com/?q=test");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("ftp://[::1]:999/?q=test");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "ftp") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "[::1]") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(strcmp(evhttp_uri_get_query(uri), "q=test") == 0);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == 999);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("ftp://[::1]:999/?q=test");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("ftp://[ff00::127.0.0.1]/?q=test");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "ftp") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "[ff00::127.0.0.1]") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(strcmp(evhttp_uri_get_query(uri), "q=test") == 0);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("ftp://[ff00::127.0.0.1]/?q=test");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("ftp://[v99.not_(any:time)_soon]/?q=test");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "ftp") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "[v99.not_(any:time)_soon]") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(strcmp(evhttp_uri_get_query(uri), "q=test") == 0);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("ftp://[v99.not_(any:time)_soon]/?q=test");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("scheme://user:pass@foo.com:42/?q=test&s=some+thing#fragment");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "scheme") == 0);
+ tt_want(strcmp(evhttp_uri_get_userinfo(uri), "user:pass") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "foo.com") == 0);
+ tt_want(evhttp_uri_get_port(uri) == 42);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(strcmp(evhttp_uri_get_query(uri), "q=test&s=some+thing") == 0);
+ tt_want(strcmp(evhttp_uri_get_fragment(uri), "fragment") == 0);
+ TT_URI("scheme://user:pass@foo.com:42/?q=test&s=some+thing#fragment");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("scheme://user@foo.com/#fragment");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "scheme") == 0);
+ tt_want(strcmp(evhttp_uri_get_userinfo(uri), "user") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "foo.com") == 0);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(strcmp(evhttp_uri_get_fragment(uri), "fragment") == 0);
+ TT_URI("scheme://user@foo.com/#fragment");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("scheme://%75ser@foo.com/#frag@ment");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "scheme") == 0);
+ tt_want(strcmp(evhttp_uri_get_userinfo(uri), "%75ser") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "foo.com") == 0);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(strcmp(evhttp_uri_get_fragment(uri), "frag@ment") == 0);
+ TT_URI("scheme://%75ser@foo.com/#frag@ment");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("file:///some/path/to/the/file");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "file") == 0);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "") == 0);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/some/path/to/the/file") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("file:///some/path/to/the/file");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("///some/path/to/the-file");
+ tt_want(uri != NULL);
+ tt_want(evhttp_uri_get_scheme(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "") == 0);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/some/path/to/the-file") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("///some/path/to/the-file");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("/s:ome/path/to/the-file?q=99#fred");
+ tt_want(uri != NULL);
+ tt_want(evhttp_uri_get_scheme(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_host(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/s:ome/path/to/the-file") == 0);
+ tt_want(strcmp(evhttp_uri_get_query(uri), "q=99") == 0);
+ tt_want(strcmp(evhttp_uri_get_fragment(uri), "fred") == 0);
+ TT_URI("/s:ome/path/to/the-file?q=99#fred");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("relative/path/with/co:lon");
+ tt_want(uri != NULL);
+ tt_want(evhttp_uri_get_scheme(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_host(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "relative/path/with/co:lon") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("relative/path/with/co:lon");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("bob?q=99&q2=q?33#fr?ed");
+ tt_want(uri != NULL);
+ tt_want(evhttp_uri_get_scheme(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_host(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "bob") == 0);
+ tt_want(strcmp(evhttp_uri_get_query(uri), "q=99&q2=q?33") == 0);
+ tt_want(strcmp(evhttp_uri_get_fragment(uri), "fr?ed") == 0);
+ TT_URI("bob?q=99&q2=q?33#fr?ed");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("#fr?ed");
+ tt_want(uri != NULL);
+ tt_want(evhttp_uri_get_scheme(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_host(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(strcmp(evhttp_uri_get_fragment(uri), "fr?ed") == 0);
+ TT_URI("#fr?ed");
+ evhttp_uri_free(uri);
+#undef URI_PARSE
+#undef TT_URI
+#undef BAD
+}
+
+static void
+http_uriencode_test(void *ptr)
+{
+ char *s=NULL, *s2=NULL;
+ size_t sz;
+ int bytes_decoded;
+
+#define ENC(from,want,plus) do { \
+ s = evhttp_uriencode((from), -1, (plus)); \
+ tt_assert(s); \
+ tt_str_op(s,==,(want)); \
+ sz = -1; \
+ s2 = evhttp_uridecode((s), (plus), &sz); \
+ tt_assert(s2); \
+ tt_str_op(s2,==,(from)); \
+ tt_int_op(sz,==,strlen(from)); \
+ free(s); \
+ free(s2); \
+ s = s2 = NULL; \
+ } while (0)
+
+#define DEC(from,want,dp) do { \
+ s = evhttp_uridecode((from),(dp),&sz); \
+ tt_assert(s); \
+ tt_str_op(s,==,(want)); \
+ tt_int_op(sz,==,strlen(want)); \
+ free(s); \
+ s = NULL; \
+ } while (0)
+
+#define OLD_DEC(from,want) do { \
+ s = evhttp_decode_uri((from)); \
+ tt_assert(s); \
+ tt_str_op(s,==,(want)); \
+ free(s); \
+ s = NULL; \
+ } while (0)
+
+
+ ENC("Hello", "Hello",0);
+ ENC("99", "99",0);
+ ENC("", "",0);
+ ENC(
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789-.~_",
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789-.~_",0);
+ ENC(" ", "%20",0);
+ ENC(" ", "+",1);
+ ENC("\xff\xf0\xe0", "%FF%F0%E0",0);
+ ENC("\x01\x19", "%01%19",1);
+ ENC("http://www.ietf.org/rfc/rfc3986.txt",
+ "http%3A%2F%2Fwww.ietf.org%2Frfc%2Frfc3986.txt",1);
+
+ ENC("1+2=3", "1%2B2%3D3",1);
+ ENC("1+2=3", "1%2B2%3D3",0);
+
+ /* Now try encoding with internal NULs. */
+ s = evhttp_uriencode("hello\0world", 11, 0);
+ tt_assert(s);
+ tt_str_op(s,==,"hello%00world");
+ free(s);
+ s = NULL;
+
+ /* Now try decoding just part of string. */
+ s = malloc(6 + 1 /* NUL byte */);
+ bytes_decoded = evhttp_decode_uri_internal("hello%20%20", 6, s, 0);
+ tt_assert(s);
+ tt_int_op(bytes_decoded,==,6);
+ tt_str_op(s,==,"hello%");
+ free(s);
+ s = NULL;
+
+ /* Now try out some decoding cases that we don't generate with
+ * encode_uri: Make sure that malformed stuff doesn't crash... */
+ DEC("%%xhello th+ere \xff",
+ "%%xhello th+ere \xff", 0);
+ /* Make sure plus decoding works */
+ DEC("plus+should%20work+", "plus should work ",1);
+ /* Try some lowercase hex */
+ DEC("%f0%a0%b0", "\xf0\xa0\xb0",1);
+
+ /* Try an internal NUL. */
+ sz = 0;
+ s = evhttp_uridecode("%00%00x%00%00", 1, &sz);
+ tt_int_op(sz,==,5);
+ tt_assert(!memcmp(s, "\0\0x\0\0", 5));
+ free(s);
+ s = NULL;
+
+ /* Try with size == NULL */
+ sz = 0;
+ s = evhttp_uridecode("%00%00x%00%00", 1, NULL);
+ tt_assert(!memcmp(s, "\0\0x\0\0", 5));
+ free(s);
+ s = NULL;
+
+ /* Test out the crazy old behavior of the deprecated
+ * evhttp_decode_uri */
+ OLD_DEC("http://example.com/normal+path/?key=val+with+spaces",
+ "http://example.com/normal+path/?key=val with spaces");
+
+end:
+ if (s)
+ free(s);
+ if (s2)
+ free(s2);
+#undef ENC
+#undef DEC
+#undef OLD_DEC
+}
+
+static void
+http_base_test(void *ptr)
+{
+ struct event_base *base = NULL;
+ struct bufferevent *bev;
+ evutil_socket_t fd;
+ const char *http_request;
+ ev_uint16_t port = 0;
+
+ test_ok = 0;
+ base = event_base_new();
+ tt_assert(base);
+ http = http_setup(&port, base, 0);
+
+ fd = http_connect("127.0.0.1", port);
+ tt_int_op(fd, >=, 0);
+
+ /* Stupid thing to send a request */
+ bev = bufferevent_socket_new(base, fd, 0);
+ bufferevent_setcb(bev, http_readcb, http_writecb,
+ http_errorcb, base);
+ bufferevent_base_set(base, bev);
+
+ http_request =
+ "GET /test HTTP/1.1\r\n"
+ "Host: somehost\r\n"
+ "Connection: close\r\n"
+ "\r\n";
+
+ bufferevent_write(bev, http_request, strlen(http_request));
+
+ event_base_dispatch(base);
+
+ bufferevent_free(bev);
+ evutil_closesocket(fd);
+
+ evhttp_free(http);
+
+ tt_int_op(test_ok, ==, 2);
+
+end:
+ if (base)
+ event_base_free(base);
+}
+
+/*
+ * the server is just going to close the connection if it times out during
+ * reading the headers.
+ */
+
+static void
+http_incomplete_readcb(struct bufferevent *bev, void *arg)
+{
+ test_ok = -1;
+ event_base_loopexit(exit_base,NULL);
+}
+
+static void
+http_incomplete_errorcb(struct bufferevent *bev, short what, void *arg)
+{
+ /** For ssl */
+ if (what & BEV_EVENT_CONNECTED)
+ return;
+
+ if (what == (BEV_EVENT_READING|BEV_EVENT_EOF))
+ test_ok++;
+ else
+ test_ok = -2;
+ event_base_loopexit(exit_base,NULL);
+}
+
+static void
+http_incomplete_writecb(struct bufferevent *bev, void *arg)
+{
+ if (arg != NULL) {
+ evutil_socket_t fd = *(evutil_socket_t *)arg;
+ /* terminate the write side to simulate EOF */
+ shutdown(fd, SHUT_WR);
+ }
+ if (evbuffer_get_length(bufferevent_get_output(bev)) == 0) {
+ /* enable reading of the reply */
+ bufferevent_enable(bev, EV_READ);
+ test_ok++;
+ }
+}
+
+static void
+http_incomplete_test_(struct basic_test_data *data, int use_timeout, int ssl)
+{
+ struct bufferevent *bev;
+ evutil_socket_t fd;
+ const char *http_request;
+ ev_uint16_t port = 0;
+ struct timeval tv_start, tv_end;
+
+ exit_base = data->base;
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0);
+ evhttp_set_timeout(http, 1);
+
+ fd = http_connect("127.0.0.1", port);
+ tt_int_op(fd, >=, 0);
+
+ /* Stupid thing to send a request */
+ bev = create_bev(data->base, fd, ssl);
+ bufferevent_setcb(bev,
+ http_incomplete_readcb, http_incomplete_writecb,
+ http_incomplete_errorcb, use_timeout ? NULL : &fd);
+
+ http_request =
+ "GET /test HTTP/1.1\r\n"
+ "Host: somehost\r\n";
+
+ bufferevent_write(bev, http_request, strlen(http_request));
+
+ evutil_gettimeofday(&tv_start, NULL);
+
+ event_base_dispatch(data->base);
+
+ evutil_gettimeofday(&tv_end, NULL);
+ evutil_timersub(&tv_end, &tv_start, &tv_end);
+
+ bufferevent_free(bev);
+ if (use_timeout) {
+ evutil_closesocket(fd);
+ fd = -1;
+ }
+
+ evhttp_free(http);
+
+ if (use_timeout && tv_end.tv_sec >= 3) {
+ tt_abort_msg("time");
+ } else if (!use_timeout && tv_end.tv_sec >= 1) {
+ /* we should be done immediately */
+ tt_abort_msg("time");
+ }
+
+ tt_int_op(test_ok, ==, 2);
+ end:
+ if (fd >= 0)
+ evutil_closesocket(fd);
+}
+static void http_incomplete_test(void *arg)
+{ http_incomplete_test_(arg, 0, 0); }
+static void http_incomplete_timeout_test(void *arg)
+{ http_incomplete_test_(arg, 1, 0); }
+
+
+/*
+ * the server is going to reply with chunked data.
+ */
+
+static void
+http_chunked_readcb(struct bufferevent *bev, void *arg)
+{
+ /* nothing here */
+}
+
+static void
+http_chunked_errorcb(struct bufferevent *bev, short what, void *arg)
+{
+ struct evhttp_request *req = NULL;
+
+ /** SSL */
+ if (what & BEV_EVENT_CONNECTED)
+ return;
+
+ if (!test_ok)
+ goto out;
+
+ test_ok = -1;
+
+ if ((what & BEV_EVENT_EOF) != 0) {
+ const char *header;
+ enum message_read_status done;
+ req = evhttp_request_new(NULL, NULL);
+
+ /* req->kind = EVHTTP_RESPONSE; */
+ done = evhttp_parse_firstline_(req, bufferevent_get_input(bev));
+ if (done != ALL_DATA_READ)
+ goto out;
+
+ done = evhttp_parse_headers_(req, bufferevent_get_input(bev));
+ if (done != ALL_DATA_READ)
+ goto out;
+
+ header = evhttp_find_header(evhttp_request_get_input_headers(req), "Transfer-Encoding");
+ if (header == NULL || strcmp(header, "chunked"))
+ goto out;
+
+ header = evhttp_find_header(evhttp_request_get_input_headers(req), "Connection");
+ if (header == NULL || strcmp(header, "close"))
+ goto out;
+
+ header = evbuffer_readln(bufferevent_get_input(bev), NULL, EVBUFFER_EOL_CRLF);
+ if (header == NULL)
+ goto out;
+ /* 13 chars */
+ if (strcmp(header, "d")) {
+ free((void*)header);
+ goto out;
+ }
+ free((void*)header);
+
+ if (strncmp((char *)evbuffer_pullup(bufferevent_get_input(bev), 13),
+ "This is funny", 13))
+ goto out;
+
+ evbuffer_drain(bufferevent_get_input(bev), 13 + 2);
+
+ header = evbuffer_readln(bufferevent_get_input(bev), NULL, EVBUFFER_EOL_CRLF);
+ if (header == NULL)
+ goto out;
+ /* 18 chars */
+ if (strcmp(header, "12"))
+ goto out;
+ free((char *)header);
+
+ if (strncmp((char *)evbuffer_pullup(bufferevent_get_input(bev), 18),
+ "but not hilarious.", 18))
+ goto out;
+
+ evbuffer_drain(bufferevent_get_input(bev), 18 + 2);
+
+ header = evbuffer_readln(bufferevent_get_input(bev), NULL, EVBUFFER_EOL_CRLF);
+ if (header == NULL)
+ goto out;
+ /* 8 chars */
+ if (strcmp(header, "8")) {
+ free((void*)header);
+ goto out;
+ }
+ free((char *)header);
+
+ if (strncmp((char *)evbuffer_pullup(bufferevent_get_input(bev), 8),
+ "bwv 1052.", 8))
+ goto out;
+
+ evbuffer_drain(bufferevent_get_input(bev), 8 + 2);
+
+ header = evbuffer_readln(bufferevent_get_input(bev), NULL, EVBUFFER_EOL_CRLF);
+ if (header == NULL)
+ goto out;
+ /* 0 chars */
+ if (strcmp(header, "0")) {
+ free((void*)header);
+ goto out;
+ }
+ free((void *)header);
+
+ test_ok = 2;
+ }
+
+out:
+ if (req)
+ evhttp_request_free(req);
+
+ event_base_loopexit(arg, NULL);
+}
+
+static void
+http_chunked_writecb(struct bufferevent *bev, void *arg)
+{
+ if (evbuffer_get_length(bufferevent_get_output(bev)) == 0) {
+ /* enable reading of the reply */
+ bufferevent_enable(bev, EV_READ);
+ test_ok++;
+ }
+}
+
+static void
+http_chunked_request_done(struct evhttp_request *req, void *arg)
+{
+ if (evhttp_request_get_response_code(req) != HTTP_OK) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ if (evhttp_find_header(evhttp_request_get_input_headers(req),
+ "Transfer-Encoding") == NULL) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ if (evbuffer_get_length(evhttp_request_get_input_buffer(req)) != 13 + 18 + 8) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ if (strncmp((char *)evbuffer_pullup(evhttp_request_get_input_buffer(req), 13 + 18 + 8),
+ "This is funnybut not hilarious.bwv 1052",
+ 13 + 18 + 8)) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ test_ok = 1;
+ event_base_loopexit(arg, NULL);
+}
+
+static void
+http_chunk_out_test_impl(void *arg, int ssl)
+{
+ struct basic_test_data *data = arg;
+ struct bufferevent *bev;
+ evutil_socket_t fd;
+ const char *http_request;
+ ev_uint16_t port = 0;
+ struct timeval tv_start, tv_end;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+ int i;
+
+ exit_base = data->base;
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0);
+
+ fd = http_connect("127.0.0.1", port);
+
+ /* Stupid thing to send a request */
+ bev = create_bev(data->base, fd, ssl);
+ bufferevent_setcb(bev,
+ http_chunked_readcb, http_chunked_writecb,
+ http_chunked_errorcb, data->base);
+
+ http_request =
+ "GET /chunked HTTP/1.1\r\n"
+ "Host: somehost\r\n"
+ "Connection: close\r\n"
+ "\r\n";
+
+ bufferevent_write(bev, http_request, strlen(http_request));
+
+ evutil_gettimeofday(&tv_start, NULL);
+
+ event_base_dispatch(data->base);
+
+ bufferevent_free(bev);
+
+ evutil_gettimeofday(&tv_end, NULL);
+ evutil_timersub(&tv_end, &tv_start, &tv_end);
+
+ tt_int_op(tv_end.tv_sec, <, 1);
+
+ tt_int_op(test_ok, ==, 2);
+
+ /* now try again with the regular connection object */
+ bev = create_bev(data->base, -1, ssl);
+ evcon = evhttp_connection_base_bufferevent_new(
+ data->base, NULL, bev, "127.0.0.1", port);
+ tt_assert(evcon);
+
+ /* make two requests to check the keepalive behavior */
+ for (i = 0; i < 2; i++) {
+ test_ok = 0;
+ req = evhttp_request_new(http_chunked_request_done,data->base);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req,
+ EVHTTP_REQ_GET, "/chunked") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ tt_assert(test_ok == 1);
+ }
+
+ end:
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http)
+ evhttp_free(http);
+}
+static void http_chunk_out_test(void *arg)
+{ return http_chunk_out_test_impl(arg, 0); }
+
+static void
+http_stream_out_test_impl(void *arg, int ssl)
+{
+ struct basic_test_data *data = arg;
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+ struct bufferevent *bev;
+
+ test_ok = 0;
+ exit_base = data->base;
+
+ http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0);
+
+ bev = create_bev(data->base, -1, ssl);
+ evcon = evhttp_connection_base_bufferevent_new(
+ data->base, NULL, bev, "127.0.0.1", port);
+ tt_assert(evcon);
+
+ /*
+ * At this point, we want to schedule a request to the HTTP
+ * server using our make request method.
+ */
+
+ req = evhttp_request_new(http_request_done,
+ (void *)"This is funnybut not hilarious.bwv 1052");
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/streamed")
+ == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ end:
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http)
+ evhttp_free(http);
+}
+static void http_stream_out_test(void *arg)
+{ return http_stream_out_test_impl(arg, 0); }
+
+static void
+http_stream_in_chunk(struct evhttp_request *req, void *arg)
+{
+ struct evbuffer *reply = arg;
+
+ if (evhttp_request_get_response_code(req) != HTTP_OK) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ evbuffer_add_buffer(reply, evhttp_request_get_input_buffer(req));
+}
+
+static void
+http_stream_in_done(struct evhttp_request *req, void *arg)
+{
+ if (evbuffer_get_length(evhttp_request_get_input_buffer(req)) != 0) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ event_base_loopexit(exit_base, NULL);
+}
+
+/**
+ * Makes a request and reads the response in chunks.
+ */
+static void
+http_stream_in_test_(struct basic_test_data *data, char const *url,
+ size_t expected_len, char const *expected)
+{
+ struct evhttp_connection *evcon;
+ struct evbuffer *reply = evbuffer_new();
+ struct evhttp_request *req = NULL;
+ ev_uint16_t port = 0;
+
+ exit_base = data->base;
+ http = http_setup(&port, data->base, 0);
+
+ evcon = evhttp_connection_base_new(data->base, NULL,"127.0.0.1", port);
+ tt_assert(evcon);
+
+ req = evhttp_request_new(http_stream_in_done, reply);
+ evhttp_request_set_chunked_cb(req, http_stream_in_chunk);
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, url) == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ if (evbuffer_get_length(reply) != expected_len) {
+ TT_DIE(("reply length %lu; expected %lu; FAILED (%s)\n",
+ (unsigned long)evbuffer_get_length(reply),
+ (unsigned long)expected_len,
+ (char*)evbuffer_pullup(reply, -1)));
+ }
+
+ if (memcmp(evbuffer_pullup(reply, -1), expected, expected_len) != 0) {
+ tt_abort_msg("Memory mismatch");
+ }
+
+ test_ok = 1;
+ end:
+ if (reply)
+ evbuffer_free(reply);
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http)
+ evhttp_free(http);
+}
+
+static void
+http_stream_in_test(void *arg)
+{
+ http_stream_in_test_(arg, "/chunked", 13 + 18 + 8,
+ "This is funnybut not hilarious.bwv 1052");
+
+ http_stream_in_test_(arg, "/test", strlen(BASIC_REQUEST_BODY),
+ BASIC_REQUEST_BODY);
+}
+
+static void
+http_stream_in_cancel_chunk(struct evhttp_request *req, void *arg)
+{
+ tt_int_op(evhttp_request_get_response_code(req), ==, HTTP_OK);
+
+ end:
+ evhttp_cancel_request(req);
+ event_base_loopexit(arg, NULL);
+}
+
+static void
+http_stream_in_cancel_done(struct evhttp_request *req, void *arg)
+{
+ /* should never be called */
+ tt_fail_msg("In cancel done");
+}
+
+static void
+http_stream_in_cancel_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct evhttp_connection *evcon;
+ struct evhttp_request *req = NULL;
+ ev_uint16_t port = 0;
+
+ http = http_setup(&port, data->base, 0);
+
+ evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port);
+ tt_assert(evcon);
+
+ req = evhttp_request_new(http_stream_in_cancel_done, data->base);
+ evhttp_request_set_chunked_cb(req, http_stream_in_cancel_chunk);
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/chunked") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ test_ok = 1;
+ end:
+ evhttp_connection_free(evcon);
+ evhttp_free(http);
+
+}
+
+static void
+http_connection_fail_done(struct evhttp_request *req, void *arg)
+{
+ struct evhttp_connection *evcon = arg;
+ struct event_base *base = evhttp_connection_get_base(evcon);
+
+ /* An ENETUNREACH error results in an unrecoverable
+ * evhttp_connection error (see evhttp_connection_fail_()). The
+ * connection will be reset, and the user will be notified with a NULL
+ * req parameter. */
+ tt_assert(!req);
+
+ evhttp_connection_free(evcon);
+
+ test_ok = 1;
+
+ end:
+ event_base_loopexit(base, NULL);
+}
+
+/* Test unrecoverable evhttp_connection errors by generating an ENETUNREACH
+ * error on connection. */
+static void
+http_connection_fail_test_impl(void *arg, int ssl)
+{
+ struct basic_test_data *data = arg;
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+ struct bufferevent *bev;
+
+ exit_base = data->base;
+ test_ok = 0;
+
+ /* auto detect a port */
+ http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0);
+ evhttp_free(http);
+ http = NULL;
+
+ bev = create_bev(data->base, -1, ssl);
+ /* Pick an unroutable address. This administratively scoped multicast
+ * address should do when working with TCP. */
+ evcon = evhttp_connection_base_bufferevent_new(
+ data->base, NULL, bev, "239.10.20.30", 80);
+ tt_assert(evcon);
+
+ /*
+ * At this point, we want to schedule an HTTP GET request
+ * server using our make request method.
+ */
+
+ req = evhttp_request_new(http_connection_fail_done, evcon);
+ tt_assert(req);
+
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(test_ok, ==, 1);
+
+ end:
+ ;
+}
+static void http_connection_fail_test(void *arg)
+{ return http_connection_fail_test_impl(arg, 0); }
+
+static void
+http_connection_retry_done(struct evhttp_request *req, void *arg)
+{
+ tt_assert(req);
+ tt_int_op(evhttp_request_get_response_code(req), !=, HTTP_OK);
+ if (evhttp_find_header(evhttp_request_get_input_headers(req), "Content-Type") != NULL) {
+ tt_abort_msg("(content type)\n");
+ }
+
+ tt_uint_op(evbuffer_get_length(evhttp_request_get_input_buffer(req)), ==, 0);
+
+ test_ok = 1;
+ end:
+ event_base_loopexit(arg,NULL);
+}
+
+struct http_server
+{
+ ev_uint16_t port;
+ int ssl;
+};
+static struct event_base *http_make_web_server_base=NULL;
+static void
+http_make_web_server(evutil_socket_t fd, short what, void *arg)
+{
+ struct http_server *hs = (struct http_server *)arg;
+ http = http_setup(&hs->port, http_make_web_server_base, hs->ssl ? HTTP_BIND_SSL : 0);
+}
+
+static void
+http_simple_test_impl(void *arg, int ssl, int dirty)
+{
+ struct basic_test_data *data = arg;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+ struct bufferevent *bev;
+ struct http_server hs = { .port = 0, .ssl = ssl, };
+
+ exit_base = data->base;
+ test_ok = 0;
+
+ http = http_setup(&hs.port, data->base, ssl ? HTTP_BIND_SSL : 0);
+
+ bev = create_bev(data->base, -1, ssl);
+ evcon = evhttp_connection_base_bufferevent_new(
+ data->base, NULL, bev, "127.0.0.1", hs.port);
+ tt_assert(evcon);
+ evhttp_connection_set_local_address(evcon, "127.0.0.1");
+
+ req = evhttp_request_new(http_request_done, (void*) BASIC_REQUEST_BODY);
+ tt_assert(req);
+
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+ tt_int_op(test_ok, ==, 1);
+
+ end:
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http)
+ evhttp_free(http);
+}
+static void http_simple_test(void *arg)
+{ return http_simple_test_impl(arg, 0, 0); }
+
+static void
+http_connection_retry_test_basic(void *arg, const char *addr, struct evdns_base *dns_base, int ssl)
+{
+ struct basic_test_data *data = arg;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+ struct timeval tv, tv_start, tv_end;
+ struct bufferevent *bev;
+ struct http_server hs = { .port = 0, .ssl = ssl, };
+
+ exit_base = data->base;
+ test_ok = 0;
+
+ /* auto detect a port */
+ http = http_setup(&hs.port, data->base, ssl ? HTTP_BIND_SSL : 0);
+ evhttp_free(http);
+ http = NULL;
+
+ bev = create_bev(data->base, -1, ssl);
+ evcon = evhttp_connection_base_bufferevent_new(data->base, dns_base, bev, addr, hs.port);
+ tt_assert(evcon);
+ if (dns_base)
+ tt_assert(!evhttp_connection_set_flags(evcon, EVHTTP_CON_REUSE_CONNECTED_ADDR));
+
+ evhttp_connection_set_timeout(evcon, 1);
+ /* also bind to local host */
+ evhttp_connection_set_local_address(evcon, "127.0.0.1");
+
+ /*
+ * At this point, we want to schedule an HTTP GET request
+ * server using our make request method.
+ */
+
+ req = evhttp_request_new(http_connection_retry_done, data->base);
+ tt_assert(req);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET,
+ "/?arg=val") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ evutil_gettimeofday(&tv_start, NULL);
+ event_base_dispatch(data->base);
+ evutil_gettimeofday(&tv_end, NULL);
+ evutil_timersub(&tv_end, &tv_start, &tv_end);
+ tt_int_op(tv_end.tv_sec, <, 1);
+
+ tt_int_op(test_ok, ==, 1);
+
+ /*
+ * now test the same but with retries
+ */
+ test_ok = 0;
+ /** Shutdown dns server, to test conn_address reusing */
+ if (dns_base)
+ regress_clean_dnsserver();
+
+ {
+ const struct timeval tv_timeout = { 0, 500000 };
+ const struct timeval tv_retry = { 0, 500000 };
+ evhttp_connection_set_timeout_tv(evcon, &tv_timeout);
+ evhttp_connection_set_initial_retry_tv(evcon, &tv_retry);
+ }
+ evhttp_connection_set_retries(evcon, 1);
+
+ req = evhttp_request_new(http_connection_retry_done, data->base);
+ tt_assert(req);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET,
+ "/?arg=val") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ evutil_gettimeofday(&tv_start, NULL);
+ event_base_dispatch(data->base);
+ evutil_gettimeofday(&tv_end, NULL);
+
+ /* fails fast, .5 sec to wait to retry, fails fast again. */
+ test_timeval_diff_leq(&tv_start, &tv_end, 500, 200);
+
+ tt_assert(test_ok == 1);
+
+ /*
+ * now test the same but with retries and give it a web server
+ * at the end
+ */
+ test_ok = 0;
+
+ evhttp_connection_set_timeout(evcon, 1);
+ evhttp_connection_set_retries(evcon, 3);
+
+ req = evhttp_request_new(http_dispatcher_test_done, data->base);
+ tt_assert(req);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET,
+ "/?arg=val") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ /* start up a web server .2 seconds after the connection tried
+ * to send a request
+ */
+ evutil_timerclear(&tv);
+ tv.tv_usec = 200000;
+ http_make_web_server_base = data->base;
+ event_base_once(data->base, -1, EV_TIMEOUT, http_make_web_server, &hs, &tv);
+
+ evutil_gettimeofday(&tv_start, NULL);
+ event_base_dispatch(data->base);
+ evutil_gettimeofday(&tv_end, NULL);
+ /* We'll wait twice as long as we did last time. */
+ test_timeval_diff_leq(&tv_start, &tv_end, 1000, 400);
+
+ tt_int_op(test_ok, ==, 1);
+
+ end:
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http)
+ evhttp_free(http);
+}
+
+static void
+http_connection_retry_conn_address_test_impl(void *arg, int ssl)
+{
+ struct basic_test_data *data = arg;
+ ev_uint16_t portnum = 0;
+ struct evdns_base *dns_base = NULL;
+ char address[64];
+
+ tt_assert(regress_dnsserver(data->base, &portnum, search_table));
+ dns_base = evdns_base_new(data->base, 0/* init name servers */);
+ tt_assert(dns_base);
+
+ /* Add ourself as the only nameserver, and make sure we really are
+ * the only nameserver. */
+ evutil_snprintf(address, sizeof(address), "127.0.0.1:%d", portnum);
+ evdns_base_nameserver_ip_add(dns_base, address);
+
+ http_connection_retry_test_basic(arg, "localhost", dns_base, ssl);
+
+ end:
+ if (dns_base)
+ evdns_base_free(dns_base, 0);
+ /** dnsserver will be cleaned in http_connection_retry_test_basic() */
+}
+static void http_connection_retry_conn_address_test(void *arg)
+{ return http_connection_retry_conn_address_test_impl(arg, 0); }
+
+static void
+http_connection_retry_test_impl(void *arg, int ssl)
+{
+ return http_connection_retry_test_basic(arg, "127.0.0.1", NULL, ssl);
+}
+static void
+http_connection_retry_test(void *arg)
+{ return http_connection_retry_test_impl(arg, 0); }
+
+static void
+http_primitives(void *ptr)
+{
+ char *escaped = NULL;
+ struct evhttp *http = NULL;
+
+ escaped = evhttp_htmlescape("<script>");
+ tt_assert(escaped);
+ tt_str_op(escaped, ==, "&lt;script&gt;");
+ free(escaped);
+
+ escaped = evhttp_htmlescape("\"\'&");
+ tt_assert(escaped);
+ tt_str_op(escaped, ==, "&quot;&#039;&amp;");
+
+ http = evhttp_new(NULL);
+ tt_assert(http);
+ tt_int_op(evhttp_set_cb(http, "/test", http_basic_cb, NULL), ==, 0);
+ tt_int_op(evhttp_set_cb(http, "/test", http_basic_cb, NULL), ==, -1);
+ tt_int_op(evhttp_del_cb(http, "/test"), ==, 0);
+ tt_int_op(evhttp_del_cb(http, "/test"), ==, -1);
+ tt_int_op(evhttp_set_cb(http, "/test", http_basic_cb, NULL), ==, 0);
+
+ end:
+ if (escaped)
+ free(escaped);
+ if (http)
+ evhttp_free(http);
+}
+
+static void
+http_multi_line_header_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct bufferevent *bev= NULL;
+ evutil_socket_t fd = -1;
+ const char *http_start_request;
+ ev_uint16_t port = 0;
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+
+ tt_ptr_op(http, !=, NULL);
+
+ fd = http_connect("127.0.0.1", port);
+
+ tt_int_op(fd, !=, -1);
+
+ /* Stupid thing to send a request */
+ bev = bufferevent_socket_new(data->base, fd, 0);
+ tt_ptr_op(bev, !=, NULL);
+ bufferevent_setcb(bev, http_readcb, http_writecb,
+ http_errorcb, data->base);
+
+ http_start_request =
+ "GET /test HTTP/1.1\r\n"
+ "Host: somehost\r\n"
+ "Connection: close\r\n"
+ "X-Multi-Extra-WS: libevent \r\n"
+ "\t\t\t2.1 \r\n"
+ "X-Multi: aaaaaaaa\r\n"
+ " a\r\n"
+ "\tEND\r\n"
+ "X-Last: last\r\n"
+ "\r\n";
+
+ bufferevent_write(bev, http_start_request, strlen(http_start_request));
+ found_multi = found_multi2 = 0;
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(found_multi, ==, 1);
+ tt_int_op(found_multi2, ==, 1);
+ tt_int_op(test_ok, ==, 4);
+ end:
+ if (bev)
+ bufferevent_free(bev);
+ if (fd >= 0)
+ evutil_closesocket(fd);
+ if (http)
+ evhttp_free(http);
+}
+
+static void
+http_request_bad(struct evhttp_request *req, void *arg)
+{
+ if (req != NULL) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ test_ok = 1;
+ event_base_loopexit(arg, NULL);
+}
+
+static void
+http_negative_content_length_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+
+ evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port);
+ tt_assert(evcon);
+
+ /*
+ * At this point, we want to schedule a request to the HTTP
+ * server using our make request method.
+ */
+
+ req = evhttp_request_new(http_request_bad, data->base);
+
+ /* Cause the response to have a negative content-length */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "X-Negative", "makeitso");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ end:
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http)
+ evhttp_free(http);
+}
+
+
+static void
+http_data_length_constraints_test_done(struct evhttp_request *req, void *arg)
+{
+ tt_assert(req);
+ tt_int_op(evhttp_request_get_response_code(req), ==, HTTP_BADREQUEST);
+end:
+ event_base_loopexit(arg, NULL);
+}
+
+static void
+http_large_entity_test_done(struct evhttp_request *req, void *arg)
+{
+ tt_assert(req);
+ tt_int_op(evhttp_request_get_response_code(req), ==, HTTP_ENTITYTOOLARGE);
+end:
+ event_base_loopexit(arg, NULL);
+}
+
+static void
+http_data_length_constraints_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+ char long_str[8192];
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+
+ evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port);
+ tt_assert(evcon);
+
+ /* also bind to local host */
+ evhttp_connection_set_local_address(evcon, "127.0.0.1");
+
+ /*
+ * At this point, we want to schedule an HTTP GET request
+ * server using our make request method.
+ */
+
+ req = evhttp_request_new(http_data_length_constraints_test_done, data->base);
+ tt_assert(req);
+
+ memset(long_str, 'a', 8192);
+ long_str[8191] = '\0';
+ /* Add the information that we care about */
+ evhttp_set_max_headers_size(http, 8191);
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Longheader", long_str);
+
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/?arg=val") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+ event_base_dispatch(data->base);
+
+ req = evhttp_request_new(http_data_length_constraints_test_done, data->base);
+ tt_assert(req);
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ /* GET /?arg=verylongvalue HTTP/1.1 */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, long_str) == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+ event_base_dispatch(data->base);
+
+ evhttp_set_max_body_size(http, 8190);
+ req = evhttp_request_new(http_data_length_constraints_test_done, data->base);
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+ evbuffer_add_printf(evhttp_request_get_output_buffer(req), "%s", long_str);
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_POST, "/") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+ event_base_dispatch(data->base);
+
+ req = evhttp_request_new(http_large_entity_test_done, data->base);
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Expect", "100-continue");
+ evbuffer_add_printf(evhttp_request_get_output_buffer(req), "%s", long_str);
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_POST, "/") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+ event_base_dispatch(data->base);
+
+ test_ok = 1;
+ end:
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http)
+ evhttp_free(http);
+}
+
+/*
+ * Testing client reset of server chunked connections
+ */
+
+struct terminate_state {
+ struct event_base *base;
+ struct evhttp_request *req;
+ struct bufferevent *bev;
+ evutil_socket_t fd;
+ int gotclosecb: 1;
+ int oneshot: 1;
+};
+
+static void
+terminate_chunked_trickle_cb(evutil_socket_t fd, short events, void *arg)
+{
+ struct terminate_state *state = arg;
+ struct evbuffer *evb;
+
+ if (!state->req) {
+ return;
+ }
+
+ if (evhttp_request_get_connection(state->req) == NULL) {
+ test_ok = 1;
+ evhttp_request_free(state->req);
+ event_base_loopexit(state->base,NULL);
+ return;
+ }
+
+ evb = evbuffer_new();
+ evbuffer_add_printf(evb, "%p", evb);
+ evhttp_send_reply_chunk(state->req, evb);
+ evbuffer_free(evb);
+
+ if (!state->oneshot) {
+ struct timeval tv;
+ tv.tv_sec = 0;
+ tv.tv_usec = 3000;
+ EVUTIL_ASSERT(state);
+ EVUTIL_ASSERT(state->base);
+ event_base_once(state->base, -1, EV_TIMEOUT, terminate_chunked_trickle_cb, arg, &tv);
+ }
+}
+
+static void
+terminate_chunked_close_cb(struct evhttp_connection *evcon, void *arg)
+{
+ struct terminate_state *state = arg;
+ state->gotclosecb = 1;
+
+ /** TODO: though we can do this unconditionally */
+ if (state->oneshot) {
+ evhttp_request_free(state->req);
+ state->req = NULL;
+ event_base_loopexit(state->base,NULL);
+ }
+}
+
+static void
+terminate_chunked_cb(struct evhttp_request *req, void *arg)
+{
+ struct terminate_state *state = arg;
+ struct timeval tv;
+
+ /* we want to know if this connection closes on us */
+ evhttp_connection_set_closecb(
+ evhttp_request_get_connection(req),
+ terminate_chunked_close_cb, arg);
+
+ state->req = req;
+
+ evhttp_send_reply_start(req, HTTP_OK, "OK");
+
+ tv.tv_sec = 0;
+ tv.tv_usec = 3000;
+ event_base_once(state->base, -1, EV_TIMEOUT, terminate_chunked_trickle_cb, arg, &tv);
+}
+
+static void
+terminate_chunked_client(evutil_socket_t fd, short event, void *arg)
+{
+ struct terminate_state *state = arg;
+ bufferevent_free(state->bev);
+ evutil_closesocket(state->fd);
+}
+
+static void
+terminate_readcb(struct bufferevent *bev, void *arg)
+{
+ /* just drop the data */
+ evbuffer_drain(bufferevent_get_input(bev), -1);
+}
+
+
+static void
+http_terminate_chunked_test_impl(void *arg, int oneshot)
+{
+ struct basic_test_data *data = arg;
+ struct bufferevent *bev = NULL;
+ struct timeval tv;
+ const char *http_request;
+ ev_uint16_t port = 0;
+ evutil_socket_t fd = -1;
+ struct terminate_state terminate_state;
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+ evhttp_del_cb(http, "/test");
+ tt_assert(evhttp_set_cb(http, "/test",
+ terminate_chunked_cb, &terminate_state) == 0);
+
+ fd = http_connect("127.0.0.1", port);
+
+ /* Stupid thing to send a request */
+ bev = bufferevent_socket_new(data->base, fd, 0);
+ bufferevent_setcb(bev, terminate_readcb, http_writecb,
+ http_errorcb, data->base);
+
+ memset(&terminate_state, 0, sizeof(terminate_state));
+ terminate_state.base = data->base;
+ terminate_state.fd = fd;
+ terminate_state.bev = bev;
+ terminate_state.gotclosecb = 0;
+ terminate_state.oneshot = oneshot;
+
+ /* first half of the http request */
+ http_request =
+ "GET /test HTTP/1.1\r\n"
+ "Host: some\r\n\r\n";
+
+ bufferevent_write(bev, http_request, strlen(http_request));
+ evutil_timerclear(&tv);
+ tv.tv_usec = 10000;
+ event_base_once(data->base, -1, EV_TIMEOUT, terminate_chunked_client, &terminate_state,
+ &tv);
+
+ event_base_dispatch(data->base);
+
+ if (terminate_state.gotclosecb == 0)
+ test_ok = 0;
+
+ end:
+ if (fd >= 0)
+ evutil_closesocket(fd);
+ if (http)
+ evhttp_free(http);
+}
+static void
+http_terminate_chunked_test(void *arg)
+{
+ http_terminate_chunked_test_impl(arg, 0);
+}
+static void
+http_terminate_chunked_oneshot_test(void *arg)
+{
+ http_terminate_chunked_test_impl(arg, 1);
+}
+
+static struct regress_dns_server_table ipv6_search_table[] = {
+ { "localhost", "AAAA", "::1", 0, 0 },
+ { NULL, NULL, NULL, 0, 0 }
+};
+
+static void
+http_ipv6_for_domain_test_impl(void *arg, int family)
+{
+ struct basic_test_data *data = arg;
+ struct evdns_base *dns_base = NULL;
+ ev_uint16_t portnum = 0;
+ char address[64];
+
+ tt_assert(regress_dnsserver(data->base, &portnum, ipv6_search_table));
+
+ dns_base = evdns_base_new(data->base, 0/* init name servers */);
+ tt_assert(dns_base);
+
+ /* Add ourself as the only nameserver, and make sure we really are
+ * the only nameserver. */
+ evutil_snprintf(address, sizeof(address), "127.0.0.1:%d", portnum);
+ evdns_base_nameserver_ip_add(dns_base, address);
+
+ http_connection_test_(arg, 0 /* not persistent */, "localhost", dns_base,
+ 1 /* ipv6 */, family);
+
+ end:
+ if (dns_base)
+ evdns_base_free(dns_base, 0);
+ regress_clean_dnsserver();
+}
+static void
+http_ipv6_for_domain_test(void *arg)
+{
+ http_ipv6_for_domain_test_impl(arg, AF_UNSPEC);
+}
+
+static void
+http_request_get_addr_on_close(struct evhttp_connection *evcon, void *arg)
+{
+ const struct sockaddr *storage;
+ char addrbuf[128];
+ char local[] = "127.0.0.1:";
+
+ test_ok = 0;
+ tt_assert(evcon);
+
+ storage = evhttp_connection_get_addr(evcon);
+ tt_assert(storage);
+
+ evutil_format_sockaddr_port_((struct sockaddr *)storage, addrbuf, sizeof(addrbuf));
+ tt_assert(!strncmp(addrbuf, local, sizeof(local) - 1));
+
+ test_ok = 1;
+ return;
+
+end:
+ test_ok = 0;
+}
+
+static void
+http_get_addr_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+
+ test_ok = 0;
+ exit_base = data->base;
+
+ http = http_setup(&port, data->base, 0);
+
+ evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port);
+ tt_assert(evcon);
+ evhttp_connection_set_closecb(evcon, http_request_get_addr_on_close, arg);
+
+ /*
+ * At this point, we want to schedule a request to the HTTP
+ * server using our make request method.
+ */
+
+ req = evhttp_request_new(http_request_done, (void *)BASIC_REQUEST_BODY);
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ http_request_get_addr_on_close(evcon, NULL);
+
+ end:
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http)
+ evhttp_free(http);
+}
+
+static void
+http_set_family_test(void *arg)
+{
+ http_connection_test_(arg, 0, "127.0.0.1", NULL, 0, AF_UNSPEC);
+}
+static void
+http_set_family_ipv4_test(void *arg)
+{
+ http_connection_test_(arg, 0, "127.0.0.1", NULL, 0, AF_INET);
+}
+static void
+http_set_family_ipv6_test(void *arg)
+{
+ http_ipv6_for_domain_test_impl(arg, AF_INET6);
+}
+
+static void
+http_write_during_read(evutil_socket_t fd, short what, void *arg)
+{
+ struct bufferevent *bev = arg;
+ struct timeval tv;
+
+ bufferevent_write(bev, "foobar", strlen("foobar"));
+
+ evutil_timerclear(&tv);
+ tv.tv_sec = 1;
+ event_base_loopexit(exit_base, &tv);
+}
+static void
+http_write_during_read_test_impl(void *arg, int ssl)
+{
+ struct basic_test_data *data = arg;
+ ev_uint16_t port = 0;
+ struct bufferevent *bev = NULL;
+ struct timeval tv;
+ int fd;
+ const char *http_request;
+
+ test_ok = 0;
+ exit_base = data->base;
+
+ http = http_setup(&port, data->base, ssl ? HTTP_BIND_SSL : 0);
+
+ fd = http_connect("127.0.0.1", port);
+ bev = create_bev(data->base, fd, 0);
+ bufferevent_setcb(bev, NULL, NULL, NULL, data->base);
+ bufferevent_disable(bev, EV_READ);
+
+ http_request =
+ "GET /large HTTP/1.1\r\n"
+ "Host: somehost\r\n"
+ "\r\n";
+
+ bufferevent_write(bev, http_request, strlen(http_request));
+ evutil_timerclear(&tv);
+ tv.tv_usec = 10000;
+ event_base_once(data->base, -1, EV_TIMEOUT, http_write_during_read, bev, &tv);
+
+ event_base_dispatch(data->base);
+
+ if (bev)
+ bufferevent_free(bev);
+ if (http)
+ evhttp_free(http);
+}
+static void http_write_during_read_test(void *arg)
+{ return http_write_during_read_test_impl(arg, 0); }
+
+static void
+http_request_own_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+
+ test_ok = 0;
+ exit_base = data->base;
+
+ http = http_setup(&port, data->base, 0);
+ evhttp_free(http);
+
+ evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port);
+ tt_assert(evcon);
+
+ req = evhttp_request_new(http_request_no_action_done, NULL);
+
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+ evhttp_request_own(req);
+
+ event_base_dispatch(data->base);
+
+ end:
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (req)
+ evhttp_request_free(req);
+
+ test_ok = 1;
+}
+
+#define HTTP_LEGACY(name) \
+ { #name, run_legacy_test_fn, TT_ISOLATED|TT_LEGACY, &legacy_setup, \
+ http_##name##_test }
+
+#define HTTP(name) \
+ { #name, http_##name##_test, TT_ISOLATED, &basic_setup, NULL }
+#define HTTPS(name) \
+ { "https_" #name, https_##name##_test, TT_ISOLATED, &basic_setup, NULL }
+
+#ifdef EVENT__HAVE_OPENSSL
+static void https_basic_test(void *arg)
+{ return http_basic_test_impl(arg, 1); }
+static void https_incomplete_test(void *arg)
+{ http_incomplete_test_(arg, 0, 1); }
+static void https_incomplete_timeout_test(void *arg)
+{ http_incomplete_test_(arg, 1, 1); }
+static void https_simple_test(void *arg)
+{ return http_simple_test_impl(arg, 1, 0); }
+static void https_simple_dirty_test(void *arg)
+{ return http_simple_test_impl(arg, 1, 1); }
+static void https_connection_retry_conn_address_test(void *arg)
+{ return http_connection_retry_conn_address_test_impl(arg, 1); }
+static void https_connection_retry_test(void *arg)
+{ return http_connection_retry_test_impl(arg, 1); }
+static void https_chunk_out_test(void *arg)
+{ return http_chunk_out_test_impl(arg, 1); }
+static void https_stream_out_test(void *arg)
+{ return http_stream_out_test_impl(arg, 1); }
+static void https_connection_fail_test(void *arg)
+{ return http_connection_fail_test_impl(arg, 1); }
+static void https_write_during_read_test(void *arg)
+{ return http_write_during_read_test_impl(arg, 1); }
+#endif
+
+struct testcase_t http_testcases[] = {
+ { "primitives", http_primitives, 0, NULL, NULL },
+ { "base", http_base_test, TT_FORK, NULL, NULL },
+ { "bad_headers", http_bad_header_test, 0, NULL, NULL },
+ { "parse_query", http_parse_query_test, 0, NULL, NULL },
+ { "parse_uri", http_parse_uri_test, 0, NULL, NULL },
+ { "parse_uri_nc", http_parse_uri_test, 0, &basic_setup, (void*)"nc" },
+ { "uriencode", http_uriencode_test, 0, NULL, NULL },
+ HTTP(basic),
+ HTTP(simple),
+ HTTP(cancel),
+ HTTP(virtual_host),
+ HTTP(post),
+ HTTP(put),
+ HTTP(delete),
+ HTTP(allowed_methods),
+ HTTP(failure),
+ HTTP(connection),
+ HTTP(persist_connection),
+ HTTP(autofree_connection),
+ HTTP(connection_async),
+ HTTP(close_detection),
+ HTTP(close_detection_delay),
+ HTTP(bad_request),
+ HTTP(incomplete),
+ HTTP(incomplete_timeout),
+ HTTP(terminate_chunked),
+ HTTP(terminate_chunked_oneshot),
+ HTTP(on_complete),
+
+ HTTP(highport),
+ HTTP(dispatcher),
+ HTTP(multi_line_header),
+ HTTP(negative_content_length),
+ HTTP(chunk_out),
+ HTTP(stream_out),
+
+ HTTP(stream_in),
+ HTTP(stream_in_cancel),
+
+ HTTP(connection_fail),
+ { "connection_retry", http_connection_retry_test, TT_ISOLATED|TT_OFF_BY_DEFAULT, &basic_setup, NULL },
+ { "connection_retry_conn_address", http_connection_retry_conn_address_test,
+ TT_ISOLATED|TT_OFF_BY_DEFAULT, &basic_setup, NULL },
+
+ HTTP(data_length_constraints),
+
+ HTTP(ipv6_for_domain),
+ HTTP(get_addr),
+
+ HTTP(set_family),
+ HTTP(set_family_ipv4),
+ HTTP(set_family_ipv6),
+
+ HTTP(write_during_read),
+ HTTP(request_own),
+
+#ifdef EVENT__HAVE_OPENSSL
+ HTTPS(basic),
+ HTTPS(simple),
+ HTTPS(simple_dirty),
+ HTTPS(incomplete),
+ HTTPS(incomplete_timeout),
+ { "https_connection_retry", https_connection_retry_test, TT_ISOLATED|TT_OFF_BY_DEFAULT, &basic_setup, NULL },
+ { "https_connection_retry_conn_address", https_connection_retry_conn_address_test,
+ TT_ISOLATED|TT_OFF_BY_DEFAULT, &basic_setup, NULL },
+ HTTPS(chunk_out),
+ HTTPS(stream_out),
+ HTTPS(connection_fail),
+ HTTPS(write_during_read),
+#endif
+
+ END_OF_TESTCASES
+};
+
diff --git a/protocols/Telegram/tgl/libevent/test/regress_http.obj b/protocols/Telegram/tgl/libevent/test/regress_http.obj
new file mode 100644
index 0000000000..85099a6a04
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_http.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/regress_iocp.c b/protocols/Telegram/tgl/libevent/test/regress_iocp.c
new file mode 100644
index 0000000000..17b385241f
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_iocp.c
@@ -0,0 +1,352 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 <stdlib.h>
+#include <string.h>
+#include "event2/event.h"
+#include "event2/thread.h"
+#include "event2/buffer.h"
+#include "event2/buffer_compat.h"
+#include "event2/bufferevent.h"
+
+#include <winsock2.h>
+#include <ws2tcpip.h>
+
+#include "regress.h"
+#include "tinytest.h"
+#include "tinytest_macros.h"
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <winsock2.h>
+#undef WIN32_LEAN_AND_MEAN
+
+#include "iocp-internal.h"
+#include "evbuffer-internal.h"
+#include "evthread-internal.h"
+
+/* FIXME remove these ones */
+#include <sys/queue.h>
+#include "event2/event_struct.h"
+#include "event-internal.h"
+
+#define MAX_CALLS 16
+
+static void *count_lock = NULL, *count_cond = NULL;
+static int count = 0;
+
+static void
+count_init(void)
+{
+ EVTHREAD_ALLOC_LOCK(count_lock, 0);
+ EVTHREAD_ALLOC_COND(count_cond);
+
+ tt_assert(count_lock);
+ tt_assert(count_cond);
+
+end:
+ ;
+}
+
+static void
+count_free(void)
+{
+ EVTHREAD_FREE_LOCK(count_lock, 0);
+ EVTHREAD_FREE_COND(count_cond);
+}
+
+static void
+count_incr(void)
+{
+ EVLOCK_LOCK(count_lock, 0);
+ count++;
+ EVTHREAD_COND_BROADCAST(count_cond);
+ EVLOCK_UNLOCK(count_lock, 0);
+}
+
+static int
+count_wait_for(int i, int ms)
+{
+ struct timeval tv;
+ DWORD elapsed;
+ int rv = -1;
+
+ EVLOCK_LOCK(count_lock, 0);
+ while (ms > 0 && count != i) {
+ tv.tv_sec = 0;
+ tv.tv_usec = ms * 1000;
+ elapsed = GetTickCount();
+ EVTHREAD_COND_WAIT_TIMED(count_cond, count_lock, &tv);
+ elapsed = GetTickCount() - elapsed;
+ ms -= elapsed;
+ }
+ if (count == i)
+ rv = 0;
+ EVLOCK_UNLOCK(count_lock, 0);
+
+ return rv;
+}
+
+struct dummy_overlapped {
+ struct event_overlapped eo;
+ void *lock;
+ int call_count;
+ uintptr_t keys[MAX_CALLS];
+ ev_ssize_t sizes[MAX_CALLS];
+};
+
+static void
+dummy_cb(struct event_overlapped *o, uintptr_t key, ev_ssize_t n, int ok)
+{
+ struct dummy_overlapped *d_o =
+ EVUTIL_UPCAST(o, struct dummy_overlapped, eo);
+
+ EVLOCK_LOCK(d_o->lock, 0);
+ if (d_o->call_count < MAX_CALLS) {
+ d_o->keys[d_o->call_count] = key;
+ d_o->sizes[d_o->call_count] = n;
+ }
+ d_o->call_count++;
+ EVLOCK_UNLOCK(d_o->lock, 0);
+
+ count_incr();
+}
+
+static int
+pair_is_in(struct dummy_overlapped *o, uintptr_t key, ev_ssize_t n)
+{
+ int i;
+ int result = 0;
+ EVLOCK_LOCK(o->lock, 0);
+ for (i=0; i < o->call_count; ++i) {
+ if (o->keys[i] == key && o->sizes[i] == n) {
+ result = 1;
+ break;
+ }
+ }
+ EVLOCK_UNLOCK(o->lock, 0);
+ return result;
+}
+
+static void
+test_iocp_port(void *ptr)
+{
+ struct event_iocp_port *port = NULL;
+ struct dummy_overlapped o1, o2;
+
+ memset(&o1, 0, sizeof(o1));
+ memset(&o2, 0, sizeof(o2));
+
+ count_init();
+ EVTHREAD_ALLOC_LOCK(o1.lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+ EVTHREAD_ALLOC_LOCK(o2.lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+
+ tt_assert(o1.lock);
+ tt_assert(o2.lock);
+
+ event_overlapped_init_(&o1.eo, dummy_cb);
+ event_overlapped_init_(&o2.eo, dummy_cb);
+
+ port = event_iocp_port_launch_(0);
+ tt_assert(port);
+
+ tt_assert(!event_iocp_activate_overlapped_(port, &o1.eo, 10, 100));
+ tt_assert(!event_iocp_activate_overlapped_(port, &o2.eo, 20, 200));
+
+ tt_assert(!event_iocp_activate_overlapped_(port, &o1.eo, 11, 101));
+ tt_assert(!event_iocp_activate_overlapped_(port, &o2.eo, 21, 201));
+
+ tt_assert(!event_iocp_activate_overlapped_(port, &o1.eo, 12, 102));
+ tt_assert(!event_iocp_activate_overlapped_(port, &o2.eo, 22, 202));
+
+ tt_assert(!event_iocp_activate_overlapped_(port, &o1.eo, 13, 103));
+ tt_assert(!event_iocp_activate_overlapped_(port, &o2.eo, 23, 203));
+
+ tt_int_op(count_wait_for(8, 2000), ==, 0);
+
+ tt_want(!event_iocp_shutdown_(port, 2000));
+
+ tt_int_op(o1.call_count, ==, 4);
+ tt_int_op(o2.call_count, ==, 4);
+
+ tt_want(pair_is_in(&o1, 10, 100));
+ tt_want(pair_is_in(&o1, 11, 101));
+ tt_want(pair_is_in(&o1, 12, 102));
+ tt_want(pair_is_in(&o1, 13, 103));
+
+ tt_want(pair_is_in(&o2, 20, 200));
+ tt_want(pair_is_in(&o2, 21, 201));
+ tt_want(pair_is_in(&o2, 22, 202));
+ tt_want(pair_is_in(&o2, 23, 203));
+
+end:
+ EVTHREAD_FREE_LOCK(o1.lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+ EVTHREAD_FREE_LOCK(o2.lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+ count_free();
+}
+
+static struct evbuffer *rbuf = NULL, *wbuf = NULL;
+
+static void
+read_complete(struct event_overlapped *eo, uintptr_t key,
+ ev_ssize_t nbytes, int ok)
+{
+ tt_assert(ok);
+ evbuffer_commit_read_(rbuf, nbytes);
+ count_incr();
+end:
+ ;
+}
+
+static void
+write_complete(struct event_overlapped *eo, uintptr_t key,
+ ev_ssize_t nbytes, int ok)
+{
+ tt_assert(ok);
+ evbuffer_commit_write_(wbuf, nbytes);
+ count_incr();
+end:
+ ;
+}
+
+static void
+test_iocp_evbuffer(void *ptr)
+{
+ struct event_overlapped rol, wol;
+ struct basic_test_data *data = ptr;
+ struct event_iocp_port *port = NULL;
+ struct evbuffer *buf=NULL;
+ struct evbuffer_chain *chain;
+ char junk[1024];
+ int i;
+
+ count_init();
+ event_overlapped_init_(&rol, read_complete);
+ event_overlapped_init_(&wol, write_complete);
+
+ for (i = 0; i < (int)sizeof(junk); ++i)
+ junk[i] = (char)(i);
+
+ rbuf = evbuffer_overlapped_new_(data->pair[0]);
+ wbuf = evbuffer_overlapped_new_(data->pair[1]);
+ evbuffer_enable_locking(rbuf, NULL);
+ evbuffer_enable_locking(wbuf, NULL);
+
+ port = event_iocp_port_launch_(0);
+ tt_assert(port);
+ tt_assert(rbuf);
+ tt_assert(wbuf);
+
+ tt_assert(!event_iocp_port_associate_(port, data->pair[0], 100));
+ tt_assert(!event_iocp_port_associate_(port, data->pair[1], 100));
+
+ for (i=0;i<10;++i)
+ evbuffer_add(wbuf, junk, sizeof(junk));
+
+ buf = evbuffer_new();
+ tt_assert(buf != NULL);
+ evbuffer_add(rbuf, junk, sizeof(junk));
+ tt_assert(!evbuffer_launch_read_(rbuf, 2048, &rol));
+ evbuffer_add_buffer(buf, rbuf);
+ tt_int_op(evbuffer_get_length(buf), ==, sizeof(junk));
+ for (chain = buf->first; chain; chain = chain->next)
+ tt_int_op(chain->flags & EVBUFFER_MEM_PINNED_ANY, ==, 0);
+ tt_assert(!evbuffer_get_length(rbuf));
+ tt_assert(!evbuffer_launch_write_(wbuf, 512, &wol));
+
+ tt_int_op(count_wait_for(2, 2000), ==, 0);
+
+ tt_int_op(evbuffer_get_length(rbuf),==,512);
+
+ /* FIXME Actually test some stuff here. */
+
+ tt_want(!event_iocp_shutdown_(port, 2000));
+end:
+ count_free();
+ evbuffer_free(rbuf);
+ evbuffer_free(wbuf);
+ if (buf) evbuffer_free(buf);
+}
+
+static int got_readcb = 0;
+
+static void
+async_readcb(struct bufferevent *bev, void *arg)
+{
+ /* Disabling read should cause the loop to quit */
+ bufferevent_disable(bev, EV_READ);
+ got_readcb++;
+}
+
+static void
+test_iocp_bufferevent_async(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct event_iocp_port *port = NULL;
+ struct bufferevent *bea1=NULL, *bea2=NULL;
+ char buf[128];
+ size_t n;
+
+ event_base_start_iocp_(data->base, 0);
+ port = event_base_get_iocp_(data->base);
+ tt_assert(port);
+
+ bea1 = bufferevent_async_new_(data->base, data->pair[0],
+ BEV_OPT_DEFER_CALLBACKS);
+ bea2 = bufferevent_async_new_(data->base, data->pair[1],
+ BEV_OPT_DEFER_CALLBACKS);
+ tt_assert(bea1);
+ tt_assert(bea2);
+
+ bufferevent_setcb(bea2, async_readcb, NULL, NULL, NULL);
+ bufferevent_enable(bea1, EV_WRITE);
+ bufferevent_enable(bea2, EV_READ);
+
+ bufferevent_write(bea1, "Hello world", strlen("Hello world")+1);
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(got_readcb, ==, 1);
+ n = bufferevent_read(bea2, buf, sizeof(buf)-1);
+ buf[n]='\0';
+ tt_str_op(buf, ==, "Hello world");
+
+end:
+ bufferevent_free(bea1);
+ bufferevent_free(bea2);
+}
+
+
+struct testcase_t iocp_testcases[] = {
+ { "port", test_iocp_port, TT_FORK|TT_NEED_THREADS, &basic_setup, NULL },
+ { "evbuffer", test_iocp_evbuffer,
+ TT_FORK|TT_NEED_SOCKETPAIR|TT_NEED_THREADS,
+ &basic_setup, NULL },
+ { "bufferevent_async", test_iocp_bufferevent_async,
+ TT_FORK|TT_NEED_SOCKETPAIR|TT_NEED_THREADS|TT_NEED_BASE,
+ &basic_setup, NULL },
+ END_OF_TESTCASES
+};
diff --git a/protocols/Telegram/tgl/libevent/test/regress_iocp.obj b/protocols/Telegram/tgl/libevent/test/regress_iocp.obj
new file mode 100644
index 0000000000..5e2f0d2149
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_iocp.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/regress_listener.c b/protocols/Telegram/tgl/libevent/test/regress_listener.c
new file mode 100644
index 0000000000..4db102df68
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_listener.c
@@ -0,0 +1,214 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "util-internal.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+#include <sys/types.h>
+
+#ifndef _WIN32
+#include <sys/socket.h>
+#include <netinet/in.h>
+# ifdef _XOPEN_SOURCE_EXTENDED
+# include <arpa/inet.h>
+# endif
+#include <unistd.h>
+#endif
+
+#include <string.h>
+
+#include "event2/listener.h"
+#include "event2/event.h"
+#include "event2/util.h"
+
+#include "regress.h"
+#include "tinytest.h"
+#include "tinytest_macros.h"
+
+static void
+acceptcb(struct evconnlistener *listener, evutil_socket_t fd,
+ struct sockaddr *addr, int socklen, void *arg)
+{
+ int *ptr = arg;
+ --*ptr;
+ TT_BLATHER(("Got one for %p", ptr));
+ evutil_closesocket(fd);
+
+ if (! *ptr)
+ evconnlistener_disable(listener);
+}
+
+static void
+regress_pick_a_port(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+ struct evconnlistener *listener1 = NULL, *listener2 = NULL;
+ struct sockaddr_in sin;
+ int count1 = 2, count2 = 1;
+ struct sockaddr_storage ss1, ss2;
+ struct sockaddr_in *sin1, *sin2;
+ ev_socklen_t slen1 = sizeof(ss1), slen2 = sizeof(ss2);
+ unsigned int flags =
+ LEV_OPT_CLOSE_ON_FREE|LEV_OPT_REUSEABLE|LEV_OPT_CLOSE_ON_EXEC;
+
+ evutil_socket_t fd1 = -1, fd2 = -1, fd3 = -1;
+
+ if (data->setup_data && strstr((char*)data->setup_data, "ts")) {
+ flags |= LEV_OPT_THREADSAFE;
+ }
+
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_addr.s_addr = htonl(0x7f000001); /* 127.0.0.1 */
+ sin.sin_port = 0; /* "You pick!" */
+
+ listener1 = evconnlistener_new_bind(base, acceptcb, &count1,
+ flags, -1, (struct sockaddr *)&sin, sizeof(sin));
+ tt_assert(listener1);
+ listener2 = evconnlistener_new_bind(base, acceptcb, &count2,
+ flags, -1, (struct sockaddr *)&sin, sizeof(sin));
+ tt_assert(listener2);
+
+ tt_int_op(evconnlistener_get_fd(listener1), >=, 0);
+ tt_int_op(evconnlistener_get_fd(listener2), >=, 0);
+ tt_assert(getsockname(evconnlistener_get_fd(listener1),
+ (struct sockaddr*)&ss1, &slen1) == 0);
+ tt_assert(getsockname(evconnlistener_get_fd(listener2),
+ (struct sockaddr*)&ss2, &slen2) == 0);
+ tt_int_op(ss1.ss_family, ==, AF_INET);
+ tt_int_op(ss2.ss_family, ==, AF_INET);
+
+ sin1 = (struct sockaddr_in*)&ss1;
+ sin2 = (struct sockaddr_in*)&ss2;
+ tt_int_op(ntohl(sin1->sin_addr.s_addr), ==, 0x7f000001);
+ tt_int_op(ntohl(sin2->sin_addr.s_addr), ==, 0x7f000001);
+ tt_int_op(sin1->sin_port, !=, sin2->sin_port);
+
+ tt_ptr_op(evconnlistener_get_base(listener1), ==, base);
+ tt_ptr_op(evconnlistener_get_base(listener2), ==, base);
+
+ fd1 = fd2 = fd3 = -1;
+ evutil_socket_connect_(&fd1, (struct sockaddr*)&ss1, slen1);
+ evutil_socket_connect_(&fd2, (struct sockaddr*)&ss1, slen1);
+ evutil_socket_connect_(&fd3, (struct sockaddr*)&ss2, slen2);
+
+#ifdef _WIN32
+ Sleep(100); /* XXXX this is a stupid stopgap. */
+#endif
+ event_base_dispatch(base);
+
+ tt_int_op(count1, ==, 0);
+ tt_int_op(count2, ==, 0);
+
+end:
+ if (fd1>=0)
+ EVUTIL_CLOSESOCKET(fd1);
+ if (fd2>=0)
+ EVUTIL_CLOSESOCKET(fd2);
+ if (fd3>=0)
+ EVUTIL_CLOSESOCKET(fd3);
+ if (listener1)
+ evconnlistener_free(listener1);
+ if (listener2)
+ evconnlistener_free(listener2);
+}
+
+static void
+errorcb(struct evconnlistener *lis, void *data_)
+{
+ int *data = data_;
+ *data = 1000;
+ evconnlistener_disable(lis);
+}
+
+static void
+regress_listener_error(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+ struct evconnlistener *listener = NULL;
+ int count = 1;
+ unsigned int flags = LEV_OPT_CLOSE_ON_FREE|LEV_OPT_REUSEABLE;
+
+ if (data->setup_data && strstr((char*)data->setup_data, "ts")) {
+ flags |= LEV_OPT_THREADSAFE;
+ }
+
+ /* send, so that pair[0] will look 'readable'*/
+ tt_int_op(send(data->pair[1], "hello", 5, 0), >, 0);
+
+ /* Start a listener with a bogus socket. */
+ listener = evconnlistener_new(base, acceptcb, &count,
+ flags, 0,
+ data->pair[0]);
+ tt_assert(listener);
+
+ evconnlistener_set_error_cb(listener, errorcb);
+
+ tt_assert(listener);
+
+ event_base_dispatch(base);
+ tt_int_op(count,==,1000); /* set by error cb */
+
+end:
+ if (listener)
+ evconnlistener_free(listener);
+}
+
+struct testcase_t listener_testcases[] = {
+
+ { "randport", regress_pick_a_port, TT_FORK|TT_NEED_BASE,
+ &basic_setup, NULL},
+
+ { "randport_ts", regress_pick_a_port, TT_FORK|TT_NEED_BASE,
+ &basic_setup, (char*)"ts"},
+
+ { "error", regress_listener_error,
+ TT_FORK|TT_NEED_BASE|TT_NEED_SOCKETPAIR,
+ &basic_setup, NULL},
+
+ { "error_ts", regress_listener_error,
+ TT_FORK|TT_NEED_BASE|TT_NEED_SOCKETPAIR,
+ &basic_setup, (char*)"ts"},
+
+ END_OF_TESTCASES,
+};
+
+struct testcase_t listener_iocp_testcases[] = {
+ { "randport", regress_pick_a_port,
+ TT_FORK|TT_NEED_BASE|TT_ENABLE_IOCP,
+ &basic_setup, NULL},
+
+ { "error", regress_listener_error,
+ TT_FORK|TT_NEED_BASE|TT_NEED_SOCKETPAIR|TT_ENABLE_IOCP,
+ &basic_setup, NULL},
+
+ END_OF_TESTCASES,
+};
diff --git a/protocols/Telegram/tgl/libevent/test/regress_listener.obj b/protocols/Telegram/tgl/libevent/test/regress_listener.obj
new file mode 100644
index 0000000000..b05b290d36
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_listener.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/regress_main.c b/protocols/Telegram/tgl/libevent/test/regress_main.c
new file mode 100644
index 0000000000..6d045bb833
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_main.c
@@ -0,0 +1,468 @@
+/*
+ * Copyright (c) 2003-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "util-internal.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#include <io.h>
+#include <fcntl.h>
+#endif
+
+#if defined(__APPLE__) && defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
+#if (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1060 && \
+ __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
+#define FORK_BREAKS_GCOV
+#include <vproc.h>
+#endif
+#endif
+
+#include "event2/event-config.h"
+
+#ifdef EVENT____func__
+#define __func__ EVENT____func__
+#endif
+
+#if 0
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#include <signal.h>
+#include <errno.h>
+#endif
+
+#include <sys/types.h>
+#ifdef EVENT__HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+#ifndef _WIN32
+#include <sys/socket.h>
+#include <sys/wait.h>
+#include <signal.h>
+#include <unistd.h>
+#include <netdb.h>
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+#include "event2/util.h"
+#include "event2/event.h"
+#include "event2/event_compat.h"
+#include "event2/dns.h"
+#include "event2/dns_compat.h"
+#include "event2/thread.h"
+
+#include "event2/event-config.h"
+#include "regress.h"
+#include "tinytest.h"
+#include "tinytest_macros.h"
+#include "../iocp-internal.h"
+#include "../event-internal.h"
+
+struct evutil_weakrand_state test_weakrand_state;
+
+long
+timeval_msec_diff(const struct timeval *start, const struct timeval *end)
+{
+ long ms = end->tv_sec - start->tv_sec;
+ ms *= 1000;
+ ms += ((end->tv_usec - start->tv_usec)+500) / 1000;
+ return ms;
+}
+
+/* ============================================================ */
+/* Code to wrap up old legacy test cases that used setup() and cleanup().
+ *
+ * Not all of the tests designated "legacy" are ones that used setup() and
+ * cleanup(), of course. A test is legacy it it uses setup()/cleanup(), OR
+ * if it wants to find its event base/socketpair in global variables (ugh),
+ * OR if it wants to communicate success/failure through test_ok.
+ */
+
+/* This is set to true if we're inside a legacy test wrapper. It lets the
+ setup() and cleanup() functions in regress.c know they're not needed.
+ */
+int in_legacy_test_wrapper = 0;
+
+static void dnslogcb(int w, const char *m)
+{
+ TT_BLATHER(("%s", m));
+}
+
+/* creates a temporary file with the data in it. If *filename_out gets set,
+ * the caller should try to unlink it. */
+int
+regress_make_tmpfile(const void *data, size_t datalen, char **filename_out)
+{
+#ifndef _WIN32
+ char tmpfilename[32];
+ int fd;
+ *filename_out = NULL;
+ strcpy(tmpfilename, "/tmp/eventtmp.XXXXXX");
+#ifdef EVENT__HAVE_UMASK
+ umask(0077);
+#endif
+ fd = mkstemp(tmpfilename);
+ if (fd == -1)
+ return (-1);
+ if (write(fd, data, datalen) != (int)datalen) {
+ close(fd);
+ return (-1);
+ }
+ lseek(fd, 0, SEEK_SET);
+ /* remove it from the file system */
+ unlink(tmpfilename);
+ return (fd);
+#else
+ /* XXXX actually delete the file later */
+ char tmpfilepath[MAX_PATH];
+ char tmpfilename[MAX_PATH];
+ DWORD r, written;
+ int tries = 16;
+ HANDLE h;
+ r = GetTempPathA(MAX_PATH, tmpfilepath);
+ if (r > MAX_PATH || r == 0)
+ return (-1);
+ for (; tries > 0; --tries) {
+ r = GetTempFileNameA(tmpfilepath, "LIBEVENT", 0, tmpfilename);
+ if (r == 0)
+ return (-1);
+ h = CreateFileA(tmpfilename, GENERIC_READ|GENERIC_WRITE,
+ 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (h != INVALID_HANDLE_VALUE)
+ break;
+ }
+ if (tries == 0)
+ return (-1);
+ written = 0;
+ *filename_out = strdup(tmpfilename);
+ WriteFile(h, data, (DWORD)datalen, &written, NULL);
+ /* Closing the fd returned by this function will indeed close h. */
+ return _open_osfhandle((intptr_t)h,_O_RDONLY);
+#endif
+}
+
+#ifndef _WIN32
+pid_t
+regress_fork(void)
+{
+ pid_t pid = fork();
+#ifdef FORK_BREAKS_GCOV
+ vproc_transaction_begin(0);
+#endif
+ return pid;
+}
+#endif
+
+static void
+ignore_log_cb(int s, const char *msg)
+{
+}
+
+static void *
+basic_test_setup(const struct testcase_t *testcase)
+{
+ struct event_base *base = NULL;
+ evutil_socket_t spair[2] = { -1, -1 };
+ struct basic_test_data *data = NULL;
+
+#ifndef _WIN32
+ if (testcase->flags & TT_ENABLE_IOCP_FLAG)
+ return (void*)TT_SKIP;
+#endif
+
+ if (testcase->flags & TT_NEED_THREADS) {
+ if (!(testcase->flags & TT_FORK))
+ return NULL;
+#if defined(EVTHREAD_USE_PTHREADS_IMPLEMENTED)
+ if (evthread_use_pthreads())
+ exit(1);
+#elif defined(EVTHREAD_USE_WINDOWS_THREADS_IMPLEMENTED)
+ if (evthread_use_windows_threads())
+ exit(1);
+#else
+ return (void*)TT_SKIP;
+#endif
+ }
+
+ if (testcase->flags & TT_NEED_SOCKETPAIR) {
+ if (evutil_socketpair(AF_UNIX, SOCK_STREAM, 0, spair) == -1) {
+ fprintf(stderr, "%s: socketpair\n", __func__);
+ exit(1);
+ }
+
+ if (evutil_make_socket_nonblocking(spair[0]) == -1) {
+ fprintf(stderr, "fcntl(O_NONBLOCK)");
+ exit(1);
+ }
+
+ if (evutil_make_socket_nonblocking(spair[1]) == -1) {
+ fprintf(stderr, "fcntl(O_NONBLOCK)");
+ exit(1);
+ }
+ }
+ if (testcase->flags & TT_NEED_BASE) {
+ if (testcase->flags & TT_LEGACY)
+ base = event_init();
+ else
+ base = event_base_new();
+ if (!base)
+ exit(1);
+ }
+ if (testcase->flags & TT_ENABLE_IOCP_FLAG) {
+ if (event_base_start_iocp_(base, 0)<0) {
+ event_base_free(base);
+ return (void*)TT_SKIP;
+ }
+ }
+
+ if (testcase->flags & TT_NEED_DNS) {
+ evdns_set_log_fn(dnslogcb);
+ if (evdns_init())
+ return NULL; /* fast failure */ /*XXX asserts. */
+ }
+
+ if (testcase->flags & TT_NO_LOGS)
+ event_set_log_callback(ignore_log_cb);
+
+ data = calloc(1, sizeof(*data));
+ if (!data)
+ exit(1);
+ data->base = base;
+ data->pair[0] = spair[0];
+ data->pair[1] = spair[1];
+ data->setup_data = testcase->setup_data;
+ return data;
+}
+
+static int
+basic_test_cleanup(const struct testcase_t *testcase, void *ptr)
+{
+ struct basic_test_data *data = ptr;
+
+ if (testcase->flags & TT_NO_LOGS)
+ event_set_log_callback(NULL);
+
+ if (testcase->flags & TT_NEED_SOCKETPAIR) {
+ if (data->pair[0] != -1)
+ evutil_closesocket(data->pair[0]);
+ if (data->pair[1] != -1)
+ evutil_closesocket(data->pair[1]);
+ }
+
+ if (testcase->flags & TT_NEED_DNS) {
+ evdns_shutdown(0);
+ }
+
+ if (testcase->flags & TT_NEED_BASE) {
+ if (data->base) {
+ event_base_assert_ok_(data->base);
+ event_base_free(data->base);
+ }
+ }
+
+ if (testcase->flags & TT_FORK)
+ libevent_global_shutdown();
+
+ free(data);
+
+ return 1;
+}
+
+const struct testcase_setup_t basic_setup = {
+ basic_test_setup, basic_test_cleanup
+};
+
+/* The "data" for a legacy test is just a pointer to the void fn(void)
+ function implementing the test case. We need to set up some globals,
+ though, since that's where legacy tests expect to find a socketpair
+ (sometimes) and a global event_base (sometimes).
+ */
+static void *
+legacy_test_setup(const struct testcase_t *testcase)
+{
+ struct basic_test_data *data = basic_test_setup(testcase);
+ if (data == (void*)TT_SKIP || data == NULL)
+ return data;
+ global_base = data->base;
+ pair[0] = data->pair[0];
+ pair[1] = data->pair[1];
+ data->legacy_test_fn = testcase->setup_data;
+ return data;
+}
+
+/* This function is the implementation of every legacy test case. It
+ sets test_ok to 0, invokes the test function, and tells tinytest that
+ the test failed if the test didn't set test_ok to 1.
+ */
+void
+run_legacy_test_fn(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ test_ok = called = 0;
+
+ in_legacy_test_wrapper = 1;
+ data->legacy_test_fn(); /* This part actually calls the test */
+ in_legacy_test_wrapper = 0;
+
+ if (!test_ok)
+ tt_abort_msg("Legacy unit test failed");
+
+end:
+ test_ok = 0;
+}
+
+/* This function doesn't have to clean up ptr (which is just a pointer
+ to the test function), but it may need to close the socketpair or
+ free the event_base.
+ */
+static int
+legacy_test_cleanup(const struct testcase_t *testcase, void *ptr)
+{
+ int r = basic_test_cleanup(testcase, ptr);
+ pair[0] = pair[1] = -1;
+ global_base = NULL;
+ return r;
+}
+
+const struct testcase_setup_t legacy_setup = {
+ legacy_test_setup, legacy_test_cleanup
+};
+
+/* ============================================================ */
+
+#if (!defined(EVENT__HAVE_PTHREADS) && !defined(_WIN32)) || defined(EVENT__DISABLE_THREAD_SUPPORT)
+struct testcase_t thread_testcases[] = {
+ { "basic", NULL, TT_SKIP, NULL, NULL },
+ END_OF_TESTCASES
+};
+#endif
+
+struct testgroup_t testgroups[] = {
+ { "main/", main_testcases },
+ { "heap/", minheap_testcases },
+ { "et/", edgetriggered_testcases },
+ { "finalize/", finalize_testcases },
+ { "evbuffer/", evbuffer_testcases },
+ { "signal/", signal_testcases },
+ { "util/", util_testcases },
+ { "bufferevent/", bufferevent_testcases },
+ { "http/", http_testcases },
+ { "dns/", dns_testcases },
+ { "evtag/", evtag_testcases },
+ { "rpc/", rpc_testcases },
+ { "thread/", thread_testcases },
+ { "listener/", listener_testcases },
+#ifdef _WIN32
+ { "iocp/", iocp_testcases },
+ { "iocp/bufferevent/", bufferevent_iocp_testcases },
+ { "iocp/listener/", listener_iocp_testcases },
+#endif
+#ifdef EVENT__HAVE_OPENSSL
+ { "ssl/", ssl_testcases },
+#endif
+ END_OF_GROUPS
+};
+
+const char *alltests[] = { "+..", NULL };
+const char *livenettests[] = {
+ "+util/getaddrinfo_live",
+ "+dns/gethostby..",
+ "+dns/resolve_reverse",
+ NULL
+};
+const char *finetimetests[] = {
+ "+util/monotonic_res_precise",
+ "+util/monotonic_res_fallback",
+ "+thread/deferred_cb_skew",
+ "+http/connection_retry",
+ "+http/https_connection_retry",
+ NULL
+};
+struct testlist_alias_t testaliases[] = {
+ { "all", alltests },
+ { "live_net", livenettests },
+ { "fine_timing", finetimetests },
+ END_OF_ALIASES
+};
+
+int libevent_tests_running_in_debug_mode = 0;
+
+int
+main(int argc, const char **argv)
+{
+#ifdef _WIN32
+ WORD wVersionRequested;
+ WSADATA wsaData;
+
+ wVersionRequested = MAKEWORD(2, 2);
+
+ (void) WSAStartup(wVersionRequested, &wsaData);
+#endif
+
+#ifndef _WIN32
+ if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
+ return 1;
+#endif
+
+#ifdef _WIN32
+ tinytest_skip(testgroups, "http/connection_retry");
+ tinytest_skip(testgroups, "http/https_connection_retry");
+#endif
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ if (!getenv("EVENT_NO_DEBUG_LOCKS"))
+ evthread_enable_lock_debugging();
+#endif
+
+ if (getenv("EVENT_DEBUG_MODE")) {
+ event_enable_debug_mode();
+ libevent_tests_running_in_debug_mode = 1;
+ }
+ if (getenv("EVENT_DEBUG_LOGGING_ALL")) {
+ event_enable_debug_logging(EVENT_DBG_ALL);
+ }
+
+ tinytest_set_aliases(testaliases);
+
+ evutil_weakrand_seed_(&test_weakrand_state, 0);
+
+ if (tinytest_main(argc,argv,testgroups))
+ return 1;
+
+ libevent_global_shutdown();
+
+ return 0;
+}
+
diff --git a/protocols/Telegram/tgl/libevent/test/regress_main.obj b/protocols/Telegram/tgl/libevent/test/regress_main.obj
new file mode 100644
index 0000000000..27aaa4eb28
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_main.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/regress_minheap.c b/protocols/Telegram/tgl/libevent/test/regress_minheap.c
new file mode 100644
index 0000000000..05db32e26f
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_minheap.c
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "../minheap-internal.h"
+
+#include <stdlib.h>
+#include "event2/event_struct.h"
+
+#include "tinytest.h"
+#include "tinytest_macros.h"
+#include "regress.h"
+
+static void
+set_random_timeout(struct event *ev)
+{
+ ev->ev_timeout.tv_sec = test_weakrand();
+ ev->ev_timeout.tv_usec = test_weakrand() & 0xfffff;
+ ev->ev_timeout_pos.min_heap_idx = -1;
+}
+
+static void
+check_heap(struct min_heap *heap)
+{
+ unsigned i;
+ for (i = 1; i < heap->n; ++i) {
+ unsigned parent_idx = (i-1)/2;
+ tt_want(evutil_timercmp(&heap->p[i]->ev_timeout,
+ &heap->p[parent_idx]->ev_timeout, >=));
+ }
+}
+
+static void
+test_heap_randomized(void *ptr)
+{
+ struct min_heap heap;
+ struct event *inserted[1024];
+ struct event *e, *last_e;
+ int i;
+
+ min_heap_ctor_(&heap);
+
+ for (i = 0; i < 1024; ++i) {
+ inserted[i] = malloc(sizeof(struct event));
+ set_random_timeout(inserted[i]);
+ min_heap_push_(&heap, inserted[i]);
+ }
+ check_heap(&heap);
+
+ tt_assert(min_heap_size_(&heap) == 1024);
+
+ for (i = 0; i < 512; ++i) {
+ min_heap_erase_(&heap, inserted[i]);
+ if (0 == (i % 32))
+ check_heap(&heap);
+ }
+ tt_assert(min_heap_size_(&heap) == 512);
+
+ last_e = min_heap_pop_(&heap);
+ while (1) {
+ e = min_heap_pop_(&heap);
+ if (!e)
+ break;
+ tt_want(evutil_timercmp(&last_e->ev_timeout,
+ &e->ev_timeout, <=));
+ }
+ tt_assert(min_heap_size_(&heap) == 0);
+end:
+ for (i = 0; i < 1024; ++i)
+ free(inserted[i]);
+
+ min_heap_dtor_(&heap);
+}
+
+struct testcase_t minheap_testcases[] = {
+ { "randomized", test_heap_randomized, 0, NULL, NULL },
+ END_OF_TESTCASES
+};
diff --git a/protocols/Telegram/tgl/libevent/test/regress_minheap.obj b/protocols/Telegram/tgl/libevent/test/regress_minheap.obj
new file mode 100644
index 0000000000..0ab530f4fa
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_minheap.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/regress_rpc.c b/protocols/Telegram/tgl/libevent/test/regress_rpc.c
new file mode 100644
index 0000000000..01a058cbb2
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_rpc.c
@@ -0,0 +1,905 @@
+/*
+ * Copyright (c) 2003-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* The old tests here need assertions to work. */
+#undef NDEBUG
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+#include "event2/event-config.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#ifndef _WIN32
+#include <sys/socket.h>
+#include <signal.h>
+#include <unistd.h>
+#include <netdb.h>
+#endif
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <assert.h>
+
+#include "event2/buffer.h"
+#include "event2/event.h"
+#include "event2/event_compat.h"
+#include "event2/http.h"
+#include "event2/http_compat.h"
+#include "event2/http_struct.h"
+#include "event2/rpc.h"
+#include "event2/rpc.h"
+#include "event2/rpc_struct.h"
+#include "event2/tag.h"
+#include "log-internal.h"
+
+#include "regress.gen.h"
+
+#include "regress.h"
+#include "regress_testutils.h"
+
+#ifndef NO_PYTHON_EXISTS
+
+static struct evhttp *
+http_setup(ev_uint16_t *pport)
+{
+ struct evhttp *myhttp;
+ ev_uint16_t port;
+ struct evhttp_bound_socket *sock;
+
+ myhttp = evhttp_new(NULL);
+ if (!myhttp)
+ event_errx(1, "Could not start web server");
+
+ /* Try a few different ports */
+ sock = evhttp_bind_socket_with_handle(myhttp, "127.0.0.1", 0);
+ if (!sock)
+ event_errx(1, "Couldn't open web port");
+
+ port = regress_get_socket_port(evhttp_bound_socket_get_fd(sock));
+
+ *pport = port;
+ return (myhttp);
+}
+
+EVRPC_HEADER(Message, msg, kill)
+EVRPC_HEADER(NeverReply, msg, kill)
+
+EVRPC_GENERATE(Message, msg, kill)
+EVRPC_GENERATE(NeverReply, msg, kill)
+
+static int need_input_hook = 0;
+static int need_output_hook = 0;
+
+static void
+MessageCb(EVRPC_STRUCT(Message)* rpc, void *arg)
+{
+ struct kill* kill_reply = rpc->reply;
+
+ if (need_input_hook) {
+ struct evhttp_request* req = EVRPC_REQUEST_HTTP(rpc);
+ const char *header = evhttp_find_header(
+ req->input_headers, "X-Hook");
+ assert(header);
+ assert(strcmp(header, "input") == 0);
+ }
+
+ /* we just want to fill in some non-sense */
+ EVTAG_ASSIGN(kill_reply, weapon, "dagger");
+ EVTAG_ASSIGN(kill_reply, action, "wave around like an idiot");
+
+ /* no reply to the RPC */
+ EVRPC_REQUEST_DONE(rpc);
+}
+
+static EVRPC_STRUCT(NeverReply) *saved_rpc;
+
+static void
+NeverReplyCb(EVRPC_STRUCT(NeverReply)* rpc, void *arg)
+{
+ test_ok += 1;
+ saved_rpc = rpc;
+}
+
+static void
+rpc_setup(struct evhttp **phttp, ev_uint16_t *pport, struct evrpc_base **pbase)
+{
+ ev_uint16_t port;
+ struct evhttp *http = NULL;
+ struct evrpc_base *base = NULL;
+
+ http = http_setup(&port);
+ base = evrpc_init(http);
+
+ EVRPC_REGISTER(base, Message, msg, kill, MessageCb, NULL);
+ EVRPC_REGISTER(base, NeverReply, msg, kill, NeverReplyCb, NULL);
+
+ *phttp = http;
+ *pport = port;
+ *pbase = base;
+
+ need_input_hook = 0;
+ need_output_hook = 0;
+}
+
+static void
+rpc_teardown(struct evrpc_base *base)
+{
+ assert(EVRPC_UNREGISTER(base, Message) == 0);
+ assert(EVRPC_UNREGISTER(base, NeverReply) == 0);
+
+ evrpc_free(base);
+}
+
+static void
+rpc_postrequest_failure(struct evhttp_request *req, void *arg)
+{
+ if (req->response_code != HTTP_SERVUNAVAIL) {
+
+ fprintf(stderr, "FAILED (response code)\n");
+ exit(1);
+ }
+
+ test_ok = 1;
+ event_loopexit(NULL);
+}
+
+/*
+ * Test a malformed payload submitted as an RPC
+ */
+
+static void
+rpc_basic_test(void)
+{
+ ev_uint16_t port;
+ struct evhttp *http = NULL;
+ struct evrpc_base *base = NULL;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+
+ rpc_setup(&http, &port, &base);
+
+ evcon = evhttp_connection_new("127.0.0.1", port);
+ tt_assert(evcon);
+
+ /*
+ * At this point, we want to schedule an HTTP POST request
+ * server using our make request method.
+ */
+
+ req = evhttp_request_new(rpc_postrequest_failure, NULL);
+ tt_assert(req);
+
+ /* Add the information that we care about */
+ evhttp_add_header(req->output_headers, "Host", "somehost");
+ evbuffer_add_printf(req->output_buffer, "Some Nonsense");
+
+ if (evhttp_make_request(evcon, req,
+ EVHTTP_REQ_POST,
+ "/.rpc.Message") == -1) {
+ tt_abort();
+ }
+
+ test_ok = 0;
+
+ event_dispatch();
+
+ evhttp_connection_free(evcon);
+
+ rpc_teardown(base);
+
+ tt_assert(test_ok == 1);
+
+end:
+ evhttp_free(http);
+}
+
+static void
+rpc_postrequest_done(struct evhttp_request *req, void *arg)
+{
+ struct kill* kill_reply = NULL;
+
+ if (req->response_code != HTTP_OK) {
+ fprintf(stderr, "FAILED (response code)\n");
+ exit(1);
+ }
+
+ kill_reply = kill_new();
+
+ if ((kill_unmarshal(kill_reply, req->input_buffer)) == -1) {
+ fprintf(stderr, "FAILED (unmarshal)\n");
+ exit(1);
+ }
+
+ kill_free(kill_reply);
+
+ test_ok = 1;
+ event_loopexit(NULL);
+}
+
+static void
+rpc_basic_message(void)
+{
+ ev_uint16_t port;
+ struct evhttp *http = NULL;
+ struct evrpc_base *base = NULL;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+ struct msg *msg;
+
+ rpc_setup(&http, &port, &base);
+
+ evcon = evhttp_connection_new("127.0.0.1", port);
+ tt_assert(evcon);
+
+ /*
+ * At this point, we want to schedule an HTTP POST request
+ * server using our make request method.
+ */
+
+ req = evhttp_request_new(rpc_postrequest_done, NULL);
+ if (req == NULL) {
+ fprintf(stdout, "FAILED\n");
+ exit(1);
+ }
+
+ /* Add the information that we care about */
+ evhttp_add_header(req->output_headers, "Host", "somehost");
+
+ /* set up the basic message */
+ msg = msg_new();
+ EVTAG_ASSIGN(msg, from_name, "niels");
+ EVTAG_ASSIGN(msg, to_name, "tester");
+ msg_marshal(req->output_buffer, msg);
+ msg_free(msg);
+
+ if (evhttp_make_request(evcon, req,
+ EVHTTP_REQ_POST,
+ "/.rpc.Message") == -1) {
+ fprintf(stdout, "FAILED\n");
+ exit(1);
+ }
+
+ test_ok = 0;
+
+ event_dispatch();
+
+ evhttp_connection_free(evcon);
+
+ rpc_teardown(base);
+
+end:
+ evhttp_free(http);
+}
+
+static struct evrpc_pool *
+rpc_pool_with_connection(ev_uint16_t port)
+{
+ struct evhttp_connection *evcon;
+ struct evrpc_pool *pool;
+
+ pool = evrpc_pool_new(NULL);
+ assert(pool != NULL);
+
+ evcon = evhttp_connection_new("127.0.0.1", port);
+ assert(evcon != NULL);
+
+ evrpc_pool_add_connection(pool, evcon);
+
+ return (pool);
+}
+
+static void
+GotKillCb(struct evrpc_status *status,
+ struct msg *msg, struct kill *kill, void *arg)
+{
+ char *weapon;
+ char *action;
+
+ if (need_output_hook) {
+ struct evhttp_request *req = status->http_req;
+ const char *header = evhttp_find_header(
+ req->input_headers, "X-Pool-Hook");
+ assert(header);
+ assert(strcmp(header, "ran") == 0);
+ }
+
+ if (status->error != EVRPC_STATUS_ERR_NONE)
+ goto done;
+
+ if (EVTAG_GET(kill, weapon, &weapon) == -1) {
+ fprintf(stderr, "get weapon\n");
+ goto done;
+ }
+ if (EVTAG_GET(kill, action, &action) == -1) {
+ fprintf(stderr, "get action\n");
+ goto done;
+ }
+
+ if (strcmp(weapon, "dagger"))
+ goto done;
+
+ if (strcmp(action, "wave around like an idiot"))
+ goto done;
+
+ test_ok += 1;
+
+done:
+ event_loopexit(NULL);
+}
+
+static void
+GotKillCbTwo(struct evrpc_status *status,
+ struct msg *msg, struct kill *kill, void *arg)
+{
+ char *weapon;
+ char *action;
+
+ if (status->error != EVRPC_STATUS_ERR_NONE)
+ goto done;
+
+ if (EVTAG_GET(kill, weapon, &weapon) == -1) {
+ fprintf(stderr, "get weapon\n");
+ goto done;
+ }
+ if (EVTAG_GET(kill, action, &action) == -1) {
+ fprintf(stderr, "get action\n");
+ goto done;
+ }
+
+ if (strcmp(weapon, "dagger"))
+ goto done;
+
+ if (strcmp(action, "wave around like an idiot"))
+ goto done;
+
+ test_ok += 1;
+
+done:
+ if (test_ok == 2)
+ event_loopexit(NULL);
+}
+
+static int
+rpc_hook_add_header(void *ctx, struct evhttp_request *req,
+ struct evbuffer *evbuf, void *arg)
+{
+ const char *hook_type = arg;
+ if (strcmp("input", hook_type) == 0)
+ evhttp_add_header(req->input_headers, "X-Hook", hook_type);
+ else
+ evhttp_add_header(req->output_headers, "X-Hook", hook_type);
+
+ assert(evrpc_hook_get_connection(ctx) != NULL);
+
+ return (EVRPC_CONTINUE);
+}
+
+static int
+rpc_hook_add_meta(void *ctx, struct evhttp_request *req,
+ struct evbuffer *evbuf, void *arg)
+{
+ evrpc_hook_add_meta(ctx, "meta", "test", 5);
+
+ assert(evrpc_hook_get_connection(ctx) != NULL);
+
+ return (EVRPC_CONTINUE);
+}
+
+static int
+rpc_hook_remove_header(void *ctx, struct evhttp_request *req,
+ struct evbuffer *evbuf, void *arg)
+{
+ const char *header = evhttp_find_header(req->input_headers, "X-Hook");
+ void *data = NULL;
+ size_t data_len = 0;
+
+ assert(header != NULL);
+ assert(strcmp(header, arg) == 0);
+
+ evhttp_remove_header(req->input_headers, "X-Hook");
+ evhttp_add_header(req->input_headers, "X-Pool-Hook", "ran");
+
+ assert(evrpc_hook_find_meta(ctx, "meta", &data, &data_len) == 0);
+ assert(data != NULL);
+ assert(data_len == 5);
+
+ assert(evrpc_hook_get_connection(ctx) != NULL);
+
+ return (EVRPC_CONTINUE);
+}
+
+static void
+rpc_basic_client(void)
+{
+ ev_uint16_t port;
+ struct evhttp *http = NULL;
+ struct evrpc_base *base = NULL;
+ struct evrpc_pool *pool = NULL;
+ struct msg *msg = NULL;
+ struct kill *kill = NULL;
+
+ rpc_setup(&http, &port, &base);
+
+ need_input_hook = 1;
+ need_output_hook = 1;
+
+ assert(evrpc_add_hook(base, EVRPC_INPUT, rpc_hook_add_header, (void*)"input")
+ != NULL);
+ assert(evrpc_add_hook(base, EVRPC_OUTPUT, rpc_hook_add_header, (void*)"output")
+ != NULL);
+
+ pool = rpc_pool_with_connection(port);
+ tt_assert(pool);
+
+ assert(evrpc_add_hook(pool, EVRPC_OUTPUT, rpc_hook_add_meta, NULL));
+ assert(evrpc_add_hook(pool, EVRPC_INPUT, rpc_hook_remove_header, (void*)"output"));
+
+ /* set up the basic message */
+ msg = msg_new();
+ tt_assert(msg);
+ EVTAG_ASSIGN(msg, from_name, "niels");
+ EVTAG_ASSIGN(msg, to_name, "tester");
+
+ kill = kill_new();
+
+ EVRPC_MAKE_REQUEST(Message, pool, msg, kill, GotKillCb, NULL);
+
+ test_ok = 0;
+
+ event_dispatch();
+
+ tt_assert(test_ok == 1);
+
+ /* we do it twice to make sure that reuse works correctly */
+ kill_clear(kill);
+
+ EVRPC_MAKE_REQUEST(Message, pool, msg, kill, GotKillCb, NULL);
+
+ event_dispatch();
+
+ tt_assert(test_ok == 2);
+
+ /* we do it trice to make sure other stuff works, too */
+ kill_clear(kill);
+
+ {
+ struct evrpc_request_wrapper *ctx =
+ EVRPC_MAKE_CTX(Message, msg, kill,
+ pool, msg, kill, GotKillCb, NULL);
+ evrpc_make_request(ctx);
+ }
+
+ event_dispatch();
+
+ rpc_teardown(base);
+
+ tt_assert(test_ok == 3);
+
+end:
+ if (msg)
+ msg_free(msg);
+ if (kill)
+ kill_free(kill);
+
+ if (pool)
+ evrpc_pool_free(pool);
+ if (http)
+ evhttp_free(http);
+
+ need_input_hook = 0;
+ need_output_hook = 0;
+}
+
+/*
+ * We are testing that the second requests gets send over the same
+ * connection after the first RPCs completes.
+ */
+static void
+rpc_basic_queued_client(void)
+{
+ ev_uint16_t port;
+ struct evhttp *http = NULL;
+ struct evrpc_base *base = NULL;
+ struct evrpc_pool *pool = NULL;
+ struct msg *msg=NULL;
+ struct kill *kill_one=NULL, *kill_two=NULL;
+
+ rpc_setup(&http, &port, &base);
+
+ pool = rpc_pool_with_connection(port);
+ tt_assert(pool);
+
+ /* set up the basic message */
+ msg = msg_new();
+ tt_assert(msg);
+ EVTAG_ASSIGN(msg, from_name, "niels");
+ EVTAG_ASSIGN(msg, to_name, "tester");
+
+ kill_one = kill_new();
+ kill_two = kill_new();
+
+ EVRPC_MAKE_REQUEST(Message, pool, msg, kill_one, GotKillCbTwo, NULL);
+ EVRPC_MAKE_REQUEST(Message, pool, msg, kill_two, GotKillCb, NULL);
+
+ test_ok = 0;
+
+ event_dispatch();
+
+ rpc_teardown(base);
+
+ tt_assert(test_ok == 2);
+
+end:
+ if (msg)
+ msg_free(msg);
+ if (kill_one)
+ kill_free(kill_one);
+ if (kill_two)
+ kill_free(kill_two);
+
+ if (pool)
+ evrpc_pool_free(pool);
+ if (http)
+ evhttp_free(http);
+}
+
+static void
+GotErrorCb(struct evrpc_status *status,
+ struct msg *msg, struct kill *kill, void *arg)
+{
+ if (status->error != EVRPC_STATUS_ERR_TIMEOUT)
+ goto done;
+
+ /* should never be complete but just to check */
+ if (kill_complete(kill) == 0)
+ goto done;
+
+ test_ok += 1;
+
+done:
+ event_loopexit(NULL);
+}
+
+/* we just pause the rpc and continue it in the next callback */
+
+struct rpc_hook_ctx_ {
+ void *vbase;
+ void *ctx;
+};
+
+static int hook_pause_cb_called=0;
+
+static void
+rpc_hook_pause_cb(evutil_socket_t fd, short what, void *arg)
+{
+ struct rpc_hook_ctx_ *ctx = arg;
+ ++hook_pause_cb_called;
+ evrpc_resume_request(ctx->vbase, ctx->ctx, EVRPC_CONTINUE);
+ free(arg);
+}
+
+static int
+rpc_hook_pause(void *ctx, struct evhttp_request *req, struct evbuffer *evbuf,
+ void *arg)
+{
+ struct rpc_hook_ctx_ *tmp = malloc(sizeof(*tmp));
+ struct timeval tv;
+
+ assert(tmp != NULL);
+ tmp->vbase = arg;
+ tmp->ctx = ctx;
+
+ memset(&tv, 0, sizeof(tv));
+ event_once(-1, EV_TIMEOUT, rpc_hook_pause_cb, tmp, &tv);
+ return EVRPC_PAUSE;
+}
+
+static void
+rpc_basic_client_with_pause(void)
+{
+ ev_uint16_t port;
+ struct evhttp *http = NULL;
+ struct evrpc_base *base = NULL;
+ struct evrpc_pool *pool = NULL;
+ struct msg *msg = NULL;
+ struct kill *kill= NULL;
+
+ rpc_setup(&http, &port, &base);
+
+ assert(evrpc_add_hook(base, EVRPC_INPUT, rpc_hook_pause, base));
+ assert(evrpc_add_hook(base, EVRPC_OUTPUT, rpc_hook_pause, base));
+
+ pool = rpc_pool_with_connection(port);
+ tt_assert(pool);
+ assert(evrpc_add_hook(pool, EVRPC_INPUT, rpc_hook_pause, pool));
+ assert(evrpc_add_hook(pool, EVRPC_OUTPUT, rpc_hook_pause, pool));
+
+ /* set up the basic message */
+ msg = msg_new();
+ tt_assert(msg);
+ EVTAG_ASSIGN(msg, from_name, "niels");
+ EVTAG_ASSIGN(msg, to_name, "tester");
+
+ kill = kill_new();
+
+ EVRPC_MAKE_REQUEST(Message, pool, msg, kill, GotKillCb, NULL);
+
+ test_ok = 0;
+
+ event_dispatch();
+
+ tt_int_op(test_ok, ==, 1);
+ tt_int_op(hook_pause_cb_called, ==, 4);
+
+end:
+ if (base)
+ rpc_teardown(base);
+
+ if (msg)
+ msg_free(msg);
+ if (kill)
+ kill_free(kill);
+
+ if (pool)
+ evrpc_pool_free(pool);
+ if (http)
+ evhttp_free(http);
+}
+
+static void
+rpc_client_timeout(void)
+{
+ ev_uint16_t port;
+ struct evhttp *http = NULL;
+ struct evrpc_base *base = NULL;
+ struct evrpc_pool *pool = NULL;
+ struct msg *msg = NULL;
+ struct kill *kill = NULL;
+
+ rpc_setup(&http, &port, &base);
+
+ pool = rpc_pool_with_connection(port);
+ tt_assert(pool);
+
+ /* set the timeout to 1 second. */
+ evrpc_pool_set_timeout(pool, 1);
+
+ /* set up the basic message */
+ msg = msg_new();
+ tt_assert(msg);
+ EVTAG_ASSIGN(msg, from_name, "niels");
+ EVTAG_ASSIGN(msg, to_name, "tester");
+
+ kill = kill_new();
+
+ EVRPC_MAKE_REQUEST(NeverReply, pool, msg, kill, GotErrorCb, NULL);
+
+ test_ok = 0;
+
+ event_dispatch();
+
+ /* free the saved RPC structure up */
+ EVRPC_REQUEST_DONE(saved_rpc);
+
+ rpc_teardown(base);
+
+ tt_assert(test_ok == 2);
+
+end:
+ if (msg)
+ msg_free(msg);
+ if (kill)
+ kill_free(kill);
+
+ if (pool)
+ evrpc_pool_free(pool);
+ if (http)
+ evhttp_free(http);
+}
+
+static void
+rpc_test(void)
+{
+ struct msg *msg = NULL, *msg2 = NULL;
+ struct kill *attack = NULL;
+ struct run *run = NULL;
+ struct evbuffer *tmp = evbuffer_new();
+ struct timeval tv_start, tv_end;
+ ev_uint32_t tag;
+ int i;
+
+ msg = msg_new();
+
+ tt_assert(msg);
+
+ EVTAG_ASSIGN(msg, from_name, "niels");
+ EVTAG_ASSIGN(msg, to_name, "phoenix");
+
+ if (EVTAG_GET(msg, attack, &attack) == -1) {
+ tt_abort_msg("Failed to set kill message.");
+ }
+
+ EVTAG_ASSIGN(attack, weapon, "feather");
+ EVTAG_ASSIGN(attack, action, "tickle");
+ for (i = 0; i < 3; ++i) {
+ if (EVTAG_ARRAY_ADD_VALUE(attack, how_often, i) == NULL) {
+ tt_abort_msg("Failed to add how_often.");
+ }
+ }
+
+ evutil_gettimeofday(&tv_start, NULL);
+ for (i = 0; i < 1000; ++i) {
+ run = EVTAG_ARRAY_ADD(msg, run);
+ if (run == NULL) {
+ tt_abort_msg("Failed to add run message.");
+ }
+ EVTAG_ASSIGN(run, how, "very fast but with some data in it");
+ EVTAG_ASSIGN(run, fixed_bytes,
+ (ev_uint8_t*)"012345678901234567890123");
+
+ if (EVTAG_ARRAY_ADD_VALUE(
+ run, notes, "this is my note") == NULL) {
+ tt_abort_msg("Failed to add note.");
+ }
+ if (EVTAG_ARRAY_ADD_VALUE(run, notes, "pps") == NULL) {
+ tt_abort_msg("Failed to add note");
+ }
+
+ EVTAG_ASSIGN(run, large_number, 0xdead0a0bcafebeefLL);
+ EVTAG_ARRAY_ADD_VALUE(run, other_numbers, 0xdead0a0b);
+ EVTAG_ARRAY_ADD_VALUE(run, other_numbers, 0xbeefcafe);
+ }
+
+ if (msg_complete(msg) == -1)
+ tt_abort_msg("Failed to make complete message.");
+
+ evtag_marshal_msg(tmp, 0xdeaf, msg);
+
+ if (evtag_peek(tmp, &tag) == -1)
+ tt_abort_msg("Failed to peak tag.");
+
+ if (tag != 0xdeaf)
+ TT_DIE(("Got incorrect tag: %0x.", (unsigned)tag));
+
+ msg2 = msg_new();
+ if (evtag_unmarshal_msg(tmp, 0xdeaf, msg2) == -1)
+ tt_abort_msg("Failed to unmarshal message.");
+
+ evutil_gettimeofday(&tv_end, NULL);
+ evutil_timersub(&tv_end, &tv_start, &tv_end);
+ TT_BLATHER(("(%.1f us/add) ",
+ (float)tv_end.tv_sec/(float)i * 1000000.0 +
+ tv_end.tv_usec / (float)i));
+
+ if (!EVTAG_HAS(msg2, from_name) ||
+ !EVTAG_HAS(msg2, to_name) ||
+ !EVTAG_HAS(msg2, attack)) {
+ tt_abort_msg("Missing data structures.");
+ }
+
+ if (EVTAG_GET(msg2, attack, &attack) == -1) {
+ tt_abort_msg("Could not get attack.");
+ }
+
+ if (EVTAG_ARRAY_LEN(msg2, run) != i) {
+ tt_abort_msg("Wrong number of run messages.");
+ }
+
+ /* get the very first run message */
+ if (EVTAG_ARRAY_GET(msg2, run, 0, &run) == -1) {
+ tt_abort_msg("Failed to get run msg.");
+ } else {
+ /* verify the notes */
+ char *note_one, *note_two;
+ ev_uint64_t large_number;
+ ev_uint32_t short_number;
+
+ if (EVTAG_ARRAY_LEN(run, notes) != 2) {
+ tt_abort_msg("Wrong number of note strings.");
+ }
+
+ if (EVTAG_ARRAY_GET(run, notes, 0, &note_one) == -1 ||
+ EVTAG_ARRAY_GET(run, notes, 1, &note_two) == -1) {
+ tt_abort_msg("Could not get note strings.");
+ }
+
+ if (strcmp(note_one, "this is my note") ||
+ strcmp(note_two, "pps")) {
+ tt_abort_msg("Incorrect note strings encoded.");
+ }
+
+ if (EVTAG_GET(run, large_number, &large_number) == -1 ||
+ large_number != 0xdead0a0bcafebeefLL) {
+ tt_abort_msg("Incorrrect large_number.");
+ }
+
+ if (EVTAG_ARRAY_LEN(run, other_numbers) != 2) {
+ tt_abort_msg("Wrong number of other_numbers.");
+ }
+
+ if (EVTAG_ARRAY_GET(
+ run, other_numbers, 0, &short_number) == -1) {
+ tt_abort_msg("Could not get short number.");
+ }
+ tt_uint_op(short_number, ==, 0xdead0a0b);
+
+ }
+ tt_int_op(EVTAG_ARRAY_LEN(attack, how_often), ==, 3);
+
+ for (i = 0; i < 3; ++i) {
+ ev_uint32_t res;
+ if (EVTAG_ARRAY_GET(attack, how_often, i, &res) == -1) {
+ TT_DIE(("Cannot get %dth how_often msg.", i));
+ }
+ if ((int)res != i) {
+ TT_DIE(("Wrong message encoded %d != %d", i, res));
+ }
+ }
+
+ test_ok = 1;
+end:
+ if (msg)
+ msg_free(msg);
+ if (msg2)
+ msg_free(msg2);
+ if (tmp)
+ evbuffer_free(tmp);
+}
+
+#define RPC_LEGACY(name) \
+ { #name, run_legacy_test_fn, TT_FORK|TT_NEED_BASE|TT_LEGACY, \
+ &legacy_setup, \
+ rpc_##name }
+#else
+/* NO_PYTHON_EXISTS */
+
+#define RPC_LEGACY(name) \
+ { #name, NULL, TT_SKIP, NULL, NULL }
+
+#endif
+
+struct testcase_t rpc_testcases[] = {
+ RPC_LEGACY(basic_test),
+ RPC_LEGACY(basic_message),
+ RPC_LEGACY(basic_client),
+ RPC_LEGACY(basic_queued_client),
+ RPC_LEGACY(basic_client_with_pause),
+ RPC_LEGACY(client_timeout),
+ RPC_LEGACY(test),
+
+ END_OF_TESTCASES,
+};
diff --git a/protocols/Telegram/tgl/libevent/test/regress_rpc.obj b/protocols/Telegram/tgl/libevent/test/regress_rpc.obj
new file mode 100644
index 0000000000..6c1d24abcd
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_rpc.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/regress_ssl.c b/protocols/Telegram/tgl/libevent/test/regress_ssl.c
new file mode 100644
index 0000000000..a415952a7d
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_ssl.c
@@ -0,0 +1,781 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+
+// Get rid of OSX 10.7 and greater deprecation warnings.
+#if defined(__APPLE__) && defined(__clang__)
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+#ifndef _WIN32
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#endif
+
+#include "event2/util.h"
+#include "event2/event.h"
+#include "event2/bufferevent_ssl.h"
+#include "event2/bufferevent_struct.h"
+#include "event2/buffer.h"
+#include "event2/listener.h"
+
+#include "regress.h"
+#include "tinytest.h"
+#include "tinytest_macros.h"
+
+#include <openssl/bio.h>
+#include <openssl/err.h>
+#include <openssl/pem.h>
+
+#include <string.h>
+#ifdef _WIN32
+#include <io.h>
+#define read _read
+#define write _write
+#else
+#include <unistd.h>
+#endif
+
+/* A short pre-generated key, to save the cost of doing an RSA key generation
+ * step during the unit tests. It's only 512 bits long, and it is published
+ * in this file, so you would have to be very foolish to consider using it in
+ * your own code. */
+static const char KEY[] =
+ "-----BEGIN RSA PRIVATE KEY-----\n"
+ "MIIBOgIBAAJBAKibTEzXjj+sqpipePX1lEk5BNFuL/dDBbw8QCXgaJWikOiKHeJq\n"
+ "3FQ0OmCnmpkdsPFE4x3ojYmmdgE2i0dJwq0CAwEAAQJAZ08gpUS+qE1IClps/2gG\n"
+ "AAer6Bc31K2AaiIQvCSQcH440cp062QtWMC3V5sEoWmdLsbAHFH26/9ZHn5zAflp\n"
+ "gQIhANWOx/UYeR8HD0WREU5kcuSzgzNLwUErHLzxP7U6aojpAiEAyh2H35CjN/P7\n"
+ "NhcZ4QYw3PeUWpqgJnaE/4i80BSYkSUCIQDLHFhLYLJZ80HwHTADif/ISn9/Ow6b\n"
+ "p6BWh3DbMar/eQIgBPS6azH5vpp983KXkNv9AL4VZi9ac/b+BeINdzC6GP0CIDmB\n"
+ "U6GFEQTZ3IfuiVabG5pummdC4DNbcdI+WKrSFNmQ\n"
+ "-----END RSA PRIVATE KEY-----\n";
+
+EVP_PKEY *
+ssl_getkey(void)
+{
+ EVP_PKEY *key;
+ BIO *bio;
+
+ /* new read-only BIO backed by KEY. */
+ bio = BIO_new_mem_buf((char*)KEY, -1);
+ tt_assert(bio);
+
+ key = PEM_read_bio_PrivateKey(bio,NULL,NULL,NULL);
+ BIO_free(bio);
+ tt_assert(key);
+
+ return key;
+end:
+ return NULL;
+}
+
+X509 *
+ssl_getcert(void)
+{
+ /* Dummy code to make a quick-and-dirty valid certificate with
+ OpenSSL. Don't copy this code into your own program! It does a
+ number of things in a stupid and insecure way. */
+ X509 *x509 = NULL;
+ X509_NAME *name = NULL;
+ EVP_PKEY *key = ssl_getkey();
+ int nid;
+ time_t now = time(NULL);
+
+ tt_assert(key);
+
+ x509 = X509_new();
+ tt_assert(x509);
+ tt_assert(0 != X509_set_version(x509, 2));
+ tt_assert(0 != ASN1_INTEGER_set(X509_get_serialNumber(x509),
+ (long)now));
+
+ name = X509_NAME_new();
+ tt_assert(name);
+ nid = OBJ_txt2nid("commonName");
+ tt_assert(NID_undef != nid);
+ tt_assert(0 != X509_NAME_add_entry_by_NID(
+ name, nid, MBSTRING_ASC, (unsigned char*)"example.com",
+ -1, -1, 0));
+
+ X509_set_subject_name(x509, name);
+ X509_set_issuer_name(x509, name);
+
+ X509_time_adj(X509_get_notBefore(x509), 0, &now);
+ now += 3600;
+ X509_time_adj(X509_get_notAfter(x509), 0, &now);
+ X509_set_pubkey(x509, key);
+ tt_assert(0 != X509_sign(x509, key, EVP_sha1()));
+
+ return x509;
+end:
+ X509_free(x509);
+ return NULL;
+}
+
+static int disable_tls_11_and_12 = 0;
+static SSL_CTX *the_ssl_ctx = NULL;
+
+SSL_CTX *
+get_ssl_ctx(void)
+{
+ if (the_ssl_ctx)
+ return the_ssl_ctx;
+ the_ssl_ctx = SSL_CTX_new(SSLv23_method());
+ if (!the_ssl_ctx)
+ return NULL;
+ if (disable_tls_11_and_12) {
+#ifdef SSL_OP_NO_TLSv1_2
+ SSL_CTX_set_options(the_ssl_ctx, SSL_OP_NO_TLSv1_2);
+#endif
+#ifdef SSL_OP_NO_TLSv1_1
+ SSL_CTX_set_options(the_ssl_ctx, SSL_OP_NO_TLSv1_1);
+#endif
+ }
+ return the_ssl_ctx;
+}
+
+void
+init_ssl(void)
+{
+ SSL_library_init();
+ ERR_load_crypto_strings();
+ SSL_load_error_strings();
+ OpenSSL_add_all_algorithms();
+ if (SSLeay() != OPENSSL_VERSION_NUMBER) {
+ TT_DECLARE("WARN", ("Version mismatch for openssl: compiled with %lx but running with %lx", (unsigned long)OPENSSL_VERSION_NUMBER, (unsigned long) SSLeay()));
+ }
+}
+
+/* ====================
+ Here's a simple test: we read a number from the input, increment it, and
+ reply, until we get to 1001.
+*/
+
+static int test_is_done = 0;
+static int n_connected = 0;
+static int got_close = 0;
+static int got_error = 0;
+static int got_timeout = 0;
+static int renegotiate_at = -1;
+static int stop_when_connected = 0;
+static int pending_connect_events = 0;
+static struct event_base *exit_base = NULL;
+
+enum regress_openssl_type
+{
+ REGRESS_OPENSSL_SOCKETPAIR = 1,
+ REGRESS_OPENSSL_FILTER = 2,
+ REGRESS_OPENSSL_RENEGOTIATE = 4,
+ REGRESS_OPENSSL_OPEN = 8,
+ REGRESS_OPENSSL_DIRTY_SHUTDOWN = 16,
+ REGRESS_OPENSSL_FD = 32,
+
+ REGRESS_OPENSSL_CLIENT = 64,
+ REGRESS_OPENSSL_SERVER = 128,
+
+ REGRESS_OPENSSL_FREED = 256,
+ REGRESS_OPENSSL_TIMEOUT = 512,
+ REGRESS_OPENSSL_SLEEP = 1024,
+};
+
+static void
+bufferevent_openssl_check_fd(struct bufferevent *bev, int filter)
+{
+ if (filter) {
+ tt_int_op(bufferevent_getfd(bev), ==, -1);
+ tt_int_op(bufferevent_setfd(bev, -1), ==, -1);
+ } else {
+ tt_int_op(bufferevent_getfd(bev), !=, -1);
+ tt_int_op(bufferevent_setfd(bev, -1), ==, 0);
+ }
+ tt_int_op(bufferevent_getfd(bev), ==, -1);
+
+end:
+ ;
+}
+static void
+bufferevent_openssl_check_freed(struct bufferevent *bev)
+{
+ tt_int_op(event_pending(&bev->ev_read, EVLIST_ALL, NULL), ==, 0);
+ tt_int_op(event_pending(&bev->ev_write, EVLIST_ALL, NULL), ==, 0);
+
+end:
+ ;
+}
+
+static void
+respond_to_number(struct bufferevent *bev, void *ctx)
+{
+ struct evbuffer *b = bufferevent_get_input(bev);
+ char *line;
+ int n;
+
+ enum regress_openssl_type type;
+ type = (enum regress_openssl_type)ctx;
+
+ line = evbuffer_readln(b, NULL, EVBUFFER_EOL_LF);
+ if (! line)
+ return;
+ n = atoi(line);
+ if (n <= 0)
+ TT_FAIL(("Bad number: %s", line));
+ free(line);
+ TT_BLATHER(("The number was %d", n));
+ if (n == 1001) {
+ ++test_is_done;
+ bufferevent_free(bev); /* Should trigger close on other side. */
+ return;
+ }
+ if ((type & REGRESS_OPENSSL_CLIENT) && n == renegotiate_at) {
+ SSL_renegotiate(bufferevent_openssl_get_ssl(bev));
+ }
+ ++n;
+ evbuffer_add_printf(bufferevent_get_output(bev),
+ "%d\n", n);
+ TT_BLATHER(("Done reading; now writing."));
+ bufferevent_enable(bev, EV_WRITE);
+ bufferevent_disable(bev, EV_READ);
+}
+
+static void
+done_writing_cb(struct bufferevent *bev, void *ctx)
+{
+ struct evbuffer *b = bufferevent_get_output(bev);
+ if (evbuffer_get_length(b))
+ return;
+ TT_BLATHER(("Done writing."));
+ bufferevent_disable(bev, EV_WRITE);
+ bufferevent_enable(bev, EV_READ);
+}
+
+static void
+eventcb(struct bufferevent *bev, short what, void *ctx)
+{
+ enum regress_openssl_type type;
+ type = (enum regress_openssl_type)ctx;
+
+ TT_BLATHER(("Got event %d", (int)what));
+ if (what & BEV_EVENT_CONNECTED) {
+ SSL *ssl;
+ X509 *peer_cert;
+ ++n_connected;
+ ssl = bufferevent_openssl_get_ssl(bev);
+ tt_assert(ssl);
+ peer_cert = SSL_get_peer_certificate(ssl);
+ if (type & REGRESS_OPENSSL_SERVER) {
+ tt_assert(peer_cert == NULL);
+ } else {
+ tt_assert(peer_cert != NULL);
+ }
+ if (stop_when_connected) {
+ if (--pending_connect_events == 0)
+ event_base_loopexit(exit_base, NULL);
+ }
+ } else if (what & BEV_EVENT_EOF) {
+ TT_BLATHER(("Got a good EOF"));
+ ++got_close;
+ if (type & REGRESS_OPENSSL_FD) {
+ bufferevent_openssl_check_fd(bev, type & REGRESS_OPENSSL_FILTER);
+ }
+ if (type & REGRESS_OPENSSL_FREED) {
+ bufferevent_openssl_check_freed(bev);
+ }
+ bufferevent_free(bev);
+ } else if (what & BEV_EVENT_ERROR) {
+ TT_BLATHER(("Got an error."));
+ ++got_error;
+ if (type & REGRESS_OPENSSL_FD) {
+ bufferevent_openssl_check_fd(bev, type & REGRESS_OPENSSL_FILTER);
+ }
+ if (type & REGRESS_OPENSSL_FREED) {
+ bufferevent_openssl_check_freed(bev);
+ }
+ bufferevent_free(bev);
+ } else if (what & BEV_EVENT_TIMEOUT) {
+ TT_BLATHER(("Got timeout."));
+ ++got_timeout;
+ if (type & REGRESS_OPENSSL_FD) {
+ bufferevent_openssl_check_fd(bev, type & REGRESS_OPENSSL_FILTER);
+ }
+ if (type & REGRESS_OPENSSL_FREED) {
+ bufferevent_openssl_check_freed(bev);
+ }
+ bufferevent_free(bev);
+ }
+end:
+ ;
+}
+
+static void
+open_ssl_bufevs(struct bufferevent **bev1_out, struct bufferevent **bev2_out,
+ struct event_base *base, int is_open, int flags, SSL *ssl1, SSL *ssl2,
+ evutil_socket_t *fd_pair, struct bufferevent **underlying_pair,
+ enum regress_openssl_type type)
+{
+ int state1 = is_open ? BUFFEREVENT_SSL_OPEN :BUFFEREVENT_SSL_CONNECTING;
+ int state2 = is_open ? BUFFEREVENT_SSL_OPEN :BUFFEREVENT_SSL_ACCEPTING;
+ int dirty_shutdown = type & REGRESS_OPENSSL_DIRTY_SHUTDOWN;
+ if (fd_pair) {
+ *bev1_out = bufferevent_openssl_socket_new(
+ base, fd_pair[0], ssl1, state1, flags);
+ *bev2_out = bufferevent_openssl_socket_new(
+ base, fd_pair[1], ssl2, state2, flags);
+ } else {
+ *bev1_out = bufferevent_openssl_filter_new(
+ base, underlying_pair[0], ssl1, state1, flags);
+ *bev2_out = bufferevent_openssl_filter_new(
+ base, underlying_pair[1], ssl2, state2, flags);
+
+ }
+ bufferevent_setcb(*bev1_out, respond_to_number, done_writing_cb,
+ eventcb, (void*)(REGRESS_OPENSSL_CLIENT | (long)type));
+ bufferevent_setcb(*bev2_out, respond_to_number, done_writing_cb,
+ eventcb, (void*)(REGRESS_OPENSSL_SERVER | (long)type));
+
+ bufferevent_openssl_set_allow_dirty_shutdown(*bev1_out, dirty_shutdown);
+ bufferevent_openssl_set_allow_dirty_shutdown(*bev2_out, dirty_shutdown);
+}
+
+static void
+regress_bufferevent_openssl(void *arg)
+{
+ struct basic_test_data *data = arg;
+
+ struct bufferevent *bev1, *bev2;
+ SSL *ssl1, *ssl2;
+ X509 *cert = ssl_getcert();
+ EVP_PKEY *key = ssl_getkey();
+ int flags = BEV_OPT_DEFER_CALLBACKS;
+ struct bufferevent *bev_ll[2] = { NULL, NULL };
+ evutil_socket_t *fd_pair = NULL;
+
+ enum regress_openssl_type type;
+ type = (enum regress_openssl_type)data->setup_data;
+
+ tt_assert(cert);
+ tt_assert(key);
+
+ init_ssl();
+
+ if (type & REGRESS_OPENSSL_RENEGOTIATE) {
+ if (SSLeay() >= 0x10001000 &&
+ SSLeay() < 0x1000104f) {
+ /* 1.0.1 up to 1.0.1c has a bug where TLS1.1 and 1.2
+ * can't renegotiate with themselves. Disable. */
+ disable_tls_11_and_12 = 1;
+ }
+ renegotiate_at = 600;
+ }
+
+ ssl1 = SSL_new(get_ssl_ctx());
+ ssl2 = SSL_new(get_ssl_ctx());
+
+ SSL_use_certificate(ssl2, cert);
+ SSL_use_PrivateKey(ssl2, key);
+
+ if (!(type & REGRESS_OPENSSL_OPEN))
+ flags |= BEV_OPT_CLOSE_ON_FREE;
+
+ if (!(type & REGRESS_OPENSSL_FILTER)) {
+ tt_assert(type & REGRESS_OPENSSL_SOCKETPAIR);
+ fd_pair = data->pair;
+ } else {
+ bev_ll[0] = bufferevent_socket_new(data->base, data->pair[0],
+ BEV_OPT_CLOSE_ON_FREE);
+ bev_ll[1] = bufferevent_socket_new(data->base, data->pair[1],
+ BEV_OPT_CLOSE_ON_FREE);
+ }
+
+ open_ssl_bufevs(&bev1, &bev2, data->base, 0, flags, ssl1, ssl2,
+ fd_pair, bev_ll, type);
+
+ if (!(type & REGRESS_OPENSSL_FILTER)) {
+ tt_int_op(bufferevent_getfd(bev1), ==, data->pair[0]);
+ } else {
+ tt_ptr_op(bufferevent_get_underlying(bev1), ==, bev_ll[0]);
+ }
+
+ if (type & REGRESS_OPENSSL_OPEN) {
+ pending_connect_events = 2;
+ stop_when_connected = 1;
+ exit_base = data->base;
+ event_base_dispatch(data->base);
+ /* Okay, now the renegotiation is done. Make new
+ * bufferevents to test opening in BUFFEREVENT_SSL_OPEN */
+ flags |= BEV_OPT_CLOSE_ON_FREE;
+ bufferevent_free(bev1);
+ bufferevent_free(bev2);
+ bev1 = bev2 = NULL;
+ open_ssl_bufevs(&bev1, &bev2, data->base, 1, flags, ssl1, ssl2,
+ fd_pair, bev_ll, type);
+ }
+
+ if (!(type & REGRESS_OPENSSL_TIMEOUT)) {
+ bufferevent_enable(bev1, EV_READ|EV_WRITE);
+ bufferevent_enable(bev2, EV_READ|EV_WRITE);
+
+ evbuffer_add_printf(bufferevent_get_output(bev1), "1\n");
+
+ event_base_dispatch(data->base);
+
+ tt_assert(test_is_done == 1);
+ tt_assert(n_connected == 2);
+
+ /* We don't handle shutdown properly yet */
+ if (type & REGRESS_OPENSSL_DIRTY_SHUTDOWN) {
+ tt_int_op(got_close, ==, 1);
+ tt_int_op(got_error, ==, 0);
+ } else {
+ tt_int_op(got_error, ==, 1);
+ }
+ tt_int_op(got_timeout, ==, 0);
+ } else {
+ struct timeval t = { 2, 0 };
+
+ bufferevent_enable(bev1, EV_READ|EV_WRITE);
+ bufferevent_disable(bev2, EV_READ|EV_WRITE);
+
+ bufferevent_set_timeouts(bev1, &t, &t);
+
+ evbuffer_add_printf(bufferevent_get_output(bev1), "1\n");
+
+ event_base_dispatch(data->base);
+
+ tt_assert(test_is_done == 0);
+ tt_assert(n_connected == 0);
+
+ tt_int_op(got_close, ==, 0);
+ tt_int_op(got_error, ==, 0);
+ tt_int_op(got_timeout, ==, 1);
+ }
+end:
+ return;
+}
+
+static void
+acceptcb_deferred(evutil_socket_t fd, short events, void *arg)
+{
+ struct bufferevent *bev = arg;
+ bufferevent_enable(bev, EV_READ|EV_WRITE);
+}
+static void
+acceptcb(struct evconnlistener *listener, evutil_socket_t fd,
+ struct sockaddr *addr, int socklen, void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct bufferevent *bev;
+ enum regress_openssl_type type;
+ SSL *ssl = SSL_new(get_ssl_ctx());
+
+ type = (enum regress_openssl_type)data->setup_data;
+
+ SSL_use_certificate(ssl, ssl_getcert());
+ SSL_use_PrivateKey(ssl, ssl_getkey());
+
+ bev = bufferevent_openssl_socket_new(
+ data->base,
+ fd,
+ ssl,
+ BUFFEREVENT_SSL_ACCEPTING,
+ BEV_OPT_CLOSE_ON_FREE|BEV_OPT_DEFER_CALLBACKS);
+
+ bufferevent_setcb(bev, respond_to_number, NULL, eventcb,
+ (void*)(REGRESS_OPENSSL_SERVER));
+
+ if (type & REGRESS_OPENSSL_SLEEP) {
+ struct timeval when = { 1, 0 };
+ event_base_once(data->base, -1, EV_TIMEOUT,
+ acceptcb_deferred, bev, &when);
+ bufferevent_disable(bev, EV_READ|EV_WRITE);
+ } else {
+ bufferevent_enable(bev, EV_READ|EV_WRITE);
+ }
+
+ /* Only accept once, then disable ourself. */
+ evconnlistener_disable(listener);
+}
+
+struct rwcount
+{
+ int fd;
+ size_t read;
+ size_t write;
+};
+static int
+bio_rwcount_new(BIO *b)
+{
+ b->init = 0;
+ b->num = -1;
+ b->ptr = NULL;
+ b->flags = 0;
+ return 1;
+}
+static int
+bio_rwcount_free(BIO *b)
+{
+ if (!b)
+ return 0;
+ if (b->shutdown) {
+ b->init = 0;
+ b->flags = 0;
+ b->ptr = NULL;
+ }
+ return 1;
+}
+static int
+bio_rwcount_read(BIO *b, char *out, int outlen)
+{
+ struct rwcount *rw = b->ptr;
+ ev_ssize_t ret = read(rw->fd, out, outlen);
+ ++rw->read;
+ if (ret == -1 && errno == EAGAIN) {
+ BIO_set_retry_read(b);
+ }
+ return ret;
+}
+static int
+bio_rwcount_write(BIO *b, const char *in, int inlen)
+{
+
+ struct rwcount *rw = b->ptr;
+ ev_ssize_t ret = write(rw->fd, in, inlen);
+ ++rw->write;
+ if (ret == -1 && errno == EAGAIN) {
+ BIO_set_retry_write(b);
+ }
+ return ret;
+}
+static long
+bio_rwcount_ctrl(BIO *b, int cmd, long num, void *ptr)
+{
+ long ret = 0;
+ switch (cmd) {
+ case BIO_CTRL_GET_CLOSE:
+ ret = b->shutdown;
+ break;
+ case BIO_CTRL_SET_CLOSE:
+ b->shutdown = (int)num;
+ break;
+ case BIO_CTRL_PENDING:
+ ret = 0;
+ break;
+ case BIO_CTRL_WPENDING:
+ ret = 0;
+ break;
+ case BIO_CTRL_DUP:
+ case BIO_CTRL_FLUSH:
+ ret = 1;
+ break;
+ }
+ return ret;
+}
+static int
+bio_rwcount_puts(BIO *b, const char *s)
+{
+ return bio_rwcount_write(b, s, strlen(s));
+}
+#define BIO_TYPE_LIBEVENT_RWCOUNT 0xff1
+static BIO_METHOD methods_rwcount = {
+ BIO_TYPE_LIBEVENT_RWCOUNT, "rwcount",
+ bio_rwcount_write,
+ bio_rwcount_read,
+ bio_rwcount_puts,
+ NULL /* bio_rwcount_gets */,
+ bio_rwcount_ctrl,
+ bio_rwcount_new,
+ bio_rwcount_free,
+ NULL /* callback_ctrl */,
+};
+static BIO_METHOD *
+BIO_s_rwcount(void)
+{
+ return &methods_rwcount;
+}
+static BIO *
+BIO_new_rwcount(int close_flag)
+{
+ BIO *result;
+ if (!(result = BIO_new(BIO_s_rwcount())))
+ return NULL;
+ result->init = 1;
+ result->ptr = NULL;
+ result->shutdown = !!close_flag;
+ return result;
+}
+
+static void
+regress_bufferevent_openssl_connect(void *arg)
+{
+ struct basic_test_data *data = arg;
+
+ struct event_base *base = data->base;
+
+ struct evconnlistener *listener;
+ struct bufferevent *bev;
+ struct sockaddr_in sin;
+ struct sockaddr_storage ss;
+ ev_socklen_t slen;
+ SSL *ssl;
+ BIO *bio;
+ struct rwcount rw = { -1, 0, 0 };
+ enum regress_openssl_type type;
+
+ type = (enum regress_openssl_type)data->setup_data;
+
+ init_ssl();
+
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_addr.s_addr = htonl(0x7f000001);
+
+ memset(&ss, 0, sizeof(ss));
+ slen = sizeof(ss);
+
+ listener = evconnlistener_new_bind(base, acceptcb, data,
+ LEV_OPT_CLOSE_ON_FREE|LEV_OPT_REUSEABLE,
+ -1, (struct sockaddr *)&sin, sizeof(sin));
+
+ tt_assert(listener);
+ tt_assert(evconnlistener_get_fd(listener) >= 0);
+
+ ssl = SSL_new(get_ssl_ctx());
+ tt_assert(ssl);
+
+ bev = bufferevent_openssl_socket_new(
+ data->base, -1, ssl,
+ BUFFEREVENT_SSL_CONNECTING,
+ BEV_OPT_CLOSE_ON_FREE|BEV_OPT_DEFER_CALLBACKS);
+ tt_assert(bev);
+
+ bufferevent_setcb(bev, respond_to_number, NULL, eventcb,
+ (void*)(REGRESS_OPENSSL_CLIENT));
+
+ tt_assert(getsockname(evconnlistener_get_fd(listener),
+ (struct sockaddr*)&ss, &slen) == 0);
+ tt_assert(slen == sizeof(struct sockaddr_in));
+ tt_int_op(((struct sockaddr*)&ss)->sa_family, ==, AF_INET);
+
+ tt_assert(0 ==
+ bufferevent_socket_connect(bev, (struct sockaddr*)&ss, slen));
+ /* Possible only when we have fd, since be_openssl can and will overwrite
+ * bio otherwise before */
+ if (type & REGRESS_OPENSSL_SLEEP) {
+ rw.fd = bufferevent_getfd(bev);
+ bio = BIO_new_rwcount(0);
+ tt_assert(bio);
+ bio->ptr = &rw;
+ SSL_set_bio(ssl, bio, bio);
+ }
+ evbuffer_add_printf(bufferevent_get_output(bev), "1\n");
+ bufferevent_enable(bev, EV_READ|EV_WRITE);
+
+ event_base_dispatch(base);
+
+ tt_int_op(rw.read, <=, 100);
+ tt_int_op(rw.write, <=, 100);
+end:
+ ;
+}
+
+struct testcase_t ssl_testcases[] = {
+#define T(a) ((void *)(a))
+ { "bufferevent_socketpair", regress_bufferevent_openssl,
+ TT_ISOLATED, &basic_setup, T(REGRESS_OPENSSL_SOCKETPAIR) },
+ { "bufferevent_filter", regress_bufferevent_openssl,
+ TT_ISOLATED, &basic_setup, T(REGRESS_OPENSSL_FILTER) },
+ { "bufferevent_renegotiate_socketpair", regress_bufferevent_openssl,
+ TT_ISOLATED, &basic_setup,
+ T(REGRESS_OPENSSL_SOCKETPAIR | REGRESS_OPENSSL_RENEGOTIATE) },
+ { "bufferevent_renegotiate_filter", regress_bufferevent_openssl,
+ TT_ISOLATED, &basic_setup,
+ T(REGRESS_OPENSSL_FILTER | REGRESS_OPENSSL_RENEGOTIATE) },
+ { "bufferevent_socketpair_startopen", regress_bufferevent_openssl,
+ TT_ISOLATED, &basic_setup,
+ T(REGRESS_OPENSSL_SOCKETPAIR | REGRESS_OPENSSL_OPEN) },
+ { "bufferevent_filter_startopen", regress_bufferevent_openssl,
+ TT_ISOLATED, &basic_setup,
+ T(REGRESS_OPENSSL_FILTER | REGRESS_OPENSSL_OPEN) },
+
+ { "bufferevent_socketpair_dirty_shutdown", regress_bufferevent_openssl,
+ TT_ISOLATED, &basic_setup,
+ T(REGRESS_OPENSSL_SOCKETPAIR | REGRESS_OPENSSL_DIRTY_SHUTDOWN) },
+ { "bufferevent_filter_dirty_shutdown", regress_bufferevent_openssl,
+ TT_ISOLATED, &basic_setup,
+ T(REGRESS_OPENSSL_FILTER | REGRESS_OPENSSL_DIRTY_SHUTDOWN) },
+ { "bufferevent_renegotiate_socketpair_dirty_shutdown",
+ regress_bufferevent_openssl,
+ TT_ISOLATED,
+ &basic_setup,
+ T(REGRESS_OPENSSL_SOCKETPAIR | REGRESS_OPENSSL_RENEGOTIATE | REGRESS_OPENSSL_DIRTY_SHUTDOWN) },
+ { "bufferevent_renegotiate_filter_dirty_shutdown",
+ regress_bufferevent_openssl,
+ TT_ISOLATED,
+ &basic_setup,
+ T(REGRESS_OPENSSL_FILTER | REGRESS_OPENSSL_RENEGOTIATE | REGRESS_OPENSSL_DIRTY_SHUTDOWN) },
+ { "bufferevent_socketpair_startopen_dirty_shutdown",
+ regress_bufferevent_openssl,
+ TT_ISOLATED, &basic_setup,
+ T(REGRESS_OPENSSL_SOCKETPAIR | REGRESS_OPENSSL_OPEN | REGRESS_OPENSSL_DIRTY_SHUTDOWN) },
+ { "bufferevent_filter_startopen_dirty_shutdown",
+ regress_bufferevent_openssl,
+ TT_ISOLATED, &basic_setup,
+ T(REGRESS_OPENSSL_FILTER | REGRESS_OPENSSL_OPEN | REGRESS_OPENSSL_DIRTY_SHUTDOWN) },
+
+ { "bufferevent_socketpair_fd", regress_bufferevent_openssl,
+ TT_ISOLATED, &basic_setup,
+ T(REGRESS_OPENSSL_SOCKETPAIR | REGRESS_OPENSSL_FD) },
+ { "bufferevent_socketpair_freed", regress_bufferevent_openssl,
+ TT_ISOLATED, &basic_setup,
+ T(REGRESS_OPENSSL_SOCKETPAIR | REGRESS_OPENSSL_FREED) },
+ { "bufferevent_socketpair_freed_fd", regress_bufferevent_openssl,
+ TT_ISOLATED, &basic_setup,
+ T(REGRESS_OPENSSL_SOCKETPAIR | REGRESS_OPENSSL_FREED | REGRESS_OPENSSL_FD) },
+ { "bufferevent_filter_freed_fd", regress_bufferevent_openssl,
+ TT_ISOLATED, &basic_setup,
+ T(REGRESS_OPENSSL_FILTER | REGRESS_OPENSSL_FREED | REGRESS_OPENSSL_FD) },
+
+ { "bufferevent_socketpair_timeout", regress_bufferevent_openssl,
+ TT_ISOLATED, &basic_setup,
+ T(REGRESS_OPENSSL_SOCKETPAIR | REGRESS_OPENSSL_TIMEOUT) },
+ { "bufferevent_socketpair_timeout_freed_fd", regress_bufferevent_openssl,
+ TT_ISOLATED, &basic_setup,
+ T(REGRESS_OPENSSL_SOCKETPAIR | REGRESS_OPENSSL_TIMEOUT | REGRESS_OPENSSL_FREED | REGRESS_OPENSSL_FD) },
+
+ { "bufferevent_connect", regress_bufferevent_openssl_connect,
+ TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
+ { "bufferevent_connect_sleep", regress_bufferevent_openssl_connect,
+ TT_FORK|TT_NEED_BASE, &basic_setup, T(REGRESS_OPENSSL_SLEEP) },
+
+#undef T
+
+ END_OF_TESTCASES,
+};
diff --git a/protocols/Telegram/tgl/libevent/test/regress_testutils.c b/protocols/Telegram/tgl/libevent/test/regress_testutils.c
new file mode 100644
index 0000000000..7554a5413f
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_testutils.c
@@ -0,0 +1,229 @@
+/*
+ * Copyright (c) 2010-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "../util-internal.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#include <ws2tcpip.h>
+#endif
+
+#include "event2/event-config.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#ifndef _WIN32
+#include <sys/socket.h>
+#include <signal.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <unistd.h>
+#endif
+#ifdef EVENT__HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#include "event2/dns.h"
+#include "event2/dns_struct.h"
+#include "event2/event.h"
+#include "event2/event_compat.h"
+#include "event2/util.h"
+#include "event2/listener.h"
+#include "event2/bufferevent.h"
+#include "log-internal.h"
+#include "regress.h"
+#include "regress_testutils.h"
+
+/* globals */
+static struct evdns_server_port *dns_port;
+evutil_socket_t dns_sock = -1;
+
+/* Helper: return the port that a socket is bound on, in host order. */
+int
+regress_get_socket_port(evutil_socket_t fd)
+{
+ struct sockaddr_storage ss;
+ ev_socklen_t socklen = sizeof(ss);
+ if (getsockname(fd, (struct sockaddr*)&ss, &socklen) != 0)
+ return -1;
+ if (ss.ss_family == AF_INET)
+ return ntohs( ((struct sockaddr_in*)&ss)->sin_port);
+ else if (ss.ss_family == AF_INET6)
+ return ntohs( ((struct sockaddr_in6*)&ss)->sin6_port);
+ else
+ return -1;
+}
+
+struct evdns_server_port *
+regress_get_dnsserver(struct event_base *base,
+ ev_uint16_t *portnum,
+ evutil_socket_t *psock,
+ evdns_request_callback_fn_type cb,
+ void *arg)
+{
+ struct evdns_server_port *port = NULL;
+ evutil_socket_t sock;
+ struct sockaddr_in my_addr;
+
+ sock = socket(AF_INET, SOCK_DGRAM, 0);
+ if (sock < 0) {
+ tt_abort_perror("socket");
+ }
+
+ evutil_make_socket_nonblocking(sock);
+
+ memset(&my_addr, 0, sizeof(my_addr));
+ my_addr.sin_family = AF_INET;
+ my_addr.sin_port = htons(*portnum);
+ my_addr.sin_addr.s_addr = htonl(0x7f000001UL);
+ if (bind(sock, (struct sockaddr*)&my_addr, sizeof(my_addr)) < 0) {
+ evutil_closesocket(sock);
+ tt_abort_perror("bind");
+ }
+ port = evdns_add_server_port_with_base(base, sock, 0, cb, arg);
+ if (!*portnum)
+ *portnum = regress_get_socket_port(sock);
+ if (psock)
+ *psock = sock;
+
+ return port;
+end:
+ return NULL;
+}
+
+void
+regress_clean_dnsserver(void)
+{
+ if (dns_port)
+ evdns_close_server_port(dns_port);
+ if (dns_sock >= 0)
+ evutil_closesocket(dns_sock);
+}
+
+static void strtolower(char *s)
+{
+ while (*s) {
+ *s = EVUTIL_TOLOWER_(*s);
+ ++s;
+ }
+}
+void
+regress_dns_server_cb(struct evdns_server_request *req, void *data)
+{
+ struct regress_dns_server_table *tab = data;
+ char *question;
+
+ if (req->nquestions != 1)
+ TT_DIE(("Only handling one question at a time; got %d",
+ req->nquestions));
+
+ question = req->questions[0]->name;
+
+ while (tab->q && evutil_ascii_strcasecmp(question, tab->q) &&
+ strcmp("*", tab->q))
+ ++tab;
+ if (tab->q == NULL)
+ TT_DIE(("Unexpected question: '%s'", question));
+
+ ++tab->seen;
+
+ if (tab->lower)
+ strtolower(question);
+
+ if (!strcmp(tab->anstype, "err")) {
+ int err = atoi(tab->ans);
+ tt_assert(! evdns_server_request_respond(req, err));
+ return;
+ } else if (!strcmp(tab->anstype, "errsoa")) {
+ int err = atoi(tab->ans);
+ char soa_record[] =
+ "\x04" "dns1" "\x05" "icann" "\x03" "org" "\0"
+ "\x0a" "hostmaster" "\x05" "icann" "\x03" "org" "\0"
+ "\x77\xde\x5e\xba" /* serial */
+ "\x00\x00\x1c\x20" /* refreshtime = 2h */
+ "\x00\x00\x0e\x10" /* retry = 1h */
+ "\x00\x12\x75\x00" /* expiration = 14d */
+ "\x00\x00\x0e\x10" /* min.ttl = 1h */
+ ;
+ evdns_server_request_add_reply(
+ req, EVDNS_AUTHORITY_SECTION,
+ "example.com", EVDNS_TYPE_SOA, EVDNS_CLASS_INET,
+ 42, sizeof(soa_record) - 1, 0, soa_record);
+ tt_assert(! evdns_server_request_respond(req, err));
+ return;
+ } else if (!strcmp(tab->anstype, "A")) {
+ struct in_addr in;
+ if (!evutil_inet_pton(AF_INET, tab->ans, &in)) {
+ TT_DIE(("Bad A value %s in table", tab->ans));
+ }
+ evdns_server_request_add_a_reply(req, question, 1, &in.s_addr,
+ 100);
+ } else if (!strcmp(tab->anstype, "AAAA")) {
+ struct in6_addr in6;
+ if (!evutil_inet_pton(AF_INET6, tab->ans, &in6)) {
+ TT_DIE(("Bad AAAA value %s in table", tab->ans));
+ }
+ evdns_server_request_add_aaaa_reply(req,
+ question, 1, &in6.s6_addr, 100);
+ } else {
+ TT_DIE(("Weird table entry with type '%s'", tab->anstype));
+ }
+ tt_assert(! evdns_server_request_respond(req, 0))
+ return;
+end:
+ tt_want(! evdns_server_request_drop(req));
+}
+
+int
+regress_dnsserver(struct event_base *base, ev_uint16_t *port,
+ struct regress_dns_server_table *search_table)
+{
+ dns_port = regress_get_dnsserver(base, port, &dns_sock,
+ regress_dns_server_cb, search_table);
+ return dns_port != NULL;
+}
+
+int
+regress_get_listener_addr(struct evconnlistener *lev,
+ struct sockaddr *sa, ev_socklen_t *socklen)
+{
+ evutil_socket_t s = evconnlistener_get_fd(lev);
+ if (s <= 0)
+ return -1;
+ return getsockname(s, sa, socklen);
+}
diff --git a/protocols/Telegram/tgl/libevent/test/regress_testutils.h b/protocols/Telegram/tgl/libevent/test/regress_testutils.h
new file mode 100644
index 0000000000..040516a585
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_testutils.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2010-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+
+#ifndef REGRESS_TESTUTILS_H_INCLUDED_
+#define REGRESS_TESTUTILS_H_INCLUDED_
+
+#include "event2/dns.h"
+
+struct regress_dns_server_table {
+ const char *q;
+ const char *anstype;
+ const char *ans;
+ int seen;
+ int lower;
+};
+
+struct evdns_server_port *
+regress_get_dnsserver(struct event_base *base,
+ ev_uint16_t *portnum,
+ evutil_socket_t *psock,
+ evdns_request_callback_fn_type cb,
+ void *arg);
+
+/* Helper: return the port that a socket is bound on, in host order. */
+int regress_get_socket_port(evutil_socket_t fd);
+
+/* used to look up pre-canned responses in a search table */
+void regress_dns_server_cb(
+ struct evdns_server_request *req, void *data);
+
+/* globally allocates a dns server that serves from a search table */
+int regress_dnsserver(struct event_base *base, ev_uint16_t *port,
+ struct regress_dns_server_table *seach_table);
+
+/* clean up the global dns server resources */
+void regress_clean_dnsserver(void);
+
+struct evconnlistener;
+struct sockaddr;
+int regress_get_listener_addr(struct evconnlistener *lev,
+ struct sockaddr *sa, ev_socklen_t *socklen);
+
+#endif /* REGRESS_TESTUTILS_H_INCLUDED_ */
+
diff --git a/protocols/Telegram/tgl/libevent/test/regress_testutils.obj b/protocols/Telegram/tgl/libevent/test/regress_testutils.obj
new file mode 100644
index 0000000000..f596a67e4c
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_testutils.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/regress_thread.c b/protocols/Telegram/tgl/libevent/test/regress_thread.c
new file mode 100644
index 0000000000..9ff6a8fa88
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_thread.c
@@ -0,0 +1,590 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "util-internal.h"
+
+/* The old tests here need assertions to work. */
+#undef NDEBUG
+
+#include "event2/event-config.h"
+
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef EVENT__HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+
+#ifdef EVENT__HAVE_PTHREADS
+#include <pthread.h>
+#elif defined(_WIN32)
+#include <process.h>
+#endif
+#include <assert.h>
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <time.h>
+
+#include "sys/queue.h"
+
+#include "event2/event.h"
+#include "event2/event_struct.h"
+#include "event2/thread.h"
+#include "event2/util.h"
+#include "evthread-internal.h"
+#include "event-internal.h"
+#include "defer-internal.h"
+#include "regress.h"
+#include "tinytest_macros.h"
+#include "time-internal.h"
+#include "regress_thread.h"
+
+struct cond_wait {
+ void *lock;
+ void *cond;
+};
+
+static void
+wake_all_timeout(evutil_socket_t fd, short what, void *arg)
+{
+ struct cond_wait *cw = arg;
+ EVLOCK_LOCK(cw->lock, 0);
+ EVTHREAD_COND_BROADCAST(cw->cond);
+ EVLOCK_UNLOCK(cw->lock, 0);
+
+}
+
+static void
+wake_one_timeout(evutil_socket_t fd, short what, void *arg)
+{
+ struct cond_wait *cw = arg;
+ EVLOCK_LOCK(cw->lock, 0);
+ EVTHREAD_COND_SIGNAL(cw->cond);
+ EVLOCK_UNLOCK(cw->lock, 0);
+}
+
+#define NUM_THREADS 100
+#define NUM_ITERATIONS 100
+void *count_lock;
+static int count;
+
+static THREAD_FN
+basic_thread(void *arg)
+{
+ struct cond_wait cw;
+ struct event_base *base = arg;
+ struct event ev;
+ int i = 0;
+
+ EVTHREAD_ALLOC_LOCK(cw.lock, 0);
+ EVTHREAD_ALLOC_COND(cw.cond);
+ assert(cw.lock);
+ assert(cw.cond);
+
+ evtimer_assign(&ev, base, wake_all_timeout, &cw);
+ for (i = 0; i < NUM_ITERATIONS; i++) {
+ struct timeval tv;
+ evutil_timerclear(&tv);
+ tv.tv_sec = 0;
+ tv.tv_usec = 3000;
+
+ EVLOCK_LOCK(cw.lock, 0);
+ /* we need to make sure that event does not happen before
+ * we get to wait on the conditional variable */
+ assert(evtimer_add(&ev, &tv) == 0);
+
+ assert(EVTHREAD_COND_WAIT(cw.cond, cw.lock) == 0);
+ EVLOCK_UNLOCK(cw.lock, 0);
+
+ EVLOCK_LOCK(count_lock, 0);
+ ++count;
+ EVLOCK_UNLOCK(count_lock, 0);
+ }
+
+ /* exit the loop only if all threads fired all timeouts */
+ EVLOCK_LOCK(count_lock, 0);
+ if (count >= NUM_THREADS * NUM_ITERATIONS)
+ event_base_loopexit(base, NULL);
+ EVLOCK_UNLOCK(count_lock, 0);
+
+ EVTHREAD_FREE_LOCK(cw.lock, 0);
+ EVTHREAD_FREE_COND(cw.cond);
+
+ THREAD_RETURN();
+}
+
+static int notification_fd_used = 0;
+#ifndef _WIN32
+static int got_sigchld = 0;
+static void
+sigchld_cb(evutil_socket_t fd, short event, void *arg)
+{
+ struct timeval tv;
+ struct event_base *base = arg;
+
+ got_sigchld++;
+ tv.tv_usec = 100000;
+ tv.tv_sec = 0;
+ event_base_loopexit(base, &tv);
+}
+
+
+static void
+notify_fd_cb(evutil_socket_t fd, short event, void *arg)
+{
+ ++notification_fd_used;
+}
+#endif
+
+static void
+thread_basic(void *arg)
+{
+ THREAD_T threads[NUM_THREADS];
+ struct event ev;
+ struct timeval tv;
+ int i;
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+
+ struct event *notification_event = NULL;
+ struct event *sigchld_event = NULL;
+
+ EVTHREAD_ALLOC_LOCK(count_lock, 0);
+ tt_assert(count_lock);
+
+ tt_assert(base);
+ if (evthread_make_base_notifiable(base)<0) {
+ tt_abort_msg("Couldn't make base notifiable!");
+ }
+
+#ifndef _WIN32
+ if (data->setup_data && !strcmp(data->setup_data, "forking")) {
+ pid_t pid;
+ int status;
+ sigchld_event = evsignal_new(base, SIGCHLD, sigchld_cb, base);
+ /* This piggybacks on the th_notify_fd weirdly, and looks
+ * inside libevent internals. Not a good idea in non-testing
+ * code! */
+ notification_event = event_new(base,
+ base->th_notify_fd[0], EV_READ|EV_PERSIST, notify_fd_cb,
+ NULL);
+ event_add(sigchld_event, NULL);
+ event_add(notification_event, NULL);
+
+ if ((pid = fork()) == 0) {
+ event_del(notification_event);
+ if (event_reinit(base) < 0) {
+ TT_FAIL(("reinit"));
+ exit(1);
+ }
+ event_assign(notification_event, base,
+ base->th_notify_fd[0], EV_READ|EV_PERSIST,
+ notify_fd_cb, NULL);
+ event_add(notification_event, NULL);
+ goto child;
+ }
+
+ event_base_dispatch(base);
+
+ if (waitpid(pid, &status, 0) == -1)
+ tt_abort_perror("waitpid");
+ TT_BLATHER(("Waitpid okay\n"));
+
+ tt_assert(got_sigchld);
+ tt_int_op(notification_fd_used, ==, 0);
+
+ goto end;
+ }
+
+child:
+#endif
+ for (i = 0; i < NUM_THREADS; ++i)
+ THREAD_START(threads[i], basic_thread, base);
+
+ evtimer_assign(&ev, base, NULL, NULL);
+ evutil_timerclear(&tv);
+ tv.tv_sec = 1000;
+ event_add(&ev, &tv);
+
+ event_base_dispatch(base);
+
+ for (i = 0; i < NUM_THREADS; ++i)
+ THREAD_JOIN(threads[i]);
+
+ event_del(&ev);
+
+ tt_int_op(count, ==, NUM_THREADS * NUM_ITERATIONS);
+
+ EVTHREAD_FREE_LOCK(count_lock, 0);
+
+ TT_BLATHER(("notifiations==%d", notification_fd_used));
+
+end:
+
+ if (notification_event)
+ event_free(notification_event);
+ if (sigchld_event)
+ event_free(sigchld_event);
+}
+
+#undef NUM_THREADS
+#define NUM_THREADS 10
+
+struct alerted_record {
+ struct cond_wait *cond;
+ struct timeval delay;
+ struct timeval alerted_at;
+ int timed_out;
+};
+
+static THREAD_FN
+wait_for_condition(void *arg)
+{
+ struct alerted_record *rec = arg;
+ int r;
+
+ EVLOCK_LOCK(rec->cond->lock, 0);
+ if (rec->delay.tv_sec || rec->delay.tv_usec) {
+ r = EVTHREAD_COND_WAIT_TIMED(rec->cond->cond, rec->cond->lock,
+ &rec->delay);
+ } else {
+ r = EVTHREAD_COND_WAIT(rec->cond->cond, rec->cond->lock);
+ }
+ EVLOCK_UNLOCK(rec->cond->lock, 0);
+
+ evutil_gettimeofday(&rec->alerted_at, NULL);
+ if (r == 1)
+ rec->timed_out = 1;
+
+ THREAD_RETURN();
+}
+
+static void
+thread_conditions_simple(void *arg)
+{
+ struct timeval tv_signal, tv_timeout, tv_broadcast;
+ struct alerted_record alerted[NUM_THREADS];
+ THREAD_T threads[NUM_THREADS];
+ struct cond_wait cond;
+ int i;
+ struct timeval launched_at;
+ struct event wake_one;
+ struct event wake_all;
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+ int n_timed_out=0, n_signal=0, n_broadcast=0;
+
+ tv_signal.tv_sec = tv_timeout.tv_sec = tv_broadcast.tv_sec = 0;
+ tv_signal.tv_usec = 30*1000;
+ tv_timeout.tv_usec = 150*1000;
+ tv_broadcast.tv_usec = 500*1000;
+
+ EVTHREAD_ALLOC_LOCK(cond.lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+ EVTHREAD_ALLOC_COND(cond.cond);
+ tt_assert(cond.lock);
+ tt_assert(cond.cond);
+ for (i = 0; i < NUM_THREADS; ++i) {
+ memset(&alerted[i], 0, sizeof(struct alerted_record));
+ alerted[i].cond = &cond;
+ }
+
+ /* Threads 5 and 6 will be allowed to time out */
+ memcpy(&alerted[5].delay, &tv_timeout, sizeof(tv_timeout));
+ memcpy(&alerted[6].delay, &tv_timeout, sizeof(tv_timeout));
+
+ evtimer_assign(&wake_one, base, wake_one_timeout, &cond);
+ evtimer_assign(&wake_all, base, wake_all_timeout, &cond);
+
+ evutil_gettimeofday(&launched_at, NULL);
+
+ /* Launch the threads... */
+ for (i = 0; i < NUM_THREADS; ++i) {
+ THREAD_START(threads[i], wait_for_condition, &alerted[i]);
+ }
+
+ /* Start the timers... */
+ tt_int_op(event_add(&wake_one, &tv_signal), ==, 0);
+ tt_int_op(event_add(&wake_all, &tv_broadcast), ==, 0);
+
+ /* And run for a bit... */
+ event_base_dispatch(base);
+
+ /* And wait till the threads are done. */
+ for (i = 0; i < NUM_THREADS; ++i)
+ THREAD_JOIN(threads[i]);
+
+ /* Now, let's see what happened. At least one of 5 or 6 should
+ * have timed out. */
+ n_timed_out = alerted[5].timed_out + alerted[6].timed_out;
+ tt_int_op(n_timed_out, >=, 1);
+ tt_int_op(n_timed_out, <=, 2);
+
+ for (i = 0; i < NUM_THREADS; ++i) {
+ const struct timeval *target_delay;
+ struct timeval target_time, actual_delay;
+ if (alerted[i].timed_out) {
+ TT_BLATHER(("%d looks like a timeout\n", i));
+ target_delay = &tv_timeout;
+ tt_assert(i == 5 || i == 6);
+ } else if (evutil_timerisset(&alerted[i].alerted_at)) {
+ long diff1,diff2;
+ evutil_timersub(&alerted[i].alerted_at,
+ &launched_at, &actual_delay);
+ diff1 = timeval_msec_diff(&actual_delay,
+ &tv_signal);
+ diff2 = timeval_msec_diff(&actual_delay,
+ &tv_broadcast);
+ if (labs(diff1) < labs(diff2)) {
+ TT_BLATHER(("%d looks like a signal\n", i));
+ target_delay = &tv_signal;
+ ++n_signal;
+ } else {
+ TT_BLATHER(("%d looks like a broadcast\n", i));
+ target_delay = &tv_broadcast;
+ ++n_broadcast;
+ }
+ } else {
+ TT_FAIL(("Thread %d never got woken", i));
+ continue;
+ }
+ evutil_timeradd(target_delay, &launched_at, &target_time);
+ test_timeval_diff_leq(&target_time, &alerted[i].alerted_at,
+ 0, 50);
+ }
+ tt_int_op(n_broadcast + n_signal + n_timed_out, ==, NUM_THREADS);
+ tt_int_op(n_signal, ==, 1);
+
+end:
+ EVTHREAD_FREE_LOCK(cond.lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+ EVTHREAD_FREE_COND(cond.cond);
+}
+
+#define CB_COUNT 128
+#define QUEUE_THREAD_COUNT 8
+
+static void
+SLEEP_MS(int ms)
+{
+ struct timeval tv;
+ tv.tv_sec = ms/1000;
+ tv.tv_usec = (ms%1000)*1000;
+ evutil_usleep_(&tv);
+}
+
+struct deferred_test_data {
+ struct event_callback cbs[CB_COUNT];
+ struct event_base *queue;
+};
+
+static struct timeval timer_start = {0,0};
+static struct timeval timer_end = {0,0};
+static unsigned callback_count = 0;
+static THREAD_T load_threads[QUEUE_THREAD_COUNT];
+static struct deferred_test_data deferred_data[QUEUE_THREAD_COUNT];
+
+static void
+deferred_callback(struct event_callback *cb, void *arg)
+{
+ SLEEP_MS(1);
+ callback_count += 1;
+}
+
+static THREAD_FN
+load_deferred_queue(void *arg)
+{
+ struct deferred_test_data *data = arg;
+ size_t i;
+
+ for (i = 0; i < CB_COUNT; ++i) {
+ event_deferred_cb_init_(&data->cbs[i], 0, deferred_callback,
+ NULL);
+ event_deferred_cb_schedule_(data->queue, &data->cbs[i]);
+ SLEEP_MS(1);
+ }
+
+ THREAD_RETURN();
+}
+
+static void
+timer_callback(evutil_socket_t fd, short what, void *arg)
+{
+ evutil_gettimeofday(&timer_end, NULL);
+}
+
+static void
+start_threads_callback(evutil_socket_t fd, short what, void *arg)
+{
+ int i;
+
+ for (i = 0; i < QUEUE_THREAD_COUNT; ++i) {
+ THREAD_START(load_threads[i], load_deferred_queue,
+ &deferred_data[i]);
+ }
+}
+
+static void
+thread_deferred_cb_skew(void *arg)
+{
+ struct timeval tv_timer = {1, 0};
+ struct event_base *base = NULL;
+ struct event_config *cfg = NULL;
+ struct timeval elapsed;
+ int elapsed_usec;
+ int i;
+
+ cfg = event_config_new();
+ tt_assert(cfg);
+ event_config_set_max_dispatch_interval(cfg, NULL, 16, 0);
+
+ base = event_base_new_with_config(cfg);
+ tt_assert(base);
+
+ for (i = 0; i < QUEUE_THREAD_COUNT; ++i)
+ deferred_data[i].queue = base;
+
+ evutil_gettimeofday(&timer_start, NULL);
+ event_base_once(base, -1, EV_TIMEOUT, timer_callback, NULL,
+ &tv_timer);
+ event_base_once(base, -1, EV_TIMEOUT, start_threads_callback,
+ NULL, NULL);
+ event_base_dispatch(base);
+
+ evutil_timersub(&timer_end, &timer_start, &elapsed);
+ TT_BLATHER(("callback count, %u", callback_count));
+ elapsed_usec =
+ (unsigned)(elapsed.tv_sec*1000000 + elapsed.tv_usec);
+ TT_BLATHER(("elapsed time, %u usec", elapsed_usec));
+
+ /* XXX be more intelligent here. just make sure skew is
+ * within .4 seconds for now. */
+ tt_assert(elapsed_usec >= 600000 && elapsed_usec <= 1400000);
+
+end:
+ for (i = 0; i < QUEUE_THREAD_COUNT; ++i)
+ THREAD_JOIN(load_threads[i]);
+ if (base)
+ event_base_free(base);
+ if (cfg)
+ event_config_free(cfg);
+}
+
+static struct event time_events[5];
+static struct timeval times[5];
+static struct event_base *exit_base = NULL;
+static void
+note_time_cb(evutil_socket_t fd, short what, void *arg)
+{
+ evutil_gettimeofday(arg, NULL);
+ if (arg == &times[4]) {
+ event_base_loopbreak(exit_base);
+ }
+}
+static THREAD_FN
+register_events_subthread(void *arg)
+{
+ struct timeval tv = {0,0};
+ SLEEP_MS(100);
+ event_active(&time_events[0], EV_TIMEOUT, 1);
+ SLEEP_MS(100);
+ event_active(&time_events[1], EV_TIMEOUT, 1);
+ SLEEP_MS(100);
+ tv.tv_usec = 100*1000;
+ event_add(&time_events[2], &tv);
+ tv.tv_usec = 150*1000;
+ event_add(&time_events[3], &tv);
+ SLEEP_MS(200);
+ event_active(&time_events[4], EV_TIMEOUT, 1);
+
+ THREAD_RETURN();
+}
+
+static void
+thread_no_events(void *arg)
+{
+ THREAD_T thread;
+ struct basic_test_data *data = arg;
+ struct timeval starttime, endtime;
+ int i;
+ exit_base = data->base;
+
+ memset(times,0,sizeof(times));
+ for (i=0;i<5;++i) {
+ event_assign(&time_events[i], data->base,
+ -1, 0, note_time_cb, &times[i]);
+ }
+
+ evutil_gettimeofday(&starttime, NULL);
+ THREAD_START(thread, register_events_subthread, data->base);
+ event_base_loop(data->base, EVLOOP_NO_EXIT_ON_EMPTY);
+ evutil_gettimeofday(&endtime, NULL);
+ tt_assert(event_base_got_break(data->base));
+ THREAD_JOIN(thread);
+ for (i=0; i<5; ++i) {
+ struct timeval diff;
+ double sec;
+ evutil_timersub(&times[i], &starttime, &diff);
+ sec = diff.tv_sec + diff.tv_usec/1.0e6;
+ TT_BLATHER(("event %d at %.4f seconds", i, sec));
+ }
+ test_timeval_diff_eq(&starttime, &times[0], 100);
+ test_timeval_diff_eq(&starttime, &times[1], 200);
+ test_timeval_diff_eq(&starttime, &times[2], 400);
+ test_timeval_diff_eq(&starttime, &times[3], 450);
+ test_timeval_diff_eq(&starttime, &times[4], 500);
+ test_timeval_diff_eq(&starttime, &endtime, 500);
+
+end:
+ ;
+}
+
+#define TEST(name) \
+ { #name, thread_##name, TT_FORK|TT_NEED_THREADS|TT_NEED_BASE, \
+ &basic_setup, NULL }
+
+struct testcase_t thread_testcases[] = {
+ { "basic", thread_basic, TT_FORK|TT_NEED_THREADS|TT_NEED_BASE,
+ &basic_setup, NULL },
+#ifndef _WIN32
+ { "forking", thread_basic, TT_FORK|TT_NEED_THREADS|TT_NEED_BASE,
+ &basic_setup, (char*)"forking" },
+#endif
+ TEST(conditions_simple),
+ { "deferred_cb_skew", thread_deferred_cb_skew,
+ TT_FORK|TT_NEED_THREADS|TT_OFF_BY_DEFAULT,
+ &basic_setup, NULL },
+#ifndef _WIN32
+ /****** XXX TODO FIXME windows seems to be having some timing trouble,
+ * looking into it now. / ellzey
+ ******/
+ TEST(no_events),
+#endif
+ END_OF_TESTCASES
+};
+
diff --git a/protocols/Telegram/tgl/libevent/test/regress_thread.h b/protocols/Telegram/tgl/libevent/test/regress_thread.h
new file mode 100644
index 0000000000..831b51e507
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_thread.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+
+#ifndef REGRESS_THREAD_H_INCLUDED_
+#define REGRESS_THREAD_H_INCLUDED_
+
+#ifdef EVENT__HAVE_PTHREADS
+#define THREAD_T pthread_t
+#define THREAD_FN void *
+#define THREAD_RETURN() return (NULL)
+#define THREAD_START(threadvar, fn, arg) \
+ pthread_create(&(threadvar), NULL, fn, arg)
+#define THREAD_JOIN(th) pthread_join(th, NULL)
+#else
+#define THREAD_T HANDLE
+#define THREAD_FN unsigned __stdcall
+#define THREAD_RETURN() return (0)
+#define THREAD_START(threadvar, fn, arg) do { \
+ uintptr_t threadhandle = _beginthreadex(NULL,0,fn,(arg),0,NULL); \
+ (threadvar) = (HANDLE) threadhandle; \
+ } while (0)
+#define THREAD_JOIN(th) WaitForSingleObject(th, INFINITE)
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/libevent/test/regress_thread.obj b/protocols/Telegram/tgl/libevent/test/regress_thread.obj
new file mode 100644
index 0000000000..9654fe8ddb
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_thread.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/regress_util.c b/protocols/Telegram/tgl/libevent/test/regress_util.c
new file mode 100644
index 0000000000..60f085bf1d
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_util.c
@@ -0,0 +1,1413 @@
+/*
+ * Copyright (c) 2009-2012 Nick Mathewson and Niels Provos
+ *
+ * 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 "../util-internal.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#include <ws2tcpip.h>
+#endif
+
+#include "event2/event-config.h"
+
+#include <sys/types.h>
+
+#ifndef _WIN32
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <unistd.h>
+#endif
+#ifdef EVENT__HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+#ifdef EVENT__HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "event2/event.h"
+#include "event2/util.h"
+#include "../ipv6-internal.h"
+#include "../log-internal.h"
+#include "../strlcpy-internal.h"
+#include "../mm-internal.h"
+#include "../time-internal.h"
+
+#include "regress.h"
+
+enum entry_status { NORMAL, CANONICAL, BAD };
+
+/* This is a big table of results we expect from generating and parsing */
+static struct ipv4_entry {
+ const char *addr;
+ ev_uint32_t res;
+ enum entry_status status;
+} ipv4_entries[] = {
+ { "1.2.3.4", 0x01020304u, CANONICAL },
+ { "255.255.255.255", 0xffffffffu, CANONICAL },
+ { "256.0.0.0", 0, BAD },
+ { "ABC", 0, BAD },
+ { "1.2.3.4.5", 0, BAD },
+ { "176.192.208.244", 0xb0c0d0f4, CANONICAL },
+ { NULL, 0, BAD },
+};
+
+static struct ipv6_entry {
+ const char *addr;
+ ev_uint32_t res[4];
+ enum entry_status status;
+} ipv6_entries[] = {
+ { "::", { 0, 0, 0, 0, }, CANONICAL },
+ { "0:0:0:0:0:0:0:0", { 0, 0, 0, 0, }, NORMAL },
+ { "::1", { 0, 0, 0, 1, }, CANONICAL },
+ { "::1.2.3.4", { 0, 0, 0, 0x01020304, }, CANONICAL },
+ { "ffff:1::", { 0xffff0001u, 0, 0, 0, }, CANONICAL },
+ { "ffff:0000::", { 0xffff0000u, 0, 0, 0, }, NORMAL },
+ { "ffff::1234", { 0xffff0000u, 0, 0, 0x1234, }, CANONICAL },
+ { "0102::1.2.3.4", {0x01020000u, 0, 0, 0x01020304u }, NORMAL },
+ { "::9:c0a8:1:1", { 0, 0, 0x0009c0a8u, 0x00010001u }, CANONICAL },
+ { "::ffff:1.2.3.4", { 0, 0, 0x000ffffu, 0x01020304u }, CANONICAL },
+ { "FFFF::", { 0xffff0000u, 0, 0, 0 }, NORMAL },
+ { "foobar.", { 0, 0, 0, 0 }, BAD },
+ { "foobar", { 0, 0, 0, 0 }, BAD },
+ { "fo:obar", { 0, 0, 0, 0 }, BAD },
+ { "ffff", { 0, 0, 0, 0 }, BAD },
+ { "fffff::", { 0, 0, 0, 0 }, BAD },
+ { "fffff::", { 0, 0, 0, 0 }, BAD },
+ { "::1.0.1.1000", { 0, 0, 0, 0 }, BAD },
+ { "1:2:33333:4::", { 0, 0, 0, 0 }, BAD },
+ { "1:2:3:4:5:6:7:8:9", { 0, 0, 0, 0 }, BAD },
+ { "1::2::3", { 0, 0, 0, 0 }, BAD },
+ { ":::1", { 0, 0, 0, 0 }, BAD },
+ { NULL, { 0, 0, 0, 0, }, BAD },
+};
+
+static void
+regress_ipv4_parse(void *ptr)
+{
+ int i;
+ for (i = 0; ipv4_entries[i].addr; ++i) {
+ char written[128];
+ struct ipv4_entry *ent = &ipv4_entries[i];
+ struct in_addr in;
+ int r;
+ r = evutil_inet_pton(AF_INET, ent->addr, &in);
+ if (r == 0) {
+ if (ent->status != BAD) {
+ TT_FAIL(("%s did not parse, but it's a good address!",
+ ent->addr));
+ }
+ continue;
+ }
+ if (ent->status == BAD) {
+ TT_FAIL(("%s parsed, but we expected an error", ent->addr));
+ continue;
+ }
+ if (ntohl(in.s_addr) != ent->res) {
+ TT_FAIL(("%s parsed to %lx, but we expected %lx", ent->addr,
+ (unsigned long)ntohl(in.s_addr),
+ (unsigned long)ent->res));
+ continue;
+ }
+ if (ent->status == CANONICAL) {
+ const char *w = evutil_inet_ntop(AF_INET, &in, written,
+ sizeof(written));
+ if (!w) {
+ TT_FAIL(("Tried to write out %s; got NULL.", ent->addr));
+ continue;
+ }
+ if (strcmp(written, ent->addr)) {
+ TT_FAIL(("Tried to write out %s; got %s",
+ ent->addr, written));
+ continue;
+ }
+ }
+
+ }
+
+}
+
+static void
+regress_ipv6_parse(void *ptr)
+{
+#ifdef AF_INET6
+ int i, j;
+
+ for (i = 0; ipv6_entries[i].addr; ++i) {
+ char written[128];
+ struct ipv6_entry *ent = &ipv6_entries[i];
+ struct in6_addr in6;
+ int r;
+ r = evutil_inet_pton(AF_INET6, ent->addr, &in6);
+ if (r == 0) {
+ if (ent->status != BAD)
+ TT_FAIL(("%s did not parse, but it's a good address!",
+ ent->addr));
+ continue;
+ }
+ if (ent->status == BAD) {
+ TT_FAIL(("%s parsed, but we expected an error", ent->addr));
+ continue;
+ }
+ for (j = 0; j < 4; ++j) {
+ /* Can't use s6_addr32 here; some don't have it. */
+ ev_uint32_t u =
+ ((ev_uint32_t)in6.s6_addr[j*4 ] << 24) |
+ ((ev_uint32_t)in6.s6_addr[j*4+1] << 16) |
+ ((ev_uint32_t)in6.s6_addr[j*4+2] << 8) |
+ ((ev_uint32_t)in6.s6_addr[j*4+3]);
+ if (u != ent->res[j]) {
+ TT_FAIL(("%s did not parse as expected.", ent->addr));
+ continue;
+ }
+ }
+ if (ent->status == CANONICAL) {
+ const char *w = evutil_inet_ntop(AF_INET6, &in6, written,
+ sizeof(written));
+ if (!w) {
+ TT_FAIL(("Tried to write out %s; got NULL.", ent->addr));
+ continue;
+ }
+ if (strcmp(written, ent->addr)) {
+ TT_FAIL(("Tried to write out %s; got %s", ent->addr, written));
+ continue;
+ }
+ }
+
+ }
+#else
+ TT_BLATHER(("Skipping IPv6 address parsing."));
+#endif
+}
+
+static struct sa_port_ent {
+ const char *parse;
+ int safamily;
+ const char *addr;
+ int port;
+} sa_port_ents[] = {
+ { "[ffff::1]:1000", AF_INET6, "ffff::1", 1000 },
+ { "[ffff::1]", AF_INET6, "ffff::1", 0 },
+ { "[ffff::1", 0, NULL, 0 },
+ { "[ffff::1]:65599", 0, NULL, 0 },
+ { "[ffff::1]:0", 0, NULL, 0 },
+ { "[ffff::1]:-1", 0, NULL, 0 },
+ { "::1", AF_INET6, "::1", 0 },
+ { "1:2::1", AF_INET6, "1:2::1", 0 },
+ { "192.168.0.1:50", AF_INET, "192.168.0.1", 50 },
+ { "1.2.3.4", AF_INET, "1.2.3.4", 0 },
+ { NULL, 0, NULL, 0 },
+};
+
+static void
+regress_sockaddr_port_parse(void *ptr)
+{
+ struct sockaddr_storage ss;
+ int i, r;
+
+ for (i = 0; sa_port_ents[i].parse; ++i) {
+ struct sa_port_ent *ent = &sa_port_ents[i];
+ int len = sizeof(ss);
+ memset(&ss, 0, sizeof(ss));
+ r = evutil_parse_sockaddr_port(ent->parse, (struct sockaddr*)&ss, &len);
+ if (r < 0) {
+ if (ent->safamily)
+ TT_FAIL(("Couldn't parse %s!", ent->parse));
+ continue;
+ } else if (! ent->safamily) {
+ TT_FAIL(("Shouldn't have been able to parse %s!", ent->parse));
+ continue;
+ }
+ if (ent->safamily == AF_INET) {
+ struct sockaddr_in sin;
+ memset(&sin, 0, sizeof(sin));
+#ifdef EVENT__HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
+ sin.sin_len = sizeof(sin);
+#endif
+ sin.sin_family = AF_INET;
+ sin.sin_port = htons(ent->port);
+ r = evutil_inet_pton(AF_INET, ent->addr, &sin.sin_addr);
+ if (1 != r) {
+ TT_FAIL(("Couldn't parse ipv4 target %s.", ent->addr));
+ } else if (memcmp(&sin, &ss, sizeof(sin))) {
+ TT_FAIL(("Parse for %s was not as expected.", ent->parse));
+ } else if (len != sizeof(sin)) {
+ TT_FAIL(("Length for %s not as expected.",ent->parse));
+ }
+ } else {
+ struct sockaddr_in6 sin6;
+ memset(&sin6, 0, sizeof(sin6));
+#ifdef EVENT__HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN
+ sin6.sin6_len = sizeof(sin6);
+#endif
+ sin6.sin6_family = AF_INET6;
+ sin6.sin6_port = htons(ent->port);
+ r = evutil_inet_pton(AF_INET6, ent->addr, &sin6.sin6_addr);
+ if (1 != r) {
+ TT_FAIL(("Couldn't parse ipv6 target %s.", ent->addr));
+ } else if (memcmp(&sin6, &ss, sizeof(sin6))) {
+ TT_FAIL(("Parse for %s was not as expected.", ent->parse));
+ } else if (len != sizeof(sin6)) {
+ TT_FAIL(("Length for %s not as expected.",ent->parse));
+ }
+ }
+ }
+}
+
+
+static void
+regress_sockaddr_port_format(void *ptr)
+{
+ struct sockaddr_storage ss;
+ int len;
+ const char *cp;
+ char cbuf[128];
+ int r;
+
+ len = sizeof(ss);
+ r = evutil_parse_sockaddr_port("192.168.1.1:80",
+ (struct sockaddr*)&ss, &len);
+ tt_int_op(r,==,0);
+ cp = evutil_format_sockaddr_port_(
+ (struct sockaddr*)&ss, cbuf, sizeof(cbuf));
+ tt_ptr_op(cp,==,cbuf);
+ tt_str_op(cp,==,"192.168.1.1:80");
+
+ len = sizeof(ss);
+ r = evutil_parse_sockaddr_port("[ff00::8010]:999",
+ (struct sockaddr*)&ss, &len);
+ tt_int_op(r,==,0);
+ cp = evutil_format_sockaddr_port_(
+ (struct sockaddr*)&ss, cbuf, sizeof(cbuf));
+ tt_ptr_op(cp,==,cbuf);
+ tt_str_op(cp,==,"[ff00::8010]:999");
+
+ ss.ss_family=99;
+ cp = evutil_format_sockaddr_port_(
+ (struct sockaddr*)&ss, cbuf, sizeof(cbuf));
+ tt_ptr_op(cp,==,cbuf);
+ tt_str_op(cp,==,"<addr with socktype 99>");
+end:
+ ;
+}
+
+static struct sa_pred_ent {
+ const char *parse;
+
+ int is_loopback;
+} sa_pred_entries[] = {
+ { "127.0.0.1", 1 },
+ { "127.0.3.2", 1 },
+ { "128.1.2.3", 0 },
+ { "18.0.0.1", 0 },
+ { "129.168.1.1", 0 },
+
+ { "::1", 1 },
+ { "::0", 0 },
+ { "f::1", 0 },
+ { "::501", 0 },
+ { NULL, 0 },
+
+};
+
+static void
+test_evutil_sockaddr_predicates(void *ptr)
+{
+ struct sockaddr_storage ss;
+ int r, i;
+
+ for (i=0; sa_pred_entries[i].parse; ++i) {
+ struct sa_pred_ent *ent = &sa_pred_entries[i];
+ int len = sizeof(ss);
+
+ r = evutil_parse_sockaddr_port(ent->parse, (struct sockaddr*)&ss, &len);
+
+ if (r<0) {
+ TT_FAIL(("Couldn't parse %s!", ent->parse));
+ continue;
+ }
+
+ /* sockaddr_is_loopback */
+ if (ent->is_loopback != evutil_sockaddr_is_loopback_((struct sockaddr*)&ss)) {
+ TT_FAIL(("evutil_sockaddr_loopback(%s) not as expected",
+ ent->parse));
+ }
+ }
+}
+
+static void
+test_evutil_strtoll(void *ptr)
+{
+ const char *s;
+ char *endptr;
+
+ tt_want(evutil_strtoll("5000000000", NULL, 10) ==
+ ((ev_int64_t)5000000)*1000);
+ tt_want(evutil_strtoll("-5000000000", NULL, 10) ==
+ ((ev_int64_t)5000000)*-1000);
+ s = " 99999stuff";
+ tt_want(evutil_strtoll(s, &endptr, 10) == (ev_int64_t)99999);
+ tt_want(endptr == s+6);
+ tt_want(evutil_strtoll("foo", NULL, 10) == 0);
+ }
+
+static void
+test_evutil_snprintf(void *ptr)
+{
+ char buf[16];
+ int r;
+ ev_uint64_t u64 = ((ev_uint64_t)1000000000)*200;
+ ev_int64_t i64 = -1 * (ev_int64_t) u64;
+ size_t size = 8000;
+ ev_ssize_t ssize = -9000;
+
+ r = evutil_snprintf(buf, sizeof(buf), "%d %d", 50, 100);
+ tt_str_op(buf, ==, "50 100");
+ tt_int_op(r, ==, 6);
+
+ r = evutil_snprintf(buf, sizeof(buf), "longish %d", 1234567890);
+ tt_str_op(buf, ==, "longish 1234567");
+ tt_int_op(r, ==, 18);
+
+ r = evutil_snprintf(buf, sizeof(buf), EV_U64_FMT, EV_U64_ARG(u64));
+ tt_str_op(buf, ==, "200000000000");
+ tt_int_op(r, ==, 12);
+
+ r = evutil_snprintf(buf, sizeof(buf), EV_I64_FMT, EV_I64_ARG(i64));
+ tt_str_op(buf, ==, "-200000000000");
+ tt_int_op(r, ==, 13);
+
+ r = evutil_snprintf(buf, sizeof(buf), EV_SIZE_FMT" "EV_SSIZE_FMT,
+ EV_SIZE_ARG(size), EV_SSIZE_ARG(ssize));
+ tt_str_op(buf, ==, "8000 -9000");
+ tt_int_op(r, ==, 10);
+
+ end:
+ ;
+}
+
+static void
+test_evutil_casecmp(void *ptr)
+{
+ tt_int_op(evutil_ascii_strcasecmp("ABC", "ABC"), ==, 0);
+ tt_int_op(evutil_ascii_strcasecmp("ABC", "abc"), ==, 0);
+ tt_int_op(evutil_ascii_strcasecmp("ABC", "abcd"), <, 0);
+ tt_int_op(evutil_ascii_strcasecmp("ABC", "abb"), >, 0);
+ tt_int_op(evutil_ascii_strcasecmp("ABCd", "abc"), >, 0);
+
+ tt_int_op(evutil_ascii_strncasecmp("Libevent", "LibEvEnT", 100), ==, 0);
+ tt_int_op(evutil_ascii_strncasecmp("Libevent", "LibEvEnT", 4), ==, 0);
+ tt_int_op(evutil_ascii_strncasecmp("Libevent", "LibEXXXX", 4), ==, 0);
+ tt_int_op(evutil_ascii_strncasecmp("Libevent", "LibE", 4), ==, 0);
+ tt_int_op(evutil_ascii_strncasecmp("Libe", "LibEvEnT", 4), ==, 0);
+ tt_int_op(evutil_ascii_strncasecmp("Lib", "LibEvEnT", 4), <, 0);
+ tt_int_op(evutil_ascii_strncasecmp("abc", "def", 99), <, 0);
+ tt_int_op(evutil_ascii_strncasecmp("Z", "qrst", 1), >, 0);
+end:
+ ;
+}
+
+static void
+test_evutil_rtrim(void *ptr)
+{
+#define TEST_TRIM(s, result) \
+ do { \
+ if (cp) mm_free(cp); \
+ cp = mm_strdup(s); \
+ tt_assert(cp); \
+ evutil_rtrim_lws_(cp); \
+ tt_str_op(cp, ==, result); \
+ } while(0)
+
+ char *cp = NULL;
+ (void) ptr;
+
+ TEST_TRIM("", "");
+ TEST_TRIM("a", "a");
+ TEST_TRIM("abcdef ghi", "abcdef ghi");
+
+ TEST_TRIM(" ", "");
+ TEST_TRIM(" ", "");
+ TEST_TRIM("a ", "a");
+ TEST_TRIM("abcdef gH ", "abcdef gH");
+
+ TEST_TRIM("\t\t", "");
+ TEST_TRIM(" \t", "");
+ TEST_TRIM("\t", "");
+ TEST_TRIM("a \t", "a");
+ TEST_TRIM("a\t ", "a");
+ TEST_TRIM("a\t", "a");
+ TEST_TRIM("abcdef gH \t ", "abcdef gH");
+
+end:
+ if (cp)
+ mm_free(cp);
+}
+
+static int logsev = 0;
+static char *logmsg = NULL;
+
+static void
+logfn(int severity, const char *msg)
+{
+ logsev = severity;
+ tt_want(msg);
+ if (msg) {
+ if (logmsg)
+ free(logmsg);
+ logmsg = strdup(msg);
+ }
+}
+
+static int fatal_want_severity = 0;
+static const char *fatal_want_message = NULL;
+static void
+fatalfn(int exitcode)
+{
+ if (logsev != fatal_want_severity ||
+ !logmsg ||
+ strcmp(logmsg, fatal_want_message))
+ exit(0);
+ else
+ exit(exitcode);
+}
+
+#ifndef _WIN32
+#define CAN_CHECK_ERR
+static void
+check_error_logging(void (*fn)(void), int wantexitcode,
+ int wantseverity, const char *wantmsg)
+{
+ pid_t pid;
+ int status = 0, exitcode;
+ fatal_want_severity = wantseverity;
+ fatal_want_message = wantmsg;
+ if ((pid = regress_fork()) == 0) {
+ /* child process */
+ fn();
+ exit(0); /* should be unreachable. */
+ } else {
+ wait(&status);
+ exitcode = WEXITSTATUS(status);
+ tt_int_op(wantexitcode, ==, exitcode);
+ }
+end:
+ ;
+}
+
+static void
+errx_fn(void)
+{
+ event_errx(2, "Fatal error; too many kumquats (%d)", 5);
+}
+
+static void
+err_fn(void)
+{
+ errno = ENOENT;
+ event_err(5,"Couldn't open %s", "/very/bad/file");
+}
+
+static void
+sock_err_fn(void)
+{
+ evutil_socket_t fd = socket(AF_INET, SOCK_STREAM, 0);
+#ifdef _WIN32
+ EVUTIL_SET_SOCKET_ERROR(WSAEWOULDBLOCK);
+#else
+ errno = EAGAIN;
+#endif
+ event_sock_err(20, fd, "Unhappy socket");
+}
+#endif
+
+static void
+test_evutil_log(void *ptr)
+{
+ evutil_socket_t fd = -1;
+ char buf[128];
+
+ event_set_log_callback(logfn);
+ event_set_fatal_callback(fatalfn);
+#define RESET() do { \
+ logsev = 0; \
+ if (logmsg) free(logmsg); \
+ logmsg = NULL; \
+ } while (0)
+#define LOGEQ(sev,msg) do { \
+ tt_int_op(logsev,==,sev); \
+ tt_assert(logmsg != NULL); \
+ tt_str_op(logmsg,==,msg); \
+ } while (0)
+
+#ifdef CAN_CHECK_ERR
+ /* We need to disable these tests for now. Previously, the logging
+ * module didn't enforce the requirement that a fatal callback
+ * actually exit. Now, it exits no matter what, so if we wan to
+ * reinstate these tests, we'll need to fork for each one. */
+ check_error_logging(errx_fn, 2, EVENT_LOG_ERR,
+ "Fatal error; too many kumquats (5)");
+ RESET();
+#endif
+
+ event_warnx("Far too many %s (%d)", "wombats", 99);
+ LOGEQ(EVENT_LOG_WARN, "Far too many wombats (99)");
+ RESET();
+
+ event_msgx("Connecting lime to coconut");
+ LOGEQ(EVENT_LOG_MSG, "Connecting lime to coconut");
+ RESET();
+
+ event_debug(("A millisecond passed! We should log that!"));
+#ifdef USE_DEBUG
+ LOGEQ(EVENT_LOG_DEBUG, "A millisecond passed! We should log that!");
+#else
+ tt_int_op(logsev,==,0);
+ tt_ptr_op(logmsg,==,NULL);
+#endif
+ RESET();
+
+ /* Try with an errno. */
+ errno = ENOENT;
+ event_warn("Couldn't open %s", "/bad/file");
+ evutil_snprintf(buf, sizeof(buf),
+ "Couldn't open /bad/file: %s",strerror(ENOENT));
+ LOGEQ(EVENT_LOG_WARN,buf);
+ RESET();
+
+#ifdef CAN_CHECK_ERR
+ evutil_snprintf(buf, sizeof(buf),
+ "Couldn't open /very/bad/file: %s",strerror(ENOENT));
+ check_error_logging(err_fn, 5, EVENT_LOG_ERR, buf);
+ RESET();
+#endif
+
+ /* Try with a socket errno. */
+ fd = socket(AF_INET, SOCK_STREAM, 0);
+#ifdef _WIN32
+ evutil_snprintf(buf, sizeof(buf),
+ "Unhappy socket: %s",
+ evutil_socket_error_to_string(WSAEWOULDBLOCK));
+ EVUTIL_SET_SOCKET_ERROR(WSAEWOULDBLOCK);
+#else
+ evutil_snprintf(buf, sizeof(buf),
+ "Unhappy socket: %s", strerror(EAGAIN));
+ errno = EAGAIN;
+#endif
+ event_sock_warn(fd, "Unhappy socket");
+ LOGEQ(EVENT_LOG_WARN, buf);
+ RESET();
+
+#ifdef CAN_CHECK_ERR
+ check_error_logging(sock_err_fn, 20, EVENT_LOG_ERR, buf);
+ RESET();
+#endif
+
+#undef RESET
+#undef LOGEQ
+end:
+ if (logmsg)
+ free(logmsg);
+ if (fd >= 0)
+ evutil_closesocket(fd);
+}
+
+static void
+test_evutil_strlcpy(void *arg)
+{
+ char buf[8];
+
+ /* Successful case. */
+ tt_int_op(5, ==, strlcpy(buf, "Hello", sizeof(buf)));
+ tt_str_op(buf, ==, "Hello");
+
+ /* Overflow by a lot. */
+ tt_int_op(13, ==, strlcpy(buf, "pentasyllabic", sizeof(buf)));
+ tt_str_op(buf, ==, "pentasy");
+
+ /* Overflow by exactly one. */
+ tt_int_op(8, ==, strlcpy(buf, "overlong", sizeof(buf)));
+ tt_str_op(buf, ==, "overlon");
+end:
+ ;
+}
+
+struct example_struct {
+ const char *a;
+ const char *b;
+ long c;
+};
+
+static void
+test_evutil_upcast(void *arg)
+{
+ struct example_struct es1;
+ const char **cp;
+ es1.a = "World";
+ es1.b = "Hello";
+ es1.c = -99;
+
+ tt_int_op(evutil_offsetof(struct example_struct, b), ==, sizeof(char*));
+
+ cp = &es1.b;
+ tt_ptr_op(EVUTIL_UPCAST(cp, struct example_struct, b), ==, &es1);
+
+end:
+ ;
+}
+
+static void
+test_evutil_integers(void *arg)
+{
+ ev_int64_t i64;
+ ev_uint64_t u64;
+ ev_int32_t i32;
+ ev_uint32_t u32;
+ ev_int16_t i16;
+ ev_uint16_t u16;
+ ev_int8_t i8;
+ ev_uint8_t u8;
+
+ void *ptr;
+ ev_intptr_t iptr;
+ ev_uintptr_t uptr;
+
+ ev_ssize_t ssize;
+
+ tt_int_op(sizeof(u64), ==, 8);
+ tt_int_op(sizeof(i64), ==, 8);
+ tt_int_op(sizeof(u32), ==, 4);
+ tt_int_op(sizeof(i32), ==, 4);
+ tt_int_op(sizeof(u16), ==, 2);
+ tt_int_op(sizeof(i16), ==, 2);
+ tt_int_op(sizeof(u8), ==, 1);
+ tt_int_op(sizeof(i8), ==, 1);
+
+ tt_int_op(sizeof(ev_ssize_t), ==, sizeof(size_t));
+ tt_int_op(sizeof(ev_intptr_t), >=, sizeof(void *));
+ tt_int_op(sizeof(ev_uintptr_t), ==, sizeof(intptr_t));
+
+ u64 = 1000000000;
+ u64 *= 1000000000;
+ tt_assert(u64 / 1000000000 == 1000000000);
+ i64 = -1000000000;
+ i64 *= 1000000000;
+ tt_assert(i64 / 1000000000 == -1000000000);
+
+ u64 = EV_UINT64_MAX;
+ i64 = EV_INT64_MAX;
+ tt_assert(u64 > 0);
+ tt_assert(i64 > 0);
+ u64++;
+/* i64++; */
+ tt_assert(u64 == 0);
+/* tt_assert(i64 == EV_INT64_MIN); */
+/* tt_assert(i64 < 0); */
+
+ u32 = EV_UINT32_MAX;
+ i32 = EV_INT32_MAX;
+ tt_assert(u32 > 0);
+ tt_assert(i32 > 0);
+ u32++;
+/* i32++; */
+ tt_assert(u32 == 0);
+/* tt_assert(i32 == EV_INT32_MIN); */
+/* tt_assert(i32 < 0); */
+
+ u16 = EV_UINT16_MAX;
+ i16 = EV_INT16_MAX;
+ tt_assert(u16 > 0);
+ tt_assert(i16 > 0);
+ u16++;
+/* i16++; */
+ tt_assert(u16 == 0);
+/* tt_assert(i16 == EV_INT16_MIN); */
+/* tt_assert(i16 < 0); */
+
+ u8 = EV_UINT8_MAX;
+ i8 = EV_INT8_MAX;
+ tt_assert(u8 > 0);
+ tt_assert(i8 > 0);
+ u8++;
+/* i8++;*/
+ tt_assert(u8 == 0);
+/* tt_assert(i8 == EV_INT8_MIN); */
+/* tt_assert(i8 < 0); */
+
+/*
+ ssize = EV_SSIZE_MAX;
+ tt_assert(ssize > 0);
+ ssize++;
+ tt_assert(ssize < 0);
+ tt_assert(ssize == EV_SSIZE_MIN);
+*/
+
+ ptr = &ssize;
+ iptr = (ev_intptr_t)ptr;
+ uptr = (ev_uintptr_t)ptr;
+ ptr = (void *)iptr;
+ tt_assert(ptr == &ssize);
+ ptr = (void *)uptr;
+ tt_assert(ptr == &ssize);
+
+ iptr = -1;
+ tt_assert(iptr < 0);
+end:
+ ;
+}
+
+struct evutil_addrinfo *
+ai_find_by_family(struct evutil_addrinfo *ai, int family)
+{
+ while (ai) {
+ if (ai->ai_family == family)
+ return ai;
+ ai = ai->ai_next;
+ }
+ return NULL;
+}
+
+struct evutil_addrinfo *
+ai_find_by_protocol(struct evutil_addrinfo *ai, int protocol)
+{
+ while (ai) {
+ if (ai->ai_protocol == protocol)
+ return ai;
+ ai = ai->ai_next;
+ }
+ return NULL;
+}
+
+
+int
+test_ai_eq_(const struct evutil_addrinfo *ai, const char *sockaddr_port,
+ int socktype, int protocol, int line)
+{
+ struct sockaddr_storage ss;
+ int slen = sizeof(ss);
+ int gotport;
+ char buf[128];
+ memset(&ss, 0, sizeof(ss));
+ if (socktype > 0)
+ tt_int_op(ai->ai_socktype, ==, socktype);
+ if (protocol > 0)
+ tt_int_op(ai->ai_protocol, ==, protocol);
+
+ if (evutil_parse_sockaddr_port(
+ sockaddr_port, (struct sockaddr*)&ss, &slen)<0) {
+ TT_FAIL(("Couldn't parse expected address %s on line %d",
+ sockaddr_port, line));
+ return -1;
+ }
+ if (ai->ai_family != ss.ss_family) {
+ TT_FAIL(("Address family %d did not match %d on line %d",
+ ai->ai_family, ss.ss_family, line));
+ return -1;
+ }
+ if (ai->ai_addr->sa_family == AF_INET) {
+ struct sockaddr_in *sin = (struct sockaddr_in*)ai->ai_addr;
+ evutil_inet_ntop(AF_INET, &sin->sin_addr, buf, sizeof(buf));
+ gotport = ntohs(sin->sin_port);
+ if (ai->ai_addrlen != sizeof(struct sockaddr_in)) {
+ TT_FAIL(("Addr size mismatch on line %d", line));
+ return -1;
+ }
+ } else {
+ struct sockaddr_in6 *sin6 = (struct sockaddr_in6*)ai->ai_addr;
+ evutil_inet_ntop(AF_INET6, &sin6->sin6_addr, buf, sizeof(buf));
+ gotport = ntohs(sin6->sin6_port);
+ if (ai->ai_addrlen != sizeof(struct sockaddr_in6)) {
+ TT_FAIL(("Addr size mismatch on line %d", line));
+ return -1;
+ }
+ }
+ if (evutil_sockaddr_cmp(ai->ai_addr, (struct sockaddr*)&ss, 1)) {
+ TT_FAIL(("Wanted %s, got %s:%d on line %d", sockaddr_port,
+ buf, gotport, line));
+ return -1;
+ } else {
+ TT_BLATHER(("Wanted %s, got %s:%d on line %d", sockaddr_port,
+ buf, gotport, line));
+ }
+ return 0;
+end:
+ TT_FAIL(("Test failed on line %d", line));
+ return -1;
+}
+
+static void
+test_evutil_rand(void *arg)
+{
+ char buf1[32];
+ char buf2[32];
+ int counts[256];
+ int i, j, k, n=0;
+ struct evutil_weakrand_state seed = { 12346789U };
+
+ memset(buf2, 0, sizeof(buf2));
+ memset(counts, 0, sizeof(counts));
+
+ for (k=0;k<32;++k) {
+ /* Try a few different start and end points; try to catch
+ * the various misaligned cases of arc4random_buf */
+ int startpoint = evutil_weakrand_(&seed) % 4;
+ int endpoint = 32 - (evutil_weakrand_(&seed) % 4);
+
+ memset(buf2, 0, sizeof(buf2));
+
+ /* Do 6 runs over buf1, or-ing the result into buf2 each
+ * time, to make sure we're setting each byte that we mean
+ * to set. */
+ for (i=0;i<8;++i) {
+ memset(buf1, 0, sizeof(buf1));
+ evutil_secure_rng_get_bytes(buf1 + startpoint,
+ endpoint-startpoint);
+ n += endpoint - startpoint;
+ for (j=0; j<32; ++j) {
+ if (j >= startpoint && j < endpoint) {
+ buf2[j] |= buf1[j];
+ ++counts[(unsigned char)buf1[j]];
+ } else {
+ tt_assert(buf1[j] == 0);
+ tt_int_op(buf1[j], ==, 0);
+
+ }
+ }
+ }
+
+ /* This will give a false positive with P=(256**8)==(2**64)
+ * for each character. */
+ for (j=startpoint;j<endpoint;++j) {
+ tt_int_op(buf2[j], !=, 0);
+ }
+ }
+
+ evutil_weakrand_seed_(&seed, 0);
+ for (i = 0; i < 10000; ++i) {
+ ev_int32_t r = evutil_weakrand_range_(&seed, 9999);
+ tt_int_op(0, <=, r);
+ tt_int_op(r, <, 9999);
+ }
+
+ /* for (i=0;i<256;++i) { printf("%3d %2d\n", i, counts[i]); } */
+end:
+ ;
+}
+
+static void
+test_evutil_getaddrinfo(void *arg)
+{
+ struct evutil_addrinfo *ai = NULL, *a;
+ struct evutil_addrinfo hints;
+ int r;
+
+ /* Try using it as a pton. */
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ r = evutil_getaddrinfo("1.2.3.4", "8080", &hints, &ai);
+ tt_int_op(r, ==, 0);
+ tt_assert(ai);
+ tt_ptr_op(ai->ai_next, ==, NULL); /* no ambiguity */
+ test_ai_eq(ai, "1.2.3.4:8080", SOCK_STREAM, IPPROTO_TCP);
+ evutil_freeaddrinfo(ai);
+ ai = NULL;
+
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_protocol = IPPROTO_UDP;
+ r = evutil_getaddrinfo("1001:b0b::f00f", "4321", &hints, &ai);
+ tt_int_op(r, ==, 0);
+ tt_assert(ai);
+ tt_ptr_op(ai->ai_next, ==, NULL); /* no ambiguity */
+ test_ai_eq(ai, "[1001:b0b::f00f]:4321", SOCK_DGRAM, IPPROTO_UDP);
+ evutil_freeaddrinfo(ai);
+ ai = NULL;
+
+ /* Try out the behavior of nodename=NULL */
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_INET;
+ hints.ai_protocol = IPPROTO_TCP;
+ hints.ai_flags = EVUTIL_AI_PASSIVE; /* as if for bind */
+ r = evutil_getaddrinfo(NULL, "9999", &hints, &ai);
+ tt_int_op(r,==,0);
+ tt_assert(ai);
+ tt_ptr_op(ai->ai_next, ==, NULL);
+ test_ai_eq(ai, "0.0.0.0:9999", SOCK_STREAM, IPPROTO_TCP);
+ evutil_freeaddrinfo(ai);
+ ai = NULL;
+ hints.ai_flags = 0; /* as if for connect */
+ r = evutil_getaddrinfo(NULL, "9998", &hints, &ai);
+ tt_assert(ai);
+ tt_int_op(r,==,0);
+ test_ai_eq(ai, "127.0.0.1:9998", SOCK_STREAM, IPPROTO_TCP);
+ tt_ptr_op(ai->ai_next, ==, NULL);
+ evutil_freeaddrinfo(ai);
+ ai = NULL;
+
+ hints.ai_flags = 0; /* as if for connect */
+ hints.ai_family = PF_INET6;
+ r = evutil_getaddrinfo(NULL, "9997", &hints, &ai);
+ tt_assert(ai);
+ tt_int_op(r,==,0);
+ tt_ptr_op(ai->ai_next, ==, NULL);
+ test_ai_eq(ai, "[::1]:9997", SOCK_STREAM, IPPROTO_TCP);
+ evutil_freeaddrinfo(ai);
+ ai = NULL;
+
+ hints.ai_flags = EVUTIL_AI_PASSIVE; /* as if for bind. */
+ hints.ai_family = PF_INET6;
+ r = evutil_getaddrinfo(NULL, "9996", &hints, &ai);
+ tt_assert(ai);
+ tt_int_op(r,==,0);
+ tt_ptr_op(ai->ai_next, ==, NULL);
+ test_ai_eq(ai, "[::]:9996", SOCK_STREAM, IPPROTO_TCP);
+ evutil_freeaddrinfo(ai);
+ ai = NULL;
+
+ /* Now try an unspec one. We should get a v6 and a v4. */
+ hints.ai_family = PF_UNSPEC;
+ r = evutil_getaddrinfo(NULL, "9996", &hints, &ai);
+ tt_assert(ai);
+ tt_int_op(r,==,0);
+ a = ai_find_by_family(ai, PF_INET6);
+ tt_assert(a);
+ test_ai_eq(a, "[::]:9996", SOCK_STREAM, IPPROTO_TCP);
+ a = ai_find_by_family(ai, PF_INET);
+ tt_assert(a);
+ test_ai_eq(a, "0.0.0.0:9996", SOCK_STREAM, IPPROTO_TCP);
+ evutil_freeaddrinfo(ai);
+ ai = NULL;
+
+ /* Try out AI_NUMERICHOST: successful case. Also try
+ * multiprotocol. */
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_flags = EVUTIL_AI_NUMERICHOST;
+ r = evutil_getaddrinfo("1.2.3.4", NULL, &hints, &ai);
+ tt_int_op(r, ==, 0);
+ a = ai_find_by_protocol(ai, IPPROTO_TCP);
+ tt_assert(a);
+ test_ai_eq(a, "1.2.3.4", SOCK_STREAM, IPPROTO_TCP);
+ a = ai_find_by_protocol(ai, IPPROTO_UDP);
+ tt_assert(a);
+ test_ai_eq(a, "1.2.3.4", SOCK_DGRAM, IPPROTO_UDP);
+ evutil_freeaddrinfo(ai);
+ ai = NULL;
+
+ /* Try the failing case of AI_NUMERICHOST */
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_flags = EVUTIL_AI_NUMERICHOST;
+ r = evutil_getaddrinfo("www.google.com", "80", &hints, &ai);
+ tt_int_op(r, ==, EVUTIL_EAI_NONAME);
+ tt_ptr_op(ai, ==, NULL);
+
+ /* Try symbolic service names wit AI_NUMERICSERV */
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_flags = EVUTIL_AI_NUMERICSERV;
+ r = evutil_getaddrinfo("1.2.3.4", "http", &hints, &ai);
+ tt_int_op(r,==,EVUTIL_EAI_NONAME);
+
+ /* Try symbolic service names */
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ r = evutil_getaddrinfo("1.2.3.4", "http", &hints, &ai);
+ if (r!=0) {
+ TT_DECLARE("SKIP", ("Symbolic service names seem broken."));
+ } else {
+ tt_assert(ai);
+ test_ai_eq(ai, "1.2.3.4:80", SOCK_STREAM, IPPROTO_TCP);
+ evutil_freeaddrinfo(ai);
+ ai = NULL;
+ }
+
+end:
+ if (ai)
+ evutil_freeaddrinfo(ai);
+}
+
+static void
+test_evutil_getaddrinfo_live(void *arg)
+{
+ struct evutil_addrinfo *ai = NULL;
+ struct evutil_addrinfo hints;
+
+ struct sockaddr_in6 *sin6;
+ struct sockaddr_in *sin;
+ char buf[128];
+ const char *cp;
+ int r;
+
+ /* Now do some actual lookups. */
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_INET;
+ hints.ai_protocol = IPPROTO_TCP;
+ hints.ai_socktype = SOCK_STREAM;
+ r = evutil_getaddrinfo("www.google.com", "80", &hints, &ai);
+ if (r != 0) {
+ TT_DECLARE("SKIP", ("Couldn't resolve www.google.com"));
+ } else {
+ tt_assert(ai);
+ tt_int_op(ai->ai_family, ==, PF_INET);
+ tt_int_op(ai->ai_protocol, ==, IPPROTO_TCP);
+ tt_int_op(ai->ai_socktype, ==, SOCK_STREAM);
+ tt_int_op(ai->ai_addrlen, ==, sizeof(struct sockaddr_in));
+ sin = (struct sockaddr_in*)ai->ai_addr;
+ tt_int_op(sin->sin_family, ==, AF_INET);
+ tt_int_op(sin->sin_port, ==, htons(80));
+ tt_int_op(sin->sin_addr.s_addr, !=, 0xffffffff);
+
+ cp = evutil_inet_ntop(AF_INET, &sin->sin_addr, buf, sizeof(buf));
+ TT_BLATHER(("www.google.com resolved to %s",
+ cp?cp:"<unwriteable>"));
+ evutil_freeaddrinfo(ai);
+ ai = NULL;
+ }
+
+ hints.ai_family = PF_INET6;
+ r = evutil_getaddrinfo("ipv6.google.com", "80", &hints, &ai);
+ if (r != 0) {
+ TT_BLATHER(("Couldn't do an ipv6 lookup for ipv6.google.com"));
+ } else {
+ tt_assert(ai);
+ tt_int_op(ai->ai_family, ==, PF_INET6);
+ tt_int_op(ai->ai_addrlen, ==, sizeof(struct sockaddr_in6));
+ sin6 = (struct sockaddr_in6*)ai->ai_addr;
+ tt_int_op(sin6->sin6_port, ==, htons(80));
+
+ cp = evutil_inet_ntop(AF_INET6, &sin6->sin6_addr, buf,
+ sizeof(buf));
+ TT_BLATHER(("ipv6.google.com resolved to %s",
+ cp?cp:"<unwriteable>"));
+ }
+
+end:
+ if (ai)
+ evutil_freeaddrinfo(ai);
+}
+
+#ifdef _WIN32
+static void
+test_evutil_loadsyslib(void *arg)
+{
+ HMODULE h=NULL;
+
+ h = evutil_load_windows_system_library_(TEXT("kernel32.dll"));
+ tt_assert(h);
+
+end:
+ if (h)
+ CloseHandle(h);
+
+}
+#endif
+
+/** Test mm_malloc(). */
+static void
+test_event_malloc(void *arg)
+{
+ void *p = NULL;
+ (void)arg;
+
+ /* mm_malloc(0) should simply return NULL. */
+#ifndef EVENT__DISABLE_MM_REPLACEMENT
+ errno = 0;
+ p = mm_malloc(0);
+ tt_assert(p == NULL);
+ tt_int_op(errno, ==, 0);
+#endif
+
+ /* Trivial case. */
+ errno = 0;
+ p = mm_malloc(8);
+ tt_assert(p != NULL);
+ tt_int_op(errno, ==, 0);
+ mm_free(p);
+
+ end:
+ errno = 0;
+ return;
+}
+
+static void
+test_event_calloc(void *arg)
+{
+ void *p = NULL;
+ (void)arg;
+
+#ifndef EVENT__DISABLE_MM_REPLACEMENT
+ /* mm_calloc() should simply return NULL
+ * if either argument is zero. */
+ errno = 0;
+ p = mm_calloc(0, 0);
+ tt_assert(p == NULL);
+ tt_int_op(errno, ==, 0);
+ errno = 0;
+ p = mm_calloc(0, 1);
+ tt_assert(p == NULL);
+ tt_int_op(errno, ==, 0);
+ errno = 0;
+ p = mm_calloc(1, 0);
+ tt_assert(p == NULL);
+ tt_int_op(errno, ==, 0);
+#endif
+
+ /* Trivial case. */
+ errno = 0;
+ p = mm_calloc(8, 8);
+ tt_assert(p != NULL);
+ tt_int_op(errno, ==, 0);
+ mm_free(p);
+ p = NULL;
+
+ /* mm_calloc() should set errno = ENOMEM and return NULL
+ * in case of potential overflow. */
+ errno = 0;
+ p = mm_calloc(EV_SIZE_MAX/2, EV_SIZE_MAX/2 + 8);
+ tt_assert(p == NULL);
+ tt_int_op(errno, ==, ENOMEM);
+
+ end:
+ errno = 0;
+ if (p)
+ mm_free(p);
+
+ return;
+}
+
+static void
+test_event_strdup(void *arg)
+{
+ void *p = NULL;
+ (void)arg;
+
+#ifndef EVENT__DISABLE_MM_REPLACEMENT
+ /* mm_strdup(NULL) should set errno = EINVAL and return NULL. */
+ errno = 0;
+ p = mm_strdup(NULL);
+ tt_assert(p == NULL);
+ tt_int_op(errno, ==, EINVAL);
+#endif
+
+ /* Trivial cases. */
+
+ errno = 0;
+ p = mm_strdup("");
+ tt_assert(p != NULL);
+ tt_int_op(errno, ==, 0);
+ tt_str_op(p, ==, "");
+ mm_free(p);
+
+ errno = 0;
+ p = mm_strdup("foo");
+ tt_assert(p != NULL);
+ tt_int_op(errno, ==, 0);
+ tt_str_op(p, ==, "foo");
+ mm_free(p);
+
+ /* XXX
+ * mm_strdup(str) where str is a string of length EV_SIZE_MAX
+ * should set errno = ENOMEM and return NULL. */
+
+ end:
+ errno = 0;
+ return;
+}
+
+static void
+test_evutil_usleep(void *arg)
+{
+ struct timeval tv1, tv2, tv3, diff1, diff2;
+ const struct timeval quarter_sec = {0, 250*1000};
+ const struct timeval tenth_sec = {0, 100*1000};
+ long usec1, usec2;
+
+ evutil_gettimeofday(&tv1, NULL);
+ evutil_usleep_(&quarter_sec);
+ evutil_gettimeofday(&tv2, NULL);
+ evutil_usleep_(&tenth_sec);
+ evutil_gettimeofday(&tv3, NULL);
+
+ evutil_timersub(&tv2, &tv1, &diff1);
+ evutil_timersub(&tv3, &tv2, &diff2);
+ usec1 = diff1.tv_sec * 1000000 + diff1.tv_usec;
+ usec2 = diff2.tv_sec * 1000000 + diff2.tv_usec;
+
+ tt_int_op(usec1, >, 200000);
+ tt_int_op(usec1, <, 300000);
+ tt_int_op(usec2, >, 80000);
+ tt_int_op(usec2, <, 120000);
+
+end:
+ ;
+}
+
+static void
+test_evutil_monotonic_res(void *data_)
+{
+ /* Basic santity-test for monotonic timers. What we'd really like
+ * to do is make sure that they can't go backwards even when the
+ * system clock goes backwards. But we haven't got a good way to
+ * move the system clock backwards.
+ */
+ struct basic_test_data *data = data_;
+ struct evutil_monotonic_timer timer;
+ const int precise = strstr(data->setup_data, "precise") != NULL;
+ const int fallback = strstr(data->setup_data, "fallback") != NULL;
+ struct timeval tv[10], delay;
+ int total_diff = 0;
+
+ int flags = 0, wantres, acceptdiff, i;
+ if (precise)
+ flags |= EV_MONOT_PRECISE;
+ if (fallback)
+ flags |= EV_MONOT_FALLBACK;
+ if (precise || fallback) {
+#ifdef _WIN32
+ wantres = 10*1000;
+ acceptdiff = 1000;
+#else
+ wantres = 1000;
+ acceptdiff = 300;
+#endif
+ } else {
+ wantres = 40*1000;
+ acceptdiff = 20*1000;
+ }
+
+ TT_BLATHER(("Precise = %d", precise));
+ TT_BLATHER(("Fallback = %d", fallback));
+
+ /* First, make sure we match up with usleep. */
+
+ delay.tv_sec = 0;
+ delay.tv_usec = wantres;
+
+ tt_int_op(evutil_configure_monotonic_time_(&timer, flags), ==, 0);
+
+ for (i = 0; i < 10; ++i) {
+ evutil_gettime_monotonic_(&timer, &tv[i]);
+ evutil_usleep_(&delay);
+ }
+
+ for (i = 0; i < 9; ++i) {
+ struct timeval diff;
+ tt_assert(evutil_timercmp(&tv[i], &tv[i+1], <));
+ evutil_timersub(&tv[i+1], &tv[i], &diff);
+ tt_int_op(diff.tv_sec, ==, 0);
+ total_diff += diff.tv_usec;
+ TT_BLATHER(("Difference = %d", (int)diff.tv_usec));
+ }
+ tt_int_op(abs(total_diff/9 - wantres), <, acceptdiff);
+
+end:
+ ;
+}
+
+static void
+test_evutil_monotonic_prc(void *data_)
+{
+ struct basic_test_data *data = data_;
+ struct evutil_monotonic_timer timer;
+ const int precise = strstr(data->setup_data, "precise") != NULL;
+ const int fallback = strstr(data->setup_data, "fallback") != NULL;
+ struct timeval tv[10];
+ int total_diff = 0;
+ int i, maxstep = 25*1000,flags=0;
+ if (precise)
+ maxstep = 500;
+ if (precise)
+ flags |= EV_MONOT_PRECISE;
+ if (fallback)
+ flags |= EV_MONOT_FALLBACK;
+ tt_int_op(evutil_configure_monotonic_time_(&timer, flags), ==, 0);
+
+ /* find out what precision we actually see. */
+
+ evutil_gettime_monotonic_(&timer, &tv[0]);
+ for (i = 1; i < 10; ++i) {
+ do {
+ evutil_gettime_monotonic_(&timer, &tv[i]);
+ } while (evutil_timercmp(&tv[i-1], &tv[i], ==));
+ }
+
+ total_diff = 0;
+ for (i = 0; i < 9; ++i) {
+ struct timeval diff;
+ tt_assert(evutil_timercmp(&tv[i], &tv[i+1], <));
+ evutil_timersub(&tv[i+1], &tv[i], &diff);
+ tt_int_op(diff.tv_sec, ==, 0);
+ total_diff += diff.tv_usec;
+ TT_BLATHER(("Step difference = %d", (int)diff.tv_usec));
+ }
+ TT_BLATHER(("Average step difference = %d", total_diff / 9));
+ tt_int_op(total_diff/9, <, maxstep);
+
+end:
+ ;
+}
+
+struct testcase_t util_testcases[] = {
+ { "ipv4_parse", regress_ipv4_parse, 0, NULL, NULL },
+ { "ipv6_parse", regress_ipv6_parse, 0, NULL, NULL },
+ { "sockaddr_port_parse", regress_sockaddr_port_parse, 0, NULL, NULL },
+ { "sockaddr_port_format", regress_sockaddr_port_format, 0, NULL, NULL },
+ { "sockaddr_predicates", test_evutil_sockaddr_predicates, 0,NULL,NULL },
+ { "evutil_snprintf", test_evutil_snprintf, 0, NULL, NULL },
+ { "evutil_strtoll", test_evutil_strtoll, 0, NULL, NULL },
+ { "evutil_casecmp", test_evutil_casecmp, 0, NULL, NULL },
+ { "evutil_rtrim", test_evutil_rtrim, 0, NULL, NULL },
+ { "strlcpy", test_evutil_strlcpy, 0, NULL, NULL },
+ { "log", test_evutil_log, TT_FORK, NULL, NULL },
+ { "upcast", test_evutil_upcast, 0, NULL, NULL },
+ { "integers", test_evutil_integers, 0, NULL, NULL },
+ { "rand", test_evutil_rand, TT_FORK, NULL, NULL },
+ { "getaddrinfo", test_evutil_getaddrinfo, TT_FORK, NULL, NULL },
+ { "getaddrinfo_live", test_evutil_getaddrinfo_live, TT_FORK|TT_OFF_BY_DEFAULT, NULL, NULL },
+#ifdef _WIN32
+ { "loadsyslib", test_evutil_loadsyslib, TT_FORK, NULL, NULL },
+#endif
+ { "mm_malloc", test_event_malloc, 0, NULL, NULL },
+ { "mm_calloc", test_event_calloc, 0, NULL, NULL },
+ { "mm_strdup", test_event_strdup, 0, NULL, NULL },
+ { "usleep", test_evutil_usleep, 0, NULL, NULL },
+ { "monotonic_res", test_evutil_monotonic_res, 0, &basic_setup, (void*)"" },
+ { "monotonic_res_precise", test_evutil_monotonic_res, TT_OFF_BY_DEFAULT, &basic_setup, (void*)"precise" },
+ { "monotonic_res_fallback", test_evutil_monotonic_res, TT_OFF_BY_DEFAULT, &basic_setup, (void*)"fallback" },
+ { "monotonic_prc", test_evutil_monotonic_prc, 0, &basic_setup, (void*)"" },
+ { "monotonic_prc_precise", test_evutil_monotonic_prc, 0, &basic_setup, (void*)"precise" },
+ { "monotonic_prc_fallback", test_evutil_monotonic_prc, 0, &basic_setup, (void*)"fallback" },
+ END_OF_TESTCASES,
+};
+
diff --git a/protocols/Telegram/tgl/libevent/test/regress_util.obj b/protocols/Telegram/tgl/libevent/test/regress_util.obj
new file mode 100644
index 0000000000..79a948f2a5
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_util.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/regress_zlib.c b/protocols/Telegram/tgl/libevent/test/regress_zlib.c
new file mode 100644
index 0000000000..8406676932
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/regress_zlib.c
@@ -0,0 +1,348 @@
+/*
+ * Copyright (c) 2008-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* The old tests here need assertions to work. */
+#undef NDEBUG
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+#include "event2/event-config.h"
+
+#include <sys/types.h>
+#ifndef _WIN32
+#include <sys/socket.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#include <netdb.h>
+#endif
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <assert.h>
+#include <errno.h>
+
+#include "event2/util.h"
+#include "event2/event.h"
+#include "event2/event_compat.h"
+#include "event2/buffer.h"
+#include "event2/bufferevent.h"
+
+#include "regress.h"
+#include "mm-internal.h"
+
+/* zlib 1.2.4 and 1.2.5 do some "clever" things with macros. Instead of
+ saying "(defined(FOO) ? FOO : 0)" they like to say "FOO-0", on the theory
+ that nobody will care if the compile outputs a no-such-identifier warning.
+
+ Sorry, but we like -Werror over here, so I guess we need to define these.
+ I hope that zlib 1.2.6 doesn't break these too.
+*/
+#ifndef _LARGEFILE64_SOURCE
+#define _LARGEFILE64_SOURCE 0
+#endif
+#ifndef _LFS64_LARGEFILE
+#define _LFS64_LARGEFILE 0
+#endif
+#ifndef _FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 0
+#endif
+#ifndef off64_t
+#define off64_t ev_int64_t
+#endif
+
+#include <zlib.h>
+
+static int infilter_calls;
+static int outfilter_calls;
+static int readcb_finished;
+static int writecb_finished;
+static int errorcb_invoked;
+
+/*
+ * Zlib filters
+ */
+
+static void
+zlib_deflate_free(void *ctx)
+{
+ z_streamp p = ctx;
+
+ assert(deflateEnd(p) == Z_OK);
+ mm_free(p);
+}
+
+static void
+zlib_inflate_free(void *ctx)
+{
+ z_streamp p = ctx;
+
+ assert(inflateEnd(p) == Z_OK);
+ mm_free(p);
+}
+
+static int
+getstate(enum bufferevent_flush_mode state)
+{
+ switch (state) {
+ case BEV_FINISHED:
+ return Z_FINISH;
+ case BEV_FLUSH:
+ return Z_SYNC_FLUSH;
+ case BEV_NORMAL:
+ default:
+ return Z_NO_FLUSH;
+ }
+}
+
+/*
+ * The input filter is triggered only on new input read from the network.
+ * That means all input data needs to be consumed or the filter needs to
+ * initiate its own triggering via a timeout.
+ */
+static enum bufferevent_filter_result
+zlib_input_filter(struct evbuffer *src, struct evbuffer *dst,
+ ev_ssize_t lim, enum bufferevent_flush_mode state, void *ctx)
+{
+ struct evbuffer_iovec v_in[1];
+ struct evbuffer_iovec v_out[1];
+ int nread, nwrite;
+ int res, n;
+
+ z_streamp p = ctx;
+
+ do {
+ /* let's do some decompression */
+ n = evbuffer_peek(src, -1, NULL, v_in, 1);
+ if (n) {
+ p->avail_in = v_in[0].iov_len;
+ p->next_in = v_in[0].iov_base;
+ } else {
+ p->avail_in = 0;
+ p->next_in = 0;
+ }
+
+ evbuffer_reserve_space(dst, 4096, v_out, 1);
+ p->next_out = v_out[0].iov_base;
+ p->avail_out = v_out[0].iov_len;
+
+ /* we need to flush zlib if we got a flush */
+ res = inflate(p, getstate(state));
+
+ /* let's figure out how much was compressed */
+ nread = v_in[0].iov_len - p->avail_in;
+ nwrite = v_out[0].iov_len - p->avail_out;
+
+ evbuffer_drain(src, nread);
+ v_out[0].iov_len = nwrite;
+ evbuffer_commit_space(dst, v_out, 1);
+
+ if (res==Z_BUF_ERROR) {
+ /* We're out of space, or out of decodeable input.
+ Only if nwrite == 0 assume the latter.
+ */
+ if (nwrite == 0)
+ return BEV_NEED_MORE;
+ } else {
+ assert(res == Z_OK || res == Z_STREAM_END);
+ }
+
+ } while (evbuffer_get_length(src) > 0);
+
+ ++infilter_calls;
+
+ return (BEV_OK);
+}
+
+static enum bufferevent_filter_result
+zlib_output_filter(struct evbuffer *src, struct evbuffer *dst,
+ ev_ssize_t lim, enum bufferevent_flush_mode state, void *ctx)
+{
+ struct evbuffer_iovec v_in[1];
+ struct evbuffer_iovec v_out[1];
+ int nread, nwrite;
+ int res, n;
+
+ z_streamp p = ctx;
+
+ do {
+ /* let's do some compression */
+ n = evbuffer_peek(src, -1, NULL, v_in, 1);
+ if (n) {
+ p->avail_in = v_in[0].iov_len;
+ p->next_in = v_in[0].iov_base;
+ } else {
+ p->avail_in = 0;
+ p->next_in = 0;
+ }
+
+ evbuffer_reserve_space(dst, 4096, v_out, 1);
+ p->next_out = v_out[0].iov_base;
+ p->avail_out = v_out[0].iov_len;
+
+ /* we need to flush zlib if we got a flush */
+ res = deflate(p, getstate(state));
+
+ /* let's figure out how much was decompressed */
+ nread = v_in[0].iov_len - p->avail_in;
+ nwrite = v_out[0].iov_len - p->avail_out;
+
+ evbuffer_drain(src, nread);
+ v_out[0].iov_len = nwrite;
+ evbuffer_commit_space(dst, v_out, 1);
+
+ if (res==Z_BUF_ERROR) {
+ /* We're out of space, or out of decodeable input.
+ Only if nwrite == 0 assume the latter.
+ */
+ if (nwrite == 0)
+ return BEV_NEED_MORE;
+ } else {
+ assert(res == Z_OK || res == Z_STREAM_END);
+ }
+
+ } while (evbuffer_get_length(src) > 0);
+
+ ++outfilter_calls;
+
+ return (BEV_OK);
+}
+
+/*
+ * simple bufferevent test (over transparent zlib treatment)
+ */
+
+static void
+readcb(struct bufferevent *bev, void *arg)
+{
+ if (evbuffer_get_length(bufferevent_get_input(bev)) == 8333) {
+ struct evbuffer *evbuf = evbuffer_new();
+ assert(evbuf != NULL);
+
+ /* gratuitous test of bufferevent_read_buffer */
+ bufferevent_read_buffer(bev, evbuf);
+
+ bufferevent_disable(bev, EV_READ);
+
+ if (evbuffer_get_length(evbuf) == 8333) {
+ ++readcb_finished;
+ }
+
+ evbuffer_free(evbuf);
+ }
+}
+
+static void
+writecb(struct bufferevent *bev, void *arg)
+{
+ if (evbuffer_get_length(bufferevent_get_output(bev)) == 0) {
+ ++writecb_finished;
+ }
+}
+
+static void
+errorcb(struct bufferevent *bev, short what, void *arg)
+{
+ errorcb_invoked = 1;
+}
+
+void
+test_bufferevent_zlib(void *arg)
+{
+ struct bufferevent *bev1=NULL, *bev2=NULL;
+ char buffer[8333];
+ z_stream *z_input, *z_output;
+ int i, r;
+ evutil_socket_t pair[2] = {-1, -1};
+ (void)arg;
+
+ infilter_calls = outfilter_calls = readcb_finished = writecb_finished
+ = errorcb_invoked = 0;
+
+ if (evutil_socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1) {
+ tt_abort_perror("socketpair");
+ }
+
+ evutil_make_socket_nonblocking(pair[0]);
+ evutil_make_socket_nonblocking(pair[1]);
+
+ bev1 = bufferevent_socket_new(NULL, pair[0], 0);
+ bev2 = bufferevent_socket_new(NULL, pair[1], 0);
+
+ z_output = mm_calloc(sizeof(*z_output), 1);
+ r = deflateInit(z_output, Z_DEFAULT_COMPRESSION);
+ tt_int_op(r, ==, Z_OK);
+ z_input = mm_calloc(sizeof(*z_input), 1);
+ r = inflateInit(z_input);
+ tt_int_op(r, ==, Z_OK);
+
+ /* initialize filters */
+ bev1 = bufferevent_filter_new(bev1, NULL, zlib_output_filter,
+ BEV_OPT_CLOSE_ON_FREE, zlib_deflate_free, z_output);
+ bev2 = bufferevent_filter_new(bev2, zlib_input_filter,
+ NULL, BEV_OPT_CLOSE_ON_FREE, zlib_inflate_free, z_input);
+ bufferevent_setcb(bev1, readcb, writecb, errorcb, NULL);
+ bufferevent_setcb(bev2, readcb, writecb, errorcb, NULL);
+
+ bufferevent_disable(bev1, EV_READ);
+ bufferevent_enable(bev1, EV_WRITE);
+
+ bufferevent_enable(bev2, EV_READ);
+
+ for (i = 0; i < (int)sizeof(buffer); i++)
+ buffer[i] = i;
+
+ /* break it up into multiple buffer chains */
+ bufferevent_write(bev1, buffer, 1800);
+ bufferevent_write(bev1, buffer + 1800, sizeof(buffer) - 1800);
+
+ /* we are done writing - we need to flush everything */
+ bufferevent_flush(bev1, EV_WRITE, BEV_FINISHED);
+
+ event_dispatch();
+
+ tt_want(infilter_calls);
+ tt_want(outfilter_calls);
+ tt_want(readcb_finished);
+ tt_want(writecb_finished);
+ tt_want(!errorcb_invoked);
+
+ test_ok = 1;
+end:
+ if (bev1)
+ bufferevent_free(bev1);
+ if (bev2)
+ bufferevent_free(bev2);
+
+ if (pair[0] >= 0)
+ evutil_closesocket(pair[0]);
+ if (pair[1] >= 0)
+ evutil_closesocket(pair[1]);
+}
diff --git a/protocols/Telegram/tgl/libevent/test/rpcgen_wrapper.sh b/protocols/Telegram/tgl/libevent/test/rpcgen_wrapper.sh
new file mode 100644
index 0000000000..aaa03031a1
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/rpcgen_wrapper.sh
@@ -0,0 +1,52 @@
+#!/bin/sh
+# libevent rpcgen_wrapper.sh
+# Transforms event_rpcgen.py failure into success for make, only if
+# regress.gen.c and regress.gen.h already exist in $srcdir. This
+# is needed for "make distcheck" to pass the read-only $srcdir build,
+# as with read-only sources fresh from tarball, regress.gen.[ch] will
+# be correct in $srcdir but unwritable. This previously triggered
+# Makefile.am to create stub regress.gen.c and regress.gen.h in the
+# distcheck _build directory, which were then detected as leftover
+# files in the build tree after distclean, breaking distcheck.
+# Note that regress.gen.[ch] are not in fresh git clones, making
+# working Python a requirement for make distcheck of a git tree.
+
+exit_updated() {
+# echo "Updated ${srcdir}/regress.gen.c and ${srcdir}/regress.gen.h"
+ exit 0
+}
+
+exit_reuse() {
+ echo "event_rpcgen.py failed, ${srcdir}/regress.gen.\[ch\] will be reused." >&2
+ exit 0
+}
+
+exit_failed() {
+ echo "Could not generate regress.gen.\[ch\] using event_rpcgen.sh" >&2
+ exit 1
+}
+
+if [ -x /usr/bin/python2 ] ; then
+ PYTHON2=/usr/bin/python2
+elif [ "x`which python2`" != x ] ; then
+ PYTHON2=python2
+else
+ PYTHON2=python
+fi
+
+srcdir=$1
+srcdir=${srcdir:-.}
+
+${PYTHON2} ${srcdir}/../event_rpcgen.py --quiet ${srcdir}/regress.rpc \
+ test/regress.gen.h test/regress.gen.c
+
+case "$?" in
+ 0)
+ exit_updated
+ ;;
+ *)
+ test -r ${srcdir}/regress.gen.c -a -r ${srcdir}/regress.gen.h && \
+ exit_reuse
+ exit_failed
+ ;;
+esac
diff --git a/protocols/Telegram/tgl/libevent/test/test-changelist.c b/protocols/Telegram/tgl/libevent/test/test-changelist.c
new file mode 100644
index 0000000000..6e2466d5a5
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/test-changelist.c
@@ -0,0 +1,224 @@
+/*
+ * Copyright (c) 2010-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "event2/event-config.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#else
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#ifdef EVENT__HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#include "event2/event.h"
+#include "event2/util.h"
+#include <time.h>
+
+struct cpu_usage_timer {
+#ifdef _WIN32
+ HANDLE thread;
+ FILETIME usertimeBegin;
+ FILETIME kerneltimeBegin;
+#else
+ clock_t ticksBegin;
+#endif
+ struct timeval timeBegin;
+};
+static void
+start_cpu_usage_timer(struct cpu_usage_timer *timer)
+{
+#ifdef _WIN32
+ int r;
+ FILETIME createtime, exittime;
+ timer->thread = GetCurrentThread();
+ r = GetThreadTimes(timer->thread, &createtime, &exittime,
+ &timer->usertimeBegin, &timer->kerneltimeBegin);
+ if (r==0) printf("GetThreadTimes failed.");
+#else
+ timer->ticksBegin = clock();
+#endif
+
+ evutil_gettimeofday(&timer->timeBegin, NULL);
+}
+#ifdef _WIN32
+static ev_int64_t
+filetime_to_100nsec(const FILETIME *ft)
+{
+ /* Number of 100-nanosecond units */
+ ev_int64_t n = ft->dwHighDateTime;
+ n <<= 32;
+ n += ft->dwLowDateTime;
+ return n;
+}
+static double
+filetime_diff(const FILETIME *ftStart, const FILETIME *ftEnd)
+{
+ ev_int64_t s, e, diff;
+ double r;
+ s = filetime_to_100nsec(ftStart);
+ e = filetime_to_100nsec(ftEnd);
+ diff = e - s;
+ r = (double) diff;
+ return r / 1.0e7;
+}
+#endif
+
+static void
+get_cpu_usage(struct cpu_usage_timer *timer, double *secElapsedOut,
+ double *secUsedOut, double *usageOut)
+{
+#ifdef _WIN32
+ double usertime_seconds, kerneltime_seconds;
+ FILETIME createtime, exittime, usertimeEnd, kerneltimeEnd;
+ int r;
+#else
+ clock_t ticksEnd;
+#endif
+ struct timeval timeEnd, timeDiff;
+ double secondsPassed, secondsUsed;
+
+#ifdef _WIN32
+ r = GetThreadTimes(timer->thread, &createtime, &exittime,
+ &usertimeEnd, &kerneltimeEnd);
+ if (r==0) printf("GetThreadTimes failed.");
+ usertime_seconds = filetime_diff(&timer->usertimeBegin, &usertimeEnd);
+ kerneltime_seconds = filetime_diff(&timer->kerneltimeBegin, &kerneltimeEnd);
+ secondsUsed = kerneltime_seconds + usertime_seconds;
+#else
+ ticksEnd = clock();
+ secondsUsed = (ticksEnd - timer->ticksBegin) / (double)CLOCKS_PER_SEC;
+#endif
+ evutil_gettimeofday(&timeEnd, NULL);
+ evutil_timersub(&timeEnd, &timer->timeBegin, &timeDiff);
+ secondsPassed = timeDiff.tv_sec + (timeDiff.tv_usec / 1.0e6);
+
+ *secElapsedOut = secondsPassed;
+ *secUsedOut = secondsUsed;
+ *usageOut = secondsUsed / secondsPassed;
+}
+
+static void
+write_cb(evutil_socket_t fd, short event, void *arg)
+{
+ printf("write callback. should only see this once\n");
+
+ /* got what we want remove the event */
+ event_del(*(struct event**)arg);
+
+ /* opps changed my mind add it back again */
+ event_add(*(struct event**)arg,NULL);
+
+ /* not a good day for decisiveness, I really didn't want it after all */
+ event_del(*(struct event**)arg);
+
+}
+
+static void
+timeout_cb(evutil_socket_t fd, short event, void *arg)
+{
+ printf("timeout fired, time to end test\n");
+ event_del(*(struct event**)arg);
+ return;
+}
+
+int
+main(int argc, char **argv)
+{
+ struct event* ev;
+ struct event* timeout;
+ struct event_base* base;
+
+ evutil_socket_t pair[2];
+ struct timeval tv;
+ struct cpu_usage_timer timer;
+
+ double usage, secPassed, secUsed;
+
+#ifdef _WIN32
+ WORD wVersionRequested;
+ WSADATA wsaData;
+
+ wVersionRequested = MAKEWORD(2, 2);
+
+ (void) WSAStartup(wVersionRequested, &wsaData);
+#endif
+ if (evutil_socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1)
+ return (1);
+
+ /* Initalize the event library */
+ if (!(base = event_base_new()))
+ return (1);
+
+ /* Initalize a timeout to terminate the test */
+ timeout = evtimer_new(base,timeout_cb,&timeout);
+ /* and watch for writability on one end of the pipe */
+ ev = event_new(base,pair[1],EV_WRITE | EV_PERSIST, write_cb, &ev);
+
+ tv.tv_sec = 1;
+ tv.tv_usec = 500*1000;
+
+ evtimer_add(timeout, &tv);
+
+ event_add(ev, NULL);
+
+ start_cpu_usage_timer(&timer);
+
+ event_base_dispatch(base);
+
+ event_free(ev);
+ event_free(timeout);
+ event_base_free(base);
+
+ get_cpu_usage(&timer, &secPassed, &secUsed, &usage);
+
+ /* attempt to calculate our cpu usage over the test should be
+ virtually nil */
+
+ printf("usec used=%d, usec passed=%d, cpu usage=%.2f%%\n",
+ (int)(secUsed*1e6),
+ (int)(secPassed*1e6),
+ usage*100);
+
+ if (usage > 50.0) /* way too high */
+ return 1;
+
+ return 0;
+}
+
diff --git a/protocols/Telegram/tgl/libevent/test/test-changelist.exe b/protocols/Telegram/tgl/libevent/test/test-changelist.exe
new file mode 100644
index 0000000000..2adeacc62f
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/test-changelist.exe
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/test-changelist.obj b/protocols/Telegram/tgl/libevent/test/test-changelist.obj
new file mode 100644
index 0000000000..d5e1a181f6
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/test-changelist.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/test-closed.c b/protocols/Telegram/tgl/libevent/test/test-closed.c
new file mode 100644
index 0000000000..5b04f354ac
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/test-closed.c
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2002-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2013 Niels Provos and Nick Mathewson
+ *
+ * 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 "event2/event-config.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#else
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef EVENT__HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#include <event.h>
+#include <evutil.h>
+
+#ifdef EVENT____func__
+#define __func__ EVENT____func__
+#endif
+
+struct timeval timeout = {3, 0};
+
+static void
+closed_cb(evutil_socket_t fd, short event, void *arg)
+{
+ if (EV_TIMEOUT & event) {
+ printf("%s: Timeout!\n", __func__);
+ exit(1);
+ }
+
+ if (EV_CLOSED & event) {
+ printf("%s: detected socket close with success\n", __func__);
+ return;
+ }
+
+ printf("%s: unable to detect socket close\n", __func__);
+ exit(1);
+}
+
+#ifndef SHUT_WR
+#define SHUT_WR 1
+#endif
+
+int
+main(int argc, char **argv)
+{
+ struct event_base *base;
+ struct event_config *cfg;
+ struct event *ev;
+ const char *test = "test string";
+ evutil_socket_t pair[2];
+
+ /* Initialize the library and check if the backend
+ supports EV_FEATURE_EARLY_CLOSE
+ */
+ cfg = event_config_new();
+ event_config_require_features(cfg, EV_FEATURE_EARLY_CLOSE);
+ base = event_base_new_with_config(cfg);
+ event_config_free(cfg);
+ if (!base) {
+ /* Backend doesn't support EV_FEATURE_EARLY_CLOSE */
+ return 0;
+ }
+
+ /* Create a pair of sockets */
+ if (evutil_socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1)
+ return (1);
+
+ /* Send some data on socket 0 and immediately close it */
+ if (send(pair[0], test, (int)strlen(test)+1, 0) < 0)
+ return (1);
+ shutdown(pair[0], SHUT_WR);
+
+ /* Dispatch */
+ ev = event_new(base, pair[1], EV_CLOSED | EV_TIMEOUT, closed_cb, event_self_cbarg());
+ event_add(ev, &timeout);
+ event_base_dispatch(base);
+
+ /* Finalize library */
+ event_base_free(base);
+ return 0;
+}
+
diff --git a/protocols/Telegram/tgl/libevent/test/test-closed.exe b/protocols/Telegram/tgl/libevent/test/test-closed.exe
new file mode 100644
index 0000000000..68bd7e1de1
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/test-closed.exe
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/test-closed.obj b/protocols/Telegram/tgl/libevent/test/test-closed.obj
new file mode 100644
index 0000000000..3894c88833
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/test-closed.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/test-dumpevents.c b/protocols/Telegram/tgl/libevent/test/test-dumpevents.c
new file mode 100644
index 0000000000..1c272d4c01
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/test-dumpevents.c
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "util-internal.h"
+#include "event2/event-config.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#else
+#include <unistd.h>
+#endif
+
+#include <stdio.h>
+#include <event2/event.h>
+#include <signal.h>
+
+static void
+sock_perror(const char *s)
+{
+#ifdef _WIN32
+ const char *err = evutil_socket_error_to_string(EVUTIL_SOCKET_ERROR());
+ fprintf(stderr, "%s: %s\n", s, err);
+#else
+ perror(s);
+#endif
+}
+
+static void
+callback1(evutil_socket_t fd, short events, void *arg)
+{
+}
+static void
+callback2(evutil_socket_t fd, short events, void *arg)
+{
+}
+
+/* Testing code for event_base_dump_events().
+
+ Notes that just because we have code to exercise this function,
+ doesn't mean that *ANYTHING* about the output format is guaranteed to
+ remain in the future.
+ */
+int
+main(int argc, char **argv)
+{
+#define N_EVENTS 13
+ int i;
+ struct event *ev[N_EVENTS];
+ evutil_socket_t pair1[2];
+ evutil_socket_t pair2[2];
+ struct timeval tv_onesec = {1,0};
+ struct timeval tv_two5sec = {2,500*1000};
+ const struct timeval *tv_onesec_common;
+ const struct timeval *tv_two5sec_common;
+ struct event_base *base;
+ struct timeval now;
+
+#ifdef _WIN32
+ WORD wVersionRequested;
+ WSADATA wsaData;
+
+ wVersionRequested = MAKEWORD(2, 2);
+
+ WSAStartup(wVersionRequested, &wsaData);
+#endif
+
+#ifdef _WIN32
+#define LOCAL_SOCKETPAIR_AF AF_INET
+#else
+#define LOCAL_SOCKETPAIR_AF AF_UNIX
+#endif
+
+ if (evutil_make_internal_pipe_(pair1) < 0 ||
+ evutil_make_internal_pipe_(pair2) < 0) {
+ sock_perror("evutil_make_internal_pipe_");
+ return 1;
+ }
+
+ if (!(base = event_base_new())) {
+ fprintf(stderr,"Couldn't make event_base\n");
+ return 2;
+ }
+
+ tv_onesec_common = event_base_init_common_timeout(base, &tv_onesec);
+ tv_two5sec_common = event_base_init_common_timeout(base, &tv_two5sec);
+
+ ev[0] = event_new(base, pair1[0], EV_WRITE, callback1, NULL);
+ ev[1] = event_new(base, pair1[1], EV_READ|EV_PERSIST, callback1, NULL);
+ ev[2] = event_new(base, pair2[0], EV_WRITE|EV_PERSIST, callback2, NULL);
+ ev[3] = event_new(base, pair2[1], EV_READ, callback2, NULL);
+
+ /* For timers */
+ ev[4] = evtimer_new(base, callback1, NULL);
+ ev[5] = evtimer_new(base, callback1, NULL);
+ ev[6] = evtimer_new(base, callback1, NULL);
+ ev[7] = event_new(base, -1, EV_PERSIST, callback2, NULL);
+ ev[8] = event_new(base, -1, EV_PERSIST, callback2, NULL);
+ ev[9] = event_new(base, -1, EV_PERSIST, callback2, NULL);
+
+ /* To activate */
+ ev[10] = event_new(base, -1, 0, callback1, NULL);
+ ev[11] = event_new(base, -1, 0, callback2, NULL);
+
+ /* Signals */
+ ev[12] = evsignal_new(base, SIGINT, callback2, NULL);
+
+ event_add(ev[0], NULL);
+ event_add(ev[1], &tv_onesec);
+ event_add(ev[2], tv_onesec_common);
+ event_add(ev[3], tv_two5sec_common);
+
+ event_add(ev[4], tv_onesec_common);
+ event_add(ev[5], tv_onesec_common);
+ event_add(ev[6], &tv_onesec);
+ event_add(ev[7], tv_two5sec_common);
+ event_add(ev[8], tv_onesec_common);
+ event_add(ev[9], &tv_two5sec);
+
+ event_active(ev[10], EV_READ, 1);
+ event_active(ev[11], EV_READ|EV_WRITE|EV_TIMEOUT, 1);
+ event_active(ev[1], EV_READ, 1);
+
+ event_add(ev[12], NULL);
+
+ evutil_gettimeofday(&now,NULL);
+ puts("=====expected");
+ printf("Now= %ld.%06d\n",(long)now.tv_sec,(int)now.tv_usec);
+ puts("Inserted:");
+ printf(" %p [fd %ld] Write\n",ev[0],(long)pair1[0]);
+ printf(" %p [fd %ld] Read Persist Timeout=T+1\n",ev[1],(long)pair1[1]);
+ printf(" %p [fd %ld] Write Persist Timeout=T+1\n",ev[2],(long)pair2[0]);
+ printf(" %p [fd %ld] Read Timeout=T+2.5\n",ev[3],(long)pair2[1]);
+ printf(" %p [fd -1] Timeout=T+1\n",ev[4]);
+ printf(" %p [fd -1] Timeout=T+1\n",ev[5]);
+ printf(" %p [fd -1] Timeout=T+1\n",ev[6]);
+ printf(" %p [fd -1] Persist Timeout=T+2.5\n",ev[7]);
+ printf(" %p [fd -1] Persist Timeout=T+1\n",ev[8]);
+ printf(" %p [fd -1] Persist Timeout=T+2.5\n",ev[9]);
+ printf(" %p [sig %d] Signal Persist\n", ev[12], (int)SIGINT);
+
+ puts("Active:");
+ printf(" %p [fd -1, priority=0] Read active\n", ev[10]);
+ printf(" %p [fd -1, priority=0] Read Write Timeout active\n", ev[11]);
+ printf(" %p [fd %ld, priority=0] Read active\n", ev[1], (long)pair1[1]);
+
+ puts("======received");
+ event_base_dump_events(base, stdout);
+
+ for (i = 0; i < N_EVENTS; ++i) {
+ event_free(ev[i]);
+ }
+ event_base_free(base);
+
+ return 0;
+}
+
diff --git a/protocols/Telegram/tgl/libevent/test/test-eof.c b/protocols/Telegram/tgl/libevent/test/test-eof.c
new file mode 100644
index 0000000000..a9ca5343a2
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/test-eof.c
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2002-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "event2/event-config.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#else
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef EVENT__HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#include <event.h>
+#include <evutil.h>
+
+#ifdef EVENT____func__
+#define __func__ EVENT____func__
+#endif
+
+int test_okay = 1;
+int called = 0;
+struct timeval timeout = {60, 0};
+
+static void
+read_cb(evutil_socket_t fd, short event, void *arg)
+{
+ char buf[256];
+ int len;
+
+ if (EV_TIMEOUT & event) {
+ printf("%s: Timeout!\n", __func__);
+ exit(1);
+ }
+
+ len = recv(fd, buf, sizeof(buf), 0);
+
+ printf("%s: read %d%s\n", __func__,
+ len, len ? "" : " - means EOF");
+
+ if (len) {
+ if (!called)
+ event_add(arg, &timeout);
+ } else if (called == 1)
+ test_okay = 0;
+
+ called++;
+}
+
+#ifndef SHUT_WR
+#define SHUT_WR 1
+#endif
+
+int
+main(int argc, char **argv)
+{
+ struct event ev;
+ const char *test = "test string";
+ evutil_socket_t pair[2];
+
+#ifdef _WIN32
+ WORD wVersionRequested;
+ WSADATA wsaData;
+
+ wVersionRequested = MAKEWORD(2, 2);
+
+ (void) WSAStartup(wVersionRequested, &wsaData);
+#endif
+
+ if (evutil_socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1)
+ return (1);
+
+
+ if (send(pair[0], test, (int)strlen(test)+1, 0) < 0)
+ return (1);
+ shutdown(pair[0], SHUT_WR);
+
+ /* Initalize the event library */
+ event_init();
+
+ /* Initalize one event */
+ event_set(&ev, pair[1], EV_READ | EV_TIMEOUT, read_cb, &ev);
+
+ event_add(&ev, &timeout);
+
+ event_dispatch();
+
+ return (test_okay);
+}
+
diff --git a/protocols/Telegram/tgl/libevent/test/test-eof.exe b/protocols/Telegram/tgl/libevent/test/test-eof.exe
new file mode 100644
index 0000000000..0c20f43d91
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/test-eof.exe
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/test-eof.obj b/protocols/Telegram/tgl/libevent/test/test-eof.obj
new file mode 100644
index 0000000000..05c17400b8
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/test-eof.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/test-fdleak.c b/protocols/Telegram/tgl/libevent/test/test-fdleak.c
new file mode 100644
index 0000000000..4c4eba25e7
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/test-fdleak.c
@@ -0,0 +1,249 @@
+/*
+ * Copyright (c) 2012 Ross Lagerwall <rosslagerwall@gmail.com>
+ *
+ * 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 "event2/event-config.h"
+
+#ifdef _WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#endif
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef EVENT__HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
+#ifdef EVENT__HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#include "event2/event.h"
+#include "event2/bufferevent.h"
+#include "event2/buffer.h"
+#include "event2/listener.h"
+
+/* Number of requests to make. Setting this too high might result in the machine
+ running out of ephemeral ports */
+#ifdef _WIN32
+#define MAX_REQUESTS 1000
+#else
+#define MAX_REQUESTS 4000
+#endif
+
+/* Provide storage for the address, both for the server & the clients */
+static struct sockaddr_in saddr;
+
+/* Number of sucessful requests so far */
+static int num_requests;
+
+static void start_client(struct event_base *base);
+
+static void
+my_perror(const char *s)
+{
+ fprintf(stderr, "%s: %s",
+ s, evutil_socket_error_to_string(EVUTIL_SOCKET_ERROR()));
+}
+
+/*
+===============================================
+Server functions
+===============================================
+*/
+
+/* Read a byte from the client and write it back */
+static void
+server_read_cb(struct bufferevent *bev, void *ctx)
+{
+ while (evbuffer_get_length(bufferevent_get_input(bev))) {
+ unsigned char tmp;
+ bufferevent_read(bev, &tmp, 1);
+ bufferevent_write(bev, &tmp, 1);
+ }
+}
+
+/* Wait for an EOF and then free the bufferevent */
+static void
+server_event_cb(struct bufferevent *bev, short events, void *ctx)
+{
+ if (events & BEV_EVENT_ERROR) {
+ my_perror("Error from bufferevent");
+ exit(1);
+ } else if (events & (BEV_EVENT_EOF | BEV_EVENT_ERROR)) {
+ bufferevent_free(bev);
+ }
+}
+
+/* Accept a client socket and set it up to for reading & writing */
+static void
+listener_accept_cb(struct evconnlistener *listener, evutil_socket_t sock,
+ struct sockaddr *addr, int len, void *ptr)
+{
+ struct event_base *base = evconnlistener_get_base(listener);
+ struct bufferevent *bev = bufferevent_socket_new(base, sock,
+ BEV_OPT_CLOSE_ON_FREE);
+
+ bufferevent_setcb(bev, server_read_cb, NULL, server_event_cb, NULL);
+ bufferevent_enable(bev, EV_READ|EV_WRITE);
+}
+
+/* Start the server listening on a random port and start the first client. */
+static void
+start_loop(void)
+{
+ struct event_base *base;
+ struct evconnlistener *listener;
+ struct sockaddr_storage ss;
+ ev_socklen_t socklen = sizeof(ss);
+ evutil_socket_t fd;
+
+ base = event_base_new();
+ if (base == NULL) {
+ puts("Could not open event base!");
+ exit(1);
+ }
+
+ listener = evconnlistener_new_bind(base, listener_accept_cb, NULL,
+ LEV_OPT_CLOSE_ON_FREE|LEV_OPT_REUSEABLE,
+ -1, (struct sockaddr *)&saddr, sizeof(saddr));
+ if (listener == NULL) {
+ my_perror("Could not create listener!");
+ exit(1);
+ }
+ fd = evconnlistener_get_fd(listener);
+ if (fd < 0) {
+ puts("Couldn't get fd from listener");
+ exit(1);
+ }
+ if (getsockname(fd, (struct sockaddr *)&ss, &socklen) < 0) {
+ my_perror("getsockname()");
+ exit(1);
+ }
+ memcpy(&saddr, &ss, sizeof(saddr));
+ if (saddr.sin_family != AF_INET) {
+ puts("AF mismatch from getsockname().");
+ exit(1);
+ }
+
+ start_client(base);
+
+ event_base_dispatch(base);
+}
+
+/*
+===============================================
+Client functions
+===============================================
+*/
+
+/* Check that the server sends back the same byte that the client sent.
+ If MAX_REQUESTS have been reached, exit. Otherwise, start another client. */
+static void
+client_read_cb(struct bufferevent *bev, void *ctx)
+{
+ unsigned char tmp;
+ struct event_base *base = bufferevent_get_base(bev);
+
+ bufferevent_read(bev, &tmp, 1);
+ if (tmp != 'A') {
+ puts("Incorrect data received!");
+ exit(2);
+ }
+ bufferevent_free(bev);
+
+ num_requests++;
+ if (num_requests == MAX_REQUESTS) {
+ event_base_loopbreak(base);
+ } else {
+ start_client(base);
+ }
+}
+
+/* Send a byte to the server. */
+static void
+client_event_cb(struct bufferevent *bev, short events, void *ctx)
+{
+ if (events & BEV_EVENT_CONNECTED) {
+ unsigned char tmp = 'A';
+ bufferevent_write(bev, &tmp, 1);
+ } else if (events & BEV_EVENT_ERROR) {
+ puts("Client socket got error!");
+ exit(2);
+ }
+
+ bufferevent_enable(bev, EV_READ);
+}
+
+/* Open a client socket to connect to localhost on sin */
+static void
+start_client(struct event_base *base)
+{
+ struct bufferevent *bev = bufferevent_socket_new(base, -1,
+ BEV_OPT_CLOSE_ON_FREE);
+ bufferevent_setcb(bev, client_read_cb, NULL, client_event_cb, NULL);
+
+ if (bufferevent_socket_connect(bev, (struct sockaddr *)&saddr,
+ sizeof(saddr)) < 0) {
+ my_perror("Could not connect!");
+ bufferevent_free(bev);
+ exit(2);
+ }
+}
+
+int
+main(int argc, char **argv)
+{
+#ifdef EVENT__HAVE_SETRLIMIT
+ /* Set the fd limit to a low value so that any fd leak is caught without
+ making many requests. */
+ struct rlimit rl;
+ rl.rlim_cur = rl.rlim_max = 20;
+ if (setrlimit(RLIMIT_NOFILE, &rl) == -1) {
+ my_perror("setrlimit");
+ exit(3);
+ }
+#endif
+
+#ifdef _WIN32
+ WSADATA WSAData;
+ WSAStartup(0x101, &WSAData);
+#endif
+
+ /* Set up an address, used by both client & server. */
+ memset(&saddr, 0, sizeof(saddr));
+ saddr.sin_family = AF_INET;
+ saddr.sin_addr.s_addr = htonl(0x7f000001);
+ saddr.sin_port = 0; /* Tell the implementation to pick a port. */
+
+ start_loop();
+
+ return 0;
+}
+
+/* XXX why does this test cause so much latency sometimes (OSX 10.5)? */
diff --git a/protocols/Telegram/tgl/libevent/test/test-init.c b/protocols/Telegram/tgl/libevent/test/test-init.c
new file mode 100644
index 0000000000..92fbc6b146
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/test-init.c
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2003-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "event2/event-config.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef EVENT__HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#ifndef _WIN32
+#include <unistd.h>
+#endif
+#include <errno.h>
+
+#include <event.h>
+
+int
+main(int argc, char **argv)
+{
+#ifdef _WIN32
+ WORD wVersionRequested;
+ WSADATA wsaData;
+
+ wVersionRequested = MAKEWORD(2, 2);
+
+ (void) WSAStartup(wVersionRequested, &wsaData);
+#endif
+
+ /* Initalize the event library */
+ event_init();
+
+ return (0);
+}
+
diff --git a/protocols/Telegram/tgl/libevent/test/test-init.exe b/protocols/Telegram/tgl/libevent/test/test-init.exe
new file mode 100644
index 0000000000..c404d2c1a1
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/test-init.exe
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/test-init.obj b/protocols/Telegram/tgl/libevent/test/test-init.obj
new file mode 100644
index 0000000000..606fcf91d5
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/test-init.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/test-ratelim.c b/protocols/Telegram/tgl/libevent/test/test-ratelim.c
new file mode 100644
index 0000000000..17babfdcbc
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/test-ratelim.c
@@ -0,0 +1,601 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "../util-internal.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <math.h>
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#else
+#include <sys/socket.h>
+#include <netinet/in.h>
+# ifdef _XOPEN_SOURCE_EXTENDED
+# include <arpa/inet.h>
+# endif
+#endif
+#include <signal.h>
+
+#include "event2/bufferevent.h"
+#include "event2/buffer.h"
+#include "event2/event.h"
+#include "event2/util.h"
+#include "event2/listener.h"
+#include "event2/thread.h"
+
+static struct evutil_weakrand_state weakrand_state;
+
+static int cfg_verbose = 0;
+static int cfg_help = 0;
+
+static int cfg_n_connections = 30;
+static int cfg_duration = 5;
+static int cfg_connlimit = 0;
+static int cfg_grouplimit = 0;
+static int cfg_tick_msec = 1000;
+static int cfg_min_share = -1;
+static int cfg_group_drain = 0;
+
+static int cfg_connlimit_tolerance = -1;
+static int cfg_grouplimit_tolerance = -1;
+static int cfg_stddev_tolerance = -1;
+
+#ifdef _WIN32
+static int cfg_enable_iocp = 0;
+#endif
+
+static struct timeval cfg_tick = { 0, 500*1000 };
+
+static struct ev_token_bucket_cfg *conn_bucket_cfg = NULL;
+static struct ev_token_bucket_cfg *group_bucket_cfg = NULL;
+struct bufferevent_rate_limit_group *ratelim_group = NULL;
+static double seconds_per_tick = 0.0;
+
+struct client_state {
+ size_t queued;
+ ev_uint64_t received;
+
+};
+static const struct timeval *ms100_common=NULL;
+
+/* info from check_bucket_levels_cb */
+static int total_n_bev_checks = 0;
+static ev_int64_t total_rbucket_level=0;
+static ev_int64_t total_wbucket_level=0;
+static ev_int64_t total_max_to_read=0;
+static ev_int64_t total_max_to_write=0;
+static ev_int64_t max_bucket_level=EV_INT64_MIN;
+static ev_int64_t min_bucket_level=EV_INT64_MAX;
+
+/* from check_group_bucket_levels_cb */
+static int total_n_group_bev_checks = 0;
+static ev_int64_t total_group_rbucket_level = 0;
+static ev_int64_t total_group_wbucket_level = 0;
+
+static int n_echo_conns_open = 0;
+
+/* Info on the open connections */
+struct bufferevent **bevs;
+struct client_state *states;
+struct bufferevent_rate_limit_group *group = NULL;
+
+static void check_bucket_levels_cb(evutil_socket_t fd, short events, void *arg);
+
+static void
+loud_writecb(struct bufferevent *bev, void *ctx)
+{
+ struct client_state *cs = ctx;
+ struct evbuffer *output = bufferevent_get_output(bev);
+ char buf[1024];
+ int r = evutil_weakrand_(&weakrand_state);
+ memset(buf, r, sizeof(buf));
+ while (evbuffer_get_length(output) < 8192) {
+ evbuffer_add(output, buf, sizeof(buf));
+ cs->queued += sizeof(buf);
+ }
+}
+
+static void
+discard_readcb(struct bufferevent *bev, void *ctx)
+{
+ struct client_state *cs = ctx;
+ struct evbuffer *input = bufferevent_get_input(bev);
+ size_t len = evbuffer_get_length(input);
+ evbuffer_drain(input, len);
+ cs->received += len;
+}
+
+static void
+write_on_connectedcb(struct bufferevent *bev, short what, void *ctx)
+{
+ if (what & BEV_EVENT_CONNECTED) {
+ loud_writecb(bev, ctx);
+ /* XXXX this shouldn't be needed. */
+ bufferevent_enable(bev, EV_READ|EV_WRITE);
+ }
+}
+
+static void
+echo_readcb(struct bufferevent *bev, void *ctx)
+{
+ struct evbuffer *input = bufferevent_get_input(bev);
+ struct evbuffer *output = bufferevent_get_output(bev);
+
+ evbuffer_add_buffer(output, input);
+ if (evbuffer_get_length(output) > 1024000)
+ bufferevent_disable(bev, EV_READ);
+}
+
+static void
+echo_writecb(struct bufferevent *bev, void *ctx)
+{
+ struct evbuffer *output = bufferevent_get_output(bev);
+ if (evbuffer_get_length(output) < 512000)
+ bufferevent_enable(bev, EV_READ);
+}
+
+static void
+echo_eventcb(struct bufferevent *bev, short what, void *ctx)
+{
+ if (what & (BEV_EVENT_EOF|BEV_EVENT_ERROR)) {
+ --n_echo_conns_open;
+ bufferevent_free(bev);
+ }
+}
+
+static void
+echo_listenercb(struct evconnlistener *listener, evutil_socket_t newsock,
+ struct sockaddr *sourceaddr, int socklen, void *ctx)
+{
+ struct event_base *base = ctx;
+ int flags = BEV_OPT_CLOSE_ON_FREE|BEV_OPT_THREADSAFE;
+ struct bufferevent *bev;
+
+ bev = bufferevent_socket_new(base, newsock, flags);
+ bufferevent_setcb(bev, echo_readcb, echo_writecb, echo_eventcb, NULL);
+ if (conn_bucket_cfg) {
+ struct event *check_event =
+ event_new(base, -1, EV_PERSIST, check_bucket_levels_cb, bev);
+ bufferevent_set_rate_limit(bev, conn_bucket_cfg);
+
+ assert(bufferevent_get_token_bucket_cfg(bev) != NULL);
+ event_add(check_event, ms100_common);
+ }
+ if (ratelim_group)
+ bufferevent_add_to_rate_limit_group(bev, ratelim_group);
+ ++n_echo_conns_open;
+ bufferevent_enable(bev, EV_READ|EV_WRITE);
+}
+
+/* Called periodically to check up on how full the buckets are */
+static void
+check_bucket_levels_cb(evutil_socket_t fd, short events, void *arg)
+{
+ struct bufferevent *bev = arg;
+
+ ev_ssize_t r = bufferevent_get_read_limit(bev);
+ ev_ssize_t w = bufferevent_get_write_limit(bev);
+ ev_ssize_t rm = bufferevent_get_max_to_read(bev);
+ ev_ssize_t wm = bufferevent_get_max_to_write(bev);
+ /* XXXX check that no value is above the cofigured burst
+ * limit */
+ total_rbucket_level += r;
+ total_wbucket_level += w;
+ total_max_to_read += rm;
+ total_max_to_write += wm;
+#define B(x) \
+ if ((x) > max_bucket_level) \
+ max_bucket_level = (x); \
+ if ((x) < min_bucket_level) \
+ min_bucket_level = (x)
+ B(r);
+ B(w);
+#undef B
+
+ total_n_bev_checks++;
+ if (total_n_bev_checks >= .8 * ((double)cfg_duration / cfg_tick_msec) * cfg_n_connections) {
+ event_free(event_base_get_running_event(bufferevent_get_base(bev)));
+ }
+}
+
+static void
+check_group_bucket_levels_cb(evutil_socket_t fd, short events, void *arg)
+{
+ if (ratelim_group) {
+ ev_ssize_t r = bufferevent_rate_limit_group_get_read_limit(ratelim_group);
+ ev_ssize_t w = bufferevent_rate_limit_group_get_write_limit(ratelim_group);
+ total_group_rbucket_level += r;
+ total_group_wbucket_level += w;
+ }
+ ++total_n_group_bev_checks;
+}
+
+static void
+group_drain_cb(evutil_socket_t fd, short events, void *arg)
+{
+ bufferevent_rate_limit_group_decrement_read(ratelim_group, cfg_group_drain);
+ bufferevent_rate_limit_group_decrement_write(ratelim_group, cfg_group_drain);
+}
+
+static int
+test_ratelimiting(void)
+{
+ struct event_base *base;
+ struct sockaddr_in sin;
+ struct evconnlistener *listener;
+
+ struct sockaddr_storage ss;
+ ev_socklen_t slen;
+
+ int i;
+
+ struct timeval tv;
+
+ ev_uint64_t total_received;
+ double total_sq_persec, total_persec;
+ double variance;
+ double expected_total_persec = -1.0, expected_avg_persec = -1.0;
+ int ok = 1;
+ struct event_config *base_cfg;
+ struct event *periodic_level_check;
+ struct event *group_drain_event=NULL;
+
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_addr.s_addr = htonl(0x7f000001); /* 127.0.0.1 */
+ sin.sin_port = 0; /* unspecified port */
+
+ if (0)
+ event_enable_debug_mode();
+
+ base_cfg = event_config_new();
+
+#ifdef _WIN32
+ if (cfg_enable_iocp) {
+ evthread_use_windows_threads();
+ event_config_set_flag(base_cfg, EVENT_BASE_FLAG_STARTUP_IOCP);
+ }
+#endif
+
+ base = event_base_new_with_config(base_cfg);
+ event_config_free(base_cfg);
+ if (! base) {
+ fprintf(stderr, "Couldn't create event_base");
+ return 1;
+ }
+
+ listener = evconnlistener_new_bind(base, echo_listenercb, base,
+ LEV_OPT_CLOSE_ON_FREE|LEV_OPT_REUSEABLE, -1,
+ (struct sockaddr *)&sin, sizeof(sin));
+ if (! listener) {
+ fprintf(stderr, "Couldn't create listener");
+ return 1;
+ }
+
+ slen = sizeof(ss);
+ if (getsockname(evconnlistener_get_fd(listener), (struct sockaddr *)&ss,
+ &slen) < 0) {
+ perror("getsockname");
+ return 1;
+ }
+
+ if (cfg_connlimit > 0) {
+ conn_bucket_cfg = ev_token_bucket_cfg_new(
+ cfg_connlimit, cfg_connlimit * 4,
+ cfg_connlimit, cfg_connlimit * 4,
+ &cfg_tick);
+ assert(conn_bucket_cfg);
+ }
+
+ if (cfg_grouplimit > 0) {
+ group_bucket_cfg = ev_token_bucket_cfg_new(
+ cfg_grouplimit, cfg_grouplimit * 4,
+ cfg_grouplimit, cfg_grouplimit * 4,
+ &cfg_tick);
+ group = ratelim_group = bufferevent_rate_limit_group_new(
+ base, group_bucket_cfg);
+ expected_total_persec = cfg_grouplimit - (cfg_group_drain / seconds_per_tick);
+ expected_avg_persec = cfg_grouplimit / cfg_n_connections;
+ if (cfg_connlimit > 0 && expected_avg_persec > cfg_connlimit)
+ expected_avg_persec = cfg_connlimit;
+ if (cfg_min_share >= 0)
+ bufferevent_rate_limit_group_set_min_share(
+ ratelim_group, cfg_min_share);
+ }
+
+ if (expected_avg_persec < 0 && cfg_connlimit > 0)
+ expected_avg_persec = cfg_connlimit;
+
+ if (expected_avg_persec > 0)
+ expected_avg_persec /= seconds_per_tick;
+ if (expected_total_persec > 0)
+ expected_total_persec /= seconds_per_tick;
+
+ bevs = calloc(cfg_n_connections, sizeof(struct bufferevent *));
+ states = calloc(cfg_n_connections, sizeof(struct client_state));
+
+ for (i = 0; i < cfg_n_connections; ++i) {
+ bevs[i] = bufferevent_socket_new(base, -1,
+ BEV_OPT_CLOSE_ON_FREE|BEV_OPT_THREADSAFE);
+ assert(bevs[i]);
+ bufferevent_setcb(bevs[i], discard_readcb, loud_writecb,
+ write_on_connectedcb, &states[i]);
+ bufferevent_enable(bevs[i], EV_READ|EV_WRITE);
+ bufferevent_socket_connect(bevs[i], (struct sockaddr *)&ss,
+ slen);
+ }
+
+ tv.tv_sec = cfg_duration - 1;
+ tv.tv_usec = 995000;
+
+ event_base_loopexit(base, &tv);
+
+ tv.tv_sec = 0;
+ tv.tv_usec = 100*1000;
+ ms100_common = event_base_init_common_timeout(base, &tv);
+
+ periodic_level_check = event_new(base, -1, EV_PERSIST, check_group_bucket_levels_cb, NULL);
+ event_add(periodic_level_check, ms100_common);
+
+ if (cfg_group_drain && ratelim_group) {
+ group_drain_event = event_new(base, -1, EV_PERSIST, group_drain_cb, NULL);
+ event_add(group_drain_event, &cfg_tick);
+ }
+
+ event_base_dispatch(base);
+
+ ratelim_group = NULL; /* So no more responders get added */
+ event_free(periodic_level_check);
+ if (group_drain_event)
+ event_del(group_drain_event);
+
+ for (i = 0; i < cfg_n_connections; ++i) {
+ bufferevent_free(bevs[i]);
+ }
+ evconnlistener_free(listener);
+
+ /* Make sure no new echo_conns get added to the group. */
+ ratelim_group = NULL;
+
+ /* This should get _everybody_ freed */
+ while (n_echo_conns_open) {
+ printf("waiting for %d conns\n", n_echo_conns_open);
+ tv.tv_sec = 0;
+ tv.tv_usec = 300000;
+ event_base_loopexit(base, &tv);
+ event_base_dispatch(base);
+ }
+
+ if (group)
+ bufferevent_rate_limit_group_free(group);
+
+ if (total_n_bev_checks) {
+ printf("Average read bucket level: %f\n",
+ (double)total_rbucket_level/total_n_bev_checks);
+ printf("Average write bucket level: %f\n",
+ (double)total_wbucket_level/total_n_bev_checks);
+ printf("Highest read bucket level: %f\n",
+ (double)max_bucket_level);
+ printf("Highest write bucket level: %f\n",
+ (double)min_bucket_level);
+ printf("Average max-to-read: %f\n",
+ ((double)total_max_to_read)/total_n_bev_checks);
+ printf("Average max-to-write: %f\n",
+ ((double)total_max_to_write)/total_n_bev_checks);
+ }
+ if (total_n_group_bev_checks) {
+ printf("Average group read bucket level: %f\n",
+ ((double)total_group_rbucket_level)/total_n_group_bev_checks);
+ printf("Average group write bucket level: %f\n",
+ ((double)total_group_wbucket_level)/total_n_group_bev_checks);
+ }
+
+ total_received = 0;
+ total_persec = 0.0;
+ total_sq_persec = 0.0;
+ for (i=0; i < cfg_n_connections; ++i) {
+ double persec = states[i].received;
+ persec /= cfg_duration;
+ total_received += states[i].received;
+ total_persec += persec;
+ total_sq_persec += persec*persec;
+ printf("%d: %f per second\n", i+1, persec);
+ }
+ printf(" total: %f per second\n",
+ ((double)total_received)/cfg_duration);
+ if (expected_total_persec > 0) {
+ double diff = expected_total_persec -
+ ((double)total_received/cfg_duration);
+ printf(" [Off by %lf]\n", diff);
+ if (cfg_grouplimit_tolerance > 0 &&
+ fabs(diff) > cfg_grouplimit_tolerance) {
+ fprintf(stderr, "Group bandwidth out of bounds\n");
+ ok = 0;
+ }
+ }
+
+ printf(" average: %f per second\n",
+ (((double)total_received)/cfg_duration)/cfg_n_connections);
+ if (expected_avg_persec > 0) {
+ double diff = expected_avg_persec - (((double)total_received)/cfg_duration)/cfg_n_connections;
+ printf(" [Off by %lf]\n", diff);
+ if (cfg_connlimit_tolerance > 0 &&
+ fabs(diff) > cfg_connlimit_tolerance) {
+ fprintf(stderr, "Connection bandwidth out of bounds\n");
+ ok = 0;
+ }
+ }
+
+ variance = total_sq_persec/cfg_n_connections - total_persec*total_persec/(cfg_n_connections*cfg_n_connections);
+
+ printf(" stddev: %f per second\n", sqrt(variance));
+ if (cfg_stddev_tolerance > 0 &&
+ sqrt(variance) > cfg_stddev_tolerance) {
+ fprintf(stderr, "Connection variance out of bounds\n");
+ ok = 0;
+ }
+
+ event_base_free(base);
+ free(bevs);
+ free(states);
+
+ return ok ? 0 : 1;
+}
+
+static struct option {
+ const char *name; int *ptr; int min; int isbool;
+} options[] = {
+ { "-v", &cfg_verbose, 0, 1 },
+ { "-h", &cfg_help, 0, 1 },
+ { "-n", &cfg_n_connections, 1, 0 },
+ { "-d", &cfg_duration, 1, 0 },
+ { "-c", &cfg_connlimit, 0, 0 },
+ { "-g", &cfg_grouplimit, 0, 0 },
+ { "-G", &cfg_group_drain, -100000, 0 },
+ { "-t", &cfg_tick_msec, 10, 0 },
+ { "--min-share", &cfg_min_share, 0, 0 },
+ { "--check-connlimit", &cfg_connlimit_tolerance, 0, 0 },
+ { "--check-grouplimit", &cfg_grouplimit_tolerance, 0, 0 },
+ { "--check-stddev", &cfg_stddev_tolerance, 0, 0 },
+#ifdef _WIN32
+ { "--iocp", &cfg_enable_iocp, 0, 1 },
+#endif
+ { NULL, NULL, -1, 0 },
+};
+
+static int
+handle_option(int argc, char **argv, int *i, const struct option *opt)
+{
+ long val;
+ char *endptr = NULL;
+ if (opt->isbool) {
+ *opt->ptr = 1;
+ return 0;
+ }
+ if (*i + 1 == argc) {
+ fprintf(stderr, "Too few arguments to '%s'\n",argv[*i]);
+ return -1;
+ }
+ val = strtol(argv[*i+1], &endptr, 10);
+ if (*argv[*i+1] == '\0' || !endptr || *endptr != '\0') {
+ fprintf(stderr, "Couldn't parse numeric value '%s'\n",
+ argv[*i+1]);
+ return -1;
+ }
+ if (val < opt->min || val > 0x7fffffff) {
+ fprintf(stderr, "Value '%s' is out-of-range'\n",
+ argv[*i+1]);
+ return -1;
+ }
+ *opt->ptr = (int)val;
+ ++*i;
+ return 0;
+}
+
+static void
+usage(void)
+{
+ fprintf(stderr,
+"test-ratelim [-v] [-n INT] [-d INT] [-c INT] [-g INT] [-t INT]\n\n"
+"Pushes bytes through a number of possibly rate-limited connections, and\n"
+"displays average throughput.\n\n"
+" -n INT: Number of connections to open (default: 30)\n"
+" -d INT: Duration of the test in seconds (default: 5 sec)\n");
+ fprintf(stderr,
+" -c INT: Connection-rate limit applied to each connection in bytes per second\n"
+" (default: None.)\n"
+" -g INT: Group-rate limit applied to sum of all usage in bytes per second\n"
+" (default: None.)\n"
+" -G INT: drain INT bytes from the group limit every tick. (default: 0)\n"
+" -t INT: Granularity of timing, in milliseconds (default: 1000 msec)\n");
+}
+
+int
+main(int argc, char **argv)
+{
+ int i,j;
+ double ratio;
+
+#ifdef _WIN32
+ WORD wVersionRequested = MAKEWORD(2,2);
+ WSADATA wsaData;
+
+ (void) WSAStartup(wVersionRequested, &wsaData);
+#endif
+
+ evutil_weakrand_seed_(&weakrand_state, 0);
+
+#ifndef _WIN32
+ if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
+ return 1;
+#endif
+ for (i = 1; i < argc; ++i) {
+ for (j = 0; options[j].name; ++j) {
+ if (!strcmp(argv[i],options[j].name)) {
+ if (handle_option(argc,argv,&i,&options[j])<0)
+ return 1;
+ goto again;
+ }
+ }
+ fprintf(stderr, "Unknown option '%s'\n", argv[i]);
+ usage();
+ return 1;
+ again:
+ ;
+ }
+ if (cfg_help) {
+ usage();
+ return 0;
+ }
+
+ cfg_tick.tv_sec = cfg_tick_msec / 1000;
+ cfg_tick.tv_usec = (cfg_tick_msec % 1000)*1000;
+
+ seconds_per_tick = ratio = cfg_tick_msec / 1000.0;
+
+ cfg_connlimit *= ratio;
+ cfg_grouplimit *= ratio;
+
+ {
+ struct timeval tv;
+ evutil_gettimeofday(&tv, NULL);
+#ifdef _WIN32
+ srand(tv.tv_usec);
+#else
+ srandom(tv.tv_usec);
+#endif
+ }
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ evthread_enable_lock_debugging();
+#endif
+
+ return test_ratelimiting();
+}
diff --git a/protocols/Telegram/tgl/libevent/test/test-ratelim.sh b/protocols/Telegram/tgl/libevent/test/test-ratelim.sh
new file mode 100644
index 0000000000..b5e0ca62a9
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/test-ratelim.sh
@@ -0,0 +1,88 @@
+#!/bin/sh
+
+FAILED=no
+
+if test "x$TEST_OUTPUT_FILE" = "x"
+then
+ TEST_OUTPUT_FILE=/dev/null
+fi
+
+# /bin/echo is a little more likely to support -n than sh's builtin echo.
+if test -x /bin/echo
+then
+ ECHO=/bin/echo
+else
+ ECHO=echo
+fi
+
+if test "$TEST_OUTPUT_FILE" != "/dev/null"
+then
+ touch "$TEST_OUTPUT_FILE" || exit 1
+fi
+
+TEST_DIR=.
+
+T=`echo "$0" | sed -e 's/test-ratelim.sh$//'`
+if test -x "$T/test-ratelim"
+then
+ TEST_DIR="$T"
+fi
+
+announce () {
+ echo $@
+ echo $@ >>"$TEST_OUTPUT_FILE"
+}
+
+announce_n () {
+ $ECHO -n $@
+ echo $@ >>"$TEST_OUTPUT_FILE"
+}
+
+
+run_tests () {
+ announce_n " Group limits, no connection limit:"
+ if $TEST_DIR/test-ratelim -g 30000 -n 30 -t 100 --check-grouplimit 1000 --check-stddev 100 >>"$TEST_OUTPUT_FILE"
+ then
+ announce OKAY
+ else
+ announce FAILED
+ FAILED=yes
+ fi
+
+ announce_n " Connection limit, no group limit:"
+ if $TEST_DIR/test-ratelim -c 1000 -n 30 -t 100 --check-connlimit 50 --check-stddev 50 >>"$TEST_OUTPUT_FILE"
+ then
+ announce OKAY ;
+ else
+ announce FAILED ;
+ FAILED=yes
+ fi
+
+ announce_n " Connection limit and group limit:"
+ if $TEST_DIR/test-ratelim -c 1000 -g 30000 -n 30 -t 100 --check-grouplimit 1000 --check-connlimit 50 --check-stddev 50 >>"$TEST_OUTPUT_FILE"
+ then
+ announce OKAY ;
+ else
+ announce FAILED ;
+ FAILED=yes
+ fi
+
+ announce_n " Connection limit and group limit with independent drain:"
+ if $TEST_DIR/test-ratelim -c 1000 -g 35000 -n 30 -t 100 -G 500 --check-grouplimit 1000 --check-connlimit 50 --check-stddev 50 >>"$TEST_OUTPUT_FILE"
+ then
+ announce OKAY ;
+ else
+ announce FAILED ;
+ FAILED=yes
+ fi
+
+
+}
+
+announce "Running rate-limiting tests:"
+
+run_tests
+
+if test "$FAILED" = "yes"; then
+ exit 1
+fi
diff --git a/protocols/Telegram/tgl/libevent/test/test-time.c b/protocols/Telegram/tgl/libevent/test/test-time.c
new file mode 100644
index 0000000000..bcc7086df7
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/test-time.c
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2002-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "event2/event-config.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#ifndef _WIN32
+#include <unistd.h>
+#include <sys/time.h>
+#endif
+#include <errno.h>
+
+#include "event2/event.h"
+#include "event2/event_compat.h"
+#include "event2/event_struct.h"
+#include "util-internal.h"
+
+int called = 0;
+
+#define NEVENT 20000
+
+struct event *ev[NEVENT];
+
+struct evutil_weakrand_state weakrand_state;
+
+static int
+rand_int(int n)
+{
+ return evutil_weakrand_(&weakrand_state) % n;
+}
+
+static void
+time_cb(evutil_socket_t fd, short event, void *arg)
+{
+ struct timeval tv;
+ int i, j;
+
+ called++;
+
+ if (called < 10*NEVENT) {
+ for (i = 0; i < 10; i++) {
+ j = rand_int(NEVENT);
+ tv.tv_sec = 0;
+ tv.tv_usec = rand_int(50000);
+ if (tv.tv_usec % 2 || called < NEVENT)
+ evtimer_add(ev[j], &tv);
+ else
+ evtimer_del(ev[j]);
+ }
+ }
+}
+
+int
+main(int argc, char **argv)
+{
+ struct timeval tv;
+ int i;
+#ifdef _WIN32
+ WORD wVersionRequested;
+ WSADATA wsaData;
+
+ wVersionRequested = MAKEWORD(2, 2);
+
+ (void) WSAStartup(wVersionRequested, &wsaData);
+#endif
+
+ evutil_weakrand_seed_(&weakrand_state, 0);
+
+ /* Initalize the event library */
+ event_init();
+
+ for (i = 0; i < NEVENT; i++) {
+ ev[i] = malloc(sizeof(struct event));
+
+ /* Initalize one event */
+ evtimer_set(ev[i], time_cb, ev[i]);
+ tv.tv_sec = 0;
+ tv.tv_usec = rand_int(50000);
+ evtimer_add(ev[i], &tv);
+ }
+
+ event_dispatch();
+
+
+ printf("%d, %d\n", called, NEVENT);
+ return (called < NEVENT);
+}
+
diff --git a/protocols/Telegram/tgl/libevent/test/test-time.exe b/protocols/Telegram/tgl/libevent/test/test-time.exe
new file mode 100644
index 0000000000..7cdcfd61ac
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/test-time.exe
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/test-time.obj b/protocols/Telegram/tgl/libevent/test/test-time.obj
new file mode 100644
index 0000000000..c5fa6cbeac
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/test-time.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/test-weof.c b/protocols/Telegram/tgl/libevent/test/test-weof.c
new file mode 100644
index 0000000000..c379f287cb
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/test-weof.c
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2002-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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 "event2/event-config.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#else
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef EVENT__HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <signal.h>
+#include <errno.h>
+
+#include "event2/event.h"
+#include "event2/event_struct.h"
+#include "event2/event_compat.h"
+#include "event2/util.h"
+
+#ifdef EVENT____func__
+#define __func__ EVENT____func__
+#endif
+
+evutil_socket_t pair[2];
+int test_okay = 1;
+int called = 0;
+
+static void
+write_cb(evutil_socket_t fd, short event, void *arg)
+{
+ const char *test = "test string";
+ int len;
+
+ len = send(fd, test, (int)strlen(test) + 1, 0);
+
+ printf("%s: write %d%s\n", __func__,
+ len, len ? "" : " - means EOF");
+
+ if (len > 0) {
+ if (!called)
+ event_add(arg, NULL);
+ evutil_closesocket(pair[0]);
+ } else if (called == 1)
+ test_okay = 0;
+
+ called++;
+}
+
+int
+main(int argc, char **argv)
+{
+ struct event ev;
+
+#ifdef _WIN32
+ WORD wVersionRequested;
+ WSADATA wsaData;
+
+ wVersionRequested = MAKEWORD(2, 2);
+
+ (void) WSAStartup(wVersionRequested, &wsaData);
+#endif
+
+#ifndef _WIN32
+ if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
+ return (1);
+#endif
+
+ if (evutil_socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1)
+ return (1);
+
+ /* Initalize the event library */
+ event_init();
+
+ /* Initalize one event */
+ event_set(&ev, pair[1], EV_WRITE, write_cb, &ev);
+
+ event_add(&ev, NULL);
+
+ event_dispatch();
+
+ return (test_okay);
+}
+
diff --git a/protocols/Telegram/tgl/libevent/test/test-weof.exe b/protocols/Telegram/tgl/libevent/test/test-weof.exe
new file mode 100644
index 0000000000..1fe6973f46
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/test-weof.exe
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/test-weof.obj b/protocols/Telegram/tgl/libevent/test/test-weof.obj
new file mode 100644
index 0000000000..5ca123d600
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/test-weof.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/test.sh b/protocols/Telegram/tgl/libevent/test/test.sh
new file mode 100644
index 0000000000..b73c1adced
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/test.sh
@@ -0,0 +1,160 @@
+#!/bin/sh
+
+BACKENDS="EVPORT KQUEUE EPOLL DEVPOLL POLL SELECT WIN32"
+TESTS="test-eof test-closed test-weof test-time test-changelist test-fdleak"
+FAILED=no
+TEST_OUTPUT_FILE=${TEST_OUTPUT_FILE:-/dev/null}
+REGRESS_ARGS=${REGRESS_ARGS:-}
+
+# /bin/echo is a little more likely to support -n than sh's builtin echo,
+# printf is even more likely
+if test "`printf %s hello 2>&1`" = "hello"
+then
+ ECHO_N="printf %s"
+else
+ if test -x /bin/echo
+ then
+ ECHO_N="/bin/echo -n"
+ else
+ ECHO_N="echo -n"
+ fi
+fi
+
+if test "$TEST_OUTPUT_FILE" != "/dev/null"
+then
+ touch "$TEST_OUTPUT_FILE" || exit 1
+fi
+
+TEST_DIR=.
+TEST_SRC_DIR=.
+
+T=`echo "$0" | sed -e 's/test.sh$//' | sed -e 's/test-script.sh//' `
+if test -x "$T/test-init"
+then
+ TEST_DIR="$T"
+elif test -x "./test/test-init"
+then
+ TEST_DIR="./test"
+fi
+if test -f "$T/check-dumpevents.py"
+then
+ TEST_SRC_DIR="$T"
+elif test -f "./test/check-dumpevents.py"
+then
+ TEST_SRC_DIR="./test"
+fi
+
+setup () {
+ for i in $BACKENDS; do
+ eval "EVENT_NO$i=yes; export EVENT_NO$i"
+ done
+ unset EVENT_EPOLL_USE_CHANGELIST
+ unset EVENT_PRECISE_TIMER
+}
+
+announce () {
+ echo "$@"
+ echo "$@" >>"$TEST_OUTPUT_FILE"
+}
+
+announce_n () {
+ $ECHO_N "$@"
+ echo "$@" >>"$TEST_OUTPUT_FILE"
+}
+
+
+run_tests () {
+ if $TEST_DIR/test-init 2>>"$TEST_OUTPUT_FILE" ;
+ then
+ true
+ else
+ announce Skipping test
+ return
+ fi
+ for i in $TESTS; do
+ announce_n " $i: "
+ if $TEST_DIR/$i >>"$TEST_OUTPUT_FILE" ;
+ then
+ announce OKAY ;
+ else
+ announce FAILED ;
+ FAILED=yes
+ fi
+ done
+ announce_n " test-dumpevents: "
+ if python2 -c 'import sys; assert(sys.version_info >= (2, 4))' 2>/dev/null && test -f $TEST_SRC_DIR/check-dumpevents.py; then
+ if $TEST_DIR/test-dumpevents | python2 $TEST_SRC_DIR/check-dumpevents.py >> "$TEST_OUTPUT_FILE" ;
+ then
+ announce OKAY ;
+ else
+ announce FAILED ;
+ fi
+ else
+ # no python
+ if $TEST_DIR/test-dumpevents >/dev/null; then
+ announce "OKAY (output not checked)" ;
+ else
+ announce "FAILED (output not checked)" ;
+ fi
+ fi
+
+ test -x $TEST_DIR/regress || return
+ announce_n " regress: "
+ if test "$TEST_OUTPUT_FILE" = "/dev/null" ;
+ then
+ $TEST_DIR/regress --quiet $REGRESS_ARGS
+ else
+ $TEST_DIR/regress $REGRESS_ARGS >>"$TEST_OUTPUT_FILE"
+ fi
+ if test "$?" = "0" ;
+ then
+ announce OKAY ;
+ else
+ announce FAILED ;
+ FAILED=yes
+ fi
+
+ announce_n " regress_debug: "
+ if test "$TEST_OUTPUT_FILE" = "/dev/null" ;
+ then
+ EVENT_DEBUG_MODE=1 $TEST_DIR/regress --quiet $REGRESS_ARGS
+ else
+ EVENT_DEBUG_MODE=1 $TEST_DIR/regress $REGRESS_ARGS >>"$TEST_OUTPUT_FILE"
+ fi
+ if test "$?" = "0" ;
+ then
+ announce OKAY ;
+ else
+ announce FAILED ;
+ FAILED=yes
+ fi
+}
+
+do_test() {
+ setup
+ announce "$1 $2"
+ unset EVENT_NO$1
+ if test "$2" = "(changelist)" ; then
+ EVENT_EPOLL_USE_CHANGELIST=yes; export EVENT_EPOLL_USE_CHANGELIST
+ elif test "$2" = "(timerfd)" ; then
+ EVENT_PRECISE_TIMER=1; export EVENT_PRECISE_TIMER
+ elif test "$2" = "(timerfd+changelist)" ; then
+ EVENT_EPOLL_USE_CHANGELIST=yes; export EVENT_EPOLL_USE_CHANGELIST
+ EVENT_PRECISE_TIMER=1; export EVENT_PRECISE_TIMER
+ fi
+
+ run_tests
+}
+
+announce "Running tests:"
+
+do_test EPOLL "(timerfd)"
+do_test EPOLL "(changelist)"
+do_test EPOLL "(timerfd+changelist)"
+for i in $BACKENDS; do
+ do_test $i
+done
+
+if test "$FAILED" = "yes"; then
+ exit 1
+fi
diff --git a/protocols/Telegram/tgl/libevent/test/tinytest.c b/protocols/Telegram/tgl/libevent/test/tinytest.c
new file mode 100644
index 0000000000..3a8e331055
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/tinytest.c
@@ -0,0 +1,493 @@
+/* tinytest.c -- Copyright 2009-2012 Nick Mathewson
+ *
+ * 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.
+ */
+#ifdef TINYTEST_LOCAL
+#include "tinytest_local.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+#ifndef NO_FORKING
+
+#ifdef _WIN32
+#include <windows.h>
+#else
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#endif
+
+#if defined(__APPLE__) && defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
+#if (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1060 && \
+ __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
+/* Workaround for a stupid bug in OSX 10.6 */
+#define FORK_BREAKS_GCOV
+#include <vproc.h>
+#endif
+#endif
+
+#endif /* !NO_FORKING */
+
+#ifndef __GNUC__
+#define __attribute__(x)
+#endif
+
+#include "tinytest.h"
+#include "tinytest_macros.h"
+
+#define LONGEST_TEST_NAME 16384
+
+static int in_tinytest_main = 0; /**< true if we're in tinytest_main().*/
+static int n_ok = 0; /**< Number of tests that have passed */
+static int n_bad = 0; /**< Number of tests that have failed. */
+static int n_skipped = 0; /**< Number of tests that have been skipped. */
+
+static int opt_forked = 0; /**< True iff we're called from inside a win32 fork*/
+static int opt_nofork = 0; /**< Suppress calls to fork() for debugging. */
+static int opt_verbosity = 1; /**< -==quiet,0==terse,1==normal,2==verbose */
+const char *verbosity_flag = "";
+
+const struct testlist_alias_t *cfg_aliases=NULL;
+
+enum outcome { SKIP=2, OK=1, FAIL=0 };
+static enum outcome cur_test_outcome = 0;
+const char *cur_test_prefix = NULL; /**< prefix of the current test group */
+/** Name of the current test, if we haven't logged is yet. Used for --quiet */
+const char *cur_test_name = NULL;
+
+#ifdef _WIN32
+/* Copy of argv[0] for win32. */
+static char commandname[MAX_PATH+1];
+#endif
+
+static void usage(struct testgroup_t *groups, int list_groups)
+ __attribute__((noreturn));
+static int process_test_option(struct testgroup_t *groups, const char *test);
+
+static enum outcome
+testcase_run_bare_(const struct testcase_t *testcase)
+{
+ void *env = NULL;
+ int outcome;
+ if (testcase->setup) {
+ env = testcase->setup->setup_fn(testcase);
+ if (!env)
+ return FAIL;
+ else if (env == (void*)TT_SKIP)
+ return SKIP;
+ }
+
+ cur_test_outcome = OK;
+ testcase->fn(env);
+ outcome = cur_test_outcome;
+
+ if (testcase->setup) {
+ if (testcase->setup->cleanup_fn(testcase, env) == 0)
+ outcome = FAIL;
+ }
+
+ return outcome;
+}
+
+#define MAGIC_EXITCODE 42
+
+#ifndef NO_FORKING
+
+static enum outcome
+testcase_run_forked_(const struct testgroup_t *group,
+ const struct testcase_t *testcase)
+{
+#ifdef _WIN32
+ /* Fork? On Win32? How primitive! We'll do what the smart kids do:
+ we'll invoke our own exe (whose name we recall from the command
+ line) with a command line that tells it to run just the test we
+ want, and this time without forking.
+
+ (No, threads aren't an option. The whole point of forking is to
+ share no state between tests.)
+ */
+ int ok;
+ char buffer[LONGEST_TEST_NAME+256];
+ STARTUPINFOA si;
+ PROCESS_INFORMATION info;
+ DWORD exitcode;
+
+ if (!in_tinytest_main) {
+ printf("\nERROR. On Windows, testcase_run_forked_ must be"
+ " called from within tinytest_main.\n");
+ abort();
+ }
+ if (opt_verbosity>0)
+ printf("[forking] ");
+
+ snprintf(buffer, sizeof(buffer), "%s --RUNNING-FORKED %s %s%s",
+ commandname, verbosity_flag, group->prefix, testcase->name);
+
+ memset(&si, 0, sizeof(si));
+ memset(&info, 0, sizeof(info));
+ si.cb = sizeof(si);
+
+ ok = CreateProcessA(commandname, buffer, NULL, NULL, 0,
+ 0, NULL, NULL, &si, &info);
+ if (!ok) {
+ printf("CreateProcess failed!\n");
+ return 0;
+ }
+ WaitForSingleObject(info.hProcess, INFINITE);
+ GetExitCodeProcess(info.hProcess, &exitcode);
+ CloseHandle(info.hProcess);
+ CloseHandle(info.hThread);
+ if (exitcode == 0)
+ return OK;
+ else if (exitcode == MAGIC_EXITCODE)
+ return SKIP;
+ else
+ return FAIL;
+#else
+ int outcome_pipe[2];
+ pid_t pid;
+ (void)group;
+
+ if (pipe(outcome_pipe))
+ perror("opening pipe");
+
+ if (opt_verbosity>0)
+ printf("[forking] ");
+ pid = fork();
+#ifdef FORK_BREAKS_GCOV
+ vproc_transaction_begin(0);
+#endif
+ if (!pid) {
+ /* child. */
+ int test_r, write_r;
+ char b[1];
+ close(outcome_pipe[0]);
+ test_r = testcase_run_bare_(testcase);
+ assert(0<=(int)test_r && (int)test_r<=2);
+ b[0] = "NYS"[test_r];
+ write_r = (int)write(outcome_pipe[1], b, 1);
+ if (write_r != 1) {
+ perror("write outcome to pipe");
+ exit(1);
+ }
+ exit(0);
+ return FAIL; /* unreachable */
+ } else {
+ /* parent */
+ int status, r;
+ char b[1];
+ /* Close this now, so that if the other side closes it,
+ * our read fails. */
+ close(outcome_pipe[1]);
+ r = (int)read(outcome_pipe[0], b, 1);
+ if (r == 0) {
+ printf("[Lost connection!] ");
+ return 0;
+ } else if (r != 1) {
+ perror("read outcome from pipe");
+ }
+ waitpid(pid, &status, 0);
+ close(outcome_pipe[0]);
+ return b[0]=='Y' ? OK : (b[0]=='S' ? SKIP : FAIL);
+ }
+#endif
+}
+
+#endif /* !NO_FORKING */
+
+int
+testcase_run_one(const struct testgroup_t *group,
+ const struct testcase_t *testcase)
+{
+ enum outcome outcome;
+
+ if (testcase->flags & (TT_SKIP|TT_OFF_BY_DEFAULT)) {
+ if (opt_verbosity>0)
+ printf("%s%s: %s\n",
+ group->prefix, testcase->name,
+ (testcase->flags & TT_SKIP) ? "SKIPPED" : "DISABLED");
+ ++n_skipped;
+ return SKIP;
+ }
+
+ if (opt_verbosity>0 && !opt_forked) {
+ printf("%s%s: ", group->prefix, testcase->name);
+ } else {
+ if (opt_verbosity==0) printf(".");
+ cur_test_prefix = group->prefix;
+ cur_test_name = testcase->name;
+ }
+
+#ifndef NO_FORKING
+ if ((testcase->flags & TT_FORK) && !(opt_forked||opt_nofork)) {
+ outcome = testcase_run_forked_(group, testcase);
+ } else {
+#else
+ {
+#endif
+ outcome = testcase_run_bare_(testcase);
+ }
+
+ if (outcome == OK) {
+ ++n_ok;
+ if (opt_verbosity>0 && !opt_forked)
+ puts(opt_verbosity==1?"OK":"");
+ } else if (outcome == SKIP) {
+ ++n_skipped;
+ if (opt_verbosity>0 && !opt_forked)
+ puts("SKIPPED");
+ } else {
+ ++n_bad;
+ if (!opt_forked)
+ printf("\n [%s FAILED]\n", testcase->name);
+ }
+
+ if (opt_forked) {
+ exit(outcome==OK ? 0 : (outcome==SKIP?MAGIC_EXITCODE : 1));
+ return 1; /* unreachable */
+ } else {
+ return (int)outcome;
+ }
+}
+
+int
+tinytest_set_flag_(struct testgroup_t *groups, const char *arg, int set, unsigned long flag)
+{
+ int i, j;
+ size_t length = LONGEST_TEST_NAME;
+ char fullname[LONGEST_TEST_NAME];
+ int found=0;
+ if (strstr(arg, ".."))
+ length = strstr(arg,"..")-arg;
+ for (i=0; groups[i].prefix; ++i) {
+ for (j=0; groups[i].cases[j].name; ++j) {
+ struct testcase_t *testcase = &groups[i].cases[j];
+ snprintf(fullname, sizeof(fullname), "%s%s",
+ groups[i].prefix, testcase->name);
+ if (!flag) { /* Hack! */
+ printf(" %s", fullname);
+ if (testcase->flags & TT_OFF_BY_DEFAULT)
+ puts(" (Off by default)");
+ else if (testcase->flags & TT_SKIP)
+ puts(" (DISABLED)");
+ else
+ puts("");
+ }
+ if (!strncmp(fullname, arg, length)) {
+ if (set)
+ testcase->flags |= flag;
+ else
+ testcase->flags &= ~flag;
+ ++found;
+ }
+ }
+ }
+ return found;
+}
+
+static void
+usage(struct testgroup_t *groups, int list_groups)
+{
+ puts("Options are: [--verbose|--quiet|--terse] [--no-fork]");
+ puts(" Specify tests by name, or using a prefix ending with '..'");
+ puts(" To skip a test, prefix its name with a colon.");
+ puts(" To enable a disabled test, prefix its name with a plus.");
+ puts(" Use --list-tests for a list of tests.");
+ if (list_groups) {
+ puts("Known tests are:");
+ tinytest_set_flag_(groups, "..", 1, 0);
+ }
+ exit(0);
+}
+
+static int
+process_test_alias(struct testgroup_t *groups, const char *test)
+{
+ int i, j, n, r;
+ for (i=0; cfg_aliases && cfg_aliases[i].name; ++i) {
+ if (!strcmp(cfg_aliases[i].name, test)) {
+ n = 0;
+ for (j = 0; cfg_aliases[i].tests[j]; ++j) {
+ r = process_test_option(groups, cfg_aliases[i].tests[j]);
+ if (r<0)
+ return -1;
+ n += r;
+ }
+ return n;
+ }
+ }
+ printf("No such test alias as @%s!",test);
+ return -1;
+}
+
+static int
+process_test_option(struct testgroup_t *groups, const char *test)
+{
+ int flag = TT_ENABLED_;
+ int n = 0;
+ if (test[0] == '@') {
+ return process_test_alias(groups, test + 1);
+ } else if (test[0] == ':') {
+ ++test;
+ flag = TT_SKIP;
+ } else if (test[0] == '+') {
+ ++test;
+ ++n;
+ if (!tinytest_set_flag_(groups, test, 0, TT_OFF_BY_DEFAULT)) {
+ printf("No such test as %s!\n", test);
+ return -1;
+ }
+ } else {
+ ++n;
+ }
+ if (!tinytest_set_flag_(groups, test, 1, flag)) {
+ printf("No such test as %s!\n", test);
+ return -1;
+ }
+ return n;
+}
+
+void
+tinytest_set_aliases(const struct testlist_alias_t *aliases)
+{
+ cfg_aliases = aliases;
+}
+
+int
+tinytest_main(int c, const char **v, struct testgroup_t *groups)
+{
+ int i, j, n=0;
+
+#ifdef _WIN32
+ const char *sp = strrchr(v[0], '.');
+ const char *extension = "";
+ if (!sp || stricmp(sp, ".exe"))
+ extension = ".exe"; /* Add an exe so CreateProcess will work */
+ snprintf(commandname, sizeof(commandname), "%s%s", v[0], extension);
+ commandname[MAX_PATH]='\0';
+#endif
+ for (i=1; i<c; ++i) {
+ if (v[i][0] == '-') {
+ if (!strcmp(v[i], "--RUNNING-FORKED")) {
+ opt_forked = 1;
+ } else if (!strcmp(v[i], "--no-fork")) {
+ opt_nofork = 1;
+ } else if (!strcmp(v[i], "--quiet")) {
+ opt_verbosity = -1;
+ verbosity_flag = "--quiet";
+ } else if (!strcmp(v[i], "--verbose")) {
+ opt_verbosity = 2;
+ verbosity_flag = "--verbose";
+ } else if (!strcmp(v[i], "--terse")) {
+ opt_verbosity = 0;
+ verbosity_flag = "--terse";
+ } else if (!strcmp(v[i], "--help")) {
+ usage(groups, 0);
+ } else if (!strcmp(v[i], "--list-tests")) {
+ usage(groups, 1);
+ } else {
+ printf("Unknown option %s. Try --help\n",v[i]);
+ return -1;
+ }
+ } else {
+ int r = process_test_option(groups, v[i]);
+ if (r<0)
+ return -1;
+ n += r;
+ }
+ }
+ if (!n)
+ tinytest_set_flag_(groups, "..", 1, TT_ENABLED_);
+
+#ifdef _IONBF
+ setvbuf(stdout, NULL, _IONBF, 0);
+#endif
+
+ ++in_tinytest_main;
+ for (i=0; groups[i].prefix; ++i)
+ for (j=0; groups[i].cases[j].name; ++j)
+ if (groups[i].cases[j].flags & TT_ENABLED_)
+ testcase_run_one(&groups[i],
+ &groups[i].cases[j]);
+
+ --in_tinytest_main;
+
+ if (opt_verbosity==0)
+ puts("");
+
+ if (n_bad)
+ printf("%d/%d TESTS FAILED. (%d skipped)\n", n_bad,
+ n_bad+n_ok,n_skipped);
+ else if (opt_verbosity >= 1)
+ printf("%d tests ok. (%d skipped)\n", n_ok, n_skipped);
+
+ return (n_bad == 0) ? 0 : 1;
+}
+
+int
+tinytest_get_verbosity_(void)
+{
+ return opt_verbosity;
+}
+
+void
+tinytest_set_test_failed_(void)
+{
+ if (opt_verbosity <= 0 && cur_test_name) {
+ if (opt_verbosity==0) puts("");
+ printf("%s%s: ", cur_test_prefix, cur_test_name);
+ cur_test_name = NULL;
+ }
+ cur_test_outcome = 0;
+}
+
+void
+tinytest_set_test_skipped_(void)
+{
+ if (cur_test_outcome==OK)
+ cur_test_outcome = SKIP;
+}
+
+char *
+tinytest_format_hex_(const void *val_, unsigned long len)
+{
+ const unsigned char *val = val_;
+ char *result, *cp;
+ size_t i;
+
+ if (!val)
+ return strdup("null");
+ if (!(result = malloc(len*2+1)))
+ return strdup("<allocation failure>");
+ cp = result;
+ for (i=0;i<len;++i) {
+ *cp++ = "0123456789ABCDEF"[val[i] >> 4];
+ *cp++ = "0123456789ABCDEF"[val[i] & 0x0f];
+ }
+ *cp = 0;
+ return result;
+}
diff --git a/protocols/Telegram/tgl/libevent/test/tinytest.h b/protocols/Telegram/tgl/libevent/test/tinytest.h
new file mode 100644
index 0000000000..ed07b26bc0
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/tinytest.h
@@ -0,0 +1,100 @@
+/* tinytest.h -- Copyright 2009-2012 Nick Mathewson
+ *
+ * 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.
+ */
+
+#ifndef TINYTEST_H_INCLUDED_
+#define TINYTEST_H_INCLUDED_
+
+/** Flag for a test that needs to run in a subprocess. */
+#define TT_FORK (1<<0)
+/** Runtime flag for a test we've decided to skip. */
+#define TT_SKIP (1<<1)
+/** Internal runtime flag for a test we've decided to run. */
+#define TT_ENABLED_ (1<<2)
+/** Flag for a test that's off by default. */
+#define TT_OFF_BY_DEFAULT (1<<3)
+/** If you add your own flags, make them start at this point. */
+#define TT_FIRST_USER_FLAG (1<<4)
+
+typedef void (*testcase_fn)(void *);
+
+struct testcase_t;
+
+/** Functions to initialize/teardown a structure for a testcase. */
+struct testcase_setup_t {
+ /** Return a new structure for use by a given testcase. */
+ void *(*setup_fn)(const struct testcase_t *);
+ /** Clean/free a structure from setup_fn. Return 1 if ok, 0 on err. */
+ int (*cleanup_fn)(const struct testcase_t *, void *);
+};
+
+/** A single test-case that you can run. */
+struct testcase_t {
+ const char *name; /**< An identifier for this case. */
+ testcase_fn fn; /**< The function to run to implement this case. */
+ unsigned long flags; /**< Bitfield of TT_* flags. */
+ const struct testcase_setup_t *setup; /**< Optional setup/cleanup fns*/
+ void *setup_data; /**< Extra data usable by setup function */
+};
+#define END_OF_TESTCASES { NULL, NULL, 0, NULL, NULL }
+
+/** A group of tests that are selectable together. */
+struct testgroup_t {
+ const char *prefix; /**< Prefix to prepend to testnames. */
+ struct testcase_t *cases; /** Array, ending with END_OF_TESTCASES */
+};
+#define END_OF_GROUPS { NULL, NULL}
+
+struct testlist_alias_t {
+ const char *name;
+ const char **tests;
+};
+#define END_OF_ALIASES { NULL, NULL }
+
+/** Implementation: called from a test to indicate failure, before logging. */
+void tinytest_set_test_failed_(void);
+/** Implementation: called from a test to indicate that we're skipping. */
+void tinytest_set_test_skipped_(void);
+/** Implementation: return 0 for quiet, 1 for normal, 2 for loud. */
+int tinytest_get_verbosity_(void);
+/** Implementation: Set a flag on tests matching a name; returns number
+ * of tests that matched. */
+int tinytest_set_flag_(struct testgroup_t *, const char *, int set, unsigned long);
+/** Implementation: Put a chunk of memory into hex. */
+char *tinytest_format_hex_(const void *, unsigned long);
+
+/** Set all tests in 'groups' matching the name 'named' to be skipped. */
+#define tinytest_skip(groups, named) \
+ tinytest_set_flag_(groups, named, 1, TT_SKIP)
+
+/** Run a single testcase in a single group. */
+int testcase_run_one(const struct testgroup_t *,const struct testcase_t *);
+
+void tinytest_set_aliases(const struct testlist_alias_t *aliases);
+
+/** Run a set of testcases from an END_OF_GROUPS-terminated array of groups,
+ as selected from the command line. */
+int tinytest_main(int argc, const char **argv, struct testgroup_t *groups);
+
+#endif
diff --git a/protocols/Telegram/tgl/libevent/test/tinytest.obj b/protocols/Telegram/tgl/libevent/test/tinytest.obj
new file mode 100644
index 0000000000..f9b5885695
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/tinytest.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/libevent/test/tinytest_demo.c b/protocols/Telegram/tgl/libevent/test/tinytest_demo.c
new file mode 100644
index 0000000000..f6bfd66a1a
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/tinytest_demo.c
@@ -0,0 +1,262 @@
+/* tinytest_demo.c -- Copyright 2009-2012 Nick Mathewson
+ *
+ * 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.
+ */
+
+
+/* Welcome to the example file for tinytest! I'll show you how to set up
+ * some simple and not-so-simple testcases. */
+
+/* Make sure you include these headers. */
+#include "tinytest.h"
+#include "tinytest_macros.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <time.h>
+#ifdef _WIN32
+#include <windows.h>
+#else
+#include <unistd.h>
+#endif
+
+/* ============================================================ */
+
+/* First, let's see if strcmp is working. (All your test cases should be
+ * functions declared to take a single void * as an argument.) */
+void
+test_strcmp(void *data)
+{
+ (void)data; /* This testcase takes no data. */
+
+ /* Let's make sure the empty string is equal to itself */
+ if (strcmp("","")) {
+ /* This macro tells tinytest to stop the current test
+ * and go straight to the "end" label. */
+ tt_abort_msg("The empty string was not equal to itself");
+ }
+
+ /* Pretty often, calling tt_abort_msg to indicate failure is more
+ heavy-weight than you want. Instead, just say: */
+ tt_assert(strcmp("testcase", "testcase") == 0);
+
+ /* Occasionally, you don't want to stop the current testcase just
+ because a single assertion has failed. In that case, use
+ tt_want: */
+ tt_want(strcmp("tinytest", "testcase") > 0);
+
+ /* You can use the tt_*_op family of macros to compare values and to
+ fail unless they have the relationship you want. They produce
+ more useful output than tt_assert, since they display the actual
+ values of the failing things.
+
+ Fail unless strcmp("abc, "abc") == 0 */
+ tt_int_op(strcmp("abc", "abc"), ==, 0);
+
+ /* Fail unless strcmp("abc, "abcd") is less than 0 */
+ tt_int_op(strcmp("abc", "abcd"), < , 0);
+
+ /* Incidentally, there's a test_str_op that uses strcmp internally. */
+ tt_str_op("abc", <, "abcd");
+
+
+ /* Every test-case function needs to finish with an "end:"
+ label and (optionally) code to clean up local variables. */
+ end:
+ ;
+}
+
+/* ============================================================ */
+
+/* Now let's mess with setup and teardown functions! These are handy if
+ you have a bunch of tests that all need a similar environment, and you
+ want to reconstruct that environment freshly for each one. */
+
+/* First you declare a type to hold the environment info, and functions to
+ set it up and tear it down. */
+struct data_buffer {
+ /* We're just going to have couple of character buffer. Using
+ setup/teardown functions is probably overkill for this case.
+
+ You could also do file descriptors, complicated handles, temporary
+ files, etc. */
+ char buffer1[512];
+ char buffer2[512];
+};
+/* The setup function needs to take a const struct testcase_t and return
+ void* */
+void *
+setup_data_buffer(const struct testcase_t *testcase)
+{
+ struct data_buffer *db = malloc(sizeof(struct data_buffer));
+
+ /* If you had a complicated set of setup rules, you might behave
+ differently here depending on testcase->flags or
+ testcase->setup_data or even or testcase->name. */
+
+ /* Returning a NULL here would mean that we couldn't set up for this
+ test, so we don't need to test db for null. */
+ return db;
+}
+/* The clean function deallocates storage carefully and returns true on
+ success. */
+int
+clean_data_buffer(const struct testcase_t *testcase, void *ptr)
+{
+ struct data_buffer *db = ptr;
+
+ if (db) {
+ free(db);
+ return 1;
+ }
+ return 0;
+}
+/* Finally, declare a testcase_setup_t with these functions. */
+struct testcase_setup_t data_buffer_setup = {
+ setup_data_buffer, clean_data_buffer
+};
+
+
+/* Now let's write our test. */
+void
+test_memcpy(void *ptr)
+{
+ /* This time, we use the argument. */
+ struct data_buffer *db = ptr;
+
+ /* We'll also introduce a local variable that might need cleaning up. */
+ char *mem = NULL;
+
+ /* Let's make sure that memcpy does what we'd like. */
+ strcpy(db->buffer1, "String 0");
+ memcpy(db->buffer2, db->buffer1, sizeof(db->buffer1));
+ tt_str_op(db->buffer1, ==, db->buffer2);
+
+ /* This one works if there's an internal NUL. */
+ tt_mem_op(db->buffer1, <, db->buffer2, sizeof(db->buffer1));
+
+ /* Now we've allocated memory that's referenced by a local variable.
+ The end block of the function will clean it up. */
+ mem = strdup("Hello world.");
+ tt_assert(mem);
+
+ /* Another rather trivial test. */
+ tt_str_op(db->buffer1, !=, mem);
+
+ end:
+ /* This time our end block has something to do. */
+ if (mem)
+ free(mem);
+}
+
+void
+test_timeout(void *ptr)
+{
+ time_t t1, t2;
+ (void)ptr;
+ t1 = time(NULL);
+#ifdef _WIN32
+ Sleep(5000);
+#else
+ sleep(5);
+#endif
+ t2 = time(NULL);
+
+ tt_int_op(t2-t1, >=, 4);
+
+ tt_int_op(t2-t1, <=, 6);
+
+ end:
+ ;
+}
+
+/* ============================================================ */
+
+/* Now we need to make sure that our tests get invoked. First, you take
+ a bunch of related tests and put them into an array of struct testcase_t.
+*/
+
+struct testcase_t demo_tests[] = {
+ /* Here's a really simple test: it has a name you can refer to it
+ with, and a function to invoke it. */
+ { "strcmp", test_strcmp, },
+
+ /* The second test has a flag, "TT_FORK", to make it run in a
+ subprocess, and a pointer to the testcase_setup_t that configures
+ its environment. */
+ { "memcpy", test_memcpy, TT_FORK, &data_buffer_setup },
+
+ /* This flag is off-by-default, since it takes a while to run. You
+ * can enable it manually by passing +demo/timeout at the command line.*/
+ { "timeout", test_timeout, TT_OFF_BY_DEFAULT },
+
+ /* The array has to end with END_OF_TESTCASES. */
+ END_OF_TESTCASES
+};
+
+/* Next, we make an array of testgroups. This is mandatory. Unlike more
+ heavy-duty testing frameworks, groups can't nest. */
+struct testgroup_t groups[] = {
+
+ /* Every group has a 'prefix', and an array of tests. That's it. */
+ { "demo/", demo_tests },
+
+ END_OF_GROUPS
+};
+
+/* We can also define test aliases. These can be used for types of tests that
+ * cut across groups. */
+const char *alltests[] = { "+..", NULL };
+const char *slowtests[] = { "+demo/timeout", NULL };
+struct testlist_alias_t aliases[] = {
+
+ { "ALL", alltests },
+ { "SLOW", slowtests },
+
+ END_OF_ALIASES
+};
+
+
+int
+main(int c, const char **v)
+{
+ /* Finally, just call tinytest_main(). It lets you specify verbose
+ or quiet output with --verbose and --quiet. You can list
+ specific tests:
+
+ tinytest-demo demo/memcpy
+
+ or use a ..-wildcard to select multiple tests with a common
+ prefix:
+
+ tinytest-demo demo/..
+
+ If you list no tests, you get them all by default, so that
+ "tinytest-demo" and "tinytest-demo .." mean the same thing.
+
+ */
+ tinytest_set_aliases(aliases);
+ return tinytest_main(c, v, groups);
+}
diff --git a/protocols/Telegram/tgl/libevent/test/tinytest_local.h b/protocols/Telegram/tgl/libevent/test/tinytest_local.h
new file mode 100644
index 0000000000..87ec2fa67e
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/tinytest_local.h
@@ -0,0 +1,12 @@
+
+#include "util-internal.h"
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+
+#include "event2/util.h"
+
+#ifdef snprintf
+#undef snprintf
+#endif
+#define snprintf evutil_snprintf
diff --git a/protocols/Telegram/tgl/libevent/test/tinytest_macros.h b/protocols/Telegram/tgl/libevent/test/tinytest_macros.h
new file mode 100644
index 0000000000..c3728d1fdd
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/test/tinytest_macros.h
@@ -0,0 +1,199 @@
+/* tinytest_macros.h -- Copyright 2009-2012 Nick Mathewson
+ *
+ * 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.
+ */
+
+#ifndef TINYTEST_MACROS_H_INCLUDED_
+#define TINYTEST_MACROS_H_INCLUDED_
+
+/* Helpers for defining statement-like macros */
+#define TT_STMT_BEGIN do {
+#define TT_STMT_END } while (0)
+
+/* Redefine this if your test functions want to abort with something besides
+ * "goto end;" */
+#ifndef TT_EXIT_TEST_FUNCTION
+#define TT_EXIT_TEST_FUNCTION TT_STMT_BEGIN goto end; TT_STMT_END
+#endif
+
+/* Redefine this if you want to note success/failure in some different way. */
+#ifndef TT_DECLARE
+#define TT_DECLARE(prefix, args) \
+ TT_STMT_BEGIN \
+ printf("\n %s %s:%d: ",prefix,__FILE__,__LINE__); \
+ printf args ; \
+ TT_STMT_END
+#endif
+
+/* Announce a failure. Args are parenthesized printf args. */
+#define TT_GRIPE(args) TT_DECLARE("FAIL", args)
+
+/* Announce a non-failure if we're verbose. */
+#define TT_BLATHER(args) \
+ TT_STMT_BEGIN \
+ if (tinytest_get_verbosity_()>1) TT_DECLARE(" OK", args); \
+ TT_STMT_END
+
+#define TT_DIE(args) \
+ TT_STMT_BEGIN \
+ tinytest_set_test_failed_(); \
+ TT_GRIPE(args); \
+ TT_EXIT_TEST_FUNCTION; \
+ TT_STMT_END
+
+#define TT_FAIL(args) \
+ TT_STMT_BEGIN \
+ tinytest_set_test_failed_(); \
+ TT_GRIPE(args); \
+ TT_STMT_END
+
+/* Fail and abort the current test for the reason in msg */
+#define tt_abort_printf(msg) TT_DIE(msg)
+#define tt_abort_perror(op) TT_DIE(("%s: %s [%d]",(op),strerror(errno), errno))
+#define tt_abort_msg(msg) TT_DIE(("%s", msg))
+#define tt_abort() TT_DIE(("%s", "(Failed.)"))
+
+/* Fail but do not abort the current test for the reason in msg. */
+#define tt_failprint_f(msg) TT_FAIL(msg)
+#define tt_fail_perror(op) TT_FAIL(("%s: %s [%d]",(op),strerror(errno), errno))
+#define tt_fail_msg(msg) TT_FAIL(("%s", msg))
+#define tt_fail() TT_FAIL(("%s", "(Failed.)"))
+
+/* End the current test, and indicate we are skipping it. */
+#define tt_skip() \
+ TT_STMT_BEGIN \
+ tinytest_set_test_skipped_(); \
+ TT_EXIT_TEST_FUNCTION; \
+ TT_STMT_END
+
+#define tt_want_(b, msg, fail) \
+ TT_STMT_BEGIN \
+ if (!(b)) { \
+ tinytest_set_test_failed_(); \
+ TT_GRIPE(("%s",msg)); \
+ fail; \
+ } else { \
+ TT_BLATHER(("%s",msg)); \
+ } \
+ TT_STMT_END
+
+/* Assert b, but do not stop the test if b fails. Log msg on failure. */
+#define tt_want_msg(b, msg) \
+ tt_want_(b, msg, );
+
+/* Assert b and stop the test if b fails. Log msg on failure. */
+#define tt_assert_msg(b, msg) \
+ tt_want_(b, msg, TT_EXIT_TEST_FUNCTION);
+
+/* Assert b, but do not stop the test if b fails. */
+#define tt_want(b) tt_want_msg( (b), "want("#b")")
+/* Assert b, and stop the test if b fails. */
+#define tt_assert(b) tt_assert_msg((b), "assert("#b")")
+
+#define tt_assert_test_fmt_type(a,b,str_test,type,test,printf_type,printf_fmt, \
+ setup_block,cleanup_block,die_on_fail) \
+ TT_STMT_BEGIN \
+ type val1_ = (a); \
+ type val2_ = (b); \
+ int tt_status_ = (test); \
+ if (!tt_status_ || tinytest_get_verbosity_()>1) { \
+ printf_type print_; \
+ printf_type print1_; \
+ printf_type print2_; \
+ type value_ = val1_; \
+ setup_block; \
+ print1_ = print_; \
+ value_ = val2_; \
+ setup_block; \
+ print2_ = print_; \
+ TT_DECLARE(tt_status_?" OK":"FAIL", \
+ ("assert(%s): "printf_fmt" vs "printf_fmt, \
+ str_test, print1_, print2_)); \
+ print_ = print1_; \
+ cleanup_block; \
+ print_ = print2_; \
+ cleanup_block; \
+ if (!tt_status_) { \
+ tinytest_set_test_failed_(); \
+ die_on_fail ; \
+ } \
+ } \
+ TT_STMT_END
+
+#define tt_assert_test_type(a,b,str_test,type,test,fmt,die_on_fail) \
+ tt_assert_test_fmt_type(a,b,str_test,type,test,type,fmt, \
+ {print_=value_;},{},die_on_fail)
+
+#define tt_assert_test_type_opt(a,b,str_test,type,test,fmt,die_on_fail) \
+ tt_assert_test_fmt_type(a,b,str_test,type,test,type,fmt, \
+ {print_=value_?value_:"<NULL>";},{},die_on_fail)
+
+/* Helper: assert that a op b, when cast to type. Format the values with
+ * printf format fmt on failure. */
+#define tt_assert_op_type(a,op,b,type,fmt) \
+ tt_assert_test_type(a,b,#a" "#op" "#b,type,(val1_ op val2_),fmt, \
+ TT_EXIT_TEST_FUNCTION)
+
+#define tt_int_op(a,op,b) \
+ tt_assert_test_type(a,b,#a" "#op" "#b,long,(val1_ op val2_), \
+ "%ld",TT_EXIT_TEST_FUNCTION)
+
+#define tt_uint_op(a,op,b) \
+ tt_assert_test_type(a,b,#a" "#op" "#b,unsigned long, \
+ (val1_ op val2_),"%lu",TT_EXIT_TEST_FUNCTION)
+
+#define tt_ptr_op(a,op,b) \
+ tt_assert_test_type(a,b,#a" "#op" "#b,const void*, \
+ (val1_ op val2_),"%p",TT_EXIT_TEST_FUNCTION)
+
+#define tt_str_op(a,op,b) \
+ tt_assert_test_type_opt(a,b,#a" "#op" "#b,const char *, \
+ (val1_ && val2_ && strcmp(val1_,val2_) op 0),"<%s>", \
+ TT_EXIT_TEST_FUNCTION)
+
+#define tt_mem_op(expr1, op, expr2, len) \
+ tt_assert_test_fmt_type(expr1,expr2,#expr1" "#op" "#expr2, \
+ const void *, \
+ (val1_ && val2_ && memcmp(val1_, val2_, len) op 0), \
+ char *, "%s", \
+ { print_ = tinytest_format_hex_(value_, (len)); }, \
+ { if (print_) free(print_); }, \
+ TT_EXIT_TEST_FUNCTION \
+ );
+
+#define tt_want_int_op(a,op,b) \
+ tt_assert_test_type(a,b,#a" "#op" "#b,long,(val1_ op val2_),"%ld",(void)0)
+
+#define tt_want_uint_op(a,op,b) \
+ tt_assert_test_type(a,b,#a" "#op" "#b,unsigned long, \
+ (val1_ op val2_),"%lu",(void)0)
+
+#define tt_want_ptr_op(a,op,b) \
+ tt_assert_test_type(a,b,#a" "#op" "#b,const void*, \
+ (val1_ op val2_),"%p",(void)0)
+
+#define tt_want_str_op(a,op,b) \
+ tt_assert_test_type(a,b,#a" "#op" "#b,const char *, \
+ (strcmp(val1_,val2_) op 0),"<%s>",(void)0)
+
+#endif
diff --git a/protocols/Telegram/tgl/libevent/time-internal.h b/protocols/Telegram/tgl/libevent/time-internal.h
new file mode 100644
index 0000000000..2c584fa752
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/time-internal.h
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef TIME_INTERNAL_H_INCLUDED_
+#define TIME_INTERNAL_H_INCLUDED_
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef EVENT__HAVE_MACH_MACH_TIME_H
+/* For mach_timebase_info */
+#include <mach/mach_time.h>
+#endif
+
+#include <time.h>
+
+#include "event2/util.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(EVENT__HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
+#define HAVE_POSIX_MONOTONIC
+#elif defined(EVENT__HAVE_MACH_ABSOLUTE_TIME)
+#define HAVE_MACH_MONOTONIC
+#elif defined(_WIN32)
+#define HAVE_WIN32_MONOTONIC
+#else
+#define HAVE_FALLBACK_MONOTONIC
+#endif
+
+long evutil_tv_to_msec_(const struct timeval *tv);
+void evutil_usleep_(const struct timeval *tv);
+
+#ifdef _WIN32
+typedef ULONGLONG (WINAPI *ev_GetTickCount_func)(void);
+#endif
+
+struct evutil_monotonic_timer {
+
+#ifdef HAVE_MACH_MONOTONIC
+ struct mach_timebase_info mach_timebase_units;
+#endif
+
+#ifdef HAVE_POSIX_MONOTONIC
+ int monotonic_clock;
+#endif
+
+#ifdef HAVE_WIN32_MONOTONIC
+ ev_GetTickCount_func GetTickCount64_fn;
+ ev_GetTickCount_func GetTickCount_fn;
+ ev_uint64_t last_tick_count;
+ ev_uint64_t adjust_tick_count;
+
+ ev_uint64_t first_tick;
+ ev_uint64_t first_counter;
+ double usec_per_count;
+ int use_performance_counter;
+#endif
+
+ struct timeval adjust_monotonic_clock;
+ struct timeval last_time;
+};
+
+int evutil_configure_monotonic_time_(struct evutil_monotonic_timer *mt,
+ int flags);
+int evutil_gettime_monotonic_(struct evutil_monotonic_timer *mt, struct timeval *tv);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT_INTERNAL_H_INCLUDED_ */
diff --git a/protocols/Telegram/tgl/libevent/util-internal.h b/protocols/Telegram/tgl/libevent/util-internal.h
new file mode 100644
index 0000000000..06aa97299a
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/util-internal.h
@@ -0,0 +1,479 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * 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.
+ */
+#ifndef UTIL_INTERNAL_H_INCLUDED_
+#define UTIL_INTERNAL_H_INCLUDED_
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#include <errno.h>
+
+/* For EVUTIL_ASSERT */
+#include "log-internal.h"
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef EVENT__HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef EVENT__HAVE_SYS_EVENTFD_H
+#include <sys/eventfd.h>
+#endif
+#include "event2/util.h"
+
+#include "time-internal.h"
+#include "ipv6-internal.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* If we need magic to say "inline", get it for free internally. */
+#ifdef EVENT__inline
+#define inline EVENT__inline
+#endif
+#ifdef EVENT____func__
+#define __func__ EVENT____func__
+#endif
+
+/* A good no-op to use in macro definitions. */
+#define EVUTIL_NIL_STMT_ ((void)0)
+/* A no-op that tricks the compiler into thinking a condition is used while
+ * definitely not making any code for it. Used to compile out asserts while
+ * avoiding "unused variable" warnings. The "!" forces the compiler to
+ * do the sizeof() on an int, in case "condition" is a bitfield value.
+ */
+#define EVUTIL_NIL_CONDITION_(condition) do { \
+ (void)sizeof(!(condition)); \
+} while(0)
+
+/* Internal use only: macros to match patterns of error codes in a
+ cross-platform way. We need these macros because of two historical
+ reasons: first, nonblocking IO functions are generally written to give an
+ error on the "blocked now, try later" case, so sometimes an error from a
+ read, write, connect, or accept means "no error; just wait for more
+ data," and we need to look at the error code. Second, Windows defines
+ a different set of error codes for sockets. */
+
+#ifndef _WIN32
+
+#if EAGAIN == EWOULDBLOCK
+#define EVUTIL_ERR_IS_EAGAIN(e) \
+ ((e) == EAGAIN)
+#else
+#define EVUTIL_ERR_IS_EAGAIN(e) \
+ ((e) == EAGAIN || (e) == EWOULDBLOCK)
+#endif
+
+/* True iff e is an error that means a read/write operation can be retried. */
+#define EVUTIL_ERR_RW_RETRIABLE(e) \
+ ((e) == EINTR || EVUTIL_ERR_IS_EAGAIN(e))
+/* True iff e is an error that means an connect can be retried. */
+#define EVUTIL_ERR_CONNECT_RETRIABLE(e) \
+ ((e) == EINTR || (e) == EINPROGRESS)
+/* True iff e is an error that means a accept can be retried. */
+#define EVUTIL_ERR_ACCEPT_RETRIABLE(e) \
+ ((e) == EINTR || EVUTIL_ERR_IS_EAGAIN(e) || (e) == ECONNABORTED)
+
+/* True iff e is an error that means the connection was refused */
+#define EVUTIL_ERR_CONNECT_REFUSED(e) \
+ ((e) == ECONNREFUSED)
+
+#else
+/* Win32 */
+
+#define EVUTIL_ERR_IS_EAGAIN(e) \
+ ((e) == WSAEWOULDBLOCK || (e) == EAGAIN)
+
+#define EVUTIL_ERR_RW_RETRIABLE(e) \
+ ((e) == WSAEWOULDBLOCK || \
+ (e) == WSAEINTR)
+
+#define EVUTIL_ERR_CONNECT_RETRIABLE(e) \
+ ((e) == WSAEWOULDBLOCK || \
+ (e) == WSAEINTR || \
+ (e) == WSAEINPROGRESS || \
+ (e) == WSAEINVAL)
+
+#define EVUTIL_ERR_ACCEPT_RETRIABLE(e) \
+ EVUTIL_ERR_RW_RETRIABLE(e)
+
+#define EVUTIL_ERR_CONNECT_REFUSED(e) \
+ ((e) == WSAECONNREFUSED)
+
+#endif
+
+/* Arguments for shutdown() */
+#ifdef SHUT_RD
+#define EVUTIL_SHUT_RD SHUT_RD
+#else
+#define EVUTIL_SHUT_RD 0
+#endif
+#ifdef SHUT_WR
+#define EVUTIL_SHUT_WR SHUT_WR
+#else
+#define EVUTIL_SHUT_WR 1
+#endif
+#ifdef SHUT_BOTH
+#define EVUTIL_SHUT_BOTH SHUT_BOTH
+#else
+#define EVUTIL_SHUT_BOTH 2
+#endif
+
+/* Helper: Verify that all the elements in 'dlist' are internally consistent.
+ * Checks for circular lists and bad prev/next pointers.
+ *
+ * Example usage:
+ * EVUTIL_ASSERT_LIST_OK(eventlist, event, ev_next);
+ */
+#define EVUTIL_ASSERT_LIST_OK(dlist, type, field) do { \
+ struct type *elm1, *elm2, **nextp; \
+ if (LIST_EMPTY((dlist))) \
+ break; \
+ \
+ /* Check list for circularity using Floyd's */ \
+ /* 'Tortoise and Hare' algorithm */ \
+ elm1 = LIST_FIRST((dlist)); \
+ elm2 = LIST_NEXT(elm1, field); \
+ while (elm1 && elm2) { \
+ EVUTIL_ASSERT(elm1 != elm2); \
+ elm1 = LIST_NEXT(elm1, field); \
+ elm2 = LIST_NEXT(elm2, field); \
+ if (!elm2) \
+ break; \
+ EVUTIL_ASSERT(elm1 != elm2); \
+ elm2 = LIST_NEXT(elm2, field); \
+ } \
+ \
+ /* Now check next and prev pointers for consistency. */ \
+ nextp = &LIST_FIRST((dlist)); \
+ elm1 = LIST_FIRST((dlist)); \
+ while (elm1) { \
+ EVUTIL_ASSERT(*nextp == elm1); \
+ EVUTIL_ASSERT(nextp == elm1->field.le_prev); \
+ nextp = &LIST_NEXT(elm1, field); \
+ elm1 = *nextp; \
+ } \
+ } while (0)
+
+/* Helper: Verify that all the elements in a TAILQ are internally consistent.
+ * Checks for circular lists and bad prev/next pointers.
+ *
+ * Example usage:
+ * EVUTIL_ASSERT_TAILQ_OK(activelist, event, ev_active_next);
+ */
+#define EVUTIL_ASSERT_TAILQ_OK(tailq, type, field) do { \
+ struct type *elm1, *elm2, **nextp; \
+ if (TAILQ_EMPTY((tailq))) \
+ break; \
+ \
+ /* Check list for circularity using Floyd's */ \
+ /* 'Tortoise and Hare' algorithm */ \
+ elm1 = TAILQ_FIRST((tailq)); \
+ elm2 = TAILQ_NEXT(elm1, field); \
+ while (elm1 && elm2) { \
+ EVUTIL_ASSERT(elm1 != elm2); \
+ elm1 = TAILQ_NEXT(elm1, field); \
+ elm2 = TAILQ_NEXT(elm2, field); \
+ if (!elm2) \
+ break; \
+ EVUTIL_ASSERT(elm1 != elm2); \
+ elm2 = TAILQ_NEXT(elm2, field); \
+ } \
+ \
+ /* Now check next and prev pointers for consistency. */ \
+ nextp = &TAILQ_FIRST((tailq)); \
+ elm1 = TAILQ_FIRST((tailq)); \
+ while (elm1) { \
+ EVUTIL_ASSERT(*nextp == elm1); \
+ EVUTIL_ASSERT(nextp == elm1->field.tqe_prev); \
+ nextp = &TAILQ_NEXT(elm1, field); \
+ elm1 = *nextp; \
+ } \
+ EVUTIL_ASSERT(nextp == (tailq)->tqh_last); \
+ } while (0)
+
+/* Locale-independent replacements for some ctypes functions. Use these
+ * when you care about ASCII's notion of character types, because you are about
+ * to send those types onto the wire.
+ */
+int EVUTIL_ISALPHA_(char c);
+int EVUTIL_ISALNUM_(char c);
+int EVUTIL_ISSPACE_(char c);
+int EVUTIL_ISDIGIT_(char c);
+int EVUTIL_ISXDIGIT_(char c);
+int EVUTIL_ISPRINT_(char c);
+int EVUTIL_ISLOWER_(char c);
+int EVUTIL_ISUPPER_(char c);
+char EVUTIL_TOUPPER_(char c);
+char EVUTIL_TOLOWER_(char c);
+
+/** Remove all trailing horizontal whitespace (space or tab) from the end of a
+ * string */
+void evutil_rtrim_lws_(char *);
+
+
+/** Helper macro. If we know that a given pointer points to a field in a
+ structure, return a pointer to the structure itself. Used to implement
+ our half-baked C OO. Example:
+
+ struct subtype {
+ int x;
+ struct supertype common;
+ int y;
+ };
+ ...
+ void fn(struct supertype *super) {
+ struct subtype *sub = EVUTIL_UPCAST(super, struct subtype, common);
+ ...
+ }
+ */
+#define EVUTIL_UPCAST(ptr, type, field) \
+ ((type *)(((char*)(ptr)) - evutil_offsetof(type, field)))
+
+/* As open(pathname, flags, mode), except that the file is always opened with
+ * the close-on-exec flag set. (And the mode argument is mandatory.)
+ */
+int evutil_open_closeonexec_(const char *pathname, int flags, unsigned mode);
+
+int evutil_read_file_(const char *filename, char **content_out, size_t *len_out,
+ int is_binary);
+
+int evutil_socket_connect_(evutil_socket_t *fd_ptr, const struct sockaddr *sa, int socklen);
+
+int evutil_socket_finished_connecting_(evutil_socket_t fd);
+
+int evutil_ersatz_socketpair_(int, int , int, evutil_socket_t[]);
+
+int evutil_resolve_(int family, const char *hostname, struct sockaddr *sa,
+ ev_socklen_t *socklen, int port);
+
+const char *evutil_getenv_(const char *name);
+
+/* Structure to hold the state of our weak random number generator.
+ */
+struct evutil_weakrand_state {
+ ev_uint32_t seed;
+};
+
+#define EVUTIL_WEAKRAND_MAX EV_INT32_MAX
+
+/* Initialize the state of a week random number generator based on 'seed'. If
+ * the seed is 0, construct a new seed based on not-very-strong platform
+ * entropy, like the PID and the time of day.
+ *
+ * This function, and the other evutil_weakrand* functions, are meant for
+ * speed, not security or statistical strength. If you need a RNG which an
+ * attacker can't predict, or which passes strong statistical tests, use the
+ * evutil_secure_rng* functions instead.
+ */
+ev_uint32_t evutil_weakrand_seed_(struct evutil_weakrand_state *state, ev_uint32_t seed);
+/* Return a pseudorandom value between 0 and EVUTIL_WEAKRAND_MAX inclusive.
+ * Updates the state in 'seed' as needed -- this value must be protected by a
+ * lock.
+ */
+ev_int32_t evutil_weakrand_(struct evutil_weakrand_state *seed);
+/* Return a pseudorandom value x such that 0 <= x < top. top must be no more
+ * than EVUTIL_WEAKRAND_MAX. Updates the state in 'seed' as needed -- this
+ * value must be proteced by a lock */
+ev_int32_t evutil_weakrand_range_(struct evutil_weakrand_state *seed, ev_int32_t top);
+
+/* Evaluates to the same boolean value as 'p', and hints to the compiler that
+ * we expect this value to be false. */
+#if defined(__GNUC__) && __GNUC__ >= 3 /* gcc 3.0 or later */
+#define EVUTIL_UNLIKELY(p) __builtin_expect(!!(p),0)
+#else
+#define EVUTIL_UNLIKELY(p) (p)
+#endif
+
+/* Replacement for assert() that calls event_errx on failure. */
+#ifdef NDEBUG
+#define EVUTIL_ASSERT(cond) EVUTIL_NIL_CONDITION_(cond)
+#define EVUTIL_FAILURE_CHECK(cond) 0
+#else
+#define EVUTIL_ASSERT(cond) \
+ do { \
+ if (EVUTIL_UNLIKELY(!(cond))) { \
+ event_errx(EVENT_ERR_ABORT_, \
+ "%s:%d: Assertion %s failed in %s", \
+ __FILE__,__LINE__,#cond,__func__); \
+ /* In case a user-supplied handler tries to */ \
+ /* return control to us, log and abort here. */ \
+ (void)fprintf(stderr, \
+ "%s:%d: Assertion %s failed in %s", \
+ __FILE__,__LINE__,#cond,__func__); \
+ abort(); \
+ } \
+ } while (0)
+#define EVUTIL_FAILURE_CHECK(cond) EVUTIL_UNLIKELY(cond)
+#endif
+
+#ifndef EVENT__HAVE_STRUCT_SOCKADDR_STORAGE
+/* Replacement for sockaddr storage that we can use internally on platforms
+ * that lack it. It is not space-efficient, but neither is sockaddr_storage.
+ */
+struct sockaddr_storage {
+ union {
+ struct sockaddr ss_sa;
+ struct sockaddr_in ss_sin;
+ struct sockaddr_in6 ss_sin6;
+ char ss_padding[128];
+ } ss_union;
+};
+#define ss_family ss_union.ss_sa.sa_family
+#endif
+
+/* Internal addrinfo error code. This one is returned from only from
+ * evutil_getaddrinfo_common_, when we are sure that we'll have to hit a DNS
+ * server. */
+#define EVUTIL_EAI_NEED_RESOLVE -90002
+
+struct evdns_base;
+struct evdns_getaddrinfo_request;
+typedef struct evdns_getaddrinfo_request* (*evdns_getaddrinfo_fn)(
+ struct evdns_base *base,
+ const char *nodename, const char *servname,
+ const struct evutil_addrinfo *hints_in,
+ void (*cb)(int, struct evutil_addrinfo *, void *), void *arg);
+
+void evutil_set_evdns_getaddrinfo_fn_(evdns_getaddrinfo_fn fn);
+
+struct evutil_addrinfo *evutil_new_addrinfo_(struct sockaddr *sa,
+ ev_socklen_t socklen, const struct evutil_addrinfo *hints);
+struct evutil_addrinfo *evutil_addrinfo_append_(struct evutil_addrinfo *first,
+ struct evutil_addrinfo *append);
+void evutil_adjust_hints_for_addrconfig_(struct evutil_addrinfo *hints);
+int evutil_getaddrinfo_common_(const char *nodename, const char *servname,
+ struct evutil_addrinfo *hints, struct evutil_addrinfo **res, int *portnum);
+
+int evutil_getaddrinfo_async_(struct evdns_base *dns_base,
+ const char *nodename, const char *servname,
+ const struct evutil_addrinfo *hints_in,
+ void (*cb)(int, struct evutil_addrinfo *, void *), void *arg);
+
+/** Return true iff sa is a looback address. (That is, it is 127.0.0.1/8, or
+ * ::1). */
+int evutil_sockaddr_is_loopback_(const struct sockaddr *sa);
+
+
+/**
+ Formats a sockaddr sa into a string buffer of size outlen stored in out.
+ Returns a pointer to out. Always writes something into out, so it's safe
+ to use the output of this function without checking it for NULL.
+ */
+const char *evutil_format_sockaddr_port_(const struct sockaddr *sa, char *out, size_t outlen);
+
+int evutil_hex_char_to_int_(char c);
+
+
+void evutil_free_secure_rng_globals_(void);
+void evutil_free_globals_(void);
+
+#ifdef _WIN32
+HMODULE evutil_load_windows_system_library_(const TCHAR *library_name);
+#endif
+
+#ifndef EV_SIZE_FMT
+#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__)
+#define EV_U64_FMT "%I64u"
+#define EV_I64_FMT "%I64d"
+#define EV_I64_ARG(x) ((__int64)(x))
+#define EV_U64_ARG(x) ((unsigned __int64)(x))
+#else
+#define EV_U64_FMT "%llu"
+#define EV_I64_FMT "%lld"
+#define EV_I64_ARG(x) ((long long)(x))
+#define EV_U64_ARG(x) ((unsigned long long)(x))
+#endif
+#endif
+
+#ifdef _WIN32
+#define EV_SOCK_FMT EV_I64_FMT
+#define EV_SOCK_ARG(x) EV_I64_ARG((x))
+#else
+#define EV_SOCK_FMT "%d"
+#define EV_SOCK_ARG(x) (x)
+#endif
+
+#if defined(__STDC__) && defined(__STDC_VERSION__) && !defined(__MINGW64_VERSION_MAJOR)
+#if (__STDC_VERSION__ >= 199901L)
+#define EV_SIZE_FMT "%zu"
+#define EV_SSIZE_FMT "%zd"
+#define EV_SIZE_ARG(x) (x)
+#define EV_SSIZE_ARG(x) (x)
+#endif
+#endif
+
+#ifndef EV_SIZE_FMT
+#if (EVENT__SIZEOF_SIZE_T <= EVENT__SIZEOF_LONG)
+#define EV_SIZE_FMT "%lu"
+#define EV_SSIZE_FMT "%ld"
+#define EV_SIZE_ARG(x) ((unsigned long)(x))
+#define EV_SSIZE_ARG(x) ((long)(x))
+#else
+#define EV_SIZE_FMT EV_U64_FMT
+#define EV_SSIZE_FMT EV_I64_FMT
+#define EV_SIZE_ARG(x) EV_U64_ARG(x)
+#define EV_SSIZE_ARG(x) EV_I64_ARG(x)
+#endif
+#endif
+
+evutil_socket_t evutil_socket_(int domain, int type, int protocol);
+evutil_socket_t evutil_accept4_(evutil_socket_t sockfd, struct sockaddr *addr,
+ ev_socklen_t *addrlen, int flags);
+
+ /* used by one of the test programs.. */
+EVENT2_EXPORT_SYMBOL
+int evutil_make_internal_pipe_(evutil_socket_t fd[2]);
+evutil_socket_t evutil_eventfd_(unsigned initval, int flags);
+
+#ifdef SOCK_NONBLOCK
+#define EVUTIL_SOCK_NONBLOCK SOCK_NONBLOCK
+#else
+#define EVUTIL_SOCK_NONBLOCK 0x4000000
+#endif
+#ifdef SOCK_CLOEXEC
+#define EVUTIL_SOCK_CLOEXEC SOCK_CLOEXEC
+#else
+#define EVUTIL_SOCK_CLOEXEC 0x80000000
+#endif
+#ifdef EFD_NONBLOCK
+#define EVUTIL_EFD_NONBLOCK EFD_NONBLOCK
+#else
+#define EVUTIL_EFD_NONBLOCK 0x4000
+#endif
+#ifdef EFD_CLOEXEC
+#define EVUTIL_EFD_CLOEXEC EFD_CLOEXEC
+#else
+#define EVUTIL_EFD_CLOEXEC 0x8000
+#endif
+
+void evutil_memclear_(void *mem, size_t len);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/libevent/whatsnew-2.0.txt b/protocols/Telegram/tgl/libevent/whatsnew-2.0.txt
new file mode 100644
index 0000000000..3561fcb94c
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/whatsnew-2.0.txt
@@ -0,0 +1,609 @@
+What's New In Libevent 2.0 so far:
+
+1. Meta-issues
+
+1.1. About this document
+
+ This document describes the key differences between Libevent 1.4 and
+ Libevent 2.0, from a user's point of view. It was most recently
+ updated based on features in git master as of August 2010.
+
+ NOTE: I am very sure that I missed some thing on this list. Caveat
+ haxxor.
+
+1.2. Better documentation
+
+ There is now a book-in-progress that explains how to use Libevent and its
+ growing pile of APIs. As of this writing, it covers everything except the
+ http and rpc code. Check out the latest draft at
+ http://www.wangafu.net/~nickm/libevent-book/ .
+
+2. New and Improved Event APIs
+
+ Many APIs are improved, refactored, or deprecated in Libevent 2.0.
+
+ COMPATIBILITY:
+
+ Nearly all existing code that worked with Libevent 1.4 should still
+ work correctly with Libevent 2.0. However, if you are writing new code,
+ or if you want to port old code, we strongly recommend using the new APIs
+ and avoiding deprecated APIs as much as possible.
+
+ Binaries linked against Libevent 1.4 will need to be recompiled to link
+ against Libevent 2.0. This is nothing new; we have never been good at
+ preserving binary compatibility between releases. We'll try harder in the
+ future, though: see 2.1 below.
+
+2.1. New header layout for improved forward-compatibility
+
+ Libevent 2.0 has a new header layout to make it easier for programmers to
+ write good, well-supported libevent code. The new headers are divided
+ into three types.
+
+ There are *regular headers*, like event2/event.h. These headers contain
+ the functions that most programmers will want to use.
+
+ There are *backward compatibility headers*, like event2/event_compat.h.
+ These headers contain declarations for deprecated functions from older
+ versions of Libevent. Documentation in these headers should suggest what's
+ wrong with the old functions, and what functions you want to start using
+ instead of the old ones. Some of these functions might be removed in a
+ future release. New programs should generally not include these headers.
+
+ Finally, there are *structure headers*, like event2/event_struct.h.
+ These headers contain definitions of some structures that Libevent has
+ historically exposed. Exposing them caused problems in the past,
+ since programs that were compiled to work with one version of Libevent
+ would often stop working with another version that changed the size or
+ layout of some object. We've moving them into separate headers so
+ that programmers can know that their code is not depending on any
+ unstable aspect of the Libvent ABI. New programs should generally not
+ include these headers unless they really know what they are doing, are
+ willing to rebuild their software whenever they want to link it
+ against a new version of Libevent, and are willing to risk their code
+ breaking if and when data structures change.
+
+ Functionality that once was located in event.h is now more subdivided.
+ The core event logic is now in event2/event.h. The "evbuffer" functions
+ for low-level buffer manipulation are in event2/buffer.h. The
+ "bufferevent" functions for higher-level buffered IO are in
+ event2/bufferevent.h.
+
+ COMPATIBILITY:
+
+ All of the old headers (event.h, evdns.h, evhttp.h, evrpc.h, and
+ evutil.h) will continue to work by including the corresponding new
+ headers. Old code should not be broken by this change.
+
+2.2. New thread-safe, binary-compatible, harder-to-mess-up APIs
+
+ Some aspects of the historical Libevent API have encouraged
+ non-threadsafe code, or forced code built against one version of Libevent
+ to no longer build with another. The problems with now-deprecated APIs
+ fell into two categories:
+
+ 1) Dependence on the "current" event_base. In an application with
+ multiple event_bases, Libevent previously had a notion of the
+ "current" event_base. New events were linked to this base, and
+ the caller needed to explicitly reattach them to another base.
+ This was horribly error-prone.
+
+ Functions like "event_set" that worked with the "current" event_base
+ are now deprecated but still available (see 2.1). There are new
+ functions like "event_assign" that take an explicit event_base
+ argument when setting up a structure. Using these functions will help
+ prevent errors in your applications, and to be more threadsafe.
+
+ 2) Structure dependence. Applications needed to allocate 'struct
+ event' themselves, since there was no function in Libevent to do it
+ for them. But since the size and contents of struct event can
+ change between libevent versions, this created binary-compatibility
+ nightmares. All structures of this kind are now isolated in
+ _struct.h header (see 2.1), and there are new allocate-and-
+ initialize functions you can use instead of the old initialize-only
+ functions. For example, instead of malloc and event_set, you
+ can use event_new().
+
+ (For people who do really want to allocate a struct event on the
+ stack, or put one inside another structure, you can still use
+ event2/event_compat.h.)
+
+ So in the case where old code would look like this:
+
+ #include <event.h>
+ ...
+ struct event *ev = malloc(sizeof(struct event));
+ /* This call will cause a buffer overrun if you compile with one version
+ of Libevent and link dynamically against another. */
+ event_set(ev, fd, EV_READ, cb, NULL);
+ /* If you forget this call, your code will break in hard-to-diagnose
+ ways in the presence of multiple event bases. */
+ event_set_base(ev, base);
+
+ New code will look more like this:
+
+ #include <event2/event.h>
+ ...
+ struct event *ev;
+ ev = event_new(base, fd, EV_READ, cb, NULL);
+
+2.3. Overrideable allocation functions
+
+ If you want to override the allocation functions used by libevent
+ (for example, to use a specialized allocator, or debug memory
+ issues, or so on), you can replace them by calling
+ event_set_mem_functions. It takes replacements for malloc(),
+ free(), and realloc().
+
+ If you're going to use this facility, you need to call it _before_
+ Libevent does any memory allocation; otherwise, Libevent may allocate some
+ memory with malloc(), and free it with the free() function you provide.
+
+ You can disable this feature when you are building Libevent by passing
+ the --disable-malloc-replacement argument to configure.
+
+2.4. Configurable event_base creation
+
+ Older versions of Libevent would always got the fastest backend
+ available, unless you reconfigured their behavior with the environment
+ variables EVENT_NOSELECT, EVENT_NOPOLL, and so forth. This was annoying
+ to programmers who wanted to pick a backend explicitly without messing
+ with the environment.
+
+ Also, despite our best efforts, not every backend supports every
+ operation we might like. Some features (like edge-triggered events, or
+ working with non-socket file descriptors) only work with some operating
+ systems' fast backends. Previously, programmers who cared about this
+ needed to know which backends supported what. This tended to get quite
+ ungainly.
+
+ There is now an API to choose backends, either by name or by feature.
+ Here is an example:
+
+ struct event_config_t *config;
+ struct event_base *base;
+
+ /* Create a new configuration object. */
+ config = event_config_new();
+ /* We don't want to use the "select" method. */
+ event_config_avoid_method(config, "select");
+ /* We want a method that can work with non-socket file descriptors */
+ event_config_require_features(config, EV_FEATURE_FDS);
+
+ base = event_base_new_with_config(config);
+ if (!base) {
+ /* There is no backend method that does what we want. */
+ exit(1);
+ }
+ event_config_free(config);
+
+ Supported features are documented in event2/event.h
+
+2.5. Socket is now an abstract type
+
+ All APIs that formerly accepted int as a socket type now accept
+ "evutil_socket_t". On Unix, this is just an alias for "int" as
+ before. On Windows, however, it's an alias for SOCKET, which can
+ be wider than int on 64-bit platforms.
+
+2.6. Timeouts and persistent events work together.
+
+ Previously, it wasn't useful to set a timeout on a persistent event:
+ the timeout would trigger once, and never again. This is not what
+ applications tend to want. Instead, applications tend to want every
+ triggering of the event to re-set the timeout. So now, if you set
+ up an event like this:
+ struct event *ev;
+ struct timeval tv;
+ ev = event_new(base, fd, EV_READ|EV_PERSIST, cb, NULL);
+ tv.tv_sec = 1;
+ tv.tv_usec = 0;
+ event_add(ev, &tv);
+
+ The callback 'cb' will be invoked whenever fd is ready to read, OR whenever
+ a second has passed since the last invocation of cb.
+
+2.7. Multiple events allowed per fd
+
+ Older versions of Libevent allowed at most one EV_READ event and at most
+ one EV_WRITE event per socket, per event base. This restriction is no
+ longer present.
+
+2.8. evthread_* functions for thread-safe structures.
+
+ Libevent structures can now be built with locking support. This code
+ makes it safe to add, remove, and activate events on an event base from a
+ different thread. (Previously, if you wanted to write multithreaded code
+ with Libevent, you could only an event_base or its events in one thread at
+ a time.)
+
+ If you want threading support and you're using pthreads, you can just
+ call evthread_use_pthreads(). (You'll need to link against the
+ libevent_pthreads library in addition to libevent_core. These functions are
+ not in libevent_core.)
+
+ If you want threading support and you're using Windows, you can just
+ call evthread_use_windows_threads().
+
+ If you are using some locking system besides Windows and pthreads, You
+ can enable this on a per-event-base level by writing functions to
+ implement mutexes, conditions, and thread IDs, and passing them to
+ evthread_set_lock_callbacks and related functions in event2/thread.h.
+
+ Once locking functions are enabled, every new event_base is created with a
+ lock. You can prevent a single event_base from being built with a lock
+ disabled by using the EVENT_BASE_FLAG_NOLOCK flag in its
+ event_config. If an event_base is created with a lock, it is safe to call
+ event_del, event_add, and event_active on its events from any thread. The
+ event callbacks themselves are still all executed from the thread running
+ the event loop.
+
+ To make an evbuffer or a bufferevent object threadsafe, call its
+ *_enable_locking() function.
+
+ The HTTP api is not currently threadsafe.
+
+ To build Libevent with threading support disabled, pass
+ --disable-thread-support to the configure script.
+
+2.9. Edge-triggered events on some backends.
+
+ With some backends, it's now possible to add the EV_ET flag to an event
+ in order to request that the event's semantics be edge-triggered. Right
+ now, epoll and kqueue support this.
+
+ The corresponding event_config feature is EV_FEATURE_ET; see 2.4 for more
+ information.
+
+2.10. Better support for huge numbers of timeouts
+
+ The heap-based priority queue timer implementation for Libevent 1.4 is good
+ for randomly distributed timeouts, but suboptimal if you have huge numbers
+ of timeouts that all expire in the same amount of time after their
+ creation. The new event_base_init_common_timeout() logic lets you signal
+ that a given timeout interval will be very common, and should use a linked
+ list implementation instead of a priority queue.
+
+2.11. Improved debugging support
+
+ It's been pretty easy to forget to delete all your events before you
+ re-initialize them, or otherwise put Libevent in an internally inconsistent
+ state. You can tell libevent to catch these and other common errors with
+ the new event_enable_debug_mode() call. Just invoke it before you do
+ any calls to other libevent functions, and it'll catch many common
+ event-level errors in your code.
+
+2.12. Functions to access all event fields
+
+ So that you don't have to access the struct event fields directly, Libevent
+ now provides accessor functions to retrieve everything from an event that
+ you set during event_new() or event_assign().
+
+3. Backend-specific and performance improvements.
+
+3.1. Change-minimization on O(1) backends
+
+ With previous versions of Libevent, if you called event_del() and
+ event_add() repeatedly on a single event between trips to the backend's
+ dispatch function, the backend might wind up making unnecessary calls or
+ passing unnecessary data to the kernel. The new backend logic batches up
+ redundant adds and deletes, and performs no more operations than necessary
+ at the kernel level.
+
+ This logic is on for the kqueue backend, and available (but off by
+ default) for the epoll backend. To turn it on for the epoll backend,
+ set the EVENT_BASE_FLAG_EPOLL_USE_CHANGELIST flag in the
+ event_base_cofig, or set the EVENT_EPOLL_USE_CHANGELIST environment
+ variable. Doing this with epoll may result in weird bugs if you give
+ any fds closed by dup() or its variants.
+
+3.2. Improved notification on Linux
+
+ When we need to wake the event loop up from another thread, we use
+ an epollfd to do so, instead of a socketpair. This is supposed to be
+ faster.
+
+3.3. Windows: better support for everything
+
+ Bufferevents on Windows can use a new mechanism (off-by-default; see below)
+ to send their data via Windows overlapped IO and get their notifications
+ via the IOCP API. This should be much faster than using event-based
+ notification.
+
+ Other functions throughout the code have been fixed to work more
+ consistently with Windows. Libevent now builds on Windows using either
+ mingw, or using MSVC (with nmake). Libevent works fine with UNICODE
+ defined, or not.
+
+ Data structures are a little smarter: our lookups from socket to pending
+ event are now done with O(1) hash tables rather than O(lg n) red-black
+ trees.
+
+ Unfortunately, the main Windows backend is still select()-based: from
+ testing the IOCP backends on the mailing list, it seems that there isn't
+ actually a way to tell for certain whether a socket is writable with IOCP.
+ Libevent 2.1 may add a multithreaded WaitForMultipleEvents-based
+ backend for better performance with many inactive sockets and better
+ integration with Windows events.
+
+4. Improvements to evbuffers
+
+ Libevent has long had an "evbuffer" implementation to wrap access to an
+ input or output memory buffer. In previous versions, the implementation
+ was very inefficient and lacked some desirable features. We've made many
+ improvements in Libevent 2.0.
+
+4.1. Chunked-memory internal representation
+
+ Previously, each evbuffer was a huge chunk of memory. When we ran out of
+ space in an evbuffer, we used realloc() to grow the chunk of memory. When
+ data was misaligned, we used memmove to move the data back to the front
+ of the buffer.
+
+ Needless to say, this is a terrible interface for networked IO.
+
+ Now, evbuffers are implemented as a linked list of memory chunks, like
+ most Unix kernels use for network IO. (See Linux's skbuf interfaces,
+ or *BSD's mbufs). Data is added at the end of the linked list and
+ removed from the front, so that we don't ever need realloc huge chunks
+ or memmove the whole buffer contents.
+
+ To avoid excessive calls to read and write, we use the readv/writev
+ interfaces (or WSASend/WSARecv on Windows) to do IO on multiple chunks at
+ once with a single system call.
+
+ COMPATIBILITY NOTE:
+ The evbuffer struct is no longer exposed in a header. The code here is
+ too volatile to expose an official evbuffer structure, and there was never
+ any means provided to create an evbuffer except via evbuffer_new which
+ heap-allocated the buffer.
+
+ If you need access to the whole buffer as a linear chunk of memory, the
+ EVBUFFER_DATA() function still works. Watch out, though: it needs to copy
+ the buffer's contents in a linear chunk before you can use it.
+
+4.2. More flexible readline support
+
+ The old evbuffer_readline() function (which accepted any sequence of
+ CR and LF characters as a newline, and which couldn't handle lines
+ containing NUL characters), is now deprecated. The preferred
+ function is evbuffer_readln(), which supports a variety of
+ line-ending styles, and which can return the number of characters in
+ the line returned.
+
+ You can also call evbuffer_search_eol() to find the end of a line
+ in an evbuffer without ever extracting the line.
+
+4.3. Support for file-based IO in evbuffers.
+
+ You can now add chunks of a file into a evbuffer, and Libevent will have
+ your OS use mapped-memory functionality, sendfile, or splice to transfer
+ the data without ever copying it to userspace. On OSs where this is not
+ supported, Libevent just loads the data.
+
+ There are probably some bugs remaining in this code. On some platforms
+ (like Windows), it just reads the relevant parts of the file into RAM.
+
+4.4. Support for zero-copy ("scatter/gather") writes in evbuffers.
+
+ You can add a piece of memory to an evbuffer without copying it.
+ Instead, Libevent adds a new element to the evbuffer's linked list of
+ chunks with a pointer to the memory you supplied. You can do this
+ either with a reference-counted chunk (via evbuffer_add_reference), or
+ by asking Libevent for a pointer to its internal vectors (via
+ evbuffer_reserve_space or evbuffer_peek()).
+
+4.5. Multiple callbacks per evbuffer
+
+ Previously, you could only have one callback active on an evbuffer at a
+ time. In practice, this meant that if one part of Libevent was using an
+ evbuffer callback to notice when an internal evbuffer was reading or
+ writing data, you couldn't have your own callback on that evbuffer.
+
+ Now, you can now use the evbuffer_add_cb() function to add a callback that
+ does not interfere with any other callbacks.
+
+ The evbuffer_setcb() function is now deprecated.
+
+4.6. New callback interface
+
+ Previously, evbuffer callbacks were invoked with the old size of the
+ buffer and the new size of the buffer. This interface could not capture
+ operations that simultaneously filled _and_ drained a buffer, or handle
+ cases where we needed to postpone callbacks until multiple operations were
+ complete.
+
+ Callbacks that are set with evbuffer_setcb still use the old API.
+ Callbacks added with evbuffer_add_cb() use a new interface that takes a
+ pointer to a struct holding the total number of bytes drained read and the
+ total number of bytes written. See event2/buffer.h for full details.
+
+4.7. Misc new evbuffer features
+
+ You can use evbuffer_remove() to move a given number of bytes from one
+ buffer to another.
+
+ The evbuffer_search() function lets you search for repeated instances of
+ a pattern inside an evbuffer.
+
+ You can use evbuffer_freeze() to temporarily suspend drains from or adds
+ to a given evbuffer. This is useful for code that exposes an evbuffer as
+ part of its public API, but wants users to treat it as a pure source or
+ sink.
+
+ There's an evbuffer_copyout() that looks at the data at the start of an
+ evbuffer without doing a drain.
+
+ You can have an evbuffer defer all of its callbacks, so that rather than
+ being invoked immediately when the evbuffer's length changes, they are
+ invoked from within the event_loop. This is useful when you have a
+ complex set of callbacks that can change the length of other evbuffers,
+ and you want to avoid having them recurse and overflow your stack.
+
+5. Bufferevents improvements
+
+ Libevent has long included a "bufferevents" structure and related
+ functions that were useful for generic buffered IO on a TCP connection.
+ This is what Libevent uses for its HTTP implementation. In addition to
+ the improvements that they get for free from the underlying evbuffer
+ implementation above, there are many new features in Libevent 2.0's
+ evbuffers.
+
+5.1. New OO implementations
+
+ The "bufferevent" structure is now an abstract base type with multiple
+ implementations. This should not break existing code, which always
+ allocated bufferevents with bufferevent_new().
+
+ Current implementations of the bufferevent interface are described below.
+
+5.2. bufferevent_socket_new() replaces bufferevent_new()
+
+ Since bufferevents that use a socket are not the only kind,
+ bufferevent_new() is now deprecated. Use bufferevent_socket_new()
+ instead.
+
+5.3. Filtered bufferevent IO
+
+ You can use bufferevent_filter_new() to create a bufferevent that wraps
+ around another bufferevent and transforms data it is sending and
+ receiving. See test/regress_zlib.c for a toy example that uses zlib to
+ compress data before sending it over a bufferevent.
+
+5.3. Linked pairs of bufferevents
+
+ You can use bufferevent_pair_new() to produce two linked
+ bufferevents. This is like using socketpair, but doesn't require
+ system-calls.
+
+5.4. SSL support for bufferevents with OpenSSL
+
+ There is now a bufferevent type that supports SSL/TLS using the
+ OpenSSL library. The code for this is build in a separate
+ library, libevent_openssl, so that your programs don't need to
+ link against OpenSSL unless they actually want SSL support.
+
+ There are two ways to construct one of these bufferevents, both
+ declared in <event2/bufferevent_ssl.h>. If you want to wrap an
+ SSL layer around an existing bufferevent, you would call the
+ bufferevent_openssl_filter_new() function. If you want to do SSL
+ on a socket directly, call bufferevent_openssl_socket_new().
+
+5.5. IOCP support for bufferevents on Windows
+
+ There is now a bufferevents backend that supports IOCP on Windows.
+ Supposedly, this will eventually make Windows IO much faster for
+ programs using bufferevents. We'll have to see; the code is not
+ currently optimized at all. To try it out, call the
+ event_base_start_iocp() method on an event_base before contructing
+ bufferevents.
+
+ This is tricky code; there are probably some bugs hiding here.
+
+5.6. Improved connect support for bufferevents.
+
+ You can now create a bufferevent that is not yet connected to any
+ host, and tell it to connect, either by address or by hostname.
+
+ The functions to do this are bufferevent_socket_connect and
+ bufferevent_socket_connect_hostname.
+
+5.7. Rate-limiting for bufferevents
+
+ If you need to limit the number of bytes read/written by a single
+ bufferevent, or by a group of them, you can do this with a new set of
+ bufferevent rate-limiting calls.
+
+6. Other improvements
+
+6.1. DNS improvements
+
+6.1.1. DNS: IPv6 nameservers
+
+ The evdns code now lets you have nameservers whose addresses are IPv6.
+
+6.1.2. DNS: Better security
+
+ Libevent 2.0 tries harder to resist DNS answer-sniping attacks than
+ earlier versions of evdns. See comments in the code for full details.
+
+ Notably, evdns now supports the "0x20 hack" to make it harder to
+ impersonate a DNS server. Additionally, Libevent now uses a strong
+ internal RNG to generate DNS transaction IDs, so you don't need to supply
+ your own.
+
+6.1.3. DNS: Getaddrinfo support
+
+ There's now an asynchronous getaddrinfo clone, evdns_getaddrinfo(),
+ to make the results of the evdns functions more usable. It doesn't
+ support every feature of a typical platform getaddrinfo() yet, but it
+ is quite close.
+
+ There is also a blocking evutil_getaddrinfo() declared in
+ event2/util.h, to provide a getaddrinfo() implementation for
+ platforms that don't have one, and smooth over the differences in
+ various platforms implementations of RFC3493.
+
+ Bufferevents provide bufferevent_connect_hostname(), which combines
+ the name lookup and connect operations.
+
+6.1.4. DNS: No more evdns globals
+
+ Like an event base, evdns operations are now supposed to use an evdns_base
+ argument. This makes them easier to wrap for other (more OO) languages,
+ and easier to control the lifetime of. The old evdns functions will
+ still, of course, continue working.
+
+6.2. Listener support
+
+ You can now more easily automate setting up a bound socket to listen for
+ TCP connections. Just use the evconnlistener_*() functions in the
+ event2/listener.h header.
+
+ The listener code supports IOCP on Windows if available.
+
+6.3. Secure RNG support
+
+ Network code very frequently needs a secure, hard-to-predict random number
+ generator. Some operating systems provide a good C implementation of one;
+ others do not. Libevent 2.0 now provides a consistent implementation
+ based on the arc4random code originally from OpenBSD. Libevent (and you)
+ can use the evutil_secure_rng_*() functions to access a fairly secure
+ random stream of bytes.
+
+6.4. HTTP
+
+ The evhttp uriencoding and uridecoding APIs have updated versions
+ that behave more correctly, and can handle strings with internal NULs.
+
+ The evhttp query parsing and URI parsing logic can now detect errors
+ more usefully. Moreover, we include an actual URI parsing function
+ (evhttp_uri_parse()) to correctly parse URIs, so as to discourage
+ people from rolling their own ad-hoc parsing functions.
+
+ There are now accessor functions for the useful fields of struct http
+ and friends; it shouldn't be necessary to access them directly any
+ more.
+
+ Libevent now lets you declare support for all specified HTTP methods,
+ including OPTIONS, PATCH, and so on. The default list is unchanged.
+
+ Numerous evhttp bugs also got fixed.
+
+7. Infrastructure improvements
+
+7.1. Better unit test framework
+
+ We now use a unit test framework that Nick wrote called "tinytest".
+ The main benefit from Libevent's point of view is that tests which
+ might mess with global state can all run each in their own
+ subprocess. This way, when there's a bug that makes one unit test
+ crash or mess up global state, it doesn't affect any others.
+
+7.2. Better unit tests
+
+ Despite all the code we've added, our unit tests are much better than
+ before. Right now, iterating over the different backends on various
+ platforms, I'm getting between 78% and 81% test coverage, compared
+ with less than 45% test coverage in Libevent 1.4.
+
diff --git a/protocols/Telegram/tgl/libevent/whatsnew-2.1.txt b/protocols/Telegram/tgl/libevent/whatsnew-2.1.txt
new file mode 100644
index 0000000000..0be54ae11b
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/whatsnew-2.1.txt
@@ -0,0 +1,690 @@
+ What's new in Libevent 2.1
+ Nick Mathewson
+
+0. Before we start
+
+0.1. About this document
+
+ This document describes the key differences between Libevent 2.0 and
+ Libevent 2.1, from a user's point of view. It's a work in progress.
+
+ For better documentation about libevent, see the links at
+ http://libevent.org/
+
+ Libevent 2.1 would not be possible without the generous help of
+ numerous volunteers. For a list of who did what in Libevent 2.1,
+ please see the ChangeLog!
+
+ NOTE: I am very sure that I missed some thing on this list. Caveat
+ haxxor.
+
+0.2. Where to get help
+
+ Try looking at the other documentation too. All of the header files
+ have documentation in the doxygen format; this gets turned into nice
+ HTML and linked to from the libevent.org website.
+
+ There is a work-in-progress book with reference manual at
+ http://www.wangafu.net/~nickm/libevent-book/ .
+
+ You can ask questions on the #libevent IRC channel at irc.oftc.net or
+ on the mailing list at libevent-users@freehaven.net. The mailing list
+ is subscribers-only, so you will need to subscribe before you post.
+
+0.3. Compatibility
+
+ Our source-compatibility policy is that correct code (that is to say,
+ code that uses public interfaces of Libevent and relies only on their
+ documented behavior) should have forward source compatibility: any
+ such code that worked with a previous version of Libevent should work
+ with this version too.
+
+ We don't try to do binary compatibility except within stable release
+ series, so binaries linked against any version of Libevent 2.0 will
+ probably need to be recompiled against Libevent 2.1.4-alpha if you
+ want to use it. It is probable that we'll break binary compatibility
+ again before Libevent 2.1 is stable.
+
+1. New APIs and features
+
+1.1. New ways to build libevent
+
+ We now provide an --enable-gcc-hardening configure option to turn on
+ GCC features designed for increased code security.
+
+ There is also an --enable-silent-rules configure option to make
+ compilation run more quietly with automake 1.11 or later.
+
+ You no longer need to use the --enable-gcc-warnings option to turn on
+ all of the GCC warnings that Libevent uses. The only change from
+ using that option now is to turn warnings into errors.
+
+ For IDE users, files that are not supposed to be built are now
+ surrounded with appropriate #ifdef lines to keep your IDE from getting
+ upset.
+
+ There is now an alternative cmake-based build process; cmake users
+ should see the relevant sections in the README.
+
+
+1.2. New functions for events and the event loop
+
+ If you're running Libevent with multiple event priorities, you might
+ want to make sure that Libevent checks for new events frequently, so
+ that time-consuming or numerous low-priority events don't keep it from
+ checking for new high-priority events. You can now use the
+ event_config_set_max_dispatch_interval() interface to ensure that the
+ loop checks for new events either every N microseconds, every M
+ callbacks, or both.
+
+ When configuring an event base, you can now choose whether you want
+ timers to be more efficient, or more precise. (This only has effect
+ on Linux for now.) Timers are efficient by default: to select more
+ precise timers, use the EVENT_BASE_FLAG_PRECISE_TIMER flag when
+ constructing the event_config, or set the EVENT_PRECISE_TIMER
+ environment variable to a non-empty string.
+
+ There is an EVLOOP_NO_EXIT_ON_EMPTY flag that tells event_base_loop()
+ to keep looping even when there are no pending events. (Ordinarily,
+ event_base_loop() will exit as soon as no events are pending.)
+
+ Past versions of Libevent have been annoying to use with some
+ memory-leak-checking tools, because Libevent allocated some global
+ singletons but provided no means to free them. There is now a
+ function, libevent_global_shutdown(), that you can use to free all
+ globally held resources before exiting, so that your leak-check tools
+ don't complain. (Note: this function doesn't free non-global things
+ like events, bufferevents, and so on; and it doesn't free anything
+ that wouldn't otherwise get cleaned up by the operating system when
+ your process exit()s. If you aren't using a leak-checking tool, there
+ is not much reason to call libevent_global_shutdown().)
+
+ There is a new event_base_get_npriorities() function to return the
+ number of priorities set in the event base.
+
+ Libevent 2.0 added an event_new() function to construct a new struct
+ event on the heap. Unfortunately, with event_new(), there was no
+ equivalent for:
+
+ struct event ev;
+ event_assign(&ev, base, fd, EV_READ, callback, &ev);
+
+ In other words, there was no easy way for event_new() to set up an
+ event so that the event itself would be its callback argument.
+ Libevent 2.1 lets you do this by passing "event_self_cbarg()" as the
+ callback argument:
+
+ struct event *evp;
+ evp = event_new(base, fd, EV_READ, callback,
+ event_self_cbarg());
+
+ There's also a new event_base_get_running_event() function you can
+ call from within a Libevent callback to get a pointer to the current
+ event. This should never be strictly necessary, but it's sometimes
+ convenient.
+
+ The event_base_once() function used to leak some memory if the event
+ that it added was never actually triggered. Now, its memory is
+ tracked in the event_base and freed when the event_base is freed.
+ Note however that Libevent doesn't know how to free any information
+ passed as the callback argument to event_base_once is still something
+ you'll might need a way to de-allocate yourself.
+
+ There is an event_get_priority() function to return an event's
+ priority.
+
+ By analogy to event_base_loopbreak(), there is now an
+ event_base_loopcontinue() that tells Libevent to stop processing
+ active event callbacks, and re-scan for new events right away.
+
+ There's a function, event_base_foreach_event(), that can iterate over
+ every event currently pending or active on an event base, and invoke a
+ user-supplied callback on each. The callback must not alter the events
+ or add or remove anything to the event base.
+
+ We now have an event_remove_timer() function to remove the timeout on
+ an event while leaving its socket and/or signal triggers unchanged.
+ (If we were designing the API from scratch, this would be the behavior
+ of "event_add(ev, NULL)" on an already-added event with a timeout. But
+ that's a no-op in past versions of Libevent, and we don't want to
+ break compatibility.)
+
+ You can use the new event_base_get_num_events() function to find the
+ number of events active or pending on an event_base. To find the
+ largest number of events that there have been since the last call, use
+ event_base_get_max_events().
+
+ You can now activate all the events waiting for a given fd or signal
+ using the event_base_active_by_fd() and event_base_active_by_signal()
+ APIs.
+
+ On backends that support it (currently epoll), there is now an
+ EV_CLOSED flag that programs can use to detect when a socket has
+ closed without having to read all the bytes until receiving an EOF.
+
+1.3. Event finalization
+
+ [NOTE: This is an experimental feature in Libevent 2.1.3-alpha. Though
+ it seems solid so far, its API might change between now and the first
+ release candidate for Libevent 2.1.]
+
+1.3.1. Why event finalization?
+
+ Libevent 2.1 now supports an API for safely "finalizing" events that
+ might be running in multiple threads, and provides a way to slightly
+ change the semantics of event_del() to prevent deadlocks in
+ multithreaded programs.
+
+ To motivate this feature, consider the following code, in the context
+ of a mulithreaded Libevent application:
+
+ struct connection *conn = event_get_callback_arg(ev);
+ event_del(ev);
+ connection_free(conn);
+
+ Suppose that the event's callback might be running in another thread,
+ and using the value of "conn" concurrently. We wouldn't want to
+ execute the connection_free() call until "conn" is no longer in use.
+ How can we make this code safe?
+
+ Libevent 2.0 answered that question by saying that the event_del()
+ call should block if the event's callback is running in another
+ thread. That way, we can be sure that event_del() has canceled the
+ callback (if the callback hadn't started running yet), or has waited
+ for the callback to finish.
+
+ But now suppose that the data structure is protected by a lock, and we
+ have the following code:
+
+ void check_disable(struct connection *connection) {
+ lock(connection);
+ if (should_stop_reading(connection))
+ event_del(connection->read_event);
+ unlock(connection);
+ }
+
+ What happens when we call check_disable() from a callback and from
+ another thread? Let's say that the other thread gets the lock
+ first. If it decides to call event_del(), it will wait for the
+ callback to finish. But meanwhile, the callback will be waiting for
+ the lock on the connection. Since each threads is waiting for the
+ other one to release a resource, the program will deadlock.
+
+ This bug showed up in multithreaded bufferevent programs in 2.1,
+ particularly when freeing bufferevents. (For more information, see
+ the "Deadlock when calling bufferevent_free from an other thread"
+ thread on libevent-users starting on 6 August 2012 and running through
+ February of 2013. You might also like to read my earlier writeup at
+ http://archives.seul.org/libevent/users/Feb-2012/msg00053.html and
+ the ensuing discussion.)
+
+1.3.2. The EV_FINALIZE flag and avoiding deadlock
+
+ To prevent the deadlock condition described above, Libevent
+ 2.1.3-alpha adds a new flag, "EV_FINALIZE". You can pass it to
+ event_new() and event_assign() along with EV_READ, EV_WRITE, and the
+ other event flags.
+
+ When an event is constructed with the EV_FINALIZE flag, event_del()
+ will not block on that event, even when the event's callback is
+ running in another thread. By using EV_FINALIZE, you are therefore
+ promising not to use the "event_del(ev); free(event_get_callback_arg(ev));"
+ pattern, but rather to use one of the finalization functions below to
+ clean up the event.
+
+ EV_FINALIZE has no effect on a single-threaded program, or on a
+ program where events are only used from one thread.
+
+
+ There are also two new variants of event_del() that you can use for
+ more fine-grained control:
+ event_del_noblock(ev)
+ event_del_block(ev)
+ The event_del_noblock() function will never block, even if the event
+ callback is running in another thread and doesn't have the EV_FINALIZE
+ flag. The event_del_block() function will _always_ block if the event
+ callback is running in another thread, even if the event _does_ have
+ the EV_FINALIZE flag.
+
+ [A future version of Libevent may have a way to make the EV_FINALIZE
+ flag the default.]
+
+1.3.3. Safely finalizing events
+
+ To safely tear down an event that may be running, Libevent 2.1.3-alpha
+ introduces event_finalize() and event_free_finalize(). You call them
+ on an event, and provide a finalizer callback to be run on the event
+ and its callback argument once the event is definitely no longer
+ running.
+
+ With event_free_finalize(), the event is also freed once the finalizer
+ callback has been invoked.
+
+ A finalized event cannot be re-added or activated. The finalizer
+ callback must not add events, activate events, or attempt to
+ "resucitate" the event being finalized in any way.
+
+ If any finalizer callbacks are pending as the event_base is being
+ freed, they will be invoked. You can override this behavior with the
+ new function event_base_free_nofinalize().
+
+1.4. New debugging features
+
+ You can now turn on debug logs at runtime using a new function,
+ event_enable_debug_logging().
+
+ The event_enable_lock_debugging() function is now spelled correctly.
+ You can still use the old "event_enable_lock_debuging" name, though,
+ so your old programs shouldnt' break.
+
+ There's also been some work done to try to make the debugging logs
+ more generally useful.
+
+1.5. New evbuffer functions
+
+ In Libevent 2.0, we introduced evbuffer_add_file() to add an entire
+ file's contents to an evbuffer, and then send them using sendfile() or
+ mmap() as appropriate. This API had some drawbacks, however.
+ Notably, it created one mapping or fd for every instance of the same
+ file added to any evbuffer. Also, adding a file to an evbuffer could
+ make that buffer unusable with SSL bufferevents, filtering
+ bufferevents, and any code that tried to read the contents of the
+ evbuffer.
+
+ Libevent 2.1 adds a new evbuffer_file_segment API to solve these
+ problems. Now, you can use evbuffer_file_segment_new() to construct a
+ file-segment object, and evbuffer_add_file_segment() to insert it (or
+ part of it) into an evbuffer. These segments avoid creating redundant
+ maps or fds. Better still, the code is smart enough (when the OS
+ supports sendfile) to map the file when that's necessary, and use
+ sendfile() otherwise.
+
+ File segments can receive callback functions that are invoked when the
+ file segments are freed.
+
+ The evbuffer_ptr interface has been extended so that an evbuffer_ptr
+ can now yield a point just after the end of the buffer. This makes
+ many algorithms simpler to implement.
+
+ There's a new evbuffer_add_buffer() interface that you can use to add
+ one buffer to another nondestructively. When you say
+ evbuffer_add_buffer_reference(outbuf, inbuf), outbuf now contains a
+ reference to the contents of inbuf.
+
+ To aid in adding data in bulk while minimizing evbuffer calls, there
+ is an evbuffer_add_iovec() function.
+
+ There's a new evbuffer_copyout_from() variant function to enable
+ copying data nondestructively from the middle of a buffer.
+
+ evbuffer_readln() now supports an EVBUFFER_EOL_NUL argument to fetch
+ NUL-terminated strings from buffers.
+
+1.6. New functions and features: bufferevents
+
+ You can now use the bufferevent_getcb() function to find out a
+ bufferevent's callbacks. Previously, there was no supported way to do
+ that.
+
+ The largest chunk readable or writeable in a single bufferevent
+ callback is no longer hardcoded; it's now configurable with
+ the new functions bufferevent_set_max_single_read() and
+ bufferevent_set_max_single_write().
+
+ For consistency, OpenSSL bufferevents now make sure to always set one
+ of BEV_EVENT_READING or BEV_EVENT_WRITING when invoking an event
+ callback.
+
+ Calling bufferevent_set_timeouts(bev, NULL, NULL) now removes the
+ timeouts from socket and ssl bufferevents correctly.
+
+ You can find the priority at which a bufferevent runs with
+ bufferevent_get_priority().
+
+ The function bufferevent_get_token_bucket_cfg() can retrieve the
+ rate-limit settings for a bufferevent; bufferevent_getwatermark() can
+ return a bufferevent's current watermark settings.
+
+ You can manually trigger a bufferevent's callbacks via
+ bufferevent_trigger() and bufferevent_trigger_event().
+
+1.7. New functions and features: evdns
+
+ The previous evdns interface used an "open a test UDP socket" trick in
+ order to detect IPv6 support. This was a hack, since it would
+ sometimes badly confuse people's firewall software, even though no
+ packets were sent. The current evdns interface-detection code uses
+ the appropriate OS functions to see which interfaces are configured.
+
+ The evdns_base_new() function now has multiple possible values for its
+ second (flags) argument. Using 1 and 0 have their old meanings, though the
+ 1 flag now has a symbolic name of EVDNS_BASE_INITIALIZE_NAMESERVERS.
+ A second flag is now supported too: the EVDNS_BASE_DISABLE_WHEN_INACTIVE
+ flag, which tells the evdns_base that it should not prevent Libevent from
+ exiting while it has no DNS requests in progress.
+
+ There is a new evdns_base_clear_host_addresses() function to remove
+ all the /etc/hosts addresses registered with an evdns instance.
+
+1.8. New functions and features: evconnlistener
+
+ Libevent 2.1 adds the following evconnlistener flags:
+
+ LEV_OPT_DEFERRED_ACCEPT -- Tells the OS that it doesn't need to
+ report sockets as having arrived until the initiator has sent some
+ data too. This can greatly improve performance with protocols like
+ HTTP where the client always speaks first. On operating systems
+ that don't support this functionality, this option has no effect.
+
+ LEV_OPT_DISABLED -- Creates an evconnlistener in the disabled (not
+ listening) state.
+
+ Libevent 2.1 changes the behavior of the LEV_OPT_CLOSE_ON_EXEC
+ flag. Previously, it would apply to the listener sockets, but not to
+ the accepted sockets themselves. That's almost never what you want.
+ Now, it applies both to the listener and the accepted sockets.
+
+1.9. New functions and features: evhttp
+
+ **********************************************************************
+ NOTE: The evhttp module will eventually be deprecated in favor of Mark
+ Ellzey's libevhtp library. Don't worry -- this won't happen until
+ libevhtp provides every feature that evhttp does, and provides a
+ compatible interface that applications can use to migrate.
+ **********************************************************************
+
+ Previously, you could only set evhttp timeouts in increments of one
+ second. Now, you can use evhttp_set_timeout_tv() and
+ evhttp_connection_set_timeout_tv() to configure
+ microsecond-granularity timeouts.
+
+ There are a new pair of functions: evhttp_set_bevcb() and
+ evhttp_connection_base_bufferevent_new(), that you can use to
+ configure which bufferevents will be used for incoming and outgoing
+ http connections respectively. These functions, combined with SSL
+ bufferevents, should enable HTTPS support.
+
+ There's a new evhttp_foreach_bound_socket() function to iterate over
+ every listener on an evhttp object.
+
+ Whitespace between lines in headers is now folded into a single space;
+ whitespace at the end of a header is now removed.
+
+ The socket errno value is now preserved when invoking an http error
+ callback.
+
+ There's a new kind of request callback for errors; you can set it with
+ evhttp_request_set_error_cb(). It gets called when there's a request error,
+ and actually reports the error code and lets you figure out which request
+ failed.
+
+ You can navigate from an evhttp_connection back to its evhttp with the
+ new evhttp_connection_get_server() function.
+
+ You can override the default HTTP Content-Type with the new
+ evhttp_set_default_content_type() function
+
+ There's a new evhttp_connection_get_addr() API to return the peer
+ address of an evhttp_connection.
+
+ The new evhttp_send_reply_chunk_with_cb() is a variant of
+ evhttp_send_reply_chunk() with a callback to be invoked when the
+ chunk is sent.
+
+ The evhttp_request_set_header_cb() facility adds a callback to be
+ invoked while parsing headers.
+
+ The evhttp_request_set_on_complete_cb() facility adds a callback to be
+ invoked on request completion.
+
+1.10. New functions and features: evutil
+
+ There's a function "evutil_secure_rng_set_urandom_device_file()" that
+ you can use to override the default file that Libevent uses to seed
+ its (sort-of) secure RNG.
+
+2. Cross-platform performance improvements
+
+2.1. Better data structures
+
+ We replaced several users of the sys/queue.h "TAILQ" data structure
+ with the "LIST" data structure. Because this data type doesn't
+ require FIFO access, it requires fewer pointer checks and
+ manipulations to keep it in line.
+
+ All previous versions of Libevent have kept every pending (added)
+ event in an "eventqueue" data structure. Starting in Libevent 2.0,
+ however, this structure became redundant: every pending timeout event
+ is stored in the timeout heap or in one of the common_timeout queues,
+ and every pending fd or signal event is stored in an evmap. Libevent
+ 2.1 removes this data structure, and thereby saves all of the code
+ that we'd been using to keep it updated.
+
+2.2. Faster activations and timeouts
+
+ It's a common pattern in older code to use event_base_once() with a
+ 0-second timeout to ensure that a callback will get run 'as soon as
+ possible' in the current iteration of the Libevent loop. We optimize
+ this case by calling event_active() directly, and bypassing the
+ timeout pool. (People who are using this pattern should also consider
+ using event_active() themselves.)
+
+ Libevent 2.0 would wake up a polling event loop whenever the first
+ timeout in the event loop was adjusted--whether it had become earlier
+ or later. We now only notify the event loop when a change causes the
+ expiration time to become _sooner_ than it would have been otherwise.
+
+ The timeout heap code is now optimized to perform fewer comparisons
+ and shifts when changing or removing a timeout.
+
+ Instead of checking for a wall-clock time jump every time we call
+ clock_gettime(), we now check only every 5 seconds. This should save
+ a huge number of gettimeofday() calls.
+
+2.3. Microoptimizations
+
+ Internal event list maintainance no longer use the antipattern where
+ we have one function with multiple totally independent behaviors
+ depending on an argument:
+ #define OP1 1
+ #define OP2 2
+ #define OP3 3
+ void func(int operation, struct event *ev) {
+ switch (op) {
+ ...
+ }
+ }
+ Instead, these functions are now split into separate functions for
+ each operation:
+ void func_op1(struct event *ev) { ... }
+ void func_op2(struct event *ev) { ... }
+ void func_op3(struct event *ev) { ... }
+
+ This produces better code generation and inlining decisions on some
+ compilers, and makes the code easier to read and check.
+
+2.4. Evbuffer performance improvements
+
+ The EVBUFFER_EOL_CRLF line-ending type is now much faster, thanks to
+ smart optimizations.
+
+2.5. HTTP performance improvements
+
+ o Performance tweak to evhttp_parse_request_line. (aee1a97 Mark Ellzey)
+ o Add missing break to evhttp_parse_request_line (0fcc536)
+
+2.6. Coarse timers by default on Linux
+
+ Due to limitations of the epoll interface, Libevent programs using epoll
+ have not previously been able to wait for timeouts with accuracy smaller
+ than 1 millisecond. But Libevent had been using CLOCK_MONOTONIC for
+ timekeeping on Linux, which is needlessly expensive: CLOCK_MONOTONIC_COARSE
+ has approximately the resolution corresponding to epoll, and is much faster
+ to invoke than CLOCK_MONOTONIC.
+
+ To disable coarse timers, and get a more plausible precision, use the
+ new EVENT_BASE_FLAG_PRECISE_TIMER flag when setting up your event base.
+
+3. Backend/OS-specific improvements
+
+3.1. Linux-specific improvements
+
+ The logic for deciding which arguements to use with epoll_ctl() is now
+ a table-driven lookup, rather than the previous pile of cascading
+ branches. This should minimize epoll_ctl() calls and make the epoll
+ code run a little faster on change-heavy loads.
+
+ Libevent now takes advantage of Linux's support for enhanced APIs
+ (e.g., SOCK_CLOEXEC, SOCK_NONBLOCK, accept4, pipe2) that allow us to
+ simultaneously create a socket, make it nonblocking, and make it
+ close-on-exec. This should save syscalls throughout our codebase, and
+ avoid race-conditions if an exec() occurs after a socket is socket is
+ created but before we can make it close-on-execute on it.
+
+3.2. Windows-specific improvements
+
+ We now use GetSystemTimeAsFileTime to implement gettimeofday. It's
+ significantly faster and more accurate than our old ftime()-based approach.
+
+3.3. Improvements in the solaris evport backend.
+
+ The evport backend has been updated to use many of the infrastructure
+ improvements from Libevent 2.0. Notably, it keeps track of per-fd
+ information using the evmap infrastructure, and removes a number of
+ linear scans over recently-added events. This last change makes it
+ efficient to receive many more events per evport_getn() call, thereby
+ reducing evport overhead in general.
+
+3.4. OSX backend improvements
+
+ The OSX select backend doesn't like to have more than a certain number
+ of fds set unless an "unlimited select" option has been set.
+ Therefore, we now set it.
+
+3.5. Monotonic clocks on even more platforms
+
+ Libevent previously used a monotonic clock for its internal timekeeping
+ only on platforms supporting the POSIX clock_gettime() interface. Now,
+ Libevent has support for monotonic clocks on OSX and Windows too, and a
+ fallback implementation for systems without monotonic clocks that will at
+ least keep time running forwards.
+
+ Using monotonic timers makes Libevent more resilient to changes in the
+ system time, as can happen in small amounts due to clock adjustments from
+ NTP, or in large amounts due to users who move their system clocks all over
+ the timeline in order to keep nagware from nagging them.
+
+3.6. Faster cross-thread notification on kqueue
+
+ When a thread other than the one in which the main event loop is
+ running needs to wake the thread running the main event loop, Libevent
+ usually writes to a socketpair in order to force the main event loop
+ to wake up. On Linux, we've been able to use eventfd() instead. Now
+ on BSD and OSX systems (any anywhere else that has kqueue with the
+ EVFILT_USER extension), we can use EVFILT_USER to wake up the main
+ thread from kqueue. This should be a tiny bit faster than the
+ previous approach.
+
+4. Infrastructure improvements
+
+4.1. Faster tests
+
+ I've spent some time to try to make the unit tests run faster in
+ Libevent 2.1. Nearly all of this was a matter of searching slow tests
+ for unreasonably long timeouts, and cutting them down to reasonably
+ long delays, though on one or two cases I actually had to parallelize
+ an operation or improve an algorithm.
+
+ On my desktop, a full "make verify" run of Libevent 2.0.18-stable
+ requires about 218 seconds. Libevent 2.1.1-alpha cuts this down to
+ about 78 seconds.
+
+ Faster unit tests are great, since they let programmers test their
+ changes without losing their train of thought.
+
+4.2. Finicky tests are now off-by-default
+
+ The Tinytest unit testing framework now supports optional tests, and
+ Libevent uses them. By default, Libevent's unit testing framework
+ does not run tests that require a working network, and does not run
+ tests that tend to fail on heavily loaded systems because of timing
+ issues. To re-enable all tests, run ./test/regress using the "@all"
+ alias.
+
+4.3. Modernized use of autotools
+
+ Our autotools-based build system has been updated to build without
+ warnings on recent autoconf/automake versions.
+
+ Libevent's autotools makefiles are no longer recursive. This allows
+ make to use the maximum possible parallelism to do the minimally
+ necessary amount of work. See Peter Miller's "Recursive Make
+ Considered Harmful" at http://miller.emu.id.au/pmiller/books/rmch/ for
+ more information here.
+
+ We now use the "quiet build" option to suppress distracting messages
+ about which commandlines are running. You can get them back with
+ "make V=1".
+
+4.4. Portability
+
+ Libevent now uses large-file support internally on platforms where it
+ matters. You shouldn't need to set _LARGEFILE or OFFSET_BITS or
+ anything magic before including the Libevent headers, either, since
+ Libevent now sets the size of ev_off_t to the size of off_t that it
+ received at compile time, not to some (possibly different) size based
+ on current macro definitions when your program is building.
+
+ We now also use the Autoconf AC_USE_SYSTEM_EXTENSIONS mechanism to
+ enable per-system macros needed to enable not-on-by-default features.
+ Unlike the rest of the autoconf macros, we output these to an
+ internal-use-only evconfig-private.h header, since their names need to
+ survive unmangled. This lets us build correctly on more platforms,
+ and avoid inconsistencies when some files define _GNU_SOURCE and
+ others don't.
+
+ Libevent now tries to detect OpenSSL via pkg-config.
+
+4.5. Standards conformance
+
+ Previous Libevent versions had no consistent convention for internal
+ vs external identifiers, and used identifiers starting with the "_"
+ character throughout the codebase. That's no good, since the C
+ standard says that identifiers beginning with _ are reserved. I'm not
+ aware of having any collisions with system identifiers, but it's best
+ to fix these things before they cause trouble.
+
+ We now avoid all use of the _identifiers in the Libevent source code.
+ These changes were made *mainly* through the use of automated scripts,
+ so there shouldn't be any mistakes, but you never know.
+
+ As an exception, the names _EVENT_LOG_DEBUG, _EVENT_LOG_MSG_,
+ _EVENT_LOG_WARN, and _EVENT_LOG_ERR are still exposed in event.h: they
+ are now deprecated, but to support older code, they will need to stay
+ around for a while. New code should use EVENT_LOG_DEBUG,
+ EVENT_LOG_MSG, EVENT_LOG_WARN, and EVENT_LOG_ERR instead.
+
+4.6. Event and callback refactoring
+
+ As a simplification and optimization to Libevent's "deferred callback"
+ logic (introduced in 2.0 to avoid callback recursion), Libevent now
+ treats all of its deferrable callback types using the same logic it
+ uses for active events. Now deferred events no longer cause priority
+ inversion, no longer require special code to cancel them, and so on.
+
+ Regular events and deferred callbacks now both descend from an
+ internal light-weight event_callback supertype, and both support
+ priorities and take part in the other anti-priority-inversion
+ mechanisms in Libevent.
+
+ To avoid starvation from callback recursion (which was the reason we
+ introduced "deferred callbacks" in the first place) the implementation
+ now allows an event callback to be scheduled as "active later":
+ instead of running in the current iteration of the event loop, it runs
+ in the next one.
+
+5. Testing
+
+ Libevent's test coverage level is more or less unchanged since before:
+ we still have over 80% line coverage in our tests on Linux and OSX.
+ There are some under-tested modules, though: we need to fix those.
diff --git a/protocols/Telegram/tgl/libevent/win32select.c b/protocols/Telegram/tgl/libevent/win32select.c
new file mode 100644
index 0000000000..1766858c2c
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/win32select.c
@@ -0,0 +1,388 @@
+/*
+ * Copyright 2007-2012 Niels Provos and Nick Mathewson
+ * Copyright 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright 2003 Michael A. Davis <mike@datanerds.net>
+ *
+ * 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 "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef _WIN32
+
+#include <winsock2.h>
+#include <windows.h>
+#include <sys/types.h>
+#include <sys/queue.h>
+#include <limits.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+#include "event2/util.h"
+#include "util-internal.h"
+#include "log-internal.h"
+#include "event2/event.h"
+#include "event-internal.h"
+#include "evmap-internal.h"
+#include "event2/thread.h"
+#include "evthread-internal.h"
+#include "time-internal.h"
+
+#define XFREE(ptr) do { if (ptr) mm_free(ptr); } while (0)
+
+extern struct event_list timequeue;
+extern struct event_list addqueue;
+
+struct win_fd_set {
+ unsigned int fd_count;
+ SOCKET fd_array[1];
+};
+
+/* MSDN says this is required to handle SIGFPE */
+volatile double SIGFPE_REQ = 0.0f;
+
+struct idx_info {
+ int read_pos_plus1;
+ int write_pos_plus1;
+};
+
+struct win32op {
+ unsigned num_fds_in_fd_sets;
+ int resize_out_sets;
+ struct win_fd_set *readset_in;
+ struct win_fd_set *writeset_in;
+ struct win_fd_set *readset_out;
+ struct win_fd_set *writeset_out;
+ struct win_fd_set *exset_out;
+ unsigned signals_are_broken : 1;
+};
+
+static void *win32_init(struct event_base *);
+static int win32_add(struct event_base *, evutil_socket_t, short old, short events, void *idx_);
+static int win32_del(struct event_base *, evutil_socket_t, short old, short events, void *idx_);
+static int win32_dispatch(struct event_base *base, struct timeval *);
+static void win32_dealloc(struct event_base *);
+
+struct eventop win32ops = {
+ "win32",
+ win32_init,
+ win32_add,
+ win32_del,
+ win32_dispatch,
+ win32_dealloc,
+ 0, /* doesn't need reinit */
+ 0, /* No features supported. */
+ sizeof(struct idx_info),
+};
+
+#define FD_SET_ALLOC_SIZE(n) ((sizeof(struct win_fd_set) + ((n)-1)*sizeof(SOCKET)))
+
+static int
+grow_fd_sets(struct win32op *op, unsigned new_num_fds)
+{
+ size_t size;
+
+ EVUTIL_ASSERT(new_num_fds >= op->readset_in->fd_count &&
+ new_num_fds >= op->writeset_in->fd_count);
+ EVUTIL_ASSERT(new_num_fds >= 1);
+
+ size = FD_SET_ALLOC_SIZE(new_num_fds);
+ if (!(op->readset_in = mm_realloc(op->readset_in, size)))
+ return (-1);
+ if (!(op->writeset_in = mm_realloc(op->writeset_in, size)))
+ return (-1);
+ op->resize_out_sets = 1;
+ op->num_fds_in_fd_sets = new_num_fds;
+ return (0);
+}
+
+static int
+do_fd_set(struct win32op *op, struct idx_info *ent, evutil_socket_t s, int read)
+{
+ struct win_fd_set *set = read ? op->readset_in : op->writeset_in;
+ if (read) {
+ if (ent->read_pos_plus1 > 0)
+ return (0);
+ } else {
+ if (ent->write_pos_plus1 > 0)
+ return (0);
+ }
+ if (set->fd_count == op->num_fds_in_fd_sets) {
+ if (grow_fd_sets(op, op->num_fds_in_fd_sets*2))
+ return (-1);
+ /* set pointer will have changed and needs reiniting! */
+ set = read ? op->readset_in : op->writeset_in;
+ }
+ set->fd_array[set->fd_count] = s;
+ if (read)
+ ent->read_pos_plus1 = set->fd_count+1;
+ else
+ ent->write_pos_plus1 = set->fd_count+1;
+ return (set->fd_count++);
+}
+
+static int
+do_fd_clear(struct event_base *base,
+ struct win32op *op, struct idx_info *ent, int read)
+{
+ int i;
+ struct win_fd_set *set = read ? op->readset_in : op->writeset_in;
+ if (read) {
+ i = ent->read_pos_plus1 - 1;
+ ent->read_pos_plus1 = 0;
+ } else {
+ i = ent->write_pos_plus1 - 1;
+ ent->write_pos_plus1 = 0;
+ }
+ if (i < 0)
+ return (0);
+ if (--set->fd_count != (unsigned)i) {
+ struct idx_info *ent2;
+ SOCKET s2;
+ s2 = set->fd_array[i] = set->fd_array[set->fd_count];
+
+ ent2 = evmap_io_get_fdinfo_(&base->io, s2);
+
+ if (!ent2) /* This indicates a bug. */
+ return (0);
+ if (read)
+ ent2->read_pos_plus1 = i+1;
+ else
+ ent2->write_pos_plus1 = i+1;
+ }
+ return (0);
+}
+
+#define NEVENT 32
+void *
+win32_init(struct event_base *base)
+{
+ struct win32op *winop;
+ size_t size;
+ if (!(winop = mm_calloc(1, sizeof(struct win32op))))
+ return NULL;
+ winop->num_fds_in_fd_sets = NEVENT;
+ size = FD_SET_ALLOC_SIZE(NEVENT);
+ if (!(winop->readset_in = mm_malloc(size)))
+ goto err;
+ if (!(winop->writeset_in = mm_malloc(size)))
+ goto err;
+ if (!(winop->readset_out = mm_malloc(size)))
+ goto err;
+ if (!(winop->writeset_out = mm_malloc(size)))
+ goto err;
+ if (!(winop->exset_out = mm_malloc(size)))
+ goto err;
+ winop->readset_in->fd_count = winop->writeset_in->fd_count = 0;
+ winop->readset_out->fd_count = winop->writeset_out->fd_count
+ = winop->exset_out->fd_count = 0;
+
+ if (evsig_init_(base) < 0)
+ winop->signals_are_broken = 1;
+
+ evutil_weakrand_seed_(&base->weakrand_seed, 0);
+
+ return (winop);
+ err:
+ XFREE(winop->readset_in);
+ XFREE(winop->writeset_in);
+ XFREE(winop->readset_out);
+ XFREE(winop->writeset_out);
+ XFREE(winop->exset_out);
+ XFREE(winop);
+ return (NULL);
+}
+
+int
+win32_add(struct event_base *base, evutil_socket_t fd,
+ short old, short events, void *idx_)
+{
+ struct win32op *win32op = base->evbase;
+ struct idx_info *idx = idx_;
+
+ if ((events & EV_SIGNAL) && win32op->signals_are_broken)
+ return (-1);
+
+ if (!(events & (EV_READ|EV_WRITE)))
+ return (0);
+
+ event_debug(("%s: adding event for %d", __func__, (int)fd));
+ if (events & EV_READ) {
+ if (do_fd_set(win32op, idx, fd, 1)<0)
+ return (-1);
+ }
+ if (events & EV_WRITE) {
+ if (do_fd_set(win32op, idx, fd, 0)<0)
+ return (-1);
+ }
+ return (0);
+}
+
+int
+win32_del(struct event_base *base, evutil_socket_t fd, short old, short events,
+ void *idx_)
+{
+ struct win32op *win32op = base->evbase;
+ struct idx_info *idx = idx_;
+
+ event_debug(("%s: Removing event for "EV_SOCK_FMT,
+ __func__, EV_SOCK_ARG(fd)));
+ if (events & EV_READ)
+ do_fd_clear(base, win32op, idx, 1);
+ if (events & EV_WRITE)
+ do_fd_clear(base, win32op, idx, 0);
+
+ return 0;
+}
+
+static void
+fd_set_copy(struct win_fd_set *out, const struct win_fd_set *in)
+{
+ out->fd_count = in->fd_count;
+ memcpy(out->fd_array, in->fd_array, in->fd_count * (sizeof(SOCKET)));
+}
+
+/*
+ static void dump_fd_set(struct win_fd_set *s)
+ {
+ unsigned int i;
+ printf("[ ");
+ for(i=0;i<s->fd_count;++i)
+ printf("%d ",(int)s->fd_array[i]);
+ printf("]\n");
+ }
+*/
+
+int
+win32_dispatch(struct event_base *base, struct timeval *tv)
+{
+ struct win32op *win32op = base->evbase;
+ int res = 0;
+ unsigned j, i;
+ int fd_count;
+ SOCKET s;
+
+ if (win32op->resize_out_sets) {
+ size_t size = FD_SET_ALLOC_SIZE(win32op->num_fds_in_fd_sets);
+ if (!(win32op->readset_out = mm_realloc(win32op->readset_out, size)))
+ return (-1);
+ if (!(win32op->exset_out = mm_realloc(win32op->exset_out, size)))
+ return (-1);
+ if (!(win32op->writeset_out = mm_realloc(win32op->writeset_out, size)))
+ return (-1);
+ win32op->resize_out_sets = 0;
+ }
+
+ fd_set_copy(win32op->readset_out, win32op->readset_in);
+ fd_set_copy(win32op->exset_out, win32op->writeset_in);
+ fd_set_copy(win32op->writeset_out, win32op->writeset_in);
+
+ fd_count =
+ (win32op->readset_out->fd_count > win32op->writeset_out->fd_count) ?
+ win32op->readset_out->fd_count : win32op->writeset_out->fd_count;
+
+ if (!fd_count) {
+ long msec = tv ? evutil_tv_to_msec_(tv) : LONG_MAX;
+ /* Sleep's DWORD argument is unsigned long */
+ if (msec < 0)
+ msec = LONG_MAX;
+ /* Windows doesn't like you to call select() with no sockets */
+ Sleep(msec);
+ return (0);
+ }
+
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+
+ res = select(fd_count,
+ (struct fd_set*)win32op->readset_out,
+ (struct fd_set*)win32op->writeset_out,
+ (struct fd_set*)win32op->exset_out, tv);
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+
+ event_debug(("%s: select returned %d", __func__, res));
+
+ if (res <= 0) {
+ return res;
+ }
+
+ if (win32op->readset_out->fd_count) {
+ i = evutil_weakrand_range_(&base->weakrand_seed,
+ win32op->readset_out->fd_count);
+ for (j=0; j<win32op->readset_out->fd_count; ++j) {
+ if (++i >= win32op->readset_out->fd_count)
+ i = 0;
+ s = win32op->readset_out->fd_array[i];
+ evmap_io_active_(base, s, EV_READ);
+ }
+ }
+ if (win32op->exset_out->fd_count) {
+ i = evutil_weakrand_range_(&base->weakrand_seed,
+ win32op->exset_out->fd_count);
+ for (j=0; j<win32op->exset_out->fd_count; ++j) {
+ if (++i >= win32op->exset_out->fd_count)
+ i = 0;
+ s = win32op->exset_out->fd_array[i];
+ evmap_io_active_(base, s, EV_WRITE);
+ }
+ }
+ if (win32op->writeset_out->fd_count) {
+ SOCKET s;
+ i = evutil_weakrand_range_(&base->weakrand_seed,
+ win32op->writeset_out->fd_count);
+ for (j=0; j<win32op->writeset_out->fd_count; ++j) {
+ if (++i >= win32op->writeset_out->fd_count)
+ i = 0;
+ s = win32op->writeset_out->fd_array[i];
+ evmap_io_active_(base, s, EV_WRITE);
+ }
+ }
+ return (0);
+}
+
+void
+win32_dealloc(struct event_base *base)
+{
+ struct win32op *win32op = base->evbase;
+
+ evsig_dealloc_(base);
+ if (win32op->readset_in)
+ mm_free(win32op->readset_in);
+ if (win32op->writeset_in)
+ mm_free(win32op->writeset_in);
+ if (win32op->readset_out)
+ mm_free(win32op->readset_out);
+ if (win32op->writeset_out)
+ mm_free(win32op->writeset_out);
+ if (win32op->exset_out)
+ mm_free(win32op->exset_out);
+ /* XXXXX free the tree. */
+
+ memset(win32op, 0, sizeof(*win32op));
+ mm_free(win32op);
+}
+
+#endif
diff --git a/protocols/Telegram/tgl/libevent/win32select.obj b/protocols/Telegram/tgl/libevent/win32select.obj
new file mode 100644
index 0000000000..225738415a
--- /dev/null
+++ b/protocols/Telegram/tgl/libevent/win32select.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/m4-ax_gcc_builtin.m4 b/protocols/Telegram/tgl/m4-ax_gcc_builtin.m4
new file mode 100644
index 0000000000..b28a91b14a
--- /dev/null
+++ b/protocols/Telegram/tgl/m4-ax_gcc_builtin.m4
@@ -0,0 +1,168 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_gcc_builtin.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_GCC_BUILTIN(BUILTIN)
+#
+# DESCRIPTION
+#
+# This macro checks if the compiler supports one of GCC's built-in
+# functions; many other compilers also provide those same built-ins.
+#
+# The BUILTIN parameter is the name of the built-in function.
+#
+# If BUILTIN is supported define HAVE_<BUILTIN>. Keep in mind that since
+# builtins usually start with two underscores they will be copied over
+# into the HAVE_<BUILTIN> definition (e.g. HAVE___BUILTIN_EXPECT for
+# __builtin_expect()).
+#
+# The macro caches its result in the ax_cv_have_<BUILTIN> variable (e.g.
+# ax_cv_have___builtin_expect).
+#
+# The macro currently supports the following built-in functions:
+#
+# __builtin_assume_aligned
+# __builtin_bswap32
+# __builtin_bswap64
+# __builtin_choose_expr
+# __builtin___clear_cache
+# __builtin_clrsb
+# __builtin_clrsbl
+# __builtin_clrsbll
+# __builtin_clz
+# __builtin_clzl
+# __builtin_clzll
+# __builtin_complex
+# __builtin_constant_p
+# __builtin_ctz
+# __builtin_ctzl
+# __builtin_ctzll
+# __builtin_expect
+# __builtin_ffs
+# __builtin_ffsl
+# __builtin_ffsll
+# __builtin_fpclassify
+# __builtin_huge_val
+# __builtin_huge_valf
+# __builtin_huge_vall
+# __builtin_inf
+# __builtin_infd128
+# __builtin_infd32
+# __builtin_infd64
+# __builtin_inff
+# __builtin_infl
+# __builtin_isinf_sign
+# __builtin_nan
+# __builtin_nand128
+# __builtin_nand32
+# __builtin_nand64
+# __builtin_nanf
+# __builtin_nanl
+# __builtin_nans
+# __builtin_nansf
+# __builtin_nansl
+# __builtin_object_size
+# __builtin_parity
+# __builtin_parityl
+# __builtin_parityll
+# __builtin_popcount
+# __builtin_popcountl
+# __builtin_popcountll
+# __builtin_powi
+# __builtin_powif
+# __builtin_powil
+# __builtin_prefetch
+# __builtin_trap
+# __builtin_types_compatible_p
+# __builtin_unreachable
+#
+# Unsuppored built-ins will be tested with an empty parameter set and the
+# result of the check might be wrong or meaningless so use with care.
+#
+# LICENSE
+#
+# Copyright (c) 2013 Gabriele Svelto <gabriele.svelto@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 2
+
+AC_DEFUN([AX_GCC_BUILTIN], [
+ AS_VAR_PUSHDEF([ac_var], [ax_cv_have_$1])
+
+ AC_CACHE_CHECK([for $1], [ac_var], [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [
+ m4_case([$1],
+ [__builtin_assume_aligned], [$1("", 0)],
+ [__builtin_bswap32], [$1(0)],
+ [__builtin_bswap64], [$1(0)],
+ [__builtin_choose_expr], [$1(0, 0, 0)],
+ [__builtin___clear_cache], [$1("", "")],
+ [__builtin_clrsb], [$1(0)],
+ [__builtin_clrsbl], [$1(0)],
+ [__builtin_clrsbll], [$1(0)],
+ [__builtin_clz], [$1(0)],
+ [__builtin_clzl], [$1(0)],
+ [__builtin_clzll], [$1(0)],
+ [__builtin_complex], [$1(0.0, 0.0)],
+ [__builtin_constant_p], [$1(0)],
+ [__builtin_ctz], [$1(0)],
+ [__builtin_ctzl], [$1(0)],
+ [__builtin_ctzll], [$1(0)],
+ [__builtin_expect], [$1(0, 0)],
+ [__builtin_ffs], [$1(0)],
+ [__builtin_ffsl], [$1(0)],
+ [__builtin_ffsll], [$1(0)],
+ [__builtin_fpclassify], [$1(0, 1, 2, 3, 4, 0.0)],
+ [__builtin_huge_val], [$1()],
+ [__builtin_huge_valf], [$1()],
+ [__builtin_huge_vall], [$1()],
+ [__builtin_inf], [$1()],
+ [__builtin_infd128], [$1()],
+ [__builtin_infd32], [$1()],
+ [__builtin_infd64], [$1()],
+ [__builtin_inff], [$1()],
+ [__builtin_infl], [$1()],
+ [__builtin_isinf_sign], [$1(0.0)],
+ [__builtin_nan], [$1("")],
+ [__builtin_nand128], [$1("")],
+ [__builtin_nand32], [$1("")],
+ [__builtin_nand64], [$1("")],
+ [__builtin_nanf], [$1("")],
+ [__builtin_nanl], [$1("")],
+ [__builtin_nans], [$1("")],
+ [__builtin_nansf], [$1("")],
+ [__builtin_nansl], [$1("")],
+ [__builtin_object_size], [$1("", 0)],
+ [__builtin_parity], [$1(0)],
+ [__builtin_parityl], [$1(0)],
+ [__builtin_parityll], [$1(0)],
+ [__builtin_popcount], [$1(0)],
+ [__builtin_popcountl], [$1(0)],
+ [__builtin_popcountll], [$1(0)],
+ [__builtin_powi], [$1(0, 0)],
+ [__builtin_powif], [$1(0, 0)],
+ [__builtin_powil], [$1(0, 0)],
+ [__builtin_prefetch], [$1("")],
+ [__builtin_trap], [$1()],
+ [__builtin_types_compatible_p], [$1(int, int)],
+ [__builtin_unreachable], [$1()],
+ [m4_warn([syntax], [Unsupported built-in $1, the test may fail])
+ $1()]
+ )
+ ])],
+ [AS_VAR_SET([ac_var], [yes])],
+ [AS_VAR_SET([ac_var], [no])])
+ ])
+
+ AS_IF([test yes = AS_VAR_GET([ac_var])],
+ [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$1), 1,
+ [Define to 1 if the system has the `$1' built-in function])], [])
+
+ AS_VAR_POPDEF([ac_var])
+])
diff --git a/protocols/Telegram/tgl/m4_ax_check_openssl.m4 b/protocols/Telegram/tgl/m4_ax_check_openssl.m4
new file mode 100644
index 0000000000..a87c5a6b6f
--- /dev/null
+++ b/protocols/Telegram/tgl/m4_ax_check_openssl.m4
@@ -0,0 +1,124 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_check_openssl.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_OPENSSL([action-if-found[, action-if-not-found]])
+#
+# DESCRIPTION
+#
+# Look for OpenSSL in a number of default spots, or in a user-selected
+# spot (via --with-openssl). Sets
+#
+# OPENSSL_INCLUDES to the include directives required
+# OPENSSL_LIBS to the -l directives required
+# OPENSSL_LDFLAGS to the -L or -R flags required
+#
+# and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately
+#
+# This macro sets OPENSSL_INCLUDES such that source files should use the
+# openssl/ directory in include directives:
+#
+# #include <openssl/hmac.h>
+#
+# LICENSE
+#
+# Copyright (c) 2009,2010 Zmanda Inc. <http://www.zmanda.com/>
+# Copyright (c) 2009,2010 Dustin J. Mitchell <dustin@zmanda.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 8
+
+AU_ALIAS([CHECK_SSL], [AX_CHECK_OPENSSL])
+AC_DEFUN([AX_CHECK_OPENSSL], [
+ found=false
+ AC_ARG_WITH([openssl],
+ [AS_HELP_STRING([--with-openssl=DIR],
+ [root of the OpenSSL directory])],
+ [
+ case "$withval" in
+ "" | y | ye | yes | n | no)
+ AC_MSG_ERROR([Invalid --with-openssl value])
+ ;;
+ *) ssldirs="$withval"
+ ;;
+ esac
+ ], [
+ # if pkg-config is installed and openssl has installed a .pc file,
+ # then use that information and don't search ssldirs
+ AC_PATH_PROG([PKG_CONFIG], [pkg-config])
+ if test x"$PKG_CONFIG" != x""; then
+ OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null`
+ if test $? = 0; then
+ OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null`
+ OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null`
+ found=true
+ fi
+ fi
+
+ # no such luck; use some default ssldirs
+ if ! $found; then
+ ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr"
+ fi
+ ]
+ )
+
+
+ # note that we #include <openssl/foo.h>, so the OpenSSL headers have to be in
+ # an 'openssl' subdirectory
+
+ if ! $found; then
+ OPENSSL_INCLUDES=
+ for ssldir in $ssldirs; do
+ AC_MSG_CHECKING([for openssl/ssl.h in $ssldir])
+ if test -f "$ssldir/include/openssl/ssl.h"; then
+ OPENSSL_INCLUDES="-I$ssldir/include"
+ OPENSSL_LDFLAGS="-L$ssldir/lib"
+ OPENSSL_LIBS="-lssl -lcrypto"
+ found=true
+ AC_MSG_RESULT([yes])
+ break
+ else
+ AC_MSG_RESULT([no])
+ fi
+ done
+
+ # if the file wasn't found, well, go ahead and try the link anyway -- maybe
+ # it will just work!
+ fi
+
+ # try the preprocessor and linker with our new flags,
+ # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS
+
+ AC_MSG_CHECKING([whether compiling and linking against OpenSSL works])
+ echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \
+ "OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&AS_MESSAGE_LOG_FD
+
+ save_LIBS="$LIBS"
+ save_LDFLAGS="$LDFLAGS"
+ save_CPPFLAGS="$CPPFLAGS"
+ LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS"
+ LIBS="$OPENSSL_LIBS $LIBS"
+ CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([#include <openssl/ssl.h>], [SSL_new(NULL)])],
+ [
+ AC_MSG_RESULT([yes])
+ $1
+ ], [
+ AC_MSG_RESULT([no])
+ $2
+ ])
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+
+ AC_SUBST([OPENSSL_INCLUDES])
+ AC_SUBST([OPENSSL_LIBS])
+ AC_SUBST([OPENSSL_LDFLAGS])
+])
diff --git a/protocols/Telegram/tgl/m4_ax_check_zlib.m4 b/protocols/Telegram/tgl/m4_ax_check_zlib.m4
new file mode 100644
index 0000000000..ae5705f624
--- /dev/null
+++ b/protocols/Telegram/tgl/m4_ax_check_zlib.m4
@@ -0,0 +1,142 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_check_zlib.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_ZLIB([action-if-found], [action-if-not-found])
+#
+# DESCRIPTION
+#
+# This macro searches for an installed zlib library. If nothing was
+# specified when calling configure, it searches first in /usr/local and
+# then in /usr, /opt/local and /sw. If the --with-zlib=DIR is specified,
+# it will try to find it in DIR/include/zlib.h and DIR/lib/libz.a. If
+# --without-zlib is specified, the library is not searched at all.
+#
+# If either the header file (zlib.h) or the library (libz) is not found,
+# shell commands 'action-if-not-found' is run. If 'action-if-not-found' is
+# not specified, the configuration exits on error, asking for a valid zlib
+# installation directory or --without-zlib.
+#
+# If both header file and library are found, shell commands
+# 'action-if-found' is run. If 'action-if-found' is not specified, the
+# default action appends '-I${ZLIB_HOME}/include' to CPFLAGS, appends
+# '-L$ZLIB_HOME}/lib' to LDFLAGS, prepends '-lz' to LIBS, and calls
+# AC_DEFINE(HAVE_LIBZ). You should use autoheader to include a definition
+# for this symbol in a config.h file. Sample usage in a C/C++ source is as
+# follows:
+#
+# #ifdef HAVE_LIBZ
+# #include <zlib.h>
+# #endif /* HAVE_LIBZ */
+#
+# LICENSE
+#
+# Copyright (c) 2008 Loic Dachary <loic@senga.org>
+# Copyright (c) 2010 Bastien Chevreux <bach@chevreux.org>
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 14
+
+AU_ALIAS([CHECK_ZLIB], [AX_CHECK_ZLIB])
+AC_DEFUN([AX_CHECK_ZLIB],
+#
+# Handle user hints
+#
+[AC_MSG_CHECKING(if zlib is wanted)
+zlib_places="/usr/local /usr /opt/local /sw"
+AC_ARG_WITH([zlib],
+[ --with-zlib=DIR root directory path of zlib installation @<:@defaults to
+ /usr/local or /usr if not found in /usr/local@:>@
+ --without-zlib to disable zlib usage completely],
+[if test "$withval" != no ; then
+ AC_MSG_RESULT(yes)
+ if test -d "$withval"
+ then
+ zlib_places="$withval $zlib_places"
+ else
+ AC_MSG_WARN([Sorry, $withval does not exist, checking usual places])
+ fi
+else
+ zlib_places=
+ AC_MSG_RESULT(no)
+fi],
+[AC_MSG_RESULT(yes)])
+
+#
+# Locate zlib, if wanted
+#
+if test -n "${zlib_places}"
+then
+ # check the user supplied or any other more or less 'standard' place:
+ # Most UNIX systems : /usr/local and /usr
+ # MacPorts / Fink on OSX : /opt/local respectively /sw
+ for ZLIB_HOME in ${zlib_places} ; do
+ if test -f "${ZLIB_HOME}/include/zlib.h"; then break; fi
+ ZLIB_HOME=""
+ done
+
+ ZLIB_OLD_LDFLAGS=$LDFLAGS
+ ZLIB_OLD_CPPFLAGS=$CPPFLAGS
+ if test -n "${ZLIB_HOME}"; then
+ LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
+ CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
+ fi
+ AC_LANG_SAVE
+ AC_LANG_C
+ AC_CHECK_LIB([z], [inflateEnd], [zlib_cv_libz=yes], [zlib_cv_libz=no])
+ AC_CHECK_HEADER([zlib.h], [zlib_cv_zlib_h=yes], [zlib_cv_zlib_h=no])
+ AC_LANG_RESTORE
+ if test "$zlib_cv_libz" = "yes" && test "$zlib_cv_zlib_h" = "yes"
+ then
+ #
+ # If both library and header were found, action-if-found
+ #
+ m4_ifblank([$1],[
+ CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
+ LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
+ LIBS="-lz $LIBS"
+ AC_DEFINE([HAVE_LIBZ], [1],
+ [Define to 1 if you have `z' library (-lz)])
+ ],[
+ # Restore variables
+ LDFLAGS="$ZLIB_OLD_LDFLAGS"
+ CPPFLAGS="$ZLIB_OLD_CPPFLAGS"
+ $1
+ ])
+ else
+ #
+ # If either header or library was not found, action-if-not-found
+ #
+ m4_default([$2],[
+ AC_MSG_ERROR([either specify a valid zlib installation with --with-zlib=DIR or disable zlib usage with --without-zlib])
+ ])
+ fi
+fi
+])
diff --git a/protocols/Telegram/tgl/mime-types.c b/protocols/Telegram/tgl/mime-types.c
new file mode 100644
index 0000000000..0110d3fa2e
--- /dev/null
+++ b/protocols/Telegram/tgl/mime-types.c
@@ -0,0 +1,4421 @@
+static char mime_types[] = {
+ 0x23, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20,
+ 0x6d, 0x61, 0x70, 0x73, 0x20, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65,
+ 0x74, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x20, 0x74, 0x79, 0x70, 0x65,
+ 0x73, 0x20, 0x74, 0x6f, 0x20, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x20,
+ 0x66, 0x69, 0x6c, 0x65, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,
+ 0x6f, 0x6e, 0x28, 0x73, 0x29, 0x2e, 0x0a, 0x23, 0x20, 0x41, 0x6c, 0x74,
+ 0x68, 0x6f, 0x75, 0x67, 0x68, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65,
+ 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x68, 0x74, 0x74, 0x70, 0x64, 0x2c,
+ 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x69,
+ 0x73, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x6d, 0x61,
+ 0x6e, 0x79, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20,
+ 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x0a, 0x23, 0x20, 0x61, 0x6e,
+ 0x64, 0x20, 0x68, 0x61, 0x73, 0x20, 0x62, 0x65, 0x65, 0x6e, 0x20, 0x70,
+ 0x6c, 0x61, 0x63, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65,
+ 0x20, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x64, 0x6f, 0x6d, 0x61,
+ 0x69, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x75, 0x6e, 0x6c, 0x69, 0x6d,
+ 0x69, 0x74, 0x65, 0x64, 0x20, 0x72, 0x65, 0x64, 0x69, 0x73, 0x72, 0x69,
+ 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x23, 0x0a, 0x23, 0x20,
+ 0x54, 0x68, 0x65, 0x20, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x62, 0x65,
+ 0x6c, 0x6f, 0x77, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73,
+ 0x20, 0x62, 0x6f, 0x74, 0x68, 0x20, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74,
+ 0x65, 0x72, 0x65, 0x64, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x28, 0x63, 0x6f,
+ 0x6d, 0x6d, 0x6f, 0x6e, 0x29, 0x20, 0x75, 0x6e, 0x72, 0x65, 0x67, 0x69,
+ 0x73, 0x74, 0x65, 0x72, 0x65, 0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73,
+ 0x2e, 0x0a, 0x23, 0x20, 0x41, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x74,
+ 0x68, 0x61, 0x74, 0x20, 0x68, 0x61, 0x73, 0x20, 0x6e, 0x6f, 0x20, 0x75,
+ 0x6e, 0x69, 0x71, 0x75, 0x65, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73,
+ 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x69,
+ 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x64, 0x20, 0x2d, 0x2d, 0x20, 0x74, 0x68,
+ 0x65, 0x79, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x65,
+ 0x64, 0x0a, 0x23, 0x20, 0x68, 0x65, 0x72, 0x65, 0x20, 0x74, 0x6f, 0x20,
+ 0x67, 0x75, 0x69, 0x64, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
+ 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x74, 0x6f, 0x77,
+ 0x61, 0x72, 0x64, 0x20, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x20, 0x74, 0x79,
+ 0x70, 0x65, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x6d,
+ 0x61, 0x6b, 0x65, 0x20, 0x69, 0x74, 0x20, 0x65, 0x61, 0x73, 0x69, 0x65,
+ 0x72, 0x20, 0x74, 0x6f, 0x0a, 0x23, 0x20, 0x69, 0x64, 0x65, 0x6e, 0x74,
+ 0x69, 0x66, 0x79, 0x20, 0x22, 0x6e, 0x65, 0x77, 0x22, 0x20, 0x74, 0x79,
+ 0x70, 0x65, 0x73, 0x2e, 0x20, 0x20, 0x46, 0x69, 0x6c, 0x65, 0x20, 0x65,
+ 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x72,
+ 0x65, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
+ 0x6e, 0x6c, 0x79, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20,
+ 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x0a, 0x23, 0x20, 0x63,
+ 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x20, 0x6c, 0x61, 0x6e, 0x67, 0x75,
+ 0x61, 0x67, 0x65, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x65, 0x6e, 0x63,
+ 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x2c, 0x20, 0x73, 0x6f, 0x20, 0x63,
+ 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x20, 0x74, 0x68, 0x65, 0x6d, 0x20, 0x63,
+ 0x61, 0x72, 0x65, 0x66, 0x75, 0x6c, 0x6c, 0x79, 0x2e, 0x0a, 0x23, 0x0a,
+ 0x23, 0x20, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x20, 0x6d,
+ 0x65, 0x64, 0x69, 0x61, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x20, 0x73,
+ 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x67,
+ 0x69, 0x73, 0x74, 0x65, 0x72, 0x65, 0x64, 0x20, 0x61, 0x73, 0x20, 0x64,
+ 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20,
+ 0x52, 0x46, 0x43, 0x20, 0x34, 0x32, 0x38, 0x38, 0x2e, 0x0a, 0x23, 0x20,
+ 0x54, 0x68, 0x65, 0x20, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79,
+ 0x20, 0x69, 0x73, 0x20, 0x61, 0x74, 0x20, 0x3c, 0x68, 0x74, 0x74, 0x70,
+ 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x61, 0x6e, 0x61, 0x2e,
+ 0x6f, 0x72, 0x67, 0x2f, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65,
+ 0x6e, 0x74, 0x73, 0x2f, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x2d, 0x74, 0x79,
+ 0x70, 0x65, 0x73, 0x2f, 0x3e, 0x2e, 0x0a, 0x23, 0x0a, 0x23, 0x20, 0x4d,
+ 0x49, 0x4d, 0x45, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x28, 0x6c, 0x6f,
+ 0x77, 0x65, 0x72, 0x63, 0x61, 0x73, 0x65, 0x64, 0x29, 0x09, 0x09, 0x09,
+ 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x0a, 0x23,
+ 0x20, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d,
+ 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d,
+ 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d,
+ 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x09, 0x3d, 0x3d,
+ 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x31,
+ 0x64, 0x2d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6c, 0x65, 0x61, 0x76, 0x65,
+ 0x64, 0x2d, 0x70, 0x61, 0x72, 0x69, 0x74, 0x79, 0x66, 0x65, 0x63, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x33, 0x67, 0x70, 0x70, 0x2d, 0x69, 0x6d, 0x73, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x6d,
+ 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61, 0x6e, 0x64, 0x72, 0x65,
+ 0x77, 0x2d, 0x69, 0x6e, 0x73, 0x65, 0x74, 0x09, 0x09, 0x09, 0x65, 0x7a,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x66, 0x69, 0x6c, 0x65,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x78, 0x77, 0x61, 0x72, 0x65, 0x09,
+ 0x09, 0x09, 0x09, 0x61, 0x77, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61, 0x74, 0x6f, 0x6d, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x61, 0x74, 0x6f, 0x6d, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61,
+ 0x74, 0x6f, 0x6d, 0x63, 0x61, 0x74, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09,
+ 0x09, 0x09, 0x61, 0x74, 0x6f, 0x6d, 0x63, 0x61, 0x74, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x61, 0x74, 0x6f, 0x6d, 0x69, 0x63, 0x6d, 0x61, 0x69, 0x6c, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61,
+ 0x74, 0x6f, 0x6d, 0x73, 0x76, 0x63, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09,
+ 0x09, 0x09, 0x61, 0x74, 0x6f, 0x6d, 0x73, 0x76, 0x63, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x61, 0x75, 0x74, 0x68, 0x2d, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x2d,
+ 0x73, 0x6d, 0x74, 0x70, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x62, 0x65, 0x65, 0x70, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x63, 0x61, 0x6c, 0x65, 0x6e, 0x64,
+ 0x61, 0x72, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x63, 0x61, 0x6c,
+ 0x73, 0x2d, 0x31, 0x38, 0x34, 0x30, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x63, 0x63, 0x6d,
+ 0x70, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x63, 0x63, 0x78, 0x6d, 0x6c, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x63, 0x63, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x63, 0x64, 0x6d, 0x69, 0x2d, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69,
+ 0x6c, 0x69, 0x74, 0x79, 0x09, 0x09, 0x09, 0x63, 0x64, 0x6d, 0x69, 0x61,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x63, 0x64, 0x6d, 0x69, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69,
+ 0x6e, 0x65, 0x72, 0x09, 0x09, 0x09, 0x63, 0x64, 0x6d, 0x69, 0x63, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x63, 0x64, 0x6d, 0x69, 0x2d, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x09,
+ 0x09, 0x09, 0x09, 0x63, 0x64, 0x6d, 0x69, 0x64, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x63, 0x64, 0x6d,
+ 0x69, 0x2d, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x09, 0x09, 0x09, 0x09,
+ 0x63, 0x64, 0x6d, 0x69, 0x6f, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x63, 0x64, 0x6d, 0x69, 0x2d, 0x71,
+ 0x75, 0x65, 0x75, 0x65, 0x09, 0x09, 0x09, 0x09, 0x63, 0x64, 0x6d, 0x69,
+ 0x71, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x63, 0x65, 0x61, 0x2d, 0x32, 0x30, 0x31, 0x38,
+ 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x63, 0x65, 0x6c, 0x6c, 0x6d,
+ 0x6c, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x63, 0x66, 0x77, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x63, 0x6e, 0x72, 0x70, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x67, 0x72, 0x6f, 0x75, 0x6e,
+ 0x64, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e,
+ 0x63, 0x65, 0x2d, 0x69, 0x6e, 0x66, 0x6f, 0x2b, 0x78, 0x6d, 0x6c, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x63, 0x70, 0x6c, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x63, 0x73, 0x74, 0x61, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x63,
+ 0x73, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2b, 0x78, 0x6d, 0x6c, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x63, 0x75, 0x2d, 0x73, 0x65, 0x65, 0x6d, 0x65, 0x09, 0x09, 0x09, 0x09,
+ 0x63, 0x75, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x63, 0x79, 0x62, 0x65, 0x72, 0x63, 0x61,
+ 0x73, 0x68, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x64, 0x61, 0x76, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x64, 0x61, 0x76, 0x6d, 0x6f, 0x75,
+ 0x6e, 0x74, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x64, 0x63, 0x61, 0x2d, 0x72, 0x66, 0x74,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x64, 0x65, 0x63, 0x2d, 0x64, 0x78, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x2d, 0x69, 0x6e, 0x66, 0x6f, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x64, 0x69, 0x63, 0x6f, 0x6d, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x64, 0x6e, 0x73, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x64, 0x6f, 0x63, 0x62, 0x6f, 0x6f,
+ 0x6b, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x64, 0x62, 0x6b,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x64, 0x73, 0x6b, 0x70, 0x70, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x64, 0x73, 0x73, 0x63, 0x2b, 0x64, 0x65, 0x72, 0x09, 0x09, 0x09,
+ 0x09, 0x64, 0x73, 0x73, 0x63, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x64, 0x73, 0x73, 0x63, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x78, 0x64, 0x73, 0x73, 0x63, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x64, 0x76, 0x63, 0x73, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x65, 0x63, 0x6d, 0x61, 0x73,
+ 0x63, 0x72, 0x69, 0x70, 0x74, 0x09, 0x09, 0x09, 0x09, 0x65, 0x63, 0x6d,
+ 0x61, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x65, 0x64, 0x69, 0x2d, 0x63, 0x6f, 0x6e, 0x73,
+ 0x65, 0x6e, 0x74, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x65, 0x64, 0x69, 0x2d, 0x78, 0x31,
+ 0x32, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x65, 0x64, 0x69, 0x66, 0x61, 0x63, 0x74, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x65, 0x6d, 0x6d, 0x61, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09,
+ 0x65, 0x6d, 0x6d, 0x61, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x65, 0x70, 0x70, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x65, 0x70, 0x75, 0x62, 0x2b, 0x7a, 0x69, 0x70, 0x09,
+ 0x09, 0x09, 0x09, 0x65, 0x70, 0x75, 0x62, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x65, 0x73,
+ 0x68, 0x6f, 0x70, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c,
+ 0x65, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x65, 0x78, 0x69, 0x09, 0x09, 0x09, 0x09, 0x09, 0x65, 0x78,
+ 0x69, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x66, 0x61, 0x73, 0x74, 0x69, 0x6e, 0x66, 0x6f,
+ 0x73, 0x65, 0x74, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x66, 0x61, 0x73, 0x74, 0x73, 0x6f,
+ 0x61, 0x70, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x66, 0x69, 0x74, 0x73, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x66, 0x6f,
+ 0x6e, 0x74, 0x2d, 0x74, 0x64, 0x70, 0x66, 0x72, 0x09, 0x09, 0x09, 0x09,
+ 0x70, 0x66, 0x72, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x77,
+ 0x6f, 0x72, 0x6b, 0x2d, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x73, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x6d, 0x6c, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x67, 0x6d, 0x6c, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x70,
+ 0x78, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x67, 0x70, 0x78,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x67, 0x78, 0x66, 0x09, 0x09, 0x09, 0x09, 0x09, 0x67, 0x78, 0x66,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x68, 0x32, 0x32, 0x34, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x68, 0x65,
+ 0x6c, 0x64, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x68, 0x74, 0x74,
+ 0x70, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x73, 0x74, 0x75, 0x64, 0x69,
+ 0x6f, 0x09, 0x09, 0x09, 0x09, 0x73, 0x74, 0x6b, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x69,
+ 0x62, 0x65, 0x2d, 0x6b, 0x65, 0x79, 0x2d, 0x72, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x69, 0x62, 0x65,
+ 0x2d, 0x70, 0x6b, 0x67, 0x2d, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x69, 0x62, 0x65, 0x2d, 0x70, 0x70, 0x2d,
+ 0x64, 0x61, 0x74, 0x61, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x69, 0x67, 0x65, 0x73, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x69, 0x6d, 0x2d, 0x69, 0x73, 0x63, 0x6f, 0x6d, 0x70, 0x6f,
+ 0x73, 0x69, 0x6e, 0x67, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x69,
+ 0x6e, 0x64, 0x65, 0x78, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78,
+ 0x2e, 0x63, 0x6d, 0x64, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78,
+ 0x2e, 0x6f, 0x62, 0x6a, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78,
+ 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x76, 0x6e, 0x64, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x69, 0x6e,
+ 0x6b, 0x6d, 0x6c, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x69,
+ 0x6e, 0x6b, 0x20, 0x69, 0x6e, 0x6b, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x69,
+ 0x6f, 0x74, 0x70, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x69, 0x70, 0x66, 0x69, 0x78, 0x09, 0x09, 0x09,
+ 0x09, 0x69, 0x70, 0x66, 0x69, 0x78, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x69, 0x70, 0x70,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x69, 0x73, 0x75, 0x70, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x61, 0x76, 0x61,
+ 0x2d, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x09, 0x09, 0x09, 0x6a,
+ 0x61, 0x72, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x6a, 0x61, 0x76, 0x61, 0x2d, 0x73, 0x65, 0x72, 0x69,
+ 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x2d, 0x6f, 0x62, 0x6a, 0x65, 0x63,
+ 0x74, 0x09, 0x09, 0x73, 0x65, 0x72, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x61, 0x76, 0x61, 0x2d,
+ 0x76, 0x6d, 0x09, 0x09, 0x09, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x6a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x09, 0x09,
+ 0x09, 0x09, 0x6a, 0x73, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x09, 0x09, 0x09,
+ 0x09, 0x6a, 0x73, 0x6f, 0x6e, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x6d, 0x6c,
+ 0x2b, 0x6a, 0x73, 0x6f, 0x6e, 0x09, 0x09, 0x09, 0x09, 0x6a, 0x73, 0x6f,
+ 0x6e, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6b, 0x70, 0x6d, 0x6c, 0x2d, 0x72,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x6b, 0x70, 0x6d, 0x6c, 0x2d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e,
+ 0x73, 0x65, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6c, 0x6f, 0x73, 0x74, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x6c, 0x6f, 0x73, 0x74, 0x78,
+ 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x6d, 0x61, 0x63, 0x2d, 0x62, 0x69, 0x6e, 0x68, 0x65,
+ 0x78, 0x34, 0x30, 0x09, 0x09, 0x09, 0x68, 0x71, 0x78, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x61,
+ 0x63, 0x2d, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x70, 0x72, 0x6f,
+ 0x09, 0x09, 0x09, 0x63, 0x70, 0x74, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x61, 0x63,
+ 0x77, 0x72, 0x69, 0x74, 0x65, 0x69, 0x69, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x61, 0x64, 0x73,
+ 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x6d, 0x61, 0x64, 0x73,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x6d, 0x61, 0x72, 0x63, 0x09, 0x09, 0x09, 0x09, 0x6d, 0x72, 0x63,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x6d, 0x61, 0x72, 0x63, 0x78, 0x6d, 0x6c, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x09, 0x09, 0x09, 0x09, 0x6d, 0x72, 0x63, 0x78, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x61, 0x74,
+ 0x68, 0x65, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x61, 0x09, 0x09, 0x09, 0x09,
+ 0x6d, 0x61, 0x20, 0x6e, 0x62, 0x20, 0x6d, 0x62, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d,
+ 0x61, 0x74, 0x68, 0x6d, 0x6c, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
+ 0x74, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x61, 0x74, 0x68,
+ 0x6d, 0x6c, 0x2d, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x61, 0x74, 0x68,
+ 0x6d, 0x6c, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x6d, 0x61,
+ 0x74, 0x68, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x62, 0x6d, 0x73, 0x2d,
+ 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x70,
+ 0x72, 0x6f, 0x63, 0x65, 0x64, 0x75, 0x72, 0x65, 0x2d, 0x64, 0x65, 0x73,
+ 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x6d, 0x62, 0x6d, 0x73, 0x2d, 0x64, 0x65, 0x72, 0x65,
+ 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x6d, 0x62, 0x6d, 0x73, 0x2d, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f,
+ 0x70, 0x65, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x62, 0x6d,
+ 0x73, 0x2d, 0x6d, 0x73, 0x6b, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x6d, 0x62, 0x6d, 0x73, 0x2d, 0x6d, 0x73, 0x6b, 0x2d, 0x72, 0x65, 0x73,
+ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x6d, 0x62, 0x6d, 0x73, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2d, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x62,
+ 0x6d, 0x73, 0x2d, 0x72, 0x65, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2d, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2b, 0x78, 0x6d, 0x6c, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x6d, 0x62, 0x6d, 0x73, 0x2d, 0x72, 0x65, 0x67, 0x69, 0x73,
+ 0x74, 0x65, 0x72, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x62,
+ 0x6d, 0x73, 0x2d, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x2d,
+ 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x6d, 0x62, 0x6d, 0x73, 0x2d, 0x75, 0x73, 0x65, 0x72,
+ 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2d, 0x64, 0x65, 0x73,
+ 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x6d, 0x62, 0x6f, 0x78, 0x09, 0x09, 0x09, 0x09, 0x6d, 0x62, 0x6f,
+ 0x78, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x5f, 0x63, 0x6f,
+ 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x65,
+ 0x64, 0x69, 0x61, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x63, 0x6f, 0x6e,
+ 0x74, 0x72, 0x6f, 0x6c, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x6d, 0x73,
+ 0x63, 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x69, 0x6e, 0x6b,
+ 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x6d, 0x65, 0x74, 0x61, 0x6c,
+ 0x69, 0x6e, 0x6b, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x69, 0x6e, 0x6b,
+ 0x34, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x6d, 0x65, 0x74, 0x61,
+ 0x34, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x6d, 0x65, 0x74, 0x73, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09,
+ 0x09, 0x09, 0x6d, 0x65, 0x74, 0x73, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x69, 0x6b,
+ 0x65, 0x79, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x6d, 0x6f, 0x64, 0x73, 0x2b, 0x78, 0x6d, 0x6c, 0x09,
+ 0x09, 0x09, 0x09, 0x6d, 0x6f, 0x64, 0x73, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x6f,
+ 0x73, 0x73, 0x2d, 0x6b, 0x65, 0x79, 0x73, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x6f,
+ 0x73, 0x73, 0x2d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x6d, 0x6f, 0x73, 0x73, 0x6b, 0x65, 0x79, 0x2d, 0x64,
+ 0x61, 0x74, 0x61, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x6f, 0x73, 0x73, 0x6b, 0x65,
+ 0x79, 0x2d, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x70,
+ 0x32, 0x31, 0x09, 0x09, 0x09, 0x09, 0x6d, 0x32, 0x31, 0x20, 0x6d, 0x70,
+ 0x32, 0x31, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x6d, 0x70, 0x34, 0x09, 0x09, 0x09, 0x09, 0x09, 0x6d,
+ 0x70, 0x34, 0x73, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x70, 0x65, 0x67, 0x34, 0x2d,
+ 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x70,
+ 0x65, 0x67, 0x34, 0x2d, 0x69, 0x6f, 0x64, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x70,
+ 0x65, 0x67, 0x34, 0x2d, 0x69, 0x6f, 0x64, 0x2d, 0x78, 0x6d, 0x74, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x6d, 0x73, 0x63, 0x2d, 0x69, 0x76, 0x72, 0x2b, 0x78, 0x6d,
+ 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x73, 0x63, 0x2d, 0x6d, 0x69, 0x78, 0x65,
+ 0x72, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x73, 0x77, 0x6f, 0x72, 0x64,
+ 0x09, 0x09, 0x09, 0x09, 0x64, 0x6f, 0x63, 0x20, 0x64, 0x6f, 0x74, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x6d, 0x78, 0x66, 0x09, 0x09, 0x09, 0x09, 0x09, 0x6d, 0x78, 0x66, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x6e, 0x61, 0x73, 0x64, 0x61, 0x74, 0x61, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x6e, 0x65, 0x77, 0x73, 0x2d, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x67, 0x72,
+ 0x6f, 0x75, 0x70, 0x73, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x77, 0x73, 0x2d,
+ 0x67, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x6e, 0x66, 0x6f, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x6e, 0x65, 0x77, 0x73, 0x2d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6d, 0x69,
+ 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6e, 0x73, 0x73, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x6f, 0x63, 0x73, 0x70, 0x2d, 0x72, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6f, 0x63, 0x73, 0x70, 0x2d, 0x72, 0x65,
+ 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6f, 0x63, 0x74, 0x65, 0x74,
+ 0x2d, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x09, 0x62, 0x69, 0x6e, 0x20,
+ 0x64, 0x6d, 0x73, 0x20, 0x6c, 0x72, 0x66, 0x20, 0x6d, 0x61, 0x72, 0x20,
+ 0x73, 0x6f, 0x20, 0x64, 0x69, 0x73, 0x74, 0x20, 0x64, 0x69, 0x73, 0x74,
+ 0x7a, 0x20, 0x70, 0x6b, 0x67, 0x20, 0x62, 0x70, 0x6b, 0x20, 0x64, 0x75,
+ 0x6d, 0x70, 0x20, 0x65, 0x6c, 0x63, 0x20, 0x64, 0x65, 0x70, 0x6c, 0x6f,
+ 0x79, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x6f, 0x64, 0x61, 0x09, 0x09, 0x09, 0x09, 0x09, 0x6f, 0x64,
+ 0x61, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x6f, 0x65, 0x62, 0x70, 0x73, 0x2d, 0x70, 0x61, 0x63, 0x6b,
+ 0x61, 0x67, 0x65, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x6f, 0x70,
+ 0x66, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x6f, 0x67, 0x67, 0x09, 0x09, 0x09, 0x09, 0x09, 0x6f, 0x67,
+ 0x78, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x6f, 0x6d, 0x64, 0x6f, 0x63, 0x2b, 0x78, 0x6d, 0x6c, 0x09,
+ 0x09, 0x09, 0x09, 0x6f, 0x6d, 0x64, 0x6f, 0x63, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6f, 0x6e, 0x65,
+ 0x6e, 0x6f, 0x74, 0x65, 0x09, 0x09, 0x09, 0x09, 0x6f, 0x6e, 0x65, 0x74,
+ 0x6f, 0x63, 0x20, 0x6f, 0x6e, 0x65, 0x74, 0x6f, 0x63, 0x32, 0x20, 0x6f,
+ 0x6e, 0x65, 0x74, 0x6d, 0x70, 0x20, 0x6f, 0x6e, 0x65, 0x70, 0x6b, 0x67,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x6f, 0x78, 0x70, 0x73, 0x09, 0x09, 0x09, 0x09, 0x6f, 0x78, 0x70,
+ 0x73, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x72, 0x69, 0x74, 0x79, 0x66, 0x65,
+ 0x63, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x2d, 0x6f, 0x70, 0x73, 0x2d,
+ 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09,
+ 0x78, 0x65, 0x72, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x64, 0x66, 0x09, 0x09, 0x09, 0x09, 0x09,
+ 0x70, 0x64, 0x66, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x67, 0x70, 0x2d, 0x65, 0x6e, 0x63, 0x72,
+ 0x79, 0x70, 0x74, 0x65, 0x64, 0x09, 0x09, 0x09, 0x70, 0x67, 0x70, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x70, 0x67, 0x70, 0x2d, 0x6b, 0x65, 0x79, 0x73, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70,
+ 0x67, 0x70, 0x2d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65,
+ 0x09, 0x09, 0x09, 0x61, 0x73, 0x63, 0x20, 0x73, 0x69, 0x67, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70,
+ 0x69, 0x63, 0x73, 0x2d, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x09, 0x09, 0x09,
+ 0x09, 0x70, 0x72, 0x66, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x69, 0x64, 0x66, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x69, 0x64, 0x66, 0x2d, 0x64,
+ 0x69, 0x66, 0x66, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x6b, 0x63, 0x73,
+ 0x31, 0x30, 0x09, 0x09, 0x09, 0x09, 0x70, 0x31, 0x30, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x6b,
+ 0x63, 0x73, 0x37, 0x2d, 0x6d, 0x69, 0x6d, 0x65, 0x09, 0x09, 0x09, 0x09,
+ 0x70, 0x37, 0x6d, 0x20, 0x70, 0x37, 0x63, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x6b, 0x63, 0x73,
+ 0x37, 0x2d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x09,
+ 0x09, 0x09, 0x70, 0x37, 0x73, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x6b, 0x63, 0x73, 0x38, 0x09,
+ 0x09, 0x09, 0x09, 0x70, 0x38, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x6b, 0x69, 0x78, 0x2d, 0x61,
+ 0x74, 0x74, 0x72, 0x2d, 0x63, 0x65, 0x72, 0x74, 0x09, 0x09, 0x09, 0x61,
+ 0x63, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x70, 0x6b, 0x69, 0x78, 0x2d, 0x63, 0x65, 0x72, 0x74, 0x09,
+ 0x09, 0x09, 0x09, 0x63, 0x65, 0x72, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x6b, 0x69, 0x78, 0x2d,
+ 0x63, 0x72, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x63, 0x72, 0x6c, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70,
+ 0x6b, 0x69, 0x78, 0x2d, 0x70, 0x6b, 0x69, 0x70, 0x61, 0x74, 0x68, 0x09,
+ 0x09, 0x09, 0x70, 0x6b, 0x69, 0x70, 0x61, 0x74, 0x68, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x6b,
+ 0x69, 0x78, 0x63, 0x6d, 0x70, 0x09, 0x09, 0x09, 0x09, 0x70, 0x6b, 0x69,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x70, 0x6c, 0x73, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09,
+ 0x70, 0x6c, 0x73, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x6f, 0x63, 0x2d, 0x73, 0x65,
+ 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70,
+ 0x6f, 0x73, 0x74, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x09, 0x09, 0x09,
+ 0x09, 0x61, 0x69, 0x20, 0x65, 0x70, 0x73, 0x20, 0x70, 0x73, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x70, 0x72, 0x73, 0x2e, 0x61, 0x6c, 0x76, 0x65, 0x73, 0x74, 0x72,
+ 0x61, 0x6e, 0x64, 0x2e, 0x74, 0x69, 0x74, 0x72, 0x61, 0x78, 0x2d, 0x73,
+ 0x68, 0x65, 0x65, 0x74, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x73, 0x2e, 0x63, 0x77, 0x77,
+ 0x09, 0x09, 0x09, 0x09, 0x63, 0x77, 0x77, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x72,
+ 0x73, 0x2e, 0x6e, 0x70, 0x72, 0x65, 0x6e, 0x64, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70,
+ 0x72, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x63, 0x6b, 0x65, 0x72, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x70, 0x72, 0x73, 0x2e, 0x72, 0x64, 0x66, 0x2d, 0x78, 0x6d, 0x6c,
+ 0x2d, 0x63, 0x72, 0x79, 0x70, 0x74, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x73,
+ 0x2e, 0x78, 0x73, 0x66, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x73, 0x6b,
+ 0x63, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x70, 0x73, 0x6b,
+ 0x63, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x71, 0x73, 0x69, 0x67, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x72, 0x64, 0x66, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x72,
+ 0x64, 0x66, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x6e, 0x66, 0x6f, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x72, 0x69, 0x66, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x72, 0x65,
+ 0x6c, 0x61, 0x78, 0x2d, 0x6e, 0x67, 0x2d, 0x63, 0x6f, 0x6d, 0x70, 0x61,
+ 0x63, 0x74, 0x2d, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x09, 0x09, 0x72,
+ 0x6e, 0x63, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2d,
+ 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x72, 0x65, 0x73,
+ 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2d, 0x6c, 0x69, 0x73, 0x74, 0x73, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x72, 0x6c, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x72, 0x65, 0x73,
+ 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2d, 0x6c, 0x69, 0x73, 0x74, 0x73, 0x2d,
+ 0x64, 0x69, 0x66, 0x66, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x72, 0x6c,
+ 0x64, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x72, 0x69, 0x73, 0x63, 0x6f, 0x73, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x72, 0x6c, 0x6d, 0x69, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x72, 0x6c,
+ 0x73, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x72, 0x73, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x72, 0x70, 0x6b, 0x69,
+ 0x2d, 0x67, 0x68, 0x6f, 0x73, 0x74, 0x62, 0x75, 0x73, 0x74, 0x65, 0x72,
+ 0x73, 0x09, 0x09, 0x09, 0x67, 0x62, 0x72, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x72, 0x70, 0x6b, 0x69,
+ 0x2d, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x09, 0x09, 0x09,
+ 0x6d, 0x66, 0x74, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x72, 0x70, 0x6b, 0x69, 0x2d, 0x72, 0x6f, 0x61,
+ 0x09, 0x09, 0x09, 0x09, 0x72, 0x6f, 0x61, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x72, 0x70,
+ 0x6b, 0x69, 0x2d, 0x75, 0x70, 0x64, 0x6f, 0x77, 0x6e, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x72, 0x73,
+ 0x64, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x72, 0x73, 0x64,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x72, 0x73, 0x73, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09,
+ 0x72, 0x73, 0x73, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x72, 0x74, 0x66, 0x09, 0x09, 0x09, 0x09, 0x09,
+ 0x72, 0x74, 0x66, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x72, 0x74, 0x78, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x73, 0x61, 0x6d, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x61, 0x6d, 0x6c,
+ 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x73, 0x62, 0x6d, 0x6c, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09,
+ 0x09, 0x73, 0x62, 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x63, 0x76, 0x70, 0x2d, 0x63,
+ 0x76, 0x2d, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x09, 0x09, 0x09,
+ 0x73, 0x63, 0x71, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x63, 0x76, 0x70, 0x2d, 0x63, 0x76, 0x2d,
+ 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x09, 0x09, 0x09, 0x73,
+ 0x63, 0x73, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x73, 0x63, 0x76, 0x70, 0x2d, 0x76, 0x70, 0x2d, 0x72,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x09, 0x09, 0x09, 0x73, 0x70, 0x71,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x73, 0x63, 0x76, 0x70, 0x2d, 0x76, 0x70, 0x2d, 0x72, 0x65, 0x73,
+ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x09, 0x09, 0x09, 0x73, 0x70, 0x70, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x73, 0x64, 0x70, 0x09, 0x09, 0x09, 0x09, 0x09, 0x73, 0x64, 0x70, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x73, 0x65, 0x74, 0x2d, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e,
+ 0x74, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x73, 0x65, 0x74, 0x2d, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e,
+ 0x74, 0x2d, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x09, 0x09, 0x73, 0x65, 0x74, 0x70, 0x61, 0x79, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x73,
+ 0x65, 0x74, 0x2d, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x65, 0x74, 0x2d, 0x72, 0x65, 0x67, 0x69,
+ 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2d, 0x69, 0x6e, 0x69,
+ 0x74, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x09, 0x09, 0x73, 0x65, 0x74,
+ 0x72, 0x65, 0x67, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x67, 0x6d, 0x6c, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x73, 0x67, 0x6d, 0x6c, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x2d, 0x63,
+ 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x68, 0x66, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x73, 0x68, 0x66, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x73, 0x69, 0x65, 0x76, 0x65, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x69, 0x6d, 0x70,
+ 0x6c, 0x65, 0x2d, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2b, 0x78, 0x6d,
+ 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x2d, 0x6d,
+ 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2d, 0x73, 0x75, 0x6d, 0x6d, 0x61,
+ 0x72, 0x79, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x73,
+ 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e,
+ 0x65, 0x72, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x6c, 0x61, 0x74, 0x65, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x73, 0x6d, 0x69, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x6d, 0x69, 0x6c, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x73, 0x6d, 0x69, 0x20, 0x73, 0x6d,
+ 0x69, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x6f, 0x61, 0x70, 0x2b, 0x66, 0x61,
+ 0x73, 0x74, 0x69, 0x6e, 0x66, 0x6f, 0x73, 0x65, 0x74, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x73, 0x6f, 0x61, 0x70, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x70, 0x61,
+ 0x72, 0x71, 0x6c, 0x2d, 0x71, 0x75, 0x65, 0x72, 0x79, 0x09, 0x09, 0x09,
+ 0x72, 0x71, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x73, 0x70, 0x61, 0x72, 0x71, 0x6c, 0x2d, 0x72, 0x65,
+ 0x73, 0x75, 0x6c, 0x74, 0x73, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09,
+ 0x73, 0x72, 0x78, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x70, 0x69, 0x72, 0x69, 0x74,
+ 0x73, 0x2d, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2b, 0x78, 0x6d, 0x6c, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x73, 0x72, 0x67, 0x73, 0x09, 0x09, 0x09, 0x09, 0x67, 0x72, 0x61, 0x6d,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x73, 0x72, 0x67, 0x73, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09,
+ 0x09, 0x67, 0x72, 0x78, 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x72, 0x75, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x73, 0x72, 0x75, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x73,
+ 0x64, 0x6c, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x73, 0x73,
+ 0x64, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x73, 0x73, 0x6d, 0x6c, 0x2b, 0x78, 0x6d, 0x6c, 0x09,
+ 0x09, 0x09, 0x09, 0x73, 0x73, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x74, 0x61,
+ 0x6d, 0x70, 0x2d, 0x61, 0x70, 0x65, 0x78, 0x2d, 0x75, 0x70, 0x64, 0x61,
+ 0x74, 0x65, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x74, 0x61, 0x6d, 0x70, 0x2d, 0x61, 0x70,
+ 0x65, 0x78, 0x2d, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2d, 0x63, 0x6f,
+ 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x74, 0x61, 0x6d, 0x70,
+ 0x2d, 0x63, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x2d, 0x75,
+ 0x70, 0x64, 0x61, 0x74, 0x65, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x74, 0x61, 0x6d, 0x70,
+ 0x2d, 0x63, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x2d, 0x75,
+ 0x70, 0x64, 0x61, 0x74, 0x65, 0x2d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72,
+ 0x6d, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x74, 0x61, 0x6d, 0x70, 0x2d, 0x65, 0x72, 0x72,
+ 0x6f, 0x72, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x74, 0x61, 0x6d, 0x70, 0x2d, 0x73, 0x65,
+ 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x2d, 0x61, 0x64, 0x6a, 0x75, 0x73,
+ 0x74, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x74, 0x61, 0x6d, 0x70, 0x2d, 0x73, 0x65, 0x71,
+ 0x75, 0x65, 0x6e, 0x63, 0x65, 0x2d, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74,
+ 0x2d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x74,
+ 0x61, 0x6d, 0x70, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2d, 0x71,
+ 0x75, 0x65, 0x72, 0x79, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x74, 0x61, 0x6d, 0x70, 0x2d,
+ 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2d, 0x72, 0x65, 0x73, 0x70, 0x6f,
+ 0x6e, 0x73, 0x65, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x74, 0x61, 0x6d, 0x70, 0x2d, 0x75,
+ 0x70, 0x64, 0x61, 0x74, 0x65, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x74, 0x61, 0x6d, 0x70,
+ 0x2d, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2d, 0x63, 0x6f, 0x6e, 0x66,
+ 0x69, 0x72, 0x6d, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x69, 0x2b, 0x78, 0x6d, 0x6c, 0x09,
+ 0x09, 0x09, 0x09, 0x74, 0x65, 0x69, 0x20, 0x74, 0x65, 0x69, 0x63, 0x6f,
+ 0x72, 0x70, 0x75, 0x73, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x74, 0x68, 0x72, 0x61, 0x75, 0x64, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x74, 0x66, 0x69, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2d, 0x71,
+ 0x75, 0x65, 0x72, 0x79, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73,
+ 0x74, 0x61, 0x6d, 0x70, 0x2d, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x74,
+ 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x65, 0x64, 0x2d, 0x64,
+ 0x61, 0x74, 0x61, 0x09, 0x09, 0x09, 0x74, 0x73, 0x64, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x74, 0x76, 0x65, 0x2d, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x75, 0x6c, 0x70, 0x66, 0x65, 0x63, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x63, 0x61, 0x72, 0x64, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x65, 0x6d, 0x6d, 0x69, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x69, 0x76, 0x69, 0x64,
+ 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x66,
+ 0x69, 0x6c, 0x65, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x33, 0x67,
+ 0x70, 0x70, 0x2e, 0x62, 0x73, 0x66, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x33, 0x67, 0x70, 0x70, 0x2e, 0x70, 0x69, 0x63, 0x2d,
+ 0x62, 0x77, 0x2d, 0x6c, 0x61, 0x72, 0x67, 0x65, 0x09, 0x09, 0x70, 0x6c,
+ 0x62, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x33, 0x67, 0x70, 0x70, 0x2e, 0x70,
+ 0x69, 0x63, 0x2d, 0x62, 0x77, 0x2d, 0x73, 0x6d, 0x61, 0x6c, 0x6c, 0x09,
+ 0x09, 0x70, 0x73, 0x62, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x33, 0x67, 0x70,
+ 0x70, 0x2e, 0x70, 0x69, 0x63, 0x2d, 0x62, 0x77, 0x2d, 0x76, 0x61, 0x72,
+ 0x09, 0x09, 0x09, 0x70, 0x76, 0x62, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x33, 0x67, 0x70, 0x70, 0x2e, 0x73, 0x6d, 0x73, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x33, 0x67, 0x70, 0x70, 0x32, 0x2e, 0x62, 0x63,
+ 0x6d, 0x63, 0x73, 0x69, 0x6e, 0x66, 0x6f, 0x2b, 0x78, 0x6d, 0x6c, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x33, 0x67, 0x70, 0x70, 0x32, 0x2e,
+ 0x73, 0x6d, 0x73, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x33, 0x67, 0x70, 0x70,
+ 0x32, 0x2e, 0x74, 0x63, 0x61, 0x70, 0x09, 0x09, 0x09, 0x74, 0x63, 0x61,
+ 0x70, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x33, 0x6d, 0x2e, 0x70, 0x6f, 0x73,
+ 0x74, 0x2d, 0x69, 0x74, 0x2d, 0x6e, 0x6f, 0x74, 0x65, 0x73, 0x09, 0x09,
+ 0x70, 0x77, 0x6e, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x61, 0x63, 0x63, 0x70,
+ 0x61, 0x63, 0x2e, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x79, 0x2e, 0x61, 0x73,
+ 0x6f, 0x09, 0x09, 0x61, 0x73, 0x6f, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x61,
+ 0x63, 0x63, 0x70, 0x61, 0x63, 0x2e, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x79,
+ 0x2e, 0x69, 0x6d, 0x70, 0x09, 0x09, 0x69, 0x6d, 0x70, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x61, 0x63, 0x75, 0x63, 0x6f, 0x62, 0x6f, 0x6c, 0x09, 0x09,
+ 0x09, 0x61, 0x63, 0x75, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x61, 0x63, 0x75,
+ 0x63, 0x6f, 0x72, 0x70, 0x09, 0x09, 0x09, 0x09, 0x61, 0x74, 0x63, 0x20,
+ 0x61, 0x63, 0x75, 0x74, 0x63, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x61, 0x64,
+ 0x6f, 0x62, 0x65, 0x2e, 0x61, 0x69, 0x72, 0x2d, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2d, 0x69, 0x6e, 0x73, 0x74,
+ 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x2d, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67,
+ 0x65, 0x2b, 0x7a, 0x69, 0x70, 0x09, 0x61, 0x69, 0x72, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x2e, 0x66, 0x6f, 0x72, 0x6d,
+ 0x73, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x2e, 0x66, 0x63, 0x64,
+ 0x74, 0x09, 0x09, 0x66, 0x63, 0x64, 0x74, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x61, 0x64, 0x6f, 0x62, 0x65, 0x2e, 0x66, 0x78, 0x70, 0x09, 0x09, 0x09,
+ 0x66, 0x78, 0x70, 0x20, 0x66, 0x78, 0x70, 0x6c, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x2e, 0x70, 0x61, 0x72,
+ 0x74, 0x69, 0x61, 0x6c, 0x2d, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x2e, 0x78, 0x64,
+ 0x70, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x78, 0x64, 0x70, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x2e, 0x78, 0x66,
+ 0x64, 0x66, 0x09, 0x09, 0x09, 0x78, 0x66, 0x64, 0x66, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x61, 0x65, 0x74, 0x68, 0x65, 0x72, 0x2e, 0x69,
+ 0x6d, 0x70, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x61, 0x68, 0x2d,
+ 0x62, 0x61, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x61, 0x68, 0x65, 0x61, 0x64, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x09,
+ 0x09, 0x09, 0x61, 0x68, 0x65, 0x61, 0x64, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x61, 0x69, 0x72, 0x7a, 0x69, 0x70, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73,
+ 0x65, 0x63, 0x75, 0x72, 0x65, 0x2e, 0x61, 0x7a, 0x66, 0x09, 0x09, 0x61,
+ 0x7a, 0x66, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x61, 0x69, 0x72, 0x7a, 0x69,
+ 0x70, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65,
+ 0x2e, 0x61, 0x7a, 0x73, 0x09, 0x09, 0x61, 0x7a, 0x73, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x61, 0x6d, 0x61, 0x7a, 0x6f, 0x6e, 0x2e, 0x65, 0x62, 0x6f,
+ 0x6f, 0x6b, 0x09, 0x09, 0x09, 0x61, 0x7a, 0x77, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x61, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x6e, 0x64, 0x79, 0x6e,
+ 0x61, 0x6d, 0x69, 0x63, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x09, 0x09, 0x61,
+ 0x63, 0x63, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x61, 0x6d, 0x69, 0x67, 0x61,
+ 0x2e, 0x61, 0x6d, 0x69, 0x09, 0x09, 0x09, 0x61, 0x6d, 0x69, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x61, 0x6d, 0x75, 0x6e, 0x64, 0x73, 0x65,
+ 0x6e, 0x2e, 0x6d, 0x61, 0x7a, 0x65, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x61, 0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x2e, 0x70,
+ 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x2d, 0x61, 0x72, 0x63, 0x68, 0x69,
+ 0x76, 0x65, 0x09, 0x09, 0x61, 0x70, 0x6b, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x61, 0x6e, 0x73, 0x65, 0x72, 0x2d, 0x77, 0x65, 0x62, 0x2d, 0x63, 0x65,
+ 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2d, 0x69, 0x73,
+ 0x73, 0x75, 0x65, 0x2d, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x09, 0x63, 0x69, 0x69, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x61,
+ 0x6e, 0x73, 0x65, 0x72, 0x2d, 0x77, 0x65, 0x62, 0x2d, 0x66, 0x75, 0x6e,
+ 0x64, 0x73, 0x2d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2d,
+ 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x09, 0x66,
+ 0x74, 0x69, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x61, 0x6e, 0x74, 0x69, 0x78,
+ 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x2d, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e,
+ 0x65, 0x6e, 0x74, 0x09, 0x09, 0x61, 0x74, 0x78, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x69, 0x6e, 0x73, 0x74, 0x61,
+ 0x6c, 0x6c, 0x65, 0x72, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x6d, 0x70,
+ 0x6b, 0x67, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65,
+ 0x2e, 0x6d, 0x70, 0x65, 0x67, 0x75, 0x72, 0x6c, 0x09, 0x09, 0x09, 0x6d,
+ 0x33, 0x75, 0x38, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x61, 0x72,
+ 0x61, 0x73, 0x74, 0x72, 0x61, 0x2e, 0x73, 0x77, 0x69, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x61, 0x72, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x65, 0x74, 0x77,
+ 0x6f, 0x72, 0x6b, 0x73, 0x2e, 0x73, 0x77, 0x69, 0x09, 0x09, 0x73, 0x77,
+ 0x69, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x61, 0x73, 0x74, 0x72, 0x61, 0x65,
+ 0x61, 0x2d, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x69,
+ 0x6f, 0x74, 0x61, 0x09, 0x09, 0x69, 0x6f, 0x74, 0x61, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x67, 0x72, 0x61, 0x70, 0x68,
+ 0x09, 0x09, 0x09, 0x61, 0x65, 0x70, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x61, 0x76, 0x69, 0x73, 0x74,
+ 0x61, 0x72, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x62,
+ 0x6c, 0x75, 0x65, 0x69, 0x63, 0x65, 0x2e, 0x6d, 0x75, 0x6c, 0x74, 0x69,
+ 0x70, 0x61, 0x73, 0x73, 0x09, 0x09, 0x6d, 0x70, 0x6d, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x62, 0x6c, 0x75, 0x65, 0x74, 0x6f, 0x6f, 0x74,
+ 0x68, 0x2e, 0x65, 0x70, 0x2e, 0x6f, 0x6f, 0x62, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x62, 0x6d, 0x69, 0x09, 0x09, 0x09, 0x09, 0x62, 0x6d, 0x69, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73,
+ 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x09, 0x09, 0x09, 0x72, 0x65,
+ 0x70, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x63, 0x61, 0x62, 0x2d,
+ 0x6a, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x2d, 0x63, 0x70, 0x64, 0x6c,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x63, 0x61, 0x6e, 0x6f, 0x6e,
+ 0x2d, 0x6c, 0x69, 0x70, 0x73, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x63, 0x65, 0x6e, 0x64, 0x69, 0x6f, 0x2e, 0x74, 0x68, 0x69, 0x6e, 0x6c,
+ 0x69, 0x6e, 0x63, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x63, 0x6f,
+ 0x6e, 0x66, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x63, 0x68, 0x65, 0x6d, 0x64,
+ 0x72, 0x61, 0x77, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x63, 0x64,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x63, 0x68, 0x69, 0x70,
+ 0x6e, 0x75, 0x74, 0x73, 0x2e, 0x6b, 0x61, 0x72, 0x61, 0x6f, 0x6b, 0x65,
+ 0x2d, 0x6d, 0x6d, 0x64, 0x09, 0x09, 0x6d, 0x6d, 0x64, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x63, 0x69, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x6c, 0x6c, 0x61,
+ 0x09, 0x09, 0x09, 0x63, 0x64, 0x79, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x63, 0x69, 0x72, 0x70, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x73, 0x64,
+ 0x6e, 0x2d, 0x65, 0x78, 0x74, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x63, 0x6c,
+ 0x61, 0x79, 0x6d, 0x6f, 0x72, 0x65, 0x09, 0x09, 0x09, 0x63, 0x6c, 0x61,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x63, 0x6c, 0x6f, 0x61, 0x6e, 0x74, 0x6f,
+ 0x2e, 0x72, 0x70, 0x39, 0x09, 0x09, 0x09, 0x72, 0x70, 0x39, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x63, 0x6c, 0x6f, 0x6e, 0x6b, 0x2e, 0x63, 0x34, 0x67,
+ 0x72, 0x6f, 0x75, 0x70, 0x09, 0x09, 0x09, 0x63, 0x34, 0x67, 0x20, 0x63,
+ 0x34, 0x64, 0x20, 0x63, 0x34, 0x66, 0x20, 0x63, 0x34, 0x70, 0x20, 0x63,
+ 0x34, 0x75, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x63, 0x6c, 0x75, 0x65, 0x74,
+ 0x72, 0x75, 0x73, 0x74, 0x2e, 0x63, 0x61, 0x72, 0x74, 0x6f, 0x6d, 0x6f,
+ 0x62, 0x69, 0x6c, 0x65, 0x2d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x09,
+ 0x09, 0x63, 0x31, 0x31, 0x61, 0x6d, 0x63, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x63, 0x6c, 0x75, 0x65, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x63, 0x61,
+ 0x72, 0x74, 0x6f, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x2d, 0x63, 0x6f,
+ 0x6e, 0x66, 0x69, 0x67, 0x2d, 0x70, 0x6b, 0x67, 0x09, 0x63, 0x31, 0x31,
+ 0x61, 0x6d, 0x7a, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x63, 0x6f,
+ 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2b, 0x6a, 0x73, 0x6f,
+ 0x6e, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
+ 0x65, 0x72, 0x63, 0x65, 0x2d, 0x62, 0x61, 0x74, 0x74, 0x65, 0x6c, 0x6c,
+ 0x65, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
+ 0x73, 0x70, 0x61, 0x63, 0x65, 0x09, 0x09, 0x09, 0x63, 0x73, 0x70, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x2e,
+ 0x63, 0x6d, 0x73, 0x67, 0x09, 0x09, 0x09, 0x63, 0x64, 0x62, 0x63, 0x6d,
+ 0x73, 0x67, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f,
+ 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x09, 0x09, 0x09, 0x63, 0x6d, 0x63,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x63, 0x72, 0x69, 0x63, 0x6b, 0x2e, 0x63,
+ 0x6c, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x09, 0x09, 0x09, 0x63, 0x6c, 0x6b,
+ 0x78, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x63, 0x72, 0x69, 0x63, 0x6b, 0x2e,
+ 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x6b, 0x65, 0x79, 0x62,
+ 0x6f, 0x61, 0x72, 0x64, 0x09, 0x09, 0x63, 0x6c, 0x6b, 0x6b, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x63, 0x72, 0x69, 0x63, 0x6b, 0x2e, 0x63, 0x6c, 0x69,
+ 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x70, 0x61, 0x6c, 0x65, 0x74, 0x74, 0x65,
+ 0x09, 0x09, 0x63, 0x6c, 0x6b, 0x70, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x63,
+ 0x72, 0x69, 0x63, 0x6b, 0x2e, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x65, 0x72,
+ 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x09, 0x09, 0x63,
+ 0x6c, 0x6b, 0x74, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x63, 0x72, 0x69, 0x63,
+ 0x6b, 0x2e, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x77, 0x6f,
+ 0x72, 0x64, 0x62, 0x61, 0x6e, 0x6b, 0x09, 0x09, 0x63, 0x6c, 0x6b, 0x77,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x63, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61,
+ 0x6c, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x2e, 0x77, 0x62, 0x73, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x09, 0x09, 0x77, 0x62, 0x73, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x63, 0x74, 0x63, 0x2d, 0x70, 0x6f, 0x73, 0x6d, 0x6c, 0x09, 0x09, 0x09,
+ 0x70, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x63, 0x74,
+ 0x63, 0x74, 0x2e, 0x77, 0x73, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x63, 0x75, 0x70, 0x73, 0x2d, 0x70, 0x64, 0x66,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x63, 0x75, 0x70, 0x73, 0x2d,
+ 0x70, 0x6f, 0x73, 0x74, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x63, 0x75, 0x70, 0x73, 0x2d, 0x70, 0x70, 0x64, 0x09,
+ 0x09, 0x09, 0x70, 0x70, 0x64, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x63, 0x75, 0x70, 0x73, 0x2d, 0x72, 0x61, 0x73, 0x74, 0x65, 0x72, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x63, 0x75, 0x70, 0x73, 0x2d, 0x72,
+ 0x61, 0x77, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x63, 0x75, 0x72,
+ 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x63, 0x75, 0x72, 0x6c, 0x2e, 0x63,
+ 0x61, 0x72, 0x09, 0x09, 0x09, 0x63, 0x61, 0x72, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x63, 0x75, 0x72, 0x6c, 0x2e, 0x70, 0x63, 0x75, 0x72, 0x6c, 0x09,
+ 0x09, 0x09, 0x70, 0x63, 0x75, 0x72, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x63, 0x79, 0x62, 0x61, 0x6e, 0x6b, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x64, 0x61, 0x72, 0x74, 0x09, 0x09, 0x09, 0x09, 0x64, 0x61, 0x72,
+ 0x74, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2d, 0x76,
+ 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x72, 0x64, 0x7a, 0x09, 0x09, 0x09,
+ 0x72, 0x64, 0x7a, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x65, 0x63, 0x65,
+ 0x2e, 0x64, 0x61, 0x74, 0x61, 0x09, 0x09, 0x09, 0x75, 0x76, 0x66, 0x20,
+ 0x75, 0x76, 0x76, 0x66, 0x20, 0x75, 0x76, 0x64, 0x20, 0x75, 0x76, 0x76,
+ 0x64, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x65, 0x63, 0x65, 0x2e, 0x74,
+ 0x74, 0x6d, 0x6c, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x75, 0x76,
+ 0x74, 0x20, 0x75, 0x76, 0x76, 0x74, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64,
+ 0x65, 0x63, 0x65, 0x2e, 0x75, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66,
+ 0x69, 0x65, 0x64, 0x09, 0x09, 0x75, 0x76, 0x78, 0x20, 0x75, 0x76, 0x76,
+ 0x78, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x65, 0x63, 0x65, 0x2e, 0x7a,
+ 0x69, 0x70, 0x09, 0x09, 0x09, 0x75, 0x76, 0x7a, 0x20, 0x75, 0x76, 0x76,
+ 0x7a, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x65, 0x6e, 0x6f, 0x76, 0x6f,
+ 0x2e, 0x66, 0x63, 0x73, 0x65, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x2d,
+ 0x6c, 0x69, 0x6e, 0x6b, 0x09, 0x09, 0x66, 0x65, 0x5f, 0x6c, 0x61, 0x75,
+ 0x6e, 0x63, 0x68, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x69,
+ 0x72, 0x2d, 0x62, 0x69, 0x2e, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2d, 0x64,
+ 0x6c, 0x2d, 0x6e, 0x6f, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x64, 0x6e, 0x61, 0x09, 0x09, 0x09, 0x09, 0x64, 0x6e,
+ 0x61, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x6f, 0x6c, 0x62, 0x79, 0x2e,
+ 0x6d, 0x6c, 0x70, 0x09, 0x09, 0x09, 0x6d, 0x6c, 0x70, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x6f, 0x6c, 0x62, 0x79, 0x2e, 0x6d, 0x6f,
+ 0x62, 0x69, 0x6c, 0x65, 0x2e, 0x31, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x64, 0x6f, 0x6c, 0x62, 0x79, 0x2e, 0x6d, 0x6f, 0x62, 0x69, 0x6c,
+ 0x65, 0x2e, 0x32, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x70, 0x67, 0x72,
+ 0x61, 0x70, 0x68, 0x09, 0x09, 0x09, 0x09, 0x64, 0x70, 0x67, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x64, 0x72, 0x65, 0x61, 0x6d, 0x66, 0x61, 0x63, 0x74,
+ 0x6f, 0x72, 0x79, 0x09, 0x09, 0x09, 0x64, 0x66, 0x61, 0x63, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x64, 0x73, 0x2d, 0x6b, 0x65, 0x79, 0x70, 0x6f, 0x69,
+ 0x6e, 0x74, 0x09, 0x09, 0x09, 0x6b, 0x70, 0x78, 0x78, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x64, 0x76, 0x62, 0x2e, 0x61, 0x69, 0x74, 0x09, 0x09, 0x09,
+ 0x09, 0x61, 0x69, 0x74, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64,
+ 0x76, 0x62, 0x2e, 0x64, 0x76, 0x62, 0x6a, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x64, 0x76, 0x62, 0x2e, 0x65, 0x73, 0x67, 0x63, 0x6f, 0x6e,
+ 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x64, 0x76, 0x62, 0x2e, 0x69, 0x70, 0x64, 0x63, 0x64, 0x66, 0x74,
+ 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x76, 0x62, 0x2e, 0x69, 0x70,
+ 0x64, 0x63, 0x65, 0x73, 0x67, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x76, 0x62, 0x2e, 0x69, 0x70,
+ 0x64, 0x63, 0x65, 0x73, 0x67, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x32,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x76, 0x62, 0x2e, 0x69,
+ 0x70, 0x64, 0x63, 0x65, 0x73, 0x67, 0x70, 0x64, 0x64, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x76, 0x62, 0x2e, 0x69, 0x70, 0x64, 0x63,
+ 0x72, 0x6f, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x64, 0x76, 0x62, 0x2e, 0x69, 0x70, 0x74, 0x76, 0x2e, 0x61,
+ 0x6c, 0x66, 0x65, 0x63, 0x2d, 0x62, 0x61, 0x73, 0x65, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x76, 0x62, 0x2e, 0x69, 0x70, 0x74, 0x76,
+ 0x2e, 0x61, 0x6c, 0x66, 0x65, 0x63, 0x2d, 0x65, 0x6e, 0x68, 0x61, 0x6e,
+ 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x64, 0x76, 0x62, 0x2e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x2d, 0x61,
+ 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x2d, 0x72, 0x6f, 0x6f,
+ 0x74, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x64, 0x76, 0x62, 0x2e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x2d, 0x63, 0x6f,
+ 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2b, 0x78, 0x6d, 0x6c, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x76, 0x62, 0x2e, 0x6e, 0x6f,
+ 0x74, 0x69, 0x66, 0x2d, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x76,
+ 0x62, 0x2e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x2d, 0x69, 0x61, 0x2d, 0x6d,
+ 0x73, 0x67, 0x6c, 0x69, 0x73, 0x74, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x76, 0x62, 0x2e, 0x6e, 0x6f, 0x74,
+ 0x69, 0x66, 0x2d, 0x69, 0x61, 0x2d, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74,
+ 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2d, 0x72, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x64, 0x76, 0x62, 0x2e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x2d, 0x69,
+ 0x61, 0x2d, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x76,
+ 0x62, 0x2e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x2d, 0x69, 0x6e, 0x69, 0x74,
+ 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64,
+ 0x76, 0x62, 0x2e, 0x70, 0x66, 0x72, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64,
+ 0x76, 0x62, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x09, 0x09,
+ 0x09, 0x73, 0x76, 0x63, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64,
+ 0x78, 0x72, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x79, 0x6e, 0x61, 0x67,
+ 0x65, 0x6f, 0x09, 0x09, 0x09, 0x09, 0x67, 0x65, 0x6f, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x65, 0x61, 0x73, 0x79, 0x6b, 0x61, 0x72, 0x61,
+ 0x6f, 0x6b, 0x65, 0x2e, 0x63, 0x64, 0x67, 0x64, 0x6f, 0x77, 0x6e, 0x6c,
+ 0x6f, 0x61, 0x64, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x65, 0x63,
+ 0x64, 0x69, 0x73, 0x2d, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x65, 0x63, 0x6f, 0x77, 0x69, 0x6e, 0x2e, 0x63, 0x68,
+ 0x61, 0x72, 0x74, 0x09, 0x09, 0x09, 0x6d, 0x61, 0x67, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x65, 0x63, 0x6f, 0x77, 0x69, 0x6e, 0x2e, 0x66,
+ 0x69, 0x6c, 0x65, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x65, 0x63, 0x6f, 0x77, 0x69, 0x6e, 0x2e,
+ 0x66, 0x69, 0x6c, 0x65, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x65, 0x63, 0x6f, 0x77, 0x69, 0x6e, 0x2e,
+ 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x65, 0x63, 0x6f, 0x77, 0x69, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x69,
+ 0x65, 0x73, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x65, 0x63, 0x6f, 0x77, 0x69, 0x6e, 0x2e, 0x73,
+ 0x65, 0x72, 0x69, 0x65, 0x73, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x65, 0x6d, 0x63, 0x6c, 0x69, 0x65,
+ 0x6e, 0x74, 0x2e, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x72, 0x65, 0x71,
+ 0x75, 0x65, 0x73, 0x74, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x65, 0x6e, 0x6c, 0x69, 0x76, 0x65, 0x6e, 0x09, 0x09, 0x09, 0x09,
+ 0x6e, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x65, 0x70,
+ 0x72, 0x69, 0x6e, 0x74, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x65, 0x70, 0x73, 0x6f, 0x6e,
+ 0x2e, 0x65, 0x73, 0x66, 0x09, 0x09, 0x09, 0x65, 0x73, 0x66, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x65, 0x70, 0x73, 0x6f, 0x6e, 0x2e, 0x6d, 0x73, 0x66,
+ 0x09, 0x09, 0x09, 0x6d, 0x73, 0x66, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x65,
+ 0x70, 0x73, 0x6f, 0x6e, 0x2e, 0x71, 0x75, 0x69, 0x63, 0x6b, 0x61, 0x6e,
+ 0x69, 0x6d, 0x65, 0x09, 0x09, 0x71, 0x61, 0x6d, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x65, 0x70, 0x73, 0x6f, 0x6e, 0x2e, 0x73, 0x61, 0x6c, 0x74, 0x09,
+ 0x09, 0x09, 0x73, 0x6c, 0x74, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x65, 0x70,
+ 0x73, 0x6f, 0x6e, 0x2e, 0x73, 0x73, 0x66, 0x09, 0x09, 0x09, 0x73, 0x73,
+ 0x66, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x65, 0x72, 0x69, 0x63,
+ 0x73, 0x73, 0x6f, 0x6e, 0x2e, 0x71, 0x75, 0x69, 0x63, 0x6b, 0x63, 0x61,
+ 0x6c, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x65, 0x73, 0x7a, 0x69, 0x67,
+ 0x6e, 0x6f, 0x33, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x65, 0x73,
+ 0x33, 0x20, 0x65, 0x74, 0x33, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x65, 0x74, 0x73, 0x69, 0x2e, 0x61, 0x6f, 0x63, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x65, 0x74, 0x73, 0x69, 0x2e,
+ 0x63, 0x75, 0x67, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x65, 0x74, 0x73, 0x69, 0x2e, 0x69, 0x70, 0x74, 0x76, 0x63,
+ 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x65, 0x74, 0x73, 0x69, 0x2e, 0x69, 0x70,
+ 0x74, 0x76, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x65, 0x74,
+ 0x73, 0x69, 0x2e, 0x69, 0x70, 0x74, 0x76, 0x70, 0x72, 0x6f, 0x66, 0x69,
+ 0x6c, 0x65, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x65, 0x74, 0x73, 0x69, 0x2e, 0x69, 0x70, 0x74, 0x76, 0x73, 0x61,
+ 0x64, 0x2d, 0x62, 0x63, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x65, 0x74, 0x73, 0x69, 0x2e, 0x69, 0x70, 0x74, 0x76,
+ 0x73, 0x61, 0x64, 0x2d, 0x63, 0x6f, 0x64, 0x2b, 0x78, 0x6d, 0x6c, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x65, 0x74, 0x73, 0x69, 0x2e, 0x69,
+ 0x70, 0x74, 0x76, 0x73, 0x61, 0x64, 0x2d, 0x6e, 0x70, 0x76, 0x72, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x65, 0x74,
+ 0x73, 0x69, 0x2e, 0x69, 0x70, 0x74, 0x76, 0x73, 0x65, 0x72, 0x76, 0x69,
+ 0x63, 0x65, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x65, 0x74, 0x73, 0x69, 0x2e, 0x69, 0x70, 0x74, 0x76, 0x73, 0x79,
+ 0x6e, 0x63, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x65, 0x74, 0x73, 0x69, 0x2e, 0x69, 0x70, 0x74, 0x76, 0x75, 0x65,
+ 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2b, 0x78, 0x6d, 0x6c, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x65, 0x74, 0x73, 0x69, 0x2e, 0x6d,
+ 0x63, 0x69, 0x64, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x65, 0x74, 0x73, 0x69, 0x2e, 0x6f, 0x76, 0x65, 0x72, 0x6c,
+ 0x6f, 0x61, 0x64, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d,
+ 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x73,
+ 0x65, 0x74, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x65, 0x74, 0x73, 0x69, 0x2e, 0x73, 0x63, 0x69, 0x2b, 0x78, 0x6d,
+ 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x65, 0x74, 0x73, 0x69,
+ 0x2e, 0x73, 0x69, 0x6d, 0x73, 0x65, 0x72, 0x76, 0x73, 0x2b, 0x78, 0x6d,
+ 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x65, 0x74, 0x73, 0x69,
+ 0x2e, 0x74, 0x73, 0x6c, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x65, 0x74, 0x73, 0x69, 0x2e, 0x74, 0x73, 0x6c, 0x2e,
+ 0x64, 0x65, 0x72, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x65, 0x75,
+ 0x64, 0x6f, 0x72, 0x61, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x65, 0x7a, 0x70, 0x69, 0x78, 0x2d, 0x61, 0x6c, 0x62, 0x75,
+ 0x6d, 0x09, 0x09, 0x09, 0x65, 0x7a, 0x32, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x65, 0x7a, 0x70, 0x69, 0x78, 0x2d, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67,
+ 0x65, 0x09, 0x09, 0x09, 0x65, 0x7a, 0x33, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x66, 0x2d, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x2e, 0x6d,
+ 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x66, 0x64,
+ 0x66, 0x09, 0x09, 0x09, 0x09, 0x66, 0x64, 0x66, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x66, 0x64, 0x73, 0x6e, 0x2e, 0x6d, 0x73, 0x65, 0x65, 0x64, 0x09,
+ 0x09, 0x09, 0x6d, 0x73, 0x65, 0x65, 0x64, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x66, 0x64, 0x73, 0x6e, 0x2e, 0x73, 0x65, 0x65, 0x64, 0x09, 0x09, 0x09,
+ 0x73, 0x65, 0x65, 0x64, 0x20, 0x64, 0x61, 0x74, 0x61, 0x6c, 0x65, 0x73,
+ 0x73, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x66, 0x66, 0x73, 0x6e,
+ 0x73, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x66, 0x69, 0x6e, 0x74,
+ 0x73, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x66, 0x6c, 0x6f, 0x67, 0x72, 0x61,
+ 0x70, 0x68, 0x69, 0x74, 0x09, 0x09, 0x09, 0x67, 0x70, 0x68, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x66, 0x6c, 0x75, 0x78, 0x74, 0x69, 0x6d, 0x65, 0x2e,
+ 0x63, 0x6c, 0x69, 0x70, 0x09, 0x09, 0x09, 0x66, 0x74, 0x63, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x66, 0x6f,
+ 0x6e, 0x74, 0x66, 0x6f, 0x72, 0x67, 0x65, 0x2d, 0x73, 0x66, 0x64, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x6d, 0x61, 0x6b,
+ 0x65, 0x72, 0x09, 0x09, 0x09, 0x66, 0x6d, 0x20, 0x66, 0x72, 0x61, 0x6d,
+ 0x65, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x72, 0x20, 0x62, 0x6f, 0x6f, 0x6b,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x66, 0x72, 0x6f, 0x67, 0x61, 0x6e, 0x73,
+ 0x2e, 0x66, 0x6e, 0x63, 0x09, 0x09, 0x09, 0x66, 0x6e, 0x63, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x66, 0x72, 0x6f, 0x67, 0x61, 0x6e, 0x73, 0x2e, 0x6c,
+ 0x74, 0x66, 0x09, 0x09, 0x09, 0x6c, 0x74, 0x66, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x66, 0x73, 0x63, 0x2e, 0x77, 0x65, 0x62, 0x6c, 0x61, 0x75, 0x6e,
+ 0x63, 0x68, 0x09, 0x09, 0x09, 0x66, 0x73, 0x63, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x66, 0x75, 0x6a, 0x69, 0x74, 0x73, 0x75, 0x2e, 0x6f, 0x61, 0x73,
+ 0x79, 0x73, 0x09, 0x09, 0x09, 0x6f, 0x61, 0x73, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x66, 0x75, 0x6a, 0x69, 0x74, 0x73, 0x75, 0x2e, 0x6f, 0x61, 0x73,
+ 0x79, 0x73, 0x32, 0x09, 0x09, 0x09, 0x6f, 0x61, 0x32, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x66, 0x75, 0x6a, 0x69, 0x74, 0x73, 0x75, 0x2e, 0x6f, 0x61,
+ 0x73, 0x79, 0x73, 0x33, 0x09, 0x09, 0x09, 0x6f, 0x61, 0x33, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x66, 0x75, 0x6a, 0x69, 0x74, 0x73, 0x75, 0x2e, 0x6f,
+ 0x61, 0x73, 0x79, 0x73, 0x67, 0x70, 0x09, 0x09, 0x09, 0x66, 0x67, 0x35,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x66, 0x75, 0x6a, 0x69, 0x74, 0x73, 0x75,
+ 0x2e, 0x6f, 0x61, 0x73, 0x79, 0x73, 0x70, 0x72, 0x73, 0x09, 0x09, 0x62,
+ 0x68, 0x32, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x66, 0x75, 0x6a,
+ 0x69, 0x78, 0x65, 0x72, 0x6f, 0x78, 0x2e, 0x61, 0x72, 0x74, 0x2d, 0x65,
+ 0x78, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x66, 0x75, 0x6a, 0x69,
+ 0x78, 0x65, 0x72, 0x6f, 0x78, 0x2e, 0x61, 0x72, 0x74, 0x34, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x66, 0x75, 0x6a, 0x69, 0x78, 0x65, 0x72,
+ 0x6f, 0x78, 0x2e, 0x68, 0x62, 0x70, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x66, 0x75, 0x6a, 0x69, 0x78, 0x65, 0x72, 0x6f, 0x78, 0x2e, 0x64, 0x64,
+ 0x64, 0x09, 0x09, 0x09, 0x64, 0x64, 0x64, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x66, 0x75, 0x6a, 0x69, 0x78, 0x65, 0x72, 0x6f, 0x78, 0x2e, 0x64, 0x6f,
+ 0x63, 0x75, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x09, 0x09, 0x78, 0x64, 0x77,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x66, 0x75, 0x6a, 0x69, 0x78, 0x65, 0x72,
+ 0x6f, 0x78, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x77, 0x6f, 0x72, 0x6b, 0x73,
+ 0x2e, 0x62, 0x69, 0x6e, 0x64, 0x65, 0x72, 0x09, 0x78, 0x62, 0x64, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x66, 0x75, 0x74, 0x2d, 0x6d, 0x69,
+ 0x73, 0x6e, 0x65, 0x74, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x66, 0x75, 0x7a,
+ 0x7a, 0x79, 0x73, 0x68, 0x65, 0x65, 0x74, 0x09, 0x09, 0x09, 0x66, 0x7a,
+ 0x73, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x67, 0x65, 0x6e, 0x6f, 0x6d, 0x61,
+ 0x74, 0x69, 0x78, 0x2e, 0x74, 0x75, 0x78, 0x65, 0x64, 0x6f, 0x09, 0x09,
+ 0x74, 0x78, 0x64, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x67, 0x65,
+ 0x6f, 0x63, 0x75, 0x62, 0x65, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x67, 0x65, 0x6f, 0x67, 0x65, 0x62, 0x72, 0x61, 0x2e, 0x66,
+ 0x69, 0x6c, 0x65, 0x09, 0x09, 0x09, 0x67, 0x67, 0x62, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x67, 0x65, 0x6f, 0x67, 0x65, 0x62, 0x72, 0x61, 0x2e, 0x74,
+ 0x6f, 0x6f, 0x6c, 0x09, 0x09, 0x09, 0x67, 0x67, 0x74, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x67, 0x65, 0x6f, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2d, 0x65,
+ 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x09, 0x09, 0x67, 0x65, 0x78,
+ 0x20, 0x67, 0x72, 0x65, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x67, 0x65, 0x6f,
+ 0x6e, 0x65, 0x78, 0x74, 0x09, 0x09, 0x09, 0x09, 0x67, 0x78, 0x74, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x67, 0x65, 0x6f, 0x70, 0x6c, 0x61, 0x6e, 0x09,
+ 0x09, 0x09, 0x09, 0x67, 0x32, 0x77, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x67,
+ 0x65, 0x6f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x09, 0x09, 0x09, 0x67, 0x33,
+ 0x77, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x67, 0x6c, 0x6f, 0x62,
+ 0x61, 0x6c, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x63,
+ 0x61, 0x72, 0x64, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d,
+ 0x6d, 0x67, 0x74, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x67, 0x6c,
+ 0x6f, 0x62, 0x61, 0x6c, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d,
+ 0x2e, 0x63, 0x61, 0x72, 0x64, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
+ 0x74, 0x2d, 0x6d, 0x67, 0x74, 0x2d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e,
+ 0x73, 0x65, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x67, 0x6d, 0x78, 0x09, 0x09,
+ 0x09, 0x09, 0x67, 0x6d, 0x78, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2d, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x6b,
+ 0x6d, 0x6c, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x6b, 0x6d, 0x6c, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2d, 0x65,
+ 0x61, 0x72, 0x74, 0x68, 0x2e, 0x6b, 0x6d, 0x7a, 0x09, 0x09, 0x6b, 0x6d,
+ 0x7a, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x67, 0x72, 0x61, 0x66, 0x65, 0x71,
+ 0x09, 0x09, 0x09, 0x09, 0x67, 0x71, 0x66, 0x20, 0x67, 0x71, 0x73, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x67, 0x72, 0x69, 0x64, 0x6d, 0x70,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x67, 0x72, 0x6f, 0x6f, 0x76, 0x65, 0x2d,
+ 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x09, 0x09, 0x09, 0x67, 0x61,
+ 0x63, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x67, 0x72, 0x6f, 0x6f, 0x76, 0x65,
+ 0x2d, 0x68, 0x65, 0x6c, 0x70, 0x09, 0x09, 0x09, 0x67, 0x68, 0x66, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x67, 0x72, 0x6f, 0x6f, 0x76, 0x65, 0x2d, 0x69,
+ 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2d, 0x6d, 0x65, 0x73, 0x73,
+ 0x61, 0x67, 0x65, 0x09, 0x09, 0x67, 0x69, 0x6d, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x67, 0x72, 0x6f, 0x6f, 0x76, 0x65, 0x2d, 0x69, 0x6e, 0x6a, 0x65,
+ 0x63, 0x74, 0x6f, 0x72, 0x09, 0x09, 0x09, 0x67, 0x72, 0x76, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x67, 0x72, 0x6f, 0x6f, 0x76, 0x65, 0x2d, 0x74, 0x6f,
+ 0x6f, 0x6c, 0x2d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x09, 0x09,
+ 0x67, 0x74, 0x6d, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x67, 0x72, 0x6f, 0x6f,
+ 0x76, 0x65, 0x2d, 0x74, 0x6f, 0x6f, 0x6c, 0x2d, 0x74, 0x65, 0x6d, 0x70,
+ 0x6c, 0x61, 0x74, 0x65, 0x09, 0x09, 0x74, 0x70, 0x6c, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x67, 0x72, 0x6f, 0x6f, 0x76, 0x65, 0x2d, 0x76, 0x63, 0x61,
+ 0x72, 0x64, 0x09, 0x09, 0x09, 0x76, 0x63, 0x67, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x68, 0x61, 0x6c, 0x2b, 0x6a, 0x73, 0x6f, 0x6e, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x68, 0x61, 0x6c, 0x2b, 0x78, 0x6d, 0x6c, 0x09,
+ 0x09, 0x09, 0x09, 0x68, 0x61, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x68,
+ 0x61, 0x6e, 0x64, 0x68, 0x65, 0x6c, 0x64, 0x2d, 0x65, 0x6e, 0x74, 0x65,
+ 0x72, 0x74, 0x61, 0x69, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x2b, 0x78, 0x6d,
+ 0x6c, 0x09, 0x7a, 0x6d, 0x6d, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x68, 0x62,
+ 0x63, 0x69, 0x09, 0x09, 0x09, 0x09, 0x68, 0x62, 0x63, 0x69, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x68, 0x63, 0x6c, 0x2d, 0x62, 0x69, 0x72,
+ 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x68,
+ 0x68, 0x65, 0x2e, 0x6c, 0x65, 0x73, 0x73, 0x6f, 0x6e, 0x2d, 0x70, 0x6c,
+ 0x61, 0x79, 0x65, 0x72, 0x09, 0x09, 0x6c, 0x65, 0x73, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x68, 0x70, 0x2d, 0x68, 0x70, 0x67, 0x6c, 0x09, 0x09, 0x09,
+ 0x09, 0x68, 0x70, 0x67, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x68, 0x70,
+ 0x2d, 0x68, 0x70, 0x69, 0x64, 0x09, 0x09, 0x09, 0x09, 0x68, 0x70, 0x69,
+ 0x64, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x68, 0x70, 0x2d, 0x68, 0x70, 0x73,
+ 0x09, 0x09, 0x09, 0x09, 0x68, 0x70, 0x73, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x68, 0x70, 0x2d, 0x6a, 0x6c, 0x79, 0x74, 0x09, 0x09, 0x09, 0x09, 0x6a,
+ 0x6c, 0x74, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x68, 0x70, 0x2d, 0x70, 0x63,
+ 0x6c, 0x09, 0x09, 0x09, 0x09, 0x70, 0x63, 0x6c, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x68, 0x70, 0x2d, 0x70, 0x63, 0x6c, 0x78, 0x6c, 0x09, 0x09, 0x09,
+ 0x70, 0x63, 0x6c, 0x78, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x68, 0x74, 0x74, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x68, 0x79, 0x64, 0x72, 0x6f, 0x73, 0x74, 0x61, 0x74, 0x69, 0x78,
+ 0x2e, 0x73, 0x6f, 0x66, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x09, 0x09, 0x73,
+ 0x66, 0x64, 0x2d, 0x68, 0x64, 0x73, 0x74, 0x78, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x68, 0x7a, 0x6e, 0x2d, 0x33, 0x64, 0x2d, 0x63, 0x72,
+ 0x6f, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x69, 0x62, 0x6d, 0x2e, 0x61, 0x66, 0x70, 0x6c, 0x69, 0x6e,
+ 0x65, 0x64, 0x61, 0x74, 0x61, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x69, 0x62, 0x6d, 0x2e, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x6f, 0x6e,
+ 0x69, 0x63, 0x2d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x69, 0x62, 0x6d, 0x2e, 0x6d, 0x69, 0x6e, 0x69, 0x70, 0x61, 0x79,
+ 0x09, 0x09, 0x09, 0x6d, 0x70, 0x79, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x69,
+ 0x62, 0x6d, 0x2e, 0x6d, 0x6f, 0x64, 0x63, 0x61, 0x70, 0x09, 0x09, 0x09,
+ 0x61, 0x66, 0x70, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x61, 0x66, 0x70, 0x20,
+ 0x6c, 0x69, 0x73, 0x74, 0x33, 0x38, 0x32, 0x30, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x69, 0x62, 0x6d, 0x2e, 0x72, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2d,
+ 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x09, 0x09,
+ 0x69, 0x72, 0x6d, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x69, 0x62, 0x6d, 0x2e,
+ 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x61,
+ 0x69, 0x6e, 0x65, 0x72, 0x09, 0x09, 0x73, 0x63, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x69, 0x63, 0x63, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x09,
+ 0x09, 0x09, 0x69, 0x63, 0x63, 0x20, 0x69, 0x63, 0x6d, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x69, 0x67, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x72, 0x09, 0x09,
+ 0x09, 0x69, 0x67, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x69, 0x6d, 0x6d,
+ 0x65, 0x72, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2d, 0x69, 0x76, 0x70,
+ 0x09, 0x09, 0x09, 0x69, 0x76, 0x70, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x69,
+ 0x6d, 0x6d, 0x65, 0x72, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2d, 0x69,
+ 0x76, 0x75, 0x09, 0x09, 0x09, 0x69, 0x76, 0x75, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x64, 0x63,
+ 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x72, 0x6d, 0x73, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x69, 0x6e, 0x66,
+ 0x6f, 0x72, 0x6d, 0x69, 0x78, 0x2d, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e,
+ 0x61, 0x72, 0x79, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x69, 0x6e,
+ 0x66, 0x6f, 0x74, 0x65, 0x63, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65,
+ 0x63, 0x74, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x69, 0x6e, 0x66,
+ 0x6f, 0x74, 0x65, 0x63, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63,
+ 0x74, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x69, 0x6e, 0x6e, 0x6f, 0x70, 0x61, 0x74, 0x68, 0x2e, 0x77, 0x61, 0x6d,
+ 0x70, 0x2e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x69, 0x6e, 0x73, 0x6f, 0x72,
+ 0x73, 0x2e, 0x69, 0x67, 0x6d, 0x09, 0x09, 0x09, 0x69, 0x67, 0x6d, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6e,
+ 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x6e, 0x65, 0x74, 0x09, 0x09, 0x78, 0x70,
+ 0x77, 0x20, 0x78, 0x70, 0x78, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x69, 0x6e,
+ 0x74, 0x65, 0x72, 0x67, 0x65, 0x6f, 0x09, 0x09, 0x09, 0x69, 0x32, 0x67,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72,
+ 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x64, 0x69, 0x67, 0x69, 0x62, 0x6f,
+ 0x78, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x69, 0x6e, 0x74, 0x65,
+ 0x72, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, 0x6e, 0x63, 0x70, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x69, 0x6e, 0x74, 0x75, 0x2e, 0x71, 0x62, 0x6f,
+ 0x09, 0x09, 0x09, 0x71, 0x62, 0x6f, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x69,
+ 0x6e, 0x74, 0x75, 0x2e, 0x71, 0x66, 0x78, 0x09, 0x09, 0x09, 0x71, 0x66,
+ 0x78, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x69, 0x70, 0x74, 0x63,
+ 0x2e, 0x67, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x63, 0x65, 0x70, 0x74, 0x69,
+ 0x74, 0x65, 0x6d, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x69, 0x70, 0x74, 0x63, 0x2e, 0x67, 0x32, 0x2e, 0x6b, 0x6e,
+ 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x69, 0x74, 0x65, 0x6d, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x69, 0x70,
+ 0x74, 0x63, 0x2e, 0x67, 0x32, 0x2e, 0x6e, 0x65, 0x77, 0x73, 0x69, 0x74,
+ 0x65, 0x6d, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x69, 0x70, 0x74, 0x63, 0x2e, 0x67, 0x32, 0x2e, 0x6e, 0x65, 0x77,
+ 0x73, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x69, 0x70, 0x74, 0x63, 0x2e,
+ 0x67, 0x32, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x69, 0x74,
+ 0x65, 0x6d, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x69, 0x70, 0x74, 0x63, 0x2e, 0x67, 0x32, 0x2e, 0x70, 0x6c, 0x61,
+ 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x69, 0x74, 0x65, 0x6d, 0x2b, 0x78, 0x6d,
+ 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x69, 0x70, 0x75, 0x6e, 0x70, 0x6c,
+ 0x75, 0x67, 0x67, 0x65, 0x64, 0x2e, 0x72, 0x63, 0x70, 0x72, 0x6f, 0x66,
+ 0x69, 0x6c, 0x65, 0x09, 0x09, 0x72, 0x63, 0x70, 0x72, 0x6f, 0x66, 0x69,
+ 0x6c, 0x65, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x69, 0x72, 0x65, 0x70, 0x6f,
+ 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x61,
+ 0x67, 0x65, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x69, 0x72, 0x70, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x69, 0x73, 0x2d, 0x78, 0x70, 0x72, 0x09, 0x09,
+ 0x09, 0x09, 0x78, 0x70, 0x72, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x69, 0x73,
+ 0x61, 0x63, 0x2e, 0x66, 0x63, 0x73, 0x09, 0x09, 0x09, 0x66, 0x63, 0x73,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6a, 0x61, 0x6d, 0x09, 0x09, 0x09, 0x09,
+ 0x6a, 0x61, 0x6d, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6a, 0x61,
+ 0x70, 0x61, 0x6e, 0x6e, 0x65, 0x74, 0x2d, 0x64, 0x69, 0x72, 0x65, 0x63,
+ 0x74, 0x6f, 0x72, 0x79, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6a, 0x61, 0x70, 0x61, 0x6e,
+ 0x6e, 0x65, 0x74, 0x2d, 0x6a, 0x70, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x65,
+ 0x2d, 0x77, 0x61, 0x6b, 0x65, 0x75, 0x70, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x6a, 0x61, 0x70, 0x61, 0x6e, 0x6e, 0x65, 0x74, 0x2d, 0x70,
+ 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2d, 0x77, 0x61, 0x6b, 0x65, 0x75,
+ 0x70, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6a, 0x61, 0x70, 0x61,
+ 0x6e, 0x6e, 0x65, 0x74, 0x2d, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x6a, 0x61, 0x70, 0x61, 0x6e, 0x6e, 0x65, 0x74, 0x2d, 0x72, 0x65, 0x67,
+ 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2d, 0x77, 0x61,
+ 0x6b, 0x65, 0x75, 0x70, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6a,
+ 0x61, 0x70, 0x61, 0x6e, 0x6e, 0x65, 0x74, 0x2d, 0x73, 0x65, 0x74, 0x73,
+ 0x74, 0x6f, 0x72, 0x65, 0x2d, 0x77, 0x61, 0x6b, 0x65, 0x75, 0x70, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6a, 0x61, 0x70, 0x61, 0x6e, 0x6e,
+ 0x65, 0x74, 0x2d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6a, 0x61,
+ 0x70, 0x61, 0x6e, 0x6e, 0x65, 0x74, 0x2d, 0x76, 0x65, 0x72, 0x69, 0x66,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2d, 0x77, 0x61, 0x6b, 0x65,
+ 0x75, 0x70, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6a, 0x63, 0x70, 0x2e, 0x6a,
+ 0x61, 0x76, 0x61, 0x6d, 0x65, 0x2e, 0x6d, 0x69, 0x64, 0x6c, 0x65, 0x74,
+ 0x2d, 0x72, 0x6d, 0x73, 0x09, 0x09, 0x72, 0x6d, 0x73, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x6a, 0x69, 0x73, 0x70, 0x09, 0x09, 0x09, 0x09, 0x6a, 0x69,
+ 0x73, 0x70, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6a, 0x6f, 0x6f, 0x73, 0x74,
+ 0x2e, 0x6a, 0x6f, 0x64, 0x61, 0x2d, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76,
+ 0x65, 0x09, 0x09, 0x6a, 0x6f, 0x64, 0x61, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x6b, 0x61, 0x68, 0x6f, 0x6f, 0x74, 0x7a, 0x09, 0x09, 0x09, 0x09, 0x6b,
+ 0x74, 0x7a, 0x20, 0x6b, 0x74, 0x72, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6b,
+ 0x64, 0x65, 0x2e, 0x6b, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x09, 0x09, 0x09,
+ 0x6b, 0x61, 0x72, 0x62, 0x6f, 0x6e, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6b,
+ 0x64, 0x65, 0x2e, 0x6b, 0x63, 0x68, 0x61, 0x72, 0x74, 0x09, 0x09, 0x09,
+ 0x63, 0x68, 0x72, 0x74, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6b, 0x64, 0x65,
+ 0x2e, 0x6b, 0x66, 0x6f, 0x72, 0x6d, 0x75, 0x6c, 0x61, 0x09, 0x09, 0x09,
+ 0x6b, 0x66, 0x6f, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6b, 0x64, 0x65, 0x2e,
+ 0x6b, 0x69, 0x76, 0x69, 0x6f, 0x09, 0x09, 0x09, 0x66, 0x6c, 0x77, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6b, 0x64, 0x65, 0x2e, 0x6b, 0x6f, 0x6e, 0x74,
+ 0x6f, 0x75, 0x72, 0x09, 0x09, 0x09, 0x6b, 0x6f, 0x6e, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x6b, 0x64, 0x65, 0x2e, 0x6b, 0x70, 0x72, 0x65, 0x73, 0x65,
+ 0x6e, 0x74, 0x65, 0x72, 0x09, 0x09, 0x09, 0x6b, 0x70, 0x72, 0x20, 0x6b,
+ 0x70, 0x74, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6b, 0x64, 0x65, 0x2e, 0x6b,
+ 0x73, 0x70, 0x72, 0x65, 0x61, 0x64, 0x09, 0x09, 0x09, 0x6b, 0x73, 0x70,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6b, 0x64, 0x65, 0x2e, 0x6b, 0x77, 0x6f,
+ 0x72, 0x64, 0x09, 0x09, 0x09, 0x6b, 0x77, 0x64, 0x20, 0x6b, 0x77, 0x74,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6b, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x61,
+ 0x61, 0x70, 0x70, 0x09, 0x09, 0x09, 0x68, 0x74, 0x6b, 0x65, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x6b, 0x69, 0x64, 0x73, 0x70, 0x69, 0x72, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x09, 0x09, 0x09, 0x6b, 0x69, 0x61, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x6b, 0x69, 0x6e, 0x61, 0x72, 0x09, 0x09, 0x09, 0x09, 0x6b,
+ 0x6e, 0x65, 0x20, 0x6b, 0x6e, 0x70, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6b,
+ 0x6f, 0x61, 0x6e, 0x09, 0x09, 0x09, 0x09, 0x73, 0x6b, 0x70, 0x20, 0x73,
+ 0x6b, 0x64, 0x20, 0x73, 0x6b, 0x74, 0x20, 0x73, 0x6b, 0x6d, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x6b, 0x6f, 0x64, 0x61, 0x6b, 0x2d, 0x64, 0x65, 0x73,
+ 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x09, 0x09, 0x73, 0x73, 0x65,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6c, 0x61, 0x73, 0x2e, 0x6c, 0x61, 0x73,
+ 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x6c, 0x61, 0x73, 0x78, 0x6d,
+ 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6c, 0x69, 0x62, 0x65,
+ 0x72, 0x74, 0x79, 0x2d, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6c, 0x6c, 0x61, 0x6d,
+ 0x61, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x6c, 0x69,
+ 0x66, 0x65, 0x2d, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x64,
+ 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x09, 0x6c, 0x62, 0x64, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x6c, 0x6c, 0x61, 0x6d, 0x61, 0x67, 0x72, 0x61, 0x70,
+ 0x68, 0x69, 0x63, 0x73, 0x2e, 0x6c, 0x69, 0x66, 0x65, 0x2d, 0x62, 0x61,
+ 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e,
+ 0x67, 0x65, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x6c, 0x62, 0x65, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x6c, 0x6f, 0x74, 0x75, 0x73, 0x2d, 0x31, 0x2d, 0x32,
+ 0x2d, 0x33, 0x09, 0x09, 0x09, 0x31, 0x32, 0x33, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x6c, 0x6f, 0x74, 0x75, 0x73, 0x2d, 0x61, 0x70, 0x70, 0x72, 0x6f,
+ 0x61, 0x63, 0x68, 0x09, 0x09, 0x09, 0x61, 0x70, 0x72, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x6c, 0x6f, 0x74, 0x75, 0x73, 0x2d, 0x66, 0x72, 0x65, 0x65,
+ 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x09, 0x09, 0x09, 0x70, 0x72, 0x65, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6c, 0x6f, 0x74, 0x75, 0x73, 0x2d, 0x6e, 0x6f,
+ 0x74, 0x65, 0x73, 0x09, 0x09, 0x09, 0x6e, 0x73, 0x66, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x6c, 0x6f, 0x74, 0x75, 0x73, 0x2d, 0x6f, 0x72, 0x67, 0x61,
+ 0x6e, 0x69, 0x7a, 0x65, 0x72, 0x09, 0x09, 0x09, 0x6f, 0x72, 0x67, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6c, 0x6f, 0x74, 0x75, 0x73, 0x2d, 0x73, 0x63,
+ 0x72, 0x65, 0x65, 0x6e, 0x63, 0x61, 0x6d, 0x09, 0x09, 0x09, 0x73, 0x63,
+ 0x6d, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6c, 0x6f, 0x74, 0x75, 0x73, 0x2d,
+ 0x77, 0x6f, 0x72, 0x64, 0x70, 0x72, 0x6f, 0x09, 0x09, 0x09, 0x6c, 0x77,
+ 0x70, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x61, 0x63, 0x70, 0x6f, 0x72,
+ 0x74, 0x73, 0x2e, 0x70, 0x6f, 0x72, 0x74, 0x70, 0x6b, 0x67, 0x09, 0x09,
+ 0x70, 0x6f, 0x72, 0x74, 0x70, 0x6b, 0x67, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x6d, 0x61, 0x72, 0x6c, 0x69, 0x6e, 0x2e, 0x64, 0x72, 0x6d,
+ 0x2e, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x74, 0x6f, 0x6b, 0x65, 0x6e,
+ 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d,
+ 0x61, 0x72, 0x6c, 0x69, 0x6e, 0x2e, 0x64, 0x72, 0x6d, 0x2e, 0x63, 0x6f,
+ 0x6e, 0x66, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2b, 0x78, 0x6d, 0x6c, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x61, 0x72, 0x6c, 0x69, 0x6e,
+ 0x2e, 0x64, 0x72, 0x6d, 0x2e, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65,
+ 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d,
+ 0x61, 0x72, 0x6c, 0x69, 0x6e, 0x2e, 0x64, 0x72, 0x6d, 0x2e, 0x6d, 0x64,
+ 0x63, 0x66, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x63, 0x64, 0x09, 0x09,
+ 0x09, 0x09, 0x6d, 0x63, 0x64, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x65,
+ 0x64, 0x63, 0x61, 0x6c, 0x63, 0x64, 0x61, 0x74, 0x61, 0x09, 0x09, 0x09,
+ 0x6d, 0x63, 0x31, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x65, 0x64, 0x69,
+ 0x61, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x63, 0x64, 0x6b,
+ 0x65, 0x79, 0x09, 0x09, 0x63, 0x64, 0x6b, 0x65, 0x79, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x65, 0x72, 0x69, 0x64, 0x69, 0x61, 0x6e,
+ 0x2d, 0x73, 0x6c, 0x69, 0x6e, 0x67, 0x73, 0x68, 0x6f, 0x74, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x6d, 0x66, 0x65, 0x72, 0x09, 0x09, 0x09, 0x09, 0x6d,
+ 0x77, 0x66, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x66, 0x6d, 0x70, 0x09,
+ 0x09, 0x09, 0x09, 0x6d, 0x66, 0x6d, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d,
+ 0x69, 0x63, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x66, 0x78, 0x2e, 0x66, 0x6c,
+ 0x6f, 0x09, 0x09, 0x09, 0x66, 0x6c, 0x6f, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x66, 0x78, 0x2e, 0x69,
+ 0x67, 0x78, 0x09, 0x09, 0x09, 0x69, 0x67, 0x78, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x6d, 0x69, 0x66, 0x09, 0x09, 0x09, 0x09, 0x6d, 0x69, 0x66, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x69, 0x6e, 0x69, 0x73, 0x6f,
+ 0x66, 0x74, 0x2d, 0x68, 0x70, 0x33, 0x30, 0x30, 0x30, 0x2d, 0x73, 0x61,
+ 0x76, 0x65, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x69, 0x74,
+ 0x73, 0x75, 0x62, 0x69, 0x73, 0x68, 0x69, 0x2e, 0x6d, 0x69, 0x73, 0x74,
+ 0x79, 0x2d, 0x67, 0x75, 0x61, 0x72, 0x64, 0x2e, 0x74, 0x72, 0x75, 0x73,
+ 0x74, 0x77, 0x65, 0x62, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x6f, 0x62,
+ 0x69, 0x75, 0x73, 0x2e, 0x64, 0x61, 0x66, 0x09, 0x09, 0x09, 0x64, 0x61,
+ 0x66, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x6f, 0x62, 0x69, 0x75, 0x73,
+ 0x2e, 0x64, 0x69, 0x73, 0x09, 0x09, 0x09, 0x64, 0x69, 0x73, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x6d, 0x6f, 0x62, 0x69, 0x75, 0x73, 0x2e, 0x6d, 0x62,
+ 0x6b, 0x09, 0x09, 0x09, 0x6d, 0x62, 0x6b, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x6d, 0x6f, 0x62, 0x69, 0x75, 0x73, 0x2e, 0x6d, 0x71, 0x79, 0x09, 0x09,
+ 0x09, 0x6d, 0x71, 0x79, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x6f, 0x62,
+ 0x69, 0x75, 0x73, 0x2e, 0x6d, 0x73, 0x6c, 0x09, 0x09, 0x09, 0x6d, 0x73,
+ 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x6f, 0x62, 0x69, 0x75, 0x73,
+ 0x2e, 0x70, 0x6c, 0x63, 0x09, 0x09, 0x09, 0x70, 0x6c, 0x63, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x6d, 0x6f, 0x62, 0x69, 0x75, 0x73, 0x2e, 0x74, 0x78,
+ 0x66, 0x09, 0x09, 0x09, 0x74, 0x78, 0x66, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x6d, 0x6f, 0x70, 0x68, 0x75, 0x6e, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x09, 0x09, 0x6d, 0x70, 0x6e, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x6f, 0x70, 0x68, 0x75, 0x6e, 0x2e, 0x63,
+ 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x09, 0x09,
+ 0x6d, 0x70, 0x63, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x6f,
+ 0x74, 0x6f, 0x72, 0x6f, 0x6c, 0x61, 0x2e, 0x66, 0x6c, 0x65, 0x78, 0x73,
+ 0x75, 0x69, 0x74, 0x65, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d,
+ 0x6f, 0x74, 0x6f, 0x72, 0x6f, 0x6c, 0x61, 0x2e, 0x66, 0x6c, 0x65, 0x78,
+ 0x73, 0x75, 0x69, 0x74, 0x65, 0x2e, 0x61, 0x64, 0x73, 0x69, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x6f, 0x74, 0x6f, 0x72, 0x6f, 0x6c,
+ 0x61, 0x2e, 0x66, 0x6c, 0x65, 0x78, 0x73, 0x75, 0x69, 0x74, 0x65, 0x2e,
+ 0x66, 0x69, 0x73, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x6f,
+ 0x74, 0x6f, 0x72, 0x6f, 0x6c, 0x61, 0x2e, 0x66, 0x6c, 0x65, 0x78, 0x73,
+ 0x75, 0x69, 0x74, 0x65, 0x2e, 0x67, 0x6f, 0x74, 0x61, 0x70, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x6f, 0x74, 0x6f, 0x72, 0x6f, 0x6c,
+ 0x61, 0x2e, 0x66, 0x6c, 0x65, 0x78, 0x73, 0x75, 0x69, 0x74, 0x65, 0x2e,
+ 0x6b, 0x6d, 0x72, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x6f,
+ 0x74, 0x6f, 0x72, 0x6f, 0x6c, 0x61, 0x2e, 0x66, 0x6c, 0x65, 0x78, 0x73,
+ 0x75, 0x69, 0x74, 0x65, 0x2e, 0x74, 0x74, 0x63, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x6d, 0x6f, 0x74, 0x6f, 0x72, 0x6f, 0x6c, 0x61, 0x2e,
+ 0x66, 0x6c, 0x65, 0x78, 0x73, 0x75, 0x69, 0x74, 0x65, 0x2e, 0x77, 0x65,
+ 0x6d, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x6f, 0x74, 0x6f,
+ 0x72, 0x6f, 0x6c, 0x61, 0x2e, 0x69, 0x70, 0x72, 0x6d, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x6d, 0x6f, 0x7a, 0x69, 0x6c, 0x6c, 0x61, 0x2e, 0x78, 0x75,
+ 0x6c, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x78, 0x75, 0x6c, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x61, 0x72, 0x74, 0x67, 0x61,
+ 0x6c, 0x72, 0x79, 0x09, 0x09, 0x09, 0x63, 0x69, 0x6c, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x61, 0x73, 0x66, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x63, 0x61, 0x62, 0x2d, 0x63, 0x6f,
+ 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x09, 0x09, 0x63, 0x61,
+ 0x62, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x63,
+ 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x69, 0x63, 0x63, 0x70, 0x72, 0x6f, 0x66,
+ 0x69, 0x6c, 0x65, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x65,
+ 0x78, 0x63, 0x65, 0x6c, 0x09, 0x09, 0x09, 0x78, 0x6c, 0x73, 0x20, 0x78,
+ 0x6c, 0x6d, 0x20, 0x78, 0x6c, 0x61, 0x20, 0x78, 0x6c, 0x63, 0x20, 0x78,
+ 0x6c, 0x74, 0x20, 0x78, 0x6c, 0x77, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d,
+ 0x73, 0x2d, 0x65, 0x78, 0x63, 0x65, 0x6c, 0x2e, 0x61, 0x64, 0x64, 0x69,
+ 0x6e, 0x2e, 0x6d, 0x61, 0x63, 0x72, 0x6f, 0x65, 0x6e, 0x61, 0x62, 0x6c,
+ 0x65, 0x64, 0x2e, 0x31, 0x32, 0x09, 0x09, 0x78, 0x6c, 0x61, 0x6d, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x65, 0x78, 0x63, 0x65, 0x6c,
+ 0x2e, 0x73, 0x68, 0x65, 0x65, 0x74, 0x2e, 0x62, 0x69, 0x6e, 0x61, 0x72,
+ 0x79, 0x2e, 0x6d, 0x61, 0x63, 0x72, 0x6f, 0x65, 0x6e, 0x61, 0x62, 0x6c,
+ 0x65, 0x64, 0x2e, 0x31, 0x32, 0x09, 0x78, 0x6c, 0x73, 0x62, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x65, 0x78, 0x63, 0x65, 0x6c, 0x2e,
+ 0x73, 0x68, 0x65, 0x65, 0x74, 0x2e, 0x6d, 0x61, 0x63, 0x72, 0x6f, 0x65,
+ 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x31, 0x32, 0x09, 0x09, 0x78,
+ 0x6c, 0x73, 0x6d, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x65,
+ 0x78, 0x63, 0x65, 0x6c, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74,
+ 0x65, 0x2e, 0x6d, 0x61, 0x63, 0x72, 0x6f, 0x65, 0x6e, 0x61, 0x62, 0x6c,
+ 0x65, 0x64, 0x2e, 0x31, 0x32, 0x09, 0x78, 0x6c, 0x74, 0x6d, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x66, 0x6f, 0x6e, 0x74, 0x6f, 0x62,
+ 0x6a, 0x65, 0x63, 0x74, 0x09, 0x09, 0x09, 0x65, 0x6f, 0x74, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x68, 0x74, 0x6d, 0x6c, 0x68, 0x65,
+ 0x6c, 0x70, 0x09, 0x09, 0x09, 0x63, 0x68, 0x6d, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x6d, 0x73, 0x2d, 0x69, 0x6d, 0x73, 0x09, 0x09, 0x09, 0x09, 0x69,
+ 0x6d, 0x73, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x6c, 0x72,
+ 0x6d, 0x09, 0x09, 0x09, 0x09, 0x6c, 0x72, 0x6d, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65,
+ 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x78, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69,
+ 0x63, 0x65, 0x74, 0x68, 0x65, 0x6d, 0x65, 0x09, 0x09, 0x09, 0x74, 0x68,
+ 0x6d, 0x78, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d,
+ 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67,
+ 0x65, 0x2e, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64,
+ 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x70, 0x6b, 0x69, 0x2e, 0x73, 0x65, 0x63,
+ 0x63, 0x61, 0x74, 0x09, 0x09, 0x09, 0x63, 0x61, 0x74, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x70, 0x6b, 0x69, 0x2e, 0x73, 0x74, 0x6c,
+ 0x09, 0x09, 0x09, 0x73, 0x74, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x6d, 0x73, 0x2d, 0x70, 0x6c, 0x61, 0x79, 0x72, 0x65, 0x61, 0x64,
+ 0x79, 0x2e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x74, 0x6f, 0x72, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x70,
+ 0x6f, 0x77, 0x65, 0x72, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x09, 0x09, 0x09,
+ 0x70, 0x70, 0x74, 0x20, 0x70, 0x70, 0x73, 0x20, 0x70, 0x6f, 0x74, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x70, 0x6f, 0x77, 0x65, 0x72,
+ 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x2e,
+ 0x6d, 0x61, 0x63, 0x72, 0x6f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64,
+ 0x2e, 0x31, 0x32, 0x09, 0x09, 0x70, 0x70, 0x61, 0x6d, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x70, 0x6f,
+ 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6d, 0x61, 0x63, 0x72, 0x6f, 0x65, 0x6e,
+ 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x31, 0x32, 0x09, 0x70, 0x70, 0x74,
+ 0x6d, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x70, 0x6f, 0x77,
+ 0x65, 0x72, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x73, 0x6c, 0x69, 0x64,
+ 0x65, 0x2e, 0x6d, 0x61, 0x63, 0x72, 0x6f, 0x65, 0x6e, 0x61, 0x62, 0x6c,
+ 0x65, 0x64, 0x2e, 0x31, 0x32, 0x09, 0x09, 0x73, 0x6c, 0x64, 0x6d, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x70, 0x6f, 0x77, 0x65, 0x72,
+ 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x73,
+ 0x68, 0x6f, 0x77, 0x2e, 0x6d, 0x61, 0x63, 0x72, 0x6f, 0x65, 0x6e, 0x61,
+ 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x31, 0x32, 0x09, 0x09, 0x70, 0x70, 0x73,
+ 0x6d, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x70, 0x6f, 0x77,
+ 0x65, 0x72, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x65, 0x6d, 0x70,
+ 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x6d, 0x61, 0x63, 0x72, 0x6f, 0x65, 0x6e,
+ 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x31, 0x32, 0x09, 0x09, 0x70, 0x6f,
+ 0x74, 0x6d, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d,
+ 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x69,
+ 0x6e, 0x74, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x70, 0x72, 0x6f, 0x6a,
+ 0x65, 0x63, 0x74, 0x09, 0x09, 0x09, 0x6d, 0x70, 0x70, 0x20, 0x6d, 0x70,
+ 0x74, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x74,
+ 0x6e, 0x65, 0x66, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x73,
+ 0x2d, 0x77, 0x6d, 0x64, 0x72, 0x6d, 0x2e, 0x6c, 0x69, 0x63, 0x2d, 0x63,
+ 0x68, 0x6c, 0x67, 0x2d, 0x72, 0x65, 0x71, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x77, 0x6d, 0x64, 0x72, 0x6d, 0x2e, 0x6c,
+ 0x69, 0x63, 0x2d, 0x72, 0x65, 0x73, 0x70, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x77, 0x6d, 0x64, 0x72, 0x6d, 0x2e, 0x6d,
+ 0x65, 0x74, 0x65, 0x72, 0x2d, 0x63, 0x68, 0x6c, 0x67, 0x2d, 0x72, 0x65,
+ 0x71, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x77,
+ 0x6d, 0x64, 0x72, 0x6d, 0x2e, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x2d, 0x72,
+ 0x65, 0x73, 0x70, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x77,
+ 0x6f, 0x72, 0x64, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x2e, 0x6d, 0x61, 0x63, 0x72, 0x6f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65,
+ 0x64, 0x2e, 0x31, 0x32, 0x09, 0x64, 0x6f, 0x63, 0x6d, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x77, 0x6f, 0x72, 0x64, 0x2e, 0x74, 0x65,
+ 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x6d, 0x61, 0x63, 0x72, 0x6f,
+ 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x31, 0x32, 0x09, 0x64,
+ 0x6f, 0x74, 0x6d, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x77,
+ 0x6f, 0x72, 0x6b, 0x73, 0x09, 0x09, 0x09, 0x77, 0x70, 0x73, 0x20, 0x77,
+ 0x6b, 0x73, 0x20, 0x77, 0x63, 0x6d, 0x20, 0x77, 0x64, 0x62, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x77, 0x70, 0x6c, 0x09, 0x09, 0x09,
+ 0x09, 0x77, 0x70, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d,
+ 0x78, 0x70, 0x73, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x09,
+ 0x09, 0x09, 0x78, 0x70, 0x73, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x73,
+ 0x65, 0x71, 0x09, 0x09, 0x09, 0x09, 0x6d, 0x73, 0x65, 0x71, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x69, 0x67, 0x6e, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x61, 0x64,
+ 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x61, 0x64, 0x2e, 0x63,
+ 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x63, 0x69, 0x66, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x2d, 0x6e,
+ 0x69, 0x66, 0x66, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x75, 0x73, 0x69,
+ 0x63, 0x69, 0x61, 0x6e, 0x09, 0x09, 0x09, 0x6d, 0x75, 0x73, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x6d, 0x75, 0x76, 0x65, 0x65, 0x2e, 0x73, 0x74, 0x79,
+ 0x6c, 0x65, 0x09, 0x09, 0x09, 0x6d, 0x73, 0x74, 0x79, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x6d, 0x79, 0x6e, 0x66, 0x63, 0x09, 0x09, 0x09, 0x09, 0x74,
+ 0x61, 0x67, 0x6c, 0x65, 0x74, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x6e, 0x63, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6e, 0x63, 0x64, 0x2e, 0x72, 0x65,
+ 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x6e, 0x65, 0x72, 0x76, 0x61, 0x6e, 0x61, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6e, 0x65, 0x74, 0x66, 0x70, 0x78, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x6e, 0x65, 0x75, 0x72, 0x6f, 0x6c, 0x61, 0x6e, 0x67,
+ 0x75, 0x61, 0x67, 0x65, 0x2e, 0x6e, 0x6c, 0x75, 0x09, 0x09, 0x6e, 0x6c,
+ 0x75, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6e, 0x69, 0x74, 0x66, 0x09, 0x09,
+ 0x09, 0x09, 0x6e, 0x74, 0x66, 0x20, 0x6e, 0x69, 0x74, 0x66, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x6e, 0x6f, 0x62, 0x6c, 0x65, 0x6e, 0x65, 0x74, 0x2d,
+ 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x09, 0x09, 0x6e,
+ 0x6e, 0x64, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6e, 0x6f, 0x62, 0x6c, 0x65,
+ 0x6e, 0x65, 0x74, 0x2d, 0x73, 0x65, 0x61, 0x6c, 0x65, 0x72, 0x09, 0x09,
+ 0x09, 0x6e, 0x6e, 0x73, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6e, 0x6f, 0x62,
+ 0x6c, 0x65, 0x6e, 0x65, 0x74, 0x2d, 0x77, 0x65, 0x62, 0x09, 0x09, 0x09,
+ 0x6e, 0x6e, 0x77, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6e, 0x6f,
+ 0x6b, 0x69, 0x61, 0x2e, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x73,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6e, 0x6f, 0x6b, 0x69, 0x61,
+ 0x2e, 0x63, 0x6f, 0x6e, 0x6d, 0x6c, 0x2b, 0x77, 0x62, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6e, 0x6f, 0x6b, 0x69, 0x61,
+ 0x2e, 0x63, 0x6f, 0x6e, 0x6d, 0x6c, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6e, 0x6f, 0x6b, 0x69, 0x61, 0x2e, 0x69,
+ 0x73, 0x64, 0x73, 0x2d, 0x72, 0x61, 0x64, 0x69, 0x6f, 0x2d, 0x70, 0x72,
+ 0x65, 0x73, 0x65, 0x74, 0x73, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x6e, 0x6f, 0x6b, 0x69, 0x61, 0x2e, 0x69, 0x70, 0x74, 0x76, 0x2e, 0x63,
+ 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6e, 0x6f, 0x6b, 0x69, 0x61, 0x2e, 0x6c, 0x61,
+ 0x6e, 0x64, 0x6d, 0x61, 0x72, 0x6b, 0x2b, 0x77, 0x62, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6e, 0x6f, 0x6b, 0x69, 0x61,
+ 0x2e, 0x6c, 0x61, 0x6e, 0x64, 0x6d, 0x61, 0x72, 0x6b, 0x2b, 0x78, 0x6d,
+ 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6e, 0x6f, 0x6b, 0x69,
+ 0x61, 0x2e, 0x6c, 0x61, 0x6e, 0x64, 0x6d, 0x61, 0x72, 0x6b, 0x63, 0x6f,
+ 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6e, 0x6f, 0x6b, 0x69, 0x61,
+ 0x2e, 0x6e, 0x2d, 0x67, 0x61, 0x67, 0x65, 0x2e, 0x61, 0x63, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6e, 0x6f, 0x6b, 0x69, 0x61,
+ 0x2e, 0x6e, 0x2d, 0x67, 0x61, 0x67, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61,
+ 0x09, 0x09, 0x6e, 0x67, 0x64, 0x61, 0x74, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x6e, 0x6f, 0x6b, 0x69, 0x61, 0x2e, 0x6e, 0x2d, 0x67, 0x61, 0x67, 0x65,
+ 0x2e, 0x73, 0x79, 0x6d, 0x62, 0x69, 0x61, 0x6e, 0x2e, 0x69, 0x6e, 0x73,
+ 0x74, 0x61, 0x6c, 0x6c, 0x09, 0x6e, 0x2d, 0x67, 0x61, 0x67, 0x65, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6e, 0x6f, 0x6b, 0x69, 0x61, 0x2e,
+ 0x6e, 0x63, 0x64, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6e, 0x6f,
+ 0x6b, 0x69, 0x61, 0x2e, 0x70, 0x63, 0x64, 0x2b, 0x77, 0x62, 0x78, 0x6d,
+ 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6e, 0x6f, 0x6b, 0x69,
+ 0x61, 0x2e, 0x70, 0x63, 0x64, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x6e, 0x6f, 0x6b, 0x69, 0x61, 0x2e, 0x72, 0x61, 0x64, 0x69,
+ 0x6f, 0x2d, 0x70, 0x72, 0x65, 0x73, 0x65, 0x74, 0x09, 0x09, 0x72, 0x70,
+ 0x73, 0x74, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6e, 0x6f, 0x6b, 0x69, 0x61,
+ 0x2e, 0x72, 0x61, 0x64, 0x69, 0x6f, 0x2d, 0x70, 0x72, 0x65, 0x73, 0x65,
+ 0x74, 0x73, 0x09, 0x09, 0x72, 0x70, 0x73, 0x73, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x6e, 0x6f, 0x76, 0x61, 0x64, 0x69, 0x67, 0x6d, 0x2e, 0x65, 0x64,
+ 0x6d, 0x09, 0x09, 0x09, 0x65, 0x64, 0x6d, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x6e, 0x6f, 0x76, 0x61, 0x64, 0x69, 0x67, 0x6d, 0x2e, 0x65, 0x64, 0x78,
+ 0x09, 0x09, 0x09, 0x65, 0x64, 0x78, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6e,
+ 0x6f, 0x76, 0x61, 0x64, 0x69, 0x67, 0x6d, 0x2e, 0x65, 0x78, 0x74, 0x09,
+ 0x09, 0x09, 0x65, 0x78, 0x74, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x6e, 0x74, 0x74, 0x2d, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x2e, 0x66, 0x69,
+ 0x6c, 0x65, 0x2d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6e, 0x74, 0x74, 0x2d, 0x6c, 0x6f,
+ 0x63, 0x61, 0x6c, 0x2e, 0x73, 0x69, 0x70, 0x2d, 0x74, 0x61, 0x5f, 0x72,
+ 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x6e, 0x74, 0x74, 0x2d, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x2e, 0x73, 0x69,
+ 0x70, 0x2d, 0x74, 0x61, 0x5f, 0x74, 0x63, 0x70, 0x5f, 0x73, 0x74, 0x72,
+ 0x65, 0x61, 0x6d, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x61, 0x73, 0x69,
+ 0x73, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65,
+ 0x6e, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x72, 0x74, 0x09, 0x09, 0x6f, 0x64,
+ 0x63, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x61, 0x73, 0x69, 0x73, 0x2e,
+ 0x6f, 0x70, 0x65, 0x6e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x2e, 0x63, 0x68, 0x61, 0x72, 0x74, 0x2d, 0x74, 0x65, 0x6d, 0x70, 0x6c,
+ 0x61, 0x74, 0x65, 0x09, 0x6f, 0x74, 0x63, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x6f, 0x61, 0x73, 0x69, 0x73, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x64, 0x6f,
+ 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62,
+ 0x61, 0x73, 0x65, 0x09, 0x09, 0x6f, 0x64, 0x62, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x6f, 0x61, 0x73, 0x69, 0x73, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x64,
+ 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x66, 0x6f, 0x72, 0x6d,
+ 0x75, 0x6c, 0x61, 0x09, 0x09, 0x6f, 0x64, 0x66, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x6f, 0x61, 0x73, 0x69, 0x73, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x64,
+ 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x66, 0x6f, 0x72, 0x6d,
+ 0x75, 0x6c, 0x61, 0x2d, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65,
+ 0x09, 0x6f, 0x64, 0x66, 0x74, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x61,
+ 0x73, 0x69, 0x73, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x64, 0x6f, 0x63, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63,
+ 0x73, 0x09, 0x09, 0x6f, 0x64, 0x67, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f,
+ 0x61, 0x73, 0x69, 0x73, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x64, 0x6f, 0x63,
+ 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69,
+ 0x63, 0x73, 0x2d, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x09,
+ 0x6f, 0x74, 0x67, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x61, 0x73, 0x69,
+ 0x73, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65,
+ 0x6e, 0x74, 0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x09, 0x09, 0x6f, 0x64,
+ 0x69, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x61, 0x73, 0x69, 0x73, 0x2e,
+ 0x6f, 0x70, 0x65, 0x6e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2d, 0x74, 0x65, 0x6d, 0x70, 0x6c,
+ 0x61, 0x74, 0x65, 0x09, 0x6f, 0x74, 0x69, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x6f, 0x61, 0x73, 0x69, 0x73, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x64, 0x6f,
+ 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x65, 0x73, 0x65,
+ 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x09, 0x09, 0x6f, 0x64, 0x70,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x61, 0x73, 0x69, 0x73, 0x2e, 0x6f,
+ 0x70, 0x65, 0x6e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e,
+ 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2d, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x09, 0x6f, 0x74,
+ 0x70, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x61, 0x73, 0x69, 0x73, 0x2e,
+ 0x6f, 0x70, 0x65, 0x6e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x2e, 0x73, 0x70, 0x72, 0x65, 0x61, 0x64, 0x73, 0x68, 0x65, 0x65, 0x74,
+ 0x09, 0x09, 0x6f, 0x64, 0x73, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x61,
+ 0x73, 0x69, 0x73, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x64, 0x6f, 0x63, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70, 0x72, 0x65, 0x61, 0x64, 0x73,
+ 0x68, 0x65, 0x65, 0x74, 0x2d, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74,
+ 0x65, 0x09, 0x6f, 0x74, 0x73, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x61,
+ 0x73, 0x69, 0x73, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x64, 0x6f, 0x63, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x09, 0x09, 0x09,
+ 0x6f, 0x64, 0x74, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x61, 0x73, 0x69,
+ 0x73, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65,
+ 0x6e, 0x74, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x2d, 0x6d, 0x61, 0x73, 0x74,
+ 0x65, 0x72, 0x09, 0x09, 0x6f, 0x64, 0x6d, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x6f, 0x61, 0x73, 0x69, 0x73, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x64, 0x6f,
+ 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x2d,
+ 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x09, 0x6f, 0x74, 0x74,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x61, 0x73, 0x69, 0x73, 0x2e, 0x6f,
+ 0x70, 0x65, 0x6e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e,
+ 0x74, 0x65, 0x78, 0x74, 0x2d, 0x77, 0x65, 0x62, 0x09, 0x09, 0x6f, 0x74,
+ 0x68, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x62, 0x6e, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x66, 0x74, 0x6e, 0x2e, 0x6c,
+ 0x31, 0x30, 0x6e, 0x2b, 0x6a, 0x73, 0x6f, 0x6e, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x6f, 0x69, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6e, 0x74,
+ 0x65, 0x6e, 0x74, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x64, 0x6f, 0x77,
+ 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x69, 0x70, 0x66, 0x2e, 0x63, 0x6f, 0x6e,
+ 0x74, 0x65, 0x6e, 0x74, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x73, 0x74,
+ 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2b, 0x78, 0x6d, 0x6c, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x69, 0x70, 0x66, 0x2e, 0x63,
+ 0x73, 0x70, 0x67, 0x2d, 0x68, 0x65, 0x78, 0x62, 0x69, 0x6e, 0x61, 0x72,
+ 0x79, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x69, 0x70, 0x66,
+ 0x2e, 0x64, 0x61, 0x65, 0x2e, 0x73, 0x76, 0x67, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x69, 0x70, 0x66, 0x2e,
+ 0x64, 0x61, 0x65, 0x2e, 0x78, 0x68, 0x74, 0x6d, 0x6c, 0x2b, 0x78, 0x6d,
+ 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x69, 0x70, 0x66,
+ 0x2e, 0x6d, 0x69, 0x70, 0x70, 0x76, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f,
+ 0x6c, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x69, 0x70, 0x66, 0x2e,
+ 0x70, 0x61, 0x65, 0x2e, 0x67, 0x65, 0x6d, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x6f, 0x69, 0x70, 0x66, 0x2e, 0x73, 0x70, 0x64, 0x69, 0x73,
+ 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x69, 0x70, 0x66, 0x2e, 0x73, 0x70,
+ 0x64, 0x6c, 0x69, 0x73, 0x74, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x69, 0x70, 0x66, 0x2e, 0x75, 0x65, 0x70,
+ 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x69, 0x70, 0x66, 0x2e, 0x75, 0x73,
+ 0x65, 0x72, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2b, 0x78, 0x6d,
+ 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x6c, 0x70, 0x63, 0x2d, 0x73,
+ 0x75, 0x67, 0x61, 0x72, 0x09, 0x09, 0x09, 0x78, 0x6f, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x6d, 0x61, 0x2d, 0x73, 0x63, 0x77, 0x73,
+ 0x2d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x6f, 0x6d, 0x61, 0x2d, 0x73, 0x63, 0x77, 0x73, 0x2d, 0x68,
+ 0x74, 0x74, 0x70, 0x2d, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x6d, 0x61, 0x2d, 0x73, 0x63,
+ 0x77, 0x73, 0x2d, 0x68, 0x74, 0x74, 0x70, 0x2d, 0x72, 0x65, 0x73, 0x70,
+ 0x6f, 0x6e, 0x73, 0x65, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f,
+ 0x6d, 0x61, 0x2e, 0x62, 0x63, 0x61, 0x73, 0x74, 0x2e, 0x61, 0x73, 0x73,
+ 0x6f, 0x63, 0x69, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x70, 0x72, 0x6f, 0x63,
+ 0x65, 0x64, 0x75, 0x72, 0x65, 0x2d, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65,
+ 0x74, 0x65, 0x72, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x6f, 0x6d, 0x61, 0x2e, 0x62, 0x63, 0x61, 0x73, 0x74, 0x2e,
+ 0x64, 0x72, 0x6d, 0x2d, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x6d,
+ 0x61, 0x2e, 0x62, 0x63, 0x61, 0x73, 0x74, 0x2e, 0x69, 0x6d, 0x64, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x6d,
+ 0x61, 0x2e, 0x62, 0x63, 0x61, 0x73, 0x74, 0x2e, 0x6c, 0x74, 0x6b, 0x6d,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x6d, 0x61, 0x2e, 0x62,
+ 0x63, 0x61, 0x73, 0x74, 0x2e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x6d, 0x61, 0x2e, 0x62, 0x63, 0x61, 0x73,
+ 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69,
+ 0x6e, 0x67, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x6d, 0x61, 0x2e, 0x62, 0x63, 0x61, 0x73,
+ 0x74, 0x2e, 0x73, 0x67, 0x62, 0x6f, 0x6f, 0x74, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x6f, 0x6d, 0x61, 0x2e, 0x62, 0x63, 0x61, 0x73, 0x74,
+ 0x2e, 0x73, 0x67, 0x64, 0x64, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x6d, 0x61, 0x2e, 0x62, 0x63, 0x61, 0x73,
+ 0x74, 0x2e, 0x73, 0x67, 0x64, 0x75, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x6f, 0x6d, 0x61, 0x2e, 0x62, 0x63, 0x61, 0x73, 0x74, 0x2e, 0x73,
+ 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x2d, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c,
+ 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x6d, 0x61, 0x2e, 0x62, 0x63, 0x61,
+ 0x73, 0x74, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x63, 0x61, 0x72, 0x64,
+ 0x2d, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x6d, 0x61, 0x2e, 0x62,
+ 0x63, 0x61, 0x73, 0x74, 0x2e, 0x73, 0x70, 0x72, 0x6f, 0x76, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x6d, 0x61,
+ 0x2e, 0x62, 0x63, 0x61, 0x73, 0x74, 0x2e, 0x73, 0x74, 0x6b, 0x6d, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x6d, 0x61, 0x2e, 0x63, 0x61,
+ 0x62, 0x2d, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2d, 0x62, 0x6f,
+ 0x6f, 0x6b, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x6f, 0x6d, 0x61, 0x2e, 0x63, 0x61, 0x62, 0x2d, 0x66, 0x65, 0x61,
+ 0x74, 0x75, 0x72, 0x65, 0x2d, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72,
+ 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f,
+ 0x6d, 0x61, 0x2e, 0x63, 0x61, 0x62, 0x2d, 0x70, 0x63, 0x63, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x6d, 0x61,
+ 0x2e, 0x63, 0x61, 0x62, 0x2d, 0x75, 0x73, 0x65, 0x72, 0x2d, 0x70, 0x72,
+ 0x65, 0x66, 0x73, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x6f, 0x6d, 0x61, 0x2e, 0x64, 0x63, 0x64, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x6d, 0x61, 0x2e, 0x64, 0x63, 0x64, 0x63,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x6d, 0x61, 0x2e, 0x64, 0x64, 0x32,
+ 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x64, 0x64, 0x32, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x6d, 0x61, 0x2e, 0x64, 0x72, 0x6d,
+ 0x2e, 0x72, 0x69, 0x73, 0x64, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x6d, 0x61, 0x2e, 0x67, 0x72, 0x6f, 0x75,
+ 0x70, 0x2d, 0x75, 0x73, 0x61, 0x67, 0x65, 0x2d, 0x6c, 0x69, 0x73, 0x74,
+ 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f,
+ 0x6d, 0x61, 0x2e, 0x70, 0x61, 0x6c, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x6d, 0x61, 0x2e, 0x70, 0x6f, 0x63,
+ 0x2e, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x2d, 0x70, 0x72,
+ 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x2d, 0x72, 0x65, 0x70, 0x6f, 0x72,
+ 0x74, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x6f, 0x6d, 0x61, 0x2e, 0x70, 0x6f, 0x63, 0x2e, 0x66, 0x69, 0x6e, 0x61,
+ 0x6c, 0x2d, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x6d, 0x61, 0x2e, 0x70,
+ 0x6f, 0x63, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2b, 0x78, 0x6d,
+ 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x6d, 0x61, 0x2e,
+ 0x70, 0x6f, 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2d, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f,
+ 0x72, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x6f, 0x6d, 0x61, 0x2e, 0x70, 0x6f, 0x63, 0x2e, 0x6f, 0x70, 0x74, 0x69,
+ 0x6d, 0x69, 0x7a, 0x65, 0x64, 0x2d, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65,
+ 0x73, 0x73, 0x2d, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2b, 0x78, 0x6d,
+ 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x6d, 0x61, 0x2e,
+ 0x70, 0x75, 0x73, 0x68, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f,
+ 0x6d, 0x61, 0x2e, 0x73, 0x63, 0x69, 0x64, 0x6d, 0x2e, 0x6d, 0x65, 0x73,
+ 0x73, 0x61, 0x67, 0x65, 0x73, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x6d, 0x61, 0x2e, 0x78, 0x63, 0x61, 0x70,
+ 0x2d, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x6d, 0x61,
+ 0x64, 0x73, 0x2d, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x6d, 0x61, 0x64, 0x73,
+ 0x2d, 0x66, 0x69, 0x6c, 0x65, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x6d, 0x61, 0x64, 0x73, 0x2d, 0x66, 0x6f,
+ 0x6c, 0x64, 0x65, 0x72, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x6f, 0x6d, 0x61, 0x6c, 0x6f, 0x63, 0x2d, 0x73, 0x75,
+ 0x70, 0x6c, 0x2d, 0x69, 0x6e, 0x69, 0x74, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x6f, 0x70, 0x65, 0x6e, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x6f, 0x72,
+ 0x67, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x09,
+ 0x09, 0x6f, 0x78, 0x74, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f,
+ 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74,
+ 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2d,
+ 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65,
+ 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d,
+ 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65,
+ 0x6e, 0x74, 0x2e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x78, 0x6d, 0x6c,
+ 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65,
+ 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d,
+ 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65,
+ 0x6e, 0x74, 0x2e, 0x64, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65,
+ 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d,
+ 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65,
+ 0x6e, 0x74, 0x2e, 0x64, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x6d, 0x6c,
+ 0x2e, 0x63, 0x68, 0x61, 0x72, 0x74, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c,
+ 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69,
+ 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x64,
+ 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x6d, 0x6c, 0x2e, 0x63, 0x68, 0x61,
+ 0x72, 0x74, 0x73, 0x68, 0x61, 0x70, 0x65, 0x73, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78,
+ 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66,
+ 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x2e, 0x64, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x6d, 0x6c, 0x2e, 0x64,
+ 0x69, 0x61, 0x67, 0x72, 0x61, 0x6d, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x73,
+ 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f,
+ 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74,
+ 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x64, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67,
+ 0x6d, 0x6c, 0x2e, 0x64, 0x69, 0x61, 0x67, 0x72, 0x61, 0x6d, 0x64, 0x61,
+ 0x74, 0x61, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d,
+ 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f,
+ 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x64, 0x72, 0x61, 0x77, 0x69,
+ 0x6e, 0x67, 0x6d, 0x6c, 0x2e, 0x64, 0x69, 0x61, 0x67, 0x72, 0x61, 0x6d,
+ 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c,
+ 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69,
+ 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x64,
+ 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x6d, 0x6c, 0x2e, 0x64, 0x69, 0x61,
+ 0x67, 0x72, 0x61, 0x6d, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2b, 0x78, 0x6d,
+ 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e,
+ 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f,
+ 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x2d, 0x70,
+ 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x2b, 0x78, 0x6d,
+ 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e,
+ 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f,
+ 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x2e, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x6d, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74,
+ 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x73, 0x2b, 0x78, 0x6d, 0x6c, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d,
+ 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66, 0x66,
+ 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e,
+ 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x6d, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70,
+ 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73,
+ 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x6d, 0x6c, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6f,
+ 0x75, 0x74, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78,
+ 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66,
+ 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x2e, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x6d, 0x6c, 0x2e, 0x6e, 0x6f, 0x74, 0x65, 0x73, 0x6d, 0x61, 0x73,
+ 0x74, 0x65, 0x72, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72,
+ 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64,
+ 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x65, 0x73,
+ 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x6d, 0x6c, 0x2e, 0x6e,
+ 0x6f, 0x74, 0x65, 0x73, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x2b, 0x78, 0x6d,
+ 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d,
+ 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66, 0x66,
+ 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e,
+ 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x6d, 0x6c, 0x2e, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x09, 0x70, 0x70, 0x74, 0x78, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f,
+ 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65,
+ 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x65,
+ 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x6d, 0x6c, 0x2e,
+ 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66,
+ 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63,
+ 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72,
+ 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x6d, 0x6c,
+ 0x2e, 0x70, 0x72, 0x65, 0x73, 0x70, 0x72, 0x6f, 0x70, 0x73, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78,
+ 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66,
+ 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x2e, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x6d, 0x6c, 0x2e, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x09, 0x73, 0x6c,
+ 0x64, 0x78, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65,
+ 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d,
+ 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65,
+ 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x6d, 0x6c, 0x2e, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70,
+ 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73,
+ 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x6d, 0x6c, 0x2e, 0x73, 0x6c, 0x69, 0x64, 0x65,
+ 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c,
+ 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69,
+ 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70,
+ 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x6d,
+ 0x6c, 0x2e, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x6d, 0x61, 0x73, 0x74, 0x65,
+ 0x72, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70,
+ 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73,
+ 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x6d, 0x6c, 0x2e, 0x73, 0x6c, 0x69, 0x64, 0x65,
+ 0x73, 0x68, 0x6f, 0x77, 0x09, 0x70, 0x70, 0x73, 0x78, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66,
+ 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63,
+ 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72,
+ 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x6d, 0x6c,
+ 0x2e, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x73, 0x68, 0x6f, 0x77, 0x2e, 0x6d,
+ 0x61, 0x69, 0x6e, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72,
+ 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64,
+ 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x65, 0x73,
+ 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x6d, 0x6c, 0x2e, 0x73,
+ 0x6c, 0x69, 0x64, 0x65, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x69, 0x6e,
+ 0x66, 0x6f, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d,
+ 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f,
+ 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x65, 0x73, 0x65,
+ 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x6d, 0x6c, 0x2e, 0x74, 0x61,
+ 0x62, 0x6c, 0x65, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x73, 0x2b, 0x78, 0x6d,
+ 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e,
+ 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f,
+ 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x2e, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x6d, 0x6c, 0x2e, 0x74, 0x61, 0x67, 0x73, 0x2b, 0x78, 0x6d,
+ 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d,
+ 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66, 0x66,
+ 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e,
+ 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x6d, 0x6c, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x09,
+ 0x70, 0x6f, 0x74, 0x78, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f,
+ 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74,
+ 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x6d, 0x6c, 0x2e, 0x74, 0x65, 0x6d, 0x70,
+ 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2b, 0x78, 0x6d,
+ 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e,
+ 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f,
+ 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x2e, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x6d, 0x6c, 0x2e, 0x76, 0x69, 0x65, 0x77, 0x70, 0x72, 0x6f,
+ 0x70, 0x73, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d,
+ 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f,
+ 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70, 0x72, 0x65, 0x61,
+ 0x64, 0x73, 0x68, 0x65, 0x65, 0x74, 0x6d, 0x6c, 0x2e, 0x63, 0x61, 0x6c,
+ 0x63, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c,
+ 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69,
+ 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73,
+ 0x70, 0x72, 0x65, 0x61, 0x64, 0x73, 0x68, 0x65, 0x65, 0x74, 0x6d, 0x6c,
+ 0x2e, 0x63, 0x68, 0x61, 0x72, 0x74, 0x73, 0x68, 0x65, 0x65, 0x74, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70,
+ 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73,
+ 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70, 0x72, 0x65, 0x61, 0x64, 0x73, 0x68,
+ 0x65, 0x65, 0x74, 0x6d, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e,
+ 0x74, 0x73, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d,
+ 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f,
+ 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70, 0x72, 0x65, 0x61,
+ 0x64, 0x73, 0x68, 0x65, 0x65, 0x74, 0x6d, 0x6c, 0x2e, 0x63, 0x6f, 0x6e,
+ 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78,
+ 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66,
+ 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x2e, 0x73, 0x70, 0x72, 0x65, 0x61, 0x64, 0x73, 0x68, 0x65, 0x65, 0x74,
+ 0x6d, 0x6c, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x73, 0x68, 0x65,
+ 0x65, 0x74, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d,
+ 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f,
+ 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70, 0x72, 0x65, 0x61,
+ 0x64, 0x73, 0x68, 0x65, 0x65, 0x74, 0x6d, 0x6c, 0x2e, 0x65, 0x78, 0x74,
+ 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x6c, 0x69, 0x6e, 0x6b, 0x2b, 0x78, 0x6d,
+ 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e,
+ 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f,
+ 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x2e, 0x73, 0x70, 0x72, 0x65, 0x61, 0x64, 0x73, 0x68, 0x65, 0x65,
+ 0x74, 0x6d, 0x6c, 0x2e, 0x70, 0x69, 0x76, 0x6f, 0x74, 0x63, 0x61, 0x63,
+ 0x68, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f,
+ 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74,
+ 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70, 0x72, 0x65, 0x61, 0x64, 0x73,
+ 0x68, 0x65, 0x65, 0x74, 0x6d, 0x6c, 0x2e, 0x70, 0x69, 0x76, 0x6f, 0x74,
+ 0x63, 0x61, 0x63, 0x68, 0x65, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73,
+ 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f,
+ 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74,
+ 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70, 0x72, 0x65, 0x61, 0x64, 0x73,
+ 0x68, 0x65, 0x65, 0x74, 0x6d, 0x6c, 0x2e, 0x70, 0x69, 0x76, 0x6f, 0x74,
+ 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66,
+ 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63,
+ 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70,
+ 0x72, 0x65, 0x61, 0x64, 0x73, 0x68, 0x65, 0x65, 0x74, 0x6d, 0x6c, 0x2e,
+ 0x71, 0x75, 0x65, 0x72, 0x79, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65,
+ 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d,
+ 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65,
+ 0x6e, 0x74, 0x2e, 0x73, 0x70, 0x72, 0x65, 0x61, 0x64, 0x73, 0x68, 0x65,
+ 0x65, 0x74, 0x6d, 0x6c, 0x2e, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f,
+ 0x6e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78,
+ 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66,
+ 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x2e, 0x73, 0x70, 0x72, 0x65, 0x61, 0x64, 0x73, 0x68, 0x65, 0x65, 0x74,
+ 0x6d, 0x6c, 0x2e, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x6c,
+ 0x6f, 0x67, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d,
+ 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f,
+ 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70, 0x72, 0x65, 0x61,
+ 0x64, 0x73, 0x68, 0x65, 0x65, 0x74, 0x6d, 0x6c, 0x2e, 0x73, 0x68, 0x61,
+ 0x72, 0x65, 0x64, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78,
+ 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66,
+ 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x2e, 0x73, 0x70, 0x72, 0x65, 0x61, 0x64, 0x73, 0x68, 0x65, 0x65, 0x74,
+ 0x6d, 0x6c, 0x2e, 0x73, 0x68, 0x65, 0x65, 0x74, 0x09, 0x78, 0x6c, 0x73,
+ 0x78, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e,
+ 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f,
+ 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x2e, 0x73, 0x70, 0x72, 0x65, 0x61, 0x64, 0x73, 0x68, 0x65, 0x65,
+ 0x74, 0x6d, 0x6c, 0x2e, 0x73, 0x68, 0x65, 0x65, 0x74, 0x2e, 0x6d, 0x61,
+ 0x69, 0x6e, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d,
+ 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f,
+ 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70, 0x72, 0x65, 0x61,
+ 0x64, 0x73, 0x68, 0x65, 0x65, 0x74, 0x6d, 0x6c, 0x2e, 0x73, 0x68, 0x65,
+ 0x65, 0x74, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65,
+ 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d,
+ 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65,
+ 0x6e, 0x74, 0x2e, 0x73, 0x70, 0x72, 0x65, 0x61, 0x64, 0x73, 0x68, 0x65,
+ 0x65, 0x74, 0x6d, 0x6c, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x73, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70,
+ 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73,
+ 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70, 0x72, 0x65, 0x61, 0x64, 0x73, 0x68,
+ 0x65, 0x65, 0x74, 0x6d, 0x6c, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70,
+ 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73,
+ 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70, 0x72, 0x65, 0x61, 0x64, 0x73, 0x68,
+ 0x65, 0x65, 0x74, 0x6d, 0x6c, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73,
+ 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x63, 0x65, 0x6c, 0x6c, 0x73, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78,
+ 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66,
+ 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x2e, 0x73, 0x70, 0x72, 0x65, 0x61, 0x64, 0x73, 0x68, 0x65, 0x65, 0x74,
+ 0x6d, 0x6c, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x09,
+ 0x78, 0x6c, 0x74, 0x78, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f,
+ 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74,
+ 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70, 0x72, 0x65, 0x61, 0x64, 0x73,
+ 0x68, 0x65, 0x65, 0x74, 0x6d, 0x6c, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c,
+ 0x61, 0x74, 0x65, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78,
+ 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66,
+ 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x2e, 0x73, 0x70, 0x72, 0x65, 0x61, 0x64, 0x73, 0x68, 0x65, 0x65, 0x74,
+ 0x6d, 0x6c, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x73,
+ 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f,
+ 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74,
+ 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70, 0x72, 0x65, 0x61, 0x64, 0x73,
+ 0x68, 0x65, 0x65, 0x74, 0x6d, 0x6c, 0x2e, 0x76, 0x6f, 0x6c, 0x61, 0x74,
+ 0x69, 0x6c, 0x65, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63,
+ 0x69, 0x65, 0x73, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72,
+ 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64,
+ 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70, 0x72, 0x65,
+ 0x61, 0x64, 0x73, 0x68, 0x65, 0x65, 0x74, 0x6d, 0x6c, 0x2e, 0x77, 0x6f,
+ 0x72, 0x6b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x2b, 0x78, 0x6d, 0x6c, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d,
+ 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66, 0x66,
+ 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e,
+ 0x74, 0x68, 0x65, 0x6d, 0x65, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66,
+ 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63,
+ 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x74, 0x68,
+ 0x65, 0x6d, 0x65, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70,
+ 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73,
+ 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x6d, 0x6c, 0x64, 0x72, 0x61, 0x77, 0x69,
+ 0x6e, 0x67, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65,
+ 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d,
+ 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65,
+ 0x6e, 0x74, 0x2e, 0x77, 0x6f, 0x72, 0x64, 0x70, 0x72, 0x6f, 0x63, 0x65,
+ 0x73, 0x73, 0x69, 0x6e, 0x67, 0x6d, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
+ 0x65, 0x6e, 0x74, 0x73, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d,
+ 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f,
+ 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x77, 0x6f, 0x72, 0x64, 0x70,
+ 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x6d, 0x6c, 0x2e,
+ 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x09, 0x64, 0x6f, 0x63,
+ 0x78, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e,
+ 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f,
+ 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x2e, 0x77, 0x6f, 0x72, 0x64, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73,
+ 0x73, 0x69, 0x6e, 0x67, 0x6d, 0x6c, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x2e, 0x67, 0x6c, 0x6f, 0x73, 0x73, 0x61, 0x72, 0x79,
+ 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f,
+ 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74,
+ 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x77, 0x6f, 0x72, 0x64, 0x70, 0x72, 0x6f,
+ 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x6d, 0x6c, 0x2e, 0x64, 0x6f,
+ 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70,
+ 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73,
+ 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x2e, 0x77, 0x6f, 0x72, 0x64, 0x70, 0x72, 0x6f, 0x63,
+ 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x6d, 0x6c, 0x2e, 0x65, 0x6e, 0x64,
+ 0x6e, 0x6f, 0x74, 0x65, 0x73, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66,
+ 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63,
+ 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x77, 0x6f,
+ 0x72, 0x64, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67,
+ 0x6d, 0x6c, 0x2e, 0x66, 0x6f, 0x6e, 0x74, 0x74, 0x61, 0x62, 0x6c, 0x65,
+ 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f,
+ 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74,
+ 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x77, 0x6f, 0x72, 0x64, 0x70, 0x72, 0x6f,
+ 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x6d, 0x6c, 0x2e, 0x66, 0x6f,
+ 0x6f, 0x74, 0x65, 0x72, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f,
+ 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65,
+ 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x77, 0x6f, 0x72,
+ 0x64, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x6d,
+ 0x6c, 0x2e, 0x66, 0x6f, 0x6f, 0x74, 0x6e, 0x6f, 0x74, 0x65, 0x73, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70,
+ 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73,
+ 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x2e, 0x77, 0x6f, 0x72, 0x64, 0x70, 0x72, 0x6f, 0x63,
+ 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x6d, 0x6c, 0x2e, 0x6e, 0x75, 0x6d,
+ 0x62, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c,
+ 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69,
+ 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x77,
+ 0x6f, 0x72, 0x64, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e,
+ 0x67, 0x6d, 0x6c, 0x2e, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73,
+ 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f,
+ 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74,
+ 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x77, 0x6f, 0x72, 0x64, 0x70, 0x72, 0x6f,
+ 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x6d, 0x6c, 0x2e, 0x73, 0x74,
+ 0x79, 0x6c, 0x65, 0x73, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d,
+ 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f,
+ 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x77, 0x6f, 0x72, 0x64, 0x70,
+ 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x6d, 0x6c, 0x2e,
+ 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x09, 0x64, 0x6f, 0x74,
+ 0x78, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e,
+ 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f,
+ 0x66, 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x2e, 0x77, 0x6f, 0x72, 0x64, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73,
+ 0x73, 0x69, 0x6e, 0x67, 0x6d, 0x6c, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c,
+ 0x61, 0x74, 0x65, 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78,
+ 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x6f, 0x66,
+ 0x66, 0x69, 0x63, 0x65, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x2e, 0x77, 0x6f, 0x72, 0x64, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73,
+ 0x69, 0x6e, 0x67, 0x6d, 0x6c, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x65, 0x74,
+ 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c, 0x66,
+ 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x70, 0x61, 0x63, 0x6b, 0x61,
+ 0x67, 0x65, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2d, 0x70, 0x72, 0x6f, 0x70,
+ 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x78, 0x6d, 0x6c,
+ 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d, 0x70, 0x61, 0x63, 0x6b,
+ 0x61, 0x67, 0x65, 0x2e, 0x64, 0x69, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x2d,
+ 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2d, 0x78, 0x6d,
+ 0x6c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x70, 0x65,
+ 0x6e, 0x78, 0x6d, 0x6c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2d,
+ 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x2e, 0x72, 0x65, 0x6c, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x2b, 0x78, 0x6d,
+ 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x71, 0x75, 0x6f, 0x62,
+ 0x6a, 0x65, 0x63, 0x74, 0x2d, 0x71, 0x75, 0x6f, 0x78, 0x64, 0x6f, 0x63,
+ 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x6f, 0x73, 0x61, 0x2e, 0x6e, 0x65, 0x74, 0x64, 0x65, 0x70, 0x6c, 0x6f,
+ 0x79, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x73, 0x67, 0x65, 0x6f, 0x2e,
+ 0x6d, 0x61, 0x70, 0x67, 0x75, 0x69, 0x64, 0x65, 0x2e, 0x70, 0x61, 0x63,
+ 0x6b, 0x61, 0x67, 0x65, 0x09, 0x09, 0x6d, 0x67, 0x70, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x73, 0x67, 0x69, 0x2e, 0x62, 0x75, 0x6e,
+ 0x64, 0x6c, 0x65, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x73, 0x67, 0x69,
+ 0x2e, 0x64, 0x70, 0x09, 0x09, 0x09, 0x09, 0x64, 0x70, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x6f, 0x73, 0x67, 0x69, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x79,
+ 0x73, 0x74, 0x65, 0x6d, 0x09, 0x09, 0x09, 0x65, 0x73, 0x61, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x74, 0x70, 0x73, 0x2e, 0x63, 0x74,
+ 0x2d, 0x6b, 0x69, 0x70, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x70, 0x61, 0x6c, 0x6d, 0x09, 0x09, 0x09, 0x09, 0x70, 0x64, 0x62,
+ 0x20, 0x70, 0x71, 0x61, 0x20, 0x6f, 0x70, 0x72, 0x63, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x70, 0x61, 0x6f, 0x73, 0x2e, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x70, 0x61, 0x77, 0x61, 0x61, 0x66, 0x69,
+ 0x6c, 0x65, 0x09, 0x09, 0x09, 0x70, 0x61, 0x77, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x70, 0x67, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x09, 0x09,
+ 0x09, 0x73, 0x74, 0x72, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x70, 0x67, 0x2e,
+ 0x6f, 0x73, 0x61, 0x73, 0x6c, 0x69, 0x09, 0x09, 0x09, 0x65, 0x69, 0x36,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x70, 0x69, 0x61, 0x63, 0x63,
+ 0x65, 0x73, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2d, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x63, 0x65, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x70, 0x69, 0x63, 0x73, 0x65, 0x6c, 0x09, 0x09,
+ 0x09, 0x09, 0x65, 0x66, 0x69, 0x66, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x70,
+ 0x6d, 0x69, 0x2e, 0x77, 0x69, 0x64, 0x67, 0x65, 0x74, 0x09, 0x09, 0x09,
+ 0x77, 0x67, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x70, 0x6f, 0x63,
+ 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2d, 0x61, 0x64, 0x76, 0x65, 0x72,
+ 0x74, 0x69, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x70, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x6c,
+ 0x65, 0x61, 0x72, 0x6e, 0x09, 0x09, 0x09, 0x70, 0x6c, 0x66, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x62, 0x75, 0x69, 0x6c,
+ 0x64, 0x65, 0x72, 0x36, 0x09, 0x09, 0x09, 0x70, 0x62, 0x64, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x62, 0x75,
+ 0x69, 0x6c, 0x64, 0x65, 0x72, 0x36, 0x2d, 0x73, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x62, 0x75, 0x69, 0x6c,
+ 0x64, 0x65, 0x72, 0x37, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x70,
+ 0x6f, 0x77, 0x65, 0x72, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x37,
+ 0x2d, 0x73, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x70, 0x6f, 0x77,
+ 0x65, 0x72, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x37, 0x35, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x62,
+ 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x37, 0x35, 0x2d, 0x73, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x70, 0x72, 0x65, 0x6d, 0x69, 0x6e, 0x65,
+ 0x74, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65,
+ 0x77, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x2e, 0x62, 0x6f, 0x78,
+ 0x09, 0x09, 0x62, 0x6f, 0x78, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x70, 0x72,
+ 0x6f, 0x74, 0x65, 0x75, 0x73, 0x2e, 0x6d, 0x61, 0x67, 0x61, 0x7a, 0x69,
+ 0x6e, 0x65, 0x09, 0x09, 0x6d, 0x67, 0x7a, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2d, 0x64,
+ 0x65, 0x6c, 0x74, 0x61, 0x2d, 0x74, 0x72, 0x65, 0x65, 0x09, 0x09, 0x71,
+ 0x70, 0x73, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x70, 0x76, 0x69, 0x2e, 0x70,
+ 0x74, 0x69, 0x64, 0x31, 0x09, 0x09, 0x09, 0x70, 0x74, 0x69, 0x64, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x70, 0x77, 0x67, 0x2d, 0x6d, 0x75,
+ 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x78, 0x65, 0x64, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x70, 0x77, 0x67, 0x2d, 0x78, 0x68, 0x74, 0x6d,
+ 0x6c, 0x2d, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2b, 0x78, 0x6d, 0x6c, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x71, 0x75, 0x61, 0x6c, 0x63, 0x6f,
+ 0x6d, 0x6d, 0x2e, 0x62, 0x72, 0x65, 0x77, 0x2d, 0x61, 0x70, 0x70, 0x2d,
+ 0x72, 0x65, 0x73, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x71, 0x75, 0x61, 0x72,
+ 0x6b, 0x2e, 0x71, 0x75, 0x61, 0x72, 0x6b, 0x78, 0x70, 0x72, 0x65, 0x73,
+ 0x73, 0x09, 0x09, 0x71, 0x78, 0x64, 0x20, 0x71, 0x78, 0x74, 0x20, 0x71,
+ 0x77, 0x64, 0x20, 0x71, 0x77, 0x74, 0x20, 0x71, 0x78, 0x6c, 0x20, 0x71,
+ 0x78, 0x62, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x72, 0x61, 0x64,
+ 0x69, 0x73, 0x79, 0x73, 0x2e, 0x6d, 0x6f, 0x6d, 0x6c, 0x2b, 0x78, 0x6d,
+ 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x72, 0x61, 0x64, 0x69,
+ 0x73, 0x79, 0x73, 0x2e, 0x6d, 0x73, 0x6d, 0x6c, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x72, 0x61, 0x64, 0x69, 0x73,
+ 0x79, 0x73, 0x2e, 0x6d, 0x73, 0x6d, 0x6c, 0x2d, 0x61, 0x75, 0x64, 0x69,
+ 0x74, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x72, 0x61, 0x64, 0x69, 0x73, 0x79, 0x73, 0x2e, 0x6d, 0x73, 0x6d, 0x6c,
+ 0x2d, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2d, 0x63, 0x6f, 0x6e, 0x66, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x72, 0x61,
+ 0x64, 0x69, 0x73, 0x79, 0x73, 0x2e, 0x6d, 0x73, 0x6d, 0x6c, 0x2d, 0x61,
+ 0x75, 0x64, 0x69, 0x74, 0x2d, 0x63, 0x6f, 0x6e, 0x6e, 0x2b, 0x78, 0x6d,
+ 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x72, 0x61, 0x64, 0x69,
+ 0x73, 0x79, 0x73, 0x2e, 0x6d, 0x73, 0x6d, 0x6c, 0x2d, 0x61, 0x75, 0x64,
+ 0x69, 0x74, 0x2d, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x2b, 0x78, 0x6d,
+ 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x72, 0x61, 0x64, 0x69,
+ 0x73, 0x79, 0x73, 0x2e, 0x6d, 0x73, 0x6d, 0x6c, 0x2d, 0x61, 0x75, 0x64,
+ 0x69, 0x74, 0x2d, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2b, 0x78, 0x6d,
+ 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x72, 0x61, 0x64, 0x69,
+ 0x73, 0x79, 0x73, 0x2e, 0x6d, 0x73, 0x6d, 0x6c, 0x2d, 0x63, 0x6f, 0x6e,
+ 0x66, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x72, 0x61, 0x64, 0x69, 0x73, 0x79, 0x73, 0x2e, 0x6d, 0x73, 0x6d, 0x6c,
+ 0x2d, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x2b, 0x78, 0x6d, 0x6c, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x72, 0x61, 0x64, 0x69, 0x73, 0x79,
+ 0x73, 0x2e, 0x6d, 0x73, 0x6d, 0x6c, 0x2d, 0x64, 0x69, 0x61, 0x6c, 0x6f,
+ 0x67, 0x2d, 0x62, 0x61, 0x73, 0x65, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x72, 0x61, 0x64, 0x69, 0x73, 0x79, 0x73,
+ 0x2e, 0x6d, 0x73, 0x6d, 0x6c, 0x2d, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67,
+ 0x2d, 0x66, 0x61, 0x78, 0x2d, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x72, 0x61,
+ 0x64, 0x69, 0x73, 0x79, 0x73, 0x2e, 0x6d, 0x73, 0x6d, 0x6c, 0x2d, 0x64,
+ 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x2d, 0x66, 0x61, 0x78, 0x2d, 0x73, 0x65,
+ 0x6e, 0x64, 0x72, 0x65, 0x63, 0x76, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x72, 0x61, 0x64, 0x69, 0x73, 0x79, 0x73,
+ 0x2e, 0x6d, 0x73, 0x6d, 0x6c, 0x2d, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67,
+ 0x2d, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x72, 0x61, 0x64, 0x69, 0x73, 0x79, 0x73,
+ 0x2e, 0x6d, 0x73, 0x6d, 0x6c, 0x2d, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67,
+ 0x2d, 0x73, 0x70, 0x65, 0x65, 0x63, 0x68, 0x2b, 0x78, 0x6d, 0x6c, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x72, 0x61, 0x64, 0x69, 0x73, 0x79,
+ 0x73, 0x2e, 0x6d, 0x73, 0x6d, 0x6c, 0x2d, 0x64, 0x69, 0x61, 0x6c, 0x6f,
+ 0x67, 0x2d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x72, 0x61,
+ 0x69, 0x6e, 0x73, 0x74, 0x6f, 0x72, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x72, 0x61, 0x70, 0x69, 0x64, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x72, 0x65, 0x61, 0x6c, 0x76, 0x6e, 0x63, 0x2e,
+ 0x62, 0x65, 0x64, 0x09, 0x09, 0x09, 0x62, 0x65, 0x64, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x61, 0x72, 0x65, 0x2e,
+ 0x6d, 0x75, 0x73, 0x69, 0x63, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x6d, 0x78,
+ 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64,
+ 0x61, 0x72, 0x65, 0x2e, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x78, 0x6d, 0x6c,
+ 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x78,
+ 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x72, 0x65, 0x6e,
+ 0x6c, 0x65, 0x61, 0x72, 0x6e, 0x2e, 0x72, 0x6c, 0x70, 0x72, 0x69, 0x6e,
+ 0x74, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x72, 0x69, 0x67, 0x2e, 0x63, 0x72,
+ 0x79, 0x70, 0x74, 0x6f, 0x6e, 0x6f, 0x74, 0x65, 0x09, 0x09, 0x09, 0x63,
+ 0x72, 0x79, 0x70, 0x74, 0x6f, 0x6e, 0x6f, 0x74, 0x65, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x72, 0x69, 0x6d, 0x2e, 0x63, 0x6f, 0x64, 0x09, 0x09, 0x09,
+ 0x09, 0x63, 0x6f, 0x64, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x72, 0x6e, 0x2d,
+ 0x72, 0x65, 0x61, 0x6c, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x09, 0x09, 0x09,
+ 0x72, 0x6d, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x72, 0x6e, 0x2d, 0x72, 0x65,
+ 0x61, 0x6c, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x2d, 0x76, 0x62, 0x72, 0x09,
+ 0x09, 0x72, 0x6d, 0x76, 0x62, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x72, 0x6f,
+ 0x75, 0x74, 0x65, 0x36, 0x36, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x36, 0x36,
+ 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x6c, 0x69, 0x6e, 0x6b, 0x36, 0x36,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x72, 0x73, 0x2d, 0x32, 0x37,
+ 0x34, 0x78, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x72, 0x75, 0x63,
+ 0x6b, 0x75, 0x73, 0x2e, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x33, 0x73, 0x6d, 0x73,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67,
+ 0x74, 0x72, 0x61, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x74, 0x72, 0x61, 0x63,
+ 0x6b, 0x09, 0x09, 0x73, 0x74, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x73, 0x62, 0x6d, 0x2e, 0x63, 0x69, 0x64, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x73, 0x62, 0x6d, 0x2e, 0x6d, 0x69, 0x64, 0x32, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x63, 0x72, 0x69, 0x62, 0x75, 0x73,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x65, 0x61, 0x6c, 0x65,
+ 0x64, 0x2e, 0x33, 0x64, 0x66, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x73, 0x65, 0x61, 0x6c, 0x65, 0x64, 0x2e, 0x63, 0x73, 0x66, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x65, 0x61, 0x6c, 0x65, 0x64, 0x2e,
+ 0x64, 0x6f, 0x63, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x65,
+ 0x61, 0x6c, 0x65, 0x64, 0x2e, 0x65, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x73, 0x65, 0x61, 0x6c, 0x65, 0x64, 0x2e, 0x6d, 0x68,
+ 0x74, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x65, 0x61, 0x6c,
+ 0x65, 0x64, 0x2e, 0x6e, 0x65, 0x74, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x73, 0x65, 0x61, 0x6c, 0x65, 0x64, 0x2e, 0x70, 0x70, 0x74, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x65, 0x61, 0x6c, 0x65, 0x64,
+ 0x2e, 0x74, 0x69, 0x66, 0x66, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x73, 0x65, 0x61, 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x6c, 0x73, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x65, 0x61, 0x6c, 0x65, 0x64, 0x6d,
+ 0x65, 0x64, 0x69, 0x61, 0x2e, 0x73, 0x6f, 0x66, 0x74, 0x73, 0x65, 0x61,
+ 0x6c, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x73, 0x65, 0x61, 0x6c, 0x65, 0x64, 0x6d, 0x65, 0x64, 0x69, 0x61,
+ 0x2e, 0x73, 0x6f, 0x66, 0x74, 0x73, 0x65, 0x61, 0x6c, 0x2e, 0x70, 0x64,
+ 0x66, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x65, 0x65, 0x6d, 0x61, 0x69,
+ 0x6c, 0x09, 0x09, 0x09, 0x09, 0x73, 0x65, 0x65, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x73, 0x65, 0x6d, 0x61, 0x09, 0x09, 0x09, 0x09, 0x73, 0x65, 0x6d,
+ 0x61, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x65, 0x6d, 0x64, 0x09, 0x09,
+ 0x09, 0x09, 0x73, 0x65, 0x6d, 0x64, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73,
+ 0x65, 0x6d, 0x66, 0x09, 0x09, 0x09, 0x09, 0x73, 0x65, 0x6d, 0x66, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x68, 0x61, 0x6e, 0x61, 0x2e, 0x69, 0x6e,
+ 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x64, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x64,
+ 0x61, 0x74, 0x61, 0x09, 0x09, 0x69, 0x66, 0x6d, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x73, 0x68, 0x61, 0x6e, 0x61, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x72,
+ 0x6d, 0x65, 0x64, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x74, 0x65, 0x6d, 0x70,
+ 0x6c, 0x61, 0x74, 0x65, 0x09, 0x69, 0x74, 0x70, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x73, 0x68, 0x61, 0x6e, 0x61, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x72,
+ 0x6d, 0x65, 0x64, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x68, 0x61,
+ 0x6e, 0x67, 0x65, 0x09, 0x69, 0x69, 0x66, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x73, 0x68, 0x61, 0x6e, 0x61, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d,
+ 0x65, 0x64, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x09, 0x09,
+ 0x69, 0x70, 0x6b, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x69, 0x6d, 0x74,
+ 0x65, 0x63, 0x68, 0x2d, 0x6d, 0x69, 0x6e, 0x64, 0x6d, 0x61, 0x70, 0x70,
+ 0x65, 0x72, 0x09, 0x09, 0x74, 0x77, 0x64, 0x20, 0x74, 0x77, 0x64, 0x73,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x6d, 0x61, 0x66, 0x09, 0x09, 0x09,
+ 0x09, 0x6d, 0x6d, 0x66, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73,
+ 0x6d, 0x61, 0x72, 0x74, 0x2e, 0x6e, 0x6f, 0x74, 0x65, 0x62, 0x6f, 0x6f,
+ 0x6b, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x2e,
+ 0x74, 0x65, 0x61, 0x63, 0x68, 0x65, 0x72, 0x09, 0x09, 0x09, 0x74, 0x65,
+ 0x61, 0x63, 0x68, 0x65, 0x72, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x36, 0x30, 0x32, 0x2e,
+ 0x66, 0x69, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x6f,
+ 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x36, 0x30, 0x32, 0x2e, 0x66, 0x69,
+ 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x2d, 0x78, 0x6d,
+ 0x6c, 0x2d, 0x7a, 0x69, 0x70, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x6f,
+ 0x6c, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x6d, 0x2b, 0x78, 0x6d,
+ 0x6c, 0x09, 0x09, 0x09, 0x73, 0x64, 0x6b, 0x6d, 0x20, 0x73, 0x64, 0x6b,
+ 0x64, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x70, 0x6f, 0x74, 0x66, 0x69,
+ 0x72, 0x65, 0x2e, 0x64, 0x78, 0x70, 0x09, 0x09, 0x09, 0x64, 0x78, 0x70,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x70, 0x6f, 0x74, 0x66, 0x69, 0x72,
+ 0x65, 0x2e, 0x73, 0x66, 0x73, 0x09, 0x09, 0x09, 0x73, 0x66, 0x73, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x73, 0x73, 0x2d, 0x63, 0x6f,
+ 0x64, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x73, 0x73, 0x2d,
+ 0x64, 0x74, 0x66, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x73,
+ 0x73, 0x2d, 0x6e, 0x74, 0x66, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x74,
+ 0x61, 0x72, 0x64, 0x69, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x63,
+ 0x61, 0x6c, 0x63, 0x09, 0x09, 0x73, 0x64, 0x63, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x73, 0x74, 0x61, 0x72, 0x64, 0x69, 0x76, 0x69, 0x73, 0x69, 0x6f,
+ 0x6e, 0x2e, 0x64, 0x72, 0x61, 0x77, 0x09, 0x09, 0x73, 0x64, 0x61, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x74, 0x61, 0x72, 0x64, 0x69, 0x76, 0x69,
+ 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x69, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73,
+ 0x09, 0x09, 0x73, 0x64, 0x64, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x74,
+ 0x61, 0x72, 0x64, 0x69, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x6d,
+ 0x61, 0x74, 0x68, 0x09, 0x09, 0x73, 0x6d, 0x66, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x73, 0x74, 0x61, 0x72, 0x64, 0x69, 0x76, 0x69, 0x73, 0x69, 0x6f,
+ 0x6e, 0x2e, 0x77, 0x72, 0x69, 0x74, 0x65, 0x72, 0x09, 0x09, 0x73, 0x64,
+ 0x77, 0x20, 0x76, 0x6f, 0x72, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x74,
+ 0x61, 0x72, 0x64, 0x69, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x77,
+ 0x72, 0x69, 0x74, 0x65, 0x72, 0x2d, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c,
+ 0x09, 0x73, 0x67, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x74, 0x65,
+ 0x70, 0x6d, 0x61, 0x6e, 0x69, 0x61, 0x2e, 0x70, 0x61, 0x63, 0x6b, 0x61,
+ 0x67, 0x65, 0x09, 0x09, 0x73, 0x6d, 0x7a, 0x69, 0x70, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x73, 0x74, 0x65, 0x70, 0x6d, 0x61, 0x6e, 0x69, 0x61, 0x2e,
+ 0x73, 0x74, 0x65, 0x70, 0x63, 0x68, 0x61, 0x72, 0x74, 0x09, 0x09, 0x73,
+ 0x6d, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x74, 0x72, 0x65,
+ 0x65, 0x74, 0x2d, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x73, 0x75, 0x6e, 0x2e, 0x78, 0x6d, 0x6c, 0x2e, 0x63, 0x61,
+ 0x6c, 0x63, 0x09, 0x09, 0x09, 0x73, 0x78, 0x63, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x73, 0x75, 0x6e, 0x2e, 0x78, 0x6d, 0x6c, 0x2e, 0x63, 0x61, 0x6c,
+ 0x63, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x09, 0x09,
+ 0x73, 0x74, 0x63, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x75, 0x6e, 0x2e,
+ 0x78, 0x6d, 0x6c, 0x2e, 0x64, 0x72, 0x61, 0x77, 0x09, 0x09, 0x09, 0x73,
+ 0x78, 0x64, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x75, 0x6e, 0x2e, 0x78,
+ 0x6d, 0x6c, 0x2e, 0x64, 0x72, 0x61, 0x77, 0x2e, 0x74, 0x65, 0x6d, 0x70,
+ 0x6c, 0x61, 0x74, 0x65, 0x09, 0x09, 0x73, 0x74, 0x64, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x73, 0x75, 0x6e, 0x2e, 0x78, 0x6d, 0x6c, 0x2e, 0x69, 0x6d,
+ 0x70, 0x72, 0x65, 0x73, 0x73, 0x09, 0x09, 0x09, 0x73, 0x78, 0x69, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x75, 0x6e, 0x2e, 0x78, 0x6d, 0x6c, 0x2e,
+ 0x69, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x74, 0x65, 0x6d, 0x70,
+ 0x6c, 0x61, 0x74, 0x65, 0x09, 0x73, 0x74, 0x69, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x73, 0x75, 0x6e, 0x2e, 0x78, 0x6d, 0x6c, 0x2e, 0x6d, 0x61, 0x74,
+ 0x68, 0x09, 0x09, 0x09, 0x73, 0x78, 0x6d, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x73, 0x75, 0x6e, 0x2e, 0x78, 0x6d, 0x6c, 0x2e, 0x77, 0x72, 0x69, 0x74,
+ 0x65, 0x72, 0x09, 0x09, 0x09, 0x73, 0x78, 0x77, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x73, 0x75, 0x6e, 0x2e, 0x78, 0x6d, 0x6c, 0x2e, 0x77, 0x72, 0x69,
+ 0x74, 0x65, 0x72, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x09, 0x09,
+ 0x73, 0x78, 0x67, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x75, 0x6e, 0x2e,
+ 0x78, 0x6d, 0x6c, 0x2e, 0x77, 0x72, 0x69, 0x74, 0x65, 0x72, 0x2e, 0x74,
+ 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x09, 0x09, 0x73, 0x74, 0x77,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x75, 0x6e, 0x2e, 0x77,
+ 0x61, 0x64, 0x6c, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x73, 0x75, 0x73, 0x2d, 0x63, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72,
+ 0x09, 0x09, 0x09, 0x73, 0x75, 0x73, 0x20, 0x73, 0x75, 0x73, 0x70, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x76, 0x64, 0x09, 0x09, 0x09, 0x09, 0x73,
+ 0x76, 0x64, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x77, 0x69,
+ 0x66, 0x74, 0x76, 0x69, 0x65, 0x77, 0x2d, 0x69, 0x63, 0x73, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x73, 0x79, 0x6d, 0x62, 0x69, 0x61, 0x6e, 0x2e, 0x69,
+ 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x09, 0x09, 0x09, 0x73, 0x69, 0x73,
+ 0x20, 0x73, 0x69, 0x73, 0x78, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x79,
+ 0x6e, 0x63, 0x6d, 0x6c, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x78,
+ 0x73, 0x6d, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x6d,
+ 0x6c, 0x2e, 0x64, 0x6d, 0x2b, 0x77, 0x62, 0x78, 0x6d, 0x6c, 0x09, 0x09,
+ 0x09, 0x62, 0x64, 0x6d, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x79, 0x6e,
+ 0x63, 0x6d, 0x6c, 0x2e, 0x64, 0x6d, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09,
+ 0x09, 0x78, 0x64, 0x6d, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73,
+ 0x79, 0x6e, 0x63, 0x6d, 0x6c, 0x2e, 0x64, 0x6d, 0x2e, 0x6e, 0x6f, 0x74,
+ 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x6d, 0x6c, 0x2e, 0x64,
+ 0x73, 0x2e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x74, 0x61, 0x6f, 0x2e, 0x69,
+ 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65,
+ 0x2d, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x09, 0x74, 0x61, 0x6f,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x74, 0x63, 0x70, 0x64, 0x75, 0x6d, 0x70,
+ 0x2e, 0x70, 0x63, 0x61, 0x70, 0x09, 0x09, 0x09, 0x70, 0x63, 0x61, 0x70,
+ 0x20, 0x63, 0x61, 0x70, 0x20, 0x64, 0x6d, 0x70, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x74, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x2d, 0x6c, 0x69, 0x76,
+ 0x65, 0x74, 0x76, 0x09, 0x09, 0x09, 0x74, 0x6d, 0x6f, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x74, 0x72, 0x69, 0x64, 0x2e, 0x74, 0x70, 0x74, 0x09, 0x09,
+ 0x09, 0x74, 0x70, 0x74, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x74, 0x72, 0x69,
+ 0x73, 0x63, 0x61, 0x70, 0x65, 0x2e, 0x6d, 0x78, 0x73, 0x09, 0x09, 0x09,
+ 0x6d, 0x78, 0x73, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x74, 0x72, 0x75, 0x65,
+ 0x61, 0x70, 0x70, 0x09, 0x09, 0x09, 0x09, 0x74, 0x72, 0x61, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x74, 0x72, 0x75, 0x65, 0x64, 0x6f, 0x63,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x75, 0x62, 0x69, 0x73, 0x6f,
+ 0x66, 0x74, 0x2e, 0x77, 0x65, 0x62, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x75, 0x66, 0x64, 0x6c, 0x09, 0x09, 0x09,
+ 0x09, 0x75, 0x66, 0x64, 0x20, 0x75, 0x66, 0x64, 0x6c, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x75, 0x69, 0x71, 0x2e, 0x74, 0x68, 0x65, 0x6d, 0x65, 0x09,
+ 0x09, 0x09, 0x75, 0x74, 0x7a, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x75, 0x6d,
+ 0x61, 0x6a, 0x69, 0x6e, 0x09, 0x09, 0x09, 0x09, 0x75, 0x6d, 0x6a, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x09, 0x09, 0x09,
+ 0x09, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x77, 0x65, 0x62, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x75, 0x6f, 0x6d, 0x6c, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09,
+ 0x09, 0x75, 0x6f, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x75, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x74, 0x2e, 0x61, 0x6c, 0x65, 0x72,
+ 0x74, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x75, 0x70, 0x6c, 0x61,
+ 0x6e, 0x65, 0x74, 0x2e, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x2d, 0x77, 0x62,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x75, 0x70,
+ 0x6c, 0x61, 0x6e, 0x65, 0x74, 0x2e, 0x62, 0x65, 0x61, 0x72, 0x65, 0x72,
+ 0x2d, 0x63, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x75, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x74, 0x2e, 0x62, 0x65,
+ 0x61, 0x72, 0x65, 0x72, 0x2d, 0x63, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x2d,
+ 0x77, 0x62, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x75, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x74, 0x2e, 0x63, 0x61, 0x63, 0x68,
+ 0x65, 0x6f, 0x70, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x75, 0x70,
+ 0x6c, 0x61, 0x6e, 0x65, 0x74, 0x2e, 0x63, 0x61, 0x63, 0x68, 0x65, 0x6f,
+ 0x70, 0x2d, 0x77, 0x62, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x75, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x74, 0x2e, 0x63, 0x68,
+ 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x75, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x6e,
+ 0x6e, 0x65, 0x6c, 0x2d, 0x77, 0x62, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x75, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x74, 0x2e,
+ 0x6c, 0x69, 0x73, 0x74, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x75,
+ 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x74, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x2d,
+ 0x77, 0x62, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x75, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x74, 0x2e, 0x6c, 0x69, 0x73, 0x74,
+ 0x63, 0x6d, 0x64, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x75, 0x70,
+ 0x6c, 0x61, 0x6e, 0x65, 0x74, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x63, 0x6d,
+ 0x64, 0x2d, 0x77, 0x62, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x75, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x74, 0x2e, 0x73, 0x69,
+ 0x67, 0x6e, 0x61, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x76, 0x63, 0x78,
+ 0x09, 0x09, 0x09, 0x09, 0x76, 0x63, 0x78, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x76, 0x64, 0x2d, 0x73, 0x74, 0x75, 0x64, 0x79, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x77,
+ 0x6f, 0x72, 0x6b, 0x73, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x76,
+ 0x65, 0x72, 0x69, 0x6d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x2e, 0x76, 0x63,
+ 0x61, 0x73, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x76, 0x69, 0x64,
+ 0x73, 0x6f, 0x66, 0x74, 0x2e, 0x76, 0x69, 0x64, 0x63, 0x6f, 0x6e, 0x66,
+ 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x76,
+ 0x69, 0x73, 0x69, 0x6f, 0x09, 0x09, 0x09, 0x09, 0x76, 0x73, 0x64, 0x20,
+ 0x76, 0x73, 0x74, 0x20, 0x76, 0x73, 0x73, 0x20, 0x76, 0x73, 0x77, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x61, 0x72,
+ 0x79, 0x09, 0x09, 0x09, 0x76, 0x69, 0x73, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x76, 0x69, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x2e,
+ 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x66, 0x69, 0x6c, 0x65, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x76, 0x73, 0x66, 0x09, 0x09, 0x09, 0x09, 0x76, 0x73,
+ 0x66, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x77, 0x61, 0x70, 0x2e,
+ 0x73, 0x69, 0x63, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x77, 0x61,
+ 0x70, 0x2e, 0x73, 0x6c, 0x63, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x77, 0x61,
+ 0x70, 0x2e, 0x77, 0x62, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x77, 0x62,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x77, 0x61, 0x70, 0x2e,
+ 0x77, 0x6d, 0x6c, 0x63, 0x09, 0x09, 0x09, 0x77, 0x6d, 0x6c, 0x63, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x77, 0x61, 0x70, 0x2e, 0x77, 0x6d, 0x6c, 0x73,
+ 0x63, 0x72, 0x69, 0x70, 0x74, 0x63, 0x09, 0x09, 0x09, 0x77, 0x6d, 0x6c,
+ 0x73, 0x63, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x77, 0x65, 0x62, 0x74, 0x75,
+ 0x72, 0x62, 0x6f, 0x09, 0x09, 0x09, 0x77, 0x74, 0x62, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x77, 0x66, 0x61, 0x2e, 0x77, 0x73, 0x63, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x77, 0x6d, 0x63, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x77, 0x6d, 0x66, 0x2e, 0x62, 0x6f, 0x6f, 0x74,
+ 0x73, 0x74, 0x72, 0x61, 0x70, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x77, 0x6f, 0x6c, 0x66, 0x72, 0x61, 0x6d, 0x2e, 0x6d, 0x61, 0x74, 0x68,
+ 0x65, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x61, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x77, 0x6f, 0x6c, 0x66, 0x72, 0x61, 0x6d, 0x2e, 0x6d, 0x61,
+ 0x74, 0x68, 0x65, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x61, 0x2e, 0x70, 0x61,
+ 0x63, 0x6b, 0x61, 0x67, 0x65, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x77, 0x6f,
+ 0x6c, 0x66, 0x72, 0x61, 0x6d, 0x2e, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72,
+ 0x09, 0x09, 0x09, 0x6e, 0x62, 0x70, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x77,
+ 0x6f, 0x72, 0x64, 0x70, 0x65, 0x72, 0x66, 0x65, 0x63, 0x74, 0x09, 0x09,
+ 0x09, 0x77, 0x70, 0x64, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x77, 0x71, 0x64,
+ 0x09, 0x09, 0x09, 0x09, 0x77, 0x71, 0x64, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x77, 0x72, 0x71, 0x2d, 0x68, 0x70, 0x33, 0x30, 0x30, 0x30,
+ 0x2d, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x6c, 0x65, 0x64, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x77, 0x74, 0x2e, 0x73, 0x74, 0x66, 0x09, 0x09, 0x09, 0x09,
+ 0x73, 0x74, 0x66, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x77, 0x76,
+ 0x2e, 0x63, 0x73, 0x70, 0x2b, 0x77, 0x62, 0x78, 0x6d, 0x6c, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x77, 0x76, 0x2e, 0x63, 0x73, 0x70, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x77, 0x76,
+ 0x2e, 0x73, 0x73, 0x70, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x78, 0x61, 0x72, 0x61, 0x09, 0x09, 0x09, 0x09, 0x78, 0x61, 0x72,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x78, 0x66, 0x64, 0x6c, 0x09, 0x09, 0x09,
+ 0x09, 0x78, 0x66, 0x64, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x78, 0x66, 0x64, 0x6c, 0x2e, 0x77, 0x65, 0x62, 0x66, 0x6f, 0x72, 0x6d,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x78, 0x6d, 0x69, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x78, 0x6d, 0x70,
+ 0x69, 0x65, 0x2e, 0x63, 0x70, 0x6b, 0x67, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x78, 0x6d, 0x70, 0x69, 0x65, 0x2e, 0x64, 0x70, 0x6b, 0x67,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x78, 0x6d, 0x70, 0x69, 0x65,
+ 0x2e, 0x70, 0x6c, 0x61, 0x6e, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x78, 0x6d, 0x70, 0x69, 0x65, 0x2e, 0x70, 0x70, 0x6b, 0x67, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x78, 0x6d, 0x70, 0x69, 0x65, 0x2e, 0x78,
+ 0x6c, 0x69, 0x6d, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x79, 0x61, 0x6d, 0x61,
+ 0x68, 0x61, 0x2e, 0x68, 0x76, 0x2d, 0x64, 0x69, 0x63, 0x09, 0x09, 0x09,
+ 0x68, 0x76, 0x64, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x79, 0x61, 0x6d, 0x61,
+ 0x68, 0x61, 0x2e, 0x68, 0x76, 0x2d, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
+ 0x09, 0x09, 0x68, 0x76, 0x73, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x79, 0x61,
+ 0x6d, 0x61, 0x68, 0x61, 0x2e, 0x68, 0x76, 0x2d, 0x76, 0x6f, 0x69, 0x63,
+ 0x65, 0x09, 0x09, 0x09, 0x68, 0x76, 0x70, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x79, 0x61, 0x6d, 0x61, 0x68, 0x61, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x73,
+ 0x63, 0x6f, 0x72, 0x65, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x09, 0x09,
+ 0x09, 0x6f, 0x73, 0x66, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x79, 0x61, 0x6d,
+ 0x61, 0x68, 0x61, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x73, 0x63, 0x6f, 0x72,
+ 0x65, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x6f, 0x73, 0x66, 0x70,
+ 0x76, 0x67, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x6f, 0x73, 0x66, 0x70, 0x76,
+ 0x67, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x79, 0x61, 0x6d, 0x61,
+ 0x68, 0x61, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2d, 0x73, 0x65,
+ 0x74, 0x75, 0x70, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x79, 0x61, 0x6d, 0x61,
+ 0x68, 0x61, 0x2e, 0x73, 0x6d, 0x61, 0x66, 0x2d, 0x61, 0x75, 0x64, 0x69,
+ 0x6f, 0x09, 0x09, 0x73, 0x61, 0x66, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x79,
+ 0x61, 0x6d, 0x61, 0x68, 0x61, 0x2e, 0x73, 0x6d, 0x61, 0x66, 0x2d, 0x70,
+ 0x68, 0x72, 0x61, 0x73, 0x65, 0x09, 0x09, 0x73, 0x70, 0x66, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x79, 0x61, 0x6d, 0x61, 0x68, 0x61, 0x2e,
+ 0x74, 0x68, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x2d, 0x6e, 0x67, 0x6e, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x79, 0x61, 0x6d, 0x61, 0x68, 0x61,
+ 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2d, 0x75, 0x64, 0x70, 0x65,
+ 0x6e, 0x63, 0x61, 0x70, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x79, 0x65, 0x6c,
+ 0x6c, 0x6f, 0x77, 0x72, 0x69, 0x76, 0x65, 0x72, 0x2d, 0x63, 0x75, 0x73,
+ 0x74, 0x6f, 0x6d, 0x2d, 0x6d, 0x65, 0x6e, 0x75, 0x09, 0x09, 0x63, 0x6d,
+ 0x70, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x7a, 0x75, 0x6c, 0x09, 0x09, 0x09,
+ 0x09, 0x7a, 0x69, 0x72, 0x20, 0x7a, 0x69, 0x72, 0x7a, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x7a, 0x7a, 0x61, 0x7a, 0x7a, 0x2e, 0x64, 0x65, 0x63, 0x6b,
+ 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x7a, 0x61, 0x7a, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,
+ 0x6f, 0x69, 0x63, 0x65, 0x78, 0x6d, 0x6c, 0x2b, 0x78, 0x6d, 0x6c, 0x09,
+ 0x09, 0x09, 0x76, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x71, 0x2d,
+ 0x72, 0x74, 0x63, 0x70, 0x78, 0x72, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x77, 0x61, 0x74,
+ 0x63, 0x68, 0x65, 0x72, 0x69, 0x6e, 0x66, 0x6f, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x77, 0x68, 0x6f, 0x69, 0x73, 0x70, 0x70, 0x2d, 0x71,
+ 0x75, 0x65, 0x72, 0x79, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x77, 0x68, 0x6f, 0x69, 0x73,
+ 0x70, 0x70, 0x2d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x77, 0x69, 0x64, 0x67, 0x65, 0x74, 0x09, 0x09, 0x09, 0x09, 0x77, 0x67,
+ 0x74, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x77, 0x69, 0x6e, 0x68, 0x6c, 0x70, 0x09, 0x09, 0x09, 0x09,
+ 0x68, 0x6c, 0x70, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x77, 0x69, 0x74, 0x61, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x77, 0x6f, 0x72, 0x64, 0x70, 0x65, 0x72, 0x66, 0x65, 0x63, 0x74,
+ 0x35, 0x2e, 0x31, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x77, 0x73, 0x64, 0x6c, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x09, 0x09, 0x09, 0x09, 0x77, 0x73, 0x64, 0x6c, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x77, 0x73, 0x70,
+ 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09,
+ 0x77, 0x73, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x37,
+ 0x7a, 0x2d, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64,
+ 0x09, 0x09, 0x09, 0x37, 0x7a, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x61, 0x62, 0x69, 0x77,
+ 0x6f, 0x72, 0x64, 0x09, 0x09, 0x09, 0x09, 0x61, 0x62, 0x77, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78,
+ 0x2d, 0x61, 0x63, 0x65, 0x2d, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73,
+ 0x73, 0x65, 0x64, 0x09, 0x09, 0x09, 0x61, 0x63, 0x65, 0x0a, 0x23, 0x20,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x78, 0x2d, 0x61, 0x6d, 0x66, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x61, 0x70, 0x70, 0x6c,
+ 0x65, 0x2d, 0x64, 0x69, 0x73, 0x6b, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x09,
+ 0x09, 0x09, 0x64, 0x6d, 0x67, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x61, 0x75, 0x74, 0x68,
+ 0x6f, 0x72, 0x77, 0x61, 0x72, 0x65, 0x2d, 0x62, 0x69, 0x6e, 0x09, 0x09,
+ 0x09, 0x61, 0x61, 0x62, 0x20, 0x78, 0x33, 0x32, 0x20, 0x75, 0x33, 0x32,
+ 0x20, 0x76, 0x6f, 0x78, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x61, 0x75, 0x74, 0x68, 0x6f,
+ 0x72, 0x77, 0x61, 0x72, 0x65, 0x2d, 0x6d, 0x61, 0x70, 0x09, 0x09, 0x09,
+ 0x61, 0x61, 0x6d, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72,
+ 0x77, 0x61, 0x72, 0x65, 0x2d, 0x73, 0x65, 0x67, 0x09, 0x09, 0x09, 0x61,
+ 0x61, 0x73, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x62, 0x63, 0x70, 0x69, 0x6f, 0x09, 0x09,
+ 0x09, 0x09, 0x62, 0x63, 0x70, 0x69, 0x6f, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x62, 0x69,
+ 0x74, 0x74, 0x6f, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x09, 0x09, 0x09, 0x74,
+ 0x6f, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x62, 0x6c, 0x6f,
+ 0x72, 0x62, 0x09, 0x09, 0x09, 0x09, 0x62, 0x6c, 0x62, 0x20, 0x62, 0x6c,
+ 0x6f, 0x72, 0x62, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x62, 0x7a, 0x69, 0x70, 0x09, 0x09,
+ 0x09, 0x09, 0x62, 0x7a, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x62, 0x7a, 0x69, 0x70, 0x32,
+ 0x09, 0x09, 0x09, 0x09, 0x62, 0x7a, 0x32, 0x20, 0x62, 0x6f, 0x7a, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x78, 0x2d, 0x63, 0x62, 0x72, 0x09, 0x09, 0x09, 0x09, 0x63, 0x62, 0x72,
+ 0x20, 0x63, 0x62, 0x61, 0x20, 0x63, 0x62, 0x74, 0x20, 0x63, 0x62, 0x7a,
+ 0x20, 0x63, 0x62, 0x37, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x63, 0x64, 0x6c, 0x69, 0x6e,
+ 0x6b, 0x09, 0x09, 0x09, 0x09, 0x76, 0x63, 0x64, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x63,
+ 0x66, 0x73, 0x2d, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65,
+ 0x64, 0x09, 0x09, 0x09, 0x63, 0x66, 0x73, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x63, 0x68,
+ 0x61, 0x74, 0x09, 0x09, 0x09, 0x09, 0x63, 0x68, 0x61, 0x74, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78,
+ 0x2d, 0x63, 0x68, 0x65, 0x73, 0x73, 0x2d, 0x70, 0x67, 0x6e, 0x09, 0x09,
+ 0x09, 0x09, 0x70, 0x67, 0x6e, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x63, 0x6f, 0x6e, 0x66,
+ 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x09, 0x09, 0x09, 0x6e, 0x73, 0x63,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73,
+ 0x73, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x78, 0x2d, 0x63, 0x70, 0x69, 0x6f, 0x09, 0x09, 0x09, 0x09,
+ 0x63, 0x70, 0x69, 0x6f, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x63, 0x73, 0x68, 0x09, 0x09,
+ 0x09, 0x09, 0x63, 0x73, 0x68, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x64, 0x65, 0x62, 0x69,
+ 0x61, 0x6e, 0x2d, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x09, 0x09,
+ 0x09, 0x64, 0x65, 0x62, 0x20, 0x75, 0x64, 0x65, 0x62, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d,
+ 0x64, 0x67, 0x63, 0x2d, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73,
+ 0x65, 0x64, 0x09, 0x09, 0x09, 0x64, 0x67, 0x63, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x64,
+ 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x09, 0x09, 0x09, 0x64, 0x69,
+ 0x72, 0x20, 0x64, 0x63, 0x72, 0x20, 0x64, 0x78, 0x72, 0x20, 0x63, 0x73,
+ 0x74, 0x20, 0x63, 0x63, 0x74, 0x20, 0x63, 0x78, 0x74, 0x20, 0x77, 0x33,
+ 0x64, 0x20, 0x66, 0x67, 0x64, 0x20, 0x73, 0x77, 0x61, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d,
+ 0x64, 0x6f, 0x6f, 0x6d, 0x09, 0x09, 0x09, 0x09, 0x77, 0x61, 0x64, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x78, 0x2d, 0x64, 0x74, 0x62, 0x6e, 0x63, 0x78, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x09, 0x09, 0x09, 0x6e, 0x63, 0x78, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x64, 0x74, 0x62,
+ 0x6f, 0x6f, 0x6b, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x64, 0x74,
+ 0x62, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x78, 0x2d, 0x64, 0x74, 0x62, 0x72, 0x65, 0x73, 0x6f, 0x75,
+ 0x72, 0x63, 0x65, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x72, 0x65,
+ 0x73, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x78, 0x2d, 0x64, 0x76, 0x69, 0x09, 0x09, 0x09, 0x09, 0x64,
+ 0x76, 0x69, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x09, 0x09,
+ 0x09, 0x09, 0x65, 0x76, 0x79, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x65, 0x76, 0x61, 0x09,
+ 0x09, 0x09, 0x09, 0x65, 0x76, 0x61, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x66, 0x6f, 0x6e,
+ 0x74, 0x2d, 0x62, 0x64, 0x66, 0x09, 0x09, 0x09, 0x09, 0x62, 0x64, 0x66,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x64, 0x6f,
+ 0x73, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x66,
+ 0x72, 0x61, 0x6d, 0x65, 0x6d, 0x61, 0x6b, 0x65, 0x72, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d,
+ 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x67, 0x68, 0x6f, 0x73, 0x74, 0x73, 0x63,
+ 0x72, 0x69, 0x70, 0x74, 0x09, 0x09, 0x09, 0x67, 0x73, 0x66, 0x0a, 0x23,
+ 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x78, 0x2d, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x6c, 0x69, 0x62, 0x67,
+ 0x72, 0x78, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x6c, 0x69,
+ 0x6e, 0x75, 0x78, 0x2d, 0x70, 0x73, 0x66, 0x09, 0x09, 0x09, 0x70, 0x73,
+ 0x66, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x78, 0x2d, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x6f, 0x74, 0x66,
+ 0x09, 0x09, 0x09, 0x09, 0x6f, 0x74, 0x66, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x66, 0x6f,
+ 0x6e, 0x74, 0x2d, 0x70, 0x63, 0x66, 0x09, 0x09, 0x09, 0x09, 0x70, 0x63,
+ 0x66, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x78, 0x2d, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x6e, 0x66,
+ 0x09, 0x09, 0x09, 0x09, 0x73, 0x6e, 0x66, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d,
+ 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x70, 0x65, 0x65, 0x64, 0x6f, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x78, 0x2d, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x75, 0x6e,
+ 0x6f, 0x73, 0x2d, 0x6e, 0x65, 0x77, 0x73, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x66, 0x6f,
+ 0x6e, 0x74, 0x2d, 0x74, 0x74, 0x66, 0x09, 0x09, 0x09, 0x09, 0x74, 0x74,
+ 0x66, 0x20, 0x74, 0x74, 0x63, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x66, 0x6f, 0x6e, 0x74,
+ 0x2d, 0x74, 0x79, 0x70, 0x65, 0x31, 0x09, 0x09, 0x09, 0x70, 0x66, 0x61,
+ 0x20, 0x70, 0x66, 0x62, 0x20, 0x70, 0x66, 0x6d, 0x20, 0x61, 0x66, 0x6d,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x77, 0x6f, 0x66, 0x66, 0x09, 0x09,
+ 0x09, 0x09, 0x77, 0x6f, 0x66, 0x66, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x66,
+ 0x6f, 0x6e, 0x74, 0x2d, 0x76, 0x66, 0x6f, 0x6e, 0x74, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d,
+ 0x66, 0x72, 0x65, 0x65, 0x61, 0x72, 0x63, 0x09, 0x09, 0x09, 0x09, 0x61,
+ 0x72, 0x63, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x66, 0x75, 0x74, 0x75, 0x72, 0x65, 0x73,
+ 0x70, 0x6c, 0x61, 0x73, 0x68, 0x09, 0x09, 0x09, 0x73, 0x70, 0x6c, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x78, 0x2d, 0x67, 0x63, 0x61, 0x2d, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65,
+ 0x73, 0x73, 0x65, 0x64, 0x09, 0x09, 0x09, 0x67, 0x63, 0x61, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78,
+ 0x2d, 0x67, 0x6c, 0x75, 0x6c, 0x78, 0x09, 0x09, 0x09, 0x09, 0x75, 0x6c,
+ 0x78, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x78, 0x2d, 0x67, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x69, 0x63,
+ 0x09, 0x09, 0x09, 0x09, 0x67, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x69, 0x63,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x78, 0x2d, 0x67, 0x72, 0x61, 0x6d, 0x70, 0x73, 0x2d, 0x78, 0x6d,
+ 0x6c, 0x09, 0x09, 0x09, 0x67, 0x72, 0x61, 0x6d, 0x70, 0x73, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78,
+ 0x2d, 0x67, 0x74, 0x61, 0x72, 0x09, 0x09, 0x09, 0x09, 0x67, 0x74, 0x61,
+ 0x72, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x67, 0x7a, 0x69, 0x70, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78,
+ 0x2d, 0x68, 0x64, 0x66, 0x09, 0x09, 0x09, 0x09, 0x68, 0x64, 0x66, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x78, 0x2d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x2d, 0x69, 0x6e,
+ 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x09, 0x09,
+ 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x69, 0x73,
+ 0x6f, 0x39, 0x36, 0x36, 0x30, 0x2d, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x09,
+ 0x09, 0x09, 0x69, 0x73, 0x6f, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x6a, 0x61, 0x76, 0x61,
+ 0x2d, 0x6a, 0x6e, 0x6c, 0x70, 0x2d, 0x66, 0x69, 0x6c, 0x65, 0x09, 0x09,
+ 0x09, 0x6a, 0x6e, 0x6c, 0x70, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x6c, 0x61, 0x74, 0x65,
+ 0x78, 0x09, 0x09, 0x09, 0x09, 0x6c, 0x61, 0x74, 0x65, 0x78, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78,
+ 0x2d, 0x6c, 0x7a, 0x68, 0x2d, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73,
+ 0x73, 0x65, 0x64, 0x09, 0x09, 0x09, 0x6c, 0x7a, 0x68, 0x20, 0x6c, 0x68,
+ 0x61, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x78, 0x2d, 0x6d, 0x69, 0x65, 0x09, 0x09, 0x09, 0x09, 0x6d,
+ 0x69, 0x65, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x6d, 0x6f, 0x62, 0x69, 0x70, 0x6f, 0x63,
+ 0x6b, 0x65, 0x74, 0x2d, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x09, 0x09, 0x09,
+ 0x70, 0x72, 0x63, 0x20, 0x6d, 0x6f, 0x62, 0x69, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x6d,
+ 0x73, 0x2d, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x09, 0x09, 0x09, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x6d, 0x73, 0x2d, 0x73, 0x68, 0x6f,
+ 0x72, 0x74, 0x63, 0x75, 0x74, 0x09, 0x09, 0x09, 0x6c, 0x6e, 0x6b, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x78, 0x2d, 0x6d, 0x73, 0x2d, 0x77, 0x6d, 0x64, 0x09, 0x09, 0x09, 0x09,
+ 0x77, 0x6d, 0x64, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x6d, 0x73, 0x2d, 0x77, 0x6d, 0x7a,
+ 0x09, 0x09, 0x09, 0x09, 0x77, 0x6d, 0x7a, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x6d, 0x73,
+ 0x2d, 0x78, 0x62, 0x61, 0x70, 0x09, 0x09, 0x09, 0x09, 0x78, 0x62, 0x61,
+ 0x70, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x78, 0x2d, 0x6d, 0x73, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73,
+ 0x09, 0x09, 0x09, 0x09, 0x6d, 0x64, 0x62, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x6d, 0x73,
+ 0x62, 0x69, 0x6e, 0x64, 0x65, 0x72, 0x09, 0x09, 0x09, 0x09, 0x6f, 0x62,
+ 0x64, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x78, 0x2d, 0x6d, 0x73, 0x63, 0x61, 0x72, 0x64, 0x66, 0x69,
+ 0x6c, 0x65, 0x09, 0x09, 0x09, 0x63, 0x72, 0x64, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x6d,
+ 0x73, 0x63, 0x6c, 0x69, 0x70, 0x09, 0x09, 0x09, 0x09, 0x63, 0x6c, 0x70,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x78, 0x2d, 0x6d, 0x73, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61,
+ 0x64, 0x09, 0x09, 0x09, 0x65, 0x78, 0x65, 0x20, 0x64, 0x6c, 0x6c, 0x20,
+ 0x63, 0x6f, 0x6d, 0x20, 0x62, 0x61, 0x74, 0x20, 0x6d, 0x73, 0x69, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x78, 0x2d, 0x6d, 0x73, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x76, 0x69, 0x65,
+ 0x77, 0x09, 0x09, 0x09, 0x6d, 0x76, 0x62, 0x20, 0x6d, 0x31, 0x33, 0x20,
+ 0x6d, 0x31, 0x34, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x6d, 0x73, 0x6d, 0x65, 0x74, 0x61,
+ 0x66, 0x69, 0x6c, 0x65, 0x09, 0x09, 0x09, 0x77, 0x6d, 0x66, 0x20, 0x77,
+ 0x6d, 0x7a, 0x20, 0x65, 0x6d, 0x66, 0x20, 0x65, 0x6d, 0x7a, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78,
+ 0x2d, 0x6d, 0x73, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x09, 0x09, 0x09, 0x09,
+ 0x6d, 0x6e, 0x79, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x6d, 0x73, 0x70, 0x75, 0x62, 0x6c,
+ 0x69, 0x73, 0x68, 0x65, 0x72, 0x09, 0x09, 0x09, 0x70, 0x75, 0x62, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x78, 0x2d, 0x6d, 0x73, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65,
+ 0x09, 0x09, 0x09, 0x73, 0x63, 0x64, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x6d, 0x73, 0x74,
+ 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x09, 0x09, 0x09, 0x74, 0x72,
+ 0x6d, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x78, 0x2d, 0x6d, 0x73, 0x77, 0x72, 0x69, 0x74, 0x65, 0x09,
+ 0x09, 0x09, 0x09, 0x77, 0x72, 0x69, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x6e, 0x65, 0x74,
+ 0x63, 0x64, 0x66, 0x09, 0x09, 0x09, 0x09, 0x6e, 0x63, 0x20, 0x63, 0x64,
+ 0x66, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x78, 0x2d, 0x6e, 0x7a, 0x62, 0x09, 0x09, 0x09, 0x09, 0x6e,
+ 0x7a, 0x62, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x70, 0x6b, 0x63, 0x73, 0x31, 0x32, 0x09,
+ 0x09, 0x09, 0x09, 0x70, 0x31, 0x32, 0x20, 0x70, 0x66, 0x78, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78,
+ 0x2d, 0x70, 0x6b, 0x63, 0x73, 0x37, 0x2d, 0x63, 0x65, 0x72, 0x74, 0x69,
+ 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x09, 0x09, 0x70, 0x37, 0x62,
+ 0x20, 0x73, 0x70, 0x63, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x70, 0x6b, 0x63, 0x73, 0x37,
+ 0x2d, 0x63, 0x65, 0x72, 0x74, 0x72, 0x65, 0x71, 0x72, 0x65, 0x73, 0x70,
+ 0x09, 0x09, 0x09, 0x70, 0x37, 0x72, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x72, 0x61, 0x72,
+ 0x2d, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x09,
+ 0x09, 0x09, 0x72, 0x61, 0x72, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x72, 0x65, 0x73, 0x65,
+ 0x61, 0x72, 0x63, 0x68, 0x2d, 0x69, 0x6e, 0x66, 0x6f, 0x2d, 0x73, 0x79,
+ 0x73, 0x74, 0x65, 0x6d, 0x73, 0x09, 0x09, 0x72, 0x69, 0x73, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78,
+ 0x2d, 0x73, 0x68, 0x09, 0x09, 0x09, 0x09, 0x73, 0x68, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d,
+ 0x73, 0x68, 0x61, 0x72, 0x09, 0x09, 0x09, 0x09, 0x73, 0x68, 0x61, 0x72,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x78, 0x2d, 0x73, 0x68, 0x6f, 0x63, 0x6b, 0x77, 0x61, 0x76, 0x65,
+ 0x2d, 0x66, 0x6c, 0x61, 0x73, 0x68, 0x09, 0x09, 0x09, 0x73, 0x77, 0x66,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x78, 0x2d, 0x73, 0x69, 0x6c, 0x76, 0x65, 0x72, 0x6c, 0x69, 0x67,
+ 0x68, 0x74, 0x2d, 0x61, 0x70, 0x70, 0x09, 0x09, 0x09, 0x78, 0x61, 0x70,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x78, 0x2d, 0x73, 0x71, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x73, 0x71,
+ 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x78, 0x2d, 0x73, 0x74, 0x75, 0x66, 0x66, 0x69, 0x74, 0x09,
+ 0x09, 0x09, 0x09, 0x73, 0x69, 0x74, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x73, 0x74, 0x75,
+ 0x66, 0x66, 0x69, 0x74, 0x78, 0x09, 0x09, 0x09, 0x09, 0x73, 0x69, 0x74,
+ 0x78, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x78, 0x2d, 0x73, 0x75, 0x62, 0x72, 0x69, 0x70, 0x09, 0x09,
+ 0x09, 0x09, 0x73, 0x72, 0x74, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x73, 0x76, 0x34, 0x63,
+ 0x70, 0x69, 0x6f, 0x09, 0x09, 0x09, 0x09, 0x73, 0x76, 0x34, 0x63, 0x70,
+ 0x69, 0x6f, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x73, 0x76, 0x34, 0x63, 0x72, 0x63, 0x09,
+ 0x09, 0x09, 0x09, 0x73, 0x76, 0x34, 0x63, 0x72, 0x63, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d,
+ 0x74, 0x33, 0x76, 0x6d, 0x2d, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x09, 0x09,
+ 0x09, 0x74, 0x33, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x74, 0x61, 0x64, 0x73, 0x09, 0x09,
+ 0x09, 0x09, 0x67, 0x61, 0x6d, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x74, 0x61, 0x72, 0x09,
+ 0x09, 0x09, 0x09, 0x74, 0x61, 0x72, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x74, 0x63, 0x6c,
+ 0x09, 0x09, 0x09, 0x09, 0x74, 0x63, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x74, 0x65,
+ 0x78, 0x09, 0x09, 0x09, 0x09, 0x74, 0x65, 0x78, 0x0a, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x74,
+ 0x65, 0x78, 0x2d, 0x74, 0x66, 0x6d, 0x09, 0x09, 0x09, 0x09, 0x74, 0x66,
+ 0x6d, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x78, 0x2d, 0x74, 0x65, 0x78, 0x69, 0x6e, 0x66, 0x6f, 0x09,
+ 0x09, 0x09, 0x09, 0x74, 0x65, 0x78, 0x69, 0x6e, 0x66, 0x6f, 0x20, 0x74,
+ 0x65, 0x78, 0x69, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x74, 0x67, 0x69, 0x66, 0x09, 0x09,
+ 0x09, 0x09, 0x6f, 0x62, 0x6a, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x75, 0x73, 0x74, 0x61,
+ 0x72, 0x09, 0x09, 0x09, 0x09, 0x75, 0x73, 0x74, 0x61, 0x72, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78,
+ 0x2d, 0x77, 0x61, 0x69, 0x73, 0x2d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
+ 0x09, 0x09, 0x09, 0x73, 0x72, 0x63, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x78, 0x35, 0x30,
+ 0x39, 0x2d, 0x63, 0x61, 0x2d, 0x63, 0x65, 0x72, 0x74, 0x09, 0x09, 0x09,
+ 0x64, 0x65, 0x72, 0x20, 0x63, 0x72, 0x74, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x78, 0x66,
+ 0x69, 0x67, 0x09, 0x09, 0x09, 0x09, 0x66, 0x69, 0x67, 0x0a, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d,
+ 0x78, 0x6c, 0x69, 0x66, 0x66, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09,
+ 0x09, 0x78, 0x6c, 0x66, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x78, 0x70, 0x69, 0x6e, 0x73,
+ 0x74, 0x61, 0x6c, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x78, 0x70, 0x69, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x78, 0x2d, 0x78, 0x7a, 0x09, 0x09, 0x09, 0x09, 0x78, 0x7a, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78,
+ 0x2d, 0x7a, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x09, 0x09, 0x09,
+ 0x09, 0x7a, 0x31, 0x20, 0x7a, 0x32, 0x20, 0x7a, 0x33, 0x20, 0x7a, 0x34,
+ 0x20, 0x7a, 0x35, 0x20, 0x7a, 0x36, 0x20, 0x7a, 0x37, 0x20, 0x7a, 0x38,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x78, 0x34, 0x30, 0x30, 0x2d, 0x62, 0x70, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78,
+ 0x61, 0x6d, 0x6c, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x78,
+ 0x61, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x63, 0x61, 0x70, 0x2d, 0x61,
+ 0x74, 0x74, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x63, 0x61,
+ 0x70, 0x2d, 0x63, 0x61, 0x70, 0x73, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78,
+ 0x63, 0x61, 0x70, 0x2d, 0x64, 0x69, 0x66, 0x66, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x09, 0x09, 0x09, 0x78, 0x64, 0x66, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x63, 0x61,
+ 0x70, 0x2d, 0x65, 0x6c, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61,
+ 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78,
+ 0x63, 0x61, 0x70, 0x2d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2b, 0x78, 0x6d,
+ 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x63, 0x61, 0x70, 0x2d, 0x6e, 0x73, 0x2b,
+ 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x63, 0x6f, 0x6e, 0x2d, 0x63,
+ 0x6f, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x2d, 0x69, 0x6e,
+ 0x66, 0x6f, 0x2d, 0x64, 0x69, 0x66, 0x66, 0x2b, 0x78, 0x6d, 0x6c, 0x0a,
+ 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2f, 0x78, 0x63, 0x6f, 0x6e, 0x2d, 0x63, 0x6f, 0x6e, 0x66, 0x65,
+ 0x72, 0x65, 0x6e, 0x63, 0x65, 0x2d, 0x69, 0x6e, 0x66, 0x6f, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x78, 0x65, 0x6e, 0x63, 0x2b, 0x78, 0x6d, 0x6c, 0x09,
+ 0x09, 0x09, 0x09, 0x78, 0x65, 0x6e, 0x63, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x68, 0x74, 0x6d,
+ 0x6c, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x78, 0x68, 0x74,
+ 0x6d, 0x6c, 0x20, 0x78, 0x68, 0x74, 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70,
+ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x68, 0x74,
+ 0x6d, 0x6c, 0x2d, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x09, 0x78, 0x6d, 0x6c,
+ 0x20, 0x78, 0x73, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x6d, 0x6c, 0x2d, 0x64, 0x74, 0x64,
+ 0x09, 0x09, 0x09, 0x09, 0x64, 0x74, 0x64, 0x0a, 0x23, 0x20, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x6d,
+ 0x6c, 0x2d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2d, 0x70,
+ 0x61, 0x72, 0x73, 0x65, 0x64, 0x2d, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79,
+ 0x0a, 0x23, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x78, 0x6d, 0x70, 0x70, 0x2b, 0x78, 0x6d, 0x6c, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x78, 0x6f, 0x70, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x78,
+ 0x6f, 0x70, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2f, 0x78, 0x70, 0x72, 0x6f, 0x63, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x09, 0x09, 0x09, 0x09, 0x78, 0x70, 0x6c, 0x0a, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x73, 0x6c, 0x74,
+ 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x78, 0x73, 0x6c, 0x74,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x78, 0x73, 0x70, 0x66, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09,
+ 0x09, 0x78, 0x73, 0x70, 0x66, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x76, 0x2b, 0x78, 0x6d, 0x6c,
+ 0x09, 0x09, 0x09, 0x09, 0x6d, 0x78, 0x6d, 0x6c, 0x20, 0x78, 0x68, 0x76,
+ 0x6d, 0x6c, 0x20, 0x78, 0x76, 0x6d, 0x6c, 0x20, 0x78, 0x76, 0x6d, 0x0a,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x79, 0x61, 0x6e, 0x67, 0x09, 0x09, 0x09, 0x09, 0x79, 0x61, 0x6e, 0x67,
+ 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2f, 0x79, 0x69, 0x6e, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09,
+ 0x79, 0x69, 0x6e, 0x0a, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2f, 0x7a, 0x69, 0x70, 0x09, 0x09, 0x09, 0x09, 0x09,
+ 0x7a, 0x69, 0x70, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f,
+ 0x31, 0x64, 0x2d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6c, 0x65, 0x61, 0x76,
+ 0x65, 0x64, 0x2d, 0x70, 0x61, 0x72, 0x69, 0x74, 0x79, 0x66, 0x65, 0x63,
+ 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x33, 0x32, 0x6b,
+ 0x61, 0x64, 0x70, 0x63, 0x6d, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69,
+ 0x6f, 0x2f, 0x33, 0x67, 0x70, 0x70, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64,
+ 0x69, 0x6f, 0x2f, 0x33, 0x67, 0x70, 0x70, 0x32, 0x0a, 0x23, 0x20, 0x61,
+ 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x61, 0x63, 0x33, 0x0a, 0x61, 0x75, 0x64,
+ 0x69, 0x6f, 0x2f, 0x61, 0x64, 0x70, 0x63, 0x6d, 0x09, 0x09, 0x09, 0x09,
+ 0x09, 0x61, 0x64, 0x70, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f,
+ 0x2f, 0x61, 0x6d, 0x72, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f,
+ 0x2f, 0x61, 0x6d, 0x72, 0x2d, 0x77, 0x62, 0x0a, 0x23, 0x20, 0x61, 0x75,
+ 0x64, 0x69, 0x6f, 0x2f, 0x61, 0x6d, 0x72, 0x2d, 0x77, 0x62, 0x2b, 0x0a,
+ 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x61, 0x73, 0x63, 0x0a,
+ 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x61, 0x74, 0x72, 0x61,
+ 0x63, 0x2d, 0x61, 0x64, 0x76, 0x61, 0x6e, 0x63, 0x65, 0x64, 0x2d, 0x6c,
+ 0x6f, 0x73, 0x73, 0x6c, 0x65, 0x73, 0x73, 0x0a, 0x23, 0x20, 0x61, 0x75,
+ 0x64, 0x69, 0x6f, 0x2f, 0x61, 0x74, 0x72, 0x61, 0x63, 0x2d, 0x78, 0x0a,
+ 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x61, 0x74, 0x72, 0x61,
+ 0x63, 0x33, 0x0a, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x62, 0x61, 0x73,
+ 0x69, 0x63, 0x09, 0x09, 0x09, 0x09, 0x09, 0x61, 0x75, 0x20, 0x73, 0x6e,
+ 0x64, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x62, 0x76,
+ 0x31, 0x36, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x62,
+ 0x76, 0x33, 0x32, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f,
+ 0x63, 0x6c, 0x65, 0x61, 0x72, 0x6d, 0x6f, 0x64, 0x65, 0x0a, 0x23, 0x20,
+ 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x63, 0x6e, 0x0a, 0x23, 0x20, 0x61,
+ 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x64, 0x61, 0x74, 0x31, 0x32, 0x0a, 0x23,
+ 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x64, 0x6c, 0x73, 0x0a, 0x23,
+ 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x64, 0x73, 0x72, 0x2d, 0x65,
+ 0x73, 0x32, 0x30, 0x31, 0x31, 0x30, 0x38, 0x0a, 0x23, 0x20, 0x61, 0x75,
+ 0x64, 0x69, 0x6f, 0x2f, 0x64, 0x73, 0x72, 0x2d, 0x65, 0x73, 0x32, 0x30,
+ 0x32, 0x30, 0x35, 0x30, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f,
+ 0x2f, 0x64, 0x73, 0x72, 0x2d, 0x65, 0x73, 0x32, 0x30, 0x32, 0x32, 0x31,
+ 0x31, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x64, 0x73,
+ 0x72, 0x2d, 0x65, 0x73, 0x32, 0x30, 0x32, 0x32, 0x31, 0x32, 0x0a, 0x23,
+ 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x64, 0x76, 0x0a, 0x23, 0x20,
+ 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x64, 0x76, 0x69, 0x34, 0x0a, 0x23,
+ 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x65, 0x61, 0x63, 0x33, 0x0a,
+ 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x65, 0x76, 0x72, 0x63,
+ 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x65, 0x76, 0x72,
+ 0x63, 0x2d, 0x71, 0x63, 0x70, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69,
+ 0x6f, 0x2f, 0x65, 0x76, 0x72, 0x63, 0x30, 0x0a, 0x23, 0x20, 0x61, 0x75,
+ 0x64, 0x69, 0x6f, 0x2f, 0x65, 0x76, 0x72, 0x63, 0x31, 0x0a, 0x23, 0x20,
+ 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x65, 0x76, 0x72, 0x63, 0x62, 0x0a,
+ 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x65, 0x76, 0x72, 0x63,
+ 0x62, 0x30, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x65,
+ 0x76, 0x72, 0x63, 0x62, 0x31, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69,
+ 0x6f, 0x2f, 0x65, 0x76, 0x72, 0x63, 0x77, 0x62, 0x0a, 0x23, 0x20, 0x61,
+ 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x65, 0x76, 0x72, 0x63, 0x77, 0x62, 0x30,
+ 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x65, 0x76, 0x72,
+ 0x63, 0x77, 0x62, 0x31, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f,
+ 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x0a, 0x23, 0x20, 0x61,
+ 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x66, 0x77, 0x64, 0x72, 0x65, 0x64, 0x0a,
+ 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x67, 0x37, 0x31, 0x39,
+ 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x67, 0x37, 0x32,
+ 0x32, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x67, 0x37,
+ 0x32, 0x32, 0x31, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f,
+ 0x67, 0x37, 0x32, 0x33, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f,
+ 0x2f, 0x67, 0x37, 0x32, 0x36, 0x2d, 0x31, 0x36, 0x0a, 0x23, 0x20, 0x61,
+ 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x67, 0x37, 0x32, 0x36, 0x2d, 0x32, 0x34,
+ 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x67, 0x37, 0x32,
+ 0x36, 0x2d, 0x33, 0x32, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f,
+ 0x2f, 0x67, 0x37, 0x32, 0x36, 0x2d, 0x34, 0x30, 0x0a, 0x23, 0x20, 0x61,
+ 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x67, 0x37, 0x32, 0x38, 0x0a, 0x23, 0x20,
+ 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x67, 0x37, 0x32, 0x39, 0x0a, 0x23,
+ 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x67, 0x37, 0x32, 0x39, 0x31,
+ 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x67, 0x37, 0x32,
+ 0x39, 0x64, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x67,
+ 0x37, 0x32, 0x39, 0x65, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f,
+ 0x2f, 0x67, 0x73, 0x6d, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f,
+ 0x2f, 0x67, 0x73, 0x6d, 0x2d, 0x65, 0x66, 0x72, 0x0a, 0x23, 0x20, 0x61,
+ 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x67, 0x73, 0x6d, 0x2d, 0x68, 0x72, 0x2d,
+ 0x30, 0x38, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x69,
+ 0x6c, 0x62, 0x63, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f,
+ 0x69, 0x70, 0x2d, 0x6d, 0x72, 0x5f, 0x76, 0x32, 0x2e, 0x35, 0x0a, 0x23,
+ 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x69, 0x73, 0x61, 0x63, 0x0a,
+ 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x6c, 0x31, 0x36, 0x0a,
+ 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x6c, 0x32, 0x30, 0x0a,
+ 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x6c, 0x32, 0x34, 0x0a,
+ 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x6c, 0x38, 0x0a, 0x23,
+ 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x6c, 0x70, 0x63, 0x0a, 0x61,
+ 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x6d, 0x69, 0x64, 0x69, 0x09, 0x09, 0x09,
+ 0x09, 0x09, 0x6d, 0x69, 0x64, 0x20, 0x6d, 0x69, 0x64, 0x69, 0x20, 0x6b,
+ 0x61, 0x72, 0x20, 0x72, 0x6d, 0x69, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64,
+ 0x69, 0x6f, 0x2f, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x2d, 0x78, 0x6d,
+ 0x66, 0x0a, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x6d, 0x70, 0x34, 0x09,
+ 0x09, 0x09, 0x09, 0x09, 0x6d, 0x70, 0x34, 0x61, 0x0a, 0x23, 0x20, 0x61,
+ 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x6d, 0x70, 0x34, 0x61, 0x2d, 0x6c, 0x61,
+ 0x74, 0x6d, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x6d,
+ 0x70, 0x61, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x6d,
+ 0x70, 0x61, 0x2d, 0x72, 0x6f, 0x62, 0x75, 0x73, 0x74, 0x0a, 0x61, 0x75,
+ 0x64, 0x69, 0x6f, 0x2f, 0x6d, 0x70, 0x65, 0x67, 0x09, 0x09, 0x09, 0x09,
+ 0x09, 0x6d, 0x70, 0x67, 0x61, 0x20, 0x6d, 0x70, 0x32, 0x20, 0x6d, 0x70,
+ 0x32, 0x61, 0x20, 0x6d, 0x70, 0x33, 0x20, 0x6d, 0x32, 0x61, 0x20, 0x6d,
+ 0x33, 0x61, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x6d,
+ 0x70, 0x65, 0x67, 0x34, 0x2d, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63,
+ 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x6d, 0x75, 0x73,
+ 0x65, 0x70, 0x61, 0x63, 0x6b, 0x0a, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f,
+ 0x6f, 0x67, 0x67, 0x09, 0x09, 0x09, 0x09, 0x09, 0x6f, 0x67, 0x61, 0x20,
+ 0x6f, 0x67, 0x67, 0x20, 0x73, 0x70, 0x78, 0x0a, 0x23, 0x20, 0x61, 0x75,
+ 0x64, 0x69, 0x6f, 0x2f, 0x6f, 0x70, 0x75, 0x73, 0x0a, 0x23, 0x20, 0x61,
+ 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x70, 0x61, 0x72, 0x69, 0x74, 0x79, 0x66,
+ 0x65, 0x63, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x70,
+ 0x63, 0x6d, 0x61, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f,
+ 0x70, 0x63, 0x6d, 0x61, 0x2d, 0x77, 0x62, 0x0a, 0x23, 0x20, 0x61, 0x75,
+ 0x64, 0x69, 0x6f, 0x2f, 0x70, 0x63, 0x6d, 0x75, 0x2d, 0x77, 0x62, 0x0a,
+ 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x70, 0x63, 0x6d, 0x75,
+ 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x70, 0x72, 0x73,
+ 0x2e, 0x73, 0x69, 0x64, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f,
+ 0x2f, 0x71, 0x63, 0x65, 0x6c, 0x70, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64,
+ 0x69, 0x6f, 0x2f, 0x72, 0x65, 0x64, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64,
+ 0x69, 0x6f, 0x2f, 0x72, 0x74, 0x70, 0x2d, 0x65, 0x6e, 0x63, 0x2d, 0x61,
+ 0x65, 0x73, 0x63, 0x6d, 0x31, 0x32, 0x38, 0x0a, 0x23, 0x20, 0x61, 0x75,
+ 0x64, 0x69, 0x6f, 0x2f, 0x72, 0x74, 0x70, 0x2d, 0x6d, 0x69, 0x64, 0x69,
+ 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x72, 0x74, 0x78,
+ 0x0a, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x73, 0x33, 0x6d, 0x09, 0x09,
+ 0x09, 0x09, 0x09, 0x73, 0x33, 0x6d, 0x0a, 0x61, 0x75, 0x64, 0x69, 0x6f,
+ 0x2f, 0x73, 0x69, 0x6c, 0x6b, 0x09, 0x09, 0x09, 0x09, 0x09, 0x73, 0x69,
+ 0x6c, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x73, 0x6d,
+ 0x76, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x73, 0x6d,
+ 0x76, 0x30, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x73,
+ 0x6d, 0x76, 0x2d, 0x71, 0x63, 0x70, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64,
+ 0x69, 0x6f, 0x2f, 0x73, 0x70, 0x2d, 0x6d, 0x69, 0x64, 0x69, 0x0a, 0x23,
+ 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x73, 0x70, 0x65, 0x65, 0x78,
+ 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x74, 0x31, 0x34,
+ 0x30, 0x63, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x74,
+ 0x33, 0x38, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x74,
+ 0x65, 0x6c, 0x65, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x2d, 0x65, 0x76, 0x65,
+ 0x6e, 0x74, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x74,
+ 0x6f, 0x6e, 0x65, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f,
+ 0x75, 0x65, 0x6d, 0x63, 0x6c, 0x69, 0x70, 0x0a, 0x23, 0x20, 0x61, 0x75,
+ 0x64, 0x69, 0x6f, 0x2f, 0x75, 0x6c, 0x70, 0x66, 0x65, 0x63, 0x0a, 0x23,
+ 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x64, 0x76, 0x69, 0x0a,
+ 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6d, 0x72, 0x2d,
+ 0x77, 0x62, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x33, 0x67, 0x70, 0x70, 0x2e, 0x69, 0x75, 0x66, 0x70,
+ 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x34, 0x73, 0x62, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x6b, 0x6f,
+ 0x7a, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x63, 0x65, 0x6c, 0x70, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64,
+ 0x69, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x63, 0x69, 0x73, 0x63, 0x6f,
+ 0x2e, 0x6e, 0x73, 0x65, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x63, 0x6d, 0x6c, 0x65, 0x73, 0x2e, 0x72,
+ 0x61, 0x64, 0x69, 0x6f, 0x2d, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x0a,
+ 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x63, 0x6e, 0x73, 0x2e, 0x61, 0x6e, 0x70, 0x31, 0x0a, 0x23, 0x20, 0x61,
+ 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x63, 0x6e, 0x73,
+ 0x2e, 0x69, 0x6e, 0x66, 0x31, 0x0a, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x65, 0x63, 0x65, 0x2e, 0x61, 0x75, 0x64,
+ 0x69, 0x6f, 0x09, 0x09, 0x09, 0x09, 0x75, 0x76, 0x61, 0x20, 0x75, 0x76,
+ 0x76, 0x61, 0x0a, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x64, 0x69, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x2d, 0x77, 0x69, 0x6e,
+ 0x64, 0x73, 0x09, 0x09, 0x09, 0x09, 0x65, 0x6f, 0x6c, 0x0a, 0x23, 0x20,
+ 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x6c,
+ 0x6e, 0x61, 0x2e, 0x61, 0x64, 0x74, 0x73, 0x0a, 0x23, 0x20, 0x61, 0x75,
+ 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x6f, 0x6c, 0x62,
+ 0x79, 0x2e, 0x68, 0x65, 0x61, 0x61, 0x63, 0x2e, 0x31, 0x0a, 0x23, 0x20,
+ 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x6f,
+ 0x6c, 0x62, 0x79, 0x2e, 0x68, 0x65, 0x61, 0x61, 0x63, 0x2e, 0x32, 0x0a,
+ 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x64, 0x6f, 0x6c, 0x62, 0x79, 0x2e, 0x6d, 0x6c, 0x70, 0x0a, 0x23, 0x20,
+ 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x6f,
+ 0x6c, 0x62, 0x79, 0x2e, 0x6d, 0x70, 0x73, 0x0a, 0x23, 0x20, 0x61, 0x75,
+ 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x6f, 0x6c, 0x62,
+ 0x79, 0x2e, 0x70, 0x6c, 0x32, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69,
+ 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x6f, 0x6c, 0x62, 0x79, 0x2e,
+ 0x70, 0x6c, 0x32, 0x78, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x6f, 0x6c, 0x62, 0x79, 0x2e, 0x70,
+ 0x6c, 0x32, 0x7a, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x6f, 0x6c, 0x62, 0x79, 0x2e, 0x70, 0x75,
+ 0x6c, 0x73, 0x65, 0x2e, 0x31, 0x0a, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x72, 0x61, 0x09, 0x09, 0x09, 0x09, 0x09,
+ 0x64, 0x72, 0x61, 0x0a, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x64, 0x74, 0x73, 0x09, 0x09, 0x09, 0x09, 0x09, 0x64, 0x74,
+ 0x73, 0x0a, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x64, 0x74, 0x73, 0x2e, 0x68, 0x64, 0x09, 0x09, 0x09, 0x09, 0x64, 0x74,
+ 0x73, 0x68, 0x64, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x76, 0x62, 0x2e, 0x66, 0x69, 0x6c, 0x65,
+ 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x65, 0x76, 0x65, 0x72, 0x61, 0x64, 0x2e, 0x70, 0x6c, 0x6a, 0x0a,
+ 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x68, 0x6e, 0x73, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x0a, 0x61, 0x75,
+ 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6c, 0x75, 0x63, 0x65,
+ 0x6e, 0x74, 0x2e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x09, 0x09, 0x09, 0x09,
+ 0x6c, 0x76, 0x70, 0x0a, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x70, 0x6c, 0x61, 0x79, 0x72, 0x65, 0x61,
+ 0x64, 0x79, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x2e, 0x70, 0x79, 0x61,
+ 0x09, 0x09, 0x70, 0x79, 0x61, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69,
+ 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6e, 0x6f, 0x6b, 0x69, 0x61, 0x2e,
+ 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x2d, 0x78, 0x6d, 0x66, 0x0a, 0x23,
+ 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6e,
+ 0x6f, 0x72, 0x74, 0x65, 0x6c, 0x2e, 0x76, 0x62, 0x6b, 0x0a, 0x61, 0x75,
+ 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6e, 0x75, 0x65, 0x72,
+ 0x61, 0x2e, 0x65, 0x63, 0x65, 0x6c, 0x70, 0x34, 0x38, 0x30, 0x30, 0x09,
+ 0x09, 0x09, 0x65, 0x63, 0x65, 0x6c, 0x70, 0x34, 0x38, 0x30, 0x30, 0x0a,
+ 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6e, 0x75,
+ 0x65, 0x72, 0x61, 0x2e, 0x65, 0x63, 0x65, 0x6c, 0x70, 0x37, 0x34, 0x37,
+ 0x30, 0x09, 0x09, 0x09, 0x65, 0x63, 0x65, 0x6c, 0x70, 0x37, 0x34, 0x37,
+ 0x30, 0x0a, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x6e, 0x75, 0x65, 0x72, 0x61, 0x2e, 0x65, 0x63, 0x65, 0x6c, 0x70, 0x39,
+ 0x36, 0x30, 0x30, 0x09, 0x09, 0x09, 0x65, 0x63, 0x65, 0x6c, 0x70, 0x39,
+ 0x36, 0x30, 0x30, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x63, 0x74, 0x65, 0x6c, 0x2e, 0x73, 0x62,
+ 0x63, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x71, 0x63, 0x65, 0x6c, 0x70, 0x0a, 0x23, 0x20, 0x61, 0x75,
+ 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x72, 0x68, 0x65, 0x74,
+ 0x6f, 0x72, 0x65, 0x78, 0x2e, 0x33, 0x32, 0x6b, 0x61, 0x64, 0x70, 0x63,
+ 0x6d, 0x0a, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x72, 0x69, 0x70, 0x09, 0x09, 0x09, 0x09, 0x09, 0x72, 0x69, 0x70, 0x0a,
+ 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x73, 0x65, 0x61, 0x6c, 0x65, 0x64, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x2e,
+ 0x73, 0x6f, 0x66, 0x74, 0x73, 0x65, 0x61, 0x6c, 0x2e, 0x6d, 0x70, 0x65,
+ 0x67, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x76, 0x6d, 0x78, 0x2e, 0x63, 0x76, 0x73, 0x64, 0x0a, 0x23,
+ 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6f, 0x72, 0x62, 0x69,
+ 0x73, 0x0a, 0x23, 0x20, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x6f,
+ 0x72, 0x62, 0x69, 0x73, 0x2d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x0a,
+ 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x77, 0x65, 0x62, 0x6d, 0x09, 0x09,
+ 0x09, 0x09, 0x09, 0x77, 0x65, 0x62, 0x61, 0x0a, 0x61, 0x75, 0x64, 0x69,
+ 0x6f, 0x2f, 0x78, 0x2d, 0x61, 0x61, 0x63, 0x09, 0x09, 0x09, 0x09, 0x09,
+ 0x61, 0x61, 0x63, 0x0a, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x78, 0x2d,
+ 0x61, 0x69, 0x66, 0x66, 0x09, 0x09, 0x09, 0x09, 0x09, 0x61, 0x69, 0x66,
+ 0x20, 0x61, 0x69, 0x66, 0x66, 0x20, 0x61, 0x69, 0x66, 0x63, 0x0a, 0x61,
+ 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x78, 0x2d, 0x63, 0x61, 0x66, 0x09, 0x09,
+ 0x09, 0x09, 0x09, 0x63, 0x61, 0x66, 0x0a, 0x61, 0x75, 0x64, 0x69, 0x6f,
+ 0x2f, 0x78, 0x2d, 0x66, 0x6c, 0x61, 0x63, 0x09, 0x09, 0x09, 0x09, 0x09,
+ 0x66, 0x6c, 0x61, 0x63, 0x0a, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x78,
+ 0x2d, 0x6d, 0x61, 0x74, 0x72, 0x6f, 0x73, 0x6b, 0x61, 0x09, 0x09, 0x09,
+ 0x09, 0x6d, 0x6b, 0x61, 0x0a, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x78,
+ 0x2d, 0x6d, 0x70, 0x65, 0x67, 0x75, 0x72, 0x6c, 0x09, 0x09, 0x09, 0x09,
+ 0x09, 0x6d, 0x33, 0x75, 0x0a, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x78,
+ 0x2d, 0x6d, 0x73, 0x2d, 0x77, 0x61, 0x78, 0x09, 0x09, 0x09, 0x09, 0x09,
+ 0x77, 0x61, 0x78, 0x0a, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x78, 0x2d,
+ 0x6d, 0x73, 0x2d, 0x77, 0x6d, 0x61, 0x09, 0x09, 0x09, 0x09, 0x09, 0x77,
+ 0x6d, 0x61, 0x0a, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x78, 0x2d, 0x70,
+ 0x6e, 0x2d, 0x72, 0x65, 0x61, 0x6c, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x09,
+ 0x09, 0x09, 0x09, 0x72, 0x61, 0x6d, 0x20, 0x72, 0x61, 0x0a, 0x61, 0x75,
+ 0x64, 0x69, 0x6f, 0x2f, 0x78, 0x2d, 0x70, 0x6e, 0x2d, 0x72, 0x65, 0x61,
+ 0x6c, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2d, 0x70, 0x6c, 0x75, 0x67, 0x69,
+ 0x6e, 0x09, 0x09, 0x09, 0x72, 0x6d, 0x70, 0x0a, 0x23, 0x20, 0x61, 0x75,
+ 0x64, 0x69, 0x6f, 0x2f, 0x78, 0x2d, 0x74, 0x74, 0x61, 0x0a, 0x61, 0x75,
+ 0x64, 0x69, 0x6f, 0x2f, 0x78, 0x2d, 0x77, 0x61, 0x76, 0x09, 0x09, 0x09,
+ 0x09, 0x09, 0x77, 0x61, 0x76, 0x0a, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x2f,
+ 0x78, 0x6d, 0x09, 0x09, 0x09, 0x09, 0x09, 0x78, 0x6d, 0x0a, 0x63, 0x68,
+ 0x65, 0x6d, 0x69, 0x63, 0x61, 0x6c, 0x2f, 0x78, 0x2d, 0x63, 0x64, 0x78,
+ 0x09, 0x09, 0x09, 0x09, 0x09, 0x63, 0x64, 0x78, 0x0a, 0x63, 0x68, 0x65,
+ 0x6d, 0x69, 0x63, 0x61, 0x6c, 0x2f, 0x78, 0x2d, 0x63, 0x69, 0x66, 0x09,
+ 0x09, 0x09, 0x09, 0x09, 0x63, 0x69, 0x66, 0x0a, 0x63, 0x68, 0x65, 0x6d,
+ 0x69, 0x63, 0x61, 0x6c, 0x2f, 0x78, 0x2d, 0x63, 0x6d, 0x64, 0x66, 0x09,
+ 0x09, 0x09, 0x09, 0x09, 0x63, 0x6d, 0x64, 0x66, 0x0a, 0x63, 0x68, 0x65,
+ 0x6d, 0x69, 0x63, 0x61, 0x6c, 0x2f, 0x78, 0x2d, 0x63, 0x6d, 0x6c, 0x09,
+ 0x09, 0x09, 0x09, 0x09, 0x63, 0x6d, 0x6c, 0x0a, 0x63, 0x68, 0x65, 0x6d,
+ 0x69, 0x63, 0x61, 0x6c, 0x2f, 0x78, 0x2d, 0x63, 0x73, 0x6d, 0x6c, 0x09,
+ 0x09, 0x09, 0x09, 0x09, 0x63, 0x73, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x63,
+ 0x68, 0x65, 0x6d, 0x69, 0x63, 0x61, 0x6c, 0x2f, 0x78, 0x2d, 0x70, 0x64,
+ 0x62, 0x0a, 0x63, 0x68, 0x65, 0x6d, 0x69, 0x63, 0x61, 0x6c, 0x2f, 0x78,
+ 0x2d, 0x78, 0x79, 0x7a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x78, 0x79, 0x7a,
+ 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x62, 0x6d, 0x70, 0x09, 0x09,
+ 0x09, 0x09, 0x09, 0x62, 0x6d, 0x70, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65,
+ 0x2f, 0x63, 0x67, 0x6d, 0x09, 0x09, 0x09, 0x09, 0x09, 0x63, 0x67, 0x6d,
+ 0x0a, 0x23, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x65, 0x78, 0x61,
+ 0x6d, 0x70, 0x6c, 0x65, 0x0a, 0x23, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65,
+ 0x2f, 0x66, 0x69, 0x74, 0x73, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f,
+ 0x67, 0x33, 0x66, 0x61, 0x78, 0x09, 0x09, 0x09, 0x09, 0x09, 0x67, 0x33,
+ 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x67, 0x69, 0x66, 0x09, 0x09,
+ 0x09, 0x09, 0x09, 0x67, 0x69, 0x66, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65,
+ 0x2f, 0x69, 0x65, 0x66, 0x09, 0x09, 0x09, 0x09, 0x09, 0x69, 0x65, 0x66,
+ 0x0a, 0x23, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x6a, 0x70, 0x32,
+ 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x6a, 0x70, 0x65, 0x67, 0x09,
+ 0x09, 0x09, 0x09, 0x09, 0x6a, 0x70, 0x65, 0x67, 0x20, 0x6a, 0x70, 0x67,
+ 0x20, 0x6a, 0x70, 0x65, 0x0a, 0x23, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65,
+ 0x2f, 0x6a, 0x70, 0x6d, 0x0a, 0x23, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65,
+ 0x2f, 0x6a, 0x70, 0x78, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x6b,
+ 0x74, 0x78, 0x09, 0x09, 0x09, 0x09, 0x09, 0x6b, 0x74, 0x78, 0x0a, 0x23,
+ 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x6e, 0x61, 0x70, 0x6c, 0x70,
+ 0x73, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x70, 0x6e, 0x67, 0x09,
+ 0x09, 0x09, 0x09, 0x09, 0x70, 0x6e, 0x67, 0x0a, 0x69, 0x6d, 0x61, 0x67,
+ 0x65, 0x2f, 0x70, 0x72, 0x73, 0x2e, 0x62, 0x74, 0x69, 0x66, 0x09, 0x09,
+ 0x09, 0x09, 0x09, 0x62, 0x74, 0x69, 0x66, 0x0a, 0x23, 0x20, 0x69, 0x6d,
+ 0x61, 0x67, 0x65, 0x2f, 0x70, 0x72, 0x73, 0x2e, 0x70, 0x74, 0x69, 0x0a,
+ 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x73, 0x67, 0x69, 0x09, 0x09, 0x09,
+ 0x09, 0x09, 0x73, 0x67, 0x69, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f,
+ 0x73, 0x76, 0x67, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x09,
+ 0x73, 0x76, 0x67, 0x20, 0x73, 0x76, 0x67, 0x7a, 0x0a, 0x23, 0x20, 0x69,
+ 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x74, 0x33, 0x38, 0x0a, 0x69, 0x6d, 0x61,
+ 0x67, 0x65, 0x2f, 0x74, 0x69, 0x66, 0x66, 0x09, 0x09, 0x09, 0x09, 0x09,
+ 0x74, 0x69, 0x66, 0x66, 0x20, 0x74, 0x69, 0x66, 0x0a, 0x23, 0x20, 0x69,
+ 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x74, 0x69, 0x66, 0x66, 0x2d, 0x66, 0x78,
+ 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x61,
+ 0x64, 0x6f, 0x62, 0x65, 0x2e, 0x70, 0x68, 0x6f, 0x74, 0x6f, 0x73, 0x68,
+ 0x6f, 0x70, 0x09, 0x09, 0x09, 0x70, 0x73, 0x64, 0x0a, 0x23, 0x20, 0x69,
+ 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x63, 0x6e, 0x73,
+ 0x2e, 0x69, 0x6e, 0x66, 0x32, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x65, 0x63, 0x65, 0x2e, 0x67, 0x72, 0x61,
+ 0x70, 0x68, 0x69, 0x63, 0x09, 0x09, 0x09, 0x09, 0x75, 0x76, 0x69, 0x20,
+ 0x75, 0x76, 0x76, 0x69, 0x20, 0x75, 0x76, 0x67, 0x20, 0x75, 0x76, 0x76,
+ 0x67, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x64, 0x76, 0x62, 0x2e, 0x73, 0x75, 0x62, 0x74, 0x69, 0x74, 0x6c, 0x65,
+ 0x09, 0x09, 0x09, 0x09, 0x73, 0x75, 0x62, 0x0a, 0x69, 0x6d, 0x61, 0x67,
+ 0x65, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x6a, 0x76, 0x75, 0x09, 0x09,
+ 0x09, 0x09, 0x09, 0x64, 0x6a, 0x76, 0x75, 0x20, 0x64, 0x6a, 0x76, 0x0a,
+ 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x77,
+ 0x67, 0x09, 0x09, 0x09, 0x09, 0x09, 0x64, 0x77, 0x67, 0x0a, 0x69, 0x6d,
+ 0x61, 0x67, 0x65, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x78, 0x66, 0x09,
+ 0x09, 0x09, 0x09, 0x09, 0x64, 0x78, 0x66, 0x0a, 0x69, 0x6d, 0x61, 0x67,
+ 0x65, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x66, 0x61, 0x73, 0x74, 0x62, 0x69,
+ 0x64, 0x73, 0x68, 0x65, 0x65, 0x74, 0x09, 0x09, 0x09, 0x09, 0x66, 0x62,
+ 0x73, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x66, 0x70, 0x78, 0x09, 0x09, 0x09, 0x09, 0x09, 0x66, 0x70, 0x78, 0x0a,
+ 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x66, 0x73,
+ 0x74, 0x09, 0x09, 0x09, 0x09, 0x09, 0x66, 0x73, 0x74, 0x0a, 0x69, 0x6d,
+ 0x61, 0x67, 0x65, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x66, 0x75, 0x6a, 0x69,
+ 0x78, 0x65, 0x72, 0x6f, 0x78, 0x2e, 0x65, 0x64, 0x6d, 0x69, 0x63, 0x73,
+ 0x2d, 0x6d, 0x6d, 0x72, 0x09, 0x09, 0x09, 0x6d, 0x6d, 0x72, 0x0a, 0x69,
+ 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x66, 0x75, 0x6a,
+ 0x69, 0x78, 0x65, 0x72, 0x6f, 0x78, 0x2e, 0x65, 0x64, 0x6d, 0x69, 0x63,
+ 0x73, 0x2d, 0x72, 0x6c, 0x63, 0x09, 0x09, 0x09, 0x72, 0x6c, 0x63, 0x0a,
+ 0x23, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69,
+ 0x63, 0x73, 0x2e, 0x70, 0x67, 0x62, 0x0a, 0x23, 0x20, 0x69, 0x6d, 0x61,
+ 0x67, 0x65, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f,
+ 0x73, 0x6f, 0x66, 0x74, 0x2e, 0x69, 0x63, 0x6f, 0x6e, 0x0a, 0x23, 0x20,
+ 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x69,
+ 0x78, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x6d, 0x73, 0x2d, 0x6d, 0x6f, 0x64, 0x69, 0x09, 0x09, 0x09, 0x09, 0x6d,
+ 0x64, 0x69, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x6d, 0x73, 0x2d, 0x70, 0x68, 0x6f, 0x74, 0x6f, 0x09, 0x09, 0x09,
+ 0x09, 0x77, 0x64, 0x70, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x6e, 0x65, 0x74, 0x2d, 0x66, 0x70, 0x78, 0x09, 0x09,
+ 0x09, 0x09, 0x6e, 0x70, 0x78, 0x0a, 0x23, 0x20, 0x69, 0x6d, 0x61, 0x67,
+ 0x65, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x72, 0x61, 0x64, 0x69, 0x61, 0x6e,
+ 0x63, 0x65, 0x0a, 0x23, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x73, 0x65, 0x61, 0x6c, 0x65, 0x64, 0x2e, 0x70, 0x6e,
+ 0x67, 0x0a, 0x23, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x73, 0x65, 0x61, 0x6c, 0x65, 0x64, 0x6d, 0x65, 0x64, 0x69,
+ 0x61, 0x2e, 0x73, 0x6f, 0x66, 0x74, 0x73, 0x65, 0x61, 0x6c, 0x2e, 0x67,
+ 0x69, 0x66, 0x0a, 0x23, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x73, 0x65, 0x61, 0x6c, 0x65, 0x64, 0x6d, 0x65, 0x64,
+ 0x69, 0x61, 0x2e, 0x73, 0x6f, 0x66, 0x74, 0x73, 0x65, 0x61, 0x6c, 0x2e,
+ 0x6a, 0x70, 0x67, 0x0a, 0x23, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x76, 0x66, 0x0a, 0x69, 0x6d, 0x61, 0x67,
+ 0x65, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x77, 0x61, 0x70, 0x2e, 0x77, 0x62,
+ 0x6d, 0x70, 0x09, 0x09, 0x09, 0x09, 0x77, 0x62, 0x6d, 0x70, 0x0a, 0x69,
+ 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x78, 0x69, 0x66,
+ 0x66, 0x09, 0x09, 0x09, 0x09, 0x09, 0x78, 0x69, 0x66, 0x0a, 0x69, 0x6d,
+ 0x61, 0x67, 0x65, 0x2f, 0x77, 0x65, 0x62, 0x70, 0x09, 0x09, 0x09, 0x09,
+ 0x09, 0x77, 0x65, 0x62, 0x70, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f,
+ 0x78, 0x2d, 0x33, 0x64, 0x73, 0x09, 0x09, 0x09, 0x09, 0x09, 0x33, 0x64,
+ 0x73, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x78, 0x2d, 0x63, 0x6d,
+ 0x75, 0x2d, 0x72, 0x61, 0x73, 0x74, 0x65, 0x72, 0x09, 0x09, 0x09, 0x09,
+ 0x72, 0x61, 0x73, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x78, 0x2d,
+ 0x63, 0x6d, 0x78, 0x09, 0x09, 0x09, 0x09, 0x09, 0x63, 0x6d, 0x78, 0x0a,
+ 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x78, 0x2d, 0x66, 0x72, 0x65, 0x65,
+ 0x68, 0x61, 0x6e, 0x64, 0x09, 0x09, 0x09, 0x09, 0x66, 0x68, 0x20, 0x66,
+ 0x68, 0x63, 0x20, 0x66, 0x68, 0x34, 0x20, 0x66, 0x68, 0x35, 0x20, 0x66,
+ 0x68, 0x37, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x78, 0x2d, 0x69,
+ 0x63, 0x6f, 0x6e, 0x09, 0x09, 0x09, 0x09, 0x09, 0x69, 0x63, 0x6f, 0x0a,
+ 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x78, 0x2d, 0x6d, 0x72, 0x73, 0x69,
+ 0x64, 0x2d, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x09, 0x09, 0x09, 0x09, 0x73,
+ 0x69, 0x64, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x78, 0x2d, 0x70,
+ 0x63, 0x78, 0x09, 0x09, 0x09, 0x09, 0x09, 0x70, 0x63, 0x78, 0x0a, 0x69,
+ 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x78, 0x2d, 0x70, 0x69, 0x63, 0x74, 0x09,
+ 0x09, 0x09, 0x09, 0x09, 0x70, 0x69, 0x63, 0x20, 0x70, 0x63, 0x74, 0x0a,
+ 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x78, 0x2d, 0x70, 0x6f, 0x72, 0x74,
+ 0x61, 0x62, 0x6c, 0x65, 0x2d, 0x61, 0x6e, 0x79, 0x6d, 0x61, 0x70, 0x09,
+ 0x09, 0x09, 0x09, 0x70, 0x6e, 0x6d, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65,
+ 0x2f, 0x78, 0x2d, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2d,
+ 0x62, 0x69, 0x74, 0x6d, 0x61, 0x70, 0x09, 0x09, 0x09, 0x09, 0x70, 0x62,
+ 0x6d, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x78, 0x2d, 0x70, 0x6f,
+ 0x72, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2d, 0x67, 0x72, 0x61, 0x79, 0x6d,
+ 0x61, 0x70, 0x09, 0x09, 0x09, 0x70, 0x67, 0x6d, 0x0a, 0x69, 0x6d, 0x61,
+ 0x67, 0x65, 0x2f, 0x78, 0x2d, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x62, 0x6c,
+ 0x65, 0x2d, 0x70, 0x69, 0x78, 0x6d, 0x61, 0x70, 0x09, 0x09, 0x09, 0x09,
+ 0x70, 0x70, 0x6d, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x78, 0x2d,
+ 0x72, 0x67, 0x62, 0x09, 0x09, 0x09, 0x09, 0x09, 0x72, 0x67, 0x62, 0x0a,
+ 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x78, 0x2d, 0x74, 0x67, 0x61, 0x09,
+ 0x09, 0x09, 0x09, 0x09, 0x74, 0x67, 0x61, 0x0a, 0x69, 0x6d, 0x61, 0x67,
+ 0x65, 0x2f, 0x78, 0x2d, 0x78, 0x62, 0x69, 0x74, 0x6d, 0x61, 0x70, 0x09,
+ 0x09, 0x09, 0x09, 0x09, 0x78, 0x62, 0x6d, 0x0a, 0x69, 0x6d, 0x61, 0x67,
+ 0x65, 0x2f, 0x78, 0x2d, 0x78, 0x70, 0x69, 0x78, 0x6d, 0x61, 0x70, 0x09,
+ 0x09, 0x09, 0x09, 0x09, 0x78, 0x70, 0x6d, 0x0a, 0x69, 0x6d, 0x61, 0x67,
+ 0x65, 0x2f, 0x78, 0x2d, 0x78, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x64,
+ 0x75, 0x6d, 0x70, 0x09, 0x09, 0x09, 0x09, 0x78, 0x77, 0x64, 0x0a, 0x23,
+ 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2f, 0x63, 0x70, 0x69,
+ 0x6d, 0x0a, 0x23, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2f,
+ 0x64, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x2d, 0x73, 0x74, 0x61,
+ 0x74, 0x75, 0x73, 0x0a, 0x23, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
+ 0x65, 0x2f, 0x64, 0x69, 0x73, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2d, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x0a, 0x23, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
+ 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x0a, 0x23, 0x20, 0x6d,
+ 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x72,
+ 0x6e, 0x61, 0x6c, 0x2d, 0x62, 0x6f, 0x64, 0x79, 0x0a, 0x23, 0x20, 0x6d,
+ 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2f, 0x66, 0x65, 0x65, 0x64, 0x62,
+ 0x61, 0x63, 0x6b, 0x2d, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x0a, 0x23,
+ 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2f, 0x67, 0x6c, 0x6f,
+ 0x62, 0x61, 0x6c, 0x0a, 0x23, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
+ 0x65, 0x2f, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2d, 0x64, 0x65, 0x6c,
+ 0x69, 0x76, 0x65, 0x72, 0x79, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73,
+ 0x0a, 0x23, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2f, 0x67,
+ 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2d, 0x64, 0x69, 0x73, 0x70, 0x6f, 0x73,
+ 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2d, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x23, 0x20, 0x6d, 0x65, 0x73,
+ 0x73, 0x61, 0x67, 0x65, 0x2f, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2d,
+ 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x0a, 0x23, 0x20, 0x6d, 0x65,
+ 0x73, 0x73, 0x61, 0x67, 0x65, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x0a, 0x23,
+ 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2f, 0x69, 0x6d, 0x64,
+ 0x6e, 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x6d, 0x65, 0x73, 0x73,
+ 0x61, 0x67, 0x65, 0x2f, 0x6e, 0x65, 0x77, 0x73, 0x0a, 0x23, 0x20, 0x6d,
+ 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x69,
+ 0x61, 0x6c, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2f, 0x72,
+ 0x66, 0x63, 0x38, 0x32, 0x32, 0x09, 0x09, 0x09, 0x09, 0x09, 0x65, 0x6d,
+ 0x6c, 0x20, 0x6d, 0x69, 0x6d, 0x65, 0x0a, 0x23, 0x20, 0x6d, 0x65, 0x73,
+ 0x73, 0x61, 0x67, 0x65, 0x2f, 0x73, 0x2d, 0x68, 0x74, 0x74, 0x70, 0x0a,
+ 0x23, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2f, 0x73, 0x69,
+ 0x70, 0x0a, 0x23, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2f,
+ 0x73, 0x69, 0x70, 0x66, 0x72, 0x61, 0x67, 0x0a, 0x23, 0x20, 0x6d, 0x65,
+ 0x73, 0x73, 0x61, 0x67, 0x65, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x69,
+ 0x6e, 0x67, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x0a, 0x23, 0x20,
+ 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x73, 0x69, 0x2e, 0x73, 0x69, 0x6d, 0x70, 0x0a, 0x23, 0x20, 0x6d, 0x6f,
+ 0x64, 0x65, 0x6c, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x0a,
+ 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x69, 0x67, 0x65, 0x73, 0x09, 0x09,
+ 0x09, 0x09, 0x09, 0x69, 0x67, 0x73, 0x20, 0x69, 0x67, 0x65, 0x73, 0x0a,
+ 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x09, 0x09,
+ 0x09, 0x09, 0x09, 0x6d, 0x73, 0x68, 0x20, 0x6d, 0x65, 0x73, 0x68, 0x20,
+ 0x73, 0x69, 0x6c, 0x6f, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x64, 0x61, 0x2b, 0x78,
+ 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x64, 0x61, 0x65, 0x0a, 0x6d, 0x6f,
+ 0x64, 0x65, 0x6c, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x77, 0x66, 0x09,
+ 0x09, 0x09, 0x09, 0x09, 0x64, 0x77, 0x66, 0x0a, 0x23, 0x20, 0x6d, 0x6f,
+ 0x64, 0x65, 0x6c, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x66, 0x6c, 0x61, 0x74,
+ 0x6c, 0x61, 0x6e, 0x64, 0x2e, 0x33, 0x64, 0x6d, 0x6c, 0x0a, 0x6d, 0x6f,
+ 0x64, 0x65, 0x6c, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x67, 0x64, 0x6c, 0x09,
+ 0x09, 0x09, 0x09, 0x09, 0x67, 0x64, 0x6c, 0x0a, 0x23, 0x20, 0x6d, 0x6f,
+ 0x64, 0x65, 0x6c, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x67, 0x73, 0x2d, 0x67,
+ 0x64, 0x6c, 0x0a, 0x23, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x67, 0x73, 0x2e, 0x67, 0x64, 0x6c, 0x0a, 0x6d, 0x6f,
+ 0x64, 0x65, 0x6c, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x67, 0x74, 0x77, 0x09,
+ 0x09, 0x09, 0x09, 0x09, 0x67, 0x74, 0x77, 0x0a, 0x23, 0x20, 0x6d, 0x6f,
+ 0x64, 0x65, 0x6c, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x6f, 0x6d, 0x6c,
+ 0x2b, 0x78, 0x6d, 0x6c, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x6d, 0x74, 0x73, 0x09, 0x09, 0x09, 0x09, 0x09, 0x6d,
+ 0x74, 0x73, 0x0a, 0x23, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x70, 0x61, 0x72, 0x61, 0x73, 0x6f, 0x6c, 0x69, 0x64,
+ 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6d, 0x69, 0x74, 0x2e, 0x62, 0x69,
+ 0x6e, 0x61, 0x72, 0x79, 0x0a, 0x23, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x70, 0x61, 0x72, 0x61, 0x73, 0x6f, 0x6c,
+ 0x69, 0x64, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6d, 0x69, 0x74, 0x2e,
+ 0x74, 0x65, 0x78, 0x74, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x76, 0x74, 0x75, 0x09, 0x09, 0x09, 0x09, 0x09, 0x76,
+ 0x74, 0x75, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x76, 0x72, 0x6d,
+ 0x6c, 0x09, 0x09, 0x09, 0x09, 0x09, 0x77, 0x72, 0x6c, 0x20, 0x76, 0x72,
+ 0x6d, 0x6c, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x78, 0x33, 0x64,
+ 0x2b, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x09, 0x09, 0x09, 0x09, 0x78,
+ 0x33, 0x64, 0x62, 0x20, 0x78, 0x33, 0x64, 0x62, 0x7a, 0x0a, 0x6d, 0x6f,
+ 0x64, 0x65, 0x6c, 0x2f, 0x78, 0x33, 0x64, 0x2b, 0x76, 0x72, 0x6d, 0x6c,
+ 0x09, 0x09, 0x09, 0x09, 0x09, 0x78, 0x33, 0x64, 0x76, 0x20, 0x78, 0x33,
+ 0x64, 0x76, 0x7a, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x78, 0x33,
+ 0x64, 0x2b, 0x78, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x09, 0x78, 0x33,
+ 0x64, 0x20, 0x78, 0x33, 0x64, 0x7a, 0x0a, 0x23, 0x20, 0x6d, 0x75, 0x6c,
+ 0x74, 0x69, 0x70, 0x61, 0x72, 0x74, 0x2f, 0x61, 0x6c, 0x74, 0x65, 0x72,
+ 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x0a, 0x23, 0x20, 0x6d, 0x75, 0x6c,
+ 0x74, 0x69, 0x70, 0x61, 0x72, 0x74, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x65,
+ 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x0a, 0x23, 0x20, 0x6d, 0x75, 0x6c,
+ 0x74, 0x69, 0x70, 0x61, 0x72, 0x74, 0x2f, 0x62, 0x79, 0x74, 0x65, 0x72,
+ 0x61, 0x6e, 0x67, 0x65, 0x73, 0x0a, 0x23, 0x20, 0x6d, 0x75, 0x6c, 0x74,
+ 0x69, 0x70, 0x61, 0x72, 0x74, 0x2f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74,
+ 0x0a, 0x23, 0x20, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x61, 0x72, 0x74,
+ 0x2f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x0a, 0x23,
+ 0x20, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x61, 0x72, 0x74, 0x2f, 0x65,
+ 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x0a, 0x23, 0x20, 0x6d, 0x75, 0x6c,
+ 0x74, 0x69, 0x70, 0x61, 0x72, 0x74, 0x2f, 0x66, 0x6f, 0x72, 0x6d, 0x2d,
+ 0x64, 0x61, 0x74, 0x61, 0x0a, 0x23, 0x20, 0x6d, 0x75, 0x6c, 0x74, 0x69,
+ 0x70, 0x61, 0x72, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2d,
+ 0x73, 0x65, 0x74, 0x0a, 0x23, 0x20, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70,
+ 0x61, 0x72, 0x74, 0x2f, 0x6d, 0x69, 0x78, 0x65, 0x64, 0x0a, 0x23, 0x20,
+ 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x61, 0x72, 0x74, 0x2f, 0x70, 0x61,
+ 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x0a, 0x23, 0x20, 0x6d, 0x75, 0x6c,
+ 0x74, 0x69, 0x70, 0x61, 0x72, 0x74, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x74,
+ 0x65, 0x64, 0x0a, 0x23, 0x20, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x61,
+ 0x72, 0x74, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x0a, 0x23, 0x20,
+ 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x61, 0x72, 0x74, 0x2f, 0x73, 0x69,
+ 0x67, 0x6e, 0x65, 0x64, 0x0a, 0x23, 0x20, 0x6d, 0x75, 0x6c, 0x74, 0x69,
+ 0x70, 0x61, 0x72, 0x74, 0x2f, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x2d, 0x6d,
+ 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x0a, 0x23, 0x20, 0x74, 0x65, 0x78,
+ 0x74, 0x2f, 0x31, 0x64, 0x2d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6c, 0x65,
+ 0x61, 0x76, 0x65, 0x64, 0x2d, 0x70, 0x61, 0x72, 0x69, 0x74, 0x79, 0x66,
+ 0x65, 0x63, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x63, 0x61, 0x63, 0x68,
+ 0x65, 0x2d, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x09, 0x09,
+ 0x09, 0x09, 0x61, 0x70, 0x70, 0x63, 0x61, 0x63, 0x68, 0x65, 0x0a, 0x74,
+ 0x65, 0x78, 0x74, 0x2f, 0x63, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72,
+ 0x09, 0x09, 0x09, 0x09, 0x09, 0x69, 0x63, 0x73, 0x20, 0x69, 0x66, 0x62,
+ 0x0a, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x63, 0x73, 0x73, 0x09, 0x09, 0x09,
+ 0x09, 0x09, 0x63, 0x73, 0x73, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x63,
+ 0x73, 0x76, 0x09, 0x09, 0x09, 0x09, 0x09, 0x63, 0x73, 0x76, 0x0a, 0x23,
+ 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74,
+ 0x6f, 0x72, 0x79, 0x0a, 0x23, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x64,
+ 0x6e, 0x73, 0x0a, 0x23, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x65, 0x63,
+ 0x6d, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x0a, 0x23, 0x20, 0x74,
+ 0x65, 0x78, 0x74, 0x2f, 0x65, 0x6e, 0x72, 0x69, 0x63, 0x68, 0x65, 0x64,
+ 0x0a, 0x23, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x65, 0x78, 0x61, 0x6d,
+ 0x70, 0x6c, 0x65, 0x0a, 0x23, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x66,
+ 0x77, 0x64, 0x72, 0x65, 0x64, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x68,
+ 0x74, 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x09, 0x68, 0x74, 0x6d, 0x6c,
+ 0x20, 0x68, 0x74, 0x6d, 0x0a, 0x23, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f,
+ 0x6a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x0a, 0x74,
+ 0x65, 0x78, 0x74, 0x2f, 0x6e, 0x33, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09,
+ 0x6e, 0x33, 0x0a, 0x23, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x70, 0x61,
+ 0x72, 0x69, 0x74, 0x79, 0x66, 0x65, 0x63, 0x0a, 0x74, 0x65, 0x78, 0x74,
+ 0x2f, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x09, 0x09, 0x09, 0x09, 0x09, 0x74,
+ 0x78, 0x74, 0x20, 0x74, 0x65, 0x78, 0x74, 0x20, 0x63, 0x6f, 0x6e, 0x66,
+ 0x20, 0x64, 0x65, 0x66, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6c, 0x6f,
+ 0x67, 0x20, 0x69, 0x6e, 0x0a, 0x23, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f,
+ 0x70, 0x72, 0x73, 0x2e, 0x66, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x73, 0x74,
+ 0x65, 0x69, 0x6e, 0x2e, 0x72, 0x73, 0x74, 0x0a, 0x74, 0x65, 0x78, 0x74,
+ 0x2f, 0x70, 0x72, 0x73, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x2e, 0x74,
+ 0x61, 0x67, 0x09, 0x09, 0x09, 0x09, 0x64, 0x73, 0x63, 0x0a, 0x23, 0x20,
+ 0x74, 0x65, 0x78, 0x74, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x72, 0x61, 0x64,
+ 0x69, 0x73, 0x79, 0x73, 0x2e, 0x6d, 0x73, 0x6d, 0x6c, 0x2d, 0x62, 0x61,
+ 0x73, 0x69, 0x63, 0x2d, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x0a, 0x23,
+ 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x72, 0x65, 0x64, 0x0a, 0x23, 0x20,
+ 0x74, 0x65, 0x78, 0x74, 0x2f, 0x72, 0x66, 0x63, 0x38, 0x32, 0x32, 0x2d,
+ 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x0a, 0x74, 0x65, 0x78, 0x74,
+ 0x2f, 0x72, 0x69, 0x63, 0x68, 0x74, 0x65, 0x78, 0x74, 0x09, 0x09, 0x09,
+ 0x09, 0x09, 0x72, 0x74, 0x78, 0x0a, 0x23, 0x20, 0x74, 0x65, 0x78, 0x74,
+ 0x2f, 0x72, 0x74, 0x66, 0x0a, 0x23, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f,
+ 0x72, 0x74, 0x70, 0x2d, 0x65, 0x6e, 0x63, 0x2d, 0x61, 0x65, 0x73, 0x63,
+ 0x6d, 0x31, 0x32, 0x38, 0x0a, 0x23, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f,
+ 0x72, 0x74, 0x78, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x73, 0x67, 0x6d,
+ 0x6c, 0x09, 0x09, 0x09, 0x09, 0x09, 0x73, 0x67, 0x6d, 0x6c, 0x20, 0x73,
+ 0x67, 0x6d, 0x0a, 0x23, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x74, 0x31,
+ 0x34, 0x30, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x74, 0x61, 0x62, 0x2d,
+ 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x76, 0x61,
+ 0x6c, 0x75, 0x65, 0x73, 0x09, 0x09, 0x09, 0x74, 0x73, 0x76, 0x0a, 0x74,
+ 0x65, 0x78, 0x74, 0x2f, 0x74, 0x72, 0x6f, 0x66, 0x66, 0x09, 0x09, 0x09,
+ 0x09, 0x09, 0x74, 0x20, 0x74, 0x72, 0x20, 0x72, 0x6f, 0x66, 0x66, 0x20,
+ 0x6d, 0x61, 0x6e, 0x20, 0x6d, 0x65, 0x20, 0x6d, 0x73, 0x0a, 0x74, 0x65,
+ 0x78, 0x74, 0x2f, 0x74, 0x75, 0x72, 0x74, 0x6c, 0x65, 0x09, 0x09, 0x09,
+ 0x09, 0x09, 0x74, 0x74, 0x6c, 0x0a, 0x23, 0x20, 0x74, 0x65, 0x78, 0x74,
+ 0x2f, 0x75, 0x6c, 0x70, 0x66, 0x65, 0x63, 0x0a, 0x74, 0x65, 0x78, 0x74,
+ 0x2f, 0x75, 0x72, 0x69, 0x2d, 0x6c, 0x69, 0x73, 0x74, 0x09, 0x09, 0x09,
+ 0x09, 0x09, 0x75, 0x72, 0x69, 0x20, 0x75, 0x72, 0x69, 0x73, 0x20, 0x75,
+ 0x72, 0x6c, 0x73, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x76, 0x63, 0x61,
+ 0x72, 0x64, 0x09, 0x09, 0x09, 0x09, 0x09, 0x76, 0x63, 0x61, 0x72, 0x64,
+ 0x0a, 0x23, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x61, 0x62, 0x63, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x63, 0x75, 0x72, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x09, 0x63, 0x75,
+ 0x72, 0x6c, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x63, 0x75, 0x72, 0x6c, 0x2e, 0x64, 0x63, 0x75, 0x72, 0x6c, 0x09, 0x09,
+ 0x09, 0x09, 0x64, 0x63, 0x75, 0x72, 0x6c, 0x0a, 0x74, 0x65, 0x78, 0x74,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x63, 0x75, 0x72, 0x6c, 0x2e, 0x73, 0x63,
+ 0x75, 0x72, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x73, 0x63, 0x75, 0x72, 0x6c,
+ 0x0a, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x63, 0x75,
+ 0x72, 0x6c, 0x2e, 0x6d, 0x63, 0x75, 0x72, 0x6c, 0x09, 0x09, 0x09, 0x09,
+ 0x6d, 0x63, 0x75, 0x72, 0x6c, 0x0a, 0x23, 0x20, 0x74, 0x65, 0x78, 0x74,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x6d, 0x63, 0x6c, 0x69, 0x65, 0x6e,
+ 0x74, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x0a, 0x74, 0x65, 0x78, 0x74,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x76, 0x62, 0x2e, 0x73, 0x75, 0x62,
+ 0x74, 0x69, 0x74, 0x6c, 0x65, 0x09, 0x09, 0x09, 0x09, 0x73, 0x75, 0x62,
+ 0x0a, 0x23, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x65, 0x73, 0x6d, 0x65, 0x72, 0x74, 0x65, 0x63, 0x2e, 0x74, 0x68, 0x65,
+ 0x6d, 0x65, 0x2d, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f,
+ 0x72, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x66,
+ 0x6c, 0x79, 0x09, 0x09, 0x09, 0x09, 0x09, 0x66, 0x6c, 0x79, 0x0a, 0x74,
+ 0x65, 0x78, 0x74, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x66, 0x6d, 0x69, 0x2e,
+ 0x66, 0x6c, 0x65, 0x78, 0x73, 0x74, 0x6f, 0x72, 0x09, 0x09, 0x09, 0x09,
+ 0x66, 0x6c, 0x78, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x76, 0x69, 0x7a, 0x09, 0x09, 0x09,
+ 0x09, 0x67, 0x76, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x69, 0x6e, 0x33, 0x64, 0x2e, 0x33, 0x64, 0x6d, 0x6c, 0x09, 0x09,
+ 0x09, 0x09, 0x33, 0x64, 0x6d, 0x6c, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x69, 0x6e, 0x33, 0x64, 0x2e, 0x73, 0x70, 0x6f,
+ 0x74, 0x09, 0x09, 0x09, 0x09, 0x73, 0x70, 0x6f, 0x74, 0x0a, 0x23, 0x20,
+ 0x74, 0x65, 0x78, 0x74, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x69, 0x70, 0x74,
+ 0x63, 0x2e, 0x6e, 0x65, 0x77, 0x73, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x74,
+ 0x65, 0x78, 0x74, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x69, 0x70, 0x74, 0x63,
+ 0x2e, 0x6e, 0x69, 0x74, 0x66, 0x0a, 0x23, 0x20, 0x74, 0x65, 0x78, 0x74,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6c, 0x61, 0x74, 0x65, 0x78, 0x2d, 0x7a,
+ 0x0a, 0x23, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x6d, 0x6f, 0x74, 0x6f, 0x72, 0x6f, 0x6c, 0x61, 0x2e, 0x72, 0x65, 0x66,
+ 0x6c, 0x65, 0x78, 0x0a, 0x23, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x70,
+ 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x0a, 0x23, 0x20, 0x74, 0x65, 0x78,
+ 0x74, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6e, 0x65, 0x74, 0x32, 0x70, 0x68,
+ 0x6f, 0x6e, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x63, 0x65, 0x6e, 0x74,
+ 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x0a, 0x23,
+ 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x69,
+ 0x2e, 0x75, 0x72, 0x69, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x75,
+ 0x65, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73,
+ 0x75, 0x6e, 0x2e, 0x6a, 0x32, 0x6d, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2d,
+ 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x09, 0x09,
+ 0x6a, 0x61, 0x64, 0x0a, 0x23, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x74, 0x65, 0x63, 0x68,
+ 0x2e, 0x6c, 0x69, 0x6e, 0x67, 0x75, 0x69, 0x73, 0x74, 0x0a, 0x23, 0x20,
+ 0x74, 0x65, 0x78, 0x74, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x77, 0x61, 0x70,
+ 0x2e, 0x73, 0x69, 0x0a, 0x23, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x76,
+ 0x6e, 0x64, 0x2e, 0x77, 0x61, 0x70, 0x2e, 0x73, 0x6c, 0x0a, 0x74, 0x65,
+ 0x78, 0x74, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x77, 0x61, 0x70, 0x2e, 0x77,
+ 0x6d, 0x6c, 0x09, 0x09, 0x09, 0x09, 0x77, 0x6d, 0x6c, 0x0a, 0x74, 0x65,
+ 0x78, 0x74, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x77, 0x61, 0x70, 0x2e, 0x77,
+ 0x6d, 0x6c, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x09, 0x09, 0x09, 0x09,
+ 0x77, 0x6d, 0x6c, 0x73, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x78, 0x2d,
+ 0x61, 0x73, 0x6d, 0x09, 0x09, 0x09, 0x09, 0x09, 0x73, 0x20, 0x61, 0x73,
+ 0x6d, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x78, 0x2d, 0x63, 0x09, 0x09,
+ 0x09, 0x09, 0x09, 0x63, 0x20, 0x63, 0x63, 0x20, 0x63, 0x78, 0x78, 0x20,
+ 0x63, 0x70, 0x70, 0x20, 0x68, 0x20, 0x68, 0x68, 0x20, 0x64, 0x69, 0x63,
+ 0x0a, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x78, 0x2d, 0x66, 0x6f, 0x72, 0x74,
+ 0x72, 0x61, 0x6e, 0x09, 0x09, 0x09, 0x09, 0x09, 0x66, 0x20, 0x66, 0x6f,
+ 0x72, 0x20, 0x66, 0x37, 0x37, 0x20, 0x66, 0x39, 0x30, 0x0a, 0x74, 0x65,
+ 0x78, 0x74, 0x2f, 0x78, 0x2d, 0x6a, 0x61, 0x76, 0x61, 0x2d, 0x73, 0x6f,
+ 0x75, 0x72, 0x63, 0x65, 0x09, 0x09, 0x09, 0x09, 0x6a, 0x61, 0x76, 0x61,
+ 0x0a, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x78, 0x2d, 0x6f, 0x70, 0x6d, 0x6c,
+ 0x09, 0x09, 0x09, 0x09, 0x09, 0x6f, 0x70, 0x6d, 0x6c, 0x0a, 0x74, 0x65,
+ 0x78, 0x74, 0x2f, 0x78, 0x2d, 0x70, 0x61, 0x73, 0x63, 0x61, 0x6c, 0x09,
+ 0x09, 0x09, 0x09, 0x09, 0x70, 0x20, 0x70, 0x61, 0x73, 0x0a, 0x74, 0x65,
+ 0x78, 0x74, 0x2f, 0x78, 0x2d, 0x6e, 0x66, 0x6f, 0x09, 0x09, 0x09, 0x09,
+ 0x09, 0x6e, 0x66, 0x6f, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x78, 0x2d,
+ 0x73, 0x65, 0x74, 0x65, 0x78, 0x74, 0x09, 0x09, 0x09, 0x09, 0x09, 0x65,
+ 0x74, 0x78, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x78, 0x2d, 0x73, 0x66,
+ 0x76, 0x09, 0x09, 0x09, 0x09, 0x09, 0x73, 0x66, 0x76, 0x0a, 0x74, 0x65,
+ 0x78, 0x74, 0x2f, 0x78, 0x2d, 0x75, 0x75, 0x65, 0x6e, 0x63, 0x6f, 0x64,
+ 0x65, 0x09, 0x09, 0x09, 0x09, 0x09, 0x75, 0x75, 0x0a, 0x74, 0x65, 0x78,
+ 0x74, 0x2f, 0x78, 0x2d, 0x76, 0x63, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61,
+ 0x72, 0x09, 0x09, 0x09, 0x09, 0x76, 0x63, 0x73, 0x0a, 0x74, 0x65, 0x78,
+ 0x74, 0x2f, 0x78, 0x2d, 0x76, 0x63, 0x61, 0x72, 0x64, 0x09, 0x09, 0x09,
+ 0x09, 0x09, 0x76, 0x63, 0x66, 0x0a, 0x23, 0x20, 0x74, 0x65, 0x78, 0x74,
+ 0x2f, 0x78, 0x6d, 0x6c, 0x0a, 0x23, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f,
+ 0x78, 0x6d, 0x6c, 0x2d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c,
+ 0x2d, 0x70, 0x61, 0x72, 0x73, 0x65, 0x64, 0x2d, 0x65, 0x6e, 0x74, 0x69,
+ 0x74, 0x79, 0x0a, 0x23, 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x31,
+ 0x64, 0x2d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6c, 0x65, 0x61, 0x76, 0x65,
+ 0x64, 0x2d, 0x70, 0x61, 0x72, 0x69, 0x74, 0x79, 0x66, 0x65, 0x63, 0x0a,
+ 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x33, 0x67, 0x70, 0x70, 0x09, 0x09,
+ 0x09, 0x09, 0x09, 0x33, 0x67, 0x70, 0x0a, 0x23, 0x20, 0x76, 0x69, 0x64,
+ 0x65, 0x6f, 0x2f, 0x33, 0x67, 0x70, 0x70, 0x2d, 0x74, 0x74, 0x0a, 0x76,
+ 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x33, 0x67, 0x70, 0x70, 0x32, 0x09, 0x09,
+ 0x09, 0x09, 0x09, 0x33, 0x67, 0x32, 0x0a, 0x23, 0x20, 0x76, 0x69, 0x64,
+ 0x65, 0x6f, 0x2f, 0x62, 0x6d, 0x70, 0x65, 0x67, 0x0a, 0x23, 0x20, 0x76,
+ 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x62, 0x74, 0x36, 0x35, 0x36, 0x0a, 0x23,
+ 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x63, 0x65, 0x6c, 0x62, 0x0a,
+ 0x23, 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x64, 0x76, 0x0a, 0x23,
+ 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70,
+ 0x6c, 0x65, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x68, 0x32, 0x36,
+ 0x31, 0x09, 0x09, 0x09, 0x09, 0x09, 0x68, 0x32, 0x36, 0x31, 0x0a, 0x76,
+ 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x68, 0x32, 0x36, 0x33, 0x09, 0x09, 0x09,
+ 0x09, 0x09, 0x68, 0x32, 0x36, 0x33, 0x0a, 0x23, 0x20, 0x76, 0x69, 0x64,
+ 0x65, 0x6f, 0x2f, 0x68, 0x32, 0x36, 0x33, 0x2d, 0x31, 0x39, 0x39, 0x38,
+ 0x0a, 0x23, 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x68, 0x32, 0x36,
+ 0x33, 0x2d, 0x32, 0x30, 0x30, 0x30, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f,
+ 0x2f, 0x68, 0x32, 0x36, 0x34, 0x09, 0x09, 0x09, 0x09, 0x09, 0x68, 0x32,
+ 0x36, 0x34, 0x0a, 0x23, 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x68,
+ 0x32, 0x36, 0x34, 0x2d, 0x72, 0x63, 0x64, 0x6f, 0x0a, 0x23, 0x20, 0x76,
+ 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x68, 0x32, 0x36, 0x34, 0x2d, 0x73, 0x76,
+ 0x63, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x6a, 0x70, 0x65, 0x67,
+ 0x09, 0x09, 0x09, 0x09, 0x09, 0x6a, 0x70, 0x67, 0x76, 0x0a, 0x23, 0x20,
+ 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x6a, 0x70, 0x65, 0x67, 0x32, 0x30,
+ 0x30, 0x30, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x6a, 0x70, 0x6d,
+ 0x09, 0x09, 0x09, 0x09, 0x09, 0x6a, 0x70, 0x6d, 0x20, 0x6a, 0x70, 0x67,
+ 0x6d, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x6d, 0x6a, 0x32, 0x09,
+ 0x09, 0x09, 0x09, 0x09, 0x6d, 0x6a, 0x32, 0x20, 0x6d, 0x6a, 0x70, 0x32,
+ 0x0a, 0x23, 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x6d, 0x70, 0x31,
+ 0x73, 0x0a, 0x23, 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x6d, 0x70,
+ 0x32, 0x70, 0x0a, 0x23, 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x6d,
+ 0x70, 0x32, 0x74, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x6d, 0x70,
+ 0x34, 0x09, 0x09, 0x09, 0x09, 0x09, 0x6d, 0x70, 0x34, 0x20, 0x6d, 0x70,
+ 0x34, 0x76, 0x20, 0x6d, 0x70, 0x67, 0x34, 0x0a, 0x23, 0x20, 0x76, 0x69,
+ 0x64, 0x65, 0x6f, 0x2f, 0x6d, 0x70, 0x34, 0x76, 0x2d, 0x65, 0x73, 0x0a,
+ 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x6d, 0x70, 0x65, 0x67, 0x09, 0x09,
+ 0x09, 0x09, 0x09, 0x6d, 0x70, 0x65, 0x67, 0x20, 0x6d, 0x70, 0x67, 0x20,
+ 0x6d, 0x70, 0x65, 0x20, 0x6d, 0x31, 0x76, 0x20, 0x6d, 0x32, 0x76, 0x0a,
+ 0x23, 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x6d, 0x70, 0x65, 0x67,
+ 0x34, 0x2d, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x0a, 0x23, 0x20,
+ 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x6d, 0x70, 0x76, 0x0a, 0x23, 0x20,
+ 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x6e, 0x76, 0x0a, 0x76, 0x69, 0x64,
+ 0x65, 0x6f, 0x2f, 0x6f, 0x67, 0x67, 0x09, 0x09, 0x09, 0x09, 0x09, 0x6f,
+ 0x67, 0x76, 0x0a, 0x23, 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x70,
+ 0x61, 0x72, 0x69, 0x74, 0x79, 0x66, 0x65, 0x63, 0x0a, 0x23, 0x20, 0x76,
+ 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72,
+ 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x71, 0x75, 0x69, 0x63, 0x6b,
+ 0x74, 0x69, 0x6d, 0x65, 0x09, 0x09, 0x09, 0x09, 0x09, 0x71, 0x74, 0x20,
+ 0x6d, 0x6f, 0x76, 0x0a, 0x23, 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f,
+ 0x72, 0x61, 0x77, 0x0a, 0x23, 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f,
+ 0x72, 0x74, 0x70, 0x2d, 0x65, 0x6e, 0x63, 0x2d, 0x61, 0x65, 0x73, 0x63,
+ 0x6d, 0x31, 0x32, 0x38, 0x0a, 0x23, 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f,
+ 0x2f, 0x72, 0x74, 0x78, 0x0a, 0x23, 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f,
+ 0x2f, 0x73, 0x6d, 0x70, 0x74, 0x65, 0x32, 0x39, 0x32, 0x6d, 0x0a, 0x23,
+ 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x75, 0x6c, 0x70, 0x66, 0x65,
+ 0x63, 0x0a, 0x23, 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x76, 0x63,
+ 0x31, 0x0a, 0x23, 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x63, 0x63, 0x74, 0x76, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x65, 0x63, 0x65, 0x2e, 0x68, 0x64,
+ 0x09, 0x09, 0x09, 0x09, 0x75, 0x76, 0x68, 0x20, 0x75, 0x76, 0x76, 0x68,
+ 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64,
+ 0x65, 0x63, 0x65, 0x2e, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x09, 0x09,
+ 0x09, 0x09, 0x75, 0x76, 0x6d, 0x20, 0x75, 0x76, 0x76, 0x6d, 0x0a, 0x23,
+ 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64,
+ 0x65, 0x63, 0x65, 0x2e, 0x6d, 0x70, 0x34, 0x0a, 0x76, 0x69, 0x64, 0x65,
+ 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x65, 0x63, 0x65, 0x2e, 0x70,
+ 0x64, 0x09, 0x09, 0x09, 0x09, 0x75, 0x76, 0x70, 0x20, 0x75, 0x76, 0x76,
+ 0x70, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x64, 0x65, 0x63, 0x65, 0x2e, 0x73, 0x64, 0x09, 0x09, 0x09, 0x09, 0x75,
+ 0x76, 0x73, 0x20, 0x75, 0x76, 0x76, 0x73, 0x0a, 0x76, 0x69, 0x64, 0x65,
+ 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x65, 0x63, 0x65, 0x2e, 0x76,
+ 0x69, 0x64, 0x65, 0x6f, 0x09, 0x09, 0x09, 0x09, 0x75, 0x76, 0x76, 0x20,
+ 0x75, 0x76, 0x76, 0x76, 0x0a, 0x23, 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x76,
+ 0x2e, 0x6d, 0x70, 0x65, 0x67, 0x0a, 0x23, 0x20, 0x76, 0x69, 0x64, 0x65,
+ 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74,
+ 0x76, 0x2e, 0x6d, 0x70, 0x65, 0x67, 0x2d, 0x74, 0x74, 0x73, 0x0a, 0x23,
+ 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64,
+ 0x6c, 0x6e, 0x61, 0x2e, 0x6d, 0x70, 0x65, 0x67, 0x2d, 0x74, 0x74, 0x73,
+ 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x64,
+ 0x76, 0x62, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x09, 0x09, 0x09, 0x09, 0x64,
+ 0x76, 0x62, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x66, 0x76, 0x74, 0x09, 0x09, 0x09, 0x09, 0x09, 0x66, 0x76, 0x74,
+ 0x0a, 0x23, 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x68, 0x6e, 0x73, 0x2e, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x0a, 0x23,
+ 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x69,
+ 0x70, 0x74, 0x76, 0x66, 0x6f, 0x72, 0x75, 0x6d, 0x2e, 0x31, 0x64, 0x70,
+ 0x61, 0x72, 0x69, 0x74, 0x79, 0x66, 0x65, 0x63, 0x2d, 0x31, 0x30, 0x31,
+ 0x30, 0x0a, 0x23, 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x69, 0x70, 0x74, 0x76, 0x66, 0x6f, 0x72, 0x75, 0x6d, 0x2e,
+ 0x31, 0x64, 0x70, 0x61, 0x72, 0x69, 0x74, 0x79, 0x66, 0x65, 0x63, 0x2d,
+ 0x32, 0x30, 0x30, 0x35, 0x0a, 0x23, 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x69, 0x70, 0x74, 0x76, 0x66, 0x6f, 0x72,
+ 0x75, 0x6d, 0x2e, 0x32, 0x64, 0x70, 0x61, 0x72, 0x69, 0x74, 0x79, 0x66,
+ 0x65, 0x63, 0x2d, 0x31, 0x30, 0x31, 0x30, 0x0a, 0x23, 0x20, 0x76, 0x69,
+ 0x64, 0x65, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x69, 0x70, 0x74, 0x76,
+ 0x66, 0x6f, 0x72, 0x75, 0x6d, 0x2e, 0x32, 0x64, 0x70, 0x61, 0x72, 0x69,
+ 0x74, 0x79, 0x66, 0x65, 0x63, 0x2d, 0x32, 0x30, 0x30, 0x35, 0x0a, 0x23,
+ 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x69,
+ 0x70, 0x74, 0x76, 0x66, 0x6f, 0x72, 0x75, 0x6d, 0x2e, 0x74, 0x74, 0x73,
+ 0x61, 0x76, 0x63, 0x0a, 0x23, 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x69, 0x70, 0x74, 0x76, 0x66, 0x6f, 0x72, 0x75,
+ 0x6d, 0x2e, 0x74, 0x74, 0x73, 0x6d, 0x70, 0x65, 0x67, 0x32, 0x0a, 0x23,
+ 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d,
+ 0x6f, 0x74, 0x6f, 0x72, 0x6f, 0x6c, 0x61, 0x2e, 0x76, 0x69, 0x64, 0x65,
+ 0x6f, 0x0a, 0x23, 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x76, 0x6e,
+ 0x64, 0x2e, 0x6d, 0x6f, 0x74, 0x6f, 0x72, 0x6f, 0x6c, 0x61, 0x2e, 0x76,
+ 0x69, 0x64, 0x65, 0x6f, 0x70, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f,
+ 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x70, 0x65, 0x67, 0x75, 0x72, 0x6c, 0x09,
+ 0x09, 0x09, 0x09, 0x6d, 0x78, 0x75, 0x20, 0x6d, 0x34, 0x75, 0x0a, 0x76,
+ 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d,
+ 0x70, 0x6c, 0x61, 0x79, 0x72, 0x65, 0x61, 0x64, 0x79, 0x2e, 0x6d, 0x65,
+ 0x64, 0x69, 0x61, 0x2e, 0x70, 0x79, 0x76, 0x09, 0x09, 0x70, 0x79, 0x76,
+ 0x0a, 0x23, 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x76, 0x6e, 0x64,
+ 0x2e, 0x6e, 0x6f, 0x6b, 0x69, 0x61, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72,
+ 0x6c, 0x65, 0x61, 0x76, 0x65, 0x64, 0x2d, 0x6d, 0x75, 0x6c, 0x74, 0x69,
+ 0x6d, 0x65, 0x64, 0x69, 0x61, 0x0a, 0x23, 0x20, 0x76, 0x69, 0x64, 0x65,
+ 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6e, 0x6f, 0x6b, 0x69, 0x61, 0x2e,
+ 0x76, 0x69, 0x64, 0x65, 0x6f, 0x76, 0x6f, 0x69, 0x70, 0x0a, 0x23, 0x20,
+ 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6f, 0x62,
+ 0x6a, 0x65, 0x63, 0x74, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x0a, 0x23, 0x20,
+ 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73, 0x65,
+ 0x61, 0x6c, 0x65, 0x64, 0x2e, 0x6d, 0x70, 0x65, 0x67, 0x31, 0x0a, 0x23,
+ 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73,
+ 0x65, 0x61, 0x6c, 0x65, 0x64, 0x2e, 0x6d, 0x70, 0x65, 0x67, 0x34, 0x0a,
+ 0x23, 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e,
+ 0x73, 0x65, 0x61, 0x6c, 0x65, 0x64, 0x2e, 0x73, 0x77, 0x66, 0x0a, 0x23,
+ 0x20, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x73,
+ 0x65, 0x61, 0x6c, 0x65, 0x64, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x2e, 0x73,
+ 0x6f, 0x66, 0x74, 0x73, 0x65, 0x61, 0x6c, 0x2e, 0x6d, 0x6f, 0x76, 0x0a,
+ 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x75, 0x76,
+ 0x76, 0x75, 0x2e, 0x6d, 0x70, 0x34, 0x09, 0x09, 0x09, 0x09, 0x75, 0x76,
+ 0x75, 0x20, 0x75, 0x76, 0x76, 0x75, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f,
+ 0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x76, 0x69, 0x76, 0x6f, 0x09, 0x09, 0x09,
+ 0x09, 0x09, 0x76, 0x69, 0x76, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f,
+ 0x77, 0x65, 0x62, 0x6d, 0x09, 0x09, 0x09, 0x09, 0x09, 0x77, 0x65, 0x62,
+ 0x6d, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x78, 0x2d, 0x66, 0x34,
+ 0x76, 0x09, 0x09, 0x09, 0x09, 0x09, 0x66, 0x34, 0x76, 0x0a, 0x76, 0x69,
+ 0x64, 0x65, 0x6f, 0x2f, 0x78, 0x2d, 0x66, 0x6c, 0x69, 0x09, 0x09, 0x09,
+ 0x09, 0x09, 0x66, 0x6c, 0x69, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f,
+ 0x78, 0x2d, 0x66, 0x6c, 0x76, 0x09, 0x09, 0x09, 0x09, 0x09, 0x66, 0x6c,
+ 0x76, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x78, 0x2d, 0x6d, 0x34,
+ 0x76, 0x09, 0x09, 0x09, 0x09, 0x09, 0x6d, 0x34, 0x76, 0x0a, 0x76, 0x69,
+ 0x64, 0x65, 0x6f, 0x2f, 0x78, 0x2d, 0x6d, 0x61, 0x74, 0x72, 0x6f, 0x73,
+ 0x6b, 0x61, 0x09, 0x09, 0x09, 0x09, 0x6d, 0x6b, 0x76, 0x20, 0x6d, 0x6b,
+ 0x33, 0x64, 0x20, 0x6d, 0x6b, 0x73, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f,
+ 0x2f, 0x78, 0x2d, 0x6d, 0x6e, 0x67, 0x09, 0x09, 0x09, 0x09, 0x09, 0x6d,
+ 0x6e, 0x67, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x78, 0x2d, 0x6d,
+ 0x73, 0x2d, 0x61, 0x73, 0x66, 0x09, 0x09, 0x09, 0x09, 0x09, 0x61, 0x73,
+ 0x66, 0x20, 0x61, 0x73, 0x78, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f,
+ 0x78, 0x2d, 0x6d, 0x73, 0x2d, 0x76, 0x6f, 0x62, 0x09, 0x09, 0x09, 0x09,
+ 0x09, 0x76, 0x6f, 0x62, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x78,
+ 0x2d, 0x6d, 0x73, 0x2d, 0x77, 0x6d, 0x09, 0x09, 0x09, 0x09, 0x09, 0x77,
+ 0x6d, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x78, 0x2d, 0x6d, 0x73,
+ 0x2d, 0x77, 0x6d, 0x76, 0x09, 0x09, 0x09, 0x09, 0x09, 0x77, 0x6d, 0x76,
+ 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x78, 0x2d, 0x6d, 0x73, 0x2d,
+ 0x77, 0x6d, 0x78, 0x09, 0x09, 0x09, 0x09, 0x09, 0x77, 0x6d, 0x78, 0x0a,
+ 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x78, 0x2d, 0x6d, 0x73, 0x2d, 0x77,
+ 0x76, 0x78, 0x09, 0x09, 0x09, 0x09, 0x09, 0x77, 0x76, 0x78, 0x0a, 0x76,
+ 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x78, 0x2d, 0x6d, 0x73, 0x76, 0x69, 0x64,
+ 0x65, 0x6f, 0x09, 0x09, 0x09, 0x09, 0x09, 0x61, 0x76, 0x69, 0x0a, 0x76,
+ 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x78, 0x2d, 0x73, 0x67, 0x69, 0x2d, 0x6d,
+ 0x6f, 0x76, 0x69, 0x65, 0x09, 0x09, 0x09, 0x09, 0x6d, 0x6f, 0x76, 0x69,
+ 0x65, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x2f, 0x78, 0x2d, 0x73, 0x6d,
+ 0x76, 0x09, 0x09, 0x09, 0x09, 0x09, 0x73, 0x6d, 0x76, 0x0a, 0x78, 0x2d,
+ 0x63, 0x6f, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x2f, 0x78,
+ 0x2d, 0x63, 0x6f, 0x6f, 0x6c, 0x74, 0x61, 0x6c, 0x6b, 0x09, 0x09, 0x09,
+ 0x09, 0x69, 0x63, 0x65, 0x0a
+};
+static unsigned int mime_types_len = 53009;
diff --git a/protocols/Telegram/tgl/mime.types b/protocols/Telegram/tgl/mime.types
new file mode 100644
index 0000000000..da8cd69187
--- /dev/null
+++ b/protocols/Telegram/tgl/mime.types
@@ -0,0 +1,1588 @@
+# This file maps Internet media types to unique file extension(s).
+# Although created for httpd, this file is used by many software systems
+# and has been placed in the public domain for unlimited redisribution.
+#
+# The table below contains both registered and (common) unregistered types.
+# A type that has no unique extension can be ignored -- they are listed
+# here to guide configurations toward known types and to make it easier to
+# identify "new" types. File extensions are also commonly used to indicate
+# content languages and encodings, so choose them carefully.
+#
+# Internet media types should be registered as described in RFC 4288.
+# The registry is at <http://www.iana.org/assignments/media-types/>.
+#
+# MIME type (lowercased) Extensions
+# ============================================ ==========
+# application/1d-interleaved-parityfec
+# application/3gpp-ims+xml
+# application/activemessage
+application/andrew-inset ez
+# application/applefile
+application/applixware aw
+application/atom+xml atom
+application/atomcat+xml atomcat
+# application/atomicmail
+application/atomsvc+xml atomsvc
+# application/auth-policy+xml
+# application/batch-smtp
+# application/beep+xml
+# application/calendar+xml
+# application/cals-1840
+# application/ccmp+xml
+application/ccxml+xml ccxml
+application/cdmi-capability cdmia
+application/cdmi-container cdmic
+application/cdmi-domain cdmid
+application/cdmi-object cdmio
+application/cdmi-queue cdmiq
+# application/cea-2018+xml
+# application/cellml+xml
+# application/cfw
+# application/cnrp+xml
+# application/commonground
+# application/conference-info+xml
+# application/cpl+xml
+# application/csta+xml
+# application/cstadata+xml
+application/cu-seeme cu
+# application/cybercash
+application/davmount+xml davmount
+# application/dca-rft
+# application/dec-dx
+# application/dialog-info+xml
+# application/dicom
+# application/dns
+application/docbook+xml dbk
+# application/dskpp+xml
+application/dssc+der dssc
+application/dssc+xml xdssc
+# application/dvcs
+application/ecmascript ecma
+# application/edi-consent
+# application/edi-x12
+# application/edifact
+application/emma+xml emma
+# application/epp+xml
+application/epub+zip epub
+# application/eshop
+# application/example
+application/exi exi
+# application/fastinfoset
+# application/fastsoap
+# application/fits
+application/font-tdpfr pfr
+# application/framework-attributes+xml
+application/gml+xml gml
+application/gpx+xml gpx
+application/gxf gxf
+# application/h224
+# application/held+xml
+# application/http
+application/hyperstudio stk
+# application/ibe-key-request+xml
+# application/ibe-pkg-reply+xml
+# application/ibe-pp-data
+# application/iges
+# application/im-iscomposing+xml
+# application/index
+# application/index.cmd
+# application/index.obj
+# application/index.response
+# application/index.vnd
+application/inkml+xml ink inkml
+# application/iotp
+application/ipfix ipfix
+# application/ipp
+# application/isup
+application/java-archive jar
+application/java-serialized-object ser
+application/java-vm class
+application/javascript js
+application/json json
+application/jsonml+json jsonml
+# application/kpml-request+xml
+# application/kpml-response+xml
+application/lost+xml lostxml
+application/mac-binhex40 hqx
+application/mac-compactpro cpt
+# application/macwriteii
+application/mads+xml mads
+application/marc mrc
+application/marcxml+xml mrcx
+application/mathematica ma nb mb
+# application/mathml-content+xml
+# application/mathml-presentation+xml
+application/mathml+xml mathml
+# application/mbms-associated-procedure-description+xml
+# application/mbms-deregister+xml
+# application/mbms-envelope+xml
+# application/mbms-msk+xml
+# application/mbms-msk-response+xml
+# application/mbms-protection-description+xml
+# application/mbms-reception-report+xml
+# application/mbms-register+xml
+# application/mbms-register-response+xml
+# application/mbms-user-service-description+xml
+application/mbox mbox
+# application/media_control+xml
+application/mediaservercontrol+xml mscml
+application/metalink+xml metalink
+application/metalink4+xml meta4
+application/mets+xml mets
+# application/mikey
+application/mods+xml mods
+# application/moss-keys
+# application/moss-signature
+# application/mosskey-data
+# application/mosskey-request
+application/mp21 m21 mp21
+application/mp4 mp4s
+# application/mpeg4-generic
+# application/mpeg4-iod
+# application/mpeg4-iod-xmt
+# application/msc-ivr+xml
+# application/msc-mixer+xml
+application/msword doc dot
+application/mxf mxf
+# application/nasdata
+# application/news-checkgroups
+# application/news-groupinfo
+# application/news-transmission
+# application/nss
+# application/ocsp-request
+# application/ocsp-response
+application/octet-stream bin dms lrf mar so dist distz pkg bpk dump elc deploy
+application/oda oda
+application/oebps-package+xml opf
+application/ogg ogx
+application/omdoc+xml omdoc
+application/onenote onetoc onetoc2 onetmp onepkg
+application/oxps oxps
+# application/parityfec
+application/patch-ops-error+xml xer
+application/pdf pdf
+application/pgp-encrypted pgp
+# application/pgp-keys
+application/pgp-signature asc sig
+application/pics-rules prf
+# application/pidf+xml
+# application/pidf-diff+xml
+application/pkcs10 p10
+application/pkcs7-mime p7m p7c
+application/pkcs7-signature p7s
+application/pkcs8 p8
+application/pkix-attr-cert ac
+application/pkix-cert cer
+application/pkix-crl crl
+application/pkix-pkipath pkipath
+application/pkixcmp pki
+application/pls+xml pls
+# application/poc-settings+xml
+application/postscript ai eps ps
+# application/prs.alvestrand.titrax-sheet
+application/prs.cww cww
+# application/prs.nprend
+# application/prs.plucker
+# application/prs.rdf-xml-crypt
+# application/prs.xsf+xml
+application/pskc+xml pskcxml
+# application/qsig
+application/rdf+xml rdf
+application/reginfo+xml rif
+application/relax-ng-compact-syntax rnc
+# application/remote-printing
+application/resource-lists+xml rl
+application/resource-lists-diff+xml rld
+# application/riscos
+# application/rlmi+xml
+application/rls-services+xml rs
+application/rpki-ghostbusters gbr
+application/rpki-manifest mft
+application/rpki-roa roa
+# application/rpki-updown
+application/rsd+xml rsd
+application/rss+xml rss
+application/rtf rtf
+# application/rtx
+# application/samlassertion+xml
+# application/samlmetadata+xml
+application/sbml+xml sbml
+application/scvp-cv-request scq
+application/scvp-cv-response scs
+application/scvp-vp-request spq
+application/scvp-vp-response spp
+application/sdp sdp
+# application/set-payment
+application/set-payment-initiation setpay
+# application/set-registration
+application/set-registration-initiation setreg
+# application/sgml
+# application/sgml-open-catalog
+application/shf+xml shf
+# application/sieve
+# application/simple-filter+xml
+# application/simple-message-summary
+# application/simplesymbolcontainer
+# application/slate
+# application/smil
+application/smil+xml smi smil
+# application/soap+fastinfoset
+# application/soap+xml
+application/sparql-query rq
+application/sparql-results+xml srx
+# application/spirits-event+xml
+application/srgs gram
+application/srgs+xml grxml
+application/sru+xml sru
+application/ssdl+xml ssdl
+application/ssml+xml ssml
+# application/tamp-apex-update
+# application/tamp-apex-update-confirm
+# application/tamp-community-update
+# application/tamp-community-update-confirm
+# application/tamp-error
+# application/tamp-sequence-adjust
+# application/tamp-sequence-adjust-confirm
+# application/tamp-status-query
+# application/tamp-status-response
+# application/tamp-update
+# application/tamp-update-confirm
+application/tei+xml tei teicorpus
+application/thraud+xml tfi
+# application/timestamp-query
+# application/timestamp-reply
+application/timestamped-data tsd
+# application/tve-trigger
+# application/ulpfec
+# application/vcard+xml
+# application/vemmi
+# application/vividence.scriptfile
+# application/vnd.3gpp.bsf+xml
+application/vnd.3gpp.pic-bw-large plb
+application/vnd.3gpp.pic-bw-small psb
+application/vnd.3gpp.pic-bw-var pvb
+# application/vnd.3gpp.sms
+# application/vnd.3gpp2.bcmcsinfo+xml
+# application/vnd.3gpp2.sms
+application/vnd.3gpp2.tcap tcap
+application/vnd.3m.post-it-notes pwn
+application/vnd.accpac.simply.aso aso
+application/vnd.accpac.simply.imp imp
+application/vnd.acucobol acu
+application/vnd.acucorp atc acutc
+application/vnd.adobe.air-application-installer-package+zip air
+application/vnd.adobe.formscentral.fcdt fcdt
+application/vnd.adobe.fxp fxp fxpl
+# application/vnd.adobe.partial-upload
+application/vnd.adobe.xdp+xml xdp
+application/vnd.adobe.xfdf xfdf
+# application/vnd.aether.imp
+# application/vnd.ah-barcode
+application/vnd.ahead.space ahead
+application/vnd.airzip.filesecure.azf azf
+application/vnd.airzip.filesecure.azs azs
+application/vnd.amazon.ebook azw
+application/vnd.americandynamics.acc acc
+application/vnd.amiga.ami ami
+# application/vnd.amundsen.maze+xml
+application/vnd.android.package-archive apk
+application/vnd.anser-web-certificate-issue-initiation cii
+application/vnd.anser-web-funds-transfer-initiation fti
+application/vnd.antix.game-component atx
+application/vnd.apple.installer+xml mpkg
+application/vnd.apple.mpegurl m3u8
+# application/vnd.arastra.swi
+application/vnd.aristanetworks.swi swi
+application/vnd.astraea-software.iota iota
+application/vnd.audiograph aep
+# application/vnd.autopackage
+# application/vnd.avistar+xml
+application/vnd.blueice.multipass mpm
+# application/vnd.bluetooth.ep.oob
+application/vnd.bmi bmi
+application/vnd.businessobjects rep
+# application/vnd.cab-jscript
+# application/vnd.canon-cpdl
+# application/vnd.canon-lips
+# application/vnd.cendio.thinlinc.clientconf
+application/vnd.chemdraw+xml cdxml
+application/vnd.chipnuts.karaoke-mmd mmd
+application/vnd.cinderella cdy
+# application/vnd.cirpack.isdn-ext
+application/vnd.claymore cla
+application/vnd.cloanto.rp9 rp9
+application/vnd.clonk.c4group c4g c4d c4f c4p c4u
+application/vnd.cluetrust.cartomobile-config c11amc
+application/vnd.cluetrust.cartomobile-config-pkg c11amz
+# application/vnd.collection+json
+# application/vnd.commerce-battelle
+application/vnd.commonspace csp
+application/vnd.contact.cmsg cdbcmsg
+application/vnd.cosmocaller cmc
+application/vnd.crick.clicker clkx
+application/vnd.crick.clicker.keyboard clkk
+application/vnd.crick.clicker.palette clkp
+application/vnd.crick.clicker.template clkt
+application/vnd.crick.clicker.wordbank clkw
+application/vnd.criticaltools.wbs+xml wbs
+application/vnd.ctc-posml pml
+# application/vnd.ctct.ws+xml
+# application/vnd.cups-pdf
+# application/vnd.cups-postscript
+application/vnd.cups-ppd ppd
+# application/vnd.cups-raster
+# application/vnd.cups-raw
+# application/vnd.curl
+application/vnd.curl.car car
+application/vnd.curl.pcurl pcurl
+# application/vnd.cybank
+application/vnd.dart dart
+application/vnd.data-vision.rdz rdz
+application/vnd.dece.data uvf uvvf uvd uvvd
+application/vnd.dece.ttml+xml uvt uvvt
+application/vnd.dece.unspecified uvx uvvx
+application/vnd.dece.zip uvz uvvz
+application/vnd.denovo.fcselayout-link fe_launch
+# application/vnd.dir-bi.plate-dl-nosuffix
+application/vnd.dna dna
+application/vnd.dolby.mlp mlp
+# application/vnd.dolby.mobile.1
+# application/vnd.dolby.mobile.2
+application/vnd.dpgraph dpg
+application/vnd.dreamfactory dfac
+application/vnd.ds-keypoint kpxx
+application/vnd.dvb.ait ait
+# application/vnd.dvb.dvbj
+# application/vnd.dvb.esgcontainer
+# application/vnd.dvb.ipdcdftnotifaccess
+# application/vnd.dvb.ipdcesgaccess
+# application/vnd.dvb.ipdcesgaccess2
+# application/vnd.dvb.ipdcesgpdd
+# application/vnd.dvb.ipdcroaming
+# application/vnd.dvb.iptv.alfec-base
+# application/vnd.dvb.iptv.alfec-enhancement
+# application/vnd.dvb.notif-aggregate-root+xml
+# application/vnd.dvb.notif-container+xml
+# application/vnd.dvb.notif-generic+xml
+# application/vnd.dvb.notif-ia-msglist+xml
+# application/vnd.dvb.notif-ia-registration-request+xml
+# application/vnd.dvb.notif-ia-registration-response+xml
+# application/vnd.dvb.notif-init+xml
+# application/vnd.dvb.pfr
+application/vnd.dvb.service svc
+# application/vnd.dxr
+application/vnd.dynageo geo
+# application/vnd.easykaraoke.cdgdownload
+# application/vnd.ecdis-update
+application/vnd.ecowin.chart mag
+# application/vnd.ecowin.filerequest
+# application/vnd.ecowin.fileupdate
+# application/vnd.ecowin.series
+# application/vnd.ecowin.seriesrequest
+# application/vnd.ecowin.seriesupdate
+# application/vnd.emclient.accessrequest+xml
+application/vnd.enliven nml
+# application/vnd.eprints.data+xml
+application/vnd.epson.esf esf
+application/vnd.epson.msf msf
+application/vnd.epson.quickanime qam
+application/vnd.epson.salt slt
+application/vnd.epson.ssf ssf
+# application/vnd.ericsson.quickcall
+application/vnd.eszigno3+xml es3 et3
+# application/vnd.etsi.aoc+xml
+# application/vnd.etsi.cug+xml
+# application/vnd.etsi.iptvcommand+xml
+# application/vnd.etsi.iptvdiscovery+xml
+# application/vnd.etsi.iptvprofile+xml
+# application/vnd.etsi.iptvsad-bc+xml
+# application/vnd.etsi.iptvsad-cod+xml
+# application/vnd.etsi.iptvsad-npvr+xml
+# application/vnd.etsi.iptvservice+xml
+# application/vnd.etsi.iptvsync+xml
+# application/vnd.etsi.iptvueprofile+xml
+# application/vnd.etsi.mcid+xml
+# application/vnd.etsi.overload-control-policy-dataset+xml
+# application/vnd.etsi.sci+xml
+# application/vnd.etsi.simservs+xml
+# application/vnd.etsi.tsl+xml
+# application/vnd.etsi.tsl.der
+# application/vnd.eudora.data
+application/vnd.ezpix-album ez2
+application/vnd.ezpix-package ez3
+# application/vnd.f-secure.mobile
+application/vnd.fdf fdf
+application/vnd.fdsn.mseed mseed
+application/vnd.fdsn.seed seed dataless
+# application/vnd.ffsns
+# application/vnd.fints
+application/vnd.flographit gph
+application/vnd.fluxtime.clip ftc
+# application/vnd.font-fontforge-sfd
+application/vnd.framemaker fm frame maker book
+application/vnd.frogans.fnc fnc
+application/vnd.frogans.ltf ltf
+application/vnd.fsc.weblaunch fsc
+application/vnd.fujitsu.oasys oas
+application/vnd.fujitsu.oasys2 oa2
+application/vnd.fujitsu.oasys3 oa3
+application/vnd.fujitsu.oasysgp fg5
+application/vnd.fujitsu.oasysprs bh2
+# application/vnd.fujixerox.art-ex
+# application/vnd.fujixerox.art4
+# application/vnd.fujixerox.hbpl
+application/vnd.fujixerox.ddd ddd
+application/vnd.fujixerox.docuworks xdw
+application/vnd.fujixerox.docuworks.binder xbd
+# application/vnd.fut-misnet
+application/vnd.fuzzysheet fzs
+application/vnd.genomatix.tuxedo txd
+# application/vnd.geocube+xml
+application/vnd.geogebra.file ggb
+application/vnd.geogebra.tool ggt
+application/vnd.geometry-explorer gex gre
+application/vnd.geonext gxt
+application/vnd.geoplan g2w
+application/vnd.geospace g3w
+# application/vnd.globalplatform.card-content-mgt
+# application/vnd.globalplatform.card-content-mgt-response
+application/vnd.gmx gmx
+application/vnd.google-earth.kml+xml kml
+application/vnd.google-earth.kmz kmz
+application/vnd.grafeq gqf gqs
+# application/vnd.gridmp
+application/vnd.groove-account gac
+application/vnd.groove-help ghf
+application/vnd.groove-identity-message gim
+application/vnd.groove-injector grv
+application/vnd.groove-tool-message gtm
+application/vnd.groove-tool-template tpl
+application/vnd.groove-vcard vcg
+# application/vnd.hal+json
+application/vnd.hal+xml hal
+application/vnd.handheld-entertainment+xml zmm
+application/vnd.hbci hbci
+# application/vnd.hcl-bireports
+application/vnd.hhe.lesson-player les
+application/vnd.hp-hpgl hpgl
+application/vnd.hp-hpid hpid
+application/vnd.hp-hps hps
+application/vnd.hp-jlyt jlt
+application/vnd.hp-pcl pcl
+application/vnd.hp-pclxl pclxl
+# application/vnd.httphone
+application/vnd.hydrostatix.sof-data sfd-hdstx
+# application/vnd.hzn-3d-crossword
+# application/vnd.ibm.afplinedata
+# application/vnd.ibm.electronic-media
+application/vnd.ibm.minipay mpy
+application/vnd.ibm.modcap afp listafp list3820
+application/vnd.ibm.rights-management irm
+application/vnd.ibm.secure-container sc
+application/vnd.iccprofile icc icm
+application/vnd.igloader igl
+application/vnd.immervision-ivp ivp
+application/vnd.immervision-ivu ivu
+# application/vnd.informedcontrol.rms+xml
+# application/vnd.informix-visionary
+# application/vnd.infotech.project
+# application/vnd.infotech.project+xml
+# application/vnd.innopath.wamp.notification
+application/vnd.insors.igm igm
+application/vnd.intercon.formnet xpw xpx
+application/vnd.intergeo i2g
+# application/vnd.intertrust.digibox
+# application/vnd.intertrust.nncp
+application/vnd.intu.qbo qbo
+application/vnd.intu.qfx qfx
+# application/vnd.iptc.g2.conceptitem+xml
+# application/vnd.iptc.g2.knowledgeitem+xml
+# application/vnd.iptc.g2.newsitem+xml
+# application/vnd.iptc.g2.newsmessage+xml
+# application/vnd.iptc.g2.packageitem+xml
+# application/vnd.iptc.g2.planningitem+xml
+application/vnd.ipunplugged.rcprofile rcprofile
+application/vnd.irepository.package+xml irp
+application/vnd.is-xpr xpr
+application/vnd.isac.fcs fcs
+application/vnd.jam jam
+# application/vnd.japannet-directory-service
+# application/vnd.japannet-jpnstore-wakeup
+# application/vnd.japannet-payment-wakeup
+# application/vnd.japannet-registration
+# application/vnd.japannet-registration-wakeup
+# application/vnd.japannet-setstore-wakeup
+# application/vnd.japannet-verification
+# application/vnd.japannet-verification-wakeup
+application/vnd.jcp.javame.midlet-rms rms
+application/vnd.jisp jisp
+application/vnd.joost.joda-archive joda
+application/vnd.kahootz ktz ktr
+application/vnd.kde.karbon karbon
+application/vnd.kde.kchart chrt
+application/vnd.kde.kformula kfo
+application/vnd.kde.kivio flw
+application/vnd.kde.kontour kon
+application/vnd.kde.kpresenter kpr kpt
+application/vnd.kde.kspread ksp
+application/vnd.kde.kword kwd kwt
+application/vnd.kenameaapp htke
+application/vnd.kidspiration kia
+application/vnd.kinar kne knp
+application/vnd.koan skp skd skt skm
+application/vnd.kodak-descriptor sse
+application/vnd.las.las+xml lasxml
+# application/vnd.liberty-request+xml
+application/vnd.llamagraphics.life-balance.desktop lbd
+application/vnd.llamagraphics.life-balance.exchange+xml lbe
+application/vnd.lotus-1-2-3 123
+application/vnd.lotus-approach apr
+application/vnd.lotus-freelance pre
+application/vnd.lotus-notes nsf
+application/vnd.lotus-organizer org
+application/vnd.lotus-screencam scm
+application/vnd.lotus-wordpro lwp
+application/vnd.macports.portpkg portpkg
+# application/vnd.marlin.drm.actiontoken+xml
+# application/vnd.marlin.drm.conftoken+xml
+# application/vnd.marlin.drm.license+xml
+# application/vnd.marlin.drm.mdcf
+application/vnd.mcd mcd
+application/vnd.medcalcdata mc1
+application/vnd.mediastation.cdkey cdkey
+# application/vnd.meridian-slingshot
+application/vnd.mfer mwf
+application/vnd.mfmp mfm
+application/vnd.micrografx.flo flo
+application/vnd.micrografx.igx igx
+application/vnd.mif mif
+# application/vnd.minisoft-hp3000-save
+# application/vnd.mitsubishi.misty-guard.trustweb
+application/vnd.mobius.daf daf
+application/vnd.mobius.dis dis
+application/vnd.mobius.mbk mbk
+application/vnd.mobius.mqy mqy
+application/vnd.mobius.msl msl
+application/vnd.mobius.plc plc
+application/vnd.mobius.txf txf
+application/vnd.mophun.application mpn
+application/vnd.mophun.certificate mpc
+# application/vnd.motorola.flexsuite
+# application/vnd.motorola.flexsuite.adsi
+# application/vnd.motorola.flexsuite.fis
+# application/vnd.motorola.flexsuite.gotap
+# application/vnd.motorola.flexsuite.kmr
+# application/vnd.motorola.flexsuite.ttc
+# application/vnd.motorola.flexsuite.wem
+# application/vnd.motorola.iprm
+application/vnd.mozilla.xul+xml xul
+application/vnd.ms-artgalry cil
+# application/vnd.ms-asf
+application/vnd.ms-cab-compressed cab
+# application/vnd.ms-color.iccprofile
+application/vnd.ms-excel xls xlm xla xlc xlt xlw
+application/vnd.ms-excel.addin.macroenabled.12 xlam
+application/vnd.ms-excel.sheet.binary.macroenabled.12 xlsb
+application/vnd.ms-excel.sheet.macroenabled.12 xlsm
+application/vnd.ms-excel.template.macroenabled.12 xltm
+application/vnd.ms-fontobject eot
+application/vnd.ms-htmlhelp chm
+application/vnd.ms-ims ims
+application/vnd.ms-lrm lrm
+# application/vnd.ms-office.activex+xml
+application/vnd.ms-officetheme thmx
+# application/vnd.ms-opentype
+# application/vnd.ms-package.obfuscated-opentype
+application/vnd.ms-pki.seccat cat
+application/vnd.ms-pki.stl stl
+# application/vnd.ms-playready.initiator+xml
+application/vnd.ms-powerpoint ppt pps pot
+application/vnd.ms-powerpoint.addin.macroenabled.12 ppam
+application/vnd.ms-powerpoint.presentation.macroenabled.12 pptm
+application/vnd.ms-powerpoint.slide.macroenabled.12 sldm
+application/vnd.ms-powerpoint.slideshow.macroenabled.12 ppsm
+application/vnd.ms-powerpoint.template.macroenabled.12 potm
+# application/vnd.ms-printing.printticket+xml
+application/vnd.ms-project mpp mpt
+# application/vnd.ms-tnef
+# application/vnd.ms-wmdrm.lic-chlg-req
+# application/vnd.ms-wmdrm.lic-resp
+# application/vnd.ms-wmdrm.meter-chlg-req
+# application/vnd.ms-wmdrm.meter-resp
+application/vnd.ms-word.document.macroenabled.12 docm
+application/vnd.ms-word.template.macroenabled.12 dotm
+application/vnd.ms-works wps wks wcm wdb
+application/vnd.ms-wpl wpl
+application/vnd.ms-xpsdocument xps
+application/vnd.mseq mseq
+# application/vnd.msign
+# application/vnd.multiad.creator
+# application/vnd.multiad.creator.cif
+# application/vnd.music-niff
+application/vnd.musician mus
+application/vnd.muvee.style msty
+application/vnd.mynfc taglet
+# application/vnd.ncd.control
+# application/vnd.ncd.reference
+# application/vnd.nervana
+# application/vnd.netfpx
+application/vnd.neurolanguage.nlu nlu
+application/vnd.nitf ntf nitf
+application/vnd.noblenet-directory nnd
+application/vnd.noblenet-sealer nns
+application/vnd.noblenet-web nnw
+# application/vnd.nokia.catalogs
+# application/vnd.nokia.conml+wbxml
+# application/vnd.nokia.conml+xml
+# application/vnd.nokia.isds-radio-presets
+# application/vnd.nokia.iptv.config+xml
+# application/vnd.nokia.landmark+wbxml
+# application/vnd.nokia.landmark+xml
+# application/vnd.nokia.landmarkcollection+xml
+# application/vnd.nokia.n-gage.ac+xml
+application/vnd.nokia.n-gage.data ngdat
+application/vnd.nokia.n-gage.symbian.install n-gage
+# application/vnd.nokia.ncd
+# application/vnd.nokia.pcd+wbxml
+# application/vnd.nokia.pcd+xml
+application/vnd.nokia.radio-preset rpst
+application/vnd.nokia.radio-presets rpss
+application/vnd.novadigm.edm edm
+application/vnd.novadigm.edx edx
+application/vnd.novadigm.ext ext
+# application/vnd.ntt-local.file-transfer
+# application/vnd.ntt-local.sip-ta_remote
+# application/vnd.ntt-local.sip-ta_tcp_stream
+application/vnd.oasis.opendocument.chart odc
+application/vnd.oasis.opendocument.chart-template otc
+application/vnd.oasis.opendocument.database odb
+application/vnd.oasis.opendocument.formula odf
+application/vnd.oasis.opendocument.formula-template odft
+application/vnd.oasis.opendocument.graphics odg
+application/vnd.oasis.opendocument.graphics-template otg
+application/vnd.oasis.opendocument.image odi
+application/vnd.oasis.opendocument.image-template oti
+application/vnd.oasis.opendocument.presentation odp
+application/vnd.oasis.opendocument.presentation-template otp
+application/vnd.oasis.opendocument.spreadsheet ods
+application/vnd.oasis.opendocument.spreadsheet-template ots
+application/vnd.oasis.opendocument.text odt
+application/vnd.oasis.opendocument.text-master odm
+application/vnd.oasis.opendocument.text-template ott
+application/vnd.oasis.opendocument.text-web oth
+# application/vnd.obn
+# application/vnd.oftn.l10n+json
+# application/vnd.oipf.contentaccessdownload+xml
+# application/vnd.oipf.contentaccessstreaming+xml
+# application/vnd.oipf.cspg-hexbinary
+# application/vnd.oipf.dae.svg+xml
+# application/vnd.oipf.dae.xhtml+xml
+# application/vnd.oipf.mippvcontrolmessage+xml
+# application/vnd.oipf.pae.gem
+# application/vnd.oipf.spdiscovery+xml
+# application/vnd.oipf.spdlist+xml
+# application/vnd.oipf.ueprofile+xml
+# application/vnd.oipf.userprofile+xml
+application/vnd.olpc-sugar xo
+# application/vnd.oma-scws-config
+# application/vnd.oma-scws-http-request
+# application/vnd.oma-scws-http-response
+# application/vnd.oma.bcast.associated-procedure-parameter+xml
+# application/vnd.oma.bcast.drm-trigger+xml
+# application/vnd.oma.bcast.imd+xml
+# application/vnd.oma.bcast.ltkm
+# application/vnd.oma.bcast.notification+xml
+# application/vnd.oma.bcast.provisioningtrigger
+# application/vnd.oma.bcast.sgboot
+# application/vnd.oma.bcast.sgdd+xml
+# application/vnd.oma.bcast.sgdu
+# application/vnd.oma.bcast.simple-symbol-container
+# application/vnd.oma.bcast.smartcard-trigger+xml
+# application/vnd.oma.bcast.sprov+xml
+# application/vnd.oma.bcast.stkm
+# application/vnd.oma.cab-address-book+xml
+# application/vnd.oma.cab-feature-handler+xml
+# application/vnd.oma.cab-pcc+xml
+# application/vnd.oma.cab-user-prefs+xml
+# application/vnd.oma.dcd
+# application/vnd.oma.dcdc
+application/vnd.oma.dd2+xml dd2
+# application/vnd.oma.drm.risd+xml
+# application/vnd.oma.group-usage-list+xml
+# application/vnd.oma.pal+xml
+# application/vnd.oma.poc.detailed-progress-report+xml
+# application/vnd.oma.poc.final-report+xml
+# application/vnd.oma.poc.groups+xml
+# application/vnd.oma.poc.invocation-descriptor+xml
+# application/vnd.oma.poc.optimized-progress-report+xml
+# application/vnd.oma.push
+# application/vnd.oma.scidm.messages+xml
+# application/vnd.oma.xcap-directory+xml
+# application/vnd.omads-email+xml
+# application/vnd.omads-file+xml
+# application/vnd.omads-folder+xml
+# application/vnd.omaloc-supl-init
+application/vnd.openofficeorg.extension oxt
+# application/vnd.openxmlformats-officedocument.custom-properties+xml
+# application/vnd.openxmlformats-officedocument.customxmlproperties+xml
+# application/vnd.openxmlformats-officedocument.drawing+xml
+# application/vnd.openxmlformats-officedocument.drawingml.chart+xml
+# application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml
+# application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml
+# application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml
+# application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml
+# application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml
+# application/vnd.openxmlformats-officedocument.extended-properties+xml
+# application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml
+# application/vnd.openxmlformats-officedocument.presentationml.comments+xml
+# application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml
+# application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml
+# application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml
+application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
+# application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml
+# application/vnd.openxmlformats-officedocument.presentationml.presprops+xml
+application/vnd.openxmlformats-officedocument.presentationml.slide sldx
+# application/vnd.openxmlformats-officedocument.presentationml.slide+xml
+# application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml
+# application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml
+application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx
+# application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml
+# application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml
+# application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml
+# application/vnd.openxmlformats-officedocument.presentationml.tags+xml
+application/vnd.openxmlformats-officedocument.presentationml.template potx
+# application/vnd.openxmlformats-officedocument.presentationml.template.main+xml
+# application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml
+application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
+# application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml
+application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx
+# application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml
+# application/vnd.openxmlformats-officedocument.theme+xml
+# application/vnd.openxmlformats-officedocument.themeoverride+xml
+# application/vnd.openxmlformats-officedocument.vmldrawing
+# application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml
+application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
+# application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml
+# application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml
+# application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml
+# application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml
+# application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml
+# application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml
+# application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml
+# application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml
+# application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml
+application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx
+# application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml
+# application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml
+# application/vnd.openxmlformats-package.core-properties+xml
+# application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml
+# application/vnd.openxmlformats-package.relationships+xml
+# application/vnd.quobject-quoxdocument
+# application/vnd.osa.netdeploy
+application/vnd.osgeo.mapguide.package mgp
+# application/vnd.osgi.bundle
+application/vnd.osgi.dp dp
+application/vnd.osgi.subsystem esa
+# application/vnd.otps.ct-kip+xml
+application/vnd.palm pdb pqa oprc
+# application/vnd.paos.xml
+application/vnd.pawaafile paw
+application/vnd.pg.format str
+application/vnd.pg.osasli ei6
+# application/vnd.piaccess.application-licence
+application/vnd.picsel efif
+application/vnd.pmi.widget wg
+# application/vnd.poc.group-advertisement+xml
+application/vnd.pocketlearn plf
+application/vnd.powerbuilder6 pbd
+# application/vnd.powerbuilder6-s
+# application/vnd.powerbuilder7
+# application/vnd.powerbuilder7-s
+# application/vnd.powerbuilder75
+# application/vnd.powerbuilder75-s
+# application/vnd.preminet
+application/vnd.previewsystems.box box
+application/vnd.proteus.magazine mgz
+application/vnd.publishare-delta-tree qps
+application/vnd.pvi.ptid1 ptid
+# application/vnd.pwg-multiplexed
+# application/vnd.pwg-xhtml-print+xml
+# application/vnd.qualcomm.brew-app-res
+application/vnd.quark.quarkxpress qxd qxt qwd qwt qxl qxb
+# application/vnd.radisys.moml+xml
+# application/vnd.radisys.msml+xml
+# application/vnd.radisys.msml-audit+xml
+# application/vnd.radisys.msml-audit-conf+xml
+# application/vnd.radisys.msml-audit-conn+xml
+# application/vnd.radisys.msml-audit-dialog+xml
+# application/vnd.radisys.msml-audit-stream+xml
+# application/vnd.radisys.msml-conf+xml
+# application/vnd.radisys.msml-dialog+xml
+# application/vnd.radisys.msml-dialog-base+xml
+# application/vnd.radisys.msml-dialog-fax-detect+xml
+# application/vnd.radisys.msml-dialog-fax-sendrecv+xml
+# application/vnd.radisys.msml-dialog-group+xml
+# application/vnd.radisys.msml-dialog-speech+xml
+# application/vnd.radisys.msml-dialog-transform+xml
+# application/vnd.rainstor.data
+# application/vnd.rapid
+application/vnd.realvnc.bed bed
+application/vnd.recordare.musicxml mxl
+application/vnd.recordare.musicxml+xml musicxml
+# application/vnd.renlearn.rlprint
+application/vnd.rig.cryptonote cryptonote
+application/vnd.rim.cod cod
+application/vnd.rn-realmedia rm
+application/vnd.rn-realmedia-vbr rmvb
+application/vnd.route66.link66+xml link66
+# application/vnd.rs-274x
+# application/vnd.ruckus.download
+# application/vnd.s3sms
+application/vnd.sailingtracker.track st
+# application/vnd.sbm.cid
+# application/vnd.sbm.mid2
+# application/vnd.scribus
+# application/vnd.sealed.3df
+# application/vnd.sealed.csf
+# application/vnd.sealed.doc
+# application/vnd.sealed.eml
+# application/vnd.sealed.mht
+# application/vnd.sealed.net
+# application/vnd.sealed.ppt
+# application/vnd.sealed.tiff
+# application/vnd.sealed.xls
+# application/vnd.sealedmedia.softseal.html
+# application/vnd.sealedmedia.softseal.pdf
+application/vnd.seemail see
+application/vnd.sema sema
+application/vnd.semd semd
+application/vnd.semf semf
+application/vnd.shana.informed.formdata ifm
+application/vnd.shana.informed.formtemplate itp
+application/vnd.shana.informed.interchange iif
+application/vnd.shana.informed.package ipk
+application/vnd.simtech-mindmapper twd twds
+application/vnd.smaf mmf
+# application/vnd.smart.notebook
+application/vnd.smart.teacher teacher
+# application/vnd.software602.filler.form+xml
+# application/vnd.software602.filler.form-xml-zip
+application/vnd.solent.sdkm+xml sdkm sdkd
+application/vnd.spotfire.dxp dxp
+application/vnd.spotfire.sfs sfs
+# application/vnd.sss-cod
+# application/vnd.sss-dtf
+# application/vnd.sss-ntf
+application/vnd.stardivision.calc sdc
+application/vnd.stardivision.draw sda
+application/vnd.stardivision.impress sdd
+application/vnd.stardivision.math smf
+application/vnd.stardivision.writer sdw vor
+application/vnd.stardivision.writer-global sgl
+application/vnd.stepmania.package smzip
+application/vnd.stepmania.stepchart sm
+# application/vnd.street-stream
+application/vnd.sun.xml.calc sxc
+application/vnd.sun.xml.calc.template stc
+application/vnd.sun.xml.draw sxd
+application/vnd.sun.xml.draw.template std
+application/vnd.sun.xml.impress sxi
+application/vnd.sun.xml.impress.template sti
+application/vnd.sun.xml.math sxm
+application/vnd.sun.xml.writer sxw
+application/vnd.sun.xml.writer.global sxg
+application/vnd.sun.xml.writer.template stw
+# application/vnd.sun.wadl+xml
+application/vnd.sus-calendar sus susp
+application/vnd.svd svd
+# application/vnd.swiftview-ics
+application/vnd.symbian.install sis sisx
+application/vnd.syncml+xml xsm
+application/vnd.syncml.dm+wbxml bdm
+application/vnd.syncml.dm+xml xdm
+# application/vnd.syncml.dm.notification
+# application/vnd.syncml.ds.notification
+application/vnd.tao.intent-module-archive tao
+application/vnd.tcpdump.pcap pcap cap dmp
+application/vnd.tmobile-livetv tmo
+application/vnd.trid.tpt tpt
+application/vnd.triscape.mxs mxs
+application/vnd.trueapp tra
+# application/vnd.truedoc
+# application/vnd.ubisoft.webplayer
+application/vnd.ufdl ufd ufdl
+application/vnd.uiq.theme utz
+application/vnd.umajin umj
+application/vnd.unity unityweb
+application/vnd.uoml+xml uoml
+# application/vnd.uplanet.alert
+# application/vnd.uplanet.alert-wbxml
+# application/vnd.uplanet.bearer-choice
+# application/vnd.uplanet.bearer-choice-wbxml
+# application/vnd.uplanet.cacheop
+# application/vnd.uplanet.cacheop-wbxml
+# application/vnd.uplanet.channel
+# application/vnd.uplanet.channel-wbxml
+# application/vnd.uplanet.list
+# application/vnd.uplanet.list-wbxml
+# application/vnd.uplanet.listcmd
+# application/vnd.uplanet.listcmd-wbxml
+# application/vnd.uplanet.signal
+application/vnd.vcx vcx
+# application/vnd.vd-study
+# application/vnd.vectorworks
+# application/vnd.verimatrix.vcas
+# application/vnd.vidsoft.vidconference
+application/vnd.visio vsd vst vss vsw
+application/vnd.visionary vis
+# application/vnd.vividence.scriptfile
+application/vnd.vsf vsf
+# application/vnd.wap.sic
+# application/vnd.wap.slc
+application/vnd.wap.wbxml wbxml
+application/vnd.wap.wmlc wmlc
+application/vnd.wap.wmlscriptc wmlsc
+application/vnd.webturbo wtb
+# application/vnd.wfa.wsc
+# application/vnd.wmc
+# application/vnd.wmf.bootstrap
+# application/vnd.wolfram.mathematica
+# application/vnd.wolfram.mathematica.package
+application/vnd.wolfram.player nbp
+application/vnd.wordperfect wpd
+application/vnd.wqd wqd
+# application/vnd.wrq-hp3000-labelled
+application/vnd.wt.stf stf
+# application/vnd.wv.csp+wbxml
+# application/vnd.wv.csp+xml
+# application/vnd.wv.ssp+xml
+application/vnd.xara xar
+application/vnd.xfdl xfdl
+# application/vnd.xfdl.webform
+# application/vnd.xmi+xml
+# application/vnd.xmpie.cpkg
+# application/vnd.xmpie.dpkg
+# application/vnd.xmpie.plan
+# application/vnd.xmpie.ppkg
+# application/vnd.xmpie.xlim
+application/vnd.yamaha.hv-dic hvd
+application/vnd.yamaha.hv-script hvs
+application/vnd.yamaha.hv-voice hvp
+application/vnd.yamaha.openscoreformat osf
+application/vnd.yamaha.openscoreformat.osfpvg+xml osfpvg
+# application/vnd.yamaha.remote-setup
+application/vnd.yamaha.smaf-audio saf
+application/vnd.yamaha.smaf-phrase spf
+# application/vnd.yamaha.through-ngn
+# application/vnd.yamaha.tunnel-udpencap
+application/vnd.yellowriver-custom-menu cmp
+application/vnd.zul zir zirz
+application/vnd.zzazz.deck+xml zaz
+application/voicexml+xml vxml
+# application/vq-rtcpxr
+# application/watcherinfo+xml
+# application/whoispp-query
+# application/whoispp-response
+application/widget wgt
+application/winhlp hlp
+# application/wita
+# application/wordperfect5.1
+application/wsdl+xml wsdl
+application/wspolicy+xml wspolicy
+application/x-7z-compressed 7z
+application/x-abiword abw
+application/x-ace-compressed ace
+# application/x-amf
+application/x-apple-diskimage dmg
+application/x-authorware-bin aab x32 u32 vox
+application/x-authorware-map aam
+application/x-authorware-seg aas
+application/x-bcpio bcpio
+application/x-bittorrent torrent
+application/x-blorb blb blorb
+application/x-bzip bz
+application/x-bzip2 bz2 boz
+application/x-cbr cbr cba cbt cbz cb7
+application/x-cdlink vcd
+application/x-cfs-compressed cfs
+application/x-chat chat
+application/x-chess-pgn pgn
+application/x-conference nsc
+# application/x-compress
+application/x-cpio cpio
+application/x-csh csh
+application/x-debian-package deb udeb
+application/x-dgc-compressed dgc
+application/x-director dir dcr dxr cst cct cxt w3d fgd swa
+application/x-doom wad
+application/x-dtbncx+xml ncx
+application/x-dtbook+xml dtb
+application/x-dtbresource+xml res
+application/x-dvi dvi
+application/x-envoy evy
+application/x-eva eva
+application/x-font-bdf bdf
+# application/x-font-dos
+# application/x-font-framemaker
+application/x-font-ghostscript gsf
+# application/x-font-libgrx
+application/x-font-linux-psf psf
+application/x-font-otf otf
+application/x-font-pcf pcf
+application/x-font-snf snf
+# application/x-font-speedo
+# application/x-font-sunos-news
+application/x-font-ttf ttf ttc
+application/x-font-type1 pfa pfb pfm afm
+application/font-woff woff
+# application/x-font-vfont
+application/x-freearc arc
+application/x-futuresplash spl
+application/x-gca-compressed gca
+application/x-glulx ulx
+application/x-gnumeric gnumeric
+application/x-gramps-xml gramps
+application/x-gtar gtar
+# application/x-gzip
+application/x-hdf hdf
+application/x-install-instructions install
+application/x-iso9660-image iso
+application/x-java-jnlp-file jnlp
+application/x-latex latex
+application/x-lzh-compressed lzh lha
+application/x-mie mie
+application/x-mobipocket-ebook prc mobi
+application/x-ms-application application
+application/x-ms-shortcut lnk
+application/x-ms-wmd wmd
+application/x-ms-wmz wmz
+application/x-ms-xbap xbap
+application/x-msaccess mdb
+application/x-msbinder obd
+application/x-mscardfile crd
+application/x-msclip clp
+application/x-msdownload exe dll com bat msi
+application/x-msmediaview mvb m13 m14
+application/x-msmetafile wmf wmz emf emz
+application/x-msmoney mny
+application/x-mspublisher pub
+application/x-msschedule scd
+application/x-msterminal trm
+application/x-mswrite wri
+application/x-netcdf nc cdf
+application/x-nzb nzb
+application/x-pkcs12 p12 pfx
+application/x-pkcs7-certificates p7b spc
+application/x-pkcs7-certreqresp p7r
+application/x-rar-compressed rar
+application/x-research-info-systems ris
+application/x-sh sh
+application/x-shar shar
+application/x-shockwave-flash swf
+application/x-silverlight-app xap
+application/x-sql sql
+application/x-stuffit sit
+application/x-stuffitx sitx
+application/x-subrip srt
+application/x-sv4cpio sv4cpio
+application/x-sv4crc sv4crc
+application/x-t3vm-image t3
+application/x-tads gam
+application/x-tar tar
+application/x-tcl tcl
+application/x-tex tex
+application/x-tex-tfm tfm
+application/x-texinfo texinfo texi
+application/x-tgif obj
+application/x-ustar ustar
+application/x-wais-source src
+application/x-x509-ca-cert der crt
+application/x-xfig fig
+application/x-xliff+xml xlf
+application/x-xpinstall xpi
+application/x-xz xz
+application/x-zmachine z1 z2 z3 z4 z5 z6 z7 z8
+# application/x400-bp
+application/xaml+xml xaml
+# application/xcap-att+xml
+# application/xcap-caps+xml
+application/xcap-diff+xml xdf
+# application/xcap-el+xml
+# application/xcap-error+xml
+# application/xcap-ns+xml
+# application/xcon-conference-info-diff+xml
+# application/xcon-conference-info+xml
+application/xenc+xml xenc
+application/xhtml+xml xhtml xht
+# application/xhtml-voice+xml
+application/xml xml xsl
+application/xml-dtd dtd
+# application/xml-external-parsed-entity
+# application/xmpp+xml
+application/xop+xml xop
+application/xproc+xml xpl
+application/xslt+xml xslt
+application/xspf+xml xspf
+application/xv+xml mxml xhvml xvml xvm
+application/yang yang
+application/yin+xml yin
+application/zip zip
+# audio/1d-interleaved-parityfec
+# audio/32kadpcm
+# audio/3gpp
+# audio/3gpp2
+# audio/ac3
+audio/adpcm adp
+# audio/amr
+# audio/amr-wb
+# audio/amr-wb+
+# audio/asc
+# audio/atrac-advanced-lossless
+# audio/atrac-x
+# audio/atrac3
+audio/basic au snd
+# audio/bv16
+# audio/bv32
+# audio/clearmode
+# audio/cn
+# audio/dat12
+# audio/dls
+# audio/dsr-es201108
+# audio/dsr-es202050
+# audio/dsr-es202211
+# audio/dsr-es202212
+# audio/dv
+# audio/dvi4
+# audio/eac3
+# audio/evrc
+# audio/evrc-qcp
+# audio/evrc0
+# audio/evrc1
+# audio/evrcb
+# audio/evrcb0
+# audio/evrcb1
+# audio/evrcwb
+# audio/evrcwb0
+# audio/evrcwb1
+# audio/example
+# audio/fwdred
+# audio/g719
+# audio/g722
+# audio/g7221
+# audio/g723
+# audio/g726-16
+# audio/g726-24
+# audio/g726-32
+# audio/g726-40
+# audio/g728
+# audio/g729
+# audio/g7291
+# audio/g729d
+# audio/g729e
+# audio/gsm
+# audio/gsm-efr
+# audio/gsm-hr-08
+# audio/ilbc
+# audio/ip-mr_v2.5
+# audio/isac
+# audio/l16
+# audio/l20
+# audio/l24
+# audio/l8
+# audio/lpc
+audio/midi mid midi kar rmi
+# audio/mobile-xmf
+audio/mp4 mp4a
+# audio/mp4a-latm
+# audio/mpa
+# audio/mpa-robust
+audio/mpeg mpga mp2 mp2a mp3 m2a m3a
+# audio/mpeg4-generic
+# audio/musepack
+audio/ogg oga ogg spx
+# audio/opus
+# audio/parityfec
+# audio/pcma
+# audio/pcma-wb
+# audio/pcmu-wb
+# audio/pcmu
+# audio/prs.sid
+# audio/qcelp
+# audio/red
+# audio/rtp-enc-aescm128
+# audio/rtp-midi
+# audio/rtx
+audio/s3m s3m
+audio/silk sil
+# audio/smv
+# audio/smv0
+# audio/smv-qcp
+# audio/sp-midi
+# audio/speex
+# audio/t140c
+# audio/t38
+# audio/telephone-event
+# audio/tone
+# audio/uemclip
+# audio/ulpfec
+# audio/vdvi
+# audio/vmr-wb
+# audio/vnd.3gpp.iufp
+# audio/vnd.4sb
+# audio/vnd.audiokoz
+# audio/vnd.celp
+# audio/vnd.cisco.nse
+# audio/vnd.cmles.radio-events
+# audio/vnd.cns.anp1
+# audio/vnd.cns.inf1
+audio/vnd.dece.audio uva uvva
+audio/vnd.digital-winds eol
+# audio/vnd.dlna.adts
+# audio/vnd.dolby.heaac.1
+# audio/vnd.dolby.heaac.2
+# audio/vnd.dolby.mlp
+# audio/vnd.dolby.mps
+# audio/vnd.dolby.pl2
+# audio/vnd.dolby.pl2x
+# audio/vnd.dolby.pl2z
+# audio/vnd.dolby.pulse.1
+audio/vnd.dra dra
+audio/vnd.dts dts
+audio/vnd.dts.hd dtshd
+# audio/vnd.dvb.file
+# audio/vnd.everad.plj
+# audio/vnd.hns.audio
+audio/vnd.lucent.voice lvp
+audio/vnd.ms-playready.media.pya pya
+# audio/vnd.nokia.mobile-xmf
+# audio/vnd.nortel.vbk
+audio/vnd.nuera.ecelp4800 ecelp4800
+audio/vnd.nuera.ecelp7470 ecelp7470
+audio/vnd.nuera.ecelp9600 ecelp9600
+# audio/vnd.octel.sbc
+# audio/vnd.qcelp
+# audio/vnd.rhetorex.32kadpcm
+audio/vnd.rip rip
+# audio/vnd.sealedmedia.softseal.mpeg
+# audio/vnd.vmx.cvsd
+# audio/vorbis
+# audio/vorbis-config
+audio/webm weba
+audio/x-aac aac
+audio/x-aiff aif aiff aifc
+audio/x-caf caf
+audio/x-flac flac
+audio/x-matroska mka
+audio/x-mpegurl m3u
+audio/x-ms-wax wax
+audio/x-ms-wma wma
+audio/x-pn-realaudio ram ra
+audio/x-pn-realaudio-plugin rmp
+# audio/x-tta
+audio/x-wav wav
+audio/xm xm
+chemical/x-cdx cdx
+chemical/x-cif cif
+chemical/x-cmdf cmdf
+chemical/x-cml cml
+chemical/x-csml csml
+# chemical/x-pdb
+chemical/x-xyz xyz
+image/bmp bmp
+image/cgm cgm
+# image/example
+# image/fits
+image/g3fax g3
+image/gif gif
+image/ief ief
+# image/jp2
+image/jpeg jpeg jpg jpe
+# image/jpm
+# image/jpx
+image/ktx ktx
+# image/naplps
+image/png png
+image/prs.btif btif
+# image/prs.pti
+image/sgi sgi
+image/svg+xml svg svgz
+# image/t38
+image/tiff tiff tif
+# image/tiff-fx
+image/vnd.adobe.photoshop psd
+# image/vnd.cns.inf2
+image/vnd.dece.graphic uvi uvvi uvg uvvg
+image/vnd.dvb.subtitle sub
+image/vnd.djvu djvu djv
+image/vnd.dwg dwg
+image/vnd.dxf dxf
+image/vnd.fastbidsheet fbs
+image/vnd.fpx fpx
+image/vnd.fst fst
+image/vnd.fujixerox.edmics-mmr mmr
+image/vnd.fujixerox.edmics-rlc rlc
+# image/vnd.globalgraphics.pgb
+# image/vnd.microsoft.icon
+# image/vnd.mix
+image/vnd.ms-modi mdi
+image/vnd.ms-photo wdp
+image/vnd.net-fpx npx
+# image/vnd.radiance
+# image/vnd.sealed.png
+# image/vnd.sealedmedia.softseal.gif
+# image/vnd.sealedmedia.softseal.jpg
+# image/vnd.svf
+image/vnd.wap.wbmp wbmp
+image/vnd.xiff xif
+image/webp webp
+image/x-3ds 3ds
+image/x-cmu-raster ras
+image/x-cmx cmx
+image/x-freehand fh fhc fh4 fh5 fh7
+image/x-icon ico
+image/x-mrsid-image sid
+image/x-pcx pcx
+image/x-pict pic pct
+image/x-portable-anymap pnm
+image/x-portable-bitmap pbm
+image/x-portable-graymap pgm
+image/x-portable-pixmap ppm
+image/x-rgb rgb
+image/x-tga tga
+image/x-xbitmap xbm
+image/x-xpixmap xpm
+image/x-xwindowdump xwd
+# message/cpim
+# message/delivery-status
+# message/disposition-notification
+# message/example
+# message/external-body
+# message/feedback-report
+# message/global
+# message/global-delivery-status
+# message/global-disposition-notification
+# message/global-headers
+# message/http
+# message/imdn+xml
+# message/news
+# message/partial
+message/rfc822 eml mime
+# message/s-http
+# message/sip
+# message/sipfrag
+# message/tracking-status
+# message/vnd.si.simp
+# model/example
+model/iges igs iges
+model/mesh msh mesh silo
+model/vnd.collada+xml dae
+model/vnd.dwf dwf
+# model/vnd.flatland.3dml
+model/vnd.gdl gdl
+# model/vnd.gs-gdl
+# model/vnd.gs.gdl
+model/vnd.gtw gtw
+# model/vnd.moml+xml
+model/vnd.mts mts
+# model/vnd.parasolid.transmit.binary
+# model/vnd.parasolid.transmit.text
+model/vnd.vtu vtu
+model/vrml wrl vrml
+model/x3d+binary x3db x3dbz
+model/x3d+vrml x3dv x3dvz
+model/x3d+xml x3d x3dz
+# multipart/alternative
+# multipart/appledouble
+# multipart/byteranges
+# multipart/digest
+# multipart/encrypted
+# multipart/example
+# multipart/form-data
+# multipart/header-set
+# multipart/mixed
+# multipart/parallel
+# multipart/related
+# multipart/report
+# multipart/signed
+# multipart/voice-message
+# text/1d-interleaved-parityfec
+text/cache-manifest appcache
+text/calendar ics ifb
+text/css css
+text/csv csv
+# text/directory
+# text/dns
+# text/ecmascript
+# text/enriched
+# text/example
+# text/fwdred
+text/html html htm
+# text/javascript
+text/n3 n3
+# text/parityfec
+text/plain txt text conf def list log in
+# text/prs.fallenstein.rst
+text/prs.lines.tag dsc
+# text/vnd.radisys.msml-basic-layout
+# text/red
+# text/rfc822-headers
+text/richtext rtx
+# text/rtf
+# text/rtp-enc-aescm128
+# text/rtx
+text/sgml sgml sgm
+# text/t140
+text/tab-separated-values tsv
+text/troff t tr roff man me ms
+text/turtle ttl
+# text/ulpfec
+text/uri-list uri uris urls
+text/vcard vcard
+# text/vnd.abc
+text/vnd.curl curl
+text/vnd.curl.dcurl dcurl
+text/vnd.curl.scurl scurl
+text/vnd.curl.mcurl mcurl
+# text/vnd.dmclientscript
+text/vnd.dvb.subtitle sub
+# text/vnd.esmertec.theme-descriptor
+text/vnd.fly fly
+text/vnd.fmi.flexstor flx
+text/vnd.graphviz gv
+text/vnd.in3d.3dml 3dml
+text/vnd.in3d.spot spot
+# text/vnd.iptc.newsml
+# text/vnd.iptc.nitf
+# text/vnd.latex-z
+# text/vnd.motorola.reflex
+# text/vnd.ms-mediapackage
+# text/vnd.net2phone.commcenter.command
+# text/vnd.si.uricatalogue
+text/vnd.sun.j2me.app-descriptor jad
+# text/vnd.trolltech.linguist
+# text/vnd.wap.si
+# text/vnd.wap.sl
+text/vnd.wap.wml wml
+text/vnd.wap.wmlscript wmls
+text/x-asm s asm
+text/x-c c cc cxx cpp h hh dic
+text/x-fortran f for f77 f90
+text/x-java-source java
+text/x-opml opml
+text/x-pascal p pas
+text/x-nfo nfo
+text/x-setext etx
+text/x-sfv sfv
+text/x-uuencode uu
+text/x-vcalendar vcs
+text/x-vcard vcf
+# text/xml
+# text/xml-external-parsed-entity
+# video/1d-interleaved-parityfec
+video/3gpp 3gp
+# video/3gpp-tt
+video/3gpp2 3g2
+# video/bmpeg
+# video/bt656
+# video/celb
+# video/dv
+# video/example
+video/h261 h261
+video/h263 h263
+# video/h263-1998
+# video/h263-2000
+video/h264 h264
+# video/h264-rcdo
+# video/h264-svc
+video/jpeg jpgv
+# video/jpeg2000
+video/jpm jpm jpgm
+video/mj2 mj2 mjp2
+# video/mp1s
+# video/mp2p
+# video/mp2t
+video/mp4 mp4 mp4v mpg4
+# video/mp4v-es
+video/mpeg mpeg mpg mpe m1v m2v
+# video/mpeg4-generic
+# video/mpv
+# video/nv
+video/ogg ogv
+# video/parityfec
+# video/pointer
+video/quicktime qt mov
+# video/raw
+# video/rtp-enc-aescm128
+# video/rtx
+# video/smpte292m
+# video/ulpfec
+# video/vc1
+# video/vnd.cctv
+video/vnd.dece.hd uvh uvvh
+video/vnd.dece.mobile uvm uvvm
+# video/vnd.dece.mp4
+video/vnd.dece.pd uvp uvvp
+video/vnd.dece.sd uvs uvvs
+video/vnd.dece.video uvv uvvv
+# video/vnd.directv.mpeg
+# video/vnd.directv.mpeg-tts
+# video/vnd.dlna.mpeg-tts
+video/vnd.dvb.file dvb
+video/vnd.fvt fvt
+# video/vnd.hns.video
+# video/vnd.iptvforum.1dparityfec-1010
+# video/vnd.iptvforum.1dparityfec-2005
+# video/vnd.iptvforum.2dparityfec-1010
+# video/vnd.iptvforum.2dparityfec-2005
+# video/vnd.iptvforum.ttsavc
+# video/vnd.iptvforum.ttsmpeg2
+# video/vnd.motorola.video
+# video/vnd.motorola.videop
+video/vnd.mpegurl mxu m4u
+video/vnd.ms-playready.media.pyv pyv
+# video/vnd.nokia.interleaved-multimedia
+# video/vnd.nokia.videovoip
+# video/vnd.objectvideo
+# video/vnd.sealed.mpeg1
+# video/vnd.sealed.mpeg4
+# video/vnd.sealed.swf
+# video/vnd.sealedmedia.softseal.mov
+video/vnd.uvvu.mp4 uvu uvvu
+video/vnd.vivo viv
+video/webm webm
+video/x-f4v f4v
+video/x-fli fli
+video/x-flv flv
+video/x-m4v m4v
+video/x-matroska mkv mk3d mks
+video/x-mng mng
+video/x-ms-asf asf asx
+video/x-ms-vob vob
+video/x-ms-wm wm
+video/x-ms-wmv wmv
+video/x-ms-wmx wmx
+video/x-ms-wvx wvx
+video/x-msvideo avi
+video/x-sgi-movie movie
+video/x-smv smv
+x-conference/x-cooltalk ice
diff --git a/protocols/Telegram/tgl/mtproto-client.c b/protocols/Telegram/tgl/mtproto-client.c
new file mode 100644
index 0000000000..37530b5afb
--- /dev/null
+++ b/protocols/Telegram/tgl/mtproto-client.c
@@ -0,0 +1,1489 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Nikolay Durov, Andrey Lopatin 2012-2013
+ Vitaly Valtman 2013-2015
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#define _FILE_OFFSET_BITS 64
+
+#include <assert.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <signal.h>
+#if defined(WIN32) || defined(_WIN32)
+#include <io.h>
+#include <stdint.h>
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#else
+#include <unistd.h>
+#include <netdb.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <poll.h>
+#endif
+#include <fcntl.h>
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
+#include <sys/endian.h>
+#endif
+#include <sys/types.h>
+#include <openssl/rand.h>
+#include <openssl/rsa.h>
+#include <openssl/pem.h>
+#include <openssl/sha.h>
+
+//#include "telegram.h"
+#include "queries.h"
+//#include "loop.h"
+#include "tgl-structures.h"
+#include "tgl-binlog.h"
+#include "auto.h"
+#include "auto/auto-types.h"
+#include "auto/auto-skip.h"
+#include "tgl.h"
+#include "mtproto-client.h"
+#include "tools.h"
+#include "tree.h"
+#include "updates.h"
+#include "mtproto-utils.h"
+#include "auto.h"
+#include "tgl-methods-in.h"
+
+#if defined(__FreeBSD__)
+#define __builtin_bswap32(x) bswap32(x)
+#endif
+
+#if defined(__OpenBSD__)
+#define __builtin_bswap32(x) __swap32gen(x)
+#endif
+
+#define sha1 SHA1
+
+#include "mtproto-common.h"
+
+#define MAX_NET_RES (1L << 16)
+//extern int log_level;
+
+static long long generate_next_msg_id (struct tgl_state *TLS, struct tgl_dc *DC, struct tgl_session *S);
+static double get_server_time (struct tgl_dc *DC);
+
+#if !defined(HAVE___BUILTIN_BSWAP32) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
+static inline unsigned __builtin_bswap32(unsigned x) {
+ return ((x << 24) & 0xff000000 ) |
+ ((x << 8) & 0x00ff0000 ) |
+ ((x >> 8) & 0x0000ff00 ) |
+ ((x >> 24) & 0x000000ff );
+}
+#endif
+
+// for statistic only
+static int total_packets_sent;
+static long long total_data_sent;
+
+
+static int rpc_execute (struct tgl_state *TLS, struct connection *c, int op, int len);
+static int rpc_becomes_ready (struct tgl_state *TLS, struct connection *c);
+static int rpc_close (struct tgl_state *TLS, struct connection *c);
+
+static double get_utime (int clock_id) {
+ struct timespec T;
+ tgl_my_clock_gettime (clock_id, &T);
+ return T.tv_sec + (double) T.tv_nsec * 1e-9;
+}
+
+
+#define MAX_RESPONSE_SIZE (1L << 24)
+
+static RSA *rsa_load_public_key (struct tgl_state *TLS, const char *public_key_name) {
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ FILE * f = NULL;
+ errno_t err = fopen_s(&f, public_key_name, "r");
+ if (err != 0) {
+#else
+ FILE *f = fopen (public_key_name, "r");
+ if (f == NULL) {
+#endif
+ vlogprintf (E_WARNING, "Couldn't open public key file: %s\n", public_key_name);
+ return NULL;
+ }
+ RSA *res = PEM_read_RSAPublicKey (f, NULL, NULL, NULL);
+ fclose (f);
+ if (res == NULL) {
+ vlogprintf (E_WARNING, "PEM_read_RSAPublicKey returns NULL.\n");
+ return NULL;
+ }
+
+ vlogprintf (E_NOTICE, "public key '%s' loaded successfully\n", public_key_name);
+
+ return res;
+}
+
+
+
+
+/*
+ *
+ * UNAUTHORIZED (DH KEY EXCHANGE) PROTOCOL PART
+ *
+ */
+
+#define ENCRYPT_BUFFER_INTS 16384
+static int encrypt_buffer[ENCRYPT_BUFFER_INTS];
+
+#define DECRYPT_BUFFER_INTS 16384
+static int decrypt_buffer[ENCRYPT_BUFFER_INTS];
+
+static int encrypt_packet_buffer (struct tgl_state *TLS, struct tgl_dc *DC) {
+ RSA *key = TLS->rsa_key_loaded[DC->rsa_key_idx];
+ return tgl_pad_rsa_encrypt (TLS, (char *) packet_buffer, (packet_ptr - packet_buffer) * 4, (char *) encrypt_buffer, ENCRYPT_BUFFER_INTS * 4, key->n, key->e);
+}
+
+static int encrypt_packet_buffer_aes_unauth (const char server_nonce[16], const char hidden_client_nonce[32]) {
+ tgl_init_aes_unauth (server_nonce, hidden_client_nonce, AES_ENCRYPT);
+ return tgl_pad_aes_encrypt ((char *) packet_buffer, (packet_ptr - packet_buffer) * 4, (char *) encrypt_buffer, ENCRYPT_BUFFER_INTS * 4);
+}
+
+//
+// Used in unauthorized part of protocol
+//
+static int rpc_send_packet (struct tgl_state *TLS, struct connection *c) {
+ static struct {
+ long long auth_key_id;
+ long long out_msg_id;
+ int msg_len;
+ } unenc_msg_header;
+
+ int len = (packet_ptr - packet_buffer) * 4;
+ TLS->net_methods->incr_out_packet_num (c);
+
+ struct tgl_dc *DC = TLS->net_methods->get_dc (c);
+ struct tgl_session *S = TLS->net_methods->get_session (c);
+
+ unenc_msg_header.out_msg_id = generate_next_msg_id (TLS, DC, S);
+ unenc_msg_header.msg_len = len;
+
+ int total_len = len + 20;
+ assert (total_len > 0 && !(total_len & 0xfc000003));
+ total_len >>= 2;
+ vlogprintf (E_DEBUG, "writing packet: total_len = %d, len = %d\n", total_len, len);
+ if (total_len < 0x7f) {
+ assert (TLS->net_methods->write_out (c, &total_len, 1) == 1);
+ } else {
+ total_len = (total_len << 8) | 0x7f;
+ assert (TLS->net_methods->write_out (c, &total_len, 4) == 4);
+ }
+ TLS->net_methods->write_out (c, &unenc_msg_header, 20);
+ TLS->net_methods->write_out (c, packet_buffer, len);
+ TLS->net_methods->flush_out (c);
+
+ total_packets_sent ++;
+ total_data_sent += total_len;
+ return 1;
+}
+
+static int rpc_send_message (struct tgl_state *TLS, struct connection *c, void *data, int len) {
+ assert (len > 0 && !(len & 0xfc000003));
+
+ int total_len = len >> 2;
+ if (total_len < 0x7f) {
+ assert (TLS->net_methods->write_out (c, &total_len, 1) == 1);
+ } else {
+ total_len = (total_len << 8) | 0x7f;
+ assert (TLS->net_methods->write_out (c, &total_len, 4) == 4);
+ }
+
+ TLS->net_methods->incr_out_packet_num (c);
+ assert (TLS->net_methods->write_out (c, data, len) == len);
+ TLS->net_methods->flush_out (c);
+
+ total_packets_sent ++;
+ total_data_sent += total_len;
+ return 1;
+}
+
+//
+// State machine. See description at
+// https://core.telegram.org/mtproto/auth_key
+//
+
+
+static int check_unauthorized_header (struct tgl_state *TLS) {
+ long long auth_key_id = fetch_long ();
+ if (auth_key_id) {
+ vlogprintf (E_ERROR, "ERROR: auth_key_id should be NULL\n");
+ return -1;
+ }
+ fetch_long (); // msg_id
+ int len = fetch_int ();
+ if (len != 4 * (in_end - in_ptr)) {
+ vlogprintf (E_ERROR, "ERROR: length mismatch\n");
+ return -1;
+ }
+ return 0;
+}
+
+/* {{{ REQ_PQ */
+// req_pq#60469778 nonce:int128 = ResPQ
+static int send_req_pq_packet (struct tgl_state *TLS, struct connection *c) {
+ struct tgl_dc *DC = TLS->net_methods->get_dc (c);
+ assert (DC->state == st_init);
+
+ tglt_secure_random (DC->nonce, 16);
+ clear_packet ();
+ out_int (CODE_req_pq);
+ out_ints ((int *)DC->nonce, 4);
+ rpc_send_packet (TLS, c);
+
+ DC->state = st_reqpq_sent;
+ return 1;
+}
+
+// req_pq#60469778 nonce:int128 = ResPQ
+static int send_req_pq_temp_packet (struct tgl_state *TLS, struct connection *c) {
+ struct tgl_dc *DC = TLS->net_methods->get_dc (c);
+ assert (DC->state == st_authorized);
+
+ tglt_secure_random (DC->nonce, 16);
+ clear_packet ();
+ out_int (CODE_req_pq);
+ out_ints ((int *)DC->nonce, 4);
+ rpc_send_packet (TLS, c);
+
+ DC->state = st_reqpq_sent_temp;
+ return 1;
+}
+/* }}} */
+
+/* {{{ REQ DH */
+// req_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params;
+// p_q_inner_data#83c95aec pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 = P_Q_inner_data;
+// p_q_inner_data_temp#3c6a84d4 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 expires_in:int = P_Q_inner_data;
+static void send_req_dh_packet (struct tgl_state *TLS, struct connection *c, BIGNUM *pq, int temp_key) {
+ struct tgl_dc *DC = TLS->net_methods->get_dc (c);
+
+ BIGNUM *p = BN_new ();
+ BIGNUM *q = BN_new ();
+ assert (bn_factorize (pq, p, q) >= 0);
+
+ clear_packet ();
+ packet_ptr += 5;
+ out_int (temp_key ? CODE_p_q_inner_data_temp : CODE_p_q_inner_data);
+
+ out_bignum (pq);
+ out_bignum (p);
+ out_bignum (q);
+
+ out_ints ((int *) DC->nonce, 4);
+ out_ints ((int *) DC->server_nonce, 4);
+ tglt_secure_random (DC->new_nonce, 32);
+ out_ints ((int *) DC->new_nonce, 8);
+ if (temp_key) {
+ out_int (TLS->temp_key_expire_time);
+ }
+ sha1 ((unsigned char *) (packet_buffer + 5), (packet_ptr - packet_buffer - 5) * 4, (unsigned char *) packet_buffer);
+
+ int l = encrypt_packet_buffer (TLS, DC);
+
+ clear_packet ();
+ out_int (CODE_req_DH_params);
+ out_ints ((int *) DC->nonce, 4);
+ out_ints ((int *) DC->server_nonce, 4);
+ out_bignum (p);
+ out_bignum (q);
+
+ out_long (TLS->rsa_key_fingerprint[DC->rsa_key_idx]);
+ out_cstring ((char *) encrypt_buffer, l);
+
+ BN_free (p);
+ BN_free (q);
+ DC->state = temp_key ? st_reqdh_sent_temp : st_reqdh_sent;
+ rpc_send_packet (TLS, c);
+}
+/* }}} */
+
+/* {{{ SEND DH PARAMS */
+// set_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer;
+// client_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data
+static void send_dh_params (struct tgl_state *TLS, struct connection *c, BIGNUM *dh_prime, BIGNUM *g_a, int g, int temp_key) {
+ struct tgl_dc *DC = TLS->net_methods->get_dc (c);
+
+ clear_packet ();
+ packet_ptr += 5;
+ out_int (CODE_client_DH_inner_data);
+ out_ints ((int *) DC->nonce, 4);
+ out_ints ((int *) DC->server_nonce, 4);
+ out_long (0);
+
+ BIGNUM *dh_g = BN_new ();
+ ensure (BN_set_word (dh_g, g));
+
+ static unsigned char s_power[256];
+ tglt_secure_random (s_power, 256);
+ BIGNUM *dh_power = BN_bin2bn ((unsigned char *)s_power, 256, 0);
+ ensure_ptr (dh_power);
+
+ BIGNUM *y = BN_new ();
+ ensure_ptr (y);
+ ensure (BN_mod_exp (y, dh_g, dh_power, dh_prime, TLS->BN_ctx));
+ out_bignum (y);
+ BN_free (y);
+
+ BIGNUM *auth_key_num = BN_new ();
+ ensure (BN_mod_exp (auth_key_num, g_a, dh_power, dh_prime, TLS->BN_ctx));
+ int l = BN_num_bytes (auth_key_num);
+ assert (l >= 250 && l <= 256);
+ assert (BN_bn2bin (auth_key_num, (unsigned char *)(temp_key ? DC->temp_auth_key : DC->auth_key)));
+ if (l < 256) {
+ char *key = temp_key ? DC->temp_auth_key : DC->auth_key;
+ memmove (key + 256 - l, key, l);
+ memset (key, 0, 256 - l);
+ }
+
+ BN_free (dh_power);
+ BN_free (auth_key_num);
+ BN_free (dh_g);
+
+ sha1 ((unsigned char *) (packet_buffer + 5), (packet_ptr - packet_buffer - 5) * 4, (unsigned char *) packet_buffer);
+
+ l = encrypt_packet_buffer_aes_unauth (DC->server_nonce, DC->new_nonce);
+
+ clear_packet ();
+ out_int (CODE_set_client_DH_params);
+ out_ints ((int *) DC->nonce, 4);
+ out_ints ((int *) DC->server_nonce, 4);
+ out_cstring ((char *) encrypt_buffer, l);
+
+ DC->state = temp_key ? st_client_dh_sent_temp : st_client_dh_sent;;
+ rpc_send_packet (TLS, c);
+}
+/* }}} */
+
+/* {{{ RECV RESPQ */
+// resPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:Vector long = ResPQ
+static int process_respq_answer (struct tgl_state *TLS, struct connection *c, char *packet, int len, int temp_key) {
+ assert (!(len & 3));
+ in_ptr = (int *)packet;
+ in_end = in_ptr + (len / 4);
+ if (check_unauthorized_header (TLS) < 0) {
+ return -1;
+ }
+
+ int *in_save = in_ptr;
+ if (skip_type_any (TYPE_TO_PARAM (res_p_q)) < 0 || in_ptr != in_end) {
+ vlogprintf (E_ERROR, "can not parse req_p_q answer\n");
+ return -1;
+ }
+ in_ptr = in_save;
+
+ struct tgl_dc *DC = TLS->net_methods->get_dc (c);
+
+ assert (fetch_int() == CODE_res_p_q);
+
+ static int tmp[4];
+ fetch_ints (tmp, 4);
+ if (memcmp (tmp, DC->nonce, 16)) {
+ vlogprintf (E_ERROR, "nonce mismatch\n");
+ return -1;
+ }
+ fetch_ints (DC->server_nonce, 4);
+
+ BIGNUM *pq = BN_new ();
+ assert (fetch_bignum (pq) >= 0);
+
+ assert (fetch_int () == CODE_vector);
+ int fingerprints_num = fetch_int ();
+ assert (fingerprints_num >= 0);
+ DC->rsa_key_idx = -1;
+
+ int i;
+ for (i = 0; i < fingerprints_num; i++) {
+ int j;
+ long long fprint = fetch_long ();
+ for (j = 0; j < TLS->rsa_key_num; j++) {
+ if (TLS->rsa_key_loaded[j]) {
+ if (fprint == TLS->rsa_key_fingerprint[j]) {
+ DC->rsa_key_idx = j;
+ break;
+ }
+ }
+ }
+ }
+ assert (in_ptr == in_end);
+ if (DC->rsa_key_idx == -1) {
+ vlogprintf (E_ERROR, "fatal: don't have any matching keys\n");
+ return -1;
+ }
+
+ send_req_dh_packet (TLS, c, pq, temp_key);
+
+ BN_free (pq);
+ return 1;
+}
+/* }}} */
+
+/* {{{ RECV DH */
+// server_DH_params_fail#79cb045d nonce:int128 server_nonce:int128 new_nonce_hash:int128 = Server_DH_Params;
+// server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;
+// server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;
+static int process_dh_answer (struct tgl_state *TLS, struct connection *c, char *packet, int len, int temp_key) {
+ assert (!(len & 3));
+ in_ptr = (int *)packet;
+ in_end = in_ptr + (len / 4);
+ if (check_unauthorized_header (TLS) < 0) {
+ return -1;
+ }
+
+ int *in_save = in_ptr;
+ if (skip_type_any (TYPE_TO_PARAM (server_d_h_params)) < 0 || in_ptr != in_end) {
+ vlogprintf (E_ERROR, "can not parse server_DH_params answer\n");
+ return -1;
+ }
+ in_ptr = in_save;
+
+ struct tgl_dc *DC = TLS->net_methods->get_dc (c);
+
+ unsigned op = fetch_int ();
+ assert (op == CODE_server__d_h_params_ok || op == CODE_server__d_h_params_fail);
+
+ int tmp[4];
+ fetch_ints (tmp, 4);
+ if (memcmp (tmp, DC->nonce, 16)) {
+ vlogprintf (E_ERROR, "nonce mismatch\n");
+ return -1;
+ }
+ assert (!memcmp (tmp, DC->nonce, 16));
+ fetch_ints (tmp, 4);
+ if (memcmp (tmp, DC->server_nonce, 16)) {
+ vlogprintf (E_ERROR, "nonce mismatch\n");
+ return -1;
+ }
+ assert (!memcmp (tmp, DC->server_nonce, 16));
+
+ if (op == CODE_server__d_h_params_fail) {
+ vlogprintf (E_ERROR, "DH params fail\n");
+ return -1;
+ }
+
+ tgl_init_aes_unauth (DC->server_nonce, DC->new_nonce, AES_DECRYPT);
+
+ int l = prefetch_strlen ();
+ assert (l >= 0);
+ if (!l) {
+ vlogprintf (E_ERROR, "non-empty encrypted part expected\n");
+ return -1;
+ }
+ l = tgl_pad_aes_decrypt (fetch_str (l), l, (char *) decrypt_buffer, DECRYPT_BUFFER_INTS * 4 - 16);
+ assert (in_ptr == in_end);
+
+ in_ptr = decrypt_buffer + 5;
+ in_end = decrypt_buffer + (l >> 2);
+ if (skip_type_any (TYPE_TO_PARAM (server_d_h_inner_data)) < 0) {
+ vlogprintf (E_ERROR, "can not parse server_DH_inner_data answer\n");
+ return -1;
+ }
+ in_ptr = decrypt_buffer + 5;
+
+ assert (fetch_int () == (int)CODE_server_DH_inner_data);
+ fetch_ints (tmp, 4);
+ if (memcmp (tmp, DC->nonce, 16)) {
+ vlogprintf (E_ERROR, "nonce mismatch\n");
+ return -1;
+ }
+ assert (!memcmp (tmp, DC->nonce, 16));
+ fetch_ints (tmp, 4);
+ if (memcmp (tmp, DC->server_nonce, 16)) {
+ vlogprintf (E_ERROR, "nonce mismatch\n");
+ return -1;
+ }
+ assert (!memcmp (tmp, DC->server_nonce, 16));
+ int g = fetch_int ();
+
+ BIGNUM *dh_prime = BN_new ();
+ BIGNUM *g_a = BN_new ();
+ assert (fetch_bignum (dh_prime) > 0);
+ assert (fetch_bignum (g_a) > 0);
+
+ if (tglmp_check_DH_params (TLS, dh_prime, g) < 0) {
+ vlogprintf (E_ERROR, "bad DH params\n");
+ return -1;
+ }
+ if (tglmp_check_g_a (TLS, dh_prime, g_a) < 0) {
+ vlogprintf (E_ERROR, "bad dh_prime\n");
+ return -1;
+ }
+
+ int server_time = fetch_int ();
+ assert (in_ptr <= in_end);
+
+ static char sha1_buffer[20];
+ sha1 ((unsigned char *) decrypt_buffer + 20, (in_ptr - decrypt_buffer - 5) * 4, (unsigned char *) sha1_buffer);
+ if (memcmp (decrypt_buffer, sha1_buffer, 20)) {
+ vlogprintf (E_ERROR, "bad encrypted message SHA1\n");
+ return -1;
+ }
+ if ((char *) in_end - (char *) in_ptr >= 16) {
+ vlogprintf (E_ERROR, "too much padding\n");
+ return -1;
+ }
+
+ DC->server_time_delta = server_time - get_utime (CLOCK_REALTIME);
+ DC->server_time_udelta = server_time - get_utime (CLOCK_MONOTONIC);
+
+ send_dh_params (TLS, c, dh_prime, g_a, g, temp_key);
+
+ BN_free (dh_prime);
+ BN_free (g_a);
+
+ return 1;
+}
+/* }}} */
+
+static void create_temp_auth_key (struct tgl_state *TLS, struct connection *c) {
+ assert (TLS->enable_pfs);
+ send_req_pq_temp_packet (TLS, c);
+}
+
+int tglmp_encrypt_inner_temp (struct tgl_state *TLS, struct connection *c, int *msg, int msg_ints, int useful, void *data, long long msg_id);
+static long long msg_id_override;
+static void mpc_on_get_config (struct tgl_state *TLS, void *extra, int success);
+static void bind_temp_auth_key (struct tgl_state *TLS, struct connection *c);
+
+/* {{{ RECV AUTH COMPLETE */
+
+// dh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer;
+// dh_gen_retry#46dc1fb9 nonce:int128 server_nonce:int128 new_nonce_hash2:int128 = Set_client_DH_params_answer;
+// dh_gen_fail#a69dae02 nonce:int128 server_nonce:int128 new_nonce_hash3:int128 = Set_client_DH_params_answer;
+static int process_auth_complete (struct tgl_state *TLS, struct connection *c, char *packet, int len, int temp_key) {
+ struct tgl_dc *DC = TLS->net_methods->get_dc (c);
+
+ assert (!(len & 3));
+ in_ptr = (int *)packet;
+ in_end = in_ptr + (len / 4);
+ if (check_unauthorized_header (TLS) < 0) {
+ return -1;
+ }
+
+ int *in_save = in_ptr;
+ if (skip_type_any (TYPE_TO_PARAM (set_client_d_h_params_answer)) < 0 || in_ptr != in_end) {
+ vlogprintf (E_ERROR, "can not parse server_DH_params answer\n");
+ return -1;
+ }
+ in_ptr = in_save;
+
+ unsigned op = fetch_int ();
+ assert (op == CODE_dh_gen_ok || op == CODE_dh_gen_retry || op == CODE_dh_gen_fail);
+
+ int tmp[4];
+ fetch_ints (tmp, 4);
+ if (memcmp (DC->nonce, tmp, 16)) {
+ vlogprintf (E_ERROR, "nonce mismatch\n");
+ return -1;
+ }
+ fetch_ints (tmp, 4);
+ if (memcmp (DC->server_nonce, tmp, 16)) {
+ vlogprintf (E_ERROR, "nonce mismatch\n");
+ return -1;
+ }
+ if (op != CODE_dh_gen_ok) {
+ vlogprintf (E_ERROR, "something bad. Retry regen\n");
+ return -1;
+ }
+
+ fetch_ints (tmp, 4);
+
+ static unsigned char th[44], sha1_buffer[20];
+ memcpy (th, DC->new_nonce, 32);
+ th[32] = 1;
+ if (!temp_key) {
+ sha1 ((unsigned char *)DC->auth_key, 256, sha1_buffer);
+ } else {
+ sha1 ((unsigned char *)DC->temp_auth_key, 256, sha1_buffer);
+ }
+ memcpy (th + 33, sha1_buffer, 8);
+ sha1 (th, 41, sha1_buffer);
+ if (memcmp (tmp, sha1_buffer + 4, 16)) {
+ vlogprintf (E_ERROR, "hash mismatch\n");
+ return -1;
+ }
+
+ if (!temp_key) {
+ bl_do_set_auth_key (TLS, DC->id, (unsigned char *)DC->auth_key);
+ sha1 ((unsigned char *)DC->auth_key, 256, sha1_buffer);
+ } else {
+ sha1 ((unsigned char *)DC->temp_auth_key, 256, sha1_buffer);
+ DC->temp_auth_key_id = *(long long *)(sha1_buffer + 12);
+ }
+
+ DC->server_salt = *(long long *)DC->server_nonce ^ *(long long *)DC->new_nonce;
+
+ DC->state = st_authorized;
+
+ vlogprintf (E_DEBUG, "Auth success\n");
+ if (temp_key) {
+ bind_temp_auth_key (TLS, c);
+ } else {
+ DC->flags |= 1;
+ if (TLS->enable_pfs) {
+ create_temp_auth_key (TLS, c);
+ } else {
+ DC->temp_auth_key_id = DC->auth_key_id;
+ memcpy (DC->temp_auth_key, DC->auth_key, 256);
+ DC->flags |= 2;
+ if (!(DC->flags & 4)) {
+ tgl_do_help_get_config_dc (TLS, DC, mpc_on_get_config, DC);
+ }
+ }
+ }
+
+ return 1;
+}
+/* }}} */
+
+static void bind_temp_auth_key (struct tgl_state *TLS, struct connection *c) {
+ struct tgl_dc *DC = TLS->net_methods->get_dc (c);
+ if (DC->temp_auth_key_bind_query_id) {
+ tglq_query_delete (TLS, DC->temp_auth_key_bind_query_id);
+ }
+ struct tgl_session *S = TLS->net_methods->get_session (c);
+ long long msg_id = generate_next_msg_id (TLS, DC, S);
+
+ clear_packet ();
+ out_int (CODE_bind_auth_key_inner);
+ long long rand;
+ tglt_secure_random (&rand, 8);
+ out_long (rand);
+ out_long (DC->temp_auth_key_id);
+ out_long (DC->auth_key_id);
+
+ if (!S->session_id) {
+ tglt_secure_random (&S->session_id, 8);
+ }
+ out_long (S->session_id);
+ int expires = (int)time (0) + DC->server_time_delta + TLS->temp_key_expire_time;
+ out_int (expires);
+
+ static int data[1000];
+ int len = tglmp_encrypt_inner_temp (TLS, c, packet_buffer, packet_ptr - packet_buffer, 0, data, msg_id);
+ msg_id_override = msg_id;
+ DC->temp_auth_key_bind_query_id = msg_id;
+ tgl_do_send_bind_temp_key (TLS, DC, rand, expires, (void *)data, len, msg_id);
+ msg_id_override = 0;
+}
+
+/*
+ *
+ * AUTHORIZED (MAIN) PROTOCOL PART
+ *
+ */
+
+static struct encrypted_message enc_msg;
+
+static double get_server_time (struct tgl_dc *DC) {
+ //if (!DC->server_time_udelta) {
+ // DC->server_time_udelta = get_utime (CLOCK_REALTIME) - get_utime (CLOCK_MONOTONIC);
+ //}
+ return get_utime (CLOCK_MONOTONIC) + DC->server_time_udelta;
+}
+
+static long long generate_next_msg_id (struct tgl_state *TLS, struct tgl_dc *DC, struct tgl_session *S) {
+ long long next_id = (long long) (get_server_time (DC) * (1LL << 32)) & -4;
+ if (next_id <= S->last_msg_id) {
+ next_id = S->last_msg_id += 4;
+ } else {
+ S->last_msg_id = next_id;
+ }
+ return next_id;
+}
+
+static void init_enc_msg (struct tgl_state *TLS, struct tgl_session *S, int useful) {
+ struct tgl_dc *DC = S->dc;
+ assert (DC->state == st_authorized);
+ assert (DC->temp_auth_key_id);
+ vlogprintf (E_DEBUG, "temp_auth_key_id = 0x%016llx, auth_key_id = 0x%016llx\n", DC->temp_auth_key_id, DC->auth_key_id);
+ enc_msg.auth_key_id = DC->temp_auth_key_id;
+ enc_msg.server_salt = DC->server_salt;
+ if (!S->session_id) {
+ tglt_secure_random (&S->session_id, 8);
+ }
+ enc_msg.session_id = S->session_id;
+ enc_msg.msg_id = msg_id_override ? msg_id_override : generate_next_msg_id (TLS, DC, S);
+ enc_msg.seq_no = S->seq_no;
+ if (useful) {
+ enc_msg.seq_no |= 1;
+ }
+ S->seq_no += 2;
+};
+
+static void init_enc_msg_inner_temp (struct tgl_dc *DC, long long msg_id) {
+ enc_msg.auth_key_id = DC->auth_key_id;
+ tglt_secure_random (&enc_msg.server_salt, 8);
+ tglt_secure_random (&enc_msg.session_id, 8);
+ enc_msg.msg_id = msg_id;
+ enc_msg.seq_no = 0;
+};
+
+
+static int aes_encrypt_message (struct tgl_state *TLS, char *key, struct encrypted_message *enc) {
+ unsigned char sha1_buffer[20];
+ const int MINSZ = offsetof (struct encrypted_message, message);
+ const int UNENCSZ = offsetof (struct encrypted_message, server_salt);
+
+ int enc_len = (MINSZ - UNENCSZ) + enc->msg_len;
+ assert (enc->msg_len >= 0 && enc->msg_len <= MAX_MESSAGE_INTS * 4 - 16 && !(enc->msg_len & 3));
+ sha1 ((unsigned char *) &enc->server_salt, enc_len, sha1_buffer);
+ vlogprintf (E_DEBUG, "sending message with sha1 %08x\n", *(int *)sha1_buffer);
+ memcpy (enc->msg_key, sha1_buffer + 4, 16);
+ tgl_init_aes_auth (key, enc->msg_key, AES_ENCRYPT);
+ return tgl_pad_aes_encrypt ((char *) &enc->server_salt, enc_len, (char *) &enc->server_salt, MAX_MESSAGE_INTS * 4 + (MINSZ - UNENCSZ));
+}
+
+long long tglmp_encrypt_send_message (struct tgl_state *TLS, struct connection *c, int *msg, int msg_ints, int flags) {
+ struct tgl_dc *DC = TLS->net_methods->get_dc (c);
+ struct tgl_session *S = TLS->net_methods->get_session (c);
+ assert (S);
+ if (!(DC->flags & 4) && !(flags & 2)) {
+ return generate_next_msg_id (TLS, DC, S);
+ }
+
+ const int UNENCSZ = offsetof (struct encrypted_message, server_salt);
+ if (msg_ints <= 0 || msg_ints > MAX_MESSAGE_INTS - 4) {
+ return -1;
+ }
+ if (msg) {
+ memcpy (enc_msg.message, msg, msg_ints * 4);
+ enc_msg.msg_len = msg_ints * 4;
+ } else {
+ if ((enc_msg.msg_len & 0x80000003) || enc_msg.msg_len > MAX_MESSAGE_INTS * 4 - 16) {
+ return -1;
+ }
+ }
+ init_enc_msg (TLS, S, flags & 1);
+
+ int l = aes_encrypt_message (TLS, DC->temp_auth_key, &enc_msg);
+ assert (l > 0);
+ rpc_send_message (TLS, c, &enc_msg, l + UNENCSZ);
+
+ return S->last_msg_id;
+}
+
+int tglmp_encrypt_inner_temp (struct tgl_state *TLS, struct connection *c, int *msg, int msg_ints, int useful, void *data, long long msg_id) {
+ struct tgl_dc *DC = TLS->net_methods->get_dc (c);
+ struct tgl_session *S = TLS->net_methods->get_session (c);
+ assert (S);
+
+ const int UNENCSZ = offsetof (struct encrypted_message, server_salt);
+ if (msg_ints <= 0 || msg_ints > MAX_MESSAGE_INTS - 4) {
+ return -1;
+ }
+ memcpy (enc_msg.message, msg, msg_ints * 4);
+ enc_msg.msg_len = msg_ints * 4;
+
+ init_enc_msg_inner_temp (DC, msg_id);
+
+ int l = aes_encrypt_message (TLS, DC->auth_key, &enc_msg);
+ assert (l > 0);
+ //rpc_send_message (c, &enc_msg, l + UNENCSZ);
+ memcpy (data, &enc_msg, l + UNENCSZ);
+
+ return l + UNENCSZ;
+}
+
+static int rpc_execute_answer (struct tgl_state *TLS, struct connection *c, long long msg_id);
+
+static int work_container (struct tgl_state *TLS, struct connection *c, long long msg_id) {
+ vlogprintf (E_DEBUG, "work_container: msg_id = %"_PRINTF_INT64_"d\n", msg_id);
+ assert (fetch_int () == CODE_msg_container);
+ int n = fetch_int ();
+ int i;
+ for (i = 0; i < n; i++) {
+ long long id = fetch_long ();
+ //int seqno = fetch_int ();
+ fetch_int (); // seq_no
+ if (id & 1) {
+ tgln_insert_msg_id (TLS, TLS->net_methods->get_session (c), id);
+ }
+ int bytes = fetch_int ();
+ int *t = in_end;
+ in_end = in_ptr + (bytes / 4);
+ int r = rpc_execute_answer (TLS, c, id);
+ if (r < 0) { return -1; }
+ assert (in_ptr == in_end);
+ in_end = t;
+ }
+ return 0;
+}
+
+static int work_new_session_created (struct tgl_state *TLS, struct connection *c, long long msg_id) {
+ vlogprintf (E_DEBUG, "work_new_session_created: msg_id = %"_PRINTF_INT64_"d\n", msg_id);
+ assert (fetch_int () == (int)CODE_new_session_created);
+ fetch_long (); // first message id
+ fetch_long (); // unique_id
+ TLS->net_methods->get_dc (c)->server_salt = fetch_long ();
+ if (TLS->started && !(TLS->locks & TGL_LOCK_DIFF) && (TLS->DC_working->flags & TGLDCF_LOGGED_IN)) {
+ tgl_do_get_difference (TLS, 0, 0, 0);
+ }
+ return 0;
+}
+
+static int work_msgs_ack (struct tgl_state *TLS, struct connection *c, long long msg_id) {
+ vlogprintf (E_DEBUG, "work_msgs_ack: msg_id = %"_PRINTF_INT64_"d\n", msg_id);
+ assert (fetch_int () == CODE_msgs_ack);
+ assert (fetch_int () == CODE_vector);
+ int n = fetch_int ();
+ int i;
+ for (i = 0; i < n; i++) {
+ long long id = fetch_long ();
+ vlogprintf (E_DEBUG + 1, "ack for %"_PRINTF_INT64_"d\n", id);
+ tglq_query_ack (TLS, id);
+ }
+ return 0;
+}
+
+static int work_rpc_result (struct tgl_state *TLS, struct connection *c, long long msg_id) {
+ vlogprintf (E_DEBUG, "work_rpc_result: msg_id = %"_PRINTF_INT64_"d\n", msg_id);
+ assert (fetch_int () == (int)CODE_rpc_result);
+ long long id = fetch_long ();
+ int op = prefetch_int ();
+ if (op == CODE_rpc_error) {
+ return tglq_query_error (TLS, id);
+ } else {
+ return tglq_query_result (TLS, id);
+ }
+}
+
+#define MAX_PACKED_SIZE (1 << 24)
+static int work_packed (struct tgl_state *TLS, struct connection *c, long long msg_id) {
+ assert (fetch_int () == CODE_gzip_packed);
+ static int in_gzip;
+ static int buf[MAX_PACKED_SIZE >> 2];
+ assert (!in_gzip);
+ in_gzip = 1;
+
+ int l = prefetch_strlen ();
+ char *s = fetch_str (l);
+
+ int total_out = tgl_inflate (s, l, buf, MAX_PACKED_SIZE);
+ int *end = in_ptr;
+ int *eend = in_end;
+ //assert (total_out % 4 == 0);
+ in_ptr = buf;
+ in_end = in_ptr + total_out / 4;
+ int r = rpc_execute_answer (TLS, c, msg_id);
+ in_ptr = end;
+ in_end = eend;
+ in_gzip = 0;
+ return r;
+}
+
+static int work_bad_server_salt (struct tgl_state *TLS, struct connection *c, long long msg_id) {
+ assert (fetch_int () == (int)CODE_bad_server_salt);
+ long long id = fetch_long ();
+ tglq_query_restart (TLS, id);
+ fetch_int (); // seq_no
+ fetch_int (); // error_code
+ long long new_server_salt = fetch_long ();
+ TLS->net_methods->get_dc (c)->server_salt = new_server_salt;
+ return 0;
+}
+
+static int work_pong (struct tgl_state *TLS, struct connection *c, long long msg_id) {
+ assert (fetch_int () == CODE_pong);
+ fetch_long (); // msg_id
+ fetch_long (); // ping_id
+ return 0;
+}
+
+static int work_detailed_info (struct tgl_state *TLS, struct connection *c, long long msg_id) {
+ assert (fetch_int () == CODE_msg_detailed_info);
+ fetch_long (); // msg_id
+ fetch_long (); // answer_msg_id
+ fetch_int (); // bytes
+ fetch_int (); // status
+ return 0;
+}
+
+static int work_new_detailed_info (struct tgl_state *TLS, struct connection *c, long long msg_id) {
+ assert (fetch_int () == (int)CODE_msg_new_detailed_info);
+ fetch_long (); // answer_msg_id
+ fetch_int (); // bytes
+ fetch_int (); // status
+ return 0;
+}
+
+static int work_bad_msg_notification (struct tgl_state *TLS, struct connection *c, long long msg_id) {
+ assert (fetch_int () == (int)CODE_bad_msg_notification);
+ long long m1 = fetch_long ();
+ int s = fetch_int ();
+ int e = fetch_int ();
+ vlogprintf (E_NOTICE, "bad_msg_notification: msg_id = %"_PRINTF_INT64_"d, seq = %d, error = %d\n", m1, s, e);
+ switch (e) {
+ // Too low msg id
+ case 16:
+ tglq_regen_query (TLS, m1);
+ break;
+ // Too high msg id
+ case 17:
+ tglq_regen_query (TLS, m1);
+ break;
+ default:
+ vlogprintf (E_NOTICE, "bad_msg_notification: msg_id = %"_PRINTF_INT64_"d, seq = %d, error = %d\n", m1, s, e);
+ break;
+ }
+
+ return -1;
+}
+
+static int rpc_execute_answer (struct tgl_state *TLS, struct connection *c, long long msg_id) {
+ int op = prefetch_int ();
+ switch (op) {
+ case CODE_msg_container:
+ return work_container (TLS, c, msg_id);
+ case CODE_new_session_created:
+ return work_new_session_created (TLS, c, msg_id);
+ case CODE_msgs_ack:
+ return work_msgs_ack (TLS, c, msg_id);
+ case CODE_rpc_result:
+ return work_rpc_result (TLS, c, msg_id);
+ case CODE_update_short:
+ case CODE_updates:
+ case CODE_update_short_message:
+ case CODE_update_short_chat_message:
+ case CODE_updates_too_long:
+ tglu_work_any_updates (TLS);
+ return 0;
+ case CODE_gzip_packed:
+ return work_packed (TLS, c, msg_id);
+ case CODE_bad_server_salt:
+ return work_bad_server_salt (TLS, c, msg_id);
+ case CODE_pong:
+ return work_pong (TLS, c, msg_id);
+ case CODE_msg_detailed_info:
+ return work_detailed_info (TLS, c, msg_id);
+ case CODE_msg_new_detailed_info:
+ return work_new_detailed_info (TLS, c, msg_id);
+ case CODE_bad_msg_notification:
+ return work_bad_msg_notification (TLS, c, msg_id);
+ }
+ vlogprintf (E_WARNING, "Unknown message: %08x\n", op);
+ in_ptr = in_end; // Will not fail due to assertion in_ptr == in_end
+ return 0;
+}
+
+static struct mtproto_methods mtproto_methods;
+void tgls_free_session (struct tgl_state *TLS, struct tgl_session *S);
+/*
+static char *get_ipv6 (struct tgl_state *TLS, int num) {
+ static char res[1<< 10];
+ if (TLS->test_mode) {
+ switch (num) {
+ case 1:
+ strcpy (res, TG_SERVER_TEST_IPV6_1);
+ break;
+ case 2:
+ strcpy (res, TG_SERVER_TEST_IPV6_2);
+ break;
+ case 3:
+ strcpy (res, TG_SERVER_TEST_IPV6_3);
+ break;
+ default:
+ assert (0);
+ }
+ } else {
+ switch (num) {
+ case 1:
+ strcpy (res, TG_SERVER_IPV6_1);
+ break;
+ case 2:
+ strcpy (res, TG_SERVER_IPV6_2);
+ break;
+ case 3:
+ strcpy (res, TG_SERVER_IPV6_3);
+ break;
+ case 4:
+ strcpy (res, TG_SERVER_IPV6_4);
+ break;
+ case 5:
+ strcpy (res, TG_SERVER_IPV6_5);
+ break;
+ default:
+ assert (0);
+ }
+ }
+ return res;
+}
+*/
+
+static void create_session_connect (struct tgl_state *TLS, struct tgl_session *S) {
+ struct tgl_dc *DC = S->dc;
+
+ if (TLS->ipv6_enabled) {
+ S->c = TLS->net_methods->create_connection (TLS, DC->options[1]->ip, DC->options[1]->port, S, DC, &mtproto_methods);
+ } else {
+ S->c = TLS->net_methods->create_connection (TLS, DC->options[0]->ip, DC->options[0]->port, S, DC, &mtproto_methods);
+ }
+}
+
+static void fail_connection (struct tgl_state *TLS, struct connection *c) {
+ struct tgl_session *S = TLS->net_methods->get_session (c);
+ TLS->net_methods->free (c);
+ create_session_connect (TLS, S);
+}
+
+static void fail_session (struct tgl_state *TLS, struct tgl_session *S) {
+ vlogprintf (E_NOTICE, "failing session %"_PRINTF_INT64_"d\n", S->session_id);
+ struct tgl_dc *DC = S->dc;
+ tgls_free_session (TLS, S);
+ DC->sessions[0] = NULL;
+ tglmp_dc_create_session (TLS, DC);
+}
+
+static int process_rpc_message (struct tgl_state *TLS, struct connection *c, struct encrypted_message *enc, int len) {
+ const int MINSZ = offsetof (struct encrypted_message, message);
+ const int UNENCSZ = offsetof (struct encrypted_message, server_salt);
+ vlogprintf (E_DEBUG, "process_rpc_message(), len=%d\n", len);
+ if (len < MINSZ || (len & 15) != (UNENCSZ & 15)) {
+ vlogprintf (E_WARNING, "Incorrect packet from server. Closing connection\n");
+ fail_connection (TLS, c);
+ return -1;
+ }
+ assert (len >= MINSZ && (len & 15) == (UNENCSZ & 15));
+ struct tgl_dc *DC = TLS->net_methods->get_dc (c);
+ if (enc->auth_key_id != DC->temp_auth_key_id && enc->auth_key_id != DC->auth_key_id) {
+ vlogprintf (E_WARNING, "received msg from dc %d with auth_key_id %"_PRINTF_INT64_"d (perm_auth_key_id %"_PRINTF_INT64_"d temp_auth_key_id %"_PRINTF_INT64_"d). Dropping\n",
+ DC->id, enc->auth_key_id, DC->auth_key_id, DC->temp_auth_key_id);
+ return 0;
+ }
+ if (enc->auth_key_id == DC->temp_auth_key_id) {
+ assert (enc->auth_key_id == DC->temp_auth_key_id);
+ assert (DC->temp_auth_key_id);
+ tgl_init_aes_auth (DC->temp_auth_key + 8, enc->msg_key, AES_DECRYPT);
+ } else {
+ assert (enc->auth_key_id == DC->auth_key_id);
+ assert (DC->auth_key_id);
+ tgl_init_aes_auth (DC->auth_key + 8, enc->msg_key, AES_DECRYPT);
+ }
+
+ int l = tgl_pad_aes_decrypt ((char *)&enc->server_salt, len - UNENCSZ, (char *)&enc->server_salt, len - UNENCSZ);
+ assert (l == len - UNENCSZ);
+
+ if (!(!(enc->msg_len & 3) && enc->msg_len > 0 && enc->msg_len <= len - MINSZ && len - MINSZ - enc->msg_len <= 12)) {
+ vlogprintf (E_WARNING, "Incorrect packet from server. Closing connection\n");
+ fail_connection (TLS, c);
+ return -1;
+ }
+ assert (!(enc->msg_len & 3) && enc->msg_len > 0 && enc->msg_len <= len - MINSZ && len - MINSZ - enc->msg_len <= 12);
+
+ struct tgl_session *S = TLS->net_methods->get_session (c);
+ if (!S || S->session_id != enc->session_id) {
+ vlogprintf (E_WARNING, "Message to bad session. Drop.\n");
+ return 0;
+ }
+
+ static unsigned char sha1_buffer[20];
+ sha1 ((void *)&enc->server_salt, enc->msg_len + (MINSZ - UNENCSZ), sha1_buffer);
+ if (memcmp (&enc->msg_key, sha1_buffer + 4, 16)) {
+ vlogprintf (E_WARNING, "Incorrect packet from server. Closing connection\n");
+ fail_connection (TLS, c);
+ return -1;
+ }
+ assert (!memcmp (&enc->msg_key, sha1_buffer + 4, 16));
+
+ int this_server_time = enc->msg_id >> 32LL;
+ if (!S->received_messages) {
+ DC->server_time_delta = this_server_time - get_utime (CLOCK_REALTIME);
+ if (DC->server_time_udelta) {
+ vlogprintf (E_WARNING, "adjusting CLOCK_MONOTONIC delta to %lf\n",
+ DC->server_time_udelta - this_server_time + get_utime (CLOCK_MONOTONIC));
+ }
+ DC->server_time_udelta = this_server_time - get_utime (CLOCK_MONOTONIC);
+ }
+
+ double st = get_server_time (DC);
+ if (this_server_time < st - 300 || this_server_time > st + 30) {
+ vlogprintf (E_WARNING, "bad msg time: salt = %"_PRINTF_INT64_"d, session_id = %"_PRINTF_INT64_"d, msg_id = %"_PRINTF_INT64_"d, seq_no = %d, st = %lf, now = %lf\n", enc->server_salt, enc->session_id, enc->msg_id, enc->seq_no, st, get_utime (CLOCK_REALTIME));
+ fail_session (TLS, S);
+ return -1;
+ }
+ S->received_messages ++;
+
+ if (DC->server_salt != enc->server_salt) {
+ DC->server_salt = enc->server_salt;
+ }
+
+ assert (this_server_time >= st - 300 && this_server_time <= st + 30);
+ //assert (enc->msg_id > server_last_msg_id && (enc->msg_id & 3) == 1);
+ vlogprintf (E_DEBUG, "received mesage id %016llx\n", enc->msg_id);
+ //server_last_msg_id = enc->msg_id;
+
+ //*(long long *)(longpoll_query + 3) = *(long long *)((char *)(&enc->msg_id) + 0x3c);
+ //*(long long *)(longpoll_query + 5) = *(long long *)((char *)(&enc->msg_id) + 0x3c);
+
+ assert (l >= (MINSZ - UNENCSZ) + 8);
+ //assert (enc->message[0] == CODE_rpc_result && *(long long *)(enc->message + 1) == client_last_msg_id);
+
+ in_ptr = enc->message;
+ in_end = in_ptr + (enc->msg_len / 4);
+
+ if (enc->msg_id & 1) {
+ tgln_insert_msg_id (TLS, S, enc->msg_id);
+ }
+ assert (S->session_id == enc->session_id);
+
+ if (rpc_execute_answer (TLS, c, enc->msg_id) < 0) {
+ fail_session (TLS, S);
+ return -1;
+ }
+ assert (in_ptr == in_end);
+ return 0;
+}
+
+
+static int rpc_execute (struct tgl_state *TLS, struct connection *c, int op, int len) {
+ struct tgl_dc *DC = TLS->net_methods->get_dc (c);
+
+ if (len >= MAX_RESPONSE_SIZE/* - 12*/ || len < 0/*12*/) {
+ vlogprintf (E_WARNING, "answer too long (%d bytes), skipping\n", len);
+ return 0;
+ }
+
+ int Response_len = len;
+
+ static char Response[MAX_RESPONSE_SIZE];
+ vlogprintf (E_DEBUG, "Response_len = %d\n", Response_len);
+ assert (TLS->net_methods->read_in (c, Response, Response_len) == Response_len);
+
+#if !defined(WIN32) || !defined(_WIN32)
+ setsockopt(c->fd, IPPROTO_TCP, TCP_QUICKACK, (int[]) { 0 }, 4);
+#endif
+#if !defined(__MACH__) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined (__CYGWIN__)
+// setsockopt (c->fd, IPPROTO_TCP, TCP_QUICKACK, (int[]){0}, 4);
+#endif
+ int o = DC->state;
+ //if (DC->flags & 1) { o = st_authorized;}
+ if (o != st_authorized) {
+ vlogprintf (E_DEBUG, "%s: state = %d\n", __func__, o);
+ }
+ switch (o) {
+ case st_reqpq_sent:
+ process_respq_answer (TLS, c, Response/* + 8*/, Response_len/* - 12*/, 0);
+ return 0;
+ case st_reqdh_sent:
+ process_dh_answer (TLS, c, Response/* + 8*/, Response_len/* - 12*/, 0);
+ return 0;
+ case st_client_dh_sent:
+ process_auth_complete (TLS, c, Response/* + 8*/, Response_len/* - 12*/, 0);
+ return 0;
+ case st_reqpq_sent_temp:
+ process_respq_answer (TLS, c, Response/* + 8*/, Response_len/* - 12*/, 1);
+ return 0;
+ case st_reqdh_sent_temp:
+ process_dh_answer (TLS, c, Response/* + 8*/, Response_len/* - 12*/, 1);
+ return 0;
+ case st_client_dh_sent_temp:
+ process_auth_complete (TLS, c, Response/* + 8*/, Response_len/* - 12*/, 1);
+ return 0;
+ case st_authorized:
+ if (op < 0 && op >= -999) {
+ vlogprintf (E_WARNING, "Server error %d\n", op);
+ } else {
+ return process_rpc_message (TLS, c, (void *)(Response/* + 8*/), Response_len/* - 12*/);
+ }
+ return 0;
+ default:
+ vlogprintf (E_ERROR, "fatal: cannot receive answer in state %d\n", DC->state);
+ exit (2);
+ }
+
+ return 0;
+}
+
+
+static int tc_close (struct tgl_state *TLS, struct connection *c, int who) {
+ vlogprintf (E_DEBUG, "outbound rpc connection from dc #%d : closing by %d\n", TLS->net_methods->get_dc(c)->id, who);
+ return 0;
+}
+
+static void mpc_on_get_config (struct tgl_state *TLS, void *extra, int success) {
+ assert (success);
+ struct tgl_dc *DC = extra;
+ DC->flags |= 4;
+}
+
+static int tc_becomes_ready (struct tgl_state *TLS, struct connection *c) {
+ vlogprintf (E_NOTICE, "outbound rpc connection from dc #%d becomed ready\n", TLS->net_methods->get_dc(c)->id);
+ //char byte = 0xef;
+ //assert (TLS->net_methods->write_out (c, &byte, 1) == 1);
+ //TLS->net_methods->flush_out (c);
+
+ struct tgl_dc *DC = TLS->net_methods->get_dc (c);
+ if (DC->flags & 1) { DC->state = st_authorized; }
+ int o = DC->state;
+ if (o == st_authorized && !TLS->enable_pfs) {
+ DC->temp_auth_key_id = DC->auth_key_id;
+ memcpy (DC->temp_auth_key, DC->auth_key, 256);
+ DC->flags |= 2;
+ }
+ switch (o) {
+ case st_init:
+ send_req_pq_packet (TLS, c);
+ break;
+ case st_authorized:
+ if (!(DC->flags & 2)) {
+ assert (TLS->enable_pfs);
+ if (!DC->temp_auth_key_id) {
+ assert (!DC->temp_auth_key_id);
+ create_temp_auth_key (TLS, c);
+ } else {
+ bind_temp_auth_key (TLS, c);
+ }
+ } else if (!(DC->flags & 4)) {
+ tgl_do_help_get_config_dc (TLS, DC, mpc_on_get_config, DC);
+ }
+ break;
+ default:
+ vlogprintf (E_DEBUG, "c_state = %d\n", DC->state);
+ DC->state = st_init; // previous connection was reset
+ send_req_pq_packet (TLS, c);
+ break;
+ }
+ return 0;
+}
+
+static int rpc_becomes_ready (struct tgl_state *TLS, struct connection *c) {
+ return tc_becomes_ready (TLS, c);
+}
+
+static int rpc_close (struct tgl_state *TLS, struct connection *c) {
+ return tc_close (TLS, c, 0);
+}
+
+
+#define RANDSEED_PASSWORD_FILENAME NULL
+#define RANDSEED_PASSWORD_LENGTH 0
+void tglmp_on_start (struct tgl_state *TLS) {
+ tgl_prng_seed (TLS, RANDSEED_PASSWORD_FILENAME, RANDSEED_PASSWORD_LENGTH);
+
+ int i;
+ int ok = 0;
+ for (i = 0; i < TLS->rsa_key_num; i++) {
+ char *key = TLS->rsa_key_list[i];
+ RSA *res = rsa_load_public_key (TLS, key);
+ if (!res) {
+ vlogprintf (E_WARNING, "Can not load key %s\n", key);
+ TLS->rsa_key_loaded[i] = NULL;
+ } else {
+ ok = 1;
+ TLS->rsa_key_loaded[i] = res;
+ TLS->rsa_key_fingerprint[i] = tgl_do_compute_rsa_key_fingerprint (res);
+ }
+ }
+
+ if (!ok) {
+ vlogprintf (E_ERROR, "No public keys found\n");
+ exit (1);
+ }
+}
+
+void tgl_dc_authorize (struct tgl_state *TLS, struct tgl_dc *DC) {
+ //c_state = 0;
+ if (!DC->sessions[0]) {
+ tglmp_dc_create_session (TLS, DC);
+ }
+ vlogprintf (E_DEBUG, "Starting authorization for DC #%d\n", DC->id);
+ //net_loop (0, auth_ok);
+}
+
+#define long_cmp(a,b) ((a) > (b) ? 1 : (a) == (b) ? 0 : -1)
+DEFINE_TREE(long,long long,long_cmp,0)
+
+static int send_all_acks (struct tgl_state *TLS, struct tgl_session *S) {
+ clear_packet ();
+ out_int (CODE_msgs_ack);
+ out_int (CODE_vector);
+ out_int (tree_count_long (S->ack_tree));
+ while (S->ack_tree) {
+ long long x = tree_get_min_long (S->ack_tree);
+ out_long (x);
+ S->ack_tree = tree_delete_long (S->ack_tree, x);
+ }
+ tglmp_encrypt_send_message (TLS, S->c, packet_buffer, packet_ptr - packet_buffer, 0);
+ return 0;
+}
+
+static void send_all_acks_gateway (struct tgl_state *TLS, void *arg) {
+ send_all_acks (TLS, arg);
+}
+
+
+void tgln_insert_msg_id (struct tgl_state *TLS, struct tgl_session *S, long long id) {
+ if (!S->ack_tree) {
+ TLS->timer_methods->insert (S->ev, ACK_TIMEOUT);
+ }
+ if (!tree_lookup_long (S->ack_tree, id)) {
+ S->ack_tree = tree_insert_long (S->ack_tree, id, lrand48 ());
+ }
+}
+
+//extern struct tgl_dc *DC_list[];
+
+
+static void regen_temp_key_gw (struct tgl_state *TLS, void *arg) {
+ tglmp_regenerate_temp_auth_key (TLS, arg);
+}
+
+struct tgl_dc *tglmp_alloc_dc (struct tgl_state *TLS, int flags, int id, char *ip, int port) {
+ //assert (!TLS->DC_list[id]);
+
+ if (!TLS->DC_list[id]) {
+ struct tgl_dc *DC = talloc0 (sizeof (*DC));
+ DC->id = id;
+ TLS->DC_list[id] = DC;
+ if (id > TLS->max_dc_num) {
+ TLS->max_dc_num = id;
+ }
+ DC->ev = TLS->timer_methods->alloc (TLS, regen_temp_key_gw, DC);
+ TLS->timer_methods->insert (DC->ev, 0);
+ }
+
+ struct tgl_dc *DC = TLS->DC_list[id];
+
+ struct tgl_dc_option *O = DC->options[flags & 3];
+
+ struct tgl_dc_option *O2 = O;
+ while (O2) {
+ if (!strcmp (O2->ip, ip)) {
+ tfree_str (ip);
+ return DC;
+ }
+ O2 = O2->next;
+ }
+
+ struct tgl_dc_option *T = talloc (sizeof (*T));
+ T->ip = ip;
+ T->port = port;
+ T->next = O;
+ DC->options[flags & 3] = T;
+
+
+ return DC;
+}
+
+static struct mtproto_methods mtproto_methods = {
+ .execute = rpc_execute,
+ .ready = rpc_becomes_ready,
+ .close = rpc_close
+};
+
+void tglmp_dc_create_session (struct tgl_state *TLS, struct tgl_dc *DC) {
+ struct tgl_session *S = talloc0 (sizeof (*S));
+ assert (RAND_pseudo_bytes ((unsigned char *) &S->session_id, 8) >= 0);
+ S->dc = DC;
+ //S->c = TLS->net_methods->create_connection (TLS, DC->ip, DC->port, S, DC, &mtproto_methods);
+
+ create_session_connect (TLS, S);
+ S->ev = TLS->timer_methods->alloc (TLS, send_all_acks_gateway, S);
+ assert (!DC->sessions[0]);
+ DC->sessions[0] = S;
+}
+
+void tgl_do_send_ping (struct tgl_state *TLS, struct connection *c) {
+ int x[3];
+ x[0] = CODE_ping;
+ *(long long *)(x + 1) = lrand48 () * (1ll << 32) + lrand48 ();
+ tglmp_encrypt_send_message (TLS, c, x, 3, 0);
+}
+
+void tgl_dc_iterator (struct tgl_state *TLS, void (*iterator)(struct tgl_dc *DC)) {
+ int i;
+ for (i = 0; i <= TLS->max_dc_num; i++) {
+ iterator (TLS->DC_list[i]);
+ }
+}
+
+void tgl_dc_iterator_ex (struct tgl_state *TLS, void (*iterator)(struct tgl_dc *DC, void *extra), void *extra) {
+ int i;
+ for (i = 0; i <= TLS->max_dc_num; i++) {
+ iterator (TLS->DC_list[i], extra);
+ }
+}
+
+
+void tglmp_regenerate_temp_auth_key (struct tgl_state *TLS, struct tgl_dc *DC) {
+ DC->flags &= ~6;
+ DC->temp_auth_key_id = 0;
+ memset (DC->temp_auth_key, 0, 256);
+
+ if (!DC->sessions[0]) {
+ tgl_dc_authorize (TLS, DC);
+ return;
+ }
+
+
+ struct tgl_session *S = DC->sessions[0];
+ tglt_secure_random (&S->session_id, 8);
+ S->seq_no = 0;
+
+ TLS->timer_methods->remove (S->ev);
+ S->ack_tree = tree_clear_long (S->ack_tree);
+
+ if (DC->state != st_authorized) {
+ return;
+ }
+
+ if (S->c) {
+ create_temp_auth_key (TLS, S->c);
+ }
+}
+
+void tgls_free_session (struct tgl_state *TLS, struct tgl_session *S) {
+ S->ack_tree = tree_clear_long (S->ack_tree);
+ if (S->ev) { TLS->timer_methods->free (S->ev); }
+ if (S->c) {
+ TLS->net_methods->free (S->c);
+ }
+ tfree (S, sizeof (*S));
+}
+
+void tgls_free_dc (struct tgl_state *TLS, struct tgl_dc *DC) {
+ //if (DC->ip) { tfree_str (DC->ip); }
+
+ struct tgl_session *S = DC->sessions[0];
+ if (S) { tgls_free_session (TLS, S); }
+
+ if (DC->ev) { TLS->timer_methods->free (DC->ev); }
+ tfree (DC, sizeof (*DC));
+}
+
+void tgls_free_pubkey (struct tgl_state *TLS) {
+ int i;
+ for (i = 0; i < TLS->rsa_key_num; i++) {
+ if (TLS->rsa_key_loaded[i]) {
+ RSA_free (TLS->rsa_key_loaded[i]);
+ TLS->rsa_key_loaded[i] = NULL;
+ }
+ }
+}
diff --git a/protocols/Telegram/tgl/mtproto-client.h b/protocols/Telegram/tgl/mtproto-client.h
new file mode 100644
index 0000000000..13a98fd406
--- /dev/null
+++ b/protocols/Telegram/tgl/mtproto-client.h
@@ -0,0 +1,61 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Nikolay Durov, Andrey Lopatin 2012-2013
+ Vitaly Valtman 2013-2015
+*/
+#ifndef __MTPROTO_CLIENT_H__
+#define __MTPROTO_CLIENT_H__
+//#include "net.h"
+#include <openssl/bn.h>
+//void on_start (void);
+//..long long encrypt_send_message (struct connection *c, int *msg, int msg_ints, int useful);
+//void dc_authorize (struct tgl_dc *DC);
+//void work_update (struct connection *c, long long msg_id);
+//void work_update_binlog (void);
+//int check_g (unsigned char p[256], BIGNUM *g);
+//int check_g_bn (BIGNUM *p, BIGNUM *g);
+//int check_DH_params (BIGNUM *p, int g);
+//void secure_random (void *s, int l);
+
+#include "tgl.h"
+
+struct connection;
+struct tgl_dc;
+//#include "queries.h"
+#define TG_APP_HASH "844584f2b1fd2daecee726166dcc1ef8"
+#define TG_APP_ID 10534
+
+#define ACK_TIMEOUT 1
+#define MAX_DC_ID 10
+
+struct connection;
+
+long long tglmp_encrypt_send_message (struct tgl_state *TLS, struct connection *c, int *msg, int msg_ints, int flags);
+void tglmp_dc_create_session (struct tgl_state *TLS, struct tgl_dc *DC);
+//int tglmp_check_g (struct tgl_state *TLS, unsigned char p[256], BIGNUM *g);
+//int tglmp_check_DH_params (struct tgl_state *TLS, BIGNUM *p, int g);
+struct tgl_dc *tglmp_alloc_dc (struct tgl_state *TLS, int flags, int id, char *ip, int port);
+void tglmp_regenerate_temp_auth_key (struct tgl_state *TLS, struct tgl_dc *D);
+
+void tgln_insert_msg_id (struct tgl_state *TLS, struct tgl_session *S, long long id);
+void tglmp_on_start (struct tgl_state *TLS);
+void tgl_dc_authorize (struct tgl_state *TLS, struct tgl_dc *DC);
+void tgls_free_dc (struct tgl_state *TLS, struct tgl_dc *DC);
+void tgls_free_pubkey (struct tgl_state *TLS);
+void tgl_do_send_ping (struct tgl_state *TLS, struct connection *c);
+#endif
diff --git a/protocols/Telegram/tgl/mtproto-common.c b/protocols/Telegram/tgl/mtproto-common.c
new file mode 100644
index 0000000000..fccc349d2b
--- /dev/null
+++ b/protocols/Telegram/tgl/mtproto-common.c
@@ -0,0 +1,474 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Nikolay Durov, Andrey Lopatin 2012-2013
+ Vitaly Valtman 2013-2015
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#define _FILE_OFFSET_BITS 64
+
+#include <assert.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+#include <io.h>
+#include <stdint.h>
+#include <string.h>
+#include <intrin.h>
+#include <process.h>
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#include <tlhelp32.h>
+#include <sys/stat.h>
+#include "tgl.h"
+#elif defined(__MINGW32__)
+#include "tgl.h"
++#include <winsock2.h>
+#include <unistd.h>
+#else
+#include <unistd.h>
+#include <netdb.h>
+#endif
+#include <fcntl.h>
+#include <sys/types.h>
+#include <openssl/bn.h>
+#include <openssl/rand.h>
+#include <openssl/pem.h>
+#include <openssl/aes.h>
+#include <openssl/sha.h>
+#include <openssl/rand.h>
+
+#include "mtproto-common.h"
+#include "tools.h"
+
+#ifdef __MACH__
+#include <mach/clock.h>
+#include <mach/mach.h>
+#endif
+
+
+static int __packet_buffer[PACKET_BUFFER_SIZE + 16];
+int *tgl_packet_ptr;
+int *tgl_packet_buffer = __packet_buffer + 16;
+
+static long long rsa_encrypted_chunks, rsa_decrypted_chunks;
+
+//int verbosity;
+
+static int get_random_bytes (struct tgl_state *TLS, unsigned char *buf, int n) {
+#if defined(WIN32) || defined(_WIN32)
+ if (RAND_bytes(buf, n) != 1)
+ return 0;
+
+ vlogprintf(E_DEBUG, "added %d bytes of real entropy to secure random numbers seed\n", n);
+ *(long *)buf ^= lrand48();
+ srand48(*(long *)buf);
+ return n;
+#else
+ int r = 0, h = open ("/dev/random", O_RDONLY | O_NONBLOCK);
+ if (h >= 0) {
+ r = read (h, buf, n);
+ if (r > 0) {
+ vlogprintf (E_DEBUG, "added %d bytes of real entropy to secure random numbers seed\n", r);
+ } else {
+ r = 0;
+ }
+ close (h);
+ }
+
+ if (r < n) {
+ h = open ("/dev/urandom", O_RDONLY);
+ if (h < 0) {
+ return r;
+ }
+ int s = read (h, buf + r, n - r);
+ close (h);
+ if (s > 0) {
+ r += s;
+ }
+ }
+
+ if (r >= (int) sizeof (long)) {
+ *(long *)buf ^= lrand48 ();
+ srand48 (*(long *)buf);
+ }
+
+ return r;
+#endif
+}
+
+
+/* RDTSC */
+#ifdef _MSC_VER
+#define HAVE_RDTSC
+#pragma intrinsic(__rdtsc)
+static __inline unsigned long long rdtsc(void) {
+ return __rdtsc();
+}
+
+inline DWORD getppid() {
+ HANDLE hSnapshot = INVALID_HANDLE_VALUE;
+ PROCESSENTRY32 pe32;
+ DWORD ppid = 0, pid = GetCurrentProcessId();
+
+ hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
+ __try {
+ if (hSnapshot == INVALID_HANDLE_VALUE) __leave;
+ ZeroMemory(&pe32, sizeof(pe32));
+ pe32.dwSize = sizeof(pe32);
+ if (!Process32First(hSnapshot, &pe32)) __leave;
+
+ do {
+ if (pe32.th32ProcessID == pid) {
+ ppid = pe32.th32ParentProcessID;
+ break;
+ }
+ } while (Process32Next(hSnapshot, &pe32));
+
+ }
+ __finally {
+ if (hSnapshot != INVALID_HANDLE_VALUE) CloseHandle(hSnapshot);
+ }
+ return ppid;
+}
+
+#elif defined(__i386__)
+#define HAVE_RDTSC
+static __inline__ unsigned long long rdtsc (void) {
+ unsigned long long int x;
+ __asm__ volatile ("rdtsc" : "=A" (x));
+ return x;
+}
+#elif defined(__x86_64__)
+#define HAVE_RDTSC
+static __inline__ unsigned long long rdtsc (void) {
+ unsigned hi, lo;
+ __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi));
+ return ((unsigned long long) lo) | (((unsigned long long) hi) << 32);
+}
+#endif
+
+void tgl_prng_seed (struct tgl_state *TLS, const char *password_filename, int password_length) {
+ struct timespec T;
+ tgl_my_clock_gettime (CLOCK_REALTIME, &T);
+ RAND_add (&T, sizeof (T), 4.0);
+#ifdef HAVE_RDTSC
+ unsigned long long r = rdtsc ();
+ RAND_add (&r, 8, 4.0);
+#endif
+#if defined(_MSC_VER)
+ DWORD p = GetCurrentProcessId ();
+#else
+ unsigned short p = getpid ();
+#endif
+ RAND_add (&p, sizeof (p), 0.0);
+ p = getppid ();
+ RAND_add (&p, sizeof (p), 0.0);
+ unsigned char rb[32];
+ int s = get_random_bytes (TLS, rb, 32);
+ if (s > 0) {
+ RAND_add (rb, s, s);
+ }
+ memset (rb, 0, sizeof (rb));
+ if (password_filename && password_length > 0) {
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ int fd = 0;
+ errno_t err = _sopen_s(&fd, password_filename, _O_RDONLY | _O_BINARY, _SH_DENYNO, _S_IREAD | _S_IWRITE);
+ if (err != 0) {
+ vlogprintf(E_WARNING, "Warning: fail to open password file - \"%s\", %s.\n", password_filename, GetErrnoStr (errno));
+#elif defined(WIN32) || defined(_WIN32)
+ int fd = open(password_filename, O_RDONLY | O_BINARY);
+ if (fd < 0) {
+ vlogprintf (E_WARNING, "Warning: fail to open password file - \"%s\", %s.\n", password_filename, GetErrnoStr (errno));
+#else
+ int fd = open (password_filename, O_RDONLY);
+ if (fd < 0) {
+ vlogprintf (E_WARNING, "Warning: fail to open password file - \"%s\", %m.\n", password_filename);
+#endif
+ } else {
+ unsigned char *a = talloc0 (password_length);
+ int l = read (fd, a, password_length);
+ if (l < 0) {
+#if defined(WIN32) || defined(_WIN32)
+ vlogprintf (E_WARNING, "Warning: fail to read password file - \"%s\", %s.\n", password_filename, GetErrnoStr (errno));
+#else
+ vlogprintf (E_WARNING, "Warning: fail to read password file - \"%s\", %m.\n", password_filename);
+#endif
+ } else {
+ vlogprintf (E_DEBUG, "read %d bytes from password file.\n", l);
+ RAND_add (a, l, l);
+ }
+ close (fd);
+ tfree_secure (a, password_length);
+ }
+ }
+ TLS->BN_ctx = BN_CTX_new ();
+ ensure_ptr (TLS->BN_ctx);
+}
+
+int tgl_serialize_bignum (BIGNUM *b, char *buffer, int maxlen) {
+ int itslen = BN_num_bytes (b);
+ int reqlen;
+ if (itslen < 254) {
+ reqlen = itslen + 1;
+ } else {
+ reqlen = itslen + 4;
+ }
+ int newlen = (reqlen + 3) & -4;
+ int pad = newlen - reqlen;
+ reqlen = newlen;
+ if (reqlen > maxlen) {
+ return -reqlen;
+ }
+ if (itslen < 254) {
+ *buffer++ = itslen;
+ } else {
+ *(int *)buffer = (itslen << 8) + 0xfe;
+ buffer += 4;
+ }
+ int l = BN_bn2bin (b, (unsigned char *)buffer);
+ assert (l == itslen);
+ buffer += l;
+ while (pad --> 0) {
+ *buffer++ = 0;
+ }
+ return reqlen;
+}
+
+
+long long tgl_do_compute_rsa_key_fingerprint (RSA *key) {
+ static char tempbuff[4096];
+ static unsigned char sha[20];
+ assert (key->n && key->e);
+ int l1 = tgl_serialize_bignum (key->n, tempbuff, 4096);
+ assert (l1 > 0);
+ int l2 = tgl_serialize_bignum (key->e, tempbuff + l1, 4096 - l1);
+ assert (l2 > 0 && l1 + l2 <= 4096);
+ SHA1 ((unsigned char *)tempbuff, l1 + l2, sha);
+ return *(long long *)(sha + 12);
+}
+
+void tgl_out_cstring (const char *str, long len) {
+ assert (len >= 0 && len < (1 << 24));
+ assert ((char *) packet_ptr + len + 8 < (char *) (packet_buffer + PACKET_BUFFER_SIZE));
+ char *dest = (char *) packet_ptr;
+ if (len < 254) {
+ *dest++ = len;
+ } else {
+ *packet_ptr = (len << 8) + 0xfe;
+ dest += 4;
+ }
+ memcpy (dest, str, len);
+ dest += len;
+ while ((long) dest & 3) {
+ *dest++ = 0;
+ }
+ packet_ptr = (int *) dest;
+}
+
+void tgl_out_cstring_careful (const char *str, long len) {
+ assert (len >= 0 && len < (1 << 24));
+ assert ((char *) packet_ptr + len + 8 < (char *) (packet_buffer + PACKET_BUFFER_SIZE));
+ char *dest = (char *) packet_ptr;
+ if (len < 254) {
+ dest++;
+ if (dest != str) {
+ memmove (dest, str, len);
+ }
+ dest[-1] = len;
+ } else {
+ dest += 4;
+ if (dest != str) {
+ memmove (dest, str, len);
+ }
+ *packet_ptr = (len << 8) + 0xfe;
+ }
+ dest += len;
+ while ((long) dest & 3) {
+ *dest++ = 0;
+ }
+ packet_ptr = (int *) dest;
+}
+
+
+void tgl_out_data (const void *data, long len) {
+ assert (len >= 0 && len < (1 << 24) && !(len & 3));
+ assert ((char *) packet_ptr + len + 8 < (char *) (packet_buffer + PACKET_BUFFER_SIZE));
+ memcpy (packet_ptr, data, len);
+ packet_ptr += len >> 2;
+}
+
+int *tgl_in_ptr, *tgl_in_end;
+
+int tgl_fetch_bignum (BIGNUM *x) {
+ int l = prefetch_strlen ();
+ if (l < 0) {
+ return l;
+ }
+ char *str = fetch_str (l);
+ assert (BN_bin2bn ((unsigned char *) str, l, x) == x);
+ return l;
+}
+
+int tgl_pad_rsa_encrypt (struct tgl_state *TLS, char *from, int from_len, char *to, int size, BIGNUM *N, BIGNUM *E) {
+ int pad = (255000 - from_len - 32) % 255 + 32;
+ int chunks = (from_len + pad) / 255;
+ int bits = BN_num_bits (N);
+ assert (bits >= 2041 && bits <= 2048);
+ assert (from_len > 0 && from_len <= 2550);
+ assert (size >= chunks * 256);
+ assert (RAND_pseudo_bytes ((unsigned char *) from + from_len, pad) >= 0);
+ int i;
+ BIGNUM x, y;
+ BN_init (&x);
+ BN_init (&y);
+ rsa_encrypted_chunks += chunks;
+ for (i = 0; i < chunks; i++) {
+ BN_bin2bn ((unsigned char *) from, 255, &x);
+ assert (BN_mod_exp (&y, &x, E, N, TLS->BN_ctx) == 1);
+ unsigned l = 256 - BN_num_bytes (&y);
+ assert (l <= 256);
+ memset (to, 0, l);
+ BN_bn2bin (&y, (unsigned char *) to + l);
+ to += 256;
+ }
+ BN_free (&x);
+ BN_free (&y);
+ return chunks * 256;
+}
+
+int tgl_pad_rsa_decrypt (struct tgl_state *TLS, char *from, int from_len, char *to, int size, BIGNUM *N, BIGNUM *D) {
+ if (from_len < 0 || from_len > 0x1000 || (from_len & 0xff)) {
+ return -1;
+ }
+ int chunks = (from_len >> 8);
+ int bits = BN_num_bits (N);
+ assert (bits >= 2041 && bits <= 2048);
+ assert (size >= chunks * 255);
+ int i;
+ BIGNUM x, y;
+ BN_init (&x);
+ BN_init (&y);
+ for (i = 0; i < chunks; i++) {
+ ++rsa_decrypted_chunks;
+ BN_bin2bn ((unsigned char *) from, 256, &x);
+ assert (BN_mod_exp (&y, &x, D, N, TLS->BN_ctx) == 1);
+ int l = BN_num_bytes (&y);
+ if (l > 255) {
+ BN_free (&x);
+ BN_free (&y);
+ return -1;
+ }
+ assert (l >= 0 && l <= 255);
+ memset (to, 0, 255 - l);
+ BN_bn2bin (&y, (unsigned char *) to + 255 - l);
+ to += 255;
+ }
+ BN_free (&x);
+ BN_free (&y);
+ return chunks * 255;
+}
+
+static unsigned char aes_key_raw[32], aes_iv[32];
+static AES_KEY aes_key;
+
+void tgl_init_aes_unauth (const char server_nonce[16], const char hidden_client_nonce[32], int encrypt) {
+ static unsigned char buffer[64], hash[20];
+ memcpy (buffer, hidden_client_nonce, 32);
+ memcpy (buffer + 32, server_nonce, 16);
+ SHA1 (buffer, 48, aes_key_raw);
+ memcpy (buffer + 32, hidden_client_nonce, 32);
+ SHA1 (buffer, 64, aes_iv + 8);
+ memcpy (buffer, server_nonce, 16);
+ memcpy (buffer + 16, hidden_client_nonce, 32);
+ SHA1 (buffer, 48, hash);
+ memcpy (aes_key_raw + 20, hash, 12);
+ memcpy (aes_iv, hash + 12, 8);
+ memcpy (aes_iv + 28, hidden_client_nonce, 4);
+ if (encrypt == AES_ENCRYPT) {
+ AES_set_encrypt_key (aes_key_raw, 32*8, &aes_key);
+ } else {
+ AES_set_decrypt_key (aes_key_raw, 32*8, &aes_key);
+ }
+ memset (aes_key_raw, 0, sizeof (aes_key_raw));
+}
+
+void tgl_init_aes_auth (char auth_key[192], char msg_key[16], int encrypt) {
+ static unsigned char buffer[48], hash[20];
+ // sha1_a = SHA1 (msg_key + substr (auth_key, 0, 32));
+ // sha1_b = SHA1 (substr (auth_key, 32, 16) + msg_key + substr (auth_key, 48, 16));
+ // sha1_Ñ = SHA1 (substr (auth_key, 64, 32) + msg_key);
+ // sha1_d = SHA1 (msg_key + substr (auth_key, 96, 32));
+ // aes_key = substr (sha1_a, 0, 8) + substr (sha1_b, 8, 12) + substr (sha1_c, 4, 12);
+ // aes_iv = substr (sha1_a, 8, 12) + substr (sha1_b, 0, 8) + substr (sha1_c, 16, 4) + substr (sha1_d, 0, 8);
+ memcpy (buffer, msg_key, 16);
+ memcpy (buffer + 16, auth_key, 32);
+ SHA1 (buffer, 48, hash);
+ memcpy (aes_key_raw, hash, 8);
+ memcpy (aes_iv, hash + 8, 12);
+
+ memcpy (buffer, auth_key + 32, 16);
+ memcpy (buffer + 16, msg_key, 16);
+ memcpy (buffer + 32, auth_key + 48, 16);
+ SHA1 (buffer, 48, hash);
+ memcpy (aes_key_raw + 8, hash + 8, 12);
+ memcpy (aes_iv + 12, hash, 8);
+
+ memcpy (buffer, auth_key + 64, 32);
+ memcpy (buffer + 32, msg_key, 16);
+ SHA1 (buffer, 48, hash);
+ memcpy (aes_key_raw + 20, hash + 4, 12);
+ memcpy (aes_iv + 20, hash + 16, 4);
+
+ memcpy (buffer, msg_key, 16);
+ memcpy (buffer + 16, auth_key + 96, 32);
+ SHA1 (buffer, 48, hash);
+ memcpy (aes_iv + 24, hash, 8);
+
+ if (encrypt == AES_ENCRYPT) {
+ AES_set_encrypt_key (aes_key_raw, 32*8, &aes_key);
+ } else {
+ AES_set_decrypt_key (aes_key_raw, 32*8, &aes_key);
+ }
+ memset (aes_key_raw, 0, sizeof (aes_key_raw));
+}
+
+int tgl_pad_aes_encrypt (char *from, int from_len, char *to, int size) {
+ int padded_size = (from_len + 15) & -16;
+ assert (from_len > 0 && padded_size <= size);
+ if (from_len < padded_size) {
+ assert (RAND_pseudo_bytes ((unsigned char *) from + from_len, padded_size - from_len) >= 0);
+ }
+ AES_ige_encrypt ((unsigned char *) from, (unsigned char *) to, padded_size, &aes_key, aes_iv, AES_ENCRYPT);
+ return padded_size;
+}
+
+int tgl_pad_aes_decrypt (char *from, int from_len, char *to, int size) {
+ if (from_len <= 0 || from_len > size || (from_len & 15)) {
+ return -1;
+ }
+ AES_ige_encrypt ((unsigned char *) from, (unsigned char *) to, from_len, &aes_key, aes_iv, AES_DECRYPT);
+ return from_len;
+}
+
+
diff --git a/protocols/Telegram/tgl/mtproto-common.h b/protocols/Telegram/tgl/mtproto-common.h
new file mode 100644
index 0000000000..afcea1eeb4
--- /dev/null
+++ b/protocols/Telegram/tgl/mtproto-common.h
@@ -0,0 +1,385 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Nikolay Durov, Andrey Lopatin 2012-2013
+ Vitaly Valtman 2013-2015
+*/
+#ifndef __MTPROTO_COMMON_H__
+#define __MTPROTO_COMMON_H__
+
+#include <string.h>
+#include <openssl/rsa.h>
+#include <openssl/bn.h>
+#include <openssl/aes.h>
+#include <stdio.h>
+#include <assert.h>
+
+//#include "interface.h"
+#include "tools.h"
+#include "auto/constants.h"
+
+#include "tgl.h"
+#include "tgl-inner.h"
+/* DH key exchange protocol data structures */
+#define CODE_req_pq 0x60469778
+#define CODE_resPQ 0x05162463
+#define CODE_req_DH_params 0xd712e4be
+#define CODE_p_q_inner_data 0x83c95aec
+#define CODE_p_q_inner_data_temp 0x3c6a84d4
+#define CODE_server_DH_inner_data 0xb5890dba
+#define CODE_server_DH_params_fail 0x79cb045d
+#define CODE_server_DH_params_ok 0xd0e8075c
+#define CODE_set_client_DH_params 0xf5045f1f
+#define CODE_client_DH_inner_data 0x6643b654
+#define CODE_dh_gen_ok 0x3bcbf734
+#define CODE_dh_gen_retry 0x46dc1fb9
+#define CODE_dh_gen_fail 0xa69dae02
+
+#define CODE_bind_auth_key_inner 0x75a3f765
+
+/* service messages */
+#define CODE_rpc_result 0xf35c6d01
+#define CODE_rpc_error 0x2144ca19
+#define CODE_msg_container 0x73f1f8dc
+#define CODE_msg_copy 0xe06046b2
+#define CODE_msgs_ack 0x62d6b459
+#define CODE_bad_msg_notification 0xa7eff811
+#define CODE_bad_server_salt 0xedab447b
+#define CODE_msgs_state_req 0xda69fb52
+#define CODE_msgs_state_info 0x04deb57d
+#define CODE_msgs_all_info 0x8cc0d131
+#define CODE_new_session_created 0x9ec20908
+#define CODE_msg_resend_req 0x7d861a08
+#define CODE_ping 0x7abe77ec
+#define CODE_pong 0x347773c5
+#define CODE_destroy_session 0xe7512126
+#define CODE_destroy_session_ok 0xe22045fc
+#define CODE_destroy_session_none 0x62d350c9
+#define CODE_destroy_sessions 0x9a6face8
+#define CODE_destroy_sessions_res 0xa8164668
+#define CODE_get_future_salts 0xb921bd04
+#define CODE_future_salt 0x0949d9dc
+#define CODE_future_salts 0xae500895
+#define CODE_rpc_drop_answer 0x58e4a740
+#define CODE_rpc_answer_unknown 0x5e2ad36e
+#define CODE_rpc_answer_dropped_running 0xcd78e586
+#define CODE_rpc_answer_dropped 0xa43ad8b7
+#define CODE_msg_detailed_info 0x276d3ec6
+#define CODE_msg_new_detailed_info 0x809db6df
+#define CODE_ping_delay_disconnect 0xf3427b8c
+#define CODE_gzip_packed 0x3072cfa1
+
+#define CODE_input_peer_notify_settings_old 0x3cf4b1be
+#define CODE_peer_notify_settings_old 0xddbcd4a5
+#define CODE_user_profile_photo_old 0x990d1493
+#define CODE_config_old 0x232d5905
+
+#define CODE_msg_new_detailed_info 0x809db6df
+
+#define CODE_msg_detailed_info 0x276d3ec6
+/* not really a limit, for struct encrypted_message only */
+// #define MAX_MESSAGE_INTS 16384
+#define MAX_MESSAGE_INTS 1048576
+#define MAX_PROTO_MESSAGE_INTS 1048576
+
+#define PACKET_BUFFER_SIZE (16384 * 100 + 16) // temp fix
+#pragma pack(push,4)
+struct encrypted_message {
+ // unencrypted header
+ long long auth_key_id;
+ char msg_key[16];
+ // encrypted part, starts with encrypted header
+ long long server_salt;
+ long long session_id;
+ // long long auth_key_id2; // removed
+ // first message follows
+ long long msg_id;
+ int seq_no;
+ int msg_len; // divisible by 4
+ int message[MAX_MESSAGE_INTS];
+};
+
+#pragma pack(pop)
+
+//BN_CTX *BN_ctx;
+
+void tgl_prng_seed (struct tgl_state *TLS, const char *password_filename, int password_length);
+int tgl_serialize_bignum (BIGNUM *b, char *buffer, int maxlen);
+long long tgl_do_compute_rsa_key_fingerprint (RSA *key);
+
+#define packet_buffer tgl_packet_buffer
+#define packet_ptr tgl_packet_ptr
+
+extern int *tgl_packet_buffer;
+extern int *tgl_packet_ptr;
+
+static inline void out_ints (const int *what, int len) {
+ assert (packet_ptr + len <= packet_buffer + PACKET_BUFFER_SIZE);
+ memcpy (packet_ptr, what, len * 4);
+ packet_ptr += len;
+}
+
+
+static inline void out_int (int x) {
+ assert (packet_ptr + 1 <= packet_buffer + PACKET_BUFFER_SIZE);
+ *packet_ptr++ = x;
+}
+
+
+static inline void out_long (long long x) {
+ assert (packet_ptr + 2 <= packet_buffer + PACKET_BUFFER_SIZE);
+ *(long long *)packet_ptr = x;
+ packet_ptr += 2;
+}
+
+static inline void out_double (double x) {
+ assert (packet_ptr + 2 <= packet_buffer + PACKET_BUFFER_SIZE);
+ *(double *)packet_ptr = x;
+ packet_ptr += 2;
+}
+
+static inline void clear_packet (void) {
+ packet_ptr = packet_buffer;
+}
+
+void tgl_out_cstring (const char *str, long len);
+void tgl_out_cstring_careful (const char *str, long len);
+void tgl_out_data (const void *data, long len);
+
+#define out_cstring tgl_out_cstring
+#define out_cstring_careful tgl_out_cstring_careful
+#define out_data tgl_out_data
+
+static inline void out_string (const char *str) {
+ out_cstring (str, strlen (str));
+}
+
+static inline void out_bignum (BIGNUM *n) {
+ int l = tgl_serialize_bignum (n, (char *)packet_ptr, (PACKET_BUFFER_SIZE - (packet_ptr - packet_buffer)) * 4);
+ assert (l > 0);
+ packet_ptr += l >> 2;
+}
+
+#define in_ptr tgl_in_ptr
+#define in_end tgl_in_end
+extern int *tgl_in_ptr, *tgl_in_end;
+
+
+//void fetch_pts (void);
+//void fetch_qts (void);
+//void fetch_date (void);
+//void fetch_seq (void);
+static inline int prefetch_strlen (void) {
+ if (in_ptr >= in_end) {
+ return -1;
+ }
+ unsigned l = *in_ptr;
+ if ((l & 0xff) < 0xfe) {
+ l &= 0xff;
+ return (in_end >= in_ptr + (l >> 2) + 1) ? (int)l : -1;
+ } else if ((l & 0xff) == 0xfe) {
+ l >>= 8;
+ return (l >= 254 && in_end >= in_ptr + ((l + 7) >> 2)) ? (int)l : -1;
+ } else {
+ return -1;
+ }
+}
+
+static inline char *fetch_str (int len) {
+ assert (len >= 0);
+ if (len < 254) {
+ char *str = (char *) in_ptr + 1;
+ in_ptr += 1 + (len >> 2);
+ return str;
+ } else {
+ char *str = (char *) in_ptr + 4;
+ in_ptr += (len + 7) >> 2;
+ return str;
+ }
+}
+
+static inline char *fetch_str_dup (void) {
+ int l = prefetch_strlen ();
+ assert (l >= 0);
+ int i;
+ char *s = fetch_str (l);
+ for (i = 0; i < l; i++) {
+ if (!s[i]) { break; }
+ }
+ char *r = talloc (i + 1);
+ memcpy (r, s, i);
+ r[i] = 0;
+ return r;
+}
+
+static inline int fetch_update_str (char **s) {
+ if (!*s) {
+ *s = fetch_str_dup ();
+ return 1;
+ }
+ int l = prefetch_strlen ();
+ char *r = fetch_str (l);
+ if (memcmp (*s, r, l) || (*s)[l]) {
+ tfree_str (*s);
+ *s = talloc (l + 1);
+ memcpy (*s, r, l);
+ (*s)[l] = 0;
+ return 1;
+ }
+ return 0;
+}
+
+static inline int fetch_update_int (int *value) {
+ if (*value == *in_ptr) {
+ in_ptr ++;
+ return 0;
+ } else {
+ *value = *(in_ptr ++);
+ return 1;
+ }
+}
+
+static inline int fetch_update_long (long long *value) {
+ if (*value == *(long long *)in_ptr) {
+ in_ptr += 2;
+ return 0;
+ } else {
+ *value = *(long long *)(in_ptr);
+ in_ptr += 2;
+ return 1;
+ }
+}
+
+static inline int set_update_int (int *value, int new_value) {
+ if (*value == new_value) {
+ return 0;
+ } else {
+ *value = new_value;
+ return 1;
+ }
+}
+
+static inline void fetch_skip (int n) {
+ in_ptr += n;
+ assert (in_ptr <= in_end);
+}
+
+static inline void fetch_skip_str (void) {
+ int l = prefetch_strlen ();
+ assert (l >= 0);
+ fetch_str (l);
+}
+
+static inline long have_prefetch_ints (void) {
+ return in_end - in_ptr;
+}
+
+int tgl_fetch_bignum (BIGNUM *x);
+#define fetch_bignum tgl_fetch_bignum
+
+static inline int fetch_int (void) {
+ assert (in_ptr + 1 <= in_end);
+ return *(in_ptr ++);
+}
+
+static inline int fetch_bool (void) {
+ assert (in_ptr + 1 <= in_end);
+ assert (*(in_ptr) == (int)CODE_bool_true || *(in_ptr) == (int)CODE_bool_false);
+ return *(in_ptr ++) == (int)CODE_bool_true;
+}
+
+static inline int prefetch_int (void) {
+ assert (in_ptr < in_end);
+ return *(in_ptr);
+}
+
+static inline void prefetch_data (void *data, int size) {
+ assert (in_ptr + (size >> 2) <= in_end);
+ memcpy (data, in_ptr, size);
+}
+
+static inline void fetch_data (void *data, int size) {
+ assert (in_ptr + (size >> 2) <= in_end);
+ memcpy (data, in_ptr, size);
+ assert (!(size & 3));
+ in_ptr += (size >> 2);
+}
+
+static inline long long fetch_long (void) {
+ assert (in_ptr + 2 <= in_end);
+ long long r = *(long long *)in_ptr;
+ in_ptr += 2;
+ return r;
+}
+
+static inline double fetch_double (void) {
+ assert (in_ptr + 2 <= in_end);
+ double r = *(double *)in_ptr;
+ in_ptr += 2;
+ return r;
+}
+
+static inline void fetch_ints (void *data, int count) {
+ assert (in_ptr + count <= in_end);
+ memcpy (data, in_ptr, 4 * count);
+ in_ptr += count;
+}
+
+static inline void fetch256 (void *buf) {
+ int l = prefetch_strlen ();
+ assert (l >= 0);
+ char *s = fetch_str (l);
+ if (l < 256) {
+ memcpy ((char *)buf + 256 - l, s, l);
+ memset (buf, 0, 256 - l);
+ } else {
+ memcpy (buf, s + (l - 256), 256);
+ }
+}
+
+static inline int in_remaining (void) {
+ return 4 * (in_end - in_ptr);
+}
+
+//int get_random_bytes (unsigned char *buf, int n);
+
+int tgl_pad_rsa_encrypt (struct tgl_state *TLS, char *from, int from_len, char *to, int size, BIGNUM *N, BIGNUM *E);
+int tgl_pad_rsa_decrypt (struct tgl_state *TLS, char *from, int from_len, char *to, int size, BIGNUM *N, BIGNUM *D);
+
+//extern long long rsa_encrypted_chunks, rsa_decrypted_chunks;
+
+//extern unsigned char aes_key_raw[32], aes_iv[32];
+//extern AES_KEY aes_key;
+
+void tgl_init_aes_unauth (const char server_nonce[16], const char hidden_client_nonce[32], int encrypt);
+void tgl_init_aes_auth (char auth_key[192], char msg_key[16], int encrypt);
+int tgl_pad_aes_encrypt (char *from, int from_len, char *to, int size);
+int tgl_pad_aes_decrypt (char *from, int from_len, char *to, int size);
+/*
+static inline void hexdump_in (void) {
+ hexdump (in_ptr, in_end);
+}
+
+static inline void hexdump_out (void) {
+ hexdump (packet_buffer, packet_ptr);
+}*/
+
+#if defined(__MACH__) || defined(WIN32) || defined(_WIN32)
+#define CLOCK_REALTIME 0
+#define CLOCK_MONOTONIC 1
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/mtproto-utils.c b/protocols/Telegram/tgl/mtproto-utils.c
new file mode 100644
index 0000000000..481bff6371
--- /dev/null
+++ b/protocols/Telegram/tgl/mtproto-utils.c
@@ -0,0 +1,178 @@
+#include "config.h"
+#include <openssl/bn.h>
+#include "tgl.h"
+#include "tools.h"
+
+#if !defined(HAVE___BUILTIN_BSWAP32) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
+static inline unsigned __builtin_bswap32(unsigned x) {
+ return ((x << 24) & 0xff000000) |
+ ((x << 8) & 0x00ff0000) |
+ ((x >> 8) & 0x0000ff00) |
+ ((x >> 24) & 0x000000ff);
+}
+#endif
+
+static unsigned long long gcd (unsigned long long a, unsigned long long b) {
+ return b ? gcd (b, a % b) : a;
+}
+
+static int check_prime (struct tgl_state *TLS, BIGNUM *p) {
+ int r = BN_is_prime (p, BN_prime_checks, 0, TLS->BN_ctx, 0);
+ ensure (r >= 0);
+ return r;
+}
+
+
+// Complete set of checks see at https://core.telegram.org/mtproto/security_guidelines
+
+
+// Checks that (p,g) is acceptable pair for DH
+int tglmp_check_DH_params (struct tgl_state *TLS, BIGNUM *p, int g) {
+ if (g < 2 || g > 7) { return -1; }
+ if (BN_num_bits (p) != 2048) { return -1; }
+
+ BIGNUM *t = BN_new ();
+
+ BIGNUM *dh_g = BN_new ();
+
+ ensure (BN_set_word (dh_g, 4 * g));
+ ensure (BN_mod (t, p, dh_g, TLS->BN_ctx));
+ int x = BN_get_word (t);
+ assert (x >= 0 && x < 4 * g);
+
+ BN_free (dh_g);
+
+ int res = 0;
+ switch (g) {
+ case 2:
+ if (x != 7) { res = -1; }
+ break;
+ case 3:
+ if (x % 3 != 2) { res = -1; }
+ break;
+ case 4:
+ break;
+ case 5:
+ if (x % 5 != 1 && x % 5 != 4) { res = -1; }
+ break;
+ case 6:
+ if (x != 19 && x != 23) { res = -1; }
+ break;
+ case 7:
+ if (x % 7 != 3 && x % 7 != 5 && x % 7 != 6) { res = -1; }
+ break;
+ }
+
+ if (res < 0 || !check_prime (TLS, p)) {
+ BN_free (t);
+ return -1;
+ }
+
+ BIGNUM *b = BN_new ();
+ ensure (BN_set_word (b, 2));
+ ensure (BN_div (t, 0, p, b, TLS->BN_ctx));
+ if (!check_prime (TLS, t)) {
+ res = -1;
+ }
+ BN_free (b);
+ BN_free (t);
+ return res;
+}
+
+// checks that g_a is acceptable for DH
+int tglmp_check_g_a (struct tgl_state *TLS, BIGNUM *p, BIGNUM *g_a) {
+ if (BN_num_bytes (g_a) > 256) {
+ return -1;
+ }
+ if (BN_num_bits (g_a) < 2048 - 64) {
+ return -1;
+ }
+ if (BN_cmp (p, g_a) <= 0) {
+ return -1;
+ }
+
+ BIGNUM *dif = BN_new ();
+ BN_sub (dif, p, g_a);
+ if (BN_num_bits (dif) < 2048 - 64) {
+ BN_free (dif);
+ return -1;
+ }
+ BN_free (dif);
+ return 0;
+}
+
+static unsigned long long BN2ull (BIGNUM *b) {
+ if (sizeof (BN_ULONG) == 8) {
+ return BN_get_word (b);
+ } else {
+ unsigned int tmp[2];
+ memset (tmp, 0, 8);
+ BN_bn2bin (b, (void *)tmp);
+ return __builtin_bswap32 (tmp[0]) * (1ll << 32) | __builtin_bswap32 (tmp[1]);
+ }
+}
+
+static void ull2BN (BIGNUM *b, unsigned long long val) {
+ if (sizeof (BN_ULONG) == 8 || val < (1ll << 32)) {
+ BN_set_word (b, val);
+ } else {
+ unsigned int tmp[2];
+ tmp[0] = __builtin_bswap32 (val >> 32);
+ tmp[1] = __builtin_bswap32 ((unsigned)val);
+ BN_bin2bn ((void *)tmp, 8, b);
+ }
+}
+
+int bn_factorize (BIGNUM *pq, BIGNUM *p, BIGNUM *q) {
+ // Should work in any case
+ // Rewrite this code
+ unsigned long long what = BN2ull (pq);
+
+ int it = 0;
+
+ unsigned long long g = 0;
+ int i;
+ for (i = 0; i < 3 || it < 1000; i++) {
+ int q = ((lrand48() & 15) + 17) % what;
+ unsigned long long x = (long long)lrand48 () % (what - 1) + 1, y = x;
+ int lim = 1 << (i + 18);
+ int j;
+ for (j = 1; j < lim; j++) {
+ ++it;
+ unsigned long long a = x, b = x, c = q;
+ while (b) {
+ if (b & 1) {
+ c += a;
+ if (c >= what) {
+ c -= what;
+ }
+ }
+ a += a;
+ if (a >= what) {
+ a -= what;
+ }
+ b >>= 1;
+ }
+ x = c;
+ unsigned long long z = x < y ? what + x - y : x - y;
+ g = gcd (z, what);
+ if (g != 1) {
+ break;
+ }
+ if (!(j & (j - 1))) {
+ y = x;
+ }
+ }
+ if (g > 1 && g < what) break;
+ }
+
+ assert (g > 1 && g < what);
+ unsigned long long p1 = g;
+ unsigned long long p2 = what / g;
+ if (p1 > p2) {
+ unsigned long long t = p1; p1 = p2; p2 = t;
+ }
+ ull2BN (p, p1);
+ ull2BN (q, p2);
+ return 0;
+}
diff --git a/protocols/Telegram/tgl/mtproto-utils.h b/protocols/Telegram/tgl/mtproto-utils.h
new file mode 100644
index 0000000000..e9bb6aeef3
--- /dev/null
+++ b/protocols/Telegram/tgl/mtproto-utils.h
@@ -0,0 +1,7 @@
+#ifndef __MTPROTO_UTILS_H__
+#define __MTPROTO_UTILS_H__
+#include <openssl/bn.h>
+int tglmp_check_DH_params (struct tgl_state *TLS, BIGNUM *p, int g);
+int tglmp_check_g_a (struct tgl_state *TLS, BIGNUM *p, BIGNUM *g_a);
+int bn_factorize (BIGNUM *pq, BIGNUM *p, BIGNUM *q);
+#endif
diff --git a/protocols/Telegram/tgl/mtproto.tl b/protocols/Telegram/tgl/mtproto.tl
new file mode 100644
index 0000000000..2f02c49ae8
--- /dev/null
+++ b/protocols/Telegram/tgl/mtproto.tl
@@ -0,0 +1,19 @@
+---types---
+resPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:(Vector long) = ResPQ;
+server_DH_params_fail#79cb045d nonce:int128 server_nonce:int128 new_nonce_hash:int128 = Server_DH_Params;
+server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;
+
+p_q_inner_data#83c95aec pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 = P_Q_inner_data;
+p_q_inner_data_temp#3c6a84d4 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 expires_in:int = P_Q_inner_data;
+client_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data;
+
+dh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer;
+dh_gen_retry#46dc1fb9 nonce:int128 server_nonce:int128 new_nonce_hash2:int128 = Set_client_DH_params_answer;
+dh_gen_fail#a69dae02 nonce:int128 server_nonce:int128 new_nonce_hash3:int128 = Set_client_DH_params_answer;
+
+server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;
+
+---functions---
+req_pq#60469778 nonce:int128 = ResPQ;
+req_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params;
+set_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer;
diff --git a/protocols/Telegram/tgl/no-preview.h b/protocols/Telegram/tgl/no-preview.h
new file mode 100644
index 0000000000..cf2651d9d2
--- /dev/null
+++ b/protocols/Telegram/tgl/no-preview.h
@@ -0,0 +1,106 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Vitaly Valtman 2013-2015
+*/
+
+// Just sample jpg file 90x90
+
+int thumb_file_size = (82 * 6 - 2) * 4;
+int thumb_file [] = {
+0xe0ffd8ff, 0x464a1000, 0x01004649, 0x64000101, 0x00006400, 0xa002e2ff,
+0x5f434349, 0x464f5250, 0x00454c49, 0x00000101, 0x636c9002, 0x3004736d,
+0x6e6d0000, 0x47527274, 0x59582042, 0xdd07205a, 0x04000b00, 0x1b001600,
+0x63612400, 0x50417073, 0x00004c50, 0x00000000, 0x00000000, 0x00000000,
+0x00000000, 0x00000000, 0x00000000, 0x0100d6f6, 0x00000000, 0x636c2dd3,
+0x0000736d, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+0x65640b00, 0x00006373, 0x00000801, 0x70633800, 0x00007472, 0x00004001,
+0x74774e00, 0x00007470, 0x00009001, 0x68631400, 0x00006461, 0x0000a401,
+0x58722c00, 0x00005a59, 0x0000d001, 0x58621400, 0x00005a59, 0x0000e401,
+0x58671400, 0x00005a59, 0x0000f801, 0x54721400, 0x00004352, 0x00000c02,
+0x54672000, 0x00004352, 0x00002c02, 0x54622000, 0x00004352, 0x00004c02,
+0x68632000, 0x00006d72, 0x00006c02, 0x6c6d2400, 0x00006375, 0x00000000,
+0x00000100, 0x6e650c00, 0x00005355, 0x00001c00, 0x73001c00, 0x47005200,
+0x20004200, 0x75006200, 0x6c006900, 0x2d007400, 0x6e006900, 0x6c6d0000,
+0x00006375, 0x00000000, 0x00000100, 0x6e650c00, 0x00005355, 0x00003200,
+0x4e001c00, 0x20006f00, 0x6f006300, 0x79007000, 0x69007200, 0x68006700,
+0x2c007400, 0x75002000, 0x65007300, 0x66002000, 0x65007200, 0x6c006500,
+0x00007900, 0x59580000, 0x0000205a, 0x00000000, 0x0100d6f6, 0x00000000,
+0x66732dd3, 0x00003233, 0x01000000, 0x00004a0c, 0xffffe305, 0x00002af3,
+0x00009b07, 0xffff87fd, 0xffffa2fb, 0x0000a3fd, 0x0000d803, 0x595894c0,
+0x0000205a, 0x00000000, 0x0000946f, 0x0000ee38, 0x59589003, 0x0000205a,
+0x00000000, 0x00009d24, 0x0000830f, 0x5958beb6, 0x0000205a, 0x00000000,
+0x0000a562, 0x000090b7, 0x6170de18, 0x00006172, 0x03000000, 0x02000000,
+0x00006666, 0x0000a7f2, 0x0000590d, 0x0000d013, 0x61705b0a, 0x00006172,
+0x03000000, 0x02000000, 0x00006666, 0x0000a7f2, 0x0000590d, 0x0000d013,
+0x61705b0a, 0x00006172, 0x03000000, 0x02000000, 0x00006666, 0x0000a7f2,
+0x0000590d, 0x0000d013, 0x68635b0a, 0x00006d72, 0x03000000, 0x00000000,
+0x0000d7a3, 0x00007b54, 0x0000cd4c, 0x00009a99, 0x00006626, 0xdbff5c0f,
+0x14004300, 0x0f120f0e, 0x1112140d, 0x14161712, 0x21331f18, 0x1f1c1c1f,
+0x252f2d3f, 0x4e414a33, 0x4841494d, 0x765c5246, 0x6f575264, 0x66484658,
+0x7a6f688c, 0x8485847d, 0x9b91634f, 0x769a808f, 0xff7f8481, 0x014300db,
+0x1f171716, 0x213c1f1b, 0x547f3c21, 0x7f7f5448, 0x7f7f7f7f, 0x7f7f7f7f,
+0x7f7f7f7f, 0x7f7f7f7f, 0x7f7f7f7f, 0x7f7f7f7f, 0x7f7f7f7f, 0x7f7f7f7f,
+0x7f7f7f7f, 0x7f7f7f7f, 0x7f7f7f7f, 0x7f7f7f7f, 0x1100c0ff, 0x005a0008,
+0x2201035a, 0x01110200, 0xff011103, 0x001900c4, 0x01010101, 0x00000101,
+0x00000000, 0x00000000, 0x02030400, 0xc4ff0605, 0x00103600, 0x02010401,
+0x06050304, 0x00000306, 0x01000000, 0x11030200, 0x05211204, 0x13514131,
+0x32146122, 0x23918171, 0x72423424, 0x432515a1, 0xa2827444, 0xc4fff0b3,
+0x01011400, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x1400c4ff,
+0x00000111, 0x00000000, 0x00000000, 0x00000000, 0xdaff0000, 0x01030c00,
+0x03110200, 0x003f0011, 0x404434fb, 0xbcb4875c, 0x006b38b0, 0x03dcdb12,
+0xf4637f74, 0xe519f153, 0x09d7c5c7, 0x47d29160, 0x20692f18, 0xd06d786a,
+0x53f7f922, 0x17b3e260, 0x2fe8668c, 0x1786a473, 0x9775efbd, 0xe917e43a,
+0x1d0a1bb0, 0x114d0f82, 0x14651110, 0x35f299ed, 0xe9b09680, 0xf5a4fc2f,
+0xe975bd03, 0xb506737b, 0x04444440, 0x5c444044, 0x8e8dedbd, 0xc61adc7b,
+0x689c738b, 0x92a0dc01, 0x58e2b77f, 0x7bfb37d1, 0xb5b5e79d, 0xdbf968cc,
+0xead3f48d, 0x38ed1313, 0xdea77c86, 0xae089963, 0xc743435a, 0x403fe4ce,
+0x392ee1b9, 0xed39e718, 0xd6517e2d, 0x7fc4aa03, 0xb7ad7590, 0x77e7e6ab,
+0x34bf705d, 0x7c77ca53, 0x3dea1299, 0x7fb0bcf4, 0x241fadc5, 0x95a7a816,
+0x13fbe6f3, 0x3182b135, 0xd1b4b224, 0x1b0d48a2, 0xbf9d26d8, 0x82dc3640,
+0x63569a2a, 0xbbd224c3, 0xb9b4714c, 0x1680aec6, 0x3d311856, 0x9b59be91,
+0x09876ca6, 0x61d86564, 0x5a9f06d2, 0x36f51b0d, 0x8682e476, 0xacb1b131,
+0xd1584363, 0x00456b4d, 0x22d2053b, 0x22202202, 0xf3f30222, 0xe3e513e5,
+0xf1e6e1f0, 0x2380496e, 0x5fdcdb68, 0x549b3a27, 0x825e6a6c, 0x6522028b,
+0xaf91ccc8, 0x341cf26b, 0x58dbc4b5, 0xf2289add, 0x0854ddbd, 0x0b9247d5,
+0xf02b5c54, 0x3f917f92, 0xaf56affd, 0xe3760637, 0x05cebde0, 0xed4c76ce,
+0x3cef1b63, 0x7fd8aff8, 0xa0c902ea, 0x7e730d0a, 0x435834f3, 0x26edbb76,
+0xd3ec00fd, 0x76d48efa, 0xa8560f2d, 0x0e766331, 0xd319993c, 0x20243209,
+0x61b7e6c8, 0x998331d0, 0x640ee802, 0x47a3d493, 0xfab99413, 0x4fd871f1,
+0xe9443792, 0x627e051c, 0xd8f3051c, 0x2f28f558, 0x64b51745, 0x1b2bfee3,
+0xb8783953, 0x9900fff6, 0xd8176a65, 0x5a3bf56a, 0x1b331fdb, 0x64b3572f,
+0xd59a3643, 0xaf3abce1, 0x11dd20bd, 0x01111110, 0x5c141011, 0xb3e3083f,
+0xd9b19cc4, 0x17edb20e, 0xa78e9aa1, 0x4ef4de06, 0x00c0bfe7, 0x7e1e442d,
+0x9221fe38, 0xedb5c7dc, 0x6338078a, 0x62495b8d, 0xc11d9b8c, 0x49e81b16,
+0x51d02bea, 0x3eb86d70, 0xc8bc4f13, 0xa10ec758, 0xd40751c0, 0x5ac94710,
+0xc4c8b080, 0x95492b83, 0x975ee696, 0xb7bd96b4, 0x17379cce, 0x82e856e8,
+0xe4c2c82a, 0x398e935f, 0x632437ea, 0x7c9c87d2, 0xdc1ddb7c, 0x65a80a48,
+0x2309f164, 0x51fab475, 0x081dc11d, 0xda45573b, 0x6622f3f3, 0x48f1b214,
+0x676c4edb, 0x243468c7, 0x00ffde60, 0xf1630350, 0xa0076c1d, 0x8f2c0c8b,
+0x2383c26b, 0x361a8f4e, 0xaceea6c9, 0x01dd5a5d, 0x11111011, 0xc3780c04,
+0xbf093ee2, 0xc7972c0b, 0x00d99040, 0xc0c20eb7, 0x659d3bd4, 0x269ab85e,
+0x468e114f, 0x11ad4fdb, 0x83d083d8, 0x8c52f4bd, 0x3c9664bf, 0xa4f9c77c,
+0x22a68876, 0xadb18784, 0xf480be83, 0x885a00ea, 0x220e0a88, 0xc303e4f6,
+0xc866e058, 0xdddbd661, 0xdf395db1, 0xbad64343, 0xe6e65b03, 0x668e81c3,
+0xad619e98, 0xeeb94563, 0xd4d19a3c, 0x3316ce95, 0x9d65f1e1, 0x3bf324fe,
+0x0e468f53, 0xc386068c, 0xa89e24f7, 0xf0c7c73b, 0xb60e391f, 0x1b8827cb,
+0x58601954, 0xc54f90f9, 0x80886ec5, 0x88088888, 0x1b7bb980, 0xb4c71c23,
+0xe6148e39, 0xb12358b8, 0xbd08225d, 0x0ffef085, 0x72b4f025, 0x635ce389,
+0xb90277e4, 0x0d05e000, 0x9bf9dbb9, 0x8e749fbc, 0x7ee6abbf, 0x4ddbf4af,
+0x728df7f3, 0x10b59adf, 0xe3c38f49, 0xb23c638a, 0xdb3d9349, 0x66899a64,
+0x00004dd5, 0xf51b5adf, 0x2220a255, 0xd9ff0f22};
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/aes.h b/protocols/Telegram/tgl/openssl/include/openssl/aes.h
new file mode 100644
index 0000000000..87bf60f6f2
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/aes.h
@@ -0,0 +1,149 @@
+/* crypto/aes/aes.h -*- mode:C; c-file-style: "eay" -*- */
+/* ====================================================================
+ * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ */
+
+#ifndef HEADER_AES_H
+# define HEADER_AES_H
+
+# include <openssl/opensslconf.h>
+
+# ifdef OPENSSL_NO_AES
+# error AES is disabled.
+# endif
+
+# include <stddef.h>
+
+# define AES_ENCRYPT 1
+# define AES_DECRYPT 0
+
+/*
+ * Because array size can't be a const in C, the following two are macros.
+ * Both sizes are in bytes.
+ */
+# define AES_MAXNR 14
+# define AES_BLOCK_SIZE 16
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* This should be a hidden type, but EVP requires that the size be known */
+struct aes_key_st {
+# ifdef AES_LONG
+ unsigned long rd_key[4 * (AES_MAXNR + 1)];
+# else
+ unsigned int rd_key[4 * (AES_MAXNR + 1)];
+# endif
+ int rounds;
+};
+typedef struct aes_key_st AES_KEY;
+
+const char *AES_options(void);
+
+int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
+ AES_KEY *key);
+int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
+ AES_KEY *key);
+
+int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits,
+ AES_KEY *key);
+int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits,
+ AES_KEY *key);
+
+void AES_encrypt(const unsigned char *in, unsigned char *out,
+ const AES_KEY *key);
+void AES_decrypt(const unsigned char *in, unsigned char *out,
+ const AES_KEY *key);
+
+void AES_ecb_encrypt(const unsigned char *in, unsigned char *out,
+ const AES_KEY *key, const int enc);
+void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ unsigned char *ivec, const int enc);
+void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ unsigned char *ivec, int *num, const int enc);
+void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ unsigned char *ivec, int *num, const int enc);
+void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ unsigned char *ivec, int *num, const int enc);
+void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ unsigned char *ivec, int *num);
+void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ unsigned char ivec[AES_BLOCK_SIZE],
+ unsigned char ecount_buf[AES_BLOCK_SIZE],
+ unsigned int *num);
+/* NB: the IV is _two_ blocks long */
+void AES_ige_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ unsigned char *ivec, const int enc);
+/* NB: the IV is _four_ blocks long */
+void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ const AES_KEY *key2, const unsigned char *ivec,
+ const int enc);
+
+int AES_wrap_key(AES_KEY *key, const unsigned char *iv,
+ unsigned char *out,
+ const unsigned char *in, unsigned int inlen);
+int AES_unwrap_key(AES_KEY *key, const unsigned char *iv,
+ unsigned char *out,
+ const unsigned char *in, unsigned int inlen);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !HEADER_AES_H */
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/applink.c b/protocols/Telegram/tgl/openssl/include/openssl/applink.c
new file mode 100644
index 0000000000..2831b39e9a
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/applink.c
@@ -0,0 +1,129 @@
+#define APPLINK_STDIN 1
+#define APPLINK_STDOUT 2
+#define APPLINK_STDERR 3
+#define APPLINK_FPRINTF 4
+#define APPLINK_FGETS 5
+#define APPLINK_FREAD 6
+#define APPLINK_FWRITE 7
+#define APPLINK_FSETMOD 8
+#define APPLINK_FEOF 9
+#define APPLINK_FCLOSE 10 /* should not be used */
+
+#define APPLINK_FOPEN 11 /* solely for completeness */
+#define APPLINK_FSEEK 12
+#define APPLINK_FTELL 13
+#define APPLINK_FFLUSH 14
+#define APPLINK_FERROR 15
+#define APPLINK_CLEARERR 16
+#define APPLINK_FILENO 17 /* to be used with below */
+
+#define APPLINK_OPEN 18 /* formally can't be used, as flags can vary */
+#define APPLINK_READ 19
+#define APPLINK_WRITE 20
+#define APPLINK_LSEEK 21
+#define APPLINK_CLOSE 22
+#define APPLINK_MAX 22 /* always same as last macro */
+
+#ifndef APPMACROS_ONLY
+# include <stdio.h>
+# include <io.h>
+# include <fcntl.h>
+
+static void *app_stdin(void)
+{
+ return stdin;
+}
+
+static void *app_stdout(void)
+{
+ return stdout;
+}
+
+static void *app_stderr(void)
+{
+ return stderr;
+}
+
+static int app_feof(FILE *fp)
+{
+ return feof(fp);
+}
+
+static int app_ferror(FILE *fp)
+{
+ return ferror(fp);
+}
+
+static void app_clearerr(FILE *fp)
+{
+ clearerr(fp);
+}
+
+static int app_fileno(FILE *fp)
+{
+ return _fileno(fp);
+}
+
+static int app_fsetmod(FILE *fp, char mod)
+{
+ return _setmode(_fileno(fp), mod == 'b' ? _O_BINARY : _O_TEXT);
+}
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+__declspec(dllexport)
+void **
+# if defined(__BORLANDC__)
+/*
+ * __stdcall appears to be the only way to get the name
+ * decoration right with Borland C. Otherwise it works
+ * purely incidentally, as we pass no parameters.
+ */
+ __stdcall
+# else
+ __cdecl
+# endif
+OPENSSL_Applink(void)
+{
+ static int once = 1;
+ static void *OPENSSL_ApplinkTable[APPLINK_MAX + 1] =
+ { (void *)APPLINK_MAX };
+
+ if (once) {
+ OPENSSL_ApplinkTable[APPLINK_STDIN] = app_stdin;
+ OPENSSL_ApplinkTable[APPLINK_STDOUT] = app_stdout;
+ OPENSSL_ApplinkTable[APPLINK_STDERR] = app_stderr;
+ OPENSSL_ApplinkTable[APPLINK_FPRINTF] = fprintf;
+ OPENSSL_ApplinkTable[APPLINK_FGETS] = fgets;
+ OPENSSL_ApplinkTable[APPLINK_FREAD] = fread;
+ OPENSSL_ApplinkTable[APPLINK_FWRITE] = fwrite;
+ OPENSSL_ApplinkTable[APPLINK_FSETMOD] = app_fsetmod;
+ OPENSSL_ApplinkTable[APPLINK_FEOF] = app_feof;
+ OPENSSL_ApplinkTable[APPLINK_FCLOSE] = fclose;
+
+ OPENSSL_ApplinkTable[APPLINK_FOPEN] = fopen;
+ OPENSSL_ApplinkTable[APPLINK_FSEEK] = fseek;
+ OPENSSL_ApplinkTable[APPLINK_FTELL] = ftell;
+ OPENSSL_ApplinkTable[APPLINK_FFLUSH] = fflush;
+ OPENSSL_ApplinkTable[APPLINK_FERROR] = app_ferror;
+ OPENSSL_ApplinkTable[APPLINK_CLEARERR] = app_clearerr;
+ OPENSSL_ApplinkTable[APPLINK_FILENO] = app_fileno;
+
+ OPENSSL_ApplinkTable[APPLINK_OPEN] = _open;
+ OPENSSL_ApplinkTable[APPLINK_READ] = _read;
+ OPENSSL_ApplinkTable[APPLINK_WRITE] = _write;
+ OPENSSL_ApplinkTable[APPLINK_LSEEK] = _lseek;
+ OPENSSL_ApplinkTable[APPLINK_CLOSE] = _close;
+
+ once = 0;
+ }
+
+ return OPENSSL_ApplinkTable;
+}
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/asn1.h b/protocols/Telegram/tgl/openssl/include/openssl/asn1.h
new file mode 100644
index 0000000000..68e791fcdb
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/asn1.h
@@ -0,0 +1,1419 @@
+/* crypto/asn1/asn1.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_ASN1_H
+# define HEADER_ASN1_H
+
+# include <time.h>
+# include <openssl/e_os2.h>
+# ifndef OPENSSL_NO_BIO
+# include <openssl/bio.h>
+# endif
+# include <openssl/stack.h>
+# include <openssl/safestack.h>
+
+# include <openssl/symhacks.h>
+
+# include <openssl/ossl_typ.h>
+# ifndef OPENSSL_NO_DEPRECATED
+# include <openssl/bn.h>
+# endif
+
+# ifdef OPENSSL_BUILD_SHLIBCRYPTO
+# undef OPENSSL_EXTERN
+# define OPENSSL_EXTERN OPENSSL_EXPORT
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# define V_ASN1_UNIVERSAL 0x00
+# define V_ASN1_APPLICATION 0x40
+# define V_ASN1_CONTEXT_SPECIFIC 0x80
+# define V_ASN1_PRIVATE 0xc0
+
+# define V_ASN1_CONSTRUCTED 0x20
+# define V_ASN1_PRIMITIVE_TAG 0x1f
+# define V_ASN1_PRIMATIVE_TAG 0x1f
+
+# define V_ASN1_APP_CHOOSE -2/* let the recipient choose */
+# define V_ASN1_OTHER -3/* used in ASN1_TYPE */
+# define V_ASN1_ANY -4/* used in ASN1 template code */
+
+# define V_ASN1_NEG 0x100/* negative flag */
+
+# define V_ASN1_UNDEF -1
+# define V_ASN1_EOC 0
+# define V_ASN1_BOOLEAN 1 /**/
+# define V_ASN1_INTEGER 2
+# define V_ASN1_NEG_INTEGER (2 | V_ASN1_NEG)
+# define V_ASN1_BIT_STRING 3
+# define V_ASN1_OCTET_STRING 4
+# define V_ASN1_NULL 5
+# define V_ASN1_OBJECT 6
+# define V_ASN1_OBJECT_DESCRIPTOR 7
+# define V_ASN1_EXTERNAL 8
+# define V_ASN1_REAL 9
+# define V_ASN1_ENUMERATED 10
+# define V_ASN1_NEG_ENUMERATED (10 | V_ASN1_NEG)
+# define V_ASN1_UTF8STRING 12
+# define V_ASN1_SEQUENCE 16
+# define V_ASN1_SET 17
+# define V_ASN1_NUMERICSTRING 18 /**/
+# define V_ASN1_PRINTABLESTRING 19
+# define V_ASN1_T61STRING 20
+# define V_ASN1_TELETEXSTRING 20/* alias */
+# define V_ASN1_VIDEOTEXSTRING 21 /**/
+# define V_ASN1_IA5STRING 22
+# define V_ASN1_UTCTIME 23
+# define V_ASN1_GENERALIZEDTIME 24 /**/
+# define V_ASN1_GRAPHICSTRING 25 /**/
+# define V_ASN1_ISO64STRING 26 /**/
+# define V_ASN1_VISIBLESTRING 26/* alias */
+# define V_ASN1_GENERALSTRING 27 /**/
+# define V_ASN1_UNIVERSALSTRING 28 /**/
+# define V_ASN1_BMPSTRING 30
+/* For use with d2i_ASN1_type_bytes() */
+# define B_ASN1_NUMERICSTRING 0x0001
+# define B_ASN1_PRINTABLESTRING 0x0002
+# define B_ASN1_T61STRING 0x0004
+# define B_ASN1_TELETEXSTRING 0x0004
+# define B_ASN1_VIDEOTEXSTRING 0x0008
+# define B_ASN1_IA5STRING 0x0010
+# define B_ASN1_GRAPHICSTRING 0x0020
+# define B_ASN1_ISO64STRING 0x0040
+# define B_ASN1_VISIBLESTRING 0x0040
+# define B_ASN1_GENERALSTRING 0x0080
+# define B_ASN1_UNIVERSALSTRING 0x0100
+# define B_ASN1_OCTET_STRING 0x0200
+# define B_ASN1_BIT_STRING 0x0400
+# define B_ASN1_BMPSTRING 0x0800
+# define B_ASN1_UNKNOWN 0x1000
+# define B_ASN1_UTF8STRING 0x2000
+# define B_ASN1_UTCTIME 0x4000
+# define B_ASN1_GENERALIZEDTIME 0x8000
+# define B_ASN1_SEQUENCE 0x10000
+/* For use with ASN1_mbstring_copy() */
+# define MBSTRING_FLAG 0x1000
+# define MBSTRING_UTF8 (MBSTRING_FLAG)
+# define MBSTRING_ASC (MBSTRING_FLAG|1)
+# define MBSTRING_BMP (MBSTRING_FLAG|2)
+# define MBSTRING_UNIV (MBSTRING_FLAG|4)
+# define SMIME_OLDMIME 0x400
+# define SMIME_CRLFEOL 0x800
+# define SMIME_STREAM 0x1000
+ struct X509_algor_st;
+DECLARE_STACK_OF(X509_ALGOR)
+
+# define DECLARE_ASN1_SET_OF(type)/* filled in by mkstack.pl */
+# define IMPLEMENT_ASN1_SET_OF(type)/* nothing, no longer needed */
+
+/*
+ * We MUST make sure that, except for constness, asn1_ctx_st and
+ * asn1_const_ctx are exactly the same. Fortunately, as soon as the old ASN1
+ * parsing macros are gone, we can throw this away as well...
+ */
+typedef struct asn1_ctx_st {
+ unsigned char *p; /* work char pointer */
+ int eos; /* end of sequence read for indefinite
+ * encoding */
+ int error; /* error code to use when returning an error */
+ int inf; /* constructed if 0x20, indefinite is 0x21 */
+ int tag; /* tag from last 'get object' */
+ int xclass; /* class from last 'get object' */
+ long slen; /* length of last 'get object' */
+ unsigned char *max; /* largest value of p allowed */
+ unsigned char *q; /* temporary variable */
+ unsigned char **pp; /* variable */
+ int line; /* used in error processing */
+} ASN1_CTX;
+
+typedef struct asn1_const_ctx_st {
+ const unsigned char *p; /* work char pointer */
+ int eos; /* end of sequence read for indefinite
+ * encoding */
+ int error; /* error code to use when returning an error */
+ int inf; /* constructed if 0x20, indefinite is 0x21 */
+ int tag; /* tag from last 'get object' */
+ int xclass; /* class from last 'get object' */
+ long slen; /* length of last 'get object' */
+ const unsigned char *max; /* largest value of p allowed */
+ const unsigned char *q; /* temporary variable */
+ const unsigned char **pp; /* variable */
+ int line; /* used in error processing */
+} ASN1_const_CTX;
+
+/*
+ * These are used internally in the ASN1_OBJECT to keep track of whether the
+ * names and data need to be free()ed
+ */
+# define ASN1_OBJECT_FLAG_DYNAMIC 0x01/* internal use */
+# define ASN1_OBJECT_FLAG_CRITICAL 0x02/* critical x509v3 object id */
+# define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04/* internal use */
+# define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08/* internal use */
+struct asn1_object_st {
+ const char *sn, *ln;
+ int nid;
+ int length;
+ const unsigned char *data; /* data remains const after init */
+ int flags; /* Should we free this one */
+};
+
+# define ASN1_STRING_FLAG_BITS_LEFT 0x08/* Set if 0x07 has bits left value */
+/*
+ * This indicates that the ASN1_STRING is not a real value but just a place
+ * holder for the location where indefinite length constructed data should be
+ * inserted in the memory buffer
+ */
+# define ASN1_STRING_FLAG_NDEF 0x010
+
+/*
+ * This flag is used by the CMS code to indicate that a string is not
+ * complete and is a place holder for content when it had all been accessed.
+ * The flag will be reset when content has been written to it.
+ */
+
+# define ASN1_STRING_FLAG_CONT 0x020
+/*
+ * This flag is used by ASN1 code to indicate an ASN1_STRING is an MSTRING
+ * type.
+ */
+# define ASN1_STRING_FLAG_MSTRING 0x040
+/* This is the base type that holds just about everything :-) */
+struct asn1_string_st {
+ int length;
+ int type;
+ unsigned char *data;
+ /*
+ * The value of the following field depends on the type being held. It
+ * is mostly being used for BIT_STRING so if the input data has a
+ * non-zero 'unused bits' value, it will be handled correctly
+ */
+ long flags;
+};
+
+/*
+ * ASN1_ENCODING structure: this is used to save the received encoding of an
+ * ASN1 type. This is useful to get round problems with invalid encodings
+ * which can break signatures.
+ */
+
+typedef struct ASN1_ENCODING_st {
+ unsigned char *enc; /* DER encoding */
+ long len; /* Length of encoding */
+ int modified; /* set to 1 if 'enc' is invalid */
+} ASN1_ENCODING;
+
+/* Used with ASN1 LONG type: if a long is set to this it is omitted */
+# define ASN1_LONG_UNDEF 0x7fffffffL
+
+# define STABLE_FLAGS_MALLOC 0x01
+# define STABLE_NO_MASK 0x02
+# define DIRSTRING_TYPE \
+ (B_ASN1_PRINTABLESTRING|B_ASN1_T61STRING|B_ASN1_BMPSTRING|B_ASN1_UTF8STRING)
+# define PKCS9STRING_TYPE (DIRSTRING_TYPE|B_ASN1_IA5STRING)
+
+typedef struct asn1_string_table_st {
+ int nid;
+ long minsize;
+ long maxsize;
+ unsigned long mask;
+ unsigned long flags;
+} ASN1_STRING_TABLE;
+
+DECLARE_STACK_OF(ASN1_STRING_TABLE)
+
+/* size limits: this stuff is taken straight from RFC2459 */
+
+# define ub_name 32768
+# define ub_common_name 64
+# define ub_locality_name 128
+# define ub_state_name 128
+# define ub_organization_name 64
+# define ub_organization_unit_name 64
+# define ub_title 64
+# define ub_email_address 128
+
+/*
+ * Declarations for template structures: for full definitions see asn1t.h
+ */
+typedef struct ASN1_TEMPLATE_st ASN1_TEMPLATE;
+typedef struct ASN1_TLC_st ASN1_TLC;
+/* This is just an opaque pointer */
+typedef struct ASN1_VALUE_st ASN1_VALUE;
+
+/* Declare ASN1 functions: the implement macro in in asn1t.h */
+
+# define DECLARE_ASN1_FUNCTIONS(type) DECLARE_ASN1_FUNCTIONS_name(type, type)
+
+# define DECLARE_ASN1_ALLOC_FUNCTIONS(type) \
+ DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, type)
+
+# define DECLARE_ASN1_FUNCTIONS_name(type, name) \
+ DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
+ DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name)
+
+# define DECLARE_ASN1_FUNCTIONS_fname(type, itname, name) \
+ DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
+ DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name)
+
+# define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \
+ type *d2i_##name(type **a, const unsigned char **in, long len); \
+ int i2d_##name(type *a, unsigned char **out); \
+ DECLARE_ASN1_ITEM(itname)
+
+# define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \
+ type *d2i_##name(type **a, const unsigned char **in, long len); \
+ int i2d_##name(const type *a, unsigned char **out); \
+ DECLARE_ASN1_ITEM(name)
+
+# define DECLARE_ASN1_NDEF_FUNCTION(name) \
+ int i2d_##name##_NDEF(name *a, unsigned char **out);
+
+# define DECLARE_ASN1_FUNCTIONS_const(name) \
+ DECLARE_ASN1_ALLOC_FUNCTIONS(name) \
+ DECLARE_ASN1_ENCODE_FUNCTIONS_const(name, name)
+
+# define DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
+ type *name##_new(void); \
+ void name##_free(type *a);
+
+# define DECLARE_ASN1_PRINT_FUNCTION(stname) \
+ DECLARE_ASN1_PRINT_FUNCTION_fname(stname, stname)
+
+# define DECLARE_ASN1_PRINT_FUNCTION_fname(stname, fname) \
+ int fname##_print_ctx(BIO *out, stname *x, int indent, \
+ const ASN1_PCTX *pctx);
+
+# define D2I_OF(type) type *(*)(type **,const unsigned char **,long)
+# define I2D_OF(type) int (*)(type *,unsigned char **)
+# define I2D_OF_const(type) int (*)(const type *,unsigned char **)
+
+# define CHECKED_D2I_OF(type, d2i) \
+ ((d2i_of_void*) (1 ? d2i : ((D2I_OF(type))0)))
+# define CHECKED_I2D_OF(type, i2d) \
+ ((i2d_of_void*) (1 ? i2d : ((I2D_OF(type))0)))
+# define CHECKED_NEW_OF(type, xnew) \
+ ((void *(*)(void)) (1 ? xnew : ((type *(*)(void))0)))
+# define CHECKED_PTR_OF(type, p) \
+ ((void*) (1 ? p : (type*)0))
+# define CHECKED_PPTR_OF(type, p) \
+ ((void**) (1 ? p : (type**)0))
+
+# define TYPEDEF_D2I_OF(type) typedef type *d2i_of_##type(type **,const unsigned char **,long)
+# define TYPEDEF_I2D_OF(type) typedef int i2d_of_##type(type *,unsigned char **)
+# define TYPEDEF_D2I2D_OF(type) TYPEDEF_D2I_OF(type); TYPEDEF_I2D_OF(type)
+
+TYPEDEF_D2I2D_OF(void);
+
+/*-
+ * The following macros and typedefs allow an ASN1_ITEM
+ * to be embedded in a structure and referenced. Since
+ * the ASN1_ITEM pointers need to be globally accessible
+ * (possibly from shared libraries) they may exist in
+ * different forms. On platforms that support it the
+ * ASN1_ITEM structure itself will be globally exported.
+ * Other platforms will export a function that returns
+ * an ASN1_ITEM pointer.
+ *
+ * To handle both cases transparently the macros below
+ * should be used instead of hard coding an ASN1_ITEM
+ * pointer in a structure.
+ *
+ * The structure will look like this:
+ *
+ * typedef struct SOMETHING_st {
+ * ...
+ * ASN1_ITEM_EXP *iptr;
+ * ...
+ * } SOMETHING;
+ *
+ * It would be initialised as e.g.:
+ *
+ * SOMETHING somevar = {...,ASN1_ITEM_ref(X509),...};
+ *
+ * and the actual pointer extracted with:
+ *
+ * const ASN1_ITEM *it = ASN1_ITEM_ptr(somevar.iptr);
+ *
+ * Finally an ASN1_ITEM pointer can be extracted from an
+ * appropriate reference with: ASN1_ITEM_rptr(X509). This
+ * would be used when a function takes an ASN1_ITEM * argument.
+ *
+ */
+
+# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
+
+/* ASN1_ITEM pointer exported type */
+typedef const ASN1_ITEM ASN1_ITEM_EXP;
+
+/* Macro to obtain ASN1_ITEM pointer from exported type */
+# define ASN1_ITEM_ptr(iptr) (iptr)
+
+/* Macro to include ASN1_ITEM pointer from base type */
+# define ASN1_ITEM_ref(iptr) (&(iptr##_it))
+
+# define ASN1_ITEM_rptr(ref) (&(ref##_it))
+
+# define DECLARE_ASN1_ITEM(name) \
+ OPENSSL_EXTERN const ASN1_ITEM name##_it;
+
+# else
+
+/*
+ * Platforms that can't easily handle shared global variables are declared as
+ * functions returning ASN1_ITEM pointers.
+ */
+
+/* ASN1_ITEM pointer exported type */
+typedef const ASN1_ITEM *ASN1_ITEM_EXP (void);
+
+/* Macro to obtain ASN1_ITEM pointer from exported type */
+# define ASN1_ITEM_ptr(iptr) (iptr())
+
+/* Macro to include ASN1_ITEM pointer from base type */
+# define ASN1_ITEM_ref(iptr) (iptr##_it)
+
+# define ASN1_ITEM_rptr(ref) (ref##_it())
+
+# define DECLARE_ASN1_ITEM(name) \
+ const ASN1_ITEM * name##_it(void);
+
+# endif
+
+/* Parameters used by ASN1_STRING_print_ex() */
+
+/*
+ * These determine which characters to escape: RFC2253 special characters,
+ * control characters and MSB set characters
+ */
+
+# define ASN1_STRFLGS_ESC_2253 1
+# define ASN1_STRFLGS_ESC_CTRL 2
+# define ASN1_STRFLGS_ESC_MSB 4
+
+/*
+ * This flag determines how we do escaping: normally RC2253 backslash only,
+ * set this to use backslash and quote.
+ */
+
+# define ASN1_STRFLGS_ESC_QUOTE 8
+
+/* These three flags are internal use only. */
+
+/* Character is a valid PrintableString character */
+# define CHARTYPE_PRINTABLESTRING 0x10
+/* Character needs escaping if it is the first character */
+# define CHARTYPE_FIRST_ESC_2253 0x20
+/* Character needs escaping if it is the last character */
+# define CHARTYPE_LAST_ESC_2253 0x40
+
+/*
+ * NB the internal flags are safely reused below by flags handled at the top
+ * level.
+ */
+
+/*
+ * If this is set we convert all character strings to UTF8 first
+ */
+
+# define ASN1_STRFLGS_UTF8_CONVERT 0x10
+
+/*
+ * If this is set we don't attempt to interpret content: just assume all
+ * strings are 1 byte per character. This will produce some pretty odd
+ * looking output!
+ */
+
+# define ASN1_STRFLGS_IGNORE_TYPE 0x20
+
+/* If this is set we include the string type in the output */
+# define ASN1_STRFLGS_SHOW_TYPE 0x40
+
+/*
+ * This determines which strings to display and which to 'dump' (hex dump of
+ * content octets or DER encoding). We can only dump non character strings or
+ * everything. If we don't dump 'unknown' they are interpreted as character
+ * strings with 1 octet per character and are subject to the usual escaping
+ * options.
+ */
+
+# define ASN1_STRFLGS_DUMP_ALL 0x80
+# define ASN1_STRFLGS_DUMP_UNKNOWN 0x100
+
+/*
+ * These determine what 'dumping' does, we can dump the content octets or the
+ * DER encoding: both use the RFC2253 #XXXXX notation.
+ */
+
+# define ASN1_STRFLGS_DUMP_DER 0x200
+
+/*
+ * All the string flags consistent with RFC2253, escaping control characters
+ * isn't essential in RFC2253 but it is advisable anyway.
+ */
+
+# define ASN1_STRFLGS_RFC2253 (ASN1_STRFLGS_ESC_2253 | \
+ ASN1_STRFLGS_ESC_CTRL | \
+ ASN1_STRFLGS_ESC_MSB | \
+ ASN1_STRFLGS_UTF8_CONVERT | \
+ ASN1_STRFLGS_DUMP_UNKNOWN | \
+ ASN1_STRFLGS_DUMP_DER)
+
+DECLARE_STACK_OF(ASN1_INTEGER)
+DECLARE_ASN1_SET_OF(ASN1_INTEGER)
+
+DECLARE_STACK_OF(ASN1_GENERALSTRING)
+
+typedef struct asn1_type_st {
+ int type;
+ union {
+ char *ptr;
+ ASN1_BOOLEAN boolean;
+ ASN1_STRING *asn1_string;
+ ASN1_OBJECT *object;
+ ASN1_INTEGER *integer;
+ ASN1_ENUMERATED *enumerated;
+ ASN1_BIT_STRING *bit_string;
+ ASN1_OCTET_STRING *octet_string;
+ ASN1_PRINTABLESTRING *printablestring;
+ ASN1_T61STRING *t61string;
+ ASN1_IA5STRING *ia5string;
+ ASN1_GENERALSTRING *generalstring;
+ ASN1_BMPSTRING *bmpstring;
+ ASN1_UNIVERSALSTRING *universalstring;
+ ASN1_UTCTIME *utctime;
+ ASN1_GENERALIZEDTIME *generalizedtime;
+ ASN1_VISIBLESTRING *visiblestring;
+ ASN1_UTF8STRING *utf8string;
+ /*
+ * set and sequence are left complete and still contain the set or
+ * sequence bytes
+ */
+ ASN1_STRING *set;
+ ASN1_STRING *sequence;
+ ASN1_VALUE *asn1_value;
+ } value;
+} ASN1_TYPE;
+
+DECLARE_STACK_OF(ASN1_TYPE)
+DECLARE_ASN1_SET_OF(ASN1_TYPE)
+
+typedef STACK_OF(ASN1_TYPE) ASN1_SEQUENCE_ANY;
+
+DECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SEQUENCE_ANY)
+DECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SET_ANY)
+
+typedef struct NETSCAPE_X509_st {
+ ASN1_OCTET_STRING *header;
+ X509 *cert;
+} NETSCAPE_X509;
+
+/* This is used to contain a list of bit names */
+typedef struct BIT_STRING_BITNAME_st {
+ int bitnum;
+ const char *lname;
+ const char *sname;
+} BIT_STRING_BITNAME;
+
+# define M_ASN1_STRING_length(x) ((x)->length)
+# define M_ASN1_STRING_length_set(x, n) ((x)->length = (n))
+# define M_ASN1_STRING_type(x) ((x)->type)
+# define M_ASN1_STRING_data(x) ((x)->data)
+
+/* Macros for string operations */
+# define M_ASN1_BIT_STRING_new() (ASN1_BIT_STRING *)\
+ ASN1_STRING_type_new(V_ASN1_BIT_STRING)
+# define M_ASN1_BIT_STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_ASN1_BIT_STRING_dup(a) (ASN1_BIT_STRING *)\
+ ASN1_STRING_dup((const ASN1_STRING *)a)
+# define M_ASN1_BIT_STRING_cmp(a,b) ASN1_STRING_cmp(\
+ (const ASN1_STRING *)a,(const ASN1_STRING *)b)
+# define M_ASN1_BIT_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c)
+
+# define M_ASN1_INTEGER_new() (ASN1_INTEGER *)\
+ ASN1_STRING_type_new(V_ASN1_INTEGER)
+# define M_ASN1_INTEGER_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_ASN1_INTEGER_dup(a) (ASN1_INTEGER *)\
+ ASN1_STRING_dup((const ASN1_STRING *)a)
+# define M_ASN1_INTEGER_cmp(a,b) ASN1_STRING_cmp(\
+ (const ASN1_STRING *)a,(const ASN1_STRING *)b)
+
+# define M_ASN1_ENUMERATED_new() (ASN1_ENUMERATED *)\
+ ASN1_STRING_type_new(V_ASN1_ENUMERATED)
+# define M_ASN1_ENUMERATED_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_ASN1_ENUMERATED_dup(a) (ASN1_ENUMERATED *)\
+ ASN1_STRING_dup((const ASN1_STRING *)a)
+# define M_ASN1_ENUMERATED_cmp(a,b) ASN1_STRING_cmp(\
+ (const ASN1_STRING *)a,(const ASN1_STRING *)b)
+
+# define M_ASN1_OCTET_STRING_new() (ASN1_OCTET_STRING *)\
+ ASN1_STRING_type_new(V_ASN1_OCTET_STRING)
+# define M_ASN1_OCTET_STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_ASN1_OCTET_STRING_dup(a) (ASN1_OCTET_STRING *)\
+ ASN1_STRING_dup((const ASN1_STRING *)a)
+# define M_ASN1_OCTET_STRING_cmp(a,b) ASN1_STRING_cmp(\
+ (const ASN1_STRING *)a,(const ASN1_STRING *)b)
+# define M_ASN1_OCTET_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c)
+# define M_ASN1_OCTET_STRING_print(a,b) ASN1_STRING_print(a,(ASN1_STRING *)b)
+# define M_i2d_ASN1_OCTET_STRING(a,pp) \
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_OCTET_STRING,\
+ V_ASN1_UNIVERSAL)
+
+# define B_ASN1_TIME \
+ B_ASN1_UTCTIME | \
+ B_ASN1_GENERALIZEDTIME
+
+# define B_ASN1_PRINTABLE \
+ B_ASN1_NUMERICSTRING| \
+ B_ASN1_PRINTABLESTRING| \
+ B_ASN1_T61STRING| \
+ B_ASN1_IA5STRING| \
+ B_ASN1_BIT_STRING| \
+ B_ASN1_UNIVERSALSTRING|\
+ B_ASN1_BMPSTRING|\
+ B_ASN1_UTF8STRING|\
+ B_ASN1_SEQUENCE|\
+ B_ASN1_UNKNOWN
+
+# define B_ASN1_DIRECTORYSTRING \
+ B_ASN1_PRINTABLESTRING| \
+ B_ASN1_TELETEXSTRING|\
+ B_ASN1_BMPSTRING|\
+ B_ASN1_UNIVERSALSTRING|\
+ B_ASN1_UTF8STRING
+
+# define B_ASN1_DISPLAYTEXT \
+ B_ASN1_IA5STRING| \
+ B_ASN1_VISIBLESTRING| \
+ B_ASN1_BMPSTRING|\
+ B_ASN1_UTF8STRING
+
+# define M_ASN1_PRINTABLE_new() ASN1_STRING_type_new(V_ASN1_T61STRING)
+# define M_ASN1_PRINTABLE_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_i2d_ASN1_PRINTABLE(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\
+ pp,a->type,V_ASN1_UNIVERSAL)
+# define M_d2i_ASN1_PRINTABLE(a,pp,l) \
+ d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \
+ B_ASN1_PRINTABLE)
+
+# define M_DIRECTORYSTRING_new() ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING)
+# define M_DIRECTORYSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_i2d_DIRECTORYSTRING(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\
+ pp,a->type,V_ASN1_UNIVERSAL)
+# define M_d2i_DIRECTORYSTRING(a,pp,l) \
+ d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \
+ B_ASN1_DIRECTORYSTRING)
+
+# define M_DISPLAYTEXT_new() ASN1_STRING_type_new(V_ASN1_VISIBLESTRING)
+# define M_DISPLAYTEXT_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_i2d_DISPLAYTEXT(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\
+ pp,a->type,V_ASN1_UNIVERSAL)
+# define M_d2i_DISPLAYTEXT(a,pp,l) \
+ d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \
+ B_ASN1_DISPLAYTEXT)
+
+# define M_ASN1_PRINTABLESTRING_new() (ASN1_PRINTABLESTRING *)\
+ ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING)
+# define M_ASN1_PRINTABLESTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_i2d_ASN1_PRINTABLESTRING(a,pp) \
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_PRINTABLESTRING,\
+ V_ASN1_UNIVERSAL)
+# define M_d2i_ASN1_PRINTABLESTRING(a,pp,l) \
+ (ASN1_PRINTABLESTRING *)d2i_ASN1_type_bytes\
+ ((ASN1_STRING **)a,pp,l,B_ASN1_PRINTABLESTRING)
+
+# define M_ASN1_T61STRING_new() (ASN1_T61STRING *)\
+ ASN1_STRING_type_new(V_ASN1_T61STRING)
+# define M_ASN1_T61STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_i2d_ASN1_T61STRING(a,pp) \
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_T61STRING,\
+ V_ASN1_UNIVERSAL)
+# define M_d2i_ASN1_T61STRING(a,pp,l) \
+ (ASN1_T61STRING *)d2i_ASN1_type_bytes\
+ ((ASN1_STRING **)a,pp,l,B_ASN1_T61STRING)
+
+# define M_ASN1_IA5STRING_new() (ASN1_IA5STRING *)\
+ ASN1_STRING_type_new(V_ASN1_IA5STRING)
+# define M_ASN1_IA5STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_ASN1_IA5STRING_dup(a) \
+ (ASN1_IA5STRING *)ASN1_STRING_dup((const ASN1_STRING *)a)
+# define M_i2d_ASN1_IA5STRING(a,pp) \
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_IA5STRING,\
+ V_ASN1_UNIVERSAL)
+# define M_d2i_ASN1_IA5STRING(a,pp,l) \
+ (ASN1_IA5STRING *)d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l,\
+ B_ASN1_IA5STRING)
+
+# define M_ASN1_UTCTIME_new() (ASN1_UTCTIME *)\
+ ASN1_STRING_type_new(V_ASN1_UTCTIME)
+# define M_ASN1_UTCTIME_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_ASN1_UTCTIME_dup(a) (ASN1_UTCTIME *)\
+ ASN1_STRING_dup((const ASN1_STRING *)a)
+
+# define M_ASN1_GENERALIZEDTIME_new() (ASN1_GENERALIZEDTIME *)\
+ ASN1_STRING_type_new(V_ASN1_GENERALIZEDTIME)
+# define M_ASN1_GENERALIZEDTIME_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_ASN1_GENERALIZEDTIME_dup(a) (ASN1_GENERALIZEDTIME *)ASN1_STRING_dup(\
+ (const ASN1_STRING *)a)
+
+# define M_ASN1_TIME_new() (ASN1_TIME *)\
+ ASN1_STRING_type_new(V_ASN1_UTCTIME)
+# define M_ASN1_TIME_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_ASN1_TIME_dup(a) (ASN1_TIME *)\
+ ASN1_STRING_dup((const ASN1_STRING *)a)
+
+# define M_ASN1_GENERALSTRING_new() (ASN1_GENERALSTRING *)\
+ ASN1_STRING_type_new(V_ASN1_GENERALSTRING)
+# define M_ASN1_GENERALSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_i2d_ASN1_GENERALSTRING(a,pp) \
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_GENERALSTRING,\
+ V_ASN1_UNIVERSAL)
+# define M_d2i_ASN1_GENERALSTRING(a,pp,l) \
+ (ASN1_GENERALSTRING *)d2i_ASN1_type_bytes\
+ ((ASN1_STRING **)a,pp,l,B_ASN1_GENERALSTRING)
+
+# define M_ASN1_UNIVERSALSTRING_new() (ASN1_UNIVERSALSTRING *)\
+ ASN1_STRING_type_new(V_ASN1_UNIVERSALSTRING)
+# define M_ASN1_UNIVERSALSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_i2d_ASN1_UNIVERSALSTRING(a,pp) \
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_UNIVERSALSTRING,\
+ V_ASN1_UNIVERSAL)
+# define M_d2i_ASN1_UNIVERSALSTRING(a,pp,l) \
+ (ASN1_UNIVERSALSTRING *)d2i_ASN1_type_bytes\
+ ((ASN1_STRING **)a,pp,l,B_ASN1_UNIVERSALSTRING)
+
+# define M_ASN1_BMPSTRING_new() (ASN1_BMPSTRING *)\
+ ASN1_STRING_type_new(V_ASN1_BMPSTRING)
+# define M_ASN1_BMPSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_i2d_ASN1_BMPSTRING(a,pp) \
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_BMPSTRING,\
+ V_ASN1_UNIVERSAL)
+# define M_d2i_ASN1_BMPSTRING(a,pp,l) \
+ (ASN1_BMPSTRING *)d2i_ASN1_type_bytes\
+ ((ASN1_STRING **)a,pp,l,B_ASN1_BMPSTRING)
+
+# define M_ASN1_VISIBLESTRING_new() (ASN1_VISIBLESTRING *)\
+ ASN1_STRING_type_new(V_ASN1_VISIBLESTRING)
+# define M_ASN1_VISIBLESTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_i2d_ASN1_VISIBLESTRING(a,pp) \
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_VISIBLESTRING,\
+ V_ASN1_UNIVERSAL)
+# define M_d2i_ASN1_VISIBLESTRING(a,pp,l) \
+ (ASN1_VISIBLESTRING *)d2i_ASN1_type_bytes\
+ ((ASN1_STRING **)a,pp,l,B_ASN1_VISIBLESTRING)
+
+# define M_ASN1_UTF8STRING_new() (ASN1_UTF8STRING *)\
+ ASN1_STRING_type_new(V_ASN1_UTF8STRING)
+# define M_ASN1_UTF8STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_i2d_ASN1_UTF8STRING(a,pp) \
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_UTF8STRING,\
+ V_ASN1_UNIVERSAL)
+# define M_d2i_ASN1_UTF8STRING(a,pp,l) \
+ (ASN1_UTF8STRING *)d2i_ASN1_type_bytes\
+ ((ASN1_STRING **)a,pp,l,B_ASN1_UTF8STRING)
+
+ /* for the is_set parameter to i2d_ASN1_SET */
+# define IS_SEQUENCE 0
+# define IS_SET 1
+
+DECLARE_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE)
+
+int ASN1_TYPE_get(ASN1_TYPE *a);
+void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value);
+int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value);
+int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b);
+
+ASN1_OBJECT *ASN1_OBJECT_new(void);
+void ASN1_OBJECT_free(ASN1_OBJECT *a);
+int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp);
+ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
+ long length);
+ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
+ long length);
+
+DECLARE_ASN1_ITEM(ASN1_OBJECT)
+
+DECLARE_STACK_OF(ASN1_OBJECT)
+DECLARE_ASN1_SET_OF(ASN1_OBJECT)
+
+ASN1_STRING *ASN1_STRING_new(void);
+void ASN1_STRING_free(ASN1_STRING *a);
+void ASN1_STRING_clear_free(ASN1_STRING *a);
+int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str);
+ASN1_STRING *ASN1_STRING_dup(const ASN1_STRING *a);
+ASN1_STRING *ASN1_STRING_type_new(int type);
+int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b);
+ /*
+ * Since this is used to store all sorts of things, via macros, for now,
+ * make its data void *
+ */
+int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len);
+void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len);
+int ASN1_STRING_length(const ASN1_STRING *x);
+void ASN1_STRING_length_set(ASN1_STRING *x, int n);
+int ASN1_STRING_type(ASN1_STRING *x);
+unsigned char *ASN1_STRING_data(ASN1_STRING *x);
+
+DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING)
+int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp);
+ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,
+ const unsigned char **pp, long length);
+int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, int length);
+int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value);
+int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n);
+int ASN1_BIT_STRING_check(ASN1_BIT_STRING *a,
+ unsigned char *flags, int flags_len);
+
+# ifndef OPENSSL_NO_BIO
+int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs,
+ BIT_STRING_BITNAME *tbl, int indent);
+# endif
+int ASN1_BIT_STRING_num_asc(char *name, BIT_STRING_BITNAME *tbl);
+int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value,
+ BIT_STRING_BITNAME *tbl);
+
+int i2d_ASN1_BOOLEAN(int a, unsigned char **pp);
+int d2i_ASN1_BOOLEAN(int *a, const unsigned char **pp, long length);
+
+DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER)
+int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp);
+ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp,
+ long length);
+ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp,
+ long length);
+ASN1_INTEGER *ASN1_INTEGER_dup(const ASN1_INTEGER *x);
+int ASN1_INTEGER_cmp(const ASN1_INTEGER *x, const ASN1_INTEGER *y);
+
+DECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED)
+
+int ASN1_UTCTIME_check(const ASN1_UTCTIME *a);
+ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t);
+ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t,
+ int offset_day, long offset_sec);
+int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str);
+int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t);
+# if 0
+time_t ASN1_UTCTIME_get(const ASN1_UTCTIME *s);
+# endif
+
+int ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *a);
+ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,
+ time_t t);
+ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s,
+ time_t t, int offset_day,
+ long offset_sec);
+int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str);
+int ASN1_TIME_diff(int *pday, int *psec,
+ const ASN1_TIME *from, const ASN1_TIME *to);
+
+DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING)
+ASN1_OCTET_STRING *ASN1_OCTET_STRING_dup(const ASN1_OCTET_STRING *a);
+int ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a,
+ const ASN1_OCTET_STRING *b);
+int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data,
+ int len);
+
+DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING)
+DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING)
+DECLARE_ASN1_FUNCTIONS(ASN1_UTF8STRING)
+DECLARE_ASN1_FUNCTIONS(ASN1_NULL)
+DECLARE_ASN1_FUNCTIONS(ASN1_BMPSTRING)
+
+int UTF8_getc(const unsigned char *str, int len, unsigned long *val);
+int UTF8_putc(unsigned char *str, int len, unsigned long value);
+
+DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE)
+
+DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING)
+DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DISPLAYTEXT)
+DECLARE_ASN1_FUNCTIONS(ASN1_PRINTABLESTRING)
+DECLARE_ASN1_FUNCTIONS(ASN1_T61STRING)
+DECLARE_ASN1_FUNCTIONS(ASN1_IA5STRING)
+DECLARE_ASN1_FUNCTIONS(ASN1_GENERALSTRING)
+DECLARE_ASN1_FUNCTIONS(ASN1_UTCTIME)
+DECLARE_ASN1_FUNCTIONS(ASN1_GENERALIZEDTIME)
+DECLARE_ASN1_FUNCTIONS(ASN1_TIME)
+
+DECLARE_ASN1_ITEM(ASN1_OCTET_STRING_NDEF)
+
+ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t);
+ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t,
+ int offset_day, long offset_sec);
+int ASN1_TIME_check(ASN1_TIME *t);
+ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME
+ **out);
+int ASN1_TIME_set_string(ASN1_TIME *s, const char *str);
+
+int i2d_ASN1_SET(STACK_OF(OPENSSL_BLOCK) *a, unsigned char **pp,
+ i2d_of_void *i2d, int ex_tag, int ex_class, int is_set);
+STACK_OF(OPENSSL_BLOCK) *d2i_ASN1_SET(STACK_OF(OPENSSL_BLOCK) **a,
+ const unsigned char **pp,
+ long length, d2i_of_void *d2i,
+ void (*free_func) (OPENSSL_BLOCK),
+ int ex_tag, int ex_class);
+
+# ifndef OPENSSL_NO_BIO
+int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a);
+int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size);
+int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a);
+int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size);
+int i2a_ASN1_OBJECT(BIO *bp, ASN1_OBJECT *a);
+int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size);
+int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type);
+# endif
+int i2t_ASN1_OBJECT(char *buf, int buf_len, ASN1_OBJECT *a);
+
+int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num);
+ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len,
+ const char *sn, const char *ln);
+
+int ASN1_INTEGER_set(ASN1_INTEGER *a, long v);
+long ASN1_INTEGER_get(const ASN1_INTEGER *a);
+ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai);
+BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn);
+
+int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v);
+long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a);
+ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai);
+BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai, BIGNUM *bn);
+
+/* General */
+/* given a string, return the correct type, max is the maximum length */
+int ASN1_PRINTABLE_type(const unsigned char *s, int max);
+
+int i2d_ASN1_bytes(ASN1_STRING *a, unsigned char **pp, int tag, int xclass);
+ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp,
+ long length, int Ptag, int Pclass);
+unsigned long ASN1_tag2bit(int tag);
+/* type is one or more of the B_ASN1_ values. */
+ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a, const unsigned char **pp,
+ long length, int type);
+
+/* PARSING */
+int asn1_Finish(ASN1_CTX *c);
+int asn1_const_Finish(ASN1_const_CTX *c);
+
+/* SPECIALS */
+int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag,
+ int *pclass, long omax);
+int ASN1_check_infinite_end(unsigned char **p, long len);
+int ASN1_const_check_infinite_end(const unsigned char **p, long len);
+void ASN1_put_object(unsigned char **pp, int constructed, int length,
+ int tag, int xclass);
+int ASN1_put_eoc(unsigned char **pp);
+int ASN1_object_size(int constructed, int length, int tag);
+
+/* Used to implement other functions */
+void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, void *x);
+
+# define ASN1_dup_of(type,i2d,d2i,x) \
+ ((type*)ASN1_dup(CHECKED_I2D_OF(type, i2d), \
+ CHECKED_D2I_OF(type, d2i), \
+ CHECKED_PTR_OF(type, x)))
+
+# define ASN1_dup_of_const(type,i2d,d2i,x) \
+ ((type*)ASN1_dup(CHECKED_I2D_OF(const type, i2d), \
+ CHECKED_D2I_OF(type, d2i), \
+ CHECKED_PTR_OF(const type, x)))
+
+void *ASN1_item_dup(const ASN1_ITEM *it, void *x);
+
+/* ASN1 alloc/free macros for when a type is only used internally */
+
+# define M_ASN1_new_of(type) (type *)ASN1_item_new(ASN1_ITEM_rptr(type))
+# define M_ASN1_free_of(x, type) \
+ ASN1_item_free(CHECKED_PTR_OF(type, x), ASN1_ITEM_rptr(type))
+
+# ifndef OPENSSL_NO_FP_API
+void *ASN1_d2i_fp(void *(*xnew) (void), d2i_of_void *d2i, FILE *in, void **x);
+
+# define ASN1_d2i_fp_of(type,xnew,d2i,in,x) \
+ ((type*)ASN1_d2i_fp(CHECKED_NEW_OF(type, xnew), \
+ CHECKED_D2I_OF(type, d2i), \
+ in, \
+ CHECKED_PPTR_OF(type, x)))
+
+void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x);
+int ASN1_i2d_fp(i2d_of_void *i2d, FILE *out, void *x);
+
+# define ASN1_i2d_fp_of(type,i2d,out,x) \
+ (ASN1_i2d_fp(CHECKED_I2D_OF(type, i2d), \
+ out, \
+ CHECKED_PTR_OF(type, x)))
+
+# define ASN1_i2d_fp_of_const(type,i2d,out,x) \
+ (ASN1_i2d_fp(CHECKED_I2D_OF(const type, i2d), \
+ out, \
+ CHECKED_PTR_OF(const type, x)))
+
+int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x);
+int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags);
+# endif
+
+int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in);
+
+# ifndef OPENSSL_NO_BIO
+void *ASN1_d2i_bio(void *(*xnew) (void), d2i_of_void *d2i, BIO *in, void **x);
+
+# define ASN1_d2i_bio_of(type,xnew,d2i,in,x) \
+ ((type*)ASN1_d2i_bio( CHECKED_NEW_OF(type, xnew), \
+ CHECKED_D2I_OF(type, d2i), \
+ in, \
+ CHECKED_PPTR_OF(type, x)))
+
+void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x);
+int ASN1_i2d_bio(i2d_of_void *i2d, BIO *out, unsigned char *x);
+
+# define ASN1_i2d_bio_of(type,i2d,out,x) \
+ (ASN1_i2d_bio(CHECKED_I2D_OF(type, i2d), \
+ out, \
+ CHECKED_PTR_OF(type, x)))
+
+# define ASN1_i2d_bio_of_const(type,i2d,out,x) \
+ (ASN1_i2d_bio(CHECKED_I2D_OF(const type, i2d), \
+ out, \
+ CHECKED_PTR_OF(const type, x)))
+
+int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x);
+int ASN1_UTCTIME_print(BIO *fp, const ASN1_UTCTIME *a);
+int ASN1_GENERALIZEDTIME_print(BIO *fp, const ASN1_GENERALIZEDTIME *a);
+int ASN1_TIME_print(BIO *fp, const ASN1_TIME *a);
+int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v);
+int ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags);
+int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num,
+ unsigned char *buf, int off);
+int ASN1_parse(BIO *bp, const unsigned char *pp, long len, int indent);
+int ASN1_parse_dump(BIO *bp, const unsigned char *pp, long len, int indent,
+ int dump);
+# endif
+const char *ASN1_tag2str(int tag);
+
+/* Used to load and write netscape format cert */
+
+DECLARE_ASN1_FUNCTIONS(NETSCAPE_X509)
+
+int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s);
+
+int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len);
+int ASN1_TYPE_get_octetstring(ASN1_TYPE *a, unsigned char *data, int max_len);
+int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num,
+ unsigned char *data, int len);
+int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a, long *num,
+ unsigned char *data, int max_len);
+
+STACK_OF(OPENSSL_BLOCK) *ASN1_seq_unpack(const unsigned char *buf, int len,
+ d2i_of_void *d2i,
+ void (*free_func) (OPENSSL_BLOCK));
+unsigned char *ASN1_seq_pack(STACK_OF(OPENSSL_BLOCK) *safes, i2d_of_void *i2d,
+ unsigned char **buf, int *len);
+void *ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i);
+void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it);
+ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d,
+ ASN1_OCTET_STRING **oct);
+
+# define ASN1_pack_string_of(type,obj,i2d,oct) \
+ (ASN1_pack_string(CHECKED_PTR_OF(type, obj), \
+ CHECKED_I2D_OF(type, i2d), \
+ oct))
+
+ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it,
+ ASN1_OCTET_STRING **oct);
+
+void ASN1_STRING_set_default_mask(unsigned long mask);
+int ASN1_STRING_set_default_mask_asc(const char *p);
+unsigned long ASN1_STRING_get_default_mask(void);
+int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len,
+ int inform, unsigned long mask);
+int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
+ int inform, unsigned long mask,
+ long minsize, long maxsize);
+
+ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out,
+ const unsigned char *in, int inlen,
+ int inform, int nid);
+ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid);
+int ASN1_STRING_TABLE_add(int, long, long, unsigned long, unsigned long);
+void ASN1_STRING_TABLE_cleanup(void);
+
+/* ASN1 template functions */
+
+/* Old API compatible functions */
+ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it);
+void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it);
+ASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **val, const unsigned char **in,
+ long len, const ASN1_ITEM *it);
+int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it);
+int ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out,
+ const ASN1_ITEM *it);
+
+void ASN1_add_oid_module(void);
+
+ASN1_TYPE *ASN1_generate_nconf(char *str, CONF *nconf);
+ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf);
+
+/* ASN1 Print flags */
+
+/* Indicate missing OPTIONAL fields */
+# define ASN1_PCTX_FLAGS_SHOW_ABSENT 0x001
+/* Mark start and end of SEQUENCE */
+# define ASN1_PCTX_FLAGS_SHOW_SEQUENCE 0x002
+/* Mark start and end of SEQUENCE/SET OF */
+# define ASN1_PCTX_FLAGS_SHOW_SSOF 0x004
+/* Show the ASN1 type of primitives */
+# define ASN1_PCTX_FLAGS_SHOW_TYPE 0x008
+/* Don't show ASN1 type of ANY */
+# define ASN1_PCTX_FLAGS_NO_ANY_TYPE 0x010
+/* Don't show ASN1 type of MSTRINGs */
+# define ASN1_PCTX_FLAGS_NO_MSTRING_TYPE 0x020
+/* Don't show field names in SEQUENCE */
+# define ASN1_PCTX_FLAGS_NO_FIELD_NAME 0x040
+/* Show structure names of each SEQUENCE field */
+# define ASN1_PCTX_FLAGS_SHOW_FIELD_STRUCT_NAME 0x080
+/* Don't show structure name even at top level */
+# define ASN1_PCTX_FLAGS_NO_STRUCT_NAME 0x100
+
+int ASN1_item_print(BIO *out, ASN1_VALUE *ifld, int indent,
+ const ASN1_ITEM *it, const ASN1_PCTX *pctx);
+ASN1_PCTX *ASN1_PCTX_new(void);
+void ASN1_PCTX_free(ASN1_PCTX *p);
+unsigned long ASN1_PCTX_get_flags(ASN1_PCTX *p);
+void ASN1_PCTX_set_flags(ASN1_PCTX *p, unsigned long flags);
+unsigned long ASN1_PCTX_get_nm_flags(ASN1_PCTX *p);
+void ASN1_PCTX_set_nm_flags(ASN1_PCTX *p, unsigned long flags);
+unsigned long ASN1_PCTX_get_cert_flags(ASN1_PCTX *p);
+void ASN1_PCTX_set_cert_flags(ASN1_PCTX *p, unsigned long flags);
+unsigned long ASN1_PCTX_get_oid_flags(ASN1_PCTX *p);
+void ASN1_PCTX_set_oid_flags(ASN1_PCTX *p, unsigned long flags);
+unsigned long ASN1_PCTX_get_str_flags(ASN1_PCTX *p);
+void ASN1_PCTX_set_str_flags(ASN1_PCTX *p, unsigned long flags);
+
+BIO_METHOD *BIO_f_asn1(void);
+
+BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it);
+
+int i2d_ASN1_bio_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags,
+ const ASN1_ITEM *it);
+int PEM_write_bio_ASN1_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags,
+ const char *hdr, const ASN1_ITEM *it);
+int SMIME_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags,
+ int ctype_nid, int econt_nid,
+ STACK_OF(X509_ALGOR) *mdalgs, const ASN1_ITEM *it);
+ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it);
+int SMIME_crlf_copy(BIO *in, BIO *out, int flags);
+int SMIME_text(BIO *in, BIO *out);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_ASN1_strings(void);
+
+/* Error codes for the ASN1 functions. */
+
+/* Function codes. */
+# define ASN1_F_A2D_ASN1_OBJECT 100
+# define ASN1_F_A2I_ASN1_ENUMERATED 101
+# define ASN1_F_A2I_ASN1_INTEGER 102
+# define ASN1_F_A2I_ASN1_STRING 103
+# define ASN1_F_APPEND_EXP 176
+# define ASN1_F_ASN1_BIT_STRING_SET_BIT 183
+# define ASN1_F_ASN1_CB 177
+# define ASN1_F_ASN1_CHECK_TLEN 104
+# define ASN1_F_ASN1_COLLATE_PRIMITIVE 105
+# define ASN1_F_ASN1_COLLECT 106
+# define ASN1_F_ASN1_D2I_EX_PRIMITIVE 108
+# define ASN1_F_ASN1_D2I_FP 109
+# define ASN1_F_ASN1_D2I_READ_BIO 107
+# define ASN1_F_ASN1_DIGEST 184
+# define ASN1_F_ASN1_DO_ADB 110
+# define ASN1_F_ASN1_DUP 111
+# define ASN1_F_ASN1_ENUMERATED_SET 112
+# define ASN1_F_ASN1_ENUMERATED_TO_BN 113
+# define ASN1_F_ASN1_EX_C2I 204
+# define ASN1_F_ASN1_FIND_END 190
+# define ASN1_F_ASN1_GENERALIZEDTIME_ADJ 216
+# define ASN1_F_ASN1_GENERALIZEDTIME_SET 185
+# define ASN1_F_ASN1_GENERATE_V3 178
+# define ASN1_F_ASN1_GET_OBJECT 114
+# define ASN1_F_ASN1_HEADER_NEW 115
+# define ASN1_F_ASN1_I2D_BIO 116
+# define ASN1_F_ASN1_I2D_FP 117
+# define ASN1_F_ASN1_INTEGER_SET 118
+# define ASN1_F_ASN1_INTEGER_TO_BN 119
+# define ASN1_F_ASN1_ITEM_D2I_FP 206
+# define ASN1_F_ASN1_ITEM_DUP 191
+# define ASN1_F_ASN1_ITEM_EX_COMBINE_NEW 121
+# define ASN1_F_ASN1_ITEM_EX_D2I 120
+# define ASN1_F_ASN1_ITEM_I2D_BIO 192
+# define ASN1_F_ASN1_ITEM_I2D_FP 193
+# define ASN1_F_ASN1_ITEM_PACK 198
+# define ASN1_F_ASN1_ITEM_SIGN 195
+# define ASN1_F_ASN1_ITEM_SIGN_CTX 220
+# define ASN1_F_ASN1_ITEM_UNPACK 199
+# define ASN1_F_ASN1_ITEM_VERIFY 197
+# define ASN1_F_ASN1_MBSTRING_NCOPY 122
+# define ASN1_F_ASN1_OBJECT_NEW 123
+# define ASN1_F_ASN1_OUTPUT_DATA 214
+# define ASN1_F_ASN1_PACK_STRING 124
+# define ASN1_F_ASN1_PCTX_NEW 205
+# define ASN1_F_ASN1_PKCS5_PBE_SET 125
+# define ASN1_F_ASN1_SEQ_PACK 126
+# define ASN1_F_ASN1_SEQ_UNPACK 127
+# define ASN1_F_ASN1_SIGN 128
+# define ASN1_F_ASN1_STR2TYPE 179
+# define ASN1_F_ASN1_STRING_SET 186
+# define ASN1_F_ASN1_STRING_TABLE_ADD 129
+# define ASN1_F_ASN1_STRING_TYPE_NEW 130
+# define ASN1_F_ASN1_TEMPLATE_EX_D2I 132
+# define ASN1_F_ASN1_TEMPLATE_NEW 133
+# define ASN1_F_ASN1_TEMPLATE_NOEXP_D2I 131
+# define ASN1_F_ASN1_TIME_ADJ 217
+# define ASN1_F_ASN1_TIME_SET 175
+# define ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING 134
+# define ASN1_F_ASN1_TYPE_GET_OCTETSTRING 135
+# define ASN1_F_ASN1_UNPACK_STRING 136
+# define ASN1_F_ASN1_UTCTIME_ADJ 218
+# define ASN1_F_ASN1_UTCTIME_SET 187
+# define ASN1_F_ASN1_VERIFY 137
+# define ASN1_F_B64_READ_ASN1 209
+# define ASN1_F_B64_WRITE_ASN1 210
+# define ASN1_F_BIO_NEW_NDEF 208
+# define ASN1_F_BITSTR_CB 180
+# define ASN1_F_BN_TO_ASN1_ENUMERATED 138
+# define ASN1_F_BN_TO_ASN1_INTEGER 139
+# define ASN1_F_C2I_ASN1_BIT_STRING 189
+# define ASN1_F_C2I_ASN1_INTEGER 194
+# define ASN1_F_C2I_ASN1_OBJECT 196
+# define ASN1_F_COLLECT_DATA 140
+# define ASN1_F_D2I_ASN1_BIT_STRING 141
+# define ASN1_F_D2I_ASN1_BOOLEAN 142
+# define ASN1_F_D2I_ASN1_BYTES 143
+# define ASN1_F_D2I_ASN1_GENERALIZEDTIME 144
+# define ASN1_F_D2I_ASN1_HEADER 145
+# define ASN1_F_D2I_ASN1_INTEGER 146
+# define ASN1_F_D2I_ASN1_OBJECT 147
+# define ASN1_F_D2I_ASN1_SET 148
+# define ASN1_F_D2I_ASN1_TYPE_BYTES 149
+# define ASN1_F_D2I_ASN1_UINTEGER 150
+# define ASN1_F_D2I_ASN1_UTCTIME 151
+# define ASN1_F_D2I_AUTOPRIVATEKEY 207
+# define ASN1_F_D2I_NETSCAPE_RSA 152
+# define ASN1_F_D2I_NETSCAPE_RSA_2 153
+# define ASN1_F_D2I_PRIVATEKEY 154
+# define ASN1_F_D2I_PUBLICKEY 155
+# define ASN1_F_D2I_RSA_NET 200
+# define ASN1_F_D2I_RSA_NET_2 201
+# define ASN1_F_D2I_X509 156
+# define ASN1_F_D2I_X509_CINF 157
+# define ASN1_F_D2I_X509_PKEY 159
+# define ASN1_F_I2D_ASN1_BIO_STREAM 211
+# define ASN1_F_I2D_ASN1_SET 188
+# define ASN1_F_I2D_ASN1_TIME 160
+# define ASN1_F_I2D_DSA_PUBKEY 161
+# define ASN1_F_I2D_EC_PUBKEY 181
+# define ASN1_F_I2D_PRIVATEKEY 163
+# define ASN1_F_I2D_PUBLICKEY 164
+# define ASN1_F_I2D_RSA_NET 162
+# define ASN1_F_I2D_RSA_PUBKEY 165
+# define ASN1_F_LONG_C2I 166
+# define ASN1_F_OID_MODULE_INIT 174
+# define ASN1_F_PARSE_TAGGING 182
+# define ASN1_F_PKCS5_PBE2_SET_IV 167
+# define ASN1_F_PKCS5_PBE_SET 202
+# define ASN1_F_PKCS5_PBE_SET0_ALGOR 215
+# define ASN1_F_PKCS5_PBKDF2_SET 219
+# define ASN1_F_SMIME_READ_ASN1 212
+# define ASN1_F_SMIME_TEXT 213
+# define ASN1_F_X509_CINF_NEW 168
+# define ASN1_F_X509_CRL_ADD0_REVOKED 169
+# define ASN1_F_X509_INFO_NEW 170
+# define ASN1_F_X509_NAME_ENCODE 203
+# define ASN1_F_X509_NAME_EX_D2I 158
+# define ASN1_F_X509_NAME_EX_NEW 171
+# define ASN1_F_X509_NEW 172
+# define ASN1_F_X509_PKEY_NEW 173
+
+/* Reason codes. */
+# define ASN1_R_ADDING_OBJECT 171
+# define ASN1_R_ASN1_PARSE_ERROR 203
+# define ASN1_R_ASN1_SIG_PARSE_ERROR 204
+# define ASN1_R_AUX_ERROR 100
+# define ASN1_R_BAD_CLASS 101
+# define ASN1_R_BAD_OBJECT_HEADER 102
+# define ASN1_R_BAD_PASSWORD_READ 103
+# define ASN1_R_BAD_TAG 104
+# define ASN1_R_BMPSTRING_IS_WRONG_LENGTH 214
+# define ASN1_R_BN_LIB 105
+# define ASN1_R_BOOLEAN_IS_WRONG_LENGTH 106
+# define ASN1_R_BUFFER_TOO_SMALL 107
+# define ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 108
+# define ASN1_R_CONTEXT_NOT_INITIALISED 217
+# define ASN1_R_DATA_IS_WRONG 109
+# define ASN1_R_DECODE_ERROR 110
+# define ASN1_R_DECODING_ERROR 111
+# define ASN1_R_DEPTH_EXCEEDED 174
+# define ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED 198
+# define ASN1_R_ENCODE_ERROR 112
+# define ASN1_R_ERROR_GETTING_TIME 173
+# define ASN1_R_ERROR_LOADING_SECTION 172
+# define ASN1_R_ERROR_PARSING_SET_ELEMENT 113
+# define ASN1_R_ERROR_SETTING_CIPHER_PARAMS 114
+# define ASN1_R_EXPECTING_AN_INTEGER 115
+# define ASN1_R_EXPECTING_AN_OBJECT 116
+# define ASN1_R_EXPECTING_A_BOOLEAN 117
+# define ASN1_R_EXPECTING_A_TIME 118
+# define ASN1_R_EXPLICIT_LENGTH_MISMATCH 119
+# define ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED 120
+# define ASN1_R_FIELD_MISSING 121
+# define ASN1_R_FIRST_NUM_TOO_LARGE 122
+# define ASN1_R_HEADER_TOO_LONG 123
+# define ASN1_R_ILLEGAL_BITSTRING_FORMAT 175
+# define ASN1_R_ILLEGAL_BOOLEAN 176
+# define ASN1_R_ILLEGAL_CHARACTERS 124
+# define ASN1_R_ILLEGAL_FORMAT 177
+# define ASN1_R_ILLEGAL_HEX 178
+# define ASN1_R_ILLEGAL_IMPLICIT_TAG 179
+# define ASN1_R_ILLEGAL_INTEGER 180
+# define ASN1_R_ILLEGAL_NESTED_TAGGING 181
+# define ASN1_R_ILLEGAL_NULL 125
+# define ASN1_R_ILLEGAL_NULL_VALUE 182
+# define ASN1_R_ILLEGAL_OBJECT 183
+# define ASN1_R_ILLEGAL_OPTIONAL_ANY 126
+# define ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE 170
+# define ASN1_R_ILLEGAL_TAGGED_ANY 127
+# define ASN1_R_ILLEGAL_TIME_VALUE 184
+# define ASN1_R_INTEGER_NOT_ASCII_FORMAT 185
+# define ASN1_R_INTEGER_TOO_LARGE_FOR_LONG 128
+# define ASN1_R_INVALID_BIT_STRING_BITS_LEFT 220
+# define ASN1_R_INVALID_BMPSTRING_LENGTH 129
+# define ASN1_R_INVALID_DIGIT 130
+# define ASN1_R_INVALID_MIME_TYPE 205
+# define ASN1_R_INVALID_MODIFIER 186
+# define ASN1_R_INVALID_NUMBER 187
+# define ASN1_R_INVALID_OBJECT_ENCODING 216
+# define ASN1_R_INVALID_SEPARATOR 131
+# define ASN1_R_INVALID_TIME_FORMAT 132
+# define ASN1_R_INVALID_UNIVERSALSTRING_LENGTH 133
+# define ASN1_R_INVALID_UTF8STRING 134
+# define ASN1_R_IV_TOO_LARGE 135
+# define ASN1_R_LENGTH_ERROR 136
+# define ASN1_R_LIST_ERROR 188
+# define ASN1_R_MIME_NO_CONTENT_TYPE 206
+# define ASN1_R_MIME_PARSE_ERROR 207
+# define ASN1_R_MIME_SIG_PARSE_ERROR 208
+# define ASN1_R_MISSING_EOC 137
+# define ASN1_R_MISSING_SECOND_NUMBER 138
+# define ASN1_R_MISSING_VALUE 189
+# define ASN1_R_MSTRING_NOT_UNIVERSAL 139
+# define ASN1_R_MSTRING_WRONG_TAG 140
+# define ASN1_R_NESTED_ASN1_STRING 197
+# define ASN1_R_NON_HEX_CHARACTERS 141
+# define ASN1_R_NOT_ASCII_FORMAT 190
+# define ASN1_R_NOT_ENOUGH_DATA 142
+# define ASN1_R_NO_CONTENT_TYPE 209
+# define ASN1_R_NO_DEFAULT_DIGEST 201
+# define ASN1_R_NO_MATCHING_CHOICE_TYPE 143
+# define ASN1_R_NO_MULTIPART_BODY_FAILURE 210
+# define ASN1_R_NO_MULTIPART_BOUNDARY 211
+# define ASN1_R_NO_SIG_CONTENT_TYPE 212
+# define ASN1_R_NULL_IS_WRONG_LENGTH 144
+# define ASN1_R_OBJECT_NOT_ASCII_FORMAT 191
+# define ASN1_R_ODD_NUMBER_OF_CHARS 145
+# define ASN1_R_PRIVATE_KEY_HEADER_MISSING 146
+# define ASN1_R_SECOND_NUMBER_TOO_LARGE 147
+# define ASN1_R_SEQUENCE_LENGTH_MISMATCH 148
+# define ASN1_R_SEQUENCE_NOT_CONSTRUCTED 149
+# define ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG 192
+# define ASN1_R_SHORT_LINE 150
+# define ASN1_R_SIG_INVALID_MIME_TYPE 213
+# define ASN1_R_STREAMING_NOT_SUPPORTED 202
+# define ASN1_R_STRING_TOO_LONG 151
+# define ASN1_R_STRING_TOO_SHORT 152
+# define ASN1_R_TAG_VALUE_TOO_HIGH 153
+# define ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 154
+# define ASN1_R_TIME_NOT_ASCII_FORMAT 193
+# define ASN1_R_TOO_LONG 155
+# define ASN1_R_TYPE_NOT_CONSTRUCTED 156
+# define ASN1_R_TYPE_NOT_PRIMITIVE 218
+# define ASN1_R_UNABLE_TO_DECODE_RSA_KEY 157
+# define ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY 158
+# define ASN1_R_UNEXPECTED_EOC 159
+# define ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH 215
+# define ASN1_R_UNKNOWN_FORMAT 160
+# define ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM 161
+# define ASN1_R_UNKNOWN_OBJECT_TYPE 162
+# define ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE 163
+# define ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM 199
+# define ASN1_R_UNKNOWN_TAG 194
+# define ASN1_R_UNKOWN_FORMAT 195
+# define ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE 164
+# define ASN1_R_UNSUPPORTED_CIPHER 165
+# define ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM 166
+# define ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE 167
+# define ASN1_R_UNSUPPORTED_TYPE 196
+# define ASN1_R_WRONG_PUBLIC_KEY_TYPE 200
+# define ASN1_R_WRONG_TAG 168
+# define ASN1_R_WRONG_TYPE 169
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/asn1_mac.h b/protocols/Telegram/tgl/openssl/include/openssl/asn1_mac.h
new file mode 100644
index 0000000000..abc6dc35ca
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/asn1_mac.h
@@ -0,0 +1,579 @@
+/* crypto/asn1/asn1_mac.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_ASN1_MAC_H
+# define HEADER_ASN1_MAC_H
+
+# include <openssl/asn1.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# ifndef ASN1_MAC_ERR_LIB
+# define ASN1_MAC_ERR_LIB ERR_LIB_ASN1
+# endif
+
+# define ASN1_MAC_H_err(f,r,line) \
+ ERR_PUT_error(ASN1_MAC_ERR_LIB,(f),(r),__FILE__,(line))
+
+# define M_ASN1_D2I_vars(a,type,func) \
+ ASN1_const_CTX c; \
+ type ret=NULL; \
+ \
+ c.pp=(const unsigned char **)pp; \
+ c.q= *(const unsigned char **)pp; \
+ c.error=ERR_R_NESTED_ASN1_ERROR; \
+ if ((a == NULL) || ((*a) == NULL)) \
+ { if ((ret=(type)func()) == NULL) \
+ { c.line=__LINE__; goto err; } } \
+ else ret=(*a);
+
+# define M_ASN1_D2I_Init() \
+ c.p= *(const unsigned char **)pp; \
+ c.max=(length == 0)?0:(c.p+length);
+
+# define M_ASN1_D2I_Finish_2(a) \
+ if (!asn1_const_Finish(&c)) \
+ { c.line=__LINE__; goto err; } \
+ *(const unsigned char **)pp=c.p; \
+ if (a != NULL) (*a)=ret; \
+ return(ret);
+
+# define M_ASN1_D2I_Finish(a,func,e) \
+ M_ASN1_D2I_Finish_2(a); \
+err:\
+ ASN1_MAC_H_err((e),c.error,c.line); \
+ asn1_add_error(*(const unsigned char **)pp,(int)(c.q- *pp)); \
+ if ((ret != NULL) && ((a == NULL) || (*a != ret))) func(ret); \
+ return(NULL)
+
+# define M_ASN1_D2I_start_sequence() \
+ if (!asn1_GetSequence(&c,&length)) \
+ { c.line=__LINE__; goto err; }
+/* Begin reading ASN1 without a surrounding sequence */
+# define M_ASN1_D2I_begin() \
+ c.slen = length;
+
+/* End reading ASN1 with no check on length */
+# define M_ASN1_D2I_Finish_nolen(a, func, e) \
+ *pp=c.p; \
+ if (a != NULL) (*a)=ret; \
+ return(ret); \
+err:\
+ ASN1_MAC_H_err((e),c.error,c.line); \
+ asn1_add_error(*pp,(int)(c.q- *pp)); \
+ if ((ret != NULL) && ((a == NULL) || (*a != ret))) func(ret); \
+ return(NULL)
+
+# define M_ASN1_D2I_end_sequence() \
+ (((c.inf&1) == 0)?(c.slen <= 0): \
+ (c.eos=ASN1_const_check_infinite_end(&c.p,c.slen)))
+
+/* Don't use this with d2i_ASN1_BOOLEAN() */
+# define M_ASN1_D2I_get(b, func) \
+ c.q=c.p; \
+ if (func(&(b),&c.p,c.slen) == NULL) \
+ {c.line=__LINE__; goto err; } \
+ c.slen-=(c.p-c.q);
+
+/* Don't use this with d2i_ASN1_BOOLEAN() */
+# define M_ASN1_D2I_get_x(type,b,func) \
+ c.q=c.p; \
+ if (((D2I_OF(type))func)(&(b),&c.p,c.slen) == NULL) \
+ {c.line=__LINE__; goto err; } \
+ c.slen-=(c.p-c.q);
+
+/* use this instead () */
+# define M_ASN1_D2I_get_int(b,func) \
+ c.q=c.p; \
+ if (func(&(b),&c.p,c.slen) < 0) \
+ {c.line=__LINE__; goto err; } \
+ c.slen-=(c.p-c.q);
+
+# define M_ASN1_D2I_get_opt(b,func,type) \
+ if ((c.slen != 0) && ((M_ASN1_next & (~V_ASN1_CONSTRUCTED)) \
+ == (V_ASN1_UNIVERSAL|(type)))) \
+ { \
+ M_ASN1_D2I_get(b,func); \
+ }
+
+# define M_ASN1_D2I_get_int_opt(b,func,type) \
+ if ((c.slen != 0) && ((M_ASN1_next & (~V_ASN1_CONSTRUCTED)) \
+ == (V_ASN1_UNIVERSAL|(type)))) \
+ { \
+ M_ASN1_D2I_get_int(b,func); \
+ }
+
+# define M_ASN1_D2I_get_imp(b,func, type) \
+ M_ASN1_next=(_tmp& V_ASN1_CONSTRUCTED)|type; \
+ c.q=c.p; \
+ if (func(&(b),&c.p,c.slen) == NULL) \
+ {c.line=__LINE__; M_ASN1_next_prev = _tmp; goto err; } \
+ c.slen-=(c.p-c.q);\
+ M_ASN1_next_prev=_tmp;
+
+# define M_ASN1_D2I_get_IMP_opt(b,func,tag,type) \
+ if ((c.slen != 0) && ((M_ASN1_next & (~V_ASN1_CONSTRUCTED)) == \
+ (V_ASN1_CONTEXT_SPECIFIC|(tag)))) \
+ { \
+ unsigned char _tmp = M_ASN1_next; \
+ M_ASN1_D2I_get_imp(b,func, type);\
+ }
+
+# define M_ASN1_D2I_get_set(r,func,free_func) \
+ M_ASN1_D2I_get_imp_set(r,func,free_func, \
+ V_ASN1_SET,V_ASN1_UNIVERSAL);
+
+# define M_ASN1_D2I_get_set_type(type,r,func,free_func) \
+ M_ASN1_D2I_get_imp_set_type(type,r,func,free_func, \
+ V_ASN1_SET,V_ASN1_UNIVERSAL);
+
+# define M_ASN1_D2I_get_set_opt(r,func,free_func) \
+ if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \
+ V_ASN1_CONSTRUCTED|V_ASN1_SET)))\
+ { M_ASN1_D2I_get_set(r,func,free_func); }
+
+# define M_ASN1_D2I_get_set_opt_type(type,r,func,free_func) \
+ if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \
+ V_ASN1_CONSTRUCTED|V_ASN1_SET)))\
+ { M_ASN1_D2I_get_set_type(type,r,func,free_func); }
+
+# define M_ASN1_I2D_len_SET_opt(a,f) \
+ if ((a != NULL) && (sk_num(a) != 0)) \
+ M_ASN1_I2D_len_SET(a,f);
+
+# define M_ASN1_I2D_put_SET_opt(a,f) \
+ if ((a != NULL) && (sk_num(a) != 0)) \
+ M_ASN1_I2D_put_SET(a,f);
+
+# define M_ASN1_I2D_put_SEQUENCE_opt(a,f) \
+ if ((a != NULL) && (sk_num(a) != 0)) \
+ M_ASN1_I2D_put_SEQUENCE(a,f);
+
+# define M_ASN1_I2D_put_SEQUENCE_opt_type(type,a,f) \
+ if ((a != NULL) && (sk_##type##_num(a) != 0)) \
+ M_ASN1_I2D_put_SEQUENCE_type(type,a,f);
+
+# define M_ASN1_D2I_get_IMP_set_opt(b,func,free_func,tag) \
+ if ((c.slen != 0) && \
+ (M_ASN1_next == \
+ (V_ASN1_CONTEXT_SPECIFIC|V_ASN1_CONSTRUCTED|(tag))))\
+ { \
+ M_ASN1_D2I_get_imp_set(b,func,free_func,\
+ tag,V_ASN1_CONTEXT_SPECIFIC); \
+ }
+
+# define M_ASN1_D2I_get_IMP_set_opt_type(type,b,func,free_func,tag) \
+ if ((c.slen != 0) && \
+ (M_ASN1_next == \
+ (V_ASN1_CONTEXT_SPECIFIC|V_ASN1_CONSTRUCTED|(tag))))\
+ { \
+ M_ASN1_D2I_get_imp_set_type(type,b,func,free_func,\
+ tag,V_ASN1_CONTEXT_SPECIFIC); \
+ }
+
+# define M_ASN1_D2I_get_seq(r,func,free_func) \
+ M_ASN1_D2I_get_imp_set(r,func,free_func,\
+ V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL);
+
+# define M_ASN1_D2I_get_seq_type(type,r,func,free_func) \
+ M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,\
+ V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL)
+
+# define M_ASN1_D2I_get_seq_opt(r,func,free_func) \
+ if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \
+ V_ASN1_CONSTRUCTED|V_ASN1_SEQUENCE)))\
+ { M_ASN1_D2I_get_seq(r,func,free_func); }
+
+# define M_ASN1_D2I_get_seq_opt_type(type,r,func,free_func) \
+ if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \
+ V_ASN1_CONSTRUCTED|V_ASN1_SEQUENCE)))\
+ { M_ASN1_D2I_get_seq_type(type,r,func,free_func); }
+
+# define M_ASN1_D2I_get_IMP_set(r,func,free_func,x) \
+ M_ASN1_D2I_get_imp_set(r,func,free_func,\
+ x,V_ASN1_CONTEXT_SPECIFIC);
+
+# define M_ASN1_D2I_get_IMP_set_type(type,r,func,free_func,x) \
+ M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,\
+ x,V_ASN1_CONTEXT_SPECIFIC);
+
+# define M_ASN1_D2I_get_imp_set(r,func,free_func,a,b) \
+ c.q=c.p; \
+ if (d2i_ASN1_SET(&(r),&c.p,c.slen,(char *(*)())func,\
+ (void (*)())free_func,a,b) == NULL) \
+ { c.line=__LINE__; goto err; } \
+ c.slen-=(c.p-c.q);
+
+# define M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,a,b) \
+ c.q=c.p; \
+ if (d2i_ASN1_SET_OF_##type(&(r),&c.p,c.slen,func,\
+ free_func,a,b) == NULL) \
+ { c.line=__LINE__; goto err; } \
+ c.slen-=(c.p-c.q);
+
+# define M_ASN1_D2I_get_set_strings(r,func,a,b) \
+ c.q=c.p; \
+ if (d2i_ASN1_STRING_SET(&(r),&c.p,c.slen,a,b) == NULL) \
+ { c.line=__LINE__; goto err; } \
+ c.slen-=(c.p-c.q);
+
+# define M_ASN1_D2I_get_EXP_opt(r,func,tag) \
+ if ((c.slen != 0L) && (M_ASN1_next == \
+ (V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \
+ { \
+ int Tinf,Ttag,Tclass; \
+ long Tlen; \
+ \
+ c.q=c.p; \
+ Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \
+ if (Tinf & 0x80) \
+ { c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \
+ c.line=__LINE__; goto err; } \
+ if (Tinf == (V_ASN1_CONSTRUCTED+1)) \
+ Tlen = c.slen - (c.p - c.q) - 2; \
+ if (func(&(r),&c.p,Tlen) == NULL) \
+ { c.line=__LINE__; goto err; } \
+ if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \
+ Tlen = c.slen - (c.p - c.q); \
+ if(!ASN1_const_check_infinite_end(&c.p, Tlen)) \
+ { c.error=ERR_R_MISSING_ASN1_EOS; \
+ c.line=__LINE__; goto err; } \
+ }\
+ c.slen-=(c.p-c.q); \
+ }
+
+# define M_ASN1_D2I_get_EXP_set_opt(r,func,free_func,tag,b) \
+ if ((c.slen != 0) && (M_ASN1_next == \
+ (V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \
+ { \
+ int Tinf,Ttag,Tclass; \
+ long Tlen; \
+ \
+ c.q=c.p; \
+ Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \
+ if (Tinf & 0x80) \
+ { c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \
+ c.line=__LINE__; goto err; } \
+ if (Tinf == (V_ASN1_CONSTRUCTED+1)) \
+ Tlen = c.slen - (c.p - c.q) - 2; \
+ if (d2i_ASN1_SET(&(r),&c.p,Tlen,(char *(*)())func, \
+ (void (*)())free_func, \
+ b,V_ASN1_UNIVERSAL) == NULL) \
+ { c.line=__LINE__; goto err; } \
+ if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \
+ Tlen = c.slen - (c.p - c.q); \
+ if(!ASN1_check_infinite_end(&c.p, Tlen)) \
+ { c.error=ERR_R_MISSING_ASN1_EOS; \
+ c.line=__LINE__; goto err; } \
+ }\
+ c.slen-=(c.p-c.q); \
+ }
+
+# define M_ASN1_D2I_get_EXP_set_opt_type(type,r,func,free_func,tag,b) \
+ if ((c.slen != 0) && (M_ASN1_next == \
+ (V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \
+ { \
+ int Tinf,Ttag,Tclass; \
+ long Tlen; \
+ \
+ c.q=c.p; \
+ Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \
+ if (Tinf & 0x80) \
+ { c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \
+ c.line=__LINE__; goto err; } \
+ if (Tinf == (V_ASN1_CONSTRUCTED+1)) \
+ Tlen = c.slen - (c.p - c.q) - 2; \
+ if (d2i_ASN1_SET_OF_##type(&(r),&c.p,Tlen,func, \
+ free_func,b,V_ASN1_UNIVERSAL) == NULL) \
+ { c.line=__LINE__; goto err; } \
+ if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \
+ Tlen = c.slen - (c.p - c.q); \
+ if(!ASN1_check_infinite_end(&c.p, Tlen)) \
+ { c.error=ERR_R_MISSING_ASN1_EOS; \
+ c.line=__LINE__; goto err; } \
+ }\
+ c.slen-=(c.p-c.q); \
+ }
+
+/* New macros */
+# define M_ASN1_New_Malloc(ret,type) \
+ if ((ret=(type *)OPENSSL_malloc(sizeof(type))) == NULL) \
+ { c.line=__LINE__; goto err2; }
+
+# define M_ASN1_New(arg,func) \
+ if (((arg)=func()) == NULL) return(NULL)
+
+# define M_ASN1_New_Error(a) \
+/*- err: ASN1_MAC_H_err((a),ERR_R_NESTED_ASN1_ERROR,c.line); \
+ return(NULL);*/ \
+ err2: ASN1_MAC_H_err((a),ERR_R_MALLOC_FAILURE,c.line); \
+ return(NULL)
+
+/*
+ * BIG UGLY WARNING! This is so damn ugly I wanna puke. Unfortunately, some
+ * macros that use ASN1_const_CTX still insist on writing in the input
+ * stream. ARGH! ARGH! ARGH! Let's get rid of this macro package. Please? --
+ * Richard Levitte
+ */
+# define M_ASN1_next (*((unsigned char *)(c.p)))
+# define M_ASN1_next_prev (*((unsigned char *)(c.q)))
+
+/*************************************************/
+
+# define M_ASN1_I2D_vars(a) int r=0,ret=0; \
+ unsigned char *p; \
+ if (a == NULL) return(0)
+
+/* Length Macros */
+# define M_ASN1_I2D_len(a,f) ret+=f(a,NULL)
+# define M_ASN1_I2D_len_IMP_opt(a,f) if (a != NULL) M_ASN1_I2D_len(a,f)
+
+# define M_ASN1_I2D_len_SET(a,f) \
+ ret+=i2d_ASN1_SET(a,NULL,f,V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET);
+
+# define M_ASN1_I2D_len_SET_type(type,a,f) \
+ ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,V_ASN1_SET, \
+ V_ASN1_UNIVERSAL,IS_SET);
+
+# define M_ASN1_I2D_len_SEQUENCE(a,f) \
+ ret+=i2d_ASN1_SET(a,NULL,f,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \
+ IS_SEQUENCE);
+
+# define M_ASN1_I2D_len_SEQUENCE_type(type,a,f) \
+ ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,V_ASN1_SEQUENCE, \
+ V_ASN1_UNIVERSAL,IS_SEQUENCE)
+
+# define M_ASN1_I2D_len_SEQUENCE_opt(a,f) \
+ if ((a != NULL) && (sk_num(a) != 0)) \
+ M_ASN1_I2D_len_SEQUENCE(a,f);
+
+# define M_ASN1_I2D_len_SEQUENCE_opt_type(type,a,f) \
+ if ((a != NULL) && (sk_##type##_num(a) != 0)) \
+ M_ASN1_I2D_len_SEQUENCE_type(type,a,f);
+
+# define M_ASN1_I2D_len_IMP_SET(a,f,x) \
+ ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET);
+
+# define M_ASN1_I2D_len_IMP_SET_type(type,a,f,x) \
+ ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \
+ V_ASN1_CONTEXT_SPECIFIC,IS_SET);
+
+# define M_ASN1_I2D_len_IMP_SET_opt(a,f,x) \
+ if ((a != NULL) && (sk_num(a) != 0)) \
+ ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \
+ IS_SET);
+
+# define M_ASN1_I2D_len_IMP_SET_opt_type(type,a,f,x) \
+ if ((a != NULL) && (sk_##type##_num(a) != 0)) \
+ ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \
+ V_ASN1_CONTEXT_SPECIFIC,IS_SET);
+
+# define M_ASN1_I2D_len_IMP_SEQUENCE(a,f,x) \
+ ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \
+ IS_SEQUENCE);
+
+# define M_ASN1_I2D_len_IMP_SEQUENCE_opt(a,f,x) \
+ if ((a != NULL) && (sk_num(a) != 0)) \
+ ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \
+ IS_SEQUENCE);
+
+# define M_ASN1_I2D_len_IMP_SEQUENCE_opt_type(type,a,f,x) \
+ if ((a != NULL) && (sk_##type##_num(a) != 0)) \
+ ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \
+ V_ASN1_CONTEXT_SPECIFIC, \
+ IS_SEQUENCE);
+
+# define M_ASN1_I2D_len_EXP_opt(a,f,mtag,v) \
+ if (a != NULL)\
+ { \
+ v=f(a,NULL); \
+ ret+=ASN1_object_size(1,v,mtag); \
+ }
+
+# define M_ASN1_I2D_len_EXP_SET_opt(a,f,mtag,tag,v) \
+ if ((a != NULL) && (sk_num(a) != 0))\
+ { \
+ v=i2d_ASN1_SET(a,NULL,f,tag,V_ASN1_UNIVERSAL,IS_SET); \
+ ret+=ASN1_object_size(1,v,mtag); \
+ }
+
+# define M_ASN1_I2D_len_EXP_SEQUENCE_opt(a,f,mtag,tag,v) \
+ if ((a != NULL) && (sk_num(a) != 0))\
+ { \
+ v=i2d_ASN1_SET(a,NULL,f,tag,V_ASN1_UNIVERSAL, \
+ IS_SEQUENCE); \
+ ret+=ASN1_object_size(1,v,mtag); \
+ }
+
+# define M_ASN1_I2D_len_EXP_SEQUENCE_opt_type(type,a,f,mtag,tag,v) \
+ if ((a != NULL) && (sk_##type##_num(a) != 0))\
+ { \
+ v=i2d_ASN1_SET_OF_##type(a,NULL,f,tag, \
+ V_ASN1_UNIVERSAL, \
+ IS_SEQUENCE); \
+ ret+=ASN1_object_size(1,v,mtag); \
+ }
+
+/* Put Macros */
+# define M_ASN1_I2D_put(a,f) f(a,&p)
+
+# define M_ASN1_I2D_put_IMP_opt(a,f,t) \
+ if (a != NULL) \
+ { \
+ unsigned char *q=p; \
+ f(a,&p); \
+ *q=(V_ASN1_CONTEXT_SPECIFIC|t|(*q&V_ASN1_CONSTRUCTED));\
+ }
+
+# define M_ASN1_I2D_put_SET(a,f) i2d_ASN1_SET(a,&p,f,V_ASN1_SET,\
+ V_ASN1_UNIVERSAL,IS_SET)
+# define M_ASN1_I2D_put_SET_type(type,a,f) \
+ i2d_ASN1_SET_OF_##type(a,&p,f,V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET)
+# define M_ASN1_I2D_put_IMP_SET(a,f,x) i2d_ASN1_SET(a,&p,f,x,\
+ V_ASN1_CONTEXT_SPECIFIC,IS_SET)
+# define M_ASN1_I2D_put_IMP_SET_type(type,a,f,x) \
+ i2d_ASN1_SET_OF_##type(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET)
+# define M_ASN1_I2D_put_IMP_SEQUENCE(a,f,x) i2d_ASN1_SET(a,&p,f,x,\
+ V_ASN1_CONTEXT_SPECIFIC,IS_SEQUENCE)
+
+# define M_ASN1_I2D_put_SEQUENCE(a,f) i2d_ASN1_SET(a,&p,f,V_ASN1_SEQUENCE,\
+ V_ASN1_UNIVERSAL,IS_SEQUENCE)
+
+# define M_ASN1_I2D_put_SEQUENCE_type(type,a,f) \
+ i2d_ASN1_SET_OF_##type(a,&p,f,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \
+ IS_SEQUENCE)
+
+# define M_ASN1_I2D_put_SEQUENCE_opt(a,f) \
+ if ((a != NULL) && (sk_num(a) != 0)) \
+ M_ASN1_I2D_put_SEQUENCE(a,f);
+
+# define M_ASN1_I2D_put_IMP_SET_opt(a,f,x) \
+ if ((a != NULL) && (sk_num(a) != 0)) \
+ { i2d_ASN1_SET(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC, \
+ IS_SET); }
+
+# define M_ASN1_I2D_put_IMP_SET_opt_type(type,a,f,x) \
+ if ((a != NULL) && (sk_##type##_num(a) != 0)) \
+ { i2d_ASN1_SET_OF_##type(a,&p,f,x, \
+ V_ASN1_CONTEXT_SPECIFIC, \
+ IS_SET); }
+
+# define M_ASN1_I2D_put_IMP_SEQUENCE_opt(a,f,x) \
+ if ((a != NULL) && (sk_num(a) != 0)) \
+ { i2d_ASN1_SET(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC, \
+ IS_SEQUENCE); }
+
+# define M_ASN1_I2D_put_IMP_SEQUENCE_opt_type(type,a,f,x) \
+ if ((a != NULL) && (sk_##type##_num(a) != 0)) \
+ { i2d_ASN1_SET_OF_##type(a,&p,f,x, \
+ V_ASN1_CONTEXT_SPECIFIC, \
+ IS_SEQUENCE); }
+
+# define M_ASN1_I2D_put_EXP_opt(a,f,tag,v) \
+ if (a != NULL) \
+ { \
+ ASN1_put_object(&p,1,v,tag,V_ASN1_CONTEXT_SPECIFIC); \
+ f(a,&p); \
+ }
+
+# define M_ASN1_I2D_put_EXP_SET_opt(a,f,mtag,tag,v) \
+ if ((a != NULL) && (sk_num(a) != 0)) \
+ { \
+ ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \
+ i2d_ASN1_SET(a,&p,f,tag,V_ASN1_UNIVERSAL,IS_SET); \
+ }
+
+# define M_ASN1_I2D_put_EXP_SEQUENCE_opt(a,f,mtag,tag,v) \
+ if ((a != NULL) && (sk_num(a) != 0)) \
+ { \
+ ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \
+ i2d_ASN1_SET(a,&p,f,tag,V_ASN1_UNIVERSAL,IS_SEQUENCE); \
+ }
+
+# define M_ASN1_I2D_put_EXP_SEQUENCE_opt_type(type,a,f,mtag,tag,v) \
+ if ((a != NULL) && (sk_##type##_num(a) != 0)) \
+ { \
+ ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \
+ i2d_ASN1_SET_OF_##type(a,&p,f,tag,V_ASN1_UNIVERSAL, \
+ IS_SEQUENCE); \
+ }
+
+# define M_ASN1_I2D_seq_total() \
+ r=ASN1_object_size(1,ret,V_ASN1_SEQUENCE); \
+ if (pp == NULL) return(r); \
+ p= *pp; \
+ ASN1_put_object(&p,1,ret,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL)
+
+# define M_ASN1_I2D_INF_seq_start(tag,ctx) \
+ *(p++)=(V_ASN1_CONSTRUCTED|(tag)|(ctx)); \
+ *(p++)=0x80
+
+# define M_ASN1_I2D_INF_seq_end() *(p++)=0x00; *(p++)=0x00
+
+# define M_ASN1_I2D_finish() *pp=p; \
+ return(r);
+
+int asn1_GetSequence(ASN1_const_CTX *c, long *length);
+void asn1_add_error(const unsigned char *address, int offset);
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/asn1t.h b/protocols/Telegram/tgl/openssl/include/openssl/asn1t.h
new file mode 100644
index 0000000000..99bc0eecf3
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/asn1t.h
@@ -0,0 +1,973 @@
+/* asn1t.h */
+/*
+ * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
+ * 2000.
+ */
+/* ====================================================================
+ * Copyright (c) 2000-2005 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+#ifndef HEADER_ASN1T_H
+# define HEADER_ASN1T_H
+
+# include <stddef.h>
+# include <openssl/e_os2.h>
+# include <openssl/asn1.h>
+
+# ifdef OPENSSL_BUILD_SHLIBCRYPTO
+# undef OPENSSL_EXTERN
+# define OPENSSL_EXTERN OPENSSL_EXPORT
+# endif
+
+/* ASN1 template defines, structures and functions */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
+
+/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */
+# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)(iptr))
+
+/* Macros for start and end of ASN1_ITEM definition */
+
+# define ASN1_ITEM_start(itname) \
+ OPENSSL_GLOBAL const ASN1_ITEM itname##_it = {
+
+# define ASN1_ITEM_end(itname) \
+ };
+
+# else
+
+/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */
+# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)(iptr()))
+
+/* Macros for start and end of ASN1_ITEM definition */
+
+# define ASN1_ITEM_start(itname) \
+ const ASN1_ITEM * itname##_it(void) \
+ { \
+ static const ASN1_ITEM local_it = {
+
+# define ASN1_ITEM_end(itname) \
+ }; \
+ return &local_it; \
+ }
+
+# endif
+
+/* Macros to aid ASN1 template writing */
+
+# define ASN1_ITEM_TEMPLATE(tname) \
+ static const ASN1_TEMPLATE tname##_item_tt
+
+# define ASN1_ITEM_TEMPLATE_END(tname) \
+ ;\
+ ASN1_ITEM_start(tname) \
+ ASN1_ITYPE_PRIMITIVE,\
+ -1,\
+ &tname##_item_tt,\
+ 0,\
+ NULL,\
+ 0,\
+ #tname \
+ ASN1_ITEM_end(tname)
+
+/* This is a ASN1 type which just embeds a template */
+
+/*-
+ * This pair helps declare a SEQUENCE. We can do:
+ *
+ * ASN1_SEQUENCE(stname) = {
+ * ... SEQUENCE components ...
+ * } ASN1_SEQUENCE_END(stname)
+ *
+ * This will produce an ASN1_ITEM called stname_it
+ * for a structure called stname.
+ *
+ * If you want the same structure but a different
+ * name then use:
+ *
+ * ASN1_SEQUENCE(itname) = {
+ * ... SEQUENCE components ...
+ * } ASN1_SEQUENCE_END_name(stname, itname)
+ *
+ * This will create an item called itname_it using
+ * a structure called stname.
+ */
+
+# define ASN1_SEQUENCE(tname) \
+ static const ASN1_TEMPLATE tname##_seq_tt[]
+
+# define ASN1_SEQUENCE_END(stname) ASN1_SEQUENCE_END_name(stname, stname)
+
+# define ASN1_SEQUENCE_END_name(stname, tname) \
+ ;\
+ ASN1_ITEM_start(tname) \
+ ASN1_ITYPE_SEQUENCE,\
+ V_ASN1_SEQUENCE,\
+ tname##_seq_tt,\
+ sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
+ NULL,\
+ sizeof(stname),\
+ #stname \
+ ASN1_ITEM_end(tname)
+
+# define ASN1_NDEF_SEQUENCE(tname) \
+ ASN1_SEQUENCE(tname)
+
+# define ASN1_NDEF_SEQUENCE_cb(tname, cb) \
+ ASN1_SEQUENCE_cb(tname, cb)
+
+# define ASN1_SEQUENCE_cb(tname, cb) \
+ static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \
+ ASN1_SEQUENCE(tname)
+
+# define ASN1_BROKEN_SEQUENCE(tname) \
+ static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_BROKEN, 0, 0, 0, 0}; \
+ ASN1_SEQUENCE(tname)
+
+# define ASN1_SEQUENCE_ref(tname, cb, lck) \
+ static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_REFCOUNT, offsetof(tname, references), lck, cb, 0}; \
+ ASN1_SEQUENCE(tname)
+
+# define ASN1_SEQUENCE_enc(tname, enc, cb) \
+ static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_ENCODING, 0, 0, cb, offsetof(tname, enc)}; \
+ ASN1_SEQUENCE(tname)
+
+# define ASN1_NDEF_SEQUENCE_END(tname) \
+ ;\
+ ASN1_ITEM_start(tname) \
+ ASN1_ITYPE_NDEF_SEQUENCE,\
+ V_ASN1_SEQUENCE,\
+ tname##_seq_tt,\
+ sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
+ NULL,\
+ sizeof(tname),\
+ #tname \
+ ASN1_ITEM_end(tname)
+
+# define ASN1_BROKEN_SEQUENCE_END(stname) ASN1_SEQUENCE_END_ref(stname, stname)
+
+# define ASN1_SEQUENCE_END_enc(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname)
+
+# define ASN1_SEQUENCE_END_cb(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname)
+
+# define ASN1_SEQUENCE_END_ref(stname, tname) \
+ ;\
+ ASN1_ITEM_start(tname) \
+ ASN1_ITYPE_SEQUENCE,\
+ V_ASN1_SEQUENCE,\
+ tname##_seq_tt,\
+ sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
+ &tname##_aux,\
+ sizeof(stname),\
+ #stname \
+ ASN1_ITEM_end(tname)
+
+# define ASN1_NDEF_SEQUENCE_END_cb(stname, tname) \
+ ;\
+ ASN1_ITEM_start(tname) \
+ ASN1_ITYPE_NDEF_SEQUENCE,\
+ V_ASN1_SEQUENCE,\
+ tname##_seq_tt,\
+ sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
+ &tname##_aux,\
+ sizeof(stname),\
+ #stname \
+ ASN1_ITEM_end(tname)
+
+/*-
+ * This pair helps declare a CHOICE type. We can do:
+ *
+ * ASN1_CHOICE(chname) = {
+ * ... CHOICE options ...
+ * ASN1_CHOICE_END(chname)
+ *
+ * This will produce an ASN1_ITEM called chname_it
+ * for a structure called chname. The structure
+ * definition must look like this:
+ * typedef struct {
+ * int type;
+ * union {
+ * ASN1_SOMETHING *opt1;
+ * ASN1_SOMEOTHER *opt2;
+ * } value;
+ * } chname;
+ *
+ * the name of the selector must be 'type'.
+ * to use an alternative selector name use the
+ * ASN1_CHOICE_END_selector() version.
+ */
+
+# define ASN1_CHOICE(tname) \
+ static const ASN1_TEMPLATE tname##_ch_tt[]
+
+# define ASN1_CHOICE_cb(tname, cb) \
+ static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \
+ ASN1_CHOICE(tname)
+
+# define ASN1_CHOICE_END(stname) ASN1_CHOICE_END_name(stname, stname)
+
+# define ASN1_CHOICE_END_name(stname, tname) ASN1_CHOICE_END_selector(stname, tname, type)
+
+# define ASN1_CHOICE_END_selector(stname, tname, selname) \
+ ;\
+ ASN1_ITEM_start(tname) \
+ ASN1_ITYPE_CHOICE,\
+ offsetof(stname,selname) ,\
+ tname##_ch_tt,\
+ sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
+ NULL,\
+ sizeof(stname),\
+ #stname \
+ ASN1_ITEM_end(tname)
+
+# define ASN1_CHOICE_END_cb(stname, tname, selname) \
+ ;\
+ ASN1_ITEM_start(tname) \
+ ASN1_ITYPE_CHOICE,\
+ offsetof(stname,selname) ,\
+ tname##_ch_tt,\
+ sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
+ &tname##_aux,\
+ sizeof(stname),\
+ #stname \
+ ASN1_ITEM_end(tname)
+
+/* This helps with the template wrapper form of ASN1_ITEM */
+
+# define ASN1_EX_TEMPLATE_TYPE(flags, tag, name, type) { \
+ (flags), (tag), 0,\
+ #name, ASN1_ITEM_ref(type) }
+
+/* These help with SEQUENCE or CHOICE components */
+
+/* used to declare other types */
+
+# define ASN1_EX_TYPE(flags, tag, stname, field, type) { \
+ (flags), (tag), offsetof(stname, field),\
+ #field, ASN1_ITEM_ref(type) }
+
+/* used when the structure is combined with the parent */
+
+# define ASN1_EX_COMBINE(flags, tag, type) { \
+ (flags)|ASN1_TFLG_COMBINE, (tag), 0, NULL, ASN1_ITEM_ref(type) }
+
+/* implicit and explicit helper macros */
+
+# define ASN1_IMP_EX(stname, field, type, tag, ex) \
+ ASN1_EX_TYPE(ASN1_TFLG_IMPLICIT | ex, tag, stname, field, type)
+
+# define ASN1_EXP_EX(stname, field, type, tag, ex) \
+ ASN1_EX_TYPE(ASN1_TFLG_EXPLICIT | ex, tag, stname, field, type)
+
+/* Any defined by macros: the field used is in the table itself */
+
+# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
+# define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) }
+# define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) }
+# else
+# define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, tblname##_adb }
+# define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, tblname##_adb }
+# endif
+/* Plain simple type */
+# define ASN1_SIMPLE(stname, field, type) ASN1_EX_TYPE(0,0, stname, field, type)
+
+/* OPTIONAL simple type */
+# define ASN1_OPT(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL, 0, stname, field, type)
+
+/* IMPLICIT tagged simple type */
+# define ASN1_IMP(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, 0)
+
+/* IMPLICIT tagged OPTIONAL simple type */
+# define ASN1_IMP_OPT(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL)
+
+/* Same as above but EXPLICIT */
+
+# define ASN1_EXP(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, 0)
+# define ASN1_EXP_OPT(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL)
+
+/* SEQUENCE OF type */
+# define ASN1_SEQUENCE_OF(stname, field, type) \
+ ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, stname, field, type)
+
+/* OPTIONAL SEQUENCE OF */
+# define ASN1_SEQUENCE_OF_OPT(stname, field, type) \
+ ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type)
+
+/* Same as above but for SET OF */
+
+# define ASN1_SET_OF(stname, field, type) \
+ ASN1_EX_TYPE(ASN1_TFLG_SET_OF, 0, stname, field, type)
+
+# define ASN1_SET_OF_OPT(stname, field, type) \
+ ASN1_EX_TYPE(ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type)
+
+/* Finally compound types of SEQUENCE, SET, IMPLICIT, EXPLICIT and OPTIONAL */
+
+# define ASN1_IMP_SET_OF(stname, field, type, tag) \
+ ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF)
+
+# define ASN1_EXP_SET_OF(stname, field, type, tag) \
+ ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF)
+
+# define ASN1_IMP_SET_OF_OPT(stname, field, type, tag) \
+ ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL)
+
+# define ASN1_EXP_SET_OF_OPT(stname, field, type, tag) \
+ ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL)
+
+# define ASN1_IMP_SEQUENCE_OF(stname, field, type, tag) \
+ ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF)
+
+# define ASN1_IMP_SEQUENCE_OF_OPT(stname, field, type, tag) \
+ ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL)
+
+# define ASN1_EXP_SEQUENCE_OF(stname, field, type, tag) \
+ ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF)
+
+# define ASN1_EXP_SEQUENCE_OF_OPT(stname, field, type, tag) \
+ ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL)
+
+/* EXPLICIT using indefinite length constructed form */
+# define ASN1_NDEF_EXP(stname, field, type, tag) \
+ ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_NDEF)
+
+/* EXPLICIT OPTIONAL using indefinite length constructed form */
+# define ASN1_NDEF_EXP_OPT(stname, field, type, tag) \
+ ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_NDEF)
+
+/* Macros for the ASN1_ADB structure */
+
+# define ASN1_ADB(name) \
+ static const ASN1_ADB_TABLE name##_adbtbl[]
+
+# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
+
+# define ASN1_ADB_END(name, flags, field, app_table, def, none) \
+ ;\
+ static const ASN1_ADB name##_adb = {\
+ flags,\
+ offsetof(name, field),\
+ app_table,\
+ name##_adbtbl,\
+ sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
+ def,\
+ none\
+ }
+
+# else
+
+# define ASN1_ADB_END(name, flags, field, app_table, def, none) \
+ ;\
+ static const ASN1_ITEM *name##_adb(void) \
+ { \
+ static const ASN1_ADB internal_adb = \
+ {\
+ flags,\
+ offsetof(name, field),\
+ app_table,\
+ name##_adbtbl,\
+ sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
+ def,\
+ none\
+ }; \
+ return (const ASN1_ITEM *) &internal_adb; \
+ } \
+ void dummy_function(void)
+
+# endif
+
+# define ADB_ENTRY(val, template) {val, template}
+
+# define ASN1_ADB_TEMPLATE(name) \
+ static const ASN1_TEMPLATE name##_tt
+
+/*
+ * This is the ASN1 template structure that defines a wrapper round the
+ * actual type. It determines the actual position of the field in the value
+ * structure, various flags such as OPTIONAL and the field name.
+ */
+
+struct ASN1_TEMPLATE_st {
+ unsigned long flags; /* Various flags */
+ long tag; /* tag, not used if no tagging */
+ unsigned long offset; /* Offset of this field in structure */
+# ifndef NO_ASN1_FIELD_NAMES
+ const char *field_name; /* Field name */
+# endif
+ ASN1_ITEM_EXP *item; /* Relevant ASN1_ITEM or ASN1_ADB */
+};
+
+/* Macro to extract ASN1_ITEM and ASN1_ADB pointer from ASN1_TEMPLATE */
+
+# define ASN1_TEMPLATE_item(t) (t->item_ptr)
+# define ASN1_TEMPLATE_adb(t) (t->item_ptr)
+
+typedef struct ASN1_ADB_TABLE_st ASN1_ADB_TABLE;
+typedef struct ASN1_ADB_st ASN1_ADB;
+
+struct ASN1_ADB_st {
+ unsigned long flags; /* Various flags */
+ unsigned long offset; /* Offset of selector field */
+ STACK_OF(ASN1_ADB_TABLE) **app_items; /* Application defined items */
+ const ASN1_ADB_TABLE *tbl; /* Table of possible types */
+ long tblcount; /* Number of entries in tbl */
+ const ASN1_TEMPLATE *default_tt; /* Type to use if no match */
+ const ASN1_TEMPLATE *null_tt; /* Type to use if selector is NULL */
+};
+
+struct ASN1_ADB_TABLE_st {
+ long value; /* NID for an object or value for an int */
+ const ASN1_TEMPLATE tt; /* item for this value */
+};
+
+/* template flags */
+
+/* Field is optional */
+# define ASN1_TFLG_OPTIONAL (0x1)
+
+/* Field is a SET OF */
+# define ASN1_TFLG_SET_OF (0x1 << 1)
+
+/* Field is a SEQUENCE OF */
+# define ASN1_TFLG_SEQUENCE_OF (0x2 << 1)
+
+/*
+ * Special case: this refers to a SET OF that will be sorted into DER order
+ * when encoded *and* the corresponding STACK will be modified to match the
+ * new order.
+ */
+# define ASN1_TFLG_SET_ORDER (0x3 << 1)
+
+/* Mask for SET OF or SEQUENCE OF */
+# define ASN1_TFLG_SK_MASK (0x3 << 1)
+
+/*
+ * These flags mean the tag should be taken from the tag field. If EXPLICIT
+ * then the underlying type is used for the inner tag.
+ */
+
+/* IMPLICIT tagging */
+# define ASN1_TFLG_IMPTAG (0x1 << 3)
+
+/* EXPLICIT tagging, inner tag from underlying type */
+# define ASN1_TFLG_EXPTAG (0x2 << 3)
+
+# define ASN1_TFLG_TAG_MASK (0x3 << 3)
+
+/* context specific IMPLICIT */
+# define ASN1_TFLG_IMPLICIT ASN1_TFLG_IMPTAG|ASN1_TFLG_CONTEXT
+
+/* context specific EXPLICIT */
+# define ASN1_TFLG_EXPLICIT ASN1_TFLG_EXPTAG|ASN1_TFLG_CONTEXT
+
+/*
+ * If tagging is in force these determine the type of tag to use. Otherwise
+ * the tag is determined by the underlying type. These values reflect the
+ * actual octet format.
+ */
+
+/* Universal tag */
+# define ASN1_TFLG_UNIVERSAL (0x0<<6)
+/* Application tag */
+# define ASN1_TFLG_APPLICATION (0x1<<6)
+/* Context specific tag */
+# define ASN1_TFLG_CONTEXT (0x2<<6)
+/* Private tag */
+# define ASN1_TFLG_PRIVATE (0x3<<6)
+
+# define ASN1_TFLG_TAG_CLASS (0x3<<6)
+
+/*
+ * These are for ANY DEFINED BY type. In this case the 'item' field points to
+ * an ASN1_ADB structure which contains a table of values to decode the
+ * relevant type
+ */
+
+# define ASN1_TFLG_ADB_MASK (0x3<<8)
+
+# define ASN1_TFLG_ADB_OID (0x1<<8)
+
+# define ASN1_TFLG_ADB_INT (0x1<<9)
+
+/*
+ * This flag means a parent structure is passed instead of the field: this is
+ * useful is a SEQUENCE is being combined with a CHOICE for example. Since
+ * this means the structure and item name will differ we need to use the
+ * ASN1_CHOICE_END_name() macro for example.
+ */
+
+# define ASN1_TFLG_COMBINE (0x1<<10)
+
+/*
+ * This flag when present in a SEQUENCE OF, SET OF or EXPLICIT causes
+ * indefinite length constructed encoding to be used if required.
+ */
+
+# define ASN1_TFLG_NDEF (0x1<<11)
+
+/* This is the actual ASN1 item itself */
+
+struct ASN1_ITEM_st {
+ char itype; /* The item type, primitive, SEQUENCE, CHOICE
+ * or extern */
+ long utype; /* underlying type */
+ const ASN1_TEMPLATE *templates; /* If SEQUENCE or CHOICE this contains
+ * the contents */
+ long tcount; /* Number of templates if SEQUENCE or CHOICE */
+ const void *funcs; /* functions that handle this type */
+ long size; /* Structure size (usually) */
+# ifndef NO_ASN1_FIELD_NAMES
+ const char *sname; /* Structure name */
+# endif
+};
+
+/*-
+ * These are values for the itype field and
+ * determine how the type is interpreted.
+ *
+ * For PRIMITIVE types the underlying type
+ * determines the behaviour if items is NULL.
+ *
+ * Otherwise templates must contain a single
+ * template and the type is treated in the
+ * same way as the type specified in the template.
+ *
+ * For SEQUENCE types the templates field points
+ * to the members, the size field is the
+ * structure size.
+ *
+ * For CHOICE types the templates field points
+ * to each possible member (typically a union)
+ * and the 'size' field is the offset of the
+ * selector.
+ *
+ * The 'funcs' field is used for application
+ * specific functions.
+ *
+ * For COMPAT types the funcs field gives a
+ * set of functions that handle this type, this
+ * supports the old d2i, i2d convention.
+ *
+ * The EXTERN type uses a new style d2i/i2d.
+ * The new style should be used where possible
+ * because it avoids things like the d2i IMPLICIT
+ * hack.
+ *
+ * MSTRING is a multiple string type, it is used
+ * for a CHOICE of character strings where the
+ * actual strings all occupy an ASN1_STRING
+ * structure. In this case the 'utype' field
+ * has a special meaning, it is used as a mask
+ * of acceptable types using the B_ASN1 constants.
+ *
+ * NDEF_SEQUENCE is the same as SEQUENCE except
+ * that it will use indefinite length constructed
+ * encoding if requested.
+ *
+ */
+
+# define ASN1_ITYPE_PRIMITIVE 0x0
+
+# define ASN1_ITYPE_SEQUENCE 0x1
+
+# define ASN1_ITYPE_CHOICE 0x2
+
+# define ASN1_ITYPE_COMPAT 0x3
+
+# define ASN1_ITYPE_EXTERN 0x4
+
+# define ASN1_ITYPE_MSTRING 0x5
+
+# define ASN1_ITYPE_NDEF_SEQUENCE 0x6
+
+/*
+ * Cache for ASN1 tag and length, so we don't keep re-reading it for things
+ * like CHOICE
+ */
+
+struct ASN1_TLC_st {
+ char valid; /* Values below are valid */
+ int ret; /* return value */
+ long plen; /* length */
+ int ptag; /* class value */
+ int pclass; /* class value */
+ int hdrlen; /* header length */
+};
+
+/* Typedefs for ASN1 function pointers */
+
+typedef ASN1_VALUE *ASN1_new_func(void);
+typedef void ASN1_free_func(ASN1_VALUE *a);
+typedef ASN1_VALUE *ASN1_d2i_func(ASN1_VALUE **a, const unsigned char **in,
+ long length);
+typedef int ASN1_i2d_func(ASN1_VALUE *a, unsigned char **in);
+
+typedef int ASN1_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
+ const ASN1_ITEM *it, int tag, int aclass, char opt,
+ ASN1_TLC *ctx);
+
+typedef int ASN1_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
+ const ASN1_ITEM *it, int tag, int aclass);
+typedef int ASN1_ex_new_func(ASN1_VALUE **pval, const ASN1_ITEM *it);
+typedef void ASN1_ex_free_func(ASN1_VALUE **pval, const ASN1_ITEM *it);
+
+typedef int ASN1_ex_print_func(BIO *out, ASN1_VALUE **pval,
+ int indent, const char *fname,
+ const ASN1_PCTX *pctx);
+
+typedef int ASN1_primitive_i2c(ASN1_VALUE **pval, unsigned char *cont,
+ int *putype, const ASN1_ITEM *it);
+typedef int ASN1_primitive_c2i(ASN1_VALUE **pval, const unsigned char *cont,
+ int len, int utype, char *free_cont,
+ const ASN1_ITEM *it);
+typedef int ASN1_primitive_print(BIO *out, ASN1_VALUE **pval,
+ const ASN1_ITEM *it, int indent,
+ const ASN1_PCTX *pctx);
+
+typedef struct ASN1_COMPAT_FUNCS_st {
+ ASN1_new_func *asn1_new;
+ ASN1_free_func *asn1_free;
+ ASN1_d2i_func *asn1_d2i;
+ ASN1_i2d_func *asn1_i2d;
+} ASN1_COMPAT_FUNCS;
+
+typedef struct ASN1_EXTERN_FUNCS_st {
+ void *app_data;
+ ASN1_ex_new_func *asn1_ex_new;
+ ASN1_ex_free_func *asn1_ex_free;
+ ASN1_ex_free_func *asn1_ex_clear;
+ ASN1_ex_d2i *asn1_ex_d2i;
+ ASN1_ex_i2d *asn1_ex_i2d;
+ ASN1_ex_print_func *asn1_ex_print;
+} ASN1_EXTERN_FUNCS;
+
+typedef struct ASN1_PRIMITIVE_FUNCS_st {
+ void *app_data;
+ unsigned long flags;
+ ASN1_ex_new_func *prim_new;
+ ASN1_ex_free_func *prim_free;
+ ASN1_ex_free_func *prim_clear;
+ ASN1_primitive_c2i *prim_c2i;
+ ASN1_primitive_i2c *prim_i2c;
+ ASN1_primitive_print *prim_print;
+} ASN1_PRIMITIVE_FUNCS;
+
+/*
+ * This is the ASN1_AUX structure: it handles various miscellaneous
+ * requirements. For example the use of reference counts and an informational
+ * callback. The "informational callback" is called at various points during
+ * the ASN1 encoding and decoding. It can be used to provide minor
+ * customisation of the structures used. This is most useful where the
+ * supplied routines *almost* do the right thing but need some extra help at
+ * a few points. If the callback returns zero then it is assumed a fatal
+ * error has occurred and the main operation should be abandoned. If major
+ * changes in the default behaviour are required then an external type is
+ * more appropriate.
+ */
+
+typedef int ASN1_aux_cb(int operation, ASN1_VALUE **in, const ASN1_ITEM *it,
+ void *exarg);
+
+typedef struct ASN1_AUX_st {
+ void *app_data;
+ int flags;
+ int ref_offset; /* Offset of reference value */
+ int ref_lock; /* Lock type to use */
+ ASN1_aux_cb *asn1_cb;
+ int enc_offset; /* Offset of ASN1_ENCODING structure */
+} ASN1_AUX;
+
+/* For print related callbacks exarg points to this structure */
+typedef struct ASN1_PRINT_ARG_st {
+ BIO *out;
+ int indent;
+ const ASN1_PCTX *pctx;
+} ASN1_PRINT_ARG;
+
+/* For streaming related callbacks exarg points to this structure */
+typedef struct ASN1_STREAM_ARG_st {
+ /* BIO to stream through */
+ BIO *out;
+ /* BIO with filters appended */
+ BIO *ndef_bio;
+ /* Streaming I/O boundary */
+ unsigned char **boundary;
+} ASN1_STREAM_ARG;
+
+/* Flags in ASN1_AUX */
+
+/* Use a reference count */
+# define ASN1_AFLG_REFCOUNT 1
+/* Save the encoding of structure (useful for signatures) */
+# define ASN1_AFLG_ENCODING 2
+/* The Sequence length is invalid */
+# define ASN1_AFLG_BROKEN 4
+
+/* operation values for asn1_cb */
+
+# define ASN1_OP_NEW_PRE 0
+# define ASN1_OP_NEW_POST 1
+# define ASN1_OP_FREE_PRE 2
+# define ASN1_OP_FREE_POST 3
+# define ASN1_OP_D2I_PRE 4
+# define ASN1_OP_D2I_POST 5
+# define ASN1_OP_I2D_PRE 6
+# define ASN1_OP_I2D_POST 7
+# define ASN1_OP_PRINT_PRE 8
+# define ASN1_OP_PRINT_POST 9
+# define ASN1_OP_STREAM_PRE 10
+# define ASN1_OP_STREAM_POST 11
+# define ASN1_OP_DETACHED_PRE 12
+# define ASN1_OP_DETACHED_POST 13
+
+/* Macro to implement a primitive type */
+# define IMPLEMENT_ASN1_TYPE(stname) IMPLEMENT_ASN1_TYPE_ex(stname, stname, 0)
+# define IMPLEMENT_ASN1_TYPE_ex(itname, vname, ex) \
+ ASN1_ITEM_start(itname) \
+ ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
+ ASN1_ITEM_end(itname)
+
+/* Macro to implement a multi string type */
+# define IMPLEMENT_ASN1_MSTRING(itname, mask) \
+ ASN1_ITEM_start(itname) \
+ ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
+ ASN1_ITEM_end(itname)
+
+/* Macro to implement an ASN1_ITEM in terms of old style funcs */
+
+# define IMPLEMENT_COMPAT_ASN1(sname) IMPLEMENT_COMPAT_ASN1_type(sname, V_ASN1_SEQUENCE)
+
+# define IMPLEMENT_COMPAT_ASN1_type(sname, tag) \
+ static const ASN1_COMPAT_FUNCS sname##_ff = { \
+ (ASN1_new_func *)sname##_new, \
+ (ASN1_free_func *)sname##_free, \
+ (ASN1_d2i_func *)d2i_##sname, \
+ (ASN1_i2d_func *)i2d_##sname, \
+ }; \
+ ASN1_ITEM_start(sname) \
+ ASN1_ITYPE_COMPAT, \
+ tag, \
+ NULL, \
+ 0, \
+ &sname##_ff, \
+ 0, \
+ #sname \
+ ASN1_ITEM_end(sname)
+
+# define IMPLEMENT_EXTERN_ASN1(sname, tag, fptrs) \
+ ASN1_ITEM_start(sname) \
+ ASN1_ITYPE_EXTERN, \
+ tag, \
+ NULL, \
+ 0, \
+ &fptrs, \
+ 0, \
+ #sname \
+ ASN1_ITEM_end(sname)
+
+/* Macro to implement standard functions in terms of ASN1_ITEM structures */
+
+# define IMPLEMENT_ASN1_FUNCTIONS(stname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, stname, stname)
+
+# define IMPLEMENT_ASN1_FUNCTIONS_name(stname, itname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, itname)
+
+# define IMPLEMENT_ASN1_FUNCTIONS_ENCODE_name(stname, itname) \
+ IMPLEMENT_ASN1_FUNCTIONS_ENCODE_fname(stname, itname, itname)
+
+# define IMPLEMENT_STATIC_ASN1_ALLOC_FUNCTIONS(stname) \
+ IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(static, stname, stname, stname)
+
+# define IMPLEMENT_ASN1_ALLOC_FUNCTIONS(stname) \
+ IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, stname, stname)
+
+# define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(pre, stname, itname, fname) \
+ pre stname *fname##_new(void) \
+ { \
+ return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
+ } \
+ pre void fname##_free(stname *a) \
+ { \
+ ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
+ }
+
+# define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) \
+ stname *fname##_new(void) \
+ { \
+ return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
+ } \
+ void fname##_free(stname *a) \
+ { \
+ ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
+ }
+
+# define IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, fname) \
+ IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \
+ IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname)
+
+# define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \
+ stname *d2i_##fname(stname **a, const unsigned char **in, long len) \
+ { \
+ return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
+ } \
+ int i2d_##fname(stname *a, unsigned char **out) \
+ { \
+ return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
+ }
+
+# define IMPLEMENT_ASN1_NDEF_FUNCTION(stname) \
+ int i2d_##stname##_NDEF(stname *a, unsigned char **out) \
+ { \
+ return ASN1_item_ndef_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(stname));\
+ }
+
+/*
+ * This includes evil casts to remove const: they will go away when full ASN1
+ * constification is done.
+ */
+# define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \
+ stname *d2i_##fname(stname **a, const unsigned char **in, long len) \
+ { \
+ return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
+ } \
+ int i2d_##fname(const stname *a, unsigned char **out) \
+ { \
+ return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
+ }
+
+# define IMPLEMENT_ASN1_DUP_FUNCTION(stname) \
+ stname * stname##_dup(stname *x) \
+ { \
+ return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \
+ }
+
+# define IMPLEMENT_ASN1_PRINT_FUNCTION(stname) \
+ IMPLEMENT_ASN1_PRINT_FUNCTION_fname(stname, stname, stname)
+
+# define IMPLEMENT_ASN1_PRINT_FUNCTION_fname(stname, itname, fname) \
+ int fname##_print_ctx(BIO *out, stname *x, int indent, \
+ const ASN1_PCTX *pctx) \
+ { \
+ return ASN1_item_print(out, (ASN1_VALUE *)x, indent, \
+ ASN1_ITEM_rptr(itname), pctx); \
+ }
+
+# define IMPLEMENT_ASN1_FUNCTIONS_const(name) \
+ IMPLEMENT_ASN1_FUNCTIONS_const_fname(name, name, name)
+
+# define IMPLEMENT_ASN1_FUNCTIONS_const_fname(stname, itname, fname) \
+ IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \
+ IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname)
+
+/* external definitions for primitive types */
+
+DECLARE_ASN1_ITEM(ASN1_BOOLEAN)
+DECLARE_ASN1_ITEM(ASN1_TBOOLEAN)
+DECLARE_ASN1_ITEM(ASN1_FBOOLEAN)
+DECLARE_ASN1_ITEM(ASN1_SEQUENCE)
+DECLARE_ASN1_ITEM(CBIGNUM)
+DECLARE_ASN1_ITEM(BIGNUM)
+DECLARE_ASN1_ITEM(LONG)
+DECLARE_ASN1_ITEM(ZLONG)
+
+DECLARE_STACK_OF(ASN1_VALUE)
+
+/* Functions used internally by the ASN1 code */
+
+int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it);
+void ASN1_item_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it);
+int ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);
+int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it);
+
+void ASN1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);
+int ASN1_template_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
+ const ASN1_TEMPLATE *tt);
+int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
+ const ASN1_ITEM *it, int tag, int aclass, char opt,
+ ASN1_TLC *ctx);
+
+int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
+ const ASN1_ITEM *it, int tag, int aclass);
+int ASN1_template_i2d(ASN1_VALUE **pval, unsigned char **out,
+ const ASN1_TEMPLATE *tt);
+void ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it);
+
+int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype,
+ const ASN1_ITEM *it);
+int asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
+ int utype, char *free_cont, const ASN1_ITEM *it);
+
+int asn1_get_choice_selector(ASN1_VALUE **pval, const ASN1_ITEM *it);
+int asn1_set_choice_selector(ASN1_VALUE **pval, int value,
+ const ASN1_ITEM *it);
+
+ASN1_VALUE **asn1_get_field_ptr(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);
+
+const ASN1_TEMPLATE *asn1_do_adb(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt,
+ int nullerr);
+
+int asn1_do_lock(ASN1_VALUE **pval, int op, const ASN1_ITEM *it);
+
+void asn1_enc_init(ASN1_VALUE **pval, const ASN1_ITEM *it);
+void asn1_enc_free(ASN1_VALUE **pval, const ASN1_ITEM *it);
+int asn1_enc_restore(int *len, unsigned char **out, ASN1_VALUE **pval,
+ const ASN1_ITEM *it);
+int asn1_enc_save(ASN1_VALUE **pval, const unsigned char *in, int inlen,
+ const ASN1_ITEM *it);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/bio.h b/protocols/Telegram/tgl/openssl/include/openssl/bio.h
new file mode 100644
index 0000000000..f78796b069
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/bio.h
@@ -0,0 +1,879 @@
+/* crypto/bio/bio.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_BIO_H
+# define HEADER_BIO_H
+
+# include <openssl/e_os2.h>
+
+# ifndef OPENSSL_NO_FP_API
+# include <stdio.h>
+# endif
+# include <stdarg.h>
+
+# include <openssl/crypto.h>
+
+# ifndef OPENSSL_NO_SCTP
+# ifndef OPENSSL_SYS_VMS
+# include <stdint.h>
+# else
+# include <inttypes.h>
+# endif
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* These are the 'types' of BIOs */
+# define BIO_TYPE_NONE 0
+# define BIO_TYPE_MEM (1|0x0400)
+# define BIO_TYPE_FILE (2|0x0400)
+
+# define BIO_TYPE_FD (4|0x0400|0x0100)
+# define BIO_TYPE_SOCKET (5|0x0400|0x0100)
+# define BIO_TYPE_NULL (6|0x0400)
+# define BIO_TYPE_SSL (7|0x0200)
+# define BIO_TYPE_MD (8|0x0200)/* passive filter */
+# define BIO_TYPE_BUFFER (9|0x0200)/* filter */
+# define BIO_TYPE_CIPHER (10|0x0200)/* filter */
+# define BIO_TYPE_BASE64 (11|0x0200)/* filter */
+# define BIO_TYPE_CONNECT (12|0x0400|0x0100)/* socket - connect */
+# define BIO_TYPE_ACCEPT (13|0x0400|0x0100)/* socket for accept */
+# define BIO_TYPE_PROXY_CLIENT (14|0x0200)/* client proxy BIO */
+# define BIO_TYPE_PROXY_SERVER (15|0x0200)/* server proxy BIO */
+# define BIO_TYPE_NBIO_TEST (16|0x0200)/* server proxy BIO */
+# define BIO_TYPE_NULL_FILTER (17|0x0200)
+# define BIO_TYPE_BER (18|0x0200)/* BER -> bin filter */
+# define BIO_TYPE_BIO (19|0x0400)/* (half a) BIO pair */
+# define BIO_TYPE_LINEBUFFER (20|0x0200)/* filter */
+# define BIO_TYPE_DGRAM (21|0x0400|0x0100)
+# ifndef OPENSSL_NO_SCTP
+# define BIO_TYPE_DGRAM_SCTP (24|0x0400|0x0100)
+# endif
+# define BIO_TYPE_ASN1 (22|0x0200)/* filter */
+# define BIO_TYPE_COMP (23|0x0200)/* filter */
+
+# define BIO_TYPE_DESCRIPTOR 0x0100/* socket, fd, connect or accept */
+# define BIO_TYPE_FILTER 0x0200
+# define BIO_TYPE_SOURCE_SINK 0x0400
+
+/*
+ * BIO_FILENAME_READ|BIO_CLOSE to open or close on free.
+ * BIO_set_fp(in,stdin,BIO_NOCLOSE);
+ */
+# define BIO_NOCLOSE 0x00
+# define BIO_CLOSE 0x01
+
+/*
+ * These are used in the following macros and are passed to BIO_ctrl()
+ */
+# define BIO_CTRL_RESET 1/* opt - rewind/zero etc */
+# define BIO_CTRL_EOF 2/* opt - are we at the eof */
+# define BIO_CTRL_INFO 3/* opt - extra tit-bits */
+# define BIO_CTRL_SET 4/* man - set the 'IO' type */
+# define BIO_CTRL_GET 5/* man - get the 'IO' type */
+# define BIO_CTRL_PUSH 6/* opt - internal, used to signify change */
+# define BIO_CTRL_POP 7/* opt - internal, used to signify change */
+# define BIO_CTRL_GET_CLOSE 8/* man - set the 'close' on free */
+# define BIO_CTRL_SET_CLOSE 9/* man - set the 'close' on free */
+# define BIO_CTRL_PENDING 10/* opt - is their more data buffered */
+# define BIO_CTRL_FLUSH 11/* opt - 'flush' buffered output */
+# define BIO_CTRL_DUP 12/* man - extra stuff for 'duped' BIO */
+# define BIO_CTRL_WPENDING 13/* opt - number of bytes still to write */
+/* callback is int cb(BIO *bio,state,ret); */
+# define BIO_CTRL_SET_CALLBACK 14/* opt - set callback function */
+# define BIO_CTRL_GET_CALLBACK 15/* opt - set callback function */
+
+# define BIO_CTRL_SET_FILENAME 30/* BIO_s_file special */
+
+/* dgram BIO stuff */
+# define BIO_CTRL_DGRAM_CONNECT 31/* BIO dgram special */
+# define BIO_CTRL_DGRAM_SET_CONNECTED 32/* allow for an externally connected
+ * socket to be passed in */
+# define BIO_CTRL_DGRAM_SET_RECV_TIMEOUT 33/* setsockopt, essentially */
+# define BIO_CTRL_DGRAM_GET_RECV_TIMEOUT 34/* getsockopt, essentially */
+# define BIO_CTRL_DGRAM_SET_SEND_TIMEOUT 35/* setsockopt, essentially */
+# define BIO_CTRL_DGRAM_GET_SEND_TIMEOUT 36/* getsockopt, essentially */
+
+# define BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP 37/* flag whether the last */
+# define BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP 38/* I/O operation tiemd out */
+
+/* #ifdef IP_MTU_DISCOVER */
+# define BIO_CTRL_DGRAM_MTU_DISCOVER 39/* set DF bit on egress packets */
+/* #endif */
+
+# define BIO_CTRL_DGRAM_QUERY_MTU 40/* as kernel for current MTU */
+# define BIO_CTRL_DGRAM_GET_FALLBACK_MTU 47
+# define BIO_CTRL_DGRAM_GET_MTU 41/* get cached value for MTU */
+# define BIO_CTRL_DGRAM_SET_MTU 42/* set cached value for MTU.
+ * want to use this if asking
+ * the kernel fails */
+
+# define BIO_CTRL_DGRAM_MTU_EXCEEDED 43/* check whether the MTU was
+ * exceed in the previous write
+ * operation */
+
+# define BIO_CTRL_DGRAM_GET_PEER 46
+# define BIO_CTRL_DGRAM_SET_PEER 44/* Destination for the data */
+
+# define BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT 45/* Next DTLS handshake timeout
+ * to adjust socket timeouts */
+# define BIO_CTRL_DGRAM_SET_DONT_FRAG 48
+
+# define BIO_CTRL_DGRAM_GET_MTU_OVERHEAD 49
+
+# ifndef OPENSSL_NO_SCTP
+/* SCTP stuff */
+# define BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE 50
+# define BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY 51
+# define BIO_CTRL_DGRAM_SCTP_NEXT_AUTH_KEY 52
+# define BIO_CTRL_DGRAM_SCTP_AUTH_CCS_RCVD 53
+# define BIO_CTRL_DGRAM_SCTP_GET_SNDINFO 60
+# define BIO_CTRL_DGRAM_SCTP_SET_SNDINFO 61
+# define BIO_CTRL_DGRAM_SCTP_GET_RCVINFO 62
+# define BIO_CTRL_DGRAM_SCTP_SET_RCVINFO 63
+# define BIO_CTRL_DGRAM_SCTP_GET_PRINFO 64
+# define BIO_CTRL_DGRAM_SCTP_SET_PRINFO 65
+# define BIO_CTRL_DGRAM_SCTP_SAVE_SHUTDOWN 70
+# endif
+
+/* modifiers */
+# define BIO_FP_READ 0x02
+# define BIO_FP_WRITE 0x04
+# define BIO_FP_APPEND 0x08
+# define BIO_FP_TEXT 0x10
+
+# define BIO_FLAGS_READ 0x01
+# define BIO_FLAGS_WRITE 0x02
+# define BIO_FLAGS_IO_SPECIAL 0x04
+# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
+# define BIO_FLAGS_SHOULD_RETRY 0x08
+# ifndef BIO_FLAGS_UPLINK
+/*
+ * "UPLINK" flag denotes file descriptors provided by application. It
+ * defaults to 0, as most platforms don't require UPLINK interface.
+ */
+# define BIO_FLAGS_UPLINK 0
+# endif
+
+/* Used in BIO_gethostbyname() */
+# define BIO_GHBN_CTRL_HITS 1
+# define BIO_GHBN_CTRL_MISSES 2
+# define BIO_GHBN_CTRL_CACHE_SIZE 3
+# define BIO_GHBN_CTRL_GET_ENTRY 4
+# define BIO_GHBN_CTRL_FLUSH 5
+
+/* Mostly used in the SSL BIO */
+/*-
+ * Not used anymore
+ * #define BIO_FLAGS_PROTOCOL_DELAYED_READ 0x10
+ * #define BIO_FLAGS_PROTOCOL_DELAYED_WRITE 0x20
+ * #define BIO_FLAGS_PROTOCOL_STARTUP 0x40
+ */
+
+# define BIO_FLAGS_BASE64_NO_NL 0x100
+
+/*
+ * This is used with memory BIOs: it means we shouldn't free up or change the
+ * data in any way.
+ */
+# define BIO_FLAGS_MEM_RDONLY 0x200
+
+typedef struct bio_st BIO;
+
+void BIO_set_flags(BIO *b, int flags);
+int BIO_test_flags(const BIO *b, int flags);
+void BIO_clear_flags(BIO *b, int flags);
+
+# define BIO_get_flags(b) BIO_test_flags(b, ~(0x0))
+# define BIO_set_retry_special(b) \
+ BIO_set_flags(b, (BIO_FLAGS_IO_SPECIAL|BIO_FLAGS_SHOULD_RETRY))
+# define BIO_set_retry_read(b) \
+ BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
+# define BIO_set_retry_write(b) \
+ BIO_set_flags(b, (BIO_FLAGS_WRITE|BIO_FLAGS_SHOULD_RETRY))
+
+/* These are normally used internally in BIOs */
+# define BIO_clear_retry_flags(b) \
+ BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
+# define BIO_get_retry_flags(b) \
+ BIO_test_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
+
+/* These should be used by the application to tell why we should retry */
+# define BIO_should_read(a) BIO_test_flags(a, BIO_FLAGS_READ)
+# define BIO_should_write(a) BIO_test_flags(a, BIO_FLAGS_WRITE)
+# define BIO_should_io_special(a) BIO_test_flags(a, BIO_FLAGS_IO_SPECIAL)
+# define BIO_retry_type(a) BIO_test_flags(a, BIO_FLAGS_RWS)
+# define BIO_should_retry(a) BIO_test_flags(a, BIO_FLAGS_SHOULD_RETRY)
+
+/*
+ * The next three are used in conjunction with the BIO_should_io_special()
+ * condition. After this returns true, BIO *BIO_get_retry_BIO(BIO *bio, int
+ * *reason); will walk the BIO stack and return the 'reason' for the special
+ * and the offending BIO. Given a BIO, BIO_get_retry_reason(bio) will return
+ * the code.
+ */
+/*
+ * Returned from the SSL bio when the certificate retrieval code had an error
+ */
+# define BIO_RR_SSL_X509_LOOKUP 0x01
+/* Returned from the connect BIO when a connect would have blocked */
+# define BIO_RR_CONNECT 0x02
+/* Returned from the accept BIO when an accept would have blocked */
+# define BIO_RR_ACCEPT 0x03
+
+/* These are passed by the BIO callback */
+# define BIO_CB_FREE 0x01
+# define BIO_CB_READ 0x02
+# define BIO_CB_WRITE 0x03
+# define BIO_CB_PUTS 0x04
+# define BIO_CB_GETS 0x05
+# define BIO_CB_CTRL 0x06
+
+/*
+ * The callback is called before and after the underling operation, The
+ * BIO_CB_RETURN flag indicates if it is after the call
+ */
+# define BIO_CB_RETURN 0x80
+# define BIO_CB_return(a) ((a)|BIO_CB_RETURN)
+# define BIO_cb_pre(a) (!((a)&BIO_CB_RETURN))
+# define BIO_cb_post(a) ((a)&BIO_CB_RETURN)
+
+long (*BIO_get_callback(const BIO *b)) (struct bio_st *, int, const char *,
+ int, long, long);
+void BIO_set_callback(BIO *b,
+ long (*callback) (struct bio_st *, int, const char *,
+ int, long, long));
+char *BIO_get_callback_arg(const BIO *b);
+void BIO_set_callback_arg(BIO *b, char *arg);
+
+const char *BIO_method_name(const BIO *b);
+int BIO_method_type(const BIO *b);
+
+typedef void bio_info_cb (struct bio_st *, int, const char *, int, long,
+ long);
+
+typedef struct bio_method_st {
+ int type;
+ const char *name;
+ int (*bwrite) (BIO *, const char *, int);
+ int (*bread) (BIO *, char *, int);
+ int (*bputs) (BIO *, const char *);
+ int (*bgets) (BIO *, char *, int);
+ long (*ctrl) (BIO *, int, long, void *);
+ int (*create) (BIO *);
+ int (*destroy) (BIO *);
+ long (*callback_ctrl) (BIO *, int, bio_info_cb *);
+} BIO_METHOD;
+
+struct bio_st {
+ BIO_METHOD *method;
+ /* bio, mode, argp, argi, argl, ret */
+ long (*callback) (struct bio_st *, int, const char *, int, long, long);
+ char *cb_arg; /* first argument for the callback */
+ int init;
+ int shutdown;
+ int flags; /* extra storage */
+ int retry_reason;
+ int num;
+ void *ptr;
+ struct bio_st *next_bio; /* used by filter BIOs */
+ struct bio_st *prev_bio; /* used by filter BIOs */
+ int references;
+ unsigned long num_read;
+ unsigned long num_write;
+ CRYPTO_EX_DATA ex_data;
+};
+
+DECLARE_STACK_OF(BIO)
+
+typedef struct bio_f_buffer_ctx_struct {
+ /*-
+ * Buffers are setup like this:
+ *
+ * <---------------------- size ----------------------->
+ * +---------------------------------------------------+
+ * | consumed | remaining | free space |
+ * +---------------------------------------------------+
+ * <-- off --><------- len ------->
+ */
+ /*- BIO *bio; *//*
+ * this is now in the BIO struct
+ */
+ int ibuf_size; /* how big is the input buffer */
+ int obuf_size; /* how big is the output buffer */
+ char *ibuf; /* the char array */
+ int ibuf_len; /* how many bytes are in it */
+ int ibuf_off; /* write/read offset */
+ char *obuf; /* the char array */
+ int obuf_len; /* how many bytes are in it */
+ int obuf_off; /* write/read offset */
+} BIO_F_BUFFER_CTX;
+
+/* Prefix and suffix callback in ASN1 BIO */
+typedef int asn1_ps_func (BIO *b, unsigned char **pbuf, int *plen,
+ void *parg);
+
+# ifndef OPENSSL_NO_SCTP
+/* SCTP parameter structs */
+struct bio_dgram_sctp_sndinfo {
+ uint16_t snd_sid;
+ uint16_t snd_flags;
+ uint32_t snd_ppid;
+ uint32_t snd_context;
+};
+
+struct bio_dgram_sctp_rcvinfo {
+ uint16_t rcv_sid;
+ uint16_t rcv_ssn;
+ uint16_t rcv_flags;
+ uint32_t rcv_ppid;
+ uint32_t rcv_tsn;
+ uint32_t rcv_cumtsn;
+ uint32_t rcv_context;
+};
+
+struct bio_dgram_sctp_prinfo {
+ uint16_t pr_policy;
+ uint32_t pr_value;
+};
+# endif
+
+/* connect BIO stuff */
+# define BIO_CONN_S_BEFORE 1
+# define BIO_CONN_S_GET_IP 2
+# define BIO_CONN_S_GET_PORT 3
+# define BIO_CONN_S_CREATE_SOCKET 4
+# define BIO_CONN_S_CONNECT 5
+# define BIO_CONN_S_OK 6
+# define BIO_CONN_S_BLOCKED_CONNECT 7
+# define BIO_CONN_S_NBIO 8
+/*
+ * #define BIO_CONN_get_param_hostname BIO_ctrl
+ */
+
+# define BIO_C_SET_CONNECT 100
+# define BIO_C_DO_STATE_MACHINE 101
+# define BIO_C_SET_NBIO 102
+# define BIO_C_SET_PROXY_PARAM 103
+# define BIO_C_SET_FD 104
+# define BIO_C_GET_FD 105
+# define BIO_C_SET_FILE_PTR 106
+# define BIO_C_GET_FILE_PTR 107
+# define BIO_C_SET_FILENAME 108
+# define BIO_C_SET_SSL 109
+# define BIO_C_GET_SSL 110
+# define BIO_C_SET_MD 111
+# define BIO_C_GET_MD 112
+# define BIO_C_GET_CIPHER_STATUS 113
+# define BIO_C_SET_BUF_MEM 114
+# define BIO_C_GET_BUF_MEM_PTR 115
+# define BIO_C_GET_BUFF_NUM_LINES 116
+# define BIO_C_SET_BUFF_SIZE 117
+# define BIO_C_SET_ACCEPT 118
+# define BIO_C_SSL_MODE 119
+# define BIO_C_GET_MD_CTX 120
+# define BIO_C_GET_PROXY_PARAM 121
+# define BIO_C_SET_BUFF_READ_DATA 122/* data to read first */
+# define BIO_C_GET_CONNECT 123
+# define BIO_C_GET_ACCEPT 124
+# define BIO_C_SET_SSL_RENEGOTIATE_BYTES 125
+# define BIO_C_GET_SSL_NUM_RENEGOTIATES 126
+# define BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT 127
+# define BIO_C_FILE_SEEK 128
+# define BIO_C_GET_CIPHER_CTX 129
+# define BIO_C_SET_BUF_MEM_EOF_RETURN 130/* return end of input
+ * value */
+# define BIO_C_SET_BIND_MODE 131
+# define BIO_C_GET_BIND_MODE 132
+# define BIO_C_FILE_TELL 133
+# define BIO_C_GET_SOCKS 134
+# define BIO_C_SET_SOCKS 135
+
+# define BIO_C_SET_WRITE_BUF_SIZE 136/* for BIO_s_bio */
+# define BIO_C_GET_WRITE_BUF_SIZE 137
+# define BIO_C_MAKE_BIO_PAIR 138
+# define BIO_C_DESTROY_BIO_PAIR 139
+# define BIO_C_GET_WRITE_GUARANTEE 140
+# define BIO_C_GET_READ_REQUEST 141
+# define BIO_C_SHUTDOWN_WR 142
+# define BIO_C_NREAD0 143
+# define BIO_C_NREAD 144
+# define BIO_C_NWRITE0 145
+# define BIO_C_NWRITE 146
+# define BIO_C_RESET_READ_REQUEST 147
+# define BIO_C_SET_MD_CTX 148
+
+# define BIO_C_SET_PREFIX 149
+# define BIO_C_GET_PREFIX 150
+# define BIO_C_SET_SUFFIX 151
+# define BIO_C_GET_SUFFIX 152
+
+# define BIO_C_SET_EX_ARG 153
+# define BIO_C_GET_EX_ARG 154
+
+# define BIO_set_app_data(s,arg) BIO_set_ex_data(s,0,arg)
+# define BIO_get_app_data(s) BIO_get_ex_data(s,0)
+
+/* BIO_s_connect() and BIO_s_socks4a_connect() */
+# define BIO_set_conn_hostname(b,name) BIO_ctrl(b,BIO_C_SET_CONNECT,0,(char *)name)
+# define BIO_set_conn_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,1,(char *)port)
+# define BIO_set_conn_ip(b,ip) BIO_ctrl(b,BIO_C_SET_CONNECT,2,(char *)ip)
+# define BIO_set_conn_int_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,3,(char *)port)
+# define BIO_get_conn_hostname(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0)
+# define BIO_get_conn_port(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1)
+# define BIO_get_conn_ip(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2)
+# define BIO_get_conn_int_port(b) BIO_int_ctrl(b,BIO_C_GET_CONNECT,3,0)
+
+# define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL)
+
+/* BIO_s_accept_socket() */
+# define BIO_set_accept_port(b,name) BIO_ctrl(b,BIO_C_SET_ACCEPT,0,(char *)name)
+# define BIO_get_accept_port(b) BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0)
+/* #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) */
+# define BIO_set_nbio_accept(b,n) BIO_ctrl(b,BIO_C_SET_ACCEPT,1,(n)?(void *)"a":NULL)
+# define BIO_set_accept_bios(b,bio) BIO_ctrl(b,BIO_C_SET_ACCEPT,2,(char *)bio)
+
+# define BIO_BIND_NORMAL 0
+# define BIO_BIND_REUSEADDR_IF_UNUSED 1
+# define BIO_BIND_REUSEADDR 2
+# define BIO_set_bind_mode(b,mode) BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,NULL)
+# define BIO_get_bind_mode(b,mode) BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,NULL)
+
+# define BIO_do_connect(b) BIO_do_handshake(b)
+# define BIO_do_accept(b) BIO_do_handshake(b)
+# define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL)
+
+/* BIO_s_proxy_client() */
+# define BIO_set_url(b,url) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,0,(char *)(url))
+# define BIO_set_proxies(b,p) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,1,(char *)(p))
+/* BIO_set_nbio(b,n) */
+# define BIO_set_filter_bio(b,s) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,2,(char *)(s))
+/* BIO *BIO_get_filter_bio(BIO *bio); */
+# define BIO_set_proxy_cb(b,cb) BIO_callback_ctrl(b,BIO_C_SET_PROXY_PARAM,3,(void *(*cb)()))
+# define BIO_set_proxy_header(b,sk) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,4,(char *)sk)
+# define BIO_set_no_connect_return(b,bool) BIO_int_ctrl(b,BIO_C_SET_PROXY_PARAM,5,bool)
+
+# define BIO_get_proxy_header(b,skp) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,0,(char *)skp)
+# define BIO_get_proxies(b,pxy_p) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,1,(char *)(pxy_p))
+# define BIO_get_url(b,url) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,2,(char *)(url))
+# define BIO_get_no_connect_return(b) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,5,NULL)
+
+# define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd)
+# define BIO_get_fd(b,c) BIO_ctrl(b,BIO_C_GET_FD,0,(char *)c)
+
+# define BIO_set_fp(b,fp,c) BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char *)fp)
+# define BIO_get_fp(b,fpp) BIO_ctrl(b,BIO_C_GET_FILE_PTR,0,(char *)fpp)
+
+# define BIO_seek(b,ofs) (int)BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,NULL)
+# define BIO_tell(b) (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL)
+
+/*
+ * name is cast to lose const, but might be better to route through a
+ * function so we can do it safely
+ */
+# ifdef CONST_STRICT
+/*
+ * If you are wondering why this isn't defined, its because CONST_STRICT is
+ * purely a compile-time kludge to allow const to be checked.
+ */
+int BIO_read_filename(BIO *b, const char *name);
+# else
+# define BIO_read_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
+ BIO_CLOSE|BIO_FP_READ,(char *)name)
+# endif
+# define BIO_write_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
+ BIO_CLOSE|BIO_FP_WRITE,name)
+# define BIO_append_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
+ BIO_CLOSE|BIO_FP_APPEND,name)
+# define BIO_rw_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
+ BIO_CLOSE|BIO_FP_READ|BIO_FP_WRITE,name)
+
+/*
+ * WARNING WARNING, this ups the reference count on the read bio of the SSL
+ * structure. This is because the ssl read BIO is now pointed to by the
+ * next_bio field in the bio. So when you free the BIO, make sure you are
+ * doing a BIO_free_all() to catch the underlying BIO.
+ */
+# define BIO_set_ssl(b,ssl,c) BIO_ctrl(b,BIO_C_SET_SSL,c,(char *)ssl)
+# define BIO_get_ssl(b,sslp) BIO_ctrl(b,BIO_C_GET_SSL,0,(char *)sslp)
+# define BIO_set_ssl_mode(b,client) BIO_ctrl(b,BIO_C_SSL_MODE,client,NULL)
+# define BIO_set_ssl_renegotiate_bytes(b,num) \
+ BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL);
+# define BIO_get_num_renegotiates(b) \
+ BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,NULL);
+# define BIO_set_ssl_renegotiate_timeout(b,seconds) \
+ BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL);
+
+/* defined in evp.h */
+/* #define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,1,(char *)md) */
+
+# define BIO_get_mem_data(b,pp) BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)pp)
+# define BIO_set_mem_buf(b,bm,c) BIO_ctrl(b,BIO_C_SET_BUF_MEM,c,(char *)bm)
+# define BIO_get_mem_ptr(b,pp) BIO_ctrl(b,BIO_C_GET_BUF_MEM_PTR,0,(char *)pp)
+# define BIO_set_mem_eof_return(b,v) \
+ BIO_ctrl(b,BIO_C_SET_BUF_MEM_EOF_RETURN,v,NULL)
+
+/* For the BIO_f_buffer() type */
+# define BIO_get_buffer_num_lines(b) BIO_ctrl(b,BIO_C_GET_BUFF_NUM_LINES,0,NULL)
+# define BIO_set_buffer_size(b,size) BIO_ctrl(b,BIO_C_SET_BUFF_SIZE,size,NULL)
+# define BIO_set_read_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,0)
+# define BIO_set_write_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,1)
+# define BIO_set_buffer_read_data(b,buf,num) BIO_ctrl(b,BIO_C_SET_BUFF_READ_DATA,num,buf)
+
+/* Don't use the next one unless you know what you are doing :-) */
+# define BIO_dup_state(b,ret) BIO_ctrl(b,BIO_CTRL_DUP,0,(char *)(ret))
+
+# define BIO_reset(b) (int)BIO_ctrl(b,BIO_CTRL_RESET,0,NULL)
+# define BIO_eof(b) (int)BIO_ctrl(b,BIO_CTRL_EOF,0,NULL)
+# define BIO_set_close(b,c) (int)BIO_ctrl(b,BIO_CTRL_SET_CLOSE,(c),NULL)
+# define BIO_get_close(b) (int)BIO_ctrl(b,BIO_CTRL_GET_CLOSE,0,NULL)
+# define BIO_pending(b) (int)BIO_ctrl(b,BIO_CTRL_PENDING,0,NULL)
+# define BIO_wpending(b) (int)BIO_ctrl(b,BIO_CTRL_WPENDING,0,NULL)
+/* ...pending macros have inappropriate return type */
+size_t BIO_ctrl_pending(BIO *b);
+size_t BIO_ctrl_wpending(BIO *b);
+# define BIO_flush(b) (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL)
+# define BIO_get_info_callback(b,cbp) (int)BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0, \
+ cbp)
+# define BIO_set_info_callback(b,cb) (int)BIO_callback_ctrl(b,BIO_CTRL_SET_CALLBACK,cb)
+
+/* For the BIO_f_buffer() type */
+# define BIO_buffer_get_num_lines(b) BIO_ctrl(b,BIO_CTRL_GET,0,NULL)
+
+/* For BIO_s_bio() */
+# define BIO_set_write_buf_size(b,size) (int)BIO_ctrl(b,BIO_C_SET_WRITE_BUF_SIZE,size,NULL)
+# define BIO_get_write_buf_size(b,size) (size_t)BIO_ctrl(b,BIO_C_GET_WRITE_BUF_SIZE,size,NULL)
+# define BIO_make_bio_pair(b1,b2) (int)BIO_ctrl(b1,BIO_C_MAKE_BIO_PAIR,0,b2)
+# define BIO_destroy_bio_pair(b) (int)BIO_ctrl(b,BIO_C_DESTROY_BIO_PAIR,0,NULL)
+# define BIO_shutdown_wr(b) (int)BIO_ctrl(b, BIO_C_SHUTDOWN_WR, 0, NULL)
+/* macros with inappropriate type -- but ...pending macros use int too: */
+# define BIO_get_write_guarantee(b) (int)BIO_ctrl(b,BIO_C_GET_WRITE_GUARANTEE,0,NULL)
+# define BIO_get_read_request(b) (int)BIO_ctrl(b,BIO_C_GET_READ_REQUEST,0,NULL)
+size_t BIO_ctrl_get_write_guarantee(BIO *b);
+size_t BIO_ctrl_get_read_request(BIO *b);
+int BIO_ctrl_reset_read_request(BIO *b);
+
+/* ctrl macros for dgram */
+# define BIO_ctrl_dgram_connect(b,peer) \
+ (int)BIO_ctrl(b,BIO_CTRL_DGRAM_CONNECT,0, (char *)peer)
+# define BIO_ctrl_set_connected(b, state, peer) \
+ (int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_CONNECTED, state, (char *)peer)
+# define BIO_dgram_recv_timedout(b) \
+ (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP, 0, NULL)
+# define BIO_dgram_send_timedout(b) \
+ (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP, 0, NULL)
+# define BIO_dgram_get_peer(b,peer) \
+ (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_PEER, 0, (char *)peer)
+# define BIO_dgram_set_peer(b,peer) \
+ (int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, (char *)peer)
+# define BIO_dgram_get_mtu_overhead(b) \
+ (unsigned int)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_MTU_OVERHEAD, 0, NULL)
+
+/* These two aren't currently implemented */
+/* int BIO_get_ex_num(BIO *bio); */
+/* void BIO_set_ex_free_func(BIO *bio,int idx,void (*cb)()); */
+int BIO_set_ex_data(BIO *bio, int idx, void *data);
+void *BIO_get_ex_data(BIO *bio, int idx);
+int BIO_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
+ CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
+unsigned long BIO_number_read(BIO *bio);
+unsigned long BIO_number_written(BIO *bio);
+
+/* For BIO_f_asn1() */
+int BIO_asn1_set_prefix(BIO *b, asn1_ps_func *prefix,
+ asn1_ps_func *prefix_free);
+int BIO_asn1_get_prefix(BIO *b, asn1_ps_func **pprefix,
+ asn1_ps_func **pprefix_free);
+int BIO_asn1_set_suffix(BIO *b, asn1_ps_func *suffix,
+ asn1_ps_func *suffix_free);
+int BIO_asn1_get_suffix(BIO *b, asn1_ps_func **psuffix,
+ asn1_ps_func **psuffix_free);
+
+# ifndef OPENSSL_NO_FP_API
+BIO_METHOD *BIO_s_file(void);
+BIO *BIO_new_file(const char *filename, const char *mode);
+BIO *BIO_new_fp(FILE *stream, int close_flag);
+# define BIO_s_file_internal BIO_s_file
+# endif
+BIO *BIO_new(BIO_METHOD *type);
+int BIO_set(BIO *a, BIO_METHOD *type);
+int BIO_free(BIO *a);
+void BIO_vfree(BIO *a);
+int BIO_read(BIO *b, void *data, int len);
+int BIO_gets(BIO *bp, char *buf, int size);
+int BIO_write(BIO *b, const void *data, int len);
+int BIO_puts(BIO *bp, const char *buf);
+int BIO_indent(BIO *b, int indent, int max);
+long BIO_ctrl(BIO *bp, int cmd, long larg, void *parg);
+long BIO_callback_ctrl(BIO *b, int cmd,
+ void (*fp) (struct bio_st *, int, const char *, int,
+ long, long));
+char *BIO_ptr_ctrl(BIO *bp, int cmd, long larg);
+long BIO_int_ctrl(BIO *bp, int cmd, long larg, int iarg);
+BIO *BIO_push(BIO *b, BIO *append);
+BIO *BIO_pop(BIO *b);
+void BIO_free_all(BIO *a);
+BIO *BIO_find_type(BIO *b, int bio_type);
+BIO *BIO_next(BIO *b);
+BIO *BIO_get_retry_BIO(BIO *bio, int *reason);
+int BIO_get_retry_reason(BIO *bio);
+BIO *BIO_dup_chain(BIO *in);
+
+int BIO_nread0(BIO *bio, char **buf);
+int BIO_nread(BIO *bio, char **buf, int num);
+int BIO_nwrite0(BIO *bio, char **buf);
+int BIO_nwrite(BIO *bio, char **buf, int num);
+
+long BIO_debug_callback(BIO *bio, int cmd, const char *argp, int argi,
+ long argl, long ret);
+
+BIO_METHOD *BIO_s_mem(void);
+BIO *BIO_new_mem_buf(void *buf, int len);
+BIO_METHOD *BIO_s_socket(void);
+BIO_METHOD *BIO_s_connect(void);
+BIO_METHOD *BIO_s_accept(void);
+BIO_METHOD *BIO_s_fd(void);
+# ifndef OPENSSL_SYS_OS2
+BIO_METHOD *BIO_s_log(void);
+# endif
+BIO_METHOD *BIO_s_bio(void);
+BIO_METHOD *BIO_s_null(void);
+BIO_METHOD *BIO_f_null(void);
+BIO_METHOD *BIO_f_buffer(void);
+# ifdef OPENSSL_SYS_VMS
+BIO_METHOD *BIO_f_linebuffer(void);
+# endif
+BIO_METHOD *BIO_f_nbio_test(void);
+# ifndef OPENSSL_NO_DGRAM
+BIO_METHOD *BIO_s_datagram(void);
+# ifndef OPENSSL_NO_SCTP
+BIO_METHOD *BIO_s_datagram_sctp(void);
+# endif
+# endif
+
+/* BIO_METHOD *BIO_f_ber(void); */
+
+int BIO_sock_should_retry(int i);
+int BIO_sock_non_fatal_error(int error);
+int BIO_dgram_non_fatal_error(int error);
+
+int BIO_fd_should_retry(int i);
+int BIO_fd_non_fatal_error(int error);
+int BIO_dump_cb(int (*cb) (const void *data, size_t len, void *u),
+ void *u, const char *s, int len);
+int BIO_dump_indent_cb(int (*cb) (const void *data, size_t len, void *u),
+ void *u, const char *s, int len, int indent);
+int BIO_dump(BIO *b, const char *bytes, int len);
+int BIO_dump_indent(BIO *b, const char *bytes, int len, int indent);
+# ifndef OPENSSL_NO_FP_API
+int BIO_dump_fp(FILE *fp, const char *s, int len);
+int BIO_dump_indent_fp(FILE *fp, const char *s, int len, int indent);
+# endif
+int BIO_hex_string(BIO *out, int indent, int width, unsigned char *data,
+ int datalen);
+
+struct hostent *BIO_gethostbyname(const char *name);
+/*-
+ * We might want a thread-safe interface too:
+ * struct hostent *BIO_gethostbyname_r(const char *name,
+ * struct hostent *result, void *buffer, size_t buflen);
+ * or something similar (caller allocates a struct hostent,
+ * pointed to by "result", and additional buffer space for the various
+ * substructures; if the buffer does not suffice, NULL is returned
+ * and an appropriate error code is set).
+ */
+int BIO_sock_error(int sock);
+int BIO_socket_ioctl(int fd, long type, void *arg);
+int BIO_socket_nbio(int fd, int mode);
+int BIO_get_port(const char *str, unsigned short *port_ptr);
+int BIO_get_host_ip(const char *str, unsigned char *ip);
+int BIO_get_accept_socket(char *host_port, int mode);
+int BIO_accept(int sock, char **ip_port);
+int BIO_sock_init(void);
+void BIO_sock_cleanup(void);
+int BIO_set_tcp_ndelay(int sock, int turn_on);
+
+BIO *BIO_new_socket(int sock, int close_flag);
+BIO *BIO_new_dgram(int fd, int close_flag);
+# ifndef OPENSSL_NO_SCTP
+BIO *BIO_new_dgram_sctp(int fd, int close_flag);
+int BIO_dgram_is_sctp(BIO *bio);
+int BIO_dgram_sctp_notification_cb(BIO *b,
+ void (*handle_notifications) (BIO *bio,
+ void
+ *context,
+ void *buf),
+ void *context);
+int BIO_dgram_sctp_wait_for_dry(BIO *b);
+int BIO_dgram_sctp_msg_waiting(BIO *b);
+# endif
+BIO *BIO_new_fd(int fd, int close_flag);
+BIO *BIO_new_connect(const char *host_port);
+BIO *BIO_new_accept(const char *host_port);
+
+int BIO_new_bio_pair(BIO **bio1, size_t writebuf1,
+ BIO **bio2, size_t writebuf2);
+/*
+ * If successful, returns 1 and in *bio1, *bio2 two BIO pair endpoints.
+ * Otherwise returns 0 and sets *bio1 and *bio2 to NULL. Size 0 uses default
+ * value.
+ */
+
+void BIO_copy_next_retry(BIO *b);
+
+/*
+ * long BIO_ghbn_ctrl(int cmd,int iarg,char *parg);
+ */
+
+# ifdef __GNUC__
+# define __bio_h__attr__ __attribute__
+# else
+# define __bio_h__attr__(x)
+# endif
+int BIO_printf(BIO *bio, const char *format, ...)
+__bio_h__attr__((__format__(__printf__, 2, 3)));
+int BIO_vprintf(BIO *bio, const char *format, va_list args)
+__bio_h__attr__((__format__(__printf__, 2, 0)));
+int BIO_snprintf(char *buf, size_t n, const char *format, ...)
+__bio_h__attr__((__format__(__printf__, 3, 4)));
+int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args)
+__bio_h__attr__((__format__(__printf__, 3, 0)));
+# undef __bio_h__attr__
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_BIO_strings(void);
+
+/* Error codes for the BIO functions. */
+
+/* Function codes. */
+# define BIO_F_ACPT_STATE 100
+# define BIO_F_BIO_ACCEPT 101
+# define BIO_F_BIO_BER_GET_HEADER 102
+# define BIO_F_BIO_CALLBACK_CTRL 131
+# define BIO_F_BIO_CTRL 103
+# define BIO_F_BIO_GETHOSTBYNAME 120
+# define BIO_F_BIO_GETS 104
+# define BIO_F_BIO_GET_ACCEPT_SOCKET 105
+# define BIO_F_BIO_GET_HOST_IP 106
+# define BIO_F_BIO_GET_PORT 107
+# define BIO_F_BIO_MAKE_PAIR 121
+# define BIO_F_BIO_NEW 108
+# define BIO_F_BIO_NEW_FILE 109
+# define BIO_F_BIO_NEW_MEM_BUF 126
+# define BIO_F_BIO_NREAD 123
+# define BIO_F_BIO_NREAD0 124
+# define BIO_F_BIO_NWRITE 125
+# define BIO_F_BIO_NWRITE0 122
+# define BIO_F_BIO_PUTS 110
+# define BIO_F_BIO_READ 111
+# define BIO_F_BIO_SOCK_INIT 112
+# define BIO_F_BIO_WRITE 113
+# define BIO_F_BUFFER_CTRL 114
+# define BIO_F_CONN_CTRL 127
+# define BIO_F_CONN_STATE 115
+# define BIO_F_DGRAM_SCTP_READ 132
+# define BIO_F_DGRAM_SCTP_WRITE 133
+# define BIO_F_FILE_CTRL 116
+# define BIO_F_FILE_READ 130
+# define BIO_F_LINEBUFFER_CTRL 129
+# define BIO_F_MEM_READ 128
+# define BIO_F_MEM_WRITE 117
+# define BIO_F_SSL_NEW 118
+# define BIO_F_WSASTARTUP 119
+
+/* Reason codes. */
+# define BIO_R_ACCEPT_ERROR 100
+# define BIO_R_BAD_FOPEN_MODE 101
+# define BIO_R_BAD_HOSTNAME_LOOKUP 102
+# define BIO_R_BROKEN_PIPE 124
+# define BIO_R_CONNECT_ERROR 103
+# define BIO_R_EOF_ON_MEMORY_BIO 127
+# define BIO_R_ERROR_SETTING_NBIO 104
+# define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET 105
+# define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET 106
+# define BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET 107
+# define BIO_R_INVALID_ARGUMENT 125
+# define BIO_R_INVALID_IP_ADDRESS 108
+# define BIO_R_IN_USE 123
+# define BIO_R_KEEPALIVE 109
+# define BIO_R_NBIO_CONNECT_ERROR 110
+# define BIO_R_NO_ACCEPT_PORT_SPECIFIED 111
+# define BIO_R_NO_HOSTNAME_SPECIFIED 112
+# define BIO_R_NO_PORT_DEFINED 113
+# define BIO_R_NO_PORT_SPECIFIED 114
+# define BIO_R_NO_SUCH_FILE 128
+# define BIO_R_NULL_PARAMETER 115
+# define BIO_R_TAG_MISMATCH 116
+# define BIO_R_UNABLE_TO_BIND_SOCKET 117
+# define BIO_R_UNABLE_TO_CREATE_SOCKET 118
+# define BIO_R_UNABLE_TO_LISTEN_SOCKET 119
+# define BIO_R_UNINITIALIZED 120
+# define BIO_R_UNSUPPORTED_METHOD 121
+# define BIO_R_WRITE_TO_READ_ONLY_BIO 126
+# define BIO_R_WSASTARTUP 122
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/blowfish.h b/protocols/Telegram/tgl/openssl/include/openssl/blowfish.h
new file mode 100644
index 0000000000..832930272c
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/blowfish.h
@@ -0,0 +1,130 @@
+/* crypto/bf/blowfish.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_BLOWFISH_H
+# define HEADER_BLOWFISH_H
+
+# include <openssl/e_os2.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# ifdef OPENSSL_NO_BF
+# error BF is disabled.
+# endif
+
+# define BF_ENCRYPT 1
+# define BF_DECRYPT 0
+
+/*-
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ * ! BF_LONG has to be at least 32 bits wide. If it's wider, then !
+ * ! BF_LONG_LOG2 has to be defined along. !
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ */
+
+# if defined(__LP32__)
+# define BF_LONG unsigned long
+# elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)
+# define BF_LONG unsigned long
+# define BF_LONG_LOG2 3
+/*
+ * _CRAY note. I could declare short, but I have no idea what impact
+ * does it have on performance on none-T3E machines. I could declare
+ * int, but at least on C90 sizeof(int) can be chosen at compile time.
+ * So I've chosen long...
+ * <appro@fy.chalmers.se>
+ */
+# else
+# define BF_LONG unsigned int
+# endif
+
+# define BF_ROUNDS 16
+# define BF_BLOCK 8
+
+typedef struct bf_key_st {
+ BF_LONG P[BF_ROUNDS + 2];
+ BF_LONG S[4 * 256];
+} BF_KEY;
+
+# ifdef OPENSSL_FIPS
+void private_BF_set_key(BF_KEY *key, int len, const unsigned char *data);
+# endif
+void BF_set_key(BF_KEY *key, int len, const unsigned char *data);
+
+void BF_encrypt(BF_LONG *data, const BF_KEY *key);
+void BF_decrypt(BF_LONG *data, const BF_KEY *key);
+
+void BF_ecb_encrypt(const unsigned char *in, unsigned char *out,
+ const BF_KEY *key, int enc);
+void BF_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
+ const BF_KEY *schedule, unsigned char *ivec, int enc);
+void BF_cfb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, const BF_KEY *schedule,
+ unsigned char *ivec, int *num, int enc);
+void BF_ofb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, const BF_KEY *schedule,
+ unsigned char *ivec, int *num);
+const char *BF_options(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/bn.h b/protocols/Telegram/tgl/openssl/include/openssl/bn.h
new file mode 100644
index 0000000000..5696965e9a
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/bn.h
@@ -0,0 +1,939 @@
+/* crypto/bn/bn.h */
+/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+/* ====================================================================
+ * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+/* ====================================================================
+ * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
+ *
+ * Portions of the attached software ("Contribution") are developed by
+ * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project.
+ *
+ * The Contribution is licensed pursuant to the Eric Young open source
+ * license provided above.
+ *
+ * The binary polynomial arithmetic software is originally written by
+ * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories.
+ *
+ */
+
+#ifndef HEADER_BN_H
+# define HEADER_BN_H
+
+# include <openssl/e_os2.h>
+# ifndef OPENSSL_NO_FP_API
+# include <stdio.h> /* FILE */
+# endif
+# include <openssl/ossl_typ.h>
+# include <openssl/crypto.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * These preprocessor symbols control various aspects of the bignum headers
+ * and library code. They're not defined by any "normal" configuration, as
+ * they are intended for development and testing purposes. NB: defining all
+ * three can be useful for debugging application code as well as openssl
+ * itself. BN_DEBUG - turn on various debugging alterations to the bignum
+ * code BN_DEBUG_RAND - uses random poisoning of unused words to trip up
+ * mismanagement of bignum internals. You must also define BN_DEBUG.
+ */
+/* #define BN_DEBUG */
+/* #define BN_DEBUG_RAND */
+
+# ifndef OPENSSL_SMALL_FOOTPRINT
+# define BN_MUL_COMBA
+# define BN_SQR_COMBA
+# define BN_RECURSION
+# endif
+
+/*
+ * This next option uses the C libraries (2 word)/(1 word) function. If it is
+ * not defined, I use my C version (which is slower). The reason for this
+ * flag is that when the particular C compiler library routine is used, and
+ * the library is linked with a different compiler, the library is missing.
+ * This mostly happens when the library is built with gcc and then linked
+ * using normal cc. This would be a common occurrence because gcc normally
+ * produces code that is 2 times faster than system compilers for the big
+ * number stuff. For machines with only one compiler (or shared libraries),
+ * this should be on. Again this in only really a problem on machines using
+ * "long long's", are 32bit, and are not using my assembler code.
+ */
+# if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WINDOWS) || \
+ defined(OPENSSL_SYS_WIN32) || defined(linux)
+# ifndef BN_DIV2W
+# define BN_DIV2W
+# endif
+# endif
+
+/*
+ * assuming long is 64bit - this is the DEC Alpha unsigned long long is only
+ * 64 bits :-(, don't define BN_LLONG for the DEC Alpha
+ */
+# ifdef SIXTY_FOUR_BIT_LONG
+# define BN_ULLONG unsigned long long
+# define BN_ULONG unsigned long
+# define BN_LONG long
+# define BN_BITS 128
+# define BN_BYTES 8
+# define BN_BITS2 64
+# define BN_BITS4 32
+# define BN_MASK (0xffffffffffffffffffffffffffffffffLL)
+# define BN_MASK2 (0xffffffffffffffffL)
+# define BN_MASK2l (0xffffffffL)
+# define BN_MASK2h (0xffffffff00000000L)
+# define BN_MASK2h1 (0xffffffff80000000L)
+# define BN_TBIT (0x8000000000000000L)
+# define BN_DEC_CONV (10000000000000000000UL)
+# define BN_DEC_FMT1 "%lu"
+# define BN_DEC_FMT2 "%019lu"
+# define BN_DEC_NUM 19
+# define BN_HEX_FMT1 "%lX"
+# define BN_HEX_FMT2 "%016lX"
+# endif
+
+/*
+ * This is where the long long data type is 64 bits, but long is 32. For
+ * machines where there are 64bit registers, this is the mode to use. IRIX,
+ * on R4000 and above should use this mode, along with the relevant assembler
+ * code :-). Do NOT define BN_LLONG.
+ */
+# ifdef SIXTY_FOUR_BIT
+# undef BN_LLONG
+# undef BN_ULLONG
+# define BN_ULONG unsigned long long
+# define BN_LONG long long
+# define BN_BITS 128
+# define BN_BYTES 8
+# define BN_BITS2 64
+# define BN_BITS4 32
+# define BN_MASK2 (0xffffffffffffffffLL)
+# define BN_MASK2l (0xffffffffL)
+# define BN_MASK2h (0xffffffff00000000LL)
+# define BN_MASK2h1 (0xffffffff80000000LL)
+# define BN_TBIT (0x8000000000000000LL)
+# define BN_DEC_CONV (10000000000000000000ULL)
+# define BN_DEC_FMT1 "%llu"
+# define BN_DEC_FMT2 "%019llu"
+# define BN_DEC_NUM 19
+# define BN_HEX_FMT1 "%llX"
+# define BN_HEX_FMT2 "%016llX"
+# endif
+
+# ifdef THIRTY_TWO_BIT
+# ifdef BN_LLONG
+# if defined(_WIN32) && !defined(__GNUC__)
+# define BN_ULLONG unsigned __int64
+# define BN_MASK (0xffffffffffffffffI64)
+# else
+# define BN_ULLONG unsigned long long
+# define BN_MASK (0xffffffffffffffffLL)
+# endif
+# endif
+# define BN_ULONG unsigned int
+# define BN_LONG int
+# define BN_BITS 64
+# define BN_BYTES 4
+# define BN_BITS2 32
+# define BN_BITS4 16
+# define BN_MASK2 (0xffffffffL)
+# define BN_MASK2l (0xffff)
+# define BN_MASK2h1 (0xffff8000L)
+# define BN_MASK2h (0xffff0000L)
+# define BN_TBIT (0x80000000L)
+# define BN_DEC_CONV (1000000000L)
+# define BN_DEC_FMT1 "%u"
+# define BN_DEC_FMT2 "%09u"
+# define BN_DEC_NUM 9
+# define BN_HEX_FMT1 "%X"
+# define BN_HEX_FMT2 "%08X"
+# endif
+
+# define BN_DEFAULT_BITS 1280
+
+# define BN_FLG_MALLOCED 0x01
+# define BN_FLG_STATIC_DATA 0x02
+
+/*
+ * avoid leaking exponent information through timing,
+ * BN_mod_exp_mont() will call BN_mod_exp_mont_consttime,
+ * BN_div() will call BN_div_no_branch,
+ * BN_mod_inverse() will call BN_mod_inverse_no_branch.
+ */
+# define BN_FLG_CONSTTIME 0x04
+
+# ifdef OPENSSL_NO_DEPRECATED
+/* deprecated name for the flag */
+# define BN_FLG_EXP_CONSTTIME BN_FLG_CONSTTIME
+/*
+ * avoid leaking exponent information through timings
+ * (BN_mod_exp_mont() will call BN_mod_exp_mont_consttime)
+ */
+# endif
+
+# ifndef OPENSSL_NO_DEPRECATED
+# define BN_FLG_FREE 0x8000
+ /* used for debuging */
+# endif
+# define BN_set_flags(b,n) ((b)->flags|=(n))
+# define BN_get_flags(b,n) ((b)->flags&(n))
+
+/*
+ * get a clone of a BIGNUM with changed flags, for *temporary* use only (the
+ * two BIGNUMs cannot not be used in parallel!)
+ */
+# define BN_with_flags(dest,b,n) ((dest)->d=(b)->d, \
+ (dest)->top=(b)->top, \
+ (dest)->dmax=(b)->dmax, \
+ (dest)->neg=(b)->neg, \
+ (dest)->flags=(((dest)->flags & BN_FLG_MALLOCED) \
+ | ((b)->flags & ~BN_FLG_MALLOCED) \
+ | BN_FLG_STATIC_DATA \
+ | (n)))
+
+/* Already declared in ossl_typ.h */
+# if 0
+typedef struct bignum_st BIGNUM;
+/* Used for temp variables (declaration hidden in bn_lcl.h) */
+typedef struct bignum_ctx BN_CTX;
+typedef struct bn_blinding_st BN_BLINDING;
+typedef struct bn_mont_ctx_st BN_MONT_CTX;
+typedef struct bn_recp_ctx_st BN_RECP_CTX;
+typedef struct bn_gencb_st BN_GENCB;
+# endif
+
+struct bignum_st {
+ BN_ULONG *d; /* Pointer to an array of 'BN_BITS2' bit
+ * chunks. */
+ int top; /* Index of last used d +1. */
+ /* The next are internal book keeping for bn_expand. */
+ int dmax; /* Size of the d array. */
+ int neg; /* one if the number is negative */
+ int flags;
+};
+
+/* Used for montgomery multiplication */
+struct bn_mont_ctx_st {
+ int ri; /* number of bits in R */
+ BIGNUM RR; /* used to convert to montgomery form */
+ BIGNUM N; /* The modulus */
+ BIGNUM Ni; /* R*(1/R mod N) - N*Ni = 1 (Ni is only
+ * stored for bignum algorithm) */
+ BN_ULONG n0[2]; /* least significant word(s) of Ni; (type
+ * changed with 0.9.9, was "BN_ULONG n0;"
+ * before) */
+ int flags;
+};
+
+/*
+ * Used for reciprocal division/mod functions It cannot be shared between
+ * threads
+ */
+struct bn_recp_ctx_st {
+ BIGNUM N; /* the divisor */
+ BIGNUM Nr; /* the reciprocal */
+ int num_bits;
+ int shift;
+ int flags;
+};
+
+/* Used for slow "generation" functions. */
+struct bn_gencb_st {
+ unsigned int ver; /* To handle binary (in)compatibility */
+ void *arg; /* callback-specific data */
+ union {
+ /* if(ver==1) - handles old style callbacks */
+ void (*cb_1) (int, int, void *);
+ /* if(ver==2) - new callback style */
+ int (*cb_2) (int, int, BN_GENCB *);
+ } cb;
+};
+/* Wrapper function to make using BN_GENCB easier, */
+int BN_GENCB_call(BN_GENCB *cb, int a, int b);
+/* Macro to populate a BN_GENCB structure with an "old"-style callback */
+# define BN_GENCB_set_old(gencb, callback, cb_arg) { \
+ BN_GENCB *tmp_gencb = (gencb); \
+ tmp_gencb->ver = 1; \
+ tmp_gencb->arg = (cb_arg); \
+ tmp_gencb->cb.cb_1 = (callback); }
+/* Macro to populate a BN_GENCB structure with a "new"-style callback */
+# define BN_GENCB_set(gencb, callback, cb_arg) { \
+ BN_GENCB *tmp_gencb = (gencb); \
+ tmp_gencb->ver = 2; \
+ tmp_gencb->arg = (cb_arg); \
+ tmp_gencb->cb.cb_2 = (callback); }
+
+# define BN_prime_checks 0 /* default: select number of iterations based
+ * on the size of the number */
+
+/*
+ * number of Miller-Rabin iterations for an error rate of less than 2^-80 for
+ * random 'b'-bit input, b >= 100 (taken from table 4.4 in the Handbook of
+ * Applied Cryptography [Menezes, van Oorschot, Vanstone; CRC Press 1996];
+ * original paper: Damgaard, Landrock, Pomerance: Average case error
+ * estimates for the strong probable prime test. -- Math. Comp. 61 (1993)
+ * 177-194)
+ */
+# define BN_prime_checks_for_size(b) ((b) >= 1300 ? 2 : \
+ (b) >= 850 ? 3 : \
+ (b) >= 650 ? 4 : \
+ (b) >= 550 ? 5 : \
+ (b) >= 450 ? 6 : \
+ (b) >= 400 ? 7 : \
+ (b) >= 350 ? 8 : \
+ (b) >= 300 ? 9 : \
+ (b) >= 250 ? 12 : \
+ (b) >= 200 ? 15 : \
+ (b) >= 150 ? 18 : \
+ /* b >= 100 */ 27)
+
+# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
+
+/* Note that BN_abs_is_word didn't work reliably for w == 0 until 0.9.8 */
+# define BN_abs_is_word(a,w) ((((a)->top == 1) && ((a)->d[0] == (BN_ULONG)(w))) || \
+ (((w) == 0) && ((a)->top == 0)))
+# define BN_is_zero(a) ((a)->top == 0)
+# define BN_is_one(a) (BN_abs_is_word((a),1) && !(a)->neg)
+# define BN_is_word(a,w) (BN_abs_is_word((a),(w)) && (!(w) || !(a)->neg))
+# define BN_is_odd(a) (((a)->top > 0) && ((a)->d[0] & 1))
+
+# define BN_one(a) (BN_set_word((a),1))
+# define BN_zero_ex(a) \
+ do { \
+ BIGNUM *_tmp_bn = (a); \
+ _tmp_bn->top = 0; \
+ _tmp_bn->neg = 0; \
+ } while(0)
+# ifdef OPENSSL_NO_DEPRECATED
+# define BN_zero(a) BN_zero_ex(a)
+# else
+# define BN_zero(a) (BN_set_word((a),0))
+# endif
+
+const BIGNUM *BN_value_one(void);
+char *BN_options(void);
+BN_CTX *BN_CTX_new(void);
+# ifndef OPENSSL_NO_DEPRECATED
+void BN_CTX_init(BN_CTX *c);
+# endif
+void BN_CTX_free(BN_CTX *c);
+void BN_CTX_start(BN_CTX *ctx);
+BIGNUM *BN_CTX_get(BN_CTX *ctx);
+void BN_CTX_end(BN_CTX *ctx);
+int BN_rand(BIGNUM *rnd, int bits, int top, int bottom);
+int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom);
+int BN_rand_range(BIGNUM *rnd, const BIGNUM *range);
+int BN_pseudo_rand_range(BIGNUM *rnd, const BIGNUM *range);
+int BN_num_bits(const BIGNUM *a);
+int BN_num_bits_word(BN_ULONG);
+BIGNUM *BN_new(void);
+void BN_init(BIGNUM *);
+void BN_clear_free(BIGNUM *a);
+BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b);
+void BN_swap(BIGNUM *a, BIGNUM *b);
+BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret);
+int BN_bn2bin(const BIGNUM *a, unsigned char *to);
+BIGNUM *BN_mpi2bn(const unsigned char *s, int len, BIGNUM *ret);
+int BN_bn2mpi(const BIGNUM *a, unsigned char *to);
+int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
+int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
+int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
+int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
+int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
+int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx);
+/** BN_set_negative sets sign of a BIGNUM
+ * \param b pointer to the BIGNUM object
+ * \param n 0 if the BIGNUM b should be positive and a value != 0 otherwise
+ */
+void BN_set_negative(BIGNUM *b, int n);
+/** BN_is_negative returns 1 if the BIGNUM is negative
+ * \param a pointer to the BIGNUM object
+ * \return 1 if a < 0 and 0 otherwise
+ */
+# define BN_is_negative(a) ((a)->neg != 0)
+
+int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
+ BN_CTX *ctx);
+# define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
+int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx);
+int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
+ BN_CTX *ctx);
+int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+ const BIGNUM *m);
+int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
+ BN_CTX *ctx);
+int BN_mod_sub_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+ const BIGNUM *m);
+int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
+ BN_CTX *ctx);
+int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
+int BN_mod_lshift1(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
+int BN_mod_lshift1_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *m);
+int BN_mod_lshift(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m,
+ BN_CTX *ctx);
+int BN_mod_lshift_quick(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m);
+
+BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w);
+BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w);
+int BN_mul_word(BIGNUM *a, BN_ULONG w);
+int BN_add_word(BIGNUM *a, BN_ULONG w);
+int BN_sub_word(BIGNUM *a, BN_ULONG w);
+int BN_set_word(BIGNUM *a, BN_ULONG w);
+BN_ULONG BN_get_word(const BIGNUM *a);
+
+int BN_cmp(const BIGNUM *a, const BIGNUM *b);
+void BN_free(BIGNUM *a);
+int BN_is_bit_set(const BIGNUM *a, int n);
+int BN_lshift(BIGNUM *r, const BIGNUM *a, int n);
+int BN_lshift1(BIGNUM *r, const BIGNUM *a);
+int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
+
+int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
+ const BIGNUM *m, BN_CTX *ctx);
+int BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
+ const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
+int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
+ const BIGNUM *m, BN_CTX *ctx,
+ BN_MONT_CTX *in_mont);
+int BN_mod_exp_mont_word(BIGNUM *r, BN_ULONG a, const BIGNUM *p,
+ const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
+int BN_mod_exp2_mont(BIGNUM *r, const BIGNUM *a1, const BIGNUM *p1,
+ const BIGNUM *a2, const BIGNUM *p2, const BIGNUM *m,
+ BN_CTX *ctx, BN_MONT_CTX *m_ctx);
+int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
+ const BIGNUM *m, BN_CTX *ctx);
+
+int BN_mask_bits(BIGNUM *a, int n);
+# ifndef OPENSSL_NO_FP_API
+int BN_print_fp(FILE *fp, const BIGNUM *a);
+# endif
+# ifdef HEADER_BIO_H
+int BN_print(BIO *fp, const BIGNUM *a);
+# else
+int BN_print(void *fp, const BIGNUM *a);
+# endif
+int BN_reciprocal(BIGNUM *r, const BIGNUM *m, int len, BN_CTX *ctx);
+int BN_rshift(BIGNUM *r, const BIGNUM *a, int n);
+int BN_rshift1(BIGNUM *r, const BIGNUM *a);
+void BN_clear(BIGNUM *a);
+BIGNUM *BN_dup(const BIGNUM *a);
+int BN_ucmp(const BIGNUM *a, const BIGNUM *b);
+int BN_set_bit(BIGNUM *a, int n);
+int BN_clear_bit(BIGNUM *a, int n);
+char *BN_bn2hex(const BIGNUM *a);
+char *BN_bn2dec(const BIGNUM *a);
+int BN_hex2bn(BIGNUM **a, const char *str);
+int BN_dec2bn(BIGNUM **a, const char *str);
+int BN_asc2bn(BIGNUM **a, const char *str);
+int BN_gcd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
+int BN_kronecker(const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); /* returns
+ * -2 for
+ * error */
+BIGNUM *BN_mod_inverse(BIGNUM *ret,
+ const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx);
+BIGNUM *BN_mod_sqrt(BIGNUM *ret,
+ const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx);
+
+void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords);
+
+/* Deprecated versions */
+# ifndef OPENSSL_NO_DEPRECATED
+BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe,
+ const BIGNUM *add, const BIGNUM *rem,
+ void (*callback) (int, int, void *), void *cb_arg);
+int BN_is_prime(const BIGNUM *p, int nchecks,
+ void (*callback) (int, int, void *),
+ BN_CTX *ctx, void *cb_arg);
+int BN_is_prime_fasttest(const BIGNUM *p, int nchecks,
+ void (*callback) (int, int, void *), BN_CTX *ctx,
+ void *cb_arg, int do_trial_division);
+# endif /* !defined(OPENSSL_NO_DEPRECATED) */
+
+/* Newer versions */
+int BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, const BIGNUM *add,
+ const BIGNUM *rem, BN_GENCB *cb);
+int BN_is_prime_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx, BN_GENCB *cb);
+int BN_is_prime_fasttest_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx,
+ int do_trial_division, BN_GENCB *cb);
+
+int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx);
+
+int BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
+ const BIGNUM *Xp, const BIGNUM *Xp1,
+ const BIGNUM *Xp2, const BIGNUM *e, BN_CTX *ctx,
+ BN_GENCB *cb);
+int BN_X931_generate_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, BIGNUM *Xp1,
+ BIGNUM *Xp2, const BIGNUM *Xp, const BIGNUM *e,
+ BN_CTX *ctx, BN_GENCB *cb);
+
+BN_MONT_CTX *BN_MONT_CTX_new(void);
+void BN_MONT_CTX_init(BN_MONT_CTX *ctx);
+int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+ BN_MONT_CTX *mont, BN_CTX *ctx);
+# define BN_to_montgomery(r,a,mont,ctx) BN_mod_mul_montgomery(\
+ (r),(a),&((mont)->RR),(mont),(ctx))
+int BN_from_montgomery(BIGNUM *r, const BIGNUM *a,
+ BN_MONT_CTX *mont, BN_CTX *ctx);
+void BN_MONT_CTX_free(BN_MONT_CTX *mont);
+int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx);
+BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, BN_MONT_CTX *from);
+BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock,
+ const BIGNUM *mod, BN_CTX *ctx);
+
+/* BN_BLINDING flags */
+# define BN_BLINDING_NO_UPDATE 0x00000001
+# define BN_BLINDING_NO_RECREATE 0x00000002
+
+BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod);
+void BN_BLINDING_free(BN_BLINDING *b);
+int BN_BLINDING_update(BN_BLINDING *b, BN_CTX *ctx);
+int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx);
+int BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx);
+int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *);
+int BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b,
+ BN_CTX *);
+# ifndef OPENSSL_NO_DEPRECATED
+unsigned long BN_BLINDING_get_thread_id(const BN_BLINDING *);
+void BN_BLINDING_set_thread_id(BN_BLINDING *, unsigned long);
+# endif
+CRYPTO_THREADID *BN_BLINDING_thread_id(BN_BLINDING *);
+unsigned long BN_BLINDING_get_flags(const BN_BLINDING *);
+void BN_BLINDING_set_flags(BN_BLINDING *, unsigned long);
+BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b,
+ const BIGNUM *e, BIGNUM *m, BN_CTX *ctx,
+ int (*bn_mod_exp) (BIGNUM *r,
+ const BIGNUM *a,
+ const BIGNUM *p,
+ const BIGNUM *m,
+ BN_CTX *ctx,
+ BN_MONT_CTX *m_ctx),
+ BN_MONT_CTX *m_ctx);
+
+# ifndef OPENSSL_NO_DEPRECATED
+void BN_set_params(int mul, int high, int low, int mont);
+int BN_get_params(int which); /* 0, mul, 1 high, 2 low, 3 mont */
+# endif
+
+void BN_RECP_CTX_init(BN_RECP_CTX *recp);
+BN_RECP_CTX *BN_RECP_CTX_new(void);
+void BN_RECP_CTX_free(BN_RECP_CTX *recp);
+int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *rdiv, BN_CTX *ctx);
+int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y,
+ BN_RECP_CTX *recp, BN_CTX *ctx);
+int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
+ const BIGNUM *m, BN_CTX *ctx);
+int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m,
+ BN_RECP_CTX *recp, BN_CTX *ctx);
+
+# ifndef OPENSSL_NO_EC2M
+
+/*
+ * Functions for arithmetic over binary polynomials represented by BIGNUMs.
+ * The BIGNUM::neg property of BIGNUMs representing binary polynomials is
+ * ignored. Note that input arguments are not const so that their bit arrays
+ * can be expanded to the appropriate size if needed.
+ */
+
+/*
+ * r = a + b
+ */
+int BN_GF2m_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
+# define BN_GF2m_sub(r, a, b) BN_GF2m_add(r, a, b)
+/*
+ * r=a mod p
+ */
+int BN_GF2m_mod(BIGNUM *r, const BIGNUM *a, const BIGNUM *p);
+/* r = (a * b) mod p */
+int BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+ const BIGNUM *p, BN_CTX *ctx);
+/* r = (a * a) mod p */
+int BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
+/* r = (1 / b) mod p */
+int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *b, const BIGNUM *p, BN_CTX *ctx);
+/* r = (a / b) mod p */
+int BN_GF2m_mod_div(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+ const BIGNUM *p, BN_CTX *ctx);
+/* r = (a ^ b) mod p */
+int BN_GF2m_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+ const BIGNUM *p, BN_CTX *ctx);
+/* r = sqrt(a) mod p */
+int BN_GF2m_mod_sqrt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
+ BN_CTX *ctx);
+/* r^2 + r = a mod p */
+int BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
+ BN_CTX *ctx);
+# define BN_GF2m_cmp(a, b) BN_ucmp((a), (b))
+/*-
+ * Some functions allow for representation of the irreducible polynomials
+ * as an unsigned int[], say p. The irreducible f(t) is then of the form:
+ * t^p[0] + t^p[1] + ... + t^p[k]
+ * where m = p[0] > p[1] > ... > p[k] = 0.
+ */
+/* r = a mod p */
+int BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const int p[]);
+/* r = (a * b) mod p */
+int BN_GF2m_mod_mul_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+ const int p[], BN_CTX *ctx);
+/* r = (a * a) mod p */
+int BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const int p[],
+ BN_CTX *ctx);
+/* r = (1 / b) mod p */
+int BN_GF2m_mod_inv_arr(BIGNUM *r, const BIGNUM *b, const int p[],
+ BN_CTX *ctx);
+/* r = (a / b) mod p */
+int BN_GF2m_mod_div_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+ const int p[], BN_CTX *ctx);
+/* r = (a ^ b) mod p */
+int BN_GF2m_mod_exp_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+ const int p[], BN_CTX *ctx);
+/* r = sqrt(a) mod p */
+int BN_GF2m_mod_sqrt_arr(BIGNUM *r, const BIGNUM *a,
+ const int p[], BN_CTX *ctx);
+/* r^2 + r = a mod p */
+int BN_GF2m_mod_solve_quad_arr(BIGNUM *r, const BIGNUM *a,
+ const int p[], BN_CTX *ctx);
+int BN_GF2m_poly2arr(const BIGNUM *a, int p[], int max);
+int BN_GF2m_arr2poly(const int p[], BIGNUM *a);
+
+# endif
+
+/*
+ * faster mod functions for the 'NIST primes' 0 <= a < p^2
+ */
+int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
+int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
+int BN_nist_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
+int BN_nist_mod_384(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
+int BN_nist_mod_521(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
+
+const BIGNUM *BN_get0_nist_prime_192(void);
+const BIGNUM *BN_get0_nist_prime_224(void);
+const BIGNUM *BN_get0_nist_prime_256(void);
+const BIGNUM *BN_get0_nist_prime_384(void);
+const BIGNUM *BN_get0_nist_prime_521(void);
+
+/* library internal functions */
+
+# define bn_expand(a,bits) ((((((bits+BN_BITS2-1))/BN_BITS2)) <= (a)->dmax)?\
+ (a):bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2))
+# define bn_wexpand(a,words) (((words) <= (a)->dmax)?(a):bn_expand2((a),(words)))
+BIGNUM *bn_expand2(BIGNUM *a, int words);
+# ifndef OPENSSL_NO_DEPRECATED
+BIGNUM *bn_dup_expand(const BIGNUM *a, int words); /* unused */
+# endif
+
+/*-
+ * Bignum consistency macros
+ * There is one "API" macro, bn_fix_top(), for stripping leading zeroes from
+ * bignum data after direct manipulations on the data. There is also an
+ * "internal" macro, bn_check_top(), for verifying that there are no leading
+ * zeroes. Unfortunately, some auditing is required due to the fact that
+ * bn_fix_top() has become an overabused duct-tape because bignum data is
+ * occasionally passed around in an inconsistent state. So the following
+ * changes have been made to sort this out;
+ * - bn_fix_top()s implementation has been moved to bn_correct_top()
+ * - if BN_DEBUG isn't defined, bn_fix_top() maps to bn_correct_top(), and
+ * bn_check_top() is as before.
+ * - if BN_DEBUG *is* defined;
+ * - bn_check_top() tries to pollute unused words even if the bignum 'top' is
+ * consistent. (ed: only if BN_DEBUG_RAND is defined)
+ * - bn_fix_top() maps to bn_check_top() rather than "fixing" anything.
+ * The idea is to have debug builds flag up inconsistent bignums when they
+ * occur. If that occurs in a bn_fix_top(), we examine the code in question; if
+ * the use of bn_fix_top() was appropriate (ie. it follows directly after code
+ * that manipulates the bignum) it is converted to bn_correct_top(), and if it
+ * was not appropriate, we convert it permanently to bn_check_top() and track
+ * down the cause of the bug. Eventually, no internal code should be using the
+ * bn_fix_top() macro. External applications and libraries should try this with
+ * their own code too, both in terms of building against the openssl headers
+ * with BN_DEBUG defined *and* linking with a version of OpenSSL built with it
+ * defined. This not only improves external code, it provides more test
+ * coverage for openssl's own code.
+ */
+
+# ifdef BN_DEBUG
+
+/* We only need assert() when debugging */
+# include <assert.h>
+
+# ifdef BN_DEBUG_RAND
+/* To avoid "make update" cvs wars due to BN_DEBUG, use some tricks */
+# ifndef RAND_pseudo_bytes
+int RAND_pseudo_bytes(unsigned char *buf, int num);
+# define BN_DEBUG_TRIX
+# endif
+# define bn_pollute(a) \
+ do { \
+ const BIGNUM *_bnum1 = (a); \
+ if(_bnum1->top < _bnum1->dmax) { \
+ unsigned char _tmp_char; \
+ /* We cast away const without the compiler knowing, any \
+ * *genuinely* constant variables that aren't mutable \
+ * wouldn't be constructed with top!=dmax. */ \
+ BN_ULONG *_not_const; \
+ memcpy(&_not_const, &_bnum1->d, sizeof(BN_ULONG*)); \
+ /* Debug only - safe to ignore error return */ \
+ RAND_pseudo_bytes(&_tmp_char, 1); \
+ memset((unsigned char *)(_not_const + _bnum1->top), _tmp_char, \
+ (_bnum1->dmax - _bnum1->top) * sizeof(BN_ULONG)); \
+ } \
+ } while(0)
+# ifdef BN_DEBUG_TRIX
+# undef RAND_pseudo_bytes
+# endif
+# else
+# define bn_pollute(a)
+# endif
+# define bn_check_top(a) \
+ do { \
+ const BIGNUM *_bnum2 = (a); \
+ if (_bnum2 != NULL) { \
+ assert((_bnum2->top == 0) || \
+ (_bnum2->d[_bnum2->top - 1] != 0)); \
+ bn_pollute(_bnum2); \
+ } \
+ } while(0)
+
+# define bn_fix_top(a) bn_check_top(a)
+
+# define bn_check_size(bn, bits) bn_wcheck_size(bn, ((bits+BN_BITS2-1))/BN_BITS2)
+# define bn_wcheck_size(bn, words) \
+ do { \
+ const BIGNUM *_bnum2 = (bn); \
+ assert((words) <= (_bnum2)->dmax && (words) >= (_bnum2)->top); \
+ /* avoid unused variable warning with NDEBUG */ \
+ (void)(_bnum2); \
+ } while(0)
+
+# else /* !BN_DEBUG */
+
+# define bn_pollute(a)
+# define bn_check_top(a)
+# define bn_fix_top(a) bn_correct_top(a)
+# define bn_check_size(bn, bits)
+# define bn_wcheck_size(bn, words)
+
+# endif
+
+# define bn_correct_top(a) \
+ { \
+ BN_ULONG *ftl; \
+ int tmp_top = (a)->top; \
+ if (tmp_top > 0) \
+ { \
+ for (ftl= &((a)->d[tmp_top-1]); tmp_top > 0; tmp_top--) \
+ if (*(ftl--)) break; \
+ (a)->top = tmp_top; \
+ } \
+ bn_pollute(a); \
+ }
+
+BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num,
+ BN_ULONG w);
+BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w);
+void bn_sqr_words(BN_ULONG *rp, const BN_ULONG *ap, int num);
+BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d);
+BN_ULONG bn_add_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
+ int num);
+BN_ULONG bn_sub_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
+ int num);
+
+/* Primes from RFC 2409 */
+BIGNUM *get_rfc2409_prime_768(BIGNUM *bn);
+BIGNUM *get_rfc2409_prime_1024(BIGNUM *bn);
+
+/* Primes from RFC 3526 */
+BIGNUM *get_rfc3526_prime_1536(BIGNUM *bn);
+BIGNUM *get_rfc3526_prime_2048(BIGNUM *bn);
+BIGNUM *get_rfc3526_prime_3072(BIGNUM *bn);
+BIGNUM *get_rfc3526_prime_4096(BIGNUM *bn);
+BIGNUM *get_rfc3526_prime_6144(BIGNUM *bn);
+BIGNUM *get_rfc3526_prime_8192(BIGNUM *bn);
+
+int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_BN_strings(void);
+
+/* Error codes for the BN functions. */
+
+/* Function codes. */
+# define BN_F_BNRAND 127
+# define BN_F_BN_BLINDING_CONVERT_EX 100
+# define BN_F_BN_BLINDING_CREATE_PARAM 128
+# define BN_F_BN_BLINDING_INVERT_EX 101
+# define BN_F_BN_BLINDING_NEW 102
+# define BN_F_BN_BLINDING_UPDATE 103
+# define BN_F_BN_BN2DEC 104
+# define BN_F_BN_BN2HEX 105
+# define BN_F_BN_CTX_GET 116
+# define BN_F_BN_CTX_NEW 106
+# define BN_F_BN_CTX_START 129
+# define BN_F_BN_DIV 107
+# define BN_F_BN_DIV_NO_BRANCH 138
+# define BN_F_BN_DIV_RECP 130
+# define BN_F_BN_EXP 123
+# define BN_F_BN_EXPAND2 108
+# define BN_F_BN_EXPAND_INTERNAL 120
+# define BN_F_BN_GF2M_MOD 131
+# define BN_F_BN_GF2M_MOD_EXP 132
+# define BN_F_BN_GF2M_MOD_MUL 133
+# define BN_F_BN_GF2M_MOD_SOLVE_QUAD 134
+# define BN_F_BN_GF2M_MOD_SOLVE_QUAD_ARR 135
+# define BN_F_BN_GF2M_MOD_SQR 136
+# define BN_F_BN_GF2M_MOD_SQRT 137
+# define BN_F_BN_LSHIFT 145
+# define BN_F_BN_MOD_EXP2_MONT 118
+# define BN_F_BN_MOD_EXP_MONT 109
+# define BN_F_BN_MOD_EXP_MONT_CONSTTIME 124
+# define BN_F_BN_MOD_EXP_MONT_WORD 117
+# define BN_F_BN_MOD_EXP_RECP 125
+# define BN_F_BN_MOD_EXP_SIMPLE 126
+# define BN_F_BN_MOD_INVERSE 110
+# define BN_F_BN_MOD_INVERSE_NO_BRANCH 139
+# define BN_F_BN_MOD_LSHIFT_QUICK 119
+# define BN_F_BN_MOD_MUL_RECIPROCAL 111
+# define BN_F_BN_MOD_SQRT 121
+# define BN_F_BN_MPI2BN 112
+# define BN_F_BN_NEW 113
+# define BN_F_BN_RAND 114
+# define BN_F_BN_RAND_RANGE 122
+# define BN_F_BN_RSHIFT 146
+# define BN_F_BN_USUB 115
+
+/* Reason codes. */
+# define BN_R_ARG2_LT_ARG3 100
+# define BN_R_BAD_RECIPROCAL 101
+# define BN_R_BIGNUM_TOO_LONG 114
+# define BN_R_BITS_TOO_SMALL 118
+# define BN_R_CALLED_WITH_EVEN_MODULUS 102
+# define BN_R_DIV_BY_ZERO 103
+# define BN_R_ENCODING_ERROR 104
+# define BN_R_EXPAND_ON_STATIC_BIGNUM_DATA 105
+# define BN_R_INPUT_NOT_REDUCED 110
+# define BN_R_INVALID_LENGTH 106
+# define BN_R_INVALID_RANGE 115
+# define BN_R_INVALID_SHIFT 119
+# define BN_R_NOT_A_SQUARE 111
+# define BN_R_NOT_INITIALIZED 107
+# define BN_R_NO_INVERSE 108
+# define BN_R_NO_SOLUTION 116
+# define BN_R_P_IS_NOT_PRIME 112
+# define BN_R_TOO_MANY_ITERATIONS 113
+# define BN_R_TOO_MANY_TEMPORARY_VARIABLES 109
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/buffer.h b/protocols/Telegram/tgl/openssl/include/openssl/buffer.h
new file mode 100644
index 0000000000..c343dd772f
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/buffer.h
@@ -0,0 +1,119 @@
+/* crypto/buffer/buffer.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_BUFFER_H
+# define HEADER_BUFFER_H
+
+# include <openssl/ossl_typ.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# include <stddef.h>
+
+# if !defined(NO_SYS_TYPES_H)
+# include <sys/types.h>
+# endif
+
+/* Already declared in ossl_typ.h */
+/* typedef struct buf_mem_st BUF_MEM; */
+
+struct buf_mem_st {
+ size_t length; /* current number of bytes */
+ char *data;
+ size_t max; /* size of buffer */
+};
+
+BUF_MEM *BUF_MEM_new(void);
+void BUF_MEM_free(BUF_MEM *a);
+int BUF_MEM_grow(BUF_MEM *str, size_t len);
+int BUF_MEM_grow_clean(BUF_MEM *str, size_t len);
+size_t BUF_strnlen(const char *str, size_t maxlen);
+char *BUF_strdup(const char *str);
+char *BUF_strndup(const char *str, size_t siz);
+void *BUF_memdup(const void *data, size_t siz);
+void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz);
+
+/* safe string functions */
+size_t BUF_strlcpy(char *dst, const char *src, size_t siz);
+size_t BUF_strlcat(char *dst, const char *src, size_t siz);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_BUF_strings(void);
+
+/* Error codes for the BUF functions. */
+
+/* Function codes. */
+# define BUF_F_BUF_MEMDUP 103
+# define BUF_F_BUF_MEM_GROW 100
+# define BUF_F_BUF_MEM_GROW_CLEAN 105
+# define BUF_F_BUF_MEM_NEW 101
+# define BUF_F_BUF_STRDUP 102
+# define BUF_F_BUF_STRNDUP 104
+
+/* Reason codes. */
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/camellia.h b/protocols/Telegram/tgl/openssl/include/openssl/camellia.h
new file mode 100644
index 0000000000..9be7c0fd99
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/camellia.h
@@ -0,0 +1,132 @@
+/* crypto/camellia/camellia.h -*- mode:C; c-file-style: "eay" -*- */
+/* ====================================================================
+ * Copyright (c) 2006 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ */
+
+#ifndef HEADER_CAMELLIA_H
+# define HEADER_CAMELLIA_H
+
+# include <openssl/opensslconf.h>
+
+# ifdef OPENSSL_NO_CAMELLIA
+# error CAMELLIA is disabled.
+# endif
+
+# include <stddef.h>
+
+# define CAMELLIA_ENCRYPT 1
+# define CAMELLIA_DECRYPT 0
+
+/*
+ * Because array size can't be a const in C, the following two are macros.
+ * Both sizes are in bytes.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* This should be a hidden type, but EVP requires that the size be known */
+
+# define CAMELLIA_BLOCK_SIZE 16
+# define CAMELLIA_TABLE_BYTE_LEN 272
+# define CAMELLIA_TABLE_WORD_LEN (CAMELLIA_TABLE_BYTE_LEN / 4)
+
+typedef unsigned int KEY_TABLE_TYPE[CAMELLIA_TABLE_WORD_LEN]; /* to match
+ * with WORD */
+
+struct camellia_key_st {
+ union {
+ double d; /* ensures 64-bit align */
+ KEY_TABLE_TYPE rd_key;
+ } u;
+ int grand_rounds;
+};
+typedef struct camellia_key_st CAMELLIA_KEY;
+
+# ifdef OPENSSL_FIPS
+int private_Camellia_set_key(const unsigned char *userKey, const int bits,
+ CAMELLIA_KEY *key);
+# endif
+int Camellia_set_key(const unsigned char *userKey, const int bits,
+ CAMELLIA_KEY *key);
+
+void Camellia_encrypt(const unsigned char *in, unsigned char *out,
+ const CAMELLIA_KEY *key);
+void Camellia_decrypt(const unsigned char *in, unsigned char *out,
+ const CAMELLIA_KEY *key);
+
+void Camellia_ecb_encrypt(const unsigned char *in, unsigned char *out,
+ const CAMELLIA_KEY *key, const int enc);
+void Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const CAMELLIA_KEY *key,
+ unsigned char *ivec, const int enc);
+void Camellia_cfb128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const CAMELLIA_KEY *key,
+ unsigned char *ivec, int *num, const int enc);
+void Camellia_cfb1_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const CAMELLIA_KEY *key,
+ unsigned char *ivec, int *num, const int enc);
+void Camellia_cfb8_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const CAMELLIA_KEY *key,
+ unsigned char *ivec, int *num, const int enc);
+void Camellia_ofb128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const CAMELLIA_KEY *key,
+ unsigned char *ivec, int *num);
+void Camellia_ctr128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const CAMELLIA_KEY *key,
+ unsigned char ivec[CAMELLIA_BLOCK_SIZE],
+ unsigned char ecount_buf[CAMELLIA_BLOCK_SIZE],
+ unsigned int *num);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !HEADER_Camellia_H */
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/cast.h b/protocols/Telegram/tgl/openssl/include/openssl/cast.h
new file mode 100644
index 0000000000..0003ec9c7c
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/cast.h
@@ -0,0 +1,107 @@
+/* crypto/cast/cast.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_CAST_H
+# define HEADER_CAST_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# include <openssl/opensslconf.h>
+
+# ifdef OPENSSL_NO_CAST
+# error CAST is disabled.
+# endif
+
+# define CAST_ENCRYPT 1
+# define CAST_DECRYPT 0
+
+# define CAST_LONG unsigned int
+
+# define CAST_BLOCK 8
+# define CAST_KEY_LENGTH 16
+
+typedef struct cast_key_st {
+ CAST_LONG data[32];
+ int short_key; /* Use reduced rounds for short key */
+} CAST_KEY;
+
+# ifdef OPENSSL_FIPS
+void private_CAST_set_key(CAST_KEY *key, int len, const unsigned char *data);
+# endif
+void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data);
+void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out,
+ const CAST_KEY *key, int enc);
+void CAST_encrypt(CAST_LONG *data, const CAST_KEY *key);
+void CAST_decrypt(CAST_LONG *data, const CAST_KEY *key);
+void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out,
+ long length, const CAST_KEY *ks, unsigned char *iv,
+ int enc);
+void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, const CAST_KEY *schedule,
+ unsigned char *ivec, int *num, int enc);
+void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, const CAST_KEY *schedule,
+ unsigned char *ivec, int *num);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/cmac.h b/protocols/Telegram/tgl/openssl/include/openssl/cmac.h
new file mode 100644
index 0000000000..175be8348a
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/cmac.h
@@ -0,0 +1,82 @@
+/* crypto/cmac/cmac.h */
+/*
+ * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
+ * project.
+ */
+/* ====================================================================
+ * Copyright (c) 2010 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ */
+
+#ifndef HEADER_CMAC_H
+# define HEADER_CMAC_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# include <openssl/evp.h>
+
+/* Opaque */
+typedef struct CMAC_CTX_st CMAC_CTX;
+
+CMAC_CTX *CMAC_CTX_new(void);
+void CMAC_CTX_cleanup(CMAC_CTX *ctx);
+void CMAC_CTX_free(CMAC_CTX *ctx);
+EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx);
+int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in);
+
+int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen,
+ const EVP_CIPHER *cipher, ENGINE *impl);
+int CMAC_Update(CMAC_CTX *ctx, const void *data, size_t dlen);
+int CMAC_Final(CMAC_CTX *ctx, unsigned char *out, size_t *poutlen);
+int CMAC_resume(CMAC_CTX *ctx);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/cms.h b/protocols/Telegram/tgl/openssl/include/openssl/cms.h
new file mode 100644
index 0000000000..e6c7f964bf
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/cms.h
@@ -0,0 +1,555 @@
+/* crypto/cms/cms.h */
+/*
+ * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
+ * project.
+ */
+/* ====================================================================
+ * Copyright (c) 2008 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ */
+
+#ifndef HEADER_CMS_H
+# define HEADER_CMS_H
+
+# include <openssl/x509.h>
+
+# ifdef OPENSSL_NO_CMS
+# error CMS is disabled.
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct CMS_ContentInfo_st CMS_ContentInfo;
+typedef struct CMS_SignerInfo_st CMS_SignerInfo;
+typedef struct CMS_CertificateChoices CMS_CertificateChoices;
+typedef struct CMS_RevocationInfoChoice_st CMS_RevocationInfoChoice;
+typedef struct CMS_RecipientInfo_st CMS_RecipientInfo;
+typedef struct CMS_ReceiptRequest_st CMS_ReceiptRequest;
+typedef struct CMS_Receipt_st CMS_Receipt;
+typedef struct CMS_RecipientEncryptedKey_st CMS_RecipientEncryptedKey;
+typedef struct CMS_OtherKeyAttribute_st CMS_OtherKeyAttribute;
+
+DECLARE_STACK_OF(CMS_SignerInfo)
+DECLARE_STACK_OF(GENERAL_NAMES)
+DECLARE_STACK_OF(CMS_RecipientEncryptedKey)
+DECLARE_ASN1_FUNCTIONS(CMS_ContentInfo)
+DECLARE_ASN1_FUNCTIONS(CMS_ReceiptRequest)
+DECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo)
+
+# define CMS_SIGNERINFO_ISSUER_SERIAL 0
+# define CMS_SIGNERINFO_KEYIDENTIFIER 1
+
+# define CMS_RECIPINFO_NONE -1
+# define CMS_RECIPINFO_TRANS 0
+# define CMS_RECIPINFO_AGREE 1
+# define CMS_RECIPINFO_KEK 2
+# define CMS_RECIPINFO_PASS 3
+# define CMS_RECIPINFO_OTHER 4
+
+/* S/MIME related flags */
+
+# define CMS_TEXT 0x1
+# define CMS_NOCERTS 0x2
+# define CMS_NO_CONTENT_VERIFY 0x4
+# define CMS_NO_ATTR_VERIFY 0x8
+# define CMS_NOSIGS \
+ (CMS_NO_CONTENT_VERIFY|CMS_NO_ATTR_VERIFY)
+# define CMS_NOINTERN 0x10
+# define CMS_NO_SIGNER_CERT_VERIFY 0x20
+# define CMS_NOVERIFY 0x20
+# define CMS_DETACHED 0x40
+# define CMS_BINARY 0x80
+# define CMS_NOATTR 0x100
+# define CMS_NOSMIMECAP 0x200
+# define CMS_NOOLDMIMETYPE 0x400
+# define CMS_CRLFEOL 0x800
+# define CMS_STREAM 0x1000
+# define CMS_NOCRL 0x2000
+# define CMS_PARTIAL 0x4000
+# define CMS_REUSE_DIGEST 0x8000
+# define CMS_USE_KEYID 0x10000
+# define CMS_DEBUG_DECRYPT 0x20000
+# define CMS_KEY_PARAM 0x40000
+
+const ASN1_OBJECT *CMS_get0_type(CMS_ContentInfo *cms);
+
+BIO *CMS_dataInit(CMS_ContentInfo *cms, BIO *icont);
+int CMS_dataFinal(CMS_ContentInfo *cms, BIO *bio);
+
+ASN1_OCTET_STRING **CMS_get0_content(CMS_ContentInfo *cms);
+int CMS_is_detached(CMS_ContentInfo *cms);
+int CMS_set_detached(CMS_ContentInfo *cms, int detached);
+
+# ifdef HEADER_PEM_H
+DECLARE_PEM_rw_const(CMS, CMS_ContentInfo)
+# endif
+int CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms);
+CMS_ContentInfo *d2i_CMS_bio(BIO *bp, CMS_ContentInfo **cms);
+int i2d_CMS_bio(BIO *bp, CMS_ContentInfo *cms);
+
+BIO *BIO_new_CMS(BIO *out, CMS_ContentInfo *cms);
+int i2d_CMS_bio_stream(BIO *out, CMS_ContentInfo *cms, BIO *in, int flags);
+int PEM_write_bio_CMS_stream(BIO *out, CMS_ContentInfo *cms, BIO *in,
+ int flags);
+CMS_ContentInfo *SMIME_read_CMS(BIO *bio, BIO **bcont);
+int SMIME_write_CMS(BIO *bio, CMS_ContentInfo *cms, BIO *data, int flags);
+
+int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont,
+ unsigned int flags);
+
+CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey,
+ STACK_OF(X509) *certs, BIO *data,
+ unsigned int flags);
+
+CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si,
+ X509 *signcert, EVP_PKEY *pkey,
+ STACK_OF(X509) *certs, unsigned int flags);
+
+int CMS_data(CMS_ContentInfo *cms, BIO *out, unsigned int flags);
+CMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags);
+
+int CMS_digest_verify(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
+ unsigned int flags);
+CMS_ContentInfo *CMS_digest_create(BIO *in, const EVP_MD *md,
+ unsigned int flags);
+
+int CMS_EncryptedData_decrypt(CMS_ContentInfo *cms,
+ const unsigned char *key, size_t keylen,
+ BIO *dcont, BIO *out, unsigned int flags);
+
+CMS_ContentInfo *CMS_EncryptedData_encrypt(BIO *in, const EVP_CIPHER *cipher,
+ const unsigned char *key,
+ size_t keylen, unsigned int flags);
+
+int CMS_EncryptedData_set1_key(CMS_ContentInfo *cms, const EVP_CIPHER *ciph,
+ const unsigned char *key, size_t keylen);
+
+int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
+ X509_STORE *store, BIO *dcont, BIO *out, unsigned int flags);
+
+int CMS_verify_receipt(CMS_ContentInfo *rcms, CMS_ContentInfo *ocms,
+ STACK_OF(X509) *certs,
+ X509_STORE *store, unsigned int flags);
+
+STACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms);
+
+CMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *in,
+ const EVP_CIPHER *cipher, unsigned int flags);
+
+int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pkey, X509 *cert,
+ BIO *dcont, BIO *out, unsigned int flags);
+
+int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert);
+int CMS_decrypt_set1_key(CMS_ContentInfo *cms,
+ unsigned char *key, size_t keylen,
+ unsigned char *id, size_t idlen);
+int CMS_decrypt_set1_password(CMS_ContentInfo *cms,
+ unsigned char *pass, ossl_ssize_t passlen);
+
+STACK_OF(CMS_RecipientInfo) *CMS_get0_RecipientInfos(CMS_ContentInfo *cms);
+int CMS_RecipientInfo_type(CMS_RecipientInfo *ri);
+EVP_PKEY_CTX *CMS_RecipientInfo_get0_pkey_ctx(CMS_RecipientInfo *ri);
+CMS_ContentInfo *CMS_EnvelopedData_create(const EVP_CIPHER *cipher);
+CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms,
+ X509 *recip, unsigned int flags);
+int CMS_RecipientInfo_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pkey);
+int CMS_RecipientInfo_ktri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert);
+int CMS_RecipientInfo_ktri_get0_algs(CMS_RecipientInfo *ri,
+ EVP_PKEY **pk, X509 **recip,
+ X509_ALGOR **palg);
+int CMS_RecipientInfo_ktri_get0_signer_id(CMS_RecipientInfo *ri,
+ ASN1_OCTET_STRING **keyid,
+ X509_NAME **issuer,
+ ASN1_INTEGER **sno);
+
+CMS_RecipientInfo *CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid,
+ unsigned char *key, size_t keylen,
+ unsigned char *id, size_t idlen,
+ ASN1_GENERALIZEDTIME *date,
+ ASN1_OBJECT *otherTypeId,
+ ASN1_TYPE *otherType);
+
+int CMS_RecipientInfo_kekri_get0_id(CMS_RecipientInfo *ri,
+ X509_ALGOR **palg,
+ ASN1_OCTET_STRING **pid,
+ ASN1_GENERALIZEDTIME **pdate,
+ ASN1_OBJECT **potherid,
+ ASN1_TYPE **pothertype);
+
+int CMS_RecipientInfo_set0_key(CMS_RecipientInfo *ri,
+ unsigned char *key, size_t keylen);
+
+int CMS_RecipientInfo_kekri_id_cmp(CMS_RecipientInfo *ri,
+ const unsigned char *id, size_t idlen);
+
+int CMS_RecipientInfo_set0_password(CMS_RecipientInfo *ri,
+ unsigned char *pass,
+ ossl_ssize_t passlen);
+
+CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms,
+ int iter, int wrap_nid,
+ int pbe_nid,
+ unsigned char *pass,
+ ossl_ssize_t passlen,
+ const EVP_CIPHER *kekciph);
+
+int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri);
+int CMS_RecipientInfo_encrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri);
+
+int CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
+ unsigned int flags);
+CMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags);
+
+int CMS_set1_eContentType(CMS_ContentInfo *cms, const ASN1_OBJECT *oid);
+const ASN1_OBJECT *CMS_get0_eContentType(CMS_ContentInfo *cms);
+
+CMS_CertificateChoices *CMS_add0_CertificateChoices(CMS_ContentInfo *cms);
+int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert);
+int CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert);
+STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms);
+
+CMS_RevocationInfoChoice *CMS_add0_RevocationInfoChoice(CMS_ContentInfo *cms);
+int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl);
+int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl);
+STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms);
+
+int CMS_SignedData_init(CMS_ContentInfo *cms);
+CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms,
+ X509 *signer, EVP_PKEY *pk, const EVP_MD *md,
+ unsigned int flags);
+EVP_PKEY_CTX *CMS_SignerInfo_get0_pkey_ctx(CMS_SignerInfo *si);
+EVP_MD_CTX *CMS_SignerInfo_get0_md_ctx(CMS_SignerInfo *si);
+STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms);
+
+void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer);
+int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si,
+ ASN1_OCTET_STRING **keyid,
+ X509_NAME **issuer, ASN1_INTEGER **sno);
+int CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert);
+int CMS_set1_signers_certs(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
+ unsigned int flags);
+void CMS_SignerInfo_get0_algs(CMS_SignerInfo *si, EVP_PKEY **pk,
+ X509 **signer, X509_ALGOR **pdig,
+ X509_ALGOR **psig);
+ASN1_OCTET_STRING *CMS_SignerInfo_get0_signature(CMS_SignerInfo *si);
+int CMS_SignerInfo_sign(CMS_SignerInfo *si);
+int CMS_SignerInfo_verify(CMS_SignerInfo *si);
+int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain);
+
+int CMS_add_smimecap(CMS_SignerInfo *si, STACK_OF(X509_ALGOR) *algs);
+int CMS_add_simple_smimecap(STACK_OF(X509_ALGOR) **algs,
+ int algnid, int keysize);
+int CMS_add_standard_smimecap(STACK_OF(X509_ALGOR) **smcap);
+
+int CMS_signed_get_attr_count(const CMS_SignerInfo *si);
+int CMS_signed_get_attr_by_NID(const CMS_SignerInfo *si, int nid,
+ int lastpos);
+int CMS_signed_get_attr_by_OBJ(const CMS_SignerInfo *si, ASN1_OBJECT *obj,
+ int lastpos);
+X509_ATTRIBUTE *CMS_signed_get_attr(const CMS_SignerInfo *si, int loc);
+X509_ATTRIBUTE *CMS_signed_delete_attr(CMS_SignerInfo *si, int loc);
+int CMS_signed_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr);
+int CMS_signed_add1_attr_by_OBJ(CMS_SignerInfo *si,
+ const ASN1_OBJECT *obj, int type,
+ const void *bytes, int len);
+int CMS_signed_add1_attr_by_NID(CMS_SignerInfo *si,
+ int nid, int type,
+ const void *bytes, int len);
+int CMS_signed_add1_attr_by_txt(CMS_SignerInfo *si,
+ const char *attrname, int type,
+ const void *bytes, int len);
+void *CMS_signed_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid,
+ int lastpos, int type);
+
+int CMS_unsigned_get_attr_count(const CMS_SignerInfo *si);
+int CMS_unsigned_get_attr_by_NID(const CMS_SignerInfo *si, int nid,
+ int lastpos);
+int CMS_unsigned_get_attr_by_OBJ(const CMS_SignerInfo *si, ASN1_OBJECT *obj,
+ int lastpos);
+X509_ATTRIBUTE *CMS_unsigned_get_attr(const CMS_SignerInfo *si, int loc);
+X509_ATTRIBUTE *CMS_unsigned_delete_attr(CMS_SignerInfo *si, int loc);
+int CMS_unsigned_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr);
+int CMS_unsigned_add1_attr_by_OBJ(CMS_SignerInfo *si,
+ const ASN1_OBJECT *obj, int type,
+ const void *bytes, int len);
+int CMS_unsigned_add1_attr_by_NID(CMS_SignerInfo *si,
+ int nid, int type,
+ const void *bytes, int len);
+int CMS_unsigned_add1_attr_by_txt(CMS_SignerInfo *si,
+ const char *attrname, int type,
+ const void *bytes, int len);
+void *CMS_unsigned_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid,
+ int lastpos, int type);
+
+# ifdef HEADER_X509V3_H
+
+int CMS_get1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest **prr);
+CMS_ReceiptRequest *CMS_ReceiptRequest_create0(unsigned char *id, int idlen,
+ int allorfirst,
+ STACK_OF(GENERAL_NAMES)
+ *receiptList, STACK_OF(GENERAL_NAMES)
+ *receiptsTo);
+int CMS_add1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest *rr);
+void CMS_ReceiptRequest_get0_values(CMS_ReceiptRequest *rr,
+ ASN1_STRING **pcid,
+ int *pallorfirst,
+ STACK_OF(GENERAL_NAMES) **plist,
+ STACK_OF(GENERAL_NAMES) **prto);
+# endif
+int CMS_RecipientInfo_kari_get0_alg(CMS_RecipientInfo *ri,
+ X509_ALGOR **palg,
+ ASN1_OCTET_STRING **pukm);
+STACK_OF(CMS_RecipientEncryptedKey)
+*CMS_RecipientInfo_kari_get0_reks(CMS_RecipientInfo *ri);
+
+int CMS_RecipientInfo_kari_get0_orig_id(CMS_RecipientInfo *ri,
+ X509_ALGOR **pubalg,
+ ASN1_BIT_STRING **pubkey,
+ ASN1_OCTET_STRING **keyid,
+ X509_NAME **issuer,
+ ASN1_INTEGER **sno);
+
+int CMS_RecipientInfo_kari_orig_id_cmp(CMS_RecipientInfo *ri, X509 *cert);
+
+int CMS_RecipientEncryptedKey_get0_id(CMS_RecipientEncryptedKey *rek,
+ ASN1_OCTET_STRING **keyid,
+ ASN1_GENERALIZEDTIME **tm,
+ CMS_OtherKeyAttribute **other,
+ X509_NAME **issuer, ASN1_INTEGER **sno);
+int CMS_RecipientEncryptedKey_cert_cmp(CMS_RecipientEncryptedKey *rek,
+ X509 *cert);
+int CMS_RecipientInfo_kari_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk);
+EVP_CIPHER_CTX *CMS_RecipientInfo_kari_get0_ctx(CMS_RecipientInfo *ri);
+int CMS_RecipientInfo_kari_decrypt(CMS_ContentInfo *cms,
+ CMS_RecipientInfo *ri,
+ CMS_RecipientEncryptedKey *rek);
+
+int CMS_SharedInfo_encode(unsigned char **pder, X509_ALGOR *kekalg,
+ ASN1_OCTET_STRING *ukm, int keylen);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_CMS_strings(void);
+
+/* Error codes for the CMS functions. */
+
+/* Function codes. */
+# define CMS_F_CHECK_CONTENT 99
+# define CMS_F_CMS_ADD0_CERT 164
+# define CMS_F_CMS_ADD0_RECIPIENT_KEY 100
+# define CMS_F_CMS_ADD0_RECIPIENT_PASSWORD 165
+# define CMS_F_CMS_ADD1_RECEIPTREQUEST 158
+# define CMS_F_CMS_ADD1_RECIPIENT_CERT 101
+# define CMS_F_CMS_ADD1_SIGNER 102
+# define CMS_F_CMS_ADD1_SIGNINGTIME 103
+# define CMS_F_CMS_COMPRESS 104
+# define CMS_F_CMS_COMPRESSEDDATA_CREATE 105
+# define CMS_F_CMS_COMPRESSEDDATA_INIT_BIO 106
+# define CMS_F_CMS_COPY_CONTENT 107
+# define CMS_F_CMS_COPY_MESSAGEDIGEST 108
+# define CMS_F_CMS_DATA 109
+# define CMS_F_CMS_DATAFINAL 110
+# define CMS_F_CMS_DATAINIT 111
+# define CMS_F_CMS_DECRYPT 112
+# define CMS_F_CMS_DECRYPT_SET1_KEY 113
+# define CMS_F_CMS_DECRYPT_SET1_PASSWORD 166
+# define CMS_F_CMS_DECRYPT_SET1_PKEY 114
+# define CMS_F_CMS_DIGESTALGORITHM_FIND_CTX 115
+# define CMS_F_CMS_DIGESTALGORITHM_INIT_BIO 116
+# define CMS_F_CMS_DIGESTEDDATA_DO_FINAL 117
+# define CMS_F_CMS_DIGEST_VERIFY 118
+# define CMS_F_CMS_ENCODE_RECEIPT 161
+# define CMS_F_CMS_ENCRYPT 119
+# define CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO 120
+# define CMS_F_CMS_ENCRYPTEDDATA_DECRYPT 121
+# define CMS_F_CMS_ENCRYPTEDDATA_ENCRYPT 122
+# define CMS_F_CMS_ENCRYPTEDDATA_SET1_KEY 123
+# define CMS_F_CMS_ENVELOPEDDATA_CREATE 124
+# define CMS_F_CMS_ENVELOPEDDATA_INIT_BIO 125
+# define CMS_F_CMS_ENVELOPED_DATA_INIT 126
+# define CMS_F_CMS_ENV_ASN1_CTRL 171
+# define CMS_F_CMS_FINAL 127
+# define CMS_F_CMS_GET0_CERTIFICATE_CHOICES 128
+# define CMS_F_CMS_GET0_CONTENT 129
+# define CMS_F_CMS_GET0_ECONTENT_TYPE 130
+# define CMS_F_CMS_GET0_ENVELOPED 131
+# define CMS_F_CMS_GET0_REVOCATION_CHOICES 132
+# define CMS_F_CMS_GET0_SIGNED 133
+# define CMS_F_CMS_MSGSIGDIGEST_ADD1 162
+# define CMS_F_CMS_RECEIPTREQUEST_CREATE0 159
+# define CMS_F_CMS_RECEIPT_VERIFY 160
+# define CMS_F_CMS_RECIPIENTINFO_DECRYPT 134
+# define CMS_F_CMS_RECIPIENTINFO_ENCRYPT 169
+# define CMS_F_CMS_RECIPIENTINFO_KARI_ENCRYPT 178
+# define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ALG 175
+# define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ORIG_ID 173
+# define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_REKS 172
+# define CMS_F_CMS_RECIPIENTINFO_KARI_ORIG_ID_CMP 174
+# define CMS_F_CMS_RECIPIENTINFO_KEKRI_DECRYPT 135
+# define CMS_F_CMS_RECIPIENTINFO_KEKRI_ENCRYPT 136
+# define CMS_F_CMS_RECIPIENTINFO_KEKRI_GET0_ID 137
+# define CMS_F_CMS_RECIPIENTINFO_KEKRI_ID_CMP 138
+# define CMS_F_CMS_RECIPIENTINFO_KTRI_CERT_CMP 139
+# define CMS_F_CMS_RECIPIENTINFO_KTRI_DECRYPT 140
+# define CMS_F_CMS_RECIPIENTINFO_KTRI_ENCRYPT 141
+# define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_ALGS 142
+# define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_SIGNER_ID 143
+# define CMS_F_CMS_RECIPIENTINFO_PWRI_CRYPT 167
+# define CMS_F_CMS_RECIPIENTINFO_SET0_KEY 144
+# define CMS_F_CMS_RECIPIENTINFO_SET0_PASSWORD 168
+# define CMS_F_CMS_RECIPIENTINFO_SET0_PKEY 145
+# define CMS_F_CMS_SD_ASN1_CTRL 170
+# define CMS_F_CMS_SET1_IAS 176
+# define CMS_F_CMS_SET1_KEYID 177
+# define CMS_F_CMS_SET1_SIGNERIDENTIFIER 146
+# define CMS_F_CMS_SET_DETACHED 147
+# define CMS_F_CMS_SIGN 148
+# define CMS_F_CMS_SIGNED_DATA_INIT 149
+# define CMS_F_CMS_SIGNERINFO_CONTENT_SIGN 150
+# define CMS_F_CMS_SIGNERINFO_SIGN 151
+# define CMS_F_CMS_SIGNERINFO_VERIFY 152
+# define CMS_F_CMS_SIGNERINFO_VERIFY_CERT 153
+# define CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT 154
+# define CMS_F_CMS_SIGN_RECEIPT 163
+# define CMS_F_CMS_STREAM 155
+# define CMS_F_CMS_UNCOMPRESS 156
+# define CMS_F_CMS_VERIFY 157
+
+/* Reason codes. */
+# define CMS_R_ADD_SIGNER_ERROR 99
+# define CMS_R_CERTIFICATE_ALREADY_PRESENT 175
+# define CMS_R_CERTIFICATE_HAS_NO_KEYID 160
+# define CMS_R_CERTIFICATE_VERIFY_ERROR 100
+# define CMS_R_CIPHER_INITIALISATION_ERROR 101
+# define CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR 102
+# define CMS_R_CMS_DATAFINAL_ERROR 103
+# define CMS_R_CMS_LIB 104
+# define CMS_R_CONTENTIDENTIFIER_MISMATCH 170
+# define CMS_R_CONTENT_NOT_FOUND 105
+# define CMS_R_CONTENT_TYPE_MISMATCH 171
+# define CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA 106
+# define CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA 107
+# define CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA 108
+# define CMS_R_CONTENT_VERIFY_ERROR 109
+# define CMS_R_CTRL_ERROR 110
+# define CMS_R_CTRL_FAILURE 111
+# define CMS_R_DECRYPT_ERROR 112
+# define CMS_R_DIGEST_ERROR 161
+# define CMS_R_ERROR_GETTING_PUBLIC_KEY 113
+# define CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE 114
+# define CMS_R_ERROR_SETTING_KEY 115
+# define CMS_R_ERROR_SETTING_RECIPIENTINFO 116
+# define CMS_R_INVALID_ENCRYPTED_KEY_LENGTH 117
+# define CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER 176
+# define CMS_R_INVALID_KEY_LENGTH 118
+# define CMS_R_MD_BIO_INIT_ERROR 119
+# define CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH 120
+# define CMS_R_MESSAGEDIGEST_WRONG_LENGTH 121
+# define CMS_R_MSGSIGDIGEST_ERROR 172
+# define CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE 162
+# define CMS_R_MSGSIGDIGEST_WRONG_LENGTH 163
+# define CMS_R_NEED_ONE_SIGNER 164
+# define CMS_R_NOT_A_SIGNED_RECEIPT 165
+# define CMS_R_NOT_ENCRYPTED_DATA 122
+# define CMS_R_NOT_KEK 123
+# define CMS_R_NOT_KEY_AGREEMENT 181
+# define CMS_R_NOT_KEY_TRANSPORT 124
+# define CMS_R_NOT_PWRI 177
+# define CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 125
+# define CMS_R_NO_CIPHER 126
+# define CMS_R_NO_CONTENT 127
+# define CMS_R_NO_CONTENT_TYPE 173
+# define CMS_R_NO_DEFAULT_DIGEST 128
+# define CMS_R_NO_DIGEST_SET 129
+# define CMS_R_NO_KEY 130
+# define CMS_R_NO_KEY_OR_CERT 174
+# define CMS_R_NO_MATCHING_DIGEST 131
+# define CMS_R_NO_MATCHING_RECIPIENT 132
+# define CMS_R_NO_MATCHING_SIGNATURE 166
+# define CMS_R_NO_MSGSIGDIGEST 167
+# define CMS_R_NO_PASSWORD 178
+# define CMS_R_NO_PRIVATE_KEY 133
+# define CMS_R_NO_PUBLIC_KEY 134
+# define CMS_R_NO_RECEIPT_REQUEST 168
+# define CMS_R_NO_SIGNERS 135
+# define CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 136
+# define CMS_R_RECEIPT_DECODE_ERROR 169
+# define CMS_R_RECIPIENT_ERROR 137
+# define CMS_R_SIGNER_CERTIFICATE_NOT_FOUND 138
+# define CMS_R_SIGNFINAL_ERROR 139
+# define CMS_R_SMIME_TEXT_ERROR 140
+# define CMS_R_STORE_INIT_ERROR 141
+# define CMS_R_TYPE_NOT_COMPRESSED_DATA 142
+# define CMS_R_TYPE_NOT_DATA 143
+# define CMS_R_TYPE_NOT_DIGESTED_DATA 144
+# define CMS_R_TYPE_NOT_ENCRYPTED_DATA 145
+# define CMS_R_TYPE_NOT_ENVELOPED_DATA 146
+# define CMS_R_UNABLE_TO_FINALIZE_CONTEXT 147
+# define CMS_R_UNKNOWN_CIPHER 148
+# define CMS_R_UNKNOWN_DIGEST_ALGORIHM 149
+# define CMS_R_UNKNOWN_ID 150
+# define CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM 151
+# define CMS_R_UNSUPPORTED_CONTENT_TYPE 152
+# define CMS_R_UNSUPPORTED_KEK_ALGORITHM 153
+# define CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM 179
+# define CMS_R_UNSUPPORTED_RECIPIENT_TYPE 154
+# define CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE 155
+# define CMS_R_UNSUPPORTED_TYPE 156
+# define CMS_R_UNWRAP_ERROR 157
+# define CMS_R_UNWRAP_FAILURE 180
+# define CMS_R_VERIFICATION_FAILURE 158
+# define CMS_R_WRAP_ERROR 159
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/comp.h b/protocols/Telegram/tgl/openssl/include/openssl/comp.h
new file mode 100644
index 0000000000..406c428aae
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/comp.h
@@ -0,0 +1,79 @@
+
+#ifndef HEADER_COMP_H
+# define HEADER_COMP_H
+
+# include <openssl/crypto.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct comp_ctx_st COMP_CTX;
+
+typedef struct comp_method_st {
+ int type; /* NID for compression library */
+ const char *name; /* A text string to identify the library */
+ int (*init) (COMP_CTX *ctx);
+ void (*finish) (COMP_CTX *ctx);
+ int (*compress) (COMP_CTX *ctx,
+ unsigned char *out, unsigned int olen,
+ unsigned char *in, unsigned int ilen);
+ int (*expand) (COMP_CTX *ctx,
+ unsigned char *out, unsigned int olen,
+ unsigned char *in, unsigned int ilen);
+ /*
+ * The following two do NOTHING, but are kept for backward compatibility
+ */
+ long (*ctrl) (void);
+ long (*callback_ctrl) (void);
+} COMP_METHOD;
+
+struct comp_ctx_st {
+ COMP_METHOD *meth;
+ unsigned long compress_in;
+ unsigned long compress_out;
+ unsigned long expand_in;
+ unsigned long expand_out;
+ CRYPTO_EX_DATA ex_data;
+};
+
+COMP_CTX *COMP_CTX_new(COMP_METHOD *meth);
+void COMP_CTX_free(COMP_CTX *ctx);
+int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
+ unsigned char *in, int ilen);
+int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
+ unsigned char *in, int ilen);
+COMP_METHOD *COMP_rle(void);
+COMP_METHOD *COMP_zlib(void);
+void COMP_zlib_cleanup(void);
+
+# ifdef HEADER_BIO_H
+# ifdef ZLIB
+BIO_METHOD *BIO_f_zlib(void);
+# endif
+# endif
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_COMP_strings(void);
+
+/* Error codes for the COMP functions. */
+
+/* Function codes. */
+# define COMP_F_BIO_ZLIB_FLUSH 99
+# define COMP_F_BIO_ZLIB_NEW 100
+# define COMP_F_BIO_ZLIB_READ 101
+# define COMP_F_BIO_ZLIB_WRITE 102
+
+/* Reason codes. */
+# define COMP_R_ZLIB_DEFLATE_ERROR 99
+# define COMP_R_ZLIB_INFLATE_ERROR 100
+# define COMP_R_ZLIB_NOT_SUPPORTED 101
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/conf.h b/protocols/Telegram/tgl/openssl/include/openssl/conf.h
new file mode 100644
index 0000000000..8d926d5d82
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/conf.h
@@ -0,0 +1,267 @@
+/* crypto/conf/conf.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_CONF_H
+# define HEADER_CONF_H
+
+# include <openssl/bio.h>
+# include <openssl/lhash.h>
+# include <openssl/stack.h>
+# include <openssl/safestack.h>
+# include <openssl/e_os2.h>
+
+# include <openssl/ossl_typ.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+ char *section;
+ char *name;
+ char *value;
+} CONF_VALUE;
+
+DECLARE_STACK_OF(CONF_VALUE)
+DECLARE_LHASH_OF(CONF_VALUE);
+
+struct conf_st;
+struct conf_method_st;
+typedef struct conf_method_st CONF_METHOD;
+
+struct conf_method_st {
+ const char *name;
+ CONF *(*create) (CONF_METHOD *meth);
+ int (*init) (CONF *conf);
+ int (*destroy) (CONF *conf);
+ int (*destroy_data) (CONF *conf);
+ int (*load_bio) (CONF *conf, BIO *bp, long *eline);
+ int (*dump) (const CONF *conf, BIO *bp);
+ int (*is_number) (const CONF *conf, char c);
+ int (*to_int) (const CONF *conf, char c);
+ int (*load) (CONF *conf, const char *name, long *eline);
+};
+
+/* Module definitions */
+
+typedef struct conf_imodule_st CONF_IMODULE;
+typedef struct conf_module_st CONF_MODULE;
+
+DECLARE_STACK_OF(CONF_MODULE)
+DECLARE_STACK_OF(CONF_IMODULE)
+
+/* DSO module function typedefs */
+typedef int conf_init_func (CONF_IMODULE *md, const CONF *cnf);
+typedef void conf_finish_func (CONF_IMODULE *md);
+
+# define CONF_MFLAGS_IGNORE_ERRORS 0x1
+# define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2
+# define CONF_MFLAGS_SILENT 0x4
+# define CONF_MFLAGS_NO_DSO 0x8
+# define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10
+# define CONF_MFLAGS_DEFAULT_SECTION 0x20
+
+int CONF_set_default_method(CONF_METHOD *meth);
+void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash);
+LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file,
+ long *eline);
+# ifndef OPENSSL_NO_FP_API
+LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp,
+ long *eline);
+# endif
+LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp,
+ long *eline);
+STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf,
+ const char *section);
+char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group,
+ const char *name);
+long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group,
+ const char *name);
+void CONF_free(LHASH_OF(CONF_VALUE) *conf);
+int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out);
+int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out);
+
+void OPENSSL_config(const char *config_name);
+void OPENSSL_no_config(void);
+
+/*
+ * New conf code. The semantics are different from the functions above. If
+ * that wasn't the case, the above functions would have been replaced
+ */
+
+struct conf_st {
+ CONF_METHOD *meth;
+ void *meth_data;
+ LHASH_OF(CONF_VALUE) *data;
+};
+
+CONF *NCONF_new(CONF_METHOD *meth);
+CONF_METHOD *NCONF_default(void);
+CONF_METHOD *NCONF_WIN32(void);
+# if 0 /* Just to give you an idea of what I have in
+ * mind */
+CONF_METHOD *NCONF_XML(void);
+# endif
+void NCONF_free(CONF *conf);
+void NCONF_free_data(CONF *conf);
+
+int NCONF_load(CONF *conf, const char *file, long *eline);
+# ifndef OPENSSL_NO_FP_API
+int NCONF_load_fp(CONF *conf, FILE *fp, long *eline);
+# endif
+int NCONF_load_bio(CONF *conf, BIO *bp, long *eline);
+STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf,
+ const char *section);
+char *NCONF_get_string(const CONF *conf, const char *group, const char *name);
+int NCONF_get_number_e(const CONF *conf, const char *group, const char *name,
+ long *result);
+int NCONF_dump_fp(const CONF *conf, FILE *out);
+int NCONF_dump_bio(const CONF *conf, BIO *out);
+
+# if 0 /* The following function has no error
+ * checking, and should therefore be avoided */
+long NCONF_get_number(CONF *conf, char *group, char *name);
+# else
+# define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r)
+# endif
+
+/* Module functions */
+
+int CONF_modules_load(const CONF *cnf, const char *appname,
+ unsigned long flags);
+int CONF_modules_load_file(const char *filename, const char *appname,
+ unsigned long flags);
+void CONF_modules_unload(int all);
+void CONF_modules_finish(void);
+void CONF_modules_free(void);
+int CONF_module_add(const char *name, conf_init_func *ifunc,
+ conf_finish_func *ffunc);
+
+const char *CONF_imodule_get_name(const CONF_IMODULE *md);
+const char *CONF_imodule_get_value(const CONF_IMODULE *md);
+void *CONF_imodule_get_usr_data(const CONF_IMODULE *md);
+void CONF_imodule_set_usr_data(CONF_IMODULE *md, void *usr_data);
+CONF_MODULE *CONF_imodule_get_module(const CONF_IMODULE *md);
+unsigned long CONF_imodule_get_flags(const CONF_IMODULE *md);
+void CONF_imodule_set_flags(CONF_IMODULE *md, unsigned long flags);
+void *CONF_module_get_usr_data(CONF_MODULE *pmod);
+void CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data);
+
+char *CONF_get1_default_config_file(void);
+
+int CONF_parse_list(const char *list, int sep, int nospc,
+ int (*list_cb) (const char *elem, int len, void *usr),
+ void *arg);
+
+void OPENSSL_load_builtin_modules(void);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_CONF_strings(void);
+
+/* Error codes for the CONF functions. */
+
+/* Function codes. */
+# define CONF_F_CONF_DUMP_FP 104
+# define CONF_F_CONF_LOAD 100
+# define CONF_F_CONF_LOAD_BIO 102
+# define CONF_F_CONF_LOAD_FP 103
+# define CONF_F_CONF_MODULES_LOAD 116
+# define CONF_F_CONF_PARSE_LIST 119
+# define CONF_F_DEF_LOAD 120
+# define CONF_F_DEF_LOAD_BIO 121
+# define CONF_F_MODULE_INIT 115
+# define CONF_F_MODULE_LOAD_DSO 117
+# define CONF_F_MODULE_RUN 118
+# define CONF_F_NCONF_DUMP_BIO 105
+# define CONF_F_NCONF_DUMP_FP 106
+# define CONF_F_NCONF_GET_NUMBER 107
+# define CONF_F_NCONF_GET_NUMBER_E 112
+# define CONF_F_NCONF_GET_SECTION 108
+# define CONF_F_NCONF_GET_STRING 109
+# define CONF_F_NCONF_LOAD 113
+# define CONF_F_NCONF_LOAD_BIO 110
+# define CONF_F_NCONF_LOAD_FP 114
+# define CONF_F_NCONF_NEW 111
+# define CONF_F_STR_COPY 101
+
+/* Reason codes. */
+# define CONF_R_ERROR_LOADING_DSO 110
+# define CONF_R_LIST_CANNOT_BE_NULL 115
+# define CONF_R_MISSING_CLOSE_SQUARE_BRACKET 100
+# define CONF_R_MISSING_EQUAL_SIGN 101
+# define CONF_R_MISSING_FINISH_FUNCTION 111
+# define CONF_R_MISSING_INIT_FUNCTION 112
+# define CONF_R_MODULE_INITIALIZATION_ERROR 109
+# define CONF_R_NO_CLOSE_BRACE 102
+# define CONF_R_NO_CONF 105
+# define CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE 106
+# define CONF_R_NO_SECTION 107
+# define CONF_R_NO_SUCH_FILE 114
+# define CONF_R_NO_VALUE 108
+# define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103
+# define CONF_R_UNKNOWN_MODULE_NAME 113
+# define CONF_R_VARIABLE_HAS_NO_VALUE 104
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/conf_api.h b/protocols/Telegram/tgl/openssl/include/openssl/conf_api.h
new file mode 100644
index 0000000000..e478f7df4b
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/conf_api.h
@@ -0,0 +1,89 @@
+/* conf_api.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_CONF_API_H
+# define HEADER_CONF_API_H
+
+# include <openssl/lhash.h>
+# include <openssl/conf.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Up until OpenSSL 0.9.5a, this was new_section */
+CONF_VALUE *_CONF_new_section(CONF *conf, const char *section);
+/* Up until OpenSSL 0.9.5a, this was get_section */
+CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section);
+/* Up until OpenSSL 0.9.5a, this was CONF_get_section */
+STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf,
+ const char *section);
+
+int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value);
+char *_CONF_get_string(const CONF *conf, const char *section,
+ const char *name);
+long _CONF_get_number(const CONF *conf, const char *section,
+ const char *name);
+
+int _CONF_new_data(CONF *conf);
+void _CONF_free_data(CONF *conf);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/crypto.h b/protocols/Telegram/tgl/openssl/include/openssl/crypto.h
new file mode 100644
index 0000000000..c450d7a3c3
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/crypto.h
@@ -0,0 +1,661 @@
+/* crypto/crypto.h */
+/* ====================================================================
+ * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+/* ====================================================================
+ * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
+ * ECDH support in OpenSSL originally developed by
+ * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
+ */
+
+#ifndef HEADER_CRYPTO_H
+# define HEADER_CRYPTO_H
+
+# include <stdlib.h>
+
+# include <openssl/e_os2.h>
+
+# ifndef OPENSSL_NO_FP_API
+# include <stdio.h>
+# endif
+
+# include <openssl/stack.h>
+# include <openssl/safestack.h>
+# include <openssl/opensslv.h>
+# include <openssl/ossl_typ.h>
+
+# ifdef CHARSET_EBCDIC
+# include <openssl/ebcdic.h>
+# endif
+
+/*
+ * Resolve problems on some operating systems with symbol names that clash
+ * one way or another
+ */
+# include <openssl/symhacks.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Backward compatibility to SSLeay */
+/*
+ * This is more to be used to check the correct DLL is being used in the MS
+ * world.
+ */
+# define SSLEAY_VERSION_NUMBER OPENSSL_VERSION_NUMBER
+# define SSLEAY_VERSION 0
+/* #define SSLEAY_OPTIONS 1 no longer supported */
+# define SSLEAY_CFLAGS 2
+# define SSLEAY_BUILT_ON 3
+# define SSLEAY_PLATFORM 4
+# define SSLEAY_DIR 5
+
+/* Already declared in ossl_typ.h */
+# if 0
+typedef struct crypto_ex_data_st CRYPTO_EX_DATA;
+/* Called when a new object is created */
+typedef int CRYPTO_EX_new (void *parent, void *ptr, CRYPTO_EX_DATA *ad,
+ int idx, long argl, void *argp);
+/* Called when an object is free()ed */
+typedef void CRYPTO_EX_free (void *parent, void *ptr, CRYPTO_EX_DATA *ad,
+ int idx, long argl, void *argp);
+/* Called when we need to dup an object */
+typedef int CRYPTO_EX_dup (CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from,
+ void *from_d, int idx, long argl, void *argp);
+# endif
+
+/* A generic structure to pass assorted data in a expandable way */
+typedef struct openssl_item_st {
+ int code;
+ void *value; /* Not used for flag attributes */
+ size_t value_size; /* Max size of value for output, length for
+ * input */
+ size_t *value_length; /* Returned length of value for output */
+} OPENSSL_ITEM;
+
+/*
+ * When changing the CRYPTO_LOCK_* list, be sure to maintin the text lock
+ * names in cryptlib.c
+ */
+
+# define CRYPTO_LOCK_ERR 1
+# define CRYPTO_LOCK_EX_DATA 2
+# define CRYPTO_LOCK_X509 3
+# define CRYPTO_LOCK_X509_INFO 4
+# define CRYPTO_LOCK_X509_PKEY 5
+# define CRYPTO_LOCK_X509_CRL 6
+# define CRYPTO_LOCK_X509_REQ 7
+# define CRYPTO_LOCK_DSA 8
+# define CRYPTO_LOCK_RSA 9
+# define CRYPTO_LOCK_EVP_PKEY 10
+# define CRYPTO_LOCK_X509_STORE 11
+# define CRYPTO_LOCK_SSL_CTX 12
+# define CRYPTO_LOCK_SSL_CERT 13
+# define CRYPTO_LOCK_SSL_SESSION 14
+# define CRYPTO_LOCK_SSL_SESS_CERT 15
+# define CRYPTO_LOCK_SSL 16
+# define CRYPTO_LOCK_SSL_METHOD 17
+# define CRYPTO_LOCK_RAND 18
+# define CRYPTO_LOCK_RAND2 19
+# define CRYPTO_LOCK_MALLOC 20
+# define CRYPTO_LOCK_BIO 21
+# define CRYPTO_LOCK_GETHOSTBYNAME 22
+# define CRYPTO_LOCK_GETSERVBYNAME 23
+# define CRYPTO_LOCK_READDIR 24
+# define CRYPTO_LOCK_RSA_BLINDING 25
+# define CRYPTO_LOCK_DH 26
+# define CRYPTO_LOCK_MALLOC2 27
+# define CRYPTO_LOCK_DSO 28
+# define CRYPTO_LOCK_DYNLOCK 29
+# define CRYPTO_LOCK_ENGINE 30
+# define CRYPTO_LOCK_UI 31
+# define CRYPTO_LOCK_ECDSA 32
+# define CRYPTO_LOCK_EC 33
+# define CRYPTO_LOCK_ECDH 34
+# define CRYPTO_LOCK_BN 35
+# define CRYPTO_LOCK_EC_PRE_COMP 36
+# define CRYPTO_LOCK_STORE 37
+# define CRYPTO_LOCK_COMP 38
+# define CRYPTO_LOCK_FIPS 39
+# define CRYPTO_LOCK_FIPS2 40
+# define CRYPTO_NUM_LOCKS 41
+
+# define CRYPTO_LOCK 1
+# define CRYPTO_UNLOCK 2
+# define CRYPTO_READ 4
+# define CRYPTO_WRITE 8
+
+# ifndef OPENSSL_NO_LOCKING
+# ifndef CRYPTO_w_lock
+# define CRYPTO_w_lock(type) \
+ CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,__FILE__,__LINE__)
+# define CRYPTO_w_unlock(type) \
+ CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,__FILE__,__LINE__)
+# define CRYPTO_r_lock(type) \
+ CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,__FILE__,__LINE__)
+# define CRYPTO_r_unlock(type) \
+ CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,__FILE__,__LINE__)
+# define CRYPTO_add(addr,amount,type) \
+ CRYPTO_add_lock(addr,amount,type,__FILE__,__LINE__)
+# endif
+# else
+# define CRYPTO_w_lock(a)
+# define CRYPTO_w_unlock(a)
+# define CRYPTO_r_lock(a)
+# define CRYPTO_r_unlock(a)
+# define CRYPTO_add(a,b,c) ((*(a))+=(b))
+# endif
+
+/*
+ * Some applications as well as some parts of OpenSSL need to allocate and
+ * deallocate locks in a dynamic fashion. The following typedef makes this
+ * possible in a type-safe manner.
+ */
+/* struct CRYPTO_dynlock_value has to be defined by the application. */
+typedef struct {
+ int references;
+ struct CRYPTO_dynlock_value *data;
+} CRYPTO_dynlock;
+
+/*
+ * The following can be used to detect memory leaks in the SSLeay library. It
+ * used, it turns on malloc checking
+ */
+
+# define CRYPTO_MEM_CHECK_OFF 0x0/* an enume */
+# define CRYPTO_MEM_CHECK_ON 0x1/* a bit */
+# define CRYPTO_MEM_CHECK_ENABLE 0x2/* a bit */
+# define CRYPTO_MEM_CHECK_DISABLE 0x3/* an enume */
+
+/*
+ * The following are bit values to turn on or off options connected to the
+ * malloc checking functionality
+ */
+
+/* Adds time to the memory checking information */
+# define V_CRYPTO_MDEBUG_TIME 0x1/* a bit */
+/* Adds thread number to the memory checking information */
+# define V_CRYPTO_MDEBUG_THREAD 0x2/* a bit */
+
+# define V_CRYPTO_MDEBUG_ALL (V_CRYPTO_MDEBUG_TIME | V_CRYPTO_MDEBUG_THREAD)
+
+/* predec of the BIO type */
+typedef struct bio_st BIO_dummy;
+
+struct crypto_ex_data_st {
+ STACK_OF(void) *sk;
+ /* gcc is screwing up this data structure :-( */
+ int dummy;
+};
+DECLARE_STACK_OF(void)
+
+/*
+ * This stuff is basically class callback functions The current classes are
+ * SSL_CTX, SSL, SSL_SESSION, and a few more
+ */
+
+typedef struct crypto_ex_data_func_st {
+ long argl; /* Arbitary long */
+ void *argp; /* Arbitary void * */
+ CRYPTO_EX_new *new_func;
+ CRYPTO_EX_free *free_func;
+ CRYPTO_EX_dup *dup_func;
+} CRYPTO_EX_DATA_FUNCS;
+
+DECLARE_STACK_OF(CRYPTO_EX_DATA_FUNCS)
+
+/*
+ * Per class, we have a STACK of CRYPTO_EX_DATA_FUNCS for each CRYPTO_EX_DATA
+ * entry.
+ */
+
+# define CRYPTO_EX_INDEX_BIO 0
+# define CRYPTO_EX_INDEX_SSL 1
+# define CRYPTO_EX_INDEX_SSL_CTX 2
+# define CRYPTO_EX_INDEX_SSL_SESSION 3
+# define CRYPTO_EX_INDEX_X509_STORE 4
+# define CRYPTO_EX_INDEX_X509_STORE_CTX 5
+# define CRYPTO_EX_INDEX_RSA 6
+# define CRYPTO_EX_INDEX_DSA 7
+# define CRYPTO_EX_INDEX_DH 8
+# define CRYPTO_EX_INDEX_ENGINE 9
+# define CRYPTO_EX_INDEX_X509 10
+# define CRYPTO_EX_INDEX_UI 11
+# define CRYPTO_EX_INDEX_ECDSA 12
+# define CRYPTO_EX_INDEX_ECDH 13
+# define CRYPTO_EX_INDEX_COMP 14
+# define CRYPTO_EX_INDEX_STORE 15
+
+/*
+ * Dynamically assigned indexes start from this value (don't use directly,
+ * use via CRYPTO_ex_data_new_class).
+ */
+# define CRYPTO_EX_INDEX_USER 100
+
+/*
+ * This is the default callbacks, but we can have others as well: this is
+ * needed in Win32 where the application malloc and the library malloc may
+ * not be the same.
+ */
+# define CRYPTO_malloc_init() CRYPTO_set_mem_functions(\
+ malloc, realloc, free)
+
+# if defined CRYPTO_MDEBUG_ALL || defined CRYPTO_MDEBUG_TIME || defined CRYPTO_MDEBUG_THREAD
+# ifndef CRYPTO_MDEBUG /* avoid duplicate #define */
+# define CRYPTO_MDEBUG
+# endif
+# endif
+
+/*
+ * Set standard debugging functions (not done by default unless CRYPTO_MDEBUG
+ * is defined)
+ */
+# define CRYPTO_malloc_debug_init() do {\
+ CRYPTO_set_mem_debug_functions(\
+ CRYPTO_dbg_malloc,\
+ CRYPTO_dbg_realloc,\
+ CRYPTO_dbg_free,\
+ CRYPTO_dbg_set_options,\
+ CRYPTO_dbg_get_options);\
+ } while(0)
+
+int CRYPTO_mem_ctrl(int mode);
+int CRYPTO_is_mem_check_on(void);
+
+/* for applications */
+# define MemCheck_start() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON)
+# define MemCheck_stop() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_OFF)
+
+/* for library-internal use */
+# define MemCheck_on() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE)
+# define MemCheck_off() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE)
+# define is_MemCheck_on() CRYPTO_is_mem_check_on()
+
+# define OPENSSL_malloc(num) CRYPTO_malloc((int)num,__FILE__,__LINE__)
+# define OPENSSL_strdup(str) CRYPTO_strdup((str),__FILE__,__LINE__)
+# define OPENSSL_realloc(addr,num) \
+ CRYPTO_realloc((char *)addr,(int)num,__FILE__,__LINE__)
+# define OPENSSL_realloc_clean(addr,old_num,num) \
+ CRYPTO_realloc_clean(addr,old_num,num,__FILE__,__LINE__)
+# define OPENSSL_remalloc(addr,num) \
+ CRYPTO_remalloc((char **)addr,(int)num,__FILE__,__LINE__)
+# define OPENSSL_freeFunc CRYPTO_free
+# define OPENSSL_free(addr) CRYPTO_free(addr)
+
+# define OPENSSL_malloc_locked(num) \
+ CRYPTO_malloc_locked((int)num,__FILE__,__LINE__)
+# define OPENSSL_free_locked(addr) CRYPTO_free_locked(addr)
+
+const char *SSLeay_version(int type);
+unsigned long SSLeay(void);
+
+int OPENSSL_issetugid(void);
+
+/* An opaque type representing an implementation of "ex_data" support */
+typedef struct st_CRYPTO_EX_DATA_IMPL CRYPTO_EX_DATA_IMPL;
+/* Return an opaque pointer to the current "ex_data" implementation */
+const CRYPTO_EX_DATA_IMPL *CRYPTO_get_ex_data_implementation(void);
+/* Sets the "ex_data" implementation to be used (if it's not too late) */
+int CRYPTO_set_ex_data_implementation(const CRYPTO_EX_DATA_IMPL *i);
+/* Get a new "ex_data" class, and return the corresponding "class_index" */
+int CRYPTO_ex_data_new_class(void);
+/* Within a given class, get/register a new index */
+int CRYPTO_get_ex_new_index(int class_index, long argl, void *argp,
+ CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func,
+ CRYPTO_EX_free *free_func);
+/*
+ * Initialise/duplicate/free CRYPTO_EX_DATA variables corresponding to a
+ * given class (invokes whatever per-class callbacks are applicable)
+ */
+int CRYPTO_new_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad);
+int CRYPTO_dup_ex_data(int class_index, CRYPTO_EX_DATA *to,
+ CRYPTO_EX_DATA *from);
+void CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad);
+/*
+ * Get/set data in a CRYPTO_EX_DATA variable corresponding to a particular
+ * index (relative to the class type involved)
+ */
+int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int idx, void *val);
+void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx);
+/*
+ * This function cleans up all "ex_data" state. It mustn't be called under
+ * potential race-conditions.
+ */
+void CRYPTO_cleanup_all_ex_data(void);
+
+int CRYPTO_get_new_lockid(char *name);
+
+int CRYPTO_num_locks(void); /* return CRYPTO_NUM_LOCKS (shared libs!) */
+void CRYPTO_lock(int mode, int type, const char *file, int line);
+void CRYPTO_set_locking_callback(void (*func) (int mode, int type,
+ const char *file, int line));
+void (*CRYPTO_get_locking_callback(void)) (int mode, int type,
+ const char *file, int line);
+void CRYPTO_set_add_lock_callback(int (*func)
+ (int *num, int mount, int type,
+ const char *file, int line));
+int (*CRYPTO_get_add_lock_callback(void)) (int *num, int mount, int type,
+ const char *file, int line);
+
+/* Don't use this structure directly. */
+typedef struct crypto_threadid_st {
+ void *ptr;
+ unsigned long val;
+} CRYPTO_THREADID;
+/* Only use CRYPTO_THREADID_set_[numeric|pointer]() within callbacks */
+void CRYPTO_THREADID_set_numeric(CRYPTO_THREADID *id, unsigned long val);
+void CRYPTO_THREADID_set_pointer(CRYPTO_THREADID *id, void *ptr);
+int CRYPTO_THREADID_set_callback(void (*threadid_func) (CRYPTO_THREADID *));
+void (*CRYPTO_THREADID_get_callback(void)) (CRYPTO_THREADID *);
+void CRYPTO_THREADID_current(CRYPTO_THREADID *id);
+int CRYPTO_THREADID_cmp(const CRYPTO_THREADID *a, const CRYPTO_THREADID *b);
+void CRYPTO_THREADID_cpy(CRYPTO_THREADID *dest, const CRYPTO_THREADID *src);
+unsigned long CRYPTO_THREADID_hash(const CRYPTO_THREADID *id);
+# ifndef OPENSSL_NO_DEPRECATED
+void CRYPTO_set_id_callback(unsigned long (*func) (void));
+unsigned long (*CRYPTO_get_id_callback(void)) (void);
+unsigned long CRYPTO_thread_id(void);
+# endif
+
+const char *CRYPTO_get_lock_name(int type);
+int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,
+ int line);
+
+int CRYPTO_get_new_dynlockid(void);
+void CRYPTO_destroy_dynlockid(int i);
+struct CRYPTO_dynlock_value *CRYPTO_get_dynlock_value(int i);
+void CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value
+ *(*dyn_create_function) (const char
+ *file,
+ int line));
+void CRYPTO_set_dynlock_lock_callback(void (*dyn_lock_function)
+ (int mode,
+ struct CRYPTO_dynlock_value *l,
+ const char *file, int line));
+void CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function)
+ (struct CRYPTO_dynlock_value *l,
+ const char *file, int line));
+struct CRYPTO_dynlock_value
+*(*CRYPTO_get_dynlock_create_callback(void)) (const char *file, int line);
+void (*CRYPTO_get_dynlock_lock_callback(void)) (int mode,
+ struct CRYPTO_dynlock_value
+ *l, const char *file,
+ int line);
+void (*CRYPTO_get_dynlock_destroy_callback(void)) (struct CRYPTO_dynlock_value
+ *l, const char *file,
+ int line);
+
+/*
+ * CRYPTO_set_mem_functions includes CRYPTO_set_locked_mem_functions -- call
+ * the latter last if you need different functions
+ */
+int CRYPTO_set_mem_functions(void *(*m) (size_t), void *(*r) (void *, size_t),
+ void (*f) (void *));
+int CRYPTO_set_locked_mem_functions(void *(*m) (size_t),
+ void (*free_func) (void *));
+int CRYPTO_set_mem_ex_functions(void *(*m) (size_t, const char *, int),
+ void *(*r) (void *, size_t, const char *,
+ int), void (*f) (void *));
+int CRYPTO_set_locked_mem_ex_functions(void *(*m) (size_t, const char *, int),
+ void (*free_func) (void *));
+int CRYPTO_set_mem_debug_functions(void (*m)
+ (void *, int, const char *, int, int),
+ void (*r) (void *, void *, int,
+ const char *, int, int),
+ void (*f) (void *, int), void (*so) (long),
+ long (*go) (void));
+void CRYPTO_get_mem_functions(void *(**m) (size_t),
+ void *(**r) (void *, size_t),
+ void (**f) (void *));
+void CRYPTO_get_locked_mem_functions(void *(**m) (size_t),
+ void (**f) (void *));
+void CRYPTO_get_mem_ex_functions(void *(**m) (size_t, const char *, int),
+ void *(**r) (void *, size_t, const char *,
+ int), void (**f) (void *));
+void CRYPTO_get_locked_mem_ex_functions(void
+ *(**m) (size_t, const char *, int),
+ void (**f) (void *));
+void CRYPTO_get_mem_debug_functions(void (**m)
+ (void *, int, const char *, int, int),
+ void (**r) (void *, void *, int,
+ const char *, int, int),
+ void (**f) (void *, int),
+ void (**so) (long), long (**go) (void));
+
+void *CRYPTO_malloc_locked(int num, const char *file, int line);
+void CRYPTO_free_locked(void *ptr);
+void *CRYPTO_malloc(int num, const char *file, int line);
+char *CRYPTO_strdup(const char *str, const char *file, int line);
+void CRYPTO_free(void *ptr);
+void *CRYPTO_realloc(void *addr, int num, const char *file, int line);
+void *CRYPTO_realloc_clean(void *addr, int old_num, int num, const char *file,
+ int line);
+void *CRYPTO_remalloc(void *addr, int num, const char *file, int line);
+
+void OPENSSL_cleanse(void *ptr, size_t len);
+
+void CRYPTO_set_mem_debug_options(long bits);
+long CRYPTO_get_mem_debug_options(void);
+
+# define CRYPTO_push_info(info) \
+ CRYPTO_push_info_(info, __FILE__, __LINE__);
+int CRYPTO_push_info_(const char *info, const char *file, int line);
+int CRYPTO_pop_info(void);
+int CRYPTO_remove_all_info(void);
+
+/*
+ * Default debugging functions (enabled by CRYPTO_malloc_debug_init() macro;
+ * used as default in CRYPTO_MDEBUG compilations):
+ */
+/*-
+ * The last argument has the following significance:
+ *
+ * 0: called before the actual memory allocation has taken place
+ * 1: called after the actual memory allocation has taken place
+ */
+void CRYPTO_dbg_malloc(void *addr, int num, const char *file, int line,
+ int before_p);
+void CRYPTO_dbg_realloc(void *addr1, void *addr2, int num, const char *file,
+ int line, int before_p);
+void CRYPTO_dbg_free(void *addr, int before_p);
+/*-
+ * Tell the debugging code about options. By default, the following values
+ * apply:
+ *
+ * 0: Clear all options.
+ * V_CRYPTO_MDEBUG_TIME (1): Set the "Show Time" option.
+ * V_CRYPTO_MDEBUG_THREAD (2): Set the "Show Thread Number" option.
+ * V_CRYPTO_MDEBUG_ALL (3): 1 + 2
+ */
+void CRYPTO_dbg_set_options(long bits);
+long CRYPTO_dbg_get_options(void);
+
+# ifndef OPENSSL_NO_FP_API
+void CRYPTO_mem_leaks_fp(FILE *);
+# endif
+void CRYPTO_mem_leaks(struct bio_st *bio);
+/* unsigned long order, char *file, int line, int num_bytes, char *addr */
+typedef void *CRYPTO_MEM_LEAK_CB (unsigned long, const char *, int, int,
+ void *);
+void CRYPTO_mem_leaks_cb(CRYPTO_MEM_LEAK_CB *cb);
+
+/* die if we have to */
+void OpenSSLDie(const char *file, int line, const char *assertion);
+# define OPENSSL_assert(e) (void)((e) ? 0 : (OpenSSLDie(__FILE__, __LINE__, #e),1))
+
+unsigned long *OPENSSL_ia32cap_loc(void);
+# define OPENSSL_ia32cap (*(OPENSSL_ia32cap_loc()))
+int OPENSSL_isservice(void);
+
+int FIPS_mode(void);
+int FIPS_mode_set(int r);
+
+void OPENSSL_init(void);
+
+# define fips_md_init(alg) fips_md_init_ctx(alg, alg)
+
+# ifdef OPENSSL_FIPS
+# define fips_md_init_ctx(alg, cx) \
+ int alg##_Init(cx##_CTX *c) \
+ { \
+ if (FIPS_mode()) OpenSSLDie(__FILE__, __LINE__, \
+ "Low level API call to digest " #alg " forbidden in FIPS mode!"); \
+ return private_##alg##_Init(c); \
+ } \
+ int private_##alg##_Init(cx##_CTX *c)
+
+# define fips_cipher_abort(alg) \
+ if (FIPS_mode()) OpenSSLDie(__FILE__, __LINE__, \
+ "Low level API call to cipher " #alg " forbidden in FIPS mode!")
+
+# else
+# define fips_md_init_ctx(alg, cx) \
+ int alg##_Init(cx##_CTX *c)
+# define fips_cipher_abort(alg) while(0)
+# endif
+
+/*
+ * CRYPTO_memcmp returns zero iff the |len| bytes at |a| and |b| are equal.
+ * It takes an amount of time dependent on |len|, but independent of the
+ * contents of |a| and |b|. Unlike memcmp, it cannot be used to put elements
+ * into a defined order as the return value when a != b is undefined, other
+ * than to be non-zero.
+ */
+int CRYPTO_memcmp(const void *a, const void *b, size_t len);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_CRYPTO_strings(void);
+
+/* Error codes for the CRYPTO functions. */
+
+/* Function codes. */
+# define CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX 100
+# define CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID 103
+# define CRYPTO_F_CRYPTO_GET_NEW_LOCKID 101
+# define CRYPTO_F_CRYPTO_SET_EX_DATA 102
+# define CRYPTO_F_DEF_ADD_INDEX 104
+# define CRYPTO_F_DEF_GET_CLASS 105
+# define CRYPTO_F_FIPS_MODE_SET 109
+# define CRYPTO_F_INT_DUP_EX_DATA 106
+# define CRYPTO_F_INT_FREE_EX_DATA 107
+# define CRYPTO_F_INT_NEW_EX_DATA 108
+
+/* Reason codes. */
+# define CRYPTO_R_FIPS_MODE_NOT_SUPPORTED 101
+# define CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK 100
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/des.h b/protocols/Telegram/tgl/openssl/include/openssl/des.h
new file mode 100644
index 0000000000..1b40144e1b
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/des.h
@@ -0,0 +1,257 @@
+/* crypto/des/des.h */
+/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_NEW_DES_H
+# define HEADER_NEW_DES_H
+
+# include <openssl/e_os2.h> /* OPENSSL_EXTERN, OPENSSL_NO_DES, DES_LONG
+ * (via openssl/opensslconf.h */
+
+# ifdef OPENSSL_NO_DES
+# error DES is disabled.
+# endif
+
+# ifdef OPENSSL_BUILD_SHLIBCRYPTO
+# undef OPENSSL_EXTERN
+# define OPENSSL_EXTERN OPENSSL_EXPORT
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef unsigned char DES_cblock[8];
+typedef /* const */ unsigned char const_DES_cblock[8];
+/*
+ * With "const", gcc 2.8.1 on Solaris thinks that DES_cblock * and
+ * const_DES_cblock * are incompatible pointer types.
+ */
+
+typedef struct DES_ks {
+ union {
+ DES_cblock cblock;
+ /*
+ * make sure things are correct size on machines with 8 byte longs
+ */
+ DES_LONG deslong[2];
+ } ks[16];
+} DES_key_schedule;
+
+# ifndef OPENSSL_DISABLE_OLD_DES_SUPPORT
+# ifndef OPENSSL_ENABLE_OLD_DES_SUPPORT
+# define OPENSSL_ENABLE_OLD_DES_SUPPORT
+# endif
+# endif
+
+# ifdef OPENSSL_ENABLE_OLD_DES_SUPPORT
+# include <openssl/des_old.h>
+# endif
+
+# define DES_KEY_SZ (sizeof(DES_cblock))
+# define DES_SCHEDULE_SZ (sizeof(DES_key_schedule))
+
+# define DES_ENCRYPT 1
+# define DES_DECRYPT 0
+
+# define DES_CBC_MODE 0
+# define DES_PCBC_MODE 1
+
+# define DES_ecb2_encrypt(i,o,k1,k2,e) \
+ DES_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
+
+# define DES_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \
+ DES_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
+
+# define DES_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \
+ DES_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))
+
+# define DES_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
+ DES_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
+
+OPENSSL_DECLARE_GLOBAL(int, DES_check_key); /* defaults to false */
+# define DES_check_key OPENSSL_GLOBAL_REF(DES_check_key)
+OPENSSL_DECLARE_GLOBAL(int, DES_rw_mode); /* defaults to DES_PCBC_MODE */
+# define DES_rw_mode OPENSSL_GLOBAL_REF(DES_rw_mode)
+
+const char *DES_options(void);
+void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output,
+ DES_key_schedule *ks1, DES_key_schedule *ks2,
+ DES_key_schedule *ks3, int enc);
+DES_LONG DES_cbc_cksum(const unsigned char *input, DES_cblock *output,
+ long length, DES_key_schedule *schedule,
+ const_DES_cblock *ivec);
+/* DES_cbc_encrypt does not update the IV! Use DES_ncbc_encrypt instead. */
+void DES_cbc_encrypt(const unsigned char *input, unsigned char *output,
+ long length, DES_key_schedule *schedule,
+ DES_cblock *ivec, int enc);
+void DES_ncbc_encrypt(const unsigned char *input, unsigned char *output,
+ long length, DES_key_schedule *schedule,
+ DES_cblock *ivec, int enc);
+void DES_xcbc_encrypt(const unsigned char *input, unsigned char *output,
+ long length, DES_key_schedule *schedule,
+ DES_cblock *ivec, const_DES_cblock *inw,
+ const_DES_cblock *outw, int enc);
+void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits,
+ long length, DES_key_schedule *schedule,
+ DES_cblock *ivec, int enc);
+void DES_ecb_encrypt(const_DES_cblock *input, DES_cblock *output,
+ DES_key_schedule *ks, int enc);
+
+/*
+ * This is the DES encryption function that gets called by just about every
+ * other DES routine in the library. You should not use this function except
+ * to implement 'modes' of DES. I say this because the functions that call
+ * this routine do the conversion from 'char *' to long, and this needs to be
+ * done to make sure 'non-aligned' memory access do not occur. The
+ * characters are loaded 'little endian'. Data is a pointer to 2 unsigned
+ * long's and ks is the DES_key_schedule to use. enc, is non zero specifies
+ * encryption, zero if decryption.
+ */
+void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc);
+
+/*
+ * This functions is the same as DES_encrypt1() except that the DES initial
+ * permutation (IP) and final permutation (FP) have been left out. As for
+ * DES_encrypt1(), you should not use this function. It is used by the
+ * routines in the library that implement triple DES. IP() DES_encrypt2()
+ * DES_encrypt2() DES_encrypt2() FP() is the same as DES_encrypt1()
+ * DES_encrypt1() DES_encrypt1() except faster :-).
+ */
+void DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc);
+
+void DES_encrypt3(DES_LONG *data, DES_key_schedule *ks1,
+ DES_key_schedule *ks2, DES_key_schedule *ks3);
+void DES_decrypt3(DES_LONG *data, DES_key_schedule *ks1,
+ DES_key_schedule *ks2, DES_key_schedule *ks3);
+void DES_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output,
+ long length,
+ DES_key_schedule *ks1, DES_key_schedule *ks2,
+ DES_key_schedule *ks3, DES_cblock *ivec, int enc);
+void DES_ede3_cbcm_encrypt(const unsigned char *in, unsigned char *out,
+ long length,
+ DES_key_schedule *ks1, DES_key_schedule *ks2,
+ DES_key_schedule *ks3,
+ DES_cblock *ivec1, DES_cblock *ivec2, int enc);
+void DES_ede3_cfb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, DES_key_schedule *ks1,
+ DES_key_schedule *ks2, DES_key_schedule *ks3,
+ DES_cblock *ivec, int *num, int enc);
+void DES_ede3_cfb_encrypt(const unsigned char *in, unsigned char *out,
+ int numbits, long length, DES_key_schedule *ks1,
+ DES_key_schedule *ks2, DES_key_schedule *ks3,
+ DES_cblock *ivec, int enc);
+void DES_ede3_ofb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, DES_key_schedule *ks1,
+ DES_key_schedule *ks2, DES_key_schedule *ks3,
+ DES_cblock *ivec, int *num);
+# if 0
+void DES_xwhite_in2out(const_DES_cblock *DES_key, const_DES_cblock *in_white,
+ DES_cblock *out_white);
+# endif
+
+int DES_enc_read(int fd, void *buf, int len, DES_key_schedule *sched,
+ DES_cblock *iv);
+int DES_enc_write(int fd, const void *buf, int len, DES_key_schedule *sched,
+ DES_cblock *iv);
+char *DES_fcrypt(const char *buf, const char *salt, char *ret);
+char *DES_crypt(const char *buf, const char *salt);
+void DES_ofb_encrypt(const unsigned char *in, unsigned char *out, int numbits,
+ long length, DES_key_schedule *schedule,
+ DES_cblock *ivec);
+void DES_pcbc_encrypt(const unsigned char *input, unsigned char *output,
+ long length, DES_key_schedule *schedule,
+ DES_cblock *ivec, int enc);
+DES_LONG DES_quad_cksum(const unsigned char *input, DES_cblock output[],
+ long length, int out_count, DES_cblock *seed);
+int DES_random_key(DES_cblock *ret);
+void DES_set_odd_parity(DES_cblock *key);
+int DES_check_key_parity(const_DES_cblock *key);
+int DES_is_weak_key(const_DES_cblock *key);
+/*
+ * DES_set_key (= set_key = DES_key_sched = key_sched) calls
+ * DES_set_key_checked if global variable DES_check_key is set,
+ * DES_set_key_unchecked otherwise.
+ */
+int DES_set_key(const_DES_cblock *key, DES_key_schedule *schedule);
+int DES_key_sched(const_DES_cblock *key, DES_key_schedule *schedule);
+int DES_set_key_checked(const_DES_cblock *key, DES_key_schedule *schedule);
+void DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule);
+# ifdef OPENSSL_FIPS
+void private_DES_set_key_unchecked(const_DES_cblock *key,
+ DES_key_schedule *schedule);
+# endif
+void DES_string_to_key(const char *str, DES_cblock *key);
+void DES_string_to_2keys(const char *str, DES_cblock *key1, DES_cblock *key2);
+void DES_cfb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, DES_key_schedule *schedule,
+ DES_cblock *ivec, int *num, int enc);
+void DES_ofb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, DES_key_schedule *schedule,
+ DES_cblock *ivec, int *num);
+
+int DES_read_password(DES_cblock *key, const char *prompt, int verify);
+int DES_read_2passwords(DES_cblock *key1, DES_cblock *key2,
+ const char *prompt, int verify);
+
+# define DES_fixup_key_parity DES_set_odd_parity
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/des_old.h b/protocols/Telegram/tgl/openssl/include/openssl/des_old.h
new file mode 100644
index 0000000000..f1e1e2cb09
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/des_old.h
@@ -0,0 +1,497 @@
+/* crypto/des/des_old.h -*- mode:C; c-file-style: "eay" -*- */
+
+/*-
+ * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
+ *
+ * The function names in here are deprecated and are only present to
+ * provide an interface compatible with openssl 0.9.6 and older as
+ * well as libdes. OpenSSL now provides functions where "des_" has
+ * been replaced with "DES_" in the names, to make it possible to
+ * make incompatible changes that are needed for C type security and
+ * other stuff.
+ *
+ * This include files has two compatibility modes:
+ *
+ * - If OPENSSL_DES_LIBDES_COMPATIBILITY is defined, you get an API
+ * that is compatible with libdes and SSLeay.
+ * - If OPENSSL_DES_LIBDES_COMPATIBILITY isn't defined, you get an
+ * API that is compatible with OpenSSL 0.9.5x to 0.9.6x.
+ *
+ * Note that these modes break earlier snapshots of OpenSSL, where
+ * libdes compatibility was the only available mode or (later on) the
+ * prefered compatibility mode. However, after much consideration
+ * (and more or less violent discussions with external parties), it
+ * was concluded that OpenSSL should be compatible with earlier versions
+ * of itself before anything else. Also, in all honesty, libdes is
+ * an old beast that shouldn't really be used any more.
+ *
+ * Please consider starting to use the DES_ functions rather than the
+ * des_ ones. The des_ functions will disappear completely before
+ * OpenSSL 1.0!
+ *
+ * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
+ */
+
+/*
+ * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project
+ * 2001.
+ */
+/* ====================================================================
+ * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_DES_H
+# define HEADER_DES_H
+
+# include <openssl/e_os2.h> /* OPENSSL_EXTERN, OPENSSL_NO_DES, DES_LONG */
+
+# ifdef OPENSSL_NO_DES
+# error DES is disabled.
+# endif
+
+# ifndef HEADER_NEW_DES_H
+# error You must include des.h, not des_old.h directly.
+# endif
+
+# ifdef _KERBEROS_DES_H
+# error <openssl/des_old.h> replaces <kerberos/des.h>.
+# endif
+
+# include <openssl/symhacks.h>
+
+# ifdef OPENSSL_BUILD_SHLIBCRYPTO
+# undef OPENSSL_EXTERN
+# define OPENSSL_EXTERN OPENSSL_EXPORT
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# ifdef _
+# undef _
+# endif
+
+typedef unsigned char _ossl_old_des_cblock[8];
+typedef struct _ossl_old_des_ks_struct {
+ union {
+ _ossl_old_des_cblock _;
+ /*
+ * make sure things are correct size on machines with 8 byte longs
+ */
+ DES_LONG pad[2];
+ } ks;
+} _ossl_old_des_key_schedule[16];
+
+# ifndef OPENSSL_DES_LIBDES_COMPATIBILITY
+# define des_cblock DES_cblock
+# define const_des_cblock const_DES_cblock
+# define des_key_schedule DES_key_schedule
+# define des_ecb3_encrypt(i,o,k1,k2,k3,e)\
+ DES_ecb3_encrypt((i),(o),&(k1),&(k2),&(k3),(e))
+# define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\
+ DES_ede3_cbc_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(e))
+# define des_ede3_cbcm_encrypt(i,o,l,k1,k2,k3,iv1,iv2,e)\
+ DES_ede3_cbcm_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv1),(iv2),(e))
+# define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\
+ DES_ede3_cfb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n),(e))
+# define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\
+ DES_ede3_ofb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n))
+# define des_options()\
+ DES_options()
+# define des_cbc_cksum(i,o,l,k,iv)\
+ DES_cbc_cksum((i),(o),(l),&(k),(iv))
+# define des_cbc_encrypt(i,o,l,k,iv,e)\
+ DES_cbc_encrypt((i),(o),(l),&(k),(iv),(e))
+# define des_ncbc_encrypt(i,o,l,k,iv,e)\
+ DES_ncbc_encrypt((i),(o),(l),&(k),(iv),(e))
+# define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\
+ DES_xcbc_encrypt((i),(o),(l),&(k),(iv),(inw),(outw),(e))
+# define des_cfb_encrypt(i,o,n,l,k,iv,e)\
+ DES_cfb_encrypt((i),(o),(n),(l),&(k),(iv),(e))
+# define des_ecb_encrypt(i,o,k,e)\
+ DES_ecb_encrypt((i),(o),&(k),(e))
+# define des_encrypt1(d,k,e)\
+ DES_encrypt1((d),&(k),(e))
+# define des_encrypt2(d,k,e)\
+ DES_encrypt2((d),&(k),(e))
+# define des_encrypt3(d,k1,k2,k3)\
+ DES_encrypt3((d),&(k1),&(k2),&(k3))
+# define des_decrypt3(d,k1,k2,k3)\
+ DES_decrypt3((d),&(k1),&(k2),&(k3))
+# define des_xwhite_in2out(k,i,o)\
+ DES_xwhite_in2out((k),(i),(o))
+# define des_enc_read(f,b,l,k,iv)\
+ DES_enc_read((f),(b),(l),&(k),(iv))
+# define des_enc_write(f,b,l,k,iv)\
+ DES_enc_write((f),(b),(l),&(k),(iv))
+# define des_fcrypt(b,s,r)\
+ DES_fcrypt((b),(s),(r))
+# if 0
+# define des_crypt(b,s)\
+ DES_crypt((b),(s))
+# if !defined(PERL5) && !defined(__FreeBSD__) && !defined(NeXT) && !defined(__OpenBSD__)
+# define crypt(b,s)\
+ DES_crypt((b),(s))
+# endif
+# endif
+# define des_ofb_encrypt(i,o,n,l,k,iv)\
+ DES_ofb_encrypt((i),(o),(n),(l),&(k),(iv))
+# define des_pcbc_encrypt(i,o,l,k,iv,e)\
+ DES_pcbc_encrypt((i),(o),(l),&(k),(iv),(e))
+# define des_quad_cksum(i,o,l,c,s)\
+ DES_quad_cksum((i),(o),(l),(c),(s))
+# define des_random_seed(k)\
+ _ossl_096_des_random_seed((k))
+# define des_random_key(r)\
+ DES_random_key((r))
+# define des_read_password(k,p,v) \
+ DES_read_password((k),(p),(v))
+# define des_read_2passwords(k1,k2,p,v) \
+ DES_read_2passwords((k1),(k2),(p),(v))
+# define des_set_odd_parity(k)\
+ DES_set_odd_parity((k))
+# define des_check_key_parity(k)\
+ DES_check_key_parity((k))
+# define des_is_weak_key(k)\
+ DES_is_weak_key((k))
+# define des_set_key(k,ks)\
+ DES_set_key((k),&(ks))
+# define des_key_sched(k,ks)\
+ DES_key_sched((k),&(ks))
+# define des_set_key_checked(k,ks)\
+ DES_set_key_checked((k),&(ks))
+# define des_set_key_unchecked(k,ks)\
+ DES_set_key_unchecked((k),&(ks))
+# define des_string_to_key(s,k)\
+ DES_string_to_key((s),(k))
+# define des_string_to_2keys(s,k1,k2)\
+ DES_string_to_2keys((s),(k1),(k2))
+# define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\
+ DES_cfb64_encrypt((i),(o),(l),&(ks),(iv),(n),(e))
+# define des_ofb64_encrypt(i,o,l,ks,iv,n)\
+ DES_ofb64_encrypt((i),(o),(l),&(ks),(iv),(n))
+
+# define des_ecb2_encrypt(i,o,k1,k2,e) \
+ des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
+
+# define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \
+ des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
+
+# define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \
+ des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))
+
+# define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
+ des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
+
+# define des_check_key DES_check_key
+# define des_rw_mode DES_rw_mode
+# else /* libdes compatibility */
+/*
+ * Map all symbol names to _ossl_old_des_* form, so we avoid all clashes with
+ * libdes
+ */
+# define des_cblock _ossl_old_des_cblock
+# define des_key_schedule _ossl_old_des_key_schedule
+# define des_ecb3_encrypt(i,o,k1,k2,k3,e)\
+ _ossl_old_des_ecb3_encrypt((i),(o),(k1),(k2),(k3),(e))
+# define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\
+ _ossl_old_des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(e))
+# define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\
+ _ossl_old_des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n),(e))
+# define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\
+ _ossl_old_des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n))
+# define des_options()\
+ _ossl_old_des_options()
+# define des_cbc_cksum(i,o,l,k,iv)\
+ _ossl_old_des_cbc_cksum((i),(o),(l),(k),(iv))
+# define des_cbc_encrypt(i,o,l,k,iv,e)\
+ _ossl_old_des_cbc_encrypt((i),(o),(l),(k),(iv),(e))
+# define des_ncbc_encrypt(i,o,l,k,iv,e)\
+ _ossl_old_des_ncbc_encrypt((i),(o),(l),(k),(iv),(e))
+# define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\
+ _ossl_old_des_xcbc_encrypt((i),(o),(l),(k),(iv),(inw),(outw),(e))
+# define des_cfb_encrypt(i,o,n,l,k,iv,e)\
+ _ossl_old_des_cfb_encrypt((i),(o),(n),(l),(k),(iv),(e))
+# define des_ecb_encrypt(i,o,k,e)\
+ _ossl_old_des_ecb_encrypt((i),(o),(k),(e))
+# define des_encrypt(d,k,e)\
+ _ossl_old_des_encrypt((d),(k),(e))
+# define des_encrypt2(d,k,e)\
+ _ossl_old_des_encrypt2((d),(k),(e))
+# define des_encrypt3(d,k1,k2,k3)\
+ _ossl_old_des_encrypt3((d),(k1),(k2),(k3))
+# define des_decrypt3(d,k1,k2,k3)\
+ _ossl_old_des_decrypt3((d),(k1),(k2),(k3))
+# define des_xwhite_in2out(k,i,o)\
+ _ossl_old_des_xwhite_in2out((k),(i),(o))
+# define des_enc_read(f,b,l,k,iv)\
+ _ossl_old_des_enc_read((f),(b),(l),(k),(iv))
+# define des_enc_write(f,b,l,k,iv)\
+ _ossl_old_des_enc_write((f),(b),(l),(k),(iv))
+# define des_fcrypt(b,s,r)\
+ _ossl_old_des_fcrypt((b),(s),(r))
+# define des_crypt(b,s)\
+ _ossl_old_des_crypt((b),(s))
+# if 0
+# define crypt(b,s)\
+ _ossl_old_crypt((b),(s))
+# endif
+# define des_ofb_encrypt(i,o,n,l,k,iv)\
+ _ossl_old_des_ofb_encrypt((i),(o),(n),(l),(k),(iv))
+# define des_pcbc_encrypt(i,o,l,k,iv,e)\
+ _ossl_old_des_pcbc_encrypt((i),(o),(l),(k),(iv),(e))
+# define des_quad_cksum(i,o,l,c,s)\
+ _ossl_old_des_quad_cksum((i),(o),(l),(c),(s))
+# define des_random_seed(k)\
+ _ossl_old_des_random_seed((k))
+# define des_random_key(r)\
+ _ossl_old_des_random_key((r))
+# define des_read_password(k,p,v) \
+ _ossl_old_des_read_password((k),(p),(v))
+# define des_read_2passwords(k1,k2,p,v) \
+ _ossl_old_des_read_2passwords((k1),(k2),(p),(v))
+# define des_set_odd_parity(k)\
+ _ossl_old_des_set_odd_parity((k))
+# define des_is_weak_key(k)\
+ _ossl_old_des_is_weak_key((k))
+# define des_set_key(k,ks)\
+ _ossl_old_des_set_key((k),(ks))
+# define des_key_sched(k,ks)\
+ _ossl_old_des_key_sched((k),(ks))
+# define des_string_to_key(s,k)\
+ _ossl_old_des_string_to_key((s),(k))
+# define des_string_to_2keys(s,k1,k2)\
+ _ossl_old_des_string_to_2keys((s),(k1),(k2))
+# define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\
+ _ossl_old_des_cfb64_encrypt((i),(o),(l),(ks),(iv),(n),(e))
+# define des_ofb64_encrypt(i,o,l,ks,iv,n)\
+ _ossl_old_des_ofb64_encrypt((i),(o),(l),(ks),(iv),(n))
+
+# define des_ecb2_encrypt(i,o,k1,k2,e) \
+ des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
+
+# define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \
+ des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
+
+# define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \
+ des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))
+
+# define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
+ des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
+
+# define des_check_key DES_check_key
+# define des_rw_mode DES_rw_mode
+# endif
+
+const char *_ossl_old_des_options(void);
+void _ossl_old_des_ecb3_encrypt(_ossl_old_des_cblock *input,
+ _ossl_old_des_cblock *output,
+ _ossl_old_des_key_schedule ks1,
+ _ossl_old_des_key_schedule ks2,
+ _ossl_old_des_key_schedule ks3, int enc);
+DES_LONG _ossl_old_des_cbc_cksum(_ossl_old_des_cblock *input,
+ _ossl_old_des_cblock *output, long length,
+ _ossl_old_des_key_schedule schedule,
+ _ossl_old_des_cblock *ivec);
+void _ossl_old_des_cbc_encrypt(_ossl_old_des_cblock *input,
+ _ossl_old_des_cblock *output, long length,
+ _ossl_old_des_key_schedule schedule,
+ _ossl_old_des_cblock *ivec, int enc);
+void _ossl_old_des_ncbc_encrypt(_ossl_old_des_cblock *input,
+ _ossl_old_des_cblock *output, long length,
+ _ossl_old_des_key_schedule schedule,
+ _ossl_old_des_cblock *ivec, int enc);
+void _ossl_old_des_xcbc_encrypt(_ossl_old_des_cblock *input,
+ _ossl_old_des_cblock *output, long length,
+ _ossl_old_des_key_schedule schedule,
+ _ossl_old_des_cblock *ivec,
+ _ossl_old_des_cblock *inw,
+ _ossl_old_des_cblock *outw, int enc);
+void _ossl_old_des_cfb_encrypt(unsigned char *in, unsigned char *out,
+ int numbits, long length,
+ _ossl_old_des_key_schedule schedule,
+ _ossl_old_des_cblock *ivec, int enc);
+void _ossl_old_des_ecb_encrypt(_ossl_old_des_cblock *input,
+ _ossl_old_des_cblock *output,
+ _ossl_old_des_key_schedule ks, int enc);
+void _ossl_old_des_encrypt(DES_LONG *data, _ossl_old_des_key_schedule ks,
+ int enc);
+void _ossl_old_des_encrypt2(DES_LONG *data, _ossl_old_des_key_schedule ks,
+ int enc);
+void _ossl_old_des_encrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1,
+ _ossl_old_des_key_schedule ks2,
+ _ossl_old_des_key_schedule ks3);
+void _ossl_old_des_decrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1,
+ _ossl_old_des_key_schedule ks2,
+ _ossl_old_des_key_schedule ks3);
+void _ossl_old_des_ede3_cbc_encrypt(_ossl_old_des_cblock *input,
+ _ossl_old_des_cblock *output, long length,
+ _ossl_old_des_key_schedule ks1,
+ _ossl_old_des_key_schedule ks2,
+ _ossl_old_des_key_schedule ks3,
+ _ossl_old_des_cblock *ivec, int enc);
+void _ossl_old_des_ede3_cfb64_encrypt(unsigned char *in, unsigned char *out,
+ long length,
+ _ossl_old_des_key_schedule ks1,
+ _ossl_old_des_key_schedule ks2,
+ _ossl_old_des_key_schedule ks3,
+ _ossl_old_des_cblock *ivec, int *num,
+ int enc);
+void _ossl_old_des_ede3_ofb64_encrypt(unsigned char *in, unsigned char *out,
+ long length,
+ _ossl_old_des_key_schedule ks1,
+ _ossl_old_des_key_schedule ks2,
+ _ossl_old_des_key_schedule ks3,
+ _ossl_old_des_cblock *ivec, int *num);
+# if 0
+void _ossl_old_des_xwhite_in2out(_ossl_old_des_cblock (*des_key),
+ _ossl_old_des_cblock (*in_white),
+ _ossl_old_des_cblock (*out_white));
+# endif
+
+int _ossl_old_des_enc_read(int fd, char *buf, int len,
+ _ossl_old_des_key_schedule sched,
+ _ossl_old_des_cblock *iv);
+int _ossl_old_des_enc_write(int fd, char *buf, int len,
+ _ossl_old_des_key_schedule sched,
+ _ossl_old_des_cblock *iv);
+char *_ossl_old_des_fcrypt(const char *buf, const char *salt, char *ret);
+char *_ossl_old_des_crypt(const char *buf, const char *salt);
+# if !defined(PERL5) && !defined(NeXT)
+char *_ossl_old_crypt(const char *buf, const char *salt);
+# endif
+void _ossl_old_des_ofb_encrypt(unsigned char *in, unsigned char *out,
+ int numbits, long length,
+ _ossl_old_des_key_schedule schedule,
+ _ossl_old_des_cblock *ivec);
+void _ossl_old_des_pcbc_encrypt(_ossl_old_des_cblock *input,
+ _ossl_old_des_cblock *output, long length,
+ _ossl_old_des_key_schedule schedule,
+ _ossl_old_des_cblock *ivec, int enc);
+DES_LONG _ossl_old_des_quad_cksum(_ossl_old_des_cblock *input,
+ _ossl_old_des_cblock *output, long length,
+ int out_count, _ossl_old_des_cblock *seed);
+void _ossl_old_des_random_seed(_ossl_old_des_cblock key);
+void _ossl_old_des_random_key(_ossl_old_des_cblock ret);
+int _ossl_old_des_read_password(_ossl_old_des_cblock *key, const char *prompt,
+ int verify);
+int _ossl_old_des_read_2passwords(_ossl_old_des_cblock *key1,
+ _ossl_old_des_cblock *key2,
+ const char *prompt, int verify);
+void _ossl_old_des_set_odd_parity(_ossl_old_des_cblock *key);
+int _ossl_old_des_is_weak_key(_ossl_old_des_cblock *key);
+int _ossl_old_des_set_key(_ossl_old_des_cblock *key,
+ _ossl_old_des_key_schedule schedule);
+int _ossl_old_des_key_sched(_ossl_old_des_cblock *key,
+ _ossl_old_des_key_schedule schedule);
+void _ossl_old_des_string_to_key(char *str, _ossl_old_des_cblock *key);
+void _ossl_old_des_string_to_2keys(char *str, _ossl_old_des_cblock *key1,
+ _ossl_old_des_cblock *key2);
+void _ossl_old_des_cfb64_encrypt(unsigned char *in, unsigned char *out,
+ long length,
+ _ossl_old_des_key_schedule schedule,
+ _ossl_old_des_cblock *ivec, int *num,
+ int enc);
+void _ossl_old_des_ofb64_encrypt(unsigned char *in, unsigned char *out,
+ long length,
+ _ossl_old_des_key_schedule schedule,
+ _ossl_old_des_cblock *ivec, int *num);
+
+void _ossl_096_des_random_seed(des_cblock *key);
+
+/*
+ * The following definitions provide compatibility with the MIT Kerberos
+ * library. The _ossl_old_des_key_schedule structure is not binary
+ * compatible.
+ */
+
+# define _KERBEROS_DES_H
+
+# define KRBDES_ENCRYPT DES_ENCRYPT
+# define KRBDES_DECRYPT DES_DECRYPT
+
+# ifdef KERBEROS
+# define ENCRYPT DES_ENCRYPT
+# define DECRYPT DES_DECRYPT
+# endif
+
+# ifndef NCOMPAT
+# define C_Block des_cblock
+# define Key_schedule des_key_schedule
+# define KEY_SZ DES_KEY_SZ
+# define string_to_key des_string_to_key
+# define read_pw_string des_read_pw_string
+# define random_key des_random_key
+# define pcbc_encrypt des_pcbc_encrypt
+# define set_key des_set_key
+# define key_sched des_key_sched
+# define ecb_encrypt des_ecb_encrypt
+# define cbc_encrypt des_cbc_encrypt
+# define ncbc_encrypt des_ncbc_encrypt
+# define xcbc_encrypt des_xcbc_encrypt
+# define cbc_cksum des_cbc_cksum
+# define quad_cksum des_quad_cksum
+# define check_parity des_check_key_parity
+# endif
+
+# define des_fixup_key_parity DES_fixup_key_parity
+
+#ifdef __cplusplus
+}
+#endif
+
+/* for DES_read_pw_string et al */
+# include <openssl/ui_compat.h>
+
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/dh.h b/protocols/Telegram/tgl/openssl/include/openssl/dh.h
new file mode 100644
index 0000000000..0502f1a9cc
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/dh.h
@@ -0,0 +1,392 @@
+/* crypto/dh/dh.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_DH_H
+# define HEADER_DH_H
+
+# include <openssl/e_os2.h>
+
+# ifdef OPENSSL_NO_DH
+# error DH is disabled.
+# endif
+
+# ifndef OPENSSL_NO_BIO
+# include <openssl/bio.h>
+# endif
+# include <openssl/ossl_typ.h>
+# ifndef OPENSSL_NO_DEPRECATED
+# include <openssl/bn.h>
+# endif
+
+# ifndef OPENSSL_DH_MAX_MODULUS_BITS
+# define OPENSSL_DH_MAX_MODULUS_BITS 10000
+# endif
+
+# define DH_FLAG_CACHE_MONT_P 0x01
+
+/*
+ * new with 0.9.7h; the built-in DH
+ * implementation now uses constant time
+ * modular exponentiation for secret exponents
+ * by default. This flag causes the
+ * faster variable sliding window method to
+ * be used for all exponents.
+ */
+# define DH_FLAG_NO_EXP_CONSTTIME 0x02
+
+/*
+ * If this flag is set the DH method is FIPS compliant and can be used in
+ * FIPS mode. This is set in the validated module method. If an application
+ * sets this flag in its own methods it is its reposibility to ensure the
+ * result is compliant.
+ */
+
+# define DH_FLAG_FIPS_METHOD 0x0400
+
+/*
+ * If this flag is set the operations normally disabled in FIPS mode are
+ * permitted it is then the applications responsibility to ensure that the
+ * usage is compliant.
+ */
+
+# define DH_FLAG_NON_FIPS_ALLOW 0x0400
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Already defined in ossl_typ.h */
+/* typedef struct dh_st DH; */
+/* typedef struct dh_method DH_METHOD; */
+
+struct dh_method {
+ const char *name;
+ /* Methods here */
+ int (*generate_key) (DH *dh);
+ int (*compute_key) (unsigned char *key, const BIGNUM *pub_key, DH *dh);
+ /* Can be null */
+ int (*bn_mod_exp) (const DH *dh, BIGNUM *r, const BIGNUM *a,
+ const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx,
+ BN_MONT_CTX *m_ctx);
+ int (*init) (DH *dh);
+ int (*finish) (DH *dh);
+ int flags;
+ char *app_data;
+ /* If this is non-NULL, it will be used to generate parameters */
+ int (*generate_params) (DH *dh, int prime_len, int generator,
+ BN_GENCB *cb);
+};
+
+struct dh_st {
+ /*
+ * This first argument is used to pick up errors when a DH is passed
+ * instead of a EVP_PKEY
+ */
+ int pad;
+ int version;
+ BIGNUM *p;
+ BIGNUM *g;
+ long length; /* optional */
+ BIGNUM *pub_key; /* g^x */
+ BIGNUM *priv_key; /* x */
+ int flags;
+ BN_MONT_CTX *method_mont_p;
+ /* Place holders if we want to do X9.42 DH */
+ BIGNUM *q;
+ BIGNUM *j;
+ unsigned char *seed;
+ int seedlen;
+ BIGNUM *counter;
+ int references;
+ CRYPTO_EX_DATA ex_data;
+ const DH_METHOD *meth;
+ ENGINE *engine;
+};
+
+# define DH_GENERATOR_2 2
+/* #define DH_GENERATOR_3 3 */
+# define DH_GENERATOR_5 5
+
+/* DH_check error codes */
+# define DH_CHECK_P_NOT_PRIME 0x01
+# define DH_CHECK_P_NOT_SAFE_PRIME 0x02
+# define DH_UNABLE_TO_CHECK_GENERATOR 0x04
+# define DH_NOT_SUITABLE_GENERATOR 0x08
+# define DH_CHECK_Q_NOT_PRIME 0x10
+# define DH_CHECK_INVALID_Q_VALUE 0x20
+# define DH_CHECK_INVALID_J_VALUE 0x40
+
+/* DH_check_pub_key error codes */
+# define DH_CHECK_PUBKEY_TOO_SMALL 0x01
+# define DH_CHECK_PUBKEY_TOO_LARGE 0x02
+
+/*
+ * primes p where (p-1)/2 is prime too are called "safe"; we define this for
+ * backward compatibility:
+ */
+# define DH_CHECK_P_NOT_STRONG_PRIME DH_CHECK_P_NOT_SAFE_PRIME
+
+# define d2i_DHparams_fp(fp,x) (DH *)ASN1_d2i_fp((char *(*)())DH_new, \
+ (char *(*)())d2i_DHparams,(fp),(unsigned char **)(x))
+# define i2d_DHparams_fp(fp,x) ASN1_i2d_fp(i2d_DHparams,(fp), \
+ (unsigned char *)(x))
+# define d2i_DHparams_bio(bp,x) ASN1_d2i_bio_of(DH,DH_new,d2i_DHparams,bp,x)
+# define i2d_DHparams_bio(bp,x) ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x)
+
+DH *DHparams_dup(DH *);
+
+const DH_METHOD *DH_OpenSSL(void);
+
+void DH_set_default_method(const DH_METHOD *meth);
+const DH_METHOD *DH_get_default_method(void);
+int DH_set_method(DH *dh, const DH_METHOD *meth);
+DH *DH_new_method(ENGINE *engine);
+
+DH *DH_new(void);
+void DH_free(DH *dh);
+int DH_up_ref(DH *dh);
+int DH_size(const DH *dh);
+int DH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
+ CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
+int DH_set_ex_data(DH *d, int idx, void *arg);
+void *DH_get_ex_data(DH *d, int idx);
+
+/* Deprecated version */
+# ifndef OPENSSL_NO_DEPRECATED
+DH *DH_generate_parameters(int prime_len, int generator,
+ void (*callback) (int, int, void *), void *cb_arg);
+# endif /* !defined(OPENSSL_NO_DEPRECATED) */
+
+/* New version */
+int DH_generate_parameters_ex(DH *dh, int prime_len, int generator,
+ BN_GENCB *cb);
+
+int DH_check(const DH *dh, int *codes);
+int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *codes);
+int DH_generate_key(DH *dh);
+int DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh);
+int DH_compute_key_padded(unsigned char *key, const BIGNUM *pub_key, DH *dh);
+DH *d2i_DHparams(DH **a, const unsigned char **pp, long length);
+int i2d_DHparams(const DH *a, unsigned char **pp);
+DH *d2i_DHxparams(DH **a, const unsigned char **pp, long length);
+int i2d_DHxparams(const DH *a, unsigned char **pp);
+# ifndef OPENSSL_NO_FP_API
+int DHparams_print_fp(FILE *fp, const DH *x);
+# endif
+# ifndef OPENSSL_NO_BIO
+int DHparams_print(BIO *bp, const DH *x);
+# else
+int DHparams_print(char *bp, const DH *x);
+# endif
+
+/* RFC 5114 parameters */
+DH *DH_get_1024_160(void);
+DH *DH_get_2048_224(void);
+DH *DH_get_2048_256(void);
+
+/* RFC2631 KDF */
+int DH_KDF_X9_42(unsigned char *out, size_t outlen,
+ const unsigned char *Z, size_t Zlen,
+ ASN1_OBJECT *key_oid,
+ const unsigned char *ukm, size_t ukmlen, const EVP_MD *md);
+
+# define EVP_PKEY_CTX_set_dh_paramgen_prime_len(ctx, len) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \
+ EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN, len, NULL)
+
+# define EVP_PKEY_CTX_set_dh_paramgen_subprime_len(ctx, len) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \
+ EVP_PKEY_CTRL_DH_PARAMGEN_SUBPRIME_LEN, len, NULL)
+
+# define EVP_PKEY_CTX_set_dh_paramgen_type(ctx, typ) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \
+ EVP_PKEY_CTRL_DH_PARAMGEN_TYPE, typ, NULL)
+
+# define EVP_PKEY_CTX_set_dh_paramgen_generator(ctx, gen) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \
+ EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR, gen, NULL)
+
+# define EVP_PKEY_CTX_set_dh_rfc5114(ctx, gen) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_PARAMGEN, \
+ EVP_PKEY_CTRL_DH_RFC5114, gen, NULL)
+
+# define EVP_PKEY_CTX_set_dhx_rfc5114(ctx, gen) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_PARAMGEN, \
+ EVP_PKEY_CTRL_DH_RFC5114, gen, NULL)
+
+# define EVP_PKEY_CTX_set_dh_kdf_type(ctx, kdf) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_DH_KDF_TYPE, kdf, NULL)
+
+# define EVP_PKEY_CTX_get_dh_kdf_type(ctx) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_DH_KDF_TYPE, -2, NULL)
+
+# define EVP_PKEY_CTX_set0_dh_kdf_oid(ctx, oid) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_DH_KDF_OID, 0, (void *)oid)
+
+# define EVP_PKEY_CTX_get0_dh_kdf_oid(ctx, poid) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_GET_DH_KDF_OID, 0, (void *)poid)
+
+# define EVP_PKEY_CTX_set_dh_kdf_md(ctx, md) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_DH_KDF_MD, 0, (void *)md)
+
+# define EVP_PKEY_CTX_get_dh_kdf_md(ctx, pmd) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_GET_DH_KDF_MD, 0, (void *)pmd)
+
+# define EVP_PKEY_CTX_set_dh_kdf_outlen(ctx, len) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_DH_KDF_OUTLEN, len, NULL)
+
+# define EVP_PKEY_CTX_get_dh_kdf_outlen(ctx, plen) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_GET_DH_KDF_OUTLEN, 0, (void *)plen)
+
+# define EVP_PKEY_CTX_set0_dh_kdf_ukm(ctx, p, plen) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_DH_KDF_UKM, plen, (void *)p)
+
+# define EVP_PKEY_CTX_get0_dh_kdf_ukm(ctx, p) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_GET_DH_KDF_UKM, 0, (void *)p)
+
+# define EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN (EVP_PKEY_ALG_CTRL + 1)
+# define EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR (EVP_PKEY_ALG_CTRL + 2)
+# define EVP_PKEY_CTRL_DH_RFC5114 (EVP_PKEY_ALG_CTRL + 3)
+# define EVP_PKEY_CTRL_DH_PARAMGEN_SUBPRIME_LEN (EVP_PKEY_ALG_CTRL + 4)
+# define EVP_PKEY_CTRL_DH_PARAMGEN_TYPE (EVP_PKEY_ALG_CTRL + 5)
+# define EVP_PKEY_CTRL_DH_KDF_TYPE (EVP_PKEY_ALG_CTRL + 6)
+# define EVP_PKEY_CTRL_DH_KDF_MD (EVP_PKEY_ALG_CTRL + 7)
+# define EVP_PKEY_CTRL_GET_DH_KDF_MD (EVP_PKEY_ALG_CTRL + 8)
+# define EVP_PKEY_CTRL_DH_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 9)
+# define EVP_PKEY_CTRL_GET_DH_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 10)
+# define EVP_PKEY_CTRL_DH_KDF_UKM (EVP_PKEY_ALG_CTRL + 11)
+# define EVP_PKEY_CTRL_GET_DH_KDF_UKM (EVP_PKEY_ALG_CTRL + 12)
+# define EVP_PKEY_CTRL_DH_KDF_OID (EVP_PKEY_ALG_CTRL + 13)
+# define EVP_PKEY_CTRL_GET_DH_KDF_OID (EVP_PKEY_ALG_CTRL + 14)
+
+/* KDF types */
+# define EVP_PKEY_DH_KDF_NONE 1
+# define EVP_PKEY_DH_KDF_X9_42 2
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_DH_strings(void);
+
+/* Error codes for the DH functions. */
+
+/* Function codes. */
+# define DH_F_COMPUTE_KEY 102
+# define DH_F_DHPARAMS_PRINT_FP 101
+# define DH_F_DH_BUILTIN_GENPARAMS 106
+# define DH_F_DH_CMS_DECRYPT 117
+# define DH_F_DH_CMS_SET_PEERKEY 118
+# define DH_F_DH_CMS_SET_SHARED_INFO 119
+# define DH_F_DH_COMPUTE_KEY 114
+# define DH_F_DH_GENERATE_KEY 115
+# define DH_F_DH_GENERATE_PARAMETERS_EX 116
+# define DH_F_DH_NEW_METHOD 105
+# define DH_F_DH_PARAM_DECODE 107
+# define DH_F_DH_PRIV_DECODE 110
+# define DH_F_DH_PRIV_ENCODE 111
+# define DH_F_DH_PUB_DECODE 108
+# define DH_F_DH_PUB_ENCODE 109
+# define DH_F_DO_DH_PRINT 100
+# define DH_F_GENERATE_KEY 103
+# define DH_F_GENERATE_PARAMETERS 104
+# define DH_F_PKEY_DH_DERIVE 112
+# define DH_F_PKEY_DH_KEYGEN 113
+
+/* Reason codes. */
+# define DH_R_BAD_GENERATOR 101
+# define DH_R_BN_DECODE_ERROR 109
+# define DH_R_BN_ERROR 106
+# define DH_R_DECODE_ERROR 104
+# define DH_R_INVALID_PUBKEY 102
+# define DH_R_KDF_PARAMETER_ERROR 112
+# define DH_R_KEYS_NOT_SET 108
+# define DH_R_KEY_SIZE_TOO_SMALL 110
+# define DH_R_MODULUS_TOO_LARGE 103
+# define DH_R_NON_FIPS_METHOD 111
+# define DH_R_NO_PARAMETERS_SET 107
+# define DH_R_NO_PRIVATE_VALUE 100
+# define DH_R_PARAMETER_ENCODING_ERROR 105
+# define DH_R_PEER_KEY_ERROR 113
+# define DH_R_SHARED_INFO_ERROR 114
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/dsa.h b/protocols/Telegram/tgl/openssl/include/openssl/dsa.h
new file mode 100644
index 0000000000..545358fd02
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/dsa.h
@@ -0,0 +1,332 @@
+/* crypto/dsa/dsa.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+/*
+ * The DSS routines are based on patches supplied by
+ * Steven Schoch <schoch@sheba.arc.nasa.gov>. He basically did the
+ * work and I have just tweaked them a little to fit into my
+ * stylistic vision for SSLeay :-) */
+
+#ifndef HEADER_DSA_H
+# define HEADER_DSA_H
+
+# include <openssl/e_os2.h>
+
+# ifdef OPENSSL_NO_DSA
+# error DSA is disabled.
+# endif
+
+# ifndef OPENSSL_NO_BIO
+# include <openssl/bio.h>
+# endif
+# include <openssl/crypto.h>
+# include <openssl/ossl_typ.h>
+
+# ifndef OPENSSL_NO_DEPRECATED
+# include <openssl/bn.h>
+# ifndef OPENSSL_NO_DH
+# include <openssl/dh.h>
+# endif
+# endif
+
+# ifndef OPENSSL_DSA_MAX_MODULUS_BITS
+# define OPENSSL_DSA_MAX_MODULUS_BITS 10000
+# endif
+
+# define DSA_FLAG_CACHE_MONT_P 0x01
+/*
+ * new with 0.9.7h; the built-in DSA implementation now uses constant time
+ * modular exponentiation for secret exponents by default. This flag causes
+ * the faster variable sliding window method to be used for all exponents.
+ */
+# define DSA_FLAG_NO_EXP_CONSTTIME 0x02
+
+/*
+ * If this flag is set the DSA method is FIPS compliant and can be used in
+ * FIPS mode. This is set in the validated module method. If an application
+ * sets this flag in its own methods it is its reposibility to ensure the
+ * result is compliant.
+ */
+
+# define DSA_FLAG_FIPS_METHOD 0x0400
+
+/*
+ * If this flag is set the operations normally disabled in FIPS mode are
+ * permitted it is then the applications responsibility to ensure that the
+ * usage is compliant.
+ */
+
+# define DSA_FLAG_NON_FIPS_ALLOW 0x0400
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Already defined in ossl_typ.h */
+/* typedef struct dsa_st DSA; */
+/* typedef struct dsa_method DSA_METHOD; */
+
+typedef struct DSA_SIG_st {
+ BIGNUM *r;
+ BIGNUM *s;
+} DSA_SIG;
+
+struct dsa_method {
+ const char *name;
+ DSA_SIG *(*dsa_do_sign) (const unsigned char *dgst, int dlen, DSA *dsa);
+ int (*dsa_sign_setup) (DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp,
+ BIGNUM **rp);
+ int (*dsa_do_verify) (const unsigned char *dgst, int dgst_len,
+ DSA_SIG *sig, DSA *dsa);
+ int (*dsa_mod_exp) (DSA *dsa, BIGNUM *rr, BIGNUM *a1, BIGNUM *p1,
+ BIGNUM *a2, BIGNUM *p2, BIGNUM *m, BN_CTX *ctx,
+ BN_MONT_CTX *in_mont);
+ /* Can be null */
+ int (*bn_mod_exp) (DSA *dsa, BIGNUM *r, BIGNUM *a, const BIGNUM *p,
+ const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
+ int (*init) (DSA *dsa);
+ int (*finish) (DSA *dsa);
+ int flags;
+ char *app_data;
+ /* If this is non-NULL, it is used to generate DSA parameters */
+ int (*dsa_paramgen) (DSA *dsa, int bits,
+ const unsigned char *seed, int seed_len,
+ int *counter_ret, unsigned long *h_ret,
+ BN_GENCB *cb);
+ /* If this is non-NULL, it is used to generate DSA keys */
+ int (*dsa_keygen) (DSA *dsa);
+};
+
+struct dsa_st {
+ /*
+ * This first variable is used to pick up errors where a DSA is passed
+ * instead of of a EVP_PKEY
+ */
+ int pad;
+ long version;
+ int write_params;
+ BIGNUM *p;
+ BIGNUM *q; /* == 20 */
+ BIGNUM *g;
+ BIGNUM *pub_key; /* y public key */
+ BIGNUM *priv_key; /* x private key */
+ BIGNUM *kinv; /* Signing pre-calc */
+ BIGNUM *r; /* Signing pre-calc */
+ int flags;
+ /* Normally used to cache montgomery values */
+ BN_MONT_CTX *method_mont_p;
+ int references;
+ CRYPTO_EX_DATA ex_data;
+ const DSA_METHOD *meth;
+ /* functional reference if 'meth' is ENGINE-provided */
+ ENGINE *engine;
+};
+
+# define d2i_DSAparams_fp(fp,x) (DSA *)ASN1_d2i_fp((char *(*)())DSA_new, \
+ (char *(*)())d2i_DSAparams,(fp),(unsigned char **)(x))
+# define i2d_DSAparams_fp(fp,x) ASN1_i2d_fp(i2d_DSAparams,(fp), \
+ (unsigned char *)(x))
+# define d2i_DSAparams_bio(bp,x) ASN1_d2i_bio_of(DSA,DSA_new,d2i_DSAparams,bp,x)
+# define i2d_DSAparams_bio(bp,x) ASN1_i2d_bio_of_const(DSA,i2d_DSAparams,bp,x)
+
+DSA *DSAparams_dup(DSA *x);
+DSA_SIG *DSA_SIG_new(void);
+void DSA_SIG_free(DSA_SIG *a);
+int i2d_DSA_SIG(const DSA_SIG *a, unsigned char **pp);
+DSA_SIG *d2i_DSA_SIG(DSA_SIG **v, const unsigned char **pp, long length);
+
+DSA_SIG *DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa);
+int DSA_do_verify(const unsigned char *dgst, int dgst_len,
+ DSA_SIG *sig, DSA *dsa);
+
+const DSA_METHOD *DSA_OpenSSL(void);
+
+void DSA_set_default_method(const DSA_METHOD *);
+const DSA_METHOD *DSA_get_default_method(void);
+int DSA_set_method(DSA *dsa, const DSA_METHOD *);
+
+DSA *DSA_new(void);
+DSA *DSA_new_method(ENGINE *engine);
+void DSA_free(DSA *r);
+/* "up" the DSA object's reference count */
+int DSA_up_ref(DSA *r);
+int DSA_size(const DSA *);
+ /* next 4 return -1 on error */
+int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp);
+int DSA_sign(int type, const unsigned char *dgst, int dlen,
+ unsigned char *sig, unsigned int *siglen, DSA *dsa);
+int DSA_verify(int type, const unsigned char *dgst, int dgst_len,
+ const unsigned char *sigbuf, int siglen, DSA *dsa);
+int DSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
+ CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
+int DSA_set_ex_data(DSA *d, int idx, void *arg);
+void *DSA_get_ex_data(DSA *d, int idx);
+
+DSA *d2i_DSAPublicKey(DSA **a, const unsigned char **pp, long length);
+DSA *d2i_DSAPrivateKey(DSA **a, const unsigned char **pp, long length);
+DSA *d2i_DSAparams(DSA **a, const unsigned char **pp, long length);
+
+/* Deprecated version */
+# ifndef OPENSSL_NO_DEPRECATED
+DSA *DSA_generate_parameters(int bits,
+ unsigned char *seed, int seed_len,
+ int *counter_ret, unsigned long *h_ret, void
+ (*callback) (int, int, void *), void *cb_arg);
+# endif /* !defined(OPENSSL_NO_DEPRECATED) */
+
+/* New version */
+int DSA_generate_parameters_ex(DSA *dsa, int bits,
+ const unsigned char *seed, int seed_len,
+ int *counter_ret, unsigned long *h_ret,
+ BN_GENCB *cb);
+
+int DSA_generate_key(DSA *a);
+int i2d_DSAPublicKey(const DSA *a, unsigned char **pp);
+int i2d_DSAPrivateKey(const DSA *a, unsigned char **pp);
+int i2d_DSAparams(const DSA *a, unsigned char **pp);
+
+# ifndef OPENSSL_NO_BIO
+int DSAparams_print(BIO *bp, const DSA *x);
+int DSA_print(BIO *bp, const DSA *x, int off);
+# endif
+# ifndef OPENSSL_NO_FP_API
+int DSAparams_print_fp(FILE *fp, const DSA *x);
+int DSA_print_fp(FILE *bp, const DSA *x, int off);
+# endif
+
+# define DSS_prime_checks 50
+/*
+ * Primality test according to FIPS PUB 186[-1], Appendix 2.1: 50 rounds of
+ * Rabin-Miller
+ */
+# define DSA_is_prime(n, callback, cb_arg) \
+ BN_is_prime(n, DSS_prime_checks, callback, NULL, cb_arg)
+
+# ifndef OPENSSL_NO_DH
+/*
+ * Convert DSA structure (key or just parameters) into DH structure (be
+ * careful to avoid small subgroup attacks when using this!)
+ */
+DH *DSA_dup_DH(const DSA *r);
+# endif
+
+# define EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx, nbits) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN, \
+ EVP_PKEY_CTRL_DSA_PARAMGEN_BITS, nbits, NULL)
+
+# define EVP_PKEY_CTRL_DSA_PARAMGEN_BITS (EVP_PKEY_ALG_CTRL + 1)
+# define EVP_PKEY_CTRL_DSA_PARAMGEN_Q_BITS (EVP_PKEY_ALG_CTRL + 2)
+# define EVP_PKEY_CTRL_DSA_PARAMGEN_MD (EVP_PKEY_ALG_CTRL + 3)
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_DSA_strings(void);
+
+/* Error codes for the DSA functions. */
+
+/* Function codes. */
+# define DSA_F_D2I_DSA_SIG 110
+# define DSA_F_DO_DSA_PRINT 104
+# define DSA_F_DSAPARAMS_PRINT 100
+# define DSA_F_DSAPARAMS_PRINT_FP 101
+# define DSA_F_DSA_BUILTIN_PARAMGEN2 126
+# define DSA_F_DSA_DO_SIGN 112
+# define DSA_F_DSA_DO_VERIFY 113
+# define DSA_F_DSA_GENERATE_KEY 124
+# define DSA_F_DSA_GENERATE_PARAMETERS_EX 123
+# define DSA_F_DSA_NEW_METHOD 103
+# define DSA_F_DSA_PARAM_DECODE 119
+# define DSA_F_DSA_PRINT_FP 105
+# define DSA_F_DSA_PRIV_DECODE 115
+# define DSA_F_DSA_PRIV_ENCODE 116
+# define DSA_F_DSA_PUB_DECODE 117
+# define DSA_F_DSA_PUB_ENCODE 118
+# define DSA_F_DSA_SIGN 106
+# define DSA_F_DSA_SIGN_SETUP 107
+# define DSA_F_DSA_SIG_NEW 109
+# define DSA_F_DSA_SIG_PRINT 125
+# define DSA_F_DSA_VERIFY 108
+# define DSA_F_I2D_DSA_SIG 111
+# define DSA_F_OLD_DSA_PRIV_DECODE 122
+# define DSA_F_PKEY_DSA_CTRL 120
+# define DSA_F_PKEY_DSA_KEYGEN 121
+# define DSA_F_SIG_CB 114
+
+/* Reason codes. */
+# define DSA_R_BAD_Q_VALUE 102
+# define DSA_R_BN_DECODE_ERROR 108
+# define DSA_R_BN_ERROR 109
+# define DSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 100
+# define DSA_R_DECODE_ERROR 104
+# define DSA_R_INVALID_DIGEST_TYPE 106
+# define DSA_R_INVALID_PARAMETERS 112
+# define DSA_R_MISSING_PARAMETERS 101
+# define DSA_R_MODULUS_TOO_LARGE 103
+# define DSA_R_NEED_NEW_SETUP_VALUES 110
+# define DSA_R_NON_FIPS_DSA_METHOD 111
+# define DSA_R_NO_PARAMETERS_SET 107
+# define DSA_R_PARAMETER_ENCODING_ERROR 105
+# define DSA_R_Q_NOT_PRIME 113
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/dso.h b/protocols/Telegram/tgl/openssl/include/openssl/dso.h
new file mode 100644
index 0000000000..7c4a1dc4a6
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/dso.h
@@ -0,0 +1,451 @@
+/* dso.h -*- mode:C; c-file-style: "eay" -*- */
+/*
+ * Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL project
+ * 2000.
+ */
+/* ====================================================================
+ * Copyright (c) 2000 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_DSO_H
+# define HEADER_DSO_H
+
+# include <openssl/crypto.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* These values are used as commands to DSO_ctrl() */
+# define DSO_CTRL_GET_FLAGS 1
+# define DSO_CTRL_SET_FLAGS 2
+# define DSO_CTRL_OR_FLAGS 3
+
+/*
+ * By default, DSO_load() will translate the provided filename into a form
+ * typical for the platform (more specifically the DSO_METHOD) using the
+ * dso_name_converter function of the method. Eg. win32 will transform "blah"
+ * into "blah.dll", and dlfcn will transform it into "libblah.so". The
+ * behaviour can be overriden by setting the name_converter callback in the
+ * DSO object (using DSO_set_name_converter()). This callback could even
+ * utilise the DSO_METHOD's converter too if it only wants to override
+ * behaviour for one or two possible DSO methods. However, the following flag
+ * can be set in a DSO to prevent *any* native name-translation at all - eg.
+ * if the caller has prompted the user for a path to a driver library so the
+ * filename should be interpreted as-is.
+ */
+# define DSO_FLAG_NO_NAME_TRANSLATION 0x01
+/*
+ * An extra flag to give if only the extension should be added as
+ * translation. This is obviously only of importance on Unix and other
+ * operating systems where the translation also may prefix the name with
+ * something, like 'lib', and ignored everywhere else. This flag is also
+ * ignored if DSO_FLAG_NO_NAME_TRANSLATION is used at the same time.
+ */
+# define DSO_FLAG_NAME_TRANSLATION_EXT_ONLY 0x02
+
+/*
+ * The following flag controls the translation of symbol names to upper case.
+ * This is currently only being implemented for OpenVMS.
+ */
+# define DSO_FLAG_UPCASE_SYMBOL 0x10
+
+/*
+ * This flag loads the library with public symbols. Meaning: The exported
+ * symbols of this library are public to all libraries loaded after this
+ * library. At the moment only implemented in unix.
+ */
+# define DSO_FLAG_GLOBAL_SYMBOLS 0x20
+
+typedef void (*DSO_FUNC_TYPE) (void);
+
+typedef struct dso_st DSO;
+
+/*
+ * The function prototype used for method functions (or caller-provided
+ * callbacks) that transform filenames. They are passed a DSO structure
+ * pointer (or NULL if they are to be used independantly of a DSO object) and
+ * a filename to transform. They should either return NULL (if there is an
+ * error condition) or a newly allocated string containing the transformed
+ * form that the caller will need to free with OPENSSL_free() when done.
+ */
+typedef char *(*DSO_NAME_CONVERTER_FUNC)(DSO *, const char *);
+/*
+ * The function prototype used for method functions (or caller-provided
+ * callbacks) that merge two file specifications. They are passed a DSO
+ * structure pointer (or NULL if they are to be used independantly of a DSO
+ * object) and two file specifications to merge. They should either return
+ * NULL (if there is an error condition) or a newly allocated string
+ * containing the result of merging that the caller will need to free with
+ * OPENSSL_free() when done. Here, merging means that bits and pieces are
+ * taken from each of the file specifications and added together in whatever
+ * fashion that is sensible for the DSO method in question. The only rule
+ * that really applies is that if the two specification contain pieces of the
+ * same type, the copy from the first string takes priority. One could see
+ * it as the first specification is the one given by the user and the second
+ * being a bunch of defaults to add on if they're missing in the first.
+ */
+typedef char *(*DSO_MERGER_FUNC)(DSO *, const char *, const char *);
+
+typedef struct dso_meth_st {
+ const char *name;
+ /*
+ * Loads a shared library, NB: new DSO_METHODs must ensure that a
+ * successful load populates the loaded_filename field, and likewise a
+ * successful unload OPENSSL_frees and NULLs it out.
+ */
+ int (*dso_load) (DSO *dso);
+ /* Unloads a shared library */
+ int (*dso_unload) (DSO *dso);
+ /* Binds a variable */
+ void *(*dso_bind_var) (DSO *dso, const char *symname);
+ /*
+ * Binds a function - assumes a return type of DSO_FUNC_TYPE. This should
+ * be cast to the real function prototype by the caller. Platforms that
+ * don't have compatible representations for different prototypes (this
+ * is possible within ANSI C) are highly unlikely to have shared
+ * libraries at all, let alone a DSO_METHOD implemented for them.
+ */
+ DSO_FUNC_TYPE (*dso_bind_func) (DSO *dso, const char *symname);
+/* I don't think this would actually be used in any circumstances. */
+# if 0
+ /* Unbinds a variable */
+ int (*dso_unbind_var) (DSO *dso, char *symname, void *symptr);
+ /* Unbinds a function */
+ int (*dso_unbind_func) (DSO *dso, char *symname, DSO_FUNC_TYPE symptr);
+# endif
+ /*
+ * The generic (yuck) "ctrl()" function. NB: Negative return values
+ * (rather than zero) indicate errors.
+ */
+ long (*dso_ctrl) (DSO *dso, int cmd, long larg, void *parg);
+ /*
+ * The default DSO_METHOD-specific function for converting filenames to a
+ * canonical native form.
+ */
+ DSO_NAME_CONVERTER_FUNC dso_name_converter;
+ /*
+ * The default DSO_METHOD-specific function for converting filenames to a
+ * canonical native form.
+ */
+ DSO_MERGER_FUNC dso_merger;
+ /* [De]Initialisation handlers. */
+ int (*init) (DSO *dso);
+ int (*finish) (DSO *dso);
+ /* Return pathname of the module containing location */
+ int (*pathbyaddr) (void *addr, char *path, int sz);
+ /* Perform global symbol lookup, i.e. among *all* modules */
+ void *(*globallookup) (const char *symname);
+} DSO_METHOD;
+
+/**********************************************************************/
+/* The low-level handle type used to refer to a loaded shared library */
+
+struct dso_st {
+ DSO_METHOD *meth;
+ /*
+ * Standard dlopen uses a (void *). Win32 uses a HANDLE. VMS doesn't use
+ * anything but will need to cache the filename for use in the dso_bind
+ * handler. All in all, let each method control its own destiny.
+ * "Handles" and such go in a STACK.
+ */
+ STACK_OF(void) *meth_data;
+ int references;
+ int flags;
+ /*
+ * For use by applications etc ... use this for your bits'n'pieces, don't
+ * touch meth_data!
+ */
+ CRYPTO_EX_DATA ex_data;
+ /*
+ * If this callback function pointer is set to non-NULL, then it will be
+ * used in DSO_load() in place of meth->dso_name_converter. NB: This
+ * should normally set using DSO_set_name_converter().
+ */
+ DSO_NAME_CONVERTER_FUNC name_converter;
+ /*
+ * If this callback function pointer is set to non-NULL, then it will be
+ * used in DSO_load() in place of meth->dso_merger. NB: This should
+ * normally set using DSO_set_merger().
+ */
+ DSO_MERGER_FUNC merger;
+ /*
+ * This is populated with (a copy of) the platform-independant filename
+ * used for this DSO.
+ */
+ char *filename;
+ /*
+ * This is populated with (a copy of) the translated filename by which
+ * the DSO was actually loaded. It is NULL iff the DSO is not currently
+ * loaded. NB: This is here because the filename translation process may
+ * involve a callback being invoked more than once not only to convert to
+ * a platform-specific form, but also to try different filenames in the
+ * process of trying to perform a load. As such, this variable can be
+ * used to indicate (a) whether this DSO structure corresponds to a
+ * loaded library or not, and (b) the filename with which it was actually
+ * loaded.
+ */
+ char *loaded_filename;
+};
+
+DSO *DSO_new(void);
+DSO *DSO_new_method(DSO_METHOD *method);
+int DSO_free(DSO *dso);
+int DSO_flags(DSO *dso);
+int DSO_up_ref(DSO *dso);
+long DSO_ctrl(DSO *dso, int cmd, long larg, void *parg);
+
+/*
+ * This function sets the DSO's name_converter callback. If it is non-NULL,
+ * then it will be used instead of the associated DSO_METHOD's function. If
+ * oldcb is non-NULL then it is set to the function pointer value being
+ * replaced. Return value is non-zero for success.
+ */
+int DSO_set_name_converter(DSO *dso, DSO_NAME_CONVERTER_FUNC cb,
+ DSO_NAME_CONVERTER_FUNC *oldcb);
+/*
+ * These functions can be used to get/set the platform-independant filename
+ * used for a DSO. NB: set will fail if the DSO is already loaded.
+ */
+const char *DSO_get_filename(DSO *dso);
+int DSO_set_filename(DSO *dso, const char *filename);
+/*
+ * This function will invoke the DSO's name_converter callback to translate a
+ * filename, or if the callback isn't set it will instead use the DSO_METHOD's
+ * converter. If "filename" is NULL, the "filename" in the DSO itself will be
+ * used. If the DSO_FLAG_NO_NAME_TRANSLATION flag is set, then the filename is
+ * simply duplicated. NB: This function is usually called from within a
+ * DSO_METHOD during the processing of a DSO_load() call, and is exposed so
+ * that caller-created DSO_METHODs can do the same thing. A non-NULL return
+ * value will need to be OPENSSL_free()'d.
+ */
+char *DSO_convert_filename(DSO *dso, const char *filename);
+/*
+ * This function will invoke the DSO's merger callback to merge two file
+ * specifications, or if the callback isn't set it will instead use the
+ * DSO_METHOD's merger. A non-NULL return value will need to be
+ * OPENSSL_free()'d.
+ */
+char *DSO_merge(DSO *dso, const char *filespec1, const char *filespec2);
+/*
+ * If the DSO is currently loaded, this returns the filename that it was
+ * loaded under, otherwise it returns NULL. So it is also useful as a test as
+ * to whether the DSO is currently loaded. NB: This will not necessarily
+ * return the same value as DSO_convert_filename(dso, dso->filename), because
+ * the DSO_METHOD's load function may have tried a variety of filenames (with
+ * and/or without the aid of the converters) before settling on the one it
+ * actually loaded.
+ */
+const char *DSO_get_loaded_filename(DSO *dso);
+
+void DSO_set_default_method(DSO_METHOD *meth);
+DSO_METHOD *DSO_get_default_method(void);
+DSO_METHOD *DSO_get_method(DSO *dso);
+DSO_METHOD *DSO_set_method(DSO *dso, DSO_METHOD *meth);
+
+/*
+ * The all-singing all-dancing load function, you normally pass NULL for the
+ * first and third parameters. Use DSO_up and DSO_free for subsequent
+ * reference count handling. Any flags passed in will be set in the
+ * constructed DSO after its init() function but before the load operation.
+ * If 'dso' is non-NULL, 'flags' is ignored.
+ */
+DSO *DSO_load(DSO *dso, const char *filename, DSO_METHOD *meth, int flags);
+
+/* This function binds to a variable inside a shared library. */
+void *DSO_bind_var(DSO *dso, const char *symname);
+
+/* This function binds to a function inside a shared library. */
+DSO_FUNC_TYPE DSO_bind_func(DSO *dso, const char *symname);
+
+/*
+ * This method is the default, but will beg, borrow, or steal whatever method
+ * should be the default on any particular platform (including
+ * DSO_METH_null() if necessary).
+ */
+DSO_METHOD *DSO_METHOD_openssl(void);
+
+/*
+ * This method is defined for all platforms - if a platform has no DSO
+ * support then this will be the only method!
+ */
+DSO_METHOD *DSO_METHOD_null(void);
+
+/*
+ * If DSO_DLFCN is defined, the standard dlfcn.h-style functions (dlopen,
+ * dlclose, dlsym, etc) will be used and incorporated into this method. If
+ * not, this method will return NULL.
+ */
+DSO_METHOD *DSO_METHOD_dlfcn(void);
+
+/*
+ * If DSO_DL is defined, the standard dl.h-style functions (shl_load,
+ * shl_unload, shl_findsym, etc) will be used and incorporated into this
+ * method. If not, this method will return NULL.
+ */
+DSO_METHOD *DSO_METHOD_dl(void);
+
+/* If WIN32 is defined, use DLLs. If not, return NULL. */
+DSO_METHOD *DSO_METHOD_win32(void);
+
+/* If VMS is defined, use shared images. If not, return NULL. */
+DSO_METHOD *DSO_METHOD_vms(void);
+
+/*
+ * This function writes null-terminated pathname of DSO module containing
+ * 'addr' into 'sz' large caller-provided 'path' and returns the number of
+ * characters [including trailing zero] written to it. If 'sz' is 0 or
+ * negative, 'path' is ignored and required amount of charachers [including
+ * trailing zero] to accomodate pathname is returned. If 'addr' is NULL, then
+ * pathname of cryptolib itself is returned. Negative or zero return value
+ * denotes error.
+ */
+int DSO_pathbyaddr(void *addr, char *path, int sz);
+
+/*
+ * This function should be used with caution! It looks up symbols in *all*
+ * loaded modules and if module gets unloaded by somebody else attempt to
+ * dereference the pointer is doomed to have fatal consequences. Primary
+ * usage for this function is to probe *core* system functionality, e.g.
+ * check if getnameinfo(3) is available at run-time without bothering about
+ * OS-specific details such as libc.so.versioning or where does it actually
+ * reside: in libc itself or libsocket.
+ */
+void *DSO_global_lookup(const char *name);
+
+/* If BeOS is defined, use shared images. If not, return NULL. */
+DSO_METHOD *DSO_METHOD_beos(void);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_DSO_strings(void);
+
+/* Error codes for the DSO functions. */
+
+/* Function codes. */
+# define DSO_F_BEOS_BIND_FUNC 144
+# define DSO_F_BEOS_BIND_VAR 145
+# define DSO_F_BEOS_LOAD 146
+# define DSO_F_BEOS_NAME_CONVERTER 147
+# define DSO_F_BEOS_UNLOAD 148
+# define DSO_F_DLFCN_BIND_FUNC 100
+# define DSO_F_DLFCN_BIND_VAR 101
+# define DSO_F_DLFCN_LOAD 102
+# define DSO_F_DLFCN_MERGER 130
+# define DSO_F_DLFCN_NAME_CONVERTER 123
+# define DSO_F_DLFCN_UNLOAD 103
+# define DSO_F_DL_BIND_FUNC 104
+# define DSO_F_DL_BIND_VAR 105
+# define DSO_F_DL_LOAD 106
+# define DSO_F_DL_MERGER 131
+# define DSO_F_DL_NAME_CONVERTER 124
+# define DSO_F_DL_UNLOAD 107
+# define DSO_F_DSO_BIND_FUNC 108
+# define DSO_F_DSO_BIND_VAR 109
+# define DSO_F_DSO_CONVERT_FILENAME 126
+# define DSO_F_DSO_CTRL 110
+# define DSO_F_DSO_FREE 111
+# define DSO_F_DSO_GET_FILENAME 127
+# define DSO_F_DSO_GET_LOADED_FILENAME 128
+# define DSO_F_DSO_GLOBAL_LOOKUP 139
+# define DSO_F_DSO_LOAD 112
+# define DSO_F_DSO_MERGE 132
+# define DSO_F_DSO_NEW_METHOD 113
+# define DSO_F_DSO_PATHBYADDR 140
+# define DSO_F_DSO_SET_FILENAME 129
+# define DSO_F_DSO_SET_NAME_CONVERTER 122
+# define DSO_F_DSO_UP_REF 114
+# define DSO_F_GLOBAL_LOOKUP_FUNC 138
+# define DSO_F_PATHBYADDR 137
+# define DSO_F_VMS_BIND_SYM 115
+# define DSO_F_VMS_LOAD 116
+# define DSO_F_VMS_MERGER 133
+# define DSO_F_VMS_UNLOAD 117
+# define DSO_F_WIN32_BIND_FUNC 118
+# define DSO_F_WIN32_BIND_VAR 119
+# define DSO_F_WIN32_GLOBALLOOKUP 142
+# define DSO_F_WIN32_GLOBALLOOKUP_FUNC 143
+# define DSO_F_WIN32_JOINER 135
+# define DSO_F_WIN32_LOAD 120
+# define DSO_F_WIN32_MERGER 134
+# define DSO_F_WIN32_NAME_CONVERTER 125
+# define DSO_F_WIN32_PATHBYADDR 141
+# define DSO_F_WIN32_SPLITTER 136
+# define DSO_F_WIN32_UNLOAD 121
+
+/* Reason codes. */
+# define DSO_R_CTRL_FAILED 100
+# define DSO_R_DSO_ALREADY_LOADED 110
+# define DSO_R_EMPTY_FILE_STRUCTURE 113
+# define DSO_R_FAILURE 114
+# define DSO_R_FILENAME_TOO_BIG 101
+# define DSO_R_FINISH_FAILED 102
+# define DSO_R_INCORRECT_FILE_SYNTAX 115
+# define DSO_R_LOAD_FAILED 103
+# define DSO_R_NAME_TRANSLATION_FAILED 109
+# define DSO_R_NO_FILENAME 111
+# define DSO_R_NO_FILE_SPECIFICATION 116
+# define DSO_R_NULL_HANDLE 104
+# define DSO_R_SET_FILENAME_FAILED 112
+# define DSO_R_STACK_ERROR 105
+# define DSO_R_SYM_FAILURE 106
+# define DSO_R_UNLOAD_FAILED 107
+# define DSO_R_UNSUPPORTED 108
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/dtls1.h b/protocols/Telegram/tgl/openssl/include/openssl/dtls1.h
new file mode 100644
index 0000000000..30bbcf278a
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/dtls1.h
@@ -0,0 +1,272 @@
+/* ssl/dtls1.h */
+/*
+ * DTLS implementation written by Nagendra Modadugu
+ * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
+ */
+/* ====================================================================
+ * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_DTLS1_H
+# define HEADER_DTLS1_H
+
+# include <openssl/buffer.h>
+# include <openssl/pqueue.h>
+# ifdef OPENSSL_SYS_VMS
+# include <resource.h>
+# include <sys/timeb.h>
+# endif
+# ifdef OPENSSL_SYS_WIN32
+/* Needed for struct timeval */
+# include <winsock.h>
+# elif defined(OPENSSL_SYS_NETWARE) && !defined(_WINSOCK2API_)
+# include <sys/timeval.h>
+# else
+# if defined(OPENSSL_SYS_VXWORKS)
+# include <sys/times.h>
+# else
+# include <sys/time.h>
+# endif
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# define DTLS1_VERSION 0xFEFF
+# define DTLS1_2_VERSION 0xFEFD
+# define DTLS_MAX_VERSION DTLS1_2_VERSION
+# define DTLS1_VERSION_MAJOR 0xFE
+
+# define DTLS1_BAD_VER 0x0100
+
+/* Special value for method supporting multiple versions */
+# define DTLS_ANY_VERSION 0x1FFFF
+
+# if 0
+/* this alert description is not specified anywhere... */
+# define DTLS1_AD_MISSING_HANDSHAKE_MESSAGE 110
+# endif
+
+/* lengths of messages */
+# define DTLS1_COOKIE_LENGTH 256
+
+# define DTLS1_RT_HEADER_LENGTH 13
+
+# define DTLS1_HM_HEADER_LENGTH 12
+
+# define DTLS1_HM_BAD_FRAGMENT -2
+# define DTLS1_HM_FRAGMENT_RETRY -3
+
+# define DTLS1_CCS_HEADER_LENGTH 1
+
+# ifdef DTLS1_AD_MISSING_HANDSHAKE_MESSAGE
+# define DTLS1_AL_HEADER_LENGTH 7
+# else
+# define DTLS1_AL_HEADER_LENGTH 2
+# endif
+
+# ifndef OPENSSL_NO_SSL_INTERN
+
+# ifndef OPENSSL_NO_SCTP
+# define DTLS1_SCTP_AUTH_LABEL "EXPORTER_DTLS_OVER_SCTP"
+# endif
+
+/* Max MTU overhead we know about so far is 40 for IPv6 + 8 for UDP */
+# define DTLS1_MAX_MTU_OVERHEAD 48
+
+typedef struct dtls1_bitmap_st {
+ unsigned long map; /* track 32 packets on 32-bit systems and 64
+ * - on 64-bit systems */
+ unsigned char max_seq_num[8]; /* max record number seen so far, 64-bit
+ * value in big-endian encoding */
+} DTLS1_BITMAP;
+
+struct dtls1_retransmit_state {
+ EVP_CIPHER_CTX *enc_write_ctx; /* cryptographic state */
+ EVP_MD_CTX *write_hash; /* used for mac generation */
+# ifndef OPENSSL_NO_COMP
+ COMP_CTX *compress; /* compression */
+# else
+ char *compress;
+# endif
+ SSL_SESSION *session;
+ unsigned short epoch;
+};
+
+struct hm_header_st {
+ unsigned char type;
+ unsigned long msg_len;
+ unsigned short seq;
+ unsigned long frag_off;
+ unsigned long frag_len;
+ unsigned int is_ccs;
+ struct dtls1_retransmit_state saved_retransmit_state;
+};
+
+struct ccs_header_st {
+ unsigned char type;
+ unsigned short seq;
+};
+
+struct dtls1_timeout_st {
+ /* Number of read timeouts so far */
+ unsigned int read_timeouts;
+ /* Number of write timeouts so far */
+ unsigned int write_timeouts;
+ /* Number of alerts received so far */
+ unsigned int num_alerts;
+};
+
+typedef struct record_pqueue_st {
+ unsigned short epoch;
+ pqueue q;
+} record_pqueue;
+
+typedef struct hm_fragment_st {
+ struct hm_header_st msg_header;
+ unsigned char *fragment;
+ unsigned char *reassembly;
+} hm_fragment;
+
+typedef struct dtls1_state_st {
+ unsigned int send_cookie;
+ unsigned char cookie[DTLS1_COOKIE_LENGTH];
+ unsigned char rcvd_cookie[DTLS1_COOKIE_LENGTH];
+ unsigned int cookie_len;
+ /*
+ * The current data and handshake epoch. This is initially
+ * undefined, and starts at zero once the initial handshake is
+ * completed
+ */
+ unsigned short r_epoch;
+ unsigned short w_epoch;
+ /* records being received in the current epoch */
+ DTLS1_BITMAP bitmap;
+ /* renegotiation starts a new set of sequence numbers */
+ DTLS1_BITMAP next_bitmap;
+ /* handshake message numbers */
+ unsigned short handshake_write_seq;
+ unsigned short next_handshake_write_seq;
+ unsigned short handshake_read_seq;
+ /* save last sequence number for retransmissions */
+ unsigned char last_write_sequence[8];
+ /* Received handshake records (processed and unprocessed) */
+ record_pqueue unprocessed_rcds;
+ record_pqueue processed_rcds;
+ /* Buffered handshake messages */
+ pqueue buffered_messages;
+ /* Buffered (sent) handshake records */
+ pqueue sent_messages;
+ /*
+ * Buffered application records. Only for records between CCS and
+ * Finished to prevent either protocol violation or unnecessary message
+ * loss.
+ */
+ record_pqueue buffered_app_data;
+ /* Is set when listening for new connections with dtls1_listen() */
+ unsigned int listen;
+ unsigned int link_mtu; /* max on-the-wire DTLS packet size */
+ unsigned int mtu; /* max DTLS packet size */
+ struct hm_header_st w_msg_hdr;
+ struct hm_header_st r_msg_hdr;
+ struct dtls1_timeout_st timeout;
+ /*
+ * Indicates when the last handshake msg or heartbeat sent will timeout
+ */
+ struct timeval next_timeout;
+ /* Timeout duration */
+ unsigned short timeout_duration;
+ /*
+ * storage for Alert/Handshake protocol data received but not yet
+ * processed by ssl3_read_bytes:
+ */
+ unsigned char alert_fragment[DTLS1_AL_HEADER_LENGTH];
+ unsigned int alert_fragment_len;
+ unsigned char handshake_fragment[DTLS1_HM_HEADER_LENGTH];
+ unsigned int handshake_fragment_len;
+ unsigned int retransmitting;
+ /*
+ * Set when the handshake is ready to process peer's ChangeCipherSpec message.
+ * Cleared after the message has been processed.
+ */
+ unsigned int change_cipher_spec_ok;
+# ifndef OPENSSL_NO_SCTP
+ /* used when SSL_ST_XX_FLUSH is entered */
+ int next_state;
+ int shutdown_received;
+# endif
+} DTLS1_STATE;
+
+typedef struct dtls1_record_data_st {
+ unsigned char *packet;
+ unsigned int packet_length;
+ SSL3_BUFFER rbuf;
+ SSL3_RECORD rrec;
+# ifndef OPENSSL_NO_SCTP
+ struct bio_dgram_sctp_rcvinfo recordinfo;
+# endif
+} DTLS1_RECORD_DATA;
+
+# endif
+
+/* Timeout multipliers (timeout slice is defined in apps/timeouts.h */
+# define DTLS1_TMO_READ_COUNT 2
+# define DTLS1_TMO_WRITE_COUNT 2
+
+# define DTLS1_TMO_ALERT_COUNT 12
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/e_os2.h b/protocols/Telegram/tgl/openssl/include/openssl/e_os2.h
new file mode 100644
index 0000000000..7be9989ac3
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/e_os2.h
@@ -0,0 +1,328 @@
+/* e_os2.h */
+/* ====================================================================
+ * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#include <openssl/opensslconf.h>
+
+#ifndef HEADER_E_OS2_H
+# define HEADER_E_OS2_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/******************************************************************************
+ * Detect operating systems. This probably needs completing.
+ * The result is that at least one OPENSSL_SYS_os macro should be defined.
+ * However, if none is defined, Unix is assumed.
+ **/
+
+# define OPENSSL_SYS_UNIX
+
+/* ---------------------- Macintosh, before MacOS X ----------------------- */
+# if defined(__MWERKS__) && defined(macintosh) || defined(OPENSSL_SYSNAME_MAC)
+# undef OPENSSL_SYS_UNIX
+# define OPENSSL_SYS_MACINTOSH_CLASSIC
+# endif
+
+/* ---------------------- NetWare ----------------------------------------- */
+# if defined(NETWARE) || defined(OPENSSL_SYSNAME_NETWARE)
+# undef OPENSSL_SYS_UNIX
+# define OPENSSL_SYS_NETWARE
+# endif
+
+/* --------------------- Microsoft operating systems ---------------------- */
+
+/*
+ * Note that MSDOS actually denotes 32-bit environments running on top of
+ * MS-DOS, such as DJGPP one.
+ */
+# if defined(OPENSSL_SYSNAME_MSDOS)
+# undef OPENSSL_SYS_UNIX
+# define OPENSSL_SYS_MSDOS
+# endif
+
+/*
+ * For 32 bit environment, there seems to be the CygWin environment and then
+ * all the others that try to do the same thing Microsoft does...
+ */
+# if defined(OPENSSL_SYSNAME_UWIN)
+# undef OPENSSL_SYS_UNIX
+# define OPENSSL_SYS_WIN32_UWIN
+# else
+# if defined(__CYGWIN__) || defined(OPENSSL_SYSNAME_CYGWIN)
+# undef OPENSSL_SYS_UNIX
+# define OPENSSL_SYS_WIN32_CYGWIN
+# else
+# if defined(_WIN32) || defined(OPENSSL_SYSNAME_WIN32)
+# undef OPENSSL_SYS_UNIX
+# define OPENSSL_SYS_WIN32
+# endif
+# if defined(_WIN64) || defined(OPENSSL_SYSNAME_WIN64)
+# undef OPENSSL_SYS_UNIX
+# if !defined(OPENSSL_SYS_WIN64)
+# define OPENSSL_SYS_WIN64
+# endif
+# endif
+# if defined(OPENSSL_SYSNAME_WINNT)
+# undef OPENSSL_SYS_UNIX
+# define OPENSSL_SYS_WINNT
+# endif
+# if defined(OPENSSL_SYSNAME_WINCE)
+# undef OPENSSL_SYS_UNIX
+# define OPENSSL_SYS_WINCE
+# endif
+# endif
+# endif
+
+/* Anything that tries to look like Microsoft is "Windows" */
+# if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN64) || defined(OPENSSL_SYS_WINNT) || defined(OPENSSL_SYS_WINCE)
+# undef OPENSSL_SYS_UNIX
+# define OPENSSL_SYS_WINDOWS
+# ifndef OPENSSL_SYS_MSDOS
+# define OPENSSL_SYS_MSDOS
+# endif
+# endif
+
+/*
+ * DLL settings. This part is a bit tough, because it's up to the
+ * application implementor how he or she will link the application, so it
+ * requires some macro to be used.
+ */
+# ifdef OPENSSL_SYS_WINDOWS
+# ifndef OPENSSL_OPT_WINDLL
+# if defined(_WINDLL) /* This is used when building OpenSSL to
+ * indicate that DLL linkage should be used */
+# define OPENSSL_OPT_WINDLL
+# endif
+# endif
+# endif
+
+/* ------------------------------- OpenVMS -------------------------------- */
+# if defined(__VMS) || defined(VMS) || defined(OPENSSL_SYSNAME_VMS)
+# undef OPENSSL_SYS_UNIX
+# define OPENSSL_SYS_VMS
+# if defined(__DECC)
+# define OPENSSL_SYS_VMS_DECC
+# elif defined(__DECCXX)
+# define OPENSSL_SYS_VMS_DECC
+# define OPENSSL_SYS_VMS_DECCXX
+# else
+# define OPENSSL_SYS_VMS_NODECC
+# endif
+# endif
+
+/* -------------------------------- OS/2 ---------------------------------- */
+# if defined(__EMX__) || defined(__OS2__)
+# undef OPENSSL_SYS_UNIX
+# define OPENSSL_SYS_OS2
+# endif
+
+/* -------------------------------- Unix ---------------------------------- */
+# ifdef OPENSSL_SYS_UNIX
+# if defined(linux) || defined(__linux__) || defined(OPENSSL_SYSNAME_LINUX)
+# define OPENSSL_SYS_LINUX
+# endif
+# ifdef OPENSSL_SYSNAME_MPE
+# define OPENSSL_SYS_MPE
+# endif
+# ifdef OPENSSL_SYSNAME_SNI
+# define OPENSSL_SYS_SNI
+# endif
+# ifdef OPENSSL_SYSNAME_ULTRASPARC
+# define OPENSSL_SYS_ULTRASPARC
+# endif
+# ifdef OPENSSL_SYSNAME_NEWS4
+# define OPENSSL_SYS_NEWS4
+# endif
+# ifdef OPENSSL_SYSNAME_MACOSX
+# define OPENSSL_SYS_MACOSX
+# endif
+# ifdef OPENSSL_SYSNAME_MACOSX_RHAPSODY
+# define OPENSSL_SYS_MACOSX_RHAPSODY
+# define OPENSSL_SYS_MACOSX
+# endif
+# ifdef OPENSSL_SYSNAME_SUNOS
+# define OPENSSL_SYS_SUNOS
+# endif
+# if defined(_CRAY) || defined(OPENSSL_SYSNAME_CRAY)
+# define OPENSSL_SYS_CRAY
+# endif
+# if defined(_AIX) || defined(OPENSSL_SYSNAME_AIX)
+# define OPENSSL_SYS_AIX
+# endif
+# endif
+
+/* -------------------------------- VOS ----------------------------------- */
+# if defined(__VOS__) || defined(OPENSSL_SYSNAME_VOS)
+# define OPENSSL_SYS_VOS
+# ifdef __HPPA__
+# define OPENSSL_SYS_VOS_HPPA
+# endif
+# ifdef __IA32__
+# define OPENSSL_SYS_VOS_IA32
+# endif
+# endif
+
+/* ------------------------------ VxWorks --------------------------------- */
+# ifdef OPENSSL_SYSNAME_VXWORKS
+# define OPENSSL_SYS_VXWORKS
+# endif
+
+/* -------------------------------- BeOS ---------------------------------- */
+# if defined(__BEOS__)
+# define OPENSSL_SYS_BEOS
+# include <sys/socket.h>
+# if defined(BONE_VERSION)
+# define OPENSSL_SYS_BEOS_BONE
+# else
+# define OPENSSL_SYS_BEOS_R5
+# endif
+# endif
+
+/**
+ * That's it for OS-specific stuff
+ *****************************************************************************/
+
+/* Specials for I/O an exit */
+# ifdef OPENSSL_SYS_MSDOS
+# define OPENSSL_UNISTD_IO <io.h>
+# define OPENSSL_DECLARE_EXIT extern void exit(int);
+# else
+# define OPENSSL_UNISTD_IO OPENSSL_UNISTD
+# define OPENSSL_DECLARE_EXIT /* declared in unistd.h */
+# endif
+
+/*-
+ * Definitions of OPENSSL_GLOBAL and OPENSSL_EXTERN, to define and declare
+ * certain global symbols that, with some compilers under VMS, have to be
+ * defined and declared explicitely with globaldef and globalref.
+ * Definitions of OPENSSL_EXPORT and OPENSSL_IMPORT, to define and declare
+ * DLL exports and imports for compilers under Win32. These are a little
+ * more complicated to use. Basically, for any library that exports some
+ * global variables, the following code must be present in the header file
+ * that declares them, before OPENSSL_EXTERN is used:
+ *
+ * #ifdef SOME_BUILD_FLAG_MACRO
+ * # undef OPENSSL_EXTERN
+ * # define OPENSSL_EXTERN OPENSSL_EXPORT
+ * #endif
+ *
+ * The default is to have OPENSSL_EXPORT, OPENSSL_IMPORT and OPENSSL_GLOBAL
+ * have some generally sensible values, and for OPENSSL_EXTERN to have the
+ * value OPENSSL_IMPORT.
+ */
+
+# if defined(OPENSSL_SYS_VMS_NODECC)
+# define OPENSSL_EXPORT globalref
+# define OPENSSL_IMPORT globalref
+# define OPENSSL_GLOBAL globaldef
+# elif defined(OPENSSL_SYS_WINDOWS) && defined(OPENSSL_OPT_WINDLL)
+# define OPENSSL_EXPORT extern __declspec(dllexport)
+# define OPENSSL_IMPORT extern __declspec(dllimport)
+# define OPENSSL_GLOBAL
+# else
+# define OPENSSL_EXPORT extern
+# define OPENSSL_IMPORT extern
+# define OPENSSL_GLOBAL
+# endif
+# define OPENSSL_EXTERN OPENSSL_IMPORT
+
+/*-
+ * Macros to allow global variables to be reached through function calls when
+ * required (if a shared library version requires it, for example.
+ * The way it's done allows definitions like this:
+ *
+ * // in foobar.c
+ * OPENSSL_IMPLEMENT_GLOBAL(int,foobar,0)
+ * // in foobar.h
+ * OPENSSL_DECLARE_GLOBAL(int,foobar);
+ * #define foobar OPENSSL_GLOBAL_REF(foobar)
+ */
+# ifdef OPENSSL_EXPORT_VAR_AS_FUNCTION
+# define OPENSSL_IMPLEMENT_GLOBAL(type,name,value) \
+ type *_shadow_##name(void) \
+ { static type _hide_##name=value; return &_hide_##name; }
+# define OPENSSL_DECLARE_GLOBAL(type,name) type *_shadow_##name(void)
+# define OPENSSL_GLOBAL_REF(name) (*(_shadow_##name()))
+# else
+# define OPENSSL_IMPLEMENT_GLOBAL(type,name,value) OPENSSL_GLOBAL type _shadow_##name=value;
+# define OPENSSL_DECLARE_GLOBAL(type,name) OPENSSL_EXPORT type _shadow_##name
+# define OPENSSL_GLOBAL_REF(name) _shadow_##name
+# endif
+
+# if defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && macintosh==1 && !defined(MAC_OS_GUSI_SOURCE)
+# define ossl_ssize_t long
+# endif
+
+# ifdef OPENSSL_SYS_MSDOS
+# define ossl_ssize_t long
+# endif
+
+# if defined(NeXT) || defined(OPENSSL_SYS_NEWS4) || defined(OPENSSL_SYS_SUNOS)
+# define ssize_t int
+# endif
+
+# if defined(__ultrix) && !defined(ssize_t)
+# define ossl_ssize_t int
+# endif
+
+# ifndef ossl_ssize_t
+# define ossl_ssize_t ssize_t
+# endif
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/ebcdic.h b/protocols/Telegram/tgl/openssl/include/openssl/ebcdic.h
new file mode 100644
index 0000000000..4cbdfeb7ae
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/ebcdic.h
@@ -0,0 +1,26 @@
+/* crypto/ebcdic.h */
+
+#ifndef HEADER_EBCDIC_H
+# define HEADER_EBCDIC_H
+
+# include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Avoid name clashes with other applications */
+# define os_toascii _openssl_os_toascii
+# define os_toebcdic _openssl_os_toebcdic
+# define ebcdic2ascii _openssl_ebcdic2ascii
+# define ascii2ebcdic _openssl_ascii2ebcdic
+
+extern const unsigned char os_toascii[256];
+extern const unsigned char os_toebcdic[256];
+void *ebcdic2ascii(void *dest, const void *srce, size_t count);
+void *ascii2ebcdic(void *dest, const void *srce, size_t count);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/ec.h b/protocols/Telegram/tgl/openssl/include/openssl/ec.h
new file mode 100644
index 0000000000..6d3178f609
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/ec.h
@@ -0,0 +1,1282 @@
+/* crypto/ec/ec.h */
+/*
+ * Originally written by Bodo Moeller for the OpenSSL project.
+ */
+/**
+ * \file crypto/ec/ec.h Include file for the OpenSSL EC functions
+ * \author Originally written by Bodo Moeller for the OpenSSL project
+ */
+/* ====================================================================
+ * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+/* ====================================================================
+ * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
+ *
+ * Portions of the attached software ("Contribution") are developed by
+ * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project.
+ *
+ * The Contribution is licensed pursuant to the OpenSSL open source
+ * license provided above.
+ *
+ * The elliptic curve binary polynomial software is originally written by
+ * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories.
+ *
+ */
+
+#ifndef HEADER_EC_H
+# define HEADER_EC_H
+
+# include <openssl/opensslconf.h>
+
+# ifdef OPENSSL_NO_EC
+# error EC is disabled.
+# endif
+
+# include <openssl/asn1.h>
+# include <openssl/symhacks.h>
+# ifndef OPENSSL_NO_DEPRECATED
+# include <openssl/bn.h>
+# endif
+
+# ifdef __cplusplus
+extern "C" {
+# elif defined(__SUNPRO_C)
+# if __SUNPRO_C >= 0x520
+# pragma error_messages (off,E_ARRAY_OF_INCOMPLETE_NONAME,E_ARRAY_OF_INCOMPLETE)
+# endif
+# endif
+
+# ifndef OPENSSL_ECC_MAX_FIELD_BITS
+# define OPENSSL_ECC_MAX_FIELD_BITS 661
+# endif
+
+/** Enum for the point conversion form as defined in X9.62 (ECDSA)
+ * for the encoding of a elliptic curve point (x,y) */
+typedef enum {
+ /** the point is encoded as z||x, where the octet z specifies
+ * which solution of the quadratic equation y is */
+ POINT_CONVERSION_COMPRESSED = 2,
+ /** the point is encoded as z||x||y, where z is the octet 0x02 */
+ POINT_CONVERSION_UNCOMPRESSED = 4,
+ /** the point is encoded as z||x||y, where the octet z specifies
+ * which solution of the quadratic equation y is */
+ POINT_CONVERSION_HYBRID = 6
+} point_conversion_form_t;
+
+typedef struct ec_method_st EC_METHOD;
+
+typedef struct ec_group_st
+ /*-
+ EC_METHOD *meth;
+ -- field definition
+ -- curve coefficients
+ -- optional generator with associated information (order, cofactor)
+ -- optional extra data (precomputed table for fast computation of multiples of generator)
+ -- ASN1 stuff
+ */
+ EC_GROUP;
+
+typedef struct ec_point_st EC_POINT;
+
+/********************************************************************/
+/* EC_METHODs for curves over GF(p) */
+/********************************************************************/
+
+/** Returns the basic GFp ec methods which provides the basis for the
+ * optimized methods.
+ * \return EC_METHOD object
+ */
+const EC_METHOD *EC_GFp_simple_method(void);
+
+/** Returns GFp methods using montgomery multiplication.
+ * \return EC_METHOD object
+ */
+const EC_METHOD *EC_GFp_mont_method(void);
+
+/** Returns GFp methods using optimized methods for NIST recommended curves
+ * \return EC_METHOD object
+ */
+const EC_METHOD *EC_GFp_nist_method(void);
+
+# ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
+/** Returns 64-bit optimized methods for nistp224
+ * \return EC_METHOD object
+ */
+const EC_METHOD *EC_GFp_nistp224_method(void);
+
+/** Returns 64-bit optimized methods for nistp256
+ * \return EC_METHOD object
+ */
+const EC_METHOD *EC_GFp_nistp256_method(void);
+
+/** Returns 64-bit optimized methods for nistp521
+ * \return EC_METHOD object
+ */
+const EC_METHOD *EC_GFp_nistp521_method(void);
+# endif
+
+# ifndef OPENSSL_NO_EC2M
+/********************************************************************/
+/* EC_METHOD for curves over GF(2^m) */
+/********************************************************************/
+
+/** Returns the basic GF2m ec method
+ * \return EC_METHOD object
+ */
+const EC_METHOD *EC_GF2m_simple_method(void);
+
+# endif
+
+/********************************************************************/
+/* EC_GROUP functions */
+/********************************************************************/
+
+/** Creates a new EC_GROUP object
+ * \param meth EC_METHOD to use
+ * \return newly created EC_GROUP object or NULL in case of an error.
+ */
+EC_GROUP *EC_GROUP_new(const EC_METHOD *meth);
+
+/** Frees a EC_GROUP object
+ * \param group EC_GROUP object to be freed.
+ */
+void EC_GROUP_free(EC_GROUP *group);
+
+/** Clears and frees a EC_GROUP object
+ * \param group EC_GROUP object to be cleared and freed.
+ */
+void EC_GROUP_clear_free(EC_GROUP *group);
+
+/** Copies EC_GROUP objects. Note: both EC_GROUPs must use the same EC_METHOD.
+ * \param dst destination EC_GROUP object
+ * \param src source EC_GROUP object
+ * \return 1 on success and 0 if an error occurred.
+ */
+int EC_GROUP_copy(EC_GROUP *dst, const EC_GROUP *src);
+
+/** Creates a new EC_GROUP object and copies the copies the content
+ * form src to the newly created EC_KEY object
+ * \param src source EC_GROUP object
+ * \return newly created EC_GROUP object or NULL in case of an error.
+ */
+EC_GROUP *EC_GROUP_dup(const EC_GROUP *src);
+
+/** Returns the EC_METHOD of the EC_GROUP object.
+ * \param group EC_GROUP object
+ * \return EC_METHOD used in this EC_GROUP object.
+ */
+const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group);
+
+/** Returns the field type of the EC_METHOD.
+ * \param meth EC_METHOD object
+ * \return NID of the underlying field type OID.
+ */
+int EC_METHOD_get_field_type(const EC_METHOD *meth);
+
+/** Sets the generator and it's order/cofactor of a EC_GROUP object.
+ * \param group EC_GROUP object
+ * \param generator EC_POINT object with the generator.
+ * \param order the order of the group generated by the generator.
+ * \param cofactor the index of the sub-group generated by the generator
+ * in the group of all points on the elliptic curve.
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator,
+ const BIGNUM *order, const BIGNUM *cofactor);
+
+/** Returns the generator of a EC_GROUP object.
+ * \param group EC_GROUP object
+ * \return the currently used generator (possibly NULL).
+ */
+const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group);
+
+/** Returns the montgomery data for order(Generator)
+ * \param group EC_GROUP object
+ * \return the currently used generator (possibly NULL).
+*/
+BN_MONT_CTX *EC_GROUP_get_mont_data(const EC_GROUP *group);
+
+/** Gets the order of a EC_GROUP
+ * \param group EC_GROUP object
+ * \param order BIGNUM to which the order is copied
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx);
+
+/** Gets the cofactor of a EC_GROUP
+ * \param group EC_GROUP object
+ * \param cofactor BIGNUM to which the cofactor is copied
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor,
+ BN_CTX *ctx);
+
+/** Sets the name of a EC_GROUP object
+ * \param group EC_GROUP object
+ * \param nid NID of the curve name OID
+ */
+void EC_GROUP_set_curve_name(EC_GROUP *group, int nid);
+
+/** Returns the curve name of a EC_GROUP object
+ * \param group EC_GROUP object
+ * \return NID of the curve name OID or 0 if not set.
+ */
+int EC_GROUP_get_curve_name(const EC_GROUP *group);
+
+void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag);
+int EC_GROUP_get_asn1_flag(const EC_GROUP *group);
+
+void EC_GROUP_set_point_conversion_form(EC_GROUP *group,
+ point_conversion_form_t form);
+point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *);
+
+unsigned char *EC_GROUP_get0_seed(const EC_GROUP *x);
+size_t EC_GROUP_get_seed_len(const EC_GROUP *);
+size_t EC_GROUP_set_seed(EC_GROUP *, const unsigned char *, size_t len);
+
+/** Sets the parameter of a ec over GFp defined by y^2 = x^3 + a*x + b
+ * \param group EC_GROUP object
+ * \param p BIGNUM with the prime number
+ * \param a BIGNUM with parameter a of the equation
+ * \param b BIGNUM with parameter b of the equation
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a,
+ const BIGNUM *b, BN_CTX *ctx);
+
+/** Gets the parameter of the ec over GFp defined by y^2 = x^3 + a*x + b
+ * \param group EC_GROUP object
+ * \param p BIGNUM for the prime number
+ * \param a BIGNUM for parameter a of the equation
+ * \param b BIGNUM for parameter b of the equation
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a,
+ BIGNUM *b, BN_CTX *ctx);
+
+# ifndef OPENSSL_NO_EC2M
+/** Sets the parameter of a ec over GF2m defined by y^2 + x*y = x^3 + a*x^2 + b
+ * \param group EC_GROUP object
+ * \param p BIGNUM with the polynomial defining the underlying field
+ * \param a BIGNUM with parameter a of the equation
+ * \param b BIGNUM with parameter b of the equation
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_GROUP_set_curve_GF2m(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a,
+ const BIGNUM *b, BN_CTX *ctx);
+
+/** Gets the parameter of the ec over GF2m defined by y^2 + x*y = x^3 + a*x^2 + b
+ * \param group EC_GROUP object
+ * \param p BIGNUM for the polynomial defining the underlying field
+ * \param a BIGNUM for parameter a of the equation
+ * \param b BIGNUM for parameter b of the equation
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_GROUP_get_curve_GF2m(const EC_GROUP *group, BIGNUM *p, BIGNUM *a,
+ BIGNUM *b, BN_CTX *ctx);
+# endif
+/** Returns the number of bits needed to represent a field element
+ * \param group EC_GROUP object
+ * \return number of bits needed to represent a field element
+ */
+int EC_GROUP_get_degree(const EC_GROUP *group);
+
+/** Checks whether the parameter in the EC_GROUP define a valid ec group
+ * \param group EC_GROUP object
+ * \param ctx BN_CTX object (optional)
+ * \return 1 if group is a valid ec group and 0 otherwise
+ */
+int EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx);
+
+/** Checks whether the discriminant of the elliptic curve is zero or not
+ * \param group EC_GROUP object
+ * \param ctx BN_CTX object (optional)
+ * \return 1 if the discriminant is not zero and 0 otherwise
+ */
+int EC_GROUP_check_discriminant(const EC_GROUP *group, BN_CTX *ctx);
+
+/** Compares two EC_GROUP objects
+ * \param a first EC_GROUP object
+ * \param b second EC_GROUP object
+ * \param ctx BN_CTX object (optional)
+ * \return 0 if both groups are equal and 1 otherwise
+ */
+int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx);
+
+/*
+ * EC_GROUP_new_GF*() calls EC_GROUP_new() and EC_GROUP_set_GF*() after
+ * choosing an appropriate EC_METHOD
+ */
+
+/** Creates a new EC_GROUP object with the specified parameters defined
+ * over GFp (defined by the equation y^2 = x^3 + a*x + b)
+ * \param p BIGNUM with the prime number
+ * \param a BIGNUM with the parameter a of the equation
+ * \param b BIGNUM with the parameter b of the equation
+ * \param ctx BN_CTX object (optional)
+ * \return newly created EC_GROUP object with the specified parameters
+ */
+EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a,
+ const BIGNUM *b, BN_CTX *ctx);
+# ifndef OPENSSL_NO_EC2M
+/** Creates a new EC_GROUP object with the specified parameters defined
+ * over GF2m (defined by the equation y^2 + x*y = x^3 + a*x^2 + b)
+ * \param p BIGNUM with the polynomial defining the underlying field
+ * \param a BIGNUM with the parameter a of the equation
+ * \param b BIGNUM with the parameter b of the equation
+ * \param ctx BN_CTX object (optional)
+ * \return newly created EC_GROUP object with the specified parameters
+ */
+EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a,
+ const BIGNUM *b, BN_CTX *ctx);
+# endif
+/** Creates a EC_GROUP object with a curve specified by a NID
+ * \param nid NID of the OID of the curve name
+ * \return newly created EC_GROUP object with specified curve or NULL
+ * if an error occurred
+ */
+EC_GROUP *EC_GROUP_new_by_curve_name(int nid);
+
+/********************************************************************/
+/* handling of internal curves */
+/********************************************************************/
+
+typedef struct {
+ int nid;
+ const char *comment;
+} EC_builtin_curve;
+
+/*
+ * EC_builtin_curves(EC_builtin_curve *r, size_t size) returns number of all
+ * available curves or zero if a error occurred. In case r ist not zero
+ * nitems EC_builtin_curve structures are filled with the data of the first
+ * nitems internal groups
+ */
+size_t EC_get_builtin_curves(EC_builtin_curve *r, size_t nitems);
+
+const char *EC_curve_nid2nist(int nid);
+int EC_curve_nist2nid(const char *name);
+
+/********************************************************************/
+/* EC_POINT functions */
+/********************************************************************/
+
+/** Creates a new EC_POINT object for the specified EC_GROUP
+ * \param group EC_GROUP the underlying EC_GROUP object
+ * \return newly created EC_POINT object or NULL if an error occurred
+ */
+EC_POINT *EC_POINT_new(const EC_GROUP *group);
+
+/** Frees a EC_POINT object
+ * \param point EC_POINT object to be freed
+ */
+void EC_POINT_free(EC_POINT *point);
+
+/** Clears and frees a EC_POINT object
+ * \param point EC_POINT object to be cleared and freed
+ */
+void EC_POINT_clear_free(EC_POINT *point);
+
+/** Copies EC_POINT object
+ * \param dst destination EC_POINT object
+ * \param src source EC_POINT object
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_copy(EC_POINT *dst, const EC_POINT *src);
+
+/** Creates a new EC_POINT object and copies the content of the supplied
+ * EC_POINT
+ * \param src source EC_POINT object
+ * \param group underlying the EC_GROUP object
+ * \return newly created EC_POINT object or NULL if an error occurred
+ */
+EC_POINT *EC_POINT_dup(const EC_POINT *src, const EC_GROUP *group);
+
+/** Returns the EC_METHOD used in EC_POINT object
+ * \param point EC_POINT object
+ * \return the EC_METHOD used
+ */
+const EC_METHOD *EC_POINT_method_of(const EC_POINT *point);
+
+/** Sets a point to infinity (neutral element)
+ * \param group underlying EC_GROUP object
+ * \param point EC_POINT to set to infinity
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point);
+
+/** Sets the jacobian projective coordinates of a EC_POINT over GFp
+ * \param group underlying EC_GROUP object
+ * \param p EC_POINT object
+ * \param x BIGNUM with the x-coordinate
+ * \param y BIGNUM with the y-coordinate
+ * \param z BIGNUM with the z-coordinate
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group,
+ EC_POINT *p, const BIGNUM *x,
+ const BIGNUM *y, const BIGNUM *z,
+ BN_CTX *ctx);
+
+/** Gets the jacobian projective coordinates of a EC_POINT over GFp
+ * \param group underlying EC_GROUP object
+ * \param p EC_POINT object
+ * \param x BIGNUM for the x-coordinate
+ * \param y BIGNUM for the y-coordinate
+ * \param z BIGNUM for the z-coordinate
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group,
+ const EC_POINT *p, BIGNUM *x,
+ BIGNUM *y, BIGNUM *z,
+ BN_CTX *ctx);
+
+/** Sets the affine coordinates of a EC_POINT over GFp
+ * \param group underlying EC_GROUP object
+ * \param p EC_POINT object
+ * \param x BIGNUM with the x-coordinate
+ * \param y BIGNUM with the y-coordinate
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
+ const BIGNUM *x, const BIGNUM *y,
+ BN_CTX *ctx);
+
+/** Gets the affine coordinates of a EC_POINT over GFp
+ * \param group underlying EC_GROUP object
+ * \param p EC_POINT object
+ * \param x BIGNUM for the x-coordinate
+ * \param y BIGNUM for the y-coordinate
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group,
+ const EC_POINT *p, BIGNUM *x,
+ BIGNUM *y, BN_CTX *ctx);
+
+/** Sets the x9.62 compressed coordinates of a EC_POINT over GFp
+ * \param group underlying EC_GROUP object
+ * \param p EC_POINT object
+ * \param x BIGNUM with x-coordinate
+ * \param y_bit integer with the y-Bit (either 0 or 1)
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group,
+ EC_POINT *p, const BIGNUM *x,
+ int y_bit, BN_CTX *ctx);
+# ifndef OPENSSL_NO_EC2M
+/** Sets the affine coordinates of a EC_POINT over GF2m
+ * \param group underlying EC_GROUP object
+ * \param p EC_POINT object
+ * \param x BIGNUM with the x-coordinate
+ * \param y BIGNUM with the y-coordinate
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p,
+ const BIGNUM *x, const BIGNUM *y,
+ BN_CTX *ctx);
+
+/** Gets the affine coordinates of a EC_POINT over GF2m
+ * \param group underlying EC_GROUP object
+ * \param p EC_POINT object
+ * \param x BIGNUM for the x-coordinate
+ * \param y BIGNUM for the y-coordinate
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group,
+ const EC_POINT *p, BIGNUM *x,
+ BIGNUM *y, BN_CTX *ctx);
+
+/** Sets the x9.62 compressed coordinates of a EC_POINT over GF2m
+ * \param group underlying EC_GROUP object
+ * \param p EC_POINT object
+ * \param x BIGNUM with x-coordinate
+ * \param y_bit integer with the y-Bit (either 0 or 1)
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *group,
+ EC_POINT *p, const BIGNUM *x,
+ int y_bit, BN_CTX *ctx);
+# endif
+/** Encodes a EC_POINT object to a octet string
+ * \param group underlying EC_GROUP object
+ * \param p EC_POINT object
+ * \param form point conversion form
+ * \param buf memory buffer for the result. If NULL the function returns
+ * required buffer size.
+ * \param len length of the memory buffer
+ * \param ctx BN_CTX object (optional)
+ * \return the length of the encoded octet string or 0 if an error occurred
+ */
+size_t EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *p,
+ point_conversion_form_t form,
+ unsigned char *buf, size_t len, BN_CTX *ctx);
+
+/** Decodes a EC_POINT from a octet string
+ * \param group underlying EC_GROUP object
+ * \param p EC_POINT object
+ * \param buf memory buffer with the encoded ec point
+ * \param len length of the encoded ec point
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *p,
+ const unsigned char *buf, size_t len, BN_CTX *ctx);
+
+/* other interfaces to point2oct/oct2point: */
+BIGNUM *EC_POINT_point2bn(const EC_GROUP *, const EC_POINT *,
+ point_conversion_form_t form, BIGNUM *, BN_CTX *);
+EC_POINT *EC_POINT_bn2point(const EC_GROUP *, const BIGNUM *,
+ EC_POINT *, BN_CTX *);
+char *EC_POINT_point2hex(const EC_GROUP *, const EC_POINT *,
+ point_conversion_form_t form, BN_CTX *);
+EC_POINT *EC_POINT_hex2point(const EC_GROUP *, const char *,
+ EC_POINT *, BN_CTX *);
+
+/********************************************************************/
+/* functions for doing EC_POINT arithmetic */
+/********************************************************************/
+
+/** Computes the sum of two EC_POINT
+ * \param group underlying EC_GROUP object
+ * \param r EC_POINT object for the result (r = a + b)
+ * \param a EC_POINT object with the first summand
+ * \param b EC_POINT object with the second summand
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
+ const EC_POINT *b, BN_CTX *ctx);
+
+/** Computes the double of a EC_POINT
+ * \param group underlying EC_GROUP object
+ * \param r EC_POINT object for the result (r = 2 * a)
+ * \param a EC_POINT object
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
+ BN_CTX *ctx);
+
+/** Computes the inverse of a EC_POINT
+ * \param group underlying EC_GROUP object
+ * \param a EC_POINT object to be inverted (it's used for the result as well)
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx);
+
+/** Checks whether the point is the neutral element of the group
+ * \param group the underlying EC_GROUP object
+ * \param p EC_POINT object
+ * \return 1 if the point is the neutral element and 0 otherwise
+ */
+int EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *p);
+
+/** Checks whether the point is on the curve
+ * \param group underlying EC_GROUP object
+ * \param point EC_POINT object to check
+ * \param ctx BN_CTX object (optional)
+ * \return 1 if point if on the curve and 0 otherwise
+ */
+int EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point,
+ BN_CTX *ctx);
+
+/** Compares two EC_POINTs
+ * \param group underlying EC_GROUP object
+ * \param a first EC_POINT object
+ * \param b second EC_POINT object
+ * \param ctx BN_CTX object (optional)
+ * \return 0 if both points are equal and a value != 0 otherwise
+ */
+int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b,
+ BN_CTX *ctx);
+
+int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx);
+int EC_POINTs_make_affine(const EC_GROUP *group, size_t num,
+ EC_POINT *points[], BN_CTX *ctx);
+
+/** Computes r = generator * n sum_{i=0}^{num-1} p[i] * m[i]
+ * \param group underlying EC_GROUP object
+ * \param r EC_POINT object for the result
+ * \param n BIGNUM with the multiplier for the group generator (optional)
+ * \param num number futher summands
+ * \param p array of size num of EC_POINT objects
+ * \param m array of size num of BIGNUM objects
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n,
+ size_t num, const EC_POINT *p[], const BIGNUM *m[],
+ BN_CTX *ctx);
+
+/** Computes r = generator * n + q * m
+ * \param group underlying EC_GROUP object
+ * \param r EC_POINT object for the result
+ * \param n BIGNUM with the multiplier for the group generator (optional)
+ * \param q EC_POINT object with the first factor of the second summand
+ * \param m BIGNUM with the second factor of the second summand
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n,
+ const EC_POINT *q, const BIGNUM *m, BN_CTX *ctx);
+
+/** Stores multiples of generator for faster point multiplication
+ * \param group EC_GROUP object
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx);
+
+/** Reports whether a precomputation has been done
+ * \param group EC_GROUP object
+ * \return 1 if a pre-computation has been done and 0 otherwise
+ */
+int EC_GROUP_have_precompute_mult(const EC_GROUP *group);
+
+/********************************************************************/
+/* ASN1 stuff */
+/********************************************************************/
+
+/*
+ * EC_GROUP_get_basis_type() returns the NID of the basis type used to
+ * represent the field elements
+ */
+int EC_GROUP_get_basis_type(const EC_GROUP *);
+# ifndef OPENSSL_NO_EC2M
+int EC_GROUP_get_trinomial_basis(const EC_GROUP *, unsigned int *k);
+int EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1,
+ unsigned int *k2, unsigned int *k3);
+# endif
+
+# define OPENSSL_EC_NAMED_CURVE 0x001
+
+typedef struct ecpk_parameters_st ECPKPARAMETERS;
+
+EC_GROUP *d2i_ECPKParameters(EC_GROUP **, const unsigned char **in, long len);
+int i2d_ECPKParameters(const EC_GROUP *, unsigned char **out);
+
+# define d2i_ECPKParameters_bio(bp,x) ASN1_d2i_bio_of(EC_GROUP,NULL,d2i_ECPKParameters,bp,x)
+# define i2d_ECPKParameters_bio(bp,x) ASN1_i2d_bio_of_const(EC_GROUP,i2d_ECPKParameters,bp,x)
+# define d2i_ECPKParameters_fp(fp,x) (EC_GROUP *)ASN1_d2i_fp(NULL, \
+ (char *(*)())d2i_ECPKParameters,(fp),(unsigned char **)(x))
+# define i2d_ECPKParameters_fp(fp,x) ASN1_i2d_fp(i2d_ECPKParameters,(fp), \
+ (unsigned char *)(x))
+
+# ifndef OPENSSL_NO_BIO
+int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off);
+# endif
+# ifndef OPENSSL_NO_FP_API
+int ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off);
+# endif
+
+/********************************************************************/
+/* EC_KEY functions */
+/********************************************************************/
+
+typedef struct ec_key_st EC_KEY;
+
+/* some values for the encoding_flag */
+# define EC_PKEY_NO_PARAMETERS 0x001
+# define EC_PKEY_NO_PUBKEY 0x002
+
+/* some values for the flags field */
+# define EC_FLAG_NON_FIPS_ALLOW 0x1
+# define EC_FLAG_FIPS_CHECKED 0x2
+
+/** Creates a new EC_KEY object.
+ * \return EC_KEY object or NULL if an error occurred.
+ */
+EC_KEY *EC_KEY_new(void);
+
+int EC_KEY_get_flags(const EC_KEY *key);
+
+void EC_KEY_set_flags(EC_KEY *key, int flags);
+
+void EC_KEY_clear_flags(EC_KEY *key, int flags);
+
+/** Creates a new EC_KEY object using a named curve as underlying
+ * EC_GROUP object.
+ * \param nid NID of the named curve.
+ * \return EC_KEY object or NULL if an error occurred.
+ */
+EC_KEY *EC_KEY_new_by_curve_name(int nid);
+
+/** Frees a EC_KEY object.
+ * \param key EC_KEY object to be freed.
+ */
+void EC_KEY_free(EC_KEY *key);
+
+/** Copies a EC_KEY object.
+ * \param dst destination EC_KEY object
+ * \param src src EC_KEY object
+ * \return dst or NULL if an error occurred.
+ */
+EC_KEY *EC_KEY_copy(EC_KEY *dst, const EC_KEY *src);
+
+/** Creates a new EC_KEY object and copies the content from src to it.
+ * \param src the source EC_KEY object
+ * \return newly created EC_KEY object or NULL if an error occurred.
+ */
+EC_KEY *EC_KEY_dup(const EC_KEY *src);
+
+/** Increases the internal reference count of a EC_KEY object.
+ * \param key EC_KEY object
+ * \return 1 on success and 0 if an error occurred.
+ */
+int EC_KEY_up_ref(EC_KEY *key);
+
+/** Returns the EC_GROUP object of a EC_KEY object
+ * \param key EC_KEY object
+ * \return the EC_GROUP object (possibly NULL).
+ */
+const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key);
+
+/** Sets the EC_GROUP of a EC_KEY object.
+ * \param key EC_KEY object
+ * \param group EC_GROUP to use in the EC_KEY object (note: the EC_KEY
+ * object will use an own copy of the EC_GROUP).
+ * \return 1 on success and 0 if an error occurred.
+ */
+int EC_KEY_set_group(EC_KEY *key, const EC_GROUP *group);
+
+/** Returns the private key of a EC_KEY object.
+ * \param key EC_KEY object
+ * \return a BIGNUM with the private key (possibly NULL).
+ */
+const BIGNUM *EC_KEY_get0_private_key(const EC_KEY *key);
+
+/** Sets the private key of a EC_KEY object.
+ * \param key EC_KEY object
+ * \param prv BIGNUM with the private key (note: the EC_KEY object
+ * will use an own copy of the BIGNUM).
+ * \return 1 on success and 0 if an error occurred.
+ */
+int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *prv);
+
+/** Returns the public key of a EC_KEY object.
+ * \param key the EC_KEY object
+ * \return a EC_POINT object with the public key (possibly NULL)
+ */
+const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *key);
+
+/** Sets the public key of a EC_KEY object.
+ * \param key EC_KEY object
+ * \param pub EC_POINT object with the public key (note: the EC_KEY object
+ * will use an own copy of the EC_POINT object).
+ * \return 1 on success and 0 if an error occurred.
+ */
+int EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub);
+
+unsigned EC_KEY_get_enc_flags(const EC_KEY *key);
+void EC_KEY_set_enc_flags(EC_KEY *eckey, unsigned int flags);
+point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *key);
+void EC_KEY_set_conv_form(EC_KEY *eckey, point_conversion_form_t cform);
+/* functions to set/get method specific data */
+void *EC_KEY_get_key_method_data(EC_KEY *key,
+ void *(*dup_func) (void *),
+ void (*free_func) (void *),
+ void (*clear_free_func) (void *));
+/** Sets the key method data of an EC_KEY object, if none has yet been set.
+ * \param key EC_KEY object
+ * \param data opaque data to install.
+ * \param dup_func a function that duplicates |data|.
+ * \param free_func a function that frees |data|.
+ * \param clear_free_func a function that wipes and frees |data|.
+ * \return the previously set data pointer, or NULL if |data| was inserted.
+ */
+void *EC_KEY_insert_key_method_data(EC_KEY *key, void *data,
+ void *(*dup_func) (void *),
+ void (*free_func) (void *),
+ void (*clear_free_func) (void *));
+/* wrapper functions for the underlying EC_GROUP object */
+void EC_KEY_set_asn1_flag(EC_KEY *eckey, int asn1_flag);
+
+/** Creates a table of pre-computed multiples of the generator to
+ * accelerate further EC_KEY operations.
+ * \param key EC_KEY object
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occurred.
+ */
+int EC_KEY_precompute_mult(EC_KEY *key, BN_CTX *ctx);
+
+/** Creates a new ec private (and optional a new public) key.
+ * \param key EC_KEY object
+ * \return 1 on success and 0 if an error occurred.
+ */
+int EC_KEY_generate_key(EC_KEY *key);
+
+/** Verifies that a private and/or public key is valid.
+ * \param key the EC_KEY object
+ * \return 1 on success and 0 otherwise.
+ */
+int EC_KEY_check_key(const EC_KEY *key);
+
+/** Sets a public key from affine coordindates performing
+ * neccessary NIST PKV tests.
+ * \param key the EC_KEY object
+ * \param x public key x coordinate
+ * \param y public key y coordinate
+ * \return 1 on success and 0 otherwise.
+ */
+int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x,
+ BIGNUM *y);
+
+/********************************************************************/
+/* de- and encoding functions for SEC1 ECPrivateKey */
+/********************************************************************/
+
+/** Decodes a private key from a memory buffer.
+ * \param key a pointer to a EC_KEY object which should be used (or NULL)
+ * \param in pointer to memory with the DER encoded private key
+ * \param len length of the DER encoded private key
+ * \return the decoded private key or NULL if an error occurred.
+ */
+EC_KEY *d2i_ECPrivateKey(EC_KEY **key, const unsigned char **in, long len);
+
+/** Encodes a private key object and stores the result in a buffer.
+ * \param key the EC_KEY object to encode
+ * \param out the buffer for the result (if NULL the function returns number
+ * of bytes needed).
+ * \return 1 on success and 0 if an error occurred.
+ */
+int i2d_ECPrivateKey(EC_KEY *key, unsigned char **out);
+
+/********************************************************************/
+/* de- and encoding functions for EC parameters */
+/********************************************************************/
+
+/** Decodes ec parameter from a memory buffer.
+ * \param key a pointer to a EC_KEY object which should be used (or NULL)
+ * \param in pointer to memory with the DER encoded ec parameters
+ * \param len length of the DER encoded ec parameters
+ * \return a EC_KEY object with the decoded parameters or NULL if an error
+ * occurred.
+ */
+EC_KEY *d2i_ECParameters(EC_KEY **key, const unsigned char **in, long len);
+
+/** Encodes ec parameter and stores the result in a buffer.
+ * \param key the EC_KEY object with ec paramters to encode
+ * \param out the buffer for the result (if NULL the function returns number
+ * of bytes needed).
+ * \return 1 on success and 0 if an error occurred.
+ */
+int i2d_ECParameters(EC_KEY *key, unsigned char **out);
+
+/********************************************************************/
+/* de- and encoding functions for EC public key */
+/* (octet string, not DER -- hence 'o2i' and 'i2o') */
+/********************************************************************/
+
+/** Decodes a ec public key from a octet string.
+ * \param key a pointer to a EC_KEY object which should be used
+ * \param in memory buffer with the encoded public key
+ * \param len length of the encoded public key
+ * \return EC_KEY object with decoded public key or NULL if an error
+ * occurred.
+ */
+EC_KEY *o2i_ECPublicKey(EC_KEY **key, const unsigned char **in, long len);
+
+/** Encodes a ec public key in an octet string.
+ * \param key the EC_KEY object with the public key
+ * \param out the buffer for the result (if NULL the function returns number
+ * of bytes needed).
+ * \return 1 on success and 0 if an error occurred
+ */
+int i2o_ECPublicKey(EC_KEY *key, unsigned char **out);
+
+# ifndef OPENSSL_NO_BIO
+/** Prints out the ec parameters on human readable form.
+ * \param bp BIO object to which the information is printed
+ * \param key EC_KEY object
+ * \return 1 on success and 0 if an error occurred
+ */
+int ECParameters_print(BIO *bp, const EC_KEY *key);
+
+/** Prints out the contents of a EC_KEY object
+ * \param bp BIO object to which the information is printed
+ * \param key EC_KEY object
+ * \param off line offset
+ * \return 1 on success and 0 if an error occurred
+ */
+int EC_KEY_print(BIO *bp, const EC_KEY *key, int off);
+
+# endif
+# ifndef OPENSSL_NO_FP_API
+/** Prints out the ec parameters on human readable form.
+ * \param fp file descriptor to which the information is printed
+ * \param key EC_KEY object
+ * \return 1 on success and 0 if an error occurred
+ */
+int ECParameters_print_fp(FILE *fp, const EC_KEY *key);
+
+/** Prints out the contents of a EC_KEY object
+ * \param fp file descriptor to which the information is printed
+ * \param key EC_KEY object
+ * \param off line offset
+ * \return 1 on success and 0 if an error occurred
+ */
+int EC_KEY_print_fp(FILE *fp, const EC_KEY *key, int off);
+
+# endif
+
+# define ECParameters_dup(x) ASN1_dup_of(EC_KEY,i2d_ECParameters,d2i_ECParameters,x)
+
+# ifndef __cplusplus
+# if defined(__SUNPRO_C)
+# if __SUNPRO_C >= 0x520
+# pragma error_messages (default,E_ARRAY_OF_INCOMPLETE_NONAME,E_ARRAY_OF_INCOMPLETE)
+# endif
+# endif
+# endif
+
+# define EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx, nid) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
+ EVP_PKEY_OP_PARAMGEN|EVP_PKEY_OP_KEYGEN, \
+ EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID, nid, NULL)
+
+# define EVP_PKEY_CTX_set_ec_param_enc(ctx, flag) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
+ EVP_PKEY_OP_PARAMGEN|EVP_PKEY_OP_KEYGEN, \
+ EVP_PKEY_CTRL_EC_PARAM_ENC, flag, NULL)
+
+# define EVP_PKEY_CTX_set_ecdh_cofactor_mode(ctx, flag) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_EC_ECDH_COFACTOR, flag, NULL)
+
+# define EVP_PKEY_CTX_get_ecdh_cofactor_mode(ctx) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_EC_ECDH_COFACTOR, -2, NULL)
+
+# define EVP_PKEY_CTX_set_ecdh_kdf_type(ctx, kdf) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_EC_KDF_TYPE, kdf, NULL)
+
+# define EVP_PKEY_CTX_get_ecdh_kdf_type(ctx) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_EC_KDF_TYPE, -2, NULL)
+
+# define EVP_PKEY_CTX_set_ecdh_kdf_md(ctx, md) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_EC_KDF_MD, 0, (void *)md)
+
+# define EVP_PKEY_CTX_get_ecdh_kdf_md(ctx, pmd) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_GET_EC_KDF_MD, 0, (void *)pmd)
+
+# define EVP_PKEY_CTX_set_ecdh_kdf_outlen(ctx, len) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_EC_KDF_OUTLEN, len, NULL)
+
+# define EVP_PKEY_CTX_get_ecdh_kdf_outlen(ctx, plen) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_GET_EC_KDF_OUTLEN, 0, (void *)plen)
+
+# define EVP_PKEY_CTX_set0_ecdh_kdf_ukm(ctx, p, plen) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_EC_KDF_UKM, plen, (void *)p)
+
+# define EVP_PKEY_CTX_get0_ecdh_kdf_ukm(ctx, p) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_GET_EC_KDF_UKM, 0, (void *)p)
+
+# define EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID (EVP_PKEY_ALG_CTRL + 1)
+# define EVP_PKEY_CTRL_EC_PARAM_ENC (EVP_PKEY_ALG_CTRL + 2)
+# define EVP_PKEY_CTRL_EC_ECDH_COFACTOR (EVP_PKEY_ALG_CTRL + 3)
+# define EVP_PKEY_CTRL_EC_KDF_TYPE (EVP_PKEY_ALG_CTRL + 4)
+# define EVP_PKEY_CTRL_EC_KDF_MD (EVP_PKEY_ALG_CTRL + 5)
+# define EVP_PKEY_CTRL_GET_EC_KDF_MD (EVP_PKEY_ALG_CTRL + 6)
+# define EVP_PKEY_CTRL_EC_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 7)
+# define EVP_PKEY_CTRL_GET_EC_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 8)
+# define EVP_PKEY_CTRL_EC_KDF_UKM (EVP_PKEY_ALG_CTRL + 9)
+# define EVP_PKEY_CTRL_GET_EC_KDF_UKM (EVP_PKEY_ALG_CTRL + 10)
+/* KDF types */
+# define EVP_PKEY_ECDH_KDF_NONE 1
+# define EVP_PKEY_ECDH_KDF_X9_62 2
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_EC_strings(void);
+
+/* Error codes for the EC functions. */
+
+/* Function codes. */
+# define EC_F_BN_TO_FELEM 224
+# define EC_F_COMPUTE_WNAF 143
+# define EC_F_D2I_ECPARAMETERS 144
+# define EC_F_D2I_ECPKPARAMETERS 145
+# define EC_F_D2I_ECPRIVATEKEY 146
+# define EC_F_DO_EC_KEY_PRINT 221
+# define EC_F_ECDH_CMS_DECRYPT 238
+# define EC_F_ECDH_CMS_SET_SHARED_INFO 239
+# define EC_F_ECKEY_PARAM2TYPE 223
+# define EC_F_ECKEY_PARAM_DECODE 212
+# define EC_F_ECKEY_PRIV_DECODE 213
+# define EC_F_ECKEY_PRIV_ENCODE 214
+# define EC_F_ECKEY_PUB_DECODE 215
+# define EC_F_ECKEY_PUB_ENCODE 216
+# define EC_F_ECKEY_TYPE2PARAM 220
+# define EC_F_ECPARAMETERS_PRINT 147
+# define EC_F_ECPARAMETERS_PRINT_FP 148
+# define EC_F_ECPKPARAMETERS_PRINT 149
+# define EC_F_ECPKPARAMETERS_PRINT_FP 150
+# define EC_F_ECP_NISTZ256_GET_AFFINE 240
+# define EC_F_ECP_NISTZ256_MULT_PRECOMPUTE 243
+# define EC_F_ECP_NISTZ256_POINTS_MUL 241
+# define EC_F_ECP_NISTZ256_PRE_COMP_NEW 244
+# define EC_F_ECP_NISTZ256_SET_WORDS 245
+# define EC_F_ECP_NISTZ256_WINDOWED_MUL 242
+# define EC_F_ECP_NIST_MOD_192 203
+# define EC_F_ECP_NIST_MOD_224 204
+# define EC_F_ECP_NIST_MOD_256 205
+# define EC_F_ECP_NIST_MOD_521 206
+# define EC_F_EC_ASN1_GROUP2CURVE 153
+# define EC_F_EC_ASN1_GROUP2FIELDID 154
+# define EC_F_EC_ASN1_GROUP2PARAMETERS 155
+# define EC_F_EC_ASN1_GROUP2PKPARAMETERS 156
+# define EC_F_EC_ASN1_PARAMETERS2GROUP 157
+# define EC_F_EC_ASN1_PKPARAMETERS2GROUP 158
+# define EC_F_EC_EX_DATA_SET_DATA 211
+# define EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY 208
+# define EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT 159
+# define EC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVE 195
+# define EC_F_EC_GF2M_SIMPLE_OCT2POINT 160
+# define EC_F_EC_GF2M_SIMPLE_POINT2OCT 161
+# define EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES 162
+# define EC_F_EC_GF2M_SIMPLE_POINT_SET_AFFINE_COORDINATES 163
+# define EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES 164
+# define EC_F_EC_GFP_MONT_FIELD_DECODE 133
+# define EC_F_EC_GFP_MONT_FIELD_ENCODE 134
+# define EC_F_EC_GFP_MONT_FIELD_MUL 131
+# define EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE 209
+# define EC_F_EC_GFP_MONT_FIELD_SQR 132
+# define EC_F_EC_GFP_MONT_GROUP_SET_CURVE 189
+# define EC_F_EC_GFP_MONT_GROUP_SET_CURVE_GFP 135
+# define EC_F_EC_GFP_NISTP224_GROUP_SET_CURVE 225
+# define EC_F_EC_GFP_NISTP224_POINTS_MUL 228
+# define EC_F_EC_GFP_NISTP224_POINT_GET_AFFINE_COORDINATES 226
+# define EC_F_EC_GFP_NISTP256_GROUP_SET_CURVE 230
+# define EC_F_EC_GFP_NISTP256_POINTS_MUL 231
+# define EC_F_EC_GFP_NISTP256_POINT_GET_AFFINE_COORDINATES 232
+# define EC_F_EC_GFP_NISTP521_GROUP_SET_CURVE 233
+# define EC_F_EC_GFP_NISTP521_POINTS_MUL 234
+# define EC_F_EC_GFP_NISTP521_POINT_GET_AFFINE_COORDINATES 235
+# define EC_F_EC_GFP_NIST_FIELD_MUL 200
+# define EC_F_EC_GFP_NIST_FIELD_SQR 201
+# define EC_F_EC_GFP_NIST_GROUP_SET_CURVE 202
+# define EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT 165
+# define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE 166
+# define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE_GFP 100
+# define EC_F_EC_GFP_SIMPLE_GROUP_SET_GENERATOR 101
+# define EC_F_EC_GFP_SIMPLE_MAKE_AFFINE 102
+# define EC_F_EC_GFP_SIMPLE_OCT2POINT 103
+# define EC_F_EC_GFP_SIMPLE_POINT2OCT 104
+# define EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE 137
+# define EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES 167
+# define EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES_GFP 105
+# define EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES 168
+# define EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES_GFP 128
+# define EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES 169
+# define EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFP 129
+# define EC_F_EC_GROUP_CHECK 170
+# define EC_F_EC_GROUP_CHECK_DISCRIMINANT 171
+# define EC_F_EC_GROUP_COPY 106
+# define EC_F_EC_GROUP_GET0_GENERATOR 139
+# define EC_F_EC_GROUP_GET_COFACTOR 140
+# define EC_F_EC_GROUP_GET_CURVE_GF2M 172
+# define EC_F_EC_GROUP_GET_CURVE_GFP 130
+# define EC_F_EC_GROUP_GET_DEGREE 173
+# define EC_F_EC_GROUP_GET_ORDER 141
+# define EC_F_EC_GROUP_GET_PENTANOMIAL_BASIS 193
+# define EC_F_EC_GROUP_GET_TRINOMIAL_BASIS 194
+# define EC_F_EC_GROUP_NEW 108
+# define EC_F_EC_GROUP_NEW_BY_CURVE_NAME 174
+# define EC_F_EC_GROUP_NEW_FROM_DATA 175
+# define EC_F_EC_GROUP_PRECOMPUTE_MULT 142
+# define EC_F_EC_GROUP_SET_CURVE_GF2M 176
+# define EC_F_EC_GROUP_SET_CURVE_GFP 109
+# define EC_F_EC_GROUP_SET_EXTRA_DATA 110
+# define EC_F_EC_GROUP_SET_GENERATOR 111
+# define EC_F_EC_KEY_CHECK_KEY 177
+# define EC_F_EC_KEY_COPY 178
+# define EC_F_EC_KEY_GENERATE_KEY 179
+# define EC_F_EC_KEY_NEW 182
+# define EC_F_EC_KEY_PRINT 180
+# define EC_F_EC_KEY_PRINT_FP 181
+# define EC_F_EC_KEY_SET_PUBLIC_KEY_AFFINE_COORDINATES 229
+# define EC_F_EC_POINTS_MAKE_AFFINE 136
+# define EC_F_EC_POINT_ADD 112
+# define EC_F_EC_POINT_CMP 113
+# define EC_F_EC_POINT_COPY 114
+# define EC_F_EC_POINT_DBL 115
+# define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M 183
+# define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP 116
+# define EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP 117
+# define EC_F_EC_POINT_INVERT 210
+# define EC_F_EC_POINT_IS_AT_INFINITY 118
+# define EC_F_EC_POINT_IS_ON_CURVE 119
+# define EC_F_EC_POINT_MAKE_AFFINE 120
+# define EC_F_EC_POINT_MUL 184
+# define EC_F_EC_POINT_NEW 121
+# define EC_F_EC_POINT_OCT2POINT 122
+# define EC_F_EC_POINT_POINT2OCT 123
+# define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GF2M 185
+# define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GFP 124
+# define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M 186
+# define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP 125
+# define EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP 126
+# define EC_F_EC_POINT_SET_TO_INFINITY 127
+# define EC_F_EC_PRE_COMP_DUP 207
+# define EC_F_EC_PRE_COMP_NEW 196
+# define EC_F_EC_WNAF_MUL 187
+# define EC_F_EC_WNAF_PRECOMPUTE_MULT 188
+# define EC_F_I2D_ECPARAMETERS 190
+# define EC_F_I2D_ECPKPARAMETERS 191
+# define EC_F_I2D_ECPRIVATEKEY 192
+# define EC_F_I2O_ECPUBLICKEY 151
+# define EC_F_NISTP224_PRE_COMP_NEW 227
+# define EC_F_NISTP256_PRE_COMP_NEW 236
+# define EC_F_NISTP521_PRE_COMP_NEW 237
+# define EC_F_O2I_ECPUBLICKEY 152
+# define EC_F_OLD_EC_PRIV_DECODE 222
+# define EC_F_PKEY_EC_CTRL 197
+# define EC_F_PKEY_EC_CTRL_STR 198
+# define EC_F_PKEY_EC_DERIVE 217
+# define EC_F_PKEY_EC_KEYGEN 199
+# define EC_F_PKEY_EC_PARAMGEN 219
+# define EC_F_PKEY_EC_SIGN 218
+
+/* Reason codes. */
+# define EC_R_ASN1_ERROR 115
+# define EC_R_ASN1_UNKNOWN_FIELD 116
+# define EC_R_BIGNUM_OUT_OF_RANGE 144
+# define EC_R_BUFFER_TOO_SMALL 100
+# define EC_R_COORDINATES_OUT_OF_RANGE 146
+# define EC_R_D2I_ECPKPARAMETERS_FAILURE 117
+# define EC_R_DECODE_ERROR 142
+# define EC_R_DISCRIMINANT_IS_ZERO 118
+# define EC_R_EC_GROUP_NEW_BY_NAME_FAILURE 119
+# define EC_R_FIELD_TOO_LARGE 143
+# define EC_R_GF2M_NOT_SUPPORTED 147
+# define EC_R_GROUP2PKPARAMETERS_FAILURE 120
+# define EC_R_I2D_ECPKPARAMETERS_FAILURE 121
+# define EC_R_INCOMPATIBLE_OBJECTS 101
+# define EC_R_INVALID_ARGUMENT 112
+# define EC_R_INVALID_COMPRESSED_POINT 110
+# define EC_R_INVALID_COMPRESSION_BIT 109
+# define EC_R_INVALID_CURVE 141
+# define EC_R_INVALID_DIGEST 151
+# define EC_R_INVALID_DIGEST_TYPE 138
+# define EC_R_INVALID_ENCODING 102
+# define EC_R_INVALID_FIELD 103
+# define EC_R_INVALID_FORM 104
+# define EC_R_INVALID_GROUP_ORDER 122
+# define EC_R_INVALID_PENTANOMIAL_BASIS 132
+# define EC_R_INVALID_PRIVATE_KEY 123
+# define EC_R_INVALID_TRINOMIAL_BASIS 137
+# define EC_R_KDF_PARAMETER_ERROR 148
+# define EC_R_KEYS_NOT_SET 140
+# define EC_R_MISSING_PARAMETERS 124
+# define EC_R_MISSING_PRIVATE_KEY 125
+# define EC_R_NOT_A_NIST_PRIME 135
+# define EC_R_NOT_A_SUPPORTED_NIST_PRIME 136
+# define EC_R_NOT_IMPLEMENTED 126
+# define EC_R_NOT_INITIALIZED 111
+# define EC_R_NO_FIELD_MOD 133
+# define EC_R_NO_PARAMETERS_SET 139
+# define EC_R_PASSED_NULL_PARAMETER 134
+# define EC_R_PEER_KEY_ERROR 149
+# define EC_R_PKPARAMETERS2GROUP_FAILURE 127
+# define EC_R_POINT_AT_INFINITY 106
+# define EC_R_POINT_IS_NOT_ON_CURVE 107
+# define EC_R_SHARED_INFO_ERROR 150
+# define EC_R_SLOT_FULL 108
+# define EC_R_UNDEFINED_GENERATOR 113
+# define EC_R_UNDEFINED_ORDER 128
+# define EC_R_UNKNOWN_GROUP 129
+# define EC_R_UNKNOWN_ORDER 114
+# define EC_R_UNSUPPORTED_FIELD 131
+# define EC_R_WRONG_CURVE_PARAMETERS 145
+# define EC_R_WRONG_ORDER 130
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/ecdh.h b/protocols/Telegram/tgl/openssl/include/openssl/ecdh.h
new file mode 100644
index 0000000000..25348b30fe
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/ecdh.h
@@ -0,0 +1,134 @@
+/* crypto/ecdh/ecdh.h */
+/* ====================================================================
+ * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
+ *
+ * The Elliptic Curve Public-Key Crypto Library (ECC Code) included
+ * herein is developed by SUN MICROSYSTEMS, INC., and is contributed
+ * to the OpenSSL project.
+ *
+ * The ECC Code is licensed pursuant to the OpenSSL open source
+ * license provided below.
+ *
+ * The ECDH software is originally written by Douglas Stebila of
+ * Sun Microsystems Laboratories.
+ *
+ */
+/* ====================================================================
+ * Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+#ifndef HEADER_ECDH_H
+# define HEADER_ECDH_H
+
+# include <openssl/opensslconf.h>
+
+# ifdef OPENSSL_NO_ECDH
+# error ECDH is disabled.
+# endif
+
+# include <openssl/ec.h>
+# include <openssl/ossl_typ.h>
+# ifndef OPENSSL_NO_DEPRECATED
+# include <openssl/bn.h>
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# define EC_FLAG_COFACTOR_ECDH 0x1000
+
+const ECDH_METHOD *ECDH_OpenSSL(void);
+
+void ECDH_set_default_method(const ECDH_METHOD *);
+const ECDH_METHOD *ECDH_get_default_method(void);
+int ECDH_set_method(EC_KEY *, const ECDH_METHOD *);
+
+int ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key,
+ EC_KEY *ecdh, void *(*KDF) (const void *in, size_t inlen,
+ void *out, size_t *outlen));
+
+int ECDH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new
+ *new_func, CRYPTO_EX_dup *dup_func,
+ CRYPTO_EX_free *free_func);
+int ECDH_set_ex_data(EC_KEY *d, int idx, void *arg);
+void *ECDH_get_ex_data(EC_KEY *d, int idx);
+
+int ECDH_KDF_X9_62(unsigned char *out, size_t outlen,
+ const unsigned char *Z, size_t Zlen,
+ const unsigned char *sinfo, size_t sinfolen,
+ const EVP_MD *md);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_ECDH_strings(void);
+
+/* Error codes for the ECDH functions. */
+
+/* Function codes. */
+# define ECDH_F_ECDH_CHECK 102
+# define ECDH_F_ECDH_COMPUTE_KEY 100
+# define ECDH_F_ECDH_DATA_NEW_METHOD 101
+
+/* Reason codes. */
+# define ECDH_R_KDF_FAILED 102
+# define ECDH_R_NON_FIPS_METHOD 103
+# define ECDH_R_NO_PRIVATE_VALUE 100
+# define ECDH_R_POINT_ARITHMETIC_FAILURE 101
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/ecdsa.h b/protocols/Telegram/tgl/openssl/include/openssl/ecdsa.h
new file mode 100644
index 0000000000..c4016ac3e1
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/ecdsa.h
@@ -0,0 +1,335 @@
+/* crypto/ecdsa/ecdsa.h */
+/**
+ * \file crypto/ecdsa/ecdsa.h Include file for the OpenSSL ECDSA functions
+ * \author Written by Nils Larsch for the OpenSSL project
+ */
+/* ====================================================================
+ * Copyright (c) 2000-2005 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+#ifndef HEADER_ECDSA_H
+# define HEADER_ECDSA_H
+
+# include <openssl/opensslconf.h>
+
+# ifdef OPENSSL_NO_ECDSA
+# error ECDSA is disabled.
+# endif
+
+# include <openssl/ec.h>
+# include <openssl/ossl_typ.h>
+# ifndef OPENSSL_NO_DEPRECATED
+# include <openssl/bn.h>
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct ECDSA_SIG_st {
+ BIGNUM *r;
+ BIGNUM *s;
+} ECDSA_SIG;
+
+/** Allocates and initialize a ECDSA_SIG structure
+ * \return pointer to a ECDSA_SIG structure or NULL if an error occurred
+ */
+ECDSA_SIG *ECDSA_SIG_new(void);
+
+/** frees a ECDSA_SIG structure
+ * \param sig pointer to the ECDSA_SIG structure
+ */
+void ECDSA_SIG_free(ECDSA_SIG *sig);
+
+/** DER encode content of ECDSA_SIG object (note: this function modifies *pp
+ * (*pp += length of the DER encoded signature)).
+ * \param sig pointer to the ECDSA_SIG object
+ * \param pp pointer to a unsigned char pointer for the output or NULL
+ * \return the length of the DER encoded ECDSA_SIG object or 0
+ */
+int i2d_ECDSA_SIG(const ECDSA_SIG *sig, unsigned char **pp);
+
+/** Decodes a DER encoded ECDSA signature (note: this function changes *pp
+ * (*pp += len)).
+ * \param sig pointer to ECDSA_SIG pointer (may be NULL)
+ * \param pp memory buffer with the DER encoded signature
+ * \param len length of the buffer
+ * \return pointer to the decoded ECDSA_SIG structure (or NULL)
+ */
+ECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **sig, const unsigned char **pp, long len);
+
+/** Computes the ECDSA signature of the given hash value using
+ * the supplied private key and returns the created signature.
+ * \param dgst pointer to the hash value
+ * \param dgst_len length of the hash value
+ * \param eckey EC_KEY object containing a private EC key
+ * \return pointer to a ECDSA_SIG structure or NULL if an error occurred
+ */
+ECDSA_SIG *ECDSA_do_sign(const unsigned char *dgst, int dgst_len,
+ EC_KEY *eckey);
+
+/** Computes ECDSA signature of a given hash value using the supplied
+ * private key (note: sig must point to ECDSA_size(eckey) bytes of memory).
+ * \param dgst pointer to the hash value to sign
+ * \param dgstlen length of the hash value
+ * \param kinv BIGNUM with a pre-computed inverse k (optional)
+ * \param rp BIGNUM with a pre-computed rp value (optioanl),
+ * see ECDSA_sign_setup
+ * \param eckey EC_KEY object containing a private EC key
+ * \return pointer to a ECDSA_SIG structure or NULL if an error occurred
+ */
+ECDSA_SIG *ECDSA_do_sign_ex(const unsigned char *dgst, int dgstlen,
+ const BIGNUM *kinv, const BIGNUM *rp,
+ EC_KEY *eckey);
+
+/** Verifies that the supplied signature is a valid ECDSA
+ * signature of the supplied hash value using the supplied public key.
+ * \param dgst pointer to the hash value
+ * \param dgst_len length of the hash value
+ * \param sig ECDSA_SIG structure
+ * \param eckey EC_KEY object containing a public EC key
+ * \return 1 if the signature is valid, 0 if the signature is invalid
+ * and -1 on error
+ */
+int ECDSA_do_verify(const unsigned char *dgst, int dgst_len,
+ const ECDSA_SIG *sig, EC_KEY *eckey);
+
+const ECDSA_METHOD *ECDSA_OpenSSL(void);
+
+/** Sets the default ECDSA method
+ * \param meth new default ECDSA_METHOD
+ */
+void ECDSA_set_default_method(const ECDSA_METHOD *meth);
+
+/** Returns the default ECDSA method
+ * \return pointer to ECDSA_METHOD structure containing the default method
+ */
+const ECDSA_METHOD *ECDSA_get_default_method(void);
+
+/** Sets method to be used for the ECDSA operations
+ * \param eckey EC_KEY object
+ * \param meth new method
+ * \return 1 on success and 0 otherwise
+ */
+int ECDSA_set_method(EC_KEY *eckey, const ECDSA_METHOD *meth);
+
+/** Returns the maximum length of the DER encoded signature
+ * \param eckey EC_KEY object
+ * \return numbers of bytes required for the DER encoded signature
+ */
+int ECDSA_size(const EC_KEY *eckey);
+
+/** Precompute parts of the signing operation
+ * \param eckey EC_KEY object containing a private EC key
+ * \param ctx BN_CTX object (optional)
+ * \param kinv BIGNUM pointer for the inverse of k
+ * \param rp BIGNUM pointer for x coordinate of k * generator
+ * \return 1 on success and 0 otherwise
+ */
+int ECDSA_sign_setup(EC_KEY *eckey, BN_CTX *ctx, BIGNUM **kinv, BIGNUM **rp);
+
+/** Computes ECDSA signature of a given hash value using the supplied
+ * private key (note: sig must point to ECDSA_size(eckey) bytes of memory).
+ * \param type this parameter is ignored
+ * \param dgst pointer to the hash value to sign
+ * \param dgstlen length of the hash value
+ * \param sig memory for the DER encoded created signature
+ * \param siglen pointer to the length of the returned signature
+ * \param eckey EC_KEY object containing a private EC key
+ * \return 1 on success and 0 otherwise
+ */
+int ECDSA_sign(int type, const unsigned char *dgst, int dgstlen,
+ unsigned char *sig, unsigned int *siglen, EC_KEY *eckey);
+
+/** Computes ECDSA signature of a given hash value using the supplied
+ * private key (note: sig must point to ECDSA_size(eckey) bytes of memory).
+ * \param type this parameter is ignored
+ * \param dgst pointer to the hash value to sign
+ * \param dgstlen length of the hash value
+ * \param sig buffer to hold the DER encoded signature
+ * \param siglen pointer to the length of the returned signature
+ * \param kinv BIGNUM with a pre-computed inverse k (optional)
+ * \param rp BIGNUM with a pre-computed rp value (optioanl),
+ * see ECDSA_sign_setup
+ * \param eckey EC_KEY object containing a private EC key
+ * \return 1 on success and 0 otherwise
+ */
+int ECDSA_sign_ex(int type, const unsigned char *dgst, int dgstlen,
+ unsigned char *sig, unsigned int *siglen,
+ const BIGNUM *kinv, const BIGNUM *rp, EC_KEY *eckey);
+
+/** Verifies that the given signature is valid ECDSA signature
+ * of the supplied hash value using the specified public key.
+ * \param type this parameter is ignored
+ * \param dgst pointer to the hash value
+ * \param dgstlen length of the hash value
+ * \param sig pointer to the DER encoded signature
+ * \param siglen length of the DER encoded signature
+ * \param eckey EC_KEY object containing a public EC key
+ * \return 1 if the signature is valid, 0 if the signature is invalid
+ * and -1 on error
+ */
+int ECDSA_verify(int type, const unsigned char *dgst, int dgstlen,
+ const unsigned char *sig, int siglen, EC_KEY *eckey);
+
+/* the standard ex_data functions */
+int ECDSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new
+ *new_func, CRYPTO_EX_dup *dup_func,
+ CRYPTO_EX_free *free_func);
+int ECDSA_set_ex_data(EC_KEY *d, int idx, void *arg);
+void *ECDSA_get_ex_data(EC_KEY *d, int idx);
+
+/** Allocates and initialize a ECDSA_METHOD structure
+ * \param ecdsa_method pointer to ECDSA_METHOD to copy. (May be NULL)
+ * \return pointer to a ECDSA_METHOD structure or NULL if an error occurred
+ */
+
+ECDSA_METHOD *ECDSA_METHOD_new(ECDSA_METHOD *ecdsa_method);
+
+/** frees a ECDSA_METHOD structure
+ * \param ecdsa_method pointer to the ECDSA_METHOD structure
+ */
+void ECDSA_METHOD_free(ECDSA_METHOD *ecdsa_method);
+
+/** Sets application specific data in the ECDSA_METHOD
+ * \param ecdsa_method pointer to existing ECDSA_METHOD
+ * \param app application specific data to set
+ */
+
+void ECDSA_METHOD_set_app_data(ECDSA_METHOD *ecdsa_method, void *app);
+
+/** Returns application specific data from a ECDSA_METHOD structure
+ * \param ecdsa_method pointer to ECDSA_METHOD structure
+ * \return pointer to application specific data.
+ */
+
+void *ECDSA_METHOD_get_app_data(ECDSA_METHOD *ecdsa_method);
+
+/** Set the ECDSA_do_sign function in the ECDSA_METHOD
+ * \param ecdsa_method pointer to existing ECDSA_METHOD
+ * \param ecdsa_do_sign a funtion of type ECDSA_do_sign
+ */
+
+void ECDSA_METHOD_set_sign(ECDSA_METHOD *ecdsa_method,
+ ECDSA_SIG *(*ecdsa_do_sign) (const unsigned char
+ *dgst, int dgst_len,
+ const BIGNUM *inv,
+ const BIGNUM *rp,
+ EC_KEY *eckey));
+
+/** Set the ECDSA_sign_setup function in the ECDSA_METHOD
+ * \param ecdsa_method pointer to existing ECDSA_METHOD
+ * \param ecdsa_sign_setup a funtion of type ECDSA_sign_setup
+ */
+
+void ECDSA_METHOD_set_sign_setup(ECDSA_METHOD *ecdsa_method,
+ int (*ecdsa_sign_setup) (EC_KEY *eckey,
+ BN_CTX *ctx,
+ BIGNUM **kinv,
+ BIGNUM **r));
+
+/** Set the ECDSA_do_verify function in the ECDSA_METHOD
+ * \param ecdsa_method pointer to existing ECDSA_METHOD
+ * \param ecdsa_do_verify a funtion of type ECDSA_do_verify
+ */
+
+void ECDSA_METHOD_set_verify(ECDSA_METHOD *ecdsa_method,
+ int (*ecdsa_do_verify) (const unsigned char
+ *dgst, int dgst_len,
+ const ECDSA_SIG *sig,
+ EC_KEY *eckey));
+
+void ECDSA_METHOD_set_flags(ECDSA_METHOD *ecdsa_method, int flags);
+
+/** Set the flags field in the ECDSA_METHOD
+ * \param ecdsa_method pointer to existing ECDSA_METHOD
+ * \param flags flags value to set
+ */
+
+void ECDSA_METHOD_set_name(ECDSA_METHOD *ecdsa_method, char *name);
+
+/** Set the name field in the ECDSA_METHOD
+ * \param ecdsa_method pointer to existing ECDSA_METHOD
+ * \param name name to set
+ */
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_ECDSA_strings(void);
+
+/* Error codes for the ECDSA functions. */
+
+/* Function codes. */
+# define ECDSA_F_ECDSA_CHECK 104
+# define ECDSA_F_ECDSA_DATA_NEW_METHOD 100
+# define ECDSA_F_ECDSA_DO_SIGN 101
+# define ECDSA_F_ECDSA_DO_VERIFY 102
+# define ECDSA_F_ECDSA_METHOD_NEW 105
+# define ECDSA_F_ECDSA_SIGN_SETUP 103
+
+/* Reason codes. */
+# define ECDSA_R_BAD_SIGNATURE 100
+# define ECDSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 101
+# define ECDSA_R_ERR_EC_LIB 102
+# define ECDSA_R_MISSING_PARAMETERS 103
+# define ECDSA_R_NEED_NEW_SETUP_VALUES 106
+# define ECDSA_R_NON_FIPS_METHOD 107
+# define ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED 104
+# define ECDSA_R_SIGNATURE_MALLOC_FAILED 105
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/engine.h b/protocols/Telegram/tgl/openssl/include/openssl/engine.h
new file mode 100644
index 0000000000..bd7b591447
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/engine.h
@@ -0,0 +1,960 @@
+/* openssl/engine.h */
+/*
+ * Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL project
+ * 2000.
+ */
+/* ====================================================================
+ * Copyright (c) 1999-2004 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+/* ====================================================================
+ * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
+ * ECDH support in OpenSSL originally developed by
+ * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
+ */
+
+#ifndef HEADER_ENGINE_H
+# define HEADER_ENGINE_H
+
+# include <openssl/opensslconf.h>
+
+# ifdef OPENSSL_NO_ENGINE
+# error ENGINE is disabled.
+# endif
+
+# ifndef OPENSSL_NO_DEPRECATED
+# include <openssl/bn.h>
+# ifndef OPENSSL_NO_RSA
+# include <openssl/rsa.h>
+# endif
+# ifndef OPENSSL_NO_DSA
+# include <openssl/dsa.h>
+# endif
+# ifndef OPENSSL_NO_DH
+# include <openssl/dh.h>
+# endif
+# ifndef OPENSSL_NO_ECDH
+# include <openssl/ecdh.h>
+# endif
+# ifndef OPENSSL_NO_ECDSA
+# include <openssl/ecdsa.h>
+# endif
+# include <openssl/rand.h>
+# include <openssl/ui.h>
+# include <openssl/err.h>
+# endif
+
+# include <openssl/ossl_typ.h>
+# include <openssl/symhacks.h>
+
+# include <openssl/x509.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * These flags are used to control combinations of algorithm (methods) by
+ * bitwise "OR"ing.
+ */
+# define ENGINE_METHOD_RSA (unsigned int)0x0001
+# define ENGINE_METHOD_DSA (unsigned int)0x0002
+# define ENGINE_METHOD_DH (unsigned int)0x0004
+# define ENGINE_METHOD_RAND (unsigned int)0x0008
+# define ENGINE_METHOD_ECDH (unsigned int)0x0010
+# define ENGINE_METHOD_ECDSA (unsigned int)0x0020
+# define ENGINE_METHOD_CIPHERS (unsigned int)0x0040
+# define ENGINE_METHOD_DIGESTS (unsigned int)0x0080
+# define ENGINE_METHOD_STORE (unsigned int)0x0100
+# define ENGINE_METHOD_PKEY_METHS (unsigned int)0x0200
+# define ENGINE_METHOD_PKEY_ASN1_METHS (unsigned int)0x0400
+/* Obvious all-or-nothing cases. */
+# define ENGINE_METHOD_ALL (unsigned int)0xFFFF
+# define ENGINE_METHOD_NONE (unsigned int)0x0000
+
+/*
+ * This(ese) flag(s) controls behaviour of the ENGINE_TABLE mechanism used
+ * internally to control registration of ENGINE implementations, and can be
+ * set by ENGINE_set_table_flags(). The "NOINIT" flag prevents attempts to
+ * initialise registered ENGINEs if they are not already initialised.
+ */
+# define ENGINE_TABLE_FLAG_NOINIT (unsigned int)0x0001
+
+/* ENGINE flags that can be set by ENGINE_set_flags(). */
+/* Not used */
+/* #define ENGINE_FLAGS_MALLOCED 0x0001 */
+
+/*
+ * This flag is for ENGINEs that wish to handle the various 'CMD'-related
+ * control commands on their own. Without this flag, ENGINE_ctrl() handles
+ * these control commands on behalf of the ENGINE using their "cmd_defns"
+ * data.
+ */
+# define ENGINE_FLAGS_MANUAL_CMD_CTRL (int)0x0002
+
+/*
+ * This flag is for ENGINEs who return new duplicate structures when found
+ * via "ENGINE_by_id()". When an ENGINE must store state (eg. if
+ * ENGINE_ctrl() commands are called in sequence as part of some stateful
+ * process like key-generation setup and execution), it can set this flag -
+ * then each attempt to obtain the ENGINE will result in it being copied into
+ * a new structure. Normally, ENGINEs don't declare this flag so
+ * ENGINE_by_id() just increments the existing ENGINE's structural reference
+ * count.
+ */
+# define ENGINE_FLAGS_BY_ID_COPY (int)0x0004
+
+/*
+ * This flag if for an ENGINE that does not want its methods registered as
+ * part of ENGINE_register_all_complete() for example if the methods are not
+ * usable as default methods.
+ */
+
+# define ENGINE_FLAGS_NO_REGISTER_ALL (int)0x0008
+
+/*
+ * ENGINEs can support their own command types, and these flags are used in
+ * ENGINE_CTRL_GET_CMD_FLAGS to indicate to the caller what kind of input
+ * each command expects. Currently only numeric and string input is
+ * supported. If a control command supports none of the _NUMERIC, _STRING, or
+ * _NO_INPUT options, then it is regarded as an "internal" control command -
+ * and not for use in config setting situations. As such, they're not
+ * available to the ENGINE_ctrl_cmd_string() function, only raw ENGINE_ctrl()
+ * access. Changes to this list of 'command types' should be reflected
+ * carefully in ENGINE_cmd_is_executable() and ENGINE_ctrl_cmd_string().
+ */
+
+/* accepts a 'long' input value (3rd parameter to ENGINE_ctrl) */
+# define ENGINE_CMD_FLAG_NUMERIC (unsigned int)0x0001
+/*
+ * accepts string input (cast from 'void*' to 'const char *', 4th parameter
+ * to ENGINE_ctrl)
+ */
+# define ENGINE_CMD_FLAG_STRING (unsigned int)0x0002
+/*
+ * Indicates that the control command takes *no* input. Ie. the control
+ * command is unparameterised.
+ */
+# define ENGINE_CMD_FLAG_NO_INPUT (unsigned int)0x0004
+/*
+ * Indicates that the control command is internal. This control command won't
+ * be shown in any output, and is only usable through the ENGINE_ctrl_cmd()
+ * function.
+ */
+# define ENGINE_CMD_FLAG_INTERNAL (unsigned int)0x0008
+
+/*
+ * NB: These 3 control commands are deprecated and should not be used.
+ * ENGINEs relying on these commands should compile conditional support for
+ * compatibility (eg. if these symbols are defined) but should also migrate
+ * the same functionality to their own ENGINE-specific control functions that
+ * can be "discovered" by calling applications. The fact these control
+ * commands wouldn't be "executable" (ie. usable by text-based config)
+ * doesn't change the fact that application code can find and use them
+ * without requiring per-ENGINE hacking.
+ */
+
+/*
+ * These flags are used to tell the ctrl function what should be done. All
+ * command numbers are shared between all engines, even if some don't make
+ * sense to some engines. In such a case, they do nothing but return the
+ * error ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED.
+ */
+# define ENGINE_CTRL_SET_LOGSTREAM 1
+# define ENGINE_CTRL_SET_PASSWORD_CALLBACK 2
+# define ENGINE_CTRL_HUP 3/* Close and reinitialise
+ * any handles/connections
+ * etc. */
+# define ENGINE_CTRL_SET_USER_INTERFACE 4/* Alternative to callback */
+# define ENGINE_CTRL_SET_CALLBACK_DATA 5/* User-specific data, used
+ * when calling the password
+ * callback and the user
+ * interface */
+# define ENGINE_CTRL_LOAD_CONFIGURATION 6/* Load a configuration,
+ * given a string that
+ * represents a file name
+ * or so */
+# define ENGINE_CTRL_LOAD_SECTION 7/* Load data from a given
+ * section in the already
+ * loaded configuration */
+
+/*
+ * These control commands allow an application to deal with an arbitrary
+ * engine in a dynamic way. Warn: Negative return values indicate errors FOR
+ * THESE COMMANDS because zero is used to indicate 'end-of-list'. Other
+ * commands, including ENGINE-specific command types, return zero for an
+ * error. An ENGINE can choose to implement these ctrl functions, and can
+ * internally manage things however it chooses - it does so by setting the
+ * ENGINE_FLAGS_MANUAL_CMD_CTRL flag (using ENGINE_set_flags()). Otherwise
+ * the ENGINE_ctrl() code handles this on the ENGINE's behalf using the
+ * cmd_defns data (set using ENGINE_set_cmd_defns()). This means an ENGINE's
+ * ctrl() handler need only implement its own commands - the above "meta"
+ * commands will be taken care of.
+ */
+
+/*
+ * Returns non-zero if the supplied ENGINE has a ctrl() handler. If "not",
+ * then all the remaining control commands will return failure, so it is
+ * worth checking this first if the caller is trying to "discover" the
+ * engine's capabilities and doesn't want errors generated unnecessarily.
+ */
+# define ENGINE_CTRL_HAS_CTRL_FUNCTION 10
+/*
+ * Returns a positive command number for the first command supported by the
+ * engine. Returns zero if no ctrl commands are supported.
+ */
+# define ENGINE_CTRL_GET_FIRST_CMD_TYPE 11
+/*
+ * The 'long' argument specifies a command implemented by the engine, and the
+ * return value is the next command supported, or zero if there are no more.
+ */
+# define ENGINE_CTRL_GET_NEXT_CMD_TYPE 12
+/*
+ * The 'void*' argument is a command name (cast from 'const char *'), and the
+ * return value is the command that corresponds to it.
+ */
+# define ENGINE_CTRL_GET_CMD_FROM_NAME 13
+/*
+ * The next two allow a command to be converted into its corresponding string
+ * form. In each case, the 'long' argument supplies the command. In the
+ * NAME_LEN case, the return value is the length of the command name (not
+ * counting a trailing EOL). In the NAME case, the 'void*' argument must be a
+ * string buffer large enough, and it will be populated with the name of the
+ * command (WITH a trailing EOL).
+ */
+# define ENGINE_CTRL_GET_NAME_LEN_FROM_CMD 14
+# define ENGINE_CTRL_GET_NAME_FROM_CMD 15
+/* The next two are similar but give a "short description" of a command. */
+# define ENGINE_CTRL_GET_DESC_LEN_FROM_CMD 16
+# define ENGINE_CTRL_GET_DESC_FROM_CMD 17
+/*
+ * With this command, the return value is the OR'd combination of
+ * ENGINE_CMD_FLAG_*** values that indicate what kind of input a given
+ * engine-specific ctrl command expects.
+ */
+# define ENGINE_CTRL_GET_CMD_FLAGS 18
+
+/*
+ * ENGINE implementations should start the numbering of their own control
+ * commands from this value. (ie. ENGINE_CMD_BASE, ENGINE_CMD_BASE + 1, etc).
+ */
+# define ENGINE_CMD_BASE 200
+
+/*
+ * NB: These 2 nCipher "chil" control commands are deprecated, and their
+ * functionality is now available through ENGINE-specific control commands
+ * (exposed through the above-mentioned 'CMD'-handling). Code using these 2
+ * commands should be migrated to the more general command handling before
+ * these are removed.
+ */
+
+/* Flags specific to the nCipher "chil" engine */
+# define ENGINE_CTRL_CHIL_SET_FORKCHECK 100
+ /*
+ * Depending on the value of the (long)i argument, this sets or
+ * unsets the SimpleForkCheck flag in the CHIL API to enable or
+ * disable checking and workarounds for applications that fork().
+ */
+# define ENGINE_CTRL_CHIL_NO_LOCKING 101
+ /*
+ * This prevents the initialisation function from providing mutex
+ * callbacks to the nCipher library.
+ */
+
+/*
+ * If an ENGINE supports its own specific control commands and wishes the
+ * framework to handle the above 'ENGINE_CMD_***'-manipulation commands on
+ * its behalf, it should supply a null-terminated array of ENGINE_CMD_DEFN
+ * entries to ENGINE_set_cmd_defns(). It should also implement a ctrl()
+ * handler that supports the stated commands (ie. the "cmd_num" entries as
+ * described by the array). NB: The array must be ordered in increasing order
+ * of cmd_num. "null-terminated" means that the last ENGINE_CMD_DEFN element
+ * has cmd_num set to zero and/or cmd_name set to NULL.
+ */
+typedef struct ENGINE_CMD_DEFN_st {
+ unsigned int cmd_num; /* The command number */
+ const char *cmd_name; /* The command name itself */
+ const char *cmd_desc; /* A short description of the command */
+ unsigned int cmd_flags; /* The input the command expects */
+} ENGINE_CMD_DEFN;
+
+/* Generic function pointer */
+typedef int (*ENGINE_GEN_FUNC_PTR) (void);
+/* Generic function pointer taking no arguments */
+typedef int (*ENGINE_GEN_INT_FUNC_PTR) (ENGINE *);
+/* Specific control function pointer */
+typedef int (*ENGINE_CTRL_FUNC_PTR) (ENGINE *, int, long, void *,
+ void (*f) (void));
+/* Generic load_key function pointer */
+typedef EVP_PKEY *(*ENGINE_LOAD_KEY_PTR)(ENGINE *, const char *,
+ UI_METHOD *ui_method,
+ void *callback_data);
+typedef int (*ENGINE_SSL_CLIENT_CERT_PTR) (ENGINE *, SSL *ssl,
+ STACK_OF(X509_NAME) *ca_dn,
+ X509 **pcert, EVP_PKEY **pkey,
+ STACK_OF(X509) **pother,
+ UI_METHOD *ui_method,
+ void *callback_data);
+/*-
+ * These callback types are for an ENGINE's handler for cipher and digest logic.
+ * These handlers have these prototypes;
+ * int foo(ENGINE *e, const EVP_CIPHER **cipher, const int **nids, int nid);
+ * int foo(ENGINE *e, const EVP_MD **digest, const int **nids, int nid);
+ * Looking at how to implement these handlers in the case of cipher support, if
+ * the framework wants the EVP_CIPHER for 'nid', it will call;
+ * foo(e, &p_evp_cipher, NULL, nid); (return zero for failure)
+ * If the framework wants a list of supported 'nid's, it will call;
+ * foo(e, NULL, &p_nids, 0); (returns number of 'nids' or -1 for error)
+ */
+/*
+ * Returns to a pointer to the array of supported cipher 'nid's. If the
+ * second parameter is non-NULL it is set to the size of the returned array.
+ */
+typedef int (*ENGINE_CIPHERS_PTR) (ENGINE *, const EVP_CIPHER **,
+ const int **, int);
+typedef int (*ENGINE_DIGESTS_PTR) (ENGINE *, const EVP_MD **, const int **,
+ int);
+typedef int (*ENGINE_PKEY_METHS_PTR) (ENGINE *, EVP_PKEY_METHOD **,
+ const int **, int);
+typedef int (*ENGINE_PKEY_ASN1_METHS_PTR) (ENGINE *, EVP_PKEY_ASN1_METHOD **,
+ const int **, int);
+/*
+ * STRUCTURE functions ... all of these functions deal with pointers to
+ * ENGINE structures where the pointers have a "structural reference". This
+ * means that their reference is to allowed access to the structure but it
+ * does not imply that the structure is functional. To simply increment or
+ * decrement the structural reference count, use ENGINE_by_id and
+ * ENGINE_free. NB: This is not required when iterating using ENGINE_get_next
+ * as it will automatically decrement the structural reference count of the
+ * "current" ENGINE and increment the structural reference count of the
+ * ENGINE it returns (unless it is NULL).
+ */
+
+/* Get the first/last "ENGINE" type available. */
+ENGINE *ENGINE_get_first(void);
+ENGINE *ENGINE_get_last(void);
+/* Iterate to the next/previous "ENGINE" type (NULL = end of the list). */
+ENGINE *ENGINE_get_next(ENGINE *e);
+ENGINE *ENGINE_get_prev(ENGINE *e);
+/* Add another "ENGINE" type into the array. */
+int ENGINE_add(ENGINE *e);
+/* Remove an existing "ENGINE" type from the array. */
+int ENGINE_remove(ENGINE *e);
+/* Retrieve an engine from the list by its unique "id" value. */
+ENGINE *ENGINE_by_id(const char *id);
+/* Add all the built-in engines. */
+void ENGINE_load_openssl(void);
+void ENGINE_load_dynamic(void);
+# ifndef OPENSSL_NO_STATIC_ENGINE
+void ENGINE_load_4758cca(void);
+void ENGINE_load_aep(void);
+void ENGINE_load_atalla(void);
+void ENGINE_load_chil(void);
+void ENGINE_load_cswift(void);
+void ENGINE_load_nuron(void);
+void ENGINE_load_sureware(void);
+void ENGINE_load_ubsec(void);
+void ENGINE_load_padlock(void);
+void ENGINE_load_capi(void);
+# ifndef OPENSSL_NO_GMP
+void ENGINE_load_gmp(void);
+# endif
+# ifndef OPENSSL_NO_GOST
+void ENGINE_load_gost(void);
+# endif
+# endif
+void ENGINE_load_cryptodev(void);
+void ENGINE_load_rdrand(void);
+void ENGINE_load_builtin_engines(void);
+
+/*
+ * Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation
+ * "registry" handling.
+ */
+unsigned int ENGINE_get_table_flags(void);
+void ENGINE_set_table_flags(unsigned int flags);
+
+/*- Manage registration of ENGINEs per "table". For each type, there are 3
+ * functions;
+ * ENGINE_register_***(e) - registers the implementation from 'e' (if it has one)
+ * ENGINE_unregister_***(e) - unregister the implementation from 'e'
+ * ENGINE_register_all_***() - call ENGINE_register_***() for each 'e' in the list
+ * Cleanup is automatically registered from each table when required, so
+ * ENGINE_cleanup() will reverse any "register" operations.
+ */
+
+int ENGINE_register_RSA(ENGINE *e);
+void ENGINE_unregister_RSA(ENGINE *e);
+void ENGINE_register_all_RSA(void);
+
+int ENGINE_register_DSA(ENGINE *e);
+void ENGINE_unregister_DSA(ENGINE *e);
+void ENGINE_register_all_DSA(void);
+
+int ENGINE_register_ECDH(ENGINE *e);
+void ENGINE_unregister_ECDH(ENGINE *e);
+void ENGINE_register_all_ECDH(void);
+
+int ENGINE_register_ECDSA(ENGINE *e);
+void ENGINE_unregister_ECDSA(ENGINE *e);
+void ENGINE_register_all_ECDSA(void);
+
+int ENGINE_register_DH(ENGINE *e);
+void ENGINE_unregister_DH(ENGINE *e);
+void ENGINE_register_all_DH(void);
+
+int ENGINE_register_RAND(ENGINE *e);
+void ENGINE_unregister_RAND(ENGINE *e);
+void ENGINE_register_all_RAND(void);
+
+int ENGINE_register_STORE(ENGINE *e);
+void ENGINE_unregister_STORE(ENGINE *e);
+void ENGINE_register_all_STORE(void);
+
+int ENGINE_register_ciphers(ENGINE *e);
+void ENGINE_unregister_ciphers(ENGINE *e);
+void ENGINE_register_all_ciphers(void);
+
+int ENGINE_register_digests(ENGINE *e);
+void ENGINE_unregister_digests(ENGINE *e);
+void ENGINE_register_all_digests(void);
+
+int ENGINE_register_pkey_meths(ENGINE *e);
+void ENGINE_unregister_pkey_meths(ENGINE *e);
+void ENGINE_register_all_pkey_meths(void);
+
+int ENGINE_register_pkey_asn1_meths(ENGINE *e);
+void ENGINE_unregister_pkey_asn1_meths(ENGINE *e);
+void ENGINE_register_all_pkey_asn1_meths(void);
+
+/*
+ * These functions register all support from the above categories. Note, use
+ * of these functions can result in static linkage of code your application
+ * may not need. If you only need a subset of functionality, consider using
+ * more selective initialisation.
+ */
+int ENGINE_register_complete(ENGINE *e);
+int ENGINE_register_all_complete(void);
+
+/*
+ * Send parametrised control commands to the engine. The possibilities to
+ * send down an integer, a pointer to data or a function pointer are
+ * provided. Any of the parameters may or may not be NULL, depending on the
+ * command number. In actuality, this function only requires a structural
+ * (rather than functional) reference to an engine, but many control commands
+ * may require the engine be functional. The caller should be aware of trying
+ * commands that require an operational ENGINE, and only use functional
+ * references in such situations.
+ */
+int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f) (void));
+
+/*
+ * This function tests if an ENGINE-specific command is usable as a
+ * "setting". Eg. in an application's config file that gets processed through
+ * ENGINE_ctrl_cmd_string(). If this returns zero, it is not available to
+ * ENGINE_ctrl_cmd_string(), only ENGINE_ctrl().
+ */
+int ENGINE_cmd_is_executable(ENGINE *e, int cmd);
+
+/*
+ * This function works like ENGINE_ctrl() with the exception of taking a
+ * command name instead of a command number, and can handle optional
+ * commands. See the comment on ENGINE_ctrl_cmd_string() for an explanation
+ * on how to use the cmd_name and cmd_optional.
+ */
+int ENGINE_ctrl_cmd(ENGINE *e, const char *cmd_name,
+ long i, void *p, void (*f) (void), int cmd_optional);
+
+/*
+ * This function passes a command-name and argument to an ENGINE. The
+ * cmd_name is converted to a command number and the control command is
+ * called using 'arg' as an argument (unless the ENGINE doesn't support such
+ * a command, in which case no control command is called). The command is
+ * checked for input flags, and if necessary the argument will be converted
+ * to a numeric value. If cmd_optional is non-zero, then if the ENGINE
+ * doesn't support the given cmd_name the return value will be success
+ * anyway. This function is intended for applications to use so that users
+ * (or config files) can supply engine-specific config data to the ENGINE at
+ * run-time to control behaviour of specific engines. As such, it shouldn't
+ * be used for calling ENGINE_ctrl() functions that return data, deal with
+ * binary data, or that are otherwise supposed to be used directly through
+ * ENGINE_ctrl() in application code. Any "return" data from an ENGINE_ctrl()
+ * operation in this function will be lost - the return value is interpreted
+ * as failure if the return value is zero, success otherwise, and this
+ * function returns a boolean value as a result. In other words, vendors of
+ * 'ENGINE'-enabled devices should write ENGINE implementations with
+ * parameterisations that work in this scheme, so that compliant ENGINE-based
+ * applications can work consistently with the same configuration for the
+ * same ENGINE-enabled devices, across applications.
+ */
+int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name, const char *arg,
+ int cmd_optional);
+
+/*
+ * These functions are useful for manufacturing new ENGINE structures. They
+ * don't address reference counting at all - one uses them to populate an
+ * ENGINE structure with personalised implementations of things prior to
+ * using it directly or adding it to the builtin ENGINE list in OpenSSL.
+ * These are also here so that the ENGINE structure doesn't have to be
+ * exposed and break binary compatibility!
+ */
+ENGINE *ENGINE_new(void);
+int ENGINE_free(ENGINE *e);
+int ENGINE_up_ref(ENGINE *e);
+int ENGINE_set_id(ENGINE *e, const char *id);
+int ENGINE_set_name(ENGINE *e, const char *name);
+int ENGINE_set_RSA(ENGINE *e, const RSA_METHOD *rsa_meth);
+int ENGINE_set_DSA(ENGINE *e, const DSA_METHOD *dsa_meth);
+int ENGINE_set_ECDH(ENGINE *e, const ECDH_METHOD *ecdh_meth);
+int ENGINE_set_ECDSA(ENGINE *e, const ECDSA_METHOD *ecdsa_meth);
+int ENGINE_set_DH(ENGINE *e, const DH_METHOD *dh_meth);
+int ENGINE_set_RAND(ENGINE *e, const RAND_METHOD *rand_meth);
+int ENGINE_set_STORE(ENGINE *e, const STORE_METHOD *store_meth);
+int ENGINE_set_destroy_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR destroy_f);
+int ENGINE_set_init_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f);
+int ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f);
+int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f);
+int ENGINE_set_load_privkey_function(ENGINE *e,
+ ENGINE_LOAD_KEY_PTR loadpriv_f);
+int ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f);
+int ENGINE_set_load_ssl_client_cert_function(ENGINE *e,
+ ENGINE_SSL_CLIENT_CERT_PTR
+ loadssl_f);
+int ENGINE_set_ciphers(ENGINE *e, ENGINE_CIPHERS_PTR f);
+int ENGINE_set_digests(ENGINE *e, ENGINE_DIGESTS_PTR f);
+int ENGINE_set_pkey_meths(ENGINE *e, ENGINE_PKEY_METHS_PTR f);
+int ENGINE_set_pkey_asn1_meths(ENGINE *e, ENGINE_PKEY_ASN1_METHS_PTR f);
+int ENGINE_set_flags(ENGINE *e, int flags);
+int ENGINE_set_cmd_defns(ENGINE *e, const ENGINE_CMD_DEFN *defns);
+/* These functions allow control over any per-structure ENGINE data. */
+int ENGINE_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
+ CRYPTO_EX_dup *dup_func,
+ CRYPTO_EX_free *free_func);
+int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg);
+void *ENGINE_get_ex_data(const ENGINE *e, int idx);
+
+/*
+ * This function cleans up anything that needs it. Eg. the ENGINE_add()
+ * function automatically ensures the list cleanup function is registered to
+ * be called from ENGINE_cleanup(). Similarly, all ENGINE_register_***
+ * functions ensure ENGINE_cleanup() will clean up after them.
+ */
+void ENGINE_cleanup(void);
+
+/*
+ * These return values from within the ENGINE structure. These can be useful
+ * with functional references as well as structural references - it depends
+ * which you obtained. Using the result for functional purposes if you only
+ * obtained a structural reference may be problematic!
+ */
+const char *ENGINE_get_id(const ENGINE *e);
+const char *ENGINE_get_name(const ENGINE *e);
+const RSA_METHOD *ENGINE_get_RSA(const ENGINE *e);
+const DSA_METHOD *ENGINE_get_DSA(const ENGINE *e);
+const ECDH_METHOD *ENGINE_get_ECDH(const ENGINE *e);
+const ECDSA_METHOD *ENGINE_get_ECDSA(const ENGINE *e);
+const DH_METHOD *ENGINE_get_DH(const ENGINE *e);
+const RAND_METHOD *ENGINE_get_RAND(const ENGINE *e);
+const STORE_METHOD *ENGINE_get_STORE(const ENGINE *e);
+ENGINE_GEN_INT_FUNC_PTR ENGINE_get_destroy_function(const ENGINE *e);
+ENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function(const ENGINE *e);
+ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(const ENGINE *e);
+ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(const ENGINE *e);
+ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e);
+ENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function(const ENGINE *e);
+ENGINE_SSL_CLIENT_CERT_PTR ENGINE_get_ssl_client_cert_function(const ENGINE
+ *e);
+ENGINE_CIPHERS_PTR ENGINE_get_ciphers(const ENGINE *e);
+ENGINE_DIGESTS_PTR ENGINE_get_digests(const ENGINE *e);
+ENGINE_PKEY_METHS_PTR ENGINE_get_pkey_meths(const ENGINE *e);
+ENGINE_PKEY_ASN1_METHS_PTR ENGINE_get_pkey_asn1_meths(const ENGINE *e);
+const EVP_CIPHER *ENGINE_get_cipher(ENGINE *e, int nid);
+const EVP_MD *ENGINE_get_digest(ENGINE *e, int nid);
+const EVP_PKEY_METHOD *ENGINE_get_pkey_meth(ENGINE *e, int nid);
+const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth(ENGINE *e, int nid);
+const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth_str(ENGINE *e,
+ const char *str,
+ int len);
+const EVP_PKEY_ASN1_METHOD *ENGINE_pkey_asn1_find_str(ENGINE **pe,
+ const char *str,
+ int len);
+const ENGINE_CMD_DEFN *ENGINE_get_cmd_defns(const ENGINE *e);
+int ENGINE_get_flags(const ENGINE *e);
+
+/*
+ * FUNCTIONAL functions. These functions deal with ENGINE structures that
+ * have (or will) be initialised for use. Broadly speaking, the structural
+ * functions are useful for iterating the list of available engine types,
+ * creating new engine types, and other "list" operations. These functions
+ * actually deal with ENGINEs that are to be used. As such these functions
+ * can fail (if applicable) when particular engines are unavailable - eg. if
+ * a hardware accelerator is not attached or not functioning correctly. Each
+ * ENGINE has 2 reference counts; structural and functional. Every time a
+ * functional reference is obtained or released, a corresponding structural
+ * reference is automatically obtained or released too.
+ */
+
+/*
+ * Initialise a engine type for use (or up its reference count if it's
+ * already in use). This will fail if the engine is not currently operational
+ * and cannot initialise.
+ */
+int ENGINE_init(ENGINE *e);
+/*
+ * Free a functional reference to a engine type. This does not require a
+ * corresponding call to ENGINE_free as it also releases a structural
+ * reference.
+ */
+int ENGINE_finish(ENGINE *e);
+
+/*
+ * The following functions handle keys that are stored in some secondary
+ * location, handled by the engine. The storage may be on a card or
+ * whatever.
+ */
+EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id,
+ UI_METHOD *ui_method, void *callback_data);
+EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id,
+ UI_METHOD *ui_method, void *callback_data);
+int ENGINE_load_ssl_client_cert(ENGINE *e, SSL *s,
+ STACK_OF(X509_NAME) *ca_dn, X509 **pcert,
+ EVP_PKEY **ppkey, STACK_OF(X509) **pother,
+ UI_METHOD *ui_method, void *callback_data);
+
+/*
+ * This returns a pointer for the current ENGINE structure that is (by
+ * default) performing any RSA operations. The value returned is an
+ * incremented reference, so it should be free'd (ENGINE_finish) before it is
+ * discarded.
+ */
+ENGINE *ENGINE_get_default_RSA(void);
+/* Same for the other "methods" */
+ENGINE *ENGINE_get_default_DSA(void);
+ENGINE *ENGINE_get_default_ECDH(void);
+ENGINE *ENGINE_get_default_ECDSA(void);
+ENGINE *ENGINE_get_default_DH(void);
+ENGINE *ENGINE_get_default_RAND(void);
+/*
+ * These functions can be used to get a functional reference to perform
+ * ciphering or digesting corresponding to "nid".
+ */
+ENGINE *ENGINE_get_cipher_engine(int nid);
+ENGINE *ENGINE_get_digest_engine(int nid);
+ENGINE *ENGINE_get_pkey_meth_engine(int nid);
+ENGINE *ENGINE_get_pkey_asn1_meth_engine(int nid);
+
+/*
+ * This sets a new default ENGINE structure for performing RSA operations. If
+ * the result is non-zero (success) then the ENGINE structure will have had
+ * its reference count up'd so the caller should still free their own
+ * reference 'e'.
+ */
+int ENGINE_set_default_RSA(ENGINE *e);
+int ENGINE_set_default_string(ENGINE *e, const char *def_list);
+/* Same for the other "methods" */
+int ENGINE_set_default_DSA(ENGINE *e);
+int ENGINE_set_default_ECDH(ENGINE *e);
+int ENGINE_set_default_ECDSA(ENGINE *e);
+int ENGINE_set_default_DH(ENGINE *e);
+int ENGINE_set_default_RAND(ENGINE *e);
+int ENGINE_set_default_ciphers(ENGINE *e);
+int ENGINE_set_default_digests(ENGINE *e);
+int ENGINE_set_default_pkey_meths(ENGINE *e);
+int ENGINE_set_default_pkey_asn1_meths(ENGINE *e);
+
+/*
+ * The combination "set" - the flags are bitwise "OR"d from the
+ * ENGINE_METHOD_*** defines above. As with the "ENGINE_register_complete()"
+ * function, this function can result in unnecessary static linkage. If your
+ * application requires only specific functionality, consider using more
+ * selective functions.
+ */
+int ENGINE_set_default(ENGINE *e, unsigned int flags);
+
+void ENGINE_add_conf_module(void);
+
+/* Deprecated functions ... */
+/* int ENGINE_clear_defaults(void); */
+
+/**************************/
+/* DYNAMIC ENGINE SUPPORT */
+/**************************/
+
+/* Binary/behaviour compatibility levels */
+# define OSSL_DYNAMIC_VERSION (unsigned long)0x00020000
+/*
+ * Binary versions older than this are too old for us (whether we're a loader
+ * or a loadee)
+ */
+# define OSSL_DYNAMIC_OLDEST (unsigned long)0x00020000
+
+/*
+ * When compiling an ENGINE entirely as an external shared library, loadable
+ * by the "dynamic" ENGINE, these types are needed. The 'dynamic_fns'
+ * structure type provides the calling application's (or library's) error
+ * functionality and memory management function pointers to the loaded
+ * library. These should be used/set in the loaded library code so that the
+ * loading application's 'state' will be used/changed in all operations. The
+ * 'static_state' pointer allows the loaded library to know if it shares the
+ * same static data as the calling application (or library), and thus whether
+ * these callbacks need to be set or not.
+ */
+typedef void *(*dyn_MEM_malloc_cb) (size_t);
+typedef void *(*dyn_MEM_realloc_cb) (void *, size_t);
+typedef void (*dyn_MEM_free_cb) (void *);
+typedef struct st_dynamic_MEM_fns {
+ dyn_MEM_malloc_cb malloc_cb;
+ dyn_MEM_realloc_cb realloc_cb;
+ dyn_MEM_free_cb free_cb;
+} dynamic_MEM_fns;
+/*
+ * FIXME: Perhaps the memory and locking code (crypto.h) should declare and
+ * use these types so we (and any other dependant code) can simplify a bit??
+ */
+typedef void (*dyn_lock_locking_cb) (int, int, const char *, int);
+typedef int (*dyn_lock_add_lock_cb) (int *, int, int, const char *, int);
+typedef struct CRYPTO_dynlock_value *(*dyn_dynlock_create_cb) (const char *,
+ int);
+typedef void (*dyn_dynlock_lock_cb) (int, struct CRYPTO_dynlock_value *,
+ const char *, int);
+typedef void (*dyn_dynlock_destroy_cb) (struct CRYPTO_dynlock_value *,
+ const char *, int);
+typedef struct st_dynamic_LOCK_fns {
+ dyn_lock_locking_cb lock_locking_cb;
+ dyn_lock_add_lock_cb lock_add_lock_cb;
+ dyn_dynlock_create_cb dynlock_create_cb;
+ dyn_dynlock_lock_cb dynlock_lock_cb;
+ dyn_dynlock_destroy_cb dynlock_destroy_cb;
+} dynamic_LOCK_fns;
+/* The top-level structure */
+typedef struct st_dynamic_fns {
+ void *static_state;
+ const ERR_FNS *err_fns;
+ const CRYPTO_EX_DATA_IMPL *ex_data_fns;
+ dynamic_MEM_fns mem_fns;
+ dynamic_LOCK_fns lock_fns;
+} dynamic_fns;
+
+/*
+ * The version checking function should be of this prototype. NB: The
+ * ossl_version value passed in is the OSSL_DYNAMIC_VERSION of the loading
+ * code. If this function returns zero, it indicates a (potential) version
+ * incompatibility and the loaded library doesn't believe it can proceed.
+ * Otherwise, the returned value is the (latest) version supported by the
+ * loading library. The loader may still decide that the loaded code's
+ * version is unsatisfactory and could veto the load. The function is
+ * expected to be implemented with the symbol name "v_check", and a default
+ * implementation can be fully instantiated with
+ * IMPLEMENT_DYNAMIC_CHECK_FN().
+ */
+typedef unsigned long (*dynamic_v_check_fn) (unsigned long ossl_version);
+# define IMPLEMENT_DYNAMIC_CHECK_FN() \
+ OPENSSL_EXPORT unsigned long v_check(unsigned long v); \
+ OPENSSL_EXPORT unsigned long v_check(unsigned long v) { \
+ if(v >= OSSL_DYNAMIC_OLDEST) return OSSL_DYNAMIC_VERSION; \
+ return 0; }
+
+/*
+ * This function is passed the ENGINE structure to initialise with its own
+ * function and command settings. It should not adjust the structural or
+ * functional reference counts. If this function returns zero, (a) the load
+ * will be aborted, (b) the previous ENGINE state will be memcpy'd back onto
+ * the structure, and (c) the shared library will be unloaded. So
+ * implementations should do their own internal cleanup in failure
+ * circumstances otherwise they could leak. The 'id' parameter, if non-NULL,
+ * represents the ENGINE id that the loader is looking for. If this is NULL,
+ * the shared library can choose to return failure or to initialise a
+ * 'default' ENGINE. If non-NULL, the shared library must initialise only an
+ * ENGINE matching the passed 'id'. The function is expected to be
+ * implemented with the symbol name "bind_engine". A standard implementation
+ * can be instantiated with IMPLEMENT_DYNAMIC_BIND_FN(fn) where the parameter
+ * 'fn' is a callback function that populates the ENGINE structure and
+ * returns an int value (zero for failure). 'fn' should have prototype;
+ * [static] int fn(ENGINE *e, const char *id);
+ */
+typedef int (*dynamic_bind_engine) (ENGINE *e, const char *id,
+ const dynamic_fns *fns);
+# define IMPLEMENT_DYNAMIC_BIND_FN(fn) \
+ OPENSSL_EXPORT \
+ int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns); \
+ OPENSSL_EXPORT \
+ int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \
+ if(ENGINE_get_static_state() == fns->static_state) goto skip_cbs; \
+ if(!CRYPTO_set_mem_functions(fns->mem_fns.malloc_cb, \
+ fns->mem_fns.realloc_cb, fns->mem_fns.free_cb)) \
+ return 0; \
+ CRYPTO_set_locking_callback(fns->lock_fns.lock_locking_cb); \
+ CRYPTO_set_add_lock_callback(fns->lock_fns.lock_add_lock_cb); \
+ CRYPTO_set_dynlock_create_callback(fns->lock_fns.dynlock_create_cb); \
+ CRYPTO_set_dynlock_lock_callback(fns->lock_fns.dynlock_lock_cb); \
+ CRYPTO_set_dynlock_destroy_callback(fns->lock_fns.dynlock_destroy_cb); \
+ if(!CRYPTO_set_ex_data_implementation(fns->ex_data_fns)) \
+ return 0; \
+ if(!ERR_set_implementation(fns->err_fns)) return 0; \
+ skip_cbs: \
+ if(!fn(e,id)) return 0; \
+ return 1; }
+
+/*
+ * If the loading application (or library) and the loaded ENGINE library
+ * share the same static data (eg. they're both dynamically linked to the
+ * same libcrypto.so) we need a way to avoid trying to set system callbacks -
+ * this would fail, and for the same reason that it's unnecessary to try. If
+ * the loaded ENGINE has (or gets from through the loader) its own copy of
+ * the libcrypto static data, we will need to set the callbacks. The easiest
+ * way to detect this is to have a function that returns a pointer to some
+ * static data and let the loading application and loaded ENGINE compare
+ * their respective values.
+ */
+void *ENGINE_get_static_state(void);
+
+# if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV)
+void ENGINE_setup_bsd_cryptodev(void);
+# endif
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_ENGINE_strings(void);
+
+/* Error codes for the ENGINE functions. */
+
+/* Function codes. */
+# define ENGINE_F_DYNAMIC_CTRL 180
+# define ENGINE_F_DYNAMIC_GET_DATA_CTX 181
+# define ENGINE_F_DYNAMIC_LOAD 182
+# define ENGINE_F_DYNAMIC_SET_DATA_CTX 183
+# define ENGINE_F_ENGINE_ADD 105
+# define ENGINE_F_ENGINE_BY_ID 106
+# define ENGINE_F_ENGINE_CMD_IS_EXECUTABLE 170
+# define ENGINE_F_ENGINE_CTRL 142
+# define ENGINE_F_ENGINE_CTRL_CMD 178
+# define ENGINE_F_ENGINE_CTRL_CMD_STRING 171
+# define ENGINE_F_ENGINE_FINISH 107
+# define ENGINE_F_ENGINE_FREE_UTIL 108
+# define ENGINE_F_ENGINE_GET_CIPHER 185
+# define ENGINE_F_ENGINE_GET_DEFAULT_TYPE 177
+# define ENGINE_F_ENGINE_GET_DIGEST 186
+# define ENGINE_F_ENGINE_GET_NEXT 115
+# define ENGINE_F_ENGINE_GET_PKEY_ASN1_METH 193
+# define ENGINE_F_ENGINE_GET_PKEY_METH 192
+# define ENGINE_F_ENGINE_GET_PREV 116
+# define ENGINE_F_ENGINE_INIT 119
+# define ENGINE_F_ENGINE_LIST_ADD 120
+# define ENGINE_F_ENGINE_LIST_REMOVE 121
+# define ENGINE_F_ENGINE_LOAD_PRIVATE_KEY 150
+# define ENGINE_F_ENGINE_LOAD_PUBLIC_KEY 151
+# define ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT 194
+# define ENGINE_F_ENGINE_NEW 122
+# define ENGINE_F_ENGINE_REMOVE 123
+# define ENGINE_F_ENGINE_SET_DEFAULT_STRING 189
+# define ENGINE_F_ENGINE_SET_DEFAULT_TYPE 126
+# define ENGINE_F_ENGINE_SET_ID 129
+# define ENGINE_F_ENGINE_SET_NAME 130
+# define ENGINE_F_ENGINE_TABLE_REGISTER 184
+# define ENGINE_F_ENGINE_UNLOAD_KEY 152
+# define ENGINE_F_ENGINE_UNLOCKED_FINISH 191
+# define ENGINE_F_ENGINE_UP_REF 190
+# define ENGINE_F_INT_CTRL_HELPER 172
+# define ENGINE_F_INT_ENGINE_CONFIGURE 188
+# define ENGINE_F_INT_ENGINE_MODULE_INIT 187
+# define ENGINE_F_LOG_MESSAGE 141
+
+/* Reason codes. */
+# define ENGINE_R_ALREADY_LOADED 100
+# define ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER 133
+# define ENGINE_R_CMD_NOT_EXECUTABLE 134
+# define ENGINE_R_COMMAND_TAKES_INPUT 135
+# define ENGINE_R_COMMAND_TAKES_NO_INPUT 136
+# define ENGINE_R_CONFLICTING_ENGINE_ID 103
+# define ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED 119
+# define ENGINE_R_DH_NOT_IMPLEMENTED 139
+# define ENGINE_R_DSA_NOT_IMPLEMENTED 140
+# define ENGINE_R_DSO_FAILURE 104
+# define ENGINE_R_DSO_NOT_FOUND 132
+# define ENGINE_R_ENGINES_SECTION_ERROR 148
+# define ENGINE_R_ENGINE_CONFIGURATION_ERROR 102
+# define ENGINE_R_ENGINE_IS_NOT_IN_LIST 105
+# define ENGINE_R_ENGINE_SECTION_ERROR 149
+# define ENGINE_R_FAILED_LOADING_PRIVATE_KEY 128
+# define ENGINE_R_FAILED_LOADING_PUBLIC_KEY 129
+# define ENGINE_R_FINISH_FAILED 106
+# define ENGINE_R_GET_HANDLE_FAILED 107
+# define ENGINE_R_ID_OR_NAME_MISSING 108
+# define ENGINE_R_INIT_FAILED 109
+# define ENGINE_R_INTERNAL_LIST_ERROR 110
+# define ENGINE_R_INVALID_ARGUMENT 143
+# define ENGINE_R_INVALID_CMD_NAME 137
+# define ENGINE_R_INVALID_CMD_NUMBER 138
+# define ENGINE_R_INVALID_INIT_VALUE 151
+# define ENGINE_R_INVALID_STRING 150
+# define ENGINE_R_NOT_INITIALISED 117
+# define ENGINE_R_NOT_LOADED 112
+# define ENGINE_R_NO_CONTROL_FUNCTION 120
+# define ENGINE_R_NO_INDEX 144
+# define ENGINE_R_NO_LOAD_FUNCTION 125
+# define ENGINE_R_NO_REFERENCE 130
+# define ENGINE_R_NO_SUCH_ENGINE 116
+# define ENGINE_R_NO_UNLOAD_FUNCTION 126
+# define ENGINE_R_PROVIDE_PARAMETERS 113
+# define ENGINE_R_RSA_NOT_IMPLEMENTED 141
+# define ENGINE_R_UNIMPLEMENTED_CIPHER 146
+# define ENGINE_R_UNIMPLEMENTED_DIGEST 147
+# define ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD 101
+# define ENGINE_R_VERSION_INCOMPATIBILITY 145
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/err.h b/protocols/Telegram/tgl/openssl/include/openssl/err.h
new file mode 100644
index 0000000000..585aa8ba3d
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/err.h
@@ -0,0 +1,389 @@
+/* crypto/err/err.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+/* ====================================================================
+ * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_ERR_H
+# define HEADER_ERR_H
+
+# include <openssl/e_os2.h>
+
+# ifndef OPENSSL_NO_FP_API
+# include <stdio.h>
+# include <stdlib.h>
+# endif
+
+# include <openssl/ossl_typ.h>
+# ifndef OPENSSL_NO_BIO
+# include <openssl/bio.h>
+# endif
+# ifndef OPENSSL_NO_LHASH
+# include <openssl/lhash.h>
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# ifndef OPENSSL_NO_ERR
+# define ERR_PUT_error(a,b,c,d,e) ERR_put_error(a,b,c,d,e)
+# else
+# define ERR_PUT_error(a,b,c,d,e) ERR_put_error(a,b,c,NULL,0)
+# endif
+
+# include <errno.h>
+
+# define ERR_TXT_MALLOCED 0x01
+# define ERR_TXT_STRING 0x02
+
+# define ERR_FLAG_MARK 0x01
+
+# define ERR_NUM_ERRORS 16
+typedef struct err_state_st {
+ CRYPTO_THREADID tid;
+ int err_flags[ERR_NUM_ERRORS];
+ unsigned long err_buffer[ERR_NUM_ERRORS];
+ char *err_data[ERR_NUM_ERRORS];
+ int err_data_flags[ERR_NUM_ERRORS];
+ const char *err_file[ERR_NUM_ERRORS];
+ int err_line[ERR_NUM_ERRORS];
+ int top, bottom;
+} ERR_STATE;
+
+/* library */
+# define ERR_LIB_NONE 1
+# define ERR_LIB_SYS 2
+# define ERR_LIB_BN 3
+# define ERR_LIB_RSA 4
+# define ERR_LIB_DH 5
+# define ERR_LIB_EVP 6
+# define ERR_LIB_BUF 7
+# define ERR_LIB_OBJ 8
+# define ERR_LIB_PEM 9
+# define ERR_LIB_DSA 10
+# define ERR_LIB_X509 11
+/* #define ERR_LIB_METH 12 */
+# define ERR_LIB_ASN1 13
+# define ERR_LIB_CONF 14
+# define ERR_LIB_CRYPTO 15
+# define ERR_LIB_EC 16
+# define ERR_LIB_SSL 20
+/* #define ERR_LIB_SSL23 21 */
+/* #define ERR_LIB_SSL2 22 */
+/* #define ERR_LIB_SSL3 23 */
+/* #define ERR_LIB_RSAREF 30 */
+/* #define ERR_LIB_PROXY 31 */
+# define ERR_LIB_BIO 32
+# define ERR_LIB_PKCS7 33
+# define ERR_LIB_X509V3 34
+# define ERR_LIB_PKCS12 35
+# define ERR_LIB_RAND 36
+# define ERR_LIB_DSO 37
+# define ERR_LIB_ENGINE 38
+# define ERR_LIB_OCSP 39
+# define ERR_LIB_UI 40
+# define ERR_LIB_COMP 41
+# define ERR_LIB_ECDSA 42
+# define ERR_LIB_ECDH 43
+# define ERR_LIB_STORE 44
+# define ERR_LIB_FIPS 45
+# define ERR_LIB_CMS 46
+# define ERR_LIB_TS 47
+# define ERR_LIB_HMAC 48
+# define ERR_LIB_JPAKE 49
+
+# define ERR_LIB_USER 128
+
+# define SYSerr(f,r) ERR_PUT_error(ERR_LIB_SYS,(f),(r),__FILE__,__LINE__)
+# define BNerr(f,r) ERR_PUT_error(ERR_LIB_BN,(f),(r),__FILE__,__LINE__)
+# define RSAerr(f,r) ERR_PUT_error(ERR_LIB_RSA,(f),(r),__FILE__,__LINE__)
+# define DHerr(f,r) ERR_PUT_error(ERR_LIB_DH,(f),(r),__FILE__,__LINE__)
+# define EVPerr(f,r) ERR_PUT_error(ERR_LIB_EVP,(f),(r),__FILE__,__LINE__)
+# define BUFerr(f,r) ERR_PUT_error(ERR_LIB_BUF,(f),(r),__FILE__,__LINE__)
+# define OBJerr(f,r) ERR_PUT_error(ERR_LIB_OBJ,(f),(r),__FILE__,__LINE__)
+# define PEMerr(f,r) ERR_PUT_error(ERR_LIB_PEM,(f),(r),__FILE__,__LINE__)
+# define DSAerr(f,r) ERR_PUT_error(ERR_LIB_DSA,(f),(r),__FILE__,__LINE__)
+# define X509err(f,r) ERR_PUT_error(ERR_LIB_X509,(f),(r),__FILE__,__LINE__)
+# define ASN1err(f,r) ERR_PUT_error(ERR_LIB_ASN1,(f),(r),__FILE__,__LINE__)
+# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),__FILE__,__LINE__)
+# define CRYPTOerr(f,r) ERR_PUT_error(ERR_LIB_CRYPTO,(f),(r),__FILE__,__LINE__)
+# define ECerr(f,r) ERR_PUT_error(ERR_LIB_EC,(f),(r),__FILE__,__LINE__)
+# define SSLerr(f,r) ERR_PUT_error(ERR_LIB_SSL,(f),(r),__FILE__,__LINE__)
+# define BIOerr(f,r) ERR_PUT_error(ERR_LIB_BIO,(f),(r),__FILE__,__LINE__)
+# define PKCS7err(f,r) ERR_PUT_error(ERR_LIB_PKCS7,(f),(r),__FILE__,__LINE__)
+# define X509V3err(f,r) ERR_PUT_error(ERR_LIB_X509V3,(f),(r),__FILE__,__LINE__)
+# define PKCS12err(f,r) ERR_PUT_error(ERR_LIB_PKCS12,(f),(r),__FILE__,__LINE__)
+# define RANDerr(f,r) ERR_PUT_error(ERR_LIB_RAND,(f),(r),__FILE__,__LINE__)
+# define DSOerr(f,r) ERR_PUT_error(ERR_LIB_DSO,(f),(r),__FILE__,__LINE__)
+# define ENGINEerr(f,r) ERR_PUT_error(ERR_LIB_ENGINE,(f),(r),__FILE__,__LINE__)
+# define OCSPerr(f,r) ERR_PUT_error(ERR_LIB_OCSP,(f),(r),__FILE__,__LINE__)
+# define UIerr(f,r) ERR_PUT_error(ERR_LIB_UI,(f),(r),__FILE__,__LINE__)
+# define COMPerr(f,r) ERR_PUT_error(ERR_LIB_COMP,(f),(r),__FILE__,__LINE__)
+# define ECDSAerr(f,r) ERR_PUT_error(ERR_LIB_ECDSA,(f),(r),__FILE__,__LINE__)
+# define ECDHerr(f,r) ERR_PUT_error(ERR_LIB_ECDH,(f),(r),__FILE__,__LINE__)
+# define STOREerr(f,r) ERR_PUT_error(ERR_LIB_STORE,(f),(r),__FILE__,__LINE__)
+# define FIPSerr(f,r) ERR_PUT_error(ERR_LIB_FIPS,(f),(r),__FILE__,__LINE__)
+# define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,(f),(r),__FILE__,__LINE__)
+# define TSerr(f,r) ERR_PUT_error(ERR_LIB_TS,(f),(r),__FILE__,__LINE__)
+# define HMACerr(f,r) ERR_PUT_error(ERR_LIB_HMAC,(f),(r),__FILE__,__LINE__)
+# define JPAKEerr(f,r) ERR_PUT_error(ERR_LIB_JPAKE,(f),(r),__FILE__,__LINE__)
+
+/*
+ * Borland C seems too stupid to be able to shift and do longs in the
+ * pre-processor :-(
+ */
+# define ERR_PACK(l,f,r) (((((unsigned long)l)&0xffL)*0x1000000)| \
+ ((((unsigned long)f)&0xfffL)*0x1000)| \
+ ((((unsigned long)r)&0xfffL)))
+# define ERR_GET_LIB(l) (int)((((unsigned long)l)>>24L)&0xffL)
+# define ERR_GET_FUNC(l) (int)((((unsigned long)l)>>12L)&0xfffL)
+# define ERR_GET_REASON(l) (int)((l)&0xfffL)
+# define ERR_FATAL_ERROR(l) (int)((l)&ERR_R_FATAL)
+
+/* OS functions */
+# define SYS_F_FOPEN 1
+# define SYS_F_CONNECT 2
+# define SYS_F_GETSERVBYNAME 3
+# define SYS_F_SOCKET 4
+# define SYS_F_IOCTLSOCKET 5
+# define SYS_F_BIND 6
+# define SYS_F_LISTEN 7
+# define SYS_F_ACCEPT 8
+# define SYS_F_WSASTARTUP 9/* Winsock stuff */
+# define SYS_F_OPENDIR 10
+# define SYS_F_FREAD 11
+
+/* reasons */
+# define ERR_R_SYS_LIB ERR_LIB_SYS/* 2 */
+# define ERR_R_BN_LIB ERR_LIB_BN/* 3 */
+# define ERR_R_RSA_LIB ERR_LIB_RSA/* 4 */
+# define ERR_R_DH_LIB ERR_LIB_DH/* 5 */
+# define ERR_R_EVP_LIB ERR_LIB_EVP/* 6 */
+# define ERR_R_BUF_LIB ERR_LIB_BUF/* 7 */
+# define ERR_R_OBJ_LIB ERR_LIB_OBJ/* 8 */
+# define ERR_R_PEM_LIB ERR_LIB_PEM/* 9 */
+# define ERR_R_DSA_LIB ERR_LIB_DSA/* 10 */
+# define ERR_R_X509_LIB ERR_LIB_X509/* 11 */
+# define ERR_R_ASN1_LIB ERR_LIB_ASN1/* 13 */
+# define ERR_R_CONF_LIB ERR_LIB_CONF/* 14 */
+# define ERR_R_CRYPTO_LIB ERR_LIB_CRYPTO/* 15 */
+# define ERR_R_EC_LIB ERR_LIB_EC/* 16 */
+# define ERR_R_SSL_LIB ERR_LIB_SSL/* 20 */
+# define ERR_R_BIO_LIB ERR_LIB_BIO/* 32 */
+# define ERR_R_PKCS7_LIB ERR_LIB_PKCS7/* 33 */
+# define ERR_R_X509V3_LIB ERR_LIB_X509V3/* 34 */
+# define ERR_R_PKCS12_LIB ERR_LIB_PKCS12/* 35 */
+# define ERR_R_RAND_LIB ERR_LIB_RAND/* 36 */
+# define ERR_R_DSO_LIB ERR_LIB_DSO/* 37 */
+# define ERR_R_ENGINE_LIB ERR_LIB_ENGINE/* 38 */
+# define ERR_R_OCSP_LIB ERR_LIB_OCSP/* 39 */
+# define ERR_R_UI_LIB ERR_LIB_UI/* 40 */
+# define ERR_R_COMP_LIB ERR_LIB_COMP/* 41 */
+# define ERR_R_ECDSA_LIB ERR_LIB_ECDSA/* 42 */
+# define ERR_R_ECDH_LIB ERR_LIB_ECDH/* 43 */
+# define ERR_R_STORE_LIB ERR_LIB_STORE/* 44 */
+# define ERR_R_TS_LIB ERR_LIB_TS/* 45 */
+
+# define ERR_R_NESTED_ASN1_ERROR 58
+# define ERR_R_BAD_ASN1_OBJECT_HEADER 59
+# define ERR_R_BAD_GET_ASN1_OBJECT_CALL 60
+# define ERR_R_EXPECTING_AN_ASN1_SEQUENCE 61
+# define ERR_R_ASN1_LENGTH_MISMATCH 62
+# define ERR_R_MISSING_ASN1_EOS 63
+
+/* fatal error */
+# define ERR_R_FATAL 64
+# define ERR_R_MALLOC_FAILURE (1|ERR_R_FATAL)
+# define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED (2|ERR_R_FATAL)
+# define ERR_R_PASSED_NULL_PARAMETER (3|ERR_R_FATAL)
+# define ERR_R_INTERNAL_ERROR (4|ERR_R_FATAL)
+# define ERR_R_DISABLED (5|ERR_R_FATAL)
+
+/*
+ * 99 is the maximum possible ERR_R_... code, higher values are reserved for
+ * the individual libraries
+ */
+
+typedef struct ERR_string_data_st {
+ unsigned long error;
+ const char *string;
+} ERR_STRING_DATA;
+
+void ERR_put_error(int lib, int func, int reason, const char *file, int line);
+void ERR_set_error_data(char *data, int flags);
+
+unsigned long ERR_get_error(void);
+unsigned long ERR_get_error_line(const char **file, int *line);
+unsigned long ERR_get_error_line_data(const char **file, int *line,
+ const char **data, int *flags);
+unsigned long ERR_peek_error(void);
+unsigned long ERR_peek_error_line(const char **file, int *line);
+unsigned long ERR_peek_error_line_data(const char **file, int *line,
+ const char **data, int *flags);
+unsigned long ERR_peek_last_error(void);
+unsigned long ERR_peek_last_error_line(const char **file, int *line);
+unsigned long ERR_peek_last_error_line_data(const char **file, int *line,
+ const char **data, int *flags);
+void ERR_clear_error(void);
+char *ERR_error_string(unsigned long e, char *buf);
+void ERR_error_string_n(unsigned long e, char *buf, size_t len);
+const char *ERR_lib_error_string(unsigned long e);
+const char *ERR_func_error_string(unsigned long e);
+const char *ERR_reason_error_string(unsigned long e);
+void ERR_print_errors_cb(int (*cb) (const char *str, size_t len, void *u),
+ void *u);
+# ifndef OPENSSL_NO_FP_API
+void ERR_print_errors_fp(FILE *fp);
+# endif
+# ifndef OPENSSL_NO_BIO
+void ERR_print_errors(BIO *bp);
+# endif
+void ERR_add_error_data(int num, ...);
+void ERR_add_error_vdata(int num, va_list args);
+void ERR_load_strings(int lib, ERR_STRING_DATA str[]);
+void ERR_unload_strings(int lib, ERR_STRING_DATA str[]);
+void ERR_load_ERR_strings(void);
+void ERR_load_crypto_strings(void);
+void ERR_free_strings(void);
+
+void ERR_remove_thread_state(const CRYPTO_THREADID *tid);
+# ifndef OPENSSL_NO_DEPRECATED
+void ERR_remove_state(unsigned long pid); /* if zero we look it up */
+# endif
+ERR_STATE *ERR_get_state(void);
+
+# ifndef OPENSSL_NO_LHASH
+LHASH_OF(ERR_STRING_DATA) *ERR_get_string_table(void);
+LHASH_OF(ERR_STATE) *ERR_get_err_state_table(void);
+void ERR_release_err_state_table(LHASH_OF(ERR_STATE) **hash);
+# endif
+
+int ERR_get_next_error_library(void);
+
+int ERR_set_mark(void);
+int ERR_pop_to_mark(void);
+
+/* Already defined in ossl_typ.h */
+/* typedef struct st_ERR_FNS ERR_FNS; */
+/*
+ * An application can use this function and provide the return value to
+ * loaded modules that should use the application's ERR state/functionality
+ */
+const ERR_FNS *ERR_get_implementation(void);
+/*
+ * A loaded module should call this function prior to any ERR operations
+ * using the application's "ERR_FNS".
+ */
+int ERR_set_implementation(const ERR_FNS *fns);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/evp.h b/protocols/Telegram/tgl/openssl/include/openssl/evp.h
new file mode 100644
index 0000000000..39ab7937d2
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/evp.h
@@ -0,0 +1,1534 @@
+/* crypto/evp/evp.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_ENVELOPE_H
+# define HEADER_ENVELOPE_H
+
+# ifdef OPENSSL_ALGORITHM_DEFINES
+# include <openssl/opensslconf.h>
+# else
+# define OPENSSL_ALGORITHM_DEFINES
+# include <openssl/opensslconf.h>
+# undef OPENSSL_ALGORITHM_DEFINES
+# endif
+
+# include <openssl/ossl_typ.h>
+
+# include <openssl/symhacks.h>
+
+# ifndef OPENSSL_NO_BIO
+# include <openssl/bio.h>
+# endif
+
+/*-
+#define EVP_RC2_KEY_SIZE 16
+#define EVP_RC4_KEY_SIZE 16
+#define EVP_BLOWFISH_KEY_SIZE 16
+#define EVP_CAST5_KEY_SIZE 16
+#define EVP_RC5_32_12_16_KEY_SIZE 16
+*/
+# define EVP_MAX_MD_SIZE 64/* longest known is SHA512 */
+# define EVP_MAX_KEY_LENGTH 64
+# define EVP_MAX_IV_LENGTH 16
+# define EVP_MAX_BLOCK_LENGTH 32
+
+# define PKCS5_SALT_LEN 8
+/* Default PKCS#5 iteration count */
+# define PKCS5_DEFAULT_ITER 2048
+
+# include <openssl/objects.h>
+
+# define EVP_PK_RSA 0x0001
+# define EVP_PK_DSA 0x0002
+# define EVP_PK_DH 0x0004
+# define EVP_PK_EC 0x0008
+# define EVP_PKT_SIGN 0x0010
+# define EVP_PKT_ENC 0x0020
+# define EVP_PKT_EXCH 0x0040
+# define EVP_PKS_RSA 0x0100
+# define EVP_PKS_DSA 0x0200
+# define EVP_PKS_EC 0x0400
+
+# define EVP_PKEY_NONE NID_undef
+# define EVP_PKEY_RSA NID_rsaEncryption
+# define EVP_PKEY_RSA2 NID_rsa
+# define EVP_PKEY_DSA NID_dsa
+# define EVP_PKEY_DSA1 NID_dsa_2
+# define EVP_PKEY_DSA2 NID_dsaWithSHA
+# define EVP_PKEY_DSA3 NID_dsaWithSHA1
+# define EVP_PKEY_DSA4 NID_dsaWithSHA1_2
+# define EVP_PKEY_DH NID_dhKeyAgreement
+# define EVP_PKEY_DHX NID_dhpublicnumber
+# define EVP_PKEY_EC NID_X9_62_id_ecPublicKey
+# define EVP_PKEY_HMAC NID_hmac
+# define EVP_PKEY_CMAC NID_cmac
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Type needs to be a bit field Sub-type needs to be for variations on the
+ * method, as in, can it do arbitrary encryption....
+ */
+struct evp_pkey_st {
+ int type;
+ int save_type;
+ int references;
+ const EVP_PKEY_ASN1_METHOD *ameth;
+ ENGINE *engine;
+ union {
+ char *ptr;
+# ifndef OPENSSL_NO_RSA
+ struct rsa_st *rsa; /* RSA */
+# endif
+# ifndef OPENSSL_NO_DSA
+ struct dsa_st *dsa; /* DSA */
+# endif
+# ifndef OPENSSL_NO_DH
+ struct dh_st *dh; /* DH */
+# endif
+# ifndef OPENSSL_NO_EC
+ struct ec_key_st *ec; /* ECC */
+# endif
+ } pkey;
+ int save_parameters;
+ STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */
+} /* EVP_PKEY */ ;
+
+# define EVP_PKEY_MO_SIGN 0x0001
+# define EVP_PKEY_MO_VERIFY 0x0002
+# define EVP_PKEY_MO_ENCRYPT 0x0004
+# define EVP_PKEY_MO_DECRYPT 0x0008
+
+# ifndef EVP_MD
+struct env_md_st {
+ int type;
+ int pkey_type;
+ int md_size;
+ unsigned long flags;
+ int (*init) (EVP_MD_CTX *ctx);
+ int (*update) (EVP_MD_CTX *ctx, const void *data, size_t count);
+ int (*final) (EVP_MD_CTX *ctx, unsigned char *md);
+ int (*copy) (EVP_MD_CTX *to, const EVP_MD_CTX *from);
+ int (*cleanup) (EVP_MD_CTX *ctx);
+ /* FIXME: prototype these some day */
+ int (*sign) (int type, const unsigned char *m, unsigned int m_length,
+ unsigned char *sigret, unsigned int *siglen, void *key);
+ int (*verify) (int type, const unsigned char *m, unsigned int m_length,
+ const unsigned char *sigbuf, unsigned int siglen,
+ void *key);
+ int required_pkey_type[5]; /* EVP_PKEY_xxx */
+ int block_size;
+ int ctx_size; /* how big does the ctx->md_data need to be */
+ /* control function */
+ int (*md_ctrl) (EVP_MD_CTX *ctx, int cmd, int p1, void *p2);
+} /* EVP_MD */ ;
+
+typedef int evp_sign_method(int type, const unsigned char *m,
+ unsigned int m_length, unsigned char *sigret,
+ unsigned int *siglen, void *key);
+typedef int evp_verify_method(int type, const unsigned char *m,
+ unsigned int m_length,
+ const unsigned char *sigbuf,
+ unsigned int siglen, void *key);
+
+/* digest can only handle a single block */
+# define EVP_MD_FLAG_ONESHOT 0x0001
+
+/*
+ * digest is a "clone" digest used
+ * which is a copy of an existing
+ * one for a specific public key type.
+ * EVP_dss1() etc
+ */
+# define EVP_MD_FLAG_PKEY_DIGEST 0x0002
+
+/* Digest uses EVP_PKEY_METHOD for signing instead of MD specific signing */
+
+# define EVP_MD_FLAG_PKEY_METHOD_SIGNATURE 0x0004
+
+/* DigestAlgorithmIdentifier flags... */
+
+# define EVP_MD_FLAG_DIGALGID_MASK 0x0018
+
+/* NULL or absent parameter accepted. Use NULL */
+
+# define EVP_MD_FLAG_DIGALGID_NULL 0x0000
+
+/* NULL or absent parameter accepted. Use NULL for PKCS#1 otherwise absent */
+
+# define EVP_MD_FLAG_DIGALGID_ABSENT 0x0008
+
+/* Custom handling via ctrl */
+
+# define EVP_MD_FLAG_DIGALGID_CUSTOM 0x0018
+
+/* Note if suitable for use in FIPS mode */
+# define EVP_MD_FLAG_FIPS 0x0400
+
+/* Digest ctrls */
+
+# define EVP_MD_CTRL_DIGALGID 0x1
+# define EVP_MD_CTRL_MICALG 0x2
+
+/* Minimum Algorithm specific ctrl value */
+
+# define EVP_MD_CTRL_ALG_CTRL 0x1000
+
+# define EVP_PKEY_NULL_method NULL,NULL,{0,0,0,0}
+
+# ifndef OPENSSL_NO_DSA
+# define EVP_PKEY_DSA_method (evp_sign_method *)DSA_sign, \
+ (evp_verify_method *)DSA_verify, \
+ {EVP_PKEY_DSA,EVP_PKEY_DSA2,EVP_PKEY_DSA3, \
+ EVP_PKEY_DSA4,0}
+# else
+# define EVP_PKEY_DSA_method EVP_PKEY_NULL_method
+# endif
+
+# ifndef OPENSSL_NO_ECDSA
+# define EVP_PKEY_ECDSA_method (evp_sign_method *)ECDSA_sign, \
+ (evp_verify_method *)ECDSA_verify, \
+ {EVP_PKEY_EC,0,0,0}
+# else
+# define EVP_PKEY_ECDSA_method EVP_PKEY_NULL_method
+# endif
+
+# ifndef OPENSSL_NO_RSA
+# define EVP_PKEY_RSA_method (evp_sign_method *)RSA_sign, \
+ (evp_verify_method *)RSA_verify, \
+ {EVP_PKEY_RSA,EVP_PKEY_RSA2,0,0}
+# define EVP_PKEY_RSA_ASN1_OCTET_STRING_method \
+ (evp_sign_method *)RSA_sign_ASN1_OCTET_STRING, \
+ (evp_verify_method *)RSA_verify_ASN1_OCTET_STRING, \
+ {EVP_PKEY_RSA,EVP_PKEY_RSA2,0,0}
+# else
+# define EVP_PKEY_RSA_method EVP_PKEY_NULL_method
+# define EVP_PKEY_RSA_ASN1_OCTET_STRING_method EVP_PKEY_NULL_method
+# endif
+
+# endif /* !EVP_MD */
+
+struct env_md_ctx_st {
+ const EVP_MD *digest;
+ ENGINE *engine; /* functional reference if 'digest' is
+ * ENGINE-provided */
+ unsigned long flags;
+ void *md_data;
+ /* Public key context for sign/verify */
+ EVP_PKEY_CTX *pctx;
+ /* Update function: usually copied from EVP_MD */
+ int (*update) (EVP_MD_CTX *ctx, const void *data, size_t count);
+} /* EVP_MD_CTX */ ;
+
+/* values for EVP_MD_CTX flags */
+
+# define EVP_MD_CTX_FLAG_ONESHOT 0x0001/* digest update will be
+ * called once only */
+# define EVP_MD_CTX_FLAG_CLEANED 0x0002/* context has already been
+ * cleaned */
+# define EVP_MD_CTX_FLAG_REUSE 0x0004/* Don't free up ctx->md_data
+ * in EVP_MD_CTX_cleanup */
+/*
+ * FIPS and pad options are ignored in 1.0.0, definitions are here so we
+ * don't accidentally reuse the values for other purposes.
+ */
+
+# define EVP_MD_CTX_FLAG_NON_FIPS_ALLOW 0x0008/* Allow use of non FIPS
+ * digest in FIPS mode */
+
+/*
+ * The following PAD options are also currently ignored in 1.0.0, digest
+ * parameters are handled through EVP_DigestSign*() and EVP_DigestVerify*()
+ * instead.
+ */
+# define EVP_MD_CTX_FLAG_PAD_MASK 0xF0/* RSA mode to use */
+# define EVP_MD_CTX_FLAG_PAD_PKCS1 0x00/* PKCS#1 v1.5 mode */
+# define EVP_MD_CTX_FLAG_PAD_X931 0x10/* X9.31 mode */
+# define EVP_MD_CTX_FLAG_PAD_PSS 0x20/* PSS mode */
+
+# define EVP_MD_CTX_FLAG_NO_INIT 0x0100/* Don't initialize md_data */
+
+struct evp_cipher_st {
+ int nid;
+ int block_size;
+ /* Default value for variable length ciphers */
+ int key_len;
+ int iv_len;
+ /* Various flags */
+ unsigned long flags;
+ /* init key */
+ int (*init) (EVP_CIPHER_CTX *ctx, const unsigned char *key,
+ const unsigned char *iv, int enc);
+ /* encrypt/decrypt data */
+ int (*do_cipher) (EVP_CIPHER_CTX *ctx, unsigned char *out,
+ const unsigned char *in, size_t inl);
+ /* cleanup ctx */
+ int (*cleanup) (EVP_CIPHER_CTX *);
+ /* how big ctx->cipher_data needs to be */
+ int ctx_size;
+ /* Populate a ASN1_TYPE with parameters */
+ int (*set_asn1_parameters) (EVP_CIPHER_CTX *, ASN1_TYPE *);
+ /* Get parameters from a ASN1_TYPE */
+ int (*get_asn1_parameters) (EVP_CIPHER_CTX *, ASN1_TYPE *);
+ /* Miscellaneous operations */
+ int (*ctrl) (EVP_CIPHER_CTX *, int type, int arg, void *ptr);
+ /* Application data */
+ void *app_data;
+} /* EVP_CIPHER */ ;
+
+/* Values for cipher flags */
+
+/* Modes for ciphers */
+
+# define EVP_CIPH_STREAM_CIPHER 0x0
+# define EVP_CIPH_ECB_MODE 0x1
+# define EVP_CIPH_CBC_MODE 0x2
+# define EVP_CIPH_CFB_MODE 0x3
+# define EVP_CIPH_OFB_MODE 0x4
+# define EVP_CIPH_CTR_MODE 0x5
+# define EVP_CIPH_GCM_MODE 0x6
+# define EVP_CIPH_CCM_MODE 0x7
+# define EVP_CIPH_XTS_MODE 0x10001
+# define EVP_CIPH_WRAP_MODE 0x10002
+# define EVP_CIPH_MODE 0xF0007
+/* Set if variable length cipher */
+# define EVP_CIPH_VARIABLE_LENGTH 0x8
+/* Set if the iv handling should be done by the cipher itself */
+# define EVP_CIPH_CUSTOM_IV 0x10
+/* Set if the cipher's init() function should be called if key is NULL */
+# define EVP_CIPH_ALWAYS_CALL_INIT 0x20
+/* Call ctrl() to init cipher parameters */
+# define EVP_CIPH_CTRL_INIT 0x40
+/* Don't use standard key length function */
+# define EVP_CIPH_CUSTOM_KEY_LENGTH 0x80
+/* Don't use standard block padding */
+# define EVP_CIPH_NO_PADDING 0x100
+/* cipher handles random key generation */
+# define EVP_CIPH_RAND_KEY 0x200
+/* cipher has its own additional copying logic */
+# define EVP_CIPH_CUSTOM_COPY 0x400
+/* Allow use default ASN1 get/set iv */
+# define EVP_CIPH_FLAG_DEFAULT_ASN1 0x1000
+/* Buffer length in bits not bytes: CFB1 mode only */
+# define EVP_CIPH_FLAG_LENGTH_BITS 0x2000
+/* Note if suitable for use in FIPS mode */
+# define EVP_CIPH_FLAG_FIPS 0x4000
+/* Allow non FIPS cipher in FIPS mode */
+# define EVP_CIPH_FLAG_NON_FIPS_ALLOW 0x8000
+/*
+ * Cipher handles any and all padding logic as well as finalisation.
+ */
+# define EVP_CIPH_FLAG_CUSTOM_CIPHER 0x100000
+# define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000
+# define EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK 0x400000
+
+/*
+ * Cipher context flag to indicate we can handle wrap mode: if allowed in
+ * older applications it could overflow buffers.
+ */
+
+# define EVP_CIPHER_CTX_FLAG_WRAP_ALLOW 0x1
+
+/* ctrl() values */
+
+# define EVP_CTRL_INIT 0x0
+# define EVP_CTRL_SET_KEY_LENGTH 0x1
+# define EVP_CTRL_GET_RC2_KEY_BITS 0x2
+# define EVP_CTRL_SET_RC2_KEY_BITS 0x3
+# define EVP_CTRL_GET_RC5_ROUNDS 0x4
+# define EVP_CTRL_SET_RC5_ROUNDS 0x5
+# define EVP_CTRL_RAND_KEY 0x6
+# define EVP_CTRL_PBE_PRF_NID 0x7
+# define EVP_CTRL_COPY 0x8
+# define EVP_CTRL_GCM_SET_IVLEN 0x9
+# define EVP_CTRL_GCM_GET_TAG 0x10
+# define EVP_CTRL_GCM_SET_TAG 0x11
+# define EVP_CTRL_GCM_SET_IV_FIXED 0x12
+# define EVP_CTRL_GCM_IV_GEN 0x13
+# define EVP_CTRL_CCM_SET_IVLEN EVP_CTRL_GCM_SET_IVLEN
+# define EVP_CTRL_CCM_GET_TAG EVP_CTRL_GCM_GET_TAG
+# define EVP_CTRL_CCM_SET_TAG EVP_CTRL_GCM_SET_TAG
+# define EVP_CTRL_CCM_SET_L 0x14
+# define EVP_CTRL_CCM_SET_MSGLEN 0x15
+/*
+ * AEAD cipher deduces payload length and returns number of bytes required to
+ * store MAC and eventual padding. Subsequent call to EVP_Cipher even
+ * appends/verifies MAC.
+ */
+# define EVP_CTRL_AEAD_TLS1_AAD 0x16
+/* Used by composite AEAD ciphers, no-op in GCM, CCM... */
+# define EVP_CTRL_AEAD_SET_MAC_KEY 0x17
+/* Set the GCM invocation field, decrypt only */
+# define EVP_CTRL_GCM_SET_IV_INV 0x18
+
+# define EVP_CTRL_TLS1_1_MULTIBLOCK_AAD 0x19
+# define EVP_CTRL_TLS1_1_MULTIBLOCK_ENCRYPT 0x1a
+# define EVP_CTRL_TLS1_1_MULTIBLOCK_DECRYPT 0x1b
+# define EVP_CTRL_TLS1_1_MULTIBLOCK_MAX_BUFSIZE 0x1c
+
+/* RFC 5246 defines additional data to be 13 bytes in length */
+# define EVP_AEAD_TLS1_AAD_LEN 13
+
+typedef struct {
+ unsigned char *out;
+ const unsigned char *inp;
+ size_t len;
+ unsigned int interleave;
+} EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM;
+
+/* GCM TLS constants */
+/* Length of fixed part of IV derived from PRF */
+# define EVP_GCM_TLS_FIXED_IV_LEN 4
+/* Length of explicit part of IV part of TLS records */
+# define EVP_GCM_TLS_EXPLICIT_IV_LEN 8
+/* Length of tag for TLS */
+# define EVP_GCM_TLS_TAG_LEN 16
+
+typedef struct evp_cipher_info_st {
+ const EVP_CIPHER *cipher;
+ unsigned char iv[EVP_MAX_IV_LENGTH];
+} EVP_CIPHER_INFO;
+
+struct evp_cipher_ctx_st {
+ const EVP_CIPHER *cipher;
+ ENGINE *engine; /* functional reference if 'cipher' is
+ * ENGINE-provided */
+ int encrypt; /* encrypt or decrypt */
+ int buf_len; /* number we have left */
+ unsigned char oiv[EVP_MAX_IV_LENGTH]; /* original iv */
+ unsigned char iv[EVP_MAX_IV_LENGTH]; /* working iv */
+ unsigned char buf[EVP_MAX_BLOCK_LENGTH]; /* saved partial block */
+ int num; /* used by cfb/ofb/ctr mode */
+ void *app_data; /* application stuff */
+ int key_len; /* May change for variable length cipher */
+ unsigned long flags; /* Various flags */
+ void *cipher_data; /* per EVP data */
+ int final_used;
+ int block_mask;
+ unsigned char final[EVP_MAX_BLOCK_LENGTH]; /* possible final block */
+} /* EVP_CIPHER_CTX */ ;
+
+typedef struct evp_Encode_Ctx_st {
+ /* number saved in a partial encode/decode */
+ int num;
+ /*
+ * The length is either the output line length (in input bytes) or the
+ * shortest input line length that is ok. Once decoding begins, the
+ * length is adjusted up each time a longer line is decoded
+ */
+ int length;
+ /* data to encode */
+ unsigned char enc_data[80];
+ /* number read on current line */
+ int line_num;
+ int expect_nl;
+} EVP_ENCODE_CTX;
+
+/* Password based encryption function */
+typedef int (EVP_PBE_KEYGEN) (EVP_CIPHER_CTX *ctx, const char *pass,
+ int passlen, ASN1_TYPE *param,
+ const EVP_CIPHER *cipher, const EVP_MD *md,
+ int en_de);
+
+# ifndef OPENSSL_NO_RSA
+# define EVP_PKEY_assign_RSA(pkey,rsa) EVP_PKEY_assign((pkey),EVP_PKEY_RSA,\
+ (char *)(rsa))
+# endif
+
+# ifndef OPENSSL_NO_DSA
+# define EVP_PKEY_assign_DSA(pkey,dsa) EVP_PKEY_assign((pkey),EVP_PKEY_DSA,\
+ (char *)(dsa))
+# endif
+
+# ifndef OPENSSL_NO_DH
+# define EVP_PKEY_assign_DH(pkey,dh) EVP_PKEY_assign((pkey),EVP_PKEY_DH,\
+ (char *)(dh))
+# endif
+
+# ifndef OPENSSL_NO_EC
+# define EVP_PKEY_assign_EC_KEY(pkey,eckey) EVP_PKEY_assign((pkey),EVP_PKEY_EC,\
+ (char *)(eckey))
+# endif
+
+/* Add some extra combinations */
+# define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a))
+# define EVP_get_digestbyobj(a) EVP_get_digestbynid(OBJ_obj2nid(a))
+# define EVP_get_cipherbynid(a) EVP_get_cipherbyname(OBJ_nid2sn(a))
+# define EVP_get_cipherbyobj(a) EVP_get_cipherbynid(OBJ_obj2nid(a))
+
+int EVP_MD_type(const EVP_MD *md);
+# define EVP_MD_nid(e) EVP_MD_type(e)
+# define EVP_MD_name(e) OBJ_nid2sn(EVP_MD_nid(e))
+int EVP_MD_pkey_type(const EVP_MD *md);
+int EVP_MD_size(const EVP_MD *md);
+int EVP_MD_block_size(const EVP_MD *md);
+unsigned long EVP_MD_flags(const EVP_MD *md);
+
+const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx);
+# define EVP_MD_CTX_size(e) EVP_MD_size(EVP_MD_CTX_md(e))
+# define EVP_MD_CTX_block_size(e) EVP_MD_block_size(EVP_MD_CTX_md(e))
+# define EVP_MD_CTX_type(e) EVP_MD_type(EVP_MD_CTX_md(e))
+
+int EVP_CIPHER_nid(const EVP_CIPHER *cipher);
+# define EVP_CIPHER_name(e) OBJ_nid2sn(EVP_CIPHER_nid(e))
+int EVP_CIPHER_block_size(const EVP_CIPHER *cipher);
+int EVP_CIPHER_key_length(const EVP_CIPHER *cipher);
+int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher);
+unsigned long EVP_CIPHER_flags(const EVP_CIPHER *cipher);
+# define EVP_CIPHER_mode(e) (EVP_CIPHER_flags(e) & EVP_CIPH_MODE)
+
+const EVP_CIPHER *EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx);
+int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx);
+int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx);
+int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx);
+int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx);
+int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in);
+void *EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx);
+void EVP_CIPHER_CTX_set_app_data(EVP_CIPHER_CTX *ctx, void *data);
+# define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c))
+unsigned long EVP_CIPHER_CTX_flags(const EVP_CIPHER_CTX *ctx);
+# define EVP_CIPHER_CTX_mode(e) (EVP_CIPHER_CTX_flags(e) & EVP_CIPH_MODE)
+
+# define EVP_ENCODE_LENGTH(l) (((l+2)/3*4)+(l/48+1)*2+80)
+# define EVP_DECODE_LENGTH(l) ((l+3)/4*3+80)
+
+# define EVP_SignInit_ex(a,b,c) EVP_DigestInit_ex(a,b,c)
+# define EVP_SignInit(a,b) EVP_DigestInit(a,b)
+# define EVP_SignUpdate(a,b,c) EVP_DigestUpdate(a,b,c)
+# define EVP_VerifyInit_ex(a,b,c) EVP_DigestInit_ex(a,b,c)
+# define EVP_VerifyInit(a,b) EVP_DigestInit(a,b)
+# define EVP_VerifyUpdate(a,b,c) EVP_DigestUpdate(a,b,c)
+# define EVP_OpenUpdate(a,b,c,d,e) EVP_DecryptUpdate(a,b,c,d,e)
+# define EVP_SealUpdate(a,b,c,d,e) EVP_EncryptUpdate(a,b,c,d,e)
+# define EVP_DigestSignUpdate(a,b,c) EVP_DigestUpdate(a,b,c)
+# define EVP_DigestVerifyUpdate(a,b,c) EVP_DigestUpdate(a,b,c)
+
+# ifdef CONST_STRICT
+void BIO_set_md(BIO *, const EVP_MD *md);
+# else
+# define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,0,(char *)md)
+# endif
+# define BIO_get_md(b,mdp) BIO_ctrl(b,BIO_C_GET_MD,0,(char *)mdp)
+# define BIO_get_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_GET_MD_CTX,0,(char *)mdcp)
+# define BIO_set_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_SET_MD_CTX,0,(char *)mdcp)
+# define BIO_get_cipher_status(b) BIO_ctrl(b,BIO_C_GET_CIPHER_STATUS,0,NULL)
+# define BIO_get_cipher_ctx(b,c_pp) BIO_ctrl(b,BIO_C_GET_CIPHER_CTX,0,(char *)c_pp)
+
+int EVP_Cipher(EVP_CIPHER_CTX *c,
+ unsigned char *out, const unsigned char *in, unsigned int inl);
+
+# define EVP_add_cipher_alias(n,alias) \
+ OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
+# define EVP_add_digest_alias(n,alias) \
+ OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n))
+# define EVP_delete_cipher_alias(alias) \
+ OBJ_NAME_remove(alias,OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS);
+# define EVP_delete_digest_alias(alias) \
+ OBJ_NAME_remove(alias,OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS);
+
+void EVP_MD_CTX_init(EVP_MD_CTX *ctx);
+int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx);
+EVP_MD_CTX *EVP_MD_CTX_create(void);
+void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx);
+int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in);
+void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags);
+void EVP_MD_CTX_clear_flags(EVP_MD_CTX *ctx, int flags);
+int EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx, int flags);
+int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl);
+int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d, size_t cnt);
+int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s);
+int EVP_Digest(const void *data, size_t count,
+ unsigned char *md, unsigned int *size, const EVP_MD *type,
+ ENGINE *impl);
+
+int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in);
+int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type);
+int EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s);
+
+int EVP_read_pw_string(char *buf, int length, const char *prompt, int verify);
+int EVP_read_pw_string_min(char *buf, int minlen, int maxlen,
+ const char *prompt, int verify);
+void EVP_set_pw_prompt(const char *prompt);
+char *EVP_get_pw_prompt(void);
+
+int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md,
+ const unsigned char *salt, const unsigned char *data,
+ int datal, int count, unsigned char *key,
+ unsigned char *iv);
+
+void EVP_CIPHER_CTX_set_flags(EVP_CIPHER_CTX *ctx, int flags);
+void EVP_CIPHER_CTX_clear_flags(EVP_CIPHER_CTX *ctx, int flags);
+int EVP_CIPHER_CTX_test_flags(const EVP_CIPHER_CTX *ctx, int flags);
+
+int EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
+ const unsigned char *key, const unsigned char *iv);
+int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
+ ENGINE *impl, const unsigned char *key,
+ const unsigned char *iv);
+int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
+ const unsigned char *in, int inl);
+int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);
+int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);
+
+int EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
+ const unsigned char *key, const unsigned char *iv);
+int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
+ ENGINE *impl, const unsigned char *key,
+ const unsigned char *iv);
+int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
+ const unsigned char *in, int inl);
+int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);
+int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);
+
+int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
+ const unsigned char *key, const unsigned char *iv,
+ int enc);
+int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
+ ENGINE *impl, const unsigned char *key,
+ const unsigned char *iv, int enc);
+int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
+ const unsigned char *in, int inl);
+int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);
+int EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);
+
+int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s,
+ EVP_PKEY *pkey);
+
+int EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf,
+ unsigned int siglen, EVP_PKEY *pkey);
+
+int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
+ const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey);
+int EVP_DigestSignFinal(EVP_MD_CTX *ctx,
+ unsigned char *sigret, size_t *siglen);
+
+int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
+ const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey);
+int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx,
+ const unsigned char *sig, size_t siglen);
+
+int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
+ const unsigned char *ek, int ekl, const unsigned char *iv,
+ EVP_PKEY *priv);
+int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);
+
+int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
+ unsigned char **ek, int *ekl, unsigned char *iv,
+ EVP_PKEY **pubk, int npubk);
+int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);
+
+void EVP_EncodeInit(EVP_ENCODE_CTX *ctx);
+void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
+ const unsigned char *in, int inl);
+void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl);
+int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int n);
+
+void EVP_DecodeInit(EVP_ENCODE_CTX *ctx);
+int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
+ const unsigned char *in, int inl);
+int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned
+ char *out, int *outl);
+int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n);
+
+void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a);
+int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a);
+EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void);
+void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *a);
+int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen);
+int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *c, int pad);
+int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr);
+int EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key);
+
+# ifndef OPENSSL_NO_BIO
+BIO_METHOD *BIO_f_md(void);
+BIO_METHOD *BIO_f_base64(void);
+BIO_METHOD *BIO_f_cipher(void);
+BIO_METHOD *BIO_f_reliable(void);
+void BIO_set_cipher(BIO *b, const EVP_CIPHER *c, const unsigned char *k,
+ const unsigned char *i, int enc);
+# endif
+
+const EVP_MD *EVP_md_null(void);
+# ifndef OPENSSL_NO_MD2
+const EVP_MD *EVP_md2(void);
+# endif
+# ifndef OPENSSL_NO_MD4
+const EVP_MD *EVP_md4(void);
+# endif
+# ifndef OPENSSL_NO_MD5
+const EVP_MD *EVP_md5(void);
+# endif
+# ifndef OPENSSL_NO_SHA
+const EVP_MD *EVP_sha(void);
+const EVP_MD *EVP_sha1(void);
+const EVP_MD *EVP_dss(void);
+const EVP_MD *EVP_dss1(void);
+const EVP_MD *EVP_ecdsa(void);
+# endif
+# ifndef OPENSSL_NO_SHA256
+const EVP_MD *EVP_sha224(void);
+const EVP_MD *EVP_sha256(void);
+# endif
+# ifndef OPENSSL_NO_SHA512
+const EVP_MD *EVP_sha384(void);
+const EVP_MD *EVP_sha512(void);
+# endif
+# ifndef OPENSSL_NO_MDC2
+const EVP_MD *EVP_mdc2(void);
+# endif
+# ifndef OPENSSL_NO_RIPEMD
+const EVP_MD *EVP_ripemd160(void);
+# endif
+# ifndef OPENSSL_NO_WHIRLPOOL
+const EVP_MD *EVP_whirlpool(void);
+# endif
+const EVP_CIPHER *EVP_enc_null(void); /* does nothing :-) */
+# ifndef OPENSSL_NO_DES
+const EVP_CIPHER *EVP_des_ecb(void);
+const EVP_CIPHER *EVP_des_ede(void);
+const EVP_CIPHER *EVP_des_ede3(void);
+const EVP_CIPHER *EVP_des_ede_ecb(void);
+const EVP_CIPHER *EVP_des_ede3_ecb(void);
+const EVP_CIPHER *EVP_des_cfb64(void);
+# define EVP_des_cfb EVP_des_cfb64
+const EVP_CIPHER *EVP_des_cfb1(void);
+const EVP_CIPHER *EVP_des_cfb8(void);
+const EVP_CIPHER *EVP_des_ede_cfb64(void);
+# define EVP_des_ede_cfb EVP_des_ede_cfb64
+# if 0
+const EVP_CIPHER *EVP_des_ede_cfb1(void);
+const EVP_CIPHER *EVP_des_ede_cfb8(void);
+# endif
+const EVP_CIPHER *EVP_des_ede3_cfb64(void);
+# define EVP_des_ede3_cfb EVP_des_ede3_cfb64
+const EVP_CIPHER *EVP_des_ede3_cfb1(void);
+const EVP_CIPHER *EVP_des_ede3_cfb8(void);
+const EVP_CIPHER *EVP_des_ofb(void);
+const EVP_CIPHER *EVP_des_ede_ofb(void);
+const EVP_CIPHER *EVP_des_ede3_ofb(void);
+const EVP_CIPHER *EVP_des_cbc(void);
+const EVP_CIPHER *EVP_des_ede_cbc(void);
+const EVP_CIPHER *EVP_des_ede3_cbc(void);
+const EVP_CIPHER *EVP_desx_cbc(void);
+const EVP_CIPHER *EVP_des_ede3_wrap(void);
+/*
+ * This should now be supported through the dev_crypto ENGINE. But also, why
+ * are rc4 and md5 declarations made here inside a "NO_DES" precompiler
+ * branch?
+ */
+# if 0
+# ifdef OPENSSL_OPENBSD_DEV_CRYPTO
+const EVP_CIPHER *EVP_dev_crypto_des_ede3_cbc(void);
+const EVP_CIPHER *EVP_dev_crypto_rc4(void);
+const EVP_MD *EVP_dev_crypto_md5(void);
+# endif
+# endif
+# endif
+# ifndef OPENSSL_NO_RC4
+const EVP_CIPHER *EVP_rc4(void);
+const EVP_CIPHER *EVP_rc4_40(void);
+# ifndef OPENSSL_NO_MD5
+const EVP_CIPHER *EVP_rc4_hmac_md5(void);
+# endif
+# endif
+# ifndef OPENSSL_NO_IDEA
+const EVP_CIPHER *EVP_idea_ecb(void);
+const EVP_CIPHER *EVP_idea_cfb64(void);
+# define EVP_idea_cfb EVP_idea_cfb64
+const EVP_CIPHER *EVP_idea_ofb(void);
+const EVP_CIPHER *EVP_idea_cbc(void);
+# endif
+# ifndef OPENSSL_NO_RC2
+const EVP_CIPHER *EVP_rc2_ecb(void);
+const EVP_CIPHER *EVP_rc2_cbc(void);
+const EVP_CIPHER *EVP_rc2_40_cbc(void);
+const EVP_CIPHER *EVP_rc2_64_cbc(void);
+const EVP_CIPHER *EVP_rc2_cfb64(void);
+# define EVP_rc2_cfb EVP_rc2_cfb64
+const EVP_CIPHER *EVP_rc2_ofb(void);
+# endif
+# ifndef OPENSSL_NO_BF
+const EVP_CIPHER *EVP_bf_ecb(void);
+const EVP_CIPHER *EVP_bf_cbc(void);
+const EVP_CIPHER *EVP_bf_cfb64(void);
+# define EVP_bf_cfb EVP_bf_cfb64
+const EVP_CIPHER *EVP_bf_ofb(void);
+# endif
+# ifndef OPENSSL_NO_CAST
+const EVP_CIPHER *EVP_cast5_ecb(void);
+const EVP_CIPHER *EVP_cast5_cbc(void);
+const EVP_CIPHER *EVP_cast5_cfb64(void);
+# define EVP_cast5_cfb EVP_cast5_cfb64
+const EVP_CIPHER *EVP_cast5_ofb(void);
+# endif
+# ifndef OPENSSL_NO_RC5
+const EVP_CIPHER *EVP_rc5_32_12_16_cbc(void);
+const EVP_CIPHER *EVP_rc5_32_12_16_ecb(void);
+const EVP_CIPHER *EVP_rc5_32_12_16_cfb64(void);
+# define EVP_rc5_32_12_16_cfb EVP_rc5_32_12_16_cfb64
+const EVP_CIPHER *EVP_rc5_32_12_16_ofb(void);
+# endif
+# ifndef OPENSSL_NO_AES
+const EVP_CIPHER *EVP_aes_128_ecb(void);
+const EVP_CIPHER *EVP_aes_128_cbc(void);
+const EVP_CIPHER *EVP_aes_128_cfb1(void);
+const EVP_CIPHER *EVP_aes_128_cfb8(void);
+const EVP_CIPHER *EVP_aes_128_cfb128(void);
+# define EVP_aes_128_cfb EVP_aes_128_cfb128
+const EVP_CIPHER *EVP_aes_128_ofb(void);
+const EVP_CIPHER *EVP_aes_128_ctr(void);
+const EVP_CIPHER *EVP_aes_128_ccm(void);
+const EVP_CIPHER *EVP_aes_128_gcm(void);
+const EVP_CIPHER *EVP_aes_128_xts(void);
+const EVP_CIPHER *EVP_aes_128_wrap(void);
+const EVP_CIPHER *EVP_aes_192_ecb(void);
+const EVP_CIPHER *EVP_aes_192_cbc(void);
+const EVP_CIPHER *EVP_aes_192_cfb1(void);
+const EVP_CIPHER *EVP_aes_192_cfb8(void);
+const EVP_CIPHER *EVP_aes_192_cfb128(void);
+# define EVP_aes_192_cfb EVP_aes_192_cfb128
+const EVP_CIPHER *EVP_aes_192_ofb(void);
+const EVP_CIPHER *EVP_aes_192_ctr(void);
+const EVP_CIPHER *EVP_aes_192_ccm(void);
+const EVP_CIPHER *EVP_aes_192_gcm(void);
+const EVP_CIPHER *EVP_aes_192_wrap(void);
+const EVP_CIPHER *EVP_aes_256_ecb(void);
+const EVP_CIPHER *EVP_aes_256_cbc(void);
+const EVP_CIPHER *EVP_aes_256_cfb1(void);
+const EVP_CIPHER *EVP_aes_256_cfb8(void);
+const EVP_CIPHER *EVP_aes_256_cfb128(void);
+# define EVP_aes_256_cfb EVP_aes_256_cfb128
+const EVP_CIPHER *EVP_aes_256_ofb(void);
+const EVP_CIPHER *EVP_aes_256_ctr(void);
+const EVP_CIPHER *EVP_aes_256_ccm(void);
+const EVP_CIPHER *EVP_aes_256_gcm(void);
+const EVP_CIPHER *EVP_aes_256_xts(void);
+const EVP_CIPHER *EVP_aes_256_wrap(void);
+# if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1)
+const EVP_CIPHER *EVP_aes_128_cbc_hmac_sha1(void);
+const EVP_CIPHER *EVP_aes_256_cbc_hmac_sha1(void);
+# endif
+# ifndef OPENSSL_NO_SHA256
+const EVP_CIPHER *EVP_aes_128_cbc_hmac_sha256(void);
+const EVP_CIPHER *EVP_aes_256_cbc_hmac_sha256(void);
+# endif
+# endif
+# ifndef OPENSSL_NO_CAMELLIA
+const EVP_CIPHER *EVP_camellia_128_ecb(void);
+const EVP_CIPHER *EVP_camellia_128_cbc(void);
+const EVP_CIPHER *EVP_camellia_128_cfb1(void);
+const EVP_CIPHER *EVP_camellia_128_cfb8(void);
+const EVP_CIPHER *EVP_camellia_128_cfb128(void);
+# define EVP_camellia_128_cfb EVP_camellia_128_cfb128
+const EVP_CIPHER *EVP_camellia_128_ofb(void);
+const EVP_CIPHER *EVP_camellia_192_ecb(void);
+const EVP_CIPHER *EVP_camellia_192_cbc(void);
+const EVP_CIPHER *EVP_camellia_192_cfb1(void);
+const EVP_CIPHER *EVP_camellia_192_cfb8(void);
+const EVP_CIPHER *EVP_camellia_192_cfb128(void);
+# define EVP_camellia_192_cfb EVP_camellia_192_cfb128
+const EVP_CIPHER *EVP_camellia_192_ofb(void);
+const EVP_CIPHER *EVP_camellia_256_ecb(void);
+const EVP_CIPHER *EVP_camellia_256_cbc(void);
+const EVP_CIPHER *EVP_camellia_256_cfb1(void);
+const EVP_CIPHER *EVP_camellia_256_cfb8(void);
+const EVP_CIPHER *EVP_camellia_256_cfb128(void);
+# define EVP_camellia_256_cfb EVP_camellia_256_cfb128
+const EVP_CIPHER *EVP_camellia_256_ofb(void);
+# endif
+
+# ifndef OPENSSL_NO_SEED
+const EVP_CIPHER *EVP_seed_ecb(void);
+const EVP_CIPHER *EVP_seed_cbc(void);
+const EVP_CIPHER *EVP_seed_cfb128(void);
+# define EVP_seed_cfb EVP_seed_cfb128
+const EVP_CIPHER *EVP_seed_ofb(void);
+# endif
+
+void OPENSSL_add_all_algorithms_noconf(void);
+void OPENSSL_add_all_algorithms_conf(void);
+
+# ifdef OPENSSL_LOAD_CONF
+# define OpenSSL_add_all_algorithms() \
+ OPENSSL_add_all_algorithms_conf()
+# else
+# define OpenSSL_add_all_algorithms() \
+ OPENSSL_add_all_algorithms_noconf()
+# endif
+
+void OpenSSL_add_all_ciphers(void);
+void OpenSSL_add_all_digests(void);
+# define SSLeay_add_all_algorithms() OpenSSL_add_all_algorithms()
+# define SSLeay_add_all_ciphers() OpenSSL_add_all_ciphers()
+# define SSLeay_add_all_digests() OpenSSL_add_all_digests()
+
+int EVP_add_cipher(const EVP_CIPHER *cipher);
+int EVP_add_digest(const EVP_MD *digest);
+
+const EVP_CIPHER *EVP_get_cipherbyname(const char *name);
+const EVP_MD *EVP_get_digestbyname(const char *name);
+void EVP_cleanup(void);
+
+void EVP_CIPHER_do_all(void (*fn) (const EVP_CIPHER *ciph,
+ const char *from, const char *to, void *x),
+ void *arg);
+void EVP_CIPHER_do_all_sorted(void (*fn)
+ (const EVP_CIPHER *ciph, const char *from,
+ const char *to, void *x), void *arg);
+
+void EVP_MD_do_all(void (*fn) (const EVP_MD *ciph,
+ const char *from, const char *to, void *x),
+ void *arg);
+void EVP_MD_do_all_sorted(void (*fn)
+ (const EVP_MD *ciph, const char *from,
+ const char *to, void *x), void *arg);
+
+int EVP_PKEY_decrypt_old(unsigned char *dec_key,
+ const unsigned char *enc_key, int enc_key_len,
+ EVP_PKEY *private_key);
+int EVP_PKEY_encrypt_old(unsigned char *enc_key,
+ const unsigned char *key, int key_len,
+ EVP_PKEY *pub_key);
+int EVP_PKEY_type(int type);
+int EVP_PKEY_id(const EVP_PKEY *pkey);
+int EVP_PKEY_base_id(const EVP_PKEY *pkey);
+int EVP_PKEY_bits(EVP_PKEY *pkey);
+int EVP_PKEY_size(EVP_PKEY *pkey);
+int EVP_PKEY_set_type(EVP_PKEY *pkey, int type);
+int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len);
+int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key);
+void *EVP_PKEY_get0(EVP_PKEY *pkey);
+
+# ifndef OPENSSL_NO_RSA
+struct rsa_st;
+int EVP_PKEY_set1_RSA(EVP_PKEY *pkey, struct rsa_st *key);
+struct rsa_st *EVP_PKEY_get1_RSA(EVP_PKEY *pkey);
+# endif
+# ifndef OPENSSL_NO_DSA
+struct dsa_st;
+int EVP_PKEY_set1_DSA(EVP_PKEY *pkey, struct dsa_st *key);
+struct dsa_st *EVP_PKEY_get1_DSA(EVP_PKEY *pkey);
+# endif
+# ifndef OPENSSL_NO_DH
+struct dh_st;
+int EVP_PKEY_set1_DH(EVP_PKEY *pkey, struct dh_st *key);
+struct dh_st *EVP_PKEY_get1_DH(EVP_PKEY *pkey);
+# endif
+# ifndef OPENSSL_NO_EC
+struct ec_key_st;
+int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey, struct ec_key_st *key);
+struct ec_key_st *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey);
+# endif
+
+EVP_PKEY *EVP_PKEY_new(void);
+void EVP_PKEY_free(EVP_PKEY *pkey);
+
+EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp,
+ long length);
+int i2d_PublicKey(EVP_PKEY *a, unsigned char **pp);
+
+EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp,
+ long length);
+EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp,
+ long length);
+int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp);
+
+int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from);
+int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey);
+int EVP_PKEY_save_parameters(EVP_PKEY *pkey, int mode);
+int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b);
+
+int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b);
+
+int EVP_PKEY_print_public(BIO *out, const EVP_PKEY *pkey,
+ int indent, ASN1_PCTX *pctx);
+int EVP_PKEY_print_private(BIO *out, const EVP_PKEY *pkey,
+ int indent, ASN1_PCTX *pctx);
+int EVP_PKEY_print_params(BIO *out, const EVP_PKEY *pkey,
+ int indent, ASN1_PCTX *pctx);
+
+int EVP_PKEY_get_default_digest_nid(EVP_PKEY *pkey, int *pnid);
+
+int EVP_CIPHER_type(const EVP_CIPHER *ctx);
+
+/* calls methods */
+int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
+int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
+
+/* These are used by EVP_CIPHER methods */
+int EVP_CIPHER_set_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
+int EVP_CIPHER_get_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
+
+/* PKCS5 password based encryption */
+int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
+ ASN1_TYPE *param, const EVP_CIPHER *cipher,
+ const EVP_MD *md, int en_de);
+int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen,
+ const unsigned char *salt, int saltlen, int iter,
+ int keylen, unsigned char *out);
+int PKCS5_PBKDF2_HMAC(const char *pass, int passlen,
+ const unsigned char *salt, int saltlen, int iter,
+ const EVP_MD *digest, int keylen, unsigned char *out);
+int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
+ ASN1_TYPE *param, const EVP_CIPHER *cipher,
+ const EVP_MD *md, int en_de);
+
+void PKCS5_PBE_add(void);
+
+int EVP_PBE_CipherInit(ASN1_OBJECT *pbe_obj, const char *pass, int passlen,
+ ASN1_TYPE *param, EVP_CIPHER_CTX *ctx, int en_de);
+
+/* PBE type */
+
+/* Can appear as the outermost AlgorithmIdentifier */
+# define EVP_PBE_TYPE_OUTER 0x0
+/* Is an PRF type OID */
+# define EVP_PBE_TYPE_PRF 0x1
+
+int EVP_PBE_alg_add_type(int pbe_type, int pbe_nid, int cipher_nid,
+ int md_nid, EVP_PBE_KEYGEN *keygen);
+int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md,
+ EVP_PBE_KEYGEN *keygen);
+int EVP_PBE_find(int type, int pbe_nid, int *pcnid, int *pmnid,
+ EVP_PBE_KEYGEN **pkeygen);
+void EVP_PBE_cleanup(void);
+
+# define ASN1_PKEY_ALIAS 0x1
+# define ASN1_PKEY_DYNAMIC 0x2
+# define ASN1_PKEY_SIGPARAM_NULL 0x4
+
+# define ASN1_PKEY_CTRL_PKCS7_SIGN 0x1
+# define ASN1_PKEY_CTRL_PKCS7_ENCRYPT 0x2
+# define ASN1_PKEY_CTRL_DEFAULT_MD_NID 0x3
+# define ASN1_PKEY_CTRL_CMS_SIGN 0x5
+# define ASN1_PKEY_CTRL_CMS_ENVELOPE 0x7
+# define ASN1_PKEY_CTRL_CMS_RI_TYPE 0x8
+
+int EVP_PKEY_asn1_get_count(void);
+const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_get0(int idx);
+const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find(ENGINE **pe, int type);
+const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find_str(ENGINE **pe,
+ const char *str, int len);
+int EVP_PKEY_asn1_add0(const EVP_PKEY_ASN1_METHOD *ameth);
+int EVP_PKEY_asn1_add_alias(int to, int from);
+int EVP_PKEY_asn1_get0_info(int *ppkey_id, int *pkey_base_id,
+ int *ppkey_flags, const char **pinfo,
+ const char **ppem_str,
+ const EVP_PKEY_ASN1_METHOD *ameth);
+
+const EVP_PKEY_ASN1_METHOD *EVP_PKEY_get0_asn1(EVP_PKEY *pkey);
+EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_new(int id, int flags,
+ const char *pem_str,
+ const char *info);
+void EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst,
+ const EVP_PKEY_ASN1_METHOD *src);
+void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth);
+void EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth,
+ int (*pub_decode) (EVP_PKEY *pk,
+ X509_PUBKEY *pub),
+ int (*pub_encode) (X509_PUBKEY *pub,
+ const EVP_PKEY *pk),
+ int (*pub_cmp) (const EVP_PKEY *a,
+ const EVP_PKEY *b),
+ int (*pub_print) (BIO *out,
+ const EVP_PKEY *pkey,
+ int indent, ASN1_PCTX *pctx),
+ int (*pkey_size) (const EVP_PKEY *pk),
+ int (*pkey_bits) (const EVP_PKEY *pk));
+void EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth,
+ int (*priv_decode) (EVP_PKEY *pk,
+ PKCS8_PRIV_KEY_INFO
+ *p8inf),
+ int (*priv_encode) (PKCS8_PRIV_KEY_INFO *p8,
+ const EVP_PKEY *pk),
+ int (*priv_print) (BIO *out,
+ const EVP_PKEY *pkey,
+ int indent,
+ ASN1_PCTX *pctx));
+void EVP_PKEY_asn1_set_param(EVP_PKEY_ASN1_METHOD *ameth,
+ int (*param_decode) (EVP_PKEY *pkey,
+ const unsigned char **pder,
+ int derlen),
+ int (*param_encode) (const EVP_PKEY *pkey,
+ unsigned char **pder),
+ int (*param_missing) (const EVP_PKEY *pk),
+ int (*param_copy) (EVP_PKEY *to,
+ const EVP_PKEY *from),
+ int (*param_cmp) (const EVP_PKEY *a,
+ const EVP_PKEY *b),
+ int (*param_print) (BIO *out,
+ const EVP_PKEY *pkey,
+ int indent,
+ ASN1_PCTX *pctx));
+
+void EVP_PKEY_asn1_set_free(EVP_PKEY_ASN1_METHOD *ameth,
+ void (*pkey_free) (EVP_PKEY *pkey));
+void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth,
+ int (*pkey_ctrl) (EVP_PKEY *pkey, int op,
+ long arg1, void *arg2));
+void EVP_PKEY_asn1_set_item(EVP_PKEY_ASN1_METHOD *ameth,
+ int (*item_verify) (EVP_MD_CTX *ctx,
+ const ASN1_ITEM *it,
+ void *asn,
+ X509_ALGOR *a,
+ ASN1_BIT_STRING *sig,
+ EVP_PKEY *pkey),
+ int (*item_sign) (EVP_MD_CTX *ctx,
+ const ASN1_ITEM *it,
+ void *asn,
+ X509_ALGOR *alg1,
+ X509_ALGOR *alg2,
+ ASN1_BIT_STRING *sig));
+
+# define EVP_PKEY_OP_UNDEFINED 0
+# define EVP_PKEY_OP_PARAMGEN (1<<1)
+# define EVP_PKEY_OP_KEYGEN (1<<2)
+# define EVP_PKEY_OP_SIGN (1<<3)
+# define EVP_PKEY_OP_VERIFY (1<<4)
+# define EVP_PKEY_OP_VERIFYRECOVER (1<<5)
+# define EVP_PKEY_OP_SIGNCTX (1<<6)
+# define EVP_PKEY_OP_VERIFYCTX (1<<7)
+# define EVP_PKEY_OP_ENCRYPT (1<<8)
+# define EVP_PKEY_OP_DECRYPT (1<<9)
+# define EVP_PKEY_OP_DERIVE (1<<10)
+
+# define EVP_PKEY_OP_TYPE_SIG \
+ (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYRECOVER \
+ | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
+
+# define EVP_PKEY_OP_TYPE_CRYPT \
+ (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT)
+
+# define EVP_PKEY_OP_TYPE_NOGEN \
+ (EVP_PKEY_OP_SIG | EVP_PKEY_OP_CRYPT | EVP_PKEY_OP_DERIVE)
+
+# define EVP_PKEY_OP_TYPE_GEN \
+ (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
+
+# define EVP_PKEY_CTX_set_signature_md(ctx, md) \
+ EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_TYPE_SIG, \
+ EVP_PKEY_CTRL_MD, 0, (void *)md)
+
+# define EVP_PKEY_CTX_get_signature_md(ctx, pmd) \
+ EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_TYPE_SIG, \
+ EVP_PKEY_CTRL_GET_MD, 0, (void *)pmd)
+
+# define EVP_PKEY_CTRL_MD 1
+# define EVP_PKEY_CTRL_PEER_KEY 2
+
+# define EVP_PKEY_CTRL_PKCS7_ENCRYPT 3
+# define EVP_PKEY_CTRL_PKCS7_DECRYPT 4
+
+# define EVP_PKEY_CTRL_PKCS7_SIGN 5
+
+# define EVP_PKEY_CTRL_SET_MAC_KEY 6
+
+# define EVP_PKEY_CTRL_DIGESTINIT 7
+
+/* Used by GOST key encryption in TLS */
+# define EVP_PKEY_CTRL_SET_IV 8
+
+# define EVP_PKEY_CTRL_CMS_ENCRYPT 9
+# define EVP_PKEY_CTRL_CMS_DECRYPT 10
+# define EVP_PKEY_CTRL_CMS_SIGN 11
+
+# define EVP_PKEY_CTRL_CIPHER 12
+
+# define EVP_PKEY_CTRL_GET_MD 13
+
+# define EVP_PKEY_ALG_CTRL 0x1000
+
+# define EVP_PKEY_FLAG_AUTOARGLEN 2
+/*
+ * Method handles all operations: don't assume any digest related defaults.
+ */
+# define EVP_PKEY_FLAG_SIGCTX_CUSTOM 4
+
+const EVP_PKEY_METHOD *EVP_PKEY_meth_find(int type);
+EVP_PKEY_METHOD *EVP_PKEY_meth_new(int id, int flags);
+void EVP_PKEY_meth_get0_info(int *ppkey_id, int *pflags,
+ const EVP_PKEY_METHOD *meth);
+void EVP_PKEY_meth_copy(EVP_PKEY_METHOD *dst, const EVP_PKEY_METHOD *src);
+void EVP_PKEY_meth_free(EVP_PKEY_METHOD *pmeth);
+int EVP_PKEY_meth_add0(const EVP_PKEY_METHOD *pmeth);
+
+EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e);
+EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e);
+EVP_PKEY_CTX *EVP_PKEY_CTX_dup(EVP_PKEY_CTX *ctx);
+void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx);
+
+int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype,
+ int cmd, int p1, void *p2);
+int EVP_PKEY_CTX_ctrl_str(EVP_PKEY_CTX *ctx, const char *type,
+ const char *value);
+
+int EVP_PKEY_CTX_get_operation(EVP_PKEY_CTX *ctx);
+void EVP_PKEY_CTX_set0_keygen_info(EVP_PKEY_CTX *ctx, int *dat, int datlen);
+
+EVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e,
+ const unsigned char *key, int keylen);
+
+void EVP_PKEY_CTX_set_data(EVP_PKEY_CTX *ctx, void *data);
+void *EVP_PKEY_CTX_get_data(EVP_PKEY_CTX *ctx);
+EVP_PKEY *EVP_PKEY_CTX_get0_pkey(EVP_PKEY_CTX *ctx);
+
+EVP_PKEY *EVP_PKEY_CTX_get0_peerkey(EVP_PKEY_CTX *ctx);
+
+void EVP_PKEY_CTX_set_app_data(EVP_PKEY_CTX *ctx, void *data);
+void *EVP_PKEY_CTX_get_app_data(EVP_PKEY_CTX *ctx);
+
+int EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx);
+int EVP_PKEY_sign(EVP_PKEY_CTX *ctx,
+ unsigned char *sig, size_t *siglen,
+ const unsigned char *tbs, size_t tbslen);
+int EVP_PKEY_verify_init(EVP_PKEY_CTX *ctx);
+int EVP_PKEY_verify(EVP_PKEY_CTX *ctx,
+ const unsigned char *sig, size_t siglen,
+ const unsigned char *tbs, size_t tbslen);
+int EVP_PKEY_verify_recover_init(EVP_PKEY_CTX *ctx);
+int EVP_PKEY_verify_recover(EVP_PKEY_CTX *ctx,
+ unsigned char *rout, size_t *routlen,
+ const unsigned char *sig, size_t siglen);
+int EVP_PKEY_encrypt_init(EVP_PKEY_CTX *ctx);
+int EVP_PKEY_encrypt(EVP_PKEY_CTX *ctx,
+ unsigned char *out, size_t *outlen,
+ const unsigned char *in, size_t inlen);
+int EVP_PKEY_decrypt_init(EVP_PKEY_CTX *ctx);
+int EVP_PKEY_decrypt(EVP_PKEY_CTX *ctx,
+ unsigned char *out, size_t *outlen,
+ const unsigned char *in, size_t inlen);
+
+int EVP_PKEY_derive_init(EVP_PKEY_CTX *ctx);
+int EVP_PKEY_derive_set_peer(EVP_PKEY_CTX *ctx, EVP_PKEY *peer);
+int EVP_PKEY_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen);
+
+typedef int EVP_PKEY_gen_cb (EVP_PKEY_CTX *ctx);
+
+int EVP_PKEY_paramgen_init(EVP_PKEY_CTX *ctx);
+int EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey);
+int EVP_PKEY_keygen_init(EVP_PKEY_CTX *ctx);
+int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey);
+
+void EVP_PKEY_CTX_set_cb(EVP_PKEY_CTX *ctx, EVP_PKEY_gen_cb *cb);
+EVP_PKEY_gen_cb *EVP_PKEY_CTX_get_cb(EVP_PKEY_CTX *ctx);
+
+int EVP_PKEY_CTX_get_keygen_info(EVP_PKEY_CTX *ctx, int idx);
+
+void EVP_PKEY_meth_set_init(EVP_PKEY_METHOD *pmeth,
+ int (*init) (EVP_PKEY_CTX *ctx));
+
+void EVP_PKEY_meth_set_copy(EVP_PKEY_METHOD *pmeth,
+ int (*copy) (EVP_PKEY_CTX *dst,
+ EVP_PKEY_CTX *src));
+
+void EVP_PKEY_meth_set_cleanup(EVP_PKEY_METHOD *pmeth,
+ void (*cleanup) (EVP_PKEY_CTX *ctx));
+
+void EVP_PKEY_meth_set_paramgen(EVP_PKEY_METHOD *pmeth,
+ int (*paramgen_init) (EVP_PKEY_CTX *ctx),
+ int (*paramgen) (EVP_PKEY_CTX *ctx,
+ EVP_PKEY *pkey));
+
+void EVP_PKEY_meth_set_keygen(EVP_PKEY_METHOD *pmeth,
+ int (*keygen_init) (EVP_PKEY_CTX *ctx),
+ int (*keygen) (EVP_PKEY_CTX *ctx,
+ EVP_PKEY *pkey));
+
+void EVP_PKEY_meth_set_sign(EVP_PKEY_METHOD *pmeth,
+ int (*sign_init) (EVP_PKEY_CTX *ctx),
+ int (*sign) (EVP_PKEY_CTX *ctx,
+ unsigned char *sig, size_t *siglen,
+ const unsigned char *tbs,
+ size_t tbslen));
+
+void EVP_PKEY_meth_set_verify(EVP_PKEY_METHOD *pmeth,
+ int (*verify_init) (EVP_PKEY_CTX *ctx),
+ int (*verify) (EVP_PKEY_CTX *ctx,
+ const unsigned char *sig,
+ size_t siglen,
+ const unsigned char *tbs,
+ size_t tbslen));
+
+void EVP_PKEY_meth_set_verify_recover(EVP_PKEY_METHOD *pmeth,
+ int (*verify_recover_init) (EVP_PKEY_CTX
+ *ctx),
+ int (*verify_recover) (EVP_PKEY_CTX
+ *ctx,
+ unsigned char
+ *sig,
+ size_t *siglen,
+ const unsigned
+ char *tbs,
+ size_t tbslen));
+
+void EVP_PKEY_meth_set_signctx(EVP_PKEY_METHOD *pmeth,
+ int (*signctx_init) (EVP_PKEY_CTX *ctx,
+ EVP_MD_CTX *mctx),
+ int (*signctx) (EVP_PKEY_CTX *ctx,
+ unsigned char *sig,
+ size_t *siglen,
+ EVP_MD_CTX *mctx));
+
+void EVP_PKEY_meth_set_verifyctx(EVP_PKEY_METHOD *pmeth,
+ int (*verifyctx_init) (EVP_PKEY_CTX *ctx,
+ EVP_MD_CTX *mctx),
+ int (*verifyctx) (EVP_PKEY_CTX *ctx,
+ const unsigned char *sig,
+ int siglen,
+ EVP_MD_CTX *mctx));
+
+void EVP_PKEY_meth_set_encrypt(EVP_PKEY_METHOD *pmeth,
+ int (*encrypt_init) (EVP_PKEY_CTX *ctx),
+ int (*encryptfn) (EVP_PKEY_CTX *ctx,
+ unsigned char *out,
+ size_t *outlen,
+ const unsigned char *in,
+ size_t inlen));
+
+void EVP_PKEY_meth_set_decrypt(EVP_PKEY_METHOD *pmeth,
+ int (*decrypt_init) (EVP_PKEY_CTX *ctx),
+ int (*decrypt) (EVP_PKEY_CTX *ctx,
+ unsigned char *out,
+ size_t *outlen,
+ const unsigned char *in,
+ size_t inlen));
+
+void EVP_PKEY_meth_set_derive(EVP_PKEY_METHOD *pmeth,
+ int (*derive_init) (EVP_PKEY_CTX *ctx),
+ int (*derive) (EVP_PKEY_CTX *ctx,
+ unsigned char *key,
+ size_t *keylen));
+
+void EVP_PKEY_meth_set_ctrl(EVP_PKEY_METHOD *pmeth,
+ int (*ctrl) (EVP_PKEY_CTX *ctx, int type, int p1,
+ void *p2),
+ int (*ctrl_str) (EVP_PKEY_CTX *ctx,
+ const char *type,
+ const char *value));
+
+void EVP_add_alg_module(void);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_EVP_strings(void);
+
+/* Error codes for the EVP functions. */
+
+/* Function codes. */
+# define EVP_F_AESNI_INIT_KEY 165
+# define EVP_F_AESNI_XTS_CIPHER 176
+# define EVP_F_AES_INIT_KEY 133
+# define EVP_F_AES_T4_INIT_KEY 178
+# define EVP_F_AES_XTS 172
+# define EVP_F_AES_XTS_CIPHER 175
+# define EVP_F_ALG_MODULE_INIT 177
+# define EVP_F_CAMELLIA_INIT_KEY 159
+# define EVP_F_CMAC_INIT 173
+# define EVP_F_CMLL_T4_INIT_KEY 179
+# define EVP_F_D2I_PKEY 100
+# define EVP_F_DO_SIGVER_INIT 161
+# define EVP_F_DSAPKEY2PKCS8 134
+# define EVP_F_DSA_PKEY2PKCS8 135
+# define EVP_F_ECDSA_PKEY2PKCS8 129
+# define EVP_F_ECKEY_PKEY2PKCS8 132
+# define EVP_F_EVP_CIPHERINIT_EX 123
+# define EVP_F_EVP_CIPHER_CTX_COPY 163
+# define EVP_F_EVP_CIPHER_CTX_CTRL 124
+# define EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH 122
+# define EVP_F_EVP_DECRYPTFINAL_EX 101
+# define EVP_F_EVP_DIGESTINIT_EX 128
+# define EVP_F_EVP_ENCRYPTFINAL_EX 127
+# define EVP_F_EVP_MD_CTX_COPY_EX 110
+# define EVP_F_EVP_MD_SIZE 162
+# define EVP_F_EVP_OPENINIT 102
+# define EVP_F_EVP_PBE_ALG_ADD 115
+# define EVP_F_EVP_PBE_ALG_ADD_TYPE 160
+# define EVP_F_EVP_PBE_CIPHERINIT 116
+# define EVP_F_EVP_PKCS82PKEY 111
+# define EVP_F_EVP_PKCS82PKEY_BROKEN 136
+# define EVP_F_EVP_PKEY2PKCS8_BROKEN 113
+# define EVP_F_EVP_PKEY_COPY_PARAMETERS 103
+# define EVP_F_EVP_PKEY_CTX_CTRL 137
+# define EVP_F_EVP_PKEY_CTX_CTRL_STR 150
+# define EVP_F_EVP_PKEY_CTX_DUP 156
+# define EVP_F_EVP_PKEY_DECRYPT 104
+# define EVP_F_EVP_PKEY_DECRYPT_INIT 138
+# define EVP_F_EVP_PKEY_DECRYPT_OLD 151
+# define EVP_F_EVP_PKEY_DERIVE 153
+# define EVP_F_EVP_PKEY_DERIVE_INIT 154
+# define EVP_F_EVP_PKEY_DERIVE_SET_PEER 155
+# define EVP_F_EVP_PKEY_ENCRYPT 105
+# define EVP_F_EVP_PKEY_ENCRYPT_INIT 139
+# define EVP_F_EVP_PKEY_ENCRYPT_OLD 152
+# define EVP_F_EVP_PKEY_GET1_DH 119
+# define EVP_F_EVP_PKEY_GET1_DSA 120
+# define EVP_F_EVP_PKEY_GET1_ECDSA 130
+# define EVP_F_EVP_PKEY_GET1_EC_KEY 131
+# define EVP_F_EVP_PKEY_GET1_RSA 121
+# define EVP_F_EVP_PKEY_KEYGEN 146
+# define EVP_F_EVP_PKEY_KEYGEN_INIT 147
+# define EVP_F_EVP_PKEY_NEW 106
+# define EVP_F_EVP_PKEY_PARAMGEN 148
+# define EVP_F_EVP_PKEY_PARAMGEN_INIT 149
+# define EVP_F_EVP_PKEY_SIGN 140
+# define EVP_F_EVP_PKEY_SIGN_INIT 141
+# define EVP_F_EVP_PKEY_VERIFY 142
+# define EVP_F_EVP_PKEY_VERIFY_INIT 143
+# define EVP_F_EVP_PKEY_VERIFY_RECOVER 144
+# define EVP_F_EVP_PKEY_VERIFY_RECOVER_INIT 145
+# define EVP_F_EVP_RIJNDAEL 126
+# define EVP_F_EVP_SIGNFINAL 107
+# define EVP_F_EVP_VERIFYFINAL 108
+# define EVP_F_FIPS_CIPHERINIT 166
+# define EVP_F_FIPS_CIPHER_CTX_COPY 170
+# define EVP_F_FIPS_CIPHER_CTX_CTRL 167
+# define EVP_F_FIPS_CIPHER_CTX_SET_KEY_LENGTH 171
+# define EVP_F_FIPS_DIGESTINIT 168
+# define EVP_F_FIPS_MD_CTX_COPY 169
+# define EVP_F_HMAC_INIT_EX 174
+# define EVP_F_INT_CTX_NEW 157
+# define EVP_F_PKCS5_PBE_KEYIVGEN 117
+# define EVP_F_PKCS5_V2_PBE_KEYIVGEN 118
+# define EVP_F_PKCS5_V2_PBKDF2_KEYIVGEN 164
+# define EVP_F_PKCS8_SET_BROKEN 112
+# define EVP_F_PKEY_SET_TYPE 158
+# define EVP_F_RC2_MAGIC_TO_METH 109
+# define EVP_F_RC5_CTRL 125
+
+/* Reason codes. */
+# define EVP_R_AES_IV_SETUP_FAILED 162
+# define EVP_R_AES_KEY_SETUP_FAILED 143
+# define EVP_R_ASN1_LIB 140
+# define EVP_R_BAD_BLOCK_LENGTH 136
+# define EVP_R_BAD_DECRYPT 100
+# define EVP_R_BAD_KEY_LENGTH 137
+# define EVP_R_BN_DECODE_ERROR 112
+# define EVP_R_BN_PUBKEY_ERROR 113
+# define EVP_R_BUFFER_TOO_SMALL 155
+# define EVP_R_CAMELLIA_KEY_SETUP_FAILED 157
+# define EVP_R_CIPHER_PARAMETER_ERROR 122
+# define EVP_R_COMMAND_NOT_SUPPORTED 147
+# define EVP_R_CTRL_NOT_IMPLEMENTED 132
+# define EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED 133
+# define EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH 138
+# define EVP_R_DECODE_ERROR 114
+# define EVP_R_DIFFERENT_KEY_TYPES 101
+# define EVP_R_DIFFERENT_PARAMETERS 153
+# define EVP_R_DISABLED_FOR_FIPS 163
+# define EVP_R_ENCODE_ERROR 115
+# define EVP_R_ERROR_LOADING_SECTION 165
+# define EVP_R_ERROR_SETTING_FIPS_MODE 166
+# define EVP_R_EVP_PBE_CIPHERINIT_ERROR 119
+# define EVP_R_EXPECTING_AN_RSA_KEY 127
+# define EVP_R_EXPECTING_A_DH_KEY 128
+# define EVP_R_EXPECTING_A_DSA_KEY 129
+# define EVP_R_EXPECTING_A_ECDSA_KEY 141
+# define EVP_R_EXPECTING_A_EC_KEY 142
+# define EVP_R_FIPS_MODE_NOT_SUPPORTED 167
+# define EVP_R_INITIALIZATION_ERROR 134
+# define EVP_R_INPUT_NOT_INITIALIZED 111
+# define EVP_R_INVALID_DIGEST 152
+# define EVP_R_INVALID_FIPS_MODE 168
+# define EVP_R_INVALID_KEY_LENGTH 130
+# define EVP_R_INVALID_OPERATION 148
+# define EVP_R_IV_TOO_LARGE 102
+# define EVP_R_KEYGEN_FAILURE 120
+# define EVP_R_MESSAGE_DIGEST_IS_NULL 159
+# define EVP_R_METHOD_NOT_SUPPORTED 144
+# define EVP_R_MISSING_PARAMETERS 103
+# define EVP_R_NO_CIPHER_SET 131
+# define EVP_R_NO_DEFAULT_DIGEST 158
+# define EVP_R_NO_DIGEST_SET 139
+# define EVP_R_NO_DSA_PARAMETERS 116
+# define EVP_R_NO_KEY_SET 154
+# define EVP_R_NO_OPERATION_SET 149
+# define EVP_R_NO_SIGN_FUNCTION_CONFIGURED 104
+# define EVP_R_NO_VERIFY_FUNCTION_CONFIGURED 105
+# define EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 150
+# define EVP_R_OPERATON_NOT_INITIALIZED 151
+# define EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE 117
+# define EVP_R_PRIVATE_KEY_DECODE_ERROR 145
+# define EVP_R_PRIVATE_KEY_ENCODE_ERROR 146
+# define EVP_R_PUBLIC_KEY_NOT_RSA 106
+# define EVP_R_TOO_LARGE 164
+# define EVP_R_UNKNOWN_CIPHER 160
+# define EVP_R_UNKNOWN_DIGEST 161
+# define EVP_R_UNKNOWN_OPTION 169
+# define EVP_R_UNKNOWN_PBE_ALGORITHM 121
+# define EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS 135
+# define EVP_R_UNSUPPORTED_ALGORITHM 156
+# define EVP_R_UNSUPPORTED_CIPHER 107
+# define EVP_R_UNSUPPORTED_KEYLENGTH 123
+# define EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION 124
+# define EVP_R_UNSUPPORTED_KEY_SIZE 108
+# define EVP_R_UNSUPPORTED_PRF 125
+# define EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM 118
+# define EVP_R_UNSUPPORTED_SALT_TYPE 126
+# define EVP_R_WRAP_MODE_NOT_ALLOWED 170
+# define EVP_R_WRONG_FINAL_BLOCK_LENGTH 109
+# define EVP_R_WRONG_PUBLIC_KEY_TYPE 110
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/hmac.h b/protocols/Telegram/tgl/openssl/include/openssl/hmac.h
new file mode 100644
index 0000000000..b8b55cda7d
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/hmac.h
@@ -0,0 +1,109 @@
+/* crypto/hmac/hmac.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+#ifndef HEADER_HMAC_H
+# define HEADER_HMAC_H
+
+# include <openssl/opensslconf.h>
+
+# ifdef OPENSSL_NO_HMAC
+# error HMAC is disabled.
+# endif
+
+# include <openssl/evp.h>
+
+# define HMAC_MAX_MD_CBLOCK 128/* largest known is SHA512 */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct hmac_ctx_st {
+ const EVP_MD *md;
+ EVP_MD_CTX md_ctx;
+ EVP_MD_CTX i_ctx;
+ EVP_MD_CTX o_ctx;
+ unsigned int key_length;
+ unsigned char key[HMAC_MAX_MD_CBLOCK];
+} HMAC_CTX;
+
+# define HMAC_size(e) (EVP_MD_size((e)->md))
+
+void HMAC_CTX_init(HMAC_CTX *ctx);
+void HMAC_CTX_cleanup(HMAC_CTX *ctx);
+
+/* deprecated */
+# define HMAC_cleanup(ctx) HMAC_CTX_cleanup(ctx)
+
+/* deprecated */
+int HMAC_Init(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md);
+int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
+ const EVP_MD *md, ENGINE *impl);
+int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len);
+int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len);
+unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
+ const unsigned char *d, size_t n, unsigned char *md,
+ unsigned int *md_len);
+int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx);
+
+void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/idea.h b/protocols/Telegram/tgl/openssl/include/openssl/idea.h
new file mode 100644
index 0000000000..6075984039
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/idea.h
@@ -0,0 +1,105 @@
+/* crypto/idea/idea.h */
+/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_IDEA_H
+# define HEADER_IDEA_H
+
+# include <openssl/opensslconf.h>/* IDEA_INT, OPENSSL_NO_IDEA */
+
+# ifdef OPENSSL_NO_IDEA
+# error IDEA is disabled.
+# endif
+
+# define IDEA_ENCRYPT 1
+# define IDEA_DECRYPT 0
+
+# define IDEA_BLOCK 8
+# define IDEA_KEY_LENGTH 16
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct idea_key_st {
+ IDEA_INT data[9][6];
+} IDEA_KEY_SCHEDULE;
+
+const char *idea_options(void);
+void idea_ecb_encrypt(const unsigned char *in, unsigned char *out,
+ IDEA_KEY_SCHEDULE *ks);
+# ifdef OPENSSL_FIPS
+void private_idea_set_encrypt_key(const unsigned char *key,
+ IDEA_KEY_SCHEDULE *ks);
+# endif
+void idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks);
+void idea_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk);
+void idea_cbc_encrypt(const unsigned char *in, unsigned char *out,
+ long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,
+ int enc);
+void idea_cfb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,
+ int *num, int enc);
+void idea_ofb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,
+ int *num);
+void idea_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks);
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/krb5_asn.h b/protocols/Telegram/tgl/openssl/include/openssl/krb5_asn.h
new file mode 100644
index 0000000000..9cf5a26dd8
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/krb5_asn.h
@@ -0,0 +1,240 @@
+/* krb5_asn.h */
+/*
+ * Written by Vern Staats <staatsvr@asc.hpc.mil> for the OpenSSL project, **
+ * using ocsp/{*.h,*asn*.c} as a starting point
+ */
+
+/* ====================================================================
+ * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_KRB5_ASN_H
+# define HEADER_KRB5_ASN_H
+
+/*
+ * #include <krb5.h>
+ */
+# include <openssl/safestack.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * ASN.1 from Kerberos RFC 1510
+ */
+
+/*- EncryptedData ::= SEQUENCE {
+ * etype[0] INTEGER, -- EncryptionType
+ * kvno[1] INTEGER OPTIONAL,
+ * cipher[2] OCTET STRING -- ciphertext
+ * }
+ */
+typedef struct krb5_encdata_st {
+ ASN1_INTEGER *etype;
+ ASN1_INTEGER *kvno;
+ ASN1_OCTET_STRING *cipher;
+} KRB5_ENCDATA;
+
+DECLARE_STACK_OF(KRB5_ENCDATA)
+
+/*- PrincipalName ::= SEQUENCE {
+ * name-type[0] INTEGER,
+ * name-string[1] SEQUENCE OF GeneralString
+ * }
+ */
+typedef struct krb5_princname_st {
+ ASN1_INTEGER *nametype;
+ STACK_OF(ASN1_GENERALSTRING) *namestring;
+} KRB5_PRINCNAME;
+
+DECLARE_STACK_OF(KRB5_PRINCNAME)
+
+/*- Ticket ::= [APPLICATION 1] SEQUENCE {
+ * tkt-vno[0] INTEGER,
+ * realm[1] Realm,
+ * sname[2] PrincipalName,
+ * enc-part[3] EncryptedData
+ * }
+ */
+typedef struct krb5_tktbody_st {
+ ASN1_INTEGER *tktvno;
+ ASN1_GENERALSTRING *realm;
+ KRB5_PRINCNAME *sname;
+ KRB5_ENCDATA *encdata;
+} KRB5_TKTBODY;
+
+typedef STACK_OF(KRB5_TKTBODY) KRB5_TICKET;
+DECLARE_STACK_OF(KRB5_TKTBODY)
+
+/*- AP-REQ ::= [APPLICATION 14] SEQUENCE {
+ * pvno[0] INTEGER,
+ * msg-type[1] INTEGER,
+ * ap-options[2] APOptions,
+ * ticket[3] Ticket,
+ * authenticator[4] EncryptedData
+ * }
+ *
+ * APOptions ::= BIT STRING {
+ * reserved(0), use-session-key(1), mutual-required(2) }
+ */
+typedef struct krb5_ap_req_st {
+ ASN1_INTEGER *pvno;
+ ASN1_INTEGER *msgtype;
+ ASN1_BIT_STRING *apoptions;
+ KRB5_TICKET *ticket;
+ KRB5_ENCDATA *authenticator;
+} KRB5_APREQBODY;
+
+typedef STACK_OF(KRB5_APREQBODY) KRB5_APREQ;
+DECLARE_STACK_OF(KRB5_APREQBODY)
+
+/* Authenticator Stuff */
+
+/*- Checksum ::= SEQUENCE {
+ * cksumtype[0] INTEGER,
+ * checksum[1] OCTET STRING
+ * }
+ */
+typedef struct krb5_checksum_st {
+ ASN1_INTEGER *ctype;
+ ASN1_OCTET_STRING *checksum;
+} KRB5_CHECKSUM;
+
+DECLARE_STACK_OF(KRB5_CHECKSUM)
+
+/*- EncryptionKey ::= SEQUENCE {
+ * keytype[0] INTEGER,
+ * keyvalue[1] OCTET STRING
+ * }
+ */
+typedef struct krb5_encryptionkey_st {
+ ASN1_INTEGER *ktype;
+ ASN1_OCTET_STRING *keyvalue;
+} KRB5_ENCKEY;
+
+DECLARE_STACK_OF(KRB5_ENCKEY)
+
+/*- AuthorizationData ::= SEQUENCE OF SEQUENCE {
+ * ad-type[0] INTEGER,
+ * ad-data[1] OCTET STRING
+ * }
+ */
+typedef struct krb5_authorization_st {
+ ASN1_INTEGER *adtype;
+ ASN1_OCTET_STRING *addata;
+} KRB5_AUTHDATA;
+
+DECLARE_STACK_OF(KRB5_AUTHDATA)
+
+/*- -- Unencrypted authenticator
+ * Authenticator ::= [APPLICATION 2] SEQUENCE {
+ * authenticator-vno[0] INTEGER,
+ * crealm[1] Realm,
+ * cname[2] PrincipalName,
+ * cksum[3] Checksum OPTIONAL,
+ * cusec[4] INTEGER,
+ * ctime[5] KerberosTime,
+ * subkey[6] EncryptionKey OPTIONAL,
+ * seq-number[7] INTEGER OPTIONAL,
+ * authorization-data[8] AuthorizationData OPTIONAL
+ * }
+ */
+typedef struct krb5_authenticator_st {
+ ASN1_INTEGER *avno;
+ ASN1_GENERALSTRING *crealm;
+ KRB5_PRINCNAME *cname;
+ KRB5_CHECKSUM *cksum;
+ ASN1_INTEGER *cusec;
+ ASN1_GENERALIZEDTIME *ctime;
+ KRB5_ENCKEY *subkey;
+ ASN1_INTEGER *seqnum;
+ KRB5_AUTHDATA *authorization;
+} KRB5_AUTHENTBODY;
+
+typedef STACK_OF(KRB5_AUTHENTBODY) KRB5_AUTHENT;
+DECLARE_STACK_OF(KRB5_AUTHENTBODY)
+
+/*- DECLARE_ASN1_FUNCTIONS(type) = DECLARE_ASN1_FUNCTIONS_name(type, type) =
+ * type *name##_new(void);
+ * void name##_free(type *a);
+ * DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name) =
+ * DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) =
+ * type *d2i_##name(type **a, const unsigned char **in, long len);
+ * int i2d_##name(type *a, unsigned char **out);
+ * DECLARE_ASN1_ITEM(itname) = OPENSSL_EXTERN const ASN1_ITEM itname##_it
+ */
+
+DECLARE_ASN1_FUNCTIONS(KRB5_ENCDATA)
+DECLARE_ASN1_FUNCTIONS(KRB5_PRINCNAME)
+DECLARE_ASN1_FUNCTIONS(KRB5_TKTBODY)
+DECLARE_ASN1_FUNCTIONS(KRB5_APREQBODY)
+DECLARE_ASN1_FUNCTIONS(KRB5_TICKET)
+DECLARE_ASN1_FUNCTIONS(KRB5_APREQ)
+
+DECLARE_ASN1_FUNCTIONS(KRB5_CHECKSUM)
+DECLARE_ASN1_FUNCTIONS(KRB5_ENCKEY)
+DECLARE_ASN1_FUNCTIONS(KRB5_AUTHDATA)
+DECLARE_ASN1_FUNCTIONS(KRB5_AUTHENTBODY)
+DECLARE_ASN1_FUNCTIONS(KRB5_AUTHENT)
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/kssl.h b/protocols/Telegram/tgl/openssl/include/openssl/kssl.h
new file mode 100644
index 0000000000..9a57672801
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/kssl.h
@@ -0,0 +1,197 @@
+/* ssl/kssl.h -*- mode: C; c-file-style: "eay" -*- */
+/*
+ * Written by Vern Staats <staatsvr@asc.hpc.mil> for the OpenSSL project
+ * 2000. project 2000.
+ */
+/* ====================================================================
+ * Copyright (c) 2000 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+/*
+ ** 19990701 VRS Started.
+ */
+
+#ifndef KSSL_H
+# define KSSL_H
+
+# include <openssl/opensslconf.h>
+
+# ifndef OPENSSL_NO_KRB5
+
+# include <stdio.h>
+# include <ctype.h>
+# include <krb5.h>
+# ifdef OPENSSL_SYS_WIN32
+/*
+ * These can sometimes get redefined indirectly by krb5 header files after
+ * they get undefed in ossl_typ.h
+ */
+# undef X509_NAME
+# undef X509_EXTENSIONS
+# undef OCSP_REQUEST
+# undef OCSP_RESPONSE
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Depending on which KRB5 implementation used, some types from
+ * the other may be missing. Resolve that here and now
+ */
+# ifdef KRB5_HEIMDAL
+typedef unsigned char krb5_octet;
+# define FAR
+# else
+
+# ifndef FAR
+# define FAR
+# endif
+
+# endif
+
+/*-
+ * Uncomment this to debug kssl problems or
+ * to trace usage of the Kerberos session key
+ *
+ * #define KSSL_DEBUG
+ */
+
+# ifndef KRB5SVC
+# define KRB5SVC "host"
+# endif
+
+# ifndef KRB5KEYTAB
+# define KRB5KEYTAB "/etc/krb5.keytab"
+# endif
+
+# ifndef KRB5SENDAUTH
+# define KRB5SENDAUTH 1
+# endif
+
+# ifndef KRB5CHECKAUTH
+# define KRB5CHECKAUTH 1
+# endif
+
+# ifndef KSSL_CLOCKSKEW
+# define KSSL_CLOCKSKEW 300;
+# endif
+
+# define KSSL_ERR_MAX 255
+typedef struct kssl_err_st {
+ int reason;
+ char text[KSSL_ERR_MAX + 1];
+} KSSL_ERR;
+
+/*- Context for passing
+ * (1) Kerberos session key to SSL, and
+ * (2) Config data between application and SSL lib
+ */
+typedef struct kssl_ctx_st {
+ /* used by: disposition: */
+ char *service_name; /* C,S default ok (kssl) */
+ char *service_host; /* C input, REQUIRED */
+ char *client_princ; /* S output from krb5 ticket */
+ char *keytab_file; /* S NULL (/etc/krb5.keytab) */
+ char *cred_cache; /* C NULL (default) */
+ krb5_enctype enctype;
+ int length;
+ krb5_octet FAR *key;
+} KSSL_CTX;
+
+# define KSSL_CLIENT 1
+# define KSSL_SERVER 2
+# define KSSL_SERVICE 3
+# define KSSL_KEYTAB 4
+
+# define KSSL_CTX_OK 0
+# define KSSL_CTX_ERR 1
+# define KSSL_NOMEM 2
+
+/* Public (for use by applications that use OpenSSL with Kerberos 5 support */
+krb5_error_code kssl_ctx_setstring(KSSL_CTX *kssl_ctx, int which, char *text);
+KSSL_CTX *kssl_ctx_new(void);
+KSSL_CTX *kssl_ctx_free(KSSL_CTX *kssl_ctx);
+void kssl_ctx_show(KSSL_CTX *kssl_ctx);
+krb5_error_code kssl_ctx_setprinc(KSSL_CTX *kssl_ctx, int which,
+ krb5_data *realm, krb5_data *entity,
+ int nentities);
+krb5_error_code kssl_cget_tkt(KSSL_CTX *kssl_ctx, krb5_data **enc_tktp,
+ krb5_data *authenp, KSSL_ERR *kssl_err);
+krb5_error_code kssl_sget_tkt(KSSL_CTX *kssl_ctx, krb5_data *indata,
+ krb5_ticket_times *ttimes, KSSL_ERR *kssl_err);
+krb5_error_code kssl_ctx_setkey(KSSL_CTX *kssl_ctx, krb5_keyblock *session);
+void kssl_err_set(KSSL_ERR *kssl_err, int reason, char *text);
+void kssl_krb5_free_data_contents(krb5_context context, krb5_data *data);
+krb5_error_code kssl_build_principal_2(krb5_context context,
+ krb5_principal *princ, int rlen,
+ const char *realm, int slen,
+ const char *svc, int hlen,
+ const char *host);
+krb5_error_code kssl_validate_times(krb5_timestamp atime,
+ krb5_ticket_times *ttimes);
+krb5_error_code kssl_check_authent(KSSL_CTX *kssl_ctx, krb5_data *authentp,
+ krb5_timestamp *atimep,
+ KSSL_ERR *kssl_err);
+unsigned char *kssl_skip_confound(krb5_enctype enctype, unsigned char *authn);
+
+void SSL_set0_kssl_ctx(SSL *s, KSSL_CTX *kctx);
+KSSL_CTX *SSL_get0_kssl_ctx(SSL *s);
+char *kssl_ctx_get0_client_princ(KSSL_CTX *kctx);
+
+#ifdef __cplusplus
+}
+#endif
+# endif /* OPENSSL_NO_KRB5 */
+#endif /* KSSL_H */
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/lhash.h b/protocols/Telegram/tgl/openssl/include/openssl/lhash.h
new file mode 100644
index 0000000000..b6c328bffb
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/lhash.h
@@ -0,0 +1,240 @@
+/* crypto/lhash/lhash.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+/*
+ * Header for dynamic hash table routines Author - Eric Young
+ */
+
+#ifndef HEADER_LHASH_H
+# define HEADER_LHASH_H
+
+# include <openssl/e_os2.h>
+# ifndef OPENSSL_NO_FP_API
+# include <stdio.h>
+# endif
+
+# ifndef OPENSSL_NO_BIO
+# include <openssl/bio.h>
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct lhash_node_st {
+ void *data;
+ struct lhash_node_st *next;
+# ifndef OPENSSL_NO_HASH_COMP
+ unsigned long hash;
+# endif
+} LHASH_NODE;
+
+typedef int (*LHASH_COMP_FN_TYPE) (const void *, const void *);
+typedef unsigned long (*LHASH_HASH_FN_TYPE) (const void *);
+typedef void (*LHASH_DOALL_FN_TYPE) (void *);
+typedef void (*LHASH_DOALL_ARG_FN_TYPE) (void *, void *);
+
+/*
+ * Macros for declaring and implementing type-safe wrappers for LHASH
+ * callbacks. This way, callbacks can be provided to LHASH structures without
+ * function pointer casting and the macro-defined callbacks provide
+ * per-variable casting before deferring to the underlying type-specific
+ * callbacks. NB: It is possible to place a "static" in front of both the
+ * DECLARE and IMPLEMENT macros if the functions are strictly internal.
+ */
+
+/* First: "hash" functions */
+# define DECLARE_LHASH_HASH_FN(name, o_type) \
+ unsigned long name##_LHASH_HASH(const void *);
+# define IMPLEMENT_LHASH_HASH_FN(name, o_type) \
+ unsigned long name##_LHASH_HASH(const void *arg) { \
+ const o_type *a = arg; \
+ return name##_hash(a); }
+# define LHASH_HASH_FN(name) name##_LHASH_HASH
+
+/* Second: "compare" functions */
+# define DECLARE_LHASH_COMP_FN(name, o_type) \
+ int name##_LHASH_COMP(const void *, const void *);
+# define IMPLEMENT_LHASH_COMP_FN(name, o_type) \
+ int name##_LHASH_COMP(const void *arg1, const void *arg2) { \
+ const o_type *a = arg1; \
+ const o_type *b = arg2; \
+ return name##_cmp(a,b); }
+# define LHASH_COMP_FN(name) name##_LHASH_COMP
+
+/* Third: "doall" functions */
+# define DECLARE_LHASH_DOALL_FN(name, o_type) \
+ void name##_LHASH_DOALL(void *);
+# define IMPLEMENT_LHASH_DOALL_FN(name, o_type) \
+ void name##_LHASH_DOALL(void *arg) { \
+ o_type *a = arg; \
+ name##_doall(a); }
+# define LHASH_DOALL_FN(name) name##_LHASH_DOALL
+
+/* Fourth: "doall_arg" functions */
+# define DECLARE_LHASH_DOALL_ARG_FN(name, o_type, a_type) \
+ void name##_LHASH_DOALL_ARG(void *, void *);
+# define IMPLEMENT_LHASH_DOALL_ARG_FN(name, o_type, a_type) \
+ void name##_LHASH_DOALL_ARG(void *arg1, void *arg2) { \
+ o_type *a = arg1; \
+ a_type *b = arg2; \
+ name##_doall_arg(a, b); }
+# define LHASH_DOALL_ARG_FN(name) name##_LHASH_DOALL_ARG
+
+typedef struct lhash_st {
+ LHASH_NODE **b;
+ LHASH_COMP_FN_TYPE comp;
+ LHASH_HASH_FN_TYPE hash;
+ unsigned int num_nodes;
+ unsigned int num_alloc_nodes;
+ unsigned int p;
+ unsigned int pmax;
+ unsigned long up_load; /* load times 256 */
+ unsigned long down_load; /* load times 256 */
+ unsigned long num_items;
+ unsigned long num_expands;
+ unsigned long num_expand_reallocs;
+ unsigned long num_contracts;
+ unsigned long num_contract_reallocs;
+ unsigned long num_hash_calls;
+ unsigned long num_comp_calls;
+ unsigned long num_insert;
+ unsigned long num_replace;
+ unsigned long num_delete;
+ unsigned long num_no_delete;
+ unsigned long num_retrieve;
+ unsigned long num_retrieve_miss;
+ unsigned long num_hash_comps;
+ int error;
+} _LHASH; /* Do not use _LHASH directly, use LHASH_OF
+ * and friends */
+
+# define LH_LOAD_MULT 256
+
+/*
+ * Indicates a malloc() error in the last call, this is only bad in
+ * lh_insert().
+ */
+# define lh_error(lh) ((lh)->error)
+
+_LHASH *lh_new(LHASH_HASH_FN_TYPE h, LHASH_COMP_FN_TYPE c);
+void lh_free(_LHASH *lh);
+void *lh_insert(_LHASH *lh, void *data);
+void *lh_delete(_LHASH *lh, const void *data);
+void *lh_retrieve(_LHASH *lh, const void *data);
+void lh_doall(_LHASH *lh, LHASH_DOALL_FN_TYPE func);
+void lh_doall_arg(_LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg);
+unsigned long lh_strhash(const char *c);
+unsigned long lh_num_items(const _LHASH *lh);
+
+# ifndef OPENSSL_NO_FP_API
+void lh_stats(const _LHASH *lh, FILE *out);
+void lh_node_stats(const _LHASH *lh, FILE *out);
+void lh_node_usage_stats(const _LHASH *lh, FILE *out);
+# endif
+
+# ifndef OPENSSL_NO_BIO
+void lh_stats_bio(const _LHASH *lh, BIO *out);
+void lh_node_stats_bio(const _LHASH *lh, BIO *out);
+void lh_node_usage_stats_bio(const _LHASH *lh, BIO *out);
+# endif
+
+/* Type checking... */
+
+# define LHASH_OF(type) struct lhash_st_##type
+
+# define DECLARE_LHASH_OF(type) LHASH_OF(type) { int dummy; }
+
+# define CHECKED_LHASH_OF(type,lh) \
+ ((_LHASH *)CHECKED_PTR_OF(LHASH_OF(type),lh))
+
+/* Define wrapper functions. */
+# define LHM_lh_new(type, name) \
+ ((LHASH_OF(type) *)lh_new(LHASH_HASH_FN(name), LHASH_COMP_FN(name)))
+# define LHM_lh_error(type, lh) \
+ lh_error(CHECKED_LHASH_OF(type,lh))
+# define LHM_lh_insert(type, lh, inst) \
+ ((type *)lh_insert(CHECKED_LHASH_OF(type, lh), \
+ CHECKED_PTR_OF(type, inst)))
+# define LHM_lh_retrieve(type, lh, inst) \
+ ((type *)lh_retrieve(CHECKED_LHASH_OF(type, lh), \
+ CHECKED_PTR_OF(type, inst)))
+# define LHM_lh_delete(type, lh, inst) \
+ ((type *)lh_delete(CHECKED_LHASH_OF(type, lh), \
+ CHECKED_PTR_OF(type, inst)))
+# define LHM_lh_doall(type, lh,fn) lh_doall(CHECKED_LHASH_OF(type, lh), fn)
+# define LHM_lh_doall_arg(type, lh, fn, arg_type, arg) \
+ lh_doall_arg(CHECKED_LHASH_OF(type, lh), fn, CHECKED_PTR_OF(arg_type, arg))
+# define LHM_lh_num_items(type, lh) lh_num_items(CHECKED_LHASH_OF(type, lh))
+# define LHM_lh_down_load(type, lh) (CHECKED_LHASH_OF(type, lh)->down_load)
+# define LHM_lh_node_stats_bio(type, lh, out) \
+ lh_node_stats_bio(CHECKED_LHASH_OF(type, lh), out)
+# define LHM_lh_node_usage_stats_bio(type, lh, out) \
+ lh_node_usage_stats_bio(CHECKED_LHASH_OF(type, lh), out)
+# define LHM_lh_stats_bio(type, lh, out) \
+ lh_stats_bio(CHECKED_LHASH_OF(type, lh), out)
+# define LHM_lh_free(type, lh) lh_free(CHECKED_LHASH_OF(type, lh))
+
+DECLARE_LHASH_OF(OPENSSL_STRING);
+DECLARE_LHASH_OF(OPENSSL_CSTRING);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/md4.h b/protocols/Telegram/tgl/openssl/include/openssl/md4.h
new file mode 100644
index 0000000000..11fd71295b
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/md4.h
@@ -0,0 +1,119 @@
+/* crypto/md4/md4.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_MD4_H
+# define HEADER_MD4_H
+
+# include <openssl/e_os2.h>
+# include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# ifdef OPENSSL_NO_MD4
+# error MD4 is disabled.
+# endif
+
+/*-
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ * ! MD4_LONG has to be at least 32 bits wide. If it's wider, then !
+ * ! MD4_LONG_LOG2 has to be defined along. !
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ */
+
+# if defined(__LP32__)
+# define MD4_LONG unsigned long
+# elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)
+# define MD4_LONG unsigned long
+# define MD4_LONG_LOG2 3
+/*
+ * _CRAY note. I could declare short, but I have no idea what impact
+ * does it have on performance on none-T3E machines. I could declare
+ * int, but at least on C90 sizeof(int) can be chosen at compile time.
+ * So I've chosen long...
+ * <appro@fy.chalmers.se>
+ */
+# else
+# define MD4_LONG unsigned int
+# endif
+
+# define MD4_CBLOCK 64
+# define MD4_LBLOCK (MD4_CBLOCK/4)
+# define MD4_DIGEST_LENGTH 16
+
+typedef struct MD4state_st {
+ MD4_LONG A, B, C, D;
+ MD4_LONG Nl, Nh;
+ MD4_LONG data[MD4_LBLOCK];
+ unsigned int num;
+} MD4_CTX;
+
+# ifdef OPENSSL_FIPS
+int private_MD4_Init(MD4_CTX *c);
+# endif
+int MD4_Init(MD4_CTX *c);
+int MD4_Update(MD4_CTX *c, const void *data, size_t len);
+int MD4_Final(unsigned char *md, MD4_CTX *c);
+unsigned char *MD4(const unsigned char *d, size_t n, unsigned char *md);
+void MD4_Transform(MD4_CTX *c, const unsigned char *b);
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/md5.h b/protocols/Telegram/tgl/openssl/include/openssl/md5.h
new file mode 100644
index 0000000000..2659038abd
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/md5.h
@@ -0,0 +1,119 @@
+/* crypto/md5/md5.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_MD5_H
+# define HEADER_MD5_H
+
+# include <openssl/e_os2.h>
+# include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# ifdef OPENSSL_NO_MD5
+# error MD5 is disabled.
+# endif
+
+/*
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ * ! MD5_LONG has to be at least 32 bits wide. If it's wider, then !
+ * ! MD5_LONG_LOG2 has to be defined along. !
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ */
+
+# if defined(__LP32__)
+# define MD5_LONG unsigned long
+# elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)
+# define MD5_LONG unsigned long
+# define MD5_LONG_LOG2 3
+/*
+ * _CRAY note. I could declare short, but I have no idea what impact
+ * does it have on performance on none-T3E machines. I could declare
+ * int, but at least on C90 sizeof(int) can be chosen at compile time.
+ * So I've chosen long...
+ * <appro@fy.chalmers.se>
+ */
+# else
+# define MD5_LONG unsigned int
+# endif
+
+# define MD5_CBLOCK 64
+# define MD5_LBLOCK (MD5_CBLOCK/4)
+# define MD5_DIGEST_LENGTH 16
+
+typedef struct MD5state_st {
+ MD5_LONG A, B, C, D;
+ MD5_LONG Nl, Nh;
+ MD5_LONG data[MD5_LBLOCK];
+ unsigned int num;
+} MD5_CTX;
+
+# ifdef OPENSSL_FIPS
+int private_MD5_Init(MD5_CTX *c);
+# endif
+int MD5_Init(MD5_CTX *c);
+int MD5_Update(MD5_CTX *c, const void *data, size_t len);
+int MD5_Final(unsigned char *md, MD5_CTX *c);
+unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md);
+void MD5_Transform(MD5_CTX *c, const unsigned char *b);
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/mdc2.h b/protocols/Telegram/tgl/openssl/include/openssl/mdc2.h
new file mode 100644
index 0000000000..7efe53bc29
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/mdc2.h
@@ -0,0 +1,94 @@
+/* crypto/mdc2/mdc2.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_MDC2_H
+# define HEADER_MDC2_H
+
+# include <openssl/des.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# ifdef OPENSSL_NO_MDC2
+# error MDC2 is disabled.
+# endif
+
+# define MDC2_BLOCK 8
+# define MDC2_DIGEST_LENGTH 16
+
+typedef struct mdc2_ctx_st {
+ unsigned int num;
+ unsigned char data[MDC2_BLOCK];
+ DES_cblock h, hh;
+ int pad_type; /* either 1 or 2, default 1 */
+} MDC2_CTX;
+
+# ifdef OPENSSL_FIPS
+int private_MDC2_Init(MDC2_CTX *c);
+# endif
+int MDC2_Init(MDC2_CTX *c);
+int MDC2_Update(MDC2_CTX *c, const unsigned char *data, size_t len);
+int MDC2_Final(unsigned char *md, MDC2_CTX *c);
+unsigned char *MDC2(const unsigned char *d, size_t n, unsigned char *md);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/modes.h b/protocols/Telegram/tgl/openssl/include/openssl/modes.h
new file mode 100644
index 0000000000..fd488499a0
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/modes.h
@@ -0,0 +1,163 @@
+/* ====================================================================
+ * Copyright (c) 2008 The OpenSSL Project. All rights reserved.
+ *
+ * Rights for redistribution and usage in source and binary
+ * forms are granted according to the OpenSSL license.
+ */
+
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef void (*block128_f) (const unsigned char in[16],
+ unsigned char out[16], const void *key);
+
+typedef void (*cbc128_f) (const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], int enc);
+
+typedef void (*ctr128_f) (const unsigned char *in, unsigned char *out,
+ size_t blocks, const void *key,
+ const unsigned char ivec[16]);
+
+typedef void (*ccm128_f) (const unsigned char *in, unsigned char *out,
+ size_t blocks, const void *key,
+ const unsigned char ivec[16],
+ unsigned char cmac[16]);
+
+void CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], block128_f block);
+void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], block128_f block);
+
+void CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16],
+ unsigned char ecount_buf[16], unsigned int *num,
+ block128_f block);
+
+void CRYPTO_ctr128_encrypt_ctr32(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16],
+ unsigned char ecount_buf[16],
+ unsigned int *num, ctr128_f ctr);
+
+void CRYPTO_ofb128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], int *num,
+ block128_f block);
+
+void CRYPTO_cfb128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], int *num,
+ int enc, block128_f block);
+void CRYPTO_cfb128_8_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const void *key,
+ unsigned char ivec[16], int *num,
+ int enc, block128_f block);
+void CRYPTO_cfb128_1_encrypt(const unsigned char *in, unsigned char *out,
+ size_t bits, const void *key,
+ unsigned char ivec[16], int *num,
+ int enc, block128_f block);
+
+size_t CRYPTO_cts128_encrypt_block(const unsigned char *in,
+ unsigned char *out, size_t len,
+ const void *key, unsigned char ivec[16],
+ block128_f block);
+size_t CRYPTO_cts128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], cbc128_f cbc);
+size_t CRYPTO_cts128_decrypt_block(const unsigned char *in,
+ unsigned char *out, size_t len,
+ const void *key, unsigned char ivec[16],
+ block128_f block);
+size_t CRYPTO_cts128_decrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], cbc128_f cbc);
+
+size_t CRYPTO_nistcts128_encrypt_block(const unsigned char *in,
+ unsigned char *out, size_t len,
+ const void *key,
+ unsigned char ivec[16],
+ block128_f block);
+size_t CRYPTO_nistcts128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], cbc128_f cbc);
+size_t CRYPTO_nistcts128_decrypt_block(const unsigned char *in,
+ unsigned char *out, size_t len,
+ const void *key,
+ unsigned char ivec[16],
+ block128_f block);
+size_t CRYPTO_nistcts128_decrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], cbc128_f cbc);
+
+typedef struct gcm128_context GCM128_CONTEXT;
+
+GCM128_CONTEXT *CRYPTO_gcm128_new(void *key, block128_f block);
+void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx, void *key, block128_f block);
+void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const unsigned char *iv,
+ size_t len);
+int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const unsigned char *aad,
+ size_t len);
+int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx,
+ const unsigned char *in, unsigned char *out,
+ size_t len);
+int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx,
+ const unsigned char *in, unsigned char *out,
+ size_t len);
+int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx,
+ const unsigned char *in, unsigned char *out,
+ size_t len, ctr128_f stream);
+int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx,
+ const unsigned char *in, unsigned char *out,
+ size_t len, ctr128_f stream);
+int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const unsigned char *tag,
+ size_t len);
+void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len);
+void CRYPTO_gcm128_release(GCM128_CONTEXT *ctx);
+
+typedef struct ccm128_context CCM128_CONTEXT;
+
+void CRYPTO_ccm128_init(CCM128_CONTEXT *ctx,
+ unsigned int M, unsigned int L, void *key,
+ block128_f block);
+int CRYPTO_ccm128_setiv(CCM128_CONTEXT *ctx, const unsigned char *nonce,
+ size_t nlen, size_t mlen);
+void CRYPTO_ccm128_aad(CCM128_CONTEXT *ctx, const unsigned char *aad,
+ size_t alen);
+int CRYPTO_ccm128_encrypt(CCM128_CONTEXT *ctx, const unsigned char *inp,
+ unsigned char *out, size_t len);
+int CRYPTO_ccm128_decrypt(CCM128_CONTEXT *ctx, const unsigned char *inp,
+ unsigned char *out, size_t len);
+int CRYPTO_ccm128_encrypt_ccm64(CCM128_CONTEXT *ctx, const unsigned char *inp,
+ unsigned char *out, size_t len,
+ ccm128_f stream);
+int CRYPTO_ccm128_decrypt_ccm64(CCM128_CONTEXT *ctx, const unsigned char *inp,
+ unsigned char *out, size_t len,
+ ccm128_f stream);
+size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len);
+
+typedef struct xts128_context XTS128_CONTEXT;
+
+int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx,
+ const unsigned char iv[16],
+ const unsigned char *inp, unsigned char *out,
+ size_t len, int enc);
+
+size_t CRYPTO_128_wrap(void *key, const unsigned char *iv,
+ unsigned char *out,
+ const unsigned char *in, size_t inlen,
+ block128_f block);
+
+size_t CRYPTO_128_unwrap(void *key, const unsigned char *iv,
+ unsigned char *out,
+ const unsigned char *in, size_t inlen,
+ block128_f block);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/obj_mac.h b/protocols/Telegram/tgl/openssl/include/openssl/obj_mac.h
new file mode 100644
index 0000000000..779c309b86
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/obj_mac.h
@@ -0,0 +1,4194 @@
+/* crypto/objects/obj_mac.h */
+
+/*
+ * THIS FILE IS GENERATED FROM objects.txt by objects.pl via the following
+ * command: perl objects.pl objects.txt obj_mac.num obj_mac.h
+ */
+
+/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#define SN_undef "UNDEF"
+#define LN_undef "undefined"
+#define NID_undef 0
+#define OBJ_undef 0L
+
+#define SN_itu_t "ITU-T"
+#define LN_itu_t "itu-t"
+#define NID_itu_t 645
+#define OBJ_itu_t 0L
+
+#define NID_ccitt 404
+#define OBJ_ccitt OBJ_itu_t
+
+#define SN_iso "ISO"
+#define LN_iso "iso"
+#define NID_iso 181
+#define OBJ_iso 1L
+
+#define SN_joint_iso_itu_t "JOINT-ISO-ITU-T"
+#define LN_joint_iso_itu_t "joint-iso-itu-t"
+#define NID_joint_iso_itu_t 646
+#define OBJ_joint_iso_itu_t 2L
+
+#define NID_joint_iso_ccitt 393
+#define OBJ_joint_iso_ccitt OBJ_joint_iso_itu_t
+
+#define SN_member_body "member-body"
+#define LN_member_body "ISO Member Body"
+#define NID_member_body 182
+#define OBJ_member_body OBJ_iso,2L
+
+#define SN_identified_organization "identified-organization"
+#define NID_identified_organization 676
+#define OBJ_identified_organization OBJ_iso,3L
+
+#define SN_hmac_md5 "HMAC-MD5"
+#define LN_hmac_md5 "hmac-md5"
+#define NID_hmac_md5 780
+#define OBJ_hmac_md5 OBJ_identified_organization,6L,1L,5L,5L,8L,1L,1L
+
+#define SN_hmac_sha1 "HMAC-SHA1"
+#define LN_hmac_sha1 "hmac-sha1"
+#define NID_hmac_sha1 781
+#define OBJ_hmac_sha1 OBJ_identified_organization,6L,1L,5L,5L,8L,1L,2L
+
+#define SN_certicom_arc "certicom-arc"
+#define NID_certicom_arc 677
+#define OBJ_certicom_arc OBJ_identified_organization,132L
+
+#define SN_international_organizations "international-organizations"
+#define LN_international_organizations "International Organizations"
+#define NID_international_organizations 647
+#define OBJ_international_organizations OBJ_joint_iso_itu_t,23L
+
+#define SN_wap "wap"
+#define NID_wap 678
+#define OBJ_wap OBJ_international_organizations,43L
+
+#define SN_wap_wsg "wap-wsg"
+#define NID_wap_wsg 679
+#define OBJ_wap_wsg OBJ_wap,1L
+
+#define SN_selected_attribute_types "selected-attribute-types"
+#define LN_selected_attribute_types "Selected Attribute Types"
+#define NID_selected_attribute_types 394
+#define OBJ_selected_attribute_types OBJ_joint_iso_itu_t,5L,1L,5L
+
+#define SN_clearance "clearance"
+#define NID_clearance 395
+#define OBJ_clearance OBJ_selected_attribute_types,55L
+
+#define SN_ISO_US "ISO-US"
+#define LN_ISO_US "ISO US Member Body"
+#define NID_ISO_US 183
+#define OBJ_ISO_US OBJ_member_body,840L
+
+#define SN_X9_57 "X9-57"
+#define LN_X9_57 "X9.57"
+#define NID_X9_57 184
+#define OBJ_X9_57 OBJ_ISO_US,10040L
+
+#define SN_X9cm "X9cm"
+#define LN_X9cm "X9.57 CM ?"
+#define NID_X9cm 185
+#define OBJ_X9cm OBJ_X9_57,4L
+
+#define SN_dsa "DSA"
+#define LN_dsa "dsaEncryption"
+#define NID_dsa 116
+#define OBJ_dsa OBJ_X9cm,1L
+
+#define SN_dsaWithSHA1 "DSA-SHA1"
+#define LN_dsaWithSHA1 "dsaWithSHA1"
+#define NID_dsaWithSHA1 113
+#define OBJ_dsaWithSHA1 OBJ_X9cm,3L
+
+#define SN_ansi_X9_62 "ansi-X9-62"
+#define LN_ansi_X9_62 "ANSI X9.62"
+#define NID_ansi_X9_62 405
+#define OBJ_ansi_X9_62 OBJ_ISO_US,10045L
+
+#define OBJ_X9_62_id_fieldType OBJ_ansi_X9_62,1L
+
+#define SN_X9_62_prime_field "prime-field"
+#define NID_X9_62_prime_field 406
+#define OBJ_X9_62_prime_field OBJ_X9_62_id_fieldType,1L
+
+#define SN_X9_62_characteristic_two_field "characteristic-two-field"
+#define NID_X9_62_characteristic_two_field 407
+#define OBJ_X9_62_characteristic_two_field OBJ_X9_62_id_fieldType,2L
+
+#define SN_X9_62_id_characteristic_two_basis "id-characteristic-two-basis"
+#define NID_X9_62_id_characteristic_two_basis 680
+#define OBJ_X9_62_id_characteristic_two_basis OBJ_X9_62_characteristic_two_field,3L
+
+#define SN_X9_62_onBasis "onBasis"
+#define NID_X9_62_onBasis 681
+#define OBJ_X9_62_onBasis OBJ_X9_62_id_characteristic_two_basis,1L
+
+#define SN_X9_62_tpBasis "tpBasis"
+#define NID_X9_62_tpBasis 682
+#define OBJ_X9_62_tpBasis OBJ_X9_62_id_characteristic_two_basis,2L
+
+#define SN_X9_62_ppBasis "ppBasis"
+#define NID_X9_62_ppBasis 683
+#define OBJ_X9_62_ppBasis OBJ_X9_62_id_characteristic_two_basis,3L
+
+#define OBJ_X9_62_id_publicKeyType OBJ_ansi_X9_62,2L
+
+#define SN_X9_62_id_ecPublicKey "id-ecPublicKey"
+#define NID_X9_62_id_ecPublicKey 408
+#define OBJ_X9_62_id_ecPublicKey OBJ_X9_62_id_publicKeyType,1L
+
+#define OBJ_X9_62_ellipticCurve OBJ_ansi_X9_62,3L
+
+#define OBJ_X9_62_c_TwoCurve OBJ_X9_62_ellipticCurve,0L
+
+#define SN_X9_62_c2pnb163v1 "c2pnb163v1"
+#define NID_X9_62_c2pnb163v1 684
+#define OBJ_X9_62_c2pnb163v1 OBJ_X9_62_c_TwoCurve,1L
+
+#define SN_X9_62_c2pnb163v2 "c2pnb163v2"
+#define NID_X9_62_c2pnb163v2 685
+#define OBJ_X9_62_c2pnb163v2 OBJ_X9_62_c_TwoCurve,2L
+
+#define SN_X9_62_c2pnb163v3 "c2pnb163v3"
+#define NID_X9_62_c2pnb163v3 686
+#define OBJ_X9_62_c2pnb163v3 OBJ_X9_62_c_TwoCurve,3L
+
+#define SN_X9_62_c2pnb176v1 "c2pnb176v1"
+#define NID_X9_62_c2pnb176v1 687
+#define OBJ_X9_62_c2pnb176v1 OBJ_X9_62_c_TwoCurve,4L
+
+#define SN_X9_62_c2tnb191v1 "c2tnb191v1"
+#define NID_X9_62_c2tnb191v1 688
+#define OBJ_X9_62_c2tnb191v1 OBJ_X9_62_c_TwoCurve,5L
+
+#define SN_X9_62_c2tnb191v2 "c2tnb191v2"
+#define NID_X9_62_c2tnb191v2 689
+#define OBJ_X9_62_c2tnb191v2 OBJ_X9_62_c_TwoCurve,6L
+
+#define SN_X9_62_c2tnb191v3 "c2tnb191v3"
+#define NID_X9_62_c2tnb191v3 690
+#define OBJ_X9_62_c2tnb191v3 OBJ_X9_62_c_TwoCurve,7L
+
+#define SN_X9_62_c2onb191v4 "c2onb191v4"
+#define NID_X9_62_c2onb191v4 691
+#define OBJ_X9_62_c2onb191v4 OBJ_X9_62_c_TwoCurve,8L
+
+#define SN_X9_62_c2onb191v5 "c2onb191v5"
+#define NID_X9_62_c2onb191v5 692
+#define OBJ_X9_62_c2onb191v5 OBJ_X9_62_c_TwoCurve,9L
+
+#define SN_X9_62_c2pnb208w1 "c2pnb208w1"
+#define NID_X9_62_c2pnb208w1 693
+#define OBJ_X9_62_c2pnb208w1 OBJ_X9_62_c_TwoCurve,10L
+
+#define SN_X9_62_c2tnb239v1 "c2tnb239v1"
+#define NID_X9_62_c2tnb239v1 694
+#define OBJ_X9_62_c2tnb239v1 OBJ_X9_62_c_TwoCurve,11L
+
+#define SN_X9_62_c2tnb239v2 "c2tnb239v2"
+#define NID_X9_62_c2tnb239v2 695
+#define OBJ_X9_62_c2tnb239v2 OBJ_X9_62_c_TwoCurve,12L
+
+#define SN_X9_62_c2tnb239v3 "c2tnb239v3"
+#define NID_X9_62_c2tnb239v3 696
+#define OBJ_X9_62_c2tnb239v3 OBJ_X9_62_c_TwoCurve,13L
+
+#define SN_X9_62_c2onb239v4 "c2onb239v4"
+#define NID_X9_62_c2onb239v4 697
+#define OBJ_X9_62_c2onb239v4 OBJ_X9_62_c_TwoCurve,14L
+
+#define SN_X9_62_c2onb239v5 "c2onb239v5"
+#define NID_X9_62_c2onb239v5 698
+#define OBJ_X9_62_c2onb239v5 OBJ_X9_62_c_TwoCurve,15L
+
+#define SN_X9_62_c2pnb272w1 "c2pnb272w1"
+#define NID_X9_62_c2pnb272w1 699
+#define OBJ_X9_62_c2pnb272w1 OBJ_X9_62_c_TwoCurve,16L
+
+#define SN_X9_62_c2pnb304w1 "c2pnb304w1"
+#define NID_X9_62_c2pnb304w1 700
+#define OBJ_X9_62_c2pnb304w1 OBJ_X9_62_c_TwoCurve,17L
+
+#define SN_X9_62_c2tnb359v1 "c2tnb359v1"
+#define NID_X9_62_c2tnb359v1 701
+#define OBJ_X9_62_c2tnb359v1 OBJ_X9_62_c_TwoCurve,18L
+
+#define SN_X9_62_c2pnb368w1 "c2pnb368w1"
+#define NID_X9_62_c2pnb368w1 702
+#define OBJ_X9_62_c2pnb368w1 OBJ_X9_62_c_TwoCurve,19L
+
+#define SN_X9_62_c2tnb431r1 "c2tnb431r1"
+#define NID_X9_62_c2tnb431r1 703
+#define OBJ_X9_62_c2tnb431r1 OBJ_X9_62_c_TwoCurve,20L
+
+#define OBJ_X9_62_primeCurve OBJ_X9_62_ellipticCurve,1L
+
+#define SN_X9_62_prime192v1 "prime192v1"
+#define NID_X9_62_prime192v1 409
+#define OBJ_X9_62_prime192v1 OBJ_X9_62_primeCurve,1L
+
+#define SN_X9_62_prime192v2 "prime192v2"
+#define NID_X9_62_prime192v2 410
+#define OBJ_X9_62_prime192v2 OBJ_X9_62_primeCurve,2L
+
+#define SN_X9_62_prime192v3 "prime192v3"
+#define NID_X9_62_prime192v3 411
+#define OBJ_X9_62_prime192v3 OBJ_X9_62_primeCurve,3L
+
+#define SN_X9_62_prime239v1 "prime239v1"
+#define NID_X9_62_prime239v1 412
+#define OBJ_X9_62_prime239v1 OBJ_X9_62_primeCurve,4L
+
+#define SN_X9_62_prime239v2 "prime239v2"
+#define NID_X9_62_prime239v2 413
+#define OBJ_X9_62_prime239v2 OBJ_X9_62_primeCurve,5L
+
+#define SN_X9_62_prime239v3 "prime239v3"
+#define NID_X9_62_prime239v3 414
+#define OBJ_X9_62_prime239v3 OBJ_X9_62_primeCurve,6L
+
+#define SN_X9_62_prime256v1 "prime256v1"
+#define NID_X9_62_prime256v1 415
+#define OBJ_X9_62_prime256v1 OBJ_X9_62_primeCurve,7L
+
+#define OBJ_X9_62_id_ecSigType OBJ_ansi_X9_62,4L
+
+#define SN_ecdsa_with_SHA1 "ecdsa-with-SHA1"
+#define NID_ecdsa_with_SHA1 416
+#define OBJ_ecdsa_with_SHA1 OBJ_X9_62_id_ecSigType,1L
+
+#define SN_ecdsa_with_Recommended "ecdsa-with-Recommended"
+#define NID_ecdsa_with_Recommended 791
+#define OBJ_ecdsa_with_Recommended OBJ_X9_62_id_ecSigType,2L
+
+#define SN_ecdsa_with_Specified "ecdsa-with-Specified"
+#define NID_ecdsa_with_Specified 792
+#define OBJ_ecdsa_with_Specified OBJ_X9_62_id_ecSigType,3L
+
+#define SN_ecdsa_with_SHA224 "ecdsa-with-SHA224"
+#define NID_ecdsa_with_SHA224 793
+#define OBJ_ecdsa_with_SHA224 OBJ_ecdsa_with_Specified,1L
+
+#define SN_ecdsa_with_SHA256 "ecdsa-with-SHA256"
+#define NID_ecdsa_with_SHA256 794
+#define OBJ_ecdsa_with_SHA256 OBJ_ecdsa_with_Specified,2L
+
+#define SN_ecdsa_with_SHA384 "ecdsa-with-SHA384"
+#define NID_ecdsa_with_SHA384 795
+#define OBJ_ecdsa_with_SHA384 OBJ_ecdsa_with_Specified,3L
+
+#define SN_ecdsa_with_SHA512 "ecdsa-with-SHA512"
+#define NID_ecdsa_with_SHA512 796
+#define OBJ_ecdsa_with_SHA512 OBJ_ecdsa_with_Specified,4L
+
+#define OBJ_secg_ellipticCurve OBJ_certicom_arc,0L
+
+#define SN_secp112r1 "secp112r1"
+#define NID_secp112r1 704
+#define OBJ_secp112r1 OBJ_secg_ellipticCurve,6L
+
+#define SN_secp112r2 "secp112r2"
+#define NID_secp112r2 705
+#define OBJ_secp112r2 OBJ_secg_ellipticCurve,7L
+
+#define SN_secp128r1 "secp128r1"
+#define NID_secp128r1 706
+#define OBJ_secp128r1 OBJ_secg_ellipticCurve,28L
+
+#define SN_secp128r2 "secp128r2"
+#define NID_secp128r2 707
+#define OBJ_secp128r2 OBJ_secg_ellipticCurve,29L
+
+#define SN_secp160k1 "secp160k1"
+#define NID_secp160k1 708
+#define OBJ_secp160k1 OBJ_secg_ellipticCurve,9L
+
+#define SN_secp160r1 "secp160r1"
+#define NID_secp160r1 709
+#define OBJ_secp160r1 OBJ_secg_ellipticCurve,8L
+
+#define SN_secp160r2 "secp160r2"
+#define NID_secp160r2 710
+#define OBJ_secp160r2 OBJ_secg_ellipticCurve,30L
+
+#define SN_secp192k1 "secp192k1"
+#define NID_secp192k1 711
+#define OBJ_secp192k1 OBJ_secg_ellipticCurve,31L
+
+#define SN_secp224k1 "secp224k1"
+#define NID_secp224k1 712
+#define OBJ_secp224k1 OBJ_secg_ellipticCurve,32L
+
+#define SN_secp224r1 "secp224r1"
+#define NID_secp224r1 713
+#define OBJ_secp224r1 OBJ_secg_ellipticCurve,33L
+
+#define SN_secp256k1 "secp256k1"
+#define NID_secp256k1 714
+#define OBJ_secp256k1 OBJ_secg_ellipticCurve,10L
+
+#define SN_secp384r1 "secp384r1"
+#define NID_secp384r1 715
+#define OBJ_secp384r1 OBJ_secg_ellipticCurve,34L
+
+#define SN_secp521r1 "secp521r1"
+#define NID_secp521r1 716
+#define OBJ_secp521r1 OBJ_secg_ellipticCurve,35L
+
+#define SN_sect113r1 "sect113r1"
+#define NID_sect113r1 717
+#define OBJ_sect113r1 OBJ_secg_ellipticCurve,4L
+
+#define SN_sect113r2 "sect113r2"
+#define NID_sect113r2 718
+#define OBJ_sect113r2 OBJ_secg_ellipticCurve,5L
+
+#define SN_sect131r1 "sect131r1"
+#define NID_sect131r1 719
+#define OBJ_sect131r1 OBJ_secg_ellipticCurve,22L
+
+#define SN_sect131r2 "sect131r2"
+#define NID_sect131r2 720
+#define OBJ_sect131r2 OBJ_secg_ellipticCurve,23L
+
+#define SN_sect163k1 "sect163k1"
+#define NID_sect163k1 721
+#define OBJ_sect163k1 OBJ_secg_ellipticCurve,1L
+
+#define SN_sect163r1 "sect163r1"
+#define NID_sect163r1 722
+#define OBJ_sect163r1 OBJ_secg_ellipticCurve,2L
+
+#define SN_sect163r2 "sect163r2"
+#define NID_sect163r2 723
+#define OBJ_sect163r2 OBJ_secg_ellipticCurve,15L
+
+#define SN_sect193r1 "sect193r1"
+#define NID_sect193r1 724
+#define OBJ_sect193r1 OBJ_secg_ellipticCurve,24L
+
+#define SN_sect193r2 "sect193r2"
+#define NID_sect193r2 725
+#define OBJ_sect193r2 OBJ_secg_ellipticCurve,25L
+
+#define SN_sect233k1 "sect233k1"
+#define NID_sect233k1 726
+#define OBJ_sect233k1 OBJ_secg_ellipticCurve,26L
+
+#define SN_sect233r1 "sect233r1"
+#define NID_sect233r1 727
+#define OBJ_sect233r1 OBJ_secg_ellipticCurve,27L
+
+#define SN_sect239k1 "sect239k1"
+#define NID_sect239k1 728
+#define OBJ_sect239k1 OBJ_secg_ellipticCurve,3L
+
+#define SN_sect283k1 "sect283k1"
+#define NID_sect283k1 729
+#define OBJ_sect283k1 OBJ_secg_ellipticCurve,16L
+
+#define SN_sect283r1 "sect283r1"
+#define NID_sect283r1 730
+#define OBJ_sect283r1 OBJ_secg_ellipticCurve,17L
+
+#define SN_sect409k1 "sect409k1"
+#define NID_sect409k1 731
+#define OBJ_sect409k1 OBJ_secg_ellipticCurve,36L
+
+#define SN_sect409r1 "sect409r1"
+#define NID_sect409r1 732
+#define OBJ_sect409r1 OBJ_secg_ellipticCurve,37L
+
+#define SN_sect571k1 "sect571k1"
+#define NID_sect571k1 733
+#define OBJ_sect571k1 OBJ_secg_ellipticCurve,38L
+
+#define SN_sect571r1 "sect571r1"
+#define NID_sect571r1 734
+#define OBJ_sect571r1 OBJ_secg_ellipticCurve,39L
+
+#define OBJ_wap_wsg_idm_ecid OBJ_wap_wsg,4L
+
+#define SN_wap_wsg_idm_ecid_wtls1 "wap-wsg-idm-ecid-wtls1"
+#define NID_wap_wsg_idm_ecid_wtls1 735
+#define OBJ_wap_wsg_idm_ecid_wtls1 OBJ_wap_wsg_idm_ecid,1L
+
+#define SN_wap_wsg_idm_ecid_wtls3 "wap-wsg-idm-ecid-wtls3"
+#define NID_wap_wsg_idm_ecid_wtls3 736
+#define OBJ_wap_wsg_idm_ecid_wtls3 OBJ_wap_wsg_idm_ecid,3L
+
+#define SN_wap_wsg_idm_ecid_wtls4 "wap-wsg-idm-ecid-wtls4"
+#define NID_wap_wsg_idm_ecid_wtls4 737
+#define OBJ_wap_wsg_idm_ecid_wtls4 OBJ_wap_wsg_idm_ecid,4L
+
+#define SN_wap_wsg_idm_ecid_wtls5 "wap-wsg-idm-ecid-wtls5"
+#define NID_wap_wsg_idm_ecid_wtls5 738
+#define OBJ_wap_wsg_idm_ecid_wtls5 OBJ_wap_wsg_idm_ecid,5L
+
+#define SN_wap_wsg_idm_ecid_wtls6 "wap-wsg-idm-ecid-wtls6"
+#define NID_wap_wsg_idm_ecid_wtls6 739
+#define OBJ_wap_wsg_idm_ecid_wtls6 OBJ_wap_wsg_idm_ecid,6L
+
+#define SN_wap_wsg_idm_ecid_wtls7 "wap-wsg-idm-ecid-wtls7"
+#define NID_wap_wsg_idm_ecid_wtls7 740
+#define OBJ_wap_wsg_idm_ecid_wtls7 OBJ_wap_wsg_idm_ecid,7L
+
+#define SN_wap_wsg_idm_ecid_wtls8 "wap-wsg-idm-ecid-wtls8"
+#define NID_wap_wsg_idm_ecid_wtls8 741
+#define OBJ_wap_wsg_idm_ecid_wtls8 OBJ_wap_wsg_idm_ecid,8L
+
+#define SN_wap_wsg_idm_ecid_wtls9 "wap-wsg-idm-ecid-wtls9"
+#define NID_wap_wsg_idm_ecid_wtls9 742
+#define OBJ_wap_wsg_idm_ecid_wtls9 OBJ_wap_wsg_idm_ecid,9L
+
+#define SN_wap_wsg_idm_ecid_wtls10 "wap-wsg-idm-ecid-wtls10"
+#define NID_wap_wsg_idm_ecid_wtls10 743
+#define OBJ_wap_wsg_idm_ecid_wtls10 OBJ_wap_wsg_idm_ecid,10L
+
+#define SN_wap_wsg_idm_ecid_wtls11 "wap-wsg-idm-ecid-wtls11"
+#define NID_wap_wsg_idm_ecid_wtls11 744
+#define OBJ_wap_wsg_idm_ecid_wtls11 OBJ_wap_wsg_idm_ecid,11L
+
+#define SN_wap_wsg_idm_ecid_wtls12 "wap-wsg-idm-ecid-wtls12"
+#define NID_wap_wsg_idm_ecid_wtls12 745
+#define OBJ_wap_wsg_idm_ecid_wtls12 OBJ_wap_wsg_idm_ecid,12L
+
+#define SN_cast5_cbc "CAST5-CBC"
+#define LN_cast5_cbc "cast5-cbc"
+#define NID_cast5_cbc 108
+#define OBJ_cast5_cbc OBJ_ISO_US,113533L,7L,66L,10L
+
+#define SN_cast5_ecb "CAST5-ECB"
+#define LN_cast5_ecb "cast5-ecb"
+#define NID_cast5_ecb 109
+
+#define SN_cast5_cfb64 "CAST5-CFB"
+#define LN_cast5_cfb64 "cast5-cfb"
+#define NID_cast5_cfb64 110
+
+#define SN_cast5_ofb64 "CAST5-OFB"
+#define LN_cast5_ofb64 "cast5-ofb"
+#define NID_cast5_ofb64 111
+
+#define LN_pbeWithMD5AndCast5_CBC "pbeWithMD5AndCast5CBC"
+#define NID_pbeWithMD5AndCast5_CBC 112
+#define OBJ_pbeWithMD5AndCast5_CBC OBJ_ISO_US,113533L,7L,66L,12L
+
+#define SN_id_PasswordBasedMAC "id-PasswordBasedMAC"
+#define LN_id_PasswordBasedMAC "password based MAC"
+#define NID_id_PasswordBasedMAC 782
+#define OBJ_id_PasswordBasedMAC OBJ_ISO_US,113533L,7L,66L,13L
+
+#define SN_id_DHBasedMac "id-DHBasedMac"
+#define LN_id_DHBasedMac "Diffie-Hellman based MAC"
+#define NID_id_DHBasedMac 783
+#define OBJ_id_DHBasedMac OBJ_ISO_US,113533L,7L,66L,30L
+
+#define SN_rsadsi "rsadsi"
+#define LN_rsadsi "RSA Data Security, Inc."
+#define NID_rsadsi 1
+#define OBJ_rsadsi OBJ_ISO_US,113549L
+
+#define SN_pkcs "pkcs"
+#define LN_pkcs "RSA Data Security, Inc. PKCS"
+#define NID_pkcs 2
+#define OBJ_pkcs OBJ_rsadsi,1L
+
+#define SN_pkcs1 "pkcs1"
+#define NID_pkcs1 186
+#define OBJ_pkcs1 OBJ_pkcs,1L
+
+#define LN_rsaEncryption "rsaEncryption"
+#define NID_rsaEncryption 6
+#define OBJ_rsaEncryption OBJ_pkcs1,1L
+
+#define SN_md2WithRSAEncryption "RSA-MD2"
+#define LN_md2WithRSAEncryption "md2WithRSAEncryption"
+#define NID_md2WithRSAEncryption 7
+#define OBJ_md2WithRSAEncryption OBJ_pkcs1,2L
+
+#define SN_md4WithRSAEncryption "RSA-MD4"
+#define LN_md4WithRSAEncryption "md4WithRSAEncryption"
+#define NID_md4WithRSAEncryption 396
+#define OBJ_md4WithRSAEncryption OBJ_pkcs1,3L
+
+#define SN_md5WithRSAEncryption "RSA-MD5"
+#define LN_md5WithRSAEncryption "md5WithRSAEncryption"
+#define NID_md5WithRSAEncryption 8
+#define OBJ_md5WithRSAEncryption OBJ_pkcs1,4L
+
+#define SN_sha1WithRSAEncryption "RSA-SHA1"
+#define LN_sha1WithRSAEncryption "sha1WithRSAEncryption"
+#define NID_sha1WithRSAEncryption 65
+#define OBJ_sha1WithRSAEncryption OBJ_pkcs1,5L
+
+#define SN_rsaesOaep "RSAES-OAEP"
+#define LN_rsaesOaep "rsaesOaep"
+#define NID_rsaesOaep 919
+#define OBJ_rsaesOaep OBJ_pkcs1,7L
+
+#define SN_mgf1 "MGF1"
+#define LN_mgf1 "mgf1"
+#define NID_mgf1 911
+#define OBJ_mgf1 OBJ_pkcs1,8L
+
+#define SN_pSpecified "PSPECIFIED"
+#define LN_pSpecified "pSpecified"
+#define NID_pSpecified 935
+#define OBJ_pSpecified OBJ_pkcs1,9L
+
+#define SN_rsassaPss "RSASSA-PSS"
+#define LN_rsassaPss "rsassaPss"
+#define NID_rsassaPss 912
+#define OBJ_rsassaPss OBJ_pkcs1,10L
+
+#define SN_sha256WithRSAEncryption "RSA-SHA256"
+#define LN_sha256WithRSAEncryption "sha256WithRSAEncryption"
+#define NID_sha256WithRSAEncryption 668
+#define OBJ_sha256WithRSAEncryption OBJ_pkcs1,11L
+
+#define SN_sha384WithRSAEncryption "RSA-SHA384"
+#define LN_sha384WithRSAEncryption "sha384WithRSAEncryption"
+#define NID_sha384WithRSAEncryption 669
+#define OBJ_sha384WithRSAEncryption OBJ_pkcs1,12L
+
+#define SN_sha512WithRSAEncryption "RSA-SHA512"
+#define LN_sha512WithRSAEncryption "sha512WithRSAEncryption"
+#define NID_sha512WithRSAEncryption 670
+#define OBJ_sha512WithRSAEncryption OBJ_pkcs1,13L
+
+#define SN_sha224WithRSAEncryption "RSA-SHA224"
+#define LN_sha224WithRSAEncryption "sha224WithRSAEncryption"
+#define NID_sha224WithRSAEncryption 671
+#define OBJ_sha224WithRSAEncryption OBJ_pkcs1,14L
+
+#define SN_pkcs3 "pkcs3"
+#define NID_pkcs3 27
+#define OBJ_pkcs3 OBJ_pkcs,3L
+
+#define LN_dhKeyAgreement "dhKeyAgreement"
+#define NID_dhKeyAgreement 28
+#define OBJ_dhKeyAgreement OBJ_pkcs3,1L
+
+#define SN_pkcs5 "pkcs5"
+#define NID_pkcs5 187
+#define OBJ_pkcs5 OBJ_pkcs,5L
+
+#define SN_pbeWithMD2AndDES_CBC "PBE-MD2-DES"
+#define LN_pbeWithMD2AndDES_CBC "pbeWithMD2AndDES-CBC"
+#define NID_pbeWithMD2AndDES_CBC 9
+#define OBJ_pbeWithMD2AndDES_CBC OBJ_pkcs5,1L
+
+#define SN_pbeWithMD5AndDES_CBC "PBE-MD5-DES"
+#define LN_pbeWithMD5AndDES_CBC "pbeWithMD5AndDES-CBC"
+#define NID_pbeWithMD5AndDES_CBC 10
+#define OBJ_pbeWithMD5AndDES_CBC OBJ_pkcs5,3L
+
+#define SN_pbeWithMD2AndRC2_CBC "PBE-MD2-RC2-64"
+#define LN_pbeWithMD2AndRC2_CBC "pbeWithMD2AndRC2-CBC"
+#define NID_pbeWithMD2AndRC2_CBC 168
+#define OBJ_pbeWithMD2AndRC2_CBC OBJ_pkcs5,4L
+
+#define SN_pbeWithMD5AndRC2_CBC "PBE-MD5-RC2-64"
+#define LN_pbeWithMD5AndRC2_CBC "pbeWithMD5AndRC2-CBC"
+#define NID_pbeWithMD5AndRC2_CBC 169
+#define OBJ_pbeWithMD5AndRC2_CBC OBJ_pkcs5,6L
+
+#define SN_pbeWithSHA1AndDES_CBC "PBE-SHA1-DES"
+#define LN_pbeWithSHA1AndDES_CBC "pbeWithSHA1AndDES-CBC"
+#define NID_pbeWithSHA1AndDES_CBC 170
+#define OBJ_pbeWithSHA1AndDES_CBC OBJ_pkcs5,10L
+
+#define SN_pbeWithSHA1AndRC2_CBC "PBE-SHA1-RC2-64"
+#define LN_pbeWithSHA1AndRC2_CBC "pbeWithSHA1AndRC2-CBC"
+#define NID_pbeWithSHA1AndRC2_CBC 68
+#define OBJ_pbeWithSHA1AndRC2_CBC OBJ_pkcs5,11L
+
+#define LN_id_pbkdf2 "PBKDF2"
+#define NID_id_pbkdf2 69
+#define OBJ_id_pbkdf2 OBJ_pkcs5,12L
+
+#define LN_pbes2 "PBES2"
+#define NID_pbes2 161
+#define OBJ_pbes2 OBJ_pkcs5,13L
+
+#define LN_pbmac1 "PBMAC1"
+#define NID_pbmac1 162
+#define OBJ_pbmac1 OBJ_pkcs5,14L
+
+#define SN_pkcs7 "pkcs7"
+#define NID_pkcs7 20
+#define OBJ_pkcs7 OBJ_pkcs,7L
+
+#define LN_pkcs7_data "pkcs7-data"
+#define NID_pkcs7_data 21
+#define OBJ_pkcs7_data OBJ_pkcs7,1L
+
+#define LN_pkcs7_signed "pkcs7-signedData"
+#define NID_pkcs7_signed 22
+#define OBJ_pkcs7_signed OBJ_pkcs7,2L
+
+#define LN_pkcs7_enveloped "pkcs7-envelopedData"
+#define NID_pkcs7_enveloped 23
+#define OBJ_pkcs7_enveloped OBJ_pkcs7,3L
+
+#define LN_pkcs7_signedAndEnveloped "pkcs7-signedAndEnvelopedData"
+#define NID_pkcs7_signedAndEnveloped 24
+#define OBJ_pkcs7_signedAndEnveloped OBJ_pkcs7,4L
+
+#define LN_pkcs7_digest "pkcs7-digestData"
+#define NID_pkcs7_digest 25
+#define OBJ_pkcs7_digest OBJ_pkcs7,5L
+
+#define LN_pkcs7_encrypted "pkcs7-encryptedData"
+#define NID_pkcs7_encrypted 26
+#define OBJ_pkcs7_encrypted OBJ_pkcs7,6L
+
+#define SN_pkcs9 "pkcs9"
+#define NID_pkcs9 47
+#define OBJ_pkcs9 OBJ_pkcs,9L
+
+#define LN_pkcs9_emailAddress "emailAddress"
+#define NID_pkcs9_emailAddress 48
+#define OBJ_pkcs9_emailAddress OBJ_pkcs9,1L
+
+#define LN_pkcs9_unstructuredName "unstructuredName"
+#define NID_pkcs9_unstructuredName 49
+#define OBJ_pkcs9_unstructuredName OBJ_pkcs9,2L
+
+#define LN_pkcs9_contentType "contentType"
+#define NID_pkcs9_contentType 50
+#define OBJ_pkcs9_contentType OBJ_pkcs9,3L
+
+#define LN_pkcs9_messageDigest "messageDigest"
+#define NID_pkcs9_messageDigest 51
+#define OBJ_pkcs9_messageDigest OBJ_pkcs9,4L
+
+#define LN_pkcs9_signingTime "signingTime"
+#define NID_pkcs9_signingTime 52
+#define OBJ_pkcs9_signingTime OBJ_pkcs9,5L
+
+#define LN_pkcs9_countersignature "countersignature"
+#define NID_pkcs9_countersignature 53
+#define OBJ_pkcs9_countersignature OBJ_pkcs9,6L
+
+#define LN_pkcs9_challengePassword "challengePassword"
+#define NID_pkcs9_challengePassword 54
+#define OBJ_pkcs9_challengePassword OBJ_pkcs9,7L
+
+#define LN_pkcs9_unstructuredAddress "unstructuredAddress"
+#define NID_pkcs9_unstructuredAddress 55
+#define OBJ_pkcs9_unstructuredAddress OBJ_pkcs9,8L
+
+#define LN_pkcs9_extCertAttributes "extendedCertificateAttributes"
+#define NID_pkcs9_extCertAttributes 56
+#define OBJ_pkcs9_extCertAttributes OBJ_pkcs9,9L
+
+#define SN_ext_req "extReq"
+#define LN_ext_req "Extension Request"
+#define NID_ext_req 172
+#define OBJ_ext_req OBJ_pkcs9,14L
+
+#define SN_SMIMECapabilities "SMIME-CAPS"
+#define LN_SMIMECapabilities "S/MIME Capabilities"
+#define NID_SMIMECapabilities 167
+#define OBJ_SMIMECapabilities OBJ_pkcs9,15L
+
+#define SN_SMIME "SMIME"
+#define LN_SMIME "S/MIME"
+#define NID_SMIME 188
+#define OBJ_SMIME OBJ_pkcs9,16L
+
+#define SN_id_smime_mod "id-smime-mod"
+#define NID_id_smime_mod 189
+#define OBJ_id_smime_mod OBJ_SMIME,0L
+
+#define SN_id_smime_ct "id-smime-ct"
+#define NID_id_smime_ct 190
+#define OBJ_id_smime_ct OBJ_SMIME,1L
+
+#define SN_id_smime_aa "id-smime-aa"
+#define NID_id_smime_aa 191
+#define OBJ_id_smime_aa OBJ_SMIME,2L
+
+#define SN_id_smime_alg "id-smime-alg"
+#define NID_id_smime_alg 192
+#define OBJ_id_smime_alg OBJ_SMIME,3L
+
+#define SN_id_smime_cd "id-smime-cd"
+#define NID_id_smime_cd 193
+#define OBJ_id_smime_cd OBJ_SMIME,4L
+
+#define SN_id_smime_spq "id-smime-spq"
+#define NID_id_smime_spq 194
+#define OBJ_id_smime_spq OBJ_SMIME,5L
+
+#define SN_id_smime_cti "id-smime-cti"
+#define NID_id_smime_cti 195
+#define OBJ_id_smime_cti OBJ_SMIME,6L
+
+#define SN_id_smime_mod_cms "id-smime-mod-cms"
+#define NID_id_smime_mod_cms 196
+#define OBJ_id_smime_mod_cms OBJ_id_smime_mod,1L
+
+#define SN_id_smime_mod_ess "id-smime-mod-ess"
+#define NID_id_smime_mod_ess 197
+#define OBJ_id_smime_mod_ess OBJ_id_smime_mod,2L
+
+#define SN_id_smime_mod_oid "id-smime-mod-oid"
+#define NID_id_smime_mod_oid 198
+#define OBJ_id_smime_mod_oid OBJ_id_smime_mod,3L
+
+#define SN_id_smime_mod_msg_v3 "id-smime-mod-msg-v3"
+#define NID_id_smime_mod_msg_v3 199
+#define OBJ_id_smime_mod_msg_v3 OBJ_id_smime_mod,4L
+
+#define SN_id_smime_mod_ets_eSignature_88 "id-smime-mod-ets-eSignature-88"
+#define NID_id_smime_mod_ets_eSignature_88 200
+#define OBJ_id_smime_mod_ets_eSignature_88 OBJ_id_smime_mod,5L
+
+#define SN_id_smime_mod_ets_eSignature_97 "id-smime-mod-ets-eSignature-97"
+#define NID_id_smime_mod_ets_eSignature_97 201
+#define OBJ_id_smime_mod_ets_eSignature_97 OBJ_id_smime_mod,6L
+
+#define SN_id_smime_mod_ets_eSigPolicy_88 "id-smime-mod-ets-eSigPolicy-88"
+#define NID_id_smime_mod_ets_eSigPolicy_88 202
+#define OBJ_id_smime_mod_ets_eSigPolicy_88 OBJ_id_smime_mod,7L
+
+#define SN_id_smime_mod_ets_eSigPolicy_97 "id-smime-mod-ets-eSigPolicy-97"
+#define NID_id_smime_mod_ets_eSigPolicy_97 203
+#define OBJ_id_smime_mod_ets_eSigPolicy_97 OBJ_id_smime_mod,8L
+
+#define SN_id_smime_ct_receipt "id-smime-ct-receipt"
+#define NID_id_smime_ct_receipt 204
+#define OBJ_id_smime_ct_receipt OBJ_id_smime_ct,1L
+
+#define SN_id_smime_ct_authData "id-smime-ct-authData"
+#define NID_id_smime_ct_authData 205
+#define OBJ_id_smime_ct_authData OBJ_id_smime_ct,2L
+
+#define SN_id_smime_ct_publishCert "id-smime-ct-publishCert"
+#define NID_id_smime_ct_publishCert 206
+#define OBJ_id_smime_ct_publishCert OBJ_id_smime_ct,3L
+
+#define SN_id_smime_ct_TSTInfo "id-smime-ct-TSTInfo"
+#define NID_id_smime_ct_TSTInfo 207
+#define OBJ_id_smime_ct_TSTInfo OBJ_id_smime_ct,4L
+
+#define SN_id_smime_ct_TDTInfo "id-smime-ct-TDTInfo"
+#define NID_id_smime_ct_TDTInfo 208
+#define OBJ_id_smime_ct_TDTInfo OBJ_id_smime_ct,5L
+
+#define SN_id_smime_ct_contentInfo "id-smime-ct-contentInfo"
+#define NID_id_smime_ct_contentInfo 209
+#define OBJ_id_smime_ct_contentInfo OBJ_id_smime_ct,6L
+
+#define SN_id_smime_ct_DVCSRequestData "id-smime-ct-DVCSRequestData"
+#define NID_id_smime_ct_DVCSRequestData 210
+#define OBJ_id_smime_ct_DVCSRequestData OBJ_id_smime_ct,7L
+
+#define SN_id_smime_ct_DVCSResponseData "id-smime-ct-DVCSResponseData"
+#define NID_id_smime_ct_DVCSResponseData 211
+#define OBJ_id_smime_ct_DVCSResponseData OBJ_id_smime_ct,8L
+
+#define SN_id_smime_ct_compressedData "id-smime-ct-compressedData"
+#define NID_id_smime_ct_compressedData 786
+#define OBJ_id_smime_ct_compressedData OBJ_id_smime_ct,9L
+
+#define SN_id_ct_asciiTextWithCRLF "id-ct-asciiTextWithCRLF"
+#define NID_id_ct_asciiTextWithCRLF 787
+#define OBJ_id_ct_asciiTextWithCRLF OBJ_id_smime_ct,27L
+
+#define SN_id_smime_aa_receiptRequest "id-smime-aa-receiptRequest"
+#define NID_id_smime_aa_receiptRequest 212
+#define OBJ_id_smime_aa_receiptRequest OBJ_id_smime_aa,1L
+
+#define SN_id_smime_aa_securityLabel "id-smime-aa-securityLabel"
+#define NID_id_smime_aa_securityLabel 213
+#define OBJ_id_smime_aa_securityLabel OBJ_id_smime_aa,2L
+
+#define SN_id_smime_aa_mlExpandHistory "id-smime-aa-mlExpandHistory"
+#define NID_id_smime_aa_mlExpandHistory 214
+#define OBJ_id_smime_aa_mlExpandHistory OBJ_id_smime_aa,3L
+
+#define SN_id_smime_aa_contentHint "id-smime-aa-contentHint"
+#define NID_id_smime_aa_contentHint 215
+#define OBJ_id_smime_aa_contentHint OBJ_id_smime_aa,4L
+
+#define SN_id_smime_aa_msgSigDigest "id-smime-aa-msgSigDigest"
+#define NID_id_smime_aa_msgSigDigest 216
+#define OBJ_id_smime_aa_msgSigDigest OBJ_id_smime_aa,5L
+
+#define SN_id_smime_aa_encapContentType "id-smime-aa-encapContentType"
+#define NID_id_smime_aa_encapContentType 217
+#define OBJ_id_smime_aa_encapContentType OBJ_id_smime_aa,6L
+
+#define SN_id_smime_aa_contentIdentifier "id-smime-aa-contentIdentifier"
+#define NID_id_smime_aa_contentIdentifier 218
+#define OBJ_id_smime_aa_contentIdentifier OBJ_id_smime_aa,7L
+
+#define SN_id_smime_aa_macValue "id-smime-aa-macValue"
+#define NID_id_smime_aa_macValue 219
+#define OBJ_id_smime_aa_macValue OBJ_id_smime_aa,8L
+
+#define SN_id_smime_aa_equivalentLabels "id-smime-aa-equivalentLabels"
+#define NID_id_smime_aa_equivalentLabels 220
+#define OBJ_id_smime_aa_equivalentLabels OBJ_id_smime_aa,9L
+
+#define SN_id_smime_aa_contentReference "id-smime-aa-contentReference"
+#define NID_id_smime_aa_contentReference 221
+#define OBJ_id_smime_aa_contentReference OBJ_id_smime_aa,10L
+
+#define SN_id_smime_aa_encrypKeyPref "id-smime-aa-encrypKeyPref"
+#define NID_id_smime_aa_encrypKeyPref 222
+#define OBJ_id_smime_aa_encrypKeyPref OBJ_id_smime_aa,11L
+
+#define SN_id_smime_aa_signingCertificate "id-smime-aa-signingCertificate"
+#define NID_id_smime_aa_signingCertificate 223
+#define OBJ_id_smime_aa_signingCertificate OBJ_id_smime_aa,12L
+
+#define SN_id_smime_aa_smimeEncryptCerts "id-smime-aa-smimeEncryptCerts"
+#define NID_id_smime_aa_smimeEncryptCerts 224
+#define OBJ_id_smime_aa_smimeEncryptCerts OBJ_id_smime_aa,13L
+
+#define SN_id_smime_aa_timeStampToken "id-smime-aa-timeStampToken"
+#define NID_id_smime_aa_timeStampToken 225
+#define OBJ_id_smime_aa_timeStampToken OBJ_id_smime_aa,14L
+
+#define SN_id_smime_aa_ets_sigPolicyId "id-smime-aa-ets-sigPolicyId"
+#define NID_id_smime_aa_ets_sigPolicyId 226
+#define OBJ_id_smime_aa_ets_sigPolicyId OBJ_id_smime_aa,15L
+
+#define SN_id_smime_aa_ets_commitmentType "id-smime-aa-ets-commitmentType"
+#define NID_id_smime_aa_ets_commitmentType 227
+#define OBJ_id_smime_aa_ets_commitmentType OBJ_id_smime_aa,16L
+
+#define SN_id_smime_aa_ets_signerLocation "id-smime-aa-ets-signerLocation"
+#define NID_id_smime_aa_ets_signerLocation 228
+#define OBJ_id_smime_aa_ets_signerLocation OBJ_id_smime_aa,17L
+
+#define SN_id_smime_aa_ets_signerAttr "id-smime-aa-ets-signerAttr"
+#define NID_id_smime_aa_ets_signerAttr 229
+#define OBJ_id_smime_aa_ets_signerAttr OBJ_id_smime_aa,18L
+
+#define SN_id_smime_aa_ets_otherSigCert "id-smime-aa-ets-otherSigCert"
+#define NID_id_smime_aa_ets_otherSigCert 230
+#define OBJ_id_smime_aa_ets_otherSigCert OBJ_id_smime_aa,19L
+
+#define SN_id_smime_aa_ets_contentTimestamp "id-smime-aa-ets-contentTimestamp"
+#define NID_id_smime_aa_ets_contentTimestamp 231
+#define OBJ_id_smime_aa_ets_contentTimestamp OBJ_id_smime_aa,20L
+
+#define SN_id_smime_aa_ets_CertificateRefs "id-smime-aa-ets-CertificateRefs"
+#define NID_id_smime_aa_ets_CertificateRefs 232
+#define OBJ_id_smime_aa_ets_CertificateRefs OBJ_id_smime_aa,21L
+
+#define SN_id_smime_aa_ets_RevocationRefs "id-smime-aa-ets-RevocationRefs"
+#define NID_id_smime_aa_ets_RevocationRefs 233
+#define OBJ_id_smime_aa_ets_RevocationRefs OBJ_id_smime_aa,22L
+
+#define SN_id_smime_aa_ets_certValues "id-smime-aa-ets-certValues"
+#define NID_id_smime_aa_ets_certValues 234
+#define OBJ_id_smime_aa_ets_certValues OBJ_id_smime_aa,23L
+
+#define SN_id_smime_aa_ets_revocationValues "id-smime-aa-ets-revocationValues"
+#define NID_id_smime_aa_ets_revocationValues 235
+#define OBJ_id_smime_aa_ets_revocationValues OBJ_id_smime_aa,24L
+
+#define SN_id_smime_aa_ets_escTimeStamp "id-smime-aa-ets-escTimeStamp"
+#define NID_id_smime_aa_ets_escTimeStamp 236
+#define OBJ_id_smime_aa_ets_escTimeStamp OBJ_id_smime_aa,25L
+
+#define SN_id_smime_aa_ets_certCRLTimestamp "id-smime-aa-ets-certCRLTimestamp"
+#define NID_id_smime_aa_ets_certCRLTimestamp 237
+#define OBJ_id_smime_aa_ets_certCRLTimestamp OBJ_id_smime_aa,26L
+
+#define SN_id_smime_aa_ets_archiveTimeStamp "id-smime-aa-ets-archiveTimeStamp"
+#define NID_id_smime_aa_ets_archiveTimeStamp 238
+#define OBJ_id_smime_aa_ets_archiveTimeStamp OBJ_id_smime_aa,27L
+
+#define SN_id_smime_aa_signatureType "id-smime-aa-signatureType"
+#define NID_id_smime_aa_signatureType 239
+#define OBJ_id_smime_aa_signatureType OBJ_id_smime_aa,28L
+
+#define SN_id_smime_aa_dvcs_dvc "id-smime-aa-dvcs-dvc"
+#define NID_id_smime_aa_dvcs_dvc 240
+#define OBJ_id_smime_aa_dvcs_dvc OBJ_id_smime_aa,29L
+
+#define SN_id_smime_alg_ESDHwith3DES "id-smime-alg-ESDHwith3DES"
+#define NID_id_smime_alg_ESDHwith3DES 241
+#define OBJ_id_smime_alg_ESDHwith3DES OBJ_id_smime_alg,1L
+
+#define SN_id_smime_alg_ESDHwithRC2 "id-smime-alg-ESDHwithRC2"
+#define NID_id_smime_alg_ESDHwithRC2 242
+#define OBJ_id_smime_alg_ESDHwithRC2 OBJ_id_smime_alg,2L
+
+#define SN_id_smime_alg_3DESwrap "id-smime-alg-3DESwrap"
+#define NID_id_smime_alg_3DESwrap 243
+#define OBJ_id_smime_alg_3DESwrap OBJ_id_smime_alg,3L
+
+#define SN_id_smime_alg_RC2wrap "id-smime-alg-RC2wrap"
+#define NID_id_smime_alg_RC2wrap 244
+#define OBJ_id_smime_alg_RC2wrap OBJ_id_smime_alg,4L
+
+#define SN_id_smime_alg_ESDH "id-smime-alg-ESDH"
+#define NID_id_smime_alg_ESDH 245
+#define OBJ_id_smime_alg_ESDH OBJ_id_smime_alg,5L
+
+#define SN_id_smime_alg_CMS3DESwrap "id-smime-alg-CMS3DESwrap"
+#define NID_id_smime_alg_CMS3DESwrap 246
+#define OBJ_id_smime_alg_CMS3DESwrap OBJ_id_smime_alg,6L
+
+#define SN_id_smime_alg_CMSRC2wrap "id-smime-alg-CMSRC2wrap"
+#define NID_id_smime_alg_CMSRC2wrap 247
+#define OBJ_id_smime_alg_CMSRC2wrap OBJ_id_smime_alg,7L
+
+#define SN_id_alg_PWRI_KEK "id-alg-PWRI-KEK"
+#define NID_id_alg_PWRI_KEK 893
+#define OBJ_id_alg_PWRI_KEK OBJ_id_smime_alg,9L
+
+#define SN_id_smime_cd_ldap "id-smime-cd-ldap"
+#define NID_id_smime_cd_ldap 248
+#define OBJ_id_smime_cd_ldap OBJ_id_smime_cd,1L
+
+#define SN_id_smime_spq_ets_sqt_uri "id-smime-spq-ets-sqt-uri"
+#define NID_id_smime_spq_ets_sqt_uri 249
+#define OBJ_id_smime_spq_ets_sqt_uri OBJ_id_smime_spq,1L
+
+#define SN_id_smime_spq_ets_sqt_unotice "id-smime-spq-ets-sqt-unotice"
+#define NID_id_smime_spq_ets_sqt_unotice 250
+#define OBJ_id_smime_spq_ets_sqt_unotice OBJ_id_smime_spq,2L
+
+#define SN_id_smime_cti_ets_proofOfOrigin "id-smime-cti-ets-proofOfOrigin"
+#define NID_id_smime_cti_ets_proofOfOrigin 251
+#define OBJ_id_smime_cti_ets_proofOfOrigin OBJ_id_smime_cti,1L
+
+#define SN_id_smime_cti_ets_proofOfReceipt "id-smime-cti-ets-proofOfReceipt"
+#define NID_id_smime_cti_ets_proofOfReceipt 252
+#define OBJ_id_smime_cti_ets_proofOfReceipt OBJ_id_smime_cti,2L
+
+#define SN_id_smime_cti_ets_proofOfDelivery "id-smime-cti-ets-proofOfDelivery"
+#define NID_id_smime_cti_ets_proofOfDelivery 253
+#define OBJ_id_smime_cti_ets_proofOfDelivery OBJ_id_smime_cti,3L
+
+#define SN_id_smime_cti_ets_proofOfSender "id-smime-cti-ets-proofOfSender"
+#define NID_id_smime_cti_ets_proofOfSender 254
+#define OBJ_id_smime_cti_ets_proofOfSender OBJ_id_smime_cti,4L
+
+#define SN_id_smime_cti_ets_proofOfApproval "id-smime-cti-ets-proofOfApproval"
+#define NID_id_smime_cti_ets_proofOfApproval 255
+#define OBJ_id_smime_cti_ets_proofOfApproval OBJ_id_smime_cti,5L
+
+#define SN_id_smime_cti_ets_proofOfCreation "id-smime-cti-ets-proofOfCreation"
+#define NID_id_smime_cti_ets_proofOfCreation 256
+#define OBJ_id_smime_cti_ets_proofOfCreation OBJ_id_smime_cti,6L
+
+#define LN_friendlyName "friendlyName"
+#define NID_friendlyName 156
+#define OBJ_friendlyName OBJ_pkcs9,20L
+
+#define LN_localKeyID "localKeyID"
+#define NID_localKeyID 157
+#define OBJ_localKeyID OBJ_pkcs9,21L
+
+#define SN_ms_csp_name "CSPName"
+#define LN_ms_csp_name "Microsoft CSP Name"
+#define NID_ms_csp_name 417
+#define OBJ_ms_csp_name 1L,3L,6L,1L,4L,1L,311L,17L,1L
+
+#define SN_LocalKeySet "LocalKeySet"
+#define LN_LocalKeySet "Microsoft Local Key set"
+#define NID_LocalKeySet 856
+#define OBJ_LocalKeySet 1L,3L,6L,1L,4L,1L,311L,17L,2L
+
+#define OBJ_certTypes OBJ_pkcs9,22L
+
+#define LN_x509Certificate "x509Certificate"
+#define NID_x509Certificate 158
+#define OBJ_x509Certificate OBJ_certTypes,1L
+
+#define LN_sdsiCertificate "sdsiCertificate"
+#define NID_sdsiCertificate 159
+#define OBJ_sdsiCertificate OBJ_certTypes,2L
+
+#define OBJ_crlTypes OBJ_pkcs9,23L
+
+#define LN_x509Crl "x509Crl"
+#define NID_x509Crl 160
+#define OBJ_x509Crl OBJ_crlTypes,1L
+
+#define OBJ_pkcs12 OBJ_pkcs,12L
+
+#define OBJ_pkcs12_pbeids OBJ_pkcs12,1L
+
+#define SN_pbe_WithSHA1And128BitRC4 "PBE-SHA1-RC4-128"
+#define LN_pbe_WithSHA1And128BitRC4 "pbeWithSHA1And128BitRC4"
+#define NID_pbe_WithSHA1And128BitRC4 144
+#define OBJ_pbe_WithSHA1And128BitRC4 OBJ_pkcs12_pbeids,1L
+
+#define SN_pbe_WithSHA1And40BitRC4 "PBE-SHA1-RC4-40"
+#define LN_pbe_WithSHA1And40BitRC4 "pbeWithSHA1And40BitRC4"
+#define NID_pbe_WithSHA1And40BitRC4 145
+#define OBJ_pbe_WithSHA1And40BitRC4 OBJ_pkcs12_pbeids,2L
+
+#define SN_pbe_WithSHA1And3_Key_TripleDES_CBC "PBE-SHA1-3DES"
+#define LN_pbe_WithSHA1And3_Key_TripleDES_CBC "pbeWithSHA1And3-KeyTripleDES-CBC"
+#define NID_pbe_WithSHA1And3_Key_TripleDES_CBC 146
+#define OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC OBJ_pkcs12_pbeids,3L
+
+#define SN_pbe_WithSHA1And2_Key_TripleDES_CBC "PBE-SHA1-2DES"
+#define LN_pbe_WithSHA1And2_Key_TripleDES_CBC "pbeWithSHA1And2-KeyTripleDES-CBC"
+#define NID_pbe_WithSHA1And2_Key_TripleDES_CBC 147
+#define OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC OBJ_pkcs12_pbeids,4L
+
+#define SN_pbe_WithSHA1And128BitRC2_CBC "PBE-SHA1-RC2-128"
+#define LN_pbe_WithSHA1And128BitRC2_CBC "pbeWithSHA1And128BitRC2-CBC"
+#define NID_pbe_WithSHA1And128BitRC2_CBC 148
+#define OBJ_pbe_WithSHA1And128BitRC2_CBC OBJ_pkcs12_pbeids,5L
+
+#define SN_pbe_WithSHA1And40BitRC2_CBC "PBE-SHA1-RC2-40"
+#define LN_pbe_WithSHA1And40BitRC2_CBC "pbeWithSHA1And40BitRC2-CBC"
+#define NID_pbe_WithSHA1And40BitRC2_CBC 149
+#define OBJ_pbe_WithSHA1And40BitRC2_CBC OBJ_pkcs12_pbeids,6L
+
+#define OBJ_pkcs12_Version1 OBJ_pkcs12,10L
+
+#define OBJ_pkcs12_BagIds OBJ_pkcs12_Version1,1L
+
+#define LN_keyBag "keyBag"
+#define NID_keyBag 150
+#define OBJ_keyBag OBJ_pkcs12_BagIds,1L
+
+#define LN_pkcs8ShroudedKeyBag "pkcs8ShroudedKeyBag"
+#define NID_pkcs8ShroudedKeyBag 151
+#define OBJ_pkcs8ShroudedKeyBag OBJ_pkcs12_BagIds,2L
+
+#define LN_certBag "certBag"
+#define NID_certBag 152
+#define OBJ_certBag OBJ_pkcs12_BagIds,3L
+
+#define LN_crlBag "crlBag"
+#define NID_crlBag 153
+#define OBJ_crlBag OBJ_pkcs12_BagIds,4L
+
+#define LN_secretBag "secretBag"
+#define NID_secretBag 154
+#define OBJ_secretBag OBJ_pkcs12_BagIds,5L
+
+#define LN_safeContentsBag "safeContentsBag"
+#define NID_safeContentsBag 155
+#define OBJ_safeContentsBag OBJ_pkcs12_BagIds,6L
+
+#define SN_md2 "MD2"
+#define LN_md2 "md2"
+#define NID_md2 3
+#define OBJ_md2 OBJ_rsadsi,2L,2L
+
+#define SN_md4 "MD4"
+#define LN_md4 "md4"
+#define NID_md4 257
+#define OBJ_md4 OBJ_rsadsi,2L,4L
+
+#define SN_md5 "MD5"
+#define LN_md5 "md5"
+#define NID_md5 4
+#define OBJ_md5 OBJ_rsadsi,2L,5L
+
+#define SN_md5_sha1 "MD5-SHA1"
+#define LN_md5_sha1 "md5-sha1"
+#define NID_md5_sha1 114
+
+#define LN_hmacWithMD5 "hmacWithMD5"
+#define NID_hmacWithMD5 797
+#define OBJ_hmacWithMD5 OBJ_rsadsi,2L,6L
+
+#define LN_hmacWithSHA1 "hmacWithSHA1"
+#define NID_hmacWithSHA1 163
+#define OBJ_hmacWithSHA1 OBJ_rsadsi,2L,7L
+
+#define LN_hmacWithSHA224 "hmacWithSHA224"
+#define NID_hmacWithSHA224 798
+#define OBJ_hmacWithSHA224 OBJ_rsadsi,2L,8L
+
+#define LN_hmacWithSHA256 "hmacWithSHA256"
+#define NID_hmacWithSHA256 799
+#define OBJ_hmacWithSHA256 OBJ_rsadsi,2L,9L
+
+#define LN_hmacWithSHA384 "hmacWithSHA384"
+#define NID_hmacWithSHA384 800
+#define OBJ_hmacWithSHA384 OBJ_rsadsi,2L,10L
+
+#define LN_hmacWithSHA512 "hmacWithSHA512"
+#define NID_hmacWithSHA512 801
+#define OBJ_hmacWithSHA512 OBJ_rsadsi,2L,11L
+
+#define SN_rc2_cbc "RC2-CBC"
+#define LN_rc2_cbc "rc2-cbc"
+#define NID_rc2_cbc 37
+#define OBJ_rc2_cbc OBJ_rsadsi,3L,2L
+
+#define SN_rc2_ecb "RC2-ECB"
+#define LN_rc2_ecb "rc2-ecb"
+#define NID_rc2_ecb 38
+
+#define SN_rc2_cfb64 "RC2-CFB"
+#define LN_rc2_cfb64 "rc2-cfb"
+#define NID_rc2_cfb64 39
+
+#define SN_rc2_ofb64 "RC2-OFB"
+#define LN_rc2_ofb64 "rc2-ofb"
+#define NID_rc2_ofb64 40
+
+#define SN_rc2_40_cbc "RC2-40-CBC"
+#define LN_rc2_40_cbc "rc2-40-cbc"
+#define NID_rc2_40_cbc 98
+
+#define SN_rc2_64_cbc "RC2-64-CBC"
+#define LN_rc2_64_cbc "rc2-64-cbc"
+#define NID_rc2_64_cbc 166
+
+#define SN_rc4 "RC4"
+#define LN_rc4 "rc4"
+#define NID_rc4 5
+#define OBJ_rc4 OBJ_rsadsi,3L,4L
+
+#define SN_rc4_40 "RC4-40"
+#define LN_rc4_40 "rc4-40"
+#define NID_rc4_40 97
+
+#define SN_des_ede3_cbc "DES-EDE3-CBC"
+#define LN_des_ede3_cbc "des-ede3-cbc"
+#define NID_des_ede3_cbc 44
+#define OBJ_des_ede3_cbc OBJ_rsadsi,3L,7L
+
+#define SN_rc5_cbc "RC5-CBC"
+#define LN_rc5_cbc "rc5-cbc"
+#define NID_rc5_cbc 120
+#define OBJ_rc5_cbc OBJ_rsadsi,3L,8L
+
+#define SN_rc5_ecb "RC5-ECB"
+#define LN_rc5_ecb "rc5-ecb"
+#define NID_rc5_ecb 121
+
+#define SN_rc5_cfb64 "RC5-CFB"
+#define LN_rc5_cfb64 "rc5-cfb"
+#define NID_rc5_cfb64 122
+
+#define SN_rc5_ofb64 "RC5-OFB"
+#define LN_rc5_ofb64 "rc5-ofb"
+#define NID_rc5_ofb64 123
+
+#define SN_ms_ext_req "msExtReq"
+#define LN_ms_ext_req "Microsoft Extension Request"
+#define NID_ms_ext_req 171
+#define OBJ_ms_ext_req 1L,3L,6L,1L,4L,1L,311L,2L,1L,14L
+
+#define SN_ms_code_ind "msCodeInd"
+#define LN_ms_code_ind "Microsoft Individual Code Signing"
+#define NID_ms_code_ind 134
+#define OBJ_ms_code_ind 1L,3L,6L,1L,4L,1L,311L,2L,1L,21L
+
+#define SN_ms_code_com "msCodeCom"
+#define LN_ms_code_com "Microsoft Commercial Code Signing"
+#define NID_ms_code_com 135
+#define OBJ_ms_code_com 1L,3L,6L,1L,4L,1L,311L,2L,1L,22L
+
+#define SN_ms_ctl_sign "msCTLSign"
+#define LN_ms_ctl_sign "Microsoft Trust List Signing"
+#define NID_ms_ctl_sign 136
+#define OBJ_ms_ctl_sign 1L,3L,6L,1L,4L,1L,311L,10L,3L,1L
+
+#define SN_ms_sgc "msSGC"
+#define LN_ms_sgc "Microsoft Server Gated Crypto"
+#define NID_ms_sgc 137
+#define OBJ_ms_sgc 1L,3L,6L,1L,4L,1L,311L,10L,3L,3L
+
+#define SN_ms_efs "msEFS"
+#define LN_ms_efs "Microsoft Encrypted File System"
+#define NID_ms_efs 138
+#define OBJ_ms_efs 1L,3L,6L,1L,4L,1L,311L,10L,3L,4L
+
+#define SN_ms_smartcard_login "msSmartcardLogin"
+#define LN_ms_smartcard_login "Microsoft Smartcardlogin"
+#define NID_ms_smartcard_login 648
+#define OBJ_ms_smartcard_login 1L,3L,6L,1L,4L,1L,311L,20L,2L,2L
+
+#define SN_ms_upn "msUPN"
+#define LN_ms_upn "Microsoft Universal Principal Name"
+#define NID_ms_upn 649
+#define OBJ_ms_upn 1L,3L,6L,1L,4L,1L,311L,20L,2L,3L
+
+#define SN_idea_cbc "IDEA-CBC"
+#define LN_idea_cbc "idea-cbc"
+#define NID_idea_cbc 34
+#define OBJ_idea_cbc 1L,3L,6L,1L,4L,1L,188L,7L,1L,1L,2L
+
+#define SN_idea_ecb "IDEA-ECB"
+#define LN_idea_ecb "idea-ecb"
+#define NID_idea_ecb 36
+
+#define SN_idea_cfb64 "IDEA-CFB"
+#define LN_idea_cfb64 "idea-cfb"
+#define NID_idea_cfb64 35
+
+#define SN_idea_ofb64 "IDEA-OFB"
+#define LN_idea_ofb64 "idea-ofb"
+#define NID_idea_ofb64 46
+
+#define SN_bf_cbc "BF-CBC"
+#define LN_bf_cbc "bf-cbc"
+#define NID_bf_cbc 91
+#define OBJ_bf_cbc 1L,3L,6L,1L,4L,1L,3029L,1L,2L
+
+#define SN_bf_ecb "BF-ECB"
+#define LN_bf_ecb "bf-ecb"
+#define NID_bf_ecb 92
+
+#define SN_bf_cfb64 "BF-CFB"
+#define LN_bf_cfb64 "bf-cfb"
+#define NID_bf_cfb64 93
+
+#define SN_bf_ofb64 "BF-OFB"
+#define LN_bf_ofb64 "bf-ofb"
+#define NID_bf_ofb64 94
+
+#define SN_id_pkix "PKIX"
+#define NID_id_pkix 127
+#define OBJ_id_pkix 1L,3L,6L,1L,5L,5L,7L
+
+#define SN_id_pkix_mod "id-pkix-mod"
+#define NID_id_pkix_mod 258
+#define OBJ_id_pkix_mod OBJ_id_pkix,0L
+
+#define SN_id_pe "id-pe"
+#define NID_id_pe 175
+#define OBJ_id_pe OBJ_id_pkix,1L
+
+#define SN_id_qt "id-qt"
+#define NID_id_qt 259
+#define OBJ_id_qt OBJ_id_pkix,2L
+
+#define SN_id_kp "id-kp"
+#define NID_id_kp 128
+#define OBJ_id_kp OBJ_id_pkix,3L
+
+#define SN_id_it "id-it"
+#define NID_id_it 260
+#define OBJ_id_it OBJ_id_pkix,4L
+
+#define SN_id_pkip "id-pkip"
+#define NID_id_pkip 261
+#define OBJ_id_pkip OBJ_id_pkix,5L
+
+#define SN_id_alg "id-alg"
+#define NID_id_alg 262
+#define OBJ_id_alg OBJ_id_pkix,6L
+
+#define SN_id_cmc "id-cmc"
+#define NID_id_cmc 263
+#define OBJ_id_cmc OBJ_id_pkix,7L
+
+#define SN_id_on "id-on"
+#define NID_id_on 264
+#define OBJ_id_on OBJ_id_pkix,8L
+
+#define SN_id_pda "id-pda"
+#define NID_id_pda 265
+#define OBJ_id_pda OBJ_id_pkix,9L
+
+#define SN_id_aca "id-aca"
+#define NID_id_aca 266
+#define OBJ_id_aca OBJ_id_pkix,10L
+
+#define SN_id_qcs "id-qcs"
+#define NID_id_qcs 267
+#define OBJ_id_qcs OBJ_id_pkix,11L
+
+#define SN_id_cct "id-cct"
+#define NID_id_cct 268
+#define OBJ_id_cct OBJ_id_pkix,12L
+
+#define SN_id_ppl "id-ppl"
+#define NID_id_ppl 662
+#define OBJ_id_ppl OBJ_id_pkix,21L
+
+#define SN_id_ad "id-ad"
+#define NID_id_ad 176
+#define OBJ_id_ad OBJ_id_pkix,48L
+
+#define SN_id_pkix1_explicit_88 "id-pkix1-explicit-88"
+#define NID_id_pkix1_explicit_88 269
+#define OBJ_id_pkix1_explicit_88 OBJ_id_pkix_mod,1L
+
+#define SN_id_pkix1_implicit_88 "id-pkix1-implicit-88"
+#define NID_id_pkix1_implicit_88 270
+#define OBJ_id_pkix1_implicit_88 OBJ_id_pkix_mod,2L
+
+#define SN_id_pkix1_explicit_93 "id-pkix1-explicit-93"
+#define NID_id_pkix1_explicit_93 271
+#define OBJ_id_pkix1_explicit_93 OBJ_id_pkix_mod,3L
+
+#define SN_id_pkix1_implicit_93 "id-pkix1-implicit-93"
+#define NID_id_pkix1_implicit_93 272
+#define OBJ_id_pkix1_implicit_93 OBJ_id_pkix_mod,4L
+
+#define SN_id_mod_crmf "id-mod-crmf"
+#define NID_id_mod_crmf 273
+#define OBJ_id_mod_crmf OBJ_id_pkix_mod,5L
+
+#define SN_id_mod_cmc "id-mod-cmc"
+#define NID_id_mod_cmc 274
+#define OBJ_id_mod_cmc OBJ_id_pkix_mod,6L
+
+#define SN_id_mod_kea_profile_88 "id-mod-kea-profile-88"
+#define NID_id_mod_kea_profile_88 275
+#define OBJ_id_mod_kea_profile_88 OBJ_id_pkix_mod,7L
+
+#define SN_id_mod_kea_profile_93 "id-mod-kea-profile-93"
+#define NID_id_mod_kea_profile_93 276
+#define OBJ_id_mod_kea_profile_93 OBJ_id_pkix_mod,8L
+
+#define SN_id_mod_cmp "id-mod-cmp"
+#define NID_id_mod_cmp 277
+#define OBJ_id_mod_cmp OBJ_id_pkix_mod,9L
+
+#define SN_id_mod_qualified_cert_88 "id-mod-qualified-cert-88"
+#define NID_id_mod_qualified_cert_88 278
+#define OBJ_id_mod_qualified_cert_88 OBJ_id_pkix_mod,10L
+
+#define SN_id_mod_qualified_cert_93 "id-mod-qualified-cert-93"
+#define NID_id_mod_qualified_cert_93 279
+#define OBJ_id_mod_qualified_cert_93 OBJ_id_pkix_mod,11L
+
+#define SN_id_mod_attribute_cert "id-mod-attribute-cert"
+#define NID_id_mod_attribute_cert 280
+#define OBJ_id_mod_attribute_cert OBJ_id_pkix_mod,12L
+
+#define SN_id_mod_timestamp_protocol "id-mod-timestamp-protocol"
+#define NID_id_mod_timestamp_protocol 281
+#define OBJ_id_mod_timestamp_protocol OBJ_id_pkix_mod,13L
+
+#define SN_id_mod_ocsp "id-mod-ocsp"
+#define NID_id_mod_ocsp 282
+#define OBJ_id_mod_ocsp OBJ_id_pkix_mod,14L
+
+#define SN_id_mod_dvcs "id-mod-dvcs"
+#define NID_id_mod_dvcs 283
+#define OBJ_id_mod_dvcs OBJ_id_pkix_mod,15L
+
+#define SN_id_mod_cmp2000 "id-mod-cmp2000"
+#define NID_id_mod_cmp2000 284
+#define OBJ_id_mod_cmp2000 OBJ_id_pkix_mod,16L
+
+#define SN_info_access "authorityInfoAccess"
+#define LN_info_access "Authority Information Access"
+#define NID_info_access 177
+#define OBJ_info_access OBJ_id_pe,1L
+
+#define SN_biometricInfo "biometricInfo"
+#define LN_biometricInfo "Biometric Info"
+#define NID_biometricInfo 285
+#define OBJ_biometricInfo OBJ_id_pe,2L
+
+#define SN_qcStatements "qcStatements"
+#define NID_qcStatements 286
+#define OBJ_qcStatements OBJ_id_pe,3L
+
+#define SN_ac_auditEntity "ac-auditEntity"
+#define NID_ac_auditEntity 287
+#define OBJ_ac_auditEntity OBJ_id_pe,4L
+
+#define SN_ac_targeting "ac-targeting"
+#define NID_ac_targeting 288
+#define OBJ_ac_targeting OBJ_id_pe,5L
+
+#define SN_aaControls "aaControls"
+#define NID_aaControls 289
+#define OBJ_aaControls OBJ_id_pe,6L
+
+#define SN_sbgp_ipAddrBlock "sbgp-ipAddrBlock"
+#define NID_sbgp_ipAddrBlock 290
+#define OBJ_sbgp_ipAddrBlock OBJ_id_pe,7L
+
+#define SN_sbgp_autonomousSysNum "sbgp-autonomousSysNum"
+#define NID_sbgp_autonomousSysNum 291
+#define OBJ_sbgp_autonomousSysNum OBJ_id_pe,8L
+
+#define SN_sbgp_routerIdentifier "sbgp-routerIdentifier"
+#define NID_sbgp_routerIdentifier 292
+#define OBJ_sbgp_routerIdentifier OBJ_id_pe,9L
+
+#define SN_ac_proxying "ac-proxying"
+#define NID_ac_proxying 397
+#define OBJ_ac_proxying OBJ_id_pe,10L
+
+#define SN_sinfo_access "subjectInfoAccess"
+#define LN_sinfo_access "Subject Information Access"
+#define NID_sinfo_access 398
+#define OBJ_sinfo_access OBJ_id_pe,11L
+
+#define SN_proxyCertInfo "proxyCertInfo"
+#define LN_proxyCertInfo "Proxy Certificate Information"
+#define NID_proxyCertInfo 663
+#define OBJ_proxyCertInfo OBJ_id_pe,14L
+
+#define SN_id_qt_cps "id-qt-cps"
+#define LN_id_qt_cps "Policy Qualifier CPS"
+#define NID_id_qt_cps 164
+#define OBJ_id_qt_cps OBJ_id_qt,1L
+
+#define SN_id_qt_unotice "id-qt-unotice"
+#define LN_id_qt_unotice "Policy Qualifier User Notice"
+#define NID_id_qt_unotice 165
+#define OBJ_id_qt_unotice OBJ_id_qt,2L
+
+#define SN_textNotice "textNotice"
+#define NID_textNotice 293
+#define OBJ_textNotice OBJ_id_qt,3L
+
+#define SN_server_auth "serverAuth"
+#define LN_server_auth "TLS Web Server Authentication"
+#define NID_server_auth 129
+#define OBJ_server_auth OBJ_id_kp,1L
+
+#define SN_client_auth "clientAuth"
+#define LN_client_auth "TLS Web Client Authentication"
+#define NID_client_auth 130
+#define OBJ_client_auth OBJ_id_kp,2L
+
+#define SN_code_sign "codeSigning"
+#define LN_code_sign "Code Signing"
+#define NID_code_sign 131
+#define OBJ_code_sign OBJ_id_kp,3L
+
+#define SN_email_protect "emailProtection"
+#define LN_email_protect "E-mail Protection"
+#define NID_email_protect 132
+#define OBJ_email_protect OBJ_id_kp,4L
+
+#define SN_ipsecEndSystem "ipsecEndSystem"
+#define LN_ipsecEndSystem "IPSec End System"
+#define NID_ipsecEndSystem 294
+#define OBJ_ipsecEndSystem OBJ_id_kp,5L
+
+#define SN_ipsecTunnel "ipsecTunnel"
+#define LN_ipsecTunnel "IPSec Tunnel"
+#define NID_ipsecTunnel 295
+#define OBJ_ipsecTunnel OBJ_id_kp,6L
+
+#define SN_ipsecUser "ipsecUser"
+#define LN_ipsecUser "IPSec User"
+#define NID_ipsecUser 296
+#define OBJ_ipsecUser OBJ_id_kp,7L
+
+#define SN_time_stamp "timeStamping"
+#define LN_time_stamp "Time Stamping"
+#define NID_time_stamp 133
+#define OBJ_time_stamp OBJ_id_kp,8L
+
+#define SN_OCSP_sign "OCSPSigning"
+#define LN_OCSP_sign "OCSP Signing"
+#define NID_OCSP_sign 180
+#define OBJ_OCSP_sign OBJ_id_kp,9L
+
+#define SN_dvcs "DVCS"
+#define LN_dvcs "dvcs"
+#define NID_dvcs 297
+#define OBJ_dvcs OBJ_id_kp,10L
+
+#define SN_id_it_caProtEncCert "id-it-caProtEncCert"
+#define NID_id_it_caProtEncCert 298
+#define OBJ_id_it_caProtEncCert OBJ_id_it,1L
+
+#define SN_id_it_signKeyPairTypes "id-it-signKeyPairTypes"
+#define NID_id_it_signKeyPairTypes 299
+#define OBJ_id_it_signKeyPairTypes OBJ_id_it,2L
+
+#define SN_id_it_encKeyPairTypes "id-it-encKeyPairTypes"
+#define NID_id_it_encKeyPairTypes 300
+#define OBJ_id_it_encKeyPairTypes OBJ_id_it,3L
+
+#define SN_id_it_preferredSymmAlg "id-it-preferredSymmAlg"
+#define NID_id_it_preferredSymmAlg 301
+#define OBJ_id_it_preferredSymmAlg OBJ_id_it,4L
+
+#define SN_id_it_caKeyUpdateInfo "id-it-caKeyUpdateInfo"
+#define NID_id_it_caKeyUpdateInfo 302
+#define OBJ_id_it_caKeyUpdateInfo OBJ_id_it,5L
+
+#define SN_id_it_currentCRL "id-it-currentCRL"
+#define NID_id_it_currentCRL 303
+#define OBJ_id_it_currentCRL OBJ_id_it,6L
+
+#define SN_id_it_unsupportedOIDs "id-it-unsupportedOIDs"
+#define NID_id_it_unsupportedOIDs 304
+#define OBJ_id_it_unsupportedOIDs OBJ_id_it,7L
+
+#define SN_id_it_subscriptionRequest "id-it-subscriptionRequest"
+#define NID_id_it_subscriptionRequest 305
+#define OBJ_id_it_subscriptionRequest OBJ_id_it,8L
+
+#define SN_id_it_subscriptionResponse "id-it-subscriptionResponse"
+#define NID_id_it_subscriptionResponse 306
+#define OBJ_id_it_subscriptionResponse OBJ_id_it,9L
+
+#define SN_id_it_keyPairParamReq "id-it-keyPairParamReq"
+#define NID_id_it_keyPairParamReq 307
+#define OBJ_id_it_keyPairParamReq OBJ_id_it,10L
+
+#define SN_id_it_keyPairParamRep "id-it-keyPairParamRep"
+#define NID_id_it_keyPairParamRep 308
+#define OBJ_id_it_keyPairParamRep OBJ_id_it,11L
+
+#define SN_id_it_revPassphrase "id-it-revPassphrase"
+#define NID_id_it_revPassphrase 309
+#define OBJ_id_it_revPassphrase OBJ_id_it,12L
+
+#define SN_id_it_implicitConfirm "id-it-implicitConfirm"
+#define NID_id_it_implicitConfirm 310
+#define OBJ_id_it_implicitConfirm OBJ_id_it,13L
+
+#define SN_id_it_confirmWaitTime "id-it-confirmWaitTime"
+#define NID_id_it_confirmWaitTime 311
+#define OBJ_id_it_confirmWaitTime OBJ_id_it,14L
+
+#define SN_id_it_origPKIMessage "id-it-origPKIMessage"
+#define NID_id_it_origPKIMessage 312
+#define OBJ_id_it_origPKIMessage OBJ_id_it,15L
+
+#define SN_id_it_suppLangTags "id-it-suppLangTags"
+#define NID_id_it_suppLangTags 784
+#define OBJ_id_it_suppLangTags OBJ_id_it,16L
+
+#define SN_id_regCtrl "id-regCtrl"
+#define NID_id_regCtrl 313
+#define OBJ_id_regCtrl OBJ_id_pkip,1L
+
+#define SN_id_regInfo "id-regInfo"
+#define NID_id_regInfo 314
+#define OBJ_id_regInfo OBJ_id_pkip,2L
+
+#define SN_id_regCtrl_regToken "id-regCtrl-regToken"
+#define NID_id_regCtrl_regToken 315
+#define OBJ_id_regCtrl_regToken OBJ_id_regCtrl,1L
+
+#define SN_id_regCtrl_authenticator "id-regCtrl-authenticator"
+#define NID_id_regCtrl_authenticator 316
+#define OBJ_id_regCtrl_authenticator OBJ_id_regCtrl,2L
+
+#define SN_id_regCtrl_pkiPublicationInfo "id-regCtrl-pkiPublicationInfo"
+#define NID_id_regCtrl_pkiPublicationInfo 317
+#define OBJ_id_regCtrl_pkiPublicationInfo OBJ_id_regCtrl,3L
+
+#define SN_id_regCtrl_pkiArchiveOptions "id-regCtrl-pkiArchiveOptions"
+#define NID_id_regCtrl_pkiArchiveOptions 318
+#define OBJ_id_regCtrl_pkiArchiveOptions OBJ_id_regCtrl,4L
+
+#define SN_id_regCtrl_oldCertID "id-regCtrl-oldCertID"
+#define NID_id_regCtrl_oldCertID 319
+#define OBJ_id_regCtrl_oldCertID OBJ_id_regCtrl,5L
+
+#define SN_id_regCtrl_protocolEncrKey "id-regCtrl-protocolEncrKey"
+#define NID_id_regCtrl_protocolEncrKey 320
+#define OBJ_id_regCtrl_protocolEncrKey OBJ_id_regCtrl,6L
+
+#define SN_id_regInfo_utf8Pairs "id-regInfo-utf8Pairs"
+#define NID_id_regInfo_utf8Pairs 321
+#define OBJ_id_regInfo_utf8Pairs OBJ_id_regInfo,1L
+
+#define SN_id_regInfo_certReq "id-regInfo-certReq"
+#define NID_id_regInfo_certReq 322
+#define OBJ_id_regInfo_certReq OBJ_id_regInfo,2L
+
+#define SN_id_alg_des40 "id-alg-des40"
+#define NID_id_alg_des40 323
+#define OBJ_id_alg_des40 OBJ_id_alg,1L
+
+#define SN_id_alg_noSignature "id-alg-noSignature"
+#define NID_id_alg_noSignature 324
+#define OBJ_id_alg_noSignature OBJ_id_alg,2L
+
+#define SN_id_alg_dh_sig_hmac_sha1 "id-alg-dh-sig-hmac-sha1"
+#define NID_id_alg_dh_sig_hmac_sha1 325
+#define OBJ_id_alg_dh_sig_hmac_sha1 OBJ_id_alg,3L
+
+#define SN_id_alg_dh_pop "id-alg-dh-pop"
+#define NID_id_alg_dh_pop 326
+#define OBJ_id_alg_dh_pop OBJ_id_alg,4L
+
+#define SN_id_cmc_statusInfo "id-cmc-statusInfo"
+#define NID_id_cmc_statusInfo 327
+#define OBJ_id_cmc_statusInfo OBJ_id_cmc,1L
+
+#define SN_id_cmc_identification "id-cmc-identification"
+#define NID_id_cmc_identification 328
+#define OBJ_id_cmc_identification OBJ_id_cmc,2L
+
+#define SN_id_cmc_identityProof "id-cmc-identityProof"
+#define NID_id_cmc_identityProof 329
+#define OBJ_id_cmc_identityProof OBJ_id_cmc,3L
+
+#define SN_id_cmc_dataReturn "id-cmc-dataReturn"
+#define NID_id_cmc_dataReturn 330
+#define OBJ_id_cmc_dataReturn OBJ_id_cmc,4L
+
+#define SN_id_cmc_transactionId "id-cmc-transactionId"
+#define NID_id_cmc_transactionId 331
+#define OBJ_id_cmc_transactionId OBJ_id_cmc,5L
+
+#define SN_id_cmc_senderNonce "id-cmc-senderNonce"
+#define NID_id_cmc_senderNonce 332
+#define OBJ_id_cmc_senderNonce OBJ_id_cmc,6L
+
+#define SN_id_cmc_recipientNonce "id-cmc-recipientNonce"
+#define NID_id_cmc_recipientNonce 333
+#define OBJ_id_cmc_recipientNonce OBJ_id_cmc,7L
+
+#define SN_id_cmc_addExtensions "id-cmc-addExtensions"
+#define NID_id_cmc_addExtensions 334
+#define OBJ_id_cmc_addExtensions OBJ_id_cmc,8L
+
+#define SN_id_cmc_encryptedPOP "id-cmc-encryptedPOP"
+#define NID_id_cmc_encryptedPOP 335
+#define OBJ_id_cmc_encryptedPOP OBJ_id_cmc,9L
+
+#define SN_id_cmc_decryptedPOP "id-cmc-decryptedPOP"
+#define NID_id_cmc_decryptedPOP 336
+#define OBJ_id_cmc_decryptedPOP OBJ_id_cmc,10L
+
+#define SN_id_cmc_lraPOPWitness "id-cmc-lraPOPWitness"
+#define NID_id_cmc_lraPOPWitness 337
+#define OBJ_id_cmc_lraPOPWitness OBJ_id_cmc,11L
+
+#define SN_id_cmc_getCert "id-cmc-getCert"
+#define NID_id_cmc_getCert 338
+#define OBJ_id_cmc_getCert OBJ_id_cmc,15L
+
+#define SN_id_cmc_getCRL "id-cmc-getCRL"
+#define NID_id_cmc_getCRL 339
+#define OBJ_id_cmc_getCRL OBJ_id_cmc,16L
+
+#define SN_id_cmc_revokeRequest "id-cmc-revokeRequest"
+#define NID_id_cmc_revokeRequest 340
+#define OBJ_id_cmc_revokeRequest OBJ_id_cmc,17L
+
+#define SN_id_cmc_regInfo "id-cmc-regInfo"
+#define NID_id_cmc_regInfo 341
+#define OBJ_id_cmc_regInfo OBJ_id_cmc,18L
+
+#define SN_id_cmc_responseInfo "id-cmc-responseInfo"
+#define NID_id_cmc_responseInfo 342
+#define OBJ_id_cmc_responseInfo OBJ_id_cmc,19L
+
+#define SN_id_cmc_queryPending "id-cmc-queryPending"
+#define NID_id_cmc_queryPending 343
+#define OBJ_id_cmc_queryPending OBJ_id_cmc,21L
+
+#define SN_id_cmc_popLinkRandom "id-cmc-popLinkRandom"
+#define NID_id_cmc_popLinkRandom 344
+#define OBJ_id_cmc_popLinkRandom OBJ_id_cmc,22L
+
+#define SN_id_cmc_popLinkWitness "id-cmc-popLinkWitness"
+#define NID_id_cmc_popLinkWitness 345
+#define OBJ_id_cmc_popLinkWitness OBJ_id_cmc,23L
+
+#define SN_id_cmc_confirmCertAcceptance "id-cmc-confirmCertAcceptance"
+#define NID_id_cmc_confirmCertAcceptance 346
+#define OBJ_id_cmc_confirmCertAcceptance OBJ_id_cmc,24L
+
+#define SN_id_on_personalData "id-on-personalData"
+#define NID_id_on_personalData 347
+#define OBJ_id_on_personalData OBJ_id_on,1L
+
+#define SN_id_on_permanentIdentifier "id-on-permanentIdentifier"
+#define LN_id_on_permanentIdentifier "Permanent Identifier"
+#define NID_id_on_permanentIdentifier 858
+#define OBJ_id_on_permanentIdentifier OBJ_id_on,3L
+
+#define SN_id_pda_dateOfBirth "id-pda-dateOfBirth"
+#define NID_id_pda_dateOfBirth 348
+#define OBJ_id_pda_dateOfBirth OBJ_id_pda,1L
+
+#define SN_id_pda_placeOfBirth "id-pda-placeOfBirth"
+#define NID_id_pda_placeOfBirth 349
+#define OBJ_id_pda_placeOfBirth OBJ_id_pda,2L
+
+#define SN_id_pda_gender "id-pda-gender"
+#define NID_id_pda_gender 351
+#define OBJ_id_pda_gender OBJ_id_pda,3L
+
+#define SN_id_pda_countryOfCitizenship "id-pda-countryOfCitizenship"
+#define NID_id_pda_countryOfCitizenship 352
+#define OBJ_id_pda_countryOfCitizenship OBJ_id_pda,4L
+
+#define SN_id_pda_countryOfResidence "id-pda-countryOfResidence"
+#define NID_id_pda_countryOfResidence 353
+#define OBJ_id_pda_countryOfResidence OBJ_id_pda,5L
+
+#define SN_id_aca_authenticationInfo "id-aca-authenticationInfo"
+#define NID_id_aca_authenticationInfo 354
+#define OBJ_id_aca_authenticationInfo OBJ_id_aca,1L
+
+#define SN_id_aca_accessIdentity "id-aca-accessIdentity"
+#define NID_id_aca_accessIdentity 355
+#define OBJ_id_aca_accessIdentity OBJ_id_aca,2L
+
+#define SN_id_aca_chargingIdentity "id-aca-chargingIdentity"
+#define NID_id_aca_chargingIdentity 356
+#define OBJ_id_aca_chargingIdentity OBJ_id_aca,3L
+
+#define SN_id_aca_group "id-aca-group"
+#define NID_id_aca_group 357
+#define OBJ_id_aca_group OBJ_id_aca,4L
+
+#define SN_id_aca_role "id-aca-role"
+#define NID_id_aca_role 358
+#define OBJ_id_aca_role OBJ_id_aca,5L
+
+#define SN_id_aca_encAttrs "id-aca-encAttrs"
+#define NID_id_aca_encAttrs 399
+#define OBJ_id_aca_encAttrs OBJ_id_aca,6L
+
+#define SN_id_qcs_pkixQCSyntax_v1 "id-qcs-pkixQCSyntax-v1"
+#define NID_id_qcs_pkixQCSyntax_v1 359
+#define OBJ_id_qcs_pkixQCSyntax_v1 OBJ_id_qcs,1L
+
+#define SN_id_cct_crs "id-cct-crs"
+#define NID_id_cct_crs 360
+#define OBJ_id_cct_crs OBJ_id_cct,1L
+
+#define SN_id_cct_PKIData "id-cct-PKIData"
+#define NID_id_cct_PKIData 361
+#define OBJ_id_cct_PKIData OBJ_id_cct,2L
+
+#define SN_id_cct_PKIResponse "id-cct-PKIResponse"
+#define NID_id_cct_PKIResponse 362
+#define OBJ_id_cct_PKIResponse OBJ_id_cct,3L
+
+#define SN_id_ppl_anyLanguage "id-ppl-anyLanguage"
+#define LN_id_ppl_anyLanguage "Any language"
+#define NID_id_ppl_anyLanguage 664
+#define OBJ_id_ppl_anyLanguage OBJ_id_ppl,0L
+
+#define SN_id_ppl_inheritAll "id-ppl-inheritAll"
+#define LN_id_ppl_inheritAll "Inherit all"
+#define NID_id_ppl_inheritAll 665
+#define OBJ_id_ppl_inheritAll OBJ_id_ppl,1L
+
+#define SN_Independent "id-ppl-independent"
+#define LN_Independent "Independent"
+#define NID_Independent 667
+#define OBJ_Independent OBJ_id_ppl,2L
+
+#define SN_ad_OCSP "OCSP"
+#define LN_ad_OCSP "OCSP"
+#define NID_ad_OCSP 178
+#define OBJ_ad_OCSP OBJ_id_ad,1L
+
+#define SN_ad_ca_issuers "caIssuers"
+#define LN_ad_ca_issuers "CA Issuers"
+#define NID_ad_ca_issuers 179
+#define OBJ_ad_ca_issuers OBJ_id_ad,2L
+
+#define SN_ad_timeStamping "ad_timestamping"
+#define LN_ad_timeStamping "AD Time Stamping"
+#define NID_ad_timeStamping 363
+#define OBJ_ad_timeStamping OBJ_id_ad,3L
+
+#define SN_ad_dvcs "AD_DVCS"
+#define LN_ad_dvcs "ad dvcs"
+#define NID_ad_dvcs 364
+#define OBJ_ad_dvcs OBJ_id_ad,4L
+
+#define SN_caRepository "caRepository"
+#define LN_caRepository "CA Repository"
+#define NID_caRepository 785
+#define OBJ_caRepository OBJ_id_ad,5L
+
+#define OBJ_id_pkix_OCSP OBJ_ad_OCSP
+
+#define SN_id_pkix_OCSP_basic "basicOCSPResponse"
+#define LN_id_pkix_OCSP_basic "Basic OCSP Response"
+#define NID_id_pkix_OCSP_basic 365
+#define OBJ_id_pkix_OCSP_basic OBJ_id_pkix_OCSP,1L
+
+#define SN_id_pkix_OCSP_Nonce "Nonce"
+#define LN_id_pkix_OCSP_Nonce "OCSP Nonce"
+#define NID_id_pkix_OCSP_Nonce 366
+#define OBJ_id_pkix_OCSP_Nonce OBJ_id_pkix_OCSP,2L
+
+#define SN_id_pkix_OCSP_CrlID "CrlID"
+#define LN_id_pkix_OCSP_CrlID "OCSP CRL ID"
+#define NID_id_pkix_OCSP_CrlID 367
+#define OBJ_id_pkix_OCSP_CrlID OBJ_id_pkix_OCSP,3L
+
+#define SN_id_pkix_OCSP_acceptableResponses "acceptableResponses"
+#define LN_id_pkix_OCSP_acceptableResponses "Acceptable OCSP Responses"
+#define NID_id_pkix_OCSP_acceptableResponses 368
+#define OBJ_id_pkix_OCSP_acceptableResponses OBJ_id_pkix_OCSP,4L
+
+#define SN_id_pkix_OCSP_noCheck "noCheck"
+#define LN_id_pkix_OCSP_noCheck "OCSP No Check"
+#define NID_id_pkix_OCSP_noCheck 369
+#define OBJ_id_pkix_OCSP_noCheck OBJ_id_pkix_OCSP,5L
+
+#define SN_id_pkix_OCSP_archiveCutoff "archiveCutoff"
+#define LN_id_pkix_OCSP_archiveCutoff "OCSP Archive Cutoff"
+#define NID_id_pkix_OCSP_archiveCutoff 370
+#define OBJ_id_pkix_OCSP_archiveCutoff OBJ_id_pkix_OCSP,6L
+
+#define SN_id_pkix_OCSP_serviceLocator "serviceLocator"
+#define LN_id_pkix_OCSP_serviceLocator "OCSP Service Locator"
+#define NID_id_pkix_OCSP_serviceLocator 371
+#define OBJ_id_pkix_OCSP_serviceLocator OBJ_id_pkix_OCSP,7L
+
+#define SN_id_pkix_OCSP_extendedStatus "extendedStatus"
+#define LN_id_pkix_OCSP_extendedStatus "Extended OCSP Status"
+#define NID_id_pkix_OCSP_extendedStatus 372
+#define OBJ_id_pkix_OCSP_extendedStatus OBJ_id_pkix_OCSP,8L
+
+#define SN_id_pkix_OCSP_valid "valid"
+#define NID_id_pkix_OCSP_valid 373
+#define OBJ_id_pkix_OCSP_valid OBJ_id_pkix_OCSP,9L
+
+#define SN_id_pkix_OCSP_path "path"
+#define NID_id_pkix_OCSP_path 374
+#define OBJ_id_pkix_OCSP_path OBJ_id_pkix_OCSP,10L
+
+#define SN_id_pkix_OCSP_trustRoot "trustRoot"
+#define LN_id_pkix_OCSP_trustRoot "Trust Root"
+#define NID_id_pkix_OCSP_trustRoot 375
+#define OBJ_id_pkix_OCSP_trustRoot OBJ_id_pkix_OCSP,11L
+
+#define SN_algorithm "algorithm"
+#define LN_algorithm "algorithm"
+#define NID_algorithm 376
+#define OBJ_algorithm 1L,3L,14L,3L,2L
+
+#define SN_md5WithRSA "RSA-NP-MD5"
+#define LN_md5WithRSA "md5WithRSA"
+#define NID_md5WithRSA 104
+#define OBJ_md5WithRSA OBJ_algorithm,3L
+
+#define SN_des_ecb "DES-ECB"
+#define LN_des_ecb "des-ecb"
+#define NID_des_ecb 29
+#define OBJ_des_ecb OBJ_algorithm,6L
+
+#define SN_des_cbc "DES-CBC"
+#define LN_des_cbc "des-cbc"
+#define NID_des_cbc 31
+#define OBJ_des_cbc OBJ_algorithm,7L
+
+#define SN_des_ofb64 "DES-OFB"
+#define LN_des_ofb64 "des-ofb"
+#define NID_des_ofb64 45
+#define OBJ_des_ofb64 OBJ_algorithm,8L
+
+#define SN_des_cfb64 "DES-CFB"
+#define LN_des_cfb64 "des-cfb"
+#define NID_des_cfb64 30
+#define OBJ_des_cfb64 OBJ_algorithm,9L
+
+#define SN_rsaSignature "rsaSignature"
+#define NID_rsaSignature 377
+#define OBJ_rsaSignature OBJ_algorithm,11L
+
+#define SN_dsa_2 "DSA-old"
+#define LN_dsa_2 "dsaEncryption-old"
+#define NID_dsa_2 67
+#define OBJ_dsa_2 OBJ_algorithm,12L
+
+#define SN_dsaWithSHA "DSA-SHA"
+#define LN_dsaWithSHA "dsaWithSHA"
+#define NID_dsaWithSHA 66
+#define OBJ_dsaWithSHA OBJ_algorithm,13L
+
+#define SN_shaWithRSAEncryption "RSA-SHA"
+#define LN_shaWithRSAEncryption "shaWithRSAEncryption"
+#define NID_shaWithRSAEncryption 42
+#define OBJ_shaWithRSAEncryption OBJ_algorithm,15L
+
+#define SN_des_ede_ecb "DES-EDE"
+#define LN_des_ede_ecb "des-ede"
+#define NID_des_ede_ecb 32
+#define OBJ_des_ede_ecb OBJ_algorithm,17L
+
+#define SN_des_ede3_ecb "DES-EDE3"
+#define LN_des_ede3_ecb "des-ede3"
+#define NID_des_ede3_ecb 33
+
+#define SN_des_ede_cbc "DES-EDE-CBC"
+#define LN_des_ede_cbc "des-ede-cbc"
+#define NID_des_ede_cbc 43
+
+#define SN_des_ede_cfb64 "DES-EDE-CFB"
+#define LN_des_ede_cfb64 "des-ede-cfb"
+#define NID_des_ede_cfb64 60
+
+#define SN_des_ede3_cfb64 "DES-EDE3-CFB"
+#define LN_des_ede3_cfb64 "des-ede3-cfb"
+#define NID_des_ede3_cfb64 61
+
+#define SN_des_ede_ofb64 "DES-EDE-OFB"
+#define LN_des_ede_ofb64 "des-ede-ofb"
+#define NID_des_ede_ofb64 62
+
+#define SN_des_ede3_ofb64 "DES-EDE3-OFB"
+#define LN_des_ede3_ofb64 "des-ede3-ofb"
+#define NID_des_ede3_ofb64 63
+
+#define SN_desx_cbc "DESX-CBC"
+#define LN_desx_cbc "desx-cbc"
+#define NID_desx_cbc 80
+
+#define SN_sha "SHA"
+#define LN_sha "sha"
+#define NID_sha 41
+#define OBJ_sha OBJ_algorithm,18L
+
+#define SN_sha1 "SHA1"
+#define LN_sha1 "sha1"
+#define NID_sha1 64
+#define OBJ_sha1 OBJ_algorithm,26L
+
+#define SN_dsaWithSHA1_2 "DSA-SHA1-old"
+#define LN_dsaWithSHA1_2 "dsaWithSHA1-old"
+#define NID_dsaWithSHA1_2 70
+#define OBJ_dsaWithSHA1_2 OBJ_algorithm,27L
+
+#define SN_sha1WithRSA "RSA-SHA1-2"
+#define LN_sha1WithRSA "sha1WithRSA"
+#define NID_sha1WithRSA 115
+#define OBJ_sha1WithRSA OBJ_algorithm,29L
+
+#define SN_ripemd160 "RIPEMD160"
+#define LN_ripemd160 "ripemd160"
+#define NID_ripemd160 117
+#define OBJ_ripemd160 1L,3L,36L,3L,2L,1L
+
+#define SN_ripemd160WithRSA "RSA-RIPEMD160"
+#define LN_ripemd160WithRSA "ripemd160WithRSA"
+#define NID_ripemd160WithRSA 119
+#define OBJ_ripemd160WithRSA 1L,3L,36L,3L,3L,1L,2L
+
+#define SN_sxnet "SXNetID"
+#define LN_sxnet "Strong Extranet ID"
+#define NID_sxnet 143
+#define OBJ_sxnet 1L,3L,101L,1L,4L,1L
+
+#define SN_X500 "X500"
+#define LN_X500 "directory services (X.500)"
+#define NID_X500 11
+#define OBJ_X500 2L,5L
+
+#define SN_X509 "X509"
+#define NID_X509 12
+#define OBJ_X509 OBJ_X500,4L
+
+#define SN_commonName "CN"
+#define LN_commonName "commonName"
+#define NID_commonName 13
+#define OBJ_commonName OBJ_X509,3L
+
+#define SN_surname "SN"
+#define LN_surname "surname"
+#define NID_surname 100
+#define OBJ_surname OBJ_X509,4L
+
+#define LN_serialNumber "serialNumber"
+#define NID_serialNumber 105
+#define OBJ_serialNumber OBJ_X509,5L
+
+#define SN_countryName "C"
+#define LN_countryName "countryName"
+#define NID_countryName 14
+#define OBJ_countryName OBJ_X509,6L
+
+#define SN_localityName "L"
+#define LN_localityName "localityName"
+#define NID_localityName 15
+#define OBJ_localityName OBJ_X509,7L
+
+#define SN_stateOrProvinceName "ST"
+#define LN_stateOrProvinceName "stateOrProvinceName"
+#define NID_stateOrProvinceName 16
+#define OBJ_stateOrProvinceName OBJ_X509,8L
+
+#define SN_streetAddress "street"
+#define LN_streetAddress "streetAddress"
+#define NID_streetAddress 660
+#define OBJ_streetAddress OBJ_X509,9L
+
+#define SN_organizationName "O"
+#define LN_organizationName "organizationName"
+#define NID_organizationName 17
+#define OBJ_organizationName OBJ_X509,10L
+
+#define SN_organizationalUnitName "OU"
+#define LN_organizationalUnitName "organizationalUnitName"
+#define NID_organizationalUnitName 18
+#define OBJ_organizationalUnitName OBJ_X509,11L
+
+#define SN_title "title"
+#define LN_title "title"
+#define NID_title 106
+#define OBJ_title OBJ_X509,12L
+
+#define LN_description "description"
+#define NID_description 107
+#define OBJ_description OBJ_X509,13L
+
+#define LN_searchGuide "searchGuide"
+#define NID_searchGuide 859
+#define OBJ_searchGuide OBJ_X509,14L
+
+#define LN_businessCategory "businessCategory"
+#define NID_businessCategory 860
+#define OBJ_businessCategory OBJ_X509,15L
+
+#define LN_postalAddress "postalAddress"
+#define NID_postalAddress 861
+#define OBJ_postalAddress OBJ_X509,16L
+
+#define LN_postalCode "postalCode"
+#define NID_postalCode 661
+#define OBJ_postalCode OBJ_X509,17L
+
+#define LN_postOfficeBox "postOfficeBox"
+#define NID_postOfficeBox 862
+#define OBJ_postOfficeBox OBJ_X509,18L
+
+#define LN_physicalDeliveryOfficeName "physicalDeliveryOfficeName"
+#define NID_physicalDeliveryOfficeName 863
+#define OBJ_physicalDeliveryOfficeName OBJ_X509,19L
+
+#define LN_telephoneNumber "telephoneNumber"
+#define NID_telephoneNumber 864
+#define OBJ_telephoneNumber OBJ_X509,20L
+
+#define LN_telexNumber "telexNumber"
+#define NID_telexNumber 865
+#define OBJ_telexNumber OBJ_X509,21L
+
+#define LN_teletexTerminalIdentifier "teletexTerminalIdentifier"
+#define NID_teletexTerminalIdentifier 866
+#define OBJ_teletexTerminalIdentifier OBJ_X509,22L
+
+#define LN_facsimileTelephoneNumber "facsimileTelephoneNumber"
+#define NID_facsimileTelephoneNumber 867
+#define OBJ_facsimileTelephoneNumber OBJ_X509,23L
+
+#define LN_x121Address "x121Address"
+#define NID_x121Address 868
+#define OBJ_x121Address OBJ_X509,24L
+
+#define LN_internationaliSDNNumber "internationaliSDNNumber"
+#define NID_internationaliSDNNumber 869
+#define OBJ_internationaliSDNNumber OBJ_X509,25L
+
+#define LN_registeredAddress "registeredAddress"
+#define NID_registeredAddress 870
+#define OBJ_registeredAddress OBJ_X509,26L
+
+#define LN_destinationIndicator "destinationIndicator"
+#define NID_destinationIndicator 871
+#define OBJ_destinationIndicator OBJ_X509,27L
+
+#define LN_preferredDeliveryMethod "preferredDeliveryMethod"
+#define NID_preferredDeliveryMethod 872
+#define OBJ_preferredDeliveryMethod OBJ_X509,28L
+
+#define LN_presentationAddress "presentationAddress"
+#define NID_presentationAddress 873
+#define OBJ_presentationAddress OBJ_X509,29L
+
+#define LN_supportedApplicationContext "supportedApplicationContext"
+#define NID_supportedApplicationContext 874
+#define OBJ_supportedApplicationContext OBJ_X509,30L
+
+#define SN_member "member"
+#define NID_member 875
+#define OBJ_member OBJ_X509,31L
+
+#define SN_owner "owner"
+#define NID_owner 876
+#define OBJ_owner OBJ_X509,32L
+
+#define LN_roleOccupant "roleOccupant"
+#define NID_roleOccupant 877
+#define OBJ_roleOccupant OBJ_X509,33L
+
+#define SN_seeAlso "seeAlso"
+#define NID_seeAlso 878
+#define OBJ_seeAlso OBJ_X509,34L
+
+#define LN_userPassword "userPassword"
+#define NID_userPassword 879
+#define OBJ_userPassword OBJ_X509,35L
+
+#define LN_userCertificate "userCertificate"
+#define NID_userCertificate 880
+#define OBJ_userCertificate OBJ_X509,36L
+
+#define LN_cACertificate "cACertificate"
+#define NID_cACertificate 881
+#define OBJ_cACertificate OBJ_X509,37L
+
+#define LN_authorityRevocationList "authorityRevocationList"
+#define NID_authorityRevocationList 882
+#define OBJ_authorityRevocationList OBJ_X509,38L
+
+#define LN_certificateRevocationList "certificateRevocationList"
+#define NID_certificateRevocationList 883
+#define OBJ_certificateRevocationList OBJ_X509,39L
+
+#define LN_crossCertificatePair "crossCertificatePair"
+#define NID_crossCertificatePair 884
+#define OBJ_crossCertificatePair OBJ_X509,40L
+
+#define SN_name "name"
+#define LN_name "name"
+#define NID_name 173
+#define OBJ_name OBJ_X509,41L
+
+#define SN_givenName "GN"
+#define LN_givenName "givenName"
+#define NID_givenName 99
+#define OBJ_givenName OBJ_X509,42L
+
+#define SN_initials "initials"
+#define LN_initials "initials"
+#define NID_initials 101
+#define OBJ_initials OBJ_X509,43L
+
+#define LN_generationQualifier "generationQualifier"
+#define NID_generationQualifier 509
+#define OBJ_generationQualifier OBJ_X509,44L
+
+#define LN_x500UniqueIdentifier "x500UniqueIdentifier"
+#define NID_x500UniqueIdentifier 503
+#define OBJ_x500UniqueIdentifier OBJ_X509,45L
+
+#define SN_dnQualifier "dnQualifier"
+#define LN_dnQualifier "dnQualifier"
+#define NID_dnQualifier 174
+#define OBJ_dnQualifier OBJ_X509,46L
+
+#define LN_enhancedSearchGuide "enhancedSearchGuide"
+#define NID_enhancedSearchGuide 885
+#define OBJ_enhancedSearchGuide OBJ_X509,47L
+
+#define LN_protocolInformation "protocolInformation"
+#define NID_protocolInformation 886
+#define OBJ_protocolInformation OBJ_X509,48L
+
+#define LN_distinguishedName "distinguishedName"
+#define NID_distinguishedName 887
+#define OBJ_distinguishedName OBJ_X509,49L
+
+#define LN_uniqueMember "uniqueMember"
+#define NID_uniqueMember 888
+#define OBJ_uniqueMember OBJ_X509,50L
+
+#define LN_houseIdentifier "houseIdentifier"
+#define NID_houseIdentifier 889
+#define OBJ_houseIdentifier OBJ_X509,51L
+
+#define LN_supportedAlgorithms "supportedAlgorithms"
+#define NID_supportedAlgorithms 890
+#define OBJ_supportedAlgorithms OBJ_X509,52L
+
+#define LN_deltaRevocationList "deltaRevocationList"
+#define NID_deltaRevocationList 891
+#define OBJ_deltaRevocationList OBJ_X509,53L
+
+#define SN_dmdName "dmdName"
+#define NID_dmdName 892
+#define OBJ_dmdName OBJ_X509,54L
+
+#define LN_pseudonym "pseudonym"
+#define NID_pseudonym 510
+#define OBJ_pseudonym OBJ_X509,65L
+
+#define SN_role "role"
+#define LN_role "role"
+#define NID_role 400
+#define OBJ_role OBJ_X509,72L
+
+#define SN_X500algorithms "X500algorithms"
+#define LN_X500algorithms "directory services - algorithms"
+#define NID_X500algorithms 378
+#define OBJ_X500algorithms OBJ_X500,8L
+
+#define SN_rsa "RSA"
+#define LN_rsa "rsa"
+#define NID_rsa 19
+#define OBJ_rsa OBJ_X500algorithms,1L,1L
+
+#define SN_mdc2WithRSA "RSA-MDC2"
+#define LN_mdc2WithRSA "mdc2WithRSA"
+#define NID_mdc2WithRSA 96
+#define OBJ_mdc2WithRSA OBJ_X500algorithms,3L,100L
+
+#define SN_mdc2 "MDC2"
+#define LN_mdc2 "mdc2"
+#define NID_mdc2 95
+#define OBJ_mdc2 OBJ_X500algorithms,3L,101L
+
+#define SN_id_ce "id-ce"
+#define NID_id_ce 81
+#define OBJ_id_ce OBJ_X500,29L
+
+#define SN_subject_directory_attributes "subjectDirectoryAttributes"
+#define LN_subject_directory_attributes "X509v3 Subject Directory Attributes"
+#define NID_subject_directory_attributes 769
+#define OBJ_subject_directory_attributes OBJ_id_ce,9L
+
+#define SN_subject_key_identifier "subjectKeyIdentifier"
+#define LN_subject_key_identifier "X509v3 Subject Key Identifier"
+#define NID_subject_key_identifier 82
+#define OBJ_subject_key_identifier OBJ_id_ce,14L
+
+#define SN_key_usage "keyUsage"
+#define LN_key_usage "X509v3 Key Usage"
+#define NID_key_usage 83
+#define OBJ_key_usage OBJ_id_ce,15L
+
+#define SN_private_key_usage_period "privateKeyUsagePeriod"
+#define LN_private_key_usage_period "X509v3 Private Key Usage Period"
+#define NID_private_key_usage_period 84
+#define OBJ_private_key_usage_period OBJ_id_ce,16L
+
+#define SN_subject_alt_name "subjectAltName"
+#define LN_subject_alt_name "X509v3 Subject Alternative Name"
+#define NID_subject_alt_name 85
+#define OBJ_subject_alt_name OBJ_id_ce,17L
+
+#define SN_issuer_alt_name "issuerAltName"
+#define LN_issuer_alt_name "X509v3 Issuer Alternative Name"
+#define NID_issuer_alt_name 86
+#define OBJ_issuer_alt_name OBJ_id_ce,18L
+
+#define SN_basic_constraints "basicConstraints"
+#define LN_basic_constraints "X509v3 Basic Constraints"
+#define NID_basic_constraints 87
+#define OBJ_basic_constraints OBJ_id_ce,19L
+
+#define SN_crl_number "crlNumber"
+#define LN_crl_number "X509v3 CRL Number"
+#define NID_crl_number 88
+#define OBJ_crl_number OBJ_id_ce,20L
+
+#define SN_crl_reason "CRLReason"
+#define LN_crl_reason "X509v3 CRL Reason Code"
+#define NID_crl_reason 141
+#define OBJ_crl_reason OBJ_id_ce,21L
+
+#define SN_invalidity_date "invalidityDate"
+#define LN_invalidity_date "Invalidity Date"
+#define NID_invalidity_date 142
+#define OBJ_invalidity_date OBJ_id_ce,24L
+
+#define SN_delta_crl "deltaCRL"
+#define LN_delta_crl "X509v3 Delta CRL Indicator"
+#define NID_delta_crl 140
+#define OBJ_delta_crl OBJ_id_ce,27L
+
+#define SN_issuing_distribution_point "issuingDistributionPoint"
+#define LN_issuing_distribution_point "X509v3 Issuing Distrubution Point"
+#define NID_issuing_distribution_point 770
+#define OBJ_issuing_distribution_point OBJ_id_ce,28L
+
+#define SN_certificate_issuer "certificateIssuer"
+#define LN_certificate_issuer "X509v3 Certificate Issuer"
+#define NID_certificate_issuer 771
+#define OBJ_certificate_issuer OBJ_id_ce,29L
+
+#define SN_name_constraints "nameConstraints"
+#define LN_name_constraints "X509v3 Name Constraints"
+#define NID_name_constraints 666
+#define OBJ_name_constraints OBJ_id_ce,30L
+
+#define SN_crl_distribution_points "crlDistributionPoints"
+#define LN_crl_distribution_points "X509v3 CRL Distribution Points"
+#define NID_crl_distribution_points 103
+#define OBJ_crl_distribution_points OBJ_id_ce,31L
+
+#define SN_certificate_policies "certificatePolicies"
+#define LN_certificate_policies "X509v3 Certificate Policies"
+#define NID_certificate_policies 89
+#define OBJ_certificate_policies OBJ_id_ce,32L
+
+#define SN_any_policy "anyPolicy"
+#define LN_any_policy "X509v3 Any Policy"
+#define NID_any_policy 746
+#define OBJ_any_policy OBJ_certificate_policies,0L
+
+#define SN_policy_mappings "policyMappings"
+#define LN_policy_mappings "X509v3 Policy Mappings"
+#define NID_policy_mappings 747
+#define OBJ_policy_mappings OBJ_id_ce,33L
+
+#define SN_authority_key_identifier "authorityKeyIdentifier"
+#define LN_authority_key_identifier "X509v3 Authority Key Identifier"
+#define NID_authority_key_identifier 90
+#define OBJ_authority_key_identifier OBJ_id_ce,35L
+
+#define SN_policy_constraints "policyConstraints"
+#define LN_policy_constraints "X509v3 Policy Constraints"
+#define NID_policy_constraints 401
+#define OBJ_policy_constraints OBJ_id_ce,36L
+
+#define SN_ext_key_usage "extendedKeyUsage"
+#define LN_ext_key_usage "X509v3 Extended Key Usage"
+#define NID_ext_key_usage 126
+#define OBJ_ext_key_usage OBJ_id_ce,37L
+
+#define SN_freshest_crl "freshestCRL"
+#define LN_freshest_crl "X509v3 Freshest CRL"
+#define NID_freshest_crl 857
+#define OBJ_freshest_crl OBJ_id_ce,46L
+
+#define SN_inhibit_any_policy "inhibitAnyPolicy"
+#define LN_inhibit_any_policy "X509v3 Inhibit Any Policy"
+#define NID_inhibit_any_policy 748
+#define OBJ_inhibit_any_policy OBJ_id_ce,54L
+
+#define SN_target_information "targetInformation"
+#define LN_target_information "X509v3 AC Targeting"
+#define NID_target_information 402
+#define OBJ_target_information OBJ_id_ce,55L
+
+#define SN_no_rev_avail "noRevAvail"
+#define LN_no_rev_avail "X509v3 No Revocation Available"
+#define NID_no_rev_avail 403
+#define OBJ_no_rev_avail OBJ_id_ce,56L
+
+#define SN_anyExtendedKeyUsage "anyExtendedKeyUsage"
+#define LN_anyExtendedKeyUsage "Any Extended Key Usage"
+#define NID_anyExtendedKeyUsage 910
+#define OBJ_anyExtendedKeyUsage OBJ_ext_key_usage,0L
+
+#define SN_netscape "Netscape"
+#define LN_netscape "Netscape Communications Corp."
+#define NID_netscape 57
+#define OBJ_netscape 2L,16L,840L,1L,113730L
+
+#define SN_netscape_cert_extension "nsCertExt"
+#define LN_netscape_cert_extension "Netscape Certificate Extension"
+#define NID_netscape_cert_extension 58
+#define OBJ_netscape_cert_extension OBJ_netscape,1L
+
+#define SN_netscape_data_type "nsDataType"
+#define LN_netscape_data_type "Netscape Data Type"
+#define NID_netscape_data_type 59
+#define OBJ_netscape_data_type OBJ_netscape,2L
+
+#define SN_netscape_cert_type "nsCertType"
+#define LN_netscape_cert_type "Netscape Cert Type"
+#define NID_netscape_cert_type 71
+#define OBJ_netscape_cert_type OBJ_netscape_cert_extension,1L
+
+#define SN_netscape_base_url "nsBaseUrl"
+#define LN_netscape_base_url "Netscape Base Url"
+#define NID_netscape_base_url 72
+#define OBJ_netscape_base_url OBJ_netscape_cert_extension,2L
+
+#define SN_netscape_revocation_url "nsRevocationUrl"
+#define LN_netscape_revocation_url "Netscape Revocation Url"
+#define NID_netscape_revocation_url 73
+#define OBJ_netscape_revocation_url OBJ_netscape_cert_extension,3L
+
+#define SN_netscape_ca_revocation_url "nsCaRevocationUrl"
+#define LN_netscape_ca_revocation_url "Netscape CA Revocation Url"
+#define NID_netscape_ca_revocation_url 74
+#define OBJ_netscape_ca_revocation_url OBJ_netscape_cert_extension,4L
+
+#define SN_netscape_renewal_url "nsRenewalUrl"
+#define LN_netscape_renewal_url "Netscape Renewal Url"
+#define NID_netscape_renewal_url 75
+#define OBJ_netscape_renewal_url OBJ_netscape_cert_extension,7L
+
+#define SN_netscape_ca_policy_url "nsCaPolicyUrl"
+#define LN_netscape_ca_policy_url "Netscape CA Policy Url"
+#define NID_netscape_ca_policy_url 76
+#define OBJ_netscape_ca_policy_url OBJ_netscape_cert_extension,8L
+
+#define SN_netscape_ssl_server_name "nsSslServerName"
+#define LN_netscape_ssl_server_name "Netscape SSL Server Name"
+#define NID_netscape_ssl_server_name 77
+#define OBJ_netscape_ssl_server_name OBJ_netscape_cert_extension,12L
+
+#define SN_netscape_comment "nsComment"
+#define LN_netscape_comment "Netscape Comment"
+#define NID_netscape_comment 78
+#define OBJ_netscape_comment OBJ_netscape_cert_extension,13L
+
+#define SN_netscape_cert_sequence "nsCertSequence"
+#define LN_netscape_cert_sequence "Netscape Certificate Sequence"
+#define NID_netscape_cert_sequence 79
+#define OBJ_netscape_cert_sequence OBJ_netscape_data_type,5L
+
+#define SN_ns_sgc "nsSGC"
+#define LN_ns_sgc "Netscape Server Gated Crypto"
+#define NID_ns_sgc 139
+#define OBJ_ns_sgc OBJ_netscape,4L,1L
+
+#define SN_org "ORG"
+#define LN_org "org"
+#define NID_org 379
+#define OBJ_org OBJ_iso,3L
+
+#define SN_dod "DOD"
+#define LN_dod "dod"
+#define NID_dod 380
+#define OBJ_dod OBJ_org,6L
+
+#define SN_iana "IANA"
+#define LN_iana "iana"
+#define NID_iana 381
+#define OBJ_iana OBJ_dod,1L
+
+#define OBJ_internet OBJ_iana
+
+#define SN_Directory "directory"
+#define LN_Directory "Directory"
+#define NID_Directory 382
+#define OBJ_Directory OBJ_internet,1L
+
+#define SN_Management "mgmt"
+#define LN_Management "Management"
+#define NID_Management 383
+#define OBJ_Management OBJ_internet,2L
+
+#define SN_Experimental "experimental"
+#define LN_Experimental "Experimental"
+#define NID_Experimental 384
+#define OBJ_Experimental OBJ_internet,3L
+
+#define SN_Private "private"
+#define LN_Private "Private"
+#define NID_Private 385
+#define OBJ_Private OBJ_internet,4L
+
+#define SN_Security "security"
+#define LN_Security "Security"
+#define NID_Security 386
+#define OBJ_Security OBJ_internet,5L
+
+#define SN_SNMPv2 "snmpv2"
+#define LN_SNMPv2 "SNMPv2"
+#define NID_SNMPv2 387
+#define OBJ_SNMPv2 OBJ_internet,6L
+
+#define LN_Mail "Mail"
+#define NID_Mail 388
+#define OBJ_Mail OBJ_internet,7L
+
+#define SN_Enterprises "enterprises"
+#define LN_Enterprises "Enterprises"
+#define NID_Enterprises 389
+#define OBJ_Enterprises OBJ_Private,1L
+
+#define SN_dcObject "dcobject"
+#define LN_dcObject "dcObject"
+#define NID_dcObject 390
+#define OBJ_dcObject OBJ_Enterprises,1466L,344L
+
+#define SN_mime_mhs "mime-mhs"
+#define LN_mime_mhs "MIME MHS"
+#define NID_mime_mhs 504
+#define OBJ_mime_mhs OBJ_Mail,1L
+
+#define SN_mime_mhs_headings "mime-mhs-headings"
+#define LN_mime_mhs_headings "mime-mhs-headings"
+#define NID_mime_mhs_headings 505
+#define OBJ_mime_mhs_headings OBJ_mime_mhs,1L
+
+#define SN_mime_mhs_bodies "mime-mhs-bodies"
+#define LN_mime_mhs_bodies "mime-mhs-bodies"
+#define NID_mime_mhs_bodies 506
+#define OBJ_mime_mhs_bodies OBJ_mime_mhs,2L
+
+#define SN_id_hex_partial_message "id-hex-partial-message"
+#define LN_id_hex_partial_message "id-hex-partial-message"
+#define NID_id_hex_partial_message 507
+#define OBJ_id_hex_partial_message OBJ_mime_mhs_headings,1L
+
+#define SN_id_hex_multipart_message "id-hex-multipart-message"
+#define LN_id_hex_multipart_message "id-hex-multipart-message"
+#define NID_id_hex_multipart_message 508
+#define OBJ_id_hex_multipart_message OBJ_mime_mhs_headings,2L
+
+#define SN_rle_compression "RLE"
+#define LN_rle_compression "run length compression"
+#define NID_rle_compression 124
+#define OBJ_rle_compression 1L,1L,1L,1L,666L,1L
+
+#define SN_zlib_compression "ZLIB"
+#define LN_zlib_compression "zlib compression"
+#define NID_zlib_compression 125
+#define OBJ_zlib_compression OBJ_id_smime_alg,8L
+
+#define OBJ_csor 2L,16L,840L,1L,101L,3L
+
+#define OBJ_nistAlgorithms OBJ_csor,4L
+
+#define OBJ_aes OBJ_nistAlgorithms,1L
+
+#define SN_aes_128_ecb "AES-128-ECB"
+#define LN_aes_128_ecb "aes-128-ecb"
+#define NID_aes_128_ecb 418
+#define OBJ_aes_128_ecb OBJ_aes,1L
+
+#define SN_aes_128_cbc "AES-128-CBC"
+#define LN_aes_128_cbc "aes-128-cbc"
+#define NID_aes_128_cbc 419
+#define OBJ_aes_128_cbc OBJ_aes,2L
+
+#define SN_aes_128_ofb128 "AES-128-OFB"
+#define LN_aes_128_ofb128 "aes-128-ofb"
+#define NID_aes_128_ofb128 420
+#define OBJ_aes_128_ofb128 OBJ_aes,3L
+
+#define SN_aes_128_cfb128 "AES-128-CFB"
+#define LN_aes_128_cfb128 "aes-128-cfb"
+#define NID_aes_128_cfb128 421
+#define OBJ_aes_128_cfb128 OBJ_aes,4L
+
+#define SN_id_aes128_wrap "id-aes128-wrap"
+#define NID_id_aes128_wrap 788
+#define OBJ_id_aes128_wrap OBJ_aes,5L
+
+#define SN_aes_128_gcm "id-aes128-GCM"
+#define LN_aes_128_gcm "aes-128-gcm"
+#define NID_aes_128_gcm 895
+#define OBJ_aes_128_gcm OBJ_aes,6L
+
+#define SN_aes_128_ccm "id-aes128-CCM"
+#define LN_aes_128_ccm "aes-128-ccm"
+#define NID_aes_128_ccm 896
+#define OBJ_aes_128_ccm OBJ_aes,7L
+
+#define SN_id_aes128_wrap_pad "id-aes128-wrap-pad"
+#define NID_id_aes128_wrap_pad 897
+#define OBJ_id_aes128_wrap_pad OBJ_aes,8L
+
+#define SN_aes_192_ecb "AES-192-ECB"
+#define LN_aes_192_ecb "aes-192-ecb"
+#define NID_aes_192_ecb 422
+#define OBJ_aes_192_ecb OBJ_aes,21L
+
+#define SN_aes_192_cbc "AES-192-CBC"
+#define LN_aes_192_cbc "aes-192-cbc"
+#define NID_aes_192_cbc 423
+#define OBJ_aes_192_cbc OBJ_aes,22L
+
+#define SN_aes_192_ofb128 "AES-192-OFB"
+#define LN_aes_192_ofb128 "aes-192-ofb"
+#define NID_aes_192_ofb128 424
+#define OBJ_aes_192_ofb128 OBJ_aes,23L
+
+#define SN_aes_192_cfb128 "AES-192-CFB"
+#define LN_aes_192_cfb128 "aes-192-cfb"
+#define NID_aes_192_cfb128 425
+#define OBJ_aes_192_cfb128 OBJ_aes,24L
+
+#define SN_id_aes192_wrap "id-aes192-wrap"
+#define NID_id_aes192_wrap 789
+#define OBJ_id_aes192_wrap OBJ_aes,25L
+
+#define SN_aes_192_gcm "id-aes192-GCM"
+#define LN_aes_192_gcm "aes-192-gcm"
+#define NID_aes_192_gcm 898
+#define OBJ_aes_192_gcm OBJ_aes,26L
+
+#define SN_aes_192_ccm "id-aes192-CCM"
+#define LN_aes_192_ccm "aes-192-ccm"
+#define NID_aes_192_ccm 899
+#define OBJ_aes_192_ccm OBJ_aes,27L
+
+#define SN_id_aes192_wrap_pad "id-aes192-wrap-pad"
+#define NID_id_aes192_wrap_pad 900
+#define OBJ_id_aes192_wrap_pad OBJ_aes,28L
+
+#define SN_aes_256_ecb "AES-256-ECB"
+#define LN_aes_256_ecb "aes-256-ecb"
+#define NID_aes_256_ecb 426
+#define OBJ_aes_256_ecb OBJ_aes,41L
+
+#define SN_aes_256_cbc "AES-256-CBC"
+#define LN_aes_256_cbc "aes-256-cbc"
+#define NID_aes_256_cbc 427
+#define OBJ_aes_256_cbc OBJ_aes,42L
+
+#define SN_aes_256_ofb128 "AES-256-OFB"
+#define LN_aes_256_ofb128 "aes-256-ofb"
+#define NID_aes_256_ofb128 428
+#define OBJ_aes_256_ofb128 OBJ_aes,43L
+
+#define SN_aes_256_cfb128 "AES-256-CFB"
+#define LN_aes_256_cfb128 "aes-256-cfb"
+#define NID_aes_256_cfb128 429
+#define OBJ_aes_256_cfb128 OBJ_aes,44L
+
+#define SN_id_aes256_wrap "id-aes256-wrap"
+#define NID_id_aes256_wrap 790
+#define OBJ_id_aes256_wrap OBJ_aes,45L
+
+#define SN_aes_256_gcm "id-aes256-GCM"
+#define LN_aes_256_gcm "aes-256-gcm"
+#define NID_aes_256_gcm 901
+#define OBJ_aes_256_gcm OBJ_aes,46L
+
+#define SN_aes_256_ccm "id-aes256-CCM"
+#define LN_aes_256_ccm "aes-256-ccm"
+#define NID_aes_256_ccm 902
+#define OBJ_aes_256_ccm OBJ_aes,47L
+
+#define SN_id_aes256_wrap_pad "id-aes256-wrap-pad"
+#define NID_id_aes256_wrap_pad 903
+#define OBJ_id_aes256_wrap_pad OBJ_aes,48L
+
+#define SN_aes_128_cfb1 "AES-128-CFB1"
+#define LN_aes_128_cfb1 "aes-128-cfb1"
+#define NID_aes_128_cfb1 650
+
+#define SN_aes_192_cfb1 "AES-192-CFB1"
+#define LN_aes_192_cfb1 "aes-192-cfb1"
+#define NID_aes_192_cfb1 651
+
+#define SN_aes_256_cfb1 "AES-256-CFB1"
+#define LN_aes_256_cfb1 "aes-256-cfb1"
+#define NID_aes_256_cfb1 652
+
+#define SN_aes_128_cfb8 "AES-128-CFB8"
+#define LN_aes_128_cfb8 "aes-128-cfb8"
+#define NID_aes_128_cfb8 653
+
+#define SN_aes_192_cfb8 "AES-192-CFB8"
+#define LN_aes_192_cfb8 "aes-192-cfb8"
+#define NID_aes_192_cfb8 654
+
+#define SN_aes_256_cfb8 "AES-256-CFB8"
+#define LN_aes_256_cfb8 "aes-256-cfb8"
+#define NID_aes_256_cfb8 655
+
+#define SN_aes_128_ctr "AES-128-CTR"
+#define LN_aes_128_ctr "aes-128-ctr"
+#define NID_aes_128_ctr 904
+
+#define SN_aes_192_ctr "AES-192-CTR"
+#define LN_aes_192_ctr "aes-192-ctr"
+#define NID_aes_192_ctr 905
+
+#define SN_aes_256_ctr "AES-256-CTR"
+#define LN_aes_256_ctr "aes-256-ctr"
+#define NID_aes_256_ctr 906
+
+#define SN_aes_128_xts "AES-128-XTS"
+#define LN_aes_128_xts "aes-128-xts"
+#define NID_aes_128_xts 913
+
+#define SN_aes_256_xts "AES-256-XTS"
+#define LN_aes_256_xts "aes-256-xts"
+#define NID_aes_256_xts 914
+
+#define SN_des_cfb1 "DES-CFB1"
+#define LN_des_cfb1 "des-cfb1"
+#define NID_des_cfb1 656
+
+#define SN_des_cfb8 "DES-CFB8"
+#define LN_des_cfb8 "des-cfb8"
+#define NID_des_cfb8 657
+
+#define SN_des_ede3_cfb1 "DES-EDE3-CFB1"
+#define LN_des_ede3_cfb1 "des-ede3-cfb1"
+#define NID_des_ede3_cfb1 658
+
+#define SN_des_ede3_cfb8 "DES-EDE3-CFB8"
+#define LN_des_ede3_cfb8 "des-ede3-cfb8"
+#define NID_des_ede3_cfb8 659
+
+#define OBJ_nist_hashalgs OBJ_nistAlgorithms,2L
+
+#define SN_sha256 "SHA256"
+#define LN_sha256 "sha256"
+#define NID_sha256 672
+#define OBJ_sha256 OBJ_nist_hashalgs,1L
+
+#define SN_sha384 "SHA384"
+#define LN_sha384 "sha384"
+#define NID_sha384 673
+#define OBJ_sha384 OBJ_nist_hashalgs,2L
+
+#define SN_sha512 "SHA512"
+#define LN_sha512 "sha512"
+#define NID_sha512 674
+#define OBJ_sha512 OBJ_nist_hashalgs,3L
+
+#define SN_sha224 "SHA224"
+#define LN_sha224 "sha224"
+#define NID_sha224 675
+#define OBJ_sha224 OBJ_nist_hashalgs,4L
+
+#define OBJ_dsa_with_sha2 OBJ_nistAlgorithms,3L
+
+#define SN_dsa_with_SHA224 "dsa_with_SHA224"
+#define NID_dsa_with_SHA224 802
+#define OBJ_dsa_with_SHA224 OBJ_dsa_with_sha2,1L
+
+#define SN_dsa_with_SHA256 "dsa_with_SHA256"
+#define NID_dsa_with_SHA256 803
+#define OBJ_dsa_with_SHA256 OBJ_dsa_with_sha2,2L
+
+#define SN_hold_instruction_code "holdInstructionCode"
+#define LN_hold_instruction_code "Hold Instruction Code"
+#define NID_hold_instruction_code 430
+#define OBJ_hold_instruction_code OBJ_id_ce,23L
+
+#define OBJ_holdInstruction OBJ_X9_57,2L
+
+#define SN_hold_instruction_none "holdInstructionNone"
+#define LN_hold_instruction_none "Hold Instruction None"
+#define NID_hold_instruction_none 431
+#define OBJ_hold_instruction_none OBJ_holdInstruction,1L
+
+#define SN_hold_instruction_call_issuer "holdInstructionCallIssuer"
+#define LN_hold_instruction_call_issuer "Hold Instruction Call Issuer"
+#define NID_hold_instruction_call_issuer 432
+#define OBJ_hold_instruction_call_issuer OBJ_holdInstruction,2L
+
+#define SN_hold_instruction_reject "holdInstructionReject"
+#define LN_hold_instruction_reject "Hold Instruction Reject"
+#define NID_hold_instruction_reject 433
+#define OBJ_hold_instruction_reject OBJ_holdInstruction,3L
+
+#define SN_data "data"
+#define NID_data 434
+#define OBJ_data OBJ_itu_t,9L
+
+#define SN_pss "pss"
+#define NID_pss 435
+#define OBJ_pss OBJ_data,2342L
+
+#define SN_ucl "ucl"
+#define NID_ucl 436
+#define OBJ_ucl OBJ_pss,19200300L
+
+#define SN_pilot "pilot"
+#define NID_pilot 437
+#define OBJ_pilot OBJ_ucl,100L
+
+#define LN_pilotAttributeType "pilotAttributeType"
+#define NID_pilotAttributeType 438
+#define OBJ_pilotAttributeType OBJ_pilot,1L
+
+#define LN_pilotAttributeSyntax "pilotAttributeSyntax"
+#define NID_pilotAttributeSyntax 439
+#define OBJ_pilotAttributeSyntax OBJ_pilot,3L
+
+#define LN_pilotObjectClass "pilotObjectClass"
+#define NID_pilotObjectClass 440
+#define OBJ_pilotObjectClass OBJ_pilot,4L
+
+#define LN_pilotGroups "pilotGroups"
+#define NID_pilotGroups 441
+#define OBJ_pilotGroups OBJ_pilot,10L
+
+#define LN_iA5StringSyntax "iA5StringSyntax"
+#define NID_iA5StringSyntax 442
+#define OBJ_iA5StringSyntax OBJ_pilotAttributeSyntax,4L
+
+#define LN_caseIgnoreIA5StringSyntax "caseIgnoreIA5StringSyntax"
+#define NID_caseIgnoreIA5StringSyntax 443
+#define OBJ_caseIgnoreIA5StringSyntax OBJ_pilotAttributeSyntax,5L
+
+#define LN_pilotObject "pilotObject"
+#define NID_pilotObject 444
+#define OBJ_pilotObject OBJ_pilotObjectClass,3L
+
+#define LN_pilotPerson "pilotPerson"
+#define NID_pilotPerson 445
+#define OBJ_pilotPerson OBJ_pilotObjectClass,4L
+
+#define SN_account "account"
+#define NID_account 446
+#define OBJ_account OBJ_pilotObjectClass,5L
+
+#define SN_document "document"
+#define NID_document 447
+#define OBJ_document OBJ_pilotObjectClass,6L
+
+#define SN_room "room"
+#define NID_room 448
+#define OBJ_room OBJ_pilotObjectClass,7L
+
+#define LN_documentSeries "documentSeries"
+#define NID_documentSeries 449
+#define OBJ_documentSeries OBJ_pilotObjectClass,9L
+
+#define SN_Domain "domain"
+#define LN_Domain "Domain"
+#define NID_Domain 392
+#define OBJ_Domain OBJ_pilotObjectClass,13L
+
+#define LN_rFC822localPart "rFC822localPart"
+#define NID_rFC822localPart 450
+#define OBJ_rFC822localPart OBJ_pilotObjectClass,14L
+
+#define LN_dNSDomain "dNSDomain"
+#define NID_dNSDomain 451
+#define OBJ_dNSDomain OBJ_pilotObjectClass,15L
+
+#define LN_domainRelatedObject "domainRelatedObject"
+#define NID_domainRelatedObject 452
+#define OBJ_domainRelatedObject OBJ_pilotObjectClass,17L
+
+#define LN_friendlyCountry "friendlyCountry"
+#define NID_friendlyCountry 453
+#define OBJ_friendlyCountry OBJ_pilotObjectClass,18L
+
+#define LN_simpleSecurityObject "simpleSecurityObject"
+#define NID_simpleSecurityObject 454
+#define OBJ_simpleSecurityObject OBJ_pilotObjectClass,19L
+
+#define LN_pilotOrganization "pilotOrganization"
+#define NID_pilotOrganization 455
+#define OBJ_pilotOrganization OBJ_pilotObjectClass,20L
+
+#define LN_pilotDSA "pilotDSA"
+#define NID_pilotDSA 456
+#define OBJ_pilotDSA OBJ_pilotObjectClass,21L
+
+#define LN_qualityLabelledData "qualityLabelledData"
+#define NID_qualityLabelledData 457
+#define OBJ_qualityLabelledData OBJ_pilotObjectClass,22L
+
+#define SN_userId "UID"
+#define LN_userId "userId"
+#define NID_userId 458
+#define OBJ_userId OBJ_pilotAttributeType,1L
+
+#define LN_textEncodedORAddress "textEncodedORAddress"
+#define NID_textEncodedORAddress 459
+#define OBJ_textEncodedORAddress OBJ_pilotAttributeType,2L
+
+#define SN_rfc822Mailbox "mail"
+#define LN_rfc822Mailbox "rfc822Mailbox"
+#define NID_rfc822Mailbox 460
+#define OBJ_rfc822Mailbox OBJ_pilotAttributeType,3L
+
+#define SN_info "info"
+#define NID_info 461
+#define OBJ_info OBJ_pilotAttributeType,4L
+
+#define LN_favouriteDrink "favouriteDrink"
+#define NID_favouriteDrink 462
+#define OBJ_favouriteDrink OBJ_pilotAttributeType,5L
+
+#define LN_roomNumber "roomNumber"
+#define NID_roomNumber 463
+#define OBJ_roomNumber OBJ_pilotAttributeType,6L
+
+#define SN_photo "photo"
+#define NID_photo 464
+#define OBJ_photo OBJ_pilotAttributeType,7L
+
+#define LN_userClass "userClass"
+#define NID_userClass 465
+#define OBJ_userClass OBJ_pilotAttributeType,8L
+
+#define SN_host "host"
+#define NID_host 466
+#define OBJ_host OBJ_pilotAttributeType,9L
+
+#define SN_manager "manager"
+#define NID_manager 467
+#define OBJ_manager OBJ_pilotAttributeType,10L
+
+#define LN_documentIdentifier "documentIdentifier"
+#define NID_documentIdentifier 468
+#define OBJ_documentIdentifier OBJ_pilotAttributeType,11L
+
+#define LN_documentTitle "documentTitle"
+#define NID_documentTitle 469
+#define OBJ_documentTitle OBJ_pilotAttributeType,12L
+
+#define LN_documentVersion "documentVersion"
+#define NID_documentVersion 470
+#define OBJ_documentVersion OBJ_pilotAttributeType,13L
+
+#define LN_documentAuthor "documentAuthor"
+#define NID_documentAuthor 471
+#define OBJ_documentAuthor OBJ_pilotAttributeType,14L
+
+#define LN_documentLocation "documentLocation"
+#define NID_documentLocation 472
+#define OBJ_documentLocation OBJ_pilotAttributeType,15L
+
+#define LN_homeTelephoneNumber "homeTelephoneNumber"
+#define NID_homeTelephoneNumber 473
+#define OBJ_homeTelephoneNumber OBJ_pilotAttributeType,20L
+
+#define SN_secretary "secretary"
+#define NID_secretary 474
+#define OBJ_secretary OBJ_pilotAttributeType,21L
+
+#define LN_otherMailbox "otherMailbox"
+#define NID_otherMailbox 475
+#define OBJ_otherMailbox OBJ_pilotAttributeType,22L
+
+#define LN_lastModifiedTime "lastModifiedTime"
+#define NID_lastModifiedTime 476
+#define OBJ_lastModifiedTime OBJ_pilotAttributeType,23L
+
+#define LN_lastModifiedBy "lastModifiedBy"
+#define NID_lastModifiedBy 477
+#define OBJ_lastModifiedBy OBJ_pilotAttributeType,24L
+
+#define SN_domainComponent "DC"
+#define LN_domainComponent "domainComponent"
+#define NID_domainComponent 391
+#define OBJ_domainComponent OBJ_pilotAttributeType,25L
+
+#define LN_aRecord "aRecord"
+#define NID_aRecord 478
+#define OBJ_aRecord OBJ_pilotAttributeType,26L
+
+#define LN_pilotAttributeType27 "pilotAttributeType27"
+#define NID_pilotAttributeType27 479
+#define OBJ_pilotAttributeType27 OBJ_pilotAttributeType,27L
+
+#define LN_mXRecord "mXRecord"
+#define NID_mXRecord 480
+#define OBJ_mXRecord OBJ_pilotAttributeType,28L
+
+#define LN_nSRecord "nSRecord"
+#define NID_nSRecord 481
+#define OBJ_nSRecord OBJ_pilotAttributeType,29L
+
+#define LN_sOARecord "sOARecord"
+#define NID_sOARecord 482
+#define OBJ_sOARecord OBJ_pilotAttributeType,30L
+
+#define LN_cNAMERecord "cNAMERecord"
+#define NID_cNAMERecord 483
+#define OBJ_cNAMERecord OBJ_pilotAttributeType,31L
+
+#define LN_associatedDomain "associatedDomain"
+#define NID_associatedDomain 484
+#define OBJ_associatedDomain OBJ_pilotAttributeType,37L
+
+#define LN_associatedName "associatedName"
+#define NID_associatedName 485
+#define OBJ_associatedName OBJ_pilotAttributeType,38L
+
+#define LN_homePostalAddress "homePostalAddress"
+#define NID_homePostalAddress 486
+#define OBJ_homePostalAddress OBJ_pilotAttributeType,39L
+
+#define LN_personalTitle "personalTitle"
+#define NID_personalTitle 487
+#define OBJ_personalTitle OBJ_pilotAttributeType,40L
+
+#define LN_mobileTelephoneNumber "mobileTelephoneNumber"
+#define NID_mobileTelephoneNumber 488
+#define OBJ_mobileTelephoneNumber OBJ_pilotAttributeType,41L
+
+#define LN_pagerTelephoneNumber "pagerTelephoneNumber"
+#define NID_pagerTelephoneNumber 489
+#define OBJ_pagerTelephoneNumber OBJ_pilotAttributeType,42L
+
+#define LN_friendlyCountryName "friendlyCountryName"
+#define NID_friendlyCountryName 490
+#define OBJ_friendlyCountryName OBJ_pilotAttributeType,43L
+
+#define LN_organizationalStatus "organizationalStatus"
+#define NID_organizationalStatus 491
+#define OBJ_organizationalStatus OBJ_pilotAttributeType,45L
+
+#define LN_janetMailbox "janetMailbox"
+#define NID_janetMailbox 492
+#define OBJ_janetMailbox OBJ_pilotAttributeType,46L
+
+#define LN_mailPreferenceOption "mailPreferenceOption"
+#define NID_mailPreferenceOption 493
+#define OBJ_mailPreferenceOption OBJ_pilotAttributeType,47L
+
+#define LN_buildingName "buildingName"
+#define NID_buildingName 494
+#define OBJ_buildingName OBJ_pilotAttributeType,48L
+
+#define LN_dSAQuality "dSAQuality"
+#define NID_dSAQuality 495
+#define OBJ_dSAQuality OBJ_pilotAttributeType,49L
+
+#define LN_singleLevelQuality "singleLevelQuality"
+#define NID_singleLevelQuality 496
+#define OBJ_singleLevelQuality OBJ_pilotAttributeType,50L
+
+#define LN_subtreeMinimumQuality "subtreeMinimumQuality"
+#define NID_subtreeMinimumQuality 497
+#define OBJ_subtreeMinimumQuality OBJ_pilotAttributeType,51L
+
+#define LN_subtreeMaximumQuality "subtreeMaximumQuality"
+#define NID_subtreeMaximumQuality 498
+#define OBJ_subtreeMaximumQuality OBJ_pilotAttributeType,52L
+
+#define LN_personalSignature "personalSignature"
+#define NID_personalSignature 499
+#define OBJ_personalSignature OBJ_pilotAttributeType,53L
+
+#define LN_dITRedirect "dITRedirect"
+#define NID_dITRedirect 500
+#define OBJ_dITRedirect OBJ_pilotAttributeType,54L
+
+#define SN_audio "audio"
+#define NID_audio 501
+#define OBJ_audio OBJ_pilotAttributeType,55L
+
+#define LN_documentPublisher "documentPublisher"
+#define NID_documentPublisher 502
+#define OBJ_documentPublisher OBJ_pilotAttributeType,56L
+
+#define SN_id_set "id-set"
+#define LN_id_set "Secure Electronic Transactions"
+#define NID_id_set 512
+#define OBJ_id_set OBJ_international_organizations,42L
+
+#define SN_set_ctype "set-ctype"
+#define LN_set_ctype "content types"
+#define NID_set_ctype 513
+#define OBJ_set_ctype OBJ_id_set,0L
+
+#define SN_set_msgExt "set-msgExt"
+#define LN_set_msgExt "message extensions"
+#define NID_set_msgExt 514
+#define OBJ_set_msgExt OBJ_id_set,1L
+
+#define SN_set_attr "set-attr"
+#define NID_set_attr 515
+#define OBJ_set_attr OBJ_id_set,3L
+
+#define SN_set_policy "set-policy"
+#define NID_set_policy 516
+#define OBJ_set_policy OBJ_id_set,5L
+
+#define SN_set_certExt "set-certExt"
+#define LN_set_certExt "certificate extensions"
+#define NID_set_certExt 517
+#define OBJ_set_certExt OBJ_id_set,7L
+
+#define SN_set_brand "set-brand"
+#define NID_set_brand 518
+#define OBJ_set_brand OBJ_id_set,8L
+
+#define SN_setct_PANData "setct-PANData"
+#define NID_setct_PANData 519
+#define OBJ_setct_PANData OBJ_set_ctype,0L
+
+#define SN_setct_PANToken "setct-PANToken"
+#define NID_setct_PANToken 520
+#define OBJ_setct_PANToken OBJ_set_ctype,1L
+
+#define SN_setct_PANOnly "setct-PANOnly"
+#define NID_setct_PANOnly 521
+#define OBJ_setct_PANOnly OBJ_set_ctype,2L
+
+#define SN_setct_OIData "setct-OIData"
+#define NID_setct_OIData 522
+#define OBJ_setct_OIData OBJ_set_ctype,3L
+
+#define SN_setct_PI "setct-PI"
+#define NID_setct_PI 523
+#define OBJ_setct_PI OBJ_set_ctype,4L
+
+#define SN_setct_PIData "setct-PIData"
+#define NID_setct_PIData 524
+#define OBJ_setct_PIData OBJ_set_ctype,5L
+
+#define SN_setct_PIDataUnsigned "setct-PIDataUnsigned"
+#define NID_setct_PIDataUnsigned 525
+#define OBJ_setct_PIDataUnsigned OBJ_set_ctype,6L
+
+#define SN_setct_HODInput "setct-HODInput"
+#define NID_setct_HODInput 526
+#define OBJ_setct_HODInput OBJ_set_ctype,7L
+
+#define SN_setct_AuthResBaggage "setct-AuthResBaggage"
+#define NID_setct_AuthResBaggage 527
+#define OBJ_setct_AuthResBaggage OBJ_set_ctype,8L
+
+#define SN_setct_AuthRevReqBaggage "setct-AuthRevReqBaggage"
+#define NID_setct_AuthRevReqBaggage 528
+#define OBJ_setct_AuthRevReqBaggage OBJ_set_ctype,9L
+
+#define SN_setct_AuthRevResBaggage "setct-AuthRevResBaggage"
+#define NID_setct_AuthRevResBaggage 529
+#define OBJ_setct_AuthRevResBaggage OBJ_set_ctype,10L
+
+#define SN_setct_CapTokenSeq "setct-CapTokenSeq"
+#define NID_setct_CapTokenSeq 530
+#define OBJ_setct_CapTokenSeq OBJ_set_ctype,11L
+
+#define SN_setct_PInitResData "setct-PInitResData"
+#define NID_setct_PInitResData 531
+#define OBJ_setct_PInitResData OBJ_set_ctype,12L
+
+#define SN_setct_PI_TBS "setct-PI-TBS"
+#define NID_setct_PI_TBS 532
+#define OBJ_setct_PI_TBS OBJ_set_ctype,13L
+
+#define SN_setct_PResData "setct-PResData"
+#define NID_setct_PResData 533
+#define OBJ_setct_PResData OBJ_set_ctype,14L
+
+#define SN_setct_AuthReqTBS "setct-AuthReqTBS"
+#define NID_setct_AuthReqTBS 534
+#define OBJ_setct_AuthReqTBS OBJ_set_ctype,16L
+
+#define SN_setct_AuthResTBS "setct-AuthResTBS"
+#define NID_setct_AuthResTBS 535
+#define OBJ_setct_AuthResTBS OBJ_set_ctype,17L
+
+#define SN_setct_AuthResTBSX "setct-AuthResTBSX"
+#define NID_setct_AuthResTBSX 536
+#define OBJ_setct_AuthResTBSX OBJ_set_ctype,18L
+
+#define SN_setct_AuthTokenTBS "setct-AuthTokenTBS"
+#define NID_setct_AuthTokenTBS 537
+#define OBJ_setct_AuthTokenTBS OBJ_set_ctype,19L
+
+#define SN_setct_CapTokenData "setct-CapTokenData"
+#define NID_setct_CapTokenData 538
+#define OBJ_setct_CapTokenData OBJ_set_ctype,20L
+
+#define SN_setct_CapTokenTBS "setct-CapTokenTBS"
+#define NID_setct_CapTokenTBS 539
+#define OBJ_setct_CapTokenTBS OBJ_set_ctype,21L
+
+#define SN_setct_AcqCardCodeMsg "setct-AcqCardCodeMsg"
+#define NID_setct_AcqCardCodeMsg 540
+#define OBJ_setct_AcqCardCodeMsg OBJ_set_ctype,22L
+
+#define SN_setct_AuthRevReqTBS "setct-AuthRevReqTBS"
+#define NID_setct_AuthRevReqTBS 541
+#define OBJ_setct_AuthRevReqTBS OBJ_set_ctype,23L
+
+#define SN_setct_AuthRevResData "setct-AuthRevResData"
+#define NID_setct_AuthRevResData 542
+#define OBJ_setct_AuthRevResData OBJ_set_ctype,24L
+
+#define SN_setct_AuthRevResTBS "setct-AuthRevResTBS"
+#define NID_setct_AuthRevResTBS 543
+#define OBJ_setct_AuthRevResTBS OBJ_set_ctype,25L
+
+#define SN_setct_CapReqTBS "setct-CapReqTBS"
+#define NID_setct_CapReqTBS 544
+#define OBJ_setct_CapReqTBS OBJ_set_ctype,26L
+
+#define SN_setct_CapReqTBSX "setct-CapReqTBSX"
+#define NID_setct_CapReqTBSX 545
+#define OBJ_setct_CapReqTBSX OBJ_set_ctype,27L
+
+#define SN_setct_CapResData "setct-CapResData"
+#define NID_setct_CapResData 546
+#define OBJ_setct_CapResData OBJ_set_ctype,28L
+
+#define SN_setct_CapRevReqTBS "setct-CapRevReqTBS"
+#define NID_setct_CapRevReqTBS 547
+#define OBJ_setct_CapRevReqTBS OBJ_set_ctype,29L
+
+#define SN_setct_CapRevReqTBSX "setct-CapRevReqTBSX"
+#define NID_setct_CapRevReqTBSX 548
+#define OBJ_setct_CapRevReqTBSX OBJ_set_ctype,30L
+
+#define SN_setct_CapRevResData "setct-CapRevResData"
+#define NID_setct_CapRevResData 549
+#define OBJ_setct_CapRevResData OBJ_set_ctype,31L
+
+#define SN_setct_CredReqTBS "setct-CredReqTBS"
+#define NID_setct_CredReqTBS 550
+#define OBJ_setct_CredReqTBS OBJ_set_ctype,32L
+
+#define SN_setct_CredReqTBSX "setct-CredReqTBSX"
+#define NID_setct_CredReqTBSX 551
+#define OBJ_setct_CredReqTBSX OBJ_set_ctype,33L
+
+#define SN_setct_CredResData "setct-CredResData"
+#define NID_setct_CredResData 552
+#define OBJ_setct_CredResData OBJ_set_ctype,34L
+
+#define SN_setct_CredRevReqTBS "setct-CredRevReqTBS"
+#define NID_setct_CredRevReqTBS 553
+#define OBJ_setct_CredRevReqTBS OBJ_set_ctype,35L
+
+#define SN_setct_CredRevReqTBSX "setct-CredRevReqTBSX"
+#define NID_setct_CredRevReqTBSX 554
+#define OBJ_setct_CredRevReqTBSX OBJ_set_ctype,36L
+
+#define SN_setct_CredRevResData "setct-CredRevResData"
+#define NID_setct_CredRevResData 555
+#define OBJ_setct_CredRevResData OBJ_set_ctype,37L
+
+#define SN_setct_PCertReqData "setct-PCertReqData"
+#define NID_setct_PCertReqData 556
+#define OBJ_setct_PCertReqData OBJ_set_ctype,38L
+
+#define SN_setct_PCertResTBS "setct-PCertResTBS"
+#define NID_setct_PCertResTBS 557
+#define OBJ_setct_PCertResTBS OBJ_set_ctype,39L
+
+#define SN_setct_BatchAdminReqData "setct-BatchAdminReqData"
+#define NID_setct_BatchAdminReqData 558
+#define OBJ_setct_BatchAdminReqData OBJ_set_ctype,40L
+
+#define SN_setct_BatchAdminResData "setct-BatchAdminResData"
+#define NID_setct_BatchAdminResData 559
+#define OBJ_setct_BatchAdminResData OBJ_set_ctype,41L
+
+#define SN_setct_CardCInitResTBS "setct-CardCInitResTBS"
+#define NID_setct_CardCInitResTBS 560
+#define OBJ_setct_CardCInitResTBS OBJ_set_ctype,42L
+
+#define SN_setct_MeAqCInitResTBS "setct-MeAqCInitResTBS"
+#define NID_setct_MeAqCInitResTBS 561
+#define OBJ_setct_MeAqCInitResTBS OBJ_set_ctype,43L
+
+#define SN_setct_RegFormResTBS "setct-RegFormResTBS"
+#define NID_setct_RegFormResTBS 562
+#define OBJ_setct_RegFormResTBS OBJ_set_ctype,44L
+
+#define SN_setct_CertReqData "setct-CertReqData"
+#define NID_setct_CertReqData 563
+#define OBJ_setct_CertReqData OBJ_set_ctype,45L
+
+#define SN_setct_CertReqTBS "setct-CertReqTBS"
+#define NID_setct_CertReqTBS 564
+#define OBJ_setct_CertReqTBS OBJ_set_ctype,46L
+
+#define SN_setct_CertResData "setct-CertResData"
+#define NID_setct_CertResData 565
+#define OBJ_setct_CertResData OBJ_set_ctype,47L
+
+#define SN_setct_CertInqReqTBS "setct-CertInqReqTBS"
+#define NID_setct_CertInqReqTBS 566
+#define OBJ_setct_CertInqReqTBS OBJ_set_ctype,48L
+
+#define SN_setct_ErrorTBS "setct-ErrorTBS"
+#define NID_setct_ErrorTBS 567
+#define OBJ_setct_ErrorTBS OBJ_set_ctype,49L
+
+#define SN_setct_PIDualSignedTBE "setct-PIDualSignedTBE"
+#define NID_setct_PIDualSignedTBE 568
+#define OBJ_setct_PIDualSignedTBE OBJ_set_ctype,50L
+
+#define SN_setct_PIUnsignedTBE "setct-PIUnsignedTBE"
+#define NID_setct_PIUnsignedTBE 569
+#define OBJ_setct_PIUnsignedTBE OBJ_set_ctype,51L
+
+#define SN_setct_AuthReqTBE "setct-AuthReqTBE"
+#define NID_setct_AuthReqTBE 570
+#define OBJ_setct_AuthReqTBE OBJ_set_ctype,52L
+
+#define SN_setct_AuthResTBE "setct-AuthResTBE"
+#define NID_setct_AuthResTBE 571
+#define OBJ_setct_AuthResTBE OBJ_set_ctype,53L
+
+#define SN_setct_AuthResTBEX "setct-AuthResTBEX"
+#define NID_setct_AuthResTBEX 572
+#define OBJ_setct_AuthResTBEX OBJ_set_ctype,54L
+
+#define SN_setct_AuthTokenTBE "setct-AuthTokenTBE"
+#define NID_setct_AuthTokenTBE 573
+#define OBJ_setct_AuthTokenTBE OBJ_set_ctype,55L
+
+#define SN_setct_CapTokenTBE "setct-CapTokenTBE"
+#define NID_setct_CapTokenTBE 574
+#define OBJ_setct_CapTokenTBE OBJ_set_ctype,56L
+
+#define SN_setct_CapTokenTBEX "setct-CapTokenTBEX"
+#define NID_setct_CapTokenTBEX 575
+#define OBJ_setct_CapTokenTBEX OBJ_set_ctype,57L
+
+#define SN_setct_AcqCardCodeMsgTBE "setct-AcqCardCodeMsgTBE"
+#define NID_setct_AcqCardCodeMsgTBE 576
+#define OBJ_setct_AcqCardCodeMsgTBE OBJ_set_ctype,58L
+
+#define SN_setct_AuthRevReqTBE "setct-AuthRevReqTBE"
+#define NID_setct_AuthRevReqTBE 577
+#define OBJ_setct_AuthRevReqTBE OBJ_set_ctype,59L
+
+#define SN_setct_AuthRevResTBE "setct-AuthRevResTBE"
+#define NID_setct_AuthRevResTBE 578
+#define OBJ_setct_AuthRevResTBE OBJ_set_ctype,60L
+
+#define SN_setct_AuthRevResTBEB "setct-AuthRevResTBEB"
+#define NID_setct_AuthRevResTBEB 579
+#define OBJ_setct_AuthRevResTBEB OBJ_set_ctype,61L
+
+#define SN_setct_CapReqTBE "setct-CapReqTBE"
+#define NID_setct_CapReqTBE 580
+#define OBJ_setct_CapReqTBE OBJ_set_ctype,62L
+
+#define SN_setct_CapReqTBEX "setct-CapReqTBEX"
+#define NID_setct_CapReqTBEX 581
+#define OBJ_setct_CapReqTBEX OBJ_set_ctype,63L
+
+#define SN_setct_CapResTBE "setct-CapResTBE"
+#define NID_setct_CapResTBE 582
+#define OBJ_setct_CapResTBE OBJ_set_ctype,64L
+
+#define SN_setct_CapRevReqTBE "setct-CapRevReqTBE"
+#define NID_setct_CapRevReqTBE 583
+#define OBJ_setct_CapRevReqTBE OBJ_set_ctype,65L
+
+#define SN_setct_CapRevReqTBEX "setct-CapRevReqTBEX"
+#define NID_setct_CapRevReqTBEX 584
+#define OBJ_setct_CapRevReqTBEX OBJ_set_ctype,66L
+
+#define SN_setct_CapRevResTBE "setct-CapRevResTBE"
+#define NID_setct_CapRevResTBE 585
+#define OBJ_setct_CapRevResTBE OBJ_set_ctype,67L
+
+#define SN_setct_CredReqTBE "setct-CredReqTBE"
+#define NID_setct_CredReqTBE 586
+#define OBJ_setct_CredReqTBE OBJ_set_ctype,68L
+
+#define SN_setct_CredReqTBEX "setct-CredReqTBEX"
+#define NID_setct_CredReqTBEX 587
+#define OBJ_setct_CredReqTBEX OBJ_set_ctype,69L
+
+#define SN_setct_CredResTBE "setct-CredResTBE"
+#define NID_setct_CredResTBE 588
+#define OBJ_setct_CredResTBE OBJ_set_ctype,70L
+
+#define SN_setct_CredRevReqTBE "setct-CredRevReqTBE"
+#define NID_setct_CredRevReqTBE 589
+#define OBJ_setct_CredRevReqTBE OBJ_set_ctype,71L
+
+#define SN_setct_CredRevReqTBEX "setct-CredRevReqTBEX"
+#define NID_setct_CredRevReqTBEX 590
+#define OBJ_setct_CredRevReqTBEX OBJ_set_ctype,72L
+
+#define SN_setct_CredRevResTBE "setct-CredRevResTBE"
+#define NID_setct_CredRevResTBE 591
+#define OBJ_setct_CredRevResTBE OBJ_set_ctype,73L
+
+#define SN_setct_BatchAdminReqTBE "setct-BatchAdminReqTBE"
+#define NID_setct_BatchAdminReqTBE 592
+#define OBJ_setct_BatchAdminReqTBE OBJ_set_ctype,74L
+
+#define SN_setct_BatchAdminResTBE "setct-BatchAdminResTBE"
+#define NID_setct_BatchAdminResTBE 593
+#define OBJ_setct_BatchAdminResTBE OBJ_set_ctype,75L
+
+#define SN_setct_RegFormReqTBE "setct-RegFormReqTBE"
+#define NID_setct_RegFormReqTBE 594
+#define OBJ_setct_RegFormReqTBE OBJ_set_ctype,76L
+
+#define SN_setct_CertReqTBE "setct-CertReqTBE"
+#define NID_setct_CertReqTBE 595
+#define OBJ_setct_CertReqTBE OBJ_set_ctype,77L
+
+#define SN_setct_CertReqTBEX "setct-CertReqTBEX"
+#define NID_setct_CertReqTBEX 596
+#define OBJ_setct_CertReqTBEX OBJ_set_ctype,78L
+
+#define SN_setct_CertResTBE "setct-CertResTBE"
+#define NID_setct_CertResTBE 597
+#define OBJ_setct_CertResTBE OBJ_set_ctype,79L
+
+#define SN_setct_CRLNotificationTBS "setct-CRLNotificationTBS"
+#define NID_setct_CRLNotificationTBS 598
+#define OBJ_setct_CRLNotificationTBS OBJ_set_ctype,80L
+
+#define SN_setct_CRLNotificationResTBS "setct-CRLNotificationResTBS"
+#define NID_setct_CRLNotificationResTBS 599
+#define OBJ_setct_CRLNotificationResTBS OBJ_set_ctype,81L
+
+#define SN_setct_BCIDistributionTBS "setct-BCIDistributionTBS"
+#define NID_setct_BCIDistributionTBS 600
+#define OBJ_setct_BCIDistributionTBS OBJ_set_ctype,82L
+
+#define SN_setext_genCrypt "setext-genCrypt"
+#define LN_setext_genCrypt "generic cryptogram"
+#define NID_setext_genCrypt 601
+#define OBJ_setext_genCrypt OBJ_set_msgExt,1L
+
+#define SN_setext_miAuth "setext-miAuth"
+#define LN_setext_miAuth "merchant initiated auth"
+#define NID_setext_miAuth 602
+#define OBJ_setext_miAuth OBJ_set_msgExt,3L
+
+#define SN_setext_pinSecure "setext-pinSecure"
+#define NID_setext_pinSecure 603
+#define OBJ_setext_pinSecure OBJ_set_msgExt,4L
+
+#define SN_setext_pinAny "setext-pinAny"
+#define NID_setext_pinAny 604
+#define OBJ_setext_pinAny OBJ_set_msgExt,5L
+
+#define SN_setext_track2 "setext-track2"
+#define NID_setext_track2 605
+#define OBJ_setext_track2 OBJ_set_msgExt,7L
+
+#define SN_setext_cv "setext-cv"
+#define LN_setext_cv "additional verification"
+#define NID_setext_cv 606
+#define OBJ_setext_cv OBJ_set_msgExt,8L
+
+#define SN_set_policy_root "set-policy-root"
+#define NID_set_policy_root 607
+#define OBJ_set_policy_root OBJ_set_policy,0L
+
+#define SN_setCext_hashedRoot "setCext-hashedRoot"
+#define NID_setCext_hashedRoot 608
+#define OBJ_setCext_hashedRoot OBJ_set_certExt,0L
+
+#define SN_setCext_certType "setCext-certType"
+#define NID_setCext_certType 609
+#define OBJ_setCext_certType OBJ_set_certExt,1L
+
+#define SN_setCext_merchData "setCext-merchData"
+#define NID_setCext_merchData 610
+#define OBJ_setCext_merchData OBJ_set_certExt,2L
+
+#define SN_setCext_cCertRequired "setCext-cCertRequired"
+#define NID_setCext_cCertRequired 611
+#define OBJ_setCext_cCertRequired OBJ_set_certExt,3L
+
+#define SN_setCext_tunneling "setCext-tunneling"
+#define NID_setCext_tunneling 612
+#define OBJ_setCext_tunneling OBJ_set_certExt,4L
+
+#define SN_setCext_setExt "setCext-setExt"
+#define NID_setCext_setExt 613
+#define OBJ_setCext_setExt OBJ_set_certExt,5L
+
+#define SN_setCext_setQualf "setCext-setQualf"
+#define NID_setCext_setQualf 614
+#define OBJ_setCext_setQualf OBJ_set_certExt,6L
+
+#define SN_setCext_PGWYcapabilities "setCext-PGWYcapabilities"
+#define NID_setCext_PGWYcapabilities 615
+#define OBJ_setCext_PGWYcapabilities OBJ_set_certExt,7L
+
+#define SN_setCext_TokenIdentifier "setCext-TokenIdentifier"
+#define NID_setCext_TokenIdentifier 616
+#define OBJ_setCext_TokenIdentifier OBJ_set_certExt,8L
+
+#define SN_setCext_Track2Data "setCext-Track2Data"
+#define NID_setCext_Track2Data 617
+#define OBJ_setCext_Track2Data OBJ_set_certExt,9L
+
+#define SN_setCext_TokenType "setCext-TokenType"
+#define NID_setCext_TokenType 618
+#define OBJ_setCext_TokenType OBJ_set_certExt,10L
+
+#define SN_setCext_IssuerCapabilities "setCext-IssuerCapabilities"
+#define NID_setCext_IssuerCapabilities 619
+#define OBJ_setCext_IssuerCapabilities OBJ_set_certExt,11L
+
+#define SN_setAttr_Cert "setAttr-Cert"
+#define NID_setAttr_Cert 620
+#define OBJ_setAttr_Cert OBJ_set_attr,0L
+
+#define SN_setAttr_PGWYcap "setAttr-PGWYcap"
+#define LN_setAttr_PGWYcap "payment gateway capabilities"
+#define NID_setAttr_PGWYcap 621
+#define OBJ_setAttr_PGWYcap OBJ_set_attr,1L
+
+#define SN_setAttr_TokenType "setAttr-TokenType"
+#define NID_setAttr_TokenType 622
+#define OBJ_setAttr_TokenType OBJ_set_attr,2L
+
+#define SN_setAttr_IssCap "setAttr-IssCap"
+#define LN_setAttr_IssCap "issuer capabilities"
+#define NID_setAttr_IssCap 623
+#define OBJ_setAttr_IssCap OBJ_set_attr,3L
+
+#define SN_set_rootKeyThumb "set-rootKeyThumb"
+#define NID_set_rootKeyThumb 624
+#define OBJ_set_rootKeyThumb OBJ_setAttr_Cert,0L
+
+#define SN_set_addPolicy "set-addPolicy"
+#define NID_set_addPolicy 625
+#define OBJ_set_addPolicy OBJ_setAttr_Cert,1L
+
+#define SN_setAttr_Token_EMV "setAttr-Token-EMV"
+#define NID_setAttr_Token_EMV 626
+#define OBJ_setAttr_Token_EMV OBJ_setAttr_TokenType,1L
+
+#define SN_setAttr_Token_B0Prime "setAttr-Token-B0Prime"
+#define NID_setAttr_Token_B0Prime 627
+#define OBJ_setAttr_Token_B0Prime OBJ_setAttr_TokenType,2L
+
+#define SN_setAttr_IssCap_CVM "setAttr-IssCap-CVM"
+#define NID_setAttr_IssCap_CVM 628
+#define OBJ_setAttr_IssCap_CVM OBJ_setAttr_IssCap,3L
+
+#define SN_setAttr_IssCap_T2 "setAttr-IssCap-T2"
+#define NID_setAttr_IssCap_T2 629
+#define OBJ_setAttr_IssCap_T2 OBJ_setAttr_IssCap,4L
+
+#define SN_setAttr_IssCap_Sig "setAttr-IssCap-Sig"
+#define NID_setAttr_IssCap_Sig 630
+#define OBJ_setAttr_IssCap_Sig OBJ_setAttr_IssCap,5L
+
+#define SN_setAttr_GenCryptgrm "setAttr-GenCryptgrm"
+#define LN_setAttr_GenCryptgrm "generate cryptogram"
+#define NID_setAttr_GenCryptgrm 631
+#define OBJ_setAttr_GenCryptgrm OBJ_setAttr_IssCap_CVM,1L
+
+#define SN_setAttr_T2Enc "setAttr-T2Enc"
+#define LN_setAttr_T2Enc "encrypted track 2"
+#define NID_setAttr_T2Enc 632
+#define OBJ_setAttr_T2Enc OBJ_setAttr_IssCap_T2,1L
+
+#define SN_setAttr_T2cleartxt "setAttr-T2cleartxt"
+#define LN_setAttr_T2cleartxt "cleartext track 2"
+#define NID_setAttr_T2cleartxt 633
+#define OBJ_setAttr_T2cleartxt OBJ_setAttr_IssCap_T2,2L
+
+#define SN_setAttr_TokICCsig "setAttr-TokICCsig"
+#define LN_setAttr_TokICCsig "ICC or token signature"
+#define NID_setAttr_TokICCsig 634
+#define OBJ_setAttr_TokICCsig OBJ_setAttr_IssCap_Sig,1L
+
+#define SN_setAttr_SecDevSig "setAttr-SecDevSig"
+#define LN_setAttr_SecDevSig "secure device signature"
+#define NID_setAttr_SecDevSig 635
+#define OBJ_setAttr_SecDevSig OBJ_setAttr_IssCap_Sig,2L
+
+#define SN_set_brand_IATA_ATA "set-brand-IATA-ATA"
+#define NID_set_brand_IATA_ATA 636
+#define OBJ_set_brand_IATA_ATA OBJ_set_brand,1L
+
+#define SN_set_brand_Diners "set-brand-Diners"
+#define NID_set_brand_Diners 637
+#define OBJ_set_brand_Diners OBJ_set_brand,30L
+
+#define SN_set_brand_AmericanExpress "set-brand-AmericanExpress"
+#define NID_set_brand_AmericanExpress 638
+#define OBJ_set_brand_AmericanExpress OBJ_set_brand,34L
+
+#define SN_set_brand_JCB "set-brand-JCB"
+#define NID_set_brand_JCB 639
+#define OBJ_set_brand_JCB OBJ_set_brand,35L
+
+#define SN_set_brand_Visa "set-brand-Visa"
+#define NID_set_brand_Visa 640
+#define OBJ_set_brand_Visa OBJ_set_brand,4L
+
+#define SN_set_brand_MasterCard "set-brand-MasterCard"
+#define NID_set_brand_MasterCard 641
+#define OBJ_set_brand_MasterCard OBJ_set_brand,5L
+
+#define SN_set_brand_Novus "set-brand-Novus"
+#define NID_set_brand_Novus 642
+#define OBJ_set_brand_Novus OBJ_set_brand,6011L
+
+#define SN_des_cdmf "DES-CDMF"
+#define LN_des_cdmf "des-cdmf"
+#define NID_des_cdmf 643
+#define OBJ_des_cdmf OBJ_rsadsi,3L,10L
+
+#define SN_rsaOAEPEncryptionSET "rsaOAEPEncryptionSET"
+#define NID_rsaOAEPEncryptionSET 644
+#define OBJ_rsaOAEPEncryptionSET OBJ_rsadsi,1L,1L,6L
+
+#define SN_ipsec3 "Oakley-EC2N-3"
+#define LN_ipsec3 "ipsec3"
+#define NID_ipsec3 749
+
+#define SN_ipsec4 "Oakley-EC2N-4"
+#define LN_ipsec4 "ipsec4"
+#define NID_ipsec4 750
+
+#define SN_whirlpool "whirlpool"
+#define NID_whirlpool 804
+#define OBJ_whirlpool OBJ_iso,0L,10118L,3L,0L,55L
+
+#define SN_cryptopro "cryptopro"
+#define NID_cryptopro 805
+#define OBJ_cryptopro OBJ_member_body,643L,2L,2L
+
+#define SN_cryptocom "cryptocom"
+#define NID_cryptocom 806
+#define OBJ_cryptocom OBJ_member_body,643L,2L,9L
+
+#define SN_id_GostR3411_94_with_GostR3410_2001 "id-GostR3411-94-with-GostR3410-2001"
+#define LN_id_GostR3411_94_with_GostR3410_2001 "GOST R 34.11-94 with GOST R 34.10-2001"
+#define NID_id_GostR3411_94_with_GostR3410_2001 807
+#define OBJ_id_GostR3411_94_with_GostR3410_2001 OBJ_cryptopro,3L
+
+#define SN_id_GostR3411_94_with_GostR3410_94 "id-GostR3411-94-with-GostR3410-94"
+#define LN_id_GostR3411_94_with_GostR3410_94 "GOST R 34.11-94 with GOST R 34.10-94"
+#define NID_id_GostR3411_94_with_GostR3410_94 808
+#define OBJ_id_GostR3411_94_with_GostR3410_94 OBJ_cryptopro,4L
+
+#define SN_id_GostR3411_94 "md_gost94"
+#define LN_id_GostR3411_94 "GOST R 34.11-94"
+#define NID_id_GostR3411_94 809
+#define OBJ_id_GostR3411_94 OBJ_cryptopro,9L
+
+#define SN_id_HMACGostR3411_94 "id-HMACGostR3411-94"
+#define LN_id_HMACGostR3411_94 "HMAC GOST 34.11-94"
+#define NID_id_HMACGostR3411_94 810
+#define OBJ_id_HMACGostR3411_94 OBJ_cryptopro,10L
+
+#define SN_id_GostR3410_2001 "gost2001"
+#define LN_id_GostR3410_2001 "GOST R 34.10-2001"
+#define NID_id_GostR3410_2001 811
+#define OBJ_id_GostR3410_2001 OBJ_cryptopro,19L
+
+#define SN_id_GostR3410_94 "gost94"
+#define LN_id_GostR3410_94 "GOST R 34.10-94"
+#define NID_id_GostR3410_94 812
+#define OBJ_id_GostR3410_94 OBJ_cryptopro,20L
+
+#define SN_id_Gost28147_89 "gost89"
+#define LN_id_Gost28147_89 "GOST 28147-89"
+#define NID_id_Gost28147_89 813
+#define OBJ_id_Gost28147_89 OBJ_cryptopro,21L
+
+#define SN_gost89_cnt "gost89-cnt"
+#define NID_gost89_cnt 814
+
+#define SN_id_Gost28147_89_MAC "gost-mac"
+#define LN_id_Gost28147_89_MAC "GOST 28147-89 MAC"
+#define NID_id_Gost28147_89_MAC 815
+#define OBJ_id_Gost28147_89_MAC OBJ_cryptopro,22L
+
+#define SN_id_GostR3411_94_prf "prf-gostr3411-94"
+#define LN_id_GostR3411_94_prf "GOST R 34.11-94 PRF"
+#define NID_id_GostR3411_94_prf 816
+#define OBJ_id_GostR3411_94_prf OBJ_cryptopro,23L
+
+#define SN_id_GostR3410_2001DH "id-GostR3410-2001DH"
+#define LN_id_GostR3410_2001DH "GOST R 34.10-2001 DH"
+#define NID_id_GostR3410_2001DH 817
+#define OBJ_id_GostR3410_2001DH OBJ_cryptopro,98L
+
+#define SN_id_GostR3410_94DH "id-GostR3410-94DH"
+#define LN_id_GostR3410_94DH "GOST R 34.10-94 DH"
+#define NID_id_GostR3410_94DH 818
+#define OBJ_id_GostR3410_94DH OBJ_cryptopro,99L
+
+#define SN_id_Gost28147_89_CryptoPro_KeyMeshing "id-Gost28147-89-CryptoPro-KeyMeshing"
+#define NID_id_Gost28147_89_CryptoPro_KeyMeshing 819
+#define OBJ_id_Gost28147_89_CryptoPro_KeyMeshing OBJ_cryptopro,14L,1L
+
+#define SN_id_Gost28147_89_None_KeyMeshing "id-Gost28147-89-None-KeyMeshing"
+#define NID_id_Gost28147_89_None_KeyMeshing 820
+#define OBJ_id_Gost28147_89_None_KeyMeshing OBJ_cryptopro,14L,0L
+
+#define SN_id_GostR3411_94_TestParamSet "id-GostR3411-94-TestParamSet"
+#define NID_id_GostR3411_94_TestParamSet 821
+#define OBJ_id_GostR3411_94_TestParamSet OBJ_cryptopro,30L,0L
+
+#define SN_id_GostR3411_94_CryptoProParamSet "id-GostR3411-94-CryptoProParamSet"
+#define NID_id_GostR3411_94_CryptoProParamSet 822
+#define OBJ_id_GostR3411_94_CryptoProParamSet OBJ_cryptopro,30L,1L
+
+#define SN_id_Gost28147_89_TestParamSet "id-Gost28147-89-TestParamSet"
+#define NID_id_Gost28147_89_TestParamSet 823
+#define OBJ_id_Gost28147_89_TestParamSet OBJ_cryptopro,31L,0L
+
+#define SN_id_Gost28147_89_CryptoPro_A_ParamSet "id-Gost28147-89-CryptoPro-A-ParamSet"
+#define NID_id_Gost28147_89_CryptoPro_A_ParamSet 824
+#define OBJ_id_Gost28147_89_CryptoPro_A_ParamSet OBJ_cryptopro,31L,1L
+
+#define SN_id_Gost28147_89_CryptoPro_B_ParamSet "id-Gost28147-89-CryptoPro-B-ParamSet"
+#define NID_id_Gost28147_89_CryptoPro_B_ParamSet 825
+#define OBJ_id_Gost28147_89_CryptoPro_B_ParamSet OBJ_cryptopro,31L,2L
+
+#define SN_id_Gost28147_89_CryptoPro_C_ParamSet "id-Gost28147-89-CryptoPro-C-ParamSet"
+#define NID_id_Gost28147_89_CryptoPro_C_ParamSet 826
+#define OBJ_id_Gost28147_89_CryptoPro_C_ParamSet OBJ_cryptopro,31L,3L
+
+#define SN_id_Gost28147_89_CryptoPro_D_ParamSet "id-Gost28147-89-CryptoPro-D-ParamSet"
+#define NID_id_Gost28147_89_CryptoPro_D_ParamSet 827
+#define OBJ_id_Gost28147_89_CryptoPro_D_ParamSet OBJ_cryptopro,31L,4L
+
+#define SN_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet "id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet"
+#define NID_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet 828
+#define OBJ_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet OBJ_cryptopro,31L,5L
+
+#define SN_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet "id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet"
+#define NID_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet 829
+#define OBJ_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet OBJ_cryptopro,31L,6L
+
+#define SN_id_Gost28147_89_CryptoPro_RIC_1_ParamSet "id-Gost28147-89-CryptoPro-RIC-1-ParamSet"
+#define NID_id_Gost28147_89_CryptoPro_RIC_1_ParamSet 830
+#define OBJ_id_Gost28147_89_CryptoPro_RIC_1_ParamSet OBJ_cryptopro,31L,7L
+
+#define SN_id_GostR3410_94_TestParamSet "id-GostR3410-94-TestParamSet"
+#define NID_id_GostR3410_94_TestParamSet 831
+#define OBJ_id_GostR3410_94_TestParamSet OBJ_cryptopro,32L,0L
+
+#define SN_id_GostR3410_94_CryptoPro_A_ParamSet "id-GostR3410-94-CryptoPro-A-ParamSet"
+#define NID_id_GostR3410_94_CryptoPro_A_ParamSet 832
+#define OBJ_id_GostR3410_94_CryptoPro_A_ParamSet OBJ_cryptopro,32L,2L
+
+#define SN_id_GostR3410_94_CryptoPro_B_ParamSet "id-GostR3410-94-CryptoPro-B-ParamSet"
+#define NID_id_GostR3410_94_CryptoPro_B_ParamSet 833
+#define OBJ_id_GostR3410_94_CryptoPro_B_ParamSet OBJ_cryptopro,32L,3L
+
+#define SN_id_GostR3410_94_CryptoPro_C_ParamSet "id-GostR3410-94-CryptoPro-C-ParamSet"
+#define NID_id_GostR3410_94_CryptoPro_C_ParamSet 834
+#define OBJ_id_GostR3410_94_CryptoPro_C_ParamSet OBJ_cryptopro,32L,4L
+
+#define SN_id_GostR3410_94_CryptoPro_D_ParamSet "id-GostR3410-94-CryptoPro-D-ParamSet"
+#define NID_id_GostR3410_94_CryptoPro_D_ParamSet 835
+#define OBJ_id_GostR3410_94_CryptoPro_D_ParamSet OBJ_cryptopro,32L,5L
+
+#define SN_id_GostR3410_94_CryptoPro_XchA_ParamSet "id-GostR3410-94-CryptoPro-XchA-ParamSet"
+#define NID_id_GostR3410_94_CryptoPro_XchA_ParamSet 836
+#define OBJ_id_GostR3410_94_CryptoPro_XchA_ParamSet OBJ_cryptopro,33L,1L
+
+#define SN_id_GostR3410_94_CryptoPro_XchB_ParamSet "id-GostR3410-94-CryptoPro-XchB-ParamSet"
+#define NID_id_GostR3410_94_CryptoPro_XchB_ParamSet 837
+#define OBJ_id_GostR3410_94_CryptoPro_XchB_ParamSet OBJ_cryptopro,33L,2L
+
+#define SN_id_GostR3410_94_CryptoPro_XchC_ParamSet "id-GostR3410-94-CryptoPro-XchC-ParamSet"
+#define NID_id_GostR3410_94_CryptoPro_XchC_ParamSet 838
+#define OBJ_id_GostR3410_94_CryptoPro_XchC_ParamSet OBJ_cryptopro,33L,3L
+
+#define SN_id_GostR3410_2001_TestParamSet "id-GostR3410-2001-TestParamSet"
+#define NID_id_GostR3410_2001_TestParamSet 839
+#define OBJ_id_GostR3410_2001_TestParamSet OBJ_cryptopro,35L,0L
+
+#define SN_id_GostR3410_2001_CryptoPro_A_ParamSet "id-GostR3410-2001-CryptoPro-A-ParamSet"
+#define NID_id_GostR3410_2001_CryptoPro_A_ParamSet 840
+#define OBJ_id_GostR3410_2001_CryptoPro_A_ParamSet OBJ_cryptopro,35L,1L
+
+#define SN_id_GostR3410_2001_CryptoPro_B_ParamSet "id-GostR3410-2001-CryptoPro-B-ParamSet"
+#define NID_id_GostR3410_2001_CryptoPro_B_ParamSet 841
+#define OBJ_id_GostR3410_2001_CryptoPro_B_ParamSet OBJ_cryptopro,35L,2L
+
+#define SN_id_GostR3410_2001_CryptoPro_C_ParamSet "id-GostR3410-2001-CryptoPro-C-ParamSet"
+#define NID_id_GostR3410_2001_CryptoPro_C_ParamSet 842
+#define OBJ_id_GostR3410_2001_CryptoPro_C_ParamSet OBJ_cryptopro,35L,3L
+
+#define SN_id_GostR3410_2001_CryptoPro_XchA_ParamSet "id-GostR3410-2001-CryptoPro-XchA-ParamSet"
+#define NID_id_GostR3410_2001_CryptoPro_XchA_ParamSet 843
+#define OBJ_id_GostR3410_2001_CryptoPro_XchA_ParamSet OBJ_cryptopro,36L,0L
+
+#define SN_id_GostR3410_2001_CryptoPro_XchB_ParamSet "id-GostR3410-2001-CryptoPro-XchB-ParamSet"
+#define NID_id_GostR3410_2001_CryptoPro_XchB_ParamSet 844
+#define OBJ_id_GostR3410_2001_CryptoPro_XchB_ParamSet OBJ_cryptopro,36L,1L
+
+#define SN_id_GostR3410_94_a "id-GostR3410-94-a"
+#define NID_id_GostR3410_94_a 845
+#define OBJ_id_GostR3410_94_a OBJ_id_GostR3410_94,1L
+
+#define SN_id_GostR3410_94_aBis "id-GostR3410-94-aBis"
+#define NID_id_GostR3410_94_aBis 846
+#define OBJ_id_GostR3410_94_aBis OBJ_id_GostR3410_94,2L
+
+#define SN_id_GostR3410_94_b "id-GostR3410-94-b"
+#define NID_id_GostR3410_94_b 847
+#define OBJ_id_GostR3410_94_b OBJ_id_GostR3410_94,3L
+
+#define SN_id_GostR3410_94_bBis "id-GostR3410-94-bBis"
+#define NID_id_GostR3410_94_bBis 848
+#define OBJ_id_GostR3410_94_bBis OBJ_id_GostR3410_94,4L
+
+#define SN_id_Gost28147_89_cc "id-Gost28147-89-cc"
+#define LN_id_Gost28147_89_cc "GOST 28147-89 Cryptocom ParamSet"
+#define NID_id_Gost28147_89_cc 849
+#define OBJ_id_Gost28147_89_cc OBJ_cryptocom,1L,6L,1L
+
+#define SN_id_GostR3410_94_cc "gost94cc"
+#define LN_id_GostR3410_94_cc "GOST 34.10-94 Cryptocom"
+#define NID_id_GostR3410_94_cc 850
+#define OBJ_id_GostR3410_94_cc OBJ_cryptocom,1L,5L,3L
+
+#define SN_id_GostR3410_2001_cc "gost2001cc"
+#define LN_id_GostR3410_2001_cc "GOST 34.10-2001 Cryptocom"
+#define NID_id_GostR3410_2001_cc 851
+#define OBJ_id_GostR3410_2001_cc OBJ_cryptocom,1L,5L,4L
+
+#define SN_id_GostR3411_94_with_GostR3410_94_cc "id-GostR3411-94-with-GostR3410-94-cc"
+#define LN_id_GostR3411_94_with_GostR3410_94_cc "GOST R 34.11-94 with GOST R 34.10-94 Cryptocom"
+#define NID_id_GostR3411_94_with_GostR3410_94_cc 852
+#define OBJ_id_GostR3411_94_with_GostR3410_94_cc OBJ_cryptocom,1L,3L,3L
+
+#define SN_id_GostR3411_94_with_GostR3410_2001_cc "id-GostR3411-94-with-GostR3410-2001-cc"
+#define LN_id_GostR3411_94_with_GostR3410_2001_cc "GOST R 34.11-94 with GOST R 34.10-2001 Cryptocom"
+#define NID_id_GostR3411_94_with_GostR3410_2001_cc 853
+#define OBJ_id_GostR3411_94_with_GostR3410_2001_cc OBJ_cryptocom,1L,3L,4L
+
+#define SN_id_GostR3410_2001_ParamSet_cc "id-GostR3410-2001-ParamSet-cc"
+#define LN_id_GostR3410_2001_ParamSet_cc "GOST R 3410-2001 Parameter Set Cryptocom"
+#define NID_id_GostR3410_2001_ParamSet_cc 854
+#define OBJ_id_GostR3410_2001_ParamSet_cc OBJ_cryptocom,1L,8L,1L
+
+#define SN_camellia_128_cbc "CAMELLIA-128-CBC"
+#define LN_camellia_128_cbc "camellia-128-cbc"
+#define NID_camellia_128_cbc 751
+#define OBJ_camellia_128_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,2L
+
+#define SN_camellia_192_cbc "CAMELLIA-192-CBC"
+#define LN_camellia_192_cbc "camellia-192-cbc"
+#define NID_camellia_192_cbc 752
+#define OBJ_camellia_192_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,3L
+
+#define SN_camellia_256_cbc "CAMELLIA-256-CBC"
+#define LN_camellia_256_cbc "camellia-256-cbc"
+#define NID_camellia_256_cbc 753
+#define OBJ_camellia_256_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,4L
+
+#define SN_id_camellia128_wrap "id-camellia128-wrap"
+#define NID_id_camellia128_wrap 907
+#define OBJ_id_camellia128_wrap 1L,2L,392L,200011L,61L,1L,1L,3L,2L
+
+#define SN_id_camellia192_wrap "id-camellia192-wrap"
+#define NID_id_camellia192_wrap 908
+#define OBJ_id_camellia192_wrap 1L,2L,392L,200011L,61L,1L,1L,3L,3L
+
+#define SN_id_camellia256_wrap "id-camellia256-wrap"
+#define NID_id_camellia256_wrap 909
+#define OBJ_id_camellia256_wrap 1L,2L,392L,200011L,61L,1L,1L,3L,4L
+
+#define OBJ_ntt_ds 0L,3L,4401L,5L
+
+#define OBJ_camellia OBJ_ntt_ds,3L,1L,9L
+
+#define SN_camellia_128_ecb "CAMELLIA-128-ECB"
+#define LN_camellia_128_ecb "camellia-128-ecb"
+#define NID_camellia_128_ecb 754
+#define OBJ_camellia_128_ecb OBJ_camellia,1L
+
+#define SN_camellia_128_ofb128 "CAMELLIA-128-OFB"
+#define LN_camellia_128_ofb128 "camellia-128-ofb"
+#define NID_camellia_128_ofb128 766
+#define OBJ_camellia_128_ofb128 OBJ_camellia,3L
+
+#define SN_camellia_128_cfb128 "CAMELLIA-128-CFB"
+#define LN_camellia_128_cfb128 "camellia-128-cfb"
+#define NID_camellia_128_cfb128 757
+#define OBJ_camellia_128_cfb128 OBJ_camellia,4L
+
+#define SN_camellia_192_ecb "CAMELLIA-192-ECB"
+#define LN_camellia_192_ecb "camellia-192-ecb"
+#define NID_camellia_192_ecb 755
+#define OBJ_camellia_192_ecb OBJ_camellia,21L
+
+#define SN_camellia_192_ofb128 "CAMELLIA-192-OFB"
+#define LN_camellia_192_ofb128 "camellia-192-ofb"
+#define NID_camellia_192_ofb128 767
+#define OBJ_camellia_192_ofb128 OBJ_camellia,23L
+
+#define SN_camellia_192_cfb128 "CAMELLIA-192-CFB"
+#define LN_camellia_192_cfb128 "camellia-192-cfb"
+#define NID_camellia_192_cfb128 758
+#define OBJ_camellia_192_cfb128 OBJ_camellia,24L
+
+#define SN_camellia_256_ecb "CAMELLIA-256-ECB"
+#define LN_camellia_256_ecb "camellia-256-ecb"
+#define NID_camellia_256_ecb 756
+#define OBJ_camellia_256_ecb OBJ_camellia,41L
+
+#define SN_camellia_256_ofb128 "CAMELLIA-256-OFB"
+#define LN_camellia_256_ofb128 "camellia-256-ofb"
+#define NID_camellia_256_ofb128 768
+#define OBJ_camellia_256_ofb128 OBJ_camellia,43L
+
+#define SN_camellia_256_cfb128 "CAMELLIA-256-CFB"
+#define LN_camellia_256_cfb128 "camellia-256-cfb"
+#define NID_camellia_256_cfb128 759
+#define OBJ_camellia_256_cfb128 OBJ_camellia,44L
+
+#define SN_camellia_128_cfb1 "CAMELLIA-128-CFB1"
+#define LN_camellia_128_cfb1 "camellia-128-cfb1"
+#define NID_camellia_128_cfb1 760
+
+#define SN_camellia_192_cfb1 "CAMELLIA-192-CFB1"
+#define LN_camellia_192_cfb1 "camellia-192-cfb1"
+#define NID_camellia_192_cfb1 761
+
+#define SN_camellia_256_cfb1 "CAMELLIA-256-CFB1"
+#define LN_camellia_256_cfb1 "camellia-256-cfb1"
+#define NID_camellia_256_cfb1 762
+
+#define SN_camellia_128_cfb8 "CAMELLIA-128-CFB8"
+#define LN_camellia_128_cfb8 "camellia-128-cfb8"
+#define NID_camellia_128_cfb8 763
+
+#define SN_camellia_192_cfb8 "CAMELLIA-192-CFB8"
+#define LN_camellia_192_cfb8 "camellia-192-cfb8"
+#define NID_camellia_192_cfb8 764
+
+#define SN_camellia_256_cfb8 "CAMELLIA-256-CFB8"
+#define LN_camellia_256_cfb8 "camellia-256-cfb8"
+#define NID_camellia_256_cfb8 765
+
+#define SN_kisa "KISA"
+#define LN_kisa "kisa"
+#define NID_kisa 773
+#define OBJ_kisa OBJ_member_body,410L,200004L
+
+#define SN_seed_ecb "SEED-ECB"
+#define LN_seed_ecb "seed-ecb"
+#define NID_seed_ecb 776
+#define OBJ_seed_ecb OBJ_kisa,1L,3L
+
+#define SN_seed_cbc "SEED-CBC"
+#define LN_seed_cbc "seed-cbc"
+#define NID_seed_cbc 777
+#define OBJ_seed_cbc OBJ_kisa,1L,4L
+
+#define SN_seed_cfb128 "SEED-CFB"
+#define LN_seed_cfb128 "seed-cfb"
+#define NID_seed_cfb128 779
+#define OBJ_seed_cfb128 OBJ_kisa,1L,5L
+
+#define SN_seed_ofb128 "SEED-OFB"
+#define LN_seed_ofb128 "seed-ofb"
+#define NID_seed_ofb128 778
+#define OBJ_seed_ofb128 OBJ_kisa,1L,6L
+
+#define SN_hmac "HMAC"
+#define LN_hmac "hmac"
+#define NID_hmac 855
+
+#define SN_cmac "CMAC"
+#define LN_cmac "cmac"
+#define NID_cmac 894
+
+#define SN_rc4_hmac_md5 "RC4-HMAC-MD5"
+#define LN_rc4_hmac_md5 "rc4-hmac-md5"
+#define NID_rc4_hmac_md5 915
+
+#define SN_aes_128_cbc_hmac_sha1 "AES-128-CBC-HMAC-SHA1"
+#define LN_aes_128_cbc_hmac_sha1 "aes-128-cbc-hmac-sha1"
+#define NID_aes_128_cbc_hmac_sha1 916
+
+#define SN_aes_192_cbc_hmac_sha1 "AES-192-CBC-HMAC-SHA1"
+#define LN_aes_192_cbc_hmac_sha1 "aes-192-cbc-hmac-sha1"
+#define NID_aes_192_cbc_hmac_sha1 917
+
+#define SN_aes_256_cbc_hmac_sha1 "AES-256-CBC-HMAC-SHA1"
+#define LN_aes_256_cbc_hmac_sha1 "aes-256-cbc-hmac-sha1"
+#define NID_aes_256_cbc_hmac_sha1 918
+
+#define SN_aes_128_cbc_hmac_sha256 "AES-128-CBC-HMAC-SHA256"
+#define LN_aes_128_cbc_hmac_sha256 "aes-128-cbc-hmac-sha256"
+#define NID_aes_128_cbc_hmac_sha256 948
+
+#define SN_aes_192_cbc_hmac_sha256 "AES-192-CBC-HMAC-SHA256"
+#define LN_aes_192_cbc_hmac_sha256 "aes-192-cbc-hmac-sha256"
+#define NID_aes_192_cbc_hmac_sha256 949
+
+#define SN_aes_256_cbc_hmac_sha256 "AES-256-CBC-HMAC-SHA256"
+#define LN_aes_256_cbc_hmac_sha256 "aes-256-cbc-hmac-sha256"
+#define NID_aes_256_cbc_hmac_sha256 950
+
+#define SN_dhpublicnumber "dhpublicnumber"
+#define LN_dhpublicnumber "X9.42 DH"
+#define NID_dhpublicnumber 920
+#define OBJ_dhpublicnumber OBJ_ISO_US,10046L,2L,1L
+
+#define SN_brainpoolP160r1 "brainpoolP160r1"
+#define NID_brainpoolP160r1 921
+#define OBJ_brainpoolP160r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,1L
+
+#define SN_brainpoolP160t1 "brainpoolP160t1"
+#define NID_brainpoolP160t1 922
+#define OBJ_brainpoolP160t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,2L
+
+#define SN_brainpoolP192r1 "brainpoolP192r1"
+#define NID_brainpoolP192r1 923
+#define OBJ_brainpoolP192r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,3L
+
+#define SN_brainpoolP192t1 "brainpoolP192t1"
+#define NID_brainpoolP192t1 924
+#define OBJ_brainpoolP192t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,4L
+
+#define SN_brainpoolP224r1 "brainpoolP224r1"
+#define NID_brainpoolP224r1 925
+#define OBJ_brainpoolP224r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,5L
+
+#define SN_brainpoolP224t1 "brainpoolP224t1"
+#define NID_brainpoolP224t1 926
+#define OBJ_brainpoolP224t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,6L
+
+#define SN_brainpoolP256r1 "brainpoolP256r1"
+#define NID_brainpoolP256r1 927
+#define OBJ_brainpoolP256r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,7L
+
+#define SN_brainpoolP256t1 "brainpoolP256t1"
+#define NID_brainpoolP256t1 928
+#define OBJ_brainpoolP256t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,8L
+
+#define SN_brainpoolP320r1 "brainpoolP320r1"
+#define NID_brainpoolP320r1 929
+#define OBJ_brainpoolP320r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,9L
+
+#define SN_brainpoolP320t1 "brainpoolP320t1"
+#define NID_brainpoolP320t1 930
+#define OBJ_brainpoolP320t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,10L
+
+#define SN_brainpoolP384r1 "brainpoolP384r1"
+#define NID_brainpoolP384r1 931
+#define OBJ_brainpoolP384r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,11L
+
+#define SN_brainpoolP384t1 "brainpoolP384t1"
+#define NID_brainpoolP384t1 932
+#define OBJ_brainpoolP384t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,12L
+
+#define SN_brainpoolP512r1 "brainpoolP512r1"
+#define NID_brainpoolP512r1 933
+#define OBJ_brainpoolP512r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,13L
+
+#define SN_brainpoolP512t1 "brainpoolP512t1"
+#define NID_brainpoolP512t1 934
+#define OBJ_brainpoolP512t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,14L
+
+#define OBJ_x9_63_scheme 1L,3L,133L,16L,840L,63L,0L
+
+#define OBJ_secg_scheme OBJ_certicom_arc,1L
+
+#define SN_dhSinglePass_stdDH_sha1kdf_scheme "dhSinglePass-stdDH-sha1kdf-scheme"
+#define NID_dhSinglePass_stdDH_sha1kdf_scheme 936
+#define OBJ_dhSinglePass_stdDH_sha1kdf_scheme OBJ_x9_63_scheme,2L
+
+#define SN_dhSinglePass_stdDH_sha224kdf_scheme "dhSinglePass-stdDH-sha224kdf-scheme"
+#define NID_dhSinglePass_stdDH_sha224kdf_scheme 937
+#define OBJ_dhSinglePass_stdDH_sha224kdf_scheme OBJ_secg_scheme,11L,0L
+
+#define SN_dhSinglePass_stdDH_sha256kdf_scheme "dhSinglePass-stdDH-sha256kdf-scheme"
+#define NID_dhSinglePass_stdDH_sha256kdf_scheme 938
+#define OBJ_dhSinglePass_stdDH_sha256kdf_scheme OBJ_secg_scheme,11L,1L
+
+#define SN_dhSinglePass_stdDH_sha384kdf_scheme "dhSinglePass-stdDH-sha384kdf-scheme"
+#define NID_dhSinglePass_stdDH_sha384kdf_scheme 939
+#define OBJ_dhSinglePass_stdDH_sha384kdf_scheme OBJ_secg_scheme,11L,2L
+
+#define SN_dhSinglePass_stdDH_sha512kdf_scheme "dhSinglePass-stdDH-sha512kdf-scheme"
+#define NID_dhSinglePass_stdDH_sha512kdf_scheme 940
+#define OBJ_dhSinglePass_stdDH_sha512kdf_scheme OBJ_secg_scheme,11L,3L
+
+#define SN_dhSinglePass_cofactorDH_sha1kdf_scheme "dhSinglePass-cofactorDH-sha1kdf-scheme"
+#define NID_dhSinglePass_cofactorDH_sha1kdf_scheme 941
+#define OBJ_dhSinglePass_cofactorDH_sha1kdf_scheme OBJ_x9_63_scheme,3L
+
+#define SN_dhSinglePass_cofactorDH_sha224kdf_scheme "dhSinglePass-cofactorDH-sha224kdf-scheme"
+#define NID_dhSinglePass_cofactorDH_sha224kdf_scheme 942
+#define OBJ_dhSinglePass_cofactorDH_sha224kdf_scheme OBJ_secg_scheme,14L,0L
+
+#define SN_dhSinglePass_cofactorDH_sha256kdf_scheme "dhSinglePass-cofactorDH-sha256kdf-scheme"
+#define NID_dhSinglePass_cofactorDH_sha256kdf_scheme 943
+#define OBJ_dhSinglePass_cofactorDH_sha256kdf_scheme OBJ_secg_scheme,14L,1L
+
+#define SN_dhSinglePass_cofactorDH_sha384kdf_scheme "dhSinglePass-cofactorDH-sha384kdf-scheme"
+#define NID_dhSinglePass_cofactorDH_sha384kdf_scheme 944
+#define OBJ_dhSinglePass_cofactorDH_sha384kdf_scheme OBJ_secg_scheme,14L,2L
+
+#define SN_dhSinglePass_cofactorDH_sha512kdf_scheme "dhSinglePass-cofactorDH-sha512kdf-scheme"
+#define NID_dhSinglePass_cofactorDH_sha512kdf_scheme 945
+#define OBJ_dhSinglePass_cofactorDH_sha512kdf_scheme OBJ_secg_scheme,14L,3L
+
+#define SN_dh_std_kdf "dh-std-kdf"
+#define NID_dh_std_kdf 946
+
+#define SN_dh_cofactor_kdf "dh-cofactor-kdf"
+#define NID_dh_cofactor_kdf 947
+
+#define SN_ct_precert_scts "ct_precert_scts"
+#define LN_ct_precert_scts "CT Precertificate SCTs"
+#define NID_ct_precert_scts 951
+#define OBJ_ct_precert_scts 1L,3L,6L,1L,4L,1L,11129L,2L,4L,2L
+
+#define SN_ct_precert_poison "ct_precert_poison"
+#define LN_ct_precert_poison "CT Precertificate Poison"
+#define NID_ct_precert_poison 952
+#define OBJ_ct_precert_poison 1L,3L,6L,1L,4L,1L,11129L,2L,4L,3L
+
+#define SN_ct_precert_signer "ct_precert_signer"
+#define LN_ct_precert_signer "CT Precertificate Signer"
+#define NID_ct_precert_signer 953
+#define OBJ_ct_precert_signer 1L,3L,6L,1L,4L,1L,11129L,2L,4L,4L
+
+#define SN_ct_cert_scts "ct_cert_scts"
+#define LN_ct_cert_scts "CT Certificate SCTs"
+#define NID_ct_cert_scts 954
+#define OBJ_ct_cert_scts 1L,3L,6L,1L,4L,1L,11129L,2L,4L,5L
+
+#define SN_jurisdictionLocalityName "jurisdictionL"
+#define LN_jurisdictionLocalityName "jurisdictionLocalityName"
+#define NID_jurisdictionLocalityName 955
+#define OBJ_jurisdictionLocalityName 1L,3L,6L,1L,4L,1L,311L,60L,2L,1L,1L
+
+#define SN_jurisdictionStateOrProvinceName "jurisdictionST"
+#define LN_jurisdictionStateOrProvinceName "jurisdictionStateOrProvinceName"
+#define NID_jurisdictionStateOrProvinceName 956
+#define OBJ_jurisdictionStateOrProvinceName 1L,3L,6L,1L,4L,1L,311L,60L,2L,1L,2L
+
+#define SN_jurisdictionCountryName "jurisdictionC"
+#define LN_jurisdictionCountryName "jurisdictionCountryName"
+#define NID_jurisdictionCountryName 957
+#define OBJ_jurisdictionCountryName 1L,3L,6L,1L,4L,1L,311L,60L,2L,1L,3L
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/objects.h b/protocols/Telegram/tgl/openssl/include/openssl/objects.h
new file mode 100644
index 0000000000..b8dafa89ce
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/objects.h
@@ -0,0 +1,1143 @@
+/* crypto/objects/objects.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_OBJECTS_H
+# define HEADER_OBJECTS_H
+
+# define USE_OBJ_MAC
+
+# ifdef USE_OBJ_MAC
+# include <openssl/obj_mac.h>
+# else
+# define SN_undef "UNDEF"
+# define LN_undef "undefined"
+# define NID_undef 0
+# define OBJ_undef 0L
+
+# define SN_Algorithm "Algorithm"
+# define LN_algorithm "algorithm"
+# define NID_algorithm 38
+# define OBJ_algorithm 1L,3L,14L,3L,2L
+
+# define LN_rsadsi "rsadsi"
+# define NID_rsadsi 1
+# define OBJ_rsadsi 1L,2L,840L,113549L
+
+# define LN_pkcs "pkcs"
+# define NID_pkcs 2
+# define OBJ_pkcs OBJ_rsadsi,1L
+
+# define SN_md2 "MD2"
+# define LN_md2 "md2"
+# define NID_md2 3
+# define OBJ_md2 OBJ_rsadsi,2L,2L
+
+# define SN_md5 "MD5"
+# define LN_md5 "md5"
+# define NID_md5 4
+# define OBJ_md5 OBJ_rsadsi,2L,5L
+
+# define SN_rc4 "RC4"
+# define LN_rc4 "rc4"
+# define NID_rc4 5
+# define OBJ_rc4 OBJ_rsadsi,3L,4L
+
+# define LN_rsaEncryption "rsaEncryption"
+# define NID_rsaEncryption 6
+# define OBJ_rsaEncryption OBJ_pkcs,1L,1L
+
+# define SN_md2WithRSAEncryption "RSA-MD2"
+# define LN_md2WithRSAEncryption "md2WithRSAEncryption"
+# define NID_md2WithRSAEncryption 7
+# define OBJ_md2WithRSAEncryption OBJ_pkcs,1L,2L
+
+# define SN_md5WithRSAEncryption "RSA-MD5"
+# define LN_md5WithRSAEncryption "md5WithRSAEncryption"
+# define NID_md5WithRSAEncryption 8
+# define OBJ_md5WithRSAEncryption OBJ_pkcs,1L,4L
+
+# define SN_pbeWithMD2AndDES_CBC "PBE-MD2-DES"
+# define LN_pbeWithMD2AndDES_CBC "pbeWithMD2AndDES-CBC"
+# define NID_pbeWithMD2AndDES_CBC 9
+# define OBJ_pbeWithMD2AndDES_CBC OBJ_pkcs,5L,1L
+
+# define SN_pbeWithMD5AndDES_CBC "PBE-MD5-DES"
+# define LN_pbeWithMD5AndDES_CBC "pbeWithMD5AndDES-CBC"
+# define NID_pbeWithMD5AndDES_CBC 10
+# define OBJ_pbeWithMD5AndDES_CBC OBJ_pkcs,5L,3L
+
+# define LN_X500 "X500"
+# define NID_X500 11
+# define OBJ_X500 2L,5L
+
+# define LN_X509 "X509"
+# define NID_X509 12
+# define OBJ_X509 OBJ_X500,4L
+
+# define SN_commonName "CN"
+# define LN_commonName "commonName"
+# define NID_commonName 13
+# define OBJ_commonName OBJ_X509,3L
+
+# define SN_countryName "C"
+# define LN_countryName "countryName"
+# define NID_countryName 14
+# define OBJ_countryName OBJ_X509,6L
+
+# define SN_localityName "L"
+# define LN_localityName "localityName"
+# define NID_localityName 15
+# define OBJ_localityName OBJ_X509,7L
+
+/* Postal Address? PA */
+
+/* should be "ST" (rfc1327) but MS uses 'S' */
+# define SN_stateOrProvinceName "ST"
+# define LN_stateOrProvinceName "stateOrProvinceName"
+# define NID_stateOrProvinceName 16
+# define OBJ_stateOrProvinceName OBJ_X509,8L
+
+# define SN_organizationName "O"
+# define LN_organizationName "organizationName"
+# define NID_organizationName 17
+# define OBJ_organizationName OBJ_X509,10L
+
+# define SN_organizationalUnitName "OU"
+# define LN_organizationalUnitName "organizationalUnitName"
+# define NID_organizationalUnitName 18
+# define OBJ_organizationalUnitName OBJ_X509,11L
+
+# define SN_rsa "RSA"
+# define LN_rsa "rsa"
+# define NID_rsa 19
+# define OBJ_rsa OBJ_X500,8L,1L,1L
+
+# define LN_pkcs7 "pkcs7"
+# define NID_pkcs7 20
+# define OBJ_pkcs7 OBJ_pkcs,7L
+
+# define LN_pkcs7_data "pkcs7-data"
+# define NID_pkcs7_data 21
+# define OBJ_pkcs7_data OBJ_pkcs7,1L
+
+# define LN_pkcs7_signed "pkcs7-signedData"
+# define NID_pkcs7_signed 22
+# define OBJ_pkcs7_signed OBJ_pkcs7,2L
+
+# define LN_pkcs7_enveloped "pkcs7-envelopedData"
+# define NID_pkcs7_enveloped 23
+# define OBJ_pkcs7_enveloped OBJ_pkcs7,3L
+
+# define LN_pkcs7_signedAndEnveloped "pkcs7-signedAndEnvelopedData"
+# define NID_pkcs7_signedAndEnveloped 24
+# define OBJ_pkcs7_signedAndEnveloped OBJ_pkcs7,4L
+
+# define LN_pkcs7_digest "pkcs7-digestData"
+# define NID_pkcs7_digest 25
+# define OBJ_pkcs7_digest OBJ_pkcs7,5L
+
+# define LN_pkcs7_encrypted "pkcs7-encryptedData"
+# define NID_pkcs7_encrypted 26
+# define OBJ_pkcs7_encrypted OBJ_pkcs7,6L
+
+# define LN_pkcs3 "pkcs3"
+# define NID_pkcs3 27
+# define OBJ_pkcs3 OBJ_pkcs,3L
+
+# define LN_dhKeyAgreement "dhKeyAgreement"
+# define NID_dhKeyAgreement 28
+# define OBJ_dhKeyAgreement OBJ_pkcs3,1L
+
+# define SN_des_ecb "DES-ECB"
+# define LN_des_ecb "des-ecb"
+# define NID_des_ecb 29
+# define OBJ_des_ecb OBJ_algorithm,6L
+
+# define SN_des_cfb64 "DES-CFB"
+# define LN_des_cfb64 "des-cfb"
+# define NID_des_cfb64 30
+/* IV + num */
+# define OBJ_des_cfb64 OBJ_algorithm,9L
+
+# define SN_des_cbc "DES-CBC"
+# define LN_des_cbc "des-cbc"
+# define NID_des_cbc 31
+/* IV */
+# define OBJ_des_cbc OBJ_algorithm,7L
+
+# define SN_des_ede "DES-EDE"
+# define LN_des_ede "des-ede"
+# define NID_des_ede 32
+/* ?? */
+# define OBJ_des_ede OBJ_algorithm,17L
+
+# define SN_des_ede3 "DES-EDE3"
+# define LN_des_ede3 "des-ede3"
+# define NID_des_ede3 33
+
+# define SN_idea_cbc "IDEA-CBC"
+# define LN_idea_cbc "idea-cbc"
+# define NID_idea_cbc 34
+# define OBJ_idea_cbc 1L,3L,6L,1L,4L,1L,188L,7L,1L,1L,2L
+
+# define SN_idea_cfb64 "IDEA-CFB"
+# define LN_idea_cfb64 "idea-cfb"
+# define NID_idea_cfb64 35
+
+# define SN_idea_ecb "IDEA-ECB"
+# define LN_idea_ecb "idea-ecb"
+# define NID_idea_ecb 36
+
+# define SN_rc2_cbc "RC2-CBC"
+# define LN_rc2_cbc "rc2-cbc"
+# define NID_rc2_cbc 37
+# define OBJ_rc2_cbc OBJ_rsadsi,3L,2L
+
+# define SN_rc2_ecb "RC2-ECB"
+# define LN_rc2_ecb "rc2-ecb"
+# define NID_rc2_ecb 38
+
+# define SN_rc2_cfb64 "RC2-CFB"
+# define LN_rc2_cfb64 "rc2-cfb"
+# define NID_rc2_cfb64 39
+
+# define SN_rc2_ofb64 "RC2-OFB"
+# define LN_rc2_ofb64 "rc2-ofb"
+# define NID_rc2_ofb64 40
+
+# define SN_sha "SHA"
+# define LN_sha "sha"
+# define NID_sha 41
+# define OBJ_sha OBJ_algorithm,18L
+
+# define SN_shaWithRSAEncryption "RSA-SHA"
+# define LN_shaWithRSAEncryption "shaWithRSAEncryption"
+# define NID_shaWithRSAEncryption 42
+# define OBJ_shaWithRSAEncryption OBJ_algorithm,15L
+
+# define SN_des_ede_cbc "DES-EDE-CBC"
+# define LN_des_ede_cbc "des-ede-cbc"
+# define NID_des_ede_cbc 43
+
+# define SN_des_ede3_cbc "DES-EDE3-CBC"
+# define LN_des_ede3_cbc "des-ede3-cbc"
+# define NID_des_ede3_cbc 44
+# define OBJ_des_ede3_cbc OBJ_rsadsi,3L,7L
+
+# define SN_des_ofb64 "DES-OFB"
+# define LN_des_ofb64 "des-ofb"
+# define NID_des_ofb64 45
+# define OBJ_des_ofb64 OBJ_algorithm,8L
+
+# define SN_idea_ofb64 "IDEA-OFB"
+# define LN_idea_ofb64 "idea-ofb"
+# define NID_idea_ofb64 46
+
+# define LN_pkcs9 "pkcs9"
+# define NID_pkcs9 47
+# define OBJ_pkcs9 OBJ_pkcs,9L
+
+# define SN_pkcs9_emailAddress "Email"
+# define LN_pkcs9_emailAddress "emailAddress"
+# define NID_pkcs9_emailAddress 48
+# define OBJ_pkcs9_emailAddress OBJ_pkcs9,1L
+
+# define LN_pkcs9_unstructuredName "unstructuredName"
+# define NID_pkcs9_unstructuredName 49
+# define OBJ_pkcs9_unstructuredName OBJ_pkcs9,2L
+
+# define LN_pkcs9_contentType "contentType"
+# define NID_pkcs9_contentType 50
+# define OBJ_pkcs9_contentType OBJ_pkcs9,3L
+
+# define LN_pkcs9_messageDigest "messageDigest"
+# define NID_pkcs9_messageDigest 51
+# define OBJ_pkcs9_messageDigest OBJ_pkcs9,4L
+
+# define LN_pkcs9_signingTime "signingTime"
+# define NID_pkcs9_signingTime 52
+# define OBJ_pkcs9_signingTime OBJ_pkcs9,5L
+
+# define LN_pkcs9_countersignature "countersignature"
+# define NID_pkcs9_countersignature 53
+# define OBJ_pkcs9_countersignature OBJ_pkcs9,6L
+
+# define LN_pkcs9_challengePassword "challengePassword"
+# define NID_pkcs9_challengePassword 54
+# define OBJ_pkcs9_challengePassword OBJ_pkcs9,7L
+
+# define LN_pkcs9_unstructuredAddress "unstructuredAddress"
+# define NID_pkcs9_unstructuredAddress 55
+# define OBJ_pkcs9_unstructuredAddress OBJ_pkcs9,8L
+
+# define LN_pkcs9_extCertAttributes "extendedCertificateAttributes"
+# define NID_pkcs9_extCertAttributes 56
+# define OBJ_pkcs9_extCertAttributes OBJ_pkcs9,9L
+
+# define SN_netscape "Netscape"
+# define LN_netscape "Netscape Communications Corp."
+# define NID_netscape 57
+# define OBJ_netscape 2L,16L,840L,1L,113730L
+
+# define SN_netscape_cert_extension "nsCertExt"
+# define LN_netscape_cert_extension "Netscape Certificate Extension"
+# define NID_netscape_cert_extension 58
+# define OBJ_netscape_cert_extension OBJ_netscape,1L
+
+# define SN_netscape_data_type "nsDataType"
+# define LN_netscape_data_type "Netscape Data Type"
+# define NID_netscape_data_type 59
+# define OBJ_netscape_data_type OBJ_netscape,2L
+
+# define SN_des_ede_cfb64 "DES-EDE-CFB"
+# define LN_des_ede_cfb64 "des-ede-cfb"
+# define NID_des_ede_cfb64 60
+
+# define SN_des_ede3_cfb64 "DES-EDE3-CFB"
+# define LN_des_ede3_cfb64 "des-ede3-cfb"
+# define NID_des_ede3_cfb64 61
+
+# define SN_des_ede_ofb64 "DES-EDE-OFB"
+# define LN_des_ede_ofb64 "des-ede-ofb"
+# define NID_des_ede_ofb64 62
+
+# define SN_des_ede3_ofb64 "DES-EDE3-OFB"
+# define LN_des_ede3_ofb64 "des-ede3-ofb"
+# define NID_des_ede3_ofb64 63
+
+/* I'm not sure about the object ID */
+# define SN_sha1 "SHA1"
+# define LN_sha1 "sha1"
+# define NID_sha1 64
+# define OBJ_sha1 OBJ_algorithm,26L
+/* 28 Jun 1996 - eay */
+/* #define OBJ_sha1 1L,3L,14L,2L,26L,05L <- wrong */
+
+# define SN_sha1WithRSAEncryption "RSA-SHA1"
+# define LN_sha1WithRSAEncryption "sha1WithRSAEncryption"
+# define NID_sha1WithRSAEncryption 65
+# define OBJ_sha1WithRSAEncryption OBJ_pkcs,1L,5L
+
+# define SN_dsaWithSHA "DSA-SHA"
+# define LN_dsaWithSHA "dsaWithSHA"
+# define NID_dsaWithSHA 66
+# define OBJ_dsaWithSHA OBJ_algorithm,13L
+
+# define SN_dsa_2 "DSA-old"
+# define LN_dsa_2 "dsaEncryption-old"
+# define NID_dsa_2 67
+# define OBJ_dsa_2 OBJ_algorithm,12L
+
+/* proposed by microsoft to RSA */
+# define SN_pbeWithSHA1AndRC2_CBC "PBE-SHA1-RC2-64"
+# define LN_pbeWithSHA1AndRC2_CBC "pbeWithSHA1AndRC2-CBC"
+# define NID_pbeWithSHA1AndRC2_CBC 68
+# define OBJ_pbeWithSHA1AndRC2_CBC OBJ_pkcs,5L,11L
+
+/*
+ * proposed by microsoft to RSA as pbeWithSHA1AndRC4: it is now defined
+ * explicitly in PKCS#5 v2.0 as id-PBKDF2 which is something completely
+ * different.
+ */
+# define LN_id_pbkdf2 "PBKDF2"
+# define NID_id_pbkdf2 69
+# define OBJ_id_pbkdf2 OBJ_pkcs,5L,12L
+
+# define SN_dsaWithSHA1_2 "DSA-SHA1-old"
+# define LN_dsaWithSHA1_2 "dsaWithSHA1-old"
+# define NID_dsaWithSHA1_2 70
+/* Got this one from 'sdn706r20.pdf' which is actually an NSA document :-) */
+# define OBJ_dsaWithSHA1_2 OBJ_algorithm,27L
+
+# define SN_netscape_cert_type "nsCertType"
+# define LN_netscape_cert_type "Netscape Cert Type"
+# define NID_netscape_cert_type 71
+# define OBJ_netscape_cert_type OBJ_netscape_cert_extension,1L
+
+# define SN_netscape_base_url "nsBaseUrl"
+# define LN_netscape_base_url "Netscape Base Url"
+# define NID_netscape_base_url 72
+# define OBJ_netscape_base_url OBJ_netscape_cert_extension,2L
+
+# define SN_netscape_revocation_url "nsRevocationUrl"
+# define LN_netscape_revocation_url "Netscape Revocation Url"
+# define NID_netscape_revocation_url 73
+# define OBJ_netscape_revocation_url OBJ_netscape_cert_extension,3L
+
+# define SN_netscape_ca_revocation_url "nsCaRevocationUrl"
+# define LN_netscape_ca_revocation_url "Netscape CA Revocation Url"
+# define NID_netscape_ca_revocation_url 74
+# define OBJ_netscape_ca_revocation_url OBJ_netscape_cert_extension,4L
+
+# define SN_netscape_renewal_url "nsRenewalUrl"
+# define LN_netscape_renewal_url "Netscape Renewal Url"
+# define NID_netscape_renewal_url 75
+# define OBJ_netscape_renewal_url OBJ_netscape_cert_extension,7L
+
+# define SN_netscape_ca_policy_url "nsCaPolicyUrl"
+# define LN_netscape_ca_policy_url "Netscape CA Policy Url"
+# define NID_netscape_ca_policy_url 76
+# define OBJ_netscape_ca_policy_url OBJ_netscape_cert_extension,8L
+
+# define SN_netscape_ssl_server_name "nsSslServerName"
+# define LN_netscape_ssl_server_name "Netscape SSL Server Name"
+# define NID_netscape_ssl_server_name 77
+# define OBJ_netscape_ssl_server_name OBJ_netscape_cert_extension,12L
+
+# define SN_netscape_comment "nsComment"
+# define LN_netscape_comment "Netscape Comment"
+# define NID_netscape_comment 78
+# define OBJ_netscape_comment OBJ_netscape_cert_extension,13L
+
+# define SN_netscape_cert_sequence "nsCertSequence"
+# define LN_netscape_cert_sequence "Netscape Certificate Sequence"
+# define NID_netscape_cert_sequence 79
+# define OBJ_netscape_cert_sequence OBJ_netscape_data_type,5L
+
+# define SN_desx_cbc "DESX-CBC"
+# define LN_desx_cbc "desx-cbc"
+# define NID_desx_cbc 80
+
+# define SN_id_ce "id-ce"
+# define NID_id_ce 81
+# define OBJ_id_ce 2L,5L,29L
+
+# define SN_subject_key_identifier "subjectKeyIdentifier"
+# define LN_subject_key_identifier "X509v3 Subject Key Identifier"
+# define NID_subject_key_identifier 82
+# define OBJ_subject_key_identifier OBJ_id_ce,14L
+
+# define SN_key_usage "keyUsage"
+# define LN_key_usage "X509v3 Key Usage"
+# define NID_key_usage 83
+# define OBJ_key_usage OBJ_id_ce,15L
+
+# define SN_private_key_usage_period "privateKeyUsagePeriod"
+# define LN_private_key_usage_period "X509v3 Private Key Usage Period"
+# define NID_private_key_usage_period 84
+# define OBJ_private_key_usage_period OBJ_id_ce,16L
+
+# define SN_subject_alt_name "subjectAltName"
+# define LN_subject_alt_name "X509v3 Subject Alternative Name"
+# define NID_subject_alt_name 85
+# define OBJ_subject_alt_name OBJ_id_ce,17L
+
+# define SN_issuer_alt_name "issuerAltName"
+# define LN_issuer_alt_name "X509v3 Issuer Alternative Name"
+# define NID_issuer_alt_name 86
+# define OBJ_issuer_alt_name OBJ_id_ce,18L
+
+# define SN_basic_constraints "basicConstraints"
+# define LN_basic_constraints "X509v3 Basic Constraints"
+# define NID_basic_constraints 87
+# define OBJ_basic_constraints OBJ_id_ce,19L
+
+# define SN_crl_number "crlNumber"
+# define LN_crl_number "X509v3 CRL Number"
+# define NID_crl_number 88
+# define OBJ_crl_number OBJ_id_ce,20L
+
+# define SN_certificate_policies "certificatePolicies"
+# define LN_certificate_policies "X509v3 Certificate Policies"
+# define NID_certificate_policies 89
+# define OBJ_certificate_policies OBJ_id_ce,32L
+
+# define SN_authority_key_identifier "authorityKeyIdentifier"
+# define LN_authority_key_identifier "X509v3 Authority Key Identifier"
+# define NID_authority_key_identifier 90
+# define OBJ_authority_key_identifier OBJ_id_ce,35L
+
+# define SN_bf_cbc "BF-CBC"
+# define LN_bf_cbc "bf-cbc"
+# define NID_bf_cbc 91
+# define OBJ_bf_cbc 1L,3L,6L,1L,4L,1L,3029L,1L,2L
+
+# define SN_bf_ecb "BF-ECB"
+# define LN_bf_ecb "bf-ecb"
+# define NID_bf_ecb 92
+
+# define SN_bf_cfb64 "BF-CFB"
+# define LN_bf_cfb64 "bf-cfb"
+# define NID_bf_cfb64 93
+
+# define SN_bf_ofb64 "BF-OFB"
+# define LN_bf_ofb64 "bf-ofb"
+# define NID_bf_ofb64 94
+
+# define SN_mdc2 "MDC2"
+# define LN_mdc2 "mdc2"
+# define NID_mdc2 95
+# define OBJ_mdc2 2L,5L,8L,3L,101L
+/* An alternative? 1L,3L,14L,3L,2L,19L */
+
+# define SN_mdc2WithRSA "RSA-MDC2"
+# define LN_mdc2WithRSA "mdc2withRSA"
+# define NID_mdc2WithRSA 96
+# define OBJ_mdc2WithRSA 2L,5L,8L,3L,100L
+
+# define SN_rc4_40 "RC4-40"
+# define LN_rc4_40 "rc4-40"
+# define NID_rc4_40 97
+
+# define SN_rc2_40_cbc "RC2-40-CBC"
+# define LN_rc2_40_cbc "rc2-40-cbc"
+# define NID_rc2_40_cbc 98
+
+# define SN_givenName "G"
+# define LN_givenName "givenName"
+# define NID_givenName 99
+# define OBJ_givenName OBJ_X509,42L
+
+# define SN_surname "S"
+# define LN_surname "surname"
+# define NID_surname 100
+# define OBJ_surname OBJ_X509,4L
+
+# define SN_initials "I"
+# define LN_initials "initials"
+# define NID_initials 101
+# define OBJ_initials OBJ_X509,43L
+
+# define SN_uniqueIdentifier "UID"
+# define LN_uniqueIdentifier "uniqueIdentifier"
+# define NID_uniqueIdentifier 102
+# define OBJ_uniqueIdentifier OBJ_X509,45L
+
+# define SN_crl_distribution_points "crlDistributionPoints"
+# define LN_crl_distribution_points "X509v3 CRL Distribution Points"
+# define NID_crl_distribution_points 103
+# define OBJ_crl_distribution_points OBJ_id_ce,31L
+
+# define SN_md5WithRSA "RSA-NP-MD5"
+# define LN_md5WithRSA "md5WithRSA"
+# define NID_md5WithRSA 104
+# define OBJ_md5WithRSA OBJ_algorithm,3L
+
+# define SN_serialNumber "SN"
+# define LN_serialNumber "serialNumber"
+# define NID_serialNumber 105
+# define OBJ_serialNumber OBJ_X509,5L
+
+# define SN_title "T"
+# define LN_title "title"
+# define NID_title 106
+# define OBJ_title OBJ_X509,12L
+
+# define SN_description "D"
+# define LN_description "description"
+# define NID_description 107
+# define OBJ_description OBJ_X509,13L
+
+/* CAST5 is CAST-128, I'm just sticking with the documentation */
+# define SN_cast5_cbc "CAST5-CBC"
+# define LN_cast5_cbc "cast5-cbc"
+# define NID_cast5_cbc 108
+# define OBJ_cast5_cbc 1L,2L,840L,113533L,7L,66L,10L
+
+# define SN_cast5_ecb "CAST5-ECB"
+# define LN_cast5_ecb "cast5-ecb"
+# define NID_cast5_ecb 109
+
+# define SN_cast5_cfb64 "CAST5-CFB"
+# define LN_cast5_cfb64 "cast5-cfb"
+# define NID_cast5_cfb64 110
+
+# define SN_cast5_ofb64 "CAST5-OFB"
+# define LN_cast5_ofb64 "cast5-ofb"
+# define NID_cast5_ofb64 111
+
+# define LN_pbeWithMD5AndCast5_CBC "pbeWithMD5AndCast5CBC"
+# define NID_pbeWithMD5AndCast5_CBC 112
+# define OBJ_pbeWithMD5AndCast5_CBC 1L,2L,840L,113533L,7L,66L,12L
+
+/*-
+ * This is one sun will soon be using :-(
+ * id-dsa-with-sha1 ID ::= {
+ * iso(1) member-body(2) us(840) x9-57 (10040) x9cm(4) 3 }
+ */
+# define SN_dsaWithSHA1 "DSA-SHA1"
+# define LN_dsaWithSHA1 "dsaWithSHA1"
+# define NID_dsaWithSHA1 113
+# define OBJ_dsaWithSHA1 1L,2L,840L,10040L,4L,3L
+
+# define NID_md5_sha1 114
+# define SN_md5_sha1 "MD5-SHA1"
+# define LN_md5_sha1 "md5-sha1"
+
+# define SN_sha1WithRSA "RSA-SHA1-2"
+# define LN_sha1WithRSA "sha1WithRSA"
+# define NID_sha1WithRSA 115
+# define OBJ_sha1WithRSA OBJ_algorithm,29L
+
+# define SN_dsa "DSA"
+# define LN_dsa "dsaEncryption"
+# define NID_dsa 116
+# define OBJ_dsa 1L,2L,840L,10040L,4L,1L
+
+# define SN_ripemd160 "RIPEMD160"
+# define LN_ripemd160 "ripemd160"
+# define NID_ripemd160 117
+# define OBJ_ripemd160 1L,3L,36L,3L,2L,1L
+
+/*
+ * The name should actually be rsaSignatureWithripemd160, but I'm going to
+ * continue using the convention I'm using with the other ciphers
+ */
+# define SN_ripemd160WithRSA "RSA-RIPEMD160"
+# define LN_ripemd160WithRSA "ripemd160WithRSA"
+# define NID_ripemd160WithRSA 119
+# define OBJ_ripemd160WithRSA 1L,3L,36L,3L,3L,1L,2L
+
+/*-
+ * Taken from rfc2040
+ * RC5_CBC_Parameters ::= SEQUENCE {
+ * version INTEGER (v1_0(16)),
+ * rounds INTEGER (8..127),
+ * blockSizeInBits INTEGER (64, 128),
+ * iv OCTET STRING OPTIONAL
+ * }
+ */
+# define SN_rc5_cbc "RC5-CBC"
+# define LN_rc5_cbc "rc5-cbc"
+# define NID_rc5_cbc 120
+# define OBJ_rc5_cbc OBJ_rsadsi,3L,8L
+
+# define SN_rc5_ecb "RC5-ECB"
+# define LN_rc5_ecb "rc5-ecb"
+# define NID_rc5_ecb 121
+
+# define SN_rc5_cfb64 "RC5-CFB"
+# define LN_rc5_cfb64 "rc5-cfb"
+# define NID_rc5_cfb64 122
+
+# define SN_rc5_ofb64 "RC5-OFB"
+# define LN_rc5_ofb64 "rc5-ofb"
+# define NID_rc5_ofb64 123
+
+# define SN_rle_compression "RLE"
+# define LN_rle_compression "run length compression"
+# define NID_rle_compression 124
+# define OBJ_rle_compression 1L,1L,1L,1L,666L,1L
+
+# define SN_zlib_compression "ZLIB"
+# define LN_zlib_compression "zlib compression"
+# define NID_zlib_compression 125
+# define OBJ_zlib_compression 1L,1L,1L,1L,666L,2L
+
+# define SN_ext_key_usage "extendedKeyUsage"
+# define LN_ext_key_usage "X509v3 Extended Key Usage"
+# define NID_ext_key_usage 126
+# define OBJ_ext_key_usage OBJ_id_ce,37
+
+# define SN_id_pkix "PKIX"
+# define NID_id_pkix 127
+# define OBJ_id_pkix 1L,3L,6L,1L,5L,5L,7L
+
+# define SN_id_kp "id-kp"
+# define NID_id_kp 128
+# define OBJ_id_kp OBJ_id_pkix,3L
+
+/* PKIX extended key usage OIDs */
+
+# define SN_server_auth "serverAuth"
+# define LN_server_auth "TLS Web Server Authentication"
+# define NID_server_auth 129
+# define OBJ_server_auth OBJ_id_kp,1L
+
+# define SN_client_auth "clientAuth"
+# define LN_client_auth "TLS Web Client Authentication"
+# define NID_client_auth 130
+# define OBJ_client_auth OBJ_id_kp,2L
+
+# define SN_code_sign "codeSigning"
+# define LN_code_sign "Code Signing"
+# define NID_code_sign 131
+# define OBJ_code_sign OBJ_id_kp,3L
+
+# define SN_email_protect "emailProtection"
+# define LN_email_protect "E-mail Protection"
+# define NID_email_protect 132
+# define OBJ_email_protect OBJ_id_kp,4L
+
+# define SN_time_stamp "timeStamping"
+# define LN_time_stamp "Time Stamping"
+# define NID_time_stamp 133
+# define OBJ_time_stamp OBJ_id_kp,8L
+
+/* Additional extended key usage OIDs: Microsoft */
+
+# define SN_ms_code_ind "msCodeInd"
+# define LN_ms_code_ind "Microsoft Individual Code Signing"
+# define NID_ms_code_ind 134
+# define OBJ_ms_code_ind 1L,3L,6L,1L,4L,1L,311L,2L,1L,21L
+
+# define SN_ms_code_com "msCodeCom"
+# define LN_ms_code_com "Microsoft Commercial Code Signing"
+# define NID_ms_code_com 135
+# define OBJ_ms_code_com 1L,3L,6L,1L,4L,1L,311L,2L,1L,22L
+
+# define SN_ms_ctl_sign "msCTLSign"
+# define LN_ms_ctl_sign "Microsoft Trust List Signing"
+# define NID_ms_ctl_sign 136
+# define OBJ_ms_ctl_sign 1L,3L,6L,1L,4L,1L,311L,10L,3L,1L
+
+# define SN_ms_sgc "msSGC"
+# define LN_ms_sgc "Microsoft Server Gated Crypto"
+# define NID_ms_sgc 137
+# define OBJ_ms_sgc 1L,3L,6L,1L,4L,1L,311L,10L,3L,3L
+
+# define SN_ms_efs "msEFS"
+# define LN_ms_efs "Microsoft Encrypted File System"
+# define NID_ms_efs 138
+# define OBJ_ms_efs 1L,3L,6L,1L,4L,1L,311L,10L,3L,4L
+
+/* Additional usage: Netscape */
+
+# define SN_ns_sgc "nsSGC"
+# define LN_ns_sgc "Netscape Server Gated Crypto"
+# define NID_ns_sgc 139
+# define OBJ_ns_sgc OBJ_netscape,4L,1L
+
+# define SN_delta_crl "deltaCRL"
+# define LN_delta_crl "X509v3 Delta CRL Indicator"
+# define NID_delta_crl 140
+# define OBJ_delta_crl OBJ_id_ce,27L
+
+# define SN_crl_reason "CRLReason"
+# define LN_crl_reason "CRL Reason Code"
+# define NID_crl_reason 141
+# define OBJ_crl_reason OBJ_id_ce,21L
+
+# define SN_invalidity_date "invalidityDate"
+# define LN_invalidity_date "Invalidity Date"
+# define NID_invalidity_date 142
+# define OBJ_invalidity_date OBJ_id_ce,24L
+
+# define SN_sxnet "SXNetID"
+# define LN_sxnet "Strong Extranet ID"
+# define NID_sxnet 143
+# define OBJ_sxnet 1L,3L,101L,1L,4L,1L
+
+/* PKCS12 and related OBJECT IDENTIFIERS */
+
+# define OBJ_pkcs12 OBJ_pkcs,12L
+# define OBJ_pkcs12_pbeids OBJ_pkcs12, 1
+
+# define SN_pbe_WithSHA1And128BitRC4 "PBE-SHA1-RC4-128"
+# define LN_pbe_WithSHA1And128BitRC4 "pbeWithSHA1And128BitRC4"
+# define NID_pbe_WithSHA1And128BitRC4 144
+# define OBJ_pbe_WithSHA1And128BitRC4 OBJ_pkcs12_pbeids, 1L
+
+# define SN_pbe_WithSHA1And40BitRC4 "PBE-SHA1-RC4-40"
+# define LN_pbe_WithSHA1And40BitRC4 "pbeWithSHA1And40BitRC4"
+# define NID_pbe_WithSHA1And40BitRC4 145
+# define OBJ_pbe_WithSHA1And40BitRC4 OBJ_pkcs12_pbeids, 2L
+
+# define SN_pbe_WithSHA1And3_Key_TripleDES_CBC "PBE-SHA1-3DES"
+# define LN_pbe_WithSHA1And3_Key_TripleDES_CBC "pbeWithSHA1And3-KeyTripleDES-CBC"
+# define NID_pbe_WithSHA1And3_Key_TripleDES_CBC 146
+# define OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC OBJ_pkcs12_pbeids, 3L
+
+# define SN_pbe_WithSHA1And2_Key_TripleDES_CBC "PBE-SHA1-2DES"
+# define LN_pbe_WithSHA1And2_Key_TripleDES_CBC "pbeWithSHA1And2-KeyTripleDES-CBC"
+# define NID_pbe_WithSHA1And2_Key_TripleDES_CBC 147
+# define OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC OBJ_pkcs12_pbeids, 4L
+
+# define SN_pbe_WithSHA1And128BitRC2_CBC "PBE-SHA1-RC2-128"
+# define LN_pbe_WithSHA1And128BitRC2_CBC "pbeWithSHA1And128BitRC2-CBC"
+# define NID_pbe_WithSHA1And128BitRC2_CBC 148
+# define OBJ_pbe_WithSHA1And128BitRC2_CBC OBJ_pkcs12_pbeids, 5L
+
+# define SN_pbe_WithSHA1And40BitRC2_CBC "PBE-SHA1-RC2-40"
+# define LN_pbe_WithSHA1And40BitRC2_CBC "pbeWithSHA1And40BitRC2-CBC"
+# define NID_pbe_WithSHA1And40BitRC2_CBC 149
+# define OBJ_pbe_WithSHA1And40BitRC2_CBC OBJ_pkcs12_pbeids, 6L
+
+# define OBJ_pkcs12_Version1 OBJ_pkcs12, 10L
+
+# define OBJ_pkcs12_BagIds OBJ_pkcs12_Version1, 1L
+
+# define LN_keyBag "keyBag"
+# define NID_keyBag 150
+# define OBJ_keyBag OBJ_pkcs12_BagIds, 1L
+
+# define LN_pkcs8ShroudedKeyBag "pkcs8ShroudedKeyBag"
+# define NID_pkcs8ShroudedKeyBag 151
+# define OBJ_pkcs8ShroudedKeyBag OBJ_pkcs12_BagIds, 2L
+
+# define LN_certBag "certBag"
+# define NID_certBag 152
+# define OBJ_certBag OBJ_pkcs12_BagIds, 3L
+
+# define LN_crlBag "crlBag"
+# define NID_crlBag 153
+# define OBJ_crlBag OBJ_pkcs12_BagIds, 4L
+
+# define LN_secretBag "secretBag"
+# define NID_secretBag 154
+# define OBJ_secretBag OBJ_pkcs12_BagIds, 5L
+
+# define LN_safeContentsBag "safeContentsBag"
+# define NID_safeContentsBag 155
+# define OBJ_safeContentsBag OBJ_pkcs12_BagIds, 6L
+
+# define LN_friendlyName "friendlyName"
+# define NID_friendlyName 156
+# define OBJ_friendlyName OBJ_pkcs9, 20L
+
+# define LN_localKeyID "localKeyID"
+# define NID_localKeyID 157
+# define OBJ_localKeyID OBJ_pkcs9, 21L
+
+# define OBJ_certTypes OBJ_pkcs9, 22L
+
+# define LN_x509Certificate "x509Certificate"
+# define NID_x509Certificate 158
+# define OBJ_x509Certificate OBJ_certTypes, 1L
+
+# define LN_sdsiCertificate "sdsiCertificate"
+# define NID_sdsiCertificate 159
+# define OBJ_sdsiCertificate OBJ_certTypes, 2L
+
+# define OBJ_crlTypes OBJ_pkcs9, 23L
+
+# define LN_x509Crl "x509Crl"
+# define NID_x509Crl 160
+# define OBJ_x509Crl OBJ_crlTypes, 1L
+
+/* PKCS#5 v2 OIDs */
+
+# define LN_pbes2 "PBES2"
+# define NID_pbes2 161
+# define OBJ_pbes2 OBJ_pkcs,5L,13L
+
+# define LN_pbmac1 "PBMAC1"
+# define NID_pbmac1 162
+# define OBJ_pbmac1 OBJ_pkcs,5L,14L
+
+# define LN_hmacWithSHA1 "hmacWithSHA1"
+# define NID_hmacWithSHA1 163
+# define OBJ_hmacWithSHA1 OBJ_rsadsi,2L,7L
+
+/* Policy Qualifier Ids */
+
+# define LN_id_qt_cps "Policy Qualifier CPS"
+# define SN_id_qt_cps "id-qt-cps"
+# define NID_id_qt_cps 164
+# define OBJ_id_qt_cps OBJ_id_pkix,2L,1L
+
+# define LN_id_qt_unotice "Policy Qualifier User Notice"
+# define SN_id_qt_unotice "id-qt-unotice"
+# define NID_id_qt_unotice 165
+# define OBJ_id_qt_unotice OBJ_id_pkix,2L,2L
+
+# define SN_rc2_64_cbc "RC2-64-CBC"
+# define LN_rc2_64_cbc "rc2-64-cbc"
+# define NID_rc2_64_cbc 166
+
+# define SN_SMIMECapabilities "SMIME-CAPS"
+# define LN_SMIMECapabilities "S/MIME Capabilities"
+# define NID_SMIMECapabilities 167
+# define OBJ_SMIMECapabilities OBJ_pkcs9,15L
+
+# define SN_pbeWithMD2AndRC2_CBC "PBE-MD2-RC2-64"
+# define LN_pbeWithMD2AndRC2_CBC "pbeWithMD2AndRC2-CBC"
+# define NID_pbeWithMD2AndRC2_CBC 168
+# define OBJ_pbeWithMD2AndRC2_CBC OBJ_pkcs,5L,4L
+
+# define SN_pbeWithMD5AndRC2_CBC "PBE-MD5-RC2-64"
+# define LN_pbeWithMD5AndRC2_CBC "pbeWithMD5AndRC2-CBC"
+# define NID_pbeWithMD5AndRC2_CBC 169
+# define OBJ_pbeWithMD5AndRC2_CBC OBJ_pkcs,5L,6L
+
+# define SN_pbeWithSHA1AndDES_CBC "PBE-SHA1-DES"
+# define LN_pbeWithSHA1AndDES_CBC "pbeWithSHA1AndDES-CBC"
+# define NID_pbeWithSHA1AndDES_CBC 170
+# define OBJ_pbeWithSHA1AndDES_CBC OBJ_pkcs,5L,10L
+
+/* Extension request OIDs */
+
+# define LN_ms_ext_req "Microsoft Extension Request"
+# define SN_ms_ext_req "msExtReq"
+# define NID_ms_ext_req 171
+# define OBJ_ms_ext_req 1L,3L,6L,1L,4L,1L,311L,2L,1L,14L
+
+# define LN_ext_req "Extension Request"
+# define SN_ext_req "extReq"
+# define NID_ext_req 172
+# define OBJ_ext_req OBJ_pkcs9,14L
+
+# define SN_name "name"
+# define LN_name "name"
+# define NID_name 173
+# define OBJ_name OBJ_X509,41L
+
+# define SN_dnQualifier "dnQualifier"
+# define LN_dnQualifier "dnQualifier"
+# define NID_dnQualifier 174
+# define OBJ_dnQualifier OBJ_X509,46L
+
+# define SN_id_pe "id-pe"
+# define NID_id_pe 175
+# define OBJ_id_pe OBJ_id_pkix,1L
+
+# define SN_id_ad "id-ad"
+# define NID_id_ad 176
+# define OBJ_id_ad OBJ_id_pkix,48L
+
+# define SN_info_access "authorityInfoAccess"
+# define LN_info_access "Authority Information Access"
+# define NID_info_access 177
+# define OBJ_info_access OBJ_id_pe,1L
+
+# define SN_ad_OCSP "OCSP"
+# define LN_ad_OCSP "OCSP"
+# define NID_ad_OCSP 178
+# define OBJ_ad_OCSP OBJ_id_ad,1L
+
+# define SN_ad_ca_issuers "caIssuers"
+# define LN_ad_ca_issuers "CA Issuers"
+# define NID_ad_ca_issuers 179
+# define OBJ_ad_ca_issuers OBJ_id_ad,2L
+
+# define SN_OCSP_sign "OCSPSigning"
+# define LN_OCSP_sign "OCSP Signing"
+# define NID_OCSP_sign 180
+# define OBJ_OCSP_sign OBJ_id_kp,9L
+# endif /* USE_OBJ_MAC */
+
+# include <openssl/bio.h>
+# include <openssl/asn1.h>
+
+# define OBJ_NAME_TYPE_UNDEF 0x00
+# define OBJ_NAME_TYPE_MD_METH 0x01
+# define OBJ_NAME_TYPE_CIPHER_METH 0x02
+# define OBJ_NAME_TYPE_PKEY_METH 0x03
+# define OBJ_NAME_TYPE_COMP_METH 0x04
+# define OBJ_NAME_TYPE_NUM 0x05
+
+# define OBJ_NAME_ALIAS 0x8000
+
+# define OBJ_BSEARCH_VALUE_ON_NOMATCH 0x01
+# define OBJ_BSEARCH_FIRST_VALUE_ON_MATCH 0x02
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct obj_name_st {
+ int type;
+ int alias;
+ const char *name;
+ const char *data;
+} OBJ_NAME;
+
+# define OBJ_create_and_add_object(a,b,c) OBJ_create(a,b,c)
+
+int OBJ_NAME_init(void);
+int OBJ_NAME_new_index(unsigned long (*hash_func) (const char *),
+ int (*cmp_func) (const char *, const char *),
+ void (*free_func) (const char *, int, const char *));
+const char *OBJ_NAME_get(const char *name, int type);
+int OBJ_NAME_add(const char *name, int type, const char *data);
+int OBJ_NAME_remove(const char *name, int type);
+void OBJ_NAME_cleanup(int type); /* -1 for everything */
+void OBJ_NAME_do_all(int type, void (*fn) (const OBJ_NAME *, void *arg),
+ void *arg);
+void OBJ_NAME_do_all_sorted(int type,
+ void (*fn) (const OBJ_NAME *, void *arg),
+ void *arg);
+
+ASN1_OBJECT *OBJ_dup(const ASN1_OBJECT *o);
+ASN1_OBJECT *OBJ_nid2obj(int n);
+const char *OBJ_nid2ln(int n);
+const char *OBJ_nid2sn(int n);
+int OBJ_obj2nid(const ASN1_OBJECT *o);
+ASN1_OBJECT *OBJ_txt2obj(const char *s, int no_name);
+int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name);
+int OBJ_txt2nid(const char *s);
+int OBJ_ln2nid(const char *s);
+int OBJ_sn2nid(const char *s);
+int OBJ_cmp(const ASN1_OBJECT *a, const ASN1_OBJECT *b);
+const void *OBJ_bsearch_(const void *key, const void *base, int num, int size,
+ int (*cmp) (const void *, const void *));
+const void *OBJ_bsearch_ex_(const void *key, const void *base, int num,
+ int size,
+ int (*cmp) (const void *, const void *),
+ int flags);
+
+# define _DECLARE_OBJ_BSEARCH_CMP_FN(scope, type1, type2, nm) \
+ static int nm##_cmp_BSEARCH_CMP_FN(const void *, const void *); \
+ static int nm##_cmp(type1 const *, type2 const *); \
+ scope type2 * OBJ_bsearch_##nm(type1 *key, type2 const *base, int num)
+
+# define DECLARE_OBJ_BSEARCH_CMP_FN(type1, type2, cmp) \
+ _DECLARE_OBJ_BSEARCH_CMP_FN(static, type1, type2, cmp)
+# define DECLARE_OBJ_BSEARCH_GLOBAL_CMP_FN(type1, type2, nm) \
+ type2 * OBJ_bsearch_##nm(type1 *key, type2 const *base, int num)
+
+/*-
+ * Unsolved problem: if a type is actually a pointer type, like
+ * nid_triple is, then its impossible to get a const where you need
+ * it. Consider:
+ *
+ * typedef int nid_triple[3];
+ * const void *a_;
+ * const nid_triple const *a = a_;
+ *
+ * The assignement discards a const because what you really want is:
+ *
+ * const int const * const *a = a_;
+ *
+ * But if you do that, you lose the fact that a is an array of 3 ints,
+ * which breaks comparison functions.
+ *
+ * Thus we end up having to cast, sadly, or unpack the
+ * declarations. Or, as I finally did in this case, delcare nid_triple
+ * to be a struct, which it should have been in the first place.
+ *
+ * Ben, August 2008.
+ *
+ * Also, strictly speaking not all types need be const, but handling
+ * the non-constness means a lot of complication, and in practice
+ * comparison routines do always not touch their arguments.
+ */
+
+# define IMPLEMENT_OBJ_BSEARCH_CMP_FN(type1, type2, nm) \
+ static int nm##_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_) \
+ { \
+ type1 const *a = a_; \
+ type2 const *b = b_; \
+ return nm##_cmp(a,b); \
+ } \
+ static type2 *OBJ_bsearch_##nm(type1 *key, type2 const *base, int num) \
+ { \
+ return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
+ nm##_cmp_BSEARCH_CMP_FN); \
+ } \
+ extern void dummy_prototype(void)
+
+# define IMPLEMENT_OBJ_BSEARCH_GLOBAL_CMP_FN(type1, type2, nm) \
+ static int nm##_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_) \
+ { \
+ type1 const *a = a_; \
+ type2 const *b = b_; \
+ return nm##_cmp(a,b); \
+ } \
+ type2 *OBJ_bsearch_##nm(type1 *key, type2 const *base, int num) \
+ { \
+ return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
+ nm##_cmp_BSEARCH_CMP_FN); \
+ } \
+ extern void dummy_prototype(void)
+
+# define OBJ_bsearch(type1,key,type2,base,num,cmp) \
+ ((type2 *)OBJ_bsearch_(CHECKED_PTR_OF(type1,key),CHECKED_PTR_OF(type2,base), \
+ num,sizeof(type2), \
+ ((void)CHECKED_PTR_OF(type1,cmp##_type_1), \
+ (void)CHECKED_PTR_OF(type2,cmp##_type_2), \
+ cmp##_BSEARCH_CMP_FN)))
+
+# define OBJ_bsearch_ex(type1,key,type2,base,num,cmp,flags) \
+ ((type2 *)OBJ_bsearch_ex_(CHECKED_PTR_OF(type1,key),CHECKED_PTR_OF(type2,base), \
+ num,sizeof(type2), \
+ ((void)CHECKED_PTR_OF(type1,cmp##_type_1), \
+ (void)type_2=CHECKED_PTR_OF(type2,cmp##_type_2), \
+ cmp##_BSEARCH_CMP_FN)),flags)
+
+int OBJ_new_nid(int num);
+int OBJ_add_object(const ASN1_OBJECT *obj);
+int OBJ_create(const char *oid, const char *sn, const char *ln);
+void OBJ_cleanup(void);
+int OBJ_create_objects(BIO *in);
+
+int OBJ_find_sigid_algs(int signid, int *pdig_nid, int *ppkey_nid);
+int OBJ_find_sigid_by_algs(int *psignid, int dig_nid, int pkey_nid);
+int OBJ_add_sigid(int signid, int dig_id, int pkey_id);
+void OBJ_sigid_free(void);
+
+extern int obj_cleanup_defer;
+void check_defer(int nid);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_OBJ_strings(void);
+
+/* Error codes for the OBJ functions. */
+
+/* Function codes. */
+# define OBJ_F_OBJ_ADD_OBJECT 105
+# define OBJ_F_OBJ_CREATE 100
+# define OBJ_F_OBJ_DUP 101
+# define OBJ_F_OBJ_NAME_NEW_INDEX 106
+# define OBJ_F_OBJ_NID2LN 102
+# define OBJ_F_OBJ_NID2OBJ 103
+# define OBJ_F_OBJ_NID2SN 104
+
+/* Reason codes. */
+# define OBJ_R_MALLOC_FAILURE 100
+# define OBJ_R_UNKNOWN_NID 101
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/ocsp.h b/protocols/Telegram/tgl/openssl/include/openssl/ocsp.h
new file mode 100644
index 0000000000..ca2ee76dce
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/ocsp.h
@@ -0,0 +1,637 @@
+/* ocsp.h */
+/*
+ * Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL
+ * project.
+ */
+
+/*
+ * History: This file was transfered to Richard Levitte from CertCo by Kathy
+ * Weinhold in mid-spring 2000 to be included in OpenSSL or released as a
+ * patch kit.
+ */
+
+/* ====================================================================
+ * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_OCSP_H
+# define HEADER_OCSP_H
+
+# include <openssl/ossl_typ.h>
+# include <openssl/x509.h>
+# include <openssl/x509v3.h>
+# include <openssl/safestack.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Various flags and values */
+
+# define OCSP_DEFAULT_NONCE_LENGTH 16
+
+# define OCSP_NOCERTS 0x1
+# define OCSP_NOINTERN 0x2
+# define OCSP_NOSIGS 0x4
+# define OCSP_NOCHAIN 0x8
+# define OCSP_NOVERIFY 0x10
+# define OCSP_NOEXPLICIT 0x20
+# define OCSP_NOCASIGN 0x40
+# define OCSP_NODELEGATED 0x80
+# define OCSP_NOCHECKS 0x100
+# define OCSP_TRUSTOTHER 0x200
+# define OCSP_RESPID_KEY 0x400
+# define OCSP_NOTIME 0x800
+
+/*- CertID ::= SEQUENCE {
+ * hashAlgorithm AlgorithmIdentifier,
+ * issuerNameHash OCTET STRING, -- Hash of Issuer's DN
+ * issuerKeyHash OCTET STRING, -- Hash of Issuers public key (excluding the tag & length fields)
+ * serialNumber CertificateSerialNumber }
+ */
+typedef struct ocsp_cert_id_st {
+ X509_ALGOR *hashAlgorithm;
+ ASN1_OCTET_STRING *issuerNameHash;
+ ASN1_OCTET_STRING *issuerKeyHash;
+ ASN1_INTEGER *serialNumber;
+} OCSP_CERTID;
+
+DECLARE_STACK_OF(OCSP_CERTID)
+
+/*- Request ::= SEQUENCE {
+ * reqCert CertID,
+ * singleRequestExtensions [0] EXPLICIT Extensions OPTIONAL }
+ */
+typedef struct ocsp_one_request_st {
+ OCSP_CERTID *reqCert;
+ STACK_OF(X509_EXTENSION) *singleRequestExtensions;
+} OCSP_ONEREQ;
+
+DECLARE_STACK_OF(OCSP_ONEREQ)
+DECLARE_ASN1_SET_OF(OCSP_ONEREQ)
+
+/*- TBSRequest ::= SEQUENCE {
+ * version [0] EXPLICIT Version DEFAULT v1,
+ * requestorName [1] EXPLICIT GeneralName OPTIONAL,
+ * requestList SEQUENCE OF Request,
+ * requestExtensions [2] EXPLICIT Extensions OPTIONAL }
+ */
+typedef struct ocsp_req_info_st {
+ ASN1_INTEGER *version;
+ GENERAL_NAME *requestorName;
+ STACK_OF(OCSP_ONEREQ) *requestList;
+ STACK_OF(X509_EXTENSION) *requestExtensions;
+} OCSP_REQINFO;
+
+/*- Signature ::= SEQUENCE {
+ * signatureAlgorithm AlgorithmIdentifier,
+ * signature BIT STRING,
+ * certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }
+ */
+typedef struct ocsp_signature_st {
+ X509_ALGOR *signatureAlgorithm;
+ ASN1_BIT_STRING *signature;
+ STACK_OF(X509) *certs;
+} OCSP_SIGNATURE;
+
+/*- OCSPRequest ::= SEQUENCE {
+ * tbsRequest TBSRequest,
+ * optionalSignature [0] EXPLICIT Signature OPTIONAL }
+ */
+typedef struct ocsp_request_st {
+ OCSP_REQINFO *tbsRequest;
+ OCSP_SIGNATURE *optionalSignature; /* OPTIONAL */
+} OCSP_REQUEST;
+
+/*- OCSPResponseStatus ::= ENUMERATED {
+ * successful (0), --Response has valid confirmations
+ * malformedRequest (1), --Illegal confirmation request
+ * internalError (2), --Internal error in issuer
+ * tryLater (3), --Try again later
+ * --(4) is not used
+ * sigRequired (5), --Must sign the request
+ * unauthorized (6) --Request unauthorized
+ * }
+ */
+# define OCSP_RESPONSE_STATUS_SUCCESSFUL 0
+# define OCSP_RESPONSE_STATUS_MALFORMEDREQUEST 1
+# define OCSP_RESPONSE_STATUS_INTERNALERROR 2
+# define OCSP_RESPONSE_STATUS_TRYLATER 3
+# define OCSP_RESPONSE_STATUS_SIGREQUIRED 5
+# define OCSP_RESPONSE_STATUS_UNAUTHORIZED 6
+
+/*- ResponseBytes ::= SEQUENCE {
+ * responseType OBJECT IDENTIFIER,
+ * response OCTET STRING }
+ */
+typedef struct ocsp_resp_bytes_st {
+ ASN1_OBJECT *responseType;
+ ASN1_OCTET_STRING *response;
+} OCSP_RESPBYTES;
+
+/*- OCSPResponse ::= SEQUENCE {
+ * responseStatus OCSPResponseStatus,
+ * responseBytes [0] EXPLICIT ResponseBytes OPTIONAL }
+ */
+struct ocsp_response_st {
+ ASN1_ENUMERATED *responseStatus;
+ OCSP_RESPBYTES *responseBytes;
+};
+
+/*- ResponderID ::= CHOICE {
+ * byName [1] Name,
+ * byKey [2] KeyHash }
+ */
+# define V_OCSP_RESPID_NAME 0
+# define V_OCSP_RESPID_KEY 1
+struct ocsp_responder_id_st {
+ int type;
+ union {
+ X509_NAME *byName;
+ ASN1_OCTET_STRING *byKey;
+ } value;
+};
+
+DECLARE_STACK_OF(OCSP_RESPID)
+DECLARE_ASN1_FUNCTIONS(OCSP_RESPID)
+
+/*- KeyHash ::= OCTET STRING --SHA-1 hash of responder's public key
+ * --(excluding the tag and length fields)
+ */
+
+/*- RevokedInfo ::= SEQUENCE {
+ * revocationTime GeneralizedTime,
+ * revocationReason [0] EXPLICIT CRLReason OPTIONAL }
+ */
+typedef struct ocsp_revoked_info_st {
+ ASN1_GENERALIZEDTIME *revocationTime;
+ ASN1_ENUMERATED *revocationReason;
+} OCSP_REVOKEDINFO;
+
+/*- CertStatus ::= CHOICE {
+ * good [0] IMPLICIT NULL,
+ * revoked [1] IMPLICIT RevokedInfo,
+ * unknown [2] IMPLICIT UnknownInfo }
+ */
+# define V_OCSP_CERTSTATUS_GOOD 0
+# define V_OCSP_CERTSTATUS_REVOKED 1
+# define V_OCSP_CERTSTATUS_UNKNOWN 2
+typedef struct ocsp_cert_status_st {
+ int type;
+ union {
+ ASN1_NULL *good;
+ OCSP_REVOKEDINFO *revoked;
+ ASN1_NULL *unknown;
+ } value;
+} OCSP_CERTSTATUS;
+
+/*- SingleResponse ::= SEQUENCE {
+ * certID CertID,
+ * certStatus CertStatus,
+ * thisUpdate GeneralizedTime,
+ * nextUpdate [0] EXPLICIT GeneralizedTime OPTIONAL,
+ * singleExtensions [1] EXPLICIT Extensions OPTIONAL }
+ */
+typedef struct ocsp_single_response_st {
+ OCSP_CERTID *certId;
+ OCSP_CERTSTATUS *certStatus;
+ ASN1_GENERALIZEDTIME *thisUpdate;
+ ASN1_GENERALIZEDTIME *nextUpdate;
+ STACK_OF(X509_EXTENSION) *singleExtensions;
+} OCSP_SINGLERESP;
+
+DECLARE_STACK_OF(OCSP_SINGLERESP)
+DECLARE_ASN1_SET_OF(OCSP_SINGLERESP)
+
+/*- ResponseData ::= SEQUENCE {
+ * version [0] EXPLICIT Version DEFAULT v1,
+ * responderID ResponderID,
+ * producedAt GeneralizedTime,
+ * responses SEQUENCE OF SingleResponse,
+ * responseExtensions [1] EXPLICIT Extensions OPTIONAL }
+ */
+typedef struct ocsp_response_data_st {
+ ASN1_INTEGER *version;
+ OCSP_RESPID *responderId;
+ ASN1_GENERALIZEDTIME *producedAt;
+ STACK_OF(OCSP_SINGLERESP) *responses;
+ STACK_OF(X509_EXTENSION) *responseExtensions;
+} OCSP_RESPDATA;
+
+/*- BasicOCSPResponse ::= SEQUENCE {
+ * tbsResponseData ResponseData,
+ * signatureAlgorithm AlgorithmIdentifier,
+ * signature BIT STRING,
+ * certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }
+ */
+ /*
+ * Note 1: The value for "signature" is specified in the OCSP rfc2560 as
+ * follows: "The value for the signature SHALL be computed on the hash of
+ * the DER encoding ResponseData." This means that you must hash the
+ * DER-encoded tbsResponseData, and then run it through a crypto-signing
+ * function, which will (at least w/RSA) do a hash-'n'-private-encrypt
+ * operation. This seems a bit odd, but that's the spec. Also note that
+ * the data structures do not leave anywhere to independently specify the
+ * algorithm used for the initial hash. So, we look at the
+ * signature-specification algorithm, and try to do something intelligent.
+ * -- Kathy Weinhold, CertCo
+ */
+ /*
+ * Note 2: It seems that the mentioned passage from RFC 2560 (section
+ * 4.2.1) is open for interpretation. I've done tests against another
+ * responder, and found that it doesn't do the double hashing that the RFC
+ * seems to say one should. Therefore, all relevant functions take a flag
+ * saying which variant should be used. -- Richard Levitte, OpenSSL team
+ * and CeloCom
+ */
+typedef struct ocsp_basic_response_st {
+ OCSP_RESPDATA *tbsResponseData;
+ X509_ALGOR *signatureAlgorithm;
+ ASN1_BIT_STRING *signature;
+ STACK_OF(X509) *certs;
+} OCSP_BASICRESP;
+
+/*-
+ * CRLReason ::= ENUMERATED {
+ * unspecified (0),
+ * keyCompromise (1),
+ * cACompromise (2),
+ * affiliationChanged (3),
+ * superseded (4),
+ * cessationOfOperation (5),
+ * certificateHold (6),
+ * removeFromCRL (8) }
+ */
+# define OCSP_REVOKED_STATUS_NOSTATUS -1
+# define OCSP_REVOKED_STATUS_UNSPECIFIED 0
+# define OCSP_REVOKED_STATUS_KEYCOMPROMISE 1
+# define OCSP_REVOKED_STATUS_CACOMPROMISE 2
+# define OCSP_REVOKED_STATUS_AFFILIATIONCHANGED 3
+# define OCSP_REVOKED_STATUS_SUPERSEDED 4
+# define OCSP_REVOKED_STATUS_CESSATIONOFOPERATION 5
+# define OCSP_REVOKED_STATUS_CERTIFICATEHOLD 6
+# define OCSP_REVOKED_STATUS_REMOVEFROMCRL 8
+
+/*-
+ * CrlID ::= SEQUENCE {
+ * crlUrl [0] EXPLICIT IA5String OPTIONAL,
+ * crlNum [1] EXPLICIT INTEGER OPTIONAL,
+ * crlTime [2] EXPLICIT GeneralizedTime OPTIONAL }
+ */
+typedef struct ocsp_crl_id_st {
+ ASN1_IA5STRING *crlUrl;
+ ASN1_INTEGER *crlNum;
+ ASN1_GENERALIZEDTIME *crlTime;
+} OCSP_CRLID;
+
+/*-
+ * ServiceLocator ::= SEQUENCE {
+ * issuer Name,
+ * locator AuthorityInfoAccessSyntax OPTIONAL }
+ */
+typedef struct ocsp_service_locator_st {
+ X509_NAME *issuer;
+ STACK_OF(ACCESS_DESCRIPTION) *locator;
+} OCSP_SERVICELOC;
+
+# define PEM_STRING_OCSP_REQUEST "OCSP REQUEST"
+# define PEM_STRING_OCSP_RESPONSE "OCSP RESPONSE"
+
+# define d2i_OCSP_REQUEST_bio(bp,p) ASN1_d2i_bio_of(OCSP_REQUEST,OCSP_REQUEST_new,d2i_OCSP_REQUEST,bp,p)
+
+# define d2i_OCSP_RESPONSE_bio(bp,p) ASN1_d2i_bio_of(OCSP_RESPONSE,OCSP_RESPONSE_new,d2i_OCSP_RESPONSE,bp,p)
+
+# define PEM_read_bio_OCSP_REQUEST(bp,x,cb) (OCSP_REQUEST *)PEM_ASN1_read_bio( \
+ (char *(*)())d2i_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,bp,(char **)x,cb,NULL)
+
+# define PEM_read_bio_OCSP_RESPONSE(bp,x,cb)(OCSP_RESPONSE *)PEM_ASN1_read_bio(\
+ (char *(*)())d2i_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,bp,(char **)x,cb,NULL)
+
+# define PEM_write_bio_OCSP_REQUEST(bp,o) \
+ PEM_ASN1_write_bio((int (*)())i2d_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,\
+ bp,(char *)o, NULL,NULL,0,NULL,NULL)
+
+# define PEM_write_bio_OCSP_RESPONSE(bp,o) \
+ PEM_ASN1_write_bio((int (*)())i2d_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,\
+ bp,(char *)o, NULL,NULL,0,NULL,NULL)
+
+# define i2d_OCSP_RESPONSE_bio(bp,o) ASN1_i2d_bio_of(OCSP_RESPONSE,i2d_OCSP_RESPONSE,bp,o)
+
+# define i2d_OCSP_REQUEST_bio(bp,o) ASN1_i2d_bio_of(OCSP_REQUEST,i2d_OCSP_REQUEST,bp,o)
+
+# define OCSP_REQUEST_sign(o,pkey,md) \
+ ASN1_item_sign(ASN1_ITEM_rptr(OCSP_REQINFO),\
+ o->optionalSignature->signatureAlgorithm,NULL,\
+ o->optionalSignature->signature,o->tbsRequest,pkey,md)
+
+# define OCSP_BASICRESP_sign(o,pkey,md,d) \
+ ASN1_item_sign(ASN1_ITEM_rptr(OCSP_RESPDATA),o->signatureAlgorithm,NULL,\
+ o->signature,o->tbsResponseData,pkey,md)
+
+# define OCSP_REQUEST_verify(a,r) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_REQINFO),\
+ a->optionalSignature->signatureAlgorithm,\
+ a->optionalSignature->signature,a->tbsRequest,r)
+
+# define OCSP_BASICRESP_verify(a,r,d) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_RESPDATA),\
+ a->signatureAlgorithm,a->signature,a->tbsResponseData,r)
+
+# define ASN1_BIT_STRING_digest(data,type,md,len) \
+ ASN1_item_digest(ASN1_ITEM_rptr(ASN1_BIT_STRING),type,data,md,len)
+
+# define OCSP_CERTSTATUS_dup(cs)\
+ (OCSP_CERTSTATUS*)ASN1_dup((int(*)())i2d_OCSP_CERTSTATUS,\
+ (char *(*)())d2i_OCSP_CERTSTATUS,(char *)(cs))
+
+OCSP_CERTID *OCSP_CERTID_dup(OCSP_CERTID *id);
+
+OCSP_RESPONSE *OCSP_sendreq_bio(BIO *b, const char *path, OCSP_REQUEST *req);
+OCSP_REQ_CTX *OCSP_sendreq_new(BIO *io, const char *path, OCSP_REQUEST *req,
+ int maxline);
+int OCSP_REQ_CTX_nbio(OCSP_REQ_CTX *rctx);
+int OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OCSP_REQ_CTX *rctx);
+OCSP_REQ_CTX *OCSP_REQ_CTX_new(BIO *io, int maxline);
+void OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx);
+void OCSP_set_max_response_length(OCSP_REQ_CTX *rctx, unsigned long len);
+int OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it,
+ ASN1_VALUE *val);
+int OCSP_REQ_CTX_nbio_d2i(OCSP_REQ_CTX *rctx, ASN1_VALUE **pval,
+ const ASN1_ITEM *it);
+BIO *OCSP_REQ_CTX_get0_mem_bio(OCSP_REQ_CTX *rctx);
+int OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it,
+ ASN1_VALUE *val);
+int OCSP_REQ_CTX_http(OCSP_REQ_CTX *rctx, const char *op, const char *path);
+int OCSP_REQ_CTX_set1_req(OCSP_REQ_CTX *rctx, OCSP_REQUEST *req);
+int OCSP_REQ_CTX_add1_header(OCSP_REQ_CTX *rctx,
+ const char *name, const char *value);
+
+OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst, X509 *subject, X509 *issuer);
+
+OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst,
+ X509_NAME *issuerName,
+ ASN1_BIT_STRING *issuerKey,
+ ASN1_INTEGER *serialNumber);
+
+OCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid);
+
+int OCSP_request_add1_nonce(OCSP_REQUEST *req, unsigned char *val, int len);
+int OCSP_basic_add1_nonce(OCSP_BASICRESP *resp, unsigned char *val, int len);
+int OCSP_check_nonce(OCSP_REQUEST *req, OCSP_BASICRESP *bs);
+int OCSP_copy_nonce(OCSP_BASICRESP *resp, OCSP_REQUEST *req);
+
+int OCSP_request_set1_name(OCSP_REQUEST *req, X509_NAME *nm);
+int OCSP_request_add1_cert(OCSP_REQUEST *req, X509 *cert);
+
+int OCSP_request_sign(OCSP_REQUEST *req,
+ X509 *signer,
+ EVP_PKEY *key,
+ const EVP_MD *dgst,
+ STACK_OF(X509) *certs, unsigned long flags);
+
+int OCSP_response_status(OCSP_RESPONSE *resp);
+OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp);
+
+int OCSP_resp_count(OCSP_BASICRESP *bs);
+OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx);
+int OCSP_resp_find(OCSP_BASICRESP *bs, OCSP_CERTID *id, int last);
+int OCSP_single_get0_status(OCSP_SINGLERESP *single, int *reason,
+ ASN1_GENERALIZEDTIME **revtime,
+ ASN1_GENERALIZEDTIME **thisupd,
+ ASN1_GENERALIZEDTIME **nextupd);
+int OCSP_resp_find_status(OCSP_BASICRESP *bs, OCSP_CERTID *id, int *status,
+ int *reason,
+ ASN1_GENERALIZEDTIME **revtime,
+ ASN1_GENERALIZEDTIME **thisupd,
+ ASN1_GENERALIZEDTIME **nextupd);
+int OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd,
+ ASN1_GENERALIZEDTIME *nextupd, long sec, long maxsec);
+
+int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs,
+ X509_STORE *store, unsigned long flags);
+
+int OCSP_parse_url(const char *url, char **phost, char **pport, char **ppath,
+ int *pssl);
+
+int OCSP_id_issuer_cmp(OCSP_CERTID *a, OCSP_CERTID *b);
+int OCSP_id_cmp(OCSP_CERTID *a, OCSP_CERTID *b);
+
+int OCSP_request_onereq_count(OCSP_REQUEST *req);
+OCSP_ONEREQ *OCSP_request_onereq_get0(OCSP_REQUEST *req, int i);
+OCSP_CERTID *OCSP_onereq_get0_id(OCSP_ONEREQ *one);
+int OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd,
+ ASN1_OCTET_STRING **pikeyHash,
+ ASN1_INTEGER **pserial, OCSP_CERTID *cid);
+int OCSP_request_is_signed(OCSP_REQUEST *req);
+OCSP_RESPONSE *OCSP_response_create(int status, OCSP_BASICRESP *bs);
+OCSP_SINGLERESP *OCSP_basic_add1_status(OCSP_BASICRESP *rsp,
+ OCSP_CERTID *cid,
+ int status, int reason,
+ ASN1_TIME *revtime,
+ ASN1_TIME *thisupd,
+ ASN1_TIME *nextupd);
+int OCSP_basic_add1_cert(OCSP_BASICRESP *resp, X509 *cert);
+int OCSP_basic_sign(OCSP_BASICRESP *brsp,
+ X509 *signer, EVP_PKEY *key, const EVP_MD *dgst,
+ STACK_OF(X509) *certs, unsigned long flags);
+
+X509_EXTENSION *OCSP_crlID_new(char *url, long *n, char *tim);
+
+X509_EXTENSION *OCSP_accept_responses_new(char **oids);
+
+X509_EXTENSION *OCSP_archive_cutoff_new(char *tim);
+
+X509_EXTENSION *OCSP_url_svcloc_new(X509_NAME *issuer, char **urls);
+
+int OCSP_REQUEST_get_ext_count(OCSP_REQUEST *x);
+int OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos);
+int OCSP_REQUEST_get_ext_by_OBJ(OCSP_REQUEST *x, ASN1_OBJECT *obj,
+ int lastpos);
+int OCSP_REQUEST_get_ext_by_critical(OCSP_REQUEST *x, int crit, int lastpos);
+X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc);
+X509_EXTENSION *OCSP_REQUEST_delete_ext(OCSP_REQUEST *x, int loc);
+void *OCSP_REQUEST_get1_ext_d2i(OCSP_REQUEST *x, int nid, int *crit,
+ int *idx);
+int OCSP_REQUEST_add1_ext_i2d(OCSP_REQUEST *x, int nid, void *value, int crit,
+ unsigned long flags);
+int OCSP_REQUEST_add_ext(OCSP_REQUEST *x, X509_EXTENSION *ex, int loc);
+
+int OCSP_ONEREQ_get_ext_count(OCSP_ONEREQ *x);
+int OCSP_ONEREQ_get_ext_by_NID(OCSP_ONEREQ *x, int nid, int lastpos);
+int OCSP_ONEREQ_get_ext_by_OBJ(OCSP_ONEREQ *x, ASN1_OBJECT *obj, int lastpos);
+int OCSP_ONEREQ_get_ext_by_critical(OCSP_ONEREQ *x, int crit, int lastpos);
+X509_EXTENSION *OCSP_ONEREQ_get_ext(OCSP_ONEREQ *x, int loc);
+X509_EXTENSION *OCSP_ONEREQ_delete_ext(OCSP_ONEREQ *x, int loc);
+void *OCSP_ONEREQ_get1_ext_d2i(OCSP_ONEREQ *x, int nid, int *crit, int *idx);
+int OCSP_ONEREQ_add1_ext_i2d(OCSP_ONEREQ *x, int nid, void *value, int crit,
+ unsigned long flags);
+int OCSP_ONEREQ_add_ext(OCSP_ONEREQ *x, X509_EXTENSION *ex, int loc);
+
+int OCSP_BASICRESP_get_ext_count(OCSP_BASICRESP *x);
+int OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos);
+int OCSP_BASICRESP_get_ext_by_OBJ(OCSP_BASICRESP *x, ASN1_OBJECT *obj,
+ int lastpos);
+int OCSP_BASICRESP_get_ext_by_critical(OCSP_BASICRESP *x, int crit,
+ int lastpos);
+X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc);
+X509_EXTENSION *OCSP_BASICRESP_delete_ext(OCSP_BASICRESP *x, int loc);
+void *OCSP_BASICRESP_get1_ext_d2i(OCSP_BASICRESP *x, int nid, int *crit,
+ int *idx);
+int OCSP_BASICRESP_add1_ext_i2d(OCSP_BASICRESP *x, int nid, void *value,
+ int crit, unsigned long flags);
+int OCSP_BASICRESP_add_ext(OCSP_BASICRESP *x, X509_EXTENSION *ex, int loc);
+
+int OCSP_SINGLERESP_get_ext_count(OCSP_SINGLERESP *x);
+int OCSP_SINGLERESP_get_ext_by_NID(OCSP_SINGLERESP *x, int nid, int lastpos);
+int OCSP_SINGLERESP_get_ext_by_OBJ(OCSP_SINGLERESP *x, ASN1_OBJECT *obj,
+ int lastpos);
+int OCSP_SINGLERESP_get_ext_by_critical(OCSP_SINGLERESP *x, int crit,
+ int lastpos);
+X509_EXTENSION *OCSP_SINGLERESP_get_ext(OCSP_SINGLERESP *x, int loc);
+X509_EXTENSION *OCSP_SINGLERESP_delete_ext(OCSP_SINGLERESP *x, int loc);
+void *OCSP_SINGLERESP_get1_ext_d2i(OCSP_SINGLERESP *x, int nid, int *crit,
+ int *idx);
+int OCSP_SINGLERESP_add1_ext_i2d(OCSP_SINGLERESP *x, int nid, void *value,
+ int crit, unsigned long flags);
+int OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, X509_EXTENSION *ex, int loc);
+
+DECLARE_ASN1_FUNCTIONS(OCSP_SINGLERESP)
+DECLARE_ASN1_FUNCTIONS(OCSP_CERTSTATUS)
+DECLARE_ASN1_FUNCTIONS(OCSP_REVOKEDINFO)
+DECLARE_ASN1_FUNCTIONS(OCSP_BASICRESP)
+DECLARE_ASN1_FUNCTIONS(OCSP_RESPDATA)
+DECLARE_ASN1_FUNCTIONS(OCSP_RESPID)
+DECLARE_ASN1_FUNCTIONS(OCSP_RESPONSE)
+DECLARE_ASN1_FUNCTIONS(OCSP_RESPBYTES)
+DECLARE_ASN1_FUNCTIONS(OCSP_ONEREQ)
+DECLARE_ASN1_FUNCTIONS(OCSP_CERTID)
+DECLARE_ASN1_FUNCTIONS(OCSP_REQUEST)
+DECLARE_ASN1_FUNCTIONS(OCSP_SIGNATURE)
+DECLARE_ASN1_FUNCTIONS(OCSP_REQINFO)
+DECLARE_ASN1_FUNCTIONS(OCSP_CRLID)
+DECLARE_ASN1_FUNCTIONS(OCSP_SERVICELOC)
+
+const char *OCSP_response_status_str(long s);
+const char *OCSP_cert_status_str(long s);
+const char *OCSP_crl_reason_str(long s);
+
+int OCSP_REQUEST_print(BIO *bp, OCSP_REQUEST *a, unsigned long flags);
+int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE *o, unsigned long flags);
+
+int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs,
+ X509_STORE *st, unsigned long flags);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_OCSP_strings(void);
+
+/* Error codes for the OCSP functions. */
+
+/* Function codes. */
+# define OCSP_F_ASN1_STRING_ENCODE 100
+# define OCSP_F_D2I_OCSP_NONCE 102
+# define OCSP_F_OCSP_BASIC_ADD1_STATUS 103
+# define OCSP_F_OCSP_BASIC_SIGN 104
+# define OCSP_F_OCSP_BASIC_VERIFY 105
+# define OCSP_F_OCSP_CERT_ID_NEW 101
+# define OCSP_F_OCSP_CHECK_DELEGATED 106
+# define OCSP_F_OCSP_CHECK_IDS 107
+# define OCSP_F_OCSP_CHECK_ISSUER 108
+# define OCSP_F_OCSP_CHECK_VALIDITY 115
+# define OCSP_F_OCSP_MATCH_ISSUERID 109
+# define OCSP_F_OCSP_PARSE_URL 114
+# define OCSP_F_OCSP_REQUEST_SIGN 110
+# define OCSP_F_OCSP_REQUEST_VERIFY 116
+# define OCSP_F_OCSP_RESPONSE_GET1_BASIC 111
+# define OCSP_F_OCSP_SENDREQ_BIO 112
+# define OCSP_F_OCSP_SENDREQ_NBIO 117
+# define OCSP_F_PARSE_HTTP_LINE1 118
+# define OCSP_F_REQUEST_VERIFY 113
+
+/* Reason codes. */
+# define OCSP_R_BAD_DATA 100
+# define OCSP_R_CERTIFICATE_VERIFY_ERROR 101
+# define OCSP_R_DIGEST_ERR 102
+# define OCSP_R_ERROR_IN_NEXTUPDATE_FIELD 122
+# define OCSP_R_ERROR_IN_THISUPDATE_FIELD 123
+# define OCSP_R_ERROR_PARSING_URL 121
+# define OCSP_R_MISSING_OCSPSIGNING_USAGE 103
+# define OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE 124
+# define OCSP_R_NOT_BASIC_RESPONSE 104
+# define OCSP_R_NO_CERTIFICATES_IN_CHAIN 105
+# define OCSP_R_NO_CONTENT 106
+# define OCSP_R_NO_PUBLIC_KEY 107
+# define OCSP_R_NO_RESPONSE_DATA 108
+# define OCSP_R_NO_REVOKED_TIME 109
+# define OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 110
+# define OCSP_R_REQUEST_NOT_SIGNED 128
+# define OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA 111
+# define OCSP_R_ROOT_CA_NOT_TRUSTED 112
+# define OCSP_R_SERVER_READ_ERROR 113
+# define OCSP_R_SERVER_RESPONSE_ERROR 114
+# define OCSP_R_SERVER_RESPONSE_PARSE_ERROR 115
+# define OCSP_R_SERVER_WRITE_ERROR 116
+# define OCSP_R_SIGNATURE_FAILURE 117
+# define OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND 118
+# define OCSP_R_STATUS_EXPIRED 125
+# define OCSP_R_STATUS_NOT_YET_VALID 126
+# define OCSP_R_STATUS_TOO_OLD 127
+# define OCSP_R_UNKNOWN_MESSAGE_DIGEST 119
+# define OCSP_R_UNKNOWN_NID 120
+# define OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE 129
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/opensslconf.h b/protocols/Telegram/tgl/openssl/include/openssl/opensslconf.h
new file mode 100644
index 0000000000..46329cc5fd
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/opensslconf.h
@@ -0,0 +1,259 @@
+/* opensslconf.h */
+/* WARNING: Generated automatically from opensslconf.h.in by Configure. */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+/* OpenSSL was configured with the following options: */
+#ifndef OPENSSL_SYSNAME_WIN32
+# define OPENSSL_SYSNAME_WIN32
+#endif
+#ifndef OPENSSL_DOING_MAKEDEPEND
+
+
+#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
+# define OPENSSL_NO_EC_NISTP_64_GCC_128
+#endif
+#ifndef OPENSSL_NO_GMP
+# define OPENSSL_NO_GMP
+#endif
+#ifndef OPENSSL_NO_JPAKE
+# define OPENSSL_NO_JPAKE
+#endif
+#ifndef OPENSSL_NO_KRB5
+# define OPENSSL_NO_KRB5
+#endif
+#ifndef OPENSSL_NO_LIBUNBOUND
+# define OPENSSL_NO_LIBUNBOUND
+#endif
+#ifndef OPENSSL_NO_MD2
+# define OPENSSL_NO_MD2
+#endif
+#ifndef OPENSSL_NO_RC5
+# define OPENSSL_NO_RC5
+#endif
+#ifndef OPENSSL_NO_RFC3779
+# define OPENSSL_NO_RFC3779
+#endif
+#ifndef OPENSSL_NO_SCTP
+# define OPENSSL_NO_SCTP
+#endif
+#ifndef OPENSSL_NO_SSL_TRACE
+# define OPENSSL_NO_SSL_TRACE
+#endif
+#ifndef OPENSSL_NO_STORE
+# define OPENSSL_NO_STORE
+#endif
+#ifndef OPENSSL_NO_UNIT_TEST
+# define OPENSSL_NO_UNIT_TEST
+#endif
+
+#endif /* OPENSSL_DOING_MAKEDEPEND */
+
+#ifndef OPENSSL_THREADS
+# define OPENSSL_THREADS
+#endif
+
+/* The OPENSSL_NO_* macros are also defined as NO_* if the application
+ asks for it. This is a transient feature that is provided for those
+ who haven't had the time to do the appropriate changes in their
+ applications. */
+#ifdef OPENSSL_ALGORITHM_DEFINES
+# if defined(OPENSSL_NO_EC_NISTP_64_GCC_128) && !defined(NO_EC_NISTP_64_GCC_128)
+# define NO_EC_NISTP_64_GCC_128
+# endif
+# if defined(OPENSSL_NO_GMP) && !defined(NO_GMP)
+# define NO_GMP
+# endif
+# if defined(OPENSSL_NO_JPAKE) && !defined(NO_JPAKE)
+# define NO_JPAKE
+# endif
+# if defined(OPENSSL_NO_KRB5) && !defined(NO_KRB5)
+# define NO_KRB5
+# endif
+# if defined(OPENSSL_NO_LIBUNBOUND) && !defined(NO_LIBUNBOUND)
+# define NO_LIBUNBOUND
+# endif
+# if defined(OPENSSL_NO_MD2) && !defined(NO_MD2)
+# define NO_MD2
+# endif
+# if defined(OPENSSL_NO_RC5) && !defined(NO_RC5)
+# define NO_RC5
+# endif
+# if defined(OPENSSL_NO_RFC3779) && !defined(NO_RFC3779)
+# define NO_RFC3779
+# endif
+# if defined(OPENSSL_NO_SCTP) && !defined(NO_SCTP)
+# define NO_SCTP
+# endif
+# if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE)
+# define NO_SSL_TRACE
+# endif
+# if defined(OPENSSL_NO_STORE) && !defined(NO_STORE)
+# define NO_STORE
+# endif
+# if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST)
+# define NO_UNIT_TEST
+# endif
+#endif
+
+#define OPENSSL_CPUID_OBJ
+
+/* crypto/opensslconf.h.in */
+
+/* Generate 80386 code? */
+#undef I386_ONLY
+
+#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */
+#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR)
+#define ENGINESDIR "T:\\openssl-1.0.2d-32bit-release-static-VS2015/lib/engines"
+#define OPENSSLDIR "T:\\openssl-1.0.2d-32bit-release-static-VS2015/ssl"
+#endif
+#endif
+
+#undef OPENSSL_UNISTD
+#define OPENSSL_UNISTD <unistd.h>
+
+#undef OPENSSL_EXPORT_VAR_AS_FUNCTION
+#define OPENSSL_EXPORT_VAR_AS_FUNCTION
+
+#if defined(HEADER_IDEA_H) && !defined(IDEA_INT)
+#define IDEA_INT unsigned int
+#endif
+
+#if defined(HEADER_MD2_H) && !defined(MD2_INT)
+#define MD2_INT unsigned int
+#endif
+
+#if defined(HEADER_RC2_H) && !defined(RC2_INT)
+/* I need to put in a mod for the alpha - eay */
+#define RC2_INT unsigned int
+#endif
+
+#if defined(HEADER_RC4_H)
+#if !defined(RC4_INT)
+/* using int types make the structure larger but make the code faster
+ * on most boxes I have tested - up to %20 faster. */
+/*
+ * I don't know what does "most" mean, but declaring "int" is a must on:
+ * - Intel P6 because partial register stalls are very expensive;
+ * - elder Alpha because it lacks byte load/store instructions;
+ */
+#define RC4_INT unsigned int
+#endif
+#if !defined(RC4_CHUNK)
+/*
+ * This enables code handling data aligned at natural CPU word
+ * boundary. See crypto/rc4/rc4_enc.c for further details.
+ */
+#undef RC4_CHUNK
+#endif
+#endif
+
+#if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG)
+/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a
+ * %20 speed up (longs are 8 bytes, int's are 4). */
+#ifndef DES_LONG
+#define DES_LONG unsigned long
+#endif
+#endif
+
+#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H)
+#define CONFIG_HEADER_BN_H
+#define BN_LLONG
+
+/* Should we define BN_DIV2W here? */
+
+/* Only one for the following should be defined */
+#undef SIXTY_FOUR_BIT_LONG
+#undef SIXTY_FOUR_BIT
+#define THIRTY_TWO_BIT
+#endif
+
+#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
+#define CONFIG_HEADER_RC4_LOCL_H
+/* if this is defined data[i] is used instead of *data, this is a %20
+ * speedup on x86 */
+#define RC4_INDEX
+#endif
+
+#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
+#define CONFIG_HEADER_BF_LOCL_H
+#undef BF_PTR
+#endif /* HEADER_BF_LOCL_H */
+
+#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H)
+#define CONFIG_HEADER_DES_LOCL_H
+#ifndef DES_DEFAULT_OPTIONS
+/* the following is tweaked from a config script, that is why it is a
+ * protected undef/define */
+#ifndef DES_PTR
+#undef DES_PTR
+#endif
+
+/* This helps C compiler generate the correct code for multiple functional
+ * units. It reduces register dependancies at the expense of 2 more
+ * registers */
+#ifndef DES_RISC1
+#undef DES_RISC1
+#endif
+
+#ifndef DES_RISC2
+#undef DES_RISC2
+#endif
+
+#if defined(DES_RISC1) && defined(DES_RISC2)
+#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
+#endif
+
+/* Unroll the inner loop, this sometimes helps, sometimes hinders.
+ * Very mucy CPU dependant */
+#ifndef DES_UNROLL
+#undef DES_UNROLL
+#endif
+
+/* These default values were supplied by
+ * Peter Gutman <pgut001@cs.auckland.ac.nz>
+ * They are only used if nothing else has been defined */
+#if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL)
+/* Special defines which change the way the code is built depending on the
+ CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find
+ even newer MIPS CPU's, but at the moment one size fits all for
+ optimization options. Older Sparc's work better with only UNROLL, but
+ there's no way to tell at compile time what it is you're running on */
+
+#if defined( sun ) /* Newer Sparc's */
+# define DES_PTR
+# define DES_RISC1
+# define DES_UNROLL
+#elif defined( __ultrix ) /* Older MIPS */
+# define DES_PTR
+# define DES_RISC2
+# define DES_UNROLL
+#elif defined( __osf1__ ) /* Alpha */
+# define DES_PTR
+# define DES_RISC2
+#elif defined ( _AIX ) /* RS6000 */
+ /* Unknown */
+#elif defined( __hpux ) /* HP-PA */
+ /* Unknown */
+#elif defined( __aux ) /* 68K */
+ /* Unknown */
+#elif defined( __dgux ) /* 88K (but P6 in latest boxes) */
+# define DES_UNROLL
+#elif defined( __sgi ) /* Newer MIPS */
+# define DES_PTR
+# define DES_RISC2
+# define DES_UNROLL
+#elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */
+# define DES_PTR
+# define DES_RISC1
+# define DES_UNROLL
+#endif /* Systems-specific speed defines */
+#endif
+
+#endif /* DES_DEFAULT_OPTIONS */
+#endif /* HEADER_DES_LOCL_H */
+#ifdef __cplusplus
+}
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/opensslv.h b/protocols/Telegram/tgl/openssl/include/openssl/opensslv.h
new file mode 100644
index 0000000000..c06b13ac6b
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/opensslv.h
@@ -0,0 +1,97 @@
+#ifndef HEADER_OPENSSLV_H
+# define HEADER_OPENSSLV_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*-
+ * Numeric release version identifier:
+ * MNNFFPPS: major minor fix patch status
+ * The status nibble has one of the values 0 for development, 1 to e for betas
+ * 1 to 14, and f for release. The patch level is exactly that.
+ * For example:
+ * 0.9.3-dev 0x00903000
+ * 0.9.3-beta1 0x00903001
+ * 0.9.3-beta2-dev 0x00903002
+ * 0.9.3-beta2 0x00903002 (same as ...beta2-dev)
+ * 0.9.3 0x0090300f
+ * 0.9.3a 0x0090301f
+ * 0.9.4 0x0090400f
+ * 1.2.3z 0x102031af
+ *
+ * For continuity reasons (because 0.9.5 is already out, and is coded
+ * 0x00905100), between 0.9.5 and 0.9.6 the coding of the patch level
+ * part is slightly different, by setting the highest bit. This means
+ * that 0.9.5a looks like this: 0x0090581f. At 0.9.6, we can start
+ * with 0x0090600S...
+ *
+ * (Prior to 0.9.3-dev a different scheme was used: 0.9.2b is 0x0922.)
+ * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
+ * major minor fix final patch/beta)
+ */
+# define OPENSSL_VERSION_NUMBER 0x1000204fL
+# ifdef OPENSSL_FIPS
+# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2d-fips 9 Jul 2015"
+# else
+# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2d 9 Jul 2015"
+# endif
+# define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT
+
+/*-
+ * The macros below are to be used for shared library (.so, .dll, ...)
+ * versioning. That kind of versioning works a bit differently between
+ * operating systems. The most usual scheme is to set a major and a minor
+ * number, and have the runtime loader check that the major number is equal
+ * to what it was at application link time, while the minor number has to
+ * be greater or equal to what it was at application link time. With this
+ * scheme, the version number is usually part of the file name, like this:
+ *
+ * libcrypto.so.0.9
+ *
+ * Some unixen also make a softlink with the major verson number only:
+ *
+ * libcrypto.so.0
+ *
+ * On Tru64 and IRIX 6.x it works a little bit differently. There, the
+ * shared library version is stored in the file, and is actually a series
+ * of versions, separated by colons. The rightmost version present in the
+ * library when linking an application is stored in the application to be
+ * matched at run time. When the application is run, a check is done to
+ * see if the library version stored in the application matches any of the
+ * versions in the version string of the library itself.
+ * This version string can be constructed in any way, depending on what
+ * kind of matching is desired. However, to implement the same scheme as
+ * the one used in the other unixen, all compatible versions, from lowest
+ * to highest, should be part of the string. Consecutive builds would
+ * give the following versions strings:
+ *
+ * 3.0
+ * 3.0:3.1
+ * 3.0:3.1:3.2
+ * 4.0
+ * 4.0:4.1
+ *
+ * Notice how version 4 is completely incompatible with version, and
+ * therefore give the breach you can see.
+ *
+ * There may be other schemes as well that I haven't yet discovered.
+ *
+ * So, here's the way it works here: first of all, the library version
+ * number doesn't need at all to match the overall OpenSSL version.
+ * However, it's nice and more understandable if it actually does.
+ * The current library version is stored in the macro SHLIB_VERSION_NUMBER,
+ * which is just a piece of text in the format "M.m.e" (Major, minor, edit).
+ * For the sake of Tru64, IRIX, and any other OS that behaves in similar ways,
+ * we need to keep a history of version numbers, which is done in the
+ * macro SHLIB_VERSION_HISTORY. The numbers are separated by colons and
+ * should only keep the versions that are binary compatible with the current.
+ */
+# define SHLIB_VERSION_HISTORY ""
+# define SHLIB_VERSION_NUMBER "1.0.0"
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* HEADER_OPENSSLV_H */
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/ossl_typ.h b/protocols/Telegram/tgl/openssl/include/openssl/ossl_typ.h
new file mode 100644
index 0000000000..9144ea2cf6
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/ossl_typ.h
@@ -0,0 +1,211 @@
+/* ====================================================================
+ * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_OPENSSL_TYPES_H
+# define HEADER_OPENSSL_TYPES_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# include <openssl/e_os2.h>
+
+# ifdef NO_ASN1_TYPEDEFS
+# define ASN1_INTEGER ASN1_STRING
+# define ASN1_ENUMERATED ASN1_STRING
+# define ASN1_BIT_STRING ASN1_STRING
+# define ASN1_OCTET_STRING ASN1_STRING
+# define ASN1_PRINTABLESTRING ASN1_STRING
+# define ASN1_T61STRING ASN1_STRING
+# define ASN1_IA5STRING ASN1_STRING
+# define ASN1_UTCTIME ASN1_STRING
+# define ASN1_GENERALIZEDTIME ASN1_STRING
+# define ASN1_TIME ASN1_STRING
+# define ASN1_GENERALSTRING ASN1_STRING
+# define ASN1_UNIVERSALSTRING ASN1_STRING
+# define ASN1_BMPSTRING ASN1_STRING
+# define ASN1_VISIBLESTRING ASN1_STRING
+# define ASN1_UTF8STRING ASN1_STRING
+# define ASN1_BOOLEAN int
+# define ASN1_NULL int
+# else
+typedef struct asn1_string_st ASN1_INTEGER;
+typedef struct asn1_string_st ASN1_ENUMERATED;
+typedef struct asn1_string_st ASN1_BIT_STRING;
+typedef struct asn1_string_st ASN1_OCTET_STRING;
+typedef struct asn1_string_st ASN1_PRINTABLESTRING;
+typedef struct asn1_string_st ASN1_T61STRING;
+typedef struct asn1_string_st ASN1_IA5STRING;
+typedef struct asn1_string_st ASN1_GENERALSTRING;
+typedef struct asn1_string_st ASN1_UNIVERSALSTRING;
+typedef struct asn1_string_st ASN1_BMPSTRING;
+typedef struct asn1_string_st ASN1_UTCTIME;
+typedef struct asn1_string_st ASN1_TIME;
+typedef struct asn1_string_st ASN1_GENERALIZEDTIME;
+typedef struct asn1_string_st ASN1_VISIBLESTRING;
+typedef struct asn1_string_st ASN1_UTF8STRING;
+typedef struct asn1_string_st ASN1_STRING;
+typedef int ASN1_BOOLEAN;
+typedef int ASN1_NULL;
+# endif
+
+typedef struct asn1_object_st ASN1_OBJECT;
+
+typedef struct ASN1_ITEM_st ASN1_ITEM;
+typedef struct asn1_pctx_st ASN1_PCTX;
+
+# ifdef OPENSSL_SYS_WIN32
+# undef X509_NAME
+# undef X509_EXTENSIONS
+# undef X509_CERT_PAIR
+# undef PKCS7_ISSUER_AND_SERIAL
+# undef OCSP_REQUEST
+# undef OCSP_RESPONSE
+# endif
+
+# ifdef BIGNUM
+# undef BIGNUM
+# endif
+typedef struct bignum_st BIGNUM;
+typedef struct bignum_ctx BN_CTX;
+typedef struct bn_blinding_st BN_BLINDING;
+typedef struct bn_mont_ctx_st BN_MONT_CTX;
+typedef struct bn_recp_ctx_st BN_RECP_CTX;
+typedef struct bn_gencb_st BN_GENCB;
+
+typedef struct buf_mem_st BUF_MEM;
+
+typedef struct evp_cipher_st EVP_CIPHER;
+typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX;
+typedef struct env_md_st EVP_MD;
+typedef struct env_md_ctx_st EVP_MD_CTX;
+typedef struct evp_pkey_st EVP_PKEY;
+
+typedef struct evp_pkey_asn1_method_st EVP_PKEY_ASN1_METHOD;
+
+typedef struct evp_pkey_method_st EVP_PKEY_METHOD;
+typedef struct evp_pkey_ctx_st EVP_PKEY_CTX;
+
+typedef struct dh_st DH;
+typedef struct dh_method DH_METHOD;
+
+typedef struct dsa_st DSA;
+typedef struct dsa_method DSA_METHOD;
+
+typedef struct rsa_st RSA;
+typedef struct rsa_meth_st RSA_METHOD;
+
+typedef struct rand_meth_st RAND_METHOD;
+
+typedef struct ecdh_method ECDH_METHOD;
+typedef struct ecdsa_method ECDSA_METHOD;
+
+typedef struct x509_st X509;
+typedef struct X509_algor_st X509_ALGOR;
+typedef struct X509_crl_st X509_CRL;
+typedef struct x509_crl_method_st X509_CRL_METHOD;
+typedef struct x509_revoked_st X509_REVOKED;
+typedef struct X509_name_st X509_NAME;
+typedef struct X509_pubkey_st X509_PUBKEY;
+typedef struct x509_store_st X509_STORE;
+typedef struct x509_store_ctx_st X509_STORE_CTX;
+
+typedef struct pkcs8_priv_key_info_st PKCS8_PRIV_KEY_INFO;
+
+typedef struct v3_ext_ctx X509V3_CTX;
+typedef struct conf_st CONF;
+
+typedef struct store_st STORE;
+typedef struct store_method_st STORE_METHOD;
+
+typedef struct ui_st UI;
+typedef struct ui_method_st UI_METHOD;
+
+typedef struct st_ERR_FNS ERR_FNS;
+
+typedef struct engine_st ENGINE;
+typedef struct ssl_st SSL;
+typedef struct ssl_ctx_st SSL_CTX;
+
+typedef struct X509_POLICY_NODE_st X509_POLICY_NODE;
+typedef struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL;
+typedef struct X509_POLICY_TREE_st X509_POLICY_TREE;
+typedef struct X509_POLICY_CACHE_st X509_POLICY_CACHE;
+
+typedef struct AUTHORITY_KEYID_st AUTHORITY_KEYID;
+typedef struct DIST_POINT_st DIST_POINT;
+typedef struct ISSUING_DIST_POINT_st ISSUING_DIST_POINT;
+typedef struct NAME_CONSTRAINTS_st NAME_CONSTRAINTS;
+
+ /* If placed in pkcs12.h, we end up with a circular depency with pkcs7.h */
+# define DECLARE_PKCS12_STACK_OF(type)/* Nothing */
+# define IMPLEMENT_PKCS12_STACK_OF(type)/* Nothing */
+
+typedef struct crypto_ex_data_st CRYPTO_EX_DATA;
+/* Callback types for crypto.h */
+typedef int CRYPTO_EX_new (void *parent, void *ptr, CRYPTO_EX_DATA *ad,
+ int idx, long argl, void *argp);
+typedef void CRYPTO_EX_free (void *parent, void *ptr, CRYPTO_EX_DATA *ad,
+ int idx, long argl, void *argp);
+typedef int CRYPTO_EX_dup (CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from,
+ void *from_d, int idx, long argl, void *argp);
+
+typedef struct ocsp_req_ctx_st OCSP_REQ_CTX;
+typedef struct ocsp_response_st OCSP_RESPONSE;
+typedef struct ocsp_responder_id_st OCSP_RESPID;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* def HEADER_OPENSSL_TYPES_H */
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/pem.h b/protocols/Telegram/tgl/openssl/include/openssl/pem.h
new file mode 100644
index 0000000000..d3b23fc997
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/pem.h
@@ -0,0 +1,615 @@
+/* crypto/pem/pem.h */
+/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_PEM_H
+# define HEADER_PEM_H
+
+# include <openssl/e_os2.h>
+# ifndef OPENSSL_NO_BIO
+# include <openssl/bio.h>
+# endif
+# ifndef OPENSSL_NO_STACK
+# include <openssl/stack.h>
+# endif
+# include <openssl/evp.h>
+# include <openssl/x509.h>
+# include <openssl/pem2.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# define PEM_BUFSIZE 1024
+
+# define PEM_OBJ_UNDEF 0
+# define PEM_OBJ_X509 1
+# define PEM_OBJ_X509_REQ 2
+# define PEM_OBJ_CRL 3
+# define PEM_OBJ_SSL_SESSION 4
+# define PEM_OBJ_PRIV_KEY 10
+# define PEM_OBJ_PRIV_RSA 11
+# define PEM_OBJ_PRIV_DSA 12
+# define PEM_OBJ_PRIV_DH 13
+# define PEM_OBJ_PUB_RSA 14
+# define PEM_OBJ_PUB_DSA 15
+# define PEM_OBJ_PUB_DH 16
+# define PEM_OBJ_DHPARAMS 17
+# define PEM_OBJ_DSAPARAMS 18
+# define PEM_OBJ_PRIV_RSA_PUBLIC 19
+# define PEM_OBJ_PRIV_ECDSA 20
+# define PEM_OBJ_PUB_ECDSA 21
+# define PEM_OBJ_ECPARAMETERS 22
+
+# define PEM_ERROR 30
+# define PEM_DEK_DES_CBC 40
+# define PEM_DEK_IDEA_CBC 45
+# define PEM_DEK_DES_EDE 50
+# define PEM_DEK_DES_ECB 60
+# define PEM_DEK_RSA 70
+# define PEM_DEK_RSA_MD2 80
+# define PEM_DEK_RSA_MD5 90
+
+# define PEM_MD_MD2 NID_md2
+# define PEM_MD_MD5 NID_md5
+# define PEM_MD_SHA NID_sha
+# define PEM_MD_MD2_RSA NID_md2WithRSAEncryption
+# define PEM_MD_MD5_RSA NID_md5WithRSAEncryption
+# define PEM_MD_SHA_RSA NID_sha1WithRSAEncryption
+
+# define PEM_STRING_X509_OLD "X509 CERTIFICATE"
+# define PEM_STRING_X509 "CERTIFICATE"
+# define PEM_STRING_X509_PAIR "CERTIFICATE PAIR"
+# define PEM_STRING_X509_TRUSTED "TRUSTED CERTIFICATE"
+# define PEM_STRING_X509_REQ_OLD "NEW CERTIFICATE REQUEST"
+# define PEM_STRING_X509_REQ "CERTIFICATE REQUEST"
+# define PEM_STRING_X509_CRL "X509 CRL"
+# define PEM_STRING_EVP_PKEY "ANY PRIVATE KEY"
+# define PEM_STRING_PUBLIC "PUBLIC KEY"
+# define PEM_STRING_RSA "RSA PRIVATE KEY"
+# define PEM_STRING_RSA_PUBLIC "RSA PUBLIC KEY"
+# define PEM_STRING_DSA "DSA PRIVATE KEY"
+# define PEM_STRING_DSA_PUBLIC "DSA PUBLIC KEY"
+# define PEM_STRING_PKCS7 "PKCS7"
+# define PEM_STRING_PKCS7_SIGNED "PKCS #7 SIGNED DATA"
+# define PEM_STRING_PKCS8 "ENCRYPTED PRIVATE KEY"
+# define PEM_STRING_PKCS8INF "PRIVATE KEY"
+# define PEM_STRING_DHPARAMS "DH PARAMETERS"
+# define PEM_STRING_DHXPARAMS "X9.42 DH PARAMETERS"
+# define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS"
+# define PEM_STRING_DSAPARAMS "DSA PARAMETERS"
+# define PEM_STRING_ECDSA_PUBLIC "ECDSA PUBLIC KEY"
+# define PEM_STRING_ECPARAMETERS "EC PARAMETERS"
+# define PEM_STRING_ECPRIVATEKEY "EC PRIVATE KEY"
+# define PEM_STRING_PARAMETERS "PARAMETERS"
+# define PEM_STRING_CMS "CMS"
+
+ /*
+ * Note that this structure is initialised by PEM_SealInit and cleaned up
+ * by PEM_SealFinal (at least for now)
+ */
+typedef struct PEM_Encode_Seal_st {
+ EVP_ENCODE_CTX encode;
+ EVP_MD_CTX md;
+ EVP_CIPHER_CTX cipher;
+} PEM_ENCODE_SEAL_CTX;
+
+/* enc_type is one off */
+# define PEM_TYPE_ENCRYPTED 10
+# define PEM_TYPE_MIC_ONLY 20
+# define PEM_TYPE_MIC_CLEAR 30
+# define PEM_TYPE_CLEAR 40
+
+typedef struct pem_recip_st {
+ char *name;
+ X509_NAME *dn;
+ int cipher;
+ int key_enc;
+ /* char iv[8]; unused and wrong size */
+} PEM_USER;
+
+typedef struct pem_ctx_st {
+ int type; /* what type of object */
+ struct {
+ int version;
+ int mode;
+ } proc_type;
+
+ char *domain;
+
+ struct {
+ int cipher;
+ /*-
+ unused, and wrong size
+ unsigned char iv[8]; */
+ } DEK_info;
+
+ PEM_USER *originator;
+
+ int num_recipient;
+ PEM_USER **recipient;
+/*-
+ XXX(ben): don#t think this is used!
+ STACK *x509_chain; / * certificate chain */
+ EVP_MD *md; /* signature type */
+
+ int md_enc; /* is the md encrypted or not? */
+ int md_len; /* length of md_data */
+ char *md_data; /* message digest, could be pkey encrypted */
+
+ EVP_CIPHER *dec; /* date encryption cipher */
+ int key_len; /* key length */
+ unsigned char *key; /* key */
+ /*-
+ unused, and wrong size
+ unsigned char iv[8]; */
+
+ int data_enc; /* is the data encrypted */
+ int data_len;
+ unsigned char *data;
+} PEM_CTX;
+
+/*
+ * These macros make the PEM_read/PEM_write functions easier to maintain and
+ * write. Now they are all implemented with either: IMPLEMENT_PEM_rw(...) or
+ * IMPLEMENT_PEM_rw_cb(...)
+ */
+
+# ifdef OPENSSL_NO_FP_API
+
+# define IMPLEMENT_PEM_read_fp(name, type, str, asn1) /**/
+# define IMPLEMENT_PEM_write_fp(name, type, str, asn1) /**/
+# define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) /**/
+# define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) /**/
+# define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) /**/
+# else
+
+# define IMPLEMENT_PEM_read_fp(name, type, str, asn1) \
+type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u)\
+{ \
+return PEM_ASN1_read((d2i_of_void *)d2i_##asn1, str,fp,(void **)x,cb,u); \
+}
+
+# define IMPLEMENT_PEM_write_fp(name, type, str, asn1) \
+int PEM_write_##name(FILE *fp, type *x) \
+{ \
+return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,NULL,NULL,0,NULL,NULL); \
+}
+
+# define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) \
+int PEM_write_##name(FILE *fp, const type *x) \
+{ \
+return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,(void *)x,NULL,NULL,0,NULL,NULL); \
+}
+
+# define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) \
+int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \
+ unsigned char *kstr, int klen, pem_password_cb *cb, \
+ void *u) \
+ { \
+ return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,enc,kstr,klen,cb,u); \
+ }
+
+# define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) \
+int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \
+ unsigned char *kstr, int klen, pem_password_cb *cb, \
+ void *u) \
+ { \
+ return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,enc,kstr,klen,cb,u); \
+ }
+
+# endif
+
+# define IMPLEMENT_PEM_read_bio(name, type, str, asn1) \
+type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u)\
+{ \
+return PEM_ASN1_read_bio((d2i_of_void *)d2i_##asn1, str,bp,(void **)x,cb,u); \
+}
+
+# define IMPLEMENT_PEM_write_bio(name, type, str, asn1) \
+int PEM_write_bio_##name(BIO *bp, type *x) \
+{ \
+return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,x,NULL,NULL,0,NULL,NULL); \
+}
+
+# define IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \
+int PEM_write_bio_##name(BIO *bp, const type *x) \
+{ \
+return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,(void *)x,NULL,NULL,0,NULL,NULL); \
+}
+
+# define IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \
+int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
+ unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \
+ { \
+ return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,x,enc,kstr,klen,cb,u); \
+ }
+
+# define IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \
+int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
+ unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \
+ { \
+ return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,(void *)x,enc,kstr,klen,cb,u); \
+ }
+
+# define IMPLEMENT_PEM_write(name, type, str, asn1) \
+ IMPLEMENT_PEM_write_bio(name, type, str, asn1) \
+ IMPLEMENT_PEM_write_fp(name, type, str, asn1)
+
+# define IMPLEMENT_PEM_write_const(name, type, str, asn1) \
+ IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \
+ IMPLEMENT_PEM_write_fp_const(name, type, str, asn1)
+
+# define IMPLEMENT_PEM_write_cb(name, type, str, asn1) \
+ IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \
+ IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1)
+
+# define IMPLEMENT_PEM_write_cb_const(name, type, str, asn1) \
+ IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \
+ IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1)
+
+# define IMPLEMENT_PEM_read(name, type, str, asn1) \
+ IMPLEMENT_PEM_read_bio(name, type, str, asn1) \
+ IMPLEMENT_PEM_read_fp(name, type, str, asn1)
+
+# define IMPLEMENT_PEM_rw(name, type, str, asn1) \
+ IMPLEMENT_PEM_read(name, type, str, asn1) \
+ IMPLEMENT_PEM_write(name, type, str, asn1)
+
+# define IMPLEMENT_PEM_rw_const(name, type, str, asn1) \
+ IMPLEMENT_PEM_read(name, type, str, asn1) \
+ IMPLEMENT_PEM_write_const(name, type, str, asn1)
+
+# define IMPLEMENT_PEM_rw_cb(name, type, str, asn1) \
+ IMPLEMENT_PEM_read(name, type, str, asn1) \
+ IMPLEMENT_PEM_write_cb(name, type, str, asn1)
+
+/* These are the same except they are for the declarations */
+
+# if defined(OPENSSL_NO_FP_API)
+
+# define DECLARE_PEM_read_fp(name, type) /**/
+# define DECLARE_PEM_write_fp(name, type) /**/
+# define DECLARE_PEM_write_cb_fp(name, type) /**/
+# else
+
+# define DECLARE_PEM_read_fp(name, type) \
+ type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u);
+
+# define DECLARE_PEM_write_fp(name, type) \
+ int PEM_write_##name(FILE *fp, type *x);
+
+# define DECLARE_PEM_write_fp_const(name, type) \
+ int PEM_write_##name(FILE *fp, const type *x);
+
+# define DECLARE_PEM_write_cb_fp(name, type) \
+ int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \
+ unsigned char *kstr, int klen, pem_password_cb *cb, void *u);
+
+# endif
+
+# ifndef OPENSSL_NO_BIO
+# define DECLARE_PEM_read_bio(name, type) \
+ type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u);
+
+# define DECLARE_PEM_write_bio(name, type) \
+ int PEM_write_bio_##name(BIO *bp, type *x);
+
+# define DECLARE_PEM_write_bio_const(name, type) \
+ int PEM_write_bio_##name(BIO *bp, const type *x);
+
+# define DECLARE_PEM_write_cb_bio(name, type) \
+ int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
+ unsigned char *kstr, int klen, pem_password_cb *cb, void *u);
+
+# else
+
+# define DECLARE_PEM_read_bio(name, type) /**/
+# define DECLARE_PEM_write_bio(name, type) /**/
+# define DECLARE_PEM_write_bio_const(name, type) /**/
+# define DECLARE_PEM_write_cb_bio(name, type) /**/
+# endif
+# define DECLARE_PEM_write(name, type) \
+ DECLARE_PEM_write_bio(name, type) \
+ DECLARE_PEM_write_fp(name, type)
+# define DECLARE_PEM_write_const(name, type) \
+ DECLARE_PEM_write_bio_const(name, type) \
+ DECLARE_PEM_write_fp_const(name, type)
+# define DECLARE_PEM_write_cb(name, type) \
+ DECLARE_PEM_write_cb_bio(name, type) \
+ DECLARE_PEM_write_cb_fp(name, type)
+# define DECLARE_PEM_read(name, type) \
+ DECLARE_PEM_read_bio(name, type) \
+ DECLARE_PEM_read_fp(name, type)
+# define DECLARE_PEM_rw(name, type) \
+ DECLARE_PEM_read(name, type) \
+ DECLARE_PEM_write(name, type)
+# define DECLARE_PEM_rw_const(name, type) \
+ DECLARE_PEM_read(name, type) \
+ DECLARE_PEM_write_const(name, type)
+# define DECLARE_PEM_rw_cb(name, type) \
+ DECLARE_PEM_read(name, type) \
+ DECLARE_PEM_write_cb(name, type)
+# if 1
+/* "userdata": new with OpenSSL 0.9.4 */
+typedef int pem_password_cb (char *buf, int size, int rwflag, void *userdata);
+# else
+/* OpenSSL 0.9.3, 0.9.3a */
+typedef int pem_password_cb (char *buf, int size, int rwflag);
+# endif
+
+int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher);
+int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *len,
+ pem_password_cb *callback, void *u);
+
+# ifndef OPENSSL_NO_BIO
+int PEM_read_bio(BIO *bp, char **name, char **header,
+ unsigned char **data, long *len);
+int PEM_write_bio(BIO *bp, const char *name, const char *hdr,
+ const unsigned char *data, long len);
+int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm,
+ const char *name, BIO *bp, pem_password_cb *cb,
+ void *u);
+void *PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, void **x,
+ pem_password_cb *cb, void *u);
+int PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp, void *x,
+ const EVP_CIPHER *enc, unsigned char *kstr, int klen,
+ pem_password_cb *cb, void *u);
+
+STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk,
+ pem_password_cb *cb, void *u);
+int PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc,
+ unsigned char *kstr, int klen,
+ pem_password_cb *cd, void *u);
+# endif
+
+int PEM_read(FILE *fp, char **name, char **header,
+ unsigned char **data, long *len);
+int PEM_write(FILE *fp, const char *name, const char *hdr,
+ const unsigned char *data, long len);
+void *PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x,
+ pem_password_cb *cb, void *u);
+int PEM_ASN1_write(i2d_of_void *i2d, const char *name, FILE *fp,
+ void *x, const EVP_CIPHER *enc, unsigned char *kstr,
+ int klen, pem_password_cb *callback, void *u);
+STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk,
+ pem_password_cb *cb, void *u);
+
+int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type,
+ EVP_MD *md_type, unsigned char **ek, int *ekl,
+ unsigned char *iv, EVP_PKEY **pubk, int npubk);
+void PEM_SealUpdate(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *out, int *outl,
+ unsigned char *in, int inl);
+int PEM_SealFinal(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *sig, int *sigl,
+ unsigned char *out, int *outl, EVP_PKEY *priv);
+
+void PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type);
+void PEM_SignUpdate(EVP_MD_CTX *ctx, unsigned char *d, unsigned int cnt);
+int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
+ unsigned int *siglen, EVP_PKEY *pkey);
+
+int PEM_def_callback(char *buf, int num, int w, void *key);
+void PEM_proc_type(char *buf, int type);
+void PEM_dek_info(char *buf, const char *type, int len, char *str);
+
+# include <openssl/symhacks.h>
+
+DECLARE_PEM_rw(X509, X509)
+DECLARE_PEM_rw(X509_AUX, X509)
+DECLARE_PEM_rw(X509_CERT_PAIR, X509_CERT_PAIR)
+DECLARE_PEM_rw(X509_REQ, X509_REQ)
+DECLARE_PEM_write(X509_REQ_NEW, X509_REQ)
+DECLARE_PEM_rw(X509_CRL, X509_CRL)
+DECLARE_PEM_rw(PKCS7, PKCS7)
+DECLARE_PEM_rw(NETSCAPE_CERT_SEQUENCE, NETSCAPE_CERT_SEQUENCE)
+DECLARE_PEM_rw(PKCS8, X509_SIG)
+DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO)
+# ifndef OPENSSL_NO_RSA
+DECLARE_PEM_rw_cb(RSAPrivateKey, RSA)
+DECLARE_PEM_rw_const(RSAPublicKey, RSA)
+DECLARE_PEM_rw(RSA_PUBKEY, RSA)
+# endif
+# ifndef OPENSSL_NO_DSA
+DECLARE_PEM_rw_cb(DSAPrivateKey, DSA)
+DECLARE_PEM_rw(DSA_PUBKEY, DSA)
+DECLARE_PEM_rw_const(DSAparams, DSA)
+# endif
+# ifndef OPENSSL_NO_EC
+DECLARE_PEM_rw_const(ECPKParameters, EC_GROUP)
+DECLARE_PEM_rw_cb(ECPrivateKey, EC_KEY)
+DECLARE_PEM_rw(EC_PUBKEY, EC_KEY)
+# endif
+# ifndef OPENSSL_NO_DH
+DECLARE_PEM_rw_const(DHparams, DH)
+DECLARE_PEM_write_const(DHxparams, DH)
+# endif
+DECLARE_PEM_rw_cb(PrivateKey, EVP_PKEY)
+DECLARE_PEM_rw(PUBKEY, EVP_PKEY)
+
+int PEM_write_bio_PKCS8PrivateKey_nid(BIO *bp, EVP_PKEY *x, int nid,
+ char *kstr, int klen,
+ pem_password_cb *cb, void *u);
+int PEM_write_bio_PKCS8PrivateKey(BIO *, EVP_PKEY *, const EVP_CIPHER *,
+ char *, int, pem_password_cb *, void *);
+int i2d_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc,
+ char *kstr, int klen,
+ pem_password_cb *cb, void *u);
+int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, EVP_PKEY *x, int nid,
+ char *kstr, int klen,
+ pem_password_cb *cb, void *u);
+EVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb,
+ void *u);
+
+int i2d_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc,
+ char *kstr, int klen,
+ pem_password_cb *cb, void *u);
+int i2d_PKCS8PrivateKey_nid_fp(FILE *fp, EVP_PKEY *x, int nid,
+ char *kstr, int klen,
+ pem_password_cb *cb, void *u);
+int PEM_write_PKCS8PrivateKey_nid(FILE *fp, EVP_PKEY *x, int nid,
+ char *kstr, int klen,
+ pem_password_cb *cb, void *u);
+
+EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb,
+ void *u);
+
+int PEM_write_PKCS8PrivateKey(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc,
+ char *kstr, int klen, pem_password_cb *cd,
+ void *u);
+
+EVP_PKEY *PEM_read_bio_Parameters(BIO *bp, EVP_PKEY **x);
+int PEM_write_bio_Parameters(BIO *bp, EVP_PKEY *x);
+
+EVP_PKEY *b2i_PrivateKey(const unsigned char **in, long length);
+EVP_PKEY *b2i_PublicKey(const unsigned char **in, long length);
+EVP_PKEY *b2i_PrivateKey_bio(BIO *in);
+EVP_PKEY *b2i_PublicKey_bio(BIO *in);
+int i2b_PrivateKey_bio(BIO *out, EVP_PKEY *pk);
+int i2b_PublicKey_bio(BIO *out, EVP_PKEY *pk);
+# ifndef OPENSSL_NO_RC4
+EVP_PKEY *b2i_PVK_bio(BIO *in, pem_password_cb *cb, void *u);
+int i2b_PVK_bio(BIO *out, EVP_PKEY *pk, int enclevel,
+ pem_password_cb *cb, void *u);
+# endif
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_PEM_strings(void);
+
+/* Error codes for the PEM functions. */
+
+/* Function codes. */
+# define PEM_F_B2I_DSS 127
+# define PEM_F_B2I_PVK_BIO 128
+# define PEM_F_B2I_RSA 129
+# define PEM_F_CHECK_BITLEN_DSA 130
+# define PEM_F_CHECK_BITLEN_RSA 131
+# define PEM_F_D2I_PKCS8PRIVATEKEY_BIO 120
+# define PEM_F_D2I_PKCS8PRIVATEKEY_FP 121
+# define PEM_F_DO_B2I 132
+# define PEM_F_DO_B2I_BIO 133
+# define PEM_F_DO_BLOB_HEADER 134
+# define PEM_F_DO_PK8PKEY 126
+# define PEM_F_DO_PK8PKEY_FP 125
+# define PEM_F_DO_PVK_BODY 135
+# define PEM_F_DO_PVK_HEADER 136
+# define PEM_F_I2B_PVK 137
+# define PEM_F_I2B_PVK_BIO 138
+# define PEM_F_LOAD_IV 101
+# define PEM_F_PEM_ASN1_READ 102
+# define PEM_F_PEM_ASN1_READ_BIO 103
+# define PEM_F_PEM_ASN1_WRITE 104
+# define PEM_F_PEM_ASN1_WRITE_BIO 105
+# define PEM_F_PEM_DEF_CALLBACK 100
+# define PEM_F_PEM_DO_HEADER 106
+# define PEM_F_PEM_F_PEM_WRITE_PKCS8PRIVATEKEY 118
+# define PEM_F_PEM_GET_EVP_CIPHER_INFO 107
+# define PEM_F_PEM_PK8PKEY 119
+# define PEM_F_PEM_READ 108
+# define PEM_F_PEM_READ_BIO 109
+# define PEM_F_PEM_READ_BIO_DHPARAMS 141
+# define PEM_F_PEM_READ_BIO_PARAMETERS 140
+# define PEM_F_PEM_READ_BIO_PRIVATEKEY 123
+# define PEM_F_PEM_READ_DHPARAMS 142
+# define PEM_F_PEM_READ_PRIVATEKEY 124
+# define PEM_F_PEM_SEALFINAL 110
+# define PEM_F_PEM_SEALINIT 111
+# define PEM_F_PEM_SIGNFINAL 112
+# define PEM_F_PEM_WRITE 113
+# define PEM_F_PEM_WRITE_BIO 114
+# define PEM_F_PEM_WRITE_PRIVATEKEY 139
+# define PEM_F_PEM_X509_INFO_READ 115
+# define PEM_F_PEM_X509_INFO_READ_BIO 116
+# define PEM_F_PEM_X509_INFO_WRITE_BIO 117
+
+/* Reason codes. */
+# define PEM_R_BAD_BASE64_DECODE 100
+# define PEM_R_BAD_DECRYPT 101
+# define PEM_R_BAD_END_LINE 102
+# define PEM_R_BAD_IV_CHARS 103
+# define PEM_R_BAD_MAGIC_NUMBER 116
+# define PEM_R_BAD_PASSWORD_READ 104
+# define PEM_R_BAD_VERSION_NUMBER 117
+# define PEM_R_BIO_WRITE_FAILURE 118
+# define PEM_R_CIPHER_IS_NULL 127
+# define PEM_R_ERROR_CONVERTING_PRIVATE_KEY 115
+# define PEM_R_EXPECTING_PRIVATE_KEY_BLOB 119
+# define PEM_R_EXPECTING_PUBLIC_KEY_BLOB 120
+# define PEM_R_INCONSISTENT_HEADER 121
+# define PEM_R_KEYBLOB_HEADER_PARSE_ERROR 122
+# define PEM_R_KEYBLOB_TOO_SHORT 123
+# define PEM_R_NOT_DEK_INFO 105
+# define PEM_R_NOT_ENCRYPTED 106
+# define PEM_R_NOT_PROC_TYPE 107
+# define PEM_R_NO_START_LINE 108
+# define PEM_R_PROBLEMS_GETTING_PASSWORD 109
+# define PEM_R_PUBLIC_KEY_NO_RSA 110
+# define PEM_R_PVK_DATA_TOO_SHORT 124
+# define PEM_R_PVK_TOO_SHORT 125
+# define PEM_R_READ_KEY 111
+# define PEM_R_SHORT_HEADER 112
+# define PEM_R_UNSUPPORTED_CIPHER 113
+# define PEM_R_UNSUPPORTED_ENCRYPTION 114
+# define PEM_R_UNSUPPORTED_KEY_COMPONENTS 126
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/pem2.h b/protocols/Telegram/tgl/openssl/include/openssl/pem2.h
new file mode 100644
index 0000000000..84897d5ec3
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/pem2.h
@@ -0,0 +1,70 @@
+/* ====================================================================
+ * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+/*
+ * This header only exists to break a circular dependency between pem and err
+ * Ben 30 Jan 1999.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef HEADER_PEM_H
+void ERR_load_PEM_strings(void);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/pkcs12.h b/protocols/Telegram/tgl/openssl/include/openssl/pkcs12.h
new file mode 100644
index 0000000000..a39adf5eb5
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/pkcs12.h
@@ -0,0 +1,342 @@
+/* pkcs12.h */
+/*
+ * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
+ * 1999.
+ */
+/* ====================================================================
+ * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_PKCS12_H
+# define HEADER_PKCS12_H
+
+# include <openssl/bio.h>
+# include <openssl/x509.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# define PKCS12_KEY_ID 1
+# define PKCS12_IV_ID 2
+# define PKCS12_MAC_ID 3
+
+/* Default iteration count */
+# ifndef PKCS12_DEFAULT_ITER
+# define PKCS12_DEFAULT_ITER PKCS5_DEFAULT_ITER
+# endif
+
+# define PKCS12_MAC_KEY_LENGTH 20
+
+# define PKCS12_SALT_LEN 8
+
+/* Uncomment out next line for unicode password and names, otherwise ASCII */
+
+/*
+ * #define PBE_UNICODE
+ */
+
+# ifdef PBE_UNICODE
+# define PKCS12_key_gen PKCS12_key_gen_uni
+# define PKCS12_add_friendlyname PKCS12_add_friendlyname_uni
+# else
+# define PKCS12_key_gen PKCS12_key_gen_asc
+# define PKCS12_add_friendlyname PKCS12_add_friendlyname_asc
+# endif
+
+/* MS key usage constants */
+
+# define KEY_EX 0x10
+# define KEY_SIG 0x80
+
+typedef struct {
+ X509_SIG *dinfo;
+ ASN1_OCTET_STRING *salt;
+ ASN1_INTEGER *iter; /* defaults to 1 */
+} PKCS12_MAC_DATA;
+
+typedef struct {
+ ASN1_INTEGER *version;
+ PKCS12_MAC_DATA *mac;
+ PKCS7 *authsafes;
+} PKCS12;
+
+typedef struct {
+ ASN1_OBJECT *type;
+ union {
+ struct pkcs12_bag_st *bag; /* secret, crl and certbag */
+ struct pkcs8_priv_key_info_st *keybag; /* keybag */
+ X509_SIG *shkeybag; /* shrouded key bag */
+ STACK_OF(PKCS12_SAFEBAG) *safes;
+ ASN1_TYPE *other;
+ } value;
+ STACK_OF(X509_ATTRIBUTE) *attrib;
+} PKCS12_SAFEBAG;
+
+DECLARE_STACK_OF(PKCS12_SAFEBAG)
+DECLARE_ASN1_SET_OF(PKCS12_SAFEBAG)
+DECLARE_PKCS12_STACK_OF(PKCS12_SAFEBAG)
+
+typedef struct pkcs12_bag_st {
+ ASN1_OBJECT *type;
+ union {
+ ASN1_OCTET_STRING *x509cert;
+ ASN1_OCTET_STRING *x509crl;
+ ASN1_OCTET_STRING *octet;
+ ASN1_IA5STRING *sdsicert;
+ ASN1_TYPE *other; /* Secret or other bag */
+ } value;
+} PKCS12_BAGS;
+
+# define PKCS12_ERROR 0
+# define PKCS12_OK 1
+
+/* Compatibility macros */
+
+# define M_PKCS12_x5092certbag PKCS12_x5092certbag
+# define M_PKCS12_x509crl2certbag PKCS12_x509crl2certbag
+
+# define M_PKCS12_certbag2x509 PKCS12_certbag2x509
+# define M_PKCS12_certbag2x509crl PKCS12_certbag2x509crl
+
+# define M_PKCS12_unpack_p7data PKCS12_unpack_p7data
+# define M_PKCS12_pack_authsafes PKCS12_pack_authsafes
+# define M_PKCS12_unpack_authsafes PKCS12_unpack_authsafes
+# define M_PKCS12_unpack_p7encdata PKCS12_unpack_p7encdata
+
+# define M_PKCS12_decrypt_skey PKCS12_decrypt_skey
+# define M_PKCS8_decrypt PKCS8_decrypt
+
+# define M_PKCS12_bag_type(bg) OBJ_obj2nid((bg)->type)
+# define M_PKCS12_cert_bag_type(bg) OBJ_obj2nid((bg)->value.bag->type)
+# define M_PKCS12_crl_bag_type M_PKCS12_cert_bag_type
+
+# define PKCS12_get_attr(bag, attr_nid) \
+ PKCS12_get_attr_gen(bag->attrib, attr_nid)
+
+# define PKCS8_get_attr(p8, attr_nid) \
+ PKCS12_get_attr_gen(p8->attributes, attr_nid)
+
+# define PKCS12_mac_present(p12) ((p12)->mac ? 1 : 0)
+
+PKCS12_SAFEBAG *PKCS12_x5092certbag(X509 *x509);
+PKCS12_SAFEBAG *PKCS12_x509crl2certbag(X509_CRL *crl);
+X509 *PKCS12_certbag2x509(PKCS12_SAFEBAG *bag);
+X509_CRL *PKCS12_certbag2x509crl(PKCS12_SAFEBAG *bag);
+
+PKCS12_SAFEBAG *PKCS12_item_pack_safebag(void *obj, const ASN1_ITEM *it,
+ int nid1, int nid2);
+PKCS12_SAFEBAG *PKCS12_MAKE_KEYBAG(PKCS8_PRIV_KEY_INFO *p8);
+PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(X509_SIG *p8, const char *pass,
+ int passlen);
+PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey(PKCS12_SAFEBAG *bag,
+ const char *pass, int passlen);
+X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher,
+ const char *pass, int passlen, unsigned char *salt,
+ int saltlen, int iter, PKCS8_PRIV_KEY_INFO *p8);
+PKCS12_SAFEBAG *PKCS12_MAKE_SHKEYBAG(int pbe_nid, const char *pass,
+ int passlen, unsigned char *salt,
+ int saltlen, int iter,
+ PKCS8_PRIV_KEY_INFO *p8);
+PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk);
+STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7data(PKCS7 *p7);
+PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen,
+ unsigned char *salt, int saltlen, int iter,
+ STACK_OF(PKCS12_SAFEBAG) *bags);
+STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass,
+ int passlen);
+
+int PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes);
+STACK_OF(PKCS7) *PKCS12_unpack_authsafes(PKCS12 *p12);
+
+int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name,
+ int namelen);
+int PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name,
+ int namelen);
+int PKCS12_add_CSPName_asc(PKCS12_SAFEBAG *bag, const char *name,
+ int namelen);
+int PKCS12_add_friendlyname_uni(PKCS12_SAFEBAG *bag,
+ const unsigned char *name, int namelen);
+int PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage);
+ASN1_TYPE *PKCS12_get_attr_gen(STACK_OF(X509_ATTRIBUTE) *attrs, int attr_nid);
+char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag);
+unsigned char *PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass,
+ int passlen, unsigned char *in, int inlen,
+ unsigned char **data, int *datalen,
+ int en_de);
+void *PKCS12_item_decrypt_d2i(X509_ALGOR *algor, const ASN1_ITEM *it,
+ const char *pass, int passlen,
+ ASN1_OCTET_STRING *oct, int zbuf);
+ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor,
+ const ASN1_ITEM *it,
+ const char *pass, int passlen,
+ void *obj, int zbuf);
+PKCS12 *PKCS12_init(int mode);
+int PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt,
+ int saltlen, int id, int iter, int n,
+ unsigned char *out, const EVP_MD *md_type);
+int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt,
+ int saltlen, int id, int iter, int n,
+ unsigned char *out, const EVP_MD *md_type);
+int PKCS12_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
+ ASN1_TYPE *param, const EVP_CIPHER *cipher,
+ const EVP_MD *md_type, int en_de);
+int PKCS12_gen_mac(PKCS12 *p12, const char *pass, int passlen,
+ unsigned char *mac, unsigned int *maclen);
+int PKCS12_verify_mac(PKCS12 *p12, const char *pass, int passlen);
+int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen,
+ unsigned char *salt, int saltlen, int iter,
+ const EVP_MD *md_type);
+int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt,
+ int saltlen, const EVP_MD *md_type);
+unsigned char *OPENSSL_asc2uni(const char *asc, int asclen,
+ unsigned char **uni, int *unilen);
+char *OPENSSL_uni2asc(unsigned char *uni, int unilen);
+
+DECLARE_ASN1_FUNCTIONS(PKCS12)
+DECLARE_ASN1_FUNCTIONS(PKCS12_MAC_DATA)
+DECLARE_ASN1_FUNCTIONS(PKCS12_SAFEBAG)
+DECLARE_ASN1_FUNCTIONS(PKCS12_BAGS)
+
+DECLARE_ASN1_ITEM(PKCS12_SAFEBAGS)
+DECLARE_ASN1_ITEM(PKCS12_AUTHSAFES)
+
+void PKCS12_PBE_add(void);
+int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,
+ STACK_OF(X509) **ca);
+PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
+ STACK_OF(X509) *ca, int nid_key, int nid_cert, int iter,
+ int mac_iter, int keytype);
+
+PKCS12_SAFEBAG *PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags, X509 *cert);
+PKCS12_SAFEBAG *PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags,
+ EVP_PKEY *key, int key_usage, int iter,
+ int key_nid, char *pass);
+int PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags,
+ int safe_nid, int iter, char *pass);
+PKCS12 *PKCS12_add_safes(STACK_OF(PKCS7) *safes, int p7_nid);
+
+int i2d_PKCS12_bio(BIO *bp, PKCS12 *p12);
+int i2d_PKCS12_fp(FILE *fp, PKCS12 *p12);
+PKCS12 *d2i_PKCS12_bio(BIO *bp, PKCS12 **p12);
+PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12);
+int PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_PKCS12_strings(void);
+
+/* Error codes for the PKCS12 functions. */
+
+/* Function codes. */
+# define PKCS12_F_PARSE_BAG 129
+# define PKCS12_F_PARSE_BAGS 103
+# define PKCS12_F_PKCS12_ADD_FRIENDLYNAME 100
+# define PKCS12_F_PKCS12_ADD_FRIENDLYNAME_ASC 127
+# define PKCS12_F_PKCS12_ADD_FRIENDLYNAME_UNI 102
+# define PKCS12_F_PKCS12_ADD_LOCALKEYID 104
+# define PKCS12_F_PKCS12_CREATE 105
+# define PKCS12_F_PKCS12_GEN_MAC 107
+# define PKCS12_F_PKCS12_INIT 109
+# define PKCS12_F_PKCS12_ITEM_DECRYPT_D2I 106
+# define PKCS12_F_PKCS12_ITEM_I2D_ENCRYPT 108
+# define PKCS12_F_PKCS12_ITEM_PACK_SAFEBAG 117
+# define PKCS12_F_PKCS12_KEY_GEN_ASC 110
+# define PKCS12_F_PKCS12_KEY_GEN_UNI 111
+# define PKCS12_F_PKCS12_MAKE_KEYBAG 112
+# define PKCS12_F_PKCS12_MAKE_SHKEYBAG 113
+# define PKCS12_F_PKCS12_NEWPASS 128
+# define PKCS12_F_PKCS12_PACK_P7DATA 114
+# define PKCS12_F_PKCS12_PACK_P7ENCDATA 115
+# define PKCS12_F_PKCS12_PARSE 118
+# define PKCS12_F_PKCS12_PBE_CRYPT 119
+# define PKCS12_F_PKCS12_PBE_KEYIVGEN 120
+# define PKCS12_F_PKCS12_SETUP_MAC 122
+# define PKCS12_F_PKCS12_SET_MAC 123
+# define PKCS12_F_PKCS12_UNPACK_AUTHSAFES 130
+# define PKCS12_F_PKCS12_UNPACK_P7DATA 131
+# define PKCS12_F_PKCS12_VERIFY_MAC 126
+# define PKCS12_F_PKCS8_ADD_KEYUSAGE 124
+# define PKCS12_F_PKCS8_ENCRYPT 125
+
+/* Reason codes. */
+# define PKCS12_R_CANT_PACK_STRUCTURE 100
+# define PKCS12_R_CONTENT_TYPE_NOT_DATA 121
+# define PKCS12_R_DECODE_ERROR 101
+# define PKCS12_R_ENCODE_ERROR 102
+# define PKCS12_R_ENCRYPT_ERROR 103
+# define PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE 120
+# define PKCS12_R_INVALID_NULL_ARGUMENT 104
+# define PKCS12_R_INVALID_NULL_PKCS12_POINTER 105
+# define PKCS12_R_IV_GEN_ERROR 106
+# define PKCS12_R_KEY_GEN_ERROR 107
+# define PKCS12_R_MAC_ABSENT 108
+# define PKCS12_R_MAC_GENERATION_ERROR 109
+# define PKCS12_R_MAC_SETUP_ERROR 110
+# define PKCS12_R_MAC_STRING_SET_ERROR 111
+# define PKCS12_R_MAC_VERIFY_ERROR 112
+# define PKCS12_R_MAC_VERIFY_FAILURE 113
+# define PKCS12_R_PARSE_ERROR 114
+# define PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR 115
+# define PKCS12_R_PKCS12_CIPHERFINAL_ERROR 116
+# define PKCS12_R_PKCS12_PBE_CRYPT_ERROR 117
+# define PKCS12_R_UNKNOWN_DIGEST_ALGORITHM 118
+# define PKCS12_R_UNSUPPORTED_PKCS12_MODE 119
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/pkcs7.h b/protocols/Telegram/tgl/openssl/include/openssl/pkcs7.h
new file mode 100644
index 0000000000..b51b3863eb
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/pkcs7.h
@@ -0,0 +1,481 @@
+/* crypto/pkcs7/pkcs7.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_PKCS7_H
+# define HEADER_PKCS7_H
+
+# include <openssl/asn1.h>
+# include <openssl/bio.h>
+# include <openssl/e_os2.h>
+
+# include <openssl/symhacks.h>
+# include <openssl/ossl_typ.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# ifdef OPENSSL_SYS_WIN32
+/* Under Win32 thes are defined in wincrypt.h */
+# undef PKCS7_ISSUER_AND_SERIAL
+# undef PKCS7_SIGNER_INFO
+# endif
+
+/*-
+Encryption_ID DES-CBC
+Digest_ID MD5
+Digest_Encryption_ID rsaEncryption
+Key_Encryption_ID rsaEncryption
+*/
+
+typedef struct pkcs7_issuer_and_serial_st {
+ X509_NAME *issuer;
+ ASN1_INTEGER *serial;
+} PKCS7_ISSUER_AND_SERIAL;
+
+typedef struct pkcs7_signer_info_st {
+ ASN1_INTEGER *version; /* version 1 */
+ PKCS7_ISSUER_AND_SERIAL *issuer_and_serial;
+ X509_ALGOR *digest_alg;
+ STACK_OF(X509_ATTRIBUTE) *auth_attr; /* [ 0 ] */
+ X509_ALGOR *digest_enc_alg;
+ ASN1_OCTET_STRING *enc_digest;
+ STACK_OF(X509_ATTRIBUTE) *unauth_attr; /* [ 1 ] */
+ /* The private key to sign with */
+ EVP_PKEY *pkey;
+} PKCS7_SIGNER_INFO;
+
+DECLARE_STACK_OF(PKCS7_SIGNER_INFO)
+DECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO)
+
+typedef struct pkcs7_recip_info_st {
+ ASN1_INTEGER *version; /* version 0 */
+ PKCS7_ISSUER_AND_SERIAL *issuer_and_serial;
+ X509_ALGOR *key_enc_algor;
+ ASN1_OCTET_STRING *enc_key;
+ X509 *cert; /* get the pub-key from this */
+} PKCS7_RECIP_INFO;
+
+DECLARE_STACK_OF(PKCS7_RECIP_INFO)
+DECLARE_ASN1_SET_OF(PKCS7_RECIP_INFO)
+
+typedef struct pkcs7_signed_st {
+ ASN1_INTEGER *version; /* version 1 */
+ STACK_OF(X509_ALGOR) *md_algs; /* md used */
+ STACK_OF(X509) *cert; /* [ 0 ] */
+ STACK_OF(X509_CRL) *crl; /* [ 1 ] */
+ STACK_OF(PKCS7_SIGNER_INFO) *signer_info;
+ struct pkcs7_st *contents;
+} PKCS7_SIGNED;
+/*
+ * The above structure is very very similar to PKCS7_SIGN_ENVELOPE. How about
+ * merging the two
+ */
+
+typedef struct pkcs7_enc_content_st {
+ ASN1_OBJECT *content_type;
+ X509_ALGOR *algorithm;
+ ASN1_OCTET_STRING *enc_data; /* [ 0 ] */
+ const EVP_CIPHER *cipher;
+} PKCS7_ENC_CONTENT;
+
+typedef struct pkcs7_enveloped_st {
+ ASN1_INTEGER *version; /* version 0 */
+ STACK_OF(PKCS7_RECIP_INFO) *recipientinfo;
+ PKCS7_ENC_CONTENT *enc_data;
+} PKCS7_ENVELOPE;
+
+typedef struct pkcs7_signedandenveloped_st {
+ ASN1_INTEGER *version; /* version 1 */
+ STACK_OF(X509_ALGOR) *md_algs; /* md used */
+ STACK_OF(X509) *cert; /* [ 0 ] */
+ STACK_OF(X509_CRL) *crl; /* [ 1 ] */
+ STACK_OF(PKCS7_SIGNER_INFO) *signer_info;
+ PKCS7_ENC_CONTENT *enc_data;
+ STACK_OF(PKCS7_RECIP_INFO) *recipientinfo;
+} PKCS7_SIGN_ENVELOPE;
+
+typedef struct pkcs7_digest_st {
+ ASN1_INTEGER *version; /* version 0 */
+ X509_ALGOR *md; /* md used */
+ struct pkcs7_st *contents;
+ ASN1_OCTET_STRING *digest;
+} PKCS7_DIGEST;
+
+typedef struct pkcs7_encrypted_st {
+ ASN1_INTEGER *version; /* version 0 */
+ PKCS7_ENC_CONTENT *enc_data;
+} PKCS7_ENCRYPT;
+
+typedef struct pkcs7_st {
+ /*
+ * The following is non NULL if it contains ASN1 encoding of this
+ * structure
+ */
+ unsigned char *asn1;
+ long length;
+# define PKCS7_S_HEADER 0
+# define PKCS7_S_BODY 1
+# define PKCS7_S_TAIL 2
+ int state; /* used during processing */
+ int detached;
+ ASN1_OBJECT *type;
+ /* content as defined by the type */
+ /*
+ * all encryption/message digests are applied to the 'contents', leaving
+ * out the 'type' field.
+ */
+ union {
+ char *ptr;
+ /* NID_pkcs7_data */
+ ASN1_OCTET_STRING *data;
+ /* NID_pkcs7_signed */
+ PKCS7_SIGNED *sign;
+ /* NID_pkcs7_enveloped */
+ PKCS7_ENVELOPE *enveloped;
+ /* NID_pkcs7_signedAndEnveloped */
+ PKCS7_SIGN_ENVELOPE *signed_and_enveloped;
+ /* NID_pkcs7_digest */
+ PKCS7_DIGEST *digest;
+ /* NID_pkcs7_encrypted */
+ PKCS7_ENCRYPT *encrypted;
+ /* Anything else */
+ ASN1_TYPE *other;
+ } d;
+} PKCS7;
+
+DECLARE_STACK_OF(PKCS7)
+DECLARE_ASN1_SET_OF(PKCS7)
+DECLARE_PKCS12_STACK_OF(PKCS7)
+
+# define PKCS7_OP_SET_DETACHED_SIGNATURE 1
+# define PKCS7_OP_GET_DETACHED_SIGNATURE 2
+
+# define PKCS7_get_signed_attributes(si) ((si)->auth_attr)
+# define PKCS7_get_attributes(si) ((si)->unauth_attr)
+
+# define PKCS7_type_is_signed(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_signed)
+# define PKCS7_type_is_encrypted(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_encrypted)
+# define PKCS7_type_is_enveloped(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_enveloped)
+# define PKCS7_type_is_signedAndEnveloped(a) \
+ (OBJ_obj2nid((a)->type) == NID_pkcs7_signedAndEnveloped)
+# define PKCS7_type_is_data(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_data)
+# define PKCS7_type_is_digest(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_digest)
+
+# define PKCS7_set_detached(p,v) \
+ PKCS7_ctrl(p,PKCS7_OP_SET_DETACHED_SIGNATURE,v,NULL)
+# define PKCS7_get_detached(p) \
+ PKCS7_ctrl(p,PKCS7_OP_GET_DETACHED_SIGNATURE,0,NULL)
+
+# define PKCS7_is_detached(p7) (PKCS7_type_is_signed(p7) && PKCS7_get_detached(p7))
+
+/* S/MIME related flags */
+
+# define PKCS7_TEXT 0x1
+# define PKCS7_NOCERTS 0x2
+# define PKCS7_NOSIGS 0x4
+# define PKCS7_NOCHAIN 0x8
+# define PKCS7_NOINTERN 0x10
+# define PKCS7_NOVERIFY 0x20
+# define PKCS7_DETACHED 0x40
+# define PKCS7_BINARY 0x80
+# define PKCS7_NOATTR 0x100
+# define PKCS7_NOSMIMECAP 0x200
+# define PKCS7_NOOLDMIMETYPE 0x400
+# define PKCS7_CRLFEOL 0x800
+# define PKCS7_STREAM 0x1000
+# define PKCS7_NOCRL 0x2000
+# define PKCS7_PARTIAL 0x4000
+# define PKCS7_REUSE_DIGEST 0x8000
+
+/* Flags: for compatibility with older code */
+
+# define SMIME_TEXT PKCS7_TEXT
+# define SMIME_NOCERTS PKCS7_NOCERTS
+# define SMIME_NOSIGS PKCS7_NOSIGS
+# define SMIME_NOCHAIN PKCS7_NOCHAIN
+# define SMIME_NOINTERN PKCS7_NOINTERN
+# define SMIME_NOVERIFY PKCS7_NOVERIFY
+# define SMIME_DETACHED PKCS7_DETACHED
+# define SMIME_BINARY PKCS7_BINARY
+# define SMIME_NOATTR PKCS7_NOATTR
+
+DECLARE_ASN1_FUNCTIONS(PKCS7_ISSUER_AND_SERIAL)
+
+int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data,
+ const EVP_MD *type, unsigned char *md,
+ unsigned int *len);
+# ifndef OPENSSL_NO_FP_API
+PKCS7 *d2i_PKCS7_fp(FILE *fp, PKCS7 **p7);
+int i2d_PKCS7_fp(FILE *fp, PKCS7 *p7);
+# endif
+PKCS7 *PKCS7_dup(PKCS7 *p7);
+PKCS7 *d2i_PKCS7_bio(BIO *bp, PKCS7 **p7);
+int i2d_PKCS7_bio(BIO *bp, PKCS7 *p7);
+int i2d_PKCS7_bio_stream(BIO *out, PKCS7 *p7, BIO *in, int flags);
+int PEM_write_bio_PKCS7_stream(BIO *out, PKCS7 *p7, BIO *in, int flags);
+
+DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNER_INFO)
+DECLARE_ASN1_FUNCTIONS(PKCS7_RECIP_INFO)
+DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNED)
+DECLARE_ASN1_FUNCTIONS(PKCS7_ENC_CONTENT)
+DECLARE_ASN1_FUNCTIONS(PKCS7_ENVELOPE)
+DECLARE_ASN1_FUNCTIONS(PKCS7_SIGN_ENVELOPE)
+DECLARE_ASN1_FUNCTIONS(PKCS7_DIGEST)
+DECLARE_ASN1_FUNCTIONS(PKCS7_ENCRYPT)
+DECLARE_ASN1_FUNCTIONS(PKCS7)
+
+DECLARE_ASN1_ITEM(PKCS7_ATTR_SIGN)
+DECLARE_ASN1_ITEM(PKCS7_ATTR_VERIFY)
+
+DECLARE_ASN1_NDEF_FUNCTION(PKCS7)
+DECLARE_ASN1_PRINT_FUNCTION(PKCS7)
+
+long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg);
+
+int PKCS7_set_type(PKCS7 *p7, int type);
+int PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *other);
+int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data);
+int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey,
+ const EVP_MD *dgst);
+int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si);
+int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *p7i);
+int PKCS7_add_certificate(PKCS7 *p7, X509 *x509);
+int PKCS7_add_crl(PKCS7 *p7, X509_CRL *x509);
+int PKCS7_content_new(PKCS7 *p7, int nid);
+int PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx,
+ BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si);
+int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si,
+ X509 *x509);
+
+BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio);
+int PKCS7_dataFinal(PKCS7 *p7, BIO *bio);
+BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert);
+
+PKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509,
+ EVP_PKEY *pkey, const EVP_MD *dgst);
+X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si);
+int PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md);
+STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7);
+
+PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509);
+void PKCS7_SIGNER_INFO_get0_algs(PKCS7_SIGNER_INFO *si, EVP_PKEY **pk,
+ X509_ALGOR **pdig, X509_ALGOR **psig);
+void PKCS7_RECIP_INFO_get0_alg(PKCS7_RECIP_INFO *ri, X509_ALGOR **penc);
+int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri);
+int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509);
+int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher);
+int PKCS7_stream(unsigned char ***boundary, PKCS7 *p7);
+
+PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx);
+ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk);
+int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int type,
+ void *data);
+int PKCS7_add_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int atrtype,
+ void *value);
+ASN1_TYPE *PKCS7_get_attribute(PKCS7_SIGNER_INFO *si, int nid);
+ASN1_TYPE *PKCS7_get_signed_attribute(PKCS7_SIGNER_INFO *si, int nid);
+int PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si,
+ STACK_OF(X509_ATTRIBUTE) *sk);
+int PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si,
+ STACK_OF(X509_ATTRIBUTE) *sk);
+
+PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
+ BIO *data, int flags);
+
+PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7,
+ X509 *signcert, EVP_PKEY *pkey,
+ const EVP_MD *md, int flags);
+
+int PKCS7_final(PKCS7 *p7, BIO *data, int flags);
+int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
+ BIO *indata, BIO *out, int flags);
+STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs,
+ int flags);
+PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher,
+ int flags);
+int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data,
+ int flags);
+
+int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si,
+ STACK_OF(X509_ALGOR) *cap);
+STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si);
+int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg);
+
+int PKCS7_add_attrib_content_type(PKCS7_SIGNER_INFO *si, ASN1_OBJECT *coid);
+int PKCS7_add0_attrib_signing_time(PKCS7_SIGNER_INFO *si, ASN1_TIME *t);
+int PKCS7_add1_attrib_digest(PKCS7_SIGNER_INFO *si,
+ const unsigned char *md, int mdlen);
+
+int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags);
+PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont);
+
+BIO *BIO_new_PKCS7(BIO *out, PKCS7 *p7);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_PKCS7_strings(void);
+
+/* Error codes for the PKCS7 functions. */
+
+/* Function codes. */
+# define PKCS7_F_B64_READ_PKCS7 120
+# define PKCS7_F_B64_WRITE_PKCS7 121
+# define PKCS7_F_DO_PKCS7_SIGNED_ATTRIB 136
+# define PKCS7_F_I2D_PKCS7_BIO_STREAM 140
+# define PKCS7_F_PKCS7_ADD0_ATTRIB_SIGNING_TIME 135
+# define PKCS7_F_PKCS7_ADD_ATTRIB_SMIMECAP 118
+# define PKCS7_F_PKCS7_ADD_CERTIFICATE 100
+# define PKCS7_F_PKCS7_ADD_CRL 101
+# define PKCS7_F_PKCS7_ADD_RECIPIENT_INFO 102
+# define PKCS7_F_PKCS7_ADD_SIGNATURE 131
+# define PKCS7_F_PKCS7_ADD_SIGNER 103
+# define PKCS7_F_PKCS7_BIO_ADD_DIGEST 125
+# define PKCS7_F_PKCS7_COPY_EXISTING_DIGEST 138
+# define PKCS7_F_PKCS7_CTRL 104
+# define PKCS7_F_PKCS7_DATADECODE 112
+# define PKCS7_F_PKCS7_DATAFINAL 128
+# define PKCS7_F_PKCS7_DATAINIT 105
+# define PKCS7_F_PKCS7_DATASIGN 106
+# define PKCS7_F_PKCS7_DATAVERIFY 107
+# define PKCS7_F_PKCS7_DECRYPT 114
+# define PKCS7_F_PKCS7_DECRYPT_RINFO 133
+# define PKCS7_F_PKCS7_ENCODE_RINFO 132
+# define PKCS7_F_PKCS7_ENCRYPT 115
+# define PKCS7_F_PKCS7_FINAL 134
+# define PKCS7_F_PKCS7_FIND_DIGEST 127
+# define PKCS7_F_PKCS7_GET0_SIGNERS 124
+# define PKCS7_F_PKCS7_RECIP_INFO_SET 130
+# define PKCS7_F_PKCS7_SET_CIPHER 108
+# define PKCS7_F_PKCS7_SET_CONTENT 109
+# define PKCS7_F_PKCS7_SET_DIGEST 126
+# define PKCS7_F_PKCS7_SET_TYPE 110
+# define PKCS7_F_PKCS7_SIGN 116
+# define PKCS7_F_PKCS7_SIGNATUREVERIFY 113
+# define PKCS7_F_PKCS7_SIGNER_INFO_SET 129
+# define PKCS7_F_PKCS7_SIGNER_INFO_SIGN 139
+# define PKCS7_F_PKCS7_SIGN_ADD_SIGNER 137
+# define PKCS7_F_PKCS7_SIMPLE_SMIMECAP 119
+# define PKCS7_F_PKCS7_VERIFY 117
+# define PKCS7_F_SMIME_READ_PKCS7 122
+# define PKCS7_F_SMIME_TEXT 123
+
+/* Reason codes. */
+# define PKCS7_R_CERTIFICATE_VERIFY_ERROR 117
+# define PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 144
+# define PKCS7_R_CIPHER_NOT_INITIALIZED 116
+# define PKCS7_R_CONTENT_AND_DATA_PRESENT 118
+# define PKCS7_R_CTRL_ERROR 152
+# define PKCS7_R_DECODE_ERROR 130
+# define PKCS7_R_DECRYPTED_KEY_IS_WRONG_LENGTH 100
+# define PKCS7_R_DECRYPT_ERROR 119
+# define PKCS7_R_DIGEST_FAILURE 101
+# define PKCS7_R_ENCRYPTION_CTRL_FAILURE 149
+# define PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 150
+# define PKCS7_R_ERROR_ADDING_RECIPIENT 120
+# define PKCS7_R_ERROR_SETTING_CIPHER 121
+# define PKCS7_R_INVALID_MIME_TYPE 131
+# define PKCS7_R_INVALID_NULL_POINTER 143
+# define PKCS7_R_INVALID_SIGNED_DATA_TYPE 155
+# define PKCS7_R_MIME_NO_CONTENT_TYPE 132
+# define PKCS7_R_MIME_PARSE_ERROR 133
+# define PKCS7_R_MIME_SIG_PARSE_ERROR 134
+# define PKCS7_R_MISSING_CERIPEND_INFO 103
+# define PKCS7_R_NO_CONTENT 122
+# define PKCS7_R_NO_CONTENT_TYPE 135
+# define PKCS7_R_NO_DEFAULT_DIGEST 151
+# define PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND 154
+# define PKCS7_R_NO_MULTIPART_BODY_FAILURE 136
+# define PKCS7_R_NO_MULTIPART_BOUNDARY 137
+# define PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE 115
+# define PKCS7_R_NO_RECIPIENT_MATCHES_KEY 146
+# define PKCS7_R_NO_SIGNATURES_ON_DATA 123
+# define PKCS7_R_NO_SIGNERS 142
+# define PKCS7_R_NO_SIG_CONTENT_TYPE 138
+# define PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE 104
+# define PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR 124
+# define PKCS7_R_PKCS7_ADD_SIGNER_ERROR 153
+# define PKCS7_R_PKCS7_DATAFINAL 126
+# define PKCS7_R_PKCS7_DATAFINAL_ERROR 125
+# define PKCS7_R_PKCS7_DATASIGN 145
+# define PKCS7_R_PKCS7_PARSE_ERROR 139
+# define PKCS7_R_PKCS7_SIG_PARSE_ERROR 140
+# define PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 127
+# define PKCS7_R_SIGNATURE_FAILURE 105
+# define PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND 128
+# define PKCS7_R_SIGNING_CTRL_FAILURE 147
+# define PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 148
+# define PKCS7_R_SIG_INVALID_MIME_TYPE 141
+# define PKCS7_R_SMIME_TEXT_ERROR 129
+# define PKCS7_R_UNABLE_TO_FIND_CERTIFICATE 106
+# define PKCS7_R_UNABLE_TO_FIND_MEM_BIO 107
+# define PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST 108
+# define PKCS7_R_UNKNOWN_DIGEST_TYPE 109
+# define PKCS7_R_UNKNOWN_OPERATION 110
+# define PKCS7_R_UNSUPPORTED_CIPHER_TYPE 111
+# define PKCS7_R_UNSUPPORTED_CONTENT_TYPE 112
+# define PKCS7_R_WRONG_CONTENT_TYPE 113
+# define PKCS7_R_WRONG_PKCS7_TYPE 114
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/pqueue.h b/protocols/Telegram/tgl/openssl/include/openssl/pqueue.h
new file mode 100644
index 0000000000..d40d9c7d85
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/pqueue.h
@@ -0,0 +1,99 @@
+/* crypto/pqueue/pqueue.h */
+/*
+ * DTLS implementation written by Nagendra Modadugu
+ * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
+ */
+/* ====================================================================
+ * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_PQUEUE_H
+# define HEADER_PQUEUE_H
+
+# include <stdio.h>
+# include <stdlib.h>
+# include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef struct _pqueue *pqueue;
+
+typedef struct _pitem {
+ unsigned char priority[8]; /* 64-bit value in big-endian encoding */
+ void *data;
+ struct _pitem *next;
+} pitem;
+
+typedef struct _pitem *piterator;
+
+pitem *pitem_new(unsigned char *prio64be, void *data);
+void pitem_free(pitem *item);
+
+pqueue pqueue_new(void);
+void pqueue_free(pqueue pq);
+
+pitem *pqueue_insert(pqueue pq, pitem *item);
+pitem *pqueue_peek(pqueue pq);
+pitem *pqueue_pop(pqueue pq);
+pitem *pqueue_find(pqueue pq, unsigned char *prio64be);
+pitem *pqueue_iterator(pqueue pq);
+pitem *pqueue_next(piterator *iter);
+
+void pqueue_print(pqueue pq);
+int pqueue_size(pqueue pq);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* ! HEADER_PQUEUE_H */
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/rand.h b/protocols/Telegram/tgl/openssl/include/openssl/rand.h
new file mode 100644
index 0000000000..2553afda20
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/rand.h
@@ -0,0 +1,150 @@
+/* crypto/rand/rand.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_RAND_H
+# define HEADER_RAND_H
+
+# include <stdlib.h>
+# include <openssl/ossl_typ.h>
+# include <openssl/e_os2.h>
+
+# if defined(OPENSSL_SYS_WINDOWS)
+# include <windows.h>
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# if defined(OPENSSL_FIPS)
+# define FIPS_RAND_SIZE_T size_t
+# endif
+
+/* Already defined in ossl_typ.h */
+/* typedef struct rand_meth_st RAND_METHOD; */
+
+struct rand_meth_st {
+ void (*seed) (const void *buf, int num);
+ int (*bytes) (unsigned char *buf, int num);
+ void (*cleanup) (void);
+ void (*add) (const void *buf, int num, double entropy);
+ int (*pseudorand) (unsigned char *buf, int num);
+ int (*status) (void);
+};
+
+# ifdef BN_DEBUG
+extern int rand_predictable;
+# endif
+
+int RAND_set_rand_method(const RAND_METHOD *meth);
+const RAND_METHOD *RAND_get_rand_method(void);
+# ifndef OPENSSL_NO_ENGINE
+int RAND_set_rand_engine(ENGINE *engine);
+# endif
+RAND_METHOD *RAND_SSLeay(void);
+void RAND_cleanup(void);
+int RAND_bytes(unsigned char *buf, int num);
+int RAND_pseudo_bytes(unsigned char *buf, int num);
+void RAND_seed(const void *buf, int num);
+void RAND_add(const void *buf, int num, double entropy);
+int RAND_load_file(const char *file, long max_bytes);
+int RAND_write_file(const char *file);
+const char *RAND_file_name(char *file, size_t num);
+int RAND_status(void);
+int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes);
+int RAND_egd(const char *path);
+int RAND_egd_bytes(const char *path, int bytes);
+int RAND_poll(void);
+
+# if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
+
+void RAND_screen(void);
+int RAND_event(UINT, WPARAM, LPARAM);
+
+# endif
+
+# ifdef OPENSSL_FIPS
+void RAND_set_fips_drbg_type(int type, int flags);
+int RAND_init_fips(void);
+# endif
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_RAND_strings(void);
+
+/* Error codes for the RAND functions. */
+
+/* Function codes. */
+# define RAND_F_RAND_GET_RAND_METHOD 101
+# define RAND_F_RAND_INIT_FIPS 102
+# define RAND_F_SSLEAY_RAND_BYTES 100
+
+/* Reason codes. */
+# define RAND_R_DUAL_EC_DRBG_DISABLED 104
+# define RAND_R_ERROR_INITIALISING_DRBG 102
+# define RAND_R_ERROR_INSTANTIATING_DRBG 103
+# define RAND_R_NO_FIPS_RANDOM_METHOD_SET 101
+# define RAND_R_PRNG_NOT_SEEDED 100
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/rc2.h b/protocols/Telegram/tgl/openssl/include/openssl/rc2.h
new file mode 100644
index 0000000000..29d02d7322
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/rc2.h
@@ -0,0 +1,103 @@
+/* crypto/rc2/rc2.h */
+/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_RC2_H
+# define HEADER_RC2_H
+
+# include <openssl/opensslconf.h>/* OPENSSL_NO_RC2, RC2_INT */
+# ifdef OPENSSL_NO_RC2
+# error RC2 is disabled.
+# endif
+
+# define RC2_ENCRYPT 1
+# define RC2_DECRYPT 0
+
+# define RC2_BLOCK 8
+# define RC2_KEY_LENGTH 16
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct rc2_key_st {
+ RC2_INT data[64];
+} RC2_KEY;
+
+# ifdef OPENSSL_FIPS
+void private_RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,
+ int bits);
+# endif
+void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits);
+void RC2_ecb_encrypt(const unsigned char *in, unsigned char *out,
+ RC2_KEY *key, int enc);
+void RC2_encrypt(unsigned long *data, RC2_KEY *key);
+void RC2_decrypt(unsigned long *data, RC2_KEY *key);
+void RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
+ RC2_KEY *ks, unsigned char *iv, int enc);
+void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, RC2_KEY *schedule, unsigned char *ivec,
+ int *num, int enc);
+void RC2_ofb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, RC2_KEY *schedule, unsigned char *ivec,
+ int *num);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/rc4.h b/protocols/Telegram/tgl/openssl/include/openssl/rc4.h
new file mode 100644
index 0000000000..39162b1648
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/rc4.h
@@ -0,0 +1,88 @@
+/* crypto/rc4/rc4.h */
+/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_RC4_H
+# define HEADER_RC4_H
+
+# include <openssl/opensslconf.h>/* OPENSSL_NO_RC4, RC4_INT */
+# ifdef OPENSSL_NO_RC4
+# error RC4 is disabled.
+# endif
+
+# include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct rc4_key_st {
+ RC4_INT x, y;
+ RC4_INT data[256];
+} RC4_KEY;
+
+const char *RC4_options(void);
+void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data);
+void private_RC4_set_key(RC4_KEY *key, int len, const unsigned char *data);
+void RC4(RC4_KEY *key, size_t len, const unsigned char *indata,
+ unsigned char *outdata);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/ripemd.h b/protocols/Telegram/tgl/openssl/include/openssl/ripemd.h
new file mode 100644
index 0000000000..b88ef25e72
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/ripemd.h
@@ -0,0 +1,105 @@
+/* crypto/ripemd/ripemd.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_RIPEMD_H
+# define HEADER_RIPEMD_H
+
+# include <openssl/e_os2.h>
+# include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# ifdef OPENSSL_NO_RIPEMD
+# error RIPEMD is disabled.
+# endif
+
+# if defined(__LP32__)
+# define RIPEMD160_LONG unsigned long
+# elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)
+# define RIPEMD160_LONG unsigned long
+# define RIPEMD160_LONG_LOG2 3
+# else
+# define RIPEMD160_LONG unsigned int
+# endif
+
+# define RIPEMD160_CBLOCK 64
+# define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK/4)
+# define RIPEMD160_DIGEST_LENGTH 20
+
+typedef struct RIPEMD160state_st {
+ RIPEMD160_LONG A, B, C, D, E;
+ RIPEMD160_LONG Nl, Nh;
+ RIPEMD160_LONG data[RIPEMD160_LBLOCK];
+ unsigned int num;
+} RIPEMD160_CTX;
+
+# ifdef OPENSSL_FIPS
+int private_RIPEMD160_Init(RIPEMD160_CTX *c);
+# endif
+int RIPEMD160_Init(RIPEMD160_CTX *c);
+int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len);
+int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c);
+unsigned char *RIPEMD160(const unsigned char *d, size_t n, unsigned char *md);
+void RIPEMD160_Transform(RIPEMD160_CTX *c, const unsigned char *b);
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/rsa.h b/protocols/Telegram/tgl/openssl/include/openssl/rsa.h
new file mode 100644
index 0000000000..d2ee37406e
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/rsa.h
@@ -0,0 +1,664 @@
+/* crypto/rsa/rsa.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_RSA_H
+# define HEADER_RSA_H
+
+# include <openssl/asn1.h>
+
+# ifndef OPENSSL_NO_BIO
+# include <openssl/bio.h>
+# endif
+# include <openssl/crypto.h>
+# include <openssl/ossl_typ.h>
+# ifndef OPENSSL_NO_DEPRECATED
+# include <openssl/bn.h>
+# endif
+
+# ifdef OPENSSL_NO_RSA
+# error RSA is disabled.
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Declared already in ossl_typ.h */
+/* typedef struct rsa_st RSA; */
+/* typedef struct rsa_meth_st RSA_METHOD; */
+
+struct rsa_meth_st {
+ const char *name;
+ int (*rsa_pub_enc) (int flen, const unsigned char *from,
+ unsigned char *to, RSA *rsa, int padding);
+ int (*rsa_pub_dec) (int flen, const unsigned char *from,
+ unsigned char *to, RSA *rsa, int padding);
+ int (*rsa_priv_enc) (int flen, const unsigned char *from,
+ unsigned char *to, RSA *rsa, int padding);
+ int (*rsa_priv_dec) (int flen, const unsigned char *from,
+ unsigned char *to, RSA *rsa, int padding);
+ /* Can be null */
+ int (*rsa_mod_exp) (BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx);
+ /* Can be null */
+ int (*bn_mod_exp) (BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
+ const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
+ /* called at new */
+ int (*init) (RSA *rsa);
+ /* called at free */
+ int (*finish) (RSA *rsa);
+ /* RSA_METHOD_FLAG_* things */
+ int flags;
+ /* may be needed! */
+ char *app_data;
+ /*
+ * New sign and verify functions: some libraries don't allow arbitrary
+ * data to be signed/verified: this allows them to be used. Note: for
+ * this to work the RSA_public_decrypt() and RSA_private_encrypt() should
+ * *NOT* be used RSA_sign(), RSA_verify() should be used instead. Note:
+ * for backwards compatibility this functionality is only enabled if the
+ * RSA_FLAG_SIGN_VER option is set in 'flags'.
+ */
+ int (*rsa_sign) (int type,
+ const unsigned char *m, unsigned int m_length,
+ unsigned char *sigret, unsigned int *siglen,
+ const RSA *rsa);
+ int (*rsa_verify) (int dtype, const unsigned char *m,
+ unsigned int m_length, const unsigned char *sigbuf,
+ unsigned int siglen, const RSA *rsa);
+ /*
+ * If this callback is NULL, the builtin software RSA key-gen will be
+ * used. This is for behavioural compatibility whilst the code gets
+ * rewired, but one day it would be nice to assume there are no such
+ * things as "builtin software" implementations.
+ */
+ int (*rsa_keygen) (RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
+};
+
+struct rsa_st {
+ /*
+ * The first parameter is used to pickup errors where this is passed
+ * instead of aEVP_PKEY, it is set to 0
+ */
+ int pad;
+ long version;
+ const RSA_METHOD *meth;
+ /* functional reference if 'meth' is ENGINE-provided */
+ ENGINE *engine;
+ BIGNUM *n;
+ BIGNUM *e;
+ BIGNUM *d;
+ BIGNUM *p;
+ BIGNUM *q;
+ BIGNUM *dmp1;
+ BIGNUM *dmq1;
+ BIGNUM *iqmp;
+ /* be careful using this if the RSA structure is shared */
+ CRYPTO_EX_DATA ex_data;
+ int references;
+ int flags;
+ /* Used to cache montgomery values */
+ BN_MONT_CTX *_method_mod_n;
+ BN_MONT_CTX *_method_mod_p;
+ BN_MONT_CTX *_method_mod_q;
+ /*
+ * all BIGNUM values are actually in the following data, if it is not
+ * NULL
+ */
+ char *bignum_data;
+ BN_BLINDING *blinding;
+ BN_BLINDING *mt_blinding;
+};
+
+# ifndef OPENSSL_RSA_MAX_MODULUS_BITS
+# define OPENSSL_RSA_MAX_MODULUS_BITS 16384
+# endif
+
+# ifndef OPENSSL_RSA_SMALL_MODULUS_BITS
+# define OPENSSL_RSA_SMALL_MODULUS_BITS 3072
+# endif
+# ifndef OPENSSL_RSA_MAX_PUBEXP_BITS
+
+/* exponent limit enforced for "large" modulus only */
+# define OPENSSL_RSA_MAX_PUBEXP_BITS 64
+# endif
+
+# define RSA_3 0x3L
+# define RSA_F4 0x10001L
+
+# define RSA_METHOD_FLAG_NO_CHECK 0x0001/* don't check pub/private
+ * match */
+
+# define RSA_FLAG_CACHE_PUBLIC 0x0002
+# define RSA_FLAG_CACHE_PRIVATE 0x0004
+# define RSA_FLAG_BLINDING 0x0008
+# define RSA_FLAG_THREAD_SAFE 0x0010
+/*
+ * This flag means the private key operations will be handled by rsa_mod_exp
+ * and that they do not depend on the private key components being present:
+ * for example a key stored in external hardware. Without this flag
+ * bn_mod_exp gets called when private key components are absent.
+ */
+# define RSA_FLAG_EXT_PKEY 0x0020
+
+/*
+ * This flag in the RSA_METHOD enables the new rsa_sign, rsa_verify
+ * functions.
+ */
+# define RSA_FLAG_SIGN_VER 0x0040
+
+/*
+ * new with 0.9.6j and 0.9.7b; the built-in
+ * RSA implementation now uses blinding by
+ * default (ignoring RSA_FLAG_BLINDING),
+ * but other engines might not need it
+ */
+# define RSA_FLAG_NO_BLINDING 0x0080
+/*
+ * new with 0.9.8f; the built-in RSA
+ * implementation now uses constant time
+ * operations by default in private key operations,
+ * e.g., constant time modular exponentiation,
+ * modular inverse without leaking branches,
+ * division without leaking branches. This
+ * flag disables these constant time
+ * operations and results in faster RSA
+ * private key operations.
+ */
+# define RSA_FLAG_NO_CONSTTIME 0x0100
+# ifdef OPENSSL_USE_DEPRECATED
+/* deprecated name for the flag*/
+/*
+ * new with 0.9.7h; the built-in RSA
+ * implementation now uses constant time
+ * modular exponentiation for secret exponents
+ * by default. This flag causes the
+ * faster variable sliding window method to
+ * be used for all exponents.
+ */
+# define RSA_FLAG_NO_EXP_CONSTTIME RSA_FLAG_NO_CONSTTIME
+# endif
+
+# define EVP_PKEY_CTX_set_rsa_padding(ctx, pad) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, -1, EVP_PKEY_CTRL_RSA_PADDING, \
+ pad, NULL)
+
+# define EVP_PKEY_CTX_get_rsa_padding(ctx, ppad) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, -1, \
+ EVP_PKEY_CTRL_GET_RSA_PADDING, 0, ppad)
+
+# define EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx, len) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, \
+ (EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY), \
+ EVP_PKEY_CTRL_RSA_PSS_SALTLEN, \
+ len, NULL)
+
+# define EVP_PKEY_CTX_get_rsa_pss_saltlen(ctx, plen) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, \
+ (EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY), \
+ EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN, \
+ 0, plen)
+
+# define EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, bits) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_KEYGEN, \
+ EVP_PKEY_CTRL_RSA_KEYGEN_BITS, bits, NULL)
+
+# define EVP_PKEY_CTX_set_rsa_keygen_pubexp(ctx, pubexp) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_KEYGEN, \
+ EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP, 0, pubexp)
+
+# define EVP_PKEY_CTX_set_rsa_mgf1_md(ctx, md) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, \
+ EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT, \
+ EVP_PKEY_CTRL_RSA_MGF1_MD, 0, (void *)md)
+
+# define EVP_PKEY_CTX_set_rsa_oaep_md(ctx, md) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, \
+ EVP_PKEY_CTRL_RSA_OAEP_MD, 0, (void *)md)
+
+# define EVP_PKEY_CTX_get_rsa_mgf1_md(ctx, pmd) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, \
+ EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT, \
+ EVP_PKEY_CTRL_GET_RSA_MGF1_MD, 0, (void *)pmd)
+
+# define EVP_PKEY_CTX_get_rsa_oaep_md(ctx, pmd) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, \
+ EVP_PKEY_CTRL_GET_RSA_OAEP_MD, 0, (void *)pmd)
+
+# define EVP_PKEY_CTX_set0_rsa_oaep_label(ctx, l, llen) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, \
+ EVP_PKEY_CTRL_RSA_OAEP_LABEL, llen, (void *)l)
+
+# define EVP_PKEY_CTX_get0_rsa_oaep_label(ctx, l) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, \
+ EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL, 0, (void *)l)
+
+# define EVP_PKEY_CTRL_RSA_PADDING (EVP_PKEY_ALG_CTRL + 1)
+# define EVP_PKEY_CTRL_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 2)
+
+# define EVP_PKEY_CTRL_RSA_KEYGEN_BITS (EVP_PKEY_ALG_CTRL + 3)
+# define EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP (EVP_PKEY_ALG_CTRL + 4)
+# define EVP_PKEY_CTRL_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 5)
+
+# define EVP_PKEY_CTRL_GET_RSA_PADDING (EVP_PKEY_ALG_CTRL + 6)
+# define EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 7)
+# define EVP_PKEY_CTRL_GET_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 8)
+
+# define EVP_PKEY_CTRL_RSA_OAEP_MD (EVP_PKEY_ALG_CTRL + 9)
+# define EVP_PKEY_CTRL_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 10)
+
+# define EVP_PKEY_CTRL_GET_RSA_OAEP_MD (EVP_PKEY_ALG_CTRL + 11)
+# define EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 12)
+
+# define RSA_PKCS1_PADDING 1
+# define RSA_SSLV23_PADDING 2
+# define RSA_NO_PADDING 3
+# define RSA_PKCS1_OAEP_PADDING 4
+# define RSA_X931_PADDING 5
+/* EVP_PKEY_ only */
+# define RSA_PKCS1_PSS_PADDING 6
+
+# define RSA_PKCS1_PADDING_SIZE 11
+
+# define RSA_set_app_data(s,arg) RSA_set_ex_data(s,0,arg)
+# define RSA_get_app_data(s) RSA_get_ex_data(s,0)
+
+RSA *RSA_new(void);
+RSA *RSA_new_method(ENGINE *engine);
+int RSA_size(const RSA *rsa);
+
+/* Deprecated version */
+# ifndef OPENSSL_NO_DEPRECATED
+RSA *RSA_generate_key(int bits, unsigned long e, void
+ (*callback) (int, int, void *), void *cb_arg);
+# endif /* !defined(OPENSSL_NO_DEPRECATED) */
+
+/* New version */
+int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
+
+int RSA_check_key(const RSA *);
+ /* next 4 return -1 on error */
+int RSA_public_encrypt(int flen, const unsigned char *from,
+ unsigned char *to, RSA *rsa, int padding);
+int RSA_private_encrypt(int flen, const unsigned char *from,
+ unsigned char *to, RSA *rsa, int padding);
+int RSA_public_decrypt(int flen, const unsigned char *from,
+ unsigned char *to, RSA *rsa, int padding);
+int RSA_private_decrypt(int flen, const unsigned char *from,
+ unsigned char *to, RSA *rsa, int padding);
+void RSA_free(RSA *r);
+/* "up" the RSA object's reference count */
+int RSA_up_ref(RSA *r);
+
+int RSA_flags(const RSA *r);
+
+void RSA_set_default_method(const RSA_METHOD *meth);
+const RSA_METHOD *RSA_get_default_method(void);
+const RSA_METHOD *RSA_get_method(const RSA *rsa);
+int RSA_set_method(RSA *rsa, const RSA_METHOD *meth);
+
+/* This function needs the memory locking malloc callbacks to be installed */
+int RSA_memory_lock(RSA *r);
+
+/* these are the actual SSLeay RSA functions */
+const RSA_METHOD *RSA_PKCS1_SSLeay(void);
+
+const RSA_METHOD *RSA_null_method(void);
+
+DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPublicKey)
+DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPrivateKey)
+
+typedef struct rsa_pss_params_st {
+ X509_ALGOR *hashAlgorithm;
+ X509_ALGOR *maskGenAlgorithm;
+ ASN1_INTEGER *saltLength;
+ ASN1_INTEGER *trailerField;
+} RSA_PSS_PARAMS;
+
+DECLARE_ASN1_FUNCTIONS(RSA_PSS_PARAMS)
+
+typedef struct rsa_oaep_params_st {
+ X509_ALGOR *hashFunc;
+ X509_ALGOR *maskGenFunc;
+ X509_ALGOR *pSourceFunc;
+} RSA_OAEP_PARAMS;
+
+DECLARE_ASN1_FUNCTIONS(RSA_OAEP_PARAMS)
+
+# ifndef OPENSSL_NO_FP_API
+int RSA_print_fp(FILE *fp, const RSA *r, int offset);
+# endif
+
+# ifndef OPENSSL_NO_BIO
+int RSA_print(BIO *bp, const RSA *r, int offset);
+# endif
+
+# ifndef OPENSSL_NO_RC4
+int i2d_RSA_NET(const RSA *a, unsigned char **pp,
+ int (*cb) (char *buf, int len, const char *prompt,
+ int verify), int sgckey);
+RSA *d2i_RSA_NET(RSA **a, const unsigned char **pp, long length,
+ int (*cb) (char *buf, int len, const char *prompt,
+ int verify), int sgckey);
+
+int i2d_Netscape_RSA(const RSA *a, unsigned char **pp,
+ int (*cb) (char *buf, int len, const char *prompt,
+ int verify));
+RSA *d2i_Netscape_RSA(RSA **a, const unsigned char **pp, long length,
+ int (*cb) (char *buf, int len, const char *prompt,
+ int verify));
+# endif
+
+/*
+ * The following 2 functions sign and verify a X509_SIG ASN1 object inside
+ * PKCS#1 padded RSA encryption
+ */
+int RSA_sign(int type, const unsigned char *m, unsigned int m_length,
+ unsigned char *sigret, unsigned int *siglen, RSA *rsa);
+int RSA_verify(int type, const unsigned char *m, unsigned int m_length,
+ const unsigned char *sigbuf, unsigned int siglen, RSA *rsa);
+
+/*
+ * The following 2 function sign and verify a ASN1_OCTET_STRING object inside
+ * PKCS#1 padded RSA encryption
+ */
+int RSA_sign_ASN1_OCTET_STRING(int type,
+ const unsigned char *m, unsigned int m_length,
+ unsigned char *sigret, unsigned int *siglen,
+ RSA *rsa);
+int RSA_verify_ASN1_OCTET_STRING(int type, const unsigned char *m,
+ unsigned int m_length, unsigned char *sigbuf,
+ unsigned int siglen, RSA *rsa);
+
+int RSA_blinding_on(RSA *rsa, BN_CTX *ctx);
+void RSA_blinding_off(RSA *rsa);
+BN_BLINDING *RSA_setup_blinding(RSA *rsa, BN_CTX *ctx);
+
+int RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen,
+ const unsigned char *f, int fl);
+int RSA_padding_check_PKCS1_type_1(unsigned char *to, int tlen,
+ const unsigned char *f, int fl,
+ int rsa_len);
+int RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen,
+ const unsigned char *f, int fl);
+int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen,
+ const unsigned char *f, int fl,
+ int rsa_len);
+int PKCS1_MGF1(unsigned char *mask, long len, const unsigned char *seed,
+ long seedlen, const EVP_MD *dgst);
+int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen,
+ const unsigned char *f, int fl,
+ const unsigned char *p, int pl);
+int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen,
+ const unsigned char *f, int fl, int rsa_len,
+ const unsigned char *p, int pl);
+int RSA_padding_add_PKCS1_OAEP_mgf1(unsigned char *to, int tlen,
+ const unsigned char *from, int flen,
+ const unsigned char *param, int plen,
+ const EVP_MD *md, const EVP_MD *mgf1md);
+int RSA_padding_check_PKCS1_OAEP_mgf1(unsigned char *to, int tlen,
+ const unsigned char *from, int flen,
+ int num, const unsigned char *param,
+ int plen, const EVP_MD *md,
+ const EVP_MD *mgf1md);
+int RSA_padding_add_SSLv23(unsigned char *to, int tlen,
+ const unsigned char *f, int fl);
+int RSA_padding_check_SSLv23(unsigned char *to, int tlen,
+ const unsigned char *f, int fl, int rsa_len);
+int RSA_padding_add_none(unsigned char *to, int tlen, const unsigned char *f,
+ int fl);
+int RSA_padding_check_none(unsigned char *to, int tlen,
+ const unsigned char *f, int fl, int rsa_len);
+int RSA_padding_add_X931(unsigned char *to, int tlen, const unsigned char *f,
+ int fl);
+int RSA_padding_check_X931(unsigned char *to, int tlen,
+ const unsigned char *f, int fl, int rsa_len);
+int RSA_X931_hash_id(int nid);
+
+int RSA_verify_PKCS1_PSS(RSA *rsa, const unsigned char *mHash,
+ const EVP_MD *Hash, const unsigned char *EM,
+ int sLen);
+int RSA_padding_add_PKCS1_PSS(RSA *rsa, unsigned char *EM,
+ const unsigned char *mHash, const EVP_MD *Hash,
+ int sLen);
+
+int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const unsigned char *mHash,
+ const EVP_MD *Hash, const EVP_MD *mgf1Hash,
+ const unsigned char *EM, int sLen);
+
+int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM,
+ const unsigned char *mHash,
+ const EVP_MD *Hash, const EVP_MD *mgf1Hash,
+ int sLen);
+
+int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
+ CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
+int RSA_set_ex_data(RSA *r, int idx, void *arg);
+void *RSA_get_ex_data(const RSA *r, int idx);
+
+RSA *RSAPublicKey_dup(RSA *rsa);
+RSA *RSAPrivateKey_dup(RSA *rsa);
+
+/*
+ * If this flag is set the RSA method is FIPS compliant and can be used in
+ * FIPS mode. This is set in the validated module method. If an application
+ * sets this flag in its own methods it is its responsibility to ensure the
+ * result is compliant.
+ */
+
+# define RSA_FLAG_FIPS_METHOD 0x0400
+
+/*
+ * If this flag is set the operations normally disabled in FIPS mode are
+ * permitted it is then the applications responsibility to ensure that the
+ * usage is compliant.
+ */
+
+# define RSA_FLAG_NON_FIPS_ALLOW 0x0400
+/*
+ * Application has decided PRNG is good enough to generate a key: don't
+ * check.
+ */
+# define RSA_FLAG_CHECKED 0x0800
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_RSA_strings(void);
+
+/* Error codes for the RSA functions. */
+
+/* Function codes. */
+# define RSA_F_CHECK_PADDING_MD 140
+# define RSA_F_DO_RSA_PRINT 146
+# define RSA_F_INT_RSA_VERIFY 145
+# define RSA_F_MEMORY_LOCK 100
+# define RSA_F_OLD_RSA_PRIV_DECODE 147
+# define RSA_F_PKEY_RSA_CTRL 143
+# define RSA_F_PKEY_RSA_CTRL_STR 144
+# define RSA_F_PKEY_RSA_SIGN 142
+# define RSA_F_PKEY_RSA_VERIFY 154
+# define RSA_F_PKEY_RSA_VERIFYRECOVER 141
+# define RSA_F_RSA_ALGOR_TO_MD 157
+# define RSA_F_RSA_BUILTIN_KEYGEN 129
+# define RSA_F_RSA_CHECK_KEY 123
+# define RSA_F_RSA_CMS_DECRYPT 158
+# define RSA_F_RSA_EAY_PRIVATE_DECRYPT 101
+# define RSA_F_RSA_EAY_PRIVATE_ENCRYPT 102
+# define RSA_F_RSA_EAY_PUBLIC_DECRYPT 103
+# define RSA_F_RSA_EAY_PUBLIC_ENCRYPT 104
+# define RSA_F_RSA_GENERATE_KEY 105
+# define RSA_F_RSA_GENERATE_KEY_EX 155
+# define RSA_F_RSA_ITEM_VERIFY 156
+# define RSA_F_RSA_MEMORY_LOCK 130
+# define RSA_F_RSA_MGF1_TO_MD 159
+# define RSA_F_RSA_NEW_METHOD 106
+# define RSA_F_RSA_NULL 124
+# define RSA_F_RSA_NULL_MOD_EXP 131
+# define RSA_F_RSA_NULL_PRIVATE_DECRYPT 132
+# define RSA_F_RSA_NULL_PRIVATE_ENCRYPT 133
+# define RSA_F_RSA_NULL_PUBLIC_DECRYPT 134
+# define RSA_F_RSA_NULL_PUBLIC_ENCRYPT 135
+# define RSA_F_RSA_PADDING_ADD_NONE 107
+# define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP 121
+# define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP_MGF1 160
+# define RSA_F_RSA_PADDING_ADD_PKCS1_PSS 125
+# define RSA_F_RSA_PADDING_ADD_PKCS1_PSS_MGF1 148
+# define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1 108
+# define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2 109
+# define RSA_F_RSA_PADDING_ADD_SSLV23 110
+# define RSA_F_RSA_PADDING_ADD_X931 127
+# define RSA_F_RSA_PADDING_CHECK_NONE 111
+# define RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP 122
+# define RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP_MGF1 161
+# define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_1 112
+# define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2 113
+# define RSA_F_RSA_PADDING_CHECK_SSLV23 114
+# define RSA_F_RSA_PADDING_CHECK_X931 128
+# define RSA_F_RSA_PRINT 115
+# define RSA_F_RSA_PRINT_FP 116
+# define RSA_F_RSA_PRIVATE_DECRYPT 150
+# define RSA_F_RSA_PRIVATE_ENCRYPT 151
+# define RSA_F_RSA_PRIV_DECODE 137
+# define RSA_F_RSA_PRIV_ENCODE 138
+# define RSA_F_RSA_PSS_TO_CTX 162
+# define RSA_F_RSA_PUBLIC_DECRYPT 152
+# define RSA_F_RSA_PUBLIC_ENCRYPT 153
+# define RSA_F_RSA_PUB_DECODE 139
+# define RSA_F_RSA_SETUP_BLINDING 136
+# define RSA_F_RSA_SIGN 117
+# define RSA_F_RSA_SIGN_ASN1_OCTET_STRING 118
+# define RSA_F_RSA_VERIFY 119
+# define RSA_F_RSA_VERIFY_ASN1_OCTET_STRING 120
+# define RSA_F_RSA_VERIFY_PKCS1_PSS 126
+# define RSA_F_RSA_VERIFY_PKCS1_PSS_MGF1 149
+
+/* Reason codes. */
+# define RSA_R_ALGORITHM_MISMATCH 100
+# define RSA_R_BAD_E_VALUE 101
+# define RSA_R_BAD_FIXED_HEADER_DECRYPT 102
+# define RSA_R_BAD_PAD_BYTE_COUNT 103
+# define RSA_R_BAD_SIGNATURE 104
+# define RSA_R_BLOCK_TYPE_IS_NOT_01 106
+# define RSA_R_BLOCK_TYPE_IS_NOT_02 107
+# define RSA_R_DATA_GREATER_THAN_MOD_LEN 108
+# define RSA_R_DATA_TOO_LARGE 109
+# define RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 110
+# define RSA_R_DATA_TOO_LARGE_FOR_MODULUS 132
+# define RSA_R_DATA_TOO_SMALL 111
+# define RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE 122
+# define RSA_R_DIGEST_DOES_NOT_MATCH 166
+# define RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY 112
+# define RSA_R_DMP1_NOT_CONGRUENT_TO_D 124
+# define RSA_R_DMQ1_NOT_CONGRUENT_TO_D 125
+# define RSA_R_D_E_NOT_CONGRUENT_TO_1 123
+# define RSA_R_FIRST_OCTET_INVALID 133
+# define RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE 144
+# define RSA_R_INVALID_DIGEST 160
+# define RSA_R_INVALID_DIGEST_LENGTH 143
+# define RSA_R_INVALID_HEADER 137
+# define RSA_R_INVALID_KEYBITS 145
+# define RSA_R_INVALID_LABEL 161
+# define RSA_R_INVALID_MESSAGE_LENGTH 131
+# define RSA_R_INVALID_MGF1_MD 156
+# define RSA_R_INVALID_OAEP_PARAMETERS 162
+# define RSA_R_INVALID_PADDING 138
+# define RSA_R_INVALID_PADDING_MODE 141
+# define RSA_R_INVALID_PSS_PARAMETERS 149
+# define RSA_R_INVALID_PSS_SALTLEN 146
+# define RSA_R_INVALID_SALT_LENGTH 150
+# define RSA_R_INVALID_TRAILER 139
+# define RSA_R_INVALID_X931_DIGEST 142
+# define RSA_R_IQMP_NOT_INVERSE_OF_Q 126
+# define RSA_R_KEY_SIZE_TOO_SMALL 120
+# define RSA_R_LAST_OCTET_INVALID 134
+# define RSA_R_MODULUS_TOO_LARGE 105
+# define RSA_R_NON_FIPS_RSA_METHOD 157
+# define RSA_R_NO_PUBLIC_EXPONENT 140
+# define RSA_R_NULL_BEFORE_BLOCK_MISSING 113
+# define RSA_R_N_DOES_NOT_EQUAL_P_Q 127
+# define RSA_R_OAEP_DECODING_ERROR 121
+# define RSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE 158
+# define RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 148
+# define RSA_R_PADDING_CHECK_FAILED 114
+# define RSA_R_PKCS_DECODING_ERROR 159
+# define RSA_R_P_NOT_PRIME 128
+# define RSA_R_Q_NOT_PRIME 129
+# define RSA_R_RSA_OPERATIONS_NOT_SUPPORTED 130
+# define RSA_R_SLEN_CHECK_FAILED 136
+# define RSA_R_SLEN_RECOVERY_FAILED 135
+# define RSA_R_SSLV3_ROLLBACK_ATTACK 115
+# define RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 116
+# define RSA_R_UNKNOWN_ALGORITHM_TYPE 117
+# define RSA_R_UNKNOWN_DIGEST 163
+# define RSA_R_UNKNOWN_MASK_DIGEST 151
+# define RSA_R_UNKNOWN_PADDING_TYPE 118
+# define RSA_R_UNKNOWN_PSS_DIGEST 152
+# define RSA_R_UNSUPPORTED_ENCRYPTION_TYPE 164
+# define RSA_R_UNSUPPORTED_LABEL_SOURCE 165
+# define RSA_R_UNSUPPORTED_MASK_ALGORITHM 153
+# define RSA_R_UNSUPPORTED_MASK_PARAMETER 154
+# define RSA_R_UNSUPPORTED_SIGNATURE_TYPE 155
+# define RSA_R_VALUE_MISSING 147
+# define RSA_R_WRONG_SIGNATURE_LENGTH 119
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/safestack.h b/protocols/Telegram/tgl/openssl/include/openssl/safestack.h
new file mode 100644
index 0000000000..1d4f87eab3
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/safestack.h
@@ -0,0 +1,2672 @@
+/* ====================================================================
+ * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_SAFESTACK_H
+# define HEADER_SAFESTACK_H
+
+# include <openssl/stack.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# ifndef CHECKED_PTR_OF
+# define CHECKED_PTR_OF(type, p) \
+ ((void*) (1 ? p : (type*)0))
+# endif
+
+/*
+ * In C++ we get problems because an explicit cast is needed from (void *) we
+ * use CHECKED_STACK_OF to ensure the correct type is passed in the macros
+ * below.
+ */
+
+# define CHECKED_STACK_OF(type, p) \
+ ((_STACK*) (1 ? p : (STACK_OF(type)*)0))
+
+# define CHECKED_SK_COPY_FUNC(type, p) \
+ ((void *(*)(void *)) ((1 ? p : (type *(*)(const type *))0)))
+
+# define CHECKED_SK_FREE_FUNC(type, p) \
+ ((void (*)(void *)) ((1 ? p : (void (*)(type *))0)))
+
+# define CHECKED_SK_CMP_FUNC(type, p) \
+ ((int (*)(const void *, const void *)) \
+ ((1 ? p : (int (*)(const type * const *, const type * const *))0)))
+
+# define STACK_OF(type) struct stack_st_##type
+# define PREDECLARE_STACK_OF(type) STACK_OF(type);
+
+# define DECLARE_STACK_OF(type) \
+STACK_OF(type) \
+ { \
+ _STACK stack; \
+ };
+# define DECLARE_SPECIAL_STACK_OF(type, type2) \
+STACK_OF(type) \
+ { \
+ _STACK stack; \
+ };
+
+/* nada (obsolete in new safestack approach)*/
+# define IMPLEMENT_STACK_OF(type)
+
+/*-
+ * Strings are special: normally an lhash entry will point to a single
+ * (somewhat) mutable object. In the case of strings:
+ *
+ * a) Instead of a single char, there is an array of chars, NUL-terminated.
+ * b) The string may have be immutable.
+ *
+ * So, they need their own declarations. Especially important for
+ * type-checking tools, such as Deputy.
+ *
+ * In practice, however, it appears to be hard to have a const
+ * string. For now, I'm settling for dealing with the fact it is a
+ * string at all.
+ */
+typedef char *OPENSSL_STRING;
+
+typedef const char *OPENSSL_CSTRING;
+
+/*
+ * Confusingly, LHASH_OF(STRING) deals with char ** throughout, but
+ * STACK_OF(STRING) is really more like STACK_OF(char), only, as mentioned
+ * above, instead of a single char each entry is a NUL-terminated array of
+ * chars. So, we have to implement STRING specially for STACK_OF. This is
+ * dealt with in the autogenerated macros below.
+ */
+
+DECLARE_SPECIAL_STACK_OF(OPENSSL_STRING, char)
+
+/*
+ * Similarly, we sometimes use a block of characters, NOT nul-terminated.
+ * These should also be distinguished from "normal" stacks.
+ */
+typedef void *OPENSSL_BLOCK;
+DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void)
+
+/*
+ * SKM_sk_... stack macros are internal to safestack.h: never use them
+ * directly, use sk_<type>_... instead
+ */
+# define SKM_sk_new(type, cmp) \
+ ((STACK_OF(type) *)sk_new(CHECKED_SK_CMP_FUNC(type, cmp)))
+# define SKM_sk_new_null(type) \
+ ((STACK_OF(type) *)sk_new_null())
+# define SKM_sk_free(type, st) \
+ sk_free(CHECKED_STACK_OF(type, st))
+# define SKM_sk_num(type, st) \
+ sk_num(CHECKED_STACK_OF(type, st))
+# define SKM_sk_value(type, st,i) \
+ ((type *)sk_value(CHECKED_STACK_OF(type, st), i))
+# define SKM_sk_set(type, st,i,val) \
+ sk_set(CHECKED_STACK_OF(type, st), i, CHECKED_PTR_OF(type, val))
+# define SKM_sk_zero(type, st) \
+ sk_zero(CHECKED_STACK_OF(type, st))
+# define SKM_sk_push(type, st, val) \
+ sk_push(CHECKED_STACK_OF(type, st), CHECKED_PTR_OF(type, val))
+# define SKM_sk_unshift(type, st, val) \
+ sk_unshift(CHECKED_STACK_OF(type, st), CHECKED_PTR_OF(type, val))
+# define SKM_sk_find(type, st, val) \
+ sk_find(CHECKED_STACK_OF(type, st), CHECKED_PTR_OF(type, val))
+# define SKM_sk_find_ex(type, st, val) \
+ sk_find_ex(CHECKED_STACK_OF(type, st), \
+ CHECKED_PTR_OF(type, val))
+# define SKM_sk_delete(type, st, i) \
+ (type *)sk_delete(CHECKED_STACK_OF(type, st), i)
+# define SKM_sk_delete_ptr(type, st, ptr) \
+ (type *)sk_delete_ptr(CHECKED_STACK_OF(type, st), CHECKED_PTR_OF(type, ptr))
+# define SKM_sk_insert(type, st,val, i) \
+ sk_insert(CHECKED_STACK_OF(type, st), CHECKED_PTR_OF(type, val), i)
+# define SKM_sk_set_cmp_func(type, st, cmp) \
+ ((int (*)(const type * const *,const type * const *)) \
+ sk_set_cmp_func(CHECKED_STACK_OF(type, st), CHECKED_SK_CMP_FUNC(type, cmp)))
+# define SKM_sk_dup(type, st) \
+ (STACK_OF(type) *)sk_dup(CHECKED_STACK_OF(type, st))
+# define SKM_sk_pop_free(type, st, free_func) \
+ sk_pop_free(CHECKED_STACK_OF(type, st), CHECKED_SK_FREE_FUNC(type, free_func))
+# define SKM_sk_deep_copy(type, st, copy_func, free_func) \
+ (STACK_OF(type) *)sk_deep_copy(CHECKED_STACK_OF(type, st), CHECKED_SK_COPY_FUNC(type, copy_func), CHECKED_SK_FREE_FUNC(type, free_func))
+# define SKM_sk_shift(type, st) \
+ (type *)sk_shift(CHECKED_STACK_OF(type, st))
+# define SKM_sk_pop(type, st) \
+ (type *)sk_pop(CHECKED_STACK_OF(type, st))
+# define SKM_sk_sort(type, st) \
+ sk_sort(CHECKED_STACK_OF(type, st))
+# define SKM_sk_is_sorted(type, st) \
+ sk_is_sorted(CHECKED_STACK_OF(type, st))
+# define SKM_ASN1_SET_OF_d2i(type, st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ (STACK_OF(type) *)d2i_ASN1_SET( \
+ (STACK_OF(OPENSSL_BLOCK) **)CHECKED_PTR_OF(STACK_OF(type)*, st), \
+ pp, length, \
+ CHECKED_D2I_OF(type, d2i_func), \
+ CHECKED_SK_FREE_FUNC(type, free_func), \
+ ex_tag, ex_class)
+# define SKM_ASN1_SET_OF_i2d(type, st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ i2d_ASN1_SET((STACK_OF(OPENSSL_BLOCK) *)CHECKED_STACK_OF(type, st), pp, \
+ CHECKED_I2D_OF(type, i2d_func), \
+ ex_tag, ex_class, is_set)
+# define SKM_ASN1_seq_pack(type, st, i2d_func, buf, len) \
+ ASN1_seq_pack(CHECKED_PTR_OF(STACK_OF(type), st), \
+ CHECKED_I2D_OF(type, i2d_func), buf, len)
+# define SKM_ASN1_seq_unpack(type, buf, len, d2i_func, free_func) \
+ (STACK_OF(type) *)ASN1_seq_unpack(buf, len, CHECKED_D2I_OF(type, d2i_func), CHECKED_SK_FREE_FUNC(type, free_func))
+# define SKM_PKCS12_decrypt_d2i(type, algor, d2i_func, free_func, pass, passlen, oct, seq) \
+ (STACK_OF(type) *)PKCS12_decrypt_d2i(algor, \
+ CHECKED_D2I_OF(type, d2i_func), \
+ CHECKED_SK_FREE_FUNC(type, free_func), \
+ pass, passlen, oct, seq)
+/*
+ * This block of defines is updated by util/mkstack.pl, please do not touch!
+ */
+# define sk_ACCESS_DESCRIPTION_new(cmp) SKM_sk_new(ACCESS_DESCRIPTION, (cmp))
+# define sk_ACCESS_DESCRIPTION_new_null() SKM_sk_new_null(ACCESS_DESCRIPTION)
+# define sk_ACCESS_DESCRIPTION_free(st) SKM_sk_free(ACCESS_DESCRIPTION, (st))
+# define sk_ACCESS_DESCRIPTION_num(st) SKM_sk_num(ACCESS_DESCRIPTION, (st))
+# define sk_ACCESS_DESCRIPTION_value(st, i) SKM_sk_value(ACCESS_DESCRIPTION, (st), (i))
+# define sk_ACCESS_DESCRIPTION_set(st, i, val) SKM_sk_set(ACCESS_DESCRIPTION, (st), (i), (val))
+# define sk_ACCESS_DESCRIPTION_zero(st) SKM_sk_zero(ACCESS_DESCRIPTION, (st))
+# define sk_ACCESS_DESCRIPTION_push(st, val) SKM_sk_push(ACCESS_DESCRIPTION, (st), (val))
+# define sk_ACCESS_DESCRIPTION_unshift(st, val) SKM_sk_unshift(ACCESS_DESCRIPTION, (st), (val))
+# define sk_ACCESS_DESCRIPTION_find(st, val) SKM_sk_find(ACCESS_DESCRIPTION, (st), (val))
+# define sk_ACCESS_DESCRIPTION_find_ex(st, val) SKM_sk_find_ex(ACCESS_DESCRIPTION, (st), (val))
+# define sk_ACCESS_DESCRIPTION_delete(st, i) SKM_sk_delete(ACCESS_DESCRIPTION, (st), (i))
+# define sk_ACCESS_DESCRIPTION_delete_ptr(st, ptr) SKM_sk_delete_ptr(ACCESS_DESCRIPTION, (st), (ptr))
+# define sk_ACCESS_DESCRIPTION_insert(st, val, i) SKM_sk_insert(ACCESS_DESCRIPTION, (st), (val), (i))
+# define sk_ACCESS_DESCRIPTION_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ACCESS_DESCRIPTION, (st), (cmp))
+# define sk_ACCESS_DESCRIPTION_dup(st) SKM_sk_dup(ACCESS_DESCRIPTION, st)
+# define sk_ACCESS_DESCRIPTION_pop_free(st, free_func) SKM_sk_pop_free(ACCESS_DESCRIPTION, (st), (free_func))
+# define sk_ACCESS_DESCRIPTION_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ACCESS_DESCRIPTION, (st), (copy_func), (free_func))
+# define sk_ACCESS_DESCRIPTION_shift(st) SKM_sk_shift(ACCESS_DESCRIPTION, (st))
+# define sk_ACCESS_DESCRIPTION_pop(st) SKM_sk_pop(ACCESS_DESCRIPTION, (st))
+# define sk_ACCESS_DESCRIPTION_sort(st) SKM_sk_sort(ACCESS_DESCRIPTION, (st))
+# define sk_ACCESS_DESCRIPTION_is_sorted(st) SKM_sk_is_sorted(ACCESS_DESCRIPTION, (st))
+# define sk_ASIdOrRange_new(cmp) SKM_sk_new(ASIdOrRange, (cmp))
+# define sk_ASIdOrRange_new_null() SKM_sk_new_null(ASIdOrRange)
+# define sk_ASIdOrRange_free(st) SKM_sk_free(ASIdOrRange, (st))
+# define sk_ASIdOrRange_num(st) SKM_sk_num(ASIdOrRange, (st))
+# define sk_ASIdOrRange_value(st, i) SKM_sk_value(ASIdOrRange, (st), (i))
+# define sk_ASIdOrRange_set(st, i, val) SKM_sk_set(ASIdOrRange, (st), (i), (val))
+# define sk_ASIdOrRange_zero(st) SKM_sk_zero(ASIdOrRange, (st))
+# define sk_ASIdOrRange_push(st, val) SKM_sk_push(ASIdOrRange, (st), (val))
+# define sk_ASIdOrRange_unshift(st, val) SKM_sk_unshift(ASIdOrRange, (st), (val))
+# define sk_ASIdOrRange_find(st, val) SKM_sk_find(ASIdOrRange, (st), (val))
+# define sk_ASIdOrRange_find_ex(st, val) SKM_sk_find_ex(ASIdOrRange, (st), (val))
+# define sk_ASIdOrRange_delete(st, i) SKM_sk_delete(ASIdOrRange, (st), (i))
+# define sk_ASIdOrRange_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASIdOrRange, (st), (ptr))
+# define sk_ASIdOrRange_insert(st, val, i) SKM_sk_insert(ASIdOrRange, (st), (val), (i))
+# define sk_ASIdOrRange_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASIdOrRange, (st), (cmp))
+# define sk_ASIdOrRange_dup(st) SKM_sk_dup(ASIdOrRange, st)
+# define sk_ASIdOrRange_pop_free(st, free_func) SKM_sk_pop_free(ASIdOrRange, (st), (free_func))
+# define sk_ASIdOrRange_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASIdOrRange, (st), (copy_func), (free_func))
+# define sk_ASIdOrRange_shift(st) SKM_sk_shift(ASIdOrRange, (st))
+# define sk_ASIdOrRange_pop(st) SKM_sk_pop(ASIdOrRange, (st))
+# define sk_ASIdOrRange_sort(st) SKM_sk_sort(ASIdOrRange, (st))
+# define sk_ASIdOrRange_is_sorted(st) SKM_sk_is_sorted(ASIdOrRange, (st))
+# define sk_ASN1_GENERALSTRING_new(cmp) SKM_sk_new(ASN1_GENERALSTRING, (cmp))
+# define sk_ASN1_GENERALSTRING_new_null() SKM_sk_new_null(ASN1_GENERALSTRING)
+# define sk_ASN1_GENERALSTRING_free(st) SKM_sk_free(ASN1_GENERALSTRING, (st))
+# define sk_ASN1_GENERALSTRING_num(st) SKM_sk_num(ASN1_GENERALSTRING, (st))
+# define sk_ASN1_GENERALSTRING_value(st, i) SKM_sk_value(ASN1_GENERALSTRING, (st), (i))
+# define sk_ASN1_GENERALSTRING_set(st, i, val) SKM_sk_set(ASN1_GENERALSTRING, (st), (i), (val))
+# define sk_ASN1_GENERALSTRING_zero(st) SKM_sk_zero(ASN1_GENERALSTRING, (st))
+# define sk_ASN1_GENERALSTRING_push(st, val) SKM_sk_push(ASN1_GENERALSTRING, (st), (val))
+# define sk_ASN1_GENERALSTRING_unshift(st, val) SKM_sk_unshift(ASN1_GENERALSTRING, (st), (val))
+# define sk_ASN1_GENERALSTRING_find(st, val) SKM_sk_find(ASN1_GENERALSTRING, (st), (val))
+# define sk_ASN1_GENERALSTRING_find_ex(st, val) SKM_sk_find_ex(ASN1_GENERALSTRING, (st), (val))
+# define sk_ASN1_GENERALSTRING_delete(st, i) SKM_sk_delete(ASN1_GENERALSTRING, (st), (i))
+# define sk_ASN1_GENERALSTRING_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_GENERALSTRING, (st), (ptr))
+# define sk_ASN1_GENERALSTRING_insert(st, val, i) SKM_sk_insert(ASN1_GENERALSTRING, (st), (val), (i))
+# define sk_ASN1_GENERALSTRING_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_GENERALSTRING, (st), (cmp))
+# define sk_ASN1_GENERALSTRING_dup(st) SKM_sk_dup(ASN1_GENERALSTRING, st)
+# define sk_ASN1_GENERALSTRING_pop_free(st, free_func) SKM_sk_pop_free(ASN1_GENERALSTRING, (st), (free_func))
+# define sk_ASN1_GENERALSTRING_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASN1_GENERALSTRING, (st), (copy_func), (free_func))
+# define sk_ASN1_GENERALSTRING_shift(st) SKM_sk_shift(ASN1_GENERALSTRING, (st))
+# define sk_ASN1_GENERALSTRING_pop(st) SKM_sk_pop(ASN1_GENERALSTRING, (st))
+# define sk_ASN1_GENERALSTRING_sort(st) SKM_sk_sort(ASN1_GENERALSTRING, (st))
+# define sk_ASN1_GENERALSTRING_is_sorted(st) SKM_sk_is_sorted(ASN1_GENERALSTRING, (st))
+# define sk_ASN1_INTEGER_new(cmp) SKM_sk_new(ASN1_INTEGER, (cmp))
+# define sk_ASN1_INTEGER_new_null() SKM_sk_new_null(ASN1_INTEGER)
+# define sk_ASN1_INTEGER_free(st) SKM_sk_free(ASN1_INTEGER, (st))
+# define sk_ASN1_INTEGER_num(st) SKM_sk_num(ASN1_INTEGER, (st))
+# define sk_ASN1_INTEGER_value(st, i) SKM_sk_value(ASN1_INTEGER, (st), (i))
+# define sk_ASN1_INTEGER_set(st, i, val) SKM_sk_set(ASN1_INTEGER, (st), (i), (val))
+# define sk_ASN1_INTEGER_zero(st) SKM_sk_zero(ASN1_INTEGER, (st))
+# define sk_ASN1_INTEGER_push(st, val) SKM_sk_push(ASN1_INTEGER, (st), (val))
+# define sk_ASN1_INTEGER_unshift(st, val) SKM_sk_unshift(ASN1_INTEGER, (st), (val))
+# define sk_ASN1_INTEGER_find(st, val) SKM_sk_find(ASN1_INTEGER, (st), (val))
+# define sk_ASN1_INTEGER_find_ex(st, val) SKM_sk_find_ex(ASN1_INTEGER, (st), (val))
+# define sk_ASN1_INTEGER_delete(st, i) SKM_sk_delete(ASN1_INTEGER, (st), (i))
+# define sk_ASN1_INTEGER_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_INTEGER, (st), (ptr))
+# define sk_ASN1_INTEGER_insert(st, val, i) SKM_sk_insert(ASN1_INTEGER, (st), (val), (i))
+# define sk_ASN1_INTEGER_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_INTEGER, (st), (cmp))
+# define sk_ASN1_INTEGER_dup(st) SKM_sk_dup(ASN1_INTEGER, st)
+# define sk_ASN1_INTEGER_pop_free(st, free_func) SKM_sk_pop_free(ASN1_INTEGER, (st), (free_func))
+# define sk_ASN1_INTEGER_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASN1_INTEGER, (st), (copy_func), (free_func))
+# define sk_ASN1_INTEGER_shift(st) SKM_sk_shift(ASN1_INTEGER, (st))
+# define sk_ASN1_INTEGER_pop(st) SKM_sk_pop(ASN1_INTEGER, (st))
+# define sk_ASN1_INTEGER_sort(st) SKM_sk_sort(ASN1_INTEGER, (st))
+# define sk_ASN1_INTEGER_is_sorted(st) SKM_sk_is_sorted(ASN1_INTEGER, (st))
+# define sk_ASN1_OBJECT_new(cmp) SKM_sk_new(ASN1_OBJECT, (cmp))
+# define sk_ASN1_OBJECT_new_null() SKM_sk_new_null(ASN1_OBJECT)
+# define sk_ASN1_OBJECT_free(st) SKM_sk_free(ASN1_OBJECT, (st))
+# define sk_ASN1_OBJECT_num(st) SKM_sk_num(ASN1_OBJECT, (st))
+# define sk_ASN1_OBJECT_value(st, i) SKM_sk_value(ASN1_OBJECT, (st), (i))
+# define sk_ASN1_OBJECT_set(st, i, val) SKM_sk_set(ASN1_OBJECT, (st), (i), (val))
+# define sk_ASN1_OBJECT_zero(st) SKM_sk_zero(ASN1_OBJECT, (st))
+# define sk_ASN1_OBJECT_push(st, val) SKM_sk_push(ASN1_OBJECT, (st), (val))
+# define sk_ASN1_OBJECT_unshift(st, val) SKM_sk_unshift(ASN1_OBJECT, (st), (val))
+# define sk_ASN1_OBJECT_find(st, val) SKM_sk_find(ASN1_OBJECT, (st), (val))
+# define sk_ASN1_OBJECT_find_ex(st, val) SKM_sk_find_ex(ASN1_OBJECT, (st), (val))
+# define sk_ASN1_OBJECT_delete(st, i) SKM_sk_delete(ASN1_OBJECT, (st), (i))
+# define sk_ASN1_OBJECT_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_OBJECT, (st), (ptr))
+# define sk_ASN1_OBJECT_insert(st, val, i) SKM_sk_insert(ASN1_OBJECT, (st), (val), (i))
+# define sk_ASN1_OBJECT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_OBJECT, (st), (cmp))
+# define sk_ASN1_OBJECT_dup(st) SKM_sk_dup(ASN1_OBJECT, st)
+# define sk_ASN1_OBJECT_pop_free(st, free_func) SKM_sk_pop_free(ASN1_OBJECT, (st), (free_func))
+# define sk_ASN1_OBJECT_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASN1_OBJECT, (st), (copy_func), (free_func))
+# define sk_ASN1_OBJECT_shift(st) SKM_sk_shift(ASN1_OBJECT, (st))
+# define sk_ASN1_OBJECT_pop(st) SKM_sk_pop(ASN1_OBJECT, (st))
+# define sk_ASN1_OBJECT_sort(st) SKM_sk_sort(ASN1_OBJECT, (st))
+# define sk_ASN1_OBJECT_is_sorted(st) SKM_sk_is_sorted(ASN1_OBJECT, (st))
+# define sk_ASN1_STRING_TABLE_new(cmp) SKM_sk_new(ASN1_STRING_TABLE, (cmp))
+# define sk_ASN1_STRING_TABLE_new_null() SKM_sk_new_null(ASN1_STRING_TABLE)
+# define sk_ASN1_STRING_TABLE_free(st) SKM_sk_free(ASN1_STRING_TABLE, (st))
+# define sk_ASN1_STRING_TABLE_num(st) SKM_sk_num(ASN1_STRING_TABLE, (st))
+# define sk_ASN1_STRING_TABLE_value(st, i) SKM_sk_value(ASN1_STRING_TABLE, (st), (i))
+# define sk_ASN1_STRING_TABLE_set(st, i, val) SKM_sk_set(ASN1_STRING_TABLE, (st), (i), (val))
+# define sk_ASN1_STRING_TABLE_zero(st) SKM_sk_zero(ASN1_STRING_TABLE, (st))
+# define sk_ASN1_STRING_TABLE_push(st, val) SKM_sk_push(ASN1_STRING_TABLE, (st), (val))
+# define sk_ASN1_STRING_TABLE_unshift(st, val) SKM_sk_unshift(ASN1_STRING_TABLE, (st), (val))
+# define sk_ASN1_STRING_TABLE_find(st, val) SKM_sk_find(ASN1_STRING_TABLE, (st), (val))
+# define sk_ASN1_STRING_TABLE_find_ex(st, val) SKM_sk_find_ex(ASN1_STRING_TABLE, (st), (val))
+# define sk_ASN1_STRING_TABLE_delete(st, i) SKM_sk_delete(ASN1_STRING_TABLE, (st), (i))
+# define sk_ASN1_STRING_TABLE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_STRING_TABLE, (st), (ptr))
+# define sk_ASN1_STRING_TABLE_insert(st, val, i) SKM_sk_insert(ASN1_STRING_TABLE, (st), (val), (i))
+# define sk_ASN1_STRING_TABLE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_STRING_TABLE, (st), (cmp))
+# define sk_ASN1_STRING_TABLE_dup(st) SKM_sk_dup(ASN1_STRING_TABLE, st)
+# define sk_ASN1_STRING_TABLE_pop_free(st, free_func) SKM_sk_pop_free(ASN1_STRING_TABLE, (st), (free_func))
+# define sk_ASN1_STRING_TABLE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASN1_STRING_TABLE, (st), (copy_func), (free_func))
+# define sk_ASN1_STRING_TABLE_shift(st) SKM_sk_shift(ASN1_STRING_TABLE, (st))
+# define sk_ASN1_STRING_TABLE_pop(st) SKM_sk_pop(ASN1_STRING_TABLE, (st))
+# define sk_ASN1_STRING_TABLE_sort(st) SKM_sk_sort(ASN1_STRING_TABLE, (st))
+# define sk_ASN1_STRING_TABLE_is_sorted(st) SKM_sk_is_sorted(ASN1_STRING_TABLE, (st))
+# define sk_ASN1_TYPE_new(cmp) SKM_sk_new(ASN1_TYPE, (cmp))
+# define sk_ASN1_TYPE_new_null() SKM_sk_new_null(ASN1_TYPE)
+# define sk_ASN1_TYPE_free(st) SKM_sk_free(ASN1_TYPE, (st))
+# define sk_ASN1_TYPE_num(st) SKM_sk_num(ASN1_TYPE, (st))
+# define sk_ASN1_TYPE_value(st, i) SKM_sk_value(ASN1_TYPE, (st), (i))
+# define sk_ASN1_TYPE_set(st, i, val) SKM_sk_set(ASN1_TYPE, (st), (i), (val))
+# define sk_ASN1_TYPE_zero(st) SKM_sk_zero(ASN1_TYPE, (st))
+# define sk_ASN1_TYPE_push(st, val) SKM_sk_push(ASN1_TYPE, (st), (val))
+# define sk_ASN1_TYPE_unshift(st, val) SKM_sk_unshift(ASN1_TYPE, (st), (val))
+# define sk_ASN1_TYPE_find(st, val) SKM_sk_find(ASN1_TYPE, (st), (val))
+# define sk_ASN1_TYPE_find_ex(st, val) SKM_sk_find_ex(ASN1_TYPE, (st), (val))
+# define sk_ASN1_TYPE_delete(st, i) SKM_sk_delete(ASN1_TYPE, (st), (i))
+# define sk_ASN1_TYPE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_TYPE, (st), (ptr))
+# define sk_ASN1_TYPE_insert(st, val, i) SKM_sk_insert(ASN1_TYPE, (st), (val), (i))
+# define sk_ASN1_TYPE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_TYPE, (st), (cmp))
+# define sk_ASN1_TYPE_dup(st) SKM_sk_dup(ASN1_TYPE, st)
+# define sk_ASN1_TYPE_pop_free(st, free_func) SKM_sk_pop_free(ASN1_TYPE, (st), (free_func))
+# define sk_ASN1_TYPE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASN1_TYPE, (st), (copy_func), (free_func))
+# define sk_ASN1_TYPE_shift(st) SKM_sk_shift(ASN1_TYPE, (st))
+# define sk_ASN1_TYPE_pop(st) SKM_sk_pop(ASN1_TYPE, (st))
+# define sk_ASN1_TYPE_sort(st) SKM_sk_sort(ASN1_TYPE, (st))
+# define sk_ASN1_TYPE_is_sorted(st) SKM_sk_is_sorted(ASN1_TYPE, (st))
+# define sk_ASN1_UTF8STRING_new(cmp) SKM_sk_new(ASN1_UTF8STRING, (cmp))
+# define sk_ASN1_UTF8STRING_new_null() SKM_sk_new_null(ASN1_UTF8STRING)
+# define sk_ASN1_UTF8STRING_free(st) SKM_sk_free(ASN1_UTF8STRING, (st))
+# define sk_ASN1_UTF8STRING_num(st) SKM_sk_num(ASN1_UTF8STRING, (st))
+# define sk_ASN1_UTF8STRING_value(st, i) SKM_sk_value(ASN1_UTF8STRING, (st), (i))
+# define sk_ASN1_UTF8STRING_set(st, i, val) SKM_sk_set(ASN1_UTF8STRING, (st), (i), (val))
+# define sk_ASN1_UTF8STRING_zero(st) SKM_sk_zero(ASN1_UTF8STRING, (st))
+# define sk_ASN1_UTF8STRING_push(st, val) SKM_sk_push(ASN1_UTF8STRING, (st), (val))
+# define sk_ASN1_UTF8STRING_unshift(st, val) SKM_sk_unshift(ASN1_UTF8STRING, (st), (val))
+# define sk_ASN1_UTF8STRING_find(st, val) SKM_sk_find(ASN1_UTF8STRING, (st), (val))
+# define sk_ASN1_UTF8STRING_find_ex(st, val) SKM_sk_find_ex(ASN1_UTF8STRING, (st), (val))
+# define sk_ASN1_UTF8STRING_delete(st, i) SKM_sk_delete(ASN1_UTF8STRING, (st), (i))
+# define sk_ASN1_UTF8STRING_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_UTF8STRING, (st), (ptr))
+# define sk_ASN1_UTF8STRING_insert(st, val, i) SKM_sk_insert(ASN1_UTF8STRING, (st), (val), (i))
+# define sk_ASN1_UTF8STRING_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_UTF8STRING, (st), (cmp))
+# define sk_ASN1_UTF8STRING_dup(st) SKM_sk_dup(ASN1_UTF8STRING, st)
+# define sk_ASN1_UTF8STRING_pop_free(st, free_func) SKM_sk_pop_free(ASN1_UTF8STRING, (st), (free_func))
+# define sk_ASN1_UTF8STRING_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASN1_UTF8STRING, (st), (copy_func), (free_func))
+# define sk_ASN1_UTF8STRING_shift(st) SKM_sk_shift(ASN1_UTF8STRING, (st))
+# define sk_ASN1_UTF8STRING_pop(st) SKM_sk_pop(ASN1_UTF8STRING, (st))
+# define sk_ASN1_UTF8STRING_sort(st) SKM_sk_sort(ASN1_UTF8STRING, (st))
+# define sk_ASN1_UTF8STRING_is_sorted(st) SKM_sk_is_sorted(ASN1_UTF8STRING, (st))
+# define sk_ASN1_VALUE_new(cmp) SKM_sk_new(ASN1_VALUE, (cmp))
+# define sk_ASN1_VALUE_new_null() SKM_sk_new_null(ASN1_VALUE)
+# define sk_ASN1_VALUE_free(st) SKM_sk_free(ASN1_VALUE, (st))
+# define sk_ASN1_VALUE_num(st) SKM_sk_num(ASN1_VALUE, (st))
+# define sk_ASN1_VALUE_value(st, i) SKM_sk_value(ASN1_VALUE, (st), (i))
+# define sk_ASN1_VALUE_set(st, i, val) SKM_sk_set(ASN1_VALUE, (st), (i), (val))
+# define sk_ASN1_VALUE_zero(st) SKM_sk_zero(ASN1_VALUE, (st))
+# define sk_ASN1_VALUE_push(st, val) SKM_sk_push(ASN1_VALUE, (st), (val))
+# define sk_ASN1_VALUE_unshift(st, val) SKM_sk_unshift(ASN1_VALUE, (st), (val))
+# define sk_ASN1_VALUE_find(st, val) SKM_sk_find(ASN1_VALUE, (st), (val))
+# define sk_ASN1_VALUE_find_ex(st, val) SKM_sk_find_ex(ASN1_VALUE, (st), (val))
+# define sk_ASN1_VALUE_delete(st, i) SKM_sk_delete(ASN1_VALUE, (st), (i))
+# define sk_ASN1_VALUE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_VALUE, (st), (ptr))
+# define sk_ASN1_VALUE_insert(st, val, i) SKM_sk_insert(ASN1_VALUE, (st), (val), (i))
+# define sk_ASN1_VALUE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_VALUE, (st), (cmp))
+# define sk_ASN1_VALUE_dup(st) SKM_sk_dup(ASN1_VALUE, st)
+# define sk_ASN1_VALUE_pop_free(st, free_func) SKM_sk_pop_free(ASN1_VALUE, (st), (free_func))
+# define sk_ASN1_VALUE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASN1_VALUE, (st), (copy_func), (free_func))
+# define sk_ASN1_VALUE_shift(st) SKM_sk_shift(ASN1_VALUE, (st))
+# define sk_ASN1_VALUE_pop(st) SKM_sk_pop(ASN1_VALUE, (st))
+# define sk_ASN1_VALUE_sort(st) SKM_sk_sort(ASN1_VALUE, (st))
+# define sk_ASN1_VALUE_is_sorted(st) SKM_sk_is_sorted(ASN1_VALUE, (st))
+# define sk_BIO_new(cmp) SKM_sk_new(BIO, (cmp))
+# define sk_BIO_new_null() SKM_sk_new_null(BIO)
+# define sk_BIO_free(st) SKM_sk_free(BIO, (st))
+# define sk_BIO_num(st) SKM_sk_num(BIO, (st))
+# define sk_BIO_value(st, i) SKM_sk_value(BIO, (st), (i))
+# define sk_BIO_set(st, i, val) SKM_sk_set(BIO, (st), (i), (val))
+# define sk_BIO_zero(st) SKM_sk_zero(BIO, (st))
+# define sk_BIO_push(st, val) SKM_sk_push(BIO, (st), (val))
+# define sk_BIO_unshift(st, val) SKM_sk_unshift(BIO, (st), (val))
+# define sk_BIO_find(st, val) SKM_sk_find(BIO, (st), (val))
+# define sk_BIO_find_ex(st, val) SKM_sk_find_ex(BIO, (st), (val))
+# define sk_BIO_delete(st, i) SKM_sk_delete(BIO, (st), (i))
+# define sk_BIO_delete_ptr(st, ptr) SKM_sk_delete_ptr(BIO, (st), (ptr))
+# define sk_BIO_insert(st, val, i) SKM_sk_insert(BIO, (st), (val), (i))
+# define sk_BIO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(BIO, (st), (cmp))
+# define sk_BIO_dup(st) SKM_sk_dup(BIO, st)
+# define sk_BIO_pop_free(st, free_func) SKM_sk_pop_free(BIO, (st), (free_func))
+# define sk_BIO_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(BIO, (st), (copy_func), (free_func))
+# define sk_BIO_shift(st) SKM_sk_shift(BIO, (st))
+# define sk_BIO_pop(st) SKM_sk_pop(BIO, (st))
+# define sk_BIO_sort(st) SKM_sk_sort(BIO, (st))
+# define sk_BIO_is_sorted(st) SKM_sk_is_sorted(BIO, (st))
+# define sk_BY_DIR_ENTRY_new(cmp) SKM_sk_new(BY_DIR_ENTRY, (cmp))
+# define sk_BY_DIR_ENTRY_new_null() SKM_sk_new_null(BY_DIR_ENTRY)
+# define sk_BY_DIR_ENTRY_free(st) SKM_sk_free(BY_DIR_ENTRY, (st))
+# define sk_BY_DIR_ENTRY_num(st) SKM_sk_num(BY_DIR_ENTRY, (st))
+# define sk_BY_DIR_ENTRY_value(st, i) SKM_sk_value(BY_DIR_ENTRY, (st), (i))
+# define sk_BY_DIR_ENTRY_set(st, i, val) SKM_sk_set(BY_DIR_ENTRY, (st), (i), (val))
+# define sk_BY_DIR_ENTRY_zero(st) SKM_sk_zero(BY_DIR_ENTRY, (st))
+# define sk_BY_DIR_ENTRY_push(st, val) SKM_sk_push(BY_DIR_ENTRY, (st), (val))
+# define sk_BY_DIR_ENTRY_unshift(st, val) SKM_sk_unshift(BY_DIR_ENTRY, (st), (val))
+# define sk_BY_DIR_ENTRY_find(st, val) SKM_sk_find(BY_DIR_ENTRY, (st), (val))
+# define sk_BY_DIR_ENTRY_find_ex(st, val) SKM_sk_find_ex(BY_DIR_ENTRY, (st), (val))
+# define sk_BY_DIR_ENTRY_delete(st, i) SKM_sk_delete(BY_DIR_ENTRY, (st), (i))
+# define sk_BY_DIR_ENTRY_delete_ptr(st, ptr) SKM_sk_delete_ptr(BY_DIR_ENTRY, (st), (ptr))
+# define sk_BY_DIR_ENTRY_insert(st, val, i) SKM_sk_insert(BY_DIR_ENTRY, (st), (val), (i))
+# define sk_BY_DIR_ENTRY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(BY_DIR_ENTRY, (st), (cmp))
+# define sk_BY_DIR_ENTRY_dup(st) SKM_sk_dup(BY_DIR_ENTRY, st)
+# define sk_BY_DIR_ENTRY_pop_free(st, free_func) SKM_sk_pop_free(BY_DIR_ENTRY, (st), (free_func))
+# define sk_BY_DIR_ENTRY_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(BY_DIR_ENTRY, (st), (copy_func), (free_func))
+# define sk_BY_DIR_ENTRY_shift(st) SKM_sk_shift(BY_DIR_ENTRY, (st))
+# define sk_BY_DIR_ENTRY_pop(st) SKM_sk_pop(BY_DIR_ENTRY, (st))
+# define sk_BY_DIR_ENTRY_sort(st) SKM_sk_sort(BY_DIR_ENTRY, (st))
+# define sk_BY_DIR_ENTRY_is_sorted(st) SKM_sk_is_sorted(BY_DIR_ENTRY, (st))
+# define sk_BY_DIR_HASH_new(cmp) SKM_sk_new(BY_DIR_HASH, (cmp))
+# define sk_BY_DIR_HASH_new_null() SKM_sk_new_null(BY_DIR_HASH)
+# define sk_BY_DIR_HASH_free(st) SKM_sk_free(BY_DIR_HASH, (st))
+# define sk_BY_DIR_HASH_num(st) SKM_sk_num(BY_DIR_HASH, (st))
+# define sk_BY_DIR_HASH_value(st, i) SKM_sk_value(BY_DIR_HASH, (st), (i))
+# define sk_BY_DIR_HASH_set(st, i, val) SKM_sk_set(BY_DIR_HASH, (st), (i), (val))
+# define sk_BY_DIR_HASH_zero(st) SKM_sk_zero(BY_DIR_HASH, (st))
+# define sk_BY_DIR_HASH_push(st, val) SKM_sk_push(BY_DIR_HASH, (st), (val))
+# define sk_BY_DIR_HASH_unshift(st, val) SKM_sk_unshift(BY_DIR_HASH, (st), (val))
+# define sk_BY_DIR_HASH_find(st, val) SKM_sk_find(BY_DIR_HASH, (st), (val))
+# define sk_BY_DIR_HASH_find_ex(st, val) SKM_sk_find_ex(BY_DIR_HASH, (st), (val))
+# define sk_BY_DIR_HASH_delete(st, i) SKM_sk_delete(BY_DIR_HASH, (st), (i))
+# define sk_BY_DIR_HASH_delete_ptr(st, ptr) SKM_sk_delete_ptr(BY_DIR_HASH, (st), (ptr))
+# define sk_BY_DIR_HASH_insert(st, val, i) SKM_sk_insert(BY_DIR_HASH, (st), (val), (i))
+# define sk_BY_DIR_HASH_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(BY_DIR_HASH, (st), (cmp))
+# define sk_BY_DIR_HASH_dup(st) SKM_sk_dup(BY_DIR_HASH, st)
+# define sk_BY_DIR_HASH_pop_free(st, free_func) SKM_sk_pop_free(BY_DIR_HASH, (st), (free_func))
+# define sk_BY_DIR_HASH_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(BY_DIR_HASH, (st), (copy_func), (free_func))
+# define sk_BY_DIR_HASH_shift(st) SKM_sk_shift(BY_DIR_HASH, (st))
+# define sk_BY_DIR_HASH_pop(st) SKM_sk_pop(BY_DIR_HASH, (st))
+# define sk_BY_DIR_HASH_sort(st) SKM_sk_sort(BY_DIR_HASH, (st))
+# define sk_BY_DIR_HASH_is_sorted(st) SKM_sk_is_sorted(BY_DIR_HASH, (st))
+# define sk_CMS_CertificateChoices_new(cmp) SKM_sk_new(CMS_CertificateChoices, (cmp))
+# define sk_CMS_CertificateChoices_new_null() SKM_sk_new_null(CMS_CertificateChoices)
+# define sk_CMS_CertificateChoices_free(st) SKM_sk_free(CMS_CertificateChoices, (st))
+# define sk_CMS_CertificateChoices_num(st) SKM_sk_num(CMS_CertificateChoices, (st))
+# define sk_CMS_CertificateChoices_value(st, i) SKM_sk_value(CMS_CertificateChoices, (st), (i))
+# define sk_CMS_CertificateChoices_set(st, i, val) SKM_sk_set(CMS_CertificateChoices, (st), (i), (val))
+# define sk_CMS_CertificateChoices_zero(st) SKM_sk_zero(CMS_CertificateChoices, (st))
+# define sk_CMS_CertificateChoices_push(st, val) SKM_sk_push(CMS_CertificateChoices, (st), (val))
+# define sk_CMS_CertificateChoices_unshift(st, val) SKM_sk_unshift(CMS_CertificateChoices, (st), (val))
+# define sk_CMS_CertificateChoices_find(st, val) SKM_sk_find(CMS_CertificateChoices, (st), (val))
+# define sk_CMS_CertificateChoices_find_ex(st, val) SKM_sk_find_ex(CMS_CertificateChoices, (st), (val))
+# define sk_CMS_CertificateChoices_delete(st, i) SKM_sk_delete(CMS_CertificateChoices, (st), (i))
+# define sk_CMS_CertificateChoices_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_CertificateChoices, (st), (ptr))
+# define sk_CMS_CertificateChoices_insert(st, val, i) SKM_sk_insert(CMS_CertificateChoices, (st), (val), (i))
+# define sk_CMS_CertificateChoices_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_CertificateChoices, (st), (cmp))
+# define sk_CMS_CertificateChoices_dup(st) SKM_sk_dup(CMS_CertificateChoices, st)
+# define sk_CMS_CertificateChoices_pop_free(st, free_func) SKM_sk_pop_free(CMS_CertificateChoices, (st), (free_func))
+# define sk_CMS_CertificateChoices_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CMS_CertificateChoices, (st), (copy_func), (free_func))
+# define sk_CMS_CertificateChoices_shift(st) SKM_sk_shift(CMS_CertificateChoices, (st))
+# define sk_CMS_CertificateChoices_pop(st) SKM_sk_pop(CMS_CertificateChoices, (st))
+# define sk_CMS_CertificateChoices_sort(st) SKM_sk_sort(CMS_CertificateChoices, (st))
+# define sk_CMS_CertificateChoices_is_sorted(st) SKM_sk_is_sorted(CMS_CertificateChoices, (st))
+# define sk_CMS_RecipientEncryptedKey_new(cmp) SKM_sk_new(CMS_RecipientEncryptedKey, (cmp))
+# define sk_CMS_RecipientEncryptedKey_new_null() SKM_sk_new_null(CMS_RecipientEncryptedKey)
+# define sk_CMS_RecipientEncryptedKey_free(st) SKM_sk_free(CMS_RecipientEncryptedKey, (st))
+# define sk_CMS_RecipientEncryptedKey_num(st) SKM_sk_num(CMS_RecipientEncryptedKey, (st))
+# define sk_CMS_RecipientEncryptedKey_value(st, i) SKM_sk_value(CMS_RecipientEncryptedKey, (st), (i))
+# define sk_CMS_RecipientEncryptedKey_set(st, i, val) SKM_sk_set(CMS_RecipientEncryptedKey, (st), (i), (val))
+# define sk_CMS_RecipientEncryptedKey_zero(st) SKM_sk_zero(CMS_RecipientEncryptedKey, (st))
+# define sk_CMS_RecipientEncryptedKey_push(st, val) SKM_sk_push(CMS_RecipientEncryptedKey, (st), (val))
+# define sk_CMS_RecipientEncryptedKey_unshift(st, val) SKM_sk_unshift(CMS_RecipientEncryptedKey, (st), (val))
+# define sk_CMS_RecipientEncryptedKey_find(st, val) SKM_sk_find(CMS_RecipientEncryptedKey, (st), (val))
+# define sk_CMS_RecipientEncryptedKey_find_ex(st, val) SKM_sk_find_ex(CMS_RecipientEncryptedKey, (st), (val))
+# define sk_CMS_RecipientEncryptedKey_delete(st, i) SKM_sk_delete(CMS_RecipientEncryptedKey, (st), (i))
+# define sk_CMS_RecipientEncryptedKey_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_RecipientEncryptedKey, (st), (ptr))
+# define sk_CMS_RecipientEncryptedKey_insert(st, val, i) SKM_sk_insert(CMS_RecipientEncryptedKey, (st), (val), (i))
+# define sk_CMS_RecipientEncryptedKey_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_RecipientEncryptedKey, (st), (cmp))
+# define sk_CMS_RecipientEncryptedKey_dup(st) SKM_sk_dup(CMS_RecipientEncryptedKey, st)
+# define sk_CMS_RecipientEncryptedKey_pop_free(st, free_func) SKM_sk_pop_free(CMS_RecipientEncryptedKey, (st), (free_func))
+# define sk_CMS_RecipientEncryptedKey_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CMS_RecipientEncryptedKey, (st), (copy_func), (free_func))
+# define sk_CMS_RecipientEncryptedKey_shift(st) SKM_sk_shift(CMS_RecipientEncryptedKey, (st))
+# define sk_CMS_RecipientEncryptedKey_pop(st) SKM_sk_pop(CMS_RecipientEncryptedKey, (st))
+# define sk_CMS_RecipientEncryptedKey_sort(st) SKM_sk_sort(CMS_RecipientEncryptedKey, (st))
+# define sk_CMS_RecipientEncryptedKey_is_sorted(st) SKM_sk_is_sorted(CMS_RecipientEncryptedKey, (st))
+# define sk_CMS_RecipientInfo_new(cmp) SKM_sk_new(CMS_RecipientInfo, (cmp))
+# define sk_CMS_RecipientInfo_new_null() SKM_sk_new_null(CMS_RecipientInfo)
+# define sk_CMS_RecipientInfo_free(st) SKM_sk_free(CMS_RecipientInfo, (st))
+# define sk_CMS_RecipientInfo_num(st) SKM_sk_num(CMS_RecipientInfo, (st))
+# define sk_CMS_RecipientInfo_value(st, i) SKM_sk_value(CMS_RecipientInfo, (st), (i))
+# define sk_CMS_RecipientInfo_set(st, i, val) SKM_sk_set(CMS_RecipientInfo, (st), (i), (val))
+# define sk_CMS_RecipientInfo_zero(st) SKM_sk_zero(CMS_RecipientInfo, (st))
+# define sk_CMS_RecipientInfo_push(st, val) SKM_sk_push(CMS_RecipientInfo, (st), (val))
+# define sk_CMS_RecipientInfo_unshift(st, val) SKM_sk_unshift(CMS_RecipientInfo, (st), (val))
+# define sk_CMS_RecipientInfo_find(st, val) SKM_sk_find(CMS_RecipientInfo, (st), (val))
+# define sk_CMS_RecipientInfo_find_ex(st, val) SKM_sk_find_ex(CMS_RecipientInfo, (st), (val))
+# define sk_CMS_RecipientInfo_delete(st, i) SKM_sk_delete(CMS_RecipientInfo, (st), (i))
+# define sk_CMS_RecipientInfo_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_RecipientInfo, (st), (ptr))
+# define sk_CMS_RecipientInfo_insert(st, val, i) SKM_sk_insert(CMS_RecipientInfo, (st), (val), (i))
+# define sk_CMS_RecipientInfo_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_RecipientInfo, (st), (cmp))
+# define sk_CMS_RecipientInfo_dup(st) SKM_sk_dup(CMS_RecipientInfo, st)
+# define sk_CMS_RecipientInfo_pop_free(st, free_func) SKM_sk_pop_free(CMS_RecipientInfo, (st), (free_func))
+# define sk_CMS_RecipientInfo_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CMS_RecipientInfo, (st), (copy_func), (free_func))
+# define sk_CMS_RecipientInfo_shift(st) SKM_sk_shift(CMS_RecipientInfo, (st))
+# define sk_CMS_RecipientInfo_pop(st) SKM_sk_pop(CMS_RecipientInfo, (st))
+# define sk_CMS_RecipientInfo_sort(st) SKM_sk_sort(CMS_RecipientInfo, (st))
+# define sk_CMS_RecipientInfo_is_sorted(st) SKM_sk_is_sorted(CMS_RecipientInfo, (st))
+# define sk_CMS_RevocationInfoChoice_new(cmp) SKM_sk_new(CMS_RevocationInfoChoice, (cmp))
+# define sk_CMS_RevocationInfoChoice_new_null() SKM_sk_new_null(CMS_RevocationInfoChoice)
+# define sk_CMS_RevocationInfoChoice_free(st) SKM_sk_free(CMS_RevocationInfoChoice, (st))
+# define sk_CMS_RevocationInfoChoice_num(st) SKM_sk_num(CMS_RevocationInfoChoice, (st))
+# define sk_CMS_RevocationInfoChoice_value(st, i) SKM_sk_value(CMS_RevocationInfoChoice, (st), (i))
+# define sk_CMS_RevocationInfoChoice_set(st, i, val) SKM_sk_set(CMS_RevocationInfoChoice, (st), (i), (val))
+# define sk_CMS_RevocationInfoChoice_zero(st) SKM_sk_zero(CMS_RevocationInfoChoice, (st))
+# define sk_CMS_RevocationInfoChoice_push(st, val) SKM_sk_push(CMS_RevocationInfoChoice, (st), (val))
+# define sk_CMS_RevocationInfoChoice_unshift(st, val) SKM_sk_unshift(CMS_RevocationInfoChoice, (st), (val))
+# define sk_CMS_RevocationInfoChoice_find(st, val) SKM_sk_find(CMS_RevocationInfoChoice, (st), (val))
+# define sk_CMS_RevocationInfoChoice_find_ex(st, val) SKM_sk_find_ex(CMS_RevocationInfoChoice, (st), (val))
+# define sk_CMS_RevocationInfoChoice_delete(st, i) SKM_sk_delete(CMS_RevocationInfoChoice, (st), (i))
+# define sk_CMS_RevocationInfoChoice_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_RevocationInfoChoice, (st), (ptr))
+# define sk_CMS_RevocationInfoChoice_insert(st, val, i) SKM_sk_insert(CMS_RevocationInfoChoice, (st), (val), (i))
+# define sk_CMS_RevocationInfoChoice_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_RevocationInfoChoice, (st), (cmp))
+# define sk_CMS_RevocationInfoChoice_dup(st) SKM_sk_dup(CMS_RevocationInfoChoice, st)
+# define sk_CMS_RevocationInfoChoice_pop_free(st, free_func) SKM_sk_pop_free(CMS_RevocationInfoChoice, (st), (free_func))
+# define sk_CMS_RevocationInfoChoice_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CMS_RevocationInfoChoice, (st), (copy_func), (free_func))
+# define sk_CMS_RevocationInfoChoice_shift(st) SKM_sk_shift(CMS_RevocationInfoChoice, (st))
+# define sk_CMS_RevocationInfoChoice_pop(st) SKM_sk_pop(CMS_RevocationInfoChoice, (st))
+# define sk_CMS_RevocationInfoChoice_sort(st) SKM_sk_sort(CMS_RevocationInfoChoice, (st))
+# define sk_CMS_RevocationInfoChoice_is_sorted(st) SKM_sk_is_sorted(CMS_RevocationInfoChoice, (st))
+# define sk_CMS_SignerInfo_new(cmp) SKM_sk_new(CMS_SignerInfo, (cmp))
+# define sk_CMS_SignerInfo_new_null() SKM_sk_new_null(CMS_SignerInfo)
+# define sk_CMS_SignerInfo_free(st) SKM_sk_free(CMS_SignerInfo, (st))
+# define sk_CMS_SignerInfo_num(st) SKM_sk_num(CMS_SignerInfo, (st))
+# define sk_CMS_SignerInfo_value(st, i) SKM_sk_value(CMS_SignerInfo, (st), (i))
+# define sk_CMS_SignerInfo_set(st, i, val) SKM_sk_set(CMS_SignerInfo, (st), (i), (val))
+# define sk_CMS_SignerInfo_zero(st) SKM_sk_zero(CMS_SignerInfo, (st))
+# define sk_CMS_SignerInfo_push(st, val) SKM_sk_push(CMS_SignerInfo, (st), (val))
+# define sk_CMS_SignerInfo_unshift(st, val) SKM_sk_unshift(CMS_SignerInfo, (st), (val))
+# define sk_CMS_SignerInfo_find(st, val) SKM_sk_find(CMS_SignerInfo, (st), (val))
+# define sk_CMS_SignerInfo_find_ex(st, val) SKM_sk_find_ex(CMS_SignerInfo, (st), (val))
+# define sk_CMS_SignerInfo_delete(st, i) SKM_sk_delete(CMS_SignerInfo, (st), (i))
+# define sk_CMS_SignerInfo_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_SignerInfo, (st), (ptr))
+# define sk_CMS_SignerInfo_insert(st, val, i) SKM_sk_insert(CMS_SignerInfo, (st), (val), (i))
+# define sk_CMS_SignerInfo_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_SignerInfo, (st), (cmp))
+# define sk_CMS_SignerInfo_dup(st) SKM_sk_dup(CMS_SignerInfo, st)
+# define sk_CMS_SignerInfo_pop_free(st, free_func) SKM_sk_pop_free(CMS_SignerInfo, (st), (free_func))
+# define sk_CMS_SignerInfo_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CMS_SignerInfo, (st), (copy_func), (free_func))
+# define sk_CMS_SignerInfo_shift(st) SKM_sk_shift(CMS_SignerInfo, (st))
+# define sk_CMS_SignerInfo_pop(st) SKM_sk_pop(CMS_SignerInfo, (st))
+# define sk_CMS_SignerInfo_sort(st) SKM_sk_sort(CMS_SignerInfo, (st))
+# define sk_CMS_SignerInfo_is_sorted(st) SKM_sk_is_sorted(CMS_SignerInfo, (st))
+# define sk_CONF_IMODULE_new(cmp) SKM_sk_new(CONF_IMODULE, (cmp))
+# define sk_CONF_IMODULE_new_null() SKM_sk_new_null(CONF_IMODULE)
+# define sk_CONF_IMODULE_free(st) SKM_sk_free(CONF_IMODULE, (st))
+# define sk_CONF_IMODULE_num(st) SKM_sk_num(CONF_IMODULE, (st))
+# define sk_CONF_IMODULE_value(st, i) SKM_sk_value(CONF_IMODULE, (st), (i))
+# define sk_CONF_IMODULE_set(st, i, val) SKM_sk_set(CONF_IMODULE, (st), (i), (val))
+# define sk_CONF_IMODULE_zero(st) SKM_sk_zero(CONF_IMODULE, (st))
+# define sk_CONF_IMODULE_push(st, val) SKM_sk_push(CONF_IMODULE, (st), (val))
+# define sk_CONF_IMODULE_unshift(st, val) SKM_sk_unshift(CONF_IMODULE, (st), (val))
+# define sk_CONF_IMODULE_find(st, val) SKM_sk_find(CONF_IMODULE, (st), (val))
+# define sk_CONF_IMODULE_find_ex(st, val) SKM_sk_find_ex(CONF_IMODULE, (st), (val))
+# define sk_CONF_IMODULE_delete(st, i) SKM_sk_delete(CONF_IMODULE, (st), (i))
+# define sk_CONF_IMODULE_delete_ptr(st, ptr) SKM_sk_delete_ptr(CONF_IMODULE, (st), (ptr))
+# define sk_CONF_IMODULE_insert(st, val, i) SKM_sk_insert(CONF_IMODULE, (st), (val), (i))
+# define sk_CONF_IMODULE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CONF_IMODULE, (st), (cmp))
+# define sk_CONF_IMODULE_dup(st) SKM_sk_dup(CONF_IMODULE, st)
+# define sk_CONF_IMODULE_pop_free(st, free_func) SKM_sk_pop_free(CONF_IMODULE, (st), (free_func))
+# define sk_CONF_IMODULE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CONF_IMODULE, (st), (copy_func), (free_func))
+# define sk_CONF_IMODULE_shift(st) SKM_sk_shift(CONF_IMODULE, (st))
+# define sk_CONF_IMODULE_pop(st) SKM_sk_pop(CONF_IMODULE, (st))
+# define sk_CONF_IMODULE_sort(st) SKM_sk_sort(CONF_IMODULE, (st))
+# define sk_CONF_IMODULE_is_sorted(st) SKM_sk_is_sorted(CONF_IMODULE, (st))
+# define sk_CONF_MODULE_new(cmp) SKM_sk_new(CONF_MODULE, (cmp))
+# define sk_CONF_MODULE_new_null() SKM_sk_new_null(CONF_MODULE)
+# define sk_CONF_MODULE_free(st) SKM_sk_free(CONF_MODULE, (st))
+# define sk_CONF_MODULE_num(st) SKM_sk_num(CONF_MODULE, (st))
+# define sk_CONF_MODULE_value(st, i) SKM_sk_value(CONF_MODULE, (st), (i))
+# define sk_CONF_MODULE_set(st, i, val) SKM_sk_set(CONF_MODULE, (st), (i), (val))
+# define sk_CONF_MODULE_zero(st) SKM_sk_zero(CONF_MODULE, (st))
+# define sk_CONF_MODULE_push(st, val) SKM_sk_push(CONF_MODULE, (st), (val))
+# define sk_CONF_MODULE_unshift(st, val) SKM_sk_unshift(CONF_MODULE, (st), (val))
+# define sk_CONF_MODULE_find(st, val) SKM_sk_find(CONF_MODULE, (st), (val))
+# define sk_CONF_MODULE_find_ex(st, val) SKM_sk_find_ex(CONF_MODULE, (st), (val))
+# define sk_CONF_MODULE_delete(st, i) SKM_sk_delete(CONF_MODULE, (st), (i))
+# define sk_CONF_MODULE_delete_ptr(st, ptr) SKM_sk_delete_ptr(CONF_MODULE, (st), (ptr))
+# define sk_CONF_MODULE_insert(st, val, i) SKM_sk_insert(CONF_MODULE, (st), (val), (i))
+# define sk_CONF_MODULE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CONF_MODULE, (st), (cmp))
+# define sk_CONF_MODULE_dup(st) SKM_sk_dup(CONF_MODULE, st)
+# define sk_CONF_MODULE_pop_free(st, free_func) SKM_sk_pop_free(CONF_MODULE, (st), (free_func))
+# define sk_CONF_MODULE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CONF_MODULE, (st), (copy_func), (free_func))
+# define sk_CONF_MODULE_shift(st) SKM_sk_shift(CONF_MODULE, (st))
+# define sk_CONF_MODULE_pop(st) SKM_sk_pop(CONF_MODULE, (st))
+# define sk_CONF_MODULE_sort(st) SKM_sk_sort(CONF_MODULE, (st))
+# define sk_CONF_MODULE_is_sorted(st) SKM_sk_is_sorted(CONF_MODULE, (st))
+# define sk_CONF_VALUE_new(cmp) SKM_sk_new(CONF_VALUE, (cmp))
+# define sk_CONF_VALUE_new_null() SKM_sk_new_null(CONF_VALUE)
+# define sk_CONF_VALUE_free(st) SKM_sk_free(CONF_VALUE, (st))
+# define sk_CONF_VALUE_num(st) SKM_sk_num(CONF_VALUE, (st))
+# define sk_CONF_VALUE_value(st, i) SKM_sk_value(CONF_VALUE, (st), (i))
+# define sk_CONF_VALUE_set(st, i, val) SKM_sk_set(CONF_VALUE, (st), (i), (val))
+# define sk_CONF_VALUE_zero(st) SKM_sk_zero(CONF_VALUE, (st))
+# define sk_CONF_VALUE_push(st, val) SKM_sk_push(CONF_VALUE, (st), (val))
+# define sk_CONF_VALUE_unshift(st, val) SKM_sk_unshift(CONF_VALUE, (st), (val))
+# define sk_CONF_VALUE_find(st, val) SKM_sk_find(CONF_VALUE, (st), (val))
+# define sk_CONF_VALUE_find_ex(st, val) SKM_sk_find_ex(CONF_VALUE, (st), (val))
+# define sk_CONF_VALUE_delete(st, i) SKM_sk_delete(CONF_VALUE, (st), (i))
+# define sk_CONF_VALUE_delete_ptr(st, ptr) SKM_sk_delete_ptr(CONF_VALUE, (st), (ptr))
+# define sk_CONF_VALUE_insert(st, val, i) SKM_sk_insert(CONF_VALUE, (st), (val), (i))
+# define sk_CONF_VALUE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CONF_VALUE, (st), (cmp))
+# define sk_CONF_VALUE_dup(st) SKM_sk_dup(CONF_VALUE, st)
+# define sk_CONF_VALUE_pop_free(st, free_func) SKM_sk_pop_free(CONF_VALUE, (st), (free_func))
+# define sk_CONF_VALUE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CONF_VALUE, (st), (copy_func), (free_func))
+# define sk_CONF_VALUE_shift(st) SKM_sk_shift(CONF_VALUE, (st))
+# define sk_CONF_VALUE_pop(st) SKM_sk_pop(CONF_VALUE, (st))
+# define sk_CONF_VALUE_sort(st) SKM_sk_sort(CONF_VALUE, (st))
+# define sk_CONF_VALUE_is_sorted(st) SKM_sk_is_sorted(CONF_VALUE, (st))
+# define sk_CRYPTO_EX_DATA_FUNCS_new(cmp) SKM_sk_new(CRYPTO_EX_DATA_FUNCS, (cmp))
+# define sk_CRYPTO_EX_DATA_FUNCS_new_null() SKM_sk_new_null(CRYPTO_EX_DATA_FUNCS)
+# define sk_CRYPTO_EX_DATA_FUNCS_free(st) SKM_sk_free(CRYPTO_EX_DATA_FUNCS, (st))
+# define sk_CRYPTO_EX_DATA_FUNCS_num(st) SKM_sk_num(CRYPTO_EX_DATA_FUNCS, (st))
+# define sk_CRYPTO_EX_DATA_FUNCS_value(st, i) SKM_sk_value(CRYPTO_EX_DATA_FUNCS, (st), (i))
+# define sk_CRYPTO_EX_DATA_FUNCS_set(st, i, val) SKM_sk_set(CRYPTO_EX_DATA_FUNCS, (st), (i), (val))
+# define sk_CRYPTO_EX_DATA_FUNCS_zero(st) SKM_sk_zero(CRYPTO_EX_DATA_FUNCS, (st))
+# define sk_CRYPTO_EX_DATA_FUNCS_push(st, val) SKM_sk_push(CRYPTO_EX_DATA_FUNCS, (st), (val))
+# define sk_CRYPTO_EX_DATA_FUNCS_unshift(st, val) SKM_sk_unshift(CRYPTO_EX_DATA_FUNCS, (st), (val))
+# define sk_CRYPTO_EX_DATA_FUNCS_find(st, val) SKM_sk_find(CRYPTO_EX_DATA_FUNCS, (st), (val))
+# define sk_CRYPTO_EX_DATA_FUNCS_find_ex(st, val) SKM_sk_find_ex(CRYPTO_EX_DATA_FUNCS, (st), (val))
+# define sk_CRYPTO_EX_DATA_FUNCS_delete(st, i) SKM_sk_delete(CRYPTO_EX_DATA_FUNCS, (st), (i))
+# define sk_CRYPTO_EX_DATA_FUNCS_delete_ptr(st, ptr) SKM_sk_delete_ptr(CRYPTO_EX_DATA_FUNCS, (st), (ptr))
+# define sk_CRYPTO_EX_DATA_FUNCS_insert(st, val, i) SKM_sk_insert(CRYPTO_EX_DATA_FUNCS, (st), (val), (i))
+# define sk_CRYPTO_EX_DATA_FUNCS_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CRYPTO_EX_DATA_FUNCS, (st), (cmp))
+# define sk_CRYPTO_EX_DATA_FUNCS_dup(st) SKM_sk_dup(CRYPTO_EX_DATA_FUNCS, st)
+# define sk_CRYPTO_EX_DATA_FUNCS_pop_free(st, free_func) SKM_sk_pop_free(CRYPTO_EX_DATA_FUNCS, (st), (free_func))
+# define sk_CRYPTO_EX_DATA_FUNCS_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CRYPTO_EX_DATA_FUNCS, (st), (copy_func), (free_func))
+# define sk_CRYPTO_EX_DATA_FUNCS_shift(st) SKM_sk_shift(CRYPTO_EX_DATA_FUNCS, (st))
+# define sk_CRYPTO_EX_DATA_FUNCS_pop(st) SKM_sk_pop(CRYPTO_EX_DATA_FUNCS, (st))
+# define sk_CRYPTO_EX_DATA_FUNCS_sort(st) SKM_sk_sort(CRYPTO_EX_DATA_FUNCS, (st))
+# define sk_CRYPTO_EX_DATA_FUNCS_is_sorted(st) SKM_sk_is_sorted(CRYPTO_EX_DATA_FUNCS, (st))
+# define sk_CRYPTO_dynlock_new(cmp) SKM_sk_new(CRYPTO_dynlock, (cmp))
+# define sk_CRYPTO_dynlock_new_null() SKM_sk_new_null(CRYPTO_dynlock)
+# define sk_CRYPTO_dynlock_free(st) SKM_sk_free(CRYPTO_dynlock, (st))
+# define sk_CRYPTO_dynlock_num(st) SKM_sk_num(CRYPTO_dynlock, (st))
+# define sk_CRYPTO_dynlock_value(st, i) SKM_sk_value(CRYPTO_dynlock, (st), (i))
+# define sk_CRYPTO_dynlock_set(st, i, val) SKM_sk_set(CRYPTO_dynlock, (st), (i), (val))
+# define sk_CRYPTO_dynlock_zero(st) SKM_sk_zero(CRYPTO_dynlock, (st))
+# define sk_CRYPTO_dynlock_push(st, val) SKM_sk_push(CRYPTO_dynlock, (st), (val))
+# define sk_CRYPTO_dynlock_unshift(st, val) SKM_sk_unshift(CRYPTO_dynlock, (st), (val))
+# define sk_CRYPTO_dynlock_find(st, val) SKM_sk_find(CRYPTO_dynlock, (st), (val))
+# define sk_CRYPTO_dynlock_find_ex(st, val) SKM_sk_find_ex(CRYPTO_dynlock, (st), (val))
+# define sk_CRYPTO_dynlock_delete(st, i) SKM_sk_delete(CRYPTO_dynlock, (st), (i))
+# define sk_CRYPTO_dynlock_delete_ptr(st, ptr) SKM_sk_delete_ptr(CRYPTO_dynlock, (st), (ptr))
+# define sk_CRYPTO_dynlock_insert(st, val, i) SKM_sk_insert(CRYPTO_dynlock, (st), (val), (i))
+# define sk_CRYPTO_dynlock_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CRYPTO_dynlock, (st), (cmp))
+# define sk_CRYPTO_dynlock_dup(st) SKM_sk_dup(CRYPTO_dynlock, st)
+# define sk_CRYPTO_dynlock_pop_free(st, free_func) SKM_sk_pop_free(CRYPTO_dynlock, (st), (free_func))
+# define sk_CRYPTO_dynlock_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CRYPTO_dynlock, (st), (copy_func), (free_func))
+# define sk_CRYPTO_dynlock_shift(st) SKM_sk_shift(CRYPTO_dynlock, (st))
+# define sk_CRYPTO_dynlock_pop(st) SKM_sk_pop(CRYPTO_dynlock, (st))
+# define sk_CRYPTO_dynlock_sort(st) SKM_sk_sort(CRYPTO_dynlock, (st))
+# define sk_CRYPTO_dynlock_is_sorted(st) SKM_sk_is_sorted(CRYPTO_dynlock, (st))
+# define sk_DIST_POINT_new(cmp) SKM_sk_new(DIST_POINT, (cmp))
+# define sk_DIST_POINT_new_null() SKM_sk_new_null(DIST_POINT)
+# define sk_DIST_POINT_free(st) SKM_sk_free(DIST_POINT, (st))
+# define sk_DIST_POINT_num(st) SKM_sk_num(DIST_POINT, (st))
+# define sk_DIST_POINT_value(st, i) SKM_sk_value(DIST_POINT, (st), (i))
+# define sk_DIST_POINT_set(st, i, val) SKM_sk_set(DIST_POINT, (st), (i), (val))
+# define sk_DIST_POINT_zero(st) SKM_sk_zero(DIST_POINT, (st))
+# define sk_DIST_POINT_push(st, val) SKM_sk_push(DIST_POINT, (st), (val))
+# define sk_DIST_POINT_unshift(st, val) SKM_sk_unshift(DIST_POINT, (st), (val))
+# define sk_DIST_POINT_find(st, val) SKM_sk_find(DIST_POINT, (st), (val))
+# define sk_DIST_POINT_find_ex(st, val) SKM_sk_find_ex(DIST_POINT, (st), (val))
+# define sk_DIST_POINT_delete(st, i) SKM_sk_delete(DIST_POINT, (st), (i))
+# define sk_DIST_POINT_delete_ptr(st, ptr) SKM_sk_delete_ptr(DIST_POINT, (st), (ptr))
+# define sk_DIST_POINT_insert(st, val, i) SKM_sk_insert(DIST_POINT, (st), (val), (i))
+# define sk_DIST_POINT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(DIST_POINT, (st), (cmp))
+# define sk_DIST_POINT_dup(st) SKM_sk_dup(DIST_POINT, st)
+# define sk_DIST_POINT_pop_free(st, free_func) SKM_sk_pop_free(DIST_POINT, (st), (free_func))
+# define sk_DIST_POINT_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(DIST_POINT, (st), (copy_func), (free_func))
+# define sk_DIST_POINT_shift(st) SKM_sk_shift(DIST_POINT, (st))
+# define sk_DIST_POINT_pop(st) SKM_sk_pop(DIST_POINT, (st))
+# define sk_DIST_POINT_sort(st) SKM_sk_sort(DIST_POINT, (st))
+# define sk_DIST_POINT_is_sorted(st) SKM_sk_is_sorted(DIST_POINT, (st))
+# define sk_ENGINE_new(cmp) SKM_sk_new(ENGINE, (cmp))
+# define sk_ENGINE_new_null() SKM_sk_new_null(ENGINE)
+# define sk_ENGINE_free(st) SKM_sk_free(ENGINE, (st))
+# define sk_ENGINE_num(st) SKM_sk_num(ENGINE, (st))
+# define sk_ENGINE_value(st, i) SKM_sk_value(ENGINE, (st), (i))
+# define sk_ENGINE_set(st, i, val) SKM_sk_set(ENGINE, (st), (i), (val))
+# define sk_ENGINE_zero(st) SKM_sk_zero(ENGINE, (st))
+# define sk_ENGINE_push(st, val) SKM_sk_push(ENGINE, (st), (val))
+# define sk_ENGINE_unshift(st, val) SKM_sk_unshift(ENGINE, (st), (val))
+# define sk_ENGINE_find(st, val) SKM_sk_find(ENGINE, (st), (val))
+# define sk_ENGINE_find_ex(st, val) SKM_sk_find_ex(ENGINE, (st), (val))
+# define sk_ENGINE_delete(st, i) SKM_sk_delete(ENGINE, (st), (i))
+# define sk_ENGINE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ENGINE, (st), (ptr))
+# define sk_ENGINE_insert(st, val, i) SKM_sk_insert(ENGINE, (st), (val), (i))
+# define sk_ENGINE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ENGINE, (st), (cmp))
+# define sk_ENGINE_dup(st) SKM_sk_dup(ENGINE, st)
+# define sk_ENGINE_pop_free(st, free_func) SKM_sk_pop_free(ENGINE, (st), (free_func))
+# define sk_ENGINE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ENGINE, (st), (copy_func), (free_func))
+# define sk_ENGINE_shift(st) SKM_sk_shift(ENGINE, (st))
+# define sk_ENGINE_pop(st) SKM_sk_pop(ENGINE, (st))
+# define sk_ENGINE_sort(st) SKM_sk_sort(ENGINE, (st))
+# define sk_ENGINE_is_sorted(st) SKM_sk_is_sorted(ENGINE, (st))
+# define sk_ENGINE_CLEANUP_ITEM_new(cmp) SKM_sk_new(ENGINE_CLEANUP_ITEM, (cmp))
+# define sk_ENGINE_CLEANUP_ITEM_new_null() SKM_sk_new_null(ENGINE_CLEANUP_ITEM)
+# define sk_ENGINE_CLEANUP_ITEM_free(st) SKM_sk_free(ENGINE_CLEANUP_ITEM, (st))
+# define sk_ENGINE_CLEANUP_ITEM_num(st) SKM_sk_num(ENGINE_CLEANUP_ITEM, (st))
+# define sk_ENGINE_CLEANUP_ITEM_value(st, i) SKM_sk_value(ENGINE_CLEANUP_ITEM, (st), (i))
+# define sk_ENGINE_CLEANUP_ITEM_set(st, i, val) SKM_sk_set(ENGINE_CLEANUP_ITEM, (st), (i), (val))
+# define sk_ENGINE_CLEANUP_ITEM_zero(st) SKM_sk_zero(ENGINE_CLEANUP_ITEM, (st))
+# define sk_ENGINE_CLEANUP_ITEM_push(st, val) SKM_sk_push(ENGINE_CLEANUP_ITEM, (st), (val))
+# define sk_ENGINE_CLEANUP_ITEM_unshift(st, val) SKM_sk_unshift(ENGINE_CLEANUP_ITEM, (st), (val))
+# define sk_ENGINE_CLEANUP_ITEM_find(st, val) SKM_sk_find(ENGINE_CLEANUP_ITEM, (st), (val))
+# define sk_ENGINE_CLEANUP_ITEM_find_ex(st, val) SKM_sk_find_ex(ENGINE_CLEANUP_ITEM, (st), (val))
+# define sk_ENGINE_CLEANUP_ITEM_delete(st, i) SKM_sk_delete(ENGINE_CLEANUP_ITEM, (st), (i))
+# define sk_ENGINE_CLEANUP_ITEM_delete_ptr(st, ptr) SKM_sk_delete_ptr(ENGINE_CLEANUP_ITEM, (st), (ptr))
+# define sk_ENGINE_CLEANUP_ITEM_insert(st, val, i) SKM_sk_insert(ENGINE_CLEANUP_ITEM, (st), (val), (i))
+# define sk_ENGINE_CLEANUP_ITEM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ENGINE_CLEANUP_ITEM, (st), (cmp))
+# define sk_ENGINE_CLEANUP_ITEM_dup(st) SKM_sk_dup(ENGINE_CLEANUP_ITEM, st)
+# define sk_ENGINE_CLEANUP_ITEM_pop_free(st, free_func) SKM_sk_pop_free(ENGINE_CLEANUP_ITEM, (st), (free_func))
+# define sk_ENGINE_CLEANUP_ITEM_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ENGINE_CLEANUP_ITEM, (st), (copy_func), (free_func))
+# define sk_ENGINE_CLEANUP_ITEM_shift(st) SKM_sk_shift(ENGINE_CLEANUP_ITEM, (st))
+# define sk_ENGINE_CLEANUP_ITEM_pop(st) SKM_sk_pop(ENGINE_CLEANUP_ITEM, (st))
+# define sk_ENGINE_CLEANUP_ITEM_sort(st) SKM_sk_sort(ENGINE_CLEANUP_ITEM, (st))
+# define sk_ENGINE_CLEANUP_ITEM_is_sorted(st) SKM_sk_is_sorted(ENGINE_CLEANUP_ITEM, (st))
+# define sk_ESS_CERT_ID_new(cmp) SKM_sk_new(ESS_CERT_ID, (cmp))
+# define sk_ESS_CERT_ID_new_null() SKM_sk_new_null(ESS_CERT_ID)
+# define sk_ESS_CERT_ID_free(st) SKM_sk_free(ESS_CERT_ID, (st))
+# define sk_ESS_CERT_ID_num(st) SKM_sk_num(ESS_CERT_ID, (st))
+# define sk_ESS_CERT_ID_value(st, i) SKM_sk_value(ESS_CERT_ID, (st), (i))
+# define sk_ESS_CERT_ID_set(st, i, val) SKM_sk_set(ESS_CERT_ID, (st), (i), (val))
+# define sk_ESS_CERT_ID_zero(st) SKM_sk_zero(ESS_CERT_ID, (st))
+# define sk_ESS_CERT_ID_push(st, val) SKM_sk_push(ESS_CERT_ID, (st), (val))
+# define sk_ESS_CERT_ID_unshift(st, val) SKM_sk_unshift(ESS_CERT_ID, (st), (val))
+# define sk_ESS_CERT_ID_find(st, val) SKM_sk_find(ESS_CERT_ID, (st), (val))
+# define sk_ESS_CERT_ID_find_ex(st, val) SKM_sk_find_ex(ESS_CERT_ID, (st), (val))
+# define sk_ESS_CERT_ID_delete(st, i) SKM_sk_delete(ESS_CERT_ID, (st), (i))
+# define sk_ESS_CERT_ID_delete_ptr(st, ptr) SKM_sk_delete_ptr(ESS_CERT_ID, (st), (ptr))
+# define sk_ESS_CERT_ID_insert(st, val, i) SKM_sk_insert(ESS_CERT_ID, (st), (val), (i))
+# define sk_ESS_CERT_ID_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ESS_CERT_ID, (st), (cmp))
+# define sk_ESS_CERT_ID_dup(st) SKM_sk_dup(ESS_CERT_ID, st)
+# define sk_ESS_CERT_ID_pop_free(st, free_func) SKM_sk_pop_free(ESS_CERT_ID, (st), (free_func))
+# define sk_ESS_CERT_ID_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ESS_CERT_ID, (st), (copy_func), (free_func))
+# define sk_ESS_CERT_ID_shift(st) SKM_sk_shift(ESS_CERT_ID, (st))
+# define sk_ESS_CERT_ID_pop(st) SKM_sk_pop(ESS_CERT_ID, (st))
+# define sk_ESS_CERT_ID_sort(st) SKM_sk_sort(ESS_CERT_ID, (st))
+# define sk_ESS_CERT_ID_is_sorted(st) SKM_sk_is_sorted(ESS_CERT_ID, (st))
+# define sk_EVP_MD_new(cmp) SKM_sk_new(EVP_MD, (cmp))
+# define sk_EVP_MD_new_null() SKM_sk_new_null(EVP_MD)
+# define sk_EVP_MD_free(st) SKM_sk_free(EVP_MD, (st))
+# define sk_EVP_MD_num(st) SKM_sk_num(EVP_MD, (st))
+# define sk_EVP_MD_value(st, i) SKM_sk_value(EVP_MD, (st), (i))
+# define sk_EVP_MD_set(st, i, val) SKM_sk_set(EVP_MD, (st), (i), (val))
+# define sk_EVP_MD_zero(st) SKM_sk_zero(EVP_MD, (st))
+# define sk_EVP_MD_push(st, val) SKM_sk_push(EVP_MD, (st), (val))
+# define sk_EVP_MD_unshift(st, val) SKM_sk_unshift(EVP_MD, (st), (val))
+# define sk_EVP_MD_find(st, val) SKM_sk_find(EVP_MD, (st), (val))
+# define sk_EVP_MD_find_ex(st, val) SKM_sk_find_ex(EVP_MD, (st), (val))
+# define sk_EVP_MD_delete(st, i) SKM_sk_delete(EVP_MD, (st), (i))
+# define sk_EVP_MD_delete_ptr(st, ptr) SKM_sk_delete_ptr(EVP_MD, (st), (ptr))
+# define sk_EVP_MD_insert(st, val, i) SKM_sk_insert(EVP_MD, (st), (val), (i))
+# define sk_EVP_MD_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(EVP_MD, (st), (cmp))
+# define sk_EVP_MD_dup(st) SKM_sk_dup(EVP_MD, st)
+# define sk_EVP_MD_pop_free(st, free_func) SKM_sk_pop_free(EVP_MD, (st), (free_func))
+# define sk_EVP_MD_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(EVP_MD, (st), (copy_func), (free_func))
+# define sk_EVP_MD_shift(st) SKM_sk_shift(EVP_MD, (st))
+# define sk_EVP_MD_pop(st) SKM_sk_pop(EVP_MD, (st))
+# define sk_EVP_MD_sort(st) SKM_sk_sort(EVP_MD, (st))
+# define sk_EVP_MD_is_sorted(st) SKM_sk_is_sorted(EVP_MD, (st))
+# define sk_EVP_PBE_CTL_new(cmp) SKM_sk_new(EVP_PBE_CTL, (cmp))
+# define sk_EVP_PBE_CTL_new_null() SKM_sk_new_null(EVP_PBE_CTL)
+# define sk_EVP_PBE_CTL_free(st) SKM_sk_free(EVP_PBE_CTL, (st))
+# define sk_EVP_PBE_CTL_num(st) SKM_sk_num(EVP_PBE_CTL, (st))
+# define sk_EVP_PBE_CTL_value(st, i) SKM_sk_value(EVP_PBE_CTL, (st), (i))
+# define sk_EVP_PBE_CTL_set(st, i, val) SKM_sk_set(EVP_PBE_CTL, (st), (i), (val))
+# define sk_EVP_PBE_CTL_zero(st) SKM_sk_zero(EVP_PBE_CTL, (st))
+# define sk_EVP_PBE_CTL_push(st, val) SKM_sk_push(EVP_PBE_CTL, (st), (val))
+# define sk_EVP_PBE_CTL_unshift(st, val) SKM_sk_unshift(EVP_PBE_CTL, (st), (val))
+# define sk_EVP_PBE_CTL_find(st, val) SKM_sk_find(EVP_PBE_CTL, (st), (val))
+# define sk_EVP_PBE_CTL_find_ex(st, val) SKM_sk_find_ex(EVP_PBE_CTL, (st), (val))
+# define sk_EVP_PBE_CTL_delete(st, i) SKM_sk_delete(EVP_PBE_CTL, (st), (i))
+# define sk_EVP_PBE_CTL_delete_ptr(st, ptr) SKM_sk_delete_ptr(EVP_PBE_CTL, (st), (ptr))
+# define sk_EVP_PBE_CTL_insert(st, val, i) SKM_sk_insert(EVP_PBE_CTL, (st), (val), (i))
+# define sk_EVP_PBE_CTL_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(EVP_PBE_CTL, (st), (cmp))
+# define sk_EVP_PBE_CTL_dup(st) SKM_sk_dup(EVP_PBE_CTL, st)
+# define sk_EVP_PBE_CTL_pop_free(st, free_func) SKM_sk_pop_free(EVP_PBE_CTL, (st), (free_func))
+# define sk_EVP_PBE_CTL_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(EVP_PBE_CTL, (st), (copy_func), (free_func))
+# define sk_EVP_PBE_CTL_shift(st) SKM_sk_shift(EVP_PBE_CTL, (st))
+# define sk_EVP_PBE_CTL_pop(st) SKM_sk_pop(EVP_PBE_CTL, (st))
+# define sk_EVP_PBE_CTL_sort(st) SKM_sk_sort(EVP_PBE_CTL, (st))
+# define sk_EVP_PBE_CTL_is_sorted(st) SKM_sk_is_sorted(EVP_PBE_CTL, (st))
+# define sk_EVP_PKEY_ASN1_METHOD_new(cmp) SKM_sk_new(EVP_PKEY_ASN1_METHOD, (cmp))
+# define sk_EVP_PKEY_ASN1_METHOD_new_null() SKM_sk_new_null(EVP_PKEY_ASN1_METHOD)
+# define sk_EVP_PKEY_ASN1_METHOD_free(st) SKM_sk_free(EVP_PKEY_ASN1_METHOD, (st))
+# define sk_EVP_PKEY_ASN1_METHOD_num(st) SKM_sk_num(EVP_PKEY_ASN1_METHOD, (st))
+# define sk_EVP_PKEY_ASN1_METHOD_value(st, i) SKM_sk_value(EVP_PKEY_ASN1_METHOD, (st), (i))
+# define sk_EVP_PKEY_ASN1_METHOD_set(st, i, val) SKM_sk_set(EVP_PKEY_ASN1_METHOD, (st), (i), (val))
+# define sk_EVP_PKEY_ASN1_METHOD_zero(st) SKM_sk_zero(EVP_PKEY_ASN1_METHOD, (st))
+# define sk_EVP_PKEY_ASN1_METHOD_push(st, val) SKM_sk_push(EVP_PKEY_ASN1_METHOD, (st), (val))
+# define sk_EVP_PKEY_ASN1_METHOD_unshift(st, val) SKM_sk_unshift(EVP_PKEY_ASN1_METHOD, (st), (val))
+# define sk_EVP_PKEY_ASN1_METHOD_find(st, val) SKM_sk_find(EVP_PKEY_ASN1_METHOD, (st), (val))
+# define sk_EVP_PKEY_ASN1_METHOD_find_ex(st, val) SKM_sk_find_ex(EVP_PKEY_ASN1_METHOD, (st), (val))
+# define sk_EVP_PKEY_ASN1_METHOD_delete(st, i) SKM_sk_delete(EVP_PKEY_ASN1_METHOD, (st), (i))
+# define sk_EVP_PKEY_ASN1_METHOD_delete_ptr(st, ptr) SKM_sk_delete_ptr(EVP_PKEY_ASN1_METHOD, (st), (ptr))
+# define sk_EVP_PKEY_ASN1_METHOD_insert(st, val, i) SKM_sk_insert(EVP_PKEY_ASN1_METHOD, (st), (val), (i))
+# define sk_EVP_PKEY_ASN1_METHOD_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(EVP_PKEY_ASN1_METHOD, (st), (cmp))
+# define sk_EVP_PKEY_ASN1_METHOD_dup(st) SKM_sk_dup(EVP_PKEY_ASN1_METHOD, st)
+# define sk_EVP_PKEY_ASN1_METHOD_pop_free(st, free_func) SKM_sk_pop_free(EVP_PKEY_ASN1_METHOD, (st), (free_func))
+# define sk_EVP_PKEY_ASN1_METHOD_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(EVP_PKEY_ASN1_METHOD, (st), (copy_func), (free_func))
+# define sk_EVP_PKEY_ASN1_METHOD_shift(st) SKM_sk_shift(EVP_PKEY_ASN1_METHOD, (st))
+# define sk_EVP_PKEY_ASN1_METHOD_pop(st) SKM_sk_pop(EVP_PKEY_ASN1_METHOD, (st))
+# define sk_EVP_PKEY_ASN1_METHOD_sort(st) SKM_sk_sort(EVP_PKEY_ASN1_METHOD, (st))
+# define sk_EVP_PKEY_ASN1_METHOD_is_sorted(st) SKM_sk_is_sorted(EVP_PKEY_ASN1_METHOD, (st))
+# define sk_EVP_PKEY_METHOD_new(cmp) SKM_sk_new(EVP_PKEY_METHOD, (cmp))
+# define sk_EVP_PKEY_METHOD_new_null() SKM_sk_new_null(EVP_PKEY_METHOD)
+# define sk_EVP_PKEY_METHOD_free(st) SKM_sk_free(EVP_PKEY_METHOD, (st))
+# define sk_EVP_PKEY_METHOD_num(st) SKM_sk_num(EVP_PKEY_METHOD, (st))
+# define sk_EVP_PKEY_METHOD_value(st, i) SKM_sk_value(EVP_PKEY_METHOD, (st), (i))
+# define sk_EVP_PKEY_METHOD_set(st, i, val) SKM_sk_set(EVP_PKEY_METHOD, (st), (i), (val))
+# define sk_EVP_PKEY_METHOD_zero(st) SKM_sk_zero(EVP_PKEY_METHOD, (st))
+# define sk_EVP_PKEY_METHOD_push(st, val) SKM_sk_push(EVP_PKEY_METHOD, (st), (val))
+# define sk_EVP_PKEY_METHOD_unshift(st, val) SKM_sk_unshift(EVP_PKEY_METHOD, (st), (val))
+# define sk_EVP_PKEY_METHOD_find(st, val) SKM_sk_find(EVP_PKEY_METHOD, (st), (val))
+# define sk_EVP_PKEY_METHOD_find_ex(st, val) SKM_sk_find_ex(EVP_PKEY_METHOD, (st), (val))
+# define sk_EVP_PKEY_METHOD_delete(st, i) SKM_sk_delete(EVP_PKEY_METHOD, (st), (i))
+# define sk_EVP_PKEY_METHOD_delete_ptr(st, ptr) SKM_sk_delete_ptr(EVP_PKEY_METHOD, (st), (ptr))
+# define sk_EVP_PKEY_METHOD_insert(st, val, i) SKM_sk_insert(EVP_PKEY_METHOD, (st), (val), (i))
+# define sk_EVP_PKEY_METHOD_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(EVP_PKEY_METHOD, (st), (cmp))
+# define sk_EVP_PKEY_METHOD_dup(st) SKM_sk_dup(EVP_PKEY_METHOD, st)
+# define sk_EVP_PKEY_METHOD_pop_free(st, free_func) SKM_sk_pop_free(EVP_PKEY_METHOD, (st), (free_func))
+# define sk_EVP_PKEY_METHOD_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(EVP_PKEY_METHOD, (st), (copy_func), (free_func))
+# define sk_EVP_PKEY_METHOD_shift(st) SKM_sk_shift(EVP_PKEY_METHOD, (st))
+# define sk_EVP_PKEY_METHOD_pop(st) SKM_sk_pop(EVP_PKEY_METHOD, (st))
+# define sk_EVP_PKEY_METHOD_sort(st) SKM_sk_sort(EVP_PKEY_METHOD, (st))
+# define sk_EVP_PKEY_METHOD_is_sorted(st) SKM_sk_is_sorted(EVP_PKEY_METHOD, (st))
+# define sk_GENERAL_NAME_new(cmp) SKM_sk_new(GENERAL_NAME, (cmp))
+# define sk_GENERAL_NAME_new_null() SKM_sk_new_null(GENERAL_NAME)
+# define sk_GENERAL_NAME_free(st) SKM_sk_free(GENERAL_NAME, (st))
+# define sk_GENERAL_NAME_num(st) SKM_sk_num(GENERAL_NAME, (st))
+# define sk_GENERAL_NAME_value(st, i) SKM_sk_value(GENERAL_NAME, (st), (i))
+# define sk_GENERAL_NAME_set(st, i, val) SKM_sk_set(GENERAL_NAME, (st), (i), (val))
+# define sk_GENERAL_NAME_zero(st) SKM_sk_zero(GENERAL_NAME, (st))
+# define sk_GENERAL_NAME_push(st, val) SKM_sk_push(GENERAL_NAME, (st), (val))
+# define sk_GENERAL_NAME_unshift(st, val) SKM_sk_unshift(GENERAL_NAME, (st), (val))
+# define sk_GENERAL_NAME_find(st, val) SKM_sk_find(GENERAL_NAME, (st), (val))
+# define sk_GENERAL_NAME_find_ex(st, val) SKM_sk_find_ex(GENERAL_NAME, (st), (val))
+# define sk_GENERAL_NAME_delete(st, i) SKM_sk_delete(GENERAL_NAME, (st), (i))
+# define sk_GENERAL_NAME_delete_ptr(st, ptr) SKM_sk_delete_ptr(GENERAL_NAME, (st), (ptr))
+# define sk_GENERAL_NAME_insert(st, val, i) SKM_sk_insert(GENERAL_NAME, (st), (val), (i))
+# define sk_GENERAL_NAME_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(GENERAL_NAME, (st), (cmp))
+# define sk_GENERAL_NAME_dup(st) SKM_sk_dup(GENERAL_NAME, st)
+# define sk_GENERAL_NAME_pop_free(st, free_func) SKM_sk_pop_free(GENERAL_NAME, (st), (free_func))
+# define sk_GENERAL_NAME_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(GENERAL_NAME, (st), (copy_func), (free_func))
+# define sk_GENERAL_NAME_shift(st) SKM_sk_shift(GENERAL_NAME, (st))
+# define sk_GENERAL_NAME_pop(st) SKM_sk_pop(GENERAL_NAME, (st))
+# define sk_GENERAL_NAME_sort(st) SKM_sk_sort(GENERAL_NAME, (st))
+# define sk_GENERAL_NAME_is_sorted(st) SKM_sk_is_sorted(GENERAL_NAME, (st))
+# define sk_GENERAL_NAMES_new(cmp) SKM_sk_new(GENERAL_NAMES, (cmp))
+# define sk_GENERAL_NAMES_new_null() SKM_sk_new_null(GENERAL_NAMES)
+# define sk_GENERAL_NAMES_free(st) SKM_sk_free(GENERAL_NAMES, (st))
+# define sk_GENERAL_NAMES_num(st) SKM_sk_num(GENERAL_NAMES, (st))
+# define sk_GENERAL_NAMES_value(st, i) SKM_sk_value(GENERAL_NAMES, (st), (i))
+# define sk_GENERAL_NAMES_set(st, i, val) SKM_sk_set(GENERAL_NAMES, (st), (i), (val))
+# define sk_GENERAL_NAMES_zero(st) SKM_sk_zero(GENERAL_NAMES, (st))
+# define sk_GENERAL_NAMES_push(st, val) SKM_sk_push(GENERAL_NAMES, (st), (val))
+# define sk_GENERAL_NAMES_unshift(st, val) SKM_sk_unshift(GENERAL_NAMES, (st), (val))
+# define sk_GENERAL_NAMES_find(st, val) SKM_sk_find(GENERAL_NAMES, (st), (val))
+# define sk_GENERAL_NAMES_find_ex(st, val) SKM_sk_find_ex(GENERAL_NAMES, (st), (val))
+# define sk_GENERAL_NAMES_delete(st, i) SKM_sk_delete(GENERAL_NAMES, (st), (i))
+# define sk_GENERAL_NAMES_delete_ptr(st, ptr) SKM_sk_delete_ptr(GENERAL_NAMES, (st), (ptr))
+# define sk_GENERAL_NAMES_insert(st, val, i) SKM_sk_insert(GENERAL_NAMES, (st), (val), (i))
+# define sk_GENERAL_NAMES_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(GENERAL_NAMES, (st), (cmp))
+# define sk_GENERAL_NAMES_dup(st) SKM_sk_dup(GENERAL_NAMES, st)
+# define sk_GENERAL_NAMES_pop_free(st, free_func) SKM_sk_pop_free(GENERAL_NAMES, (st), (free_func))
+# define sk_GENERAL_NAMES_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(GENERAL_NAMES, (st), (copy_func), (free_func))
+# define sk_GENERAL_NAMES_shift(st) SKM_sk_shift(GENERAL_NAMES, (st))
+# define sk_GENERAL_NAMES_pop(st) SKM_sk_pop(GENERAL_NAMES, (st))
+# define sk_GENERAL_NAMES_sort(st) SKM_sk_sort(GENERAL_NAMES, (st))
+# define sk_GENERAL_NAMES_is_sorted(st) SKM_sk_is_sorted(GENERAL_NAMES, (st))
+# define sk_GENERAL_SUBTREE_new(cmp) SKM_sk_new(GENERAL_SUBTREE, (cmp))
+# define sk_GENERAL_SUBTREE_new_null() SKM_sk_new_null(GENERAL_SUBTREE)
+# define sk_GENERAL_SUBTREE_free(st) SKM_sk_free(GENERAL_SUBTREE, (st))
+# define sk_GENERAL_SUBTREE_num(st) SKM_sk_num(GENERAL_SUBTREE, (st))
+# define sk_GENERAL_SUBTREE_value(st, i) SKM_sk_value(GENERAL_SUBTREE, (st), (i))
+# define sk_GENERAL_SUBTREE_set(st, i, val) SKM_sk_set(GENERAL_SUBTREE, (st), (i), (val))
+# define sk_GENERAL_SUBTREE_zero(st) SKM_sk_zero(GENERAL_SUBTREE, (st))
+# define sk_GENERAL_SUBTREE_push(st, val) SKM_sk_push(GENERAL_SUBTREE, (st), (val))
+# define sk_GENERAL_SUBTREE_unshift(st, val) SKM_sk_unshift(GENERAL_SUBTREE, (st), (val))
+# define sk_GENERAL_SUBTREE_find(st, val) SKM_sk_find(GENERAL_SUBTREE, (st), (val))
+# define sk_GENERAL_SUBTREE_find_ex(st, val) SKM_sk_find_ex(GENERAL_SUBTREE, (st), (val))
+# define sk_GENERAL_SUBTREE_delete(st, i) SKM_sk_delete(GENERAL_SUBTREE, (st), (i))
+# define sk_GENERAL_SUBTREE_delete_ptr(st, ptr) SKM_sk_delete_ptr(GENERAL_SUBTREE, (st), (ptr))
+# define sk_GENERAL_SUBTREE_insert(st, val, i) SKM_sk_insert(GENERAL_SUBTREE, (st), (val), (i))
+# define sk_GENERAL_SUBTREE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(GENERAL_SUBTREE, (st), (cmp))
+# define sk_GENERAL_SUBTREE_dup(st) SKM_sk_dup(GENERAL_SUBTREE, st)
+# define sk_GENERAL_SUBTREE_pop_free(st, free_func) SKM_sk_pop_free(GENERAL_SUBTREE, (st), (free_func))
+# define sk_GENERAL_SUBTREE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(GENERAL_SUBTREE, (st), (copy_func), (free_func))
+# define sk_GENERAL_SUBTREE_shift(st) SKM_sk_shift(GENERAL_SUBTREE, (st))
+# define sk_GENERAL_SUBTREE_pop(st) SKM_sk_pop(GENERAL_SUBTREE, (st))
+# define sk_GENERAL_SUBTREE_sort(st) SKM_sk_sort(GENERAL_SUBTREE, (st))
+# define sk_GENERAL_SUBTREE_is_sorted(st) SKM_sk_is_sorted(GENERAL_SUBTREE, (st))
+# define sk_IPAddressFamily_new(cmp) SKM_sk_new(IPAddressFamily, (cmp))
+# define sk_IPAddressFamily_new_null() SKM_sk_new_null(IPAddressFamily)
+# define sk_IPAddressFamily_free(st) SKM_sk_free(IPAddressFamily, (st))
+# define sk_IPAddressFamily_num(st) SKM_sk_num(IPAddressFamily, (st))
+# define sk_IPAddressFamily_value(st, i) SKM_sk_value(IPAddressFamily, (st), (i))
+# define sk_IPAddressFamily_set(st, i, val) SKM_sk_set(IPAddressFamily, (st), (i), (val))
+# define sk_IPAddressFamily_zero(st) SKM_sk_zero(IPAddressFamily, (st))
+# define sk_IPAddressFamily_push(st, val) SKM_sk_push(IPAddressFamily, (st), (val))
+# define sk_IPAddressFamily_unshift(st, val) SKM_sk_unshift(IPAddressFamily, (st), (val))
+# define sk_IPAddressFamily_find(st, val) SKM_sk_find(IPAddressFamily, (st), (val))
+# define sk_IPAddressFamily_find_ex(st, val) SKM_sk_find_ex(IPAddressFamily, (st), (val))
+# define sk_IPAddressFamily_delete(st, i) SKM_sk_delete(IPAddressFamily, (st), (i))
+# define sk_IPAddressFamily_delete_ptr(st, ptr) SKM_sk_delete_ptr(IPAddressFamily, (st), (ptr))
+# define sk_IPAddressFamily_insert(st, val, i) SKM_sk_insert(IPAddressFamily, (st), (val), (i))
+# define sk_IPAddressFamily_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(IPAddressFamily, (st), (cmp))
+# define sk_IPAddressFamily_dup(st) SKM_sk_dup(IPAddressFamily, st)
+# define sk_IPAddressFamily_pop_free(st, free_func) SKM_sk_pop_free(IPAddressFamily, (st), (free_func))
+# define sk_IPAddressFamily_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(IPAddressFamily, (st), (copy_func), (free_func))
+# define sk_IPAddressFamily_shift(st) SKM_sk_shift(IPAddressFamily, (st))
+# define sk_IPAddressFamily_pop(st) SKM_sk_pop(IPAddressFamily, (st))
+# define sk_IPAddressFamily_sort(st) SKM_sk_sort(IPAddressFamily, (st))
+# define sk_IPAddressFamily_is_sorted(st) SKM_sk_is_sorted(IPAddressFamily, (st))
+# define sk_IPAddressOrRange_new(cmp) SKM_sk_new(IPAddressOrRange, (cmp))
+# define sk_IPAddressOrRange_new_null() SKM_sk_new_null(IPAddressOrRange)
+# define sk_IPAddressOrRange_free(st) SKM_sk_free(IPAddressOrRange, (st))
+# define sk_IPAddressOrRange_num(st) SKM_sk_num(IPAddressOrRange, (st))
+# define sk_IPAddressOrRange_value(st, i) SKM_sk_value(IPAddressOrRange, (st), (i))
+# define sk_IPAddressOrRange_set(st, i, val) SKM_sk_set(IPAddressOrRange, (st), (i), (val))
+# define sk_IPAddressOrRange_zero(st) SKM_sk_zero(IPAddressOrRange, (st))
+# define sk_IPAddressOrRange_push(st, val) SKM_sk_push(IPAddressOrRange, (st), (val))
+# define sk_IPAddressOrRange_unshift(st, val) SKM_sk_unshift(IPAddressOrRange, (st), (val))
+# define sk_IPAddressOrRange_find(st, val) SKM_sk_find(IPAddressOrRange, (st), (val))
+# define sk_IPAddressOrRange_find_ex(st, val) SKM_sk_find_ex(IPAddressOrRange, (st), (val))
+# define sk_IPAddressOrRange_delete(st, i) SKM_sk_delete(IPAddressOrRange, (st), (i))
+# define sk_IPAddressOrRange_delete_ptr(st, ptr) SKM_sk_delete_ptr(IPAddressOrRange, (st), (ptr))
+# define sk_IPAddressOrRange_insert(st, val, i) SKM_sk_insert(IPAddressOrRange, (st), (val), (i))
+# define sk_IPAddressOrRange_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(IPAddressOrRange, (st), (cmp))
+# define sk_IPAddressOrRange_dup(st) SKM_sk_dup(IPAddressOrRange, st)
+# define sk_IPAddressOrRange_pop_free(st, free_func) SKM_sk_pop_free(IPAddressOrRange, (st), (free_func))
+# define sk_IPAddressOrRange_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(IPAddressOrRange, (st), (copy_func), (free_func))
+# define sk_IPAddressOrRange_shift(st) SKM_sk_shift(IPAddressOrRange, (st))
+# define sk_IPAddressOrRange_pop(st) SKM_sk_pop(IPAddressOrRange, (st))
+# define sk_IPAddressOrRange_sort(st) SKM_sk_sort(IPAddressOrRange, (st))
+# define sk_IPAddressOrRange_is_sorted(st) SKM_sk_is_sorted(IPAddressOrRange, (st))
+# define sk_KRB5_APREQBODY_new(cmp) SKM_sk_new(KRB5_APREQBODY, (cmp))
+# define sk_KRB5_APREQBODY_new_null() SKM_sk_new_null(KRB5_APREQBODY)
+# define sk_KRB5_APREQBODY_free(st) SKM_sk_free(KRB5_APREQBODY, (st))
+# define sk_KRB5_APREQBODY_num(st) SKM_sk_num(KRB5_APREQBODY, (st))
+# define sk_KRB5_APREQBODY_value(st, i) SKM_sk_value(KRB5_APREQBODY, (st), (i))
+# define sk_KRB5_APREQBODY_set(st, i, val) SKM_sk_set(KRB5_APREQBODY, (st), (i), (val))
+# define sk_KRB5_APREQBODY_zero(st) SKM_sk_zero(KRB5_APREQBODY, (st))
+# define sk_KRB5_APREQBODY_push(st, val) SKM_sk_push(KRB5_APREQBODY, (st), (val))
+# define sk_KRB5_APREQBODY_unshift(st, val) SKM_sk_unshift(KRB5_APREQBODY, (st), (val))
+# define sk_KRB5_APREQBODY_find(st, val) SKM_sk_find(KRB5_APREQBODY, (st), (val))
+# define sk_KRB5_APREQBODY_find_ex(st, val) SKM_sk_find_ex(KRB5_APREQBODY, (st), (val))
+# define sk_KRB5_APREQBODY_delete(st, i) SKM_sk_delete(KRB5_APREQBODY, (st), (i))
+# define sk_KRB5_APREQBODY_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_APREQBODY, (st), (ptr))
+# define sk_KRB5_APREQBODY_insert(st, val, i) SKM_sk_insert(KRB5_APREQBODY, (st), (val), (i))
+# define sk_KRB5_APREQBODY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_APREQBODY, (st), (cmp))
+# define sk_KRB5_APREQBODY_dup(st) SKM_sk_dup(KRB5_APREQBODY, st)
+# define sk_KRB5_APREQBODY_pop_free(st, free_func) SKM_sk_pop_free(KRB5_APREQBODY, (st), (free_func))
+# define sk_KRB5_APREQBODY_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_APREQBODY, (st), (copy_func), (free_func))
+# define sk_KRB5_APREQBODY_shift(st) SKM_sk_shift(KRB5_APREQBODY, (st))
+# define sk_KRB5_APREQBODY_pop(st) SKM_sk_pop(KRB5_APREQBODY, (st))
+# define sk_KRB5_APREQBODY_sort(st) SKM_sk_sort(KRB5_APREQBODY, (st))
+# define sk_KRB5_APREQBODY_is_sorted(st) SKM_sk_is_sorted(KRB5_APREQBODY, (st))
+# define sk_KRB5_AUTHDATA_new(cmp) SKM_sk_new(KRB5_AUTHDATA, (cmp))
+# define sk_KRB5_AUTHDATA_new_null() SKM_sk_new_null(KRB5_AUTHDATA)
+# define sk_KRB5_AUTHDATA_free(st) SKM_sk_free(KRB5_AUTHDATA, (st))
+# define sk_KRB5_AUTHDATA_num(st) SKM_sk_num(KRB5_AUTHDATA, (st))
+# define sk_KRB5_AUTHDATA_value(st, i) SKM_sk_value(KRB5_AUTHDATA, (st), (i))
+# define sk_KRB5_AUTHDATA_set(st, i, val) SKM_sk_set(KRB5_AUTHDATA, (st), (i), (val))
+# define sk_KRB5_AUTHDATA_zero(st) SKM_sk_zero(KRB5_AUTHDATA, (st))
+# define sk_KRB5_AUTHDATA_push(st, val) SKM_sk_push(KRB5_AUTHDATA, (st), (val))
+# define sk_KRB5_AUTHDATA_unshift(st, val) SKM_sk_unshift(KRB5_AUTHDATA, (st), (val))
+# define sk_KRB5_AUTHDATA_find(st, val) SKM_sk_find(KRB5_AUTHDATA, (st), (val))
+# define sk_KRB5_AUTHDATA_find_ex(st, val) SKM_sk_find_ex(KRB5_AUTHDATA, (st), (val))
+# define sk_KRB5_AUTHDATA_delete(st, i) SKM_sk_delete(KRB5_AUTHDATA, (st), (i))
+# define sk_KRB5_AUTHDATA_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_AUTHDATA, (st), (ptr))
+# define sk_KRB5_AUTHDATA_insert(st, val, i) SKM_sk_insert(KRB5_AUTHDATA, (st), (val), (i))
+# define sk_KRB5_AUTHDATA_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_AUTHDATA, (st), (cmp))
+# define sk_KRB5_AUTHDATA_dup(st) SKM_sk_dup(KRB5_AUTHDATA, st)
+# define sk_KRB5_AUTHDATA_pop_free(st, free_func) SKM_sk_pop_free(KRB5_AUTHDATA, (st), (free_func))
+# define sk_KRB5_AUTHDATA_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_AUTHDATA, (st), (copy_func), (free_func))
+# define sk_KRB5_AUTHDATA_shift(st) SKM_sk_shift(KRB5_AUTHDATA, (st))
+# define sk_KRB5_AUTHDATA_pop(st) SKM_sk_pop(KRB5_AUTHDATA, (st))
+# define sk_KRB5_AUTHDATA_sort(st) SKM_sk_sort(KRB5_AUTHDATA, (st))
+# define sk_KRB5_AUTHDATA_is_sorted(st) SKM_sk_is_sorted(KRB5_AUTHDATA, (st))
+# define sk_KRB5_AUTHENTBODY_new(cmp) SKM_sk_new(KRB5_AUTHENTBODY, (cmp))
+# define sk_KRB5_AUTHENTBODY_new_null() SKM_sk_new_null(KRB5_AUTHENTBODY)
+# define sk_KRB5_AUTHENTBODY_free(st) SKM_sk_free(KRB5_AUTHENTBODY, (st))
+# define sk_KRB5_AUTHENTBODY_num(st) SKM_sk_num(KRB5_AUTHENTBODY, (st))
+# define sk_KRB5_AUTHENTBODY_value(st, i) SKM_sk_value(KRB5_AUTHENTBODY, (st), (i))
+# define sk_KRB5_AUTHENTBODY_set(st, i, val) SKM_sk_set(KRB5_AUTHENTBODY, (st), (i), (val))
+# define sk_KRB5_AUTHENTBODY_zero(st) SKM_sk_zero(KRB5_AUTHENTBODY, (st))
+# define sk_KRB5_AUTHENTBODY_push(st, val) SKM_sk_push(KRB5_AUTHENTBODY, (st), (val))
+# define sk_KRB5_AUTHENTBODY_unshift(st, val) SKM_sk_unshift(KRB5_AUTHENTBODY, (st), (val))
+# define sk_KRB5_AUTHENTBODY_find(st, val) SKM_sk_find(KRB5_AUTHENTBODY, (st), (val))
+# define sk_KRB5_AUTHENTBODY_find_ex(st, val) SKM_sk_find_ex(KRB5_AUTHENTBODY, (st), (val))
+# define sk_KRB5_AUTHENTBODY_delete(st, i) SKM_sk_delete(KRB5_AUTHENTBODY, (st), (i))
+# define sk_KRB5_AUTHENTBODY_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_AUTHENTBODY, (st), (ptr))
+# define sk_KRB5_AUTHENTBODY_insert(st, val, i) SKM_sk_insert(KRB5_AUTHENTBODY, (st), (val), (i))
+# define sk_KRB5_AUTHENTBODY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_AUTHENTBODY, (st), (cmp))
+# define sk_KRB5_AUTHENTBODY_dup(st) SKM_sk_dup(KRB5_AUTHENTBODY, st)
+# define sk_KRB5_AUTHENTBODY_pop_free(st, free_func) SKM_sk_pop_free(KRB5_AUTHENTBODY, (st), (free_func))
+# define sk_KRB5_AUTHENTBODY_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_AUTHENTBODY, (st), (copy_func), (free_func))
+# define sk_KRB5_AUTHENTBODY_shift(st) SKM_sk_shift(KRB5_AUTHENTBODY, (st))
+# define sk_KRB5_AUTHENTBODY_pop(st) SKM_sk_pop(KRB5_AUTHENTBODY, (st))
+# define sk_KRB5_AUTHENTBODY_sort(st) SKM_sk_sort(KRB5_AUTHENTBODY, (st))
+# define sk_KRB5_AUTHENTBODY_is_sorted(st) SKM_sk_is_sorted(KRB5_AUTHENTBODY, (st))
+# define sk_KRB5_CHECKSUM_new(cmp) SKM_sk_new(KRB5_CHECKSUM, (cmp))
+# define sk_KRB5_CHECKSUM_new_null() SKM_sk_new_null(KRB5_CHECKSUM)
+# define sk_KRB5_CHECKSUM_free(st) SKM_sk_free(KRB5_CHECKSUM, (st))
+# define sk_KRB5_CHECKSUM_num(st) SKM_sk_num(KRB5_CHECKSUM, (st))
+# define sk_KRB5_CHECKSUM_value(st, i) SKM_sk_value(KRB5_CHECKSUM, (st), (i))
+# define sk_KRB5_CHECKSUM_set(st, i, val) SKM_sk_set(KRB5_CHECKSUM, (st), (i), (val))
+# define sk_KRB5_CHECKSUM_zero(st) SKM_sk_zero(KRB5_CHECKSUM, (st))
+# define sk_KRB5_CHECKSUM_push(st, val) SKM_sk_push(KRB5_CHECKSUM, (st), (val))
+# define sk_KRB5_CHECKSUM_unshift(st, val) SKM_sk_unshift(KRB5_CHECKSUM, (st), (val))
+# define sk_KRB5_CHECKSUM_find(st, val) SKM_sk_find(KRB5_CHECKSUM, (st), (val))
+# define sk_KRB5_CHECKSUM_find_ex(st, val) SKM_sk_find_ex(KRB5_CHECKSUM, (st), (val))
+# define sk_KRB5_CHECKSUM_delete(st, i) SKM_sk_delete(KRB5_CHECKSUM, (st), (i))
+# define sk_KRB5_CHECKSUM_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_CHECKSUM, (st), (ptr))
+# define sk_KRB5_CHECKSUM_insert(st, val, i) SKM_sk_insert(KRB5_CHECKSUM, (st), (val), (i))
+# define sk_KRB5_CHECKSUM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_CHECKSUM, (st), (cmp))
+# define sk_KRB5_CHECKSUM_dup(st) SKM_sk_dup(KRB5_CHECKSUM, st)
+# define sk_KRB5_CHECKSUM_pop_free(st, free_func) SKM_sk_pop_free(KRB5_CHECKSUM, (st), (free_func))
+# define sk_KRB5_CHECKSUM_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_CHECKSUM, (st), (copy_func), (free_func))
+# define sk_KRB5_CHECKSUM_shift(st) SKM_sk_shift(KRB5_CHECKSUM, (st))
+# define sk_KRB5_CHECKSUM_pop(st) SKM_sk_pop(KRB5_CHECKSUM, (st))
+# define sk_KRB5_CHECKSUM_sort(st) SKM_sk_sort(KRB5_CHECKSUM, (st))
+# define sk_KRB5_CHECKSUM_is_sorted(st) SKM_sk_is_sorted(KRB5_CHECKSUM, (st))
+# define sk_KRB5_ENCDATA_new(cmp) SKM_sk_new(KRB5_ENCDATA, (cmp))
+# define sk_KRB5_ENCDATA_new_null() SKM_sk_new_null(KRB5_ENCDATA)
+# define sk_KRB5_ENCDATA_free(st) SKM_sk_free(KRB5_ENCDATA, (st))
+# define sk_KRB5_ENCDATA_num(st) SKM_sk_num(KRB5_ENCDATA, (st))
+# define sk_KRB5_ENCDATA_value(st, i) SKM_sk_value(KRB5_ENCDATA, (st), (i))
+# define sk_KRB5_ENCDATA_set(st, i, val) SKM_sk_set(KRB5_ENCDATA, (st), (i), (val))
+# define sk_KRB5_ENCDATA_zero(st) SKM_sk_zero(KRB5_ENCDATA, (st))
+# define sk_KRB5_ENCDATA_push(st, val) SKM_sk_push(KRB5_ENCDATA, (st), (val))
+# define sk_KRB5_ENCDATA_unshift(st, val) SKM_sk_unshift(KRB5_ENCDATA, (st), (val))
+# define sk_KRB5_ENCDATA_find(st, val) SKM_sk_find(KRB5_ENCDATA, (st), (val))
+# define sk_KRB5_ENCDATA_find_ex(st, val) SKM_sk_find_ex(KRB5_ENCDATA, (st), (val))
+# define sk_KRB5_ENCDATA_delete(st, i) SKM_sk_delete(KRB5_ENCDATA, (st), (i))
+# define sk_KRB5_ENCDATA_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_ENCDATA, (st), (ptr))
+# define sk_KRB5_ENCDATA_insert(st, val, i) SKM_sk_insert(KRB5_ENCDATA, (st), (val), (i))
+# define sk_KRB5_ENCDATA_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_ENCDATA, (st), (cmp))
+# define sk_KRB5_ENCDATA_dup(st) SKM_sk_dup(KRB5_ENCDATA, st)
+# define sk_KRB5_ENCDATA_pop_free(st, free_func) SKM_sk_pop_free(KRB5_ENCDATA, (st), (free_func))
+# define sk_KRB5_ENCDATA_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_ENCDATA, (st), (copy_func), (free_func))
+# define sk_KRB5_ENCDATA_shift(st) SKM_sk_shift(KRB5_ENCDATA, (st))
+# define sk_KRB5_ENCDATA_pop(st) SKM_sk_pop(KRB5_ENCDATA, (st))
+# define sk_KRB5_ENCDATA_sort(st) SKM_sk_sort(KRB5_ENCDATA, (st))
+# define sk_KRB5_ENCDATA_is_sorted(st) SKM_sk_is_sorted(KRB5_ENCDATA, (st))
+# define sk_KRB5_ENCKEY_new(cmp) SKM_sk_new(KRB5_ENCKEY, (cmp))
+# define sk_KRB5_ENCKEY_new_null() SKM_sk_new_null(KRB5_ENCKEY)
+# define sk_KRB5_ENCKEY_free(st) SKM_sk_free(KRB5_ENCKEY, (st))
+# define sk_KRB5_ENCKEY_num(st) SKM_sk_num(KRB5_ENCKEY, (st))
+# define sk_KRB5_ENCKEY_value(st, i) SKM_sk_value(KRB5_ENCKEY, (st), (i))
+# define sk_KRB5_ENCKEY_set(st, i, val) SKM_sk_set(KRB5_ENCKEY, (st), (i), (val))
+# define sk_KRB5_ENCKEY_zero(st) SKM_sk_zero(KRB5_ENCKEY, (st))
+# define sk_KRB5_ENCKEY_push(st, val) SKM_sk_push(KRB5_ENCKEY, (st), (val))
+# define sk_KRB5_ENCKEY_unshift(st, val) SKM_sk_unshift(KRB5_ENCKEY, (st), (val))
+# define sk_KRB5_ENCKEY_find(st, val) SKM_sk_find(KRB5_ENCKEY, (st), (val))
+# define sk_KRB5_ENCKEY_find_ex(st, val) SKM_sk_find_ex(KRB5_ENCKEY, (st), (val))
+# define sk_KRB5_ENCKEY_delete(st, i) SKM_sk_delete(KRB5_ENCKEY, (st), (i))
+# define sk_KRB5_ENCKEY_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_ENCKEY, (st), (ptr))
+# define sk_KRB5_ENCKEY_insert(st, val, i) SKM_sk_insert(KRB5_ENCKEY, (st), (val), (i))
+# define sk_KRB5_ENCKEY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_ENCKEY, (st), (cmp))
+# define sk_KRB5_ENCKEY_dup(st) SKM_sk_dup(KRB5_ENCKEY, st)
+# define sk_KRB5_ENCKEY_pop_free(st, free_func) SKM_sk_pop_free(KRB5_ENCKEY, (st), (free_func))
+# define sk_KRB5_ENCKEY_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_ENCKEY, (st), (copy_func), (free_func))
+# define sk_KRB5_ENCKEY_shift(st) SKM_sk_shift(KRB5_ENCKEY, (st))
+# define sk_KRB5_ENCKEY_pop(st) SKM_sk_pop(KRB5_ENCKEY, (st))
+# define sk_KRB5_ENCKEY_sort(st) SKM_sk_sort(KRB5_ENCKEY, (st))
+# define sk_KRB5_ENCKEY_is_sorted(st) SKM_sk_is_sorted(KRB5_ENCKEY, (st))
+# define sk_KRB5_PRINCNAME_new(cmp) SKM_sk_new(KRB5_PRINCNAME, (cmp))
+# define sk_KRB5_PRINCNAME_new_null() SKM_sk_new_null(KRB5_PRINCNAME)
+# define sk_KRB5_PRINCNAME_free(st) SKM_sk_free(KRB5_PRINCNAME, (st))
+# define sk_KRB5_PRINCNAME_num(st) SKM_sk_num(KRB5_PRINCNAME, (st))
+# define sk_KRB5_PRINCNAME_value(st, i) SKM_sk_value(KRB5_PRINCNAME, (st), (i))
+# define sk_KRB5_PRINCNAME_set(st, i, val) SKM_sk_set(KRB5_PRINCNAME, (st), (i), (val))
+# define sk_KRB5_PRINCNAME_zero(st) SKM_sk_zero(KRB5_PRINCNAME, (st))
+# define sk_KRB5_PRINCNAME_push(st, val) SKM_sk_push(KRB5_PRINCNAME, (st), (val))
+# define sk_KRB5_PRINCNAME_unshift(st, val) SKM_sk_unshift(KRB5_PRINCNAME, (st), (val))
+# define sk_KRB5_PRINCNAME_find(st, val) SKM_sk_find(KRB5_PRINCNAME, (st), (val))
+# define sk_KRB5_PRINCNAME_find_ex(st, val) SKM_sk_find_ex(KRB5_PRINCNAME, (st), (val))
+# define sk_KRB5_PRINCNAME_delete(st, i) SKM_sk_delete(KRB5_PRINCNAME, (st), (i))
+# define sk_KRB5_PRINCNAME_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_PRINCNAME, (st), (ptr))
+# define sk_KRB5_PRINCNAME_insert(st, val, i) SKM_sk_insert(KRB5_PRINCNAME, (st), (val), (i))
+# define sk_KRB5_PRINCNAME_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_PRINCNAME, (st), (cmp))
+# define sk_KRB5_PRINCNAME_dup(st) SKM_sk_dup(KRB5_PRINCNAME, st)
+# define sk_KRB5_PRINCNAME_pop_free(st, free_func) SKM_sk_pop_free(KRB5_PRINCNAME, (st), (free_func))
+# define sk_KRB5_PRINCNAME_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_PRINCNAME, (st), (copy_func), (free_func))
+# define sk_KRB5_PRINCNAME_shift(st) SKM_sk_shift(KRB5_PRINCNAME, (st))
+# define sk_KRB5_PRINCNAME_pop(st) SKM_sk_pop(KRB5_PRINCNAME, (st))
+# define sk_KRB5_PRINCNAME_sort(st) SKM_sk_sort(KRB5_PRINCNAME, (st))
+# define sk_KRB5_PRINCNAME_is_sorted(st) SKM_sk_is_sorted(KRB5_PRINCNAME, (st))
+# define sk_KRB5_TKTBODY_new(cmp) SKM_sk_new(KRB5_TKTBODY, (cmp))
+# define sk_KRB5_TKTBODY_new_null() SKM_sk_new_null(KRB5_TKTBODY)
+# define sk_KRB5_TKTBODY_free(st) SKM_sk_free(KRB5_TKTBODY, (st))
+# define sk_KRB5_TKTBODY_num(st) SKM_sk_num(KRB5_TKTBODY, (st))
+# define sk_KRB5_TKTBODY_value(st, i) SKM_sk_value(KRB5_TKTBODY, (st), (i))
+# define sk_KRB5_TKTBODY_set(st, i, val) SKM_sk_set(KRB5_TKTBODY, (st), (i), (val))
+# define sk_KRB5_TKTBODY_zero(st) SKM_sk_zero(KRB5_TKTBODY, (st))
+# define sk_KRB5_TKTBODY_push(st, val) SKM_sk_push(KRB5_TKTBODY, (st), (val))
+# define sk_KRB5_TKTBODY_unshift(st, val) SKM_sk_unshift(KRB5_TKTBODY, (st), (val))
+# define sk_KRB5_TKTBODY_find(st, val) SKM_sk_find(KRB5_TKTBODY, (st), (val))
+# define sk_KRB5_TKTBODY_find_ex(st, val) SKM_sk_find_ex(KRB5_TKTBODY, (st), (val))
+# define sk_KRB5_TKTBODY_delete(st, i) SKM_sk_delete(KRB5_TKTBODY, (st), (i))
+# define sk_KRB5_TKTBODY_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_TKTBODY, (st), (ptr))
+# define sk_KRB5_TKTBODY_insert(st, val, i) SKM_sk_insert(KRB5_TKTBODY, (st), (val), (i))
+# define sk_KRB5_TKTBODY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_TKTBODY, (st), (cmp))
+# define sk_KRB5_TKTBODY_dup(st) SKM_sk_dup(KRB5_TKTBODY, st)
+# define sk_KRB5_TKTBODY_pop_free(st, free_func) SKM_sk_pop_free(KRB5_TKTBODY, (st), (free_func))
+# define sk_KRB5_TKTBODY_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_TKTBODY, (st), (copy_func), (free_func))
+# define sk_KRB5_TKTBODY_shift(st) SKM_sk_shift(KRB5_TKTBODY, (st))
+# define sk_KRB5_TKTBODY_pop(st) SKM_sk_pop(KRB5_TKTBODY, (st))
+# define sk_KRB5_TKTBODY_sort(st) SKM_sk_sort(KRB5_TKTBODY, (st))
+# define sk_KRB5_TKTBODY_is_sorted(st) SKM_sk_is_sorted(KRB5_TKTBODY, (st))
+# define sk_MEM_OBJECT_DATA_new(cmp) SKM_sk_new(MEM_OBJECT_DATA, (cmp))
+# define sk_MEM_OBJECT_DATA_new_null() SKM_sk_new_null(MEM_OBJECT_DATA)
+# define sk_MEM_OBJECT_DATA_free(st) SKM_sk_free(MEM_OBJECT_DATA, (st))
+# define sk_MEM_OBJECT_DATA_num(st) SKM_sk_num(MEM_OBJECT_DATA, (st))
+# define sk_MEM_OBJECT_DATA_value(st, i) SKM_sk_value(MEM_OBJECT_DATA, (st), (i))
+# define sk_MEM_OBJECT_DATA_set(st, i, val) SKM_sk_set(MEM_OBJECT_DATA, (st), (i), (val))
+# define sk_MEM_OBJECT_DATA_zero(st) SKM_sk_zero(MEM_OBJECT_DATA, (st))
+# define sk_MEM_OBJECT_DATA_push(st, val) SKM_sk_push(MEM_OBJECT_DATA, (st), (val))
+# define sk_MEM_OBJECT_DATA_unshift(st, val) SKM_sk_unshift(MEM_OBJECT_DATA, (st), (val))
+# define sk_MEM_OBJECT_DATA_find(st, val) SKM_sk_find(MEM_OBJECT_DATA, (st), (val))
+# define sk_MEM_OBJECT_DATA_find_ex(st, val) SKM_sk_find_ex(MEM_OBJECT_DATA, (st), (val))
+# define sk_MEM_OBJECT_DATA_delete(st, i) SKM_sk_delete(MEM_OBJECT_DATA, (st), (i))
+# define sk_MEM_OBJECT_DATA_delete_ptr(st, ptr) SKM_sk_delete_ptr(MEM_OBJECT_DATA, (st), (ptr))
+# define sk_MEM_OBJECT_DATA_insert(st, val, i) SKM_sk_insert(MEM_OBJECT_DATA, (st), (val), (i))
+# define sk_MEM_OBJECT_DATA_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MEM_OBJECT_DATA, (st), (cmp))
+# define sk_MEM_OBJECT_DATA_dup(st) SKM_sk_dup(MEM_OBJECT_DATA, st)
+# define sk_MEM_OBJECT_DATA_pop_free(st, free_func) SKM_sk_pop_free(MEM_OBJECT_DATA, (st), (free_func))
+# define sk_MEM_OBJECT_DATA_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(MEM_OBJECT_DATA, (st), (copy_func), (free_func))
+# define sk_MEM_OBJECT_DATA_shift(st) SKM_sk_shift(MEM_OBJECT_DATA, (st))
+# define sk_MEM_OBJECT_DATA_pop(st) SKM_sk_pop(MEM_OBJECT_DATA, (st))
+# define sk_MEM_OBJECT_DATA_sort(st) SKM_sk_sort(MEM_OBJECT_DATA, (st))
+# define sk_MEM_OBJECT_DATA_is_sorted(st) SKM_sk_is_sorted(MEM_OBJECT_DATA, (st))
+# define sk_MIME_HEADER_new(cmp) SKM_sk_new(MIME_HEADER, (cmp))
+# define sk_MIME_HEADER_new_null() SKM_sk_new_null(MIME_HEADER)
+# define sk_MIME_HEADER_free(st) SKM_sk_free(MIME_HEADER, (st))
+# define sk_MIME_HEADER_num(st) SKM_sk_num(MIME_HEADER, (st))
+# define sk_MIME_HEADER_value(st, i) SKM_sk_value(MIME_HEADER, (st), (i))
+# define sk_MIME_HEADER_set(st, i, val) SKM_sk_set(MIME_HEADER, (st), (i), (val))
+# define sk_MIME_HEADER_zero(st) SKM_sk_zero(MIME_HEADER, (st))
+# define sk_MIME_HEADER_push(st, val) SKM_sk_push(MIME_HEADER, (st), (val))
+# define sk_MIME_HEADER_unshift(st, val) SKM_sk_unshift(MIME_HEADER, (st), (val))
+# define sk_MIME_HEADER_find(st, val) SKM_sk_find(MIME_HEADER, (st), (val))
+# define sk_MIME_HEADER_find_ex(st, val) SKM_sk_find_ex(MIME_HEADER, (st), (val))
+# define sk_MIME_HEADER_delete(st, i) SKM_sk_delete(MIME_HEADER, (st), (i))
+# define sk_MIME_HEADER_delete_ptr(st, ptr) SKM_sk_delete_ptr(MIME_HEADER, (st), (ptr))
+# define sk_MIME_HEADER_insert(st, val, i) SKM_sk_insert(MIME_HEADER, (st), (val), (i))
+# define sk_MIME_HEADER_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MIME_HEADER, (st), (cmp))
+# define sk_MIME_HEADER_dup(st) SKM_sk_dup(MIME_HEADER, st)
+# define sk_MIME_HEADER_pop_free(st, free_func) SKM_sk_pop_free(MIME_HEADER, (st), (free_func))
+# define sk_MIME_HEADER_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(MIME_HEADER, (st), (copy_func), (free_func))
+# define sk_MIME_HEADER_shift(st) SKM_sk_shift(MIME_HEADER, (st))
+# define sk_MIME_HEADER_pop(st) SKM_sk_pop(MIME_HEADER, (st))
+# define sk_MIME_HEADER_sort(st) SKM_sk_sort(MIME_HEADER, (st))
+# define sk_MIME_HEADER_is_sorted(st) SKM_sk_is_sorted(MIME_HEADER, (st))
+# define sk_MIME_PARAM_new(cmp) SKM_sk_new(MIME_PARAM, (cmp))
+# define sk_MIME_PARAM_new_null() SKM_sk_new_null(MIME_PARAM)
+# define sk_MIME_PARAM_free(st) SKM_sk_free(MIME_PARAM, (st))
+# define sk_MIME_PARAM_num(st) SKM_sk_num(MIME_PARAM, (st))
+# define sk_MIME_PARAM_value(st, i) SKM_sk_value(MIME_PARAM, (st), (i))
+# define sk_MIME_PARAM_set(st, i, val) SKM_sk_set(MIME_PARAM, (st), (i), (val))
+# define sk_MIME_PARAM_zero(st) SKM_sk_zero(MIME_PARAM, (st))
+# define sk_MIME_PARAM_push(st, val) SKM_sk_push(MIME_PARAM, (st), (val))
+# define sk_MIME_PARAM_unshift(st, val) SKM_sk_unshift(MIME_PARAM, (st), (val))
+# define sk_MIME_PARAM_find(st, val) SKM_sk_find(MIME_PARAM, (st), (val))
+# define sk_MIME_PARAM_find_ex(st, val) SKM_sk_find_ex(MIME_PARAM, (st), (val))
+# define sk_MIME_PARAM_delete(st, i) SKM_sk_delete(MIME_PARAM, (st), (i))
+# define sk_MIME_PARAM_delete_ptr(st, ptr) SKM_sk_delete_ptr(MIME_PARAM, (st), (ptr))
+# define sk_MIME_PARAM_insert(st, val, i) SKM_sk_insert(MIME_PARAM, (st), (val), (i))
+# define sk_MIME_PARAM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MIME_PARAM, (st), (cmp))
+# define sk_MIME_PARAM_dup(st) SKM_sk_dup(MIME_PARAM, st)
+# define sk_MIME_PARAM_pop_free(st, free_func) SKM_sk_pop_free(MIME_PARAM, (st), (free_func))
+# define sk_MIME_PARAM_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(MIME_PARAM, (st), (copy_func), (free_func))
+# define sk_MIME_PARAM_shift(st) SKM_sk_shift(MIME_PARAM, (st))
+# define sk_MIME_PARAM_pop(st) SKM_sk_pop(MIME_PARAM, (st))
+# define sk_MIME_PARAM_sort(st) SKM_sk_sort(MIME_PARAM, (st))
+# define sk_MIME_PARAM_is_sorted(st) SKM_sk_is_sorted(MIME_PARAM, (st))
+# define sk_NAME_FUNCS_new(cmp) SKM_sk_new(NAME_FUNCS, (cmp))
+# define sk_NAME_FUNCS_new_null() SKM_sk_new_null(NAME_FUNCS)
+# define sk_NAME_FUNCS_free(st) SKM_sk_free(NAME_FUNCS, (st))
+# define sk_NAME_FUNCS_num(st) SKM_sk_num(NAME_FUNCS, (st))
+# define sk_NAME_FUNCS_value(st, i) SKM_sk_value(NAME_FUNCS, (st), (i))
+# define sk_NAME_FUNCS_set(st, i, val) SKM_sk_set(NAME_FUNCS, (st), (i), (val))
+# define sk_NAME_FUNCS_zero(st) SKM_sk_zero(NAME_FUNCS, (st))
+# define sk_NAME_FUNCS_push(st, val) SKM_sk_push(NAME_FUNCS, (st), (val))
+# define sk_NAME_FUNCS_unshift(st, val) SKM_sk_unshift(NAME_FUNCS, (st), (val))
+# define sk_NAME_FUNCS_find(st, val) SKM_sk_find(NAME_FUNCS, (st), (val))
+# define sk_NAME_FUNCS_find_ex(st, val) SKM_sk_find_ex(NAME_FUNCS, (st), (val))
+# define sk_NAME_FUNCS_delete(st, i) SKM_sk_delete(NAME_FUNCS, (st), (i))
+# define sk_NAME_FUNCS_delete_ptr(st, ptr) SKM_sk_delete_ptr(NAME_FUNCS, (st), (ptr))
+# define sk_NAME_FUNCS_insert(st, val, i) SKM_sk_insert(NAME_FUNCS, (st), (val), (i))
+# define sk_NAME_FUNCS_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(NAME_FUNCS, (st), (cmp))
+# define sk_NAME_FUNCS_dup(st) SKM_sk_dup(NAME_FUNCS, st)
+# define sk_NAME_FUNCS_pop_free(st, free_func) SKM_sk_pop_free(NAME_FUNCS, (st), (free_func))
+# define sk_NAME_FUNCS_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(NAME_FUNCS, (st), (copy_func), (free_func))
+# define sk_NAME_FUNCS_shift(st) SKM_sk_shift(NAME_FUNCS, (st))
+# define sk_NAME_FUNCS_pop(st) SKM_sk_pop(NAME_FUNCS, (st))
+# define sk_NAME_FUNCS_sort(st) SKM_sk_sort(NAME_FUNCS, (st))
+# define sk_NAME_FUNCS_is_sorted(st) SKM_sk_is_sorted(NAME_FUNCS, (st))
+# define sk_OCSP_CERTID_new(cmp) SKM_sk_new(OCSP_CERTID, (cmp))
+# define sk_OCSP_CERTID_new_null() SKM_sk_new_null(OCSP_CERTID)
+# define sk_OCSP_CERTID_free(st) SKM_sk_free(OCSP_CERTID, (st))
+# define sk_OCSP_CERTID_num(st) SKM_sk_num(OCSP_CERTID, (st))
+# define sk_OCSP_CERTID_value(st, i) SKM_sk_value(OCSP_CERTID, (st), (i))
+# define sk_OCSP_CERTID_set(st, i, val) SKM_sk_set(OCSP_CERTID, (st), (i), (val))
+# define sk_OCSP_CERTID_zero(st) SKM_sk_zero(OCSP_CERTID, (st))
+# define sk_OCSP_CERTID_push(st, val) SKM_sk_push(OCSP_CERTID, (st), (val))
+# define sk_OCSP_CERTID_unshift(st, val) SKM_sk_unshift(OCSP_CERTID, (st), (val))
+# define sk_OCSP_CERTID_find(st, val) SKM_sk_find(OCSP_CERTID, (st), (val))
+# define sk_OCSP_CERTID_find_ex(st, val) SKM_sk_find_ex(OCSP_CERTID, (st), (val))
+# define sk_OCSP_CERTID_delete(st, i) SKM_sk_delete(OCSP_CERTID, (st), (i))
+# define sk_OCSP_CERTID_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_CERTID, (st), (ptr))
+# define sk_OCSP_CERTID_insert(st, val, i) SKM_sk_insert(OCSP_CERTID, (st), (val), (i))
+# define sk_OCSP_CERTID_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_CERTID, (st), (cmp))
+# define sk_OCSP_CERTID_dup(st) SKM_sk_dup(OCSP_CERTID, st)
+# define sk_OCSP_CERTID_pop_free(st, free_func) SKM_sk_pop_free(OCSP_CERTID, (st), (free_func))
+# define sk_OCSP_CERTID_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(OCSP_CERTID, (st), (copy_func), (free_func))
+# define sk_OCSP_CERTID_shift(st) SKM_sk_shift(OCSP_CERTID, (st))
+# define sk_OCSP_CERTID_pop(st) SKM_sk_pop(OCSP_CERTID, (st))
+# define sk_OCSP_CERTID_sort(st) SKM_sk_sort(OCSP_CERTID, (st))
+# define sk_OCSP_CERTID_is_sorted(st) SKM_sk_is_sorted(OCSP_CERTID, (st))
+# define sk_OCSP_ONEREQ_new(cmp) SKM_sk_new(OCSP_ONEREQ, (cmp))
+# define sk_OCSP_ONEREQ_new_null() SKM_sk_new_null(OCSP_ONEREQ)
+# define sk_OCSP_ONEREQ_free(st) SKM_sk_free(OCSP_ONEREQ, (st))
+# define sk_OCSP_ONEREQ_num(st) SKM_sk_num(OCSP_ONEREQ, (st))
+# define sk_OCSP_ONEREQ_value(st, i) SKM_sk_value(OCSP_ONEREQ, (st), (i))
+# define sk_OCSP_ONEREQ_set(st, i, val) SKM_sk_set(OCSP_ONEREQ, (st), (i), (val))
+# define sk_OCSP_ONEREQ_zero(st) SKM_sk_zero(OCSP_ONEREQ, (st))
+# define sk_OCSP_ONEREQ_push(st, val) SKM_sk_push(OCSP_ONEREQ, (st), (val))
+# define sk_OCSP_ONEREQ_unshift(st, val) SKM_sk_unshift(OCSP_ONEREQ, (st), (val))
+# define sk_OCSP_ONEREQ_find(st, val) SKM_sk_find(OCSP_ONEREQ, (st), (val))
+# define sk_OCSP_ONEREQ_find_ex(st, val) SKM_sk_find_ex(OCSP_ONEREQ, (st), (val))
+# define sk_OCSP_ONEREQ_delete(st, i) SKM_sk_delete(OCSP_ONEREQ, (st), (i))
+# define sk_OCSP_ONEREQ_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_ONEREQ, (st), (ptr))
+# define sk_OCSP_ONEREQ_insert(st, val, i) SKM_sk_insert(OCSP_ONEREQ, (st), (val), (i))
+# define sk_OCSP_ONEREQ_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_ONEREQ, (st), (cmp))
+# define sk_OCSP_ONEREQ_dup(st) SKM_sk_dup(OCSP_ONEREQ, st)
+# define sk_OCSP_ONEREQ_pop_free(st, free_func) SKM_sk_pop_free(OCSP_ONEREQ, (st), (free_func))
+# define sk_OCSP_ONEREQ_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(OCSP_ONEREQ, (st), (copy_func), (free_func))
+# define sk_OCSP_ONEREQ_shift(st) SKM_sk_shift(OCSP_ONEREQ, (st))
+# define sk_OCSP_ONEREQ_pop(st) SKM_sk_pop(OCSP_ONEREQ, (st))
+# define sk_OCSP_ONEREQ_sort(st) SKM_sk_sort(OCSP_ONEREQ, (st))
+# define sk_OCSP_ONEREQ_is_sorted(st) SKM_sk_is_sorted(OCSP_ONEREQ, (st))
+# define sk_OCSP_RESPID_new(cmp) SKM_sk_new(OCSP_RESPID, (cmp))
+# define sk_OCSP_RESPID_new_null() SKM_sk_new_null(OCSP_RESPID)
+# define sk_OCSP_RESPID_free(st) SKM_sk_free(OCSP_RESPID, (st))
+# define sk_OCSP_RESPID_num(st) SKM_sk_num(OCSP_RESPID, (st))
+# define sk_OCSP_RESPID_value(st, i) SKM_sk_value(OCSP_RESPID, (st), (i))
+# define sk_OCSP_RESPID_set(st, i, val) SKM_sk_set(OCSP_RESPID, (st), (i), (val))
+# define sk_OCSP_RESPID_zero(st) SKM_sk_zero(OCSP_RESPID, (st))
+# define sk_OCSP_RESPID_push(st, val) SKM_sk_push(OCSP_RESPID, (st), (val))
+# define sk_OCSP_RESPID_unshift(st, val) SKM_sk_unshift(OCSP_RESPID, (st), (val))
+# define sk_OCSP_RESPID_find(st, val) SKM_sk_find(OCSP_RESPID, (st), (val))
+# define sk_OCSP_RESPID_find_ex(st, val) SKM_sk_find_ex(OCSP_RESPID, (st), (val))
+# define sk_OCSP_RESPID_delete(st, i) SKM_sk_delete(OCSP_RESPID, (st), (i))
+# define sk_OCSP_RESPID_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_RESPID, (st), (ptr))
+# define sk_OCSP_RESPID_insert(st, val, i) SKM_sk_insert(OCSP_RESPID, (st), (val), (i))
+# define sk_OCSP_RESPID_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_RESPID, (st), (cmp))
+# define sk_OCSP_RESPID_dup(st) SKM_sk_dup(OCSP_RESPID, st)
+# define sk_OCSP_RESPID_pop_free(st, free_func) SKM_sk_pop_free(OCSP_RESPID, (st), (free_func))
+# define sk_OCSP_RESPID_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(OCSP_RESPID, (st), (copy_func), (free_func))
+# define sk_OCSP_RESPID_shift(st) SKM_sk_shift(OCSP_RESPID, (st))
+# define sk_OCSP_RESPID_pop(st) SKM_sk_pop(OCSP_RESPID, (st))
+# define sk_OCSP_RESPID_sort(st) SKM_sk_sort(OCSP_RESPID, (st))
+# define sk_OCSP_RESPID_is_sorted(st) SKM_sk_is_sorted(OCSP_RESPID, (st))
+# define sk_OCSP_SINGLERESP_new(cmp) SKM_sk_new(OCSP_SINGLERESP, (cmp))
+# define sk_OCSP_SINGLERESP_new_null() SKM_sk_new_null(OCSP_SINGLERESP)
+# define sk_OCSP_SINGLERESP_free(st) SKM_sk_free(OCSP_SINGLERESP, (st))
+# define sk_OCSP_SINGLERESP_num(st) SKM_sk_num(OCSP_SINGLERESP, (st))
+# define sk_OCSP_SINGLERESP_value(st, i) SKM_sk_value(OCSP_SINGLERESP, (st), (i))
+# define sk_OCSP_SINGLERESP_set(st, i, val) SKM_sk_set(OCSP_SINGLERESP, (st), (i), (val))
+# define sk_OCSP_SINGLERESP_zero(st) SKM_sk_zero(OCSP_SINGLERESP, (st))
+# define sk_OCSP_SINGLERESP_push(st, val) SKM_sk_push(OCSP_SINGLERESP, (st), (val))
+# define sk_OCSP_SINGLERESP_unshift(st, val) SKM_sk_unshift(OCSP_SINGLERESP, (st), (val))
+# define sk_OCSP_SINGLERESP_find(st, val) SKM_sk_find(OCSP_SINGLERESP, (st), (val))
+# define sk_OCSP_SINGLERESP_find_ex(st, val) SKM_sk_find_ex(OCSP_SINGLERESP, (st), (val))
+# define sk_OCSP_SINGLERESP_delete(st, i) SKM_sk_delete(OCSP_SINGLERESP, (st), (i))
+# define sk_OCSP_SINGLERESP_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_SINGLERESP, (st), (ptr))
+# define sk_OCSP_SINGLERESP_insert(st, val, i) SKM_sk_insert(OCSP_SINGLERESP, (st), (val), (i))
+# define sk_OCSP_SINGLERESP_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_SINGLERESP, (st), (cmp))
+# define sk_OCSP_SINGLERESP_dup(st) SKM_sk_dup(OCSP_SINGLERESP, st)
+# define sk_OCSP_SINGLERESP_pop_free(st, free_func) SKM_sk_pop_free(OCSP_SINGLERESP, (st), (free_func))
+# define sk_OCSP_SINGLERESP_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(OCSP_SINGLERESP, (st), (copy_func), (free_func))
+# define sk_OCSP_SINGLERESP_shift(st) SKM_sk_shift(OCSP_SINGLERESP, (st))
+# define sk_OCSP_SINGLERESP_pop(st) SKM_sk_pop(OCSP_SINGLERESP, (st))
+# define sk_OCSP_SINGLERESP_sort(st) SKM_sk_sort(OCSP_SINGLERESP, (st))
+# define sk_OCSP_SINGLERESP_is_sorted(st) SKM_sk_is_sorted(OCSP_SINGLERESP, (st))
+# define sk_PKCS12_SAFEBAG_new(cmp) SKM_sk_new(PKCS12_SAFEBAG, (cmp))
+# define sk_PKCS12_SAFEBAG_new_null() SKM_sk_new_null(PKCS12_SAFEBAG)
+# define sk_PKCS12_SAFEBAG_free(st) SKM_sk_free(PKCS12_SAFEBAG, (st))
+# define sk_PKCS12_SAFEBAG_num(st) SKM_sk_num(PKCS12_SAFEBAG, (st))
+# define sk_PKCS12_SAFEBAG_value(st, i) SKM_sk_value(PKCS12_SAFEBAG, (st), (i))
+# define sk_PKCS12_SAFEBAG_set(st, i, val) SKM_sk_set(PKCS12_SAFEBAG, (st), (i), (val))
+# define sk_PKCS12_SAFEBAG_zero(st) SKM_sk_zero(PKCS12_SAFEBAG, (st))
+# define sk_PKCS12_SAFEBAG_push(st, val) SKM_sk_push(PKCS12_SAFEBAG, (st), (val))
+# define sk_PKCS12_SAFEBAG_unshift(st, val) SKM_sk_unshift(PKCS12_SAFEBAG, (st), (val))
+# define sk_PKCS12_SAFEBAG_find(st, val) SKM_sk_find(PKCS12_SAFEBAG, (st), (val))
+# define sk_PKCS12_SAFEBAG_find_ex(st, val) SKM_sk_find_ex(PKCS12_SAFEBAG, (st), (val))
+# define sk_PKCS12_SAFEBAG_delete(st, i) SKM_sk_delete(PKCS12_SAFEBAG, (st), (i))
+# define sk_PKCS12_SAFEBAG_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS12_SAFEBAG, (st), (ptr))
+# define sk_PKCS12_SAFEBAG_insert(st, val, i) SKM_sk_insert(PKCS12_SAFEBAG, (st), (val), (i))
+# define sk_PKCS12_SAFEBAG_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS12_SAFEBAG, (st), (cmp))
+# define sk_PKCS12_SAFEBAG_dup(st) SKM_sk_dup(PKCS12_SAFEBAG, st)
+# define sk_PKCS12_SAFEBAG_pop_free(st, free_func) SKM_sk_pop_free(PKCS12_SAFEBAG, (st), (free_func))
+# define sk_PKCS12_SAFEBAG_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(PKCS12_SAFEBAG, (st), (copy_func), (free_func))
+# define sk_PKCS12_SAFEBAG_shift(st) SKM_sk_shift(PKCS12_SAFEBAG, (st))
+# define sk_PKCS12_SAFEBAG_pop(st) SKM_sk_pop(PKCS12_SAFEBAG, (st))
+# define sk_PKCS12_SAFEBAG_sort(st) SKM_sk_sort(PKCS12_SAFEBAG, (st))
+# define sk_PKCS12_SAFEBAG_is_sorted(st) SKM_sk_is_sorted(PKCS12_SAFEBAG, (st))
+# define sk_PKCS7_new(cmp) SKM_sk_new(PKCS7, (cmp))
+# define sk_PKCS7_new_null() SKM_sk_new_null(PKCS7)
+# define sk_PKCS7_free(st) SKM_sk_free(PKCS7, (st))
+# define sk_PKCS7_num(st) SKM_sk_num(PKCS7, (st))
+# define sk_PKCS7_value(st, i) SKM_sk_value(PKCS7, (st), (i))
+# define sk_PKCS7_set(st, i, val) SKM_sk_set(PKCS7, (st), (i), (val))
+# define sk_PKCS7_zero(st) SKM_sk_zero(PKCS7, (st))
+# define sk_PKCS7_push(st, val) SKM_sk_push(PKCS7, (st), (val))
+# define sk_PKCS7_unshift(st, val) SKM_sk_unshift(PKCS7, (st), (val))
+# define sk_PKCS7_find(st, val) SKM_sk_find(PKCS7, (st), (val))
+# define sk_PKCS7_find_ex(st, val) SKM_sk_find_ex(PKCS7, (st), (val))
+# define sk_PKCS7_delete(st, i) SKM_sk_delete(PKCS7, (st), (i))
+# define sk_PKCS7_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS7, (st), (ptr))
+# define sk_PKCS7_insert(st, val, i) SKM_sk_insert(PKCS7, (st), (val), (i))
+# define sk_PKCS7_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS7, (st), (cmp))
+# define sk_PKCS7_dup(st) SKM_sk_dup(PKCS7, st)
+# define sk_PKCS7_pop_free(st, free_func) SKM_sk_pop_free(PKCS7, (st), (free_func))
+# define sk_PKCS7_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(PKCS7, (st), (copy_func), (free_func))
+# define sk_PKCS7_shift(st) SKM_sk_shift(PKCS7, (st))
+# define sk_PKCS7_pop(st) SKM_sk_pop(PKCS7, (st))
+# define sk_PKCS7_sort(st) SKM_sk_sort(PKCS7, (st))
+# define sk_PKCS7_is_sorted(st) SKM_sk_is_sorted(PKCS7, (st))
+# define sk_PKCS7_RECIP_INFO_new(cmp) SKM_sk_new(PKCS7_RECIP_INFO, (cmp))
+# define sk_PKCS7_RECIP_INFO_new_null() SKM_sk_new_null(PKCS7_RECIP_INFO)
+# define sk_PKCS7_RECIP_INFO_free(st) SKM_sk_free(PKCS7_RECIP_INFO, (st))
+# define sk_PKCS7_RECIP_INFO_num(st) SKM_sk_num(PKCS7_RECIP_INFO, (st))
+# define sk_PKCS7_RECIP_INFO_value(st, i) SKM_sk_value(PKCS7_RECIP_INFO, (st), (i))
+# define sk_PKCS7_RECIP_INFO_set(st, i, val) SKM_sk_set(PKCS7_RECIP_INFO, (st), (i), (val))
+# define sk_PKCS7_RECIP_INFO_zero(st) SKM_sk_zero(PKCS7_RECIP_INFO, (st))
+# define sk_PKCS7_RECIP_INFO_push(st, val) SKM_sk_push(PKCS7_RECIP_INFO, (st), (val))
+# define sk_PKCS7_RECIP_INFO_unshift(st, val) SKM_sk_unshift(PKCS7_RECIP_INFO, (st), (val))
+# define sk_PKCS7_RECIP_INFO_find(st, val) SKM_sk_find(PKCS7_RECIP_INFO, (st), (val))
+# define sk_PKCS7_RECIP_INFO_find_ex(st, val) SKM_sk_find_ex(PKCS7_RECIP_INFO, (st), (val))
+# define sk_PKCS7_RECIP_INFO_delete(st, i) SKM_sk_delete(PKCS7_RECIP_INFO, (st), (i))
+# define sk_PKCS7_RECIP_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS7_RECIP_INFO, (st), (ptr))
+# define sk_PKCS7_RECIP_INFO_insert(st, val, i) SKM_sk_insert(PKCS7_RECIP_INFO, (st), (val), (i))
+# define sk_PKCS7_RECIP_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS7_RECIP_INFO, (st), (cmp))
+# define sk_PKCS7_RECIP_INFO_dup(st) SKM_sk_dup(PKCS7_RECIP_INFO, st)
+# define sk_PKCS7_RECIP_INFO_pop_free(st, free_func) SKM_sk_pop_free(PKCS7_RECIP_INFO, (st), (free_func))
+# define sk_PKCS7_RECIP_INFO_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(PKCS7_RECIP_INFO, (st), (copy_func), (free_func))
+# define sk_PKCS7_RECIP_INFO_shift(st) SKM_sk_shift(PKCS7_RECIP_INFO, (st))
+# define sk_PKCS7_RECIP_INFO_pop(st) SKM_sk_pop(PKCS7_RECIP_INFO, (st))
+# define sk_PKCS7_RECIP_INFO_sort(st) SKM_sk_sort(PKCS7_RECIP_INFO, (st))
+# define sk_PKCS7_RECIP_INFO_is_sorted(st) SKM_sk_is_sorted(PKCS7_RECIP_INFO, (st))
+# define sk_PKCS7_SIGNER_INFO_new(cmp) SKM_sk_new(PKCS7_SIGNER_INFO, (cmp))
+# define sk_PKCS7_SIGNER_INFO_new_null() SKM_sk_new_null(PKCS7_SIGNER_INFO)
+# define sk_PKCS7_SIGNER_INFO_free(st) SKM_sk_free(PKCS7_SIGNER_INFO, (st))
+# define sk_PKCS7_SIGNER_INFO_num(st) SKM_sk_num(PKCS7_SIGNER_INFO, (st))
+# define sk_PKCS7_SIGNER_INFO_value(st, i) SKM_sk_value(PKCS7_SIGNER_INFO, (st), (i))
+# define sk_PKCS7_SIGNER_INFO_set(st, i, val) SKM_sk_set(PKCS7_SIGNER_INFO, (st), (i), (val))
+# define sk_PKCS7_SIGNER_INFO_zero(st) SKM_sk_zero(PKCS7_SIGNER_INFO, (st))
+# define sk_PKCS7_SIGNER_INFO_push(st, val) SKM_sk_push(PKCS7_SIGNER_INFO, (st), (val))
+# define sk_PKCS7_SIGNER_INFO_unshift(st, val) SKM_sk_unshift(PKCS7_SIGNER_INFO, (st), (val))
+# define sk_PKCS7_SIGNER_INFO_find(st, val) SKM_sk_find(PKCS7_SIGNER_INFO, (st), (val))
+# define sk_PKCS7_SIGNER_INFO_find_ex(st, val) SKM_sk_find_ex(PKCS7_SIGNER_INFO, (st), (val))
+# define sk_PKCS7_SIGNER_INFO_delete(st, i) SKM_sk_delete(PKCS7_SIGNER_INFO, (st), (i))
+# define sk_PKCS7_SIGNER_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS7_SIGNER_INFO, (st), (ptr))
+# define sk_PKCS7_SIGNER_INFO_insert(st, val, i) SKM_sk_insert(PKCS7_SIGNER_INFO, (st), (val), (i))
+# define sk_PKCS7_SIGNER_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS7_SIGNER_INFO, (st), (cmp))
+# define sk_PKCS7_SIGNER_INFO_dup(st) SKM_sk_dup(PKCS7_SIGNER_INFO, st)
+# define sk_PKCS7_SIGNER_INFO_pop_free(st, free_func) SKM_sk_pop_free(PKCS7_SIGNER_INFO, (st), (free_func))
+# define sk_PKCS7_SIGNER_INFO_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(PKCS7_SIGNER_INFO, (st), (copy_func), (free_func))
+# define sk_PKCS7_SIGNER_INFO_shift(st) SKM_sk_shift(PKCS7_SIGNER_INFO, (st))
+# define sk_PKCS7_SIGNER_INFO_pop(st) SKM_sk_pop(PKCS7_SIGNER_INFO, (st))
+# define sk_PKCS7_SIGNER_INFO_sort(st) SKM_sk_sort(PKCS7_SIGNER_INFO, (st))
+# define sk_PKCS7_SIGNER_INFO_is_sorted(st) SKM_sk_is_sorted(PKCS7_SIGNER_INFO, (st))
+# define sk_POLICYINFO_new(cmp) SKM_sk_new(POLICYINFO, (cmp))
+# define sk_POLICYINFO_new_null() SKM_sk_new_null(POLICYINFO)
+# define sk_POLICYINFO_free(st) SKM_sk_free(POLICYINFO, (st))
+# define sk_POLICYINFO_num(st) SKM_sk_num(POLICYINFO, (st))
+# define sk_POLICYINFO_value(st, i) SKM_sk_value(POLICYINFO, (st), (i))
+# define sk_POLICYINFO_set(st, i, val) SKM_sk_set(POLICYINFO, (st), (i), (val))
+# define sk_POLICYINFO_zero(st) SKM_sk_zero(POLICYINFO, (st))
+# define sk_POLICYINFO_push(st, val) SKM_sk_push(POLICYINFO, (st), (val))
+# define sk_POLICYINFO_unshift(st, val) SKM_sk_unshift(POLICYINFO, (st), (val))
+# define sk_POLICYINFO_find(st, val) SKM_sk_find(POLICYINFO, (st), (val))
+# define sk_POLICYINFO_find_ex(st, val) SKM_sk_find_ex(POLICYINFO, (st), (val))
+# define sk_POLICYINFO_delete(st, i) SKM_sk_delete(POLICYINFO, (st), (i))
+# define sk_POLICYINFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(POLICYINFO, (st), (ptr))
+# define sk_POLICYINFO_insert(st, val, i) SKM_sk_insert(POLICYINFO, (st), (val), (i))
+# define sk_POLICYINFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(POLICYINFO, (st), (cmp))
+# define sk_POLICYINFO_dup(st) SKM_sk_dup(POLICYINFO, st)
+# define sk_POLICYINFO_pop_free(st, free_func) SKM_sk_pop_free(POLICYINFO, (st), (free_func))
+# define sk_POLICYINFO_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(POLICYINFO, (st), (copy_func), (free_func))
+# define sk_POLICYINFO_shift(st) SKM_sk_shift(POLICYINFO, (st))
+# define sk_POLICYINFO_pop(st) SKM_sk_pop(POLICYINFO, (st))
+# define sk_POLICYINFO_sort(st) SKM_sk_sort(POLICYINFO, (st))
+# define sk_POLICYINFO_is_sorted(st) SKM_sk_is_sorted(POLICYINFO, (st))
+# define sk_POLICYQUALINFO_new(cmp) SKM_sk_new(POLICYQUALINFO, (cmp))
+# define sk_POLICYQUALINFO_new_null() SKM_sk_new_null(POLICYQUALINFO)
+# define sk_POLICYQUALINFO_free(st) SKM_sk_free(POLICYQUALINFO, (st))
+# define sk_POLICYQUALINFO_num(st) SKM_sk_num(POLICYQUALINFO, (st))
+# define sk_POLICYQUALINFO_value(st, i) SKM_sk_value(POLICYQUALINFO, (st), (i))
+# define sk_POLICYQUALINFO_set(st, i, val) SKM_sk_set(POLICYQUALINFO, (st), (i), (val))
+# define sk_POLICYQUALINFO_zero(st) SKM_sk_zero(POLICYQUALINFO, (st))
+# define sk_POLICYQUALINFO_push(st, val) SKM_sk_push(POLICYQUALINFO, (st), (val))
+# define sk_POLICYQUALINFO_unshift(st, val) SKM_sk_unshift(POLICYQUALINFO, (st), (val))
+# define sk_POLICYQUALINFO_find(st, val) SKM_sk_find(POLICYQUALINFO, (st), (val))
+# define sk_POLICYQUALINFO_find_ex(st, val) SKM_sk_find_ex(POLICYQUALINFO, (st), (val))
+# define sk_POLICYQUALINFO_delete(st, i) SKM_sk_delete(POLICYQUALINFO, (st), (i))
+# define sk_POLICYQUALINFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(POLICYQUALINFO, (st), (ptr))
+# define sk_POLICYQUALINFO_insert(st, val, i) SKM_sk_insert(POLICYQUALINFO, (st), (val), (i))
+# define sk_POLICYQUALINFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(POLICYQUALINFO, (st), (cmp))
+# define sk_POLICYQUALINFO_dup(st) SKM_sk_dup(POLICYQUALINFO, st)
+# define sk_POLICYQUALINFO_pop_free(st, free_func) SKM_sk_pop_free(POLICYQUALINFO, (st), (free_func))
+# define sk_POLICYQUALINFO_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(POLICYQUALINFO, (st), (copy_func), (free_func))
+# define sk_POLICYQUALINFO_shift(st) SKM_sk_shift(POLICYQUALINFO, (st))
+# define sk_POLICYQUALINFO_pop(st) SKM_sk_pop(POLICYQUALINFO, (st))
+# define sk_POLICYQUALINFO_sort(st) SKM_sk_sort(POLICYQUALINFO, (st))
+# define sk_POLICYQUALINFO_is_sorted(st) SKM_sk_is_sorted(POLICYQUALINFO, (st))
+# define sk_POLICY_MAPPING_new(cmp) SKM_sk_new(POLICY_MAPPING, (cmp))
+# define sk_POLICY_MAPPING_new_null() SKM_sk_new_null(POLICY_MAPPING)
+# define sk_POLICY_MAPPING_free(st) SKM_sk_free(POLICY_MAPPING, (st))
+# define sk_POLICY_MAPPING_num(st) SKM_sk_num(POLICY_MAPPING, (st))
+# define sk_POLICY_MAPPING_value(st, i) SKM_sk_value(POLICY_MAPPING, (st), (i))
+# define sk_POLICY_MAPPING_set(st, i, val) SKM_sk_set(POLICY_MAPPING, (st), (i), (val))
+# define sk_POLICY_MAPPING_zero(st) SKM_sk_zero(POLICY_MAPPING, (st))
+# define sk_POLICY_MAPPING_push(st, val) SKM_sk_push(POLICY_MAPPING, (st), (val))
+# define sk_POLICY_MAPPING_unshift(st, val) SKM_sk_unshift(POLICY_MAPPING, (st), (val))
+# define sk_POLICY_MAPPING_find(st, val) SKM_sk_find(POLICY_MAPPING, (st), (val))
+# define sk_POLICY_MAPPING_find_ex(st, val) SKM_sk_find_ex(POLICY_MAPPING, (st), (val))
+# define sk_POLICY_MAPPING_delete(st, i) SKM_sk_delete(POLICY_MAPPING, (st), (i))
+# define sk_POLICY_MAPPING_delete_ptr(st, ptr) SKM_sk_delete_ptr(POLICY_MAPPING, (st), (ptr))
+# define sk_POLICY_MAPPING_insert(st, val, i) SKM_sk_insert(POLICY_MAPPING, (st), (val), (i))
+# define sk_POLICY_MAPPING_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(POLICY_MAPPING, (st), (cmp))
+# define sk_POLICY_MAPPING_dup(st) SKM_sk_dup(POLICY_MAPPING, st)
+# define sk_POLICY_MAPPING_pop_free(st, free_func) SKM_sk_pop_free(POLICY_MAPPING, (st), (free_func))
+# define sk_POLICY_MAPPING_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(POLICY_MAPPING, (st), (copy_func), (free_func))
+# define sk_POLICY_MAPPING_shift(st) SKM_sk_shift(POLICY_MAPPING, (st))
+# define sk_POLICY_MAPPING_pop(st) SKM_sk_pop(POLICY_MAPPING, (st))
+# define sk_POLICY_MAPPING_sort(st) SKM_sk_sort(POLICY_MAPPING, (st))
+# define sk_POLICY_MAPPING_is_sorted(st) SKM_sk_is_sorted(POLICY_MAPPING, (st))
+# define sk_SCT_new(cmp) SKM_sk_new(SCT, (cmp))
+# define sk_SCT_new_null() SKM_sk_new_null(SCT)
+# define sk_SCT_free(st) SKM_sk_free(SCT, (st))
+# define sk_SCT_num(st) SKM_sk_num(SCT, (st))
+# define sk_SCT_value(st, i) SKM_sk_value(SCT, (st), (i))
+# define sk_SCT_set(st, i, val) SKM_sk_set(SCT, (st), (i), (val))
+# define sk_SCT_zero(st) SKM_sk_zero(SCT, (st))
+# define sk_SCT_push(st, val) SKM_sk_push(SCT, (st), (val))
+# define sk_SCT_unshift(st, val) SKM_sk_unshift(SCT, (st), (val))
+# define sk_SCT_find(st, val) SKM_sk_find(SCT, (st), (val))
+# define sk_SCT_find_ex(st, val) SKM_sk_find_ex(SCT, (st), (val))
+# define sk_SCT_delete(st, i) SKM_sk_delete(SCT, (st), (i))
+# define sk_SCT_delete_ptr(st, ptr) SKM_sk_delete_ptr(SCT, (st), (ptr))
+# define sk_SCT_insert(st, val, i) SKM_sk_insert(SCT, (st), (val), (i))
+# define sk_SCT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SCT, (st), (cmp))
+# define sk_SCT_dup(st) SKM_sk_dup(SCT, st)
+# define sk_SCT_pop_free(st, free_func) SKM_sk_pop_free(SCT, (st), (free_func))
+# define sk_SCT_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SCT, (st), (copy_func), (free_func))
+# define sk_SCT_shift(st) SKM_sk_shift(SCT, (st))
+# define sk_SCT_pop(st) SKM_sk_pop(SCT, (st))
+# define sk_SCT_sort(st) SKM_sk_sort(SCT, (st))
+# define sk_SCT_is_sorted(st) SKM_sk_is_sorted(SCT, (st))
+# define sk_SRP_gN_new(cmp) SKM_sk_new(SRP_gN, (cmp))
+# define sk_SRP_gN_new_null() SKM_sk_new_null(SRP_gN)
+# define sk_SRP_gN_free(st) SKM_sk_free(SRP_gN, (st))
+# define sk_SRP_gN_num(st) SKM_sk_num(SRP_gN, (st))
+# define sk_SRP_gN_value(st, i) SKM_sk_value(SRP_gN, (st), (i))
+# define sk_SRP_gN_set(st, i, val) SKM_sk_set(SRP_gN, (st), (i), (val))
+# define sk_SRP_gN_zero(st) SKM_sk_zero(SRP_gN, (st))
+# define sk_SRP_gN_push(st, val) SKM_sk_push(SRP_gN, (st), (val))
+# define sk_SRP_gN_unshift(st, val) SKM_sk_unshift(SRP_gN, (st), (val))
+# define sk_SRP_gN_find(st, val) SKM_sk_find(SRP_gN, (st), (val))
+# define sk_SRP_gN_find_ex(st, val) SKM_sk_find_ex(SRP_gN, (st), (val))
+# define sk_SRP_gN_delete(st, i) SKM_sk_delete(SRP_gN, (st), (i))
+# define sk_SRP_gN_delete_ptr(st, ptr) SKM_sk_delete_ptr(SRP_gN, (st), (ptr))
+# define sk_SRP_gN_insert(st, val, i) SKM_sk_insert(SRP_gN, (st), (val), (i))
+# define sk_SRP_gN_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SRP_gN, (st), (cmp))
+# define sk_SRP_gN_dup(st) SKM_sk_dup(SRP_gN, st)
+# define sk_SRP_gN_pop_free(st, free_func) SKM_sk_pop_free(SRP_gN, (st), (free_func))
+# define sk_SRP_gN_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SRP_gN, (st), (copy_func), (free_func))
+# define sk_SRP_gN_shift(st) SKM_sk_shift(SRP_gN, (st))
+# define sk_SRP_gN_pop(st) SKM_sk_pop(SRP_gN, (st))
+# define sk_SRP_gN_sort(st) SKM_sk_sort(SRP_gN, (st))
+# define sk_SRP_gN_is_sorted(st) SKM_sk_is_sorted(SRP_gN, (st))
+# define sk_SRP_gN_cache_new(cmp) SKM_sk_new(SRP_gN_cache, (cmp))
+# define sk_SRP_gN_cache_new_null() SKM_sk_new_null(SRP_gN_cache)
+# define sk_SRP_gN_cache_free(st) SKM_sk_free(SRP_gN_cache, (st))
+# define sk_SRP_gN_cache_num(st) SKM_sk_num(SRP_gN_cache, (st))
+# define sk_SRP_gN_cache_value(st, i) SKM_sk_value(SRP_gN_cache, (st), (i))
+# define sk_SRP_gN_cache_set(st, i, val) SKM_sk_set(SRP_gN_cache, (st), (i), (val))
+# define sk_SRP_gN_cache_zero(st) SKM_sk_zero(SRP_gN_cache, (st))
+# define sk_SRP_gN_cache_push(st, val) SKM_sk_push(SRP_gN_cache, (st), (val))
+# define sk_SRP_gN_cache_unshift(st, val) SKM_sk_unshift(SRP_gN_cache, (st), (val))
+# define sk_SRP_gN_cache_find(st, val) SKM_sk_find(SRP_gN_cache, (st), (val))
+# define sk_SRP_gN_cache_find_ex(st, val) SKM_sk_find_ex(SRP_gN_cache, (st), (val))
+# define sk_SRP_gN_cache_delete(st, i) SKM_sk_delete(SRP_gN_cache, (st), (i))
+# define sk_SRP_gN_cache_delete_ptr(st, ptr) SKM_sk_delete_ptr(SRP_gN_cache, (st), (ptr))
+# define sk_SRP_gN_cache_insert(st, val, i) SKM_sk_insert(SRP_gN_cache, (st), (val), (i))
+# define sk_SRP_gN_cache_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SRP_gN_cache, (st), (cmp))
+# define sk_SRP_gN_cache_dup(st) SKM_sk_dup(SRP_gN_cache, st)
+# define sk_SRP_gN_cache_pop_free(st, free_func) SKM_sk_pop_free(SRP_gN_cache, (st), (free_func))
+# define sk_SRP_gN_cache_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SRP_gN_cache, (st), (copy_func), (free_func))
+# define sk_SRP_gN_cache_shift(st) SKM_sk_shift(SRP_gN_cache, (st))
+# define sk_SRP_gN_cache_pop(st) SKM_sk_pop(SRP_gN_cache, (st))
+# define sk_SRP_gN_cache_sort(st) SKM_sk_sort(SRP_gN_cache, (st))
+# define sk_SRP_gN_cache_is_sorted(st) SKM_sk_is_sorted(SRP_gN_cache, (st))
+# define sk_SRP_user_pwd_new(cmp) SKM_sk_new(SRP_user_pwd, (cmp))
+# define sk_SRP_user_pwd_new_null() SKM_sk_new_null(SRP_user_pwd)
+# define sk_SRP_user_pwd_free(st) SKM_sk_free(SRP_user_pwd, (st))
+# define sk_SRP_user_pwd_num(st) SKM_sk_num(SRP_user_pwd, (st))
+# define sk_SRP_user_pwd_value(st, i) SKM_sk_value(SRP_user_pwd, (st), (i))
+# define sk_SRP_user_pwd_set(st, i, val) SKM_sk_set(SRP_user_pwd, (st), (i), (val))
+# define sk_SRP_user_pwd_zero(st) SKM_sk_zero(SRP_user_pwd, (st))
+# define sk_SRP_user_pwd_push(st, val) SKM_sk_push(SRP_user_pwd, (st), (val))
+# define sk_SRP_user_pwd_unshift(st, val) SKM_sk_unshift(SRP_user_pwd, (st), (val))
+# define sk_SRP_user_pwd_find(st, val) SKM_sk_find(SRP_user_pwd, (st), (val))
+# define sk_SRP_user_pwd_find_ex(st, val) SKM_sk_find_ex(SRP_user_pwd, (st), (val))
+# define sk_SRP_user_pwd_delete(st, i) SKM_sk_delete(SRP_user_pwd, (st), (i))
+# define sk_SRP_user_pwd_delete_ptr(st, ptr) SKM_sk_delete_ptr(SRP_user_pwd, (st), (ptr))
+# define sk_SRP_user_pwd_insert(st, val, i) SKM_sk_insert(SRP_user_pwd, (st), (val), (i))
+# define sk_SRP_user_pwd_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SRP_user_pwd, (st), (cmp))
+# define sk_SRP_user_pwd_dup(st) SKM_sk_dup(SRP_user_pwd, st)
+# define sk_SRP_user_pwd_pop_free(st, free_func) SKM_sk_pop_free(SRP_user_pwd, (st), (free_func))
+# define sk_SRP_user_pwd_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SRP_user_pwd, (st), (copy_func), (free_func))
+# define sk_SRP_user_pwd_shift(st) SKM_sk_shift(SRP_user_pwd, (st))
+# define sk_SRP_user_pwd_pop(st) SKM_sk_pop(SRP_user_pwd, (st))
+# define sk_SRP_user_pwd_sort(st) SKM_sk_sort(SRP_user_pwd, (st))
+# define sk_SRP_user_pwd_is_sorted(st) SKM_sk_is_sorted(SRP_user_pwd, (st))
+# define sk_SRTP_PROTECTION_PROFILE_new(cmp) SKM_sk_new(SRTP_PROTECTION_PROFILE, (cmp))
+# define sk_SRTP_PROTECTION_PROFILE_new_null() SKM_sk_new_null(SRTP_PROTECTION_PROFILE)
+# define sk_SRTP_PROTECTION_PROFILE_free(st) SKM_sk_free(SRTP_PROTECTION_PROFILE, (st))
+# define sk_SRTP_PROTECTION_PROFILE_num(st) SKM_sk_num(SRTP_PROTECTION_PROFILE, (st))
+# define sk_SRTP_PROTECTION_PROFILE_value(st, i) SKM_sk_value(SRTP_PROTECTION_PROFILE, (st), (i))
+# define sk_SRTP_PROTECTION_PROFILE_set(st, i, val) SKM_sk_set(SRTP_PROTECTION_PROFILE, (st), (i), (val))
+# define sk_SRTP_PROTECTION_PROFILE_zero(st) SKM_sk_zero(SRTP_PROTECTION_PROFILE, (st))
+# define sk_SRTP_PROTECTION_PROFILE_push(st, val) SKM_sk_push(SRTP_PROTECTION_PROFILE, (st), (val))
+# define sk_SRTP_PROTECTION_PROFILE_unshift(st, val) SKM_sk_unshift(SRTP_PROTECTION_PROFILE, (st), (val))
+# define sk_SRTP_PROTECTION_PROFILE_find(st, val) SKM_sk_find(SRTP_PROTECTION_PROFILE, (st), (val))
+# define sk_SRTP_PROTECTION_PROFILE_find_ex(st, val) SKM_sk_find_ex(SRTP_PROTECTION_PROFILE, (st), (val))
+# define sk_SRTP_PROTECTION_PROFILE_delete(st, i) SKM_sk_delete(SRTP_PROTECTION_PROFILE, (st), (i))
+# define sk_SRTP_PROTECTION_PROFILE_delete_ptr(st, ptr) SKM_sk_delete_ptr(SRTP_PROTECTION_PROFILE, (st), (ptr))
+# define sk_SRTP_PROTECTION_PROFILE_insert(st, val, i) SKM_sk_insert(SRTP_PROTECTION_PROFILE, (st), (val), (i))
+# define sk_SRTP_PROTECTION_PROFILE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SRTP_PROTECTION_PROFILE, (st), (cmp))
+# define sk_SRTP_PROTECTION_PROFILE_dup(st) SKM_sk_dup(SRTP_PROTECTION_PROFILE, st)
+# define sk_SRTP_PROTECTION_PROFILE_pop_free(st, free_func) SKM_sk_pop_free(SRTP_PROTECTION_PROFILE, (st), (free_func))
+# define sk_SRTP_PROTECTION_PROFILE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SRTP_PROTECTION_PROFILE, (st), (copy_func), (free_func))
+# define sk_SRTP_PROTECTION_PROFILE_shift(st) SKM_sk_shift(SRTP_PROTECTION_PROFILE, (st))
+# define sk_SRTP_PROTECTION_PROFILE_pop(st) SKM_sk_pop(SRTP_PROTECTION_PROFILE, (st))
+# define sk_SRTP_PROTECTION_PROFILE_sort(st) SKM_sk_sort(SRTP_PROTECTION_PROFILE, (st))
+# define sk_SRTP_PROTECTION_PROFILE_is_sorted(st) SKM_sk_is_sorted(SRTP_PROTECTION_PROFILE, (st))
+# define sk_SSL_CIPHER_new(cmp) SKM_sk_new(SSL_CIPHER, (cmp))
+# define sk_SSL_CIPHER_new_null() SKM_sk_new_null(SSL_CIPHER)
+# define sk_SSL_CIPHER_free(st) SKM_sk_free(SSL_CIPHER, (st))
+# define sk_SSL_CIPHER_num(st) SKM_sk_num(SSL_CIPHER, (st))
+# define sk_SSL_CIPHER_value(st, i) SKM_sk_value(SSL_CIPHER, (st), (i))
+# define sk_SSL_CIPHER_set(st, i, val) SKM_sk_set(SSL_CIPHER, (st), (i), (val))
+# define sk_SSL_CIPHER_zero(st) SKM_sk_zero(SSL_CIPHER, (st))
+# define sk_SSL_CIPHER_push(st, val) SKM_sk_push(SSL_CIPHER, (st), (val))
+# define sk_SSL_CIPHER_unshift(st, val) SKM_sk_unshift(SSL_CIPHER, (st), (val))
+# define sk_SSL_CIPHER_find(st, val) SKM_sk_find(SSL_CIPHER, (st), (val))
+# define sk_SSL_CIPHER_find_ex(st, val) SKM_sk_find_ex(SSL_CIPHER, (st), (val))
+# define sk_SSL_CIPHER_delete(st, i) SKM_sk_delete(SSL_CIPHER, (st), (i))
+# define sk_SSL_CIPHER_delete_ptr(st, ptr) SKM_sk_delete_ptr(SSL_CIPHER, (st), (ptr))
+# define sk_SSL_CIPHER_insert(st, val, i) SKM_sk_insert(SSL_CIPHER, (st), (val), (i))
+# define sk_SSL_CIPHER_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SSL_CIPHER, (st), (cmp))
+# define sk_SSL_CIPHER_dup(st) SKM_sk_dup(SSL_CIPHER, st)
+# define sk_SSL_CIPHER_pop_free(st, free_func) SKM_sk_pop_free(SSL_CIPHER, (st), (free_func))
+# define sk_SSL_CIPHER_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SSL_CIPHER, (st), (copy_func), (free_func))
+# define sk_SSL_CIPHER_shift(st) SKM_sk_shift(SSL_CIPHER, (st))
+# define sk_SSL_CIPHER_pop(st) SKM_sk_pop(SSL_CIPHER, (st))
+# define sk_SSL_CIPHER_sort(st) SKM_sk_sort(SSL_CIPHER, (st))
+# define sk_SSL_CIPHER_is_sorted(st) SKM_sk_is_sorted(SSL_CIPHER, (st))
+# define sk_SSL_COMP_new(cmp) SKM_sk_new(SSL_COMP, (cmp))
+# define sk_SSL_COMP_new_null() SKM_sk_new_null(SSL_COMP)
+# define sk_SSL_COMP_free(st) SKM_sk_free(SSL_COMP, (st))
+# define sk_SSL_COMP_num(st) SKM_sk_num(SSL_COMP, (st))
+# define sk_SSL_COMP_value(st, i) SKM_sk_value(SSL_COMP, (st), (i))
+# define sk_SSL_COMP_set(st, i, val) SKM_sk_set(SSL_COMP, (st), (i), (val))
+# define sk_SSL_COMP_zero(st) SKM_sk_zero(SSL_COMP, (st))
+# define sk_SSL_COMP_push(st, val) SKM_sk_push(SSL_COMP, (st), (val))
+# define sk_SSL_COMP_unshift(st, val) SKM_sk_unshift(SSL_COMP, (st), (val))
+# define sk_SSL_COMP_find(st, val) SKM_sk_find(SSL_COMP, (st), (val))
+# define sk_SSL_COMP_find_ex(st, val) SKM_sk_find_ex(SSL_COMP, (st), (val))
+# define sk_SSL_COMP_delete(st, i) SKM_sk_delete(SSL_COMP, (st), (i))
+# define sk_SSL_COMP_delete_ptr(st, ptr) SKM_sk_delete_ptr(SSL_COMP, (st), (ptr))
+# define sk_SSL_COMP_insert(st, val, i) SKM_sk_insert(SSL_COMP, (st), (val), (i))
+# define sk_SSL_COMP_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SSL_COMP, (st), (cmp))
+# define sk_SSL_COMP_dup(st) SKM_sk_dup(SSL_COMP, st)
+# define sk_SSL_COMP_pop_free(st, free_func) SKM_sk_pop_free(SSL_COMP, (st), (free_func))
+# define sk_SSL_COMP_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SSL_COMP, (st), (copy_func), (free_func))
+# define sk_SSL_COMP_shift(st) SKM_sk_shift(SSL_COMP, (st))
+# define sk_SSL_COMP_pop(st) SKM_sk_pop(SSL_COMP, (st))
+# define sk_SSL_COMP_sort(st) SKM_sk_sort(SSL_COMP, (st))
+# define sk_SSL_COMP_is_sorted(st) SKM_sk_is_sorted(SSL_COMP, (st))
+# define sk_STACK_OF_X509_NAME_ENTRY_new(cmp) SKM_sk_new(STACK_OF_X509_NAME_ENTRY, (cmp))
+# define sk_STACK_OF_X509_NAME_ENTRY_new_null() SKM_sk_new_null(STACK_OF_X509_NAME_ENTRY)
+# define sk_STACK_OF_X509_NAME_ENTRY_free(st) SKM_sk_free(STACK_OF_X509_NAME_ENTRY, (st))
+# define sk_STACK_OF_X509_NAME_ENTRY_num(st) SKM_sk_num(STACK_OF_X509_NAME_ENTRY, (st))
+# define sk_STACK_OF_X509_NAME_ENTRY_value(st, i) SKM_sk_value(STACK_OF_X509_NAME_ENTRY, (st), (i))
+# define sk_STACK_OF_X509_NAME_ENTRY_set(st, i, val) SKM_sk_set(STACK_OF_X509_NAME_ENTRY, (st), (i), (val))
+# define sk_STACK_OF_X509_NAME_ENTRY_zero(st) SKM_sk_zero(STACK_OF_X509_NAME_ENTRY, (st))
+# define sk_STACK_OF_X509_NAME_ENTRY_push(st, val) SKM_sk_push(STACK_OF_X509_NAME_ENTRY, (st), (val))
+# define sk_STACK_OF_X509_NAME_ENTRY_unshift(st, val) SKM_sk_unshift(STACK_OF_X509_NAME_ENTRY, (st), (val))
+# define sk_STACK_OF_X509_NAME_ENTRY_find(st, val) SKM_sk_find(STACK_OF_X509_NAME_ENTRY, (st), (val))
+# define sk_STACK_OF_X509_NAME_ENTRY_find_ex(st, val) SKM_sk_find_ex(STACK_OF_X509_NAME_ENTRY, (st), (val))
+# define sk_STACK_OF_X509_NAME_ENTRY_delete(st, i) SKM_sk_delete(STACK_OF_X509_NAME_ENTRY, (st), (i))
+# define sk_STACK_OF_X509_NAME_ENTRY_delete_ptr(st, ptr) SKM_sk_delete_ptr(STACK_OF_X509_NAME_ENTRY, (st), (ptr))
+# define sk_STACK_OF_X509_NAME_ENTRY_insert(st, val, i) SKM_sk_insert(STACK_OF_X509_NAME_ENTRY, (st), (val), (i))
+# define sk_STACK_OF_X509_NAME_ENTRY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(STACK_OF_X509_NAME_ENTRY, (st), (cmp))
+# define sk_STACK_OF_X509_NAME_ENTRY_dup(st) SKM_sk_dup(STACK_OF_X509_NAME_ENTRY, st)
+# define sk_STACK_OF_X509_NAME_ENTRY_pop_free(st, free_func) SKM_sk_pop_free(STACK_OF_X509_NAME_ENTRY, (st), (free_func))
+# define sk_STACK_OF_X509_NAME_ENTRY_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(STACK_OF_X509_NAME_ENTRY, (st), (copy_func), (free_func))
+# define sk_STACK_OF_X509_NAME_ENTRY_shift(st) SKM_sk_shift(STACK_OF_X509_NAME_ENTRY, (st))
+# define sk_STACK_OF_X509_NAME_ENTRY_pop(st) SKM_sk_pop(STACK_OF_X509_NAME_ENTRY, (st))
+# define sk_STACK_OF_X509_NAME_ENTRY_sort(st) SKM_sk_sort(STACK_OF_X509_NAME_ENTRY, (st))
+# define sk_STACK_OF_X509_NAME_ENTRY_is_sorted(st) SKM_sk_is_sorted(STACK_OF_X509_NAME_ENTRY, (st))
+# define sk_STORE_ATTR_INFO_new(cmp) SKM_sk_new(STORE_ATTR_INFO, (cmp))
+# define sk_STORE_ATTR_INFO_new_null() SKM_sk_new_null(STORE_ATTR_INFO)
+# define sk_STORE_ATTR_INFO_free(st) SKM_sk_free(STORE_ATTR_INFO, (st))
+# define sk_STORE_ATTR_INFO_num(st) SKM_sk_num(STORE_ATTR_INFO, (st))
+# define sk_STORE_ATTR_INFO_value(st, i) SKM_sk_value(STORE_ATTR_INFO, (st), (i))
+# define sk_STORE_ATTR_INFO_set(st, i, val) SKM_sk_set(STORE_ATTR_INFO, (st), (i), (val))
+# define sk_STORE_ATTR_INFO_zero(st) SKM_sk_zero(STORE_ATTR_INFO, (st))
+# define sk_STORE_ATTR_INFO_push(st, val) SKM_sk_push(STORE_ATTR_INFO, (st), (val))
+# define sk_STORE_ATTR_INFO_unshift(st, val) SKM_sk_unshift(STORE_ATTR_INFO, (st), (val))
+# define sk_STORE_ATTR_INFO_find(st, val) SKM_sk_find(STORE_ATTR_INFO, (st), (val))
+# define sk_STORE_ATTR_INFO_find_ex(st, val) SKM_sk_find_ex(STORE_ATTR_INFO, (st), (val))
+# define sk_STORE_ATTR_INFO_delete(st, i) SKM_sk_delete(STORE_ATTR_INFO, (st), (i))
+# define sk_STORE_ATTR_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(STORE_ATTR_INFO, (st), (ptr))
+# define sk_STORE_ATTR_INFO_insert(st, val, i) SKM_sk_insert(STORE_ATTR_INFO, (st), (val), (i))
+# define sk_STORE_ATTR_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(STORE_ATTR_INFO, (st), (cmp))
+# define sk_STORE_ATTR_INFO_dup(st) SKM_sk_dup(STORE_ATTR_INFO, st)
+# define sk_STORE_ATTR_INFO_pop_free(st, free_func) SKM_sk_pop_free(STORE_ATTR_INFO, (st), (free_func))
+# define sk_STORE_ATTR_INFO_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(STORE_ATTR_INFO, (st), (copy_func), (free_func))
+# define sk_STORE_ATTR_INFO_shift(st) SKM_sk_shift(STORE_ATTR_INFO, (st))
+# define sk_STORE_ATTR_INFO_pop(st) SKM_sk_pop(STORE_ATTR_INFO, (st))
+# define sk_STORE_ATTR_INFO_sort(st) SKM_sk_sort(STORE_ATTR_INFO, (st))
+# define sk_STORE_ATTR_INFO_is_sorted(st) SKM_sk_is_sorted(STORE_ATTR_INFO, (st))
+# define sk_STORE_OBJECT_new(cmp) SKM_sk_new(STORE_OBJECT, (cmp))
+# define sk_STORE_OBJECT_new_null() SKM_sk_new_null(STORE_OBJECT)
+# define sk_STORE_OBJECT_free(st) SKM_sk_free(STORE_OBJECT, (st))
+# define sk_STORE_OBJECT_num(st) SKM_sk_num(STORE_OBJECT, (st))
+# define sk_STORE_OBJECT_value(st, i) SKM_sk_value(STORE_OBJECT, (st), (i))
+# define sk_STORE_OBJECT_set(st, i, val) SKM_sk_set(STORE_OBJECT, (st), (i), (val))
+# define sk_STORE_OBJECT_zero(st) SKM_sk_zero(STORE_OBJECT, (st))
+# define sk_STORE_OBJECT_push(st, val) SKM_sk_push(STORE_OBJECT, (st), (val))
+# define sk_STORE_OBJECT_unshift(st, val) SKM_sk_unshift(STORE_OBJECT, (st), (val))
+# define sk_STORE_OBJECT_find(st, val) SKM_sk_find(STORE_OBJECT, (st), (val))
+# define sk_STORE_OBJECT_find_ex(st, val) SKM_sk_find_ex(STORE_OBJECT, (st), (val))
+# define sk_STORE_OBJECT_delete(st, i) SKM_sk_delete(STORE_OBJECT, (st), (i))
+# define sk_STORE_OBJECT_delete_ptr(st, ptr) SKM_sk_delete_ptr(STORE_OBJECT, (st), (ptr))
+# define sk_STORE_OBJECT_insert(st, val, i) SKM_sk_insert(STORE_OBJECT, (st), (val), (i))
+# define sk_STORE_OBJECT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(STORE_OBJECT, (st), (cmp))
+# define sk_STORE_OBJECT_dup(st) SKM_sk_dup(STORE_OBJECT, st)
+# define sk_STORE_OBJECT_pop_free(st, free_func) SKM_sk_pop_free(STORE_OBJECT, (st), (free_func))
+# define sk_STORE_OBJECT_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(STORE_OBJECT, (st), (copy_func), (free_func))
+# define sk_STORE_OBJECT_shift(st) SKM_sk_shift(STORE_OBJECT, (st))
+# define sk_STORE_OBJECT_pop(st) SKM_sk_pop(STORE_OBJECT, (st))
+# define sk_STORE_OBJECT_sort(st) SKM_sk_sort(STORE_OBJECT, (st))
+# define sk_STORE_OBJECT_is_sorted(st) SKM_sk_is_sorted(STORE_OBJECT, (st))
+# define sk_SXNETID_new(cmp) SKM_sk_new(SXNETID, (cmp))
+# define sk_SXNETID_new_null() SKM_sk_new_null(SXNETID)
+# define sk_SXNETID_free(st) SKM_sk_free(SXNETID, (st))
+# define sk_SXNETID_num(st) SKM_sk_num(SXNETID, (st))
+# define sk_SXNETID_value(st, i) SKM_sk_value(SXNETID, (st), (i))
+# define sk_SXNETID_set(st, i, val) SKM_sk_set(SXNETID, (st), (i), (val))
+# define sk_SXNETID_zero(st) SKM_sk_zero(SXNETID, (st))
+# define sk_SXNETID_push(st, val) SKM_sk_push(SXNETID, (st), (val))
+# define sk_SXNETID_unshift(st, val) SKM_sk_unshift(SXNETID, (st), (val))
+# define sk_SXNETID_find(st, val) SKM_sk_find(SXNETID, (st), (val))
+# define sk_SXNETID_find_ex(st, val) SKM_sk_find_ex(SXNETID, (st), (val))
+# define sk_SXNETID_delete(st, i) SKM_sk_delete(SXNETID, (st), (i))
+# define sk_SXNETID_delete_ptr(st, ptr) SKM_sk_delete_ptr(SXNETID, (st), (ptr))
+# define sk_SXNETID_insert(st, val, i) SKM_sk_insert(SXNETID, (st), (val), (i))
+# define sk_SXNETID_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SXNETID, (st), (cmp))
+# define sk_SXNETID_dup(st) SKM_sk_dup(SXNETID, st)
+# define sk_SXNETID_pop_free(st, free_func) SKM_sk_pop_free(SXNETID, (st), (free_func))
+# define sk_SXNETID_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SXNETID, (st), (copy_func), (free_func))
+# define sk_SXNETID_shift(st) SKM_sk_shift(SXNETID, (st))
+# define sk_SXNETID_pop(st) SKM_sk_pop(SXNETID, (st))
+# define sk_SXNETID_sort(st) SKM_sk_sort(SXNETID, (st))
+# define sk_SXNETID_is_sorted(st) SKM_sk_is_sorted(SXNETID, (st))
+# define sk_UI_STRING_new(cmp) SKM_sk_new(UI_STRING, (cmp))
+# define sk_UI_STRING_new_null() SKM_sk_new_null(UI_STRING)
+# define sk_UI_STRING_free(st) SKM_sk_free(UI_STRING, (st))
+# define sk_UI_STRING_num(st) SKM_sk_num(UI_STRING, (st))
+# define sk_UI_STRING_value(st, i) SKM_sk_value(UI_STRING, (st), (i))
+# define sk_UI_STRING_set(st, i, val) SKM_sk_set(UI_STRING, (st), (i), (val))
+# define sk_UI_STRING_zero(st) SKM_sk_zero(UI_STRING, (st))
+# define sk_UI_STRING_push(st, val) SKM_sk_push(UI_STRING, (st), (val))
+# define sk_UI_STRING_unshift(st, val) SKM_sk_unshift(UI_STRING, (st), (val))
+# define sk_UI_STRING_find(st, val) SKM_sk_find(UI_STRING, (st), (val))
+# define sk_UI_STRING_find_ex(st, val) SKM_sk_find_ex(UI_STRING, (st), (val))
+# define sk_UI_STRING_delete(st, i) SKM_sk_delete(UI_STRING, (st), (i))
+# define sk_UI_STRING_delete_ptr(st, ptr) SKM_sk_delete_ptr(UI_STRING, (st), (ptr))
+# define sk_UI_STRING_insert(st, val, i) SKM_sk_insert(UI_STRING, (st), (val), (i))
+# define sk_UI_STRING_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(UI_STRING, (st), (cmp))
+# define sk_UI_STRING_dup(st) SKM_sk_dup(UI_STRING, st)
+# define sk_UI_STRING_pop_free(st, free_func) SKM_sk_pop_free(UI_STRING, (st), (free_func))
+# define sk_UI_STRING_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(UI_STRING, (st), (copy_func), (free_func))
+# define sk_UI_STRING_shift(st) SKM_sk_shift(UI_STRING, (st))
+# define sk_UI_STRING_pop(st) SKM_sk_pop(UI_STRING, (st))
+# define sk_UI_STRING_sort(st) SKM_sk_sort(UI_STRING, (st))
+# define sk_UI_STRING_is_sorted(st) SKM_sk_is_sorted(UI_STRING, (st))
+# define sk_X509_new(cmp) SKM_sk_new(X509, (cmp))
+# define sk_X509_new_null() SKM_sk_new_null(X509)
+# define sk_X509_free(st) SKM_sk_free(X509, (st))
+# define sk_X509_num(st) SKM_sk_num(X509, (st))
+# define sk_X509_value(st, i) SKM_sk_value(X509, (st), (i))
+# define sk_X509_set(st, i, val) SKM_sk_set(X509, (st), (i), (val))
+# define sk_X509_zero(st) SKM_sk_zero(X509, (st))
+# define sk_X509_push(st, val) SKM_sk_push(X509, (st), (val))
+# define sk_X509_unshift(st, val) SKM_sk_unshift(X509, (st), (val))
+# define sk_X509_find(st, val) SKM_sk_find(X509, (st), (val))
+# define sk_X509_find_ex(st, val) SKM_sk_find_ex(X509, (st), (val))
+# define sk_X509_delete(st, i) SKM_sk_delete(X509, (st), (i))
+# define sk_X509_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509, (st), (ptr))
+# define sk_X509_insert(st, val, i) SKM_sk_insert(X509, (st), (val), (i))
+# define sk_X509_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509, (st), (cmp))
+# define sk_X509_dup(st) SKM_sk_dup(X509, st)
+# define sk_X509_pop_free(st, free_func) SKM_sk_pop_free(X509, (st), (free_func))
+# define sk_X509_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509, (st), (copy_func), (free_func))
+# define sk_X509_shift(st) SKM_sk_shift(X509, (st))
+# define sk_X509_pop(st) SKM_sk_pop(X509, (st))
+# define sk_X509_sort(st) SKM_sk_sort(X509, (st))
+# define sk_X509_is_sorted(st) SKM_sk_is_sorted(X509, (st))
+# define sk_X509V3_EXT_METHOD_new(cmp) SKM_sk_new(X509V3_EXT_METHOD, (cmp))
+# define sk_X509V3_EXT_METHOD_new_null() SKM_sk_new_null(X509V3_EXT_METHOD)
+# define sk_X509V3_EXT_METHOD_free(st) SKM_sk_free(X509V3_EXT_METHOD, (st))
+# define sk_X509V3_EXT_METHOD_num(st) SKM_sk_num(X509V3_EXT_METHOD, (st))
+# define sk_X509V3_EXT_METHOD_value(st, i) SKM_sk_value(X509V3_EXT_METHOD, (st), (i))
+# define sk_X509V3_EXT_METHOD_set(st, i, val) SKM_sk_set(X509V3_EXT_METHOD, (st), (i), (val))
+# define sk_X509V3_EXT_METHOD_zero(st) SKM_sk_zero(X509V3_EXT_METHOD, (st))
+# define sk_X509V3_EXT_METHOD_push(st, val) SKM_sk_push(X509V3_EXT_METHOD, (st), (val))
+# define sk_X509V3_EXT_METHOD_unshift(st, val) SKM_sk_unshift(X509V3_EXT_METHOD, (st), (val))
+# define sk_X509V3_EXT_METHOD_find(st, val) SKM_sk_find(X509V3_EXT_METHOD, (st), (val))
+# define sk_X509V3_EXT_METHOD_find_ex(st, val) SKM_sk_find_ex(X509V3_EXT_METHOD, (st), (val))
+# define sk_X509V3_EXT_METHOD_delete(st, i) SKM_sk_delete(X509V3_EXT_METHOD, (st), (i))
+# define sk_X509V3_EXT_METHOD_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509V3_EXT_METHOD, (st), (ptr))
+# define sk_X509V3_EXT_METHOD_insert(st, val, i) SKM_sk_insert(X509V3_EXT_METHOD, (st), (val), (i))
+# define sk_X509V3_EXT_METHOD_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509V3_EXT_METHOD, (st), (cmp))
+# define sk_X509V3_EXT_METHOD_dup(st) SKM_sk_dup(X509V3_EXT_METHOD, st)
+# define sk_X509V3_EXT_METHOD_pop_free(st, free_func) SKM_sk_pop_free(X509V3_EXT_METHOD, (st), (free_func))
+# define sk_X509V3_EXT_METHOD_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509V3_EXT_METHOD, (st), (copy_func), (free_func))
+# define sk_X509V3_EXT_METHOD_shift(st) SKM_sk_shift(X509V3_EXT_METHOD, (st))
+# define sk_X509V3_EXT_METHOD_pop(st) SKM_sk_pop(X509V3_EXT_METHOD, (st))
+# define sk_X509V3_EXT_METHOD_sort(st) SKM_sk_sort(X509V3_EXT_METHOD, (st))
+# define sk_X509V3_EXT_METHOD_is_sorted(st) SKM_sk_is_sorted(X509V3_EXT_METHOD, (st))
+# define sk_X509_ALGOR_new(cmp) SKM_sk_new(X509_ALGOR, (cmp))
+# define sk_X509_ALGOR_new_null() SKM_sk_new_null(X509_ALGOR)
+# define sk_X509_ALGOR_free(st) SKM_sk_free(X509_ALGOR, (st))
+# define sk_X509_ALGOR_num(st) SKM_sk_num(X509_ALGOR, (st))
+# define sk_X509_ALGOR_value(st, i) SKM_sk_value(X509_ALGOR, (st), (i))
+# define sk_X509_ALGOR_set(st, i, val) SKM_sk_set(X509_ALGOR, (st), (i), (val))
+# define sk_X509_ALGOR_zero(st) SKM_sk_zero(X509_ALGOR, (st))
+# define sk_X509_ALGOR_push(st, val) SKM_sk_push(X509_ALGOR, (st), (val))
+# define sk_X509_ALGOR_unshift(st, val) SKM_sk_unshift(X509_ALGOR, (st), (val))
+# define sk_X509_ALGOR_find(st, val) SKM_sk_find(X509_ALGOR, (st), (val))
+# define sk_X509_ALGOR_find_ex(st, val) SKM_sk_find_ex(X509_ALGOR, (st), (val))
+# define sk_X509_ALGOR_delete(st, i) SKM_sk_delete(X509_ALGOR, (st), (i))
+# define sk_X509_ALGOR_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_ALGOR, (st), (ptr))
+# define sk_X509_ALGOR_insert(st, val, i) SKM_sk_insert(X509_ALGOR, (st), (val), (i))
+# define sk_X509_ALGOR_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_ALGOR, (st), (cmp))
+# define sk_X509_ALGOR_dup(st) SKM_sk_dup(X509_ALGOR, st)
+# define sk_X509_ALGOR_pop_free(st, free_func) SKM_sk_pop_free(X509_ALGOR, (st), (free_func))
+# define sk_X509_ALGOR_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_ALGOR, (st), (copy_func), (free_func))
+# define sk_X509_ALGOR_shift(st) SKM_sk_shift(X509_ALGOR, (st))
+# define sk_X509_ALGOR_pop(st) SKM_sk_pop(X509_ALGOR, (st))
+# define sk_X509_ALGOR_sort(st) SKM_sk_sort(X509_ALGOR, (st))
+# define sk_X509_ALGOR_is_sorted(st) SKM_sk_is_sorted(X509_ALGOR, (st))
+# define sk_X509_ATTRIBUTE_new(cmp) SKM_sk_new(X509_ATTRIBUTE, (cmp))
+# define sk_X509_ATTRIBUTE_new_null() SKM_sk_new_null(X509_ATTRIBUTE)
+# define sk_X509_ATTRIBUTE_free(st) SKM_sk_free(X509_ATTRIBUTE, (st))
+# define sk_X509_ATTRIBUTE_num(st) SKM_sk_num(X509_ATTRIBUTE, (st))
+# define sk_X509_ATTRIBUTE_value(st, i) SKM_sk_value(X509_ATTRIBUTE, (st), (i))
+# define sk_X509_ATTRIBUTE_set(st, i, val) SKM_sk_set(X509_ATTRIBUTE, (st), (i), (val))
+# define sk_X509_ATTRIBUTE_zero(st) SKM_sk_zero(X509_ATTRIBUTE, (st))
+# define sk_X509_ATTRIBUTE_push(st, val) SKM_sk_push(X509_ATTRIBUTE, (st), (val))
+# define sk_X509_ATTRIBUTE_unshift(st, val) SKM_sk_unshift(X509_ATTRIBUTE, (st), (val))
+# define sk_X509_ATTRIBUTE_find(st, val) SKM_sk_find(X509_ATTRIBUTE, (st), (val))
+# define sk_X509_ATTRIBUTE_find_ex(st, val) SKM_sk_find_ex(X509_ATTRIBUTE, (st), (val))
+# define sk_X509_ATTRIBUTE_delete(st, i) SKM_sk_delete(X509_ATTRIBUTE, (st), (i))
+# define sk_X509_ATTRIBUTE_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_ATTRIBUTE, (st), (ptr))
+# define sk_X509_ATTRIBUTE_insert(st, val, i) SKM_sk_insert(X509_ATTRIBUTE, (st), (val), (i))
+# define sk_X509_ATTRIBUTE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_ATTRIBUTE, (st), (cmp))
+# define sk_X509_ATTRIBUTE_dup(st) SKM_sk_dup(X509_ATTRIBUTE, st)
+# define sk_X509_ATTRIBUTE_pop_free(st, free_func) SKM_sk_pop_free(X509_ATTRIBUTE, (st), (free_func))
+# define sk_X509_ATTRIBUTE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_ATTRIBUTE, (st), (copy_func), (free_func))
+# define sk_X509_ATTRIBUTE_shift(st) SKM_sk_shift(X509_ATTRIBUTE, (st))
+# define sk_X509_ATTRIBUTE_pop(st) SKM_sk_pop(X509_ATTRIBUTE, (st))
+# define sk_X509_ATTRIBUTE_sort(st) SKM_sk_sort(X509_ATTRIBUTE, (st))
+# define sk_X509_ATTRIBUTE_is_sorted(st) SKM_sk_is_sorted(X509_ATTRIBUTE, (st))
+# define sk_X509_CRL_new(cmp) SKM_sk_new(X509_CRL, (cmp))
+# define sk_X509_CRL_new_null() SKM_sk_new_null(X509_CRL)
+# define sk_X509_CRL_free(st) SKM_sk_free(X509_CRL, (st))
+# define sk_X509_CRL_num(st) SKM_sk_num(X509_CRL, (st))
+# define sk_X509_CRL_value(st, i) SKM_sk_value(X509_CRL, (st), (i))
+# define sk_X509_CRL_set(st, i, val) SKM_sk_set(X509_CRL, (st), (i), (val))
+# define sk_X509_CRL_zero(st) SKM_sk_zero(X509_CRL, (st))
+# define sk_X509_CRL_push(st, val) SKM_sk_push(X509_CRL, (st), (val))
+# define sk_X509_CRL_unshift(st, val) SKM_sk_unshift(X509_CRL, (st), (val))
+# define sk_X509_CRL_find(st, val) SKM_sk_find(X509_CRL, (st), (val))
+# define sk_X509_CRL_find_ex(st, val) SKM_sk_find_ex(X509_CRL, (st), (val))
+# define sk_X509_CRL_delete(st, i) SKM_sk_delete(X509_CRL, (st), (i))
+# define sk_X509_CRL_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_CRL, (st), (ptr))
+# define sk_X509_CRL_insert(st, val, i) SKM_sk_insert(X509_CRL, (st), (val), (i))
+# define sk_X509_CRL_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_CRL, (st), (cmp))
+# define sk_X509_CRL_dup(st) SKM_sk_dup(X509_CRL, st)
+# define sk_X509_CRL_pop_free(st, free_func) SKM_sk_pop_free(X509_CRL, (st), (free_func))
+# define sk_X509_CRL_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_CRL, (st), (copy_func), (free_func))
+# define sk_X509_CRL_shift(st) SKM_sk_shift(X509_CRL, (st))
+# define sk_X509_CRL_pop(st) SKM_sk_pop(X509_CRL, (st))
+# define sk_X509_CRL_sort(st) SKM_sk_sort(X509_CRL, (st))
+# define sk_X509_CRL_is_sorted(st) SKM_sk_is_sorted(X509_CRL, (st))
+# define sk_X509_EXTENSION_new(cmp) SKM_sk_new(X509_EXTENSION, (cmp))
+# define sk_X509_EXTENSION_new_null() SKM_sk_new_null(X509_EXTENSION)
+# define sk_X509_EXTENSION_free(st) SKM_sk_free(X509_EXTENSION, (st))
+# define sk_X509_EXTENSION_num(st) SKM_sk_num(X509_EXTENSION, (st))
+# define sk_X509_EXTENSION_value(st, i) SKM_sk_value(X509_EXTENSION, (st), (i))
+# define sk_X509_EXTENSION_set(st, i, val) SKM_sk_set(X509_EXTENSION, (st), (i), (val))
+# define sk_X509_EXTENSION_zero(st) SKM_sk_zero(X509_EXTENSION, (st))
+# define sk_X509_EXTENSION_push(st, val) SKM_sk_push(X509_EXTENSION, (st), (val))
+# define sk_X509_EXTENSION_unshift(st, val) SKM_sk_unshift(X509_EXTENSION, (st), (val))
+# define sk_X509_EXTENSION_find(st, val) SKM_sk_find(X509_EXTENSION, (st), (val))
+# define sk_X509_EXTENSION_find_ex(st, val) SKM_sk_find_ex(X509_EXTENSION, (st), (val))
+# define sk_X509_EXTENSION_delete(st, i) SKM_sk_delete(X509_EXTENSION, (st), (i))
+# define sk_X509_EXTENSION_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_EXTENSION, (st), (ptr))
+# define sk_X509_EXTENSION_insert(st, val, i) SKM_sk_insert(X509_EXTENSION, (st), (val), (i))
+# define sk_X509_EXTENSION_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_EXTENSION, (st), (cmp))
+# define sk_X509_EXTENSION_dup(st) SKM_sk_dup(X509_EXTENSION, st)
+# define sk_X509_EXTENSION_pop_free(st, free_func) SKM_sk_pop_free(X509_EXTENSION, (st), (free_func))
+# define sk_X509_EXTENSION_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_EXTENSION, (st), (copy_func), (free_func))
+# define sk_X509_EXTENSION_shift(st) SKM_sk_shift(X509_EXTENSION, (st))
+# define sk_X509_EXTENSION_pop(st) SKM_sk_pop(X509_EXTENSION, (st))
+# define sk_X509_EXTENSION_sort(st) SKM_sk_sort(X509_EXTENSION, (st))
+# define sk_X509_EXTENSION_is_sorted(st) SKM_sk_is_sorted(X509_EXTENSION, (st))
+# define sk_X509_INFO_new(cmp) SKM_sk_new(X509_INFO, (cmp))
+# define sk_X509_INFO_new_null() SKM_sk_new_null(X509_INFO)
+# define sk_X509_INFO_free(st) SKM_sk_free(X509_INFO, (st))
+# define sk_X509_INFO_num(st) SKM_sk_num(X509_INFO, (st))
+# define sk_X509_INFO_value(st, i) SKM_sk_value(X509_INFO, (st), (i))
+# define sk_X509_INFO_set(st, i, val) SKM_sk_set(X509_INFO, (st), (i), (val))
+# define sk_X509_INFO_zero(st) SKM_sk_zero(X509_INFO, (st))
+# define sk_X509_INFO_push(st, val) SKM_sk_push(X509_INFO, (st), (val))
+# define sk_X509_INFO_unshift(st, val) SKM_sk_unshift(X509_INFO, (st), (val))
+# define sk_X509_INFO_find(st, val) SKM_sk_find(X509_INFO, (st), (val))
+# define sk_X509_INFO_find_ex(st, val) SKM_sk_find_ex(X509_INFO, (st), (val))
+# define sk_X509_INFO_delete(st, i) SKM_sk_delete(X509_INFO, (st), (i))
+# define sk_X509_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_INFO, (st), (ptr))
+# define sk_X509_INFO_insert(st, val, i) SKM_sk_insert(X509_INFO, (st), (val), (i))
+# define sk_X509_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_INFO, (st), (cmp))
+# define sk_X509_INFO_dup(st) SKM_sk_dup(X509_INFO, st)
+# define sk_X509_INFO_pop_free(st, free_func) SKM_sk_pop_free(X509_INFO, (st), (free_func))
+# define sk_X509_INFO_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_INFO, (st), (copy_func), (free_func))
+# define sk_X509_INFO_shift(st) SKM_sk_shift(X509_INFO, (st))
+# define sk_X509_INFO_pop(st) SKM_sk_pop(X509_INFO, (st))
+# define sk_X509_INFO_sort(st) SKM_sk_sort(X509_INFO, (st))
+# define sk_X509_INFO_is_sorted(st) SKM_sk_is_sorted(X509_INFO, (st))
+# define sk_X509_LOOKUP_new(cmp) SKM_sk_new(X509_LOOKUP, (cmp))
+# define sk_X509_LOOKUP_new_null() SKM_sk_new_null(X509_LOOKUP)
+# define sk_X509_LOOKUP_free(st) SKM_sk_free(X509_LOOKUP, (st))
+# define sk_X509_LOOKUP_num(st) SKM_sk_num(X509_LOOKUP, (st))
+# define sk_X509_LOOKUP_value(st, i) SKM_sk_value(X509_LOOKUP, (st), (i))
+# define sk_X509_LOOKUP_set(st, i, val) SKM_sk_set(X509_LOOKUP, (st), (i), (val))
+# define sk_X509_LOOKUP_zero(st) SKM_sk_zero(X509_LOOKUP, (st))
+# define sk_X509_LOOKUP_push(st, val) SKM_sk_push(X509_LOOKUP, (st), (val))
+# define sk_X509_LOOKUP_unshift(st, val) SKM_sk_unshift(X509_LOOKUP, (st), (val))
+# define sk_X509_LOOKUP_find(st, val) SKM_sk_find(X509_LOOKUP, (st), (val))
+# define sk_X509_LOOKUP_find_ex(st, val) SKM_sk_find_ex(X509_LOOKUP, (st), (val))
+# define sk_X509_LOOKUP_delete(st, i) SKM_sk_delete(X509_LOOKUP, (st), (i))
+# define sk_X509_LOOKUP_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_LOOKUP, (st), (ptr))
+# define sk_X509_LOOKUP_insert(st, val, i) SKM_sk_insert(X509_LOOKUP, (st), (val), (i))
+# define sk_X509_LOOKUP_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_LOOKUP, (st), (cmp))
+# define sk_X509_LOOKUP_dup(st) SKM_sk_dup(X509_LOOKUP, st)
+# define sk_X509_LOOKUP_pop_free(st, free_func) SKM_sk_pop_free(X509_LOOKUP, (st), (free_func))
+# define sk_X509_LOOKUP_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_LOOKUP, (st), (copy_func), (free_func))
+# define sk_X509_LOOKUP_shift(st) SKM_sk_shift(X509_LOOKUP, (st))
+# define sk_X509_LOOKUP_pop(st) SKM_sk_pop(X509_LOOKUP, (st))
+# define sk_X509_LOOKUP_sort(st) SKM_sk_sort(X509_LOOKUP, (st))
+# define sk_X509_LOOKUP_is_sorted(st) SKM_sk_is_sorted(X509_LOOKUP, (st))
+# define sk_X509_NAME_new(cmp) SKM_sk_new(X509_NAME, (cmp))
+# define sk_X509_NAME_new_null() SKM_sk_new_null(X509_NAME)
+# define sk_X509_NAME_free(st) SKM_sk_free(X509_NAME, (st))
+# define sk_X509_NAME_num(st) SKM_sk_num(X509_NAME, (st))
+# define sk_X509_NAME_value(st, i) SKM_sk_value(X509_NAME, (st), (i))
+# define sk_X509_NAME_set(st, i, val) SKM_sk_set(X509_NAME, (st), (i), (val))
+# define sk_X509_NAME_zero(st) SKM_sk_zero(X509_NAME, (st))
+# define sk_X509_NAME_push(st, val) SKM_sk_push(X509_NAME, (st), (val))
+# define sk_X509_NAME_unshift(st, val) SKM_sk_unshift(X509_NAME, (st), (val))
+# define sk_X509_NAME_find(st, val) SKM_sk_find(X509_NAME, (st), (val))
+# define sk_X509_NAME_find_ex(st, val) SKM_sk_find_ex(X509_NAME, (st), (val))
+# define sk_X509_NAME_delete(st, i) SKM_sk_delete(X509_NAME, (st), (i))
+# define sk_X509_NAME_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_NAME, (st), (ptr))
+# define sk_X509_NAME_insert(st, val, i) SKM_sk_insert(X509_NAME, (st), (val), (i))
+# define sk_X509_NAME_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_NAME, (st), (cmp))
+# define sk_X509_NAME_dup(st) SKM_sk_dup(X509_NAME, st)
+# define sk_X509_NAME_pop_free(st, free_func) SKM_sk_pop_free(X509_NAME, (st), (free_func))
+# define sk_X509_NAME_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_NAME, (st), (copy_func), (free_func))
+# define sk_X509_NAME_shift(st) SKM_sk_shift(X509_NAME, (st))
+# define sk_X509_NAME_pop(st) SKM_sk_pop(X509_NAME, (st))
+# define sk_X509_NAME_sort(st) SKM_sk_sort(X509_NAME, (st))
+# define sk_X509_NAME_is_sorted(st) SKM_sk_is_sorted(X509_NAME, (st))
+# define sk_X509_NAME_ENTRY_new(cmp) SKM_sk_new(X509_NAME_ENTRY, (cmp))
+# define sk_X509_NAME_ENTRY_new_null() SKM_sk_new_null(X509_NAME_ENTRY)
+# define sk_X509_NAME_ENTRY_free(st) SKM_sk_free(X509_NAME_ENTRY, (st))
+# define sk_X509_NAME_ENTRY_num(st) SKM_sk_num(X509_NAME_ENTRY, (st))
+# define sk_X509_NAME_ENTRY_value(st, i) SKM_sk_value(X509_NAME_ENTRY, (st), (i))
+# define sk_X509_NAME_ENTRY_set(st, i, val) SKM_sk_set(X509_NAME_ENTRY, (st), (i), (val))
+# define sk_X509_NAME_ENTRY_zero(st) SKM_sk_zero(X509_NAME_ENTRY, (st))
+# define sk_X509_NAME_ENTRY_push(st, val) SKM_sk_push(X509_NAME_ENTRY, (st), (val))
+# define sk_X509_NAME_ENTRY_unshift(st, val) SKM_sk_unshift(X509_NAME_ENTRY, (st), (val))
+# define sk_X509_NAME_ENTRY_find(st, val) SKM_sk_find(X509_NAME_ENTRY, (st), (val))
+# define sk_X509_NAME_ENTRY_find_ex(st, val) SKM_sk_find_ex(X509_NAME_ENTRY, (st), (val))
+# define sk_X509_NAME_ENTRY_delete(st, i) SKM_sk_delete(X509_NAME_ENTRY, (st), (i))
+# define sk_X509_NAME_ENTRY_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_NAME_ENTRY, (st), (ptr))
+# define sk_X509_NAME_ENTRY_insert(st, val, i) SKM_sk_insert(X509_NAME_ENTRY, (st), (val), (i))
+# define sk_X509_NAME_ENTRY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_NAME_ENTRY, (st), (cmp))
+# define sk_X509_NAME_ENTRY_dup(st) SKM_sk_dup(X509_NAME_ENTRY, st)
+# define sk_X509_NAME_ENTRY_pop_free(st, free_func) SKM_sk_pop_free(X509_NAME_ENTRY, (st), (free_func))
+# define sk_X509_NAME_ENTRY_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_NAME_ENTRY, (st), (copy_func), (free_func))
+# define sk_X509_NAME_ENTRY_shift(st) SKM_sk_shift(X509_NAME_ENTRY, (st))
+# define sk_X509_NAME_ENTRY_pop(st) SKM_sk_pop(X509_NAME_ENTRY, (st))
+# define sk_X509_NAME_ENTRY_sort(st) SKM_sk_sort(X509_NAME_ENTRY, (st))
+# define sk_X509_NAME_ENTRY_is_sorted(st) SKM_sk_is_sorted(X509_NAME_ENTRY, (st))
+# define sk_X509_OBJECT_new(cmp) SKM_sk_new(X509_OBJECT, (cmp))
+# define sk_X509_OBJECT_new_null() SKM_sk_new_null(X509_OBJECT)
+# define sk_X509_OBJECT_free(st) SKM_sk_free(X509_OBJECT, (st))
+# define sk_X509_OBJECT_num(st) SKM_sk_num(X509_OBJECT, (st))
+# define sk_X509_OBJECT_value(st, i) SKM_sk_value(X509_OBJECT, (st), (i))
+# define sk_X509_OBJECT_set(st, i, val) SKM_sk_set(X509_OBJECT, (st), (i), (val))
+# define sk_X509_OBJECT_zero(st) SKM_sk_zero(X509_OBJECT, (st))
+# define sk_X509_OBJECT_push(st, val) SKM_sk_push(X509_OBJECT, (st), (val))
+# define sk_X509_OBJECT_unshift(st, val) SKM_sk_unshift(X509_OBJECT, (st), (val))
+# define sk_X509_OBJECT_find(st, val) SKM_sk_find(X509_OBJECT, (st), (val))
+# define sk_X509_OBJECT_find_ex(st, val) SKM_sk_find_ex(X509_OBJECT, (st), (val))
+# define sk_X509_OBJECT_delete(st, i) SKM_sk_delete(X509_OBJECT, (st), (i))
+# define sk_X509_OBJECT_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_OBJECT, (st), (ptr))
+# define sk_X509_OBJECT_insert(st, val, i) SKM_sk_insert(X509_OBJECT, (st), (val), (i))
+# define sk_X509_OBJECT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_OBJECT, (st), (cmp))
+# define sk_X509_OBJECT_dup(st) SKM_sk_dup(X509_OBJECT, st)
+# define sk_X509_OBJECT_pop_free(st, free_func) SKM_sk_pop_free(X509_OBJECT, (st), (free_func))
+# define sk_X509_OBJECT_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_OBJECT, (st), (copy_func), (free_func))
+# define sk_X509_OBJECT_shift(st) SKM_sk_shift(X509_OBJECT, (st))
+# define sk_X509_OBJECT_pop(st) SKM_sk_pop(X509_OBJECT, (st))
+# define sk_X509_OBJECT_sort(st) SKM_sk_sort(X509_OBJECT, (st))
+# define sk_X509_OBJECT_is_sorted(st) SKM_sk_is_sorted(X509_OBJECT, (st))
+# define sk_X509_POLICY_DATA_new(cmp) SKM_sk_new(X509_POLICY_DATA, (cmp))
+# define sk_X509_POLICY_DATA_new_null() SKM_sk_new_null(X509_POLICY_DATA)
+# define sk_X509_POLICY_DATA_free(st) SKM_sk_free(X509_POLICY_DATA, (st))
+# define sk_X509_POLICY_DATA_num(st) SKM_sk_num(X509_POLICY_DATA, (st))
+# define sk_X509_POLICY_DATA_value(st, i) SKM_sk_value(X509_POLICY_DATA, (st), (i))
+# define sk_X509_POLICY_DATA_set(st, i, val) SKM_sk_set(X509_POLICY_DATA, (st), (i), (val))
+# define sk_X509_POLICY_DATA_zero(st) SKM_sk_zero(X509_POLICY_DATA, (st))
+# define sk_X509_POLICY_DATA_push(st, val) SKM_sk_push(X509_POLICY_DATA, (st), (val))
+# define sk_X509_POLICY_DATA_unshift(st, val) SKM_sk_unshift(X509_POLICY_DATA, (st), (val))
+# define sk_X509_POLICY_DATA_find(st, val) SKM_sk_find(X509_POLICY_DATA, (st), (val))
+# define sk_X509_POLICY_DATA_find_ex(st, val) SKM_sk_find_ex(X509_POLICY_DATA, (st), (val))
+# define sk_X509_POLICY_DATA_delete(st, i) SKM_sk_delete(X509_POLICY_DATA, (st), (i))
+# define sk_X509_POLICY_DATA_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_POLICY_DATA, (st), (ptr))
+# define sk_X509_POLICY_DATA_insert(st, val, i) SKM_sk_insert(X509_POLICY_DATA, (st), (val), (i))
+# define sk_X509_POLICY_DATA_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_POLICY_DATA, (st), (cmp))
+# define sk_X509_POLICY_DATA_dup(st) SKM_sk_dup(X509_POLICY_DATA, st)
+# define sk_X509_POLICY_DATA_pop_free(st, free_func) SKM_sk_pop_free(X509_POLICY_DATA, (st), (free_func))
+# define sk_X509_POLICY_DATA_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_POLICY_DATA, (st), (copy_func), (free_func))
+# define sk_X509_POLICY_DATA_shift(st) SKM_sk_shift(X509_POLICY_DATA, (st))
+# define sk_X509_POLICY_DATA_pop(st) SKM_sk_pop(X509_POLICY_DATA, (st))
+# define sk_X509_POLICY_DATA_sort(st) SKM_sk_sort(X509_POLICY_DATA, (st))
+# define sk_X509_POLICY_DATA_is_sorted(st) SKM_sk_is_sorted(X509_POLICY_DATA, (st))
+# define sk_X509_POLICY_NODE_new(cmp) SKM_sk_new(X509_POLICY_NODE, (cmp))
+# define sk_X509_POLICY_NODE_new_null() SKM_sk_new_null(X509_POLICY_NODE)
+# define sk_X509_POLICY_NODE_free(st) SKM_sk_free(X509_POLICY_NODE, (st))
+# define sk_X509_POLICY_NODE_num(st) SKM_sk_num(X509_POLICY_NODE, (st))
+# define sk_X509_POLICY_NODE_value(st, i) SKM_sk_value(X509_POLICY_NODE, (st), (i))
+# define sk_X509_POLICY_NODE_set(st, i, val) SKM_sk_set(X509_POLICY_NODE, (st), (i), (val))
+# define sk_X509_POLICY_NODE_zero(st) SKM_sk_zero(X509_POLICY_NODE, (st))
+# define sk_X509_POLICY_NODE_push(st, val) SKM_sk_push(X509_POLICY_NODE, (st), (val))
+# define sk_X509_POLICY_NODE_unshift(st, val) SKM_sk_unshift(X509_POLICY_NODE, (st), (val))
+# define sk_X509_POLICY_NODE_find(st, val) SKM_sk_find(X509_POLICY_NODE, (st), (val))
+# define sk_X509_POLICY_NODE_find_ex(st, val) SKM_sk_find_ex(X509_POLICY_NODE, (st), (val))
+# define sk_X509_POLICY_NODE_delete(st, i) SKM_sk_delete(X509_POLICY_NODE, (st), (i))
+# define sk_X509_POLICY_NODE_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_POLICY_NODE, (st), (ptr))
+# define sk_X509_POLICY_NODE_insert(st, val, i) SKM_sk_insert(X509_POLICY_NODE, (st), (val), (i))
+# define sk_X509_POLICY_NODE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_POLICY_NODE, (st), (cmp))
+# define sk_X509_POLICY_NODE_dup(st) SKM_sk_dup(X509_POLICY_NODE, st)
+# define sk_X509_POLICY_NODE_pop_free(st, free_func) SKM_sk_pop_free(X509_POLICY_NODE, (st), (free_func))
+# define sk_X509_POLICY_NODE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_POLICY_NODE, (st), (copy_func), (free_func))
+# define sk_X509_POLICY_NODE_shift(st) SKM_sk_shift(X509_POLICY_NODE, (st))
+# define sk_X509_POLICY_NODE_pop(st) SKM_sk_pop(X509_POLICY_NODE, (st))
+# define sk_X509_POLICY_NODE_sort(st) SKM_sk_sort(X509_POLICY_NODE, (st))
+# define sk_X509_POLICY_NODE_is_sorted(st) SKM_sk_is_sorted(X509_POLICY_NODE, (st))
+# define sk_X509_PURPOSE_new(cmp) SKM_sk_new(X509_PURPOSE, (cmp))
+# define sk_X509_PURPOSE_new_null() SKM_sk_new_null(X509_PURPOSE)
+# define sk_X509_PURPOSE_free(st) SKM_sk_free(X509_PURPOSE, (st))
+# define sk_X509_PURPOSE_num(st) SKM_sk_num(X509_PURPOSE, (st))
+# define sk_X509_PURPOSE_value(st, i) SKM_sk_value(X509_PURPOSE, (st), (i))
+# define sk_X509_PURPOSE_set(st, i, val) SKM_sk_set(X509_PURPOSE, (st), (i), (val))
+# define sk_X509_PURPOSE_zero(st) SKM_sk_zero(X509_PURPOSE, (st))
+# define sk_X509_PURPOSE_push(st, val) SKM_sk_push(X509_PURPOSE, (st), (val))
+# define sk_X509_PURPOSE_unshift(st, val) SKM_sk_unshift(X509_PURPOSE, (st), (val))
+# define sk_X509_PURPOSE_find(st, val) SKM_sk_find(X509_PURPOSE, (st), (val))
+# define sk_X509_PURPOSE_find_ex(st, val) SKM_sk_find_ex(X509_PURPOSE, (st), (val))
+# define sk_X509_PURPOSE_delete(st, i) SKM_sk_delete(X509_PURPOSE, (st), (i))
+# define sk_X509_PURPOSE_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_PURPOSE, (st), (ptr))
+# define sk_X509_PURPOSE_insert(st, val, i) SKM_sk_insert(X509_PURPOSE, (st), (val), (i))
+# define sk_X509_PURPOSE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_PURPOSE, (st), (cmp))
+# define sk_X509_PURPOSE_dup(st) SKM_sk_dup(X509_PURPOSE, st)
+# define sk_X509_PURPOSE_pop_free(st, free_func) SKM_sk_pop_free(X509_PURPOSE, (st), (free_func))
+# define sk_X509_PURPOSE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_PURPOSE, (st), (copy_func), (free_func))
+# define sk_X509_PURPOSE_shift(st) SKM_sk_shift(X509_PURPOSE, (st))
+# define sk_X509_PURPOSE_pop(st) SKM_sk_pop(X509_PURPOSE, (st))
+# define sk_X509_PURPOSE_sort(st) SKM_sk_sort(X509_PURPOSE, (st))
+# define sk_X509_PURPOSE_is_sorted(st) SKM_sk_is_sorted(X509_PURPOSE, (st))
+# define sk_X509_REVOKED_new(cmp) SKM_sk_new(X509_REVOKED, (cmp))
+# define sk_X509_REVOKED_new_null() SKM_sk_new_null(X509_REVOKED)
+# define sk_X509_REVOKED_free(st) SKM_sk_free(X509_REVOKED, (st))
+# define sk_X509_REVOKED_num(st) SKM_sk_num(X509_REVOKED, (st))
+# define sk_X509_REVOKED_value(st, i) SKM_sk_value(X509_REVOKED, (st), (i))
+# define sk_X509_REVOKED_set(st, i, val) SKM_sk_set(X509_REVOKED, (st), (i), (val))
+# define sk_X509_REVOKED_zero(st) SKM_sk_zero(X509_REVOKED, (st))
+# define sk_X509_REVOKED_push(st, val) SKM_sk_push(X509_REVOKED, (st), (val))
+# define sk_X509_REVOKED_unshift(st, val) SKM_sk_unshift(X509_REVOKED, (st), (val))
+# define sk_X509_REVOKED_find(st, val) SKM_sk_find(X509_REVOKED, (st), (val))
+# define sk_X509_REVOKED_find_ex(st, val) SKM_sk_find_ex(X509_REVOKED, (st), (val))
+# define sk_X509_REVOKED_delete(st, i) SKM_sk_delete(X509_REVOKED, (st), (i))
+# define sk_X509_REVOKED_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_REVOKED, (st), (ptr))
+# define sk_X509_REVOKED_insert(st, val, i) SKM_sk_insert(X509_REVOKED, (st), (val), (i))
+# define sk_X509_REVOKED_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_REVOKED, (st), (cmp))
+# define sk_X509_REVOKED_dup(st) SKM_sk_dup(X509_REVOKED, st)
+# define sk_X509_REVOKED_pop_free(st, free_func) SKM_sk_pop_free(X509_REVOKED, (st), (free_func))
+# define sk_X509_REVOKED_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_REVOKED, (st), (copy_func), (free_func))
+# define sk_X509_REVOKED_shift(st) SKM_sk_shift(X509_REVOKED, (st))
+# define sk_X509_REVOKED_pop(st) SKM_sk_pop(X509_REVOKED, (st))
+# define sk_X509_REVOKED_sort(st) SKM_sk_sort(X509_REVOKED, (st))
+# define sk_X509_REVOKED_is_sorted(st) SKM_sk_is_sorted(X509_REVOKED, (st))
+# define sk_X509_TRUST_new(cmp) SKM_sk_new(X509_TRUST, (cmp))
+# define sk_X509_TRUST_new_null() SKM_sk_new_null(X509_TRUST)
+# define sk_X509_TRUST_free(st) SKM_sk_free(X509_TRUST, (st))
+# define sk_X509_TRUST_num(st) SKM_sk_num(X509_TRUST, (st))
+# define sk_X509_TRUST_value(st, i) SKM_sk_value(X509_TRUST, (st), (i))
+# define sk_X509_TRUST_set(st, i, val) SKM_sk_set(X509_TRUST, (st), (i), (val))
+# define sk_X509_TRUST_zero(st) SKM_sk_zero(X509_TRUST, (st))
+# define sk_X509_TRUST_push(st, val) SKM_sk_push(X509_TRUST, (st), (val))
+# define sk_X509_TRUST_unshift(st, val) SKM_sk_unshift(X509_TRUST, (st), (val))
+# define sk_X509_TRUST_find(st, val) SKM_sk_find(X509_TRUST, (st), (val))
+# define sk_X509_TRUST_find_ex(st, val) SKM_sk_find_ex(X509_TRUST, (st), (val))
+# define sk_X509_TRUST_delete(st, i) SKM_sk_delete(X509_TRUST, (st), (i))
+# define sk_X509_TRUST_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_TRUST, (st), (ptr))
+# define sk_X509_TRUST_insert(st, val, i) SKM_sk_insert(X509_TRUST, (st), (val), (i))
+# define sk_X509_TRUST_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_TRUST, (st), (cmp))
+# define sk_X509_TRUST_dup(st) SKM_sk_dup(X509_TRUST, st)
+# define sk_X509_TRUST_pop_free(st, free_func) SKM_sk_pop_free(X509_TRUST, (st), (free_func))
+# define sk_X509_TRUST_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_TRUST, (st), (copy_func), (free_func))
+# define sk_X509_TRUST_shift(st) SKM_sk_shift(X509_TRUST, (st))
+# define sk_X509_TRUST_pop(st) SKM_sk_pop(X509_TRUST, (st))
+# define sk_X509_TRUST_sort(st) SKM_sk_sort(X509_TRUST, (st))
+# define sk_X509_TRUST_is_sorted(st) SKM_sk_is_sorted(X509_TRUST, (st))
+# define sk_X509_VERIFY_PARAM_new(cmp) SKM_sk_new(X509_VERIFY_PARAM, (cmp))
+# define sk_X509_VERIFY_PARAM_new_null() SKM_sk_new_null(X509_VERIFY_PARAM)
+# define sk_X509_VERIFY_PARAM_free(st) SKM_sk_free(X509_VERIFY_PARAM, (st))
+# define sk_X509_VERIFY_PARAM_num(st) SKM_sk_num(X509_VERIFY_PARAM, (st))
+# define sk_X509_VERIFY_PARAM_value(st, i) SKM_sk_value(X509_VERIFY_PARAM, (st), (i))
+# define sk_X509_VERIFY_PARAM_set(st, i, val) SKM_sk_set(X509_VERIFY_PARAM, (st), (i), (val))
+# define sk_X509_VERIFY_PARAM_zero(st) SKM_sk_zero(X509_VERIFY_PARAM, (st))
+# define sk_X509_VERIFY_PARAM_push(st, val) SKM_sk_push(X509_VERIFY_PARAM, (st), (val))
+# define sk_X509_VERIFY_PARAM_unshift(st, val) SKM_sk_unshift(X509_VERIFY_PARAM, (st), (val))
+# define sk_X509_VERIFY_PARAM_find(st, val) SKM_sk_find(X509_VERIFY_PARAM, (st), (val))
+# define sk_X509_VERIFY_PARAM_find_ex(st, val) SKM_sk_find_ex(X509_VERIFY_PARAM, (st), (val))
+# define sk_X509_VERIFY_PARAM_delete(st, i) SKM_sk_delete(X509_VERIFY_PARAM, (st), (i))
+# define sk_X509_VERIFY_PARAM_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_VERIFY_PARAM, (st), (ptr))
+# define sk_X509_VERIFY_PARAM_insert(st, val, i) SKM_sk_insert(X509_VERIFY_PARAM, (st), (val), (i))
+# define sk_X509_VERIFY_PARAM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_VERIFY_PARAM, (st), (cmp))
+# define sk_X509_VERIFY_PARAM_dup(st) SKM_sk_dup(X509_VERIFY_PARAM, st)
+# define sk_X509_VERIFY_PARAM_pop_free(st, free_func) SKM_sk_pop_free(X509_VERIFY_PARAM, (st), (free_func))
+# define sk_X509_VERIFY_PARAM_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_VERIFY_PARAM, (st), (copy_func), (free_func))
+# define sk_X509_VERIFY_PARAM_shift(st) SKM_sk_shift(X509_VERIFY_PARAM, (st))
+# define sk_X509_VERIFY_PARAM_pop(st) SKM_sk_pop(X509_VERIFY_PARAM, (st))
+# define sk_X509_VERIFY_PARAM_sort(st) SKM_sk_sort(X509_VERIFY_PARAM, (st))
+# define sk_X509_VERIFY_PARAM_is_sorted(st) SKM_sk_is_sorted(X509_VERIFY_PARAM, (st))
+# define sk_nid_triple_new(cmp) SKM_sk_new(nid_triple, (cmp))
+# define sk_nid_triple_new_null() SKM_sk_new_null(nid_triple)
+# define sk_nid_triple_free(st) SKM_sk_free(nid_triple, (st))
+# define sk_nid_triple_num(st) SKM_sk_num(nid_triple, (st))
+# define sk_nid_triple_value(st, i) SKM_sk_value(nid_triple, (st), (i))
+# define sk_nid_triple_set(st, i, val) SKM_sk_set(nid_triple, (st), (i), (val))
+# define sk_nid_triple_zero(st) SKM_sk_zero(nid_triple, (st))
+# define sk_nid_triple_push(st, val) SKM_sk_push(nid_triple, (st), (val))
+# define sk_nid_triple_unshift(st, val) SKM_sk_unshift(nid_triple, (st), (val))
+# define sk_nid_triple_find(st, val) SKM_sk_find(nid_triple, (st), (val))
+# define sk_nid_triple_find_ex(st, val) SKM_sk_find_ex(nid_triple, (st), (val))
+# define sk_nid_triple_delete(st, i) SKM_sk_delete(nid_triple, (st), (i))
+# define sk_nid_triple_delete_ptr(st, ptr) SKM_sk_delete_ptr(nid_triple, (st), (ptr))
+# define sk_nid_triple_insert(st, val, i) SKM_sk_insert(nid_triple, (st), (val), (i))
+# define sk_nid_triple_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(nid_triple, (st), (cmp))
+# define sk_nid_triple_dup(st) SKM_sk_dup(nid_triple, st)
+# define sk_nid_triple_pop_free(st, free_func) SKM_sk_pop_free(nid_triple, (st), (free_func))
+# define sk_nid_triple_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(nid_triple, (st), (copy_func), (free_func))
+# define sk_nid_triple_shift(st) SKM_sk_shift(nid_triple, (st))
+# define sk_nid_triple_pop(st) SKM_sk_pop(nid_triple, (st))
+# define sk_nid_triple_sort(st) SKM_sk_sort(nid_triple, (st))
+# define sk_nid_triple_is_sorted(st) SKM_sk_is_sorted(nid_triple, (st))
+# define sk_void_new(cmp) SKM_sk_new(void, (cmp))
+# define sk_void_new_null() SKM_sk_new_null(void)
+# define sk_void_free(st) SKM_sk_free(void, (st))
+# define sk_void_num(st) SKM_sk_num(void, (st))
+# define sk_void_value(st, i) SKM_sk_value(void, (st), (i))
+# define sk_void_set(st, i, val) SKM_sk_set(void, (st), (i), (val))
+# define sk_void_zero(st) SKM_sk_zero(void, (st))
+# define sk_void_push(st, val) SKM_sk_push(void, (st), (val))
+# define sk_void_unshift(st, val) SKM_sk_unshift(void, (st), (val))
+# define sk_void_find(st, val) SKM_sk_find(void, (st), (val))
+# define sk_void_find_ex(st, val) SKM_sk_find_ex(void, (st), (val))
+# define sk_void_delete(st, i) SKM_sk_delete(void, (st), (i))
+# define sk_void_delete_ptr(st, ptr) SKM_sk_delete_ptr(void, (st), (ptr))
+# define sk_void_insert(st, val, i) SKM_sk_insert(void, (st), (val), (i))
+# define sk_void_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(void, (st), (cmp))
+# define sk_void_dup(st) SKM_sk_dup(void, st)
+# define sk_void_pop_free(st, free_func) SKM_sk_pop_free(void, (st), (free_func))
+# define sk_void_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(void, (st), (copy_func), (free_func))
+# define sk_void_shift(st) SKM_sk_shift(void, (st))
+# define sk_void_pop(st) SKM_sk_pop(void, (st))
+# define sk_void_sort(st) SKM_sk_sort(void, (st))
+# define sk_void_is_sorted(st) SKM_sk_is_sorted(void, (st))
+# define sk_OPENSSL_STRING_new(cmp) ((STACK_OF(OPENSSL_STRING) *)sk_new(CHECKED_SK_CMP_FUNC(char, cmp)))
+# define sk_OPENSSL_STRING_new_null() ((STACK_OF(OPENSSL_STRING) *)sk_new_null())
+# define sk_OPENSSL_STRING_push(st, val) sk_push(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, val))
+# define sk_OPENSSL_STRING_find(st, val) sk_find(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, val))
+# define sk_OPENSSL_STRING_value(st, i) ((OPENSSL_STRING)sk_value(CHECKED_STACK_OF(OPENSSL_STRING, st), i))
+# define sk_OPENSSL_STRING_num(st) SKM_sk_num(OPENSSL_STRING, st)
+# define sk_OPENSSL_STRING_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_SK_FREE_FUNC(char, free_func))
+# define sk_OPENSSL_STRING_deep_copy(st, copy_func, free_func) ((STACK_OF(OPENSSL_STRING) *)sk_deep_copy(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_SK_COPY_FUNC(char, copy_func), CHECKED_SK_FREE_FUNC(char, free_func)))
+# define sk_OPENSSL_STRING_insert(st, val, i) sk_insert(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, val), i)
+# define sk_OPENSSL_STRING_free(st) SKM_sk_free(OPENSSL_STRING, st)
+# define sk_OPENSSL_STRING_set(st, i, val) sk_set(CHECKED_STACK_OF(OPENSSL_STRING, st), i, CHECKED_PTR_OF(char, val))
+# define sk_OPENSSL_STRING_zero(st) SKM_sk_zero(OPENSSL_STRING, (st))
+# define sk_OPENSSL_STRING_unshift(st, val) sk_unshift(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, val))
+# define sk_OPENSSL_STRING_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_CONST_PTR_OF(char, val))
+# define sk_OPENSSL_STRING_delete(st, i) SKM_sk_delete(OPENSSL_STRING, (st), (i))
+# define sk_OPENSSL_STRING_delete_ptr(st, ptr) (OPENSSL_STRING *)sk_delete_ptr(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, ptr))
+# define sk_OPENSSL_STRING_set_cmp_func(st, cmp) \
+ ((int (*)(const char * const *,const char * const *)) \
+ sk_set_cmp_func(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_SK_CMP_FUNC(char, cmp)))
+# define sk_OPENSSL_STRING_dup(st) SKM_sk_dup(OPENSSL_STRING, st)
+# define sk_OPENSSL_STRING_shift(st) SKM_sk_shift(OPENSSL_STRING, (st))
+# define sk_OPENSSL_STRING_pop(st) (char *)sk_pop(CHECKED_STACK_OF(OPENSSL_STRING, st))
+# define sk_OPENSSL_STRING_sort(st) SKM_sk_sort(OPENSSL_STRING, (st))
+# define sk_OPENSSL_STRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_STRING, (st))
+# define sk_OPENSSL_BLOCK_new(cmp) ((STACK_OF(OPENSSL_BLOCK) *)sk_new(CHECKED_SK_CMP_FUNC(void, cmp)))
+# define sk_OPENSSL_BLOCK_new_null() ((STACK_OF(OPENSSL_BLOCK) *)sk_new_null())
+# define sk_OPENSSL_BLOCK_push(st, val) sk_push(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, val))
+# define sk_OPENSSL_BLOCK_find(st, val) sk_find(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, val))
+# define sk_OPENSSL_BLOCK_value(st, i) ((OPENSSL_BLOCK)sk_value(CHECKED_STACK_OF(OPENSSL_BLOCK, st), i))
+# define sk_OPENSSL_BLOCK_num(st) SKM_sk_num(OPENSSL_BLOCK, st)
+# define sk_OPENSSL_BLOCK_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_SK_FREE_FUNC(void, free_func))
+# define sk_OPENSSL_BLOCK_deep_copy(st, copy_func, free_func) ((STACK_OF(OPENSSL_BLOCK) *)sk_deep_copy(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_SK_COPY_FUNC(void, copy_func), CHECKED_SK_FREE_FUNC(void, free_func)))
+# define sk_OPENSSL_BLOCK_insert(st, val, i) sk_insert(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, val), i)
+# define sk_OPENSSL_BLOCK_free(st) SKM_sk_free(OPENSSL_BLOCK, st)
+# define sk_OPENSSL_BLOCK_set(st, i, val) sk_set(CHECKED_STACK_OF(OPENSSL_BLOCK, st), i, CHECKED_PTR_OF(void, val))
+# define sk_OPENSSL_BLOCK_zero(st) SKM_sk_zero(OPENSSL_BLOCK, (st))
+# define sk_OPENSSL_BLOCK_unshift(st, val) sk_unshift(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, val))
+# define sk_OPENSSL_BLOCK_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_BLOCK), st), CHECKED_CONST_PTR_OF(void, val))
+# define sk_OPENSSL_BLOCK_delete(st, i) SKM_sk_delete(OPENSSL_BLOCK, (st), (i))
+# define sk_OPENSSL_BLOCK_delete_ptr(st, ptr) (OPENSSL_BLOCK *)sk_delete_ptr(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, ptr))
+# define sk_OPENSSL_BLOCK_set_cmp_func(st, cmp) \
+ ((int (*)(const void * const *,const void * const *)) \
+ sk_set_cmp_func(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_SK_CMP_FUNC(void, cmp)))
+# define sk_OPENSSL_BLOCK_dup(st) SKM_sk_dup(OPENSSL_BLOCK, st)
+# define sk_OPENSSL_BLOCK_shift(st) SKM_sk_shift(OPENSSL_BLOCK, (st))
+# define sk_OPENSSL_BLOCK_pop(st) (void *)sk_pop(CHECKED_STACK_OF(OPENSSL_BLOCK, st))
+# define sk_OPENSSL_BLOCK_sort(st) SKM_sk_sort(OPENSSL_BLOCK, (st))
+# define sk_OPENSSL_BLOCK_is_sorted(st) SKM_sk_is_sorted(OPENSSL_BLOCK, (st))
+# define sk_OPENSSL_PSTRING_new(cmp) ((STACK_OF(OPENSSL_PSTRING) *)sk_new(CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp)))
+# define sk_OPENSSL_PSTRING_new_null() ((STACK_OF(OPENSSL_PSTRING) *)sk_new_null())
+# define sk_OPENSSL_PSTRING_push(st, val) sk_push(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val))
+# define sk_OPENSSL_PSTRING_find(st, val) sk_find(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val))
+# define sk_OPENSSL_PSTRING_value(st, i) ((OPENSSL_PSTRING)sk_value(CHECKED_STACK_OF(OPENSSL_PSTRING, st), i))
+# define sk_OPENSSL_PSTRING_num(st) SKM_sk_num(OPENSSL_PSTRING, st)
+# define sk_OPENSSL_PSTRING_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_SK_FREE_FUNC(OPENSSL_STRING, free_func))
+# define sk_OPENSSL_PSTRING_deep_copy(st, copy_func, free_func) ((STACK_OF(OPENSSL_PSTRING) *)sk_deep_copy(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_SK_COPY_FUNC(OPENSSL_STRING, copy_func), CHECKED_SK_FREE_FUNC(OPENSSL_STRING, free_func)))
+# define sk_OPENSSL_PSTRING_insert(st, val, i) sk_insert(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val), i)
+# define sk_OPENSSL_PSTRING_free(st) SKM_sk_free(OPENSSL_PSTRING, st)
+# define sk_OPENSSL_PSTRING_set(st, i, val) sk_set(CHECKED_STACK_OF(OPENSSL_PSTRING, st), i, CHECKED_PTR_OF(OPENSSL_STRING, val))
+# define sk_OPENSSL_PSTRING_zero(st) SKM_sk_zero(OPENSSL_PSTRING, (st))
+# define sk_OPENSSL_PSTRING_unshift(st, val) sk_unshift(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val))
+# define sk_OPENSSL_PSTRING_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_CONST_PTR_OF(OPENSSL_STRING, val))
+# define sk_OPENSSL_PSTRING_delete(st, i) SKM_sk_delete(OPENSSL_PSTRING, (st), (i))
+# define sk_OPENSSL_PSTRING_delete_ptr(st, ptr) (OPENSSL_PSTRING *)sk_delete_ptr(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, ptr))
+# define sk_OPENSSL_PSTRING_set_cmp_func(st, cmp) \
+ ((int (*)(const OPENSSL_STRING * const *,const OPENSSL_STRING * const *)) \
+ sk_set_cmp_func(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp)))
+# define sk_OPENSSL_PSTRING_dup(st) SKM_sk_dup(OPENSSL_PSTRING, st)
+# define sk_OPENSSL_PSTRING_shift(st) SKM_sk_shift(OPENSSL_PSTRING, (st))
+# define sk_OPENSSL_PSTRING_pop(st) (OPENSSL_STRING *)sk_pop(CHECKED_STACK_OF(OPENSSL_PSTRING, st))
+# define sk_OPENSSL_PSTRING_sort(st) SKM_sk_sort(OPENSSL_PSTRING, (st))
+# define sk_OPENSSL_PSTRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_PSTRING, (st))
+# define d2i_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(ACCESS_DESCRIPTION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(ACCESS_DESCRIPTION, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_ACCESS_DESCRIPTION(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(ACCESS_DESCRIPTION, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_ACCESS_DESCRIPTION(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(ACCESS_DESCRIPTION, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_ASN1_INTEGER(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(ASN1_INTEGER, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_ASN1_INTEGER(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(ASN1_INTEGER, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_ASN1_INTEGER(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(ASN1_INTEGER, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_ASN1_INTEGER(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(ASN1_INTEGER, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_ASN1_OBJECT(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(ASN1_OBJECT, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_ASN1_OBJECT(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(ASN1_OBJECT, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_ASN1_OBJECT(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(ASN1_OBJECT, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_ASN1_OBJECT(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(ASN1_OBJECT, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_ASN1_TYPE(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(ASN1_TYPE, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_ASN1_TYPE(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(ASN1_TYPE, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_ASN1_TYPE(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(ASN1_TYPE, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_ASN1_TYPE(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(ASN1_TYPE, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_ASN1_UTF8STRING(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(ASN1_UTF8STRING, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_ASN1_UTF8STRING(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(ASN1_UTF8STRING, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_ASN1_UTF8STRING(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(ASN1_UTF8STRING, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_ASN1_UTF8STRING(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(ASN1_UTF8STRING, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_DIST_POINT(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(DIST_POINT, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_DIST_POINT(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(DIST_POINT, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_DIST_POINT(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(DIST_POINT, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_DIST_POINT(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(DIST_POINT, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_ESS_CERT_ID(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(ESS_CERT_ID, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_ESS_CERT_ID(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(ESS_CERT_ID, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_ESS_CERT_ID(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(ESS_CERT_ID, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_ESS_CERT_ID(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(ESS_CERT_ID, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_EVP_MD(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(EVP_MD, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_EVP_MD(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(EVP_MD, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_EVP_MD(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(EVP_MD, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_EVP_MD(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(EVP_MD, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_GENERAL_NAME(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(GENERAL_NAME, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_GENERAL_NAME(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(GENERAL_NAME, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_GENERAL_NAME(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(GENERAL_NAME, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_GENERAL_NAME(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(GENERAL_NAME, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_OCSP_ONEREQ(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(OCSP_ONEREQ, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_OCSP_ONEREQ(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(OCSP_ONEREQ, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_OCSP_ONEREQ(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(OCSP_ONEREQ, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_OCSP_ONEREQ(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(OCSP_ONEREQ, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_OCSP_SINGLERESP(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(OCSP_SINGLERESP, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_OCSP_SINGLERESP(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(OCSP_SINGLERESP, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_OCSP_SINGLERESP(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(OCSP_SINGLERESP, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_OCSP_SINGLERESP(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(OCSP_SINGLERESP, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_PKCS12_SAFEBAG(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(PKCS12_SAFEBAG, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_PKCS12_SAFEBAG(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(PKCS12_SAFEBAG, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_PKCS12_SAFEBAG(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(PKCS12_SAFEBAG, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_PKCS12_SAFEBAG(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(PKCS12_SAFEBAG, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_PKCS7(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(PKCS7, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_PKCS7(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(PKCS7, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_PKCS7(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(PKCS7, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_PKCS7(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(PKCS7, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_PKCS7_RECIP_INFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(PKCS7_RECIP_INFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_PKCS7_RECIP_INFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(PKCS7_RECIP_INFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_PKCS7_RECIP_INFO(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(PKCS7_RECIP_INFO, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_PKCS7_RECIP_INFO(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(PKCS7_RECIP_INFO, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(PKCS7_SIGNER_INFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(PKCS7_SIGNER_INFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_PKCS7_SIGNER_INFO(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(PKCS7_SIGNER_INFO, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_PKCS7_SIGNER_INFO(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(PKCS7_SIGNER_INFO, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_POLICYINFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(POLICYINFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_POLICYINFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(POLICYINFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_POLICYINFO(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(POLICYINFO, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_POLICYINFO(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(POLICYINFO, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_POLICYQUALINFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(POLICYQUALINFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_POLICYQUALINFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(POLICYQUALINFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_POLICYQUALINFO(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(POLICYQUALINFO, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_POLICYQUALINFO(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(POLICYQUALINFO, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_SXNETID(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(SXNETID, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_SXNETID(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(SXNETID, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_SXNETID(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(SXNETID, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_SXNETID(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(SXNETID, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_X509(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(X509, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_X509(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(X509, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_X509(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(X509, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_X509(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(X509, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_X509_ALGOR(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(X509_ALGOR, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_X509_ALGOR(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(X509_ALGOR, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_X509_ALGOR(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(X509_ALGOR, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_X509_ALGOR(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(X509_ALGOR, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_X509_ATTRIBUTE(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(X509_ATTRIBUTE, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_X509_ATTRIBUTE(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(X509_ATTRIBUTE, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_X509_ATTRIBUTE(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(X509_ATTRIBUTE, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_X509_ATTRIBUTE(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(X509_ATTRIBUTE, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_X509_CRL(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(X509_CRL, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_X509_CRL(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(X509_CRL, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_X509_CRL(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(X509_CRL, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_X509_CRL(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(X509_CRL, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_X509_EXTENSION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(X509_EXTENSION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_X509_EXTENSION(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(X509_EXTENSION, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_X509_EXTENSION(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(X509_EXTENSION, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_X509_EXTENSION(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(X509_EXTENSION, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_X509_NAME_ENTRY(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(X509_NAME_ENTRY, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_X509_NAME_ENTRY(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(X509_NAME_ENTRY, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_X509_NAME_ENTRY(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(X509_NAME_ENTRY, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_X509_NAME_ENTRY(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(X509_NAME_ENTRY, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_X509_REVOKED(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(X509_REVOKED, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_X509_REVOKED(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(X509_REVOKED, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_X509_REVOKED(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(X509_REVOKED, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_X509_REVOKED(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(X509_REVOKED, (buf), (len), (d2i_func), (free_func))
+# define PKCS12_decrypt_d2i_PKCS12_SAFEBAG(algor, d2i_func, free_func, pass, passlen, oct, seq) \
+ SKM_PKCS12_decrypt_d2i(PKCS12_SAFEBAG, (algor), (d2i_func), (free_func), (pass), (passlen), (oct), (seq))
+# define PKCS12_decrypt_d2i_PKCS7(algor, d2i_func, free_func, pass, passlen, oct, seq) \
+ SKM_PKCS12_decrypt_d2i(PKCS7, (algor), (d2i_func), (free_func), (pass), (passlen), (oct), (seq))
+# define lh_ADDED_OBJ_new() LHM_lh_new(ADDED_OBJ,added_obj)
+# define lh_ADDED_OBJ_insert(lh,inst) LHM_lh_insert(ADDED_OBJ,lh,inst)
+# define lh_ADDED_OBJ_retrieve(lh,inst) LHM_lh_retrieve(ADDED_OBJ,lh,inst)
+# define lh_ADDED_OBJ_delete(lh,inst) LHM_lh_delete(ADDED_OBJ,lh,inst)
+# define lh_ADDED_OBJ_doall(lh,fn) LHM_lh_doall(ADDED_OBJ,lh,fn)
+# define lh_ADDED_OBJ_doall_arg(lh,fn,arg_type,arg) \
+ LHM_lh_doall_arg(ADDED_OBJ,lh,fn,arg_type,arg)
+# define lh_ADDED_OBJ_error(lh) LHM_lh_error(ADDED_OBJ,lh)
+# define lh_ADDED_OBJ_num_items(lh) LHM_lh_num_items(ADDED_OBJ,lh)
+# define lh_ADDED_OBJ_down_load(lh) LHM_lh_down_load(ADDED_OBJ,lh)
+# define lh_ADDED_OBJ_node_stats_bio(lh,out) \
+ LHM_lh_node_stats_bio(ADDED_OBJ,lh,out)
+# define lh_ADDED_OBJ_node_usage_stats_bio(lh,out) \
+ LHM_lh_node_usage_stats_bio(ADDED_OBJ,lh,out)
+# define lh_ADDED_OBJ_stats_bio(lh,out) \
+ LHM_lh_stats_bio(ADDED_OBJ,lh,out)
+# define lh_ADDED_OBJ_free(lh) LHM_lh_free(ADDED_OBJ,lh)
+# define lh_APP_INFO_new() LHM_lh_new(APP_INFO,app_info)
+# define lh_APP_INFO_insert(lh,inst) LHM_lh_insert(APP_INFO,lh,inst)
+# define lh_APP_INFO_retrieve(lh,inst) LHM_lh_retrieve(APP_INFO,lh,inst)
+# define lh_APP_INFO_delete(lh,inst) LHM_lh_delete(APP_INFO,lh,inst)
+# define lh_APP_INFO_doall(lh,fn) LHM_lh_doall(APP_INFO,lh,fn)
+# define lh_APP_INFO_doall_arg(lh,fn,arg_type,arg) \
+ LHM_lh_doall_arg(APP_INFO,lh,fn,arg_type,arg)
+# define lh_APP_INFO_error(lh) LHM_lh_error(APP_INFO,lh)
+# define lh_APP_INFO_num_items(lh) LHM_lh_num_items(APP_INFO,lh)
+# define lh_APP_INFO_down_load(lh) LHM_lh_down_load(APP_INFO,lh)
+# define lh_APP_INFO_node_stats_bio(lh,out) \
+ LHM_lh_node_stats_bio(APP_INFO,lh,out)
+# define lh_APP_INFO_node_usage_stats_bio(lh,out) \
+ LHM_lh_node_usage_stats_bio(APP_INFO,lh,out)
+# define lh_APP_INFO_stats_bio(lh,out) \
+ LHM_lh_stats_bio(APP_INFO,lh,out)
+# define lh_APP_INFO_free(lh) LHM_lh_free(APP_INFO,lh)
+# define lh_CONF_VALUE_new() LHM_lh_new(CONF_VALUE,conf_value)
+# define lh_CONF_VALUE_insert(lh,inst) LHM_lh_insert(CONF_VALUE,lh,inst)
+# define lh_CONF_VALUE_retrieve(lh,inst) LHM_lh_retrieve(CONF_VALUE,lh,inst)
+# define lh_CONF_VALUE_delete(lh,inst) LHM_lh_delete(CONF_VALUE,lh,inst)
+# define lh_CONF_VALUE_doall(lh,fn) LHM_lh_doall(CONF_VALUE,lh,fn)
+# define lh_CONF_VALUE_doall_arg(lh,fn,arg_type,arg) \
+ LHM_lh_doall_arg(CONF_VALUE,lh,fn,arg_type,arg)
+# define lh_CONF_VALUE_error(lh) LHM_lh_error(CONF_VALUE,lh)
+# define lh_CONF_VALUE_num_items(lh) LHM_lh_num_items(CONF_VALUE,lh)
+# define lh_CONF_VALUE_down_load(lh) LHM_lh_down_load(CONF_VALUE,lh)
+# define lh_CONF_VALUE_node_stats_bio(lh,out) \
+ LHM_lh_node_stats_bio(CONF_VALUE,lh,out)
+# define lh_CONF_VALUE_node_usage_stats_bio(lh,out) \
+ LHM_lh_node_usage_stats_bio(CONF_VALUE,lh,out)
+# define lh_CONF_VALUE_stats_bio(lh,out) \
+ LHM_lh_stats_bio(CONF_VALUE,lh,out)
+# define lh_CONF_VALUE_free(lh) LHM_lh_free(CONF_VALUE,lh)
+# define lh_ENGINE_PILE_new() LHM_lh_new(ENGINE_PILE,engine_pile)
+# define lh_ENGINE_PILE_insert(lh,inst) LHM_lh_insert(ENGINE_PILE,lh,inst)
+# define lh_ENGINE_PILE_retrieve(lh,inst) LHM_lh_retrieve(ENGINE_PILE,lh,inst)
+# define lh_ENGINE_PILE_delete(lh,inst) LHM_lh_delete(ENGINE_PILE,lh,inst)
+# define lh_ENGINE_PILE_doall(lh,fn) LHM_lh_doall(ENGINE_PILE,lh,fn)
+# define lh_ENGINE_PILE_doall_arg(lh,fn,arg_type,arg) \
+ LHM_lh_doall_arg(ENGINE_PILE,lh,fn,arg_type,arg)
+# define lh_ENGINE_PILE_error(lh) LHM_lh_error(ENGINE_PILE,lh)
+# define lh_ENGINE_PILE_num_items(lh) LHM_lh_num_items(ENGINE_PILE,lh)
+# define lh_ENGINE_PILE_down_load(lh) LHM_lh_down_load(ENGINE_PILE,lh)
+# define lh_ENGINE_PILE_node_stats_bio(lh,out) \
+ LHM_lh_node_stats_bio(ENGINE_PILE,lh,out)
+# define lh_ENGINE_PILE_node_usage_stats_bio(lh,out) \
+ LHM_lh_node_usage_stats_bio(ENGINE_PILE,lh,out)
+# define lh_ENGINE_PILE_stats_bio(lh,out) \
+ LHM_lh_stats_bio(ENGINE_PILE,lh,out)
+# define lh_ENGINE_PILE_free(lh) LHM_lh_free(ENGINE_PILE,lh)
+# define lh_ERR_STATE_new() LHM_lh_new(ERR_STATE,err_state)
+# define lh_ERR_STATE_insert(lh,inst) LHM_lh_insert(ERR_STATE,lh,inst)
+# define lh_ERR_STATE_retrieve(lh,inst) LHM_lh_retrieve(ERR_STATE,lh,inst)
+# define lh_ERR_STATE_delete(lh,inst) LHM_lh_delete(ERR_STATE,lh,inst)
+# define lh_ERR_STATE_doall(lh,fn) LHM_lh_doall(ERR_STATE,lh,fn)
+# define lh_ERR_STATE_doall_arg(lh,fn,arg_type,arg) \
+ LHM_lh_doall_arg(ERR_STATE,lh,fn,arg_type,arg)
+# define lh_ERR_STATE_error(lh) LHM_lh_error(ERR_STATE,lh)
+# define lh_ERR_STATE_num_items(lh) LHM_lh_num_items(ERR_STATE,lh)
+# define lh_ERR_STATE_down_load(lh) LHM_lh_down_load(ERR_STATE,lh)
+# define lh_ERR_STATE_node_stats_bio(lh,out) \
+ LHM_lh_node_stats_bio(ERR_STATE,lh,out)
+# define lh_ERR_STATE_node_usage_stats_bio(lh,out) \
+ LHM_lh_node_usage_stats_bio(ERR_STATE,lh,out)
+# define lh_ERR_STATE_stats_bio(lh,out) \
+ LHM_lh_stats_bio(ERR_STATE,lh,out)
+# define lh_ERR_STATE_free(lh) LHM_lh_free(ERR_STATE,lh)
+# define lh_ERR_STRING_DATA_new() LHM_lh_new(ERR_STRING_DATA,err_string_data)
+# define lh_ERR_STRING_DATA_insert(lh,inst) LHM_lh_insert(ERR_STRING_DATA,lh,inst)
+# define lh_ERR_STRING_DATA_retrieve(lh,inst) LHM_lh_retrieve(ERR_STRING_DATA,lh,inst)
+# define lh_ERR_STRING_DATA_delete(lh,inst) LHM_lh_delete(ERR_STRING_DATA,lh,inst)
+# define lh_ERR_STRING_DATA_doall(lh,fn) LHM_lh_doall(ERR_STRING_DATA,lh,fn)
+# define lh_ERR_STRING_DATA_doall_arg(lh,fn,arg_type,arg) \
+ LHM_lh_doall_arg(ERR_STRING_DATA,lh,fn,arg_type,arg)
+# define lh_ERR_STRING_DATA_error(lh) LHM_lh_error(ERR_STRING_DATA,lh)
+# define lh_ERR_STRING_DATA_num_items(lh) LHM_lh_num_items(ERR_STRING_DATA,lh)
+# define lh_ERR_STRING_DATA_down_load(lh) LHM_lh_down_load(ERR_STRING_DATA,lh)
+# define lh_ERR_STRING_DATA_node_stats_bio(lh,out) \
+ LHM_lh_node_stats_bio(ERR_STRING_DATA,lh,out)
+# define lh_ERR_STRING_DATA_node_usage_stats_bio(lh,out) \
+ LHM_lh_node_usage_stats_bio(ERR_STRING_DATA,lh,out)
+# define lh_ERR_STRING_DATA_stats_bio(lh,out) \
+ LHM_lh_stats_bio(ERR_STRING_DATA,lh,out)
+# define lh_ERR_STRING_DATA_free(lh) LHM_lh_free(ERR_STRING_DATA,lh)
+# define lh_EX_CLASS_ITEM_new() LHM_lh_new(EX_CLASS_ITEM,ex_class_item)
+# define lh_EX_CLASS_ITEM_insert(lh,inst) LHM_lh_insert(EX_CLASS_ITEM,lh,inst)
+# define lh_EX_CLASS_ITEM_retrieve(lh,inst) LHM_lh_retrieve(EX_CLASS_ITEM,lh,inst)
+# define lh_EX_CLASS_ITEM_delete(lh,inst) LHM_lh_delete(EX_CLASS_ITEM,lh,inst)
+# define lh_EX_CLASS_ITEM_doall(lh,fn) LHM_lh_doall(EX_CLASS_ITEM,lh,fn)
+# define lh_EX_CLASS_ITEM_doall_arg(lh,fn,arg_type,arg) \
+ LHM_lh_doall_arg(EX_CLASS_ITEM,lh,fn,arg_type,arg)
+# define lh_EX_CLASS_ITEM_error(lh) LHM_lh_error(EX_CLASS_ITEM,lh)
+# define lh_EX_CLASS_ITEM_num_items(lh) LHM_lh_num_items(EX_CLASS_ITEM,lh)
+# define lh_EX_CLASS_ITEM_down_load(lh) LHM_lh_down_load(EX_CLASS_ITEM,lh)
+# define lh_EX_CLASS_ITEM_node_stats_bio(lh,out) \
+ LHM_lh_node_stats_bio(EX_CLASS_ITEM,lh,out)
+# define lh_EX_CLASS_ITEM_node_usage_stats_bio(lh,out) \
+ LHM_lh_node_usage_stats_bio(EX_CLASS_ITEM,lh,out)
+# define lh_EX_CLASS_ITEM_stats_bio(lh,out) \
+ LHM_lh_stats_bio(EX_CLASS_ITEM,lh,out)
+# define lh_EX_CLASS_ITEM_free(lh) LHM_lh_free(EX_CLASS_ITEM,lh)
+# define lh_FUNCTION_new() LHM_lh_new(FUNCTION,function)
+# define lh_FUNCTION_insert(lh,inst) LHM_lh_insert(FUNCTION,lh,inst)
+# define lh_FUNCTION_retrieve(lh,inst) LHM_lh_retrieve(FUNCTION,lh,inst)
+# define lh_FUNCTION_delete(lh,inst) LHM_lh_delete(FUNCTION,lh,inst)
+# define lh_FUNCTION_doall(lh,fn) LHM_lh_doall(FUNCTION,lh,fn)
+# define lh_FUNCTION_doall_arg(lh,fn,arg_type,arg) \
+ LHM_lh_doall_arg(FUNCTION,lh,fn,arg_type,arg)
+# define lh_FUNCTION_error(lh) LHM_lh_error(FUNCTION,lh)
+# define lh_FUNCTION_num_items(lh) LHM_lh_num_items(FUNCTION,lh)
+# define lh_FUNCTION_down_load(lh) LHM_lh_down_load(FUNCTION,lh)
+# define lh_FUNCTION_node_stats_bio(lh,out) \
+ LHM_lh_node_stats_bio(FUNCTION,lh,out)
+# define lh_FUNCTION_node_usage_stats_bio(lh,out) \
+ LHM_lh_node_usage_stats_bio(FUNCTION,lh,out)
+# define lh_FUNCTION_stats_bio(lh,out) \
+ LHM_lh_stats_bio(FUNCTION,lh,out)
+# define lh_FUNCTION_free(lh) LHM_lh_free(FUNCTION,lh)
+# define lh_MEM_new() LHM_lh_new(MEM,mem)
+# define lh_MEM_insert(lh,inst) LHM_lh_insert(MEM,lh,inst)
+# define lh_MEM_retrieve(lh,inst) LHM_lh_retrieve(MEM,lh,inst)
+# define lh_MEM_delete(lh,inst) LHM_lh_delete(MEM,lh,inst)
+# define lh_MEM_doall(lh,fn) LHM_lh_doall(MEM,lh,fn)
+# define lh_MEM_doall_arg(lh,fn,arg_type,arg) \
+ LHM_lh_doall_arg(MEM,lh,fn,arg_type,arg)
+# define lh_MEM_error(lh) LHM_lh_error(MEM,lh)
+# define lh_MEM_num_items(lh) LHM_lh_num_items(MEM,lh)
+# define lh_MEM_down_load(lh) LHM_lh_down_load(MEM,lh)
+# define lh_MEM_node_stats_bio(lh,out) \
+ LHM_lh_node_stats_bio(MEM,lh,out)
+# define lh_MEM_node_usage_stats_bio(lh,out) \
+ LHM_lh_node_usage_stats_bio(MEM,lh,out)
+# define lh_MEM_stats_bio(lh,out) \
+ LHM_lh_stats_bio(MEM,lh,out)
+# define lh_MEM_free(lh) LHM_lh_free(MEM,lh)
+# define lh_OBJ_NAME_new() LHM_lh_new(OBJ_NAME,obj_name)
+# define lh_OBJ_NAME_insert(lh,inst) LHM_lh_insert(OBJ_NAME,lh,inst)
+# define lh_OBJ_NAME_retrieve(lh,inst) LHM_lh_retrieve(OBJ_NAME,lh,inst)
+# define lh_OBJ_NAME_delete(lh,inst) LHM_lh_delete(OBJ_NAME,lh,inst)
+# define lh_OBJ_NAME_doall(lh,fn) LHM_lh_doall(OBJ_NAME,lh,fn)
+# define lh_OBJ_NAME_doall_arg(lh,fn,arg_type,arg) \
+ LHM_lh_doall_arg(OBJ_NAME,lh,fn,arg_type,arg)
+# define lh_OBJ_NAME_error(lh) LHM_lh_error(OBJ_NAME,lh)
+# define lh_OBJ_NAME_num_items(lh) LHM_lh_num_items(OBJ_NAME,lh)
+# define lh_OBJ_NAME_down_load(lh) LHM_lh_down_load(OBJ_NAME,lh)
+# define lh_OBJ_NAME_node_stats_bio(lh,out) \
+ LHM_lh_node_stats_bio(OBJ_NAME,lh,out)
+# define lh_OBJ_NAME_node_usage_stats_bio(lh,out) \
+ LHM_lh_node_usage_stats_bio(OBJ_NAME,lh,out)
+# define lh_OBJ_NAME_stats_bio(lh,out) \
+ LHM_lh_stats_bio(OBJ_NAME,lh,out)
+# define lh_OBJ_NAME_free(lh) LHM_lh_free(OBJ_NAME,lh)
+# define lh_OPENSSL_CSTRING_new() LHM_lh_new(OPENSSL_CSTRING,openssl_cstring)
+# define lh_OPENSSL_CSTRING_insert(lh,inst) LHM_lh_insert(OPENSSL_CSTRING,lh,inst)
+# define lh_OPENSSL_CSTRING_retrieve(lh,inst) LHM_lh_retrieve(OPENSSL_CSTRING,lh,inst)
+# define lh_OPENSSL_CSTRING_delete(lh,inst) LHM_lh_delete(OPENSSL_CSTRING,lh,inst)
+# define lh_OPENSSL_CSTRING_doall(lh,fn) LHM_lh_doall(OPENSSL_CSTRING,lh,fn)
+# define lh_OPENSSL_CSTRING_doall_arg(lh,fn,arg_type,arg) \
+ LHM_lh_doall_arg(OPENSSL_CSTRING,lh,fn,arg_type,arg)
+# define lh_OPENSSL_CSTRING_error(lh) LHM_lh_error(OPENSSL_CSTRING,lh)
+# define lh_OPENSSL_CSTRING_num_items(lh) LHM_lh_num_items(OPENSSL_CSTRING,lh)
+# define lh_OPENSSL_CSTRING_down_load(lh) LHM_lh_down_load(OPENSSL_CSTRING,lh)
+# define lh_OPENSSL_CSTRING_node_stats_bio(lh,out) \
+ LHM_lh_node_stats_bio(OPENSSL_CSTRING,lh,out)
+# define lh_OPENSSL_CSTRING_node_usage_stats_bio(lh,out) \
+ LHM_lh_node_usage_stats_bio(OPENSSL_CSTRING,lh,out)
+# define lh_OPENSSL_CSTRING_stats_bio(lh,out) \
+ LHM_lh_stats_bio(OPENSSL_CSTRING,lh,out)
+# define lh_OPENSSL_CSTRING_free(lh) LHM_lh_free(OPENSSL_CSTRING,lh)
+# define lh_OPENSSL_STRING_new() LHM_lh_new(OPENSSL_STRING,openssl_string)
+# define lh_OPENSSL_STRING_insert(lh,inst) LHM_lh_insert(OPENSSL_STRING,lh,inst)
+# define lh_OPENSSL_STRING_retrieve(lh,inst) LHM_lh_retrieve(OPENSSL_STRING,lh,inst)
+# define lh_OPENSSL_STRING_delete(lh,inst) LHM_lh_delete(OPENSSL_STRING,lh,inst)
+# define lh_OPENSSL_STRING_doall(lh,fn) LHM_lh_doall(OPENSSL_STRING,lh,fn)
+# define lh_OPENSSL_STRING_doall_arg(lh,fn,arg_type,arg) \
+ LHM_lh_doall_arg(OPENSSL_STRING,lh,fn,arg_type,arg)
+# define lh_OPENSSL_STRING_error(lh) LHM_lh_error(OPENSSL_STRING,lh)
+# define lh_OPENSSL_STRING_num_items(lh) LHM_lh_num_items(OPENSSL_STRING,lh)
+# define lh_OPENSSL_STRING_down_load(lh) LHM_lh_down_load(OPENSSL_STRING,lh)
+# define lh_OPENSSL_STRING_node_stats_bio(lh,out) \
+ LHM_lh_node_stats_bio(OPENSSL_STRING,lh,out)
+# define lh_OPENSSL_STRING_node_usage_stats_bio(lh,out) \
+ LHM_lh_node_usage_stats_bio(OPENSSL_STRING,lh,out)
+# define lh_OPENSSL_STRING_stats_bio(lh,out) \
+ LHM_lh_stats_bio(OPENSSL_STRING,lh,out)
+# define lh_OPENSSL_STRING_free(lh) LHM_lh_free(OPENSSL_STRING,lh)
+# define lh_SSL_SESSION_new() LHM_lh_new(SSL_SESSION,ssl_session)
+# define lh_SSL_SESSION_insert(lh,inst) LHM_lh_insert(SSL_SESSION,lh,inst)
+# define lh_SSL_SESSION_retrieve(lh,inst) LHM_lh_retrieve(SSL_SESSION,lh,inst)
+# define lh_SSL_SESSION_delete(lh,inst) LHM_lh_delete(SSL_SESSION,lh,inst)
+# define lh_SSL_SESSION_doall(lh,fn) LHM_lh_doall(SSL_SESSION,lh,fn)
+# define lh_SSL_SESSION_doall_arg(lh,fn,arg_type,arg) \
+ LHM_lh_doall_arg(SSL_SESSION,lh,fn,arg_type,arg)
+# define lh_SSL_SESSION_error(lh) LHM_lh_error(SSL_SESSION,lh)
+# define lh_SSL_SESSION_num_items(lh) LHM_lh_num_items(SSL_SESSION,lh)
+# define lh_SSL_SESSION_down_load(lh) LHM_lh_down_load(SSL_SESSION,lh)
+# define lh_SSL_SESSION_node_stats_bio(lh,out) \
+ LHM_lh_node_stats_bio(SSL_SESSION,lh,out)
+# define lh_SSL_SESSION_node_usage_stats_bio(lh,out) \
+ LHM_lh_node_usage_stats_bio(SSL_SESSION,lh,out)
+# define lh_SSL_SESSION_stats_bio(lh,out) \
+ LHM_lh_stats_bio(SSL_SESSION,lh,out)
+# define lh_SSL_SESSION_free(lh) LHM_lh_free(SSL_SESSION,lh)
+#ifdef __cplusplus
+}
+#endif
+#endif /* !defined HEADER_SAFESTACK_H */
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/seed.h b/protocols/Telegram/tgl/openssl/include/openssl/seed.h
new file mode 100644
index 0000000000..8cbf0d9281
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/seed.h
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2007 KISA(Korea Information Security Agency). All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Neither the name of author nor the names of its contributors may
+ * be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``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 AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+/* ====================================================================
+ * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_SEED_H
+# define HEADER_SEED_H
+
+# include <openssl/opensslconf.h>
+# include <openssl/e_os2.h>
+# include <openssl/crypto.h>
+
+# ifdef OPENSSL_NO_SEED
+# error SEED is disabled.
+# endif
+
+/* look whether we need 'long' to get 32 bits */
+# ifdef AES_LONG
+# ifndef SEED_LONG
+# define SEED_LONG 1
+# endif
+# endif
+
+# if !defined(NO_SYS_TYPES_H)
+# include <sys/types.h>
+# endif
+
+# define SEED_BLOCK_SIZE 16
+# define SEED_KEY_LENGTH 16
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct seed_key_st {
+# ifdef SEED_LONG
+ unsigned long data[32];
+# else
+ unsigned int data[32];
+# endif
+} SEED_KEY_SCHEDULE;
+
+# ifdef OPENSSL_FIPS
+void private_SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH],
+ SEED_KEY_SCHEDULE *ks);
+# endif
+void SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH],
+ SEED_KEY_SCHEDULE *ks);
+
+void SEED_encrypt(const unsigned char s[SEED_BLOCK_SIZE],
+ unsigned char d[SEED_BLOCK_SIZE],
+ const SEED_KEY_SCHEDULE *ks);
+void SEED_decrypt(const unsigned char s[SEED_BLOCK_SIZE],
+ unsigned char d[SEED_BLOCK_SIZE],
+ const SEED_KEY_SCHEDULE *ks);
+
+void SEED_ecb_encrypt(const unsigned char *in, unsigned char *out,
+ const SEED_KEY_SCHEDULE *ks, int enc);
+void SEED_cbc_encrypt(const unsigned char *in, unsigned char *out, size_t len,
+ const SEED_KEY_SCHEDULE *ks,
+ unsigned char ivec[SEED_BLOCK_SIZE], int enc);
+void SEED_cfb128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const SEED_KEY_SCHEDULE *ks,
+ unsigned char ivec[SEED_BLOCK_SIZE], int *num,
+ int enc);
+void SEED_ofb128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const SEED_KEY_SCHEDULE *ks,
+ unsigned char ivec[SEED_BLOCK_SIZE], int *num);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* HEADER_SEED_H */
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/sha.h b/protocols/Telegram/tgl/openssl/include/openssl/sha.h
new file mode 100644
index 0000000000..e5169e4fee
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/sha.h
@@ -0,0 +1,214 @@
+/* crypto/sha/sha.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_SHA_H
+# define HEADER_SHA_H
+
+# include <openssl/e_os2.h>
+# include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# if defined(OPENSSL_NO_SHA) || (defined(OPENSSL_NO_SHA0) && defined(OPENSSL_NO_SHA1))
+# error SHA is disabled.
+# endif
+
+# if defined(OPENSSL_FIPS)
+# define FIPS_SHA_SIZE_T size_t
+# endif
+
+/*-
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ * ! SHA_LONG has to be at least 32 bits wide. If it's wider, then !
+ * ! SHA_LONG_LOG2 has to be defined along. !
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ */
+
+# if defined(__LP32__)
+# define SHA_LONG unsigned long
+# elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)
+# define SHA_LONG unsigned long
+# define SHA_LONG_LOG2 3
+# else
+# define SHA_LONG unsigned int
+# endif
+
+# define SHA_LBLOCK 16
+# define SHA_CBLOCK (SHA_LBLOCK*4)/* SHA treats input data as a
+ * contiguous array of 32 bit wide
+ * big-endian values. */
+# define SHA_LAST_BLOCK (SHA_CBLOCK-8)
+# define SHA_DIGEST_LENGTH 20
+
+typedef struct SHAstate_st {
+ SHA_LONG h0, h1, h2, h3, h4;
+ SHA_LONG Nl, Nh;
+ SHA_LONG data[SHA_LBLOCK];
+ unsigned int num;
+} SHA_CTX;
+
+# ifndef OPENSSL_NO_SHA0
+# ifdef OPENSSL_FIPS
+int private_SHA_Init(SHA_CTX *c);
+# endif
+int SHA_Init(SHA_CTX *c);
+int SHA_Update(SHA_CTX *c, const void *data, size_t len);
+int SHA_Final(unsigned char *md, SHA_CTX *c);
+unsigned char *SHA(const unsigned char *d, size_t n, unsigned char *md);
+void SHA_Transform(SHA_CTX *c, const unsigned char *data);
+# endif
+# ifndef OPENSSL_NO_SHA1
+# ifdef OPENSSL_FIPS
+int private_SHA1_Init(SHA_CTX *c);
+# endif
+int SHA1_Init(SHA_CTX *c);
+int SHA1_Update(SHA_CTX *c, const void *data, size_t len);
+int SHA1_Final(unsigned char *md, SHA_CTX *c);
+unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md);
+void SHA1_Transform(SHA_CTX *c, const unsigned char *data);
+# endif
+
+# define SHA256_CBLOCK (SHA_LBLOCK*4)/* SHA-256 treats input data as a
+ * contiguous array of 32 bit wide
+ * big-endian values. */
+# define SHA224_DIGEST_LENGTH 28
+# define SHA256_DIGEST_LENGTH 32
+
+typedef struct SHA256state_st {
+ SHA_LONG h[8];
+ SHA_LONG Nl, Nh;
+ SHA_LONG data[SHA_LBLOCK];
+ unsigned int num, md_len;
+} SHA256_CTX;
+
+# ifndef OPENSSL_NO_SHA256
+# ifdef OPENSSL_FIPS
+int private_SHA224_Init(SHA256_CTX *c);
+int private_SHA256_Init(SHA256_CTX *c);
+# endif
+int SHA224_Init(SHA256_CTX *c);
+int SHA224_Update(SHA256_CTX *c, const void *data, size_t len);
+int SHA224_Final(unsigned char *md, SHA256_CTX *c);
+unsigned char *SHA224(const unsigned char *d, size_t n, unsigned char *md);
+int SHA256_Init(SHA256_CTX *c);
+int SHA256_Update(SHA256_CTX *c, const void *data, size_t len);
+int SHA256_Final(unsigned char *md, SHA256_CTX *c);
+unsigned char *SHA256(const unsigned char *d, size_t n, unsigned char *md);
+void SHA256_Transform(SHA256_CTX *c, const unsigned char *data);
+# endif
+
+# define SHA384_DIGEST_LENGTH 48
+# define SHA512_DIGEST_LENGTH 64
+
+# ifndef OPENSSL_NO_SHA512
+/*
+ * Unlike 32-bit digest algorithms, SHA-512 *relies* on SHA_LONG64
+ * being exactly 64-bit wide. See Implementation Notes in sha512.c
+ * for further details.
+ */
+/*
+ * SHA-512 treats input data as a
+ * contiguous array of 64 bit
+ * wide big-endian values.
+ */
+# define SHA512_CBLOCK (SHA_LBLOCK*8)
+# if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)
+# define SHA_LONG64 unsigned __int64
+# define U64(C) C##UI64
+# elif defined(__arch64__)
+# define SHA_LONG64 unsigned long
+# define U64(C) C##UL
+# else
+# define SHA_LONG64 unsigned long long
+# define U64(C) C##ULL
+# endif
+
+typedef struct SHA512state_st {
+ SHA_LONG64 h[8];
+ SHA_LONG64 Nl, Nh;
+ union {
+ SHA_LONG64 d[SHA_LBLOCK];
+ unsigned char p[SHA512_CBLOCK];
+ } u;
+ unsigned int num, md_len;
+} SHA512_CTX;
+# endif
+
+# ifndef OPENSSL_NO_SHA512
+# ifdef OPENSSL_FIPS
+int private_SHA384_Init(SHA512_CTX *c);
+int private_SHA512_Init(SHA512_CTX *c);
+# endif
+int SHA384_Init(SHA512_CTX *c);
+int SHA384_Update(SHA512_CTX *c, const void *data, size_t len);
+int SHA384_Final(unsigned char *md, SHA512_CTX *c);
+unsigned char *SHA384(const unsigned char *d, size_t n, unsigned char *md);
+int SHA512_Init(SHA512_CTX *c);
+int SHA512_Update(SHA512_CTX *c, const void *data, size_t len);
+int SHA512_Final(unsigned char *md, SHA512_CTX *c);
+unsigned char *SHA512(const unsigned char *d, size_t n, unsigned char *md);
+void SHA512_Transform(SHA512_CTX *c, const unsigned char *data);
+# endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/srp.h b/protocols/Telegram/tgl/openssl/include/openssl/srp.h
new file mode 100644
index 0000000000..d072536fec
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/srp.h
@@ -0,0 +1,169 @@
+/* crypto/srp/srp.h */
+/*
+ * Written by Christophe Renou (christophe.renou@edelweb.fr) with the
+ * precious help of Peter Sylvester (peter.sylvester@edelweb.fr) for the
+ * EdelKey project and contributed to the OpenSSL project 2004.
+ */
+/* ====================================================================
+ * Copyright (c) 2004 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+#ifndef __SRP_H__
+# define __SRP_H__
+
+# ifndef OPENSSL_NO_SRP
+
+# include <stdio.h>
+# include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# include <openssl/safestack.h>
+# include <openssl/bn.h>
+# include <openssl/crypto.h>
+
+typedef struct SRP_gN_cache_st {
+ char *b64_bn;
+ BIGNUM *bn;
+} SRP_gN_cache;
+
+
+DECLARE_STACK_OF(SRP_gN_cache)
+
+typedef struct SRP_user_pwd_st {
+ char *id;
+ BIGNUM *s;
+ BIGNUM *v;
+ const BIGNUM *g;
+ const BIGNUM *N;
+ char *info;
+} SRP_user_pwd;
+
+DECLARE_STACK_OF(SRP_user_pwd)
+
+typedef struct SRP_VBASE_st {
+ STACK_OF(SRP_user_pwd) *users_pwd;
+ STACK_OF(SRP_gN_cache) *gN_cache;
+/* to simulate a user */
+ char *seed_key;
+ BIGNUM *default_g;
+ BIGNUM *default_N;
+} SRP_VBASE;
+
+/*
+ * Structure interne pour retenir les couples N et g
+ */
+typedef struct SRP_gN_st {
+ char *id;
+ BIGNUM *g;
+ BIGNUM *N;
+} SRP_gN;
+
+DECLARE_STACK_OF(SRP_gN)
+
+SRP_VBASE *SRP_VBASE_new(char *seed_key);
+int SRP_VBASE_free(SRP_VBASE *vb);
+int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file);
+SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username);
+char *SRP_create_verifier(const char *user, const char *pass, char **salt,
+ char **verifier, const char *N, const char *g);
+int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt,
+ BIGNUM **verifier, BIGNUM *N, BIGNUM *g);
+
+# define SRP_NO_ERROR 0
+# define SRP_ERR_VBASE_INCOMPLETE_FILE 1
+# define SRP_ERR_VBASE_BN_LIB 2
+# define SRP_ERR_OPEN_FILE 3
+# define SRP_ERR_MEMORY 4
+
+# define DB_srptype 0
+# define DB_srpverifier 1
+# define DB_srpsalt 2
+# define DB_srpid 3
+# define DB_srpgN 4
+# define DB_srpinfo 5
+# undef DB_NUMBER
+# define DB_NUMBER 6
+
+# define DB_SRP_INDEX 'I'
+# define DB_SRP_VALID 'V'
+# define DB_SRP_REVOKED 'R'
+# define DB_SRP_MODIF 'v'
+
+/* see srp.c */
+char *SRP_check_known_gN_param(BIGNUM *g, BIGNUM *N);
+SRP_gN *SRP_get_default_gN(const char *id);
+
+/* server side .... */
+BIGNUM *SRP_Calc_server_key(BIGNUM *A, BIGNUM *v, BIGNUM *u, BIGNUM *b,
+ BIGNUM *N);
+BIGNUM *SRP_Calc_B(BIGNUM *b, BIGNUM *N, BIGNUM *g, BIGNUM *v);
+int SRP_Verify_A_mod_N(BIGNUM *A, BIGNUM *N);
+BIGNUM *SRP_Calc_u(BIGNUM *A, BIGNUM *B, BIGNUM *N);
+
+/* client side .... */
+BIGNUM *SRP_Calc_x(BIGNUM *s, const char *user, const char *pass);
+BIGNUM *SRP_Calc_A(BIGNUM *a, BIGNUM *N, BIGNUM *g);
+BIGNUM *SRP_Calc_client_key(BIGNUM *N, BIGNUM *B, BIGNUM *g, BIGNUM *x,
+ BIGNUM *a, BIGNUM *u);
+int SRP_Verify_B_mod_N(BIGNUM *B, BIGNUM *N);
+
+# define SRP_MINIMAL_N 1024
+
+#ifdef __cplusplus
+}
+#endif
+
+# endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/srtp.h b/protocols/Telegram/tgl/openssl/include/openssl/srtp.h
new file mode 100644
index 0000000000..2279c32b89
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/srtp.h
@@ -0,0 +1,147 @@
+/* ssl/srtp.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+/* ====================================================================
+ * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+/*
+ * DTLS code by Eric Rescorla <ekr@rtfm.com>
+ *
+ * Copyright (C) 2006, Network Resonance, Inc. Copyright (C) 2011, RTFM, Inc.
+ */
+
+#ifndef HEADER_D1_SRTP_H
+# define HEADER_D1_SRTP_H
+
+# include <openssl/ssl.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# define SRTP_AES128_CM_SHA1_80 0x0001
+# define SRTP_AES128_CM_SHA1_32 0x0002
+# define SRTP_AES128_F8_SHA1_80 0x0003
+# define SRTP_AES128_F8_SHA1_32 0x0004
+# define SRTP_NULL_SHA1_80 0x0005
+# define SRTP_NULL_SHA1_32 0x0006
+
+# ifndef OPENSSL_NO_SRTP
+
+int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles);
+int SSL_set_tlsext_use_srtp(SSL *ctx, const char *profiles);
+
+STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles(SSL *ssl);
+SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *s);
+
+# endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/ssl.h b/protocols/Telegram/tgl/openssl/include/openssl/ssl.h
new file mode 100644
index 0000000000..6fe1a2474d
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/ssl.h
@@ -0,0 +1,3164 @@
+/* ssl/ssl.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+/* ====================================================================
+ * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+/* ====================================================================
+ * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
+ * ECC cipher suite support in OpenSSL originally developed by
+ * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
+ */
+/* ====================================================================
+ * Copyright 2005 Nokia. All rights reserved.
+ *
+ * The portions of the attached software ("Contribution") is developed by
+ * Nokia Corporation and is licensed pursuant to the OpenSSL open source
+ * license.
+ *
+ * The Contribution, originally written by Mika Kousa and Pasi Eronen of
+ * Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites
+ * support (see RFC 4279) to OpenSSL.
+ *
+ * No patent licenses or other rights except those expressly stated in
+ * the OpenSSL open source license shall be deemed granted or received
+ * expressly, by implication, estoppel, or otherwise.
+ *
+ * No assurances are provided by Nokia that the Contribution does not
+ * infringe the patent or other intellectual property rights of any third
+ * party or that the license provides you with all the necessary rights
+ * to make use of the Contribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN
+ * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA
+ * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY
+ * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR
+ * OTHERWISE.
+ */
+
+#ifndef HEADER_SSL_H
+# define HEADER_SSL_H
+
+# include <openssl/e_os2.h>
+
+# ifndef OPENSSL_NO_COMP
+# include <openssl/comp.h>
+# endif
+# ifndef OPENSSL_NO_BIO
+# include <openssl/bio.h>
+# endif
+# ifndef OPENSSL_NO_DEPRECATED
+# ifndef OPENSSL_NO_X509
+# include <openssl/x509.h>
+# endif
+# include <openssl/crypto.h>
+# include <openssl/lhash.h>
+# include <openssl/buffer.h>
+# endif
+# include <openssl/pem.h>
+# include <openssl/hmac.h>
+
+# include <openssl/kssl.h>
+# include <openssl/safestack.h>
+# include <openssl/symhacks.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* SSLeay version number for ASN.1 encoding of the session information */
+/*-
+ * Version 0 - initial version
+ * Version 1 - added the optional peer certificate
+ */
+# define SSL_SESSION_ASN1_VERSION 0x0001
+
+/* text strings for the ciphers */
+# define SSL_TXT_NULL_WITH_MD5 SSL2_TXT_NULL_WITH_MD5
+# define SSL_TXT_RC4_128_WITH_MD5 SSL2_TXT_RC4_128_WITH_MD5
+# define SSL_TXT_RC4_128_EXPORT40_WITH_MD5 SSL2_TXT_RC4_128_EXPORT40_WITH_MD5
+# define SSL_TXT_RC2_128_CBC_WITH_MD5 SSL2_TXT_RC2_128_CBC_WITH_MD5
+# define SSL_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5
+# define SSL_TXT_IDEA_128_CBC_WITH_MD5 SSL2_TXT_IDEA_128_CBC_WITH_MD5
+# define SSL_TXT_DES_64_CBC_WITH_MD5 SSL2_TXT_DES_64_CBC_WITH_MD5
+# define SSL_TXT_DES_64_CBC_WITH_SHA SSL2_TXT_DES_64_CBC_WITH_SHA
+# define SSL_TXT_DES_192_EDE3_CBC_WITH_MD5 SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5
+# define SSL_TXT_DES_192_EDE3_CBC_WITH_SHA SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA
+
+/*
+ * VRS Additional Kerberos5 entries
+ */
+# define SSL_TXT_KRB5_DES_64_CBC_SHA SSL3_TXT_KRB5_DES_64_CBC_SHA
+# define SSL_TXT_KRB5_DES_192_CBC3_SHA SSL3_TXT_KRB5_DES_192_CBC3_SHA
+# define SSL_TXT_KRB5_RC4_128_SHA SSL3_TXT_KRB5_RC4_128_SHA
+# define SSL_TXT_KRB5_IDEA_128_CBC_SHA SSL3_TXT_KRB5_IDEA_128_CBC_SHA
+# define SSL_TXT_KRB5_DES_64_CBC_MD5 SSL3_TXT_KRB5_DES_64_CBC_MD5
+# define SSL_TXT_KRB5_DES_192_CBC3_MD5 SSL3_TXT_KRB5_DES_192_CBC3_MD5
+# define SSL_TXT_KRB5_RC4_128_MD5 SSL3_TXT_KRB5_RC4_128_MD5
+# define SSL_TXT_KRB5_IDEA_128_CBC_MD5 SSL3_TXT_KRB5_IDEA_128_CBC_MD5
+
+# define SSL_TXT_KRB5_DES_40_CBC_SHA SSL3_TXT_KRB5_DES_40_CBC_SHA
+# define SSL_TXT_KRB5_RC2_40_CBC_SHA SSL3_TXT_KRB5_RC2_40_CBC_SHA
+# define SSL_TXT_KRB5_RC4_40_SHA SSL3_TXT_KRB5_RC4_40_SHA
+# define SSL_TXT_KRB5_DES_40_CBC_MD5 SSL3_TXT_KRB5_DES_40_CBC_MD5
+# define SSL_TXT_KRB5_RC2_40_CBC_MD5 SSL3_TXT_KRB5_RC2_40_CBC_MD5
+# define SSL_TXT_KRB5_RC4_40_MD5 SSL3_TXT_KRB5_RC4_40_MD5
+
+# define SSL_TXT_KRB5_DES_40_CBC_SHA SSL3_TXT_KRB5_DES_40_CBC_SHA
+# define SSL_TXT_KRB5_DES_40_CBC_MD5 SSL3_TXT_KRB5_DES_40_CBC_MD5
+# define SSL_TXT_KRB5_DES_64_CBC_SHA SSL3_TXT_KRB5_DES_64_CBC_SHA
+# define SSL_TXT_KRB5_DES_64_CBC_MD5 SSL3_TXT_KRB5_DES_64_CBC_MD5
+# define SSL_TXT_KRB5_DES_192_CBC3_SHA SSL3_TXT_KRB5_DES_192_CBC3_SHA
+# define SSL_TXT_KRB5_DES_192_CBC3_MD5 SSL3_TXT_KRB5_DES_192_CBC3_MD5
+# define SSL_MAX_KRB5_PRINCIPAL_LENGTH 256
+
+# define SSL_MAX_SSL_SESSION_ID_LENGTH 32
+# define SSL_MAX_SID_CTX_LENGTH 32
+
+# define SSL_MIN_RSA_MODULUS_LENGTH_IN_BYTES (512/8)
+# define SSL_MAX_KEY_ARG_LENGTH 8
+# define SSL_MAX_MASTER_KEY_LENGTH 48
+
+/* These are used to specify which ciphers to use and not to use */
+
+# define SSL_TXT_EXP40 "EXPORT40"
+# define SSL_TXT_EXP56 "EXPORT56"
+# define SSL_TXT_LOW "LOW"
+# define SSL_TXT_MEDIUM "MEDIUM"
+# define SSL_TXT_HIGH "HIGH"
+# define SSL_TXT_FIPS "FIPS"
+
+# define SSL_TXT_kFZA "kFZA"/* unused! */
+# define SSL_TXT_aFZA "aFZA"/* unused! */
+# define SSL_TXT_eFZA "eFZA"/* unused! */
+# define SSL_TXT_FZA "FZA"/* unused! */
+
+# define SSL_TXT_aNULL "aNULL"
+# define SSL_TXT_eNULL "eNULL"
+# define SSL_TXT_NULL "NULL"
+
+# define SSL_TXT_kRSA "kRSA"
+# define SSL_TXT_kDHr "kDHr"
+# define SSL_TXT_kDHd "kDHd"
+# define SSL_TXT_kDH "kDH"
+# define SSL_TXT_kEDH "kEDH"
+# define SSL_TXT_kDHE "kDHE"/* alias for kEDH */
+# define SSL_TXT_kKRB5 "kKRB5"
+# define SSL_TXT_kECDHr "kECDHr"
+# define SSL_TXT_kECDHe "kECDHe"
+# define SSL_TXT_kECDH "kECDH"
+# define SSL_TXT_kEECDH "kEECDH"
+# define SSL_TXT_kECDHE "kECDHE"/* alias for kEECDH */
+# define SSL_TXT_kPSK "kPSK"
+# define SSL_TXT_kGOST "kGOST"
+# define SSL_TXT_kSRP "kSRP"
+
+# define SSL_TXT_aRSA "aRSA"
+# define SSL_TXT_aDSS "aDSS"
+# define SSL_TXT_aDH "aDH"
+# define SSL_TXT_aECDH "aECDH"
+# define SSL_TXT_aKRB5 "aKRB5"
+# define SSL_TXT_aECDSA "aECDSA"
+# define SSL_TXT_aPSK "aPSK"
+# define SSL_TXT_aGOST94 "aGOST94"
+# define SSL_TXT_aGOST01 "aGOST01"
+# define SSL_TXT_aGOST "aGOST"
+# define SSL_TXT_aSRP "aSRP"
+
+# define SSL_TXT_DSS "DSS"
+# define SSL_TXT_DH "DH"
+# define SSL_TXT_EDH "EDH"/* same as "kEDH:-ADH" */
+# define SSL_TXT_DHE "DHE"/* alias for EDH */
+# define SSL_TXT_ADH "ADH"
+# define SSL_TXT_RSA "RSA"
+# define SSL_TXT_ECDH "ECDH"
+# define SSL_TXT_EECDH "EECDH"/* same as "kEECDH:-AECDH" */
+# define SSL_TXT_ECDHE "ECDHE"/* alias for ECDHE" */
+# define SSL_TXT_AECDH "AECDH"
+# define SSL_TXT_ECDSA "ECDSA"
+# define SSL_TXT_KRB5 "KRB5"
+# define SSL_TXT_PSK "PSK"
+# define SSL_TXT_SRP "SRP"
+
+# define SSL_TXT_DES "DES"
+# define SSL_TXT_3DES "3DES"
+# define SSL_TXT_RC4 "RC4"
+# define SSL_TXT_RC2 "RC2"
+# define SSL_TXT_IDEA "IDEA"
+# define SSL_TXT_SEED "SEED"
+# define SSL_TXT_AES128 "AES128"
+# define SSL_TXT_AES256 "AES256"
+# define SSL_TXT_AES "AES"
+# define SSL_TXT_AES_GCM "AESGCM"
+# define SSL_TXT_CAMELLIA128 "CAMELLIA128"
+# define SSL_TXT_CAMELLIA256 "CAMELLIA256"
+# define SSL_TXT_CAMELLIA "CAMELLIA"
+
+# define SSL_TXT_MD5 "MD5"
+# define SSL_TXT_SHA1 "SHA1"
+# define SSL_TXT_SHA "SHA"/* same as "SHA1" */
+# define SSL_TXT_GOST94 "GOST94"
+# define SSL_TXT_GOST89MAC "GOST89MAC"
+# define SSL_TXT_SHA256 "SHA256"
+# define SSL_TXT_SHA384 "SHA384"
+
+# define SSL_TXT_SSLV2 "SSLv2"
+# define SSL_TXT_SSLV3 "SSLv3"
+# define SSL_TXT_TLSV1 "TLSv1"
+# define SSL_TXT_TLSV1_1 "TLSv1.1"
+# define SSL_TXT_TLSV1_2 "TLSv1.2"
+
+# define SSL_TXT_EXP "EXP"
+# define SSL_TXT_EXPORT "EXPORT"
+
+# define SSL_TXT_ALL "ALL"
+
+/*-
+ * COMPLEMENTOF* definitions. These identifiers are used to (de-select)
+ * ciphers normally not being used.
+ * Example: "RC4" will activate all ciphers using RC4 including ciphers
+ * without authentication, which would normally disabled by DEFAULT (due
+ * the "!ADH" being part of default). Therefore "RC4:!COMPLEMENTOFDEFAULT"
+ * will make sure that it is also disabled in the specific selection.
+ * COMPLEMENTOF* identifiers are portable between version, as adjustments
+ * to the default cipher setup will also be included here.
+ *
+ * COMPLEMENTOFDEFAULT does not experience the same special treatment that
+ * DEFAULT gets, as only selection is being done and no sorting as needed
+ * for DEFAULT.
+ */
+# define SSL_TXT_CMPALL "COMPLEMENTOFALL"
+# define SSL_TXT_CMPDEF "COMPLEMENTOFDEFAULT"
+
+/*
+ * The following cipher list is used by default. It also is substituted when
+ * an application-defined cipher list string starts with 'DEFAULT'.
+ */
+# define SSL_DEFAULT_CIPHER_LIST "ALL:!EXPORT:!aNULL:!eNULL:!SSLv2"
+/*
+ * As of OpenSSL 1.0.0, ssl_create_cipher_list() in ssl/ssl_ciph.c always
+ * starts with a reasonable order, and all we have to do for DEFAULT is
+ * throwing out anonymous and unencrypted ciphersuites! (The latter are not
+ * actually enabled by ALL, but "ALL:RSA" would enable some of them.)
+ */
+
+/* Used in SSL_set_shutdown()/SSL_get_shutdown(); */
+# define SSL_SENT_SHUTDOWN 1
+# define SSL_RECEIVED_SHUTDOWN 2
+
+#ifdef __cplusplus
+}
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# if (defined(OPENSSL_NO_RSA) || defined(OPENSSL_NO_MD5)) && !defined(OPENSSL_NO_SSL2)
+# define OPENSSL_NO_SSL2
+# endif
+
+# define SSL_FILETYPE_ASN1 X509_FILETYPE_ASN1
+# define SSL_FILETYPE_PEM X509_FILETYPE_PEM
+
+/*
+ * This is needed to stop compilers complaining about the 'struct ssl_st *'
+ * function parameters used to prototype callbacks in SSL_CTX.
+ */
+typedef struct ssl_st *ssl_crock_st;
+typedef struct tls_session_ticket_ext_st TLS_SESSION_TICKET_EXT;
+typedef struct ssl_method_st SSL_METHOD;
+typedef struct ssl_cipher_st SSL_CIPHER;
+typedef struct ssl_session_st SSL_SESSION;
+typedef struct tls_sigalgs_st TLS_SIGALGS;
+typedef struct ssl_conf_ctx_st SSL_CONF_CTX;
+
+DECLARE_STACK_OF(SSL_CIPHER)
+
+/* SRTP protection profiles for use with the use_srtp extension (RFC 5764)*/
+typedef struct srtp_protection_profile_st {
+ const char *name;
+ unsigned long id;
+} SRTP_PROTECTION_PROFILE;
+
+DECLARE_STACK_OF(SRTP_PROTECTION_PROFILE)
+
+typedef int (*tls_session_ticket_ext_cb_fn) (SSL *s,
+ const unsigned char *data,
+ int len, void *arg);
+typedef int (*tls_session_secret_cb_fn) (SSL *s, void *secret,
+ int *secret_len,
+ STACK_OF(SSL_CIPHER) *peer_ciphers,
+ SSL_CIPHER **cipher, void *arg);
+
+# ifndef OPENSSL_NO_TLSEXT
+
+/* Typedefs for handling custom extensions */
+
+typedef int (*custom_ext_add_cb) (SSL *s, unsigned int ext_type,
+ const unsigned char **out,
+ size_t *outlen, int *al, void *add_arg);
+
+typedef void (*custom_ext_free_cb) (SSL *s, unsigned int ext_type,
+ const unsigned char *out, void *add_arg);
+
+typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type,
+ const unsigned char *in,
+ size_t inlen, int *al, void *parse_arg);
+
+# endif
+
+# ifndef OPENSSL_NO_SSL_INTERN
+
+/* used to hold info on the particular ciphers used */
+struct ssl_cipher_st {
+ int valid;
+ const char *name; /* text name */
+ unsigned long id; /* id, 4 bytes, first is version */
+ /*
+ * changed in 0.9.9: these four used to be portions of a single value
+ * 'algorithms'
+ */
+ unsigned long algorithm_mkey; /* key exchange algorithm */
+ unsigned long algorithm_auth; /* server authentication */
+ unsigned long algorithm_enc; /* symmetric encryption */
+ unsigned long algorithm_mac; /* symmetric authentication */
+ unsigned long algorithm_ssl; /* (major) protocol version */
+ unsigned long algo_strength; /* strength and export flags */
+ unsigned long algorithm2; /* Extra flags */
+ int strength_bits; /* Number of bits really used */
+ int alg_bits; /* Number of bits for algorithm */
+};
+
+/* Used to hold functions for SSLv2 or SSLv3/TLSv1 functions */
+struct ssl_method_st {
+ int version;
+ int (*ssl_new) (SSL *s);
+ void (*ssl_clear) (SSL *s);
+ void (*ssl_free) (SSL *s);
+ int (*ssl_accept) (SSL *s);
+ int (*ssl_connect) (SSL *s);
+ int (*ssl_read) (SSL *s, void *buf, int len);
+ int (*ssl_peek) (SSL *s, void *buf, int len);
+ int (*ssl_write) (SSL *s, const void *buf, int len);
+ int (*ssl_shutdown) (SSL *s);
+ int (*ssl_renegotiate) (SSL *s);
+ int (*ssl_renegotiate_check) (SSL *s);
+ long (*ssl_get_message) (SSL *s, int st1, int stn, int mt, long
+ max, int *ok);
+ int (*ssl_read_bytes) (SSL *s, int type, unsigned char *buf, int len,
+ int peek);
+ int (*ssl_write_bytes) (SSL *s, int type, const void *buf_, int len);
+ int (*ssl_dispatch_alert) (SSL *s);
+ long (*ssl_ctrl) (SSL *s, int cmd, long larg, void *parg);
+ long (*ssl_ctx_ctrl) (SSL_CTX *ctx, int cmd, long larg, void *parg);
+ const SSL_CIPHER *(*get_cipher_by_char) (const unsigned char *ptr);
+ int (*put_cipher_by_char) (const SSL_CIPHER *cipher, unsigned char *ptr);
+ int (*ssl_pending) (const SSL *s);
+ int (*num_ciphers) (void);
+ const SSL_CIPHER *(*get_cipher) (unsigned ncipher);
+ const struct ssl_method_st *(*get_ssl_method) (int version);
+ long (*get_timeout) (void);
+ struct ssl3_enc_method *ssl3_enc; /* Extra SSLv3/TLS stuff */
+ int (*ssl_version) (void);
+ long (*ssl_callback_ctrl) (SSL *s, int cb_id, void (*fp) (void));
+ long (*ssl_ctx_callback_ctrl) (SSL_CTX *s, int cb_id, void (*fp) (void));
+};
+
+/*-
+ * Lets make this into an ASN.1 type structure as follows
+ * SSL_SESSION_ID ::= SEQUENCE {
+ * version INTEGER, -- structure version number
+ * SSLversion INTEGER, -- SSL version number
+ * Cipher OCTET STRING, -- the 3 byte cipher ID
+ * Session_ID OCTET STRING, -- the Session ID
+ * Master_key OCTET STRING, -- the master key
+ * KRB5_principal OCTET STRING -- optional Kerberos principal
+ * Key_Arg [ 0 ] IMPLICIT OCTET STRING, -- the optional Key argument
+ * Time [ 1 ] EXPLICIT INTEGER, -- optional Start Time
+ * Timeout [ 2 ] EXPLICIT INTEGER, -- optional Timeout ins seconds
+ * Peer [ 3 ] EXPLICIT X509, -- optional Peer Certificate
+ * Session_ID_context [ 4 ] EXPLICIT OCTET STRING, -- the Session ID context
+ * Verify_result [ 5 ] EXPLICIT INTEGER, -- X509_V_... code for `Peer'
+ * HostName [ 6 ] EXPLICIT OCTET STRING, -- optional HostName from servername TLS extension
+ * PSK_identity_hint [ 7 ] EXPLICIT OCTET STRING, -- optional PSK identity hint
+ * PSK_identity [ 8 ] EXPLICIT OCTET STRING, -- optional PSK identity
+ * Ticket_lifetime_hint [9] EXPLICIT INTEGER, -- server's lifetime hint for session ticket
+ * Ticket [10] EXPLICIT OCTET STRING, -- session ticket (clients only)
+ * Compression_meth [11] EXPLICIT OCTET STRING, -- optional compression method
+ * SRP_username [ 12 ] EXPLICIT OCTET STRING -- optional SRP username
+ * }
+ * Look in ssl/ssl_asn1.c for more details
+ * I'm using EXPLICIT tags so I can read the damn things using asn1parse :-).
+ */
+struct ssl_session_st {
+ int ssl_version; /* what ssl version session info is being
+ * kept in here? */
+ /* only really used in SSLv2 */
+ unsigned int key_arg_length;
+ unsigned char key_arg[SSL_MAX_KEY_ARG_LENGTH];
+ int master_key_length;
+ unsigned char master_key[SSL_MAX_MASTER_KEY_LENGTH];
+ /* session_id - valid? */
+ unsigned int session_id_length;
+ unsigned char session_id[SSL_MAX_SSL_SESSION_ID_LENGTH];
+ /*
+ * this is used to determine whether the session is being reused in the
+ * appropriate context. It is up to the application to set this, via
+ * SSL_new
+ */
+ unsigned int sid_ctx_length;
+ unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];
+# ifndef OPENSSL_NO_KRB5
+ unsigned int krb5_client_princ_len;
+ unsigned char krb5_client_princ[SSL_MAX_KRB5_PRINCIPAL_LENGTH];
+# endif /* OPENSSL_NO_KRB5 */
+# ifndef OPENSSL_NO_PSK
+ char *psk_identity_hint;
+ char *psk_identity;
+# endif
+ /*
+ * Used to indicate that session resumption is not allowed. Applications
+ * can also set this bit for a new session via not_resumable_session_cb
+ * to disable session caching and tickets.
+ */
+ int not_resumable;
+ /* The cert is the certificate used to establish this connection */
+ struct sess_cert_st /* SESS_CERT */ *sess_cert;
+ /*
+ * This is the cert for the other end. On clients, it will be the same as
+ * sess_cert->peer_key->x509 (the latter is not enough as sess_cert is
+ * not retained in the external representation of sessions, see
+ * ssl_asn1.c).
+ */
+ X509 *peer;
+ /*
+ * when app_verify_callback accepts a session where the peer's
+ * certificate is not ok, we must remember the error for session reuse:
+ */
+ long verify_result; /* only for servers */
+ int references;
+ long timeout;
+ long time;
+ unsigned int compress_meth; /* Need to lookup the method */
+ const SSL_CIPHER *cipher;
+ unsigned long cipher_id; /* when ASN.1 loaded, this needs to be used
+ * to load the 'cipher' structure */
+ STACK_OF(SSL_CIPHER) *ciphers; /* shared ciphers? */
+ CRYPTO_EX_DATA ex_data; /* application specific data */
+ /*
+ * These are used to make removal of session-ids more efficient and to
+ * implement a maximum cache size.
+ */
+ struct ssl_session_st *prev, *next;
+# ifndef OPENSSL_NO_TLSEXT
+ char *tlsext_hostname;
+# ifndef OPENSSL_NO_EC
+ size_t tlsext_ecpointformatlist_length;
+ unsigned char *tlsext_ecpointformatlist; /* peer's list */
+ size_t tlsext_ellipticcurvelist_length;
+ unsigned char *tlsext_ellipticcurvelist; /* peer's list */
+# endif /* OPENSSL_NO_EC */
+ /* RFC4507 info */
+ unsigned char *tlsext_tick; /* Session ticket */
+ size_t tlsext_ticklen; /* Session ticket length */
+ long tlsext_tick_lifetime_hint; /* Session lifetime hint in seconds */
+# endif
+# ifndef OPENSSL_NO_SRP
+ char *srp_username;
+# endif
+};
+
+# endif
+
+# define SSL_OP_MICROSOFT_SESS_ID_BUG 0x00000001L
+# define SSL_OP_NETSCAPE_CHALLENGE_BUG 0x00000002L
+/* Allow initial connection to servers that don't support RI */
+# define SSL_OP_LEGACY_SERVER_CONNECT 0x00000004L
+# define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG 0x00000008L
+# define SSL_OP_TLSEXT_PADDING 0x00000010L
+# define SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER 0x00000020L
+# define SSL_OP_SAFARI_ECDHE_ECDSA_BUG 0x00000040L
+# define SSL_OP_SSLEAY_080_CLIENT_DH_BUG 0x00000080L
+# define SSL_OP_TLS_D5_BUG 0x00000100L
+# define SSL_OP_TLS_BLOCK_PADDING_BUG 0x00000200L
+
+/* Hasn't done anything since OpenSSL 0.9.7h, retained for compatibility */
+# define SSL_OP_MSIE_SSLV2_RSA_PADDING 0x0
+/* Refers to ancient SSLREF and SSLv2, retained for compatibility */
+# define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG 0x0
+
+/*
+ * Disable SSL 3.0/TLS 1.0 CBC vulnerability workaround that was added in
+ * OpenSSL 0.9.6d. Usually (depending on the application protocol) the
+ * workaround is not needed. Unfortunately some broken SSL/TLS
+ * implementations cannot handle it at all, which is why we include it in
+ * SSL_OP_ALL.
+ */
+/* added in 0.9.6e */
+# define SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS 0x00000800L
+
+/*
+ * SSL_OP_ALL: various bug workarounds that should be rather harmless. This
+ * used to be 0x000FFFFFL before 0.9.7.
+ */
+# define SSL_OP_ALL 0x80000BFFL
+
+/* DTLS options */
+# define SSL_OP_NO_QUERY_MTU 0x00001000L
+/* Turn on Cookie Exchange (on relevant for servers) */
+# define SSL_OP_COOKIE_EXCHANGE 0x00002000L
+/* Don't use RFC4507 ticket extension */
+# define SSL_OP_NO_TICKET 0x00004000L
+/* Use Cisco's "speshul" version of DTLS_BAD_VER (as client) */
+# define SSL_OP_CISCO_ANYCONNECT 0x00008000L
+
+/* As server, disallow session resumption on renegotiation */
+# define SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION 0x00010000L
+/* Don't use compression even if supported */
+# define SSL_OP_NO_COMPRESSION 0x00020000L
+/* Permit unsafe legacy renegotiation */
+# define SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION 0x00040000L
+/* If set, always create a new key when using tmp_ecdh parameters */
+# define SSL_OP_SINGLE_ECDH_USE 0x00080000L
+/* If set, always create a new key when using tmp_dh parameters */
+# define SSL_OP_SINGLE_DH_USE 0x00100000L
+/* Does nothing: retained for compatibiity */
+# define SSL_OP_EPHEMERAL_RSA 0x0
+/*
+ * Set on servers to choose the cipher according to the server's preferences
+ */
+# define SSL_OP_CIPHER_SERVER_PREFERENCE 0x00400000L
+/*
+ * If set, a server will allow a client to issue a SSLv3.0 version number as
+ * latest version supported in the premaster secret, even when TLSv1.0
+ * (version 3.1) was announced in the client hello. Normally this is
+ * forbidden to prevent version rollback attacks.
+ */
+# define SSL_OP_TLS_ROLLBACK_BUG 0x00800000L
+
+# define SSL_OP_NO_SSLv2 0x01000000L
+# define SSL_OP_NO_SSLv3 0x02000000L
+# define SSL_OP_NO_TLSv1 0x04000000L
+# define SSL_OP_NO_TLSv1_2 0x08000000L
+# define SSL_OP_NO_TLSv1_1 0x10000000L
+
+# define SSL_OP_NO_DTLSv1 0x04000000L
+# define SSL_OP_NO_DTLSv1_2 0x08000000L
+
+# define SSL_OP_NO_SSL_MASK (SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|\
+ SSL_OP_NO_TLSv1|SSL_OP_NO_TLSv1_1|SSL_OP_NO_TLSv1_2)
+
+/*
+ * These next two were never actually used for anything since SSLeay zap so
+ * we have some more flags.
+ */
+/*
+ * The next flag deliberately changes the ciphertest, this is a check for the
+ * PKCS#1 attack
+ */
+# define SSL_OP_PKCS1_CHECK_1 0x0
+# define SSL_OP_PKCS1_CHECK_2 0x0
+
+# define SSL_OP_NETSCAPE_CA_DN_BUG 0x20000000L
+# define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x40000000L
+/*
+ * Make server add server-hello extension from early version of cryptopro
+ * draft, when GOST ciphersuite is negotiated. Required for interoperability
+ * with CryptoPro CSP 3.x
+ */
+# define SSL_OP_CRYPTOPRO_TLSEXT_BUG 0x80000000L
+
+/*
+ * Allow SSL_write(..., n) to return r with 0 < r < n (i.e. report success
+ * when just a single record has been written):
+ */
+# define SSL_MODE_ENABLE_PARTIAL_WRITE 0x00000001L
+/*
+ * Make it possible to retry SSL_write() with changed buffer location (buffer
+ * contents must stay the same!); this is not the default to avoid the
+ * misconception that non-blocking SSL_write() behaves like non-blocking
+ * write():
+ */
+# define SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER 0x00000002L
+/*
+ * Never bother the application with retries if the transport is blocking:
+ */
+# define SSL_MODE_AUTO_RETRY 0x00000004L
+/* Don't attempt to automatically build certificate chain */
+# define SSL_MODE_NO_AUTO_CHAIN 0x00000008L
+/*
+ * Save RAM by releasing read and write buffers when they're empty. (SSL3 and
+ * TLS only.) "Released" buffers are put onto a free-list in the context or
+ * just freed (depending on the context's setting for freelist_max_len).
+ */
+# define SSL_MODE_RELEASE_BUFFERS 0x00000010L
+/*
+ * Send the current time in the Random fields of the ClientHello and
+ * ServerHello records for compatibility with hypothetical implementations
+ * that require it.
+ */
+# define SSL_MODE_SEND_CLIENTHELLO_TIME 0x00000020L
+# define SSL_MODE_SEND_SERVERHELLO_TIME 0x00000040L
+/*
+ * Send TLS_FALLBACK_SCSV in the ClientHello. To be set only by applications
+ * that reconnect with a downgraded protocol version; see
+ * draft-ietf-tls-downgrade-scsv-00 for details. DO NOT ENABLE THIS if your
+ * application attempts a normal handshake. Only use this in explicit
+ * fallback retries, following the guidance in
+ * draft-ietf-tls-downgrade-scsv-00.
+ */
+# define SSL_MODE_SEND_FALLBACK_SCSV 0x00000080L
+
+/* Cert related flags */
+/*
+ * Many implementations ignore some aspects of the TLS standards such as
+ * enforcing certifcate chain algorithms. When this is set we enforce them.
+ */
+# define SSL_CERT_FLAG_TLS_STRICT 0x00000001L
+
+/* Suite B modes, takes same values as certificate verify flags */
+# define SSL_CERT_FLAG_SUITEB_128_LOS_ONLY 0x10000
+/* Suite B 192 bit only mode */
+# define SSL_CERT_FLAG_SUITEB_192_LOS 0x20000
+/* Suite B 128 bit mode allowing 192 bit algorithms */
+# define SSL_CERT_FLAG_SUITEB_128_LOS 0x30000
+
+/* Perform all sorts of protocol violations for testing purposes */
+# define SSL_CERT_FLAG_BROKEN_PROTOCOL 0x10000000
+
+/* Flags for building certificate chains */
+/* Treat any existing certificates as untrusted CAs */
+# define SSL_BUILD_CHAIN_FLAG_UNTRUSTED 0x1
+/* Don't include root CA in chain */
+# define SSL_BUILD_CHAIN_FLAG_NO_ROOT 0x2
+/* Just check certificates already there */
+# define SSL_BUILD_CHAIN_FLAG_CHECK 0x4
+/* Ignore verification errors */
+# define SSL_BUILD_CHAIN_FLAG_IGNORE_ERROR 0x8
+/* Clear verification errors from queue */
+# define SSL_BUILD_CHAIN_FLAG_CLEAR_ERROR 0x10
+
+/* Flags returned by SSL_check_chain */
+/* Certificate can be used with this session */
+# define CERT_PKEY_VALID 0x1
+/* Certificate can also be used for signing */
+# define CERT_PKEY_SIGN 0x2
+/* EE certificate signing algorithm OK */
+# define CERT_PKEY_EE_SIGNATURE 0x10
+/* CA signature algorithms OK */
+# define CERT_PKEY_CA_SIGNATURE 0x20
+/* EE certificate parameters OK */
+# define CERT_PKEY_EE_PARAM 0x40
+/* CA certificate parameters OK */
+# define CERT_PKEY_CA_PARAM 0x80
+/* Signing explicitly allowed as opposed to SHA1 fallback */
+# define CERT_PKEY_EXPLICIT_SIGN 0x100
+/* Client CA issuer names match (always set for server cert) */
+# define CERT_PKEY_ISSUER_NAME 0x200
+/* Cert type matches client types (always set for server cert) */
+# define CERT_PKEY_CERT_TYPE 0x400
+/* Cert chain suitable to Suite B */
+# define CERT_PKEY_SUITEB 0x800
+
+# define SSL_CONF_FLAG_CMDLINE 0x1
+# define SSL_CONF_FLAG_FILE 0x2
+# define SSL_CONF_FLAG_CLIENT 0x4
+# define SSL_CONF_FLAG_SERVER 0x8
+# define SSL_CONF_FLAG_SHOW_ERRORS 0x10
+# define SSL_CONF_FLAG_CERTIFICATE 0x20
+/* Configuration value types */
+# define SSL_CONF_TYPE_UNKNOWN 0x0
+# define SSL_CONF_TYPE_STRING 0x1
+# define SSL_CONF_TYPE_FILE 0x2
+# define SSL_CONF_TYPE_DIR 0x3
+
+/*
+ * Note: SSL[_CTX]_set_{options,mode} use |= op on the previous value, they
+ * cannot be used to clear bits.
+ */
+
+# define SSL_CTX_set_options(ctx,op) \
+ SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,(op),NULL)
+# define SSL_CTX_clear_options(ctx,op) \
+ SSL_CTX_ctrl((ctx),SSL_CTRL_CLEAR_OPTIONS,(op),NULL)
+# define SSL_CTX_get_options(ctx) \
+ SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,0,NULL)
+# define SSL_set_options(ssl,op) \
+ SSL_ctrl((ssl),SSL_CTRL_OPTIONS,(op),NULL)
+# define SSL_clear_options(ssl,op) \
+ SSL_ctrl((ssl),SSL_CTRL_CLEAR_OPTIONS,(op),NULL)
+# define SSL_get_options(ssl) \
+ SSL_ctrl((ssl),SSL_CTRL_OPTIONS,0,NULL)
+
+# define SSL_CTX_set_mode(ctx,op) \
+ SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,(op),NULL)
+# define SSL_CTX_clear_mode(ctx,op) \
+ SSL_CTX_ctrl((ctx),SSL_CTRL_CLEAR_MODE,(op),NULL)
+# define SSL_CTX_get_mode(ctx) \
+ SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,0,NULL)
+# define SSL_clear_mode(ssl,op) \
+ SSL_ctrl((ssl),SSL_CTRL_CLEAR_MODE,(op),NULL)
+# define SSL_set_mode(ssl,op) \
+ SSL_ctrl((ssl),SSL_CTRL_MODE,(op),NULL)
+# define SSL_get_mode(ssl) \
+ SSL_ctrl((ssl),SSL_CTRL_MODE,0,NULL)
+# define SSL_set_mtu(ssl, mtu) \
+ SSL_ctrl((ssl),SSL_CTRL_SET_MTU,(mtu),NULL)
+# define DTLS_set_link_mtu(ssl, mtu) \
+ SSL_ctrl((ssl),DTLS_CTRL_SET_LINK_MTU,(mtu),NULL)
+# define DTLS_get_link_min_mtu(ssl) \
+ SSL_ctrl((ssl),DTLS_CTRL_GET_LINK_MIN_MTU,0,NULL)
+
+# define SSL_get_secure_renegotiation_support(ssl) \
+ SSL_ctrl((ssl), SSL_CTRL_GET_RI_SUPPORT, 0, NULL)
+
+# ifndef OPENSSL_NO_HEARTBEATS
+# define SSL_heartbeat(ssl) \
+ SSL_ctrl((ssl),SSL_CTRL_TLS_EXT_SEND_HEARTBEAT,0,NULL)
+# endif
+
+# define SSL_CTX_set_cert_flags(ctx,op) \
+ SSL_CTX_ctrl((ctx),SSL_CTRL_CERT_FLAGS,(op),NULL)
+# define SSL_set_cert_flags(s,op) \
+ SSL_ctrl((s),SSL_CTRL_CERT_FLAGS,(op),NULL)
+# define SSL_CTX_clear_cert_flags(ctx,op) \
+ SSL_CTX_ctrl((ctx),SSL_CTRL_CLEAR_CERT_FLAGS,(op),NULL)
+# define SSL_clear_cert_flags(s,op) \
+ SSL_ctrl((s),SSL_CTRL_CLEAR_CERT_FLAGS,(op),NULL)
+
+void SSL_CTX_set_msg_callback(SSL_CTX *ctx,
+ void (*cb) (int write_p, int version,
+ int content_type, const void *buf,
+ size_t len, SSL *ssl, void *arg));
+void SSL_set_msg_callback(SSL *ssl,
+ void (*cb) (int write_p, int version,
+ int content_type, const void *buf,
+ size_t len, SSL *ssl, void *arg));
+# define SSL_CTX_set_msg_callback_arg(ctx, arg) SSL_CTX_ctrl((ctx), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg))
+# define SSL_set_msg_callback_arg(ssl, arg) SSL_ctrl((ssl), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg))
+
+# ifndef OPENSSL_NO_SRP
+
+# ifndef OPENSSL_NO_SSL_INTERN
+
+typedef struct srp_ctx_st {
+ /* param for all the callbacks */
+ void *SRP_cb_arg;
+ /* set client Hello login callback */
+ int (*TLS_ext_srp_username_callback) (SSL *, int *, void *);
+ /* set SRP N/g param callback for verification */
+ int (*SRP_verify_param_callback) (SSL *, void *);
+ /* set SRP client passwd callback */
+ char *(*SRP_give_srp_client_pwd_callback) (SSL *, void *);
+ char *login;
+ BIGNUM *N, *g, *s, *B, *A;
+ BIGNUM *a, *b, *v;
+ char *info;
+ int strength;
+ unsigned long srp_Mask;
+} SRP_CTX;
+
+# endif
+
+/* see tls_srp.c */
+int SSL_SRP_CTX_init(SSL *s);
+int SSL_CTX_SRP_CTX_init(SSL_CTX *ctx);
+int SSL_SRP_CTX_free(SSL *ctx);
+int SSL_CTX_SRP_CTX_free(SSL_CTX *ctx);
+int SSL_srp_server_param_with_username(SSL *s, int *ad);
+int SRP_generate_server_master_secret(SSL *s, unsigned char *master_key);
+int SRP_Calc_A_param(SSL *s);
+int SRP_generate_client_master_secret(SSL *s, unsigned char *master_key);
+
+# endif
+
+# if defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_WIN32)
+# define SSL_MAX_CERT_LIST_DEFAULT 1024*30
+ /* 30k max cert list :-) */
+# else
+# define SSL_MAX_CERT_LIST_DEFAULT 1024*100
+ /* 100k max cert list :-) */
+# endif
+
+# define SSL_SESSION_CACHE_MAX_SIZE_DEFAULT (1024*20)
+
+/*
+ * This callback type is used inside SSL_CTX, SSL, and in the functions that
+ * set them. It is used to override the generation of SSL/TLS session IDs in
+ * a server. Return value should be zero on an error, non-zero to proceed.
+ * Also, callbacks should themselves check if the id they generate is unique
+ * otherwise the SSL handshake will fail with an error - callbacks can do
+ * this using the 'ssl' value they're passed by;
+ * SSL_has_matching_session_id(ssl, id, *id_len) The length value passed in
+ * is set at the maximum size the session ID can be. In SSLv2 this is 16
+ * bytes, whereas SSLv3/TLSv1 it is 32 bytes. The callback can alter this
+ * length to be less if desired, but under SSLv2 session IDs are supposed to
+ * be fixed at 16 bytes so the id will be padded after the callback returns
+ * in this case. It is also an error for the callback to set the size to
+ * zero.
+ */
+typedef int (*GEN_SESSION_CB) (const SSL *ssl, unsigned char *id,
+ unsigned int *id_len);
+
+typedef struct ssl_comp_st SSL_COMP;
+
+# ifndef OPENSSL_NO_SSL_INTERN
+
+struct ssl_comp_st {
+ int id;
+ const char *name;
+# ifndef OPENSSL_NO_COMP
+ COMP_METHOD *method;
+# else
+ char *method;
+# endif
+};
+
+DECLARE_STACK_OF(SSL_COMP)
+DECLARE_LHASH_OF(SSL_SESSION);
+
+struct ssl_ctx_st {
+ const SSL_METHOD *method;
+ STACK_OF(SSL_CIPHER) *cipher_list;
+ /* same as above but sorted for lookup */
+ STACK_OF(SSL_CIPHER) *cipher_list_by_id;
+ struct x509_store_st /* X509_STORE */ *cert_store;
+ LHASH_OF(SSL_SESSION) *sessions;
+ /*
+ * Most session-ids that will be cached, default is
+ * SSL_SESSION_CACHE_MAX_SIZE_DEFAULT. 0 is unlimited.
+ */
+ unsigned long session_cache_size;
+ struct ssl_session_st *session_cache_head;
+ struct ssl_session_st *session_cache_tail;
+ /*
+ * This can have one of 2 values, ored together, SSL_SESS_CACHE_CLIENT,
+ * SSL_SESS_CACHE_SERVER, Default is SSL_SESSION_CACHE_SERVER, which
+ * means only SSL_accept which cache SSL_SESSIONS.
+ */
+ int session_cache_mode;
+ /*
+ * If timeout is not 0, it is the default timeout value set when
+ * SSL_new() is called. This has been put in to make life easier to set
+ * things up
+ */
+ long session_timeout;
+ /*
+ * If this callback is not null, it will be called each time a session id
+ * is added to the cache. If this function returns 1, it means that the
+ * callback will do a SSL_SESSION_free() when it has finished using it.
+ * Otherwise, on 0, it means the callback has finished with it. If
+ * remove_session_cb is not null, it will be called when a session-id is
+ * removed from the cache. After the call, OpenSSL will
+ * SSL_SESSION_free() it.
+ */
+ int (*new_session_cb) (struct ssl_st *ssl, SSL_SESSION *sess);
+ void (*remove_session_cb) (struct ssl_ctx_st *ctx, SSL_SESSION *sess);
+ SSL_SESSION *(*get_session_cb) (struct ssl_st *ssl,
+ unsigned char *data, int len, int *copy);
+ struct {
+ int sess_connect; /* SSL new conn - started */
+ int sess_connect_renegotiate; /* SSL reneg - requested */
+ int sess_connect_good; /* SSL new conne/reneg - finished */
+ int sess_accept; /* SSL new accept - started */
+ int sess_accept_renegotiate; /* SSL reneg - requested */
+ int sess_accept_good; /* SSL accept/reneg - finished */
+ int sess_miss; /* session lookup misses */
+ int sess_timeout; /* reuse attempt on timeouted session */
+ int sess_cache_full; /* session removed due to full cache */
+ int sess_hit; /* session reuse actually done */
+ int sess_cb_hit; /* session-id that was not in the cache was
+ * passed back via the callback. This
+ * indicates that the application is
+ * supplying session-id's from other
+ * processes - spooky :-) */
+ } stats;
+
+ int references;
+
+ /* if defined, these override the X509_verify_cert() calls */
+ int (*app_verify_callback) (X509_STORE_CTX *, void *);
+ void *app_verify_arg;
+ /*
+ * before OpenSSL 0.9.7, 'app_verify_arg' was ignored
+ * ('app_verify_callback' was called with just one argument)
+ */
+
+ /* Default password callback. */
+ pem_password_cb *default_passwd_callback;
+
+ /* Default password callback user data. */
+ void *default_passwd_callback_userdata;
+
+ /* get client cert callback */
+ int (*client_cert_cb) (SSL *ssl, X509 **x509, EVP_PKEY **pkey);
+
+ /* cookie generate callback */
+ int (*app_gen_cookie_cb) (SSL *ssl, unsigned char *cookie,
+ unsigned int *cookie_len);
+
+ /* verify cookie callback */
+ int (*app_verify_cookie_cb) (SSL *ssl, unsigned char *cookie,
+ unsigned int cookie_len);
+
+ CRYPTO_EX_DATA ex_data;
+
+ const EVP_MD *rsa_md5; /* For SSLv2 - name is 'ssl2-md5' */
+ const EVP_MD *md5; /* For SSLv3/TLSv1 'ssl3-md5' */
+ const EVP_MD *sha1; /* For SSLv3/TLSv1 'ssl3->sha1' */
+
+ STACK_OF(X509) *extra_certs;
+ STACK_OF(SSL_COMP) *comp_methods; /* stack of SSL_COMP, SSLv3/TLSv1 */
+
+ /* Default values used when no per-SSL value is defined follow */
+
+ /* used if SSL's info_callback is NULL */
+ void (*info_callback) (const SSL *ssl, int type, int val);
+
+ /* what we put in client cert requests */
+ STACK_OF(X509_NAME) *client_CA;
+
+ /*
+ * Default values to use in SSL structures follow (these are copied by
+ * SSL_new)
+ */
+
+ unsigned long options;
+ unsigned long mode;
+ long max_cert_list;
+
+ struct cert_st /* CERT */ *cert;
+ int read_ahead;
+
+ /* callback that allows applications to peek at protocol messages */
+ void (*msg_callback) (int write_p, int version, int content_type,
+ const void *buf, size_t len, SSL *ssl, void *arg);
+ void *msg_callback_arg;
+
+ int verify_mode;
+ unsigned int sid_ctx_length;
+ unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];
+ /* called 'verify_callback' in the SSL */
+ int (*default_verify_callback) (int ok, X509_STORE_CTX *ctx);
+
+ /* Default generate session ID callback. */
+ GEN_SESSION_CB generate_session_id;
+
+ X509_VERIFY_PARAM *param;
+
+# if 0
+ int purpose; /* Purpose setting */
+ int trust; /* Trust setting */
+# endif
+
+ int quiet_shutdown;
+
+ /*
+ * Maximum amount of data to send in one fragment. actual record size can
+ * be more than this due to padding and MAC overheads.
+ */
+ unsigned int max_send_fragment;
+
+# ifndef OPENSSL_NO_ENGINE
+ /*
+ * Engine to pass requests for client certs to
+ */
+ ENGINE *client_cert_engine;
+# endif
+
+# ifndef OPENSSL_NO_TLSEXT
+ /* TLS extensions servername callback */
+ int (*tlsext_servername_callback) (SSL *, int *, void *);
+ void *tlsext_servername_arg;
+ /* RFC 4507 session ticket keys */
+ unsigned char tlsext_tick_key_name[16];
+ unsigned char tlsext_tick_hmac_key[16];
+ unsigned char tlsext_tick_aes_key[16];
+ /* Callback to support customisation of ticket key setting */
+ int (*tlsext_ticket_key_cb) (SSL *ssl,
+ unsigned char *name, unsigned char *iv,
+ EVP_CIPHER_CTX *ectx,
+ HMAC_CTX *hctx, int enc);
+
+ /* certificate status request info */
+ /* Callback for status request */
+ int (*tlsext_status_cb) (SSL *ssl, void *arg);
+ void *tlsext_status_arg;
+
+ /* draft-rescorla-tls-opaque-prf-input-00.txt information */
+ int (*tlsext_opaque_prf_input_callback) (SSL *, void *peerinput,
+ size_t len, void *arg);
+ void *tlsext_opaque_prf_input_callback_arg;
+# endif
+
+# ifndef OPENSSL_NO_PSK
+ char *psk_identity_hint;
+ unsigned int (*psk_client_callback) (SSL *ssl, const char *hint,
+ char *identity,
+ unsigned int max_identity_len,
+ unsigned char *psk,
+ unsigned int max_psk_len);
+ unsigned int (*psk_server_callback) (SSL *ssl, const char *identity,
+ unsigned char *psk,
+ unsigned int max_psk_len);
+# endif
+
+# ifndef OPENSSL_NO_BUF_FREELISTS
+# define SSL_MAX_BUF_FREELIST_LEN_DEFAULT 32
+ unsigned int freelist_max_len;
+ struct ssl3_buf_freelist_st *wbuf_freelist;
+ struct ssl3_buf_freelist_st *rbuf_freelist;
+# endif
+# ifndef OPENSSL_NO_SRP
+ SRP_CTX srp_ctx; /* ctx for SRP authentication */
+# endif
+
+# ifndef OPENSSL_NO_TLSEXT
+
+# ifndef OPENSSL_NO_NEXTPROTONEG
+ /* Next protocol negotiation information */
+ /* (for experimental NPN extension). */
+
+ /*
+ * For a server, this contains a callback function by which the set of
+ * advertised protocols can be provided.
+ */
+ int (*next_protos_advertised_cb) (SSL *s, const unsigned char **buf,
+ unsigned int *len, void *arg);
+ void *next_protos_advertised_cb_arg;
+ /*
+ * For a client, this contains a callback function that selects the next
+ * protocol from the list provided by the server.
+ */
+ int (*next_proto_select_cb) (SSL *s, unsigned char **out,
+ unsigned char *outlen,
+ const unsigned char *in,
+ unsigned int inlen, void *arg);
+ void *next_proto_select_cb_arg;
+# endif
+ /* SRTP profiles we are willing to do from RFC 5764 */
+ STACK_OF(SRTP_PROTECTION_PROFILE) *srtp_profiles;
+
+ /*
+ * ALPN information (we are in the process of transitioning from NPN to
+ * ALPN.)
+ */
+
+ /*-
+ * For a server, this contains a callback function that allows the
+ * server to select the protocol for the connection.
+ * out: on successful return, this must point to the raw protocol
+ * name (without the length prefix).
+ * outlen: on successful return, this contains the length of |*out|.
+ * in: points to the client's list of supported protocols in
+ * wire-format.
+ * inlen: the length of |in|.
+ */
+ int (*alpn_select_cb) (SSL *s,
+ const unsigned char **out,
+ unsigned char *outlen,
+ const unsigned char *in,
+ unsigned int inlen, void *arg);
+ void *alpn_select_cb_arg;
+
+ /*
+ * For a client, this contains the list of supported protocols in wire
+ * format.
+ */
+ unsigned char *alpn_client_proto_list;
+ unsigned alpn_client_proto_list_len;
+
+# ifndef OPENSSL_NO_EC
+ /* EC extension values inherited by SSL structure */
+ size_t tlsext_ecpointformatlist_length;
+ unsigned char *tlsext_ecpointformatlist;
+ size_t tlsext_ellipticcurvelist_length;
+ unsigned char *tlsext_ellipticcurvelist;
+# endif /* OPENSSL_NO_EC */
+# endif
+};
+
+# endif
+
+# define SSL_SESS_CACHE_OFF 0x0000
+# define SSL_SESS_CACHE_CLIENT 0x0001
+# define SSL_SESS_CACHE_SERVER 0x0002
+# define SSL_SESS_CACHE_BOTH (SSL_SESS_CACHE_CLIENT|SSL_SESS_CACHE_SERVER)
+# define SSL_SESS_CACHE_NO_AUTO_CLEAR 0x0080
+/* enough comments already ... see SSL_CTX_set_session_cache_mode(3) */
+# define SSL_SESS_CACHE_NO_INTERNAL_LOOKUP 0x0100
+# define SSL_SESS_CACHE_NO_INTERNAL_STORE 0x0200
+# define SSL_SESS_CACHE_NO_INTERNAL \
+ (SSL_SESS_CACHE_NO_INTERNAL_LOOKUP|SSL_SESS_CACHE_NO_INTERNAL_STORE)
+
+LHASH_OF(SSL_SESSION) *SSL_CTX_sessions(SSL_CTX *ctx);
+# define SSL_CTX_sess_number(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_NUMBER,0,NULL)
+# define SSL_CTX_sess_connect(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT,0,NULL)
+# define SSL_CTX_sess_connect_good(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_GOOD,0,NULL)
+# define SSL_CTX_sess_connect_renegotiate(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_RENEGOTIATE,0,NULL)
+# define SSL_CTX_sess_accept(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT,0,NULL)
+# define SSL_CTX_sess_accept_renegotiate(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_RENEGOTIATE,0,NULL)
+# define SSL_CTX_sess_accept_good(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_GOOD,0,NULL)
+# define SSL_CTX_sess_hits(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_HIT,0,NULL)
+# define SSL_CTX_sess_cb_hits(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CB_HIT,0,NULL)
+# define SSL_CTX_sess_misses(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_MISSES,0,NULL)
+# define SSL_CTX_sess_timeouts(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_TIMEOUTS,0,NULL)
+# define SSL_CTX_sess_cache_full(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CACHE_FULL,0,NULL)
+
+void SSL_CTX_sess_set_new_cb(SSL_CTX *ctx,
+ int (*new_session_cb) (struct ssl_st *ssl,
+ SSL_SESSION *sess));
+int (*SSL_CTX_sess_get_new_cb(SSL_CTX *ctx)) (struct ssl_st *ssl,
+ SSL_SESSION *sess);
+void SSL_CTX_sess_set_remove_cb(SSL_CTX *ctx,
+ void (*remove_session_cb) (struct ssl_ctx_st
+ *ctx,
+ SSL_SESSION
+ *sess));
+void (*SSL_CTX_sess_get_remove_cb(SSL_CTX *ctx)) (struct ssl_ctx_st *ctx,
+ SSL_SESSION *sess);
+void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx,
+ SSL_SESSION *(*get_session_cb) (struct ssl_st
+ *ssl,
+ unsigned char
+ *data, int len,
+ int *copy));
+SSL_SESSION *(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx)) (struct ssl_st *ssl,
+ unsigned char *Data,
+ int len, int *copy);
+void SSL_CTX_set_info_callback(SSL_CTX *ctx,
+ void (*cb) (const SSL *ssl, int type,
+ int val));
+void (*SSL_CTX_get_info_callback(SSL_CTX *ctx)) (const SSL *ssl, int type,
+ int val);
+void SSL_CTX_set_client_cert_cb(SSL_CTX *ctx,
+ int (*client_cert_cb) (SSL *ssl, X509 **x509,
+ EVP_PKEY **pkey));
+int (*SSL_CTX_get_client_cert_cb(SSL_CTX *ctx)) (SSL *ssl, X509 **x509,
+ EVP_PKEY **pkey);
+# ifndef OPENSSL_NO_ENGINE
+int SSL_CTX_set_client_cert_engine(SSL_CTX *ctx, ENGINE *e);
+# endif
+void SSL_CTX_set_cookie_generate_cb(SSL_CTX *ctx,
+ int (*app_gen_cookie_cb) (SSL *ssl,
+ unsigned char
+ *cookie,
+ unsigned int
+ *cookie_len));
+void SSL_CTX_set_cookie_verify_cb(SSL_CTX *ctx,
+ int (*app_verify_cookie_cb) (SSL *ssl,
+ unsigned char
+ *cookie,
+ unsigned int
+ cookie_len));
+# ifndef OPENSSL_NO_NEXTPROTONEG
+void SSL_CTX_set_next_protos_advertised_cb(SSL_CTX *s,
+ int (*cb) (SSL *ssl,
+ const unsigned char
+ **out,
+ unsigned int *outlen,
+ void *arg), void *arg);
+void SSL_CTX_set_next_proto_select_cb(SSL_CTX *s,
+ int (*cb) (SSL *ssl,
+ unsigned char **out,
+ unsigned char *outlen,
+ const unsigned char *in,
+ unsigned int inlen,
+ void *arg), void *arg);
+void SSL_get0_next_proto_negotiated(const SSL *s, const unsigned char **data,
+ unsigned *len);
+# endif
+
+# ifndef OPENSSL_NO_TLSEXT
+int SSL_select_next_proto(unsigned char **out, unsigned char *outlen,
+ const unsigned char *in, unsigned int inlen,
+ const unsigned char *client,
+ unsigned int client_len);
+# endif
+
+# define OPENSSL_NPN_UNSUPPORTED 0
+# define OPENSSL_NPN_NEGOTIATED 1
+# define OPENSSL_NPN_NO_OVERLAP 2
+
+int SSL_CTX_set_alpn_protos(SSL_CTX *ctx, const unsigned char *protos,
+ unsigned protos_len);
+int SSL_set_alpn_protos(SSL *ssl, const unsigned char *protos,
+ unsigned protos_len);
+void SSL_CTX_set_alpn_select_cb(SSL_CTX *ctx,
+ int (*cb) (SSL *ssl,
+ const unsigned char **out,
+ unsigned char *outlen,
+ const unsigned char *in,
+ unsigned int inlen,
+ void *arg), void *arg);
+void SSL_get0_alpn_selected(const SSL *ssl, const unsigned char **data,
+ unsigned *len);
+
+# ifndef OPENSSL_NO_PSK
+/*
+ * the maximum length of the buffer given to callbacks containing the
+ * resulting identity/psk
+ */
+# define PSK_MAX_IDENTITY_LEN 128
+# define PSK_MAX_PSK_LEN 256
+void SSL_CTX_set_psk_client_callback(SSL_CTX *ctx,
+ unsigned int (*psk_client_callback) (SSL
+ *ssl,
+ const
+ char
+ *hint,
+ char
+ *identity,
+ unsigned
+ int
+ max_identity_len,
+ unsigned
+ char
+ *psk,
+ unsigned
+ int
+ max_psk_len));
+void SSL_set_psk_client_callback(SSL *ssl,
+ unsigned int (*psk_client_callback) (SSL
+ *ssl,
+ const
+ char
+ *hint,
+ char
+ *identity,
+ unsigned
+ int
+ max_identity_len,
+ unsigned
+ char
+ *psk,
+ unsigned
+ int
+ max_psk_len));
+void SSL_CTX_set_psk_server_callback(SSL_CTX *ctx,
+ unsigned int (*psk_server_callback) (SSL
+ *ssl,
+ const
+ char
+ *identity,
+ unsigned
+ char
+ *psk,
+ unsigned
+ int
+ max_psk_len));
+void SSL_set_psk_server_callback(SSL *ssl,
+ unsigned int (*psk_server_callback) (SSL
+ *ssl,
+ const
+ char
+ *identity,
+ unsigned
+ char
+ *psk,
+ unsigned
+ int
+ max_psk_len));
+int SSL_CTX_use_psk_identity_hint(SSL_CTX *ctx, const char *identity_hint);
+int SSL_use_psk_identity_hint(SSL *s, const char *identity_hint);
+const char *SSL_get_psk_identity_hint(const SSL *s);
+const char *SSL_get_psk_identity(const SSL *s);
+# endif
+
+# ifndef OPENSSL_NO_TLSEXT
+/* Register callbacks to handle custom TLS Extensions for client or server. */
+
+int SSL_CTX_add_client_custom_ext(SSL_CTX *ctx, unsigned int ext_type,
+ custom_ext_add_cb add_cb,
+ custom_ext_free_cb free_cb,
+ void *add_arg,
+ custom_ext_parse_cb parse_cb,
+ void *parse_arg);
+
+int SSL_CTX_add_server_custom_ext(SSL_CTX *ctx, unsigned int ext_type,
+ custom_ext_add_cb add_cb,
+ custom_ext_free_cb free_cb,
+ void *add_arg,
+ custom_ext_parse_cb parse_cb,
+ void *parse_arg);
+
+int SSL_extension_supported(unsigned int ext_type);
+
+# endif
+
+# define SSL_NOTHING 1
+# define SSL_WRITING 2
+# define SSL_READING 3
+# define SSL_X509_LOOKUP 4
+
+/* These will only be used when doing non-blocking IO */
+# define SSL_want_nothing(s) (SSL_want(s) == SSL_NOTHING)
+# define SSL_want_read(s) (SSL_want(s) == SSL_READING)
+# define SSL_want_write(s) (SSL_want(s) == SSL_WRITING)
+# define SSL_want_x509_lookup(s) (SSL_want(s) == SSL_X509_LOOKUP)
+
+# define SSL_MAC_FLAG_READ_MAC_STREAM 1
+# define SSL_MAC_FLAG_WRITE_MAC_STREAM 2
+
+# ifndef OPENSSL_NO_SSL_INTERN
+
+struct ssl_st {
+ /*
+ * protocol version (one of SSL2_VERSION, SSL3_VERSION, TLS1_VERSION,
+ * DTLS1_VERSION)
+ */
+ int version;
+ /* SSL_ST_CONNECT or SSL_ST_ACCEPT */
+ int type;
+ /* SSLv3 */
+ const SSL_METHOD *method;
+ /*
+ * There are 2 BIO's even though they are normally both the same. This
+ * is so data can be read and written to different handlers
+ */
+# ifndef OPENSSL_NO_BIO
+ /* used by SSL_read */
+ BIO *rbio;
+ /* used by SSL_write */
+ BIO *wbio;
+ /* used during session-id reuse to concatenate messages */
+ BIO *bbio;
+# else
+ /* used by SSL_read */
+ char *rbio;
+ /* used by SSL_write */
+ char *wbio;
+ char *bbio;
+# endif
+ /*
+ * This holds a variable that indicates what we were doing when a 0 or -1
+ * is returned. This is needed for non-blocking IO so we know what
+ * request needs re-doing when in SSL_accept or SSL_connect
+ */
+ int rwstate;
+ /* true when we are actually in SSL_accept() or SSL_connect() */
+ int in_handshake;
+ int (*handshake_func) (SSL *);
+ /*
+ * Imagine that here's a boolean member "init" that is switched as soon
+ * as SSL_set_{accept/connect}_state is called for the first time, so
+ * that "state" and "handshake_func" are properly initialized. But as
+ * handshake_func is == 0 until then, we use this test instead of an
+ * "init" member.
+ */
+ /* are we the server side? - mostly used by SSL_clear */
+ int server;
+ /*
+ * Generate a new session or reuse an old one.
+ * NB: For servers, the 'new' session may actually be a previously
+ * cached session or even the previous session unless
+ * SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION is set
+ */
+ int new_session;
+ /* don't send shutdown packets */
+ int quiet_shutdown;
+ /* we have shut things down, 0x01 sent, 0x02 for received */
+ int shutdown;
+ /* where we are */
+ int state;
+ /* where we are when reading */
+ int rstate;
+ BUF_MEM *init_buf; /* buffer used during init */
+ void *init_msg; /* pointer to handshake message body, set by
+ * ssl3_get_message() */
+ int init_num; /* amount read/written */
+ int init_off; /* amount read/written */
+ /* used internally to point at a raw packet */
+ unsigned char *packet;
+ unsigned int packet_length;
+ struct ssl2_state_st *s2; /* SSLv2 variables */
+ struct ssl3_state_st *s3; /* SSLv3 variables */
+ struct dtls1_state_st *d1; /* DTLSv1 variables */
+ int read_ahead; /* Read as many input bytes as possible (for
+ * non-blocking reads) */
+ /* callback that allows applications to peek at protocol messages */
+ void (*msg_callback) (int write_p, int version, int content_type,
+ const void *buf, size_t len, SSL *ssl, void *arg);
+ void *msg_callback_arg;
+ int hit; /* reusing a previous session */
+ X509_VERIFY_PARAM *param;
+# if 0
+ int purpose; /* Purpose setting */
+ int trust; /* Trust setting */
+# endif
+ /* crypto */
+ STACK_OF(SSL_CIPHER) *cipher_list;
+ STACK_OF(SSL_CIPHER) *cipher_list_by_id;
+ /*
+ * These are the ones being used, the ones in SSL_SESSION are the ones to
+ * be 'copied' into these ones
+ */
+ int mac_flags;
+ EVP_CIPHER_CTX *enc_read_ctx; /* cryptographic state */
+ EVP_MD_CTX *read_hash; /* used for mac generation */
+# ifndef OPENSSL_NO_COMP
+ COMP_CTX *expand; /* uncompress */
+# else
+ char *expand;
+# endif
+ EVP_CIPHER_CTX *enc_write_ctx; /* cryptographic state */
+ EVP_MD_CTX *write_hash; /* used for mac generation */
+# ifndef OPENSSL_NO_COMP
+ COMP_CTX *compress; /* compression */
+# else
+ char *compress;
+# endif
+ /* session info */
+ /* client cert? */
+ /* This is used to hold the server certificate used */
+ struct cert_st /* CERT */ *cert;
+ /*
+ * the session_id_context is used to ensure sessions are only reused in
+ * the appropriate context
+ */
+ unsigned int sid_ctx_length;
+ unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];
+ /* This can also be in the session once a session is established */
+ SSL_SESSION *session;
+ /* Default generate session ID callback. */
+ GEN_SESSION_CB generate_session_id;
+ /* Used in SSL2 and SSL3 */
+ /*
+ * 0 don't care about verify failure.
+ * 1 fail if verify fails
+ */
+ int verify_mode;
+ /* fail if callback returns 0 */
+ int (*verify_callback) (int ok, X509_STORE_CTX *ctx);
+ /* optional informational callback */
+ void (*info_callback) (const SSL *ssl, int type, int val);
+ /* error bytes to be written */
+ int error;
+ /* actual code */
+ int error_code;
+# ifndef OPENSSL_NO_KRB5
+ /* Kerberos 5 context */
+ KSSL_CTX *kssl_ctx;
+# endif /* OPENSSL_NO_KRB5 */
+# ifndef OPENSSL_NO_PSK
+ unsigned int (*psk_client_callback) (SSL *ssl, const char *hint,
+ char *identity,
+ unsigned int max_identity_len,
+ unsigned char *psk,
+ unsigned int max_psk_len);
+ unsigned int (*psk_server_callback) (SSL *ssl, const char *identity,
+ unsigned char *psk,
+ unsigned int max_psk_len);
+# endif
+ SSL_CTX *ctx;
+ /*
+ * set this flag to 1 and a sleep(1) is put into all SSL_read() and
+ * SSL_write() calls, good for nbio debuging :-)
+ */
+ int debug;
+ /* extra application data */
+ long verify_result;
+ CRYPTO_EX_DATA ex_data;
+ /* for server side, keep the list of CA_dn we can use */
+ STACK_OF(X509_NAME) *client_CA;
+ int references;
+ /* protocol behaviour */
+ unsigned long options;
+ /* API behaviour */
+ unsigned long mode;
+ long max_cert_list;
+ int first_packet;
+ /* what was passed, used for SSLv3/TLS rollback check */
+ int client_version;
+ unsigned int max_send_fragment;
+# ifndef OPENSSL_NO_TLSEXT
+ /* TLS extension debug callback */
+ void (*tlsext_debug_cb) (SSL *s, int client_server, int type,
+ unsigned char *data, int len, void *arg);
+ void *tlsext_debug_arg;
+ char *tlsext_hostname;
+ /*-
+ * no further mod of servername
+ * 0 : call the servername extension callback.
+ * 1 : prepare 2, allow last ack just after in server callback.
+ * 2 : don't call servername callback, no ack in server hello
+ */
+ int servername_done;
+ /* certificate status request info */
+ /* Status type or -1 if no status type */
+ int tlsext_status_type;
+ /* Expect OCSP CertificateStatus message */
+ int tlsext_status_expected;
+ /* OCSP status request only */
+ STACK_OF(OCSP_RESPID) *tlsext_ocsp_ids;
+ X509_EXTENSIONS *tlsext_ocsp_exts;
+ /* OCSP response received or to be sent */
+ unsigned char *tlsext_ocsp_resp;
+ int tlsext_ocsp_resplen;
+ /* RFC4507 session ticket expected to be received or sent */
+ int tlsext_ticket_expected;
+# ifndef OPENSSL_NO_EC
+ size_t tlsext_ecpointformatlist_length;
+ /* our list */
+ unsigned char *tlsext_ecpointformatlist;
+ size_t tlsext_ellipticcurvelist_length;
+ /* our list */
+ unsigned char *tlsext_ellipticcurvelist;
+# endif /* OPENSSL_NO_EC */
+ /*
+ * draft-rescorla-tls-opaque-prf-input-00.txt information to be used for
+ * handshakes
+ */
+ void *tlsext_opaque_prf_input;
+ size_t tlsext_opaque_prf_input_len;
+ /* TLS Session Ticket extension override */
+ TLS_SESSION_TICKET_EXT *tlsext_session_ticket;
+ /* TLS Session Ticket extension callback */
+ tls_session_ticket_ext_cb_fn tls_session_ticket_ext_cb;
+ void *tls_session_ticket_ext_cb_arg;
+ /* TLS pre-shared secret session resumption */
+ tls_session_secret_cb_fn tls_session_secret_cb;
+ void *tls_session_secret_cb_arg;
+ SSL_CTX *initial_ctx; /* initial ctx, used to store sessions */
+# ifndef OPENSSL_NO_NEXTPROTONEG
+ /*
+ * Next protocol negotiation. For the client, this is the protocol that
+ * we sent in NextProtocol and is set when handling ServerHello
+ * extensions. For a server, this is the client's selected_protocol from
+ * NextProtocol and is set when handling the NextProtocol message, before
+ * the Finished message.
+ */
+ unsigned char *next_proto_negotiated;
+ unsigned char next_proto_negotiated_len;
+# endif
+# define session_ctx initial_ctx
+ /* What we'll do */
+ STACK_OF(SRTP_PROTECTION_PROFILE) *srtp_profiles;
+ /* What's been chosen */
+ SRTP_PROTECTION_PROFILE *srtp_profile;
+ /*-
+ * Is use of the Heartbeat extension negotiated?
+ * 0: disabled
+ * 1: enabled
+ * 2: enabled, but not allowed to send Requests
+ */
+ unsigned int tlsext_heartbeat;
+ /* Indicates if a HeartbeatRequest is in flight */
+ unsigned int tlsext_hb_pending;
+ /* HeartbeatRequest sequence number */
+ unsigned int tlsext_hb_seq;
+# else
+# define session_ctx ctx
+# endif /* OPENSSL_NO_TLSEXT */
+ /*-
+ * 1 if we are renegotiating.
+ * 2 if we are a server and are inside a handshake
+ * (i.e. not just sending a HelloRequest)
+ */
+ int renegotiate;
+# ifndef OPENSSL_NO_SRP
+ /* ctx for SRP authentication */
+ SRP_CTX srp_ctx;
+# endif
+# ifndef OPENSSL_NO_TLSEXT
+ /*
+ * For a client, this contains the list of supported protocols in wire
+ * format.
+ */
+ unsigned char *alpn_client_proto_list;
+ unsigned alpn_client_proto_list_len;
+# endif /* OPENSSL_NO_TLSEXT */
+};
+
+# endif
+
+#ifdef __cplusplus
+}
+#endif
+
+# include <openssl/ssl2.h>
+# include <openssl/ssl3.h>
+# include <openssl/tls1.h> /* This is mostly sslv3 with a few tweaks */
+# include <openssl/dtls1.h> /* Datagram TLS */
+# include <openssl/ssl23.h>
+# include <openssl/srtp.h> /* Support for the use_srtp extension */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* compatibility */
+# define SSL_set_app_data(s,arg) (SSL_set_ex_data(s,0,(char *)arg))
+# define SSL_get_app_data(s) (SSL_get_ex_data(s,0))
+# define SSL_SESSION_set_app_data(s,a) (SSL_SESSION_set_ex_data(s,0,(char *)a))
+# define SSL_SESSION_get_app_data(s) (SSL_SESSION_get_ex_data(s,0))
+# define SSL_CTX_get_app_data(ctx) (SSL_CTX_get_ex_data(ctx,0))
+# define SSL_CTX_set_app_data(ctx,arg) (SSL_CTX_set_ex_data(ctx,0,(char *)arg))
+
+/*
+ * The following are the possible values for ssl->state are are used to
+ * indicate where we are up to in the SSL connection establishment. The
+ * macros that follow are about the only things you should need to use and
+ * even then, only when using non-blocking IO. It can also be useful to work
+ * out where you were when the connection failed
+ */
+
+# define SSL_ST_CONNECT 0x1000
+# define SSL_ST_ACCEPT 0x2000
+# define SSL_ST_MASK 0x0FFF
+# define SSL_ST_INIT (SSL_ST_CONNECT|SSL_ST_ACCEPT)
+# define SSL_ST_BEFORE 0x4000
+# define SSL_ST_OK 0x03
+# define SSL_ST_RENEGOTIATE (0x04|SSL_ST_INIT)
+# define SSL_ST_ERR 0x05
+
+# define SSL_CB_LOOP 0x01
+# define SSL_CB_EXIT 0x02
+# define SSL_CB_READ 0x04
+# define SSL_CB_WRITE 0x08
+# define SSL_CB_ALERT 0x4000/* used in callback */
+# define SSL_CB_READ_ALERT (SSL_CB_ALERT|SSL_CB_READ)
+# define SSL_CB_WRITE_ALERT (SSL_CB_ALERT|SSL_CB_WRITE)
+# define SSL_CB_ACCEPT_LOOP (SSL_ST_ACCEPT|SSL_CB_LOOP)
+# define SSL_CB_ACCEPT_EXIT (SSL_ST_ACCEPT|SSL_CB_EXIT)
+# define SSL_CB_CONNECT_LOOP (SSL_ST_CONNECT|SSL_CB_LOOP)
+# define SSL_CB_CONNECT_EXIT (SSL_ST_CONNECT|SSL_CB_EXIT)
+# define SSL_CB_HANDSHAKE_START 0x10
+# define SSL_CB_HANDSHAKE_DONE 0x20
+
+/* Is the SSL_connection established? */
+# define SSL_get_state(a) SSL_state(a)
+# define SSL_is_init_finished(a) (SSL_state(a) == SSL_ST_OK)
+# define SSL_in_init(a) (SSL_state(a)&SSL_ST_INIT)
+# define SSL_in_before(a) (SSL_state(a)&SSL_ST_BEFORE)
+# define SSL_in_connect_init(a) (SSL_state(a)&SSL_ST_CONNECT)
+# define SSL_in_accept_init(a) (SSL_state(a)&SSL_ST_ACCEPT)
+
+/*
+ * The following 2 states are kept in ssl->rstate when reads fail, you should
+ * not need these
+ */
+# define SSL_ST_READ_HEADER 0xF0
+# define SSL_ST_READ_BODY 0xF1
+# define SSL_ST_READ_DONE 0xF2
+
+/*-
+ * Obtain latest Finished message
+ * -- that we sent (SSL_get_finished)
+ * -- that we expected from peer (SSL_get_peer_finished).
+ * Returns length (0 == no Finished so far), copies up to 'count' bytes.
+ */
+size_t SSL_get_finished(const SSL *s, void *buf, size_t count);
+size_t SSL_get_peer_finished(const SSL *s, void *buf, size_t count);
+
+/*
+ * use either SSL_VERIFY_NONE or SSL_VERIFY_PEER, the last 2 options are
+ * 'ored' with SSL_VERIFY_PEER if they are desired
+ */
+# define SSL_VERIFY_NONE 0x00
+# define SSL_VERIFY_PEER 0x01
+# define SSL_VERIFY_FAIL_IF_NO_PEER_CERT 0x02
+# define SSL_VERIFY_CLIENT_ONCE 0x04
+
+# define OpenSSL_add_ssl_algorithms() SSL_library_init()
+# define SSLeay_add_ssl_algorithms() SSL_library_init()
+
+/* this is for backward compatibility */
+# if 0 /* NEW_SSLEAY */
+# define SSL_CTX_set_default_verify(a,b,c) SSL_CTX_set_verify(a,b,c)
+# define SSL_set_pref_cipher(c,n) SSL_set_cipher_list(c,n)
+# define SSL_add_session(a,b) SSL_CTX_add_session((a),(b))
+# define SSL_remove_session(a,b) SSL_CTX_remove_session((a),(b))
+# define SSL_flush_sessions(a,b) SSL_CTX_flush_sessions((a),(b))
+# endif
+/* More backward compatibility */
+# define SSL_get_cipher(s) \
+ SSL_CIPHER_get_name(SSL_get_current_cipher(s))
+# define SSL_get_cipher_bits(s,np) \
+ SSL_CIPHER_get_bits(SSL_get_current_cipher(s),np)
+# define SSL_get_cipher_version(s) \
+ SSL_CIPHER_get_version(SSL_get_current_cipher(s))
+# define SSL_get_cipher_name(s) \
+ SSL_CIPHER_get_name(SSL_get_current_cipher(s))
+# define SSL_get_time(a) SSL_SESSION_get_time(a)
+# define SSL_set_time(a,b) SSL_SESSION_set_time((a),(b))
+# define SSL_get_timeout(a) SSL_SESSION_get_timeout(a)
+# define SSL_set_timeout(a,b) SSL_SESSION_set_timeout((a),(b))
+
+# define d2i_SSL_SESSION_bio(bp,s_id) ASN1_d2i_bio_of(SSL_SESSION,SSL_SESSION_new,d2i_SSL_SESSION,bp,s_id)
+# define i2d_SSL_SESSION_bio(bp,s_id) ASN1_i2d_bio_of(SSL_SESSION,i2d_SSL_SESSION,bp,s_id)
+
+DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION)
+# define SSL_AD_REASON_OFFSET 1000/* offset to get SSL_R_... value
+ * from SSL_AD_... */
+/* These alert types are for SSLv3 and TLSv1 */
+# define SSL_AD_CLOSE_NOTIFY SSL3_AD_CLOSE_NOTIFY
+/* fatal */
+# define SSL_AD_UNEXPECTED_MESSAGE SSL3_AD_UNEXPECTED_MESSAGE
+/* fatal */
+# define SSL_AD_BAD_RECORD_MAC SSL3_AD_BAD_RECORD_MAC
+# define SSL_AD_DECRYPTION_FAILED TLS1_AD_DECRYPTION_FAILED
+# define SSL_AD_RECORD_OVERFLOW TLS1_AD_RECORD_OVERFLOW
+/* fatal */
+# define SSL_AD_DECOMPRESSION_FAILURE SSL3_AD_DECOMPRESSION_FAILURE
+/* fatal */
+# define SSL_AD_HANDSHAKE_FAILURE SSL3_AD_HANDSHAKE_FAILURE
+/* Not for TLS */
+# define SSL_AD_NO_CERTIFICATE SSL3_AD_NO_CERTIFICATE
+# define SSL_AD_BAD_CERTIFICATE SSL3_AD_BAD_CERTIFICATE
+# define SSL_AD_UNSUPPORTED_CERTIFICATE SSL3_AD_UNSUPPORTED_CERTIFICATE
+# define SSL_AD_CERTIFICATE_REVOKED SSL3_AD_CERTIFICATE_REVOKED
+# define SSL_AD_CERTIFICATE_EXPIRED SSL3_AD_CERTIFICATE_EXPIRED
+# define SSL_AD_CERTIFICATE_UNKNOWN SSL3_AD_CERTIFICATE_UNKNOWN
+/* fatal */
+# define SSL_AD_ILLEGAL_PARAMETER SSL3_AD_ILLEGAL_PARAMETER
+/* fatal */
+# define SSL_AD_UNKNOWN_CA TLS1_AD_UNKNOWN_CA
+/* fatal */
+# define SSL_AD_ACCESS_DENIED TLS1_AD_ACCESS_DENIED
+/* fatal */
+# define SSL_AD_DECODE_ERROR TLS1_AD_DECODE_ERROR
+# define SSL_AD_DECRYPT_ERROR TLS1_AD_DECRYPT_ERROR
+/* fatal */
+# define SSL_AD_EXPORT_RESTRICTION TLS1_AD_EXPORT_RESTRICTION
+/* fatal */
+# define SSL_AD_PROTOCOL_VERSION TLS1_AD_PROTOCOL_VERSION
+/* fatal */
+# define SSL_AD_INSUFFICIENT_SECURITY TLS1_AD_INSUFFICIENT_SECURITY
+/* fatal */
+# define SSL_AD_INTERNAL_ERROR TLS1_AD_INTERNAL_ERROR
+# define SSL_AD_USER_CANCELLED TLS1_AD_USER_CANCELLED
+# define SSL_AD_NO_RENEGOTIATION TLS1_AD_NO_RENEGOTIATION
+# define SSL_AD_UNSUPPORTED_EXTENSION TLS1_AD_UNSUPPORTED_EXTENSION
+# define SSL_AD_CERTIFICATE_UNOBTAINABLE TLS1_AD_CERTIFICATE_UNOBTAINABLE
+# define SSL_AD_UNRECOGNIZED_NAME TLS1_AD_UNRECOGNIZED_NAME
+# define SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE
+# define SSL_AD_BAD_CERTIFICATE_HASH_VALUE TLS1_AD_BAD_CERTIFICATE_HASH_VALUE
+/* fatal */
+# define SSL_AD_UNKNOWN_PSK_IDENTITY TLS1_AD_UNKNOWN_PSK_IDENTITY
+/* fatal */
+# define SSL_AD_INAPPROPRIATE_FALLBACK TLS1_AD_INAPPROPRIATE_FALLBACK
+# define SSL_ERROR_NONE 0
+# define SSL_ERROR_SSL 1
+# define SSL_ERROR_WANT_READ 2
+# define SSL_ERROR_WANT_WRITE 3
+# define SSL_ERROR_WANT_X509_LOOKUP 4
+# define SSL_ERROR_SYSCALL 5/* look at error stack/return
+ * value/errno */
+# define SSL_ERROR_ZERO_RETURN 6
+# define SSL_ERROR_WANT_CONNECT 7
+# define SSL_ERROR_WANT_ACCEPT 8
+# define SSL_CTRL_NEED_TMP_RSA 1
+# define SSL_CTRL_SET_TMP_RSA 2
+# define SSL_CTRL_SET_TMP_DH 3
+# define SSL_CTRL_SET_TMP_ECDH 4
+# define SSL_CTRL_SET_TMP_RSA_CB 5
+# define SSL_CTRL_SET_TMP_DH_CB 6
+# define SSL_CTRL_SET_TMP_ECDH_CB 7
+# define SSL_CTRL_GET_SESSION_REUSED 8
+# define SSL_CTRL_GET_CLIENT_CERT_REQUEST 9
+# define SSL_CTRL_GET_NUM_RENEGOTIATIONS 10
+# define SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS 11
+# define SSL_CTRL_GET_TOTAL_RENEGOTIATIONS 12
+# define SSL_CTRL_GET_FLAGS 13
+# define SSL_CTRL_EXTRA_CHAIN_CERT 14
+# define SSL_CTRL_SET_MSG_CALLBACK 15
+# define SSL_CTRL_SET_MSG_CALLBACK_ARG 16
+/* only applies to datagram connections */
+# define SSL_CTRL_SET_MTU 17
+/* Stats */
+# define SSL_CTRL_SESS_NUMBER 20
+# define SSL_CTRL_SESS_CONNECT 21
+# define SSL_CTRL_SESS_CONNECT_GOOD 22
+# define SSL_CTRL_SESS_CONNECT_RENEGOTIATE 23
+# define SSL_CTRL_SESS_ACCEPT 24
+# define SSL_CTRL_SESS_ACCEPT_GOOD 25
+# define SSL_CTRL_SESS_ACCEPT_RENEGOTIATE 26
+# define SSL_CTRL_SESS_HIT 27
+# define SSL_CTRL_SESS_CB_HIT 28
+# define SSL_CTRL_SESS_MISSES 29
+# define SSL_CTRL_SESS_TIMEOUTS 30
+# define SSL_CTRL_SESS_CACHE_FULL 31
+# define SSL_CTRL_OPTIONS 32
+# define SSL_CTRL_MODE 33
+# define SSL_CTRL_GET_READ_AHEAD 40
+# define SSL_CTRL_SET_READ_AHEAD 41
+# define SSL_CTRL_SET_SESS_CACHE_SIZE 42
+# define SSL_CTRL_GET_SESS_CACHE_SIZE 43
+# define SSL_CTRL_SET_SESS_CACHE_MODE 44
+# define SSL_CTRL_GET_SESS_CACHE_MODE 45
+# define SSL_CTRL_GET_MAX_CERT_LIST 50
+# define SSL_CTRL_SET_MAX_CERT_LIST 51
+# define SSL_CTRL_SET_MAX_SEND_FRAGMENT 52
+/* see tls1.h for macros based on these */
+# ifndef OPENSSL_NO_TLSEXT
+# define SSL_CTRL_SET_TLSEXT_SERVERNAME_CB 53
+# define SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG 54
+# define SSL_CTRL_SET_TLSEXT_HOSTNAME 55
+# define SSL_CTRL_SET_TLSEXT_DEBUG_CB 56
+# define SSL_CTRL_SET_TLSEXT_DEBUG_ARG 57
+# define SSL_CTRL_GET_TLSEXT_TICKET_KEYS 58
+# define SSL_CTRL_SET_TLSEXT_TICKET_KEYS 59
+# define SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT 60
+# define SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB 61
+# define SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB_ARG 62
+# define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB 63
+# define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG 64
+# define SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE 65
+# define SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS 66
+# define SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS 67
+# define SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS 68
+# define SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS 69
+# define SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP 70
+# define SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP 71
+# define SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB 72
+# define SSL_CTRL_SET_TLS_EXT_SRP_USERNAME_CB 75
+# define SSL_CTRL_SET_SRP_VERIFY_PARAM_CB 76
+# define SSL_CTRL_SET_SRP_GIVE_CLIENT_PWD_CB 77
+# define SSL_CTRL_SET_SRP_ARG 78
+# define SSL_CTRL_SET_TLS_EXT_SRP_USERNAME 79
+# define SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH 80
+# define SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD 81
+# ifndef OPENSSL_NO_HEARTBEATS
+# define SSL_CTRL_TLS_EXT_SEND_HEARTBEAT 85
+# define SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING 86
+# define SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS 87
+# endif
+# endif /* OPENSSL_NO_TLSEXT */
+# define DTLS_CTRL_GET_TIMEOUT 73
+# define DTLS_CTRL_HANDLE_TIMEOUT 74
+# define DTLS_CTRL_LISTEN 75
+# define SSL_CTRL_GET_RI_SUPPORT 76
+# define SSL_CTRL_CLEAR_OPTIONS 77
+# define SSL_CTRL_CLEAR_MODE 78
+# define SSL_CTRL_GET_EXTRA_CHAIN_CERTS 82
+# define SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS 83
+# define SSL_CTRL_CHAIN 88
+# define SSL_CTRL_CHAIN_CERT 89
+# define SSL_CTRL_GET_CURVES 90
+# define SSL_CTRL_SET_CURVES 91
+# define SSL_CTRL_SET_CURVES_LIST 92
+# define SSL_CTRL_GET_SHARED_CURVE 93
+# define SSL_CTRL_SET_ECDH_AUTO 94
+# define SSL_CTRL_SET_SIGALGS 97
+# define SSL_CTRL_SET_SIGALGS_LIST 98
+# define SSL_CTRL_CERT_FLAGS 99
+# define SSL_CTRL_CLEAR_CERT_FLAGS 100
+# define SSL_CTRL_SET_CLIENT_SIGALGS 101
+# define SSL_CTRL_SET_CLIENT_SIGALGS_LIST 102
+# define SSL_CTRL_GET_CLIENT_CERT_TYPES 103
+# define SSL_CTRL_SET_CLIENT_CERT_TYPES 104
+# define SSL_CTRL_BUILD_CERT_CHAIN 105
+# define SSL_CTRL_SET_VERIFY_CERT_STORE 106
+# define SSL_CTRL_SET_CHAIN_CERT_STORE 107
+# define SSL_CTRL_GET_PEER_SIGNATURE_NID 108
+# define SSL_CTRL_GET_SERVER_TMP_KEY 109
+# define SSL_CTRL_GET_RAW_CIPHERLIST 110
+# define SSL_CTRL_GET_EC_POINT_FORMATS 111
+# define SSL_CTRL_GET_CHAIN_CERTS 115
+# define SSL_CTRL_SELECT_CURRENT_CERT 116
+# define SSL_CTRL_SET_CURRENT_CERT 117
+# define SSL_CTRL_CHECK_PROTO_VERSION 119
+# define DTLS_CTRL_SET_LINK_MTU 120
+# define DTLS_CTRL_GET_LINK_MIN_MTU 121
+# define SSL_CERT_SET_FIRST 1
+# define SSL_CERT_SET_NEXT 2
+# define SSL_CERT_SET_SERVER 3
+# define DTLSv1_get_timeout(ssl, arg) \
+ SSL_ctrl(ssl,DTLS_CTRL_GET_TIMEOUT,0, (void *)arg)
+# define DTLSv1_handle_timeout(ssl) \
+ SSL_ctrl(ssl,DTLS_CTRL_HANDLE_TIMEOUT,0, NULL)
+# define DTLSv1_listen(ssl, peer) \
+ SSL_ctrl(ssl,DTLS_CTRL_LISTEN,0, (void *)peer)
+# define SSL_session_reused(ssl) \
+ SSL_ctrl((ssl),SSL_CTRL_GET_SESSION_REUSED,0,NULL)
+# define SSL_num_renegotiations(ssl) \
+ SSL_ctrl((ssl),SSL_CTRL_GET_NUM_RENEGOTIATIONS,0,NULL)
+# define SSL_clear_num_renegotiations(ssl) \
+ SSL_ctrl((ssl),SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS,0,NULL)
+# define SSL_total_renegotiations(ssl) \
+ SSL_ctrl((ssl),SSL_CTRL_GET_TOTAL_RENEGOTIATIONS,0,NULL)
+# define SSL_CTX_need_tmp_RSA(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_NEED_TMP_RSA,0,NULL)
+# define SSL_CTX_set_tmp_rsa(ctx,rsa) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_RSA,0,(char *)rsa)
+# define SSL_CTX_set_tmp_dh(ctx,dh) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_DH,0,(char *)dh)
+# define SSL_CTX_set_tmp_ecdh(ctx,ecdh) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_ECDH,0,(char *)ecdh)
+# define SSL_need_tmp_RSA(ssl) \
+ SSL_ctrl(ssl,SSL_CTRL_NEED_TMP_RSA,0,NULL)
+# define SSL_set_tmp_rsa(ssl,rsa) \
+ SSL_ctrl(ssl,SSL_CTRL_SET_TMP_RSA,0,(char *)rsa)
+# define SSL_set_tmp_dh(ssl,dh) \
+ SSL_ctrl(ssl,SSL_CTRL_SET_TMP_DH,0,(char *)dh)
+# define SSL_set_tmp_ecdh(ssl,ecdh) \
+ SSL_ctrl(ssl,SSL_CTRL_SET_TMP_ECDH,0,(char *)ecdh)
+# define SSL_CTX_add_extra_chain_cert(ctx,x509) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_EXTRA_CHAIN_CERT,0,(char *)x509)
+# define SSL_CTX_get_extra_chain_certs(ctx,px509) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_GET_EXTRA_CHAIN_CERTS,0,px509)
+# define SSL_CTX_get_extra_chain_certs_only(ctx,px509) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_GET_EXTRA_CHAIN_CERTS,1,px509)
+# define SSL_CTX_clear_extra_chain_certs(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS,0,NULL)
+# define SSL_CTX_set0_chain(ctx,sk) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN,0,(char *)sk)
+# define SSL_CTX_set1_chain(ctx,sk) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN,1,(char *)sk)
+# define SSL_CTX_add0_chain_cert(ctx,x509) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN_CERT,0,(char *)x509)
+# define SSL_CTX_add1_chain_cert(ctx,x509) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN_CERT,1,(char *)x509)
+# define SSL_CTX_get0_chain_certs(ctx,px509) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_GET_CHAIN_CERTS,0,px509)
+# define SSL_CTX_clear_chain_certs(ctx) \
+ SSL_CTX_set0_chain(ctx,NULL)
+# define SSL_CTX_build_cert_chain(ctx, flags) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_BUILD_CERT_CHAIN, flags, NULL)
+# define SSL_CTX_select_current_cert(ctx,x509) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SELECT_CURRENT_CERT,0,(char *)x509)
+# define SSL_CTX_set_current_cert(ctx, op) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CURRENT_CERT, op, NULL)
+# define SSL_CTX_set0_verify_cert_store(ctx,st) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_VERIFY_CERT_STORE,0,(char *)st)
+# define SSL_CTX_set1_verify_cert_store(ctx,st) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_VERIFY_CERT_STORE,1,(char *)st)
+# define SSL_CTX_set0_chain_cert_store(ctx,st) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CHAIN_CERT_STORE,0,(char *)st)
+# define SSL_CTX_set1_chain_cert_store(ctx,st) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CHAIN_CERT_STORE,1,(char *)st)
+# define SSL_set0_chain(ctx,sk) \
+ SSL_ctrl(ctx,SSL_CTRL_CHAIN,0,(char *)sk)
+# define SSL_set1_chain(ctx,sk) \
+ SSL_ctrl(ctx,SSL_CTRL_CHAIN,1,(char *)sk)
+# define SSL_add0_chain_cert(ctx,x509) \
+ SSL_ctrl(ctx,SSL_CTRL_CHAIN_CERT,0,(char *)x509)
+# define SSL_add1_chain_cert(ctx,x509) \
+ SSL_ctrl(ctx,SSL_CTRL_CHAIN_CERT,1,(char *)x509)
+# define SSL_get0_chain_certs(ctx,px509) \
+ SSL_ctrl(ctx,SSL_CTRL_GET_CHAIN_CERTS,0,px509)
+# define SSL_clear_chain_certs(ctx) \
+ SSL_set0_chain(ctx,NULL)
+# define SSL_build_cert_chain(s, flags) \
+ SSL_ctrl(s,SSL_CTRL_BUILD_CERT_CHAIN, flags, NULL)
+# define SSL_select_current_cert(ctx,x509) \
+ SSL_ctrl(ctx,SSL_CTRL_SELECT_CURRENT_CERT,0,(char *)x509)
+# define SSL_set_current_cert(ctx,op) \
+ SSL_ctrl(ctx,SSL_CTRL_SET_CURRENT_CERT, op, NULL)
+# define SSL_set0_verify_cert_store(s,st) \
+ SSL_ctrl(s,SSL_CTRL_SET_VERIFY_CERT_STORE,0,(char *)st)
+# define SSL_set1_verify_cert_store(s,st) \
+ SSL_ctrl(s,SSL_CTRL_SET_VERIFY_CERT_STORE,1,(char *)st)
+# define SSL_set0_chain_cert_store(s,st) \
+ SSL_ctrl(s,SSL_CTRL_SET_CHAIN_CERT_STORE,0,(char *)st)
+# define SSL_set1_chain_cert_store(s,st) \
+ SSL_ctrl(s,SSL_CTRL_SET_CHAIN_CERT_STORE,1,(char *)st)
+# define SSL_get1_curves(ctx, s) \
+ SSL_ctrl(ctx,SSL_CTRL_GET_CURVES,0,(char *)s)
+# define SSL_CTX_set1_curves(ctx, clist, clistlen) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CURVES,clistlen,(char *)clist)
+# define SSL_CTX_set1_curves_list(ctx, s) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CURVES_LIST,0,(char *)s)
+# define SSL_set1_curves(ctx, clist, clistlen) \
+ SSL_ctrl(ctx,SSL_CTRL_SET_CURVES,clistlen,(char *)clist)
+# define SSL_set1_curves_list(ctx, s) \
+ SSL_ctrl(ctx,SSL_CTRL_SET_CURVES_LIST,0,(char *)s)
+# define SSL_get_shared_curve(s, n) \
+ SSL_ctrl(s,SSL_CTRL_GET_SHARED_CURVE,n,NULL)
+# define SSL_CTX_set_ecdh_auto(ctx, onoff) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_ECDH_AUTO,onoff,NULL)
+# define SSL_set_ecdh_auto(s, onoff) \
+ SSL_ctrl(s,SSL_CTRL_SET_ECDH_AUTO,onoff,NULL)
+# define SSL_CTX_set1_sigalgs(ctx, slist, slistlen) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SIGALGS,slistlen,(int *)slist)
+# define SSL_CTX_set1_sigalgs_list(ctx, s) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)s)
+# define SSL_set1_sigalgs(ctx, slist, slistlen) \
+ SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS,clistlen,(int *)slist)
+# define SSL_set1_sigalgs_list(ctx, s) \
+ SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)s)
+# define SSL_CTX_set1_client_sigalgs(ctx, slist, slistlen) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CLIENT_SIGALGS,slistlen,(int *)slist)
+# define SSL_CTX_set1_client_sigalgs_list(ctx, s) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CLIENT_SIGALGS_LIST,0,(char *)s)
+# define SSL_set1_client_sigalgs(ctx, slist, slistlen) \
+ SSL_ctrl(ctx,SSL_CTRL_SET_CLIENT_SIGALGS,clistlen,(int *)slist)
+# define SSL_set1_client_sigalgs_list(ctx, s) \
+ SSL_ctrl(ctx,SSL_CTRL_SET_CLIENT_SIGALGS_LIST,0,(char *)s)
+# define SSL_get0_certificate_types(s, clist) \
+ SSL_ctrl(s, SSL_CTRL_GET_CLIENT_CERT_TYPES, 0, (char *)clist)
+# define SSL_CTX_set1_client_certificate_types(ctx, clist, clistlen) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CLIENT_CERT_TYPES,clistlen,(char *)clist)
+# define SSL_set1_client_certificate_types(s, clist, clistlen) \
+ SSL_ctrl(s,SSL_CTRL_SET_CLIENT_CERT_TYPES,clistlen,(char *)clist)
+# define SSL_get_peer_signature_nid(s, pn) \
+ SSL_ctrl(s,SSL_CTRL_GET_PEER_SIGNATURE_NID,0,pn)
+# define SSL_get_server_tmp_key(s, pk) \
+ SSL_ctrl(s,SSL_CTRL_GET_SERVER_TMP_KEY,0,pk)
+# define SSL_get0_raw_cipherlist(s, plst) \
+ SSL_ctrl(s,SSL_CTRL_GET_RAW_CIPHERLIST,0,(char *)plst)
+# define SSL_get0_ec_point_formats(s, plst) \
+ SSL_ctrl(s,SSL_CTRL_GET_EC_POINT_FORMATS,0,(char *)plst)
+# ifndef OPENSSL_NO_BIO
+BIO_METHOD *BIO_f_ssl(void);
+BIO *BIO_new_ssl(SSL_CTX *ctx, int client);
+BIO *BIO_new_ssl_connect(SSL_CTX *ctx);
+BIO *BIO_new_buffer_ssl_connect(SSL_CTX *ctx);
+int BIO_ssl_copy_session_id(BIO *to, BIO *from);
+void BIO_ssl_shutdown(BIO *ssl_bio);
+
+# endif
+
+int SSL_CTX_set_cipher_list(SSL_CTX *, const char *str);
+SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth);
+void SSL_CTX_free(SSL_CTX *);
+long SSL_CTX_set_timeout(SSL_CTX *ctx, long t);
+long SSL_CTX_get_timeout(const SSL_CTX *ctx);
+X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *);
+void SSL_CTX_set_cert_store(SSL_CTX *, X509_STORE *);
+int SSL_want(const SSL *s);
+int SSL_clear(SSL *s);
+
+void SSL_CTX_flush_sessions(SSL_CTX *ctx, long tm);
+
+const SSL_CIPHER *SSL_get_current_cipher(const SSL *s);
+int SSL_CIPHER_get_bits(const SSL_CIPHER *c, int *alg_bits);
+char *SSL_CIPHER_get_version(const SSL_CIPHER *c);
+const char *SSL_CIPHER_get_name(const SSL_CIPHER *c);
+unsigned long SSL_CIPHER_get_id(const SSL_CIPHER *c);
+
+int SSL_get_fd(const SSL *s);
+int SSL_get_rfd(const SSL *s);
+int SSL_get_wfd(const SSL *s);
+const char *SSL_get_cipher_list(const SSL *s, int n);
+char *SSL_get_shared_ciphers(const SSL *s, char *buf, int len);
+int SSL_get_read_ahead(const SSL *s);
+int SSL_pending(const SSL *s);
+# ifndef OPENSSL_NO_SOCK
+int SSL_set_fd(SSL *s, int fd);
+int SSL_set_rfd(SSL *s, int fd);
+int SSL_set_wfd(SSL *s, int fd);
+# endif
+# ifndef OPENSSL_NO_BIO
+void SSL_set_bio(SSL *s, BIO *rbio, BIO *wbio);
+BIO *SSL_get_rbio(const SSL *s);
+BIO *SSL_get_wbio(const SSL *s);
+# endif
+int SSL_set_cipher_list(SSL *s, const char *str);
+void SSL_set_read_ahead(SSL *s, int yes);
+int SSL_get_verify_mode(const SSL *s);
+int SSL_get_verify_depth(const SSL *s);
+int (*SSL_get_verify_callback(const SSL *s)) (int, X509_STORE_CTX *);
+void SSL_set_verify(SSL *s, int mode,
+ int (*callback) (int ok, X509_STORE_CTX *ctx));
+void SSL_set_verify_depth(SSL *s, int depth);
+void SSL_set_cert_cb(SSL *s, int (*cb) (SSL *ssl, void *arg), void *arg);
+# ifndef OPENSSL_NO_RSA
+int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa);
+# endif
+int SSL_use_RSAPrivateKey_ASN1(SSL *ssl, unsigned char *d, long len);
+int SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey);
+int SSL_use_PrivateKey_ASN1(int pk, SSL *ssl, const unsigned char *d,
+ long len);
+int SSL_use_certificate(SSL *ssl, X509 *x);
+int SSL_use_certificate_ASN1(SSL *ssl, const unsigned char *d, int len);
+
+# ifndef OPENSSL_NO_TLSEXT
+/* Set serverinfo data for the current active cert. */
+int SSL_CTX_use_serverinfo(SSL_CTX *ctx, const unsigned char *serverinfo,
+ size_t serverinfo_length);
+# ifndef OPENSSL_NO_STDIO
+int SSL_CTX_use_serverinfo_file(SSL_CTX *ctx, const char *file);
+# endif /* NO_STDIO */
+
+# endif
+
+# ifndef OPENSSL_NO_STDIO
+int SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type);
+int SSL_use_PrivateKey_file(SSL *ssl, const char *file, int type);
+int SSL_use_certificate_file(SSL *ssl, const char *file, int type);
+int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX *ctx, const char *file, int type);
+int SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *file, int type);
+int SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, int type);
+/* PEM type */
+int SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, const char *file);
+STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file);
+int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs,
+ const char *file);
+# ifndef OPENSSL_SYS_VMS
+/* XXXXX: Better scheme needed! [was: #ifndef MAC_OS_pre_X] */
+# ifndef OPENSSL_SYS_MACINTOSH_CLASSIC
+int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs,
+ const char *dir);
+# endif
+# endif
+
+# endif
+
+void SSL_load_error_strings(void);
+const char *SSL_state_string(const SSL *s);
+const char *SSL_rstate_string(const SSL *s);
+const char *SSL_state_string_long(const SSL *s);
+const char *SSL_rstate_string_long(const SSL *s);
+long SSL_SESSION_get_time(const SSL_SESSION *s);
+long SSL_SESSION_set_time(SSL_SESSION *s, long t);
+long SSL_SESSION_get_timeout(const SSL_SESSION *s);
+long SSL_SESSION_set_timeout(SSL_SESSION *s, long t);
+void SSL_copy_session_id(SSL *to, const SSL *from);
+X509 *SSL_SESSION_get0_peer(SSL_SESSION *s);
+int SSL_SESSION_set1_id_context(SSL_SESSION *s, const unsigned char *sid_ctx,
+ unsigned int sid_ctx_len);
+
+SSL_SESSION *SSL_SESSION_new(void);
+const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s,
+ unsigned int *len);
+unsigned int SSL_SESSION_get_compress_id(const SSL_SESSION *s);
+# ifndef OPENSSL_NO_FP_API
+int SSL_SESSION_print_fp(FILE *fp, const SSL_SESSION *ses);
+# endif
+# ifndef OPENSSL_NO_BIO
+int SSL_SESSION_print(BIO *fp, const SSL_SESSION *ses);
+# endif
+void SSL_SESSION_free(SSL_SESSION *ses);
+int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp);
+int SSL_set_session(SSL *to, SSL_SESSION *session);
+int SSL_CTX_add_session(SSL_CTX *s, SSL_SESSION *c);
+int SSL_CTX_remove_session(SSL_CTX *, SSL_SESSION *c);
+int SSL_CTX_set_generate_session_id(SSL_CTX *, GEN_SESSION_CB);
+int SSL_set_generate_session_id(SSL *, GEN_SESSION_CB);
+int SSL_has_matching_session_id(const SSL *ssl, const unsigned char *id,
+ unsigned int id_len);
+SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp,
+ long length);
+
+# ifdef HEADER_X509_H
+X509 *SSL_get_peer_certificate(const SSL *s);
+# endif
+
+STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *s);
+
+int SSL_CTX_get_verify_mode(const SSL_CTX *ctx);
+int SSL_CTX_get_verify_depth(const SSL_CTX *ctx);
+int (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx)) (int,
+ X509_STORE_CTX *);
+void SSL_CTX_set_verify(SSL_CTX *ctx, int mode,
+ int (*callback) (int, X509_STORE_CTX *));
+void SSL_CTX_set_verify_depth(SSL_CTX *ctx, int depth);
+void SSL_CTX_set_cert_verify_callback(SSL_CTX *ctx,
+ int (*cb) (X509_STORE_CTX *, void *),
+ void *arg);
+void SSL_CTX_set_cert_cb(SSL_CTX *c, int (*cb) (SSL *ssl, void *arg),
+ void *arg);
+# ifndef OPENSSL_NO_RSA
+int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa);
+# endif
+int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, const unsigned char *d,
+ long len);
+int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey);
+int SSL_CTX_use_PrivateKey_ASN1(int pk, SSL_CTX *ctx,
+ const unsigned char *d, long len);
+int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x);
+int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, int len,
+ const unsigned char *d);
+
+void SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx, pem_password_cb *cb);
+void SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX *ctx, void *u);
+
+int SSL_CTX_check_private_key(const SSL_CTX *ctx);
+int SSL_check_private_key(const SSL *ctx);
+
+int SSL_CTX_set_session_id_context(SSL_CTX *ctx, const unsigned char *sid_ctx,
+ unsigned int sid_ctx_len);
+
+SSL *SSL_new(SSL_CTX *ctx);
+int SSL_set_session_id_context(SSL *ssl, const unsigned char *sid_ctx,
+ unsigned int sid_ctx_len);
+
+int SSL_CTX_set_purpose(SSL_CTX *s, int purpose);
+int SSL_set_purpose(SSL *s, int purpose);
+int SSL_CTX_set_trust(SSL_CTX *s, int trust);
+int SSL_set_trust(SSL *s, int trust);
+
+int SSL_CTX_set1_param(SSL_CTX *ctx, X509_VERIFY_PARAM *vpm);
+int SSL_set1_param(SSL *ssl, X509_VERIFY_PARAM *vpm);
+
+X509_VERIFY_PARAM *SSL_CTX_get0_param(SSL_CTX *ctx);
+X509_VERIFY_PARAM *SSL_get0_param(SSL *ssl);
+
+# ifndef OPENSSL_NO_SRP
+int SSL_CTX_set_srp_username(SSL_CTX *ctx, char *name);
+int SSL_CTX_set_srp_password(SSL_CTX *ctx, char *password);
+int SSL_CTX_set_srp_strength(SSL_CTX *ctx, int strength);
+int SSL_CTX_set_srp_client_pwd_callback(SSL_CTX *ctx,
+ char *(*cb) (SSL *, void *));
+int SSL_CTX_set_srp_verify_param_callback(SSL_CTX *ctx,
+ int (*cb) (SSL *, void *));
+int SSL_CTX_set_srp_username_callback(SSL_CTX *ctx,
+ int (*cb) (SSL *, int *, void *));
+int SSL_CTX_set_srp_cb_arg(SSL_CTX *ctx, void *arg);
+
+int SSL_set_srp_server_param(SSL *s, const BIGNUM *N, const BIGNUM *g,
+ BIGNUM *sa, BIGNUM *v, char *info);
+int SSL_set_srp_server_param_pw(SSL *s, const char *user, const char *pass,
+ const char *grp);
+
+BIGNUM *SSL_get_srp_g(SSL *s);
+BIGNUM *SSL_get_srp_N(SSL *s);
+
+char *SSL_get_srp_username(SSL *s);
+char *SSL_get_srp_userinfo(SSL *s);
+# endif
+
+void SSL_certs_clear(SSL *s);
+void SSL_free(SSL *ssl);
+int SSL_accept(SSL *ssl);
+int SSL_connect(SSL *ssl);
+int SSL_read(SSL *ssl, void *buf, int num);
+int SSL_peek(SSL *ssl, void *buf, int num);
+int SSL_write(SSL *ssl, const void *buf, int num);
+long SSL_ctrl(SSL *ssl, int cmd, long larg, void *parg);
+long SSL_callback_ctrl(SSL *, int, void (*)(void));
+long SSL_CTX_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg);
+long SSL_CTX_callback_ctrl(SSL_CTX *, int, void (*)(void));
+
+int SSL_get_error(const SSL *s, int ret_code);
+const char *SSL_get_version(const SSL *s);
+
+/* This sets the 'default' SSL version that SSL_new() will create */
+int SSL_CTX_set_ssl_version(SSL_CTX *ctx, const SSL_METHOD *meth);
+
+# ifndef OPENSSL_NO_SSL2
+const SSL_METHOD *SSLv2_method(void); /* SSLv2 */
+const SSL_METHOD *SSLv2_server_method(void); /* SSLv2 */
+const SSL_METHOD *SSLv2_client_method(void); /* SSLv2 */
+# endif
+
+# ifndef OPENSSL_NO_SSL3_METHOD
+const SSL_METHOD *SSLv3_method(void); /* SSLv3 */
+const SSL_METHOD *SSLv3_server_method(void); /* SSLv3 */
+const SSL_METHOD *SSLv3_client_method(void); /* SSLv3 */
+# endif
+
+const SSL_METHOD *SSLv23_method(void); /* Negotiate highest available SSL/TLS
+ * version */
+const SSL_METHOD *SSLv23_server_method(void); /* Negotiate highest available
+ * SSL/TLS version */
+const SSL_METHOD *SSLv23_client_method(void); /* Negotiate highest available
+ * SSL/TLS version */
+
+const SSL_METHOD *TLSv1_method(void); /* TLSv1.0 */
+const SSL_METHOD *TLSv1_server_method(void); /* TLSv1.0 */
+const SSL_METHOD *TLSv1_client_method(void); /* TLSv1.0 */
+
+const SSL_METHOD *TLSv1_1_method(void); /* TLSv1.1 */
+const SSL_METHOD *TLSv1_1_server_method(void); /* TLSv1.1 */
+const SSL_METHOD *TLSv1_1_client_method(void); /* TLSv1.1 */
+
+const SSL_METHOD *TLSv1_2_method(void); /* TLSv1.2 */
+const SSL_METHOD *TLSv1_2_server_method(void); /* TLSv1.2 */
+const SSL_METHOD *TLSv1_2_client_method(void); /* TLSv1.2 */
+
+const SSL_METHOD *DTLSv1_method(void); /* DTLSv1.0 */
+const SSL_METHOD *DTLSv1_server_method(void); /* DTLSv1.0 */
+const SSL_METHOD *DTLSv1_client_method(void); /* DTLSv1.0 */
+
+const SSL_METHOD *DTLSv1_2_method(void); /* DTLSv1.2 */
+const SSL_METHOD *DTLSv1_2_server_method(void); /* DTLSv1.2 */
+const SSL_METHOD *DTLSv1_2_client_method(void); /* DTLSv1.2 */
+
+const SSL_METHOD *DTLS_method(void); /* DTLS 1.0 and 1.2 */
+const SSL_METHOD *DTLS_server_method(void); /* DTLS 1.0 and 1.2 */
+const SSL_METHOD *DTLS_client_method(void); /* DTLS 1.0 and 1.2 */
+
+STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const SSL *s);
+
+int SSL_do_handshake(SSL *s);
+int SSL_renegotiate(SSL *s);
+int SSL_renegotiate_abbreviated(SSL *s);
+int SSL_renegotiate_pending(SSL *s);
+int SSL_shutdown(SSL *s);
+
+const SSL_METHOD *SSL_CTX_get_ssl_method(SSL_CTX *ctx);
+const SSL_METHOD *SSL_get_ssl_method(SSL *s);
+int SSL_set_ssl_method(SSL *s, const SSL_METHOD *method);
+const char *SSL_alert_type_string_long(int value);
+const char *SSL_alert_type_string(int value);
+const char *SSL_alert_desc_string_long(int value);
+const char *SSL_alert_desc_string(int value);
+
+void SSL_set_client_CA_list(SSL *s, STACK_OF(X509_NAME) *name_list);
+void SSL_CTX_set_client_CA_list(SSL_CTX *ctx, STACK_OF(X509_NAME) *name_list);
+STACK_OF(X509_NAME) *SSL_get_client_CA_list(const SSL *s);
+STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(const SSL_CTX *s);
+int SSL_add_client_CA(SSL *ssl, X509 *x);
+int SSL_CTX_add_client_CA(SSL_CTX *ctx, X509 *x);
+
+void SSL_set_connect_state(SSL *s);
+void SSL_set_accept_state(SSL *s);
+
+long SSL_get_default_timeout(const SSL *s);
+
+int SSL_library_init(void);
+
+char *SSL_CIPHER_description(const SSL_CIPHER *, char *buf, int size);
+STACK_OF(X509_NAME) *SSL_dup_CA_list(STACK_OF(X509_NAME) *sk);
+
+SSL *SSL_dup(SSL *ssl);
+
+X509 *SSL_get_certificate(const SSL *ssl);
+/*
+ * EVP_PKEY
+ */ struct evp_pkey_st *SSL_get_privatekey(const SSL *ssl);
+
+X509 *SSL_CTX_get0_certificate(const SSL_CTX *ctx);
+EVP_PKEY *SSL_CTX_get0_privatekey(const SSL_CTX *ctx);
+
+void SSL_CTX_set_quiet_shutdown(SSL_CTX *ctx, int mode);
+int SSL_CTX_get_quiet_shutdown(const SSL_CTX *ctx);
+void SSL_set_quiet_shutdown(SSL *ssl, int mode);
+int SSL_get_quiet_shutdown(const SSL *ssl);
+void SSL_set_shutdown(SSL *ssl, int mode);
+int SSL_get_shutdown(const SSL *ssl);
+int SSL_version(const SSL *ssl);
+int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx);
+int SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile,
+ const char *CApath);
+# define SSL_get0_session SSL_get_session/* just peek at pointer */
+SSL_SESSION *SSL_get_session(const SSL *ssl);
+SSL_SESSION *SSL_get1_session(SSL *ssl); /* obtain a reference count */
+SSL_CTX *SSL_get_SSL_CTX(const SSL *ssl);
+SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX *ctx);
+void SSL_set_info_callback(SSL *ssl,
+ void (*cb) (const SSL *ssl, int type, int val));
+void (*SSL_get_info_callback(const SSL *ssl)) (const SSL *ssl, int type,
+ int val);
+int SSL_state(const SSL *ssl);
+void SSL_set_state(SSL *ssl, int state);
+
+void SSL_set_verify_result(SSL *ssl, long v);
+long SSL_get_verify_result(const SSL *ssl);
+
+int SSL_set_ex_data(SSL *ssl, int idx, void *data);
+void *SSL_get_ex_data(const SSL *ssl, int idx);
+int SSL_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
+ CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
+
+int SSL_SESSION_set_ex_data(SSL_SESSION *ss, int idx, void *data);
+void *SSL_SESSION_get_ex_data(const SSL_SESSION *ss, int idx);
+int SSL_SESSION_get_ex_new_index(long argl, void *argp,
+ CRYPTO_EX_new *new_func,
+ CRYPTO_EX_dup *dup_func,
+ CRYPTO_EX_free *free_func);
+
+int SSL_CTX_set_ex_data(SSL_CTX *ssl, int idx, void *data);
+void *SSL_CTX_get_ex_data(const SSL_CTX *ssl, int idx);
+int SSL_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
+ CRYPTO_EX_dup *dup_func,
+ CRYPTO_EX_free *free_func);
+
+int SSL_get_ex_data_X509_STORE_CTX_idx(void);
+
+# define SSL_CTX_sess_set_cache_size(ctx,t) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_SIZE,t,NULL)
+# define SSL_CTX_sess_get_cache_size(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_SIZE,0,NULL)
+# define SSL_CTX_set_session_cache_mode(ctx,m) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_MODE,m,NULL)
+# define SSL_CTX_get_session_cache_mode(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_MODE,0,NULL)
+
+# define SSL_CTX_get_default_read_ahead(ctx) SSL_CTX_get_read_ahead(ctx)
+# define SSL_CTX_set_default_read_ahead(ctx,m) SSL_CTX_set_read_ahead(ctx,m)
+# define SSL_CTX_get_read_ahead(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_GET_READ_AHEAD,0,NULL)
+# define SSL_CTX_set_read_ahead(ctx,m) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_READ_AHEAD,m,NULL)
+# define SSL_CTX_get_max_cert_list(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL)
+# define SSL_CTX_set_max_cert_list(ctx,m) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL)
+# define SSL_get_max_cert_list(ssl) \
+ SSL_ctrl(ssl,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL)
+# define SSL_set_max_cert_list(ssl,m) \
+ SSL_ctrl(ssl,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL)
+
+# define SSL_CTX_set_max_send_fragment(ctx,m) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_SEND_FRAGMENT,m,NULL)
+# define SSL_set_max_send_fragment(ssl,m) \
+ SSL_ctrl(ssl,SSL_CTRL_SET_MAX_SEND_FRAGMENT,m,NULL)
+
+ /* NB: the keylength is only applicable when is_export is true */
+# ifndef OPENSSL_NO_RSA
+void SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx,
+ RSA *(*cb) (SSL *ssl, int is_export,
+ int keylength));
+
+void SSL_set_tmp_rsa_callback(SSL *ssl,
+ RSA *(*cb) (SSL *ssl, int is_export,
+ int keylength));
+# endif
+# ifndef OPENSSL_NO_DH
+void SSL_CTX_set_tmp_dh_callback(SSL_CTX *ctx,
+ DH *(*dh) (SSL *ssl, int is_export,
+ int keylength));
+void SSL_set_tmp_dh_callback(SSL *ssl,
+ DH *(*dh) (SSL *ssl, int is_export,
+ int keylength));
+# endif
+# ifndef OPENSSL_NO_ECDH
+void SSL_CTX_set_tmp_ecdh_callback(SSL_CTX *ctx,
+ EC_KEY *(*ecdh) (SSL *ssl, int is_export,
+ int keylength));
+void SSL_set_tmp_ecdh_callback(SSL *ssl,
+ EC_KEY *(*ecdh) (SSL *ssl, int is_export,
+ int keylength));
+# endif
+
+# ifndef OPENSSL_NO_COMP
+const COMP_METHOD *SSL_get_current_compression(SSL *s);
+const COMP_METHOD *SSL_get_current_expansion(SSL *s);
+const char *SSL_COMP_get_name(const COMP_METHOD *comp);
+STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void);
+STACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP)
+ *meths);
+void SSL_COMP_free_compression_methods(void);
+int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm);
+# else
+const void *SSL_get_current_compression(SSL *s);
+const void *SSL_get_current_expansion(SSL *s);
+const char *SSL_COMP_get_name(const void *comp);
+void *SSL_COMP_get_compression_methods(void);
+int SSL_COMP_add_compression_method(int id, void *cm);
+# endif
+
+const SSL_CIPHER *SSL_CIPHER_find(SSL *ssl, const unsigned char *ptr);
+
+/* TLS extensions functions */
+int SSL_set_session_ticket_ext(SSL *s, void *ext_data, int ext_len);
+
+int SSL_set_session_ticket_ext_cb(SSL *s, tls_session_ticket_ext_cb_fn cb,
+ void *arg);
+
+/* Pre-shared secret session resumption functions */
+int SSL_set_session_secret_cb(SSL *s,
+ tls_session_secret_cb_fn tls_session_secret_cb,
+ void *arg);
+
+void SSL_set_debug(SSL *s, int debug);
+int SSL_cache_hit(SSL *s);
+int SSL_is_server(SSL *s);
+
+SSL_CONF_CTX *SSL_CONF_CTX_new(void);
+int SSL_CONF_CTX_finish(SSL_CONF_CTX *cctx);
+void SSL_CONF_CTX_free(SSL_CONF_CTX *cctx);
+unsigned int SSL_CONF_CTX_set_flags(SSL_CONF_CTX *cctx, unsigned int flags);
+unsigned int SSL_CONF_CTX_clear_flags(SSL_CONF_CTX *cctx, unsigned int flags);
+int SSL_CONF_CTX_set1_prefix(SSL_CONF_CTX *cctx, const char *pre);
+
+void SSL_CONF_CTX_set_ssl(SSL_CONF_CTX *cctx, SSL *ssl);
+void SSL_CONF_CTX_set_ssl_ctx(SSL_CONF_CTX *cctx, SSL_CTX *ctx);
+
+int SSL_CONF_cmd(SSL_CONF_CTX *cctx, const char *cmd, const char *value);
+int SSL_CONF_cmd_argv(SSL_CONF_CTX *cctx, int *pargc, char ***pargv);
+int SSL_CONF_cmd_value_type(SSL_CONF_CTX *cctx, const char *cmd);
+
+# ifndef OPENSSL_NO_SSL_TRACE
+void SSL_trace(int write_p, int version, int content_type,
+ const void *buf, size_t len, SSL *ssl, void *arg);
+const char *SSL_CIPHER_standard_name(const SSL_CIPHER *c);
+# endif
+
+# ifndef OPENSSL_NO_UNIT_TEST
+const struct openssl_ssl_test_functions *SSL_test_functions(void);
+# endif
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_SSL_strings(void);
+
+/* Error codes for the SSL functions. */
+
+/* Function codes. */
+# define SSL_F_CHECK_SUITEB_CIPHER_LIST 331
+# define SSL_F_CLIENT_CERTIFICATE 100
+# define SSL_F_CLIENT_FINISHED 167
+# define SSL_F_CLIENT_HELLO 101
+# define SSL_F_CLIENT_MASTER_KEY 102
+# define SSL_F_D2I_SSL_SESSION 103
+# define SSL_F_DO_DTLS1_WRITE 245
+# define SSL_F_DO_SSL3_WRITE 104
+# define SSL_F_DTLS1_ACCEPT 246
+# define SSL_F_DTLS1_ADD_CERT_TO_BUF 295
+# define SSL_F_DTLS1_BUFFER_RECORD 247
+# define SSL_F_DTLS1_CHECK_TIMEOUT_NUM 316
+# define SSL_F_DTLS1_CLIENT_HELLO 248
+# define SSL_F_DTLS1_CONNECT 249
+# define SSL_F_DTLS1_ENC 250
+# define SSL_F_DTLS1_GET_HELLO_VERIFY 251
+# define SSL_F_DTLS1_GET_MESSAGE 252
+# define SSL_F_DTLS1_GET_MESSAGE_FRAGMENT 253
+# define SSL_F_DTLS1_GET_RECORD 254
+# define SSL_F_DTLS1_HANDLE_TIMEOUT 297
+# define SSL_F_DTLS1_HEARTBEAT 305
+# define SSL_F_DTLS1_OUTPUT_CERT_CHAIN 255
+# define SSL_F_DTLS1_PREPROCESS_FRAGMENT 288
+# define SSL_F_DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE 256
+# define SSL_F_DTLS1_PROCESS_RECORD 257
+# define SSL_F_DTLS1_READ_BYTES 258
+# define SSL_F_DTLS1_READ_FAILED 259
+# define SSL_F_DTLS1_SEND_CERTIFICATE_REQUEST 260
+# define SSL_F_DTLS1_SEND_CLIENT_CERTIFICATE 261
+# define SSL_F_DTLS1_SEND_CLIENT_KEY_EXCHANGE 262
+# define SSL_F_DTLS1_SEND_CLIENT_VERIFY 263
+# define SSL_F_DTLS1_SEND_HELLO_VERIFY_REQUEST 264
+# define SSL_F_DTLS1_SEND_SERVER_CERTIFICATE 265
+# define SSL_F_DTLS1_SEND_SERVER_HELLO 266
+# define SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE 267
+# define SSL_F_DTLS1_WRITE_APP_DATA_BYTES 268
+# define SSL_F_GET_CLIENT_FINISHED 105
+# define SSL_F_GET_CLIENT_HELLO 106
+# define SSL_F_GET_CLIENT_MASTER_KEY 107
+# define SSL_F_GET_SERVER_FINISHED 108
+# define SSL_F_GET_SERVER_HELLO 109
+# define SSL_F_GET_SERVER_STATIC_DH_KEY 340
+# define SSL_F_GET_SERVER_VERIFY 110
+# define SSL_F_I2D_SSL_SESSION 111
+# define SSL_F_READ_N 112
+# define SSL_F_REQUEST_CERTIFICATE 113
+# define SSL_F_SERVER_FINISH 239
+# define SSL_F_SERVER_HELLO 114
+# define SSL_F_SERVER_VERIFY 240
+# define SSL_F_SSL23_ACCEPT 115
+# define SSL_F_SSL23_CLIENT_HELLO 116
+# define SSL_F_SSL23_CONNECT 117
+# define SSL_F_SSL23_GET_CLIENT_HELLO 118
+# define SSL_F_SSL23_GET_SERVER_HELLO 119
+# define SSL_F_SSL23_PEEK 237
+# define SSL_F_SSL23_READ 120
+# define SSL_F_SSL23_WRITE 121
+# define SSL_F_SSL2_ACCEPT 122
+# define SSL_F_SSL2_CONNECT 123
+# define SSL_F_SSL2_ENC_INIT 124
+# define SSL_F_SSL2_GENERATE_KEY_MATERIAL 241
+# define SSL_F_SSL2_PEEK 234
+# define SSL_F_SSL2_READ 125
+# define SSL_F_SSL2_READ_INTERNAL 236
+# define SSL_F_SSL2_SET_CERTIFICATE 126
+# define SSL_F_SSL2_WRITE 127
+# define SSL_F_SSL3_ACCEPT 128
+# define SSL_F_SSL3_ADD_CERT_TO_BUF 296
+# define SSL_F_SSL3_CALLBACK_CTRL 233
+# define SSL_F_SSL3_CHANGE_CIPHER_STATE 129
+# define SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM 130
+# define SSL_F_SSL3_CHECK_CLIENT_HELLO 304
+# define SSL_F_SSL3_CHECK_FINISHED 339
+# define SSL_F_SSL3_CLIENT_HELLO 131
+# define SSL_F_SSL3_CONNECT 132
+# define SSL_F_SSL3_CTRL 213
+# define SSL_F_SSL3_CTX_CTRL 133
+# define SSL_F_SSL3_DIGEST_CACHED_RECORDS 293
+# define SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC 292
+# define SSL_F_SSL3_ENC 134
+# define SSL_F_SSL3_GENERATE_KEY_BLOCK 238
+# define SSL_F_SSL3_GET_CERTIFICATE_REQUEST 135
+# define SSL_F_SSL3_GET_CERT_STATUS 289
+# define SSL_F_SSL3_GET_CERT_VERIFY 136
+# define SSL_F_SSL3_GET_CLIENT_CERTIFICATE 137
+# define SSL_F_SSL3_GET_CLIENT_HELLO 138
+# define SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE 139
+# define SSL_F_SSL3_GET_FINISHED 140
+# define SSL_F_SSL3_GET_KEY_EXCHANGE 141
+# define SSL_F_SSL3_GET_MESSAGE 142
+# define SSL_F_SSL3_GET_NEW_SESSION_TICKET 283
+# define SSL_F_SSL3_GET_NEXT_PROTO 306
+# define SSL_F_SSL3_GET_RECORD 143
+# define SSL_F_SSL3_GET_SERVER_CERTIFICATE 144
+# define SSL_F_SSL3_GET_SERVER_DONE 145
+# define SSL_F_SSL3_GET_SERVER_HELLO 146
+# define SSL_F_SSL3_HANDSHAKE_MAC 285
+# define SSL_F_SSL3_NEW_SESSION_TICKET 287
+# define SSL_F_SSL3_OUTPUT_CERT_CHAIN 147
+# define SSL_F_SSL3_PEEK 235
+# define SSL_F_SSL3_READ_BYTES 148
+# define SSL_F_SSL3_READ_N 149
+# define SSL_F_SSL3_SEND_CERTIFICATE_REQUEST 150
+# define SSL_F_SSL3_SEND_CLIENT_CERTIFICATE 151
+# define SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE 152
+# define SSL_F_SSL3_SEND_CLIENT_VERIFY 153
+# define SSL_F_SSL3_SEND_SERVER_CERTIFICATE 154
+# define SSL_F_SSL3_SEND_SERVER_HELLO 242
+# define SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE 155
+# define SSL_F_SSL3_SETUP_KEY_BLOCK 157
+# define SSL_F_SSL3_SETUP_READ_BUFFER 156
+# define SSL_F_SSL3_SETUP_WRITE_BUFFER 291
+# define SSL_F_SSL3_WRITE_BYTES 158
+# define SSL_F_SSL3_WRITE_PENDING 159
+# define SSL_F_SSL_ADD_CERT_CHAIN 318
+# define SSL_F_SSL_ADD_CERT_TO_BUF 319
+# define SSL_F_SSL_ADD_CLIENTHELLO_RENEGOTIATE_EXT 298
+# define SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT 277
+# define SSL_F_SSL_ADD_CLIENTHELLO_USE_SRTP_EXT 307
+# define SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK 215
+# define SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK 216
+# define SSL_F_SSL_ADD_SERVERHELLO_RENEGOTIATE_EXT 299
+# define SSL_F_SSL_ADD_SERVERHELLO_TLSEXT 278
+# define SSL_F_SSL_ADD_SERVERHELLO_USE_SRTP_EXT 308
+# define SSL_F_SSL_BAD_METHOD 160
+# define SSL_F_SSL_BUILD_CERT_CHAIN 332
+# define SSL_F_SSL_BYTES_TO_CIPHER_LIST 161
+# define SSL_F_SSL_CERT_DUP 221
+# define SSL_F_SSL_CERT_INST 222
+# define SSL_F_SSL_CERT_INSTANTIATE 214
+# define SSL_F_SSL_CERT_NEW 162
+# define SSL_F_SSL_CHECK_PRIVATE_KEY 163
+# define SSL_F_SSL_CHECK_SERVERHELLO_TLSEXT 280
+# define SSL_F_SSL_CHECK_SRVR_ECC_CERT_AND_ALG 279
+# define SSL_F_SSL_CIPHER_PROCESS_RULESTR 230
+# define SSL_F_SSL_CIPHER_STRENGTH_SORT 231
+# define SSL_F_SSL_CLEAR 164
+# define SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD 165
+# define SSL_F_SSL_CONF_CMD 334
+# define SSL_F_SSL_CREATE_CIPHER_LIST 166
+# define SSL_F_SSL_CTRL 232
+# define SSL_F_SSL_CTX_CHECK_PRIVATE_KEY 168
+# define SSL_F_SSL_CTX_MAKE_PROFILES 309
+# define SSL_F_SSL_CTX_NEW 169
+# define SSL_F_SSL_CTX_SET_CIPHER_LIST 269
+# define SSL_F_SSL_CTX_SET_CLIENT_CERT_ENGINE 290
+# define SSL_F_SSL_CTX_SET_PURPOSE 226
+# define SSL_F_SSL_CTX_SET_SESSION_ID_CONTEXT 219
+# define SSL_F_SSL_CTX_SET_SSL_VERSION 170
+# define SSL_F_SSL_CTX_SET_TRUST 229
+# define SSL_F_SSL_CTX_USE_CERTIFICATE 171
+# define SSL_F_SSL_CTX_USE_CERTIFICATE_ASN1 172
+# define SSL_F_SSL_CTX_USE_CERTIFICATE_CHAIN_FILE 220
+# define SSL_F_SSL_CTX_USE_CERTIFICATE_FILE 173
+# define SSL_F_SSL_CTX_USE_PRIVATEKEY 174
+# define SSL_F_SSL_CTX_USE_PRIVATEKEY_ASN1 175
+# define SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE 176
+# define SSL_F_SSL_CTX_USE_PSK_IDENTITY_HINT 272
+# define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY 177
+# define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_ASN1 178
+# define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_FILE 179
+# define SSL_F_SSL_CTX_USE_SERVERINFO 336
+# define SSL_F_SSL_CTX_USE_SERVERINFO_FILE 337
+# define SSL_F_SSL_DO_HANDSHAKE 180
+# define SSL_F_SSL_GET_NEW_SESSION 181
+# define SSL_F_SSL_GET_PREV_SESSION 217
+# define SSL_F_SSL_GET_SERVER_CERT_INDEX 322
+# define SSL_F_SSL_GET_SERVER_SEND_CERT 182
+# define SSL_F_SSL_GET_SERVER_SEND_PKEY 317
+# define SSL_F_SSL_GET_SIGN_PKEY 183
+# define SSL_F_SSL_INIT_WBIO_BUFFER 184
+# define SSL_F_SSL_LOAD_CLIENT_CA_FILE 185
+# define SSL_F_SSL_NEW 186
+# define SSL_F_SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT 300
+# define SSL_F_SSL_PARSE_CLIENTHELLO_TLSEXT 302
+# define SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT 310
+# define SSL_F_SSL_PARSE_SERVERHELLO_RENEGOTIATE_EXT 301
+# define SSL_F_SSL_PARSE_SERVERHELLO_TLSEXT 303
+# define SSL_F_SSL_PARSE_SERVERHELLO_USE_SRTP_EXT 311
+# define SSL_F_SSL_PEEK 270
+# define SSL_F_SSL_PREPARE_CLIENTHELLO_TLSEXT 281
+# define SSL_F_SSL_PREPARE_SERVERHELLO_TLSEXT 282
+# define SSL_F_SSL_READ 223
+# define SSL_F_SSL_RSA_PRIVATE_DECRYPT 187
+# define SSL_F_SSL_RSA_PUBLIC_ENCRYPT 188
+# define SSL_F_SSL_SCAN_CLIENTHELLO_TLSEXT 320
+# define SSL_F_SSL_SCAN_SERVERHELLO_TLSEXT 321
+# define SSL_F_SSL_SESSION_DUP 348
+# define SSL_F_SSL_SESSION_NEW 189
+# define SSL_F_SSL_SESSION_PRINT_FP 190
+# define SSL_F_SSL_SESSION_SET1_ID_CONTEXT 312
+# define SSL_F_SSL_SESS_CERT_NEW 225
+# define SSL_F_SSL_SET_CERT 191
+# define SSL_F_SSL_SET_CIPHER_LIST 271
+# define SSL_F_SSL_SET_FD 192
+# define SSL_F_SSL_SET_PKEY 193
+# define SSL_F_SSL_SET_PURPOSE 227
+# define SSL_F_SSL_SET_RFD 194
+# define SSL_F_SSL_SET_SESSION 195
+# define SSL_F_SSL_SET_SESSION_ID_CONTEXT 218
+# define SSL_F_SSL_SET_SESSION_TICKET_EXT 294
+# define SSL_F_SSL_SET_TRUST 228
+# define SSL_F_SSL_SET_WFD 196
+# define SSL_F_SSL_SHUTDOWN 224
+# define SSL_F_SSL_SRP_CTX_INIT 313
+# define SSL_F_SSL_UNDEFINED_CONST_FUNCTION 243
+# define SSL_F_SSL_UNDEFINED_FUNCTION 197
+# define SSL_F_SSL_UNDEFINED_VOID_FUNCTION 244
+# define SSL_F_SSL_USE_CERTIFICATE 198
+# define SSL_F_SSL_USE_CERTIFICATE_ASN1 199
+# define SSL_F_SSL_USE_CERTIFICATE_FILE 200
+# define SSL_F_SSL_USE_PRIVATEKEY 201
+# define SSL_F_SSL_USE_PRIVATEKEY_ASN1 202
+# define SSL_F_SSL_USE_PRIVATEKEY_FILE 203
+# define SSL_F_SSL_USE_PSK_IDENTITY_HINT 273
+# define SSL_F_SSL_USE_RSAPRIVATEKEY 204
+# define SSL_F_SSL_USE_RSAPRIVATEKEY_ASN1 205
+# define SSL_F_SSL_USE_RSAPRIVATEKEY_FILE 206
+# define SSL_F_SSL_VERIFY_CERT_CHAIN 207
+# define SSL_F_SSL_WRITE 208
+# define SSL_F_TLS12_CHECK_PEER_SIGALG 333
+# define SSL_F_TLS1_CERT_VERIFY_MAC 286
+# define SSL_F_TLS1_CHANGE_CIPHER_STATE 209
+# define SSL_F_TLS1_CHECK_SERVERHELLO_TLSEXT 274
+# define SSL_F_TLS1_ENC 210
+# define SSL_F_TLS1_EXPORT_KEYING_MATERIAL 314
+# define SSL_F_TLS1_GET_CURVELIST 338
+# define SSL_F_TLS1_HEARTBEAT 315
+# define SSL_F_TLS1_PREPARE_CLIENTHELLO_TLSEXT 275
+# define SSL_F_TLS1_PREPARE_SERVERHELLO_TLSEXT 276
+# define SSL_F_TLS1_PRF 284
+# define SSL_F_TLS1_SETUP_KEY_BLOCK 211
+# define SSL_F_TLS1_SET_SERVER_SIGALGS 335
+# define SSL_F_WRITE_PENDING 212
+
+/* Reason codes. */
+# define SSL_R_APP_DATA_IN_HANDSHAKE 100
+# define SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT 272
+# define SSL_R_BAD_ALERT_RECORD 101
+# define SSL_R_BAD_AUTHENTICATION_TYPE 102
+# define SSL_R_BAD_CHANGE_CIPHER_SPEC 103
+# define SSL_R_BAD_CHECKSUM 104
+# define SSL_R_BAD_DATA 390
+# define SSL_R_BAD_DATA_RETURNED_BY_CALLBACK 106
+# define SSL_R_BAD_DECOMPRESSION 107
+# define SSL_R_BAD_DH_G_LENGTH 108
+# define SSL_R_BAD_DH_PUB_KEY_LENGTH 109
+# define SSL_R_BAD_DH_P_LENGTH 110
+# define SSL_R_BAD_DIGEST_LENGTH 111
+# define SSL_R_BAD_DSA_SIGNATURE 112
+# define SSL_R_BAD_ECC_CERT 304
+# define SSL_R_BAD_ECDSA_SIGNATURE 305
+# define SSL_R_BAD_ECPOINT 306
+# define SSL_R_BAD_HANDSHAKE_LENGTH 332
+# define SSL_R_BAD_HELLO_REQUEST 105
+# define SSL_R_BAD_LENGTH 271
+# define SSL_R_BAD_MAC_DECODE 113
+# define SSL_R_BAD_MAC_LENGTH 333
+# define SSL_R_BAD_MESSAGE_TYPE 114
+# define SSL_R_BAD_PACKET_LENGTH 115
+# define SSL_R_BAD_PROTOCOL_VERSION_NUMBER 116
+# define SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH 316
+# define SSL_R_BAD_RESPONSE_ARGUMENT 117
+# define SSL_R_BAD_RSA_DECRYPT 118
+# define SSL_R_BAD_RSA_ENCRYPT 119
+# define SSL_R_BAD_RSA_E_LENGTH 120
+# define SSL_R_BAD_RSA_MODULUS_LENGTH 121
+# define SSL_R_BAD_RSA_SIGNATURE 122
+# define SSL_R_BAD_SIGNATURE 123
+# define SSL_R_BAD_SRP_A_LENGTH 347
+# define SSL_R_BAD_SRP_B_LENGTH 348
+# define SSL_R_BAD_SRP_G_LENGTH 349
+# define SSL_R_BAD_SRP_N_LENGTH 350
+# define SSL_R_BAD_SRP_PARAMETERS 371
+# define SSL_R_BAD_SRP_S_LENGTH 351
+# define SSL_R_BAD_SRTP_MKI_VALUE 352
+# define SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST 353
+# define SSL_R_BAD_SSL_FILETYPE 124
+# define SSL_R_BAD_SSL_SESSION_ID_LENGTH 125
+# define SSL_R_BAD_STATE 126
+# define SSL_R_BAD_VALUE 384
+# define SSL_R_BAD_WRITE_RETRY 127
+# define SSL_R_BIO_NOT_SET 128
+# define SSL_R_BLOCK_CIPHER_PAD_IS_WRONG 129
+# define SSL_R_BN_LIB 130
+# define SSL_R_CA_DN_LENGTH_MISMATCH 131
+# define SSL_R_CA_DN_TOO_LONG 132
+# define SSL_R_CCS_RECEIVED_EARLY 133
+# define SSL_R_CERTIFICATE_VERIFY_FAILED 134
+# define SSL_R_CERT_CB_ERROR 377
+# define SSL_R_CERT_LENGTH_MISMATCH 135
+# define SSL_R_CHALLENGE_IS_DIFFERENT 136
+# define SSL_R_CIPHER_CODE_WRONG_LENGTH 137
+# define SSL_R_CIPHER_OR_HASH_UNAVAILABLE 138
+# define SSL_R_CIPHER_TABLE_SRC_ERROR 139
+# define SSL_R_CLIENTHELLO_TLSEXT 226
+# define SSL_R_COMPRESSED_LENGTH_TOO_LONG 140
+# define SSL_R_COMPRESSION_DISABLED 343
+# define SSL_R_COMPRESSION_FAILURE 141
+# define SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE 307
+# define SSL_R_COMPRESSION_LIBRARY_ERROR 142
+# define SSL_R_CONNECTION_ID_IS_DIFFERENT 143
+# define SSL_R_CONNECTION_TYPE_NOT_SET 144
+# define SSL_R_COOKIE_MISMATCH 308
+# define SSL_R_DATA_BETWEEN_CCS_AND_FINISHED 145
+# define SSL_R_DATA_LENGTH_TOO_LONG 146
+# define SSL_R_DECRYPTION_FAILED 147
+# define SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC 281
+# define SSL_R_DH_KEY_TOO_SMALL 372
+# define SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG 148
+# define SSL_R_DIGEST_CHECK_FAILED 149
+# define SSL_R_DTLS_MESSAGE_TOO_BIG 334
+# define SSL_R_DUPLICATE_COMPRESSION_ID 309
+# define SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT 317
+# define SSL_R_ECC_CERT_NOT_FOR_SIGNING 318
+# define SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE 322
+# define SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE 323
+# define SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE 374
+# define SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER 310
+# define SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST 354
+# define SSL_R_ENCRYPTED_LENGTH_TOO_LONG 150
+# define SSL_R_ERROR_GENERATING_TMP_RSA_KEY 282
+# define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST 151
+# define SSL_R_EXCESSIVE_MESSAGE_SIZE 152
+# define SSL_R_EXTRA_DATA_IN_MESSAGE 153
+# define SSL_R_GOT_A_FIN_BEFORE_A_CCS 154
+# define SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS 355
+# define SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION 356
+# define SSL_R_HTTPS_PROXY_REQUEST 155
+# define SSL_R_HTTP_REQUEST 156
+# define SSL_R_ILLEGAL_PADDING 283
+# define SSL_R_ILLEGAL_SUITEB_DIGEST 380
+# define SSL_R_INAPPROPRIATE_FALLBACK 373
+# define SSL_R_INCONSISTENT_COMPRESSION 340
+# define SSL_R_INVALID_CHALLENGE_LENGTH 158
+# define SSL_R_INVALID_COMMAND 280
+# define SSL_R_INVALID_COMPRESSION_ALGORITHM 341
+# define SSL_R_INVALID_NULL_CMD_NAME 385
+# define SSL_R_INVALID_PURPOSE 278
+# define SSL_R_INVALID_SERVERINFO_DATA 388
+# define SSL_R_INVALID_SRP_USERNAME 357
+# define SSL_R_INVALID_STATUS_RESPONSE 328
+# define SSL_R_INVALID_TICKET_KEYS_LENGTH 325
+# define SSL_R_INVALID_TRUST 279
+# define SSL_R_KEY_ARG_TOO_LONG 284
+# define SSL_R_KRB5 285
+# define SSL_R_KRB5_C_CC_PRINC 286
+# define SSL_R_KRB5_C_GET_CRED 287
+# define SSL_R_KRB5_C_INIT 288
+# define SSL_R_KRB5_C_MK_REQ 289
+# define SSL_R_KRB5_S_BAD_TICKET 290
+# define SSL_R_KRB5_S_INIT 291
+# define SSL_R_KRB5_S_RD_REQ 292
+# define SSL_R_KRB5_S_TKT_EXPIRED 293
+# define SSL_R_KRB5_S_TKT_NYV 294
+# define SSL_R_KRB5_S_TKT_SKEW 295
+# define SSL_R_LENGTH_MISMATCH 159
+# define SSL_R_LENGTH_TOO_SHORT 160
+# define SSL_R_LIBRARY_BUG 274
+# define SSL_R_LIBRARY_HAS_NO_CIPHERS 161
+# define SSL_R_MESSAGE_TOO_LONG 296
+# define SSL_R_MISSING_DH_DSA_CERT 162
+# define SSL_R_MISSING_DH_KEY 163
+# define SSL_R_MISSING_DH_RSA_CERT 164
+# define SSL_R_MISSING_DSA_SIGNING_CERT 165
+# define SSL_R_MISSING_ECDH_CERT 382
+# define SSL_R_MISSING_ECDSA_SIGNING_CERT 381
+# define SSL_R_MISSING_EXPORT_TMP_DH_KEY 166
+# define SSL_R_MISSING_EXPORT_TMP_RSA_KEY 167
+# define SSL_R_MISSING_RSA_CERTIFICATE 168
+# define SSL_R_MISSING_RSA_ENCRYPTING_CERT 169
+# define SSL_R_MISSING_RSA_SIGNING_CERT 170
+# define SSL_R_MISSING_SRP_PARAM 358
+# define SSL_R_MISSING_TMP_DH_KEY 171
+# define SSL_R_MISSING_TMP_ECDH_KEY 311
+# define SSL_R_MISSING_TMP_RSA_KEY 172
+# define SSL_R_MISSING_TMP_RSA_PKEY 173
+# define SSL_R_MISSING_VERIFY_MESSAGE 174
+# define SSL_R_MULTIPLE_SGC_RESTARTS 346
+# define SSL_R_NON_SSLV2_INITIAL_PACKET 175
+# define SSL_R_NO_CERTIFICATES_RETURNED 176
+# define SSL_R_NO_CERTIFICATE_ASSIGNED 177
+# define SSL_R_NO_CERTIFICATE_RETURNED 178
+# define SSL_R_NO_CERTIFICATE_SET 179
+# define SSL_R_NO_CERTIFICATE_SPECIFIED 180
+# define SSL_R_NO_CIPHERS_AVAILABLE 181
+# define SSL_R_NO_CIPHERS_PASSED 182
+# define SSL_R_NO_CIPHERS_SPECIFIED 183
+# define SSL_R_NO_CIPHER_LIST 184
+# define SSL_R_NO_CIPHER_MATCH 185
+# define SSL_R_NO_CLIENT_CERT_METHOD 331
+# define SSL_R_NO_CLIENT_CERT_RECEIVED 186
+# define SSL_R_NO_COMPRESSION_SPECIFIED 187
+# define SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER 330
+# define SSL_R_NO_METHOD_SPECIFIED 188
+# define SSL_R_NO_PEM_EXTENSIONS 389
+# define SSL_R_NO_PRIVATEKEY 189
+# define SSL_R_NO_PRIVATE_KEY_ASSIGNED 190
+# define SSL_R_NO_PROTOCOLS_AVAILABLE 191
+# define SSL_R_NO_PUBLICKEY 192
+# define SSL_R_NO_RENEGOTIATION 339
+# define SSL_R_NO_REQUIRED_DIGEST 324
+# define SSL_R_NO_SHARED_CIPHER 193
+# define SSL_R_NO_SHARED_SIGATURE_ALGORITHMS 376
+# define SSL_R_NO_SRTP_PROFILES 359
+# define SSL_R_NO_VERIFY_CALLBACK 194
+# define SSL_R_NULL_SSL_CTX 195
+# define SSL_R_NULL_SSL_METHOD_PASSED 196
+# define SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED 197
+# define SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED 344
+# define SSL_R_ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE 387
+# define SSL_R_ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE 379
+# define SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE 297
+# define SSL_R_OPAQUE_PRF_INPUT_TOO_LONG 327
+# define SSL_R_PACKET_LENGTH_TOO_LONG 198
+# define SSL_R_PARSE_TLSEXT 227
+# define SSL_R_PATH_TOO_LONG 270
+# define SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE 199
+# define SSL_R_PEER_ERROR 200
+# define SSL_R_PEER_ERROR_CERTIFICATE 201
+# define SSL_R_PEER_ERROR_NO_CERTIFICATE 202
+# define SSL_R_PEER_ERROR_NO_CIPHER 203
+# define SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE 204
+# define SSL_R_PEM_NAME_BAD_PREFIX 391
+# define SSL_R_PEM_NAME_TOO_SHORT 392
+# define SSL_R_PRE_MAC_LENGTH_TOO_LONG 205
+# define SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS 206
+# define SSL_R_PROTOCOL_IS_SHUTDOWN 207
+# define SSL_R_PSK_IDENTITY_NOT_FOUND 223
+# define SSL_R_PSK_NO_CLIENT_CB 224
+# define SSL_R_PSK_NO_SERVER_CB 225
+# define SSL_R_PUBLIC_KEY_ENCRYPT_ERROR 208
+# define SSL_R_PUBLIC_KEY_IS_NOT_RSA 209
+# define SSL_R_PUBLIC_KEY_NOT_RSA 210
+# define SSL_R_READ_BIO_NOT_SET 211
+# define SSL_R_READ_TIMEOUT_EXPIRED 312
+# define SSL_R_READ_WRONG_PACKET_TYPE 212
+# define SSL_R_RECORD_LENGTH_MISMATCH 213
+# define SSL_R_RECORD_TOO_LARGE 214
+# define SSL_R_RECORD_TOO_SMALL 298
+# define SSL_R_RENEGOTIATE_EXT_TOO_LONG 335
+# define SSL_R_RENEGOTIATION_ENCODING_ERR 336
+# define SSL_R_RENEGOTIATION_MISMATCH 337
+# define SSL_R_REQUIRED_CIPHER_MISSING 215
+# define SSL_R_REQUIRED_COMPRESSSION_ALGORITHM_MISSING 342
+# define SSL_R_REUSE_CERT_LENGTH_NOT_ZERO 216
+# define SSL_R_REUSE_CERT_TYPE_NOT_ZERO 217
+# define SSL_R_REUSE_CIPHER_LIST_NOT_ZERO 218
+# define SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING 345
+# define SSL_R_SERVERHELLO_TLSEXT 275
+# define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED 277
+# define SSL_R_SHORT_READ 219
+# define SSL_R_SIGNATURE_ALGORITHMS_ERROR 360
+# define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE 220
+# define SSL_R_SRP_A_CALC 361
+# define SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES 362
+# define SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG 363
+# define SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE 364
+# define SSL_R_SSL23_DOING_SESSION_ID_REUSE 221
+# define SSL_R_SSL2_CONNECTION_ID_TOO_LONG 299
+# define SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT 321
+# define SSL_R_SSL3_EXT_INVALID_SERVERNAME 319
+# define SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE 320
+# define SSL_R_SSL3_SESSION_ID_TOO_LONG 300
+# define SSL_R_SSL3_SESSION_ID_TOO_SHORT 222
+# define SSL_R_SSLV3_ALERT_BAD_CERTIFICATE 1042
+# define SSL_R_SSLV3_ALERT_BAD_RECORD_MAC 1020
+# define SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED 1045
+# define SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED 1044
+# define SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN 1046
+# define SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE 1030
+# define SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE 1040
+# define SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER 1047
+# define SSL_R_SSLV3_ALERT_NO_CERTIFICATE 1041
+# define SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE 1010
+# define SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE 1043
+# define SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION 228
+# define SSL_R_SSL_HANDSHAKE_FAILURE 229
+# define SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS 230
+# define SSL_R_SSL_SESSION_ID_CALLBACK_FAILED 301
+# define SSL_R_SSL_SESSION_ID_CONFLICT 302
+# define SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG 273
+# define SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH 303
+# define SSL_R_SSL_SESSION_ID_IS_DIFFERENT 231
+# define SSL_R_TLSV1_ALERT_ACCESS_DENIED 1049
+# define SSL_R_TLSV1_ALERT_DECODE_ERROR 1050
+# define SSL_R_TLSV1_ALERT_DECRYPTION_FAILED 1021
+# define SSL_R_TLSV1_ALERT_DECRYPT_ERROR 1051
+# define SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION 1060
+# define SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK 1086
+# define SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY 1071
+# define SSL_R_TLSV1_ALERT_INTERNAL_ERROR 1080
+# define SSL_R_TLSV1_ALERT_NO_RENEGOTIATION 1100
+# define SSL_R_TLSV1_ALERT_PROTOCOL_VERSION 1070
+# define SSL_R_TLSV1_ALERT_RECORD_OVERFLOW 1022
+# define SSL_R_TLSV1_ALERT_UNKNOWN_CA 1048
+# define SSL_R_TLSV1_ALERT_USER_CANCELLED 1090
+# define SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE 1114
+# define SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE 1113
+# define SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE 1111
+# define SSL_R_TLSV1_UNRECOGNIZED_NAME 1112
+# define SSL_R_TLSV1_UNSUPPORTED_EXTENSION 1110
+# define SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER 232
+# define SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT 365
+# define SSL_R_TLS_HEARTBEAT_PENDING 366
+# define SSL_R_TLS_ILLEGAL_EXPORTER_LABEL 367
+# define SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST 157
+# define SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST 233
+# define SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG 234
+# define SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER 235
+# define SSL_R_UNABLE_TO_DECODE_DH_CERTS 236
+# define SSL_R_UNABLE_TO_DECODE_ECDH_CERTS 313
+# define SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY 237
+# define SSL_R_UNABLE_TO_FIND_DH_PARAMETERS 238
+# define SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS 314
+# define SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS 239
+# define SSL_R_UNABLE_TO_FIND_SSL_METHOD 240
+# define SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES 241
+# define SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES 242
+# define SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES 243
+# define SSL_R_UNEXPECTED_MESSAGE 244
+# define SSL_R_UNEXPECTED_RECORD 245
+# define SSL_R_UNINITIALIZED 276
+# define SSL_R_UNKNOWN_ALERT_TYPE 246
+# define SSL_R_UNKNOWN_CERTIFICATE_TYPE 247
+# define SSL_R_UNKNOWN_CIPHER_RETURNED 248
+# define SSL_R_UNKNOWN_CIPHER_TYPE 249
+# define SSL_R_UNKNOWN_CMD_NAME 386
+# define SSL_R_UNKNOWN_DIGEST 368
+# define SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE 250
+# define SSL_R_UNKNOWN_PKEY_TYPE 251
+# define SSL_R_UNKNOWN_PROTOCOL 252
+# define SSL_R_UNKNOWN_REMOTE_ERROR_TYPE 253
+# define SSL_R_UNKNOWN_SSL_VERSION 254
+# define SSL_R_UNKNOWN_STATE 255
+# define SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED 338
+# define SSL_R_UNSUPPORTED_CIPHER 256
+# define SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM 257
+# define SSL_R_UNSUPPORTED_DIGEST_TYPE 326
+# define SSL_R_UNSUPPORTED_ELLIPTIC_CURVE 315
+# define SSL_R_UNSUPPORTED_PROTOCOL 258
+# define SSL_R_UNSUPPORTED_SSL_VERSION 259
+# define SSL_R_UNSUPPORTED_STATUS_TYPE 329
+# define SSL_R_USE_SRTP_NOT_NEGOTIATED 369
+# define SSL_R_WRITE_BIO_NOT_SET 260
+# define SSL_R_WRONG_CERTIFICATE_TYPE 383
+# define SSL_R_WRONG_CIPHER_RETURNED 261
+# define SSL_R_WRONG_CURVE 378
+# define SSL_R_WRONG_MESSAGE_TYPE 262
+# define SSL_R_WRONG_NUMBER_OF_KEY_BITS 263
+# define SSL_R_WRONG_SIGNATURE_LENGTH 264
+# define SSL_R_WRONG_SIGNATURE_SIZE 265
+# define SSL_R_WRONG_SIGNATURE_TYPE 370
+# define SSL_R_WRONG_SSL_VERSION 266
+# define SSL_R_WRONG_VERSION_NUMBER 267
+# define SSL_R_X509_LIB 268
+# define SSL_R_X509_VERIFICATION_SETUP_PROBLEMS 269
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/ssl2.h b/protocols/Telegram/tgl/openssl/include/openssl/ssl2.h
new file mode 100644
index 0000000000..03c7dd8cac
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/ssl2.h
@@ -0,0 +1,265 @@
+/* ssl/ssl2.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_SSL2_H
+# define HEADER_SSL2_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Protocol Version Codes */
+# define SSL2_VERSION 0x0002
+# define SSL2_VERSION_MAJOR 0x00
+# define SSL2_VERSION_MINOR 0x02
+/* #define SSL2_CLIENT_VERSION 0x0002 */
+/* #define SSL2_SERVER_VERSION 0x0002 */
+
+/* Protocol Message Codes */
+# define SSL2_MT_ERROR 0
+# define SSL2_MT_CLIENT_HELLO 1
+# define SSL2_MT_CLIENT_MASTER_KEY 2
+# define SSL2_MT_CLIENT_FINISHED 3
+# define SSL2_MT_SERVER_HELLO 4
+# define SSL2_MT_SERVER_VERIFY 5
+# define SSL2_MT_SERVER_FINISHED 6
+# define SSL2_MT_REQUEST_CERTIFICATE 7
+# define SSL2_MT_CLIENT_CERTIFICATE 8
+
+/* Error Message Codes */
+# define SSL2_PE_UNDEFINED_ERROR 0x0000
+# define SSL2_PE_NO_CIPHER 0x0001
+# define SSL2_PE_NO_CERTIFICATE 0x0002
+# define SSL2_PE_BAD_CERTIFICATE 0x0004
+# define SSL2_PE_UNSUPPORTED_CERTIFICATE_TYPE 0x0006
+
+/* Cipher Kind Values */
+# define SSL2_CK_NULL_WITH_MD5 0x02000000/* v3 */
+# define SSL2_CK_RC4_128_WITH_MD5 0x02010080
+# define SSL2_CK_RC4_128_EXPORT40_WITH_MD5 0x02020080
+# define SSL2_CK_RC2_128_CBC_WITH_MD5 0x02030080
+# define SSL2_CK_RC2_128_CBC_EXPORT40_WITH_MD5 0x02040080
+# define SSL2_CK_IDEA_128_CBC_WITH_MD5 0x02050080
+# define SSL2_CK_DES_64_CBC_WITH_MD5 0x02060040
+# define SSL2_CK_DES_64_CBC_WITH_SHA 0x02060140/* v3 */
+# define SSL2_CK_DES_192_EDE3_CBC_WITH_MD5 0x020700c0
+# define SSL2_CK_DES_192_EDE3_CBC_WITH_SHA 0x020701c0/* v3 */
+# define SSL2_CK_RC4_64_WITH_MD5 0x02080080/* MS hack */
+
+# define SSL2_CK_DES_64_CFB64_WITH_MD5_1 0x02ff0800/* SSLeay */
+# define SSL2_CK_NULL 0x02ff0810/* SSLeay */
+
+# define SSL2_TXT_DES_64_CFB64_WITH_MD5_1 "DES-CFB-M1"
+# define SSL2_TXT_NULL_WITH_MD5 "NULL-MD5"
+# define SSL2_TXT_RC4_128_WITH_MD5 "RC4-MD5"
+# define SSL2_TXT_RC4_128_EXPORT40_WITH_MD5 "EXP-RC4-MD5"
+# define SSL2_TXT_RC2_128_CBC_WITH_MD5 "RC2-CBC-MD5"
+# define SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 "EXP-RC2-CBC-MD5"
+# define SSL2_TXT_IDEA_128_CBC_WITH_MD5 "IDEA-CBC-MD5"
+# define SSL2_TXT_DES_64_CBC_WITH_MD5 "DES-CBC-MD5"
+# define SSL2_TXT_DES_64_CBC_WITH_SHA "DES-CBC-SHA"
+# define SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5 "DES-CBC3-MD5"
+# define SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA "DES-CBC3-SHA"
+# define SSL2_TXT_RC4_64_WITH_MD5 "RC4-64-MD5"
+
+# define SSL2_TXT_NULL "NULL"
+
+/* Flags for the SSL_CIPHER.algorithm2 field */
+# define SSL2_CF_5_BYTE_ENC 0x01
+# define SSL2_CF_8_BYTE_ENC 0x02
+
+/* Certificate Type Codes */
+# define SSL2_CT_X509_CERTIFICATE 0x01
+
+/* Authentication Type Code */
+# define SSL2_AT_MD5_WITH_RSA_ENCRYPTION 0x01
+
+# define SSL2_MAX_SSL_SESSION_ID_LENGTH 32
+
+/* Upper/Lower Bounds */
+# define SSL2_MAX_MASTER_KEY_LENGTH_IN_BITS 256
+# ifdef OPENSSL_SYS_MPE
+# define SSL2_MAX_RECORD_LENGTH_2_BYTE_HEADER 29998u
+# else
+# define SSL2_MAX_RECORD_LENGTH_2_BYTE_HEADER 32767u
+ /* 2^15-1 */
+# endif
+# define SSL2_MAX_RECORD_LENGTH_3_BYTE_HEADER 16383/* 2^14-1 */
+
+# define SSL2_CHALLENGE_LENGTH 16
+/*
+ * #define SSL2_CHALLENGE_LENGTH 32
+ */
+# define SSL2_MIN_CHALLENGE_LENGTH 16
+# define SSL2_MAX_CHALLENGE_LENGTH 32
+# define SSL2_CONNECTION_ID_LENGTH 16
+# define SSL2_MAX_CONNECTION_ID_LENGTH 16
+# define SSL2_SSL_SESSION_ID_LENGTH 16
+# define SSL2_MAX_CERT_CHALLENGE_LENGTH 32
+# define SSL2_MIN_CERT_CHALLENGE_LENGTH 16
+# define SSL2_MAX_KEY_MATERIAL_LENGTH 24
+
+# ifndef HEADER_SSL_LOCL_H
+# define CERT char
+# endif
+
+# ifndef OPENSSL_NO_SSL_INTERN
+
+typedef struct ssl2_state_st {
+ int three_byte_header;
+ int clear_text; /* clear text */
+ int escape; /* not used in SSLv2 */
+ int ssl2_rollback; /* used if SSLv23 rolled back to SSLv2 */
+ /*
+ * non-blocking io info, used to make sure the same args were passwd
+ */
+ unsigned int wnum; /* number of bytes sent so far */
+ int wpend_tot;
+ const unsigned char *wpend_buf;
+ int wpend_off; /* offset to data to write */
+ int wpend_len; /* number of bytes passwd to write */
+ int wpend_ret; /* number of bytes to return to caller */
+ /* buffer raw data */
+ int rbuf_left;
+ int rbuf_offs;
+ unsigned char *rbuf;
+ unsigned char *wbuf;
+ unsigned char *write_ptr; /* used to point to the start due to 2/3 byte
+ * header. */
+ unsigned int padding;
+ unsigned int rlength; /* passed to ssl2_enc */
+ int ract_data_length; /* Set when things are encrypted. */
+ unsigned int wlength; /* passed to ssl2_enc */
+ int wact_data_length; /* Set when things are decrypted. */
+ unsigned char *ract_data;
+ unsigned char *wact_data;
+ unsigned char *mac_data;
+ unsigned char *read_key;
+ unsigned char *write_key;
+ /* Stuff specifically to do with this SSL session */
+ unsigned int challenge_length;
+ unsigned char challenge[SSL2_MAX_CHALLENGE_LENGTH];
+ unsigned int conn_id_length;
+ unsigned char conn_id[SSL2_MAX_CONNECTION_ID_LENGTH];
+ unsigned int key_material_length;
+ unsigned char key_material[SSL2_MAX_KEY_MATERIAL_LENGTH * 2];
+ unsigned long read_sequence;
+ unsigned long write_sequence;
+ struct {
+ unsigned int conn_id_length;
+ unsigned int cert_type;
+ unsigned int cert_length;
+ unsigned int csl;
+ unsigned int clear;
+ unsigned int enc;
+ unsigned char ccl[SSL2_MAX_CERT_CHALLENGE_LENGTH];
+ unsigned int cipher_spec_length;
+ unsigned int session_id_length;
+ unsigned int clen;
+ unsigned int rlen;
+ } tmp;
+} SSL2_STATE;
+
+# endif
+
+/* SSLv2 */
+/* client */
+# define SSL2_ST_SEND_CLIENT_HELLO_A (0x10|SSL_ST_CONNECT)
+# define SSL2_ST_SEND_CLIENT_HELLO_B (0x11|SSL_ST_CONNECT)
+# define SSL2_ST_GET_SERVER_HELLO_A (0x20|SSL_ST_CONNECT)
+# define SSL2_ST_GET_SERVER_HELLO_B (0x21|SSL_ST_CONNECT)
+# define SSL2_ST_SEND_CLIENT_MASTER_KEY_A (0x30|SSL_ST_CONNECT)
+# define SSL2_ST_SEND_CLIENT_MASTER_KEY_B (0x31|SSL_ST_CONNECT)
+# define SSL2_ST_SEND_CLIENT_FINISHED_A (0x40|SSL_ST_CONNECT)
+# define SSL2_ST_SEND_CLIENT_FINISHED_B (0x41|SSL_ST_CONNECT)
+# define SSL2_ST_SEND_CLIENT_CERTIFICATE_A (0x50|SSL_ST_CONNECT)
+# define SSL2_ST_SEND_CLIENT_CERTIFICATE_B (0x51|SSL_ST_CONNECT)
+# define SSL2_ST_SEND_CLIENT_CERTIFICATE_C (0x52|SSL_ST_CONNECT)
+# define SSL2_ST_SEND_CLIENT_CERTIFICATE_D (0x53|SSL_ST_CONNECT)
+# define SSL2_ST_GET_SERVER_VERIFY_A (0x60|SSL_ST_CONNECT)
+# define SSL2_ST_GET_SERVER_VERIFY_B (0x61|SSL_ST_CONNECT)
+# define SSL2_ST_GET_SERVER_FINISHED_A (0x70|SSL_ST_CONNECT)
+# define SSL2_ST_GET_SERVER_FINISHED_B (0x71|SSL_ST_CONNECT)
+# define SSL2_ST_CLIENT_START_ENCRYPTION (0x80|SSL_ST_CONNECT)
+# define SSL2_ST_X509_GET_CLIENT_CERTIFICATE (0x90|SSL_ST_CONNECT)
+/* server */
+# define SSL2_ST_GET_CLIENT_HELLO_A (0x10|SSL_ST_ACCEPT)
+# define SSL2_ST_GET_CLIENT_HELLO_B (0x11|SSL_ST_ACCEPT)
+# define SSL2_ST_GET_CLIENT_HELLO_C (0x12|SSL_ST_ACCEPT)
+# define SSL2_ST_SEND_SERVER_HELLO_A (0x20|SSL_ST_ACCEPT)
+# define SSL2_ST_SEND_SERVER_HELLO_B (0x21|SSL_ST_ACCEPT)
+# define SSL2_ST_GET_CLIENT_MASTER_KEY_A (0x30|SSL_ST_ACCEPT)
+# define SSL2_ST_GET_CLIENT_MASTER_KEY_B (0x31|SSL_ST_ACCEPT)
+# define SSL2_ST_SEND_SERVER_VERIFY_A (0x40|SSL_ST_ACCEPT)
+# define SSL2_ST_SEND_SERVER_VERIFY_B (0x41|SSL_ST_ACCEPT)
+# define SSL2_ST_SEND_SERVER_VERIFY_C (0x42|SSL_ST_ACCEPT)
+# define SSL2_ST_GET_CLIENT_FINISHED_A (0x50|SSL_ST_ACCEPT)
+# define SSL2_ST_GET_CLIENT_FINISHED_B (0x51|SSL_ST_ACCEPT)
+# define SSL2_ST_SEND_SERVER_FINISHED_A (0x60|SSL_ST_ACCEPT)
+# define SSL2_ST_SEND_SERVER_FINISHED_B (0x61|SSL_ST_ACCEPT)
+# define SSL2_ST_SEND_REQUEST_CERTIFICATE_A (0x70|SSL_ST_ACCEPT)
+# define SSL2_ST_SEND_REQUEST_CERTIFICATE_B (0x71|SSL_ST_ACCEPT)
+# define SSL2_ST_SEND_REQUEST_CERTIFICATE_C (0x72|SSL_ST_ACCEPT)
+# define SSL2_ST_SEND_REQUEST_CERTIFICATE_D (0x73|SSL_ST_ACCEPT)
+# define SSL2_ST_SERVER_START_ENCRYPTION (0x80|SSL_ST_ACCEPT)
+# define SSL2_ST_X509_GET_SERVER_CERTIFICATE (0x90|SSL_ST_ACCEPT)
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/ssl23.h b/protocols/Telegram/tgl/openssl/include/openssl/ssl23.h
new file mode 100644
index 0000000000..9de4685af9
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/ssl23.h
@@ -0,0 +1,84 @@
+/* ssl/ssl23.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_SSL23_H
+# define HEADER_SSL23_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * client
+ */
+/* write to server */
+# define SSL23_ST_CW_CLNT_HELLO_A (0x210|SSL_ST_CONNECT)
+# define SSL23_ST_CW_CLNT_HELLO_B (0x211|SSL_ST_CONNECT)
+/* read from server */
+# define SSL23_ST_CR_SRVR_HELLO_A (0x220|SSL_ST_CONNECT)
+# define SSL23_ST_CR_SRVR_HELLO_B (0x221|SSL_ST_CONNECT)
+
+/* server */
+/* read from client */
+# define SSL23_ST_SR_CLNT_HELLO_A (0x210|SSL_ST_ACCEPT)
+# define SSL23_ST_SR_CLNT_HELLO_B (0x211|SSL_ST_ACCEPT)
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/ssl3.h b/protocols/Telegram/tgl/openssl/include/openssl/ssl3.h
new file mode 100644
index 0000000000..e681d50a9e
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/ssl3.h
@@ -0,0 +1,774 @@
+/* ssl/ssl3.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+/* ====================================================================
+ * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+/* ====================================================================
+ * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
+ * ECC cipher suite support in OpenSSL originally developed by
+ * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
+ */
+
+#ifndef HEADER_SSL3_H
+# define HEADER_SSL3_H
+
+# ifndef OPENSSL_NO_COMP
+# include <openssl/comp.h>
+# endif
+# include <openssl/buffer.h>
+# include <openssl/evp.h>
+# include <openssl/ssl.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Signalling cipher suite value from RFC 5746
+ * (TLS_EMPTY_RENEGOTIATION_INFO_SCSV)
+ */
+# define SSL3_CK_SCSV 0x030000FF
+
+/*
+ * Signalling cipher suite value from draft-ietf-tls-downgrade-scsv-00
+ * (TLS_FALLBACK_SCSV)
+ */
+# define SSL3_CK_FALLBACK_SCSV 0x03005600
+
+# define SSL3_CK_RSA_NULL_MD5 0x03000001
+# define SSL3_CK_RSA_NULL_SHA 0x03000002
+# define SSL3_CK_RSA_RC4_40_MD5 0x03000003
+# define SSL3_CK_RSA_RC4_128_MD5 0x03000004
+# define SSL3_CK_RSA_RC4_128_SHA 0x03000005
+# define SSL3_CK_RSA_RC2_40_MD5 0x03000006
+# define SSL3_CK_RSA_IDEA_128_SHA 0x03000007
+# define SSL3_CK_RSA_DES_40_CBC_SHA 0x03000008
+# define SSL3_CK_RSA_DES_64_CBC_SHA 0x03000009
+# define SSL3_CK_RSA_DES_192_CBC3_SHA 0x0300000A
+
+# define SSL3_CK_DH_DSS_DES_40_CBC_SHA 0x0300000B
+# define SSL3_CK_DH_DSS_DES_64_CBC_SHA 0x0300000C
+# define SSL3_CK_DH_DSS_DES_192_CBC3_SHA 0x0300000D
+# define SSL3_CK_DH_RSA_DES_40_CBC_SHA 0x0300000E
+# define SSL3_CK_DH_RSA_DES_64_CBC_SHA 0x0300000F
+# define SSL3_CK_DH_RSA_DES_192_CBC3_SHA 0x03000010
+
+# define SSL3_CK_EDH_DSS_DES_40_CBC_SHA 0x03000011
+# define SSL3_CK_DHE_DSS_DES_40_CBC_SHA SSL3_CK_EDH_DSS_DES_40_CBC_SHA
+# define SSL3_CK_EDH_DSS_DES_64_CBC_SHA 0x03000012
+# define SSL3_CK_DHE_DSS_DES_64_CBC_SHA SSL3_CK_EDH_DSS_DES_64_CBC_SHA
+# define SSL3_CK_EDH_DSS_DES_192_CBC3_SHA 0x03000013
+# define SSL3_CK_DHE_DSS_DES_192_CBC3_SHA SSL3_CK_EDH_DSS_DES_192_CBC3_SHA
+# define SSL3_CK_EDH_RSA_DES_40_CBC_SHA 0x03000014
+# define SSL3_CK_DHE_RSA_DES_40_CBC_SHA SSL3_CK_EDH_RSA_DES_40_CBC_SHA
+# define SSL3_CK_EDH_RSA_DES_64_CBC_SHA 0x03000015
+# define SSL3_CK_DHE_RSA_DES_64_CBC_SHA SSL3_CK_EDH_RSA_DES_64_CBC_SHA
+# define SSL3_CK_EDH_RSA_DES_192_CBC3_SHA 0x03000016
+# define SSL3_CK_DHE_RSA_DES_192_CBC3_SHA SSL3_CK_EDH_RSA_DES_192_CBC3_SHA
+
+# define SSL3_CK_ADH_RC4_40_MD5 0x03000017
+# define SSL3_CK_ADH_RC4_128_MD5 0x03000018
+# define SSL3_CK_ADH_DES_40_CBC_SHA 0x03000019
+# define SSL3_CK_ADH_DES_64_CBC_SHA 0x0300001A
+# define SSL3_CK_ADH_DES_192_CBC_SHA 0x0300001B
+
+# if 0
+# define SSL3_CK_FZA_DMS_NULL_SHA 0x0300001C
+# define SSL3_CK_FZA_DMS_FZA_SHA 0x0300001D
+# if 0 /* Because it clashes with KRB5, is never
+ * used any more, and is safe to remove
+ * according to David Hopwood
+ * <david.hopwood@zetnet.co.uk> of the
+ * ietf-tls list */
+# define SSL3_CK_FZA_DMS_RC4_SHA 0x0300001E
+# endif
+# endif
+
+/*
+ * VRS Additional Kerberos5 entries
+ */
+# define SSL3_CK_KRB5_DES_64_CBC_SHA 0x0300001E
+# define SSL3_CK_KRB5_DES_192_CBC3_SHA 0x0300001F
+# define SSL3_CK_KRB5_RC4_128_SHA 0x03000020
+# define SSL3_CK_KRB5_IDEA_128_CBC_SHA 0x03000021
+# define SSL3_CK_KRB5_DES_64_CBC_MD5 0x03000022
+# define SSL3_CK_KRB5_DES_192_CBC3_MD5 0x03000023
+# define SSL3_CK_KRB5_RC4_128_MD5 0x03000024
+# define SSL3_CK_KRB5_IDEA_128_CBC_MD5 0x03000025
+
+# define SSL3_CK_KRB5_DES_40_CBC_SHA 0x03000026
+# define SSL3_CK_KRB5_RC2_40_CBC_SHA 0x03000027
+# define SSL3_CK_KRB5_RC4_40_SHA 0x03000028
+# define SSL3_CK_KRB5_DES_40_CBC_MD5 0x03000029
+# define SSL3_CK_KRB5_RC2_40_CBC_MD5 0x0300002A
+# define SSL3_CK_KRB5_RC4_40_MD5 0x0300002B
+
+# define SSL3_TXT_RSA_NULL_MD5 "NULL-MD5"
+# define SSL3_TXT_RSA_NULL_SHA "NULL-SHA"
+# define SSL3_TXT_RSA_RC4_40_MD5 "EXP-RC4-MD5"
+# define SSL3_TXT_RSA_RC4_128_MD5 "RC4-MD5"
+# define SSL3_TXT_RSA_RC4_128_SHA "RC4-SHA"
+# define SSL3_TXT_RSA_RC2_40_MD5 "EXP-RC2-CBC-MD5"
+# define SSL3_TXT_RSA_IDEA_128_SHA "IDEA-CBC-SHA"
+# define SSL3_TXT_RSA_DES_40_CBC_SHA "EXP-DES-CBC-SHA"
+# define SSL3_TXT_RSA_DES_64_CBC_SHA "DES-CBC-SHA"
+# define SSL3_TXT_RSA_DES_192_CBC3_SHA "DES-CBC3-SHA"
+
+# define SSL3_TXT_DH_DSS_DES_40_CBC_SHA "EXP-DH-DSS-DES-CBC-SHA"
+# define SSL3_TXT_DH_DSS_DES_64_CBC_SHA "DH-DSS-DES-CBC-SHA"
+# define SSL3_TXT_DH_DSS_DES_192_CBC3_SHA "DH-DSS-DES-CBC3-SHA"
+# define SSL3_TXT_DH_RSA_DES_40_CBC_SHA "EXP-DH-RSA-DES-CBC-SHA"
+# define SSL3_TXT_DH_RSA_DES_64_CBC_SHA "DH-RSA-DES-CBC-SHA"
+# define SSL3_TXT_DH_RSA_DES_192_CBC3_SHA "DH-RSA-DES-CBC3-SHA"
+
+# define SSL3_TXT_DHE_DSS_DES_40_CBC_SHA "EXP-DHE-DSS-DES-CBC-SHA"
+# define SSL3_TXT_DHE_DSS_DES_64_CBC_SHA "DHE-DSS-DES-CBC-SHA"
+# define SSL3_TXT_DHE_DSS_DES_192_CBC3_SHA "DHE-DSS-DES-CBC3-SHA"
+# define SSL3_TXT_DHE_RSA_DES_40_CBC_SHA "EXP-DHE-RSA-DES-CBC-SHA"
+# define SSL3_TXT_DHE_RSA_DES_64_CBC_SHA "DHE-RSA-DES-CBC-SHA"
+# define SSL3_TXT_DHE_RSA_DES_192_CBC3_SHA "DHE-RSA-DES-CBC3-SHA"
+
+/*
+ * This next block of six "EDH" labels is for backward compatibility with
+ * older versions of OpenSSL. New code should use the six "DHE" labels above
+ * instead:
+ */
+# define SSL3_TXT_EDH_DSS_DES_40_CBC_SHA "EXP-EDH-DSS-DES-CBC-SHA"
+# define SSL3_TXT_EDH_DSS_DES_64_CBC_SHA "EDH-DSS-DES-CBC-SHA"
+# define SSL3_TXT_EDH_DSS_DES_192_CBC3_SHA "EDH-DSS-DES-CBC3-SHA"
+# define SSL3_TXT_EDH_RSA_DES_40_CBC_SHA "EXP-EDH-RSA-DES-CBC-SHA"
+# define SSL3_TXT_EDH_RSA_DES_64_CBC_SHA "EDH-RSA-DES-CBC-SHA"
+# define SSL3_TXT_EDH_RSA_DES_192_CBC3_SHA "EDH-RSA-DES-CBC3-SHA"
+
+# define SSL3_TXT_ADH_RC4_40_MD5 "EXP-ADH-RC4-MD5"
+# define SSL3_TXT_ADH_RC4_128_MD5 "ADH-RC4-MD5"
+# define SSL3_TXT_ADH_DES_40_CBC_SHA "EXP-ADH-DES-CBC-SHA"
+# define SSL3_TXT_ADH_DES_64_CBC_SHA "ADH-DES-CBC-SHA"
+# define SSL3_TXT_ADH_DES_192_CBC_SHA "ADH-DES-CBC3-SHA"
+
+# if 0
+# define SSL3_TXT_FZA_DMS_NULL_SHA "FZA-NULL-SHA"
+# define SSL3_TXT_FZA_DMS_FZA_SHA "FZA-FZA-CBC-SHA"
+# define SSL3_TXT_FZA_DMS_RC4_SHA "FZA-RC4-SHA"
+# endif
+
+# define SSL3_TXT_KRB5_DES_64_CBC_SHA "KRB5-DES-CBC-SHA"
+# define SSL3_TXT_KRB5_DES_192_CBC3_SHA "KRB5-DES-CBC3-SHA"
+# define SSL3_TXT_KRB5_RC4_128_SHA "KRB5-RC4-SHA"
+# define SSL3_TXT_KRB5_IDEA_128_CBC_SHA "KRB5-IDEA-CBC-SHA"
+# define SSL3_TXT_KRB5_DES_64_CBC_MD5 "KRB5-DES-CBC-MD5"
+# define SSL3_TXT_KRB5_DES_192_CBC3_MD5 "KRB5-DES-CBC3-MD5"
+# define SSL3_TXT_KRB5_RC4_128_MD5 "KRB5-RC4-MD5"
+# define SSL3_TXT_KRB5_IDEA_128_CBC_MD5 "KRB5-IDEA-CBC-MD5"
+
+# define SSL3_TXT_KRB5_DES_40_CBC_SHA "EXP-KRB5-DES-CBC-SHA"
+# define SSL3_TXT_KRB5_RC2_40_CBC_SHA "EXP-KRB5-RC2-CBC-SHA"
+# define SSL3_TXT_KRB5_RC4_40_SHA "EXP-KRB5-RC4-SHA"
+# define SSL3_TXT_KRB5_DES_40_CBC_MD5 "EXP-KRB5-DES-CBC-MD5"
+# define SSL3_TXT_KRB5_RC2_40_CBC_MD5 "EXP-KRB5-RC2-CBC-MD5"
+# define SSL3_TXT_KRB5_RC4_40_MD5 "EXP-KRB5-RC4-MD5"
+
+# define SSL3_SSL_SESSION_ID_LENGTH 32
+# define SSL3_MAX_SSL_SESSION_ID_LENGTH 32
+
+# define SSL3_MASTER_SECRET_SIZE 48
+# define SSL3_RANDOM_SIZE 32
+# define SSL3_SESSION_ID_SIZE 32
+# define SSL3_RT_HEADER_LENGTH 5
+
+# define SSL3_HM_HEADER_LENGTH 4
+
+# ifndef SSL3_ALIGN_PAYLOAD
+ /*
+ * Some will argue that this increases memory footprint, but it's not
+ * actually true. Point is that malloc has to return at least 64-bit aligned
+ * pointers, meaning that allocating 5 bytes wastes 3 bytes in either case.
+ * Suggested pre-gaping simply moves these wasted bytes from the end of
+ * allocated region to its front, but makes data payload aligned, which
+ * improves performance:-)
+ */
+# define SSL3_ALIGN_PAYLOAD 8
+# else
+# if (SSL3_ALIGN_PAYLOAD&(SSL3_ALIGN_PAYLOAD-1))!=0
+# error "insane SSL3_ALIGN_PAYLOAD"
+# undef SSL3_ALIGN_PAYLOAD
+# endif
+# endif
+
+/*
+ * This is the maximum MAC (digest) size used by the SSL library. Currently
+ * maximum of 20 is used by SHA1, but we reserve for future extension for
+ * 512-bit hashes.
+ */
+
+# define SSL3_RT_MAX_MD_SIZE 64
+
+/*
+ * Maximum block size used in all ciphersuites. Currently 16 for AES.
+ */
+
+# define SSL_RT_MAX_CIPHER_BLOCK_SIZE 16
+
+# define SSL3_RT_MAX_EXTRA (16384)
+
+/* Maximum plaintext length: defined by SSL/TLS standards */
+# define SSL3_RT_MAX_PLAIN_LENGTH 16384
+/* Maximum compression overhead: defined by SSL/TLS standards */
+# define SSL3_RT_MAX_COMPRESSED_OVERHEAD 1024
+
+/*
+ * The standards give a maximum encryption overhead of 1024 bytes. In
+ * practice the value is lower than this. The overhead is the maximum number
+ * of padding bytes (256) plus the mac size.
+ */
+# define SSL3_RT_MAX_ENCRYPTED_OVERHEAD (256 + SSL3_RT_MAX_MD_SIZE)
+
+/*
+ * OpenSSL currently only uses a padding length of at most one block so the
+ * send overhead is smaller.
+ */
+
+# define SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD \
+ (SSL_RT_MAX_CIPHER_BLOCK_SIZE + SSL3_RT_MAX_MD_SIZE)
+
+/* If compression isn't used don't include the compression overhead */
+
+# ifdef OPENSSL_NO_COMP
+# define SSL3_RT_MAX_COMPRESSED_LENGTH SSL3_RT_MAX_PLAIN_LENGTH
+# else
+# define SSL3_RT_MAX_COMPRESSED_LENGTH \
+ (SSL3_RT_MAX_PLAIN_LENGTH+SSL3_RT_MAX_COMPRESSED_OVERHEAD)
+# endif
+# define SSL3_RT_MAX_ENCRYPTED_LENGTH \
+ (SSL3_RT_MAX_ENCRYPTED_OVERHEAD+SSL3_RT_MAX_COMPRESSED_LENGTH)
+# define SSL3_RT_MAX_PACKET_SIZE \
+ (SSL3_RT_MAX_ENCRYPTED_LENGTH+SSL3_RT_HEADER_LENGTH)
+
+# define SSL3_MD_CLIENT_FINISHED_CONST "\x43\x4C\x4E\x54"
+# define SSL3_MD_SERVER_FINISHED_CONST "\x53\x52\x56\x52"
+
+# define SSL3_VERSION 0x0300
+# define SSL3_VERSION_MAJOR 0x03
+# define SSL3_VERSION_MINOR 0x00
+
+# define SSL3_RT_CHANGE_CIPHER_SPEC 20
+# define SSL3_RT_ALERT 21
+# define SSL3_RT_HANDSHAKE 22
+# define SSL3_RT_APPLICATION_DATA 23
+# define TLS1_RT_HEARTBEAT 24
+
+/* Pseudo content types to indicate additional parameters */
+# define TLS1_RT_CRYPTO 0x1000
+# define TLS1_RT_CRYPTO_PREMASTER (TLS1_RT_CRYPTO | 0x1)
+# define TLS1_RT_CRYPTO_CLIENT_RANDOM (TLS1_RT_CRYPTO | 0x2)
+# define TLS1_RT_CRYPTO_SERVER_RANDOM (TLS1_RT_CRYPTO | 0x3)
+# define TLS1_RT_CRYPTO_MASTER (TLS1_RT_CRYPTO | 0x4)
+
+# define TLS1_RT_CRYPTO_READ 0x0000
+# define TLS1_RT_CRYPTO_WRITE 0x0100
+# define TLS1_RT_CRYPTO_MAC (TLS1_RT_CRYPTO | 0x5)
+# define TLS1_RT_CRYPTO_KEY (TLS1_RT_CRYPTO | 0x6)
+# define TLS1_RT_CRYPTO_IV (TLS1_RT_CRYPTO | 0x7)
+# define TLS1_RT_CRYPTO_FIXED_IV (TLS1_RT_CRYPTO | 0x8)
+
+/* Pseudo content type for SSL/TLS header info */
+# define SSL3_RT_HEADER 0x100
+
+# define SSL3_AL_WARNING 1
+# define SSL3_AL_FATAL 2
+
+# define SSL3_AD_CLOSE_NOTIFY 0
+# define SSL3_AD_UNEXPECTED_MESSAGE 10/* fatal */
+# define SSL3_AD_BAD_RECORD_MAC 20/* fatal */
+# define SSL3_AD_DECOMPRESSION_FAILURE 30/* fatal */
+# define SSL3_AD_HANDSHAKE_FAILURE 40/* fatal */
+# define SSL3_AD_NO_CERTIFICATE 41
+# define SSL3_AD_BAD_CERTIFICATE 42
+# define SSL3_AD_UNSUPPORTED_CERTIFICATE 43
+# define SSL3_AD_CERTIFICATE_REVOKED 44
+# define SSL3_AD_CERTIFICATE_EXPIRED 45
+# define SSL3_AD_CERTIFICATE_UNKNOWN 46
+# define SSL3_AD_ILLEGAL_PARAMETER 47/* fatal */
+
+# define TLS1_HB_REQUEST 1
+# define TLS1_HB_RESPONSE 2
+
+# ifndef OPENSSL_NO_SSL_INTERN
+
+typedef struct ssl3_record_st {
+ /* type of record */
+ /*
+ * r
+ */ int type;
+ /* How many bytes available */
+ /*
+ * rw
+ */ unsigned int length;
+ /* read/write offset into 'buf' */
+ /*
+ * r
+ */ unsigned int off;
+ /* pointer to the record data */
+ /*
+ * rw
+ */ unsigned char *data;
+ /* where the decode bytes are */
+ /*
+ * rw
+ */ unsigned char *input;
+ /* only used with decompression - malloc()ed */
+ /*
+ * r
+ */ unsigned char *comp;
+ /* epoch number, needed by DTLS1 */
+ /*
+ * r
+ */ unsigned long epoch;
+ /* sequence number, needed by DTLS1 */
+ /*
+ * r
+ */ unsigned char seq_num[8];
+} SSL3_RECORD;
+
+typedef struct ssl3_buffer_st {
+ /* at least SSL3_RT_MAX_PACKET_SIZE bytes, see ssl3_setup_buffers() */
+ unsigned char *buf;
+ /* buffer size */
+ size_t len;
+ /* where to 'copy from' */
+ int offset;
+ /* how many bytes left */
+ int left;
+} SSL3_BUFFER;
+
+# endif
+
+# define SSL3_CT_RSA_SIGN 1
+# define SSL3_CT_DSS_SIGN 2
+# define SSL3_CT_RSA_FIXED_DH 3
+# define SSL3_CT_DSS_FIXED_DH 4
+# define SSL3_CT_RSA_EPHEMERAL_DH 5
+# define SSL3_CT_DSS_EPHEMERAL_DH 6
+# define SSL3_CT_FORTEZZA_DMS 20
+/*
+ * SSL3_CT_NUMBER is used to size arrays and it must be large enough to
+ * contain all of the cert types defined either for SSLv3 and TLSv1.
+ */
+# define SSL3_CT_NUMBER 9
+
+# define SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS 0x0001
+# define SSL3_FLAGS_DELAY_CLIENT_FINISHED 0x0002
+# define SSL3_FLAGS_POP_BUFFER 0x0004
+# define TLS1_FLAGS_TLS_PADDING_BUG 0x0008
+# define TLS1_FLAGS_SKIP_CERT_VERIFY 0x0010
+# define TLS1_FLAGS_KEEP_HANDSHAKE 0x0020
+/*
+ * Set when the handshake is ready to process peer's ChangeCipherSpec message.
+ * Cleared after the message has been processed.
+ */
+# define SSL3_FLAGS_CCS_OK 0x0080
+
+/* SSL3_FLAGS_SGC_RESTART_DONE is no longer used */
+# define SSL3_FLAGS_SGC_RESTART_DONE 0x0040
+
+# ifndef OPENSSL_NO_SSL_INTERN
+
+typedef struct ssl3_state_st {
+ long flags;
+ int delay_buf_pop_ret;
+ unsigned char read_sequence[8];
+ int read_mac_secret_size;
+ unsigned char read_mac_secret[EVP_MAX_MD_SIZE];
+ unsigned char write_sequence[8];
+ int write_mac_secret_size;
+ unsigned char write_mac_secret[EVP_MAX_MD_SIZE];
+ unsigned char server_random[SSL3_RANDOM_SIZE];
+ unsigned char client_random[SSL3_RANDOM_SIZE];
+ /* flags for countermeasure against known-IV weakness */
+ int need_empty_fragments;
+ int empty_fragment_done;
+ /* The value of 'extra' when the buffers were initialized */
+ int init_extra;
+ SSL3_BUFFER rbuf; /* read IO goes into here */
+ SSL3_BUFFER wbuf; /* write IO goes into here */
+ SSL3_RECORD rrec; /* each decoded record goes in here */
+ SSL3_RECORD wrec; /* goes out from here */
+ /*
+ * storage for Alert/Handshake protocol data received but not yet
+ * processed by ssl3_read_bytes:
+ */
+ unsigned char alert_fragment[2];
+ unsigned int alert_fragment_len;
+ unsigned char handshake_fragment[4];
+ unsigned int handshake_fragment_len;
+ /* partial write - check the numbers match */
+ unsigned int wnum; /* number of bytes sent so far */
+ int wpend_tot; /* number bytes written */
+ int wpend_type;
+ int wpend_ret; /* number of bytes submitted */
+ const unsigned char *wpend_buf;
+ /* used during startup, digest all incoming/outgoing packets */
+ BIO *handshake_buffer;
+ /*
+ * When set of handshake digests is determined, buffer is hashed and
+ * freed and MD_CTX-es for all required digests are stored in this array
+ */
+ EVP_MD_CTX **handshake_dgst;
+ /*
+ * Set whenever an expected ChangeCipherSpec message is processed.
+ * Unset when the peer's Finished message is received.
+ * Unexpected ChangeCipherSpec messages trigger a fatal alert.
+ */
+ int change_cipher_spec;
+ int warn_alert;
+ int fatal_alert;
+ /*
+ * we allow one fatal and one warning alert to be outstanding, send close
+ * alert via the warning alert
+ */
+ int alert_dispatch;
+ unsigned char send_alert[2];
+ /*
+ * This flag is set when we should renegotiate ASAP, basically when there
+ * is no more data in the read or write buffers
+ */
+ int renegotiate;
+ int total_renegotiations;
+ int num_renegotiations;
+ int in_read_app_data;
+ /*
+ * Opaque PRF input as used for the current handshake. These fields are
+ * used only if TLSEXT_TYPE_opaque_prf_input is defined (otherwise, they
+ * are merely present to improve binary compatibility)
+ */
+ void *client_opaque_prf_input;
+ size_t client_opaque_prf_input_len;
+ void *server_opaque_prf_input;
+ size_t server_opaque_prf_input_len;
+ struct {
+ /* actually only needs to be 16+20 */
+ unsigned char cert_verify_md[EVP_MAX_MD_SIZE * 2];
+ /* actually only need to be 16+20 for SSLv3 and 12 for TLS */
+ unsigned char finish_md[EVP_MAX_MD_SIZE * 2];
+ int finish_md_len;
+ unsigned char peer_finish_md[EVP_MAX_MD_SIZE * 2];
+ int peer_finish_md_len;
+ unsigned long message_size;
+ int message_type;
+ /* used to hold the new cipher we are going to use */
+ const SSL_CIPHER *new_cipher;
+# ifndef OPENSSL_NO_DH
+ DH *dh;
+# endif
+# ifndef OPENSSL_NO_ECDH
+ EC_KEY *ecdh; /* holds short lived ECDH key */
+# endif
+ /* used when SSL_ST_FLUSH_DATA is entered */
+ int next_state;
+ int reuse_message;
+ /* used for certificate requests */
+ int cert_req;
+ int ctype_num;
+ char ctype[SSL3_CT_NUMBER];
+ STACK_OF(X509_NAME) *ca_names;
+ int use_rsa_tmp;
+ int key_block_length;
+ unsigned char *key_block;
+ const EVP_CIPHER *new_sym_enc;
+ const EVP_MD *new_hash;
+ int new_mac_pkey_type;
+ int new_mac_secret_size;
+# ifndef OPENSSL_NO_COMP
+ const SSL_COMP *new_compression;
+# else
+ char *new_compression;
+# endif
+ int cert_request;
+ } tmp;
+
+ /* Connection binding to prevent renegotiation attacks */
+ unsigned char previous_client_finished[EVP_MAX_MD_SIZE];
+ unsigned char previous_client_finished_len;
+ unsigned char previous_server_finished[EVP_MAX_MD_SIZE];
+ unsigned char previous_server_finished_len;
+ int send_connection_binding; /* TODOEKR */
+
+# ifndef OPENSSL_NO_NEXTPROTONEG
+ /*
+ * Set if we saw the Next Protocol Negotiation extension from our peer.
+ */
+ int next_proto_neg_seen;
+# endif
+
+# ifndef OPENSSL_NO_TLSEXT
+# ifndef OPENSSL_NO_EC
+ /*
+ * This is set to true if we believe that this is a version of Safari
+ * running on OS X 10.6 or newer. We wish to know this because Safari on
+ * 10.8 .. 10.8.3 has broken ECDHE-ECDSA support.
+ */
+ char is_probably_safari;
+# endif /* !OPENSSL_NO_EC */
+
+ /*
+ * ALPN information (we are in the process of transitioning from NPN to
+ * ALPN.)
+ */
+
+ /*
+ * In a server these point to the selected ALPN protocol after the
+ * ClientHello has been processed. In a client these contain the protocol
+ * that the server selected once the ServerHello has been processed.
+ */
+ unsigned char *alpn_selected;
+ unsigned alpn_selected_len;
+# endif /* OPENSSL_NO_TLSEXT */
+} SSL3_STATE;
+
+# endif
+
+/* SSLv3 */
+/*
+ * client
+ */
+/* extra state */
+# define SSL3_ST_CW_FLUSH (0x100|SSL_ST_CONNECT)
+# ifndef OPENSSL_NO_SCTP
+# define DTLS1_SCTP_ST_CW_WRITE_SOCK (0x310|SSL_ST_CONNECT)
+# define DTLS1_SCTP_ST_CR_READ_SOCK (0x320|SSL_ST_CONNECT)
+# endif
+/* write to server */
+# define SSL3_ST_CW_CLNT_HELLO_A (0x110|SSL_ST_CONNECT)
+# define SSL3_ST_CW_CLNT_HELLO_B (0x111|SSL_ST_CONNECT)
+/* read from server */
+# define SSL3_ST_CR_SRVR_HELLO_A (0x120|SSL_ST_CONNECT)
+# define SSL3_ST_CR_SRVR_HELLO_B (0x121|SSL_ST_CONNECT)
+# define DTLS1_ST_CR_HELLO_VERIFY_REQUEST_A (0x126|SSL_ST_CONNECT)
+# define DTLS1_ST_CR_HELLO_VERIFY_REQUEST_B (0x127|SSL_ST_CONNECT)
+# define SSL3_ST_CR_CERT_A (0x130|SSL_ST_CONNECT)
+# define SSL3_ST_CR_CERT_B (0x131|SSL_ST_CONNECT)
+# define SSL3_ST_CR_KEY_EXCH_A (0x140|SSL_ST_CONNECT)
+# define SSL3_ST_CR_KEY_EXCH_B (0x141|SSL_ST_CONNECT)
+# define SSL3_ST_CR_CERT_REQ_A (0x150|SSL_ST_CONNECT)
+# define SSL3_ST_CR_CERT_REQ_B (0x151|SSL_ST_CONNECT)
+# define SSL3_ST_CR_SRVR_DONE_A (0x160|SSL_ST_CONNECT)
+# define SSL3_ST_CR_SRVR_DONE_B (0x161|SSL_ST_CONNECT)
+/* write to server */
+# define SSL3_ST_CW_CERT_A (0x170|SSL_ST_CONNECT)
+# define SSL3_ST_CW_CERT_B (0x171|SSL_ST_CONNECT)
+# define SSL3_ST_CW_CERT_C (0x172|SSL_ST_CONNECT)
+# define SSL3_ST_CW_CERT_D (0x173|SSL_ST_CONNECT)
+# define SSL3_ST_CW_KEY_EXCH_A (0x180|SSL_ST_CONNECT)
+# define SSL3_ST_CW_KEY_EXCH_B (0x181|SSL_ST_CONNECT)
+# define SSL3_ST_CW_CERT_VRFY_A (0x190|SSL_ST_CONNECT)
+# define SSL3_ST_CW_CERT_VRFY_B (0x191|SSL_ST_CONNECT)
+# define SSL3_ST_CW_CHANGE_A (0x1A0|SSL_ST_CONNECT)
+# define SSL3_ST_CW_CHANGE_B (0x1A1|SSL_ST_CONNECT)
+# ifndef OPENSSL_NO_NEXTPROTONEG
+# define SSL3_ST_CW_NEXT_PROTO_A (0x200|SSL_ST_CONNECT)
+# define SSL3_ST_CW_NEXT_PROTO_B (0x201|SSL_ST_CONNECT)
+# endif
+# define SSL3_ST_CW_FINISHED_A (0x1B0|SSL_ST_CONNECT)
+# define SSL3_ST_CW_FINISHED_B (0x1B1|SSL_ST_CONNECT)
+/* read from server */
+# define SSL3_ST_CR_CHANGE_A (0x1C0|SSL_ST_CONNECT)
+# define SSL3_ST_CR_CHANGE_B (0x1C1|SSL_ST_CONNECT)
+# define SSL3_ST_CR_FINISHED_A (0x1D0|SSL_ST_CONNECT)
+# define SSL3_ST_CR_FINISHED_B (0x1D1|SSL_ST_CONNECT)
+# define SSL3_ST_CR_SESSION_TICKET_A (0x1E0|SSL_ST_CONNECT)
+# define SSL3_ST_CR_SESSION_TICKET_B (0x1E1|SSL_ST_CONNECT)
+# define SSL3_ST_CR_CERT_STATUS_A (0x1F0|SSL_ST_CONNECT)
+# define SSL3_ST_CR_CERT_STATUS_B (0x1F1|SSL_ST_CONNECT)
+
+/* server */
+/* extra state */
+# define SSL3_ST_SW_FLUSH (0x100|SSL_ST_ACCEPT)
+# ifndef OPENSSL_NO_SCTP
+# define DTLS1_SCTP_ST_SW_WRITE_SOCK (0x310|SSL_ST_ACCEPT)
+# define DTLS1_SCTP_ST_SR_READ_SOCK (0x320|SSL_ST_ACCEPT)
+# endif
+/* read from client */
+/* Do not change the number values, they do matter */
+# define SSL3_ST_SR_CLNT_HELLO_A (0x110|SSL_ST_ACCEPT)
+# define SSL3_ST_SR_CLNT_HELLO_B (0x111|SSL_ST_ACCEPT)
+# define SSL3_ST_SR_CLNT_HELLO_C (0x112|SSL_ST_ACCEPT)
+# define SSL3_ST_SR_CLNT_HELLO_D (0x115|SSL_ST_ACCEPT)
+/* write to client */
+# define DTLS1_ST_SW_HELLO_VERIFY_REQUEST_A (0x113|SSL_ST_ACCEPT)
+# define DTLS1_ST_SW_HELLO_VERIFY_REQUEST_B (0x114|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_HELLO_REQ_A (0x120|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_HELLO_REQ_B (0x121|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_HELLO_REQ_C (0x122|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_SRVR_HELLO_A (0x130|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_SRVR_HELLO_B (0x131|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_CERT_A (0x140|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_CERT_B (0x141|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_KEY_EXCH_A (0x150|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_KEY_EXCH_B (0x151|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_CERT_REQ_A (0x160|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_CERT_REQ_B (0x161|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_SRVR_DONE_A (0x170|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_SRVR_DONE_B (0x171|SSL_ST_ACCEPT)
+/* read from client */
+# define SSL3_ST_SR_CERT_A (0x180|SSL_ST_ACCEPT)
+# define SSL3_ST_SR_CERT_B (0x181|SSL_ST_ACCEPT)
+# define SSL3_ST_SR_KEY_EXCH_A (0x190|SSL_ST_ACCEPT)
+# define SSL3_ST_SR_KEY_EXCH_B (0x191|SSL_ST_ACCEPT)
+# define SSL3_ST_SR_CERT_VRFY_A (0x1A0|SSL_ST_ACCEPT)
+# define SSL3_ST_SR_CERT_VRFY_B (0x1A1|SSL_ST_ACCEPT)
+# define SSL3_ST_SR_CHANGE_A (0x1B0|SSL_ST_ACCEPT)
+# define SSL3_ST_SR_CHANGE_B (0x1B1|SSL_ST_ACCEPT)
+# ifndef OPENSSL_NO_NEXTPROTONEG
+# define SSL3_ST_SR_NEXT_PROTO_A (0x210|SSL_ST_ACCEPT)
+# define SSL3_ST_SR_NEXT_PROTO_B (0x211|SSL_ST_ACCEPT)
+# endif
+# define SSL3_ST_SR_FINISHED_A (0x1C0|SSL_ST_ACCEPT)
+# define SSL3_ST_SR_FINISHED_B (0x1C1|SSL_ST_ACCEPT)
+/* write to client */
+# define SSL3_ST_SW_CHANGE_A (0x1D0|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_CHANGE_B (0x1D1|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_FINISHED_A (0x1E0|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_FINISHED_B (0x1E1|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_SESSION_TICKET_A (0x1F0|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_SESSION_TICKET_B (0x1F1|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_CERT_STATUS_A (0x200|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_CERT_STATUS_B (0x201|SSL_ST_ACCEPT)
+
+# define SSL3_MT_HELLO_REQUEST 0
+# define SSL3_MT_CLIENT_HELLO 1
+# define SSL3_MT_SERVER_HELLO 2
+# define SSL3_MT_NEWSESSION_TICKET 4
+# define SSL3_MT_CERTIFICATE 11
+# define SSL3_MT_SERVER_KEY_EXCHANGE 12
+# define SSL3_MT_CERTIFICATE_REQUEST 13
+# define SSL3_MT_SERVER_DONE 14
+# define SSL3_MT_CERTIFICATE_VERIFY 15
+# define SSL3_MT_CLIENT_KEY_EXCHANGE 16
+# define SSL3_MT_FINISHED 20
+# define SSL3_MT_CERTIFICATE_STATUS 22
+# ifndef OPENSSL_NO_NEXTPROTONEG
+# define SSL3_MT_NEXT_PROTO 67
+# endif
+# define DTLS1_MT_HELLO_VERIFY_REQUEST 3
+
+# define SSL3_MT_CCS 1
+
+/* These are used when changing over to a new cipher */
+# define SSL3_CC_READ 0x01
+# define SSL3_CC_WRITE 0x02
+# define SSL3_CC_CLIENT 0x10
+# define SSL3_CC_SERVER 0x20
+# define SSL3_CHANGE_CIPHER_CLIENT_WRITE (SSL3_CC_CLIENT|SSL3_CC_WRITE)
+# define SSL3_CHANGE_CIPHER_SERVER_READ (SSL3_CC_SERVER|SSL3_CC_READ)
+# define SSL3_CHANGE_CIPHER_CLIENT_READ (SSL3_CC_CLIENT|SSL3_CC_READ)
+# define SSL3_CHANGE_CIPHER_SERVER_WRITE (SSL3_CC_SERVER|SSL3_CC_WRITE)
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/stack.h b/protocols/Telegram/tgl/openssl/include/openssl/stack.h
new file mode 100644
index 0000000000..eb07216659
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/stack.h
@@ -0,0 +1,107 @@
+/* crypto/stack/stack.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_STACK_H
+# define HEADER_STACK_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct stack_st {
+ int num;
+ char **data;
+ int sorted;
+ int num_alloc;
+ int (*comp) (const void *, const void *);
+} _STACK; /* Use STACK_OF(...) instead */
+
+# define M_sk_num(sk) ((sk) ? (sk)->num:-1)
+# define M_sk_value(sk,n) ((sk) ? (sk)->data[n] : NULL)
+
+int sk_num(const _STACK *);
+void *sk_value(const _STACK *, int);
+
+void *sk_set(_STACK *, int, void *);
+
+_STACK *sk_new(int (*cmp) (const void *, const void *));
+_STACK *sk_new_null(void);
+void sk_free(_STACK *);
+void sk_pop_free(_STACK *st, void (*func) (void *));
+_STACK *sk_deep_copy(_STACK *, void *(*)(void *), void (*)(void *));
+int sk_insert(_STACK *sk, void *data, int where);
+void *sk_delete(_STACK *st, int loc);
+void *sk_delete_ptr(_STACK *st, void *p);
+int sk_find(_STACK *st, void *data);
+int sk_find_ex(_STACK *st, void *data);
+int sk_push(_STACK *st, void *data);
+int sk_unshift(_STACK *st, void *data);
+void *sk_shift(_STACK *st);
+void *sk_pop(_STACK *st);
+void sk_zero(_STACK *st);
+int (*sk_set_cmp_func(_STACK *sk, int (*c) (const void *, const void *)))
+ (const void *, const void *);
+_STACK *sk_dup(_STACK *st);
+void sk_sort(_STACK *st);
+int sk_is_sorted(const _STACK *st);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/symhacks.h b/protocols/Telegram/tgl/openssl/include/openssl/symhacks.h
new file mode 100644
index 0000000000..239fa4fb1b
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/symhacks.h
@@ -0,0 +1,516 @@
+/* ====================================================================
+ * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_SYMHACKS_H
+# define HEADER_SYMHACKS_H
+
+# include <openssl/e_os2.h>
+
+/*
+ * Hacks to solve the problem with linkers incapable of handling very long
+ * symbol names. In the case of VMS, the limit is 31 characters on VMS for
+ * VAX.
+ */
+/*
+ * Note that this affects util/libeay.num and util/ssleay.num... you may
+ * change those manually, but that's not recommended, as those files are
+ * controlled centrally and updated on Unix, and the central definition may
+ * disagree with yours, which in turn may come with shareable library
+ * incompatibilities.
+ */
+# ifdef OPENSSL_SYS_VMS
+
+/* Hack a long name in crypto/ex_data.c */
+# undef CRYPTO_get_ex_data_implementation
+# define CRYPTO_get_ex_data_implementation CRYPTO_get_ex_data_impl
+# undef CRYPTO_set_ex_data_implementation
+# define CRYPTO_set_ex_data_implementation CRYPTO_set_ex_data_impl
+
+/* Hack a long name in crypto/asn1/a_mbstr.c */
+# undef ASN1_STRING_set_default_mask_asc
+# define ASN1_STRING_set_default_mask_asc ASN1_STRING_set_def_mask_asc
+
+# if 0 /* No longer needed, since safestack macro
+ * magic does the job */
+/* Hack the names created with DECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO) */
+# undef i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO
+# define i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO i2d_ASN1_SET_OF_PKCS7_SIGINF
+# undef d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO
+# define d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO d2i_ASN1_SET_OF_PKCS7_SIGINF
+# endif
+
+# if 0 /* No longer needed, since safestack macro
+ * magic does the job */
+/* Hack the names created with DECLARE_ASN1_SET_OF(PKCS7_RECIP_INFO) */
+# undef i2d_ASN1_SET_OF_PKCS7_RECIP_INFO
+# define i2d_ASN1_SET_OF_PKCS7_RECIP_INFO i2d_ASN1_SET_OF_PKCS7_RECINF
+# undef d2i_ASN1_SET_OF_PKCS7_RECIP_INFO
+# define d2i_ASN1_SET_OF_PKCS7_RECIP_INFO d2i_ASN1_SET_OF_PKCS7_RECINF
+# endif
+
+# if 0 /* No longer needed, since safestack macro
+ * magic does the job */
+/* Hack the names created with DECLARE_ASN1_SET_OF(ACCESS_DESCRIPTION) */
+# undef i2d_ASN1_SET_OF_ACCESS_DESCRIPTION
+# define i2d_ASN1_SET_OF_ACCESS_DESCRIPTION i2d_ASN1_SET_OF_ACC_DESC
+# undef d2i_ASN1_SET_OF_ACCESS_DESCRIPTION
+# define d2i_ASN1_SET_OF_ACCESS_DESCRIPTION d2i_ASN1_SET_OF_ACC_DESC
+# endif
+
+/* Hack the names created with DECLARE_PEM_rw(NETSCAPE_CERT_SEQUENCE) */
+# undef PEM_read_NETSCAPE_CERT_SEQUENCE
+# define PEM_read_NETSCAPE_CERT_SEQUENCE PEM_read_NS_CERT_SEQ
+# undef PEM_write_NETSCAPE_CERT_SEQUENCE
+# define PEM_write_NETSCAPE_CERT_SEQUENCE PEM_write_NS_CERT_SEQ
+# undef PEM_read_bio_NETSCAPE_CERT_SEQUENCE
+# define PEM_read_bio_NETSCAPE_CERT_SEQUENCE PEM_read_bio_NS_CERT_SEQ
+# undef PEM_write_bio_NETSCAPE_CERT_SEQUENCE
+# define PEM_write_bio_NETSCAPE_CERT_SEQUENCE PEM_write_bio_NS_CERT_SEQ
+# undef PEM_write_cb_bio_NETSCAPE_CERT_SEQUENCE
+# define PEM_write_cb_bio_NETSCAPE_CERT_SEQUENCE PEM_write_cb_bio_NS_CERT_SEQ
+
+/* Hack the names created with DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO) */
+# undef PEM_read_PKCS8_PRIV_KEY_INFO
+# define PEM_read_PKCS8_PRIV_KEY_INFO PEM_read_P8_PRIV_KEY_INFO
+# undef PEM_write_PKCS8_PRIV_KEY_INFO
+# define PEM_write_PKCS8_PRIV_KEY_INFO PEM_write_P8_PRIV_KEY_INFO
+# undef PEM_read_bio_PKCS8_PRIV_KEY_INFO
+# define PEM_read_bio_PKCS8_PRIV_KEY_INFO PEM_read_bio_P8_PRIV_KEY_INFO
+# undef PEM_write_bio_PKCS8_PRIV_KEY_INFO
+# define PEM_write_bio_PKCS8_PRIV_KEY_INFO PEM_write_bio_P8_PRIV_KEY_INFO
+# undef PEM_write_cb_bio_PKCS8_PRIV_KEY_INFO
+# define PEM_write_cb_bio_PKCS8_PRIV_KEY_INFO PEM_wrt_cb_bio_P8_PRIV_KEY_INFO
+
+/* Hack other PEM names */
+# undef PEM_write_bio_PKCS8PrivateKey_nid
+# define PEM_write_bio_PKCS8PrivateKey_nid PEM_write_bio_PKCS8PrivKey_nid
+
+/* Hack some long X509 names */
+# undef X509_REVOKED_get_ext_by_critical
+# define X509_REVOKED_get_ext_by_critical X509_REVOKED_get_ext_by_critic
+# undef X509_policy_tree_get0_user_policies
+# define X509_policy_tree_get0_user_policies X509_pcy_tree_get0_usr_policies
+# undef X509_policy_node_get0_qualifiers
+# define X509_policy_node_get0_qualifiers X509_pcy_node_get0_qualifiers
+# undef X509_STORE_CTX_get_explicit_policy
+# define X509_STORE_CTX_get_explicit_policy X509_STORE_CTX_get_expl_policy
+# undef X509_STORE_CTX_get0_current_issuer
+# define X509_STORE_CTX_get0_current_issuer X509_STORE_CTX_get0_cur_issuer
+
+/* Hack some long CRYPTO names */
+# undef CRYPTO_set_dynlock_destroy_callback
+# define CRYPTO_set_dynlock_destroy_callback CRYPTO_set_dynlock_destroy_cb
+# undef CRYPTO_set_dynlock_create_callback
+# define CRYPTO_set_dynlock_create_callback CRYPTO_set_dynlock_create_cb
+# undef CRYPTO_set_dynlock_lock_callback
+# define CRYPTO_set_dynlock_lock_callback CRYPTO_set_dynlock_lock_cb
+# undef CRYPTO_get_dynlock_lock_callback
+# define CRYPTO_get_dynlock_lock_callback CRYPTO_get_dynlock_lock_cb
+# undef CRYPTO_get_dynlock_destroy_callback
+# define CRYPTO_get_dynlock_destroy_callback CRYPTO_get_dynlock_destroy_cb
+# undef CRYPTO_get_dynlock_create_callback
+# define CRYPTO_get_dynlock_create_callback CRYPTO_get_dynlock_create_cb
+# undef CRYPTO_set_locked_mem_ex_functions
+# define CRYPTO_set_locked_mem_ex_functions CRYPTO_set_locked_mem_ex_funcs
+# undef CRYPTO_get_locked_mem_ex_functions
+# define CRYPTO_get_locked_mem_ex_functions CRYPTO_get_locked_mem_ex_funcs
+
+/* Hack some long SSL/TLS names */
+# undef SSL_CTX_set_default_verify_paths
+# define SSL_CTX_set_default_verify_paths SSL_CTX_set_def_verify_paths
+# undef SSL_get_ex_data_X509_STORE_CTX_idx
+# define SSL_get_ex_data_X509_STORE_CTX_idx SSL_get_ex_d_X509_STORE_CTX_idx
+# undef SSL_add_file_cert_subjects_to_stack
+# define SSL_add_file_cert_subjects_to_stack SSL_add_file_cert_subjs_to_stk
+# undef SSL_add_dir_cert_subjects_to_stack
+# define SSL_add_dir_cert_subjects_to_stack SSL_add_dir_cert_subjs_to_stk
+# undef SSL_CTX_use_certificate_chain_file
+# define SSL_CTX_use_certificate_chain_file SSL_CTX_use_cert_chain_file
+# undef SSL_CTX_set_cert_verify_callback
+# define SSL_CTX_set_cert_verify_callback SSL_CTX_set_cert_verify_cb
+# undef SSL_CTX_set_default_passwd_cb_userdata
+# define SSL_CTX_set_default_passwd_cb_userdata SSL_CTX_set_def_passwd_cb_ud
+# undef SSL_COMP_get_compression_methods
+# define SSL_COMP_get_compression_methods SSL_COMP_get_compress_methods
+# undef SSL_COMP_set0_compression_methods
+# define SSL_COMP_set0_compression_methods SSL_COMP_set0_compress_methods
+# undef SSL_COMP_free_compression_methods
+# define SSL_COMP_free_compression_methods SSL_COMP_free_compress_methods
+# undef ssl_add_clienthello_renegotiate_ext
+# define ssl_add_clienthello_renegotiate_ext ssl_add_clienthello_reneg_ext
+# undef ssl_add_serverhello_renegotiate_ext
+# define ssl_add_serverhello_renegotiate_ext ssl_add_serverhello_reneg_ext
+# undef ssl_parse_clienthello_renegotiate_ext
+# define ssl_parse_clienthello_renegotiate_ext ssl_parse_clienthello_reneg_ext
+# undef ssl_parse_serverhello_renegotiate_ext
+# define ssl_parse_serverhello_renegotiate_ext ssl_parse_serverhello_reneg_ext
+# undef SSL_srp_server_param_with_username
+# define SSL_srp_server_param_with_username SSL_srp_server_param_with_un
+# undef SSL_CTX_set_srp_client_pwd_callback
+# define SSL_CTX_set_srp_client_pwd_callback SSL_CTX_set_srp_client_pwd_cb
+# undef SSL_CTX_set_srp_verify_param_callback
+# define SSL_CTX_set_srp_verify_param_callback SSL_CTX_set_srp_vfy_param_cb
+# undef SSL_CTX_set_srp_username_callback
+# define SSL_CTX_set_srp_username_callback SSL_CTX_set_srp_un_cb
+# undef ssl_add_clienthello_use_srtp_ext
+# define ssl_add_clienthello_use_srtp_ext ssl_add_clihello_use_srtp_ext
+# undef ssl_add_serverhello_use_srtp_ext
+# define ssl_add_serverhello_use_srtp_ext ssl_add_serhello_use_srtp_ext
+# undef ssl_parse_clienthello_use_srtp_ext
+# define ssl_parse_clienthello_use_srtp_ext ssl_parse_clihello_use_srtp_ext
+# undef ssl_parse_serverhello_use_srtp_ext
+# define ssl_parse_serverhello_use_srtp_ext ssl_parse_serhello_use_srtp_ext
+# undef SSL_CTX_set_next_protos_advertised_cb
+# define SSL_CTX_set_next_protos_advertised_cb SSL_CTX_set_next_protos_adv_cb
+# undef SSL_CTX_set_next_proto_select_cb
+# define SSL_CTX_set_next_proto_select_cb SSL_CTX_set_next_proto_sel_cb
+
+# undef tls1_send_server_supplemental_data
+# define tls1_send_server_supplemental_data tls1_send_server_suppl_data
+# undef tls1_send_client_supplemental_data
+# define tls1_send_client_supplemental_data tls1_send_client_suppl_data
+# undef tls1_get_server_supplemental_data
+# define tls1_get_server_supplemental_data tls1_get_server_suppl_data
+# undef tls1_get_client_supplemental_data
+# define tls1_get_client_supplemental_data tls1_get_client_suppl_data
+
+# undef ssl3_cbc_record_digest_supported
+# define ssl3_cbc_record_digest_supported ssl3_cbc_record_digest_support
+# undef ssl_check_clienthello_tlsext_late
+# define ssl_check_clienthello_tlsext_late ssl_check_clihello_tlsext_late
+# undef ssl_check_clienthello_tlsext_early
+# define ssl_check_clienthello_tlsext_early ssl_check_clihello_tlsext_early
+
+/* Hack some RSA long names */
+# undef RSA_padding_check_PKCS1_OAEP_mgf1
+# define RSA_padding_check_PKCS1_OAEP_mgf1 RSA_pad_check_PKCS1_OAEP_mgf1
+
+/* Hack some ENGINE long names */
+# undef ENGINE_get_default_BN_mod_exp_crt
+# define ENGINE_get_default_BN_mod_exp_crt ENGINE_get_def_BN_mod_exp_crt
+# undef ENGINE_set_default_BN_mod_exp_crt
+# define ENGINE_set_default_BN_mod_exp_crt ENGINE_set_def_BN_mod_exp_crt
+# undef ENGINE_set_load_privkey_function
+# define ENGINE_set_load_privkey_function ENGINE_set_load_privkey_fn
+# undef ENGINE_get_load_privkey_function
+# define ENGINE_get_load_privkey_function ENGINE_get_load_privkey_fn
+# undef ENGINE_unregister_pkey_asn1_meths
+# define ENGINE_unregister_pkey_asn1_meths ENGINE_unreg_pkey_asn1_meths
+# undef ENGINE_register_all_pkey_asn1_meths
+# define ENGINE_register_all_pkey_asn1_meths ENGINE_reg_all_pkey_asn1_meths
+# undef ENGINE_set_default_pkey_asn1_meths
+# define ENGINE_set_default_pkey_asn1_meths ENGINE_set_def_pkey_asn1_meths
+# undef ENGINE_get_pkey_asn1_meth_engine
+# define ENGINE_get_pkey_asn1_meth_engine ENGINE_get_pkey_asn1_meth_eng
+# undef ENGINE_set_load_ssl_client_cert_function
+# define ENGINE_set_load_ssl_client_cert_function \
+ ENGINE_set_ld_ssl_clnt_cert_fn
+# undef ENGINE_get_ssl_client_cert_function
+# define ENGINE_get_ssl_client_cert_function ENGINE_get_ssl_client_cert_fn
+
+/* Hack some long OCSP names */
+# undef OCSP_REQUEST_get_ext_by_critical
+# define OCSP_REQUEST_get_ext_by_critical OCSP_REQUEST_get_ext_by_crit
+# undef OCSP_BASICRESP_get_ext_by_critical
+# define OCSP_BASICRESP_get_ext_by_critical OCSP_BASICRESP_get_ext_by_crit
+# undef OCSP_SINGLERESP_get_ext_by_critical
+# define OCSP_SINGLERESP_get_ext_by_critical OCSP_SINGLERESP_get_ext_by_crit
+
+/* Hack some long DES names */
+# undef _ossl_old_des_ede3_cfb64_encrypt
+# define _ossl_old_des_ede3_cfb64_encrypt _ossl_odes_ede3_cfb64_encrypt
+# undef _ossl_old_des_ede3_ofb64_encrypt
+# define _ossl_old_des_ede3_ofb64_encrypt _ossl_odes_ede3_ofb64_encrypt
+
+/* Hack some long EVP names */
+# undef OPENSSL_add_all_algorithms_noconf
+# define OPENSSL_add_all_algorithms_noconf OPENSSL_add_all_algo_noconf
+# undef OPENSSL_add_all_algorithms_conf
+# define OPENSSL_add_all_algorithms_conf OPENSSL_add_all_algo_conf
+# undef EVP_PKEY_meth_set_verify_recover
+# define EVP_PKEY_meth_set_verify_recover EVP_PKEY_meth_set_vrfy_recover
+
+/* Hack some long EC names */
+# undef EC_GROUP_set_point_conversion_form
+# define EC_GROUP_set_point_conversion_form EC_GROUP_set_point_conv_form
+# undef EC_GROUP_get_point_conversion_form
+# define EC_GROUP_get_point_conversion_form EC_GROUP_get_point_conv_form
+# undef EC_GROUP_clear_free_all_extra_data
+# define EC_GROUP_clear_free_all_extra_data EC_GROUP_clr_free_all_xtra_data
+# undef EC_KEY_set_public_key_affine_coordinates
+# define EC_KEY_set_public_key_affine_coordinates \
+ EC_KEY_set_pub_key_aff_coords
+# undef EC_POINT_set_Jprojective_coordinates_GFp
+# define EC_POINT_set_Jprojective_coordinates_GFp \
+ EC_POINT_set_Jproj_coords_GFp
+# undef EC_POINT_get_Jprojective_coordinates_GFp
+# define EC_POINT_get_Jprojective_coordinates_GFp \
+ EC_POINT_get_Jproj_coords_GFp
+# undef EC_POINT_set_affine_coordinates_GFp
+# define EC_POINT_set_affine_coordinates_GFp EC_POINT_set_affine_coords_GFp
+# undef EC_POINT_get_affine_coordinates_GFp
+# define EC_POINT_get_affine_coordinates_GFp EC_POINT_get_affine_coords_GFp
+# undef EC_POINT_set_compressed_coordinates_GFp
+# define EC_POINT_set_compressed_coordinates_GFp EC_POINT_set_compr_coords_GFp
+# undef EC_POINT_set_affine_coordinates_GF2m
+# define EC_POINT_set_affine_coordinates_GF2m EC_POINT_set_affine_coords_GF2m
+# undef EC_POINT_get_affine_coordinates_GF2m
+# define EC_POINT_get_affine_coordinates_GF2m EC_POINT_get_affine_coords_GF2m
+# undef EC_POINT_set_compressed_coordinates_GF2m
+# define EC_POINT_set_compressed_coordinates_GF2m \
+ EC_POINT_set_compr_coords_GF2m
+# undef ec_GF2m_simple_group_clear_finish
+# define ec_GF2m_simple_group_clear_finish ec_GF2m_simple_grp_clr_finish
+# undef ec_GF2m_simple_group_check_discriminant
+# define ec_GF2m_simple_group_check_discriminant ec_GF2m_simple_grp_chk_discrim
+# undef ec_GF2m_simple_point_clear_finish
+# define ec_GF2m_simple_point_clear_finish ec_GF2m_simple_pt_clr_finish
+# undef ec_GF2m_simple_point_set_to_infinity
+# define ec_GF2m_simple_point_set_to_infinity ec_GF2m_simple_pt_set_to_inf
+# undef ec_GF2m_simple_points_make_affine
+# define ec_GF2m_simple_points_make_affine ec_GF2m_simple_pts_make_affine
+# undef ec_GF2m_simple_point_set_affine_coordinates
+# define ec_GF2m_simple_point_set_affine_coordinates \
+ ec_GF2m_smp_pt_set_af_coords
+# undef ec_GF2m_simple_point_get_affine_coordinates
+# define ec_GF2m_simple_point_get_affine_coordinates \
+ ec_GF2m_smp_pt_get_af_coords
+# undef ec_GF2m_simple_set_compressed_coordinates
+# define ec_GF2m_simple_set_compressed_coordinates \
+ ec_GF2m_smp_set_compr_coords
+# undef ec_GFp_simple_group_set_curve_GFp
+# define ec_GFp_simple_group_set_curve_GFp ec_GFp_simple_grp_set_curve_GFp
+# undef ec_GFp_simple_group_get_curve_GFp
+# define ec_GFp_simple_group_get_curve_GFp ec_GFp_simple_grp_get_curve_GFp
+# undef ec_GFp_simple_group_clear_finish
+# define ec_GFp_simple_group_clear_finish ec_GFp_simple_grp_clear_finish
+# undef ec_GFp_simple_group_set_generator
+# define ec_GFp_simple_group_set_generator ec_GFp_simple_grp_set_generator
+# undef ec_GFp_simple_group_get0_generator
+# define ec_GFp_simple_group_get0_generator ec_GFp_simple_grp_gt0_generator
+# undef ec_GFp_simple_group_get_cofactor
+# define ec_GFp_simple_group_get_cofactor ec_GFp_simple_grp_get_cofactor
+# undef ec_GFp_simple_point_clear_finish
+# define ec_GFp_simple_point_clear_finish ec_GFp_simple_pt_clear_finish
+# undef ec_GFp_simple_point_set_to_infinity
+# define ec_GFp_simple_point_set_to_infinity ec_GFp_simple_pt_set_to_inf
+# undef ec_GFp_simple_points_make_affine
+# define ec_GFp_simple_points_make_affine ec_GFp_simple_pts_make_affine
+# undef ec_GFp_simple_set_Jprojective_coordinates_GFp
+# define ec_GFp_simple_set_Jprojective_coordinates_GFp \
+ ec_GFp_smp_set_Jproj_coords_GFp
+# undef ec_GFp_simple_get_Jprojective_coordinates_GFp
+# define ec_GFp_simple_get_Jprojective_coordinates_GFp \
+ ec_GFp_smp_get_Jproj_coords_GFp
+# undef ec_GFp_simple_point_set_affine_coordinates_GFp
+# define ec_GFp_simple_point_set_affine_coordinates_GFp \
+ ec_GFp_smp_pt_set_af_coords_GFp
+# undef ec_GFp_simple_point_get_affine_coordinates_GFp
+# define ec_GFp_simple_point_get_affine_coordinates_GFp \
+ ec_GFp_smp_pt_get_af_coords_GFp
+# undef ec_GFp_simple_set_compressed_coordinates_GFp
+# define ec_GFp_simple_set_compressed_coordinates_GFp \
+ ec_GFp_smp_set_compr_coords_GFp
+# undef ec_GFp_simple_point_set_affine_coordinates
+# define ec_GFp_simple_point_set_affine_coordinates \
+ ec_GFp_smp_pt_set_af_coords
+# undef ec_GFp_simple_point_get_affine_coordinates
+# define ec_GFp_simple_point_get_affine_coordinates \
+ ec_GFp_smp_pt_get_af_coords
+# undef ec_GFp_simple_set_compressed_coordinates
+# define ec_GFp_simple_set_compressed_coordinates \
+ ec_GFp_smp_set_compr_coords
+# undef ec_GFp_simple_group_check_discriminant
+# define ec_GFp_simple_group_check_discriminant ec_GFp_simple_grp_chk_discrim
+
+/* Hack som long STORE names */
+# undef STORE_method_set_initialise_function
+# define STORE_method_set_initialise_function STORE_meth_set_initialise_fn
+# undef STORE_method_set_cleanup_function
+# define STORE_method_set_cleanup_function STORE_meth_set_cleanup_fn
+# undef STORE_method_set_generate_function
+# define STORE_method_set_generate_function STORE_meth_set_generate_fn
+# undef STORE_method_set_modify_function
+# define STORE_method_set_modify_function STORE_meth_set_modify_fn
+# undef STORE_method_set_revoke_function
+# define STORE_method_set_revoke_function STORE_meth_set_revoke_fn
+# undef STORE_method_set_delete_function
+# define STORE_method_set_delete_function STORE_meth_set_delete_fn
+# undef STORE_method_set_list_start_function
+# define STORE_method_set_list_start_function STORE_meth_set_list_start_fn
+# undef STORE_method_set_list_next_function
+# define STORE_method_set_list_next_function STORE_meth_set_list_next_fn
+# undef STORE_method_set_list_end_function
+# define STORE_method_set_list_end_function STORE_meth_set_list_end_fn
+# undef STORE_method_set_update_store_function
+# define STORE_method_set_update_store_function STORE_meth_set_update_store_fn
+# undef STORE_method_set_lock_store_function
+# define STORE_method_set_lock_store_function STORE_meth_set_lock_store_fn
+# undef STORE_method_set_unlock_store_function
+# define STORE_method_set_unlock_store_function STORE_meth_set_unlock_store_fn
+# undef STORE_method_get_initialise_function
+# define STORE_method_get_initialise_function STORE_meth_get_initialise_fn
+# undef STORE_method_get_cleanup_function
+# define STORE_method_get_cleanup_function STORE_meth_get_cleanup_fn
+# undef STORE_method_get_generate_function
+# define STORE_method_get_generate_function STORE_meth_get_generate_fn
+# undef STORE_method_get_modify_function
+# define STORE_method_get_modify_function STORE_meth_get_modify_fn
+# undef STORE_method_get_revoke_function
+# define STORE_method_get_revoke_function STORE_meth_get_revoke_fn
+# undef STORE_method_get_delete_function
+# define STORE_method_get_delete_function STORE_meth_get_delete_fn
+# undef STORE_method_get_list_start_function
+# define STORE_method_get_list_start_function STORE_meth_get_list_start_fn
+# undef STORE_method_get_list_next_function
+# define STORE_method_get_list_next_function STORE_meth_get_list_next_fn
+# undef STORE_method_get_list_end_function
+# define STORE_method_get_list_end_function STORE_meth_get_list_end_fn
+# undef STORE_method_get_update_store_function
+# define STORE_method_get_update_store_function STORE_meth_get_update_store_fn
+# undef STORE_method_get_lock_store_function
+# define STORE_method_get_lock_store_function STORE_meth_get_lock_store_fn
+# undef STORE_method_get_unlock_store_function
+# define STORE_method_get_unlock_store_function STORE_meth_get_unlock_store_fn
+
+/* Hack some long TS names */
+# undef TS_RESP_CTX_set_status_info_cond
+# define TS_RESP_CTX_set_status_info_cond TS_RESP_CTX_set_stat_info_cond
+# undef TS_RESP_CTX_set_clock_precision_digits
+# define TS_RESP_CTX_set_clock_precision_digits TS_RESP_CTX_set_clk_prec_digits
+# undef TS_CONF_set_clock_precision_digits
+# define TS_CONF_set_clock_precision_digits TS_CONF_set_clk_prec_digits
+
+/* Hack some long CMS names */
+# undef CMS_RecipientInfo_ktri_get0_algs
+# define CMS_RecipientInfo_ktri_get0_algs CMS_RecipInfo_ktri_get0_algs
+# undef CMS_RecipientInfo_ktri_get0_signer_id
+# define CMS_RecipientInfo_ktri_get0_signer_id CMS_RecipInfo_ktri_get0_sigr_id
+# undef CMS_OtherRevocationInfoFormat_it
+# define CMS_OtherRevocationInfoFormat_it CMS_OtherRevocInfoFormat_it
+# undef CMS_KeyAgreeRecipientIdentifier_it
+# define CMS_KeyAgreeRecipientIdentifier_it CMS_KeyAgreeRecipIdentifier_it
+# undef CMS_OriginatorIdentifierOrKey_it
+# define CMS_OriginatorIdentifierOrKey_it CMS_OriginatorIdOrKey_it
+# undef cms_SignerIdentifier_get0_signer_id
+# define cms_SignerIdentifier_get0_signer_id cms_SignerId_get0_signer_id
+# undef CMS_RecipientInfo_kari_get0_orig_id
+# define CMS_RecipientInfo_kari_get0_orig_id CMS_RecipInfo_kari_get0_orig_id
+# undef CMS_RecipientInfo_kari_get0_reks
+# define CMS_RecipientInfo_kari_get0_reks CMS_RecipInfo_kari_get0_reks
+# undef CMS_RecipientEncryptedKey_cert_cmp
+# define CMS_RecipientEncryptedKey_cert_cmp CMS_RecipEncryptedKey_cert_cmp
+# undef CMS_RecipientInfo_kari_set0_pkey
+# define CMS_RecipientInfo_kari_set0_pkey CMS_RecipInfo_kari_set0_pkey
+# undef CMS_RecipientEncryptedKey_get0_id
+# define CMS_RecipientEncryptedKey_get0_id CMS_RecipEncryptedKey_get0_id
+# undef CMS_RecipientInfo_kari_orig_id_cmp
+# define CMS_RecipientInfo_kari_orig_id_cmp CMS_RecipInfo_kari_orig_id_cmp
+
+/* Hack some long DTLS1 names */
+# undef dtls1_retransmit_buffered_messages
+# define dtls1_retransmit_buffered_messages dtls1_retransmit_buffered_msgs
+
+/* Hack some long SRP names */
+# undef SRP_generate_server_master_secret
+# define SRP_generate_server_master_secret SRP_gen_server_master_secret
+# undef SRP_generate_client_master_secret
+# define SRP_generate_client_master_secret SRP_gen_client_master_secret
+
+/* Hack some long UI names */
+# undef UI_method_get_prompt_constructor
+# define UI_method_get_prompt_constructor UI_method_get_prompt_constructr
+# undef UI_method_set_prompt_constructor
+# define UI_method_set_prompt_constructor UI_method_set_prompt_constructr
+
+# endif /* defined OPENSSL_SYS_VMS */
+
+/* Case insensitive linking causes problems.... */
+# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2)
+# undef ERR_load_CRYPTO_strings
+# define ERR_load_CRYPTO_strings ERR_load_CRYPTOlib_strings
+# undef OCSP_crlID_new
+# define OCSP_crlID_new OCSP_crlID2_new
+
+# undef d2i_ECPARAMETERS
+# define d2i_ECPARAMETERS d2i_UC_ECPARAMETERS
+# undef i2d_ECPARAMETERS
+# define i2d_ECPARAMETERS i2d_UC_ECPARAMETERS
+# undef d2i_ECPKPARAMETERS
+# define d2i_ECPKPARAMETERS d2i_UC_ECPKPARAMETERS
+# undef i2d_ECPKPARAMETERS
+# define i2d_ECPKPARAMETERS i2d_UC_ECPKPARAMETERS
+
+/*
+ * These functions do not seem to exist! However, I'm paranoid... Original
+ * command in x509v3.h: These functions are being redefined in another
+ * directory, and clash when the linker is case-insensitive, so let's hide
+ * them a little, by giving them an extra 'o' at the beginning of the name...
+ */
+# undef X509v3_cleanup_extensions
+# define X509v3_cleanup_extensions oX509v3_cleanup_extensions
+# undef X509v3_add_extension
+# define X509v3_add_extension oX509v3_add_extension
+# undef X509v3_add_netscape_extensions
+# define X509v3_add_netscape_extensions oX509v3_add_netscape_extensions
+# undef X509v3_add_standard_extensions
+# define X509v3_add_standard_extensions oX509v3_add_standard_extensions
+
+/* This one clashes with CMS_data_create */
+# undef cms_Data_create
+# define cms_Data_create priv_cms_Data_create
+
+# endif
+
+#endif /* ! defined HEADER_VMS_IDHACKS_H */
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/tls1.h b/protocols/Telegram/tgl/openssl/include/openssl/tls1.h
new file mode 100644
index 0000000000..5929607ff8
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/tls1.h
@@ -0,0 +1,813 @@
+/* ssl/tls1.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+/* ====================================================================
+ * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+/* ====================================================================
+ * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
+ *
+ * Portions of the attached software ("Contribution") are developed by
+ * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project.
+ *
+ * The Contribution is licensed pursuant to the OpenSSL open source
+ * license provided above.
+ *
+ * ECC cipher suite support in OpenSSL originally written by
+ * Vipul Gupta and Sumit Gupta of Sun Microsystems Laboratories.
+ *
+ */
+/* ====================================================================
+ * Copyright 2005 Nokia. All rights reserved.
+ *
+ * The portions of the attached software ("Contribution") is developed by
+ * Nokia Corporation and is licensed pursuant to the OpenSSL open source
+ * license.
+ *
+ * The Contribution, originally written by Mika Kousa and Pasi Eronen of
+ * Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites
+ * support (see RFC 4279) to OpenSSL.
+ *
+ * No patent licenses or other rights except those expressly stated in
+ * the OpenSSL open source license shall be deemed granted or received
+ * expressly, by implication, estoppel, or otherwise.
+ *
+ * No assurances are provided by Nokia that the Contribution does not
+ * infringe the patent or other intellectual property rights of any third
+ * party or that the license provides you with all the necessary rights
+ * to make use of the Contribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN
+ * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA
+ * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY
+ * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR
+ * OTHERWISE.
+ */
+
+#ifndef HEADER_TLS1_H
+# define HEADER_TLS1_H
+
+# include <openssl/buffer.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# define TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES 0
+
+# define TLS1_VERSION 0x0301
+# define TLS1_1_VERSION 0x0302
+# define TLS1_2_VERSION 0x0303
+# define TLS_MAX_VERSION TLS1_2_VERSION
+
+# define TLS1_VERSION_MAJOR 0x03
+# define TLS1_VERSION_MINOR 0x01
+
+# define TLS1_1_VERSION_MAJOR 0x03
+# define TLS1_1_VERSION_MINOR 0x02
+
+# define TLS1_2_VERSION_MAJOR 0x03
+# define TLS1_2_VERSION_MINOR 0x03
+
+# define TLS1_get_version(s) \
+ ((s->version >> 8) == TLS1_VERSION_MAJOR ? s->version : 0)
+
+# define TLS1_get_client_version(s) \
+ ((s->client_version >> 8) == TLS1_VERSION_MAJOR ? s->client_version : 0)
+
+# define TLS1_AD_DECRYPTION_FAILED 21
+# define TLS1_AD_RECORD_OVERFLOW 22
+# define TLS1_AD_UNKNOWN_CA 48/* fatal */
+# define TLS1_AD_ACCESS_DENIED 49/* fatal */
+# define TLS1_AD_DECODE_ERROR 50/* fatal */
+# define TLS1_AD_DECRYPT_ERROR 51
+# define TLS1_AD_EXPORT_RESTRICTION 60/* fatal */
+# define TLS1_AD_PROTOCOL_VERSION 70/* fatal */
+# define TLS1_AD_INSUFFICIENT_SECURITY 71/* fatal */
+# define TLS1_AD_INTERNAL_ERROR 80/* fatal */
+# define TLS1_AD_INAPPROPRIATE_FALLBACK 86/* fatal */
+# define TLS1_AD_USER_CANCELLED 90
+# define TLS1_AD_NO_RENEGOTIATION 100
+/* codes 110-114 are from RFC3546 */
+# define TLS1_AD_UNSUPPORTED_EXTENSION 110
+# define TLS1_AD_CERTIFICATE_UNOBTAINABLE 111
+# define TLS1_AD_UNRECOGNIZED_NAME 112
+# define TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE 113
+# define TLS1_AD_BAD_CERTIFICATE_HASH_VALUE 114
+# define TLS1_AD_UNKNOWN_PSK_IDENTITY 115/* fatal */
+
+/* ExtensionType values from RFC3546 / RFC4366 / RFC6066 */
+# define TLSEXT_TYPE_server_name 0
+# define TLSEXT_TYPE_max_fragment_length 1
+# define TLSEXT_TYPE_client_certificate_url 2
+# define TLSEXT_TYPE_trusted_ca_keys 3
+# define TLSEXT_TYPE_truncated_hmac 4
+# define TLSEXT_TYPE_status_request 5
+/* ExtensionType values from RFC4681 */
+# define TLSEXT_TYPE_user_mapping 6
+/* ExtensionType values from RFC5878 */
+# define TLSEXT_TYPE_client_authz 7
+# define TLSEXT_TYPE_server_authz 8
+/* ExtensionType values from RFC6091 */
+# define TLSEXT_TYPE_cert_type 9
+
+/* ExtensionType values from RFC4492 */
+# define TLSEXT_TYPE_elliptic_curves 10
+# define TLSEXT_TYPE_ec_point_formats 11
+
+/* ExtensionType value from RFC5054 */
+# define TLSEXT_TYPE_srp 12
+
+/* ExtensionType values from RFC5246 */
+# define TLSEXT_TYPE_signature_algorithms 13
+
+/* ExtensionType value from RFC5764 */
+# define TLSEXT_TYPE_use_srtp 14
+
+/* ExtensionType value from RFC5620 */
+# define TLSEXT_TYPE_heartbeat 15
+
+/* ExtensionType value from draft-ietf-tls-applayerprotoneg-00 */
+# define TLSEXT_TYPE_application_layer_protocol_negotiation 16
+
+/*
+ * ExtensionType value for TLS padding extension.
+ * http://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml
+ * http://tools.ietf.org/html/draft-agl-tls-padding-03
+ */
+# define TLSEXT_TYPE_padding 21
+
+/* ExtensionType value from RFC4507 */
+# define TLSEXT_TYPE_session_ticket 35
+
+/* ExtensionType value from draft-rescorla-tls-opaque-prf-input-00.txt */
+# if 0
+/*
+ * will have to be provided externally for now ,
+ * i.e. build with -DTLSEXT_TYPE_opaque_prf_input=38183
+ * using whatever extension number you'd like to try
+ */
+# define TLSEXT_TYPE_opaque_prf_input ??
+# endif
+
+/* Temporary extension type */
+# define TLSEXT_TYPE_renegotiate 0xff01
+
+# ifndef OPENSSL_NO_NEXTPROTONEG
+/* This is not an IANA defined extension number */
+# define TLSEXT_TYPE_next_proto_neg 13172
+# endif
+
+/* NameType value from RFC 3546 */
+# define TLSEXT_NAMETYPE_host_name 0
+/* status request value from RFC 3546 */
+# define TLSEXT_STATUSTYPE_ocsp 1
+
+/* ECPointFormat values from draft-ietf-tls-ecc-12 */
+# define TLSEXT_ECPOINTFORMAT_first 0
+# define TLSEXT_ECPOINTFORMAT_uncompressed 0
+# define TLSEXT_ECPOINTFORMAT_ansiX962_compressed_prime 1
+# define TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2 2
+# define TLSEXT_ECPOINTFORMAT_last 2
+
+/* Signature and hash algorithms from RFC 5246 */
+
+# define TLSEXT_signature_anonymous 0
+# define TLSEXT_signature_rsa 1
+# define TLSEXT_signature_dsa 2
+# define TLSEXT_signature_ecdsa 3
+
+/* Total number of different signature algorithms */
+# define TLSEXT_signature_num 4
+
+# define TLSEXT_hash_none 0
+# define TLSEXT_hash_md5 1
+# define TLSEXT_hash_sha1 2
+# define TLSEXT_hash_sha224 3
+# define TLSEXT_hash_sha256 4
+# define TLSEXT_hash_sha384 5
+# define TLSEXT_hash_sha512 6
+
+/* Total number of different digest algorithms */
+
+# define TLSEXT_hash_num 7
+
+/* Flag set for unrecognised algorithms */
+# define TLSEXT_nid_unknown 0x1000000
+
+/* ECC curves */
+
+# define TLSEXT_curve_P_256 23
+# define TLSEXT_curve_P_384 24
+
+# ifndef OPENSSL_NO_TLSEXT
+
+# define TLSEXT_MAXLEN_host_name 255
+
+const char *SSL_get_servername(const SSL *s, const int type);
+int SSL_get_servername_type(const SSL *s);
+/*
+ * SSL_export_keying_material exports a value derived from the master secret,
+ * as specified in RFC 5705. It writes |olen| bytes to |out| given a label and
+ * optional context. (Since a zero length context is allowed, the |use_context|
+ * flag controls whether a context is included.) It returns 1 on success and
+ * zero otherwise.
+ */
+int SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen,
+ const char *label, size_t llen,
+ const unsigned char *p, size_t plen,
+ int use_context);
+
+int SSL_get_sigalgs(SSL *s, int idx,
+ int *psign, int *phash, int *psignandhash,
+ unsigned char *rsig, unsigned char *rhash);
+
+int SSL_get_shared_sigalgs(SSL *s, int idx,
+ int *psign, int *phash, int *psignandhash,
+ unsigned char *rsig, unsigned char *rhash);
+
+int SSL_check_chain(SSL *s, X509 *x, EVP_PKEY *pk, STACK_OF(X509) *chain);
+
+# define SSL_set_tlsext_host_name(s,name) \
+SSL_ctrl(s,SSL_CTRL_SET_TLSEXT_HOSTNAME,TLSEXT_NAMETYPE_host_name,(char *)name)
+
+# define SSL_set_tlsext_debug_callback(ssl, cb) \
+SSL_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_CB,(void (*)(void))cb)
+
+# define SSL_set_tlsext_debug_arg(ssl, arg) \
+SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_ARG,0, (void *)arg)
+
+# define SSL_set_tlsext_status_type(ssl, type) \
+SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE,type, NULL)
+
+# define SSL_get_tlsext_status_exts(ssl, arg) \
+SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS,0, (void *)arg)
+
+# define SSL_set_tlsext_status_exts(ssl, arg) \
+SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS,0, (void *)arg)
+
+# define SSL_get_tlsext_status_ids(ssl, arg) \
+SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS,0, (void *)arg)
+
+# define SSL_set_tlsext_status_ids(ssl, arg) \
+SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS,0, (void *)arg)
+
+# define SSL_get_tlsext_status_ocsp_resp(ssl, arg) \
+SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP,0, (void *)arg)
+
+# define SSL_set_tlsext_status_ocsp_resp(ssl, arg, arglen) \
+SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP,arglen, (void *)arg)
+
+# define SSL_CTX_set_tlsext_servername_callback(ctx, cb) \
+SSL_CTX_callback_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_CB,(void (*)(void))cb)
+
+# define SSL_TLSEXT_ERR_OK 0
+# define SSL_TLSEXT_ERR_ALERT_WARNING 1
+# define SSL_TLSEXT_ERR_ALERT_FATAL 2
+# define SSL_TLSEXT_ERR_NOACK 3
+
+# define SSL_CTX_set_tlsext_servername_arg(ctx, arg) \
+SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG,0, (void *)arg)
+
+# define SSL_CTX_get_tlsext_ticket_keys(ctx, keys, keylen) \
+ SSL_CTX_ctrl((ctx),SSL_CTRL_GET_TLSEXT_TICKET_KEYS,(keylen),(keys))
+# define SSL_CTX_set_tlsext_ticket_keys(ctx, keys, keylen) \
+ SSL_CTX_ctrl((ctx),SSL_CTRL_SET_TLSEXT_TICKET_KEYS,(keylen),(keys))
+
+# define SSL_CTX_set_tlsext_status_cb(ssl, cb) \
+SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB,(void (*)(void))cb)
+
+# define SSL_CTX_set_tlsext_status_arg(ssl, arg) \
+SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg)
+
+# define SSL_set_tlsext_opaque_prf_input(s, src, len) \
+SSL_ctrl(s,SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT, len, src)
+# define SSL_CTX_set_tlsext_opaque_prf_input_callback(ctx, cb) \
+SSL_CTX_callback_ctrl(ctx,SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB, (void (*)(void))cb)
+# define SSL_CTX_set_tlsext_opaque_prf_input_callback_arg(ctx, arg) \
+SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB_ARG, 0, arg)
+
+# define SSL_CTX_set_tlsext_ticket_key_cb(ssl, cb) \
+SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb)
+
+# ifndef OPENSSL_NO_HEARTBEATS
+# define SSL_TLSEXT_HB_ENABLED 0x01
+# define SSL_TLSEXT_HB_DONT_SEND_REQUESTS 0x02
+# define SSL_TLSEXT_HB_DONT_RECV_REQUESTS 0x04
+
+# define SSL_get_tlsext_heartbeat_pending(ssl) \
+ SSL_ctrl((ssl),SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING,0,NULL)
+# define SSL_set_tlsext_heartbeat_no_requests(ssl, arg) \
+ SSL_ctrl((ssl),SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS,arg,NULL)
+# endif
+# endif
+
+/* PSK ciphersuites from 4279 */
+# define TLS1_CK_PSK_WITH_RC4_128_SHA 0x0300008A
+# define TLS1_CK_PSK_WITH_3DES_EDE_CBC_SHA 0x0300008B
+# define TLS1_CK_PSK_WITH_AES_128_CBC_SHA 0x0300008C
+# define TLS1_CK_PSK_WITH_AES_256_CBC_SHA 0x0300008D
+
+/*
+ * Additional TLS ciphersuites from expired Internet Draft
+ * draft-ietf-tls-56-bit-ciphersuites-01.txt (available if
+ * TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES is defined, see s3_lib.c). We
+ * actually treat them like SSL 3.0 ciphers, which we probably shouldn't.
+ * Note that the first two are actually not in the IDs.
+ */
+# define TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_MD5 0x03000060/* not in
+ * ID */
+# define TLS1_CK_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5 0x03000061/* not in
+ * ID */
+# define TLS1_CK_RSA_EXPORT1024_WITH_DES_CBC_SHA 0x03000062
+# define TLS1_CK_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA 0x03000063
+# define TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_SHA 0x03000064
+# define TLS1_CK_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA 0x03000065
+# define TLS1_CK_DHE_DSS_WITH_RC4_128_SHA 0x03000066
+
+/* AES ciphersuites from RFC3268 */
+
+# define TLS1_CK_RSA_WITH_AES_128_SHA 0x0300002F
+# define TLS1_CK_DH_DSS_WITH_AES_128_SHA 0x03000030
+# define TLS1_CK_DH_RSA_WITH_AES_128_SHA 0x03000031
+# define TLS1_CK_DHE_DSS_WITH_AES_128_SHA 0x03000032
+# define TLS1_CK_DHE_RSA_WITH_AES_128_SHA 0x03000033
+# define TLS1_CK_ADH_WITH_AES_128_SHA 0x03000034
+
+# define TLS1_CK_RSA_WITH_AES_256_SHA 0x03000035
+# define TLS1_CK_DH_DSS_WITH_AES_256_SHA 0x03000036
+# define TLS1_CK_DH_RSA_WITH_AES_256_SHA 0x03000037
+# define TLS1_CK_DHE_DSS_WITH_AES_256_SHA 0x03000038
+# define TLS1_CK_DHE_RSA_WITH_AES_256_SHA 0x03000039
+# define TLS1_CK_ADH_WITH_AES_256_SHA 0x0300003A
+
+/* TLS v1.2 ciphersuites */
+# define TLS1_CK_RSA_WITH_NULL_SHA256 0x0300003B
+# define TLS1_CK_RSA_WITH_AES_128_SHA256 0x0300003C
+# define TLS1_CK_RSA_WITH_AES_256_SHA256 0x0300003D
+# define TLS1_CK_DH_DSS_WITH_AES_128_SHA256 0x0300003E
+# define TLS1_CK_DH_RSA_WITH_AES_128_SHA256 0x0300003F
+# define TLS1_CK_DHE_DSS_WITH_AES_128_SHA256 0x03000040
+
+/* Camellia ciphersuites from RFC4132 */
+# define TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000041
+# define TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA 0x03000042
+# define TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000043
+# define TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA 0x03000044
+# define TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000045
+# define TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA 0x03000046
+
+/* TLS v1.2 ciphersuites */
+# define TLS1_CK_DHE_RSA_WITH_AES_128_SHA256 0x03000067
+# define TLS1_CK_DH_DSS_WITH_AES_256_SHA256 0x03000068
+# define TLS1_CK_DH_RSA_WITH_AES_256_SHA256 0x03000069
+# define TLS1_CK_DHE_DSS_WITH_AES_256_SHA256 0x0300006A
+# define TLS1_CK_DHE_RSA_WITH_AES_256_SHA256 0x0300006B
+# define TLS1_CK_ADH_WITH_AES_128_SHA256 0x0300006C
+# define TLS1_CK_ADH_WITH_AES_256_SHA256 0x0300006D
+
+/* Camellia ciphersuites from RFC4132 */
+# define TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000084
+# define TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA 0x03000085
+# define TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000086
+# define TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA 0x03000087
+# define TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000088
+# define TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA 0x03000089
+
+/* SEED ciphersuites from RFC4162 */
+# define TLS1_CK_RSA_WITH_SEED_SHA 0x03000096
+# define TLS1_CK_DH_DSS_WITH_SEED_SHA 0x03000097
+# define TLS1_CK_DH_RSA_WITH_SEED_SHA 0x03000098
+# define TLS1_CK_DHE_DSS_WITH_SEED_SHA 0x03000099
+# define TLS1_CK_DHE_RSA_WITH_SEED_SHA 0x0300009A
+# define TLS1_CK_ADH_WITH_SEED_SHA 0x0300009B
+
+/* TLS v1.2 GCM ciphersuites from RFC5288 */
+# define TLS1_CK_RSA_WITH_AES_128_GCM_SHA256 0x0300009C
+# define TLS1_CK_RSA_WITH_AES_256_GCM_SHA384 0x0300009D
+# define TLS1_CK_DHE_RSA_WITH_AES_128_GCM_SHA256 0x0300009E
+# define TLS1_CK_DHE_RSA_WITH_AES_256_GCM_SHA384 0x0300009F
+# define TLS1_CK_DH_RSA_WITH_AES_128_GCM_SHA256 0x030000A0
+# define TLS1_CK_DH_RSA_WITH_AES_256_GCM_SHA384 0x030000A1
+# define TLS1_CK_DHE_DSS_WITH_AES_128_GCM_SHA256 0x030000A2
+# define TLS1_CK_DHE_DSS_WITH_AES_256_GCM_SHA384 0x030000A3
+# define TLS1_CK_DH_DSS_WITH_AES_128_GCM_SHA256 0x030000A4
+# define TLS1_CK_DH_DSS_WITH_AES_256_GCM_SHA384 0x030000A5
+# define TLS1_CK_ADH_WITH_AES_128_GCM_SHA256 0x030000A6
+# define TLS1_CK_ADH_WITH_AES_256_GCM_SHA384 0x030000A7
+
+/*
+ * ECC ciphersuites from draft-ietf-tls-ecc-12.txt with changes soon to be in
+ * draft 13
+ */
+# define TLS1_CK_ECDH_ECDSA_WITH_NULL_SHA 0x0300C001
+# define TLS1_CK_ECDH_ECDSA_WITH_RC4_128_SHA 0x0300C002
+# define TLS1_CK_ECDH_ECDSA_WITH_DES_192_CBC3_SHA 0x0300C003
+# define TLS1_CK_ECDH_ECDSA_WITH_AES_128_CBC_SHA 0x0300C004
+# define TLS1_CK_ECDH_ECDSA_WITH_AES_256_CBC_SHA 0x0300C005
+
+# define TLS1_CK_ECDHE_ECDSA_WITH_NULL_SHA 0x0300C006
+# define TLS1_CK_ECDHE_ECDSA_WITH_RC4_128_SHA 0x0300C007
+# define TLS1_CK_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA 0x0300C008
+# define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA 0x0300C009
+# define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA 0x0300C00A
+
+# define TLS1_CK_ECDH_RSA_WITH_NULL_SHA 0x0300C00B
+# define TLS1_CK_ECDH_RSA_WITH_RC4_128_SHA 0x0300C00C
+# define TLS1_CK_ECDH_RSA_WITH_DES_192_CBC3_SHA 0x0300C00D
+# define TLS1_CK_ECDH_RSA_WITH_AES_128_CBC_SHA 0x0300C00E
+# define TLS1_CK_ECDH_RSA_WITH_AES_256_CBC_SHA 0x0300C00F
+
+# define TLS1_CK_ECDHE_RSA_WITH_NULL_SHA 0x0300C010
+# define TLS1_CK_ECDHE_RSA_WITH_RC4_128_SHA 0x0300C011
+# define TLS1_CK_ECDHE_RSA_WITH_DES_192_CBC3_SHA 0x0300C012
+# define TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA 0x0300C013
+# define TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA 0x0300C014
+
+# define TLS1_CK_ECDH_anon_WITH_NULL_SHA 0x0300C015
+# define TLS1_CK_ECDH_anon_WITH_RC4_128_SHA 0x0300C016
+# define TLS1_CK_ECDH_anon_WITH_DES_192_CBC3_SHA 0x0300C017
+# define TLS1_CK_ECDH_anon_WITH_AES_128_CBC_SHA 0x0300C018
+# define TLS1_CK_ECDH_anon_WITH_AES_256_CBC_SHA 0x0300C019
+
+/* SRP ciphersuites from RFC 5054 */
+# define TLS1_CK_SRP_SHA_WITH_3DES_EDE_CBC_SHA 0x0300C01A
+# define TLS1_CK_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA 0x0300C01B
+# define TLS1_CK_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA 0x0300C01C
+# define TLS1_CK_SRP_SHA_WITH_AES_128_CBC_SHA 0x0300C01D
+# define TLS1_CK_SRP_SHA_RSA_WITH_AES_128_CBC_SHA 0x0300C01E
+# define TLS1_CK_SRP_SHA_DSS_WITH_AES_128_CBC_SHA 0x0300C01F
+# define TLS1_CK_SRP_SHA_WITH_AES_256_CBC_SHA 0x0300C020
+# define TLS1_CK_SRP_SHA_RSA_WITH_AES_256_CBC_SHA 0x0300C021
+# define TLS1_CK_SRP_SHA_DSS_WITH_AES_256_CBC_SHA 0x0300C022
+
+/* ECDH HMAC based ciphersuites from RFC5289 */
+
+# define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_SHA256 0x0300C023
+# define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_SHA384 0x0300C024
+# define TLS1_CK_ECDH_ECDSA_WITH_AES_128_SHA256 0x0300C025
+# define TLS1_CK_ECDH_ECDSA_WITH_AES_256_SHA384 0x0300C026
+# define TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256 0x0300C027
+# define TLS1_CK_ECDHE_RSA_WITH_AES_256_SHA384 0x0300C028
+# define TLS1_CK_ECDH_RSA_WITH_AES_128_SHA256 0x0300C029
+# define TLS1_CK_ECDH_RSA_WITH_AES_256_SHA384 0x0300C02A
+
+/* ECDH GCM based ciphersuites from RFC5289 */
+# define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 0x0300C02B
+# define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 0x0300C02C
+# define TLS1_CK_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 0x0300C02D
+# define TLS1_CK_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 0x0300C02E
+# define TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256 0x0300C02F
+# define TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384 0x0300C030
+# define TLS1_CK_ECDH_RSA_WITH_AES_128_GCM_SHA256 0x0300C031
+# define TLS1_CK_ECDH_RSA_WITH_AES_256_GCM_SHA384 0x0300C032
+
+/*
+ * XXX * Backward compatibility alert: + * Older versions of OpenSSL gave
+ * some DHE ciphers names with "EDH" + * instead of "DHE". Going forward, we
+ * should be using DHE + * everywhere, though we may indefinitely maintain
+ * aliases for users + * or configurations that used "EDH" +
+ */
+# define TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_MD5 "EXP1024-RC4-MD5"
+# define TLS1_TXT_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5 "EXP1024-RC2-CBC-MD5"
+# define TLS1_TXT_RSA_EXPORT1024_WITH_DES_CBC_SHA "EXP1024-DES-CBC-SHA"
+# define TLS1_TXT_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA "EXP1024-DHE-DSS-DES-CBC-SHA"
+# define TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_SHA "EXP1024-RC4-SHA"
+# define TLS1_TXT_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA "EXP1024-DHE-DSS-RC4-SHA"
+# define TLS1_TXT_DHE_DSS_WITH_RC4_128_SHA "DHE-DSS-RC4-SHA"
+
+/* AES ciphersuites from RFC3268 */
+# define TLS1_TXT_RSA_WITH_AES_128_SHA "AES128-SHA"
+# define TLS1_TXT_DH_DSS_WITH_AES_128_SHA "DH-DSS-AES128-SHA"
+# define TLS1_TXT_DH_RSA_WITH_AES_128_SHA "DH-RSA-AES128-SHA"
+# define TLS1_TXT_DHE_DSS_WITH_AES_128_SHA "DHE-DSS-AES128-SHA"
+# define TLS1_TXT_DHE_RSA_WITH_AES_128_SHA "DHE-RSA-AES128-SHA"
+# define TLS1_TXT_ADH_WITH_AES_128_SHA "ADH-AES128-SHA"
+
+# define TLS1_TXT_RSA_WITH_AES_256_SHA "AES256-SHA"
+# define TLS1_TXT_DH_DSS_WITH_AES_256_SHA "DH-DSS-AES256-SHA"
+# define TLS1_TXT_DH_RSA_WITH_AES_256_SHA "DH-RSA-AES256-SHA"
+# define TLS1_TXT_DHE_DSS_WITH_AES_256_SHA "DHE-DSS-AES256-SHA"
+# define TLS1_TXT_DHE_RSA_WITH_AES_256_SHA "DHE-RSA-AES256-SHA"
+# define TLS1_TXT_ADH_WITH_AES_256_SHA "ADH-AES256-SHA"
+
+/* ECC ciphersuites from draft-ietf-tls-ecc-01.txt (Mar 15, 2001) */
+# define TLS1_TXT_ECDH_ECDSA_WITH_NULL_SHA "ECDH-ECDSA-NULL-SHA"
+# define TLS1_TXT_ECDH_ECDSA_WITH_RC4_128_SHA "ECDH-ECDSA-RC4-SHA"
+# define TLS1_TXT_ECDH_ECDSA_WITH_DES_192_CBC3_SHA "ECDH-ECDSA-DES-CBC3-SHA"
+# define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_CBC_SHA "ECDH-ECDSA-AES128-SHA"
+# define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_CBC_SHA "ECDH-ECDSA-AES256-SHA"
+
+# define TLS1_TXT_ECDHE_ECDSA_WITH_NULL_SHA "ECDHE-ECDSA-NULL-SHA"
+# define TLS1_TXT_ECDHE_ECDSA_WITH_RC4_128_SHA "ECDHE-ECDSA-RC4-SHA"
+# define TLS1_TXT_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA "ECDHE-ECDSA-DES-CBC3-SHA"
+# define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CBC_SHA "ECDHE-ECDSA-AES128-SHA"
+# define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CBC_SHA "ECDHE-ECDSA-AES256-SHA"
+
+# define TLS1_TXT_ECDH_RSA_WITH_NULL_SHA "ECDH-RSA-NULL-SHA"
+# define TLS1_TXT_ECDH_RSA_WITH_RC4_128_SHA "ECDH-RSA-RC4-SHA"
+# define TLS1_TXT_ECDH_RSA_WITH_DES_192_CBC3_SHA "ECDH-RSA-DES-CBC3-SHA"
+# define TLS1_TXT_ECDH_RSA_WITH_AES_128_CBC_SHA "ECDH-RSA-AES128-SHA"
+# define TLS1_TXT_ECDH_RSA_WITH_AES_256_CBC_SHA "ECDH-RSA-AES256-SHA"
+
+# define TLS1_TXT_ECDHE_RSA_WITH_NULL_SHA "ECDHE-RSA-NULL-SHA"
+# define TLS1_TXT_ECDHE_RSA_WITH_RC4_128_SHA "ECDHE-RSA-RC4-SHA"
+# define TLS1_TXT_ECDHE_RSA_WITH_DES_192_CBC3_SHA "ECDHE-RSA-DES-CBC3-SHA"
+# define TLS1_TXT_ECDHE_RSA_WITH_AES_128_CBC_SHA "ECDHE-RSA-AES128-SHA"
+# define TLS1_TXT_ECDHE_RSA_WITH_AES_256_CBC_SHA "ECDHE-RSA-AES256-SHA"
+
+# define TLS1_TXT_ECDH_anon_WITH_NULL_SHA "AECDH-NULL-SHA"
+# define TLS1_TXT_ECDH_anon_WITH_RC4_128_SHA "AECDH-RC4-SHA"
+# define TLS1_TXT_ECDH_anon_WITH_DES_192_CBC3_SHA "AECDH-DES-CBC3-SHA"
+# define TLS1_TXT_ECDH_anon_WITH_AES_128_CBC_SHA "AECDH-AES128-SHA"
+# define TLS1_TXT_ECDH_anon_WITH_AES_256_CBC_SHA "AECDH-AES256-SHA"
+
+/* PSK ciphersuites from RFC 4279 */
+# define TLS1_TXT_PSK_WITH_RC4_128_SHA "PSK-RC4-SHA"
+# define TLS1_TXT_PSK_WITH_3DES_EDE_CBC_SHA "PSK-3DES-EDE-CBC-SHA"
+# define TLS1_TXT_PSK_WITH_AES_128_CBC_SHA "PSK-AES128-CBC-SHA"
+# define TLS1_TXT_PSK_WITH_AES_256_CBC_SHA "PSK-AES256-CBC-SHA"
+
+/* SRP ciphersuite from RFC 5054 */
+# define TLS1_TXT_SRP_SHA_WITH_3DES_EDE_CBC_SHA "SRP-3DES-EDE-CBC-SHA"
+# define TLS1_TXT_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA "SRP-RSA-3DES-EDE-CBC-SHA"
+# define TLS1_TXT_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA "SRP-DSS-3DES-EDE-CBC-SHA"
+# define TLS1_TXT_SRP_SHA_WITH_AES_128_CBC_SHA "SRP-AES-128-CBC-SHA"
+# define TLS1_TXT_SRP_SHA_RSA_WITH_AES_128_CBC_SHA "SRP-RSA-AES-128-CBC-SHA"
+# define TLS1_TXT_SRP_SHA_DSS_WITH_AES_128_CBC_SHA "SRP-DSS-AES-128-CBC-SHA"
+# define TLS1_TXT_SRP_SHA_WITH_AES_256_CBC_SHA "SRP-AES-256-CBC-SHA"
+# define TLS1_TXT_SRP_SHA_RSA_WITH_AES_256_CBC_SHA "SRP-RSA-AES-256-CBC-SHA"
+# define TLS1_TXT_SRP_SHA_DSS_WITH_AES_256_CBC_SHA "SRP-DSS-AES-256-CBC-SHA"
+
+/* Camellia ciphersuites from RFC4132 */
+# define TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA "CAMELLIA128-SHA"
+# define TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA "DH-DSS-CAMELLIA128-SHA"
+# define TLS1_TXT_DH_RSA_WITH_CAMELLIA_128_CBC_SHA "DH-RSA-CAMELLIA128-SHA"
+# define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA "DHE-DSS-CAMELLIA128-SHA"
+# define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA "DHE-RSA-CAMELLIA128-SHA"
+# define TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA "ADH-CAMELLIA128-SHA"
+
+# define TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA "CAMELLIA256-SHA"
+# define TLS1_TXT_DH_DSS_WITH_CAMELLIA_256_CBC_SHA "DH-DSS-CAMELLIA256-SHA"
+# define TLS1_TXT_DH_RSA_WITH_CAMELLIA_256_CBC_SHA "DH-RSA-CAMELLIA256-SHA"
+# define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA "DHE-DSS-CAMELLIA256-SHA"
+# define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA "DHE-RSA-CAMELLIA256-SHA"
+# define TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA "ADH-CAMELLIA256-SHA"
+
+/* SEED ciphersuites from RFC4162 */
+# define TLS1_TXT_RSA_WITH_SEED_SHA "SEED-SHA"
+# define TLS1_TXT_DH_DSS_WITH_SEED_SHA "DH-DSS-SEED-SHA"
+# define TLS1_TXT_DH_RSA_WITH_SEED_SHA "DH-RSA-SEED-SHA"
+# define TLS1_TXT_DHE_DSS_WITH_SEED_SHA "DHE-DSS-SEED-SHA"
+# define TLS1_TXT_DHE_RSA_WITH_SEED_SHA "DHE-RSA-SEED-SHA"
+# define TLS1_TXT_ADH_WITH_SEED_SHA "ADH-SEED-SHA"
+
+/* TLS v1.2 ciphersuites */
+# define TLS1_TXT_RSA_WITH_NULL_SHA256 "NULL-SHA256"
+# define TLS1_TXT_RSA_WITH_AES_128_SHA256 "AES128-SHA256"
+# define TLS1_TXT_RSA_WITH_AES_256_SHA256 "AES256-SHA256"
+# define TLS1_TXT_DH_DSS_WITH_AES_128_SHA256 "DH-DSS-AES128-SHA256"
+# define TLS1_TXT_DH_RSA_WITH_AES_128_SHA256 "DH-RSA-AES128-SHA256"
+# define TLS1_TXT_DHE_DSS_WITH_AES_128_SHA256 "DHE-DSS-AES128-SHA256"
+# define TLS1_TXT_DHE_RSA_WITH_AES_128_SHA256 "DHE-RSA-AES128-SHA256"
+# define TLS1_TXT_DH_DSS_WITH_AES_256_SHA256 "DH-DSS-AES256-SHA256"
+# define TLS1_TXT_DH_RSA_WITH_AES_256_SHA256 "DH-RSA-AES256-SHA256"
+# define TLS1_TXT_DHE_DSS_WITH_AES_256_SHA256 "DHE-DSS-AES256-SHA256"
+# define TLS1_TXT_DHE_RSA_WITH_AES_256_SHA256 "DHE-RSA-AES256-SHA256"
+# define TLS1_TXT_ADH_WITH_AES_128_SHA256 "ADH-AES128-SHA256"
+# define TLS1_TXT_ADH_WITH_AES_256_SHA256 "ADH-AES256-SHA256"
+
+/* TLS v1.2 GCM ciphersuites from RFC5288 */
+# define TLS1_TXT_RSA_WITH_AES_128_GCM_SHA256 "AES128-GCM-SHA256"
+# define TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384 "AES256-GCM-SHA384"
+# define TLS1_TXT_DHE_RSA_WITH_AES_128_GCM_SHA256 "DHE-RSA-AES128-GCM-SHA256"
+# define TLS1_TXT_DHE_RSA_WITH_AES_256_GCM_SHA384 "DHE-RSA-AES256-GCM-SHA384"
+# define TLS1_TXT_DH_RSA_WITH_AES_128_GCM_SHA256 "DH-RSA-AES128-GCM-SHA256"
+# define TLS1_TXT_DH_RSA_WITH_AES_256_GCM_SHA384 "DH-RSA-AES256-GCM-SHA384"
+# define TLS1_TXT_DHE_DSS_WITH_AES_128_GCM_SHA256 "DHE-DSS-AES128-GCM-SHA256"
+# define TLS1_TXT_DHE_DSS_WITH_AES_256_GCM_SHA384 "DHE-DSS-AES256-GCM-SHA384"
+# define TLS1_TXT_DH_DSS_WITH_AES_128_GCM_SHA256 "DH-DSS-AES128-GCM-SHA256"
+# define TLS1_TXT_DH_DSS_WITH_AES_256_GCM_SHA384 "DH-DSS-AES256-GCM-SHA384"
+# define TLS1_TXT_ADH_WITH_AES_128_GCM_SHA256 "ADH-AES128-GCM-SHA256"
+# define TLS1_TXT_ADH_WITH_AES_256_GCM_SHA384 "ADH-AES256-GCM-SHA384"
+
+/* ECDH HMAC based ciphersuites from RFC5289 */
+
+# define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256 "ECDHE-ECDSA-AES128-SHA256"
+# define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_SHA384 "ECDHE-ECDSA-AES256-SHA384"
+# define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_SHA256 "ECDH-ECDSA-AES128-SHA256"
+# define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_SHA384 "ECDH-ECDSA-AES256-SHA384"
+# define TLS1_TXT_ECDHE_RSA_WITH_AES_128_SHA256 "ECDHE-RSA-AES128-SHA256"
+# define TLS1_TXT_ECDHE_RSA_WITH_AES_256_SHA384 "ECDHE-RSA-AES256-SHA384"
+# define TLS1_TXT_ECDH_RSA_WITH_AES_128_SHA256 "ECDH-RSA-AES128-SHA256"
+# define TLS1_TXT_ECDH_RSA_WITH_AES_256_SHA384 "ECDH-RSA-AES256-SHA384"
+
+/* ECDH GCM based ciphersuites from RFC5289 */
+# define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 "ECDHE-ECDSA-AES128-GCM-SHA256"
+# define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 "ECDHE-ECDSA-AES256-GCM-SHA384"
+# define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 "ECDH-ECDSA-AES128-GCM-SHA256"
+# define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 "ECDH-ECDSA-AES256-GCM-SHA384"
+# define TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256 "ECDHE-RSA-AES128-GCM-SHA256"
+# define TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384 "ECDHE-RSA-AES256-GCM-SHA384"
+# define TLS1_TXT_ECDH_RSA_WITH_AES_128_GCM_SHA256 "ECDH-RSA-AES128-GCM-SHA256"
+# define TLS1_TXT_ECDH_RSA_WITH_AES_256_GCM_SHA384 "ECDH-RSA-AES256-GCM-SHA384"
+
+# define TLS_CT_RSA_SIGN 1
+# define TLS_CT_DSS_SIGN 2
+# define TLS_CT_RSA_FIXED_DH 3
+# define TLS_CT_DSS_FIXED_DH 4
+# define TLS_CT_ECDSA_SIGN 64
+# define TLS_CT_RSA_FIXED_ECDH 65
+# define TLS_CT_ECDSA_FIXED_ECDH 66
+# define TLS_CT_GOST94_SIGN 21
+# define TLS_CT_GOST01_SIGN 22
+/*
+ * when correcting this number, correct also SSL3_CT_NUMBER in ssl3.h (see
+ * comment there)
+ */
+# define TLS_CT_NUMBER 9
+
+# define TLS1_FINISH_MAC_LENGTH 12
+
+# define TLS_MD_MAX_CONST_SIZE 20
+# define TLS_MD_CLIENT_FINISH_CONST "client finished"
+# define TLS_MD_CLIENT_FINISH_CONST_SIZE 15
+# define TLS_MD_SERVER_FINISH_CONST "server finished"
+# define TLS_MD_SERVER_FINISH_CONST_SIZE 15
+# define TLS_MD_SERVER_WRITE_KEY_CONST "server write key"
+# define TLS_MD_SERVER_WRITE_KEY_CONST_SIZE 16
+# define TLS_MD_KEY_EXPANSION_CONST "key expansion"
+# define TLS_MD_KEY_EXPANSION_CONST_SIZE 13
+# define TLS_MD_CLIENT_WRITE_KEY_CONST "client write key"
+# define TLS_MD_CLIENT_WRITE_KEY_CONST_SIZE 16
+# define TLS_MD_SERVER_WRITE_KEY_CONST "server write key"
+# define TLS_MD_SERVER_WRITE_KEY_CONST_SIZE 16
+# define TLS_MD_IV_BLOCK_CONST "IV block"
+# define TLS_MD_IV_BLOCK_CONST_SIZE 8
+# define TLS_MD_MASTER_SECRET_CONST "master secret"
+# define TLS_MD_MASTER_SECRET_CONST_SIZE 13
+
+# ifdef CHARSET_EBCDIC
+# undef TLS_MD_CLIENT_FINISH_CONST
+/*
+ * client finished
+ */
+# define TLS_MD_CLIENT_FINISH_CONST "\x63\x6c\x69\x65\x6e\x74\x20\x66\x69\x6e\x69\x73\x68\x65\x64"
+
+# undef TLS_MD_SERVER_FINISH_CONST
+/*
+ * server finished
+ */
+# define TLS_MD_SERVER_FINISH_CONST "\x73\x65\x72\x76\x65\x72\x20\x66\x69\x6e\x69\x73\x68\x65\x64"
+
+# undef TLS_MD_SERVER_WRITE_KEY_CONST
+/*
+ * server write key
+ */
+# define TLS_MD_SERVER_WRITE_KEY_CONST "\x73\x65\x72\x76\x65\x72\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79"
+
+# undef TLS_MD_KEY_EXPANSION_CONST
+/*
+ * key expansion
+ */
+# define TLS_MD_KEY_EXPANSION_CONST "\x6b\x65\x79\x20\x65\x78\x70\x61\x6e\x73\x69\x6f\x6e"
+
+# undef TLS_MD_CLIENT_WRITE_KEY_CONST
+/*
+ * client write key
+ */
+# define TLS_MD_CLIENT_WRITE_KEY_CONST "\x63\x6c\x69\x65\x6e\x74\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79"
+
+# undef TLS_MD_SERVER_WRITE_KEY_CONST
+/*
+ * server write key
+ */
+# define TLS_MD_SERVER_WRITE_KEY_CONST "\x73\x65\x72\x76\x65\x72\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79"
+
+# undef TLS_MD_IV_BLOCK_CONST
+/*
+ * IV block
+ */
+# define TLS_MD_IV_BLOCK_CONST "\x49\x56\x20\x62\x6c\x6f\x63\x6b"
+
+# undef TLS_MD_MASTER_SECRET_CONST
+/*
+ * master secret
+ */
+# define TLS_MD_MASTER_SECRET_CONST "\x6d\x61\x73\x74\x65\x72\x20\x73\x65\x63\x72\x65\x74"
+# endif
+
+/* TLS Session Ticket extension struct */
+struct tls_session_ticket_ext_st {
+ unsigned short length;
+ void *data;
+};
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/ts.h b/protocols/Telegram/tgl/openssl/include/openssl/ts.h
new file mode 100644
index 0000000000..16eccbb38d
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/ts.h
@@ -0,0 +1,862 @@
+/* crypto/ts/ts.h */
+/*
+ * Written by Zoltan Glozik (zglozik@opentsa.org) for the OpenSSL project
+ * 2002, 2003, 2004.
+ */
+/* ====================================================================
+ * Copyright (c) 2006 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_TS_H
+# define HEADER_TS_H
+
+# include <openssl/opensslconf.h>
+# include <openssl/symhacks.h>
+# ifndef OPENSSL_NO_BUFFER
+# include <openssl/buffer.h>
+# endif
+# ifndef OPENSSL_NO_EVP
+# include <openssl/evp.h>
+# endif
+# ifndef OPENSSL_NO_BIO
+# include <openssl/bio.h>
+# endif
+# include <openssl/stack.h>
+# include <openssl/asn1.h>
+# include <openssl/safestack.h>
+
+# ifndef OPENSSL_NO_RSA
+# include <openssl/rsa.h>
+# endif
+
+# ifndef OPENSSL_NO_DSA
+# include <openssl/dsa.h>
+# endif
+
+# ifndef OPENSSL_NO_DH
+# include <openssl/dh.h>
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# ifdef WIN32
+/* Under Win32 this is defined in wincrypt.h */
+# undef X509_NAME
+# endif
+
+# include <openssl/x509.h>
+# include <openssl/x509v3.h>
+
+/*-
+MessageImprint ::= SEQUENCE {
+ hashAlgorithm AlgorithmIdentifier,
+ hashedMessage OCTET STRING }
+*/
+
+typedef struct TS_msg_imprint_st {
+ X509_ALGOR *hash_algo;
+ ASN1_OCTET_STRING *hashed_msg;
+} TS_MSG_IMPRINT;
+
+/*-
+TimeStampReq ::= SEQUENCE {
+ version INTEGER { v1(1) },
+ messageImprint MessageImprint,
+ --a hash algorithm OID and the hash value of the data to be
+ --time-stamped
+ reqPolicy TSAPolicyId OPTIONAL,
+ nonce INTEGER OPTIONAL,
+ certReq BOOLEAN DEFAULT FALSE,
+ extensions [0] IMPLICIT Extensions OPTIONAL }
+*/
+
+typedef struct TS_req_st {
+ ASN1_INTEGER *version;
+ TS_MSG_IMPRINT *msg_imprint;
+ ASN1_OBJECT *policy_id; /* OPTIONAL */
+ ASN1_INTEGER *nonce; /* OPTIONAL */
+ ASN1_BOOLEAN cert_req; /* DEFAULT FALSE */
+ STACK_OF(X509_EXTENSION) *extensions; /* [0] OPTIONAL */
+} TS_REQ;
+
+/*-
+Accuracy ::= SEQUENCE {
+ seconds INTEGER OPTIONAL,
+ millis [0] INTEGER (1..999) OPTIONAL,
+ micros [1] INTEGER (1..999) OPTIONAL }
+*/
+
+typedef struct TS_accuracy_st {
+ ASN1_INTEGER *seconds;
+ ASN1_INTEGER *millis;
+ ASN1_INTEGER *micros;
+} TS_ACCURACY;
+
+/*-
+TSTInfo ::= SEQUENCE {
+ version INTEGER { v1(1) },
+ policy TSAPolicyId,
+ messageImprint MessageImprint,
+ -- MUST have the same value as the similar field in
+ -- TimeStampReq
+ serialNumber INTEGER,
+ -- Time-Stamping users MUST be ready to accommodate integers
+ -- up to 160 bits.
+ genTime GeneralizedTime,
+ accuracy Accuracy OPTIONAL,
+ ordering BOOLEAN DEFAULT FALSE,
+ nonce INTEGER OPTIONAL,
+ -- MUST be present if the similar field was present
+ -- in TimeStampReq. In that case it MUST have the same value.
+ tsa [0] GeneralName OPTIONAL,
+ extensions [1] IMPLICIT Extensions OPTIONAL }
+*/
+
+typedef struct TS_tst_info_st {
+ ASN1_INTEGER *version;
+ ASN1_OBJECT *policy_id;
+ TS_MSG_IMPRINT *msg_imprint;
+ ASN1_INTEGER *serial;
+ ASN1_GENERALIZEDTIME *time;
+ TS_ACCURACY *accuracy;
+ ASN1_BOOLEAN ordering;
+ ASN1_INTEGER *nonce;
+ GENERAL_NAME *tsa;
+ STACK_OF(X509_EXTENSION) *extensions;
+} TS_TST_INFO;
+
+/*-
+PKIStatusInfo ::= SEQUENCE {
+ status PKIStatus,
+ statusString PKIFreeText OPTIONAL,
+ failInfo PKIFailureInfo OPTIONAL }
+
+From RFC 1510 - section 3.1.1:
+PKIFreeText ::= SEQUENCE SIZE (1..MAX) OF UTF8String
+ -- text encoded as UTF-8 String (note: each UTF8String SHOULD
+ -- include an RFC 1766 language tag to indicate the language
+ -- of the contained text)
+*/
+
+/* Possible values for status. See ts_resp_print.c && ts_resp_verify.c. */
+
+# define TS_STATUS_GRANTED 0
+# define TS_STATUS_GRANTED_WITH_MODS 1
+# define TS_STATUS_REJECTION 2
+# define TS_STATUS_WAITING 3
+# define TS_STATUS_REVOCATION_WARNING 4
+# define TS_STATUS_REVOCATION_NOTIFICATION 5
+
+/*
+ * Possible values for failure_info. See ts_resp_print.c && ts_resp_verify.c
+ */
+
+# define TS_INFO_BAD_ALG 0
+# define TS_INFO_BAD_REQUEST 2
+# define TS_INFO_BAD_DATA_FORMAT 5
+# define TS_INFO_TIME_NOT_AVAILABLE 14
+# define TS_INFO_UNACCEPTED_POLICY 15
+# define TS_INFO_UNACCEPTED_EXTENSION 16
+# define TS_INFO_ADD_INFO_NOT_AVAILABLE 17
+# define TS_INFO_SYSTEM_FAILURE 25
+
+typedef struct TS_status_info_st {
+ ASN1_INTEGER *status;
+ STACK_OF(ASN1_UTF8STRING) *text;
+ ASN1_BIT_STRING *failure_info;
+} TS_STATUS_INFO;
+
+DECLARE_STACK_OF(ASN1_UTF8STRING)
+DECLARE_ASN1_SET_OF(ASN1_UTF8STRING)
+
+/*-
+TimeStampResp ::= SEQUENCE {
+ status PKIStatusInfo,
+ timeStampToken TimeStampToken OPTIONAL }
+*/
+
+typedef struct TS_resp_st {
+ TS_STATUS_INFO *status_info;
+ PKCS7 *token;
+ TS_TST_INFO *tst_info;
+} TS_RESP;
+
+/* The structure below would belong to the ESS component. */
+
+/*-
+IssuerSerial ::= SEQUENCE {
+ issuer GeneralNames,
+ serialNumber CertificateSerialNumber
+ }
+*/
+
+typedef struct ESS_issuer_serial {
+ STACK_OF(GENERAL_NAME) *issuer;
+ ASN1_INTEGER *serial;
+} ESS_ISSUER_SERIAL;
+
+/*-
+ESSCertID ::= SEQUENCE {
+ certHash Hash,
+ issuerSerial IssuerSerial OPTIONAL
+}
+*/
+
+typedef struct ESS_cert_id {
+ ASN1_OCTET_STRING *hash; /* Always SHA-1 digest. */
+ ESS_ISSUER_SERIAL *issuer_serial;
+} ESS_CERT_ID;
+
+DECLARE_STACK_OF(ESS_CERT_ID)
+DECLARE_ASN1_SET_OF(ESS_CERT_ID)
+
+/*-
+SigningCertificate ::= SEQUENCE {
+ certs SEQUENCE OF ESSCertID,
+ policies SEQUENCE OF PolicyInformation OPTIONAL
+}
+*/
+
+typedef struct ESS_signing_cert {
+ STACK_OF(ESS_CERT_ID) *cert_ids;
+ STACK_OF(POLICYINFO) *policy_info;
+} ESS_SIGNING_CERT;
+
+TS_REQ *TS_REQ_new(void);
+void TS_REQ_free(TS_REQ *a);
+int i2d_TS_REQ(const TS_REQ *a, unsigned char **pp);
+TS_REQ *d2i_TS_REQ(TS_REQ **a, const unsigned char **pp, long length);
+
+TS_REQ *TS_REQ_dup(TS_REQ *a);
+
+TS_REQ *d2i_TS_REQ_fp(FILE *fp, TS_REQ **a);
+int i2d_TS_REQ_fp(FILE *fp, TS_REQ *a);
+TS_REQ *d2i_TS_REQ_bio(BIO *fp, TS_REQ **a);
+int i2d_TS_REQ_bio(BIO *fp, TS_REQ *a);
+
+TS_MSG_IMPRINT *TS_MSG_IMPRINT_new(void);
+void TS_MSG_IMPRINT_free(TS_MSG_IMPRINT *a);
+int i2d_TS_MSG_IMPRINT(const TS_MSG_IMPRINT *a, unsigned char **pp);
+TS_MSG_IMPRINT *d2i_TS_MSG_IMPRINT(TS_MSG_IMPRINT **a,
+ const unsigned char **pp, long length);
+
+TS_MSG_IMPRINT *TS_MSG_IMPRINT_dup(TS_MSG_IMPRINT *a);
+
+TS_MSG_IMPRINT *d2i_TS_MSG_IMPRINT_fp(FILE *fp, TS_MSG_IMPRINT **a);
+int i2d_TS_MSG_IMPRINT_fp(FILE *fp, TS_MSG_IMPRINT *a);
+TS_MSG_IMPRINT *d2i_TS_MSG_IMPRINT_bio(BIO *fp, TS_MSG_IMPRINT **a);
+int i2d_TS_MSG_IMPRINT_bio(BIO *fp, TS_MSG_IMPRINT *a);
+
+TS_RESP *TS_RESP_new(void);
+void TS_RESP_free(TS_RESP *a);
+int i2d_TS_RESP(const TS_RESP *a, unsigned char **pp);
+TS_RESP *d2i_TS_RESP(TS_RESP **a, const unsigned char **pp, long length);
+TS_TST_INFO *PKCS7_to_TS_TST_INFO(PKCS7 *token);
+TS_RESP *TS_RESP_dup(TS_RESP *a);
+
+TS_RESP *d2i_TS_RESP_fp(FILE *fp, TS_RESP **a);
+int i2d_TS_RESP_fp(FILE *fp, TS_RESP *a);
+TS_RESP *d2i_TS_RESP_bio(BIO *fp, TS_RESP **a);
+int i2d_TS_RESP_bio(BIO *fp, TS_RESP *a);
+
+TS_STATUS_INFO *TS_STATUS_INFO_new(void);
+void TS_STATUS_INFO_free(TS_STATUS_INFO *a);
+int i2d_TS_STATUS_INFO(const TS_STATUS_INFO *a, unsigned char **pp);
+TS_STATUS_INFO *d2i_TS_STATUS_INFO(TS_STATUS_INFO **a,
+ const unsigned char **pp, long length);
+TS_STATUS_INFO *TS_STATUS_INFO_dup(TS_STATUS_INFO *a);
+
+TS_TST_INFO *TS_TST_INFO_new(void);
+void TS_TST_INFO_free(TS_TST_INFO *a);
+int i2d_TS_TST_INFO(const TS_TST_INFO *a, unsigned char **pp);
+TS_TST_INFO *d2i_TS_TST_INFO(TS_TST_INFO **a, const unsigned char **pp,
+ long length);
+TS_TST_INFO *TS_TST_INFO_dup(TS_TST_INFO *a);
+
+TS_TST_INFO *d2i_TS_TST_INFO_fp(FILE *fp, TS_TST_INFO **a);
+int i2d_TS_TST_INFO_fp(FILE *fp, TS_TST_INFO *a);
+TS_TST_INFO *d2i_TS_TST_INFO_bio(BIO *fp, TS_TST_INFO **a);
+int i2d_TS_TST_INFO_bio(BIO *fp, TS_TST_INFO *a);
+
+TS_ACCURACY *TS_ACCURACY_new(void);
+void TS_ACCURACY_free(TS_ACCURACY *a);
+int i2d_TS_ACCURACY(const TS_ACCURACY *a, unsigned char **pp);
+TS_ACCURACY *d2i_TS_ACCURACY(TS_ACCURACY **a, const unsigned char **pp,
+ long length);
+TS_ACCURACY *TS_ACCURACY_dup(TS_ACCURACY *a);
+
+ESS_ISSUER_SERIAL *ESS_ISSUER_SERIAL_new(void);
+void ESS_ISSUER_SERIAL_free(ESS_ISSUER_SERIAL *a);
+int i2d_ESS_ISSUER_SERIAL(const ESS_ISSUER_SERIAL *a, unsigned char **pp);
+ESS_ISSUER_SERIAL *d2i_ESS_ISSUER_SERIAL(ESS_ISSUER_SERIAL **a,
+ const unsigned char **pp,
+ long length);
+ESS_ISSUER_SERIAL *ESS_ISSUER_SERIAL_dup(ESS_ISSUER_SERIAL *a);
+
+ESS_CERT_ID *ESS_CERT_ID_new(void);
+void ESS_CERT_ID_free(ESS_CERT_ID *a);
+int i2d_ESS_CERT_ID(const ESS_CERT_ID *a, unsigned char **pp);
+ESS_CERT_ID *d2i_ESS_CERT_ID(ESS_CERT_ID **a, const unsigned char **pp,
+ long length);
+ESS_CERT_ID *ESS_CERT_ID_dup(ESS_CERT_ID *a);
+
+ESS_SIGNING_CERT *ESS_SIGNING_CERT_new(void);
+void ESS_SIGNING_CERT_free(ESS_SIGNING_CERT *a);
+int i2d_ESS_SIGNING_CERT(const ESS_SIGNING_CERT *a, unsigned char **pp);
+ESS_SIGNING_CERT *d2i_ESS_SIGNING_CERT(ESS_SIGNING_CERT **a,
+ const unsigned char **pp, long length);
+ESS_SIGNING_CERT *ESS_SIGNING_CERT_dup(ESS_SIGNING_CERT *a);
+
+void ERR_load_TS_strings(void);
+
+int TS_REQ_set_version(TS_REQ *a, long version);
+long TS_REQ_get_version(const TS_REQ *a);
+
+int TS_REQ_set_msg_imprint(TS_REQ *a, TS_MSG_IMPRINT *msg_imprint);
+TS_MSG_IMPRINT *TS_REQ_get_msg_imprint(TS_REQ *a);
+
+int TS_MSG_IMPRINT_set_algo(TS_MSG_IMPRINT *a, X509_ALGOR *alg);
+X509_ALGOR *TS_MSG_IMPRINT_get_algo(TS_MSG_IMPRINT *a);
+
+int TS_MSG_IMPRINT_set_msg(TS_MSG_IMPRINT *a, unsigned char *d, int len);
+ASN1_OCTET_STRING *TS_MSG_IMPRINT_get_msg(TS_MSG_IMPRINT *a);
+
+int TS_REQ_set_policy_id(TS_REQ *a, ASN1_OBJECT *policy);
+ASN1_OBJECT *TS_REQ_get_policy_id(TS_REQ *a);
+
+int TS_REQ_set_nonce(TS_REQ *a, const ASN1_INTEGER *nonce);
+const ASN1_INTEGER *TS_REQ_get_nonce(const TS_REQ *a);
+
+int TS_REQ_set_cert_req(TS_REQ *a, int cert_req);
+int TS_REQ_get_cert_req(const TS_REQ *a);
+
+STACK_OF(X509_EXTENSION) *TS_REQ_get_exts(TS_REQ *a);
+void TS_REQ_ext_free(TS_REQ *a);
+int TS_REQ_get_ext_count(TS_REQ *a);
+int TS_REQ_get_ext_by_NID(TS_REQ *a, int nid, int lastpos);
+int TS_REQ_get_ext_by_OBJ(TS_REQ *a, ASN1_OBJECT *obj, int lastpos);
+int TS_REQ_get_ext_by_critical(TS_REQ *a, int crit, int lastpos);
+X509_EXTENSION *TS_REQ_get_ext(TS_REQ *a, int loc);
+X509_EXTENSION *TS_REQ_delete_ext(TS_REQ *a, int loc);
+int TS_REQ_add_ext(TS_REQ *a, X509_EXTENSION *ex, int loc);
+void *TS_REQ_get_ext_d2i(TS_REQ *a, int nid, int *crit, int *idx);
+
+/* Function declarations for TS_REQ defined in ts/ts_req_print.c */
+
+int TS_REQ_print_bio(BIO *bio, TS_REQ *a);
+
+/* Function declarations for TS_RESP defined in ts/ts_resp_utils.c */
+
+int TS_RESP_set_status_info(TS_RESP *a, TS_STATUS_INFO *info);
+TS_STATUS_INFO *TS_RESP_get_status_info(TS_RESP *a);
+
+/* Caller loses ownership of PKCS7 and TS_TST_INFO objects. */
+void TS_RESP_set_tst_info(TS_RESP *a, PKCS7 *p7, TS_TST_INFO *tst_info);
+PKCS7 *TS_RESP_get_token(TS_RESP *a);
+TS_TST_INFO *TS_RESP_get_tst_info(TS_RESP *a);
+
+int TS_TST_INFO_set_version(TS_TST_INFO *a, long version);
+long TS_TST_INFO_get_version(const TS_TST_INFO *a);
+
+int TS_TST_INFO_set_policy_id(TS_TST_INFO *a, ASN1_OBJECT *policy_id);
+ASN1_OBJECT *TS_TST_INFO_get_policy_id(TS_TST_INFO *a);
+
+int TS_TST_INFO_set_msg_imprint(TS_TST_INFO *a, TS_MSG_IMPRINT *msg_imprint);
+TS_MSG_IMPRINT *TS_TST_INFO_get_msg_imprint(TS_TST_INFO *a);
+
+int TS_TST_INFO_set_serial(TS_TST_INFO *a, const ASN1_INTEGER *serial);
+const ASN1_INTEGER *TS_TST_INFO_get_serial(const TS_TST_INFO *a);
+
+int TS_TST_INFO_set_time(TS_TST_INFO *a, const ASN1_GENERALIZEDTIME *gtime);
+const ASN1_GENERALIZEDTIME *TS_TST_INFO_get_time(const TS_TST_INFO *a);
+
+int TS_TST_INFO_set_accuracy(TS_TST_INFO *a, TS_ACCURACY *accuracy);
+TS_ACCURACY *TS_TST_INFO_get_accuracy(TS_TST_INFO *a);
+
+int TS_ACCURACY_set_seconds(TS_ACCURACY *a, const ASN1_INTEGER *seconds);
+const ASN1_INTEGER *TS_ACCURACY_get_seconds(const TS_ACCURACY *a);
+
+int TS_ACCURACY_set_millis(TS_ACCURACY *a, const ASN1_INTEGER *millis);
+const ASN1_INTEGER *TS_ACCURACY_get_millis(const TS_ACCURACY *a);
+
+int TS_ACCURACY_set_micros(TS_ACCURACY *a, const ASN1_INTEGER *micros);
+const ASN1_INTEGER *TS_ACCURACY_get_micros(const TS_ACCURACY *a);
+
+int TS_TST_INFO_set_ordering(TS_TST_INFO *a, int ordering);
+int TS_TST_INFO_get_ordering(const TS_TST_INFO *a);
+
+int TS_TST_INFO_set_nonce(TS_TST_INFO *a, const ASN1_INTEGER *nonce);
+const ASN1_INTEGER *TS_TST_INFO_get_nonce(const TS_TST_INFO *a);
+
+int TS_TST_INFO_set_tsa(TS_TST_INFO *a, GENERAL_NAME *tsa);
+GENERAL_NAME *TS_TST_INFO_get_tsa(TS_TST_INFO *a);
+
+STACK_OF(X509_EXTENSION) *TS_TST_INFO_get_exts(TS_TST_INFO *a);
+void TS_TST_INFO_ext_free(TS_TST_INFO *a);
+int TS_TST_INFO_get_ext_count(TS_TST_INFO *a);
+int TS_TST_INFO_get_ext_by_NID(TS_TST_INFO *a, int nid, int lastpos);
+int TS_TST_INFO_get_ext_by_OBJ(TS_TST_INFO *a, ASN1_OBJECT *obj, int lastpos);
+int TS_TST_INFO_get_ext_by_critical(TS_TST_INFO *a, int crit, int lastpos);
+X509_EXTENSION *TS_TST_INFO_get_ext(TS_TST_INFO *a, int loc);
+X509_EXTENSION *TS_TST_INFO_delete_ext(TS_TST_INFO *a, int loc);
+int TS_TST_INFO_add_ext(TS_TST_INFO *a, X509_EXTENSION *ex, int loc);
+void *TS_TST_INFO_get_ext_d2i(TS_TST_INFO *a, int nid, int *crit, int *idx);
+
+/*
+ * Declarations related to response generation, defined in ts/ts_resp_sign.c.
+ */
+
+/* Optional flags for response generation. */
+
+/* Don't include the TSA name in response. */
+# define TS_TSA_NAME 0x01
+
+/* Set ordering to true in response. */
+# define TS_ORDERING 0x02
+
+/*
+ * Include the signer certificate and the other specified certificates in
+ * the ESS signing certificate attribute beside the PKCS7 signed data.
+ * Only the signer certificates is included by default.
+ */
+# define TS_ESS_CERT_ID_CHAIN 0x04
+
+/* Forward declaration. */
+struct TS_resp_ctx;
+
+/* This must return a unique number less than 160 bits long. */
+typedef ASN1_INTEGER *(*TS_serial_cb) (struct TS_resp_ctx *, void *);
+
+/*
+ * This must return the seconds and microseconds since Jan 1, 1970 in the sec
+ * and usec variables allocated by the caller. Return non-zero for success
+ * and zero for failure.
+ */
+typedef int (*TS_time_cb) (struct TS_resp_ctx *, void *, long *sec,
+ long *usec);
+
+/*
+ * This must process the given extension. It can modify the TS_TST_INFO
+ * object of the context. Return values: !0 (processed), 0 (error, it must
+ * set the status info/failure info of the response).
+ */
+typedef int (*TS_extension_cb) (struct TS_resp_ctx *, X509_EXTENSION *,
+ void *);
+
+typedef struct TS_resp_ctx {
+ X509 *signer_cert;
+ EVP_PKEY *signer_key;
+ STACK_OF(X509) *certs; /* Certs to include in signed data. */
+ STACK_OF(ASN1_OBJECT) *policies; /* Acceptable policies. */
+ ASN1_OBJECT *default_policy; /* It may appear in policies, too. */
+ STACK_OF(EVP_MD) *mds; /* Acceptable message digests. */
+ ASN1_INTEGER *seconds; /* accuracy, 0 means not specified. */
+ ASN1_INTEGER *millis; /* accuracy, 0 means not specified. */
+ ASN1_INTEGER *micros; /* accuracy, 0 means not specified. */
+ unsigned clock_precision_digits; /* fraction of seconds in time stamp
+ * token. */
+ unsigned flags; /* Optional info, see values above. */
+ /* Callback functions. */
+ TS_serial_cb serial_cb;
+ void *serial_cb_data; /* User data for serial_cb. */
+ TS_time_cb time_cb;
+ void *time_cb_data; /* User data for time_cb. */
+ TS_extension_cb extension_cb;
+ void *extension_cb_data; /* User data for extension_cb. */
+ /* These members are used only while creating the response. */
+ TS_REQ *request;
+ TS_RESP *response;
+ TS_TST_INFO *tst_info;
+} TS_RESP_CTX;
+
+DECLARE_STACK_OF(EVP_MD)
+DECLARE_ASN1_SET_OF(EVP_MD)
+
+/* Creates a response context that can be used for generating responses. */
+TS_RESP_CTX *TS_RESP_CTX_new(void);
+void TS_RESP_CTX_free(TS_RESP_CTX *ctx);
+
+/* This parameter must be set. */
+int TS_RESP_CTX_set_signer_cert(TS_RESP_CTX *ctx, X509 *signer);
+
+/* This parameter must be set. */
+int TS_RESP_CTX_set_signer_key(TS_RESP_CTX *ctx, EVP_PKEY *key);
+
+/* This parameter must be set. */
+int TS_RESP_CTX_set_def_policy(TS_RESP_CTX *ctx, ASN1_OBJECT *def_policy);
+
+/* No additional certs are included in the response by default. */
+int TS_RESP_CTX_set_certs(TS_RESP_CTX *ctx, STACK_OF(X509) *certs);
+
+/*
+ * Adds a new acceptable policy, only the default policy is accepted by
+ * default.
+ */
+int TS_RESP_CTX_add_policy(TS_RESP_CTX *ctx, ASN1_OBJECT *policy);
+
+/*
+ * Adds a new acceptable message digest. Note that no message digests are
+ * accepted by default. The md argument is shared with the caller.
+ */
+int TS_RESP_CTX_add_md(TS_RESP_CTX *ctx, const EVP_MD *md);
+
+/* Accuracy is not included by default. */
+int TS_RESP_CTX_set_accuracy(TS_RESP_CTX *ctx,
+ int secs, int millis, int micros);
+
+/*
+ * Clock precision digits, i.e. the number of decimal digits: '0' means sec,
+ * '3' msec, '6' usec, and so on. Default is 0.
+ */
+int TS_RESP_CTX_set_clock_precision_digits(TS_RESP_CTX *ctx,
+ unsigned clock_precision_digits);
+/* At most we accept usec precision. */
+# define TS_MAX_CLOCK_PRECISION_DIGITS 6
+
+/* No flags are set by default. */
+void TS_RESP_CTX_add_flags(TS_RESP_CTX *ctx, int flags);
+
+/* Default callback always returns a constant. */
+void TS_RESP_CTX_set_serial_cb(TS_RESP_CTX *ctx, TS_serial_cb cb, void *data);
+
+/* Default callback uses the gettimeofday() and gmtime() system calls. */
+void TS_RESP_CTX_set_time_cb(TS_RESP_CTX *ctx, TS_time_cb cb, void *data);
+
+/*
+ * Default callback rejects all extensions. The extension callback is called
+ * when the TS_TST_INFO object is already set up and not signed yet.
+ */
+/* FIXME: extension handling is not tested yet. */
+void TS_RESP_CTX_set_extension_cb(TS_RESP_CTX *ctx,
+ TS_extension_cb cb, void *data);
+
+/* The following methods can be used in the callbacks. */
+int TS_RESP_CTX_set_status_info(TS_RESP_CTX *ctx,
+ int status, const char *text);
+
+/* Sets the status info only if it is still TS_STATUS_GRANTED. */
+int TS_RESP_CTX_set_status_info_cond(TS_RESP_CTX *ctx,
+ int status, const char *text);
+
+int TS_RESP_CTX_add_failure_info(TS_RESP_CTX *ctx, int failure);
+
+/* The get methods below can be used in the extension callback. */
+TS_REQ *TS_RESP_CTX_get_request(TS_RESP_CTX *ctx);
+
+TS_TST_INFO *TS_RESP_CTX_get_tst_info(TS_RESP_CTX *ctx);
+
+/*
+ * Creates the signed TS_TST_INFO and puts it in TS_RESP.
+ * In case of errors it sets the status info properly.
+ * Returns NULL only in case of memory allocation/fatal error.
+ */
+TS_RESP *TS_RESP_create_response(TS_RESP_CTX *ctx, BIO *req_bio);
+
+/*
+ * Declarations related to response verification,
+ * they are defined in ts/ts_resp_verify.c.
+ */
+
+int TS_RESP_verify_signature(PKCS7 *token, STACK_OF(X509) *certs,
+ X509_STORE *store, X509 **signer_out);
+
+/* Context structure for the generic verify method. */
+
+/* Verify the signer's certificate and the signature of the response. */
+# define TS_VFY_SIGNATURE (1u << 0)
+/* Verify the version number of the response. */
+# define TS_VFY_VERSION (1u << 1)
+/* Verify if the policy supplied by the user matches the policy of the TSA. */
+# define TS_VFY_POLICY (1u << 2)
+/*
+ * Verify the message imprint provided by the user. This flag should not be
+ * specified with TS_VFY_DATA.
+ */
+# define TS_VFY_IMPRINT (1u << 3)
+/*
+ * Verify the message imprint computed by the verify method from the user
+ * provided data and the MD algorithm of the response. This flag should not
+ * be specified with TS_VFY_IMPRINT.
+ */
+# define TS_VFY_DATA (1u << 4)
+/* Verify the nonce value. */
+# define TS_VFY_NONCE (1u << 5)
+/* Verify if the TSA name field matches the signer certificate. */
+# define TS_VFY_SIGNER (1u << 6)
+/* Verify if the TSA name field equals to the user provided name. */
+# define TS_VFY_TSA_NAME (1u << 7)
+
+/* You can use the following convenience constants. */
+# define TS_VFY_ALL_IMPRINT (TS_VFY_SIGNATURE \
+ | TS_VFY_VERSION \
+ | TS_VFY_POLICY \
+ | TS_VFY_IMPRINT \
+ | TS_VFY_NONCE \
+ | TS_VFY_SIGNER \
+ | TS_VFY_TSA_NAME)
+# define TS_VFY_ALL_DATA (TS_VFY_SIGNATURE \
+ | TS_VFY_VERSION \
+ | TS_VFY_POLICY \
+ | TS_VFY_DATA \
+ | TS_VFY_NONCE \
+ | TS_VFY_SIGNER \
+ | TS_VFY_TSA_NAME)
+
+typedef struct TS_verify_ctx {
+ /* Set this to the union of TS_VFY_... flags you want to carry out. */
+ unsigned flags;
+ /* Must be set only with TS_VFY_SIGNATURE. certs is optional. */
+ X509_STORE *store;
+ STACK_OF(X509) *certs;
+ /* Must be set only with TS_VFY_POLICY. */
+ ASN1_OBJECT *policy;
+ /*
+ * Must be set only with TS_VFY_IMPRINT. If md_alg is NULL, the
+ * algorithm from the response is used.
+ */
+ X509_ALGOR *md_alg;
+ unsigned char *imprint;
+ unsigned imprint_len;
+ /* Must be set only with TS_VFY_DATA. */
+ BIO *data;
+ /* Must be set only with TS_VFY_TSA_NAME. */
+ ASN1_INTEGER *nonce;
+ /* Must be set only with TS_VFY_TSA_NAME. */
+ GENERAL_NAME *tsa_name;
+} TS_VERIFY_CTX;
+
+int TS_RESP_verify_response(TS_VERIFY_CTX *ctx, TS_RESP *response);
+int TS_RESP_verify_token(TS_VERIFY_CTX *ctx, PKCS7 *token);
+
+/*
+ * Declarations related to response verification context,
+ * they are defined in ts/ts_verify_ctx.c.
+ */
+
+/* Set all fields to zero. */
+TS_VERIFY_CTX *TS_VERIFY_CTX_new(void);
+void TS_VERIFY_CTX_init(TS_VERIFY_CTX *ctx);
+void TS_VERIFY_CTX_free(TS_VERIFY_CTX *ctx);
+void TS_VERIFY_CTX_cleanup(TS_VERIFY_CTX *ctx);
+
+/*-
+ * If ctx is NULL, it allocates and returns a new object, otherwise
+ * it returns ctx. It initialises all the members as follows:
+ * flags = TS_VFY_ALL_IMPRINT & ~(TS_VFY_TSA_NAME | TS_VFY_SIGNATURE)
+ * certs = NULL
+ * store = NULL
+ * policy = policy from the request or NULL if absent (in this case
+ * TS_VFY_POLICY is cleared from flags as well)
+ * md_alg = MD algorithm from request
+ * imprint, imprint_len = imprint from request
+ * data = NULL
+ * nonce, nonce_len = nonce from the request or NULL if absent (in this case
+ * TS_VFY_NONCE is cleared from flags as well)
+ * tsa_name = NULL
+ * Important: after calling this method TS_VFY_SIGNATURE should be added!
+ */
+TS_VERIFY_CTX *TS_REQ_to_TS_VERIFY_CTX(TS_REQ *req, TS_VERIFY_CTX *ctx);
+
+/* Function declarations for TS_RESP defined in ts/ts_resp_print.c */
+
+int TS_RESP_print_bio(BIO *bio, TS_RESP *a);
+int TS_STATUS_INFO_print_bio(BIO *bio, TS_STATUS_INFO *a);
+int TS_TST_INFO_print_bio(BIO *bio, TS_TST_INFO *a);
+
+/* Common utility functions defined in ts/ts_lib.c */
+
+int TS_ASN1_INTEGER_print_bio(BIO *bio, const ASN1_INTEGER *num);
+int TS_OBJ_print_bio(BIO *bio, const ASN1_OBJECT *obj);
+int TS_ext_print_bio(BIO *bio, const STACK_OF(X509_EXTENSION) *extensions);
+int TS_X509_ALGOR_print_bio(BIO *bio, const X509_ALGOR *alg);
+int TS_MSG_IMPRINT_print_bio(BIO *bio, TS_MSG_IMPRINT *msg);
+
+/*
+ * Function declarations for handling configuration options, defined in
+ * ts/ts_conf.c
+ */
+
+X509 *TS_CONF_load_cert(const char *file);
+STACK_OF(X509) *TS_CONF_load_certs(const char *file);
+EVP_PKEY *TS_CONF_load_key(const char *file, const char *pass);
+const char *TS_CONF_get_tsa_section(CONF *conf, const char *section);
+int TS_CONF_set_serial(CONF *conf, const char *section, TS_serial_cb cb,
+ TS_RESP_CTX *ctx);
+int TS_CONF_set_crypto_device(CONF *conf, const char *section,
+ const char *device);
+int TS_CONF_set_default_engine(const char *name);
+int TS_CONF_set_signer_cert(CONF *conf, const char *section,
+ const char *cert, TS_RESP_CTX *ctx);
+int TS_CONF_set_certs(CONF *conf, const char *section, const char *certs,
+ TS_RESP_CTX *ctx);
+int TS_CONF_set_signer_key(CONF *conf, const char *section,
+ const char *key, const char *pass,
+ TS_RESP_CTX *ctx);
+int TS_CONF_set_def_policy(CONF *conf, const char *section,
+ const char *policy, TS_RESP_CTX *ctx);
+int TS_CONF_set_policies(CONF *conf, const char *section, TS_RESP_CTX *ctx);
+int TS_CONF_set_digests(CONF *conf, const char *section, TS_RESP_CTX *ctx);
+int TS_CONF_set_accuracy(CONF *conf, const char *section, TS_RESP_CTX *ctx);
+int TS_CONF_set_clock_precision_digits(CONF *conf, const char *section,
+ TS_RESP_CTX *ctx);
+int TS_CONF_set_ordering(CONF *conf, const char *section, TS_RESP_CTX *ctx);
+int TS_CONF_set_tsa_name(CONF *conf, const char *section, TS_RESP_CTX *ctx);
+int TS_CONF_set_ess_cert_id_chain(CONF *conf, const char *section,
+ TS_RESP_CTX *ctx);
+
+/* -------------------------------------------------- */
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_TS_strings(void);
+
+/* Error codes for the TS functions. */
+
+/* Function codes. */
+# define TS_F_D2I_TS_RESP 147
+# define TS_F_DEF_SERIAL_CB 110
+# define TS_F_DEF_TIME_CB 111
+# define TS_F_ESS_ADD_SIGNING_CERT 112
+# define TS_F_ESS_CERT_ID_NEW_INIT 113
+# define TS_F_ESS_SIGNING_CERT_NEW_INIT 114
+# define TS_F_INT_TS_RESP_VERIFY_TOKEN 149
+# define TS_F_PKCS7_TO_TS_TST_INFO 148
+# define TS_F_TS_ACCURACY_SET_MICROS 115
+# define TS_F_TS_ACCURACY_SET_MILLIS 116
+# define TS_F_TS_ACCURACY_SET_SECONDS 117
+# define TS_F_TS_CHECK_IMPRINTS 100
+# define TS_F_TS_CHECK_NONCES 101
+# define TS_F_TS_CHECK_POLICY 102
+# define TS_F_TS_CHECK_SIGNING_CERTS 103
+# define TS_F_TS_CHECK_STATUS_INFO 104
+# define TS_F_TS_COMPUTE_IMPRINT 145
+# define TS_F_TS_CONF_SET_DEFAULT_ENGINE 146
+# define TS_F_TS_GET_STATUS_TEXT 105
+# define TS_F_TS_MSG_IMPRINT_SET_ALGO 118
+# define TS_F_TS_REQ_SET_MSG_IMPRINT 119
+# define TS_F_TS_REQ_SET_NONCE 120
+# define TS_F_TS_REQ_SET_POLICY_ID 121
+# define TS_F_TS_RESP_CREATE_RESPONSE 122
+# define TS_F_TS_RESP_CREATE_TST_INFO 123
+# define TS_F_TS_RESP_CTX_ADD_FAILURE_INFO 124
+# define TS_F_TS_RESP_CTX_ADD_MD 125
+# define TS_F_TS_RESP_CTX_ADD_POLICY 126
+# define TS_F_TS_RESP_CTX_NEW 127
+# define TS_F_TS_RESP_CTX_SET_ACCURACY 128
+# define TS_F_TS_RESP_CTX_SET_CERTS 129
+# define TS_F_TS_RESP_CTX_SET_DEF_POLICY 130
+# define TS_F_TS_RESP_CTX_SET_SIGNER_CERT 131
+# define TS_F_TS_RESP_CTX_SET_STATUS_INFO 132
+# define TS_F_TS_RESP_GET_POLICY 133
+# define TS_F_TS_RESP_SET_GENTIME_WITH_PRECISION 134
+# define TS_F_TS_RESP_SET_STATUS_INFO 135
+# define TS_F_TS_RESP_SET_TST_INFO 150
+# define TS_F_TS_RESP_SIGN 136
+# define TS_F_TS_RESP_VERIFY_SIGNATURE 106
+# define TS_F_TS_RESP_VERIFY_TOKEN 107
+# define TS_F_TS_TST_INFO_SET_ACCURACY 137
+# define TS_F_TS_TST_INFO_SET_MSG_IMPRINT 138
+# define TS_F_TS_TST_INFO_SET_NONCE 139
+# define TS_F_TS_TST_INFO_SET_POLICY_ID 140
+# define TS_F_TS_TST_INFO_SET_SERIAL 141
+# define TS_F_TS_TST_INFO_SET_TIME 142
+# define TS_F_TS_TST_INFO_SET_TSA 143
+# define TS_F_TS_VERIFY 108
+# define TS_F_TS_VERIFY_CERT 109
+# define TS_F_TS_VERIFY_CTX_NEW 144
+
+/* Reason codes. */
+# define TS_R_BAD_PKCS7_TYPE 132
+# define TS_R_BAD_TYPE 133
+# define TS_R_CERTIFICATE_VERIFY_ERROR 100
+# define TS_R_COULD_NOT_SET_ENGINE 127
+# define TS_R_COULD_NOT_SET_TIME 115
+# define TS_R_D2I_TS_RESP_INT_FAILED 128
+# define TS_R_DETACHED_CONTENT 134
+# define TS_R_ESS_ADD_SIGNING_CERT_ERROR 116
+# define TS_R_ESS_SIGNING_CERTIFICATE_ERROR 101
+# define TS_R_INVALID_NULL_POINTER 102
+# define TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE 117
+# define TS_R_MESSAGE_IMPRINT_MISMATCH 103
+# define TS_R_NONCE_MISMATCH 104
+# define TS_R_NONCE_NOT_RETURNED 105
+# define TS_R_NO_CONTENT 106
+# define TS_R_NO_TIME_STAMP_TOKEN 107
+# define TS_R_PKCS7_ADD_SIGNATURE_ERROR 118
+# define TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR 119
+# define TS_R_PKCS7_TO_TS_TST_INFO_FAILED 129
+# define TS_R_POLICY_MISMATCH 108
+# define TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 120
+# define TS_R_RESPONSE_SETUP_ERROR 121
+# define TS_R_SIGNATURE_FAILURE 109
+# define TS_R_THERE_MUST_BE_ONE_SIGNER 110
+# define TS_R_TIME_SYSCALL_ERROR 122
+# define TS_R_TOKEN_NOT_PRESENT 130
+# define TS_R_TOKEN_PRESENT 131
+# define TS_R_TSA_NAME_MISMATCH 111
+# define TS_R_TSA_UNTRUSTED 112
+# define TS_R_TST_INFO_SETUP_ERROR 123
+# define TS_R_TS_DATASIGN 124
+# define TS_R_UNACCEPTABLE_POLICY 125
+# define TS_R_UNSUPPORTED_MD_ALGORITHM 126
+# define TS_R_UNSUPPORTED_VERSION 113
+# define TS_R_WRONG_CONTENT_TYPE 114
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/txt_db.h b/protocols/Telegram/tgl/openssl/include/openssl/txt_db.h
new file mode 100644
index 0000000000..98e23a2003
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/txt_db.h
@@ -0,0 +1,112 @@
+/* crypto/txt_db/txt_db.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_TXT_DB_H
+# define HEADER_TXT_DB_H
+
+# include <openssl/opensslconf.h>
+# ifndef OPENSSL_NO_BIO
+# include <openssl/bio.h>
+# endif
+# include <openssl/stack.h>
+# include <openssl/lhash.h>
+
+# define DB_ERROR_OK 0
+# define DB_ERROR_MALLOC 1
+# define DB_ERROR_INDEX_CLASH 2
+# define DB_ERROR_INDEX_OUT_OF_RANGE 3
+# define DB_ERROR_NO_INDEX 4
+# define DB_ERROR_INSERT_INDEX_CLASH 5
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef OPENSSL_STRING *OPENSSL_PSTRING;
+DECLARE_SPECIAL_STACK_OF(OPENSSL_PSTRING, OPENSSL_STRING)
+
+typedef struct txt_db_st {
+ int num_fields;
+ STACK_OF(OPENSSL_PSTRING) *data;
+ LHASH_OF(OPENSSL_STRING) **index;
+ int (**qual) (OPENSSL_STRING *);
+ long error;
+ long arg1;
+ long arg2;
+ OPENSSL_STRING *arg_row;
+} TXT_DB;
+
+# ifndef OPENSSL_NO_BIO
+TXT_DB *TXT_DB_read(BIO *in, int num);
+long TXT_DB_write(BIO *out, TXT_DB *db);
+# else
+TXT_DB *TXT_DB_read(char *in, int num);
+long TXT_DB_write(char *out, TXT_DB *db);
+# endif
+int TXT_DB_create_index(TXT_DB *db, int field, int (*qual) (OPENSSL_STRING *),
+ LHASH_HASH_FN_TYPE hash, LHASH_COMP_FN_TYPE cmp);
+void TXT_DB_free(TXT_DB *db);
+OPENSSL_STRING *TXT_DB_get_by_index(TXT_DB *db, int idx,
+ OPENSSL_STRING *value);
+int TXT_DB_insert(TXT_DB *db, OPENSSL_STRING *value);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/ui.h b/protocols/Telegram/tgl/openssl/include/openssl/ui.h
new file mode 100644
index 0000000000..b917edab3a
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/ui.h
@@ -0,0 +1,415 @@
+/* crypto/ui/ui.h -*- mode:C; c-file-style: "eay" -*- */
+/*
+ * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project
+ * 2001.
+ */
+/* ====================================================================
+ * Copyright (c) 2001 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_UI_H
+# define HEADER_UI_H
+
+# ifndef OPENSSL_NO_DEPRECATED
+# include <openssl/crypto.h>
+# endif
+# include <openssl/safestack.h>
+# include <openssl/ossl_typ.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Declared already in ossl_typ.h */
+/* typedef struct ui_st UI; */
+/* typedef struct ui_method_st UI_METHOD; */
+
+/*
+ * All the following functions return -1 or NULL on error and in some cases
+ * (UI_process()) -2 if interrupted or in some other way cancelled. When
+ * everything is fine, they return 0, a positive value or a non-NULL pointer,
+ * all depending on their purpose.
+ */
+
+/* Creators and destructor. */
+UI *UI_new(void);
+UI *UI_new_method(const UI_METHOD *method);
+void UI_free(UI *ui);
+
+/*-
+ The following functions are used to add strings to be printed and prompt
+ strings to prompt for data. The names are UI_{add,dup}_<function>_string
+ and UI_{add,dup}_input_boolean.
+
+ UI_{add,dup}_<function>_string have the following meanings:
+ add add a text or prompt string. The pointers given to these
+ functions are used verbatim, no copying is done.
+ dup make a copy of the text or prompt string, then add the copy
+ to the collection of strings in the user interface.
+ <function>
+ The function is a name for the functionality that the given
+ string shall be used for. It can be one of:
+ input use the string as data prompt.
+ verify use the string as verification prompt. This
+ is used to verify a previous input.
+ info use the string for informational output.
+ error use the string for error output.
+ Honestly, there's currently no difference between info and error for the
+ moment.
+
+ UI_{add,dup}_input_boolean have the same semantics for "add" and "dup",
+ and are typically used when one wants to prompt for a yes/no response.
+
+ All of the functions in this group take a UI and a prompt string.
+ The string input and verify addition functions also take a flag argument,
+ a buffer for the result to end up with, a minimum input size and a maximum
+ input size (the result buffer MUST be large enough to be able to contain
+ the maximum number of characters). Additionally, the verify addition
+ functions takes another buffer to compare the result against.
+ The boolean input functions take an action description string (which should
+ be safe to ignore if the expected user action is obvious, for example with
+ a dialog box with an OK button and a Cancel button), a string of acceptable
+ characters to mean OK and to mean Cancel. The two last strings are checked
+ to make sure they don't have common characters. Additionally, the same
+ flag argument as for the string input is taken, as well as a result buffer.
+ The result buffer is required to be at least one byte long. Depending on
+ the answer, the first character from the OK or the Cancel character strings
+ will be stored in the first byte of the result buffer. No NUL will be
+ added, so the result is *not* a string.
+
+ On success, the all return an index of the added information. That index
+ is usefull when retrieving results with UI_get0_result(). */
+int UI_add_input_string(UI *ui, const char *prompt, int flags,
+ char *result_buf, int minsize, int maxsize);
+int UI_dup_input_string(UI *ui, const char *prompt, int flags,
+ char *result_buf, int minsize, int maxsize);
+int UI_add_verify_string(UI *ui, const char *prompt, int flags,
+ char *result_buf, int minsize, int maxsize,
+ const char *test_buf);
+int UI_dup_verify_string(UI *ui, const char *prompt, int flags,
+ char *result_buf, int minsize, int maxsize,
+ const char *test_buf);
+int UI_add_input_boolean(UI *ui, const char *prompt, const char *action_desc,
+ const char *ok_chars, const char *cancel_chars,
+ int flags, char *result_buf);
+int UI_dup_input_boolean(UI *ui, const char *prompt, const char *action_desc,
+ const char *ok_chars, const char *cancel_chars,
+ int flags, char *result_buf);
+int UI_add_info_string(UI *ui, const char *text);
+int UI_dup_info_string(UI *ui, const char *text);
+int UI_add_error_string(UI *ui, const char *text);
+int UI_dup_error_string(UI *ui, const char *text);
+
+/* These are the possible flags. They can be or'ed together. */
+/* Use to have echoing of input */
+# define UI_INPUT_FLAG_ECHO 0x01
+/*
+ * Use a default password. Where that password is found is completely up to
+ * the application, it might for example be in the user data set with
+ * UI_add_user_data(). It is not recommended to have more than one input in
+ * each UI being marked with this flag, or the application might get
+ * confused.
+ */
+# define UI_INPUT_FLAG_DEFAULT_PWD 0x02
+
+/*-
+ * The user of these routines may want to define flags of their own. The core
+ * UI won't look at those, but will pass them on to the method routines. They
+ * must use higher bits so they don't get confused with the UI bits above.
+ * UI_INPUT_FLAG_USER_BASE tells which is the lowest bit to use. A good
+ * example of use is this:
+ *
+ * #define MY_UI_FLAG1 (0x01 << UI_INPUT_FLAG_USER_BASE)
+ *
+*/
+# define UI_INPUT_FLAG_USER_BASE 16
+
+/*-
+ * The following function helps construct a prompt. object_desc is a
+ * textual short description of the object, for example "pass phrase",
+ * and object_name is the name of the object (might be a card name or
+ * a file name.
+ * The returned string shall always be allocated on the heap with
+ * OPENSSL_malloc(), and need to be free'd with OPENSSL_free().
+ *
+ * If the ui_method doesn't contain a pointer to a user-defined prompt
+ * constructor, a default string is built, looking like this:
+ *
+ * "Enter {object_desc} for {object_name}:"
+ *
+ * So, if object_desc has the value "pass phrase" and object_name has
+ * the value "foo.key", the resulting string is:
+ *
+ * "Enter pass phrase for foo.key:"
+*/
+char *UI_construct_prompt(UI *ui_method,
+ const char *object_desc, const char *object_name);
+
+/*
+ * The following function is used to store a pointer to user-specific data.
+ * Any previous such pointer will be returned and replaced.
+ *
+ * For callback purposes, this function makes a lot more sense than using
+ * ex_data, since the latter requires that different parts of OpenSSL or
+ * applications share the same ex_data index.
+ *
+ * Note that the UI_OpenSSL() method completely ignores the user data. Other
+ * methods may not, however.
+ */
+void *UI_add_user_data(UI *ui, void *user_data);
+/* We need a user data retrieving function as well. */
+void *UI_get0_user_data(UI *ui);
+
+/* Return the result associated with a prompt given with the index i. */
+const char *UI_get0_result(UI *ui, int i);
+
+/* When all strings have been added, process the whole thing. */
+int UI_process(UI *ui);
+
+/*
+ * Give a user interface parametrised control commands. This can be used to
+ * send down an integer, a data pointer or a function pointer, as well as be
+ * used to get information from a UI.
+ */
+int UI_ctrl(UI *ui, int cmd, long i, void *p, void (*f) (void));
+
+/* The commands */
+/*
+ * Use UI_CONTROL_PRINT_ERRORS with the value 1 to have UI_process print the
+ * OpenSSL error stack before printing any info or added error messages and
+ * before any prompting.
+ */
+# define UI_CTRL_PRINT_ERRORS 1
+/*
+ * Check if a UI_process() is possible to do again with the same instance of
+ * a user interface. This makes UI_ctrl() return 1 if it is redoable, and 0
+ * if not.
+ */
+# define UI_CTRL_IS_REDOABLE 2
+
+/* Some methods may use extra data */
+# define UI_set_app_data(s,arg) UI_set_ex_data(s,0,arg)
+# define UI_get_app_data(s) UI_get_ex_data(s,0)
+int UI_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
+ CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
+int UI_set_ex_data(UI *r, int idx, void *arg);
+void *UI_get_ex_data(UI *r, int idx);
+
+/* Use specific methods instead of the built-in one */
+void UI_set_default_method(const UI_METHOD *meth);
+const UI_METHOD *UI_get_default_method(void);
+const UI_METHOD *UI_get_method(UI *ui);
+const UI_METHOD *UI_set_method(UI *ui, const UI_METHOD *meth);
+
+/* The method with all the built-in thingies */
+UI_METHOD *UI_OpenSSL(void);
+
+/* ---------- For method writers ---------- */
+/*-
+ A method contains a number of functions that implement the low level
+ of the User Interface. The functions are:
+
+ an opener This function starts a session, maybe by opening
+ a channel to a tty, or by opening a window.
+ a writer This function is called to write a given string,
+ maybe to the tty, maybe as a field label in a
+ window.
+ a flusher This function is called to flush everything that
+ has been output so far. It can be used to actually
+ display a dialog box after it has been built.
+ a reader This function is called to read a given prompt,
+ maybe from the tty, maybe from a field in a
+ window. Note that it's called wth all string
+ structures, not only the prompt ones, so it must
+ check such things itself.
+ a closer This function closes the session, maybe by closing
+ the channel to the tty, or closing the window.
+
+ All these functions are expected to return:
+
+ 0 on error.
+ 1 on success.
+ -1 on out-of-band events, for example if some prompting has
+ been canceled (by pressing Ctrl-C, for example). This is
+ only checked when returned by the flusher or the reader.
+
+ The way this is used, the opener is first called, then the writer for all
+ strings, then the flusher, then the reader for all strings and finally the
+ closer. Note that if you want to prompt from a terminal or other command
+ line interface, the best is to have the reader also write the prompts
+ instead of having the writer do it. If you want to prompt from a dialog
+ box, the writer can be used to build up the contents of the box, and the
+ flusher to actually display the box and run the event loop until all data
+ has been given, after which the reader only grabs the given data and puts
+ them back into the UI strings.
+
+ All method functions take a UI as argument. Additionally, the writer and
+ the reader take a UI_STRING.
+*/
+
+/*
+ * The UI_STRING type is the data structure that contains all the needed info
+ * about a string or a prompt, including test data for a verification prompt.
+ */
+typedef struct ui_string_st UI_STRING;
+DECLARE_STACK_OF(UI_STRING)
+
+/*
+ * The different types of strings that are currently supported. This is only
+ * needed by method authors.
+ */
+enum UI_string_types {
+ UIT_NONE = 0,
+ UIT_PROMPT, /* Prompt for a string */
+ UIT_VERIFY, /* Prompt for a string and verify */
+ UIT_BOOLEAN, /* Prompt for a yes/no response */
+ UIT_INFO, /* Send info to the user */
+ UIT_ERROR /* Send an error message to the user */
+};
+
+/* Create and manipulate methods */
+UI_METHOD *UI_create_method(char *name);
+void UI_destroy_method(UI_METHOD *ui_method);
+int UI_method_set_opener(UI_METHOD *method, int (*opener) (UI *ui));
+int UI_method_set_writer(UI_METHOD *method,
+ int (*writer) (UI *ui, UI_STRING *uis));
+int UI_method_set_flusher(UI_METHOD *method, int (*flusher) (UI *ui));
+int UI_method_set_reader(UI_METHOD *method,
+ int (*reader) (UI *ui, UI_STRING *uis));
+int UI_method_set_closer(UI_METHOD *method, int (*closer) (UI *ui));
+int UI_method_set_prompt_constructor(UI_METHOD *method,
+ char *(*prompt_constructor) (UI *ui,
+ const char
+ *object_desc,
+ const char
+ *object_name));
+int (*UI_method_get_opener(UI_METHOD *method)) (UI *);
+int (*UI_method_get_writer(UI_METHOD *method)) (UI *, UI_STRING *);
+int (*UI_method_get_flusher(UI_METHOD *method)) (UI *);
+int (*UI_method_get_reader(UI_METHOD *method)) (UI *, UI_STRING *);
+int (*UI_method_get_closer(UI_METHOD *method)) (UI *);
+char *(*UI_method_get_prompt_constructor(UI_METHOD *method)) (UI *,
+ const char *,
+ const char *);
+
+/*
+ * The following functions are helpers for method writers to access relevant
+ * data from a UI_STRING.
+ */
+
+/* Return type of the UI_STRING */
+enum UI_string_types UI_get_string_type(UI_STRING *uis);
+/* Return input flags of the UI_STRING */
+int UI_get_input_flags(UI_STRING *uis);
+/* Return the actual string to output (the prompt, info or error) */
+const char *UI_get0_output_string(UI_STRING *uis);
+/*
+ * Return the optional action string to output (the boolean promtp
+ * instruction)
+ */
+const char *UI_get0_action_string(UI_STRING *uis);
+/* Return the result of a prompt */
+const char *UI_get0_result_string(UI_STRING *uis);
+/*
+ * Return the string to test the result against. Only useful with verifies.
+ */
+const char *UI_get0_test_string(UI_STRING *uis);
+/* Return the required minimum size of the result */
+int UI_get_result_minsize(UI_STRING *uis);
+/* Return the required maximum size of the result */
+int UI_get_result_maxsize(UI_STRING *uis);
+/* Set the result of a UI_STRING. */
+int UI_set_result(UI *ui, UI_STRING *uis, const char *result);
+
+/* A couple of popular utility functions */
+int UI_UTIL_read_pw_string(char *buf, int length, const char *prompt,
+ int verify);
+int UI_UTIL_read_pw(char *buf, char *buff, int size, const char *prompt,
+ int verify);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_UI_strings(void);
+
+/* Error codes for the UI functions. */
+
+/* Function codes. */
+# define UI_F_GENERAL_ALLOCATE_BOOLEAN 108
+# define UI_F_GENERAL_ALLOCATE_PROMPT 109
+# define UI_F_GENERAL_ALLOCATE_STRING 100
+# define UI_F_UI_CTRL 111
+# define UI_F_UI_DUP_ERROR_STRING 101
+# define UI_F_UI_DUP_INFO_STRING 102
+# define UI_F_UI_DUP_INPUT_BOOLEAN 110
+# define UI_F_UI_DUP_INPUT_STRING 103
+# define UI_F_UI_DUP_VERIFY_STRING 106
+# define UI_F_UI_GET0_RESULT 107
+# define UI_F_UI_NEW_METHOD 104
+# define UI_F_UI_SET_RESULT 105
+
+/* Reason codes. */
+# define UI_R_COMMON_OK_AND_CANCEL_CHARACTERS 104
+# define UI_R_INDEX_TOO_LARGE 102
+# define UI_R_INDEX_TOO_SMALL 103
+# define UI_R_NO_RESULT_BUFFER 105
+# define UI_R_RESULT_TOO_LARGE 100
+# define UI_R_RESULT_TOO_SMALL 101
+# define UI_R_UNKNOWN_CONTROL_COMMAND 106
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/ui_compat.h b/protocols/Telegram/tgl/openssl/include/openssl/ui_compat.h
new file mode 100644
index 0000000000..42fb9ff650
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/ui_compat.h
@@ -0,0 +1,88 @@
+/* crypto/ui/ui.h -*- mode:C; c-file-style: "eay" -*- */
+/*
+ * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project
+ * 2001.
+ */
+/* ====================================================================
+ * Copyright (c) 2001 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_UI_COMPAT_H
+# define HEADER_UI_COMPAT_H
+
+# include <openssl/opensslconf.h>
+# include <openssl/ui.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * The following functions were previously part of the DES section, and are
+ * provided here for backward compatibility reasons.
+ */
+
+# define des_read_pw_string(b,l,p,v) \
+ _ossl_old_des_read_pw_string((b),(l),(p),(v))
+# define des_read_pw(b,bf,s,p,v) \
+ _ossl_old_des_read_pw((b),(bf),(s),(p),(v))
+
+int _ossl_old_des_read_pw_string(char *buf, int length, const char *prompt,
+ int verify);
+int _ossl_old_des_read_pw(char *buf, char *buff, int size, const char *prompt,
+ int verify);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/whrlpool.h b/protocols/Telegram/tgl/openssl/include/openssl/whrlpool.h
new file mode 100644
index 0000000000..73c749da81
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/whrlpool.h
@@ -0,0 +1,41 @@
+#ifndef HEADER_WHRLPOOL_H
+# define HEADER_WHRLPOOL_H
+
+# include <openssl/e_os2.h>
+# include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# define WHIRLPOOL_DIGEST_LENGTH (512/8)
+# define WHIRLPOOL_BBLOCK 512
+# define WHIRLPOOL_COUNTER (256/8)
+
+typedef struct {
+ union {
+ unsigned char c[WHIRLPOOL_DIGEST_LENGTH];
+ /* double q is here to ensure 64-bit alignment */
+ double q[WHIRLPOOL_DIGEST_LENGTH / sizeof(double)];
+ } H;
+ unsigned char data[WHIRLPOOL_BBLOCK / 8];
+ unsigned int bitoff;
+ size_t bitlen[WHIRLPOOL_COUNTER / sizeof(size_t)];
+} WHIRLPOOL_CTX;
+
+# ifndef OPENSSL_NO_WHIRLPOOL
+# ifdef OPENSSL_FIPS
+int private_WHIRLPOOL_Init(WHIRLPOOL_CTX *c);
+# endif
+int WHIRLPOOL_Init(WHIRLPOOL_CTX *c);
+int WHIRLPOOL_Update(WHIRLPOOL_CTX *c, const void *inp, size_t bytes);
+void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c, const void *inp, size_t bits);
+int WHIRLPOOL_Final(unsigned char *md, WHIRLPOOL_CTX *c);
+unsigned char *WHIRLPOOL(const void *inp, size_t bytes, unsigned char *md);
+# endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/x509.h b/protocols/Telegram/tgl/openssl/include/openssl/x509.h
new file mode 100644
index 0000000000..99337b849a
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/x509.h
@@ -0,0 +1,1327 @@
+/* crypto/x509/x509.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+/* ====================================================================
+ * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
+ * ECDH support in OpenSSL originally developed by
+ * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
+ */
+
+#ifndef HEADER_X509_H
+# define HEADER_X509_H
+
+# include <openssl/e_os2.h>
+# include <openssl/symhacks.h>
+# ifndef OPENSSL_NO_BUFFER
+# include <openssl/buffer.h>
+# endif
+# ifndef OPENSSL_NO_EVP
+# include <openssl/evp.h>
+# endif
+# ifndef OPENSSL_NO_BIO
+# include <openssl/bio.h>
+# endif
+# include <openssl/stack.h>
+# include <openssl/asn1.h>
+# include <openssl/safestack.h>
+
+# ifndef OPENSSL_NO_EC
+# include <openssl/ec.h>
+# endif
+
+# ifndef OPENSSL_NO_ECDSA
+# include <openssl/ecdsa.h>
+# endif
+
+# ifndef OPENSSL_NO_ECDH
+# include <openssl/ecdh.h>
+# endif
+
+# ifndef OPENSSL_NO_DEPRECATED
+# ifndef OPENSSL_NO_RSA
+# include <openssl/rsa.h>
+# endif
+# ifndef OPENSSL_NO_DSA
+# include <openssl/dsa.h>
+# endif
+# ifndef OPENSSL_NO_DH
+# include <openssl/dh.h>
+# endif
+# endif
+
+# ifndef OPENSSL_NO_SHA
+# include <openssl/sha.h>
+# endif
+# include <openssl/ossl_typ.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# ifdef OPENSSL_SYS_WIN32
+/* Under Win32 these are defined in wincrypt.h */
+# undef X509_NAME
+# undef X509_CERT_PAIR
+# undef X509_EXTENSIONS
+# endif
+
+# define X509_FILETYPE_PEM 1
+# define X509_FILETYPE_ASN1 2
+# define X509_FILETYPE_DEFAULT 3
+
+# define X509v3_KU_DIGITAL_SIGNATURE 0x0080
+# define X509v3_KU_NON_REPUDIATION 0x0040
+# define X509v3_KU_KEY_ENCIPHERMENT 0x0020
+# define X509v3_KU_DATA_ENCIPHERMENT 0x0010
+# define X509v3_KU_KEY_AGREEMENT 0x0008
+# define X509v3_KU_KEY_CERT_SIGN 0x0004
+# define X509v3_KU_CRL_SIGN 0x0002
+# define X509v3_KU_ENCIPHER_ONLY 0x0001
+# define X509v3_KU_DECIPHER_ONLY 0x8000
+# define X509v3_KU_UNDEF 0xffff
+
+typedef struct X509_objects_st {
+ int nid;
+ int (*a2i) (void);
+ int (*i2a) (void);
+} X509_OBJECTS;
+
+struct X509_algor_st {
+ ASN1_OBJECT *algorithm;
+ ASN1_TYPE *parameter;
+} /* X509_ALGOR */ ;
+
+DECLARE_ASN1_SET_OF(X509_ALGOR)
+
+typedef STACK_OF(X509_ALGOR) X509_ALGORS;
+
+typedef struct X509_val_st {
+ ASN1_TIME *notBefore;
+ ASN1_TIME *notAfter;
+} X509_VAL;
+
+struct X509_pubkey_st {
+ X509_ALGOR *algor;
+ ASN1_BIT_STRING *public_key;
+ EVP_PKEY *pkey;
+};
+
+typedef struct X509_sig_st {
+ X509_ALGOR *algor;
+ ASN1_OCTET_STRING *digest;
+} X509_SIG;
+
+typedef struct X509_name_entry_st {
+ ASN1_OBJECT *object;
+ ASN1_STRING *value;
+ int set;
+ int size; /* temp variable */
+} X509_NAME_ENTRY;
+
+DECLARE_STACK_OF(X509_NAME_ENTRY)
+DECLARE_ASN1_SET_OF(X509_NAME_ENTRY)
+
+/* we always keep X509_NAMEs in 2 forms. */
+struct X509_name_st {
+ STACK_OF(X509_NAME_ENTRY) *entries;
+ int modified; /* true if 'bytes' needs to be built */
+# ifndef OPENSSL_NO_BUFFER
+ BUF_MEM *bytes;
+# else
+ char *bytes;
+# endif
+/* unsigned long hash; Keep the hash around for lookups */
+ unsigned char *canon_enc;
+ int canon_enclen;
+} /* X509_NAME */ ;
+
+DECLARE_STACK_OF(X509_NAME)
+
+# define X509_EX_V_NETSCAPE_HACK 0x8000
+# define X509_EX_V_INIT 0x0001
+typedef struct X509_extension_st {
+ ASN1_OBJECT *object;
+ ASN1_BOOLEAN critical;
+ ASN1_OCTET_STRING *value;
+} X509_EXTENSION;
+
+typedef STACK_OF(X509_EXTENSION) X509_EXTENSIONS;
+
+DECLARE_STACK_OF(X509_EXTENSION)
+DECLARE_ASN1_SET_OF(X509_EXTENSION)
+
+/* a sequence of these are used */
+typedef struct x509_attributes_st {
+ ASN1_OBJECT *object;
+ int single; /* 0 for a set, 1 for a single item (which is
+ * wrong) */
+ union {
+ char *ptr;
+ /*
+ * 0
+ */ STACK_OF(ASN1_TYPE) *set;
+ /*
+ * 1
+ */ ASN1_TYPE *single;
+ } value;
+} X509_ATTRIBUTE;
+
+DECLARE_STACK_OF(X509_ATTRIBUTE)
+DECLARE_ASN1_SET_OF(X509_ATTRIBUTE)
+
+typedef struct X509_req_info_st {
+ ASN1_ENCODING enc;
+ ASN1_INTEGER *version;
+ X509_NAME *subject;
+ X509_PUBKEY *pubkey;
+ /* d=2 hl=2 l= 0 cons: cont: 00 */
+ STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */
+} X509_REQ_INFO;
+
+typedef struct X509_req_st {
+ X509_REQ_INFO *req_info;
+ X509_ALGOR *sig_alg;
+ ASN1_BIT_STRING *signature;
+ int references;
+} X509_REQ;
+
+typedef struct x509_cinf_st {
+ ASN1_INTEGER *version; /* [ 0 ] default of v1 */
+ ASN1_INTEGER *serialNumber;
+ X509_ALGOR *signature;
+ X509_NAME *issuer;
+ X509_VAL *validity;
+ X509_NAME *subject;
+ X509_PUBKEY *key;
+ ASN1_BIT_STRING *issuerUID; /* [ 1 ] optional in v2 */
+ ASN1_BIT_STRING *subjectUID; /* [ 2 ] optional in v2 */
+ STACK_OF(X509_EXTENSION) *extensions; /* [ 3 ] optional in v3 */
+ ASN1_ENCODING enc;
+} X509_CINF;
+
+/*
+ * This stuff is certificate "auxiliary info" it contains details which are
+ * useful in certificate stores and databases. When used this is tagged onto
+ * the end of the certificate itself
+ */
+
+typedef struct x509_cert_aux_st {
+ STACK_OF(ASN1_OBJECT) *trust; /* trusted uses */
+ STACK_OF(ASN1_OBJECT) *reject; /* rejected uses */
+ ASN1_UTF8STRING *alias; /* "friendly name" */
+ ASN1_OCTET_STRING *keyid; /* key id of private key */
+ STACK_OF(X509_ALGOR) *other; /* other unspecified info */
+} X509_CERT_AUX;
+
+struct x509_st {
+ X509_CINF *cert_info;
+ X509_ALGOR *sig_alg;
+ ASN1_BIT_STRING *signature;
+ int valid;
+ int references;
+ char *name;
+ CRYPTO_EX_DATA ex_data;
+ /* These contain copies of various extension values */
+ long ex_pathlen;
+ long ex_pcpathlen;
+ unsigned long ex_flags;
+ unsigned long ex_kusage;
+ unsigned long ex_xkusage;
+ unsigned long ex_nscert;
+ ASN1_OCTET_STRING *skid;
+ AUTHORITY_KEYID *akid;
+ X509_POLICY_CACHE *policy_cache;
+ STACK_OF(DIST_POINT) *crldp;
+ STACK_OF(GENERAL_NAME) *altname;
+ NAME_CONSTRAINTS *nc;
+# ifndef OPENSSL_NO_RFC3779
+ STACK_OF(IPAddressFamily) *rfc3779_addr;
+ struct ASIdentifiers_st *rfc3779_asid;
+# endif
+# ifndef OPENSSL_NO_SHA
+ unsigned char sha1_hash[SHA_DIGEST_LENGTH];
+# endif
+ X509_CERT_AUX *aux;
+} /* X509 */ ;
+
+DECLARE_STACK_OF(X509)
+DECLARE_ASN1_SET_OF(X509)
+
+/* This is used for a table of trust checking functions */
+
+typedef struct x509_trust_st {
+ int trust;
+ int flags;
+ int (*check_trust) (struct x509_trust_st *, X509 *, int);
+ char *name;
+ int arg1;
+ void *arg2;
+} X509_TRUST;
+
+DECLARE_STACK_OF(X509_TRUST)
+
+typedef struct x509_cert_pair_st {
+ X509 *forward;
+ X509 *reverse;
+} X509_CERT_PAIR;
+
+/* standard trust ids */
+
+# define X509_TRUST_DEFAULT -1/* Only valid in purpose settings */
+
+# define X509_TRUST_COMPAT 1
+# define X509_TRUST_SSL_CLIENT 2
+# define X509_TRUST_SSL_SERVER 3
+# define X509_TRUST_EMAIL 4
+# define X509_TRUST_OBJECT_SIGN 5
+# define X509_TRUST_OCSP_SIGN 6
+# define X509_TRUST_OCSP_REQUEST 7
+# define X509_TRUST_TSA 8
+
+/* Keep these up to date! */
+# define X509_TRUST_MIN 1
+# define X509_TRUST_MAX 8
+
+/* trust_flags values */
+# define X509_TRUST_DYNAMIC 1
+# define X509_TRUST_DYNAMIC_NAME 2
+
+/* check_trust return codes */
+
+# define X509_TRUST_TRUSTED 1
+# define X509_TRUST_REJECTED 2
+# define X509_TRUST_UNTRUSTED 3
+
+/* Flags for X509_print_ex() */
+
+# define X509_FLAG_COMPAT 0
+# define X509_FLAG_NO_HEADER 1L
+# define X509_FLAG_NO_VERSION (1L << 1)
+# define X509_FLAG_NO_SERIAL (1L << 2)
+# define X509_FLAG_NO_SIGNAME (1L << 3)
+# define X509_FLAG_NO_ISSUER (1L << 4)
+# define X509_FLAG_NO_VALIDITY (1L << 5)
+# define X509_FLAG_NO_SUBJECT (1L << 6)
+# define X509_FLAG_NO_PUBKEY (1L << 7)
+# define X509_FLAG_NO_EXTENSIONS (1L << 8)
+# define X509_FLAG_NO_SIGDUMP (1L << 9)
+# define X509_FLAG_NO_AUX (1L << 10)
+# define X509_FLAG_NO_ATTRIBUTES (1L << 11)
+# define X509_FLAG_NO_IDS (1L << 12)
+
+/* Flags specific to X509_NAME_print_ex() */
+
+/* The field separator information */
+
+# define XN_FLAG_SEP_MASK (0xf << 16)
+
+# define XN_FLAG_COMPAT 0/* Traditional SSLeay: use old
+ * X509_NAME_print */
+# define XN_FLAG_SEP_COMMA_PLUS (1 << 16)/* RFC2253 ,+ */
+# define XN_FLAG_SEP_CPLUS_SPC (2 << 16)/* ,+ spaced: more readable */
+# define XN_FLAG_SEP_SPLUS_SPC (3 << 16)/* ;+ spaced */
+# define XN_FLAG_SEP_MULTILINE (4 << 16)/* One line per field */
+
+# define XN_FLAG_DN_REV (1 << 20)/* Reverse DN order */
+
+/* How the field name is shown */
+
+# define XN_FLAG_FN_MASK (0x3 << 21)
+
+# define XN_FLAG_FN_SN 0/* Object short name */
+# define XN_FLAG_FN_LN (1 << 21)/* Object long name */
+# define XN_FLAG_FN_OID (2 << 21)/* Always use OIDs */
+# define XN_FLAG_FN_NONE (3 << 21)/* No field names */
+
+# define XN_FLAG_SPC_EQ (1 << 23)/* Put spaces round '=' */
+
+/*
+ * This determines if we dump fields we don't recognise: RFC2253 requires
+ * this.
+ */
+
+# define XN_FLAG_DUMP_UNKNOWN_FIELDS (1 << 24)
+
+# define XN_FLAG_FN_ALIGN (1 << 25)/* Align field names to 20
+ * characters */
+
+/* Complete set of RFC2253 flags */
+
+# define XN_FLAG_RFC2253 (ASN1_STRFLGS_RFC2253 | \
+ XN_FLAG_SEP_COMMA_PLUS | \
+ XN_FLAG_DN_REV | \
+ XN_FLAG_FN_SN | \
+ XN_FLAG_DUMP_UNKNOWN_FIELDS)
+
+/* readable oneline form */
+
+# define XN_FLAG_ONELINE (ASN1_STRFLGS_RFC2253 | \
+ ASN1_STRFLGS_ESC_QUOTE | \
+ XN_FLAG_SEP_CPLUS_SPC | \
+ XN_FLAG_SPC_EQ | \
+ XN_FLAG_FN_SN)
+
+/* readable multiline form */
+
+# define XN_FLAG_MULTILINE (ASN1_STRFLGS_ESC_CTRL | \
+ ASN1_STRFLGS_ESC_MSB | \
+ XN_FLAG_SEP_MULTILINE | \
+ XN_FLAG_SPC_EQ | \
+ XN_FLAG_FN_LN | \
+ XN_FLAG_FN_ALIGN)
+
+struct x509_revoked_st {
+ ASN1_INTEGER *serialNumber;
+ ASN1_TIME *revocationDate;
+ STACK_OF(X509_EXTENSION) /* optional */ *extensions;
+ /* Set up if indirect CRL */
+ STACK_OF(GENERAL_NAME) *issuer;
+ /* Revocation reason */
+ int reason;
+ int sequence; /* load sequence */
+};
+
+DECLARE_STACK_OF(X509_REVOKED)
+DECLARE_ASN1_SET_OF(X509_REVOKED)
+
+typedef struct X509_crl_info_st {
+ ASN1_INTEGER *version;
+ X509_ALGOR *sig_alg;
+ X509_NAME *issuer;
+ ASN1_TIME *lastUpdate;
+ ASN1_TIME *nextUpdate;
+ STACK_OF(X509_REVOKED) *revoked;
+ STACK_OF(X509_EXTENSION) /* [0] */ *extensions;
+ ASN1_ENCODING enc;
+} X509_CRL_INFO;
+
+struct X509_crl_st {
+ /* actual signature */
+ X509_CRL_INFO *crl;
+ X509_ALGOR *sig_alg;
+ ASN1_BIT_STRING *signature;
+ int references;
+ int flags;
+ /* Copies of various extensions */
+ AUTHORITY_KEYID *akid;
+ ISSUING_DIST_POINT *idp;
+ /* Convenient breakdown of IDP */
+ int idp_flags;
+ int idp_reasons;
+ /* CRL and base CRL numbers for delta processing */
+ ASN1_INTEGER *crl_number;
+ ASN1_INTEGER *base_crl_number;
+# ifndef OPENSSL_NO_SHA
+ unsigned char sha1_hash[SHA_DIGEST_LENGTH];
+# endif
+ STACK_OF(GENERAL_NAMES) *issuers;
+ const X509_CRL_METHOD *meth;
+ void *meth_data;
+} /* X509_CRL */ ;
+
+DECLARE_STACK_OF(X509_CRL)
+DECLARE_ASN1_SET_OF(X509_CRL)
+
+typedef struct private_key_st {
+ int version;
+ /* The PKCS#8 data types */
+ X509_ALGOR *enc_algor;
+ ASN1_OCTET_STRING *enc_pkey; /* encrypted pub key */
+ /* When decrypted, the following will not be NULL */
+ EVP_PKEY *dec_pkey;
+ /* used to encrypt and decrypt */
+ int key_length;
+ char *key_data;
+ int key_free; /* true if we should auto free key_data */
+ /* expanded version of 'enc_algor' */
+ EVP_CIPHER_INFO cipher;
+ int references;
+} X509_PKEY;
+
+# ifndef OPENSSL_NO_EVP
+typedef struct X509_info_st {
+ X509 *x509;
+ X509_CRL *crl;
+ X509_PKEY *x_pkey;
+ EVP_CIPHER_INFO enc_cipher;
+ int enc_len;
+ char *enc_data;
+ int references;
+} X509_INFO;
+
+DECLARE_STACK_OF(X509_INFO)
+# endif
+
+/*
+ * The next 2 structures and their 8 routines were sent to me by Pat Richard
+ * <patr@x509.com> and are used to manipulate Netscapes spki structures -
+ * useful if you are writing a CA web page
+ */
+typedef struct Netscape_spkac_st {
+ X509_PUBKEY *pubkey;
+ ASN1_IA5STRING *challenge; /* challenge sent in atlas >= PR2 */
+} NETSCAPE_SPKAC;
+
+typedef struct Netscape_spki_st {
+ NETSCAPE_SPKAC *spkac; /* signed public key and challenge */
+ X509_ALGOR *sig_algor;
+ ASN1_BIT_STRING *signature;
+} NETSCAPE_SPKI;
+
+/* Netscape certificate sequence structure */
+typedef struct Netscape_certificate_sequence {
+ ASN1_OBJECT *type;
+ STACK_OF(X509) *certs;
+} NETSCAPE_CERT_SEQUENCE;
+
+/*- Unused (and iv length is wrong)
+typedef struct CBCParameter_st
+ {
+ unsigned char iv[8];
+ } CBC_PARAM;
+*/
+
+/* Password based encryption structure */
+
+typedef struct PBEPARAM_st {
+ ASN1_OCTET_STRING *salt;
+ ASN1_INTEGER *iter;
+} PBEPARAM;
+
+/* Password based encryption V2 structures */
+
+typedef struct PBE2PARAM_st {
+ X509_ALGOR *keyfunc;
+ X509_ALGOR *encryption;
+} PBE2PARAM;
+
+typedef struct PBKDF2PARAM_st {
+/* Usually OCTET STRING but could be anything */
+ ASN1_TYPE *salt;
+ ASN1_INTEGER *iter;
+ ASN1_INTEGER *keylength;
+ X509_ALGOR *prf;
+} PBKDF2PARAM;
+
+/* PKCS#8 private key info structure */
+
+struct pkcs8_priv_key_info_st {
+ /* Flag for various broken formats */
+ int broken;
+# define PKCS8_OK 0
+# define PKCS8_NO_OCTET 1
+# define PKCS8_EMBEDDED_PARAM 2
+# define PKCS8_NS_DB 3
+# define PKCS8_NEG_PRIVKEY 4
+ ASN1_INTEGER *version;
+ X509_ALGOR *pkeyalg;
+ /* Should be OCTET STRING but some are broken */
+ ASN1_TYPE *pkey;
+ STACK_OF(X509_ATTRIBUTE) *attributes;
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+# include <openssl/x509_vfy.h>
+# include <openssl/pkcs7.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# define X509_EXT_PACK_UNKNOWN 1
+# define X509_EXT_PACK_STRING 2
+
+# define X509_get_version(x) ASN1_INTEGER_get((x)->cert_info->version)
+/* #define X509_get_serialNumber(x) ((x)->cert_info->serialNumber) */
+# define X509_get_notBefore(x) ((x)->cert_info->validity->notBefore)
+# define X509_get_notAfter(x) ((x)->cert_info->validity->notAfter)
+# define X509_extract_key(x) X509_get_pubkey(x)/*****/
+# define X509_REQ_get_version(x) ASN1_INTEGER_get((x)->req_info->version)
+# define X509_REQ_get_subject_name(x) ((x)->req_info->subject)
+# define X509_REQ_extract_key(a) X509_REQ_get_pubkey(a)
+# define X509_name_cmp(a,b) X509_NAME_cmp((a),(b))
+# define X509_get_signature_type(x) EVP_PKEY_type(OBJ_obj2nid((x)->sig_alg->algorithm))
+
+# define X509_CRL_get_version(x) ASN1_INTEGER_get((x)->crl->version)
+# define X509_CRL_get_lastUpdate(x) ((x)->crl->lastUpdate)
+# define X509_CRL_get_nextUpdate(x) ((x)->crl->nextUpdate)
+# define X509_CRL_get_issuer(x) ((x)->crl->issuer)
+# define X509_CRL_get_REVOKED(x) ((x)->crl->revoked)
+
+void X509_CRL_set_default_method(const X509_CRL_METHOD *meth);
+X509_CRL_METHOD *X509_CRL_METHOD_new(int (*crl_init) (X509_CRL *crl),
+ int (*crl_free) (X509_CRL *crl),
+ int (*crl_lookup) (X509_CRL *crl,
+ X509_REVOKED **ret,
+ ASN1_INTEGER *ser,
+ X509_NAME *issuer),
+ int (*crl_verify) (X509_CRL *crl,
+ EVP_PKEY *pk));
+void X509_CRL_METHOD_free(X509_CRL_METHOD *m);
+
+void X509_CRL_set_meth_data(X509_CRL *crl, void *dat);
+void *X509_CRL_get_meth_data(X509_CRL *crl);
+
+/*
+ * This one is only used so that a binary form can output, as in
+ * i2d_X509_NAME(X509_get_X509_PUBKEY(x),&buf)
+ */
+# define X509_get_X509_PUBKEY(x) ((x)->cert_info->key)
+
+const char *X509_verify_cert_error_string(long n);
+
+# ifndef OPENSSL_NO_EVP
+int X509_verify(X509 *a, EVP_PKEY *r);
+
+int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r);
+int X509_CRL_verify(X509_CRL *a, EVP_PKEY *r);
+int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r);
+
+NETSCAPE_SPKI *NETSCAPE_SPKI_b64_decode(const char *str, int len);
+char *NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *x);
+EVP_PKEY *NETSCAPE_SPKI_get_pubkey(NETSCAPE_SPKI *x);
+int NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey);
+
+int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki);
+
+int X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent);
+int X509_signature_print(BIO *bp, X509_ALGOR *alg, ASN1_STRING *sig);
+
+int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md);
+int X509_sign_ctx(X509 *x, EVP_MD_CTX *ctx);
+int X509_http_nbio(OCSP_REQ_CTX *rctx, X509 **pcert);
+int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md);
+int X509_REQ_sign_ctx(X509_REQ *x, EVP_MD_CTX *ctx);
+int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md);
+int X509_CRL_sign_ctx(X509_CRL *x, EVP_MD_CTX *ctx);
+int X509_CRL_http_nbio(OCSP_REQ_CTX *rctx, X509_CRL **pcrl);
+int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md);
+
+int X509_pubkey_digest(const X509 *data, const EVP_MD *type,
+ unsigned char *md, unsigned int *len);
+int X509_digest(const X509 *data, const EVP_MD *type,
+ unsigned char *md, unsigned int *len);
+int X509_CRL_digest(const X509_CRL *data, const EVP_MD *type,
+ unsigned char *md, unsigned int *len);
+int X509_REQ_digest(const X509_REQ *data, const EVP_MD *type,
+ unsigned char *md, unsigned int *len);
+int X509_NAME_digest(const X509_NAME *data, const EVP_MD *type,
+ unsigned char *md, unsigned int *len);
+# endif
+
+# ifndef OPENSSL_NO_FP_API
+X509 *d2i_X509_fp(FILE *fp, X509 **x509);
+int i2d_X509_fp(FILE *fp, X509 *x509);
+X509_CRL *d2i_X509_CRL_fp(FILE *fp, X509_CRL **crl);
+int i2d_X509_CRL_fp(FILE *fp, X509_CRL *crl);
+X509_REQ *d2i_X509_REQ_fp(FILE *fp, X509_REQ **req);
+int i2d_X509_REQ_fp(FILE *fp, X509_REQ *req);
+# ifndef OPENSSL_NO_RSA
+RSA *d2i_RSAPrivateKey_fp(FILE *fp, RSA **rsa);
+int i2d_RSAPrivateKey_fp(FILE *fp, RSA *rsa);
+RSA *d2i_RSAPublicKey_fp(FILE *fp, RSA **rsa);
+int i2d_RSAPublicKey_fp(FILE *fp, RSA *rsa);
+RSA *d2i_RSA_PUBKEY_fp(FILE *fp, RSA **rsa);
+int i2d_RSA_PUBKEY_fp(FILE *fp, RSA *rsa);
+# endif
+# ifndef OPENSSL_NO_DSA
+DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa);
+int i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa);
+DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa);
+int i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa);
+# endif
+# ifndef OPENSSL_NO_EC
+EC_KEY *d2i_EC_PUBKEY_fp(FILE *fp, EC_KEY **eckey);
+int i2d_EC_PUBKEY_fp(FILE *fp, EC_KEY *eckey);
+EC_KEY *d2i_ECPrivateKey_fp(FILE *fp, EC_KEY **eckey);
+int i2d_ECPrivateKey_fp(FILE *fp, EC_KEY *eckey);
+# endif
+X509_SIG *d2i_PKCS8_fp(FILE *fp, X509_SIG **p8);
+int i2d_PKCS8_fp(FILE *fp, X509_SIG *p8);
+PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp,
+ PKCS8_PRIV_KEY_INFO **p8inf);
+int i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, PKCS8_PRIV_KEY_INFO *p8inf);
+int i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, EVP_PKEY *key);
+int i2d_PrivateKey_fp(FILE *fp, EVP_PKEY *pkey);
+EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a);
+int i2d_PUBKEY_fp(FILE *fp, EVP_PKEY *pkey);
+EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a);
+# endif
+
+# ifndef OPENSSL_NO_BIO
+X509 *d2i_X509_bio(BIO *bp, X509 **x509);
+int i2d_X509_bio(BIO *bp, X509 *x509);
+X509_CRL *d2i_X509_CRL_bio(BIO *bp, X509_CRL **crl);
+int i2d_X509_CRL_bio(BIO *bp, X509_CRL *crl);
+X509_REQ *d2i_X509_REQ_bio(BIO *bp, X509_REQ **req);
+int i2d_X509_REQ_bio(BIO *bp, X509_REQ *req);
+# ifndef OPENSSL_NO_RSA
+RSA *d2i_RSAPrivateKey_bio(BIO *bp, RSA **rsa);
+int i2d_RSAPrivateKey_bio(BIO *bp, RSA *rsa);
+RSA *d2i_RSAPublicKey_bio(BIO *bp, RSA **rsa);
+int i2d_RSAPublicKey_bio(BIO *bp, RSA *rsa);
+RSA *d2i_RSA_PUBKEY_bio(BIO *bp, RSA **rsa);
+int i2d_RSA_PUBKEY_bio(BIO *bp, RSA *rsa);
+# endif
+# ifndef OPENSSL_NO_DSA
+DSA *d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa);
+int i2d_DSA_PUBKEY_bio(BIO *bp, DSA *dsa);
+DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA **dsa);
+int i2d_DSAPrivateKey_bio(BIO *bp, DSA *dsa);
+# endif
+# ifndef OPENSSL_NO_EC
+EC_KEY *d2i_EC_PUBKEY_bio(BIO *bp, EC_KEY **eckey);
+int i2d_EC_PUBKEY_bio(BIO *bp, EC_KEY *eckey);
+EC_KEY *d2i_ECPrivateKey_bio(BIO *bp, EC_KEY **eckey);
+int i2d_ECPrivateKey_bio(BIO *bp, EC_KEY *eckey);
+# endif
+X509_SIG *d2i_PKCS8_bio(BIO *bp, X509_SIG **p8);
+int i2d_PKCS8_bio(BIO *bp, X509_SIG *p8);
+PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_bio(BIO *bp,
+ PKCS8_PRIV_KEY_INFO **p8inf);
+int i2d_PKCS8_PRIV_KEY_INFO_bio(BIO *bp, PKCS8_PRIV_KEY_INFO *p8inf);
+int i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, EVP_PKEY *key);
+int i2d_PrivateKey_bio(BIO *bp, EVP_PKEY *pkey);
+EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a);
+int i2d_PUBKEY_bio(BIO *bp, EVP_PKEY *pkey);
+EVP_PKEY *d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **a);
+# endif
+
+X509 *X509_dup(X509 *x509);
+X509_ATTRIBUTE *X509_ATTRIBUTE_dup(X509_ATTRIBUTE *xa);
+X509_EXTENSION *X509_EXTENSION_dup(X509_EXTENSION *ex);
+X509_CRL *X509_CRL_dup(X509_CRL *crl);
+X509_REVOKED *X509_REVOKED_dup(X509_REVOKED *rev);
+X509_REQ *X509_REQ_dup(X509_REQ *req);
+X509_ALGOR *X509_ALGOR_dup(X509_ALGOR *xn);
+int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype,
+ void *pval);
+void X509_ALGOR_get0(ASN1_OBJECT **paobj, int *pptype, void **ppval,
+ X509_ALGOR *algor);
+void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md);
+int X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b);
+
+X509_NAME *X509_NAME_dup(X509_NAME *xn);
+X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne);
+
+int X509_cmp_time(const ASN1_TIME *s, time_t *t);
+int X509_cmp_current_time(const ASN1_TIME *s);
+ASN1_TIME *X509_time_adj(ASN1_TIME *s, long adj, time_t *t);
+ASN1_TIME *X509_time_adj_ex(ASN1_TIME *s,
+ int offset_day, long offset_sec, time_t *t);
+ASN1_TIME *X509_gmtime_adj(ASN1_TIME *s, long adj);
+
+const char *X509_get_default_cert_area(void);
+const char *X509_get_default_cert_dir(void);
+const char *X509_get_default_cert_file(void);
+const char *X509_get_default_cert_dir_env(void);
+const char *X509_get_default_cert_file_env(void);
+const char *X509_get_default_private_dir(void);
+
+X509_REQ *X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md);
+X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey);
+
+DECLARE_ASN1_FUNCTIONS(X509_ALGOR)
+DECLARE_ASN1_ENCODE_FUNCTIONS(X509_ALGORS, X509_ALGORS, X509_ALGORS)
+DECLARE_ASN1_FUNCTIONS(X509_VAL)
+
+DECLARE_ASN1_FUNCTIONS(X509_PUBKEY)
+
+int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey);
+EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key);
+int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain);
+int i2d_PUBKEY(EVP_PKEY *a, unsigned char **pp);
+EVP_PKEY *d2i_PUBKEY(EVP_PKEY **a, const unsigned char **pp, long length);
+# ifndef OPENSSL_NO_RSA
+int i2d_RSA_PUBKEY(RSA *a, unsigned char **pp);
+RSA *d2i_RSA_PUBKEY(RSA **a, const unsigned char **pp, long length);
+# endif
+# ifndef OPENSSL_NO_DSA
+int i2d_DSA_PUBKEY(DSA *a, unsigned char **pp);
+DSA *d2i_DSA_PUBKEY(DSA **a, const unsigned char **pp, long length);
+# endif
+# ifndef OPENSSL_NO_EC
+int i2d_EC_PUBKEY(EC_KEY *a, unsigned char **pp);
+EC_KEY *d2i_EC_PUBKEY(EC_KEY **a, const unsigned char **pp, long length);
+# endif
+
+DECLARE_ASN1_FUNCTIONS(X509_SIG)
+DECLARE_ASN1_FUNCTIONS(X509_REQ_INFO)
+DECLARE_ASN1_FUNCTIONS(X509_REQ)
+
+DECLARE_ASN1_FUNCTIONS(X509_ATTRIBUTE)
+X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value);
+
+DECLARE_ASN1_FUNCTIONS(X509_EXTENSION)
+DECLARE_ASN1_ENCODE_FUNCTIONS(X509_EXTENSIONS, X509_EXTENSIONS, X509_EXTENSIONS)
+
+DECLARE_ASN1_FUNCTIONS(X509_NAME_ENTRY)
+
+DECLARE_ASN1_FUNCTIONS(X509_NAME)
+
+int X509_NAME_set(X509_NAME **xn, X509_NAME *name);
+
+DECLARE_ASN1_FUNCTIONS(X509_CINF)
+
+DECLARE_ASN1_FUNCTIONS(X509)
+DECLARE_ASN1_FUNCTIONS(X509_CERT_AUX)
+
+DECLARE_ASN1_FUNCTIONS(X509_CERT_PAIR)
+
+int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
+ CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
+int X509_set_ex_data(X509 *r, int idx, void *arg);
+void *X509_get_ex_data(X509 *r, int idx);
+int i2d_X509_AUX(X509 *a, unsigned char **pp);
+X509 *d2i_X509_AUX(X509 **a, const unsigned char **pp, long length);
+
+int i2d_re_X509_tbs(X509 *x, unsigned char **pp);
+
+void X509_get0_signature(ASN1_BIT_STRING **psig, X509_ALGOR **palg,
+ const X509 *x);
+int X509_get_signature_nid(const X509 *x);
+
+int X509_alias_set1(X509 *x, unsigned char *name, int len);
+int X509_keyid_set1(X509 *x, unsigned char *id, int len);
+unsigned char *X509_alias_get0(X509 *x, int *len);
+unsigned char *X509_keyid_get0(X509 *x, int *len);
+int (*X509_TRUST_set_default(int (*trust) (int, X509 *, int))) (int, X509 *,
+ int);
+int X509_TRUST_set(int *t, int trust);
+int X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj);
+int X509_add1_reject_object(X509 *x, ASN1_OBJECT *obj);
+void X509_trust_clear(X509 *x);
+void X509_reject_clear(X509 *x);
+
+DECLARE_ASN1_FUNCTIONS(X509_REVOKED)
+DECLARE_ASN1_FUNCTIONS(X509_CRL_INFO)
+DECLARE_ASN1_FUNCTIONS(X509_CRL)
+
+int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev);
+int X509_CRL_get0_by_serial(X509_CRL *crl,
+ X509_REVOKED **ret, ASN1_INTEGER *serial);
+int X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x);
+
+X509_PKEY *X509_PKEY_new(void);
+void X509_PKEY_free(X509_PKEY *a);
+int i2d_X509_PKEY(X509_PKEY *a, unsigned char **pp);
+X509_PKEY *d2i_X509_PKEY(X509_PKEY **a, const unsigned char **pp,
+ long length);
+
+DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI)
+DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC)
+DECLARE_ASN1_FUNCTIONS(NETSCAPE_CERT_SEQUENCE)
+
+# ifndef OPENSSL_NO_EVP
+X509_INFO *X509_INFO_new(void);
+void X509_INFO_free(X509_INFO *a);
+char *X509_NAME_oneline(X509_NAME *a, char *buf, int size);
+
+int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *algor1,
+ ASN1_BIT_STRING *signature, char *data, EVP_PKEY *pkey);
+
+int ASN1_digest(i2d_of_void *i2d, const EVP_MD *type, char *data,
+ unsigned char *md, unsigned int *len);
+
+int ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1,
+ X509_ALGOR *algor2, ASN1_BIT_STRING *signature,
+ char *data, EVP_PKEY *pkey, const EVP_MD *type);
+
+int ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *data,
+ unsigned char *md, unsigned int *len);
+
+int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *algor1,
+ ASN1_BIT_STRING *signature, void *data, EVP_PKEY *pkey);
+
+int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1,
+ X509_ALGOR *algor2, ASN1_BIT_STRING *signature, void *data,
+ EVP_PKEY *pkey, const EVP_MD *type);
+int ASN1_item_sign_ctx(const ASN1_ITEM *it, X509_ALGOR *algor1,
+ X509_ALGOR *algor2, ASN1_BIT_STRING *signature,
+ void *asn, EVP_MD_CTX *ctx);
+# endif
+
+int X509_set_version(X509 *x, long version);
+int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial);
+ASN1_INTEGER *X509_get_serialNumber(X509 *x);
+int X509_set_issuer_name(X509 *x, X509_NAME *name);
+X509_NAME *X509_get_issuer_name(X509 *a);
+int X509_set_subject_name(X509 *x, X509_NAME *name);
+X509_NAME *X509_get_subject_name(X509 *a);
+int X509_set_notBefore(X509 *x, const ASN1_TIME *tm);
+int X509_set_notAfter(X509 *x, const ASN1_TIME *tm);
+int X509_set_pubkey(X509 *x, EVP_PKEY *pkey);
+EVP_PKEY *X509_get_pubkey(X509 *x);
+ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x);
+int X509_certificate_type(X509 *x, EVP_PKEY *pubkey /* optional */ );
+
+int X509_REQ_set_version(X509_REQ *x, long version);
+int X509_REQ_set_subject_name(X509_REQ *req, X509_NAME *name);
+int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey);
+EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req);
+int X509_REQ_extension_nid(int nid);
+int *X509_REQ_get_extension_nids(void);
+void X509_REQ_set_extension_nids(int *nids);
+STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req);
+int X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts,
+ int nid);
+int X509_REQ_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts);
+int X509_REQ_get_attr_count(const X509_REQ *req);
+int X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid, int lastpos);
+int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, ASN1_OBJECT *obj,
+ int lastpos);
+X509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc);
+X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc);
+int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr);
+int X509_REQ_add1_attr_by_OBJ(X509_REQ *req,
+ const ASN1_OBJECT *obj, int type,
+ const unsigned char *bytes, int len);
+int X509_REQ_add1_attr_by_NID(X509_REQ *req,
+ int nid, int type,
+ const unsigned char *bytes, int len);
+int X509_REQ_add1_attr_by_txt(X509_REQ *req,
+ const char *attrname, int type,
+ const unsigned char *bytes, int len);
+
+int X509_CRL_set_version(X509_CRL *x, long version);
+int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name);
+int X509_CRL_set_lastUpdate(X509_CRL *x, const ASN1_TIME *tm);
+int X509_CRL_set_nextUpdate(X509_CRL *x, const ASN1_TIME *tm);
+int X509_CRL_sort(X509_CRL *crl);
+
+int X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial);
+int X509_REVOKED_set_revocationDate(X509_REVOKED *r, ASN1_TIME *tm);
+
+X509_CRL *X509_CRL_diff(X509_CRL *base, X509_CRL *newer,
+ EVP_PKEY *skey, const EVP_MD *md, unsigned int flags);
+
+int X509_REQ_check_private_key(X509_REQ *x509, EVP_PKEY *pkey);
+
+int X509_check_private_key(X509 *x509, EVP_PKEY *pkey);
+int X509_chain_check_suiteb(int *perror_depth,
+ X509 *x, STACK_OF(X509) *chain,
+ unsigned long flags);
+int X509_CRL_check_suiteb(X509_CRL *crl, EVP_PKEY *pk, unsigned long flags);
+STACK_OF(X509) *X509_chain_up_ref(STACK_OF(X509) *chain);
+
+int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b);
+unsigned long X509_issuer_and_serial_hash(X509 *a);
+
+int X509_issuer_name_cmp(const X509 *a, const X509 *b);
+unsigned long X509_issuer_name_hash(X509 *a);
+
+int X509_subject_name_cmp(const X509 *a, const X509 *b);
+unsigned long X509_subject_name_hash(X509 *x);
+
+# ifndef OPENSSL_NO_MD5
+unsigned long X509_issuer_name_hash_old(X509 *a);
+unsigned long X509_subject_name_hash_old(X509 *x);
+# endif
+
+int X509_cmp(const X509 *a, const X509 *b);
+int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b);
+unsigned long X509_NAME_hash(X509_NAME *x);
+unsigned long X509_NAME_hash_old(X509_NAME *x);
+
+int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b);
+int X509_CRL_match(const X509_CRL *a, const X509_CRL *b);
+# ifndef OPENSSL_NO_FP_API
+int X509_print_ex_fp(FILE *bp, X509 *x, unsigned long nmflag,
+ unsigned long cflag);
+int X509_print_fp(FILE *bp, X509 *x);
+int X509_CRL_print_fp(FILE *bp, X509_CRL *x);
+int X509_REQ_print_fp(FILE *bp, X509_REQ *req);
+int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent,
+ unsigned long flags);
+# endif
+
+# ifndef OPENSSL_NO_BIO
+int X509_NAME_print(BIO *bp, X509_NAME *name, int obase);
+int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent,
+ unsigned long flags);
+int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflag,
+ unsigned long cflag);
+int X509_print(BIO *bp, X509 *x);
+int X509_ocspid_print(BIO *bp, X509 *x);
+int X509_CERT_AUX_print(BIO *bp, X509_CERT_AUX *x, int indent);
+int X509_CRL_print(BIO *bp, X509_CRL *x);
+int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflag,
+ unsigned long cflag);
+int X509_REQ_print(BIO *bp, X509_REQ *req);
+# endif
+
+int X509_NAME_entry_count(X509_NAME *name);
+int X509_NAME_get_text_by_NID(X509_NAME *name, int nid, char *buf, int len);
+int X509_NAME_get_text_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj,
+ char *buf, int len);
+
+/*
+ * NOTE: you should be passsing -1, not 0 as lastpos. The functions that use
+ * lastpos, search after that position on.
+ */
+int X509_NAME_get_index_by_NID(X509_NAME *name, int nid, int lastpos);
+int X509_NAME_get_index_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj,
+ int lastpos);
+X509_NAME_ENTRY *X509_NAME_get_entry(X509_NAME *name, int loc);
+X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc);
+int X509_NAME_add_entry(X509_NAME *name, X509_NAME_ENTRY *ne,
+ int loc, int set);
+int X509_NAME_add_entry_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int type,
+ unsigned char *bytes, int len, int loc,
+ int set);
+int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type,
+ unsigned char *bytes, int len, int loc,
+ int set);
+X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne,
+ const char *field, int type,
+ const unsigned char *bytes,
+ int len);
+X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid,
+ int type, unsigned char *bytes,
+ int len);
+int X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type,
+ const unsigned char *bytes, int len, int loc,
+ int set);
+X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne,
+ ASN1_OBJECT *obj, int type,
+ const unsigned char *bytes,
+ int len);
+int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, ASN1_OBJECT *obj);
+int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type,
+ const unsigned char *bytes, int len);
+ASN1_OBJECT *X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne);
+ASN1_STRING *X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne);
+
+int X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x);
+int X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x,
+ int nid, int lastpos);
+int X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *x,
+ ASN1_OBJECT *obj, int lastpos);
+int X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *x,
+ int crit, int lastpos);
+X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc);
+X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc);
+STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x,
+ X509_EXTENSION *ex, int loc);
+
+int X509_get_ext_count(X509 *x);
+int X509_get_ext_by_NID(X509 *x, int nid, int lastpos);
+int X509_get_ext_by_OBJ(X509 *x, ASN1_OBJECT *obj, int lastpos);
+int X509_get_ext_by_critical(X509 *x, int crit, int lastpos);
+X509_EXTENSION *X509_get_ext(X509 *x, int loc);
+X509_EXTENSION *X509_delete_ext(X509 *x, int loc);
+int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc);
+void *X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx);
+int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit,
+ unsigned long flags);
+
+int X509_CRL_get_ext_count(X509_CRL *x);
+int X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos);
+int X509_CRL_get_ext_by_OBJ(X509_CRL *x, ASN1_OBJECT *obj, int lastpos);
+int X509_CRL_get_ext_by_critical(X509_CRL *x, int crit, int lastpos);
+X509_EXTENSION *X509_CRL_get_ext(X509_CRL *x, int loc);
+X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc);
+int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc);
+void *X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx);
+int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit,
+ unsigned long flags);
+
+int X509_REVOKED_get_ext_count(X509_REVOKED *x);
+int X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos);
+int X509_REVOKED_get_ext_by_OBJ(X509_REVOKED *x, ASN1_OBJECT *obj,
+ int lastpos);
+int X509_REVOKED_get_ext_by_critical(X509_REVOKED *x, int crit, int lastpos);
+X509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *x, int loc);
+X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc);
+int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc);
+void *X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx);
+int X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit,
+ unsigned long flags);
+
+X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex,
+ int nid, int crit,
+ ASN1_OCTET_STRING *data);
+X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex,
+ ASN1_OBJECT *obj, int crit,
+ ASN1_OCTET_STRING *data);
+int X509_EXTENSION_set_object(X509_EXTENSION *ex, ASN1_OBJECT *obj);
+int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit);
+int X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data);
+ASN1_OBJECT *X509_EXTENSION_get_object(X509_EXTENSION *ex);
+ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne);
+int X509_EXTENSION_get_critical(X509_EXTENSION *ex);
+
+int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x);
+int X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid,
+ int lastpos);
+int X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk,
+ ASN1_OBJECT *obj, int lastpos);
+X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc);
+X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc);
+STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x,
+ X509_ATTRIBUTE *attr);
+STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE)
+ **x, const ASN1_OBJECT *obj,
+ int type,
+ const unsigned char *bytes,
+ int len);
+STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE)
+ **x, int nid, int type,
+ const unsigned char *bytes,
+ int len);
+STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE)
+ **x, const char *attrname,
+ int type,
+ const unsigned char *bytes,
+ int len);
+void *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, ASN1_OBJECT *obj,
+ int lastpos, int type);
+X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid,
+ int atrtype, const void *data,
+ int len);
+X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr,
+ const ASN1_OBJECT *obj,
+ int atrtype, const void *data,
+ int len);
+X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr,
+ const char *atrname, int type,
+ const unsigned char *bytes,
+ int len);
+int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj);
+int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype,
+ const void *data, int len);
+void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, int atrtype,
+ void *data);
+int X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr);
+ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr);
+ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx);
+
+int EVP_PKEY_get_attr_count(const EVP_PKEY *key);
+int EVP_PKEY_get_attr_by_NID(const EVP_PKEY *key, int nid, int lastpos);
+int EVP_PKEY_get_attr_by_OBJ(const EVP_PKEY *key, ASN1_OBJECT *obj,
+ int lastpos);
+X509_ATTRIBUTE *EVP_PKEY_get_attr(const EVP_PKEY *key, int loc);
+X509_ATTRIBUTE *EVP_PKEY_delete_attr(EVP_PKEY *key, int loc);
+int EVP_PKEY_add1_attr(EVP_PKEY *key, X509_ATTRIBUTE *attr);
+int EVP_PKEY_add1_attr_by_OBJ(EVP_PKEY *key,
+ const ASN1_OBJECT *obj, int type,
+ const unsigned char *bytes, int len);
+int EVP_PKEY_add1_attr_by_NID(EVP_PKEY *key,
+ int nid, int type,
+ const unsigned char *bytes, int len);
+int EVP_PKEY_add1_attr_by_txt(EVP_PKEY *key,
+ const char *attrname, int type,
+ const unsigned char *bytes, int len);
+
+int X509_verify_cert(X509_STORE_CTX *ctx);
+
+/* lookup a cert from a X509 STACK */
+X509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk, X509_NAME *name,
+ ASN1_INTEGER *serial);
+X509 *X509_find_by_subject(STACK_OF(X509) *sk, X509_NAME *name);
+
+DECLARE_ASN1_FUNCTIONS(PBEPARAM)
+DECLARE_ASN1_FUNCTIONS(PBE2PARAM)
+DECLARE_ASN1_FUNCTIONS(PBKDF2PARAM)
+
+int PKCS5_pbe_set0_algor(X509_ALGOR *algor, int alg, int iter,
+ const unsigned char *salt, int saltlen);
+
+X509_ALGOR *PKCS5_pbe_set(int alg, int iter,
+ const unsigned char *salt, int saltlen);
+X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter,
+ unsigned char *salt, int saltlen);
+X509_ALGOR *PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter,
+ unsigned char *salt, int saltlen,
+ unsigned char *aiv, int prf_nid);
+
+X509_ALGOR *PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen,
+ int prf_nid, int keylen);
+
+/* PKCS#8 utilities */
+
+DECLARE_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO)
+
+EVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8);
+PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey);
+PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8_broken(EVP_PKEY *pkey, int broken);
+PKCS8_PRIV_KEY_INFO *PKCS8_set_broken(PKCS8_PRIV_KEY_INFO *p8, int broken);
+
+int PKCS8_pkey_set0(PKCS8_PRIV_KEY_INFO *priv, ASN1_OBJECT *aobj,
+ int version, int ptype, void *pval,
+ unsigned char *penc, int penclen);
+int PKCS8_pkey_get0(ASN1_OBJECT **ppkalg,
+ const unsigned char **pk, int *ppklen,
+ X509_ALGOR **pa, PKCS8_PRIV_KEY_INFO *p8);
+
+int X509_PUBKEY_set0_param(X509_PUBKEY *pub, ASN1_OBJECT *aobj,
+ int ptype, void *pval,
+ unsigned char *penc, int penclen);
+int X509_PUBKEY_get0_param(ASN1_OBJECT **ppkalg,
+ const unsigned char **pk, int *ppklen,
+ X509_ALGOR **pa, X509_PUBKEY *pub);
+
+int X509_check_trust(X509 *x, int id, int flags);
+int X509_TRUST_get_count(void);
+X509_TRUST *X509_TRUST_get0(int idx);
+int X509_TRUST_get_by_id(int id);
+int X509_TRUST_add(int id, int flags, int (*ck) (X509_TRUST *, X509 *, int),
+ char *name, int arg1, void *arg2);
+void X509_TRUST_cleanup(void);
+int X509_TRUST_get_flags(X509_TRUST *xp);
+char *X509_TRUST_get0_name(X509_TRUST *xp);
+int X509_TRUST_get_trust(X509_TRUST *xp);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_X509_strings(void);
+
+/* Error codes for the X509 functions. */
+
+/* Function codes. */
+# define X509_F_ADD_CERT_DIR 100
+# define X509_F_BY_FILE_CTRL 101
+# define X509_F_CHECK_POLICY 145
+# define X509_F_DIR_CTRL 102
+# define X509_F_GET_CERT_BY_SUBJECT 103
+# define X509_F_NETSCAPE_SPKI_B64_DECODE 129
+# define X509_F_NETSCAPE_SPKI_B64_ENCODE 130
+# define X509_F_X509AT_ADD1_ATTR 135
+# define X509_F_X509V3_ADD_EXT 104
+# define X509_F_X509_ATTRIBUTE_CREATE_BY_NID 136
+# define X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ 137
+# define X509_F_X509_ATTRIBUTE_CREATE_BY_TXT 140
+# define X509_F_X509_ATTRIBUTE_GET0_DATA 139
+# define X509_F_X509_ATTRIBUTE_SET1_DATA 138
+# define X509_F_X509_CHECK_PRIVATE_KEY 128
+# define X509_F_X509_CRL_DIFF 105
+# define X509_F_X509_CRL_PRINT_FP 147
+# define X509_F_X509_EXTENSION_CREATE_BY_NID 108
+# define X509_F_X509_EXTENSION_CREATE_BY_OBJ 109
+# define X509_F_X509_GET_PUBKEY_PARAMETERS 110
+# define X509_F_X509_LOAD_CERT_CRL_FILE 132
+# define X509_F_X509_LOAD_CERT_FILE 111
+# define X509_F_X509_LOAD_CRL_FILE 112
+# define X509_F_X509_NAME_ADD_ENTRY 113
+# define X509_F_X509_NAME_ENTRY_CREATE_BY_NID 114
+# define X509_F_X509_NAME_ENTRY_CREATE_BY_TXT 131
+# define X509_F_X509_NAME_ENTRY_SET_OBJECT 115
+# define X509_F_X509_NAME_ONELINE 116
+# define X509_F_X509_NAME_PRINT 117
+# define X509_F_X509_PRINT_EX_FP 118
+# define X509_F_X509_PUBKEY_GET 119
+# define X509_F_X509_PUBKEY_SET 120
+# define X509_F_X509_REQ_CHECK_PRIVATE_KEY 144
+# define X509_F_X509_REQ_PRINT_EX 121
+# define X509_F_X509_REQ_PRINT_FP 122
+# define X509_F_X509_REQ_TO_X509 123
+# define X509_F_X509_STORE_ADD_CERT 124
+# define X509_F_X509_STORE_ADD_CRL 125
+# define X509_F_X509_STORE_CTX_GET1_ISSUER 146
+# define X509_F_X509_STORE_CTX_INIT 143
+# define X509_F_X509_STORE_CTX_NEW 142
+# define X509_F_X509_STORE_CTX_PURPOSE_INHERIT 134
+# define X509_F_X509_TO_X509_REQ 126
+# define X509_F_X509_TRUST_ADD 133
+# define X509_F_X509_TRUST_SET 141
+# define X509_F_X509_VERIFY_CERT 127
+
+/* Reason codes. */
+# define X509_R_AKID_MISMATCH 110
+# define X509_R_BAD_X509_FILETYPE 100
+# define X509_R_BASE64_DECODE_ERROR 118
+# define X509_R_CANT_CHECK_DH_KEY 114
+# define X509_R_CERT_ALREADY_IN_HASH_TABLE 101
+# define X509_R_CRL_ALREADY_DELTA 127
+# define X509_R_CRL_VERIFY_FAILURE 131
+# define X509_R_ERR_ASN1_LIB 102
+# define X509_R_IDP_MISMATCH 128
+# define X509_R_INVALID_DIRECTORY 113
+# define X509_R_INVALID_FIELD_NAME 119
+# define X509_R_INVALID_TRUST 123
+# define X509_R_ISSUER_MISMATCH 129
+# define X509_R_KEY_TYPE_MISMATCH 115
+# define X509_R_KEY_VALUES_MISMATCH 116
+# define X509_R_LOADING_CERT_DIR 103
+# define X509_R_LOADING_DEFAULTS 104
+# define X509_R_METHOD_NOT_SUPPORTED 124
+# define X509_R_NEWER_CRL_NOT_NEWER 132
+# define X509_R_NO_CERT_SET_FOR_US_TO_VERIFY 105
+# define X509_R_NO_CRL_NUMBER 130
+# define X509_R_PUBLIC_KEY_DECODE_ERROR 125
+# define X509_R_PUBLIC_KEY_ENCODE_ERROR 126
+# define X509_R_SHOULD_RETRY 106
+# define X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN 107
+# define X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY 108
+# define X509_R_UNKNOWN_KEY_TYPE 117
+# define X509_R_UNKNOWN_NID 109
+# define X509_R_UNKNOWN_PURPOSE_ID 121
+# define X509_R_UNKNOWN_TRUST_ID 120
+# define X509_R_UNSUPPORTED_ALGORITHM 111
+# define X509_R_WRONG_LOOKUP_TYPE 112
+# define X509_R_WRONG_TYPE 122
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/x509_vfy.h b/protocols/Telegram/tgl/openssl/include/openssl/x509_vfy.h
new file mode 100644
index 0000000000..bd8613c62b
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/x509_vfy.h
@@ -0,0 +1,647 @@
+/* crypto/x509/x509_vfy.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * 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 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_X509_H
+# include <openssl/x509.h>
+/*
+ * openssl/x509.h ends up #include-ing this file at about the only
+ * appropriate moment.
+ */
+#endif
+
+#ifndef HEADER_X509_VFY_H
+# define HEADER_X509_VFY_H
+
+# include <openssl/opensslconf.h>
+# ifndef OPENSSL_NO_LHASH
+# include <openssl/lhash.h>
+# endif
+# include <openssl/bio.h>
+# include <openssl/crypto.h>
+# include <openssl/symhacks.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# if 0
+/* Outer object */
+typedef struct x509_hash_dir_st {
+ int num_dirs;
+ char **dirs;
+ int *dirs_type;
+ int num_dirs_alloced;
+} X509_HASH_DIR_CTX;
+# endif
+
+typedef struct x509_file_st {
+ int num_paths; /* number of paths to files or directories */
+ int num_alloced;
+ char **paths; /* the list of paths or directories */
+ int *path_type;
+} X509_CERT_FILE_CTX;
+
+/*******************************/
+/*-
+SSL_CTX -> X509_STORE
+ -> X509_LOOKUP
+ ->X509_LOOKUP_METHOD
+ -> X509_LOOKUP
+ ->X509_LOOKUP_METHOD
+
+SSL -> X509_STORE_CTX
+ ->X509_STORE
+
+The X509_STORE holds the tables etc for verification stuff.
+A X509_STORE_CTX is used while validating a single certificate.
+The X509_STORE has X509_LOOKUPs for looking up certs.
+The X509_STORE then calls a function to actually verify the
+certificate chain.
+*/
+
+# define X509_LU_RETRY -1
+# define X509_LU_FAIL 0
+# define X509_LU_X509 1
+# define X509_LU_CRL 2
+# define X509_LU_PKEY 3
+
+typedef struct x509_object_st {
+ /* one of the above types */
+ int type;
+ union {
+ char *ptr;
+ X509 *x509;
+ X509_CRL *crl;
+ EVP_PKEY *pkey;
+ } data;
+} X509_OBJECT;
+
+typedef struct x509_lookup_st X509_LOOKUP;
+
+DECLARE_STACK_OF(X509_LOOKUP)
+DECLARE_STACK_OF(X509_OBJECT)
+
+/* This is a static that defines the function interface */
+typedef struct x509_lookup_method_st {
+ const char *name;
+ int (*new_item) (X509_LOOKUP *ctx);
+ void (*free) (X509_LOOKUP *ctx);
+ int (*init) (X509_LOOKUP *ctx);
+ int (*shutdown) (X509_LOOKUP *ctx);
+ int (*ctrl) (X509_LOOKUP *ctx, int cmd, const char *argc, long argl,
+ char **ret);
+ int (*get_by_subject) (X509_LOOKUP *ctx, int type, X509_NAME *name,
+ X509_OBJECT *ret);
+ int (*get_by_issuer_serial) (X509_LOOKUP *ctx, int type, X509_NAME *name,
+ ASN1_INTEGER *serial, X509_OBJECT *ret);
+ int (*get_by_fingerprint) (X509_LOOKUP *ctx, int type,
+ unsigned char *bytes, int len,
+ X509_OBJECT *ret);
+ int (*get_by_alias) (X509_LOOKUP *ctx, int type, char *str, int len,
+ X509_OBJECT *ret);
+} X509_LOOKUP_METHOD;
+
+typedef struct X509_VERIFY_PARAM_ID_st X509_VERIFY_PARAM_ID;
+
+/*
+ * This structure hold all parameters associated with a verify operation by
+ * including an X509_VERIFY_PARAM structure in related structures the
+ * parameters used can be customized
+ */
+
+typedef struct X509_VERIFY_PARAM_st {
+ char *name;
+ time_t check_time; /* Time to use */
+ unsigned long inh_flags; /* Inheritance flags */
+ unsigned long flags; /* Various verify flags */
+ int purpose; /* purpose to check untrusted certificates */
+ int trust; /* trust setting to check */
+ int depth; /* Verify depth */
+ STACK_OF(ASN1_OBJECT) *policies; /* Permissible policies */
+ X509_VERIFY_PARAM_ID *id; /* opaque ID data */
+} X509_VERIFY_PARAM;
+
+DECLARE_STACK_OF(X509_VERIFY_PARAM)
+
+/*
+ * This is used to hold everything. It is used for all certificate
+ * validation. Once we have a certificate chain, the 'verify' function is
+ * then called to actually check the cert chain.
+ */
+struct x509_store_st {
+ /* The following is a cache of trusted certs */
+ int cache; /* if true, stash any hits */
+ STACK_OF(X509_OBJECT) *objs; /* Cache of all objects */
+ /* These are external lookup methods */
+ STACK_OF(X509_LOOKUP) *get_cert_methods;
+ X509_VERIFY_PARAM *param;
+ /* Callbacks for various operations */
+ /* called to verify a certificate */
+ int (*verify) (X509_STORE_CTX *ctx);
+ /* error callback */
+ int (*verify_cb) (int ok, X509_STORE_CTX *ctx);
+ /* get issuers cert from ctx */
+ int (*get_issuer) (X509 **issuer, X509_STORE_CTX *ctx, X509 *x);
+ /* check issued */
+ int (*check_issued) (X509_STORE_CTX *ctx, X509 *x, X509 *issuer);
+ /* Check revocation status of chain */
+ int (*check_revocation) (X509_STORE_CTX *ctx);
+ /* retrieve CRL */
+ int (*get_crl) (X509_STORE_CTX *ctx, X509_CRL **crl, X509 *x);
+ /* Check CRL validity */
+ int (*check_crl) (X509_STORE_CTX *ctx, X509_CRL *crl);
+ /* Check certificate against CRL */
+ int (*cert_crl) (X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x);
+ STACK_OF(X509) *(*lookup_certs) (X509_STORE_CTX *ctx, X509_NAME *nm);
+ STACK_OF(X509_CRL) *(*lookup_crls) (X509_STORE_CTX *ctx, X509_NAME *nm);
+ int (*cleanup) (X509_STORE_CTX *ctx);
+ CRYPTO_EX_DATA ex_data;
+ int references;
+} /* X509_STORE */ ;
+
+int X509_STORE_set_depth(X509_STORE *store, int depth);
+
+# define X509_STORE_set_verify_cb_func(ctx,func) ((ctx)->verify_cb=(func))
+# define X509_STORE_set_verify_func(ctx,func) ((ctx)->verify=(func))
+
+/* This is the functions plus an instance of the local variables. */
+struct x509_lookup_st {
+ int init; /* have we been started */
+ int skip; /* don't use us. */
+ X509_LOOKUP_METHOD *method; /* the functions */
+ char *method_data; /* method data */
+ X509_STORE *store_ctx; /* who owns us */
+} /* X509_LOOKUP */ ;
+
+/*
+ * This is a used when verifying cert chains. Since the gathering of the
+ * cert chain can take some time (and have to be 'retried', this needs to be
+ * kept and passed around.
+ */
+struct x509_store_ctx_st { /* X509_STORE_CTX */
+ X509_STORE *ctx;
+ /* used when looking up certs */
+ int current_method;
+ /* The following are set by the caller */
+ /* The cert to check */
+ X509 *cert;
+ /* chain of X509s - untrusted - passed in */
+ STACK_OF(X509) *untrusted;
+ /* set of CRLs passed in */
+ STACK_OF(X509_CRL) *crls;
+ X509_VERIFY_PARAM *param;
+ /* Other info for use with get_issuer() */
+ void *other_ctx;
+ /* Callbacks for various operations */
+ /* called to verify a certificate */
+ int (*verify) (X509_STORE_CTX *ctx);
+ /* error callback */
+ int (*verify_cb) (int ok, X509_STORE_CTX *ctx);
+ /* get issuers cert from ctx */
+ int (*get_issuer) (X509 **issuer, X509_STORE_CTX *ctx, X509 *x);
+ /* check issued */
+ int (*check_issued) (X509_STORE_CTX *ctx, X509 *x, X509 *issuer);
+ /* Check revocation status of chain */
+ int (*check_revocation) (X509_STORE_CTX *ctx);
+ /* retrieve CRL */
+ int (*get_crl) (X509_STORE_CTX *ctx, X509_CRL **crl, X509 *x);
+ /* Check CRL validity */
+ int (*check_crl) (X509_STORE_CTX *ctx, X509_CRL *crl);
+ /* Check certificate against CRL */
+ int (*cert_crl) (X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x);
+ int (*check_policy) (X509_STORE_CTX *ctx);
+ STACK_OF(X509) *(*lookup_certs) (X509_STORE_CTX *ctx, X509_NAME *nm);
+ STACK_OF(X509_CRL) *(*lookup_crls) (X509_STORE_CTX *ctx, X509_NAME *nm);
+ int (*cleanup) (X509_STORE_CTX *ctx);
+ /* The following is built up */
+ /* if 0, rebuild chain */
+ int valid;
+ /* index of last untrusted cert */
+ int last_untrusted;
+ /* chain of X509s - built up and trusted */
+ STACK_OF(X509) *chain;
+ /* Valid policy tree */
+ X509_POLICY_TREE *tree;
+ /* Require explicit policy value */
+ int explicit_policy;
+ /* When something goes wrong, this is why */
+ int error_depth;
+ int error;
+ X509 *current_cert;
+ /* cert currently being tested as valid issuer */
+ X509 *current_issuer;
+ /* current CRL */
+ X509_CRL *current_crl;
+ /* score of current CRL */
+ int current_crl_score;
+ /* Reason mask */
+ unsigned int current_reasons;
+ /* For CRL path validation: parent context */
+ X509_STORE_CTX *parent;
+ CRYPTO_EX_DATA ex_data;
+} /* X509_STORE_CTX */ ;
+
+void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth);
+
+# define X509_STORE_CTX_set_app_data(ctx,data) \
+ X509_STORE_CTX_set_ex_data(ctx,0,data)
+# define X509_STORE_CTX_get_app_data(ctx) \
+ X509_STORE_CTX_get_ex_data(ctx,0)
+
+# define X509_L_FILE_LOAD 1
+# define X509_L_ADD_DIR 2
+
+# define X509_LOOKUP_load_file(x,name,type) \
+ X509_LOOKUP_ctrl((x),X509_L_FILE_LOAD,(name),(long)(type),NULL)
+
+# define X509_LOOKUP_add_dir(x,name,type) \
+ X509_LOOKUP_ctrl((x),X509_L_ADD_DIR,(name),(long)(type),NULL)
+
+# define X509_V_OK 0
+/* illegal error (for uninitialized values, to avoid X509_V_OK): 1 */
+
+# define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT 2
+# define X509_V_ERR_UNABLE_TO_GET_CRL 3
+# define X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE 4
+# define X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE 5
+# define X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY 6
+# define X509_V_ERR_CERT_SIGNATURE_FAILURE 7
+# define X509_V_ERR_CRL_SIGNATURE_FAILURE 8
+# define X509_V_ERR_CERT_NOT_YET_VALID 9
+# define X509_V_ERR_CERT_HAS_EXPIRED 10
+# define X509_V_ERR_CRL_NOT_YET_VALID 11
+# define X509_V_ERR_CRL_HAS_EXPIRED 12
+# define X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD 13
+# define X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD 14
+# define X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD 15
+# define X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD 16
+# define X509_V_ERR_OUT_OF_MEM 17
+# define X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT 18
+# define X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN 19
+# define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY 20
+# define X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE 21
+# define X509_V_ERR_CERT_CHAIN_TOO_LONG 22
+# define X509_V_ERR_CERT_REVOKED 23
+# define X509_V_ERR_INVALID_CA 24
+# define X509_V_ERR_PATH_LENGTH_EXCEEDED 25
+# define X509_V_ERR_INVALID_PURPOSE 26
+# define X509_V_ERR_CERT_UNTRUSTED 27
+# define X509_V_ERR_CERT_REJECTED 28
+/* These are 'informational' when looking for issuer cert */
+# define X509_V_ERR_SUBJECT_ISSUER_MISMATCH 29
+# define X509_V_ERR_AKID_SKID_MISMATCH 30
+# define X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH 31
+# define X509_V_ERR_KEYUSAGE_NO_CERTSIGN 32
+
+# define X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER 33
+# define X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION 34
+# define X509_V_ERR_KEYUSAGE_NO_CRL_SIGN 35
+# define X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION 36
+# define X509_V_ERR_INVALID_NON_CA 37
+# define X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED 38
+# define X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE 39
+# define X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED 40
+
+# define X509_V_ERR_INVALID_EXTENSION 41
+# define X509_V_ERR_INVALID_POLICY_EXTENSION 42
+# define X509_V_ERR_NO_EXPLICIT_POLICY 43
+# define X509_V_ERR_DIFFERENT_CRL_SCOPE 44
+# define X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE 45
+
+# define X509_V_ERR_UNNESTED_RESOURCE 46
+
+# define X509_V_ERR_PERMITTED_VIOLATION 47
+# define X509_V_ERR_EXCLUDED_VIOLATION 48
+# define X509_V_ERR_SUBTREE_MINMAX 49
+# define X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE 51
+# define X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX 52
+# define X509_V_ERR_UNSUPPORTED_NAME_SYNTAX 53
+# define X509_V_ERR_CRL_PATH_VALIDATION_ERROR 54
+
+/* Suite B mode algorithm violation */
+# define X509_V_ERR_SUITE_B_INVALID_VERSION 56
+# define X509_V_ERR_SUITE_B_INVALID_ALGORITHM 57
+# define X509_V_ERR_SUITE_B_INVALID_CURVE 58
+# define X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM 59
+# define X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED 60
+# define X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256 61
+
+/* Host, email and IP check errors */
+# define X509_V_ERR_HOSTNAME_MISMATCH 62
+# define X509_V_ERR_EMAIL_MISMATCH 63
+# define X509_V_ERR_IP_ADDRESS_MISMATCH 64
+
+/* The application is not happy */
+# define X509_V_ERR_APPLICATION_VERIFICATION 50
+
+/* Certificate verify flags */
+
+/* Send issuer+subject checks to verify_cb */
+# define X509_V_FLAG_CB_ISSUER_CHECK 0x1
+/* Use check time instead of current time */
+# define X509_V_FLAG_USE_CHECK_TIME 0x2
+/* Lookup CRLs */
+# define X509_V_FLAG_CRL_CHECK 0x4
+/* Lookup CRLs for whole chain */
+# define X509_V_FLAG_CRL_CHECK_ALL 0x8
+/* Ignore unhandled critical extensions */
+# define X509_V_FLAG_IGNORE_CRITICAL 0x10
+/* Disable workarounds for broken certificates */
+# define X509_V_FLAG_X509_STRICT 0x20
+/* Enable proxy certificate validation */
+# define X509_V_FLAG_ALLOW_PROXY_CERTS 0x40
+/* Enable policy checking */
+# define X509_V_FLAG_POLICY_CHECK 0x80
+/* Policy variable require-explicit-policy */
+# define X509_V_FLAG_EXPLICIT_POLICY 0x100
+/* Policy variable inhibit-any-policy */
+# define X509_V_FLAG_INHIBIT_ANY 0x200
+/* Policy variable inhibit-policy-mapping */
+# define X509_V_FLAG_INHIBIT_MAP 0x400
+/* Notify callback that policy is OK */
+# define X509_V_FLAG_NOTIFY_POLICY 0x800
+/* Extended CRL features such as indirect CRLs, alternate CRL signing keys */
+# define X509_V_FLAG_EXTENDED_CRL_SUPPORT 0x1000
+/* Delta CRL support */
+# define X509_V_FLAG_USE_DELTAS 0x2000
+/* Check selfsigned CA signature */
+# define X509_V_FLAG_CHECK_SS_SIGNATURE 0x4000
+/* Use trusted store first */
+# define X509_V_FLAG_TRUSTED_FIRST 0x8000
+/* Suite B 128 bit only mode: not normally used */
+# define X509_V_FLAG_SUITEB_128_LOS_ONLY 0x10000
+/* Suite B 192 bit only mode */
+# define X509_V_FLAG_SUITEB_192_LOS 0x20000
+/* Suite B 128 bit mode allowing 192 bit algorithms */
+# define X509_V_FLAG_SUITEB_128_LOS 0x30000
+
+/* Allow partial chains if at least one certificate is in trusted store */
+# define X509_V_FLAG_PARTIAL_CHAIN 0x80000
+/*
+ * If the initial chain is not trusted, do not attempt to build an alternative
+ * chain. Alternate chain checking was introduced in 1.0.2b. Setting this flag
+ * will force the behaviour to match that of previous versions.
+ */
+# define X509_V_FLAG_NO_ALT_CHAINS 0x100000
+
+# define X509_VP_FLAG_DEFAULT 0x1
+# define X509_VP_FLAG_OVERWRITE 0x2
+# define X509_VP_FLAG_RESET_FLAGS 0x4
+# define X509_VP_FLAG_LOCKED 0x8
+# define X509_VP_FLAG_ONCE 0x10
+
+/* Internal use: mask of policy related options */
+# define X509_V_FLAG_POLICY_MASK (X509_V_FLAG_POLICY_CHECK \
+ | X509_V_FLAG_EXPLICIT_POLICY \
+ | X509_V_FLAG_INHIBIT_ANY \
+ | X509_V_FLAG_INHIBIT_MAP)
+
+int X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, int type,
+ X509_NAME *name);
+X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h,
+ int type, X509_NAME *name);
+X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h,
+ X509_OBJECT *x);
+void X509_OBJECT_up_ref_count(X509_OBJECT *a);
+void X509_OBJECT_free_contents(X509_OBJECT *a);
+X509_STORE *X509_STORE_new(void);
+void X509_STORE_free(X509_STORE *v);
+
+STACK_OF(X509) *X509_STORE_get1_certs(X509_STORE_CTX *st, X509_NAME *nm);
+STACK_OF(X509_CRL) *X509_STORE_get1_crls(X509_STORE_CTX *st, X509_NAME *nm);
+int X509_STORE_set_flags(X509_STORE *ctx, unsigned long flags);
+int X509_STORE_set_purpose(X509_STORE *ctx, int purpose);
+int X509_STORE_set_trust(X509_STORE *ctx, int trust);
+int X509_STORE_set1_param(X509_STORE *ctx, X509_VERIFY_PARAM *pm);
+
+void X509_STORE_set_verify_cb(X509_STORE *ctx,
+ int (*verify_cb) (int, X509_STORE_CTX *));
+
+void X509_STORE_set_lookup_crls_cb(X509_STORE *ctx,
+ STACK_OF(X509_CRL) *(*cb) (X509_STORE_CTX
+ *ctx,
+ X509_NAME *nm));
+
+X509_STORE_CTX *X509_STORE_CTX_new(void);
+
+int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x);
+
+void X509_STORE_CTX_free(X509_STORE_CTX *ctx);
+int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store,
+ X509 *x509, STACK_OF(X509) *chain);
+void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk);
+void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx);
+
+X509_STORE *X509_STORE_CTX_get0_store(X509_STORE_CTX *ctx);
+
+X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m);
+
+X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void);
+X509_LOOKUP_METHOD *X509_LOOKUP_file(void);
+
+int X509_STORE_add_cert(X509_STORE *ctx, X509 *x);
+int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x);
+
+int X509_STORE_get_by_subject(X509_STORE_CTX *vs, int type, X509_NAME *name,
+ X509_OBJECT *ret);
+
+int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,
+ long argl, char **ret);
+
+# ifndef OPENSSL_NO_STDIO
+int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type);
+int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type);
+int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type);
+# endif
+
+X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method);
+void X509_LOOKUP_free(X509_LOOKUP *ctx);
+int X509_LOOKUP_init(X509_LOOKUP *ctx);
+int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, int type, X509_NAME *name,
+ X509_OBJECT *ret);
+int X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, int type, X509_NAME *name,
+ ASN1_INTEGER *serial, X509_OBJECT *ret);
+int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, int type,
+ unsigned char *bytes, int len,
+ X509_OBJECT *ret);
+int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, int type, char *str, int len,
+ X509_OBJECT *ret);
+int X509_LOOKUP_shutdown(X509_LOOKUP *ctx);
+
+# ifndef OPENSSL_NO_STDIO
+int X509_STORE_load_locations(X509_STORE *ctx,
+ const char *file, const char *dir);
+int X509_STORE_set_default_paths(X509_STORE *ctx);
+# endif
+
+int X509_STORE_CTX_get_ex_new_index(long argl, void *argp,
+ CRYPTO_EX_new *new_func,
+ CRYPTO_EX_dup *dup_func,
+ CRYPTO_EX_free *free_func);
+int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *ctx, int idx, void *data);
+void *X509_STORE_CTX_get_ex_data(X509_STORE_CTX *ctx, int idx);
+int X509_STORE_CTX_get_error(X509_STORE_CTX *ctx);
+void X509_STORE_CTX_set_error(X509_STORE_CTX *ctx, int s);
+int X509_STORE_CTX_get_error_depth(X509_STORE_CTX *ctx);
+X509 *X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx);
+X509 *X509_STORE_CTX_get0_current_issuer(X509_STORE_CTX *ctx);
+X509_CRL *X509_STORE_CTX_get0_current_crl(X509_STORE_CTX *ctx);
+X509_STORE_CTX *X509_STORE_CTX_get0_parent_ctx(X509_STORE_CTX *ctx);
+STACK_OF(X509) *X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx);
+STACK_OF(X509) *X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx);
+void X509_STORE_CTX_set_cert(X509_STORE_CTX *c, X509 *x);
+void X509_STORE_CTX_set_chain(X509_STORE_CTX *c, STACK_OF(X509) *sk);
+void X509_STORE_CTX_set0_crls(X509_STORE_CTX *c, STACK_OF(X509_CRL) *sk);
+int X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose);
+int X509_STORE_CTX_set_trust(X509_STORE_CTX *ctx, int trust);
+int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose,
+ int purpose, int trust);
+void X509_STORE_CTX_set_flags(X509_STORE_CTX *ctx, unsigned long flags);
+void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, unsigned long flags,
+ time_t t);
+void X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx,
+ int (*verify_cb) (int, X509_STORE_CTX *));
+
+X509_POLICY_TREE *X509_STORE_CTX_get0_policy_tree(X509_STORE_CTX *ctx);
+int X509_STORE_CTX_get_explicit_policy(X509_STORE_CTX *ctx);
+
+X509_VERIFY_PARAM *X509_STORE_CTX_get0_param(X509_STORE_CTX *ctx);
+void X509_STORE_CTX_set0_param(X509_STORE_CTX *ctx, X509_VERIFY_PARAM *param);
+int X509_STORE_CTX_set_default(X509_STORE_CTX *ctx, const char *name);
+
+/* X509_VERIFY_PARAM functions */
+
+X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void);
+void X509_VERIFY_PARAM_free(X509_VERIFY_PARAM *param);
+int X509_VERIFY_PARAM_inherit(X509_VERIFY_PARAM *to,
+ const X509_VERIFY_PARAM *from);
+int X509_VERIFY_PARAM_set1(X509_VERIFY_PARAM *to,
+ const X509_VERIFY_PARAM *from);
+int X509_VERIFY_PARAM_set1_name(X509_VERIFY_PARAM *param, const char *name);
+int X509_VERIFY_PARAM_set_flags(X509_VERIFY_PARAM *param,
+ unsigned long flags);
+int X509_VERIFY_PARAM_clear_flags(X509_VERIFY_PARAM *param,
+ unsigned long flags);
+unsigned long X509_VERIFY_PARAM_get_flags(X509_VERIFY_PARAM *param);
+int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose);
+int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust);
+void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth);
+void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t);
+int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param,
+ ASN1_OBJECT *policy);
+int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param,
+ STACK_OF(ASN1_OBJECT) *policies);
+
+int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param,
+ const char *name, size_t namelen);
+int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param,
+ const char *name, size_t namelen);
+void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param,
+ unsigned int flags);
+char *X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *);
+int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param,
+ const char *email, size_t emaillen);
+int X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *param,
+ const unsigned char *ip, size_t iplen);
+int X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *param,
+ const char *ipasc);
+
+int X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param);
+const char *X509_VERIFY_PARAM_get0_name(const X509_VERIFY_PARAM *param);
+
+int X509_VERIFY_PARAM_add0_table(X509_VERIFY_PARAM *param);
+int X509_VERIFY_PARAM_get_count(void);
+const X509_VERIFY_PARAM *X509_VERIFY_PARAM_get0(int id);
+const X509_VERIFY_PARAM *X509_VERIFY_PARAM_lookup(const char *name);
+void X509_VERIFY_PARAM_table_cleanup(void);
+
+int X509_policy_check(X509_POLICY_TREE **ptree, int *pexplicit_policy,
+ STACK_OF(X509) *certs,
+ STACK_OF(ASN1_OBJECT) *policy_oids, unsigned int flags);
+
+void X509_policy_tree_free(X509_POLICY_TREE *tree);
+
+int X509_policy_tree_level_count(const X509_POLICY_TREE *tree);
+X509_POLICY_LEVEL *X509_policy_tree_get0_level(const X509_POLICY_TREE *tree,
+ int i);
+
+STACK_OF(X509_POLICY_NODE) *X509_policy_tree_get0_policies(const
+ X509_POLICY_TREE
+ *tree);
+
+STACK_OF(X509_POLICY_NODE) *X509_policy_tree_get0_user_policies(const
+ X509_POLICY_TREE
+ *tree);
+
+int X509_policy_level_node_count(X509_POLICY_LEVEL *level);
+
+X509_POLICY_NODE *X509_policy_level_get0_node(X509_POLICY_LEVEL *level,
+ int i);
+
+const ASN1_OBJECT *X509_policy_node_get0_policy(const X509_POLICY_NODE *node);
+
+STACK_OF(POLICYQUALINFO) *X509_policy_node_get0_qualifiers(const
+ X509_POLICY_NODE
+ *node);
+const X509_POLICY_NODE *X509_policy_node_get0_parent(const X509_POLICY_NODE
+ *node);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/include/openssl/x509v3.h b/protocols/Telegram/tgl/openssl/include/openssl/x509v3.h
new file mode 100644
index 0000000000..f5c61560aa
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/include/openssl/x509v3.h
@@ -0,0 +1,1055 @@
+/* x509v3.h */
+/*
+ * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
+ * 1999.
+ */
+/* ====================================================================
+ * Copyright (c) 1999-2004 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+#ifndef HEADER_X509V3_H
+# define HEADER_X509V3_H
+
+# include <openssl/bio.h>
+# include <openssl/x509.h>
+# include <openssl/conf.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# ifdef OPENSSL_SYS_WIN32
+/* Under Win32 these are defined in wincrypt.h */
+# undef X509_NAME
+# undef X509_CERT_PAIR
+# undef X509_EXTENSIONS
+# endif
+
+/* Forward reference */
+struct v3_ext_method;
+struct v3_ext_ctx;
+
+/* Useful typedefs */
+
+typedef void *(*X509V3_EXT_NEW)(void);
+typedef void (*X509V3_EXT_FREE) (void *);
+typedef void *(*X509V3_EXT_D2I)(void *, const unsigned char **, long);
+typedef int (*X509V3_EXT_I2D) (void *, unsigned char **);
+typedef STACK_OF(CONF_VALUE) *
+ (*X509V3_EXT_I2V) (const struct v3_ext_method *method, void *ext,
+ STACK_OF(CONF_VALUE) *extlist);
+typedef void *(*X509V3_EXT_V2I)(const struct v3_ext_method *method,
+ struct v3_ext_ctx *ctx,
+ STACK_OF(CONF_VALUE) *values);
+typedef char *(*X509V3_EXT_I2S)(const struct v3_ext_method *method,
+ void *ext);
+typedef void *(*X509V3_EXT_S2I)(const struct v3_ext_method *method,
+ struct v3_ext_ctx *ctx, const char *str);
+typedef int (*X509V3_EXT_I2R) (const struct v3_ext_method *method, void *ext,
+ BIO *out, int indent);
+typedef void *(*X509V3_EXT_R2I)(const struct v3_ext_method *method,
+ struct v3_ext_ctx *ctx, const char *str);
+
+/* V3 extension structure */
+
+struct v3_ext_method {
+ int ext_nid;
+ int ext_flags;
+/* If this is set the following four fields are ignored */
+ ASN1_ITEM_EXP *it;
+/* Old style ASN1 calls */
+ X509V3_EXT_NEW ext_new;
+ X509V3_EXT_FREE ext_free;
+ X509V3_EXT_D2I d2i;
+ X509V3_EXT_I2D i2d;
+/* The following pair is used for string extensions */
+ X509V3_EXT_I2S i2s;
+ X509V3_EXT_S2I s2i;
+/* The following pair is used for multi-valued extensions */
+ X509V3_EXT_I2V i2v;
+ X509V3_EXT_V2I v2i;
+/* The following are used for raw extensions */
+ X509V3_EXT_I2R i2r;
+ X509V3_EXT_R2I r2i;
+ void *usr_data; /* Any extension specific data */
+};
+
+typedef struct X509V3_CONF_METHOD_st {
+ char *(*get_string) (void *db, char *section, char *value);
+ STACK_OF(CONF_VALUE) *(*get_section) (void *db, char *section);
+ void (*free_string) (void *db, char *string);
+ void (*free_section) (void *db, STACK_OF(CONF_VALUE) *section);
+} X509V3_CONF_METHOD;
+
+/* Context specific info */
+struct v3_ext_ctx {
+# define CTX_TEST 0x1
+ int flags;
+ X509 *issuer_cert;
+ X509 *subject_cert;
+ X509_REQ *subject_req;
+ X509_CRL *crl;
+ X509V3_CONF_METHOD *db_meth;
+ void *db;
+/* Maybe more here */
+};
+
+typedef struct v3_ext_method X509V3_EXT_METHOD;
+
+DECLARE_STACK_OF(X509V3_EXT_METHOD)
+
+/* ext_flags values */
+# define X509V3_EXT_DYNAMIC 0x1
+# define X509V3_EXT_CTX_DEP 0x2
+# define X509V3_EXT_MULTILINE 0x4
+
+typedef BIT_STRING_BITNAME ENUMERATED_NAMES;
+
+typedef struct BASIC_CONSTRAINTS_st {
+ int ca;
+ ASN1_INTEGER *pathlen;
+} BASIC_CONSTRAINTS;
+
+typedef struct PKEY_USAGE_PERIOD_st {
+ ASN1_GENERALIZEDTIME *notBefore;
+ ASN1_GENERALIZEDTIME *notAfter;
+} PKEY_USAGE_PERIOD;
+
+typedef struct otherName_st {
+ ASN1_OBJECT *type_id;
+ ASN1_TYPE *value;
+} OTHERNAME;
+
+typedef struct EDIPartyName_st {
+ ASN1_STRING *nameAssigner;
+ ASN1_STRING *partyName;
+} EDIPARTYNAME;
+
+typedef struct GENERAL_NAME_st {
+# define GEN_OTHERNAME 0
+# define GEN_EMAIL 1
+# define GEN_DNS 2
+# define GEN_X400 3
+# define GEN_DIRNAME 4
+# define GEN_EDIPARTY 5
+# define GEN_URI 6
+# define GEN_IPADD 7
+# define GEN_RID 8
+ int type;
+ union {
+ char *ptr;
+ OTHERNAME *otherName; /* otherName */
+ ASN1_IA5STRING *rfc822Name;
+ ASN1_IA5STRING *dNSName;
+ ASN1_TYPE *x400Address;
+ X509_NAME *directoryName;
+ EDIPARTYNAME *ediPartyName;
+ ASN1_IA5STRING *uniformResourceIdentifier;
+ ASN1_OCTET_STRING *iPAddress;
+ ASN1_OBJECT *registeredID;
+ /* Old names */
+ ASN1_OCTET_STRING *ip; /* iPAddress */
+ X509_NAME *dirn; /* dirn */
+ ASN1_IA5STRING *ia5; /* rfc822Name, dNSName,
+ * uniformResourceIdentifier */
+ ASN1_OBJECT *rid; /* registeredID */
+ ASN1_TYPE *other; /* x400Address */
+ } d;
+} GENERAL_NAME;
+
+typedef STACK_OF(GENERAL_NAME) GENERAL_NAMES;
+
+typedef struct ACCESS_DESCRIPTION_st {
+ ASN1_OBJECT *method;
+ GENERAL_NAME *location;
+} ACCESS_DESCRIPTION;
+
+typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
+
+typedef STACK_OF(ASN1_OBJECT) EXTENDED_KEY_USAGE;
+
+DECLARE_STACK_OF(GENERAL_NAME)
+DECLARE_ASN1_SET_OF(GENERAL_NAME)
+
+DECLARE_STACK_OF(ACCESS_DESCRIPTION)
+DECLARE_ASN1_SET_OF(ACCESS_DESCRIPTION)
+
+typedef struct DIST_POINT_NAME_st {
+ int type;
+ union {
+ GENERAL_NAMES *fullname;
+ STACK_OF(X509_NAME_ENTRY) *relativename;
+ } name;
+/* If relativename then this contains the full distribution point name */
+ X509_NAME *dpname;
+} DIST_POINT_NAME;
+/* All existing reasons */
+# define CRLDP_ALL_REASONS 0x807f
+
+# define CRL_REASON_NONE -1
+# define CRL_REASON_UNSPECIFIED 0
+# define CRL_REASON_KEY_COMPROMISE 1
+# define CRL_REASON_CA_COMPROMISE 2
+# define CRL_REASON_AFFILIATION_CHANGED 3
+# define CRL_REASON_SUPERSEDED 4
+# define CRL_REASON_CESSATION_OF_OPERATION 5
+# define CRL_REASON_CERTIFICATE_HOLD 6
+# define CRL_REASON_REMOVE_FROM_CRL 8
+# define CRL_REASON_PRIVILEGE_WITHDRAWN 9
+# define CRL_REASON_AA_COMPROMISE 10
+
+struct DIST_POINT_st {
+ DIST_POINT_NAME *distpoint;
+ ASN1_BIT_STRING *reasons;
+ GENERAL_NAMES *CRLissuer;
+ int dp_reasons;
+};
+
+typedef STACK_OF(DIST_POINT) CRL_DIST_POINTS;
+
+DECLARE_STACK_OF(DIST_POINT)
+DECLARE_ASN1_SET_OF(DIST_POINT)
+
+struct AUTHORITY_KEYID_st {
+ ASN1_OCTET_STRING *keyid;
+ GENERAL_NAMES *issuer;
+ ASN1_INTEGER *serial;
+};
+
+/* Strong extranet structures */
+
+typedef struct SXNET_ID_st {
+ ASN1_INTEGER *zone;
+ ASN1_OCTET_STRING *user;
+} SXNETID;
+
+DECLARE_STACK_OF(SXNETID)
+DECLARE_ASN1_SET_OF(SXNETID)
+
+typedef struct SXNET_st {
+ ASN1_INTEGER *version;
+ STACK_OF(SXNETID) *ids;
+} SXNET;
+
+typedef struct NOTICEREF_st {
+ ASN1_STRING *organization;
+ STACK_OF(ASN1_INTEGER) *noticenos;
+} NOTICEREF;
+
+typedef struct USERNOTICE_st {
+ NOTICEREF *noticeref;
+ ASN1_STRING *exptext;
+} USERNOTICE;
+
+typedef struct POLICYQUALINFO_st {
+ ASN1_OBJECT *pqualid;
+ union {
+ ASN1_IA5STRING *cpsuri;
+ USERNOTICE *usernotice;
+ ASN1_TYPE *other;
+ } d;
+} POLICYQUALINFO;
+
+DECLARE_STACK_OF(POLICYQUALINFO)
+DECLARE_ASN1_SET_OF(POLICYQUALINFO)
+
+typedef struct POLICYINFO_st {
+ ASN1_OBJECT *policyid;
+ STACK_OF(POLICYQUALINFO) *qualifiers;
+} POLICYINFO;
+
+typedef STACK_OF(POLICYINFO) CERTIFICATEPOLICIES;
+
+DECLARE_STACK_OF(POLICYINFO)
+DECLARE_ASN1_SET_OF(POLICYINFO)
+
+typedef struct POLICY_MAPPING_st {
+ ASN1_OBJECT *issuerDomainPolicy;
+ ASN1_OBJECT *subjectDomainPolicy;
+} POLICY_MAPPING;
+
+DECLARE_STACK_OF(POLICY_MAPPING)
+
+typedef STACK_OF(POLICY_MAPPING) POLICY_MAPPINGS;
+
+typedef struct GENERAL_SUBTREE_st {
+ GENERAL_NAME *base;
+ ASN1_INTEGER *minimum;
+ ASN1_INTEGER *maximum;
+} GENERAL_SUBTREE;
+
+DECLARE_STACK_OF(GENERAL_SUBTREE)
+
+struct NAME_CONSTRAINTS_st {
+ STACK_OF(GENERAL_SUBTREE) *permittedSubtrees;
+ STACK_OF(GENERAL_SUBTREE) *excludedSubtrees;
+};
+
+typedef struct POLICY_CONSTRAINTS_st {
+ ASN1_INTEGER *requireExplicitPolicy;
+ ASN1_INTEGER *inhibitPolicyMapping;
+} POLICY_CONSTRAINTS;
+
+/* Proxy certificate structures, see RFC 3820 */
+typedef struct PROXY_POLICY_st {
+ ASN1_OBJECT *policyLanguage;
+ ASN1_OCTET_STRING *policy;
+} PROXY_POLICY;
+
+typedef struct PROXY_CERT_INFO_EXTENSION_st {
+ ASN1_INTEGER *pcPathLengthConstraint;
+ PROXY_POLICY *proxyPolicy;
+} PROXY_CERT_INFO_EXTENSION;
+
+DECLARE_ASN1_FUNCTIONS(PROXY_POLICY)
+DECLARE_ASN1_FUNCTIONS(PROXY_CERT_INFO_EXTENSION)
+
+struct ISSUING_DIST_POINT_st {
+ DIST_POINT_NAME *distpoint;
+ int onlyuser;
+ int onlyCA;
+ ASN1_BIT_STRING *onlysomereasons;
+ int indirectCRL;
+ int onlyattr;
+};
+
+/* Values in idp_flags field */
+/* IDP present */
+# define IDP_PRESENT 0x1
+/* IDP values inconsistent */
+# define IDP_INVALID 0x2
+/* onlyuser true */
+# define IDP_ONLYUSER 0x4
+/* onlyCA true */
+# define IDP_ONLYCA 0x8
+/* onlyattr true */
+# define IDP_ONLYATTR 0x10
+/* indirectCRL true */
+# define IDP_INDIRECT 0x20
+/* onlysomereasons present */
+# define IDP_REASONS 0x40
+
+# define X509V3_conf_err(val) ERR_add_error_data(6, "section:", val->section, \
+",name:", val->name, ",value:", val->value);
+
+# define X509V3_set_ctx_test(ctx) \
+ X509V3_set_ctx(ctx, NULL, NULL, NULL, NULL, CTX_TEST)
+# define X509V3_set_ctx_nodb(ctx) (ctx)->db = NULL;
+
+# define EXT_BITSTRING(nid, table) { nid, 0, ASN1_ITEM_ref(ASN1_BIT_STRING), \
+ 0,0,0,0, \
+ 0,0, \
+ (X509V3_EXT_I2V)i2v_ASN1_BIT_STRING, \
+ (X509V3_EXT_V2I)v2i_ASN1_BIT_STRING, \
+ NULL, NULL, \
+ table}
+
+# define EXT_IA5STRING(nid) { nid, 0, ASN1_ITEM_ref(ASN1_IA5STRING), \
+ 0,0,0,0, \
+ (X509V3_EXT_I2S)i2s_ASN1_IA5STRING, \
+ (X509V3_EXT_S2I)s2i_ASN1_IA5STRING, \
+ 0,0,0,0, \
+ NULL}
+
+# define EXT_END { -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+
+/* X509_PURPOSE stuff */
+
+# define EXFLAG_BCONS 0x1
+# define EXFLAG_KUSAGE 0x2
+# define EXFLAG_XKUSAGE 0x4
+# define EXFLAG_NSCERT 0x8
+
+# define EXFLAG_CA 0x10
+/* Really self issued not necessarily self signed */
+# define EXFLAG_SI 0x20
+# define EXFLAG_V1 0x40
+# define EXFLAG_INVALID 0x80
+# define EXFLAG_SET 0x100
+# define EXFLAG_CRITICAL 0x200
+# define EXFLAG_PROXY 0x400
+
+# define EXFLAG_INVALID_POLICY 0x800
+# define EXFLAG_FRESHEST 0x1000
+/* Self signed */
+# define EXFLAG_SS 0x2000
+
+# define KU_DIGITAL_SIGNATURE 0x0080
+# define KU_NON_REPUDIATION 0x0040
+# define KU_KEY_ENCIPHERMENT 0x0020
+# define KU_DATA_ENCIPHERMENT 0x0010
+# define KU_KEY_AGREEMENT 0x0008
+# define KU_KEY_CERT_SIGN 0x0004
+# define KU_CRL_SIGN 0x0002
+# define KU_ENCIPHER_ONLY 0x0001
+# define KU_DECIPHER_ONLY 0x8000
+
+# define NS_SSL_CLIENT 0x80
+# define NS_SSL_SERVER 0x40
+# define NS_SMIME 0x20
+# define NS_OBJSIGN 0x10
+# define NS_SSL_CA 0x04
+# define NS_SMIME_CA 0x02
+# define NS_OBJSIGN_CA 0x01
+# define NS_ANY_CA (NS_SSL_CA|NS_SMIME_CA|NS_OBJSIGN_CA)
+
+# define XKU_SSL_SERVER 0x1
+# define XKU_SSL_CLIENT 0x2
+# define XKU_SMIME 0x4
+# define XKU_CODE_SIGN 0x8
+# define XKU_SGC 0x10
+# define XKU_OCSP_SIGN 0x20
+# define XKU_TIMESTAMP 0x40
+# define XKU_DVCS 0x80
+# define XKU_ANYEKU 0x100
+
+# define X509_PURPOSE_DYNAMIC 0x1
+# define X509_PURPOSE_DYNAMIC_NAME 0x2
+
+typedef struct x509_purpose_st {
+ int purpose;
+ int trust; /* Default trust ID */
+ int flags;
+ int (*check_purpose) (const struct x509_purpose_st *, const X509 *, int);
+ char *name;
+ char *sname;
+ void *usr_data;
+} X509_PURPOSE;
+
+# define X509_PURPOSE_SSL_CLIENT 1
+# define X509_PURPOSE_SSL_SERVER 2
+# define X509_PURPOSE_NS_SSL_SERVER 3
+# define X509_PURPOSE_SMIME_SIGN 4
+# define X509_PURPOSE_SMIME_ENCRYPT 5
+# define X509_PURPOSE_CRL_SIGN 6
+# define X509_PURPOSE_ANY 7
+# define X509_PURPOSE_OCSP_HELPER 8
+# define X509_PURPOSE_TIMESTAMP_SIGN 9
+
+# define X509_PURPOSE_MIN 1
+# define X509_PURPOSE_MAX 9
+
+/* Flags for X509V3_EXT_print() */
+
+# define X509V3_EXT_UNKNOWN_MASK (0xfL << 16)
+/* Return error for unknown extensions */
+# define X509V3_EXT_DEFAULT 0
+/* Print error for unknown extensions */
+# define X509V3_EXT_ERROR_UNKNOWN (1L << 16)
+/* ASN1 parse unknown extensions */
+# define X509V3_EXT_PARSE_UNKNOWN (2L << 16)
+/* BIO_dump unknown extensions */
+# define X509V3_EXT_DUMP_UNKNOWN (3L << 16)
+
+/* Flags for X509V3_add1_i2d */
+
+# define X509V3_ADD_OP_MASK 0xfL
+# define X509V3_ADD_DEFAULT 0L
+# define X509V3_ADD_APPEND 1L
+# define X509V3_ADD_REPLACE 2L
+# define X509V3_ADD_REPLACE_EXISTING 3L
+# define X509V3_ADD_KEEP_EXISTING 4L
+# define X509V3_ADD_DELETE 5L
+# define X509V3_ADD_SILENT 0x10
+
+DECLARE_STACK_OF(X509_PURPOSE)
+
+DECLARE_ASN1_FUNCTIONS(BASIC_CONSTRAINTS)
+
+DECLARE_ASN1_FUNCTIONS(SXNET)
+DECLARE_ASN1_FUNCTIONS(SXNETID)
+
+int SXNET_add_id_asc(SXNET **psx, char *zone, char *user, int userlen);
+int SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, char *user,
+ int userlen);
+int SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *izone, char *user,
+ int userlen);
+
+ASN1_OCTET_STRING *SXNET_get_id_asc(SXNET *sx, char *zone);
+ASN1_OCTET_STRING *SXNET_get_id_ulong(SXNET *sx, unsigned long lzone);
+ASN1_OCTET_STRING *SXNET_get_id_INTEGER(SXNET *sx, ASN1_INTEGER *zone);
+
+DECLARE_ASN1_FUNCTIONS(AUTHORITY_KEYID)
+
+DECLARE_ASN1_FUNCTIONS(PKEY_USAGE_PERIOD)
+
+DECLARE_ASN1_FUNCTIONS(GENERAL_NAME)
+GENERAL_NAME *GENERAL_NAME_dup(GENERAL_NAME *a);
+int GENERAL_NAME_cmp(GENERAL_NAME *a, GENERAL_NAME *b);
+
+ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method,
+ X509V3_CTX *ctx,
+ STACK_OF(CONF_VALUE) *nval);
+STACK_OF(CONF_VALUE) *i2v_ASN1_BIT_STRING(X509V3_EXT_METHOD *method,
+ ASN1_BIT_STRING *bits,
+ STACK_OF(CONF_VALUE) *extlist);
+
+STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method,
+ GENERAL_NAME *gen,
+ STACK_OF(CONF_VALUE) *ret);
+int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen);
+
+DECLARE_ASN1_FUNCTIONS(GENERAL_NAMES)
+
+STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method,
+ GENERAL_NAMES *gen,
+ STACK_OF(CONF_VALUE) *extlist);
+GENERAL_NAMES *v2i_GENERAL_NAMES(const X509V3_EXT_METHOD *method,
+ X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
+
+DECLARE_ASN1_FUNCTIONS(OTHERNAME)
+DECLARE_ASN1_FUNCTIONS(EDIPARTYNAME)
+int OTHERNAME_cmp(OTHERNAME *a, OTHERNAME *b);
+void GENERAL_NAME_set0_value(GENERAL_NAME *a, int type, void *value);
+void *GENERAL_NAME_get0_value(GENERAL_NAME *a, int *ptype);
+int GENERAL_NAME_set0_othername(GENERAL_NAME *gen,
+ ASN1_OBJECT *oid, ASN1_TYPE *value);
+int GENERAL_NAME_get0_otherName(GENERAL_NAME *gen,
+ ASN1_OBJECT **poid, ASN1_TYPE **pvalue);
+
+char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method,
+ ASN1_OCTET_STRING *ia5);
+ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method,
+ X509V3_CTX *ctx, char *str);
+
+DECLARE_ASN1_FUNCTIONS(EXTENDED_KEY_USAGE)
+int i2a_ACCESS_DESCRIPTION(BIO *bp, ACCESS_DESCRIPTION *a);
+
+DECLARE_ASN1_FUNCTIONS(CERTIFICATEPOLICIES)
+DECLARE_ASN1_FUNCTIONS(POLICYINFO)
+DECLARE_ASN1_FUNCTIONS(POLICYQUALINFO)
+DECLARE_ASN1_FUNCTIONS(USERNOTICE)
+DECLARE_ASN1_FUNCTIONS(NOTICEREF)
+
+DECLARE_ASN1_FUNCTIONS(CRL_DIST_POINTS)
+DECLARE_ASN1_FUNCTIONS(DIST_POINT)
+DECLARE_ASN1_FUNCTIONS(DIST_POINT_NAME)
+DECLARE_ASN1_FUNCTIONS(ISSUING_DIST_POINT)
+
+int DIST_POINT_set_dpname(DIST_POINT_NAME *dpn, X509_NAME *iname);
+
+int NAME_CONSTRAINTS_check(X509 *x, NAME_CONSTRAINTS *nc);
+
+DECLARE_ASN1_FUNCTIONS(ACCESS_DESCRIPTION)
+DECLARE_ASN1_FUNCTIONS(AUTHORITY_INFO_ACCESS)
+
+DECLARE_ASN1_ITEM(POLICY_MAPPING)
+DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_MAPPING)
+DECLARE_ASN1_ITEM(POLICY_MAPPINGS)
+
+DECLARE_ASN1_ITEM(GENERAL_SUBTREE)
+DECLARE_ASN1_ALLOC_FUNCTIONS(GENERAL_SUBTREE)
+
+DECLARE_ASN1_ITEM(NAME_CONSTRAINTS)
+DECLARE_ASN1_ALLOC_FUNCTIONS(NAME_CONSTRAINTS)
+
+DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_CONSTRAINTS)
+DECLARE_ASN1_ITEM(POLICY_CONSTRAINTS)
+
+GENERAL_NAME *a2i_GENERAL_NAME(GENERAL_NAME *out,
+ const X509V3_EXT_METHOD *method,
+ X509V3_CTX *ctx, int gen_type, char *value,
+ int is_nc);
+
+# ifdef HEADER_CONF_H
+GENERAL_NAME *v2i_GENERAL_NAME(const X509V3_EXT_METHOD *method,
+ X509V3_CTX *ctx, CONF_VALUE *cnf);
+GENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out,
+ const X509V3_EXT_METHOD *method,
+ X509V3_CTX *ctx, CONF_VALUE *cnf,
+ int is_nc);
+void X509V3_conf_free(CONF_VALUE *val);
+
+X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid,
+ char *value);
+X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, char *name,
+ char *value);
+int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, char *section,
+ STACK_OF(X509_EXTENSION) **sk);
+int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section,
+ X509 *cert);
+int X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section,
+ X509_REQ *req);
+int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section,
+ X509_CRL *crl);
+
+X509_EXTENSION *X509V3_EXT_conf_nid(LHASH_OF(CONF_VALUE) *conf,
+ X509V3_CTX *ctx, int ext_nid,
+ char *value);
+X509_EXTENSION *X509V3_EXT_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
+ char *name, char *value);
+int X509V3_EXT_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
+ char *section, X509 *cert);
+int X509V3_EXT_REQ_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
+ char *section, X509_REQ *req);
+int X509V3_EXT_CRL_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
+ char *section, X509_CRL *crl);
+
+int X509V3_add_value_bool_nf(char *name, int asn1_bool,
+ STACK_OF(CONF_VALUE) **extlist);
+int X509V3_get_value_bool(CONF_VALUE *value, int *asn1_bool);
+int X509V3_get_value_int(CONF_VALUE *value, ASN1_INTEGER **aint);
+void X509V3_set_nconf(X509V3_CTX *ctx, CONF *conf);
+void X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH_OF(CONF_VALUE) *lhash);
+# endif
+
+char *X509V3_get_string(X509V3_CTX *ctx, char *name, char *section);
+STACK_OF(CONF_VALUE) *X509V3_get_section(X509V3_CTX *ctx, char *section);
+void X509V3_string_free(X509V3_CTX *ctx, char *str);
+void X509V3_section_free(X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *section);
+void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subject,
+ X509_REQ *req, X509_CRL *crl, int flags);
+
+int X509V3_add_value(const char *name, const char *value,
+ STACK_OF(CONF_VALUE) **extlist);
+int X509V3_add_value_uchar(const char *name, const unsigned char *value,
+ STACK_OF(CONF_VALUE) **extlist);
+int X509V3_add_value_bool(const char *name, int asn1_bool,
+ STACK_OF(CONF_VALUE) **extlist);
+int X509V3_add_value_int(const char *name, ASN1_INTEGER *aint,
+ STACK_OF(CONF_VALUE) **extlist);
+char *i2s_ASN1_INTEGER(X509V3_EXT_METHOD *meth, ASN1_INTEGER *aint);
+ASN1_INTEGER *s2i_ASN1_INTEGER(X509V3_EXT_METHOD *meth, char *value);
+char *i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint);
+char *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *meth,
+ ASN1_ENUMERATED *aint);
+int X509V3_EXT_add(X509V3_EXT_METHOD *ext);
+int X509V3_EXT_add_list(X509V3_EXT_METHOD *extlist);
+int X509V3_EXT_add_alias(int nid_to, int nid_from);
+void X509V3_EXT_cleanup(void);
+
+const X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext);
+const X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid);
+int X509V3_add_standard_extensions(void);
+STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line);
+void *X509V3_EXT_d2i(X509_EXTENSION *ext);
+void *X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit,
+ int *idx);
+int X509V3_EXT_free(int nid, void *ext_data);
+
+X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc);
+int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value,
+ int crit, unsigned long flags);
+
+char *hex_to_string(const unsigned char *buffer, long len);
+unsigned char *string_to_hex(const char *str, long *len);
+int name_cmp(const char *name, const char *cmp);
+
+void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent,
+ int ml);
+int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag,
+ int indent);
+int X509V3_EXT_print_fp(FILE *out, X509_EXTENSION *ext, int flag, int indent);
+
+int X509V3_extensions_print(BIO *out, char *title,
+ STACK_OF(X509_EXTENSION) *exts,
+ unsigned long flag, int indent);
+
+int X509_check_ca(X509 *x);
+int X509_check_purpose(X509 *x, int id, int ca);
+int X509_supported_extension(X509_EXTENSION *ex);
+int X509_PURPOSE_set(int *p, int purpose);
+int X509_check_issued(X509 *issuer, X509 *subject);
+int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid);
+int X509_PURPOSE_get_count(void);
+X509_PURPOSE *X509_PURPOSE_get0(int idx);
+int X509_PURPOSE_get_by_sname(char *sname);
+int X509_PURPOSE_get_by_id(int id);
+int X509_PURPOSE_add(int id, int trust, int flags,
+ int (*ck) (const X509_PURPOSE *, const X509 *, int),
+ char *name, char *sname, void *arg);
+char *X509_PURPOSE_get0_name(X509_PURPOSE *xp);
+char *X509_PURPOSE_get0_sname(X509_PURPOSE *xp);
+int X509_PURPOSE_get_trust(X509_PURPOSE *xp);
+void X509_PURPOSE_cleanup(void);
+int X509_PURPOSE_get_id(X509_PURPOSE *);
+
+STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x);
+STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x);
+void X509_email_free(STACK_OF(OPENSSL_STRING) *sk);
+STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x);
+/* Flags for X509_check_* functions */
+
+/*
+ * Always check subject name for host match even if subject alt names present
+ */
+# define X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT 0x1
+/* Disable wildcard matching for dnsName fields and common name. */
+# define X509_CHECK_FLAG_NO_WILDCARDS 0x2
+/* Wildcards must not match a partial label. */
+# define X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS 0x4
+/* Allow (non-partial) wildcards to match multiple labels. */
+# define X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS 0x8
+/* Constraint verifier subdomain patterns to match a single labels. */
+# define X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS 0x10
+/*
+ * Match reference identifiers starting with "." to any sub-domain.
+ * This is a non-public flag, turned on implicitly when the subject
+ * reference identity is a DNS name.
+ */
+# define _X509_CHECK_FLAG_DOT_SUBDOMAINS 0x8000
+
+int X509_check_host(X509 *x, const char *chk, size_t chklen,
+ unsigned int flags, char **peername);
+int X509_check_email(X509 *x, const char *chk, size_t chklen,
+ unsigned int flags);
+int X509_check_ip(X509 *x, const unsigned char *chk, size_t chklen,
+ unsigned int flags);
+int X509_check_ip_asc(X509 *x, const char *ipasc, unsigned int flags);
+
+ASN1_OCTET_STRING *a2i_IPADDRESS(const char *ipasc);
+ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc);
+int a2i_ipadd(unsigned char *ipout, const char *ipasc);
+int X509V3_NAME_from_section(X509_NAME *nm, STACK_OF(CONF_VALUE) *dn_sk,
+ unsigned long chtype);
+
+void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent);
+DECLARE_STACK_OF(X509_POLICY_NODE)
+
+# ifndef OPENSSL_NO_RFC3779
+
+typedef struct ASRange_st {
+ ASN1_INTEGER *min, *max;
+} ASRange;
+
+# define ASIdOrRange_id 0
+# define ASIdOrRange_range 1
+
+typedef struct ASIdOrRange_st {
+ int type;
+ union {
+ ASN1_INTEGER *id;
+ ASRange *range;
+ } u;
+} ASIdOrRange;
+
+typedef STACK_OF(ASIdOrRange) ASIdOrRanges;
+DECLARE_STACK_OF(ASIdOrRange)
+
+# define ASIdentifierChoice_inherit 0
+# define ASIdentifierChoice_asIdsOrRanges 1
+
+typedef struct ASIdentifierChoice_st {
+ int type;
+ union {
+ ASN1_NULL *inherit;
+ ASIdOrRanges *asIdsOrRanges;
+ } u;
+} ASIdentifierChoice;
+
+typedef struct ASIdentifiers_st {
+ ASIdentifierChoice *asnum, *rdi;
+} ASIdentifiers;
+
+DECLARE_ASN1_FUNCTIONS(ASRange)
+DECLARE_ASN1_FUNCTIONS(ASIdOrRange)
+DECLARE_ASN1_FUNCTIONS(ASIdentifierChoice)
+DECLARE_ASN1_FUNCTIONS(ASIdentifiers)
+
+typedef struct IPAddressRange_st {
+ ASN1_BIT_STRING *min, *max;
+} IPAddressRange;
+
+# define IPAddressOrRange_addressPrefix 0
+# define IPAddressOrRange_addressRange 1
+
+typedef struct IPAddressOrRange_st {
+ int type;
+ union {
+ ASN1_BIT_STRING *addressPrefix;
+ IPAddressRange *addressRange;
+ } u;
+} IPAddressOrRange;
+
+typedef STACK_OF(IPAddressOrRange) IPAddressOrRanges;
+DECLARE_STACK_OF(IPAddressOrRange)
+
+# define IPAddressChoice_inherit 0
+# define IPAddressChoice_addressesOrRanges 1
+
+typedef struct IPAddressChoice_st {
+ int type;
+ union {
+ ASN1_NULL *inherit;
+ IPAddressOrRanges *addressesOrRanges;
+ } u;
+} IPAddressChoice;
+
+typedef struct IPAddressFamily_st {
+ ASN1_OCTET_STRING *addressFamily;
+ IPAddressChoice *ipAddressChoice;
+} IPAddressFamily;
+
+typedef STACK_OF(IPAddressFamily) IPAddrBlocks;
+DECLARE_STACK_OF(IPAddressFamily)
+
+DECLARE_ASN1_FUNCTIONS(IPAddressRange)
+DECLARE_ASN1_FUNCTIONS(IPAddressOrRange)
+DECLARE_ASN1_FUNCTIONS(IPAddressChoice)
+DECLARE_ASN1_FUNCTIONS(IPAddressFamily)
+
+/*
+ * API tag for elements of the ASIdentifer SEQUENCE.
+ */
+# define V3_ASID_ASNUM 0
+# define V3_ASID_RDI 1
+
+/*
+ * AFI values, assigned by IANA. It'd be nice to make the AFI
+ * handling code totally generic, but there are too many little things
+ * that would need to be defined for other address families for it to
+ * be worth the trouble.
+ */
+# define IANA_AFI_IPV4 1
+# define IANA_AFI_IPV6 2
+
+/*
+ * Utilities to construct and extract values from RFC3779 extensions,
+ * since some of the encodings (particularly for IP address prefixes
+ * and ranges) are a bit tedious to work with directly.
+ */
+int v3_asid_add_inherit(ASIdentifiers *asid, int which);
+int v3_asid_add_id_or_range(ASIdentifiers *asid, int which,
+ ASN1_INTEGER *min, ASN1_INTEGER *max);
+int v3_addr_add_inherit(IPAddrBlocks *addr,
+ const unsigned afi, const unsigned *safi);
+int v3_addr_add_prefix(IPAddrBlocks *addr,
+ const unsigned afi, const unsigned *safi,
+ unsigned char *a, const int prefixlen);
+int v3_addr_add_range(IPAddrBlocks *addr,
+ const unsigned afi, const unsigned *safi,
+ unsigned char *min, unsigned char *max);
+unsigned v3_addr_get_afi(const IPAddressFamily *f);
+int v3_addr_get_range(IPAddressOrRange *aor, const unsigned afi,
+ unsigned char *min, unsigned char *max,
+ const int length);
+
+/*
+ * Canonical forms.
+ */
+int v3_asid_is_canonical(ASIdentifiers *asid);
+int v3_addr_is_canonical(IPAddrBlocks *addr);
+int v3_asid_canonize(ASIdentifiers *asid);
+int v3_addr_canonize(IPAddrBlocks *addr);
+
+/*
+ * Tests for inheritance and containment.
+ */
+int v3_asid_inherits(ASIdentifiers *asid);
+int v3_addr_inherits(IPAddrBlocks *addr);
+int v3_asid_subset(ASIdentifiers *a, ASIdentifiers *b);
+int v3_addr_subset(IPAddrBlocks *a, IPAddrBlocks *b);
+
+/*
+ * Check whether RFC 3779 extensions nest properly in chains.
+ */
+int v3_asid_validate_path(X509_STORE_CTX *);
+int v3_addr_validate_path(X509_STORE_CTX *);
+int v3_asid_validate_resource_set(STACK_OF(X509) *chain,
+ ASIdentifiers *ext, int allow_inheritance);
+int v3_addr_validate_resource_set(STACK_OF(X509) *chain,
+ IPAddrBlocks *ext, int allow_inheritance);
+
+# endif /* OPENSSL_NO_RFC3779 */
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_X509V3_strings(void);
+
+/* Error codes for the X509V3 functions. */
+
+/* Function codes. */
+# define X509V3_F_A2I_GENERAL_NAME 164
+# define X509V3_F_ASIDENTIFIERCHOICE_CANONIZE 161
+# define X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL 162
+# define X509V3_F_COPY_EMAIL 122
+# define X509V3_F_COPY_ISSUER 123
+# define X509V3_F_DO_DIRNAME 144
+# define X509V3_F_DO_EXT_CONF 124
+# define X509V3_F_DO_EXT_I2D 135
+# define X509V3_F_DO_EXT_NCONF 151
+# define X509V3_F_DO_I2V_NAME_CONSTRAINTS 148
+# define X509V3_F_GNAMES_FROM_SECTNAME 156
+# define X509V3_F_HEX_TO_STRING 111
+# define X509V3_F_I2S_ASN1_ENUMERATED 121
+# define X509V3_F_I2S_ASN1_IA5STRING 149
+# define X509V3_F_I2S_ASN1_INTEGER 120
+# define X509V3_F_I2V_AUTHORITY_INFO_ACCESS 138
+# define X509V3_F_NOTICE_SECTION 132
+# define X509V3_F_NREF_NOS 133
+# define X509V3_F_POLICY_SECTION 131
+# define X509V3_F_PROCESS_PCI_VALUE 150
+# define X509V3_F_R2I_CERTPOL 130
+# define X509V3_F_R2I_PCI 155
+# define X509V3_F_S2I_ASN1_IA5STRING 100
+# define X509V3_F_S2I_ASN1_INTEGER 108
+# define X509V3_F_S2I_ASN1_OCTET_STRING 112
+# define X509V3_F_S2I_ASN1_SKEY_ID 114
+# define X509V3_F_S2I_SKEY_ID 115
+# define X509V3_F_SET_DIST_POINT_NAME 158
+# define X509V3_F_STRING_TO_HEX 113
+# define X509V3_F_SXNET_ADD_ID_ASC 125
+# define X509V3_F_SXNET_ADD_ID_INTEGER 126
+# define X509V3_F_SXNET_ADD_ID_ULONG 127
+# define X509V3_F_SXNET_GET_ID_ASC 128
+# define X509V3_F_SXNET_GET_ID_ULONG 129
+# define X509V3_F_V2I_ASIDENTIFIERS 163
+# define X509V3_F_V2I_ASN1_BIT_STRING 101
+# define X509V3_F_V2I_AUTHORITY_INFO_ACCESS 139
+# define X509V3_F_V2I_AUTHORITY_KEYID 119
+# define X509V3_F_V2I_BASIC_CONSTRAINTS 102
+# define X509V3_F_V2I_CRLD 134
+# define X509V3_F_V2I_EXTENDED_KEY_USAGE 103
+# define X509V3_F_V2I_GENERAL_NAMES 118
+# define X509V3_F_V2I_GENERAL_NAME_EX 117
+# define X509V3_F_V2I_IDP 157
+# define X509V3_F_V2I_IPADDRBLOCKS 159
+# define X509V3_F_V2I_ISSUER_ALT 153
+# define X509V3_F_V2I_NAME_CONSTRAINTS 147
+# define X509V3_F_V2I_POLICY_CONSTRAINTS 146
+# define X509V3_F_V2I_POLICY_MAPPINGS 145
+# define X509V3_F_V2I_SUBJECT_ALT 154
+# define X509V3_F_V3_ADDR_VALIDATE_PATH_INTERNAL 160
+# define X509V3_F_V3_GENERIC_EXTENSION 116
+# define X509V3_F_X509V3_ADD1_I2D 140
+# define X509V3_F_X509V3_ADD_VALUE 105
+# define X509V3_F_X509V3_EXT_ADD 104
+# define X509V3_F_X509V3_EXT_ADD_ALIAS 106
+# define X509V3_F_X509V3_EXT_CONF 107
+# define X509V3_F_X509V3_EXT_FREE 165
+# define X509V3_F_X509V3_EXT_I2D 136
+# define X509V3_F_X509V3_EXT_NCONF 152
+# define X509V3_F_X509V3_GET_SECTION 142
+# define X509V3_F_X509V3_GET_STRING 143
+# define X509V3_F_X509V3_GET_VALUE_BOOL 110
+# define X509V3_F_X509V3_PARSE_LIST 109
+# define X509V3_F_X509_PURPOSE_ADD 137
+# define X509V3_F_X509_PURPOSE_SET 141
+
+/* Reason codes. */
+# define X509V3_R_BAD_IP_ADDRESS 118
+# define X509V3_R_BAD_OBJECT 119
+# define X509V3_R_BN_DEC2BN_ERROR 100
+# define X509V3_R_BN_TO_ASN1_INTEGER_ERROR 101
+# define X509V3_R_CANNOT_FIND_FREE_FUNCTION 168
+# define X509V3_R_DIRNAME_ERROR 149
+# define X509V3_R_DISTPOINT_ALREADY_SET 160
+# define X509V3_R_DUPLICATE_ZONE_ID 133
+# define X509V3_R_ERROR_CONVERTING_ZONE 131
+# define X509V3_R_ERROR_CREATING_EXTENSION 144
+# define X509V3_R_ERROR_IN_EXTENSION 128
+# define X509V3_R_EXPECTED_A_SECTION_NAME 137
+# define X509V3_R_EXTENSION_EXISTS 145
+# define X509V3_R_EXTENSION_NAME_ERROR 115
+# define X509V3_R_EXTENSION_NOT_FOUND 102
+# define X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED 103
+# define X509V3_R_EXTENSION_VALUE_ERROR 116
+# define X509V3_R_ILLEGAL_EMPTY_EXTENSION 151
+# define X509V3_R_ILLEGAL_HEX_DIGIT 113
+# define X509V3_R_INCORRECT_POLICY_SYNTAX_TAG 152
+# define X509V3_R_INVALID_ASNUMBER 162
+# define X509V3_R_INVALID_ASRANGE 163
+# define X509V3_R_INVALID_BOOLEAN_STRING 104
+# define X509V3_R_INVALID_EXTENSION_STRING 105
+# define X509V3_R_INVALID_INHERITANCE 165
+# define X509V3_R_INVALID_IPADDRESS 166
+# define X509V3_R_INVALID_MULTIPLE_RDNS 161
+# define X509V3_R_INVALID_NAME 106
+# define X509V3_R_INVALID_NULL_ARGUMENT 107
+# define X509V3_R_INVALID_NULL_NAME 108
+# define X509V3_R_INVALID_NULL_VALUE 109
+# define X509V3_R_INVALID_NUMBER 140
+# define X509V3_R_INVALID_NUMBERS 141
+# define X509V3_R_INVALID_OBJECT_IDENTIFIER 110
+# define X509V3_R_INVALID_OPTION 138
+# define X509V3_R_INVALID_POLICY_IDENTIFIER 134
+# define X509V3_R_INVALID_PROXY_POLICY_SETTING 153
+# define X509V3_R_INVALID_PURPOSE 146
+# define X509V3_R_INVALID_SAFI 164
+# define X509V3_R_INVALID_SECTION 135
+# define X509V3_R_INVALID_SYNTAX 143
+# define X509V3_R_ISSUER_DECODE_ERROR 126
+# define X509V3_R_MISSING_VALUE 124
+# define X509V3_R_NEED_ORGANIZATION_AND_NUMBERS 142
+# define X509V3_R_NO_CONFIG_DATABASE 136
+# define X509V3_R_NO_ISSUER_CERTIFICATE 121
+# define X509V3_R_NO_ISSUER_DETAILS 127
+# define X509V3_R_NO_POLICY_IDENTIFIER 139
+# define X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED 154
+# define X509V3_R_NO_PUBLIC_KEY 114
+# define X509V3_R_NO_SUBJECT_DETAILS 125
+# define X509V3_R_ODD_NUMBER_OF_DIGITS 112
+# define X509V3_R_OPERATION_NOT_DEFINED 148
+# define X509V3_R_OTHERNAME_ERROR 147
+# define X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED 155
+# define X509V3_R_POLICY_PATH_LENGTH 156
+# define X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED 157
+# define X509V3_R_POLICY_SYNTAX_NOT_CURRENTLY_SUPPORTED 158
+# define X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY 159
+# define X509V3_R_SECTION_NOT_FOUND 150
+# define X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS 122
+# define X509V3_R_UNABLE_TO_GET_ISSUER_KEYID 123
+# define X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT 111
+# define X509V3_R_UNKNOWN_EXTENSION 129
+# define X509V3_R_UNKNOWN_EXTENSION_NAME 130
+# define X509V3_R_UNKNOWN_OPTION 120
+# define X509V3_R_UNSUPPORTED_OPTION 117
+# define X509V3_R_UNSUPPORTED_TYPE 167
+# define X509V3_R_USER_TOO_LONG 132
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/protocols/Telegram/tgl/openssl/lib/libeay32.lib b/protocols/Telegram/tgl/openssl/lib/libeay32.lib
new file mode 100644
index 0000000000..a20d2a57eb
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/lib/libeay32.lib
Binary files differ
diff --git a/protocols/Telegram/tgl/openssl/lib/ssleay32.lib b/protocols/Telegram/tgl/openssl/lib/ssleay32.lib
new file mode 100644
index 0000000000..cc9077f0a7
--- /dev/null
+++ b/protocols/Telegram/tgl/openssl/lib/ssleay32.lib
Binary files differ
diff --git a/protocols/Telegram/tgl/queries-encrypted.c b/protocols/Telegram/tgl/queries-encrypted.c
new file mode 100644
index 0000000000..cdfea63029
--- /dev/null
+++ b/protocols/Telegram/tgl/queries-encrypted.c
@@ -0,0 +1,758 @@
+
+/* {{{ Encrypt decrypted */
+static int *encr_extra;
+static int *encr_ptr;
+static int *encr_end;
+
+static char *encrypt_decrypted_message (struct tgl_secret_chat *E) {
+ static int msg_key[4];
+ static unsigned char sha1a_buffer[20];
+ static unsigned char sha1b_buffer[20];
+ static unsigned char sha1c_buffer[20];
+ static unsigned char sha1d_buffer[20];
+ int x = *(encr_ptr);
+ assert (x >= 0 && !(x & 3));
+ sha1 ((void *)encr_ptr, 4 + x, sha1a_buffer);
+ memcpy (msg_key, sha1a_buffer + 4, 16);
+
+ static unsigned char buf[64];
+ memcpy (buf, msg_key, 16);
+ memcpy (buf + 16, E->key, 32);
+ sha1 (buf, 48, sha1a_buffer);
+
+ memcpy (buf, E->key + 8, 16);
+ memcpy (buf + 16, msg_key, 16);
+ memcpy (buf + 32, E->key + 12, 16);
+ sha1 (buf, 48, sha1b_buffer);
+
+ memcpy (buf, E->key + 16, 32);
+ memcpy (buf + 32, msg_key, 16);
+ sha1 (buf, 48, sha1c_buffer);
+
+ memcpy (buf, msg_key, 16);
+ memcpy (buf + 16, E->key + 24, 32);
+ sha1 (buf, 48, sha1d_buffer);
+
+ static unsigned char key[32];
+ memcpy (key, sha1a_buffer + 0, 8);
+ memcpy (key + 8, sha1b_buffer + 8, 12);
+ memcpy (key + 20, sha1c_buffer + 4, 12);
+
+ static unsigned char iv[32];
+ memcpy (iv, sha1a_buffer + 8, 12);
+ memcpy (iv + 12, sha1b_buffer + 0, 8);
+ memcpy (iv + 20, sha1c_buffer + 16, 4);
+ memcpy (iv + 24, sha1d_buffer + 0, 8);
+
+ AES_KEY aes_key;
+ AES_set_encrypt_key (key, 256, &aes_key);
+ AES_ige_encrypt ((void *)encr_ptr, (void *)encr_ptr, 4 * (encr_end - encr_ptr), &aes_key, iv, 1);
+ memset (&aes_key, 0, sizeof (aes_key));
+
+ return (void *)msg_key;
+}
+
+static void encr_start (void) {
+ encr_extra = packet_ptr;
+ packet_ptr += 1; // str len
+ packet_ptr += 2; // fingerprint
+ packet_ptr += 4; // msg_key
+ packet_ptr += 1; // len
+}
+
+
+static void encr_finish (struct tgl_secret_chat *E) {
+ int l = packet_ptr - (encr_extra + 8);
+ while (((packet_ptr - encr_extra) - 3) & 3) {
+ int t;
+ tglt_secure_random (&t, 4);
+ out_int (t);
+ }
+
+ *encr_extra = ((packet_ptr - encr_extra) - 1) * 4 * 256 + 0xfe;
+ encr_extra ++;
+ *(long long *)encr_extra = E->key_fingerprint;
+ encr_extra += 2;
+ encr_extra[4] = l * 4;
+ encr_ptr = encr_extra + 4;
+ encr_end = packet_ptr;
+ memcpy (encr_extra, encrypt_decrypted_message (E), 16);
+}
+/* }}} */
+
+void tgl_do_send_encr_action (struct tgl_state *TLS, struct tgl_secret_chat *E, struct tl_ds_decrypted_message_action *A) {
+ long long t;
+ tglt_secure_random (&t, 8);
+ int peer_id = tgl_get_peer_id (E->id);
+ int peer_type = TGL_PEER_ENCR_CHAT;
+ int date = time (0);
+
+ bl_do_create_message_encr_new (TLS, t, &TLS->our_id, &peer_type, &peer_id, &date, NULL, 0, NULL, A, NULL, TGLMF_PENDING | TGLMF_OUT | TGLMF_UNREAD | TGLMF_CREATE | TGLMF_CREATED | TGLMF_ENCRYPTED);
+
+ struct tgl_message *M = tgl_message_get (TLS, t);
+ assert (M);
+ tgl_do_send_msg (TLS, M, 0, 0);
+}
+
+void tgl_do_send_encr_chat_layer (struct tgl_state *TLS, struct tgl_secret_chat *E) {
+ static struct tl_ds_decrypted_message_action A;
+ A.magic = CODE_decrypted_message_action_notify_layer;
+ int layer = TGL_ENCRYPTED_LAYER;
+ A.layer = &layer;
+
+ tgl_do_send_encr_action (TLS, E, &A);
+}
+
+void tgl_do_set_encr_chat_ttl (struct tgl_state *TLS, struct tgl_secret_chat *E, int ttl, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra) {
+ static struct tl_ds_decrypted_message_action A;
+ A.magic = CODE_decrypted_message_action_set_message_t_t_l;
+ A.layer = &ttl;
+
+ tgl_do_send_encr_action (TLS, E, &A);
+}
+
+
+/* {{{ Seng msg (plain text, encrypted) */
+static int msg_send_encr_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tgl_message *M = q->extra;
+ assert (M->flags & TGLMF_ENCRYPTED);
+
+ if (M->flags & TGLMF_PENDING) {
+ bl_do_create_message_encr_new (TLS, M->id, NULL, NULL, NULL,
+ &M->date,
+ NULL, 0, NULL, NULL, NULL, M->flags ^ TGLMF_PENDING);
+
+ bl_do_msg_update (TLS, M->id);
+ }
+
+ if (q->callback) {
+ ((void (*)(struct tgl_state *TLS, void *, int, struct tgl_message *))q->callback) (TLS, q->callback_extra, 1, M);
+ }
+ return 0;
+}
+
+static int msg_send_encr_on_error (struct tgl_state *TLS, struct query *q, int error_code, int error_len, const char *error) {
+ struct tgl_message *M = q->extra;
+ tgl_peer_t *P = tgl_peer_get (TLS, M->to_id);
+ if (P && P->encr_chat.state != sc_deleted && error_code == 400) {
+ if (strncmp (error, "ENCRYPTION_DECLINED", 19) == 0) {
+ bl_do_encr_chat_delete (TLS, &P->encr_chat);
+ }
+ }
+ if (q->callback) {
+ ((void (*)(struct tgl_state *TLS, void *, int, struct tgl_message *))q->callback) (TLS, q->callback_extra, 0, M);
+ }
+ if (M) {
+ bl_do_message_delete (TLS, M);
+ }
+ return 0;
+}
+
+static struct query_methods msg_send_encr_methods = {
+ .on_answer = msg_send_encr_on_answer,
+ .on_error = msg_send_encr_on_error,
+ .type = TYPE_TO_PARAM(messages_sent_encrypted_message)
+};
+/* }}} */
+
+void tgl_do_send_encr_msg_action (struct tgl_state *TLS, struct tgl_message *M, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra) {
+ tgl_peer_t *P = tgl_peer_get (TLS, M->to_id);
+ if (!P || P->encr_chat.state != sc_ok) {
+ vlogprintf (E_WARNING, "Unknown encrypted chat\n");
+ if (callback) {
+ callback (TLS, callback_extra, 0, 0);
+ }
+ return;
+ }
+
+ assert (M->flags & TGLMF_ENCRYPTED);
+ clear_packet ();
+ out_int (CODE_messages_send_encrypted_service);
+ out_int (CODE_input_encrypted_chat);
+ out_int (tgl_get_peer_id (M->to_id));
+ out_long (P->encr_chat.access_hash);
+ out_long (M->id);
+ encr_start ();
+ out_int (CODE_decrypted_message_layer);
+ out_random (15 + 4 * (lrand48 () % 3));
+ out_int (TGL_ENCRYPTED_LAYER);
+ out_int (2 * P->encr_chat.in_seq_no + (P->encr_chat.admin_id != TLS->our_id));
+ out_int (2 * P->encr_chat.out_seq_no + (P->encr_chat.admin_id == TLS->our_id) - 2);
+ out_int (CODE_decrypted_message_service);
+ out_long (M->id);
+
+ switch (M->action.type) {
+ case tgl_message_action_notify_layer:
+ out_int (CODE_decrypted_message_action_notify_layer);
+ out_int (M->action.layer);
+ break;
+ case tgl_message_action_set_message_ttl:
+ out_int (CODE_decrypted_message_action_set_message_t_t_l);
+ out_int (M->action.ttl);
+ break;
+ case tgl_message_action_request_key:
+ out_int (CODE_decrypted_message_action_request_key);
+ out_long (M->action.exchange_id);
+ out_cstring ((void *)M->action.g_a, 256);
+ break;
+ case tgl_message_action_accept_key:
+ out_int (CODE_decrypted_message_action_accept_key);
+ out_long (M->action.exchange_id);
+ out_cstring ((void *)M->action.g_a, 256);
+ out_long (M->action.key_fingerprint);
+ break;
+ case tgl_message_action_commit_key:
+ out_int (CODE_decrypted_message_action_commit_key);
+ out_long (M->action.exchange_id);
+ out_long (M->action.key_fingerprint);
+ break;
+ case tgl_message_action_abort_key:
+ out_int (CODE_decrypted_message_action_abort_key);
+ out_long (M->action.exchange_id);
+ break;
+ case tgl_message_action_noop:
+ out_int (CODE_decrypted_message_action_noop);
+ break;
+ default:
+ assert (0);
+ }
+ encr_finish (&P->encr_chat);
+
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &msg_send_encr_methods, M, callback, callback_extra);
+}
+
+void tgl_do_send_encr_msg (struct tgl_state *TLS, struct tgl_message *M, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra) {
+ if (M->flags & TGLMF_SERVICE) {
+ tgl_do_send_encr_msg_action (TLS, M, callback, callback_extra);
+ return;
+ }
+ tgl_peer_t *P = tgl_peer_get (TLS, M->to_id);
+ if (!P || P->encr_chat.state != sc_ok) {
+ vlogprintf (E_WARNING, "Unknown encrypted chat\n");
+ if (callback) {
+ callback (TLS, callback_extra, 0, M);
+ }
+ return;
+ }
+
+ assert (M->flags & TGLMF_ENCRYPTED);
+
+ clear_packet ();
+ out_int (CODE_messages_send_encrypted);
+ out_int (CODE_input_encrypted_chat);
+ out_int (tgl_get_peer_id (M->to_id));
+ out_long (P->encr_chat.access_hash);
+ out_long (M->id);
+ encr_start ();
+ out_int (CODE_decrypted_message_layer);
+ out_random (15 + 4 * (lrand48 () % 3));
+ out_int (TGL_ENCRYPTED_LAYER);
+ out_int (2 * P->encr_chat.in_seq_no + (P->encr_chat.admin_id != TLS->our_id));
+ out_int (2 * P->encr_chat.out_seq_no + (P->encr_chat.admin_id == TLS->our_id) - 2);
+ out_int (CODE_decrypted_message);
+ out_long (M->id);
+ out_int (P->encr_chat.ttl);
+ out_cstring ((void *)M->message, M->message_len);
+ switch (M->media.type) {
+ case tgl_message_media_none:
+ out_int (CODE_decrypted_message_media_empty);
+ break;
+ case tgl_message_media_geo:
+ out_int (CODE_decrypted_message_media_geo_point);
+ out_double (M->media.geo.latitude);
+ out_double (M->media.geo.longitude);
+ break;
+ default:
+ assert (0);
+ }
+ encr_finish (&P->encr_chat);
+
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &msg_send_encr_methods, M, callback, callback_extra);
+}
+
+static int mark_read_encr_on_receive (struct tgl_state *TLS, struct query *q, void *D) {
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int))q->callback)(TLS, q->callback_extra, 1);
+ }
+ return 0;
+}
+
+static int mark_read_encr_on_error (struct tgl_state *TLS, struct query *q, int error_code, int error_len, const char *error) {
+ tgl_peer_t *P = q->extra;
+ if (P && P->encr_chat.state != sc_deleted && error_code == 400) {
+ if (strncmp (error, "ENCRYPTION_DECLINED", 19) == 0) {
+ bl_do_encr_chat_delete(TLS, &P->encr_chat);
+ }
+ }
+ return 0;
+}
+
+static struct query_methods mark_read_encr_methods = {
+ .on_answer = mark_read_encr_on_receive,
+ .on_error = mark_read_encr_on_error,
+ .type = TYPE_TO_PARAM(bool)
+};
+
+void tgl_do_messages_mark_read_encr (struct tgl_state *TLS, tgl_peer_id_t id, long long access_hash, int last_time, void (*callback)(struct tgl_state *TLS, void *callback_extra, int), void *callback_extra) {
+ clear_packet ();
+ out_int (CODE_messages_read_encrypted_history);
+ out_int (CODE_input_encrypted_chat);
+ out_int (tgl_get_peer_id (id));
+ out_long (access_hash);
+ out_int (last_time);
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &mark_read_encr_methods, tgl_peer_get (TLS, id), callback, callback_extra);
+}
+
+static int send_encr_file_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tl_ds_messages_sent_encrypted_message *DS_MSEM = D;
+ struct tgl_message *M = q->extra;
+
+ if (M->flags & TGLMF_PENDING) {
+ bl_do_create_message_encr_new (TLS, M->id, NULL, NULL, NULL, DS_MSEM->date,
+ NULL, 0, NULL, NULL, DS_MSEM->file, M->flags ^ TGLMF_PENDING);
+ bl_do_msg_update (TLS, M->id);
+ }
+
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int, struct tgl_message *))q->callback)(TLS, q->callback_extra, 1, M);
+ }
+ return 0;
+}
+
+static struct query_methods send_encr_file_methods = {
+ .on_answer = send_encr_file_on_answer,
+ .on_error = msg_send_encr_on_error,
+ .type = TYPE_TO_PARAM(messages_sent_encrypted_message)
+};
+
+static void send_file_encrypted_end (struct tgl_state *TLS, struct send_file *f, void *callback, void *callback_extra) {
+ out_int (CODE_messages_send_encrypted_file);
+ out_int (CODE_input_encrypted_chat);
+ out_int (tgl_get_peer_id (f->to_id));
+ tgl_peer_t *P = tgl_peer_get (TLS, f->to_id);
+ assert (P);
+ out_long (P->encr_chat.access_hash);
+ long long r;
+ tglt_secure_random (&r, 8);
+ out_long (r);
+ encr_start ();
+ out_int (CODE_decrypted_message_layer);
+ out_random (15 + 4 * (lrand48 () % 3));
+ out_int (TGL_ENCRYPTED_LAYER);
+ out_int (2 * P->encr_chat.in_seq_no + (P->encr_chat.admin_id != TLS->our_id));
+ out_int (2 * P->encr_chat.out_seq_no + (P->encr_chat.admin_id == TLS->our_id));
+ out_int (CODE_decrypted_message);
+ out_long (r);
+ out_int (P->encr_chat.ttl);
+ out_string ("");
+ int *save_ptr = packet_ptr;
+ if (f->flags == -1) {
+ out_int (CODE_decrypted_message_media_photo);
+ } else if ((f->flags & TGLDF_VIDEO)) {
+ out_int (CODE_decrypted_message_media_video);
+ } else if ((f->flags & TGLDF_AUDIO)) {
+ out_int (CODE_decrypted_message_media_audio);
+ } else {
+ out_int (CODE_decrypted_message_media_document);
+ }
+ if (f->flags == -1 || !(f->flags & TGLDF_AUDIO)) {
+ out_cstring ("", 0);
+ out_int (90);
+ out_int (90);
+ }
+
+ if (f->flags == -1) {
+ out_int (f->w);
+ out_int (f->h);
+ } else if (f->flags & TGLDF_VIDEO) {
+ out_int (f->duration);
+ out_string (tg_mime_by_filename (f->file_name));
+ out_int (f->w);
+ out_int (f->h);
+ } else if (f->flags & TGLDF_AUDIO) {
+ out_int (f->duration);
+ out_string (tg_mime_by_filename (f->file_name));
+ } else {
+ out_string ("");
+ out_string (tg_mime_by_filename (f->file_name));
+ // document
+ }
+
+ out_int (f->size);
+ out_cstring ((void *)f->key, 32);
+ out_cstring ((void *)f->init_iv, 32);
+
+ int *save_in_ptr = in_ptr;
+ int *save_in_end = in_end;
+
+ in_ptr = save_ptr;
+ in_end = packet_ptr;
+
+ assert (skip_type_any (TYPE_TO_PARAM(decrypted_message_media)) >= 0);
+ assert (in_ptr == in_end);
+
+ in_ptr = save_ptr;
+ in_end = packet_ptr;
+
+ struct tl_ds_decrypted_message_media *DS_DMM = fetch_ds_type_decrypted_message_media (TYPE_TO_PARAM (decrypted_message_media));
+ in_end = save_in_ptr;
+ in_ptr = save_in_end;
+
+
+ int peer_type = tgl_get_peer_type (f->to_id);
+ int peer_id = tgl_get_peer_id (f->to_id);
+ int date = time (NULL);
+
+
+ encr_finish (&P->encr_chat);
+ if (f->size < (16 << 20)) {
+ out_int (CODE_input_encrypted_file_uploaded);
+ } else {
+ out_int (CODE_input_encrypted_file_big_uploaded);
+ }
+ out_long (f->id);
+ out_int (f->part_num);
+ if (f->size < (16 << 20)) {
+ out_string ("");
+ }
+
+ unsigned char md5[16];
+ unsigned char str[64];
+ memcpy (str, f->key, 32);
+ memcpy (str + 32, f->init_iv, 32);
+ MD5 (str, 64, md5);
+ out_int ((*(int *)md5) ^ (*(int *)(md5 + 4)));
+
+ tfree_secure (f->iv, 32);
+
+ bl_do_create_message_encr_new (TLS, r, &TLS->our_id, &peer_type, &peer_id, &date, NULL, 0, DS_DMM, NULL, NULL, TGLMF_OUT | TGLMF_UNREAD | TGLMF_ENCRYPTED | TGLMF_CREATE | TGLMF_CREATED);
+
+ free_ds_type_decrypted_message_media (DS_DMM, TYPE_TO_PARAM (decrypted_message_media));
+ struct tgl_message *M = tgl_message_get (TLS, r);
+ assert (M);
+
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &send_encr_file_methods, M, callback, callback_extra);
+
+ tfree_str (f->file_name);
+ tfree (f, sizeof (*f));
+
+}
+
+void tgl_do_send_location_encr (struct tgl_state *TLS, tgl_peer_id_t id, double latitude, double longitude, unsigned long long flags, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra) {
+ struct tl_ds_decrypted_message_media TDSM;
+ TDSM.magic = CODE_decrypted_message_media_geo_point;
+ TDSM.latitude = talloc (sizeof (double));
+ *TDSM.latitude = latitude;
+ TDSM.longitude = talloc (sizeof (double));
+ *TDSM.longitude = longitude;
+
+ int peer_type = tgl_get_peer_type (id);
+ int peer_id = tgl_get_peer_id (id);
+ int date = time (0);
+
+ long long t;
+ tglt_secure_random (&t, 8);
+
+ bl_do_create_message_encr_new (TLS, t, &TLS->our_id, &peer_type, &peer_id, &date, NULL, 0, &TDSM, NULL, NULL, TGLMF_UNREAD | TGLMF_OUT | TGLMF_PENDING | TGLMF_CREATE | TGLMF_CREATED | TGLMF_ENCRYPTED);
+
+ tfree (TDSM.latitude, sizeof (double));
+ tfree (TDSM.longitude, sizeof (double));
+
+ struct tgl_message *M = tgl_message_get (TLS, t);
+
+ tgl_do_send_encr_msg (TLS, M, callback, callback_extra);
+}
+
+/* {{{ Encr accept */
+static int send_encr_accept_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tgl_secret_chat *E = tglf_fetch_alloc_encrypted_chat_new (TLS, D);
+
+ if (E->state == sc_ok) {
+ tgl_do_send_encr_chat_layer (TLS, E);
+ }
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int, struct tgl_secret_chat *))q->callback) (TLS, q->callback_extra, E->state == sc_ok, E);
+ }
+ return 0;
+}
+
+static int send_encr_request_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tgl_secret_chat *E = tglf_fetch_alloc_encrypted_chat_new (TLS, D);
+
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int, struct tgl_secret_chat *))q->callback) (TLS, q->callback_extra, E->state != sc_deleted, E);
+ }
+ return 0;
+}
+
+static int encr_accept_on_error (struct tgl_state *TLS, struct query *q, int error_code, int error_len, const char *error) {
+ tgl_peer_t *P = q->extra;
+ if (P && P->encr_chat.state != sc_deleted && error_code == 400) {
+ if (strncmp (error, "ENCRYPTION_DECLINED", 19) == 0) {
+ bl_do_encr_chat_delete(TLS, &P->encr_chat);
+ }
+ }
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int, struct tgl_secret_chat *))q->callback) (TLS, q->callback_extra, 0, NULL);
+ }
+ return 0;
+}
+
+static struct query_methods send_encr_accept_methods = {
+ .on_answer = send_encr_accept_on_answer,
+ .on_error = encr_accept_on_error,
+ .type = TYPE_TO_PARAM(encrypted_chat)
+};
+
+static struct query_methods send_encr_request_methods = {
+ .on_answer = send_encr_request_on_answer,
+ .on_error = q_ptr_on_error,
+ .type = TYPE_TO_PARAM(encrypted_chat)
+};
+
+//int encr_root;
+//unsigned char *encr_prime;
+//int encr_param_version;
+//static BN_CTX *ctx;
+
+void tgl_do_send_accept_encr_chat (struct tgl_state *TLS, struct tgl_secret_chat *E, unsigned char *random, void (*callback)(struct tgl_state *TLS,void *callback_extra, int success, struct tgl_secret_chat *E), void *callback_extra) {
+ int i;
+ int ok = 0;
+ for (i = 0; i < 64; i++) {
+ if (E->key[i]) {
+ ok = 1;
+ break;
+ }
+ }
+ if (ok) {
+ if (callback) {
+ callback (TLS, callback_extra, 1, E);
+ }
+ return;
+ } // Already generated key for this chat
+ assert (E->g_key);
+ assert (TLS->BN_ctx);
+ unsigned char random_here[256];
+ tglt_secure_random (random_here, 256);
+ for (i = 0; i < 256; i++) {
+ random[i] ^= random_here[i];
+ }
+ BIGNUM *b = BN_bin2bn (random, 256, 0);
+ ensure_ptr (b);
+ BIGNUM *g_a = BN_bin2bn (E->g_key, 256, 0);
+ ensure_ptr (g_a);
+ assert (tglmp_check_g_a (TLS, TLS->encr_prime_bn, g_a) >= 0);
+ //if (!ctx) {
+ // ctx = BN_CTX_new ();
+ // ensure_ptr (ctx);
+ //}
+ BIGNUM *p = TLS->encr_prime_bn;
+ BIGNUM *r = BN_new ();
+ ensure_ptr (r);
+ ensure (BN_mod_exp (r, g_a, b, p, TLS->BN_ctx));
+ static unsigned char kk[256];
+ memset (kk, 0, sizeof (kk));
+ BN_bn2bin (r, kk + (256 - BN_num_bytes (r)));
+ static unsigned char sha_buffer[20];
+ sha1 (kk, 256, sha_buffer);
+
+ long long fingerprint = *(long long *)(sha_buffer + 12);
+
+ //bl_do_encr_chat_set_key (TLS, E, kk, *(long long *)(sha_buffer + 12));
+ //bl_do_encr_chat_set_sha (TLS, E, sha_buffer);
+
+ int state = sc_ok;
+
+ bl_do_encr_chat_new (TLS, tgl_get_peer_id (E->id),
+ NULL, NULL, NULL, NULL,
+ kk, NULL, sha_buffer, &state,
+ NULL, NULL, NULL, NULL, NULL,
+ &fingerprint,
+ TGL_FLAGS_UNCHANGED
+ );
+
+ clear_packet ();
+ out_int (CODE_messages_accept_encryption);
+ out_int (CODE_input_encrypted_chat);
+ out_int (tgl_get_peer_id (E->id));
+ out_long (E->access_hash);
+
+ ensure (BN_set_word (g_a, TLS->encr_root));
+ ensure (BN_mod_exp (r, g_a, b, p, TLS->BN_ctx));
+ static unsigned char buf[256];
+ memset (buf, 0, sizeof (buf));
+ BN_bn2bin (r, buf + (256 - BN_num_bytes (r)));
+ out_cstring ((void *)buf, 256);
+
+ out_long (E->key_fingerprint);
+ BN_clear_free (b);
+ BN_clear_free (g_a);
+ BN_clear_free (r);
+
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &send_encr_accept_methods, E, callback, callback_extra);
+}
+
+void tgl_do_create_keys_end (struct tgl_state *TLS, struct tgl_secret_chat *U) {
+ assert (TLS->encr_prime);
+ BIGNUM *g_b = BN_bin2bn (U->g_key, 256, 0);
+ ensure_ptr (g_b);
+ assert (tglmp_check_g_a (TLS, TLS->encr_prime_bn, g_b) >= 0);
+
+ BIGNUM *p = TLS->encr_prime_bn;
+ ensure_ptr (p);
+ BIGNUM *r = BN_new ();
+ ensure_ptr (r);
+ BIGNUM *a = BN_bin2bn ((void *)U->key, 256, 0);
+ ensure_ptr (a);
+ ensure (BN_mod_exp (r, g_b, a, p, TLS->BN_ctx));
+
+ unsigned char *t = talloc (256);
+ memcpy (t, U->key, 256);
+
+ memset (U->key, 0, sizeof (U->key));
+ BN_bn2bin (r, (void *)(((char *)(U->key)) + (256 - BN_num_bytes (r))));
+
+ static unsigned char sha_buffer[20];
+ sha1 ((void *)U->key, 256, sha_buffer);
+ long long k = *(long long *)(sha_buffer + 12);
+ if (k != U->key_fingerprint) {
+ vlogprintf (E_WARNING, "Key fingerprint mismatch (my 0x%llx 0x%llx)\n", (unsigned long long)k, (unsigned long long)U->key_fingerprint);
+ U->state = sc_deleted;
+ }
+
+ memcpy (U->first_key_sha, sha_buffer, 20);
+ tfree_secure (t, 256);
+
+ BN_clear_free (g_b);
+ BN_clear_free (r);
+ BN_clear_free (a);
+}
+
+void tgl_do_send_create_encr_chat (struct tgl_state *TLS, void *x, unsigned char *random, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_secret_chat *E), void *callback_extra) {
+ int user_id = (long)x;
+ int i;
+ unsigned char random_here[256];
+ tglt_secure_random (random_here, 256);
+ for (i = 0; i < 256; i++) {
+ random[i] ^= random_here[i];
+ }
+ BIGNUM *a = BN_bin2bn (random, 256, 0);
+ ensure_ptr (a);
+ BIGNUM *p = BN_bin2bn (TLS->encr_prime, 256, 0);
+ ensure_ptr (p);
+
+ BIGNUM *g = BN_new ();
+ ensure_ptr (g);
+
+ ensure (BN_set_word (g, TLS->encr_root));
+
+ BIGNUM *r = BN_new ();
+ ensure_ptr (r);
+
+ ensure (BN_mod_exp (r, g, a, p, TLS->BN_ctx));
+
+ BN_clear_free (a);
+
+ static char g_a[256];
+ memset (g_a, 0, 256);
+
+ BN_bn2bin (r, (void *)(g_a + (256 - BN_num_bytes (r))));
+
+ int t = lrand48 ();
+ while (tgl_peer_get (TLS, TGL_MK_ENCR_CHAT (t))) {
+ t = lrand48 ();
+ }
+
+ //bl_do_encr_chat_init (TLS, t, user_id, (void *)random, (void *)g_a);
+
+ int state = sc_waiting;
+ bl_do_encr_chat_new (TLS, t, NULL, NULL, &TLS->our_id, &user_id, random, NULL, NULL, &state, NULL, NULL, NULL, NULL, NULL, NULL, TGLPF_CREATE | TGLPF_CREATED);
+
+
+ tgl_peer_t *_E = tgl_peer_get (TLS, TGL_MK_ENCR_CHAT (t));
+ assert (_E);
+ struct tgl_secret_chat *E = &_E->encr_chat;
+
+ clear_packet ();
+ out_int (CODE_messages_request_encryption);
+ tgl_peer_t *U = tgl_peer_get (TLS, TGL_MK_USER (E->user_id));
+ assert (U);
+ if (U && U->user.access_hash) {
+ out_int (CODE_input_user_foreign);
+ out_int (E->user_id);
+ out_long (U->user.access_hash);
+ } else {
+ out_int (CODE_input_user_contact);
+ out_int (E->user_id);
+ }
+ out_int (tgl_get_peer_id (E->id));
+ out_cstring (g_a, 256);
+ //write_secret_chat_file ();
+
+ BN_clear_free (g);
+ BN_clear_free (p);
+ BN_clear_free (r);
+
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &send_encr_request_methods, E, callback, callback_extra);
+}
+
+static int get_dh_config_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tl_ds_messages_dh_config *DS_MDC = D;
+
+ if (DS_MDC->magic == CODE_messages_dh_config) {
+ assert (DS_MDC->p->len == 256);
+ bl_do_set_dh_params (TLS, DS_LVAL (DS_MDC->g), (void *)DS_MDC->p->data, DS_LVAL (DS_MDC->version));
+ } else {
+ assert (TLS->encr_param_version);
+ }
+ unsigned char *random = talloc (256);
+ assert (DS_MDC->random->len == 256);
+ memcpy (random, DS_MDC->random->data, 256);
+
+ if (q->extra) {
+ void **x = q->extra;
+ ((void (*)(struct tgl_state *, void *, void *, void *, void *))(*x))(TLS, x[1], random, q->callback, q->callback_extra);
+ tfree (x, 2 * sizeof (void *));
+ tfree_secure (random, 256);
+ } else {
+ tfree_secure (random, 256);
+ }
+ return 0;
+}
+
+static struct query_methods get_dh_config_methods = {
+ .on_answer = get_dh_config_on_answer,
+ .on_error = q_void_on_error,
+ .type = TYPE_TO_PARAM(messages_dh_config)
+};
+
+void tgl_do_accept_encr_chat_request (struct tgl_state *TLS, struct tgl_secret_chat *E, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_secret_chat *E), void *callback_extra) {
+ if (E->state != sc_request) {
+ if (callback) {
+ callback (TLS, callback_extra, 0, E);
+ }
+ return;
+ }
+ assert (E->state == sc_request);
+
+ clear_packet ();
+ out_int (CODE_messages_get_dh_config);
+ out_int (TLS->encr_param_version);
+ out_int (256);
+ void **x = talloc (2 * sizeof (void *));
+ x[0] = tgl_do_send_accept_encr_chat;
+ x[1] = E;
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &get_dh_config_methods, x, callback, callback_extra);
+}
+
+void tgl_do_create_encr_chat_request (struct tgl_state *TLS, int user_id, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_secret_chat *E), void *callback_extra) {
+ clear_packet ();
+ out_int (CODE_messages_get_dh_config);
+ out_int (TLS->encr_param_version);
+ out_int (256);
+ void **x = talloc (2 * sizeof (void *));
+ x[0] = tgl_do_send_create_encr_chat;
+ x[1] = (void *)(long)(user_id);
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &get_dh_config_methods, x, callback, callback_extra);
+}
+/* }}} */
diff --git a/protocols/Telegram/tgl/queries.c b/protocols/Telegram/tgl/queries.c
new file mode 100644
index 0000000000..4e0c4cc535
--- /dev/null
+++ b/protocols/Telegram/tgl/queries.c
@@ -0,0 +1,4477 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Vitaly Valtman 2013-2015
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#define _FILE_OFFSET_BITS 64
+#include <string.h>
+#include <memory.h>
+#include <stdlib.h>
+#if defined(WIN32) || defined(_WIN32)
+#include <io.h>
+#include <stdint.h>
+#include <string.h>
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#else
+#include <unistd.h>
+#include <sys/utsname.h>
+#endif
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+
+#include "mtproto-client.h"
+#include "queries.h"
+#include "tree.h"
+#include "mtproto-common.h"
+//#include "telegram.h"
+#include "tgl-structures.h"
+//#include "interface.h"
+//#include "net.h"
+#include <openssl/bn.h>
+#include <openssl/rand.h>
+#include <openssl/aes.h>
+#include <openssl/sha.h>
+#include <openssl/md5.h>
+
+#include "no-preview.h"
+#include "tgl-binlog.h"
+#include "updates.h"
+#include "auto.h"
+#include "auto/auto-types.h"
+#include "auto/auto-skip.h"
+#include "auto/auto-free-ds.h"
+#include "auto/auto-fetch-ds.h"
+#include "auto/auto-print-ds.h"
+#include "tgl.h"
+#include "tg-mime-types.h"
+#include "mtproto-utils.h"
+#include "tgl-methods-in.h"
+
+#define sha1 SHA1
+
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
+
+static void out_peer_id (struct tgl_state *TLS, tgl_peer_id_t id);
+static struct query_methods send_msgs_methods;
+
+struct messages_send_extra {
+ int multi;
+ long long id;
+ int count;
+ long long *list;
+};
+#define QUERY_TIMEOUT 6.0
+
+struct send_file {
+ int fd;
+ long long size;
+ long long offset;
+ int part_num;
+ int part_size;
+ long long id;
+ long long thumb_id;
+ tgl_peer_id_t to_id;
+ int flags;
+ char *file_name;
+ int encr;
+ int avatar;
+ int reply;
+ unsigned char *iv;
+ unsigned char *init_iv;
+ unsigned char *key;
+ int w;
+ int h;
+ int duration;
+ char *caption;
+};
+
+#define memcmp8(a,b) memcmp ((a), (b), 8)
+DEFINE_TREE (query, struct query *, memcmp8, 0) ;
+
+static int mystreq1 (const char *a, const char *b, int l) {
+ if ((int)strlen (a) != l) { return 1; }
+ return memcmp (a, b, l);
+}
+
+/* {{{ COMMON */
+
+struct query *tglq_query_get (struct tgl_state *TLS, long long id) {
+ return tree_lookup_query (TLS->queries_tree, (void *)&id);
+}
+
+static int alarm_query (struct tgl_state *TLS, struct query *q) {
+ assert (q);
+ vlogprintf (E_DEBUG - 2, "Alarm query %"_PRINTF_INT64_"d\n", q->msg_id);
+
+ TLS->timer_methods->insert (q->ev, QUERY_TIMEOUT);
+
+ if (q->session && q->session_id && q->DC && q->DC->sessions[0] == q->session && q->session->session_id == q->session_id) {
+ clear_packet ();
+ out_int (CODE_msg_container);
+ out_int (1);
+ out_long (q->msg_id);
+ out_int (q->seq_no);
+ out_int (4 * q->data_len);
+ out_ints (q->data, q->data_len);
+
+ tglmp_encrypt_send_message (TLS, q->session->c, packet_buffer, packet_ptr - packet_buffer, q->flags & QUERY_FORCE_SEND);
+ } else {
+ q->flags &= ~QUERY_ACK_RECEIVED;
+ if (tree_lookup_query (TLS->queries_tree, q)) {
+ TLS->queries_tree = tree_delete_query (TLS->queries_tree, q);
+ }
+ q->session = q->DC->sessions[0];
+ q->msg_id = tglmp_encrypt_send_message (TLS, q->session->c, q->data, q->data_len, (q->flags & QUERY_FORCE_SEND) | 1);
+ TLS->queries_tree = tree_insert_query (TLS->queries_tree, q, lrand48 ());
+ q->session_id = q->session->session_id;
+ if (!(q->session->dc->flags & 4) && !(q->flags & QUERY_FORCE_SEND)) {
+ q->session_id = 0;
+ }
+ }
+ return 0;
+}
+
+void tglq_regen_query (struct tgl_state *TLS, long long id) {
+ struct query *q = tglq_query_get (TLS, id);
+ if (!q) { return; }
+ q->flags &= ~QUERY_ACK_RECEIVED;
+
+ if (!(q->session && q->session_id && q->DC && q->DC->sessions[0] == q->session && q->session->session_id == q->session_id)) {
+ q->session_id = 0;
+ } else {
+ if (!(q->session->dc->flags & 4) && !(q->flags & QUERY_FORCE_SEND)) {
+ q->session_id = 0;
+ }
+ }
+ vlogprintf (E_NOTICE, "regen query %"_PRINTF_INT64_"d\n", id);
+ TLS->timer_methods->insert (q->ev, 0.001);
+}
+
+void tglq_query_restart (struct tgl_state *TLS, long long id) {
+ struct query *q = tglq_query_get (TLS, id);
+ if (q) {
+ vlogprintf (E_NOTICE, "restarting query %"_PRINTF_INT64_"d\n", id);
+ TLS->timer_methods->remove (q->ev);
+ alarm_query (TLS, q);
+ }
+}
+
+static void alarm_query_gateway (struct tgl_state *TLS, void *arg) {
+ alarm_query (TLS, arg);
+}
+
+
+struct query *tglq_send_query_ex (struct tgl_state *TLS, struct tgl_dc *DC, int ints, void *data, struct query_methods *methods, void *extra, void *callback, void *callback_extra, int flags) {
+ assert (DC);
+ assert (DC->auth_key_id);
+ if (!DC->sessions[0]) {
+ tglmp_dc_create_session (TLS, DC);
+ }
+ vlogprintf (E_DEBUG, "Sending query of size %d to DC %d\n", 4 * ints, DC->id);
+ struct query *q = talloc0 (sizeof (*q));
+ q->data_len = ints;
+ q->data = talloc (4 * ints);
+ memcpy (q->data, data, 4 * ints);
+ q->msg_id = tglmp_encrypt_send_message (TLS, DC->sessions[0]->c, data, ints, 1 | (flags & QUERY_FORCE_SEND));
+ q->session = DC->sessions[0];
+ q->seq_no = q->session->seq_no - 1;
+ q->session_id = q->session->session_id;
+ if (!(DC->flags & 4) && !(flags & QUERY_FORCE_SEND)) {
+ q->session_id = 0;
+ }
+ vlogprintf (E_DEBUG, "Msg_id is %"_PRINTF_INT64_"d %p\n", q->msg_id, q);
+ q->methods = methods;
+ q->type = methods->type;
+ q->DC = DC;
+ q->flags = flags & QUERY_FORCE_SEND;
+ if (TLS->queries_tree) {
+ vlogprintf (E_DEBUG + 2, "%"_PRINTF_INT64_"d %"_PRINTF_INT64_"d\n", q->msg_id, TLS->queries_tree->x->msg_id);
+ }
+ TLS->queries_tree = tree_insert_query (TLS->queries_tree, q, lrand48 ());
+
+ q->ev = TLS->timer_methods->alloc (TLS, alarm_query_gateway, q);
+ TLS->timer_methods->insert (q->ev, QUERY_TIMEOUT);
+
+ q->extra = extra;
+ q->callback = callback;
+ q->callback_extra = callback_extra;
+ TLS->active_queries ++;
+ return q;
+}
+
+struct query *tglq_send_query (struct tgl_state *TLS, struct tgl_dc *DC, int ints, void *data, struct query_methods *methods, void *extra, void *callback, void *callback_extra) {
+ return tglq_send_query_ex (TLS, DC, ints, data, methods, extra, callback, callback_extra, 0);
+}
+
+static int fail_on_error (struct tgl_state *TLS, struct query *q, int error_code, int l, const char *error) {
+ fprintf (stderr, "error #%d: %.*s\n", error_code, l, error);
+ assert (0);
+ return 0;
+}
+
+void tglq_query_ack (struct tgl_state *TLS, long long id) {
+ struct query *q = tglq_query_get (TLS, id);
+ if (q && !(q->flags & QUERY_ACK_RECEIVED)) {
+ assert (q->msg_id == id);
+ q->flags |= QUERY_ACK_RECEIVED;
+ TLS->timer_methods->remove (q->ev);
+ }
+}
+
+void tglq_query_delete (struct tgl_state *TLS, long long id) {
+ struct query *q = tglq_query_get (TLS, id);
+ if (!q) {
+ return;
+ }
+ if (!(q->flags & QUERY_ACK_RECEIVED)) {
+ TLS->timer_methods->remove (q->ev);
+ }
+ TLS->queries_tree = tree_delete_query (TLS->queries_tree, q);
+ tfree (q->data, q->data_len * 4);
+ TLS->timer_methods->free (q->ev);
+ TLS->active_queries --;
+}
+
+static void resend_query_cb (struct tgl_state *TLS, void *_q, int success);
+
+void tglq_free_query (struct query *q, void *extra) {
+ struct tgl_state *TLS = extra;
+ if (!(q->flags & QUERY_ACK_RECEIVED)) {
+ TLS->timer_methods->remove (q->ev);
+ }
+ tfree (q->data, q->data_len * 4);
+ TLS->timer_methods->free (q->ev);
+}
+
+void tglq_query_free_all (struct tgl_state *TLS) {
+ tree_act_ex_query (TLS->queries_tree, tglq_free_query, TLS);
+ TLS->queries_tree = tree_clear_query (TLS->queries_tree);
+}
+
+int tglq_query_error (struct tgl_state *TLS, long long id) {
+ assert (fetch_int () == CODE_rpc_error);
+ int error_code = fetch_int ();
+ int error_len = prefetch_strlen ();
+ char *error = fetch_str (error_len);
+ struct query *q = tglq_query_get (TLS, id);
+ if (!q) {
+ vlogprintf (E_WARNING, "error for query #%"_PRINTF_INT64_"d: #%d :%.*s\n", id, error_code, error_len, error);
+ vlogprintf (E_WARNING, "No such query\n");
+ } else {
+ if (!(q->flags & QUERY_ACK_RECEIVED)) {
+ TLS->timer_methods->remove (q->ev);
+ }
+ TLS->queries_tree = tree_delete_query (TLS->queries_tree, q);
+ int res = 0;
+
+ int error_handled = 0;
+
+ switch (error_code) {
+ case 303:
+ // migrate
+ {
+ int offset = -1;
+ if (error_len >= 15 && !memcmp (error, "PHONE_MIGRATE_", 14)) {
+ offset = 14;
+ }
+ if (error_len >= 17 && !memcmp (error, "NETWORK_MIGRATE_", 16)) {
+ offset = 16;
+ }
+ if (error_len >= 14 && !memcmp (error, "USER_MIGRATE_", 13)) {
+ offset = 13;
+ }
+ if (offset >= 0) {
+ int i = 0;
+ while (offset < error_len && error[offset] >= '0' && error[offset] <= '9') {
+ i = i * 10 + error[offset] - '0';
+ offset ++;
+ }
+ if (i > 0 && i < TGL_MAX_DC_NUM) {
+ bl_do_set_working_dc (TLS, i);
+ q->flags &= ~QUERY_ACK_RECEIVED;
+ //q->session_id = 0;
+ //struct tgl_dc *DC = q->DC;
+ //if (!(DC->flags & 4) && !(q->flags & QUERY_FORCE_SEND)) {
+ q->session_id = 0;
+ //}
+ q->DC = TLS->DC_working;
+ TLS->timer_methods->insert (q->ev, 0);
+ error_handled = 1;
+ res = 1;
+ }
+ }
+ }
+ break;
+ case 400:
+ // nothing to handle
+ // bad user input probably
+ break;
+ case 401:
+ if (!mystreq1 ("SESSION_PASSWORD_NEEDED", error, error_len)) {
+ if (!(TLS->locks & TGL_LOCK_PASSWORD)) {
+ TLS->locks |= TGL_LOCK_PASSWORD;
+ tgl_do_check_password (TLS, resend_query_cb, q);
+ }
+ res = 1;
+ error_handled = 1;
+ }
+ break;
+ case 403:
+ // privacy violation
+ break;
+ case 404:
+ // not found
+ break;
+ case 420:
+ // flood
+ case 500:
+ // internal error
+ default:
+ // anything else. Treated as internal error
+ {
+ int wait;
+ if (strncmp (error, "FLOOD_WAIT_", 11)) {
+ if (error_code == 420) {
+ vlogprintf (E_ERROR, "error = '%s'\n", error);
+ }
+ wait = 10;
+ } else {
+ wait = (int)atoll (error + 11);
+ }
+ q->flags &= ~QUERY_ACK_RECEIVED;
+ TLS->timer_methods->insert (q->ev, wait);
+ struct tgl_dc *DC = q->DC;
+ if (!(DC->flags & 4) && !(q->flags & QUERY_FORCE_SEND)) {
+ q->session_id = 0;
+ }
+ error_handled = 1;
+ }
+ break;
+ }
+
+ if (error_handled) {
+ vlogprintf (E_DEBUG - 2, "error for query #%"_PRINTF_INT64_"d: #%d %.*s (HANDLED)\n", id, error_code, error_len, error);
+ } else {
+ vlogprintf (E_WARNING, "error for query #%"_PRINTF_INT64_"d: #%d %.*s\n", id, error_code, error_len, error);
+ if (q->methods && q->methods->on_error) {
+ res = q->methods->on_error (TLS, q, error_code, error_len, error);
+ }
+ }
+
+ if (res <= 0) {
+ tfree (q->data, q->data_len * 4);
+ TLS->timer_methods->free (q->ev);
+ }
+
+ if (res == -11) {
+ TLS->active_queries --;
+ return -1;
+
+ }
+ }
+ TLS->active_queries --;
+ return 0;
+}
+
+#define MAX_PACKED_SIZE (1 << 24)
+static int packed_buffer[MAX_PACKED_SIZE / 4];
+
+int tglq_query_result (struct tgl_state *TLS, long long id) {
+ vlogprintf (E_DEBUG, "result for query #%"_PRINTF_INT64_"d. Size %ld bytes\n", id, (long)4 * (in_end - in_ptr));
+ int op = prefetch_int ();
+ int *end = 0;
+ int *eend = 0;
+ if (op == CODE_gzip_packed) {
+ fetch_int ();
+ int l = prefetch_strlen ();
+ char *s = fetch_str (l);
+ int total_out = tgl_inflate (s, l, packed_buffer, MAX_PACKED_SIZE);
+ vlogprintf (E_DEBUG, "inflated %d bytes\n", total_out);
+ end = in_ptr;
+ eend = in_end;
+ in_ptr = packed_buffer;
+ in_end = in_ptr + total_out / 4;
+ }
+ struct query *q = tglq_query_get (TLS, id);
+ if (!q) {
+ vlogprintf (E_WARNING, "No such query\n");
+ in_ptr = in_end;
+ } else {
+ if (!(q->flags & QUERY_ACK_RECEIVED)) {
+ TLS->timer_methods->remove (q->ev);
+ }
+ TLS->queries_tree = tree_delete_query (TLS->queries_tree, q);
+ if (q->methods && q->methods->on_answer) {
+ assert (q->type);
+ int *save = in_ptr;
+ vlogprintf (E_DEBUG, "in_ptr = %p, end_ptr = %p\n", in_ptr, in_end);
+ if (skip_type_any (q->type) < 0) {
+ vlogprintf (E_ERROR, "Skipped %ld int out of %ld (type %s)\n", (long)(in_ptr - save), (long)(in_end - save), q->type->type->id);
+ vlogprintf (E_ERROR, "0x%08x 0x%08x\n", *(in_ptr - 1), *in_ptr);
+ assert (0);
+ }
+
+ assert (in_ptr == in_end);
+ in_ptr = save;
+
+ void *DS = fetch_ds_type_any (q->type);
+ assert (DS);
+
+ q->methods->on_answer (TLS, q, DS);
+ free_ds_type_any (DS, q->type);
+
+ assert (in_ptr == in_end);
+ }
+ tfree (q->data, 4 * q->data_len);
+ TLS->timer_methods->free (q->ev);
+ tfree (q, sizeof (*q));
+
+ }
+ if (end) {
+ in_ptr = end;
+ in_end = eend;
+ }
+ TLS->active_queries --;
+ return 0;
+}
+
+static void out_random (int n) {
+ assert (n <= 32);
+ static char buf[32];
+ tglt_secure_random (buf, n);
+ out_cstring (buf, n);
+}
+
+int allow_send_os_version;
+void tgl_do_insert_header (struct tgl_state *TLS) {
+ out_int (CODE_invoke_with_layer);
+ out_int (TGL_SCHEME_LAYER);
+ out_int (CODE_init_connection);
+ out_int (TLS->app_id);
+ if (allow_send_os_version) {
+ static char buf[4096];
+#if defined(WIN32) || defined(_WIN32)
+ SYSTEM_INFO sysInfo;
+ char release[256] = { 0 };
+ char version[256] = { 0 };
+ OSVERSIONINFO versionInfo = { sizeof(OSVERSIONINFO), 0, 0, 0, 0,{ '\0' } };
+ char* szSystemName = "Windows";
+#if (WINVER <= _WIN32_WINNT_WIN7)
+ GetVersionEx(&versionInfo);
+#else
+ // GetModuleHandle is not supported in WinRT and linking to it at load time
+ #if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP || WINAPI_FAMILY==WINAPI_FAMILY_APP
+ szSystemName = "Windows RT"
+ MEMORY_BASIC_INFORMATION mbi = { 0, 0, 0, 0, 0, 0, 0 };
+ VirtualQuery((LPCVOID)VirtualQuery, &mbi, sizeof(mbi);
+ HMODULE kernelModule = (HMODULE)mbi.AllocationBase;
+
+ typedef HMODULE(WINAPI *GetModuleHandleFunction)(LPCWSTR);
+ GetModuleHandleFunction pGetModuleHandle = (GetModuleHandleFunction) GetProcAddressA (kernelModule, "GetModuleHandleW");
+ #else
+ #define pGetModuleHandle GetModuleHandleW
+ #endif
+
+ #if !defined(WINCE) || !defined(_WIN32_WCE)
+ #define GetProcAddressA GetProcAddress
+ #endif
+
+ HMODULE ntdll = pGetModuleHandle (L"ntdll.dll");
+ typedef LONG NTSTATUS;
+ typedef NTSTATUS(NTAPI *RtlGetVersionFunction)(LPOSVERSIONINFO);
+
+ RtlGetVersionFunction pRtlGetVersion = (RtlGetVersionFunction) GetProcAddressA (ntdll, "RtlGetVersion");
+ if(pRtlGetVersion)
+ pRtlGetVersion(&versionInfo); // always returns STATUS_SUCCESS
+#endif
+ if(versionInfo.dwBuildNumber > 0)
+ _itoa_s(versionInfo.dwBuildNumber, release, sizeof(char) * 256, 10);
+ if (versionInfo.dwMajorVersion > 0)
+ sprintf_s(version, sizeof(char) * 256, "%i.%i", versionInfo.dwMajorVersion, versionInfo.dwMinorVersion);
+ else
+ strcpy_s(version, sizeof(char) * 256, "Unknown");
+
+ // Get hardware info
+ ZeroMemory(&sysInfo, sizeof(SYSTEM_INFO));
+ GetSystemInfo(&sysInfo);
+
+ switch (sysInfo.wProcessorArchitecture) {
+ case PROCESSOR_ARCHITECTURE_AMD64:
+ out_string("x86_64");
+ break;
+ case PROCESSOR_ARCHITECTURE_IA64:
+ out_string("ia64");
+ break;
+ case PROCESSOR_ARCHITECTURE_INTEL:
+ out_string("x86");
+ break;
+ case PROCESSOR_ARCHITECTURE_ARM:
+ out_string("ARM");
+ break;
+ case PROCESSOR_ARCHITECTURE_PPC:
+ out_string("PowerPC");
+ break;
+ case PROCESSOR_ARCHITECTURE_MIPS:
+ out_string("MIPS");
+ break;
+ case PROCESSOR_ARCHITECTURE_MSIL:
+ out_string("MSIL");
+ break;
+ case PROCESSOR_ARCHITECTURE_SHX:
+ out_string("ShX");
+ break;
+ case PROCESSOR_ARCHITECTURE_UNKNOWN:
+ default:
+ out_string("unknown");
+ }
+ tsnprintf(buf, sizeof(buf) - 1, "%.999s %.999s %.999s", szSystemName, version, release);
+#else
+ struct utsname st;
+ uname (&st);
+ out_string (st.machine);
+ tsnprintf (buf, sizeof (buf) - 1, "%.999s %.999s %.999s", st.sysname, st.release, st.version);
+#endif
+ out_string (buf);
+ tsnprintf (buf, sizeof (buf) - 1, "%s (TGL %s)", TLS->app_version, TGL_VERSION);
+ out_string (buf);
+ out_string ("En");
+ } else {
+#if defined(WIN32) || defined(_WIN32)
+ out_string("x86");
+ out_string("Windows");
+#else
+ out_string ("x86");
+ out_string ("Linux");
+#endif
+ static char buf[4096];
+ tsnprintf (buf, sizeof (buf) - 1, "%s (TGL %s)", TLS->app_version, TGL_VERSION);
+ out_string (buf);
+ out_string ("en");
+ }
+}
+
+void tgl_set_query_error (struct tgl_state *TLS, int error_code, const char *format, ...) __attribute__ ((format (printf, 3, 4)));
+void tgl_set_query_error (struct tgl_state *TLS, int error_code, const char *format, ...) {
+ static char s[1001];
+
+ va_list ap;
+ va_start (ap, format);
+ vsnprintf (s, 1000, format, ap);
+ va_end (ap);
+
+ if (TLS->error) {
+ tfree_str (TLS->error);
+ }
+ TLS->error = tstrdup (s);
+ TLS->error_code = error_code;
+}
+/* }}} */
+
+/* {{{ Default on error */
+
+static int q_void_on_error (struct tgl_state *TLS, struct query *q, int error_code, int error_len, const char *error) {
+ tgl_set_query_error (TLS, EPROTO, "RPC_CALL_FAIL %d: %.*s", error_code, error_len, error);
+ if (q->callback) {
+ ((void (*)(struct tgl_state *,void *, int))(q->callback))(TLS, q->callback_extra, 0);
+ }
+ return 0;
+}
+
+static int q_ptr_on_error (struct tgl_state *TLS, struct query *q, int error_code, int error_len, const char *error) {
+ tgl_set_query_error (TLS, EPROTO, "RPC_CALL_FAIL %d: %.*s", error_code, error_len, error);
+ if (q->callback) {
+ ((void (*)(struct tgl_state *,void *, int, void *))(q->callback))(TLS, q->callback_extra, 0, NULL);
+ }
+ return 0;
+}
+
+static int q_list_on_error (struct tgl_state *TLS, struct query *q, int error_code, int error_len, const char *error) {
+ tgl_set_query_error (TLS, EPROTO, "RPC_CALL_FAIL %d: %.*s", error_code, error_len, error);
+ if (q->callback) {
+ ((void (*)(struct tgl_state *,void *, int, int, void *))(q->callback))(TLS, q->callback_extra, 0, 0, NULL);
+ }
+ return 0;
+}
+/* }}} */
+
+#include "queries-encrypted.c"
+
+/* {{{ Get config */
+
+static void fetch_dc_option (struct tgl_state *TLS, struct tl_ds_dc_option *DS_DO) {
+ bl_do_dc_option_new (TLS, DS_LVAL (DS_DO->flags), DS_LVAL (DS_DO->id), DS_STR (DS_DO->hostname), DS_STR (DS_DO->ip_address), DS_LVAL (DS_DO->port));
+}
+
+static int help_get_config_on_answer (struct tgl_state *TLS, struct query *q, void *DS) {
+ struct tl_ds_config *DS_C = DS;
+
+ int i;
+ for (i = 0; i < DS_LVAL (DS_C->dc_options->cnt); i++) {
+ fetch_dc_option (TLS, DS_C->dc_options->data[i]);
+ }
+
+ int max_chat_size = DS_LVAL (DS_C->chat_size_max);
+ int max_bcast_size = DS_LVAL (DS_C->broadcast_size_max);
+ vlogprintf (E_DEBUG, "chat_size = %d, bcast_size = %d\n", max_chat_size, max_bcast_size);
+
+ if (q->callback) {
+ ((void (*)(struct tgl_state *,void *, int))(q->callback))(TLS, q->callback_extra, 1);
+ }
+ return 0;
+}
+
+static struct query_methods help_get_config_methods = {
+ .on_answer = help_get_config_on_answer,
+ .on_error = q_void_on_error,
+ .type = TYPE_TO_PARAM(config)
+};
+
+void tgl_do_help_get_config (struct tgl_state *TLS, void (*callback)(struct tgl_state *,void *, int), void *callback_extra) {
+ clear_packet ();
+ tgl_do_insert_header (TLS);
+ out_int (CODE_help_get_config);
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &help_get_config_methods, 0, callback, callback_extra);
+}
+
+void tgl_do_help_get_config_dc (struct tgl_state *TLS, struct tgl_dc *D, void (*callback)(struct tgl_state *, void *, int), void *callback_extra) {
+ clear_packet ();
+ tgl_do_insert_header (TLS);
+ out_int (CODE_help_get_config);
+ tglq_send_query_ex (TLS, D, packet_ptr - packet_buffer, packet_buffer, &help_get_config_methods, 0, callback, callback_extra, 2);
+}
+/* }}} */
+
+/* {{{ Send code */
+static int send_code_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tl_ds_auth_sent_code *DS_ASC = D;
+
+ char *phone_code_hash = DS_STR_DUP (DS_ASC->phone_code_hash);
+ int registered = DS_BVAL (DS_ASC->phone_registered);;
+
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int, int, const char *))(q->callback)) (TLS, q->callback_extra, 1, registered, phone_code_hash);
+ }
+ tfree_str (phone_code_hash);
+ return 0;
+}
+
+static struct query_methods send_code_methods = {
+ .on_answer = send_code_on_answer,
+ .on_error = q_list_on_error,
+ .type = TYPE_TO_PARAM(auth_sent_code)
+};
+
+void tgl_do_send_code (struct tgl_state *TLS, const char *phone, int phone_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, int registered, const char *hash), void *callback_extra) {
+ vlogprintf (E_DEBUG, "sending code to dc %d\n", TLS->dc_working_num);
+
+ clear_packet ();
+ tgl_do_insert_header (TLS);
+ out_int (CODE_auth_send_code);
+ out_cstring (phone, phone_len);
+ out_int (0);
+ out_int (TLS->app_id);
+ out_string (TLS->app_hash);
+ out_string ("en");
+
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &send_code_methods, NULL, callback, callback_extra);
+}
+
+
+static int phone_call_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ if (q->callback) {
+ ((void (*)(struct tgl_state *TLS, void *, int))(q->callback))(TLS, q->callback_extra, 1);
+ }
+ return 0;
+}
+
+static struct query_methods phone_call_methods = {
+ .on_answer = phone_call_on_answer,
+ .on_error = q_void_on_error,
+ .type = TYPE_TO_PARAM(bool)
+};
+
+void tgl_do_phone_call (struct tgl_state *TLS, const char *phone, int phone_len, const char *hash, int hash_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra) {
+ vlogprintf (E_DEBUG, "calling user\n");
+
+ clear_packet ();
+ tgl_do_insert_header (TLS);
+ out_int (CODE_auth_send_call);
+ out_cstring (phone, phone_len);
+ out_cstring (hash, hash_len);
+
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &phone_call_methods, NULL, callback, callback_extra);
+}
+/* }}} */
+
+/* {{{ Sign in / Sign up */
+static int sign_in_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tl_ds_auth_authorization *DS_AA = D;
+ //vlogprintf (E_DEBUG, "Expires in %d\n", DS_LVAL (DS_AA->expires));
+
+ struct tgl_user *U = tglf_fetch_alloc_user_new (TLS, DS_AA->user);
+
+ bl_do_dc_signed (TLS, TLS->DC_working->id);
+
+ if (q->callback) {
+ ((void (*)(struct tgl_state *TLS, void *, int, struct tgl_user *))q->callback) (TLS, q->callback_extra, 1, U);
+ }
+
+ return 0;
+}
+
+static int sign_in_on_error (struct tgl_state *TLS, struct query *q, int error_code, int error_len, const char *error) {
+ tgl_set_query_error (TLS, EPROTO, "RPC_CALL_FAIL %d: %.*s", error_code, error_len, error);
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int, struct tgl_user *))q->callback) (TLS, q->callback_extra, 0, NULL);
+ }
+ return 0;
+}
+
+static struct query_methods sign_in_methods = {
+ .on_answer = sign_in_on_answer,
+ .on_error = sign_in_on_error,
+ .type = TYPE_TO_PARAM(auth_authorization)
+};
+
+int tgl_do_send_code_result (struct tgl_state *TLS, const char *phone, int phone_len, const char *hash, int hash_len, const char *code, int code_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_user *Self), void *callback_extra) {
+ clear_packet ();
+ out_int (CODE_auth_sign_in);
+ out_cstring (phone, phone_len);
+ out_cstring (hash, hash_len);
+ out_cstring (code, code_len);
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &sign_in_methods, 0, callback, callback_extra);
+ return 0;
+}
+
+int tgl_do_send_code_result_auth (struct tgl_state *TLS, const char *phone, int phone_len, const char *hash, int hash_len, const char *code, int code_len, const char *first_name, int first_name_len, const char *last_name, int last_name_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_user *Self), void *callback_extra) {
+ clear_packet ();
+ out_int (CODE_auth_sign_up);
+ out_cstring (phone, phone_len);
+ out_cstring (hash, hash_len);
+ out_cstring (code, code_len);
+ out_cstring (first_name, first_name_len);
+ out_cstring (last_name, last_name_len);
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &sign_in_methods, 0, callback, callback_extra);
+ return 0;
+}
+
+int tgl_do_send_bot_auth (struct tgl_state *TLS, const char *code, int code_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_user *Self), void *callback_extra) {
+ clear_packet ();
+ out_int (CODE_auth_import_bot_authorization);
+ out_int (0);
+ out_int (TLS->app_id);
+ out_string (TLS->app_hash);
+ out_cstring (code, code_len);
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &sign_in_methods, 0, callback, callback_extra);
+ return 0;
+}
+/* }}} */
+
+/* {{{ Get contacts */
+static int get_contacts_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tl_ds_contacts_contacts *DS_CC = D;
+
+ int n = DS_CC->users ? DS_LVAL (DS_CC->users->cnt) : 0;
+
+ int i;
+ struct tgl_user **list = talloc (sizeof (void *) * n);
+ for (i = 0; i < n; i++) {
+ list[i] = tglf_fetch_alloc_user_new (TLS, DS_CC->users->data[i]);
+ }
+ if (q->callback) {
+ ((void (*)(struct tgl_state *TLS, void *, int, int, struct tgl_user **))q->callback) (TLS, q->callback_extra, 1, n, list);
+ }
+ tfree (list, sizeof (void *) * n);
+ return 0;
+}
+
+static struct query_methods get_contacts_methods = {
+ .on_answer = get_contacts_on_answer,
+ .on_error = q_list_on_error,
+ .type = TYPE_TO_PARAM(contacts_contacts)
+};
+
+
+void tgl_do_update_contact_list (struct tgl_state *TLS, void (*callback) (struct tgl_state *TLS, void *callback_extra, int success, int size, struct tgl_user *contacts[]), void *callback_extra) {
+ clear_packet ();
+ out_int (CODE_contacts_get_contacts);
+ out_string ("");
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &get_contacts_methods, NULL, callback, callback_extra);
+}
+/* }}} */
+
+/* {{{ Send msg (plain text) */
+static int msg_send_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tl_ds_messages_sent_message *DS_MSM = D;
+
+ long long y = *(long long *)q->extra;
+ tfree (q->extra, 8);
+
+ struct tgl_message *M = tgl_message_get (TLS, y);
+ vlogprintf (E_DEBUG, "y = %"_PRINTF_INT64_"d\n", y);
+
+ if (M && M->id != DS_LVAL (DS_MSM->id)) {
+ assert (M->flags & TGLMF_PENDING);
+ bl_do_create_message_new (TLS, M->id, NULL, NULL, NULL, NULL, NULL,
+ DS_MSM->date, NULL, 0, DS_MSM->media, NULL, NULL, NULL, M->flags & 0xffff);
+ }
+
+ struct tl_ds_update *UPD = talloc0 (sizeof (*UPD));
+ UPD->magic = CODE_update_message_i_d;
+ UPD->id = talloc (4);
+ *UPD->id = DS_LVAL (DS_MSM->id);
+ UPD->random_id = talloc (8);
+ *UPD->random_id = y;
+ UPD->pts_count = talloc (4);
+ *UPD->pts_count = DS_LVAL (DS_MSM->pts_count);
+ UPD->pts = talloc (4);
+ *UPD->pts = DS_LVAL (DS_MSM->pts);
+
+ tglu_work_update_new (TLS, 1, UPD);
+ tglu_work_update_new (TLS, 0, UPD);
+
+ *UPD->pts_count = 0;
+ tfree (UPD->random_id, 8);
+ UPD->magic = CODE_update_msg_update;
+
+ tglu_work_update_new (TLS, 1, UPD);
+ tglu_work_update_new (TLS, 0, UPD);
+
+ free_ds_type_update (UPD, TYPE_TO_PARAM (update));
+
+ y = tgls_get_local_by_random (TLS, y);
+ M = tgl_message_get (TLS, y);
+
+ if (q->callback) {
+ ((void (*)(struct tgl_state *,void *, int, struct tgl_message *))q->callback) (TLS, q->callback_extra, 1, M);
+ }
+ return 0;
+}
+
+static int msg_send_on_error (struct tgl_state *TLS, struct query *q, int error_code, int error_len, const char *error) {
+ tgl_set_query_error (TLS, EPROTO, "RPC_CALL_FAIL %d: %.*s", error_code, error_len, error);
+ long long x = *(long long *)q->extra;
+ tfree (q->extra, 8);
+ struct tgl_message *M = tgl_message_get (TLS, x);
+ if (q->callback) {
+ ((void (*)(struct tgl_state *,void *, int, struct tgl_message *))q->callback) (TLS, q->callback_extra, 0, M);
+ }
+ if (M) {
+ bl_do_message_delete (TLS, M);
+ }
+ return 0;
+}
+
+static struct query_methods msg_send_methods = {
+ .on_answer = msg_send_on_answer,
+ .on_error = msg_send_on_error,
+ .type = TYPE_TO_PARAM(messages_sent_message)
+};
+
+void tgl_do_send_msg (struct tgl_state *TLS, struct tgl_message *M, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra) {
+ if (tgl_get_peer_type (M->to_id) == TGL_PEER_ENCR_CHAT) {
+ tgl_do_send_encr_msg (TLS, M, callback, callback_extra);
+ return;
+ }
+ clear_packet ();
+ out_int (CODE_messages_send_message);
+
+ out_int (((M->flags & TGLMF_DISABLE_PREVIEW) ? 2 : 0) | (M->reply_id ? 1 : 0) | (M->reply_markup ? 4 : 0));
+ out_peer_id (TLS, M->to_id);
+ if (M->reply_id) {
+ out_int (M->reply_id);
+ }
+ out_cstring (M->message, M->message_len);
+ out_long (M->id);
+ long long *x = talloc (8);
+ *x = M->id;
+
+ if (M->reply_markup) {
+ if (M->reply_markup->rows) {
+ out_int (CODE_reply_keyboard_markup);
+ out_int (M->reply_markup->flags);
+ out_int (CODE_vector);
+ out_int (M->reply_markup->rows);
+ int i;
+ for (i = 0; i < M->reply_markup->rows; i++) {
+ out_int (CODE_keyboard_button_row);
+ out_int (CODE_vector);
+ out_int (M->reply_markup->row_start[i + 1] - M->reply_markup->row_start[i]);
+ int j;
+ for (j = 0; j < M->reply_markup->row_start[i + 1] - M->reply_markup->row_start[i]; j++) {
+ out_int (CODE_keyboard_button);
+ out_string (M->reply_markup->buttons[j + M->reply_markup->row_start[i]]);
+ }
+ }
+ } else {
+ out_int (CODE_reply_keyboard_hide);
+ }
+ }
+
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &msg_send_methods, x, callback, callback_extra);
+}
+
+void tgl_do_send_message (struct tgl_state *TLS, tgl_peer_id_t id, const char *text, int text_len, unsigned long long flags, struct tl_ds_reply_markup *reply_markup, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra) {
+ if (tgl_get_peer_type (id) == TGL_PEER_ENCR_CHAT) {
+ tgl_peer_t *P = tgl_peer_get (TLS, id);
+ if (!P) {
+ tgl_set_query_error (TLS, EINVAL, "unknown secret chat");
+ if (callback) {
+ callback (TLS, callback_extra, 0, 0);
+ }
+ return;
+ }
+ if (P->encr_chat.state != sc_ok) {
+ tgl_set_query_error (TLS, EINVAL, "secret chat not in ok state");
+ if (callback) {
+ callback (TLS, callback_extra, 0, 0);
+ }
+ return;
+ }
+ }
+ long long t;
+ tglt_secure_random (&t, 8);
+
+ int peer_type = tgl_get_peer_type (id);
+ int peer_id = tgl_get_peer_id (id);
+ int date = (int)time (0);
+
+ if (tgl_get_peer_type (id) != TGL_PEER_ENCR_CHAT) {
+ int reply = (flags >> 32);
+ int disable_preview = flags & TGL_SEND_MSG_FLAG_DISABLE_PREVIEW;
+ if (!(flags & TGL_SEND_MSG_FLAG_ENABLE_PREVIEW) && TLS->disable_link_preview) {
+ disable_preview = 1;
+ }
+ if (disable_preview) {
+ disable_preview = TGLMF_DISABLE_PREVIEW;
+ }
+ struct tl_ds_message_media TDSM;
+ TDSM.magic = CODE_message_media_empty;
+
+ bl_do_create_message_new (TLS, t, &TLS->our_id, &peer_type, &peer_id, NULL, NULL, &date, text, text_len, &TDSM, NULL, reply ? &reply : NULL, reply_markup, TGLMF_UNREAD | TGLMF_OUT | TGLMF_PENDING | TGLMF_CREATE | TGLMF_CREATED | TGLMF_SESSION_OUTBOUND | disable_preview);
+ } else {
+ struct tl_ds_decrypted_message_media TDSM;
+ TDSM.magic = CODE_decrypted_message_media_empty;
+
+ bl_do_create_message_encr_new (TLS, t, &TLS->our_id, &peer_type, &peer_id, &date, text, text_len, &TDSM, NULL, NULL, TGLMF_UNREAD | TGLMF_OUT | TGLMF_PENDING | TGLMF_CREATE | TGLMF_CREATED | TGLMF_SESSION_OUTBOUND | TGLMF_ENCRYPTED);
+ }
+
+ struct tgl_message *M = tgl_message_get (TLS, t);
+ assert (M);
+ tgl_do_send_msg (TLS, M, callback, callback_extra);
+}
+
+void tgl_do_reply_message (struct tgl_state *TLS, int reply_id, const char *text, int text_len, unsigned long long flags, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra) {
+ struct tgl_message *M = tgl_message_get (TLS, reply_id);
+ if (!M || !(M->flags & TGLMF_CREATED) || (M->flags & TGLMF_ENCRYPTED)) {
+ if (!M || !(M->flags & TGLMF_CREATED)) {
+ tgl_set_query_error (TLS, EINVAL, "unknown message");
+ } else {
+ tgl_set_query_error (TLS, EINVAL, "can not reply on message from secret chat");
+ }
+ if (callback) {
+ callback (TLS, callback_extra, 0, 0);
+ }
+ return;
+ }
+
+ tgl_peer_id_t id = M->to_id;
+ if (tgl_get_peer_type (id) == TGL_PEER_USER && tgl_get_peer_id (id) == TLS->our_id) {
+ id = M->from_id;
+ }
+
+ tgl_do_send_message (TLS, id, text, text_len, flags | TGL_SEND_MSG_FLAG_REPLY (reply_id), NULL, callback, callback_extra);
+}
+/* }}} */
+
+/* {{{ Send text file */
+void tgl_do_send_text (struct tgl_state *TLS, tgl_peer_id_t id, const char *file_name, unsigned long long flags, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra) {
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ int fd = 0;
+ errno_t err = _sopen_s(&fd, file_name, _O_RDONLY | _O_BINARY, _SH_DENYNO, _S_IREAD | _S_IWRITE);
+ if(err != 0) {
+ tgl_set_query_error(TLS, EBADF, "Can not open file: %s", GetErrnoStr (errno));
+#elif defined(WIN32) || defined(_WIN32)
+ int fd = open(file_name, O_RDONLY | O_BINARY);
+ if (fd < 0) {
+ tgl_set_query_error (TLS, EBADF, "Can not open file: %s", GetErrnoStr (errno));
+#else
+ int fd = open (file_name, O_RDONLY);
+ if (fd < 0) {
+ tgl_set_query_error (TLS, EBADF, "Can not open file: %m");
+#endif
+ if (callback) {
+ callback (TLS, callback_extra, 0, NULL);
+ }
+ return;
+ }
+ static char buf[(1 << 20) + 1];
+ int x = read (fd, buf, (1 << 20) + 1);
+ if (x < 0) {
+#if defined(WIN32) || defined(_WIN32)
+ tgl_set_query_error (TLS, EBADF, "Can not read from file: %s", GetErrnoStr (errno));
+#else
+ tgl_set_query_error (TLS, EBADF, "Can not read from file: %m");
+#endif
+ close (fd);
+
+ if (callback) {
+ callback (TLS, callback_extra, 0, NULL);
+ }
+ return;
+ }
+
+ assert (x >= 0);
+ close (fd);
+ if (x == (1 << 20) + 1) {
+ tgl_set_query_error (TLS, E2BIG, "text file is too big");
+ if (callback) {
+ callback (TLS, callback_extra, 0, NULL);
+ }
+ } else {
+ tgl_do_send_message (TLS, id, buf, x, flags, NULL, callback, callback_extra);
+ }
+}
+
+void tgl_do_reply_text (struct tgl_state *TLS, int reply_id, const char *file_name, unsigned long long flags, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra) {
+ struct tgl_message *M = tgl_message_get (TLS, reply_id);
+ if (!M || !(M->flags & TGLMF_CREATED) || (M->flags & TGLMF_ENCRYPTED)) {
+ if (!M || !(M->flags & TGLMF_CREATED)) {
+ tgl_set_query_error (TLS, EINVAL, "unknown message");
+ } else {
+ tgl_set_query_error (TLS, EINVAL, "can not reply on message from secret chat");
+ }
+ if (callback) {
+ callback (TLS, callback_extra, 0, 0);
+ }
+ return;
+ }
+
+ tgl_peer_id_t id = M->to_id;
+ if (tgl_get_peer_type (id) == TGL_PEER_USER && tgl_get_peer_id (id) == TLS->our_id) {
+ id = M->from_id;
+ }
+
+ tgl_do_send_text (TLS, id, file_name, flags | TGL_SEND_MSG_FLAG_REPLY (reply_id), callback, callback_extra);
+}
+/* }}} */
+
+/* {{{ Mark read */
+
+struct mark_read_extra {
+ tgl_peer_id_t id;
+ int max_id;
+};
+
+void tgl_do_messages_mark_read (struct tgl_state *TLS, tgl_peer_id_t id, int max_id, int offset, void (*callback)(struct tgl_state *TLS, void *callback_extra, int), void *callback_extra);
+
+static int mark_read_on_receive (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tl_ds_messages_affected_history *DS_MAH = D;
+
+ int r = tgl_check_pts_diff (TLS, DS_LVAL (DS_MAH->pts), DS_LVAL (DS_MAH->pts_count));
+
+ if (r > 0) {
+ bl_do_set_pts (TLS, DS_LVAL (DS_MAH->pts));
+ }
+
+ int offset = DS_LVAL (DS_MAH->offset);
+
+ struct mark_read_extra *E = q->extra;
+ if (offset > 0) {
+ tgl_do_messages_mark_read (TLS, E->id, E->max_id, offset, q->callback, q->callback_extra);
+ } else {
+ if (tgl_get_peer_type (E->id) == TGL_PEER_USER) {
+ bl_do_user_new (TLS, tgl_get_peer_id (E->id), NULL, NULL, 0, NULL, 0, NULL, 0, NULL, 0, NULL, NULL, 0, NULL, 0, NULL, &E->max_id, NULL, NULL, TGL_FLAGS_UNCHANGED);
+ } else {
+ assert (tgl_get_peer_type (E->id) == TGL_PEER_CHAT);
+ bl_do_chat_new (TLS, tgl_get_peer_id (E->id), NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &E->max_id, NULL, TGL_FLAGS_UNCHANGED);
+ }
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int))q->callback)(TLS, q->callback_extra, 1);
+ }
+ }
+ tfree (E, sizeof (*E));
+ return 0;
+}
+
+static int mark_read_on_error (struct tgl_state *TLS, struct query *q, int error_code, int error_len, const char *error) {
+ tgl_set_query_error (TLS, EPROTO, "RPC_CALL_FAIL %d: %.*s", error_code, error_len, error);
+
+ struct mark_read_extra *E = q->extra;
+ tfree (E, sizeof (*E));
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int))q->callback)(TLS, q->callback_extra, 0);
+ }
+ return 0;
+}
+
+static struct query_methods mark_read_methods = {
+ .on_answer = mark_read_on_receive,
+ .on_error = mark_read_on_error,
+ .type = TYPE_TO_PARAM(messages_affected_history)
+};
+
+void tgl_do_messages_mark_read (struct tgl_state *TLS, tgl_peer_id_t id, int max_id, int offset, void (*callback)(struct tgl_state *TLS, void *callback_extra, int), void *callback_extra) {
+ if (TLS->is_bot) { return; }
+ clear_packet ();
+ out_int (CODE_messages_read_history);
+ out_peer_id (TLS, id);
+ out_int (max_id);
+ out_int (offset);
+
+ struct mark_read_extra *E = talloc (sizeof (*E));
+ E->id = id;
+ E->max_id = max_id;
+
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &mark_read_methods, E, callback, callback_extra);
+}
+
+void tgl_do_mark_read (struct tgl_state *TLS, tgl_peer_id_t id, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra) {
+ if (tgl_get_peer_type (id) == TGL_PEER_USER || tgl_get_peer_type (id) == TGL_PEER_CHAT) {
+ tgl_do_messages_mark_read (TLS, id, 0, 0, callback, callback_extra);
+ return;
+ }
+ tgl_peer_t *P = tgl_peer_get (TLS, id);
+ if (!P) {
+ tgl_set_query_error (TLS, EINVAL, "unknown secret chat");
+ if (callback) {
+ callback (TLS, callback_extra, 0);
+ }
+ return;
+ }
+ assert (tgl_get_peer_type (id) == TGL_PEER_ENCR_CHAT);
+ if (P->last) {
+ tgl_do_messages_mark_read_encr (TLS, id, P->encr_chat.access_hash, P->last->date, callback, callback_extra);
+ } else {
+ tgl_do_messages_mark_read_encr (TLS, id, P->encr_chat.access_hash, (int)time (0) - 10, callback, callback_extra);
+ }
+}
+/* }}} */
+
+/* {{{ Get history */
+struct get_history_extra {
+ struct tgl_message **ML;
+ int list_offset;
+ int list_size;
+ tgl_peer_id_t id;
+ int limit;
+ int offset;
+ int max_id;
+};
+
+static void _tgl_do_get_history (struct tgl_state *TLS, struct get_history_extra *E, void (*callback)(struct tgl_state *TLS,void *callback_extra, int success, int size, struct tgl_message *list[]), void *callback_extra);
+
+
+static int get_history_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tl_ds_messages_messages *DS_MM = D;
+
+ struct get_history_extra *E = q->extra;
+
+ int n = DS_LVAL (DS_MM->messages->cnt);
+
+ if (E->list_size - E->list_offset < n) {
+ int new_list_size = 2 * E->list_size;
+ if (new_list_size - E->list_offset < n) {
+ new_list_size = n + E->list_offset;
+ }
+ E->ML = trealloc (E->ML, E->list_size * sizeof (void *), new_list_size * sizeof (void *));
+ assert (E->ML);
+ E->list_size = new_list_size;
+ }
+
+ int i;
+ for (i = 0; i < n; i++) {
+ E->ML[i + E->list_offset] = tglf_fetch_alloc_message_new (TLS, DS_MM->messages->data[i]);
+ }
+ E->list_offset += n;
+ E->offset += n;
+ E->limit -= n;
+
+ int count = DS_LVAL (DS_MM->count);
+ if (count >= 0 && E->limit + E->offset >= count) {
+ E->limit = count - E->offset;
+ if (E->limit < 0) { E->limit = 0; }
+ }
+ assert (E->limit >= 0);
+
+ for (i = 0; i < DS_LVAL (DS_MM->chats->cnt); i++) {
+ tglf_fetch_alloc_chat_new (TLS, DS_MM->chats->data[i]);
+ }
+
+ for (i = 0; i < DS_LVAL (DS_MM->users->cnt); i++) {
+ tglf_fetch_alloc_user_new (TLS, DS_MM->users->data[i]);
+ }
+
+
+ if (E->limit <= 0 || DS_MM->magic == CODE_messages_messages) {
+ if (q->callback) {
+ ((void (*)(struct tgl_state *TLS, void *, int, int, struct tgl_message **))q->callback) (TLS, q->callback_extra, 1, E->list_offset, E->ML);
+ }
+ if (E->list_offset > 0) {
+ tgl_do_messages_mark_read (TLS, E->id, E->ML[0]->id, 0, 0, 0);
+ }
+
+ tfree (E->ML, sizeof (void *) * E->list_size);
+ tfree (E, sizeof (*E));
+ } else {
+ E->offset = 0;
+ E->max_id = E->ML[E->list_offset - 1]->id;
+ _tgl_do_get_history (TLS, E, q->callback, q->callback_extra);
+ }
+ return 0;
+}
+
+static int get_history_on_error (struct tgl_state *TLS, struct query *q, int error_code, int error_len, const char *error) {
+ tgl_set_query_error (TLS, EPROTO, "RPC_CALL_FAIL %d: %.*s", error_code, error_len, error);
+
+ struct get_history_extra *E = q->extra;
+ tfree (E->ML, sizeof (void *) * E->list_size);
+ tfree (E, sizeof (*E));
+
+ if (q->callback) {
+ ((void (*)(struct tgl_state *TLS, void *, int, int, struct tgl_message **))q->callback) (TLS, q->callback_extra, 0, 0, NULL);
+ }
+ return 0;
+}
+
+static struct query_methods get_history_methods = {
+ .on_answer = get_history_on_answer,
+ .on_error = get_history_on_error,
+ .type = TYPE_TO_PARAM(messages_messages)
+};
+
+void tgl_do_get_local_history (struct tgl_state *TLS, tgl_peer_id_t id, int offset, int limit, void (*callback)(struct tgl_state *TLS,void *callback_extra, int success, int size, struct tgl_message *list[]), void *callback_extra) {
+ tgl_peer_t *P = tgl_peer_get (TLS, id);
+ if (!P || !P->last) {
+ tgl_set_query_error (TLS, EINVAL, "unknown peer");
+ if (callback) {
+ callback (TLS, callback_extra, 0, 0, 0);
+ }
+ return;
+ }
+ struct tgl_message *M = P->last;
+ int count = 1;
+ assert (!M->prev);
+ while (count < limit + offset && M->next) {
+ M = M->next;
+ count ++;
+ }
+ if (count <= offset) {
+ if (callback) {
+ callback (TLS, callback_extra, 1, 0, 0);
+ }
+ return;
+ }
+ struct tgl_message **ML = talloc (sizeof (void *) * (count - offset));
+ M = P->last;
+ ML[0] = M;
+ count = 1;
+ while (count < limit && M->next) {
+ M = M->next;
+ if (count >= offset) {
+ ML[count - offset] = M;
+ }
+ count ++;
+ }
+
+ if (callback) {
+ callback (TLS, callback_extra, 1, count - offset, ML);
+ }
+ tfree (ML, sizeof (void *) * (count) - offset);
+}
+
+static void _tgl_do_get_history (struct tgl_state *TLS, struct get_history_extra *E, void (*callback)(struct tgl_state *TLS,void *callback_extra, int success, int size, struct tgl_message *list[]), void *callback_extra) {
+ clear_packet ();
+ out_int (CODE_messages_get_history);
+ out_peer_id (TLS, E->id);
+ out_int (E->offset);
+ out_int (E->max_id);
+ out_int (E->limit);
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &get_history_methods, E, callback, callback_extra);
+}
+
+void tgl_do_get_history (struct tgl_state *TLS, tgl_peer_id_t id, int offset, int limit, int offline_mode, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, int size, struct tgl_message *list[]), void *callback_extra) {
+ if (tgl_get_peer_type (id) == TGL_PEER_ENCR_CHAT || offline_mode) {
+ tgl_do_get_local_history (TLS, id, offset, limit, callback, callback_extra);
+ tgl_do_mark_read (TLS, id, 0, 0);
+ return;
+ }
+ struct get_history_extra *E = talloc0 (sizeof (*E));
+ E->id = id;
+ E->limit = limit;
+ E->offset = offset;
+ _tgl_do_get_history (TLS, E, callback, callback_extra);
+}
+/* }}} */
+
+/* {{{ Get dialogs */
+struct get_dialogs_extra {
+ tgl_peer_id_t *PL;
+ int *UC;
+ int *LM;
+ int *LRM;
+
+ int list_offset;
+ int list_size;
+ int limit;
+ int offset;
+ int max_id;
+};
+
+static void _tgl_do_get_dialog_list (struct tgl_state *TLS, struct get_dialogs_extra *E, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, int size, tgl_peer_id_t peers[], int last_msg_id[], int unread_count[]), void *callback_extra);
+
+static int get_dialogs_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tl_ds_messages_dialogs *DS_MD = D;
+
+ struct get_dialogs_extra *E = q->extra;
+
+ int dl_size = DS_LVAL (DS_MD->dialogs->cnt);
+
+ if (E->list_offset + dl_size > E->list_size) {
+ int new_list_size = E->list_size * 2;
+ if (new_list_size < E->list_offset + dl_size) {
+ new_list_size = E->list_offset + dl_size;
+ }
+
+ E->PL = trealloc (E->PL, E->list_size * sizeof (tgl_peer_id_t), new_list_size * sizeof (tgl_peer_id_t));
+ assert (E->PL);
+ E->UC = trealloc (E->UC, E->list_size * sizeof (int), new_list_size * sizeof (int));
+ assert (E->UC);
+ E->LM = trealloc (E->LM, E->list_size * sizeof (int), new_list_size * sizeof (int));
+ assert (E->LM);
+ E->LRM = trealloc (E->LRM, E->list_size * sizeof (int), new_list_size * sizeof (int));
+ assert (E->LRM);
+
+ E->list_size = new_list_size;
+ }
+
+ int i;
+ for (i = 0; i < dl_size; i++) {
+ struct tl_ds_dialog *DS_D = DS_MD->dialogs->data[i];
+ E->PL[E->list_offset + i] = tglf_fetch_peer_id_new (TLS, DS_D->peer);
+ E->LM[E->list_offset + i] = DS_LVAL (DS_D->top_message);
+ E->UC[E->list_offset + i] = DS_LVAL (DS_D->unread_count);
+ E->LRM[E->list_offset + i] = DS_LVAL (DS_D->read_inbox_max_id);
+ }
+ E->list_offset += dl_size;
+
+ for (i = 0; i < DS_LVAL (DS_MD->messages->cnt); i++) {
+ tglf_fetch_alloc_message_new (TLS, DS_MD->messages->data[i]);
+ }
+
+ for (i = 0; i < DS_LVAL (DS_MD->chats->cnt); i++) {
+ tglf_fetch_alloc_chat_new (TLS, DS_MD->chats->data[i]);
+ }
+
+ for (i = 0; i < DS_LVAL (DS_MD->users->cnt); i++) {
+ tglf_fetch_alloc_user_new (TLS, DS_MD->users->data[i]);
+ }
+
+ vlogprintf (E_DEBUG, "dl_size = %d, total = %d\n", dl_size, E->list_offset);
+ if (dl_size && E->list_offset < E->limit && DS_MD->magic == CODE_messages_dialogs_slice && E->list_offset < DS_LVAL (DS_MD->count)) {
+ E->offset += dl_size;
+ _tgl_do_get_dialog_list (TLS, E, q->callback, q->callback_extra);
+ } else {
+ if (q->callback) {
+ ((void (*)(struct tgl_state *TLS, void *, int, int, tgl_peer_id_t *, int *, int *))q->callback) (TLS, q->callback_extra, 1, E->list_offset, E->PL, E->LM, E->UC);
+ }
+ tfree (E->PL, sizeof (tgl_peer_id_t) * E->list_size);
+ tfree (E->UC, 4 * E->list_size);
+ tfree (E->LM, 4 * E->list_size);
+ tfree (E->LRM, 4 * E->list_size);
+ tfree (E, sizeof (*E));
+ }
+
+ return 0;
+}
+
+static int get_dialogs_on_error (struct tgl_state *TLS, struct query *q, int error_code, int error_len, const char *error) {
+ tgl_set_query_error (TLS, EPROTO, "RPC_CALL_FAIL %d: %.*s", error_code, error_len, error);
+
+ struct get_dialogs_extra *E = q->extra;
+ tfree (E->PL, sizeof (tgl_peer_id_t) * E->list_size);
+ tfree (E->UC, 4 * E->list_size);
+ tfree (E->LM, 4 * E->list_size);
+ tfree (E->LRM, 4 * E->list_size);
+ tfree (E, sizeof (*E));
+ if (q->callback) {
+ ((void (*)(struct tgl_state *TLS, void *, int, int, tgl_peer_id_t *, int *, int *))q->callback) (TLS, q->callback_extra, 0, 0, NULL, NULL, NULL);
+ }
+ return 0;
+}
+
+static struct query_methods get_dialogs_methods = {
+ .on_answer = get_dialogs_on_answer,
+ .on_error = get_dialogs_on_error,
+ .type = TYPE_TO_PARAM(messages_dialogs)
+};
+
+static void _tgl_do_get_dialog_list (struct tgl_state *TLS, struct get_dialogs_extra *E, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, int size, tgl_peer_id_t peers[], int last_msg_id[], int unread_count[]), void *callback_extra) {
+ clear_packet ();
+ out_int (CODE_messages_get_dialogs);
+ out_int (E->offset);
+ out_int (0);
+ out_int (E->limit - E->list_offset);
+
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &get_dialogs_methods, E, callback, callback_extra);
+}
+
+void tgl_do_get_dialog_list (struct tgl_state *TLS, int limit, int offset, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, int size, tgl_peer_id_t peers[], int last_msg_id[], int unread_count[]), void *callback_extra) {
+ struct get_dialogs_extra *E = talloc0 (sizeof (*E));
+ E->limit = limit;
+ E->offset = offset;
+ _tgl_do_get_dialog_list (TLS, E, callback, callback_extra);
+}
+/* }}} */
+
+int allow_send_os_version = 1;
+
+/* {{{ Send document file */
+
+static void out_peer_id (struct tgl_state *TLS, tgl_peer_id_t id) {
+ tgl_peer_t *U;
+ switch (tgl_get_peer_type (id)) {
+ case TGL_PEER_CHAT:
+ out_int (CODE_input_peer_chat);
+ out_int (tgl_get_peer_id (id));
+ break;
+ case TGL_PEER_USER:
+ U = tgl_peer_get (TLS, id);
+ if (U && U->user.access_hash) {
+ out_int (CODE_input_peer_foreign);
+ out_int (tgl_get_peer_id (id));
+ out_long (U->user.access_hash);
+ } else {
+ out_int (CODE_input_peer_contact);
+ out_int (tgl_get_peer_id (id));
+ }
+ break;
+ default:
+ assert (0);
+ }
+}
+
+static void send_part (struct tgl_state *TLS, struct send_file *f, void *callback, void *callback_extra);
+static int send_file_part_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ send_part (TLS, q->extra, q->callback, q->callback_extra);
+ return 0;
+}
+
+static int set_photo_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int))q->callback)(TLS, q->callback_extra, 1);
+ }
+ return 0;
+}
+
+static int send_file_part_on_error (struct tgl_state *TLS, struct query *q, int error_code, int error_len, const char *error) {
+ tgl_set_query_error (TLS, EPROTO, "RPC_CALL_FAIL %d: %.*s", error_code, error_len, error);
+
+ struct send_file *f = q->extra;
+ tfree_str (f->file_name);
+ tfree_str (f->caption);
+ if (!f->avatar) {
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int, struct tgl_message *))q->callback) (TLS, q->callback_extra, 0, 0);
+ }
+ } else {
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int))q->callback) (TLS, q->callback_extra, 0);
+ }
+ }
+ tfree (f, sizeof (*f));
+ return 0;
+}
+
+static struct query_methods send_file_part_methods = {
+ .on_answer = send_file_part_on_answer,
+ .on_error = send_file_part_on_error,
+ .type = TYPE_TO_PARAM(bool)
+};
+
+static struct query_methods set_photo_methods = {
+ .on_answer = set_photo_on_answer,
+ .on_error = q_void_on_error,
+ .type = TYPE_TO_PARAM(photos_photo)
+};
+
+static void send_avatar_end (struct tgl_state *TLS, struct send_file *f, void *callback, void *callback_extra) {
+ if (f->avatar > 0) {
+ out_int (CODE_messages_edit_chat_photo);
+ out_int (f->avatar);
+ out_int (CODE_input_chat_uploaded_photo);
+ if (f->size < (16 << 20)) {
+ out_int (CODE_input_file);
+ } else {
+ out_int (CODE_input_file_big);
+ }
+ out_long (f->id);
+ out_int (f->part_num);
+ out_string ("");
+ if (f->size < (16 << 20)) {
+ out_string ("");
+ }
+ out_int (CODE_input_photo_crop_auto);
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &send_msgs_methods, NULL, callback, callback_extra);
+ } else {
+ out_int (CODE_photos_upload_profile_photo);
+ if (f->size < (16 << 20)) {
+ out_int (CODE_input_file);
+ } else {
+ out_int (CODE_input_file_big);
+ }
+ out_long (f->id);
+ out_int (f->part_num);
+ char *s = f->file_name + strlen (f->file_name);
+ while (s >= f->file_name && *s != '/') { s --;}
+ out_string (s + 1);
+ if (f->size < (16 << 20)) {
+ out_string ("");
+ }
+ out_string ("profile photo");
+ out_int (CODE_input_geo_point_empty);
+ out_int (CODE_input_photo_crop_auto);
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &set_photo_methods, 0, callback, callback_extra);
+ }
+}
+
+
+static void send_file_unencrypted_end (struct tgl_state *TLS, struct send_file *f, void *callback, void *callback_extra) {
+ out_int (CODE_messages_send_media);
+ out_int ((f->reply ? 1 : 0));
+ out_peer_id (TLS, f->to_id);
+ if (f->reply) {
+ out_int (f->reply);
+ }
+ if (f->flags & TGL_SEND_MSG_FLAG_DOCUMENT_PHOTO) {
+ out_int (CODE_input_media_uploaded_photo);
+ } else {
+ if (f->thumb_id > 0) {
+ out_int (CODE_input_media_uploaded_thumb_document);
+ } else {
+ out_int (CODE_input_media_uploaded_document);
+ }
+ }
+
+ if (f->size < (16 << 20)) {
+ out_int (CODE_input_file);
+ } else {
+ out_int (CODE_input_file_big);
+ }
+
+ out_long (f->id);
+ out_int (f->part_num);
+ char *s = f->file_name + strlen (f->file_name);
+ while (s >= f->file_name && *s != '/') { s --;}
+ out_string (s + 1);
+ if (f->size < (16 << 20)) {
+ out_string ("");
+ }
+
+ if (!(f->flags & TGL_SEND_MSG_FLAG_DOCUMENT_PHOTO)) {
+ out_string (tg_mime_by_filename (f->file_name));
+
+ out_int (CODE_vector);
+ if (f->flags & TGLDF_IMAGE) {
+ if (f->flags & TGLDF_ANIMATED) {
+ out_int (2);
+ out_int (CODE_document_attribute_image_size);
+ out_int (f->w);
+ out_int (f->h);
+ out_int (CODE_document_attribute_animated);
+ } else {
+ out_int (1);
+ out_int (CODE_document_attribute_image_size);
+ out_int (f->w);
+ out_int (f->h);
+ }
+ } else if (f->flags & TGLDF_AUDIO) {
+ out_int (2);
+ out_int (CODE_document_attribute_audio);
+ out_int (f->duration);
+ out_int (CODE_document_attribute_filename);
+ out_string (s + 1);
+ } else if (f->flags & TGLDF_VIDEO) {
+ out_int (2);
+ out_int (CODE_document_attribute_video);
+ out_int (f->duration);
+ out_int (f->w);
+ out_int (f->h);
+ out_int (CODE_document_attribute_filename);
+ out_string (s + 1);
+ } else if (f->flags & TGLDF_STICKER) {
+ out_int (1);
+ out_int (CODE_document_attribute_sticker);
+ } else {
+ out_int (1);
+ out_int (CODE_document_attribute_filename);
+ out_string (s + 1);
+ }
+
+ if (f->thumb_id > 0) {
+ out_int (CODE_input_file);
+ out_long (f->thumb_id);
+ out_int (1);
+ out_string ("thumb.jpg");
+ out_string ("");
+ }
+ } else {
+ out_string (f->caption ? f->caption : "");
+ }
+
+
+ struct messages_send_extra *E = talloc0 (sizeof (*E));
+ tglt_secure_random (&E->id, 8);
+ out_long (E->id);
+
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &send_msgs_methods, E, callback, callback_extra);
+ tfree_str (f->file_name);
+ tfree_str (f->caption);
+ tfree (f, sizeof (*f));
+}
+
+static void send_file_end (struct tgl_state *TLS, struct send_file *f, void *callback, void *callback_extra) {
+ TLS->cur_uploaded_bytes -= f->size;
+ TLS->cur_uploading_bytes -= f->size;
+ clear_packet ();
+
+ if (f->avatar) {
+ send_avatar_end (TLS, f, callback, callback_extra);
+ return;
+ }
+ if (!f->encr) {
+ send_file_unencrypted_end (TLS, f, callback, callback_extra);
+ return;
+ }
+ send_file_encrypted_end (TLS, f, callback, callback_extra);
+ return;
+}
+
+static void send_part (struct tgl_state *TLS, struct send_file *f, void *callback, void *callback_extra) {
+ if (f->fd >= 0) {
+ if (!f->part_num) {
+ TLS->cur_uploading_bytes += f->size;
+ }
+ clear_packet ();
+ if (f->size < (16 << 20)) {
+ out_int (CODE_upload_save_file_part);
+ out_long (f->id);
+ out_int (f->part_num ++);
+ } else {
+ out_int (CODE_upload_save_big_file_part);
+ out_long (f->id);
+ out_int (f->part_num ++);
+ out_int ((f->size + f->part_size - 1) / f->part_size);
+ }
+ static char buf[512 << 10];
+#ifdef _WIN32
+ int x = _read(f->fd, buf, f->part_size);
+#else
+ int x = read (f->fd, buf, f->part_size);
+#endif
+ assert (x > 0);
+ f->offset += x;
+ TLS->cur_uploaded_bytes += x;
+
+ if (f->encr) {
+ if (x & 15) {
+ assert (f->offset == f->size);
+ tglt_secure_random (buf + x, (-x) & 15);
+ x = (x + 15) & ~15;
+ }
+
+ AES_KEY aes_key;
+ AES_set_encrypt_key (f->key, 256, &aes_key);
+ AES_ige_encrypt ((void *)buf, (void *)buf, x, &aes_key, f->iv, 1);
+ memset (&aes_key, 0, sizeof (aes_key));
+ }
+ out_cstring (buf, x);
+ vlogprintf (E_DEBUG, "offset=%"_PRINTF_INT64_"d size=%"_PRINTF_INT64_"d\n", f->offset, f->size);
+ if (f->offset == f->size) {
+ close (f->fd);
+ f->fd = -1;
+ } else {
+ assert (f->part_size == x);
+ }
+ //update_prompt ();
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &send_file_part_methods, f, callback, callback_extra);
+ } else {
+ send_file_end (TLS, f, callback, callback_extra);
+ }
+}
+
+static void send_file_thumb (struct tgl_state *TLS, struct send_file *f, const void *thumb_data, int thumb_len, void *callback, void *callback_extra) {
+ clear_packet ();
+ f->thumb_id = lrand48 () * (1ll << 32) + lrand48 ();
+ out_int (CODE_upload_save_file_part);
+ out_long (f->thumb_id);
+ out_int (0);
+ out_cstring ((void *)thumb_data, thumb_len);
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &send_file_part_methods, f, callback, callback_extra);
+}
+
+
+static void _tgl_do_send_photo (struct tgl_state *TLS, tgl_peer_id_t to_id, const char *file_name, int avatar, int w, int h, int duration, const void *thumb_data, int thumb_len, const char *caption, int caption_len, unsigned long long flags, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra) {
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ int fd = 0;
+ errno_t err = _sopen_s(&fd, file_name, _O_RDONLY | _O_BINARY, _SH_DENYNO, _S_IREAD | _S_IWRITE);
+ if(err != 0) {
+ tgl_set_query_error (TLS, EBADF, "Can not open file: %s", GetErrnoStr (errno));
+#elif defined(WIN32) || defined(_WIN32)
+ int fd = open(file_name, O_RDONLY | O_BINARY);
+ if (fd < 0) {
+ tgl_set_query_error (TLS, EBADF, "Can not open file: %s", GetErrnoStr (errno));
+#else
+ int fd = open (file_name, O_RDONLY);
+ if (fd < 0) {
+ tgl_set_query_error (TLS, EBADF, "Can not open file: %m");
+#endif
+ if (!avatar) {
+ if (callback) {
+ callback (TLS, callback_extra, 0, 0);
+ }
+ } else {
+ if (callback) {
+ ((void (*)(struct tgl_state *, void *, int))callback) (TLS, callback_extra, 0);
+ }
+ }
+ return;
+ }
+ struct stat buf;
+ fstat (fd, &buf);
+ long long size = buf.st_size;
+ if (size <= 0) {
+ tgl_set_query_error (TLS, EBADF, "File is empty");
+ close (fd);
+ if (!avatar) {
+ if (callback) {
+ callback (TLS, callback_extra, 0, 0);
+ }
+ } else {
+ if (callback) {
+ ((void (*)(struct tgl_state *, void *, int))callback) (TLS, callback_extra, 0);
+ }
+ }
+ return;
+ }
+ struct send_file *f = talloc0 (sizeof (*f));
+ f->fd = fd;
+ f->size = size;
+ f->offset = 0;
+ f->part_num = 0;
+ f->avatar = avatar;
+ f->reply = flags >> 32;
+ int tmp = ((size + 2999) / 3000);
+ f->part_size = (1 << 14);
+ while (f->part_size < tmp) {
+ f->part_size *= 2;
+ }
+ f->flags = flags;
+
+ if (f->part_size > (512 << 10)) {
+ close (fd);
+ tgl_set_query_error (TLS, E2BIG, "File is too big");
+ tfree (f, sizeof (*f));
+ if (!avatar) {
+ if (callback) {
+ callback (TLS, callback_extra, 0, 0);
+ }
+ } else {
+ if (callback) {
+ ((void (*)(struct tgl_state *, void *, int))callback) (TLS, callback_extra, 0);
+ }
+ }
+ return;
+ }
+
+ tglt_secure_random (&f->id, 8);
+ f->to_id = to_id;
+ f->flags = flags;
+ f->file_name = tstrdup (file_name);
+ f->w = w;
+ f->h = h;
+ f->duration = duration;
+ f->caption = caption ? tstrdup (caption) : tstrdup ("");
+
+ if (tgl_get_peer_type (f->to_id) == TGL_PEER_ENCR_CHAT) {
+ f->encr = 1;
+ f->iv = talloc (32);
+ tglt_secure_random (f->iv, 32);
+ f->init_iv = talloc (32);
+ memcpy (f->init_iv, f->iv, 32);
+ f->key = talloc (32);
+ tglt_secure_random (f->key, 32);
+ }
+
+ if (!f->encr && f->flags != -1 && thumb_len > 0) {
+ send_file_thumb (TLS, f, thumb_data, thumb_len, callback, callback_extra);
+ } else {
+ send_part (TLS, f, callback, callback_extra);
+ }
+}
+
+void tgl_do_send_document (struct tgl_state *TLS, tgl_peer_id_t to_id, const char *file_name, const char *caption, int caption_len, unsigned long long flags, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra) {
+ if (flags & TGL_SEND_MSG_FLAG_DOCUMENT_AUTO) {
+ char *mime_type = tg_mime_by_filename (file_name);
+ if (strcmp (mime_type, "image/gif") == 0) {
+ flags |= TGL_SEND_MSG_FLAG_DOCUMENT_ANIMATED;
+ } else if (!memcmp (mime_type, "image/", 6)) {
+ flags |= TGL_SEND_MSG_FLAG_DOCUMENT_PHOTO;
+ } else if (!memcmp (mime_type, "video/", 6)) {
+ flags |= TGLDF_VIDEO;
+ } else if (!memcmp (mime_type, "audio/", 6)) {
+ flags |= TGLDF_AUDIO;
+ }
+ }
+ _tgl_do_send_photo (TLS, to_id, file_name, 0, 100, 100, 100, 0, 0, caption, caption_len, flags, callback, callback_extra);
+}
+
+void tgl_do_reply_document (struct tgl_state *TLS, int reply_id, const char *file_name, const char *caption, int caption_len, unsigned long long flags, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra) {
+ struct tgl_message *M = tgl_message_get (TLS, reply_id);
+ if (!M || !(M->flags & TGLMF_CREATED) || (M->flags & TGLMF_ENCRYPTED)) {
+ if (!M || !(M->flags & TGLMF_CREATED)) {
+ tgl_set_query_error (TLS, EINVAL, "unknown message");
+ } else {
+ tgl_set_query_error (TLS, EINVAL, "can not reply on message from secret chat");
+ }
+ if (callback) {
+ callback (TLS, callback_extra, 0, 0);
+ }
+ return;
+ }
+
+ tgl_peer_id_t id = M->to_id;
+ if (tgl_get_peer_type (id) == TGL_PEER_USER && tgl_get_peer_id (id) == TLS->our_id) {
+ id = M->from_id;
+ }
+
+ tgl_do_send_document (TLS, id, file_name, caption, caption_len, flags | TGL_SEND_MSG_FLAG_REPLY (reply_id), callback, callback_extra);
+}
+
+void tgl_do_set_chat_photo (struct tgl_state *TLS, tgl_peer_id_t chat_id, const char *file_name, void (*callback)(struct tgl_state *TLS,void *callback_extra, int success), void *callback_extra) {
+ assert (tgl_get_peer_type (chat_id) == TGL_PEER_CHAT);
+ _tgl_do_send_photo (TLS, chat_id, file_name, tgl_get_peer_id (chat_id), 0, 0, 0, 0, 0, NULL, 0, TGL_SEND_MSG_FLAG_DOCUMENT_PHOTO, (void *)callback, callback_extra);
+}
+
+void tgl_do_set_profile_photo (struct tgl_state *TLS, const char *file_name, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra) {
+ _tgl_do_send_photo (TLS, TGL_MK_USER(TLS->our_id), file_name, -1, 0, 0, 0, 0, 0, NULL, 0, TGL_SEND_MSG_FLAG_DOCUMENT_PHOTO, (void *)callback, callback_extra);
+}
+/* }}} */
+
+/* {{{ Profile name */
+
+int set_profile_name_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tl_ds_user *DS_U = D;
+ struct tgl_user *U = tglf_fetch_alloc_user_new (TLS, DS_U);
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int, struct tgl_user *))q->callback) (TLS, q->callback_extra, 1, U);
+ }
+ return 0;
+}
+
+static struct query_methods set_profile_name_methods = {
+ .on_answer = set_profile_name_on_answer,
+ .on_error = q_ptr_on_error,
+ .type = TYPE_TO_PARAM(user)
+};
+
+void tgl_do_set_profile_name (struct tgl_state *TLS, const char *first_name, int first_name_len, const char *last_name, int last_name_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_user *U), void *callback_extra) {
+ clear_packet ();
+ out_int (CODE_account_update_profile);
+ out_cstring (first_name, first_name_len);
+ out_cstring (last_name, last_name_len);
+
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &set_profile_name_methods, 0, callback, callback_extra);
+}
+
+void tgl_do_set_username (struct tgl_state *TLS, const char *username, int username_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_user *U), void *callback_extra) {
+ clear_packet ();
+ out_int (CODE_account_update_username);
+ out_cstring (username, username_len);
+
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &set_profile_name_methods, 0, callback, callback_extra);
+}
+/* }}} */
+
+/* {{{ Contacts search */
+
+int contact_search_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tl_ds_user *DS_U = D;
+
+ struct tgl_user *U = tglf_fetch_alloc_user_new (TLS, DS_U);
+
+ if (q->callback) {
+ ((void (*)(struct tgl_state *,void *, int, struct tgl_user *))q->callback) (TLS, q->callback_extra, 1, U);
+ }
+
+ return 0;
+}
+
+static struct query_methods contact_search_methods = {
+ .on_answer = contact_search_on_answer,
+ .on_error = q_list_on_error,
+ .type = TYPE_TO_PARAM(user)
+};
+
+void tgl_do_contact_search (struct tgl_state *TLS, const char *name, int name_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_user *U), void *callback_extra) {
+ clear_packet ();
+ out_int (CODE_contacts_resolve_username);
+ out_cstring (name, name_len);
+
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &contact_search_methods, 0, callback, callback_extra);
+}
+/* }}} */
+
+/* {{{ Forward */
+
+static int send_msgs_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ tglu_work_any_updates_new (TLS, 1, D);
+ tglu_work_any_updates_new (TLS, 0, D);
+
+ struct messages_send_extra *E = q->extra;
+
+ if (!E) {
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int))q->callback) (TLS, q->callback_extra, 1);
+ }
+ } else if (E->multi) {
+ struct tgl_message **ML = talloc (sizeof (void *) * E->count);
+ int count = E->count;
+ int i;
+ for (i = 0; i < count; i++) {
+ int y = tgls_get_local_by_random (TLS, E->list[i]);
+ ML[i] = tgl_message_get (TLS, y);
+ }
+ tfree (E->list, sizeof (long long) * count);
+ tfree (E, sizeof (*E));
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int, int, struct tgl_message **))q->callback) (TLS, q->callback_extra, 1, count, ML);
+ }
+ tfree (ML, sizeof (void *) * count);
+ } else {
+ int y = tgls_get_local_by_random (TLS, E->id);
+ struct tgl_message *M = tgl_message_get (TLS, y);
+ tfree (E, sizeof (*E));
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int, struct tgl_message *))q->callback) (TLS, q->callback_extra, 1, M);
+ }
+ }
+ return 0;
+}
+
+static int send_msgs_on_error (struct tgl_state *TLS, struct query *q, int error_code, int error_len, const char *error) {
+ tgl_set_query_error (TLS, EPROTO, "RPC_CALL_FAIL %d: %.*s", error_code, error_len, error);
+ struct messages_send_extra *E = q->extra;
+
+ if (!E) {
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int))q->callback) (TLS, q->callback_extra, 0);
+ }
+ } else if (E->multi) {
+ int count = E->count;
+ tfree (E->list, sizeof (long long) * count);
+ tfree (E, sizeof (*E));
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int, int, struct tgl_message **))q->callback) (TLS, q->callback_extra, 0, 0, NULL);
+ }
+ } else {
+ tfree (E, sizeof (*E));
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int, struct tgl_message *))q->callback) (TLS, q->callback_extra, 0, NULL);
+ }
+ }
+ return 0;
+}
+
+static struct query_methods send_msgs_methods = {
+ .on_answer = send_msgs_on_answer,
+ .on_error = send_msgs_on_error,
+ .type = TYPE_TO_PARAM(updates)
+};
+
+void tgl_do_forward_messages (struct tgl_state *TLS, tgl_peer_id_t id, int n, const int ids[], unsigned long long flags, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, int count, struct tgl_message *ML[]), void *callback_extra) {
+ if (tgl_get_peer_type (id) == TGL_PEER_ENCR_CHAT) {
+ tgl_set_query_error (TLS, EINVAL, "can not forward messages to secret chats");
+ if (callback) {
+ callback (TLS, callback_extra, 0, 0, 0);
+ }
+ return;
+ }
+ clear_packet ();
+ out_int (CODE_messages_forward_messages);
+ out_peer_id (TLS, id);
+ out_int (CODE_vector);
+ out_int (n);
+ int i;
+ for (i = 0; i < n; i++) {
+ out_int (ids[i]);
+ }
+
+ struct messages_send_extra *E = talloc0 (sizeof (*E));
+ E->multi = 1;
+ E->count = n;
+ E->list = talloc (sizeof (long long) * n);
+ out_int (CODE_vector);
+ out_int (n);
+ for (i = 0; i < n; i++) {
+ tglt_secure_random (&E->list[i], 8);
+ out_long (E->list[i]);
+ }
+
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &send_msgs_methods, E, callback, callback_extra);
+}
+
+void tgl_do_forward_message (struct tgl_state *TLS, tgl_peer_id_t id, int msg_id, unsigned long long flags, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra) {
+ if (tgl_get_peer_type (id) == TGL_PEER_ENCR_CHAT) {
+ tgl_set_query_error (TLS, EINVAL, "can not forward messages to secret chats");
+ if (callback) {
+ callback (TLS, callback_extra, 0, 0);
+ }
+ return;
+ }
+ clear_packet ();
+ out_int (CODE_messages_forward_message);
+ out_peer_id (TLS, id);
+ out_int (msg_id);
+
+ struct messages_send_extra *E = talloc0 (sizeof (*E));
+ tglt_secure_random (&E->id, 8);
+ out_long (E->id);
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &send_msgs_methods, E, callback, callback_extra);
+}
+
+void tgl_do_send_contact (struct tgl_state *TLS, tgl_peer_id_t id, const char *phone, int phone_len, const char *first_name, int first_name_len, const char *last_name, int last_name_len, unsigned long long flags, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra) {
+ if (tgl_get_peer_type (id) == TGL_PEER_ENCR_CHAT) {
+ tgl_set_query_error (TLS, EINVAL, "can not send contact to secret chat");
+ if (callback) {
+ callback (TLS, callback_extra, 0, 0);
+ }
+ return;
+ }
+
+ int reply_id = flags >> 32;
+
+ clear_packet ();
+ out_int (CODE_messages_send_media);
+ out_int (reply_id ? 1 : 0);
+ if (reply_id) { out_int (reply_id); }
+ out_peer_id (TLS, id);
+ out_int (CODE_input_media_contact);
+ out_cstring (phone, phone_len);
+ out_cstring (first_name, first_name_len);
+ out_cstring (last_name, last_name_len);
+
+ struct messages_send_extra *E = talloc0 (sizeof (*E));
+ tglt_secure_random (&E->id, 8);
+ out_long (E->id);
+
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &send_msgs_methods, E, callback, callback_extra);
+}
+
+
+void tgl_do_reply_contact (struct tgl_state *TLS, int reply_id, const char *phone, int phone_len, const char *first_name, int first_name_len, const char *last_name, int last_name_len, unsigned long long flags, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra) {
+ struct tgl_message *M = tgl_message_get (TLS, reply_id);
+ if (!M || !(M->flags & TGLMF_CREATED) || (M->flags & TGLMF_ENCRYPTED)) {
+ if (!M || !(M->flags & TGLMF_CREATED)) {
+ tgl_set_query_error (TLS, EINVAL, "unknown message");
+ } else {
+ tgl_set_query_error (TLS, EINVAL, "can not reply on message from secret chat");
+ }
+ if (callback) {
+ callback (TLS, callback_extra, 0, 0);
+ }
+ return;
+ }
+
+ tgl_peer_id_t id = M->to_id;
+ if (tgl_get_peer_type (id) == TGL_PEER_USER && tgl_get_peer_id (id) == TLS->our_id) {
+ id = M->from_id;
+ }
+
+ tgl_do_send_contact (TLS, id, phone, phone_len, first_name, first_name_len, last_name, last_name_len, flags | TGL_SEND_MSG_FLAG_REPLY (reply_id), callback, callback_extra);
+}
+
+void tgl_do_forward_media (struct tgl_state *TLS, tgl_peer_id_t id, int n, unsigned long long flags, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra) {
+ if (tgl_get_peer_type (id) == TGL_PEER_ENCR_CHAT) {
+ tgl_set_query_error (TLS, EINVAL, "can not forward messages to secret chats");
+ if (callback) {
+ callback (TLS, callback_extra, 0, 0);
+ }
+ return;
+ }
+ struct tgl_message *M = tgl_message_get (TLS, n);
+ if (!M || !(M->flags & TGLMF_CREATED) || (M->flags & TGLMF_ENCRYPTED)) {
+ if (!M || !(M->flags & TGLMF_CREATED)) {
+ tgl_set_query_error (TLS, EINVAL, "unknown message");
+ } else {
+ tgl_set_query_error (TLS, EINVAL, "can not forward message from secret chat");
+ }
+ if (callback) {
+ callback (TLS, callback_extra, 0, 0);
+ }
+ return;
+ }
+ if (M->media.type != tgl_message_media_photo && M->media.type != tgl_message_media_document) {
+ tgl_set_query_error (TLS, EINVAL, "can only forward photo/document");
+ if (callback) {
+ callback (TLS, callback_extra, 0, 0);
+ }
+ return;
+ }
+ clear_packet ();
+ out_int (CODE_messages_send_media);
+ out_peer_id (TLS, id);
+ switch (M->media.type) {
+ case tgl_message_media_photo:
+ assert (M->media.photo);
+ out_int (CODE_input_media_photo);
+ out_int (CODE_input_photo);
+ out_long (M->media.photo->id);
+ out_long (M->media.photo->access_hash);
+ break;
+ case tgl_message_media_document:
+ assert (M->media.document);
+ out_int (CODE_input_media_document);
+ out_int (CODE_input_document);
+ out_long (M->media.document->id);
+ out_long (M->media.document->access_hash);
+ break;
+ default:
+ assert (0);
+ }
+
+ struct messages_send_extra *E = talloc0 (sizeof (*E));
+ tglt_secure_random (&E->id, 8);
+ out_long (E->id);
+
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &send_msgs_methods, E, callback, callback_extra);
+}
+/* }}} */
+
+/* {{{ Send location */
+
+void tgl_do_send_location (struct tgl_state *TLS, tgl_peer_id_t id, double latitude, double longitude, unsigned long long flags, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra) {
+ if (tgl_get_peer_type (id) == TGL_PEER_ENCR_CHAT) {
+ tgl_do_send_location_encr (TLS, id, latitude, longitude, flags, callback, callback_extra);
+ } else {
+ int reply_id = flags >> 32;
+ clear_packet ();
+ out_int (CODE_messages_send_media);
+ out_int (reply_id ? 1 : 0);
+ if (reply_id) { out_int (reply_id); }
+ out_peer_id (TLS, id);
+ out_int (CODE_input_media_geo_point);
+ out_int (CODE_input_geo_point);
+ out_double (latitude);
+ out_double (longitude);
+
+ struct messages_send_extra *E = talloc0 (sizeof (*E));
+ tglt_secure_random (&E->id, 8);
+ out_long (E->id);
+
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &send_msgs_methods, E, callback, callback_extra);
+ }
+}
+
+void tgl_do_reply_location (struct tgl_state *TLS, int reply_id, double latitude, double longitude, unsigned long long flags, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra) {
+ struct tgl_message *M = tgl_message_get (TLS, reply_id);
+ if (!M || !(M->flags & TGLMF_CREATED) || (M->flags & TGLMF_ENCRYPTED)) {
+ if (!M || !(M->flags & TGLMF_CREATED)) {
+ tgl_set_query_error (TLS, EINVAL, "unknown message");
+ } else {
+ tgl_set_query_error (TLS, EINVAL, "can not forward message from secret chat");
+ }
+ if (callback) {
+ callback (TLS, callback_extra, 0, 0);
+ }
+ return;
+ }
+
+ tgl_peer_id_t id = M->to_id;
+ if (tgl_get_peer_type (id) == TGL_PEER_USER && tgl_get_peer_id (id) == TLS->our_id) {
+ id = M->from_id;
+ }
+
+ tgl_do_send_location (TLS, id, latitude, longitude, flags | TGL_SEND_MSG_FLAG_REPLY (reply_id), callback, callback_extra);
+}
+/* }}} */
+
+/* {{{ Rename chat */
+
+void tgl_do_rename_chat (struct tgl_state *TLS, tgl_peer_id_t id, const char *name, int name_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra) {
+ clear_packet ();
+ out_int (CODE_messages_edit_chat_title);
+ assert (tgl_get_peer_type (id) == TGL_PEER_CHAT);
+ out_int (tgl_get_peer_id (id));
+ out_cstring (name, name_len);
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &send_msgs_methods, 0, callback, callback_extra);
+}
+/* }}} */
+
+/* {{{ Chat info */
+
+static int chat_info_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tgl_chat *C = tglf_fetch_alloc_chat_full_new (TLS, D);
+ //print_chat_info (C);
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int, struct tgl_chat *))q->callback) (TLS, q->callback_extra, 1, C);
+ }
+ return 0;
+}
+
+static struct query_methods chat_info_methods = {
+ .on_answer = chat_info_on_answer,
+ .on_error = q_ptr_on_error,
+ .type = TYPE_TO_PARAM(messages_chat_full)
+};
+
+void tgl_do_get_chat_info (struct tgl_state *TLS, tgl_peer_id_t id, int offline_mode, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_chat *C), void *callback_extra) {
+ if (offline_mode) {
+ tgl_peer_t *C = tgl_peer_get (TLS, id);
+ if (!C) {
+ tgl_set_query_error (TLS, EINVAL, "unknown chat id");
+ if (callback) {
+ callback (TLS, callback_extra, 0, 0);
+ }
+ } else {
+ //print_chat_info (&C->chat);
+ if (callback) {
+ callback (TLS, callback_extra, 1, &C->chat);
+ }
+ }
+ return;
+ }
+ clear_packet ();
+ out_int (CODE_messages_get_full_chat);
+ assert (tgl_get_peer_type (id) == TGL_PEER_CHAT);
+ out_int (tgl_get_peer_id (id));
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &chat_info_methods, 0, callback, callback_extra);
+}
+/* }}} */
+
+/* {{{ User info */
+
+static int user_info_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tgl_user *U = tglf_fetch_alloc_user_full_new (TLS, D);
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int, struct tgl_user *))q->callback) (TLS, q->callback_extra, 1, U);
+ }
+ return 0;
+}
+
+static struct query_methods user_info_methods = {
+ .on_answer = user_info_on_answer,
+ .on_error = q_ptr_on_error,
+ .type = TYPE_TO_PARAM(user_full)
+};
+
+void tgl_do_get_user_info (struct tgl_state *TLS, tgl_peer_id_t id, int offline_mode, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_user *U), void *callback_extra) {
+ if (tgl_get_peer_type (id) != TGL_PEER_USER) {
+ tgl_set_query_error (TLS, EINVAL, "id should be user id");
+ if (callback) {
+ callback (TLS, callback_extra, 0, NULL);
+ }
+ return;
+ }
+ if (offline_mode) {
+ tgl_peer_t *C = tgl_peer_get (TLS, id);
+ if (!C) {
+ tgl_set_query_error (TLS, EINVAL, "unknown user id");
+ if (callback) {
+ callback (TLS, callback_extra, 0, 0);
+ }
+ } else {
+ if (callback) {
+ callback (TLS, callback_extra, 1, &C->user);
+ }
+ }
+ return;
+ }
+ clear_packet ();
+ out_int (CODE_users_get_full_user);
+ assert (tgl_get_peer_type (id) == TGL_PEER_USER);
+ tgl_peer_t *U = tgl_peer_get (TLS, id);
+ if (U && U->user.access_hash) {
+ out_int (CODE_input_user_foreign);
+ out_int (tgl_get_peer_id (id));
+ out_long (U->user.access_hash);
+ } else {
+ out_int (CODE_input_user_contact);
+ out_int (tgl_get_peer_id (id));
+ }
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &user_info_methods, 0, callback, callback_extra);
+}
+
+static void resend_query_cb (struct tgl_state *TLS, void *_q, int success) {
+ assert (success);
+
+ bl_do_dc_signed (TLS, TLS->DC_working->id);
+
+ struct query *q = _q;
+
+ clear_packet ();
+ out_int (CODE_users_get_full_user);
+ out_int (CODE_input_user_self);
+ tglq_send_query (TLS, q->DC, packet_ptr - packet_buffer, packet_buffer, &user_info_methods, 0, q->callback, q->callback_extra);
+
+ tfree (q->data, 4 * q->data_len);
+ TLS->timer_methods->free (q->ev);
+ tfree (q, sizeof (*q));
+}
+/* }}} */
+
+/* {{{ Load photo/video */
+struct download {
+ int offset;
+ int size;
+ long long volume;
+ long long secret;
+ long long access_hash;
+ int local_id;
+ int dc;
+ int next;
+ int fd;
+ char *name;
+ char *ext;
+ long long id;
+ unsigned char *iv;
+ unsigned char *key;
+ int type;
+ int refcnt;
+};
+
+
+static void end_load (struct tgl_state *TLS, struct download *D, void *callback, void *callback_extra) {
+ TLS->cur_downloading_bytes -= D->size;
+ TLS->cur_downloaded_bytes -= D->size;
+
+ if (D->fd >= 0) {
+ close (D->fd);
+ }
+
+ if (callback) {
+ ((void (*)(struct tgl_state *, void *, int, char *))callback) (TLS, callback_extra, 1, D->name);
+ }
+
+ if (D->iv) {
+ tfree_secure (D->iv, 32);
+ }
+ tfree_str (D->name);
+ tfree (D, sizeof (*D));
+}
+
+static void load_next_part (struct tgl_state *TLS, struct download *D, void *callback, void *callback_extra);
+static int download_on_answer (struct tgl_state *TLS, struct query *q, void *DD) {
+ struct tl_ds_upload_file *DS_UF = DD;
+
+ struct download *D = q->extra;
+ if (D->fd == -1) {
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ errno_t err = _sopen_s(&D->fd, D->name, O_CREAT | O_WRONLY | _O_BINARY, _SH_DENYNO, _S_IREAD | _S_IWRITE);
+ if (err != 0) {
+ tgl_set_query_error (TLS, EBADF, "Can not open file for writing: %s", GetErrnoStr (errno));
+#elif defined(WIN32) || defined(_WIN32)
+ D->fd = open(D->name, O_CREAT | O_WRONLY | O_BINARY, 0640);
+ if (D->fd < 0) {
+ tgl_set_query_error (TLS, EBADF, "Can not open file for writing: %s", GetErrnoStr (errno));
+#else
+ D->fd = open (D->name, O_CREAT | O_WRONLY, 0640);
+ if (D->fd < 0) {
+ tgl_set_query_error (TLS, EBADF, "Can not open file for writing: %m");
+#endif
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int, char *))q->callback) (TLS, q->callback_extra, 0, NULL);
+ }
+
+ if (D->iv) {
+ tfree_secure (D->iv, 32);
+ }
+ tfree_str (D->name);
+ if (D->ext) {
+ tfree_str (D->ext);
+ }
+ tfree (D, sizeof (*D));
+ return 0;
+ }
+ }
+
+ int len = DS_UF->bytes->len;
+ TLS->cur_downloaded_bytes += len;
+ //update_prompt ();
+
+ if (D->iv) {
+ assert (!(len & 15));
+ void *ptr = DS_UF->bytes->data;
+
+ AES_KEY aes_key;
+ AES_set_decrypt_key (D->key, 256, &aes_key);
+ AES_ige_encrypt (ptr, ptr, len, &aes_key, D->iv, 0);
+ memset (&aes_key, 0, sizeof (aes_key));
+ if (len > D->size - D->offset) {
+ len = D->size - D->offset;
+ }
+ assert (write (D->fd, ptr, len) == len);
+ } else {
+ assert (write (D->fd, DS_UF->bytes->data, len) == len);
+ }
+
+ D->offset += len;
+ D->refcnt --;
+ if (D->offset < D->size) {
+ load_next_part (TLS, D, q->callback, q->callback_extra);
+ return 0;
+ } else {
+ if (!D->refcnt) {
+ end_load (TLS, D, q->callback, q->callback_extra);
+ }
+ return 0;
+ }
+}
+
+static int download_on_error (struct tgl_state *TLS, struct query *q, int error_code, int error_len, const char *error) {
+ tgl_set_query_error (TLS, EPROTO, "RPC_CALL_FAIL %d: %.*s", error_code, error_len, error);
+
+ struct download *D = q->extra;
+ if (D->fd >= 0) {
+ close (D->fd);
+ }
+
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int, char *))q->callback) (TLS, q->callback_extra, 0, NULL);
+ }
+
+ if (D->iv) {
+ tfree_secure (D->iv, 32);
+ }
+ tfree_str (D->name);
+ if (D->ext) {
+ tfree_str (D->ext);
+ }
+ tfree (D, sizeof (*D));
+ return 0;
+}
+
+static struct query_methods download_methods = {
+ .on_answer = download_on_answer,
+ .on_error = download_on_error,
+ .type = TYPE_TO_PARAM(upload_file)
+};
+
+static void load_next_part (struct tgl_state *TLS, struct download *D, void *callback, void *callback_extra) {
+ if (!D->offset) {
+ static char buf[PATH_MAX];
+ int l;
+ if (!D->id) {
+ l = tsnprintf (buf, sizeof (buf), "%s/download_%"_PRINTF_INT64_"d_%d.jpg", TLS->downloads_directory, D->volume, D->local_id);
+ } else {
+ if (D->ext) {
+ l = tsnprintf (buf, sizeof (buf), "%s/download_%"_PRINTF_INT64_"d.%s", TLS->downloads_directory, D->id, D->ext);
+ } else {
+ l = tsnprintf (buf, sizeof (buf), "%s/download_%"_PRINTF_INT64_"d", TLS->downloads_directory, D->id);
+ }
+ }
+ if (l >= (int) sizeof (buf)) {
+ vlogprintf (E_ERROR, "Download filename is too long");
+ assert (0);
+ }
+ D->name = tstrdup (buf);
+ struct stat st;
+ if (stat (buf, &st) >= 0) {
+ D->offset = st.st_size;
+ if (D->offset >= D->size) {
+ TLS->cur_downloading_bytes += D->size;
+ TLS->cur_downloaded_bytes += D->offset;
+ vlogprintf (E_NOTICE, "Already downloaded\n");
+ end_load (TLS, D, callback, callback_extra);
+ return;
+ }
+ }
+
+ TLS->cur_downloading_bytes += D->size;
+ TLS->cur_downloaded_bytes += D->offset;
+ //update_prompt ();
+ }
+ D->refcnt ++;
+ clear_packet ();
+ out_int (CODE_upload_get_file);
+ if (!D->id) {
+ out_int (CODE_input_file_location);
+ out_long (D->volume);
+ out_int (D->local_id);
+ out_long (D->secret);
+ } else {
+ if (D->iv) {
+ out_int (CODE_input_encrypted_file_location);
+ } else {
+ out_int (D->type);
+ }
+ out_long (D->id);
+ out_long (D->access_hash);
+ }
+ out_int (D->offset);
+ out_int (D->size ? (1 << 14) : (1 << 19));
+ tglq_send_query (TLS, TLS->DC_list[D->dc], packet_ptr - packet_buffer, packet_buffer, &download_methods, D, callback, callback_extra);
+ //tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &download_methods, D);
+}
+
+void tgl_do_load_photo_size (struct tgl_state *TLS, struct tgl_photo_size *P, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, const char *filename), void *callback_extra) {
+ if (!P->loc.dc) {
+ vlogprintf (E_WARNING, "Bad video thumb\n");
+ if (callback) {
+ callback (TLS, callback_extra, 0, 0);
+ }
+ return;
+ }
+
+ assert (P);
+ struct download *D = talloc0 (sizeof (*D));
+ D->id = 0;
+ D->offset = 0;
+ D->size = P->size;
+ D->volume = P->loc.volume;
+ D->dc = P->loc.dc;
+ D->local_id = P->loc.local_id;
+ D->secret = P->loc.secret;
+ D->name = 0;
+ D->fd = -1;
+ load_next_part (TLS, D, callback, callback_extra);
+}
+
+void tgl_do_load_file_location (struct tgl_state *TLS, struct tgl_file_location *P, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, const char *filename), void *callback_extra) {
+ if (!P->dc) {
+ tgl_set_query_error (TLS, EINVAL, "Bad file location");
+ if (callback) {
+ callback (TLS, callback_extra, 0, 0);
+ }
+ return;
+ }
+
+ assert (P);
+ struct download *D = talloc0 (sizeof (*D));
+ D->id = 0;
+ D->offset = 0;
+ D->size = 0;
+ D->volume = P->volume;
+ D->dc = P->dc;
+ D->local_id = P->local_id;
+ D->secret = P->secret;
+ D->name = 0;
+ D->fd = -1;
+ load_next_part (TLS, D, callback, callback_extra);
+}
+
+void tgl_do_load_photo (struct tgl_state *TLS, struct tgl_photo *photo, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, const char *filename), void *callback_extra) {
+ if (!photo->sizes_num) {
+ tgl_set_query_error (TLS, EINVAL, "Bad photo (no photo sizes");
+ if (callback) {
+ callback (TLS, callback_extra, 0, 0);
+ }
+ return;
+ }
+ int max = -1;
+ int maxi = 0;
+ int i;
+ for (i = 0; i < photo->sizes_num; i++) {
+ if (photo->sizes[i].w + photo->sizes[i].h > max) {
+ max = photo->sizes[i].w + photo->sizes[i].h;
+ maxi = i;
+ }
+ }
+ tgl_do_load_photo_size (TLS, &photo->sizes[maxi], callback, callback_extra);
+}
+
+void tgl_do_load_document_thumb (struct tgl_state *TLS, struct tgl_document *video, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, const char *filename), void *callback_extra) {
+ tgl_do_load_photo_size (TLS, &video->thumb, callback, callback_extra);
+}
+
+static void _tgl_do_load_document (struct tgl_state *TLS, struct tgl_document *V, struct download *D, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, const char *filename), void *callback_extra) {
+ assert (V);
+ D->offset = 0;
+ D->size = V->size;
+ D->id = V->id;
+ D->access_hash = V->access_hash;
+ D->dc = V->dc_id;
+ D->name = 0;
+ D->fd = -1;
+
+ if (V->mime_type) {
+ char *r = tg_extension_by_mime (V->mime_type);
+ if (r) {
+ D->ext = tstrdup (r);
+ }
+ }
+ load_next_part (TLS, D, callback, callback_extra);
+}
+
+void tgl_do_load_document (struct tgl_state *TLS, struct tgl_document *V, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, const char *filename), void *callback_extra) {
+
+ struct download *D = talloc0 (sizeof (*D));
+ D->type = CODE_input_document_file_location;
+
+ _tgl_do_load_document (TLS, V, D, callback, callback_extra);
+}
+
+void tgl_do_load_video (struct tgl_state *TLS, struct tgl_document *V, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, const char *filename), void *callback_extra) {
+
+ struct download *D = talloc0 (sizeof (*D));
+ D->type = CODE_input_video_file_location;
+
+ _tgl_do_load_document (TLS, V, D, callback, callback_extra);
+}
+
+void tgl_do_load_audio (struct tgl_state *TLS, struct tgl_document *V, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, const char *filename), void *callback_extra) {
+
+ struct download *D = talloc0 (sizeof (*D));
+ D->type = CODE_input_audio_file_location;
+
+ _tgl_do_load_document (TLS, V, D, callback, callback_extra);
+}
+
+void tgl_do_load_encr_document (struct tgl_state *TLS, struct tgl_encr_document *V, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, const char *filename), void *callback_extra) {
+ assert (V);
+ struct download *D = talloc0 (sizeof (*D));
+ D->offset = 0;
+ D->size = V->size;
+ D->id = V->id;
+ D->access_hash = V->access_hash;
+ D->dc = V->dc_id;
+ D->name = 0;
+ D->fd = -1;
+ D->key = V->key;
+ D->iv = talloc (32);
+ memcpy (D->iv, V->iv, 32);
+ if (V->mime_type) {
+ char *r = tg_extension_by_mime (V->mime_type);
+ if (r) {
+ D->ext = tstrdup (r);
+ }
+ }
+ load_next_part (TLS, D, callback, callback_extra);
+
+ unsigned char md5[16];
+ unsigned char str[64];
+ memcpy (str, V->key, 32);
+ memcpy (str + 32, V->iv, 32);
+ MD5 (str, 64, md5);
+ assert (V->key_fingerprint == ((*(int *)md5) ^ (*(int *)(md5 + 4))));
+}
+/* }}} */
+
+/* {{{ Export auth */
+
+static int import_auth_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tl_ds_auth_authorization *DS_U = D;
+ tglf_fetch_alloc_user_new (TLS, DS_U->user);
+
+ bl_do_dc_signed (TLS, ((struct tgl_dc *)q->extra)->id);
+
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int))q->callback) (TLS, q->callback_extra, 1);
+ }
+ return 0;
+}
+
+static struct query_methods import_auth_methods = {
+ .on_answer = import_auth_on_answer,
+ .on_error = fail_on_error,
+ .type = TYPE_TO_PARAM(auth_authorization)
+};
+
+static int export_auth_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tl_ds_auth_exported_authorization *DS_EA = D;
+
+ bl_do_set_our_id (TLS, DS_LVAL (DS_EA->id));
+
+
+ clear_packet ();
+ tgl_do_insert_header (TLS);
+ out_int (CODE_auth_import_authorization);
+ out_int (TLS->our_id);
+ out_cstring (DS_STR (DS_EA->bytes));
+ tglq_send_query (TLS, q->extra, packet_ptr - packet_buffer, packet_buffer, &import_auth_methods, q->extra, q->callback, q->callback_extra);
+ return 0;
+}
+
+static struct query_methods export_auth_methods = {
+ .on_answer = export_auth_on_answer,
+ .on_error = fail_on_error,
+ .type = TYPE_TO_PARAM(auth_exported_authorization)
+};
+
+void tgl_do_export_auth (struct tgl_state *TLS, int num, void (*callback) (struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra) {
+ clear_packet ();
+ out_int (CODE_auth_export_authorization);
+ out_int (num);
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &export_auth_methods, TLS->DC_list[num], callback, callback_extra);
+}
+/* }}} */
+
+/* {{{ Add contact */
+static int add_contact_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tl_ds_contacts_imported_contacts *DS_CIC = D;
+
+ if (DS_LVAL (DS_CIC->imported->cnt) > 0) {
+ vlogprintf (E_DEBUG, "Added successfully");
+ } else {
+ vlogprintf (E_DEBUG, "Not added");
+ }
+
+ int n = DS_LVAL (DS_CIC->users->cnt);
+
+ struct tgl_user **UL = talloc (n * sizeof (void *));
+ int i;
+ for (i = 0; i < n; i++) {
+ UL[i] = tglf_fetch_alloc_user_new (TLS, DS_CIC->users->data[i]);
+ }
+
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int, int, struct tgl_user **))q->callback) (TLS, q->callback_extra, 1, n, UL);
+ }
+ tfree (UL, n * sizeof (void *));
+ return 0;
+}
+
+static struct query_methods add_contact_methods = {
+ .on_answer = add_contact_on_answer,
+ .on_error = q_list_on_error,
+ .type = TYPE_TO_PARAM(contacts_imported_contacts)
+};
+
+void tgl_do_add_contact (struct tgl_state *TLS, const char *phone, int phone_len, const char *first_name, int first_name_len, const char *last_name, int last_name_len, int force, void (*callback)(struct tgl_state *TLS,void *callback_extra, int success, int size, struct tgl_user *users[]), void *callback_extra) {
+ clear_packet ();
+ out_int (CODE_contacts_import_contacts);
+ out_int (CODE_vector);
+ out_int (1);
+ out_int (CODE_input_phone_contact);
+ long long r;
+ tglt_secure_random (&r, 8);
+ out_long (r);
+ out_cstring (phone, phone_len);
+ out_cstring (first_name, first_name_len);
+ out_cstring (last_name, last_name_len);
+ out_int (force ? CODE_bool_true : CODE_bool_false);
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &add_contact_methods, 0, callback, callback_extra);
+}
+/* }}} */
+
+/* {{{ Del contact */
+static int del_contact_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int))q->callback) (TLS, q->callback_extra, 1);
+ }
+ return 0;
+}
+
+static struct query_methods del_contact_methods = {
+ .on_answer = del_contact_on_answer,
+ .on_error = q_void_on_error,
+ .type = TYPE_TO_PARAM(contacts_link)
+};
+
+void tgl_do_del_contact (struct tgl_state *TLS, tgl_peer_id_t id, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra) {
+ if (tgl_get_peer_type (id) != TGL_PEER_USER) {
+ tgl_set_query_error (TLS, EINVAL, "id should be user id");
+ if (callback) {
+ callback (TLS, callback_extra, 0);
+ }
+ return;
+ }
+ clear_packet ();
+ out_int (CODE_contacts_delete_contact);
+
+ tgl_peer_t *U = tgl_peer_get (TLS, id);
+ if (U && U->user.access_hash) {
+ out_int (CODE_input_user_foreign);
+ out_int (tgl_get_peer_id (id));
+ out_long (U->user.access_hash);
+ } else {
+ out_int (CODE_input_user_contact);
+ out_int (tgl_get_peer_id (id));
+ }
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &del_contact_methods, 0, callback, callback_extra);
+}
+/* }}} */
+
+/* {{{ Msg search */
+
+struct msg_search_extra {
+ struct tgl_message **ML;
+ int list_offset;
+ int list_size;
+ tgl_peer_id_t id;
+ int limit;
+ int offset;
+ int from;
+ int to;
+ int max_id;
+ char *query;
+};
+
+static void _tgl_do_msg_search (struct tgl_state *TLS, struct msg_search_extra *E, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, int size, struct tgl_message *list[]), void *callback_extra);
+
+static int msg_search_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tl_ds_messages_messages *DS_MM = D;
+
+ struct msg_search_extra *E = q->extra;
+
+ int n = DS_LVAL (DS_MM->messages->cnt);
+
+ if (E->list_size - E->list_offset < n) {
+ int new_list_size = 2 * E->list_size;
+ if (new_list_size - E->list_offset < n) {
+ new_list_size = n + E->list_offset;
+ }
+ E->ML = trealloc (E->ML, E->list_size * sizeof (void *), new_list_size * sizeof (void *));
+ assert (E->ML);
+ E->list_size = new_list_size;
+ }
+
+ int i;
+ for (i = 0; i < n; i++) {
+ E->ML[i + E->list_offset] = tglf_fetch_alloc_message_new (TLS, DS_MM->messages->data[i]);
+ }
+ E->list_offset += n;
+ E->offset += n;
+ E->limit -= n;
+ if (E->limit + E->offset >= DS_LVAL (DS_MM->count)) {
+ E->limit = DS_LVAL (DS_MM->count) - E->offset;
+ if (E->limit < 0) { E->limit = 0; }
+ }
+ assert (E->limit >= 0);
+
+ for (i = 0; i < DS_LVAL (DS_MM->chats->cnt); i++) {
+ tglf_fetch_alloc_chat_new (TLS, DS_MM->chats->data[i]);
+ }
+ for (i = 0; i < DS_LVAL (DS_MM->users->cnt); i++) {
+ tglf_fetch_alloc_user_new (TLS, DS_MM->users->data[i]);
+ }
+
+ if (E->limit <= 0 || DS_MM->magic == CODE_messages_messages) {
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int, int, struct tgl_message **))q->callback) (TLS, q->callback_extra, 1, E->list_offset, E->ML);
+ }
+
+ tfree_str (E->query);
+ tfree (E->ML, sizeof (void *) * E->list_size);
+ tfree (E, sizeof (*E));
+ } else {
+ E->max_id = E->ML[E->list_offset - 1]->id;
+ E->offset = 0;
+ _tgl_do_msg_search (TLS, E, q->callback, q->callback_extra);
+ }
+ return 0;
+}
+
+static int msg_search_on_error (struct tgl_state *TLS, struct query *q, int error_code, int error_len, const char *error) {
+ tgl_set_query_error (TLS, EPROTO, "RPC_CALL_FAIL %d: %.*s", error_code, error_len, error);
+
+ struct msg_search_extra *E = q->extra;
+ tfree_str (E->query);
+ tfree (E->ML, sizeof (void *) * E->list_size);
+ tfree (E, sizeof (*E));
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int, int, struct tgl_message **))q->callback) (TLS, q->callback_extra, 0, 0, NULL);
+ }
+ return 0;
+}
+
+static struct query_methods msg_search_methods = {
+ .on_answer = msg_search_on_answer,
+ .on_error = msg_search_on_error,
+ .type = TYPE_TO_PARAM(messages_messages)
+};
+
+static void _tgl_do_msg_search (struct tgl_state *TLS, struct msg_search_extra *E, void (*callback)(struct tgl_state *TLS,void *callback_extra, int success, int size, struct tgl_message *list[]), void *callback_extra) {
+ clear_packet ();
+ out_int (CODE_messages_search);
+ if (tgl_get_peer_type (E->id) == TGL_PEER_UNKNOWN) {
+ out_int (CODE_input_peer_empty);
+ } else {
+ out_peer_id (TLS, E->id);
+ }
+
+ out_string (E->query);
+ out_int (CODE_input_messages_filter_empty);
+ out_int (E->from);
+ out_int (E->to);
+ out_int (E->offset); // offset
+ out_int (E->max_id); // max_id
+ out_int (E->limit);
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &msg_search_methods, E, callback, callback_extra);
+}
+
+void tgl_do_msg_search (struct tgl_state *TLS, tgl_peer_id_t id, int from, int to, int limit, int offset, const char *pattern, int pattern_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, int size, struct tgl_message *list[]), void *callback_extra) {
+ if (tgl_get_peer_type (id) == TGL_PEER_ENCR_CHAT) {
+ tgl_set_query_error (TLS, EINVAL, "can not search in secret chats");
+ if (callback) {
+ callback (TLS, callback_extra, 0, 0, 0);
+ }
+ return;
+ }
+ struct msg_search_extra *E = talloc0 (sizeof (*E));
+ E->id = id;
+ E->from = from;
+ E->to = to;
+ E->limit = limit;
+ E->offset = offset;
+ E->query = tstrndup (pattern, pattern_len);
+
+ _tgl_do_msg_search (TLS, E, callback, callback_extra);
+}
+/* }}} */
+
+/* {{{ Get difference */
+
+static int get_state_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tl_ds_updates_state *DS_US = D;
+
+ assert (TLS->locks & TGL_LOCK_DIFF);
+ TLS->locks ^= TGL_LOCK_DIFF;
+
+ bl_do_set_pts (TLS, DS_LVAL (DS_US->pts));
+ bl_do_set_qts (TLS, DS_LVAL (DS_US->qts));
+ bl_do_set_date (TLS, DS_LVAL (DS_US->date));
+ bl_do_set_seq (TLS, DS_LVAL (DS_US->seq));
+
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int))q->callback) (TLS, q->callback_extra, 1);
+ }
+ return 0;
+}
+
+static int lookup_state_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tl_ds_updates_state *DS_US = D;
+ int pts = DS_LVAL (DS_US->pts);
+ int qts = DS_LVAL (DS_US->qts);
+ int seq = DS_LVAL (DS_US->seq);
+
+ if (pts > TLS->pts || qts > TLS->qts || seq > TLS->seq) {
+ tgl_do_get_difference (TLS, 0, 0, 0);
+ }
+ return 0;
+}
+
+
+//int get_difference_active;
+static int get_difference_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tl_ds_updates_difference *DS_UD = D;
+
+ assert (TLS->locks & TGL_LOCK_DIFF);
+ TLS->locks ^= TGL_LOCK_DIFF;
+
+ if (DS_UD->magic == CODE_updates_difference_empty) {
+ bl_do_set_date (TLS, DS_LVAL (DS_UD->date));
+ bl_do_set_seq (TLS, DS_LVAL (DS_UD->seq));
+
+ vlogprintf (E_DEBUG, "Empty difference. Seq = %d\n", TLS->seq);
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int))q->callback) (TLS, q->callback_extra, 1);
+ }
+ } else {
+ int i;
+
+ for (i = 0; i < DS_LVAL (DS_UD->users->cnt); i++) {
+ tglf_fetch_alloc_user_new (TLS, DS_UD->users->data[i]);
+ }
+ for (i = 0; i < DS_LVAL (DS_UD->chats->cnt); i++) {
+ tglf_fetch_alloc_chat_new (TLS, DS_UD->chats->data[i]);
+ }
+
+ int ml_pos = DS_LVAL (DS_UD->new_messages->cnt);
+ struct tgl_message **ML = talloc (ml_pos * sizeof (void *));
+ for (i = 0; i < ml_pos; i++) {
+ ML[i] = tglf_fetch_alloc_message_new (TLS, DS_UD->new_messages->data[i]);
+ }
+
+ int el_pos = DS_LVAL (DS_UD->new_encrypted_messages->cnt);
+ struct tgl_message **EL = talloc (el_pos * sizeof (void *));
+ for (i = 0; i < el_pos; i++) {
+ EL[i] = tglf_fetch_alloc_encrypted_message_new (TLS, DS_UD->new_encrypted_messages->data[i]);
+ }
+
+ for (i = 0; i < DS_LVAL (DS_UD->other_updates->cnt); i++) {
+ tglu_work_update_new (TLS, 1, DS_UD->other_updates->data[i]);
+ }
+
+ for (i = 0; i < DS_LVAL (DS_UD->other_updates->cnt); i++) {
+ tglu_work_update_new (TLS, -1, DS_UD->other_updates->data[i]);
+ }
+
+ for (i = 0; i < ml_pos; i++) {
+ bl_do_msg_update (TLS, ML[i]->id);
+ }
+ for (i = 0; i < el_pos; i++) {
+ bl_do_msg_update (TLS, EL[i]->id);
+ }
+
+ tfree (ML, ml_pos * sizeof (void *));
+ tfree (EL, el_pos * sizeof (void *));
+
+ if (DS_UD->state) {
+ bl_do_set_pts (TLS, DS_LVAL (DS_UD->state->pts));
+ bl_do_set_qts (TLS, DS_LVAL (DS_UD->state->qts));
+ bl_do_set_date (TLS, DS_LVAL (DS_UD->state->date));
+ bl_do_set_seq (TLS, DS_LVAL (DS_UD->state->seq));
+
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int))q->callback) (TLS, q->callback_extra, 1);
+ }
+ } else {
+ bl_do_set_pts (TLS, DS_LVAL (DS_UD->intermediate_state->pts));
+ bl_do_set_qts (TLS, DS_LVAL (DS_UD->intermediate_state->qts));
+ bl_do_set_date (TLS, DS_LVAL (DS_UD->intermediate_state->date));
+
+ tgl_do_get_difference (TLS, 0, q->callback, q->callback_extra);
+ }
+ }
+ return 0;
+}
+
+static struct query_methods lookup_state_methods = {
+ .on_answer = lookup_state_on_answer,
+ .on_error = q_void_on_error,
+ .type = TYPE_TO_PARAM(updates_state)
+};
+
+static struct query_methods get_state_methods = {
+ .on_answer = get_state_on_answer,
+ .on_error = q_void_on_error,
+ .type = TYPE_TO_PARAM(updates_state)
+};
+
+static struct query_methods get_difference_methods = {
+ .on_answer = get_difference_on_answer,
+ .on_error = q_void_on_error,
+ .type = TYPE_TO_PARAM(updates_difference)
+};
+
+void tgl_do_lookup_state (struct tgl_state *TLS) {
+ if (TLS->locks & TGL_LOCK_DIFF) {
+ return;
+ }
+ clear_packet ();
+ tgl_do_insert_header (TLS);
+ out_int (CODE_updates_get_state);
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &lookup_state_methods, 0, 0, 0);
+}
+
+void tgl_do_get_difference (struct tgl_state *TLS, int sync_from_start, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra) {
+ //get_difference_active = 1;
+ //difference_got = 0;
+ if (TLS->locks & TGL_LOCK_DIFF) {
+ if (callback) {
+ callback (TLS, callback_extra, 0);
+ }
+ return;
+ }
+ TLS->locks |= TGL_LOCK_DIFF;
+ clear_packet ();
+ tgl_do_insert_header (TLS);
+ if (TLS->pts > 0 || sync_from_start) {
+ if (TLS->pts == 0) { TLS->pts = 1; }
+ //if (TLS->qts == 0) { TLS->qts = 1; }
+ if (TLS->date == 0) { TLS->date = 1; }
+ out_int (CODE_updates_get_difference);
+ out_int (TLS->pts);
+ out_int (TLS->date);
+ out_int (TLS->qts);
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &get_difference_methods, 0, callback, callback_extra);
+ } else {
+ out_int (CODE_updates_get_state);
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &get_state_methods, 0, callback, callback_extra);
+ }
+}
+/* }}} */
+
+/* {{{ Visualize key */
+
+int tgl_do_visualize_key (struct tgl_state *TLS, tgl_peer_id_t id, unsigned char buf[16]) {
+ assert (tgl_get_peer_type (id) == TGL_PEER_ENCR_CHAT);
+ tgl_peer_t *P = tgl_peer_get (TLS, id);
+ assert (P);
+ if (P->encr_chat.state != sc_ok) {
+ vlogprintf (E_WARNING, "Chat is not initialized yet\n");
+ return -1;
+ }
+ memcpy (buf, P->encr_chat.first_key_sha, 16);
+ return 0;
+}
+/* }}} */
+
+/* {{{ Add user to chat */
+
+void tgl_do_add_user_to_chat (struct tgl_state *TLS, tgl_peer_id_t chat_id, tgl_peer_id_t id, int limit, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra) {
+ clear_packet ();
+ out_int (CODE_messages_add_chat_user);
+ out_int (tgl_get_peer_id (chat_id));
+
+ assert (tgl_get_peer_type (id) == TGL_PEER_USER);
+ tgl_peer_t *U = tgl_peer_get (TLS, id);
+ if (U && U->user.access_hash) {
+ out_int (CODE_input_user_foreign);
+ out_int (tgl_get_peer_id (id));
+ out_long (U->user.access_hash);
+ } else {
+ out_int (CODE_input_user_contact);
+ out_int (tgl_get_peer_id (id));
+ }
+ out_int (limit);
+
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &send_msgs_methods, 0, callback, callback_extra);
+}
+
+void tgl_do_del_user_from_chat (struct tgl_state *TLS, tgl_peer_id_t chat_id, tgl_peer_id_t id, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra) {
+ clear_packet ();
+ out_int (CODE_messages_delete_chat_user);
+ out_int (tgl_get_peer_id (chat_id));
+
+ assert (tgl_get_peer_type (id) == TGL_PEER_USER);
+ tgl_peer_t *U = tgl_peer_get (TLS, id);
+ if (U && U->user.access_hash) {
+ out_int (CODE_input_user_foreign);
+ out_int (tgl_get_peer_id (id));
+ out_long (U->user.access_hash);
+ } else {
+ out_int (CODE_input_user_contact);
+ out_int (tgl_get_peer_id (id));
+ }
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &send_msgs_methods, 0, callback, callback_extra);
+}
+
+/* }}} */
+
+/* {{{ Create secret chat */
+
+void tgl_do_create_secret_chat (struct tgl_state *TLS, tgl_peer_id_t id, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_secret_chat *E), void *callback_extra) {
+ assert (tgl_get_peer_type (id) == TGL_PEER_USER);
+ tgl_peer_t *U = tgl_peer_get (TLS, id);
+ if (!U) {
+ tgl_set_query_error (TLS, EINVAL, "Can not create secret chat with unknown user");
+ if (callback) {
+ callback (TLS, callback_extra, 0, NULL);
+ }
+ return;
+ }
+
+ tgl_do_create_encr_chat_request (TLS, tgl_get_peer_id (id), callback, callback_extra);
+}
+/* }}} */
+
+/* {{{ Create group chat */
+
+void tgl_do_create_group_chat (struct tgl_state *TLS, int users_num, tgl_peer_id_t ids[], const char *chat_topic, int chat_topic_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra) {
+ clear_packet ();
+ out_int (CODE_messages_create_chat);
+ out_int (CODE_vector);
+ out_int (users_num); // Number of users, currently we support only 1 user.
+ int i;
+ for (i = 0; i < users_num; i++) {
+ tgl_peer_id_t id = ids[i];
+ tgl_peer_t *U = tgl_peer_get (TLS, id);
+ if (!U || tgl_get_peer_type (id) != TGL_PEER_USER) {
+ tgl_set_query_error (TLS, EINVAL, "Can not create chat with unknown user");
+ if (callback) {
+ callback (TLS, callback_extra, 0);
+ }
+ return;
+ }
+ if (U && U->user.access_hash) {
+ out_int (CODE_input_user_foreign);
+ out_int (tgl_get_peer_id (id));
+ out_long (U->user.access_hash);
+ } else {
+ out_int (CODE_input_user_contact);
+ out_int (tgl_get_peer_id (id));
+ }
+ }
+ out_cstring (chat_topic, chat_topic_len);
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &send_msgs_methods, 0, callback, callback_extra);
+}
+/* }}} */
+
+/* {{{ Delete msg */
+
+static int delete_msg_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tl_ds_messages_affected_messages *DS_MAM = D;
+
+ struct tgl_message *M = tgl_message_get (TLS, (long)q->extra);
+ if (M) {
+ bl_do_message_delete (TLS, M);
+ }
+
+ int r = tgl_check_pts_diff (TLS, DS_LVAL (DS_MAM->pts), DS_LVAL (DS_MAM->pts_count));
+
+ if (r > 0) {
+ bl_do_set_pts (TLS, DS_LVAL (DS_MAM->pts));
+ }
+
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int))q->callback) (TLS, q->callback_extra, 1);
+ }
+ return 0;
+}
+
+static struct query_methods delete_msg_methods = {
+ .on_answer = delete_msg_on_answer,
+ .on_error = q_void_on_error,
+ .type = TYPE_TO_PARAM(messages_affected_messages)
+};
+
+void tgl_do_delete_msg (struct tgl_state *TLS, long long id, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra) {
+ clear_packet ();
+ out_int (CODE_messages_delete_messages);
+ out_int (CODE_vector);
+ out_int (1);
+ out_int (id);
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &delete_msg_methods, (void *)(long)id, callback, callback_extra);
+}
+/* }}} */
+
+/* {{{ Export card */
+
+static int export_card_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tl_ds_vector *DS_V = D;
+
+ int n = DS_LVAL (DS_V->f1);
+
+ int *r = talloc (4 * n);
+ int i;
+ for (i = 0; i < n; i++) {
+ r[i] = *(int *)DS_V->f2[i];
+ }
+
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int, int, int *))q->callback) (TLS, q->callback_extra, 1, n, r);
+ }
+ tfree (r, 4 * n);
+ return 0;
+}
+
+static struct query_methods export_card_methods = {
+ .on_answer = export_card_on_answer,
+ .on_error = q_list_on_error,
+ .type = TYPE_TO_PARAM_1(vector, TYPE_TO_PARAM (bare_int))
+};
+
+void tgl_do_export_card (struct tgl_state *TLS, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, int size, int *card), void *callback_extra) {
+ clear_packet ();
+ out_int (CODE_contacts_export_card);
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &export_card_methods, 0, callback, callback_extra);
+}
+/* }}} */
+
+/* {{{ Import card */
+
+static int import_card_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tgl_user *U = tglf_fetch_alloc_user_new (TLS, D);
+
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int, struct tgl_user *))q->callback) (TLS, q->callback_extra, 1, U);
+ }
+ return 0;
+}
+
+static struct query_methods import_card_methods = {
+ .on_answer = import_card_on_answer,
+ .on_error = q_ptr_on_error,
+ .type = TYPE_TO_PARAM (user)
+};
+
+void tgl_do_import_card (struct tgl_state *TLS, int size, int *card, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_user *U), void *callback_extra) {
+ clear_packet ();
+ out_int (CODE_contacts_import_card);
+ out_int (CODE_vector);
+ out_int (size);
+ out_ints (card, size);
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &import_card_methods, 0, callback, callback_extra);
+}
+/* }}} */
+
+void tgl_do_start_bot (struct tgl_state *TLS, tgl_peer_id_t bot, tgl_peer_id_t chat, const char *str, int str_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra) {
+ clear_packet ();
+ out_int (CODE_messages_start_bot);
+ struct tgl_user *U = (void *)tgl_peer_get (TLS, bot);
+ if (U && U->access_hash) {
+ out_int (CODE_input_user_foreign);
+ out_int (tgl_get_peer_id (bot));
+ out_long (U->access_hash);
+ } else {
+ out_int (CODE_input_user_contact);
+ out_int (tgl_get_peer_id (bot));
+ }
+ out_int (tgl_get_peer_id (chat));
+ long long m;
+ tglt_secure_random (&m, 8);
+ out_long (m);
+ out_cstring (str, str_len);
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &send_msgs_methods, 0, callback, callback_extra);
+}
+
+/* {{{ Send typing */
+static int send_typing_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int))q->callback)(TLS, q->callback_extra, 1);
+ }
+ return 0;
+}
+
+static struct query_methods send_typing_methods = {
+ .on_answer = send_typing_on_answer,
+ .on_error = q_void_on_error,
+ .type = TYPE_TO_PARAM(bool)
+};
+
+void tgl_do_send_typing (struct tgl_state *TLS, tgl_peer_id_t id, enum tgl_typing_status status, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra) {
+ if (tgl_get_peer_type (id) != TGL_PEER_ENCR_CHAT) {
+ clear_packet ();
+ out_int (CODE_messages_set_typing);
+ out_peer_id (TLS, id);
+ switch (status) {
+ case tgl_typing_none:
+ case tgl_typing_typing:
+ out_int (CODE_send_message_typing_action);
+ break;
+ case tgl_typing_cancel:
+ out_int (CODE_send_message_cancel_action);
+ break;
+ case tgl_typing_record_video:
+ out_int (CODE_send_message_record_video_action);
+ break;
+ case tgl_typing_upload_video:
+ out_int (CODE_send_message_upload_video_action);
+ break;
+ case tgl_typing_record_audio:
+ out_int (CODE_send_message_record_audio_action);
+ break;
+ case tgl_typing_upload_audio:
+ out_int (CODE_send_message_upload_audio_action);
+ break;
+ case tgl_typing_upload_photo:
+ out_int (CODE_send_message_upload_photo_action);
+ break;
+ case tgl_typing_upload_document:
+ out_int (CODE_send_message_upload_document_action);
+ break;
+ case tgl_typing_geo:
+ out_int (CODE_send_message_geo_location_action);
+ break;
+ case tgl_typing_choose_contact:
+ out_int (CODE_send_message_choose_contact_action);
+ break;
+ }
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &send_typing_methods, 0, callback, callback_extra);
+ } else {
+ if (callback) {
+ callback (TLS, callback_extra, 0);
+ }
+ }
+}
+/* }}} */
+
+/* {{{ Extd query */
+#ifndef DISABLE_EXTF
+
+
+char *tglf_extf_print_ds (struct tgl_state *TLS, void *DS, struct paramed_type *T);
+
+static int ext_query_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ if (q->callback) {
+ char *buf = tglf_extf_print_ds (TLS, D, q->type);
+ ((void (*)(struct tgl_state *, void *, int, char *))q->callback) (TLS, q->callback_extra, 1, buf);
+ }
+ tgl_paramed_type_free (q->type);
+ return 0;
+}
+
+static struct query_methods ext_query_methods = {
+ .on_answer = ext_query_on_answer,
+ .on_error = q_list_on_error
+};
+
+void tgl_do_send_extf (struct tgl_state *TLS, const char *data, int data_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, const char *buf), void *callback_extra) {
+ clear_packet ();
+
+ ext_query_methods.type = tglf_extf_store (TLS, data, data_len);
+
+ if (ext_query_methods.type) {
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &ext_query_methods, 0, callback, callback_extra);
+ }
+}
+#else
+void tgl_do_send_extf (struct tgl_state *TLS, char *data, int data_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, char *buf), void *callback_extra) {
+ if (callback) {
+ callback (TLS, callback_extra, 0, 0);
+ }
+}
+#endif
+/* }}} */
+
+/* {{{ get messages */
+
+static int get_messages_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tl_ds_messages_messages *DS_MM = D;
+
+ int i;
+ for (i = 0; i < DS_LVAL (DS_MM->users->cnt); i++) {
+ tglf_fetch_alloc_user_new (TLS, DS_MM->users->data[i]);
+ }
+ for (i = 0; i < DS_LVAL (DS_MM->chats->cnt); i++) {
+ tglf_fetch_alloc_chat_new (TLS, DS_MM->chats->data[i]);
+ }
+
+ struct tgl_message **ML;
+ if (q->extra) {
+ ML = talloc0 (sizeof (void *) * DS_LVAL (DS_MM->messages->cnt));
+ } else {
+ static struct tgl_message *M;
+ M = NULL;
+ ML = &M;
+ assert (DS_LVAL (DS_MM->messages->cnt) <= 1);
+ }
+ for (i = 0; i < DS_LVAL (DS_MM->messages->cnt); i++) {
+ ML[i] = tglf_fetch_alloc_message_new (TLS, DS_MM->messages->data[i]);
+ }
+ if (q->callback) {
+ if (q->extra) {
+ ((void (*)(struct tgl_state *, void *, int, int, struct tgl_message **))q->callback)(TLS, q->callback_extra, 1, DS_LVAL (DS_MM->messages->cnt), ML);
+ } else {
+ if (DS_LVAL (DS_MM->messages->cnt) > 0) {
+ ((void (*)(struct tgl_state *, void *, int, struct tgl_message *))q->callback)(TLS, q->callback_extra, 1, *ML);
+ } else {
+ tgl_set_query_error (TLS, ENOENT, "no such message");
+ ((void (*)(struct tgl_state *, void *, int, struct tgl_message *))q->callback)(TLS, q->callback_extra, 0, NULL);
+ }
+ }
+ }
+ if (q->extra) {
+ tfree (ML, sizeof (void *) * DS_LVAL (DS_MM->messages->cnt));
+ }
+ return 0;
+}
+
+static struct query_methods get_messages_methods = {
+ .on_answer = get_messages_on_answer,
+ .on_error = q_ptr_on_error,
+ .type = TYPE_TO_PARAM (messages_messages)
+};
+
+void tgl_do_get_message (struct tgl_state *TLS, long long id, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra) {
+ struct tgl_message *M = tgl_message_get (TLS, id);
+ if (M) {
+ if (callback) {
+ callback (TLS, callback_extra, 1, M);
+ }
+ return;
+ }
+
+ clear_packet ();
+
+ out_int (CODE_messages_get_messages);
+ out_int (CODE_vector);
+ out_int (1);
+ out_int (id);
+
+
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &get_messages_methods, 0, callback, callback_extra);
+}
+/* }}} */
+
+/* {{{ Export/import chat link */
+static int export_chat_link_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tl_ds_exported_chat_invite *DS_ECI = D;
+
+ char *s = DS_STR_DUP (DS_ECI->link);
+
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int, const char *))q->callback)(TLS, q->callback_extra, s ? 1 : 0, s);
+ }
+ tfree_str (s);
+ return 0;
+}
+
+
+static struct query_methods export_chat_link_methods = {
+ .on_answer = export_chat_link_on_answer,
+ .on_error = q_ptr_on_error,
+ .type = TYPE_TO_PARAM(exported_chat_invite)
+};
+
+void tgl_do_export_chat_link (struct tgl_state *TLS, tgl_peer_id_t id, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, const char *link), void *callback_extra) {
+ if (tgl_get_peer_type (id) != TGL_PEER_CHAT) {
+ tgl_set_query_error (TLS, EINVAL, "Can only export chat link for chat");
+ if (callback) {
+ callback (TLS, callback_extra, 0, NULL);
+ }
+ return;
+ }
+
+ clear_packet ();
+ out_int (CODE_messages_export_chat_invite);
+ out_int (tgl_get_peer_id (id));
+
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &export_chat_link_methods, 0, callback, callback_extra);
+}
+
+void tgl_do_import_chat_link (struct tgl_state *TLS, const char *link, int len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra) {
+ const char *l = link + len - 1;
+ while (l >= link && *l != '/') {
+ l --;
+ }
+ l ++;
+
+ clear_packet ();
+ out_int (CODE_messages_import_chat_invite);
+ out_cstring (l, len - (l - link));
+
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &send_msgs_methods, 0, callback, callback_extra);
+}
+
+/* }}} */
+
+/* {{{ set password */
+static int set_password_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int))q->callback)(TLS, q->callback_extra, 1);
+ }
+ return 0;
+}
+
+static int set_password_on_error (struct tgl_state *TLS, struct query *q, int error_code, int error_len, const char *error) {
+ if (error_code == 400) {
+ if (!strcmp (error, "PASSWORD_HASH_INVALID")) {
+ vlogprintf (E_WARNING, "Bad old password\n");
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int))q->callback)(TLS, q->callback_extra, 0);
+ }
+ return 0;
+ }
+ if (!strcmp (error, "NEW_PASSWORD_BAD")) {
+ vlogprintf (E_WARNING, "Bad new password (unchanged or equals hint)\n");
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int))q->callback)(TLS, q->callback_extra, 0);
+ }
+ return 0;
+ }
+ if (!strcmp (error, "NEW_SALT_INVALID")) {
+ vlogprintf (E_WARNING, "Bad new salt\n");
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int))q->callback)(TLS, q->callback_extra, 0);
+ }
+ return 0;
+ }
+ }
+ tgl_set_query_error (TLS, EPROTO, "RPC_CALL_FAIL %d: %.*s", error_code, error_len, error);
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int))q->callback)(TLS, q->callback_extra, 0);
+ }
+ return 0;
+}
+
+static struct query_methods set_password_methods = {
+ .on_answer = set_password_on_answer,
+ .on_error = set_password_on_error,
+ .type = TYPE_TO_PARAM(bool)
+};
+
+static void tgl_do_act_set_password (struct tgl_state *TLS, const char *current_password, int current_password_len, const char *new_password, int new_password_len, const char *current_salt, int current_salt_len, const char *new_salt, int new_salt_len, const char *hint, int hint_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra) {
+ clear_packet ();
+ static char s[512];
+ static unsigned char shab[32];
+
+ assert (current_salt_len <= 128);
+ assert (current_password_len <= 128);
+ assert (new_salt_len <= 128);
+ assert (new_password_len <= 128);
+
+ out_int (CODE_account_update_password_settings);
+
+ if (current_password_len && current_salt_len) {
+ memcpy (s, current_salt, current_salt_len);
+ memcpy (s + current_salt_len, current_password, current_password_len);
+ memcpy (s + current_salt_len + current_password_len, current_salt, current_salt_len);
+
+ SHA256 ((void *)s, 2 * current_salt_len + current_password_len, shab);
+ out_cstring ((void *)shab, 32);
+ } else {
+ out_string ("");
+ }
+
+ out_int (CODE_account_password_input_settings);
+ if (new_password_len) {
+ out_int (1);
+
+ static char d[256];
+ memcpy (d, new_salt, new_salt_len);
+
+ int l = new_salt_len;
+ tglt_secure_random (d + l, 16);
+ l += 16;
+ memcpy (s, d, l);
+
+ memcpy (s + l, new_password, new_password_len);
+ memcpy (s + l + new_password_len, d, l);
+
+ SHA256 ((void *)s, 2 * l + new_password_len, shab);
+
+ out_cstring (d, l);
+ out_cstring ((void *)shab, 32);
+ out_cstring (hint, hint_len);
+ } else {
+ out_int (0);
+ }
+
+
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &set_password_methods, 0, callback, callback_extra);
+}
+
+struct change_password_extra {
+ char *current_password;
+ char *new_password;
+ char *current_salt;
+ char *new_salt;
+ char *hint;
+ int current_password_len;
+ int new_password_len;
+ int current_salt_len;
+ int new_salt_len;
+ int hint_len;
+ void (*callback)(struct tgl_state *, void *, int);
+ void *callback_extra;
+};
+
+void tgl_on_new_pwd (struct tgl_state *TLS, const char *pwd[], void *_T);
+void tgl_on_new2_pwd (struct tgl_state *TLS, const char *pwd, void *_T) {
+ struct change_password_extra *E = _T;
+ if (strlen (pwd) != (size_t)E->new_password_len || memcmp (E->new_password, pwd, E->new_password_len)) {
+ tfree (E->new_password, E->new_password_len);
+ E->new_password = NULL;
+ E->new_password_len = 0;
+ vlogprintf (E_ERROR, "passwords do not match\n");
+ TLS->callback.get_values (TLS, tgl_new_password, "new password: ", 2, tgl_on_new_pwd, E);
+ return;
+ }
+ tgl_do_act_set_password (TLS, E->current_password, E->current_password_len,
+ E->new_password, E->new_password_len,
+ E->current_salt, E->current_salt_len,
+ E->new_salt, E->new_salt_len,
+ E->hint, E->hint_len,
+ E->callback, E->callback_extra);
+
+ tfree (E->current_password, E->current_password_len);
+ tfree (E->new_password, E->new_password_len);
+ tfree (E->current_salt, E->current_salt_len);
+ tfree (E->new_salt, E->new_salt_len);
+ tfree_str (E->hint);
+ tfree (E, sizeof (*E));
+}
+
+void tgl_on_new_pwd (struct tgl_state *TLS, const char *pwd[], void *_T) {
+ struct change_password_extra *E = _T;
+ E->new_password_len = strlen (pwd[0]);
+ E->new_password = tmemdup (pwd[0], E->new_password_len);
+ tgl_on_new2_pwd(TLS, pwd[1], E);
+}
+
+void tgl_on_old_pwd (struct tgl_state *TLS, const char *pwd[], void *_T) {
+ struct change_password_extra *E = _T;
+ E->current_password_len = strlen (pwd[0]);
+ E->current_password = tmemdup (pwd[0], E->current_password_len);
+ tgl_on_new_pwd(TLS, pwd + 1, E);
+}
+
+static int set_get_password_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tl_ds_account_password *DS_AP = D;
+
+ char *new_hint = q->extra;
+
+ struct change_password_extra *E = talloc0 (sizeof (*E));
+
+ if (DS_AP->current_salt) {
+ E->current_salt_len = DS_AP->current_salt->len;
+ E->current_salt = tmemdup (DS_AP->current_salt->data, E->current_salt_len);
+ }
+ if (DS_AP->new_salt) {
+ E->new_salt_len = DS_AP->new_salt->len;
+ E->new_salt = tmemdup (DS_AP->new_salt->data, E->new_salt_len);
+ }
+
+ if (new_hint) {
+ E->hint_len = strlen (new_hint);
+ E->hint = new_hint;
+ }
+
+ E->callback = q->callback;
+ E->callback_extra = q->callback_extra;
+
+ if (DS_AP->magic == CODE_account_no_password) {
+ TLS->callback.get_values (TLS, tgl_new_password, "new password: ", 2, tgl_on_new_pwd, E);
+ } else {
+ static char s[512];
+ snprintf (s, 511, "old password (hint %.*s): ", DS_RSTR (DS_AP->hint));
+ TLS->callback.get_values (TLS, tgl_cur_and_new_password, s, 3, tgl_on_old_pwd, E);
+ }
+ return 0;
+}
+
+static struct query_methods set_get_password_methods = {
+ .on_answer = set_get_password_on_answer,
+ .on_error = q_void_on_error,
+ .type = TYPE_TO_PARAM(account_password)
+};
+
+void tgl_do_set_password (struct tgl_state *TLS, const char *hint, int hint_len, void (*callback)(struct tgl_state *TLS, void *extra, int success), void *callback_extra) {
+ clear_packet ();
+ out_int (CODE_account_get_password);
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &set_get_password_methods, hint ? tstrndup (hint, hint_len) : NULL, callback, callback_extra);
+}
+
+/* }}} */
+
+/* {{{ check password */
+static int check_password_on_error (struct tgl_state *TLS, struct query *q, int error_code, int error_len, const char *error) {
+ if (error_code == 400) {
+ vlogprintf (E_ERROR, "bad password\n");
+ tgl_do_check_password (TLS, q->callback, q->callback_extra);
+ return 0;
+ }
+ TLS->locks ^= TGL_LOCK_PASSWORD;
+ tgl_set_query_error (TLS, EPROTO, "RPC_CALL_FAIL %d: %.*s", error_code, error_len, error);
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int))q->callback)(TLS, q->callback_extra, 0);
+ }
+ return 0;
+}
+
+static int check_password_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ TLS->locks ^= TGL_LOCK_PASSWORD;
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int))q->callback)(TLS, q->callback_extra, 1);
+ }
+ return 0;
+}
+
+static struct query_methods check_password_methods = {
+ .on_answer = check_password_on_answer,
+ .on_error = check_password_on_error,
+ .type = TYPE_TO_PARAM(auth_authorization)
+};
+
+
+struct check_password_extra {
+ char *current_salt;
+ int current_salt_len;
+ void (*callback)(struct tgl_state *, void *, int);
+ void *callback_extra;
+};
+
+static void tgl_pwd_got (struct tgl_state *TLS, const char *pwd[], void *_T) {
+ struct check_password_extra *E = _T;
+
+ clear_packet ();
+ static char s[512];
+ static unsigned char shab[32];
+
+ assert (E->current_salt_len <= 128);
+ assert (strlen (pwd[0]) <= 128);
+
+ out_int (CODE_auth_check_password);
+
+ if (pwd[0] && E->current_salt_len) {
+ int l = E->current_salt_len;
+ memcpy (s, E->current_salt, l);
+
+ int r = strlen (pwd[0]);
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ strcpy_s (s + l, 512 -l, pwd[0]);
+#else
+ strcpy (s + l, pwd[0]);
+#endif
+
+ memcpy (s + l + r, E->current_salt, l);
+
+ SHA256 ((void *)s, 2 * l + r, shab);
+ out_cstring ((void *)shab, 32);
+ } else {
+ out_string ("");
+ }
+
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &check_password_methods, 0, E->callback, E->callback_extra);
+
+ tfree (E->current_salt, E->current_salt_len);
+ tfree (E, sizeof (*E));
+}
+
+static int check_get_password_on_error (struct tgl_state *TLS, struct query *q, int error_code, int error_len, const char *error) {
+ TLS->locks ^= TGL_LOCK_PASSWORD;
+ tgl_set_query_error (TLS, EPROTO, "RPC_CALL_FAIL %d: %.*s", error_code, error_len, error);
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int))q->callback) (TLS, q->callback_extra, 0);
+ }
+ return 0;
+}
+
+static int check_get_password_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tl_ds_account_password *DS_AP = D;
+
+ if (DS_AP->magic == CODE_account_no_password) {
+ TLS->locks ^= TGL_LOCK_PASSWORD;
+ return 0;
+ }
+ static char s[512];
+ snprintf (s, 511, "type password (hint %.*s): ", DS_RSTR (DS_AP->hint));
+
+ struct check_password_extra *E = talloc0 (sizeof (*E));
+
+ if (DS_AP->current_salt) {
+ E->current_salt_len = DS_AP->current_salt->len;
+ E->current_salt = tmemdup (DS_AP->current_salt->data, E->current_salt_len);
+ }
+
+ E->callback = q->callback;
+ E->callback_extra = q->callback_extra;
+
+ TLS->callback.get_values (TLS, tgl_cur_password, s, 1, tgl_pwd_got, E);
+ return 0;
+}
+
+static struct query_methods check_get_password_methods = {
+ .on_answer = check_get_password_on_answer,
+ .on_error = check_get_password_on_error,
+ .type = TYPE_TO_PARAM(account_password)
+};
+
+void tgl_do_check_password (struct tgl_state *TLS, void (*callback)(struct tgl_state *TLS, void *extra, int success), void *callback_extra) {
+ clear_packet ();
+ out_int (CODE_account_get_password);
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &check_get_password_methods, NULL, callback, callback_extra);
+}
+
+/* }}} */
+
+/* {{{ send broadcast */
+void tgl_do_send_broadcast (struct tgl_state *TLS, int num, tgl_peer_id_t id[], const char *text, int text_len, unsigned long long flags, void (*callback)(struct tgl_state *TLS, void *extra, int success, int num, struct tgl_message *ML[]), void *callback_extra) {
+
+ assert (num <= 1000);
+
+ struct messages_send_extra *E = talloc0 (sizeof (*E));
+ E->multi = 1;
+ E->count = num;
+ E->list = talloc (sizeof (long long) * num);
+
+ int date = (int)time (0);
+ struct tl_ds_message_media TDSM;
+ TDSM.magic = CODE_message_media_empty;
+
+ int i;
+ for (i = 0; i < num; i++) {
+ tglt_secure_random (&E->list[i], 8);
+
+ int peer_type = tgl_get_peer_type (id[i]);
+ int peer_id = tgl_get_peer_id (id[i]);
+ assert (tgl_get_peer_type (id[i]) == TGL_PEER_USER);
+
+ int disable_preview = flags & TGL_SEND_MSG_FLAG_DISABLE_PREVIEW;
+ if (!(flags & TGL_SEND_MSG_FLAG_ENABLE_PREVIEW) && TLS->disable_link_preview) {
+ disable_preview = 1;
+ }
+ if (disable_preview) {
+ disable_preview = TGLMF_DISABLE_PREVIEW;
+ }
+
+ bl_do_create_message_new (TLS, E->list[i], &TLS->our_id, &peer_type, &peer_id, NULL, NULL, &date, text, text_len, &TDSM, NULL, NULL, NULL, TGLMF_UNREAD | TGLMF_OUT | TGLMF_PENDING | TGLMF_CREATE | TGLMF_CREATED | disable_preview);
+ }
+
+ clear_packet ();
+ out_int (CODE_messages_send_broadcast);
+ out_int (CODE_vector);
+ out_int (num);
+ for (i = 0; i < num; i++) {
+ assert (tgl_get_peer_type (id[i]) == TGL_PEER_USER);
+
+ struct tgl_user *U = (void *)tgl_peer_get (TLS, id[i]);
+ if (U && U->access_hash) {
+ out_int (CODE_input_user_foreign);
+ out_int (tgl_get_peer_id (id[i]));
+ out_long (U->access_hash);
+ } else {
+ out_int (CODE_input_user_contact);
+ out_int (tgl_get_peer_id (id[i]));
+ }
+ }
+
+ out_int (CODE_vector);
+ out_int (num);
+ for (i = 0; i < num; i++) {
+ out_long (E->list[i]);
+ }
+ out_cstring (text, text_len);
+
+ out_int (CODE_message_media_empty);
+
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &send_msgs_methods, E, callback, callback_extra);
+}
+/* }}} */
+
+/* {{{ block user */
+static int block_user_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int))q->callback)(TLS, q->callback_extra, 1);
+ }
+ return 0;
+}
+
+static struct query_methods block_user_methods = {
+ .on_answer = block_user_on_answer,
+ .on_error = q_void_on_error,
+ .type = TYPE_TO_PARAM (bool)
+};
+
+void tgl_do_block_user (struct tgl_state *TLS, tgl_peer_id_t id, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra) {
+ if (tgl_get_peer_type (id) != TGL_PEER_USER) {
+ tgl_set_query_error (TLS, EINVAL, "id should be user id");
+ if (callback) {
+ callback (TLS, callback_extra, 0);
+ }
+ return;
+ }
+
+ clear_packet ();
+
+ out_int (CODE_contacts_block);
+ tgl_peer_t *U = tgl_peer_get (TLS, id);
+ if (U && U->user.access_hash) {
+ out_int (CODE_input_user_foreign);
+ out_int (tgl_get_peer_id (id));
+ out_long (U->user.access_hash);
+ } else {
+ out_int (CODE_input_user_contact);
+ out_int (tgl_get_peer_id (id));
+ }
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &block_user_methods, 0, callback, callback_extra);
+}
+
+void tgl_do_unblock_user (struct tgl_state *TLS, tgl_peer_id_t id, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra) {
+ if (tgl_get_peer_type (id) != TGL_PEER_USER) {
+ tgl_set_query_error (TLS, EINVAL, "id should be user id");
+ if (callback) {
+ callback (TLS, callback_extra, 0);
+ }
+ return;
+ }
+
+ clear_packet ();
+
+ out_int (CODE_contacts_unblock);
+ tgl_peer_t *U = tgl_peer_get (TLS, id);
+ if (U && U->user.access_hash) {
+ out_int (CODE_input_user_foreign);
+ out_int (tgl_get_peer_id (id));
+ out_long (U->user.access_hash);
+ } else {
+ out_int (CODE_input_user_contact);
+ out_int (tgl_get_peer_id (id));
+ }
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &block_user_methods, 0, callback, callback_extra);
+}
+/* }}} */
+
+
+
+static void set_flag_4 (struct tgl_state *TLS, void *_D, int success) {
+ struct tgl_dc *D = _D;
+ assert (success);
+ D->flags |= 4;
+
+ TLS->timer_methods->insert (D->ev, TLS->temp_key_expire_time * 0.9);
+}
+
+static int send_bind_temp_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ struct tgl_dc *DC = q->extra;
+ DC->flags |= 2;
+ tgl_do_help_get_config_dc (TLS, DC, set_flag_4, DC);
+ vlogprintf (E_DEBUG, "Bind successful in dc %d\n", DC->id);
+ return 0;
+}
+
+static int send_bind_on_error (struct tgl_state *TLS, struct query *q, int error_code, int l, const char *error) {
+ vlogprintf (E_WARNING, "bind: error %d: %.*s\n", error_code, l, error);
+ if (error_code == 400) {
+ return -11;
+ }
+ return 0;
+}
+
+static struct query_methods send_bind_temp_methods = {
+ .on_answer = send_bind_temp_on_answer,
+ .on_error = send_bind_on_error,
+ .type = TYPE_TO_PARAM (bool)
+};
+
+void tgl_do_send_bind_temp_key (struct tgl_state *TLS, struct tgl_dc *D, long long nonce, int expires_at, void *data, int len, long long msg_id) {
+ clear_packet ();
+ out_int (CODE_auth_bind_temp_auth_key);
+ out_long (D->auth_key_id);
+ out_long (nonce);
+ out_int (expires_at);
+ out_cstring (data, len);
+ struct query *q = tglq_send_query_ex (TLS, D, packet_ptr - packet_buffer, packet_buffer, &send_bind_temp_methods, D, 0, 0, 2);
+ assert (q->msg_id == msg_id);
+}
+
+static int update_status_on_answer (struct tgl_state *TLS, struct query *q, void *D) {
+ if (q->callback) {
+ ((void (*)(struct tgl_state *, void *, int))q->callback) (TLS, q->callback_extra, 1);
+ }
+ return 0;
+}
+
+static struct query_methods update_status_methods = {
+ .on_answer = update_status_on_answer,
+ .on_error = q_void_on_error,
+ .type = TYPE_TO_PARAM(bool)
+};
+
+void tgl_do_update_status (struct tgl_state *TLS, int online, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra) {
+ clear_packet ();
+ out_int (CODE_account_update_status);
+ out_int (online ? CODE_bool_false : CODE_bool_true);
+ tglq_send_query (TLS, TLS->DC_working, packet_ptr - packet_buffer, packet_buffer, &update_status_methods, 0, callback, callback_extra);
+}
+
+
+void tgl_do_request_exchange (struct tgl_state *TLS, struct tgl_secret_chat *E) {
+ /*static unsigned char s[256];
+ tglt_secure_random (s, 256);
+
+ long long id;
+ tglt_secure_random (&id, 8);
+
+ //bl_do_encr_chat_exchange_request (TLS, E, id, s);
+ int rst = tgl_sce_requested;
+ bl_do_encr_chat_exchange_new (TLS, E, &id, NULL, &rst);
+
+ BIGNUM *a = BN_bin2bn (s, 256, 0);
+ ensure_ptr (a);
+ BIGNUM *p = BN_bin2bn (TLS->encr_prime, 256, 0);
+ ensure_ptr (p);
+
+ BIGNUM *g = BN_new ();
+ ensure_ptr (g);
+
+ ensure (BN_set_word (g, TLS->encr_root));
+
+ BIGNUM *r = BN_new ();
+ ensure_ptr (r);
+
+ ensure (BN_mod_exp (r, g, a, p, TLS->BN_ctx));
+
+ static unsigned char kk[256];
+ memset (kk, 0, sizeof (kk));
+ BN_bn2bin (r, kk + (256 - BN_num_bytes (r)));
+
+ BN_clear_free (a);
+ BN_clear_free (g);
+ BN_clear_free (p);
+ BN_clear_free (r);
+
+ static int action[70];
+ action[0] = CODE_decrypted_message_action_request_key;
+ *(long long *)(action + 1) = E->exchange_id;
+ action[3] = 0x100fe;
+ memcpy (action + 4, kk, 256);
+
+ long long t;
+ tglt_secure_random (&t, 8);
+
+ bl_do_send_message_action_encr (TLS, t, TLS->our_id, tgl_get_peer_type (E->id), tgl_get_peer_id (E->id), time (0), 68, action);
+
+ struct tgl_message *M = tgl_message_get (TLS, t);
+ assert (M);
+ assert (M->action.type == tgl_message_action_request_key);
+ tgl_do_send_msg (TLS, M, 0, 0);*/
+}
+
+void tgl_do_accept_exchange (struct tgl_state *TLS, struct tgl_secret_chat *E, long long exchange_id, unsigned char ga[]) {
+ /*static unsigned char s[256];
+ tglt_secure_random (s, 256);
+
+ BIGNUM *b = BN_bin2bn (s, 256, 0);
+ ensure_ptr (b);
+ BIGNUM *g_a = BN_bin2bn (ga, 256, 0);
+ ensure_ptr (g_a);
+
+ assert (tglmp_check_g_a (TLS, TLS->encr_prime_bn, g_a) >= 0);
+ //if (!ctx) {
+ // ctx = BN_CTX_new ();
+ // ensure_ptr (ctx);
+ //}
+ BIGNUM *p = TLS->encr_prime_bn;
+ ensure_ptr (p);
+ BIGNUM *r = BN_new ();
+ ensure_ptr (r);
+ ensure (BN_mod_exp (r, g_a, b, p, TLS->BN_ctx));
+
+ static unsigned char kk[256];
+ memset (kk, 0, sizeof (kk));
+ BN_bn2bin (r, kk + (256 - BN_num_bytes (r)));
+
+ bl_do_encr_chat_exchange_accept (TLS, E, exchange_id, kk);
+
+ ensure (BN_set_word (g_a, TLS->encr_root));
+ ensure (BN_mod_exp (r, g_a, b, p, TLS->BN_ctx));
+
+ static unsigned char buf[256];
+ memset (buf, 0, sizeof (buf));
+ BN_bn2bin (r, buf + (256 - BN_num_bytes (r)));
+
+ static int action[70];
+ action[0] = CODE_decrypted_message_action_accept_key;
+ *(long long *)(action + 1) = E->exchange_id;
+ action[3] = 0x100fe;
+ memcpy (action + 4, buf, 256);
+ *(long long *)(action + 68) = E->exchange_key_fingerprint;
+
+ long long t;
+ tglt_secure_random (&t, 8);
+
+ bl_do_send_message_action_encr (TLS, t, TLS->our_id, tgl_get_peer_type (E->id), tgl_get_peer_id (E->id), time (0), 70, action);
+
+ BN_clear_free (b);
+ BN_clear_free (g_a);
+ BN_clear_free (r);
+
+ struct tgl_message *M = tgl_message_get (TLS, t);
+ assert (M);
+ assert (M->action.type == tgl_message_action_accept_key);
+ tgl_do_send_msg (TLS, M, 0, 0);*/
+}
+
+void tgl_do_confirm_exchange (struct tgl_state *TLS, struct tgl_secret_chat *E, int sen_nop) {
+ /*bl_do_encr_chat_exchange_confirm (TLS, E);
+ if (sen_nop) {
+ int action = CODE_decrypted_message_action_noop;
+
+ long long t;
+ tglt_secure_random (&t, 8);
+
+ bl_do_send_message_action_encr (TLS, t, TLS->our_id, tgl_get_peer_type (E->id), tgl_get_peer_id (E->id), time (0), 1, &action);
+
+ struct tgl_message *M = tgl_message_get (TLS, t);
+ assert (M);
+ assert (M->action.type == tgl_message_action_noop);
+ tgl_do_send_msg (TLS, M, 0, 0);
+ }*/
+}
+
+void tgl_do_commit_exchange (struct tgl_state *TLS, struct tgl_secret_chat *E, unsigned char gb[]) {
+ /*assert (TLS->encr_prime);
+
+ BIGNUM *g_b = BN_bin2bn (gb, 256, 0);
+ ensure_ptr (g_b);
+ assert (tglmp_check_g_a (TLS, TLS->encr_prime_bn, g_b) >= 0);
+
+ BIGNUM *p = TLS->encr_prime_bn;
+ ensure_ptr (p);
+ BIGNUM *r = BN_new ();
+ ensure_ptr (r);
+ BIGNUM *a = BN_bin2bn ((void *)E->exchange_key, 256, 0);
+ ensure_ptr (a);
+ ensure (BN_mod_exp (r, g_b, a, p, TLS->BN_ctx));
+
+ static unsigned char s[256];
+ memset (s, 0, 256);
+
+ BN_bn2bin (r, s + (256 - BN_num_bytes (r)));
+
+ BN_clear_free (g_b);
+ BN_clear_free (r);
+ BN_clear_free (a);
+
+ static unsigned char sh[20];
+ SHA1 (s, 256, sh);
+
+ int action[4];
+ action[0] = CODE_decrypted_message_action_commit_key;
+ *(long long *)(action + 1) = E->exchange_id;
+ *(long long *)(action + 3) = *(long long *)(sh + 12);
+
+ long long t;
+ tglt_secure_random (&t, 8);
+
+ bl_do_send_message_action_encr (TLS, t, TLS->our_id, tgl_get_peer_type (E->id), tgl_get_peer_id (E->id), time (0), 5, action);
+
+ struct tgl_message *M = tgl_message_get (TLS, t);
+ assert (M);
+ assert (M->action.type == tgl_message_action_commit_key);
+ tgl_do_send_msg (TLS, M, 0, 0);
+
+ bl_do_encr_chat_exchange_commit (TLS, E, s);*/
+}
+
+void tgl_do_abort_exchange (struct tgl_state *TLS, struct tgl_secret_chat *E) {
+ //bl_do_encr_chat_exchange_abort (TLS, E);
+}
+
+void tgl_started_cb (struct tgl_state *TLS, void *arg, int success) {
+ assert (success);
+ TLS->started = 1;
+ if (TLS->callback.started) {
+ TLS->callback.started (TLS);
+ }
+}
+
+void tgl_export_auth_callback (struct tgl_state *TLS, void *arg, int success) {
+ assert (success);
+ int i;
+ for (i = 0; i <= TLS->max_dc_num; i++) if (TLS->DC_list[i] && !tgl_signed_dc (TLS, TLS->DC_list[i])) {
+ return;
+ }
+ if (TLS->callback.logged_in) {
+ TLS->callback.logged_in (TLS);
+ }
+
+ tglm_send_all_unsent (TLS);
+ tgl_do_get_difference (TLS, 0, tgl_started_cb, 0);
+}
+
+void tgl_export_all_auth (struct tgl_state *TLS) {
+ int i;
+ int ok = 1;
+ for (i = 0; i <= TLS->max_dc_num; i++) if (TLS->DC_list[i] && !tgl_signed_dc (TLS, TLS->DC_list[i])) {
+ tgl_do_export_auth (TLS, i, tgl_export_auth_callback, TLS->DC_list[i]);
+ ok = 0;
+ }
+ if (ok) {
+ if (TLS->callback.logged_in) {
+ TLS->callback.logged_in (TLS);
+ }
+
+ tglm_send_all_unsent (TLS);
+ tgl_do_get_difference (TLS, 0, tgl_started_cb, 0);
+ }
+}
+
+struct sign_up_extra {
+ char *phone;
+ char *hash;
+ char *first_name;
+ char *last_name;
+ int phone_len;
+ int hash_len;
+ int first_name_len;
+ int last_name_len;
+};
+
+void tgl_sign_in_code (struct tgl_state *TLS, const char *code[], void *_T);
+void tgl_sign_in_result (struct tgl_state *TLS, void *_T, int success, struct tgl_user *U) {
+ struct sign_up_extra *E = _T;
+ if (success) {
+ tfree (E->phone, E->phone_len);
+ tfree (E->hash, E->hash_len);
+ tfree (E, sizeof (*E));
+ } else {
+ vlogprintf (E_ERROR, "incorrect code\n");
+ TLS->callback.get_values (TLS, tgl_code, "code ('call' for phone call):", 1, tgl_sign_in_code, E);
+ return;
+ }
+ tgl_export_all_auth (TLS);
+}
+
+void tgl_sign_in_code (struct tgl_state *TLS, const char *code[], void *_T) {
+ struct sign_up_extra *E = _T;
+ if (!strcmp (code[0], "call")) {
+ tgl_do_phone_call (TLS, E->phone, E->phone_len, E->hash, E->hash_len, 0, 0);
+ TLS->callback.get_values (TLS, tgl_code, "code ('call' for phone call):", 1, tgl_sign_in_code, E);
+ return;
+ }
+
+ tgl_do_send_code_result (TLS, E->phone, E->phone_len, E->hash, E->hash_len, code[0], strlen (code[0]), tgl_sign_in_result, E);
+}
+
+void tgl_sign_up_code (struct tgl_state *TLS, const char *code[], void *_T);
+void tgl_sign_up_result (struct tgl_state *TLS, void *_T, int success, struct tgl_user *U) {
+ struct sign_up_extra *E = _T;
+ if (success) {
+ tfree (E->phone, E->phone_len);
+ tfree (E->hash, E->hash_len);
+ tfree (E->first_name, E->first_name_len);
+ tfree (E->last_name, E->last_name_len);
+ tfree (E, sizeof (*E));
+ } else {
+ vlogprintf (E_ERROR, "incorrect code\n");
+ TLS->callback.get_values (TLS, tgl_code, "code ('call' for phone call):", 1, tgl_sign_up_code, E);
+ return;
+ }
+ tgl_export_all_auth (TLS);
+}
+
+void tgl_sign_up_code (struct tgl_state *TLS, const char *code[], void *_T) {
+ struct sign_up_extra *E = _T;
+ if (!strcmp (code[0], "call")) {
+ tgl_do_phone_call (TLS, E->phone, E->phone_len, E->hash, E->hash_len, 0, 0);
+ TLS->callback.get_values (TLS, tgl_code, "code ('call' for phone call):", 1, tgl_sign_up_code, E);
+ return;
+ }
+
+ tgl_do_send_code_result_auth (TLS, E->phone, E->phone_len, E->hash, E->hash_len, code[0], strlen (code[0]), E->first_name, E->first_name_len, E->last_name, E->last_name_len, tgl_sign_up_result, E);
+}
+
+
+void tgl_set_last_name (struct tgl_state *TLS, const char *last_name, struct sign_up_extra *E) {
+ E->last_name_len = strlen (last_name);
+ E->last_name = tmemdup (last_name, E->last_name_len);
+}
+
+int tgl_set_first_name (struct tgl_state *TLS, const char *first_name, struct sign_up_extra *E) {
+ if (strlen (first_name) < 1) {
+ return -1;
+ }
+
+ E->first_name_len = strlen (first_name);
+ E->first_name = tmemdup (first_name, E->first_name_len);
+ return 0;
+}
+
+void tgl_register_cb (struct tgl_state *TLS, const char *rinfo[], void *_T) {
+ struct sign_up_extra *E = _T;
+ const char *yn = rinfo[0];
+ if (strlen (yn) > 1) {
+ TLS->callback.get_values (TLS, tgl_register_info, "registration info:", 3, tgl_register_cb, E);
+ } else if (strlen (yn) == 0 || *yn == 'y' || *yn == 'Y') {
+ if (!tgl_set_first_name(TLS, rinfo[1], E)) {
+ tgl_set_last_name(TLS, rinfo[2], E);
+ TLS->callback.get_values (TLS, tgl_code, "code ('call' for phone call):", 1, tgl_sign_up_code, E);
+ }
+ else {
+ TLS->callback.get_values (TLS, tgl_register_info, "registration info:", 3, tgl_register_cb, E);
+ }
+ } else if (*yn == 'n' || *yn == 'N') {
+ vlogprintf (E_ERROR, "stopping registration");
+ tfree (E->phone, E->phone_len);
+ tfree (E->hash, E->hash_len);
+ tfree (E, sizeof (*E));
+ tgl_login (TLS);
+ } else {
+ TLS->callback.get_values (TLS, tgl_register_info, "registration info:", 3, tgl_register_cb, E);
+ }
+}
+
+void tgl_sign_in_phone (struct tgl_state *TLS, const char *phone[], void *arg);
+void tgl_sign_in_phone_cb (struct tgl_state *TLS, void *extra, int success, int registered, const char *mhash) {
+ struct sign_up_extra *E = extra;
+ if (!success) {
+ vlogprintf (E_ERROR, "Incorrect phone number\n");
+
+ tfree (E->phone, E->phone_len);
+ tfree (E, sizeof (*E));
+ TLS->callback.get_values (TLS, tgl_phone_number, "phone number:", 1, tgl_sign_in_phone, NULL);
+ return;
+ }
+
+ E->hash_len = strlen (mhash);
+ E->hash = tmemdup (mhash, E->hash_len);
+
+ if (registered) {
+ TLS->callback.get_values (TLS, tgl_code, "code ('call' for phone call):", 1, tgl_sign_in_code, E);
+ } else {
+ TLS->callback.get_values (TLS, tgl_register_info, "registration info:", 3, tgl_register_cb, E);
+ }
+}
+
+void tgl_sign_in_phone (struct tgl_state *TLS, const char *phone[], void *arg) {
+ struct sign_up_extra *E = talloc0 (sizeof (*E));
+ E->phone_len = strlen (phone[0]);
+ E->phone = tmemdup (phone[0], E->phone_len);
+
+ tgl_do_send_code (TLS, E->phone, E->phone_len, tgl_sign_in_phone_cb, E);
+}
+
+void tgl_bot_hash_cb (struct tgl_state *TLS, const char *code[], void *arg);
+
+void tgl_sign_in_bot_cb (struct tgl_state *TLS, void *_T, int success, struct tgl_user *U) {
+ if (!success) {
+ vlogprintf (E_ERROR, "incorrect bot hash\n");
+ TLS->callback.get_values (TLS, tgl_bot_hash, "bot hash:", 1, tgl_bot_hash_cb, NULL);
+ return;
+ }
+ tgl_export_all_auth (TLS);
+}
+
+void tgl_bot_hash_cb (struct tgl_state *TLS, const char *code[], void *arg) {
+ tgl_do_send_bot_auth (TLS, code[0], strlen (code[0]), tgl_sign_in_bot_cb, NULL);
+}
+
+void tgl_sign_in (struct tgl_state *TLS) {
+ if (!tgl_signed_dc (TLS, TLS->DC_working)) {
+ if (TLS->is_bot) {
+ TLS->callback.get_values (TLS, tgl_bot_hash, "bot hash:", 1, tgl_bot_hash_cb, NULL);
+ } else {
+ TLS->callback.get_values (TLS, tgl_phone_number, "phone number:", 1, tgl_sign_in_phone, NULL);
+ }
+ } else {
+ tgl_export_all_auth (TLS);
+ }
+}
+
+static void check_authorized (struct tgl_state *TLS, void *arg) {
+ int i;
+ int ok = 1;
+ for (i = 0; i <= TLS->max_dc_num; i++) {
+ if (TLS->DC_list[i] && !tgl_signed_dc (TLS, TLS->DC_list[i]) && !tgl_authorized_dc (TLS, TLS->DC_list[i])) {
+ ok = 0;
+ break;
+ }
+ }
+
+ if (ok) {
+ TLS->timer_methods->free (TLS->ev_login);
+ TLS->ev_login = NULL;
+ tgl_sign_in (TLS);
+ } else {
+ TLS->timer_methods->insert (TLS->ev_login, 0.1);
+ }
+}
+
+void tgl_login (struct tgl_state *TLS) {
+ int i;
+ int ok = 1;
+ for (i = 0; i <= TLS->max_dc_num; i++) {
+ if (TLS->DC_list[i] && !tgl_signed_dc (TLS, TLS->DC_list[i]) && !tgl_authorized_dc (TLS, TLS->DC_list[i])) {
+ ok = 0;
+ break;
+ }
+ }
+
+ if (!ok) {
+ TLS->ev_login = TLS->timer_methods->alloc (TLS, check_authorized, NULL);
+ TLS->timer_methods->insert (TLS->ev_login, 0.1);
+ } else {
+ tgl_sign_in (TLS);
+ }
+}
diff --git a/protocols/Telegram/tgl/queries.h b/protocols/Telegram/tgl/queries.h
new file mode 100644
index 0000000000..9665667d55
--- /dev/null
+++ b/protocols/Telegram/tgl/queries.h
@@ -0,0 +1,84 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Vitaly Valtman 2013-2015
+*/
+//#include "net.h"
+#ifndef __QUERIES_H__
+#define __QUERIES_H__
+#include "tgl-structures.h"
+#include "auto.h"
+#include "tgl-layout.h"
+
+#define QUERY_ACK_RECEIVED 1
+#define QUERY_FORCE_SEND 2
+
+struct query;
+struct query_methods {
+ int (*on_answer)(struct tgl_state *TLS, struct query *q, void *DS);
+ int (*on_error)(struct tgl_state *TLS, struct query *q, int error_code, int len, const char *error);
+ int (*on_timeout)(struct tgl_state *TLS, struct query *q);
+ struct paramed_type *type;
+};
+
+struct query {
+ long long msg_id;
+ int data_len;
+ int flags;
+ int seq_no;
+ long long session_id;
+ void *data;
+ struct query_methods *methods;
+ struct tgl_timer *ev;
+ struct tgl_dc *DC;
+ struct tgl_session *session;
+ struct paramed_type *type;
+ void *extra;
+ void *callback;
+ void *callback_extra;
+};
+
+
+struct query *tglq_send_query (struct tgl_state *TLS, struct tgl_dc *DC, int len, void *data, struct query_methods *methods, void *extra, void *callback, void *callback_extra);
+void tglq_query_ack (struct tgl_state *TLS, long long id);
+int tglq_query_error (struct tgl_state *TLS, long long id);
+int tglq_query_result (struct tgl_state *TLS, long long id);
+void tglq_query_restart (struct tgl_state *TLS, long long id);
+
+//double next_timer_in (void);
+//void work_timers (void);
+
+//extern struct query_methods help_get_config_methods;
+
+double get_double_time (void);
+
+void tgl_do_send_bind_temp_key (struct tgl_state *TLS, struct tgl_dc *D, long long nonce, int expires_at, void *data, int len, long long msg_id);
+
+void tgl_do_request_exchange (struct tgl_state *TLS, struct tgl_secret_chat *E);
+void tgl_do_confirm_exchange (struct tgl_state *TLS, struct tgl_secret_chat *E, int sen_nop);
+void tgl_do_accept_exchange (struct tgl_state *TLS, struct tgl_secret_chat *E, long long exchange_id, unsigned char g_a[]);
+void tgl_do_commit_exchange (struct tgl_state *TLS, struct tgl_secret_chat *E, unsigned char g_a[]);
+void tgl_do_abort_exchange (struct tgl_state *TLS, struct tgl_secret_chat *E);
+
+void tglq_regen_query (struct tgl_state *TLS, long long id);
+void tglq_query_delete (struct tgl_state *TLS, long long id);
+void tglq_query_free_all (struct tgl_state *TLS);
+// For binlog
+
+//int get_dh_config_on_answer (struct query *q);
+//void fetch_dc_option (void);
+#endif
diff --git a/protocols/Telegram/tgl/scheme.tl b/protocols/Telegram/tgl/scheme.tl
new file mode 100644
index 0000000000..a38980aea4
--- /dev/null
+++ b/protocols/Telegram/tgl/scheme.tl
@@ -0,0 +1 @@
+scheme31.tl \ No newline at end of file
diff --git a/protocols/Telegram/tgl/scheme12.tl b/protocols/Telegram/tgl/scheme12.tl
new file mode 100644
index 0000000000..7d37a6fdc5
--- /dev/null
+++ b/protocols/Telegram/tgl/scheme12.tl
@@ -0,0 +1,505 @@
+int ?= Int;
+long ?= Long;
+double ?= Double;
+string ?= String;
+
+bytes string = Bytes;
+
+boolFalse#bc799737 = Bool;
+boolTrue#997275b5 = Bool;
+
+vector#1cb5c415 {t:Type} # [ t ] = Vector t;
+
+error#c4b9f9bb code:int text:string = Error;
+
+null#56730bcc = Null;
+
+inputPeerEmpty#7f3b18ea = InputPeer;
+inputPeerSelf#7da07ec9 = InputPeer;
+inputPeerContact#1023dbe8 user_id:int = InputPeer;
+inputPeerForeign#9b447325 user_id:int access_hash:long = InputPeer;
+inputPeerChat#179be863 chat_id:int = InputPeer;
+
+inputUserEmpty#b98886cf = InputUser;
+inputUserSelf#f7c1b13f = InputUser;
+inputUserContact#86e94f65 user_id:int = InputUser;
+inputUserForeign#655e74ff user_id:int access_hash:long = InputUser;
+
+inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact;
+
+inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;
+
+inputMediaEmpty#9664f57f = InputMedia;
+inputMediaUploadedPhoto#2dc53a7d file:InputFile = InputMedia;
+inputMediaPhoto#8f2ab2ec id:InputPhoto = InputMedia;
+inputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;
+inputMediaContact#a6e45987 phone_number:string first_name:string last_name:string = InputMedia;
+inputMediaUploadedVideo#4847d92a file:InputFile duration:int w:int h:int = InputMedia;
+inputMediaUploadedThumbVideo#e628a145 file:InputFile thumb:InputFile duration:int w:int h:int = InputMedia;
+inputMediaVideo#7f023ae6 id:InputVideo = InputMedia;
+
+inputChatPhotoEmpty#1ca48f57 = InputChatPhoto;
+inputChatUploadedPhoto#94254732 file:InputFile crop:InputPhotoCrop = InputChatPhoto;
+inputChatPhoto#b2e1bf08 id:InputPhoto crop:InputPhotoCrop = InputChatPhoto;
+
+inputGeoPointEmpty#e4c123d6 = InputGeoPoint;
+inputGeoPoint#f3b7acc9 lat:double long:double = InputGeoPoint;
+
+inputPhotoEmpty#1cd7bf0d = InputPhoto;
+inputPhoto#fb95c6c4 id:long access_hash:long = InputPhoto;
+
+inputVideoEmpty#5508ec75 = InputVideo;
+inputVideo#ee579652 id:long access_hash:long = InputVideo;
+
+inputFileLocation#14637196 volume_id:long local_id:int secret:long = InputFileLocation;
+inputVideoFileLocation#3d0364ec id:long access_hash:long = InputFileLocation;
+
+inputPhotoCropAuto#ade6b004 = InputPhotoCrop;
+inputPhotoCrop#d9915325 crop_left:double crop_top:double crop_width:double = InputPhotoCrop;
+
+inputAppEvent#770656a8 time:double type:string peer:long data:string = InputAppEvent;
+
+peerUser#9db1bc6d user_id:int = Peer;
+peerChat#bad0e5bb chat_id:int = Peer;
+
+storage.fileUnknown#aa963b05 = storage.FileType;
+storage.fileJpeg#7efe0e = storage.FileType;
+storage.fileGif#cae1aadf = storage.FileType;
+storage.filePng#a4f63c0 = storage.FileType;
+storage.filePdf#ae1e508d = storage.FileType;
+storage.fileMp3#528a0677 = storage.FileType;
+storage.fileMov#4b09ebbc = storage.FileType;
+storage.filePartial#40bc6f52 = storage.FileType;
+storage.fileMp4#b3cea0e4 = storage.FileType;
+storage.fileWebp#1081464c = storage.FileType;
+
+fileLocationUnavailable#7c596b46 volume_id:long local_id:int secret:long = FileLocation;
+fileLocation#53d69076 dc_id:int volume_id:long local_id:int secret:long = FileLocation;
+
+userEmpty#200250ba id:int = User;
+userSelf#720535ec id:int first_name:string last_name:string phone:string photo:UserProfilePhoto status:UserStatus inactive:Bool = User;
+userContact#f2fb8319 id:int first_name:string last_name:string access_hash:long phone:string photo:UserProfilePhoto status:UserStatus = User;
+userRequest#22e8ceb0 id:int first_name:string last_name:string access_hash:long phone:string photo:UserProfilePhoto status:UserStatus = User;
+userForeign#5214c89d id:int first_name:string last_name:string access_hash:long photo:UserProfilePhoto status:UserStatus = User;
+userDeleted#b29ad7cc id:int first_name:string last_name:string = User;
+
+userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
+userProfilePhoto#d559d8c8 photo_id:long photo_small:FileLocation photo_big:FileLocation = UserProfilePhoto;
+
+userStatusEmpty#9d05049 = UserStatus;
+userStatusOnline#edb93949 expires:int = UserStatus;
+userStatusOffline#8c703f was_online:int = UserStatus;
+
+chatEmpty#9ba2d800 id:int = Chat;
+chat#6e9c9bc7 id:int title:string photo:ChatPhoto participants_count:int date:int left:Bool version:int = Chat;
+chatForbidden#fb0ccc41 id:int title:string date:int = Chat;
+
+chatFull#630e61be id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings = ChatFull;
+
+chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant;
+
+chatParticipantsForbidden#fd2bb8a chat_id:int = ChatParticipants;
+chatParticipants#7841b415 chat_id:int admin_id:int participants:Vector<ChatParticipant> version:int = ChatParticipants;
+
+chatPhotoEmpty#37c1011c = ChatPhoto;
+chatPhoto#6153276a photo_small:FileLocation photo_big:FileLocation = ChatPhoto;
+
+messageEmpty#83e5de54 id:int = Message;
+message#22eb6aba id:int from_id:int to_id:Peer out:Bool unread:Bool date:int message:string media:MessageMedia = Message;
+messageForwarded#5f46804 id:int fwd_from_id:int fwd_date:int from_id:int to_id:Peer out:Bool unread:Bool date:int message:string media:MessageMedia = Message;
+messageService#9f8d60bb id:int from_id:int to_id:Peer out:Bool unread:Bool date:int action:MessageAction = Message;
+
+messageMediaEmpty#3ded6320 = MessageMedia;
+messageMediaPhoto#c8c45a2a photo:Photo = MessageMedia;
+messageMediaVideo#a2d24290 video:Video = MessageMedia;
+messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;
+messageMediaContact#5e7d2f39 phone_number:string first_name:string last_name:string user_id:int = MessageMedia;
+messageMediaUnsupported#29632a36 bytes:bytes = MessageMedia;
+
+messageActionEmpty#b6aef7b0 = MessageAction;
+messageActionChatCreate#a6638b9a title:string users:Vector<int> = MessageAction;
+messageActionChatEditTitle#b5a1ce5a title:string = MessageAction;
+messageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction;
+messageActionChatDeletePhoto#95e3fbef = MessageAction;
+messageActionChatAddUser#5e3cfc4b user_id:int = MessageAction;
+messageActionChatDeleteUser#b2ae9b0c user_id:int = MessageAction;
+
+dialog#214a8cdf peer:Peer top_message:int unread_count:int = Dialog;
+
+photoEmpty#2331b22d id:long = Photo;
+photo#22b56751 id:long access_hash:long user_id:int date:int caption:string geo:GeoPoint sizes:Vector<PhotoSize> = Photo;
+
+photoSizeEmpty#e17e23c type:string = PhotoSize;
+photoSize#77bfb61b type:string location:FileLocation w:int h:int size:int = PhotoSize;
+photoCachedSize#e9a734fa type:string location:FileLocation w:int h:int bytes:bytes = PhotoSize;
+
+videoEmpty#c10658a8 id:long = Video;
+video#5a04a49f id:long access_hash:long user_id:int date:int caption:string duration:int size:int thumb:PhotoSize dc_id:int w:int h:int = Video;
+
+geoPointEmpty#1117dd5f = GeoPoint;
+geoPoint#2049d70c long:double lat:double = GeoPoint;
+
+auth.checkedPhone#e300cc3b phone_registered:Bool phone_invited:Bool = auth.CheckedPhone;
+
+auth.sentCode#efed51d9 phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
+
+auth.authorization#f6b673a4 expires:int user:User = auth.Authorization;
+
+auth.exportedAuthorization#df969c2d id:int bytes:bytes = auth.ExportedAuthorization;
+
+inputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer;
+inputNotifyUsers#193b4417 = InputNotifyPeer;
+inputNotifyChats#4a95e84e = InputNotifyPeer;
+inputNotifyAll#a429b886 = InputNotifyPeer;
+
+inputPeerNotifyEventsEmpty#f03064d8 = InputPeerNotifyEvents;
+inputPeerNotifyEventsAll#e86a2c74 = InputPeerNotifyEvents;
+
+inputPeerNotifySettings#46a2ce98 mute_until:int sound:string show_previews:Bool events_mask:int = InputPeerNotifySettings;
+
+peerNotifyEventsEmpty#add53cb3 = PeerNotifyEvents;
+peerNotifyEventsAll#6d1ded88 = PeerNotifyEvents;
+
+peerNotifySettingsEmpty#70a68512 = PeerNotifySettings;
+peerNotifySettings#8d5e11ee mute_until:int sound:string show_previews:Bool events_mask:int = PeerNotifySettings;
+
+wallPaper#ccb03657 id:int title:string sizes:Vector<PhotoSize> color:int = WallPaper;
+
+userFull#771095da user:User link:contacts.Link profile_photo:Photo notify_settings:PeerNotifySettings blocked:Bool real_first_name:string real_last_name:string = UserFull;
+
+contact#f911c994 user_id:int mutual:Bool = Contact;
+
+importedContact#d0028438 user_id:int client_id:long = ImportedContact;
+
+contactBlocked#561bc879 user_id:int date:int = ContactBlocked;
+
+contactFound#ea879f95 user_id:int = ContactFound;
+
+contactSuggested#3de191a1 user_id:int mutual_contacts:int = ContactSuggested;
+
+contactStatus#aa77b873 user_id:int expires:int = ContactStatus;
+
+chatLocated#3631cf4c chat_id:int distance:int = ChatLocated;
+
+contacts.foreignLinkUnknown#133421f8 = contacts.ForeignLink;
+contacts.foreignLinkRequested#a7801f47 has_phone:Bool = contacts.ForeignLink;
+contacts.foreignLinkMutual#1bea8ce1 = contacts.ForeignLink;
+
+contacts.myLinkEmpty#d22a1c60 = contacts.MyLink;
+contacts.myLinkRequested#6c69efee contact:Bool = contacts.MyLink;
+contacts.myLinkContact#c240ebd9 = contacts.MyLink;
+
+contacts.link#eccea3f5 my_link:contacts.MyLink foreign_link:contacts.ForeignLink user:User = contacts.Link;
+
+contacts.contacts#6f8b8cb2 contacts:Vector<Contact> users:Vector<User> = contacts.Contacts;
+contacts.contactsNotModified#b74ba9d2 = contacts.Contacts;
+
+contacts.importedContacts#d1cd0a4c imported:Vector<ImportedContact> users:Vector<User> = contacts.ImportedContacts;
+
+contacts.blocked#1c138d15 blocked:Vector<ContactBlocked> users:Vector<User> = contacts.Blocked;
+contacts.blockedSlice#900802a1 count:int blocked:Vector<ContactBlocked> users:Vector<User> = contacts.Blocked;
+
+contacts.found#566000e results:Vector<ContactFound> users:Vector<User> = contacts.Found;
+
+contacts.suggested#5649dcc5 results:Vector<ContactSuggested> users:Vector<User> = contacts.Suggested;
+
+messages.dialogs#15ba6c40 dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
+messages.dialogsSlice#71e094f3 count:int dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
+
+messages.messages#8c718e87 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+messages.messagesSlice#b446ae3 count:int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+
+messages.messageEmpty#3f4e0648 = messages.Message;
+messages.message#ff90c417 message:Message chats:Vector<Chat> users:Vector<User> = messages.Message;
+
+messages.statedMessages#969478bb messages:Vector<Message> chats:Vector<Chat> users:Vector<User> pts:int seq:int = messages.StatedMessages;
+
+messages.statedMessage#d07ae726 message:Message chats:Vector<Chat> users:Vector<User> pts:int seq:int = messages.StatedMessage;
+
+messages.sentMessage#d1f4d35c id:int date:int pts:int seq:int = messages.SentMessage;
+
+messages.chat#40e9002a chat:Chat users:Vector<User> = messages.Chat;
+
+messages.chats#8150cbd8 chats:Vector<Chat> users:Vector<User> = messages.Chats;
+
+messages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector<Chat> users:Vector<User> = messages.ChatFull;
+
+messages.affectedHistory#b7de36f2 pts:int seq:int offset:int = messages.AffectedHistory;
+
+inputMessagesFilterEmpty#57e2f66c = MessagesFilter;
+inputMessagesFilterPhotos#9609a51c = MessagesFilter;
+inputMessagesFilterVideo#9fc00e65 = MessagesFilter;
+inputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter;
+inputMessagesFilterDocument#9eddf188 = MessagesFilter;
+inputMessagesFilterAudio#cfc87522 = MessagesFilter;
+
+updateNewMessage#13abdb3 message:Message pts:int = Update;
+updateMessageID#4e90bfd6 id:int random_id:long = Update;
+updateReadMessages#c6649e31 messages:Vector<int> pts:int = Update;
+updateDeleteMessages#a92bfe26 messages:Vector<int> pts:int = Update;
+updateRestoreMessages#d15de04d messages:Vector<int> pts:int = Update;
+updateUserTyping#6baa8508 user_id:int = Update;
+updateChatUserTyping#3c46cfe6 chat_id:int user_id:int = Update;
+updateChatParticipants#7761198 participants:ChatParticipants = Update;
+updateUserStatus#1bfbd823 user_id:int status:UserStatus = Update;
+updateUserName#da22d9ad user_id:int first_name:string last_name:string = Update;
+updateUserPhoto#95313b0c user_id:int date:int photo:UserProfilePhoto previous:Bool = Update;
+updateContactRegistered#2575bbb9 user_id:int date:int = Update;
+updateContactLink#51a48a9a user_id:int my_link:contacts.MyLink foreign_link:contacts.ForeignLink = Update;
+updateActivation#6f690963 user_id:int = Update;
+updateNewAuthorization#8f06529a auth_key_id:long date:int device:string location:string = Update;
+
+updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
+
+updates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference;
+updates.difference#f49ca0 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> state:updates.State = updates.Difference;
+updates.differenceSlice#a8fb1981 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> intermediate_state:updates.State = updates.Difference;
+
+updatesTooLong#e317af7e = Updates;
+updateShortMessage#d3f45784 id:int from_id:int message:string pts:int date:int seq:int = Updates;
+updateShortChatMessage#2b2fbd4e id:int from_id:int chat_id:int message:string pts:int date:int seq:int = Updates;
+updateShort#78d4dec1 update:Update date:int = Updates;
+updatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;
+updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
+
+photos.photos#8dca6aa5 photos:Vector<Photo> users:Vector<User> = photos.Photos;
+photos.photosSlice#15051f54 count:int photos:Vector<Photo> users:Vector<User> = photos.Photos;
+
+photos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;
+
+upload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;
+
+dcOption#2ec2a43c id:int hostname:string ip_address:string port:int = DcOption;
+
+config#2e54dd74 date:int test_mode:Bool this_dc:int dc_options:Vector<DcOption> chat_size_max:int broadcast_size_max:int = Config;
+
+nearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;
+
+help.appUpdate#8987f311 id:int critical:Bool url:string text:string = help.AppUpdate;
+help.noAppUpdate#c45a6536 = help.AppUpdate;
+
+help.inviteText#18cb9f78 message:string = help.InviteText;
+
+messages.statedMessagesLinks#3e74f5c6 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> links:Vector<contacts.Link> pts:int seq:int = messages.StatedMessages;
+
+messages.statedMessageLink#a9af2881 message:Message chats:Vector<Chat> users:Vector<User> links:Vector<contacts.Link> pts:int seq:int = messages.StatedMessage;
+
+messages.sentMessageLink#e9db4a3f id:int date:int pts:int seq:int links:Vector<contacts.Link> = messages.SentMessage;
+
+inputGeoChat#74d456fa chat_id:int access_hash:long = InputGeoChat;
+
+inputNotifyGeoChatPeer#4d8ddec8 peer:InputGeoChat = InputNotifyPeer;
+
+geoChat#75eaea5a id:int access_hash:long title:string address:string venue:string geo:GeoPoint photo:ChatPhoto participants_count:int date:int checked_in:Bool version:int = Chat;
+
+geoChatMessageEmpty#60311a9b chat_id:int id:int = GeoChatMessage;
+geoChatMessage#4505f8e1 chat_id:int id:int from_id:int date:int message:string media:MessageMedia = GeoChatMessage;
+geoChatMessageService#d34fa24e chat_id:int id:int from_id:int date:int action:MessageAction = GeoChatMessage;
+
+geochats.statedMessage#17b1578b message:GeoChatMessage chats:Vector<Chat> users:Vector<User> seq:int = geochats.StatedMessage;
+
+geochats.located#48feb267 results:Vector<ChatLocated> messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Located;
+
+geochats.messages#d1526db1 messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Messages;
+geochats.messagesSlice#bc5863e8 count:int messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Messages;
+
+messageActionGeoChatCreate#6f038ebc title:string address:string = MessageAction;
+messageActionGeoChatCheckin#c7d53de = MessageAction;
+
+updateNewGeoChatMessage#5a68e3f7 message:GeoChatMessage = Update;
+
+wallPaperSolid#63117f24 id:int title:string bg_color:int color:int = WallPaper;
+
+updateNewEncryptedMessage#12bcbd9a message:EncryptedMessage qts:int = Update;
+updateEncryptedChatTyping#1710f156 chat_id:int = Update;
+updateEncryption#b4a2e88d chat:EncryptedChat date:int = Update;
+updateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update;
+
+encryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat;
+encryptedChatWaiting#3bf703dc id:int access_hash:long date:int admin_id:int participant_id:int = EncryptedChat;
+encryptedChatRequested#c878527e id:int access_hash:long date:int admin_id:int participant_id:int g_a:bytes = EncryptedChat;
+encryptedChat#fa56ce36 id:int access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long = EncryptedChat;
+encryptedChatDiscarded#13d6dd27 id:int = EncryptedChat;
+
+inputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat;
+
+encryptedFileEmpty#c21f497e = EncryptedFile;
+encryptedFile#4a70994c id:long access_hash:long size:int dc_id:int key_fingerprint:int = EncryptedFile;
+
+inputEncryptedFileEmpty#1837c364 = InputEncryptedFile;
+inputEncryptedFileUploaded#64bd0306 id:long parts:int md5_checksum:string key_fingerprint:int = InputEncryptedFile;
+inputEncryptedFile#5a17b5e5 id:long access_hash:long = InputEncryptedFile;
+
+inputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation;
+
+encryptedMessage#ed18c118 random_id:long chat_id:int date:int bytes:bytes file:EncryptedFile = EncryptedMessage;
+encryptedMessageService#23734b06 random_id:long chat_id:int date:int bytes:bytes = EncryptedMessage;
+
+decryptedMessageLayer#99a438cf layer:int message:DecryptedMessage = DecryptedMessageLayer;
+
+decryptedMessage#1f814f1f random_id:long random_bytes:bytes message:string media:DecryptedMessageMedia = DecryptedMessage;
+decryptedMessageService#aa48327d random_id:long random_bytes:bytes action:DecryptedMessageAction = DecryptedMessage;
+
+decryptedMessageMediaEmpty#89f5c4a = DecryptedMessageMedia;
+decryptedMessageMediaPhoto#32798a8c thumb:bytes thumb_w:int thumb_h:int w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageMediaVideo#4cee6ef3 thumb:bytes thumb_w:int thumb_h:int duration:int w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageMediaGeoPoint#35480a59 lat:double long:double = DecryptedMessageMedia;
+decryptedMessageMediaContact#588a0a97 phone_number:string first_name:string last_name:string user_id:int = DecryptedMessageMedia;
+
+decryptedMessageActionSetMessageTTL#a1733aec ttl_seconds:int = DecryptedMessageAction;
+
+messages.dhConfigNotModified#c0e24635 random:bytes = messages.DhConfig;
+messages.dhConfig#2c221edd g:int p:bytes version:int random:bytes = messages.DhConfig;
+
+messages.sentEncryptedMessage#560f8935 date:int = messages.SentEncryptedMessage;
+messages.sentEncryptedFile#9493ff32 date:int file:EncryptedFile = messages.SentEncryptedMessage;
+
+inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;
+
+inputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile;
+
+updateChatParticipantAdd#3a0eeb22 chat_id:int user_id:int inviter_id:int version:int = Update;
+updateChatParticipantDelete#6e5f8c22 chat_id:int user_id:int version:int = Update;
+updateDcOptions#8e5e9873 dc_options:Vector<DcOption> = Update;
+
+inputMediaUploadedAudio#61a6d436 file:InputFile duration:int = InputMedia;
+inputMediaAudio#89938781 id:InputAudio = InputMedia;
+inputMediaUploadedDocument#34e794bd file:InputFile file_name:string mime_type:string = InputMedia;
+inputMediaUploadedThumbDocument#3e46de5d file:InputFile thumb:InputFile file_name:string mime_type:string = InputMedia;
+inputMediaDocument#d184e841 id:InputDocument = InputMedia;
+
+messageMediaDocument#2fda2204 document:Document = MessageMedia;
+messageMediaAudio#c6b68300 audio:Audio = MessageMedia;
+
+inputAudioEmpty#d95adc84 = InputAudio;
+inputAudio#77d440ff id:long access_hash:long = InputAudio;
+
+inputDocumentEmpty#72f0eaae = InputDocument;
+inputDocument#18798952 id:long access_hash:long = InputDocument;
+
+inputAudioFileLocation#74dc404d id:long access_hash:long = InputFileLocation;
+inputDocumentFileLocation#4e45abe9 id:long access_hash:long = InputFileLocation;
+
+decryptedMessageMediaDocument#b095434b thumb:bytes thumb_w:int thumb_h:int file_name:string mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageMediaAudio#6080758f duration:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+
+audioEmpty#586988d8 id:long = Audio;
+audio#427425e7 id:long access_hash:long user_id:int date:int duration:int size:int dc_id:int = Audio;
+
+documentEmpty#36f8c871 id:long = Document;
+document#9efc6326 id:long access_hash:long user_id:int date:int file_name:string mime_type:string size:int thumb:PhotoSize dc_id:int = Document;
+
+help.support#17c6b5f6 phone_number:string user:User = help.Support;
+
+---functions---
+
+invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
+
+invokeAfterMsgs#3dc4b4f0 {X:Type} msg_ids:Vector<long> query:!X = X;
+
+auth.checkPhone#6fe51dfb phone_number:string = auth.CheckedPhone;
+auth.sendCode#768d5f4d phone_number:string sms_type:int api_id:int api_hash:string lang_code:string = auth.SentCode;
+auth.sendCall#3c51564 phone_number:string phone_code_hash:string = Bool;
+auth.signUp#1b067634 phone_number:string phone_code_hash:string phone_code:string first_name:string last_name:string = auth.Authorization;
+auth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:string = auth.Authorization;
+auth.logOut#5717da40 = Bool;
+auth.resetAuthorizations#9fab0d1a = Bool;
+auth.sendInvites#771c1d97 phone_numbers:Vector<string> message:string = Bool;
+auth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization;
+auth.importAuthorization#e3ef9613 id:int bytes:bytes = auth.Authorization;
+
+account.registerDevice#446c712c token_type:int token:string device_model:string system_version:string app_version:string app_sandbox:Bool lang_code:string = Bool;
+account.unregisterDevice#65c55b40 token_type:int token:string = Bool;
+account.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool;
+account.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings;
+account.resetNotifySettings#db7e1747 = Bool;
+account.updateProfile#f0888d68 first_name:string last_name:string = User;
+account.updateStatus#6628562c offline:Bool = Bool;
+account.getWallPapers#c04cfac2 = Vector<WallPaper>;
+
+users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
+users.getFullUser#ca30a5b1 id:InputUser = UserFull;
+
+contacts.getStatuses#c4a353ee = Vector<ContactStatus>;
+contacts.getContacts#22c6aa08 hash:string = contacts.Contacts;
+contacts.importContacts#da30b32d contacts:Vector<InputContact> replace:Bool = contacts.ImportedContacts;
+contacts.search#11f812d8 q:string limit:int = contacts.Found;
+contacts.getSuggested#cd773428 limit:int = contacts.Suggested;
+contacts.deleteContact#8e953744 id:InputUser = contacts.Link;
+contacts.deleteContacts#59ab389e id:Vector<InputUser> = Bool;
+contacts.block#332b49fc id:InputUser = Bool;
+contacts.unblock#e54100bd id:InputUser = Bool;
+contacts.getBlocked#f57c350f offset:int limit:int = contacts.Blocked;
+
+messages.getMessages#4222fa74 id:Vector<int> = messages.Messages;
+messages.getDialogs#eccf1df6 offset:int max_id:int limit:int = messages.Dialogs;
+messages.getHistory#92a1df2f peer:InputPeer offset:int max_id:int limit:int = messages.Messages;
+messages.search#7e9f2ab peer:InputPeer q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = messages.Messages;
+messages.readHistory#b04f2510 peer:InputPeer max_id:int offset:int = messages.AffectedHistory;
+messages.deleteHistory#f4f8fb61 peer:InputPeer offset:int = messages.AffectedHistory;
+messages.deleteMessages#14f2dd0a id:Vector<int> = Vector<int>;
+messages.restoreMessages#395f9d7e id:Vector<int> = Vector<int>;
+messages.receivedMessages#28abcb68 max_id:int = Vector<int>;
+messages.setTyping#719839e9 peer:InputPeer typing:Bool = Bool;
+messages.sendMessage#4cde0aab peer:InputPeer message:string random_id:long = messages.SentMessage;
+messages.sendMedia#a3c85d76 peer:InputPeer media:InputMedia random_id:long = messages.StatedMessage;
+messages.forwardMessages#514cd10f peer:InputPeer id:Vector<int> = messages.StatedMessages;
+messages.getChats#3c6aa187 id:Vector<int> = messages.Chats;
+messages.getFullChat#3b831c66 chat_id:int = messages.ChatFull;
+messages.editChatTitle#b4bc68b5 chat_id:int title:string = messages.StatedMessage;
+messages.editChatPhoto#d881821d chat_id:int photo:InputChatPhoto = messages.StatedMessage;
+messages.addChatUser#2ee9ee9e chat_id:int user_id:InputUser fwd_limit:int = messages.StatedMessage;
+messages.deleteChatUser#c3c5cd23 chat_id:int user_id:InputUser = messages.StatedMessage;
+messages.createChat#419d9aee users:Vector<InputUser> title:string = messages.StatedMessage;
+
+updates.getState#edd4882a = updates.State;
+updates.getDifference#a041495 pts:int date:int qts:int = updates.Difference;
+
+photos.updateProfilePhoto#eef579a0 id:InputPhoto crop:InputPhotoCrop = UserProfilePhoto;
+photos.uploadProfilePhoto#d50f9c88 file:InputFile caption:string geo_point:InputGeoPoint crop:InputPhotoCrop = photos.Photo;
+
+upload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool;
+upload.getFile#e3a6cfb5 location:InputFileLocation offset:int limit:int = upload.File;
+
+help.getConfig#c4f9186b = Config;
+help.getNearestDc#1fb33026 = NearestDc;
+help.getAppUpdate#c812ac7e device_model:string system_version:string app_version:string lang_code:string = help.AppUpdate;
+help.saveAppLog#6f02f748 events:Vector<InputAppEvent> = Bool;
+help.getInviteText#a4a95186 lang_code:string = help.InviteText;
+
+photos.getUserPhotos#b7ee553c user_id:InputUser offset:int max_id:int limit:int = photos.Photos;
+
+messages.forwardMessage#3f3f4f2 peer:InputPeer id:int random_id:long = messages.StatedMessage;
+messages.sendBroadcast#41bb0972 contacts:Vector<InputUser> message:string media:InputMedia = messages.StatedMessages;
+
+geochats.getLocated#7f192d8f geo_point:InputGeoPoint radius:int limit:int = geochats.Located;
+geochats.getRecents#e1427e6f offset:int limit:int = geochats.Messages;
+geochats.checkin#55b3e8fb peer:InputGeoChat = geochats.StatedMessage;
+geochats.getFullChat#6722dd6f peer:InputGeoChat = messages.ChatFull;
+geochats.editChatTitle#4c8e2273 peer:InputGeoChat title:string address:string = geochats.StatedMessage;
+geochats.editChatPhoto#35d81a95 peer:InputGeoChat photo:InputChatPhoto = geochats.StatedMessage;
+geochats.search#cfcdc44d peer:InputGeoChat q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = geochats.Messages;
+geochats.getHistory#b53f7a68 peer:InputGeoChat offset:int max_id:int limit:int = geochats.Messages;
+geochats.setTyping#8b8a729 peer:InputGeoChat typing:Bool = Bool;
+geochats.sendMessage#61b0044 peer:InputGeoChat message:string random_id:long = geochats.StatedMessage;
+geochats.sendMedia#b8f0deff peer:InputGeoChat media:InputMedia random_id:long = geochats.StatedMessage;
+geochats.createGeoChat#e092e16 title:string geo_point:InputGeoPoint address:string venue:string = geochats.StatedMessage;
+
+messages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig;
+messages.requestEncryption#f64daf43 user_id:InputUser random_id:int g_a:bytes = EncryptedChat;
+messages.acceptEncryption#3dbc0415 peer:InputEncryptedChat g_b:bytes key_fingerprint:long = EncryptedChat;
+messages.discardEncryption#edd923c5 chat_id:int = Bool;
+messages.setEncryptedTyping#791451ed peer:InputEncryptedChat typing:Bool = Bool;
+messages.readEncryptedHistory#7f4b690a peer:InputEncryptedChat max_date:int = Bool;
+messages.sendEncrypted#a9776773 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
+messages.sendEncryptedFile#9a901b66 peer:InputEncryptedChat random_id:long data:bytes file:InputEncryptedFile = messages.SentEncryptedMessage;
+messages.sendEncryptedService#32d439a4 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
+messages.receivedQueue#55a5bb66 max_qts:int = Vector<long>;
+
+upload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool;
+
+initConnection#69796de9 {X:Type} api_id:int device_model:string system_version:string app_version:string lang_code:string query:!X = X;
+
+help.getSupport#9cdf08cd = help.Support;
+
+invokeWithLayer12#dda60d3c {X:Type} query:!X = X;
diff --git a/protocols/Telegram/tgl/scheme15.tl b/protocols/Telegram/tgl/scheme15.tl
new file mode 100644
index 0000000000..4e18fad21b
--- /dev/null
+++ b/protocols/Telegram/tgl/scheme15.tl
@@ -0,0 +1,522 @@
+int ?= Int;
+long ?= Long;
+double ?= Double;
+string ?= String;
+
+bytes string = Bytes;
+
+boolFalse#bc799737 = Bool;
+boolTrue#997275b5 = Bool;
+
+vector#1cb5c415 {t:Type} # [ t ] = Vector t;
+
+error#c4b9f9bb code:int text:string = Error;
+
+null#56730bcc = Null;
+
+inputPeerEmpty#7f3b18ea = InputPeer;
+inputPeerSelf#7da07ec9 = InputPeer;
+inputPeerContact#1023dbe8 user_id:int = InputPeer;
+inputPeerForeign#9b447325 user_id:int access_hash:long = InputPeer;
+inputPeerChat#179be863 chat_id:int = InputPeer;
+
+inputUserEmpty#b98886cf = InputUser;
+inputUserSelf#f7c1b13f = InputUser;
+inputUserContact#86e94f65 user_id:int = InputUser;
+inputUserForeign#655e74ff user_id:int access_hash:long = InputUser;
+
+inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact;
+
+inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;
+
+inputMediaEmpty#9664f57f = InputMedia;
+inputMediaUploadedPhoto#2dc53a7d file:InputFile = InputMedia;
+inputMediaPhoto#8f2ab2ec id:InputPhoto = InputMedia;
+inputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;
+inputMediaContact#a6e45987 phone_number:string first_name:string last_name:string = InputMedia;
+inputMediaUploadedVideo#133ad6f6 file:InputFile duration:int w:int h:int mime_type:string = InputMedia;
+inputMediaUploadedThumbVideo#9912dabf file:InputFile thumb:InputFile duration:int w:int h:int mime_type:string = InputMedia;
+inputMediaVideo#7f023ae6 id:InputVideo = InputMedia;
+
+inputChatPhotoEmpty#1ca48f57 = InputChatPhoto;
+inputChatUploadedPhoto#94254732 file:InputFile crop:InputPhotoCrop = InputChatPhoto;
+inputChatPhoto#b2e1bf08 id:InputPhoto crop:InputPhotoCrop = InputChatPhoto;
+
+inputGeoPointEmpty#e4c123d6 = InputGeoPoint;
+inputGeoPoint#f3b7acc9 lat:double long:double = InputGeoPoint;
+
+inputPhotoEmpty#1cd7bf0d = InputPhoto;
+inputPhoto#fb95c6c4 id:long access_hash:long = InputPhoto;
+
+inputVideoEmpty#5508ec75 = InputVideo;
+inputVideo#ee579652 id:long access_hash:long = InputVideo;
+
+inputFileLocation#14637196 volume_id:long local_id:int secret:long = InputFileLocation;
+inputVideoFileLocation#3d0364ec id:long access_hash:long = InputFileLocation;
+
+inputPhotoCropAuto#ade6b004 = InputPhotoCrop;
+inputPhotoCrop#d9915325 crop_left:double crop_top:double crop_width:double = InputPhotoCrop;
+
+inputAppEvent#770656a8 time:double type:string peer:long data:string = InputAppEvent;
+
+peerUser#9db1bc6d user_id:int = Peer;
+peerChat#bad0e5bb chat_id:int = Peer;
+
+storage.fileUnknown#aa963b05 = storage.FileType;
+storage.fileJpeg#007efe0e = storage.FileType;
+storage.fileGif#cae1aadf = storage.FileType;
+storage.filePng#0a4f63c0 = storage.FileType;
+storage.filePdf#ae1e508d = storage.FileType;
+storage.fileMp3#528a0677 = storage.FileType;
+storage.fileMov#4b09ebbc = storage.FileType;
+storage.filePartial#40bc6f52 = storage.FileType;
+storage.fileMp4#b3cea0e4 = storage.FileType;
+storage.fileWebp#1081464c = storage.FileType;
+
+fileLocationUnavailable#7c596b46 volume_id:long local_id:int secret:long = FileLocation;
+fileLocation#53d69076 dc_id:int volume_id:long local_id:int secret:long = FileLocation;
+
+userEmpty#200250ba id:int = User;
+userSelf#720535ec id:int first_name:string last_name:string phone:string photo:UserProfilePhoto status:UserStatus inactive:Bool = User;
+userContact#f2fb8319 id:int first_name:string last_name:string access_hash:long phone:string photo:UserProfilePhoto status:UserStatus = User;
+userRequest#22e8ceb0 id:int first_name:string last_name:string access_hash:long phone:string photo:UserProfilePhoto status:UserStatus = User;
+userForeign#5214c89d id:int first_name:string last_name:string access_hash:long photo:UserProfilePhoto status:UserStatus = User;
+userDeleted#b29ad7cc id:int first_name:string last_name:string = User;
+
+userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
+userProfilePhoto#d559d8c8 photo_id:long photo_small:FileLocation photo_big:FileLocation = UserProfilePhoto;
+
+userStatusEmpty#09d05049 = UserStatus;
+userStatusOnline#edb93949 expires:int = UserStatus;
+userStatusOffline#008c703f was_online:int = UserStatus;
+
+chatEmpty#9ba2d800 id:int = Chat;
+chat#6e9c9bc7 id:int title:string photo:ChatPhoto participants_count:int date:int left:Bool version:int = Chat;
+chatForbidden#fb0ccc41 id:int title:string date:int = Chat;
+
+chatFull#630e61be id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings = ChatFull;
+
+chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant;
+
+chatParticipantsForbidden#0fd2bb8a chat_id:int = ChatParticipants;
+chatParticipants#7841b415 chat_id:int admin_id:int participants:Vector<ChatParticipant> version:int = ChatParticipants;
+
+chatPhotoEmpty#37c1011c = ChatPhoto;
+chatPhoto#6153276a photo_small:FileLocation photo_big:FileLocation = ChatPhoto;
+
+messageEmpty#83e5de54 id:int = Message;
+message#22eb6aba id:int from_id:int to_id:Peer out:Bool unread:Bool date:int message:string media:MessageMedia = Message;
+messageForwarded#05f46804 id:int fwd_from_id:int fwd_date:int from_id:int to_id:Peer out:Bool unread:Bool date:int message:string media:MessageMedia = Message;
+messageService#9f8d60bb id:int from_id:int to_id:Peer out:Bool unread:Bool date:int action:MessageAction = Message;
+
+messageMediaEmpty#3ded6320 = MessageMedia;
+messageMediaPhoto#c8c45a2a photo:Photo = MessageMedia;
+messageMediaVideo#a2d24290 video:Video = MessageMedia;
+messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;
+messageMediaContact#5e7d2f39 phone_number:string first_name:string last_name:string user_id:int = MessageMedia;
+messageMediaUnsupported#29632a36 bytes:bytes = MessageMedia;
+
+messageActionEmpty#b6aef7b0 = MessageAction;
+messageActionChatCreate#a6638b9a title:string users:Vector<int> = MessageAction;
+messageActionChatEditTitle#b5a1ce5a title:string = MessageAction;
+messageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction;
+messageActionChatDeletePhoto#95e3fbef = MessageAction;
+messageActionChatAddUser#5e3cfc4b user_id:int = MessageAction;
+messageActionChatDeleteUser#b2ae9b0c user_id:int = MessageAction;
+
+dialog#ab3a99ac peer:Peer top_message:int unread_count:int notify_settings:PeerNotifySettings = Dialog;
+
+photoEmpty#2331b22d id:long = Photo;
+photo#22b56751 id:long access_hash:long user_id:int date:int caption:string geo:GeoPoint sizes:Vector<PhotoSize> = Photo;
+
+photoSizeEmpty#0e17e23c type:string = PhotoSize;
+photoSize#77bfb61b type:string location:FileLocation w:int h:int size:int = PhotoSize;
+photoCachedSize#e9a734fa type:string location:FileLocation w:int h:int bytes:bytes = PhotoSize;
+
+videoEmpty#c10658a8 id:long = Video;
+video#388fa391 id:long access_hash:long user_id:int date:int caption:string duration:int mime_type:string size:int thumb:PhotoSize dc_id:int w:int h:int = Video;
+
+geoPointEmpty#1117dd5f = GeoPoint;
+geoPoint#2049d70c long:double lat:double = GeoPoint;
+
+auth.checkedPhone#e300cc3b phone_registered:Bool phone_invited:Bool = auth.CheckedPhone;
+
+auth.sentCode#efed51d9 phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
+
+auth.authorization#f6b673a4 expires:int user:User = auth.Authorization;
+
+auth.exportedAuthorization#df969c2d id:int bytes:bytes = auth.ExportedAuthorization;
+
+inputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer;
+inputNotifyUsers#193b4417 = InputNotifyPeer;
+inputNotifyChats#4a95e84e = InputNotifyPeer;
+inputNotifyAll#a429b886 = InputNotifyPeer;
+
+inputPeerNotifyEventsEmpty#f03064d8 = InputPeerNotifyEvents;
+inputPeerNotifyEventsAll#e86a2c74 = InputPeerNotifyEvents;
+
+inputPeerNotifySettings#46a2ce98 mute_until:int sound:string show_previews:Bool events_mask:int = InputPeerNotifySettings;
+
+peerNotifyEventsEmpty#add53cb3 = PeerNotifyEvents;
+peerNotifyEventsAll#6d1ded88 = PeerNotifyEvents;
+
+peerNotifySettingsEmpty#70a68512 = PeerNotifySettings;
+peerNotifySettings#8d5e11ee mute_until:int sound:string show_previews:Bool events_mask:int = PeerNotifySettings;
+
+wallPaper#ccb03657 id:int title:string sizes:Vector<PhotoSize> color:int = WallPaper;
+
+userFull#771095da user:User link:contacts.Link profile_photo:Photo notify_settings:PeerNotifySettings blocked:Bool real_first_name:string real_last_name:string = UserFull;
+
+contact#f911c994 user_id:int mutual:Bool = Contact;
+
+importedContact#d0028438 user_id:int client_id:long = ImportedContact;
+
+contactBlocked#561bc879 user_id:int date:int = ContactBlocked;
+
+contactFound#ea879f95 user_id:int = ContactFound;
+
+contactSuggested#3de191a1 user_id:int mutual_contacts:int = ContactSuggested;
+
+contactStatus#aa77b873 user_id:int expires:int = ContactStatus;
+
+chatLocated#3631cf4c chat_id:int distance:int = ChatLocated;
+
+contacts.foreignLinkUnknown#133421f8 = contacts.ForeignLink;
+contacts.foreignLinkRequested#a7801f47 has_phone:Bool = contacts.ForeignLink;
+contacts.foreignLinkMutual#1bea8ce1 = contacts.ForeignLink;
+
+contacts.myLinkEmpty#d22a1c60 = contacts.MyLink;
+contacts.myLinkRequested#6c69efee contact:Bool = contacts.MyLink;
+contacts.myLinkContact#c240ebd9 = contacts.MyLink;
+
+contacts.link#eccea3f5 my_link:contacts.MyLink foreign_link:contacts.ForeignLink user:User = contacts.Link;
+
+contacts.contacts#6f8b8cb2 contacts:Vector<Contact> users:Vector<User> = contacts.Contacts;
+contacts.contactsNotModified#b74ba9d2 = contacts.Contacts;
+
+contacts.importedContacts#ad524315 imported:Vector<ImportedContact> retry_contacts:Vector<long> users:Vector<User> = contacts.ImportedContacts;
+
+contacts.blocked#1c138d15 blocked:Vector<ContactBlocked> users:Vector<User> = contacts.Blocked;
+contacts.blockedSlice#900802a1 count:int blocked:Vector<ContactBlocked> users:Vector<User> = contacts.Blocked;
+
+contacts.found#0566000e results:Vector<ContactFound> users:Vector<User> = contacts.Found;
+
+contacts.suggested#5649dcc5 results:Vector<ContactSuggested> users:Vector<User> = contacts.Suggested;
+
+messages.dialogs#15ba6c40 dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
+messages.dialogsSlice#71e094f3 count:int dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
+
+messages.messages#8c718e87 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+messages.messagesSlice#0b446ae3 count:int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+
+messages.messageEmpty#3f4e0648 = messages.Message;
+messages.message#ff90c417 message:Message chats:Vector<Chat> users:Vector<User> = messages.Message;
+
+messages.statedMessages#969478bb messages:Vector<Message> chats:Vector<Chat> users:Vector<User> pts:int seq:int = messages.StatedMessages;
+
+messages.statedMessage#d07ae726 message:Message chats:Vector<Chat> users:Vector<User> pts:int seq:int = messages.StatedMessage;
+
+messages.sentMessage#d1f4d35c id:int date:int pts:int seq:int = messages.SentMessage;
+
+messages.chat#40e9002a chat:Chat users:Vector<User> = messages.Chat;
+
+messages.chats#8150cbd8 chats:Vector<Chat> users:Vector<User> = messages.Chats;
+
+messages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector<Chat> users:Vector<User> = messages.ChatFull;
+
+messages.affectedHistory#b7de36f2 pts:int seq:int offset:int = messages.AffectedHistory;
+
+inputMessagesFilterEmpty#57e2f66c = MessagesFilter;
+inputMessagesFilterPhotos#9609a51c = MessagesFilter;
+inputMessagesFilterVideo#9fc00e65 = MessagesFilter;
+inputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter;
+inputMessagesFilterDocument#9eddf188 = MessagesFilter;
+inputMessagesFilterAudio#cfc87522 = MessagesFilter;
+
+updateNewMessage#013abdb3 message:Message pts:int = Update;
+updateMessageID#4e90bfd6 id:int random_id:long = Update;
+updateReadMessages#c6649e31 messages:Vector<int> pts:int = Update;
+updateDeleteMessages#a92bfe26 messages:Vector<int> pts:int = Update;
+updateRestoreMessages#d15de04d messages:Vector<int> pts:int = Update;
+updateUserTyping#6baa8508 user_id:int = Update;
+updateChatUserTyping#3c46cfe6 chat_id:int user_id:int = Update;
+updateChatParticipants#07761198 participants:ChatParticipants = Update;
+updateUserStatus#1bfbd823 user_id:int status:UserStatus = Update;
+updateUserName#da22d9ad user_id:int first_name:string last_name:string = Update;
+updateUserPhoto#95313b0c user_id:int date:int photo:UserProfilePhoto previous:Bool = Update;
+updateContactRegistered#2575bbb9 user_id:int date:int = Update;
+updateContactLink#51a48a9a user_id:int my_link:contacts.MyLink foreign_link:contacts.ForeignLink = Update;
+updateActivation#6f690963 user_id:int = Update;
+updateNewAuthorization#8f06529a auth_key_id:long date:int device:string location:string = Update;
+
+updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
+
+updates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference;
+updates.difference#00f49ca0 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> state:updates.State = updates.Difference;
+updates.differenceSlice#a8fb1981 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> intermediate_state:updates.State = updates.Difference;
+
+updatesTooLong#e317af7e = Updates;
+updateShortMessage#d3f45784 id:int from_id:int message:string pts:int date:int seq:int = Updates;
+updateShortChatMessage#2b2fbd4e id:int from_id:int chat_id:int message:string pts:int date:int seq:int = Updates;
+updateShort#78d4dec1 update:Update date:int = Updates;
+updatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;
+updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
+
+photos.photos#8dca6aa5 photos:Vector<Photo> users:Vector<User> = photos.Photos;
+photos.photosSlice#15051f54 count:int photos:Vector<Photo> users:Vector<User> = photos.Photos;
+
+photos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;
+
+upload.file#096a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;
+
+dcOption#2ec2a43c id:int hostname:string ip_address:string port:int = DcOption;
+
+config#2e54dd74 date:int test_mode:Bool this_dc:int dc_options:Vector<DcOption> chat_size_max:int broadcast_size_max:int = Config;
+
+nearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;
+
+help.appUpdate#8987f311 id:int critical:Bool url:string text:string = help.AppUpdate;
+help.noAppUpdate#c45a6536 = help.AppUpdate;
+
+help.inviteText#18cb9f78 message:string = help.InviteText;
+
+messages.statedMessagesLinks#3e74f5c6 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> links:Vector<contacts.Link> pts:int seq:int = messages.StatedMessages;
+
+messages.statedMessageLink#a9af2881 message:Message chats:Vector<Chat> users:Vector<User> links:Vector<contacts.Link> pts:int seq:int = messages.StatedMessage;
+
+messages.sentMessageLink#e9db4a3f id:int date:int pts:int seq:int links:Vector<contacts.Link> = messages.SentMessage;
+
+inputGeoChat#74d456fa chat_id:int access_hash:long = InputGeoChat;
+
+inputNotifyGeoChatPeer#4d8ddec8 peer:InputGeoChat = InputNotifyPeer;
+
+geoChat#75eaea5a id:int access_hash:long title:string address:string venue:string geo:GeoPoint photo:ChatPhoto participants_count:int date:int checked_in:Bool version:int = Chat;
+
+geoChatMessageEmpty#60311a9b chat_id:int id:int = GeoChatMessage;
+geoChatMessage#4505f8e1 chat_id:int id:int from_id:int date:int message:string media:MessageMedia = GeoChatMessage;
+geoChatMessageService#d34fa24e chat_id:int id:int from_id:int date:int action:MessageAction = GeoChatMessage;
+
+geochats.statedMessage#17b1578b message:GeoChatMessage chats:Vector<Chat> users:Vector<User> seq:int = geochats.StatedMessage;
+
+geochats.located#48feb267 results:Vector<ChatLocated> messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Located;
+
+geochats.messages#d1526db1 messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Messages;
+geochats.messagesSlice#bc5863e8 count:int messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Messages;
+
+messageActionGeoChatCreate#6f038ebc title:string address:string = MessageAction;
+messageActionGeoChatCheckin#0c7d53de = MessageAction;
+
+updateNewGeoChatMessage#5a68e3f7 message:GeoChatMessage = Update;
+
+wallPaperSolid#63117f24 id:int title:string bg_color:int color:int = WallPaper;
+
+updateNewEncryptedMessage#12bcbd9a message:EncryptedMessage qts:int = Update;
+updateEncryptedChatTyping#1710f156 chat_id:int = Update;
+updateEncryption#b4a2e88d chat:EncryptedChat date:int = Update;
+updateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update;
+
+encryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat;
+encryptedChatWaiting#3bf703dc id:int access_hash:long date:int admin_id:int participant_id:int = EncryptedChat;
+encryptedChatRequested#c878527e id:int access_hash:long date:int admin_id:int participant_id:int g_a:bytes = EncryptedChat;
+encryptedChat#fa56ce36 id:int access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long = EncryptedChat;
+encryptedChatDiscarded#13d6dd27 id:int = EncryptedChat;
+
+inputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat;
+
+encryptedFileEmpty#c21f497e = EncryptedFile;
+encryptedFile#4a70994c id:long access_hash:long size:int dc_id:int key_fingerprint:int = EncryptedFile;
+
+inputEncryptedFileEmpty#1837c364 = InputEncryptedFile;
+inputEncryptedFileUploaded#64bd0306 id:long parts:int md5_checksum:string key_fingerprint:int = InputEncryptedFile;
+inputEncryptedFile#5a17b5e5 id:long access_hash:long = InputEncryptedFile;
+
+inputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation;
+
+encryptedMessage#ed18c118 random_id:long chat_id:int date:int bytes:bytes file:EncryptedFile = EncryptedMessage;
+encryptedMessageService#23734b06 random_id:long chat_id:int date:int bytes:bytes = EncryptedMessage;
+
+decryptedMessageLayer#99a438cf layer:int message:DecryptedMessage = DecryptedMessageLayer;
+
+decryptedMessage#1f814f1f random_id:long random_bytes:bytes message:string media:DecryptedMessageMedia = DecryptedMessage;
+decryptedMessageService#aa48327d random_id:long random_bytes:bytes action:DecryptedMessageAction = DecryptedMessage;
+
+decryptedMessageMediaEmpty#089f5c4a = DecryptedMessageMedia;
+decryptedMessageMediaPhoto#32798a8c thumb:bytes thumb_w:int thumb_h:int w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageMediaVideo#524a415d thumb:bytes thumb_w:int thumb_h:int duration:int mime_type:string w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageMediaGeoPoint#35480a59 lat:double long:double = DecryptedMessageMedia;
+decryptedMessageMediaContact#588a0a97 phone_number:string first_name:string last_name:string user_id:int = DecryptedMessageMedia;
+
+decryptedMessageActionSetMessageTTL#a1733aec ttl_seconds:int = DecryptedMessageAction;
+
+messages.dhConfigNotModified#c0e24635 random:bytes = messages.DhConfig;
+messages.dhConfig#2c221edd g:int p:bytes version:int random:bytes = messages.DhConfig;
+
+messages.sentEncryptedMessage#560f8935 date:int = messages.SentEncryptedMessage;
+messages.sentEncryptedFile#9493ff32 date:int file:EncryptedFile = messages.SentEncryptedMessage;
+
+inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;
+
+inputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile;
+
+updateChatParticipantAdd#3a0eeb22 chat_id:int user_id:int inviter_id:int version:int = Update;
+updateChatParticipantDelete#6e5f8c22 chat_id:int user_id:int version:int = Update;
+updateDcOptions#8e5e9873 dc_options:Vector<DcOption> = Update;
+
+inputMediaUploadedAudio#4e498cab file:InputFile duration:int mime_type:string = InputMedia;
+inputMediaAudio#89938781 id:InputAudio = InputMedia;
+inputMediaUploadedDocument#34e794bd file:InputFile file_name:string mime_type:string = InputMedia;
+inputMediaUploadedThumbDocument#3e46de5d file:InputFile thumb:InputFile file_name:string mime_type:string = InputMedia;
+inputMediaDocument#d184e841 id:InputDocument = InputMedia;
+
+messageMediaDocument#2fda2204 document:Document = MessageMedia;
+messageMediaAudio#c6b68300 audio:Audio = MessageMedia;
+
+inputAudioEmpty#d95adc84 = InputAudio;
+inputAudio#77d440ff id:long access_hash:long = InputAudio;
+
+inputDocumentEmpty#72f0eaae = InputDocument;
+inputDocument#18798952 id:long access_hash:long = InputDocument;
+
+inputAudioFileLocation#74dc404d id:long access_hash:long = InputFileLocation;
+inputDocumentFileLocation#4e45abe9 id:long access_hash:long = InputFileLocation;
+
+decryptedMessageMediaDocument#b095434b thumb:bytes thumb_w:int thumb_h:int file_name:string mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia;
+decryptedMessageMediaAudio#57e0a9cb duration:int mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia;
+
+audioEmpty#586988d8 id:long = Audio;
+audio#c7ac6496 id:long access_hash:long user_id:int date:int duration:int mime_type:string size:int dc_id:int = Audio;
+
+documentEmpty#36f8c871 id:long = Document;
+document#9efc6326 id:long access_hash:long user_id:int date:int file_name:string mime_type:string size:int thumb:PhotoSize dc_id:int = Document;
+
+help.support#17c6b5f6 phone_number:string user:User = help.Support;
+
+decryptedMessageActionReadMessages#0c4f40be random_ids:Vector<long> = DecryptedMessageAction;
+decryptedMessageActionDeleteMessages#65614304 random_ids:Vector<long> = DecryptedMessageAction;
+decryptedMessageActionScreenshotMessages#8ac1f475 random_ids:Vector<long> = DecryptedMessageAction;
+decryptedMessageActionFlushHistory#6719e45c = DecryptedMessageAction;
+decryptedMessageActionNotifyLayer#f3048883 layer:int = DecryptedMessageAction;
+
+notifyPeer#9fd40bd8 peer:Peer = NotifyPeer;
+notifyUsers#b4c83b4c = NotifyPeer;
+notifyChats#c007cec3 = NotifyPeer;
+notifyAll#74d07c60 = NotifyPeer;
+
+updateUserBlocked#80ece81a user_id:int blocked:Bool = Update;
+updateNotifySettings#bec268ef peer:NotifyPeer notify_settings:PeerNotifySettings = Update;
+
+za int = Z 0;
+zb {n:#} int %(Vector int) = Z (n + 1);
+
+---functions---
+
+invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
+
+invokeAfterMsgs#3dc4b4f0 {X:Type} msg_ids:Vector<long> query:!X = X;
+
+auth.checkPhone#6fe51dfb phone_number:string = auth.CheckedPhone;
+auth.sendCode#768d5f4d phone_number:string sms_type:int api_id:int api_hash:string lang_code:string = auth.SentCode;
+auth.sendCall#03c51564 phone_number:string phone_code_hash:string = Bool;
+auth.signUp#1b067634 phone_number:string phone_code_hash:string phone_code:string first_name:string last_name:string = auth.Authorization;
+auth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:string = auth.Authorization;
+auth.logOut#5717da40 = Bool;
+auth.resetAuthorizations#9fab0d1a = Bool;
+auth.sendInvites#771c1d97 phone_numbers:Vector<string> message:string = Bool;
+auth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization;
+auth.importAuthorization#e3ef9613 id:int bytes:bytes = auth.Authorization;
+
+account.registerDevice#446c712c token_type:int token:string device_model:string system_version:string app_version:string app_sandbox:Bool lang_code:string = Bool;
+account.unregisterDevice#65c55b40 token_type:int token:string = Bool;
+account.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool;
+account.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings;
+account.resetNotifySettings#db7e1747 = Bool;
+account.updateProfile#f0888d68 first_name:string last_name:string = User;
+account.updateStatus#6628562c offline:Bool = Bool;
+account.getWallPapers#c04cfac2 = Vector<WallPaper>;
+
+users.getUsers#0d91a548 id:Vector<InputUser> = Vector<User>;
+users.getFullUser#ca30a5b1 id:InputUser = UserFull;
+
+contacts.getStatuses#c4a353ee = Vector<ContactStatus>;
+contacts.getContacts#22c6aa08 hash:string = contacts.Contacts;
+contacts.importContacts#da30b32d contacts:Vector<InputContact> replace:Bool = contacts.ImportedContacts;
+contacts.search#11f812d8 q:string limit:int = contacts.Found;
+contacts.getSuggested#cd773428 limit:int = contacts.Suggested;
+contacts.deleteContact#8e953744 id:InputUser = contacts.Link;
+contacts.deleteContacts#59ab389e id:Vector<InputUser> = Bool;
+contacts.block#332b49fc id:InputUser = Bool;
+contacts.unblock#e54100bd id:InputUser = Bool;
+contacts.getBlocked#f57c350f offset:int limit:int = contacts.Blocked;
+
+messages.getMessages#4222fa74 id:Vector<int> = messages.Messages;
+messages.getDialogs#eccf1df6 offset:int max_id:int limit:int = messages.Dialogs;
+messages.getHistory#92a1df2f peer:InputPeer offset:int max_id:int limit:int = messages.Messages;
+messages.search#07e9f2ab peer:InputPeer q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = messages.Messages;
+messages.readHistory#b04f2510 peer:InputPeer max_id:int offset:int = messages.AffectedHistory;
+messages.deleteHistory#f4f8fb61 peer:InputPeer offset:int = messages.AffectedHistory;
+messages.deleteMessages#14f2dd0a id:Vector<int> = Vector<int>;
+messages.restoreMessages#395f9d7e id:Vector<int> = Vector<int>;
+messages.receivedMessages#28abcb68 max_id:int = Vector<int>;
+messages.setTyping#719839e9 peer:InputPeer typing:Bool = Bool;
+messages.sendMessage#4cde0aab peer:InputPeer message:string random_id:long = messages.SentMessage;
+messages.sendMedia#a3c85d76 peer:InputPeer media:InputMedia random_id:long = messages.StatedMessage;
+messages.forwardMessages#514cd10f peer:InputPeer id:Vector<int> = messages.StatedMessages;
+messages.getChats#3c6aa187 id:Vector<int> = messages.Chats;
+messages.getFullChat#3b831c66 chat_id:int = messages.ChatFull;
+messages.editChatTitle#b4bc68b5 chat_id:int title:string = messages.StatedMessage;
+messages.editChatPhoto#d881821d chat_id:int photo:InputChatPhoto = messages.StatedMessage;
+messages.addChatUser#2ee9ee9e chat_id:int user_id:InputUser fwd_limit:int = messages.StatedMessage;
+messages.deleteChatUser#c3c5cd23 chat_id:int user_id:InputUser = messages.StatedMessage;
+messages.createChat#419d9aee users:Vector<InputUser> title:string = messages.StatedMessage;
+
+updates.getState#edd4882a = updates.State;
+updates.getDifference#0a041495 pts:int date:int qts:int = updates.Difference;
+
+photos.updateProfilePhoto#eef579a0 id:InputPhoto crop:InputPhotoCrop = UserProfilePhoto;
+photos.uploadProfilePhoto#d50f9c88 file:InputFile caption:string geo_point:InputGeoPoint crop:InputPhotoCrop = photos.Photo;
+
+upload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool;
+upload.getFile#e3a6cfb5 location:InputFileLocation offset:int limit:int = upload.File;
+
+help.getConfig#c4f9186b = Config;
+help.getNearestDc#1fb33026 = NearestDc;
+help.getAppUpdate#c812ac7e device_model:string system_version:string app_version:string lang_code:string = help.AppUpdate;
+help.saveAppLog#6f02f748 events:Vector<InputAppEvent> = Bool;
+help.getInviteText#a4a95186 lang_code:string = help.InviteText;
+
+photos.getUserPhotos#b7ee553c user_id:InputUser offset:int max_id:int limit:int = photos.Photos;
+
+messages.forwardMessage#03f3f4f2 peer:InputPeer id:int random_id:long = messages.StatedMessage;
+messages.sendBroadcast#41bb0972 contacts:Vector<InputUser> message:string media:InputMedia = messages.StatedMessages;
+
+geochats.getLocated#7f192d8f geo_point:InputGeoPoint radius:int limit:int = geochats.Located;
+geochats.getRecents#e1427e6f offset:int limit:int = geochats.Messages;
+geochats.checkin#55b3e8fb peer:InputGeoChat = geochats.StatedMessage;
+geochats.getFullChat#6722dd6f peer:InputGeoChat = messages.ChatFull;
+geochats.editChatTitle#4c8e2273 peer:InputGeoChat title:string address:string = geochats.StatedMessage;
+geochats.editChatPhoto#35d81a95 peer:InputGeoChat photo:InputChatPhoto = geochats.StatedMessage;
+geochats.search#cfcdc44d peer:InputGeoChat q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = geochats.Messages;
+geochats.getHistory#b53f7a68 peer:InputGeoChat offset:int max_id:int limit:int = geochats.Messages;
+geochats.setTyping#08b8a729 peer:InputGeoChat typing:Bool = Bool;
+geochats.sendMessage#061b0044 peer:InputGeoChat message:string random_id:long = geochats.StatedMessage;
+geochats.sendMedia#b8f0deff peer:InputGeoChat media:InputMedia random_id:long = geochats.StatedMessage;
+geochats.createGeoChat#0e092e16 title:string geo_point:InputGeoPoint address:string venue:string = geochats.StatedMessage;
+
+messages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig;
+messages.requestEncryption#f64daf43 user_id:InputUser random_id:int g_a:bytes = EncryptedChat;
+messages.acceptEncryption#3dbc0415 peer:InputEncryptedChat g_b:bytes key_fingerprint:long = EncryptedChat;
+messages.discardEncryption#edd923c5 chat_id:int = Bool;
+messages.setEncryptedTyping#791451ed peer:InputEncryptedChat typing:Bool = Bool;
+messages.readEncryptedHistory#7f4b690a peer:InputEncryptedChat max_date:int = Bool;
+messages.sendEncrypted#a9776773 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
+messages.sendEncryptedFile#9a901b66 peer:InputEncryptedChat random_id:long data:bytes file:InputEncryptedFile = messages.SentEncryptedMessage;
+messages.sendEncryptedService#32d439a4 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
+messages.receivedQueue#55a5bb66 max_qts:int = Vector<long>;
+
+upload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool;
+
+initConnection#69796de9 {X:Type} api_id:int device_model:string system_version:string app_version:string lang_code:string query:!X = X;
+
+help.getSupport#9cdf08cd = help.Support;
+
+invokeWithLayer15#b4418b64 {X:Type} query:!X = X;
diff --git a/protocols/Telegram/tgl/scheme16.tl b/protocols/Telegram/tgl/scheme16.tl
new file mode 100644
index 0000000000..b1e1f196d8
--- /dev/null
+++ b/protocols/Telegram/tgl/scheme16.tl
@@ -0,0 +1,504 @@
+int ?= Int;
+long ?= Long;
+double ?= Double;
+string ?= String;
+
+bytes string = Bytes;
+
+boolFalse#bc799737 = Bool;
+boolTrue#997275b5 = Bool;
+
+vector#1cb5c415 {t:Type} # [ t ] = Vector t;
+
+error#c4b9f9bb code:int text:string = Error;
+
+null#56730bcc = Null;
+
+inputPeerEmpty#7f3b18ea = InputPeer;
+inputPeerSelf#7da07ec9 = InputPeer;
+inputPeerContact#1023dbe8 user_id:int = InputPeer;
+inputPeerForeign#9b447325 user_id:int access_hash:long = InputPeer;
+inputPeerChat#179be863 chat_id:int = InputPeer;
+
+inputUserEmpty#b98886cf = InputUser;
+inputUserSelf#f7c1b13f = InputUser;
+inputUserContact#86e94f65 user_id:int = InputUser;
+inputUserForeign#655e74ff user_id:int access_hash:long = InputUser;
+
+inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact;
+
+inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;
+
+inputMediaEmpty#9664f57f = InputMedia;
+inputMediaUploadedPhoto#2dc53a7d file:InputFile = InputMedia;
+inputMediaPhoto#8f2ab2ec id:InputPhoto = InputMedia;
+inputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;
+inputMediaContact#a6e45987 phone_number:string first_name:string last_name:string = InputMedia;
+inputMediaUploadedVideo#133ad6f6 file:InputFile duration:int w:int h:int mime_type:string = InputMedia;
+inputMediaUploadedThumbVideo#9912dabf file:InputFile thumb:InputFile duration:int w:int h:int mime_type:string = InputMedia;
+inputMediaVideo#7f023ae6 id:InputVideo = InputMedia;
+
+inputChatPhotoEmpty#1ca48f57 = InputChatPhoto;
+inputChatUploadedPhoto#94254732 file:InputFile crop:InputPhotoCrop = InputChatPhoto;
+inputChatPhoto#b2e1bf08 id:InputPhoto crop:InputPhotoCrop = InputChatPhoto;
+
+inputGeoPointEmpty#e4c123d6 = InputGeoPoint;
+inputGeoPoint#f3b7acc9 lat:double long:double = InputGeoPoint;
+
+inputPhotoEmpty#1cd7bf0d = InputPhoto;
+inputPhoto#fb95c6c4 id:long access_hash:long = InputPhoto;
+
+inputVideoEmpty#5508ec75 = InputVideo;
+inputVideo#ee579652 id:long access_hash:long = InputVideo;
+
+inputFileLocation#14637196 volume_id:long local_id:int secret:long = InputFileLocation;
+inputVideoFileLocation#3d0364ec id:long access_hash:long = InputFileLocation;
+
+inputPhotoCropAuto#ade6b004 = InputPhotoCrop;
+inputPhotoCrop#d9915325 crop_left:double crop_top:double crop_width:double = InputPhotoCrop;
+
+inputAppEvent#770656a8 time:double type:string peer:long data:string = InputAppEvent;
+
+peerUser#9db1bc6d user_id:int = Peer;
+peerChat#bad0e5bb chat_id:int = Peer;
+
+storage.fileUnknown#aa963b05 = storage.FileType;
+storage.fileJpeg#7efe0e = storage.FileType;
+storage.fileGif#cae1aadf = storage.FileType;
+storage.filePng#a4f63c0 = storage.FileType;
+storage.filePdf#ae1e508d = storage.FileType;
+storage.fileMp3#528a0677 = storage.FileType;
+storage.fileMov#4b09ebbc = storage.FileType;
+storage.filePartial#40bc6f52 = storage.FileType;
+storage.fileMp4#b3cea0e4 = storage.FileType;
+storage.fileWebp#1081464c = storage.FileType;
+
+fileLocationUnavailable#7c596b46 volume_id:long local_id:int secret:long = FileLocation;
+fileLocation#53d69076 dc_id:int volume_id:long local_id:int secret:long = FileLocation;
+
+userEmpty#200250ba id:int = User;
+userSelf#720535ec id:int first_name:string last_name:string phone:string photo:UserProfilePhoto status:UserStatus inactive:Bool = User;
+userContact#f2fb8319 id:int first_name:string last_name:string access_hash:long phone:string photo:UserProfilePhoto status:UserStatus = User;
+userRequest#22e8ceb0 id:int first_name:string last_name:string access_hash:long phone:string photo:UserProfilePhoto status:UserStatus = User;
+userForeign#5214c89d id:int first_name:string last_name:string access_hash:long photo:UserProfilePhoto status:UserStatus = User;
+userDeleted#b29ad7cc id:int first_name:string last_name:string = User;
+
+userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
+userProfilePhoto#d559d8c8 photo_id:long photo_small:FileLocation photo_big:FileLocation = UserProfilePhoto;
+
+userStatusEmpty#9d05049 = UserStatus;
+userStatusOnline#edb93949 expires:int = UserStatus;
+userStatusOffline#8c703f was_online:int = UserStatus;
+
+chatEmpty#9ba2d800 id:int = Chat;
+chat#6e9c9bc7 id:int title:string photo:ChatPhoto participants_count:int date:int left:Bool version:int = Chat;
+chatForbidden#fb0ccc41 id:int title:string date:int = Chat;
+
+chatFull#630e61be id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings = ChatFull;
+
+chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant;
+
+chatParticipantsForbidden#fd2bb8a chat_id:int = ChatParticipants;
+chatParticipants#7841b415 chat_id:int admin_id:int participants:Vector<ChatParticipant> version:int = ChatParticipants;
+
+chatPhotoEmpty#37c1011c = ChatPhoto;
+chatPhoto#6153276a photo_small:FileLocation photo_big:FileLocation = ChatPhoto;
+
+messageEmpty#83e5de54 id:int = Message;
+message#22eb6aba id:int from_id:int to_id:Peer out:Bool unread:Bool date:int message:string media:MessageMedia = Message;
+messageForwarded#5f46804 id:int fwd_from_id:int fwd_date:int from_id:int to_id:Peer out:Bool unread:Bool date:int message:string media:MessageMedia = Message;
+messageService#9f8d60bb id:int from_id:int to_id:Peer out:Bool unread:Bool date:int action:MessageAction = Message;
+
+messageMediaEmpty#3ded6320 = MessageMedia;
+messageMediaPhoto#c8c45a2a photo:Photo = MessageMedia;
+messageMediaVideo#a2d24290 video:Video = MessageMedia;
+messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;
+messageMediaContact#5e7d2f39 phone_number:string first_name:string last_name:string user_id:int = MessageMedia;
+messageMediaUnsupported#29632a36 bytes:bytes = MessageMedia;
+
+messageActionEmpty#b6aef7b0 = MessageAction;
+messageActionChatCreate#a6638b9a title:string users:Vector<int> = MessageAction;
+messageActionChatEditTitle#b5a1ce5a title:string = MessageAction;
+messageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction;
+messageActionChatDeletePhoto#95e3fbef = MessageAction;
+messageActionChatAddUser#5e3cfc4b user_id:int = MessageAction;
+messageActionChatDeleteUser#b2ae9b0c user_id:int = MessageAction;
+
+dialog#ab3a99ac peer:Peer top_message:int unread_count:int notify_settings:PeerNotifySettings = Dialog;
+
+photoEmpty#2331b22d id:long = Photo;
+photo#22b56751 id:long access_hash:long user_id:int date:int caption:string geo:GeoPoint sizes:Vector<PhotoSize> = Photo;
+
+photoSizeEmpty#e17e23c type:string = PhotoSize;
+photoSize#77bfb61b type:string location:FileLocation w:int h:int size:int = PhotoSize;
+photoCachedSize#e9a734fa type:string location:FileLocation w:int h:int bytes:bytes = PhotoSize;
+
+videoEmpty#c10658a8 id:long = Video;
+video#388fa391 id:long access_hash:long user_id:int date:int caption:string duration:int mime_type:string size:int thumb:PhotoSize dc_id:int w:int h:int = Video;
+
+geoPointEmpty#1117dd5f = GeoPoint;
+geoPoint#2049d70c long:double lat:double = GeoPoint;
+
+auth.checkedPhone#e300cc3b phone_registered:Bool phone_invited:Bool = auth.CheckedPhone;
+
+auth.sentCode#efed51d9 phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
+
+auth.authorization#f6b673a4 expires:int user:User = auth.Authorization;
+
+auth.exportedAuthorization#df969c2d id:int bytes:bytes = auth.ExportedAuthorization;
+
+inputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer;
+inputNotifyUsers#193b4417 = InputNotifyPeer;
+inputNotifyChats#4a95e84e = InputNotifyPeer;
+inputNotifyAll#a429b886 = InputNotifyPeer;
+
+inputPeerNotifyEventsEmpty#f03064d8 = InputPeerNotifyEvents;
+inputPeerNotifyEventsAll#e86a2c74 = InputPeerNotifyEvents;
+
+inputPeerNotifySettings#46a2ce98 mute_until:int sound:string show_previews:Bool events_mask:int = InputPeerNotifySettings;
+
+peerNotifyEventsEmpty#add53cb3 = PeerNotifyEvents;
+peerNotifyEventsAll#6d1ded88 = PeerNotifyEvents;
+
+peerNotifySettingsEmpty#70a68512 = PeerNotifySettings;
+peerNotifySettings#8d5e11ee mute_until:int sound:string show_previews:Bool events_mask:int = PeerNotifySettings;
+
+wallPaper#ccb03657 id:int title:string sizes:Vector<PhotoSize> color:int = WallPaper;
+
+userFull#771095da user:User link:contacts.Link profile_photo:Photo notify_settings:PeerNotifySettings blocked:Bool real_first_name:string real_last_name:string = UserFull;
+
+contact#f911c994 user_id:int mutual:Bool = Contact;
+
+importedContact#d0028438 user_id:int client_id:long = ImportedContact;
+
+contactBlocked#561bc879 user_id:int date:int = ContactBlocked;
+
+contactFound#ea879f95 user_id:int = ContactFound;
+
+contactSuggested#3de191a1 user_id:int mutual_contacts:int = ContactSuggested;
+
+contactStatus#aa77b873 user_id:int expires:int = ContactStatus;
+
+chatLocated#3631cf4c chat_id:int distance:int = ChatLocated;
+
+contacts.foreignLinkUnknown#133421f8 = contacts.ForeignLink;
+contacts.foreignLinkRequested#a7801f47 has_phone:Bool = contacts.ForeignLink;
+contacts.foreignLinkMutual#1bea8ce1 = contacts.ForeignLink;
+
+contacts.myLinkEmpty#d22a1c60 = contacts.MyLink;
+contacts.myLinkRequested#6c69efee contact:Bool = contacts.MyLink;
+contacts.myLinkContact#c240ebd9 = contacts.MyLink;
+
+contacts.link#eccea3f5 my_link:contacts.MyLink foreign_link:contacts.ForeignLink user:User = contacts.Link;
+
+contacts.contacts#6f8b8cb2 contacts:Vector<Contact> users:Vector<User> = contacts.Contacts;
+contacts.contactsNotModified#b74ba9d2 = contacts.Contacts;
+
+contacts.importedContacts#ad524315 imported:Vector<ImportedContact> retry_contacts:Vector<long> users:Vector<User> = contacts.ImportedContacts;
+
+contacts.blocked#1c138d15 blocked:Vector<ContactBlocked> users:Vector<User> = contacts.Blocked;
+contacts.blockedSlice#900802a1 count:int blocked:Vector<ContactBlocked> users:Vector<User> = contacts.Blocked;
+
+contacts.found#566000e results:Vector<ContactFound> users:Vector<User> = contacts.Found;
+
+contacts.suggested#5649dcc5 results:Vector<ContactSuggested> users:Vector<User> = contacts.Suggested;
+
+messages.dialogs#15ba6c40 dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
+messages.dialogsSlice#71e094f3 count:int dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
+
+messages.messages#8c718e87 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+messages.messagesSlice#b446ae3 count:int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+
+messages.messageEmpty#3f4e0648 = messages.Message;
+messages.message#ff90c417 message:Message chats:Vector<Chat> users:Vector<User> = messages.Message;
+
+messages.statedMessages#969478bb messages:Vector<Message> chats:Vector<Chat> users:Vector<User> pts:int seq:int = messages.StatedMessages;
+
+messages.statedMessage#d07ae726 message:Message chats:Vector<Chat> users:Vector<User> pts:int seq:int = messages.StatedMessage;
+
+messages.sentMessage#d1f4d35c id:int date:int pts:int seq:int = messages.SentMessage;
+
+messages.chat#40e9002a chat:Chat users:Vector<User> = messages.Chat;
+
+messages.chats#8150cbd8 chats:Vector<Chat> users:Vector<User> = messages.Chats;
+
+messages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector<Chat> users:Vector<User> = messages.ChatFull;
+
+messages.affectedHistory#b7de36f2 pts:int seq:int offset:int = messages.AffectedHistory;
+
+inputMessagesFilterEmpty#57e2f66c = MessagesFilter;
+inputMessagesFilterPhotos#9609a51c = MessagesFilter;
+inputMessagesFilterVideo#9fc00e65 = MessagesFilter;
+inputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter;
+inputMessagesFilterDocument#9eddf188 = MessagesFilter;
+inputMessagesFilterAudio#cfc87522 = MessagesFilter;
+
+updateNewMessage#13abdb3 message:Message pts:int = Update;
+updateMessageID#4e90bfd6 id:int random_id:long = Update;
+updateReadMessages#c6649e31 messages:Vector<int> pts:int = Update;
+updateDeleteMessages#a92bfe26 messages:Vector<int> pts:int = Update;
+updateRestoreMessages#d15de04d messages:Vector<int> pts:int = Update;
+updateUserTyping#6baa8508 user_id:int = Update;
+updateChatUserTyping#3c46cfe6 chat_id:int user_id:int = Update;
+updateChatParticipants#7761198 participants:ChatParticipants = Update;
+updateUserStatus#1bfbd823 user_id:int status:UserStatus = Update;
+updateUserName#da22d9ad user_id:int first_name:string last_name:string = Update;
+updateUserPhoto#95313b0c user_id:int date:int photo:UserProfilePhoto previous:Bool = Update;
+updateContactRegistered#2575bbb9 user_id:int date:int = Update;
+updateContactLink#51a48a9a user_id:int my_link:contacts.MyLink foreign_link:contacts.ForeignLink = Update;
+updateActivation#6f690963 user_id:int = Update;
+updateNewAuthorization#8f06529a auth_key_id:long date:int device:string location:string = Update;
+
+updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
+
+updates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference;
+updates.difference#f49ca0 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> state:updates.State = updates.Difference;
+updates.differenceSlice#a8fb1981 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> intermediate_state:updates.State = updates.Difference;
+
+updatesTooLong#e317af7e = Updates;
+updateShortMessage#d3f45784 id:int from_id:int message:string pts:int date:int seq:int = Updates;
+updateShortChatMessage#2b2fbd4e id:int from_id:int chat_id:int message:string pts:int date:int seq:int = Updates;
+updateShort#78d4dec1 update:Update date:int = Updates;
+updatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;
+updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
+
+photos.photos#8dca6aa5 photos:Vector<Photo> users:Vector<User> = photos.Photos;
+photos.photosSlice#15051f54 count:int photos:Vector<Photo> users:Vector<User> = photos.Photos;
+
+photos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;
+
+upload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;
+
+dcOption#2ec2a43c id:int hostname:string ip_address:string port:int = DcOption;
+
+config#2e54dd74 date:int test_mode:Bool this_dc:int dc_options:Vector<DcOption> chat_size_max:int broadcast_size_max:int = Config;
+
+nearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;
+
+help.appUpdate#8987f311 id:int critical:Bool url:string text:string = help.AppUpdate;
+help.noAppUpdate#c45a6536 = help.AppUpdate;
+
+help.inviteText#18cb9f78 message:string = help.InviteText;
+
+messages.statedMessagesLinks#3e74f5c6 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> links:Vector<contacts.Link> pts:int seq:int = messages.StatedMessages;
+
+messages.statedMessageLink#a9af2881 message:Message chats:Vector<Chat> users:Vector<User> links:Vector<contacts.Link> pts:int seq:int = messages.StatedMessage;
+
+messages.sentMessageLink#e9db4a3f id:int date:int pts:int seq:int links:Vector<contacts.Link> = messages.SentMessage;
+
+inputGeoChat#74d456fa chat_id:int access_hash:long = InputGeoChat;
+
+inputNotifyGeoChatPeer#4d8ddec8 peer:InputGeoChat = InputNotifyPeer;
+
+geoChat#75eaea5a id:int access_hash:long title:string address:string venue:string geo:GeoPoint photo:ChatPhoto participants_count:int date:int checked_in:Bool version:int = Chat;
+
+geoChatMessageEmpty#60311a9b chat_id:int id:int = GeoChatMessage;
+geoChatMessage#4505f8e1 chat_id:int id:int from_id:int date:int message:string media:MessageMedia = GeoChatMessage;
+geoChatMessageService#d34fa24e chat_id:int id:int from_id:int date:int action:MessageAction = GeoChatMessage;
+
+geochats.statedMessage#17b1578b message:GeoChatMessage chats:Vector<Chat> users:Vector<User> seq:int = geochats.StatedMessage;
+
+geochats.located#48feb267 results:Vector<ChatLocated> messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Located;
+
+geochats.messages#d1526db1 messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Messages;
+geochats.messagesSlice#bc5863e8 count:int messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Messages;
+
+messageActionGeoChatCreate#6f038ebc title:string address:string = MessageAction;
+messageActionGeoChatCheckin#c7d53de = MessageAction;
+
+updateNewGeoChatMessage#5a68e3f7 message:GeoChatMessage = Update;
+
+wallPaperSolid#63117f24 id:int title:string bg_color:int color:int = WallPaper;
+
+updateNewEncryptedMessage#12bcbd9a message:EncryptedMessage qts:int = Update;
+updateEncryptedChatTyping#1710f156 chat_id:int = Update;
+updateEncryption#b4a2e88d chat:EncryptedChat date:int = Update;
+updateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update;
+
+encryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat;
+encryptedChatWaiting#3bf703dc id:int access_hash:long date:int admin_id:int participant_id:int = EncryptedChat;
+encryptedChatRequested#c878527e id:int access_hash:long date:int admin_id:int participant_id:int g_a:bytes = EncryptedChat;
+encryptedChat#fa56ce36 id:int access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long = EncryptedChat;
+encryptedChatDiscarded#13d6dd27 id:int = EncryptedChat;
+
+inputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat;
+
+encryptedFileEmpty#c21f497e = EncryptedFile;
+encryptedFile#4a70994c id:long access_hash:long size:int dc_id:int key_fingerprint:int = EncryptedFile;
+
+inputEncryptedFileEmpty#1837c364 = InputEncryptedFile;
+inputEncryptedFileUploaded#64bd0306 id:long parts:int md5_checksum:string key_fingerprint:int = InputEncryptedFile;
+inputEncryptedFile#5a17b5e5 id:long access_hash:long = InputEncryptedFile;
+
+inputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation;
+
+encryptedMessage#ed18c118 random_id:long chat_id:int date:int bytes:bytes file:EncryptedFile = EncryptedMessage;
+encryptedMessageService#23734b06 random_id:long chat_id:int date:int bytes:bytes = EncryptedMessage;
+
+messages.dhConfigNotModified#c0e24635 random:bytes = messages.DhConfig;
+messages.dhConfig#2c221edd g:int p:bytes version:int random:bytes = messages.DhConfig;
+
+messages.sentEncryptedMessage#560f8935 date:int = messages.SentEncryptedMessage;
+messages.sentEncryptedFile#9493ff32 date:int file:EncryptedFile = messages.SentEncryptedMessage;
+
+inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;
+
+inputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile;
+
+updateChatParticipantAdd#3a0eeb22 chat_id:int user_id:int inviter_id:int version:int = Update;
+updateChatParticipantDelete#6e5f8c22 chat_id:int user_id:int version:int = Update;
+updateDcOptions#8e5e9873 dc_options:Vector<DcOption> = Update;
+
+inputMediaUploadedAudio#4e498cab file:InputFile duration:int mime_type:string = InputMedia;
+inputMediaAudio#89938781 id:InputAudio = InputMedia;
+inputMediaUploadedDocument#34e794bd file:InputFile file_name:string mime_type:string = InputMedia;
+inputMediaUploadedThumbDocument#3e46de5d file:InputFile thumb:InputFile file_name:string mime_type:string = InputMedia;
+inputMediaDocument#d184e841 id:InputDocument = InputMedia;
+
+messageMediaDocument#2fda2204 document:Document = MessageMedia;
+messageMediaAudio#c6b68300 audio:Audio = MessageMedia;
+
+inputAudioEmpty#d95adc84 = InputAudio;
+inputAudio#77d440ff id:long access_hash:long = InputAudio;
+
+inputDocumentEmpty#72f0eaae = InputDocument;
+inputDocument#18798952 id:long access_hash:long = InputDocument;
+
+inputAudioFileLocation#74dc404d id:long access_hash:long = InputFileLocation;
+inputDocumentFileLocation#4e45abe9 id:long access_hash:long = InputFileLocation;
+
+audioEmpty#586988d8 id:long = Audio;
+audio#c7ac6496 id:long access_hash:long user_id:int date:int duration:int mime_type:string size:int dc_id:int = Audio;
+
+documentEmpty#36f8c871 id:long = Document;
+document#9efc6326 id:long access_hash:long user_id:int date:int file_name:string mime_type:string size:int thumb:PhotoSize dc_id:int = Document;
+
+help.support#17c6b5f6 phone_number:string user:User = help.Support;
+
+notifyPeer#9fd40bd8 peer:Peer = NotifyPeer;
+notifyUsers#b4c83b4c = NotifyPeer;
+notifyChats#c007cec3 = NotifyPeer;
+notifyAll#74d07c60 = NotifyPeer;
+
+updateUserBlocked#80ece81a user_id:int blocked:Bool = Update;
+updateNotifySettings#bec268ef peer:NotifyPeer notify_settings:PeerNotifySettings = Update;
+
+auth.sentAppCode#e325edcf phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
+
+---functions---
+
+invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
+
+invokeAfterMsgs#3dc4b4f0 {X:Type} msg_ids:Vector<long> query:!X = X;
+
+auth.checkPhone#6fe51dfb phone_number:string = auth.CheckedPhone;
+auth.sendCode#768d5f4d phone_number:string sms_type:int api_id:int api_hash:string lang_code:string = auth.SentCode;
+auth.sendCall#3c51564 phone_number:string phone_code_hash:string = Bool;
+auth.signUp#1b067634 phone_number:string phone_code_hash:string phone_code:string first_name:string last_name:string = auth.Authorization;
+auth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:string = auth.Authorization;
+auth.logOut#5717da40 = Bool;
+auth.resetAuthorizations#9fab0d1a = Bool;
+auth.sendInvites#771c1d97 phone_numbers:Vector<string> message:string = Bool;
+auth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization;
+auth.importAuthorization#e3ef9613 id:int bytes:bytes = auth.Authorization;
+auth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool;
+
+account.registerDevice#446c712c token_type:int token:string device_model:string system_version:string app_version:string app_sandbox:Bool lang_code:string = Bool;
+account.unregisterDevice#65c55b40 token_type:int token:string = Bool;
+account.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool;
+account.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings;
+account.resetNotifySettings#db7e1747 = Bool;
+account.updateProfile#f0888d68 first_name:string last_name:string = User;
+account.updateStatus#6628562c offline:Bool = Bool;
+account.getWallPapers#c04cfac2 = Vector<WallPaper>;
+
+users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
+users.getFullUser#ca30a5b1 id:InputUser = UserFull;
+
+contacts.getStatuses#c4a353ee = Vector<ContactStatus>;
+contacts.getContacts#22c6aa08 hash:string = contacts.Contacts;
+contacts.importContacts#da30b32d contacts:Vector<InputContact> replace:Bool = contacts.ImportedContacts;
+contacts.search#11f812d8 q:string limit:int = contacts.Found;
+contacts.getSuggested#cd773428 limit:int = contacts.Suggested;
+contacts.deleteContact#8e953744 id:InputUser = contacts.Link;
+contacts.deleteContacts#59ab389e id:Vector<InputUser> = Bool;
+contacts.block#332b49fc id:InputUser = Bool;
+contacts.unblock#e54100bd id:InputUser = Bool;
+contacts.getBlocked#f57c350f offset:int limit:int = contacts.Blocked;
+contacts.exportCard#84e53737 = Vector<int>;
+contacts.importCard#4fe196fe export_card:Vector<int> = User;
+
+messages.getMessages#4222fa74 id:Vector<int> = messages.Messages;
+messages.getDialogs#eccf1df6 offset:int max_id:int limit:int = messages.Dialogs;
+messages.getHistory#92a1df2f peer:InputPeer offset:int max_id:int limit:int = messages.Messages;
+messages.search#7e9f2ab peer:InputPeer q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = messages.Messages;
+messages.readHistory#b04f2510 peer:InputPeer max_id:int offset:int = messages.AffectedHistory;
+messages.deleteHistory#f4f8fb61 peer:InputPeer offset:int = messages.AffectedHistory;
+messages.deleteMessages#14f2dd0a id:Vector<int> = Vector<int>;
+messages.restoreMessages#395f9d7e id:Vector<int> = Vector<int>;
+messages.receivedMessages#28abcb68 max_id:int = Vector<int>;
+messages.setTyping#719839e9 peer:InputPeer typing:Bool = Bool;
+messages.sendMessage#4cde0aab peer:InputPeer message:string random_id:long = messages.SentMessage;
+messages.sendMedia#a3c85d76 peer:InputPeer media:InputMedia random_id:long = messages.StatedMessage;
+messages.forwardMessages#514cd10f peer:InputPeer id:Vector<int> = messages.StatedMessages;
+messages.getChats#3c6aa187 id:Vector<int> = messages.Chats;
+messages.getFullChat#3b831c66 chat_id:int = messages.ChatFull;
+messages.editChatTitle#b4bc68b5 chat_id:int title:string = messages.StatedMessage;
+messages.editChatPhoto#d881821d chat_id:int photo:InputChatPhoto = messages.StatedMessage;
+messages.addChatUser#2ee9ee9e chat_id:int user_id:InputUser fwd_limit:int = messages.StatedMessage;
+messages.deleteChatUser#c3c5cd23 chat_id:int user_id:InputUser = messages.StatedMessage;
+messages.createChat#419d9aee users:Vector<InputUser> title:string = messages.StatedMessage;
+
+updates.getState#edd4882a = updates.State;
+updates.getDifference#a041495 pts:int date:int qts:int = updates.Difference;
+
+photos.updateProfilePhoto#eef579a0 id:InputPhoto crop:InputPhotoCrop = UserProfilePhoto;
+photos.uploadProfilePhoto#d50f9c88 file:InputFile caption:string geo_point:InputGeoPoint crop:InputPhotoCrop = photos.Photo;
+
+upload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool;
+upload.getFile#e3a6cfb5 location:InputFileLocation offset:int limit:int = upload.File;
+
+help.getConfig#c4f9186b = Config;
+help.getNearestDc#1fb33026 = NearestDc;
+help.getAppUpdate#c812ac7e device_model:string system_version:string app_version:string lang_code:string = help.AppUpdate;
+help.saveAppLog#6f02f748 events:Vector<InputAppEvent> = Bool;
+help.getInviteText#a4a95186 lang_code:string = help.InviteText;
+
+photos.getUserPhotos#b7ee553c user_id:InputUser offset:int max_id:int limit:int = photos.Photos;
+
+messages.forwardMessage#3f3f4f2 peer:InputPeer id:int random_id:long = messages.StatedMessage;
+messages.sendBroadcast#41bb0972 contacts:Vector<InputUser> message:string media:InputMedia = messages.StatedMessages;
+
+geochats.getLocated#7f192d8f geo_point:InputGeoPoint radius:int limit:int = geochats.Located;
+geochats.getRecents#e1427e6f offset:int limit:int = geochats.Messages;
+geochats.checkin#55b3e8fb peer:InputGeoChat = geochats.StatedMessage;
+geochats.getFullChat#6722dd6f peer:InputGeoChat = messages.ChatFull;
+geochats.editChatTitle#4c8e2273 peer:InputGeoChat title:string address:string = geochats.StatedMessage;
+geochats.editChatPhoto#35d81a95 peer:InputGeoChat photo:InputChatPhoto = geochats.StatedMessage;
+geochats.search#cfcdc44d peer:InputGeoChat q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = geochats.Messages;
+geochats.getHistory#b53f7a68 peer:InputGeoChat offset:int max_id:int limit:int = geochats.Messages;
+geochats.setTyping#8b8a729 peer:InputGeoChat typing:Bool = Bool;
+geochats.sendMessage#61b0044 peer:InputGeoChat message:string random_id:long = geochats.StatedMessage;
+geochats.sendMedia#b8f0deff peer:InputGeoChat media:InputMedia random_id:long = geochats.StatedMessage;
+geochats.createGeoChat#e092e16 title:string geo_point:InputGeoPoint address:string venue:string = geochats.StatedMessage;
+
+messages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig;
+messages.requestEncryption#f64daf43 user_id:InputUser random_id:int g_a:bytes = EncryptedChat;
+messages.acceptEncryption#3dbc0415 peer:InputEncryptedChat g_b:bytes key_fingerprint:long = EncryptedChat;
+messages.discardEncryption#edd923c5 chat_id:int = Bool;
+messages.setEncryptedTyping#791451ed peer:InputEncryptedChat typing:Bool = Bool;
+messages.readEncryptedHistory#7f4b690a peer:InputEncryptedChat max_date:int = Bool;
+messages.sendEncrypted#a9776773 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
+messages.sendEncryptedFile#9a901b66 peer:InputEncryptedChat random_id:long data:bytes file:InputEncryptedFile = messages.SentEncryptedMessage;
+messages.sendEncryptedService#32d439a4 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
+messages.receivedQueue#55a5bb66 max_qts:int = Vector<long>;
+
+upload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool;
+
+initConnection#69796de9 {X:Type} api_id:int device_model:string system_version:string app_version:string lang_code:string query:!X = X;
+
+help.getSupport#9cdf08cd = help.Support;
+
+auth.sendSms#da9f3e8 phone_number:string phone_code_hash:string = Bool;
+
+invokeWithLayer16#cf5f0987 {X:Type} query:!X = X;
diff --git a/protocols/Telegram/tgl/scheme17.tl b/protocols/Telegram/tgl/scheme17.tl
new file mode 100644
index 0000000000..c564155c19
--- /dev/null
+++ b/protocols/Telegram/tgl/scheme17.tl
@@ -0,0 +1,528 @@
+int ?= Int;
+long ?= Long;
+double ?= Double;
+string ?= String;
+
+bytes string = Bytes;
+
+boolFalse#bc799737 = Bool;
+boolTrue#997275b5 = Bool;
+
+vector#1cb5c415 {t:Type} # [ t ] = Vector t;
+
+error#c4b9f9bb code:int text:string = Error;
+
+null#56730bcc = Null;
+
+inputPeerEmpty#7f3b18ea = InputPeer;
+inputPeerSelf#7da07ec9 = InputPeer;
+inputPeerContact#1023dbe8 user_id:int = InputPeer;
+inputPeerForeign#9b447325 user_id:int access_hash:long = InputPeer;
+inputPeerChat#179be863 chat_id:int = InputPeer;
+
+inputUserEmpty#b98886cf = InputUser;
+inputUserSelf#f7c1b13f = InputUser;
+inputUserContact#86e94f65 user_id:int = InputUser;
+inputUserForeign#655e74ff user_id:int access_hash:long = InputUser;
+
+inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact;
+
+inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;
+
+inputMediaEmpty#9664f57f = InputMedia;
+inputMediaUploadedPhoto#2dc53a7d file:InputFile = InputMedia;
+inputMediaPhoto#8f2ab2ec id:InputPhoto = InputMedia;
+inputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;
+inputMediaContact#a6e45987 phone_number:string first_name:string last_name:string = InputMedia;
+inputMediaUploadedVideo#133ad6f6 file:InputFile duration:int w:int h:int mime_type:string = InputMedia;
+inputMediaUploadedThumbVideo#9912dabf file:InputFile thumb:InputFile duration:int w:int h:int mime_type:string = InputMedia;
+inputMediaVideo#7f023ae6 id:InputVideo = InputMedia;
+
+inputChatPhotoEmpty#1ca48f57 = InputChatPhoto;
+inputChatUploadedPhoto#94254732 file:InputFile crop:InputPhotoCrop = InputChatPhoto;
+inputChatPhoto#b2e1bf08 id:InputPhoto crop:InputPhotoCrop = InputChatPhoto;
+
+inputGeoPointEmpty#e4c123d6 = InputGeoPoint;
+inputGeoPoint#f3b7acc9 lat:double long:double = InputGeoPoint;
+
+inputPhotoEmpty#1cd7bf0d = InputPhoto;
+inputPhoto#fb95c6c4 id:long access_hash:long = InputPhoto;
+
+inputVideoEmpty#5508ec75 = InputVideo;
+inputVideo#ee579652 id:long access_hash:long = InputVideo;
+
+inputFileLocation#14637196 volume_id:long local_id:int secret:long = InputFileLocation;
+inputVideoFileLocation#3d0364ec id:long access_hash:long = InputFileLocation;
+
+inputPhotoCropAuto#ade6b004 = InputPhotoCrop;
+inputPhotoCrop#d9915325 crop_left:double crop_top:double crop_width:double = InputPhotoCrop;
+
+inputAppEvent#770656a8 time:double type:string peer:long data:string = InputAppEvent;
+
+peerUser#9db1bc6d user_id:int = Peer;
+peerChat#bad0e5bb chat_id:int = Peer;
+
+storage.fileUnknown#aa963b05 = storage.FileType;
+storage.fileJpeg#7efe0e = storage.FileType;
+storage.fileGif#cae1aadf = storage.FileType;
+storage.filePng#a4f63c0 = storage.FileType;
+storage.filePdf#ae1e508d = storage.FileType;
+storage.fileMp3#528a0677 = storage.FileType;
+storage.fileMov#4b09ebbc = storage.FileType;
+storage.filePartial#40bc6f52 = storage.FileType;
+storage.fileMp4#b3cea0e4 = storage.FileType;
+storage.fileWebp#1081464c = storage.FileType;
+
+fileLocationUnavailable#7c596b46 volume_id:long local_id:int secret:long = FileLocation;
+fileLocation#53d69076 dc_id:int volume_id:long local_id:int secret:long = FileLocation;
+
+userEmpty#200250ba id:int = User;
+userSelf#720535ec id:int first_name:string last_name:string phone:string photo:UserProfilePhoto status:UserStatus inactive:Bool = User;
+userContact#f2fb8319 id:int first_name:string last_name:string access_hash:long phone:string photo:UserProfilePhoto status:UserStatus = User;
+userRequest#22e8ceb0 id:int first_name:string last_name:string access_hash:long phone:string photo:UserProfilePhoto status:UserStatus = User;
+userForeign#5214c89d id:int first_name:string last_name:string access_hash:long photo:UserProfilePhoto status:UserStatus = User;
+userDeleted#b29ad7cc id:int first_name:string last_name:string = User;
+
+userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
+userProfilePhoto#d559d8c8 photo_id:long photo_small:FileLocation photo_big:FileLocation = UserProfilePhoto;
+
+userStatusEmpty#9d05049 = UserStatus;
+userStatusOnline#edb93949 expires:int = UserStatus;
+userStatusOffline#8c703f was_online:int = UserStatus;
+
+chatEmpty#9ba2d800 id:int = Chat;
+chat#6e9c9bc7 id:int title:string photo:ChatPhoto participants_count:int date:int left:Bool version:int = Chat;
+chatForbidden#fb0ccc41 id:int title:string date:int = Chat;
+
+chatFull#630e61be id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings = ChatFull;
+
+chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant;
+
+chatParticipantsForbidden#fd2bb8a chat_id:int = ChatParticipants;
+chatParticipants#7841b415 chat_id:int admin_id:int participants:Vector<ChatParticipant> version:int = ChatParticipants;
+
+chatPhotoEmpty#37c1011c = ChatPhoto;
+chatPhoto#6153276a photo_small:FileLocation photo_big:FileLocation = ChatPhoto;
+
+messageEmpty#83e5de54 id:int = Message;
+//message#22eb6aba id:int from_id:int to_id:Peer out:Bool unread:Bool date:int message:string media:MessageMedia = Message;
+//messageForwarded#5f46804 id:int fwd_from_id:int fwd_date:int from_id:int to_id:Peer out:Bool unread:Bool date:int message:string media:MessageMedia = Message;
+//messageService#9f8d60bb id:int from_id:int to_id:Peer out:Bool unread:Bool date:int action:MessageAction = Message;
+
+messageMediaEmpty#3ded6320 = MessageMedia;
+messageMediaPhoto#c8c45a2a photo:Photo = MessageMedia;
+messageMediaVideo#a2d24290 video:Video = MessageMedia;
+messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;
+messageMediaContact#5e7d2f39 phone_number:string first_name:string last_name:string user_id:int = MessageMedia;
+messageMediaUnsupported#29632a36 bytes:bytes = MessageMedia;
+
+messageActionEmpty#b6aef7b0 = MessageAction;
+messageActionChatCreate#a6638b9a title:string users:Vector<int> = MessageAction;
+messageActionChatEditTitle#b5a1ce5a title:string = MessageAction;
+messageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction;
+messageActionChatDeletePhoto#95e3fbef = MessageAction;
+messageActionChatAddUser#5e3cfc4b user_id:int = MessageAction;
+messageActionChatDeleteUser#b2ae9b0c user_id:int = MessageAction;
+
+dialog#ab3a99ac peer:Peer top_message:int unread_count:int notify_settings:PeerNotifySettings = Dialog;
+
+photoEmpty#2331b22d id:long = Photo;
+photo#22b56751 id:long access_hash:long user_id:int date:int caption:string geo:GeoPoint sizes:Vector<PhotoSize> = Photo;
+
+photoSizeEmpty#e17e23c type:string = PhotoSize;
+photoSize#77bfb61b type:string location:FileLocation w:int h:int size:int = PhotoSize;
+photoCachedSize#e9a734fa type:string location:FileLocation w:int h:int bytes:bytes = PhotoSize;
+
+videoEmpty#c10658a8 id:long = Video;
+video#388fa391 id:long access_hash:long user_id:int date:int caption:string duration:int mime_type:string size:int thumb:PhotoSize dc_id:int w:int h:int = Video;
+
+geoPointEmpty#1117dd5f = GeoPoint;
+geoPoint#2049d70c long:double lat:double = GeoPoint;
+
+auth.checkedPhone#e300cc3b phone_registered:Bool phone_invited:Bool = auth.CheckedPhone;
+
+auth.sentCode#efed51d9 phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
+
+auth.authorization#f6b673a4 expires:int user:User = auth.Authorization;
+
+auth.exportedAuthorization#df969c2d id:int bytes:bytes = auth.ExportedAuthorization;
+
+inputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer;
+inputNotifyUsers#193b4417 = InputNotifyPeer;
+inputNotifyChats#4a95e84e = InputNotifyPeer;
+inputNotifyAll#a429b886 = InputNotifyPeer;
+
+inputPeerNotifyEventsEmpty#f03064d8 = InputPeerNotifyEvents;
+inputPeerNotifyEventsAll#e86a2c74 = InputPeerNotifyEvents;
+
+inputPeerNotifySettings#46a2ce98 mute_until:int sound:string show_previews:Bool events_mask:int = InputPeerNotifySettings;
+
+peerNotifyEventsEmpty#add53cb3 = PeerNotifyEvents;
+peerNotifyEventsAll#6d1ded88 = PeerNotifyEvents;
+
+peerNotifySettingsEmpty#70a68512 = PeerNotifySettings;
+peerNotifySettings#8d5e11ee mute_until:int sound:string show_previews:Bool events_mask:int = PeerNotifySettings;
+
+wallPaper#ccb03657 id:int title:string sizes:Vector<PhotoSize> color:int = WallPaper;
+
+userFull#771095da user:User link:contacts.Link profile_photo:Photo notify_settings:PeerNotifySettings blocked:Bool real_first_name:string real_last_name:string = UserFull;
+
+contact#f911c994 user_id:int mutual:Bool = Contact;
+
+importedContact#d0028438 user_id:int client_id:long = ImportedContact;
+
+contactBlocked#561bc879 user_id:int date:int = ContactBlocked;
+
+contactFound#ea879f95 user_id:int = ContactFound;
+
+contactSuggested#3de191a1 user_id:int mutual_contacts:int = ContactSuggested;
+
+contactStatus#aa77b873 user_id:int expires:int = ContactStatus;
+
+chatLocated#3631cf4c chat_id:int distance:int = ChatLocated;
+
+contacts.foreignLinkUnknown#133421f8 = contacts.ForeignLink;
+contacts.foreignLinkRequested#a7801f47 has_phone:Bool = contacts.ForeignLink;
+contacts.foreignLinkMutual#1bea8ce1 = contacts.ForeignLink;
+
+contacts.myLinkEmpty#d22a1c60 = contacts.MyLink;
+contacts.myLinkRequested#6c69efee contact:Bool = contacts.MyLink;
+contacts.myLinkContact#c240ebd9 = contacts.MyLink;
+
+contacts.link#eccea3f5 my_link:contacts.MyLink foreign_link:contacts.ForeignLink user:User = contacts.Link;
+
+contacts.contacts#6f8b8cb2 contacts:Vector<Contact> users:Vector<User> = contacts.Contacts;
+contacts.contactsNotModified#b74ba9d2 = contacts.Contacts;
+
+contacts.importedContacts#ad524315 imported:Vector<ImportedContact> retry_contacts:Vector<long> users:Vector<User> = contacts.ImportedContacts;
+
+contacts.blocked#1c138d15 blocked:Vector<ContactBlocked> users:Vector<User> = contacts.Blocked;
+contacts.blockedSlice#900802a1 count:int blocked:Vector<ContactBlocked> users:Vector<User> = contacts.Blocked;
+
+contacts.found#566000e results:Vector<ContactFound> users:Vector<User> = contacts.Found;
+
+contacts.suggested#5649dcc5 results:Vector<ContactSuggested> users:Vector<User> = contacts.Suggested;
+
+messages.dialogs#15ba6c40 dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
+messages.dialogsSlice#71e094f3 count:int dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
+
+messages.messages#8c718e87 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+messages.messagesSlice#b446ae3 count:int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+
+messages.messageEmpty#3f4e0648 = messages.Message;
+messages.message#ff90c417 message:Message chats:Vector<Chat> users:Vector<User> = messages.Message;
+
+messages.statedMessages#969478bb messages:Vector<Message> chats:Vector<Chat> users:Vector<User> pts:int seq:int = messages.StatedMessages;
+
+messages.statedMessage#d07ae726 message:Message chats:Vector<Chat> users:Vector<User> pts:int seq:int = messages.StatedMessage;
+
+messages.sentMessage#d1f4d35c id:int date:int pts:int seq:int = messages.SentMessage;
+
+messages.chat#40e9002a chat:Chat users:Vector<User> = messages.Chat;
+
+messages.chats#8150cbd8 chats:Vector<Chat> users:Vector<User> = messages.Chats;
+
+messages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector<Chat> users:Vector<User> = messages.ChatFull;
+
+messages.affectedHistory#b7de36f2 pts:int seq:int offset:int = messages.AffectedHistory;
+
+inputMessagesFilterEmpty#57e2f66c = MessagesFilter;
+inputMessagesFilterPhotos#9609a51c = MessagesFilter;
+inputMessagesFilterVideo#9fc00e65 = MessagesFilter;
+inputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter;
+inputMessagesFilterDocument#9eddf188 = MessagesFilter;
+inputMessagesFilterAudio#cfc87522 = MessagesFilter;
+
+updateNewMessage#13abdb3 message:Message pts:int = Update;
+updateMessageID#4e90bfd6 id:int random_id:long = Update;
+updateReadMessages#c6649e31 messages:Vector<int> pts:int = Update;
+updateDeleteMessages#a92bfe26 messages:Vector<int> pts:int = Update;
+updateRestoreMessages#d15de04d messages:Vector<int> pts:int = Update;
+//updateUserTyping#6baa8508 user_id:int = Update;
+//updateChatUserTyping#3c46cfe6 chat_id:int user_id:int = Update;
+updateChatParticipants#7761198 participants:ChatParticipants = Update;
+updateUserStatus#1bfbd823 user_id:int status:UserStatus = Update;
+updateUserName#da22d9ad user_id:int first_name:string last_name:string = Update;
+updateUserPhoto#95313b0c user_id:int date:int photo:UserProfilePhoto previous:Bool = Update;
+updateContactRegistered#2575bbb9 user_id:int date:int = Update;
+updateContactLink#51a48a9a user_id:int my_link:contacts.MyLink foreign_link:contacts.ForeignLink = Update;
+updateActivation#6f690963 user_id:int = Update;
+updateNewAuthorization#8f06529a auth_key_id:long date:int device:string location:string = Update;
+
+updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
+
+updates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference;
+updates.difference#f49ca0 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> state:updates.State = updates.Difference;
+updates.differenceSlice#a8fb1981 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> intermediate_state:updates.State = updates.Difference;
+
+updatesTooLong#e317af7e = Updates;
+updateShortMessage#d3f45784 id:int from_id:int message:string pts:int date:int seq:int = Updates;
+updateShortChatMessage#2b2fbd4e id:int from_id:int chat_id:int message:string pts:int date:int seq:int = Updates;
+updateShort#78d4dec1 update:Update date:int = Updates;
+updatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;
+updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
+
+photos.photos#8dca6aa5 photos:Vector<Photo> users:Vector<User> = photos.Photos;
+photos.photosSlice#15051f54 count:int photos:Vector<Photo> users:Vector<User> = photos.Photos;
+
+photos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;
+
+upload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;
+
+dcOption#2ec2a43c id:int hostname:string ip_address:string port:int = DcOption;
+
+config#2e54dd74 date:int test_mode:Bool this_dc:int dc_options:Vector<DcOption> chat_size_max:int broadcast_size_max:int = Config;
+
+nearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;
+
+help.appUpdate#8987f311 id:int critical:Bool url:string text:string = help.AppUpdate;
+help.noAppUpdate#c45a6536 = help.AppUpdate;
+
+help.inviteText#18cb9f78 message:string = help.InviteText;
+
+messages.statedMessagesLinks#3e74f5c6 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> links:Vector<contacts.Link> pts:int seq:int = messages.StatedMessages;
+
+messages.statedMessageLink#a9af2881 message:Message chats:Vector<Chat> users:Vector<User> links:Vector<contacts.Link> pts:int seq:int = messages.StatedMessage;
+
+messages.sentMessageLink#e9db4a3f id:int date:int pts:int seq:int links:Vector<contacts.Link> = messages.SentMessage;
+
+inputGeoChat#74d456fa chat_id:int access_hash:long = InputGeoChat;
+
+inputNotifyGeoChatPeer#4d8ddec8 peer:InputGeoChat = InputNotifyPeer;
+
+geoChat#75eaea5a id:int access_hash:long title:string address:string venue:string geo:GeoPoint photo:ChatPhoto participants_count:int date:int checked_in:Bool version:int = Chat;
+
+geoChatMessageEmpty#60311a9b chat_id:int id:int = GeoChatMessage;
+geoChatMessage#4505f8e1 chat_id:int id:int from_id:int date:int message:string media:MessageMedia = GeoChatMessage;
+geoChatMessageService#d34fa24e chat_id:int id:int from_id:int date:int action:MessageAction = GeoChatMessage;
+
+geochats.statedMessage#17b1578b message:GeoChatMessage chats:Vector<Chat> users:Vector<User> seq:int = geochats.StatedMessage;
+
+geochats.located#48feb267 results:Vector<ChatLocated> messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Located;
+
+geochats.messages#d1526db1 messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Messages;
+geochats.messagesSlice#bc5863e8 count:int messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Messages;
+
+messageActionGeoChatCreate#6f038ebc title:string address:string = MessageAction;
+messageActionGeoChatCheckin#c7d53de = MessageAction;
+
+updateNewGeoChatMessage#5a68e3f7 message:GeoChatMessage = Update;
+
+wallPaperSolid#63117f24 id:int title:string bg_color:int color:int = WallPaper;
+
+updateNewEncryptedMessage#12bcbd9a message:EncryptedMessage qts:int = Update;
+updateEncryptedChatTyping#1710f156 chat_id:int = Update;
+updateEncryption#b4a2e88d chat:EncryptedChat date:int = Update;
+updateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update;
+
+encryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat;
+encryptedChatWaiting#3bf703dc id:int access_hash:long date:int admin_id:int participant_id:int = EncryptedChat;
+encryptedChatRequested#c878527e id:int access_hash:long date:int admin_id:int participant_id:int g_a:bytes = EncryptedChat;
+encryptedChat#fa56ce36 id:int access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long = EncryptedChat;
+encryptedChatDiscarded#13d6dd27 id:int = EncryptedChat;
+
+inputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat;
+
+encryptedFileEmpty#c21f497e = EncryptedFile;
+encryptedFile#4a70994c id:long access_hash:long size:int dc_id:int key_fingerprint:int = EncryptedFile;
+
+inputEncryptedFileEmpty#1837c364 = InputEncryptedFile;
+inputEncryptedFileUploaded#64bd0306 id:long parts:int md5_checksum:string key_fingerprint:int = InputEncryptedFile;
+inputEncryptedFile#5a17b5e5 id:long access_hash:long = InputEncryptedFile;
+
+inputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation;
+
+encryptedMessage#ed18c118 random_id:long chat_id:int date:int bytes:bytes file:EncryptedFile = EncryptedMessage;
+encryptedMessageService#23734b06 random_id:long chat_id:int date:int bytes:bytes = EncryptedMessage;
+
+messages.dhConfigNotModified#c0e24635 random:bytes = messages.DhConfig;
+messages.dhConfig#2c221edd g:int p:bytes version:int random:bytes = messages.DhConfig;
+
+messages.sentEncryptedMessage#560f8935 date:int = messages.SentEncryptedMessage;
+messages.sentEncryptedFile#9493ff32 date:int file:EncryptedFile = messages.SentEncryptedMessage;
+
+inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;
+
+inputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile;
+
+updateChatParticipantAdd#3a0eeb22 chat_id:int user_id:int inviter_id:int version:int = Update;
+updateChatParticipantDelete#6e5f8c22 chat_id:int user_id:int version:int = Update;
+updateDcOptions#8e5e9873 dc_options:Vector<DcOption> = Update;
+
+inputMediaUploadedAudio#4e498cab file:InputFile duration:int mime_type:string = InputMedia;
+inputMediaAudio#89938781 id:InputAudio = InputMedia;
+inputMediaUploadedDocument#34e794bd file:InputFile file_name:string mime_type:string = InputMedia;
+inputMediaUploadedThumbDocument#3e46de5d file:InputFile thumb:InputFile file_name:string mime_type:string = InputMedia;
+inputMediaDocument#d184e841 id:InputDocument = InputMedia;
+
+messageMediaDocument#2fda2204 document:Document = MessageMedia;
+messageMediaAudio#c6b68300 audio:Audio = MessageMedia;
+
+inputAudioEmpty#d95adc84 = InputAudio;
+inputAudio#77d440ff id:long access_hash:long = InputAudio;
+
+inputDocumentEmpty#72f0eaae = InputDocument;
+inputDocument#18798952 id:long access_hash:long = InputDocument;
+
+inputAudioFileLocation#74dc404d id:long access_hash:long = InputFileLocation;
+inputDocumentFileLocation#4e45abe9 id:long access_hash:long = InputFileLocation;
+
+audioEmpty#586988d8 id:long = Audio;
+audio#c7ac6496 id:long access_hash:long user_id:int date:int duration:int mime_type:string size:int dc_id:int = Audio;
+
+documentEmpty#36f8c871 id:long = Document;
+document#9efc6326 id:long access_hash:long user_id:int date:int file_name:string mime_type:string size:int thumb:PhotoSize dc_id:int = Document;
+
+help.support#17c6b5f6 phone_number:string user:User = help.Support;
+
+notifyPeer#9fd40bd8 peer:Peer = NotifyPeer;
+notifyUsers#b4c83b4c = NotifyPeer;
+notifyChats#c007cec3 = NotifyPeer;
+notifyAll#74d07c60 = NotifyPeer;
+
+updateUserBlocked#80ece81a user_id:int blocked:Bool = Update;
+updateNotifySettings#bec268ef peer:NotifyPeer notify_settings:PeerNotifySettings = Update;
+
+auth.sentAppCode#e325edcf phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
+
+updateUserTyping#5c486927 user_id:int action:SendMessageAction = Update;
+updateChatUserTyping#9a65ea1f chat_id:int user_id:int action:SendMessageAction = Update;
+
+
+message#567699b3 flags:int id:int from_id:int to_id:Peer date:int message:string media:MessageMedia = Message;
+messageForwarded#a367e716 flags:int id:int fwd_from_id:int fwd_date:int from_id:int to_id:Peer date:int message:string media:MessageMedia = Message;
+messageService#1d86f70e flags:int id:int from_id:int to_id:Peer date:int action:MessageAction = Message;
+
+
+sendMessageTypingAction#16bf744e = SendMessageAction;
+sendMessageCancelAction#fd5ec8f5 = SendMessageAction;
+sendMessageRecordVideoAction#a187d66f = SendMessageAction;
+sendMessageUploadVideoAction#92042ff7 = SendMessageAction;
+sendMessageRecordAudioAction#d52f73f7 = SendMessageAction;
+sendMessageUploadAudioAction#e6ac8a6f = SendMessageAction;
+sendMessageUploadPhotoAction#990a3c1a = SendMessageAction;
+sendMessageUploadDocumentAction#8faee98e = SendMessageAction;
+sendMessageGeoLocationAction#176f8ba1 = SendMessageAction;
+sendMessageChooseContactAction#628cbc6f = SendMessageAction;
+
+---functions---
+
+invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
+
+invokeAfterMsgs#3dc4b4f0 {X:Type} msg_ids:Vector<long> query:!X = X;
+
+auth.checkPhone#6fe51dfb phone_number:string = auth.CheckedPhone;
+auth.sendCode#768d5f4d phone_number:string sms_type:int api_id:int api_hash:string lang_code:string = auth.SentCode;
+auth.sendCall#3c51564 phone_number:string phone_code_hash:string = Bool;
+auth.signUp#1b067634 phone_number:string phone_code_hash:string phone_code:string first_name:string last_name:string = auth.Authorization;
+auth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:string = auth.Authorization;
+auth.logOut#5717da40 = Bool;
+auth.resetAuthorizations#9fab0d1a = Bool;
+auth.sendInvites#771c1d97 phone_numbers:Vector<string> message:string = Bool;
+auth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization;
+auth.importAuthorization#e3ef9613 id:int bytes:bytes = auth.Authorization;
+auth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool;
+
+account.registerDevice#446c712c token_type:int token:string device_model:string system_version:string app_version:string app_sandbox:Bool lang_code:string = Bool;
+account.unregisterDevice#65c55b40 token_type:int token:string = Bool;
+account.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool;
+account.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings;
+account.resetNotifySettings#db7e1747 = Bool;
+account.updateProfile#f0888d68 first_name:string last_name:string = User;
+account.updateStatus#6628562c offline:Bool = Bool;
+account.getWallPapers#c04cfac2 = Vector<WallPaper>;
+
+users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
+users.getFullUser#ca30a5b1 id:InputUser = UserFull;
+
+contacts.getStatuses#c4a353ee = Vector<ContactStatus>;
+contacts.getContacts#22c6aa08 hash:string = contacts.Contacts;
+contacts.importContacts#da30b32d contacts:Vector<InputContact> replace:Bool = contacts.ImportedContacts;
+contacts.search#11f812d8 q:string limit:int = contacts.Found;
+contacts.getSuggested#cd773428 limit:int = contacts.Suggested;
+contacts.deleteContact#8e953744 id:InputUser = contacts.Link;
+contacts.deleteContacts#59ab389e id:Vector<InputUser> = Bool;
+contacts.block#332b49fc id:InputUser = Bool;
+contacts.unblock#e54100bd id:InputUser = Bool;
+contacts.getBlocked#f57c350f offset:int limit:int = contacts.Blocked;
+contacts.exportCard#84e53737 = Vector<int>;
+contacts.importCard#4fe196fe export_card:Vector<int> = User;
+
+messages.getMessages#4222fa74 id:Vector<int> = messages.Messages;
+messages.getDialogs#eccf1df6 offset:int max_id:int limit:int = messages.Dialogs;
+messages.getHistory#92a1df2f peer:InputPeer offset:int max_id:int limit:int = messages.Messages;
+messages.search#7e9f2ab peer:InputPeer q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = messages.Messages;
+messages.readHistory#eed884c6 peer:InputPeer max_id:int offset:int read_contents:Bool = messages.AffectedHistory;
+messages.deleteHistory#f4f8fb61 peer:InputPeer offset:int = messages.AffectedHistory;
+messages.deleteMessages#14f2dd0a id:Vector<int> = Vector<int>;
+messages.restoreMessages#395f9d7e id:Vector<int> = Vector<int>;
+messages.receivedMessages#28abcb68 max_id:int = Vector<int>;
+messages.setTyping#a3825e50 peer:InputPeer action:SendMessageAction = Bool;
+messages.sendMessage#4cde0aab peer:InputPeer message:string random_id:long = messages.SentMessage;
+messages.sendMedia#a3c85d76 peer:InputPeer media:InputMedia random_id:long = messages.StatedMessage;
+messages.forwardMessages#514cd10f peer:InputPeer id:Vector<int> = messages.StatedMessages;
+messages.getChats#3c6aa187 id:Vector<int> = messages.Chats;
+messages.getFullChat#3b831c66 chat_id:int = messages.ChatFull;
+messages.editChatTitle#b4bc68b5 chat_id:int title:string = messages.StatedMessage;
+messages.editChatPhoto#d881821d chat_id:int photo:InputChatPhoto = messages.StatedMessage;
+messages.addChatUser#2ee9ee9e chat_id:int user_id:InputUser fwd_limit:int = messages.StatedMessage;
+messages.deleteChatUser#c3c5cd23 chat_id:int user_id:InputUser = messages.StatedMessage;
+messages.createChat#419d9aee users:Vector<InputUser> title:string = messages.StatedMessage;
+
+updates.getState#edd4882a = updates.State;
+updates.getDifference#a041495 pts:int date:int qts:int = updates.Difference;
+
+photos.updateProfilePhoto#eef579a0 id:InputPhoto crop:InputPhotoCrop = UserProfilePhoto;
+photos.uploadProfilePhoto#d50f9c88 file:InputFile caption:string geo_point:InputGeoPoint crop:InputPhotoCrop = photos.Photo;
+
+upload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool;
+upload.getFile#e3a6cfb5 location:InputFileLocation offset:int limit:int = upload.File;
+
+help.getConfig#c4f9186b = Config;
+help.getNearestDc#1fb33026 = NearestDc;
+help.getAppUpdate#c812ac7e device_model:string system_version:string app_version:string lang_code:string = help.AppUpdate;
+help.saveAppLog#6f02f748 events:Vector<InputAppEvent> = Bool;
+help.getInviteText#a4a95186 lang_code:string = help.InviteText;
+
+photos.getUserPhotos#b7ee553c user_id:InputUser offset:int max_id:int limit:int = photos.Photos;
+
+messages.forwardMessage#3f3f4f2 peer:InputPeer id:int random_id:long = messages.StatedMessage;
+messages.sendBroadcast#41bb0972 contacts:Vector<InputUser> message:string media:InputMedia = messages.StatedMessages;
+
+geochats.getLocated#7f192d8f geo_point:InputGeoPoint radius:int limit:int = geochats.Located;
+geochats.getRecents#e1427e6f offset:int limit:int = geochats.Messages;
+geochats.checkin#55b3e8fb peer:InputGeoChat = geochats.StatedMessage;
+geochats.getFullChat#6722dd6f peer:InputGeoChat = messages.ChatFull;
+geochats.editChatTitle#4c8e2273 peer:InputGeoChat title:string address:string = geochats.StatedMessage;
+geochats.editChatPhoto#35d81a95 peer:InputGeoChat photo:InputChatPhoto = geochats.StatedMessage;
+geochats.search#cfcdc44d peer:InputGeoChat q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = geochats.Messages;
+geochats.getHistory#b53f7a68 peer:InputGeoChat offset:int max_id:int limit:int = geochats.Messages;
+geochats.setTyping#8b8a729 peer:InputGeoChat typing:Bool = Bool;
+geochats.sendMessage#61b0044 peer:InputGeoChat message:string random_id:long = geochats.StatedMessage;
+geochats.sendMedia#b8f0deff peer:InputGeoChat media:InputMedia random_id:long = geochats.StatedMessage;
+geochats.createGeoChat#e092e16 title:string geo_point:InputGeoPoint address:string venue:string = geochats.StatedMessage;
+
+messages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig;
+messages.requestEncryption#f64daf43 user_id:InputUser random_id:int g_a:bytes = EncryptedChat;
+messages.acceptEncryption#3dbc0415 peer:InputEncryptedChat g_b:bytes key_fingerprint:long = EncryptedChat;
+messages.discardEncryption#edd923c5 chat_id:int = Bool;
+messages.setEncryptedTyping#791451ed peer:InputEncryptedChat typing:Bool = Bool;
+messages.readEncryptedHistory#7f4b690a peer:InputEncryptedChat max_date:int = Bool;
+messages.sendEncrypted#a9776773 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
+messages.sendEncryptedFile#9a901b66 peer:InputEncryptedChat random_id:long data:bytes file:InputEncryptedFile = messages.SentEncryptedMessage;
+messages.sendEncryptedService#32d439a4 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
+messages.receivedQueue#55a5bb66 max_qts:int = Vector<long>;
+
+upload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool;
+
+initConnection#69796de9 {X:Type} api_id:int device_model:string system_version:string app_version:string lang_code:string query:!X = X;
+
+help.getSupport#9cdf08cd = help.Support;
+
+auth.sendSms#da9f3e8 phone_number:string phone_code_hash:string = Bool;
+
+messages.readMessageContents id:Vector<int> = Vector<int>;
+
+
+invokeWithLayer17#50858a19 {X:Type} query:!X = X;
+
diff --git a/protocols/Telegram/tgl/scheme18.tl b/protocols/Telegram/tgl/scheme18.tl
new file mode 100644
index 0000000000..6b7fdd5fc4
--- /dev/null
+++ b/protocols/Telegram/tgl/scheme18.tl
@@ -0,0 +1,535 @@
+int ?= Int;
+long ?= Long;
+double ?= Double;
+string ?= String;
+
+bytes string = Bytes;
+
+boolFalse#bc799737 = Bool;
+boolTrue#997275b5 = Bool;
+
+vector#1cb5c415 {t:Type} # [ t ] = Vector t;
+
+error#c4b9f9bb code:int text:string = Error;
+
+null#56730bcc = Null;
+
+inputPeerEmpty#7f3b18ea = InputPeer;
+inputPeerSelf#7da07ec9 = InputPeer;
+inputPeerContact#1023dbe8 user_id:int = InputPeer;
+inputPeerForeign#9b447325 user_id:int access_hash:long = InputPeer;
+inputPeerChat#179be863 chat_id:int = InputPeer;
+
+inputUserEmpty#b98886cf = InputUser;
+inputUserSelf#f7c1b13f = InputUser;
+inputUserContact#86e94f65 user_id:int = InputUser;
+inputUserForeign#655e74ff user_id:int access_hash:long = InputUser;
+
+inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact;
+
+inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;
+
+inputMediaEmpty#9664f57f = InputMedia;
+inputMediaUploadedPhoto#2dc53a7d file:InputFile = InputMedia;
+inputMediaPhoto#8f2ab2ec id:InputPhoto = InputMedia;
+inputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;
+inputMediaContact#a6e45987 phone_number:string first_name:string last_name:string = InputMedia;
+inputMediaUploadedVideo#133ad6f6 file:InputFile duration:int w:int h:int mime_type:string = InputMedia;
+inputMediaUploadedThumbVideo#9912dabf file:InputFile thumb:InputFile duration:int w:int h:int mime_type:string = InputMedia;
+inputMediaVideo#7f023ae6 id:InputVideo = InputMedia;
+
+inputChatPhotoEmpty#1ca48f57 = InputChatPhoto;
+inputChatUploadedPhoto#94254732 file:InputFile crop:InputPhotoCrop = InputChatPhoto;
+inputChatPhoto#b2e1bf08 id:InputPhoto crop:InputPhotoCrop = InputChatPhoto;
+
+inputGeoPointEmpty#e4c123d6 = InputGeoPoint;
+inputGeoPoint#f3b7acc9 lat:double long:double = InputGeoPoint;
+
+inputPhotoEmpty#1cd7bf0d = InputPhoto;
+inputPhoto#fb95c6c4 id:long access_hash:long = InputPhoto;
+
+inputVideoEmpty#5508ec75 = InputVideo;
+inputVideo#ee579652 id:long access_hash:long = InputVideo;
+
+inputFileLocation#14637196 volume_id:long local_id:int secret:long = InputFileLocation;
+inputVideoFileLocation#3d0364ec id:long access_hash:long = InputFileLocation;
+
+inputPhotoCropAuto#ade6b004 = InputPhotoCrop;
+inputPhotoCrop#d9915325 crop_left:double crop_top:double crop_width:double = InputPhotoCrop;
+
+inputAppEvent#770656a8 time:double type:string peer:long data:string = InputAppEvent;
+
+peerUser#9db1bc6d user_id:int = Peer;
+peerChat#bad0e5bb chat_id:int = Peer;
+
+storage.fileUnknown#aa963b05 = storage.FileType;
+storage.fileJpeg#7efe0e = storage.FileType;
+storage.fileGif#cae1aadf = storage.FileType;
+storage.filePng#a4f63c0 = storage.FileType;
+storage.filePdf#ae1e508d = storage.FileType;
+storage.fileMp3#528a0677 = storage.FileType;
+storage.fileMov#4b09ebbc = storage.FileType;
+storage.filePartial#40bc6f52 = storage.FileType;
+storage.fileMp4#b3cea0e4 = storage.FileType;
+storage.fileWebp#1081464c = storage.FileType;
+
+fileLocationUnavailable#7c596b46 volume_id:long local_id:int secret:long = FileLocation;
+fileLocation#53d69076 dc_id:int volume_id:long local_id:int secret:long = FileLocation;
+
+userEmpty#200250ba id:int = User;
+userSelf#7007b451 id:int first_name:string last_name:string username:string phone:string photo:UserProfilePhoto status:UserStatus inactive:Bool = User;
+userContact#cab35e18 id:int first_name:string last_name:string username:string access_hash:long phone:string photo:UserProfilePhoto status:UserStatus = User;
+userRequest#d9ccc4ef id:int first_name:string last_name:string username:string access_hash:long phone:string photo:UserProfilePhoto status:UserStatus = User;
+userForeign#75cf7a8 id:int first_name:string last_name:string username:string access_hash:long photo:UserProfilePhoto status:UserStatus = User;
+userDeleted#d6016d7a id:int first_name:string last_name:string username:string = User;
+
+
+userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
+userProfilePhoto#d559d8c8 photo_id:long photo_small:FileLocation photo_big:FileLocation = UserProfilePhoto;
+
+userStatusEmpty#9d05049 = UserStatus;
+userStatusOnline#edb93949 expires:int = UserStatus;
+userStatusOffline#8c703f was_online:int = UserStatus;
+
+chatEmpty#9ba2d800 id:int = Chat;
+chat#6e9c9bc7 id:int title:string photo:ChatPhoto participants_count:int date:int left:Bool version:int = Chat;
+chatForbidden#fb0ccc41 id:int title:string date:int = Chat;
+
+chatFull#630e61be id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings = ChatFull;
+
+chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant;
+
+chatParticipantsForbidden#fd2bb8a chat_id:int = ChatParticipants;
+chatParticipants#7841b415 chat_id:int admin_id:int participants:Vector<ChatParticipant> version:int = ChatParticipants;
+
+chatPhotoEmpty#37c1011c = ChatPhoto;
+chatPhoto#6153276a photo_small:FileLocation photo_big:FileLocation = ChatPhoto;
+
+messageEmpty#83e5de54 id:int = Message;
+//message#22eb6aba id:int from_id:int to_id:Peer out:Bool unread:Bool date:int message:string media:MessageMedia = Message;
+//messageForwarded#5f46804 id:int fwd_from_id:int fwd_date:int from_id:int to_id:Peer out:Bool unread:Bool date:int message:string media:MessageMedia = Message;
+//messageService#9f8d60bb id:int from_id:int to_id:Peer out:Bool unread:Bool date:int action:MessageAction = Message;
+
+messageMediaEmpty#3ded6320 = MessageMedia;
+messageMediaPhoto#c8c45a2a photo:Photo = MessageMedia;
+messageMediaVideo#a2d24290 video:Video = MessageMedia;
+messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;
+messageMediaContact#5e7d2f39 phone_number:string first_name:string last_name:string user_id:int = MessageMedia;
+messageMediaUnsupported#29632a36 bytes:bytes = MessageMedia;
+
+messageActionEmpty#b6aef7b0 = MessageAction;
+messageActionChatCreate#a6638b9a title:string users:Vector<int> = MessageAction;
+messageActionChatEditTitle#b5a1ce5a title:string = MessageAction;
+messageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction;
+messageActionChatDeletePhoto#95e3fbef = MessageAction;
+messageActionChatAddUser#5e3cfc4b user_id:int = MessageAction;
+messageActionChatDeleteUser#b2ae9b0c user_id:int = MessageAction;
+
+dialog#ab3a99ac peer:Peer top_message:int unread_count:int notify_settings:PeerNotifySettings = Dialog;
+
+photoEmpty#2331b22d id:long = Photo;
+photo#22b56751 id:long access_hash:long user_id:int date:int caption:string geo:GeoPoint sizes:Vector<PhotoSize> = Photo;
+
+photoSizeEmpty#e17e23c type:string = PhotoSize;
+photoSize#77bfb61b type:string location:FileLocation w:int h:int size:int = PhotoSize;
+photoCachedSize#e9a734fa type:string location:FileLocation w:int h:int bytes:bytes = PhotoSize;
+
+videoEmpty#c10658a8 id:long = Video;
+video#388fa391 id:long access_hash:long user_id:int date:int caption:string duration:int mime_type:string size:int thumb:PhotoSize dc_id:int w:int h:int = Video;
+
+geoPointEmpty#1117dd5f = GeoPoint;
+geoPoint#2049d70c long:double lat:double = GeoPoint;
+
+auth.checkedPhone#e300cc3b phone_registered:Bool phone_invited:Bool = auth.CheckedPhone;
+
+auth.sentCode#efed51d9 phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
+
+auth.authorization#f6b673a4 expires:int user:User = auth.Authorization;
+
+auth.exportedAuthorization#df969c2d id:int bytes:bytes = auth.ExportedAuthorization;
+
+inputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer;
+inputNotifyUsers#193b4417 = InputNotifyPeer;
+inputNotifyChats#4a95e84e = InputNotifyPeer;
+inputNotifyAll#a429b886 = InputNotifyPeer;
+
+inputPeerNotifyEventsEmpty#f03064d8 = InputPeerNotifyEvents;
+inputPeerNotifyEventsAll#e86a2c74 = InputPeerNotifyEvents;
+
+inputPeerNotifySettings#46a2ce98 mute_until:int sound:string show_previews:Bool events_mask:int = InputPeerNotifySettings;
+
+peerNotifyEventsEmpty#add53cb3 = PeerNotifyEvents;
+peerNotifyEventsAll#6d1ded88 = PeerNotifyEvents;
+
+peerNotifySettingsEmpty#70a68512 = PeerNotifySettings;
+peerNotifySettings#8d5e11ee mute_until:int sound:string show_previews:Bool events_mask:int = PeerNotifySettings;
+
+wallPaper#ccb03657 id:int title:string sizes:Vector<PhotoSize> color:int = WallPaper;
+
+userFull#771095da user:User link:contacts.Link profile_photo:Photo notify_settings:PeerNotifySettings blocked:Bool real_first_name:string real_last_name:string = UserFull;
+
+contact#f911c994 user_id:int mutual:Bool = Contact;
+
+importedContact#d0028438 user_id:int client_id:long = ImportedContact;
+
+contactBlocked#561bc879 user_id:int date:int = ContactBlocked;
+
+contactFound#ea879f95 user_id:int = ContactFound;
+
+contactSuggested#3de191a1 user_id:int mutual_contacts:int = ContactSuggested;
+
+contactStatus#aa77b873 user_id:int expires:int = ContactStatus;
+
+chatLocated#3631cf4c chat_id:int distance:int = ChatLocated;
+
+contacts.foreignLinkUnknown#133421f8 = contacts.ForeignLink;
+contacts.foreignLinkRequested#a7801f47 has_phone:Bool = contacts.ForeignLink;
+contacts.foreignLinkMutual#1bea8ce1 = contacts.ForeignLink;
+
+contacts.myLinkEmpty#d22a1c60 = contacts.MyLink;
+contacts.myLinkRequested#6c69efee contact:Bool = contacts.MyLink;
+contacts.myLinkContact#c240ebd9 = contacts.MyLink;
+
+contacts.link#eccea3f5 my_link:contacts.MyLink foreign_link:contacts.ForeignLink user:User = contacts.Link;
+
+contacts.contacts#6f8b8cb2 contacts:Vector<Contact> users:Vector<User> = contacts.Contacts;
+contacts.contactsNotModified#b74ba9d2 = contacts.Contacts;
+
+contacts.importedContacts#ad524315 imported:Vector<ImportedContact> retry_contacts:Vector<long> users:Vector<User> = contacts.ImportedContacts;
+
+contacts.blocked#1c138d15 blocked:Vector<ContactBlocked> users:Vector<User> = contacts.Blocked;
+contacts.blockedSlice#900802a1 count:int blocked:Vector<ContactBlocked> users:Vector<User> = contacts.Blocked;
+
+contacts.found#566000e results:Vector<ContactFound> users:Vector<User> = contacts.Found;
+
+contacts.suggested#5649dcc5 results:Vector<ContactSuggested> users:Vector<User> = contacts.Suggested;
+
+messages.dialogs#15ba6c40 dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
+messages.dialogsSlice#71e094f3 count:int dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
+
+messages.messages#8c718e87 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+messages.messagesSlice#b446ae3 count:int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+
+messages.messageEmpty#3f4e0648 = messages.Message;
+messages.message#ff90c417 message:Message chats:Vector<Chat> users:Vector<User> = messages.Message;
+
+messages.statedMessages#969478bb messages:Vector<Message> chats:Vector<Chat> users:Vector<User> pts:int seq:int = messages.StatedMessages;
+
+messages.statedMessage#d07ae726 message:Message chats:Vector<Chat> users:Vector<User> pts:int seq:int = messages.StatedMessage;
+
+messages.sentMessage#d1f4d35c id:int date:int pts:int seq:int = messages.SentMessage;
+
+messages.chat#40e9002a chat:Chat users:Vector<User> = messages.Chat;
+
+messages.chats#8150cbd8 chats:Vector<Chat> users:Vector<User> = messages.Chats;
+
+messages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector<Chat> users:Vector<User> = messages.ChatFull;
+
+messages.affectedHistory#b7de36f2 pts:int seq:int offset:int = messages.AffectedHistory;
+
+inputMessagesFilterEmpty#57e2f66c = MessagesFilter;
+inputMessagesFilterPhotos#9609a51c = MessagesFilter;
+inputMessagesFilterVideo#9fc00e65 = MessagesFilter;
+inputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter;
+inputMessagesFilterDocument#9eddf188 = MessagesFilter;
+inputMessagesFilterAudio#cfc87522 = MessagesFilter;
+
+updateNewMessage#13abdb3 message:Message pts:int = Update;
+updateMessageID#4e90bfd6 id:int random_id:long = Update;
+updateReadMessages#c6649e31 messages:Vector<int> pts:int = Update;
+updateDeleteMessages#a92bfe26 messages:Vector<int> pts:int = Update;
+updateRestoreMessages#d15de04d messages:Vector<int> pts:int = Update;
+//updateUserTyping#6baa8508 user_id:int = Update;
+//updateChatUserTyping#3c46cfe6 chat_id:int user_id:int = Update;
+updateChatParticipants#7761198 participants:ChatParticipants = Update;
+updateUserStatus#1bfbd823 user_id:int status:UserStatus = Update;
+updateUserPhoto#95313b0c user_id:int date:int photo:UserProfilePhoto previous:Bool = Update;
+updateContactRegistered#2575bbb9 user_id:int date:int = Update;
+updateContactLink#51a48a9a user_id:int my_link:contacts.MyLink foreign_link:contacts.ForeignLink = Update;
+updateActivation#6f690963 user_id:int = Update;
+updateNewAuthorization#8f06529a auth_key_id:long date:int device:string location:string = Update;
+
+updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
+
+updates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference;
+updates.difference#f49ca0 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> state:updates.State = updates.Difference;
+updates.differenceSlice#a8fb1981 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> intermediate_state:updates.State = updates.Difference;
+
+updatesTooLong#e317af7e = Updates;
+updateShortMessage#d3f45784 id:int from_id:int message:string pts:int date:int seq:int = Updates;
+updateShortChatMessage#2b2fbd4e id:int from_id:int chat_id:int message:string pts:int date:int seq:int = Updates;
+updateShort#78d4dec1 update:Update date:int = Updates;
+updatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;
+updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
+
+photos.photos#8dca6aa5 photos:Vector<Photo> users:Vector<User> = photos.Photos;
+photos.photosSlice#15051f54 count:int photos:Vector<Photo> users:Vector<User> = photos.Photos;
+
+photos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;
+
+upload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;
+
+dcOption#2ec2a43c id:int hostname:string ip_address:string port:int = DcOption;
+
+config#2e54dd74 date:int test_mode:Bool this_dc:int dc_options:Vector<DcOption> chat_size_max:int broadcast_size_max:int = Config;
+
+nearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;
+
+help.appUpdate#8987f311 id:int critical:Bool url:string text:string = help.AppUpdate;
+help.noAppUpdate#c45a6536 = help.AppUpdate;
+
+help.inviteText#18cb9f78 message:string = help.InviteText;
+
+messages.statedMessagesLinks#3e74f5c6 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> links:Vector<contacts.Link> pts:int seq:int = messages.StatedMessages;
+
+messages.statedMessageLink#a9af2881 message:Message chats:Vector<Chat> users:Vector<User> links:Vector<contacts.Link> pts:int seq:int = messages.StatedMessage;
+
+messages.sentMessageLink#e9db4a3f id:int date:int pts:int seq:int links:Vector<contacts.Link> = messages.SentMessage;
+
+inputGeoChat#74d456fa chat_id:int access_hash:long = InputGeoChat;
+
+inputNotifyGeoChatPeer#4d8ddec8 peer:InputGeoChat = InputNotifyPeer;
+
+geoChat#75eaea5a id:int access_hash:long title:string address:string venue:string geo:GeoPoint photo:ChatPhoto participants_count:int date:int checked_in:Bool version:int = Chat;
+
+geoChatMessageEmpty#60311a9b chat_id:int id:int = GeoChatMessage;
+geoChatMessage#4505f8e1 chat_id:int id:int from_id:int date:int message:string media:MessageMedia = GeoChatMessage;
+geoChatMessageService#d34fa24e chat_id:int id:int from_id:int date:int action:MessageAction = GeoChatMessage;
+
+geochats.statedMessage#17b1578b message:GeoChatMessage chats:Vector<Chat> users:Vector<User> seq:int = geochats.StatedMessage;
+
+geochats.located#48feb267 results:Vector<ChatLocated> messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Located;
+
+geochats.messages#d1526db1 messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Messages;
+geochats.messagesSlice#bc5863e8 count:int messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Messages;
+
+messageActionGeoChatCreate#6f038ebc title:string address:string = MessageAction;
+messageActionGeoChatCheckin#c7d53de = MessageAction;
+
+updateNewGeoChatMessage#5a68e3f7 message:GeoChatMessage = Update;
+
+wallPaperSolid#63117f24 id:int title:string bg_color:int color:int = WallPaper;
+
+updateNewEncryptedMessage#12bcbd9a message:EncryptedMessage qts:int = Update;
+updateEncryptedChatTyping#1710f156 chat_id:int = Update;
+updateEncryption#b4a2e88d chat:EncryptedChat date:int = Update;
+updateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update;
+
+encryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat;
+encryptedChatWaiting#3bf703dc id:int access_hash:long date:int admin_id:int participant_id:int = EncryptedChat;
+encryptedChatRequested#c878527e id:int access_hash:long date:int admin_id:int participant_id:int g_a:bytes = EncryptedChat;
+encryptedChat#fa56ce36 id:int access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long = EncryptedChat;
+encryptedChatDiscarded#13d6dd27 id:int = EncryptedChat;
+
+inputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat;
+
+encryptedFileEmpty#c21f497e = EncryptedFile;
+encryptedFile#4a70994c id:long access_hash:long size:int dc_id:int key_fingerprint:int = EncryptedFile;
+
+inputEncryptedFileEmpty#1837c364 = InputEncryptedFile;
+inputEncryptedFileUploaded#64bd0306 id:long parts:int md5_checksum:string key_fingerprint:int = InputEncryptedFile;
+inputEncryptedFile#5a17b5e5 id:long access_hash:long = InputEncryptedFile;
+
+inputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation;
+
+encryptedMessage#ed18c118 random_id:long chat_id:int date:int bytes:bytes file:EncryptedFile = EncryptedMessage;
+encryptedMessageService#23734b06 random_id:long chat_id:int date:int bytes:bytes = EncryptedMessage;
+
+messages.dhConfigNotModified#c0e24635 random:bytes = messages.DhConfig;
+messages.dhConfig#2c221edd g:int p:bytes version:int random:bytes = messages.DhConfig;
+
+messages.sentEncryptedMessage#560f8935 date:int = messages.SentEncryptedMessage;
+messages.sentEncryptedFile#9493ff32 date:int file:EncryptedFile = messages.SentEncryptedMessage;
+
+inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;
+
+inputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile;
+
+updateChatParticipantAdd#3a0eeb22 chat_id:int user_id:int inviter_id:int version:int = Update;
+updateChatParticipantDelete#6e5f8c22 chat_id:int user_id:int version:int = Update;
+updateDcOptions#8e5e9873 dc_options:Vector<DcOption> = Update;
+
+inputMediaUploadedAudio#4e498cab file:InputFile duration:int mime_type:string = InputMedia;
+inputMediaAudio#89938781 id:InputAudio = InputMedia;
+inputMediaUploadedDocument#34e794bd file:InputFile file_name:string mime_type:string = InputMedia;
+inputMediaUploadedThumbDocument#3e46de5d file:InputFile thumb:InputFile file_name:string mime_type:string = InputMedia;
+inputMediaDocument#d184e841 id:InputDocument = InputMedia;
+
+messageMediaDocument#2fda2204 document:Document = MessageMedia;
+messageMediaAudio#c6b68300 audio:Audio = MessageMedia;
+
+inputAudioEmpty#d95adc84 = InputAudio;
+inputAudio#77d440ff id:long access_hash:long = InputAudio;
+
+inputDocumentEmpty#72f0eaae = InputDocument;
+inputDocument#18798952 id:long access_hash:long = InputDocument;
+
+inputAudioFileLocation#74dc404d id:long access_hash:long = InputFileLocation;
+inputDocumentFileLocation#4e45abe9 id:long access_hash:long = InputFileLocation;
+
+audioEmpty#586988d8 id:long = Audio;
+audio#c7ac6496 id:long access_hash:long user_id:int date:int duration:int mime_type:string size:int dc_id:int = Audio;
+
+documentEmpty#36f8c871 id:long = Document;
+document#9efc6326 id:long access_hash:long user_id:int date:int file_name:string mime_type:string size:int thumb:PhotoSize dc_id:int = Document;
+
+help.support#17c6b5f6 phone_number:string user:User = help.Support;
+
+notifyPeer#9fd40bd8 peer:Peer = NotifyPeer;
+notifyUsers#b4c83b4c = NotifyPeer;
+notifyChats#c007cec3 = NotifyPeer;
+notifyAll#74d07c60 = NotifyPeer;
+
+updateUserBlocked#80ece81a user_id:int blocked:Bool = Update;
+updateNotifySettings#bec268ef peer:NotifyPeer notify_settings:PeerNotifySettings = Update;
+
+auth.sentAppCode#e325edcf phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
+
+updateUserTyping#5c486927 user_id:int action:SendMessageAction = Update;
+updateChatUserTyping#9a65ea1f chat_id:int user_id:int action:SendMessageAction = Update;
+
+updateUserName user_id:int first_name:string last_name:string username:string = Update;
+updateServiceNotification type:string message:string media:MessageMedia popup:Bool = Update;
+
+message#567699b3 flags:int id:int from_id:int to_id:Peer date:int message:string media:MessageMedia = Message;
+messageForwarded#a367e716 flags:int id:int fwd_from_id:int fwd_date:int from_id:int to_id:Peer date:int message:string media:MessageMedia = Message;
+messageService#1d86f70e flags:int id:int from_id:int to_id:Peer date:int action:MessageAction = Message;
+
+
+sendMessageTypingAction#16bf744e = SendMessageAction;
+sendMessageCancelAction#fd5ec8f5 = SendMessageAction;
+sendMessageRecordVideoAction#a187d66f = SendMessageAction;
+sendMessageUploadVideoAction#92042ff7 = SendMessageAction;
+sendMessageRecordAudioAction#d52f73f7 = SendMessageAction;
+sendMessageUploadAudioAction#e6ac8a6f = SendMessageAction;
+sendMessageUploadPhotoAction#990a3c1a = SendMessageAction;
+sendMessageUploadDocumentAction#8faee98e = SendMessageAction;
+sendMessageGeoLocationAction#176f8ba1 = SendMessageAction;
+sendMessageChooseContactAction#628cbc6f = SendMessageAction;
+
+---functions---
+
+invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
+
+invokeAfterMsgs#3dc4b4f0 {X:Type} msg_ids:Vector<long> query:!X = X;
+
+auth.checkPhone#6fe51dfb phone_number:string = auth.CheckedPhone;
+auth.sendCode#768d5f4d phone_number:string sms_type:int api_id:int api_hash:string lang_code:string = auth.SentCode;
+auth.sendCall#3c51564 phone_number:string phone_code_hash:string = Bool;
+auth.signUp#1b067634 phone_number:string phone_code_hash:string phone_code:string first_name:string last_name:string = auth.Authorization;
+auth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:string = auth.Authorization;
+auth.logOut#5717da40 = Bool;
+auth.resetAuthorizations#9fab0d1a = Bool;
+auth.sendInvites#771c1d97 phone_numbers:Vector<string> message:string = Bool;
+auth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization;
+auth.importAuthorization#e3ef9613 id:int bytes:bytes = auth.Authorization;
+auth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool;
+
+account.registerDevice#446c712c token_type:int token:string device_model:string system_version:string app_version:string app_sandbox:Bool lang_code:string = Bool;
+account.unregisterDevice#65c55b40 token_type:int token:string = Bool;
+account.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool;
+account.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings;
+account.resetNotifySettings#db7e1747 = Bool;
+account.updateProfile#f0888d68 first_name:string last_name:string = User;
+account.updateStatus#6628562c offline:Bool = Bool;
+account.getWallPapers#c04cfac2 = Vector<WallPaper>;
+
+users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
+users.getFullUser#ca30a5b1 id:InputUser = UserFull;
+
+contacts.getStatuses#c4a353ee = Vector<ContactStatus>;
+contacts.getContacts#22c6aa08 hash:string = contacts.Contacts;
+contacts.importContacts#da30b32d contacts:Vector<InputContact> replace:Bool = contacts.ImportedContacts;
+contacts.getSuggested#cd773428 limit:int = contacts.Suggested;
+contacts.deleteContact#8e953744 id:InputUser = contacts.Link;
+contacts.deleteContacts#59ab389e id:Vector<InputUser> = Bool;
+contacts.block#332b49fc id:InputUser = Bool;
+contacts.unblock#e54100bd id:InputUser = Bool;
+contacts.getBlocked#f57c350f offset:int limit:int = contacts.Blocked;
+contacts.exportCard#84e53737 = Vector<int>;
+contacts.importCard#4fe196fe export_card:Vector<int> = User;
+
+messages.getMessages#4222fa74 id:Vector<int> = messages.Messages;
+messages.getDialogs#eccf1df6 offset:int max_id:int limit:int = messages.Dialogs;
+messages.getHistory#92a1df2f peer:InputPeer offset:int max_id:int limit:int = messages.Messages;
+messages.search#7e9f2ab peer:InputPeer q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = messages.Messages;
+messages.readHistory#eed884c6 peer:InputPeer max_id:int offset:int read_contents:Bool = messages.AffectedHistory;
+messages.deleteHistory#f4f8fb61 peer:InputPeer offset:int = messages.AffectedHistory;
+messages.deleteMessages#14f2dd0a id:Vector<int> = Vector<int>;
+messages.restoreMessages#395f9d7e id:Vector<int> = Vector<int>;
+messages.receivedMessages#28abcb68 max_id:int = Vector<int>;
+messages.setTyping#a3825e50 peer:InputPeer action:SendMessageAction = Bool;
+messages.sendMessage#4cde0aab peer:InputPeer message:string random_id:long = messages.SentMessage;
+messages.sendMedia#a3c85d76 peer:InputPeer media:InputMedia random_id:long = messages.StatedMessage;
+messages.forwardMessages#514cd10f peer:InputPeer id:Vector<int> = messages.StatedMessages;
+messages.getChats#3c6aa187 id:Vector<int> = messages.Chats;
+messages.getFullChat#3b831c66 chat_id:int = messages.ChatFull;
+messages.editChatTitle#b4bc68b5 chat_id:int title:string = messages.StatedMessage;
+messages.editChatPhoto#d881821d chat_id:int photo:InputChatPhoto = messages.StatedMessage;
+messages.addChatUser#2ee9ee9e chat_id:int user_id:InputUser fwd_limit:int = messages.StatedMessage;
+messages.deleteChatUser#c3c5cd23 chat_id:int user_id:InputUser = messages.StatedMessage;
+messages.createChat#419d9aee users:Vector<InputUser> title:string = messages.StatedMessage;
+
+updates.getState#edd4882a = updates.State;
+updates.getDifference#a041495 pts:int date:int qts:int = updates.Difference;
+
+photos.updateProfilePhoto#eef579a0 id:InputPhoto crop:InputPhotoCrop = UserProfilePhoto;
+photos.uploadProfilePhoto#d50f9c88 file:InputFile caption:string geo_point:InputGeoPoint crop:InputPhotoCrop = photos.Photo;
+
+upload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool;
+upload.getFile#e3a6cfb5 location:InputFileLocation offset:int limit:int = upload.File;
+
+help.getConfig#c4f9186b = Config;
+help.getNearestDc#1fb33026 = NearestDc;
+help.getAppUpdate#c812ac7e device_model:string system_version:string app_version:string lang_code:string = help.AppUpdate;
+help.saveAppLog#6f02f748 events:Vector<InputAppEvent> = Bool;
+help.getInviteText#a4a95186 lang_code:string = help.InviteText;
+
+photos.getUserPhotos#b7ee553c user_id:InputUser offset:int max_id:int limit:int = photos.Photos;
+
+messages.forwardMessage#3f3f4f2 peer:InputPeer id:int random_id:long = messages.StatedMessage;
+messages.sendBroadcast#41bb0972 contacts:Vector<InputUser> message:string media:InputMedia = messages.StatedMessages;
+
+geochats.getLocated#7f192d8f geo_point:InputGeoPoint radius:int limit:int = geochats.Located;
+geochats.getRecents#e1427e6f offset:int limit:int = geochats.Messages;
+geochats.checkin#55b3e8fb peer:InputGeoChat = geochats.StatedMessage;
+geochats.getFullChat#6722dd6f peer:InputGeoChat = messages.ChatFull;
+geochats.editChatTitle#4c8e2273 peer:InputGeoChat title:string address:string = geochats.StatedMessage;
+geochats.editChatPhoto#35d81a95 peer:InputGeoChat photo:InputChatPhoto = geochats.StatedMessage;
+geochats.search#cfcdc44d peer:InputGeoChat q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = geochats.Messages;
+geochats.getHistory#b53f7a68 peer:InputGeoChat offset:int max_id:int limit:int = geochats.Messages;
+geochats.setTyping#8b8a729 peer:InputGeoChat typing:Bool = Bool;
+geochats.sendMessage#61b0044 peer:InputGeoChat message:string random_id:long = geochats.StatedMessage;
+geochats.sendMedia#b8f0deff peer:InputGeoChat media:InputMedia random_id:long = geochats.StatedMessage;
+geochats.createGeoChat#e092e16 title:string geo_point:InputGeoPoint address:string venue:string = geochats.StatedMessage;
+
+messages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig;
+messages.requestEncryption#f64daf43 user_id:InputUser random_id:int g_a:bytes = EncryptedChat;
+messages.acceptEncryption#3dbc0415 peer:InputEncryptedChat g_b:bytes key_fingerprint:long = EncryptedChat;
+messages.discardEncryption#edd923c5 chat_id:int = Bool;
+messages.setEncryptedTyping#791451ed peer:InputEncryptedChat typing:Bool = Bool;
+messages.readEncryptedHistory#7f4b690a peer:InputEncryptedChat max_date:int = Bool;
+messages.sendEncrypted#a9776773 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
+messages.sendEncryptedFile#9a901b66 peer:InputEncryptedChat random_id:long data:bytes file:InputEncryptedFile = messages.SentEncryptedMessage;
+messages.sendEncryptedService#32d439a4 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
+messages.receivedQueue#55a5bb66 max_qts:int = Vector<long>;
+
+upload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool;
+
+initConnection#69796de9 {X:Type} api_id:int device_model:string system_version:string app_version:string lang_code:string query:!X = X;
+
+help.getSupport#9cdf08cd = help.Support;
+
+auth.sendSms#da9f3e8 phone_number:string phone_code_hash:string = Bool;
+
+messages.readMessageContents id:Vector<int> = Vector<int>;
+
+
+account.checkUsername username:string = Bool;
+account.updateUsername username:string = User;
+
+contacts.search q:string limit:int = contacts.Found;
+
+//invokeWithLayer18 {X:Type} query:!X = X;
+invokeWithLayer18#1c900537 {X:Type} query:!X = X;
+
diff --git a/protocols/Telegram/tgl/scheme19.tl b/protocols/Telegram/tgl/scheme19.tl
new file mode 100644
index 0000000000..732093a02a
--- /dev/null
+++ b/protocols/Telegram/tgl/scheme19.tl
@@ -0,0 +1,596 @@
+int ?= Int;
+long ?= Long;
+double ?= Double;
+string ?= String;
+
+bytes string = Bytes;
+
+boolFalse#bc799737 = Bool;
+boolTrue#997275b5 = Bool;
+
+int128 long long = Int128;
+int256 long long long long = Int256;
+
+vector#1cb5c415 {t:Type} # [ t ] = Vector t;
+
+error#c4b9f9bb code:int text:string = Error;
+
+null#56730bcc = Null;
+
+inputPeerEmpty#7f3b18ea = InputPeer;
+inputPeerSelf#7da07ec9 = InputPeer;
+inputPeerContact#1023dbe8 user_id:int = InputPeer;
+inputPeerForeign#9b447325 user_id:int access_hash:long = InputPeer;
+inputPeerChat#179be863 chat_id:int = InputPeer;
+
+inputUserEmpty#b98886cf = InputUser;
+inputUserSelf#f7c1b13f = InputUser;
+inputUserContact#86e94f65 user_id:int = InputUser;
+inputUserForeign#655e74ff user_id:int access_hash:long = InputUser;
+
+inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact;
+
+inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;
+
+inputMediaEmpty#9664f57f = InputMedia;
+inputMediaUploadedPhoto#2dc53a7d file:InputFile = InputMedia;
+inputMediaPhoto#8f2ab2ec id:InputPhoto = InputMedia;
+inputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;
+inputMediaContact#a6e45987 phone_number:string first_name:string last_name:string = InputMedia;
+inputMediaUploadedVideo#133ad6f6 file:InputFile duration:int w:int h:int mime_type:string = InputMedia;
+inputMediaUploadedThumbVideo#9912dabf file:InputFile thumb:InputFile duration:int w:int h:int mime_type:string = InputMedia;
+inputMediaVideo#7f023ae6 id:InputVideo = InputMedia;
+
+inputChatPhotoEmpty#1ca48f57 = InputChatPhoto;
+inputChatUploadedPhoto#94254732 file:InputFile crop:InputPhotoCrop = InputChatPhoto;
+inputChatPhoto#b2e1bf08 id:InputPhoto crop:InputPhotoCrop = InputChatPhoto;
+
+inputGeoPointEmpty#e4c123d6 = InputGeoPoint;
+inputGeoPoint#f3b7acc9 lat:double long:double = InputGeoPoint;
+
+inputPhotoEmpty#1cd7bf0d = InputPhoto;
+inputPhoto#fb95c6c4 id:long access_hash:long = InputPhoto;
+
+inputVideoEmpty#5508ec75 = InputVideo;
+inputVideo#ee579652 id:long access_hash:long = InputVideo;
+
+inputFileLocation#14637196 volume_id:long local_id:int secret:long = InputFileLocation;
+inputVideoFileLocation#3d0364ec id:long access_hash:long = InputFileLocation;
+
+inputPhotoCropAuto#ade6b004 = InputPhotoCrop;
+inputPhotoCrop#d9915325 crop_left:double crop_top:double crop_width:double = InputPhotoCrop;
+
+inputAppEvent#770656a8 time:double type:string peer:long data:string = InputAppEvent;
+
+peerUser#9db1bc6d user_id:int = Peer;
+peerChat#bad0e5bb chat_id:int = Peer;
+
+storage.fileUnknown#aa963b05 = storage.FileType;
+storage.fileJpeg#7efe0e = storage.FileType;
+storage.fileGif#cae1aadf = storage.FileType;
+storage.filePng#a4f63c0 = storage.FileType;
+storage.filePdf#ae1e508d = storage.FileType;
+storage.fileMp3#528a0677 = storage.FileType;
+storage.fileMov#4b09ebbc = storage.FileType;
+storage.filePartial#40bc6f52 = storage.FileType;
+storage.fileMp4#b3cea0e4 = storage.FileType;
+storage.fileWebp#1081464c = storage.FileType;
+
+fileLocationUnavailable#7c596b46 volume_id:long local_id:int secret:long = FileLocation;
+fileLocation#53d69076 dc_id:int volume_id:long local_id:int secret:long = FileLocation;
+
+userEmpty#200250ba id:int = User;
+userSelf#7007b451 id:int first_name:string last_name:string username:string phone:string photo:UserProfilePhoto status:UserStatus inactive:Bool = User;
+userContact#cab35e18 id:int first_name:string last_name:string username:string access_hash:long phone:string photo:UserProfilePhoto status:UserStatus = User;
+userRequest#d9ccc4ef id:int first_name:string last_name:string username:string access_hash:long phone:string photo:UserProfilePhoto status:UserStatus = User;
+userForeign#75cf7a8 id:int first_name:string last_name:string username:string access_hash:long photo:UserProfilePhoto status:UserStatus = User;
+userDeleted#d6016d7a id:int first_name:string last_name:string username:string = User;
+
+userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
+userProfilePhoto#d559d8c8 photo_id:long photo_small:FileLocation photo_big:FileLocation = UserProfilePhoto;
+
+userStatusEmpty#9d05049 = UserStatus;
+userStatusOnline#edb93949 expires:int = UserStatus;
+userStatusOffline#8c703f was_online:int = UserStatus;
+
+chatEmpty#9ba2d800 id:int = Chat;
+chat#6e9c9bc7 id:int title:string photo:ChatPhoto participants_count:int date:int left:Bool version:int = Chat;
+chatForbidden#fb0ccc41 id:int title:string date:int = Chat;
+
+chatFull#630e61be id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings = ChatFull;
+
+chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant;
+
+chatParticipantsForbidden#fd2bb8a chat_id:int = ChatParticipants;
+chatParticipants#7841b415 chat_id:int admin_id:int participants:Vector<ChatParticipant> version:int = ChatParticipants;
+
+chatPhotoEmpty#37c1011c = ChatPhoto;
+chatPhoto#6153276a photo_small:FileLocation photo_big:FileLocation = ChatPhoto;
+
+messageEmpty#83e5de54 id:int = Message;
+message#567699b3 flags:int id:int from_id:int to_id:Peer date:int message:string media:MessageMedia = Message;
+messageForwarded#a367e716 flags:int id:int fwd_from_id:int fwd_date:int from_id:int to_id:Peer date:int message:string media:MessageMedia = Message;
+messageService#1d86f70e flags:int id:int from_id:int to_id:Peer date:int action:MessageAction = Message;
+
+messageMediaEmpty#3ded6320 = MessageMedia;
+messageMediaPhoto#c8c45a2a photo:Photo = MessageMedia;
+messageMediaVideo#a2d24290 video:Video = MessageMedia;
+messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;
+messageMediaContact#5e7d2f39 phone_number:string first_name:string last_name:string user_id:int = MessageMedia;
+messageMediaUnsupported#29632a36 bytes:bytes = MessageMedia;
+
+messageActionEmpty#b6aef7b0 = MessageAction;
+messageActionChatCreate#a6638b9a title:string users:Vector<int> = MessageAction;
+messageActionChatEditTitle#b5a1ce5a title:string = MessageAction;
+messageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction;
+messageActionChatDeletePhoto#95e3fbef = MessageAction;
+messageActionChatAddUser#5e3cfc4b user_id:int = MessageAction;
+messageActionChatDeleteUser#b2ae9b0c user_id:int = MessageAction;
+
+dialog#ab3a99ac peer:Peer top_message:int unread_count:int notify_settings:PeerNotifySettings = Dialog;
+
+photoEmpty#2331b22d id:long = Photo;
+photo#22b56751 id:long access_hash:long user_id:int date:int caption:string geo:GeoPoint sizes:Vector<PhotoSize> = Photo;
+
+photoSizeEmpty#e17e23c type:string = PhotoSize;
+photoSize#77bfb61b type:string location:FileLocation w:int h:int size:int = PhotoSize;
+photoCachedSize#e9a734fa type:string location:FileLocation w:int h:int bytes:bytes = PhotoSize;
+
+videoEmpty#c10658a8 id:long = Video;
+video#388fa391 id:long access_hash:long user_id:int date:int caption:string duration:int mime_type:string size:int thumb:PhotoSize dc_id:int w:int h:int = Video;
+
+geoPointEmpty#1117dd5f = GeoPoint;
+geoPoint#2049d70c long:double lat:double = GeoPoint;
+
+auth.checkedPhone#e300cc3b phone_registered:Bool phone_invited:Bool = auth.CheckedPhone;
+
+auth.sentCode#efed51d9 phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
+
+auth.authorization#f6b673a4 expires:int user:User = auth.Authorization;
+
+auth.exportedAuthorization#df969c2d id:int bytes:bytes = auth.ExportedAuthorization;
+
+inputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer;
+inputNotifyUsers#193b4417 = InputNotifyPeer;
+inputNotifyChats#4a95e84e = InputNotifyPeer;
+inputNotifyAll#a429b886 = InputNotifyPeer;
+
+inputPeerNotifyEventsEmpty#f03064d8 = InputPeerNotifyEvents;
+inputPeerNotifyEventsAll#e86a2c74 = InputPeerNotifyEvents;
+
+inputPeerNotifySettings#46a2ce98 mute_until:int sound:string show_previews:Bool events_mask:int = InputPeerNotifySettings;
+
+peerNotifyEventsEmpty#add53cb3 = PeerNotifyEvents;
+peerNotifyEventsAll#6d1ded88 = PeerNotifyEvents;
+
+peerNotifySettingsEmpty#70a68512 = PeerNotifySettings;
+peerNotifySettings#8d5e11ee mute_until:int sound:string show_previews:Bool events_mask:int = PeerNotifySettings;
+
+wallPaper#ccb03657 id:int title:string sizes:Vector<PhotoSize> color:int = WallPaper;
+
+userFull#771095da user:User link:contacts.Link profile_photo:Photo notify_settings:PeerNotifySettings blocked:Bool real_first_name:string real_last_name:string = UserFull;
+
+contact#f911c994 user_id:int mutual:Bool = Contact;
+
+importedContact#d0028438 user_id:int client_id:long = ImportedContact;
+
+contactBlocked#561bc879 user_id:int date:int = ContactBlocked;
+
+contactSuggested#3de191a1 user_id:int mutual_contacts:int = ContactSuggested;
+
+contactStatus#d3680c61 user_id:int status:UserStatus = ContactStatus;
+
+chatLocated#3631cf4c chat_id:int distance:int = ChatLocated;
+
+contacts.foreignLinkUnknown#133421f8 = contacts.ForeignLink;
+contacts.foreignLinkRequested#a7801f47 has_phone:Bool = contacts.ForeignLink;
+contacts.foreignLinkMutual#1bea8ce1 = contacts.ForeignLink;
+
+contacts.myLinkEmpty#d22a1c60 = contacts.MyLink;
+contacts.myLinkRequested#6c69efee contact:Bool = contacts.MyLink;
+contacts.myLinkContact#c240ebd9 = contacts.MyLink;
+
+contacts.link#eccea3f5 my_link:contacts.MyLink foreign_link:contacts.ForeignLink user:User = contacts.Link;
+
+contacts.contactsNotModified#b74ba9d2 = contacts.Contacts;
+contacts.contacts#6f8b8cb2 contacts:Vector<Contact> users:Vector<User> = contacts.Contacts;
+
+contacts.importedContacts#ad524315 imported:Vector<ImportedContact> retry_contacts:Vector<long> users:Vector<User> = contacts.ImportedContacts;
+
+contacts.blocked#1c138d15 blocked:Vector<ContactBlocked> users:Vector<User> = contacts.Blocked;
+contacts.blockedSlice#900802a1 count:int blocked:Vector<ContactBlocked> users:Vector<User> = contacts.Blocked;
+
+contacts.suggested#5649dcc5 results:Vector<ContactSuggested> users:Vector<User> = contacts.Suggested;
+
+messages.dialogs#15ba6c40 dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
+messages.dialogsSlice#71e094f3 count:int dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
+
+messages.messages#8c718e87 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+messages.messagesSlice#b446ae3 count:int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+
+messages.messageEmpty#3f4e0648 = messages.Message;
+messages.message#ff90c417 message:Message chats:Vector<Chat> users:Vector<User> = messages.Message;
+
+messages.statedMessages#969478bb messages:Vector<Message> chats:Vector<Chat> users:Vector<User> pts:int seq:int = messages.StatedMessages;
+
+messages.statedMessage#d07ae726 message:Message chats:Vector<Chat> users:Vector<User> pts:int seq:int = messages.StatedMessage;
+
+messages.sentMessage#d1f4d35c id:int date:int pts:int seq:int = messages.SentMessage;
+
+messages.chat#40e9002a chat:Chat users:Vector<User> = messages.Chat;
+
+messages.chats#8150cbd8 chats:Vector<Chat> users:Vector<User> = messages.Chats;
+
+messages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector<Chat> users:Vector<User> = messages.ChatFull;
+
+messages.affectedHistory#b7de36f2 pts:int seq:int offset:int = messages.AffectedHistory;
+
+inputMessagesFilterEmpty#57e2f66c = MessagesFilter;
+inputMessagesFilterPhotos#9609a51c = MessagesFilter;
+inputMessagesFilterVideo#9fc00e65 = MessagesFilter;
+inputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter;
+inputMessagesFilterDocument#9eddf188 = MessagesFilter;
+inputMessagesFilterAudio#cfc87522 = MessagesFilter;
+
+updateNewMessage#13abdb3 message:Message pts:int = Update;
+updateMessageID#4e90bfd6 id:int random_id:long = Update;
+updateReadMessages#c6649e31 messages:Vector<int> pts:int = Update;
+updateDeleteMessages#a92bfe26 messages:Vector<int> pts:int = Update;
+updateRestoreMessages#d15de04d messages:Vector<int> pts:int = Update;
+updateUserTyping#5c486927 user_id:int action:SendMessageAction = Update;
+updateChatUserTyping#9a65ea1f chat_id:int user_id:int action:SendMessageAction = Update;
+updateChatParticipants#7761198 participants:ChatParticipants = Update;
+updateUserStatus#1bfbd823 user_id:int status:UserStatus = Update;
+updateUserName#a7332b73 user_id:int first_name:string last_name:string username:string = Update;
+updateUserPhoto#95313b0c user_id:int date:int photo:UserProfilePhoto previous:Bool = Update;
+updateContactRegistered#2575bbb9 user_id:int date:int = Update;
+updateContactLink#51a48a9a user_id:int my_link:contacts.MyLink foreign_link:contacts.ForeignLink = Update;
+updateActivation#6f690963 user_id:int = Update;
+updateNewAuthorization#8f06529a auth_key_id:long date:int device:string location:string = Update;
+
+updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
+
+updates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference;
+updates.difference#f49ca0 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> state:updates.State = updates.Difference;
+updates.differenceSlice#a8fb1981 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> intermediate_state:updates.State = updates.Difference;
+
+updatesTooLong#e317af7e = Updates;
+updateShortMessage#d3f45784 id:int from_id:int message:string pts:int date:int seq:int = Updates;
+updateShortChatMessage#2b2fbd4e id:int from_id:int chat_id:int message:string pts:int date:int seq:int = Updates;
+updateShort#78d4dec1 update:Update date:int = Updates;
+updatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;
+updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
+
+photos.photos#8dca6aa5 photos:Vector<Photo> users:Vector<User> = photos.Photos;
+photos.photosSlice#15051f54 count:int photos:Vector<Photo> users:Vector<User> = photos.Photos;
+
+photos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;
+
+upload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;
+
+dcOption#2ec2a43c id:int hostname:string ip_address:string port:int = DcOption;
+
+config#2e54dd74 date:int test_mode:Bool this_dc:int dc_options:Vector<DcOption> chat_size_max:int broadcast_size_max:int = Config;
+
+nearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;
+
+help.appUpdate#8987f311 id:int critical:Bool url:string text:string = help.AppUpdate;
+help.noAppUpdate#c45a6536 = help.AppUpdate;
+
+help.inviteText#18cb9f78 message:string = help.InviteText;
+
+messages.statedMessagesLinks#3e74f5c6 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> links:Vector<contacts.Link> pts:int seq:int = messages.StatedMessages;
+
+messages.statedMessageLink#a9af2881 message:Message chats:Vector<Chat> users:Vector<User> links:Vector<contacts.Link> pts:int seq:int = messages.StatedMessage;
+
+messages.sentMessageLink#e9db4a3f id:int date:int pts:int seq:int links:Vector<contacts.Link> = messages.SentMessage;
+
+inputGeoChat#74d456fa chat_id:int access_hash:long = InputGeoChat;
+
+inputNotifyGeoChatPeer#4d8ddec8 peer:InputGeoChat = InputNotifyPeer;
+
+geoChat#75eaea5a id:int access_hash:long title:string address:string venue:string geo:GeoPoint photo:ChatPhoto participants_count:int date:int checked_in:Bool version:int = Chat;
+
+geoChatMessageEmpty#60311a9b chat_id:int id:int = GeoChatMessage;
+geoChatMessage#4505f8e1 chat_id:int id:int from_id:int date:int message:string media:MessageMedia = GeoChatMessage;
+geoChatMessageService#d34fa24e chat_id:int id:int from_id:int date:int action:MessageAction = GeoChatMessage;
+
+geochats.statedMessage#17b1578b message:GeoChatMessage chats:Vector<Chat> users:Vector<User> seq:int = geochats.StatedMessage;
+
+geochats.located#48feb267 results:Vector<ChatLocated> messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Located;
+
+geochats.messages#d1526db1 messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Messages;
+geochats.messagesSlice#bc5863e8 count:int messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Messages;
+
+messageActionGeoChatCreate#6f038ebc title:string address:string = MessageAction;
+messageActionGeoChatCheckin#c7d53de = MessageAction;
+
+updateNewGeoChatMessage#5a68e3f7 message:GeoChatMessage = Update;
+
+wallPaperSolid#63117f24 id:int title:string bg_color:int color:int = WallPaper;
+
+updateNewEncryptedMessage#12bcbd9a message:EncryptedMessage qts:int = Update;
+updateEncryptedChatTyping#1710f156 chat_id:int = Update;
+updateEncryption#b4a2e88d chat:EncryptedChat date:int = Update;
+updateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update;
+
+encryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat;
+encryptedChatWaiting#3bf703dc id:int access_hash:long date:int admin_id:int participant_id:int = EncryptedChat;
+encryptedChatRequested#c878527e id:int access_hash:long date:int admin_id:int participant_id:int g_a:bytes = EncryptedChat;
+encryptedChat#fa56ce36 id:int access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long = EncryptedChat;
+encryptedChatDiscarded#13d6dd27 id:int = EncryptedChat;
+
+inputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat;
+
+encryptedFileEmpty#c21f497e = EncryptedFile;
+encryptedFile#4a70994c id:long access_hash:long size:int dc_id:int key_fingerprint:int = EncryptedFile;
+
+inputEncryptedFileEmpty#1837c364 = InputEncryptedFile;
+inputEncryptedFileUploaded#64bd0306 id:long parts:int md5_checksum:string key_fingerprint:int = InputEncryptedFile;
+inputEncryptedFile#5a17b5e5 id:long access_hash:long = InputEncryptedFile;
+
+inputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation;
+
+encryptedMessage#ed18c118 random_id:long chat_id:int date:int bytes:bytes file:EncryptedFile = EncryptedMessage;
+encryptedMessageService#23734b06 random_id:long chat_id:int date:int bytes:bytes = EncryptedMessage;
+
+messages.dhConfigNotModified#c0e24635 random:bytes = messages.DhConfig;
+messages.dhConfig#2c221edd g:int p:bytes version:int random:bytes = messages.DhConfig;
+
+messages.sentEncryptedMessage#560f8935 date:int = messages.SentEncryptedMessage;
+messages.sentEncryptedFile#9493ff32 date:int file:EncryptedFile = messages.SentEncryptedMessage;
+
+inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;
+
+inputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile;
+
+updateChatParticipantAdd#3a0eeb22 chat_id:int user_id:int inviter_id:int version:int = Update;
+updateChatParticipantDelete#6e5f8c22 chat_id:int user_id:int version:int = Update;
+updateDcOptions#8e5e9873 dc_options:Vector<DcOption> = Update;
+
+inputMediaUploadedAudio#4e498cab file:InputFile duration:int mime_type:string = InputMedia;
+inputMediaAudio#89938781 id:InputAudio = InputMedia;
+inputMediaUploadedDocument#ffe76b78 file:InputFile mime_type:string attributes:Vector<DocumentAttribute> = InputMedia;
+inputMediaUploadedThumbDocument#41481486 file:InputFile thumb:InputFile mime_type:string attributes:Vector<DocumentAttribute> = InputMedia;
+inputMediaDocument#d184e841 id:InputDocument = InputMedia;
+
+messageMediaDocument#2fda2204 document:Document = MessageMedia;
+messageMediaAudio#c6b68300 audio:Audio = MessageMedia;
+
+inputAudioEmpty#d95adc84 = InputAudio;
+inputAudio#77d440ff id:long access_hash:long = InputAudio;
+
+inputDocumentEmpty#72f0eaae = InputDocument;
+inputDocument#18798952 id:long access_hash:long = InputDocument;
+
+inputAudioFileLocation#74dc404d id:long access_hash:long = InputFileLocation;
+inputDocumentFileLocation#4e45abe9 id:long access_hash:long = InputFileLocation;
+
+audioEmpty#586988d8 id:long = Audio;
+audio#c7ac6496 id:long access_hash:long user_id:int date:int duration:int mime_type:string size:int dc_id:int = Audio;
+
+documentEmpty#36f8c871 id:long = Document;
+document#f9a39f4f id:long access_hash:long date:int mime_type:string size:int thumb:PhotoSize dc_id:int attributes:Vector<DocumentAttribute> = Document;
+document_l19#9efc6326 id:long access_hash:long user_id:int date:int file_name:string mime_type:string size:int thumb:PhotoSize dc_id:int = Document;
+
+help.support#17c6b5f6 phone_number:string user:User = help.Support;
+
+notifyPeer#9fd40bd8 peer:Peer = NotifyPeer;
+notifyUsers#b4c83b4c = NotifyPeer;
+notifyChats#c007cec3 = NotifyPeer;
+notifyAll#74d07c60 = NotifyPeer;
+
+updateUserBlocked#80ece81a user_id:int blocked:Bool = Update;
+updateNotifySettings#bec268ef peer:NotifyPeer notify_settings:PeerNotifySettings = Update;
+
+auth.sentAppCode#e325edcf phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
+
+sendMessageTypingAction#16bf744e = SendMessageAction;
+sendMessageCancelAction#fd5ec8f5 = SendMessageAction;
+sendMessageRecordVideoAction#a187d66f = SendMessageAction;
+sendMessageUploadVideoAction#92042ff7 = SendMessageAction;
+sendMessageRecordAudioAction#d52f73f7 = SendMessageAction;
+sendMessageUploadAudioAction#e6ac8a6f = SendMessageAction;
+sendMessageUploadPhotoAction#990a3c1a = SendMessageAction;
+sendMessageUploadDocumentAction#8faee98e = SendMessageAction;
+sendMessageGeoLocationAction#176f8ba1 = SendMessageAction;
+sendMessageChooseContactAction#628cbc6f = SendMessageAction;
+
+contactFound#ea879f95 user_id:int = ContactFound;
+
+contacts.found#566000e results:Vector<ContactFound> users:Vector<User> = contacts.Found;
+
+updateServiceNotification#382dd3e4 type:string message:string media:MessageMedia popup:Bool = Update;
+
+userStatusRecently#e26f42f1 = UserStatus;
+userStatusLastWeek#7bf09fc = UserStatus;
+userStatusLastMonth#77ebc742 = UserStatus;
+
+updatePrivacy#ee3b272a key:PrivacyKey rules:Vector<PrivacyRule> = Update;
+
+inputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey;
+
+privacyKeyStatusTimestamp#bc2eab30 = PrivacyKey;
+
+inputPrivacyValueAllowContacts#d09e07b = InputPrivacyRule;
+inputPrivacyValueAllowAll#184b35ce = InputPrivacyRule;
+inputPrivacyValueAllowUsers#131cc67f users:Vector<InputUser> = InputPrivacyRule;
+inputPrivacyValueDisallowContacts#ba52007 = InputPrivacyRule;
+inputPrivacyValueDisallowAll#d66b66c9 = InputPrivacyRule;
+inputPrivacyValueDisallowUsers#90110467 users:Vector<InputUser> = InputPrivacyRule;
+
+privacyValueAllowContacts#fffe1bac = PrivacyRule;
+privacyValueAllowAll#65427b82 = PrivacyRule;
+privacyValueAllowUsers#4d5bbe0c users:Vector<int> = PrivacyRule;
+privacyValueDisallowContacts#f888fa1a = PrivacyRule;
+privacyValueDisallowAll#8b73e763 = PrivacyRule;
+privacyValueDisallowUsers#c7f49b7 users:Vector<int> = PrivacyRule;
+
+account.privacyRules#554abb6f rules:Vector<PrivacyRule> users:Vector<User> = account.PrivacyRules;
+
+accountDaysTTL#b8d0afdf days:int = AccountDaysTTL;
+
+account.sentChangePhoneCode#a4f58c4c phone_code_hash:string send_call_timeout:int = account.SentChangePhoneCode;
+
+updateUserPhone#12b9417b user_id:int phone:string = Update;
+
+account.noPassword#5770e7a9 new_salt:bytes = account.Password;
+account.password#739e5f72 current_salt:bytes new_salt:bytes hint:string = account.Password;
+
+documentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute;
+documentAttributeAnimated#11b58939 = DocumentAttribute;
+documentAttributeSticker#fb0a5727 = DocumentAttribute;
+documentAttributeVideo#5910cccb duration:int w:int h:int = DocumentAttribute;
+documentAttributeAudio#51448e5 duration:int = DocumentAttribute;
+documentAttributeFilename#15590068 file_name:string = DocumentAttribute;
+
+messages.stickersNotModified#f1749a22 = messages.Stickers;
+messages.stickers#8a8ecd32 hash:string stickers:Vector<Document> = messages.Stickers;
+
+stickerPack#12b299d4 emoticon:string documents:Vector<long> = StickerPack;
+
+messages.allStickersNotModified#e86602c3 = messages.AllStickers;
+messages.allStickers#dcef3102 hash:string packs:Vector<StickerPack> documents:Vector<Document> = messages.AllStickers;
+
+---functions---
+
+invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
+
+invokeAfterMsgs#3dc4b4f0 {X:Type} msg_ids:Vector<long> query:!X = X;
+
+auth.checkPhone#6fe51dfb phone_number:string = auth.CheckedPhone;
+auth.sendCode#768d5f4d phone_number:string sms_type:int api_id:int api_hash:string lang_code:string = auth.SentCode;
+auth.sendCall#3c51564 phone_number:string phone_code_hash:string = Bool;
+auth.signUp#1b067634 phone_number:string phone_code_hash:string phone_code:string first_name:string last_name:string = auth.Authorization;
+auth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:string = auth.Authorization;
+auth.logOut#5717da40 = Bool;
+auth.resetAuthorizations#9fab0d1a = Bool;
+auth.sendInvites#771c1d97 phone_numbers:Vector<string> message:string = Bool;
+auth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization;
+auth.importAuthorization#e3ef9613 id:int bytes:bytes = auth.Authorization;
+auth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool;
+
+account.registerDevice#446c712c token_type:int token:string device_model:string system_version:string app_version:string app_sandbox:Bool lang_code:string = Bool;
+account.unregisterDevice#65c55b40 token_type:int token:string = Bool;
+account.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool;
+account.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings;
+account.resetNotifySettings#db7e1747 = Bool;
+account.updateProfile#f0888d68 first_name:string last_name:string = User;
+account.updateStatus#6628562c offline:Bool = Bool;
+account.getWallPapers#c04cfac2 = Vector<WallPaper>;
+
+users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
+users.getFullUser#ca30a5b1 id:InputUser = UserFull;
+
+contacts.getStatuses#c4a353ee = Vector<ContactStatus>;
+contacts.getContacts#22c6aa08 hash:string = contacts.Contacts;
+contacts.importContacts#da30b32d contacts:Vector<InputContact> replace:Bool = contacts.ImportedContacts;
+contacts.getSuggested#cd773428 limit:int = contacts.Suggested;
+contacts.deleteContact#8e953744 id:InputUser = contacts.Link;
+contacts.deleteContacts#59ab389e id:Vector<InputUser> = Bool;
+contacts.block#332b49fc id:InputUser = Bool;
+contacts.unblock#e54100bd id:InputUser = Bool;
+contacts.getBlocked#f57c350f offset:int limit:int = contacts.Blocked;
+contacts.exportCard#84e53737 = Vector<int>;
+contacts.importCard#4fe196fe export_card:Vector<int> = User;
+
+messages.getMessages#4222fa74 id:Vector<int> = messages.Messages;
+messages.getDialogs#eccf1df6 offset:int max_id:int limit:int = messages.Dialogs;
+messages.getHistory#92a1df2f peer:InputPeer offset:int max_id:int limit:int = messages.Messages;
+messages.search#7e9f2ab peer:InputPeer q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = messages.Messages;
+messages.readHistory#eed884c6 peer:InputPeer max_id:int offset:int read_contents:Bool = messages.AffectedHistory;
+messages.deleteHistory#f4f8fb61 peer:InputPeer offset:int = messages.AffectedHistory;
+messages.deleteMessages#14f2dd0a id:Vector<int> = Vector<int>;
+messages.restoreMessages#395f9d7e id:Vector<int> = Vector<int>;
+messages.receivedMessages#28abcb68 max_id:int = Vector<int>;
+messages.setTyping#a3825e50 peer:InputPeer action:SendMessageAction = Bool;
+messages.sendMessage#4cde0aab peer:InputPeer message:string random_id:long = messages.SentMessage;
+messages.sendMedia#a3c85d76 peer:InputPeer media:InputMedia random_id:long = messages.StatedMessage;
+messages.forwardMessages#514cd10f peer:InputPeer id:Vector<int> = messages.StatedMessages;
+messages.getChats#3c6aa187 id:Vector<int> = messages.Chats;
+messages.getFullChat#3b831c66 chat_id:int = messages.ChatFull;
+messages.editChatTitle#b4bc68b5 chat_id:int title:string = messages.StatedMessage;
+messages.editChatPhoto#d881821d chat_id:int photo:InputChatPhoto = messages.StatedMessage;
+messages.addChatUser#2ee9ee9e chat_id:int user_id:InputUser fwd_limit:int = messages.StatedMessage;
+messages.deleteChatUser#c3c5cd23 chat_id:int user_id:InputUser = messages.StatedMessage;
+messages.createChat#419d9aee users:Vector<InputUser> title:string = messages.StatedMessage;
+
+updates.getState#edd4882a = updates.State;
+updates.getDifference#a041495 pts:int date:int qts:int = updates.Difference;
+
+photos.updateProfilePhoto#eef579a0 id:InputPhoto crop:InputPhotoCrop = UserProfilePhoto;
+photos.uploadProfilePhoto#d50f9c88 file:InputFile caption:string geo_point:InputGeoPoint crop:InputPhotoCrop = photos.Photo;
+photos.deletePhotos#87cf7f2f id:Vector<InputPhoto> = Vector<long>;
+
+upload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool;
+upload.getFile#e3a6cfb5 location:InputFileLocation offset:int limit:int = upload.File;
+
+help.getConfig#c4f9186b = Config;
+help.getNearestDc#1fb33026 = NearestDc;
+help.getAppUpdate#c812ac7e device_model:string system_version:string app_version:string lang_code:string = help.AppUpdate;
+help.saveAppLog#6f02f748 events:Vector<InputAppEvent> = Bool;
+help.getInviteText#a4a95186 lang_code:string = help.InviteText;
+
+photos.getUserPhotos#b7ee553c user_id:InputUser offset:int max_id:int limit:int = photos.Photos;
+
+messages.forwardMessage#3f3f4f2 peer:InputPeer id:int random_id:long = messages.StatedMessage;
+messages.sendBroadcast#41bb0972 contacts:Vector<InputUser> message:string media:InputMedia = messages.StatedMessages;
+
+geochats.getLocated#7f192d8f geo_point:InputGeoPoint radius:int limit:int = geochats.Located;
+geochats.getRecents#e1427e6f offset:int limit:int = geochats.Messages;
+geochats.checkin#55b3e8fb peer:InputGeoChat = geochats.StatedMessage;
+geochats.getFullChat#6722dd6f peer:InputGeoChat = messages.ChatFull;
+geochats.editChatTitle#4c8e2273 peer:InputGeoChat title:string address:string = geochats.StatedMessage;
+geochats.editChatPhoto#35d81a95 peer:InputGeoChat photo:InputChatPhoto = geochats.StatedMessage;
+geochats.search#cfcdc44d peer:InputGeoChat q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = geochats.Messages;
+geochats.getHistory#b53f7a68 peer:InputGeoChat offset:int max_id:int limit:int = geochats.Messages;
+geochats.setTyping#8b8a729 peer:InputGeoChat typing:Bool = Bool;
+geochats.sendMessage#61b0044 peer:InputGeoChat message:string random_id:long = geochats.StatedMessage;
+geochats.sendMedia#b8f0deff peer:InputGeoChat media:InputMedia random_id:long = geochats.StatedMessage;
+geochats.createGeoChat#e092e16 title:string geo_point:InputGeoPoint address:string venue:string = geochats.StatedMessage;
+
+messages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig;
+messages.requestEncryption#f64daf43 user_id:InputUser random_id:int g_a:bytes = EncryptedChat;
+messages.acceptEncryption#3dbc0415 peer:InputEncryptedChat g_b:bytes key_fingerprint:long = EncryptedChat;
+messages.discardEncryption#edd923c5 chat_id:int = Bool;
+messages.setEncryptedTyping#791451ed peer:InputEncryptedChat typing:Bool = Bool;
+messages.readEncryptedHistory#7f4b690a peer:InputEncryptedChat max_date:int = Bool;
+messages.sendEncrypted#a9776773 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
+messages.sendEncryptedFile#9a901b66 peer:InputEncryptedChat random_id:long data:bytes file:InputEncryptedFile = messages.SentEncryptedMessage;
+messages.sendEncryptedService#32d439a4 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
+messages.receivedQueue#55a5bb66 max_qts:int = Vector<long>;
+
+upload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool;
+
+initConnection#69796de9 {X:Type} api_id:int device_model:string system_version:string app_version:string lang_code:string query:!X = X;
+
+help.getSupport#9cdf08cd = help.Support;
+
+auth.sendSms#da9f3e8 phone_number:string phone_code_hash:string = Bool;
+
+messages.readMessageContents#354b5bc2 id:Vector<int> = Vector<int>;
+
+account.checkUsername#2714d86c username:string = Bool;
+account.updateUsername#3e0bdd7c username:string = User;
+
+contacts.search#11f812d8 q:string limit:int = contacts.Found;
+
+account.getPrivacy#dadbc950 key:InputPrivacyKey = account.PrivacyRules;
+account.setPrivacy#c9f81ce8 key:InputPrivacyKey rules:Vector<InputPrivacyRule> = account.PrivacyRules;
+account.deleteAccount#418d4e0b reason:string = Bool;
+account.getAccountTTL#8fc711d = AccountDaysTTL;
+account.setAccountTTL#2442485e ttl:AccountDaysTTL = Bool;
+
+invokeWithLayer#da9b0d0d {X:Type} layer:int query:!X = X;
+
+contacts.resolveUsername#bf0131c username:string = User;
+
+account.sendChangePhoneCode#a407a8f4 phone_number:string = account.SentChangePhoneCode;
+account.changePhone#70c32edb phone_number:string phone_code_hash:string phone_code:string = User;
+account.getPassword#548a30f5 = account.Password;
+account.setPassword#dd2a4d8f current_password_hash:bytes new_salt:bytes new_password_hash:bytes hint:string = Bool;
+
+auth.checkPassword#a63011e password_hash:bytes = auth.Authorization;
+
+messages.getStickers#ae22e045 emoticon:string hash:string = messages.Stickers;
+messages.getAllStickers#aa3bc868 hash:string = messages.AllStickers;
diff --git a/protocols/Telegram/tgl/scheme22.tl b/protocols/Telegram/tgl/scheme22.tl
new file mode 100644
index 0000000000..1ed65373e0
--- /dev/null
+++ b/protocols/Telegram/tgl/scheme22.tl
@@ -0,0 +1,596 @@
+int ?= Int;
+long ?= Long;
+double ?= Double;
+string ?= String;
+
+bytes string = Bytes;
+
+boolFalse#bc799737 = Bool;
+boolTrue#997275b5 = Bool;
+
+int128 long long = Int128;
+int256 long long long long = Int256;
+
+vector#1cb5c415 {t:Type} # [ t ] = Vector t;
+
+error#c4b9f9bb code:int text:string = Error;
+
+null#56730bcc = Null;
+
+inputPeerEmpty#7f3b18ea = InputPeer;
+inputPeerSelf#7da07ec9 = InputPeer;
+inputPeerContact#1023dbe8 user_id:int = InputPeer;
+inputPeerForeign#9b447325 user_id:int access_hash:long = InputPeer;
+inputPeerChat#179be863 chat_id:int = InputPeer;
+
+inputUserEmpty#b98886cf = InputUser;
+inputUserSelf#f7c1b13f = InputUser;
+inputUserContact#86e94f65 user_id:int = InputUser;
+inputUserForeign#655e74ff user_id:int access_hash:long = InputUser;
+
+inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact;
+
+inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;
+
+inputMediaEmpty#9664f57f = InputMedia;
+inputMediaUploadedPhoto#2dc53a7d file:InputFile = InputMedia;
+inputMediaPhoto#8f2ab2ec photo_id:InputPhoto = InputMedia;
+inputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;
+inputMediaContact#a6e45987 phone_number:string first_name:string last_name:string = InputMedia;
+inputMediaUploadedVideo#133ad6f6 file:InputFile duration:int w:int h:int mime_type:string = InputMedia;
+inputMediaUploadedThumbVideo#9912dabf file:InputFile thumb:InputFile duration:int w:int h:int mime_type:string = InputMedia;
+inputMediaVideo#7f023ae6 video_id:InputVideo = InputMedia;
+
+inputChatPhotoEmpty#1ca48f57 = InputChatPhoto;
+inputChatUploadedPhoto#94254732 file:InputFile crop:InputPhotoCrop = InputChatPhoto;
+inputChatPhoto#b2e1bf08 id:InputPhoto crop:InputPhotoCrop = InputChatPhoto;
+
+inputGeoPointEmpty#e4c123d6 = InputGeoPoint;
+inputGeoPoint#f3b7acc9 latitude:double longitude:double = InputGeoPoint;
+
+inputPhotoEmpty#1cd7bf0d = InputPhoto;
+inputPhoto#fb95c6c4 id:long access_hash:long = InputPhoto;
+
+inputVideoEmpty#5508ec75 = InputVideo;
+inputVideo#ee579652 id:long access_hash:long = InputVideo;
+
+inputFileLocation#14637196 volume_id:long local_id:int secret:long = InputFileLocation;
+inputVideoFileLocation#3d0364ec id:long access_hash:long = InputFileLocation;
+
+inputPhotoCropAuto#ade6b004 = InputPhotoCrop;
+inputPhotoCrop#d9915325 crop_left:double crop_top:double crop_width:double = InputPhotoCrop;
+
+inputAppEvent#770656a8 time:double type:string peer:long data:string = InputAppEvent;
+
+peerUser#9db1bc6d user_id:int = Peer;
+peerChat#bad0e5bb chat_id:int = Peer;
+
+storage.fileUnknown#aa963b05 = storage.FileType;
+storage.fileJpeg#7efe0e = storage.FileType;
+storage.fileGif#cae1aadf = storage.FileType;
+storage.filePng#a4f63c0 = storage.FileType;
+storage.filePdf#ae1e508d = storage.FileType;
+storage.fileMp3#528a0677 = storage.FileType;
+storage.fileMov#4b09ebbc = storage.FileType;
+storage.filePartial#40bc6f52 = storage.FileType;
+storage.fileMp4#b3cea0e4 = storage.FileType;
+storage.fileWebp#1081464c = storage.FileType;
+
+fileLocationUnavailable#7c596b46 volume_id:long local_id:int secret:long = FileLocation;
+fileLocation#53d69076 dc_id:int volume_id:long local_id:int secret:long = FileLocation;
+
+userEmpty#200250ba id:int = User;
+userSelf#7007b451 id:int first_name:string last_name:string username:string phone:string photo:UserProfilePhoto status:UserStatus inactive:Bool = User;
+userContact#cab35e18 id:int first_name:string last_name:string username:string access_hash:long phone:string photo:UserProfilePhoto status:UserStatus = User;
+userRequest#d9ccc4ef id:int first_name:string last_name:string username:string access_hash:long phone:string photo:UserProfilePhoto status:UserStatus = User;
+userForeign#75cf7a8 id:int first_name:string last_name:string username:string access_hash:long photo:UserProfilePhoto status:UserStatus = User;
+userDeleted#d6016d7a id:int first_name:string last_name:string username:string = User;
+
+userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
+userProfilePhoto#d559d8c8 photo_id:long photo_small:FileLocation photo_big:FileLocation = UserProfilePhoto;
+
+userStatusEmpty#9d05049 = UserStatus;
+userStatusOnline#edb93949 expires:int = UserStatus;
+userStatusOffline#8c703f was_online:int = UserStatus;
+
+chatEmpty#9ba2d800 id:int = Chat;
+chat#6e9c9bc7 id:int title:string photo:ChatPhoto participants_count:int date:int left:Bool version:int = Chat;
+chatForbidden#fb0ccc41 id:int title:string date:int = Chat;
+
+chatFull#630e61be id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings = ChatFull;
+
+chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant;
+
+chatParticipantsForbidden#fd2bb8a chat_id:int = ChatParticipants;
+chatParticipants#7841b415 chat_id:int admin_id:int participants:Vector<ChatParticipant> version:int = ChatParticipants;
+
+chatPhotoEmpty#37c1011c = ChatPhoto;
+chatPhoto#6153276a photo_small:FileLocation photo_big:FileLocation = ChatPhoto;
+
+messageEmpty#83e5de54 id:int = Message;
+message#567699b3 flags:int id:int from_id:int to_id:Peer date:int message:string media:MessageMedia = Message;
+messageForwarded#a367e716 flags:int id:int fwd_from_id:int fwd_date:int from_id:int to_id:Peer date:int message:string media:MessageMedia = Message;
+messageService#1d86f70e flags:int id:int from_id:int to_id:Peer date:int action:MessageAction = Message;
+
+messageMediaEmpty#3ded6320 = MessageMedia;
+messageMediaPhoto#c8c45a2a photo:Photo = MessageMedia;
+messageMediaVideo#a2d24290 video:Video = MessageMedia;
+messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;
+messageMediaContact#5e7d2f39 phone_number:string first_name:string last_name:string user_id:int = MessageMedia;
+messageMediaUnsupported#29632a36 bytes:bytes = MessageMedia;
+
+messageActionEmpty#b6aef7b0 = MessageAction;
+messageActionChatCreate#a6638b9a title:string users:Vector<int> = MessageAction;
+messageActionChatEditTitle#b5a1ce5a title:string = MessageAction;
+messageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction;
+messageActionChatDeletePhoto#95e3fbef = MessageAction;
+messageActionChatAddUser#5e3cfc4b user_id:int = MessageAction;
+messageActionChatDeleteUser#b2ae9b0c user_id:int = MessageAction;
+
+dialog#ab3a99ac peer:Peer top_message:int unread_count:int notify_settings:PeerNotifySettings = Dialog;
+
+photoEmpty#2331b22d id:long = Photo;
+photo#22b56751 id:long access_hash:long user_id:int date:int caption:string geo:GeoPoint sizes:Vector<PhotoSize> = Photo;
+
+photoSizeEmpty#e17e23c type:string = PhotoSize;
+photoSize#77bfb61b type:string location:FileLocation w:int h:int size:int = PhotoSize;
+photoCachedSize#e9a734fa type:string location:FileLocation w:int h:int bytes:bytes = PhotoSize;
+
+videoEmpty#c10658a8 id:long = Video;
+video#388fa391 id:long access_hash:long user_id:int date:int caption:string duration:int mime_type:string size:int thumb:PhotoSize dc_id:int w:int h:int = Video;
+
+geoPointEmpty#1117dd5f = GeoPoint;
+geoPoint#2049d70c longitude:double latitude:double = GeoPoint;
+
+auth.checkedPhone#e300cc3b phone_registered:Bool phone_invited:Bool = auth.CheckedPhone;
+
+auth.sentCode#efed51d9 phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
+
+auth.authorization#f6b673a4 expires:int user:User = auth.Authorization;
+
+auth.exportedAuthorization#df969c2d id:int bytes:bytes = auth.ExportedAuthorization;
+
+inputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer;
+inputNotifyUsers#193b4417 = InputNotifyPeer;
+inputNotifyChats#4a95e84e = InputNotifyPeer;
+inputNotifyAll#a429b886 = InputNotifyPeer;
+
+inputPeerNotifyEventsEmpty#f03064d8 = InputPeerNotifyEvents;
+inputPeerNotifyEventsAll#e86a2c74 = InputPeerNotifyEvents;
+
+inputPeerNotifySettings#46a2ce98 mute_until:int sound:string show_previews:Bool events_mask:int = InputPeerNotifySettings;
+
+peerNotifyEventsEmpty#add53cb3 = PeerNotifyEvents;
+peerNotifyEventsAll#6d1ded88 = PeerNotifyEvents;
+
+peerNotifySettingsEmpty#70a68512 = PeerNotifySettings;
+peerNotifySettings#8d5e11ee mute_until:int sound:string show_previews:Bool events_mask:int = PeerNotifySettings;
+
+wallPaper#ccb03657 id:int title:string sizes:Vector<PhotoSize> color:int = WallPaper;
+
+userFull#771095da user:User link:contacts.Link profile_photo:Photo notify_settings:PeerNotifySettings blocked:Bool real_first_name:string real_last_name:string = UserFull;
+
+contact#f911c994 user_id:int mutual:Bool = Contact;
+
+importedContact#d0028438 user_id:int client_id:long = ImportedContact;
+
+contactBlocked#561bc879 user_id:int date:int = ContactBlocked;
+
+contactSuggested#3de191a1 user_id:int mutual_contacts:int = ContactSuggested;
+
+contactStatus#d3680c61 user_id:int status:UserStatus = ContactStatus;
+
+chatLocated#3631cf4c chat_id:int distance:int = ChatLocated;
+
+contacts.foreignLinkUnknown#133421f8 = contacts.ForeignLink;
+contacts.foreignLinkRequested#a7801f47 has_phone:Bool = contacts.ForeignLink;
+contacts.foreignLinkMutual#1bea8ce1 = contacts.ForeignLink;
+
+contacts.myLinkEmpty#d22a1c60 = contacts.MyLink;
+contacts.myLinkRequested#6c69efee contact:Bool = contacts.MyLink;
+contacts.myLinkContact#c240ebd9 = contacts.MyLink;
+
+contacts.link#eccea3f5 my_link:contacts.MyLink foreign_link:contacts.ForeignLink user:User = contacts.Link;
+
+contacts.contactsNotModified#b74ba9d2 = contacts.Contacts;
+contacts.contacts#6f8b8cb2 contacts:Vector<Contact> users:Vector<User> = contacts.Contacts;
+
+contacts.importedContacts#ad524315 imported:Vector<ImportedContact> retry_contacts:Vector<long> users:Vector<User> = contacts.ImportedContacts;
+
+contacts.blocked#1c138d15 blocked:Vector<ContactBlocked> users:Vector<User> = contacts.Blocked;
+contacts.blockedSlice#900802a1 count:int blocked:Vector<ContactBlocked> users:Vector<User> = contacts.Blocked;
+
+contacts.suggested#5649dcc5 results:Vector<ContactSuggested> users:Vector<User> = contacts.Suggested;
+
+messages.dialogs#15ba6c40 dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
+messages.dialogsSlice#71e094f3 count:int dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
+
+messages.messages#8c718e87 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+messages.messagesSlice#b446ae3 count:int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+
+messages.messageEmpty#3f4e0648 = messages.Message;
+messages.message#ff90c417 message:Message chats:Vector<Chat> users:Vector<User> = messages.Message;
+
+messages.statedMessages#969478bb messages:Vector<Message> chats:Vector<Chat> users:Vector<User> pts:int seq:int = messages.StatedMessages;
+
+messages.statedMessage#d07ae726 message:Message chats:Vector<Chat> users:Vector<User> pts:int seq:int = messages.StatedMessage;
+
+messages.sentMessage#d1f4d35c id:int date:int pts:int seq:int = messages.SentMessage;
+
+messages.chat#40e9002a chat:Chat users:Vector<User> = messages.Chat;
+
+messages.chats#8150cbd8 chats:Vector<Chat> users:Vector<User> = messages.Chats;
+
+messages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector<Chat> users:Vector<User> = messages.ChatFull;
+
+messages.affectedHistory#b7de36f2 pts:int seq:int offset:int = messages.AffectedHistory;
+
+inputMessagesFilterEmpty#57e2f66c = MessagesFilter;
+inputMessagesFilterPhotos#9609a51c = MessagesFilter;
+inputMessagesFilterVideo#9fc00e65 = MessagesFilter;
+inputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter;
+inputMessagesFilterDocument#9eddf188 = MessagesFilter;
+inputMessagesFilterAudio#cfc87522 = MessagesFilter;
+
+updateNewMessage#13abdb3 message:Message pts:int = Update;
+updateMessageID#4e90bfd6 id:int random_id:long = Update;
+updateReadMessages#c6649e31 messages:Vector<int> pts:int = Update;
+updateDeleteMessages#a92bfe26 messages:Vector<int> pts:int = Update;
+updateRestoreMessages#d15de04d messages:Vector<int> pts:int = Update;
+updateUserTyping#5c486927 user_id:int action:SendMessageAction = Update;
+updateChatUserTyping#9a65ea1f chat_id:int user_id:int action:SendMessageAction = Update;
+updateChatParticipants#7761198 participants:ChatParticipants = Update;
+updateUserStatus#1bfbd823 user_id:int status:UserStatus = Update;
+updateUserName#a7332b73 user_id:int first_name:string last_name:string username:string = Update;
+updateUserPhoto#95313b0c user_id:int date:int photo:UserProfilePhoto previous:Bool = Update;
+updateContactRegistered#2575bbb9 user_id:int date:int = Update;
+updateContactLink#51a48a9a user_id:int my_link:contacts.MyLink foreign_link:contacts.ForeignLink = Update;
+updateActivation#6f690963 user_id:int = Update;
+updateNewAuthorization#8f06529a auth_key_id:long date:int device:string location:string = Update;
+
+updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
+
+updates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference;
+updates.difference#f49ca0 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> state:updates.State = updates.Difference;
+updates.differenceSlice#a8fb1981 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> intermediate_state:updates.State = updates.Difference;
+
+updatesTooLong#e317af7e = Updates;
+updateShortMessage#d3f45784 id:int from_id:int message:string pts:int date:int seq:int = Updates;
+updateShortChatMessage#2b2fbd4e id:int from_id:int chat_id:int message:string pts:int date:int seq:int = Updates;
+updateShort#78d4dec1 update:Update date:int = Updates;
+updatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;
+updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
+
+photos.photos#8dca6aa5 photos:Vector<Photo> users:Vector<User> = photos.Photos;
+photos.photosSlice#15051f54 count:int photos:Vector<Photo> users:Vector<User> = photos.Photos;
+
+photos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;
+
+upload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;
+
+dcOption#2ec2a43c id:int hostname:string ip_address:string port:int = DcOption;
+
+config#2e54dd74 date:int test_mode:Bool this_dc:int dc_options:Vector<DcOption> chat_size_max:int broadcast_size_max:int = Config;
+
+nearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;
+
+help.appUpdate#8987f311 id:int critical:Bool url:string text:string = help.AppUpdate;
+help.noAppUpdate#c45a6536 = help.AppUpdate;
+
+help.inviteText#18cb9f78 message:string = help.InviteText;
+
+messages.statedMessagesLinks#3e74f5c6 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> links:Vector<contacts.Link> pts:int seq:int = messages.StatedMessages;
+
+messages.statedMessageLink#a9af2881 message:Message chats:Vector<Chat> users:Vector<User> links:Vector<contacts.Link> pts:int seq:int = messages.StatedMessage;
+
+messages.sentMessageLink#e9db4a3f id:int date:int pts:int seq:int links:Vector<contacts.Link> = messages.SentMessage;
+
+inputGeoChat#74d456fa chat_id:int access_hash:long = InputGeoChat;
+
+inputNotifyGeoChatPeer#4d8ddec8 geo_peer:InputGeoChat = InputNotifyPeer;
+
+geoChat#75eaea5a id:int access_hash:long title:string address:string venue:string geo:GeoPoint photo:ChatPhoto participants_count:int date:int checked_in:Bool version:int = Chat;
+
+geoChatMessageEmpty#60311a9b chat_id:int id:int = GeoChatMessage;
+geoChatMessage#4505f8e1 chat_id:int id:int from_id:int date:int message:string media:MessageMedia = GeoChatMessage;
+geoChatMessageService#d34fa24e chat_id:int id:int from_id:int date:int action:MessageAction = GeoChatMessage;
+
+geochats.statedMessage#17b1578b message:GeoChatMessage chats:Vector<Chat> users:Vector<User> seq:int = geochats.StatedMessage;
+
+geochats.located#48feb267 results:Vector<ChatLocated> messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Located;
+
+geochats.messages#d1526db1 messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Messages;
+geochats.messagesSlice#bc5863e8 count:int messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Messages;
+
+messageActionGeoChatCreate#6f038ebc title:string address:string = MessageAction;
+messageActionGeoChatCheckin#c7d53de = MessageAction;
+
+updateNewGeoChatMessage#5a68e3f7 geo_message:GeoChatMessage = Update;
+
+wallPaperSolid#63117f24 id:int title:string bg_color:int color:int = WallPaper;
+
+updateNewEncryptedMessage#12bcbd9a encr_message:EncryptedMessage qts:int = Update;
+updateEncryptedChatTyping#1710f156 chat_id:int = Update;
+updateEncryption#b4a2e88d encr_chat:EncryptedChat date:int = Update;
+updateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update;
+
+encryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat;
+encryptedChatWaiting#3bf703dc id:int access_hash:long date:int admin_id:int participant_id:int = EncryptedChat;
+encryptedChatRequested#c878527e id:int access_hash:long date:int admin_id:int participant_id:int g_a:bytes = EncryptedChat;
+encryptedChat#fa56ce36 id:int access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long = EncryptedChat;
+encryptedChatDiscarded#13d6dd27 id:int = EncryptedChat;
+
+inputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat;
+
+encryptedFileEmpty#c21f497e = EncryptedFile;
+encryptedFile#4a70994c id:long access_hash:long size:int dc_id:int key_fingerprint:int = EncryptedFile;
+
+inputEncryptedFileEmpty#1837c364 = InputEncryptedFile;
+inputEncryptedFileUploaded#64bd0306 id:long parts:int md5_checksum:string key_fingerprint:int = InputEncryptedFile;
+inputEncryptedFile#5a17b5e5 id:long access_hash:long = InputEncryptedFile;
+
+inputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation;
+
+encryptedMessage#ed18c118 random_id:long chat_id:int date:int bytes:bytes file:EncryptedFile = EncryptedMessage;
+encryptedMessageService#23734b06 random_id:long chat_id:int date:int bytes:bytes = EncryptedMessage;
+
+messages.dhConfigNotModified#c0e24635 random:bytes = messages.DhConfig;
+messages.dhConfig#2c221edd g:int p:bytes version:int random:bytes = messages.DhConfig;
+
+messages.sentEncryptedMessage#560f8935 date:int = messages.SentEncryptedMessage;
+messages.sentEncryptedFile#9493ff32 date:int file:EncryptedFile = messages.SentEncryptedMessage;
+
+inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;
+
+inputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile;
+
+updateChatParticipantAdd#3a0eeb22 chat_id:int user_id:int inviter_id:int version:int = Update;
+updateChatParticipantDelete#6e5f8c22 chat_id:int user_id:int version:int = Update;
+updateDcOptions#8e5e9873 dc_options:Vector<DcOption> = Update;
+
+inputMediaUploadedAudio#4e498cab file:InputFile duration:int mime_type:string = InputMedia;
+inputMediaAudio#89938781 audio_id:InputAudio = InputMedia;
+inputMediaUploadedDocument#ffe76b78 file:InputFile mime_type:string attributes:Vector<DocumentAttribute> = InputMedia;
+inputMediaUploadedThumbDocument#41481486 file:InputFile thumb:InputFile mime_type:string attributes:Vector<DocumentAttribute> = InputMedia;
+inputMediaDocument#d184e841 document_id:InputDocument = InputMedia;
+
+messageMediaDocument#2fda2204 document:Document = MessageMedia;
+messageMediaAudio#c6b68300 audio:Audio = MessageMedia;
+
+inputAudioEmpty#d95adc84 = InputAudio;
+inputAudio#77d440ff id:long access_hash:long = InputAudio;
+
+inputDocumentEmpty#72f0eaae = InputDocument;
+inputDocument#18798952 id:long access_hash:long = InputDocument;
+
+inputAudioFileLocation#74dc404d id:long access_hash:long = InputFileLocation;
+inputDocumentFileLocation#4e45abe9 id:long access_hash:long = InputFileLocation;
+
+audioEmpty#586988d8 id:long = Audio;
+audio#c7ac6496 id:long access_hash:long user_id:int date:int duration:int mime_type:string size:int dc_id:int = Audio;
+
+documentEmpty#36f8c871 id:long = Document;
+document#f9a39f4f id:long access_hash:long date:int mime_type:string size:int thumb:PhotoSize dc_id:int attributes:Vector<DocumentAttribute> = Document;
+document_l19#9efc6326 id:long access_hash:long user_id:int date:int file_name:string mime_type:string size:int thumb:PhotoSize dc_id:int = Document;
+
+help.support#17c6b5f6 phone_number:string user:User = help.Support;
+
+notifyPeer#9fd40bd8 peer:Peer = NotifyPeer;
+notifyUsers#b4c83b4c = NotifyPeer;
+notifyChats#c007cec3 = NotifyPeer;
+notifyAll#74d07c60 = NotifyPeer;
+
+updateUserBlocked#80ece81a user_id:int blocked:Bool = Update;
+updateNotifySettings#bec268ef peer:NotifyPeer notify_settings:PeerNotifySettings = Update;
+
+auth.sentAppCode#e325edcf phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
+
+sendMessageTypingAction#16bf744e = SendMessageAction;
+sendMessageCancelAction#fd5ec8f5 = SendMessageAction;
+sendMessageRecordVideoAction#a187d66f = SendMessageAction;
+sendMessageUploadVideoAction#92042ff7 = SendMessageAction;
+sendMessageRecordAudioAction#d52f73f7 = SendMessageAction;
+sendMessageUploadAudioAction#e6ac8a6f = SendMessageAction;
+sendMessageUploadPhotoAction#990a3c1a = SendMessageAction;
+sendMessageUploadDocumentAction#8faee98e = SendMessageAction;
+sendMessageGeoLocationAction#176f8ba1 = SendMessageAction;
+sendMessageChooseContactAction#628cbc6f = SendMessageAction;
+
+contactFound#ea879f95 user_id:int = ContactFound;
+
+contacts.found#566000e results:Vector<ContactFound> users:Vector<User> = contacts.Found;
+
+updateServiceNotification#382dd3e4 type:string message_text:string media:MessageMedia popup:Bool = Update;
+
+userStatusRecently#e26f42f1 = UserStatus;
+userStatusLastWeek#7bf09fc = UserStatus;
+userStatusLastMonth#77ebc742 = UserStatus;
+
+updatePrivacy#ee3b272a key:PrivacyKey rules:Vector<PrivacyRule> = Update;
+
+inputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey;
+
+privacyKeyStatusTimestamp#bc2eab30 = PrivacyKey;
+
+inputPrivacyValueAllowContacts#d09e07b = InputPrivacyRule;
+inputPrivacyValueAllowAll#184b35ce = InputPrivacyRule;
+inputPrivacyValueAllowUsers#131cc67f users:Vector<InputUser> = InputPrivacyRule;
+inputPrivacyValueDisallowContacts#ba52007 = InputPrivacyRule;
+inputPrivacyValueDisallowAll#d66b66c9 = InputPrivacyRule;
+inputPrivacyValueDisallowUsers#90110467 users:Vector<InputUser> = InputPrivacyRule;
+
+privacyValueAllowContacts#fffe1bac = PrivacyRule;
+privacyValueAllowAll#65427b82 = PrivacyRule;
+privacyValueAllowUsers#4d5bbe0c users:Vector<int> = PrivacyRule;
+privacyValueDisallowContacts#f888fa1a = PrivacyRule;
+privacyValueDisallowAll#8b73e763 = PrivacyRule;
+privacyValueDisallowUsers#c7f49b7 users:Vector<int> = PrivacyRule;
+
+account.privacyRules#554abb6f rules:Vector<PrivacyRule> users:Vector<User> = account.PrivacyRules;
+
+accountDaysTTL#b8d0afdf days:int = AccountDaysTTL;
+
+account.sentChangePhoneCode#a4f58c4c phone_code_hash:string send_call_timeout:int = account.SentChangePhoneCode;
+
+updateUserPhone#12b9417b user_id:int phone:string = Update;
+
+account.noPassword#5770e7a9 new_salt:bytes = account.Password;
+account.password#739e5f72 current_salt:bytes new_salt:bytes hint:string = account.Password;
+
+documentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute;
+documentAttributeAnimated#11b58939 = DocumentAttribute;
+documentAttributeSticker#fb0a5727 = DocumentAttribute;
+documentAttributeVideo#5910cccb duration:int w:int h:int = DocumentAttribute;
+documentAttributeAudio#51448e5 duration:int = DocumentAttribute;
+documentAttributeFilename#15590068 file_name:string = DocumentAttribute;
+
+messages.stickersNotModified#f1749a22 = messages.Stickers;
+messages.stickers#8a8ecd32 hash:string stickers:Vector<Document> = messages.Stickers;
+
+stickerPack#12b299d4 emoticon:string documents:Vector<long> = StickerPack;
+
+messages.allStickersNotModified#e86602c3 = messages.AllStickers;
+messages.allStickers#dcef3102 hash:string packs:Vector<StickerPack> documents:Vector<Document> = messages.AllStickers;
+
+---functions---
+
+invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
+
+invokeAfterMsgs#3dc4b4f0 {X:Type} msg_ids:Vector<long> query:!X = X;
+
+auth.checkPhone#6fe51dfb phone_number:string = auth.CheckedPhone;
+auth.sendCode#768d5f4d phone_number:string sms_type:int api_id:int api_hash:string lang_code:string = auth.SentCode;
+auth.sendCall#3c51564 phone_number:string phone_code_hash:string = Bool;
+auth.signUp#1b067634 phone_number:string phone_code_hash:string phone_code:string first_name:string last_name:string = auth.Authorization;
+auth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:string = auth.Authorization;
+auth.logOut#5717da40 = Bool;
+auth.resetAuthorizations#9fab0d1a = Bool;
+auth.sendInvites#771c1d97 phone_numbers:Vector<string> message:string = Bool;
+auth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization;
+auth.importAuthorization#e3ef9613 id:int bytes:bytes = auth.Authorization;
+auth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool;
+
+account.registerDevice#446c712c token_type:int token:string device_model:string system_version:string app_version:string app_sandbox:Bool lang_code:string = Bool;
+account.unregisterDevice#65c55b40 token_type:int token:string = Bool;
+account.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool;
+account.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings;
+account.resetNotifySettings#db7e1747 = Bool;
+account.updateProfile#f0888d68 first_name:string last_name:string = User;
+account.updateStatus#6628562c offline:Bool = Bool;
+account.getWallPapers#c04cfac2 = Vector<WallPaper>;
+
+users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
+users.getFullUser#ca30a5b1 id:InputUser = UserFull;
+
+contacts.getStatuses#c4a353ee = Vector<ContactStatus>;
+contacts.getContacts#22c6aa08 hash:string = contacts.Contacts;
+contacts.importContacts#da30b32d contacts:Vector<InputContact> replace:Bool = contacts.ImportedContacts;
+contacts.getSuggested#cd773428 limit:int = contacts.Suggested;
+contacts.deleteContact#8e953744 id:InputUser = contacts.Link;
+contacts.deleteContacts#59ab389e id:Vector<InputUser> = Bool;
+contacts.block#332b49fc id:InputUser = Bool;
+contacts.unblock#e54100bd id:InputUser = Bool;
+contacts.getBlocked#f57c350f offset:int limit:int = contacts.Blocked;
+contacts.exportCard#84e53737 = Vector<int>;
+contacts.importCard#4fe196fe export_card:Vector<int> = User;
+
+messages.getMessages#4222fa74 id:Vector<int> = messages.Messages;
+messages.getDialogs#eccf1df6 offset:int max_id:int limit:int = messages.Dialogs;
+messages.getHistory#92a1df2f peer:InputPeer offset:int max_id:int limit:int = messages.Messages;
+messages.search#7e9f2ab peer:InputPeer q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = messages.Messages;
+messages.readHistory#eed884c6 peer:InputPeer max_id:int offset:int read_contents:Bool = messages.AffectedHistory;
+messages.deleteHistory#f4f8fb61 peer:InputPeer offset:int = messages.AffectedHistory;
+messages.deleteMessages#14f2dd0a id:Vector<int> = Vector<int>;
+messages.restoreMessages#395f9d7e id:Vector<int> = Vector<int>;
+messages.receivedMessages#28abcb68 max_id:int = Vector<int>;
+messages.setTyping#a3825e50 peer:InputPeer action:SendMessageAction = Bool;
+messages.sendMessage#4cde0aab peer:InputPeer message:string random_id:long = messages.SentMessage;
+messages.sendMedia#a3c85d76 peer:InputPeer media:InputMedia random_id:long = messages.StatedMessage;
+messages.forwardMessages#514cd10f peer:InputPeer id:Vector<int> = messages.StatedMessages;
+messages.getChats#3c6aa187 id:Vector<int> = messages.Chats;
+messages.getFullChat#3b831c66 chat_id:int = messages.ChatFull;
+messages.editChatTitle#b4bc68b5 chat_id:int title:string = messages.StatedMessage;
+messages.editChatPhoto#d881821d chat_id:int photo:InputChatPhoto = messages.StatedMessage;
+messages.addChatUser#2ee9ee9e chat_id:int user_id:InputUser fwd_limit:int = messages.StatedMessage;
+messages.deleteChatUser#c3c5cd23 chat_id:int user_id:InputUser = messages.StatedMessage;
+messages.createChat#419d9aee users:Vector<InputUser> title:string = messages.StatedMessage;
+
+updates.getState#edd4882a = updates.State;
+updates.getDifference#a041495 pts:int date:int qts:int = updates.Difference;
+
+photos.updateProfilePhoto#eef579a0 id:InputPhoto crop:InputPhotoCrop = UserProfilePhoto;
+photos.uploadProfilePhoto#d50f9c88 file:InputFile caption:string geo_point:InputGeoPoint crop:InputPhotoCrop = photos.Photo;
+photos.deletePhotos#87cf7f2f id:Vector<InputPhoto> = Vector<long>;
+
+upload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool;
+upload.getFile#e3a6cfb5 location:InputFileLocation offset:int limit:int = upload.File;
+
+help.getConfig#c4f9186b = Config;
+help.getNearestDc#1fb33026 = NearestDc;
+help.getAppUpdate#c812ac7e device_model:string system_version:string app_version:string lang_code:string = help.AppUpdate;
+help.saveAppLog#6f02f748 events:Vector<InputAppEvent> = Bool;
+help.getInviteText#a4a95186 lang_code:string = help.InviteText;
+
+photos.getUserPhotos#b7ee553c user_id:InputUser offset:int max_id:int limit:int = photos.Photos;
+
+messages.forwardMessage#3f3f4f2 peer:InputPeer id:int random_id:long = messages.StatedMessage;
+messages.sendBroadcast#41bb0972 contacts:Vector<InputUser> message:string media:InputMedia = messages.StatedMessages;
+
+geochats.getLocated#7f192d8f geo_point:InputGeoPoint radius:int limit:int = geochats.Located;
+geochats.getRecents#e1427e6f offset:int limit:int = geochats.Messages;
+geochats.checkin#55b3e8fb peer:InputGeoChat = geochats.StatedMessage;
+geochats.getFullChat#6722dd6f peer:InputGeoChat = messages.ChatFull;
+geochats.editChatTitle#4c8e2273 peer:InputGeoChat title:string address:string = geochats.StatedMessage;
+geochats.editChatPhoto#35d81a95 peer:InputGeoChat photo:InputChatPhoto = geochats.StatedMessage;
+geochats.search#cfcdc44d peer:InputGeoChat q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = geochats.Messages;
+geochats.getHistory#b53f7a68 peer:InputGeoChat offset:int max_id:int limit:int = geochats.Messages;
+geochats.setTyping#8b8a729 peer:InputGeoChat typing:Bool = Bool;
+geochats.sendMessage#61b0044 peer:InputGeoChat message:string random_id:long = geochats.StatedMessage;
+geochats.sendMedia#b8f0deff peer:InputGeoChat media:InputMedia random_id:long = geochats.StatedMessage;
+geochats.createGeoChat#e092e16 title:string geo_point:InputGeoPoint address:string venue:string = geochats.StatedMessage;
+
+messages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig;
+messages.requestEncryption#f64daf43 user_id:InputUser random_id:int g_a:bytes = EncryptedChat;
+messages.acceptEncryption#3dbc0415 peer:InputEncryptedChat g_b:bytes key_fingerprint:long = EncryptedChat;
+messages.discardEncryption#edd923c5 chat_id:int = Bool;
+messages.setEncryptedTyping#791451ed peer:InputEncryptedChat typing:Bool = Bool;
+messages.readEncryptedHistory#7f4b690a peer:InputEncryptedChat max_date:int = Bool;
+messages.sendEncrypted#a9776773 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
+messages.sendEncryptedFile#9a901b66 peer:InputEncryptedChat random_id:long data:bytes file:InputEncryptedFile = messages.SentEncryptedMessage;
+messages.sendEncryptedService#32d439a4 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
+messages.receivedQueue#55a5bb66 max_qts:int = Vector<long>;
+
+upload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool;
+
+initConnection#69796de9 {X:Type} api_id:int device_model:string system_version:string app_version:string lang_code:string query:!X = X;
+
+help.getSupport#9cdf08cd = help.Support;
+
+auth.sendSms#da9f3e8 phone_number:string phone_code_hash:string = Bool;
+
+messages.readMessageContents#354b5bc2 id:Vector<int> = Vector<int>;
+
+account.checkUsername#2714d86c username:string = Bool;
+account.updateUsername#3e0bdd7c username:string = User;
+
+contacts.search#11f812d8 q:string limit:int = contacts.Found;
+
+account.getPrivacy#dadbc950 key:InputPrivacyKey = account.PrivacyRules;
+account.setPrivacy#c9f81ce8 key:InputPrivacyKey rules:Vector<InputPrivacyRule> = account.PrivacyRules;
+account.deleteAccount#418d4e0b reason:string = Bool;
+account.getAccountTTL#8fc711d = AccountDaysTTL;
+account.setAccountTTL#2442485e ttl:AccountDaysTTL = Bool;
+
+invokeWithLayer#da9b0d0d {X:Type} layer:int query:!X = X;
+
+contacts.resolveUsername#bf0131c username:string = User;
+
+account.sendChangePhoneCode#a407a8f4 phone_number:string = account.SentChangePhoneCode;
+account.changePhone#70c32edb phone_number:string phone_code_hash:string phone_code:string = User;
+account.getPassword#548a30f5 = account.Password;
+account.setPassword#dd2a4d8f current_password_hash:bytes new_salt:bytes new_password_hash:bytes hint:string = Bool;
+
+auth.checkPassword#a63011e password_hash:bytes = auth.Authorization;
+
+messages.getStickers#ae22e045 emoticon:string hash:string = messages.Stickers;
+messages.getAllStickers#aa3bc868 hash:string = messages.AllStickers;
diff --git a/protocols/Telegram/tgl/scheme25.tl b/protocols/Telegram/tgl/scheme25.tl
new file mode 100644
index 0000000000..89447c4ff2
--- /dev/null
+++ b/protocols/Telegram/tgl/scheme25.tl
@@ -0,0 +1,622 @@
+int ?= Int;
+long ?= Long;
+double ?= Double;
+string ?= String;
+
+bytes string = Bytes;
+
+int128 long long = Int128;
+int256 long long long long = Int256;
+
+boolFalse#bc799737 = Bool;
+boolTrue#997275b5 = Bool;
+
+vector#1cb5c415 {t:Type} # [ t ] = Vector t;
+
+error#c4b9f9bb code:int text:string = Error;
+
+null#56730bcc = Null;
+
+inputPeerEmpty#7f3b18ea = InputPeer;
+inputPeerSelf#7da07ec9 = InputPeer;
+inputPeerContact#1023dbe8 user_id:int = InputPeer;
+inputPeerForeign#9b447325 user_id:int access_hash:long = InputPeer;
+inputPeerChat#179be863 chat_id:int = InputPeer;
+
+inputUserEmpty#b98886cf = InputUser;
+inputUserSelf#f7c1b13f = InputUser;
+inputUserContact#86e94f65 user_id:int = InputUser;
+inputUserForeign#655e74ff user_id:int access_hash:long = InputUser;
+
+inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact;
+
+inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;
+
+inputMediaEmpty#9664f57f = InputMedia;
+inputMediaUploadedPhoto#2dc53a7d file:InputFile = InputMedia;
+inputMediaPhoto#8f2ab2ec photo_id:InputPhoto = InputMedia;
+inputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;
+inputMediaContact#a6e45987 phone_number:string first_name:string last_name:string = InputMedia;
+inputMediaUploadedVideo#133ad6f6 file:InputFile duration:int w:int h:int mime_type:string = InputMedia;
+inputMediaUploadedThumbVideo#9912dabf file:InputFile thumb:InputFile duration:int w:int h:int mime_type:string = InputMedia;
+inputMediaVideo#7f023ae6 video_id:InputVideo = InputMedia;
+
+inputChatPhotoEmpty#1ca48f57 = InputChatPhoto;
+inputChatUploadedPhoto#94254732 file:InputFile crop:InputPhotoCrop = InputChatPhoto;
+inputChatPhoto#b2e1bf08 id:InputPhoto crop:InputPhotoCrop = InputChatPhoto;
+
+inputGeoPointEmpty#e4c123d6 = InputGeoPoint;
+inputGeoPoint#f3b7acc9 latitude:double longitude:double = InputGeoPoint;
+
+inputPhotoEmpty#1cd7bf0d = InputPhoto;
+inputPhoto#fb95c6c4 id:long access_hash:long = InputPhoto;
+
+inputVideoEmpty#5508ec75 = InputVideo;
+inputVideo#ee579652 id:long access_hash:long = InputVideo;
+
+inputFileLocation#14637196 volume_id:long local_id:int secret:long = InputFileLocation;
+inputVideoFileLocation#3d0364ec id:long access_hash:long = InputFileLocation;
+
+inputPhotoCropAuto#ade6b004 = InputPhotoCrop;
+inputPhotoCrop#d9915325 crop_left:double crop_top:double crop_width:double = InputPhotoCrop;
+
+inputAppEvent#770656a8 time:double type:string peer:long data:string = InputAppEvent;
+
+peerUser#9db1bc6d user_id:int = Peer;
+peerChat#bad0e5bb chat_id:int = Peer;
+
+storage.fileUnknown#aa963b05 = storage.FileType;
+storage.fileJpeg#7efe0e = storage.FileType;
+storage.fileGif#cae1aadf = storage.FileType;
+storage.filePng#a4f63c0 = storage.FileType;
+storage.filePdf#ae1e508d = storage.FileType;
+storage.fileMp3#528a0677 = storage.FileType;
+storage.fileMov#4b09ebbc = storage.FileType;
+storage.filePartial#40bc6f52 = storage.FileType;
+storage.fileMp4#b3cea0e4 = storage.FileType;
+storage.fileWebp#1081464c = storage.FileType;
+
+fileLocationUnavailable#7c596b46 volume_id:long local_id:int secret:long = FileLocation;
+fileLocation#53d69076 dc_id:int volume_id:long local_id:int secret:long = FileLocation;
+
+userEmpty#200250ba id:int = User;
+userSelf#1c60e608 id:int first_name:string last_name:string username:string phone:string photo:UserProfilePhoto status:UserStatus = User;
+userContact#cab35e18 id:int first_name:string last_name:string username:string access_hash:long phone:string photo:UserProfilePhoto status:UserStatus = User;
+userRequest#d9ccc4ef id:int first_name:string last_name:string username:string access_hash:long phone:string photo:UserProfilePhoto status:UserStatus = User;
+userForeign#75cf7a8 id:int first_name:string last_name:string username:string access_hash:long photo:UserProfilePhoto status:UserStatus = User;
+userDeleted#d6016d7a id:int first_name:string last_name:string username:string = User;
+
+userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
+userProfilePhoto#d559d8c8 photo_id:long photo_small:FileLocation photo_big:FileLocation = UserProfilePhoto;
+
+userStatusEmpty#9d05049 = UserStatus;
+userStatusOnline#edb93949 expires:int = UserStatus;
+userStatusOffline#8c703f was_online:int = UserStatus;
+
+chatEmpty#9ba2d800 id:int = Chat;
+chat#6e9c9bc7 id:int title:string photo:ChatPhoto participants_count:int date:int left:Bool version:int = Chat;
+chatForbidden#fb0ccc41 id:int title:string date:int = Chat;
+
+chatFull#630e61be id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings = ChatFull;
+
+chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant;
+
+chatParticipantsForbidden#fd2bb8a chat_id:int = ChatParticipants;
+chatParticipants#7841b415 chat_id:int admin_id:int participants:Vector<ChatParticipant> version:int = ChatParticipants;
+
+chatPhotoEmpty#37c1011c = ChatPhoto;
+chatPhoto#6153276a photo_small:FileLocation photo_big:FileLocation = ChatPhoto;
+
+messageEmpty#83e5de54 id:int = Message;
+message#a7ab1991 flags:# id:int from_id:int to_id:Peer fwd_from_id:flags.2?int fwd_date:flags.2?int reply_to_msg_id:flags.3?int date:int message:string media:MessageMedia = Message;
+messageService#1d86f70e flags:int id:int from_id:int to_id:Peer date:int action:MessageAction = Message;
+
+messageMediaEmpty#3ded6320 = MessageMedia;
+messageMediaPhoto#c8c45a2a photo:Photo = MessageMedia;
+messageMediaVideo#a2d24290 video:Video = MessageMedia;
+messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;
+messageMediaContact#5e7d2f39 phone_number:string first_name:string last_name:string user_id:int = MessageMedia;
+messageMediaUnsupportedL22#29632a36 bytes:bytes = MessageMedia;
+messageMediaUnsupported#9f84f49e = MessageMedia;
+
+messageActionEmpty#b6aef7b0 = MessageAction;
+messageActionChatCreate#a6638b9a title:string users:Vector<int> = MessageAction;
+messageActionChatEditTitle#b5a1ce5a title:string = MessageAction;
+messageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction;
+messageActionChatDeletePhoto#95e3fbef = MessageAction;
+messageActionChatAddUser#5e3cfc4b user_id:int = MessageAction;
+messageActionChatDeleteUser#b2ae9b0c user_id:int = MessageAction;
+
+dialog#c1dd804a peer:Peer top_message:int read_inbox_max_id:int unread_count:int notify_settings:PeerNotifySettings = Dialog;
+
+photoEmpty#2331b22d id:long = Photo;
+photo#22b56751 id:long access_hash:long user_id:int date:int caption:string geo:GeoPoint sizes:Vector<PhotoSize> = Photo;
+
+photoSizeEmpty#e17e23c type:string = PhotoSize;
+photoSize#77bfb61b type:string location:FileLocation w:int h:int size:int = PhotoSize;
+photoCachedSize#e9a734fa type:string location:FileLocation w:int h:int bytes:bytes = PhotoSize;
+
+videoEmpty#c10658a8 id:long = Video;
+video#388fa391 id:long access_hash:long user_id:int date:int caption:string duration:int mime_type:string size:int thumb:PhotoSize dc_id:int w:int h:int = Video;
+
+geoPointEmpty#1117dd5f = GeoPoint;
+geoPoint#2049d70c longitude:double latitude:double = GeoPoint;
+
+auth.checkedPhone#811ea28e phone_registered:Bool = auth.CheckedPhone;
+
+auth.sentCode#efed51d9 phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
+
+auth.authorization#f6b673a4 expires:int user:User = auth.Authorization;
+
+auth.exportedAuthorization#df969c2d id:int bytes:bytes = auth.ExportedAuthorization;
+
+inputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer;
+inputNotifyUsers#193b4417 = InputNotifyPeer;
+inputNotifyChats#4a95e84e = InputNotifyPeer;
+inputNotifyAll#a429b886 = InputNotifyPeer;
+
+inputPeerNotifyEventsEmpty#f03064d8 = InputPeerNotifyEvents;
+inputPeerNotifyEventsAll#e86a2c74 = InputPeerNotifyEvents;
+
+inputPeerNotifySettings#46a2ce98 mute_until:int sound:string show_previews:Bool events_mask:int = InputPeerNotifySettings;
+
+peerNotifyEventsEmpty#add53cb3 = PeerNotifyEvents;
+peerNotifyEventsAll#6d1ded88 = PeerNotifyEvents;
+
+peerNotifySettingsEmpty#70a68512 = PeerNotifySettings;
+peerNotifySettings#8d5e11ee mute_until:int sound:string show_previews:Bool events_mask:int = PeerNotifySettings;
+
+wallPaper#ccb03657 id:int title:string sizes:Vector<PhotoSize> color:int = WallPaper;
+
+userFull#771095da user:User link:contacts.Link profile_photo:Photo notify_settings:PeerNotifySettings blocked:Bool real_first_name:string real_last_name:string = UserFull;
+
+contact#f911c994 user_id:int mutual:Bool = Contact;
+
+importedContact#d0028438 user_id:int client_id:long = ImportedContact;
+
+contactBlocked#561bc879 user_id:int date:int = ContactBlocked;
+
+contactSuggested#3de191a1 user_id:int mutual_contacts:int = ContactSuggested;
+
+contactStatus#d3680c61 user_id:int status:UserStatus = ContactStatus;
+
+chatLocated#3631cf4c chat_id:int distance:int = ChatLocated;
+
+contacts.link#3ace484c my_link:ContactLink foreign_link:ContactLink user:User = contacts.Link;
+
+contacts.contactsNotModified#b74ba9d2 = contacts.Contacts;
+contacts.contacts#6f8b8cb2 contacts:Vector<Contact> users:Vector<User> = contacts.Contacts;
+
+contacts.importedContacts#ad524315 imported:Vector<ImportedContact> retry_contacts:Vector<long> users:Vector<User> = contacts.ImportedContacts;
+
+contacts.blocked#1c138d15 blocked:Vector<ContactBlocked> users:Vector<User> = contacts.Blocked;
+contacts.blockedSlice#900802a1 count:int blocked:Vector<ContactBlocked> users:Vector<User> = contacts.Blocked;
+
+contacts.suggested#5649dcc5 results:Vector<ContactSuggested> users:Vector<User> = contacts.Suggested;
+
+messages.dialogs#15ba6c40 dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
+messages.dialogsSlice#71e094f3 count:int dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
+
+messages.messages#8c718e87 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+messages.messagesSlice#b446ae3 count:int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+
+messages.messageEmpty#3f4e0648 = messages.Message;
+
+messages.sentMessage#4c3d47f3 id:int date:int media:MessageMedia pts:int pts_count:int = messages.SentMessage;
+
+messages.chats#64ff9fd5 chats:Vector<Chat> = messages.Chats;
+
+messages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector<Chat> users:Vector<User> = messages.ChatFull;
+
+messages.affectedHistory#b45c69d1 pts:int pts_count:int offset:int = messages.AffectedHistory;
+
+inputMessagesFilterEmpty#57e2f66c = MessagesFilter;
+inputMessagesFilterPhotos#9609a51c = MessagesFilter;
+inputMessagesFilterVideo#9fc00e65 = MessagesFilter;
+inputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter;
+inputMessagesFilterPhotoVideoDocuments#d95e73bb = MessagesFilter;
+inputMessagesFilterDocument#9eddf188 = MessagesFilter;
+inputMessagesFilterAudio#cfc87522 = MessagesFilter;
+
+updateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update;
+updateMessageID#4e90bfd6 id:int random_id:long = Update;
+updateReadMessages#2e5ab668 messages:Vector<int> pts:int pts_count:int = Update;
+updateDeleteMessages#a20db0e5 messages:Vector<int> pts:int pts_count:int = Update;
+updateUserTyping#5c486927 user_id:int action:SendMessageAction = Update;
+updateChatUserTyping#9a65ea1f chat_id:int user_id:int action:SendMessageAction = Update;
+updateChatParticipants#7761198 participants:ChatParticipants = Update;
+updateUserStatus#1bfbd823 user_id:int status:UserStatus = Update;
+updateUserName#a7332b73 user_id:int first_name:string last_name:string username:string = Update;
+updateUserPhoto#95313b0c user_id:int date:int photo:UserProfilePhoto previous:Bool = Update;
+updateContactRegistered#2575bbb9 user_id:int date:int = Update;
+updateContactLink#9d2e67c5 user_id:int my_link:ContactLink foreign_link:ContactLink = Update;
+updateNewAuthorization#8f06529a auth_key_id:long date:int device:string location:string = Update;
+
+updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
+
+updates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference;
+updates.difference#f49ca0 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> state:updates.State = updates.Difference;
+updates.differenceSlice#a8fb1981 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> intermediate_state:updates.State = updates.Difference;
+
+updatesTooLong#e317af7e = Updates;
+updateShortMessage#ed5c2127 flags:# id:int user_id:int message:string pts:int pts_count:int date:int fwd_from_id:flags.2?int fwd_date:flags.2?int reply_to_msg_id:flags.3?int = Updates;
+updateShortChatMessage#52238b3c flags:# id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from_id:flags.2?int fwd_date:flags.2?int reply_to_msg_id:flags.3?int = Updates;
+updateShort#78d4dec1 update:Update date:int = Updates;
+updatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;
+updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
+
+photos.photos#8dca6aa5 photos:Vector<Photo> users:Vector<User> = photos.Photos;
+photos.photosSlice#15051f54 count:int photos:Vector<Photo> users:Vector<User> = photos.Photos;
+
+photos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;
+
+upload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;
+
+dcOption#2ec2a43c id:int hostname:string ip_address:string port:int = DcOption;
+
+config#68bac247 date:int expires:int test_mode:Bool this_dc:int dc_options:Vector<DcOption> chat_size_max:int broadcast_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int chat_big_size:int disabled_features:Vector<DisabledFeature> = Config;
+
+nearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;
+
+help.appUpdate#8987f311 id:int critical:Bool url:string text:string = help.AppUpdate;
+help.noAppUpdate#c45a6536 = help.AppUpdate;
+
+help.inviteText#18cb9f78 message:string = help.InviteText;
+
+messages.sentMessageLink#35a1a663 id:int date:int media:MessageMedia pts:int pts_count:int links:Vector<contacts.Link> seq:int = messages.SentMessage;
+
+inputGeoChat#74d456fa chat_id:int access_hash:long = InputGeoChat;
+
+inputNotifyGeoChatPeer#4d8ddec8 geo_peer:InputGeoChat = InputNotifyPeer;
+
+geoChat#75eaea5a id:int access_hash:long title:string address:string venue:string geo:GeoPoint photo:ChatPhoto participants_count:int date:int checked_in:Bool version:int = Chat;
+
+geoChatMessageEmpty#60311a9b chat_id:int id:int = GeoChatMessage;
+geoChatMessage#4505f8e1 chat_id:int id:int from_id:int date:int message:string media:MessageMedia = GeoChatMessage;
+geoChatMessageService#d34fa24e chat_id:int id:int from_id:int date:int action:MessageAction = GeoChatMessage;
+
+geochats.statedMessage#17b1578b message:GeoChatMessage chats:Vector<Chat> users:Vector<User> seq:int = geochats.StatedMessage;
+
+geochats.located#48feb267 results:Vector<ChatLocated> messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Located;
+
+geochats.messages#d1526db1 messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Messages;
+geochats.messagesSlice#bc5863e8 count:int messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Messages;
+
+messageActionGeoChatCreate#6f038ebc title:string address:string = MessageAction;
+messageActionGeoChatCheckin#c7d53de = MessageAction;
+
+updateNewGeoChatMessage#5a68e3f7 geo_message:GeoChatMessage = Update;
+
+wallPaperSolid#63117f24 id:int title:string bg_color:int color:int = WallPaper;
+
+updateNewEncryptedMessage#12bcbd9a encr_message:EncryptedMessage qts:int = Update;
+updateEncryptedChatTyping#1710f156 chat_id:int = Update;
+updateEncryption#b4a2e88d encr_chat:EncryptedChat date:int = Update;
+updateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update;
+
+encryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat;
+encryptedChatWaiting#3bf703dc id:int access_hash:long date:int admin_id:int participant_id:int = EncryptedChat;
+encryptedChatRequested#c878527e id:int access_hash:long date:int admin_id:int participant_id:int g_a:bytes = EncryptedChat;
+encryptedChat#fa56ce36 id:int access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long = EncryptedChat;
+encryptedChatDiscarded#13d6dd27 id:int = EncryptedChat;
+
+inputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat;
+
+encryptedFileEmpty#c21f497e = EncryptedFile;
+encryptedFile#4a70994c id:long access_hash:long size:int dc_id:int key_fingerprint:int = EncryptedFile;
+
+inputEncryptedFileEmpty#1837c364 = InputEncryptedFile;
+inputEncryptedFileUploaded#64bd0306 id:long parts:int md5_checksum:string key_fingerprint:int = InputEncryptedFile;
+inputEncryptedFile#5a17b5e5 id:long access_hash:long = InputEncryptedFile;
+
+inputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation;
+
+encryptedMessage#ed18c118 random_id:long chat_id:int date:int bytes:bytes file:EncryptedFile = EncryptedMessage;
+encryptedMessageService#23734b06 random_id:long chat_id:int date:int bytes:bytes = EncryptedMessage;
+
+messages.dhConfigNotModified#c0e24635 random:bytes = messages.DhConfig;
+messages.dhConfig#2c221edd g:int p:bytes version:int random:bytes = messages.DhConfig;
+
+messages.sentEncryptedMessage#560f8935 date:int = messages.SentEncryptedMessage;
+messages.sentEncryptedFile#9493ff32 date:int file:EncryptedFile = messages.SentEncryptedMessage;
+
+inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;
+
+inputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile;
+
+updateChatParticipantAdd#3a0eeb22 chat_id:int user_id:int inviter_id:int version:int = Update;
+updateChatParticipantDelete#6e5f8c22 chat_id:int user_id:int version:int = Update;
+updateDcOptions#8e5e9873 dc_options:Vector<DcOption> = Update;
+
+inputMediaUploadedAudio#4e498cab file:InputFile duration:int mime_type:string = InputMedia;
+inputMediaAudio#89938781 audio_id:InputAudio = InputMedia;
+inputMediaUploadedDocument#ffe76b78 file:InputFile mime_type:string attributes:Vector<DocumentAttribute> = InputMedia;
+inputMediaUploadedThumbDocument#41481486 file:InputFile thumb:InputFile mime_type:string attributes:Vector<DocumentAttribute> = InputMedia;
+inputMediaDocument#d184e841 document_id:InputDocument = InputMedia;
+
+messageMediaDocument#2fda2204 document:Document = MessageMedia;
+messageMediaAudio#c6b68300 audio:Audio = MessageMedia;
+
+inputAudioEmpty#d95adc84 = InputAudio;
+inputAudio#77d440ff id:long access_hash:long = InputAudio;
+
+inputDocumentEmpty#72f0eaae = InputDocument;
+inputDocument#18798952 id:long access_hash:long = InputDocument;
+
+inputAudioFileLocation#74dc404d id:long access_hash:long = InputFileLocation;
+inputDocumentFileLocation#4e45abe9 id:long access_hash:long = InputFileLocation;
+
+audioEmpty#586988d8 id:long = Audio;
+audio#c7ac6496 id:long access_hash:long user_id:int date:int duration:int mime_type:string size:int dc_id:int = Audio;
+
+documentEmpty#36f8c871 id:long = Document;
+document#f9a39f4f id:long access_hash:long date:int mime_type:string size:int thumb:PhotoSize dc_id:int attributes:Vector<DocumentAttribute> = Document;
+document_l19#9efc6326 id:long access_hash:long user_id:int date:int file_name:string mime_type:string size:int thumb:PhotoSize dc_id:int = Document;
+
+help.support#17c6b5f6 phone_number:string user:User = help.Support;
+
+notifyPeer#9fd40bd8 peer:Peer = NotifyPeer;
+notifyUsers#b4c83b4c = NotifyPeer;
+notifyChats#c007cec3 = NotifyPeer;
+notifyAll#74d07c60 = NotifyPeer;
+
+updateUserBlocked#80ece81a user_id:int blocked:Bool = Update;
+updateNotifySettings#bec268ef notify_peer:NotifyPeer notify_settings:PeerNotifySettings = Update;
+
+auth.sentAppCode#e325edcf phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
+
+sendMessageTypingAction#16bf744e = SendMessageAction;
+sendMessageCancelAction#fd5ec8f5 = SendMessageAction;
+sendMessageRecordVideoAction#a187d66f = SendMessageAction;
+sendMessageUploadVideoActionL27#92042ff7 = SendMessageAction;
+sendMessageUploadVideoAction#e9763aec progress:int = SendMessageAction;
+sendMessageRecordAudioAction#d52f73f7 = SendMessageAction;
+sendMessageUploadAudioActionL27#e6ac8a6f = SendMessageAction;
+sendMessageUploadAudioAction#f351d7ab progress:int = SendMessageAction;
+sendMessageUploadPhotoAction#990a3c1a = SendMessageAction;
+sendMessageUploadDocumentActionL27#8faee98e = SendMessageAction;
+sendMessageUploadDocumentAction#aa0cd9e4 progress:int = SendMessageAction;
+sendMessageGeoLocationAction#176f8ba1 = SendMessageAction;
+sendMessageChooseContactAction#628cbc6f = SendMessageAction;
+
+contactFound#ea879f95 user_id:int = ContactFound;
+
+contacts.found#566000e results:Vector<ContactFound> users:Vector<User> = contacts.Found;
+
+updateServiceNotification#382dd3e4 type:string message_text:string media:MessageMedia popup:Bool = Update;
+
+userStatusRecently#e26f42f1 = UserStatus;
+userStatusLastWeek#7bf09fc = UserStatus;
+userStatusLastMonth#77ebc742 = UserStatus;
+
+updatePrivacy#ee3b272a key:PrivacyKey rules:Vector<PrivacyRule> = Update;
+
+inputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey;
+
+privacyKeyStatusTimestamp#bc2eab30 = PrivacyKey;
+
+inputPrivacyValueAllowContacts#d09e07b = InputPrivacyRule;
+inputPrivacyValueAllowAll#184b35ce = InputPrivacyRule;
+inputPrivacyValueAllowUsers#131cc67f users:Vector<InputUser> = InputPrivacyRule;
+inputPrivacyValueDisallowContacts#ba52007 = InputPrivacyRule;
+inputPrivacyValueDisallowAll#d66b66c9 = InputPrivacyRule;
+inputPrivacyValueDisallowUsers#90110467 users:Vector<InputUser> = InputPrivacyRule;
+
+privacyValueAllowContacts#fffe1bac = PrivacyRule;
+privacyValueAllowAll#65427b82 = PrivacyRule;
+privacyValueAllowUsers#4d5bbe0c users:Vector<int> = PrivacyRule;
+privacyValueDisallowContacts#f888fa1a = PrivacyRule;
+privacyValueDisallowAll#8b73e763 = PrivacyRule;
+privacyValueDisallowUsers#c7f49b7 users:Vector<int> = PrivacyRule;
+
+account.privacyRules#554abb6f rules:Vector<PrivacyRule> users:Vector<User> = account.PrivacyRules;
+
+accountDaysTTL#b8d0afdf days:int = AccountDaysTTL;
+
+account.sentChangePhoneCode#a4f58c4c phone_code_hash:string send_call_timeout:int = account.SentChangePhoneCode;
+
+updateUserPhone#12b9417b user_id:int phone:string = Update;
+
+documentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute;
+documentAttributeAnimated#11b58939 = DocumentAttribute;
+documentAttributeSticker#994c9882 alt:string = DocumentAttribute;
+documentAttributeVideo#5910cccb duration:int w:int h:int = DocumentAttribute;
+documentAttributeAudio#51448e5 duration:int = DocumentAttribute;
+documentAttributeFilename#15590068 file_name:string = DocumentAttribute;
+
+messages.stickersNotModified#f1749a22 = messages.Stickers;
+messages.stickers#8a8ecd32 hash:string stickers:Vector<Document> = messages.Stickers;
+
+stickerPack#12b299d4 emoticon:string documents:Vector<long> = StickerPack;
+
+messages.allStickersNotModified#e86602c3 = messages.AllStickers;
+messages.allStickers#dcef3102 hash:string packs:Vector<StickerPack> documents:Vector<Document> = messages.AllStickers;
+
+disabledFeature#ae636f24 feature:string description:string = DisabledFeature;
+
+updateReadHistoryInbox#9961fd5c peer:Peer max_id:int pts:int pts_count:int = Update;
+updateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update;
+
+messages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages;
+
+contactLinkUnknown#5f4f9247 = ContactLink;
+contactLinkNone#feedd3ad = ContactLink;
+contactLinkHasPhone#268f3f59 = ContactLink;
+contactLinkContact#d502c2d0 = ContactLink;
+
+updateWebPage#2cc36971 webpage:WebPage = Update;
+
+webPageEmpty#eb1477e8 id:long = WebPage;
+webPagePending#c586da1c id:long date:int = WebPage;
+webPage#a31ea0b5 flags:# id:long url:string display_url:string type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string = WebPage;
+
+messageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia;
+
+authorization#7bf2e6f6 hash:long flags:int device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization;
+
+account.authorizations#1250abde authorizations:Vector<Authorization> = account.Authorizations;
+
+account.noPassword#96dabc18 new_salt:bytes email_unconfirmed_pattern:string = account.Password;
+account.password#7c18141c current_salt:bytes new_salt:bytes hint:string has_recovery:Bool email_unconfirmed_pattern:string = account.Password;
+
+account.passwordSettings#b7b72ab3 email:string = account.PasswordSettings;
+
+account.passwordInputSettings#bcfc532c flags:# new_salt:flags.0?bytes new_password_hash:flags.0?bytes hint:flags.0?string email:flags.1?string = account.PasswordInputSettings;
+
+auth.passwordRecovery#137948a5 email_pattern:string = auth.PasswordRecovery;
+
+inputMediaVenue#2827a81a geo_point:InputGeoPoint title:string address:string provider:string venue_id:string = InputMedia;
+
+messageMediaVenue#7912b71f geo:GeoPoint title:string address:string provider:string venue_id:string = MessageMedia;
+
+---functions---
+
+invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
+
+invokeAfterMsgs#3dc4b4f0 {X:Type} msg_ids:Vector<long> query:!X = X;
+
+auth.checkPhone#6fe51dfb phone_number:string = auth.CheckedPhone;
+auth.sendCode#768d5f4d phone_number:string sms_type:int api_id:int api_hash:string lang_code:string = auth.SentCode;
+auth.sendCall#3c51564 phone_number:string phone_code_hash:string = Bool;
+auth.signUp#1b067634 phone_number:string phone_code_hash:string phone_code:string first_name:string last_name:string = auth.Authorization;
+auth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:string = auth.Authorization;
+auth.logOut#5717da40 = Bool;
+auth.resetAuthorizations#9fab0d1a = Bool;
+auth.sendInvites#771c1d97 phone_numbers:Vector<string> message:string = Bool;
+auth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization;
+auth.importAuthorization#e3ef9613 id:int bytes:bytes = auth.Authorization;
+auth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool;
+
+account.registerDevice#446c712c token_type:int token:string device_model:string system_version:string app_version:string app_sandbox:Bool lang_code:string = Bool;
+account.unregisterDevice#65c55b40 token_type:int token:string = Bool;
+account.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool;
+account.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings;
+account.resetNotifySettings#db7e1747 = Bool;
+account.updateProfile#f0888d68 first_name:string last_name:string = User;
+account.updateStatus#6628562c offline:Bool = Bool;
+account.getWallPapers#c04cfac2 = Vector<WallPaper>;
+
+users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
+users.getFullUser#ca30a5b1 id:InputUser = UserFull;
+
+contacts.getStatuses#c4a353ee = Vector<ContactStatus>;
+contacts.getContacts#22c6aa08 hash:string = contacts.Contacts;
+contacts.importContacts#da30b32d contacts:Vector<InputContact> replace:Bool = contacts.ImportedContacts;
+contacts.getSuggested#cd773428 limit:int = contacts.Suggested;
+contacts.deleteContact#8e953744 id:InputUser = contacts.Link;
+contacts.deleteContacts#59ab389e id:Vector<InputUser> = Bool;
+contacts.block#332b49fc id:InputUser = Bool;
+contacts.unblock#e54100bd id:InputUser = Bool;
+contacts.getBlocked#f57c350f offset:int limit:int = contacts.Blocked;
+contacts.exportCard#84e53737 = Vector<int>;
+contacts.importCard#4fe196fe export_card:Vector<int> = User;
+
+messages.getMessages#4222fa74 id:Vector<int> = messages.Messages;
+messages.getDialogs#eccf1df6 offset:int max_id:int limit:int = messages.Dialogs;
+messages.getHistory#92a1df2f peer:InputPeer offset:int max_id:int limit:int = messages.Messages;
+messages.search#7e9f2ab peer:InputPeer q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = messages.Messages;
+messages.readHistory#b04f2510 peer:InputPeer max_id:int offset:int = messages.AffectedHistory;
+messages.deleteHistory#f4f8fb61 peer:InputPeer offset:int = messages.AffectedHistory;
+messages.deleteMessages#a5f18925 id:Vector<int> = messages.AffectedMessages;
+messages.receivedMessages#28abcb68 max_id:int = Vector<int>;
+messages.setTyping#a3825e50 peer:InputPeer action:SendMessageAction = Bool;
+messages.sendMessage#9add8f26 flags:# peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long = messages.SentMessage;
+messages.sendMedia#2d7923b1 flags:# peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia random_id:long = Updates;
+messages.forwardMessages#55e1728d peer:InputPeer id:Vector<int> random_id:Vector<long> = Updates;
+messages.getChats#3c6aa187 id:Vector<int> = messages.Chats;
+messages.getFullChat#3b831c66 chat_id:int = messages.ChatFull;
+messages.editChatTitle#dc452855 chat_id:int title:string = Updates;
+messages.editChatPhoto#ca4c79d8 chat_id:int photo:InputChatPhoto = Updates;
+messages.addChatUser#f9a0aa09 chat_id:int user_id:InputUser fwd_limit:int = Updates;
+messages.deleteChatUser#e0611f16 chat_id:int user_id:InputUser = Updates;
+messages.createChat#9cb126e users:Vector<InputUser> title:string = Updates;
+
+updates.getState#edd4882a = updates.State;
+updates.getDifference#a041495 pts:int date:int qts:int = updates.Difference;
+
+photos.updateProfilePhoto#eef579a0 id:InputPhoto crop:InputPhotoCrop = UserProfilePhoto;
+photos.uploadProfilePhoto#d50f9c88 file:InputFile caption:string geo_point:InputGeoPoint crop:InputPhotoCrop = photos.Photo;
+photos.deletePhotos#87cf7f2f id:Vector<InputPhoto> = Vector<long>;
+
+upload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool;
+upload.getFile#e3a6cfb5 location:InputFileLocation offset:int limit:int = upload.File;
+
+help.getConfig#c4f9186b = Config;
+help.getNearestDc#1fb33026 = NearestDc;
+help.getAppUpdate#c812ac7e device_model:string system_version:string app_version:string lang_code:string = help.AppUpdate;
+help.saveAppLog#6f02f748 events:Vector<InputAppEvent> = Bool;
+help.getInviteText#a4a95186 lang_code:string = help.InviteText;
+
+photos.getUserPhotos#b7ee553c user_id:InputUser offset:int max_id:int limit:int = photos.Photos;
+
+messages.forwardMessage#33963bf9 peer:InputPeer id:int random_id:long = Updates;
+messages.sendBroadcast#bf73f4da contacts:Vector<InputUser> random_id:Vector<long> message:string media:InputMedia = Updates;
+
+geochats.getLocated#7f192d8f geo_point:InputGeoPoint radius:int limit:int = geochats.Located;
+geochats.getRecents#e1427e6f offset:int limit:int = geochats.Messages;
+geochats.checkin#55b3e8fb peer:InputGeoChat = geochats.StatedMessage;
+geochats.getFullChat#6722dd6f peer:InputGeoChat = messages.ChatFull;
+geochats.editChatTitle#4c8e2273 peer:InputGeoChat title:string address:string = geochats.StatedMessage;
+geochats.editChatPhoto#35d81a95 peer:InputGeoChat photo:InputChatPhoto = geochats.StatedMessage;
+geochats.search#cfcdc44d peer:InputGeoChat q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = geochats.Messages;
+geochats.getHistory#b53f7a68 peer:InputGeoChat offset:int max_id:int limit:int = geochats.Messages;
+geochats.setTyping#8b8a729 peer:InputGeoChat typing:Bool = Bool;
+geochats.sendMessage#61b0044 peer:InputGeoChat message:string random_id:long = geochats.StatedMessage;
+geochats.sendMedia#b8f0deff peer:InputGeoChat media:InputMedia random_id:long = geochats.StatedMessage;
+geochats.createGeoChat#e092e16 title:string geo_point:InputGeoPoint address:string venue:string = geochats.StatedMessage;
+
+messages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig;
+messages.requestEncryption#f64daf43 user_id:InputUser random_id:int g_a:bytes = EncryptedChat;
+messages.acceptEncryption#3dbc0415 peer:InputEncryptedChat g_b:bytes key_fingerprint:long = EncryptedChat;
+messages.discardEncryption#edd923c5 chat_id:int = Bool;
+messages.setEncryptedTyping#791451ed peer:InputEncryptedChat typing:Bool = Bool;
+messages.readEncryptedHistory#7f4b690a peer:InputEncryptedChat max_date:int = Bool;
+messages.sendEncrypted#a9776773 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
+messages.sendEncryptedFile#9a901b66 peer:InputEncryptedChat random_id:long data:bytes file:InputEncryptedFile = messages.SentEncryptedMessage;
+messages.sendEncryptedService#32d439a4 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
+messages.receivedQueue#55a5bb66 max_qts:int = Vector<long>;
+
+upload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool;
+
+initConnection#69796de9 {X:Type} api_id:int device_model:string system_version:string app_version:string lang_code:string query:!X = X;
+
+help.getSupport#9cdf08cd = help.Support;
+
+auth.sendSms#da9f3e8 phone_number:string phone_code_hash:string = Bool;
+
+messages.readMessageContents#36a73f77 id:Vector<int> = messages.AffectedMessages;
+
+account.checkUsername#2714d86c username:string = Bool;
+account.updateUsername#3e0bdd7c username:string = User;
+
+contacts.search#11f812d8 q:string limit:int = contacts.Found;
+
+account.getPrivacy#dadbc950 key:InputPrivacyKey = account.PrivacyRules;
+account.setPrivacy#c9f81ce8 key:InputPrivacyKey rules:Vector<InputPrivacyRule> = account.PrivacyRules;
+account.deleteAccount#418d4e0b reason:string = Bool;
+account.getAccountTTL#8fc711d = AccountDaysTTL;
+account.setAccountTTL#2442485e ttl:AccountDaysTTL = Bool;
+
+invokeWithLayer#da9b0d0d {X:Type} layer:int query:!X = X;
+
+contacts.resolveUsername#bf0131c username:string = User;
+
+account.sendChangePhoneCode#a407a8f4 phone_number:string = account.SentChangePhoneCode;
+account.changePhone#70c32edb phone_number:string phone_code_hash:string phone_code:string = User;
+
+messages.getStickers#ae22e045 emoticon:string hash:string = messages.Stickers;
+messages.getAllStickers#aa3bc868 hash:string = messages.AllStickers;
+
+account.updateDeviceLocked#38df3532 period:int = Bool;
+
+messages.getWebPagePreview#25223e24 message:string = MessageMedia;
+
+account.getAuthorizations#e320c158 = account.Authorizations;
+account.resetAuthorization#df77f3bc hash:long = Bool;
+account.getPassword#548a30f5 = account.Password;
+account.getPasswordSettings#bc8d11bb current_password_hash:bytes = account.PasswordSettings;
+account.updatePasswordSettings#fa7c4b86 current_password_hash:bytes new_settings:account.PasswordInputSettings = Bool;
+
+auth.checkPassword#a63011e password_hash:bytes = auth.Authorization;
+auth.requestPasswordRecovery#d897bc66 = auth.PasswordRecovery;
+auth.recoverPassword#4ea56e92 code:string = auth.Authorization;
diff --git a/protocols/Telegram/tgl/scheme28.tl b/protocols/Telegram/tgl/scheme28.tl
new file mode 100644
index 0000000000..302731ef77
--- /dev/null
+++ b/protocols/Telegram/tgl/scheme28.tl
@@ -0,0 +1,641 @@
+int ?= Int;
+long ?= Long;
+double ?= Double;
+string ?= String;
+
+bytes string = Bytes;
+
+int128 long long = Int128;
+int256 long long long long = Int256;
+
+boolFalse#bc799737 = Bool;
+boolTrue#997275b5 = Bool;
+
+vector#1cb5c415 {t:Type} # [ t ] = Vector t;
+
+error#c4b9f9bb code:int text:string = Error;
+
+null#56730bcc = Null;
+
+inputPeerEmpty#7f3b18ea = InputPeer;
+inputPeerSelf#7da07ec9 = InputPeer;
+inputPeerContact#1023dbe8 user_id:int = InputPeer;
+inputPeerForeign#9b447325 user_id:int access_hash:long = InputPeer;
+inputPeerChat#179be863 chat_id:int = InputPeer;
+
+inputUserEmpty#b98886cf = InputUser;
+inputUserSelf#f7c1b13f = InputUser;
+inputUserContact#86e94f65 user_id:int = InputUser;
+inputUserForeign#655e74ff user_id:int access_hash:long = InputUser;
+
+inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact;
+
+inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;
+
+inputMediaEmpty#9664f57f = InputMedia;
+inputMediaUploadedPhoto#f7aff1c0 file:InputFile caption:string = InputMedia;
+inputMediaPhoto#e9bfb4f3 id:InputPhoto caption:string = InputMedia;
+inputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;
+inputMediaContact#a6e45987 phone_number:string first_name:string last_name:string = InputMedia;
+inputMediaUploadedVideo#e13fd4bc file:InputFile duration:int w:int h:int caption:string = InputMedia;
+inputMediaUploadedThumbVideo#96fb97dc file:InputFile thumb:InputFile duration:int w:int h:int caption:string = InputMedia;
+inputMediaVideo#936a4ebd video_id:InputVideo caption:string = InputMedia;
+
+inputChatPhotoEmpty#1ca48f57 = InputChatPhoto;
+inputChatUploadedPhoto#94254732 file:InputFile crop:InputPhotoCrop = InputChatPhoto;
+inputChatPhoto#b2e1bf08 id:InputPhoto crop:InputPhotoCrop = InputChatPhoto;
+
+inputGeoPointEmpty#e4c123d6 = InputGeoPoint;
+inputGeoPoint#f3b7acc9 latitude:double longitude:double = InputGeoPoint;
+
+inputPhotoEmpty#1cd7bf0d = InputPhoto;
+inputPhoto#fb95c6c4 id:long access_hash:long = InputPhoto;
+
+inputVideoEmpty#5508ec75 = InputVideo;
+inputVideo#ee579652 id:long access_hash:long = InputVideo;
+
+inputFileLocation#14637196 volume_id:long local_id:int secret:long = InputFileLocation;
+inputVideoFileLocation#3d0364ec id:long access_hash:long = InputFileLocation;
+
+inputPhotoCropAuto#ade6b004 = InputPhotoCrop;
+inputPhotoCrop#d9915325 crop_left:double crop_top:double crop_width:double = InputPhotoCrop;
+
+inputAppEvent#770656a8 time:double type:string peer:long data:string = InputAppEvent;
+
+peerUser#9db1bc6d user_id:int = Peer;
+peerChat#bad0e5bb chat_id:int = Peer;
+
+storage.fileUnknown#aa963b05 = storage.FileType;
+storage.fileJpeg#7efe0e = storage.FileType;
+storage.fileGif#cae1aadf = storage.FileType;
+storage.filePng#a4f63c0 = storage.FileType;
+storage.filePdf#ae1e508d = storage.FileType;
+storage.fileMp3#528a0677 = storage.FileType;
+storage.fileMov#4b09ebbc = storage.FileType;
+storage.filePartial#40bc6f52 = storage.FileType;
+storage.fileMp4#b3cea0e4 = storage.FileType;
+storage.fileWebp#1081464c = storage.FileType;
+
+fileLocationUnavailable#7c596b46 volume_id:long local_id:int secret:long = FileLocation;
+fileLocation#53d69076 dc_id:int volume_id:long local_id:int secret:long = FileLocation;
+
+userEmpty#200250ba id:int = User;
+userSelf#1c60e608 id:int first_name:string last_name:string username:string phone:string photo:UserProfilePhoto status:UserStatus = User;
+userContact#cab35e18 id:int first_name:string last_name:string username:string access_hash:long phone:string photo:UserProfilePhoto status:UserStatus = User;
+userRequest#d9ccc4ef id:int first_name:string last_name:string username:string access_hash:long phone:string photo:UserProfilePhoto status:UserStatus = User;
+userForeign#75cf7a8 id:int first_name:string last_name:string username:string access_hash:long photo:UserProfilePhoto status:UserStatus = User;
+userDeleted#d6016d7a id:int first_name:string last_name:string username:string = User;
+
+userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
+userProfilePhoto#d559d8c8 photo_id:long photo_small:FileLocation photo_big:FileLocation = UserProfilePhoto;
+
+userStatusEmpty#9d05049 = UserStatus;
+userStatusOnline#edb93949 expires:int = UserStatus;
+userStatusOffline#8c703f was_online:int = UserStatus;
+
+chatEmpty#9ba2d800 id:int = Chat;
+chat#6e9c9bc7 id:int title:string photo:ChatPhoto participants_count:int date:int left:Bool version:int = Chat;
+chatForbidden#fb0ccc41 id:int title:string date:int = Chat;
+
+chatFullL27#630e61be id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings = ChatFull;
+chatFull#cade0791 id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite = ChatFull;
+
+chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant;
+
+chatParticipantsForbidden#fd2bb8a chat_id:int = ChatParticipants;
+chatParticipants#7841b415 chat_id:int admin_id:int participants:Vector<ChatParticipant> version:int = ChatParticipants;
+
+chatPhotoEmpty#37c1011c = ChatPhoto;
+chatPhoto#6153276a photo_small:FileLocation photo_big:FileLocation = ChatPhoto;
+
+messageEmpty#83e5de54 id:int = Message;
+message#a7ab1991 flags:# id:int from_id:int to_id:Peer fwd_from_id:flags.2?int fwd_date:flags.2?int reply_to_msg_id:flags.3?int date:int message:string media:MessageMedia = Message;
+messageService#1d86f70e flags:int id:int from_id:int to_id:Peer date:int action:MessageAction = Message;
+
+messageMediaEmpty#3ded6320 = MessageMedia;
+messageMediaPhoto#3d8ce53d photo:Photo caption:string = MessageMedia;
+messageMediaVideo#5bcf1675 video:Video caption:string = MessageMedia;
+messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;
+messageMediaContact#5e7d2f39 phone_number:string first_name:string last_name:string user_id:int = MessageMedia;
+messageMediaUnsupported#9f84f49e = MessageMedia;
+
+messageActionEmpty#b6aef7b0 = MessageAction;
+messageActionChatCreate#a6638b9a title:string users:Vector<int> = MessageAction;
+messageActionChatEditTitle#b5a1ce5a title:string = MessageAction;
+messageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction;
+messageActionChatDeletePhoto#95e3fbef = MessageAction;
+messageActionChatAddUser#5e3cfc4b user_id:int = MessageAction;
+messageActionChatDeleteUser#b2ae9b0c user_id:int = MessageAction;
+
+dialog#c1dd804a peer:Peer top_message:int read_inbox_max_id:int unread_count:int notify_settings:PeerNotifySettings = Dialog;
+
+photoEmpty#2331b22d id:long = Photo;
+photo#c3838076 id:long access_hash:long user_id:int date:int geo:GeoPoint sizes:Vector<PhotoSize> = Photo;
+photoL27#22b56751 id:long access_hash:long user_id:int date:int caption:string geo:GeoPoint sizes:Vector<PhotoSize> = Photo;
+
+photoSizeEmpty#e17e23c type:string = PhotoSize;
+photoSize#77bfb61b type:string location:FileLocation w:int h:int size:int = PhotoSize;
+photoCachedSize#e9a734fa type:string location:FileLocation w:int h:int bytes:bytes = PhotoSize;
+
+videoEmpty#c10658a8 id:long = Video;
+video#ee9f4a4d id:long access_hash:long user_id:int date:int duration:int size:int thumb:PhotoSize dc_id:int w:int h:int = Video;
+videoL27#388fa391 id:long access_hash:long user_id:int date:int caption:string duration:int mime_type:string size:int thumb:PhotoSize dc_id:int w:int h:int = Video;
+
+geoPointEmpty#1117dd5f = GeoPoint;
+geoPoint#2049d70c longitude:double latitude:double = GeoPoint;
+
+auth.checkedPhone#811ea28e phone_registered:Bool = auth.CheckedPhone;
+
+auth.sentCode#efed51d9 phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
+
+auth.authorization#f6b673a4 expires:int user:User = auth.Authorization;
+
+auth.exportedAuthorization#df969c2d id:int bytes:bytes = auth.ExportedAuthorization;
+
+inputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer;
+inputNotifyUsers#193b4417 = InputNotifyPeer;
+inputNotifyChats#4a95e84e = InputNotifyPeer;
+inputNotifyAll#a429b886 = InputNotifyPeer;
+
+inputPeerNotifyEventsEmpty#f03064d8 = InputPeerNotifyEvents;
+inputPeerNotifyEventsAll#e86a2c74 = InputPeerNotifyEvents;
+
+inputPeerNotifySettings#46a2ce98 mute_until:int sound:string show_previews:Bool events_mask:int = InputPeerNotifySettings;
+
+peerNotifyEventsEmpty#add53cb3 = PeerNotifyEvents;
+peerNotifyEventsAll#6d1ded88 = PeerNotifyEvents;
+
+peerNotifySettingsEmpty#70a68512 = PeerNotifySettings;
+peerNotifySettings#8d5e11ee mute_until:int sound:string show_previews:Bool events_mask:int = PeerNotifySettings;
+
+wallPaper#ccb03657 id:int title:string sizes:Vector<PhotoSize> color:int = WallPaper;
+
+userFull#771095da user:User link:contacts.Link profile_photo:Photo notify_settings:PeerNotifySettings blocked:Bool real_first_name:string real_last_name:string = UserFull;
+
+contact#f911c994 user_id:int mutual:Bool = Contact;
+
+importedContact#d0028438 user_id:int client_id:long = ImportedContact;
+
+contactBlocked#561bc879 user_id:int date:int = ContactBlocked;
+
+contactSuggested#3de191a1 user_id:int mutual_contacts:int = ContactSuggested;
+
+contactStatus#d3680c61 user_id:int status:UserStatus = ContactStatus;
+
+chatLocated#3631cf4c chat_id:int distance:int = ChatLocated;
+
+contacts.link#3ace484c my_link:ContactLink foreign_link:ContactLink user:User = contacts.Link;
+
+contacts.contactsNotModified#b74ba9d2 = contacts.Contacts;
+contacts.contacts#6f8b8cb2 contacts:Vector<Contact> users:Vector<User> = contacts.Contacts;
+
+contacts.importedContacts#ad524315 imported:Vector<ImportedContact> retry_contacts:Vector<long> users:Vector<User> = contacts.ImportedContacts;
+
+contacts.blocked#1c138d15 blocked:Vector<ContactBlocked> users:Vector<User> = contacts.Blocked;
+contacts.blockedSlice#900802a1 count:int blocked:Vector<ContactBlocked> users:Vector<User> = contacts.Blocked;
+
+contacts.suggested#5649dcc5 results:Vector<ContactSuggested> users:Vector<User> = contacts.Suggested;
+
+messages.dialogs#15ba6c40 dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
+messages.dialogsSlice#71e094f3 count:int dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
+
+messages.messages#8c718e87 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+messages.messagesSlice#b446ae3 count:int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+
+messages.messageEmpty#3f4e0648 = messages.Message;
+
+messages.sentMessage#4c3d47f3 id:int date:int media:MessageMedia pts:int pts_count:int = messages.SentMessage;
+
+messages.chats#64ff9fd5 chats:Vector<Chat> = messages.Chats;
+
+messages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector<Chat> users:Vector<User> = messages.ChatFull;
+
+messages.affectedHistory#b45c69d1 pts:int pts_count:int offset:int = messages.AffectedHistory;
+
+inputMessagesFilterEmpty#57e2f66c = MessagesFilter;
+inputMessagesFilterPhotos#9609a51c = MessagesFilter;
+inputMessagesFilterVideo#9fc00e65 = MessagesFilter;
+inputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter;
+inputMessagesFilterPhotoVideoDocuments#d95e73bb = MessagesFilter;
+inputMessagesFilterDocument#9eddf188 = MessagesFilter;
+inputMessagesFilterAudio#cfc87522 = MessagesFilter;
+
+updateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update;
+updateMessageID#4e90bfd6 id:int random_id:long = Update;
+updateDeleteMessages#a20db0e5 messages:Vector<int> pts:int pts_count:int = Update;
+updateUserTyping#5c486927 user_id:int action:SendMessageAction = Update;
+updateChatUserTyping#9a65ea1f chat_id:int user_id:int action:SendMessageAction = Update;
+updateChatParticipants#7761198 participants:ChatParticipants = Update;
+updateUserStatus#1bfbd823 user_id:int status:UserStatus = Update;
+updateUserName#a7332b73 user_id:int first_name:string last_name:string username:string = Update;
+updateUserPhoto#95313b0c user_id:int date:int photo:UserProfilePhoto previous:Bool = Update;
+updateContactRegistered#2575bbb9 user_id:int date:int = Update;
+updateContactLink#9d2e67c5 user_id:int my_link:ContactLink foreign_link:ContactLink = Update;
+updateNewAuthorization#8f06529a auth_key_id:long date:int device:string location:string = Update;
+
+updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
+
+updates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference;
+updates.difference#f49ca0 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> state:updates.State = updates.Difference;
+updates.differenceSlice#a8fb1981 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> intermediate_state:updates.State = updates.Difference;
+
+updatesTooLong#e317af7e = Updates;
+updateShortMessage#ed5c2127 flags:# id:int user_id:int message:string pts:int pts_count:int date:int fwd_from_id:flags.2?int fwd_date:flags.2?int reply_to_msg_id:flags.3?int = Updates;
+updateShortChatMessage#52238b3c flags:# id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from_id:flags.2?int fwd_date:flags.2?int reply_to_msg_id:flags.3?int = Updates;
+updateShort#78d4dec1 update:Update date:int = Updates;
+updatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;
+updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
+
+photos.photos#8dca6aa5 photos:Vector<Photo> users:Vector<User> = photos.Photos;
+photos.photosSlice#15051f54 count:int photos:Vector<Photo> users:Vector<User> = photos.Photos;
+
+photos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;
+
+upload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;
+
+dcOption#2ec2a43c id:int hostname:string ip_address:string port:int = DcOption;
+
+config#4e32b894 date:int expires:int test_mode:Bool this_dc:int dc_options:Vector<DcOption> chat_size_max:int broadcast_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int chat_big_size:int push_chat_period_ms:int push_chat_limit:int disabled_features:Vector<DisabledFeature> = Config;
+
+nearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;
+
+help.appUpdate#8987f311 id:int critical:Bool url:string text:string = help.AppUpdate;
+help.noAppUpdate#c45a6536 = help.AppUpdate;
+
+help.inviteText#18cb9f78 message:string = help.InviteText;
+
+messages.sentMessageLink#35a1a663 id:int date:int media:MessageMedia pts:int pts_count:int links:Vector<contacts.Link> seq:int = messages.SentMessage;
+
+inputGeoChat#74d456fa chat_id:int access_hash:long = InputGeoChat;
+
+inputNotifyGeoChatPeer#4d8ddec8 geo_peer:InputGeoChat = InputNotifyPeer;
+
+geoChat#75eaea5a id:int access_hash:long title:string address:string venue:string geo:GeoPoint photo:ChatPhoto participants_count:int date:int checked_in:Bool version:int = Chat;
+
+geoChatMessageEmpty#60311a9b chat_id:int id:int = GeoChatMessage;
+geoChatMessage#4505f8e1 chat_id:int id:int from_id:int date:int message:string media:MessageMedia = GeoChatMessage;
+geoChatMessageService#d34fa24e chat_id:int id:int from_id:int date:int action:MessageAction = GeoChatMessage;
+
+geochats.statedMessage#17b1578b message:GeoChatMessage chats:Vector<Chat> users:Vector<User> seq:int = geochats.StatedMessage;
+
+geochats.located#48feb267 results:Vector<ChatLocated> messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Located;
+
+geochats.messages#d1526db1 messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Messages;
+geochats.messagesSlice#bc5863e8 count:int messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Messages;
+
+messageActionGeoChatCreate#6f038ebc title:string address:string = MessageAction;
+messageActionGeoChatCheckin#c7d53de = MessageAction;
+
+updateNewGeoChatMessage#5a68e3f7 geo_message:GeoChatMessage = Update;
+
+wallPaperSolid#63117f24 id:int title:string bg_color:int color:int = WallPaper;
+
+updateNewEncryptedMessage#12bcbd9a encr_message:EncryptedMessage qts:int = Update;
+updateEncryptedChatTyping#1710f156 chat_id:int = Update;
+updateEncryption#b4a2e88d encr_chat:EncryptedChat date:int = Update;
+updateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update;
+
+encryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat;
+encryptedChatWaiting#3bf703dc id:int access_hash:long date:int admin_id:int participant_id:int = EncryptedChat;
+encryptedChatRequested#c878527e id:int access_hash:long date:int admin_id:int participant_id:int g_a:bytes = EncryptedChat;
+encryptedChat#fa56ce36 id:int access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long = EncryptedChat;
+encryptedChatDiscarded#13d6dd27 id:int = EncryptedChat;
+
+inputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat;
+
+encryptedFileEmpty#c21f497e = EncryptedFile;
+encryptedFile#4a70994c id:long access_hash:long size:int dc_id:int key_fingerprint:int = EncryptedFile;
+
+inputEncryptedFileEmpty#1837c364 = InputEncryptedFile;
+inputEncryptedFileUploaded#64bd0306 id:long parts:int md5_checksum:string key_fingerprint:int = InputEncryptedFile;
+inputEncryptedFile#5a17b5e5 id:long access_hash:long = InputEncryptedFile;
+
+inputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation;
+
+encryptedMessage#ed18c118 random_id:long chat_id:int date:int bytes:bytes file:EncryptedFile = EncryptedMessage;
+encryptedMessageService#23734b06 random_id:long chat_id:int date:int bytes:bytes = EncryptedMessage;
+
+messages.dhConfigNotModified#c0e24635 random:bytes = messages.DhConfig;
+messages.dhConfig#2c221edd g:int p:bytes version:int random:bytes = messages.DhConfig;
+
+messages.sentEncryptedMessage#560f8935 date:int = messages.SentEncryptedMessage;
+messages.sentEncryptedFile#9493ff32 date:int file:EncryptedFile = messages.SentEncryptedMessage;
+
+inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;
+
+inputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile;
+
+updateChatParticipantAdd#3a0eeb22 chat_id:int user_id:int inviter_id:int version:int = Update;
+updateChatParticipantDelete#6e5f8c22 chat_id:int user_id:int version:int = Update;
+updateDcOptions#8e5e9873 dc_options:Vector<DcOption> = Update;
+
+inputMediaUploadedAudio#4e498cab file:InputFile duration:int mime_type:string = InputMedia;
+inputMediaAudio#89938781 audio_id:InputAudio = InputMedia;
+inputMediaUploadedDocument#ffe76b78 file:InputFile mime_type:string attributes:Vector<DocumentAttribute> = InputMedia;
+inputMediaUploadedThumbDocument#41481486 file:InputFile thumb:InputFile mime_type:string attributes:Vector<DocumentAttribute> = InputMedia;
+inputMediaDocument#d184e841 document_id:InputDocument = InputMedia;
+
+messageMediaDocument#2fda2204 document:Document = MessageMedia;
+messageMediaAudio#c6b68300 audio:Audio = MessageMedia;
+
+inputAudioEmpty#d95adc84 = InputAudio;
+inputAudio#77d440ff id:long access_hash:long = InputAudio;
+
+inputDocumentEmpty#72f0eaae = InputDocument;
+inputDocument#18798952 id:long access_hash:long = InputDocument;
+
+inputAudioFileLocation#74dc404d id:long access_hash:long = InputFileLocation;
+inputDocumentFileLocation#4e45abe9 id:long access_hash:long = InputFileLocation;
+
+audioEmpty#586988d8 id:long = Audio;
+audio#c7ac6496 id:long access_hash:long user_id:int date:int duration:int mime_type:string size:int dc_id:int = Audio;
+
+documentEmpty#36f8c871 id:long = Document;
+document#f9a39f4f id:long access_hash:long date:int mime_type:string size:int thumb:PhotoSize dc_id:int attributes:Vector<DocumentAttribute> = Document;
+document_l19#9efc6326 id:long access_hash:long user_id:int date:int file_name:string mime_type:string size:int thumb:PhotoSize dc_id:int = Document;
+
+help.support#17c6b5f6 phone_number:string user:User = help.Support;
+
+notifyPeer#9fd40bd8 peer:Peer = NotifyPeer;
+notifyUsers#b4c83b4c = NotifyPeer;
+notifyChats#c007cec3 = NotifyPeer;
+notifyAll#74d07c60 = NotifyPeer;
+
+updateUserBlocked#80ece81a user_id:int blocked:Bool = Update;
+updateNotifySettings#bec268ef notify_peer:NotifyPeer notify_settings:PeerNotifySettings = Update;
+
+auth.sentAppCode#e325edcf phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
+
+sendMessageTypingAction#16bf744e = SendMessageAction;
+sendMessageCancelAction#fd5ec8f5 = SendMessageAction;
+sendMessageRecordVideoAction#a187d66f = SendMessageAction;
+sendMessageUploadVideoActionL27#92042ff7 = SendMessageAction;
+sendMessageUploadVideoAction#e9763aec progress:int = SendMessageAction;
+sendMessageRecordAudioAction#d52f73f7 = SendMessageAction;
+sendMessageUploadAudioActionL27#e6ac8a6f = SendMessageAction;
+sendMessageUploadAudioAction#f351d7ab progress:int = SendMessageAction;
+sendMessageUploadPhotoAction#d1d34a26 progress:int = SendMessageAction;
+sendMessageUploadDocumentActionL27#8faee98e = SendMessageAction;
+sendMessageUploadDocumentAction#aa0cd9e4 progress:int = SendMessageAction;
+sendMessageGeoLocationAction#176f8ba1 = SendMessageAction;
+sendMessageChooseContactAction#628cbc6f = SendMessageAction;
+
+contactFound#ea879f95 user_id:int = ContactFound;
+
+contacts.found#566000e results:Vector<ContactFound> users:Vector<User> = contacts.Found;
+
+updateServiceNotification#382dd3e4 type:string message_text:string media:MessageMedia popup:Bool = Update;
+
+userStatusRecently#e26f42f1 = UserStatus;
+userStatusLastWeek#7bf09fc = UserStatus;
+userStatusLastMonth#77ebc742 = UserStatus;
+
+updatePrivacy#ee3b272a key:PrivacyKey rules:Vector<PrivacyRule> = Update;
+
+inputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey;
+
+privacyKeyStatusTimestamp#bc2eab30 = PrivacyKey;
+
+inputPrivacyValueAllowContacts#d09e07b = InputPrivacyRule;
+inputPrivacyValueAllowAll#184b35ce = InputPrivacyRule;
+inputPrivacyValueAllowUsers#131cc67f users:Vector<InputUser> = InputPrivacyRule;
+inputPrivacyValueDisallowContacts#ba52007 = InputPrivacyRule;
+inputPrivacyValueDisallowAll#d66b66c9 = InputPrivacyRule;
+inputPrivacyValueDisallowUsers#90110467 users:Vector<InputUser> = InputPrivacyRule;
+
+privacyValueAllowContacts#fffe1bac = PrivacyRule;
+privacyValueAllowAll#65427b82 = PrivacyRule;
+privacyValueAllowUsers#4d5bbe0c users:Vector<int> = PrivacyRule;
+privacyValueDisallowContacts#f888fa1a = PrivacyRule;
+privacyValueDisallowAll#8b73e763 = PrivacyRule;
+privacyValueDisallowUsers#c7f49b7 users:Vector<int> = PrivacyRule;
+
+account.privacyRules#554abb6f rules:Vector<PrivacyRule> users:Vector<User> = account.PrivacyRules;
+
+accountDaysTTL#b8d0afdf days:int = AccountDaysTTL;
+
+account.sentChangePhoneCode#a4f58c4c phone_code_hash:string send_call_timeout:int = account.SentChangePhoneCode;
+
+updateUserPhone#12b9417b user_id:int phone:string = Update;
+
+documentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute;
+documentAttributeAnimated#11b58939 = DocumentAttribute;
+documentAttributeSticker#994c9882 alt:string = DocumentAttribute;
+documentAttributeVideo#5910cccb duration:int w:int h:int = DocumentAttribute;
+documentAttributeAudio#51448e5 duration:int = DocumentAttribute;
+documentAttributeFilename#15590068 file_name:string = DocumentAttribute;
+
+messages.stickersNotModified#f1749a22 = messages.Stickers;
+messages.stickers#8a8ecd32 hash:string stickers:Vector<Document> = messages.Stickers;
+
+stickerPack#12b299d4 emoticon:string documents:Vector<long> = StickerPack;
+
+messages.allStickersNotModified#e86602c3 = messages.AllStickers;
+messages.allStickers#dcef3102 hash:string packs:Vector<StickerPack> documents:Vector<Document> = messages.AllStickers;
+
+disabledFeature#ae636f24 feature:string description:string = DisabledFeature;
+
+updateReadHistoryInbox#9961fd5c peer:Peer max_id:int pts:int pts_count:int = Update;
+updateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update;
+
+messages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages;
+
+contactLinkUnknown#5f4f9247 = ContactLink;
+contactLinkNone#feedd3ad = ContactLink;
+contactLinkHasPhone#268f3f59 = ContactLink;
+contactLinkContact#d502c2d0 = ContactLink;
+
+updateWebPage#2cc36971 webpage:WebPage = Update;
+
+webPageEmpty#eb1477e8 id:long = WebPage;
+webPagePending#c586da1c id:long date:int = WebPage;
+webPage#a31ea0b5 flags:# id:long url:string display_url:string type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string = WebPage;
+
+messageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia;
+
+authorization#7bf2e6f6 hash:long flags:int device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization;
+
+account.authorizations#1250abde authorizations:Vector<Authorization> = account.Authorizations;
+
+account.noPassword#96dabc18 new_salt:bytes email_unconfirmed_pattern:string = account.Password;
+account.password#7c18141c current_salt:bytes new_salt:bytes hint:string has_recovery:Bool email_unconfirmed_pattern:string = account.Password;
+
+account.passwordSettings#b7b72ab3 email:string = account.PasswordSettings;
+
+account.passwordInputSettings#bcfc532c flags:# new_salt:flags.0?bytes new_password_hash:flags.0?bytes hint:flags.0?string email:flags.1?string = account.PasswordInputSettings;
+
+auth.passwordRecovery#137948a5 email_pattern:string = auth.PasswordRecovery;
+
+inputMediaVenue#2827a81a geo_point:InputGeoPoint title:string address:string provider:string venue_id:string = InputMedia;
+
+messageMediaVenue#7912b71f geo:GeoPoint title:string address:string provider:string venue_id:string = MessageMedia;
+
+receivedNotifyMessage#a384b779 id:int flags:int = ReceivedNotifyMessage;
+
+chatInviteEmpty#69df3769 = ExportedChatInvite;
+chatInviteExported#fc2e05bc link:string = ExportedChatInvite;
+
+chatInviteAlready#5a686d7c chat:Chat = ChatInvite;
+chatInvite#ce917dcd title:string = ChatInvite;
+
+messageActionChatJoinedByLink#f89cf5e8 inviter_id:int = MessageAction;
+
+updateReadMessagesContents#68c13933 messages:Vector<int> pts:int pts_count:int = Update;
+
+---functions---
+
+invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
+
+invokeAfterMsgs#3dc4b4f0 {X:Type} msg_ids:Vector<long> query:!X = X;
+
+auth.checkPhone#6fe51dfb phone_number:string = auth.CheckedPhone;
+auth.sendCode#768d5f4d phone_number:string sms_type:int api_id:int api_hash:string lang_code:string = auth.SentCode;
+auth.sendCall#3c51564 phone_number:string phone_code_hash:string = Bool;
+auth.signUp#1b067634 phone_number:string phone_code_hash:string phone_code:string first_name:string last_name:string = auth.Authorization;
+auth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:string = auth.Authorization;
+auth.logOut#5717da40 = Bool;
+auth.resetAuthorizations#9fab0d1a = Bool;
+auth.sendInvites#771c1d97 phone_numbers:Vector<string> message:string = Bool;
+auth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization;
+auth.importAuthorization#e3ef9613 id:int bytes:bytes = auth.Authorization;
+auth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool;
+
+account.registerDevice#446c712c token_type:int token:string device_model:string system_version:string app_version:string app_sandbox:Bool lang_code:string = Bool;
+account.unregisterDevice#65c55b40 token_type:int token:string = Bool;
+account.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool;
+account.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings;
+account.resetNotifySettings#db7e1747 = Bool;
+account.updateProfile#f0888d68 first_name:string last_name:string = User;
+account.updateStatus#6628562c offline:Bool = Bool;
+account.getWallPapers#c04cfac2 = Vector<WallPaper>;
+
+users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
+users.getFullUser#ca30a5b1 id:InputUser = UserFull;
+
+contacts.getStatuses#c4a353ee = Vector<ContactStatus>;
+contacts.getContacts#22c6aa08 hash:string = contacts.Contacts;
+contacts.importContacts#da30b32d contacts:Vector<InputContact> replace:Bool = contacts.ImportedContacts;
+contacts.getSuggested#cd773428 limit:int = contacts.Suggested;
+contacts.deleteContact#8e953744 id:InputUser = contacts.Link;
+contacts.deleteContacts#59ab389e id:Vector<InputUser> = Bool;
+contacts.block#332b49fc id:InputUser = Bool;
+contacts.unblock#e54100bd id:InputUser = Bool;
+contacts.getBlocked#f57c350f offset:int limit:int = contacts.Blocked;
+contacts.exportCard#84e53737 = Vector<int>;
+contacts.importCard#4fe196fe export_card:Vector<int> = User;
+
+messages.getMessages#4222fa74 id:Vector<int> = messages.Messages;
+messages.getDialogs#eccf1df6 offset:int max_id:int limit:int = messages.Dialogs;
+messages.getHistory#92a1df2f peer:InputPeer offset:int max_id:int limit:int = messages.Messages;
+messages.search#7e9f2ab peer:InputPeer q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = messages.Messages;
+messages.readHistory#b04f2510 peer:InputPeer max_id:int offset:int = messages.AffectedHistory;
+messages.deleteHistory#f4f8fb61 peer:InputPeer offset:int = messages.AffectedHistory;
+messages.deleteMessages#a5f18925 id:Vector<int> = messages.AffectedMessages;
+messages.receivedMessages#5a954c0 max_id:int = Vector<ReceivedNotifyMessage>;
+messages.setTyping#a3825e50 peer:InputPeer action:SendMessageAction = Bool;
+messages.sendMessage#9add8f26 flags:# peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long = messages.SentMessage;
+messages.sendMedia#2d7923b1 flags:# peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia random_id:long = Updates;
+messages.forwardMessages#55e1728d peer:InputPeer id:Vector<int> random_id:Vector<long> = Updates;
+messages.getChats#3c6aa187 id:Vector<int> = messages.Chats;
+messages.getFullChat#3b831c66 chat_id:int = messages.ChatFull;
+messages.editChatTitle#dc452855 chat_id:int title:string = Updates;
+messages.editChatPhoto#ca4c79d8 chat_id:int photo:InputChatPhoto = Updates;
+messages.addChatUser#f9a0aa09 chat_id:int user_id:InputUser fwd_limit:int = Updates;
+messages.deleteChatUser#e0611f16 chat_id:int user_id:InputUser = Updates;
+messages.createChat#9cb126e users:Vector<InputUser> title:string = Updates;
+
+updates.getState#edd4882a = updates.State;
+updates.getDifference#a041495 pts:int date:int qts:int = updates.Difference;
+
+photos.updateProfilePhoto#eef579a0 id:InputPhoto crop:InputPhotoCrop = UserProfilePhoto;
+photos.uploadProfilePhoto#d50f9c88 file:InputFile caption:string geo_point:InputGeoPoint crop:InputPhotoCrop = photos.Photo;
+photos.deletePhotos#87cf7f2f id:Vector<InputPhoto> = Vector<long>;
+
+upload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool;
+upload.getFile#e3a6cfb5 location:InputFileLocation offset:int limit:int = upload.File;
+
+help.getConfig#c4f9186b = Config;
+help.getNearestDc#1fb33026 = NearestDc;
+help.getAppUpdate#c812ac7e device_model:string system_version:string app_version:string lang_code:string = help.AppUpdate;
+help.saveAppLog#6f02f748 events:Vector<InputAppEvent> = Bool;
+help.getInviteText#a4a95186 lang_code:string = help.InviteText;
+
+photos.getUserPhotos#b7ee553c user_id:InputUser offset:int max_id:int limit:int = photos.Photos;
+
+messages.forwardMessage#33963bf9 peer:InputPeer id:int random_id:long = Updates;
+messages.sendBroadcast#bf73f4da contacts:Vector<InputUser> random_id:Vector<long> message:string media:InputMedia = Updates;
+
+geochats.getLocated#7f192d8f geo_point:InputGeoPoint radius:int limit:int = geochats.Located;
+geochats.getRecents#e1427e6f offset:int limit:int = geochats.Messages;
+geochats.checkin#55b3e8fb peer:InputGeoChat = geochats.StatedMessage;
+geochats.getFullChat#6722dd6f peer:InputGeoChat = messages.ChatFull;
+geochats.editChatTitle#4c8e2273 peer:InputGeoChat title:string address:string = geochats.StatedMessage;
+geochats.editChatPhoto#35d81a95 peer:InputGeoChat photo:InputChatPhoto = geochats.StatedMessage;
+geochats.search#cfcdc44d peer:InputGeoChat q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = geochats.Messages;
+geochats.getHistory#b53f7a68 peer:InputGeoChat offset:int max_id:int limit:int = geochats.Messages;
+geochats.setTyping#8b8a729 peer:InputGeoChat typing:Bool = Bool;
+geochats.sendMessage#61b0044 peer:InputGeoChat message:string random_id:long = geochats.StatedMessage;
+geochats.sendMedia#b8f0deff peer:InputGeoChat media:InputMedia random_id:long = geochats.StatedMessage;
+geochats.createGeoChat#e092e16 title:string geo_point:InputGeoPoint address:string venue:string = geochats.StatedMessage;
+
+messages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig;
+messages.requestEncryption#f64daf43 user_id:InputUser random_id:int g_a:bytes = EncryptedChat;
+messages.acceptEncryption#3dbc0415 peer:InputEncryptedChat g_b:bytes key_fingerprint:long = EncryptedChat;
+messages.discardEncryption#edd923c5 chat_id:int = Bool;
+messages.setEncryptedTyping#791451ed peer:InputEncryptedChat typing:Bool = Bool;
+messages.readEncryptedHistory#7f4b690a peer:InputEncryptedChat max_date:int = Bool;
+messages.sendEncrypted#a9776773 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
+messages.sendEncryptedFile#9a901b66 peer:InputEncryptedChat random_id:long data:bytes file:InputEncryptedFile = messages.SentEncryptedMessage;
+messages.sendEncryptedService#32d439a4 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
+messages.receivedQueue#55a5bb66 max_qts:int = Vector<long>;
+
+upload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool;
+
+initConnection#69796de9 {X:Type} api_id:int device_model:string system_version:string app_version:string lang_code:string query:!X = X;
+
+help.getSupport#9cdf08cd = help.Support;
+
+auth.sendSms#da9f3e8 phone_number:string phone_code_hash:string = Bool;
+
+messages.readMessageContents#36a73f77 id:Vector<int> = messages.AffectedMessages;
+
+account.checkUsername#2714d86c username:string = Bool;
+account.updateUsername#3e0bdd7c username:string = User;
+
+contacts.search#11f812d8 q:string limit:int = contacts.Found;
+
+account.getPrivacy#dadbc950 key:InputPrivacyKey = account.PrivacyRules;
+account.setPrivacy#c9f81ce8 key:InputPrivacyKey rules:Vector<InputPrivacyRule> = account.PrivacyRules;
+account.deleteAccount#418d4e0b reason:string = Bool;
+account.getAccountTTL#8fc711d = AccountDaysTTL;
+account.setAccountTTL#2442485e ttl:AccountDaysTTL = Bool;
+
+invokeWithLayer#da9b0d0d {X:Type} layer:int query:!X = X;
+
+contacts.resolveUsername#bf0131c username:string = User;
+
+account.sendChangePhoneCode#a407a8f4 phone_number:string = account.SentChangePhoneCode;
+account.changePhone#70c32edb phone_number:string phone_code_hash:string phone_code:string = User;
+
+messages.getStickers#ae22e045 emoticon:string hash:string = messages.Stickers;
+messages.getAllStickers#aa3bc868 hash:string = messages.AllStickers;
+
+account.updateDeviceLocked#38df3532 period:int = Bool;
+
+messages.getWebPagePreview#25223e24 message:string = MessageMedia;
+
+account.getAuthorizations#e320c158 = account.Authorizations;
+account.resetAuthorization#df77f3bc hash:long = Bool;
+account.getPassword#548a30f5 = account.Password;
+account.getPasswordSettings#bc8d11bb current_password_hash:bytes = account.PasswordSettings;
+account.updatePasswordSettings#fa7c4b86 current_password_hash:bytes new_settings:account.PasswordInputSettings = Bool;
+
+auth.checkPassword#a63011e password_hash:bytes = auth.Authorization;
+auth.requestPasswordRecovery#d897bc66 = auth.PasswordRecovery;
+auth.recoverPassword#4ea56e92 code:string = auth.Authorization;
+
+invokeWithoutUpdates#bf9459b7 {X:Type} query:!X = X;
+
+messages.exportChatInvite#7d885289 chat_id:int = ExportedChatInvite;
+messages.checkChatInvite#3eadb1bb hash:string = ChatInvite;
+messages.importChatInvite#6c50051c hash:string = Updates;
diff --git a/protocols/Telegram/tgl/scheme30.tl b/protocols/Telegram/tgl/scheme30.tl
new file mode 100644
index 0000000000..d6c9b7cf87
--- /dev/null
+++ b/protocols/Telegram/tgl/scheme30.tl
@@ -0,0 +1,656 @@
+int ?= Int;
+long ?= Long;
+double ?= Double;
+string ?= String;
+
+bytes string = Bytes;
+
+int128 long long = Int128;
+int256 long long long long = Int256;
+
+boolFalse#bc799737 = Bool;
+boolTrue#997275b5 = Bool;
+
+vector#1cb5c415 {t:Type} # [ t ] = Vector t;
+
+error#c4b9f9bb code:int text:string = Error;
+
+null#56730bcc = Null;
+
+inputPeerEmpty#7f3b18ea = InputPeer;
+inputPeerSelf#7da07ec9 = InputPeer;
+inputPeerContact#1023dbe8 user_id:int = InputPeer;
+inputPeerForeign#9b447325 user_id:int access_hash:long = InputPeer;
+inputPeerChat#179be863 chat_id:int = InputPeer;
+
+inputUserEmpty#b98886cf = InputUser;
+inputUserSelf#f7c1b13f = InputUser;
+inputUserContact#86e94f65 user_id:int = InputUser;
+inputUserForeign#655e74ff user_id:int access_hash:long = InputUser;
+
+inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact;
+
+inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;
+
+inputMediaEmpty#9664f57f = InputMedia;
+inputMediaUploadedPhoto#f7aff1c0 file:InputFile caption:string = InputMedia;
+inputMediaPhoto#e9bfb4f3 id:InputPhoto caption:string = InputMedia;
+inputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;
+inputMediaContact#a6e45987 phone_number:string first_name:string last_name:string = InputMedia;
+inputMediaUploadedVideo#e13fd4bc file:InputFile duration:int w:int h:int caption:string = InputMedia;
+inputMediaUploadedThumbVideo#96fb97dc file:InputFile thumb:InputFile duration:int w:int h:int caption:string = InputMedia;
+inputMediaVideo#936a4ebd video_id:InputVideo caption:string = InputMedia;
+
+inputChatPhotoEmpty#1ca48f57 = InputChatPhoto;
+inputChatUploadedPhoto#94254732 file:InputFile crop:InputPhotoCrop = InputChatPhoto;
+inputChatPhoto#b2e1bf08 id:InputPhoto crop:InputPhotoCrop = InputChatPhoto;
+
+inputGeoPointEmpty#e4c123d6 = InputGeoPoint;
+inputGeoPoint#f3b7acc9 latitude:double longitude:double = InputGeoPoint;
+
+inputPhotoEmpty#1cd7bf0d = InputPhoto;
+inputPhoto#fb95c6c4 id:long access_hash:long = InputPhoto;
+
+inputVideoEmpty#5508ec75 = InputVideo;
+inputVideo#ee579652 id:long access_hash:long = InputVideo;
+
+inputFileLocation#14637196 volume_id:long local_id:int secret:long = InputFileLocation;
+inputVideoFileLocation#3d0364ec id:long access_hash:long = InputFileLocation;
+
+inputPhotoCropAuto#ade6b004 = InputPhotoCrop;
+inputPhotoCrop#d9915325 crop_left:double crop_top:double crop_width:double = InputPhotoCrop;
+
+inputAppEvent#770656a8 time:double type:string peer:long data:string = InputAppEvent;
+
+peerUser#9db1bc6d user_id:int = Peer;
+peerChat#bad0e5bb chat_id:int = Peer;
+
+storage.fileUnknown#aa963b05 = storage.FileType;
+storage.fileJpeg#7efe0e = storage.FileType;
+storage.fileGif#cae1aadf = storage.FileType;
+storage.filePng#a4f63c0 = storage.FileType;
+storage.filePdf#ae1e508d = storage.FileType;
+storage.fileMp3#528a0677 = storage.FileType;
+storage.fileMov#4b09ebbc = storage.FileType;
+storage.filePartial#40bc6f52 = storage.FileType;
+storage.fileMp4#b3cea0e4 = storage.FileType;
+storage.fileWebp#1081464c = storage.FileType;
+
+fileLocationUnavailable#7c596b46 volume_id:long local_id:int secret:long = FileLocation;
+fileLocation#53d69076 dc_id:int volume_id:long local_id:int secret:long = FileLocation;
+
+userEmpty#200250ba id:int = User;
+userSelf#1c60e608 id:int first_name:string last_name:string username:string phone:string photo:UserProfilePhoto status:UserStatus = User;
+userContact#cab35e18 id:int first_name:string last_name:string username:string access_hash:long phone:string photo:UserProfilePhoto status:UserStatus = User;
+userRequest#d9ccc4ef id:int first_name:string last_name:string username:string access_hash:long phone:string photo:UserProfilePhoto status:UserStatus = User;
+userForeign#75cf7a8 id:int first_name:string last_name:string username:string access_hash:long photo:UserProfilePhoto status:UserStatus = User;
+userDeleted#d6016d7a id:int first_name:string last_name:string username:string = User;
+
+userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
+userProfilePhoto#d559d8c8 photo_id:long photo_small:FileLocation photo_big:FileLocation = UserProfilePhoto;
+
+userStatusEmpty#9d05049 = UserStatus;
+userStatusOnline#edb93949 expires:int = UserStatus;
+userStatusOffline#8c703f was_online:int = UserStatus;
+
+chatEmpty#9ba2d800 id:int = Chat;
+chat#6e9c9bc7 id:int title:string photo:ChatPhoto participants_count:int date:int left:Bool version:int = Chat;
+chatForbidden#fb0ccc41 id:int title:string date:int = Chat;
+
+chatFullL27#630e61be id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings = ChatFull;
+chatFull#cade0791 id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite = ChatFull;
+
+chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant;
+
+chatParticipantsForbidden#fd2bb8a chat_id:int = ChatParticipants;
+chatParticipants#7841b415 chat_id:int admin_id:int participants:Vector<ChatParticipant> version:int = ChatParticipants;
+
+chatPhotoEmpty#37c1011c = ChatPhoto;
+chatPhoto#6153276a photo_small:FileLocation photo_big:FileLocation = ChatPhoto;
+
+messageEmpty#83e5de54 id:int = Message;
+message#a7ab1991 flags:# id:int from_id:int to_id:Peer fwd_from_id:flags.2?int fwd_date:flags.2?int reply_to_msg_id:flags.3?int date:int message:string media:MessageMedia = Message;
+messageService#1d86f70e flags:int id:int from_id:int to_id:Peer date:int action:MessageAction = Message;
+
+messageMediaEmpty#3ded6320 = MessageMedia;
+messageMediaPhoto#3d8ce53d photo:Photo caption:string = MessageMedia;
+messageMediaVideo#5bcf1675 video:Video caption:string = MessageMedia;
+messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;
+messageMediaContact#5e7d2f39 phone_number:string first_name:string last_name:string user_id:int = MessageMedia;
+messageMediaUnsupported#9f84f49e = MessageMedia;
+
+messageActionEmpty#b6aef7b0 = MessageAction;
+messageActionChatCreate#a6638b9a title:string users:Vector<int> = MessageAction;
+messageActionChatEditTitle#b5a1ce5a title:string = MessageAction;
+messageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction;
+messageActionChatDeletePhoto#95e3fbef = MessageAction;
+messageActionChatAddUser#5e3cfc4b user_id:int = MessageAction;
+messageActionChatDeleteUser#b2ae9b0c user_id:int = MessageAction;
+
+dialog#c1dd804a peer:Peer top_message:int read_inbox_max_id:int unread_count:int notify_settings:PeerNotifySettings = Dialog;
+
+photoEmpty#2331b22d id:long = Photo;
+photo#c3838076 id:long access_hash:long user_id:int date:int geo:GeoPoint sizes:Vector<PhotoSize> = Photo;
+photoL27#22b56751 id:long access_hash:long user_id:int date:int caption:string geo:GeoPoint sizes:Vector<PhotoSize> = Photo;
+
+photoSizeEmpty#e17e23c type:string = PhotoSize;
+photoSize#77bfb61b type:string location:FileLocation w:int h:int size:int = PhotoSize;
+photoCachedSize#e9a734fa type:string location:FileLocation w:int h:int bytes:bytes = PhotoSize;
+
+videoEmpty#c10658a8 id:long = Video;
+video#ee9f4a4d id:long access_hash:long user_id:int date:int duration:int size:int thumb:PhotoSize dc_id:int w:int h:int = Video;
+videoL27#388fa391 id:long access_hash:long user_id:int date:int caption:string duration:int mime_type:string size:int thumb:PhotoSize dc_id:int w:int h:int = Video;
+
+geoPointEmpty#1117dd5f = GeoPoint;
+geoPoint#2049d70c longitude:double latitude:double = GeoPoint;
+
+auth.checkedPhone#811ea28e phone_registered:Bool = auth.CheckedPhone;
+
+auth.sentCode#efed51d9 phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
+
+auth.authorization#f6b673a4 expires:int user:User = auth.Authorization;
+
+auth.exportedAuthorization#df969c2d id:int bytes:bytes = auth.ExportedAuthorization;
+
+inputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer;
+inputNotifyUsers#193b4417 = InputNotifyPeer;
+inputNotifyChats#4a95e84e = InputNotifyPeer;
+inputNotifyAll#a429b886 = InputNotifyPeer;
+
+inputPeerNotifyEventsEmpty#f03064d8 = InputPeerNotifyEvents;
+inputPeerNotifyEventsAll#e86a2c74 = InputPeerNotifyEvents;
+
+inputPeerNotifySettings#46a2ce98 mute_until:int sound:string show_previews:Bool events_mask:int = InputPeerNotifySettings;
+
+peerNotifyEventsEmpty#add53cb3 = PeerNotifyEvents;
+peerNotifyEventsAll#6d1ded88 = PeerNotifyEvents;
+
+peerNotifySettingsEmpty#70a68512 = PeerNotifySettings;
+peerNotifySettings#8d5e11ee mute_until:int sound:string show_previews:Bool events_mask:int = PeerNotifySettings;
+
+wallPaper#ccb03657 id:int title:string sizes:Vector<PhotoSize> color:int = WallPaper;
+
+userFull#771095da user:User link:contacts.Link profile_photo:Photo notify_settings:PeerNotifySettings blocked:Bool real_first_name:string real_last_name:string = UserFull;
+
+contact#f911c994 user_id:int mutual:Bool = Contact;
+
+importedContact#d0028438 user_id:int client_id:long = ImportedContact;
+
+contactBlocked#561bc879 user_id:int date:int = ContactBlocked;
+
+contactSuggested#3de191a1 user_id:int mutual_contacts:int = ContactSuggested;
+
+contactStatus#d3680c61 user_id:int status:UserStatus = ContactStatus;
+
+chatLocated#3631cf4c chat_id:int distance:int = ChatLocated;
+
+contacts.link#3ace484c my_link:ContactLink foreign_link:ContactLink user:User = contacts.Link;
+
+contacts.contactsNotModified#b74ba9d2 = contacts.Contacts;
+contacts.contacts#6f8b8cb2 contacts:Vector<Contact> users:Vector<User> = contacts.Contacts;
+
+contacts.importedContacts#ad524315 imported:Vector<ImportedContact> retry_contacts:Vector<long> users:Vector<User> = contacts.ImportedContacts;
+
+contacts.blocked#1c138d15 blocked:Vector<ContactBlocked> users:Vector<User> = contacts.Blocked;
+contacts.blockedSlice#900802a1 count:int blocked:Vector<ContactBlocked> users:Vector<User> = contacts.Blocked;
+
+contacts.suggested#5649dcc5 results:Vector<ContactSuggested> users:Vector<User> = contacts.Suggested;
+
+messages.dialogs#15ba6c40 dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
+messages.dialogsSlice#71e094f3 count:int dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
+
+messages.messages#8c718e87 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+messages.messagesSlice#b446ae3 count:int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+
+messages.messageEmpty#3f4e0648 = messages.Message;
+
+messages.sentMessage#4c3d47f3 id:int date:int media:MessageMedia pts:int pts_count:int = messages.SentMessage;
+
+messages.chats#64ff9fd5 chats:Vector<Chat> = messages.Chats;
+
+messages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector<Chat> users:Vector<User> = messages.ChatFull;
+
+messages.affectedHistory#b45c69d1 pts:int pts_count:int offset:int = messages.AffectedHistory;
+
+inputMessagesFilterEmpty#57e2f66c = MessagesFilter;
+inputMessagesFilterPhotos#9609a51c = MessagesFilter;
+inputMessagesFilterVideo#9fc00e65 = MessagesFilter;
+inputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter;
+inputMessagesFilterPhotoVideoDocuments#d95e73bb = MessagesFilter;
+inputMessagesFilterDocument#9eddf188 = MessagesFilter;
+inputMessagesFilterAudio#cfc87522 = MessagesFilter;
+
+updateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update;
+updateMessageID#4e90bfd6 id:int random_id:long = Update;
+updateDeleteMessages#a20db0e5 messages:Vector<int> pts:int pts_count:int = Update;
+updateUserTyping#5c486927 user_id:int action:SendMessageAction = Update;
+updateChatUserTyping#9a65ea1f chat_id:int user_id:int action:SendMessageAction = Update;
+updateChatParticipants#7761198 participants:ChatParticipants = Update;
+updateUserStatus#1bfbd823 user_id:int status:UserStatus = Update;
+updateUserName#a7332b73 user_id:int first_name:string last_name:string username:string = Update;
+updateUserPhoto#95313b0c user_id:int date:int photo:UserProfilePhoto previous:Bool = Update;
+updateContactRegistered#2575bbb9 user_id:int date:int = Update;
+updateContactLink#9d2e67c5 user_id:int my_link:ContactLink foreign_link:ContactLink = Update;
+updateNewAuthorization#8f06529a auth_key_id:long date:int device:string location:string = Update;
+
+updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
+
+updates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference;
+updates.difference#f49ca0 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> state:updates.State = updates.Difference;
+updates.differenceSlice#a8fb1981 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> intermediate_state:updates.State = updates.Difference;
+
+updatesTooLong#e317af7e = Updates;
+updateShortMessage#ed5c2127 flags:# id:int user_id:int message:string pts:int pts_count:int date:int fwd_from_id:flags.2?int fwd_date:flags.2?int reply_to_msg_id:flags.3?int = Updates;
+updateShortChatMessage#52238b3c flags:# id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from_id:flags.2?int fwd_date:flags.2?int reply_to_msg_id:flags.3?int = Updates;
+updateShort#78d4dec1 update:Update date:int = Updates;
+updatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;
+updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
+
+photos.photos#8dca6aa5 photos:Vector<Photo> users:Vector<User> = photos.Photos;
+photos.photosSlice#15051f54 count:int photos:Vector<Photo> users:Vector<User> = photos.Photos;
+
+photos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;
+
+upload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;
+
+dcOptionL28#2ec2a43c id:int hostname:string ip_address:string port:int = DcOption;
+dcOption#5d8c6cc flags:int id:int ip_address:string port:int = DcOption;
+
+config#4e32b894 date:int expires:int test_mode:Bool this_dc:int dc_options:Vector<DcOption> chat_size_max:int broadcast_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int chat_big_size:int push_chat_period_ms:int push_chat_limit:int disabled_features:Vector<DisabledFeature> = Config;
+
+nearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;
+
+help.appUpdate#8987f311 id:int critical:Bool url:string text:string = help.AppUpdate;
+help.noAppUpdate#c45a6536 = help.AppUpdate;
+
+help.inviteText#18cb9f78 message:string = help.InviteText;
+
+messages.sentMessageLink#35a1a663 id:int date:int media:MessageMedia pts:int pts_count:int links:Vector<contacts.Link> seq:int = messages.SentMessage;
+
+inputGeoChat#74d456fa chat_id:int access_hash:long = InputGeoChat;
+
+inputNotifyGeoChatPeer#4d8ddec8 geo_peer:InputGeoChat = InputNotifyPeer;
+
+geoChat#75eaea5a id:int access_hash:long title:string address:string venue:string geo:GeoPoint photo:ChatPhoto participants_count:int date:int checked_in:Bool version:int = Chat;
+
+geoChatMessageEmpty#60311a9b chat_id:int id:int = GeoChatMessage;
+geoChatMessage#4505f8e1 chat_id:int id:int from_id:int date:int message:string media:MessageMedia = GeoChatMessage;
+geoChatMessageService#d34fa24e chat_id:int id:int from_id:int date:int action:MessageAction = GeoChatMessage;
+
+geochats.statedMessage#17b1578b message:GeoChatMessage chats:Vector<Chat> users:Vector<User> seq:int = geochats.StatedMessage;
+
+geochats.located#48feb267 results:Vector<ChatLocated> messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Located;
+
+geochats.messages#d1526db1 messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Messages;
+geochats.messagesSlice#bc5863e8 count:int messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Messages;
+
+messageActionGeoChatCreate#6f038ebc title:string address:string = MessageAction;
+messageActionGeoChatCheckin#c7d53de = MessageAction;
+
+updateNewGeoChatMessage#5a68e3f7 geo_message:GeoChatMessage = Update;
+
+wallPaperSolid#63117f24 id:int title:string bg_color:int color:int = WallPaper;
+
+updateNewEncryptedMessage#12bcbd9a encr_message:EncryptedMessage qts:int = Update;
+updateEncryptedChatTyping#1710f156 chat_id:int = Update;
+updateEncryption#b4a2e88d encr_chat:EncryptedChat date:int = Update;
+updateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update;
+
+encryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat;
+encryptedChatWaiting#3bf703dc id:int access_hash:long date:int admin_id:int participant_id:int = EncryptedChat;
+encryptedChatRequested#c878527e id:int access_hash:long date:int admin_id:int participant_id:int g_a:bytes = EncryptedChat;
+encryptedChat#fa56ce36 id:int access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long = EncryptedChat;
+encryptedChatDiscarded#13d6dd27 id:int = EncryptedChat;
+
+inputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat;
+
+encryptedFileEmpty#c21f497e = EncryptedFile;
+encryptedFile#4a70994c id:long access_hash:long size:int dc_id:int key_fingerprint:int = EncryptedFile;
+
+inputEncryptedFileEmpty#1837c364 = InputEncryptedFile;
+inputEncryptedFileUploaded#64bd0306 id:long parts:int md5_checksum:string key_fingerprint:int = InputEncryptedFile;
+inputEncryptedFile#5a17b5e5 id:long access_hash:long = InputEncryptedFile;
+
+inputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation;
+
+encryptedMessage#ed18c118 random_id:long chat_id:int date:int bytes:bytes file:EncryptedFile = EncryptedMessage;
+encryptedMessageService#23734b06 random_id:long chat_id:int date:int bytes:bytes = EncryptedMessage;
+
+messages.dhConfigNotModified#c0e24635 random:bytes = messages.DhConfig;
+messages.dhConfig#2c221edd g:int p:bytes version:int random:bytes = messages.DhConfig;
+
+messages.sentEncryptedMessage#560f8935 date:int = messages.SentEncryptedMessage;
+messages.sentEncryptedFile#9493ff32 date:int file:EncryptedFile = messages.SentEncryptedMessage;
+
+inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;
+
+inputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile;
+
+updateChatParticipantAdd#3a0eeb22 chat_id:int user_id:int inviter_id:int version:int = Update;
+updateChatParticipantDelete#6e5f8c22 chat_id:int user_id:int version:int = Update;
+updateDcOptions#8e5e9873 dc_options:Vector<DcOption> = Update;
+
+inputMediaUploadedAudio#4e498cab file:InputFile duration:int mime_type:string = InputMedia;
+inputMediaAudio#89938781 audio_id:InputAudio = InputMedia;
+inputMediaUploadedDocument#ffe76b78 file:InputFile mime_type:string attributes:Vector<DocumentAttribute> = InputMedia;
+inputMediaUploadedThumbDocument#41481486 file:InputFile thumb:InputFile mime_type:string attributes:Vector<DocumentAttribute> = InputMedia;
+inputMediaDocument#d184e841 document_id:InputDocument = InputMedia;
+
+messageMediaDocument#2fda2204 document:Document = MessageMedia;
+messageMediaAudio#c6b68300 audio:Audio = MessageMedia;
+
+inputAudioEmpty#d95adc84 = InputAudio;
+inputAudio#77d440ff id:long access_hash:long = InputAudio;
+
+inputDocumentEmpty#72f0eaae = InputDocument;
+inputDocument#18798952 id:long access_hash:long = InputDocument;
+
+inputAudioFileLocation#74dc404d id:long access_hash:long = InputFileLocation;
+inputDocumentFileLocation#4e45abe9 id:long access_hash:long = InputFileLocation;
+
+audioEmpty#586988d8 id:long = Audio;
+audio#c7ac6496 id:long access_hash:long user_id:int date:int duration:int mime_type:string size:int dc_id:int = Audio;
+
+documentEmpty#36f8c871 id:long = Document;
+document#f9a39f4f id:long access_hash:long date:int mime_type:string size:int thumb:PhotoSize dc_id:int attributes:Vector<DocumentAttribute> = Document;
+document_l19#9efc6326 id:long access_hash:long user_id:int date:int file_name:string mime_type:string size:int thumb:PhotoSize dc_id:int = Document;
+
+help.support#17c6b5f6 phone_number:string user:User = help.Support;
+
+notifyPeer#9fd40bd8 peer:Peer = NotifyPeer;
+notifyUsers#b4c83b4c = NotifyPeer;
+notifyChats#c007cec3 = NotifyPeer;
+notifyAll#74d07c60 = NotifyPeer;
+
+updateUserBlocked#80ece81a user_id:int blocked:Bool = Update;
+updateNotifySettings#bec268ef notify_peer:NotifyPeer notify_settings:PeerNotifySettings = Update;
+
+auth.sentAppCode#e325edcf phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
+
+sendMessageTypingAction#16bf744e = SendMessageAction;
+sendMessageCancelAction#fd5ec8f5 = SendMessageAction;
+sendMessageRecordVideoAction#a187d66f = SendMessageAction;
+sendMessageUploadVideoActionL27#92042ff7 = SendMessageAction;
+sendMessageUploadVideoAction#e9763aec progress:int = SendMessageAction;
+sendMessageRecordAudioAction#d52f73f7 = SendMessageAction;
+sendMessageUploadAudioActionL27#e6ac8a6f = SendMessageAction;
+sendMessageUploadAudioAction#f351d7ab progress:int = SendMessageAction;
+sendMessageUploadPhotoAction#d1d34a26 progress:int = SendMessageAction;
+sendMessageUploadDocumentActionL27#8faee98e = SendMessageAction;
+sendMessageUploadDocumentAction#aa0cd9e4 progress:int = SendMessageAction;
+sendMessageGeoLocationAction#176f8ba1 = SendMessageAction;
+sendMessageChooseContactAction#628cbc6f = SendMessageAction;
+
+contactFound#ea879f95 user_id:int = ContactFound;
+
+contacts.found#566000e results:Vector<ContactFound> users:Vector<User> = contacts.Found;
+
+updateServiceNotification#382dd3e4 type:string message_text:string media:MessageMedia popup:Bool = Update;
+
+userStatusRecently#e26f42f1 = UserStatus;
+userStatusLastWeek#7bf09fc = UserStatus;
+userStatusLastMonth#77ebc742 = UserStatus;
+
+updatePrivacy#ee3b272a key:PrivacyKey rules:Vector<PrivacyRule> = Update;
+
+inputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey;
+
+privacyKeyStatusTimestamp#bc2eab30 = PrivacyKey;
+
+inputPrivacyValueAllowContacts#d09e07b = InputPrivacyRule;
+inputPrivacyValueAllowAll#184b35ce = InputPrivacyRule;
+inputPrivacyValueAllowUsers#131cc67f users:Vector<InputUser> = InputPrivacyRule;
+inputPrivacyValueDisallowContacts#ba52007 = InputPrivacyRule;
+inputPrivacyValueDisallowAll#d66b66c9 = InputPrivacyRule;
+inputPrivacyValueDisallowUsers#90110467 users:Vector<InputUser> = InputPrivacyRule;
+
+privacyValueAllowContacts#fffe1bac = PrivacyRule;
+privacyValueAllowAll#65427b82 = PrivacyRule;
+privacyValueAllowUsers#4d5bbe0c users:Vector<int> = PrivacyRule;
+privacyValueDisallowContacts#f888fa1a = PrivacyRule;
+privacyValueDisallowAll#8b73e763 = PrivacyRule;
+privacyValueDisallowUsers#c7f49b7 users:Vector<int> = PrivacyRule;
+
+account.privacyRules#554abb6f rules:Vector<PrivacyRule> users:Vector<User> = account.PrivacyRules;
+
+accountDaysTTL#b8d0afdf days:int = AccountDaysTTL;
+
+account.sentChangePhoneCode#a4f58c4c phone_code_hash:string send_call_timeout:int = account.SentChangePhoneCode;
+
+updateUserPhone#12b9417b user_id:int phone:string = Update;
+
+documentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute;
+documentAttributeAnimated#11b58939 = DocumentAttribute;
+documentAttributeStickerL28#994c9882 alt:string = DocumentAttribute;
+documentAttributeSticker#3a556302 alt:string stickerset:InputStickerSet = DocumentAttribute;
+documentAttributeVideo#5910cccb duration:int w:int h:int = DocumentAttribute;
+documentAttributeAudio#51448e5 duration:int = DocumentAttribute;
+documentAttributeFilename#15590068 file_name:string = DocumentAttribute;
+
+messages.stickersNotModified#f1749a22 = messages.Stickers;
+messages.stickers#8a8ecd32 hash:string stickers:Vector<Document> = messages.Stickers;
+
+stickerPack#12b299d4 emoticon:string documents:Vector<long> = StickerPack;
+
+messages.allStickersNotModified#e86602c3 = messages.AllStickers;
+messages.allStickers#5ce352ec hash:string packs:Vector<StickerPack> sets:Vector<StickerSet> documents:Vector<Document> = messages.AllStickers;
+
+disabledFeature#ae636f24 feature:string description:string = DisabledFeature;
+
+updateReadHistoryInbox#9961fd5c peer:Peer max_id:int pts:int pts_count:int = Update;
+updateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update;
+
+messages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages;
+
+contactLinkUnknown#5f4f9247 = ContactLink;
+contactLinkNone#feedd3ad = ContactLink;
+contactLinkHasPhone#268f3f59 = ContactLink;
+contactLinkContact#d502c2d0 = ContactLink;
+
+updateWebPage#2cc36971 webpage:WebPage = Update;
+
+webPageEmpty#eb1477e8 id:long = WebPage;
+webPagePending#c586da1c id:long date:int = WebPage;
+webPage#a31ea0b5 flags:# id:long url:string display_url:string type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string = WebPage;
+
+messageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia;
+
+authorization#7bf2e6f6 hash:long flags:int device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization;
+
+account.authorizations#1250abde authorizations:Vector<Authorization> = account.Authorizations;
+
+account.noPassword#96dabc18 new_salt:bytes email_unconfirmed_pattern:string = account.Password;
+account.password#7c18141c current_salt:bytes new_salt:bytes hint:string has_recovery:Bool email_unconfirmed_pattern:string = account.Password;
+
+account.passwordSettings#b7b72ab3 email:string = account.PasswordSettings;
+
+account.passwordInputSettings#bcfc532c flags:# new_salt:flags.0?bytes new_password_hash:flags.0?bytes hint:flags.0?string email:flags.1?string = account.PasswordInputSettings;
+
+auth.passwordRecovery#137948a5 email_pattern:string = auth.PasswordRecovery;
+
+inputMediaVenue#2827a81a geo_point:InputGeoPoint title:string address:string provider:string venue_id:string = InputMedia;
+
+messageMediaVenue#7912b71f geo:GeoPoint title:string address:string provider:string venue_id:string = MessageMedia;
+
+receivedNotifyMessage#a384b779 id:int flags:int = ReceivedNotifyMessage;
+
+chatInviteEmpty#69df3769 = ExportedChatInvite;
+chatInviteExported#fc2e05bc link:string = ExportedChatInvite;
+
+chatInviteAlready#5a686d7c chat:Chat = ChatInvite;
+chatInvite#ce917dcd title:string = ChatInvite;
+
+messageActionChatJoinedByLink#f89cf5e8 inviter_id:int = MessageAction;
+
+updateReadMessagesContents#68c13933 messages:Vector<int> pts:int pts_count:int = Update;
+
+inputStickerSetEmpty#ffb62b95 = InputStickerSet;
+inputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet;
+inputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet;
+
+stickerSet#a7a43b17 id:long access_hash:long title:string short_name:string = StickerSet;
+
+messages.stickerSet#b60a24a6 set:StickerSet packs:Vector<StickerPack> documents:Vector<Document> = messages.StickerSet;
+
+---functions---
+
+invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
+
+invokeAfterMsgs#3dc4b4f0 {X:Type} msg_ids:Vector<long> query:!X = X;
+
+auth.checkPhone#6fe51dfb phone_number:string = auth.CheckedPhone;
+auth.sendCode#768d5f4d phone_number:string sms_type:int api_id:int api_hash:string lang_code:string = auth.SentCode;
+auth.sendCall#3c51564 phone_number:string phone_code_hash:string = Bool;
+auth.signUp#1b067634 phone_number:string phone_code_hash:string phone_code:string first_name:string last_name:string = auth.Authorization;
+auth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:string = auth.Authorization;
+auth.logOut#5717da40 = Bool;
+auth.resetAuthorizations#9fab0d1a = Bool;
+auth.sendInvites#771c1d97 phone_numbers:Vector<string> message:string = Bool;
+auth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization;
+auth.importAuthorization#e3ef9613 id:int bytes:bytes = auth.Authorization;
+auth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool;
+
+account.registerDevice#446c712c token_type:int token:string device_model:string system_version:string app_version:string app_sandbox:Bool lang_code:string = Bool;
+account.unregisterDevice#65c55b40 token_type:int token:string = Bool;
+account.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool;
+account.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings;
+account.resetNotifySettings#db7e1747 = Bool;
+account.updateProfile#f0888d68 first_name:string last_name:string = User;
+account.updateStatus#6628562c offline:Bool = Bool;
+account.getWallPapers#c04cfac2 = Vector<WallPaper>;
+
+users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
+users.getFullUser#ca30a5b1 id:InputUser = UserFull;
+
+contacts.getStatuses#c4a353ee = Vector<ContactStatus>;
+contacts.getContacts#22c6aa08 hash:string = contacts.Contacts;
+contacts.importContacts#da30b32d contacts:Vector<InputContact> replace:Bool = contacts.ImportedContacts;
+contacts.getSuggested#cd773428 limit:int = contacts.Suggested;
+contacts.deleteContact#8e953744 id:InputUser = contacts.Link;
+contacts.deleteContacts#59ab389e id:Vector<InputUser> = Bool;
+contacts.block#332b49fc id:InputUser = Bool;
+contacts.unblock#e54100bd id:InputUser = Bool;
+contacts.getBlocked#f57c350f offset:int limit:int = contacts.Blocked;
+contacts.exportCard#84e53737 = Vector<int>;
+contacts.importCard#4fe196fe export_card:Vector<int> = User;
+
+messages.getMessages#4222fa74 id:Vector<int> = messages.Messages;
+messages.getDialogs#eccf1df6 offset:int max_id:int limit:int = messages.Dialogs;
+messages.getHistory#92a1df2f peer:InputPeer offset:int max_id:int limit:int = messages.Messages;
+messages.search#7e9f2ab peer:InputPeer q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = messages.Messages;
+messages.readHistory#b04f2510 peer:InputPeer max_id:int offset:int = messages.AffectedHistory;
+messages.deleteHistory#f4f8fb61 peer:InputPeer offset:int = messages.AffectedHistory;
+messages.deleteMessages#a5f18925 id:Vector<int> = messages.AffectedMessages;
+messages.receivedMessages#5a954c0 max_id:int = Vector<ReceivedNotifyMessage>;
+messages.setTyping#a3825e50 peer:InputPeer action:SendMessageAction = Bool;
+messages.sendMessage#9add8f26 flags:# peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long = messages.SentMessage;
+messages.sendMedia#2d7923b1 flags:# peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia random_id:long = Updates;
+messages.forwardMessages#55e1728d peer:InputPeer id:Vector<int> random_id:Vector<long> = Updates;
+messages.getChats#3c6aa187 id:Vector<int> = messages.Chats;
+messages.getFullChat#3b831c66 chat_id:int = messages.ChatFull;
+messages.editChatTitle#dc452855 chat_id:int title:string = Updates;
+messages.editChatPhoto#ca4c79d8 chat_id:int photo:InputChatPhoto = Updates;
+messages.addChatUser#f9a0aa09 chat_id:int user_id:InputUser fwd_limit:int = Updates;
+messages.deleteChatUser#e0611f16 chat_id:int user_id:InputUser = Updates;
+messages.createChat#9cb126e users:Vector<InputUser> title:string = Updates;
+
+updates.getState#edd4882a = updates.State;
+updates.getDifference#a041495 pts:int date:int qts:int = updates.Difference;
+
+photos.updateProfilePhoto#eef579a0 id:InputPhoto crop:InputPhotoCrop = UserProfilePhoto;
+photos.uploadProfilePhoto#d50f9c88 file:InputFile caption:string geo_point:InputGeoPoint crop:InputPhotoCrop = photos.Photo;
+photos.deletePhotos#87cf7f2f id:Vector<InputPhoto> = Vector<long>;
+
+upload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool;
+upload.getFile#e3a6cfb5 location:InputFileLocation offset:int limit:int = upload.File;
+
+help.getConfig#c4f9186b = Config;
+help.getNearestDc#1fb33026 = NearestDc;
+help.getAppUpdate#c812ac7e device_model:string system_version:string app_version:string lang_code:string = help.AppUpdate;
+help.saveAppLog#6f02f748 events:Vector<InputAppEvent> = Bool;
+help.getInviteText#a4a95186 lang_code:string = help.InviteText;
+
+photos.getUserPhotos#b7ee553c user_id:InputUser offset:int max_id:int limit:int = photos.Photos;
+
+messages.forwardMessage#33963bf9 peer:InputPeer id:int random_id:long = Updates;
+messages.sendBroadcast#bf73f4da contacts:Vector<InputUser> random_id:Vector<long> message:string media:InputMedia = Updates;
+
+geochats.getLocated#7f192d8f geo_point:InputGeoPoint radius:int limit:int = geochats.Located;
+geochats.getRecents#e1427e6f offset:int limit:int = geochats.Messages;
+geochats.checkin#55b3e8fb peer:InputGeoChat = geochats.StatedMessage;
+geochats.getFullChat#6722dd6f peer:InputGeoChat = messages.ChatFull;
+geochats.editChatTitle#4c8e2273 peer:InputGeoChat title:string address:string = geochats.StatedMessage;
+geochats.editChatPhoto#35d81a95 peer:InputGeoChat photo:InputChatPhoto = geochats.StatedMessage;
+geochats.search#cfcdc44d peer:InputGeoChat q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = geochats.Messages;
+geochats.getHistory#b53f7a68 peer:InputGeoChat offset:int max_id:int limit:int = geochats.Messages;
+geochats.setTyping#8b8a729 peer:InputGeoChat typing:Bool = Bool;
+geochats.sendMessage#61b0044 peer:InputGeoChat message:string random_id:long = geochats.StatedMessage;
+geochats.sendMedia#b8f0deff peer:InputGeoChat media:InputMedia random_id:long = geochats.StatedMessage;
+geochats.createGeoChat#e092e16 title:string geo_point:InputGeoPoint address:string venue:string = geochats.StatedMessage;
+
+messages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig;
+messages.requestEncryption#f64daf43 user_id:InputUser random_id:int g_a:bytes = EncryptedChat;
+messages.acceptEncryption#3dbc0415 peer:InputEncryptedChat g_b:bytes key_fingerprint:long = EncryptedChat;
+messages.discardEncryption#edd923c5 chat_id:int = Bool;
+messages.setEncryptedTyping#791451ed peer:InputEncryptedChat typing:Bool = Bool;
+messages.readEncryptedHistory#7f4b690a peer:InputEncryptedChat max_date:int = Bool;
+messages.sendEncrypted#a9776773 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
+messages.sendEncryptedFile#9a901b66 peer:InputEncryptedChat random_id:long data:bytes file:InputEncryptedFile = messages.SentEncryptedMessage;
+messages.sendEncryptedService#32d439a4 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
+messages.receivedQueue#55a5bb66 max_qts:int = Vector<long>;
+
+upload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool;
+
+initConnection#69796de9 {X:Type} api_id:int device_model:string system_version:string app_version:string lang_code:string query:!X = X;
+
+help.getSupport#9cdf08cd = help.Support;
+
+auth.sendSms#da9f3e8 phone_number:string phone_code_hash:string = Bool;
+
+messages.readMessageContents#36a73f77 id:Vector<int> = messages.AffectedMessages;
+
+account.checkUsername#2714d86c username:string = Bool;
+account.updateUsername#3e0bdd7c username:string = User;
+
+contacts.search#11f812d8 q:string limit:int = contacts.Found;
+
+account.getPrivacy#dadbc950 key:InputPrivacyKey = account.PrivacyRules;
+account.setPrivacy#c9f81ce8 key:InputPrivacyKey rules:Vector<InputPrivacyRule> = account.PrivacyRules;
+account.deleteAccount#418d4e0b reason:string = Bool;
+account.getAccountTTL#8fc711d = AccountDaysTTL;
+account.setAccountTTL#2442485e ttl:AccountDaysTTL = Bool;
+
+invokeWithLayer#da9b0d0d {X:Type} layer:int query:!X = X;
+
+contacts.resolveUsername#bf0131c username:string = User;
+
+account.sendChangePhoneCode#a407a8f4 phone_number:string = account.SentChangePhoneCode;
+account.changePhone#70c32edb phone_number:string phone_code_hash:string phone_code:string = User;
+
+messages.getStickers#ae22e045 emoticon:string hash:string = messages.Stickers;
+messages.getAllStickers#aa3bc868 hash:string = messages.AllStickers;
+
+account.updateDeviceLocked#38df3532 period:int = Bool;
+
+auth.importBotAuthorization#67a3ff2c flags:int api_id:int api_hash:string bot_auth_token:string = auth.Authorization;
+
+messages.getWebPagePreview#25223e24 message:string = MessageMedia;
+
+account.getAuthorizations#e320c158 = account.Authorizations;
+account.resetAuthorization#df77f3bc hash:long = Bool;
+account.getPassword#548a30f5 = account.Password;
+account.getPasswordSettings#bc8d11bb current_password_hash:bytes = account.PasswordSettings;
+account.updatePasswordSettings#fa7c4b86 current_password_hash:bytes new_settings:account.PasswordInputSettings = Bool;
+
+auth.checkPassword#a63011e password_hash:bytes = auth.Authorization;
+auth.requestPasswordRecovery#d897bc66 = auth.PasswordRecovery;
+auth.recoverPassword#4ea56e92 code:string = auth.Authorization;
+
+invokeWithoutUpdates#bf9459b7 {X:Type} query:!X = X;
+
+messages.exportChatInvite#7d885289 chat_id:int = ExportedChatInvite;
+messages.checkChatInvite#3eadb1bb hash:string = ChatInvite;
+messages.importChatInvite#6c50051c hash:string = Updates;
+messages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet;
+messages.installStickerSet#efbbfae9 stickerset:InputStickerSet = Bool;
+messages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool;
diff --git a/protocols/Telegram/tgl/scheme31.tl b/protocols/Telegram/tgl/scheme31.tl
new file mode 100644
index 0000000000..83a2084170
--- /dev/null
+++ b/protocols/Telegram/tgl/scheme31.tl
@@ -0,0 +1,668 @@
+int ?= Int;
+long ?= Long;
+double ?= Double;
+string ?= String;
+
+bytes string = Bytes;
+
+int128 long long = Int128;
+int256 long long long long = Int256;
+
+boolFalse#bc799737 = Bool;
+boolTrue#997275b5 = Bool;
+
+vector#1cb5c415 {t:Type} # [ t ] = Vector t;
+
+error#c4b9f9bb code:int text:string = Error;
+
+null#56730bcc = Null;
+
+inputPeerEmpty#7f3b18ea = InputPeer;
+inputPeerSelf#7da07ec9 = InputPeer;
+inputPeerContact#1023dbe8 user_id:int = InputPeer;
+inputPeerForeign#9b447325 user_id:int access_hash:long = InputPeer;
+inputPeerChat#179be863 chat_id:int = InputPeer;
+
+inputUserEmpty#b98886cf = InputUser;
+inputUserSelf#f7c1b13f = InputUser;
+inputUserContact#86e94f65 user_id:int = InputUser;
+inputUserForeign#655e74ff user_id:int access_hash:long = InputUser;
+
+inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact;
+
+inputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;
+
+inputMediaEmpty#9664f57f = InputMedia;
+inputMediaUploadedPhoto#f7aff1c0 file:InputFile caption:string = InputMedia;
+inputMediaPhoto#e9bfb4f3 id:InputPhoto caption:string = InputMedia;
+inputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;
+inputMediaContact#a6e45987 phone_number:string first_name:string last_name:string = InputMedia;
+inputMediaUploadedVideo#e13fd4bc file:InputFile duration:int w:int h:int caption:string = InputMedia;
+inputMediaUploadedThumbVideo#96fb97dc file:InputFile thumb:InputFile duration:int w:int h:int caption:string = InputMedia;
+inputMediaVideo#936a4ebd video_id:InputVideo caption:string = InputMedia;
+
+inputChatPhotoEmpty#1ca48f57 = InputChatPhoto;
+inputChatUploadedPhoto#94254732 file:InputFile crop:InputPhotoCrop = InputChatPhoto;
+inputChatPhoto#b2e1bf08 id:InputPhoto crop:InputPhotoCrop = InputChatPhoto;
+
+inputGeoPointEmpty#e4c123d6 = InputGeoPoint;
+inputGeoPoint#f3b7acc9 latitude:double longitude:double = InputGeoPoint;
+
+inputPhotoEmpty#1cd7bf0d = InputPhoto;
+inputPhoto#fb95c6c4 id:long access_hash:long = InputPhoto;
+
+inputVideoEmpty#5508ec75 = InputVideo;
+inputVideo#ee579652 id:long access_hash:long = InputVideo;
+
+inputFileLocation#14637196 volume_id:long local_id:int secret:long = InputFileLocation;
+inputVideoFileLocation#3d0364ec id:long access_hash:long = InputFileLocation;
+
+inputPhotoCropAuto#ade6b004 = InputPhotoCrop;
+inputPhotoCrop#d9915325 crop_left:double crop_top:double crop_width:double = InputPhotoCrop;
+
+inputAppEvent#770656a8 time:double type:string peer:long data:string = InputAppEvent;
+
+peerUser#9db1bc6d user_id:int = Peer;
+peerChat#bad0e5bb chat_id:int = Peer;
+
+storage.fileUnknown#aa963b05 = storage.FileType;
+storage.fileJpeg#7efe0e = storage.FileType;
+storage.fileGif#cae1aadf = storage.FileType;
+storage.filePng#a4f63c0 = storage.FileType;
+storage.filePdf#ae1e508d = storage.FileType;
+storage.fileMp3#528a0677 = storage.FileType;
+storage.fileMov#4b09ebbc = storage.FileType;
+storage.filePartial#40bc6f52 = storage.FileType;
+storage.fileMp4#b3cea0e4 = storage.FileType;
+storage.fileWebp#1081464c = storage.FileType;
+
+fileLocationUnavailable#7c596b46 volume_id:long local_id:int secret:long = FileLocation;
+fileLocation#53d69076 dc_id:int volume_id:long local_id:int secret:long = FileLocation;
+
+userEmpty#200250ba id:int = User;
+
+userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
+userProfilePhoto#d559d8c8 photo_id:long photo_small:FileLocation photo_big:FileLocation = UserProfilePhoto;
+
+userStatusEmpty#9d05049 = UserStatus;
+userStatusOnline#edb93949 expires:int = UserStatus;
+userStatusOffline#8c703f was_online:int = UserStatus;
+
+chatEmpty#9ba2d800 id:int = Chat;
+chat#6e9c9bc7 id:int title:string photo:ChatPhoto participants_count:int date:int left:Bool version:int = Chat;
+chatForbidden#fb0ccc41 id:int title:string date:int = Chat;
+
+chatFull#2e02a614 id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector<BotInfo> = ChatFull;
+
+
+chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant;
+
+chatParticipantsForbidden#fd2bb8a chat_id:int = ChatParticipants;
+chatParticipants#7841b415 chat_id:int admin_id:int participants:Vector<ChatParticipant> version:int = ChatParticipants;
+
+chatPhotoEmpty#37c1011c = ChatPhoto;
+chatPhoto#6153276a photo_small:FileLocation photo_big:FileLocation = ChatPhoto;
+
+messageEmpty#83e5de54 id:int = Message;
+message#c3060325 flags:# id:int from_id:int to_id:Peer fwd_from_id:flags.2?int fwd_date:flags.2?int reply_to_msg_id:flags.3?int date:int message:string media:MessageMedia reply_markup:flags.6?ReplyMarkup = Message;
+messageService#1d86f70e flags:int id:int from_id:int to_id:Peer date:int action:MessageAction = Message;
+
+messageMediaEmpty#3ded6320 = MessageMedia;
+messageMediaPhoto#3d8ce53d photo:Photo caption:string = MessageMedia;
+messageMediaVideo#5bcf1675 video:Video caption:string = MessageMedia;
+messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;
+messageMediaContact#5e7d2f39 phone_number:string first_name:string last_name:string user_id:int = MessageMedia;
+messageMediaUnsupported#9f84f49e = MessageMedia;
+
+messageActionEmpty#b6aef7b0 = MessageAction;
+messageActionChatCreate#a6638b9a title:string users:Vector<int> = MessageAction;
+messageActionChatEditTitle#b5a1ce5a title:string = MessageAction;
+messageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction;
+messageActionChatDeletePhoto#95e3fbef = MessageAction;
+messageActionChatAddUser#5e3cfc4b user_id:int = MessageAction;
+messageActionChatDeleteUser#b2ae9b0c user_id:int = MessageAction;
+
+dialog#c1dd804a peer:Peer top_message:int read_inbox_max_id:int unread_count:int notify_settings:PeerNotifySettings = Dialog;
+
+photoEmpty#2331b22d id:long = Photo;
+photo#c3838076 id:long access_hash:long user_id:int date:int geo:GeoPoint sizes:Vector<PhotoSize> = Photo;
+photoL27#22b56751 id:long access_hash:long user_id:int date:int caption:string geo:GeoPoint sizes:Vector<PhotoSize> = Photo;
+
+photoSizeEmpty#e17e23c type:string = PhotoSize;
+photoSize#77bfb61b type:string location:FileLocation w:int h:int size:int = PhotoSize;
+photoCachedSize#e9a734fa type:string location:FileLocation w:int h:int bytes:bytes = PhotoSize;
+
+videoEmpty#c10658a8 id:long = Video;
+video#ee9f4a4d id:long access_hash:long user_id:int date:int duration:int size:int thumb:PhotoSize dc_id:int w:int h:int = Video;
+videoL27#388fa391 id:long access_hash:long user_id:int date:int caption:string duration:int mime_type:string size:int thumb:PhotoSize dc_id:int w:int h:int = Video;
+
+geoPointEmpty#1117dd5f = GeoPoint;
+geoPoint#2049d70c longitude:double latitude:double = GeoPoint;
+
+auth.checkedPhone#811ea28e phone_registered:Bool = auth.CheckedPhone;
+
+auth.sentCode#efed51d9 phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
+
+auth.authorization#ff036af1 user:User = auth.Authorization;
+
+auth.exportedAuthorization#df969c2d id:int bytes:bytes = auth.ExportedAuthorization;
+
+inputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer;
+inputNotifyUsers#193b4417 = InputNotifyPeer;
+inputNotifyChats#4a95e84e = InputNotifyPeer;
+inputNotifyAll#a429b886 = InputNotifyPeer;
+
+inputPeerNotifyEventsEmpty#f03064d8 = InputPeerNotifyEvents;
+inputPeerNotifyEventsAll#e86a2c74 = InputPeerNotifyEvents;
+
+inputPeerNotifySettings#46a2ce98 mute_until:int sound:string show_previews:Bool events_mask:int = InputPeerNotifySettings;
+
+peerNotifyEventsEmpty#add53cb3 = PeerNotifyEvents;
+peerNotifyEventsAll#6d1ded88 = PeerNotifyEvents;
+
+peerNotifySettingsEmpty#70a68512 = PeerNotifySettings;
+peerNotifySettings#8d5e11ee mute_until:int sound:string show_previews:Bool events_mask:int = PeerNotifySettings;
+
+wallPaper#ccb03657 id:int title:string sizes:Vector<PhotoSize> color:int = WallPaper;
+
+userFull#5a89ac5b user:User link:contacts.Link profile_photo:Photo notify_settings:PeerNotifySettings blocked:Bool bot_info:BotInfo = UserFull;
+
+contact#f911c994 user_id:int mutual:Bool = Contact;
+
+importedContact#d0028438 user_id:int client_id:long = ImportedContact;
+
+contactBlocked#561bc879 user_id:int date:int = ContactBlocked;
+
+contactSuggested#3de191a1 user_id:int mutual_contacts:int = ContactSuggested;
+
+contactStatus#d3680c61 user_id:int status:UserStatus = ContactStatus;
+
+chatLocated#3631cf4c chat_id:int distance:int = ChatLocated;
+
+contacts.link#3ace484c my_link:ContactLink foreign_link:ContactLink user:User = contacts.Link;
+
+contacts.contactsNotModified#b74ba9d2 = contacts.Contacts;
+contacts.contacts#6f8b8cb2 contacts:Vector<Contact> users:Vector<User> = contacts.Contacts;
+
+contacts.importedContacts#ad524315 imported:Vector<ImportedContact> retry_contacts:Vector<long> users:Vector<User> = contacts.ImportedContacts;
+
+contacts.blocked#1c138d15 blocked:Vector<ContactBlocked> users:Vector<User> = contacts.Blocked;
+contacts.blockedSlice#900802a1 count:int blocked:Vector<ContactBlocked> users:Vector<User> = contacts.Blocked;
+
+contacts.suggested#5649dcc5 results:Vector<ContactSuggested> users:Vector<User> = contacts.Suggested;
+
+messages.dialogs#15ba6c40 dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
+messages.dialogsSlice#71e094f3 count:int dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;
+
+messages.messages#8c718e87 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+messages.messagesSlice#b446ae3 count:int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+
+messages.messageEmpty#3f4e0648 = messages.Message;
+
+messages.sentMessage#4c3d47f3 id:int date:int media:MessageMedia pts:int pts_count:int = messages.SentMessage;
+
+messages.chats#64ff9fd5 chats:Vector<Chat> = messages.Chats;
+
+messages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector<Chat> users:Vector<User> = messages.ChatFull;
+
+messages.affectedHistory#b45c69d1 pts:int pts_count:int offset:int = messages.AffectedHistory;
+
+inputMessagesFilterEmpty#57e2f66c = MessagesFilter;
+inputMessagesFilterPhotos#9609a51c = MessagesFilter;
+inputMessagesFilterVideo#9fc00e65 = MessagesFilter;
+inputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter;
+inputMessagesFilterPhotoVideoDocuments#d95e73bb = MessagesFilter;
+inputMessagesFilterDocument#9eddf188 = MessagesFilter;
+inputMessagesFilterAudio#cfc87522 = MessagesFilter;
+
+updateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update;
+updateMessageID#4e90bfd6 id:int random_id:long = Update;
+updateDeleteMessages#a20db0e5 messages:Vector<int> pts:int pts_count:int = Update;
+updateUserTyping#5c486927 user_id:int action:SendMessageAction = Update;
+updateChatUserTyping#9a65ea1f chat_id:int user_id:int action:SendMessageAction = Update;
+updateChatParticipants#7761198 participants:ChatParticipants = Update;
+updateUserStatus#1bfbd823 user_id:int status:UserStatus = Update;
+updateUserName#a7332b73 user_id:int first_name:string last_name:string username:string = Update;
+updateUserPhoto#95313b0c user_id:int date:int photo:UserProfilePhoto previous:Bool = Update;
+updateContactRegistered#2575bbb9 user_id:int date:int = Update;
+updateContactLink#9d2e67c5 user_id:int my_link:ContactLink foreign_link:ContactLink = Update;
+updateNewAuthorization#8f06529a auth_key_id:long date:int device:string location:string = Update;
+
+updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
+
+updates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference;
+updates.difference#f49ca0 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> state:updates.State = updates.Difference;
+updates.differenceSlice#a8fb1981 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> intermediate_state:updates.State = updates.Difference;
+
+updatesTooLong#e317af7e = Updates;
+updateShortMessage#ed5c2127 flags:# id:int user_id:int message:string pts:int pts_count:int date:int fwd_from_id:flags.2?int fwd_date:flags.2?int reply_to_msg_id:flags.3?int = Updates;
+updateShortChatMessage#52238b3c flags:# id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from_id:flags.2?int fwd_date:flags.2?int reply_to_msg_id:flags.3?int = Updates;
+updateShort#78d4dec1 update:Update date:int = Updates;
+updatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;
+updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
+
+photos.photos#8dca6aa5 photos:Vector<Photo> users:Vector<User> = photos.Photos;
+photos.photosSlice#15051f54 count:int photos:Vector<Photo> users:Vector<User> = photos.Photos;
+
+photos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;
+
+upload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;
+
+dcOptionL28#2ec2a43c id:int hostname:string ip_address:string port:int = DcOption;
+dcOption#5d8c6cc flags:int id:int ip_address:string port:int = DcOption;
+
+config#4e32b894 date:int expires:int test_mode:Bool this_dc:int dc_options:Vector<DcOption> chat_size_max:int broadcast_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int chat_big_size:int push_chat_period_ms:int push_chat_limit:int disabled_features:Vector<DisabledFeature> = Config;
+
+nearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;
+
+help.appUpdate#8987f311 id:int critical:Bool url:string text:string = help.AppUpdate;
+help.noAppUpdate#c45a6536 = help.AppUpdate;
+
+help.inviteText#18cb9f78 message:string = help.InviteText;
+
+messages.sentMessageLink#35a1a663 id:int date:int media:MessageMedia pts:int pts_count:int links:Vector<contacts.Link> seq:int = messages.SentMessage;
+
+inputGeoChat#74d456fa chat_id:int access_hash:long = InputGeoChat;
+
+inputNotifyGeoChatPeer#4d8ddec8 geo_peer:InputGeoChat = InputNotifyPeer;
+
+geoChat#75eaea5a id:int access_hash:long title:string address:string venue:string geo:GeoPoint photo:ChatPhoto participants_count:int date:int checked_in:Bool version:int = Chat;
+
+geoChatMessageEmpty#60311a9b chat_id:int id:int = GeoChatMessage;
+geoChatMessage#4505f8e1 chat_id:int id:int from_id:int date:int message:string media:MessageMedia = GeoChatMessage;
+geoChatMessageService#d34fa24e chat_id:int id:int from_id:int date:int action:MessageAction = GeoChatMessage;
+
+geochats.statedMessage#17b1578b message:GeoChatMessage chats:Vector<Chat> users:Vector<User> seq:int = geochats.StatedMessage;
+
+geochats.located#48feb267 results:Vector<ChatLocated> messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Located;
+
+geochats.messages#d1526db1 messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Messages;
+geochats.messagesSlice#bc5863e8 count:int messages:Vector<GeoChatMessage> chats:Vector<Chat> users:Vector<User> = geochats.Messages;
+
+messageActionGeoChatCreate#6f038ebc title:string address:string = MessageAction;
+messageActionGeoChatCheckin#c7d53de = MessageAction;
+
+updateNewGeoChatMessage#5a68e3f7 geo_message:GeoChatMessage = Update;
+
+wallPaperSolid#63117f24 id:int title:string bg_color:int color:int = WallPaper;
+
+updateNewEncryptedMessage#12bcbd9a encr_message:EncryptedMessage qts:int = Update;
+updateEncryptedChatTyping#1710f156 chat_id:int = Update;
+updateEncryption#b4a2e88d encr_chat:EncryptedChat date:int = Update;
+updateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update;
+
+encryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat;
+encryptedChatWaiting#3bf703dc id:int access_hash:long date:int admin_id:int participant_id:int = EncryptedChat;
+encryptedChatRequested#c878527e id:int access_hash:long date:int admin_id:int participant_id:int g_a:bytes = EncryptedChat;
+encryptedChat#fa56ce36 id:int access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long = EncryptedChat;
+encryptedChatDiscarded#13d6dd27 id:int = EncryptedChat;
+
+inputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat;
+
+encryptedFileEmpty#c21f497e = EncryptedFile;
+encryptedFile#4a70994c id:long access_hash:long size:int dc_id:int key_fingerprint:int = EncryptedFile;
+
+inputEncryptedFileEmpty#1837c364 = InputEncryptedFile;
+inputEncryptedFileUploaded#64bd0306 id:long parts:int md5_checksum:string key_fingerprint:int = InputEncryptedFile;
+inputEncryptedFile#5a17b5e5 id:long access_hash:long = InputEncryptedFile;
+
+inputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation;
+
+encryptedMessage#ed18c118 random_id:long chat_id:int date:int bytes:bytes file:EncryptedFile = EncryptedMessage;
+encryptedMessageService#23734b06 random_id:long chat_id:int date:int bytes:bytes = EncryptedMessage;
+
+messages.dhConfigNotModified#c0e24635 random:bytes = messages.DhConfig;
+messages.dhConfig#2c221edd g:int p:bytes version:int random:bytes = messages.DhConfig;
+
+messages.sentEncryptedMessage#560f8935 date:int = messages.SentEncryptedMessage;
+messages.sentEncryptedFile#9493ff32 date:int file:EncryptedFile = messages.SentEncryptedMessage;
+
+inputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;
+
+inputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile;
+
+updateChatParticipantAdd#3a0eeb22 chat_id:int user_id:int inviter_id:int version:int = Update;
+updateChatParticipantDelete#6e5f8c22 chat_id:int user_id:int version:int = Update;
+updateDcOptions#8e5e9873 dc_options:Vector<DcOption> = Update;
+
+inputMediaUploadedAudio#4e498cab file:InputFile duration:int mime_type:string = InputMedia;
+inputMediaAudio#89938781 audio_id:InputAudio = InputMedia;
+inputMediaUploadedDocument#ffe76b78 file:InputFile mime_type:string attributes:Vector<DocumentAttribute> = InputMedia;
+inputMediaUploadedThumbDocument#41481486 file:InputFile thumb:InputFile mime_type:string attributes:Vector<DocumentAttribute> = InputMedia;
+inputMediaDocument#d184e841 document_id:InputDocument = InputMedia;
+
+messageMediaDocument#2fda2204 document:Document = MessageMedia;
+messageMediaAudio#c6b68300 audio:Audio = MessageMedia;
+
+inputAudioEmpty#d95adc84 = InputAudio;
+inputAudio#77d440ff id:long access_hash:long = InputAudio;
+
+inputDocumentEmpty#72f0eaae = InputDocument;
+inputDocument#18798952 id:long access_hash:long = InputDocument;
+
+inputAudioFileLocation#74dc404d id:long access_hash:long = InputFileLocation;
+inputDocumentFileLocation#4e45abe9 id:long access_hash:long = InputFileLocation;
+
+audioEmpty#586988d8 id:long = Audio;
+audio#c7ac6496 id:long access_hash:long user_id:int date:int duration:int mime_type:string size:int dc_id:int = Audio;
+
+documentEmpty#36f8c871 id:long = Document;
+document#f9a39f4f id:long access_hash:long date:int mime_type:string size:int thumb:PhotoSize dc_id:int attributes:Vector<DocumentAttribute> = Document;
+document_l19#9efc6326 id:long access_hash:long user_id:int date:int file_name:string mime_type:string size:int thumb:PhotoSize dc_id:int = Document;
+
+help.support#17c6b5f6 phone_number:string user:User = help.Support;
+
+notifyPeer#9fd40bd8 peer:Peer = NotifyPeer;
+notifyUsers#b4c83b4c = NotifyPeer;
+notifyChats#c007cec3 = NotifyPeer;
+notifyAll#74d07c60 = NotifyPeer;
+
+updateUserBlocked#80ece81a user_id:int blocked:Bool = Update;
+updateNotifySettings#bec268ef notify_peer:NotifyPeer notify_settings:PeerNotifySettings = Update;
+
+auth.sentAppCode#e325edcf phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
+
+sendMessageTypingAction#16bf744e = SendMessageAction;
+sendMessageCancelAction#fd5ec8f5 = SendMessageAction;
+sendMessageRecordVideoAction#a187d66f = SendMessageAction;
+sendMessageUploadVideoActionL27#92042ff7 = SendMessageAction;
+sendMessageUploadVideoAction#e9763aec progress:int = SendMessageAction;
+sendMessageRecordAudioAction#d52f73f7 = SendMessageAction;
+sendMessageUploadAudioActionL27#e6ac8a6f = SendMessageAction;
+sendMessageUploadAudioAction#f351d7ab progress:int = SendMessageAction;
+sendMessageUploadPhotoAction#d1d34a26 progress:int = SendMessageAction;
+sendMessageUploadDocumentActionL27#8faee98e = SendMessageAction;
+sendMessageUploadDocumentAction#aa0cd9e4 progress:int = SendMessageAction;
+sendMessageGeoLocationAction#176f8ba1 = SendMessageAction;
+sendMessageChooseContactAction#628cbc6f = SendMessageAction;
+
+contactFound#ea879f95 user_id:int = ContactFound;
+
+contacts.found#566000e results:Vector<ContactFound> users:Vector<User> = contacts.Found;
+
+updateServiceNotification#382dd3e4 type:string message_text:string media:MessageMedia popup:Bool = Update;
+
+userStatusRecently#e26f42f1 = UserStatus;
+userStatusLastWeek#7bf09fc = UserStatus;
+userStatusLastMonth#77ebc742 = UserStatus;
+
+updatePrivacy#ee3b272a key:PrivacyKey rules:Vector<PrivacyRule> = Update;
+
+inputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey;
+
+privacyKeyStatusTimestamp#bc2eab30 = PrivacyKey;
+
+inputPrivacyValueAllowContacts#d09e07b = InputPrivacyRule;
+inputPrivacyValueAllowAll#184b35ce = InputPrivacyRule;
+inputPrivacyValueAllowUsers#131cc67f users:Vector<InputUser> = InputPrivacyRule;
+inputPrivacyValueDisallowContacts#ba52007 = InputPrivacyRule;
+inputPrivacyValueDisallowAll#d66b66c9 = InputPrivacyRule;
+inputPrivacyValueDisallowUsers#90110467 users:Vector<InputUser> = InputPrivacyRule;
+
+privacyValueAllowContacts#fffe1bac = PrivacyRule;
+privacyValueAllowAll#65427b82 = PrivacyRule;
+privacyValueAllowUsers#4d5bbe0c users:Vector<int> = PrivacyRule;
+privacyValueDisallowContacts#f888fa1a = PrivacyRule;
+privacyValueDisallowAll#8b73e763 = PrivacyRule;
+privacyValueDisallowUsers#c7f49b7 users:Vector<int> = PrivacyRule;
+
+account.privacyRules#554abb6f rules:Vector<PrivacyRule> users:Vector<User> = account.PrivacyRules;
+
+accountDaysTTL#b8d0afdf days:int = AccountDaysTTL;
+
+account.sentChangePhoneCode#a4f58c4c phone_code_hash:string send_call_timeout:int = account.SentChangePhoneCode;
+
+updateUserPhone#12b9417b user_id:int phone:string = Update;
+
+documentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute;
+documentAttributeAnimated#11b58939 = DocumentAttribute;
+documentAttributeStickerL28#994c9882 alt:string = DocumentAttribute;
+documentAttributeSticker#3a556302 alt:string stickerset:InputStickerSet = DocumentAttribute;
+documentAttributeVideo#5910cccb duration:int w:int h:int = DocumentAttribute;
+documentAttributeAudio#51448e5 duration:int = DocumentAttribute;
+documentAttributeFilename#15590068 file_name:string = DocumentAttribute;
+
+messages.stickersNotModified#f1749a22 = messages.Stickers;
+messages.stickers#8a8ecd32 hash:string stickers:Vector<Document> = messages.Stickers;
+
+stickerPack#12b299d4 emoticon:string documents:Vector<long> = StickerPack;
+
+messages.allStickersNotModified#e86602c3 = messages.AllStickers;
+messages.allStickers#5ce352ec hash:string packs:Vector<StickerPack> sets:Vector<StickerSet> documents:Vector<Document> = messages.AllStickers;
+
+disabledFeature#ae636f24 feature:string description:string = DisabledFeature;
+
+updateReadHistoryInbox#9961fd5c peer:Peer max_id:int pts:int pts_count:int = Update;
+updateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update;
+
+messages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages;
+
+contactLinkUnknown#5f4f9247 = ContactLink;
+contactLinkNone#feedd3ad = ContactLink;
+contactLinkHasPhone#268f3f59 = ContactLink;
+contactLinkContact#d502c2d0 = ContactLink;
+
+updateWebPage#2cc36971 webpage:WebPage = Update;
+
+webPageEmpty#eb1477e8 id:long = WebPage;
+webPagePending#c586da1c id:long date:int = WebPage;
+webPage#a31ea0b5 flags:# id:long url:string display_url:string type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string = WebPage;
+
+messageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia;
+
+authorization#7bf2e6f6 hash:long flags:int device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization;
+
+account.authorizations#1250abde authorizations:Vector<Authorization> = account.Authorizations;
+
+account.noPassword#96dabc18 new_salt:bytes email_unconfirmed_pattern:string = account.Password;
+account.password#7c18141c current_salt:bytes new_salt:bytes hint:string has_recovery:Bool email_unconfirmed_pattern:string = account.Password;
+
+account.passwordSettings#b7b72ab3 email:string = account.PasswordSettings;
+
+account.passwordInputSettings#bcfc532c flags:# new_salt:flags.0?bytes new_password_hash:flags.0?bytes hint:flags.0?string email:flags.1?string = account.PasswordInputSettings;
+
+auth.passwordRecovery#137948a5 email_pattern:string = auth.PasswordRecovery;
+
+inputMediaVenue#2827a81a geo_point:InputGeoPoint title:string address:string provider:string venue_id:string = InputMedia;
+
+messageMediaVenue#7912b71f geo:GeoPoint title:string address:string provider:string venue_id:string = MessageMedia;
+
+receivedNotifyMessage#a384b779 id:int flags:int = ReceivedNotifyMessage;
+
+chatInviteEmpty#69df3769 = ExportedChatInvite;
+chatInviteExported#fc2e05bc link:string = ExportedChatInvite;
+
+chatInviteAlready#5a686d7c chat:Chat = ChatInvite;
+chatInvite#ce917dcd title:string = ChatInvite;
+
+messageActionChatJoinedByLink#f89cf5e8 inviter_id:int = MessageAction;
+
+updateReadMessagesContents#68c13933 messages:Vector<int> pts:int pts_count:int = Update;
+
+inputStickerSetEmpty#ffb62b95 = InputStickerSet;
+inputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet;
+inputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet;
+
+stickerSet#a7a43b17 id:long access_hash:long title:string short_name:string = StickerSet;
+
+messages.stickerSet#b60a24a6 set:StickerSet packs:Vector<StickerPack> documents:Vector<Document> = messages.StickerSet;
+
+user#22e49072 flags:# id:int access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int = User;
+
+botCommand#c27ac8c7 command:string description:string = BotCommand;
+botCommandOld#b79d22ab command:string params:string description:string = BotCommand;
+
+botInfoEmpty#bb2e37ce = BotInfo;
+botInfo#9cf585d user_id:int version:int share_text:string description:string commands:Vector<BotCommand> = BotInfo;
+
+keyboardButton#a2fa4880 text:string = KeyboardButton;
+
+keyboardButtonRow#77608b83 buttons:Vector<KeyboardButton> = KeyboardButtonRow;
+
+replyKeyboardHide#a03e5b85 flags:int = ReplyMarkup;
+replyKeyboardForceReply#f4108aa0 flags:int = ReplyMarkup;
+replyKeyboardMarkup#3502758c flags:int rows:Vector<KeyboardButtonRow> = ReplyMarkup;
+
+---functions---
+
+invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
+
+invokeAfterMsgs#3dc4b4f0 {X:Type} msg_ids:Vector<long> query:!X = X;
+
+auth.checkPhone#6fe51dfb phone_number:string = auth.CheckedPhone;
+auth.sendCode#768d5f4d phone_number:string sms_type:int api_id:int api_hash:string lang_code:string = auth.SentCode;
+auth.sendCall#3c51564 phone_number:string phone_code_hash:string = Bool;
+auth.signUp#1b067634 phone_number:string phone_code_hash:string phone_code:string first_name:string last_name:string = auth.Authorization;
+auth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:string = auth.Authorization;
+auth.logOut#5717da40 = Bool;
+auth.resetAuthorizations#9fab0d1a = Bool;
+auth.sendInvites#771c1d97 phone_numbers:Vector<string> message:string = Bool;
+auth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization;
+auth.importAuthorization#e3ef9613 id:int bytes:bytes = auth.Authorization;
+auth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool;
+
+account.registerDevice#446c712c token_type:int token:string device_model:string system_version:string app_version:string app_sandbox:Bool lang_code:string = Bool;
+account.unregisterDevice#65c55b40 token_type:int token:string = Bool;
+account.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool;
+account.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings;
+account.resetNotifySettings#db7e1747 = Bool;
+account.updateProfile#f0888d68 first_name:string last_name:string = User;
+account.updateStatus#6628562c offline:Bool = Bool;
+account.getWallPapers#c04cfac2 = Vector<WallPaper>;
+
+users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
+users.getFullUser#ca30a5b1 id:InputUser = UserFull;
+
+contacts.getStatuses#c4a353ee = Vector<ContactStatus>;
+contacts.getContacts#22c6aa08 hash:string = contacts.Contacts;
+contacts.importContacts#da30b32d contacts:Vector<InputContact> replace:Bool = contacts.ImportedContacts;
+contacts.getSuggested#cd773428 limit:int = contacts.Suggested;
+contacts.deleteContact#8e953744 id:InputUser = contacts.Link;
+contacts.deleteContacts#59ab389e id:Vector<InputUser> = Bool;
+contacts.block#332b49fc id:InputUser = Bool;
+contacts.unblock#e54100bd id:InputUser = Bool;
+contacts.getBlocked#f57c350f offset:int limit:int = contacts.Blocked;
+contacts.exportCard#84e53737 = Vector<int>;
+contacts.importCard#4fe196fe export_card:Vector<int> = User;
+
+messages.getMessages#4222fa74 id:Vector<int> = messages.Messages;
+messages.getDialogs#eccf1df6 offset:int max_id:int limit:int = messages.Dialogs;
+messages.getHistory#92a1df2f peer:InputPeer offset:int max_id:int limit:int = messages.Messages;
+messages.search#7e9f2ab peer:InputPeer q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = messages.Messages;
+messages.readHistory#b04f2510 peer:InputPeer max_id:int offset:int = messages.AffectedHistory;
+messages.deleteHistory#f4f8fb61 peer:InputPeer offset:int = messages.AffectedHistory;
+messages.deleteMessages#a5f18925 id:Vector<int> = messages.AffectedMessages;
+messages.receivedMessages#5a954c0 max_id:int = Vector<ReceivedNotifyMessage>;
+messages.setTyping#a3825e50 peer:InputPeer action:SendMessageAction = Bool;
+messages.sendMessage#fc55e6b5 flags:# peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long reply_markup:flags.2?ReplyMarkup = messages.SentMessage;
+messages.sendMedia#c8f16791 flags:# peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia random_id:long reply_markup:flags.2?ReplyMarkup = Updates;
+messages.forwardMessages#55e1728d peer:InputPeer id:Vector<int> random_id:Vector<long> = Updates;
+messages.getChats#3c6aa187 id:Vector<int> = messages.Chats;
+messages.getFullChat#3b831c66 chat_id:int = messages.ChatFull;
+messages.editChatTitle#dc452855 chat_id:int title:string = Updates;
+messages.editChatPhoto#ca4c79d8 chat_id:int photo:InputChatPhoto = Updates;
+messages.addChatUser#f9a0aa09 chat_id:int user_id:InputUser fwd_limit:int = Updates;
+messages.deleteChatUser#e0611f16 chat_id:int user_id:InputUser = Updates;
+messages.createChat#9cb126e users:Vector<InputUser> title:string = Updates;
+
+updates.getState#edd4882a = updates.State;
+updates.getDifference#a041495 pts:int date:int qts:int = updates.Difference;
+
+photos.updateProfilePhoto#eef579a0 id:InputPhoto crop:InputPhotoCrop = UserProfilePhoto;
+photos.uploadProfilePhoto#d50f9c88 file:InputFile caption:string geo_point:InputGeoPoint crop:InputPhotoCrop = photos.Photo;
+photos.deletePhotos#87cf7f2f id:Vector<InputPhoto> = Vector<long>;
+
+upload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool;
+upload.getFile#e3a6cfb5 location:InputFileLocation offset:int limit:int = upload.File;
+
+help.getConfig#c4f9186b = Config;
+help.getNearestDc#1fb33026 = NearestDc;
+help.getAppUpdate#c812ac7e device_model:string system_version:string app_version:string lang_code:string = help.AppUpdate;
+help.saveAppLog#6f02f748 events:Vector<InputAppEvent> = Bool;
+help.getInviteText#a4a95186 lang_code:string = help.InviteText;
+
+photos.getUserPhotos#b7ee553c user_id:InputUser offset:int max_id:int limit:int = photos.Photos;
+
+messages.forwardMessage#33963bf9 peer:InputPeer id:int random_id:long = Updates;
+messages.sendBroadcast#bf73f4da contacts:Vector<InputUser> random_id:Vector<long> message:string media:InputMedia = Updates;
+
+geochats.getLocated#7f192d8f geo_point:InputGeoPoint radius:int limit:int = geochats.Located;
+geochats.getRecents#e1427e6f offset:int limit:int = geochats.Messages;
+geochats.checkin#55b3e8fb peer:InputGeoChat = geochats.StatedMessage;
+geochats.getFullChat#6722dd6f peer:InputGeoChat = messages.ChatFull;
+geochats.editChatTitle#4c8e2273 peer:InputGeoChat title:string address:string = geochats.StatedMessage;
+geochats.editChatPhoto#35d81a95 peer:InputGeoChat photo:InputChatPhoto = geochats.StatedMessage;
+geochats.search#cfcdc44d peer:InputGeoChat q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = geochats.Messages;
+geochats.getHistory#b53f7a68 peer:InputGeoChat offset:int max_id:int limit:int = geochats.Messages;
+geochats.setTyping#8b8a729 peer:InputGeoChat typing:Bool = Bool;
+geochats.sendMessage#61b0044 peer:InputGeoChat message:string random_id:long = geochats.StatedMessage;
+geochats.sendMedia#b8f0deff peer:InputGeoChat media:InputMedia random_id:long = geochats.StatedMessage;
+geochats.createGeoChat#e092e16 title:string geo_point:InputGeoPoint address:string venue:string = geochats.StatedMessage;
+
+messages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig;
+messages.requestEncryption#f64daf43 user_id:InputUser random_id:int g_a:bytes = EncryptedChat;
+messages.acceptEncryption#3dbc0415 peer:InputEncryptedChat g_b:bytes key_fingerprint:long = EncryptedChat;
+messages.discardEncryption#edd923c5 chat_id:int = Bool;
+messages.setEncryptedTyping#791451ed peer:InputEncryptedChat typing:Bool = Bool;
+messages.readEncryptedHistory#7f4b690a peer:InputEncryptedChat max_date:int = Bool;
+messages.sendEncrypted#a9776773 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
+messages.sendEncryptedFile#9a901b66 peer:InputEncryptedChat random_id:long data:bytes file:InputEncryptedFile = messages.SentEncryptedMessage;
+messages.sendEncryptedService#32d439a4 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
+messages.receivedQueue#55a5bb66 max_qts:int = Vector<long>;
+
+upload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool;
+
+initConnection#69796de9 {X:Type} api_id:int device_model:string system_version:string app_version:string lang_code:string query:!X = X;
+
+help.getSupport#9cdf08cd = help.Support;
+
+auth.sendSms#da9f3e8 phone_number:string phone_code_hash:string = Bool;
+
+messages.readMessageContents#36a73f77 id:Vector<int> = messages.AffectedMessages;
+
+account.checkUsername#2714d86c username:string = Bool;
+account.updateUsername#3e0bdd7c username:string = User;
+
+contacts.search#11f812d8 q:string limit:int = contacts.Found;
+
+account.getPrivacy#dadbc950 key:InputPrivacyKey = account.PrivacyRules;
+account.setPrivacy#c9f81ce8 key:InputPrivacyKey rules:Vector<InputPrivacyRule> = account.PrivacyRules;
+account.deleteAccount#418d4e0b reason:string = Bool;
+account.getAccountTTL#8fc711d = AccountDaysTTL;
+account.setAccountTTL#2442485e ttl:AccountDaysTTL = Bool;
+
+invokeWithLayer#da9b0d0d {X:Type} layer:int query:!X = X;
+
+contacts.resolveUsername#bf0131c username:string = User;
+
+account.sendChangePhoneCode#a407a8f4 phone_number:string = account.SentChangePhoneCode;
+account.changePhone#70c32edb phone_number:string phone_code_hash:string phone_code:string = User;
+
+messages.getStickers#ae22e045 emoticon:string hash:string = messages.Stickers;
+messages.getAllStickers#aa3bc868 hash:string = messages.AllStickers;
+
+account.updateDeviceLocked#38df3532 period:int = Bool;
+
+auth.importBotAuthorization#67a3ff2c flags:int api_id:int api_hash:string bot_auth_token:string = auth.Authorization;
+
+messages.getWebPagePreview#25223e24 message:string = MessageMedia;
+
+account.getAuthorizations#e320c158 = account.Authorizations;
+account.resetAuthorization#df77f3bc hash:long = Bool;
+account.getPassword#548a30f5 = account.Password;
+account.getPasswordSettings#bc8d11bb current_password_hash:bytes = account.PasswordSettings;
+account.updatePasswordSettings#fa7c4b86 current_password_hash:bytes new_settings:account.PasswordInputSettings = Bool;
+
+auth.checkPassword#a63011e password_hash:bytes = auth.Authorization;
+auth.requestPasswordRecovery#d897bc66 = auth.PasswordRecovery;
+auth.recoverPassword#4ea56e92 code:string = auth.Authorization;
+
+invokeWithoutUpdates#bf9459b7 {X:Type} query:!X = X;
+
+messages.exportChatInvite#7d885289 chat_id:int = ExportedChatInvite;
+messages.checkChatInvite#3eadb1bb hash:string = ChatInvite;
+messages.importChatInvite#6c50051c hash:string = Updates;
+messages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet;
+messages.installStickerSet#efbbfae9 stickerset:InputStickerSet = Bool;
+messages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool;
+messages.startBot#1b3e0ffc bot:InputUser chat_id:int random_id:long start_param:string = Updates;
diff --git a/protocols/Telegram/tgl/structures.c b/protocols/Telegram/tgl/structures.c
new file mode 100644
index 0000000000..a680e4c415
--- /dev/null
+++ b/protocols/Telegram/tgl/structures.c
@@ -0,0 +1,2311 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Vitaly Valtman 2013-2015
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <assert.h>
+#include <string.h>
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#include "tgl-structures.h"
+#include "mtproto-common.h"
+//#include "telegram.h"
+#include "tree.h"
+#include <openssl/aes.h>
+#include <openssl/bn.h>
+#include <openssl/sha.h>
+#include "queries.h"
+#include "tgl-binlog.h"
+#include "tgl-methods-in.h"
+#include "updates.h"
+#include "mtproto-client.h"
+
+#include "tgl.h"
+#include "auto.h"
+#include "auto/auto-types.h"
+#include "auto/auto-skip.h"
+#include "auto/auto-fetch-ds.h"
+#include "auto/auto-free-ds.h"
+
+#define sha1 SHA1
+#if defined(WIN32) || defined(_WIN32)
+#define bzero(b,len) (memset((b), '\0', (len)) )
+#endif
+
+struct random2local {
+ long long random_id;
+ int local_id;
+};
+
+static int id_cmp (struct tgl_message *M1, struct tgl_message *M2);
+#define peer_cmp(a,b) (tgl_cmp_peer_id (a->id, b->id))
+#define peer_cmp_name(a,b) (strcmp (a->print_name, b->print_name))
+
+static int random_id_cmp (struct random2local *L, struct random2local *R) {
+ if (L->random_id < R->random_id) { return -1; }
+ if (L->random_id > R->random_id) { return 1; }
+ return 0;
+}
+
+static int photo_id_cmp (struct tgl_photo *L, struct tgl_photo *R) {
+ if (L->id < R->id) { return -1; }
+ if (L->id > R->id) { return 1; }
+ return 0;
+}
+
+static int document_id_cmp (struct tgl_document *L, struct tgl_document *R) {
+ if (L->id < R->id) { return -1; }
+ if (L->id > R->id) { return 1; }
+ return 0;
+}
+
+static int webpage_id_cmp (struct tgl_webpage *L, struct tgl_webpage *R) {
+ if (L->id < R->id) { return -1; }
+ if (L->id > R->id) { return 1; }
+ return 0;
+}
+
+DEFINE_TREE(peer,tgl_peer_t *,peer_cmp,0)
+DEFINE_TREE(peer_by_name,tgl_peer_t *,peer_cmp_name,0)
+DEFINE_TREE(message,struct tgl_message *,id_cmp,0)
+DEFINE_TREE(random_id,struct random2local *, random_id_cmp,0)
+DEFINE_TREE(photo,struct tgl_photo *,photo_id_cmp,0)
+DEFINE_TREE(document,struct tgl_document *,document_id_cmp,0)
+DEFINE_TREE(webpage,struct tgl_webpage *,webpage_id_cmp,0)
+
+
+char *tgls_default_create_print_name (struct tgl_state *TLS, tgl_peer_id_t id, const char *a1, const char *a2, const char *a3, const char *a4) {
+ const char *d[4];
+ d[0] = a1; d[1] = a2; d[2] = a3; d[3] = a4;
+ static char buf[10000];
+ buf[0] = 0;
+ int i;
+ int p = 0;
+ for (i = 0; i < 4; i++) {
+ if (d[i] && strlen (d[i])) {
+ p += tsnprintf (buf + p, 9999 - p, "%s%s", p ? "_" : "", d[i]);
+ assert (p < 9990);
+ }
+ }
+ char *s = buf;
+ while (*s) {
+ if (((unsigned char)*s) <= ' ') { *s = '_'; }
+ if (*s == '#') { *s = '@'; }
+ s++;
+ }
+ s = buf;
+ int fl = strlen (s);
+ int cc = 0;
+ while (1) {
+ tgl_peer_t *P = tgl_peer_get_by_name (TLS, s);
+ if (!P || !tgl_cmp_peer_id (P->id, id)) {
+ break;
+ }
+ cc ++;
+ assert (cc <= 9999);
+ tsnprintf (s + fl, 9999 - fl, "#%d", cc);
+ }
+ return tstrdup (s);
+}
+
+enum tgl_typing_status tglf_fetch_typing_new (struct tl_ds_send_message_action *DS_SMA) {
+ if (!DS_SMA) { return 0; }
+ switch (DS_SMA->magic) {
+ case CODE_send_message_typing_action:
+ return tgl_typing_typing;
+ case CODE_send_message_cancel_action:
+ return tgl_typing_cancel;
+ case CODE_send_message_record_video_action:
+ return tgl_typing_record_video;
+ case CODE_send_message_upload_video_action:
+ return tgl_typing_upload_video;
+ case CODE_send_message_record_audio_action:
+ return tgl_typing_record_audio;
+ case CODE_send_message_upload_audio_action:
+ return tgl_typing_upload_audio;
+ case CODE_send_message_upload_photo_action:
+ return tgl_typing_upload_photo;
+ case CODE_send_message_upload_document_action:
+ return tgl_typing_upload_document;
+ case CODE_send_message_geo_location_action:
+ return tgl_typing_geo;
+ case CODE_send_message_choose_contact_action:
+ return tgl_typing_choose_contact;
+ default:
+ assert (0);
+ return tgl_typing_none;
+ }
+}
+
+enum tgl_typing_status tglf_fetch_typing (void) {
+ struct tl_ds_send_message_action *DS_SMA = fetch_ds_type_send_message_action (TYPE_TO_PARAM (send_message_action));
+ enum tgl_typing_status res = tglf_fetch_typing_new (DS_SMA);
+ free_ds_type_send_message_action (DS_SMA, TYPE_TO_PARAM (send_message_action));
+ return res;
+}
+
+/* {{{ Fetch */
+
+int tglf_fetch_file_location_new (struct tgl_state *TLS, struct tgl_file_location *loc, struct tl_ds_file_location *DS_FL) {
+ if (!DS_FL) { return 0; }
+ loc->dc = DS_LVAL (DS_FL->dc_id);
+ loc->volume = DS_LVAL (DS_FL->volume_id);
+ loc->local_id = DS_LVAL (DS_FL->local_id);
+ loc->secret = DS_LVAL (DS_FL->secret);
+ return 0;
+}
+
+int tglf_fetch_user_status_new (struct tgl_state *TLS, struct tgl_user_status *S, struct tgl_user *U, struct tl_ds_user_status *DS_US) {
+ if (!DS_US) { return 0; }
+ switch (DS_US->magic) {
+ case CODE_user_status_empty:
+ if (S->online) {
+ tgl_insert_status_update (TLS, U);
+ if (S->online == 1) {
+ tgl_remove_status_expire (TLS, U);
+ }
+ }
+ S->online = 0;
+ S->when = 0;
+ break;
+ case CODE_user_status_online:
+ {
+ if (S->online != 1) {
+ S->when = DS_LVAL (DS_US->expires);
+ if (S->online) {
+ tgl_insert_status_update (TLS, U);
+ }
+ tgl_insert_status_expire (TLS, U);
+ S->online = 1;
+ } else {
+ if (DS_LVAL (DS_US->expires) != S->when) {
+ S->when = DS_LVAL (DS_US->expires);
+ tgl_remove_status_expire (TLS, U);
+ tgl_insert_status_expire (TLS, U);
+ }
+ }
+ }
+ break;
+ case CODE_user_status_offline:
+ if (S->online != -1) {
+ if (S->online) {
+ tgl_insert_status_update (TLS, U);
+ }
+ if (S->online == 1) {
+ tgl_remove_status_expire (TLS, U);
+ }
+ }
+ S->online = -1;
+ S->when = DS_LVAL (DS_US->was_online);
+ break;
+ case CODE_user_status_recently:
+ if (S->online != -2) {
+ if (S->online) {
+ tgl_insert_status_update (TLS, U);
+ }
+ if (S->online == 1) {
+ tgl_remove_status_expire (TLS, U);
+ }
+ }
+ S->online = -2;
+ break;
+ case CODE_user_status_last_week:
+ if (S->online != -3) {
+ if (S->online) {
+ tgl_insert_status_update (TLS, U);
+ }
+ if (S->online == 1) {
+ tgl_remove_status_expire (TLS, U);
+ }
+ }
+ S->online = -3;
+ break;
+ case CODE_user_status_last_month:
+ if (S->online != -4) {
+ if (S->online) {
+ tgl_insert_status_update (TLS, U);
+ }
+ if (S->online == 1) {
+ tgl_remove_status_expire (TLS, U);
+ }
+ }
+ S->online = -4;
+ break;
+ default:
+ assert (0);
+ }
+ return 0;
+}
+
+int tglf_fetch_user_new (struct tgl_state *TLS, struct tgl_user *U, struct tl_ds_user *DS_U) {
+ if (!DS_U) { return 0; }
+ U->id = TGL_MK_USER (DS_LVAL (DS_U->id));
+ if (DS_U->magic == CODE_user_empty) {
+ return 0;
+ }
+
+ int flags = U->flags & 0xffff;
+
+ if (DS_LVAL (DS_U->flags) & (1 << 10)) {
+ bl_do_set_our_id (TLS, tgl_get_peer_id (U->id));
+ flags |= TGLUF_SELF;
+ }
+
+ if (DS_LVAL (DS_U->flags) & (1 << 11)) {
+ flags |= TGLUF_CONTACT;
+ }
+
+ if (DS_LVAL (DS_U->flags) & (1 << 12)) {
+ flags |= TGLUF_MUTUAL_CONTACT;
+ }
+
+
+ if (DS_LVAL (DS_U->flags) & (1 << 14)) {
+ flags |= TGLUF_BOT;
+ }
+ /*
+ if (DS_LVAL (DS_U->flags) & (1 << 15)) {
+ flags |= TGLUF_BOT_FULL_ACCESS;
+ }
+
+ if (DS_LVAL (DS_U->flags) & (1 << 16)) {
+ flags |= TGLUF_BOT_NO_GROUPS;
+ }*/
+
+ if (!(flags & TGLUF_CREATED)) {
+ flags |= TGLUF_CREATE | TGLUF_CREATED;
+ }
+
+ bl_do_user_new (TLS, tgl_get_peer_id (U->id),
+ DS_U->access_hash,
+ DS_STR (DS_U->first_name),
+ DS_STR (DS_U->last_name),
+ DS_STR (DS_U->phone),
+ DS_STR (DS_U->username),
+ NULL,
+ NULL, 0, NULL, 0,
+ DS_U->photo,
+ NULL, NULL,
+ NULL,
+ flags
+ );
+
+ if (DS_U->status) {
+ assert (tglf_fetch_user_status_new (TLS, &U->status, U, DS_U->status) >= 0);
+ }
+
+ if (DS_LVAL (DS_U->flags) & (1 << 13)) {
+ if (!(U->flags & TGLUF_DELETED)) {
+ bl_do_user_delete (TLS, U);
+ }
+ }
+
+ return 0;
+}
+
+void tglf_fetch_user_full_new (struct tgl_state *TLS, struct tgl_user *U, struct tl_ds_user_full *DS_UF) {
+ if (!DS_UF) { return; }
+
+ tglf_fetch_user_new (TLS, U, DS_UF->user);
+
+ int flags = U->flags & 0xffff;
+
+ if (DS_BVAL (DS_UF->blocked)) {
+ flags |= TGLUF_BLOCKED;
+ } else {
+ flags &= ~TGLUF_BLOCKED;
+ }
+
+ bl_do_user_new (TLS, tgl_get_peer_id (U->id),
+ NULL,
+ NULL, 0,
+ NULL, 0,
+ NULL, 0,
+ NULL, 0,
+ DS_UF->profile_photo,
+ //DS_STR (DS_UF->real_first_name), DS_STR (DS_UF->real_last_name),
+ NULL, 0, NULL, 0,
+ NULL,
+ NULL, NULL,
+ DS_UF->bot_info,
+ flags
+ );
+}
+
+void str_to_256 (unsigned char *dst, char *src, int src_len) {
+ if (src_len >= 256) {
+ memcpy (dst, src + src_len - 256, 256);
+ } else {
+ bzero (dst, 256 - src_len);
+ memcpy (dst + 256 - src_len, src, src_len);
+ }
+}
+
+void str_to_32 (unsigned char *dst, char *src, int src_len) {
+ if (src_len >= 32) {
+ memcpy (dst, src + src_len - 32, 32);
+ } else {
+ bzero (dst, 32 - src_len);
+ memcpy (dst + 32 - src_len, src, src_len);
+ }
+}
+
+void tglf_fetch_encrypted_chat_new (struct tgl_state *TLS, struct tgl_secret_chat *U, struct tl_ds_encrypted_chat *DS_EC) {
+ if (!DS_EC) { return; }
+ U->id = TGL_MK_ENCR_CHAT (DS_LVAL (DS_EC->id));
+ if (DS_EC->magic == CODE_encrypted_chat_empty) {
+ return;
+ }
+ int new = !(U->flags & TGLPF_CREATED);
+
+ if (DS_EC->magic == CODE_encrypted_chat_discarded) {
+ if (new) {
+ vlogprintf (E_WARNING, "Unknown chat in deleted state. May be we forgot something...\n");
+ return;
+ }
+ bl_do_encr_chat_delete (TLS, U);
+ //write_secret_chat_file ();
+ return;
+ }
+
+ static unsigned char g_key[256];
+ if (new) {
+ if (DS_EC->magic != CODE_encrypted_chat_requested) {
+ vlogprintf (E_WARNING, "Unknown chat. May be we forgot something...\n");
+ return;
+ }
+
+ str_to_256 (g_key, DS_STR (DS_EC->g_a));
+
+ int user_id = DS_LVAL (DS_EC->participant_id) + DS_LVAL (DS_EC->admin_id) - TLS->our_id;
+ int r = sc_request;
+ bl_do_encr_chat_new (TLS, tgl_get_peer_id (U->id),
+ DS_EC->access_hash,
+ DS_EC->date,
+ DS_EC->admin_id,
+ &user_id,
+ NULL,
+ (void *)g_key,
+ NULL,
+ &r,
+ NULL, NULL, NULL, NULL, NULL,
+ NULL,
+ TGLECF_CREATE | TGLECF_CREATED
+ );
+ } else {
+ if (DS_EC->magic == CODE_encrypted_chat_waiting) {
+ int r = sc_waiting;
+ bl_do_encr_chat_new (TLS, tgl_get_peer_id (U->id),
+ DS_EC->access_hash,
+ DS_EC->date,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ &r,
+ NULL, NULL, NULL, NULL, NULL,
+ NULL,
+ TGL_FLAGS_UNCHANGED
+ );
+ return; // We needed only access hash from here
+ }
+
+ str_to_256 (g_key, DS_STR (DS_EC->g_a_or_b));
+
+ //write_secret_chat_file ();
+ int r = sc_ok;
+ bl_do_encr_chat_new (TLS, tgl_get_peer_id (U->id),
+ DS_EC->access_hash,
+ DS_EC->date,
+ NULL,
+ NULL,
+ NULL,
+ g_key,
+ NULL,
+ &r,
+ NULL, NULL, NULL, NULL, NULL,
+ DS_EC->key_fingerprint,
+ TGL_FLAGS_UNCHANGED
+ );
+ }
+}
+
+void tglf_fetch_chat_new (struct tgl_state *TLS, struct tgl_chat *C, struct tl_ds_chat *DS_C) {
+ if (!DS_C) { return; }
+
+ C->id = TGL_MK_CHAT (DS_LVAL (DS_C->id));
+ if (DS_C->magic == CODE_chat_empty) {
+ return;
+ }
+
+ int flags = C->flags & 0xffff;
+ if (!(flags & TGLCF_CREATED)) {
+ flags |= TGLCF_CREATE | TGLCF_CREATED;
+ }
+
+ bl_do_chat_new (TLS, tgl_get_peer_id (C->id),
+ DS_STR (DS_C->title),
+ DS_C->participants_count,
+ DS_C->date,
+ NULL,
+ NULL,
+ DS_C->photo,
+ NULL,
+ NULL,
+ NULL, NULL,
+ flags
+ );
+}
+
+void tglf_fetch_chat_full_new (struct tgl_state *TLS, struct tgl_chat *C, struct tl_ds_messages_chat_full *DS_MCF) {
+ if (!DS_MCF) { return; }
+ struct tl_ds_chat_full *DS_CF = DS_MCF->full_chat;
+
+ C->id = TGL_MK_CHAT (DS_LVAL (DS_CF->id));
+
+ bl_do_chat_new (TLS, tgl_get_peer_id (C->id),
+ NULL, 0,
+ NULL,
+ NULL,
+ DS_CF->participants->version,
+ (struct tl_ds_vector *)DS_CF->participants->participants,
+ NULL,
+ DS_CF->chat_photo,
+ DS_CF->participants->admin_id,
+ NULL, NULL,
+ C->flags & 0xffff
+ );
+
+ if (DS_MCF->users) {
+ int i;
+ for (i = 0; i < DS_LVAL (DS_MCF->users->cnt); i++) {
+ tglf_fetch_alloc_user_new (TLS, DS_MCF->users->data[i]);
+ }
+ }
+
+ if (DS_MCF->chats) {
+ int i;
+ for (i = 0; i < DS_LVAL (DS_MCF->chats->cnt); i++) {
+ tglf_fetch_alloc_chat_new (TLS, DS_MCF->chats->data[i]);
+ }
+ }
+
+ if (DS_CF->bot_info) {
+ int n = DS_LVAL (DS_CF->bot_info->cnt);
+ int i;
+ for (i = 0; i < n; i++) {
+ struct tl_ds_bot_info *DS_BI = DS_CF->bot_info->data[i];
+
+ tgl_peer_t *P = tgl_peer_get (TLS, TGL_MK_USER (DS_LVAL (DS_BI->user_id)));
+ if (P && (P->flags & TGLCF_CREATED)) {
+ bl_do_user_new (TLS, tgl_get_peer_id (P->id),
+ NULL,
+ NULL, 0,
+ NULL, 0,
+ NULL, 0,
+ NULL, 0,
+ NULL,
+ NULL, 0, NULL, 0,
+ NULL,
+ NULL, NULL,
+ DS_BI,
+ TGL_FLAGS_UNCHANGED
+ );
+ }
+ }
+ }
+}
+
+void tglf_fetch_photo_size_new (struct tgl_state *TLS, struct tgl_photo_size *S, struct tl_ds_photo_size *DS_PS) {
+ memset (S, 0, sizeof (*S));
+
+ S->type = DS_STR_DUP (DS_PS->type);
+ S->w = DS_LVAL (DS_PS->w);
+ S->h = DS_LVAL (DS_PS->h);
+ S->size = DS_LVAL (DS_PS->size);
+ if (DS_PS->bytes) {
+ S->size = DS_PS->bytes->len;
+ }
+
+ tglf_fetch_file_location_new (TLS, &S->loc, DS_PS->location);
+}
+
+void tglf_fetch_geo_new (struct tgl_state *TLS, struct tgl_geo *G, struct tl_ds_geo_point *DS_GP) {
+ G->longitude = DS_LVAL (DS_GP->longitude);
+ G->latitude = DS_LVAL (DS_GP->latitude);
+}
+
+struct tgl_photo *tglf_fetch_alloc_photo_new (struct tgl_state *TLS, struct tl_ds_photo *DS_P) {
+ if (!DS_P) { return NULL; }
+ if (DS_P->magic == CODE_photo_empty) { return NULL; }
+
+ struct tgl_photo *P = tgl_photo_get (TLS, DS_LVAL (DS_P->id));
+ if (P) {
+ P->refcnt ++;
+ return P;
+ }
+
+
+ P = talloc0 (sizeof (*P));
+ P->id = DS_LVAL (DS_P->id);
+ P->refcnt = 1;
+
+ tgl_photo_insert (TLS, P);
+
+ P->access_hash = DS_LVAL (DS_P->access_hash);
+ P->user_id = DS_LVAL (DS_P->user_id);
+ P->date = DS_LVAL (DS_P->date);
+ P->caption = NULL;//DS_STR_DUP (DS_P->caption);
+ tglf_fetch_geo_new (TLS, &P->geo, DS_P->geo);
+
+ P->sizes_num = DS_LVAL (DS_P->sizes->cnt);
+ P->sizes = talloc (sizeof (struct tgl_photo_size) * P->sizes_num);
+ int i;
+ for (i = 0; i < P->sizes_num; i++) {
+ tglf_fetch_photo_size_new (TLS, &P->sizes[i], DS_P->sizes->data[i]);
+ }
+
+ return P;
+}
+
+struct tgl_document *tglf_fetch_alloc_video_new (struct tgl_state *TLS, struct tl_ds_video *DS_V) {
+ if (!DS_V) { return NULL; }
+
+ if (DS_V->magic == CODE_video_empty) { return NULL; }
+
+ struct tgl_document *D = tgl_document_get (TLS, DS_LVAL (DS_V->id));
+ if (D) {
+ D->refcnt ++;
+ return D;
+ }
+
+
+ D = talloc0 (sizeof (*D));
+ D->id = DS_LVAL (DS_V->id);
+ D->refcnt = 1;
+
+ tgl_document_insert (TLS, D);
+
+ D->flags = TGLDF_VIDEO;
+
+ D->access_hash = DS_LVAL (DS_V->access_hash);
+ D->user_id = DS_LVAL (DS_V->user_id);
+ D->date = DS_LVAL (DS_V->date);
+ D->caption = NULL;//DS_STR_DUP (DS_V->caption);
+ D->duration = DS_LVAL (DS_V->duration);
+ D->mime_type = tstrdup ("video/");//DS_STR_DUP (DS_V->mime_type);
+ D->size = DS_LVAL (DS_V->size);
+ tglf_fetch_photo_size_new (TLS, &D->thumb, DS_V->thumb);
+
+ D->dc_id = DS_LVAL (DS_V->dc_id);
+ D->w = DS_LVAL (DS_V->w);
+ D->h = DS_LVAL (DS_V->h);
+ return D;
+}
+
+struct tgl_document *tglf_fetch_alloc_audio_new (struct tgl_state *TLS, struct tl_ds_audio *DS_A) {
+ if (!DS_A) { return NULL; }
+
+ if (DS_A->magic == CODE_audio_empty) { return NULL; }
+
+ struct tgl_document *D = tgl_document_get (TLS, DS_LVAL (DS_A->id));
+ if (D) {
+ D->refcnt ++;
+ return D;
+ }
+
+
+ D = talloc0 (sizeof (*D));
+ D->id = DS_LVAL (DS_A->id);
+ D->refcnt = 1;
+
+ tgl_document_insert (TLS, D);
+
+ D->flags = TGLDF_AUDIO;
+
+ D->access_hash = DS_LVAL (DS_A->access_hash);
+ D->user_id = DS_LVAL (DS_A->user_id);
+ D->date = DS_LVAL (DS_A->date);
+ D->duration = DS_LVAL (DS_A->duration);
+ D->mime_type = DS_STR_DUP (DS_A->mime_type);
+ D->size = DS_LVAL (DS_A->size);
+ D->dc_id = DS_LVAL (DS_A->dc_id);
+
+ return D;
+}
+
+void tglf_fetch_document_attribute_new (struct tgl_state *TLS, struct tgl_document *D, struct tl_ds_document_attribute *DS_DA) {
+ switch (DS_DA->magic) {
+ case CODE_document_attribute_image_size:
+ D->flags |= TGLDF_IMAGE;
+ D->w = DS_LVAL (DS_DA->w);
+ D->h = DS_LVAL (DS_DA->h);
+ return;
+ case CODE_document_attribute_animated:
+ D->flags |= TGLDF_ANIMATED;
+ return;
+ case CODE_document_attribute_sticker:
+ case CODE_document_attribute_sticker_l28:
+ D->flags |= TGLDF_STICKER;
+ return;
+ case CODE_document_attribute_video:
+ D->flags |= TGLDF_VIDEO;
+ D->duration = DS_LVAL (DS_DA->duration);
+ D->w = DS_LVAL (DS_DA->w);
+ D->h = DS_LVAL (DS_DA->h);
+ return;
+ case CODE_document_attribute_audio:
+ D->flags |= TGLDF_AUDIO;
+ D->duration = DS_LVAL (DS_DA->duration);
+ return;
+ case CODE_document_attribute_filename:
+ D->caption = DS_STR_DUP (DS_DA->file_name);
+ return;
+ default:
+ assert (0);
+ }
+}
+
+struct tgl_document *tglf_fetch_alloc_document_new (struct tgl_state *TLS, struct tl_ds_document *DS_D) {
+ if (!DS_D) { return NULL; }
+
+ if (DS_D->magic == CODE_document_empty) { return NULL; }
+
+ struct tgl_document *D = tgl_document_get (TLS, DS_LVAL (DS_D->id));
+ if (D) {
+ D->refcnt ++;
+ return D;
+ }
+
+
+ D = talloc0 (sizeof (*D));
+ D->id = DS_LVAL (DS_D->id);
+ D->refcnt = 1;
+
+ tgl_document_insert (TLS, D);
+
+ D->access_hash = DS_LVAL (DS_D->access_hash);
+ D->user_id = DS_LVAL (DS_D->user_id);
+ D->date = DS_LVAL (DS_D->date);
+ D->caption = DS_STR_DUP (DS_D->file_name);
+ D->mime_type = DS_STR_DUP (DS_D->mime_type);
+ D->size = DS_LVAL (DS_D->size);
+ D->dc_id = DS_LVAL (DS_D->dc_id);
+
+ tglf_fetch_photo_size_new (TLS, &D->thumb, DS_D->thumb);
+
+ if (DS_D->attributes) {
+ int i;
+ for (i = 0; i < DS_LVAL (DS_D->attributes->cnt); i++) {
+ tglf_fetch_document_attribute_new (TLS, D, DS_D->attributes->data[i]);
+ }
+ }
+ return D;
+}
+
+struct tgl_webpage *tglf_fetch_alloc_webpage_new (struct tgl_state *TLS, struct tl_ds_web_page *DS_W) {
+ if (!DS_W) { return NULL; }
+
+ struct tgl_webpage *W = tgl_webpage_get (TLS, DS_LVAL (DS_W->id));
+ if (W) {
+ W->refcnt ++;
+ } else {
+ W = talloc0 (sizeof (*W));
+ W->id = DS_LVAL (DS_W->id);
+ W->refcnt = 1;
+
+ tgl_webpage_insert (TLS, W);
+ }
+
+ if (!W->url) {
+ W->url = DS_STR_DUP (DS_W->url);
+ }
+
+ if (!W->display_url) {
+ W->display_url = DS_STR_DUP (DS_W->display_url);
+ }
+
+ if (!W->type) {
+ W->type = DS_STR_DUP (DS_W->type);
+ }
+
+ if (!W->site_name) {
+ W->site_name = DS_STR_DUP (DS_W->site_name);
+ }
+
+ if (!W->title) {
+ W->title = DS_STR_DUP (DS_W->title);
+ }
+
+ if (!W->photo) {
+ W->photo = tglf_fetch_alloc_photo_new (TLS, DS_W->photo);
+ }
+
+ if (!W->description) {
+ W->description = DS_STR_DUP (DS_W->description);
+ }
+
+ if (!W->embed_url) {
+ W->embed_url = DS_STR_DUP (DS_W->embed_url);
+ }
+
+ if (!W->embed_type) {
+ W->embed_type = DS_STR_DUP (DS_W->embed_type);
+ }
+
+ W->embed_width = DS_LVAL (DS_W->embed_width);
+
+ W->embed_height = DS_LVAL (DS_W->embed_height);
+
+ W->duration = DS_LVAL (DS_W->duration);
+
+ if (!W->author) {
+ W->author = DS_STR_DUP (DS_W->author);
+ }
+ return W;
+}
+
+void tglf_fetch_message_action_new (struct tgl_state *TLS, struct tgl_message_action *M, struct tl_ds_message_action *DS_MA) {
+ if (!DS_MA) { return; }
+ memset (M, 0, sizeof (*M));
+
+ switch (DS_MA->magic) {
+ case CODE_message_action_empty:
+ M->type = tgl_message_action_none;
+ break;
+ case CODE_message_action_geo_chat_create:
+ {
+ M->type = tgl_message_action_geo_chat_create;
+ assert (0);
+ }
+ break;
+ case CODE_message_action_geo_chat_checkin:
+ M->type = tgl_message_action_geo_chat_checkin;
+ break;
+ case CODE_message_action_chat_create:
+ {
+ M->type = tgl_message_action_chat_create;
+ M->title = DS_STR_DUP (DS_MA->title);
+
+ M->user_num = DS_LVAL (DS_MA->users->cnt);
+ M->users = talloc (M->user_num * 4);
+ int i;
+ for (i = 0; i < M->user_num; i++) {
+ M->users[i] = DS_LVAL (DS_MA->users->data[i]);
+ }
+ }
+ break;
+ case CODE_message_action_chat_edit_title:
+ M->type = tgl_message_action_chat_edit_title;
+ M->new_title = DS_STR_DUP (DS_MA->title);
+ break;
+ case CODE_message_action_chat_edit_photo:
+ M->type = tgl_message_action_chat_edit_photo;
+ M->photo = tglf_fetch_alloc_photo_new (TLS, DS_MA->photo);
+ break;
+ case CODE_message_action_chat_delete_photo:
+ M->type = tgl_message_action_chat_delete_photo;
+ break;
+ case CODE_message_action_chat_add_user:
+ M->type = tgl_message_action_chat_add_user;
+ M->user = DS_LVAL (DS_MA->user_id);
+ break;
+ case CODE_message_action_chat_delete_user:
+ M->type = tgl_message_action_chat_delete_user;
+ M->user = DS_LVAL (DS_MA->user_id);
+ break;
+ case CODE_message_action_chat_joined_by_link:
+ M->type = tgl_message_action_chat_add_user_by_link;
+ M->user = DS_LVAL (DS_MA->inviter_id);
+ break;
+ default:
+ assert (0);
+ }
+}
+
+void tglf_fetch_message_short_new (struct tgl_state *TLS, struct tgl_message *M, struct tl_ds_updates *DS_U) {
+ tgl_peer_t *P = tgl_peer_get (TLS, TGL_MK_USER (DS_LVAL (DS_U->user_id)));
+ if (!P || !(P->flags & TGLPF_CREATED)) {
+ tgl_do_get_difference (TLS, 0, 0, 0);
+ return;
+ }
+
+ int flags = M->flags & 0xffff;
+
+ if (M->flags & TGLMF_PENDING) {
+ M->flags ^= TGLMF_PENDING;
+ }
+
+ if (!(flags & TGLMF_CREATED)) {
+ flags |= TGLMF_CREATE | TGLMF_CREATED;
+ }
+
+ int f = DS_LVAL (DS_U->flags);
+
+ if (f & 1) {
+ flags |= TGLMF_UNREAD;
+ }
+ if (f & 2) {
+ flags |= TGLMF_OUT;
+ }
+ if (f & 16) {
+ flags |= TGLMF_MENTION;
+ }
+
+ struct tl_ds_message_media A;
+ A.magic = CODE_message_media_empty;
+ int type = TGL_PEER_USER;
+
+ bl_do_create_message_new (TLS, DS_LVAL (DS_U->id),
+ (f & 2) ? &TLS->our_id : DS_U->user_id,
+ &type, (f & 2) ? DS_U->user_id : &TLS->our_id,
+ DS_U->fwd_from_id,
+ DS_U->fwd_date,
+ DS_U->date,
+ DS_STR (DS_U->message),
+ &A,
+ NULL,
+ DS_U->reply_to_msg_id,
+ NULL,
+ flags
+ );
+}
+
+void tglf_fetch_message_short_chat_new (struct tgl_state *TLS, struct tgl_message *M, struct tl_ds_updates *DS_U) {
+ tgl_peer_t *P = tgl_peer_get (TLS, TGL_MK_USER (DS_LVAL (DS_U->from_id)));
+ if (!P || !(P->flags & TGLPF_CREATED)) {
+ tgl_do_get_difference (TLS, 0, 0, 0);
+ return;
+ }
+ P = tgl_peer_get (TLS, TGL_MK_CHAT (DS_LVAL (DS_U->chat_id)));
+ if (!P || !(P->flags & TGLPF_CREATED)) {
+ tgl_do_get_difference (TLS, 0, 0, 0);
+ return;
+ }
+
+ int flags = M->flags & 0xffff;
+
+ if (M->flags & TGLMF_PENDING) {
+ M->flags ^= TGLMF_PENDING;
+ }
+
+ if (!(flags & TGLMF_CREATED)) {
+ flags |= TGLMF_CREATE | TGLMF_CREATED;
+ }
+
+ int f = DS_LVAL (DS_U->flags);
+
+ if (f & 1) {
+ flags |= TGLMF_UNREAD;
+ }
+ if (f & 2) {
+ flags |= TGLMF_OUT;
+ }
+ if (f & 16) {
+ flags |= TGLMF_MENTION;
+ }
+
+ struct tl_ds_message_media A;
+ A.magic = CODE_message_media_empty;
+
+ int type = TGL_PEER_CHAT;
+ bl_do_create_message_new (TLS, DS_LVAL (DS_U->id),
+ DS_U->from_id,
+ &type, DS_U->chat_id,
+ DS_U->fwd_from_id,
+ DS_U->fwd_date,
+ DS_U->date,
+ DS_STR (DS_U->message),
+ &A,
+ NULL,
+ DS_U->reply_to_msg_id,
+ NULL,
+ flags
+ );
+}
+
+
+void tglf_fetch_message_media_new (struct tgl_state *TLS, struct tgl_message_media *M, struct tl_ds_message_media *DS_MM) {
+ if (!DS_MM) { return; }
+ memset (M, 0, sizeof (*M));
+ switch (DS_MM->magic) {
+ case CODE_message_media_empty:
+ M->type = tgl_message_media_none;
+ break;
+ case CODE_message_media_photo:
+ case CODE_message_media_photo_l27:
+ M->type = tgl_message_media_photo;
+ M->photo = tglf_fetch_alloc_photo_new (TLS, DS_MM->photo);
+ M->caption = DS_STR_DUP (DS_MM->caption);
+ break;
+ case CODE_message_media_video:
+ case CODE_message_media_video_l27:
+ M->type = tgl_message_media_video;
+ M->document = tglf_fetch_alloc_video_new (TLS, DS_MM->video);
+ M->caption = DS_STR_DUP (DS_MM->caption);
+ break;
+ case CODE_message_media_audio:
+ M->type = tgl_message_media_audio;
+ M->document = tglf_fetch_alloc_audio_new (TLS, DS_MM->audio);
+ break;
+ case CODE_message_media_document:
+ M->type = tgl_message_media_document;
+ M->document = tglf_fetch_alloc_document_new (TLS, DS_MM->document);
+ break;
+ case CODE_message_media_geo:
+ M->type = tgl_message_media_geo;
+ tglf_fetch_geo_new (TLS, &M->geo, DS_MM->geo);
+ break;
+ case CODE_message_media_contact:
+ M->type = tgl_message_media_contact;
+ M->phone = DS_STR_DUP (DS_MM->phone_number);
+ M->first_name = DS_STR_DUP (DS_MM->first_name);
+ M->last_name = DS_STR_DUP (DS_MM->last_name);
+ M->user_id = DS_LVAL (DS_MM->user_id);
+ break;
+ //case CODE_message_media_unsupported:
+ //case CODE_message_media_unsupported_l22:
+ // M->type = tgl_message_media_unsupported;
+ // break;
+ case CODE_message_media_web_page:
+ M->type = tgl_message_media_webpage;
+ M->webpage = tglf_fetch_alloc_webpage_new (TLS, DS_MM->webpage);
+ break;
+ case CODE_message_media_venue:
+ M->type = tgl_message_media_venue;
+ tglf_fetch_geo_new (TLS, &M->venue.geo, DS_MM->geo);
+ M->venue.title = DS_STR_DUP (DS_MM->title);
+ M->venue.address = DS_STR_DUP (DS_MM->address);
+ M->venue.provider = DS_STR_DUP (DS_MM->provider);
+ M->venue.venue_id = DS_STR_DUP (DS_MM->venue_id);
+ break;
+ default:
+ assert (0);
+ }
+}
+
+void tglf_fetch_message_media_encrypted_new (struct tgl_state *TLS, struct tgl_message_media *M, struct tl_ds_decrypted_message_media *DS_DMM) {
+ if (!DS_DMM) { return; }
+
+ memset (M, 0, sizeof (*M));
+ switch (DS_DMM->magic) {
+ case CODE_decrypted_message_media_empty:
+ M->type = tgl_message_media_none;
+ //M->type = CODE_message_media_empty;
+ break;
+ case CODE_decrypted_message_media_photo:
+ case CODE_decrypted_message_media_video:
+ case CODE_decrypted_message_media_video_l12:
+ case CODE_decrypted_message_media_document:
+ case CODE_decrypted_message_media_audio:
+ //M->type = CODE_decrypted_message_media_video;
+ M->type = tgl_message_media_document_encr;
+
+ M->encr_document = talloc0 (sizeof (*M->encr_document));
+
+ switch (DS_DMM->magic) {
+ case CODE_decrypted_message_media_photo:
+ M->encr_document->flags = TGLDF_IMAGE;
+ break;
+ case CODE_decrypted_message_media_video:
+ case CODE_decrypted_message_media_video_l12:
+ M->encr_document->flags = TGLDF_VIDEO;
+ break;
+ case CODE_decrypted_message_media_document:
+ //M->encr_document->flags = TGLDF_DOCUMENT;
+ break;
+ case CODE_decrypted_message_media_audio:
+ M->encr_document->flags = TGLDF_AUDIO;
+ break;
+ }
+
+ M->encr_document->w = DS_LVAL (DS_DMM->w);
+ M->encr_document->h = DS_LVAL (DS_DMM->h);
+ M->encr_document->size = DS_LVAL (DS_DMM->size);
+ M->encr_document->duration = DS_LVAL (DS_DMM->duration);
+ M->encr_document->mime_type = DS_STR_DUP (DS_DMM->mime_type);
+
+ M->encr_document->key = talloc (32);
+ str_to_32 (M->encr_document->key, DS_STR (DS_DMM->key));
+ M->encr_document->iv = talloc (32);
+ str_to_32 (M->encr_document->iv, DS_STR (DS_DMM->iv));
+ break;
+ case CODE_decrypted_message_media_geo_point:
+ M->type = tgl_message_media_geo;
+ M->geo.latitude = DS_LVAL (DS_DMM->latitude);
+ M->geo.longitude = DS_LVAL (DS_DMM->longitude);
+ break;
+ case CODE_decrypted_message_media_contact:
+ M->type = tgl_message_media_contact;
+ M->phone = DS_STR_DUP (DS_DMM->phone_number);
+ M->first_name = DS_STR_DUP (DS_DMM->first_name);
+ M->last_name = DS_STR_DUP (DS_DMM->last_name);
+ M->user_id = DS_LVAL (DS_DMM->user_id);
+ break;
+ default:
+ assert (0);
+ }
+}
+
+void tglf_fetch_message_action_encrypted_new (struct tgl_state *TLS, struct tgl_message_action *M, struct tl_ds_decrypted_message_action *DS_DMA) {
+ if (!DS_DMA) { return; }
+
+ switch (DS_DMA->magic) {
+ case CODE_decrypted_message_action_set_message_t_t_l:
+ M->type = tgl_message_action_set_message_ttl;
+ M->ttl = DS_LVAL (DS_DMA->ttl_seconds);
+ break;
+ case CODE_decrypted_message_action_read_messages:
+ M->type = tgl_message_action_read_messages;
+ {
+ M->read_cnt = DS_LVAL (DS_DMA->random_ids->cnt);
+
+ int i;
+ for (i = 0; i < M->read_cnt; i++) {
+ struct tgl_message *N = tgl_message_get (TLS, DS_LVAL (DS_DMA->random_ids->data[i]));
+ if (N) {
+ N->flags &= ~TGLMF_UNREAD;
+ }
+ }
+ }
+ break;
+ case CODE_decrypted_message_action_delete_messages:
+ M->type = tgl_message_action_delete_messages;
+ break;
+ case CODE_decrypted_message_action_screenshot_messages:
+ M->type = tgl_message_action_screenshot_messages;
+ {
+ M->screenshot_cnt = DS_LVAL (DS_DMA->random_ids->cnt);
+ }
+ break;
+ case CODE_decrypted_message_action_notify_layer:
+ M->type = tgl_message_action_notify_layer;
+ M->layer = DS_LVAL (DS_DMA->layer);
+ break;
+ case CODE_decrypted_message_action_flush_history:
+ M->type = tgl_message_action_flush_history;
+ break;
+ case CODE_decrypted_message_action_typing:
+ M->type = tgl_message_action_typing;
+ M->typing = tglf_fetch_typing_new (DS_DMA->action);
+ break;
+ case CODE_decrypted_message_action_resend:
+ M->type = tgl_message_action_resend;
+ M->start_seq_no = DS_LVAL (DS_DMA->start_seq_no);
+ M->end_seq_no = DS_LVAL (DS_DMA->end_seq_no);
+ break;
+ case CODE_decrypted_message_action_noop:
+ M->type = tgl_message_action_noop;
+ break;
+ case CODE_decrypted_message_action_request_key:
+ M->type = tgl_message_action_request_key;
+
+ M->exchange_id = DS_LVAL (DS_DMA->exchange_id);
+ M->g_a = talloc (256);
+ str_to_256 (M->g_a, DS_STR (DS_DMA->g_a));
+ break;
+ case CODE_decrypted_message_action_accept_key:
+ M->type = tgl_message_action_accept_key;
+
+ M->exchange_id = DS_LVAL (DS_DMA->exchange_id);
+ M->g_a = talloc (256);
+ str_to_256 (M->g_a, DS_STR (DS_DMA->g_b));
+ M->key_fingerprint = DS_LVAL (DS_DMA->key_fingerprint);
+ break;
+ case CODE_decrypted_message_action_commit_key:
+ M->type = tgl_message_action_commit_key;
+
+ M->exchange_id = DS_LVAL (DS_DMA->exchange_id);
+ M->key_fingerprint = DS_LVAL (DS_DMA->key_fingerprint);
+ break;
+ case CODE_decrypted_message_action_abort_key:
+ M->type = tgl_message_action_abort_key;
+
+ M->exchange_id = DS_LVAL (DS_DMA->exchange_id);
+ break;
+ default:
+ assert (0);
+ }
+}
+
+tgl_peer_id_t tglf_fetch_peer_id_new (struct tgl_state *TLS, struct tl_ds_peer *DS_P) {
+ if (DS_P->magic == CODE_peer_user) {
+ return TGL_MK_USER (DS_LVAL (DS_P->user_id));
+ } else {
+ return TGL_MK_CHAT (DS_LVAL (DS_P->chat_id));
+ }
+}
+
+void tglf_fetch_message_new (struct tgl_state *TLS, struct tgl_message *M, struct tl_ds_message *DS_M) {
+ if (!DS_M || DS_M->magic == CODE_message_empty) { return; }
+
+ assert (M->id == DS_LVAL (DS_M->id));
+
+ tgl_peer_id_t to_id = tglf_fetch_peer_id_new (TLS, DS_M->to_id);
+ {
+ tgl_peer_t *P = tgl_peer_get (TLS, to_id);
+ if (!P || !(P->flags & TGLPF_CREATED)) {
+ tgl_do_get_difference (TLS, 0, 0, 0);
+ return;
+ }
+ P = tgl_peer_get (TLS, TGL_MK_USER (DS_LVAL (DS_M->from_id)));
+ if (!P || !(P->flags & TGLPF_CREATED)) {
+ tgl_do_get_difference (TLS, 0, 0, 0);
+ return;
+ }
+ }
+
+ int new = !(M->flags & TGLMF_CREATED);
+
+ if (new) {
+ int peer_id = tgl_get_peer_id (to_id);
+ int peer_type = tgl_get_peer_type (to_id);
+
+ int flags = 0;
+ if (DS_LVAL (DS_M->flags) & 1) {
+ flags |= TGLMF_UNREAD;
+ }
+ if (DS_LVAL (DS_M->flags) & 2) {
+ flags |= TGLMF_OUT;
+ }
+ if (DS_LVAL (DS_M->flags) & 16) {
+ flags |= TGLMF_MENTION;
+ }
+
+ bl_do_create_message_new (TLS, DS_LVAL (DS_M->id),
+ DS_M->from_id,
+ &peer_type, &peer_id,
+ DS_M->fwd_from_id, DS_M->fwd_date,
+ DS_M->date,
+ DS_STR (DS_M->message),
+ DS_M->media,
+ DS_M->action,
+ DS_M->reply_to_msg_id,
+ DS_M->reply_markup,
+ flags | TGLMF_CREATE | TGLMF_CREATED
+ );
+ }
+}
+
+static int *decr_ptr;
+static int *decr_end;
+
+static int decrypt_encrypted_message (struct tgl_secret_chat *E) {
+ int *msg_key = decr_ptr;
+ decr_ptr += 4;
+ assert (decr_ptr < decr_end);
+ static unsigned char sha1a_buffer[20];
+ static unsigned char sha1b_buffer[20];
+ static unsigned char sha1c_buffer[20];
+ static unsigned char sha1d_buffer[20];
+
+ static unsigned char buf[64];
+
+ int *e_key = E->exchange_state != tgl_sce_committed ? E->key : E->exchange_key;
+
+ memcpy (buf, msg_key, 16);
+ memcpy (buf + 16, e_key, 32);
+ sha1 (buf, 48, sha1a_buffer);
+
+ memcpy (buf, e_key + 8, 16);
+ memcpy (buf + 16, msg_key, 16);
+ memcpy (buf + 32, e_key + 12, 16);
+ sha1 (buf, 48, sha1b_buffer);
+
+ memcpy (buf, e_key + 16, 32);
+ memcpy (buf + 32, msg_key, 16);
+ sha1 (buf, 48, sha1c_buffer);
+
+ memcpy (buf, msg_key, 16);
+ memcpy (buf + 16, e_key + 24, 32);
+ sha1 (buf, 48, sha1d_buffer);
+
+ static unsigned char key[32];
+ memcpy (key, sha1a_buffer + 0, 8);
+ memcpy (key + 8, sha1b_buffer + 8, 12);
+ memcpy (key + 20, sha1c_buffer + 4, 12);
+
+ static unsigned char iv[32];
+ memcpy (iv, sha1a_buffer + 8, 12);
+ memcpy (iv + 12, sha1b_buffer + 0, 8);
+ memcpy (iv + 20, sha1c_buffer + 16, 4);
+ memcpy (iv + 24, sha1d_buffer + 0, 8);
+
+ AES_KEY aes_key;
+ AES_set_decrypt_key (key, 256, &aes_key);
+ AES_ige_encrypt ((void *)decr_ptr, (void *)decr_ptr, 4 * (decr_end - decr_ptr), &aes_key, iv, 0);
+ memset (&aes_key, 0, sizeof (aes_key));
+
+ int x = *(decr_ptr);
+ if (x < 0 || (x & 3)) {
+ return -1;
+ }
+ assert (x >= 0 && !(x & 3));
+ sha1 ((void *)decr_ptr, 4 + x, sha1a_buffer);
+
+ if (memcmp (sha1a_buffer + 4, msg_key, 16)) {
+ return -1;
+ }
+ return 0;
+}
+
+void tglf_fetch_encrypted_message_new (struct tgl_state *TLS, struct tgl_message *M, struct tl_ds_encrypted_message *DS_EM) {
+ if (!DS_EM) { return; }
+
+ int new = !(M->flags & TGLMF_CREATED);
+ if (!new) {
+ return;
+ }
+
+ tgl_peer_t *P = tgl_peer_get (TLS, TGL_MK_ENCR_CHAT (DS_LVAL (DS_EM->chat_id)));
+ if (!P || P->encr_chat.state != sc_ok) {
+ vlogprintf (E_WARNING, "Encrypted message to unknown chat. Dropping\n");
+ return;
+ }
+
+ decr_ptr = (void *)DS_EM->bytes->data;
+ decr_end = decr_ptr + (DS_EM->bytes->len / 4);
+
+ if (P->encr_chat.exchange_state == tgl_sce_committed && P->encr_chat.key_fingerprint == *(long long *)decr_ptr) {
+ tgl_do_confirm_exchange (TLS, (void *)P, 0);
+ assert (P->encr_chat.exchange_state == tgl_sce_none);
+ }
+
+ long long key_fingerprint = P->encr_chat.exchange_state != tgl_sce_committed ? P->encr_chat.key_fingerprint : P->encr_chat.exchange_key_fingerprint;
+ if (*(long long *)decr_ptr != key_fingerprint) {
+ vlogprintf (E_WARNING, "Encrypted message with bad fingerprint to chat %s\n", P->print_name);
+ return;
+ }
+
+ decr_ptr += 2;
+
+ if (decrypt_encrypted_message (&P->encr_chat) < 0) {
+ vlogprintf (E_WARNING, "can not decrypt message\n");
+ return;
+ }
+
+ int *save_in_ptr = in_ptr;
+ int *save_in_end = in_end;
+
+ in_ptr = decr_ptr;
+ int ll = *in_ptr;
+ in_end = in_ptr + ll / 4 + 1;
+ assert (fetch_int () == ll);
+
+ if (skip_type_decrypted_message_layer (TYPE_TO_PARAM (decrypted_message_layer)) < 0 || in_ptr != in_end) {
+ vlogprintf (E_WARNING, "can not fetch message\n");
+ in_ptr = save_in_ptr;
+ in_end = save_in_end;
+ return;
+ }
+
+ in_ptr = decr_ptr;
+ assert (fetch_int () == ll);
+
+ struct tl_ds_decrypted_message_layer *DS_DML = fetch_ds_type_decrypted_message_layer (TYPE_TO_PARAM (decrypted_message_layer));
+ assert (DS_DML);
+
+ in_ptr = save_in_ptr;
+ in_end = save_in_end;
+
+ //bl_do_encr_chat_set_layer (TLS, (void *)P, DS_LVAL (DS_DML->layer));
+ bl_do_encr_chat_new (TLS, tgl_get_peer_id (P->id),
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ NULL, DS_DML->layer, NULL, NULL, NULL, NULL,
+ TGL_FLAGS_UNCHANGED
+ );
+
+ int in_seq_no = DS_LVAL (DS_DML->out_seq_no);
+ int out_seq_no = DS_LVAL (DS_DML->in_seq_no);
+
+ if (in_seq_no / 2 != P->encr_chat.in_seq_no) {
+ vlogprintf (E_WARNING, "Hole in seq in secret chat. in_seq_no = %d, expect_seq_no = %d\n", in_seq_no / 2, P->encr_chat.in_seq_no);
+ free_ds_type_decrypted_message_layer (DS_DML, TYPE_TO_PARAM(decrypted_message_layer));
+ return;
+ }
+
+ if ((in_seq_no & 1) != 1 - (P->encr_chat.admin_id == TLS->our_id) ||
+ (out_seq_no & 1) != (P->encr_chat.admin_id == TLS->our_id)) {
+ vlogprintf (E_WARNING, "Bad msg admin\n");
+ free_ds_type_decrypted_message_layer (DS_DML, TYPE_TO_PARAM(decrypted_message_layer));
+ return;
+ }
+ if (out_seq_no / 2 > P->encr_chat.out_seq_no) {
+ vlogprintf (E_WARNING, "In seq no is bigger than our's out seq no (out_seq_no = %d, our_out_seq_no = %d). Drop\n", out_seq_no / 2, P->encr_chat.out_seq_no);
+ free_ds_type_decrypted_message_layer (DS_DML, TYPE_TO_PARAM(decrypted_message_layer));
+ return;
+ }
+ if (out_seq_no / 2 < P->encr_chat.last_in_seq_no) {
+ vlogprintf (E_WARNING, "Clients in_seq_no decreased (out_seq_no = %d, last_out_seq_no = %d). Drop\n", out_seq_no / 2, P->encr_chat.last_in_seq_no);
+ free_ds_type_decrypted_message_layer (DS_DML, TYPE_TO_PARAM(decrypted_message_layer));
+ return;
+ }
+
+ struct tl_ds_decrypted_message *DS_DM = DS_DML->message;
+ if (M->id != DS_LVAL (DS_DM->random_id)) {
+ vlogprintf (E_ERROR, "Incorrect message: id = %"_PRINTF_INT64_"d, new_id = %"_PRINTF_INT64_"d\n", M->id, DS_LVAL (DS_DM->random_id));
+ free_ds_type_decrypted_message_layer (DS_DML, TYPE_TO_PARAM(decrypted_message_layer));
+ return;
+ }
+
+ int peer_type = TGL_PEER_ENCR_CHAT;
+ int peer_id = tgl_get_peer_id (P->id);
+
+ bl_do_create_message_encr_new (TLS, M->id, &P->encr_chat.user_id, &peer_type, &peer_id, DS_EM->date, DS_STR (DS_DM->message), DS_DM->media, DS_DM->action, DS_EM->file, TGLMF_CREATE | TGLMF_CREATED | TGLMF_ENCRYPTED);
+
+ if (in_seq_no >= 0 && out_seq_no >= 0) {
+ //bl_do_encr_chat_update_seq (TLS, (void *)P, in_seq_no / 2 + 1, out_seq_no / 2);
+ in_seq_no = in_seq_no / 2 + 1;
+ out_seq_no = out_seq_no / 2;
+ bl_do_encr_chat_new (TLS, tgl_get_peer_id (P->id),
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, &in_seq_no, &out_seq_no, NULL, NULL,
+ TGL_FLAGS_UNCHANGED
+ );
+ assert (P->encr_chat.in_seq_no == in_seq_no);
+ }
+
+ free_ds_type_decrypted_message_layer (DS_DML, TYPE_TO_PARAM(decrypted_message_layer));
+}
+
+void tglf_fetch_encrypted_message_file_new (struct tgl_state *TLS, struct tgl_message_media *M, struct tl_ds_encrypted_file *DS_EF) {
+ if (DS_EF->magic == CODE_encrypted_file_empty) {
+ assert (M->type != tgl_message_media_document_encr);
+ } else {
+ assert (M->type == tgl_message_media_document_encr);
+ assert (M->encr_document);
+
+ M->encr_document->id = DS_LVAL (DS_EF->id);
+ M->encr_document->access_hash = DS_LVAL (DS_EF->access_hash);
+ if (!M->encr_document->size) {
+ M->encr_document->size = DS_LVAL (DS_EF->size);
+ }
+ M->encr_document->dc_id = DS_LVAL (DS_EF->dc_id);
+ M->encr_document->key_fingerprint = DS_LVAL (DS_EF->key_fingerprint);
+ }
+}
+
+static int id_cmp (struct tgl_message *M1, struct tgl_message *M2) {
+ if (M1->id < M2->id) { return -1; }
+ else if (M1->id > M2->id) { return 1; }
+ else { return 0; }
+}
+
+static void increase_peer_size (struct tgl_state *TLS) {
+ if (TLS->peer_num == TLS->peer_size) {
+ int new_size = TLS->peer_size ? 2 * TLS->peer_size : 10;
+ int old_size = TLS->peer_size;
+ if (old_size) {
+ TLS->Peers = trealloc (TLS->Peers, old_size * sizeof (void *), new_size * sizeof (void *));
+ } else {
+ TLS->Peers = talloc (new_size * sizeof (void *));
+ }
+ TLS->peer_size = new_size;
+ }
+}
+
+struct tgl_user *tglf_fetch_alloc_user_new (struct tgl_state *TLS, struct tl_ds_user *DS_U) {
+ tgl_peer_t *U = tgl_peer_get (TLS, TGL_MK_USER (DS_LVAL (DS_U->id)));
+ if (!U) {
+ TLS->users_allocated ++;
+ U = talloc0 (sizeof (*U));
+ U->id = TGL_MK_USER (DS_LVAL (DS_U->id));
+ TLS->peer_tree = tree_insert_peer (TLS->peer_tree, U, lrand48 ());
+ increase_peer_size (TLS);
+ TLS->Peers[TLS->peer_num ++] = U;
+ }
+ tglf_fetch_user_new (TLS, &U->user, DS_U);
+ return &U->user;
+}
+
+struct tgl_secret_chat *tglf_fetch_alloc_encrypted_chat_new (struct tgl_state *TLS, struct tl_ds_encrypted_chat *DS_EC) {
+ tgl_peer_t *U = tgl_peer_get (TLS, TGL_MK_ENCR_CHAT (DS_LVAL (DS_EC->id)));
+ if (!U) {
+ U = talloc0 (sizeof (*U));
+ U->id = TGL_MK_ENCR_CHAT (DS_LVAL (DS_EC->id));
+ TLS->encr_chats_allocated ++;
+ TLS->peer_tree = tree_insert_peer (TLS->peer_tree, U, lrand48 ());
+ increase_peer_size (TLS);
+ TLS->Peers[TLS->peer_num ++] = U;
+ }
+ tglf_fetch_encrypted_chat_new (TLS, &U->encr_chat, DS_EC);
+ return &U->encr_chat;
+}
+
+struct tgl_user *tglf_fetch_alloc_user_full_new (struct tgl_state *TLS, struct tl_ds_user_full *DS_U) {
+ tgl_peer_t *U = tgl_peer_get (TLS, TGL_MK_USER (DS_LVAL (DS_U->user->id)));
+ if (U) {
+ tglf_fetch_user_full_new (TLS, &U->user, DS_U);
+ return &U->user;
+ } else {
+ TLS->users_allocated ++;
+ U = talloc0 (sizeof (*U));
+ U->id = TGL_MK_USER (DS_LVAL (DS_U->user->id));
+ TLS->peer_tree = tree_insert_peer (TLS->peer_tree, U, lrand48 ());
+ tglf_fetch_user_full_new (TLS, &U->user, DS_U);
+ increase_peer_size (TLS);
+ TLS->Peers[TLS->peer_num ++] = U;
+ return &U->user;
+ }
+}
+
+struct tgl_message *tglf_fetch_alloc_message_new (struct tgl_state *TLS, struct tl_ds_message *DS_M) {
+ struct tgl_message *M = tgl_message_get (TLS, DS_LVAL (DS_M->id));
+
+ if (!M) {
+ M = tglm_message_alloc (TLS, DS_LVAL (DS_M->id));
+ }
+ tglf_fetch_message_new (TLS, M, DS_M);
+ return M;
+}
+
+struct tgl_message *tglf_fetch_alloc_encrypted_message_new (struct tgl_state *TLS, struct tl_ds_encrypted_message *DS_EM) {
+ struct tgl_message *M = tgl_message_get (TLS, DS_LVAL (DS_EM->random_id));
+
+ if (!M) {
+ M = talloc0 (sizeof (*M));
+ M->id = DS_LVAL (DS_EM->random_id);
+ tglm_message_insert_tree (TLS, M);
+ TLS->messages_allocated ++;
+ assert (tgl_message_get (TLS, M->id) == M);
+ }
+ tglf_fetch_encrypted_message_new (TLS, M, DS_EM);
+
+ if (M->flags & TGLMF_CREATED) {
+ tgl_peer_t *_E = tgl_peer_get (TLS, M->to_id);
+ assert (_E);
+ struct tgl_secret_chat *E = &_E->encr_chat;
+ if (M->action.type == tgl_message_action_request_key) {
+ if (E->exchange_state == tgl_sce_none || (E->exchange_state == tgl_sce_requested && E->exchange_id > M->action.exchange_id )) {
+ tgl_do_accept_exchange (TLS, E, M->action.exchange_id, M->action.g_a);
+ } else {
+ vlogprintf (E_WARNING, "Exchange: Incorrect state (received request, state = %d)\n", E->exchange_state);
+ }
+ }
+ if (M->action.type == tgl_message_action_accept_key) {
+ if (E->exchange_state == tgl_sce_requested && E->exchange_id == M->action.exchange_id) {
+ tgl_do_commit_exchange (TLS, E, M->action.g_a);
+ } else {
+ vlogprintf (E_WARNING, "Exchange: Incorrect state (received accept, state = %d)\n", E->exchange_state);
+ }
+ }
+ if (M->action.type == tgl_message_action_commit_key) {
+ if (E->exchange_state == tgl_sce_accepted && E->exchange_id == M->action.exchange_id) {
+ tgl_do_confirm_exchange (TLS, E, 1);
+ } else {
+ vlogprintf (E_WARNING, "Exchange: Incorrect state (received commit, state = %d)\n", E->exchange_state);
+ }
+ }
+ if (M->action.type == tgl_message_action_abort_key) {
+ if (E->exchange_state != tgl_sce_none && E->exchange_id == M->action.exchange_id) {
+ tgl_do_abort_exchange (TLS, E);
+ } else {
+ vlogprintf (E_WARNING, "Exchange: Incorrect state (received abort, state = %d)\n", E->exchange_state);
+ }
+ }
+ if (M->action.type == tgl_message_action_notify_layer) {
+ bl_do_encr_chat_new (TLS, tgl_get_peer_id (E->id),
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ NULL, &M->action.layer, NULL, NULL, NULL, NULL,
+ TGL_FLAGS_UNCHANGED
+ );
+ }
+ if (M->action.type == tgl_message_action_set_message_ttl) {
+ //bl_do_encr_chat_set_ttl (TLS, E, M->action.ttl);
+ bl_do_encr_chat_new (TLS, tgl_get_peer_id (E->id),
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ &M->action.ttl, NULL, NULL, NULL, NULL, NULL,
+ TGL_FLAGS_UNCHANGED
+ );
+ }
+ }
+ return M;
+}
+
+struct tgl_message *tglf_fetch_alloc_message_short_new (struct tgl_state *TLS, struct tl_ds_updates *DS_U) {
+ int id = DS_LVAL (DS_U->id);
+ struct tgl_message *M = tgl_message_get (TLS, id);
+
+ if (!M) {
+ M = talloc0 (sizeof (*M));
+ M->id = id;
+ tglm_message_insert_tree (TLS, M);
+ TLS->messages_allocated ++;
+ }
+ tglf_fetch_message_short_new (TLS, M, DS_U);
+ return M;
+}
+
+struct tgl_message *tglf_fetch_alloc_message_short_chat_new (struct tgl_state *TLS, struct tl_ds_updates *DS_U) {
+ int id = DS_LVAL (DS_U->id);
+ struct tgl_message *M = tgl_message_get (TLS, id);
+
+ if (!M) {
+ M = talloc0 (sizeof (*M));
+ M->id = id;
+ tglm_message_insert_tree (TLS, M);
+ TLS->messages_allocated ++;
+ }
+ tglf_fetch_message_short_chat_new (TLS, M, DS_U);
+ return M;
+}
+
+struct tgl_chat *tglf_fetch_alloc_chat_new (struct tgl_state *TLS, struct tl_ds_chat *DS_C) {
+ tgl_peer_t *U = tgl_peer_get (TLS, TGL_MK_CHAT (DS_LVAL (DS_C->id)));
+ if (!U) {
+ TLS->chats_allocated ++;
+ U = talloc0 (sizeof (*U));
+ U->id = TGL_MK_CHAT (DS_LVAL (DS_C->id));
+ TLS->peer_tree = tree_insert_peer (TLS->peer_tree, U, lrand48 ());
+ increase_peer_size (TLS);
+ TLS->Peers[TLS->peer_num ++] = U;
+ }
+ tglf_fetch_chat_new (TLS, &U->chat, DS_C);
+ return &U->chat;
+}
+
+struct tgl_chat *tglf_fetch_alloc_chat_full_new (struct tgl_state *TLS, struct tl_ds_messages_chat_full *DS_MCF) {
+ tgl_peer_t *U = tgl_peer_get (TLS, TGL_MK_CHAT (DS_LVAL (DS_MCF->full_chat->id)));
+ if (U) {
+ tglf_fetch_chat_full_new (TLS, &U->chat, DS_MCF);
+ return &U->chat;
+ } else {
+ TLS->chats_allocated ++;
+ U = talloc0 (sizeof (*U));
+ U->id = TGL_MK_CHAT (DS_LVAL (DS_MCF->full_chat->id));
+ TLS->peer_tree = tree_insert_peer (TLS->peer_tree, U, lrand48 ());
+ tglf_fetch_chat_full_new (TLS, &U->chat, DS_MCF);
+ increase_peer_size (TLS);
+ TLS->Peers[TLS->peer_num ++] = U;
+ return &U->chat;
+ }
+}
+
+struct tgl_bot_info *tglf_fetch_alloc_bot_info (struct tgl_state *TLS, struct tl_ds_bot_info *DS_BI) {
+ if (!DS_BI || DS_BI->magic == CODE_bot_info_empty) { return NULL; }
+ struct tgl_bot_info *B = talloc (sizeof (*B));
+ B->version = DS_LVAL (DS_BI->version);
+ B->share_text = DS_STR_DUP (DS_BI->share_text);
+ B->description = DS_STR_DUP (DS_BI->description);
+
+ B->commands_num = DS_LVAL (DS_BI->commands->cnt);
+ B->commands = talloc (sizeof (struct tgl_bot_command) * B->commands_num);
+ int i;
+ for (i = 0; i < B->commands_num; i++) {
+ struct tl_ds_bot_command *BC = DS_BI->commands->data[i];
+ B->commands[i].command = DS_STR_DUP (BC->command);
+ B->commands[i].description = DS_STR_DUP (BC->description);
+ }
+ return B;
+}
+
+struct tgl_message_reply_markup *tglf_fetch_alloc_reply_markup (struct tgl_state *TLS, struct tgl_message *M, struct tl_ds_reply_markup *DS_RM) {
+ if (!DS_RM) { return NULL; }
+
+ struct tgl_message_reply_markup *R = talloc0 (sizeof (*R));
+ R->flags = DS_LVAL (DS_RM->flags);
+ R->refcnt = 1;
+
+ R->rows = DS_RM->rows ? DS_LVAL (DS_RM->rows->cnt) : 0;
+
+ int total = 0;
+ R->row_start = talloc ((R->rows + 1) * 4);
+ R->row_start[0] = 0;
+ int i;
+ for (i = 0; i < R->rows; i++) {
+ struct tl_ds_keyboard_button_row *DS_K = DS_RM->rows->data[i];
+ total += DS_LVAL (DS_K->buttons->cnt);
+ R->row_start[i + 1] = total;
+ }
+ R->buttons = talloc (sizeof (void *) * total);
+ int r = 0;
+ for (i = 0; i < R->rows; i++) {
+ struct tl_ds_keyboard_button_row *DS_K = DS_RM->rows->data[i];
+ int j;
+ for (j = 0; j < DS_LVAL (DS_K->buttons->cnt); j++) {
+ struct tl_ds_keyboard_button *DS_KB = DS_K->buttons->data[j];
+ R->buttons[r ++] = DS_STR_DUP (DS_KB->text);
+ }
+ }
+ assert (r == total);
+ return R;
+}
+/* }}} */
+
+void tglp_insert_encrypted_chat (struct tgl_state *TLS, tgl_peer_t *P) {
+ TLS->encr_chats_allocated ++;
+ TLS->peer_tree = tree_insert_peer (TLS->peer_tree, P, lrand48 ());
+ increase_peer_size (TLS);
+ TLS->Peers[TLS->peer_num ++] = P;
+}
+
+void tglp_insert_user (struct tgl_state *TLS, tgl_peer_t *P) {
+ TLS->users_allocated ++;
+ TLS->peer_tree = tree_insert_peer (TLS->peer_tree, P, lrand48 ());
+ increase_peer_size (TLS);
+ TLS->Peers[TLS->peer_num ++] = P;
+}
+
+void tglp_insert_chat (struct tgl_state *TLS, tgl_peer_t *P) {
+ TLS->chats_allocated ++;
+ TLS->peer_tree = tree_insert_peer (TLS->peer_tree, P, lrand48 ());
+ increase_peer_size (TLS);
+ TLS->Peers[TLS->peer_num ++] = P;
+}
+
+void tgl_insert_empty_user (struct tgl_state *TLS, int uid) {
+ tgl_peer_id_t id = TGL_MK_USER (uid);
+ if (tgl_peer_get (TLS, id)) { return; }
+ tgl_peer_t *P = talloc0 (sizeof (*P));
+ P->id = id;
+ tglp_insert_user (TLS, P);
+}
+
+void tgl_insert_empty_chat (struct tgl_state *TLS, int cid) {
+ tgl_peer_id_t id = TGL_MK_CHAT (cid);
+ if (tgl_peer_get (TLS, id)) { return; }
+ tgl_peer_t *P = talloc0 (sizeof (*P));
+ P->id = id;
+ tglp_insert_chat (TLS, P);
+}
+
+/* {{{ Free */
+
+void tgls_free_photo_size (struct tgl_state *TLS, struct tgl_photo_size *S) {
+ tfree_str (S->type);
+ if (S->data) {
+ tfree (S->data, S->size);
+ }
+}
+
+void tgls_free_photo (struct tgl_state *TLS, struct tgl_photo *P) {
+ if (--P->refcnt) {
+ assert (P->refcnt > 0);
+ return;
+ }
+ if (P->caption) { tfree_str (P->caption); }
+ if (P->sizes) {
+ int i;
+ for (i = 0; i < P->sizes_num; i++) {
+ tgls_free_photo_size (TLS, &P->sizes[i]);
+ }
+ tfree (P->sizes, sizeof (struct tgl_photo_size) * P->sizes_num);
+ }
+ TLS->photo_tree = tree_delete_photo (TLS->photo_tree, P);
+ tfree (P, sizeof (*P));
+}
+
+void tgls_free_document (struct tgl_state *TLS, struct tgl_document *D) {
+ if (--D->refcnt) {
+ assert (D->refcnt);
+ return;
+ }
+ if (D->mime_type) { tfree_str (D->mime_type);}
+ if (D->caption) {tfree_str (D->caption);}
+ tgls_free_photo_size (TLS, &D->thumb);
+
+ TLS->document_tree = tree_delete_document (TLS->document_tree, D);
+ tfree (D, sizeof (*D));
+}
+
+void tgls_free_webpage (struct tgl_state *TLS, struct tgl_webpage *W) {
+ if (--W->refcnt) {
+ assert (W->refcnt);
+ return;
+ }
+ if (W->url) { tfree_str (W->url); }
+ if (W->display_url) { tfree_str (W->display_url); }
+ if (W->title) { tfree_str (W->title); }
+ if (W->site_name) { tfree_str (W->site_name); }
+ if (W->type) { tfree_str (W->type); }
+ if (W->description) { tfree_str (W->description); }
+ if (W->photo) { tgls_free_photo (TLS, W->photo); }
+ if (W->embed_url) { tfree_str (W->embed_url); }
+ if (W->embed_type) { tfree_str (W->embed_type); }
+ if (W->author) { tfree_str (W->author); }
+
+ TLS->webpage_tree = tree_delete_webpage (TLS->webpage_tree, W);
+ tfree (W, sizeof (*W));
+}
+
+void tgls_free_message_media (struct tgl_state *TLS, struct tgl_message_media *M) {
+ switch (M->type) {
+ case tgl_message_media_none:
+ case tgl_message_media_geo:
+ return;
+ case tgl_message_media_photo:
+ tgls_free_photo (TLS, M->photo);
+ M->photo = NULL;
+ return;
+ case tgl_message_media_contact:
+ tfree_str (M->phone);
+ tfree_str (M->first_name);
+ tfree_str (M->last_name);
+ return;
+ case tgl_message_media_document:
+ case tgl_message_media_video:
+ case tgl_message_media_audio:
+ tgls_free_document (TLS, M->document);
+ return;
+ case tgl_message_media_unsupported:
+ tfree (M->data, M->data_size);
+ return;
+ case tgl_message_media_document_encr:
+ tfree_secure (M->encr_document->key, 32);
+ tfree_secure (M->encr_document->iv, 32);
+ tfree (M->encr_document, sizeof (*M->encr_document));
+ return;
+ case tgl_message_media_webpage:
+ tgls_free_webpage (TLS, M->webpage);
+ return;
+ case tgl_message_media_venue:
+ if (M->venue.title) { tfree_str (M->venue.title); }
+ if (M->venue.address) { tfree_str (M->venue.address); }
+ if (M->venue.provider) { tfree_str (M->venue.provider); }
+ if (M->venue.venue_id) { tfree_str (M->venue.venue_id); }
+ return;
+ default:
+ vlogprintf (E_ERROR, "type = 0x%08x\n", M->type);
+ assert (0);
+ }
+}
+
+void tgls_free_message_action (struct tgl_state *TLS, struct tgl_message_action *M) {
+ switch (M->type) {
+ case tgl_message_action_none:
+ return;
+ case tgl_message_action_chat_create:
+ tfree_str (M->title);
+ tfree (M->users, M->user_num * 4);
+ return;
+ case tgl_message_action_chat_edit_title:
+ tfree_str (M->new_title);
+ return;
+ case tgl_message_action_chat_edit_photo:
+ tgls_free_photo (TLS, M->photo);
+ M->photo = NULL;
+ return;
+ case tgl_message_action_chat_delete_photo:
+ case tgl_message_action_chat_add_user:
+ case tgl_message_action_chat_add_user_by_link:
+ case tgl_message_action_chat_delete_user:
+ case tgl_message_action_geo_chat_create:
+ case tgl_message_action_geo_chat_checkin:
+ case tgl_message_action_set_message_ttl:
+ case tgl_message_action_read_messages:
+ case tgl_message_action_delete_messages:
+ case tgl_message_action_screenshot_messages:
+ case tgl_message_action_flush_history:
+ case tgl_message_action_typing:
+ case tgl_message_action_resend:
+ case tgl_message_action_notify_layer:
+ case tgl_message_action_commit_key:
+ case tgl_message_action_abort_key:
+ case tgl_message_action_noop:
+ return;
+ case tgl_message_action_request_key:
+ case tgl_message_action_accept_key:
+ tfree (M->g_a, 256);
+ return;
+/* default:
+ vlogprintf (E_ERROR, "type = 0x%08x\n", M->type);
+ assert (0);*/
+ }
+ vlogprintf (E_ERROR, "type = 0x%08x\n", M->type);
+ assert (0);
+}
+
+void tgls_clear_message (struct tgl_state *TLS, struct tgl_message *M) {
+ if (!(M->flags & TGLMF_SERVICE)) {
+ if (M->message) { tfree (M->message, M->message_len + 1); }
+ tgls_free_message_media (TLS, &M->media);
+ } else {
+ tgls_free_message_action (TLS, &M->action);
+ }
+}
+
+void tgls_free_reply_markup (struct tgl_state *TLS, struct tgl_message_reply_markup *R) {
+ if (!--R->refcnt) {
+ tfree (R->buttons, R->row_start[R->rows] * sizeof (void *));
+ tfree (R->row_start, 4 * (R->rows + 1));
+ tfree (R, sizeof (*R));
+ } else {
+ assert (R->refcnt > 0);
+ }
+}
+
+void tgls_free_message (struct tgl_state *TLS, struct tgl_message *M) {
+ tgls_clear_message (TLS, M);
+ if (M->reply_markup) {
+ tgls_free_reply_markup (TLS, M->reply_markup);
+ }
+ tfree (M, sizeof (*M));
+}
+
+void tgls_free_chat (struct tgl_state *TLS, struct tgl_chat *U) {
+ if (U->title) { tfree_str (U->title); }
+ if (U->print_title) { tfree_str (U->print_title); }
+ if (U->user_list) {
+ tfree (U->user_list, U->user_list_size * 12);
+ }
+ if (U->photo) { tgls_free_photo (TLS, U->photo); }
+ tfree (U, sizeof (*U));
+}
+
+void tgls_free_user (struct tgl_state *TLS, struct tgl_user *U) {
+ if (U->first_name) { tfree_str (U->first_name); }
+ if (U->last_name) { tfree_str (U->last_name); }
+ if (U->print_name) { tfree_str (U->print_name); }
+ if (U->phone) { tfree_str (U->phone); }
+ if (U->real_first_name) { tfree_str (U->real_first_name); }
+ if (U->real_last_name) { tfree_str (U->real_last_name); }
+ if (U->status.ev) { tgl_remove_status_expire (TLS, U); }
+ if (U->photo) { tgls_free_photo (TLS, U->photo); }
+ tfree (U, sizeof (*U));
+}
+
+void tgls_free_encr_chat (struct tgl_state *TLS, struct tgl_secret_chat *U) {
+ if (U->print_name) { tfree_str (U->print_name); }
+ if (U->g_key) { tfree (U->g_key, 256); }
+ tfree (U, sizeof (*U));
+}
+
+void tgls_free_peer (struct tgl_state *TLS, tgl_peer_t *P) {
+ if (tgl_get_peer_type (P->id) == TGL_PEER_USER) {
+ tgls_free_user (TLS, (void *)P);
+ } else if (tgl_get_peer_type (P->id) == TGL_PEER_CHAT) {
+ tgls_free_chat (TLS, (void *)P);
+ } else if (tgl_get_peer_type (P->id) == TGL_PEER_ENCR_CHAT) {
+ tgls_free_encr_chat (TLS, (void *)P);
+ } else {
+ assert (0);
+ }
+}
+
+void tgls_free_bot_info (struct tgl_state *TLS, struct tgl_bot_info *B) {
+ if (!B) { return; }
+ int i;
+ for (i = 0; i < B->commands_num; i++) {
+ tfree_str (B->commands[i].command);
+ tfree_str (B->commands[i].description);
+ }
+ tfree (B->commands, sizeof (struct tgl_bot_command) * B->commands_num);
+ tfree_str (B->share_text);
+ tfree_str (B->description);
+ tfree (B, sizeof (*B));
+}
+/* }}} */
+
+/* Messages {{{ */
+
+void tglm_message_del_use (struct tgl_state *TLS, struct tgl_message *M) {
+ M->next_use->prev_use = M->prev_use;
+ M->prev_use->next_use = M->next_use;
+}
+
+void tglm_message_add_use (struct tgl_state *TLS, struct tgl_message *M) {
+ M->next_use = TLS->message_list.next_use;
+ M->prev_use = &TLS->message_list;
+ M->next_use->prev_use = M;
+ M->prev_use->next_use = M;
+}
+
+void tglm_message_add_peer (struct tgl_state *TLS, struct tgl_message *M) {
+ tgl_peer_id_t id;
+ if (!tgl_cmp_peer_id (M->to_id, TGL_MK_USER (TLS->our_id))) {
+ id = M->from_id;
+ } else {
+ id = M->to_id;
+ }
+ tgl_peer_t *P = tgl_peer_get (TLS, id);
+ if (!P) {
+ P = talloc0 (sizeof (*P));
+ P->id = id;
+ switch (tgl_get_peer_type (id)) {
+ case TGL_PEER_USER:
+ TLS->users_allocated ++;
+ break;
+ case TGL_PEER_CHAT:
+ TLS->chats_allocated ++;
+ break;
+ case TGL_PEER_GEO_CHAT:
+ TLS->geo_chats_allocated ++;
+ break;
+ case TGL_PEER_ENCR_CHAT:
+ TLS->encr_chats_allocated ++;
+ break;
+ }
+ TLS->peer_tree = tree_insert_peer (TLS->peer_tree, P, lrand48 ());
+ increase_peer_size (TLS);
+ TLS->Peers[TLS->peer_num ++] = P;
+ }
+ if (!P->last) {
+ P->last = M;
+ M->prev = M->next = 0;
+ } else {
+ if (tgl_get_peer_type (P->id) != TGL_PEER_ENCR_CHAT) {
+ struct tgl_message *N = P->last;
+ struct tgl_message *NP = 0;
+ while (N && N->id > M->id) {
+ NP = N;
+ N = N->next;
+ }
+ if (N) {
+ assert (N->id < M->id);
+ }
+ M->next = N;
+ M->prev = NP;
+ if (N) { N->prev = M; }
+ if (NP) { NP->next = M; }
+ else { P->last = M; }
+ } else {
+ struct tgl_message *N = P->last;
+ struct tgl_message *NP = 0;
+ M->next = N;
+ M->prev = NP;
+ if (N) { N->prev = M; }
+ if (NP) { NP->next = M; }
+ else { P->last = M; }
+ }
+ }
+}
+
+void tglm_message_del_peer (struct tgl_state *TLS, struct tgl_message *M) {
+ tgl_peer_id_t id;
+ if (!tgl_cmp_peer_id (M->to_id, TGL_MK_USER (TLS->our_id))) {
+ id = M->from_id;
+ } else {
+ id = M->to_id;
+ }
+ tgl_peer_t *P = tgl_peer_get (TLS, id);
+ if (M->prev) {
+ M->prev->next = M->next;
+ }
+ if (M->next) {
+ M->next->prev = M->prev;
+ }
+ if (P && P->last == M) {
+ P->last = M->next;
+ }
+}
+
+struct tgl_message *tglm_message_alloc (struct tgl_state *TLS, long long id) {
+ struct tgl_message *M = talloc0 (sizeof (*M));
+ M->id = id;
+ tglm_message_insert_tree (TLS, M);
+ TLS->messages_allocated ++;
+ return M;
+}
+
+void tglm_message_insert_tree (struct tgl_state *TLS, struct tgl_message *M) {
+ assert (M->id);
+ TLS->message_tree = tree_insert_message (TLS->message_tree, M, lrand48 ());
+}
+
+void tglm_message_remove_tree (struct tgl_state *TLS, struct tgl_message *M) {
+ assert (M->id);
+ TLS->message_tree = tree_delete_message (TLS->message_tree, M);
+}
+
+void tglm_message_insert (struct tgl_state *TLS, struct tgl_message *M) {
+ tglm_message_add_use (TLS, M);
+ tglm_message_add_peer (TLS, M);
+}
+
+void tglm_message_insert_unsent (struct tgl_state *TLS, struct tgl_message *M) {
+ TLS->message_unsent_tree = tree_insert_message (TLS->message_unsent_tree, M, lrand48 ());
+}
+
+void tglm_message_remove_unsent (struct tgl_state *TLS, struct tgl_message *M) {
+ TLS->message_unsent_tree = tree_delete_message (TLS->message_unsent_tree, M);
+}
+
+static void __send_msg (struct tgl_message *M, void *_TLS) {
+ struct tgl_state *TLS = _TLS;
+ vlogprintf (E_NOTICE, "Resending message...\n");
+ //print_message (M);
+
+ if (M->media.type != tgl_message_media_none) {
+ assert (M->flags & TGLMF_ENCRYPTED);
+ bl_do_message_delete (TLS, M);
+ } else {
+ tgl_do_send_msg (TLS, M, 0, 0);
+ }
+}
+
+void tglm_send_all_unsent (struct tgl_state *TLS) {
+ tree_act_ex_message (TLS->message_unsent_tree, __send_msg, TLS);
+}
+/* }}} */
+
+struct tgl_photo *tgl_photo_get (struct tgl_state *TLS, long long id) {
+ struct tgl_photo P;
+ P.id = id;
+ return tree_lookup_photo (TLS->photo_tree, &P);
+}
+
+void tgl_photo_insert (struct tgl_state *TLS, struct tgl_photo *P) {
+ TLS->photo_tree = tree_insert_photo (TLS->photo_tree, P, lrand48 ());
+}
+
+struct tgl_document *tgl_document_get (struct tgl_state *TLS, long long id) {
+ struct tgl_document P;
+ P.id = id;
+ return tree_lookup_document (TLS->document_tree, &P);
+}
+
+void tgl_document_insert (struct tgl_state *TLS, struct tgl_document *P) {
+ TLS->document_tree = tree_insert_document (TLS->document_tree, P, lrand48 ());
+}
+
+struct tgl_webpage *tgl_webpage_get (struct tgl_state *TLS, long long id) {
+ struct tgl_webpage P;
+ P.id = id;
+ return tree_lookup_webpage (TLS->webpage_tree, &P);
+}
+
+void tgl_webpage_insert (struct tgl_state *TLS, struct tgl_webpage *P) {
+ TLS->webpage_tree = tree_insert_webpage (TLS->webpage_tree, P, lrand48 ());
+}
+
+void tglp_peer_insert_name (struct tgl_state *TLS, tgl_peer_t *P) {
+ TLS->peer_by_name_tree = tree_insert_peer_by_name (TLS->peer_by_name_tree, P, lrand48 ());
+}
+
+void tglp_peer_delete_name (struct tgl_state *TLS, tgl_peer_t *P) {
+ TLS->peer_by_name_tree = tree_delete_peer_by_name (TLS->peer_by_name_tree, P);
+}
+
+tgl_peer_t *tgl_peer_get (struct tgl_state *TLS, tgl_peer_id_t id) {
+ static tgl_peer_t U;
+ U.id = id;
+ return tree_lookup_peer (TLS->peer_tree, &U);
+}
+
+struct tgl_message *tgl_message_get (struct tgl_state *TLS, long long id) {
+ struct tgl_message M;
+ M.id = id;
+ return tree_lookup_message (TLS->message_tree, &M);
+}
+
+tgl_peer_t *tgl_peer_get_by_name (struct tgl_state *TLS, const char *s) {
+ static tgl_peer_t P;
+ P.print_name = (void *)s;
+ tgl_peer_t *R = tree_lookup_peer_by_name (TLS->peer_by_name_tree, &P);
+ return R;
+}
+
+void tgl_peer_iterator_ex (struct tgl_state *TLS, void (*it)(tgl_peer_t *P, void *extra), void *extra) {
+ tree_act_ex_peer (TLS->peer_tree, it, extra);
+}
+
+int tgl_complete_user_list (struct tgl_state *TLS, int index, const char *text, int len, char **R) {
+ index ++;
+ while (index < TLS->peer_num && (!TLS->Peers[index]->print_name || strncmp (TLS->Peers[index]->print_name, text, len) || tgl_get_peer_type (TLS->Peers[index]->id) != TGL_PEER_USER)) {
+ index ++;
+ }
+ if (index < TLS->peer_num) {
+ *R = strdup (TLS->Peers[index]->print_name);
+ assert (*R);
+ return index;
+ } else {
+ return -1;
+ }
+}
+
+int tgl_complete_chat_list (struct tgl_state *TLS, int index, const char *text, int len, char **R) {
+ index ++;
+ while (index < TLS->peer_num && (!TLS->Peers[index]->print_name || strncmp (TLS->Peers[index]->print_name, text, len) || tgl_get_peer_type (TLS->Peers[index]->id) != TGL_PEER_CHAT)) {
+ index ++;
+ }
+ if (index < TLS->peer_num) {
+ *R = strdup (TLS->Peers[index]->print_name);
+ assert (*R);
+ return index;
+ } else {
+ return -1;
+ }
+}
+
+int tgl_complete_encr_chat_list (struct tgl_state *TLS, int index, const char *text, int len, char **R) {
+ index ++;
+ while (index < TLS->peer_num && (!TLS->Peers[index]->print_name || strncmp (TLS->Peers[index]->print_name, text, len) || tgl_get_peer_type (TLS->Peers[index]->id) != TGL_PEER_ENCR_CHAT)) {
+ index ++;
+ }
+ if (index < TLS->peer_num) {
+ *R = strdup (TLS->Peers[index]->print_name);
+ assert (*R);
+ return index;
+ } else {
+ return -1;
+ }
+}
+
+int tgl_complete_peer_list (struct tgl_state *TLS, int index, const char *text, int len, char **R) {
+ index ++;
+ while (index < TLS->peer_num && (!TLS->Peers[index]->print_name || strncmp (TLS->Peers[index]->print_name, text, len))) {
+ index ++;
+ }
+ if (index < TLS->peer_num) {
+ *R = strdup (TLS->Peers[index]->print_name);
+ assert (*R);
+ return index;
+ } else {
+ return -1;
+ }
+}
+
+int tgl_secret_chat_for_user (struct tgl_state *TLS, tgl_peer_id_t user_id) {
+ int index = 0;
+ while (index < TLS->peer_num && (tgl_get_peer_type (TLS->Peers[index]->id) != TGL_PEER_ENCR_CHAT || TLS->Peers[index]->encr_chat.user_id != tgl_get_peer_id (user_id) || TLS->Peers[index]->encr_chat.state != sc_ok)) {
+ index ++;
+ }
+ if (index < TLS->peer_num) {
+ return tgl_get_peer_id (TLS->Peers[index]->encr_chat.id);
+ } else {
+ return -1;
+ }
+}
+
+void tgls_free_peer_gw (tgl_peer_t *P, void *TLS) {
+ tgls_free_peer (TLS, P);
+}
+
+void tgls_free_message_gw (struct tgl_message *M, void *TLS) {
+ tgls_free_message (TLS, M);
+}
+
+void tgl_free_all (struct tgl_state *TLS) {
+ tree_act_ex_peer (TLS->peer_tree, tgls_free_peer_gw, TLS);
+ TLS->peer_tree = tree_clear_peer (TLS->peer_tree);
+ TLS->peer_by_name_tree = tree_clear_peer_by_name (TLS->peer_by_name_tree);
+ tree_act_ex_message (TLS->message_tree, tgls_free_message_gw, TLS);
+ TLS->message_tree = tree_clear_message (TLS->message_tree);
+ tree_act_ex_message (TLS->message_unsent_tree, tgls_free_message_gw, TLS);
+ TLS->message_unsent_tree = tree_clear_message (TLS->message_unsent_tree);
+ tglq_query_free_all (TLS);
+
+ if (TLS->encr_prime) { tfree (TLS->encr_prime, 256); }
+
+
+ if (TLS->binlog_name) { tfree_str (TLS->binlog_name); }
+ if (TLS->auth_file) { tfree_str (TLS->auth_file); }
+ if (TLS->downloads_directory) { tfree_str (TLS->downloads_directory); }
+
+ int i;
+ for (i = 0; i < TLS->rsa_key_num; i++) {
+ tfree_str (TLS->rsa_key_list[i]);
+ }
+
+ for (i = 0; i <= TLS->max_dc_num; i++) if (TLS->DC_list[i]) {
+ tgls_free_dc (TLS, TLS->DC_list[i]);
+ }
+ BN_CTX_free (TLS->BN_ctx);
+ tgls_free_pubkey (TLS);
+
+ if (TLS->ev_login) { TLS->timer_methods->free (TLS->ev_login); }
+ if (TLS->online_updates_timer) { TLS->timer_methods->free (TLS->online_updates_timer); }
+}
+
+int tgl_print_stat (struct tgl_state *TLS, char *s, int len) {
+ return tsnprintf (s, len,
+ "users_allocated\t%d\n"
+ "chats_allocated\t%d\n"
+ "encr_chats_allocated\t%d\n"
+ "peer_num\t%d\n"
+ "messages_allocated\t%d\n",
+ TLS->users_allocated,
+ TLS->chats_allocated,
+ TLS->encr_chats_allocated,
+ TLS->peer_num,
+ TLS->messages_allocated
+ );
+}
+
+void tglf_fetch_int_array (int *dst, struct tl_ds_vector *src, int len) {
+ int i;
+ assert (len <= *src->f1);
+ for (i = 0; i < len; i++) {
+ dst[i] = *(int *)src->f2[i];
+ }
+}
+
+void tglf_fetch_int_tuple (int *dst, int **src, int len) {
+ int i;
+ for (i = 0; i < len; i++) {
+ dst[i] = *src[i];
+ }
+}
+
+
+void tgls_messages_mark_read (struct tgl_state *TLS, struct tgl_message *M, int out, int seq) {
+ while (M && M->id > seq) {
+ if ((M->flags & TGLMF_OUT) == out) {
+ if (!(M->flags & TGLMF_UNREAD)) {
+ return;
+ }
+ }
+ M = M->next;
+ }
+ while (M) {
+ if ((M->flags & TGLMF_OUT) == out) {
+ if (M->flags & TGLMF_UNREAD) {
+ M->flags &= ~TGLMF_UNREAD;
+ TLS->callback.marked_read (TLS, 1, &M);
+ } else {
+ return;
+ }
+ }
+ M = M->next;
+ }
+}
+
+void tgls_insert_random2local (struct tgl_state *TLS, long long random_id, int local_id) {
+ struct random2local *X = talloc (sizeof (*X));
+ X->random_id = random_id;
+ X->local_id = local_id;
+
+ struct random2local *R = tree_lookup_random_id (TLS->random_id_tree, X);
+ assert (!R);
+
+ TLS->random_id_tree = tree_insert_random_id (TLS->random_id_tree, X, lrand48 ());
+}
+
+int tgls_get_local_by_random (struct tgl_state *TLS, long long random_id) {
+ struct random2local X;
+ X.random_id = random_id;
+ struct random2local *Y = tree_lookup_random_id (TLS->random_id_tree, &X);
+ if (Y) {
+ TLS->random_id_tree = tree_delete_random_id (TLS->random_id_tree, Y);
+ int y = Y->local_id;
+ tfree (Y, sizeof (*Y));
+ return y;
+ } else {
+ return 0;
+ }
+}
diff --git a/protocols/Telegram/tgl/tg-mime-types.c b/protocols/Telegram/tgl/tg-mime-types.c
new file mode 100644
index 0000000000..578d8da780
--- /dev/null
+++ b/protocols/Telegram/tgl/tg-mime-types.c
@@ -0,0 +1,112 @@
+#include <string.h>
+#include <assert.h>
+#define MAX_MIME_TYPES_NUM 10000
+
+#include "mime-types.c"
+
+static int mime_initialized;
+static int mime_type_number;
+static char *mime_type_names[MAX_MIME_TYPES_NUM];
+static char *mime_type_extensions[MAX_MIME_TYPES_NUM];
+
+static void mime_init (void) {
+ char *start = (char *)mime_types;
+ char *end = start + mime_types_len;
+ mime_initialized = 1;
+ char *c = start;
+ while (c < end) {
+ if (*c == '#') {
+ while (c < end && *c != '\n') {
+ c ++;
+ }
+ if (c < end) {
+ c ++;
+ }
+ } else {
+ while (*c <= ' ' && *c != '\n' && c < end) {
+ c ++;
+ }
+ assert (*c > ' ' && *c != '\n' && c < end);
+ char *name = c;
+ while (*c > ' ' && *c != '\n' && c < end) {
+ c ++;
+ }
+ assert (*c <= ' ' && *c != '\n' && c < end);
+ *c = 0;
+ c ++;
+ while (1) {
+ while (*c <= ' ' && *c != '\n' && c < end) {
+ c ++;
+ }
+ if (*c == '\n' || c == end) {
+ if (*c == '\n') { c ++; }
+ break;
+ }
+ char *ext = c;
+ while (*c > ' ' && *c != '\n' && c < end) {
+ c ++;
+ }
+ assert (c != end);
+ int br = (*c == '\n');
+ *c = 0;
+ c ++;
+ assert (mime_type_number < MAX_MIME_TYPES_NUM);
+ mime_type_names[mime_type_number] = name;
+ mime_type_extensions[mime_type_number] = ext;
+ mime_type_number ++;
+ if (br) { break; }
+ }
+ }
+ }
+}
+
+char *tg_extension_by_mime (const char *mime_type) {
+ if (!mime_initialized) {
+ mime_init ();
+ }
+ int i;
+ for (i = 0; i < mime_type_number; i++) {
+ if (!strcmp (mime_type_names[i], mime_type)) {
+ return mime_type_extensions[i];
+ }
+ }
+ return NULL;
+}
+
+char *tg_mime_by_filename (const char *filename) {
+ int l = strlen (filename);
+ const char *p = filename - 1 + l;
+ while (p >= filename && *p != '.') {
+ p --;
+ }
+ p ++;
+
+ if (!mime_initialized) {
+ mime_init ();
+ }
+
+ static char *def = "application/octet-stream";
+ if (strlen (p) > 10) {
+ return def;
+ }
+ static char s[11];
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ strcpy_s(s, 11, p);
+#else
+ strcpy (s, p);
+#endif
+ char *q = s;
+ while (*q) {
+ if (*q >= 'A' && *p <= 'Z') {
+ *q = *q + 'z' - 'Z';
+ }
+ q ++;
+ }
+ int i;
+ for (i = 0; i < mime_type_number; i++) {
+ if (!strcmp (mime_type_extensions[i], s)) {
+ return mime_type_names[i];
+ }
+ }
+ return def;
+}
diff --git a/protocols/Telegram/tgl/tg-mime-types.h b/protocols/Telegram/tgl/tg-mime-types.h
new file mode 100644
index 0000000000..3a3539e56a
--- /dev/null
+++ b/protocols/Telegram/tgl/tg-mime-types.h
@@ -0,0 +1,3 @@
+char *tg_mime_by_filename (const char *filename);
+char *tg_extension_by_mime (const char *mime_type);
+
diff --git a/protocols/Telegram/tgl/tgl-binlog.h b/protocols/Telegram/tgl/tgl-binlog.h
new file mode 100644
index 0000000000..fdd838f70c
--- /dev/null
+++ b/protocols/Telegram/tgl/tgl-binlog.h
@@ -0,0 +1,73 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Vitaly Valtman 2013-2015
+*/
+#ifndef __BINLOG_H__
+#define __BINLOG_H__
+
+//#include "structures.h"
+#include "tgl.h"
+#include "auto/auto-types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void bl_do_dc_option (struct tgl_state *TLS, int id, const char *name, int l1, const char *ip, int l2, int port);
+void bl_do_dc_option_new (struct tgl_state *TLS, int flags, int id, const char *name, int l1, const char *ip, int l2, int port);
+void bl_do_set_working_dc (struct tgl_state *TLS, int num);
+void bl_do_dc_signed (struct tgl_state *TLS, int id);
+void bl_do_set_our_id (struct tgl_state *TLS, int id);
+void bl_do_set_dh_params (struct tgl_state *TLS, int root, unsigned char prime[], int version);
+
+void bl_do_set_pts (struct tgl_state *TLS, int pts);
+void bl_do_set_qts (struct tgl_state *TLS, int qts);
+void bl_do_set_date (struct tgl_state *TLS, int date);
+void bl_do_set_seq (struct tgl_state *TLS, int seq);
+
+void bl_do_set_msg_id (struct tgl_state *TLS, struct tgl_message *M, int id);
+
+void bl_do_user_delete (struct tgl_state *TLS, struct tgl_user *U);
+void bl_do_encr_chat_delete (struct tgl_state *TLS, struct tgl_secret_chat *U);
+
+void bl_do_chat_add_user (struct tgl_state *TLS, struct tgl_chat *C, int version, int user, int inviter, int date);
+void bl_do_chat_del_user (struct tgl_state *TLS, struct tgl_chat *C, int version, int user);
+
+void bl_do_create_message_new (struct tgl_state *TLS, long long id, int *from_id, int *to_type, int *to_id, int *fwd_from_id, int *fwd_date, int *date, const char *message, int message_len, struct tl_ds_message_media *media, struct tl_ds_message_action *action, int *reply_id, struct tl_ds_reply_markup *reply_markup, int flags);
+
+void bl_do_create_message_encr_new (struct tgl_state *TLS, long long id, int *from_id, int *to_type, int *to_id, int *date, const char *message, int message_len, struct tl_ds_decrypted_message_media *media, struct tl_ds_decrypted_message_action *action, struct tl_ds_encrypted_file *file, int flags);
+void bl_do_message_delete (struct tgl_state *TLS, struct tgl_message *M);
+
+void bl_do_encr_chat_exchange_new (struct tgl_state *TLS, struct tgl_secret_chat *E, long long *exchange_id, const void *key, int *state);
+
+void bl_do_msg_update (struct tgl_state *TLS, long long id);
+void bl_do_reset_authorization (struct tgl_state *TLS);
+
+void bl_do_user_new (struct tgl_state *TLS, int id, long long *access_hash, const char *first_name, int first_name_len, const char *last_name, int last_name_len, const char *phone, int phone_len, const char *username, int username_len, struct tl_ds_photo *photo, const char *real_first_name, int real_first_name_len, const char *real_last_name, int real_last_name_len, struct tl_ds_user_profile_photo *profile_photo, int *last_read_in, int *last_read_out, struct tl_ds_bot_info *bot_info, int flags);
+
+void bl_do_set_auth_key (struct tgl_state *TLS, int num, unsigned char *buf);
+
+void bl_do_chat_new (struct tgl_state *TLS, int id, const char *title, int title_len, int *user_num, int *date, int *version, struct tl_ds_vector *participants, struct tl_ds_chat_photo *chat_photo, struct tl_ds_photo *photo, int *admin, int *last_read_in, int *last_read_out, int flags);
+
+void bl_do_encr_chat_new (struct tgl_state *TLS, int id, long long *access_hash, int *date, int *admin, int *user_id, void *key, void *g_key, void *first_key_id, int *state, int *ttl, int *layer, int *in_seq_no, int *last_in_seq_no, int *out_seq_no, long long *key_fingerprint, int flags);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/tgl-fetch.h b/protocols/Telegram/tgl/tgl-fetch.h
new file mode 100644
index 0000000000..37b2ac5d1d
--- /dev/null
+++ b/protocols/Telegram/tgl/tgl-fetch.h
@@ -0,0 +1,59 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Vitaly Valtman 2014-2015
+*/
+#ifndef __TGL_FETCH_H__
+#define __TGL_FETCH_H__
+#include "tgl.h"
+#include "auto/auto-types.h"
+
+struct tgl_user *tglf_fetch_alloc_user_new (struct tgl_state *TLS, struct tl_ds_user *DS_U);
+struct tgl_user *tglf_fetch_alloc_user_full_new (struct tgl_state *TLS, struct tl_ds_user_full *DS_U);
+struct tgl_chat *tglf_fetch_alloc_chat_new (struct tgl_state *TLS, struct tl_ds_chat *DS_C);
+struct tgl_chat *tglf_fetch_alloc_chat_full_new (struct tgl_state *TLS, struct tl_ds_messages_chat_full *DS_MCF);
+struct tgl_secret_chat *tglf_fetch_alloc_encrypted_chat_new (struct tgl_state *TLS, struct tl_ds_encrypted_chat *DS_EC);
+struct tgl_message *tglf_fetch_alloc_message_new (struct tgl_state *TLS, struct tl_ds_message *DS_M);
+struct tgl_message *tglf_fetch_alloc_message_short (struct tgl_state *TLS);
+struct tgl_message *tglf_fetch_alloc_message_short_chat (struct tgl_state *TLS);
+struct tgl_message *tglf_fetch_alloc_encrypted_message_new (struct tgl_state *TLS, struct tl_ds_encrypted_message *DS_EM);
+tgl_peer_id_t tglf_fetch_peer_id_new (struct tgl_state *TLS, struct tl_ds_peer *DS_P);
+long long tglf_fetch_user_photo_new (struct tgl_state *TLS, struct tgl_user *U, struct tl_ds_user_profile_photo *DS_UPP);
+
+void tglf_fetch_message_media_new (struct tgl_state *TLS, struct tgl_message_media *M, struct tl_ds_message_media *DS_MM);
+void tglf_fetch_message_action_new (struct tgl_state *TLS, struct tgl_message_action *M, struct tl_ds_message_action *DS_MA);
+void tglf_fetch_chat_full (struct tgl_state *TLS, struct tgl_chat *C);
+
+void tglf_fetch_encrypted_message_file_new (struct tgl_state *TLS, struct tgl_message_media *M, struct tl_ds_encrypted_file *DS_EF);
+void tglf_fetch_message_media_encrypted_new (struct tgl_state *TLS, struct tgl_message_media *M, struct tl_ds_decrypted_message_media *DS_DMM);
+void tglf_fetch_message_action_encrypted_new (struct tgl_state *TLS, struct tgl_message_action *M, struct tl_ds_decrypted_message_action *DS_DMA);
+int tglf_fetch_user_status_new (struct tgl_state *TLS, struct tgl_user_status *S, struct tgl_user *U, struct tl_ds_user_status *DS_US);
+enum tgl_typing_status tglf_fetch_typing_new (struct tl_ds_send_message_action *DS_SMA);
+void tglf_fetch_chat_participants_new (struct tgl_state *TLS, struct tgl_chat *C, struct tl_ds_chat_participants *DS_CP);
+void tglf_fetch_int_array (int *dst, struct tl_ds_vector *src, int len);
+void tglf_fetch_int_tuple (int *dst, int **src, int len);
+int tglf_fetch_file_location_new (struct tgl_state *TLS, struct tgl_file_location *loc, struct tl_ds_file_location *DS_FL);
+
+void tglf_fetch_message_short_new (struct tgl_state *TLS, struct tgl_message *M, struct tl_ds_updates *DS_U);
+void tglf_fetch_message_short_chat_new (struct tgl_state *TLS, struct tgl_message *M, struct tl_ds_updates *DS_U);
+
+struct tgl_message *tglf_fetch_alloc_message_short_new (struct tgl_state *TLS, struct tl_ds_updates *DS_U);
+struct tgl_message *tglf_fetch_alloc_message_short_chat_new (struct tgl_state *TLS, struct tl_ds_updates *DS_U);
+struct tgl_photo *tglf_fetch_alloc_photo_new (struct tgl_state *TLS, struct tl_ds_photo *DS_P);
+struct tgl_bot_info *tglf_fetch_alloc_bot_info (struct tgl_state *TLS, struct tl_ds_bot_info *DS_BI);
+struct tgl_message_reply_markup *tglf_fetch_alloc_reply_markup (struct tgl_state *TLS, struct tgl_message *M, struct tl_ds_reply_markup *DS_RM);
+#endif
diff --git a/protocols/Telegram/tgl/tgl-inner.h b/protocols/Telegram/tgl/tgl-inner.h
new file mode 100644
index 0000000000..2ffa932762
--- /dev/null
+++ b/protocols/Telegram/tgl/tgl-inner.h
@@ -0,0 +1,33 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Vitaly Valtman 2014-2015
+*/
+
+#ifndef __TGL_INNER_H__
+#define __TGL_INNER_H__
+
+#ifndef vlogprintf
+#define vlogprintf(verbosity_level,...) \
+ do { \
+ if (TLS->verbosity >= verbosity_level) { \
+ TLS->callback.logprintf (__VA_ARGS__); \
+ } \
+ } while (0)
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/tgl-layout.h b/protocols/Telegram/tgl/tgl-layout.h
new file mode 100644
index 0000000000..fee5b2c3d6
--- /dev/null
+++ b/protocols/Telegram/tgl/tgl-layout.h
@@ -0,0 +1,539 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Vitaly Valtman 2014-2015
+*/
+#ifndef __TGL_LAYOUT_H__
+#define __TGL_LAYOUT_H__
+
+#define TGLDF_IMAGE 1
+#define TGLDF_STICKER 2
+#define TGLDF_ANIMATED 4
+#define TGLDF_AUDIO 8
+#define TGLDF_VIDEO 16
+
+#define TGLMF_UNREAD 1
+#define TGLMF_OUT 2
+#define TGLMF_DISABLE_PREVIEW 4
+#define TGLMF_MENTION 16
+#define TGLMF_CREATED (1 << 8)
+#define TGLMF_PENDING (1 << 9)
+#define TGLMF_DELETED (1 << 10)
+#define TGLMF_ENCRYPTED (1 << 11)
+#define TGLMF_EMPTY (1 << 12)
+#define TGLMF_SERVICE (1 << 13)
+#define TGLMF_SESSION_OUTBOUND (1 << 14)
+
+#define TGLMF_CREATE 0x10000
+
+#define TGLPF_CREATED (1 << 8)
+#define TGLPF_CREATE (1 << 16)
+#define TGLPF_HAS_PHOTO (1 << 11)
+#define TGLPF_DELETED (1 << 10)
+
+#define TGLUF_CONTACT 1
+#define TGLUF_MUTUAL_CONTACT 2
+#define TGLUF_BLOCKED 4
+#define TGLUF_SELF 8
+#define TGLUF_CREATED TGLPF_CREATED
+#define TGLUF_DELETED TGLPF_DELETED
+#define TGLUF_HAS_PHOTO TGLPF_HAS_PHOTO
+#define TGLUF_CREATE TGLPF_CREATE
+#define TGLUF_BOT (1 << 12)
+
+#define TGLCF_CREATED TGLPF_CREATED
+#define TGLCF_CREATE TGLPF_CREATE
+#define TGLCF_HAS_PHOTO TGLPF_HAS_PHOTO
+
+#define TGLECF_CREATED TGLPF_CREATED
+#define TGLECF_CREATE TGLPF_CREATE
+#define TGLECF_HAS_PHOTO TGLPF_HAS_PHOTO
+#define TGLECF_DELETED TGLPF_DELETED
+
+#define TGL_FLAGS_UNCHANGED 0xffff
+
+#define TGLDCF_AUTHORIZED 1
+#define TGLDCF_LOGGED_IN 8
+
+#pragma pack(push,4)
+
+typedef struct { int type; int id; } tgl_peer_id_t;
+
+enum tgl_dc_state {
+ st_init,
+ st_reqpq_sent,
+ st_reqdh_sent,
+ st_client_dh_sent,
+ st_init_temp,
+ st_reqpq_sent_temp,
+ st_reqdh_sent_temp,
+ st_client_dh_sent_temp,
+ st_authorized,
+ st_error
+};
+
+#define MAX_DC_SESSIONS 3
+
+struct tgl_session {
+ struct tgl_dc *dc;
+ long long session_id;
+ long long last_msg_id;
+ int seq_no;
+ int received_messages;
+ struct connection *c;
+ struct tree_long *ack_tree;
+ struct tgl_timer *ev;
+};
+
+struct tgl_dc_option {
+ struct tgl_dc_option *next;
+ char *ip;
+ int port;
+};
+
+struct tgl_dc {
+ int id;
+ //int port;
+ int flags;
+ int rsa_key_idx;
+ enum tgl_dc_state state;
+ //char *ip;
+ //char *user;
+ struct tgl_session *sessions[MAX_DC_SESSIONS];
+ char auth_key[256];
+ char temp_auth_key[256];
+ char nonce[256];
+ char new_nonce[256];
+ char server_nonce[256];
+ long long auth_key_id;
+ long long temp_auth_key_id;
+ long long temp_auth_key_bind_query_id;
+
+ long long server_salt;
+ struct tgl_timer *ev;
+
+ int server_time_delta;
+ double server_time_udelta;
+
+ // ipv4, ipv6, ipv4_media, ipv6_media
+ struct tgl_dc_option *options[4];
+};
+
+enum tgl_message_media_type {
+ tgl_message_media_none,
+ tgl_message_media_photo,
+ tgl_message_media_document,
+ tgl_message_media_geo,
+ tgl_message_media_contact,
+ tgl_message_media_unsupported,
+ //tgl_message_media_photo_encr,
+ //tgl_message_media_video_encr,
+ //tgl_message_media_audio_encr,
+ tgl_message_media_document_encr,
+ tgl_message_media_webpage,
+ tgl_message_media_venue,
+ tgl_message_media_video,
+ tgl_message_media_audio
+};
+
+enum tgl_message_action_type {
+ tgl_message_action_none,
+ tgl_message_action_geo_chat_create,
+ tgl_message_action_geo_chat_checkin,
+ tgl_message_action_chat_create,
+ tgl_message_action_chat_edit_title,
+ tgl_message_action_chat_edit_photo,
+ tgl_message_action_chat_delete_photo,
+ tgl_message_action_chat_add_user,
+ tgl_message_action_chat_add_user_by_link,
+ tgl_message_action_chat_delete_user,
+ tgl_message_action_set_message_ttl,
+ tgl_message_action_read_messages,
+ tgl_message_action_delete_messages,
+ tgl_message_action_screenshot_messages,
+ tgl_message_action_flush_history,
+ tgl_message_action_resend,
+ tgl_message_action_notify_layer,
+ tgl_message_action_typing,
+ tgl_message_action_noop,
+ tgl_message_action_commit_key,
+ tgl_message_action_abort_key,
+ tgl_message_action_request_key,
+ tgl_message_action_accept_key
+};
+
+enum tgl_typing_status {
+ tgl_typing_none,
+ tgl_typing_typing,
+ tgl_typing_cancel,
+ tgl_typing_record_video,
+ tgl_typing_upload_video,
+ tgl_typing_record_audio,
+ tgl_typing_upload_audio,
+ tgl_typing_upload_photo,
+ tgl_typing_upload_document,
+ tgl_typing_geo,
+ tgl_typing_choose_contact
+};
+
+struct tgl_file_location {
+ int dc;
+ long long volume;
+ int local_id;
+ long long secret;
+};
+
+struct tgl_photo_size {
+ char *type;
+ struct tgl_file_location loc;
+ int w;
+ int h;
+ int size;
+ char *data;
+};
+
+struct tgl_geo {
+ double longitude;
+ double latitude;
+};
+
+struct tgl_photo {
+ long long id;
+ long long access_hash;
+ int refcnt;
+ int user_id;
+ int date;
+ char *caption;
+ struct tgl_geo geo;
+ int sizes_num;
+ struct tgl_photo_size *sizes;
+};
+
+struct tgl_encr_document {
+ long long id;
+ long long access_hash;
+ int refcnt;
+
+ int dc_id;
+ int size;
+ int key_fingerprint;
+ int flags;
+
+ unsigned char *key;
+ unsigned char *iv;
+ int w;
+ int h;
+ char *caption;
+ char *mime_type;
+ int duration;
+};
+
+
+struct tgl_user_status {
+ int online;
+ int when;
+ struct tgl_timer *ev;
+};
+
+struct tgl_bot_command {
+ char *command;
+ char *description;
+};
+
+struct tgl_bot_info {
+ int version;
+ char *share_text;
+ char *description;
+ int commands_num;
+ struct tgl_bot_command *commands;
+};
+
+struct tgl_user {
+ tgl_peer_id_t id;
+ int flags;
+ struct tgl_message *last;
+ char *print_name;
+ int structure_version;
+ struct tgl_file_location photo_big;
+ struct tgl_file_location photo_small;
+ int last_read_in;
+ int last_read_out;
+ long long photo_id;
+ struct tgl_photo *photo;
+ char *first_name;
+ char *last_name;
+ char *phone;
+ long long access_hash;
+ struct tgl_user_status status;
+ int blocked;
+ char *real_first_name;
+ char *real_last_name;
+ char *username;
+
+ struct tgl_bot_info *bot_info;
+};
+
+struct tgl_chat_user {
+ int user_id;
+ int inviter_id;
+ int date;
+};
+
+struct tgl_chat {
+ tgl_peer_id_t id;
+ int flags;
+ struct tgl_message *last;
+ char *print_title;
+ int structure_version;
+ struct tgl_file_location photo_big;
+ struct tgl_file_location photo_small;
+ int last_read_in;
+ int last_read_out;
+ struct tgl_photo *photo;
+ char *title;
+ int users_num;
+ int user_list_size;
+ int user_list_version;
+ struct tgl_chat_user *user_list;
+ int date;
+ int version;
+ int admin_id;
+};
+
+enum tgl_secret_chat_state {
+ sc_none,
+ sc_waiting,
+ sc_request,
+ sc_ok,
+ sc_deleted
+};
+
+enum tgl_secret_chat_exchange_state {
+ tgl_sce_none,
+ tgl_sce_requested,
+ tgl_sce_accepted,
+ tgl_sce_committed,
+ tgl_sce_confirmed,
+ tgl_sce_aborted
+};
+
+struct tgl_secret_chat {
+ tgl_peer_id_t id;
+ int flags;
+ struct tgl_message *last;
+ char *print_name;
+ int structure_version;
+ struct tgl_file_location photo_big;
+ struct tgl_file_location photo_small;
+ struct tgl_photo *photo;
+ int user_id;
+ int admin_id;
+ int date;
+ int ttl;
+ int layer;
+ int in_seq_no;
+ int out_seq_no;
+ int last_in_seq_no;
+ long long access_hash;
+ unsigned char *g_key;
+
+ enum tgl_secret_chat_state state;
+ int key[64];
+ long long key_fingerprint;
+ unsigned char first_key_sha[20];
+
+ long long exchange_id;
+ enum tgl_secret_chat_exchange_state exchange_state;
+ int exchange_key[64];
+ long long exchange_key_fingerprint;
+};
+
+typedef union tgl_peer {
+ struct {
+ tgl_peer_id_t id;
+ int flags;
+ struct tgl_message *last;
+ char *print_name;
+ int structure_version;
+ struct tgl_file_location photo_big;
+ struct tgl_file_location photo_small;
+ struct tgl_photo *photo;
+ };
+ struct tgl_user user;
+ struct tgl_chat chat;
+ struct tgl_secret_chat encr_chat;
+} tgl_peer_t;
+/*
+struct tgl_video {
+ long long id;
+ long long access_hash;
+ int user_id;
+ int date;
+ int size;
+ int dc_id;
+ struct tgl_photo_size thumb;
+ char *caption;
+ int duration;
+ int w;
+ int h;
+ char *mime_type;
+};
+
+struct tgl_audio {
+ long long id;
+ long long access_hash;
+ int user_id;
+ int date;
+ int size;
+ int dc_id;
+ int duration;
+ char *mime_type;
+};*/
+
+struct tgl_document {
+ long long id;
+ long long access_hash;
+ int refcnt;
+ int user_id;
+ int date;
+ int size;
+ int dc_id;
+ struct tgl_photo_size thumb;
+ char *caption;
+ char *mime_type;
+
+ int w;
+ int h;
+ int flags;
+ int duration;
+};
+
+struct tgl_message_action {
+ enum tgl_message_action_type type;
+ union {
+ struct {
+ char *title;
+ int user_num;
+ int *users;
+ };
+ char *new_title;
+ struct tgl_photo *photo;
+ int user;
+ int ttl;
+ int layer;
+ int read_cnt;
+ int delete_cnt;
+ int screenshot_cnt;
+ enum tgl_typing_status typing;
+ struct {
+ int start_seq_no;
+ int end_seq_no;
+ };
+ struct {
+ unsigned char *g_a;
+ long long exchange_id;
+ long long key_fingerprint;
+ };
+ };
+};
+
+
+struct tgl_webpage {
+ long long id;
+ int refcnt;
+ char *url;
+ char *display_url;
+ char *type;
+ char *site_name;
+ char *title;
+ char *description;
+ struct tgl_photo *photo;
+ char *embed_url;
+ char *embed_type;
+ int embed_width;
+ int embed_height;
+ int duration;
+ char *author;
+};
+
+struct tgl_message_media {
+ enum tgl_message_media_type type;
+ union {
+ struct {
+ union {
+ struct tgl_photo *photo;
+ struct tgl_document *document;
+ };
+ char *caption;
+ };
+
+ struct tgl_encr_document *encr_document;
+ struct tgl_webpage *webpage;
+
+ struct tgl_geo geo;
+ struct {
+ char *phone;
+ char *first_name;
+ char *last_name;
+ int user_id;
+ };
+
+ struct {
+ void *data;
+ int data_size;
+ };
+ struct {
+ struct tgl_geo geo;
+ char *title;
+ char *address;
+ char *provider;
+ char *venue_id;
+ } venue;
+ };
+};
+
+struct tgl_message_reply_markup {
+ int refcnt;
+ int flags;
+ int rows;
+ int *row_start;
+ char **buttons;
+};
+
+struct tgl_message {
+ struct tgl_message *next_use, *prev_use;
+ struct tgl_message *next, *prev;
+ long long id;
+ int flags;
+ tgl_peer_id_t fwd_from_id;
+ int fwd_date;
+ int reply_id;
+ tgl_peer_id_t from_id;
+ tgl_peer_id_t to_id;
+ int date;
+ struct tgl_message_reply_markup *reply_markup;
+ union {
+ struct tgl_message_action action;
+ struct {
+ char *message;
+ int message_len;
+ struct tgl_message_media media;
+ };
+ };
+};
+#pragma pack(pop)
+#endif
diff --git a/protocols/Telegram/tgl/tgl-methods-in.h b/protocols/Telegram/tgl/tgl-methods-in.h
new file mode 100644
index 0000000000..0d149db7d6
--- /dev/null
+++ b/protocols/Telegram/tgl/tgl-methods-in.h
@@ -0,0 +1,50 @@
+// normally you should not use these methods
+// use them with caution
+
+
+#ifndef __TGL_METHODS_IN_H__
+#define __TGL_METHODS_IN_H__
+
+/* {{{ AUTHORIZATION METHODS. NORMALLY YOU DON'T NEED THEM */
+
+// send query to updated DCs' ips
+// automatically renews data on update
+void tgl_do_help_get_config (struct tgl_state *TLS, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra);
+
+// requests server to send code to specified phone number
+// if user is logged in elsewhere message will first appear as telegram message
+// and SMS will be sent some time after
+void tgl_do_send_code (struct tgl_state *TLS, const char *phone, int phone_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, int registered, const char *hash), void *callback_extra);
+
+// request server to send code via phone call
+void tgl_do_phone_call (struct tgl_state *TLS, const char *phone, int phone_len, const char *hash, int hash_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra);
+
+// sends code from SMS to server. This step should end authorization, unless user have password
+int tgl_do_send_code_result (struct tgl_state *TLS, const char *phone, int phone_len, const char *hash, int hash_len, const char *code, int code_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_user *Self), void *callback_extra);
+
+
+// sends code from SMS, username and lastname to server. This step should end new user registration
+int tgl_do_send_code_result_auth (struct tgl_state *TLS, const char *phone, int phone_len, const char *hash, int hash_len, const char *code, int code_len, const char *first_name, int first_name_len, const char *last_name, int last_name_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_user *Self), void *callback_extra);
+
+/* }}} */
+
+void tgl_do_send_msg (struct tgl_state *TLS, struct tgl_message *M, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra);
+
+void tgl_do_check_password (struct tgl_state *TLS, void (*callback)(struct tgl_state *TLS, void *extra, int success), void *callback_extra);
+
+void tgl_do_export_auth (struct tgl_state *TLS, int num, void (*callback) (struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra);
+
+void tgl_do_create_secret_chat (struct tgl_state *TLS, tgl_peer_id_t id, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_secret_chat *E), void *callback_extra);
+
+void tgl_do_get_difference (struct tgl_state *TLS, int sync_from_start, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra);
+
+void tgl_do_lookup_state (struct tgl_state *TLS);
+
+void tgl_do_help_get_config_dc (struct tgl_state *TLS, struct tgl_dc *D, void (*callback)(struct tgl_state *TLS, void *, int), void *callback_extra);
+
+void tgl_do_request_exchange (struct tgl_state *TLS, struct tgl_secret_chat *E);
+
+void tgl_do_create_keys_end (struct tgl_state *TLS, struct tgl_secret_chat *U);
+
+void tgl_do_send_encr_chat_layer (struct tgl_state *TLS, struct tgl_secret_chat *E);
+#endif
diff --git a/protocols/Telegram/tgl/tgl-net-inner.h b/protocols/Telegram/tgl/tgl-net-inner.h
new file mode 100644
index 0000000000..53b9c10dfe
--- /dev/null
+++ b/protocols/Telegram/tgl/tgl-net-inner.h
@@ -0,0 +1,93 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Vitaly Valtman 2013-2015
+*/
+#ifndef __NET_H__
+#define __NET_H__
+#if !defined(WIN32) || !defined(_WIN32)
+typedef int SOCKET
+#ifndef SOCKET_ERROR
+#define SOCKET_ERROR -1
+#endif
+#endif
+
+struct connection_buffer {
+ unsigned char *start;
+ unsigned char *end;
+ unsigned char *rptr;
+ unsigned char *wptr;
+ struct connection_buffer *next;
+};
+
+enum conn_state {
+ conn_none,
+ conn_connecting,
+ conn_ready,
+ conn_failed,
+ conn_stopped
+};
+
+struct connection {
+ SOCKET fd;
+ char *ip;
+ int port;
+ int flags;
+ enum conn_state state;
+ int ipv6[4];
+ struct connection_buffer *in_head;
+ struct connection_buffer *in_tail;
+ struct connection_buffer *out_head;
+ struct connection_buffer *out_tail;
+ int in_bytes;
+ int out_bytes;
+ int packet_num;
+ int out_packet_num;
+ int last_connect_time;
+ int in_fail_timer;
+ struct mtproto_methods *methods;
+ struct tgl_state *TLS;
+ struct tgl_session *session;
+ struct tgl_dc *dc;
+ void *extra;
+ struct event *ping_ev;
+ struct event *fail_ev;
+ struct event *read_ev;
+ struct event *write_ev;
+ double last_receive_time;
+};
+
+//extern struct connection *Connections[];
+
+int tgln_write_out (struct connection *c, const void *data, int len);
+void tgln_flush_out (struct connection *c);
+int tgln_read_in (struct connection *c, void *data, int len);
+int tgln_read_in_lookup (struct connection *c, void *data, int len);
+
+//void tgln_insert_msg_id (struct tgl_session *S, long long id);
+
+extern struct tgl_net_methods tgl_conn_methods;
+
+//void create_all_outbound_connections (void);
+
+//struct connection *create_connection (const char *host, int port, struct tgl_session *session, struct connection_methods *methods);
+//struct tgl_dc *tgln_alloc_dc (int id, char *ip, int port);
+//void tgln_dc_create_session (struct tgl_dc *DC, struct mtproto_methods *methods);
+struct connection *tgln_create_connection (struct tgl_state *TLS, const char *host, int port, struct tgl_session *session, struct tgl_dc *dc, struct mtproto_methods *methods);
+
+#define GET_DC(c) (c->session->dc)
+#endif
diff --git a/protocols/Telegram/tgl/tgl-net.c b/protocols/Telegram/tgl/tgl-net.c
new file mode 100644
index 0000000000..7439ee145d
--- /dev/null
+++ b/protocols/Telegram/tgl/tgl-net.c
@@ -0,0 +1,674 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Vitaly Valtman 2013-2015
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#define _GNU_SOURCE
+#include <string.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <sys/types.h>
+#include <errno.h>
+#include <stdio.h>
+#if defined(WIN32) || defined(_WIN32)
+#include <io.h>
+#include <fcntl.h>
+#include <sys\types.h>
+#include <sys\stat.h>
+#include <stdint.h>
+#include <string.h>
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#else
+#include <unistd.h>
+#include <sys/socket.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <sys/fcntl.h>
+#include <poll.h>
+#include <arpa/inet.h>
+#include <sys/time.h>
+#endif
+
+#include <openssl/rand.h>
+
+#ifdef EVENT_V2
+#include <event2/event.h>
+#else
+#include <event.h>
+#include "event-old.h"
+#endif
+#include <time.h>
+
+#include "tgl-net-inner.h"
+#include "tgl-net.h"
+#include "tgl.h"
+#include "tgl-inner.h"
+//#include "mtproto-client.h"
+//#include "mtproto-common.h"
+#include "tree.h"
+#include "tools.h"
+#include "mtproto-client.h"
+
+#ifndef POLLRDHUP
+#define POLLRDHUP 0
+#endif
+
+//double get_utime (int clock_id);
+
+//extern struct mtproto_methods auth_methods;
+
+static void fail_connection (struct connection *c);
+
+#define PING_TIMEOUT 10
+
+static void start_ping_timer (struct connection *c);
+static void ping_alarm (evutil_socket_t fd, short what, void *arg) {
+ struct connection *c = arg;
+ struct tgl_state *TLS = c->TLS;
+ vlogprintf (E_DEBUG + 2,"ping alarm\n");
+ assert (c->state == conn_ready || c->state == conn_connecting);
+ if (tglt_get_double_time () - c->last_receive_time > 6 * PING_TIMEOUT) {
+ vlogprintf (E_WARNING, "fail connection: reason: ping timeout\n");
+ c->state = conn_failed;
+ fail_connection (c);
+ } else if (tglt_get_double_time () - c->last_receive_time > 3 * PING_TIMEOUT && c->state == conn_ready) {
+ tgl_do_send_ping (c->TLS, c);
+ start_ping_timer (c);
+ } else {
+ start_ping_timer (c);
+ }
+}
+
+static void stop_ping_timer (struct connection *c) {
+ event_del (c->ping_ev);
+}
+
+static void start_ping_timer (struct connection *c) {
+ static struct timeval ptimeout = { PING_TIMEOUT, 0};
+ event_add (c->ping_ev, &ptimeout);
+}
+
+static void restart_connection (struct connection *c);
+
+static void fail_alarm (evutil_socket_t fd, short what, void *arg) {
+ struct connection *c = arg;
+ c->in_fail_timer = 0;
+ restart_connection (c);
+}
+
+static void start_fail_timer (struct connection *c) {
+ if (c->in_fail_timer) { return; }
+ c->in_fail_timer = 1;
+
+ static struct timeval ptimeout = { 10, 0};
+ event_add (c->fail_ev, &ptimeout);
+}
+
+static struct connection_buffer *new_connection_buffer (int size) {
+ struct connection_buffer *b = talloc0 (sizeof (*b));
+ b->start = talloc (size);
+ b->end = b->start + size;
+ b->rptr = b->wptr = b->start;
+ return b;
+}
+
+static void delete_connection_buffer (struct connection_buffer *b) {
+ tfree (b->start, b->end - b->start);
+ tfree (b, sizeof (*b));
+}
+
+int tgln_write_out (struct connection *c, const void *_data, int len) {
+ struct tgl_state *TLS = c->TLS;
+ vlogprintf (E_DEBUG, "write_out: %d bytes\n", len);
+ const unsigned char *data = _data;
+ if (!len) { return 0; }
+ assert (len > 0);
+ int x = 0;
+ if (!c->out_bytes) {
+ event_add (c->write_ev, 0);
+ }
+ if (!c->out_head) {
+ struct connection_buffer *b = new_connection_buffer (1 << 20);
+ c->out_head = c->out_tail = b;
+ }
+ while (len) {
+ if (c->out_tail->end - c->out_tail->wptr >= len) {
+ memcpy (c->out_tail->wptr, data, len);
+ c->out_tail->wptr += len;
+ c->out_bytes += len;
+ return x + len;
+ } else {
+ int y = c->out_tail->end - c->out_tail->wptr;
+ assert (y < len);
+ memcpy (c->out_tail->wptr, data, y);
+ x += y;
+ len -= y;
+ data += y;
+ struct connection_buffer *b = new_connection_buffer (1 << 20);
+ c->out_tail->next = b;
+ b->next = 0;
+ c->out_tail = b;
+ c->out_bytes += y;
+ }
+ }
+ return x;
+}
+
+int tgln_read_in (struct connection *c, void *_data, int len) {
+ unsigned char *data = _data;
+ if (!len) { return 0; }
+ assert (len > 0);
+ if (len > c->in_bytes) {
+ len = c->in_bytes;
+ }
+ int x = 0;
+ while (len) {
+ int y = c->in_head->wptr - c->in_head->rptr;
+ if (y > len) {
+ memcpy (data, c->in_head->rptr, len);
+ c->in_head->rptr += len;
+ c->in_bytes -= len;
+ return x + len;
+ } else {
+ memcpy (data, c->in_head->rptr, y);
+ c->in_bytes -= y;
+ x += y;
+ data += y;
+ len -= y;
+ void *old = c->in_head;
+ c->in_head = c->in_head->next;
+ if (!c->in_head) {
+ c->in_tail = 0;
+ }
+ delete_connection_buffer (old);
+ }
+ }
+ return x;
+}
+
+int tgln_read_in_lookup (struct connection *c, void *_data, int len) {
+ unsigned char *data = _data;
+ if (!len || !c->in_bytes) { return 0; }
+ assert (len > 0);
+ if (len > c->in_bytes) {
+ len = c->in_bytes;
+ }
+ int x = 0;
+ struct connection_buffer *b = c->in_head;
+ while (len) {
+ int y = b->wptr - b->rptr;
+ if (y >= len) {
+ memcpy (data, b->rptr, len);
+ return x + len;
+ } else {
+ memcpy (data, b->rptr, y);
+ x += y;
+ data += y;
+ len -= y;
+ b = b->next;
+ }
+ }
+ return x;
+}
+
+void tgln_flush_out (struct connection *c) {
+}
+
+#define MAX_CONNECTIONS 100
+static struct connection *Connections[MAX_CONNECTIONS];
+static int max_connection_fd;
+
+static void rotate_port (struct connection *c) {
+ switch (c->port) {
+ case 443:
+ c->port = 80;
+ break;
+ case 80:
+ c->port = 25;
+ break;
+ case 25:
+ c->port = 443;
+ break;
+ }
+}
+
+static void try_read (struct connection *c);
+static void try_write (struct connection *c);
+
+static void conn_try_read (evutil_socket_t fd, short what, void *arg) {
+ struct connection *c = arg;
+ struct tgl_state *TLS = c->TLS;
+ vlogprintf (E_DEBUG + 1, "Try read. Fd = %d\n", c->fd);
+ try_read (c);
+}
+static void conn_try_write (evutil_socket_t fd, short what, void *arg) {
+ struct connection *c = arg;
+ struct tgl_state *TLS = c->TLS;
+ if (c->state == conn_connecting) {
+ c->state = conn_ready;
+ c->methods->ready (TLS, c);
+ }
+ try_write (c);
+ if (c->out_bytes) {
+ event_add (c->write_ev, 0);
+ }
+}
+
+static SOCKET my_connect (struct connection *c, const char *host) {
+ struct tgl_state *TLS = c->TLS;
+ int v6 = TLS->ipv6_enabled;
+ SOCKET fd = socket (v6 ? AF_INET6 : AF_INET, SOCK_STREAM, 0);
+#if defined(WIN32) || defined(_WIN32)
+ if (fd == INVALID_SOCKET) {
+ vlogprintf(E_ERROR, "Can not create socket: %s\n", GetLastErrorStr(WSAGetLastError()));
+#else
+ if (fd < 0) {
+ vlogprintf (E_ERROR, "Can not create socket: %m\n");
+#endif
+ start_fail_timer (c);
+ return SOCKET_ERROR;
+ }
+
+#if defined(WIN32) || defined(_WIN32)
+ assert(++max_connection_fd < MAX_CONNECTIONS);
+#else
+ assert (fd >= 0 && fd < MAX_CONNECTIONS);
+ if (fd > max_connection_fd) {
+ max_connection_fd = fd;
+ }
+#endif
+
+ int flags = -1;
+ setsockopt (fd, SOL_SOCKET, SO_REUSEADDR, (const char *)&flags, sizeof (flags));
+ setsockopt (fd, SOL_SOCKET, SO_KEEPALIVE, (const char *)&flags, sizeof (flags));
+ setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, (const char *)&flags, sizeof (flags));
+
+ struct sockaddr_in addr;
+ struct sockaddr_in6 addr6;
+ memset (&addr, 0, sizeof (addr));
+ memset (&addr6, 0, sizeof (addr6));
+ if (v6) {
+ addr6.sin6_family = AF_INET6;
+ addr6.sin6_port = htons (c->port);
+ if (inet_pton (AF_INET6, host, &addr6.sin6_addr.s6_addr) != 1) {
+ vlogprintf (E_ERROR, "Bad ipv6 %s\n", host);
+#if defined(WIN32) || defined(_WIN32)
+ closesocket (fd);
+ max_connection_fd--;
+#else
+ close (fd);
+#endif
+ return SOCKET_ERROR;
+ }
+ } else {
+ addr.sin_family = AF_INET;
+ addr.sin_port = htons (c->port);
+ if (inet_pton (AF_INET, host, &addr.sin_addr.s_addr) != 1) {
+ vlogprintf (E_ERROR, "Bad ipv4 %s\n", host);
+#if defined(WIN32) || defined(_WIN32)
+ closesocket (fd);
+ max_connection_fd--;
+#else
+ close (fd);
+#endif
+ return SOCKET_ERROR;
+ }
+ }
+
+#if defined(WIN32) || defined(_WIN32)
+ unsigned long nonblocking = 1;
+ assert (ioctlsocket (fd, FIONBIO, &nonblocking) != SOCKET_ERROR);
+#else
+ fcntl (fd, F_SETFL, O_NONBLOCK);
+#endif
+
+#if defined(WIN32) || defined(_WIN32)
+ if (connect (fd, (struct sockaddr *) (v6 ? (void *)&addr6 : (void *)&addr), v6 ? sizeof (addr6) : sizeof (addr)) != 0) {
+ if (WSAGetLastError () != WSAEWOULDBLOCK) {
+ closesocket (fd);
+ max_connection_fd--;
+#else
+ if (connect (fd, (struct sockaddr *) (v6 ? (void *)&addr6 : (void *)&addr), v6 ? sizeof (addr6) : sizeof (addr)) == -1) {
+ if (errno != EINPROGRESS) {
+ close (fd);
+#endif
+ return SOCKET_ERROR;
+ }
+ }
+ return fd;
+}
+
+struct connection *tgln_create_connection (struct tgl_state *TLS, const char *host, int port, struct tgl_session *session, struct tgl_dc *dc, struct mtproto_methods *methods) {
+ struct connection *c = talloc0 (sizeof (*c));
+ c->TLS = TLS;
+ c->ip = tstrdup (host);
+ c->port = port;
+
+ SOCKET fd = my_connect (c, c->ip);
+ if (fd == SOCKET_ERROR) {
+#if defined(WIN32) || defined(_WIN32)
+ vlogprintf(E_ERROR, "Can not connect to %s:%d %s\n", host, port, GetLastErrorStr (WSAGetLastError ()));
+#else
+ vlogprintf (E_ERROR, "Can not connect to %s:%d %m\n", host, port);
+#endif
+ tfree (c, sizeof (*c));
+ return 0;
+ }
+
+ c->fd = fd;
+ c->state = conn_connecting;
+ c->last_receive_time = tglt_get_double_time ();
+ c->flags = 0;
+ assert (!Connections[fd]);
+ Connections[fd] = c;
+
+ c->ping_ev = evtimer_new (TLS->ev_base, ping_alarm, c);
+ c->fail_ev = evtimer_new (TLS->ev_base, fail_alarm, c);
+ c->write_ev = event_new (TLS->ev_base, c->fd, EV_WRITE, conn_try_write, c);
+
+ struct timeval tv = {5, 0};
+ c->read_ev = event_new (TLS->ev_base, c->fd, EV_READ | EV_PERSIST, conn_try_read, c);
+ event_add (c->read_ev, &tv);
+
+ start_ping_timer (c);
+
+ c->dc = dc;
+ c->session = session;
+ c->methods = methods;
+
+ char byte = 0xef;
+ assert (tgln_write_out (c, &byte, 1) == 1);
+ tgln_flush_out (c);
+
+ return c;
+}
+
+static void restart_connection (struct connection *c) {
+ struct tgl_state *TLS = c->TLS;
+ if (c->last_connect_time == time (0)) {
+ start_fail_timer (c);
+ return;
+ }
+
+ /*if (strcmp (c->ip, c->dc->ip)) {
+ tfree_str (c->ip);
+ c->ip = tstrdup (c->dc->ip);
+ }*/
+ c->last_connect_time = (int)time (0);
+ SOCKET fd = my_connect (c, c->ip);
+ if (fd == SOCKET_ERROR) {
+#if defined(WIN32) || defined(_WIN32)
+ vlogprintf(E_ERROR, "Can not connect to %s:%d %s\n", c->ip, c->port, GetLastErrorStr (WSAGetLastError ()));
+#else
+ vlogprintf (E_WARNING, "Can not connect to %s:%d %m\n", c->ip, c->port);
+#endif
+ start_fail_timer (c);
+ return;
+ }
+
+ c->fd = fd;
+ c->state = conn_connecting;
+ c->last_receive_time = tglt_get_double_time ();
+ start_ping_timer (c);
+ Connections[fd] = c;
+
+ c->write_ev = event_new (TLS->ev_base, c->fd, EV_WRITE, conn_try_write, c);
+
+ struct timeval tv = {5, 0};
+ c->read_ev = event_new (TLS->ev_base, c->fd, EV_READ | EV_PERSIST, conn_try_read, c);
+ event_add (c->read_ev, &tv);
+
+ char byte = 0xef;
+ assert (tgln_write_out (c, &byte, 1) == 1);
+ tgln_flush_out (c);
+}
+
+static void fail_connection (struct connection *c) {
+ struct tgl_state *TLS = c->TLS;
+ if (c->state == conn_ready || c->state == conn_connecting) {
+ stop_ping_timer (c);
+ }
+ event_free (c->write_ev);
+ event_free (c->read_ev);
+
+ rotate_port (c);
+ struct connection_buffer *b = c->out_head;
+ while (b) {
+ struct connection_buffer *d = b;
+ b = b->next;
+ delete_connection_buffer (d);
+ }
+ b = c->in_head;
+ while (b) {
+ struct connection_buffer *d = b;
+ b = b->next;
+ delete_connection_buffer (d);
+ }
+ c->out_head = c->out_tail = c->in_head = c->in_tail = 0;
+ c->state = conn_failed;
+ c->out_bytes = c->in_bytes = 0;
+#if defined(WIN32) || defined(_WIN32)
+ closesocket (c->fd);
+ max_connection_fd--;
+#else
+ close (c->fd);
+#endif
+ Connections[c->fd] = 0;
+ vlogprintf (E_NOTICE, "Lost connection to server... %s:%d\n", c->ip, c->port);
+ restart_connection (c);
+}
+
+//extern FILE *log_net_f;
+static void try_write (struct connection *c) {
+ struct tgl_state *TLS = c->TLS;
+ vlogprintf (E_DEBUG, "try write: fd = %d\n", c->fd);
+ int x = 0;
+ while (c->out_head) {
+#if defined(WIN32) || defined(_WIN32)
+ int r = send(c->fd, c->out_head->rptr, c->out_head->wptr - c->out_head->rptr, 0);
+ if (r != SOCKET_ERROR) {
+#else
+ int r = write (c->fd, c->out_head->rptr, c->out_head->wptr - c->out_head->rptr);
+ if (r >= 0) {
+#endif
+ x += r;
+ c->out_head->rptr += r;
+ if (c->out_head->rptr != c->out_head->wptr) {
+ break;
+ }
+ struct connection_buffer *b = c->out_head;
+ c->out_head = b->next;
+ if (!c->out_head) {
+ c->out_tail = 0;
+ }
+ delete_connection_buffer (b);
+ } else {
+#if defined(WIN32) || defined(_WIN32)
+ if (/*WSAGetLastError() != EAGAIN && */WSAGetLastError() != WSAEWOULDBLOCK) {
+ vlogprintf(E_NOTICE, "fail_connection: write_error %s\n", GetLastErrorStr(WSAGetLastError()));
+#else
+ if (errno != EAGAIN && errno != EWOULDBLOCK) {
+ vlogprintf (E_NOTICE, "fail_connection: write_error %m\n");
+#endif
+ fail_connection (c);
+ return;
+ } else {
+ break;
+ }
+ }
+ }
+ vlogprintf (E_DEBUG, "Sent %d bytes to %d\n", x, c->fd);
+ c->out_bytes -= x;
+}
+
+static void try_rpc_read (struct connection *c) {
+ assert (c->in_head);
+ struct tgl_state *TLS = c->TLS;
+
+ while (1) {
+ if (c->in_bytes < 1) { return; }
+ unsigned len = 0;
+ unsigned t = 0;
+ assert (tgln_read_in_lookup (c, &len, 1) == 1);
+ if (len >= 1 && len <= 0x7e) {
+ if (c->in_bytes < (int)(1 + 4 * len)) { return; }
+ } else {
+ if (c->in_bytes < 4) { return; }
+ assert (tgln_read_in_lookup (c, &len, 4) == 4);
+ len = (len >> 8);
+ if (c->in_bytes < (int)(4 + 4 * len)) { return; }
+ len = 0x7f;
+ }
+
+ if (len >= 1 && len <= 0x7e) {
+ assert (tgln_read_in (c, &t, 1) == 1);
+ assert (t == len);
+ assert (len >= 1);
+ } else {
+ assert (len == 0x7f);
+ assert (tgln_read_in (c, &len, 4) == 4);
+ len = (len >> 8);
+ assert (len >= 1);
+ }
+ len *= 4;
+ int op;
+ assert (tgln_read_in_lookup (c, &op, 4) == 4);
+ if (c->methods->execute (TLS, c, op, len) < 0) {
+ return;
+ }
+ }
+}
+
+static void try_read (struct connection *c) {
+ struct tgl_state *TLS = c->TLS;
+ vlogprintf (E_DEBUG, "try read: fd = %d\n", c->fd);
+ if (!c->in_tail) {
+ c->in_head = c->in_tail = new_connection_buffer (1 << 20);
+ }
+ #ifdef EVENT_V1
+ struct timeval tv = {5, 0};
+ event_add (c->read_ev, &tv);
+ #endif
+ int x = 0;
+ while (1) {
+#if defined(WIN32) || defined(_WIN32)
+ int r = recv(c->fd, c->in_tail->wptr, c->in_tail->end - c->in_tail->wptr, 0);
+ if (r != SOCKET_ERROR) {
+#else
+ int r = read (c->fd, c->in_tail->wptr, c->in_tail->end - c->in_tail->wptr);
+ if (r > 0) {
+#endif
+ c->last_receive_time = tglt_get_double_time ();
+ stop_ping_timer (c);
+ start_ping_timer (c);
+ }
+ if (r >= 0) {
+ c->in_tail->wptr += r;
+ x += r;
+ if (c->in_tail->wptr != c->in_tail->end) {
+ break;
+ }
+ struct connection_buffer *b = new_connection_buffer (1 << 20);
+ c->in_tail->next = b;
+ c->in_tail = b;
+ } else {
+#if defined(WIN32) || defined(_WIN32)
+ if (/*WSAGetLastError() != EAGAIN &&*/ WSAGetLastError() != WSAEWOULDBLOCK) {
+ vlogprintf(E_NOTICE, "fail_connection: read_error %s\n", GetLastErrorStr(WSAGetLastError()));
+#else
+ if (errno != EAGAIN && errno != EWOULDBLOCK) {
+ vlogprintf (E_NOTICE, "fail_connection: read_error %m\n");
+#endif
+ fail_connection (c);
+ return;
+ } else {
+ break;
+ }
+ }
+ }
+ vlogprintf (E_DEBUG, "Received %d bytes from %d\n", x, c->fd);
+ c->in_bytes += x;
+ if (x) {
+ try_rpc_read (c);
+ }
+}
+
+static void incr_out_packet_num (struct connection *c) {
+ c->out_packet_num ++;
+}
+
+static struct tgl_dc *get_dc (struct connection *c) {
+ return c->dc;
+}
+
+static struct tgl_session *get_session (struct connection *c) {
+ return c->session;
+}
+
+static void tgln_free (struct connection *c) {
+ if (c->ip) { tfree_str (c->ip); }
+ if (c->ping_ev) { event_free (c->ping_ev); }
+ if (c->fail_ev) { event_free (c->fail_ev); }
+ if (c->read_ev) { event_free (c->read_ev); }
+ if (c->write_ev) { event_free (c->write_ev); }
+
+ struct connection_buffer *b = c->out_head;
+ while (b) {
+ struct connection_buffer *d = b;
+ b = b->next;
+ delete_connection_buffer (d);
+ }
+ b = c->in_head;
+ while (b) {
+ struct connection_buffer *d = b;
+ b = b->next;
+ delete_connection_buffer (d);
+ }
+
+ if (c->fd >= 0) {
+ Connections[c->fd] = 0;
+#if defined(WIN32) || defined(_WIN32)
+ closesocket (c->fd);
+ max_connection_fd--;
+#else
+ close (c->fd);
+#endif
+ }
+ tfree (c, sizeof (*c));
+}
+
+struct tgl_net_methods tgl_conn_methods = {
+ .write_out = tgln_write_out,
+ .read_in = tgln_read_in,
+ .read_in_lookup = tgln_read_in_lookup,
+ .flush_out = tgln_flush_out,
+ .incr_out_packet_num = incr_out_packet_num,
+ .get_dc = get_dc,
+ .get_session = get_session,
+ .create_connection = tgln_create_connection,
+ .free = tgln_free
+};
diff --git a/protocols/Telegram/tgl/tgl-net.h b/protocols/Telegram/tgl/tgl-net.h
new file mode 100644
index 0000000000..6c589a4a38
--- /dev/null
+++ b/protocols/Telegram/tgl/tgl-net.h
@@ -0,0 +1,24 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Vitaly Valtman 2013-2015
+*/
+#ifndef __NET_H__
+#define __NET_H__
+
+extern struct tgl_net_methods tgl_conn_methods;
+#endif
diff --git a/protocols/Telegram/tgl/tgl-structures.h b/protocols/Telegram/tgl/tgl-structures.h
new file mode 100644
index 0000000000..4e3fd9ec32
--- /dev/null
+++ b/protocols/Telegram/tgl/tgl-structures.h
@@ -0,0 +1,69 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Vitaly Valtman 2013-2015
+*/
+#ifndef __STRUCTURES_H__
+#define __STRUCTURES_H__
+
+#include <assert.h>
+#include "tgl-layout.h"
+#include "tgl-fetch.h"
+#include "tgl.h"
+
+char *tgls_default_create_print_name (struct tgl_state *TLS, tgl_peer_id_t id, const char *a1, const char *a2, const char *a3, const char *a4);
+
+
+void tgls_free_user (struct tgl_state *TLS, struct tgl_user *U);
+void tgls_free_chat (struct tgl_state *TLS, struct tgl_chat *U);
+void tgls_free_photo (struct tgl_state *TLS, struct tgl_photo *P);
+void tgls_free_message (struct tgl_state *TLS, struct tgl_message *M);
+void tgls_free_bot_info (struct tgl_state *TLS, struct tgl_bot_info *B);
+void tgls_clear_message (struct tgl_state *TLS, struct tgl_message *M);
+
+struct tgl_message *tglm_message_alloc (struct tgl_state *TLS, long long id);
+void tglm_message_insert_tree (struct tgl_state *TLS, struct tgl_message *M);
+void tglm_update_message_id (struct tgl_state *TLS, struct tgl_message *M, long long id);
+void tglm_message_insert (struct tgl_state *TLS, struct tgl_message *M);
+void tglm_message_insert_unsent (struct tgl_state *TLS, struct tgl_message *M);
+void tglm_message_remove_unsent (struct tgl_state *TLS, struct tgl_message *M);
+void tglm_send_all_unsent (struct tgl_state *TLS);
+void tglm_message_remove_tree (struct tgl_state *TLS, struct tgl_message *M);
+void tglm_message_add_peer (struct tgl_state *TLS, struct tgl_message *M);
+void tglm_message_del_peer (struct tgl_state *TLS, struct tgl_message *M);
+void tglm_message_del_use (struct tgl_state *TLS, struct tgl_message *M);
+void tglm_message_add_use (struct tgl_state *TLS, struct tgl_message *M);
+
+void tglp_peer_insert_name (struct tgl_state *TLS, tgl_peer_t *P);
+void tglp_peer_delete_name (struct tgl_state *TLS, tgl_peer_t *P);
+void tglp_insert_encrypted_chat (struct tgl_state *TLS, tgl_peer_t *P);
+void tglp_insert_user (struct tgl_state *TLS, tgl_peer_t *P);
+void tglp_insert_chat (struct tgl_state *TLS, tgl_peer_t *P);
+enum tgl_typing_status tglf_fetch_typing (void);
+void tgls_messages_mark_read (struct tgl_state *TLS, struct tgl_message *M, int out, int seq);
+
+void tgls_insert_random2local (struct tgl_state *TLS, long long random_id, int local_id);
+int tgls_get_local_by_random (struct tgl_state *TLS, long long random_id);
+
+
+void tgl_photo_insert (struct tgl_state *TLS, struct tgl_photo *P);
+struct tgl_photo *tgl_photo_get (struct tgl_state *TLS, long long id);
+struct tgl_document *tgl_document_get (struct tgl_state *TLS, long long id);
+void tgl_document_insert (struct tgl_state *TLS, struct tgl_document *P);
+struct tgl_webpage *tgl_webpage_get (struct tgl_state *TLS, long long id);
+void tgl_webpage_insert (struct tgl_state *TLS, struct tgl_webpage *P);
+#endif
diff --git a/protocols/Telegram/tgl/tgl-timers.c b/protocols/Telegram/tgl/tgl-timers.c
new file mode 100644
index 0000000000..d68f9ac0ec
--- /dev/null
+++ b/protocols/Telegram/tgl/tgl-timers.c
@@ -0,0 +1,69 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Vitaly Valtman 2013-2015
+*/
+#include "config.h"
+#ifdef EVENT_V2
+#include <event2/event.h>
+#include <event2/bufferevent.h>
+#include <event2/buffer.h>
+#else
+#include <event.h>
+#include "event-old.h"
+#endif
+
+#include "tgl.h"
+#include <stdlib.h>
+
+static void timer_alarm (evutil_socket_t fd, short what, void *arg) {
+ void **p = arg;
+ ((void (*)(struct tgl_state *, void *))p[1]) (p[0], p[2]);
+}
+
+struct tgl_timer *tgl_timer_alloc (struct tgl_state *TLS, void (*cb)(struct tgl_state *TLS, void *arg), void *arg) {
+ void **p = malloc (sizeof (void *) * 3);
+ p[0] = TLS;
+ p[1] = cb;
+ p[2] = arg;
+ return (void *)evtimer_new (TLS->ev_base, timer_alarm, p);
+}
+
+void tgl_timer_insert (struct tgl_timer *t, double p) {
+ if (p < 0) { p = 0; }
+ double e = p - (int)p;
+ if (e < 0) { e = 0; }
+ struct timeval pv = { (int)p, (int)(e * 1e6)};
+ event_add ((void *)t, &pv);
+}
+
+void tgl_timer_delete (struct tgl_timer *t) {
+ event_del ((void *)t);
+}
+
+void tgl_timer_free (struct tgl_timer *t) {
+ void *arg = event_get_callback_arg ((void *)t);
+ free (arg);
+ event_free ((void *)t);
+}
+
+struct tgl_timer_methods tgl_libevent_timers = {
+ .alloc = tgl_timer_alloc,
+ .insert = tgl_timer_insert,
+ .remove = tgl_timer_delete,
+ .free = tgl_timer_free
+};
diff --git a/protocols/Telegram/tgl/tgl-timers.h b/protocols/Telegram/tgl/tgl-timers.h
new file mode 100644
index 0000000000..7f52f3bd15
--- /dev/null
+++ b/protocols/Telegram/tgl/tgl-timers.h
@@ -0,0 +1,27 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Vitaly Valtman 2013-2015
+*/
+
+#ifndef __TGL_TIMERS_H__
+#define __TGL_TIMERS_H__
+
+#include "tgl.h"
+extern struct tgl_timer_methods tgl_libevent_timers;
+
+#endif
diff --git a/protocols/Telegram/tgl/tgl.c b/protocols/Telegram/tgl/tgl.c
new file mode 100644
index 0000000000..dd4f2713c9
--- /dev/null
+++ b/protocols/Telegram/tgl/tgl.c
@@ -0,0 +1,149 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Vitaly Valtman 2014-2015
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "tgl.h"
+#include "tools.h"
+#include "mtproto-client.h"
+#include "tgl-structures.h"
+//#include "net.h"
+
+#include <assert.h>
+
+struct tgl_state tgl_state;
+
+
+void tgl_set_binlog_mode (struct tgl_state *TLS, int mode) {
+ TLS->binlog_enabled = mode;
+}
+
+void tgl_set_binlog_path (struct tgl_state *TLS, const char *path) {
+ TLS->binlog_name = tstrdup (path);
+}
+
+void tgl_set_auth_file_path (struct tgl_state *TLS, const char *path) {
+ TLS->auth_file = tstrdup (path);
+}
+
+void tgl_set_download_directory (struct tgl_state *TLS, const char *path) {
+ TLS->downloads_directory = tstrdup (path);
+}
+
+void tgl_set_callback (struct tgl_state *TLS, struct tgl_update_callback *cb) {
+ TLS->callback = *cb;
+}
+
+void tgl_set_rsa_key (struct tgl_state *TLS, const char *key) {
+ assert (TLS->rsa_key_num < TGL_MAX_RSA_KEYS_NUM);
+ TLS->rsa_key_list[TLS->rsa_key_num ++] = tstrdup (key);
+}
+
+void tgl_init (struct tgl_state *TLS) {
+ assert (TLS->timer_methods);
+ assert (TLS->net_methods);
+ if (!TLS->callback.create_print_name) {
+ TLS->callback.create_print_name = tgls_default_create_print_name;
+ }
+ if (!TLS->temp_key_expire_time) {
+ TLS->temp_key_expire_time = 100000;
+ }
+
+ TLS->message_list.next_use = &TLS->message_list;
+ TLS->message_list.prev_use = &TLS->message_list;
+
+ tglmp_on_start (TLS);
+
+ if (!TLS->app_id) {
+ TLS->app_id = TG_APP_ID;
+ TLS->app_hash = tstrdup (TG_APP_HASH);
+ }
+}
+
+int tgl_authorized_dc (struct tgl_state *TLS, struct tgl_dc *DC) {
+ assert (DC);
+ return (DC->flags & 4) != 0;//DC->auth_key_id;
+}
+
+int tgl_signed_dc (struct tgl_state *TLS, struct tgl_dc *DC) {
+ assert (DC);
+ return (DC->flags & TGLDCF_LOGGED_IN) != 0;
+}
+
+void tgl_register_app_id (struct tgl_state *TLS, int app_id, const char *app_hash) {
+ TLS->app_id = app_id;
+ TLS->app_hash = tstrdup (app_hash);
+}
+
+struct tgl_state *tgl_state_alloc (void) {
+ struct tgl_state *TLS = (struct tgl_state *)malloc (sizeof (*TLS));
+ if (!TLS) { return NULL; }
+ memset (TLS, 0, sizeof (*TLS));
+ return TLS;
+}
+
+void tgl_incr_verbosity (struct tgl_state *TLS) {
+ TLS->verbosity ++;
+}
+
+void tgl_set_verbosity (struct tgl_state *TLS, int val) {
+ TLS->verbosity = val;
+}
+
+void tgl_enable_pfs (struct tgl_state *TLS) {
+ TLS->enable_pfs = 1;
+}
+
+void tgl_set_test_mode (struct tgl_state *TLS) {
+ TLS->test_mode ++;
+}
+
+void tgl_set_net_methods (struct tgl_state *TLS, struct tgl_net_methods *methods) {
+ TLS->net_methods = methods;
+}
+
+void tgl_set_timer_methods (struct tgl_state *TLS, struct tgl_timer_methods *methods) {
+ TLS->timer_methods = methods;
+}
+
+void tgl_set_ev_base (struct tgl_state *TLS, void *ev_base) {
+ TLS->ev_base = ev_base;
+}
+
+void tgl_set_app_version (struct tgl_state *TLS, const char *app_version) {
+ if (TLS->app_version) {
+ tfree_str (TLS->app_version);
+ }
+ TLS->app_version = tstrdup (app_version);
+}
+
+void tgl_enable_ipv6 (struct tgl_state *TLS) {
+ TLS->ipv6_enabled = 1;
+}
+
+void tgl_disable_link_preview (struct tgl_state *TLS) {
+ TLS->disable_link_preview = 1;
+}
+
+void tgl_enable_bot (struct tgl_state *TLS) {
+ TLS->is_bot = 1;
+}
diff --git a/protocols/Telegram/tgl/tgl.h b/protocols/Telegram/tgl/tgl.h
new file mode 100644
index 0000000000..2da8c7a254
--- /dev/null
+++ b/protocols/Telegram/tgl/tgl.h
@@ -0,0 +1,659 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Vitaly Valtman 2014-2015
+*/
+#ifndef __TGL_H__
+#define __TGL_H__
+
+#include "tgl-layout.h"
+#include <string.h>
+#include <stdlib.h>
+#ifdef _WIN32
+#include "config.h"
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#endif
+
+#define TGL_MAX_DC_NUM 100
+#define TG_SERVER_1 "149.154.175.50"
+#define TG_SERVER_2 "149.154.167.51"
+#define TG_SERVER_3 "149.154.175.100"
+#define TG_SERVER_4 "149.154.167.91"
+#define TG_SERVER_5 "149.154.171.5"
+#define TG_SERVER_IPV6_1 "2001:b28:f23d:f001::a"
+#define TG_SERVER_IPV6_2 "2001:67c:4e8:f002::a"
+#define TG_SERVER_IPV6_3 "2001:b28:f23d:f003::a"
+#define TG_SERVER_IPV6_4 "2001:67c:4e8:f004::a"
+#define TG_SERVER_IPV6_5 "2001:b28:f23f:f005::a"
+#define TG_SERVER_DEFAULT 2
+
+#define TG_SERVER_TEST_1 "149.154.175.10"
+#define TG_SERVER_TEST_2 "149.154.167.40"
+#define TG_SERVER_TEST_3 "149.154.175.117"
+#define TG_SERVER_TEST_IPV6_1 "2001:b28:f23d:f001::e"
+#define TG_SERVER_TEST_IPV6_2 "2001:67c:4e8:f002::e"
+#define TG_SERVER_TEST_IPV6_3 "2001:b28:f23d:f003::e"
+#define TG_SERVER_TEST_DEFAULT 2
+
+// JUST RANDOM STRING
+#define TGL_VERSION "2.0.3"
+
+#define TGL_ENCRYPTED_LAYER 17
+#define TGL_SCHEME_LAYER 31
+
+struct connection;
+struct mtproto_methods;
+struct tgl_session;
+struct tgl_dc;
+
+#define TGL_UPDATE_CREATED 1
+#define TGL_UPDATE_DELETED 2
+#define TGL_UPDATE_PHONE 4
+#define TGL_UPDATE_CONTACT 8
+#define TGL_UPDATE_PHOTO 16
+#define TGL_UPDATE_BLOCKED 32
+#define TGL_UPDATE_REAL_NAME 64
+#define TGL_UPDATE_NAME 128
+#define TGL_UPDATE_REQUESTED 256
+#define TGL_UPDATE_WORKING 512
+#define TGL_UPDATE_FLAGS 1024
+#define TGL_UPDATE_TITLE 2048
+#define TGL_UPDATE_ADMIN 4096
+#define TGL_UPDATE_MEMBERS 8192
+#define TGL_UPDATE_ACCESS_HASH 16384
+#define TGL_UPDATE_USERNAME (1 << 15)
+
+#if defined(WIN32) || defined(_WIN32)
+# if !defined(__cplusplus) && ( !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L )
+# if __GNUC__ >= 2 || (defined(_MSC_VER) && _MSC_VER >= 1300)
+# define __func__ __FUNCTION__
+# else
+# define __func__ "<unknown>"
+# endif
+# endif
+# ifdef _MSC_VER
+# define __attribute__(x)
+# endif
+# define _PRINTF_INT64_ "I64"
+# define lrand48() rand()
+# define srand48(x) srand(x)
+ inline const char* GetLastErrorStr(int err)
+ {
+ static char errorText[256] = { 0 };
+ FormatMessageA(
+ FORMAT_MESSAGE_FROM_SYSTEM,
+ NULL,
+ err,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPSTR)&errorText,
+ 256,
+ NULL);
+ return (const char*)errorText;
+ }
+
+ inline const char* GetErrnoStr(int err)
+ {
+ static char errnoStr[256] = { 0 };
+ strerror_s(errnoStr, 256, err);
+ return (const char*)errnoStr;
+ }
+#else
+# define _PRINTF_INT64_ "ll"
+#endif
+
+struct tgl_allocator {
+ void *(*alloc)(size_t size);
+ void *(*realloc)(void *ptr, size_t old_size, size_t size);
+ void (*free)(void *ptr, int size);
+ void (*check)(void);
+ void (*exists)(void *ptr, int size);
+};
+extern struct tgl_allocator tgl_allocator_release;
+extern struct tgl_allocator tgl_allocator_debug;
+struct tgl_state;
+
+enum tgl_value_type {
+ tgl_phone_number, // user phone number
+ tgl_code, // telegram login code, or 'call' for phone call request
+ tgl_register_info, // "Y/n" register?, first name, last name
+ tgl_new_password, // new pass, confirm new pass
+ tgl_cur_and_new_password, // curr pass, new pass, confirm new pass
+ tgl_cur_password, // current pass
+ tgl_bot_hash
+};
+
+struct tgl_update_callback {
+ void (*new_msg)(struct tgl_state *TLS, struct tgl_message *M);
+ void (*marked_read)(struct tgl_state *TLS, int num, struct tgl_message *list[]);
+ void (*logprintf)(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
+ void (*get_values)(struct tgl_state *TLS, enum tgl_value_type type, const char *prompt, int num_values,
+ void (*callback)(struct tgl_state *TLS, const char *string[], void *arg), void *arg);
+ void (*logged_in)(struct tgl_state *TLS);
+ void (*started)(struct tgl_state *TLS);
+ void (*type_notification)(struct tgl_state *TLS, struct tgl_user *U, enum tgl_typing_status status);
+ void (*type_in_chat_notification)(struct tgl_state *TLS, struct tgl_user *U, struct tgl_chat *C, enum tgl_typing_status status);
+ void (*type_in_secret_chat_notification)(struct tgl_state *TLS, struct tgl_secret_chat *E);
+ void (*status_notification)(struct tgl_state *TLS, struct tgl_user *U);
+ void (*user_registered)(struct tgl_state *TLS, struct tgl_user *U);
+ void (*user_activated)(struct tgl_state *TLS, struct tgl_user *U);
+ void (*new_authorization)(struct tgl_state *TLS, const char *device, const char *location);
+ void (*chat_update)(struct tgl_state *TLS, struct tgl_chat *C, unsigned flags);
+ void (*user_update)(struct tgl_state *TLS, struct tgl_user *C, unsigned flags);
+ void (*secret_chat_update)(struct tgl_state *TLS, struct tgl_secret_chat *C, unsigned flags);
+ void (*msg_receive)(struct tgl_state *TLS, struct tgl_message *M);
+ void (*our_id)(struct tgl_state *TLS, int id);
+ void (*notification)(struct tgl_state *TLS, const char *type, const char *message);
+ void (*user_status_update)(struct tgl_state *TLS, struct tgl_user *U);
+ char *(*create_print_name) (struct tgl_state *TLS, tgl_peer_id_t id, const char *a1, const char *a2, const char *a3, const char *a4);
+};
+
+struct tgl_net_methods {
+ int (*write_out) (struct connection *c, const void *data, int len);
+ int (*read_in) (struct connection *c, void *data, int len);
+ int (*read_in_lookup) (struct connection *c, void *data, int len);
+ void (*flush_out) (struct connection *c);
+ void (*incr_out_packet_num) (struct connection *c);
+ void (*free) (struct connection *c);
+ struct tgl_dc *(*get_dc) (struct connection *c);
+ struct tgl_session *(*get_session) (struct connection *c);
+
+ struct connection *(*create_connection) (struct tgl_state *TLS, const char *host, int port, struct tgl_session *session, struct tgl_dc *dc, struct mtproto_methods *methods);
+};
+
+struct mtproto_methods {
+ int (*ready) (struct tgl_state *TLS, struct connection *c);
+ int (*close) (struct tgl_state *TLS, struct connection *c);
+ int (*execute) (struct tgl_state *TLS, struct connection *c, int op, int len);
+};
+
+struct tgl_timer;
+struct tree_random_id;
+
+struct tgl_timer_methods {
+ struct tgl_timer *(*alloc) (struct tgl_state *TLS, void (*cb)(struct tgl_state *TLS, void *arg), void *arg);
+ void (*insert) (struct tgl_timer *t, double timeout);
+ void (*remove) (struct tgl_timer *t);
+ void (*free) (struct tgl_timer *t);
+};
+
+#define E_ERROR 0
+#define E_WARNING 1
+#define E_NOTICE 2
+#define E_DEBUG 6
+
+#define TGL_LOCK_DIFF 1
+#define TGL_LOCK_PASSWORD 2
+
+#define TGL_MAX_RSA_KEYS_NUM 10
+// Do not modify this structure, unless you know what you do
+
+#pragma pack(push,4)
+struct tgl_state {
+ int our_id; // ID of logged in user
+ int encr_root;
+ unsigned char *encr_prime;
+ void *encr_prime_bn;
+ int encr_param_version;
+ int pts;
+ int qts;
+ int date;
+ int seq;
+ int binlog_enabled;
+ int test_mode;
+ int verbosity;
+ int unread_messages;
+ int active_queries;
+ int max_msg_id;
+ int started;
+ int disable_link_preview;
+
+ long long locks;
+ struct tgl_dc *DC_list[TGL_MAX_DC_NUM];
+ struct tgl_dc *DC_working;
+ int max_dc_num;
+ int dc_working_num;
+ int enable_pfs;
+ int temp_key_expire_time;
+
+ long long cur_uploading_bytes;
+ long long cur_uploaded_bytes;
+ long long cur_downloading_bytes;
+ long long cur_downloaded_bytes;
+
+ char *binlog_name;
+ char *auth_file;
+ char *downloads_directory;
+
+ struct tgl_update_callback callback;
+ struct tgl_net_methods *net_methods;
+ void *ev_base;
+
+ char *rsa_key_list[TGL_MAX_RSA_KEYS_NUM];
+ void *rsa_key_loaded[TGL_MAX_RSA_KEYS_NUM];
+ long long rsa_key_fingerprint[TGL_MAX_RSA_KEYS_NUM];
+ int rsa_key_num;
+
+ struct bignum_ctx *BN_ctx;
+
+ struct tgl_allocator allocator;
+
+ struct tree_peer *peer_tree;
+ struct tree_peer_by_name *peer_by_name_tree;
+ struct tree_message *message_tree;
+ struct tree_message *message_unsent_tree;
+ struct tree_photo *photo_tree;
+ struct tree_document *document_tree;
+ struct tree_webpage *webpage_tree;
+ struct tree_encr_document *encr_document_tree;
+
+ int users_allocated;
+ int chats_allocated;
+ int messages_allocated;
+ int peer_num;
+ int peer_size;
+ int encr_chats_allocated;
+ int geo_chats_allocated;
+
+ tgl_peer_t **Peers;
+ struct tgl_message message_list;
+
+ int binlog_fd;
+
+ struct tgl_timer_methods *timer_methods;
+
+ struct tree_query *queries_tree;
+
+ char *base_path;
+
+ struct tree_user *online_updates;
+
+ struct tgl_timer *online_updates_timer;
+
+ int app_id;
+ char *app_hash;
+
+ void *ev_login;
+
+ char *app_version;
+ int ipv6_enabled;
+
+ struct tree_random_id *random_id_tree;
+
+ char *error;
+ int error_code;
+
+ int is_bot;
+};
+#pragma pack(pop)
+//extern struct tgl_state tgl_state;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void tgl_reopen_binlog_for_writing (struct tgl_state *TLS);
+void tgl_replay_log (struct tgl_state *TLS);
+
+int tgl_print_stat (struct tgl_state *TLS, char *s, int len);
+tgl_peer_t *tgl_peer_get (struct tgl_state *TLS, tgl_peer_id_t id);
+tgl_peer_t *tgl_peer_get_by_name (struct tgl_state *TLS, const char *s);
+
+struct tgl_message *tgl_message_get (struct tgl_state *TLS, long long id);
+void tgl_peer_iterator_ex (struct tgl_state *TLS, void (*it)(tgl_peer_t *P, void *extra), void *extra);
+
+int tgl_complete_user_list (struct tgl_state *TLS, int index, const char *text, int len, char **R);
+int tgl_complete_chat_list (struct tgl_state *TLS, int index, const char *text, int len, char **R);
+int tgl_complete_encr_chat_list (struct tgl_state *TLS, int index, const char *text, int len, char **R);
+int tgl_complete_peer_list (struct tgl_state *TLS, int index, const char *text, int len, char **R);
+int tgl_secret_chat_for_user (struct tgl_state *TLS, tgl_peer_id_t user_id);
+int tgl_do_send_bot_auth (struct tgl_state *TLS, const char *code, int code_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_user *Self), void *callback_extra);
+
+#define TGL_PEER_USER 1
+#define TGL_PEER_CHAT 2
+#define TGL_PEER_GEO_CHAT 3
+#define TGL_PEER_ENCR_CHAT 4
+#define TGL_PEER_UNKNOWN 0
+
+#define TGL_MK_USER(id) tgl_set_peer_id (TGL_PEER_USER,id)
+#define TGL_MK_CHAT(id) tgl_set_peer_id (TGL_PEER_CHAT,id)
+#define TGL_MK_GEO_CHAT(id) tgl_set_peer_id (TGL_PEER_GEO_CHAT,id)
+#define TGL_MK_ENCR_CHAT(id) tgl_set_peer_id (TGL_PEER_ENCR_CHAT,id)
+
+void tgl_set_binlog_mode (struct tgl_state *TLS, int mode);
+void tgl_set_binlog_path (struct tgl_state *TLS, const char *path);
+void tgl_set_auth_file_path (struct tgl_state *TLS, const char *path);
+void tgl_set_download_directory (struct tgl_state *TLS, const char *path);
+void tgl_set_callback (struct tgl_state *TLS, struct tgl_update_callback *cb);
+void tgl_set_rsa_key (struct tgl_state *TLS, const char *key);
+void tgl_set_app_version (struct tgl_state *TLS, const char *app_version);
+
+static inline int tgl_get_peer_type (tgl_peer_id_t id) {
+ return id.type;
+}
+
+static inline int tgl_get_peer_id (tgl_peer_id_t id) {
+ return id.id;
+}
+
+static inline tgl_peer_id_t tgl_set_peer_id (int type, int id) {
+ tgl_peer_id_t ID;
+ ID.id = id;
+ ID.type = type;
+ return ID;
+}
+
+static inline int tgl_cmp_peer_id (tgl_peer_id_t a, tgl_peer_id_t b) {
+ return memcmp (&a, &b, sizeof (a));
+}
+
+void tgl_incr_verbosity (struct tgl_state *TLS);
+void tgl_set_verbosity (struct tgl_state *TLS, int val);
+void tgl_enable_pfs (struct tgl_state *TLS);
+void tgl_set_test_mode (struct tgl_state *TLS);
+void tgl_set_net_methods (struct tgl_state *TLS, struct tgl_net_methods *methods);
+void tgl_set_timer_methods (struct tgl_state *TLS, struct tgl_timer_methods *methods);
+void tgl_set_ev_base (struct tgl_state *TLS, void *ev_base);
+
+int tgl_authorized_dc (struct tgl_state *TLS, struct tgl_dc *DC);
+int tgl_signed_dc (struct tgl_state *TLS, struct tgl_dc *DC);
+
+void tgl_init (struct tgl_state *TLS);
+void tgl_dc_authorize (struct tgl_state *TLS, struct tgl_dc *DC);
+
+void tgl_dc_iterator (struct tgl_state *TLS, void (*iterator)(struct tgl_dc *DC));
+void tgl_dc_iterator_ex (struct tgl_state *TLS, void (*iterator)(struct tgl_dc *DC, void *extra), void *extra);
+
+#define TGL_SEND_MSG_FLAG_DISABLE_PREVIEW 1
+#define TGL_SEND_MSG_FLAG_ENABLE_PREVIEW 2
+
+#define TGL_SEND_MSG_FLAG_DOCUMENT_IMAGE TGLDF_IMAGE
+#define TGL_SEND_MSG_FLAG_DOCUMENT_STICKER TGLDF_STICKER
+#define TGL_SEND_MSG_FLAG_DOCUMENT_ANIMATED TGLDF_ANIMATED
+#define TGL_SEND_MSG_FLAG_DOCUMENT_AUDIO TGLDF_AUDIO
+#define TGL_SEND_MSG_FLAG_DOCUMENT_VIDEO TGLDF_VIDEO
+#define TGL_SEND_MSG_FLAG_DOCUMENT_AUTO 32
+#define TGL_SEND_MSG_FLAG_DOCUMENT_PHOTO 64
+
+#define TGL_SEND_MSG_FLAG_REPLY(x) (((unsigned long long)x) << 32)
+
+typedef tgl_peer_id_t tgl_user_id_t;
+typedef tgl_peer_id_t tgl_chat_id_t;
+typedef tgl_peer_id_t tgl_secret_chat_id_t;
+typedef tgl_peer_id_t tgl_user_or_chat_id_t;
+
+void tgl_insert_empty_user (struct tgl_state *TLS, int id);
+void tgl_insert_empty_chat (struct tgl_state *TLS, int id);
+
+
+void tgl_free_all (struct tgl_state *TLS);
+void tgl_register_app_id (struct tgl_state *TLS, int app_id, const char *app_hash);
+
+void tgl_login (struct tgl_state *TLS);
+void tgl_enable_ipv6 (struct tgl_state *TLS);
+void tgl_enable_bot (struct tgl_state *TLS);
+
+struct tgl_state *tgl_state_alloc (void);
+
+void tgl_disable_link_preview (struct tgl_state *TLS);
+void tgl_do_lookup_state (struct tgl_state *TLS);
+
+/* {{{ WORK WITH ACCOUNT */
+// sets account password
+// user will be requested to type his current password and new password (twice)
+void tgl_do_set_password (struct tgl_state *TLS, const char *hint, int hint_len, void (*callback)(struct tgl_state *TLS, void *extra, int success), void *extra);
+/* }}} */
+
+/* {{{ SENDING MESSAGES */
+
+struct tl_ds_reply_markup;
+
+// send plain text message to peer id
+// flags is combination of TGL_SEND_MSG_FLAG_*
+// reply markup can be NULL
+void tgl_do_send_message (struct tgl_state *TLS, tgl_peer_id_t id, const char *text, int text_len, unsigned long long flags, struct tl_ds_reply_markup *reply_markup, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra);
+
+// sends plain text reply on message *reply_id*
+// message *reply_id* should be cached
+void tgl_do_reply_message (struct tgl_state *TLS, int reply_id, const char *text, int text_len, unsigned long long flags, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra);
+
+// sends contents of text file *file_name* as plain text message
+void tgl_do_send_text (struct tgl_state *TLS, tgl_peer_id_t id, const char *file_name, unsigned long long flags, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra);
+void tgl_do_reply_text (struct tgl_state *TLS, int reply_id, const char *file_name, unsigned long long flags, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra);
+
+// send media from file *file_name* to peer *to_id*
+// if reply > 0 this message is sent as reply to message *reply*
+// *caption* is used only for photos
+void tgl_do_send_document (struct tgl_state *TLS, tgl_peer_id_t to_id, const char *file_name, const char *caption, int caption_len, unsigned long long flags, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra);
+void tgl_do_reply_document (struct tgl_state *TLS, int reply_id, const char *file_name, const char *caption, int caption_len, unsigned long long flags, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra);
+
+// forward message *msg_id* to peer *id*
+// message can not be encrypted and peer can not be secret chat
+void tgl_do_forward_message (struct tgl_state *TLS, tgl_user_or_chat_id_t id, int msg_id, unsigned long long flags, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra);
+
+// forward messages *ids* to peer *id*
+// messages can not be encrypted and peer can not be secret chat
+void tgl_do_forward_messages (struct tgl_state *TLS, tgl_user_or_chat_id_t id, int size, const int ids[], unsigned long long flags, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, int count, struct tgl_message *ML[]), void *callback_extra);
+
+// sends contact to another user.
+// This contact may be or may not be telegram user
+void tgl_do_send_contact (struct tgl_state *TLS, tgl_peer_id_t id, const char *phone, int phone_len, const char *first_name, int first_name_len, const char *last_name, int last_name_len, unsigned long long flags, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra);
+
+// reply on message *reply_id* with contact
+void tgl_do_reply_contact (struct tgl_state *TLS, int reply_id, const char *phone, int phone_len, const char *first_name, int first_name_len, const char *last_name, int last_name_len, unsigned long long flags, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra);
+
+// sends media from message *msg_id* to another dialog
+// a bit different from forwarding message with media
+// secret message media can be forwarded to secret chats
+// and non-secret - to non-secret chats and users
+void tgl_do_forward_media (struct tgl_state *TLS, tgl_peer_id_t id, int msg_id, unsigned long long flags, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra);
+
+// sends location to chat *id*
+void tgl_do_send_location (struct tgl_state *TLS, tgl_peer_id_t id, double latitude, double longitude, unsigned long long flags, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra);
+
+// replies on message *reply_id* with location
+void tgl_do_reply_location (struct tgl_state *TLS, int reply_id, double latitude, double longitude, unsigned long long flags, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra);
+
+// sends broadcast (i.e. message to several users at once)
+// flags are same as in tgl_do_send_message
+void tgl_do_send_broadcast (struct tgl_state *TLS, int num, tgl_user_id_t id[], const char *text, int text_len, unsigned long long flags, void (*callback)(struct tgl_state *TLS, void *extra, int success, int num, struct tgl_message *ML[]), void *callback_extra);
+
+/* }}} */
+
+/* {{{ EDITING SELF PROFILE */
+// sets self profile photo
+// server will cut central square from this photo
+void tgl_do_set_profile_photo (struct tgl_state *TLS, const char *file_name, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra);
+
+// rename self account
+void tgl_do_set_profile_name (struct tgl_state *TLS, const char *first_name, int first_name_len, const char *last_name, int last_name_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_user *U), void *callback_extra);
+
+// sets self username
+void tgl_do_set_username (struct tgl_state *TLS, const char *username, int username_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_user *U), void *callback_extra);
+
+// updates online/offline status
+void tgl_do_update_status (struct tgl_state *TLS, int online, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra);
+
+// exports card. This card can be later be used by another user to add you to dialog list.
+void tgl_do_export_card (struct tgl_state *TLS, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, int size, int *card), void *callback_extra);
+/* }}} */
+
+/* {{{ WORKING WITH GROUP CHATS */
+
+// sets chat photo
+// server will cut central square from this photo
+void tgl_do_set_chat_photo (struct tgl_state *TLS, tgl_chat_id_t chat_id, const char *file_name, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra);
+
+// sets chat title
+void tgl_do_rename_chat (struct tgl_state *TLS, tgl_chat_id_t id, const char *new_title, int new_title_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra);
+
+// requests full info about chat *id*.
+// if *offline_mode* is set no actual query is sent
+void tgl_do_get_chat_info (struct tgl_state *TLS, tgl_chat_id_t id, int offline_mode, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_chat *C), void *callback_extra);
+
+// adds user *id* to chat *chat_id*
+// sends *limit* last messages from this chat to user
+void tgl_do_add_user_to_chat (struct tgl_state *TLS, tgl_chat_id_t chat_id, tgl_user_id_t id, int limit, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra);
+
+// deleted user *id* from chat *chat_id*
+// you can do it if you are admin (=creator) of chat or if you invited this user or if it is yourself
+void tgl_do_del_user_from_chat (struct tgl_state *TLS, tgl_chat_id_t chat_id, tgl_user_id_t id, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra);
+
+// creates group chat with users ids
+// there should be at least one user other then you in chat
+void tgl_do_create_group_chat (struct tgl_state *TLS, int users_num, tgl_user_id_t ids[], const char *chat_topic, int chat_topic_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra);
+
+// receives invitation link to this chat
+// only chat admin can create one
+// prevoius link invalidated, if existed
+void tgl_do_export_chat_link (struct tgl_state *TLS, tgl_peer_id_t id, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, const char *link), void *callback_extra);
+
+// joins to secret chat by link (or hash of this link)
+void tgl_do_import_chat_link (struct tgl_state *TLS, const char *link, int link_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra);
+
+/* }}} */
+
+/* {{{ WORKING WITH USERS */
+
+// requests full info about user *id*.
+// if *offline_mode* is set no actual query is sent
+void tgl_do_get_user_info (struct tgl_state *TLS, tgl_user_id_t id, int offline_mode, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_user *U), void *callback_extra);
+
+// adds contact to contact list by phone number
+// user will be named *first_name* *last_name* in contact list
+// force should be set to 0
+void tgl_do_add_contact (struct tgl_state *TLS, const char *phone, int phone_len, const char *first_name, int first_name_len, const char *last_name, int last_name_len, int force, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, int size, struct tgl_user *users[]), void *callback_extra);
+
+// deletes user *id* from contact list
+void tgl_do_del_contact (struct tgl_state *TLS, tgl_peer_id_t id, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra);
+
+// imports card exported by another user
+void tgl_do_import_card (struct tgl_state *TLS, int size, int *card, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_user *U), void *callback_extra);
+
+// blocks user
+void tgl_do_block_user (struct tgl_state *TLS, tgl_peer_id_t id, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra);
+
+// unblocks blocked user
+void tgl_do_unblock_user (struct tgl_state *TLS, tgl_peer_id_t id, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra);
+/* }}} */
+
+/* {{{ WORKING WITH SECRET CHATS */
+
+// requests creation of secret chat with user *user_id*
+//void tgl_do_create_encr_chat_request (struct tgl_state *TLS, int user_id, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_secret_chat *E), void *callback_extra);
+
+// accepts secret chat request
+// method can fail if another device will be first to accept it
+void tgl_do_accept_encr_chat_request (struct tgl_state *TLS, struct tgl_secret_chat *E, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_secret_chat *E), void *callback_extra);
+
+// sets ttl of secret chat
+void tgl_do_set_encr_chat_ttl (struct tgl_state *TLS, struct tgl_secret_chat *E, int ttl, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra);
+
+// returns secret chat fingerprint
+int tgl_do_visualize_key (struct tgl_state *TLS, tgl_secret_chat_id_t id, unsigned char buf[16]);
+
+// requests creation of secret chat with user id
+void tgl_do_create_secret_chat (struct tgl_state *TLS, tgl_user_id_t id, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_secret_chat *E), void *callback_extra);
+/* }}} */
+
+/* {{{ WORKING WITH DIALOG LIST */
+
+// receives all dialogs (except secret chats) from offset=*offset* with limit=*limit*
+// dialogs are sorted by last message received
+// if limit is > 100 there is a (small) chance of one dialog received twice
+void tgl_do_get_dialog_list (struct tgl_state *TLS, int limit, int offset, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, int size, tgl_peer_id_t peers[], int last_msg_id[], int unread_count[]), void *callback_extra);
+
+// resolves username
+void tgl_do_contact_search (struct tgl_state *TLS, const char *name, int name_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_user *U), void *callback_extra);
+
+// requests contact list
+void tgl_do_update_contact_list (struct tgl_state *TLS, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, int size, struct tgl_user *contacts[]), void *callback_extra);
+
+/* }}} */
+
+/* {{{ WORKING WITH ONE DIALOG */
+
+// marks all inbound messages from peer id as read
+void tgl_do_mark_read (struct tgl_state *TLS, tgl_peer_id_t id, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra);
+
+// requests last *limit* from offset *offset* (offset = 0 means most recent) messages from dialog with peer id
+// if offline_mode=1 then no actual query is sent
+// only locally cached messages returned
+// also marks messages from this chat as read
+void tgl_do_get_history (struct tgl_state *TLS, tgl_peer_id_t id, int offset, int limit, int offline_mode, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, int size, struct tgl_message *list[]), void *callback_extra);
+
+// sends typing event to chat
+// set status=tgl_typing_typing for default typing event
+void tgl_do_send_typing (struct tgl_state *TLS, tgl_peer_id_t id, enum tgl_typing_status status, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra);
+
+/* }}} */
+
+/* {{{ WORKING WITH MEDIA */
+
+// loads photo/document/document_thumb to downloads directory
+// if file is presented it is not redownloaded (but if it is shortened tail will be downloaded)
+// returns file name in callback
+void tgl_do_load_photo (struct tgl_state *TLS, struct tgl_photo *photo, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, const char *file_name), void *callback_extra);
+void tgl_do_load_encr_document (struct tgl_state *TLS, struct tgl_encr_document *V, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, const char *file_name), void *callback_extra);
+void tgl_do_load_document (struct tgl_state *TLS, struct tgl_document *V, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, const char *file_name), void *callback_extra);
+void tgl_do_load_document_thumb (struct tgl_state *TLS, struct tgl_document *video, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, const char *file_name), void *callback_extra);
+void tgl_do_load_video (struct tgl_state *TLS, struct tgl_document *V, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, const char *filename), void *callback_extra);
+void tgl_do_load_audio (struct tgl_state *TLS, struct tgl_document *V, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, const char *filename), void *callback_extra);
+
+
+// loads file by location. Use only for small files!
+void tgl_do_load_file_location (struct tgl_state *TLS, struct tgl_file_location *FL, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, const char *file_name), void *callback_extra);
+
+/* }}} */
+
+
+/* {{{ ANOTHER MESSAGES FUNCTIONS */
+// search messages with ids *from* .. *to* in dialog id
+// id type of id is UNKNOWN uses global search (in all dialogs) instead
+// if *from* or *to* is means *from*=0 and *to*=+INF
+// return up to *limit* entries from offset=*offset*
+void tgl_do_msg_search (struct tgl_state *TLS, tgl_user_or_chat_id_t id, int from, int to, int limit, int offset, const char *query, int query_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, int size, struct tgl_message *list[]), void *callback_extra);
+
+// deletes message *id*
+void tgl_do_delete_msg (struct tgl_state *TLS, long long msg_id, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra);
+
+// gets message by *id*
+void tgl_do_get_message (struct tgl_state *TLS, long long id, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_message *M), void *callback_extra);
+
+/* }}} */
+
+
+/* {{{ EXTENDED QUERIES USE WITH CAUTION */
+// sends query with extended text syntax
+// use only for debug or when you known what are you doing
+// since answer is not interpretated by library in any way
+void tgl_do_send_extf (struct tgl_state *TLS, const char *data, int data_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, const char *data), void *callback_extra);
+int tglf_extf_autocomplete (struct tgl_state *TLS, const char *text, int text_len, int index, char **R, char *data, int data_len);
+struct paramed_type *tglf_extf_store (struct tgl_state *TLS, const char *data, int data_len);
+char *tglf_extf_fetch (struct tgl_state *TLS, struct paramed_type *T);
+/* }}} */
+
+/* {{{ BOT */
+void tgl_do_start_bot (struct tgl_state *TLS, tgl_peer_id_t bot, tgl_peer_id_t chat, const char *str, int str_len, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success), void *callback_extra);
+/* }}} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/tl-parser/.gitignore b/protocols/Telegram/tgl/tl-parser/.gitignore
new file mode 100644
index 0000000000..160b5b8dcf
--- /dev/null
+++ b/protocols/Telegram/tgl/tl-parser/.gitignore
@@ -0,0 +1,12 @@
+Makefile
+config.h
+dep
+objs
+bin
+autom4te.cache
+config.log
+config.status
+*.sdf
+*.opensdf
+*.user
+build
diff --git a/protocols/Telegram/tgl/tl-parser/LICENSE b/protocols/Telegram/tgl/tl-parser/LICENSE
new file mode 100644
index 0000000000..d159169d10
--- /dev/null
+++ b/protocols/Telegram/tgl/tl-parser/LICENSE
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/protocols/Telegram/tgl/tl-parser/Makefile.in b/protocols/Telegram/tgl/tl-parser/Makefile.in
new file mode 100644
index 0000000000..446f49afdb
--- /dev/null
+++ b/protocols/Telegram/tgl/tl-parser/Makefile.in
@@ -0,0 +1,48 @@
+srcdir=@srcdir@
+
+CFLAGS=@CFLAGS@
+LDFLAGS=@LDFLAGS@
+CPPFLAGS=@CPPFLAGS@
+COMPILE_FLAGS=${CFLAGS} ${CPFLAGS} ${CPPFLAGS} ${DEFS} -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC
+
+EXTRA_LIBS=@LIBS@
+LOCAL_LDFLAGS=-rdynamic -ggdb ${EXTRA_LIBS}
+LINK_FLAGS=${LDFLAGS} ${LOCAL_LDFLAGS}
+
+DEP=dep
+EXE=bin
+OBJ=objs
+DIR_LIST=${DEP} ${EXE} ${OBJ}
+
+EXE_LIST=${EXE}/tl-parser
+
+OBJECTS=${OBJ}/tl-parser.o ${OBJ}/tlc.o
+
+DEPENDENCE=$(subst ${OBJ}/,${DEP}/,$(patsubst %.o,%.d,${OBJECTS}))
+DEPENDENCE_LIST=${DEPENDENCE}
+
+INCLUDE=-I. -I${srcdir}
+CC=@CC@
+
+.SUFFIXES:
+
+.SUFFIXES: .c .h .o
+
+all: ${EXE_LIST} ${DIR_LIST} ${LIB_LIST}
+create_dirs_and_headers: ${DIR_LIST}
+create_dirs: ${DIR_LIST}
+
+${DIR_LIST}:
+ @test -d $@ || mkdir -p $@
+
+-include ${DEPENDENCE_LIST}
+
+${OBJECTS}: ${OBJ}/%.o: ${srcdir}/%.c | create_dirs_and_headers
+ ${CC} ${INCLUDE} ${COMPILE_FLAGS} -c -MP -MD -MF ${DEP}/$*.d -MQ ${OBJ}/$*.o -o $@ $<
+
+${EXE}/tl-parser: ${OBJECTS}
+ ${CC} $^ ${LINK_FLAGS} -o $@
+
+clean:
+ rm -rf ${DIR_LIST} config.log config.status > /dev/null || echo "all clean"
+
diff --git a/protocols/Telegram/tgl/tl-parser/README.md b/protocols/Telegram/tgl/tl-parser/README.md
new file mode 100644
index 0000000000..ce211a248a
--- /dev/null
+++ b/protocols/Telegram/tgl/tl-parser/README.md
@@ -0,0 +1 @@
+Parse tl scheme to tlo file. Formely part of telegram-cli
diff --git a/protocols/Telegram/tgl/tl-parser/config.h.in b/protocols/Telegram/tgl/tl-parser/config.h.in
new file mode 100644
index 0000000000..6cffe69f2b
--- /dev/null
+++ b/protocols/Telegram/tgl/tl-parser/config.h.in
@@ -0,0 +1,96 @@
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#undef HAVE_CLOCK_GETTIME
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `z' library (-lz). */
+#undef HAVE_LIBZ
+
+/* Define to 1 if you have the <mach/mach.h> header file. */
+#undef HAVE_MACH_MACH_H
+
+/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
+ to 0 otherwise. */
+#undef HAVE_MALLOC
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `memset' function. */
+#undef HAVE_MEMSET
+
+/* Define to 1 if your system has a GNU libc compatible `realloc' function,
+ and to 0 otherwise. */
+#undef HAVE_REALLOC
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strdup' function. */
+#undef HAVE_STRDUP
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if the system has the `__builtin_bswap32' built-in function */
+#undef HAVE___BUILTIN_BSWAP32
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+#undef inline
+#endif
+
+/* Define to rpl_malloc if the replacement function should be used. */
+#undef malloc
+
+/* Define to rpl_realloc if the replacement function should be used. */
+#undef realloc
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
diff --git a/protocols/Telegram/tgl/tl-parser/configure b/protocols/Telegram/tgl/tl-parser/configure
new file mode 100644
index 0000000000..6ba3c417da
--- /dev/null
+++ b/protocols/Telegram/tgl/tl-parser/configure
@@ -0,0 +1,5018 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.69 for tl-parser 1.0.
+#
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+ # into an infinite loop, continuously re-executing ourselves.
+ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+ _as_can_reexec=no; export _as_can_reexec;
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+ fi
+ # We don't want this to propagate to other subprocesses.
+ { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ as_found=:
+ case $as_dir in #(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+ if test "x$CONFIG_SHELL" != x; then :
+ export CONFIG_SHELL
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+ fi
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+ # already done that, so ensure we don't try to do so again and fall
+ # in an infinite loop. This has already happened in practice.
+ _as_can_reexec=no; export _as_can_reexec
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='tl-parser'
+PACKAGE_TARNAME='tl-parser'
+PACKAGE_VERSION='1.0'
+PACKAGE_STRING='tl-parser 1.0'
+PACKAGE_BUGREPORT=''
+PACKAGE_URL=''
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='LTLIBOBJS
+LIBOBJS
+EGREP
+GREP
+CPP
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+runstatedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *=) ac_optarg= ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -runstatedir | --runstatedir | --runstatedi | --runstated \
+ | --runstate | --runstat | --runsta | --runst | --runs \
+ | --run | --ru | --r)
+ ac_prev=runstatedir ;;
+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+ | --run=* | --ru=* | --r=*)
+ runstatedir=$ac_optarg ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ esac
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir runstatedir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures tl-parser 1.0 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking ...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/tl-parser]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of tl-parser 1.0:";;
+ esac
+ cat <<\_ACEOF
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to the package provider.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+tl-parser configure 1.0
+generated by GNU Autoconf 2.69
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ test -x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } > conftest.i && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if eval \${$3+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_header_compiler=yes
+else
+ ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ac_header_preproc=yes
+else
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+ yes:no: )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=no"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_type
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by tl-parser $as_me 1.0, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+ done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 2)
+ as_fn_append ac_configure_args1 " '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ as_fn_append ac_configure_args " '$ac_arg'"
+ ;;
+ esac
+ done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file" \
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_gcc_builtin.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_GCC_BUILTIN(BUILTIN)
+#
+# DESCRIPTION
+#
+# This macro checks if the compiler supports one of GCC's built-in
+# functions; many other compilers also provide those same built-ins.
+#
+# The BUILTIN parameter is the name of the built-in function.
+#
+# If BUILTIN is supported define HAVE_<BUILTIN>. Keep in mind that since
+# builtins usually start with two underscores they will be copied over
+# into the HAVE_<BUILTIN> definition (e.g. HAVE___BUILTIN_EXPECT for
+# __builtin_expect()).
+#
+# The macro caches its result in the ax_cv_have_<BUILTIN> variable (e.g.
+# ax_cv_have___builtin_expect).
+#
+# The macro currently supports the following built-in functions:
+#
+# __builtin_assume_aligned
+# __builtin_bswap32
+# __builtin_bswap64
+# __builtin_choose_expr
+# __builtin___clear_cache
+# __builtin_clrsb
+# __builtin_clrsbl
+# __builtin_clrsbll
+# __builtin_clz
+# __builtin_clzl
+# __builtin_clzll
+# __builtin_complex
+# __builtin_constant_p
+# __builtin_ctz
+# __builtin_ctzl
+# __builtin_ctzll
+# __builtin_expect
+# __builtin_ffs
+# __builtin_ffsl
+# __builtin_ffsll
+# __builtin_fpclassify
+# __builtin_huge_val
+# __builtin_huge_valf
+# __builtin_huge_vall
+# __builtin_inf
+# __builtin_infd128
+# __builtin_infd32
+# __builtin_infd64
+# __builtin_inff
+# __builtin_infl
+# __builtin_isinf_sign
+# __builtin_nan
+# __builtin_nand128
+# __builtin_nand32
+# __builtin_nand64
+# __builtin_nanf
+# __builtin_nanl
+# __builtin_nans
+# __builtin_nansf
+# __builtin_nansl
+# __builtin_object_size
+# __builtin_parity
+# __builtin_parityl
+# __builtin_parityll
+# __builtin_popcount
+# __builtin_popcountl
+# __builtin_popcountll
+# __builtin_powi
+# __builtin_powif
+# __builtin_powil
+# __builtin_prefetch
+# __builtin_trap
+# __builtin_types_compatible_p
+# __builtin_unreachable
+#
+# Unsuppored built-ins will be tested with an empty parameter set and the
+# result of the check might be wrong or meaningless so use with care.
+#
+# LICENSE
+#
+# Copyright (c) 2013 Gabriele Svelto <gabriele.svelto@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 2
+
+
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+
+# Checks for programs.
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+if test -z "$ac_file"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Checks for libraries.
+# We only need the symbol 'crc32'. Stay on the safe side by checking a more specific symbol.
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for crc32_combine in -lz" >&5
+$as_echo_n "checking for crc32_combine in -lz... " >&6; }
+if ${ac_cv_lib_z_crc32_combine+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lz $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 crc32_combine ();
+int
+main ()
+{
+return crc32_combine ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_z_crc32_combine=yes
+else
+ ac_cv_lib_z_crc32_combine=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_z_crc32_combine" >&5
+$as_echo "$ac_cv_lib_z_crc32_combine" >&6; }
+if test "x$ac_cv_lib_z_crc32_combine" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBZ 1
+_ACEOF
+
+ LIBS="-lz $LIBS"
+
+fi
+
+
+# Checks for header files.
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if ${ac_cv_prog_CPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in fcntl.h mach/mach.h stdlib.h string.h sys/time.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+# Checks for typedefs, structures, and compiler characteristics.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
+$as_echo_n "checking for inline... " >&6; }
+if ${ac_cv_c_inline+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_inline=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$ac_cv_c_inline" != no && break
+done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
+$as_echo "$ac_cv_c_inline" >&6; }
+
+case $ac_cv_c_inline in
+ inline | yes) ;;
+ *)
+ case $ac_cv_c_inline in
+ no) ac_val=;;
+ *) ac_val=$ac_cv_c_inline;;
+ esac
+ cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+ ;;
+esac
+
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+
+# Checks for library functions.
+for ac_header in stdlib.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdlib_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STDLIB_H 1
+_ACEOF
+
+fi
+
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
+$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
+if ${ac_cv_func_malloc_0_nonnull+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_func_malloc_0_nonnull=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+# include <stdlib.h>
+#else
+char *malloc ();
+#endif
+
+int
+main ()
+{
+return ! malloc (0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_malloc_0_nonnull=yes
+else
+ ac_cv_func_malloc_0_nonnull=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
+$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
+if test $ac_cv_func_malloc_0_nonnull = yes; then :
+
+$as_echo "#define HAVE_MALLOC 1" >>confdefs.h
+
+else
+ $as_echo "#define HAVE_MALLOC 0" >>confdefs.h
+
+ case " $LIBOBJS " in
+ *" malloc.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS malloc.$ac_objext"
+ ;;
+esac
+
+
+$as_echo "#define malloc rpl_malloc" >>confdefs.h
+
+fi
+
+
+for ac_header in stdlib.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdlib_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STDLIB_H 1
+_ACEOF
+
+fi
+
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5
+$as_echo_n "checking for GNU libc compatible realloc... " >&6; }
+if ${ac_cv_func_realloc_0_nonnull+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_func_realloc_0_nonnull=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+# include <stdlib.h>
+#else
+char *realloc ();
+#endif
+
+int
+main ()
+{
+return ! realloc (0, 0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_realloc_0_nonnull=yes
+else
+ ac_cv_func_realloc_0_nonnull=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5
+$as_echo "$ac_cv_func_realloc_0_nonnull" >&6; }
+if test $ac_cv_func_realloc_0_nonnull = yes; then :
+
+$as_echo "#define HAVE_REALLOC 1" >>confdefs.h
+
+else
+ $as_echo "#define HAVE_REALLOC 0" >>confdefs.h
+
+ case " $LIBOBJS " in
+ *" realloc.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS realloc.$ac_objext"
+ ;;
+esac
+
+
+$as_echo "#define realloc rpl_realloc" >>confdefs.h
+
+fi
+
+
+for ac_func in clock_gettime memset strdup
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_bswap32" >&5
+$as_echo_n "checking for __builtin_bswap32... " >&6; }
+if ${ax_cv_have___builtin_bswap32+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ __builtin_bswap32(0)
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ax_cv_have___builtin_bswap32=yes
+else
+ ax_cv_have___builtin_bswap32=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_have___builtin_bswap32" >&5
+$as_echo "$ax_cv_have___builtin_bswap32" >&6; }
+
+ if test yes = $ax_cv_have___builtin_bswap32; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE___BUILTIN_BSWAP32 1
+_ACEOF
+
+fi
+
+
+
+
+ac_config_files="$ac_config_files Makefile"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by tl-parser $as_me 1.0, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Report bugs to the package provider."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+tl-parser config.status 1.0
+configured by $0, generated by GNU Autoconf 2.69,
+ with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=?*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ --*=)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h)
+ # Conflict between --help and --header
+ as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+ --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+ *) as_fn_append ac_config_targets " $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp= ac_tmp=
+ trap 'exit_status=$?
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+ trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_tt"; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any. Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[ ]*#[ ]*define[ ][ ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ for (key in D) D_is_set[key] = 1
+ FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+ line = \$ 0
+ split(line, arg, " ")
+ if (arg[1] == "#") {
+ defundef = arg[2]
+ mac1 = arg[3]
+ } else {
+ defundef = substr(arg[1], 2)
+ mac1 = arg[2]
+ }
+ split(mac1, mac2, "(") #)
+ macro = mac2[1]
+ prefix = substr(line, 1, index(line, defundef) - 1)
+ if (D_is_set[macro]) {
+ # Preserve the white space surrounding the "#".
+ print prefix "define", macro P[macro] D[macro]
+ next
+ } else {
+ # Replace #undef with comments. This is necessary, for example,
+ # in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ if (defundef == "undef") {
+ print "/*", prefix defundef, macro, "*/"
+ next
+ }
+ }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS "
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$ac_tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&2;}
+
+ rm -f "$ac_tmp/stdin"
+ case $ac_file in
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
+ if test x"$ac_file" != x-; then
+ {
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+ } >"$ac_tmp/config.h" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f "$ac_file"
+ mv "$ac_tmp/config.h" "$ac_file" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ fi
+ else
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+ || as_fn_error $? "could not create -" "$LINENO" 5
+ fi
+ ;;
+
+
+ esac
+
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/protocols/Telegram/tgl/tl-parser/configure.ac b/protocols/Telegram/tgl/tl-parser/configure.ac
new file mode 100644
index 0000000000..82d1c6b027
--- /dev/null
+++ b/protocols/Telegram/tgl/tl-parser/configure.ac
@@ -0,0 +1,33 @@
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.69])
+AC_INIT([tl-parser], [1.0])
+
+m4_include([m4-ax_gcc_builtin.m4])
+
+AC_CONFIG_HEADERS([config.h])
+
+# Checks for programs.
+AC_PROG_CC
+
+# Checks for libraries.
+# We only need the symbol 'crc32'. Stay on the safe side by checking a more specific symbol.
+AC_CHECK_LIB([z], [crc32_combine])
+
+# Checks for header files.
+AC_CHECK_HEADERS([fcntl.h mach/mach.h stdlib.h string.h sys/time.h unistd.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_C_INLINE
+AC_TYPE_SIZE_T
+
+# Checks for library functions.
+AC_FUNC_MALLOC
+AC_FUNC_REALLOC
+AC_CHECK_FUNCS([clock_gettime memset strdup])
+
+AX_GCC_BUILTIN(__builtin_bswap32)
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/protocols/Telegram/tgl/tl-parser/contrib/vs/config.bat b/protocols/Telegram/tgl/tl-parser/contrib/vs/config.bat
new file mode 100644
index 0000000000..f71d87518d
--- /dev/null
+++ b/protocols/Telegram/tgl/tl-parser/contrib/vs/config.bat
@@ -0,0 +1,107 @@
+@echo off
+setlocal enabledelayedexpansion
+
+set PACKAGE_NAME="tl-parser"
+set PACKAGE_TARNAME="tl-parser"
+set PACKAGE_VERSION="1.0"
+set PACKAGE_STRING="tl-parser %PACKAGE_VERSION:~1%"
+set PACKAGE_BUGREPORT=""
+set PACKAGE_URL=""
+
+set CONFIG_HEADER_IN=..\..\config.h.in
+set CONFIG_HEADER=config.h
+set DEFAULT_OUT_FOLDER=build
+set OUT_PATH=""
+set SOURCE_LIST=()
+
+:rem Parse Args
+for %%a in (%*) do (
+ if defined arg (
+ if /I "-o"=="!arg!" set OUT_PATH=%%a
+ set set arg=
+ )
+ if /I "%%a" geq "-" (
+ set arg=%%a
+ ) else (
+ set set arg=
+ )
+)
+if %OUT_PATH%=="" (
+ set OUT_PATH=%DEFAULT_OUT_FOLDER%
+)
+
+:rem Make output folder if not exists
+if not exist !OUT_PATH! mkdir !OUT_PATH!
+
+:rem Copy source files to the output folder
+for %%i in %SOURCE_LIST% do (
+ if not exist %OUT_PATH%\%%i (
+ echo |set /p=Copying file: %%i
+ copy %%i "%OUT_PATH%\%%i" 1>NUL && (
+ echo Done
+ ) || (
+ echo Failed
+ )
+ )
+)
+
+set OUT_PATH="%OUT_PATH%\%CONFIG_HEADER%"
+if exist %OUT_PATH% exit /B 0
+
+:rem Copy config.h.in to the output folder
+echo |set /p=Copying file: %CONFIG_HEADER%
+copy %CONFIG_HEADER_IN% %OUT_PATH% 1>NUL && (
+ echo Done
+) || (
+ echo Failed
+ exit /B %ERRORLEVEL%
+)
+
+:rem Configure config.h
+echo |set /p=Configurating file: config.h
+call :find_and_replace "#undef PACKAGE_BUGREPORT" "#define PACKAGE_BUGREPORT %PACKAGE_BUGREPORT%"
+call :find_and_replace "#undef PACKAGE_NAME" "#define PACKAGE_NAME %PACKAGE_NAME%"
+call :find_and_replace "#undef PACKAGE_STRING" "#define PACKAGE_STRING %PACKAGE_STRING%"
+call :find_and_replace "#undef PACKAGE_TARNAME" "#define PACKAGE_TARNAME %PACKAGE_TARNAME%"
+call :find_and_replace "#undef PACKAGE_URL" "#define PACKAGE_URL %PACKAGE_URL%"
+call :find_and_replace "#undef PACKAGE_VERSION" "#define PACKAGE_VERSION %PACKAGE_VERSION%"
+
+call :find_and_replace "#undef HAVE_FCNTL_H" "#define HAVE_FCNTL_H 1"
+call :find_and_replace "#undef HAVE_INTTYPES_H" "#define HAVE_INTTYPES_H 1"
+call :find_and_replace "#undef HAVE_LIBZ" "#define HAVE_LIBZ 1"
+call :find_and_replace "#undef HAVE_MALLOC" "#define HAVE_MALLOC 1"
+call :find_and_replace "#undef HAVE_MEMORY_H" "#define HAVE_MEMORY_H 1"
+call :find_and_replace "#undef HAVE_MEMSET" "#define HAVE_MEMSET 1"
+call :find_and_replace "#undef HAVE_REALLOC" "#define HAVE_REALLOC 1"
+call :find_and_replace "#undef HAVE_STDINT_H" "#define HAVE_STDINT_H 1"
+call :find_and_replace "#undef HAVE_STDLIB_H" "#define HAVE_STDLIB_H 1"
+call :find_and_replace "#undef HAVE_STRDUP" "#define HAVE_STRDUP 1"
+call :find_and_replace "#undef HAVE_STRING_H" "#define HAVE_STRING_H 1"
+call :find_and_replace "#undef HAVE_SYS_STAT_H" "#define HAVE_SYS_STAT_H 1"
+call :find_and_replace "#undef HAVE_SYS_TYPES_H" "#define HAVE_SYS_TYPES_H 1"
+call :find_and_replace "#undef STDC_HEADERS" "#define STDC_HEADERS 1"
+call :find_and_replace "#undef inline" "#define inline __inline"
+call :find_and_replace "#undef" "// #undef"
+
+if %ERRORLEVEL% == 0 echo Done
+if not %ERRORLEVEL% == 0 (
+ echo Failed
+ if exist %OUT_PATH% del /q /f %OUT_PATH%
+)
+exit /B %ERRORLEVEL%
+
+:find_and_replace
+set FIND_STR=%1
+set "FIND_STR=!FIND_STR:~1,-1!"
+set REPLACE_STR=%2 %3
+set "REPLACE_STR=!REPLACE_STR:~1,-2!"
+
+for /f "delims=" %%i in ('type "%OUT_PATH%" ^| find /n /v "" ^& break ^> "%OUT_PATH%" ') do (
+ set "line=%%i"
+ setlocal enableDelayedExpansion
+ set "line=!line:*]%FIND_STR%=%REPLACE_STR%!"
+ set "line=!line:*]=!"
+ >>"%OUT_PATH%" echo(!line!
+ endlocal
+)
+exit /B %ERRORLEVEL%
diff --git a/protocols/Telegram/tgl/tl-parser/contrib/vs/tl-parser.sln b/protocols/Telegram/tgl/tl-parser/contrib/vs/tl-parser.sln
new file mode 100644
index 0000000000..8365b797fd
--- /dev/null
+++ b/protocols/Telegram/tgl/tl-parser/contrib/vs/tl-parser.sln
@@ -0,0 +1,28 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tl-parser", "tl-parser.vcxproj", "{14022761-9F27-4A2D-B7EA-F41FB9B3274C}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {14022761-9F27-4A2D-B7EA-F41FB9B3274C}.Debug|x64.ActiveCfg = Debug|x64
+ {14022761-9F27-4A2D-B7EA-F41FB9B3274C}.Debug|x64.Build.0 = Debug|x64
+ {14022761-9F27-4A2D-B7EA-F41FB9B3274C}.Debug|x86.ActiveCfg = Debug|Win32
+ {14022761-9F27-4A2D-B7EA-F41FB9B3274C}.Debug|x86.Build.0 = Debug|Win32
+ {14022761-9F27-4A2D-B7EA-F41FB9B3274C}.Release|x64.ActiveCfg = Release|x64
+ {14022761-9F27-4A2D-B7EA-F41FB9B3274C}.Release|x64.Build.0 = Release|x64
+ {14022761-9F27-4A2D-B7EA-F41FB9B3274C}.Release|x86.ActiveCfg = Release|Win32
+ {14022761-9F27-4A2D-B7EA-F41FB9B3274C}.Release|x86.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/protocols/Telegram/tgl/tl-parser/contrib/vs/tl-parser.vcxproj b/protocols/Telegram/tgl/tl-parser/contrib/vs/tl-parser.vcxproj
new file mode 100644
index 0000000000..f6b557def8
--- /dev/null
+++ b/protocols/Telegram/tgl/tl-parser/contrib/vs/tl-parser.vcxproj
@@ -0,0 +1,198 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\portable_endian.h" />
+ <ClInclude Include="..\..\tl-parser-tree.h" />
+ <ClInclude Include="..\..\tl-parser.h" />
+ <ClInclude Include="..\..\tl-tl.h" />
+ <ClInclude Include="config.h" />
+ <ClInclude Include="wingetopt.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\tl-parser.c" />
+ <ClCompile Include="..\..\tlc.c" />
+ <ClCompile Include="wingetopt.c" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{14022761-9F27-4A2D-B7EA-F41FB9B3274C}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <RootNamespace>tlparser</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140_xp</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LinkIncremental>true</LinkIncremental>
+ <OutDir>build\$(Configuration)\</OutDir>
+ <IntDir>build\$(Configuration)\build\</IntDir>
+ <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(IntDir);$(ProjectDir);</IncludePath>
+ <ExtensionsToDeleteOnClean>*.h;$(ExtensionsToDeleteOnClean)</ExtensionsToDeleteOnClean>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LinkIncremental>true</LinkIncremental>
+ <OutDir>build\$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>build\$(Platform)\$(Configuration)\build\</IntDir>
+ <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(IntDir);$(ProjectDir);</IncludePath>
+ <ExtensionsToDeleteOnClean>*.h;$(ExtensionsToDeleteOnClean)</ExtensionsToDeleteOnClean>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>build\$(Configuration)\</OutDir>
+ <IntDir>build\$(Configuration)\build\</IntDir>
+ <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(IntDir);$(ProjectDir);</IncludePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>build\$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>build\$(Platform)\$(Configuration)\build\</IntDir>
+ <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(IntDir);$(ProjectDir);</IncludePath>
+ <ExtensionsToDeleteOnClean>*.h;$(ExtensionsToDeleteOnClean)</ExtensionsToDeleteOnClean>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>
+ </AdditionalIncludeDirectories>
+ <DisableLanguageExtensions>false</DisableLanguageExtensions>
+ <CompileAs>CompileAsC</CompileAs>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalLibraryDirectories>
+ </AdditionalLibraryDirectories>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PreBuildEvent>
+ <Command>config.bat -o $(IntDir)</Command>
+ <Message>
+ </Message>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <SDLCheck>true</SDLCheck>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ <PreBuildEvent>
+ <Command>config.bat -o $(IntDir)</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Full</Optimization>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;_CONSOLE;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\..\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalLibraryDirectories>..\..\..\zlib\contrib\vstudio\vc11\x86\ZlibStatReleaseWithoutAsm\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalDependencies>zlibstat.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PreBuildEvent>
+ <Command>config.bat -o $(IntDir)</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>
+ </AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ <PreBuildEvent>
+ <Command>config.bat -o $(IntDir)</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/protocols/Telegram/tgl/tl-parser/contrib/vs/tl-parser.vcxproj.filters b/protocols/Telegram/tgl/tl-parser/contrib/vs/tl-parser.vcxproj.filters
new file mode 100644
index 0000000000..2ba314f975
--- /dev/null
+++ b/protocols/Telegram/tgl/tl-parser/contrib/vs/tl-parser.vcxproj.filters
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\portable_endian.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\tl-parser.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\tl-parser-tree.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\tl-tl.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="config.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="wingetopt.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\tlc.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\tl-parser.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="wingetopt.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/protocols/Telegram/tgl/tl-parser/contrib/vs/wingetopt.c b/protocols/Telegram/tgl/tl-parser/contrib/vs/wingetopt.c
new file mode 100644
index 0000000000..09dac17a4f
--- /dev/null
+++ b/protocols/Telegram/tgl/tl-parser/contrib/vs/wingetopt.c
@@ -0,0 +1,82 @@
+/*
+POSIX getopt for Windows
+
+AT&T Public License
+
+Code given out at the 1985 UNIFORUM conference in Dallas.
+*/
+
+#ifndef __GNUC__
+
+#include "wingetopt.h"
+#include <stdio.h>
+#include <string.h>
+
+#ifndef NULL
+#define NULL 0
+#endif
+#define EOF (-1)
+#define ERR(s, c) if(opterr){\
+ char errbuf[2];\
+ errbuf[0] = c; errbuf[1] = '\n';\
+ fputs(argv[0], stderr);\
+ fputs(s, stderr);\
+ fputc(c, stderr);}
+//(void) write(2, argv[0], (unsigned)strlen(argv[0]));\
+ //(void) write(2, s, (unsigned)strlen(s));\
+ //(void) write(2, errbuf, 2);}
+
+int opterr = 1;
+int optind = 1;
+int optopt;
+char *optarg;
+
+int
+getopt(argc, argv, opts)
+int argc;
+char **argv, *opts;
+{
+ static int sp = 1;
+ register int c;
+ register char *cp;
+
+ if (sp == 1)
+ if (optind >= argc ||
+ argv[optind][0] != '-' || argv[optind][1] == '\0')
+ return(EOF);
+ else if (strcmp(argv[optind], "--") == (int)NULL) {
+ optind++;
+ return(EOF);
+ }
+ optopt = c = argv[optind][sp];
+ if (c == ':' || (cp = strchr(opts, c)) == NULL) {
+ ERR(": illegal option -- ", c);
+ if (argv[optind][++sp] == '\0') {
+ optind++;
+ sp = 1;
+ }
+ return('?');
+ }
+ if (*++cp == ':') {
+ if (argv[optind][sp + 1] != '\0')
+ optarg = &argv[optind++][sp + 1];
+ else if (++optind >= argc) {
+ ERR(": option requires an argument -- ", c);
+ sp = 1;
+ return('?');
+ }
+ else
+ optarg = argv[optind++];
+ sp = 1;
+ }
+ else {
+ if (argv[optind][++sp] == '\0') {
+ sp = 1;
+ optind++;
+ }
+ optarg = NULL;
+ }
+ return(c);
+}
+
+#endif /* __GNUC__ */ \ No newline at end of file
diff --git a/protocols/Telegram/tgl/tl-parser/contrib/vs/wingetopt.h b/protocols/Telegram/tgl/tl-parser/contrib/vs/wingetopt.h
new file mode 100644
index 0000000000..4372c66011
--- /dev/null
+++ b/protocols/Telegram/tgl/tl-parser/contrib/vs/wingetopt.h
@@ -0,0 +1,32 @@
+/*
+POSIX getopt for Windows
+
+AT&T Public License
+
+Code given out at the 1985 UNIFORUM conference in Dallas.
+*/
+
+#ifdef __GNUC__
+#include <getopt.h>
+#endif
+#ifndef __GNUC__
+
+#ifndef _WINGETOPT_H_
+#define _WINGETOPT_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ extern int opterr;
+ extern int optind;
+ extern int optopt;
+ extern char *optarg;
+ extern int getopt(int argc, char **argv, char *opts);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _GETOPT_H_ */
+#endif /* __GNUC__ */ \ No newline at end of file
diff --git a/protocols/Telegram/tgl/tl-parser/m4-ax_gcc_builtin.m4 b/protocols/Telegram/tgl/tl-parser/m4-ax_gcc_builtin.m4
new file mode 100644
index 0000000000..b28a91b14a
--- /dev/null
+++ b/protocols/Telegram/tgl/tl-parser/m4-ax_gcc_builtin.m4
@@ -0,0 +1,168 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_gcc_builtin.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_GCC_BUILTIN(BUILTIN)
+#
+# DESCRIPTION
+#
+# This macro checks if the compiler supports one of GCC's built-in
+# functions; many other compilers also provide those same built-ins.
+#
+# The BUILTIN parameter is the name of the built-in function.
+#
+# If BUILTIN is supported define HAVE_<BUILTIN>. Keep in mind that since
+# builtins usually start with two underscores they will be copied over
+# into the HAVE_<BUILTIN> definition (e.g. HAVE___BUILTIN_EXPECT for
+# __builtin_expect()).
+#
+# The macro caches its result in the ax_cv_have_<BUILTIN> variable (e.g.
+# ax_cv_have___builtin_expect).
+#
+# The macro currently supports the following built-in functions:
+#
+# __builtin_assume_aligned
+# __builtin_bswap32
+# __builtin_bswap64
+# __builtin_choose_expr
+# __builtin___clear_cache
+# __builtin_clrsb
+# __builtin_clrsbl
+# __builtin_clrsbll
+# __builtin_clz
+# __builtin_clzl
+# __builtin_clzll
+# __builtin_complex
+# __builtin_constant_p
+# __builtin_ctz
+# __builtin_ctzl
+# __builtin_ctzll
+# __builtin_expect
+# __builtin_ffs
+# __builtin_ffsl
+# __builtin_ffsll
+# __builtin_fpclassify
+# __builtin_huge_val
+# __builtin_huge_valf
+# __builtin_huge_vall
+# __builtin_inf
+# __builtin_infd128
+# __builtin_infd32
+# __builtin_infd64
+# __builtin_inff
+# __builtin_infl
+# __builtin_isinf_sign
+# __builtin_nan
+# __builtin_nand128
+# __builtin_nand32
+# __builtin_nand64
+# __builtin_nanf
+# __builtin_nanl
+# __builtin_nans
+# __builtin_nansf
+# __builtin_nansl
+# __builtin_object_size
+# __builtin_parity
+# __builtin_parityl
+# __builtin_parityll
+# __builtin_popcount
+# __builtin_popcountl
+# __builtin_popcountll
+# __builtin_powi
+# __builtin_powif
+# __builtin_powil
+# __builtin_prefetch
+# __builtin_trap
+# __builtin_types_compatible_p
+# __builtin_unreachable
+#
+# Unsuppored built-ins will be tested with an empty parameter set and the
+# result of the check might be wrong or meaningless so use with care.
+#
+# LICENSE
+#
+# Copyright (c) 2013 Gabriele Svelto <gabriele.svelto@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 2
+
+AC_DEFUN([AX_GCC_BUILTIN], [
+ AS_VAR_PUSHDEF([ac_var], [ax_cv_have_$1])
+
+ AC_CACHE_CHECK([for $1], [ac_var], [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [
+ m4_case([$1],
+ [__builtin_assume_aligned], [$1("", 0)],
+ [__builtin_bswap32], [$1(0)],
+ [__builtin_bswap64], [$1(0)],
+ [__builtin_choose_expr], [$1(0, 0, 0)],
+ [__builtin___clear_cache], [$1("", "")],
+ [__builtin_clrsb], [$1(0)],
+ [__builtin_clrsbl], [$1(0)],
+ [__builtin_clrsbll], [$1(0)],
+ [__builtin_clz], [$1(0)],
+ [__builtin_clzl], [$1(0)],
+ [__builtin_clzll], [$1(0)],
+ [__builtin_complex], [$1(0.0, 0.0)],
+ [__builtin_constant_p], [$1(0)],
+ [__builtin_ctz], [$1(0)],
+ [__builtin_ctzl], [$1(0)],
+ [__builtin_ctzll], [$1(0)],
+ [__builtin_expect], [$1(0, 0)],
+ [__builtin_ffs], [$1(0)],
+ [__builtin_ffsl], [$1(0)],
+ [__builtin_ffsll], [$1(0)],
+ [__builtin_fpclassify], [$1(0, 1, 2, 3, 4, 0.0)],
+ [__builtin_huge_val], [$1()],
+ [__builtin_huge_valf], [$1()],
+ [__builtin_huge_vall], [$1()],
+ [__builtin_inf], [$1()],
+ [__builtin_infd128], [$1()],
+ [__builtin_infd32], [$1()],
+ [__builtin_infd64], [$1()],
+ [__builtin_inff], [$1()],
+ [__builtin_infl], [$1()],
+ [__builtin_isinf_sign], [$1(0.0)],
+ [__builtin_nan], [$1("")],
+ [__builtin_nand128], [$1("")],
+ [__builtin_nand32], [$1("")],
+ [__builtin_nand64], [$1("")],
+ [__builtin_nanf], [$1("")],
+ [__builtin_nanl], [$1("")],
+ [__builtin_nans], [$1("")],
+ [__builtin_nansf], [$1("")],
+ [__builtin_nansl], [$1("")],
+ [__builtin_object_size], [$1("", 0)],
+ [__builtin_parity], [$1(0)],
+ [__builtin_parityl], [$1(0)],
+ [__builtin_parityll], [$1(0)],
+ [__builtin_popcount], [$1(0)],
+ [__builtin_popcountl], [$1(0)],
+ [__builtin_popcountll], [$1(0)],
+ [__builtin_powi], [$1(0, 0)],
+ [__builtin_powif], [$1(0, 0)],
+ [__builtin_powil], [$1(0, 0)],
+ [__builtin_prefetch], [$1("")],
+ [__builtin_trap], [$1()],
+ [__builtin_types_compatible_p], [$1(int, int)],
+ [__builtin_unreachable], [$1()],
+ [m4_warn([syntax], [Unsupported built-in $1, the test may fail])
+ $1()]
+ )
+ ])],
+ [AS_VAR_SET([ac_var], [yes])],
+ [AS_VAR_SET([ac_var], [no])])
+ ])
+
+ AS_IF([test yes = AS_VAR_GET([ac_var])],
+ [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$1), 1,
+ [Define to 1 if the system has the `$1' built-in function])], [])
+
+ AS_VAR_POPDEF([ac_var])
+])
diff --git a/protocols/Telegram/tgl/tl-parser/portable_endian.h b/protocols/Telegram/tgl/tl-parser/portable_endian.h
new file mode 100644
index 0000000000..b39a51ea63
--- /dev/null
+++ b/protocols/Telegram/tgl/tl-parser/portable_endian.h
@@ -0,0 +1,124 @@
+// "License": Public Domain
+// I, Mathias Panzenböck, place this file hereby into the public domain. Use it at your own risk for whatever you like.
+// In case there are jurisdictions that don't support putting things in the public domain you can also consider it to
+// be "dual licensed" under the BSD, MIT and Apache licenses, if you want to. This code is trivial anyway. Consider it
+// an example on how to get the endian conversion functions on different platforms.
+
+/* Originally cloned from https://gist.github.com/PkmX/63dd23f28ba885be53a5
+ * Commit was: 1eca2ab34f2301b9641aa73d1016b951fff3fc39
+ * Re-published at https://github.com/BenWiederhake/portable-endian.h to provide a means to submit patches and report issues. */
+
+#ifndef PORTABLE_ENDIAN_H__
+#define PORTABLE_ENDIAN_H__
+
+#if (defined(_WIN16) || defined(_WIN32) || defined(_WIN64)) && !defined(__WINDOWS__)
+
+# define __WINDOWS__
+
+#endif
+
+#if defined(__linux__) || defined(__CYGWIN__)
+
+# include <endian.h>
+
+#elif defined(__APPLE__)
+
+# include <libkern/OSByteOrder.h>
+
+# define htobe16(x) OSSwapHostToBigInt16(x)
+# define htole16(x) OSSwapHostToLittleInt16(x)
+# define be16toh(x) OSSwapBigToHostInt16(x)
+# define le16toh(x) OSSwapLittleToHostInt16(x)
+
+# define htobe32(x) OSSwapHostToBigInt32(x)
+# define htole32(x) OSSwapHostToLittleInt32(x)
+# define be32toh(x) OSSwapBigToHostInt32(x)
+# define le32toh(x) OSSwapLittleToHostInt32(x)
+
+# define htobe64(x) OSSwapHostToBigInt64(x)
+# define htole64(x) OSSwapHostToLittleInt64(x)
+# define be64toh(x) OSSwapBigToHostInt64(x)
+# define le64toh(x) OSSwapLittleToHostInt64(x)
+
+# define __BYTE_ORDER BYTE_ORDER
+# define __BIG_ENDIAN BIG_ENDIAN
+# define __LITTLE_ENDIAN LITTLE_ENDIAN
+# define __PDP_ENDIAN PDP_ENDIAN
+
+#elif defined(__OpenBSD__)
+
+# include <sys/endian.h>
+
+#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
+
+# include <sys/endian.h>
+
+# define be16toh(x) betoh16(x)
+# define le16toh(x) letoh16(x)
+
+# define be32toh(x) betoh32(x)
+# define le32toh(x) letoh32(x)
+
+# define be64toh(x) betoh64(x)
+# define le64toh(x) letoh64(x)
+
+#elif defined(__WINDOWS__)
+
+# include <winsock2.h>
+# ifdef __MINGW32__
+# include <sys/param.h>
+# endif
+
+# if BYTE_ORDER == LITTLE_ENDIAN
+
+# define htobe16(x) htons(x)
+# define htole16(x) (x)
+# define be16toh(x) ntohs(x)
+# define le16toh(x) (x)
+
+# define htobe32(x) htonl(x)
+# define htole32(x) (x)
+# define be32toh(x) ntohl(x)
+# define le32toh(x) (x)
+
+# define htobe64(x) htonll(x)
+# define htole64(x) (x)
+# define be64toh(x) ntohll(x)
+# define le64toh(x) (x)
+
+# elif BYTE_ORDER == BIG_ENDIAN
+
+ /* that would be xbox 360 */
+# define htobe16(x) (x)
+# define htole16(x) __builtin_bswap16(x)
+# define be16toh(x) (x)
+# define le16toh(x) __builtin_bswap16(x)
+
+# define htobe32(x) (x)
+# define htole32(x) __builtin_bswap32(x)
+# define be32toh(x) (x)
+# define le32toh(x) __builtin_bswap32(x)
+
+# define htobe64(x) (x)
+# define htole64(x) __builtin_bswap64(x)
+# define be64toh(x) (x)
+# define le64toh(x) __builtin_bswap64(x)
+
+# else
+
+# error byte order not supported
+
+# endif
+
+# define __BYTE_ORDER BYTE_ORDER
+# define __BIG_ENDIAN BIG_ENDIAN
+# define __LITTLE_ENDIAN LITTLE_ENDIAN
+# define __PDP_ENDIAN PDP_ENDIAN
+
+#else
+
+# error platform not supported
+
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/tl-parser/tl-parser-tree.h b/protocols/Telegram/tgl/tl-parser/tl-parser-tree.h
new file mode 100644
index 0000000000..fba7c67521
--- /dev/null
+++ b/protocols/Telegram/tgl/tl-parser/tl-parser-tree.h
@@ -0,0 +1,178 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Vitaly Valtman 2013-2014
+*/
+#ifndef __TREE_H__
+#define __TREE_H__
+#include <stdio.h>
+
+#include <memory.h>
+#include <assert.h>
+
+#pragma pack(push,4)
+#define DEFINE_TREE(X_NAME, X_TYPE, X_CMP, X_UNSET) \
+struct tree_ ## X_NAME { \
+ struct tree_ ## X_NAME *left, *right;\
+ X_TYPE x;\
+ int y;\
+};\
+\
+static struct tree_ ## X_NAME *new_tree_node_ ## X_NAME (X_TYPE x, int y) {\
+ struct tree_ ## X_NAME *T = malloc (sizeof (*T));\
+ T->x = x;\
+ T->y = y;\
+ T->left = T->right = 0;\
+ return T;\
+}\
+\
+static void delete_tree_node_ ## X_NAME (struct tree_ ## X_NAME *T) {\
+ free (T);\
+}\
+\
+static void tree_split_ ## X_NAME (struct tree_ ## X_NAME *T, X_TYPE x, struct tree_ ## X_NAME **L, struct tree_ ## X_NAME **R) {\
+ if (!T) {\
+ *L = *R = 0;\
+ } else {\
+ int c = X_CMP (x, T->x);\
+ if (c < 0) {\
+ tree_split_ ## X_NAME (T->left, x, L, &T->left);\
+ *R = T;\
+ } else {\
+ tree_split_ ## X_NAME (T->right, x, &T->right, R);\
+ *L = T;\
+ }\
+ }\
+}\
+\
+static struct tree_ ## X_NAME *tree_insert_ ## X_NAME (struct tree_ ## X_NAME *T, X_TYPE x, int y) __attribute__ ((warn_unused_result,unused));\
+static struct tree_ ## X_NAME *tree_insert_ ## X_NAME (struct tree_ ## X_NAME *T, X_TYPE x, int y) {\
+ if (!T) {\
+ return new_tree_node_ ## X_NAME (x, y);\
+ } else {\
+ if (y > T->y) {\
+ struct tree_ ## X_NAME *N = new_tree_node_ ## X_NAME (x, y);\
+ tree_split_ ## X_NAME (T, x, &N->left, &N->right);\
+ return N;\
+ } else {\
+ int c = X_CMP (x, T->x);\
+ assert (c);\
+ if (c < 0) { \
+ T->left = tree_insert_ ## X_NAME (T->left, x, y);\
+ } else { \
+ T->right = tree_insert_ ## X_NAME (T->right, x, y);\
+ } \
+ return T; \
+ }\
+ }\
+}\
+\
+static struct tree_ ## X_NAME *tree_merge_ ## X_NAME (struct tree_ ## X_NAME *L, struct tree_ ## X_NAME *R) {\
+ if (!L || !R) {\
+ return L ? L : R;\
+ } else {\
+ if (L->y > R->y) {\
+ L->right = tree_merge_ ## X_NAME (L->right, R);\
+ return L;\
+ } else {\
+ R->left = tree_merge_ ## X_NAME (L, R->left);\
+ return R;\
+ }\
+ }\
+}\
+\
+static struct tree_ ## X_NAME *tree_delete_ ## X_NAME (struct tree_ ## X_NAME *T, X_TYPE x) __attribute__ ((warn_unused_result,unused));\
+static struct tree_ ## X_NAME *tree_delete_ ## X_NAME (struct tree_ ## X_NAME *T, X_TYPE x) {\
+ assert (T);\
+ int c = X_CMP (x, T->x);\
+ if (!c) {\
+ struct tree_ ## X_NAME *N = tree_merge_ ## X_NAME (T->left, T->right);\
+ delete_tree_node_ ## X_NAME (T);\
+ return N;\
+ } else {\
+ if (c < 0) { \
+ T->left = tree_delete_ ## X_NAME (T->left, x); \
+ } else { \
+ T->right = tree_delete_ ## X_NAME (T->right, x); \
+ } \
+ return T; \
+ }\
+}\
+\
+static X_TYPE tree_get_min_ ## X_NAME (struct tree_ ## X_NAME *t) __attribute__ ((unused));\
+static X_TYPE tree_get_min_ ## X_NAME (struct tree_ ## X_NAME *T) {\
+ if (!T) { return X_UNSET; } \
+ while (T->left) { T = T->left; }\
+ return T->x; \
+} \
+\
+static X_TYPE tree_lookup_ ## X_NAME (struct tree_ ## X_NAME *T, X_TYPE x) __attribute__ ((unused));\
+static X_TYPE tree_lookup_ ## X_NAME (struct tree_ ## X_NAME *T, X_TYPE x) {\
+ int c;\
+ while (T && (c = X_CMP (x, T->x))) {\
+ T = (c < 0 ? T->left : T->right);\
+ }\
+ return T ? T->x : X_UNSET;\
+}\
+\
+static void tree_act_ ## X_NAME (struct tree_ ## X_NAME *T, void (*act)(X_TYPE)) __attribute__ ((unused));\
+static void tree_act_ ## X_NAME (struct tree_ ## X_NAME *T, void (*act)(X_TYPE)) {\
+ if (!T) { return; } \
+ tree_act_ ## X_NAME (T->left, act); \
+ act (T->x); \
+ tree_act_ ## X_NAME (T->right, act); \
+}\
+\
+static void tree_act_ex_ ## X_NAME (struct tree_ ## X_NAME *T, void (*act)(X_TYPE, void *), void *extra) __attribute__ ((unused));\
+static void tree_act_ex_ ## X_NAME (struct tree_ ## X_NAME *T, void (*act)(X_TYPE, void *), void *extra) {\
+ if (!T) { return; } \
+ tree_act_ex_ ## X_NAME (T->left, act, extra); \
+ act (T->x, extra); \
+ tree_act_ex_ ## X_NAME (T->right, act, extra); \
+}\
+\
+static int tree_count_ ## X_NAME (struct tree_ ## X_NAME *T) __attribute__ ((unused));\
+static int tree_count_ ## X_NAME (struct tree_ ## X_NAME *T) { \
+ if (!T) { return 0; }\
+ return 1 + tree_count_ ## X_NAME (T->left) + tree_count_ ## X_NAME (T->right); \
+}\
+static void tree_check_ ## X_NAME (struct tree_ ## X_NAME *T) __attribute__ ((unused));\
+static void tree_check_ ## X_NAME (struct tree_ ## X_NAME *T) { \
+ if (!T) { return; }\
+ if (T->left) { \
+ assert (T->left->y <= T->y);\
+ assert (X_CMP (T->left->x, T->x) < 0); \
+ }\
+ if (T->right) { \
+ assert (T->right->y <= T->y);\
+ assert (X_CMP (T->right->x, T->x) > 0); \
+ }\
+ tree_check_ ## X_NAME (T->left); \
+ tree_check_ ## X_NAME (T->right); \
+}\
+static struct tree_ ## X_NAME *tree_clear_ ## X_NAME (struct tree_ ## X_NAME *T) __attribute__ ((unused));\
+static struct tree_ ## X_NAME *tree_clear_ ## X_NAME (struct tree_ ## X_NAME *T) { \
+ if (!T) { return 0; }\
+ tree_clear_ ## X_NAME (T->left); \
+ tree_clear_ ## X_NAME (T->right); \
+ delete_tree_node_ ## X_NAME (T); \
+ return 0; \
+} \
+
+#define int_cmp(a,b) ((a) - (b))
+#pragma pack(pop)
+#endif
diff --git a/protocols/Telegram/tgl/tl-parser/tl-parser.c b/protocols/Telegram/tgl/tl-parser/tl-parser.c
new file mode 100644
index 0000000000..0076d6883b
--- /dev/null
+++ b/protocols/Telegram/tgl/tl-parser/tl-parser.c
@@ -0,0 +1,3111 @@
+/*
+ This file is part of tl-parser
+
+ tl-parser is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+
+ tl-parser is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this tl-parser. If not, see <http://www.gnu.org/licenses/>.
+
+ Copyright Vitaly Valtman 2014
+
+ It is derivative work of VK/KittenPHP-DB-Engine (https://github.com/vk-com/kphp-kdb/)
+ Copyright 2012-2013 Vkontakte Ltd
+ 2012-2013 Vitaliy Valtman
+
+*/
+
+#define _FILE_OFFSET_BITS 64
+#include "config.h"
+
+#if defined(_MSC_VER)
+#include <io.h>
+#include <stdint.h>
+#include <string.h>
+#else
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+#include <time.h>
+#include "portable_endian.h"
+#include <zlib.h>
+#include "tl-parser-tree.h"
+#include "tl-parser.h"
+#include "tl-tl.h"
+
+extern int verbosity;
+extern int schema_version;
+extern int output_expressions;
+
+
+int total_types_num;
+int total_constructors_num;
+int total_functions_num;
+
+
+/*char *tstrdup (const char *s) {
+ assert (s);
+ char *r = talloc (strlen (s) + 1);
+ memcpy (r, s, strlen (s) + 1);
+ return r;
+}*/
+
+#define talloc(a) malloc(a)
+#define tfree(a,b) free (a)
+#define talloc0(a) calloc(a,1)
+#define tstrdup(a) strdup(a)
+
+typedef char error_int_must_be_4_byte[(sizeof (int) == 4) ? 1 : -1];
+typedef char error_long_long_must_be_8_byte[(sizeof (long long) == 8) ? 1 : -1];
+
+char curch;
+struct parse parse;
+
+struct tree *tree;
+
+struct tree *tree_alloc (void) {
+ struct tree *T = talloc (sizeof (*T));
+ assert (T);
+ memset (T, 0, sizeof (*T));
+ return T;
+}
+
+#define CRC32_INITIAL crc32 (0, 0, 0)
+
+void tree_add_child (struct tree *P, struct tree *C) {
+ if (P->nc == P->size) {
+ void **t = talloc (sizeof (void *) * (++P->size));
+ memcpy (t, P->c, sizeof (void *) * (P->size - 1));
+ if (P->c) {
+ tfree (P->c, sizeof (void *) * (P->size - 1));
+ }
+ P->c = (void *)t;
+ assert (P->c);
+ }
+ P->c[P->nc ++] = C;
+}
+
+void tree_delete (struct tree *T) {
+ assert (T);
+ int i;
+ for (i = 0; i < T->nc; i++) {
+ assert (T->c[i]);
+ tree_delete (T->c[i]);
+ }
+ if (T->c) {
+ tfree (T->c, sizeof (void *) * T->nc);
+ }
+ tfree (T, sizeof (*T));
+}
+
+void tree_del_child (struct tree *P) {
+ assert (P->nc);
+ tree_delete (P->c[--P->nc]);
+}
+
+
+char nextch (void) {
+ if (parse.pos < parse.len - 1) {
+ curch = parse.text[++parse.pos];
+ } else {
+ curch = 0;
+ }
+ if (curch == 10) {
+ parse.line ++;
+ parse.line_pos = 0;
+ } else {
+ if (curch) {
+ parse.line_pos ++;
+ }
+ }
+ return curch;
+}
+
+
+struct parse save_parse (void) {
+ return parse;
+}
+
+void load_parse (struct parse _parse) {
+ parse = _parse;
+ curch = parse.pos > parse.len ? 0: parse.text[parse.pos] ;
+}
+
+int is_whitespace (char c) {
+ return (c <= 32);
+}
+
+int is_uletter (char c) {
+ return (c >= 'A' && c <= 'Z');
+}
+
+int is_lletter (char c) {
+ return (c >= 'a' && c <= 'z');
+}
+
+int is_letter (char c) {
+ return is_uletter (c) || is_lletter (c);
+}
+
+int is_digit (char c) {
+ return (c >= '0' && c <= '9');
+}
+
+int is_hexdigit (char c) {
+ return is_digit (c) || (c >= 'a' && c <= 'f');
+}
+
+int is_ident_char (char c) {
+ return is_digit (c) || is_letter (c) || c == '_';
+}
+
+int last_error_pos;
+int last_error_line;
+int last_error_line_pos;
+char *last_error;
+
+void parse_error (const char *e) {
+ if (parse.pos > last_error_pos) {
+ last_error_pos = parse.pos;
+ last_error_line = parse.line;
+ last_error_line_pos = parse.line_pos;
+ if (last_error) {
+ tfree (last_error, strlen (last_error) + 1);
+ }
+ last_error = tstrdup (e);
+ }
+}
+
+void tl_print_parse_error (void) {
+ fprintf (stderr, "Error near line %d pos %d: `%s`\n", last_error_line + 1, last_error_line_pos + 1, last_error);
+}
+
+char *parse_lex (void) {
+ while (1) {
+ while (curch && is_whitespace (curch)) { nextch (); }
+ if (curch == '/' && nextch () == '/') {
+ while (nextch () != 10);
+ nextch ();
+ } else {
+ break;
+ }
+ }
+ if (!curch) {
+ parse.lex.len = 0;
+ parse.lex.type = lex_eof;
+ return (parse.lex.ptr = 0);
+ }
+ char *p = parse.text + parse.pos;
+ parse.lex.flags = 0;
+ switch (curch) {
+ case '-':
+ if (nextch () != '-' || nextch () != '-') {
+ parse_error ("Can not parse triple minus");
+ parse.lex.type = lex_error;
+ return (parse.lex.ptr = (void *)-1);
+ } else {
+ parse.lex.len = 3;
+ parse.lex.type = lex_triple_minus;
+ nextch ();
+ return (parse.lex.ptr = p);
+ }
+ case ':':
+ case ';':
+ case '(':
+ case ')':
+ case '[':
+ case ']':
+ case '{':
+ case '}':
+ case '=':
+ case '#':
+ case '?':
+ case '%':
+ case '<':
+ case '>':
+ case '+':
+ case ',':
+ case '*':
+ case '_':
+ case '!':
+ case '.':
+ nextch ();
+ parse.lex.len = 1;
+ parse.lex.type = lex_char;
+ return (parse.lex.ptr = p);
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ parse.lex.flags = 0;
+ if (is_uletter (curch)) {
+ while (is_ident_char (nextch ()));
+ parse.lex.len = parse.text + parse.pos - p;
+ parse.lex.ptr = p;
+ if (parse.lex.len == 5 && !memcmp (parse.lex.ptr, "Final", 5)) {
+ parse.lex.type = lex_final;
+ } else if (parse.lex.len == 3 && !memcmp (parse.lex.ptr, "New", 3)) {
+ parse.lex.type = lex_new;
+ } else if (parse.lex.len == 5 && !memcmp (parse.lex.ptr, "Empty", 5)) {
+ parse.lex.type = lex_empty;
+ } else {
+ parse.lex.type = lex_uc_ident;
+ }
+ return (parse.lex.ptr = p);
+ }
+ while (is_ident_char (nextch ()));
+ if (curch == '.' && !is_letter (parse.text[parse.pos + 1])) {
+ parse.lex.len = parse.text + parse.pos - p;
+ parse.lex.type = lex_lc_ident;
+ return (parse.lex.ptr = p);
+ }
+ if (curch == '.') {
+ parse.lex.flags |= 1;
+ nextch ();
+ if (is_uletter (curch)) {
+ while (is_ident_char (nextch ()));
+ parse.lex.len = parse.text + parse.pos - p;
+ parse.lex.type = lex_uc_ident;
+ return (parse.lex.ptr = p);
+ }
+ if (is_lletter (curch)) {
+ while (is_ident_char (nextch ()));
+ } else {
+ parse_error ("Expected letter");
+ parse.lex.type = lex_error;
+ return (parse.lex.ptr = (void *)-1);
+ }
+ }
+ if (curch == '#') {
+ parse.lex.flags |= 2;
+ int i;
+ int ok = 1;
+ for (i = 0; i < 8; i++) {
+ if (!is_hexdigit (nextch())) {
+ if (curch == ' ' && i >= 5) {
+ ok = 2;
+ break;
+ } else {
+ parse_error ("Hex digit expected");
+ parse.lex.type = lex_error;
+ return (parse.lex.ptr = (void *)-1);
+ }
+ }
+ }
+ if (ok == 1) {
+ nextch ();
+ }
+ }
+ parse.lex.len = parse.text + parse.pos - p;
+ parse.lex.type = lex_lc_ident;
+ return (parse.lex.ptr = p);
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ while (is_digit (nextch ()));
+ parse.lex.len = parse.text + parse.pos - p;
+ parse.lex.type = lex_num;
+ return (parse.lex.ptr = p);
+ default:
+ parse_error ("Unknown lexem");
+ parse.lex.type = lex_error;
+ return (parse.lex.ptr = (void *)-1);
+ }
+
+}
+
+int expect (char *s) {
+ if (!parse.lex.ptr || parse.lex.ptr == (void *)-1 || parse.lex.type == lex_error || parse.lex.type == lex_none || parse.lex.len != (int)strlen (s) || memcmp (s, parse.lex.ptr, parse.lex.len)) {
+ static char buf[1000];
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ sprintf_s(buf, 1000, "Expected %s", s);
+#else
+ sprintf(buf, "Expected %s", s);
+#endif
+ parse_error (buf);
+ return -1;
+ } else {
+ parse_lex ();
+ }
+ return 1;
+}
+
+struct parse *tl_init_parse_file (const char *fname) {
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ int fd = 0;
+ if (_sopen_s(&fd, fname, _O_RDONLY | _O_BINARY, _SH_DENYNO, _S_IREAD | _S_IWRITE) != 0) {
+ char errorStr[256] = { 0 };
+ strerror_s(errorStr, 256, errno);
+ fprintf(stderr, "Error %s\n", errorStr);
+#elif defined(WIN32) || defined(_WIN32)
+ int fd = open(fname, O_RDONLY | O_BINARY);
+ if (fd < 0) {
+ fprintf(stderr, "Error %s\n", strerror(errno));
+#else
+ int fd = open(fname, O_RDONLY);
+ if (fd < 0) {
+ fprintf(stderr, "Error %m\n");
+#endif
+ assert (0);
+ return 0;
+ }
+ long long size = lseek (fd, 0, SEEK_END);
+ if (size <= 0) {
+ fprintf (stderr, "size is %"_PRINTF_INT64_"d. Too small.\n", size);
+ return 0;
+ }
+ static struct parse save;
+ save.text = talloc (size);
+ lseek (fd, 0, SEEK_SET);
+ save.len = read (fd, save.text, size);
+ assert (save.len == size);
+ save.pos = 0;
+ save.line = 0;
+ save.line_pos = 0;
+ save.lex.ptr = save.text;
+ save.lex.len = 0;
+ save.lex.type = lex_none;
+ return &save;
+}
+
+#define PARSE_INIT(_type) struct parse save = save_parse (); struct tree *T = tree_alloc (); T->type = (_type); T->lex_line = parse.line; T->lex_line_pos = parse.line_pos; struct tree *S __attribute__ ((unused));
+#define PARSE_FAIL load_parse (save); tree_delete (T); return 0;
+#define PARSE_OK return T;
+#define PARSE_TRY_PES(x) if (!(S = x ())) { PARSE_FAIL; } { tree_add_child (T, S); }
+#define PARSE_TRY_OPT(x) if ((S = x ())) { tree_add_child (T, S); PARSE_OK }
+#define PARSE_TRY(x) S = x ();
+#define PARSE_ADD(_type) S = tree_alloc (); S->type = _type; tree_add_child (T, S);
+#define EXPECT(s) if (expect (s) < 0) { PARSE_FAIL; }
+#define LEX_CHAR(c) (parse.lex.type == lex_char && *parse.lex.ptr == c)
+struct tree *parse_args (void);
+struct tree *parse_expr (void);
+
+struct tree *parse_boxed_type_ident (void) {
+ PARSE_INIT (type_boxed_type_ident);
+ if (parse.lex.type != lex_uc_ident) {
+ parse_error ("Can not parse boxed type");
+ PARSE_FAIL;
+ } else {
+ T->text = parse.lex.ptr;
+ T->len = parse.lex.len;
+ T->flags = parse.lex.flags;
+ parse_lex ();
+ PARSE_OK;
+ }
+}
+
+struct tree *parse_full_combinator_id (void) {
+ PARSE_INIT (type_full_combinator_id);
+ if (parse.lex.type == lex_lc_ident || LEX_CHAR('_')) {
+ T->text = parse.lex.ptr;
+ T->len = parse.lex.len;
+ T->flags = parse.lex.flags;
+ parse_lex ();
+ PARSE_OK;
+ } else {
+ parse_error ("Can not parse full combinator id");
+ PARSE_FAIL;
+ }
+}
+
+struct tree *parse_combinator_id (void) {
+ PARSE_INIT (type_combinator_id);
+ if (parse.lex.type == lex_lc_ident && !(parse.lex.flags & 2)) {
+ T->text = parse.lex.ptr;
+ T->len = parse.lex.len;
+ T->flags = parse.lex.flags;
+ parse_lex ();
+ PARSE_OK;
+ } else {
+ parse_error ("Can not parse combinator id");
+ PARSE_FAIL;
+ }
+}
+
+struct tree *parse_var_ident (void) {
+ PARSE_INIT (type_var_ident);
+ if ((parse.lex.type == lex_lc_ident || parse.lex.type == lex_uc_ident) && !(parse.lex.flags & 3)) {
+ T->text = parse.lex.ptr;
+ T->len = parse.lex.len;
+ T->flags = parse.lex.flags;
+ parse_lex ();
+ PARSE_OK;
+ } else {
+ parse_error ("Can not parse var ident");
+ PARSE_FAIL;
+ }
+}
+
+struct tree *parse_var_ident_opt (void) {
+ PARSE_INIT (type_var_ident_opt);
+ if ((parse.lex.type == lex_lc_ident || parse.lex.type == lex_uc_ident)&& !(parse.lex.flags & 3)) {
+ T->text = parse.lex.ptr;
+ T->len = parse.lex.len;
+ T->flags = parse.lex.flags;
+ parse_lex ();
+ PARSE_OK;
+ } else if (LEX_CHAR ('_')) {
+ T->text = parse.lex.ptr;
+ T->len = parse.lex.len;
+ T->flags = parse.lex.flags;
+ parse_lex ();
+ PARSE_OK;
+ } else {
+ parse_error ("Can not parse var ident opt");
+ PARSE_FAIL;
+ }
+}
+
+struct tree *parse_nat_const (void) {
+ PARSE_INIT (type_nat_const);
+ if (parse.lex.type == lex_num) {
+ T->text = parse.lex.ptr;
+ T->len = parse.lex.len;
+ T->flags = parse.lex.flags;
+ parse_lex ();
+ PARSE_OK;
+ } else {
+ parse_error ("Can not parse nat const");
+ PARSE_FAIL;
+ }
+}
+
+struct tree *parse_type_ident (void) {
+ PARSE_INIT (type_type_ident);
+ if (parse.lex.type == lex_uc_ident && !(parse.lex.flags & 2)) {
+ T->text = parse.lex.ptr;
+ T->len = parse.lex.len;
+ T->flags = parse.lex.flags;
+ parse_lex ();
+ PARSE_OK;
+ } else if (parse.lex.type == lex_lc_ident && !(parse.lex.flags & 2)) {
+ T->text = parse.lex.ptr;
+ T->len = parse.lex.len;
+ T->flags = parse.lex.flags;
+ parse_lex ();
+ PARSE_OK;
+ } else if (LEX_CHAR ('#')) {
+ T->text = parse.lex.ptr;
+ T->len = parse.lex.len;
+ T->flags = parse.lex.flags;
+ parse_lex ();
+ PARSE_OK;
+ } else {
+ parse_error ("Can not parse type ident");
+ PARSE_FAIL;
+ }
+}
+
+struct tree *parse_term (void) {
+ PARSE_INIT (type_term);
+ while (LEX_CHAR ('%')) {
+ EXPECT ("%")
+ PARSE_ADD (type_percent);
+ }
+ if (LEX_CHAR ('(')) {
+ EXPECT ("(");
+ PARSE_TRY_PES (parse_expr);
+ EXPECT (")");
+ PARSE_OK;
+ }
+ PARSE_TRY (parse_type_ident);
+ if (S) {
+ tree_add_child (T, S);
+ if (LEX_CHAR ('<')) {
+ EXPECT ("<");
+ while (1) {
+ PARSE_TRY_PES (parse_expr);
+ if (LEX_CHAR ('>')) { break; }
+ EXPECT (",");
+ }
+ EXPECT (">");
+ }
+ PARSE_OK;
+ }
+ PARSE_TRY_OPT (parse_type_ident);
+ PARSE_TRY_OPT (parse_var_ident);
+ PARSE_TRY_OPT (parse_nat_const);
+ PARSE_FAIL;
+}
+
+struct tree *parse_nat_term (void) {
+ PARSE_INIT (type_nat_term);
+ PARSE_TRY_PES (parse_term);
+ PARSE_OK;
+}
+
+struct tree *parse_subexpr (void) {
+ PARSE_INIT (type_subexpr);
+ int was_term = 0;
+ int cc = 0;
+
+ while (1) {
+ PARSE_TRY (parse_nat_const);
+ if (S) {
+ tree_add_child (T, S);
+ } else if (!was_term) {
+ was_term = 1;
+ PARSE_TRY (parse_term);
+ if (S) {
+ tree_add_child (T, S);
+ } else {
+ break;
+ }
+ }
+ cc ++;
+ if (!LEX_CHAR ('+')) {
+ break;
+ }
+ EXPECT ("+");
+ }
+ if (!cc) {
+ PARSE_FAIL;
+ } else {
+ PARSE_OK;
+ }
+}
+
+struct tree *parse_expr (void) {
+ PARSE_INIT (type_expr);
+ int cc = 0;
+ while (1) {
+ PARSE_TRY (parse_subexpr);
+ if (S) {
+ tree_add_child (T, S);
+ cc ++;
+ } else {
+ if (cc < 1) { PARSE_FAIL; }
+ else { PARSE_OK; }
+ }
+ }
+}
+
+
+
+struct tree *parse_final_empty (void) {
+ PARSE_INIT (type_final_empty);
+ EXPECT ("Empty");
+ PARSE_TRY_PES (parse_boxed_type_ident);
+ PARSE_OK;
+}
+
+struct tree *parse_final_new (void) {
+ PARSE_INIT (type_final_new);
+ EXPECT ("New");
+ PARSE_TRY_PES (parse_boxed_type_ident);
+ PARSE_OK;
+}
+
+struct tree *parse_final_final (void) {
+ PARSE_INIT (type_final_final);
+ EXPECT ("Final");
+ PARSE_TRY_PES (parse_boxed_type_ident);
+ PARSE_OK;
+}
+
+struct tree *parse_partial_comb_app_decl (void) {
+ PARSE_INIT (type_partial_comb_app_decl);
+ PARSE_TRY_PES (parse_combinator_id);
+ while (1) {
+ PARSE_TRY_PES (parse_subexpr);
+ if (LEX_CHAR (';')) { break; }
+ }
+ PARSE_OK;
+}
+
+struct tree *parse_partial_type_app_decl (void) {
+ PARSE_INIT (type_partial_type_app_decl);
+ PARSE_TRY_PES (parse_boxed_type_ident);
+ if (LEX_CHAR ('<')) {
+ EXPECT ("<");
+ while (1) {
+ PARSE_TRY_PES (parse_expr);
+ if (LEX_CHAR ('>')) { break; }
+ EXPECT (",");
+ }
+ EXPECT (">");
+ PARSE_OK;
+ } else {
+ while (1) {
+ PARSE_TRY_PES (parse_subexpr);
+ if (LEX_CHAR (';')) { break; }
+ }
+ PARSE_OK;
+ }
+}
+
+
+
+
+struct tree *parse_multiplicity (void) {
+ PARSE_INIT (type_multiplicity);
+ PARSE_TRY_PES (parse_nat_term);
+ PARSE_OK;
+}
+
+
+struct tree *parse_type_term (void) {
+ PARSE_INIT (type_type_term);
+ PARSE_TRY_PES (parse_term);
+ PARSE_OK;
+}
+
+struct tree *parse_optional_arg_def (void) {
+ PARSE_INIT (type_optional_arg_def);
+ PARSE_TRY_PES (parse_var_ident);
+ EXPECT (".");
+ PARSE_TRY_PES (parse_nat_const);
+ EXPECT ("?");
+ PARSE_OK;
+}
+
+struct tree *parse_args4 (void) {
+ PARSE_INIT (type_args4);
+ struct parse so = save_parse ();
+ PARSE_TRY (parse_optional_arg_def);
+ if (S) {
+ tree_add_child (T, S);
+ } else {
+ load_parse (so);
+ }
+ if (LEX_CHAR ('!')) {
+ PARSE_ADD (type_exclam);
+ EXPECT ("!");
+ }
+ PARSE_TRY_PES (parse_type_term);
+ PARSE_OK;
+}
+
+struct tree *parse_args3 (void) {
+ PARSE_INIT (type_args3);
+ PARSE_TRY_PES (parse_var_ident_opt);
+ EXPECT (":");
+ struct parse so = save_parse ();
+ PARSE_TRY (parse_optional_arg_def);
+ if (S) {
+ tree_add_child (T, S);
+ } else {
+ load_parse (so);
+ }
+ if (LEX_CHAR ('!')) {
+ PARSE_ADD (type_exclam);
+ EXPECT ("!");
+ }
+ PARSE_TRY_PES (parse_type_term);
+ PARSE_OK;
+}
+
+struct tree *parse_args2 (void) {
+ PARSE_INIT (type_args2);
+ PARSE_TRY (parse_var_ident_opt);
+ if (S && LEX_CHAR (':')) {
+ tree_add_child (T, S);
+ EXPECT (":");
+ } else {
+ load_parse (save);
+ }
+ struct parse so = save_parse ();
+ PARSE_TRY (parse_optional_arg_def);
+ if (S) {
+ tree_add_child (T, S);
+ } else {
+ load_parse (so);
+ }
+ struct parse save2 = save_parse ();
+ PARSE_TRY (parse_multiplicity);
+ if (S && LEX_CHAR ('*')) {
+ tree_add_child (T, S);
+ EXPECT ("*");
+ } else {
+ load_parse (save2);
+ }
+ EXPECT ("[");
+ while (1) {
+ if (LEX_CHAR (']')) { break; }
+ PARSE_TRY_PES (parse_args);
+ }
+ EXPECT ("]");
+ PARSE_OK;
+}
+
+struct tree *parse_args1 (void) {
+ PARSE_INIT (type_args1);
+ EXPECT ("(");
+ while (1) {
+ PARSE_TRY_PES (parse_var_ident_opt);
+ if (LEX_CHAR(':')) { break; }
+ }
+ EXPECT (":");
+ struct parse so = save_parse ();
+ PARSE_TRY (parse_optional_arg_def);
+ if (S) {
+ tree_add_child (T, S);
+ } else {
+ load_parse (so);
+ }
+ if (LEX_CHAR ('!')) {
+ PARSE_ADD (type_exclam);
+ EXPECT ("!");
+ }
+ PARSE_TRY_PES (parse_type_term);
+ EXPECT (")");
+ PARSE_OK;
+}
+
+struct tree *parse_args (void) {
+ PARSE_INIT (type_args);
+ PARSE_TRY_OPT (parse_args1);
+ PARSE_TRY_OPT (parse_args2);
+ PARSE_TRY_OPT (parse_args3);
+ PARSE_TRY_OPT (parse_args4);
+ PARSE_FAIL;
+}
+
+struct tree *parse_opt_args (void) {
+ PARSE_INIT (type_opt_args);
+ while (1) {
+ PARSE_TRY_PES (parse_var_ident);
+ if (parse.lex.type == lex_char && *parse.lex.ptr == ':') { break;}
+ }
+ EXPECT (":");
+ PARSE_TRY_PES (parse_type_term);
+ PARSE_OK;
+}
+
+struct tree *parse_final_decl (void) {
+ PARSE_INIT (type_final_decl);
+ PARSE_TRY_OPT (parse_final_new);
+ PARSE_TRY_OPT (parse_final_final);
+ PARSE_TRY_OPT (parse_final_empty);
+ PARSE_FAIL;
+}
+
+struct tree *parse_partial_app_decl (void) {
+ PARSE_INIT (type_partial_app_decl);
+ PARSE_TRY_OPT (parse_partial_type_app_decl);
+ PARSE_TRY_OPT (parse_partial_comb_app_decl);
+ PARSE_FAIL;
+}
+
+struct tree *parse_result_type (void) {
+ PARSE_INIT (type_result_type);
+ PARSE_TRY_PES (parse_boxed_type_ident);
+ if (LEX_CHAR ('<')) {
+ EXPECT ("<");
+ while (1) {
+ PARSE_TRY_PES (parse_expr);
+ if (LEX_CHAR ('>')) { break; }
+ EXPECT (",");
+ }
+ EXPECT (">");
+ PARSE_OK;
+ } else {
+ while (1) {
+ if (LEX_CHAR (';')) { PARSE_OK; }
+ PARSE_TRY_PES (parse_subexpr);
+ }
+ }
+}
+
+struct tree *parse_combinator_decl (void) {
+ PARSE_INIT (type_combinator_decl);
+ PARSE_TRY_PES (parse_full_combinator_id)
+ while (1) {
+ if (LEX_CHAR ('{')) {
+ parse_lex ();
+ PARSE_TRY_PES (parse_opt_args);
+ EXPECT ("}");
+ } else {
+ break;
+ }
+ }
+ while (1) {
+ if (LEX_CHAR ('=')) { break; }
+ PARSE_TRY_PES (parse_args);
+ }
+ EXPECT ("=");
+ PARSE_ADD (type_equals);
+
+ PARSE_TRY_PES (parse_result_type);
+ PARSE_OK;
+}
+
+struct tree *parse_builtin_combinator_decl (void) {
+ PARSE_INIT (type_builtin_combinator_decl);
+ PARSE_TRY_PES (parse_full_combinator_id)
+ EXPECT ("?");
+ EXPECT ("=");
+ PARSE_TRY_PES (parse_boxed_type_ident);
+ PARSE_OK;
+}
+
+struct tree *parse_declaration (void) {
+ PARSE_INIT (type_declaration);
+ PARSE_TRY_OPT (parse_combinator_decl);
+ PARSE_TRY_OPT (parse_partial_app_decl);
+ PARSE_TRY_OPT (parse_final_decl);
+ PARSE_TRY_OPT (parse_builtin_combinator_decl);
+ PARSE_FAIL;
+}
+
+struct tree *parse_constr_declarations (void) {
+ PARSE_INIT (type_constr_declarations);
+ if (parse.lex.type == lex_triple_minus || parse.lex.type == lex_eof) { PARSE_OK; }
+ while (1) {
+ PARSE_TRY_PES (parse_declaration);
+ EXPECT (";");
+ if (parse.lex.type == lex_eof || parse.lex.type == lex_triple_minus) { PARSE_OK; }
+ }
+}
+
+struct tree *parse_fun_declarations (void) {
+ PARSE_INIT (type_fun_declarations);
+ if (parse.lex.type == lex_triple_minus || parse.lex.type == lex_eof) { PARSE_OK; }
+ while (1) {
+ PARSE_TRY_PES (parse_declaration);
+ EXPECT (";");
+ if (parse.lex.type == lex_eof || parse.lex.type == lex_triple_minus) { PARSE_OK; }
+ }
+}
+
+struct tree *parse_program (void) {
+ PARSE_INIT (type_tl_program);
+ while (1) {
+ PARSE_TRY_PES (parse_constr_declarations);
+ if (parse.lex.type == lex_eof) { PARSE_OK; }
+ if (parse.lex.type == lex_error || expect ("---") < 0 || expect ("functions") < 0 || expect ("---") < 0) { PARSE_FAIL; }
+
+ PARSE_TRY_PES (parse_fun_declarations);
+ if (parse.lex.type == lex_eof) { PARSE_OK; }
+ if (parse.lex.type == lex_error || expect ("---") < 0 || expect ("types") < 0 || expect ("---") < 0) { PARSE_FAIL; }
+ }
+}
+
+struct tree *tl_parse_lex (struct parse *_parse) {
+ assert (_parse);
+ load_parse (*_parse);
+ if (parse.lex.type == lex_none) {
+ parse_lex ();
+ }
+ if (parse.lex.type == lex_error) {
+ return 0;
+ }
+ return parse_program ();
+}
+
+int mystrcmp2 (const char *b, int len, const char *a) {
+ int c = strncmp (b, a, len);
+ return c ? a[len] ? -1 : 0 : c;
+}
+
+char *mystrdup (const char *a, int len) {
+ char *z = talloc (len + 1);
+ memcpy (z, a, len);
+ z[len] = 0;
+ return z;
+}
+
+struct tl_program *tl_program_cur;
+#define TL_TRY_PES(x) if (!(x)) { return 0; }
+
+#define tl_type_cmp(a,b) (strcmp (a->id, b->id))
+DEFINE_TREE (tl_type,struct tl_type *,tl_type_cmp,0)
+struct tree_tl_type *tl_type_tree;
+
+DEFINE_TREE (tl_constructor,struct tl_constructor *,tl_type_cmp,0)
+struct tree_tl_constructor *tl_constructor_tree;
+struct tree_tl_constructor *tl_function_tree;
+
+DEFINE_TREE (tl_var,struct tl_var *,tl_type_cmp,0)
+
+struct tl_var_value {
+ struct tl_combinator_tree *ptr;
+ struct tl_combinator_tree *val;
+ int num_val;
+};
+
+#define tl_var_value_cmp(a,b) (((char *)a.ptr) - ((char *)b.ptr))
+struct tl_var_value empty;
+DEFINE_TREE (var_value, struct tl_var_value, tl_var_value_cmp, empty)
+//tree_tl_var_t *tl_var_tree;
+
+DEFINE_TREE (tl_field,char *,strcmp, 0)
+//tree_tl_field_t *tl_field_tree;
+#define TL_FAIL return 0;
+#define TL_INIT(x) struct tl_combinator_tree *x = 0;
+#define TL_TRY(f,x) { struct tl_combinator_tree *_t = f; if (!_t) { TL_FAIL;} x = tl_union (x, _t); if (!x) { TL_FAIL; }}
+#define TL_ERROR(...) fprintf (stderr, __VA_ARGS__);
+#define TL_WARNING(...) fprintf (stderr, __VA_ARGS__);
+
+void tl_set_var_value (struct tree_var_value **T, struct tl_combinator_tree *var, struct tl_combinator_tree *value) {
+ struct tl_var_value t = {.ptr = var, .val = value, .num_val = 0};
+ if (tree_lookup_var_value (*T, t).ptr) {
+ *T = tree_delete_var_value (*T, t);
+ }
+ *T = tree_insert_var_value (*T, t, lrand48 ());
+}
+
+void tl_set_var_value_num (struct tree_var_value **T, struct tl_combinator_tree *var, struct tl_combinator_tree *value, long long num_value) {
+ struct tl_var_value t = {.ptr = var, .val = value, .num_val = num_value};
+ if (tree_lookup_var_value (*T, t).ptr) {
+ *T = tree_delete_var_value (*T, t);
+ }
+ *T = tree_insert_var_value (*T, t, lrand48 ());
+}
+
+struct tl_combinator_tree *tl_get_var_value (struct tree_var_value **T, struct tl_combinator_tree *var) {
+ struct tl_var_value t = {.ptr = var, .val = 0, .num_val = 0};
+ struct tl_var_value r = tree_lookup_var_value (*T, t);
+ return r.ptr ? r.val : 0;
+}
+
+int tl_get_var_value_num (struct tree_var_value **T, struct tl_combinator_tree *var) {
+ struct tl_var_value t = {.ptr = var, .val = 0};
+ struct tl_var_value r = tree_lookup_var_value (*T, t);
+ return r.ptr ? r.num_val : 0;
+}
+
+int namespace_level;
+
+struct tree_tl_var *vars[10];
+struct tree_tl_field *fields[10];
+struct tl_var *last_num_var[10];
+
+int tl_is_type_name (const char *id, int len) {
+ if (len == 1 && *id == '#') { return 1;}
+ int ok = id[0] >= 'A' && id[0] <= 'Z';
+ int i;
+ for (i = 0; i < len - 1; i++) if (id[i] == '.') {
+ ok = id[i + 1] >= 'A' && id[i + 1] <= 'Z';
+ }
+ return ok;
+}
+
+int tl_add_field (char *id) {
+ assert (namespace_level < 10);
+ assert (namespace_level >= 0);
+ if (tree_lookup_tl_field (fields[namespace_level], id)) {
+ return 0;
+ }
+ fields[namespace_level] = tree_insert_tl_field (fields[namespace_level], id, lrand48 ());
+ return 1;
+}
+
+void tl_clear_fields (void) {
+// tree_act_tl_field (fields[namespace_level], (void *)free);
+ fields[namespace_level] = tree_clear_tl_field (fields[namespace_level]);
+}
+
+struct tl_var *tl_add_var (char *id, struct tl_combinator_tree *ptr, int type) {
+ struct tl_var *v = talloc (sizeof (*v));
+ v->id = tstrdup (id);
+ v->type = type;
+ v->ptr = ptr;
+ v->flags = 0;
+ if (tree_lookup_tl_var (vars[namespace_level], v)) {
+ return 0;
+ }
+ vars[namespace_level] = tree_insert_tl_var (vars[namespace_level], v, lrand48 ());
+ if (type) {
+ last_num_var[namespace_level] = v;
+ }
+ return v;
+}
+
+void tl_del_var (struct tl_var *v) {
+// free (v->id);
+ tfree (v, sizeof (*v));
+}
+
+void tl_clear_vars (void) {
+ tree_act_tl_var (vars[namespace_level], tl_del_var);
+ vars[namespace_level] = tree_clear_tl_var (vars[namespace_level]);
+ last_num_var[namespace_level] = 0;
+}
+
+struct tl_var *tl_get_last_num_var (void) {
+ return last_num_var[namespace_level];
+}
+
+struct tl_var *tl_get_var (char *_id, int len) {
+ char *id = mystrdup (_id, len);
+ struct tl_var v = {.id = id};
+ int i;
+ for (i = namespace_level; i >= 0; i--) {
+ struct tl_var *w = tree_lookup_tl_var (vars[i], &v);
+ if (w) {
+ tfree (id, len + 1);
+ return w;
+ }
+ }
+ tfree (id, len + 1);
+ return 0;
+}
+
+void namespace_push (void) {
+ namespace_level ++;
+ assert (namespace_level < 10);
+ tl_clear_vars ();
+ tl_clear_fields ();
+}
+
+void namespace_pop (void) {
+ namespace_level --;
+ assert (namespace_level >= 0);
+}
+
+struct tl_type *tl_get_type (const char *_id, int len) {
+ char *id = mystrdup (_id, len);
+ struct tl_type _t = {.id = id};
+ struct tl_type *r = tree_lookup_tl_type (tl_type_tree, &_t);
+ tfree (id, len + 1);
+ return r;
+}
+
+struct tl_type *tl_add_type (const char *_id, int len, int params_num, long long params_types) {
+ char *id = talloc (len + 1);
+ memcpy (id, _id, len);
+ id[len] = 0;
+ struct tl_type _t = {.id = id};
+ struct tl_type *_r = 0;
+ if ((_r = tree_lookup_tl_type (tl_type_tree, &_t))) {
+ tfree (id, len + 1);
+ if (params_num >= 0 && (_r->params_num != params_num || _r->params_types != params_types)) {
+ TL_ERROR ("Wrong params_num or types for type %s\n", _r->id);
+ return 0;
+ }
+ return _r;
+ }
+ struct tl_type *t = talloc (sizeof (*t));
+ t->id = id;
+ t->print_id = tstrdup (t->id);
+ int i;
+ for (i = 0; i < len; i++) if (t->print_id[i] == '.' || t->print_id[i] == '#' || t->print_id[i] == ' ') {
+ t->print_id[i] = '$';
+ }
+ t->name = 0;
+ t->constructors_num = 0;
+ t->constructors = 0;
+ t->flags = 0;
+ t->real_id = 0;
+ if (params_num >= 0) {
+ assert (params_num <= 64);
+ t->params_num = params_num;
+ t->params_types = params_types;
+ } else {
+ t->flags |= 4;
+ t->params_num = -1;
+ }
+ tl_type_tree = tree_insert_tl_type (tl_type_tree, t, lrand48 ());
+ total_types_num ++;
+ return t;
+}
+
+void tl_add_type_param (struct tl_type *t, int x) {
+ assert (t->flags & 4);
+ assert (t->params_num <= 64);
+ if (x) {
+ t->params_types |= (1ull << (t->params_num ++));
+ } else {
+ t->params_num ++;
+ }
+}
+
+int tl_type_set_params (struct tl_type *t, int x, long long y) {
+ if (t->flags & 4) {
+ t->params_num = x;
+ t->params_types = y;
+ t->flags &= ~4;
+ } else {
+ if (t->params_num != x || t->params_types != y) {
+ fprintf (stderr, "Wrong num of params (type %s)\n", t->id);
+ return 0;
+ }
+ }
+ return 1;
+}
+
+void tl_type_finalize (struct tl_type *t) {
+ t->flags &= ~4;
+}
+
+struct tl_constructor *tl_get_constructor (const char *_id, int len) {
+ char *id = mystrdup (_id, len);
+ struct tl_constructor _t = {.id = id};
+ struct tl_constructor *r = tree_lookup_tl_constructor (tl_constructor_tree, &_t);
+ tfree (id, len + 1);
+ return r;
+}
+
+struct tl_constructor *tl_add_constructor (struct tl_type *a, const char *_id, int len, int force_magic) {
+ assert (a);
+ if (a->flags & 1) {
+ TL_ERROR ("New constructor for type `%s` after final statement\n", a->id);
+ return 0;
+ }
+ int x = 0;
+ while (x < len && (_id[x] != '#' || force_magic)) { x++; }
+ char *id = talloc (x + 1);
+ memcpy (id, _id, x);
+ id[x] = 0;
+
+ unsigned magic = 0;
+ if (x < len) {
+ assert (len - x >= 6 && len - x <= 9);
+ int i;
+ for (i = 1; i < len - x; i++) {
+ magic = (magic << 4) + (_id[x + i] <= '9' ? _id[x + i] - '0' : _id[x + i] - 'a' + 10);
+ }
+ assert (magic && magic != (unsigned)-1);
+ }
+
+ len = x;
+ if (*id != '_') {
+ struct tl_constructor _t = {.id = id};
+ if (tree_lookup_tl_constructor (tl_constructor_tree, &_t)) {
+ TL_ERROR ("Duplicate constructor id `%s`\n", id);
+ tfree (id, len + 1);
+ return 0;
+ }
+ } else {
+ assert (len == 1);
+ }
+
+ struct tl_constructor *t = talloc (sizeof (*t));
+ t->type = a;
+ t->name = magic;
+ t->id = id;
+ t->print_id = tstrdup (id);
+ t->real_id = 0;
+
+ int i;
+ for (i = 0; i < len; i++) if (t->print_id[i] == '.' || t->print_id[i] == '#' || t->print_id[i] == ' ') {
+ t->print_id[i] = '$';
+ }
+
+ t->left = t->right = 0;
+ a->constructors = realloc (a->constructors, sizeof (void *) * (a->constructors_num + 1));
+ assert (a->constructors);
+ a->constructors[a->constructors_num ++] = t;
+ if (*id != '_') {
+ tl_constructor_tree = tree_insert_tl_constructor (tl_constructor_tree, t, lrand48 ());
+ } else {
+ a->flags |= FLAG_DEFAULT_CONSTRUCTOR;
+ }
+ total_constructors_num ++;
+ return t;
+}
+
+struct tl_constructor *tl_get_function (const char *_id, int len) {
+ char *id = mystrdup (_id, len);
+ struct tl_constructor _t = {.id = id};
+ struct tl_constructor *r = tree_lookup_tl_constructor (tl_function_tree, &_t);
+ tfree (id, len + 1);
+ return r;
+}
+
+struct tl_constructor *tl_add_function (struct tl_type *a, const char *_id, int len, int force_magic) {
+// assert (a);
+ int x = 0;
+ while (x < len && ((_id[x] != '#') || force_magic)) { x++; }
+ char *id = talloc (x + 1);
+ memcpy (id, _id, x);
+ id[x] = 0;
+
+ unsigned magic = 0;
+ if (x < len) {
+ assert (len - x >= 6 && len - x <= 9);
+ int i;
+ for (i = 1; i < len - x; i++) {
+ magic = (magic << 4) + (_id[x + i] <= '9' ? _id[x + i] - '0' : _id[x + i] - 'a' + 10);
+ }
+ assert (magic && magic != (unsigned)-1);
+ }
+
+ len = x;
+
+ struct tl_constructor _t = {.id = id};
+ if (tree_lookup_tl_constructor (tl_function_tree, &_t)) {
+ TL_ERROR ("Duplicate function id `%s`\n", id);
+ tfree (id, len + 1);
+ return 0;
+ }
+
+ struct tl_constructor *t = talloc (sizeof (*t));
+ t->type = a;
+ t->name = magic;
+ t->id = id;
+ t->print_id = tstrdup (id);
+ t->real_id = 0;
+
+ int i;
+ for (i = 0; i < len; i++) if (t->print_id[i] == '.' || t->print_id[i] == '#' || t->print_id[i] == ' ') {
+ t->print_id[i] = '$';
+ }
+
+ t->left = t->right = 0;
+ tl_function_tree = tree_insert_tl_constructor (tl_function_tree, t, lrand48 ());
+ total_functions_num ++;
+ return t;
+}
+
+static char buf[(1 << 20)];
+int buf_pos;
+
+struct tl_combinator_tree *alloc_ctree_node (void) {
+ struct tl_combinator_tree *T = talloc (sizeof (*T));
+ assert (T);
+ memset (T, 0, sizeof (*T));
+ return T;
+}
+
+struct tl_combinator_tree *tl_tree_dup (struct tl_combinator_tree *T) {
+ if (!T) { return 0; }
+ struct tl_combinator_tree *S = talloc (sizeof (*S));
+ memcpy (S, T, sizeof (*S));
+ S->left = tl_tree_dup (T->left);
+ S->right = tl_tree_dup (T->right);
+ return S;
+}
+
+struct tl_type *tl_tree_get_type (struct tl_combinator_tree *T) {
+ assert (T->type == type_type);
+ if (T->act == act_array) { return 0;}
+ while (T->left) {
+ T = T->left;
+ if (T->act == act_array) { return 0;}
+ assert (T->type == type_type);
+ }
+ assert (T->act == act_type || T->act == act_var || T->act == act_array);
+ return T->act == act_type ? T->data : 0;
+}
+
+void tl_tree_set_len (struct tl_combinator_tree *T) {
+ TL_INIT (H);
+ H = T;
+ while (H->left) {
+ H->left->type_len = H->type_len + 1;
+ H = H->left;
+ }
+ assert (H->type == type_type);
+ struct tl_type *t = H->data;
+ assert (t);
+ assert (H->type_len == t->params_num);
+}
+
+void tl_buf_reset (void) {
+ buf_pos = 0;
+}
+
+void tl_buf_add_string (char *s, int len) {
+ if (len < 0) { len = strlen (s); }
+ buf[buf_pos ++] = ' ';
+ memcpy (buf + buf_pos, s, len); buf_pos += len;
+ buf[buf_pos] = 0;
+}
+
+void tl_buf_add_string_nospace (char *s, int len) {
+ if (len < 0) { len = strlen (s); }
+// if (buf_pos) { buf[buf_pos ++] = ' '; }
+ memcpy (buf + buf_pos, s, len); buf_pos += len;
+ buf[buf_pos] = 0;
+}
+
+void tl_buf_add_string_q (char *s, int len, int x) {
+ if (x) {
+ tl_buf_add_string (s, len);
+ } else {
+ tl_buf_add_string_nospace (s, len);
+ }
+}
+
+
+void tl_buf_add_tree (struct tl_combinator_tree *T, int x) {
+ if (!T) { return; }
+ assert (T != (void *)-1l && T != (void *)-2l);
+ switch (T->act) {
+ case act_question_mark:
+ tl_buf_add_string_q ("?", -1, x);
+ return;
+ case act_type:
+ if ((T->flags & 1) && !(T->flags & 4)) {
+ tl_buf_add_string_q ("%", -1, x);
+ x = 0;
+ }
+ if (T->flags & 2) {
+ tl_buf_add_string_q ((char *)T->data, -1, x);
+ } else {
+ struct tl_type *t = T->data;
+ if (T->flags & 4) {
+ assert (t->constructors_num == 1);
+ tl_buf_add_string_q (t->constructors[0]->real_id ? t->constructors[0]->real_id : t->constructors[0]->id, -1, x);
+ } else {
+ tl_buf_add_string_q (t->real_id ? t->real_id : t->id, -1, x);
+ }
+ }
+ return;
+ case act_field:
+ if (T->data) {
+ tl_buf_add_string_q ((char *)T->data, -1, x);
+ x = 0;
+ tl_buf_add_string_q (":", -1, 0);
+ }
+ tl_buf_add_tree (T->left, x);
+ tl_buf_add_tree (T->right, 1);
+ return;
+ case act_union:
+ tl_buf_add_tree (T->left, x);
+ tl_buf_add_tree (T->right, 1);
+ return;
+ case act_var:
+ {
+ if (T->data == (void *)-1l) { return; }
+ struct tl_combinator_tree *v = T->data;
+ tl_buf_add_string_q ((char *)v->data, -1, x);
+ if (T->type == type_num && T->type_flags) {
+ static char _buf[30];
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ sprintf_s(_buf, 30, "+%"_PRINTF_INT64_"d", T->type_flags);
+#else
+ sprintf(_buf, "+%"_PRINTF_INT64_"d", T->type_flags);
+#endif
+ tl_buf_add_string_q (_buf, -1, 0);
+ }
+ }
+ return;
+ case act_arg:
+ tl_buf_add_tree (T->left, x);
+ tl_buf_add_tree (T->right, 1);
+ return;
+ case act_array:
+ if (T->left && !(T->left->flags & 128)) {
+ tl_buf_add_tree (T->left, x);
+ x = 0;
+ tl_buf_add_string_q ("*", -1, x);
+ }
+ tl_buf_add_string_q ("[", -1, x);
+ tl_buf_add_tree (T->right, 1);
+ tl_buf_add_string_q ("]", -1, 1);
+ return;
+ case act_plus:
+ tl_buf_add_tree (T->left, x);
+ tl_buf_add_string_q ("+", -1, 0);
+ tl_buf_add_tree (T->right, 0);
+ return;
+ case act_nat_const:
+ {
+ static char _buf[30];
+ snprintf (_buf, 29, "%"_PRINTF_INT64_"d", T->type_flags);
+ tl_buf_add_string_q (_buf, -1, x);
+ return;
+ }
+ case act_opt_field:
+ {
+ struct tl_combinator_tree *v = T->left->data;
+ tl_buf_add_string_q ((char *)v->data, -1, x);
+ tl_buf_add_string_q (".", -1, 0);
+ static char _buf[30];
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ sprintf_s(_buf, 30, "%"_PRINTF_INT64_"d", T->left->type_flags);
+#else
+ sprintf(_buf, "%"_PRINTF_INT64_"d", T->left->type_flags);
+#endif
+ tl_buf_add_string_q (_buf, -1, 0);
+ tl_buf_add_string_q ("?", -1, 0);
+ tl_buf_add_tree (T->right, 0);
+ return;
+ }
+
+ default:
+ fprintf (stderr, "%s %s\n", TL_ACT (T->act), TL_TYPE (T->type));
+ assert (0);
+ return;
+ }
+}
+
+int tl_count_combinator_name (struct tl_constructor *c) {
+ assert (c);
+ tl_buf_reset ();
+ tl_buf_add_string_nospace (c->real_id ? c->real_id : c->id, -1);
+ tl_buf_add_tree (c->left, 1);
+ tl_buf_add_string ("=", -1);
+ tl_buf_add_tree (c->right, 1);
+ //fprintf (stderr, "%.*s\n", buf_pos, buf);
+ if (!c->name) {
+ c->name = crc32 (CRC32_INITIAL, (void *) buf, buf_pos);
+ }
+ return c->name;
+}
+
+int tl_print_combinator (struct tl_constructor *c) {
+ tl_buf_reset ();
+ tl_buf_add_string_nospace (c->real_id ? c->real_id : c->id, -1);
+ static char _buf[10];
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ sprintf_s(_buf, 10, "#%08x", c->name);
+#else
+ sprintf(_buf, "#%08x", c->name);
+#endif
+ tl_buf_add_string_nospace (_buf, -1);
+ tl_buf_add_tree (c->left, 1);
+ tl_buf_add_string ("=", -1);
+ tl_buf_add_tree (c->right, 1);
+ if (output_expressions >= 1) {
+ fprintf (stderr, "%.*s\n", buf_pos, buf);
+ }
+/* if (!c->name) {
+ c->name = crc32 (CRC32_INITIAL, (void *) bbuf, buf_pos);
+ }*/
+ return c->name;
+}
+
+int _tl_finish_subtree (struct tl_combinator_tree *R, int x, long long y) {
+ assert (R->type == type_type);
+ assert (R->type_len < 0);
+ assert (R->act == act_arg || R->act == act_type);
+ R->type_len = x;
+ R->type_flags = y;
+ if (R->act == act_type) {
+ struct tl_type *t = R->data;
+ assert (t);
+ return tl_type_set_params (t, x, y);
+ }
+ assert ((R->right->type == type_type && R->right->type_len == 0) || R->right->type == type_num || R->right->type == type_num_value);
+ return _tl_finish_subtree (R->left, x + 1, y * 2 + (R->right->type == type_num || R->right->type == type_num_value));
+}
+
+int tl_finish_subtree (struct tl_combinator_tree *R) {
+ assert (R);
+ if (R->type != type_type) {
+ return 1;
+ }
+ if (R->type_len >= 0) {
+ if (R->type_len > 0) {
+ TL_ERROR ("Not enough params\n");
+ return 0;
+ }
+ return 1;
+ }
+ return _tl_finish_subtree (R, 0, 0);
+}
+
+struct tl_combinator_tree *tl_union (struct tl_combinator_tree *L, struct tl_combinator_tree *R) {
+ if (!L) { return R; }
+ if (!R) { return L; }
+ TL_INIT (v);
+ v = alloc_ctree_node ();
+ v->left = L;
+ v->right = R;
+ switch (L->type) {
+ case type_num:
+ if (R->type != type_num_value) {
+ TL_ERROR ("Union: type mistmatch\n");
+ return 0;
+ }
+ tfree (v, sizeof (*v));
+ L->type_flags += R->type_flags;
+ return L;
+ case type_num_value:
+ if (R->type != type_num_value && R->type != type_num) {
+ TL_ERROR ("Union: type mistmatch\n");
+ return 0;
+ }
+ tfree (v, sizeof (*v));
+ R->type_flags += L->type_flags;
+ return R;
+ case type_list_item:
+ case type_list:
+ if (R->type != type_list_item) {
+ TL_ERROR ("Union: type mistmatch\n");
+ return 0;
+ }
+ v->type = type_list;
+ v->act = act_union;
+ return v;
+ case type_type:
+ if (L->type_len == 0) {
+ TL_ERROR ("Arguments number exceeds type arity\n");
+ return 0;
+ }
+ if (R->type != type_num && R->type != type_type && R->type != type_num_value) {
+ TL_ERROR ("Union: type mistmatch\n");
+ return 0;
+ }
+ if (R->type_len < 0) {
+ if (!tl_finish_subtree (R)) {
+ return 0;
+ }
+ }
+ if (R->type_len > 0) {
+ TL_ERROR ("Argument type must have full number of arguments\n");
+ return 0;
+ }
+ if (L->type_len > 0 && ((L->type_flags & 1) != (R->type == type_num || R->type == type_num_value))) {
+ TL_ERROR ("Argument types mistmatch: L->type_flags = %"_PRINTF_INT64_"d, R->type = %s\n", L->flags, TL_TYPE (R->type));
+ return 0;
+ }
+ v->type = type_type;
+ v->act = act_arg;
+ v->type_len = L->type_len > 0 ? L->type_len - 1 : -1;
+ v->type_flags = L->type_flags >> 1;
+ return v;
+ default:
+ assert (0);
+ return 0;
+ }
+}
+
+struct tl_combinator_tree *tl_parse_any_term (struct tree *T, int s);
+struct tl_combinator_tree *tl_parse_term (struct tree *T, int s) {
+ assert (T->type == type_term);
+ int i = 0;
+ while (i < T->nc && T->c[i]->type == type_percent) { i ++; s ++; }
+ assert (i < T->nc);
+ TL_INIT (L);
+ while (i < T->nc) {
+ TL_TRY (tl_parse_any_term (T->c[i], s), L);
+ s = 0;
+ i ++;
+ }
+ return L;
+}
+
+
+struct tl_combinator_tree *tl_parse_type_term (struct tree *T, int s) {
+ assert (T->type == type_type_term);
+ assert (T->nc == 1);
+ struct tl_combinator_tree *Z = tl_parse_term (T->c[0], s);
+ if (!Z || Z->type != type_type) { if (Z) { TL_ERROR ("type_term: found type %s\n", TL_TYPE (Z->type)); } TL_FAIL; }
+ return Z;
+}
+
+struct tl_combinator_tree *tl_parse_nat_term (struct tree *T, int s) {
+ assert (T->type == type_nat_term);
+ assert (T->nc == 1);
+ struct tl_combinator_tree *Z = tl_parse_term (T->c[0], s);
+ if (!Z || (Z->type != type_num && Z->type != type_num_value)) { if (Z) { TL_ERROR ("nat_term: found type %s\n", TL_TYPE (Z->type)); }TL_FAIL; }
+ return Z;
+}
+
+struct tl_combinator_tree *tl_parse_subexpr (struct tree *T, int s) {
+ assert (T->type == type_subexpr);
+ assert (T->nc >= 1);
+ int i;
+ TL_INIT (L);
+ for (i = 0; i < T->nc; i++) {
+ TL_TRY (tl_parse_any_term (T->c[i], s), L);
+ s = 0;
+ }
+ return L;
+}
+
+struct tl_combinator_tree *tl_parse_expr (struct tree *T, int s) {
+ assert (T->type == type_expr);
+ assert (T->nc >= 1);
+ int i;
+ TL_INIT (L);
+ for (i = 0; i < T->nc; i++) {
+ TL_TRY (tl_parse_subexpr (T->c[i], s), L);
+ s = 0;
+ }
+ return L;
+}
+
+struct tl_combinator_tree *tl_parse_nat_const (struct tree *T, int s) {
+ assert (T->type == type_nat_const);
+ assert (!T->nc);
+ if (s > 0) {
+ TL_ERROR ("Nat const can not preceed with %%\n");
+ TL_FAIL;
+ }
+ assert (T->type == type_nat_const);
+ assert (!T->nc);
+ TL_INIT (L);
+ L = alloc_ctree_node ();
+ L->act = act_nat_const;
+ L->type = type_num_value;
+ int i;
+ long long x = 0;
+ for (i = 0; i < T->len; i++) {
+ x = x * 10 + T->text[i] - '0';
+ }
+ L->type_flags = x;
+ return L;
+}
+
+struct tl_combinator_tree *tl_parse_ident (struct tree *T, int s) {
+ assert (T->type == type_type_ident || T->type == type_var_ident || T->type == type_boxed_type_ident);
+ assert (!T->nc);
+ struct tl_var *v = tl_get_var (T->text, T->len);
+ TL_INIT (L);
+ if (v) {
+ L = alloc_ctree_node ();
+ L->act = act_var;
+ L->type = v->type ? type_num : type_type;
+ if (L->type == type_num && s) {
+ TL_ERROR ("Nat var can not preceed with %%\n");
+ TL_FAIL;
+ } else {
+ if (s) {
+ L->flags |= 1;
+ }
+ }
+ L->type_len = 0;
+ L->type_flags = 0;
+ L->data = v->ptr;
+ return L;
+ }
+
+/* if (!mystrcmp2 (T->text, T->len, "#") || !mystrcmp2 (T->text, T->len, "Type")) {
+ L = alloc_ctree_node ();
+ L->act = act_type;
+ L->flags |= 2;
+ L->data = tl_get_type (T->text, T->len);
+ assert (L->data);
+ L->type = type_type;
+ L->type_len = 0;
+ L->type_flags = 0;
+ return L;
+ }*/
+
+ struct tl_constructor *c = tl_get_constructor (T->text, T->len);
+ if (c) {
+ assert (c->type);
+ if (c->type->constructors_num != 1) {
+ TL_ERROR ("Constructor can be used only if it is the only constructor of the type\n");
+ return 0;
+ }
+ c->type->flags |= 1;
+ L = alloc_ctree_node ();
+ L->act = act_type;
+ L->flags |= 5;
+ L->data = c->type;
+ L->type = type_type;
+ L->type_len = c->type->params_num;
+ L->type_flags = c->type->params_types;
+ return L;
+ }
+ int x = tl_is_type_name (T->text, T->len);
+ if (x) {
+ struct tl_type *t = tl_add_type (T->text, T->len, -1, 0);
+ L = alloc_ctree_node ();
+ if (s) {
+ L->flags |= 1;
+ t->flags |= 8;
+ }
+ L->act = act_type;
+ L->data = t;
+ L->type = type_type;
+ L->type_len = t->params_num;
+ L->type_flags = t->params_types;
+ return L;
+ } else {
+ TL_ERROR ("Not a type/var ident `%.*s`\n", T->len, T->text);
+ return 0;
+ }
+}
+
+struct tl_combinator_tree *tl_parse_any_term (struct tree *T, int s) {
+ switch (T->type) {
+ case type_type_term:
+ return tl_parse_type_term (T, s);
+ case type_nat_term:
+ return tl_parse_nat_term (T, s);
+ case type_term:
+ return tl_parse_term (T, s);
+ case type_expr:
+ return tl_parse_expr (T, s);
+ case type_subexpr:
+ return tl_parse_subexpr (T, s);
+ case type_nat_const:
+ return tl_parse_nat_const (T, s);
+ case type_type_ident:
+ case type_var_ident:
+ return tl_parse_ident (T, s);
+ default:
+ fprintf (stderr, "type = %d\n", T->type);
+ assert (0);
+ return 0;
+ }
+}
+
+struct tl_combinator_tree *tl_parse_multiplicity (struct tree *T) {
+ assert (T->type == type_multiplicity);
+ assert (T->nc == 1);
+ return tl_parse_nat_term (T->c[0], 0);
+}
+
+struct tl_combinator_tree *tl_parse_opt_args (struct tree *T) {
+ assert (T);
+ assert (T->type == type_opt_args);
+ assert (T->nc >= 2);
+ TL_INIT (R);
+ TL_TRY (tl_parse_type_term (T->c[T->nc - 1], 0), R);
+ assert (R->type == type_type && !R->type_len);
+ assert (tl_finish_subtree (R));
+ struct tl_type *t = tl_tree_get_type (R);
+ //assert (t);
+ int tt = -1;
+ if (t && !strcmp (t->id, "#")) {
+ tt = 1;
+ } else if (t && !strcmp (t->id, "Type")) {
+ tt = 0;
+ }
+ if (tt < 0) {
+ TL_ERROR ("Optargs can be only of type # or Type\n");
+ TL_FAIL;
+ }
+
+ int i;
+ for (i = 0; i < T->nc - 1; i++) {
+ if (T->c[i]->type != type_var_ident) {
+ TL_ERROR ("Variable name expected\n");
+ TL_FAIL;
+ }
+ if (T->c[i]->len == 1 && *T->c[i]->text == '_') {
+ TL_ERROR ("Variables can not be unnamed\n");
+ TL_FAIL;
+ }
+ }
+ TL_INIT (H);
+// for (i = T->nc - 2; i >= (T->nc >= 2 ? 0 : -1); i--) {
+ for (i = 0; i <= T->nc - 2; i++) {
+ TL_INIT (S); S = alloc_ctree_node ();
+ S->left = (i == T->nc - 2) ? R : tl_tree_dup (R) ; S->right = 0;
+ S->type = type_list_item;
+ S->type_len = 0;
+ S->act = act_field;
+ S->data = i >= 0 ? mystrdup (T->c[i]->text, T->c[i]->len) : 0;
+ if (tt >= 0) {
+ assert (S->data);
+ tl_add_var (S->data, S, tt);
+ }
+ S->flags = 33;
+ H = tl_union (H, S);
+ }
+ return H;
+}
+
+struct tl_combinator_tree *tl_parse_args (struct tree *T);
+struct tl_combinator_tree *tl_parse_args2 (struct tree *T) {
+ assert (T);
+ assert (T->type == type_args2);
+ assert (T->nc >= 1);
+ TL_INIT (R);
+ TL_INIT (L);
+ int x = 0;
+ char *field_name = 0;
+ if (T->c[x]->type == type_var_ident_opt || T->c[x]->type == type_var_ident) {
+ field_name = mystrdup (T->c[x]->text, T->c[x]->len);
+ if (!tl_add_field (field_name)) {
+ TL_ERROR ("Duplicate field name %s\n", field_name);
+ TL_FAIL;
+ }
+ x ++;
+ }
+ //fprintf (stderr, "%d %d\n", x, T->nc);
+ if (T->c[x]->type == type_multiplicity) {
+ L = tl_parse_multiplicity (T->c[x]);
+ if (!L) { TL_FAIL;}
+ x ++;
+ } else {
+ struct tl_var *v = tl_get_last_num_var ();
+ if (!v) {
+ TL_ERROR ("Expected multiplicity or nat var\n");
+ TL_FAIL;
+ }
+ L = alloc_ctree_node ();
+ L->act = act_var;
+ L->type = type_num;
+ L->flags |= 128;
+ L->type_len = 0;
+ L->type_flags = 0;
+ L->data = v->ptr;
+ ((struct tl_combinator_tree *)(v->ptr))->flags |= 256;
+ }
+ namespace_push ();
+ while (x < T->nc) {
+ TL_TRY (tl_parse_args (T->c[x]), R);
+ x ++;
+ }
+ namespace_pop ();
+ struct tl_combinator_tree *S = alloc_ctree_node ();
+ S->type = type_type;
+ S->type_len = 0;
+ S->act = act_array;
+ S->left = L;
+ S->right = R;
+ //S->data = field_name;
+
+ struct tl_combinator_tree *H = alloc_ctree_node ();
+ H->type = type_list_item;
+ H->act = act_field;
+ H->left = S;
+ H->right = 0;
+ H->data = field_name;
+ H->type_len = 0;
+
+ return H;
+}
+
+void tl_mark_vars (struct tl_combinator_tree *T);
+struct tl_combinator_tree *tl_parse_args134 (struct tree *T) {
+ assert (T);
+ assert (T->type == type_args1 || T->type == type_args3 || T->type == type_args4);
+ assert (T->nc >= 1);
+ TL_INIT (R);
+ TL_TRY (tl_parse_type_term (T->c[T->nc - 1], 0), R);
+ assert (tl_finish_subtree (R));
+ assert (R->type == type_type && !R->type_len);
+ struct tl_type *t = tl_tree_get_type (R);
+ //assert (t);
+ int tt = -1;
+ if (t && !strcmp (t->id, "#")) {
+ tt = 1;
+ } else if (t && !strcmp (t->id, "Type")) {
+ tt = 0;
+ }
+
+/* if (tt >= 0 && T->nc == 1) {
+ TL_ERROR ("Variables can not be unnamed (type %d)\n", tt);
+ }*/
+ int last = T->nc - 2;
+ int excl = 0;
+ if (last >= 0 && T->c[last]->type == type_exclam) {
+ excl ++;
+ tl_mark_vars (R);
+ last --;
+ }
+ if (last >= 0 && T->c[last]->type == type_optional_arg_def) {
+ assert (T->c[last]->nc == 2);
+ TL_INIT (E); E = alloc_ctree_node ();
+ E->type = type_type;
+ E->act = act_opt_field;
+ E->left = tl_parse_ident (T->c[last]->c[0], 0);
+ int i;
+ long long x = 0;
+ for (i = 0; i < T->c[last]->c[1]->len; i++) {
+ x = x * 10 + T->c[last]->c[1]->text[i] - '0';
+ }
+ E->left->type_flags = x;
+ E->type_flags = R->type_flags;
+ E->type_len = R->type_len;
+ E->right = R;
+ R = E;
+ last --;
+ }
+ int i;
+ for (i = 0; i < last; i++) {
+ if (T->c[i]->type != type_var_ident && T->c[i]->type != type_var_ident_opt) {
+ TL_ERROR ("Variable name expected\n");
+ TL_FAIL;
+ }
+/* if (tt >= 0 && (T->nc == 1 || (T->c[i]->len == 1 && *T->c[i]->text == '_'))) {
+ TL_ERROR ("Variables can not be unnamed\n");
+ TL_FAIL;
+ }*/
+ }
+ TL_INIT (H);
+// for (i = T->nc - 2; i >= (T->nc >= 2 ? 0 : -1); i--) {
+ for (i = (last >= 0 ? 0 : -1); i <= last; i++) {
+ TL_INIT (S); S = alloc_ctree_node ();
+ S->left = (i == last) ? R : tl_tree_dup (R) ; S->right = 0;
+ S->type = type_list_item;
+ S->type_len = 0;
+ S->act = act_field;
+ S->data = i >= 0 ? mystrdup (T->c[i]->text, T->c[i]->len) : 0;
+ if (excl) {
+ S->flags |= FLAG_EXCL;
+ }
+ if (S->data && (T->c[i]->len >= 2 || *T->c[i]->text != '_')) {
+ if (!tl_add_field (S->data)) {
+ TL_ERROR ("Duplicate field name %s\n", (char *)S->data);
+ TL_FAIL;
+ }
+ }
+ if (tt >= 0) {
+ //assert (S->data);
+ char *name = S->data;
+ if (!name) {
+ static char s[20];
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ sprintf_s(s, 20, "%"_PRINTF_INT64_"d", lrand48() * (1ll << 32) + lrand48());
+#else
+ sprintf(s, "%"_PRINTF_INT64_"d", lrand48() * (1ll << 32) + lrand48());
+#endif
+ name = s;
+ }
+ struct tl_var *v = tl_add_var (name, S, tt);
+ if (!v) {TL_FAIL;}
+ v->flags |= 2;
+ }
+
+ H = tl_union (H, S);
+ }
+ return H;
+}
+
+
+struct tl_combinator_tree *tl_parse_args (struct tree *T) {
+ assert (T->type == type_args);
+ assert (T->nc == 1);
+ switch (T->c[0]->type) {
+ case type_args1:
+ return tl_parse_args134 (T->c[0]);
+ case type_args2:
+ return tl_parse_args2 (T->c[0]);
+ case type_args3:
+ return tl_parse_args134 (T->c[0]);
+ case type_args4:
+ return tl_parse_args134 (T->c[0]);
+ default:
+ assert (0);
+ return 0;
+ }
+}
+
+void tl_mark_vars (struct tl_combinator_tree *T) {
+ if (!T) { return; }
+ if (T->act == act_var) {
+ char *id = ((struct tl_combinator_tree *)(T->data))->data;
+ struct tl_var *v = tl_get_var (id, strlen (id));
+ assert (v);
+ v->flags |= 1;
+ }
+ tl_mark_vars (T->left);
+ tl_mark_vars (T->right);
+}
+
+struct tl_combinator_tree *tl_parse_result_type (struct tree *T) {
+ assert (T->type == type_result_type);
+ assert (T->nc >= 1);
+ assert (T->nc <= 64);
+
+ TL_INIT (L);
+
+ if (tl_get_var (T->c[0]->text, T->c[0]->len)) {
+ if (T->nc != 1) {
+ TL_ERROR ("Variable can not take params\n");
+ TL_FAIL;
+ }
+ L = alloc_ctree_node ();
+ L->act = act_var;
+ L->type = type_type;
+ struct tl_var *v = tl_get_var (T->c[0]->text, T->c[0]->len);
+ if (v->type) {
+ TL_ERROR ("Type mistmatch\n");
+ TL_FAIL;
+ }
+ L->data = v->ptr;
+// assert (v->ptr);
+ } else {
+ L = alloc_ctree_node ();
+ L->act = act_type;
+ L->type = type_type;
+ struct tl_type *t = tl_add_type (T->c[0]->text, T->c[0]->len, -1, 0);
+ assert (t);
+ L->type_len = t->params_num;
+ L->type_flags = t->params_types;
+ L->data = t;
+
+ int i;
+ for (i = 1; i < T->nc; i++) {
+ TL_TRY (tl_parse_any_term (T->c[i], 0), L);
+ assert (L->right);
+ assert (L->right->type == type_num || L->right->type == type_num_value || (L->right->type == type_type && L->right->type_len == 0));
+ }
+ }
+
+ if (!tl_finish_subtree (L)) {
+ TL_FAIL;
+ }
+
+ tl_mark_vars (L);
+ return L;
+}
+
+int __ok;
+void tl_var_check_used (struct tl_var *v) {
+ __ok = __ok && (v->flags & 3);
+}
+
+int tl_parse_combinator_decl (struct tree *T, int fun) {
+ assert (T->type == type_combinator_decl);
+ assert (T->nc >= 3);
+ namespace_level = 0;
+ tl_clear_vars ();
+ tl_clear_fields ();
+ TL_INIT (L);
+ TL_INIT (R);
+
+ int i = 1;
+ while (i < T->nc - 2 && T->c[i]->type == type_opt_args) {
+ TL_TRY (tl_parse_opt_args (T->c[i]), L);
+ i++;
+ }
+ while (i < T->nc - 2 && T->c[i]->type == type_args) {
+ TL_TRY (tl_parse_args (T->c[i]), L);
+ i++;
+ }
+ assert (i == T->nc - 2 && T->c[i]->type == type_equals);
+ i ++;
+
+ R = tl_parse_result_type (T->c[i]);
+ if (!R) { TL_FAIL; }
+
+ struct tl_type *t = tl_tree_get_type (R);
+ if (!fun && !t) {
+ TL_ERROR ("Only functions can return variables\n");
+ }
+ assert (t || fun);
+
+ assert (namespace_level == 0);
+ __ok = 1;
+ tree_act_tl_var (vars[0], tl_var_check_used);
+ if (!__ok) {
+ TL_ERROR ("Not all variables are used in right side\n");
+ TL_FAIL;
+ }
+
+ if (tl_get_constructor (T->c[0]->text, T->c[0]->len) || tl_get_function (T->c[0]->text, T->c[0]->len)) {
+ TL_ERROR ("Duplicate combinator id %.*s\n", T->c[0]->len, T->c[0]->text);
+ return 0;
+ }
+ struct tl_constructor *c = !fun ? tl_add_constructor (t, T->c[0]->text, T->c[0]->len, 0) : tl_add_function (t, T->c[0]->text, T->c[0]->len, 0);
+ if (!c) { TL_FAIL; }
+ c->left = L;
+ c->right = R;
+
+ if (!c->name) {
+ tl_count_combinator_name (c);
+ }
+ tl_print_combinator (c);
+
+ return 1;
+}
+
+void change_var_ptrs (struct tl_combinator_tree *O, struct tl_combinator_tree *D, struct tree_var_value **V) {
+ if (!O || !D) {
+ assert (!O && !D);
+ return;
+ }
+ if (O->act == act_field) {
+ struct tl_type *t = tl_tree_get_type (O->left);
+ if (t && (!strcmp (t->id, "#") || !strcmp (t->id, "Type"))) {
+ tl_set_var_value (V, O, D);
+ }
+ }
+ if (O->act == act_var) {
+ assert (D->data == O->data);
+ D->data = tl_get_var_value (V, O->data);
+ assert (D->data);
+ }
+ change_var_ptrs (O->left, D->left, V);
+ change_var_ptrs (O->right, D->right, V);
+}
+
+struct tl_combinator_tree *change_first_var (struct tl_combinator_tree *O, struct tl_combinator_tree **X, struct tl_combinator_tree *Y) {
+ if (!O) { return (void *)-2l; };
+ if (O->act == act_field && !*X) {
+ struct tl_type *t = tl_tree_get_type (O->left);
+ if (t && !strcmp (t->id, "#")) {
+ if (Y->type != type_num && Y->type != type_num_value) {
+ TL_ERROR ("change_var: Type mistmatch\n");
+ return 0;
+ } else {
+ *X = O;
+ return (void *)-1l;
+ }
+ }
+ if (t && !strcmp (t->id, "Type")) {
+ if (Y->type != type_type || Y->type_len != 0) {
+ TL_ERROR ("change_var: Type mistmatch\n");
+ return 0;
+ } else {
+ *X = O;
+ return (void *)-1l;
+ }
+ }
+ }
+ if (O->act == act_var) {
+ if (O->data == *X) {
+ struct tl_combinator_tree *R = tl_tree_dup (Y);
+ if (O->type == type_num || O->type == type_num_value) { R->type_flags += O->type_flags; }
+ return R;
+ }
+ }
+ struct tl_combinator_tree *t;
+ t = change_first_var (O->left, X, Y);
+ if (!t) { return 0;}
+ if (t == (void *)-1l) {
+ t = change_first_var (O->right, X, Y);
+ if (!t) { return 0;}
+ if (t == (void *)-1l) { return (void *)-1l; }
+ if (t != (void *)-2l) { return t;}
+ return (void *)-1l;
+ }
+ if (t != (void *)-2l) {
+ O->left = t;
+ }
+ t = change_first_var (O->right, X, Y);
+ if (!t) { return 0;}
+ if (t == (void *)-1l) {
+ return O->left;
+ }
+ if (t != (void *)-2l) {
+ O->right = t;
+ }
+ return O;
+}
+
+
+int uniformize (struct tl_combinator_tree *L, struct tl_combinator_tree *R, struct tree_var_value **T);
+struct tree_var_value **_T;
+int __tok;
+void check_nat_val (struct tl_var_value v) {
+ if (!__tok) { return; }
+ long long x = v.num_val;
+ struct tl_combinator_tree *L = v.val;
+ if (L->type == type_type) { return;}
+ while (1) {
+ if (L->type == type_num_value) {
+ if (x + L->type_flags < 0) {
+ __tok = 0;
+ return;
+ } else {
+ return;
+ }
+ }
+ assert (L->type == type_num);
+ x += L->type_flags;
+ x += tl_get_var_value_num (_T, L->data);
+ L = tl_get_var_value (_T, L->data);
+ if (!L) { return;}
+ }
+}
+
+int check_constructors_equal (struct tl_combinator_tree *L, struct tl_combinator_tree *R, struct tree_var_value **T) {
+ if (!uniformize (L, R, T)) { return 0; }
+ __tok = 1;
+ _T = T;
+ tree_act_var_value (*T, check_nat_val);
+ return __tok;
+}
+
+struct tl_combinator_tree *reduce_type (struct tl_combinator_tree *A, struct tl_type *t) {
+ assert (A);
+ if (A->type_len == t->params_num) {
+ assert (A->type_flags == t->params_types);
+ A->act = act_type;
+ A->type = type_type;
+ A->left = A->right = 0;
+ A->data = t;
+ return A;
+ }
+ A->left = reduce_type (A->left, t);
+ return A;
+}
+
+struct tl_combinator_tree *change_value_var (struct tl_combinator_tree *O, struct tree_var_value **X) {
+ if (!O) { return (void *)-2l; };
+ while (O->act == act_var) {
+ assert (O->data);
+ if (!tl_get_var_value (X, O->data)) {
+ break;
+ }
+ if (O->type == type_type) {
+ O = tl_tree_dup (tl_get_var_value (X, O->data));
+ } else {
+ long long n = tl_get_var_value_num (X, O->data);
+ struct tl_combinator_tree *T = tl_get_var_value (X, O->data);
+ O->data = T->data;
+ O->type = T->type;
+ O->act = T->act;
+ O->type_flags = O->type_flags + n + T->type_flags;
+ }
+ }
+ if (O->act == act_field) {
+ if (tl_get_var_value (X, O)) { return (void *)-1l; }
+ }
+ struct tl_combinator_tree *t;
+ t = change_value_var (O->left, X);
+ if (!t) { return 0;}
+ if (t == (void *)-1l) {
+ t = change_value_var (O->right, X);
+ if (!t) { return 0;}
+ if (t == (void *)-1l) { return (void *)-1l; }
+ if (t != (void *)-2l) { return t;}
+ return (void *)-1l;
+ }
+ if (t != (void *)-2l) {
+ O->left = t;
+ }
+ t = change_value_var (O->right, X);
+ if (!t) { return 0;}
+ if (t == (void *)-1l) {
+ return O->left;
+ }
+ if (t != (void *)-2l) {
+ O->right = t;
+ }
+ return O;
+}
+
+int tl_parse_partial_type_app_decl (struct tree *T) {
+ assert (T->type == type_partial_type_app_decl);
+ assert (T->nc >= 1);
+
+ assert (T->c[0]->type == type_boxed_type_ident);
+ struct tl_type *t = tl_get_type (T->c[0]->text, T->c[0]->len);
+ if (!t) {
+ TL_ERROR ("Can not make partial app for unknown type\n");
+ return 0;
+ }
+
+ tl_type_finalize (t);
+
+ struct tl_combinator_tree *L = tl_parse_ident (T->c[0], 0);
+ assert (L);
+ int i;
+ tl_buf_reset ();
+ int cc = T->nc - 1;
+ for (i = 1; i < T->nc; i++) {
+ TL_TRY (tl_parse_any_term (T->c[i], 0), L);
+ tl_buf_add_tree (L->right, 1);
+ }
+
+ while (L->type_len) {
+ struct tl_combinator_tree *C = alloc_ctree_node ();
+ C->act = act_var;
+ C->type = (L->type_flags & 1) ? type_num : type_type;
+ C->type_len = 0;
+ C->type_flags = 0;
+ C->data = (void *)-1l;
+ L = tl_union (L, C);
+ if (!L) { return 0; }
+ }
+
+
+ static char _buf[100000];
+ snprintf (_buf, 100000, "%s%.*s", t->id, buf_pos, buf);
+ struct tl_type *nt = tl_add_type (_buf, strlen (_buf), t->params_num - cc, t->params_types >> cc);
+ assert (nt);
+ //snprintf (_buf, 100000, "%s #", t->id);
+ //nt->real_id = strdup (_buf);
+
+ for (i = 0; i < t->constructors_num; i++) {
+ struct tl_constructor *c = t->constructors[i];
+ struct tree_var_value *V = 0;
+ TL_INIT (A);
+ TL_INIT (B);
+ A = tl_tree_dup (c->left);
+ B = tl_tree_dup (c->right);
+
+ struct tree_var_value *W = 0;
+ change_var_ptrs (c->left, A, &W);
+ change_var_ptrs (c->right, B, &W);
+
+
+ if (!check_constructors_equal (B, L, &V)) { continue; }
+ B = reduce_type (B, nt);
+ A = change_value_var (A, &V);
+ if (A == (void *)-1l) { A = 0;}
+ B = change_value_var (B, &V);
+ assert (B != (void *)-1l);
+ snprintf (_buf, 100000, "%s%.*s", c->id, buf_pos, buf);
+
+ struct tl_constructor *r = tl_add_constructor (nt, _buf, strlen (_buf), 1);
+ snprintf (_buf, 100000, "%s", c->id);
+ r->real_id = tstrdup (_buf);
+
+ r->left = A;
+ r->right = B;
+ if (!r->name) {
+ tl_count_combinator_name (r);
+ }
+ tl_print_combinator (r);
+ }
+
+ return 1;
+}
+
+int tl_parse_partial_comb_app_decl (struct tree *T, int fun) {
+ assert (T->type == type_partial_comb_app_decl);
+
+ struct tl_constructor *c = !fun ? tl_get_constructor (T->c[0]->text, T->c[0]->len) : tl_get_function (T->c[0]->text, T->c[0]->len);
+ if (!c) {
+ TL_ERROR ("Can not make partial app for undefined combinator\n");
+ return 0;
+ }
+
+ //TL_INIT (K);
+ //static char buf[1000];
+ //int x = sprintf (buf, "%s", c->id);
+ TL_INIT (L);
+ TL_INIT (R);
+ L = tl_tree_dup (c->left);
+ R = tl_tree_dup (c->right);
+
+
+ struct tree_var_value *V = 0;
+ change_var_ptrs (c->left, L, &V);
+ change_var_ptrs (c->right, R, &V);
+ V = tree_clear_var_value (V);
+
+ int i;
+ tl_buf_reset ();
+ for (i = 1; i < T->nc; i++) {
+ TL_INIT (X);
+ TL_INIT (Z);
+ X = tl_parse_any_term (T->c[i], 0);
+ struct tl_combinator_tree *K = 0;
+ if (!(Z = change_first_var (L, &K, X))) {
+ TL_FAIL;
+ }
+ L = Z;
+ if (!K) {
+ TL_ERROR ("Partial app: not enougth variables (i = %d)\n", i);
+ TL_FAIL;
+ }
+ if (!(Z = change_first_var (R, &K, X))) {
+ TL_FAIL;
+ }
+ assert (Z == R);
+ tl_buf_add_tree (X, 1);
+ }
+
+ static char _buf[100000];
+ snprintf (_buf, 100000, "%s%.*s", c->id, buf_pos, buf);
+// fprintf (stderr, "Local id: %s\n", _buf);
+
+ struct tl_constructor *r = !fun ? tl_add_constructor (c->type, _buf, strlen (_buf), 1) : tl_add_function (c->type, _buf, strlen (_buf), 1);
+ r->left = L;
+ r->right = R;
+ snprintf (_buf, 100000, "%s", c->id);
+ r->real_id = tstrdup (_buf);
+ if (!r->name) {
+ tl_count_combinator_name (r);
+ }
+ tl_print_combinator (r);
+ return 1;
+}
+
+
+int tl_parse_partial_app_decl (struct tree *T, int fun) {
+ assert (T->type == type_partial_app_decl);
+ assert (T->nc == 1);
+ if (T->c[0]->type == type_partial_comb_app_decl) {
+ return tl_parse_partial_comb_app_decl (T->c[0], fun);
+ } else {
+ if (fun) {
+ TL_ERROR ("Partial type app in functions block\n");
+ TL_FAIL;
+ }
+ return tl_parse_partial_type_app_decl (T->c[0]);
+ }
+}
+
+int tl_parse_final_final (struct tree *T) {
+ assert (T->type == type_final_final);
+ assert (T->nc == 1);
+ struct tl_type *R;
+ if ((R = tl_get_type (T->c[0]->text, T->c[0]->len))) {
+ R->flags |= 1;
+ return 1;
+ } else {
+ TL_ERROR ("Final statement for type `%.*s` before declaration\n", T->c[0]->len, T->c[0]->text);
+ TL_FAIL;
+ }
+}
+
+int tl_parse_final_new (struct tree *T) {
+ assert (T->type == type_final_new);
+ assert (T->nc == 1);
+ if (tl_get_type (T->c[0]->text, T->c[0]->len)) {
+ TL_ERROR ("New statement: type `%.*s` already declared\n", T->c[0]->len, T->c[0]->text);
+ TL_FAIL;
+ } else {
+ return 1;
+ }
+}
+
+int tl_parse_final_empty (struct tree *T) {
+ assert (T->type == type_final_empty);
+ assert (T->nc == 1);
+ if (tl_get_type (T->c[0]->text, T->c[0]->len)) {
+ TL_ERROR ("New statement: type `%.*s` already declared\n", T->c[0]->len, T->c[0]->text);
+ TL_FAIL;
+ }
+ struct tl_type *t = tl_add_type (T->c[0]->text, T->c[0]->len, 0, 0);
+ assert (t);
+ t->flags |= 1 | FLAG_EMPTY;
+ return 1;
+}
+
+int tl_parse_final_decl (struct tree *T, int fun) {
+ assert (T->type == type_final_decl);
+ assert (!fun);
+ assert (T->nc == 1);
+ switch (T->c[0]->type) {
+ case type_final_new:
+ return tl_parse_final_new (T->c[0]);
+ case type_final_final:
+ return tl_parse_final_final (T->c[0]);
+ case type_final_empty:
+ return tl_parse_final_empty (T->c[0]);
+ default:
+ assert (0);
+ return 0;
+ }
+}
+
+int tl_parse_builtin_combinator_decl (struct tree *T, int fun) {
+ if (fun) {
+ TL_ERROR ("Builtin type can not be described in function block\n");
+ return -1;
+ }
+ assert (T->type == type_builtin_combinator_decl);
+ assert (T->nc == 2);
+ assert (T->c[0]->type == type_full_combinator_id);
+ assert (T->c[1]->type == type_boxed_type_ident);
+
+
+ if ((!mystrcmp2 (T->c[0]->text, T->c[0]->len, "int") && !mystrcmp2 (T->c[1]->text, T->c[1]->len, "Int")) ||
+ (!mystrcmp2 (T->c[0]->text, T->c[0]->len, "long") && !mystrcmp2 (T->c[1]->text, T->c[1]->len, "Long")) ||
+ (!mystrcmp2 (T->c[0]->text, T->c[0]->len, "double") && !mystrcmp2 (T->c[1]->text, T->c[1]->len, "Double")) ||
+ (!mystrcmp2 (T->c[0]->text, T->c[0]->len, "string") && !mystrcmp2 (T->c[1]->text, T->c[1]->len, "String"))) {
+ struct tl_type *t = tl_add_type (T->c[1]->text, T->c[1]->len, 0, 0);
+ if (!t) {
+ return 0;
+ }
+ struct tl_constructor *c = tl_add_constructor (t, T->c[0]->text, T->c[0]->len, 0);
+ if (!c) {
+ return 0;
+ }
+
+ c->left = alloc_ctree_node ();
+ c->left->act = act_question_mark;
+ c->left->type = type_list_item;
+
+ c->right = alloc_ctree_node ();
+ c->right->act = act_type;
+ c->right->data = t;
+ c->right->type = type_type;
+
+ if (!c->name) {
+ tl_count_combinator_name (c);
+ }
+ tl_print_combinator (c);
+ } else {
+ TL_ERROR ("Unknown builting type `%.*s`\n", T->c[0]->len, T->c[0]->text);
+ return 0;
+ }
+
+ return 1;
+}
+
+int tl_parse_declaration (struct tree *T, int fun) {
+ assert (T->type == type_declaration);
+ assert (T->nc == 1);
+ switch (T->c[0]->type) {
+ case type_combinator_decl:
+ return tl_parse_combinator_decl (T->c[0], fun);
+ case type_partial_app_decl:
+ return tl_parse_partial_app_decl (T->c[0], fun);
+ case type_final_decl:
+ return tl_parse_final_decl (T->c[0], fun);
+ case type_builtin_combinator_decl:
+ return tl_parse_builtin_combinator_decl (T->c[0], fun);
+ default:
+ assert (0);
+ return 0;
+ }
+}
+
+int tl_parse_constr_declarations (struct tree *T) {
+ assert (T->type == type_constr_declarations);
+ int i;
+ for (i = 0; i < T->nc; i++) {
+ TL_TRY_PES (tl_parse_declaration (T->c[i], 0));
+ }
+ return 1;
+}
+
+int tl_parse_fun_declarations (struct tree *T) {
+ assert (T->type == type_fun_declarations);
+ int i;
+ for (i = 0; i < T->nc; i++) {
+ TL_TRY_PES (tl_parse_declaration (T->c[i], 1));
+ }
+ return 1;
+}
+
+int tl_tree_lookup_value (struct tl_combinator_tree *L, void *var, struct tree_var_value **T) {
+ if (!L) {
+ return -1;
+ }
+ if (L->act == act_var && L->data == var) {
+ return 0;
+ }
+ if (L->act == act_var) {
+ struct tl_combinator_tree *E = tl_get_var_value (T, L->data);
+ if (!E) { return -1;}
+ else { return tl_tree_lookup_value (E, var, T); }
+ }
+ if (tl_tree_lookup_value (L->left, var, T) >= 0) { return 1; }
+ if (tl_tree_lookup_value (L->right, var, T) >= 0) { return 1; }
+ return -1;
+}
+
+int tl_tree_lookup_value_nat (struct tl_combinator_tree *L, void *var, long long x, struct tree_var_value **T) {
+ assert (L);
+ if (L->type == type_num_value) { return -1; }
+ assert (L->type == type_num);
+ assert (L->act == act_var);
+ if (L->data == var) {
+ return x == L->type_flags ? 0 : 1;
+ } else {
+ if (!tl_get_var_value (T, L->data)) {
+ return -1;
+ }
+ return tl_tree_lookup_value_nat (tl_get_var_value (T, L->data), var, x + tl_get_var_value_num (T, L->data), T);
+ }
+
+}
+
+int uniformize (struct tl_combinator_tree *L, struct tl_combinator_tree *R, struct tree_var_value **T) {
+ if (!L || !R) {
+ assert (!L && !R);
+ return 1;
+ }
+ if (R->act == act_var) {
+ struct tl_combinator_tree *_ = R; R = L; L = _;
+ }
+
+ if (L->type == type_type) {
+ if (R->type != type_type || L->type_len != R->type_len || L->type_flags != R->type_flags) {
+ return 0;
+ }
+ if (R->data == (void *)-1l || L->data == (void *)-1l) { return 1;}
+ if (L->act == act_var) {
+ int x = tl_tree_lookup_value (R, L->data, T);
+ if (x > 0) {
+// if (tl_tree_lookup_value (R, L->data, T) > 0) {
+ return 0;
+ }
+ if (x == 0) {
+ return 1;
+ }
+ struct tl_combinator_tree *E = tl_get_var_value (T, L->data);
+ if (!E) {
+ tl_set_var_value (T, L->data, R);
+ return 1;
+ } else {
+ return uniformize (E, R, T);
+ }
+ } else {
+ if (L->act != R->act || L->data != R->data) {
+ return 0;
+ }
+ return uniformize (L->left, R->left, T) && uniformize (L->right, R->right, T);
+ }
+ } else {
+ assert (L->type == type_num || L->type == type_num_value);
+ if (R->type != type_num && R->type != type_num_value) {
+ return 0;
+ }
+ assert (R->type == type_num || R->type == type_num_value);
+ if (R->data == (void *)-1l || L->data == (void *)-1l) { return 1;}
+ long long x = 0;
+ struct tl_combinator_tree *K = L;
+ while (1) {
+ x += K->type_flags;
+ if (K->type == type_num_value) {
+ break;
+ }
+ if (!tl_get_var_value (T, K->data)) {
+ int s = tl_tree_lookup_value_nat (R, K->data, K->type_flags, T);
+ if (s > 0) {
+ return 0;
+ }
+ if (s == 0) {
+ return 1;
+ }
+ /*tl_set_var_value_num (T, K->data, R, -x);
+ return 1;*/
+ break;
+ }
+ x += tl_get_var_value_num (T, K->data);
+ K = tl_get_var_value (T, K->data);
+ }
+ long long y = 0;
+ struct tl_combinator_tree *M = R;
+ while (1) {
+ y += M->type_flags;
+ if (M->type == type_num_value) {
+ break;
+ }
+ if (!tl_get_var_value (T, M->data)) {
+ int s = tl_tree_lookup_value_nat (L, M->data, M->type_flags, T);
+ if (s > 0) {
+ return 0;
+ }
+ if (s == 0) {
+ return 1;
+ }
+ /*tl_set_var_value_num (T, M->data, L, -y);
+ return 1;*/
+ break;
+ }
+ y += tl_get_var_value_num (T, M->data);
+ M = tl_get_var_value (T, M->data);
+ }
+ if (K->type == type_num_value && M->type == type_num_value) {
+ return x == y;
+ }
+ if (M->type == type_num_value) {
+ tl_set_var_value_num (T, K->data, M, -(x - y + M->type_flags));
+ return 1;
+ } else if (K->type == type_num_value) {
+ tl_set_var_value_num (T, M->data, K, -(y - x + K->type_flags));
+ return 1;
+ } else {
+ if (x >= y) {
+ tl_set_var_value_num (T, K->data, M, -(x - y + M->type_flags));
+ } else {
+ tl_set_var_value_num (T, M->data, K, -(y - x + K->type_flags));
+ }
+ return 1;
+ }
+ }
+ return 0;
+}
+
+
+void tl_type_check (struct tl_type *t) {
+ if (!__ok) return;
+ if (!strcmp (t->id, "#")) { t->name = 0x70659eff; return; }
+ if (!strcmp (t->id, "Type")) { t->name = 0x2cecf817; return; }
+ if (t->constructors_num <= 0 && !(t->flags & FLAG_EMPTY)) {
+ TL_ERROR ("Type %s has no constructors\n", t->id);
+ __ok = 0;
+ return;
+ }
+ int i, j;
+ t->name = 0;
+ for (i = 0; i < t->constructors_num; i++) {
+ t->name ^= t->constructors[i]->name;
+ }
+ for (i = 0; i < t->constructors_num; i++) {
+ for (j = i + 1; j < t->constructors_num; j++) {
+ struct tree_var_value *v = 0;
+ if (check_constructors_equal (t->constructors[i]->right, t->constructors[j]->right, &v)) {
+ t->flags |= 16;
+ }
+ }
+ }
+ if ((t->flags & 24) == 24) {
+ TL_WARNING ("Warning: Type %s has overlapping costructors, but it is used with `%%`\n", t->id);
+ }
+ int z = 0;
+ int sid = 0;
+ for (i = 0; i < t->constructors_num; i++) if (*t->constructors[i]->id == '_') {
+ z ++;
+ sid = i;
+ }
+ if (z > 1) {
+ TL_ERROR ("Type %s has %d default constructors\n", t->id, z);
+ __ok = 0;
+ return;
+ }
+ if (z == 1 && (t->flags & 8)) {
+ TL_ERROR ("Type %s has default constructors and used bare\n", t->id);
+ __ok = 0;
+ return;
+ }
+ if (z) {
+ struct tl_constructor *c;
+ c = t->constructors[sid];
+ t->constructors[sid] = t->constructors[t->constructors_num - 1];
+ t->constructors[t->constructors_num - 1] = c;
+ }
+}
+
+struct tl_program *tl_parse (struct tree *T) {
+ assert (T);
+ assert (T->type == type_tl_program);
+ int i;
+ tl_program_cur = talloc (sizeof (*tl_program_cur));
+ tl_add_type ("#", 1, 0, 0);
+ tl_add_type ("Type", 4, 0, 0);
+ for (i = 0; i < T->nc; i++) {
+ if (T->c[i]->type == type_constr_declarations) { TL_TRY_PES (tl_parse_constr_declarations (T->c[i])); }
+ else { TL_TRY_PES (tl_parse_fun_declarations (T->c[i])) }
+ }
+ __ok = 1;
+ tree_act_tl_type (tl_type_tree, tl_type_check);
+ if (!__ok) {
+ return 0;
+ }
+ return tl_program_cur;
+}
+
+int __f;
+int num = 0;
+
+void wint (int a) {
+// printf ("%d ", a);
+ a = htole32 (a);
+ assert (write (__f, &a, 4) == 4);
+}
+
+void wdata (const void *x, int len) {
+ assert (write (__f, x, len) == len);
+}
+
+void wstr (const char *s) {
+ if (s) {
+// printf ("\"%s\" ", s);
+ int x = strlen (s);
+ if (x <= 254) {
+ unsigned char x_c = (unsigned char)x;
+ assert (write (__f, &x_c, 1) == 1);
+ } else {
+ fprintf (stderr, "String is too big...\n");
+ assert (0);
+ }
+ wdata (s, x);
+ x ++; // The header, containing the length, which is 1 byte
+ int t = 0;
+ if (x & 3) {
+ // Let's hope it's truly zero on every platform
+ wdata (&t, 4 - (x & 3));
+ }
+ } else {
+// printf ("<none> ");
+ wint (0);
+ }
+}
+
+void wll (long long a) {
+// printf ("%lld ", a);
+ a = htole64 (a);
+ assert (write (__f, &a, 8) == 8);
+}
+
+int count_list_size (struct tl_combinator_tree *T) {
+ assert (T->type == type_list || T->type == type_list_item);
+ if (T->type == type_list_item) {
+ return 1;
+ } else {
+ return count_list_size (T->left) + count_list_size (T->right);
+ }
+}
+
+void write_type_flags (long long flags) {
+ int new_flags = 0;
+ if (flags & 1) {
+ new_flags |= FLAG_BARE;
+ }
+ if (flags & FLAG_DEFAULT_CONSTRUCTOR) {
+ new_flags |= FLAG_DEFAULT_CONSTRUCTOR;
+ }
+ wint (new_flags);
+}
+
+void write_field_flags (long long flags) {
+ int new_flags = 0;
+ //fprintf (stderr, "%lld\n", flags);
+ if (flags & 1) {
+ new_flags |= FLAG_BARE;
+ }
+ if (flags & 32) {
+ new_flags |= FLAG_OPT_VAR;
+ }
+ if (flags & FLAG_EXCL) {
+ new_flags |= FLAG_EXCL;
+ }
+ if (flags & FLAG_OPT_FIELD) {
+ // new_flags |= FLAG_OPT_FIELD;
+ new_flags |= 2;
+ }
+ if (flags & (1 << 21)) {
+ new_flags |= 4;
+ }
+ wint (new_flags);
+}
+
+void write_var_type_flags (long long flags) {
+ int new_flags = 0;
+ if (flags & 1) {
+ new_flags |= FLAG_BARE;
+ }
+ if (new_flags & FLAG_BARE) {
+ TL_ERROR ("Sorry, bare vars are not (yet ?) supported.\n");
+ assert (!(new_flags & FLAG_BARE));
+ }
+ wint (new_flags);
+}
+
+void write_tree (struct tl_combinator_tree *T, int extra, struct tree_var_value **v, int *last_var);
+void write_args (struct tl_combinator_tree *T, struct tree_var_value **v, int *last_var) {
+ assert (T->type == type_list || T->type == type_list_item);
+ if (T->type == type_list) {
+ assert (T->act == act_union);
+ assert (T->left);
+ assert (T->right);
+ write_args (T->left, v, last_var);
+ write_args (T->right, v, last_var);
+ return;
+ }
+ wint (TLS_ARG_V2);
+ assert (T->act == act_field);
+ assert (T->left);
+ wstr (T->data && strcmp (T->data, "_") ? T->data : 0);
+ long long f = T->flags;
+ if (T->left->act == act_opt_field) {
+ f |= (1 << 20);
+ }
+ if (T->left->act == act_type && T->left->data && (!strcmp (((struct tl_type *)T->left->data)->id, "#") || !strcmp (((struct tl_type *)T->left->data)->id, "Type"))) {
+ write_field_flags (f | (1 << 21));
+ wint (*last_var);
+ *last_var = (*last_var) + 1;
+ tl_set_var_value_num (v, T, 0, (*last_var) - 1);
+ } else {
+ write_field_flags (f);
+ }
+ write_tree (T->left, 0, v, last_var);
+}
+
+void write_array (struct tl_combinator_tree *T, struct tree_var_value **v, int *last_var) {
+ wint (TLS_ARRAY);
+ write_tree (T->left, 0, v, last_var);
+ write_tree (T->right, 0, v, last_var);
+}
+
+void write_type_rec (struct tl_combinator_tree *T, int cc, struct tree_var_value **v, int *last_var) {
+ if (T->act == act_arg) {
+ write_type_rec (T->left, cc + 1, v, last_var);
+ if (T->right->type == type_num_value || T->right->type == type_num) {
+ wint (TLS_EXPR_NAT);
+ } else {
+ wint (TLS_EXPR_TYPE);
+ }
+ write_tree (T->right, 0, v, last_var);
+ } else {
+ assert (T->act == act_var || T->act == act_type);
+ if (T->act == act_var) {
+ assert (!cc);
+ wint (TLS_TYPE_VAR);
+ wint (tl_get_var_value_num (v, T->data));
+ write_var_type_flags (T->flags);
+ //wint (T->flags);
+ } else {
+ wint (TLS_TYPE_EXPR);
+ struct tl_type *t = T->data;
+ wint (t->name);
+ write_type_flags (T->flags);
+// wint (T->flags);
+ wint (cc);
+// fprintf (stderr, "cc = %d\n", cc);
+ }
+ }
+}
+
+void write_opt_type (struct tl_combinator_tree *T, struct tree_var_value **v, int *last_var) {
+ wint (tl_get_var_value_num (v, T->left->data));
+ wint (T->left->type_flags);
+// write_tree (T->right, 0, v, last_var);
+ assert (T);
+ T = T->right;
+ switch (T->type) {
+ case type_type:
+ if (T->act == act_array) {
+ write_array (T, v, last_var);
+ } else if (T->act == act_type || T->act == act_var || T->act == act_arg) {
+ write_type_rec (T, 0, v, last_var);
+ } else {
+ assert (0);
+ }
+ break;
+ default:
+ assert (0);
+ }
+}
+
+void write_tree (struct tl_combinator_tree *T, int extra, struct tree_var_value **v, int *last_var) {
+ assert (T);
+ switch (T->type) {
+ case type_list_item:
+ case type_list:
+ if (extra) {
+ wint (TLS_COMBINATOR_RIGHT_V2);
+ }
+ wint (count_list_size (T));
+ write_args (T, v, last_var);
+ break;
+ case type_num_value:
+ wint ((int)TLS_NAT_CONST);
+ wint (T->type_flags);
+ break;
+ case type_num:
+ wint ((int)TLS_NAT_VAR);
+ wint (T->type_flags);
+ wint (tl_get_var_value_num (v, T->data));
+ break;
+ case type_type:
+ if (T->act == act_array) {
+ write_array (T, v, last_var);
+ } else if (T->act == act_type || T->act == act_var || T->act == act_arg) {
+ write_type_rec (T, 0, v, last_var);
+ } else {
+ assert (T->act == act_opt_field);
+ write_opt_type (T, v, last_var);
+ }
+ break;
+ default:
+ assert (0);
+ }
+}
+
+void write_type (struct tl_type *t) {
+ wint (TLS_TYPE);
+ wint (t->name);
+ wstr (t->id);
+ wint (t->constructors_num);
+ wint (t->flags);
+ wint (t->params_num);
+ wll (t->params_types);
+}
+
+int is_builtin_type (const char *id) {
+ return !strcmp (id, "int") || !strcmp (id, "long") || !strcmp (id, "double") || !strcmp (id, "string");
+}
+
+void write_combinator (struct tl_constructor *c) {
+ wint (c->name);
+ wstr (c->id);
+ wint (c->type ? c->type->name : 0);
+ struct tree_var_value *T = 0;
+ int x = 0;
+ assert (c->right);
+ if (c->left) {
+ if (is_builtin_type (c->id)) {
+ wint (TLS_COMBINATOR_LEFT_BUILTIN);
+ } else {
+ wint (TLS_COMBINATOR_LEFT);
+ // FIXME: What is that?
+// wint (count_list_size (c->left));
+ write_tree (c->left, 0, &T, &x);
+ }
+ } else {
+ wint (TLS_COMBINATOR_LEFT);
+ wint (0);
+ }
+ wint (TLS_COMBINATOR_RIGHT_V2);
+ write_tree (c->right, 1, &T, &x);
+}
+
+void write_constructor (struct tl_constructor *c) {
+ wint (TLS_COMBINATOR);
+ write_combinator (c);
+}
+
+void write_function (struct tl_constructor *c) {
+ wint (TLS_COMBINATOR);
+ write_combinator (c);
+}
+
+void write_type_constructors (struct tl_type *t) {
+ int i;
+ for (i = 0; i < t->constructors_num; i++) {
+ write_constructor (t->constructors[i]);
+ }
+}
+
+void write_types (int f) {
+ __f = f;
+ wint (TLS_SCHEMA_V2);
+ wint (0);
+#ifdef TL_PARSER_NEED_TIME
+ wint (time (0));
+#else
+ /* Make the tlo reproducible by default. Rationale: https://wiki.debian.org/ReproducibleBuilds/Howto#Introduction */
+ wint (0);
+#endif
+ num = 0;
+ wint (total_types_num);
+ tree_act_tl_type (tl_type_tree, write_type);
+ wint (total_constructors_num);
+ tree_act_tl_type (tl_type_tree, write_type_constructors);
+ wint (total_functions_num);
+ tree_act_tl_constructor (tl_function_tree, write_function);
+}
diff --git a/protocols/Telegram/tgl/tl-parser/tl-parser.h b/protocols/Telegram/tgl/tl-parser/tl-parser.h
new file mode 100644
index 0000000000..7eb7524787
--- /dev/null
+++ b/protocols/Telegram/tgl/tl-parser/tl-parser.h
@@ -0,0 +1,221 @@
+/*
+ This file is part of tgl-libary/tlc
+
+ Tgl-library/tlc is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+
+ Tgl-library/tlc is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this tgl-library/tlc. If not, see <http://www.gnu.org/licenses/>.
+
+ Copyright Vitaly Valtman 2014
+
+ It is derivative work of VK/KittenPHP-DB-Engine (https://github.com/vk-com/kphp-kdb/)
+ Copyright 2012-2013 Vkontakte Ltd
+ 2012-2013 Vitaliy Valtman
+
+*/
+
+#ifndef __TL_PARSER_NEW_H__
+#define __TL_PARSER_NEW_H__
+#if defined(WIN32) || defined(_WIN32)
+#define lrand48() rand()
+#define _PRINTF_INT64_ "I64"
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+#define read _read
+#define write _write
+#define close _close
+#define lseek _lseek
+#define strdup _strdup
+#define __attribute__(x)
+#endif
+#else
+#define _PRINTF_INT64_ "ll"
+#endif
+
+enum lex_type {
+ lex_error,
+ lex_char,
+ lex_triple_minus,
+ lex_uc_ident,
+ lex_lc_ident,
+ lex_eof,
+ lex_final,
+ lex_new,
+ lex_none,
+ lex_num,
+ lex_empty
+};
+
+
+struct curlex {
+ char *ptr;
+ int len;
+ enum lex_type type;
+ int flags;
+};
+
+struct parse {
+ char *text;
+ int pos;
+ int len;
+ int line;
+ int line_pos;
+ struct curlex lex;
+};
+
+
+enum tree_type {
+ type_tl_program,
+ type_fun_declarations,
+ type_constr_declarations,
+ type_declaration,
+ type_combinator_decl,
+ type_equals,
+ type_partial_app_decl,
+ type_final_decl,
+ type_full_combinator_id,
+ type_opt_args,
+ type_args,
+ type_args1,
+ type_args2,
+ type_args3,
+ type_args4,
+ type_boxed_type_ident,
+ type_subexpr,
+ type_partial_comb_app_decl,
+ type_partial_type_app_decl,
+ type_final_new,
+ type_final_final,
+ type_final_empty,
+// type_type,
+ type_var_ident,
+ type_var_ident_opt,
+ type_multiplicity,
+ type_type_term,
+ type_term,
+ type_percent,
+ type_result_type,
+ type_expr,
+ type_nat_term,
+ type_combinator_id,
+ type_nat_const,
+ type_type_ident,
+ type_builtin_combinator_decl,
+ type_exclam,
+ type_optional_arg_def
+};
+
+struct tree {
+ char *text;
+ int len;
+ enum tree_type type;
+ int lex_line;
+ int lex_line_pos;
+ int flags;
+ int size;
+ int nc;
+ struct tree **c;
+};
+
+
+#define TL_ACT(x) (x == act_var ? "act_var" : x == act_field ? "act_field" : x == act_plus ? "act_plus" : x == act_type ? "act_type" : x == act_nat_const ? "act_nat_const" : x == act_array ? "act_array" : x == act_question_mark ? "act_question_mark" : \
+ x == act_union ? "act_union" : x == act_arg ? "act_arg" : x == act_opt_field ? "act_opt_field" : "act_unknown")
+
+#define TL_TYPE(x) (x == type_num ? "type_num" : x == type_type ? "type_type" : x == type_list_item ? "type_list_item" : x == type_list ? "type_list" : x == type_num_value ? "type_num_value" : "type_unknown")
+enum combinator_tree_action {
+ act_var,
+ act_field,
+ act_plus,
+ act_type,
+ act_nat_const,
+ act_array,
+ act_question_mark,
+ act_union,
+ act_arg,
+ act_opt_field
+};
+
+enum combinator_tree_type {
+ type_num,
+ type_num_value,
+ type_type,
+ type_list_item,
+ type_list
+};
+
+struct tl_combinator_tree {
+ enum combinator_tree_action act;
+ struct tl_combinator_tree *left, *right;
+ char *name;
+ void *data;
+ long long flags;
+ enum combinator_tree_type type;
+ int type_len;
+ long long type_flags;
+};
+
+
+struct tl_program {
+ int types_num;
+ int functions_num;
+ int constructors_num;
+ struct tl_type **types;
+ struct tl_function **functions;
+// struct tl_constuctor **constructors;
+};
+
+struct tl_type {
+ char *id;
+ char *print_id;
+ char *real_id;
+ unsigned name;
+ int flags;
+
+ int params_num;
+ long long params_types;
+
+ int constructors_num;
+ struct tl_constructor **constructors;
+};
+
+struct tl_constructor {
+ char *id;
+ char *print_id;
+ char *real_id;
+ unsigned name;
+ struct tl_type *type;
+
+ struct tl_combinator_tree *left;
+ struct tl_combinator_tree *right;
+};
+
+struct tl_var {
+ char *id;
+ struct tl_combinator_tree *ptr;
+ int type;
+ int flags;
+};
+
+struct parse *tl_init_parse_file (const char *fname);
+struct tree *tl_parse_lex (struct parse *P);
+void tl_print_parse_error (void);
+struct tl_program *tl_parse (struct tree *T);
+
+void write_types (int f);
+
+#define FLAG_BARE 1
+#define FLAG_OPT_VAR (1 << 17)
+#define FLAG_EXCL (1 << 18)
+#define FLAG_OPT_FIELD (1 << 20)
+#define FLAG_IS_VAR (1 << 21)
+#define FLAG_DEFAULT_CONSTRUCTOR (1 << 25)
+#define FLAG_EMPTY (1 << 10)
+
+#endif
diff --git a/protocols/Telegram/tgl/tl-parser/tl-tl.h b/protocols/Telegram/tgl/tl-parser/tl-tl.h
new file mode 100644
index 0000000000..8bc0a707bc
--- /dev/null
+++ b/protocols/Telegram/tgl/tl-parser/tl-tl.h
@@ -0,0 +1,55 @@
+/*
+ This file is part of VK/KittenPHP-DB-Engine.
+
+ VK/KittenPHP-DB-Engine is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+
+ VK/KittenPHP-DB-Engine is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with VK/KittenPHP-DB-Engine. If not, see <http://www.gnu.org/licenses/>.
+
+ This program is released under the GPL with the additional exemption
+ that compiling, linking, and/or using OpenSSL is allowed.
+ You are free to remove this exemption from derived works.
+
+ Copyright 2012-2013 Vkontakte Ltd
+ 2012-2013 Vitaliy Valtman
+*/
+
+#ifndef __TL_TL_H__
+#define __TL_TL_H__
+
+// Current tl-tl schema is V2
+// See https://core.telegram.org/mtproto/TL-tl
+
+#define TLS_SCHEMA_V2 0x3a2f9be2
+#define TLS_TYPE 0x12eb4386
+#define TLS_COMBINATOR 0x5c0a1ed5
+#define TLS_COMBINATOR_LEFT_BUILTIN 0xcd211f63
+#define TLS_COMBINATOR_LEFT 0x4c12c6d9
+#define TLS_COMBINATOR_RIGHT_V2 0x2c064372
+#define TLS_ARG_V2 0x29dfe61b
+
+#define TLS_EXPR_TYPE 0xecc9da78
+#define TLS_EXPR_NAT 0xdcb49bd8
+
+#define TLS_NAT_CONST 0xdcb49bd8
+#define TLS_NAT_VAR 0x4e8a14f0
+#define TLS_TYPE_VAR 0x0142ceae
+#define TLS_ARRAY 0xd9fb20de
+#define TLS_TYPE_EXPR 0xc1863d08
+
+/* Deprecated (old versions), read-only */
+#define TLS_TREE_NAT_CONST 0xc09f07d7
+#define TLS_TREE_NAT_VAR 0x90ea6f58
+#define TLS_TREE_TYPE_VAR 0x1caa237a
+#define TLS_TREE_ARRAY 0x80479360
+#define TLS_TREE_TYPE 0x10f32190
+
+#endif
diff --git a/protocols/Telegram/tgl/tl-parser/tlc.c b/protocols/Telegram/tgl/tl-parser/tlc.c
new file mode 100644
index 0000000000..d0edd20889
--- /dev/null
+++ b/protocols/Telegram/tgl/tl-parser/tlc.c
@@ -0,0 +1,179 @@
+/*
+ This file is part of tl-parser
+
+ tl-parser is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+
+ tl-parser is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this tl-parser. If not, see <http://www.gnu.org/licenses/>.
+
+ Copyright Vitaly Valtman 2014
+
+ It is derivative work of VK/KittenPHP-DB-Engine (https://github.com/vk-com/kphp-kdb/)
+ Copyright 2012-2013 Vkontakte Ltd
+ 2012-2013 Vitaliy Valtman
+
+*/
+
+#include "config.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#if defined(_MSC_VER)
+#include <io.h>
+#include <stdint.h>
+#include <string.h>
+#include "wingetopt.h"
+#else
+#include <unistd.h>
+#endif
+#include "tl-parser.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include <signal.h>
+#include "config.h"
+
+#ifdef HAVE_EXECINFO_H
+#include <execinfo.h>
+#endif
+#include <stdarg.h>
+
+int verbosity;
+int output_expressions;
+void usage (void) {
+ printf ("usage: tl-parser [-v] [-h] <TL-schema-file>\n"
+ "\tTL compiler\n"
+ "\t-v\toutput statistical and debug information into stderr\n"
+ "\t-E\twhenever is possible output to stdout expressions\n"
+ "\t-e <file>\texport serialized schema to file\n"
+ );
+ exit (2);
+}
+
+int vkext_write (const char *filename) {
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ int f = 0;
+ assert(_sopen_s(&f, filename, _O_CREAT | _O_WRONLY | _O_TRUNC | _O_BINARY, _SH_DENYNO, _S_IREAD | _S_IWRITE) == 0);
+#elif defined(WIN32) || defined(_WIN32)
+ int f = open(filename, O_CREAT | O_WRONLY | O_TRUNC | O_BINARY, 0640);
+ assert(f >= 0);
+#else
+ int f = open (filename, O_CREAT | O_WRONLY | O_TRUNC, 0640);
+ assert (f >= 0);
+#endif
+ write_types (f);
+ close (f);
+ return 0;
+}
+
+void logprintf (const char *format, ...) __attribute__ ((format (printf, 1, 2)));
+void logprintf (const char *format __attribute__ ((unused)), ...) {
+ va_list ap;
+ va_start (ap, format);
+ vfprintf (stderr, format, ap);
+ va_end (ap);
+}
+
+void hexdump (int *in_ptr, int *in_end) {
+ int *ptr = in_ptr;
+ while (ptr < in_end) { printf (" %08x", *(ptr ++)); }
+ printf ("\n");
+}
+
+#ifdef HAVE_EXECINFO_H
+void print_backtrace (void) {
+ void *buffer[255];
+ const int calls = backtrace (buffer, sizeof (buffer) / sizeof (void *));
+ backtrace_symbols_fd (buffer, calls, 1);
+}
+#else
+void print_backtrace (void) {
+ if (write (1, "No libexec. Backtrace disabled\n", 32) < 0) {
+ // Sad thing
+ }
+}
+#endif
+
+void sig_segv_handler (int signum __attribute__ ((unused))) {
+ if (write (1, "SIGSEGV received\n", 18) < 0) {
+ // Sad thing
+ }
+ print_backtrace ();
+ exit (EXIT_FAILURE);
+}
+
+void sig_abrt_handler (int signum __attribute__ ((unused))) {
+ if (write (1, "SIGABRT received\n", 18) < 0) {
+ // Sad thing
+ }
+ print_backtrace ();
+ exit (EXIT_FAILURE);
+}
+
+int main (int argc, char **argv) {
+ signal (SIGSEGV, sig_segv_handler);
+ signal (SIGABRT, sig_abrt_handler);
+ int i;
+ char *vkext_file = 0;
+ while ((i = getopt (argc, argv, "Ehve:w:")) != -1) {
+ switch (i) {
+ case 'E':
+ output_expressions++;
+ break;
+ case 'h':
+ usage ();
+ return 2;
+ case 'e':
+ vkext_file = optarg;
+ break;
+ case 'v':
+ verbosity++;
+ break;
+ }
+ }
+
+ if (argc != optind + 1) {
+ usage ();
+ }
+
+
+ struct parse *P = tl_init_parse_file (argv[optind]);
+ if (!P) {
+ return 0;
+ }
+ struct tree *T;
+ if (!(T = tl_parse_lex (P))) {
+ fprintf (stderr, "Error in parse:\n");
+ tl_print_parse_error ();
+ return 0;
+ } else {
+ if (verbosity) {
+ fprintf (stderr, "Parse ok\n");
+ }
+ if (!tl_parse (T)) {
+ if (verbosity) {
+ fprintf (stderr, "Fail\n");
+ }
+ return 1;
+ } else {
+ if (verbosity) {
+ fprintf (stderr, "Ok\n");
+ }
+ }
+ }
+ if (vkext_file) {
+ vkext_write (vkext_file);
+ }
+ return 0;
+}
diff --git a/protocols/Telegram/tgl/tools.c b/protocols/Telegram/tgl/tools.c
new file mode 100644
index 0000000000..02de961ef1
--- /dev/null
+++ b/protocols/Telegram/tgl/tools.c
@@ -0,0 +1,406 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Vitaly Valtman 2013-2015
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#define _GNU_SOURCE
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <openssl/err.h>
+#include <openssl/rand.h>
+#include <zlib.h>
+#include <time.h>
+#if defined(WIN32) || defined(_WIN32)
+#include <sys/timeb.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#else
+#include <sys/time.h>
+#endif // _WIN32
+
+//#include "interface.h"
+#include "tools.h"
+
+#ifdef __MACH__
+#include <mach/clock.h>
+#include <mach/mach.h>
+#endif
+
+#if defined(__MACH__) || defined(WIN32) || defined(_WIN32)
+#define CLOCK_REALTIME 0
+#define CLOCK_MONOTONIC 1
+#endif
+
+#ifdef VALGRIND_FIXES
+#include "valgrind/memcheck.h"
+#endif
+
+#define RES_PRE 8
+#define RES_AFTER 8
+#define MAX_BLOCKS 1000000
+static void *blocks[MAX_BLOCKS];
+static void *free_blocks[MAX_BLOCKS];
+static int used_blocks;
+static int free_blocks_cnt;
+
+static long long total_allocated_bytes;
+
+#if defined(WIN32) || defined(_WIN32)
+#define exp7 10000000i64 //1E+7 //C-file part
+#define exp9 1000000000i64 //1E+9
+#define w2ux 116444736000000000i64 //1.jan1601 to 1.jan1970
+#define __need_clock_t
+#include <time.h>
+
+int gettimeofday(struct timeval* t, void* timezone) {
+ struct _timeb timebuffer;
+ _ftime_s(&timebuffer);
+ t->tv_sec = (long)timebuffer.time;
+ t->tv_usec = 1000 * timebuffer.millitm;
+ return 0;
+}
+
+
+struct tms {
+ clock_t tms_utime;
+ clock_t tms_stime;
+
+ clock_t tms_cutime;
+ clock_t tms_cstime;
+};
+
+clock_t times(struct tms *__buffer) {
+ __buffer->tms_utime = clock();
+ __buffer->tms_stime = 0;
+ __buffer->tms_cstime = 0;
+ __buffer->tms_cutime = 0;
+ return __buffer->tms_utime;
+}
+
+typedef long long suseconds_t;
+
+int vasprintf(char ** __restrict ret, const char * __restrict format, va_list ap) {
+ int len;
+ /* Get Length */
+ len = _vsnprintf_s(NULL, 0, 0, format, ap);
+ if (len < 0) return -1;
+
+ /* +1 for \0 terminator. */
+ *ret = malloc(len + 1);
+ if (!*ret) return -1;
+
+ _vsnprintf_s(*ret, len + 1, len + 1, format, ap);
+
+ /* Terminate explicitly */
+ (*ret)[len] = '\0';
+ return len;
+}
+#endif // WIN32
+
+void logprintf (const char *format, ...) __attribute__ ((format (printf, 1, 2), weak));
+void logprintf (const char *format, ...) {
+ va_list ap;
+ va_start (ap, format);
+ vfprintf (stdout, format, ap);
+ va_end (ap);
+}
+
+//extern int verbosity;
+
+//static long long total_allocated_bytes;
+
+int tgl_snprintf (char *buf, int len, const char *format, ...) {
+ va_list ap;
+ va_start (ap, format);
+ int r = vsnprintf (buf, len, format, ap);
+ va_end (ap);
+ assert (r <= len && "tsnprintf buffer overflow");
+ return r;
+}
+
+int tgl_asprintf (char **res, const char *format, ...) {
+ va_list ap;
+ va_start (ap, format);
+ int r = vasprintf (res, format, ap);
+ assert (r >= 0);
+ va_end (ap);
+ void *rs = talloc (strlen (*res) + 1);
+ memcpy (rs, *res, strlen (*res) + 1);
+ free (*res);
+ *res = rs;
+ return r;
+}
+
+void tgl_free_debug (void *ptr, int size __attribute__ ((unused))) {
+ total_allocated_bytes -= size;
+ (char*)ptr -= RES_PRE;
+ if (size != (int)((*(int *)ptr) ^ 0xbedabeda)) {
+ logprintf ("size = %d, ptr = %d\n", size, (*(int *)ptr) ^ 0xbedabeda);
+ }
+ assert (*(int *)ptr == (int)((size) ^ 0xbedabeda));
+ assert (*(int *)((char *)ptr + RES_PRE + size) == (int)((size) ^ 0x7bed7bed));
+ assert (*(int *)((char *)ptr + 4) == size);
+ int block_num = *(int *)((char*)ptr + 4 + RES_PRE + size);
+ if (block_num >= used_blocks) {
+ logprintf ("block_num = %d, used = %d\n", block_num, used_blocks);
+ }
+ assert (block_num < used_blocks);
+ if (block_num < used_blocks - 1) {
+ void *p = blocks[used_blocks - 1];
+ int s = (*(int *)p) ^ 0xbedabeda;
+ *(int *)((char *)p + 4 + RES_PRE + s) = block_num;
+ blocks[block_num] = p;
+ }
+ blocks[--used_blocks] = 0;
+ memset (ptr, 0, size + RES_PRE + RES_AFTER);
+ *(int *)ptr = size + 12;
+ free_blocks[free_blocks_cnt ++] = ptr;
+}
+
+void tgl_free_release (void *ptr, int size) {
+ memset (ptr, 0, size);
+ free (ptr);
+}
+
+
+
+void *tgl_realloc_debug (void *ptr, size_t old_size __attribute__ ((unused)), size_t size) {
+ void *p = talloc (size);
+ memcpy (p, ptr, size >= old_size ? old_size : size);
+ tfree (ptr, old_size);
+ return p;
+}
+
+void *tgl_realloc_release (void *ptr, size_t old_size __attribute__ ((unused)), size_t size) {
+ void *p = realloc (ptr, size);
+ ensure_ptr (p);
+ return p;
+}
+
+void *tgl_alloc_debug (size_t size) {
+ total_allocated_bytes += size;
+ void *p = malloc (size + RES_PRE + RES_AFTER);
+ ensure_ptr (p);
+ *(int *)p = size ^ 0xbedabeda;
+ *(int *)((char *)p + 4) = size;
+ *(int *)((char *)p + RES_PRE + size) = size ^ 0x7bed7bed;
+ *(int *)((char *)p + RES_AFTER + 4 + size) = used_blocks;
+ blocks[used_blocks ++] = p;
+
+ //tcheck ();
+ return (char *)p + 8;
+}
+
+void *tgl_alloc_release (size_t size) {
+ void *p = malloc (size);
+ ensure_ptr (p);
+ return p;
+}
+
+void *tgl_alloc0 (size_t size) {
+ void *p = talloc (size);
+ memset (p, 0, size);
+ return p;
+}
+
+char *tgl_strdup (const char *s) {
+ int l = strlen (s);
+ char *p = talloc (l + 1);
+#if defined(WIN32) || defined(_WIN32)
+ ZeroMemory(p, l + 1);
+#endif
+ memcpy (p, s, l + 1);
+ return p;
+}
+
+char *tgl_strndup (const char *s, size_t n) {
+ size_t l = 0;
+ for (l = 0; l < n && s[l]; l++) { }
+ char *p = talloc (l + 1);
+ memcpy (p, s, l);
+ p[l] = 0;
+ return p;
+}
+
+void *tgl_memdup (const void *s, size_t n) {
+ void *r = talloc (n);
+ memcpy (r, s, n);
+ return r;
+}
+
+
+int tgl_inflate (void *input, int ilen, void *output, int olen) {
+ z_stream strm;
+ memset (&strm, 0, sizeof (strm));
+ assert (inflateInit2 (&strm, 16 + MAX_WBITS) == Z_OK);
+ strm.avail_in = ilen;
+ strm.next_in = input;
+ strm.avail_out = olen ;
+ strm.next_out = output;
+ int err = inflate (&strm, Z_FINISH);
+ int total_out = strm.total_out;
+
+ if (err != Z_OK && err != Z_STREAM_END) {
+ logprintf ( "inflate error = %d\n", err);
+ logprintf ( "inflated %d bytes\n", (int) strm.total_out);
+ total_out = 0;
+ }
+ inflateEnd (&strm);
+ return total_out;
+}
+
+void tgl_check_debug (void) {
+ int i;
+ for (i = 0; i < used_blocks; i++) {
+ void *ptr = blocks[i];
+ int size = (*(int *)ptr) ^ 0xbedabeda;
+ if (!(*(int *)((char *)ptr + 4) == size) ||
+ !(*(int *)((char *)ptr + RES_PRE + size) == (size ^ 0x7bed7bed)) ||
+ !(*(int *)((char *)ptr + RES_PRE + 4 + size) == i)) {
+ logprintf ("Bad block at address %p (size %d, num %d)\n", ptr, size, i);
+ assert (0 && "Bad block");
+ }
+ }
+ for (i = 0; i < free_blocks_cnt; i++) {
+ void *ptr = free_blocks[i];
+ int l = *(int *)ptr;
+ int j = 0;
+ for (j = 0; j < l; j++) {
+ if (*(char *)((char *)ptr + 4 + j)) {
+ hexdump ((char *)ptr + 8, (char *)ptr + 8 + l + ((-l) & 3));
+ logprintf ("Used freed memory size = %d. ptr = %p\n", l + 4 - RES_PRE - RES_AFTER, ptr);
+ assert (0);
+ }
+ }
+ }
+ //logprintf ("ok. Used_blocks = %d. Free blocks = %d\n", used_blocks, free_blocks_cnt);
+}
+
+void tgl_exists_debug (void *ptr, int size) {
+ (char *)ptr -= RES_PRE;
+ if (size != (int)((*(int *)ptr) ^ 0xbedabeda)) {
+ logprintf ("size = %d, ptr = %d\n", size, (*(int *)ptr) ^ 0xbedabeda);
+ }
+ assert (*(int *)ptr == (int)((size) ^ 0xbedabeda));
+ assert (*(int *)((char *)ptr + RES_PRE + size) == (int)((size) ^ 0x7bed7bed));
+ assert (*(int *)((char *)ptr + 4) == size);
+ int block_num = *(int *)((char *)ptr + 4 + RES_PRE + size);
+ if (block_num >= used_blocks) {
+ logprintf ("block_num = %d, used = %d\n", block_num, used_blocks);
+ }
+ assert (block_num < used_blocks);
+}
+
+void tgl_exists_release (void *ptr, int size) {}
+void tgl_check_release (void) {}
+
+void tgl_my_clock_gettime (int clock_id, struct timespec *T) {
+#if defined(WIN32) || defined(_WIN32)
+ static double ticks2nano;
+ static __int64 tps = 0;
+ __int64 tmp, curticks;
+ _Bool real_time = (clock_id == CLOCK_REALTIME);
+
+ QueryPerformanceFrequency((LARGE_INTEGER*)&tmp);
+ if (tps != tmp) {
+ tps = tmp;
+ ticks2nano = (double)exp9 / tps;
+ }
+
+ if (clock_id == CLOCK_REALTIME)
+ {
+ __int64 wintime;
+ GetSystemTimeAsFileTime((FILETIME*)&wintime);
+ wintime -= w2ux;
+ T->tv_sec = wintime / exp7;
+ T->tv_nsec = wintime % exp7 * 100;
+ }
+ else
+ {
+ QueryPerformanceCounter((LARGE_INTEGER*)&curticks);
+ T->tv_sec = (long)(curticks / tps);
+ T->tv_nsec = (long)((double)(curticks % tps) * ticks2nano);
+ }
+
+ if (!(T->tv_nsec < exp9))
+ {
+ T->tv_sec++;
+ T->tv_nsec -= exp9;
+ }
+
+#elif defined( __MACH__)
+ // We are ignoring MONOTONIC and hope time doesn't go back too often
+ clock_serv_t cclock;
+ mach_timespec_t mts;
+ host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
+ clock_get_time(cclock, &mts);
+ mach_port_deallocate(mach_task_self(), cclock);
+ T->tv_sec = mts.tv_sec;
+ T->tv_nsec = mts.tv_nsec;
+#else
+ assert (clock_gettime(clock_id, T) >= 0);
+#endif
+}
+
+double tglt_get_double_time (void) {
+ struct timespec tv;
+ tgl_my_clock_gettime (CLOCK_REALTIME, &tv);
+ return tv.tv_sec + 1e-9 * tv.tv_nsec;
+}
+
+void tglt_secure_random (void *s, int l) {
+ if (RAND_bytes (s, l) <= 0) {
+ /*if (allow_weak_random) {
+ RAND_pseudo_bytes (s, l);
+ } else {*/
+ assert (0 && "End of random. If you want, you can start with -w");
+ //}
+ } else {
+ #ifdef VALGRIND_FIXES
+ VALGRIND_MAKE_MEM_DEFINED (s, l);
+ VALGRIND_CHECK_MEM_IS_DEFINED (s, l);
+ #endif
+ }
+}
+
+struct tgl_allocator tgl_allocator_debug = {
+ .alloc = tgl_alloc_debug,
+ .realloc = tgl_realloc_debug,
+ .free = tgl_free_debug,
+ .check = tgl_check_debug,
+ .exists = tgl_exists_debug
+};
+
+struct tgl_allocator tgl_allocator_release = {
+ .alloc = tgl_alloc_release,
+ .realloc = tgl_realloc_release,
+ .free = tgl_free_release,
+ .check = tgl_check_release,
+ .exists = tgl_exists_release
+};
+
+struct tgl_allocator *tgl_allocator = &tgl_allocator_release;
diff --git a/protocols/Telegram/tgl/tools.h b/protocols/Telegram/tgl/tools.h
new file mode 100644
index 0000000000..aa4c2bcad3
--- /dev/null
+++ b/protocols/Telegram/tgl/tools.h
@@ -0,0 +1,123 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Vitaly Valtman 2013-2015
+*/
+
+#ifndef __TOOLS_H__
+#define __TOOLS_H__
+#include <time.h>
+#include <openssl/err.h>
+#include <assert.h>
+#include "tgl.h"
+
+#define talloc tgl_allocator->alloc
+#define talloc0 tgl_alloc0
+#define tfree tgl_allocator->free
+#define tfree_str tgl_free_str
+#define tfree_secure tgl_free_secure
+#define trealloc tgl_allocator->realloc
+#define tcheck tgl_allocator->check
+#define texists tgl_allocator->exists
+#define tstrdup tgl_strdup
+#define tmemdup tgl_memdup
+#define tstrndup tgl_strndup
+#define tasprintf tgl_asprintf
+#define tsnprintf tgl_snprintf
+
+
+extern struct tgl_allocator *tgl_allocator;
+double tglt_get_double_time (void);
+
+int tgl_inflate (void *input, int ilen, void *output, int olen);
+//void ensure (int r);
+//void ensure_ptr (void *p);
+
+static inline void out_of_memory (void) {
+ fprintf (stderr, "Out of memory\n");
+ exit (1);
+}
+
+static inline void ensure (int r) {
+ if (!r) {
+ fprintf (stderr, "Open SSL error\n");
+ ERR_print_errors_fp (stderr);
+ assert (0);
+ }
+}
+
+static inline void ensure_ptr (void *p) {
+ if (p == NULL) {
+ out_of_memory ();
+ }
+}
+
+void *tgl_alloc_debug (size_t size);
+void *tgl_alloc_release (size_t size);
+
+void *tgl_realloc_debug (void *ptr, size_t old_size, size_t size);
+void *tgl_realloc_release (void *ptr, size_t old_size, size_t size);
+
+void *tgl_alloc0 (size_t size);
+char *tgl_strdup (const char *s);
+char *tgl_strndup (const char *s, size_t n);
+
+void tgl_free_debug (void *ptr, int size);
+void tgl_free_release (void *ptr, int size);
+//void tgl_free_str (void *ptr);
+//void tgl_free_secure (void *ptr, int size);
+
+void tgl_check_debug (void);
+void tgl_exists_debug (void *ptr, int size);
+void tgl_check_release (void);
+void tgl_exists_release (void *ptr, int size);
+
+void *tgl_memdup (const void *s, size_t n);
+
+int tgl_snprintf (char *buf, int len, const char *format, ...) __attribute__ ((format (printf, 3, 4)));
+int tgl_asprintf (char **res, const char *format, ...) __attribute__ ((format (printf, 2, 3)));
+
+void tglt_secure_random (void *s, int l);
+void tgl_my_clock_gettime (int clock_id, struct timespec *T);
+
+static inline void tgl_free_str (void *ptr) {
+ if (!ptr) { return; }
+ tfree (ptr, strlen ((const char *)ptr) + 1);
+}
+
+static inline void tgl_free_secure (void *ptr, int size) {
+ memset (ptr, 0, size);
+ tfree (ptr, size);
+}
+
+static inline void hexdump (void *ptr, void *end_ptr) {
+ int total = 0;
+ unsigned char *bptr = (unsigned char *)ptr;
+ while (bptr < (unsigned char *)end_ptr) {
+ fprintf (stderr, "%02x", (int)*bptr);
+ bptr ++;
+ total ++;
+ if (total == 16) {
+ fprintf (stderr, "\n");
+ total = 0;
+ }
+ }
+ if (total) { fprintf (stderr, "\n"); }
+}
+
+
+#endif
diff --git a/protocols/Telegram/tgl/tree.h b/protocols/Telegram/tgl/tree.h
new file mode 100644
index 0000000000..18feb3aed5
--- /dev/null
+++ b/protocols/Telegram/tgl/tree.h
@@ -0,0 +1,179 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Vitaly Valtman 2013-2015
+*/
+#ifndef __TREE_H__
+#define __TREE_H__
+#include <stdio.h>
+
+#include <memory.h>
+#include <assert.h>
+#include "tools.h"
+
+#pragma pack(push,4)
+#define DEFINE_TREE(X_NAME, X_TYPE, X_CMP, X_UNSET) \
+struct tree_ ## X_NAME { \
+ struct tree_ ## X_NAME *left, *right;\
+ X_TYPE x;\
+ int y;\
+};\
+\
+static struct tree_ ## X_NAME *new_tree_node_ ## X_NAME (X_TYPE x, int y) {\
+ struct tree_ ## X_NAME *T = talloc (sizeof (*T));\
+ T->x = x;\
+ T->y = y;\
+ T->left = T->right = 0;\
+ return T;\
+}\
+\
+static void delete_tree_node_ ## X_NAME (struct tree_ ## X_NAME *T) {\
+ tfree (T, sizeof (*T));\
+}\
+\
+static void tree_split_ ## X_NAME (struct tree_ ## X_NAME *T, X_TYPE x, struct tree_ ## X_NAME **L, struct tree_ ## X_NAME **R) {\
+ if (!T) {\
+ *L = *R = 0;\
+ } else {\
+ int c = X_CMP (x, T->x);\
+ if (c < 0) {\
+ tree_split_ ## X_NAME (T->left, x, L, &T->left);\
+ *R = T;\
+ } else {\
+ tree_split_ ## X_NAME (T->right, x, &T->right, R);\
+ *L = T;\
+ }\
+ }\
+}\
+\
+static struct tree_ ## X_NAME *tree_insert_ ## X_NAME (struct tree_ ## X_NAME *T, X_TYPE x, int y) __attribute__ ((warn_unused_result,unused));\
+static struct tree_ ## X_NAME *tree_insert_ ## X_NAME (struct tree_ ## X_NAME *T, X_TYPE x, int y) {\
+ if (!T) {\
+ return new_tree_node_ ## X_NAME (x, y);\
+ } else {\
+ if (y > T->y) {\
+ struct tree_ ## X_NAME *N = new_tree_node_ ## X_NAME (x, y);\
+ tree_split_ ## X_NAME (T, x, &N->left, &N->right);\
+ return N;\
+ } else {\
+ int c = X_CMP (x, T->x);\
+ assert (c);\
+ if (c < 0) { \
+ T->left = tree_insert_ ## X_NAME (T->left, x, y);\
+ } else { \
+ T->right = tree_insert_ ## X_NAME (T->right, x, y);\
+ } \
+ return T; \
+ }\
+ }\
+}\
+\
+static struct tree_ ## X_NAME *tree_merge_ ## X_NAME (struct tree_ ## X_NAME *L, struct tree_ ## X_NAME *R) {\
+ if (!L || !R) {\
+ return L ? L : R;\
+ } else {\
+ if (L->y > R->y) {\
+ L->right = tree_merge_ ## X_NAME (L->right, R);\
+ return L;\
+ } else {\
+ R->left = tree_merge_ ## X_NAME (L, R->left);\
+ return R;\
+ }\
+ }\
+}\
+\
+static struct tree_ ## X_NAME *tree_delete_ ## X_NAME (struct tree_ ## X_NAME *T, X_TYPE x) __attribute__ ((warn_unused_result,unused));\
+static struct tree_ ## X_NAME *tree_delete_ ## X_NAME (struct tree_ ## X_NAME *T, X_TYPE x) {\
+ assert (T);\
+ int c = X_CMP (x, T->x);\
+ if (!c) {\
+ struct tree_ ## X_NAME *N = tree_merge_ ## X_NAME (T->left, T->right);\
+ delete_tree_node_ ## X_NAME (T);\
+ return N;\
+ } else {\
+ if (c < 0) { \
+ T->left = tree_delete_ ## X_NAME (T->left, x); \
+ } else { \
+ T->right = tree_delete_ ## X_NAME (T->right, x); \
+ } \
+ return T; \
+ }\
+}\
+\
+static X_TYPE tree_get_min_ ## X_NAME (struct tree_ ## X_NAME *t) __attribute__ ((unused));\
+static X_TYPE tree_get_min_ ## X_NAME (struct tree_ ## X_NAME *T) {\
+ if (!T) { return X_UNSET; } \
+ while (T->left) { T = T->left; }\
+ return T->x; \
+} \
+\
+static X_TYPE tree_lookup_ ## X_NAME (struct tree_ ## X_NAME *T, X_TYPE x) __attribute__ ((unused));\
+static X_TYPE tree_lookup_ ## X_NAME (struct tree_ ## X_NAME *T, X_TYPE x) {\
+ int c;\
+ while (T && (c = X_CMP (x, T->x))) {\
+ T = (c < 0 ? T->left : T->right);\
+ }\
+ return T ? T->x : X_UNSET;\
+}\
+\
+static void tree_act_ ## X_NAME (struct tree_ ## X_NAME *T, void (*act)(X_TYPE)) __attribute__ ((unused));\
+static void tree_act_ ## X_NAME (struct tree_ ## X_NAME *T, void (*act)(X_TYPE)) {\
+ if (!T) { return; } \
+ tree_act_ ## X_NAME (T->left, act); \
+ act (T->x); \
+ tree_act_ ## X_NAME (T->right, act); \
+}\
+\
+static void tree_act_ex_ ## X_NAME (struct tree_ ## X_NAME *T, void (*act)(X_TYPE, void *), void *extra) __attribute__ ((unused));\
+static void tree_act_ex_ ## X_NAME (struct tree_ ## X_NAME *T, void (*act)(X_TYPE, void *), void *extra) {\
+ if (!T) { return; } \
+ tree_act_ex_ ## X_NAME (T->left, act, extra); \
+ act (T->x, extra); \
+ tree_act_ex_ ## X_NAME (T->right, act, extra); \
+}\
+\
+static int tree_count_ ## X_NAME (struct tree_ ## X_NAME *T) __attribute__ ((unused));\
+static int tree_count_ ## X_NAME (struct tree_ ## X_NAME *T) { \
+ if (!T) { return 0; }\
+ return 1 + tree_count_ ## X_NAME (T->left) + tree_count_ ## X_NAME (T->right); \
+}\
+static void tree_check_ ## X_NAME (struct tree_ ## X_NAME *T) __attribute__ ((unused));\
+static void tree_check_ ## X_NAME (struct tree_ ## X_NAME *T) { \
+ if (!T) { return; }\
+ if (T->left) { \
+ assert (T->left->y <= T->y);\
+ assert (X_CMP (T->left->x, T->x) < 0); \
+ }\
+ if (T->right) { \
+ assert (T->right->y <= T->y);\
+ assert (X_CMP (T->right->x, T->x) > 0); \
+ }\
+ tree_check_ ## X_NAME (T->left); \
+ tree_check_ ## X_NAME (T->right); \
+}\
+static struct tree_ ## X_NAME *tree_clear_ ## X_NAME (struct tree_ ## X_NAME *T) __attribute__ ((unused));\
+static struct tree_ ## X_NAME *tree_clear_ ## X_NAME (struct tree_ ## X_NAME *T) { \
+ if (!T) { return 0; }\
+ tree_clear_ ## X_NAME (T->left); \
+ tree_clear_ ## X_NAME (T->right); \
+ delete_tree_node_ ## X_NAME (T); \
+ return 0; \
+} \
+
+#define int_cmp(a,b) ((a) - (b))
+#pragma pack(pop)
+#endif
diff --git a/protocols/Telegram/tgl/updates.c b/protocols/Telegram/tgl/updates.c
new file mode 100644
index 0000000000..0f4b209f54
--- /dev/null
+++ b/protocols/Telegram/tgl/updates.c
@@ -0,0 +1,668 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Vitaly Valtman 2013-2015
+*/
+#include "tgl.h"
+#include "updates.h"
+#include "mtproto-common.h"
+#include "tgl-binlog.h"
+#include "auto.h"
+#include "auto/auto-types.h"
+#include "auto/auto-skip.h"
+#include "auto/auto-fetch-ds.h"
+#include "auto/auto-free-ds.h"
+#include "tgl-structures.h"
+#include "tgl-methods-in.h"
+#include "tree.h"
+
+#include <assert.h>
+
+static void fetch_dc_option_new (struct tgl_state *TLS, struct tl_ds_dc_option *DS_DO) {
+ vlogprintf (E_DEBUG, "id = %d, name = %.*s ip = %.*s port = %d\n", DS_LVAL (DS_DO->id), DS_RSTR (DS_DO->hostname), DS_RSTR (DS_DO->ip_address), DS_LVAL (DS_DO->port));
+
+ bl_do_dc_option (TLS, DS_LVAL (DS_DO->id), DS_STR (DS_DO->hostname), DS_STR (DS_DO->ip_address), DS_LVAL (DS_DO->port));
+}
+
+int tgl_check_pts_diff (struct tgl_state *TLS, int pts, int pts_count) {
+ vlogprintf (E_DEBUG - 1, "pts = %d, pts_count = %d\n", pts, pts_count);
+ if (!TLS->pts) {
+ return 1;
+ }
+ //assert (TLS->pts);
+ if (pts < TLS->pts + pts_count) {
+ vlogprintf (E_NOTICE, "Duplicate message with pts=%d\n", pts);
+ return -1;
+ }
+ if (pts > TLS->pts + pts_count) {
+ vlogprintf (E_NOTICE, "Hole in pts (pts = %d, count = %d, cur_pts = %d)\n", pts, pts_count, TLS->pts);
+ tgl_do_get_difference (TLS, 0, 0, 0);
+ return -1;
+ }
+ if (TLS->locks & TGL_LOCK_DIFF) {
+ vlogprintf (E_DEBUG, "Update during get_difference. pts = %d\n", pts);
+ return -1;
+ }
+ vlogprintf (E_DEBUG, "Ok update. pts = %d\n", pts);
+ return 1;
+}
+
+int tgl_check_qts_diff (struct tgl_state *TLS, int qts, int qts_count) {
+ vlogprintf (E_ERROR, "qts = %d, qts_count = %d\n", qts, qts_count);
+ if (qts < TLS->qts + qts_count) {
+ vlogprintf (E_NOTICE, "Duplicate message with qts=%d\n", qts);
+ return -1;
+ }
+ if (qts > TLS->qts + qts_count) {
+ vlogprintf (E_NOTICE, "Hole in qts (qts = %d, count = %d, cur_qts = %d)\n", qts, qts_count, TLS->qts);
+ tgl_do_get_difference (TLS, 0, 0, 0);
+ return -1;
+ }
+ if (TLS->locks & TGL_LOCK_DIFF) {
+ vlogprintf (E_DEBUG, "Update during get_difference. qts = %d\n", qts);
+ return -1;
+ }
+ vlogprintf (E_DEBUG, "Ok update. qts = %d\n", qts);
+ return 1;
+}
+
+static int do_skip_seq (struct tgl_state *TLS, int seq) {
+ if (!seq) {
+ vlogprintf (E_DEBUG, "Ok update. seq = %d\n", seq);
+ return 0;
+ }
+ if (TLS->seq) {
+ if (seq <= TLS->seq) {
+ vlogprintf (E_NOTICE, "Duplicate message with seq=%d\n", seq);
+ return -1;
+ }
+ if (seq > TLS->seq + 1) {
+ vlogprintf (E_NOTICE, "Hole in seq (seq = %d, cur_seq = %d)\n", seq, TLS->seq);
+ //vlogprintf (E_NOTICE, "lock_diff = %s\n", (TLS->locks & TGL_LOCK_DIFF) ? "true" : "false");
+ tgl_do_get_difference (TLS, 0, 0, 0);
+ return -1;
+ }
+ if (TLS->locks & TGL_LOCK_DIFF) {
+ vlogprintf (E_DEBUG, "Update during get_difference. seq = %d\n", seq);
+ return -1;
+ }
+ vlogprintf (E_DEBUG, "Ok update. seq = %d\n", seq);
+ return 0;
+ } else {
+ return -1;
+ }
+}
+
+void tglu_work_update_new (struct tgl_state *TLS, int check_only, struct tl_ds_update *DS_U) {
+ if (check_only > 0 || (TLS->locks & TGL_LOCK_DIFF)) {
+ vlogprintf (E_DEBUG, "Update during get_difference. DROP\n");
+ return;
+ }
+
+ if (DS_U->pts) {
+ assert (DS_U->pts_count);
+
+ if (!check_only && tgl_check_pts_diff (TLS, DS_LVAL (DS_U->pts), DS_LVAL (DS_U->pts_count)) <= 0) {
+ return;
+ }
+ }
+
+ if (DS_U->qts) {
+ if (!check_only && tgl_check_qts_diff (TLS, DS_LVAL (DS_U->qts), 1) <= 0) {
+ return;
+ }
+ }
+
+ if (check_only > 0 && DS_U->magic != CODE_update_message_i_d) { return; }
+ switch (DS_U->magic) {
+ case CODE_update_new_message:
+ {
+ struct tgl_message *N = tgl_message_get (TLS, DS_LVAL (DS_U->id));
+ int new = (!N || !(N->flags & TGLMF_CREATED));
+ struct tgl_message *M = tglf_fetch_alloc_message_new (TLS, DS_U->message);
+ assert (M);
+ if (new) {
+ bl_do_msg_update (TLS, M->id);
+ }
+ break;
+ };
+ case CODE_update_message_i_d:
+ {
+ struct tgl_message *M = tgl_message_get (TLS, DS_LVAL (DS_U->random_id));
+ if (M) {
+ tgls_insert_random2local (TLS, DS_LVAL (DS_U->random_id), DS_LVAL (DS_U->id));
+ bl_do_set_msg_id (TLS, M, DS_LVAL (DS_U->id));
+ }
+ }
+ break;
+/* case CODE_update_read_messages:
+ {
+ int n = DS_LVAL (DS_U->messages->cnt);
+
+ int i;
+ for (i = 0; i < n; i++) {
+ struct tgl_message *M = tgl_message_get (TLS, DS_LVAL (DS_U->messages->data[i]));
+ if (M) {
+ tgl_peer_t *P;
+ if (M->flags & TGLMF_OUT) {
+ P = tgl_peer_get (TLS, M->to_id);
+ if (P && (P->flags & TGLMF_CREATED)) {
+ if (tgl_get_peer_type (P->id) == TGL_PEER_USER) {
+ bl_do_user_new (TLS, tgl_get_peer_id (P->id), NULL, NULL, 0, NULL, 0, NULL, 0, NULL, 0, NULL, NULL, 0, NULL, 0, NULL, NULL, (int *)&M->id, TGL_FLAGS_UNCHANGED);
+ } else {
+ bl_do_chat_new (TLS, tgl_get_peer_id (P->id), NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, (int *)&M->id, TGL_FLAGS_UNCHANGED);
+ }
+ }
+ } else {
+ if (tgl_get_peer_type (M->to_id) == TGL_PEER_USER) {
+ P = tgl_peer_get (TLS, M->from_id);
+ } else {
+ P = tgl_peer_get (TLS, M->to_id);
+ }
+ if (P && (P->flags & TGLMF_CREATED)) {
+ if (tgl_get_peer_type (P->id) == TGL_PEER_USER) {
+ bl_do_user_new (TLS, tgl_get_peer_id (P->id), NULL, NULL, 0, NULL, 0, NULL, 0, NULL, 0, NULL, NULL, 0, NULL, 0, NULL, (int *)&M->id, NULL, TGL_FLAGS_UNCHANGED);
+ } else {
+ bl_do_chat_new (TLS, tgl_get_peer_id (P->id), NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, (int *)&M->id, NULL, TGL_FLAGS_UNCHANGED);
+ }
+ }
+ }
+ }
+ }
+ }
+ break;*/
+ case CODE_update_user_typing:
+ {
+ tgl_peer_id_t id = TGL_MK_USER (DS_LVAL (DS_U->user_id));
+ tgl_peer_t *U = tgl_peer_get (TLS, id);
+ enum tgl_typing_status status = tglf_fetch_typing_new (DS_U->action);
+
+ if (TLS->callback.type_notification && U) {
+ TLS->callback.type_notification (TLS, (void *)U, status);
+ }
+ }
+ break;
+ case CODE_update_chat_user_typing:
+ {
+ tgl_peer_id_t chat_id = TGL_MK_CHAT (DS_LVAL (DS_U->chat_id));
+ tgl_peer_id_t id = TGL_MK_USER (DS_LVAL (DS_U->user_id));
+ tgl_peer_t *C = tgl_peer_get (TLS, chat_id);
+ tgl_peer_t *U = tgl_peer_get (TLS, id);
+ enum tgl_typing_status status = tglf_fetch_typing_new (DS_U->action);
+
+ if (U && C) {
+ if (TLS->callback.type_in_chat_notification) {
+ TLS->callback.type_in_chat_notification (TLS, (void *)U, (void *)C, status);
+ }
+ }
+ }
+ break;
+ case CODE_update_user_status:
+ {
+ tgl_peer_id_t user_id = TGL_MK_USER (DS_LVAL (DS_U->user_id));
+ tgl_peer_t *U = tgl_peer_get (TLS, user_id);
+ if (U) {
+ tglf_fetch_user_status_new (TLS, &U->user.status, &U->user, DS_U->status);
+
+ if (TLS->callback.status_notification) {
+ TLS->callback.status_notification (TLS, (void *)U);
+ }
+ }
+ }
+ break;
+ case CODE_update_user_name:
+ {
+ tgl_peer_id_t user_id = TGL_MK_USER (DS_LVAL (DS_U->user_id));
+ tgl_peer_t *UC = tgl_peer_get (TLS, user_id);
+ if (UC && (UC->flags & TGLPF_CREATED)) {
+ bl_do_user_new (TLS, tgl_get_peer_id (user_id), NULL, NULL, 0, NULL, 0, NULL, 0, DS_STR (DS_U->username), NULL, DS_STR (DS_U->first_name), DS_STR (DS_U->last_name), NULL, NULL, NULL, NULL, TGL_FLAGS_UNCHANGED);
+ }
+ }
+ break;
+ case CODE_update_user_photo:
+ {
+ tgl_peer_id_t user_id = TGL_MK_USER (DS_LVAL (DS_U->user_id));
+ tgl_peer_t *UC = tgl_peer_get (TLS, user_id);
+
+ if (UC && (UC->flags & TGLUF_CREATED)) {
+ bl_do_user_new (TLS, tgl_get_peer_id (user_id), NULL, NULL, 0, NULL, 0, NULL, 0, NULL, 0, NULL, NULL, 0, NULL, 0, DS_U->photo, NULL, NULL, NULL, TGL_FLAGS_UNCHANGED);
+ }
+ }
+ break;
+ case CODE_update_delete_messages:
+ {
+ }
+ break;
+ case CODE_update_chat_participants:
+ {
+ tgl_peer_id_t chat_id = TGL_MK_CHAT (DS_LVAL (DS_U->chat_id));
+ tgl_peer_t *C = tgl_peer_get (TLS, chat_id);
+ if (C && (C->flags & TGLPF_CREATED) && DS_U->participants->magic == CODE_chat_participants) {
+ bl_do_chat_new (TLS, tgl_get_peer_id (chat_id), NULL, 0, NULL, NULL, DS_U->participants->version, (struct tl_ds_vector *)DS_U->participants->participants, NULL, NULL, NULL, NULL, NULL, TGL_FLAGS_UNCHANGED);
+ }
+ }
+ break;
+ case CODE_update_contact_registered:
+ {
+ tgl_peer_id_t user_id = TGL_MK_USER (DS_LVAL (DS_U->user_id));
+ tgl_peer_t *U = tgl_peer_get (TLS, user_id);
+ if (TLS->callback.user_registered && U) {
+ TLS->callback.user_registered (TLS, (void *)U);
+ }
+ }
+ break;
+ case CODE_update_contact_link:
+ {
+ }
+ break;
+ /*case CODE_update_activation:
+ {
+ tgl_peer_id_t user_id = TGL_MK_USER (DS_LVAL (DS_U->user_id));
+ tgl_peer_t *U = tgl_peer_get (TLS, user_id);
+
+ if (TLS->callback.user_activated && U) {
+ TLS->callback.user_activated (TLS, (void *)U);
+ }
+ }
+ break;*/
+ case CODE_update_new_authorization:
+ {
+ if (TLS->callback.new_authorization) {
+ TLS->callback.new_authorization (TLS, DS_U->device->data, DS_U->location->data);
+ }
+ }
+ break;
+ case CODE_update_new_geo_chat_message:
+ {
+ }
+ break;
+ case CODE_update_new_encrypted_message:
+ {
+ struct tgl_message *M = tglf_fetch_alloc_encrypted_message_new (TLS, DS_U->encr_message);
+ bl_do_msg_update (TLS, M->id);
+ }
+ break;
+ case CODE_update_encryption:
+ {
+ struct tgl_secret_chat *E = tglf_fetch_alloc_encrypted_chat_new (TLS, DS_U->encr_chat);
+ vlogprintf (E_DEBUG, "Secret chat state = %d\n", E->state);
+ if (E->state == sc_ok) {
+ tgl_do_send_encr_chat_layer (TLS, E);
+ }
+ }
+ break;
+ case CODE_update_encrypted_chat_typing:
+ {
+ tgl_peer_id_t id = TGL_MK_ENCR_CHAT (DS_LVAL (DS_U->chat_id));
+ tgl_peer_t *P = tgl_peer_get (TLS, id);
+
+ if (P) {
+ if (TLS->callback.type_in_secret_chat_notification) {
+ TLS->callback.type_in_secret_chat_notification (TLS, (void *)P);
+ }
+ }
+ }
+ break;
+ case CODE_update_encrypted_messages_read:
+ {
+ tgl_peer_id_t id = TGL_MK_ENCR_CHAT (DS_LVAL (DS_U->chat_id));
+ tgl_peer_t *P = tgl_peer_get (TLS, id);
+
+ if (P && P->last) {
+ struct tgl_message *M = P->last;
+ while (M && (!(M->flags & TGLMF_OUT) || (M->flags & TGLMF_UNREAD))) {
+ if (M->flags & TGLMF_OUT) {
+ bl_do_create_message_encr_new (TLS, M->id, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, M->flags & ~TGLMF_UNREAD);
+ }
+ M = M->next;
+ }
+ }
+ }
+ break;
+ case CODE_update_chat_participant_add:
+ {
+ tgl_peer_id_t chat_id = TGL_MK_CHAT (DS_LVAL (DS_U->chat_id));
+ tgl_peer_id_t user_id = TGL_MK_USER (DS_LVAL (DS_U->user_id));
+ tgl_peer_id_t inviter_id = TGL_MK_USER (DS_LVAL (DS_U->inviter_id));
+ int version = DS_LVAL (DS_U->version);
+
+ tgl_peer_t *C = tgl_peer_get (TLS, chat_id);
+ if (C && (C->flags & TGLPF_CREATED)) {
+ bl_do_chat_add_user (TLS, &C->chat, version, tgl_get_peer_id (user_id), tgl_get_peer_id (inviter_id), (int)time (0));
+ }
+ }
+ break;
+ case CODE_update_chat_participant_delete:
+ {
+ tgl_peer_id_t chat_id = TGL_MK_CHAT (DS_LVAL (DS_U->chat_id));
+ tgl_peer_id_t user_id = TGL_MK_USER (DS_LVAL (DS_U->user_id));
+ int version = DS_LVAL (DS_U->version);
+
+ tgl_peer_t *C = tgl_peer_get (TLS, chat_id);
+ if (C && (C->flags & TGLPF_CREATED)) {
+ bl_do_chat_del_user (TLS, &C->chat, version, tgl_get_peer_id (user_id));
+ }
+ }
+ break;
+ case CODE_update_dc_options:
+ {
+ int i;
+ for (i = 0; i < DS_LVAL (DS_U->dc_options->cnt); i++) {
+ fetch_dc_option_new (TLS, DS_U->dc_options->data[i]);
+ }
+ }
+ break;
+ case CODE_update_user_blocked:
+ {
+ int blocked = DS_BVAL (DS_U->blocked);
+ tgl_peer_t *P = tgl_peer_get (TLS, TGL_MK_USER (DS_LVAL (DS_U->user_id)));
+ if (P && (P->flags & TGLPF_CREATED)) {
+ int flags = P->flags & 0xffff;
+ if (blocked) {
+ flags |= TGLUF_BLOCKED;
+ } else {
+ flags &= ~TGLUF_BLOCKED;
+ }
+ bl_do_user_new (TLS, tgl_get_peer_id (P->id), NULL, NULL, 0, NULL, 0, NULL, 0, NULL, 0, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, flags);
+ }
+ }
+ break;
+ case CODE_update_notify_settings:
+ {
+ }
+ break;
+ case CODE_update_service_notification:
+ {
+ vlogprintf (E_ERROR, "Notification %.*s: %.*s\n", DS_RSTR (DS_U->type), DS_RSTR (DS_U->message_text));
+ if (TLS->callback.notification) {
+ TLS->callback.notification (TLS, DS_U->type->data, DS_U->message_text->data);
+ }
+ }
+ break;
+ case CODE_update_privacy:
+ vlogprintf (E_NOTICE, "privacy change update\n");
+ break;
+ case CODE_update_user_phone:
+ {
+ tgl_peer_t *U = tgl_peer_get (TLS, TGL_MK_USER (DS_LVAL (DS_U->user_id)));
+ if (U && (U->flags & TGLPF_CREATED)) {
+ bl_do_user_new (TLS, tgl_get_peer_id (U->id), NULL, NULL, 0, NULL, 0, DS_STR (DS_U->phone), NULL, 0, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, TGL_FLAGS_UNCHANGED);
+ }
+ }
+ break;
+ case CODE_update_read_history_inbox:
+ {
+ tgl_peer_id_t id = tglf_fetch_peer_id_new (TLS, DS_U->peer);
+ tgl_peer_t *P = tgl_peer_get (TLS, id);
+ if (P && (P->flags & TGLPF_CREATED)) {
+ if (tgl_get_peer_type (P->id) == TGL_PEER_USER) {
+ bl_do_user_new (TLS, tgl_get_peer_id (P->id), NULL, NULL, 0, NULL, 0, NULL, 0, NULL, 0, NULL, NULL, 0, NULL, 0, NULL, DS_U->max_id, NULL, NULL, TGL_FLAGS_UNCHANGED);
+ } else {
+ bl_do_chat_new (TLS, tgl_get_peer_id (P->id), NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, DS_U->max_id, NULL, TGL_FLAGS_UNCHANGED);
+ }
+ }
+ }
+ break;
+ case CODE_update_read_history_outbox:
+ {
+ tgl_peer_id_t id = tglf_fetch_peer_id_new (TLS, DS_U->peer);
+ tgl_peer_t *P = tgl_peer_get (TLS, id);
+ if (P && (P->flags & TGLPF_CREATED)) {
+ if (tgl_get_peer_type (P->id) == TGL_PEER_USER) {
+ bl_do_user_new (TLS, tgl_get_peer_id (P->id), NULL, NULL, 0, NULL, 0, NULL, 0, NULL, 0, NULL, NULL, 0, NULL, 0, NULL, NULL, DS_U->max_id, NULL, TGL_FLAGS_UNCHANGED);
+ } else {
+ bl_do_chat_new (TLS, tgl_get_peer_id (P->id), NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, DS_U->max_id, TGL_FLAGS_UNCHANGED);
+ }
+ }
+ }
+ break;
+ case CODE_update_web_page:
+ {
+ }
+ break;
+ case CODE_update_msg_update:
+ {
+ struct tgl_message *M = tgl_message_get (TLS, DS_LVAL (DS_U->id));
+ if (M) {
+ bl_do_msg_update (TLS, M->id);
+ }
+ }
+ break;
+ case CODE_update_read_messages_contents:
+ break;
+ default:
+ assert (0);
+ }
+
+ if (check_only) { return; }
+
+ if (DS_U->pts) {
+ assert (DS_U->pts_count);
+
+ bl_do_set_pts (TLS, DS_LVAL (DS_U->pts));
+ }
+ if (DS_U->qts) {
+ bl_do_set_qts (TLS, DS_LVAL (DS_U->qts));
+ }
+}
+
+void tglu_work_updates_new (struct tgl_state *TLS, int check_only, struct tl_ds_updates *DS_U) {
+ if (check_only > 0 || (TLS->locks & TGL_LOCK_DIFF)) {
+ return;
+ }
+
+ if (!check_only && do_skip_seq (TLS, DS_LVAL (DS_U->seq)) < 0) {
+ return;
+ }
+ int i;
+ for (i = 0; i < DS_LVAL (DS_U->users->cnt); i++) {
+ tglf_fetch_alloc_user_new (TLS, DS_U->users->data[i]);
+ }
+ for (i = 0; i < DS_LVAL (DS_U->chats->cnt); i++) {
+ tglf_fetch_alloc_chat_new (TLS, DS_U->chats->data[i]);
+ }
+ for (i = 0; i < DS_LVAL (DS_U->updates->cnt); i++) {
+ tglu_work_update_new (TLS, check_only, DS_U->updates->data[i]);
+ }
+
+ if (check_only) { return; }
+ bl_do_set_date (TLS, DS_LVAL (DS_U->date));
+ bl_do_set_seq (TLS, DS_LVAL (DS_U->seq));
+}
+
+void tglu_work_updates_combined_new (struct tgl_state *TLS, int check_only, struct tl_ds_updates *DS_U) {
+ if (check_only > 0 || (TLS->locks & TGL_LOCK_DIFF)) {
+ return;
+ }
+
+ if (!check_only && do_skip_seq (TLS, DS_LVAL (DS_U->seq_start)) < 0) {
+ return;
+ }
+
+ int i;
+ for (i = 0; i < DS_LVAL (DS_U->users->cnt); i++) {
+ tglf_fetch_alloc_user_new (TLS, DS_U->users->data[i]);
+ }
+ for (i = 0; i < DS_LVAL (DS_U->chats->cnt); i++) {
+ tglf_fetch_alloc_chat_new (TLS, DS_U->chats->data[i]);
+ }
+ for (i = 0; i < DS_LVAL (DS_U->updates->cnt); i++) {
+ tglu_work_update_new (TLS, check_only, DS_U->updates->data[i]);
+ }
+
+ if (check_only) { return; }
+ bl_do_set_date (TLS, DS_LVAL (DS_U->date));
+ bl_do_set_seq (TLS, DS_LVAL (DS_U->seq));
+}
+
+void tglu_work_update_short_message_new (struct tgl_state *TLS, int check_only, struct tl_ds_updates *DS_U) {
+ if (check_only > 0 || (TLS->locks & TGL_LOCK_DIFF)) {
+ return;
+ }
+
+ if (!check_only && tgl_check_pts_diff (TLS, DS_LVAL (DS_U->pts), DS_LVAL (DS_U->pts_count)) <= 0) {
+ return;
+ }
+
+ if (check_only > 0) { return; }
+
+ struct tgl_message *N = tgl_message_get (TLS, DS_LVAL (DS_U->id));
+ int new = (!N || !(N->flags & TGLMF_CREATED));
+
+ struct tgl_message *M = tglf_fetch_alloc_message_short_new (TLS, DS_U);
+ assert (M);
+
+ if (check_only > 0 || (TLS->locks & TGL_LOCK_DIFF)) {
+ return;
+ }
+
+ if (new) {
+ bl_do_msg_update (TLS, M->id);
+ }
+
+ if (check_only) { return; }
+ bl_do_set_pts (TLS, DS_LVAL (DS_U->pts));
+}
+
+void tglu_work_update_short_chat_message_new (struct tgl_state *TLS, int check_only, struct tl_ds_updates *DS_U) {
+ if (check_only > 0 || (TLS->locks & TGL_LOCK_DIFF)) {
+ return;
+ }
+
+ if (!check_only && tgl_check_pts_diff (TLS, DS_LVAL (DS_U->pts), DS_LVAL (DS_U->pts_count)) <= 0) {
+ return;
+ }
+
+ if (check_only > 0) { return; }
+
+ struct tgl_message *N = tgl_message_get (TLS, DS_LVAL (DS_U->id));
+ int new = (!N || !(N->flags & TGLMF_CREATED));
+
+ struct tgl_message *M = tglf_fetch_alloc_message_short_chat_new (TLS, DS_U);
+ assert (M);
+
+ if (check_only > 0 || (TLS->locks & TGL_LOCK_DIFF)) {
+ return;
+ }
+
+ if (new) {
+ bl_do_msg_update (TLS, M->id);
+ }
+
+ if (check_only) { return; }
+ bl_do_set_pts (TLS, DS_LVAL (DS_U->pts));
+}
+
+void tglu_work_updates_to_long_new (struct tgl_state *TLS, int check_only, struct tl_ds_updates *DS_U) {
+ if (check_only > 0 || (TLS->locks & TGL_LOCK_DIFF)) {
+ return;
+ }
+ vlogprintf (E_NOTICE, "updates too long... Getting difference\n");
+ if (check_only) { return; }
+ tgl_do_get_difference (TLS, 0, 0, 0);
+}
+
+void tglu_work_update_short_new (struct tgl_state *TLS, int check_only, struct tl_ds_updates *DS_U) {
+ if (check_only > 0 || (TLS->locks & TGL_LOCK_DIFF)) {
+ return;
+ }
+ tglu_work_update_new (TLS, check_only, DS_U->update);
+}
+
+void tglu_work_any_updates_new (struct tgl_state *TLS, int check_only, struct tl_ds_updates *DS_U) {
+ if (check_only > 0 || (TLS->locks & TGL_LOCK_DIFF)) {
+ return;
+ }
+ switch (DS_U->magic) {
+ case CODE_updates_too_long:
+ tglu_work_updates_to_long_new (TLS, check_only, DS_U);
+ return;
+ case CODE_update_short_message:
+ tglu_work_update_short_message_new (TLS, check_only, DS_U);
+ return;
+ case CODE_update_short_chat_message:
+ tglu_work_update_short_chat_message_new (TLS, check_only, DS_U);
+ return;
+ case CODE_update_short:
+ tglu_work_update_short_new (TLS, check_only, DS_U);
+ return;
+ case CODE_updates_combined:
+ tglu_work_updates_combined_new (TLS, check_only, DS_U);
+ return;
+ case CODE_updates:
+ tglu_work_updates_new (TLS, check_only, DS_U);
+ return;
+ default:
+ assert (0);
+ }
+}
+
+void tglu_work_any_updates (struct tgl_state *TLS) {
+ struct tl_ds_updates *DS_U = fetch_ds_type_updates (TYPE_TO_PARAM (updates));
+ assert (DS_U);
+ tglu_work_any_updates_new (TLS, 1, DS_U);
+ tglu_work_any_updates_new (TLS, 0, DS_U);
+ free_ds_type_updates (DS_U, TYPE_TO_PARAM (updates));
+}
+
+#define user_cmp(a,b) (tgl_get_peer_id ((a)->id) - tgl_get_peer_id ((b)->id))
+DEFINE_TREE(user, struct tgl_user *,user_cmp,0)
+
+static void notify_status (struct tgl_user *U, void *ex) {
+ struct tgl_state *TLS = ex;
+ if (TLS->callback.user_status_update) {
+ TLS->callback.user_status_update (TLS, U);
+ }
+}
+
+static void status_notify (struct tgl_state *TLS, void *arg) {
+ tree_act_ex_user (TLS->online_updates, notify_status, TLS);
+ tree_clear_user (TLS->online_updates);
+ TLS->online_updates = NULL;
+ TLS->timer_methods->free (TLS->online_updates_timer);
+ TLS->online_updates_timer = NULL;
+}
+
+void tgl_insert_status_update (struct tgl_state *TLS, struct tgl_user *U) {
+ if (!tree_lookup_user (TLS->online_updates, U)) {
+ TLS->online_updates = tree_insert_user (TLS->online_updates, U, lrand48 ());
+ }
+ if (!TLS->online_updates_timer) {
+ TLS->online_updates_timer = TLS->timer_methods->alloc (TLS, status_notify, 0);
+ TLS->timer_methods->insert (TLS->online_updates_timer, 0);
+ }
+}
+
+static void user_expire (struct tgl_state *TLS, void *arg) {
+ struct tgl_user *U = arg;
+ TLS->timer_methods->free (U->status.ev);
+ U->status.ev = 0;
+ U->status.online = -1;
+ U->status.when = (int)tglt_get_double_time ();
+ tgl_insert_status_update (TLS, U);
+}
+
+void tgl_insert_status_expire (struct tgl_state *TLS, struct tgl_user *U) {
+ assert (!U->status.ev);
+ U->status.ev = TLS->timer_methods->alloc (TLS, user_expire, U);
+ TLS->timer_methods->insert (U->status.ev, U->status.when - tglt_get_double_time ());
+}
+
+void tgl_remove_status_expire (struct tgl_state *TLS, struct tgl_user *U) {
+ TLS->timer_methods->free (U->status.ev);
+ U->status.ev = 0;
+}
diff --git a/protocols/Telegram/tgl/updates.h b/protocols/Telegram/tgl/updates.h
new file mode 100644
index 0000000000..98f4654544
--- /dev/null
+++ b/protocols/Telegram/tgl/updates.h
@@ -0,0 +1,34 @@
+/*
+ This file is part of tgl-library
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Copyright Vitaly Valtman 2013-2015
+*/
+
+#ifndef __UPDATES_H__
+#define __UPDATES_H__
+struct tl_ds_updates;
+struct tl_ds_update;
+void tgl_insert_status_update (struct tgl_state *TLS, struct tgl_user *U);
+void tgl_insert_status_expire (struct tgl_state *TLS, struct tgl_user *U);
+void tgl_remove_status_expire (struct tgl_state *TLS, struct tgl_user *U);
+
+int tgl_check_pts_diff (struct tgl_state *TLS, int pts, int pts_count);
+void tglu_work_update_new (struct tgl_state *TLS, int check_only, struct tl_ds_update *DS_U);
+void tglu_work_updates_new (struct tgl_state *TLS, int check_only, struct tl_ds_updates *DS_U);
+void tglu_work_any_updates (struct tgl_state *TLS);
+void tglu_work_any_updates_new (struct tgl_state *TLS, int check_only, struct tl_ds_updates *DS_U);
+#endif
diff --git a/protocols/Telegram/tgl/zlib/CMakeLists.txt b/protocols/Telegram/tgl/zlib/CMakeLists.txt
new file mode 100644
index 0000000000..0c0247cc51
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/CMakeLists.txt
@@ -0,0 +1,249 @@
+cmake_minimum_required(VERSION 2.4.4)
+set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
+
+project(zlib C)
+
+set(VERSION "1.2.8")
+
+option(ASM686 "Enable building i686 assembly implementation")
+option(AMD64 "Enable building amd64 assembly implementation")
+
+set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
+set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries")
+set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation directory for headers")
+set(INSTALL_MAN_DIR "${CMAKE_INSTALL_PREFIX}/share/man" CACHE PATH "Installation directory for manual pages")
+set(INSTALL_PKGCONFIG_DIR "${CMAKE_INSTALL_PREFIX}/share/pkgconfig" CACHE PATH "Installation directory for pkgconfig (.pc) files")
+
+include(CheckTypeSize)
+include(CheckFunctionExists)
+include(CheckIncludeFile)
+include(CheckCSourceCompiles)
+enable_testing()
+
+check_include_file(sys/types.h HAVE_SYS_TYPES_H)
+check_include_file(stdint.h HAVE_STDINT_H)
+check_include_file(stddef.h HAVE_STDDEF_H)
+
+#
+# Check to see if we have large file support
+#
+set(CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE=1)
+# We add these other definitions here because CheckTypeSize.cmake
+# in CMake 2.4.x does not automatically do so and we want
+# compatibility with CMake 2.4.x.
+if(HAVE_SYS_TYPES_H)
+ list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_TYPES_H)
+endif()
+if(HAVE_STDINT_H)
+ list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDINT_H)
+endif()
+if(HAVE_STDDEF_H)
+ list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDDEF_H)
+endif()
+check_type_size(off64_t OFF64_T)
+if(HAVE_OFF64_T)
+ add_definitions(-D_LARGEFILE64_SOURCE=1)
+endif()
+set(CMAKE_REQUIRED_DEFINITIONS) # clear variable
+
+#
+# Check for fseeko
+#
+check_function_exists(fseeko HAVE_FSEEKO)
+if(NOT HAVE_FSEEKO)
+ add_definitions(-DNO_FSEEKO)
+endif()
+
+#
+# Check for unistd.h
+#
+check_include_file(unistd.h Z_HAVE_UNISTD_H)
+
+if(MSVC)
+ set(CMAKE_DEBUG_POSTFIX "d")
+ add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
+ add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+endif()
+
+if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
+ # If we're doing an out of source build and the user has a zconf.h
+ # in their source tree...
+ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h)
+ message(STATUS "Renaming")
+ message(STATUS " ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h")
+ message(STATUS "to 'zconf.h.included' because this file is included with zlib")
+ message(STATUS "but CMake generates it automatically in the build directory.")
+ file(RENAME ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.included)
+ endif()
+endif()
+
+set(ZLIB_PC ${CMAKE_CURRENT_BINARY_DIR}/zlib.pc)
+configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zlib.pc.cmakein
+ ${ZLIB_PC} @ONLY)
+configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein
+ ${CMAKE_CURRENT_BINARY_DIR}/zconf.h @ONLY)
+include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR})
+
+
+#============================================================================
+# zlib
+#============================================================================
+
+set(ZLIB_PUBLIC_HDRS
+ ${CMAKE_CURRENT_BINARY_DIR}/zconf.h
+ zlib.h
+)
+set(ZLIB_PRIVATE_HDRS
+ crc32.h
+ deflate.h
+ gzguts.h
+ inffast.h
+ inffixed.h
+ inflate.h
+ inftrees.h
+ trees.h
+ zutil.h
+)
+set(ZLIB_SRCS
+ adler32.c
+ compress.c
+ crc32.c
+ deflate.c
+ gzclose.c
+ gzlib.c
+ gzread.c
+ gzwrite.c
+ inflate.c
+ infback.c
+ inftrees.c
+ inffast.c
+ trees.c
+ uncompr.c
+ zutil.c
+)
+
+if(NOT MINGW)
+ set(ZLIB_DLL_SRCS
+ win32/zlib1.rc # If present will override custom build rule below.
+ )
+endif()
+
+if(CMAKE_COMPILER_IS_GNUCC)
+ if(ASM686)
+ set(ZLIB_ASMS contrib/asm686/match.S)
+ elseif (AMD64)
+ set(ZLIB_ASMS contrib/amd64/amd64-match.S)
+ endif ()
+
+ if(ZLIB_ASMS)
+ add_definitions(-DASMV)
+ set_source_files_properties(${ZLIB_ASMS} PROPERTIES LANGUAGE C COMPILE_FLAGS -DNO_UNDERLINE)
+ endif()
+endif()
+
+if(MSVC)
+ if(ASM686)
+ ENABLE_LANGUAGE(ASM_MASM)
+ set(ZLIB_ASMS
+ contrib/masmx86/inffas32.asm
+ contrib/masmx86/match686.asm
+ )
+ elseif (AMD64)
+ ENABLE_LANGUAGE(ASM_MASM)
+ set(ZLIB_ASMS
+ contrib/masmx64/gvmat64.asm
+ contrib/masmx64/inffasx64.asm
+ )
+ endif()
+
+ if(ZLIB_ASMS)
+ add_definitions(-DASMV -DASMINF)
+ endif()
+endif()
+
+# parse the full version number from zlib.h and include in ZLIB_FULL_VERSION
+file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents)
+string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*"
+ "\\1" ZLIB_FULL_VERSION ${_zlib_h_contents})
+
+if(MINGW)
+ # This gets us DLL resource information when compiling on MinGW.
+ if(NOT CMAKE_RC_COMPILER)
+ set(CMAKE_RC_COMPILER windres.exe)
+ endif()
+
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
+ COMMAND ${CMAKE_RC_COMPILER}
+ -D GCC_WINDRES
+ -I ${CMAKE_CURRENT_SOURCE_DIR}
+ -I ${CMAKE_CURRENT_BINARY_DIR}
+ -o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
+ -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc)
+ set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
+endif(MINGW)
+
+add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
+add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
+set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
+set_target_properties(zlib PROPERTIES SOVERSION 1)
+
+if(NOT CYGWIN)
+ # This property causes shared libraries on Linux to have the full version
+ # encoded into their final filename. We disable this on Cygwin because
+ # it causes cygz-${ZLIB_FULL_VERSION}.dll to be created when cygz.dll
+ # seems to be the default.
+ #
+ # This has no effect with MSVC, on that platform the version info for
+ # the DLL comes from the resource file win32/zlib1.rc
+ set_target_properties(zlib PROPERTIES VERSION ${ZLIB_FULL_VERSION})
+endif()
+
+if(UNIX)
+ # On unix-like platforms the library is almost always called libz
+ set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z)
+ if(NOT APPLE)
+ set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"")
+ endif()
+elseif(BUILD_SHARED_LIBS AND WIN32)
+ # Creates zlib1.dll when building shared library version
+ set_target_properties(zlib PROPERTIES SUFFIX "1.dll")
+endif()
+
+if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
+ install(TARGETS zlib zlibstatic
+ RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
+ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
+ LIBRARY DESTINATION "${INSTALL_LIB_DIR}" )
+endif()
+if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL )
+ install(FILES ${ZLIB_PUBLIC_HDRS} DESTINATION "${INSTALL_INC_DIR}")
+endif()
+if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL )
+ install(FILES zlib.3 DESTINATION "${INSTALL_MAN_DIR}/man3")
+endif()
+if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL )
+ install(FILES ${ZLIB_PC} DESTINATION "${INSTALL_PKGCONFIG_DIR}")
+endif()
+
+#============================================================================
+# Example binaries
+#============================================================================
+
+add_executable(example test/example.c)
+target_link_libraries(example zlib)
+add_test(example example)
+
+add_executable(minigzip test/minigzip.c)
+target_link_libraries(minigzip zlib)
+
+if(HAVE_OFF64_T)
+ add_executable(example64 test/example.c)
+ target_link_libraries(example64 zlib)
+ set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
+ add_test(example64 example64)
+
+ add_executable(minigzip64 test/minigzip.c)
+ target_link_libraries(minigzip64 zlib)
+ set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
+endif()
diff --git a/protocols/Telegram/tgl/zlib/ChangeLog b/protocols/Telegram/tgl/zlib/ChangeLog
new file mode 100644
index 0000000000..f22aabaef5
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/ChangeLog
@@ -0,0 +1,1472 @@
+
+ ChangeLog file for zlib
+
+Changes in 1.2.8 (28 Apr 2013)
+- Update contrib/minizip/iowin32.c for Windows RT [Vollant]
+- Do not force Z_CONST for C++
+- Clean up contrib/vstudio [Ro§]
+- Correct spelling error in zlib.h
+- Fix mixed line endings in contrib/vstudio
+
+Changes in 1.2.7.3 (13 Apr 2013)
+- Fix version numbers and DLL names in contrib/vstudio/*/zlib.rc
+
+Changes in 1.2.7.2 (13 Apr 2013)
+- Change check for a four-byte type back to hexadecimal
+- Fix typo in win32/Makefile.msc
+- Add casts in gzwrite.c for pointer differences
+
+Changes in 1.2.7.1 (24 Mar 2013)
+- Replace use of unsafe string functions with snprintf if available
+- Avoid including stddef.h on Windows for Z_SOLO compile [Niessink]
+- Fix gzgetc undefine when Z_PREFIX set [Turk]
+- Eliminate use of mktemp in Makefile (not always available)
+- Fix bug in 'F' mode for gzopen()
+- Add inflateGetDictionary() function
+- Correct comment in deflate.h
+- Use _snprintf for snprintf in Microsoft C
+- On Darwin, only use /usr/bin/libtool if libtool is not Apple
+- Delete "--version" file if created by "ar --version" [Richard G.]
+- Fix configure check for veracity of compiler error return codes
+- Fix CMake compilation of static lib for MSVC2010 x64
+- Remove unused variable in infback9.c
+- Fix argument checks in gzlog_compress() and gzlog_write()
+- Clean up the usage of z_const and respect const usage within zlib
+- Clean up examples/gzlog.[ch] comparisons of different types
+- Avoid shift equal to bits in type (caused endless loop)
+- Fix unintialized value bug in gzputc() introduced by const patches
+- Fix memory allocation error in examples/zran.c [Nor]
+- Fix bug where gzopen(), gzclose() would write an empty file
+- Fix bug in gzclose() when gzwrite() runs out of memory
+- Check for input buffer malloc failure in examples/gzappend.c
+- Add note to contrib/blast to use binary mode in stdio
+- Fix comparisons of differently signed integers in contrib/blast
+- Check for invalid code length codes in contrib/puff
+- Fix serious but very rare decompression bug in inftrees.c
+- Update inflateBack() comments, since inflate() can be faster
+- Use underscored I/O function names for WINAPI_FAMILY
+- Add _tr_flush_bits to the external symbols prefixed by --zprefix
+- Add contrib/vstudio/vc10 pre-build step for static only
+- Quote --version-script argument in CMakeLists.txt
+- Don't specify --version-script on Apple platforms in CMakeLists.txt
+- Fix casting error in contrib/testzlib/testzlib.c
+- Fix types in contrib/minizip to match result of get_crc_table()
+- Simplify contrib/vstudio/vc10 with 'd' suffix
+- Add TOP support to win32/Makefile.msc
+- Suport i686 and amd64 assembler builds in CMakeLists.txt
+- Fix typos in the use of _LARGEFILE64_SOURCE in zconf.h
+- Add vc11 and vc12 build files to contrib/vstudio
+- Add gzvprintf() as an undocumented function in zlib
+- Fix configure for Sun shell
+- Remove runtime check in configure for four-byte integer type
+- Add casts and consts to ease user conversion to C++
+- Add man pages for minizip and miniunzip
+- In Makefile uninstall, don't rm if preceding cd fails
+- Do not return Z_BUF_ERROR if deflateParam() has nothing to write
+
+Changes in 1.2.7 (2 May 2012)
+- Replace use of memmove() with a simple copy for portability
+- Test for existence of strerror
+- Restore gzgetc_ for backward compatibility with 1.2.6
+- Fix build with non-GNU make on Solaris
+- Require gcc 4.0 or later on Mac OS X to use the hidden attribute
+- Include unistd.h for Watcom C
+- Use __WATCOMC__ instead of __WATCOM__
+- Do not use the visibility attribute if NO_VIZ defined
+- Improve the detection of no hidden visibility attribute
+- Avoid using __int64 for gcc or solo compilation
+- Cast to char * in gzprintf to avoid warnings [Zinser]
+- Fix make_vms.com for VAX [Zinser]
+- Don't use library or built-in byte swaps
+- Simplify test and use of gcc hidden attribute
+- Fix bug in gzclose_w() when gzwrite() fails to allocate memory
+- Add "x" (O_EXCL) and "e" (O_CLOEXEC) modes support to gzopen()
+- Fix bug in test/minigzip.c for configure --solo
+- Fix contrib/vstudio project link errors [Mohanathas]
+- Add ability to choose the builder in make_vms.com [Schweda]
+- Add DESTDIR support to mingw32 win32/Makefile.gcc
+- Fix comments in win32/Makefile.gcc for proper usage
+- Allow overriding the default install locations for cmake
+- Generate and install the pkg-config file with cmake
+- Build both a static and a shared version of zlib with cmake
+- Include version symbols for cmake builds
+- If using cmake with MSVC, add the source directory to the includes
+- Remove unneeded EXTRA_CFLAGS from win32/Makefile.gcc [Truta]
+- Move obsolete emx makefile to old [Truta]
+- Allow the use of -Wundef when compiling or using zlib
+- Avoid the use of the -u option with mktemp
+- Improve inflate() documentation on the use of Z_FINISH
+- Recognize clang as gcc
+- Add gzopen_w() in Windows for wide character path names
+- Rename zconf.h in CMakeLists.txt to move it out of the way
+- Add source directory in CMakeLists.txt for building examples
+- Look in build directory for zlib.pc in CMakeLists.txt
+- Remove gzflags from zlibvc.def in vc9 and vc10
+- Fix contrib/minizip compilation in the MinGW environment
+- Update ./configure for Solaris, support --64 [Mooney]
+- Remove -R. from Solaris shared build (possible security issue)
+- Avoid race condition for parallel make (-j) running example
+- Fix type mismatch between get_crc_table() and crc_table
+- Fix parsing of version with "-" in CMakeLists.txt [Snider, Ziegler]
+- Fix the path to zlib.map in CMakeLists.txt
+- Force the native libtool in Mac OS X to avoid GNU libtool [Beebe]
+- Add instructions to win32/Makefile.gcc for shared install [Torri]
+
+Changes in 1.2.6.1 (12 Feb 2012)
+- Avoid the use of the Objective-C reserved name "id"
+- Include io.h in gzguts.h for Microsoft compilers
+- Fix problem with ./configure --prefix and gzgetc macro
+- Include gz_header definition when compiling zlib solo
+- Put gzflags() functionality back in zutil.c
+- Avoid library header include in crc32.c for Z_SOLO
+- Use name in GCC_CLASSIC as C compiler for coverage testing, if set
+- Minor cleanup in contrib/minizip/zip.c [Vollant]
+- Update make_vms.com [Zinser]
+- Remove unnecessary gzgetc_ function
+- Use optimized byte swap operations for Microsoft and GNU [Snyder]
+- Fix minor typo in zlib.h comments [Rzesniowiecki]
+
+Changes in 1.2.6 (29 Jan 2012)
+- Update the Pascal interface in contrib/pascal
+- Fix function numbers for gzgetc_ in zlibvc.def files
+- Fix configure.ac for contrib/minizip [Schiffer]
+- Fix large-entry detection in minizip on 64-bit systems [Schiffer]
+- Have ./configure use the compiler return code for error indication
+- Fix CMakeLists.txt for cross compilation [McClure]
+- Fix contrib/minizip/zip.c for 64-bit architectures [Dalsnes]
+- Fix compilation of contrib/minizip on FreeBSD [Marquez]
+- Correct suggested usages in win32/Makefile.msc [Shachar, Horvath]
+- Include io.h for Turbo C / Borland C on all platforms [Truta]
+- Make version explicit in contrib/minizip/configure.ac [Bosmans]
+- Avoid warning for no encryption in contrib/minizip/zip.c [Vollant]
+- Minor cleanup up contrib/minizip/unzip.c [Vollant]
+- Fix bug when compiling minizip with C++ [Vollant]
+- Protect for long name and extra fields in contrib/minizip [Vollant]
+- Avoid some warnings in contrib/minizip [Vollant]
+- Add -I../.. -L../.. to CFLAGS for minizip and miniunzip
+- Add missing libs to minizip linker command
+- Add support for VPATH builds in contrib/minizip
+- Add an --enable-demos option to contrib/minizip/configure
+- Add the generation of configure.log by ./configure
+- Exit when required parameters not provided to win32/Makefile.gcc
+- Have gzputc return the character written instead of the argument
+- Use the -m option on ldconfig for BSD systems [Tobias]
+- Correct in zlib.map when deflateResetKeep was added
+
+Changes in 1.2.5.3 (15 Jan 2012)
+- Restore gzgetc function for binary compatibility
+- Do not use _lseeki64 under Borland C++ [Truta]
+- Update win32/Makefile.msc to build test/*.c [Truta]
+- Remove old/visualc6 given CMakefile and other alternatives
+- Update AS400 build files and documentation [Monnerat]
+- Update win32/Makefile.gcc to build test/*.c [Truta]
+- Permit stronger flushes after Z_BLOCK flushes
+- Avoid extraneous empty blocks when doing empty flushes
+- Permit Z_NULL arguments to deflatePending
+- Allow deflatePrime() to insert bits in the middle of a stream
+- Remove second empty static block for Z_PARTIAL_FLUSH
+- Write out all of the available bits when using Z_BLOCK
+- Insert the first two strings in the hash table after a flush
+
+Changes in 1.2.5.2 (17 Dec 2011)
+- fix ld error: unable to find version dependency 'ZLIB_1.2.5'
+- use relative symlinks for shared libs
+- Avoid searching past window for Z_RLE strategy
+- Assure that high-water mark initialization is always applied in deflate
+- Add assertions to fill_window() in deflate.c to match comments
+- Update python link in README
+- Correct spelling error in gzread.c
+- Fix bug in gzgets() for a concatenated empty gzip stream
+- Correct error in comment for gz_make()
+- Change gzread() and related to ignore junk after gzip streams
+- Allow gzread() and related to continue after gzclearerr()
+- Allow gzrewind() and gzseek() after a premature end-of-file
+- Simplify gzseek() now that raw after gzip is ignored
+- Change gzgetc() to a macro for speed (~40% speedup in testing)
+- Fix gzclose() to return the actual error last encountered
+- Always add large file support for windows
+- Include zconf.h for windows large file support
+- Include zconf.h.cmakein for windows large file support
+- Update zconf.h.cmakein on make distclean
+- Merge vestigial vsnprintf determination from zutil.h to gzguts.h
+- Clarify how gzopen() appends in zlib.h comments
+- Correct documentation of gzdirect() since junk at end now ignored
+- Add a transparent write mode to gzopen() when 'T' is in the mode
+- Update python link in zlib man page
+- Get inffixed.h and MAKEFIXED result to match
+- Add a ./config --solo option to make zlib subset with no libary use
+- Add undocumented inflateResetKeep() function for CAB file decoding
+- Add --cover option to ./configure for gcc coverage testing
+- Add #define ZLIB_CONST option to use const in the z_stream interface
+- Add comment to gzdopen() in zlib.h to use dup() when using fileno()
+- Note behavior of uncompress() to provide as much data as it can
+- Add files in contrib/minizip to aid in building libminizip
+- Split off AR options in Makefile.in and configure
+- Change ON macro to Z_ARG to avoid application conflicts
+- Facilitate compilation with Borland C++ for pragmas and vsnprintf
+- Include io.h for Turbo C / Borland C++
+- Move example.c and minigzip.c to test/
+- Simplify incomplete code table filling in inflate_table()
+- Remove code from inflate.c and infback.c that is impossible to execute
+- Test the inflate code with full coverage
+- Allow deflateSetDictionary, inflateSetDictionary at any time (in raw)
+- Add deflateResetKeep and fix inflateResetKeep to retain dictionary
+- Fix gzwrite.c to accommodate reduced memory zlib compilation
+- Have inflate() with Z_FINISH avoid the allocation of a window
+- Do not set strm->adler when doing raw inflate
+- Fix gzeof() to behave just like feof() when read is not past end of file
+- Fix bug in gzread.c when end-of-file is reached
+- Avoid use of Z_BUF_ERROR in gz* functions except for premature EOF
+- Document gzread() capability to read concurrently written files
+- Remove hard-coding of resource compiler in CMakeLists.txt [Blammo]
+
+Changes in 1.2.5.1 (10 Sep 2011)
+- Update FAQ entry on shared builds (#13)
+- Avoid symbolic argument to chmod in Makefile.in
+- Fix bug and add consts in contrib/puff [Oberhumer]
+- Update contrib/puff/zeros.raw test file to have all block types
+- Add full coverage test for puff in contrib/puff/Makefile
+- Fix static-only-build install in Makefile.in
+- Fix bug in unzGetCurrentFileInfo() in contrib/minizip [Kuno]
+- Add libz.a dependency to shared in Makefile.in for parallel builds
+- Spell out "number" (instead of "nb") in zlib.h for total_in, total_out
+- Replace $(...) with `...` in configure for non-bash sh [Bowler]
+- Add darwin* to Darwin* and solaris* to SunOS\ 5* in configure [Groffen]
+- Add solaris* to Linux* in configure to allow gcc use [Groffen]
+- Add *bsd* to Linux* case in configure [Bar-Lev]
+- Add inffast.obj to dependencies in win32/Makefile.msc
+- Correct spelling error in deflate.h [Kohler]
+- Change libzdll.a again to libz.dll.a (!) in win32/Makefile.gcc
+- Add test to configure for GNU C looking for gcc in output of $cc -v
+- Add zlib.pc generation to win32/Makefile.gcc [Weigelt]
+- Fix bug in zlib.h for _FILE_OFFSET_BITS set and _LARGEFILE64_SOURCE not
+- Add comment in zlib.h that adler32_combine with len2 < 0 makes no sense
+- Make NO_DIVIDE option in adler32.c much faster (thanks to John Reiser)
+- Make stronger test in zconf.h to include unistd.h for LFS
+- Apply Darwin patches for 64-bit file offsets to contrib/minizip [Slack]
+- Fix zlib.h LFS support when Z_PREFIX used
+- Add updated as400 support (removed from old) [Monnerat]
+- Avoid deflate sensitivity to volatile input data
+- Avoid division in adler32_combine for NO_DIVIDE
+- Clarify the use of Z_FINISH with deflateBound() amount of space
+- Set binary for output file in puff.c
+- Use u4 type for crc_table to avoid conversion warnings
+- Apply casts in zlib.h to avoid conversion warnings
+- Add OF to prototypes for adler32_combine_ and crc32_combine_ [Miller]
+- Improve inflateSync() documentation to note indeterminancy
+- Add deflatePending() function to return the amount of pending output
+- Correct the spelling of "specification" in FAQ [Randers-Pehrson]
+- Add a check in configure for stdarg.h, use for gzprintf()
+- Check that pointers fit in ints when gzprint() compiled old style
+- Add dummy name before $(SHAREDLIBV) in Makefile [Bar-Lev, Bowler]
+- Delete line in configure that adds -L. libz.a to LDFLAGS [Weigelt]
+- Add debug records in assmebler code [Londer]
+- Update RFC references to use http://tools.ietf.org/html/... [Li]
+- Add --archs option, use of libtool to configure for Mac OS X [Borstel]
+
+Changes in 1.2.5 (19 Apr 2010)
+- Disable visibility attribute in win32/Makefile.gcc [Bar-Lev]
+- Default to libdir as sharedlibdir in configure [Nieder]
+- Update copyright dates on modified source files
+- Update trees.c to be able to generate modified trees.h
+- Exit configure for MinGW, suggesting win32/Makefile.gcc
+- Check for NULL path in gz_open [Homurlu]
+
+Changes in 1.2.4.5 (18 Apr 2010)
+- Set sharedlibdir in configure [Torok]
+- Set LDFLAGS in Makefile.in [Bar-Lev]
+- Avoid mkdir objs race condition in Makefile.in [Bowler]
+- Add ZLIB_INTERNAL in front of internal inter-module functions and arrays
+- Define ZLIB_INTERNAL to hide internal functions and arrays for GNU C
+- Don't use hidden attribute when it is a warning generator (e.g. Solaris)
+
+Changes in 1.2.4.4 (18 Apr 2010)
+- Fix CROSS_PREFIX executable testing, CHOST extract, mingw* [Torok]
+- Undefine _LARGEFILE64_SOURCE in zconf.h if it is zero, but not if empty
+- Try to use bash or ksh regardless of functionality of /bin/sh
+- Fix configure incompatibility with NetBSD sh
+- Remove attempt to run under bash or ksh since have better NetBSD fix
+- Fix win32/Makefile.gcc for MinGW [Bar-Lev]
+- Add diagnostic messages when using CROSS_PREFIX in configure
+- Added --sharedlibdir option to configure [Weigelt]
+- Use hidden visibility attribute when available [Frysinger]
+
+Changes in 1.2.4.3 (10 Apr 2010)
+- Only use CROSS_PREFIX in configure for ar and ranlib if they exist
+- Use CROSS_PREFIX for nm [Bar-Lev]
+- Assume _LARGEFILE64_SOURCE defined is equivalent to true
+- Avoid use of undefined symbols in #if with && and ||
+- Make *64 prototypes in gzguts.h consistent with functions
+- Add -shared load option for MinGW in configure [Bowler]
+- Move z_off64_t to public interface, use instead of off64_t
+- Remove ! from shell test in configure (not portable to Solaris)
+- Change +0 macro tests to -0 for possibly increased portability
+
+Changes in 1.2.4.2 (9 Apr 2010)
+- Add consistent carriage returns to readme.txt's in masmx86 and masmx64
+- Really provide prototypes for *64 functions when building without LFS
+- Only define unlink() in minigzip.c if unistd.h not included
+- Update README to point to contrib/vstudio project files
+- Move projects/vc6 to old/ and remove projects/
+- Include stdlib.h in minigzip.c for setmode() definition under WinCE
+- Clean up assembler builds in win32/Makefile.msc [Rowe]
+- Include sys/types.h for Microsoft for off_t definition
+- Fix memory leak on error in gz_open()
+- Symbolize nm as $NM in configure [Weigelt]
+- Use TEST_LDSHARED instead of LDSHARED to link test programs [Weigelt]
+- Add +0 to _FILE_OFFSET_BITS and _LFS64_LARGEFILE in case not defined
+- Fix bug in gzeof() to take into account unused input data
+- Avoid initialization of structures with variables in puff.c
+- Updated win32/README-WIN32.txt [Rowe]
+
+Changes in 1.2.4.1 (28 Mar 2010)
+- Remove the use of [a-z] constructs for sed in configure [gentoo 310225]
+- Remove $(SHAREDLIB) from LIBS in Makefile.in [Creech]
+- Restore "for debugging" comment on sprintf() in gzlib.c
+- Remove fdopen for MVS from gzguts.h
+- Put new README-WIN32.txt in win32 [Rowe]
+- Add check for shell to configure and invoke another shell if needed
+- Fix big fat stinking bug in gzseek() on uncompressed files
+- Remove vestigial F_OPEN64 define in zutil.h
+- Set and check the value of _LARGEFILE_SOURCE and _LARGEFILE64_SOURCE
+- Avoid errors on non-LFS systems when applications define LFS macros
+- Set EXE to ".exe" in configure for MINGW [Kahle]
+- Match crc32() in crc32.c exactly to the prototype in zlib.h [Sherrill]
+- Add prefix for cross-compilation in win32/makefile.gcc [Bar-Lev]
+- Add DLL install in win32/makefile.gcc [Bar-Lev]
+- Allow Linux* or linux* from uname in configure [Bar-Lev]
+- Allow ldconfig to be redefined in configure and Makefile.in [Bar-Lev]
+- Add cross-compilation prefixes to configure [Bar-Lev]
+- Match type exactly in gz_load() invocation in gzread.c
+- Match type exactly of zcalloc() in zutil.c to zlib.h alloc_func
+- Provide prototypes for *64 functions when building zlib without LFS
+- Don't use -lc when linking shared library on MinGW
+- Remove errno.h check in configure and vestigial errno code in zutil.h
+
+Changes in 1.2.4 (14 Mar 2010)
+- Fix VER3 extraction in configure for no fourth subversion
+- Update zlib.3, add docs to Makefile.in to make .pdf out of it
+- Add zlib.3.pdf to distribution
+- Don't set error code in gzerror() if passed pointer is NULL
+- Apply destination directory fixes to CMakeLists.txt [Lowman]
+- Move #cmakedefine's to a new zconf.in.cmakein
+- Restore zconf.h for builds that don't use configure or cmake
+- Add distclean to dummy Makefile for convenience
+- Update and improve INDEX, README, and FAQ
+- Update CMakeLists.txt for the return of zconf.h [Lowman]
+- Update contrib/vstudio/vc9 and vc10 [Vollant]
+- Change libz.dll.a back to libzdll.a in win32/Makefile.gcc
+- Apply license and readme changes to contrib/asm686 [Raiter]
+- Check file name lengths and add -c option in minigzip.c [Li]
+- Update contrib/amd64 and contrib/masmx86/ [Vollant]
+- Avoid use of "eof" parameter in trees.c to not shadow library variable
+- Update make_vms.com for removal of zlibdefs.h [Zinser]
+- Update assembler code and vstudio projects in contrib [Vollant]
+- Remove outdated assembler code contrib/masm686 and contrib/asm586
+- Remove old vc7 and vc8 from contrib/vstudio
+- Update win32/Makefile.msc, add ZLIB_VER_SUBREVISION [Rowe]
+- Fix memory leaks in gzclose_r() and gzclose_w(), file leak in gz_open()
+- Add contrib/gcc_gvmat64 for longest_match and inflate_fast [Vollant]
+- Remove *64 functions from win32/zlib.def (they're not 64-bit yet)
+- Fix bug in void-returning vsprintf() case in gzwrite.c
+- Fix name change from inflate.h in contrib/inflate86/inffas86.c
+- Check if temporary file exists before removing in make_vms.com [Zinser]
+- Fix make install and uninstall for --static option
+- Fix usage of _MSC_VER in gzguts.h and zutil.h [Truta]
+- Update readme.txt in contrib/masmx64 and masmx86 to assemble
+
+Changes in 1.2.3.9 (21 Feb 2010)
+- Expunge gzio.c
+- Move as400 build information to old
+- Fix updates in contrib/minizip and contrib/vstudio
+- Add const to vsnprintf test in configure to avoid warnings [Weigelt]
+- Delete zconf.h (made by configure) [Weigelt]
+- Change zconf.in.h to zconf.h.in per convention [Weigelt]
+- Check for NULL buf in gzgets()
+- Return empty string for gzgets() with len == 1 (like fgets())
+- Fix description of gzgets() in zlib.h for end-of-file, NULL return
+- Update minizip to 1.1 [Vollant]
+- Avoid MSVC loss of data warnings in gzread.c, gzwrite.c
+- Note in zlib.h that gzerror() should be used to distinguish from EOF
+- Remove use of snprintf() from gzlib.c
+- Fix bug in gzseek()
+- Update contrib/vstudio, adding vc9 and vc10 [Kuno, Vollant]
+- Fix zconf.h generation in CMakeLists.txt [Lowman]
+- Improve comments in zconf.h where modified by configure
+
+Changes in 1.2.3.8 (13 Feb 2010)
+- Clean up text files (tabs, trailing whitespace, etc.) [Oberhumer]
+- Use z_off64_t in gz_zero() and gz_skip() to match state->skip
+- Avoid comparison problem when sizeof(int) == sizeof(z_off64_t)
+- Revert to Makefile.in from 1.2.3.6 (live with the clutter)
+- Fix missing error return in gzflush(), add zlib.h note
+- Add *64 functions to zlib.map [Levin]
+- Fix signed/unsigned comparison in gz_comp()
+- Use SFLAGS when testing shared linking in configure
+- Add --64 option to ./configure to use -m64 with gcc
+- Fix ./configure --help to correctly name options
+- Have make fail if a test fails [Levin]
+- Avoid buffer overrun in contrib/masmx64/gvmat64.asm [Simpson]
+- Remove assembler object files from contrib
+
+Changes in 1.2.3.7 (24 Jan 2010)
+- Always gzopen() with O_LARGEFILE if available
+- Fix gzdirect() to work immediately after gzopen() or gzdopen()
+- Make gzdirect() more precise when the state changes while reading
+- Improve zlib.h documentation in many places
+- Catch memory allocation failure in gz_open()
+- Complete close operation if seek forward in gzclose_w() fails
+- Return Z_ERRNO from gzclose_r() if close() fails
+- Return Z_STREAM_ERROR instead of EOF for gzclose() being passed NULL
+- Return zero for gzwrite() errors to match zlib.h description
+- Return -1 on gzputs() error to match zlib.h description
+- Add zconf.in.h to allow recovery from configure modification [Weigelt]
+- Fix static library permissions in Makefile.in [Weigelt]
+- Avoid warnings in configure tests that hide functionality [Weigelt]
+- Add *BSD and DragonFly to Linux case in configure [gentoo 123571]
+- Change libzdll.a to libz.dll.a in win32/Makefile.gcc [gentoo 288212]
+- Avoid access of uninitialized data for first inflateReset2 call [Gomes]
+- Keep object files in subdirectories to reduce the clutter somewhat
+- Remove default Makefile and zlibdefs.h, add dummy Makefile
+- Add new external functions to Z_PREFIX, remove duplicates, z_z_ -> z_
+- Remove zlibdefs.h completely -- modify zconf.h instead
+
+Changes in 1.2.3.6 (17 Jan 2010)
+- Avoid void * arithmetic in gzread.c and gzwrite.c
+- Make compilers happier with const char * for gz_error message
+- Avoid unused parameter warning in inflate.c
+- Avoid signed-unsigned comparison warning in inflate.c
+- Indent #pragma's for traditional C
+- Fix usage of strwinerror() in glib.c, change to gz_strwinerror()
+- Correct email address in configure for system options
+- Update make_vms.com and add make_vms.com to contrib/minizip [Zinser]
+- Update zlib.map [Brown]
+- Fix Makefile.in for Solaris 10 make of example64 and minizip64 [Torok]
+- Apply various fixes to CMakeLists.txt [Lowman]
+- Add checks on len in gzread() and gzwrite()
+- Add error message for no more room for gzungetc()
+- Remove zlib version check in gzwrite()
+- Defer compression of gzprintf() result until need to
+- Use snprintf() in gzdopen() if available
+- Remove USE_MMAP configuration determination (only used by minigzip)
+- Remove examples/pigz.c (available separately)
+- Update examples/gun.c to 1.6
+
+Changes in 1.2.3.5 (8 Jan 2010)
+- Add space after #if in zutil.h for some compilers
+- Fix relatively harmless bug in deflate_fast() [Exarevsky]
+- Fix same problem in deflate_slow()
+- Add $(SHAREDLIBV) to LIBS in Makefile.in [Brown]
+- Add deflate_rle() for faster Z_RLE strategy run-length encoding
+- Add deflate_huff() for faster Z_HUFFMAN_ONLY encoding
+- Change name of "write" variable in inffast.c to avoid library collisions
+- Fix premature EOF from gzread() in gzio.c [Brown]
+- Use zlib header window size if windowBits is 0 in inflateInit2()
+- Remove compressBound() call in deflate.c to avoid linking compress.o
+- Replace use of errno in gz* with functions, support WinCE [Alves]
+- Provide alternative to perror() in minigzip.c for WinCE [Alves]
+- Don't use _vsnprintf on later versions of MSVC [Lowman]
+- Add CMake build script and input file [Lowman]
+- Update contrib/minizip to 1.1 [Svensson, Vollant]
+- Moved nintendods directory from contrib to .
+- Replace gzio.c with a new set of routines with the same functionality
+- Add gzbuffer(), gzoffset(), gzclose_r(), gzclose_w() as part of above
+- Update contrib/minizip to 1.1b
+- Change gzeof() to return 0 on error instead of -1 to agree with zlib.h
+
+Changes in 1.2.3.4 (21 Dec 2009)
+- Use old school .SUFFIXES in Makefile.in for FreeBSD compatibility
+- Update comments in configure and Makefile.in for default --shared
+- Fix test -z's in configure [Marquess]
+- Build examplesh and minigzipsh when not testing
+- Change NULL's to Z_NULL's in deflate.c and in comments in zlib.h
+- Import LDFLAGS from the environment in configure
+- Fix configure to populate SFLAGS with discovered CFLAGS options
+- Adapt make_vms.com to the new Makefile.in [Zinser]
+- Add zlib2ansi script for C++ compilation [Marquess]
+- Add _FILE_OFFSET_BITS=64 test to make test (when applicable)
+- Add AMD64 assembler code for longest match to contrib [Teterin]
+- Include options from $SFLAGS when doing $LDSHARED
+- Simplify 64-bit file support by introducing z_off64_t type
+- Make shared object files in objs directory to work around old Sun cc
+- Use only three-part version number for Darwin shared compiles
+- Add rc option to ar in Makefile.in for when ./configure not run
+- Add -WI,-rpath,. to LDFLAGS for OSF 1 V4*
+- Set LD_LIBRARYN32_PATH for SGI IRIX shared compile
+- Protect against _FILE_OFFSET_BITS being defined when compiling zlib
+- Rename Makefile.in targets allstatic to static and allshared to shared
+- Fix static and shared Makefile.in targets to be independent
+- Correct error return bug in gz_open() by setting state [Brown]
+- Put spaces before ;;'s in configure for better sh compatibility
+- Add pigz.c (parallel implementation of gzip) to examples/
+- Correct constant in crc32.c to UL [Leventhal]
+- Reject negative lengths in crc32_combine()
+- Add inflateReset2() function to work like inflateEnd()/inflateInit2()
+- Include sys/types.h for _LARGEFILE64_SOURCE [Brown]
+- Correct typo in doc/algorithm.txt [Janik]
+- Fix bug in adler32_combine() [Zhu]
+- Catch missing-end-of-block-code error in all inflates and in puff
+ Assures that random input to inflate eventually results in an error
+- Added enough.c (calculation of ENOUGH for inftrees.h) to examples/
+- Update ENOUGH and its usage to reflect discovered bounds
+- Fix gzerror() error report on empty input file [Brown]
+- Add ush casts in trees.c to avoid pedantic runtime errors
+- Fix typo in zlib.h uncompress() description [Reiss]
+- Correct inflate() comments with regard to automatic header detection
+- Remove deprecation comment on Z_PARTIAL_FLUSH (it stays)
+- Put new version of gzlog (2.0) in examples with interruption recovery
+- Add puff compile option to permit invalid distance-too-far streams
+- Add puff TEST command options, ability to read piped input
+- Prototype the *64 functions in zlib.h when _FILE_OFFSET_BITS == 64, but
+ _LARGEFILE64_SOURCE not defined
+- Fix Z_FULL_FLUSH to truly erase the past by resetting s->strstart
+- Fix deflateSetDictionary() to use all 32K for output consistency
+- Remove extraneous #define MIN_LOOKAHEAD in deflate.c (in deflate.h)
+- Clear bytes after deflate lookahead to avoid use of uninitialized data
+- Change a limit in inftrees.c to be more transparent to Coverity Prevent
+- Update win32/zlib.def with exported symbols from zlib.h
+- Correct spelling errors in zlib.h [Willem, Sobrado]
+- Allow Z_BLOCK for deflate() to force a new block
+- Allow negative bits in inflatePrime() to delete existing bit buffer
+- Add Z_TREES flush option to inflate() to return at end of trees
+- Add inflateMark() to return current state information for random access
+- Add Makefile for NintendoDS to contrib [Costa]
+- Add -w in configure compile tests to avoid spurious warnings [Beucler]
+- Fix typos in zlib.h comments for deflateSetDictionary()
+- Fix EOF detection in transparent gzread() [Maier]
+
+Changes in 1.2.3.3 (2 October 2006)
+- Make --shared the default for configure, add a --static option
+- Add compile option to permit invalid distance-too-far streams
+- Add inflateUndermine() function which is required to enable above
+- Remove use of "this" variable name for C++ compatibility [Marquess]
+- Add testing of shared library in make test, if shared library built
+- Use ftello() and fseeko() if available instead of ftell() and fseek()
+- Provide two versions of all functions that use the z_off_t type for
+ binary compatibility -- a normal version and a 64-bit offset version,
+ per the Large File Support Extension when _LARGEFILE64_SOURCE is
+ defined; use the 64-bit versions by default when _FILE_OFFSET_BITS
+ is defined to be 64
+- Add a --uname= option to configure to perhaps help with cross-compiling
+
+Changes in 1.2.3.2 (3 September 2006)
+- Turn off silly Borland warnings [Hay]
+- Use off64_t and define _LARGEFILE64_SOURCE when present
+- Fix missing dependency on inffixed.h in Makefile.in
+- Rig configure --shared to build both shared and static [Teredesai, Truta]
+- Remove zconf.in.h and instead create a new zlibdefs.h file
+- Fix contrib/minizip/unzip.c non-encrypted after encrypted [Vollant]
+- Add treebuild.xml (see http://treebuild.metux.de/) [Weigelt]
+
+Changes in 1.2.3.1 (16 August 2006)
+- Add watcom directory with OpenWatcom make files [Daniel]
+- Remove #undef of FAR in zconf.in.h for MVS [Fedtke]
+- Update make_vms.com [Zinser]
+- Use -fPIC for shared build in configure [Teredesai, Nicholson]
+- Use only major version number for libz.so on IRIX and OSF1 [Reinholdtsen]
+- Use fdopen() (not _fdopen()) for Interix in zutil.h [BŠck]
+- Add some FAQ entries about the contrib directory
+- Update the MVS question in the FAQ
+- Avoid extraneous reads after EOF in gzio.c [Brown]
+- Correct spelling of "successfully" in gzio.c [Randers-Pehrson]
+- Add comments to zlib.h about gzerror() usage [Brown]
+- Set extra flags in gzip header in gzopen() like deflate() does
+- Make configure options more compatible with double-dash conventions
+ [Weigelt]
+- Clean up compilation under Solaris SunStudio cc [Rowe, Reinholdtsen]
+- Fix uninstall target in Makefile.in [Truta]
+- Add pkgconfig support [Weigelt]
+- Use $(DESTDIR) macro in Makefile.in [Reinholdtsen, Weigelt]
+- Replace set_data_type() with a more accurate detect_data_type() in
+ trees.c, according to the txtvsbin.txt document [Truta]
+- Swap the order of #include <stdio.h> and #include "zlib.h" in
+ gzio.c, example.c and minigzip.c [Truta]
+- Shut up annoying VS2005 warnings about standard C deprecation [Rowe,
+ Truta] (where?)
+- Fix target "clean" from win32/Makefile.bor [Truta]
+- Create .pdb and .manifest files in win32/makefile.msc [Ziegler, Rowe]
+- Update zlib www home address in win32/DLL_FAQ.txt [Truta]
+- Update contrib/masmx86/inffas32.asm for VS2005 [Vollant, Van Wassenhove]
+- Enable browse info in the "Debug" and "ASM Debug" configurations in
+ the Visual C++ 6 project, and set (non-ASM) "Debug" as default [Truta]
+- Add pkgconfig support [Weigelt]
+- Add ZLIB_VER_MAJOR, ZLIB_VER_MINOR and ZLIB_VER_REVISION in zlib.h,
+ for use in win32/zlib1.rc [Polushin, Rowe, Truta]
+- Add a document that explains the new text detection scheme to
+ doc/txtvsbin.txt [Truta]
+- Add rfc1950.txt, rfc1951.txt and rfc1952.txt to doc/ [Truta]
+- Move algorithm.txt into doc/ [Truta]
+- Synchronize FAQ with website
+- Fix compressBound(), was low for some pathological cases [Fearnley]
+- Take into account wrapper variations in deflateBound()
+- Set examples/zpipe.c input and output to binary mode for Windows
+- Update examples/zlib_how.html with new zpipe.c (also web site)
+- Fix some warnings in examples/gzlog.c and examples/zran.c (it seems
+ that gcc became pickier in 4.0)
+- Add zlib.map for Linux: "All symbols from zlib-1.1.4 remain
+ un-versioned, the patch adds versioning only for symbols introduced in
+ zlib-1.2.0 or later. It also declares as local those symbols which are
+ not designed to be exported." [Levin]
+- Update Z_PREFIX list in zconf.in.h, add --zprefix option to configure
+- Do not initialize global static by default in trees.c, add a response
+ NO_INIT_GLOBAL_POINTERS to initialize them if needed [Marquess]
+- Don't use strerror() in gzio.c under WinCE [Yakimov]
+- Don't use errno.h in zutil.h under WinCE [Yakimov]
+- Move arguments for AR to its usage to allow replacing ar [Marot]
+- Add HAVE_VISIBILITY_PRAGMA in zconf.in.h for Mozilla [Randers-Pehrson]
+- Improve inflateInit() and inflateInit2() documentation
+- Fix structure size comment in inflate.h
+- Change configure help option from --h* to --help [Santos]
+
+Changes in 1.2.3 (18 July 2005)
+- Apply security vulnerability fixes to contrib/infback9 as well
+- Clean up some text files (carriage returns, trailing space)
+- Update testzlib, vstudio, masmx64, and masmx86 in contrib [Vollant]
+
+Changes in 1.2.2.4 (11 July 2005)
+- Add inflatePrime() function for starting inflation at bit boundary
+- Avoid some Visual C warnings in deflate.c
+- Avoid more silly Visual C warnings in inflate.c and inftrees.c for 64-bit
+ compile
+- Fix some spelling errors in comments [Betts]
+- Correct inflateInit2() error return documentation in zlib.h
+- Add zran.c example of compressed data random access to examples
+ directory, shows use of inflatePrime()
+- Fix cast for assignments to strm->state in inflate.c and infback.c
+- Fix zlibCompileFlags() in zutil.c to use 1L for long shifts [Oberhumer]
+- Move declarations of gf2 functions to right place in crc32.c [Oberhumer]
+- Add cast in trees.c t avoid a warning [Oberhumer]
+- Avoid some warnings in fitblk.c, gun.c, gzjoin.c in examples [Oberhumer]
+- Update make_vms.com [Zinser]
+- Initialize state->write in inflateReset() since copied in inflate_fast()
+- Be more strict on incomplete code sets in inflate_table() and increase
+ ENOUGH and MAXD -- this repairs a possible security vulnerability for
+ invalid inflate input. Thanks to Tavis Ormandy and Markus Oberhumer for
+ discovering the vulnerability and providing test cases.
+- Add ia64 support to configure for HP-UX [Smith]
+- Add error return to gzread() for format or i/o error [Levin]
+- Use malloc.h for OS/2 [Necasek]
+
+Changes in 1.2.2.3 (27 May 2005)
+- Replace 1U constants in inflate.c and inftrees.c for 64-bit compile
+- Typecast fread() return values in gzio.c [Vollant]
+- Remove trailing space in minigzip.c outmode (VC++ can't deal with it)
+- Fix crc check bug in gzread() after gzungetc() [Heiner]
+- Add the deflateTune() function to adjust internal compression parameters
+- Add a fast gzip decompressor, gun.c, to examples (use of inflateBack)
+- Remove an incorrect assertion in examples/zpipe.c
+- Add C++ wrapper in infback9.h [Donais]
+- Fix bug in inflateCopy() when decoding fixed codes
+- Note in zlib.h how much deflateSetDictionary() actually uses
+- Remove USE_DICT_HEAD in deflate.c (would mess up inflate if used)
+- Add _WIN32_WCE to define WIN32 in zconf.in.h [Spencer]
+- Don't include stderr.h or errno.h for _WIN32_WCE in zutil.h [Spencer]
+- Add gzdirect() function to indicate transparent reads
+- Update contrib/minizip [Vollant]
+- Fix compilation of deflate.c when both ASMV and FASTEST [Oberhumer]
+- Add casts in crc32.c to avoid warnings [Oberhumer]
+- Add contrib/masmx64 [Vollant]
+- Update contrib/asm586, asm686, masmx86, testzlib, vstudio [Vollant]
+
+Changes in 1.2.2.2 (30 December 2004)
+- Replace structure assignments in deflate.c and inflate.c with zmemcpy to
+ avoid implicit memcpy calls (portability for no-library compilation)
+- Increase sprintf() buffer size in gzdopen() to allow for large numbers
+- Add INFLATE_STRICT to check distances against zlib header
+- Improve WinCE errno handling and comments [Chang]
+- Remove comment about no gzip header processing in FAQ
+- Add Z_FIXED strategy option to deflateInit2() to force fixed trees
+- Add updated make_vms.com [Coghlan], update README
+- Create a new "examples" directory, move gzappend.c there, add zpipe.c,
+ fitblk.c, gzlog.[ch], gzjoin.c, and zlib_how.html.
+- Add FAQ entry and comments in deflate.c on uninitialized memory access
+- Add Solaris 9 make options in configure [Gilbert]
+- Allow strerror() usage in gzio.c for STDC
+- Fix DecompressBuf in contrib/delphi/ZLib.pas [ManChesTer]
+- Update contrib/masmx86/inffas32.asm and gvmat32.asm [Vollant]
+- Use z_off_t for adler32_combine() and crc32_combine() lengths
+- Make adler32() much faster for small len
+- Use OS_CODE in deflate() default gzip header
+
+Changes in 1.2.2.1 (31 October 2004)
+- Allow inflateSetDictionary() call for raw inflate
+- Fix inflate header crc check bug for file names and comments
+- Add deflateSetHeader() and gz_header structure for custom gzip headers
+- Add inflateGetheader() to retrieve gzip headers
+- Add crc32_combine() and adler32_combine() functions
+- Add alloc_func, free_func, in_func, out_func to Z_PREFIX list
+- Use zstreamp consistently in zlib.h (inflate_back functions)
+- Remove GUNZIP condition from definition of inflate_mode in inflate.h
+ and in contrib/inflate86/inffast.S [Truta, Anderson]
+- Add support for AMD64 in contrib/inflate86/inffas86.c [Anderson]
+- Update projects/README.projects and projects/visualc6 [Truta]
+- Update win32/DLL_FAQ.txt [Truta]
+- Avoid warning under NO_GZCOMPRESS in gzio.c; fix typo [Truta]
+- Deprecate Z_ASCII; use Z_TEXT instead [Truta]
+- Use a new algorithm for setting strm->data_type in trees.c [Truta]
+- Do not define an exit() prototype in zutil.c unless DEBUG defined
+- Remove prototype of exit() from zutil.c, example.c, minigzip.c [Truta]
+- Add comment in zlib.h for Z_NO_FLUSH parameter to deflate()
+- Fix Darwin build version identification [Peterson]
+
+Changes in 1.2.2 (3 October 2004)
+- Update zlib.h comments on gzip in-memory processing
+- Set adler to 1 in inflateReset() to support Java test suite [Walles]
+- Add contrib/dotzlib [Ravn]
+- Update win32/DLL_FAQ.txt [Truta]
+- Update contrib/minizip [Vollant]
+- Move contrib/visual-basic.txt to old/ [Truta]
+- Fix assembler builds in projects/visualc6/ [Truta]
+
+Changes in 1.2.1.2 (9 September 2004)
+- Update INDEX file
+- Fix trees.c to update strm->data_type (no one ever noticed!)
+- Fix bug in error case in inflate.c, infback.c, and infback9.c [Brown]
+- Add "volatile" to crc table flag declaration (for DYNAMIC_CRC_TABLE)
+- Add limited multitasking protection to DYNAMIC_CRC_TABLE
+- Add NO_vsnprintf for VMS in zutil.h [Mozilla]
+- Don't declare strerror() under VMS [Mozilla]
+- Add comment to DYNAMIC_CRC_TABLE to use get_crc_table() to initialize
+- Update contrib/ada [Anisimkov]
+- Update contrib/minizip [Vollant]
+- Fix configure to not hardcode directories for Darwin [Peterson]
+- Fix gzio.c to not return error on empty files [Brown]
+- Fix indentation; update version in contrib/delphi/ZLib.pas and
+ contrib/pascal/zlibpas.pas [Truta]
+- Update mkasm.bat in contrib/masmx86 [Truta]
+- Update contrib/untgz [Truta]
+- Add projects/README.projects [Truta]
+- Add project for MS Visual C++ 6.0 in projects/visualc6 [Cadieux, Truta]
+- Update win32/DLL_FAQ.txt [Truta]
+- Update list of Z_PREFIX symbols in zconf.h [Randers-Pehrson, Truta]
+- Remove an unnecessary assignment to curr in inftrees.c [Truta]
+- Add OS/2 to exe builds in configure [Poltorak]
+- Remove err dummy parameter in zlib.h [Kientzle]
+
+Changes in 1.2.1.1 (9 January 2004)
+- Update email address in README
+- Several FAQ updates
+- Fix a big fat bug in inftrees.c that prevented decoding valid
+ dynamic blocks with only literals and no distance codes --
+ Thanks to "Hot Emu" for the bug report and sample file
+- Add a note to puff.c on no distance codes case.
+
+Changes in 1.2.1 (17 November 2003)
+- Remove a tab in contrib/gzappend/gzappend.c
+- Update some interfaces in contrib for new zlib functions
+- Update zlib version number in some contrib entries
+- Add Windows CE definition for ptrdiff_t in zutil.h [Mai, Truta]
+- Support shared libraries on Hurd and KFreeBSD [Brown]
+- Fix error in NO_DIVIDE option of adler32.c
+
+Changes in 1.2.0.8 (4 November 2003)
+- Update version in contrib/delphi/ZLib.pas and contrib/pascal/zlibpas.pas
+- Add experimental NO_DIVIDE #define in adler32.c
+ - Possibly faster on some processors (let me know if it is)
+- Correct Z_BLOCK to not return on first inflate call if no wrap
+- Fix strm->data_type on inflate() return to correctly indicate EOB
+- Add deflatePrime() function for appending in the middle of a byte
+- Add contrib/gzappend for an example of appending to a stream
+- Update win32/DLL_FAQ.txt [Truta]
+- Delete Turbo C comment in README [Truta]
+- Improve some indentation in zconf.h [Truta]
+- Fix infinite loop on bad input in configure script [Church]
+- Fix gzeof() for concatenated gzip files [Johnson]
+- Add example to contrib/visual-basic.txt [Michael B.]
+- Add -p to mkdir's in Makefile.in [vda]
+- Fix configure to properly detect presence or lack of printf functions
+- Add AS400 support [Monnerat]
+- Add a little Cygwin support [Wilson]
+
+Changes in 1.2.0.7 (21 September 2003)
+- Correct some debug formats in contrib/infback9
+- Cast a type in a debug statement in trees.c
+- Change search and replace delimiter in configure from % to # [Beebe]
+- Update contrib/untgz to 0.2 with various fixes [Truta]
+- Add build support for Amiga [Nikl]
+- Remove some directories in old that have been updated to 1.2
+- Add dylib building for Mac OS X in configure and Makefile.in
+- Remove old distribution stuff from Makefile
+- Update README to point to DLL_FAQ.txt, and add comment on Mac OS X
+- Update links in README
+
+Changes in 1.2.0.6 (13 September 2003)
+- Minor FAQ updates
+- Update contrib/minizip to 1.00 [Vollant]
+- Remove test of gz functions in example.c when GZ_COMPRESS defined [Truta]
+- Update POSTINC comment for 68060 [Nikl]
+- Add contrib/infback9 with deflate64 decoding (unsupported)
+- For MVS define NO_vsnprintf and undefine FAR [van Burik]
+- Add pragma for fdopen on MVS [van Burik]
+
+Changes in 1.2.0.5 (8 September 2003)
+- Add OF to inflateBackEnd() declaration in zlib.h
+- Remember start when using gzdopen in the middle of a file
+- Use internal off_t counters in gz* functions to properly handle seeks
+- Perform more rigorous check for distance-too-far in inffast.c
+- Add Z_BLOCK flush option to return from inflate at block boundary
+- Set strm->data_type on return from inflate
+ - Indicate bits unused, if at block boundary, and if in last block
+- Replace size_t with ptrdiff_t in crc32.c, and check for correct size
+- Add condition so old NO_DEFLATE define still works for compatibility
+- FAQ update regarding the Windows DLL [Truta]
+- INDEX update: add qnx entry, remove aix entry [Truta]
+- Install zlib.3 into mandir [Wilson]
+- Move contrib/zlib_dll_FAQ.txt to win32/DLL_FAQ.txt; update [Truta]
+- Adapt the zlib interface to the new DLL convention guidelines [Truta]
+- Introduce ZLIB_WINAPI macro to allow the export of functions using
+ the WINAPI calling convention, for Visual Basic [Vollant, Truta]
+- Update msdos and win32 scripts and makefiles [Truta]
+- Export symbols by name, not by ordinal, in win32/zlib.def [Truta]
+- Add contrib/ada [Anisimkov]
+- Move asm files from contrib/vstudio/vc70_32 to contrib/asm386 [Truta]
+- Rename contrib/asm386 to contrib/masmx86 [Truta, Vollant]
+- Add contrib/masm686 [Truta]
+- Fix offsets in contrib/inflate86 and contrib/masmx86/inffas32.asm
+ [Truta, Vollant]
+- Update contrib/delphi; rename to contrib/pascal; add example [Truta]
+- Remove contrib/delphi2; add a new contrib/delphi [Truta]
+- Avoid inclusion of the nonstandard <memory.h> in contrib/iostream,
+ and fix some method prototypes [Truta]
+- Fix the ZCR_SEED2 constant to avoid warnings in contrib/minizip
+ [Truta]
+- Avoid the use of backslash (\) in contrib/minizip [Vollant]
+- Fix file time handling in contrib/untgz; update makefiles [Truta]
+- Update contrib/vstudio/vc70_32 to comply with the new DLL guidelines
+ [Vollant]
+- Remove contrib/vstudio/vc15_16 [Vollant]
+- Rename contrib/vstudio/vc70_32 to contrib/vstudio/vc7 [Truta]
+- Update README.contrib [Truta]
+- Invert the assignment order of match_head and s->prev[...] in
+ INSERT_STRING [Truta]
+- Compare TOO_FAR with 32767 instead of 32768, to avoid 16-bit warnings
+ [Truta]
+- Compare function pointers with 0, not with NULL or Z_NULL [Truta]
+- Fix prototype of syncsearch in inflate.c [Truta]
+- Introduce ASMINF macro to be enabled when using an ASM implementation
+ of inflate_fast [Truta]
+- Change NO_DEFLATE to NO_GZCOMPRESS [Truta]
+- Modify test_gzio in example.c to take a single file name as a
+ parameter [Truta]
+- Exit the example.c program if gzopen fails [Truta]
+- Add type casts around strlen in example.c [Truta]
+- Remove casting to sizeof in minigzip.c; give a proper type
+ to the variable compared with SUFFIX_LEN [Truta]
+- Update definitions of STDC and STDC99 in zconf.h [Truta]
+- Synchronize zconf.h with the new Windows DLL interface [Truta]
+- Use SYS16BIT instead of __32BIT__ to distinguish between
+ 16- and 32-bit platforms [Truta]
+- Use far memory allocators in small 16-bit memory models for
+ Turbo C [Truta]
+- Add info about the use of ASMV, ASMINF and ZLIB_WINAPI in
+ zlibCompileFlags [Truta]
+- Cygwin has vsnprintf [Wilson]
+- In Windows16, OS_CODE is 0, as in MSDOS [Truta]
+- In Cygwin, OS_CODE is 3 (Unix), not 11 (Windows32) [Wilson]
+
+Changes in 1.2.0.4 (10 August 2003)
+- Minor FAQ updates
+- Be more strict when checking inflateInit2's windowBits parameter
+- Change NO_GUNZIP compile option to NO_GZIP to cover deflate as well
+- Add gzip wrapper option to deflateInit2 using windowBits
+- Add updated QNX rule in configure and qnx directory [Bonnefoy]
+- Make inflate distance-too-far checks more rigorous
+- Clean up FAR usage in inflate
+- Add casting to sizeof() in gzio.c and minigzip.c
+
+Changes in 1.2.0.3 (19 July 2003)
+- Fix silly error in gzungetc() implementation [Vollant]
+- Update contrib/minizip and contrib/vstudio [Vollant]
+- Fix printf format in example.c
+- Correct cdecl support in zconf.in.h [Anisimkov]
+- Minor FAQ updates
+
+Changes in 1.2.0.2 (13 July 2003)
+- Add ZLIB_VERNUM in zlib.h for numerical preprocessor comparisons
+- Attempt to avoid warnings in crc32.c for pointer-int conversion
+- Add AIX to configure, remove aix directory [Bakker]
+- Add some casts to minigzip.c
+- Improve checking after insecure sprintf() or vsprintf() calls
+- Remove #elif's from crc32.c
+- Change leave label to inf_leave in inflate.c and infback.c to avoid
+ library conflicts
+- Remove inflate gzip decoding by default--only enable gzip decoding by
+ special request for stricter backward compatibility
+- Add zlibCompileFlags() function to return compilation information
+- More typecasting in deflate.c to avoid warnings
+- Remove leading underscore from _Capital #defines [Truta]
+- Fix configure to link shared library when testing
+- Add some Windows CE target adjustments [Mai]
+- Remove #define ZLIB_DLL in zconf.h [Vollant]
+- Add zlib.3 [Rodgers]
+- Update RFC URL in deflate.c and algorithm.txt [Mai]
+- Add zlib_dll_FAQ.txt to contrib [Truta]
+- Add UL to some constants [Truta]
+- Update minizip and vstudio [Vollant]
+- Remove vestigial NEED_DUMMY_RETURN from zconf.in.h
+- Expand use of NO_DUMMY_DECL to avoid all dummy structures
+- Added iostream3 to contrib [Schwardt]
+- Replace rewind() with fseek() for WinCE [Truta]
+- Improve setting of zlib format compression level flags
+ - Report 0 for huffman and rle strategies and for level == 0 or 1
+ - Report 2 only for level == 6
+- Only deal with 64K limit when necessary at compile time [Truta]
+- Allow TOO_FAR check to be turned off at compile time [Truta]
+- Add gzclearerr() function [Souza]
+- Add gzungetc() function
+
+Changes in 1.2.0.1 (17 March 2003)
+- Add Z_RLE strategy for run-length encoding [Truta]
+ - When Z_RLE requested, restrict matches to distance one
+ - Update zlib.h, minigzip.c, gzopen(), gzdopen() for Z_RLE
+- Correct FASTEST compilation to allow level == 0
+- Clean up what gets compiled for FASTEST
+- Incorporate changes to zconf.in.h [Vollant]
+ - Refine detection of Turbo C need for dummy returns
+ - Refine ZLIB_DLL compilation
+ - Include additional header file on VMS for off_t typedef
+- Try to use _vsnprintf where it supplants vsprintf [Vollant]
+- Add some casts in inffast.c
+- Enchance comments in zlib.h on what happens if gzprintf() tries to
+ write more than 4095 bytes before compression
+- Remove unused state from inflateBackEnd()
+- Remove exit(0) from minigzip.c, example.c
+- Get rid of all those darn tabs
+- Add "check" target to Makefile.in that does the same thing as "test"
+- Add "mostlyclean" and "maintainer-clean" targets to Makefile.in
+- Update contrib/inflate86 [Anderson]
+- Update contrib/testzlib, contrib/vstudio, contrib/minizip [Vollant]
+- Add msdos and win32 directories with makefiles [Truta]
+- More additions and improvements to the FAQ
+
+Changes in 1.2.0 (9 March 2003)
+- New and improved inflate code
+ - About 20% faster
+ - Does not allocate 32K window unless and until needed
+ - Automatically detects and decompresses gzip streams
+ - Raw inflate no longer needs an extra dummy byte at end
+ - Added inflateBack functions using a callback interface--even faster
+ than inflate, useful for file utilities (gzip, zip)
+ - Added inflateCopy() function to record state for random access on
+ externally generated deflate streams (e.g. in gzip files)
+ - More readable code (I hope)
+- New and improved crc32()
+ - About 50% faster, thanks to suggestions from Rodney Brown
+- Add deflateBound() and compressBound() functions
+- Fix memory leak in deflateInit2()
+- Permit setting dictionary for raw deflate (for parallel deflate)
+- Fix const declaration for gzwrite()
+- Check for some malloc() failures in gzio.c
+- Fix bug in gzopen() on single-byte file 0x1f
+- Fix bug in gzread() on concatenated file with 0x1f at end of buffer
+ and next buffer doesn't start with 0x8b
+- Fix uncompress() to return Z_DATA_ERROR on truncated input
+- Free memory at end of example.c
+- Remove MAX #define in trees.c (conflicted with some libraries)
+- Fix static const's in deflate.c, gzio.c, and zutil.[ch]
+- Declare malloc() and free() in gzio.c if STDC not defined
+- Use malloc() instead of calloc() in zutil.c if int big enough
+- Define STDC for AIX
+- Add aix/ with approach for compiling shared library on AIX
+- Add HP-UX support for shared libraries in configure
+- Add OpenUNIX support for shared libraries in configure
+- Use $cc instead of gcc to build shared library
+- Make prefix directory if needed when installing
+- Correct Macintosh avoidance of typedef Byte in zconf.h
+- Correct Turbo C memory allocation when under Linux
+- Use libz.a instead of -lz in Makefile (assure use of compiled library)
+- Update configure to check for snprintf or vsnprintf functions and their
+ return value, warn during make if using an insecure function
+- Fix configure problem with compile-time knowledge of HAVE_UNISTD_H that
+ is lost when library is used--resolution is to build new zconf.h
+- Documentation improvements (in zlib.h):
+ - Document raw deflate and inflate
+ - Update RFCs URL
+ - Point out that zlib and gzip formats are different
+ - Note that Z_BUF_ERROR is not fatal
+ - Document string limit for gzprintf() and possible buffer overflow
+ - Note requirement on avail_out when flushing
+ - Note permitted values of flush parameter of inflate()
+- Add some FAQs (and even answers) to the FAQ
+- Add contrib/inflate86/ for x86 faster inflate
+- Add contrib/blast/ for PKWare Data Compression Library decompression
+- Add contrib/puff/ simple inflate for deflate format description
+
+Changes in 1.1.4 (11 March 2002)
+- ZFREE was repeated on same allocation on some error conditions.
+ This creates a security problem described in
+ http://www.zlib.org/advisory-2002-03-11.txt
+- Returned incorrect error (Z_MEM_ERROR) on some invalid data
+- Avoid accesses before window for invalid distances with inflate window
+ less than 32K.
+- force windowBits > 8 to avoid a bug in the encoder for a window size
+ of 256 bytes. (A complete fix will be available in 1.1.5).
+
+Changes in 1.1.3 (9 July 1998)
+- fix "an inflate input buffer bug that shows up on rare but persistent
+ occasions" (Mark)
+- fix gzread and gztell for concatenated .gz files (Didier Le Botlan)
+- fix gzseek(..., SEEK_SET) in write mode
+- fix crc check after a gzeek (Frank Faubert)
+- fix miniunzip when the last entry in a zip file is itself a zip file
+ (J Lillge)
+- add contrib/asm586 and contrib/asm686 (Brian Raiter)
+ See http://www.muppetlabs.com/~breadbox/software/assembly.html
+- add support for Delphi 3 in contrib/delphi (Bob Dellaca)
+- add support for C++Builder 3 and Delphi 3 in contrib/delphi2 (Davide Moretti)
+- do not exit prematurely in untgz if 0 at start of block (Magnus Holmgren)
+- use macro EXTERN instead of extern to support DLL for BeOS (Sander Stoks)
+- added a FAQ file
+
+- Support gzdopen on Mac with Metrowerks (Jason Linhart)
+- Do not redefine Byte on Mac (Brad Pettit & Jason Linhart)
+- define SEEK_END too if SEEK_SET is not defined (Albert Chin-A-Young)
+- avoid some warnings with Borland C (Tom Tanner)
+- fix a problem in contrib/minizip/zip.c for 16-bit MSDOS (Gilles Vollant)
+- emulate utime() for WIN32 in contrib/untgz (Gilles Vollant)
+- allow several arguments to configure (Tim Mooney, Frodo Looijaard)
+- use libdir and includedir in Makefile.in (Tim Mooney)
+- support shared libraries on OSF1 V4 (Tim Mooney)
+- remove so_locations in "make clean" (Tim Mooney)
+- fix maketree.c compilation error (Glenn, Mark)
+- Python interface to zlib now in Python 1.5 (Jeremy Hylton)
+- new Makefile.riscos (Rich Walker)
+- initialize static descriptors in trees.c for embedded targets (Nick Smith)
+- use "foo-gz" in example.c for RISCOS and VMS (Nick Smith)
+- add the OS/2 files in Makefile.in too (Andrew Zabolotny)
+- fix fdopen and halloc macros for Microsoft C 6.0 (Tom Lane)
+- fix maketree.c to allow clean compilation of inffixed.h (Mark)
+- fix parameter check in deflateCopy (Gunther Nikl)
+- cleanup trees.c, use compressed_len only in debug mode (Christian Spieler)
+- Many portability patches by Christian Spieler:
+ . zutil.c, zutil.h: added "const" for zmem*
+ . Make_vms.com: fixed some typos
+ . Make_vms.com: msdos/Makefile.*: removed zutil.h from some dependency lists
+ . msdos/Makefile.msc: remove "default rtl link library" info from obj files
+ . msdos/Makefile.*: use model-dependent name for the built zlib library
+ . msdos/Makefile.emx, nt/Makefile.emx, nt/Makefile.gcc:
+ new makefiles, for emx (DOS/OS2), emx&rsxnt and mingw32 (Windows 9x / NT)
+- use define instead of typedef for Bytef also for MSC small/medium (Tom Lane)
+- replace __far with _far for better portability (Christian Spieler, Tom Lane)
+- fix test for errno.h in configure (Tim Newsham)
+
+Changes in 1.1.2 (19 March 98)
+- added contrib/minzip, mini zip and unzip based on zlib (Gilles Vollant)
+ See http://www.winimage.com/zLibDll/unzip.html
+- preinitialize the inflate tables for fixed codes, to make the code
+ completely thread safe (Mark)
+- some simplifications and slight speed-up to the inflate code (Mark)
+- fix gzeof on non-compressed files (Allan Schrum)
+- add -std1 option in configure for OSF1 to fix gzprintf (Martin Mokrejs)
+- use default value of 4K for Z_BUFSIZE for 16-bit MSDOS (Tim Wegner + Glenn)
+- added os2/Makefile.def and os2/zlib.def (Andrew Zabolotny)
+- add shared lib support for UNIX_SV4.2MP (MATSUURA Takanori)
+- do not wrap extern "C" around system includes (Tom Lane)
+- mention zlib binding for TCL in README (Andreas Kupries)
+- added amiga/Makefile.pup for Amiga powerUP SAS/C PPC (Andreas Kleinert)
+- allow "make install prefix=..." even after configure (Glenn Randers-Pehrson)
+- allow "configure --prefix $HOME" (Tim Mooney)
+- remove warnings in example.c and gzio.c (Glenn Randers-Pehrson)
+- move Makefile.sas to amiga/Makefile.sas
+
+Changes in 1.1.1 (27 Feb 98)
+- fix macros _tr_tally_* in deflate.h for debug mode (Glenn Randers-Pehrson)
+- remove block truncation heuristic which had very marginal effect for zlib
+ (smaller lit_bufsize than in gzip 1.2.4) and degraded a little the
+ compression ratio on some files. This also allows inlining _tr_tally for
+ matches in deflate_slow.
+- added msdos/Makefile.w32 for WIN32 Microsoft Visual C++ (Bob Frazier)
+
+Changes in 1.1.0 (24 Feb 98)
+- do not return STREAM_END prematurely in inflate (John Bowler)
+- revert to the zlib 1.0.8 inflate to avoid the gcc 2.8.0 bug (Jeremy Buhler)
+- compile with -DFASTEST to get compression code optimized for speed only
+- in minigzip, try mmap'ing the input file first (Miguel Albrecht)
+- increase size of I/O buffers in minigzip.c and gzio.c (not a big gain
+ on Sun but significant on HP)
+
+- add a pointer to experimental unzip library in README (Gilles Vollant)
+- initialize variable gcc in configure (Chris Herborth)
+
+Changes in 1.0.9 (17 Feb 1998)
+- added gzputs and gzgets functions
+- do not clear eof flag in gzseek (Mark Diekhans)
+- fix gzseek for files in transparent mode (Mark Diekhans)
+- do not assume that vsprintf returns the number of bytes written (Jens Krinke)
+- replace EXPORT with ZEXPORT to avoid conflict with other programs
+- added compress2 in zconf.h, zlib.def, zlib.dnt
+- new asm code from Gilles Vollant in contrib/asm386
+- simplify the inflate code (Mark):
+ . Replace ZALLOC's in huft_build() with single ZALLOC in inflate_blocks_new()
+ . ZALLOC the length list in inflate_trees_fixed() instead of using stack
+ . ZALLOC the value area for huft_build() instead of using stack
+ . Simplify Z_FINISH check in inflate()
+
+- Avoid gcc 2.8.0 comparison bug a little differently than zlib 1.0.8
+- in inftrees.c, avoid cc -O bug on HP (Farshid Elahi)
+- in zconf.h move the ZLIB_DLL stuff earlier to avoid problems with
+ the declaration of FAR (Gilles VOllant)
+- install libz.so* with mode 755 (executable) instead of 644 (Marc Lehmann)
+- read_buf buf parameter of type Bytef* instead of charf*
+- zmemcpy parameters are of type Bytef*, not charf* (Joseph Strout)
+- do not redeclare unlink in minigzip.c for WIN32 (John Bowler)
+- fix check for presence of directories in "make install" (Ian Willis)
+
+Changes in 1.0.8 (27 Jan 1998)
+- fixed offsets in contrib/asm386/gvmat32.asm (Gilles Vollant)
+- fix gzgetc and gzputc for big endian systems (Markus Oberhumer)
+- added compress2() to allow setting the compression level
+- include sys/types.h to get off_t on some systems (Marc Lehmann & QingLong)
+- use constant arrays for the static trees in trees.c instead of computing
+ them at run time (thanks to Ken Raeburn for this suggestion). To create
+ trees.h, compile with GEN_TREES_H and run "make test".
+- check return code of example in "make test" and display result
+- pass minigzip command line options to file_compress
+- simplifying code of inflateSync to avoid gcc 2.8 bug
+
+- support CC="gcc -Wall" in configure -s (QingLong)
+- avoid a flush caused by ftell in gzopen for write mode (Ken Raeburn)
+- fix test for shared library support to avoid compiler warnings
+- zlib.lib -> zlib.dll in msdos/zlib.rc (Gilles Vollant)
+- check for TARGET_OS_MAC in addition to MACOS (Brad Pettit)
+- do not use fdopen for Metrowerks on Mac (Brad Pettit))
+- add checks for gzputc and gzputc in example.c
+- avoid warnings in gzio.c and deflate.c (Andreas Kleinert)
+- use const for the CRC table (Ken Raeburn)
+- fixed "make uninstall" for shared libraries
+- use Tracev instead of Trace in infblock.c
+- in example.c use correct compressed length for test_sync
+- suppress +vnocompatwarnings in configure for HPUX (not always supported)
+
+Changes in 1.0.7 (20 Jan 1998)
+- fix gzseek which was broken in write mode
+- return error for gzseek to negative absolute position
+- fix configure for Linux (Chun-Chung Chen)
+- increase stack space for MSC (Tim Wegner)
+- get_crc_table and inflateSyncPoint are EXPORTed (Gilles Vollant)
+- define EXPORTVA for gzprintf (Gilles Vollant)
+- added man page zlib.3 (Rick Rodgers)
+- for contrib/untgz, fix makedir() and improve Makefile
+
+- check gzseek in write mode in example.c
+- allocate extra buffer for seeks only if gzseek is actually called
+- avoid signed/unsigned comparisons (Tim Wegner, Gilles Vollant)
+- add inflateSyncPoint in zconf.h
+- fix list of exported functions in nt/zlib.dnt and mdsos/zlib.def
+
+Changes in 1.0.6 (19 Jan 1998)
+- add functions gzprintf, gzputc, gzgetc, gztell, gzeof, gzseek, gzrewind and
+ gzsetparams (thanks to Roland Giersig and Kevin Ruland for some of this code)
+- Fix a deflate bug occurring only with compression level 0 (thanks to
+ Andy Buckler for finding this one).
+- In minigzip, pass transparently also the first byte for .Z files.
+- return Z_BUF_ERROR instead of Z_OK if output buffer full in uncompress()
+- check Z_FINISH in inflate (thanks to Marc Schluper)
+- Implement deflateCopy (thanks to Adam Costello)
+- make static libraries by default in configure, add --shared option.
+- move MSDOS or Windows specific files to directory msdos
+- suppress the notion of partial flush to simplify the interface
+ (but the symbol Z_PARTIAL_FLUSH is kept for compatibility with 1.0.4)
+- suppress history buffer provided by application to simplify the interface
+ (this feature was not implemented anyway in 1.0.4)
+- next_in and avail_in must be initialized before calling inflateInit or
+ inflateInit2
+- add EXPORT in all exported functions (for Windows DLL)
+- added Makefile.nt (thanks to Stephen Williams)
+- added the unsupported "contrib" directory:
+ contrib/asm386/ by Gilles Vollant <info@winimage.com>
+ 386 asm code replacing longest_match().
+ contrib/iostream/ by Kevin Ruland <kevin@rodin.wustl.edu>
+ A C++ I/O streams interface to the zlib gz* functions
+ contrib/iostream2/ by Tyge Løvset <Tyge.Lovset@cmr.no>
+ Another C++ I/O streams interface
+ contrib/untgz/ by "Pedro A. Aranda Guti\irrez" <paag@tid.es>
+ A very simple tar.gz file extractor using zlib
+ contrib/visual-basic.txt by Carlos Rios <c_rios@sonda.cl>
+ How to use compress(), uncompress() and the gz* functions from VB.
+- pass params -f (filtered data), -h (huffman only), -1 to -9 (compression
+ level) in minigzip (thanks to Tom Lane)
+
+- use const for rommable constants in deflate
+- added test for gzseek and gztell in example.c
+- add undocumented function inflateSyncPoint() (hack for Paul Mackerras)
+- add undocumented function zError to convert error code to string
+ (for Tim Smithers)
+- Allow compilation of gzio with -DNO_DEFLATE to avoid the compression code.
+- Use default memcpy for Symantec MSDOS compiler.
+- Add EXPORT keyword for check_func (needed for Windows DLL)
+- add current directory to LD_LIBRARY_PATH for "make test"
+- create also a link for libz.so.1
+- added support for FUJITSU UXP/DS (thanks to Toshiaki Nomura)
+- use $(SHAREDLIB) instead of libz.so in Makefile.in (for HPUX)
+- added -soname for Linux in configure (Chun-Chung Chen,
+- assign numbers to the exported functions in zlib.def (for Windows DLL)
+- add advice in zlib.h for best usage of deflateSetDictionary
+- work around compiler bug on Atari (cast Z_NULL in call of s->checkfn)
+- allow compilation with ANSI keywords only enabled for TurboC in large model
+- avoid "versionString"[0] (Borland bug)
+- add NEED_DUMMY_RETURN for Borland
+- use variable z_verbose for tracing in debug mode (L. Peter Deutsch).
+- allow compilation with CC
+- defined STDC for OS/2 (David Charlap)
+- limit external names to 8 chars for MVS (Thomas Lund)
+- in minigzip.c, use static buffers only for 16-bit systems
+- fix suffix check for "minigzip -d foo.gz"
+- do not return an error for the 2nd of two consecutive gzflush() (Felix Lee)
+- use _fdopen instead of fdopen for MSC >= 6.0 (Thomas Fanslau)
+- added makelcc.bat for lcc-win32 (Tom St Denis)
+- in Makefile.dj2, use copy and del instead of install and rm (Frank Donahoe)
+- Avoid expanded $Id$. Use "rcs -kb" or "cvs admin -kb" to avoid Id expansion.
+- check for unistd.h in configure (for off_t)
+- remove useless check parameter in inflate_blocks_free
+- avoid useless assignment of s->check to itself in inflate_blocks_new
+- do not flush twice in gzclose (thanks to Ken Raeburn)
+- rename FOPEN as F_OPEN to avoid clash with /usr/include/sys/file.h
+- use NO_ERRNO_H instead of enumeration of operating systems with errno.h
+- work around buggy fclose on pipes for HP/UX
+- support zlib DLL with BORLAND C++ 5.0 (thanks to Glenn Randers-Pehrson)
+- fix configure if CC is already equal to gcc
+
+Changes in 1.0.5 (3 Jan 98)
+- Fix inflate to terminate gracefully when fed corrupted or invalid data
+- Use const for rommable constants in inflate
+- Eliminate memory leaks on error conditions in inflate
+- Removed some vestigial code in inflate
+- Update web address in README
+
+Changes in 1.0.4 (24 Jul 96)
+- In very rare conditions, deflate(s, Z_FINISH) could fail to produce an EOF
+ bit, so the decompressor could decompress all the correct data but went
+ on to attempt decompressing extra garbage data. This affected minigzip too.
+- zlibVersion and gzerror return const char* (needed for DLL)
+- port to RISCOS (no fdopen, no multiple dots, no unlink, no fileno)
+- use z_error only for DEBUG (avoid problem with DLLs)
+
+Changes in 1.0.3 (2 Jul 96)
+- use z_streamp instead of z_stream *, which is now a far pointer in MSDOS
+ small and medium models; this makes the library incompatible with previous
+ versions for these models. (No effect in large model or on other systems.)
+- return OK instead of BUF_ERROR if previous deflate call returned with
+ avail_out as zero but there is nothing to do
+- added memcmp for non STDC compilers
+- define NO_DUMMY_DECL for more Mac compilers (.h files merged incorrectly)
+- define __32BIT__ if __386__ or i386 is defined (pb. with Watcom and SCO)
+- better check for 16-bit mode MSC (avoids problem with Symantec)
+
+Changes in 1.0.2 (23 May 96)
+- added Windows DLL support
+- added a function zlibVersion (for the DLL support)
+- fixed declarations using Bytef in infutil.c (pb with MSDOS medium model)
+- Bytef is define's instead of typedef'd only for Borland C
+- avoid reading uninitialized memory in example.c
+- mention in README that the zlib format is now RFC1950
+- updated Makefile.dj2
+- added algorithm.doc
+
+Changes in 1.0.1 (20 May 96) [1.0 skipped to avoid confusion]
+- fix array overlay in deflate.c which sometimes caused bad compressed data
+- fix inflate bug with empty stored block
+- fix MSDOS medium model which was broken in 0.99
+- fix deflateParams() which could generated bad compressed data.
+- Bytef is define'd instead of typedef'ed (work around Borland bug)
+- added an INDEX file
+- new makefiles for DJGPP (Makefile.dj2), 32-bit Borland (Makefile.b32),
+ Watcom (Makefile.wat), Amiga SAS/C (Makefile.sas)
+- speed up adler32 for modern machines without auto-increment
+- added -ansi for IRIX in configure
+- static_init_done in trees.c is an int
+- define unlink as delete for VMS
+- fix configure for QNX
+- add configure branch for SCO and HPUX
+- avoid many warnings (unused variables, dead assignments, etc...)
+- no fdopen for BeOS
+- fix the Watcom fix for 32 bit mode (define FAR as empty)
+- removed redefinition of Byte for MKWERKS
+- work around an MWKERKS bug (incorrect merge of all .h files)
+
+Changes in 0.99 (27 Jan 96)
+- allow preset dictionary shared between compressor and decompressor
+- allow compression level 0 (no compression)
+- add deflateParams in zlib.h: allow dynamic change of compression level
+ and compression strategy.
+- test large buffers and deflateParams in example.c
+- add optional "configure" to build zlib as a shared library
+- suppress Makefile.qnx, use configure instead
+- fixed deflate for 64-bit systems (detected on Cray)
+- fixed inflate_blocks for 64-bit systems (detected on Alpha)
+- declare Z_DEFLATED in zlib.h (possible parameter for deflateInit2)
+- always return Z_BUF_ERROR when deflate() has nothing to do
+- deflateInit and inflateInit are now macros to allow version checking
+- prefix all global functions and types with z_ with -DZ_PREFIX
+- make falloc completely reentrant (inftrees.c)
+- fixed very unlikely race condition in ct_static_init
+- free in reverse order of allocation to help memory manager
+- use zlib-1.0/* instead of zlib/* inside the tar.gz
+- make zlib warning-free with "gcc -O3 -Wall -Wwrite-strings -Wpointer-arith
+ -Wconversion -Wstrict-prototypes -Wmissing-prototypes"
+- allow gzread on concatenated .gz files
+- deflateEnd now returns Z_DATA_ERROR if it was premature
+- deflate is finally (?) fully deterministic (no matches beyond end of input)
+- Document Z_SYNC_FLUSH
+- add uninstall in Makefile
+- Check for __cpluplus in zlib.h
+- Better test in ct_align for partial flush
+- avoid harmless warnings for Borland C++
+- initialize hash_head in deflate.c
+- avoid warning on fdopen (gzio.c) for HP cc -Aa
+- include stdlib.h for STDC compilers
+- include errno.h for Cray
+- ignore error if ranlib doesn't exist
+- call ranlib twice for NeXTSTEP
+- use exec_prefix instead of prefix for libz.a
+- renamed ct_* as _tr_* to avoid conflict with applications
+- clear z->msg in inflateInit2 before any error return
+- initialize opaque in example.c, gzio.c, deflate.c and inflate.c
+- fixed typo in zconf.h (_GNUC__ => __GNUC__)
+- check for WIN32 in zconf.h and zutil.c (avoid farmalloc in 32-bit mode)
+- fix typo in Make_vms.com (f$trnlnm -> f$getsyi)
+- in fcalloc, normalize pointer if size > 65520 bytes
+- don't use special fcalloc for 32 bit Borland C++
+- use STDC instead of __GO32__ to avoid redeclaring exit, calloc, etc...
+- use Z_BINARY instead of BINARY
+- document that gzclose after gzdopen will close the file
+- allow "a" as mode in gzopen.
+- fix error checking in gzread
+- allow skipping .gz extra-field on pipes
+- added reference to Perl interface in README
+- put the crc table in FAR data (I dislike more and more the medium model :)
+- added get_crc_table
+- added a dimension to all arrays (Borland C can't count).
+- workaround Borland C bug in declaration of inflate_codes_new & inflate_fast
+- guard against multiple inclusion of *.h (for precompiled header on Mac)
+- Watcom C pretends to be Microsoft C small model even in 32 bit mode.
+- don't use unsized arrays to avoid silly warnings by Visual C++:
+ warning C4746: 'inflate_mask' : unsized array treated as '__far'
+ (what's wrong with far data in far model?).
+- define enum out of inflate_blocks_state to allow compilation with C++
+
+Changes in 0.95 (16 Aug 95)
+- fix MSDOS small and medium model (now easier to adapt to any compiler)
+- inlined send_bits
+- fix the final (:-) bug for deflate with flush (output was correct but
+ not completely flushed in rare occasions).
+- default window size is same for compression and decompression
+ (it's now sufficient to set MAX_WBITS in zconf.h).
+- voidp -> voidpf and voidnp -> voidp (for consistency with other
+ typedefs and because voidnp was not near in large model).
+
+Changes in 0.94 (13 Aug 95)
+- support MSDOS medium model
+- fix deflate with flush (could sometimes generate bad output)
+- fix deflateReset (zlib header was incorrectly suppressed)
+- added support for VMS
+- allow a compression level in gzopen()
+- gzflush now calls fflush
+- For deflate with flush, flush even if no more input is provided.
+- rename libgz.a as libz.a
+- avoid complex expression in infcodes.c triggering Turbo C bug
+- work around a problem with gcc on Alpha (in INSERT_STRING)
+- don't use inline functions (problem with some gcc versions)
+- allow renaming of Byte, uInt, etc... with #define.
+- avoid warning about (unused) pointer before start of array in deflate.c
+- avoid various warnings in gzio.c, example.c, infblock.c, adler32.c, zutil.c
+- avoid reserved word 'new' in trees.c
+
+Changes in 0.93 (25 June 95)
+- temporarily disable inline functions
+- make deflate deterministic
+- give enough lookahead for PARTIAL_FLUSH
+- Set binary mode for stdin/stdout in minigzip.c for OS/2
+- don't even use signed char in inflate (not portable enough)
+- fix inflate memory leak for segmented architectures
+
+Changes in 0.92 (3 May 95)
+- don't assume that char is signed (problem on SGI)
+- Clear bit buffer when starting a stored block
+- no memcpy on Pyramid
+- suppressed inftest.c
+- optimized fill_window, put longest_match inline for gcc
+- optimized inflate on stored blocks.
+- untabify all sources to simplify patches
+
+Changes in 0.91 (2 May 95)
+- Default MEM_LEVEL is 8 (not 9 for Unix) as documented in zlib.h
+- Document the memory requirements in zconf.h
+- added "make install"
+- fix sync search logic in inflateSync
+- deflate(Z_FULL_FLUSH) now works even if output buffer too short
+- after inflateSync, don't scare people with just "lo world"
+- added support for DJGPP
+
+Changes in 0.9 (1 May 95)
+- don't assume that zalloc clears the allocated memory (the TurboC bug
+ was Mark's bug after all :)
+- let again gzread copy uncompressed data unchanged (was working in 0.71)
+- deflate(Z_FULL_FLUSH), inflateReset and inflateSync are now fully implemented
+- added a test of inflateSync in example.c
+- moved MAX_WBITS to zconf.h because users might want to change that.
+- document explicitly that zalloc(64K) on MSDOS must return a normalized
+ pointer (zero offset)
+- added Makefiles for Microsoft C, Turbo C, Borland C++
+- faster crc32()
+
+Changes in 0.8 (29 April 95)
+- added fast inflate (inffast.c)
+- deflate(Z_FINISH) now returns Z_STREAM_END when done. Warning: this
+ is incompatible with previous versions of zlib which returned Z_OK.
+- work around a TurboC compiler bug (bad code for b << 0, see infutil.h)
+ (actually that was not a compiler bug, see 0.81 above)
+- gzread no longer reads one extra byte in certain cases
+- In gzio destroy(), don't reference a freed structure
+- avoid many warnings for MSDOS
+- avoid the ERROR symbol which is used by MS Windows
+
+Changes in 0.71 (14 April 95)
+- Fixed more MSDOS compilation problems :( There is still a bug with
+ TurboC large model.
+
+Changes in 0.7 (14 April 95)
+- Added full inflate support.
+- Simplified the crc32() interface. The pre- and post-conditioning
+ (one's complement) is now done inside crc32(). WARNING: this is
+ incompatible with previous versions; see zlib.h for the new usage.
+
+Changes in 0.61 (12 April 95)
+- workaround for a bug in TurboC. example and minigzip now work on MSDOS.
+
+Changes in 0.6 (11 April 95)
+- added minigzip.c
+- added gzdopen to reopen a file descriptor as gzFile
+- added transparent reading of non-gziped files in gzread.
+- fixed bug in gzread (don't read crc as data)
+- fixed bug in destroy (gzio.c) (don't return Z_STREAM_END for gzclose).
+- don't allocate big arrays in the stack (for MSDOS)
+- fix some MSDOS compilation problems
+
+Changes in 0.5:
+- do real compression in deflate.c. Z_PARTIAL_FLUSH is supported but
+ not yet Z_FULL_FLUSH.
+- support decompression but only in a single step (forced Z_FINISH)
+- added opaque object for zalloc and zfree.
+- added deflateReset and inflateReset
+- added a variable zlib_version for consistency checking.
+- renamed the 'filter' parameter of deflateInit2 as 'strategy'.
+ Added Z_FILTERED and Z_HUFFMAN_ONLY constants.
+
+Changes in 0.4:
+- avoid "zip" everywhere, use zlib instead of ziplib.
+- suppress Z_BLOCK_FLUSH, interpret Z_PARTIAL_FLUSH as block flush
+ if compression method == 8.
+- added adler32 and crc32
+- renamed deflateOptions as deflateInit2, call one or the other but not both
+- added the method parameter for deflateInit2.
+- added inflateInit2
+- simplied considerably deflateInit and inflateInit by not supporting
+ user-provided history buffer. This is supported only in deflateInit2
+ and inflateInit2.
+
+Changes in 0.3:
+- prefix all macro names with Z_
+- use Z_FINISH instead of deflateEnd to finish compression.
+- added Z_HUFFMAN_ONLY
+- added gzerror()
diff --git a/protocols/Telegram/tgl/zlib/FAQ b/protocols/Telegram/tgl/zlib/FAQ
new file mode 100644
index 0000000000..99b7cf92e4
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/FAQ
@@ -0,0 +1,368 @@
+
+ Frequently Asked Questions about zlib
+
+
+If your question is not there, please check the zlib home page
+http://zlib.net/ which may have more recent information.
+The lastest zlib FAQ is at http://zlib.net/zlib_faq.html
+
+
+ 1. Is zlib Y2K-compliant?
+
+ Yes. zlib doesn't handle dates.
+
+ 2. Where can I get a Windows DLL version?
+
+ The zlib sources can be compiled without change to produce a DLL. See the
+ file win32/DLL_FAQ.txt in the zlib distribution. Pointers to the
+ precompiled DLL are found in the zlib web site at http://zlib.net/ .
+
+ 3. Where can I get a Visual Basic interface to zlib?
+
+ See
+ * http://marknelson.us/1997/01/01/zlib-engine/
+ * win32/DLL_FAQ.txt in the zlib distribution
+
+ 4. compress() returns Z_BUF_ERROR.
+
+ Make sure that before the call of compress(), the length of the compressed
+ buffer is equal to the available size of the compressed buffer and not
+ zero. For Visual Basic, check that this parameter is passed by reference
+ ("as any"), not by value ("as long").
+
+ 5. deflate() or inflate() returns Z_BUF_ERROR.
+
+ Before making the call, make sure that avail_in and avail_out are not zero.
+ When setting the parameter flush equal to Z_FINISH, also make sure that
+ avail_out is big enough to allow processing all pending input. Note that a
+ Z_BUF_ERROR is not fatal--another call to deflate() or inflate() can be
+ made with more input or output space. A Z_BUF_ERROR may in fact be
+ unavoidable depending on how the functions are used, since it is not
+ possible to tell whether or not there is more output pending when
+ strm.avail_out returns with zero. See http://zlib.net/zlib_how.html for a
+ heavily annotated example.
+
+ 6. Where's the zlib documentation (man pages, etc.)?
+
+ It's in zlib.h . Examples of zlib usage are in the files test/example.c
+ and test/minigzip.c, with more in examples/ .
+
+ 7. Why don't you use GNU autoconf or libtool or ...?
+
+ Because we would like to keep zlib as a very small and simple package.
+ zlib is rather portable and doesn't need much configuration.
+
+ 8. I found a bug in zlib.
+
+ Most of the time, such problems are due to an incorrect usage of zlib.
+ Please try to reproduce the problem with a small program and send the
+ corresponding source to us at zlib@gzip.org . Do not send multi-megabyte
+ data files without prior agreement.
+
+ 9. Why do I get "undefined reference to gzputc"?
+
+ If "make test" produces something like
+
+ example.o(.text+0x154): undefined reference to `gzputc'
+
+ check that you don't have old files libz.* in /usr/lib, /usr/local/lib or
+ /usr/X11R6/lib. Remove any old versions, then do "make install".
+
+10. I need a Delphi interface to zlib.
+
+ See the contrib/delphi directory in the zlib distribution.
+
+11. Can zlib handle .zip archives?
+
+ Not by itself, no. See the directory contrib/minizip in the zlib
+ distribution.
+
+12. Can zlib handle .Z files?
+
+ No, sorry. You have to spawn an uncompress or gunzip subprocess, or adapt
+ the code of uncompress on your own.
+
+13. How can I make a Unix shared library?
+
+ By default a shared (and a static) library is built for Unix. So:
+
+ make distclean
+ ./configure
+ make
+
+14. How do I install a shared zlib library on Unix?
+
+ After the above, then:
+
+ make install
+
+ However, many flavors of Unix come with a shared zlib already installed.
+ Before going to the trouble of compiling a shared version of zlib and
+ trying to install it, you may want to check if it's already there! If you
+ can #include <zlib.h>, it's there. The -lz option will probably link to
+ it. You can check the version at the top of zlib.h or with the
+ ZLIB_VERSION symbol defined in zlib.h .
+
+15. I have a question about OttoPDF.
+
+ We are not the authors of OttoPDF. The real author is on the OttoPDF web
+ site: Joel Hainley, jhainley@myndkryme.com.
+
+16. Can zlib decode Flate data in an Adobe PDF file?
+
+ Yes. See http://www.pdflib.com/ . To modify PDF forms, see
+ http://sourceforge.net/projects/acroformtool/ .
+
+17. Why am I getting this "register_frame_info not found" error on Solaris?
+
+ After installing zlib 1.1.4 on Solaris 2.6, running applications using zlib
+ generates an error such as:
+
+ ld.so.1: rpm: fatal: relocation error: file /usr/local/lib/libz.so:
+ symbol __register_frame_info: referenced symbol not found
+
+ The symbol __register_frame_info is not part of zlib, it is generated by
+ the C compiler (cc or gcc). You must recompile applications using zlib
+ which have this problem. This problem is specific to Solaris. See
+ http://www.sunfreeware.com for Solaris versions of zlib and applications
+ using zlib.
+
+18. Why does gzip give an error on a file I make with compress/deflate?
+
+ The compress and deflate functions produce data in the zlib format, which
+ is different and incompatible with the gzip format. The gz* functions in
+ zlib on the other hand use the gzip format. Both the zlib and gzip formats
+ use the same compressed data format internally, but have different headers
+ and trailers around the compressed data.
+
+19. Ok, so why are there two different formats?
+
+ The gzip format was designed to retain the directory information about a
+ single file, such as the name and last modification date. The zlib format
+ on the other hand was designed for in-memory and communication channel
+ applications, and has a much more compact header and trailer and uses a
+ faster integrity check than gzip.
+
+20. Well that's nice, but how do I make a gzip file in memory?
+
+ You can request that deflate write the gzip format instead of the zlib
+ format using deflateInit2(). You can also request that inflate decode the
+ gzip format using inflateInit2(). Read zlib.h for more details.
+
+21. Is zlib thread-safe?
+
+ Yes. However any library routines that zlib uses and any application-
+ provided memory allocation routines must also be thread-safe. zlib's gz*
+ functions use stdio library routines, and most of zlib's functions use the
+ library memory allocation routines by default. zlib's *Init* functions
+ allow for the application to provide custom memory allocation routines.
+
+ Of course, you should only operate on any given zlib or gzip stream from a
+ single thread at a time.
+
+22. Can I use zlib in my commercial application?
+
+ Yes. Please read the license in zlib.h.
+
+23. Is zlib under the GNU license?
+
+ No. Please read the license in zlib.h.
+
+24. The license says that altered source versions must be "plainly marked". So
+ what exactly do I need to do to meet that requirement?
+
+ You need to change the ZLIB_VERSION and ZLIB_VERNUM #defines in zlib.h. In
+ particular, the final version number needs to be changed to "f", and an
+ identification string should be appended to ZLIB_VERSION. Version numbers
+ x.x.x.f are reserved for modifications to zlib by others than the zlib
+ maintainers. For example, if the version of the base zlib you are altering
+ is "1.2.3.4", then in zlib.h you should change ZLIB_VERNUM to 0x123f, and
+ ZLIB_VERSION to something like "1.2.3.f-zachary-mods-v3". You can also
+ update the version strings in deflate.c and inftrees.c.
+
+ For altered source distributions, you should also note the origin and
+ nature of the changes in zlib.h, as well as in ChangeLog and README, along
+ with the dates of the alterations. The origin should include at least your
+ name (or your company's name), and an email address to contact for help or
+ issues with the library.
+
+ Note that distributing a compiled zlib library along with zlib.h and
+ zconf.h is also a source distribution, and so you should change
+ ZLIB_VERSION and ZLIB_VERNUM and note the origin and nature of the changes
+ in zlib.h as you would for a full source distribution.
+
+25. Will zlib work on a big-endian or little-endian architecture, and can I
+ exchange compressed data between them?
+
+ Yes and yes.
+
+26. Will zlib work on a 64-bit machine?
+
+ Yes. It has been tested on 64-bit machines, and has no dependence on any
+ data types being limited to 32-bits in length. If you have any
+ difficulties, please provide a complete problem report to zlib@gzip.org
+
+27. Will zlib decompress data from the PKWare Data Compression Library?
+
+ No. The PKWare DCL uses a completely different compressed data format than
+ does PKZIP and zlib. However, you can look in zlib's contrib/blast
+ directory for a possible solution to your problem.
+
+28. Can I access data randomly in a compressed stream?
+
+ No, not without some preparation. If when compressing you periodically use
+ Z_FULL_FLUSH, carefully write all the pending data at those points, and
+ keep an index of those locations, then you can start decompression at those
+ points. You have to be careful to not use Z_FULL_FLUSH too often, since it
+ can significantly degrade compression. Alternatively, you can scan a
+ deflate stream once to generate an index, and then use that index for
+ random access. See examples/zran.c .
+
+29. Does zlib work on MVS, OS/390, CICS, etc.?
+
+ It has in the past, but we have not heard of any recent evidence. There
+ were working ports of zlib 1.1.4 to MVS, but those links no longer work.
+ If you know of recent, successful applications of zlib on these operating
+ systems, please let us know. Thanks.
+
+30. Is there some simpler, easier to read version of inflate I can look at to
+ understand the deflate format?
+
+ First off, you should read RFC 1951. Second, yes. Look in zlib's
+ contrib/puff directory.
+
+31. Does zlib infringe on any patents?
+
+ As far as we know, no. In fact, that was originally the whole point behind
+ zlib. Look here for some more information:
+
+ http://www.gzip.org/#faq11
+
+32. Can zlib work with greater than 4 GB of data?
+
+ Yes. inflate() and deflate() will process any amount of data correctly.
+ Each call of inflate() or deflate() is limited to input and output chunks
+ of the maximum value that can be stored in the compiler's "unsigned int"
+ type, but there is no limit to the number of chunks. Note however that the
+ strm.total_in and strm_total_out counters may be limited to 4 GB. These
+ counters are provided as a convenience and are not used internally by
+ inflate() or deflate(). The application can easily set up its own counters
+ updated after each call of inflate() or deflate() to count beyond 4 GB.
+ compress() and uncompress() may be limited to 4 GB, since they operate in a
+ single call. gzseek() and gztell() may be limited to 4 GB depending on how
+ zlib is compiled. See the zlibCompileFlags() function in zlib.h.
+
+ The word "may" appears several times above since there is a 4 GB limit only
+ if the compiler's "long" type is 32 bits. If the compiler's "long" type is
+ 64 bits, then the limit is 16 exabytes.
+
+33. Does zlib have any security vulnerabilities?
+
+ The only one that we are aware of is potentially in gzprintf(). If zlib is
+ compiled to use sprintf() or vsprintf(), then there is no protection
+ against a buffer overflow of an 8K string space (or other value as set by
+ gzbuffer()), other than the caller of gzprintf() assuring that the output
+ will not exceed 8K. On the other hand, if zlib is compiled to use
+ snprintf() or vsnprintf(), which should normally be the case, then there is
+ no vulnerability. The ./configure script will display warnings if an
+ insecure variation of sprintf() will be used by gzprintf(). Also the
+ zlibCompileFlags() function will return information on what variant of
+ sprintf() is used by gzprintf().
+
+ If you don't have snprintf() or vsnprintf() and would like one, you can
+ find a portable implementation here:
+
+ http://www.ijs.si/software/snprintf/
+
+ Note that you should be using the most recent version of zlib. Versions
+ 1.1.3 and before were subject to a double-free vulnerability, and versions
+ 1.2.1 and 1.2.2 were subject to an access exception when decompressing
+ invalid compressed data.
+
+34. Is there a Java version of zlib?
+
+ Probably what you want is to use zlib in Java. zlib is already included
+ as part of the Java SDK in the java.util.zip package. If you really want
+ a version of zlib written in the Java language, look on the zlib home
+ page for links: http://zlib.net/ .
+
+35. I get this or that compiler or source-code scanner warning when I crank it
+ up to maximally-pedantic. Can't you guys write proper code?
+
+ Many years ago, we gave up attempting to avoid warnings on every compiler
+ in the universe. It just got to be a waste of time, and some compilers
+ were downright silly as well as contradicted each other. So now, we simply
+ make sure that the code always works.
+
+36. Valgrind (or some similar memory access checker) says that deflate is
+ performing a conditional jump that depends on an uninitialized value.
+ Isn't that a bug?
+
+ No. That is intentional for performance reasons, and the output of deflate
+ is not affected. This only started showing up recently since zlib 1.2.x
+ uses malloc() by default for allocations, whereas earlier versions used
+ calloc(), which zeros out the allocated memory. Even though the code was
+ correct, versions 1.2.4 and later was changed to not stimulate these
+ checkers.
+
+37. Will zlib read the (insert any ancient or arcane format here) compressed
+ data format?
+
+ Probably not. Look in the comp.compression FAQ for pointers to various
+ formats and associated software.
+
+38. How can I encrypt/decrypt zip files with zlib?
+
+ zlib doesn't support encryption. The original PKZIP encryption is very
+ weak and can be broken with freely available programs. To get strong
+ encryption, use GnuPG, http://www.gnupg.org/ , which already includes zlib
+ compression. For PKZIP compatible "encryption", look at
+ http://www.info-zip.org/
+
+39. What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings?
+
+ "gzip" is the gzip format, and "deflate" is the zlib format. They should
+ probably have called the second one "zlib" instead to avoid confusion with
+ the raw deflate compressed data format. While the HTTP 1.1 RFC 2616
+ correctly points to the zlib specification in RFC 1950 for the "deflate"
+ transfer encoding, there have been reports of servers and browsers that
+ incorrectly produce or expect raw deflate data per the deflate
+ specification in RFC 1951, most notably Microsoft. So even though the
+ "deflate" transfer encoding using the zlib format would be the more
+ efficient approach (and in fact exactly what the zlib format was designed
+ for), using the "gzip" transfer encoding is probably more reliable due to
+ an unfortunate choice of name on the part of the HTTP 1.1 authors.
+
+ Bottom line: use the gzip format for HTTP 1.1 encoding.
+
+40. Does zlib support the new "Deflate64" format introduced by PKWare?
+
+ No. PKWare has apparently decided to keep that format proprietary, since
+ they have not documented it as they have previous compression formats. In
+ any case, the compression improvements are so modest compared to other more
+ modern approaches, that it's not worth the effort to implement.
+
+41. I'm having a problem with the zip functions in zlib, can you help?
+
+ There are no zip functions in zlib. You are probably using minizip by
+ Giles Vollant, which is found in the contrib directory of zlib. It is not
+ part of zlib. In fact none of the stuff in contrib is part of zlib. The
+ files in there are not supported by the zlib authors. You need to contact
+ the authors of the respective contribution for help.
+
+42. The match.asm code in contrib is under the GNU General Public License.
+ Since it's part of zlib, doesn't that mean that all of zlib falls under the
+ GNU GPL?
+
+ No. The files in contrib are not part of zlib. They were contributed by
+ other authors and are provided as a convenience to the user within the zlib
+ distribution. Each item in contrib has its own license.
+
+43. Is zlib subject to export controls? What is its ECCN?
+
+ zlib is not subject to export controls, and so is classified as EAR99.
+
+44. Can you please sign these lengthy legal documents and fax them back to us
+ so that we can use your software in our product?
+
+ No. Go away. Shoo.
diff --git a/protocols/Telegram/tgl/zlib/INDEX b/protocols/Telegram/tgl/zlib/INDEX
new file mode 100644
index 0000000000..2ba0641204
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/INDEX
@@ -0,0 +1,68 @@
+CMakeLists.txt cmake build file
+ChangeLog history of changes
+FAQ Frequently Asked Questions about zlib
+INDEX this file
+Makefile dummy Makefile that tells you to ./configure
+Makefile.in template for Unix Makefile
+README guess what
+configure configure script for Unix
+make_vms.com makefile for VMS
+test/example.c zlib usages examples for build testing
+test/minigzip.c minimal gzip-like functionality for build testing
+test/infcover.c inf*.c code coverage for build coverage testing
+treebuild.xml XML description of source file dependencies
+zconf.h.cmakein zconf.h template for cmake
+zconf.h.in zconf.h template for configure
+zlib.3 Man page for zlib
+zlib.3.pdf Man page in PDF format
+zlib.map Linux symbol information
+zlib.pc.in Template for pkg-config descriptor
+zlib.pc.cmakein zlib.pc template for cmake
+zlib2ansi perl script to convert source files for C++ compilation
+
+amiga/ makefiles for Amiga SAS C
+as400/ makefiles for AS/400
+doc/ documentation for formats and algorithms
+msdos/ makefiles for MSDOS
+nintendods/ makefile for Nintendo DS
+old/ makefiles for various architectures and zlib documentation
+ files that have not yet been updated for zlib 1.2.x
+qnx/ makefiles for QNX
+watcom/ makefiles for OpenWatcom
+win32/ makefiles for Windows
+
+ zlib public header files (required for library use):
+zconf.h
+zlib.h
+
+ private source files used to build the zlib library:
+adler32.c
+compress.c
+crc32.c
+crc32.h
+deflate.c
+deflate.h
+gzclose.c
+gzguts.h
+gzlib.c
+gzread.c
+gzwrite.c
+infback.c
+inffast.c
+inffast.h
+inffixed.h
+inflate.c
+inflate.h
+inftrees.c
+inftrees.h
+trees.c
+trees.h
+uncompr.c
+zutil.c
+zutil.h
+
+ source files for sample programs
+See examples/README.examples
+
+ unsupported contributions by third parties
+See contrib/README.contrib
diff --git a/protocols/Telegram/tgl/zlib/Makefile b/protocols/Telegram/tgl/zlib/Makefile
new file mode 100644
index 0000000000..6bba86c73f
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/Makefile
@@ -0,0 +1,5 @@
+all:
+ -@echo "Please use ./configure first. Thank you."
+
+distclean:
+ make -f Makefile.in distclean
diff --git a/protocols/Telegram/tgl/zlib/Makefile.in b/protocols/Telegram/tgl/zlib/Makefile.in
new file mode 100644
index 0000000000..c61aa3008d
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/Makefile.in
@@ -0,0 +1,288 @@
+# Makefile for zlib
+# Copyright (C) 1995-2013 Jean-loup Gailly, Mark Adler
+# For conditions of distribution and use, see copyright notice in zlib.h
+
+# To compile and test, type:
+# ./configure; make test
+# Normally configure builds both a static and a shared library.
+# If you want to build just a static library, use: ./configure --static
+
+# To use the asm code, type:
+# cp contrib/asm?86/match.S ./match.S
+# make LOC=-DASMV OBJA=match.o
+
+# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
+# make install
+# To install in $HOME instead of /usr/local, use:
+# make install prefix=$HOME
+
+CC=cc
+
+CFLAGS=-O
+#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
+#CFLAGS=-g -DDEBUG
+#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
+# -Wstrict-prototypes -Wmissing-prototypes
+
+SFLAGS=-O
+LDFLAGS=
+TEST_LDFLAGS=-L. libz.a
+LDSHARED=$(CC)
+CPP=$(CC) -E
+
+STATICLIB=libz.a
+SHAREDLIB=libz.so
+SHAREDLIBV=libz.so.1.2.8
+SHAREDLIBM=libz.so.1
+LIBS=$(STATICLIB) $(SHAREDLIBV)
+
+AR=ar
+ARFLAGS=rc
+RANLIB=ranlib
+LDCONFIG=ldconfig
+LDSHAREDLIBC=-lc
+TAR=tar
+SHELL=/bin/sh
+EXE=
+
+prefix = /usr/local
+exec_prefix = ${prefix}
+libdir = ${exec_prefix}/lib
+sharedlibdir = ${libdir}
+includedir = ${prefix}/include
+mandir = ${prefix}/share/man
+man3dir = ${mandir}/man3
+pkgconfigdir = ${libdir}/pkgconfig
+
+OBJZ = adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o
+OBJG = compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o
+OBJC = $(OBJZ) $(OBJG)
+
+PIC_OBJZ = adler32.lo crc32.lo deflate.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo zutil.lo
+PIC_OBJG = compress.lo uncompr.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo
+PIC_OBJC = $(PIC_OBJZ) $(PIC_OBJG)
+
+# to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo
+OBJA =
+PIC_OBJA =
+
+OBJS = $(OBJC) $(OBJA)
+
+PIC_OBJS = $(PIC_OBJC) $(PIC_OBJA)
+
+all: static shared
+
+static: example$(EXE) minigzip$(EXE)
+
+shared: examplesh$(EXE) minigzipsh$(EXE)
+
+all64: example64$(EXE) minigzip64$(EXE)
+
+check: test
+
+test: all teststatic testshared
+
+teststatic: static
+ @TMPST=tmpst_$$; \
+ if echo hello world | ./minigzip | ./minigzip -d && ./example $$TMPST ; then \
+ echo ' *** zlib test OK ***'; \
+ else \
+ echo ' *** zlib test FAILED ***'; false; \
+ fi; \
+ rm -f $$TMPST
+
+testshared: shared
+ @LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
+ LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \
+ DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \
+ SHLIB_PATH=`pwd`:$(SHLIB_PATH) ; export SHLIB_PATH; \
+ TMPSH=tmpsh_$$; \
+ if echo hello world | ./minigzipsh | ./minigzipsh -d && ./examplesh $$TMPSH; then \
+ echo ' *** zlib shared test OK ***'; \
+ else \
+ echo ' *** zlib shared test FAILED ***'; false; \
+ fi; \
+ rm -f $$TMPSH
+
+test64: all64
+ @TMP64=tmp64_$$; \
+ if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64 $$TMP64; then \
+ echo ' *** zlib 64-bit test OK ***'; \
+ else \
+ echo ' *** zlib 64-bit test FAILED ***'; false; \
+ fi; \
+ rm -f $$TMP64
+
+infcover.o: test/infcover.c zlib.h zconf.h
+ $(CC) $(CFLAGS) -I. -c -o $@ test/infcover.c
+
+infcover: infcover.o libz.a
+ $(CC) $(CFLAGS) -o $@ infcover.o libz.a
+
+cover: infcover
+ rm -f *.gcda
+ ./infcover
+ gcov inf*.c
+
+libz.a: $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
+ -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
+
+match.o: match.S
+ $(CPP) match.S > _match.s
+ $(CC) -c _match.s
+ mv _match.o match.o
+ rm -f _match.s
+
+match.lo: match.S
+ $(CPP) match.S > _match.s
+ $(CC) -c -fPIC _match.s
+ mv _match.o match.lo
+ rm -f _match.s
+
+example.o: test/example.c zlib.h zconf.h
+ $(CC) $(CFLAGS) -I. -c -o $@ test/example.c
+
+minigzip.o: test/minigzip.c zlib.h zconf.h
+ $(CC) $(CFLAGS) -I. -c -o $@ test/minigzip.c
+
+example64.o: test/example.c zlib.h zconf.h
+ $(CC) $(CFLAGS) -I. -D_FILE_OFFSET_BITS=64 -c -o $@ test/example.c
+
+minigzip64.o: test/minigzip.c zlib.h zconf.h
+ $(CC) $(CFLAGS) -I. -D_FILE_OFFSET_BITS=64 -c -o $@ test/minigzip.c
+
+.SUFFIXES: .lo
+
+.c.lo:
+ -@mkdir objs 2>/dev/null || test -d objs
+ $(CC) $(SFLAGS) -DPIC -c -o objs/$*.o $<
+ -@mv objs/$*.o $@
+
+placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a
+ $(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) $(LDSHAREDLIBC) $(LDFLAGS)
+ rm -f $(SHAREDLIB) $(SHAREDLIBM)
+ ln -s $@ $(SHAREDLIB)
+ ln -s $@ $(SHAREDLIBM)
+ -@rmdir objs
+
+example$(EXE): example.o $(STATICLIB)
+ $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS)
+
+minigzip$(EXE): minigzip.o $(STATICLIB)
+ $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS)
+
+examplesh$(EXE): example.o $(SHAREDLIBV)
+ $(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV)
+
+minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
+ $(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV)
+
+example64$(EXE): example64.o $(STATICLIB)
+ $(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS)
+
+minigzip64$(EXE): minigzip64.o $(STATICLIB)
+ $(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS)
+
+install-libs: $(LIBS)
+ -@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
+ -@if [ ! -d $(DESTDIR)$(libdir) ]; then mkdir -p $(DESTDIR)$(libdir); fi
+ -@if [ ! -d $(DESTDIR)$(sharedlibdir) ]; then mkdir -p $(DESTDIR)$(sharedlibdir); fi
+ -@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi
+ -@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi
+ cp $(STATICLIB) $(DESTDIR)$(libdir)
+ chmod 644 $(DESTDIR)$(libdir)/$(STATICLIB)
+ -@($(RANLIB) $(DESTDIR)$(libdir)/libz.a || true) >/dev/null 2>&1
+ -@if test -n "$(SHAREDLIBV)"; then \
+ cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir); \
+ echo "cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)"; \
+ chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV); \
+ echo "chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV)"; \
+ rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
+ ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB); \
+ ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
+ ($(LDCONFIG) || true) >/dev/null 2>&1; \
+ fi
+ cp zlib.3 $(DESTDIR)$(man3dir)
+ chmod 644 $(DESTDIR)$(man3dir)/zlib.3
+ cp zlib.pc $(DESTDIR)$(pkgconfigdir)
+ chmod 644 $(DESTDIR)$(pkgconfigdir)/zlib.pc
+# The ranlib in install is needed on NeXTSTEP which checks file times
+# ldconfig is for Linux
+
+install: install-libs
+ -@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi
+ cp zlib.h zconf.h $(DESTDIR)$(includedir)
+ chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
+
+uninstall:
+ cd $(DESTDIR)$(includedir) && rm -f zlib.h zconf.h
+ cd $(DESTDIR)$(libdir) && rm -f libz.a; \
+ if test -n "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then \
+ rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \
+ fi
+ cd $(DESTDIR)$(man3dir) && rm -f zlib.3
+ cd $(DESTDIR)$(pkgconfigdir) && rm -f zlib.pc
+
+docs: zlib.3.pdf
+
+zlib.3.pdf: zlib.3
+ groff -mandoc -f H -T ps zlib.3 | ps2pdf - zlib.3.pdf
+
+zconf.h.cmakein: zconf.h.in
+ -@ TEMPFILE=zconfh_$$; \
+ echo "/#define ZCONF_H/ a\\\\\n#cmakedefine Z_PREFIX\\\\\n#cmakedefine Z_HAVE_UNISTD_H\n" >> $$TEMPFILE &&\
+ sed -f $$TEMPFILE zconf.h.in > zconf.h.cmakein &&\
+ touch -r zconf.h.in zconf.h.cmakein &&\
+ rm $$TEMPFILE
+
+zconf: zconf.h.in
+ cp -p zconf.h.in zconf.h
+
+mostlyclean: clean
+clean:
+ rm -f *.o *.lo *~ \
+ example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \
+ example64$(EXE) minigzip64$(EXE) \
+ infcover \
+ libz.* foo.gz so_locations \
+ _match.s maketree contrib/infback9/*.o
+ rm -rf objs
+ rm -f *.gcda *.gcno *.gcov
+ rm -f contrib/infback9/*.gcda contrib/infback9/*.gcno contrib/infback9/*.gcov
+
+maintainer-clean: distclean
+distclean: clean zconf zconf.h.cmakein docs
+ rm -f Makefile zlib.pc configure.log
+ -@rm -f .DS_Store
+ -@printf 'all:\n\t-@echo "Please use ./configure first. Thank you."\n' > Makefile
+ -@printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile
+ -@touch -r Makefile.in Makefile
+
+tags:
+ etags *.[ch]
+
+depend:
+ makedepend -- $(CFLAGS) -- *.[ch]
+
+# DO NOT DELETE THIS LINE -- make depend depends on it.
+
+adler32.o zutil.o: zutil.h zlib.h zconf.h
+gzclose.o gzlib.o gzread.o gzwrite.o: zlib.h zconf.h gzguts.h
+compress.o example.o minigzip.o uncompr.o: zlib.h zconf.h
+crc32.o: zutil.h zlib.h zconf.h crc32.h
+deflate.o: deflate.h zutil.h zlib.h zconf.h
+infback.o inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inffixed.h
+inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
+inftrees.o: zutil.h zlib.h zconf.h inftrees.h
+trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
+
+adler32.lo zutil.lo: zutil.h zlib.h zconf.h
+gzclose.lo gzlib.lo gzread.lo gzwrite.lo: zlib.h zconf.h gzguts.h
+compress.lo example.lo minigzip.lo uncompr.lo: zlib.h zconf.h
+crc32.lo: zutil.h zlib.h zconf.h crc32.h
+deflate.lo: deflate.h zutil.h zlib.h zconf.h
+infback.lo inflate.lo: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inffixed.h
+inffast.lo: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
+inftrees.lo: zutil.h zlib.h zconf.h inftrees.h
+trees.lo: deflate.h zutil.h zlib.h zconf.h trees.h
diff --git a/protocols/Telegram/tgl/zlib/README b/protocols/Telegram/tgl/zlib/README
new file mode 100644
index 0000000000..5ca9d127ed
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/README
@@ -0,0 +1,115 @@
+ZLIB DATA COMPRESSION LIBRARY
+
+zlib 1.2.8 is a general purpose data compression library. All the code is
+thread safe. The data format used by the zlib library is described by RFCs
+(Request for Comments) 1950 to 1952 in the files
+http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and
+rfc1952 (gzip format).
+
+All functions of the compression library are documented in the file zlib.h
+(volunteer to write man pages welcome, contact zlib@gzip.org). A usage example
+of the library is given in the file test/example.c which also tests that
+the library is working correctly. Another example is given in the file
+test/minigzip.c. The compression library itself is composed of all source
+files in the root directory.
+
+To compile all files and run the test program, follow the instructions given at
+the top of Makefile.in. In short "./configure; make test", and if that goes
+well, "make install" should work for most flavors of Unix. For Windows, use
+one of the special makefiles in win32/ or contrib/vstudio/ . For VMS, use
+make_vms.com.
+
+Questions about zlib should be sent to <zlib@gzip.org>, or to Gilles Vollant
+<info@winimage.com> for the Windows DLL version. The zlib home page is
+http://zlib.net/ . Before reporting a problem, please check this site to
+verify that you have the latest version of zlib; otherwise get the latest
+version and check whether the problem still exists or not.
+
+PLEASE read the zlib FAQ http://zlib.net/zlib_faq.html before asking for help.
+
+Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997
+issue of Dr. Dobb's Journal; a copy of the article is available at
+http://marknelson.us/1997/01/01/zlib-engine/ .
+
+The changes made in version 1.2.8 are documented in the file ChangeLog.
+
+Unsupported third party contributions are provided in directory contrib/ .
+
+zlib is available in Java using the java.util.zip package, documented at
+http://java.sun.com/developer/technicalArticles/Programming/compression/ .
+
+A Perl interface to zlib written by Paul Marquess <pmqs@cpan.org> is available
+at CPAN (Comprehensive Perl Archive Network) sites, including
+http://search.cpan.org/~pmqs/IO-Compress-Zlib/ .
+
+A Python interface to zlib written by A.M. Kuchling <amk@amk.ca> is
+available in Python 1.5 and later versions, see
+http://docs.python.org/library/zlib.html .
+
+zlib is built into tcl: http://wiki.tcl.tk/4610 .
+
+An experimental package to read and write files in .zip format, written on top
+of zlib by Gilles Vollant <info@winimage.com>, is available in the
+contrib/minizip directory of zlib.
+
+
+Notes for some targets:
+
+- For Windows DLL versions, please see win32/DLL_FAQ.txt
+
+- For 64-bit Irix, deflate.c must be compiled without any optimization. With
+ -O, one libpng test fails. The test works in 32 bit mode (with the -n32
+ compiler flag). The compiler bug has been reported to SGI.
+
+- zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1 it works
+ when compiled with cc.
+
+- On Digital Unix 4.0D (formely OSF/1) on AlphaServer, the cc option -std1 is
+ necessary to get gzprintf working correctly. This is done by configure.
+
+- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with
+ other compilers. Use "make test" to check your compiler.
+
+- gzdopen is not supported on RISCOS or BEOS.
+
+- For PalmOs, see http://palmzlib.sourceforge.net/
+
+
+Acknowledgments:
+
+ The deflate format used by zlib was defined by Phil Katz. The deflate and
+ zlib specifications were written by L. Peter Deutsch. Thanks to all the
+ people who reported problems and suggested various improvements in zlib; they
+ are too numerous to cite here.
+
+Copyright notice:
+
+ (C) 1995-2013 Jean-loup Gailly and Mark Adler
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Jean-loup Gailly Mark Adler
+ jloup@gzip.org madler@alumni.caltech.edu
+
+If you use the zlib library in a product, we would appreciate *not* receiving
+lengthy legal documents to sign. The sources are provided for free but without
+warranty of any kind. The library has been entirely written by Jean-loup
+Gailly and Mark Adler; it does not include third-party code.
+
+If you redistribute modified sources, we would appreciate that you include in
+the file ChangeLog history information documenting your changes. Please read
+the FAQ for more information on the distribution of modified source versions.
diff --git a/protocols/Telegram/tgl/zlib/adler32.c b/protocols/Telegram/tgl/zlib/adler32.c
new file mode 100644
index 0000000000..a868f073d8
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/adler32.c
@@ -0,0 +1,179 @@
+/* adler32.c -- compute the Adler-32 checksum of a data stream
+ * Copyright (C) 1995-2011 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#include "zutil.h"
+
+#define local static
+
+local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
+
+#define BASE 65521 /* largest prime smaller than 65536 */
+#define NMAX 5552
+/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
+
+#define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;}
+#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
+#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
+#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
+#define DO16(buf) DO8(buf,0); DO8(buf,8);
+
+/* use NO_DIVIDE if your processor does not do division in hardware --
+ try it both ways to see which is faster */
+#ifdef NO_DIVIDE
+/* note that this assumes BASE is 65521, where 65536 % 65521 == 15
+ (thank you to John Reiser for pointing this out) */
+# define CHOP(a) \
+ do { \
+ unsigned long tmp = a >> 16; \
+ a &= 0xffffUL; \
+ a += (tmp << 4) - tmp; \
+ } while (0)
+# define MOD28(a) \
+ do { \
+ CHOP(a); \
+ if (a >= BASE) a -= BASE; \
+ } while (0)
+# define MOD(a) \
+ do { \
+ CHOP(a); \
+ MOD28(a); \
+ } while (0)
+# define MOD63(a) \
+ do { /* this assumes a is not negative */ \
+ z_off64_t tmp = a >> 32; \
+ a &= 0xffffffffL; \
+ a += (tmp << 8) - (tmp << 5) + tmp; \
+ tmp = a >> 16; \
+ a &= 0xffffL; \
+ a += (tmp << 4) - tmp; \
+ tmp = a >> 16; \
+ a &= 0xffffL; \
+ a += (tmp << 4) - tmp; \
+ if (a >= BASE) a -= BASE; \
+ } while (0)
+#else
+# define MOD(a) a %= BASE
+# define MOD28(a) a %= BASE
+# define MOD63(a) a %= BASE
+#endif
+
+/* ========================================================================= */
+uLong ZEXPORT adler32(adler, buf, len)
+ uLong adler;
+ const Bytef *buf;
+ uInt len;
+{
+ unsigned long sum2;
+ unsigned n;
+
+ /* split Adler-32 into component sums */
+ sum2 = (adler >> 16) & 0xffff;
+ adler &= 0xffff;
+
+ /* in case user likes doing a byte at a time, keep it fast */
+ if (len == 1) {
+ adler += buf[0];
+ if (adler >= BASE)
+ adler -= BASE;
+ sum2 += adler;
+ if (sum2 >= BASE)
+ sum2 -= BASE;
+ return adler | (sum2 << 16);
+ }
+
+ /* initial Adler-32 value (deferred check for len == 1 speed) */
+ if (buf == Z_NULL)
+ return 1L;
+
+ /* in case short lengths are provided, keep it somewhat fast */
+ if (len < 16) {
+ while (len--) {
+ adler += *buf++;
+ sum2 += adler;
+ }
+ if (adler >= BASE)
+ adler -= BASE;
+ MOD28(sum2); /* only added so many BASE's */
+ return adler | (sum2 << 16);
+ }
+
+ /* do length NMAX blocks -- requires just one modulo operation */
+ while (len >= NMAX) {
+ len -= NMAX;
+ n = NMAX / 16; /* NMAX is divisible by 16 */
+ do {
+ DO16(buf); /* 16 sums unrolled */
+ buf += 16;
+ } while (--n);
+ MOD(adler);
+ MOD(sum2);
+ }
+
+ /* do remaining bytes (less than NMAX, still just one modulo) */
+ if (len) { /* avoid modulos if none remaining */
+ while (len >= 16) {
+ len -= 16;
+ DO16(buf);
+ buf += 16;
+ }
+ while (len--) {
+ adler += *buf++;
+ sum2 += adler;
+ }
+ MOD(adler);
+ MOD(sum2);
+ }
+
+ /* return recombined sums */
+ return adler | (sum2 << 16);
+}
+
+/* ========================================================================= */
+local uLong adler32_combine_(adler1, adler2, len2)
+ uLong adler1;
+ uLong adler2;
+ z_off64_t len2;
+{
+ unsigned long sum1;
+ unsigned long sum2;
+ unsigned rem;
+
+ /* for negative len, return invalid adler32 as a clue for debugging */
+ if (len2 < 0)
+ return 0xffffffffUL;
+
+ /* the derivation of this formula is left as an exercise for the reader */
+ MOD63(len2); /* assumes len2 >= 0 */
+ rem = (unsigned)len2;
+ sum1 = adler1 & 0xffff;
+ sum2 = rem * sum1;
+ MOD(sum2);
+ sum1 += (adler2 & 0xffff) + BASE - 1;
+ sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;
+ if (sum1 >= BASE) sum1 -= BASE;
+ if (sum1 >= BASE) sum1 -= BASE;
+ if (sum2 >= (BASE << 1)) sum2 -= (BASE << 1);
+ if (sum2 >= BASE) sum2 -= BASE;
+ return sum1 | (sum2 << 16);
+}
+
+/* ========================================================================= */
+uLong ZEXPORT adler32_combine(adler1, adler2, len2)
+ uLong adler1;
+ uLong adler2;
+ z_off_t len2;
+{
+ return adler32_combine_(adler1, adler2, len2);
+}
+
+uLong ZEXPORT adler32_combine64(adler1, adler2, len2)
+ uLong adler1;
+ uLong adler2;
+ z_off64_t len2;
+{
+ return adler32_combine_(adler1, adler2, len2);
+}
diff --git a/protocols/Telegram/tgl/zlib/amiga/Makefile.pup b/protocols/Telegram/tgl/zlib/amiga/Makefile.pup
new file mode 100644
index 0000000000..8940c120fb
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/amiga/Makefile.pup
@@ -0,0 +1,69 @@
+# Amiga powerUP (TM) Makefile
+# makefile for libpng and SAS C V6.58/7.00 PPC compiler
+# Copyright (C) 1998 by Andreas R. Kleinert
+
+LIBNAME = libzip.a
+
+CC = scppc
+CFLAGS = NOSTKCHK NOSINT OPTIMIZE OPTGO OPTPEEP OPTINLOCAL OPTINL \
+ OPTLOOP OPTRDEP=8 OPTDEP=8 OPTCOMP=8 NOVER
+AR = ppc-amigaos-ar cr
+RANLIB = ppc-amigaos-ranlib
+LD = ppc-amigaos-ld -r
+LDFLAGS = -o
+LDLIBS = LIB:scppc.a LIB:end.o
+RM = delete quiet
+
+OBJS = adler32.o compress.o crc32.o gzclose.o gzlib.o gzread.o gzwrite.o \
+ uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o
+
+TEST_OBJS = example.o minigzip.o
+
+all: example minigzip
+
+check: test
+test: all
+ example
+ echo hello world | minigzip | minigzip -d
+
+$(LIBNAME): $(OBJS)
+ $(AR) $@ $(OBJS)
+ -$(RANLIB) $@
+
+example: example.o $(LIBNAME)
+ $(LD) $(LDFLAGS) $@ LIB:c_ppc.o $@.o $(LIBNAME) $(LDLIBS)
+
+minigzip: minigzip.o $(LIBNAME)
+ $(LD) $(LDFLAGS) $@ LIB:c_ppc.o $@.o $(LIBNAME) $(LDLIBS)
+
+mostlyclean: clean
+clean:
+ $(RM) *.o example minigzip $(LIBNAME) foo.gz
+
+zip:
+ zip -ul9 zlib README ChangeLog Makefile Make????.??? Makefile.?? \
+ descrip.mms *.[ch]
+
+tgz:
+ cd ..; tar cfz zlib/zlib.tgz zlib/README zlib/ChangeLog zlib/Makefile \
+ zlib/Make????.??? zlib/Makefile.?? zlib/descrip.mms zlib/*.[ch]
+
+# DO NOT DELETE THIS LINE -- make depend depends on it.
+
+adler32.o: zlib.h zconf.h
+compress.o: zlib.h zconf.h
+crc32.o: crc32.h zlib.h zconf.h
+deflate.o: deflate.h zutil.h zlib.h zconf.h
+example.o: zlib.h zconf.h
+gzclose.o: zlib.h zconf.h gzguts.h
+gzlib.o: zlib.h zconf.h gzguts.h
+gzread.o: zlib.h zconf.h gzguts.h
+gzwrite.o: zlib.h zconf.h gzguts.h
+inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
+inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
+infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
+inftrees.o: zutil.h zlib.h zconf.h inftrees.h
+minigzip.o: zlib.h zconf.h
+trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
+uncompr.o: zlib.h zconf.h
+zutil.o: zutil.h zlib.h zconf.h
diff --git a/protocols/Telegram/tgl/zlib/amiga/Makefile.sas b/protocols/Telegram/tgl/zlib/amiga/Makefile.sas
new file mode 100644
index 0000000000..749e291527
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/amiga/Makefile.sas
@@ -0,0 +1,68 @@
+# SMakefile for zlib
+# Modified from the standard UNIX Makefile Copyright Jean-loup Gailly
+# Osma Ahvenlampi <Osma.Ahvenlampi@hut.fi>
+# Amiga, SAS/C 6.56 & Smake
+
+CC=sc
+CFLAGS=OPT
+#CFLAGS=OPT CPU=68030
+#CFLAGS=DEBUG=LINE
+LDFLAGS=LIB z.lib
+
+SCOPTIONS=OPTSCHED OPTINLINE OPTALIAS OPTTIME OPTINLOCAL STRMERGE \
+ NOICONS PARMS=BOTH NOSTACKCHECK UTILLIB NOVERSION ERRORREXX \
+ DEF=POSTINC
+
+OBJS = adler32.o compress.o crc32.o gzclose.o gzlib.o gzread.o gzwrite.o \
+ uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o
+
+TEST_OBJS = example.o minigzip.o
+
+all: SCOPTIONS example minigzip
+
+check: test
+test: all
+ example
+ echo hello world | minigzip | minigzip -d
+
+install: z.lib
+ copy clone zlib.h zconf.h INCLUDE:
+ copy clone z.lib LIB:
+
+z.lib: $(OBJS)
+ oml z.lib r $(OBJS)
+
+example: example.o z.lib
+ $(CC) $(CFLAGS) LINK TO $@ example.o $(LDFLAGS)
+
+minigzip: minigzip.o z.lib
+ $(CC) $(CFLAGS) LINK TO $@ minigzip.o $(LDFLAGS)
+
+mostlyclean: clean
+clean:
+ -delete force quiet example minigzip *.o z.lib foo.gz *.lnk SCOPTIONS
+
+SCOPTIONS: Makefile.sas
+ copy to $@ <from <
+$(SCOPTIONS)
+<
+
+# DO NOT DELETE THIS LINE -- make depend depends on it.
+
+adler32.o: zlib.h zconf.h
+compress.o: zlib.h zconf.h
+crc32.o: crc32.h zlib.h zconf.h
+deflate.o: deflate.h zutil.h zlib.h zconf.h
+example.o: zlib.h zconf.h
+gzclose.o: zlib.h zconf.h gzguts.h
+gzlib.o: zlib.h zconf.h gzguts.h
+gzread.o: zlib.h zconf.h gzguts.h
+gzwrite.o: zlib.h zconf.h gzguts.h
+inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
+inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
+infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
+inftrees.o: zutil.h zlib.h zconf.h inftrees.h
+minigzip.o: zlib.h zconf.h
+trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
+uncompr.o: zlib.h zconf.h
+zutil.o: zutil.h zlib.h zconf.h
diff --git a/protocols/Telegram/tgl/zlib/as400/bndsrc b/protocols/Telegram/tgl/zlib/as400/bndsrc
new file mode 100644
index 0000000000..98814fd4c1
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/as400/bndsrc
@@ -0,0 +1,215 @@
+STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('ZLIB')
+
+/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
+/* Version 1.1.3 entry points. */
+/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
+
+/********************************************************************/
+/* *MODULE ADLER32 ZLIB 01/02/01 00:15:09 */
+/********************************************************************/
+
+ EXPORT SYMBOL("adler32")
+
+/********************************************************************/
+/* *MODULE COMPRESS ZLIB 01/02/01 00:15:09 */
+/********************************************************************/
+
+ EXPORT SYMBOL("compress")
+ EXPORT SYMBOL("compress2")
+
+/********************************************************************/
+/* *MODULE CRC32 ZLIB 01/02/01 00:15:09 */
+/********************************************************************/
+
+ EXPORT SYMBOL("crc32")
+ EXPORT SYMBOL("get_crc_table")
+
+/********************************************************************/
+/* *MODULE DEFLATE ZLIB 01/02/01 00:15:09 */
+/********************************************************************/
+
+ EXPORT SYMBOL("deflate")
+ EXPORT SYMBOL("deflateEnd")
+ EXPORT SYMBOL("deflateSetDictionary")
+ EXPORT SYMBOL("deflateCopy")
+ EXPORT SYMBOL("deflateReset")
+ EXPORT SYMBOL("deflateParams")
+ EXPORT SYMBOL("deflatePrime")
+ EXPORT SYMBOL("deflateInit_")
+ EXPORT SYMBOL("deflateInit2_")
+
+/********************************************************************/
+/* *MODULE GZIO ZLIB 01/02/01 00:15:09 */
+/********************************************************************/
+
+ EXPORT SYMBOL("gzopen")
+ EXPORT SYMBOL("gzdopen")
+ EXPORT SYMBOL("gzsetparams")
+ EXPORT SYMBOL("gzread")
+ EXPORT SYMBOL("gzwrite")
+ EXPORT SYMBOL("gzprintf")
+ EXPORT SYMBOL("gzputs")
+ EXPORT SYMBOL("gzgets")
+ EXPORT SYMBOL("gzputc")
+ EXPORT SYMBOL("gzgetc")
+ EXPORT SYMBOL("gzflush")
+ EXPORT SYMBOL("gzseek")
+ EXPORT SYMBOL("gzrewind")
+ EXPORT SYMBOL("gztell")
+ EXPORT SYMBOL("gzeof")
+ EXPORT SYMBOL("gzclose")
+ EXPORT SYMBOL("gzerror")
+
+/********************************************************************/
+/* *MODULE INFLATE ZLIB 01/02/01 00:15:09 */
+/********************************************************************/
+
+ EXPORT SYMBOL("inflate")
+ EXPORT SYMBOL("inflateEnd")
+ EXPORT SYMBOL("inflateSetDictionary")
+ EXPORT SYMBOL("inflateSync")
+ EXPORT SYMBOL("inflateReset")
+ EXPORT SYMBOL("inflateInit_")
+ EXPORT SYMBOL("inflateInit2_")
+ EXPORT SYMBOL("inflateSyncPoint")
+
+/********************************************************************/
+/* *MODULE UNCOMPR ZLIB 01/02/01 00:15:09 */
+/********************************************************************/
+
+ EXPORT SYMBOL("uncompress")
+
+/********************************************************************/
+/* *MODULE ZUTIL ZLIB 01/02/01 00:15:09 */
+/********************************************************************/
+
+ EXPORT SYMBOL("zlibVersion")
+ EXPORT SYMBOL("zError")
+
+/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
+/* Version 1.2.1 additional entry points. */
+/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
+
+/********************************************************************/
+/* *MODULE COMPRESS ZLIB 01/02/01 00:15:09 */
+/********************************************************************/
+
+ EXPORT SYMBOL("compressBound")
+
+/********************************************************************/
+/* *MODULE DEFLATE ZLIB 01/02/01 00:15:09 */
+/********************************************************************/
+
+ EXPORT SYMBOL("deflateBound")
+
+/********************************************************************/
+/* *MODULE GZIO ZLIB 01/02/01 00:15:09 */
+/********************************************************************/
+
+ EXPORT SYMBOL("gzungetc")
+ EXPORT SYMBOL("gzclearerr")
+
+/********************************************************************/
+/* *MODULE INFBACK ZLIB 01/02/01 00:15:09 */
+/********************************************************************/
+
+ EXPORT SYMBOL("inflateBack")
+ EXPORT SYMBOL("inflateBackEnd")
+ EXPORT SYMBOL("inflateBackInit_")
+
+/********************************************************************/
+/* *MODULE INFLATE ZLIB 01/02/01 00:15:09 */
+/********************************************************************/
+
+ EXPORT SYMBOL("inflateCopy")
+
+/********************************************************************/
+/* *MODULE ZUTIL ZLIB 01/02/01 00:15:09 */
+/********************************************************************/
+
+ EXPORT SYMBOL("zlibCompileFlags")
+
+/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
+/* Version 1.2.5 additional entry points. */
+/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
+
+/********************************************************************/
+/* *MODULE ADLER32 ZLIB 01/02/01 00:15:09 */
+/********************************************************************/
+
+ EXPORT SYMBOL("adler32_combine")
+ EXPORT SYMBOL("adler32_combine64")
+
+/********************************************************************/
+/* *MODULE CRC32 ZLIB 01/02/01 00:15:09 */
+/********************************************************************/
+
+ EXPORT SYMBOL("crc32_combine")
+ EXPORT SYMBOL("crc32_combine64")
+
+/********************************************************************/
+/* *MODULE GZLIB ZLIB 01/02/01 00:15:09 */
+/********************************************************************/
+
+ EXPORT SYMBOL("gzbuffer")
+ EXPORT SYMBOL("gzoffset")
+ EXPORT SYMBOL("gzoffset64")
+ EXPORT SYMBOL("gzopen64")
+ EXPORT SYMBOL("gzseek64")
+ EXPORT SYMBOL("gztell64")
+
+/********************************************************************/
+/* *MODULE GZREAD ZLIB 01/02/01 00:15:09 */
+/********************************************************************/
+
+ EXPORT SYMBOL("gzclose_r")
+
+/********************************************************************/
+/* *MODULE GZWRITE ZLIB 01/02/01 00:15:09 */
+/********************************************************************/
+
+ EXPORT SYMBOL("gzclose_w")
+
+/********************************************************************/
+/* *MODULE INFLATE ZLIB 01/02/01 00:15:09 */
+/********************************************************************/
+
+ EXPORT SYMBOL("inflateMark")
+ EXPORT SYMBOL("inflatePrime")
+ EXPORT SYMBOL("inflateReset2")
+ EXPORT SYMBOL("inflateUndermine")
+
+/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
+/* Version 1.2.6 additional entry points. */
+/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
+
+/********************************************************************/
+/* *MODULE DEFLATE ZLIB 01/02/01 00:15:09 */
+/********************************************************************/
+
+ EXPORT SYMBOL("deflateResetKeep")
+ EXPORT SYMBOL("deflatePending")
+
+/********************************************************************/
+/* *MODULE GZWRITE ZLIB 01/02/01 00:15:09 */
+/********************************************************************/
+
+ EXPORT SYMBOL("gzgetc_")
+
+/********************************************************************/
+/* *MODULE INFLATE ZLIB 01/02/01 00:15:09 */
+/********************************************************************/
+
+ EXPORT SYMBOL("inflateResetKeep")
+
+/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
+/* Version 1.2.8 additional entry points. */
+/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
+
+/********************************************************************/
+/* *MODULE INFLATE ZLIB 01/02/01 00:15:09 */
+/********************************************************************/
+
+ EXPORT SYMBOL("inflateGetDictionary")
+
+ENDPGMEXP
diff --git a/protocols/Telegram/tgl/zlib/as400/compile.clp b/protocols/Telegram/tgl/zlib/as400/compile.clp
new file mode 100644
index 0000000000..e3f47c6387
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/as400/compile.clp
@@ -0,0 +1,110 @@
+/******************************************************************************/
+/* */
+/* ZLIB */
+/* */
+/* Compile sources into modules and link them into a service program. */
+/* */
+/******************************************************************************/
+
+ PGM
+
+/* Configuration adjustable parameters. */
+
+ DCL VAR(&SRCLIB) TYPE(*CHAR) LEN(10) +
+ VALUE('ZLIB') /* Source library. */
+ DCL VAR(&SRCFILE) TYPE(*CHAR) LEN(10) +
+ VALUE('SOURCES') /* Source member file. */
+ DCL VAR(&CTLFILE) TYPE(*CHAR) LEN(10) +
+ VALUE('TOOLS') /* Control member file. */
+
+ DCL VAR(&MODLIB) TYPE(*CHAR) LEN(10) +
+ VALUE('ZLIB') /* Module library. */
+
+ DCL VAR(&SRVLIB) TYPE(*CHAR) LEN(10) +
+ VALUE('LGPL') /* Service program library. */
+
+ DCL VAR(&CFLAGS) TYPE(*CHAR) +
+ VALUE('OPTIMIZE(40)') /* Compile options. */
+
+ DCL VAR(&TGTRLS) TYPE(*CHAR) +
+ VALUE('V5R3M0') /* Target release. */
+
+
+/* Working storage. */
+
+ DCL VAR(&CMDLEN) TYPE(*DEC) LEN(15 5) VALUE(300) /* Command length. */
+ DCL VAR(&CMD) TYPE(*CHAR) LEN(512)
+ DCL VAR(&FIXDCMD) TYPE(*CHAR) LEN(512)
+
+
+/* Compile sources into modules. */
+
+ CHGVAR VAR(&FIXDCMD) VALUE('CRTCMOD' *BCAT &CFLAGS *BCAT +
+ 'SYSIFCOPT(*IFS64IO)' *BCAT +
+ 'DEFINE(''_LARGEFILE64_SOURCE''' *BCAT +
+ '''_LFS64_LARGEFILE=1'') TGTRLS(' *TCAT &TGTRLS *TCAT +
+ ') SRCFILE(' *TCAT &SRCLIB *TCAT '/' *TCAT +
+ &SRCFILE *TCAT ') MODULE(' *TCAT &MODLIB *TCAT '/')
+
+
+ CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'ADLER32)')
+ CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
+
+ CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'COMPRESS)')
+ CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
+
+ CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'CRC32)')
+ CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
+
+ CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'DEFLATE)')
+ CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
+
+ CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'GZCLOSE)')
+ CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
+
+ CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'GZLIB)')
+ CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
+
+ CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'GZREAD)')
+ CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
+
+ CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'GZWRITE)')
+ CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
+
+ CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'INFBACK)')
+ CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
+
+ CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'INFFAST)')
+ CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
+
+ CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'INFLATE)')
+ CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
+
+ CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'INFTREES)')
+ CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
+
+ CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'TREES)')
+ CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
+
+ CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'UNCOMPR)')
+ CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
+
+ CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'ZUTIL)')
+ CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
+
+
+/* Link modules into a service program. */
+
+ CRTSRVPGM SRVPGM(&SRVLIB/ZLIB) +
+ MODULE(&MODLIB/ADLER32 &MODLIB/COMPRESS +
+ &MODLIB/CRC32 &MODLIB/DEFLATE +
+ &MODLIB/GZCLOSE &MODLIB/GZLIB +
+ &MODLIB/GZREAD &MODLIB/GZWRITE +
+ &MODLIB/INFBACK &MODLIB/INFFAST +
+ &MODLIB/INFLATE &MODLIB/INFTREES +
+ &MODLIB/TREES &MODLIB/UNCOMPR +
+ &MODLIB/ZUTIL) +
+ SRCFILE(&SRCLIB/&CTLFILE) SRCMBR(BNDSRC) +
+ TEXT('ZLIB 1.2.8') TGTRLS(&TGTRLS)
+
+ ENDPGM
diff --git a/protocols/Telegram/tgl/zlib/as400/readme.txt b/protocols/Telegram/tgl/zlib/as400/readme.txt
new file mode 100644
index 0000000000..7b5d93bf51
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/as400/readme.txt
@@ -0,0 +1,115 @@
+ ZLIB version 1.2.8 for AS400 installation instructions
+
+I) From an AS400 *SAVF file:
+
+1) Unpacking archive to an AS400 save file
+
+On the AS400:
+
+_ Create the ZLIB AS400 library:
+
+ CRTLIB LIB(ZLIB) TYPE(*PROD) TEXT('ZLIB compression API library')
+
+_ Create a work save file, for example:
+
+ CRTSAVF FILE(ZLIB/ZLIBSAVF)
+
+On a PC connected to the target AS400:
+
+_ Unpack the save file image to a PC file "ZLIBSAVF"
+_ Upload this file into the save file on the AS400, for example
+ using ftp in BINARY mode.
+
+
+2) Populating the ZLIB AS400 source library
+
+On the AS400:
+
+_ Extract the saved objects into the ZLIB AS400 library using:
+
+RSTOBJ OBJ(*ALL) SAVLIB(ZLIB) DEV(*SAVF) SAVF(ZLIB/ZLIBSAVF) RSTLIB(ZLIB)
+
+
+3) Customize installation:
+
+_ Edit CL member ZLIB/TOOLS(COMPILE) and change parameters if needed,
+ according to the comments.
+
+_ Compile this member with:
+
+ CRTCLPGM PGM(ZLIB/COMPILE) SRCFILE(ZLIB/TOOLS) SRCMBR(COMPILE)
+
+
+4) Compile and generate the service program:
+
+_ This can now be done by executing:
+
+ CALL PGM(ZLIB/COMPILE)
+
+
+
+II) From the original source distribution:
+
+1) On the AS400, create the source library:
+
+ CRTLIB LIB(ZLIB) TYPE(*PROD) TEXT('ZLIB compression API library')
+
+2) Create the source files:
+
+ CRTSRCPF FILE(ZLIB/SOURCES) RCDLEN(112) TEXT('ZLIB library modules')
+ CRTSRCPF FILE(ZLIB/H) RCDLEN(112) TEXT('ZLIB library includes')
+ CRTSRCPF FILE(ZLIB/TOOLS) RCDLEN(112) TEXT('ZLIB library control utilities')
+
+3) From the machine hosting the distribution files, upload them (with
+ FTP in text mode, for example) according to the following table:
+
+ Original AS400 AS400 AS400 AS400
+ file file member type description
+ SOURCES Original ZLIB C subprogram sources
+ adler32.c ADLER32 C ZLIB - Compute the Adler-32 checksum of a dta strm
+ compress.c COMPRESS C ZLIB - Compress a memory buffer
+ crc32.c CRC32 C ZLIB - Compute the CRC-32 of a data stream
+ deflate.c DEFLATE C ZLIB - Compress data using the deflation algorithm
+ gzclose.c GZCLOSE C ZLIB - Close .gz files
+ gzlib.c GZLIB C ZLIB - Miscellaneous .gz files IO support
+ gzread.c GZREAD C ZLIB - Read .gz files
+ gzwrite.c GZWRITE C ZLIB - Write .gz files
+ infback.c INFBACK C ZLIB - Inflate using a callback interface
+ inffast.c INFFAST C ZLIB - Fast proc. literals & length/distance pairs
+ inflate.c INFLATE C ZLIB - Interface to inflate modules
+ inftrees.c INFTREES C ZLIB - Generate Huffman trees for efficient decode
+ trees.c TREES C ZLIB - Output deflated data using Huffman coding
+ uncompr.c UNCOMPR C ZLIB - Decompress a memory buffer
+ zutil.c ZUTIL C ZLIB - Target dependent utility functions
+ H Original ZLIB C and ILE/RPG include files
+ crc32.h CRC32 C ZLIB - CRC32 tables
+ deflate.h DEFLATE C ZLIB - Internal compression state
+ gzguts.h GZGUTS C ZLIB - Definitions for the gzclose module
+ inffast.h INFFAST C ZLIB - Header to use inffast.c
+ inffixed.h INFFIXED C ZLIB - Table for decoding fixed codes
+ inflate.h INFLATE C ZLIB - Internal inflate state definitions
+ inftrees.h INFTREES C ZLIB - Header to use inftrees.c
+ trees.h TREES C ZLIB - Created automatically with -DGEN_TREES_H
+ zconf.h ZCONF C ZLIB - Compression library configuration
+ zlib.h ZLIB C ZLIB - Compression library C user interface
+ as400/zlib.inc ZLIB.INC RPGLE ZLIB - Compression library ILE RPG user interface
+ zutil.h ZUTIL C ZLIB - Internal interface and configuration
+ TOOLS Building source software & AS/400 README
+ as400/bndsrc BNDSRC Entry point exportation list
+ as400/compile.clp COMPILE CLP Compile sources & generate service program
+ as400/readme.txt README TXT Installation instructions
+
+4) Continue as in I)3).
+
+
+
+
+Notes: For AS400 ILE RPG programmers, a /copy member defining the ZLIB
+ API prototypes for ILE RPG can be found in ZLIB/H(ZLIB.INC).
+ Please read comments in this member for more information.
+
+ Remember that most foreign textual data are ASCII coded: this
+ implementation does not handle conversion from/to ASCII, so
+ text data code conversions must be done explicitely.
+
+ Mainly for the reason above, always open zipped files in binary mode.
diff --git a/protocols/Telegram/tgl/zlib/as400/zlib.inc b/protocols/Telegram/tgl/zlib/as400/zlib.inc
new file mode 100644
index 0000000000..7341a6d818
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/as400/zlib.inc
@@ -0,0 +1,451 @@
+ * ZLIB.INC - Interface to the general purpose compression library
+ *
+ * ILE RPG400 version by Patrick Monnerat, DATASPHERE.
+ * Version 1.2.8
+ *
+ *
+ * WARNING:
+ * Procedures inflateInit(), inflateInit2(), deflateInit(),
+ * deflateInit2() and inflateBackInit() need to be called with
+ * two additional arguments:
+ * the package version string and the stream control structure.
+ * size. This is needed because RPG lacks some macro feature.
+ * Call these procedures as:
+ * inflateInit(...: ZLIB_VERSION: %size(z_stream))
+ *
+ /if not defined(ZLIB_H_)
+ /define ZLIB_H_
+ *
+ **************************************************************************
+ * Constants
+ **************************************************************************
+ *
+ * Versioning information.
+ *
+ D ZLIB_VERSION C '1.2.8'
+ D ZLIB_VERNUM C X'1280'
+ D ZLIB_VER_MAJOR C 1
+ D ZLIB_VER_MINOR C 2
+ D ZLIB_VER_REVISION...
+ D C 8
+ D ZLIB_VER_SUBREVISION...
+ D C 0
+ *
+ * Other equates.
+ *
+ D Z_NO_FLUSH C 0
+ D Z_PARTIAL_FLUSH...
+ D C 1
+ D Z_SYNC_FLUSH C 2
+ D Z_FULL_FLUSH C 3
+ D Z_FINISH C 4
+ D Z_BLOCK C 5
+ D Z_TREES C 6
+ *
+ D Z_OK C 0
+ D Z_STREAM_END C 1
+ D Z_NEED_DICT C 2
+ D Z_ERRNO C -1
+ D Z_STREAM_ERROR C -2
+ D Z_DATA_ERROR C -3
+ D Z_MEM_ERROR C -4
+ D Z_BUF_ERROR C -5
+ DZ_VERSION_ERROR C -6
+ *
+ D Z_NO_COMPRESSION...
+ D C 0
+ D Z_BEST_SPEED C 1
+ D Z_BEST_COMPRESSION...
+ D C 9
+ D Z_DEFAULT_COMPRESSION...
+ D C -1
+ *
+ D Z_FILTERED C 1
+ D Z_HUFFMAN_ONLY C 2
+ D Z_RLE C 3
+ D Z_DEFAULT_STRATEGY...
+ D C 0
+ *
+ D Z_BINARY C 0
+ D Z_ASCII C 1
+ D Z_UNKNOWN C 2
+ *
+ D Z_DEFLATED C 8
+ *
+ D Z_NULL C 0
+ *
+ **************************************************************************
+ * Types
+ **************************************************************************
+ *
+ D z_streamp S * Stream struct ptr
+ D gzFile S * File pointer
+ D z_off_t S 10i 0 Stream offsets
+ D z_off64_t S 20i 0 Stream offsets
+ *
+ **************************************************************************
+ * Structures
+ **************************************************************************
+ *
+ * The GZIP encode/decode stream support structure.
+ *
+ D z_stream DS align based(z_streamp)
+ D zs_next_in * Next input byte
+ D zs_avail_in 10U 0 Byte cnt at next_in
+ D zs_total_in 10U 0 Total bytes read
+ D zs_next_out * Output buffer ptr
+ D zs_avail_out 10U 0 Room left @ next_out
+ D zs_total_out 10U 0 Total bytes written
+ D zs_msg * Last errmsg or null
+ D zs_state * Internal state
+ D zs_zalloc * procptr Int. state allocator
+ D zs_free * procptr Int. state dealloc.
+ D zs_opaque * Private alloc. data
+ D zs_data_type 10i 0 ASC/BIN best guess
+ D zs_adler 10u 0 Uncompr. adler32 val
+ D 10U 0 Reserved
+ D 10U 0 Ptr. alignment
+ *
+ **************************************************************************
+ * Utility function prototypes
+ **************************************************************************
+ *
+ D compress PR 10I 0 extproc('compress')
+ D dest 65535 options(*varsize) Destination buffer
+ D destLen 10U 0 Destination length
+ D source 65535 const options(*varsize) Source buffer
+ D sourceLen 10u 0 value Source length
+ *
+ D compress2 PR 10I 0 extproc('compress2')
+ D dest 65535 options(*varsize) Destination buffer
+ D destLen 10U 0 Destination length
+ D source 65535 const options(*varsize) Source buffer
+ D sourceLen 10U 0 value Source length
+ D level 10I 0 value Compression level
+ *
+ D compressBound PR 10U 0 extproc('compressBound')
+ D sourceLen 10U 0 value
+ *
+ D uncompress PR 10I 0 extproc('uncompress')
+ D dest 65535 options(*varsize) Destination buffer
+ D destLen 10U 0 Destination length
+ D source 65535 const options(*varsize) Source buffer
+ D sourceLen 10U 0 value Source length
+ *
+ /if not defined(LARGE_FILES)
+ D gzopen PR extproc('gzopen')
+ D like(gzFile)
+ D path * value options(*string) File pathname
+ D mode * value options(*string) Open mode
+ /else
+ D gzopen PR extproc('gzopen64')
+ D like(gzFile)
+ D path * value options(*string) File pathname
+ D mode * value options(*string) Open mode
+ *
+ D gzopen64 PR extproc('gzopen64')
+ D like(gzFile)
+ D path * value options(*string) File pathname
+ D mode * value options(*string) Open mode
+ /endif
+ *
+ D gzdopen PR extproc('gzdopen')
+ D like(gzFile)
+ D fd 10I 0 value File descriptor
+ D mode * value options(*string) Open mode
+ *
+ D gzbuffer PR 10I 0 extproc('gzbuffer')
+ D file value like(gzFile) File pointer
+ D size 10U 0 value
+ *
+ D gzsetparams PR 10I 0 extproc('gzsetparams')
+ D file value like(gzFile) File pointer
+ D level 10I 0 value
+ D strategy 10I 0 value
+ *
+ D gzread PR 10I 0 extproc('gzread')
+ D file value like(gzFile) File pointer
+ D buf 65535 options(*varsize) Buffer
+ D len 10u 0 value Buffer length
+ *
+ D gzwrite PR 10I 0 extproc('gzwrite')
+ D file value like(gzFile) File pointer
+ D buf 65535 const options(*varsize) Buffer
+ D len 10u 0 value Buffer length
+ *
+ D gzputs PR 10I 0 extproc('gzputs')
+ D file value like(gzFile) File pointer
+ D s * value options(*string) String to output
+ *
+ D gzgets PR * extproc('gzgets')
+ D file value like(gzFile) File pointer
+ D buf 65535 options(*varsize) Read buffer
+ D len 10i 0 value Buffer length
+ *
+ D gzputc PR 10i 0 extproc('gzputc')
+ D file value like(gzFile) File pointer
+ D c 10I 0 value Character to write
+ *
+ D gzgetc PR 10i 0 extproc('gzgetc')
+ D file value like(gzFile) File pointer
+ *
+ D gzgetc_ PR 10i 0 extproc('gzgetc_')
+ D file value like(gzFile) File pointer
+ *
+ D gzungetc PR 10i 0 extproc('gzungetc')
+ D c 10I 0 value Character to push
+ D file value like(gzFile) File pointer
+ *
+ D gzflush PR 10i 0 extproc('gzflush')
+ D file value like(gzFile) File pointer
+ D flush 10I 0 value Type of flush
+ *
+ /if not defined(LARGE_FILES)
+ D gzseek PR extproc('gzseek')
+ D like(z_off_t)
+ D file value like(gzFile) File pointer
+ D offset value like(z_off_t) Offset
+ D whence 10i 0 value Origin
+ /else
+ D gzseek PR extproc('gzseek64')
+ D like(z_off_t)
+ D file value like(gzFile) File pointer
+ D offset value like(z_off_t) Offset
+ D whence 10i 0 value Origin
+ *
+ D gzseek64 PR extproc('gzseek64')
+ D like(z_off64_t)
+ D file value like(gzFile) File pointer
+ D offset value like(z_off64_t) Offset
+ D whence 10i 0 value Origin
+ /endif
+ *
+ D gzrewind PR 10i 0 extproc('gzrewind')
+ D file value like(gzFile) File pointer
+ *
+ /if not defined(LARGE_FILES)
+ D gztell PR extproc('gztell')
+ D like(z_off_t)
+ D file value like(gzFile) File pointer
+ /else
+ D gztell PR extproc('gztell64')
+ D like(z_off_t)
+ D file value like(gzFile) File pointer
+ *
+ D gztell64 PR extproc('gztell64')
+ D like(z_off64_t)
+ D file value like(gzFile) File pointer
+ /endif
+ *
+ /if not defined(LARGE_FILES)
+ D gzoffset PR extproc('gzoffset')
+ D like(z_off_t)
+ D file value like(gzFile) File pointer
+ /else
+ D gzoffset PR extproc('gzoffset64')
+ D like(z_off_t)
+ D file value like(gzFile) File pointer
+ *
+ D gzoffset64 PR extproc('gzoffset64')
+ D like(z_off64_t)
+ D file value like(gzFile) File pointer
+ /endif
+ *
+ D gzeof PR 10i 0 extproc('gzeof')
+ D file value like(gzFile) File pointer
+ *
+ D gzclose_r PR 10i 0 extproc('gzclose_r')
+ D file value like(gzFile) File pointer
+ *
+ D gzclose_w PR 10i 0 extproc('gzclose_w')
+ D file value like(gzFile) File pointer
+ *
+ D gzclose PR 10i 0 extproc('gzclose')
+ D file value like(gzFile) File pointer
+ *
+ D gzerror PR * extproc('gzerror') Error string
+ D file value like(gzFile) File pointer
+ D errnum 10I 0 Error code
+ *
+ D gzclearerr PR extproc('gzclearerr')
+ D file value like(gzFile) File pointer
+ *
+ **************************************************************************
+ * Basic function prototypes
+ **************************************************************************
+ *
+ D zlibVersion PR * extproc('zlibVersion') Version string
+ *
+ D deflateInit PR 10I 0 extproc('deflateInit_') Init. compression
+ D strm like(z_stream) Compression stream
+ D level 10I 0 value Compression level
+ D version * value options(*string) Version string
+ D stream_size 10i 0 value Stream struct. size
+ *
+ D deflate PR 10I 0 extproc('deflate') Compress data
+ D strm like(z_stream) Compression stream
+ D flush 10I 0 value Flush type required
+ *
+ D deflateEnd PR 10I 0 extproc('deflateEnd') Termin. compression
+ D strm like(z_stream) Compression stream
+ *
+ D inflateInit PR 10I 0 extproc('inflateInit_') Init. expansion
+ D strm like(z_stream) Expansion stream
+ D version * value options(*string) Version string
+ D stream_size 10i 0 value Stream struct. size
+ *
+ D inflate PR 10I 0 extproc('inflate') Expand data
+ D strm like(z_stream) Expansion stream
+ D flush 10I 0 value Flush type required
+ *
+ D inflateEnd PR 10I 0 extproc('inflateEnd') Termin. expansion
+ D strm like(z_stream) Expansion stream
+ *
+ **************************************************************************
+ * Advanced function prototypes
+ **************************************************************************
+ *
+ D deflateInit2 PR 10I 0 extproc('deflateInit2_') Init. compression
+ D strm like(z_stream) Compression stream
+ D level 10I 0 value Compression level
+ D method 10I 0 value Compression method
+ D windowBits 10I 0 value log2(window size)
+ D memLevel 10I 0 value Mem/cmpress tradeoff
+ D strategy 10I 0 value Compression stategy
+ D version * value options(*string) Version string
+ D stream_size 10i 0 value Stream struct. size
+ *
+ D deflateSetDictionary...
+ D PR 10I 0 extproc('deflateSetDictionary') Init. dictionary
+ D strm like(z_stream) Compression stream
+ D dictionary 65535 const options(*varsize) Dictionary bytes
+ D dictLength 10U 0 value Dictionary length
+ *
+ D deflateCopy PR 10I 0 extproc('deflateCopy') Compress strm 2 strm
+ D dest like(z_stream) Destination stream
+ D source like(z_stream) Source stream
+ *
+ D deflateReset PR 10I 0 extproc('deflateReset') End and init. stream
+ D strm like(z_stream) Compression stream
+ *
+ D deflateParams PR 10I 0 extproc('deflateParams') Change level & strat
+ D strm like(z_stream) Compression stream
+ D level 10I 0 value Compression level
+ D strategy 10I 0 value Compression stategy
+ *
+ D deflateBound PR 10U 0 extproc('deflateBound') Change level & strat
+ D strm like(z_stream) Compression stream
+ D sourcelen 10U 0 value Compression level
+ *
+ D deflatePending PR 10I 0 extproc('deflatePending') Change level & strat
+ D strm like(z_stream) Compression stream
+ D pending 10U 0 Pending bytes
+ D bits 10I 0 Pending bits
+ *
+ D deflatePrime PR 10I 0 extproc('deflatePrime') Change level & strat
+ D strm like(z_stream) Compression stream
+ D bits 10I 0 value # of bits to insert
+ D value 10I 0 value Bits to insert
+ *
+ D inflateInit2 PR 10I 0 extproc('inflateInit2_') Init. expansion
+ D strm like(z_stream) Expansion stream
+ D windowBits 10I 0 value log2(window size)
+ D version * value options(*string) Version string
+ D stream_size 10i 0 value Stream struct. size
+ *
+ D inflateSetDictionary...
+ D PR 10I 0 extproc('inflateSetDictionary') Init. dictionary
+ D strm like(z_stream) Expansion stream
+ D dictionary 65535 const options(*varsize) Dictionary bytes
+ D dictLength 10U 0 value Dictionary length
+ *
+ D inflateGetDictionary...
+ D PR 10I 0 extproc('inflateGetDictionary') Get dictionary
+ D strm like(z_stream) Expansion stream
+ D dictionary 65535 options(*varsize) Dictionary bytes
+ D dictLength 10U 0 Dictionary length
+ *
+ D inflateSync PR 10I 0 extproc('inflateSync') Sync. expansion
+ D strm like(z_stream) Expansion stream
+ *
+ D inflateCopy PR 10I 0 extproc('inflateCopy')
+ D dest like(z_stream) Destination stream
+ D source like(z_stream) Source stream
+ *
+ D inflateReset PR 10I 0 extproc('inflateReset') End and init. stream
+ D strm like(z_stream) Expansion stream
+ *
+ D inflateReset2 PR 10I 0 extproc('inflateReset2') End and init. stream
+ D strm like(z_stream) Expansion stream
+ D windowBits 10I 0 value Log2(buffer size)
+ *
+ D inflatePrime PR 10I 0 extproc('inflatePrime') Insert bits
+ D strm like(z_stream) Expansion stream
+ D bits 10I 0 value Bit count
+ D value 10I 0 value Bits to insert
+ *
+ D inflateMark PR 10I 0 extproc('inflateMark') Get inflate info
+ D strm like(z_stream) Expansion stream
+ *
+ D inflateBackInit...
+ D PR 10I 0 extproc('inflateBackInit_')
+ D strm like(z_stream) Expansion stream
+ D windowBits 10I 0 value Log2(buffer size)
+ D window 65535 options(*varsize) Buffer
+ D version * value options(*string) Version string
+ D stream_size 10i 0 value Stream struct. size
+ *
+ D inflateBack PR 10I 0 extproc('inflateBack')
+ D strm like(z_stream) Expansion stream
+ D in * value procptr Input function
+ D in_desc * value Input descriptor
+ D out * value procptr Output function
+ D out_desc * value Output descriptor
+ *
+ D inflateBackEnd PR 10I 0 extproc('inflateBackEnd')
+ D strm like(z_stream) Expansion stream
+ *
+ D zlibCompileFlags...
+ D PR 10U 0 extproc('zlibCompileFlags')
+ *
+ **************************************************************************
+ * Checksum function prototypes
+ **************************************************************************
+ *
+ D adler32 PR 10U 0 extproc('adler32') New checksum
+ D adler 10U 0 value Old checksum
+ D buf 65535 const options(*varsize) Bytes to accumulate
+ D len 10U 0 value Buffer length
+ *
+ D crc32 PR 10U 0 extproc('crc32') New checksum
+ D crc 10U 0 value Old checksum
+ D buf 65535 const options(*varsize) Bytes to accumulate
+ D len 10U 0 value Buffer length
+ *
+ **************************************************************************
+ * Miscellaneous function prototypes
+ **************************************************************************
+ *
+ D zError PR * extproc('zError') Error string
+ D err 10I 0 value Error code
+ *
+ D inflateSyncPoint...
+ D PR 10I 0 extproc('inflateSyncPoint')
+ D strm like(z_stream) Expansion stream
+ *
+ D get_crc_table PR * extproc('get_crc_table') Ptr to ulongs
+ *
+ D inflateUndermine...
+ D PR 10I 0 extproc('inflateUndermine')
+ D strm like(z_stream) Expansion stream
+ D arg 10I 0 value Error code
+ *
+ D inflateResetKeep...
+ D PR 10I 0 extproc('inflateResetKeep') End and init. stream
+ D strm like(z_stream) Expansion stream
+ *
+ D deflateResetKeep...
+ D PR 10I 0 extproc('deflateResetKeep') End and init. stream
+ D strm like(z_stream) Expansion stream
+ *
+ /endif
diff --git a/protocols/Telegram/tgl/zlib/compress.c b/protocols/Telegram/tgl/zlib/compress.c
new file mode 100644
index 0000000000..6e9762676a
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/compress.c
@@ -0,0 +1,80 @@
+/* compress.c -- compress a memory buffer
+ * Copyright (C) 1995-2005 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#define ZLIB_INTERNAL
+#include "zlib.h"
+
+/* ===========================================================================
+ Compresses the source buffer into the destination buffer. The level
+ parameter has the same meaning as in deflateInit. sourceLen is the byte
+ length of the source buffer. Upon entry, destLen is the total size of the
+ destination buffer, which must be at least 0.1% larger than sourceLen plus
+ 12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
+
+ compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_BUF_ERROR if there was not enough room in the output buffer,
+ Z_STREAM_ERROR if the level parameter is invalid.
+*/
+int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
+ Bytef *dest;
+ uLongf *destLen;
+ const Bytef *source;
+ uLong sourceLen;
+ int level;
+{
+ z_stream stream;
+ int err;
+
+ stream.next_in = (z_const Bytef *)source;
+ stream.avail_in = (uInt)sourceLen;
+#ifdef MAXSEG_64K
+ /* Check for source > 64K on 16-bit machine: */
+ if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
+#endif
+ stream.next_out = dest;
+ stream.avail_out = (uInt)*destLen;
+ if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
+
+ stream.zalloc = (alloc_func)0;
+ stream.zfree = (free_func)0;
+ stream.opaque = (voidpf)0;
+
+ err = deflateInit(&stream, level);
+ if (err != Z_OK) return err;
+
+ err = deflate(&stream, Z_FINISH);
+ if (err != Z_STREAM_END) {
+ deflateEnd(&stream);
+ return err == Z_OK ? Z_BUF_ERROR : err;
+ }
+ *destLen = stream.total_out;
+
+ err = deflateEnd(&stream);
+ return err;
+}
+
+/* ===========================================================================
+ */
+int ZEXPORT compress (dest, destLen, source, sourceLen)
+ Bytef *dest;
+ uLongf *destLen;
+ const Bytef *source;
+ uLong sourceLen;
+{
+ return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
+}
+
+/* ===========================================================================
+ If the default memLevel or windowBits for deflateInit() is changed, then
+ this function needs to be updated.
+ */
+uLong ZEXPORT compressBound (sourceLen)
+ uLong sourceLen;
+{
+ return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
+ (sourceLen >> 25) + 13;
+}
diff --git a/protocols/Telegram/tgl/zlib/configure b/protocols/Telegram/tgl/zlib/configure
new file mode 100644
index 0000000000..b77a8a8cf9
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/configure
@@ -0,0 +1,831 @@
+#!/bin/sh
+# configure script for zlib.
+#
+# Normally configure builds both a static and a shared library.
+# If you want to build just a static library, use: ./configure --static
+#
+# To impose specific compiler or flags or install directory, use for example:
+# prefix=$HOME CC=cc CFLAGS="-O4" ./configure
+# or for csh/tcsh users:
+# (setenv prefix $HOME; setenv CC cc; setenv CFLAGS "-O4"; ./configure)
+
+# Incorrect settings of CC or CFLAGS may prevent creating a shared library.
+# If you have problems, try without defining CC and CFLAGS before reporting
+# an error.
+
+# start off configure.log
+echo -------------------- >> configure.log
+echo $0 $* >> configure.log
+date >> configure.log
+
+# set command prefix for cross-compilation
+if [ -n "${CHOST}" ]; then
+ uname="`echo "${CHOST}" | sed -e 's/^[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)-.*$/\1/'`"
+ CROSS_PREFIX="${CHOST}-"
+fi
+
+# destination name for static library
+STATICLIB=libz.a
+
+# extract zlib version numbers from zlib.h
+VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`
+VER3=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\\.[0-9]*\).*/\1/p' < zlib.h`
+VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < zlib.h`
+VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < zlib.h`
+
+# establish commands for library building
+if "${CROSS_PREFIX}ar" --version >/dev/null 2>/dev/null || test $? -lt 126; then
+ AR=${AR-"${CROSS_PREFIX}ar"}
+ test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log
+else
+ AR=${AR-"ar"}
+ test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log
+fi
+ARFLAGS=${ARFLAGS-"rc"}
+if "${CROSS_PREFIX}ranlib" --version >/dev/null 2>/dev/null || test $? -lt 126; then
+ RANLIB=${RANLIB-"${CROSS_PREFIX}ranlib"}
+ test -n "${CROSS_PREFIX}" && echo Using ${RANLIB} | tee -a configure.log
+else
+ RANLIB=${RANLIB-"ranlib"}
+fi
+if "${CROSS_PREFIX}nm" --version >/dev/null 2>/dev/null || test $? -lt 126; then
+ NM=${NM-"${CROSS_PREFIX}nm"}
+ test -n "${CROSS_PREFIX}" && echo Using ${NM} | tee -a configure.log
+else
+ NM=${NM-"nm"}
+fi
+
+# set defaults before processing command line options
+LDCONFIG=${LDCONFIG-"ldconfig"}
+LDSHAREDLIBC="${LDSHAREDLIBC--lc}"
+ARCHS=
+prefix=${prefix-/usr/local}
+exec_prefix=${exec_prefix-'${prefix}'}
+libdir=${libdir-'${exec_prefix}/lib'}
+sharedlibdir=${sharedlibdir-'${libdir}'}
+includedir=${includedir-'${prefix}/include'}
+mandir=${mandir-'${prefix}/share/man'}
+shared_ext='.so'
+shared=1
+solo=0
+cover=0
+zprefix=0
+zconst=0
+build64=0
+gcc=0
+old_cc="$CC"
+old_cflags="$CFLAGS"
+OBJC='$(OBJZ) $(OBJG)'
+PIC_OBJC='$(PIC_OBJZ) $(PIC_OBJG)'
+
+# leave this script, optionally in a bad way
+leave()
+{
+ if test "$*" != "0"; then
+ echo "** $0 aborting." | tee -a configure.log
+ fi
+ rm -f $test.[co] $test $test$shared_ext $test.gcno ./--version
+ echo -------------------- >> configure.log
+ echo >> configure.log
+ echo >> configure.log
+ exit $1
+}
+
+# process command line options
+while test $# -ge 1
+do
+case "$1" in
+ -h* | --help)
+ echo 'usage:' | tee -a configure.log
+ echo ' configure [--const] [--zprefix] [--prefix=PREFIX] [--eprefix=EXPREFIX]' | tee -a configure.log
+ echo ' [--static] [--64] [--libdir=LIBDIR] [--sharedlibdir=LIBDIR]' | tee -a configure.log
+ echo ' [--includedir=INCLUDEDIR] [--archs="-arch i386 -arch x86_64"]' | tee -a configure.log
+ exit 0 ;;
+ -p*=* | --prefix=*) prefix=`echo $1 | sed 's/.*=//'`; shift ;;
+ -e*=* | --eprefix=*) exec_prefix=`echo $1 | sed 's/.*=//'`; shift ;;
+ -l*=* | --libdir=*) libdir=`echo $1 | sed 's/.*=//'`; shift ;;
+ --sharedlibdir=*) sharedlibdir=`echo $1 | sed 's/.*=//'`; shift ;;
+ -i*=* | --includedir=*) includedir=`echo $1 | sed 's/.*=//'`;shift ;;
+ -u*=* | --uname=*) uname=`echo $1 | sed 's/.*=//'`;shift ;;
+ -p* | --prefix) prefix="$2"; shift; shift ;;
+ -e* | --eprefix) exec_prefix="$2"; shift; shift ;;
+ -l* | --libdir) libdir="$2"; shift; shift ;;
+ -i* | --includedir) includedir="$2"; shift; shift ;;
+ -s* | --shared | --enable-shared) shared=1; shift ;;
+ -t | --static) shared=0; shift ;;
+ --solo) solo=1; shift ;;
+ --cover) cover=1; shift ;;
+ -z* | --zprefix) zprefix=1; shift ;;
+ -6* | --64) build64=1; shift ;;
+ -a*=* | --archs=*) ARCHS=`echo $1 | sed 's/.*=//'`; shift ;;
+ --sysconfdir=*) echo "ignored option: --sysconfdir" | tee -a configure.log; shift ;;
+ --localstatedir=*) echo "ignored option: --localstatedir" | tee -a configure.log; shift ;;
+ -c* | --const) zconst=1; shift ;;
+ *)
+ echo "unknown option: $1" | tee -a configure.log
+ echo "$0 --help for help" | tee -a configure.log
+ leave 1;;
+ esac
+done
+
+# temporary file name
+test=ztest$$
+
+# put arguments in log, also put test file in log if used in arguments
+show()
+{
+ case "$*" in
+ *$test.c*)
+ echo === $test.c === >> configure.log
+ cat $test.c >> configure.log
+ echo === >> configure.log;;
+ esac
+ echo $* >> configure.log
+}
+
+# check for gcc vs. cc and set compile and link flags based on the system identified by uname
+cat > $test.c <<EOF
+extern int getchar();
+int hello() {return getchar();}
+EOF
+
+test -z "$CC" && echo Checking for ${CROSS_PREFIX}gcc... | tee -a configure.log
+cc=${CC-${CROSS_PREFIX}gcc}
+cflags=${CFLAGS-"-O3"}
+# to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
+case "$cc" in
+ *gcc*) gcc=1 ;;
+ *clang*) gcc=1 ;;
+esac
+case `$cc -v 2>&1` in
+ *gcc*) gcc=1 ;;
+esac
+
+show $cc -c $test.c
+if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
+ echo ... using gcc >> configure.log
+ CC="$cc"
+ CFLAGS="${CFLAGS--O3} ${ARCHS}"
+ SFLAGS="${CFLAGS--O3} -fPIC"
+ LDFLAGS="${LDFLAGS} ${ARCHS}"
+ if test $build64 -eq 1; then
+ CFLAGS="${CFLAGS} -m64"
+ SFLAGS="${SFLAGS} -m64"
+ fi
+ if test "${ZLIBGCCWARN}" = "YES"; then
+ if test "$zconst" -eq 1; then
+ CFLAGS="${CFLAGS} -Wall -Wextra -Wcast-qual -pedantic -DZLIB_CONST"
+ else
+ CFLAGS="${CFLAGS} -Wall -Wextra -pedantic"
+ fi
+ fi
+ if test -z "$uname"; then
+ uname=`(uname -s || echo unknown) 2>/dev/null`
+ fi
+ case "$uname" in
+ Linux* | linux* | GNU | GNU/* | solaris*)
+ LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"} ;;
+ *BSD | *bsd* | DragonFly)
+ LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"}
+ LDCONFIG="ldconfig -m" ;;
+ CYGWIN* | Cygwin* | cygwin* | OS/2*)
+ EXE='.exe' ;;
+ MINGW* | mingw*)
+# temporary bypass
+ rm -f $test.[co] $test $test$shared_ext
+ echo "Please use win32/Makefile.gcc instead." | tee -a configure.log
+ leave 1
+ LDSHARED=${LDSHARED-"$cc -shared"}
+ LDSHAREDLIBC=""
+ EXE='.exe' ;;
+ QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4
+ # (alain.bonnefoy@icbt.com)
+ LDSHARED=${LDSHARED-"$cc -shared -Wl,-hlibz.so.1"} ;;
+ HP-UX*)
+ LDSHARED=${LDSHARED-"$cc -shared $SFLAGS"}
+ case `(uname -m || echo unknown) 2>/dev/null` in
+ ia64)
+ shared_ext='.so'
+ SHAREDLIB='libz.so' ;;
+ *)
+ shared_ext='.sl'
+ SHAREDLIB='libz.sl' ;;
+ esac ;;
+ Darwin* | darwin*)
+ shared_ext='.dylib'
+ SHAREDLIB=libz$shared_ext
+ SHAREDLIBV=libz.$VER$shared_ext
+ SHAREDLIBM=libz.$VER1$shared_ext
+ LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"}
+ if libtool -V 2>&1 | grep Apple > /dev/null; then
+ AR="libtool"
+ else
+ AR="/usr/bin/libtool"
+ fi
+ ARFLAGS="-o" ;;
+ *) LDSHARED=${LDSHARED-"$cc -shared"} ;;
+ esac
+else
+ # find system name and corresponding cc options
+ CC=${CC-cc}
+ gcc=0
+ echo ... using $CC >> configure.log
+ if test -z "$uname"; then
+ uname=`(uname -sr || echo unknown) 2>/dev/null`
+ fi
+ case "$uname" in
+ HP-UX*) SFLAGS=${CFLAGS-"-O +z"}
+ CFLAGS=${CFLAGS-"-O"}
+# LDSHARED=${LDSHARED-"ld -b +vnocompatwarnings"}
+ LDSHARED=${LDSHARED-"ld -b"}
+ case `(uname -m || echo unknown) 2>/dev/null` in
+ ia64)
+ shared_ext='.so'
+ SHAREDLIB='libz.so' ;;
+ *)
+ shared_ext='.sl'
+ SHAREDLIB='libz.sl' ;;
+ esac ;;
+ IRIX*) SFLAGS=${CFLAGS-"-ansi -O2 -rpath ."}
+ CFLAGS=${CFLAGS-"-ansi -O2"}
+ LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so.1"} ;;
+ OSF1\ V4*) SFLAGS=${CFLAGS-"-O -std1"}
+ CFLAGS=${CFLAGS-"-O -std1"}
+ LDFLAGS="${LDFLAGS} -Wl,-rpath,."
+ LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"} ;;
+ OSF1*) SFLAGS=${CFLAGS-"-O -std1"}
+ CFLAGS=${CFLAGS-"-O -std1"}
+ LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so.1"} ;;
+ QNX*) SFLAGS=${CFLAGS-"-4 -O"}
+ CFLAGS=${CFLAGS-"-4 -O"}
+ LDSHARED=${LDSHARED-"cc"}
+ RANLIB=${RANLIB-"true"}
+ AR="cc"
+ ARFLAGS="-A" ;;
+ SCO_SV\ 3.2*) SFLAGS=${CFLAGS-"-O3 -dy -KPIC "}
+ CFLAGS=${CFLAGS-"-O3"}
+ LDSHARED=${LDSHARED-"cc -dy -KPIC -G"} ;;
+ SunOS\ 5* | solaris*)
+ LDSHARED=${LDSHARED-"cc -G -h libz$shared_ext.$VER1"}
+ SFLAGS=${CFLAGS-"-fast -KPIC"}
+ CFLAGS=${CFLAGS-"-fast"}
+ if test $build64 -eq 1; then
+ # old versions of SunPRO/Workshop/Studio don't support -m64,
+ # but newer ones do. Check for it.
+ flag64=`$CC -flags | egrep -- '^-m64'`
+ if test x"$flag64" != x"" ; then
+ CFLAGS="${CFLAGS} -m64"
+ SFLAGS="${SFLAGS} -m64"
+ else
+ case `(uname -m || echo unknown) 2>/dev/null` in
+ i86*)
+ SFLAGS="$SFLAGS -xarch=amd64"
+ CFLAGS="$CFLAGS -xarch=amd64" ;;
+ *)
+ SFLAGS="$SFLAGS -xarch=v9"
+ CFLAGS="$CFLAGS -xarch=v9" ;;
+ esac
+ fi
+ fi
+ ;;
+ SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"}
+ CFLAGS=${CFLAGS-"-O2"}
+ LDSHARED=${LDSHARED-"ld"} ;;
+ SunStudio\ 9*) SFLAGS=${CFLAGS-"-fast -xcode=pic32 -xtarget=ultra3 -xarch=v9b"}
+ CFLAGS=${CFLAGS-"-fast -xtarget=ultra3 -xarch=v9b"}
+ LDSHARED=${LDSHARED-"cc -xarch=v9b"} ;;
+ UNIX_System_V\ 4.2.0)
+ SFLAGS=${CFLAGS-"-KPIC -O"}
+ CFLAGS=${CFLAGS-"-O"}
+ LDSHARED=${LDSHARED-"cc -G"} ;;
+ UNIX_SV\ 4.2MP)
+ SFLAGS=${CFLAGS-"-Kconform_pic -O"}
+ CFLAGS=${CFLAGS-"-O"}
+ LDSHARED=${LDSHARED-"cc -G"} ;;
+ OpenUNIX\ 5)
+ SFLAGS=${CFLAGS-"-KPIC -O"}
+ CFLAGS=${CFLAGS-"-O"}
+ LDSHARED=${LDSHARED-"cc -G"} ;;
+ AIX*) # Courtesy of dbakker@arrayasolutions.com
+ SFLAGS=${CFLAGS-"-O -qmaxmem=8192"}
+ CFLAGS=${CFLAGS-"-O -qmaxmem=8192"}
+ LDSHARED=${LDSHARED-"xlc -G"} ;;
+ # send working options for other systems to zlib@gzip.org
+ *) SFLAGS=${CFLAGS-"-O"}
+ CFLAGS=${CFLAGS-"-O"}
+ LDSHARED=${LDSHARED-"cc -shared"} ;;
+ esac
+fi
+
+# destination names for shared library if not defined above
+SHAREDLIB=${SHAREDLIB-"libz$shared_ext"}
+SHAREDLIBV=${SHAREDLIBV-"libz$shared_ext.$VER"}
+SHAREDLIBM=${SHAREDLIBM-"libz$shared_ext.$VER1"}
+
+echo >> configure.log
+
+# define functions for testing compiler and library characteristics and logging the results
+
+cat > $test.c <<EOF
+#error error
+EOF
+if ($CC -c $CFLAGS $test.c) 2>/dev/null; then
+ try()
+ {
+ show $*
+ test "`( $* ) 2>&1 | tee -a configure.log`" = ""
+ }
+ echo - using any output from compiler to indicate an error >> configure.log
+else
+try()
+{
+ show $*
+ ( $* ) >> configure.log 2>&1
+ ret=$?
+ if test $ret -ne 0; then
+ echo "(exit code "$ret")" >> configure.log
+ fi
+ return $ret
+}
+fi
+
+tryboth()
+{
+ show $*
+ got=`( $* ) 2>&1`
+ ret=$?
+ printf %s "$got" >> configure.log
+ if test $ret -ne 0; then
+ return $ret
+ fi
+ test "$got" = ""
+}
+
+cat > $test.c << EOF
+int foo() { return 0; }
+EOF
+echo "Checking for obsessive-compulsive compiler options..." >> configure.log
+if try $CC -c $CFLAGS $test.c; then
+ :
+else
+ echo "Compiler error reporting is too harsh for $0 (perhaps remove -Werror)." | tee -a configure.log
+ leave 1
+fi
+
+echo >> configure.log
+
+# see if shared library build supported
+cat > $test.c <<EOF
+extern int getchar();
+int hello() {return getchar();}
+EOF
+if test $shared -eq 1; then
+ echo Checking for shared library support... | tee -a configure.log
+ # we must test in two steps (cc then ld), required at least on SunOS 4.x
+ if try $CC -w -c $SFLAGS $test.c &&
+ try $LDSHARED $SFLAGS -o $test$shared_ext $test.o; then
+ echo Building shared library $SHAREDLIBV with $CC. | tee -a configure.log
+ elif test -z "$old_cc" -a -z "$old_cflags"; then
+ echo No shared library support. | tee -a configure.log
+ shared=0;
+ else
+ echo 'No shared library support; try without defining CC and CFLAGS' | tee -a configure.log
+ shared=0;
+ fi
+fi
+if test $shared -eq 0; then
+ LDSHARED="$CC"
+ ALL="static"
+ TEST="all teststatic"
+ SHAREDLIB=""
+ SHAREDLIBV=""
+ SHAREDLIBM=""
+ echo Building static library $STATICLIB version $VER with $CC. | tee -a configure.log
+else
+ ALL="static shared"
+ TEST="all teststatic testshared"
+fi
+
+# check for underscores in external names for use by assembler code
+CPP=${CPP-"$CC -E"}
+case $CFLAGS in
+ *ASMV*)
+ echo >> configure.log
+ show "$NM $test.o | grep _hello"
+ if test "`$NM $test.o | grep _hello | tee -a configure.log`" = ""; then
+ CPP="$CPP -DNO_UNDERLINE"
+ echo Checking for underline in external names... No. | tee -a configure.log
+ else
+ echo Checking for underline in external names... Yes. | tee -a configure.log
+ fi ;;
+esac
+
+echo >> configure.log
+
+# check for large file support, and if none, check for fseeko()
+cat > $test.c <<EOF
+#include <sys/types.h>
+off64_t dummy = 0;
+EOF
+if try $CC -c $CFLAGS -D_LARGEFILE64_SOURCE=1 $test.c; then
+ CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE=1"
+ SFLAGS="${SFLAGS} -D_LARGEFILE64_SOURCE=1"
+ ALL="${ALL} all64"
+ TEST="${TEST} test64"
+ echo "Checking for off64_t... Yes." | tee -a configure.log
+ echo "Checking for fseeko... Yes." | tee -a configure.log
+else
+ echo "Checking for off64_t... No." | tee -a configure.log
+ echo >> configure.log
+ cat > $test.c <<EOF
+#include <stdio.h>
+int main(void) {
+ fseeko(NULL, 0, 0);
+ return 0;
+}
+EOF
+ if try $CC $CFLAGS -o $test $test.c; then
+ echo "Checking for fseeko... Yes." | tee -a configure.log
+ else
+ CFLAGS="${CFLAGS} -DNO_FSEEKO"
+ SFLAGS="${SFLAGS} -DNO_FSEEKO"
+ echo "Checking for fseeko... No." | tee -a configure.log
+ fi
+fi
+
+echo >> configure.log
+
+# check for strerror() for use by gz* functions
+cat > $test.c <<EOF
+#include <string.h>
+#include <errno.h>
+int main() { return strlen(strerror(errno)); }
+EOF
+if try $CC $CFLAGS -o $test $test.c; then
+ echo "Checking for strerror... Yes." | tee -a configure.log
+else
+ CFLAGS="${CFLAGS} -DNO_STRERROR"
+ SFLAGS="${SFLAGS} -DNO_STRERROR"
+ echo "Checking for strerror... No." | tee -a configure.log
+fi
+
+# copy clean zconf.h for subsequent edits
+cp -p zconf.h.in zconf.h
+
+echo >> configure.log
+
+# check for unistd.h and save result in zconf.h
+cat > $test.c <<EOF
+#include <unistd.h>
+int main() { return 0; }
+EOF
+if try $CC -c $CFLAGS $test.c; then
+ sed < zconf.h "/^#ifdef HAVE_UNISTD_H.* may be/s/def HAVE_UNISTD_H\(.*\) may be/ 1\1 was/" > zconf.temp.h
+ mv zconf.temp.h zconf.h
+ echo "Checking for unistd.h... Yes." | tee -a configure.log
+else
+ echo "Checking for unistd.h... No." | tee -a configure.log
+fi
+
+echo >> configure.log
+
+# check for stdarg.h and save result in zconf.h
+cat > $test.c <<EOF
+#include <stdarg.h>
+int main() { return 0; }
+EOF
+if try $CC -c $CFLAGS $test.c; then
+ sed < zconf.h "/^#ifdef HAVE_STDARG_H.* may be/s/def HAVE_STDARG_H\(.*\) may be/ 1\1 was/" > zconf.temp.h
+ mv zconf.temp.h zconf.h
+ echo "Checking for stdarg.h... Yes." | tee -a configure.log
+else
+ echo "Checking for stdarg.h... No." | tee -a configure.log
+fi
+
+# if the z_ prefix was requested, save that in zconf.h
+if test $zprefix -eq 1; then
+ sed < zconf.h "/#ifdef Z_PREFIX.* may be/s/def Z_PREFIX\(.*\) may be/ 1\1 was/" > zconf.temp.h
+ mv zconf.temp.h zconf.h
+ echo >> configure.log
+ echo "Using z_ prefix on all symbols." | tee -a configure.log
+fi
+
+# if --solo compilation was requested, save that in zconf.h and remove gz stuff from object lists
+if test $solo -eq 1; then
+ sed '/#define ZCONF_H/a\
+#define Z_SOLO
+
+' < zconf.h > zconf.temp.h
+ mv zconf.temp.h zconf.h
+OBJC='$(OBJZ)'
+PIC_OBJC='$(PIC_OBJZ)'
+fi
+
+# if code coverage testing was requested, use older gcc if defined, e.g. "gcc-4.2" on Mac OS X
+if test $cover -eq 1; then
+ CFLAGS="${CFLAGS} -fprofile-arcs -ftest-coverage"
+ if test -n "$GCC_CLASSIC"; then
+ CC=$GCC_CLASSIC
+ fi
+fi
+
+echo >> configure.log
+
+# conduct a series of tests to resolve eight possible cases of using "vs" or "s" printf functions
+# (using stdarg or not), with or without "n" (proving size of buffer), and with or without a
+# return value. The most secure result is vsnprintf() with a return value. snprintf() with a
+# return value is secure as well, but then gzprintf() will be limited to 20 arguments.
+cat > $test.c <<EOF
+#include <stdio.h>
+#include <stdarg.h>
+#include "zconf.h"
+int main()
+{
+#ifndef STDC
+ choke me
+#endif
+ return 0;
+}
+EOF
+if try $CC -c $CFLAGS $test.c; then
+ echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()." | tee -a configure.log
+
+ echo >> configure.log
+ cat > $test.c <<EOF
+#include <stdio.h>
+#include <stdarg.h>
+int mytest(const char *fmt, ...)
+{
+ char buf[20];
+ va_list ap;
+ va_start(ap, fmt);
+ vsnprintf(buf, sizeof(buf), fmt, ap);
+ va_end(ap);
+ return 0;
+}
+int main()
+{
+ return (mytest("Hello%d\n", 1));
+}
+EOF
+ if try $CC $CFLAGS -o $test $test.c; then
+ echo "Checking for vsnprintf() in stdio.h... Yes." | tee -a configure.log
+
+ echo >> configure.log
+ cat >$test.c <<EOF
+#include <stdio.h>
+#include <stdarg.h>
+int mytest(const char *fmt, ...)
+{
+ int n;
+ char buf[20];
+ va_list ap;
+ va_start(ap, fmt);
+ n = vsnprintf(buf, sizeof(buf), fmt, ap);
+ va_end(ap);
+ return n;
+}
+int main()
+{
+ return (mytest("Hello%d\n", 1));
+}
+EOF
+
+ if try $CC -c $CFLAGS $test.c; then
+ echo "Checking for return value of vsnprintf()... Yes." | tee -a configure.log
+ else
+ CFLAGS="$CFLAGS -DHAS_vsnprintf_void"
+ SFLAGS="$SFLAGS -DHAS_vsnprintf_void"
+ echo "Checking for return value of vsnprintf()... No." | tee -a configure.log
+ echo " WARNING: apparently vsnprintf() does not return a value. zlib" | tee -a configure.log
+ echo " can build but will be open to possible string-format security" | tee -a configure.log
+ echo " vulnerabilities." | tee -a configure.log
+ fi
+ else
+ CFLAGS="$CFLAGS -DNO_vsnprintf"
+ SFLAGS="$SFLAGS -DNO_vsnprintf"
+ echo "Checking for vsnprintf() in stdio.h... No." | tee -a configure.log
+ echo " WARNING: vsnprintf() not found, falling back to vsprintf(). zlib" | tee -a configure.log
+ echo " can build but will be open to possible buffer-overflow security" | tee -a configure.log
+ echo " vulnerabilities." | tee -a configure.log
+
+ echo >> configure.log
+ cat >$test.c <<EOF
+#include <stdio.h>
+#include <stdarg.h>
+int mytest(const char *fmt, ...)
+{
+ int n;
+ char buf[20];
+ va_list ap;
+ va_start(ap, fmt);
+ n = vsprintf(buf, fmt, ap);
+ va_end(ap);
+ return n;
+}
+int main()
+{
+ return (mytest("Hello%d\n", 1));
+}
+EOF
+
+ if try $CC -c $CFLAGS $test.c; then
+ echo "Checking for return value of vsprintf()... Yes." | tee -a configure.log
+ else
+ CFLAGS="$CFLAGS -DHAS_vsprintf_void"
+ SFLAGS="$SFLAGS -DHAS_vsprintf_void"
+ echo "Checking for return value of vsprintf()... No." | tee -a configure.log
+ echo " WARNING: apparently vsprintf() does not return a value. zlib" | tee -a configure.log
+ echo " can build but will be open to possible string-format security" | tee -a configure.log
+ echo " vulnerabilities." | tee -a configure.log
+ fi
+ fi
+else
+ echo "Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf()." | tee -a configure.log
+
+ echo >> configure.log
+ cat >$test.c <<EOF
+#include <stdio.h>
+int mytest()
+{
+ char buf[20];
+ snprintf(buf, sizeof(buf), "%s", "foo");
+ return 0;
+}
+int main()
+{
+ return (mytest());
+}
+EOF
+
+ if try $CC $CFLAGS -o $test $test.c; then
+ echo "Checking for snprintf() in stdio.h... Yes." | tee -a configure.log
+
+ echo >> configure.log
+ cat >$test.c <<EOF
+#include <stdio.h>
+int mytest()
+{
+ char buf[20];
+ return snprintf(buf, sizeof(buf), "%s", "foo");
+}
+int main()
+{
+ return (mytest());
+}
+EOF
+
+ if try $CC -c $CFLAGS $test.c; then
+ echo "Checking for return value of snprintf()... Yes." | tee -a configure.log
+ else
+ CFLAGS="$CFLAGS -DHAS_snprintf_void"
+ SFLAGS="$SFLAGS -DHAS_snprintf_void"
+ echo "Checking for return value of snprintf()... No." | tee -a configure.log
+ echo " WARNING: apparently snprintf() does not return a value. zlib" | tee -a configure.log
+ echo " can build but will be open to possible string-format security" | tee -a configure.log
+ echo " vulnerabilities." | tee -a configure.log
+ fi
+ else
+ CFLAGS="$CFLAGS -DNO_snprintf"
+ SFLAGS="$SFLAGS -DNO_snprintf"
+ echo "Checking for snprintf() in stdio.h... No." | tee -a configure.log
+ echo " WARNING: snprintf() not found, falling back to sprintf(). zlib" | tee -a configure.log
+ echo " can build but will be open to possible buffer-overflow security" | tee -a configure.log
+ echo " vulnerabilities." | tee -a configure.log
+
+ echo >> configure.log
+ cat >$test.c <<EOF
+#include <stdio.h>
+int mytest()
+{
+ char buf[20];
+ return sprintf(buf, "%s", "foo");
+}
+int main()
+{
+ return (mytest());
+}
+EOF
+
+ if try $CC -c $CFLAGS $test.c; then
+ echo "Checking for return value of sprintf()... Yes." | tee -a configure.log
+ else
+ CFLAGS="$CFLAGS -DHAS_sprintf_void"
+ SFLAGS="$SFLAGS -DHAS_sprintf_void"
+ echo "Checking for return value of sprintf()... No." | tee -a configure.log
+ echo " WARNING: apparently sprintf() does not return a value. zlib" | tee -a configure.log
+ echo " can build but will be open to possible string-format security" | tee -a configure.log
+ echo " vulnerabilities." | tee -a configure.log
+ fi
+ fi
+fi
+
+# see if we can hide zlib internal symbols that are linked between separate source files
+if test "$gcc" -eq 1; then
+ echo >> configure.log
+ cat > $test.c <<EOF
+#define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
+int ZLIB_INTERNAL foo;
+int main()
+{
+ return 0;
+}
+EOF
+ if tryboth $CC -c $CFLAGS $test.c; then
+ CFLAGS="$CFLAGS -DHAVE_HIDDEN"
+ SFLAGS="$SFLAGS -DHAVE_HIDDEN"
+ echo "Checking for attribute(visibility) support... Yes." | tee -a configure.log
+ else
+ echo "Checking for attribute(visibility) support... No." | tee -a configure.log
+ fi
+fi
+
+# show the results in the log
+echo >> configure.log
+echo ALL = $ALL >> configure.log
+echo AR = $AR >> configure.log
+echo ARFLAGS = $ARFLAGS >> configure.log
+echo CC = $CC >> configure.log
+echo CFLAGS = $CFLAGS >> configure.log
+echo CPP = $CPP >> configure.log
+echo EXE = $EXE >> configure.log
+echo LDCONFIG = $LDCONFIG >> configure.log
+echo LDFLAGS = $LDFLAGS >> configure.log
+echo LDSHARED = $LDSHARED >> configure.log
+echo LDSHAREDLIBC = $LDSHAREDLIBC >> configure.log
+echo OBJC = $OBJC >> configure.log
+echo PIC_OBJC = $PIC_OBJC >> configure.log
+echo RANLIB = $RANLIB >> configure.log
+echo SFLAGS = $SFLAGS >> configure.log
+echo SHAREDLIB = $SHAREDLIB >> configure.log
+echo SHAREDLIBM = $SHAREDLIBM >> configure.log
+echo SHAREDLIBV = $SHAREDLIBV >> configure.log
+echo STATICLIB = $STATICLIB >> configure.log
+echo TEST = $TEST >> configure.log
+echo VER = $VER >> configure.log
+echo Z_U4 = $Z_U4 >> configure.log
+echo exec_prefix = $exec_prefix >> configure.log
+echo includedir = $includedir >> configure.log
+echo libdir = $libdir >> configure.log
+echo mandir = $mandir >> configure.log
+echo prefix = $prefix >> configure.log
+echo sharedlibdir = $sharedlibdir >> configure.log
+echo uname = $uname >> configure.log
+
+# udpate Makefile with the configure results
+sed < Makefile.in "
+/^CC *=/s#=.*#=$CC#
+/^CFLAGS *=/s#=.*#=$CFLAGS#
+/^SFLAGS *=/s#=.*#=$SFLAGS#
+/^LDFLAGS *=/s#=.*#=$LDFLAGS#
+/^LDSHARED *=/s#=.*#=$LDSHARED#
+/^CPP *=/s#=.*#=$CPP#
+/^STATICLIB *=/s#=.*#=$STATICLIB#
+/^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
+/^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
+/^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
+/^AR *=/s#=.*#=$AR#
+/^ARFLAGS *=/s#=.*#=$ARFLAGS#
+/^RANLIB *=/s#=.*#=$RANLIB#
+/^LDCONFIG *=/s#=.*#=$LDCONFIG#
+/^LDSHAREDLIBC *=/s#=.*#=$LDSHAREDLIBC#
+/^EXE *=/s#=.*#=$EXE#
+/^prefix *=/s#=.*#=$prefix#
+/^exec_prefix *=/s#=.*#=$exec_prefix#
+/^libdir *=/s#=.*#=$libdir#
+/^sharedlibdir *=/s#=.*#=$sharedlibdir#
+/^includedir *=/s#=.*#=$includedir#
+/^mandir *=/s#=.*#=$mandir#
+/^OBJC *=/s#=.*#= $OBJC#
+/^PIC_OBJC *=/s#=.*#= $PIC_OBJC#
+/^all: */s#:.*#: $ALL#
+/^test: */s#:.*#: $TEST#
+" > Makefile
+
+# create zlib.pc with the configure results
+sed < zlib.pc.in "
+/^CC *=/s#=.*#=$CC#
+/^CFLAGS *=/s#=.*#=$CFLAGS#
+/^CPP *=/s#=.*#=$CPP#
+/^LDSHARED *=/s#=.*#=$LDSHARED#
+/^STATICLIB *=/s#=.*#=$STATICLIB#
+/^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
+/^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
+/^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
+/^AR *=/s#=.*#=$AR#
+/^ARFLAGS *=/s#=.*#=$ARFLAGS#
+/^RANLIB *=/s#=.*#=$RANLIB#
+/^EXE *=/s#=.*#=$EXE#
+/^prefix *=/s#=.*#=$prefix#
+/^exec_prefix *=/s#=.*#=$exec_prefix#
+/^libdir *=/s#=.*#=$libdir#
+/^sharedlibdir *=/s#=.*#=$sharedlibdir#
+/^includedir *=/s#=.*#=$includedir#
+/^mandir *=/s#=.*#=$mandir#
+/^LDFLAGS *=/s#=.*#=$LDFLAGS#
+" | sed -e "
+s/\@VERSION\@/$VER/g;
+" > zlib.pc
+
+# done
+leave 0
diff --git a/protocols/Telegram/tgl/zlib/contrib/README.contrib b/protocols/Telegram/tgl/zlib/contrib/README.contrib
new file mode 100644
index 0000000000..c66349b7c6
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/README.contrib
@@ -0,0 +1,78 @@
+All files under this contrib directory are UNSUPPORTED. There were
+provided by users of zlib and were not tested by the authors of zlib.
+Use at your own risk. Please contact the authors of the contributions
+for help about these, not the zlib authors. Thanks.
+
+
+ada/ by Dmitriy Anisimkov <anisimkov@yahoo.com>
+ Support for Ada
+ See http://zlib-ada.sourceforge.net/
+
+amd64/ by Mikhail Teterin <mi@ALDAN.algebra.com>
+ asm code for AMD64
+ See patch at http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/96393
+
+asm686/ by Brian Raiter <breadbox@muppetlabs.com>
+ asm code for Pentium and PPro/PII, using the AT&T (GNU as) syntax
+ See http://www.muppetlabs.com/~breadbox/software/assembly.html
+
+blast/ by Mark Adler <madler@alumni.caltech.edu>
+ Decompressor for output of PKWare Data Compression Library (DCL)
+
+delphi/ by Cosmin Truta <cosmint@cs.ubbcluj.ro>
+ Support for Delphi and C++ Builder
+
+dotzlib/ by Henrik Ravn <henrik@ravn.com>
+ Support for Microsoft .Net and Visual C++ .Net
+
+gcc_gvmat64/by Gilles Vollant <info@winimage.com>
+ GCC Version of x86 64-bit (AMD64 and Intel EM64t) code for x64
+ assembler to replace longest_match() and inflate_fast()
+
+infback9/ by Mark Adler <madler@alumni.caltech.edu>
+ Unsupported diffs to infback to decode the deflate64 format
+
+inflate86/ by Chris Anderson <christop@charm.net>
+ Tuned x86 gcc asm code to replace inflate_fast()
+
+iostream/ by Kevin Ruland <kevin@rodin.wustl.edu>
+ A C++ I/O streams interface to the zlib gz* functions
+
+iostream2/ by Tyge Løvset <Tyge.Lovset@cmr.no>
+ Another C++ I/O streams interface
+
+iostream3/ by Ludwig Schwardt <schwardt@sun.ac.za>
+ and Kevin Ruland <kevin@rodin.wustl.edu>
+ Yet another C++ I/O streams interface
+
+masmx64/ by Gilles Vollant <info@winimage.com>
+ x86 64-bit (AMD64 and Intel EM64t) code for x64 assembler to
+ replace longest_match() and inflate_fast(), also masm x86
+ 64-bits translation of Chris Anderson inflate_fast()
+
+masmx86/ by Gilles Vollant <info@winimage.com>
+ x86 asm code to replace longest_match() and inflate_fast(),
+ for Visual C++ and MASM (32 bits).
+ Based on Brian Raiter (asm686) and Chris Anderson (inflate86)
+
+minizip/ by Gilles Vollant <info@winimage.com>
+ Mini zip and unzip based on zlib
+ Includes Zip64 support by Mathias Svensson <mathias@result42.com>
+ See http://www.winimage.com/zLibDll/unzip.html
+
+pascal/ by Bob Dellaca <bobdl@xtra.co.nz> et al.
+ Support for Pascal
+
+puff/ by Mark Adler <madler@alumni.caltech.edu>
+ Small, low memory usage inflate. Also serves to provide an
+ unambiguous description of the deflate format.
+
+testzlib/ by Gilles Vollant <info@winimage.com>
+ Example of the use of zlib
+
+untgz/ by Pedro A. Aranda Gutierrez <paag@tid.es>
+ A very simple tar.gz file extractor using zlib
+
+vstudio/ by Gilles Vollant <info@winimage.com>
+ Building a minizip-enhanced zlib with Microsoft Visual Studio
+ Includes vc11 from kreuzerkrieg and vc12 from davispuh
diff --git a/protocols/Telegram/tgl/zlib/contrib/ada/buffer_demo.adb b/protocols/Telegram/tgl/zlib/contrib/ada/buffer_demo.adb
new file mode 100644
index 0000000000..46b8638107
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/ada/buffer_demo.adb
@@ -0,0 +1,106 @@
+----------------------------------------------------------------
+-- ZLib for Ada thick binding. --
+-- --
+-- Copyright (C) 2002-2004 Dmitriy Anisimkov --
+-- --
+-- Open source license information is in the zlib.ads file. --
+----------------------------------------------------------------
+--
+-- $Id: buffer_demo.adb,v 1.3 2004/09/06 06:55:35 vagul Exp $
+
+-- This demo program provided by Dr Steve Sangwine <sjs@essex.ac.uk>
+--
+-- Demonstration of a problem with Zlib-Ada (already fixed) when a buffer
+-- of exactly the correct size is used for decompressed data, and the last
+-- few bytes passed in to Zlib are checksum bytes.
+
+-- This program compresses a string of text, and then decompresses the
+-- compressed text into a buffer of the same size as the original text.
+
+with Ada.Streams; use Ada.Streams;
+with Ada.Text_IO;
+
+with ZLib; use ZLib;
+
+procedure Buffer_Demo is
+ EOL : Character renames ASCII.LF;
+ Text : constant String
+ := "Four score and seven years ago our fathers brought forth," & EOL &
+ "upon this continent, a new nation, conceived in liberty," & EOL &
+ "and dedicated to the proposition that `all men are created equal'.";
+
+ Source : Stream_Element_Array (1 .. Text'Length);
+ for Source'Address use Text'Address;
+
+begin
+ Ada.Text_IO.Put (Text);
+ Ada.Text_IO.New_Line;
+ Ada.Text_IO.Put_Line
+ ("Uncompressed size : " & Positive'Image (Text'Length) & " bytes");
+
+ declare
+ Compressed_Data : Stream_Element_Array (1 .. Text'Length);
+ L : Stream_Element_Offset;
+ begin
+ Compress : declare
+ Compressor : Filter_Type;
+ I : Stream_Element_Offset;
+ begin
+ Deflate_Init (Compressor);
+
+ -- Compress the whole of T at once.
+
+ Translate (Compressor, Source, I, Compressed_Data, L, Finish);
+ pragma Assert (I = Source'Last);
+
+ Close (Compressor);
+
+ Ada.Text_IO.Put_Line
+ ("Compressed size : "
+ & Stream_Element_Offset'Image (L) & " bytes");
+ end Compress;
+
+ -- Now we decompress the data, passing short blocks of data to Zlib
+ -- (because this demonstrates the problem - the last block passed will
+ -- contain checksum information and there will be no output, only a
+ -- check inside Zlib that the checksum is correct).
+
+ Decompress : declare
+ Decompressor : Filter_Type;
+
+ Uncompressed_Data : Stream_Element_Array (1 .. Text'Length);
+
+ Block_Size : constant := 4;
+ -- This makes sure that the last block contains
+ -- only Adler checksum data.
+
+ P : Stream_Element_Offset := Compressed_Data'First - 1;
+ O : Stream_Element_Offset;
+ begin
+ Inflate_Init (Decompressor);
+
+ loop
+ Translate
+ (Decompressor,
+ Compressed_Data
+ (P + 1 .. Stream_Element_Offset'Min (P + Block_Size, L)),
+ P,
+ Uncompressed_Data
+ (Total_Out (Decompressor) + 1 .. Uncompressed_Data'Last),
+ O,
+ No_Flush);
+
+ Ada.Text_IO.Put_Line
+ ("Total in : " & Count'Image (Total_In (Decompressor)) &
+ ", out : " & Count'Image (Total_Out (Decompressor)));
+
+ exit when P = L;
+ end loop;
+
+ Ada.Text_IO.New_Line;
+ Ada.Text_IO.Put_Line
+ ("Decompressed text matches original text : "
+ & Boolean'Image (Uncompressed_Data = Source));
+ end Decompress;
+ end;
+end Buffer_Demo;
diff --git a/protocols/Telegram/tgl/zlib/contrib/ada/mtest.adb b/protocols/Telegram/tgl/zlib/contrib/ada/mtest.adb
new file mode 100644
index 0000000000..c4dfd080f0
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/ada/mtest.adb
@@ -0,0 +1,156 @@
+----------------------------------------------------------------
+-- ZLib for Ada thick binding. --
+-- --
+-- Copyright (C) 2002-2003 Dmitriy Anisimkov --
+-- --
+-- Open source license information is in the zlib.ads file. --
+----------------------------------------------------------------
+-- Continuous test for ZLib multithreading. If the test would fail
+-- we should provide thread safe allocation routines for the Z_Stream.
+--
+-- $Id: mtest.adb,v 1.4 2004/07/23 07:49:54 vagul Exp $
+
+with ZLib;
+with Ada.Streams;
+with Ada.Numerics.Discrete_Random;
+with Ada.Text_IO;
+with Ada.Exceptions;
+with Ada.Task_Identification;
+
+procedure MTest is
+ use Ada.Streams;
+ use ZLib;
+
+ Stop : Boolean := False;
+
+ pragma Atomic (Stop);
+
+ subtype Visible_Symbols is Stream_Element range 16#20# .. 16#7E#;
+
+ package Random_Elements is
+ new Ada.Numerics.Discrete_Random (Visible_Symbols);
+
+ task type Test_Task;
+
+ task body Test_Task is
+ Buffer : Stream_Element_Array (1 .. 100_000);
+ Gen : Random_Elements.Generator;
+
+ Buffer_First : Stream_Element_Offset;
+ Compare_First : Stream_Element_Offset;
+
+ Deflate : Filter_Type;
+ Inflate : Filter_Type;
+
+ procedure Further (Item : in Stream_Element_Array);
+
+ procedure Read_Buffer
+ (Item : out Ada.Streams.Stream_Element_Array;
+ Last : out Ada.Streams.Stream_Element_Offset);
+
+ -------------
+ -- Further --
+ -------------
+
+ procedure Further (Item : in Stream_Element_Array) is
+
+ procedure Compare (Item : in Stream_Element_Array);
+
+ -------------
+ -- Compare --
+ -------------
+
+ procedure Compare (Item : in Stream_Element_Array) is
+ Next_First : Stream_Element_Offset := Compare_First + Item'Length;
+ begin
+ if Buffer (Compare_First .. Next_First - 1) /= Item then
+ raise Program_Error;
+ end if;
+
+ Compare_First := Next_First;
+ end Compare;
+
+ procedure Compare_Write is new ZLib.Write (Write => Compare);
+ begin
+ Compare_Write (Inflate, Item, No_Flush);
+ end Further;
+
+ -----------------
+ -- Read_Buffer --
+ -----------------
+
+ procedure Read_Buffer
+ (Item : out Ada.Streams.Stream_Element_Array;
+ Last : out Ada.Streams.Stream_Element_Offset)
+ is
+ Buff_Diff : Stream_Element_Offset := Buffer'Last - Buffer_First;
+ Next_First : Stream_Element_Offset;
+ begin
+ if Item'Length <= Buff_Diff then
+ Last := Item'Last;
+
+ Next_First := Buffer_First + Item'Length;
+
+ Item := Buffer (Buffer_First .. Next_First - 1);
+
+ Buffer_First := Next_First;
+ else
+ Last := Item'First + Buff_Diff;
+ Item (Item'First .. Last) := Buffer (Buffer_First .. Buffer'Last);
+ Buffer_First := Buffer'Last + 1;
+ end if;
+ end Read_Buffer;
+
+ procedure Translate is new Generic_Translate
+ (Data_In => Read_Buffer,
+ Data_Out => Further);
+
+ begin
+ Random_Elements.Reset (Gen);
+
+ Buffer := (others => 20);
+
+ Main : loop
+ for J in Buffer'Range loop
+ Buffer (J) := Random_Elements.Random (Gen);
+
+ Deflate_Init (Deflate);
+ Inflate_Init (Inflate);
+
+ Buffer_First := Buffer'First;
+ Compare_First := Buffer'First;
+
+ Translate (Deflate);
+
+ if Compare_First /= Buffer'Last + 1 then
+ raise Program_Error;
+ end if;
+
+ Ada.Text_IO.Put_Line
+ (Ada.Task_Identification.Image
+ (Ada.Task_Identification.Current_Task)
+ & Stream_Element_Offset'Image (J)
+ & ZLib.Count'Image (Total_Out (Deflate)));
+
+ Close (Deflate);
+ Close (Inflate);
+
+ exit Main when Stop;
+ end loop;
+ end loop Main;
+ exception
+ when E : others =>
+ Ada.Text_IO.Put_Line (Ada.Exceptions.Exception_Information (E));
+ Stop := True;
+ end Test_Task;
+
+ Test : array (1 .. 4) of Test_Task;
+
+ pragma Unreferenced (Test);
+
+ Dummy : Character;
+
+begin
+ Ada.Text_IO.Get_Immediate (Dummy);
+ Stop := True;
+end MTest;
diff --git a/protocols/Telegram/tgl/zlib/contrib/ada/read.adb b/protocols/Telegram/tgl/zlib/contrib/ada/read.adb
new file mode 100644
index 0000000000..1f2efbfeb8
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/ada/read.adb
@@ -0,0 +1,156 @@
+----------------------------------------------------------------
+-- ZLib for Ada thick binding. --
+-- --
+-- Copyright (C) 2002-2003 Dmitriy Anisimkov --
+-- --
+-- Open source license information is in the zlib.ads file. --
+----------------------------------------------------------------
+
+-- $Id: read.adb,v 1.8 2004/05/31 10:53:40 vagul Exp $
+
+-- Test/demo program for the generic read interface.
+
+with Ada.Numerics.Discrete_Random;
+with Ada.Streams;
+with Ada.Text_IO;
+
+with ZLib;
+
+procedure Read is
+
+ use Ada.Streams;
+
+ ------------------------------------
+ -- Test configuration parameters --
+ ------------------------------------
+
+ File_Size : Stream_Element_Offset := 100_000;
+
+ Continuous : constant Boolean := False;
+ -- If this constant is True, the test would be repeated again and again,
+ -- with increment File_Size for every iteration.
+
+ Header : constant ZLib.Header_Type := ZLib.Default;
+ -- Do not use Header other than Default in ZLib versions 1.1.4 and older.
+
+ Init_Random : constant := 8;
+ -- We are using the same random sequence, in case of we catch bug,
+ -- so we would be able to reproduce it.
+
+ -- End --
+
+ Pack_Size : Stream_Element_Offset;
+ Offset : Stream_Element_Offset;
+
+ Filter : ZLib.Filter_Type;
+
+ subtype Visible_Symbols
+ is Stream_Element range 16#20# .. 16#7E#;
+
+ package Random_Elements is new
+ Ada.Numerics.Discrete_Random (Visible_Symbols);
+
+ Gen : Random_Elements.Generator;
+ Period : constant Stream_Element_Offset := 200;
+ -- Period constant variable for random generator not to be very random.
+ -- Bigger period, harder random.
+
+ Read_Buffer : Stream_Element_Array (1 .. 2048);
+ Read_First : Stream_Element_Offset;
+ Read_Last : Stream_Element_Offset;
+
+ procedure Reset;
+
+ procedure Read
+ (Item : out Stream_Element_Array;
+ Last : out Stream_Element_Offset);
+ -- this procedure is for generic instantiation of
+ -- ZLib.Read
+ -- reading data from the File_In.
+
+ procedure Read is new ZLib.Read
+ (Read,
+ Read_Buffer,
+ Rest_First => Read_First,
+ Rest_Last => Read_Last);
+
+ ----------
+ -- Read --
+ ----------
+
+ procedure Read
+ (Item : out Stream_Element_Array;
+ Last : out Stream_Element_Offset) is
+ begin
+ Last := Stream_Element_Offset'Min
+ (Item'Last,
+ Item'First + File_Size - Offset);
+
+ for J in Item'First .. Last loop
+ if J < Item'First + Period then
+ Item (J) := Random_Elements.Random (Gen);
+ else
+ Item (J) := Item (J - Period);
+ end if;
+
+ Offset := Offset + 1;
+ end loop;
+ end Read;
+
+ -----------
+ -- Reset --
+ -----------
+
+ procedure Reset is
+ begin
+ Random_Elements.Reset (Gen, Init_Random);
+ Pack_Size := 0;
+ Offset := 1;
+ Read_First := Read_Buffer'Last + 1;
+ Read_Last := Read_Buffer'Last;
+ end Reset;
+
+begin
+ Ada.Text_IO.Put_Line ("ZLib " & ZLib.Version);
+
+ loop
+ for Level in ZLib.Compression_Level'Range loop
+
+ Ada.Text_IO.Put ("Level ="
+ & ZLib.Compression_Level'Image (Level));
+
+ -- Deflate using generic instantiation.
+
+ ZLib.Deflate_Init
+ (Filter,
+ Level,
+ Header => Header);
+
+ Reset;
+
+ Ada.Text_IO.Put
+ (Stream_Element_Offset'Image (File_Size) & " ->");
+
+ loop
+ declare
+ Buffer : Stream_Element_Array (1 .. 1024);
+ Last : Stream_Element_Offset;
+ begin
+ Read (Filter, Buffer, Last);
+
+ Pack_Size := Pack_Size + Last - Buffer'First + 1;
+
+ exit when Last < Buffer'Last;
+ end;
+ end loop;
+
+ Ada.Text_IO.Put_Line (Stream_Element_Offset'Image (Pack_Size));
+
+ ZLib.Close (Filter);
+ end loop;
+
+ exit when not Continuous;
+
+ File_Size := File_Size + 1;
+ end loop;
+end Read;
diff --git a/protocols/Telegram/tgl/zlib/contrib/ada/readme.txt b/protocols/Telegram/tgl/zlib/contrib/ada/readme.txt
new file mode 100644
index 0000000000..ce4d2cadf0
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/ada/readme.txt
@@ -0,0 +1,65 @@
+ ZLib for Ada thick binding (ZLib.Ada)
+ Release 1.3
+
+ZLib.Ada is a thick binding interface to the popular ZLib data
+compression library, available at http://www.gzip.org/zlib/.
+It provides Ada-style access to the ZLib C library.
+
+
+ Here are the main changes since ZLib.Ada 1.2:
+
+- Attension: ZLib.Read generic routine have a initialization requirement
+ for Read_Last parameter now. It is a bit incompartible with previous version,
+ but extends functionality, we could use new parameters Allow_Read_Some and
+ Flush now.
+
+- Added Is_Open routines to ZLib and ZLib.Streams packages.
+
+- Add pragma Assert to check Stream_Element is 8 bit.
+
+- Fix extraction to buffer with exact known decompressed size. Error reported by
+ Steve Sangwine.
+
+- Fix definition of ULong (changed to unsigned_long), fix regression on 64 bits
+ computers. Patch provided by Pascal Obry.
+
+- Add Status_Error exception definition.
+
+- Add pragma Assertion that Ada.Streams.Stream_Element size is 8 bit.
+
+
+ How to build ZLib.Ada under GNAT
+
+You should have the ZLib library already build on your computer, before
+building ZLib.Ada. Make the directory of ZLib.Ada sources current and
+issue the command:
+
+ gnatmake test -largs -L<directory where libz.a is> -lz
+
+Or use the GNAT project file build for GNAT 3.15 or later:
+
+ gnatmake -Pzlib.gpr -L<directory where libz.a is>
+
+
+ How to build ZLib.Ada under Aonix ObjectAda for Win32 7.2.2
+
+1. Make a project with all *.ads and *.adb files from the distribution.
+2. Build the libz.a library from the ZLib C sources.
+3. Rename libz.a to z.lib.
+4. Add the library z.lib to the project.
+5. Add the libc.lib library from the ObjectAda distribution to the project.
+6. Build the executable using test.adb as a main procedure.
+
+
+ How to use ZLib.Ada
+
+The source files test.adb and read.adb are small demo programs that show
+the main functionality of ZLib.Ada.
+
+The routines from the package specifications are commented.
+
+
+Homepage: http://zlib-ada.sourceforge.net/
+Author: Dmitriy Anisimkov <anisimkov@yahoo.com>
+
+Contributors: Pascal Obry <pascal@obry.org>, Steve Sangwine <sjs@essex.ac.uk>
diff --git a/protocols/Telegram/tgl/zlib/contrib/ada/test.adb b/protocols/Telegram/tgl/zlib/contrib/ada/test.adb
new file mode 100644
index 0000000000..90773acfa1
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/ada/test.adb
@@ -0,0 +1,463 @@
+----------------------------------------------------------------
+-- ZLib for Ada thick binding. --
+-- --
+-- Copyright (C) 2002-2003 Dmitriy Anisimkov --
+-- --
+-- Open source license information is in the zlib.ads file. --
+----------------------------------------------------------------
+
+-- $Id: test.adb,v 1.17 2003/08/12 12:13:30 vagul Exp $
+
+-- The program has a few aims.
+-- 1. Test ZLib.Ada95 thick binding functionality.
+-- 2. Show the example of use main functionality of the ZLib.Ada95 binding.
+-- 3. Build this program automatically compile all ZLib.Ada95 packages under
+-- GNAT Ada95 compiler.
+
+with ZLib.Streams;
+with Ada.Streams.Stream_IO;
+with Ada.Numerics.Discrete_Random;
+
+with Ada.Text_IO;
+
+with Ada.Calendar;
+
+procedure Test is
+
+ use Ada.Streams;
+ use Stream_IO;
+
+ ------------------------------------
+ -- Test configuration parameters --
+ ------------------------------------
+
+ File_Size : Count := 100_000;
+ Continuous : constant Boolean := False;
+
+ Header : constant ZLib.Header_Type := ZLib.Default;
+ -- ZLib.None;
+ -- ZLib.Auto;
+ -- ZLib.GZip;
+ -- Do not use Header other then Default in ZLib versions 1.1.4
+ -- and older.
+
+ Strategy : constant ZLib.Strategy_Type := ZLib.Default_Strategy;
+ Init_Random : constant := 10;
+
+ -- End --
+
+ In_File_Name : constant String := "testzlib.in";
+ -- Name of the input file
+
+ Z_File_Name : constant String := "testzlib.zlb";
+ -- Name of the compressed file.
+
+ Out_File_Name : constant String := "testzlib.out";
+ -- Name of the decompressed file.
+
+ File_In : File_Type;
+ File_Out : File_Type;
+ File_Back : File_Type;
+ File_Z : ZLib.Streams.Stream_Type;
+
+ Filter : ZLib.Filter_Type;
+
+ Time_Stamp : Ada.Calendar.Time;
+
+ procedure Generate_File;
+ -- Generate file of spetsified size with some random data.
+ -- The random data is repeatable, for the good compression.
+
+ procedure Compare_Streams
+ (Left, Right : in out Root_Stream_Type'Class);
+ -- The procedure compearing data in 2 streams.
+ -- It is for compare data before and after compression/decompression.
+
+ procedure Compare_Files (Left, Right : String);
+ -- Compare files. Based on the Compare_Streams.
+
+ procedure Copy_Streams
+ (Source, Target : in out Root_Stream_Type'Class;
+ Buffer_Size : in Stream_Element_Offset := 1024);
+ -- Copying data from one stream to another. It is for test stream
+ -- interface of the library.
+
+ procedure Data_In
+ (Item : out Stream_Element_Array;
+ Last : out Stream_Element_Offset);
+ -- this procedure is for generic instantiation of
+ -- ZLib.Generic_Translate.
+ -- reading data from the File_In.
+
+ procedure Data_Out (Item : in Stream_Element_Array);
+ -- this procedure is for generic instantiation of
+ -- ZLib.Generic_Translate.
+ -- writing data to the File_Out.
+
+ procedure Stamp;
+ -- Store the timestamp to the local variable.
+
+ procedure Print_Statistic (Msg : String; Data_Size : ZLib.Count);
+ -- Print the time statistic with the message.
+
+ procedure Translate is new ZLib.Generic_Translate
+ (Data_In => Data_In,
+ Data_Out => Data_Out);
+ -- This procedure is moving data from File_In to File_Out
+ -- with compression or decompression, depend on initialization of
+ -- Filter parameter.
+
+ -------------------
+ -- Compare_Files --
+ -------------------
+
+ procedure Compare_Files (Left, Right : String) is
+ Left_File, Right_File : File_Type;
+ begin
+ Open (Left_File, In_File, Left);
+ Open (Right_File, In_File, Right);
+ Compare_Streams (Stream (Left_File).all, Stream (Right_File).all);
+ Close (Left_File);
+ Close (Right_File);
+ end Compare_Files;
+
+ ---------------------
+ -- Compare_Streams --
+ ---------------------
+
+ procedure Compare_Streams
+ (Left, Right : in out Ada.Streams.Root_Stream_Type'Class)
+ is
+ Left_Buffer, Right_Buffer : Stream_Element_Array (0 .. 16#FFF#);
+ Left_Last, Right_Last : Stream_Element_Offset;
+ begin
+ loop
+ Read (Left, Left_Buffer, Left_Last);
+ Read (Right, Right_Buffer, Right_Last);
+
+ if Left_Last /= Right_Last then
+ Ada.Text_IO.Put_Line ("Compare error :"
+ & Stream_Element_Offset'Image (Left_Last)
+ & " /= "
+ & Stream_Element_Offset'Image (Right_Last));
+
+ raise Constraint_Error;
+
+ elsif Left_Buffer (0 .. Left_Last)
+ /= Right_Buffer (0 .. Right_Last)
+ then
+ Ada.Text_IO.Put_Line ("ERROR: IN and OUT files is not equal.");
+ raise Constraint_Error;
+
+ end if;
+
+ exit when Left_Last < Left_Buffer'Last;
+ end loop;
+ end Compare_Streams;
+
+ ------------------
+ -- Copy_Streams --
+ ------------------
+
+ procedure Copy_Streams
+ (Source, Target : in out Ada.Streams.Root_Stream_Type'Class;
+ Buffer_Size : in Stream_Element_Offset := 1024)
+ is
+ Buffer : Stream_Element_Array (1 .. Buffer_Size);
+ Last : Stream_Element_Offset;
+ begin
+ loop
+ Read (Source, Buffer, Last);
+ Write (Target, Buffer (1 .. Last));
+
+ exit when Last < Buffer'Last;
+ end loop;
+ end Copy_Streams;
+
+ -------------
+ -- Data_In --
+ -------------
+
+ procedure Data_In
+ (Item : out Stream_Element_Array;
+ Last : out Stream_Element_Offset) is
+ begin
+ Read (File_In, Item, Last);
+ end Data_In;
+
+ --------------
+ -- Data_Out --
+ --------------
+
+ procedure Data_Out (Item : in Stream_Element_Array) is
+ begin
+ Write (File_Out, Item);
+ end Data_Out;
+
+ -------------------
+ -- Generate_File --
+ -------------------
+
+ procedure Generate_File is
+ subtype Visible_Symbols is Stream_Element range 16#20# .. 16#7E#;
+
+ package Random_Elements is
+ new Ada.Numerics.Discrete_Random (Visible_Symbols);
+
+ Gen : Random_Elements.Generator;
+ Buffer : Stream_Element_Array := (1 .. 77 => 16#20#) & 10;
+
+ Buffer_Count : constant Count := File_Size / Buffer'Length;
+ -- Number of same buffers in the packet.
+
+ Density : constant Count := 30; -- from 0 to Buffer'Length - 2;
+
+ procedure Fill_Buffer (J, D : in Count);
+ -- Change the part of the buffer.
+
+ -----------------
+ -- Fill_Buffer --
+ -----------------
+
+ procedure Fill_Buffer (J, D : in Count) is
+ begin
+ for K in 0 .. D loop
+ Buffer
+ (Stream_Element_Offset ((J + K) mod (Buffer'Length - 1) + 1))
+ := Random_Elements.Random (Gen);
+
+ end loop;
+ end Fill_Buffer;
+
+ begin
+ Random_Elements.Reset (Gen, Init_Random);
+
+ Create (File_In, Out_File, In_File_Name);
+
+ Fill_Buffer (1, Buffer'Length - 2);
+
+ for J in 1 .. Buffer_Count loop
+ Write (File_In, Buffer);
+
+ Fill_Buffer (J, Density);
+ end loop;
+
+ -- fill remain size.
+
+ Write
+ (File_In,
+ Buffer
+ (1 .. Stream_Element_Offset
+ (File_Size - Buffer'Length * Buffer_Count)));
+
+ Flush (File_In);
+ Close (File_In);
+ end Generate_File;
+
+ ---------------------
+ -- Print_Statistic --
+ ---------------------
+
+ procedure Print_Statistic (Msg : String; Data_Size : ZLib.Count) is
+ use Ada.Calendar;
+ use Ada.Text_IO;
+
+ package Count_IO is new Integer_IO (ZLib.Count);
+
+ Curr_Dur : Duration := Clock - Time_Stamp;
+ begin
+ Put (Msg);
+
+ Set_Col (20);
+ Ada.Text_IO.Put ("size =");
+
+ Count_IO.Put
+ (Data_Size,
+ Width => Stream_IO.Count'Image (File_Size)'Length);
+
+ Put_Line (" duration =" & Duration'Image (Curr_Dur));
+ end Print_Statistic;
+
+ -----------
+ -- Stamp --
+ -----------
+
+ procedure Stamp is
+ begin
+ Time_Stamp := Ada.Calendar.Clock;
+ end Stamp;
+
+begin
+ Ada.Text_IO.Put_Line ("ZLib " & ZLib.Version);
+
+ loop
+ Generate_File;
+
+ for Level in ZLib.Compression_Level'Range loop
+
+ Ada.Text_IO.Put_Line ("Level ="
+ & ZLib.Compression_Level'Image (Level));
+
+ -- Test generic interface.
+ Open (File_In, In_File, In_File_Name);
+ Create (File_Out, Out_File, Z_File_Name);
+
+ Stamp;
+
+ -- Deflate using generic instantiation.
+
+ ZLib.Deflate_Init
+ (Filter => Filter,
+ Level => Level,
+ Strategy => Strategy,
+ Header => Header);
+
+ Translate (Filter);
+ Print_Statistic ("Generic compress", ZLib.Total_Out (Filter));
+ ZLib.Close (Filter);
+
+ Close (File_In);
+ Close (File_Out);
+
+ Open (File_In, In_File, Z_File_Name);
+ Create (File_Out, Out_File, Out_File_Name);
+
+ Stamp;
+
+ -- Inflate using generic instantiation.
+
+ ZLib.Inflate_Init (Filter, Header => Header);
+
+ Translate (Filter);
+ Print_Statistic ("Generic decompress", ZLib.Total_Out (Filter));
+
+ ZLib.Close (Filter);
+
+ Close (File_In);
+ Close (File_Out);
+
+ Compare_Files (In_File_Name, Out_File_Name);
+
+ -- Test stream interface.
+
+ -- Compress to the back stream.
+
+ Open (File_In, In_File, In_File_Name);
+ Create (File_Back, Out_File, Z_File_Name);
+
+ Stamp;
+
+ ZLib.Streams.Create
+ (Stream => File_Z,
+ Mode => ZLib.Streams.Out_Stream,
+ Back => ZLib.Streams.Stream_Access
+ (Stream (File_Back)),
+ Back_Compressed => True,
+ Level => Level,
+ Strategy => Strategy,
+ Header => Header);
+
+ Copy_Streams
+ (Source => Stream (File_In).all,
+ Target => File_Z);
+
+ -- Flushing internal buffers to the back stream.
+
+ ZLib.Streams.Flush (File_Z, ZLib.Finish);
+
+ Print_Statistic ("Write compress",
+ ZLib.Streams.Write_Total_Out (File_Z));
+
+ ZLib.Streams.Close (File_Z);
+
+ Close (File_In);
+ Close (File_Back);
+
+ -- Compare reading from original file and from
+ -- decompression stream.
+
+ Open (File_In, In_File, In_File_Name);
+ Open (File_Back, In_File, Z_File_Name);
+
+ ZLib.Streams.Create
+ (Stream => File_Z,
+ Mode => ZLib.Streams.In_Stream,
+ Back => ZLib.Streams.Stream_Access
+ (Stream (File_Back)),
+ Back_Compressed => True,
+ Header => Header);
+
+ Stamp;
+ Compare_Streams (Stream (File_In).all, File_Z);
+
+ Print_Statistic ("Read decompress",
+ ZLib.Streams.Read_Total_Out (File_Z));
+
+ ZLib.Streams.Close (File_Z);
+ Close (File_In);
+ Close (File_Back);
+
+ -- Compress by reading from compression stream.
+
+ Open (File_Back, In_File, In_File_Name);
+ Create (File_Out, Out_File, Z_File_Name);
+
+ ZLib.Streams.Create
+ (Stream => File_Z,
+ Mode => ZLib.Streams.In_Stream,
+ Back => ZLib.Streams.Stream_Access
+ (Stream (File_Back)),
+ Back_Compressed => False,
+ Level => Level,
+ Strategy => Strategy,
+ Header => Header);
+
+ Stamp;
+ Copy_Streams
+ (Source => File_Z,
+ Target => Stream (File_Out).all);
+
+ Print_Statistic ("Read compress",
+ ZLib.Streams.Read_Total_Out (File_Z));
+
+ ZLib.Streams.Close (File_Z);
+
+ Close (File_Out);
+ Close (File_Back);
+
+ -- Decompress to decompression stream.
+
+ Open (File_In, In_File, Z_File_Name);
+ Create (File_Back, Out_File, Out_File_Name);
+
+ ZLib.Streams.Create
+ (Stream => File_Z,
+ Mode => ZLib.Streams.Out_Stream,
+ Back => ZLib.Streams.Stream_Access
+ (Stream (File_Back)),
+ Back_Compressed => False,
+ Header => Header);
+
+ Stamp;
+
+ Copy_Streams
+ (Source => Stream (File_In).all,
+ Target => File_Z);
+
+ Print_Statistic ("Write decompress",
+ ZLib.Streams.Write_Total_Out (File_Z));
+
+ ZLib.Streams.Close (File_Z);
+ Close (File_In);
+ Close (File_Back);
+
+ Compare_Files (In_File_Name, Out_File_Name);
+ end loop;
+
+ Ada.Text_IO.Put_Line (Count'Image (File_Size) & " Ok.");
+
+ exit when not Continuous;
+
+ File_Size := File_Size + 1;
+ end loop;
+end Test;
diff --git a/protocols/Telegram/tgl/zlib/contrib/ada/zlib-streams.adb b/protocols/Telegram/tgl/zlib/contrib/ada/zlib-streams.adb
new file mode 100644
index 0000000000..b6497bae28
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/ada/zlib-streams.adb
@@ -0,0 +1,225 @@
+----------------------------------------------------------------
+-- ZLib for Ada thick binding. --
+-- --
+-- Copyright (C) 2002-2003 Dmitriy Anisimkov --
+-- --
+-- Open source license information is in the zlib.ads file. --
+----------------------------------------------------------------
+
+-- $Id: zlib-streams.adb,v 1.10 2004/05/31 10:53:40 vagul Exp $
+
+with Ada.Unchecked_Deallocation;
+
+package body ZLib.Streams is
+
+ -----------
+ -- Close --
+ -----------
+
+ procedure Close (Stream : in out Stream_Type) is
+ procedure Free is new Ada.Unchecked_Deallocation
+ (Stream_Element_Array, Buffer_Access);
+ begin
+ if Stream.Mode = Out_Stream or Stream.Mode = Duplex then
+ -- We should flush the data written by the writer.
+
+ Flush (Stream, Finish);
+
+ Close (Stream.Writer);
+ end if;
+
+ if Stream.Mode = In_Stream or Stream.Mode = Duplex then
+ Close (Stream.Reader);
+ Free (Stream.Buffer);
+ end if;
+ end Close;
+
+ ------------
+ -- Create --
+ ------------
+
+ procedure Create
+ (Stream : out Stream_Type;
+ Mode : in Stream_Mode;
+ Back : in Stream_Access;
+ Back_Compressed : in Boolean;
+ Level : in Compression_Level := Default_Compression;
+ Strategy : in Strategy_Type := Default_Strategy;
+ Header : in Header_Type := Default;
+ Read_Buffer_Size : in Ada.Streams.Stream_Element_Offset
+ := Default_Buffer_Size;
+ Write_Buffer_Size : in Ada.Streams.Stream_Element_Offset
+ := Default_Buffer_Size)
+ is
+
+ subtype Buffer_Subtype is Stream_Element_Array (1 .. Read_Buffer_Size);
+
+ procedure Init_Filter
+ (Filter : in out Filter_Type;
+ Compress : in Boolean);
+
+ -----------------
+ -- Init_Filter --
+ -----------------
+
+ procedure Init_Filter
+ (Filter : in out Filter_Type;
+ Compress : in Boolean) is
+ begin
+ if Compress then
+ Deflate_Init
+ (Filter, Level, Strategy, Header => Header);
+ else
+ Inflate_Init (Filter, Header => Header);
+ end if;
+ end Init_Filter;
+
+ begin
+ Stream.Back := Back;
+ Stream.Mode := Mode;
+
+ if Mode = Out_Stream or Mode = Duplex then
+ Init_Filter (Stream.Writer, Back_Compressed);
+ Stream.Buffer_Size := Write_Buffer_Size;
+ else
+ Stream.Buffer_Size := 0;
+ end if;
+
+ if Mode = In_Stream or Mode = Duplex then
+ Init_Filter (Stream.Reader, not Back_Compressed);
+
+ Stream.Buffer := new Buffer_Subtype;
+ Stream.Rest_First := Stream.Buffer'Last + 1;
+ Stream.Rest_Last := Stream.Buffer'Last;
+ end if;
+ end Create;
+
+ -----------
+ -- Flush --
+ -----------
+
+ procedure Flush
+ (Stream : in out Stream_Type;
+ Mode : in Flush_Mode := Sync_Flush)
+ is
+ Buffer : Stream_Element_Array (1 .. Stream.Buffer_Size);
+ Last : Stream_Element_Offset;
+ begin
+ loop
+ Flush (Stream.Writer, Buffer, Last, Mode);
+
+ Ada.Streams.Write (Stream.Back.all, Buffer (1 .. Last));
+
+ exit when Last < Buffer'Last;
+ end loop;
+ end Flush;
+
+ -------------
+ -- Is_Open --
+ -------------
+
+ function Is_Open (Stream : Stream_Type) return Boolean is
+ begin
+ return Is_Open (Stream.Reader) or else Is_Open (Stream.Writer);
+ end Is_Open;
+
+ ----------
+ -- Read --
+ ----------
+
+ procedure Read
+ (Stream : in out Stream_Type;
+ Item : out Stream_Element_Array;
+ Last : out Stream_Element_Offset)
+ is
+
+ procedure Read
+ (Item : out Stream_Element_Array;
+ Last : out Stream_Element_Offset);
+
+ ----------
+ -- Read --
+ ----------
+
+ procedure Read
+ (Item : out Stream_Element_Array;
+ Last : out Stream_Element_Offset) is
+ begin
+ Ada.Streams.Read (Stream.Back.all, Item, Last);
+ end Read;
+
+ procedure Read is new ZLib.Read
+ (Read => Read,
+ Buffer => Stream.Buffer.all,
+ Rest_First => Stream.Rest_First,
+ Rest_Last => Stream.Rest_Last);
+
+ begin
+ Read (Stream.Reader, Item, Last);
+ end Read;
+
+ -------------------
+ -- Read_Total_In --
+ -------------------
+
+ function Read_Total_In (Stream : in Stream_Type) return Count is
+ begin
+ return Total_In (Stream.Reader);
+ end Read_Total_In;
+
+ --------------------
+ -- Read_Total_Out --
+ --------------------
+
+ function Read_Total_Out (Stream : in Stream_Type) return Count is
+ begin
+ return Total_Out (Stream.Reader);
+ end Read_Total_Out;
+
+ -----------
+ -- Write --
+ -----------
+
+ procedure Write
+ (Stream : in out Stream_Type;
+ Item : in Stream_Element_Array)
+ is
+
+ procedure Write (Item : in Stream_Element_Array);
+
+ -----------
+ -- Write --
+ -----------
+
+ procedure Write (Item : in Stream_Element_Array) is
+ begin
+ Ada.Streams.Write (Stream.Back.all, Item);
+ end Write;
+
+ procedure Write is new ZLib.Write
+ (Write => Write,
+ Buffer_Size => Stream.Buffer_Size);
+
+ begin
+ Write (Stream.Writer, Item, No_Flush);
+ end Write;
+
+ --------------------
+ -- Write_Total_In --
+ --------------------
+
+ function Write_Total_In (Stream : in Stream_Type) return Count is
+ begin
+ return Total_In (Stream.Writer);
+ end Write_Total_In;
+
+ ---------------------
+ -- Write_Total_Out --
+ ---------------------
+
+ function Write_Total_Out (Stream : in Stream_Type) return Count is
+ begin
+ return Total_Out (Stream.Writer);
+ end Write_Total_Out;
+
+end ZLib.Streams;
diff --git a/protocols/Telegram/tgl/zlib/contrib/ada/zlib-streams.ads b/protocols/Telegram/tgl/zlib/contrib/ada/zlib-streams.ads
new file mode 100644
index 0000000000..f0193c6bae
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/ada/zlib-streams.ads
@@ -0,0 +1,114 @@
+----------------------------------------------------------------
+-- ZLib for Ada thick binding. --
+-- --
+-- Copyright (C) 2002-2003 Dmitriy Anisimkov --
+-- --
+-- Open source license information is in the zlib.ads file. --
+----------------------------------------------------------------
+
+-- $Id: zlib-streams.ads,v 1.12 2004/05/31 10:53:40 vagul Exp $
+
+package ZLib.Streams is
+
+ type Stream_Mode is (In_Stream, Out_Stream, Duplex);
+
+ type Stream_Access is access all Ada.Streams.Root_Stream_Type'Class;
+
+ type Stream_Type is
+ new Ada.Streams.Root_Stream_Type with private;
+
+ procedure Read
+ (Stream : in out Stream_Type;
+ Item : out Ada.Streams.Stream_Element_Array;
+ Last : out Ada.Streams.Stream_Element_Offset);
+
+ procedure Write
+ (Stream : in out Stream_Type;
+ Item : in Ada.Streams.Stream_Element_Array);
+
+ procedure Flush
+ (Stream : in out Stream_Type;
+ Mode : in Flush_Mode := Sync_Flush);
+ -- Flush the written data to the back stream,
+ -- all data placed to the compressor is flushing to the Back stream.
+ -- Should not be used untill necessary, becouse it is decreasing
+ -- compression.
+
+ function Read_Total_In (Stream : in Stream_Type) return Count;
+ pragma Inline (Read_Total_In);
+ -- Return total number of bytes read from back stream so far.
+
+ function Read_Total_Out (Stream : in Stream_Type) return Count;
+ pragma Inline (Read_Total_Out);
+ -- Return total number of bytes read so far.
+
+ function Write_Total_In (Stream : in Stream_Type) return Count;
+ pragma Inline (Write_Total_In);
+ -- Return total number of bytes written so far.
+
+ function Write_Total_Out (Stream : in Stream_Type) return Count;
+ pragma Inline (Write_Total_Out);
+ -- Return total number of bytes written to the back stream.
+
+ procedure Create
+ (Stream : out Stream_Type;
+ Mode : in Stream_Mode;
+ Back : in Stream_Access;
+ Back_Compressed : in Boolean;
+ Level : in Compression_Level := Default_Compression;
+ Strategy : in Strategy_Type := Default_Strategy;
+ Header : in Header_Type := Default;
+ Read_Buffer_Size : in Ada.Streams.Stream_Element_Offset
+ := Default_Buffer_Size;
+ Write_Buffer_Size : in Ada.Streams.Stream_Element_Offset
+ := Default_Buffer_Size);
+ -- Create the Comression/Decompression stream.
+ -- If mode is In_Stream then Write operation is disabled.
+ -- If mode is Out_Stream then Read operation is disabled.
+
+ -- If Back_Compressed is true then
+ -- Data written to the Stream is compressing to the Back stream
+ -- and data read from the Stream is decompressed data from the Back stream.
+
+ -- If Back_Compressed is false then
+ -- Data written to the Stream is decompressing to the Back stream
+ -- and data read from the Stream is compressed data from the Back stream.
+
+ -- !!! When the Need_Header is False ZLib-Ada is using undocumented
+ -- ZLib 1.1.4 functionality to do not create/wait for ZLib headers.
+
+ function Is_Open (Stream : Stream_Type) return Boolean;
+
+ procedure Close (Stream : in out Stream_Type);
+
+private
+
+ use Ada.Streams;
+
+ type Buffer_Access is access all Stream_Element_Array;
+
+ type Stream_Type
+ is new Root_Stream_Type with
+ record
+ Mode : Stream_Mode;
+
+ Buffer : Buffer_Access;
+ Rest_First : Stream_Element_Offset;
+ Rest_Last : Stream_Element_Offset;
+ -- Buffer for Read operation.
+ -- We need to have this buffer in the record
+ -- becouse not all read data from back stream
+ -- could be processed during the read operation.
+
+ Buffer_Size : Stream_Element_Offset;
+ -- Buffer size for write operation.
+ -- We do not need to have this buffer
+ -- in the record becouse all data could be
+ -- processed in the write operation.
+
+ Back : Stream_Access;
+ Reader : Filter_Type;
+ Writer : Filter_Type;
+ end record;
+
+end ZLib.Streams;
diff --git a/protocols/Telegram/tgl/zlib/contrib/ada/zlib-thin.adb b/protocols/Telegram/tgl/zlib/contrib/ada/zlib-thin.adb
new file mode 100644
index 0000000000..0ca4a71204
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/ada/zlib-thin.adb
@@ -0,0 +1,141 @@
+----------------------------------------------------------------
+-- ZLib for Ada thick binding. --
+-- --
+-- Copyright (C) 2002-2003 Dmitriy Anisimkov --
+-- --
+-- Open source license information is in the zlib.ads file. --
+----------------------------------------------------------------
+
+-- $Id: zlib-thin.adb,v 1.8 2003/12/14 18:27:31 vagul Exp $
+
+package body ZLib.Thin is
+
+ ZLIB_VERSION : constant Chars_Ptr := zlibVersion;
+
+ Z_Stream_Size : constant Int := Z_Stream'Size / System.Storage_Unit;
+
+ --------------
+ -- Avail_In --
+ --------------
+
+ function Avail_In (Strm : in Z_Stream) return UInt is
+ begin
+ return Strm.Avail_In;
+ end Avail_In;
+
+ ---------------
+ -- Avail_Out --
+ ---------------
+
+ function Avail_Out (Strm : in Z_Stream) return UInt is
+ begin
+ return Strm.Avail_Out;
+ end Avail_Out;
+
+ ------------------
+ -- Deflate_Init --
+ ------------------
+
+ function Deflate_Init
+ (strm : Z_Streamp;
+ level : Int;
+ method : Int;
+ windowBits : Int;
+ memLevel : Int;
+ strategy : Int)
+ return Int is
+ begin
+ return deflateInit2
+ (strm,
+ level,
+ method,
+ windowBits,
+ memLevel,
+ strategy,
+ ZLIB_VERSION,
+ Z_Stream_Size);
+ end Deflate_Init;
+
+ ------------------
+ -- Inflate_Init --
+ ------------------
+
+ function Inflate_Init (strm : Z_Streamp; windowBits : Int) return Int is
+ begin
+ return inflateInit2 (strm, windowBits, ZLIB_VERSION, Z_Stream_Size);
+ end Inflate_Init;
+
+ ------------------------
+ -- Last_Error_Message --
+ ------------------------
+
+ function Last_Error_Message (Strm : in Z_Stream) return String is
+ use Interfaces.C.Strings;
+ begin
+ if Strm.msg = Null_Ptr then
+ return "";
+ else
+ return Value (Strm.msg);
+ end if;
+ end Last_Error_Message;
+
+ ------------
+ -- Set_In --
+ ------------
+
+ procedure Set_In
+ (Strm : in out Z_Stream;
+ Buffer : in Voidp;
+ Size : in UInt) is
+ begin
+ Strm.Next_In := Buffer;
+ Strm.Avail_In := Size;
+ end Set_In;
+
+ ------------------
+ -- Set_Mem_Func --
+ ------------------
+
+ procedure Set_Mem_Func
+ (Strm : in out Z_Stream;
+ Opaque : in Voidp;
+ Alloc : in alloc_func;
+ Free : in free_func) is
+ begin
+ Strm.opaque := Opaque;
+ Strm.zalloc := Alloc;
+ Strm.zfree := Free;
+ end Set_Mem_Func;
+
+ -------------
+ -- Set_Out --
+ -------------
+
+ procedure Set_Out
+ (Strm : in out Z_Stream;
+ Buffer : in Voidp;
+ Size : in UInt) is
+ begin
+ Strm.Next_Out := Buffer;
+ Strm.Avail_Out := Size;
+ end Set_Out;
+
+ --------------
+ -- Total_In --
+ --------------
+
+ function Total_In (Strm : in Z_Stream) return ULong is
+ begin
+ return Strm.Total_In;
+ end Total_In;
+
+ ---------------
+ -- Total_Out --
+ ---------------
+
+ function Total_Out (Strm : in Z_Stream) return ULong is
+ begin
+ return Strm.Total_Out;
+ end Total_Out;
+
+end ZLib.Thin;
diff --git a/protocols/Telegram/tgl/zlib/contrib/ada/zlib-thin.ads b/protocols/Telegram/tgl/zlib/contrib/ada/zlib-thin.ads
new file mode 100644
index 0000000000..d4407eb800
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/ada/zlib-thin.ads
@@ -0,0 +1,450 @@
+----------------------------------------------------------------
+-- ZLib for Ada thick binding. --
+-- --
+-- Copyright (C) 2002-2003 Dmitriy Anisimkov --
+-- --
+-- Open source license information is in the zlib.ads file. --
+----------------------------------------------------------------
+
+-- $Id: zlib-thin.ads,v 1.11 2004/07/23 06:33:11 vagul Exp $
+
+with Interfaces.C.Strings;
+
+with System;
+
+private package ZLib.Thin is
+
+ -- From zconf.h
+
+ MAX_MEM_LEVEL : constant := 9; -- zconf.h:105
+ -- zconf.h:105
+ MAX_WBITS : constant := 15; -- zconf.h:115
+ -- 32K LZ77 window
+ -- zconf.h:115
+ SEEK_SET : constant := 8#0000#; -- zconf.h:244
+ -- Seek from beginning of file.
+ -- zconf.h:244
+ SEEK_CUR : constant := 1; -- zconf.h:245
+ -- Seek from current position.
+ -- zconf.h:245
+ SEEK_END : constant := 2; -- zconf.h:246
+ -- Set file pointer to EOF plus "offset"
+ -- zconf.h:246
+
+ type Byte is new Interfaces.C.unsigned_char; -- 8 bits
+ -- zconf.h:214
+ type UInt is new Interfaces.C.unsigned; -- 16 bits or more
+ -- zconf.h:216
+ type Int is new Interfaces.C.int;
+
+ type ULong is new Interfaces.C.unsigned_long; -- 32 bits or more
+ -- zconf.h:217
+ subtype Chars_Ptr is Interfaces.C.Strings.chars_ptr;
+
+ type ULong_Access is access ULong;
+ type Int_Access is access Int;
+
+ subtype Voidp is System.Address; -- zconf.h:232
+
+ subtype Byte_Access is Voidp;
+
+ Nul : constant Voidp := System.Null_Address;
+ -- end from zconf
+
+ Z_NO_FLUSH : constant := 8#0000#; -- zlib.h:125
+ -- zlib.h:125
+ Z_PARTIAL_FLUSH : constant := 1; -- zlib.h:126
+ -- will be removed, use
+ -- Z_SYNC_FLUSH instead
+ -- zlib.h:126
+ Z_SYNC_FLUSH : constant := 2; -- zlib.h:127
+ -- zlib.h:127
+ Z_FULL_FLUSH : constant := 3; -- zlib.h:128
+ -- zlib.h:128
+ Z_FINISH : constant := 4; -- zlib.h:129
+ -- zlib.h:129
+ Z_OK : constant := 8#0000#; -- zlib.h:132
+ -- zlib.h:132
+ Z_STREAM_END : constant := 1; -- zlib.h:133
+ -- zlib.h:133
+ Z_NEED_DICT : constant := 2; -- zlib.h:134
+ -- zlib.h:134
+ Z_ERRNO : constant := -1; -- zlib.h:135
+ -- zlib.h:135
+ Z_STREAM_ERROR : constant := -2; -- zlib.h:136
+ -- zlib.h:136
+ Z_DATA_ERROR : constant := -3; -- zlib.h:137
+ -- zlib.h:137
+ Z_MEM_ERROR : constant := -4; -- zlib.h:138
+ -- zlib.h:138
+ Z_BUF_ERROR : constant := -5; -- zlib.h:139
+ -- zlib.h:139
+ Z_VERSION_ERROR : constant := -6; -- zlib.h:140
+ -- zlib.h:140
+ Z_NO_COMPRESSION : constant := 8#0000#; -- zlib.h:145
+ -- zlib.h:145
+ Z_BEST_SPEED : constant := 1; -- zlib.h:146
+ -- zlib.h:146
+ Z_BEST_COMPRESSION : constant := 9; -- zlib.h:147
+ -- zlib.h:147
+ Z_DEFAULT_COMPRESSION : constant := -1; -- zlib.h:148
+ -- zlib.h:148
+ Z_FILTERED : constant := 1; -- zlib.h:151
+ -- zlib.h:151
+ Z_HUFFMAN_ONLY : constant := 2; -- zlib.h:152
+ -- zlib.h:152
+ Z_DEFAULT_STRATEGY : constant := 8#0000#; -- zlib.h:153
+ -- zlib.h:153
+ Z_BINARY : constant := 8#0000#; -- zlib.h:156
+ -- zlib.h:156
+ Z_ASCII : constant := 1; -- zlib.h:157
+ -- zlib.h:157
+ Z_UNKNOWN : constant := 2; -- zlib.h:158
+ -- zlib.h:158
+ Z_DEFLATED : constant := 8; -- zlib.h:161
+ -- zlib.h:161
+ Z_NULL : constant := 8#0000#; -- zlib.h:164
+ -- for initializing zalloc, zfree, opaque
+ -- zlib.h:164
+ type gzFile is new Voidp; -- zlib.h:646
+
+ type Z_Stream is private;
+
+ type Z_Streamp is access all Z_Stream; -- zlib.h:89
+
+ type alloc_func is access function
+ (Opaque : Voidp;
+ Items : UInt;
+ Size : UInt)
+ return Voidp; -- zlib.h:63
+
+ type free_func is access procedure (opaque : Voidp; address : Voidp);
+
+ function zlibVersion return Chars_Ptr;
+
+ function Deflate (strm : Z_Streamp; flush : Int) return Int;
+
+ function DeflateEnd (strm : Z_Streamp) return Int;
+
+ function Inflate (strm : Z_Streamp; flush : Int) return Int;
+
+ function InflateEnd (strm : Z_Streamp) return Int;
+
+ function deflateSetDictionary
+ (strm : Z_Streamp;
+ dictionary : Byte_Access;
+ dictLength : UInt)
+ return Int;
+
+ function deflateCopy (dest : Z_Streamp; source : Z_Streamp) return Int;
+ -- zlib.h:478
+
+ function deflateReset (strm : Z_Streamp) return Int; -- zlib.h:495
+
+ function deflateParams
+ (strm : Z_Streamp;
+ level : Int;
+ strategy : Int)
+ return Int; -- zlib.h:506
+
+ function inflateSetDictionary
+ (strm : Z_Streamp;
+ dictionary : Byte_Access;
+ dictLength : UInt)
+ return Int; -- zlib.h:548
+
+ function inflateSync (strm : Z_Streamp) return Int; -- zlib.h:565
+
+ function inflateReset (strm : Z_Streamp) return Int; -- zlib.h:580
+
+ function compress
+ (dest : Byte_Access;
+ destLen : ULong_Access;
+ source : Byte_Access;
+ sourceLen : ULong)
+ return Int; -- zlib.h:601
+
+ function compress2
+ (dest : Byte_Access;
+ destLen : ULong_Access;
+ source : Byte_Access;
+ sourceLen : ULong;
+ level : Int)
+ return Int; -- zlib.h:615
+
+ function uncompress
+ (dest : Byte_Access;
+ destLen : ULong_Access;
+ source : Byte_Access;
+ sourceLen : ULong)
+ return Int;
+
+ function gzopen (path : Chars_Ptr; mode : Chars_Ptr) return gzFile;
+
+ function gzdopen (fd : Int; mode : Chars_Ptr) return gzFile;
+
+ function gzsetparams
+ (file : gzFile;
+ level : Int;
+ strategy : Int)
+ return Int;
+
+ function gzread
+ (file : gzFile;
+ buf : Voidp;
+ len : UInt)
+ return Int;
+
+ function gzwrite
+ (file : in gzFile;
+ buf : in Voidp;
+ len : in UInt)
+ return Int;
+
+ function gzprintf (file : in gzFile; format : in Chars_Ptr) return Int;
+
+ function gzputs (file : in gzFile; s : in Chars_Ptr) return Int;
+
+ function gzgets
+ (file : gzFile;
+ buf : Chars_Ptr;
+ len : Int)
+ return Chars_Ptr;
+
+ function gzputc (file : gzFile; char : Int) return Int;
+
+ function gzgetc (file : gzFile) return Int;
+
+ function gzflush (file : gzFile; flush : Int) return Int;
+
+ function gzseek
+ (file : gzFile;
+ offset : Int;
+ whence : Int)
+ return Int;
+
+ function gzrewind (file : gzFile) return Int;
+
+ function gztell (file : gzFile) return Int;
+
+ function gzeof (file : gzFile) return Int;
+
+ function gzclose (file : gzFile) return Int;
+
+ function gzerror (file : gzFile; errnum : Int_Access) return Chars_Ptr;
+
+ function adler32
+ (adler : ULong;
+ buf : Byte_Access;
+ len : UInt)
+ return ULong;
+
+ function crc32
+ (crc : ULong;
+ buf : Byte_Access;
+ len : UInt)
+ return ULong;
+
+ function deflateInit
+ (strm : Z_Streamp;
+ level : Int;
+ version : Chars_Ptr;
+ stream_size : Int)
+ return Int;
+
+ function deflateInit2
+ (strm : Z_Streamp;
+ level : Int;
+ method : Int;
+ windowBits : Int;
+ memLevel : Int;
+ strategy : Int;
+ version : Chars_Ptr;
+ stream_size : Int)
+ return Int;
+
+ function Deflate_Init
+ (strm : Z_Streamp;
+ level : Int;
+ method : Int;
+ windowBits : Int;
+ memLevel : Int;
+ strategy : Int)
+ return Int;
+ pragma Inline (Deflate_Init);
+
+ function inflateInit
+ (strm : Z_Streamp;
+ version : Chars_Ptr;
+ stream_size : Int)
+ return Int;
+
+ function inflateInit2
+ (strm : in Z_Streamp;
+ windowBits : in Int;
+ version : in Chars_Ptr;
+ stream_size : in Int)
+ return Int;
+
+ function inflateBackInit
+ (strm : in Z_Streamp;
+ windowBits : in Int;
+ window : in Byte_Access;
+ version : in Chars_Ptr;
+ stream_size : in Int)
+ return Int;
+ -- Size of window have to be 2**windowBits.
+
+ function Inflate_Init (strm : Z_Streamp; windowBits : Int) return Int;
+ pragma Inline (Inflate_Init);
+
+ function zError (err : Int) return Chars_Ptr;
+
+ function inflateSyncPoint (z : Z_Streamp) return Int;
+
+ function get_crc_table return ULong_Access;
+
+ -- Interface to the available fields of the z_stream structure.
+ -- The application must update next_in and avail_in when avail_in has
+ -- dropped to zero. It must update next_out and avail_out when avail_out
+ -- has dropped to zero. The application must initialize zalloc, zfree and
+ -- opaque before calling the init function.
+
+ procedure Set_In
+ (Strm : in out Z_Stream;
+ Buffer : in Voidp;
+ Size : in UInt);
+ pragma Inline (Set_In);
+
+ procedure Set_Out
+ (Strm : in out Z_Stream;
+ Buffer : in Voidp;
+ Size : in UInt);
+ pragma Inline (Set_Out);
+
+ procedure Set_Mem_Func
+ (Strm : in out Z_Stream;
+ Opaque : in Voidp;
+ Alloc : in alloc_func;
+ Free : in free_func);
+ pragma Inline (Set_Mem_Func);
+
+ function Last_Error_Message (Strm : in Z_Stream) return String;
+ pragma Inline (Last_Error_Message);
+
+ function Avail_Out (Strm : in Z_Stream) return UInt;
+ pragma Inline (Avail_Out);
+
+ function Avail_In (Strm : in Z_Stream) return UInt;
+ pragma Inline (Avail_In);
+
+ function Total_In (Strm : in Z_Stream) return ULong;
+ pragma Inline (Total_In);
+
+ function Total_Out (Strm : in Z_Stream) return ULong;
+ pragma Inline (Total_Out);
+
+ function inflateCopy
+ (dest : in Z_Streamp;
+ Source : in Z_Streamp)
+ return Int;
+
+ function compressBound (Source_Len : in ULong) return ULong;
+
+ function deflateBound
+ (Strm : in Z_Streamp;
+ Source_Len : in ULong)
+ return ULong;
+
+ function gzungetc (C : in Int; File : in gzFile) return Int;
+
+ function zlibCompileFlags return ULong;
+
+private
+
+ type Z_Stream is record -- zlib.h:68
+ Next_In : Voidp := Nul; -- next input byte
+ Avail_In : UInt := 0; -- number of bytes available at next_in
+ Total_In : ULong := 0; -- total nb of input bytes read so far
+ Next_Out : Voidp := Nul; -- next output byte should be put there
+ Avail_Out : UInt := 0; -- remaining free space at next_out
+ Total_Out : ULong := 0; -- total nb of bytes output so far
+ msg : Chars_Ptr; -- last error message, NULL if no error
+ state : Voidp; -- not visible by applications
+ zalloc : alloc_func := null; -- used to allocate the internal state
+ zfree : free_func := null; -- used to free the internal state
+ opaque : Voidp; -- private data object passed to
+ -- zalloc and zfree
+ data_type : Int; -- best guess about the data type:
+ -- ascii or binary
+ adler : ULong; -- adler32 value of the uncompressed
+ -- data
+ reserved : ULong; -- reserved for future use
+ end record;
+
+ pragma Convention (C, Z_Stream);
+
+ pragma Import (C, zlibVersion, "zlibVersion");
+ pragma Import (C, Deflate, "deflate");
+ pragma Import (C, DeflateEnd, "deflateEnd");
+ pragma Import (C, Inflate, "inflate");
+ pragma Import (C, InflateEnd, "inflateEnd");
+ pragma Import (C, deflateSetDictionary, "deflateSetDictionary");
+ pragma Import (C, deflateCopy, "deflateCopy");
+ pragma Import (C, deflateReset, "deflateReset");
+ pragma Import (C, deflateParams, "deflateParams");
+ pragma Import (C, inflateSetDictionary, "inflateSetDictionary");
+ pragma Import (C, inflateSync, "inflateSync");
+ pragma Import (C, inflateReset, "inflateReset");
+ pragma Import (C, compress, "compress");
+ pragma Import (C, compress2, "compress2");
+ pragma Import (C, uncompress, "uncompress");
+ pragma Import (C, gzopen, "gzopen");
+ pragma Import (C, gzdopen, "gzdopen");
+ pragma Import (C, gzsetparams, "gzsetparams");
+ pragma Import (C, gzread, "gzread");
+ pragma Import (C, gzwrite, "gzwrite");
+ pragma Import (C, gzprintf, "gzprintf");
+ pragma Import (C, gzputs, "gzputs");
+ pragma Import (C, gzgets, "gzgets");
+ pragma Import (C, gzputc, "gzputc");
+ pragma Import (C, gzgetc, "gzgetc");
+ pragma Import (C, gzflush, "gzflush");
+ pragma Import (C, gzseek, "gzseek");
+ pragma Import (C, gzrewind, "gzrewind");
+ pragma Import (C, gztell, "gztell");
+ pragma Import (C, gzeof, "gzeof");
+ pragma Import (C, gzclose, "gzclose");
+ pragma Import (C, gzerror, "gzerror");
+ pragma Import (C, adler32, "adler32");
+ pragma Import (C, crc32, "crc32");
+ pragma Import (C, deflateInit, "deflateInit_");
+ pragma Import (C, inflateInit, "inflateInit_");
+ pragma Import (C, deflateInit2, "deflateInit2_");
+ pragma Import (C, inflateInit2, "inflateInit2_");
+ pragma Import (C, zError, "zError");
+ pragma Import (C, inflateSyncPoint, "inflateSyncPoint");
+ pragma Import (C, get_crc_table, "get_crc_table");
+
+ -- since zlib 1.2.0:
+
+ pragma Import (C, inflateCopy, "inflateCopy");
+ pragma Import (C, compressBound, "compressBound");
+ pragma Import (C, deflateBound, "deflateBound");
+ pragma Import (C, gzungetc, "gzungetc");
+ pragma Import (C, zlibCompileFlags, "zlibCompileFlags");
+
+ pragma Import (C, inflateBackInit, "inflateBackInit_");
+
+ -- I stopped binding the inflateBack routines, becouse realize that
+ -- it does not support zlib and gzip headers for now, and have no
+ -- symmetric deflateBack routines.
+ -- ZLib-Ada is symmetric regarding deflate/inflate data transformation
+ -- and has a similar generic callback interface for the
+ -- deflate/inflate transformation based on the regular Deflate/Inflate
+ -- routines.
+
+ -- pragma Import (C, inflateBack, "inflateBack");
+ -- pragma Import (C, inflateBackEnd, "inflateBackEnd");
+
+end ZLib.Thin;
diff --git a/protocols/Telegram/tgl/zlib/contrib/ada/zlib.adb b/protocols/Telegram/tgl/zlib/contrib/ada/zlib.adb
new file mode 100644
index 0000000000..8b6fd686ac
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/ada/zlib.adb
@@ -0,0 +1,701 @@
+----------------------------------------------------------------
+-- ZLib for Ada thick binding. --
+-- --
+-- Copyright (C) 2002-2004 Dmitriy Anisimkov --
+-- --
+-- Open source license information is in the zlib.ads file. --
+----------------------------------------------------------------
+
+-- $Id: zlib.adb,v 1.31 2004/09/06 06:53:19 vagul Exp $
+
+with Ada.Exceptions;
+with Ada.Unchecked_Conversion;
+with Ada.Unchecked_Deallocation;
+
+with Interfaces.C.Strings;
+
+with ZLib.Thin;
+
+package body ZLib is
+
+ use type Thin.Int;
+
+ type Z_Stream is new Thin.Z_Stream;
+
+ type Return_Code_Enum is
+ (OK,
+ STREAM_END,
+ NEED_DICT,
+ ERRNO,
+ STREAM_ERROR,
+ DATA_ERROR,
+ MEM_ERROR,
+ BUF_ERROR,
+ VERSION_ERROR);
+
+ type Flate_Step_Function is access
+ function (Strm : in Thin.Z_Streamp; Flush : in Thin.Int) return Thin.Int;
+ pragma Convention (C, Flate_Step_Function);
+
+ type Flate_End_Function is access
+ function (Ctrm : in Thin.Z_Streamp) return Thin.Int;
+ pragma Convention (C, Flate_End_Function);
+
+ type Flate_Type is record
+ Step : Flate_Step_Function;
+ Done : Flate_End_Function;
+ end record;
+
+ subtype Footer_Array is Stream_Element_Array (1 .. 8);
+
+ Simple_GZip_Header : constant Stream_Element_Array (1 .. 10)
+ := (16#1f#, 16#8b#, -- Magic header
+ 16#08#, -- Z_DEFLATED
+ 16#00#, -- Flags
+ 16#00#, 16#00#, 16#00#, 16#00#, -- Time
+ 16#00#, -- XFlags
+ 16#03# -- OS code
+ );
+ -- The simplest gzip header is not for informational, but just for
+ -- gzip format compatibility.
+ -- Note that some code below is using assumption
+ -- Simple_GZip_Header'Last > Footer_Array'Last, so do not make
+ -- Simple_GZip_Header'Last <= Footer_Array'Last.
+
+ Return_Code : constant array (Thin.Int range <>) of Return_Code_Enum
+ := (0 => OK,
+ 1 => STREAM_END,
+ 2 => NEED_DICT,
+ -1 => ERRNO,
+ -2 => STREAM_ERROR,
+ -3 => DATA_ERROR,
+ -4 => MEM_ERROR,
+ -5 => BUF_ERROR,
+ -6 => VERSION_ERROR);
+
+ Flate : constant array (Boolean) of Flate_Type
+ := (True => (Step => Thin.Deflate'Access,
+ Done => Thin.DeflateEnd'Access),
+ False => (Step => Thin.Inflate'Access,
+ Done => Thin.InflateEnd'Access));
+
+ Flush_Finish : constant array (Boolean) of Flush_Mode
+ := (True => Finish, False => No_Flush);
+
+ procedure Raise_Error (Stream : in Z_Stream);
+ pragma Inline (Raise_Error);
+
+ procedure Raise_Error (Message : in String);
+ pragma Inline (Raise_Error);
+
+ procedure Check_Error (Stream : in Z_Stream; Code : in Thin.Int);
+
+ procedure Free is new Ada.Unchecked_Deallocation
+ (Z_Stream, Z_Stream_Access);
+
+ function To_Thin_Access is new Ada.Unchecked_Conversion
+ (Z_Stream_Access, Thin.Z_Streamp);
+
+ procedure Translate_GZip
+ (Filter : in out Filter_Type;
+ In_Data : in Ada.Streams.Stream_Element_Array;
+ In_Last : out Ada.Streams.Stream_Element_Offset;
+ Out_Data : out Ada.Streams.Stream_Element_Array;
+ Out_Last : out Ada.Streams.Stream_Element_Offset;
+ Flush : in Flush_Mode);
+ -- Separate translate routine for make gzip header.
+
+ procedure Translate_Auto
+ (Filter : in out Filter_Type;
+ In_Data : in Ada.Streams.Stream_Element_Array;
+ In_Last : out Ada.Streams.Stream_Element_Offset;
+ Out_Data : out Ada.Streams.Stream_Element_Array;
+ Out_Last : out Ada.Streams.Stream_Element_Offset;
+ Flush : in Flush_Mode);
+ -- translate routine without additional headers.
+
+ -----------------
+ -- Check_Error --
+ -----------------
+
+ procedure Check_Error (Stream : in Z_Stream; Code : in Thin.Int) is
+ use type Thin.Int;
+ begin
+ if Code /= Thin.Z_OK then
+ Raise_Error
+ (Return_Code_Enum'Image (Return_Code (Code))
+ & ": " & Last_Error_Message (Stream));
+ end if;
+ end Check_Error;
+
+ -----------
+ -- Close --
+ -----------
+
+ procedure Close
+ (Filter : in out Filter_Type;
+ Ignore_Error : in Boolean := False)
+ is
+ Code : Thin.Int;
+ begin
+ if not Ignore_Error and then not Is_Open (Filter) then
+ raise Status_Error;
+ end if;
+
+ Code := Flate (Filter.Compression).Done (To_Thin_Access (Filter.Strm));
+
+ if Ignore_Error or else Code = Thin.Z_OK then
+ Free (Filter.Strm);
+ else
+ declare
+ Error_Message : constant String
+ := Last_Error_Message (Filter.Strm.all);
+ begin
+ Free (Filter.Strm);
+ Ada.Exceptions.Raise_Exception
+ (ZLib_Error'Identity,
+ Return_Code_Enum'Image (Return_Code (Code))
+ & ": " & Error_Message);
+ end;
+ end if;
+ end Close;
+
+ -----------
+ -- CRC32 --
+ -----------
+
+ function CRC32
+ (CRC : in Unsigned_32;
+ Data : in Ada.Streams.Stream_Element_Array)
+ return Unsigned_32
+ is
+ use Thin;
+ begin
+ return Unsigned_32 (crc32 (ULong (CRC),
+ Data'Address,
+ Data'Length));
+ end CRC32;
+
+ procedure CRC32
+ (CRC : in out Unsigned_32;
+ Data : in Ada.Streams.Stream_Element_Array) is
+ begin
+ CRC := CRC32 (CRC, Data);
+ end CRC32;
+
+ ------------------
+ -- Deflate_Init --
+ ------------------
+
+ procedure Deflate_Init
+ (Filter : in out Filter_Type;
+ Level : in Compression_Level := Default_Compression;
+ Strategy : in Strategy_Type := Default_Strategy;
+ Method : in Compression_Method := Deflated;
+ Window_Bits : in Window_Bits_Type := Default_Window_Bits;
+ Memory_Level : in Memory_Level_Type := Default_Memory_Level;
+ Header : in Header_Type := Default)
+ is
+ use type Thin.Int;
+ Win_Bits : Thin.Int := Thin.Int (Window_Bits);
+ begin
+ if Is_Open (Filter) then
+ raise Status_Error;
+ end if;
+
+ -- We allow ZLib to make header only in case of default header type.
+ -- Otherwise we would either do header by ourselfs, or do not do
+ -- header at all.
+
+ if Header = None or else Header = GZip then
+ Win_Bits := -Win_Bits;
+ end if;
+
+ -- For the GZip CRC calculation and make headers.
+
+ if Header = GZip then
+ Filter.CRC := 0;
+ Filter.Offset := Simple_GZip_Header'First;
+ else
+ Filter.Offset := Simple_GZip_Header'Last + 1;
+ end if;
+
+ Filter.Strm := new Z_Stream;
+ Filter.Compression := True;
+ Filter.Stream_End := False;
+ Filter.Header := Header;
+
+ if Thin.Deflate_Init
+ (To_Thin_Access (Filter.Strm),
+ Level => Thin.Int (Level),
+ method => Thin.Int (Method),
+ windowBits => Win_Bits,
+ memLevel => Thin.Int (Memory_Level),
+ strategy => Thin.Int (Strategy)) /= Thin.Z_OK
+ then
+ Raise_Error (Filter.Strm.all);
+ end if;
+ end Deflate_Init;
+
+ -----------
+ -- Flush --
+ -----------
+
+ procedure Flush
+ (Filter : in out Filter_Type;
+ Out_Data : out Ada.Streams.Stream_Element_Array;
+ Out_Last : out Ada.Streams.Stream_Element_Offset;
+ Flush : in Flush_Mode)
+ is
+ No_Data : Stream_Element_Array := (1 .. 0 => 0);
+ Last : Stream_Element_Offset;
+ begin
+ Translate (Filter, No_Data, Last, Out_Data, Out_Last, Flush);
+ end Flush;
+
+ -----------------------
+ -- Generic_Translate --
+ -----------------------
+
+ procedure Generic_Translate
+ (Filter : in out ZLib.Filter_Type;
+ In_Buffer_Size : in Integer := Default_Buffer_Size;
+ Out_Buffer_Size : in Integer := Default_Buffer_Size)
+ is
+ In_Buffer : Stream_Element_Array
+ (1 .. Stream_Element_Offset (In_Buffer_Size));
+ Out_Buffer : Stream_Element_Array
+ (1 .. Stream_Element_Offset (Out_Buffer_Size));
+ Last : Stream_Element_Offset;
+ In_Last : Stream_Element_Offset;
+ In_First : Stream_Element_Offset;
+ Out_Last : Stream_Element_Offset;
+ begin
+ Main : loop
+ Data_In (In_Buffer, Last);
+
+ In_First := In_Buffer'First;
+
+ loop
+ Translate
+ (Filter => Filter,
+ In_Data => In_Buffer (In_First .. Last),
+ In_Last => In_Last,
+ Out_Data => Out_Buffer,
+ Out_Last => Out_Last,
+ Flush => Flush_Finish (Last < In_Buffer'First));
+
+ if Out_Buffer'First <= Out_Last then
+ Data_Out (Out_Buffer (Out_Buffer'First .. Out_Last));
+ end if;
+
+ exit Main when Stream_End (Filter);
+
+ -- The end of in buffer.
+
+ exit when In_Last = Last;
+
+ In_First := In_Last + 1;
+ end loop;
+ end loop Main;
+
+ end Generic_Translate;
+
+ ------------------
+ -- Inflate_Init --
+ ------------------
+
+ procedure Inflate_Init
+ (Filter : in out Filter_Type;
+ Window_Bits : in Window_Bits_Type := Default_Window_Bits;
+ Header : in Header_Type := Default)
+ is
+ use type Thin.Int;
+ Win_Bits : Thin.Int := Thin.Int (Window_Bits);
+
+ procedure Check_Version;
+ -- Check the latest header types compatibility.
+
+ procedure Check_Version is
+ begin
+ if Version <= "1.1.4" then
+ Raise_Error
+ ("Inflate header type " & Header_Type'Image (Header)
+ & " incompatible with ZLib version " & Version);
+ end if;
+ end Check_Version;
+
+ begin
+ if Is_Open (Filter) then
+ raise Status_Error;
+ end if;
+
+ case Header is
+ when None =>
+ Check_Version;
+
+ -- Inflate data without headers determined
+ -- by negative Win_Bits.
+
+ Win_Bits := -Win_Bits;
+ when GZip =>
+ Check_Version;
+
+ -- Inflate gzip data defined by flag 16.
+
+ Win_Bits := Win_Bits + 16;
+ when Auto =>
+ Check_Version;
+
+ -- Inflate with automatic detection
+ -- of gzip or native header defined by flag 32.
+
+ Win_Bits := Win_Bits + 32;
+ when Default => null;
+ end case;
+
+ Filter.Strm := new Z_Stream;
+ Filter.Compression := False;
+ Filter.Stream_End := False;
+ Filter.Header := Header;
+
+ if Thin.Inflate_Init
+ (To_Thin_Access (Filter.Strm), Win_Bits) /= Thin.Z_OK
+ then
+ Raise_Error (Filter.Strm.all);
+ end if;
+ end Inflate_Init;
+
+ -------------
+ -- Is_Open --
+ -------------
+
+ function Is_Open (Filter : in Filter_Type) return Boolean is
+ begin
+ return Filter.Strm /= null;
+ end Is_Open;
+
+ -----------------
+ -- Raise_Error --
+ -----------------
+
+ procedure Raise_Error (Message : in String) is
+ begin
+ Ada.Exceptions.Raise_Exception (ZLib_Error'Identity, Message);
+ end Raise_Error;
+
+ procedure Raise_Error (Stream : in Z_Stream) is
+ begin
+ Raise_Error (Last_Error_Message (Stream));
+ end Raise_Error;
+
+ ----------
+ -- Read --
+ ----------
+
+ procedure Read
+ (Filter : in out Filter_Type;
+ Item : out Ada.Streams.Stream_Element_Array;
+ Last : out Ada.Streams.Stream_Element_Offset;
+ Flush : in Flush_Mode := No_Flush)
+ is
+ In_Last : Stream_Element_Offset;
+ Item_First : Ada.Streams.Stream_Element_Offset := Item'First;
+ V_Flush : Flush_Mode := Flush;
+
+ begin
+ pragma Assert (Rest_First in Buffer'First .. Buffer'Last + 1);
+ pragma Assert (Rest_Last in Buffer'First - 1 .. Buffer'Last);
+
+ loop
+ if Rest_Last = Buffer'First - 1 then
+ V_Flush := Finish;
+
+ elsif Rest_First > Rest_Last then
+ Read (Buffer, Rest_Last);
+ Rest_First := Buffer'First;
+
+ if Rest_Last < Buffer'First then
+ V_Flush := Finish;
+ end if;
+ end if;
+
+ Translate
+ (Filter => Filter,
+ In_Data => Buffer (Rest_First .. Rest_Last),
+ In_Last => In_Last,
+ Out_Data => Item (Item_First .. Item'Last),
+ Out_Last => Last,
+ Flush => V_Flush);
+
+ Rest_First := In_Last + 1;
+
+ exit when Stream_End (Filter)
+ or else Last = Item'Last
+ or else (Last >= Item'First and then Allow_Read_Some);
+
+ Item_First := Last + 1;
+ end loop;
+ end Read;
+
+ ----------------
+ -- Stream_End --
+ ----------------
+
+ function Stream_End (Filter : in Filter_Type) return Boolean is
+ begin
+ if Filter.Header = GZip and Filter.Compression then
+ return Filter.Stream_End
+ and then Filter.Offset = Footer_Array'Last + 1;
+ else
+ return Filter.Stream_End;
+ end if;
+ end Stream_End;
+
+ --------------
+ -- Total_In --
+ --------------
+
+ function Total_In (Filter : in Filter_Type) return Count is
+ begin
+ return Count (Thin.Total_In (To_Thin_Access (Filter.Strm).all));
+ end Total_In;
+
+ ---------------
+ -- Total_Out --
+ ---------------
+
+ function Total_Out (Filter : in Filter_Type) return Count is
+ begin
+ return Count (Thin.Total_Out (To_Thin_Access (Filter.Strm).all));
+ end Total_Out;
+
+ ---------------
+ -- Translate --
+ ---------------
+
+ procedure Translate
+ (Filter : in out Filter_Type;
+ In_Data : in Ada.Streams.Stream_Element_Array;
+ In_Last : out Ada.Streams.Stream_Element_Offset;
+ Out_Data : out Ada.Streams.Stream_Element_Array;
+ Out_Last : out Ada.Streams.Stream_Element_Offset;
+ Flush : in Flush_Mode) is
+ begin
+ if Filter.Header = GZip and then Filter.Compression then
+ Translate_GZip
+ (Filter => Filter,
+ In_Data => In_Data,
+ In_Last => In_Last,
+ Out_Data => Out_Data,
+ Out_Last => Out_Last,
+ Flush => Flush);
+ else
+ Translate_Auto
+ (Filter => Filter,
+ In_Data => In_Data,
+ In_Last => In_Last,
+ Out_Data => Out_Data,
+ Out_Last => Out_Last,
+ Flush => Flush);
+ end if;
+ end Translate;
+
+ --------------------
+ -- Translate_Auto --
+ --------------------
+
+ procedure Translate_Auto
+ (Filter : in out Filter_Type;
+ In_Data : in Ada.Streams.Stream_Element_Array;
+ In_Last : out Ada.Streams.Stream_Element_Offset;
+ Out_Data : out Ada.Streams.Stream_Element_Array;
+ Out_Last : out Ada.Streams.Stream_Element_Offset;
+ Flush : in Flush_Mode)
+ is
+ use type Thin.Int;
+ Code : Thin.Int;
+
+ begin
+ if not Is_Open (Filter) then
+ raise Status_Error;
+ end if;
+
+ if Out_Data'Length = 0 and then In_Data'Length = 0 then
+ raise Constraint_Error;
+ end if;
+
+ Set_Out (Filter.Strm.all, Out_Data'Address, Out_Data'Length);
+ Set_In (Filter.Strm.all, In_Data'Address, In_Data'Length);
+
+ Code := Flate (Filter.Compression).Step
+ (To_Thin_Access (Filter.Strm),
+ Thin.Int (Flush));
+
+ if Code = Thin.Z_STREAM_END then
+ Filter.Stream_End := True;
+ else
+ Check_Error (Filter.Strm.all, Code);
+ end if;
+
+ In_Last := In_Data'Last
+ - Stream_Element_Offset (Avail_In (Filter.Strm.all));
+ Out_Last := Out_Data'Last
+ - Stream_Element_Offset (Avail_Out (Filter.Strm.all));
+ end Translate_Auto;
+
+ --------------------
+ -- Translate_GZip --
+ --------------------
+
+ procedure Translate_GZip
+ (Filter : in out Filter_Type;
+ In_Data : in Ada.Streams.Stream_Element_Array;
+ In_Last : out Ada.Streams.Stream_Element_Offset;
+ Out_Data : out Ada.Streams.Stream_Element_Array;
+ Out_Last : out Ada.Streams.Stream_Element_Offset;
+ Flush : in Flush_Mode)
+ is
+ Out_First : Stream_Element_Offset;
+
+ procedure Add_Data (Data : in Stream_Element_Array);
+ -- Add data to stream from the Filter.Offset till necessary,
+ -- used for add gzip headr/footer.
+
+ procedure Put_32
+ (Item : in out Stream_Element_Array;
+ Data : in Unsigned_32);
+ pragma Inline (Put_32);
+
+ --------------
+ -- Add_Data --
+ --------------
+
+ procedure Add_Data (Data : in Stream_Element_Array) is
+ Data_First : Stream_Element_Offset renames Filter.Offset;
+ Data_Last : Stream_Element_Offset;
+ Data_Len : Stream_Element_Offset; -- -1
+ Out_Len : Stream_Element_Offset; -- -1
+ begin
+ Out_First := Out_Last + 1;
+
+ if Data_First > Data'Last then
+ return;
+ end if;
+
+ Data_Len := Data'Last - Data_First;
+ Out_Len := Out_Data'Last - Out_First;
+
+ if Data_Len <= Out_Len then
+ Out_Last := Out_First + Data_Len;
+ Data_Last := Data'Last;
+ else
+ Out_Last := Out_Data'Last;
+ Data_Last := Data_First + Out_Len;
+ end if;
+
+ Out_Data (Out_First .. Out_Last) := Data (Data_First .. Data_Last);
+
+ Data_First := Data_Last + 1;
+ Out_First := Out_Last + 1;
+ end Add_Data;
+
+ ------------
+ -- Put_32 --
+ ------------
+
+ procedure Put_32
+ (Item : in out Stream_Element_Array;
+ Data : in Unsigned_32)
+ is
+ D : Unsigned_32 := Data;
+ begin
+ for J in Item'First .. Item'First + 3 loop
+ Item (J) := Stream_Element (D and 16#FF#);
+ D := Shift_Right (D, 8);
+ end loop;
+ end Put_32;
+
+ begin
+ Out_Last := Out_Data'First - 1;
+
+ if not Filter.Stream_End then
+ Add_Data (Simple_GZip_Header);
+
+ Translate_Auto
+ (Filter => Filter,
+ In_Data => In_Data,
+ In_Last => In_Last,
+ Out_Data => Out_Data (Out_First .. Out_Data'Last),
+ Out_Last => Out_Last,
+ Flush => Flush);
+
+ CRC32 (Filter.CRC, In_Data (In_Data'First .. In_Last));
+ end if;
+
+ if Filter.Stream_End and then Out_Last <= Out_Data'Last then
+ -- This detection method would work only when
+ -- Simple_GZip_Header'Last > Footer_Array'Last
+
+ if Filter.Offset = Simple_GZip_Header'Last + 1 then
+ Filter.Offset := Footer_Array'First;
+ end if;
+
+ declare
+ Footer : Footer_Array;
+ begin
+ Put_32 (Footer, Filter.CRC);
+ Put_32 (Footer (Footer'First + 4 .. Footer'Last),
+ Unsigned_32 (Total_In (Filter)));
+ Add_Data (Footer);
+ end;
+ end if;
+ end Translate_GZip;
+
+ -------------
+ -- Version --
+ -------------
+
+ function Version return String is
+ begin
+ return Interfaces.C.Strings.Value (Thin.zlibVersion);
+ end Version;
+
+ -----------
+ -- Write --
+ -----------
+
+ procedure Write
+ (Filter : in out Filter_Type;
+ Item : in Ada.Streams.Stream_Element_Array;
+ Flush : in Flush_Mode := No_Flush)
+ is
+ Buffer : Stream_Element_Array (1 .. Buffer_Size);
+ In_Last : Stream_Element_Offset;
+ Out_Last : Stream_Element_Offset;
+ In_First : Stream_Element_Offset := Item'First;
+ begin
+ if Item'Length = 0 and Flush = No_Flush then
+ return;
+ end if;
+
+ loop
+ Translate
+ (Filter => Filter,
+ In_Data => Item (In_First .. Item'Last),
+ In_Last => In_Last,
+ Out_Data => Buffer,
+ Out_Last => Out_Last,
+ Flush => Flush);
+
+ if Out_Last >= Buffer'First then
+ Write (Buffer (1 .. Out_Last));
+ end if;
+
+ exit when In_Last = Item'Last or Stream_End (Filter);
+
+ In_First := In_Last + 1;
+ end loop;
+ end Write;
+
+end ZLib;
diff --git a/protocols/Telegram/tgl/zlib/contrib/ada/zlib.ads b/protocols/Telegram/tgl/zlib/contrib/ada/zlib.ads
new file mode 100644
index 0000000000..79ffc4095c
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/ada/zlib.ads
@@ -0,0 +1,328 @@
+------------------------------------------------------------------------------
+-- ZLib for Ada thick binding. --
+-- --
+-- Copyright (C) 2002-2004 Dmitriy Anisimkov --
+-- --
+-- This library is free software; you can redistribute it and/or modify --
+-- it under the terms of the GNU General Public License as published by --
+-- the Free Software Foundation; either version 2 of the License, or (at --
+-- your option) any later version. --
+-- --
+-- This library is distributed in the hope that it will be useful, but --
+-- WITHOUT ANY WARRANTY; without even the implied warranty of --
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --
+-- General Public License for more details. --
+-- --
+-- You should have received a copy of the GNU General Public License --
+-- along with this library; if not, write to the Free Software Foundation, --
+-- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --
+-- --
+-- As a special exception, if other files instantiate generics from this --
+-- unit, or you link this unit with other files to produce an executable, --
+-- this unit does not by itself cause the resulting executable to be --
+-- covered by the GNU General Public License. This exception does not --
+-- however invalidate any other reasons why the executable file might be --
+-- covered by the GNU Public License. --
+------------------------------------------------------------------------------
+
+-- $Id: zlib.ads,v 1.26 2004/09/06 06:53:19 vagul Exp $
+
+with Ada.Streams;
+
+with Interfaces;
+
+package ZLib is
+
+ ZLib_Error : exception;
+ Status_Error : exception;
+
+ type Compression_Level is new Integer range -1 .. 9;
+
+ type Flush_Mode is private;
+
+ type Compression_Method is private;
+
+ type Window_Bits_Type is new Integer range 8 .. 15;
+
+ type Memory_Level_Type is new Integer range 1 .. 9;
+
+ type Unsigned_32 is new Interfaces.Unsigned_32;
+
+ type Strategy_Type is private;
+
+ type Header_Type is (None, Auto, Default, GZip);
+ -- Header type usage have a some limitation for inflate.
+ -- See comment for Inflate_Init.
+
+ subtype Count is Ada.Streams.Stream_Element_Count;
+
+ Default_Memory_Level : constant Memory_Level_Type := 8;
+ Default_Window_Bits : constant Window_Bits_Type := 15;
+
+ ----------------------------------
+ -- Compression method constants --
+ ----------------------------------
+
+ Deflated : constant Compression_Method;
+ -- Only one method allowed in this ZLib version
+
+ ---------------------------------
+ -- Compression level constants --
+ ---------------------------------
+
+ No_Compression : constant Compression_Level := 0;
+ Best_Speed : constant Compression_Level := 1;
+ Best_Compression : constant Compression_Level := 9;
+ Default_Compression : constant Compression_Level := -1;
+
+ --------------------------
+ -- Flush mode constants --
+ --------------------------
+
+ No_Flush : constant Flush_Mode;
+ -- Regular way for compression, no flush
+
+ Partial_Flush : constant Flush_Mode;
+ -- Will be removed, use Z_SYNC_FLUSH instead
+
+ Sync_Flush : constant Flush_Mode;
+ -- All pending output is flushed to the output buffer and the output
+ -- is aligned on a byte boundary, so that the decompressor can get all
+ -- input data available so far. (In particular avail_in is zero after the
+ -- call if enough output space has been provided before the call.)
+ -- Flushing may degrade compression for some compression algorithms and so
+ -- it should be used only when necessary.
+
+ Block_Flush : constant Flush_Mode;
+ -- Z_BLOCK requests that inflate() stop
+ -- if and when it get to the next deflate block boundary. When decoding the
+ -- zlib or gzip format, this will cause inflate() to return immediately
+ -- after the header and before the first block. When doing a raw inflate,
+ -- inflate() will go ahead and process the first block, and will return
+ -- when it gets to the end of that block, or when it runs out of data.
+
+ Full_Flush : constant Flush_Mode;
+ -- All output is flushed as with SYNC_FLUSH, and the compression state
+ -- is reset so that decompression can restart from this point if previous
+ -- compressed data has been damaged or if random access is desired. Using
+ -- Full_Flush too often can seriously degrade the compression.
+
+ Finish : constant Flush_Mode;
+ -- Just for tell the compressor that input data is complete.
+
+ ------------------------------------
+ -- Compression strategy constants --
+ ------------------------------------
+
+ -- RLE stategy could be used only in version 1.2.0 and later.
+
+ Filtered : constant Strategy_Type;
+ Huffman_Only : constant Strategy_Type;
+ RLE : constant Strategy_Type;
+ Default_Strategy : constant Strategy_Type;
+
+ Default_Buffer_Size : constant := 4096;
+
+ type Filter_Type is tagged limited private;
+ -- The filter is for compression and for decompression.
+ -- The usage of the type is depend of its initialization.
+
+ function Version return String;
+ pragma Inline (Version);
+ -- Return string representation of the ZLib version.
+
+ procedure Deflate_Init
+ (Filter : in out Filter_Type;
+ Level : in Compression_Level := Default_Compression;
+ Strategy : in Strategy_Type := Default_Strategy;
+ Method : in Compression_Method := Deflated;
+ Window_Bits : in Window_Bits_Type := Default_Window_Bits;
+ Memory_Level : in Memory_Level_Type := Default_Memory_Level;
+ Header : in Header_Type := Default);
+ -- Compressor initialization.
+ -- When Header parameter is Auto or Default, then default zlib header
+ -- would be provided for compressed data.
+ -- When Header is GZip, then gzip header would be set instead of
+ -- default header.
+ -- When Header is None, no header would be set for compressed data.
+
+ procedure Inflate_Init
+ (Filter : in out Filter_Type;
+ Window_Bits : in Window_Bits_Type := Default_Window_Bits;
+ Header : in Header_Type := Default);
+ -- Decompressor initialization.
+ -- Default header type mean that ZLib default header is expecting in the
+ -- input compressed stream.
+ -- Header type None mean that no header is expecting in the input stream.
+ -- GZip header type mean that GZip header is expecting in the
+ -- input compressed stream.
+ -- Auto header type mean that header type (GZip or Native) would be
+ -- detected automatically in the input stream.
+ -- Note that header types parameter values None, GZip and Auto are
+ -- supported for inflate routine only in ZLib versions 1.2.0.2 and later.
+ -- Deflate_Init is supporting all header types.
+
+ function Is_Open (Filter : in Filter_Type) return Boolean;
+ pragma Inline (Is_Open);
+ -- Is the filter opened for compression or decompression.
+
+ procedure Close
+ (Filter : in out Filter_Type;
+ Ignore_Error : in Boolean := False);
+ -- Closing the compression or decompressor.
+ -- If stream is closing before the complete and Ignore_Error is False,
+ -- The exception would be raised.
+
+ generic
+ with procedure Data_In
+ (Item : out Ada.Streams.Stream_Element_Array;
+ Last : out Ada.Streams.Stream_Element_Offset);
+ with procedure Data_Out
+ (Item : in Ada.Streams.Stream_Element_Array);
+ procedure Generic_Translate
+ (Filter : in out Filter_Type;
+ In_Buffer_Size : in Integer := Default_Buffer_Size;
+ Out_Buffer_Size : in Integer := Default_Buffer_Size);
+ -- Compress/decompress data fetch from Data_In routine and pass the result
+ -- to the Data_Out routine. User should provide Data_In and Data_Out
+ -- for compression/decompression data flow.
+ -- Compression or decompression depend on Filter initialization.
+
+ function Total_In (Filter : in Filter_Type) return Count;
+ pragma Inline (Total_In);
+ -- Returns total number of input bytes read so far
+
+ function Total_Out (Filter : in Filter_Type) return Count;
+ pragma Inline (Total_Out);
+ -- Returns total number of bytes output so far
+
+ function CRC32
+ (CRC : in Unsigned_32;
+ Data : in Ada.Streams.Stream_Element_Array)
+ return Unsigned_32;
+ pragma Inline (CRC32);
+ -- Compute CRC32, it could be necessary for make gzip format
+
+ procedure CRC32
+ (CRC : in out Unsigned_32;
+ Data : in Ada.Streams.Stream_Element_Array);
+ pragma Inline (CRC32);
+ -- Compute CRC32, it could be necessary for make gzip format
+
+ -------------------------------------------------
+ -- Below is more complex low level routines. --
+ -------------------------------------------------
+
+ procedure Translate
+ (Filter : in out Filter_Type;
+ In_Data : in Ada.Streams.Stream_Element_Array;
+ In_Last : out Ada.Streams.Stream_Element_Offset;
+ Out_Data : out Ada.Streams.Stream_Element_Array;
+ Out_Last : out Ada.Streams.Stream_Element_Offset;
+ Flush : in Flush_Mode);
+ -- Compress/decompress the In_Data buffer and place the result into
+ -- Out_Data. In_Last is the index of last element from In_Data accepted by
+ -- the Filter. Out_Last is the last element of the received data from
+ -- Filter. To tell the filter that incoming data are complete put the
+ -- Flush parameter to Finish.
+
+ function Stream_End (Filter : in Filter_Type) return Boolean;
+ pragma Inline (Stream_End);
+ -- Return the true when the stream is complete.
+
+ procedure Flush
+ (Filter : in out Filter_Type;
+ Out_Data : out Ada.Streams.Stream_Element_Array;
+ Out_Last : out Ada.Streams.Stream_Element_Offset;
+ Flush : in Flush_Mode);
+ pragma Inline (Flush);
+ -- Flushing the data from the compressor.
+
+ generic
+ with procedure Write
+ (Item : in Ada.Streams.Stream_Element_Array);
+ -- User should provide this routine for accept
+ -- compressed/decompressed data.
+
+ Buffer_Size : in Ada.Streams.Stream_Element_Offset
+ := Default_Buffer_Size;
+ -- Buffer size for Write user routine.
+
+ procedure Write
+ (Filter : in out Filter_Type;
+ Item : in Ada.Streams.Stream_Element_Array;
+ Flush : in Flush_Mode := No_Flush);
+ -- Compress/Decompress data from Item to the generic parameter procedure
+ -- Write. Output buffer size could be set in Buffer_Size generic parameter.
+
+ generic
+ with procedure Read
+ (Item : out Ada.Streams.Stream_Element_Array;
+ Last : out Ada.Streams.Stream_Element_Offset);
+ -- User should provide data for compression/decompression
+ -- thru this routine.
+
+ Buffer : in out Ada.Streams.Stream_Element_Array;
+ -- Buffer for keep remaining data from the previous
+ -- back read.
+
+ Rest_First, Rest_Last : in out Ada.Streams.Stream_Element_Offset;
+ -- Rest_First have to be initialized to Buffer'Last + 1
+ -- Rest_Last have to be initialized to Buffer'Last
+ -- before usage.
+
+ Allow_Read_Some : in Boolean := False;
+ -- Is it allowed to return Last < Item'Last before end of data.
+
+ procedure Read
+ (Filter : in out Filter_Type;
+ Item : out Ada.Streams.Stream_Element_Array;
+ Last : out Ada.Streams.Stream_Element_Offset;
+ Flush : in Flush_Mode := No_Flush);
+ -- Compress/Decompress data from generic parameter procedure Read to the
+ -- Item. User should provide Buffer and initialized Rest_First, Rest_Last
+ -- indicators. If Allow_Read_Some is True, Read routines could return
+ -- Last < Item'Last only at end of stream.
+
+private
+
+ use Ada.Streams;
+
+ pragma Assert (Ada.Streams.Stream_Element'Size = 8);
+ pragma Assert (Ada.Streams.Stream_Element'Modulus = 2**8);
+
+ type Flush_Mode is new Integer range 0 .. 5;
+
+ type Compression_Method is new Integer range 8 .. 8;
+
+ type Strategy_Type is new Integer range 0 .. 3;
+
+ No_Flush : constant Flush_Mode := 0;
+ Partial_Flush : constant Flush_Mode := 1;
+ Sync_Flush : constant Flush_Mode := 2;
+ Full_Flush : constant Flush_Mode := 3;
+ Finish : constant Flush_Mode := 4;
+ Block_Flush : constant Flush_Mode := 5;
+
+ Filtered : constant Strategy_Type := 1;
+ Huffman_Only : constant Strategy_Type := 2;
+ RLE : constant Strategy_Type := 3;
+ Default_Strategy : constant Strategy_Type := 0;
+
+ Deflated : constant Compression_Method := 8;
+
+ type Z_Stream;
+
+ type Z_Stream_Access is access all Z_Stream;
+
+ type Filter_Type is tagged limited record
+ Strm : Z_Stream_Access;
+ Compression : Boolean;
+ Stream_End : Boolean;
+ Header : Header_Type;
+ CRC : Unsigned_32;
+ Offset : Stream_Element_Offset;
+ -- Offset for gzip header/footer output.
+ end record;
+
+end ZLib;
diff --git a/protocols/Telegram/tgl/zlib/contrib/ada/zlib.gpr b/protocols/Telegram/tgl/zlib/contrib/ada/zlib.gpr
new file mode 100644
index 0000000000..296b22aa96
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/ada/zlib.gpr
@@ -0,0 +1,20 @@
+project Zlib is
+
+ for Languages use ("Ada");
+ for Source_Dirs use (".");
+ for Object_Dir use ".";
+ for Main use ("test.adb", "mtest.adb", "read.adb", "buffer_demo");
+
+ package Compiler is
+ for Default_Switches ("ada") use ("-gnatwcfilopru", "-gnatVcdfimorst", "-gnatyabcefhiklmnoprst");
+ end Compiler;
+
+ package Linker is
+ for Default_Switches ("ada") use ("-lz");
+ end Linker;
+
+ package Builder is
+ for Default_Switches ("ada") use ("-s", "-gnatQ");
+ end Builder;
+
+end Zlib;
diff --git a/protocols/Telegram/tgl/zlib/contrib/amd64/amd64-match.S b/protocols/Telegram/tgl/zlib/contrib/amd64/amd64-match.S
new file mode 100644
index 0000000000..81d4a1c949
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/amd64/amd64-match.S
@@ -0,0 +1,452 @@
+/*
+ * match.S -- optimized version of longest_match()
+ * based on the similar work by Gilles Vollant, and Brian Raiter, written 1998
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the BSD License. Use by owners of Che Guevarra
+ * parafernalia is prohibited, where possible, and highly discouraged
+ * elsewhere.
+ */
+
+#ifndef NO_UNDERLINE
+# define match_init _match_init
+# define longest_match _longest_match
+#endif
+
+#define scanend ebx
+#define scanendw bx
+#define chainlenwmask edx /* high word: current chain len low word: s->wmask */
+#define curmatch rsi
+#define curmatchd esi
+#define windowbestlen r8
+#define scanalign r9
+#define scanalignd r9d
+#define window r10
+#define bestlen r11
+#define bestlend r11d
+#define scanstart r12d
+#define scanstartw r12w
+#define scan r13
+#define nicematch r14d
+#define limit r15
+#define limitd r15d
+#define prev rcx
+
+/*
+ * The 258 is a "magic number, not a parameter -- changing it
+ * breaks the hell loose
+ */
+#define MAX_MATCH (258)
+#define MIN_MATCH (3)
+#define MIN_LOOKAHEAD (MAX_MATCH + MIN_MATCH + 1)
+#define MAX_MATCH_8 ((MAX_MATCH + 7) & ~7)
+
+/* stack frame offsets */
+#define LocalVarsSize (112)
+#define _chainlenwmask ( 8-LocalVarsSize)(%rsp)
+#define _windowbestlen (16-LocalVarsSize)(%rsp)
+#define save_r14 (24-LocalVarsSize)(%rsp)
+#define save_rsi (32-LocalVarsSize)(%rsp)
+#define save_rbx (40-LocalVarsSize)(%rsp)
+#define save_r12 (56-LocalVarsSize)(%rsp)
+#define save_r13 (64-LocalVarsSize)(%rsp)
+#define save_r15 (80-LocalVarsSize)(%rsp)
+
+
+.globl match_init, longest_match
+
+/*
+ * On AMD64 the first argument of a function (in our case -- the pointer to
+ * deflate_state structure) is passed in %rdi, hence our offsets below are
+ * all off of that.
+ */
+
+/* you can check the structure offset by running
+
+#include <stdlib.h>
+#include <stdio.h>
+#include "deflate.h"
+
+void print_depl()
+{
+deflate_state ds;
+deflate_state *s=&ds;
+printf("size pointer=%u\n",(int)sizeof(void*));
+
+printf("#define dsWSize (%3u)(%%rdi)\n",(int)(((char*)&(s->w_size))-((char*)s)));
+printf("#define dsWMask (%3u)(%%rdi)\n",(int)(((char*)&(s->w_mask))-((char*)s)));
+printf("#define dsWindow (%3u)(%%rdi)\n",(int)(((char*)&(s->window))-((char*)s)));
+printf("#define dsPrev (%3u)(%%rdi)\n",(int)(((char*)&(s->prev))-((char*)s)));
+printf("#define dsMatchLen (%3u)(%%rdi)\n",(int)(((char*)&(s->match_length))-((char*)s)));
+printf("#define dsPrevMatch (%3u)(%%rdi)\n",(int)(((char*)&(s->prev_match))-((char*)s)));
+printf("#define dsStrStart (%3u)(%%rdi)\n",(int)(((char*)&(s->strstart))-((char*)s)));
+printf("#define dsMatchStart (%3u)(%%rdi)\n",(int)(((char*)&(s->match_start))-((char*)s)));
+printf("#define dsLookahead (%3u)(%%rdi)\n",(int)(((char*)&(s->lookahead))-((char*)s)));
+printf("#define dsPrevLen (%3u)(%%rdi)\n",(int)(((char*)&(s->prev_length))-((char*)s)));
+printf("#define dsMaxChainLen (%3u)(%%rdi)\n",(int)(((char*)&(s->max_chain_length))-((char*)s)));
+printf("#define dsGoodMatch (%3u)(%%rdi)\n",(int)(((char*)&(s->good_match))-((char*)s)));
+printf("#define dsNiceMatch (%3u)(%%rdi)\n",(int)(((char*)&(s->nice_match))-((char*)s)));
+}
+
+*/
+
+
+/*
+ to compile for XCode 3.2 on MacOSX x86_64
+ - run "gcc -g -c -DXCODE_MAC_X64_STRUCTURE amd64-match.S"
+ */
+
+
+#ifndef CURRENT_LINX_XCODE_MAC_X64_STRUCTURE
+#define dsWSize ( 68)(%rdi)
+#define dsWMask ( 76)(%rdi)
+#define dsWindow ( 80)(%rdi)
+#define dsPrev ( 96)(%rdi)
+#define dsMatchLen (144)(%rdi)
+#define dsPrevMatch (148)(%rdi)
+#define dsStrStart (156)(%rdi)
+#define dsMatchStart (160)(%rdi)
+#define dsLookahead (164)(%rdi)
+#define dsPrevLen (168)(%rdi)
+#define dsMaxChainLen (172)(%rdi)
+#define dsGoodMatch (188)(%rdi)
+#define dsNiceMatch (192)(%rdi)
+
+#else
+
+#ifndef STRUCT_OFFSET
+# define STRUCT_OFFSET (0)
+#endif
+
+
+#define dsWSize ( 56 + STRUCT_OFFSET)(%rdi)
+#define dsWMask ( 64 + STRUCT_OFFSET)(%rdi)
+#define dsWindow ( 72 + STRUCT_OFFSET)(%rdi)
+#define dsPrev ( 88 + STRUCT_OFFSET)(%rdi)
+#define dsMatchLen (136 + STRUCT_OFFSET)(%rdi)
+#define dsPrevMatch (140 + STRUCT_OFFSET)(%rdi)
+#define dsStrStart (148 + STRUCT_OFFSET)(%rdi)
+#define dsMatchStart (152 + STRUCT_OFFSET)(%rdi)
+#define dsLookahead (156 + STRUCT_OFFSET)(%rdi)
+#define dsPrevLen (160 + STRUCT_OFFSET)(%rdi)
+#define dsMaxChainLen (164 + STRUCT_OFFSET)(%rdi)
+#define dsGoodMatch (180 + STRUCT_OFFSET)(%rdi)
+#define dsNiceMatch (184 + STRUCT_OFFSET)(%rdi)
+
+#endif
+
+
+
+
+.text
+
+/* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */
+
+longest_match:
+/*
+ * Retrieve the function arguments. %curmatch will hold cur_match
+ * throughout the entire function (passed via rsi on amd64).
+ * rdi will hold the pointer to the deflate_state (first arg on amd64)
+ */
+ mov %rsi, save_rsi
+ mov %rbx, save_rbx
+ mov %r12, save_r12
+ mov %r13, save_r13
+ mov %r14, save_r14
+ mov %r15, save_r15
+
+/* uInt wmask = s->w_mask; */
+/* unsigned chain_length = s->max_chain_length; */
+/* if (s->prev_length >= s->good_match) { */
+/* chain_length >>= 2; */
+/* } */
+
+ movl dsPrevLen, %eax
+ movl dsGoodMatch, %ebx
+ cmpl %ebx, %eax
+ movl dsWMask, %eax
+ movl dsMaxChainLen, %chainlenwmask
+ jl LastMatchGood
+ shrl $2, %chainlenwmask
+LastMatchGood:
+
+/* chainlen is decremented once beforehand so that the function can */
+/* use the sign flag instead of the zero flag for the exit test. */
+/* It is then shifted into the high word, to make room for the wmask */
+/* value, which it will always accompany. */
+
+ decl %chainlenwmask
+ shll $16, %chainlenwmask
+ orl %eax, %chainlenwmask
+
+/* if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; */
+
+ movl dsNiceMatch, %eax
+ movl dsLookahead, %ebx
+ cmpl %eax, %ebx
+ jl LookaheadLess
+ movl %eax, %ebx
+LookaheadLess: movl %ebx, %nicematch
+
+/* register Bytef *scan = s->window + s->strstart; */
+
+ mov dsWindow, %window
+ movl dsStrStart, %limitd
+ lea (%limit, %window), %scan
+
+/* Determine how many bytes the scan ptr is off from being */
+/* dword-aligned. */
+
+ mov %scan, %scanalign
+ negl %scanalignd
+ andl $3, %scanalignd
+
+/* IPos limit = s->strstart > (IPos)MAX_DIST(s) ? */
+/* s->strstart - (IPos)MAX_DIST(s) : NIL; */
+
+ movl dsWSize, %eax
+ subl $MIN_LOOKAHEAD, %eax
+ xorl %ecx, %ecx
+ subl %eax, %limitd
+ cmovng %ecx, %limitd
+
+/* int best_len = s->prev_length; */
+
+ movl dsPrevLen, %bestlend
+
+/* Store the sum of s->window + best_len in %windowbestlen locally, and in memory. */
+
+ lea (%window, %bestlen), %windowbestlen
+ mov %windowbestlen, _windowbestlen
+
+/* register ush scan_start = *(ushf*)scan; */
+/* register ush scan_end = *(ushf*)(scan+best_len-1); */
+/* Posf *prev = s->prev; */
+
+ movzwl (%scan), %scanstart
+ movzwl -1(%scan, %bestlen), %scanend
+ mov dsPrev, %prev
+
+/* Jump into the main loop. */
+
+ movl %chainlenwmask, _chainlenwmask
+ jmp LoopEntry
+
+.balign 16
+
+/* do {
+ * match = s->window + cur_match;
+ * if (*(ushf*)(match+best_len-1) != scan_end ||
+ * *(ushf*)match != scan_start) continue;
+ * [...]
+ * } while ((cur_match = prev[cur_match & wmask]) > limit
+ * && --chain_length != 0);
+ *
+ * Here is the inner loop of the function. The function will spend the
+ * majority of its time in this loop, and majority of that time will
+ * be spent in the first ten instructions.
+ */
+LookupLoop:
+ andl %chainlenwmask, %curmatchd
+ movzwl (%prev, %curmatch, 2), %curmatchd
+ cmpl %limitd, %curmatchd
+ jbe LeaveNow
+ subl $0x00010000, %chainlenwmask
+ js LeaveNow
+LoopEntry: cmpw -1(%windowbestlen, %curmatch), %scanendw
+ jne LookupLoop
+ cmpw %scanstartw, (%window, %curmatch)
+ jne LookupLoop
+
+/* Store the current value of chainlen. */
+ movl %chainlenwmask, _chainlenwmask
+
+/* %scan is the string under scrutiny, and %prev to the string we */
+/* are hoping to match it up with. In actuality, %esi and %edi are */
+/* both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and %edx is */
+/* initialized to -(MAX_MATCH_8 - scanalign). */
+
+ mov $(-MAX_MATCH_8), %rdx
+ lea (%curmatch, %window), %windowbestlen
+ lea MAX_MATCH_8(%windowbestlen, %scanalign), %windowbestlen
+ lea MAX_MATCH_8(%scan, %scanalign), %prev
+
+/* the prefetching below makes very little difference... */
+ prefetcht1 (%windowbestlen, %rdx)
+ prefetcht1 (%prev, %rdx)
+
+/*
+ * Test the strings for equality, 8 bytes at a time. At the end,
+ * adjust %rdx so that it is offset to the exact byte that mismatched.
+ *
+ * It should be confessed that this loop usually does not represent
+ * much of the total running time. Replacing it with a more
+ * straightforward "rep cmpsb" would not drastically degrade
+ * performance -- unrolling it, for example, makes no difference.
+ */
+
+#undef USE_SSE /* works, but is 6-7% slower, than non-SSE... */
+
+LoopCmps:
+#ifdef USE_SSE
+ /* Preload the SSE registers */
+ movdqu (%windowbestlen, %rdx), %xmm1
+ movdqu (%prev, %rdx), %xmm2
+ pcmpeqb %xmm2, %xmm1
+ movdqu 16(%windowbestlen, %rdx), %xmm3
+ movdqu 16(%prev, %rdx), %xmm4
+ pcmpeqb %xmm4, %xmm3
+ movdqu 32(%windowbestlen, %rdx), %xmm5
+ movdqu 32(%prev, %rdx), %xmm6
+ pcmpeqb %xmm6, %xmm5
+ movdqu 48(%windowbestlen, %rdx), %xmm7
+ movdqu 48(%prev, %rdx), %xmm8
+ pcmpeqb %xmm8, %xmm7
+
+ /* Check the comparisions' results */
+ pmovmskb %xmm1, %rax
+ notw %ax
+ bsfw %ax, %ax
+ jnz LeaveLoopCmps
+
+ /* this is the only iteration of the loop with a possibility of having
+ incremented rdx by 0x108 (each loop iteration add 16*4 = 0x40
+ and (0x40*4)+8=0x108 */
+ add $8, %rdx
+ jz LenMaximum
+ add $8, %rdx
+
+
+ pmovmskb %xmm3, %rax
+ notw %ax
+ bsfw %ax, %ax
+ jnz LeaveLoopCmps
+
+
+ add $16, %rdx
+
+
+ pmovmskb %xmm5, %rax
+ notw %ax
+ bsfw %ax, %ax
+ jnz LeaveLoopCmps
+
+ add $16, %rdx
+
+
+ pmovmskb %xmm7, %rax
+ notw %ax
+ bsfw %ax, %ax
+ jnz LeaveLoopCmps
+
+ add $16, %rdx
+
+ jmp LoopCmps
+LeaveLoopCmps: add %rax, %rdx
+#else
+ mov (%windowbestlen, %rdx), %rax
+ xor (%prev, %rdx), %rax
+ jnz LeaveLoopCmps
+
+ mov 8(%windowbestlen, %rdx), %rax
+ xor 8(%prev, %rdx), %rax
+ jnz LeaveLoopCmps8
+
+ mov 16(%windowbestlen, %rdx), %rax
+ xor 16(%prev, %rdx), %rax
+ jnz LeaveLoopCmps16
+
+ add $24, %rdx
+ jnz LoopCmps
+ jmp LenMaximum
+# if 0
+/*
+ * This three-liner is tantalizingly simple, but bsf is a slow instruction,
+ * and the complicated alternative down below is quite a bit faster. Sad...
+ */
+
+LeaveLoopCmps: bsf %rax, %rax /* find the first non-zero bit */
+ shrl $3, %eax /* divide by 8 to get the byte */
+ add %rax, %rdx
+# else
+LeaveLoopCmps16:
+ add $8, %rdx
+LeaveLoopCmps8:
+ add $8, %rdx
+LeaveLoopCmps: testl $0xFFFFFFFF, %eax /* Check the first 4 bytes */
+ jnz Check16
+ add $4, %rdx
+ shr $32, %rax
+Check16: testw $0xFFFF, %ax
+ jnz LenLower
+ add $2, %rdx
+ shrl $16, %eax
+LenLower: subb $1, %al
+ adc $0, %rdx
+# endif
+#endif
+
+/* Calculate the length of the match. If it is longer than MAX_MATCH, */
+/* then automatically accept it as the best possible match and leave. */
+
+ lea (%prev, %rdx), %rax
+ sub %scan, %rax
+ cmpl $MAX_MATCH, %eax
+ jge LenMaximum
+
+/* If the length of the match is not longer than the best match we */
+/* have so far, then forget it and return to the lookup loop. */
+
+ cmpl %bestlend, %eax
+ jg LongerMatch
+ mov _windowbestlen, %windowbestlen
+ mov dsPrev, %prev
+ movl _chainlenwmask, %edx
+ jmp LookupLoop
+
+/* s->match_start = cur_match; */
+/* best_len = len; */
+/* if (len >= nice_match) break; */
+/* scan_end = *(ushf*)(scan+best_len-1); */
+
+LongerMatch:
+ movl %eax, %bestlend
+ movl %curmatchd, dsMatchStart
+ cmpl %nicematch, %eax
+ jge LeaveNow
+
+ lea (%window, %bestlen), %windowbestlen
+ mov %windowbestlen, _windowbestlen
+
+ movzwl -1(%scan, %rax), %scanend
+ mov dsPrev, %prev
+ movl _chainlenwmask, %chainlenwmask
+ jmp LookupLoop
+
+/* Accept the current string, with the maximum possible length. */
+
+LenMaximum:
+ movl $MAX_MATCH, %bestlend
+ movl %curmatchd, dsMatchStart
+
+/* if ((uInt)best_len <= s->lookahead) return (uInt)best_len; */
+/* return s->lookahead; */
+
+LeaveNow:
+ movl dsLookahead, %eax
+ cmpl %eax, %bestlend
+ cmovngl %bestlend, %eax
+LookaheadRet:
+
+/* Restore the registers and return from whence we came. */
+
+ mov save_rsi, %rsi
+ mov save_rbx, %rbx
+ mov save_r12, %r12
+ mov save_r13, %r13
+ mov save_r14, %r14
+ mov save_r15, %r15
+
+ ret
+
+match_init: ret
diff --git a/protocols/Telegram/tgl/zlib/contrib/asm686/README.686 b/protocols/Telegram/tgl/zlib/contrib/asm686/README.686
new file mode 100644
index 0000000000..a0bf3bea4a
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/asm686/README.686
@@ -0,0 +1,51 @@
+This is a patched version of zlib, modified to use
+Pentium-Pro-optimized assembly code in the deflation algorithm. The
+files changed/added by this patch are:
+
+README.686
+match.S
+
+The speedup that this patch provides varies, depending on whether the
+compiler used to build the original version of zlib falls afoul of the
+PPro's speed traps. My own tests show a speedup of around 10-20% at
+the default compression level, and 20-30% using -9, against a version
+compiled using gcc 2.7.2.3. Your mileage may vary.
+
+Note that this code has been tailored for the PPro/PII in particular,
+and will not perform particuarly well on a Pentium.
+
+If you are using an assembler other than GNU as, you will have to
+translate match.S to use your assembler's syntax. (Have fun.)
+
+Brian Raiter
+breadbox@muppetlabs.com
+April, 1998
+
+
+Added for zlib 1.1.3:
+
+The patches come from
+http://www.muppetlabs.com/~breadbox/software/assembly.html
+
+To compile zlib with this asm file, copy match.S to the zlib directory
+then do:
+
+CFLAGS="-O3 -DASMV" ./configure
+make OBJA=match.o
+
+
+Update:
+
+I've been ignoring these assembly routines for years, believing that
+gcc's generated code had caught up with it sometime around gcc 2.95
+and the major rearchitecting of the Pentium 4. However, I recently
+learned that, despite what I believed, this code still has some life
+in it. On the Pentium 4 and AMD64 chips, it continues to run about 8%
+faster than the code produced by gcc 4.1.
+
+In acknowledgement of its continuing usefulness, I've altered the
+license to match that of the rest of zlib. Share and Enjoy!
+
+Brian Raiter
+breadbox@muppetlabs.com
+April, 2007
diff --git a/protocols/Telegram/tgl/zlib/contrib/asm686/match.S b/protocols/Telegram/tgl/zlib/contrib/asm686/match.S
new file mode 100644
index 0000000000..fa42109278
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/asm686/match.S
@@ -0,0 +1,357 @@
+/* match.S -- x86 assembly version of the zlib longest_match() function.
+ * Optimized for the Intel 686 chips (PPro and later).
+ *
+ * Copyright (C) 1998, 2007 Brian Raiter <breadbox@muppetlabs.com>
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the author be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ */
+
+#ifndef NO_UNDERLINE
+#define match_init _match_init
+#define longest_match _longest_match
+#endif
+
+#define MAX_MATCH (258)
+#define MIN_MATCH (3)
+#define MIN_LOOKAHEAD (MAX_MATCH + MIN_MATCH + 1)
+#define MAX_MATCH_8 ((MAX_MATCH + 7) & ~7)
+
+/* stack frame offsets */
+
+#define chainlenwmask 0 /* high word: current chain len */
+ /* low word: s->wmask */
+#define window 4 /* local copy of s->window */
+#define windowbestlen 8 /* s->window + bestlen */
+#define scanstart 16 /* first two bytes of string */
+#define scanend 12 /* last two bytes of string */
+#define scanalign 20 /* dword-misalignment of string */
+#define nicematch 24 /* a good enough match size */
+#define bestlen 28 /* size of best match so far */
+#define scan 32 /* ptr to string wanting match */
+
+#define LocalVarsSize (36)
+/* saved ebx 36 */
+/* saved edi 40 */
+/* saved esi 44 */
+/* saved ebp 48 */
+/* return address 52 */
+#define deflatestate 56 /* the function arguments */
+#define curmatch 60
+
+/* All the +zlib1222add offsets are due to the addition of fields
+ * in zlib in the deflate_state structure since the asm code was first written
+ * (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)").
+ * (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0").
+ * if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8").
+ */
+
+#define zlib1222add (8)
+
+#define dsWSize (36+zlib1222add)
+#define dsWMask (44+zlib1222add)
+#define dsWindow (48+zlib1222add)
+#define dsPrev (56+zlib1222add)
+#define dsMatchLen (88+zlib1222add)
+#define dsPrevMatch (92+zlib1222add)
+#define dsStrStart (100+zlib1222add)
+#define dsMatchStart (104+zlib1222add)
+#define dsLookahead (108+zlib1222add)
+#define dsPrevLen (112+zlib1222add)
+#define dsMaxChainLen (116+zlib1222add)
+#define dsGoodMatch (132+zlib1222add)
+#define dsNiceMatch (136+zlib1222add)
+
+
+.file "match.S"
+
+.globl match_init, longest_match
+
+.text
+
+/* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */
+.cfi_sections .debug_frame
+
+longest_match:
+
+.cfi_startproc
+/* Save registers that the compiler may be using, and adjust %esp to */
+/* make room for our stack frame. */
+
+ pushl %ebp
+ .cfi_def_cfa_offset 8
+ .cfi_offset ebp, -8
+ pushl %edi
+ .cfi_def_cfa_offset 12
+ pushl %esi
+ .cfi_def_cfa_offset 16
+ pushl %ebx
+ .cfi_def_cfa_offset 20
+ subl $LocalVarsSize, %esp
+ .cfi_def_cfa_offset LocalVarsSize+20
+
+/* Retrieve the function arguments. %ecx will hold cur_match */
+/* throughout the entire function. %edx will hold the pointer to the */
+/* deflate_state structure during the function's setup (before */
+/* entering the main loop). */
+
+ movl deflatestate(%esp), %edx
+ movl curmatch(%esp), %ecx
+
+/* uInt wmask = s->w_mask; */
+/* unsigned chain_length = s->max_chain_length; */
+/* if (s->prev_length >= s->good_match) { */
+/* chain_length >>= 2; */
+/* } */
+
+ movl dsPrevLen(%edx), %eax
+ movl dsGoodMatch(%edx), %ebx
+ cmpl %ebx, %eax
+ movl dsWMask(%edx), %eax
+ movl dsMaxChainLen(%edx), %ebx
+ jl LastMatchGood
+ shrl $2, %ebx
+LastMatchGood:
+
+/* chainlen is decremented once beforehand so that the function can */
+/* use the sign flag instead of the zero flag for the exit test. */
+/* It is then shifted into the high word, to make room for the wmask */
+/* value, which it will always accompany. */
+
+ decl %ebx
+ shll $16, %ebx
+ orl %eax, %ebx
+ movl %ebx, chainlenwmask(%esp)
+
+/* if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; */
+
+ movl dsNiceMatch(%edx), %eax
+ movl dsLookahead(%edx), %ebx
+ cmpl %eax, %ebx
+ jl LookaheadLess
+ movl %eax, %ebx
+LookaheadLess: movl %ebx, nicematch(%esp)
+
+/* register Bytef *scan = s->window + s->strstart; */
+
+ movl dsWindow(%edx), %esi
+ movl %esi, window(%esp)
+ movl dsStrStart(%edx), %ebp
+ lea (%esi,%ebp), %edi
+ movl %edi, scan(%esp)
+
+/* Determine how many bytes the scan ptr is off from being */
+/* dword-aligned. */
+
+ movl %edi, %eax
+ negl %eax
+ andl $3, %eax
+ movl %eax, scanalign(%esp)
+
+/* IPos limit = s->strstart > (IPos)MAX_DIST(s) ? */
+/* s->strstart - (IPos)MAX_DIST(s) : NIL; */
+
+ movl dsWSize(%edx), %eax
+ subl $MIN_LOOKAHEAD, %eax
+ subl %eax, %ebp
+ jg LimitPositive
+ xorl %ebp, %ebp
+LimitPositive:
+
+/* int best_len = s->prev_length; */
+
+ movl dsPrevLen(%edx), %eax
+ movl %eax, bestlen(%esp)
+
+/* Store the sum of s->window + best_len in %esi locally, and in %esi. */
+
+ addl %eax, %esi
+ movl %esi, windowbestlen(%esp)
+
+/* register ush scan_start = *(ushf*)scan; */
+/* register ush scan_end = *(ushf*)(scan+best_len-1); */
+/* Posf *prev = s->prev; */
+
+ movzwl (%edi), %ebx
+ movl %ebx, scanstart(%esp)
+ movzwl -1(%edi,%eax), %ebx
+ movl %ebx, scanend(%esp)
+ movl dsPrev(%edx), %edi
+
+/* Jump into the main loop. */
+
+ movl chainlenwmask(%esp), %edx
+ jmp LoopEntry
+
+.balign 16
+
+/* do {
+ * match = s->window + cur_match;
+ * if (*(ushf*)(match+best_len-1) != scan_end ||
+ * *(ushf*)match != scan_start) continue;
+ * [...]
+ * } while ((cur_match = prev[cur_match & wmask]) > limit
+ * && --chain_length != 0);
+ *
+ * Here is the inner loop of the function. The function will spend the
+ * majority of its time in this loop, and majority of that time will
+ * be spent in the first ten instructions.
+ *
+ * Within this loop:
+ * %ebx = scanend
+ * %ecx = curmatch
+ * %edx = chainlenwmask - i.e., ((chainlen << 16) | wmask)
+ * %esi = windowbestlen - i.e., (window + bestlen)
+ * %edi = prev
+ * %ebp = limit
+ */
+LookupLoop:
+ andl %edx, %ecx
+ movzwl (%edi,%ecx,2), %ecx
+ cmpl %ebp, %ecx
+ jbe LeaveNow
+ subl $0x00010000, %edx
+ js LeaveNow
+LoopEntry: movzwl -1(%esi,%ecx), %eax
+ cmpl %ebx, %eax
+ jnz LookupLoop
+ movl window(%esp), %eax
+ movzwl (%eax,%ecx), %eax
+ cmpl scanstart(%esp), %eax
+ jnz LookupLoop
+
+/* Store the current value of chainlen. */
+
+ movl %edx, chainlenwmask(%esp)
+
+/* Point %edi to the string under scrutiny, and %esi to the string we */
+/* are hoping to match it up with. In actuality, %esi and %edi are */
+/* both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and %edx is */
+/* initialized to -(MAX_MATCH_8 - scanalign). */
+
+ movl window(%esp), %esi
+ movl scan(%esp), %edi
+ addl %ecx, %esi
+ movl scanalign(%esp), %eax
+ movl $(-MAX_MATCH_8), %edx
+ lea MAX_MATCH_8(%edi,%eax), %edi
+ lea MAX_MATCH_8(%esi,%eax), %esi
+
+/* Test the strings for equality, 8 bytes at a time. At the end,
+ * adjust %edx so that it is offset to the exact byte that mismatched.
+ *
+ * We already know at this point that the first three bytes of the
+ * strings match each other, and they can be safely passed over before
+ * starting the compare loop. So what this code does is skip over 0-3
+ * bytes, as much as necessary in order to dword-align the %edi
+ * pointer. (%esi will still be misaligned three times out of four.)
+ *
+ * It should be confessed that this loop usually does not represent
+ * much of the total running time. Replacing it with a more
+ * straightforward "rep cmpsb" would not drastically degrade
+ * performance.
+ */
+LoopCmps:
+ movl (%esi,%edx), %eax
+ xorl (%edi,%edx), %eax
+ jnz LeaveLoopCmps
+ movl 4(%esi,%edx), %eax
+ xorl 4(%edi,%edx), %eax
+ jnz LeaveLoopCmps4
+ addl $8, %edx
+ jnz LoopCmps
+ jmp LenMaximum
+LeaveLoopCmps4: addl $4, %edx
+LeaveLoopCmps: testl $0x0000FFFF, %eax
+ jnz LenLower
+ addl $2, %edx
+ shrl $16, %eax
+LenLower: subb $1, %al
+ adcl $0, %edx
+
+/* Calculate the length of the match. If it is longer than MAX_MATCH, */
+/* then automatically accept it as the best possible match and leave. */
+
+ lea (%edi,%edx), %eax
+ movl scan(%esp), %edi
+ subl %edi, %eax
+ cmpl $MAX_MATCH, %eax
+ jge LenMaximum
+
+/* If the length of the match is not longer than the best match we */
+/* have so far, then forget it and return to the lookup loop. */
+
+ movl deflatestate(%esp), %edx
+ movl bestlen(%esp), %ebx
+ cmpl %ebx, %eax
+ jg LongerMatch
+ movl windowbestlen(%esp), %esi
+ movl dsPrev(%edx), %edi
+ movl scanend(%esp), %ebx
+ movl chainlenwmask(%esp), %edx
+ jmp LookupLoop
+
+/* s->match_start = cur_match; */
+/* best_len = len; */
+/* if (len >= nice_match) break; */
+/* scan_end = *(ushf*)(scan+best_len-1); */
+
+LongerMatch: movl nicematch(%esp), %ebx
+ movl %eax, bestlen(%esp)
+ movl %ecx, dsMatchStart(%edx)
+ cmpl %ebx, %eax
+ jge LeaveNow
+ movl window(%esp), %esi
+ addl %eax, %esi
+ movl %esi, windowbestlen(%esp)
+ movzwl -1(%edi,%eax), %ebx
+ movl dsPrev(%edx), %edi
+ movl %ebx, scanend(%esp)
+ movl chainlenwmask(%esp), %edx
+ jmp LookupLoop
+
+/* Accept the current string, with the maximum possible length. */
+
+LenMaximum: movl deflatestate(%esp), %edx
+ movl $MAX_MATCH, bestlen(%esp)
+ movl %ecx, dsMatchStart(%edx)
+
+/* if ((uInt)best_len <= s->lookahead) return (uInt)best_len; */
+/* return s->lookahead; */
+
+LeaveNow:
+ movl deflatestate(%esp), %edx
+ movl bestlen(%esp), %ebx
+ movl dsLookahead(%edx), %eax
+ cmpl %eax, %ebx
+ jg LookaheadRet
+ movl %ebx, %eax
+LookaheadRet:
+
+/* Restore the stack and return from whence we came. */
+
+ addl $LocalVarsSize, %esp
+ .cfi_def_cfa_offset 20
+ popl %ebx
+ .cfi_def_cfa_offset 16
+ popl %esi
+ .cfi_def_cfa_offset 12
+ popl %edi
+ .cfi_def_cfa_offset 8
+ popl %ebp
+ .cfi_def_cfa_offset 4
+.cfi_endproc
+match_init: ret
diff --git a/protocols/Telegram/tgl/zlib/contrib/blast/Makefile b/protocols/Telegram/tgl/zlib/contrib/blast/Makefile
new file mode 100644
index 0000000000..9be80bafe0
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/blast/Makefile
@@ -0,0 +1,8 @@
+blast: blast.c blast.h
+ cc -DTEST -o blast blast.c
+
+test: blast
+ blast < test.pk | cmp - test.txt
+
+clean:
+ rm -f blast blast.o
diff --git a/protocols/Telegram/tgl/zlib/contrib/blast/README b/protocols/Telegram/tgl/zlib/contrib/blast/README
new file mode 100644
index 0000000000..e3a60b3f5c
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/blast/README
@@ -0,0 +1,4 @@
+Read blast.h for purpose and usage.
+
+Mark Adler
+madler@alumni.caltech.edu
diff --git a/protocols/Telegram/tgl/zlib/contrib/blast/blast.c b/protocols/Telegram/tgl/zlib/contrib/blast/blast.c
new file mode 100644
index 0000000000..69ef0fe00e
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/blast/blast.c
@@ -0,0 +1,446 @@
+/* blast.c
+ * Copyright (C) 2003, 2012 Mark Adler
+ * For conditions of distribution and use, see copyright notice in blast.h
+ * version 1.2, 24 Oct 2012
+ *
+ * blast.c decompresses data compressed by the PKWare Compression Library.
+ * This function provides functionality similar to the explode() function of
+ * the PKWare library, hence the name "blast".
+ *
+ * This decompressor is based on the excellent format description provided by
+ * Ben Rudiak-Gould in comp.compression on August 13, 2001. Interestingly, the
+ * example Ben provided in the post is incorrect. The distance 110001 should
+ * instead be 111000. When corrected, the example byte stream becomes:
+ *
+ * 00 04 82 24 25 8f 80 7f
+ *
+ * which decompresses to "AIAIAIAIAIAIA" (without the quotes).
+ */
+
+/*
+ * Change history:
+ *
+ * 1.0 12 Feb 2003 - First version
+ * 1.1 16 Feb 2003 - Fixed distance check for > 4 GB uncompressed data
+ * 1.2 24 Oct 2012 - Add note about using binary mode in stdio
+ * - Fix comparisons of differently signed integers
+ */
+
+#include <setjmp.h> /* for setjmp(), longjmp(), and jmp_buf */
+#include "blast.h" /* prototype for blast() */
+
+#define local static /* for local function definitions */
+#define MAXBITS 13 /* maximum code length */
+#define MAXWIN 4096 /* maximum window size */
+
+/* input and output state */
+struct state {
+ /* input state */
+ blast_in infun; /* input function provided by user */
+ void *inhow; /* opaque information passed to infun() */
+ unsigned char *in; /* next input location */
+ unsigned left; /* available input at in */
+ int bitbuf; /* bit buffer */
+ int bitcnt; /* number of bits in bit buffer */
+
+ /* input limit error return state for bits() and decode() */
+ jmp_buf env;
+
+ /* output state */
+ blast_out outfun; /* output function provided by user */
+ void *outhow; /* opaque information passed to outfun() */
+ unsigned next; /* index of next write location in out[] */
+ int first; /* true to check distances (for first 4K) */
+ unsigned char out[MAXWIN]; /* output buffer and sliding window */
+};
+
+/*
+ * Return need bits from the input stream. This always leaves less than
+ * eight bits in the buffer. bits() works properly for need == 0.
+ *
+ * Format notes:
+ *
+ * - Bits are stored in bytes from the least significant bit to the most
+ * significant bit. Therefore bits are dropped from the bottom of the bit
+ * buffer, using shift right, and new bytes are appended to the top of the
+ * bit buffer, using shift left.
+ */
+local int bits(struct state *s, int need)
+{
+ int val; /* bit accumulator */
+
+ /* load at least need bits into val */
+ val = s->bitbuf;
+ while (s->bitcnt < need) {
+ if (s->left == 0) {
+ s->left = s->infun(s->inhow, &(s->in));
+ if (s->left == 0) longjmp(s->env, 1); /* out of input */
+ }
+ val |= (int)(*(s->in)++) << s->bitcnt; /* load eight bits */
+ s->left--;
+ s->bitcnt += 8;
+ }
+
+ /* drop need bits and update buffer, always zero to seven bits left */
+ s->bitbuf = val >> need;
+ s->bitcnt -= need;
+
+ /* return need bits, zeroing the bits above that */
+ return val & ((1 << need) - 1);
+}
+
+/*
+ * Huffman code decoding tables. count[1..MAXBITS] is the number of symbols of
+ * each length, which for a canonical code are stepped through in order.
+ * symbol[] are the symbol values in canonical order, where the number of
+ * entries is the sum of the counts in count[]. The decoding process can be
+ * seen in the function decode() below.
+ */
+struct huffman {
+ short *count; /* number of symbols of each length */
+ short *symbol; /* canonically ordered symbols */
+};
+
+/*
+ * Decode a code from the stream s using huffman table h. Return the symbol or
+ * a negative value if there is an error. If all of the lengths are zero, i.e.
+ * an empty code, or if the code is incomplete and an invalid code is received,
+ * then -9 is returned after reading MAXBITS bits.
+ *
+ * Format notes:
+ *
+ * - The codes as stored in the compressed data are bit-reversed relative to
+ * a simple integer ordering of codes of the same lengths. Hence below the
+ * bits are pulled from the compressed data one at a time and used to
+ * build the code value reversed from what is in the stream in order to
+ * permit simple integer comparisons for decoding.
+ *
+ * - The first code for the shortest length is all ones. Subsequent codes of
+ * the same length are simply integer decrements of the previous code. When
+ * moving up a length, a one bit is appended to the code. For a complete
+ * code, the last code of the longest length will be all zeros. To support
+ * this ordering, the bits pulled during decoding are inverted to apply the
+ * more "natural" ordering starting with all zeros and incrementing.
+ */
+local int decode(struct state *s, struct huffman *h)
+{
+ int len; /* current number of bits in code */
+ int code; /* len bits being decoded */
+ int first; /* first code of length len */
+ int count; /* number of codes of length len */
+ int index; /* index of first code of length len in symbol table */
+ int bitbuf; /* bits from stream */
+ int left; /* bits left in next or left to process */
+ short *next; /* next number of codes */
+
+ bitbuf = s->bitbuf;
+ left = s->bitcnt;
+ code = first = index = 0;
+ len = 1;
+ next = h->count + 1;
+ while (1) {
+ while (left--) {
+ code |= (bitbuf & 1) ^ 1; /* invert code */
+ bitbuf >>= 1;
+ count = *next++;
+ if (code < first + count) { /* if length len, return symbol */
+ s->bitbuf = bitbuf;
+ s->bitcnt = (s->bitcnt - len) & 7;
+ return h->symbol[index + (code - first)];
+ }
+ index += count; /* else update for next length */
+ first += count;
+ first <<= 1;
+ code <<= 1;
+ len++;
+ }
+ left = (MAXBITS+1) - len;
+ if (left == 0) break;
+ if (s->left == 0) {
+ s->left = s->infun(s->inhow, &(s->in));
+ if (s->left == 0) longjmp(s->env, 1); /* out of input */
+ }
+ bitbuf = *(s->in)++;
+ s->left--;
+ if (left > 8) left = 8;
+ }
+ return -9; /* ran out of codes */
+}
+
+/*
+ * Given a list of repeated code lengths rep[0..n-1], where each byte is a
+ * count (high four bits + 1) and a code length (low four bits), generate the
+ * list of code lengths. This compaction reduces the size of the object code.
+ * Then given the list of code lengths length[0..n-1] representing a canonical
+ * Huffman code for n symbols, construct the tables required to decode those
+ * codes. Those tables are the number of codes of each length, and the symbols
+ * sorted by length, retaining their original order within each length. The
+ * return value is zero for a complete code set, negative for an over-
+ * subscribed code set, and positive for an incomplete code set. The tables
+ * can be used if the return value is zero or positive, but they cannot be used
+ * if the return value is negative. If the return value is zero, it is not
+ * possible for decode() using that table to return an error--any stream of
+ * enough bits will resolve to a symbol. If the return value is positive, then
+ * it is possible for decode() using that table to return an error for received
+ * codes past the end of the incomplete lengths.
+ */
+local int construct(struct huffman *h, const unsigned char *rep, int n)
+{
+ int symbol; /* current symbol when stepping through length[] */
+ int len; /* current length when stepping through h->count[] */
+ int left; /* number of possible codes left of current length */
+ short offs[MAXBITS+1]; /* offsets in symbol table for each length */
+ short length[256]; /* code lengths */
+
+ /* convert compact repeat counts into symbol bit length list */
+ symbol = 0;
+ do {
+ len = *rep++;
+ left = (len >> 4) + 1;
+ len &= 15;
+ do {
+ length[symbol++] = len;
+ } while (--left);
+ } while (--n);
+ n = symbol;
+
+ /* count number of codes of each length */
+ for (len = 0; len <= MAXBITS; len++)
+ h->count[len] = 0;
+ for (symbol = 0; symbol < n; symbol++)
+ (h->count[length[symbol]])++; /* assumes lengths are within bounds */
+ if (h->count[0] == n) /* no codes! */
+ return 0; /* complete, but decode() will fail */
+
+ /* check for an over-subscribed or incomplete set of lengths */
+ left = 1; /* one possible code of zero length */
+ for (len = 1; len <= MAXBITS; len++) {
+ left <<= 1; /* one more bit, double codes left */
+ left -= h->count[len]; /* deduct count from possible codes */
+ if (left < 0) return left; /* over-subscribed--return negative */
+ } /* left > 0 means incomplete */
+
+ /* generate offsets into symbol table for each length for sorting */
+ offs[1] = 0;
+ for (len = 1; len < MAXBITS; len++)
+ offs[len + 1] = offs[len] + h->count[len];
+
+ /*
+ * put symbols in table sorted by length, by symbol order within each
+ * length
+ */
+ for (symbol = 0; symbol < n; symbol++)
+ if (length[symbol] != 0)
+ h->symbol[offs[length[symbol]]++] = symbol;
+
+ /* return zero for complete set, positive for incomplete set */
+ return left;
+}
+
+/*
+ * Decode PKWare Compression Library stream.
+ *
+ * Format notes:
+ *
+ * - First byte is 0 if literals are uncoded or 1 if they are coded. Second
+ * byte is 4, 5, or 6 for the number of extra bits in the distance code.
+ * This is the base-2 logarithm of the dictionary size minus six.
+ *
+ * - Compressed data is a combination of literals and length/distance pairs
+ * terminated by an end code. Literals are either Huffman coded or
+ * uncoded bytes. A length/distance pair is a coded length followed by a
+ * coded distance to represent a string that occurs earlier in the
+ * uncompressed data that occurs again at the current location.
+ *
+ * - A bit preceding a literal or length/distance pair indicates which comes
+ * next, 0 for literals, 1 for length/distance.
+ *
+ * - If literals are uncoded, then the next eight bits are the literal, in the
+ * normal bit order in th stream, i.e. no bit-reversal is needed. Similarly,
+ * no bit reversal is needed for either the length extra bits or the distance
+ * extra bits.
+ *
+ * - Literal bytes are simply written to the output. A length/distance pair is
+ * an instruction to copy previously uncompressed bytes to the output. The
+ * copy is from distance bytes back in the output stream, copying for length
+ * bytes.
+ *
+ * - Distances pointing before the beginning of the output data are not
+ * permitted.
+ *
+ * - Overlapped copies, where the length is greater than the distance, are
+ * allowed and common. For example, a distance of one and a length of 518
+ * simply copies the last byte 518 times. A distance of four and a length of
+ * twelve copies the last four bytes three times. A simple forward copy
+ * ignoring whether the length is greater than the distance or not implements
+ * this correctly.
+ */
+local int decomp(struct state *s)
+{
+ int lit; /* true if literals are coded */
+ int dict; /* log2(dictionary size) - 6 */
+ int symbol; /* decoded symbol, extra bits for distance */
+ int len; /* length for copy */
+ unsigned dist; /* distance for copy */
+ int copy; /* copy counter */
+ unsigned char *from, *to; /* copy pointers */
+ static int virgin = 1; /* build tables once */
+ static short litcnt[MAXBITS+1], litsym[256]; /* litcode memory */
+ static short lencnt[MAXBITS+1], lensym[16]; /* lencode memory */
+ static short distcnt[MAXBITS+1], distsym[64]; /* distcode memory */
+ static struct huffman litcode = {litcnt, litsym}; /* length code */
+ static struct huffman lencode = {lencnt, lensym}; /* length code */
+ static struct huffman distcode = {distcnt, distsym};/* distance code */
+ /* bit lengths of literal codes */
+ static const unsigned char litlen[] = {
+ 11, 124, 8, 7, 28, 7, 188, 13, 76, 4, 10, 8, 12, 10, 12, 10, 8, 23, 8,
+ 9, 7, 6, 7, 8, 7, 6, 55, 8, 23, 24, 12, 11, 7, 9, 11, 12, 6, 7, 22, 5,
+ 7, 24, 6, 11, 9, 6, 7, 22, 7, 11, 38, 7, 9, 8, 25, 11, 8, 11, 9, 12,
+ 8, 12, 5, 38, 5, 38, 5, 11, 7, 5, 6, 21, 6, 10, 53, 8, 7, 24, 10, 27,
+ 44, 253, 253, 253, 252, 252, 252, 13, 12, 45, 12, 45, 12, 61, 12, 45,
+ 44, 173};
+ /* bit lengths of length codes 0..15 */
+ static const unsigned char lenlen[] = {2, 35, 36, 53, 38, 23};
+ /* bit lengths of distance codes 0..63 */
+ static const unsigned char distlen[] = {2, 20, 53, 230, 247, 151, 248};
+ static const short base[16] = { /* base for length codes */
+ 3, 2, 4, 5, 6, 7, 8, 9, 10, 12, 16, 24, 40, 72, 136, 264};
+ static const char extra[16] = { /* extra bits for length codes */
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8};
+
+ /* set up decoding tables (once--might not be thread-safe) */
+ if (virgin) {
+ construct(&litcode, litlen, sizeof(litlen));
+ construct(&lencode, lenlen, sizeof(lenlen));
+ construct(&distcode, distlen, sizeof(distlen));
+ virgin = 0;
+ }
+
+ /* read header */
+ lit = bits(s, 8);
+ if (lit > 1) return -1;
+ dict = bits(s, 8);
+ if (dict < 4 || dict > 6) return -2;
+
+ /* decode literals and length/distance pairs */
+ do {
+ if (bits(s, 1)) {
+ /* get length */
+ symbol = decode(s, &lencode);
+ len = base[symbol] + bits(s, extra[symbol]);
+ if (len == 519) break; /* end code */
+
+ /* get distance */
+ symbol = len == 2 ? 2 : dict;
+ dist = decode(s, &distcode) << symbol;
+ dist += bits(s, symbol);
+ dist++;
+ if (s->first && dist > s->next)
+ return -3; /* distance too far back */
+
+ /* copy length bytes from distance bytes back */
+ do {
+ to = s->out + s->next;
+ from = to - dist;
+ copy = MAXWIN;
+ if (s->next < dist) {
+ from += copy;
+ copy = dist;
+ }
+ copy -= s->next;
+ if (copy > len) copy = len;
+ len -= copy;
+ s->next += copy;
+ do {
+ *to++ = *from++;
+ } while (--copy);
+ if (s->next == MAXWIN) {
+ if (s->outfun(s->outhow, s->out, s->next)) return 1;
+ s->next = 0;
+ s->first = 0;
+ }
+ } while (len != 0);
+ }
+ else {
+ /* get literal and write it */
+ symbol = lit ? decode(s, &litcode) : bits(s, 8);
+ s->out[s->next++] = symbol;
+ if (s->next == MAXWIN) {
+ if (s->outfun(s->outhow, s->out, s->next)) return 1;
+ s->next = 0;
+ s->first = 0;
+ }
+ }
+ } while (1);
+ return 0;
+}
+
+/* See comments in blast.h */
+int blast(blast_in infun, void *inhow, blast_out outfun, void *outhow)
+{
+ struct state s; /* input/output state */
+ int err; /* return value */
+
+ /* initialize input state */
+ s.infun = infun;
+ s.inhow = inhow;
+ s.left = 0;
+ s.bitbuf = 0;
+ s.bitcnt = 0;
+
+ /* initialize output state */
+ s.outfun = outfun;
+ s.outhow = outhow;
+ s.next = 0;
+ s.first = 1;
+
+ /* return if bits() or decode() tries to read past available input */
+ if (setjmp(s.env) != 0) /* if came back here via longjmp(), */
+ err = 2; /* then skip decomp(), return error */
+ else
+ err = decomp(&s); /* decompress */
+
+ /* write any leftover output and update the error code if needed */
+ if (err != 1 && s.next && s.outfun(s.outhow, s.out, s.next) && err == 0)
+ err = 1;
+ return err;
+}
+
+#ifdef TEST
+/* Example of how to use blast() */
+#include <stdio.h>
+#include <stdlib.h>
+
+#define CHUNK 16384
+
+local unsigned inf(void *how, unsigned char **buf)
+{
+ static unsigned char hold[CHUNK];
+
+ *buf = hold;
+ return fread(hold, 1, CHUNK, (FILE *)how);
+}
+
+local int outf(void *how, unsigned char *buf, unsigned len)
+{
+ return fwrite(buf, 1, len, (FILE *)how) != len;
+}
+
+/* Decompress a PKWare Compression Library stream from stdin to stdout */
+int main(void)
+{
+ int ret, n;
+
+ /* decompress to stdout */
+ ret = blast(inf, stdin, outf, stdout);
+ if (ret != 0) fprintf(stderr, "blast error: %d\n", ret);
+
+ /* see if there are any leftover bytes */
+ n = 0;
+ while (getchar() != EOF) n++;
+ if (n) fprintf(stderr, "blast warning: %d unused bytes of input\n", n);
+
+ /* return blast() error code */
+ return ret;
+}
+#endif
diff --git a/protocols/Telegram/tgl/zlib/contrib/blast/blast.h b/protocols/Telegram/tgl/zlib/contrib/blast/blast.h
new file mode 100644
index 0000000000..658cfd3200
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/blast/blast.h
@@ -0,0 +1,75 @@
+/* blast.h -- interface for blast.c
+ Copyright (C) 2003, 2012 Mark Adler
+ version 1.2, 24 Oct 2012
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the author be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Mark Adler madler@alumni.caltech.edu
+ */
+
+
+/*
+ * blast() decompresses the PKWare Data Compression Library (DCL) compressed
+ * format. It provides the same functionality as the explode() function in
+ * that library. (Note: PKWare overused the "implode" verb, and the format
+ * used by their library implode() function is completely different and
+ * incompatible with the implode compression method supported by PKZIP.)
+ *
+ * The binary mode for stdio functions should be used to assure that the
+ * compressed data is not corrupted when read or written. For example:
+ * fopen(..., "rb") and fopen(..., "wb").
+ */
+
+
+typedef unsigned (*blast_in)(void *how, unsigned char **buf);
+typedef int (*blast_out)(void *how, unsigned char *buf, unsigned len);
+/* Definitions for input/output functions passed to blast(). See below for
+ * what the provided functions need to do.
+ */
+
+
+int blast(blast_in infun, void *inhow, blast_out outfun, void *outhow);
+/* Decompress input to output using the provided infun() and outfun() calls.
+ * On success, the return value of blast() is zero. If there is an error in
+ * the source data, i.e. it is not in the proper format, then a negative value
+ * is returned. If there is not enough input available or there is not enough
+ * output space, then a positive error is returned.
+ *
+ * The input function is invoked: len = infun(how, &buf), where buf is set by
+ * infun() to point to the input buffer, and infun() returns the number of
+ * available bytes there. If infun() returns zero, then blast() returns with
+ * an input error. (blast() only asks for input if it needs it.) inhow is for
+ * use by the application to pass an input descriptor to infun(), if desired.
+ *
+ * The output function is invoked: err = outfun(how, buf, len), where the bytes
+ * to be written are buf[0..len-1]. If err is not zero, then blast() returns
+ * with an output error. outfun() is always called with len <= 4096. outhow
+ * is for use by the application to pass an output descriptor to outfun(), if
+ * desired.
+ *
+ * The return codes are:
+ *
+ * 2: ran out of input before completing decompression
+ * 1: output error before completing decompression
+ * 0: successful decompression
+ * -1: literal flag not zero or one
+ * -2: dictionary size not in 4..6
+ * -3: distance is too far back
+ *
+ * At the bottom of blast.c is an example program that uses blast() that can be
+ * compiled to produce a command-line decompression filter by defining TEST.
+ */
diff --git a/protocols/Telegram/tgl/zlib/contrib/blast/test.pk b/protocols/Telegram/tgl/zlib/contrib/blast/test.pk
new file mode 100644
index 0000000000..be10b2bbb2
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/blast/test.pk
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/blast/test.txt b/protocols/Telegram/tgl/zlib/contrib/blast/test.txt
new file mode 100644
index 0000000000..bfdf1c5dca
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/blast/test.txt
@@ -0,0 +1 @@
+AIAIAIAIAIAIA \ No newline at end of file
diff --git a/protocols/Telegram/tgl/zlib/contrib/delphi/ZLib.pas b/protocols/Telegram/tgl/zlib/contrib/delphi/ZLib.pas
new file mode 100644
index 0000000000..a579974f04
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/delphi/ZLib.pas
@@ -0,0 +1,557 @@
+{*******************************************************}
+{ }
+{ Borland Delphi Supplemental Components }
+{ ZLIB Data Compression Interface Unit }
+{ }
+{ Copyright (c) 1997,99 Borland Corporation }
+{ }
+{*******************************************************}
+
+{ Updated for zlib 1.2.x by Cosmin Truta <cosmint@cs.ubbcluj.ro> }
+
+unit ZLib;
+
+interface
+
+uses SysUtils, Classes;
+
+type
+ TAlloc = function (AppData: Pointer; Items, Size: Integer): Pointer; cdecl;
+ TFree = procedure (AppData, Block: Pointer); cdecl;
+
+ // Internal structure. Ignore.
+ TZStreamRec = packed record
+ next_in: PChar; // next input byte
+ avail_in: Integer; // number of bytes available at next_in
+ total_in: Longint; // total nb of input bytes read so far
+
+ next_out: PChar; // next output byte should be put here
+ avail_out: Integer; // remaining free space at next_out
+ total_out: Longint; // total nb of bytes output so far
+
+ msg: PChar; // last error message, NULL if no error
+ internal: Pointer; // not visible by applications
+
+ zalloc: TAlloc; // used to allocate the internal state
+ zfree: TFree; // used to free the internal state
+ AppData: Pointer; // private data object passed to zalloc and zfree
+
+ data_type: Integer; // best guess about the data type: ascii or binary
+ adler: Longint; // adler32 value of the uncompressed data
+ reserved: Longint; // reserved for future use
+ end;
+
+ // Abstract ancestor class
+ TCustomZlibStream = class(TStream)
+ private
+ FStrm: TStream;
+ FStrmPos: Integer;
+ FOnProgress: TNotifyEvent;
+ FZRec: TZStreamRec;
+ FBuffer: array [Word] of Char;
+ protected
+ procedure Progress(Sender: TObject); dynamic;
+ property OnProgress: TNotifyEvent read FOnProgress write FOnProgress;
+ constructor Create(Strm: TStream);
+ end;
+
+{ TCompressionStream compresses data on the fly as data is written to it, and
+ stores the compressed data to another stream.
+
+ TCompressionStream is write-only and strictly sequential. Reading from the
+ stream will raise an exception. Using Seek to move the stream pointer
+ will raise an exception.
+
+ Output data is cached internally, written to the output stream only when
+ the internal output buffer is full. All pending output data is flushed
+ when the stream is destroyed.
+
+ The Position property returns the number of uncompressed bytes of
+ data that have been written to the stream so far.
+
+ CompressionRate returns the on-the-fly percentage by which the original
+ data has been compressed: (1 - (CompressedBytes / UncompressedBytes)) * 100
+ If raw data size = 100 and compressed data size = 25, the CompressionRate
+ is 75%
+
+ The OnProgress event is called each time the output buffer is filled and
+ written to the output stream. This is useful for updating a progress
+ indicator when you are writing a large chunk of data to the compression
+ stream in a single call.}
+
+
+ TCompressionLevel = (clNone, clFastest, clDefault, clMax);
+
+ TCompressionStream = class(TCustomZlibStream)
+ private
+ function GetCompressionRate: Single;
+ public
+ constructor Create(CompressionLevel: TCompressionLevel; Dest: TStream);
+ destructor Destroy; override;
+ function Read(var Buffer; Count: Longint): Longint; override;
+ function Write(const Buffer; Count: Longint): Longint; override;
+ function Seek(Offset: Longint; Origin: Word): Longint; override;
+ property CompressionRate: Single read GetCompressionRate;
+ property OnProgress;
+ end;
+
+{ TDecompressionStream decompresses data on the fly as data is read from it.
+
+ Compressed data comes from a separate source stream. TDecompressionStream
+ is read-only and unidirectional; you can seek forward in the stream, but not
+ backwards. The special case of setting the stream position to zero is
+ allowed. Seeking forward decompresses data until the requested position in
+ the uncompressed data has been reached. Seeking backwards, seeking relative
+ to the end of the stream, requesting the size of the stream, and writing to
+ the stream will raise an exception.
+
+ The Position property returns the number of bytes of uncompressed data that
+ have been read from the stream so far.
+
+ The OnProgress event is called each time the internal input buffer of
+ compressed data is exhausted and the next block is read from the input stream.
+ This is useful for updating a progress indicator when you are reading a
+ large chunk of data from the decompression stream in a single call.}
+
+ TDecompressionStream = class(TCustomZlibStream)
+ public
+ constructor Create(Source: TStream);
+ destructor Destroy; override;
+ function Read(var Buffer; Count: Longint): Longint; override;
+ function Write(const Buffer; Count: Longint): Longint; override;
+ function Seek(Offset: Longint; Origin: Word): Longint; override;
+ property OnProgress;
+ end;
+
+
+
+{ CompressBuf compresses data, buffer to buffer, in one call.
+ In: InBuf = ptr to compressed data
+ InBytes = number of bytes in InBuf
+ Out: OutBuf = ptr to newly allocated buffer containing decompressed data
+ OutBytes = number of bytes in OutBuf }
+procedure CompressBuf(const InBuf: Pointer; InBytes: Integer;
+ out OutBuf: Pointer; out OutBytes: Integer);
+
+
+{ DecompressBuf decompresses data, buffer to buffer, in one call.
+ In: InBuf = ptr to compressed data
+ InBytes = number of bytes in InBuf
+ OutEstimate = zero, or est. size of the decompressed data
+ Out: OutBuf = ptr to newly allocated buffer containing decompressed data
+ OutBytes = number of bytes in OutBuf }
+procedure DecompressBuf(const InBuf: Pointer; InBytes: Integer;
+ OutEstimate: Integer; out OutBuf: Pointer; out OutBytes: Integer);
+
+{ DecompressToUserBuf decompresses data, buffer to buffer, in one call.
+ In: InBuf = ptr to compressed data
+ InBytes = number of bytes in InBuf
+ Out: OutBuf = ptr to user-allocated buffer to contain decompressed data
+ BufSize = number of bytes in OutBuf }
+procedure DecompressToUserBuf(const InBuf: Pointer; InBytes: Integer;
+ const OutBuf: Pointer; BufSize: Integer);
+
+const
+ zlib_version = '1.2.8';
+
+type
+ EZlibError = class(Exception);
+ ECompressionError = class(EZlibError);
+ EDecompressionError = class(EZlibError);
+
+implementation
+
+uses ZLibConst;
+
+const
+ Z_NO_FLUSH = 0;
+ Z_PARTIAL_FLUSH = 1;
+ Z_SYNC_FLUSH = 2;
+ Z_FULL_FLUSH = 3;
+ Z_FINISH = 4;
+
+ Z_OK = 0;
+ Z_STREAM_END = 1;
+ Z_NEED_DICT = 2;
+ Z_ERRNO = (-1);
+ Z_STREAM_ERROR = (-2);
+ Z_DATA_ERROR = (-3);
+ Z_MEM_ERROR = (-4);
+ Z_BUF_ERROR = (-5);
+ Z_VERSION_ERROR = (-6);
+
+ Z_NO_COMPRESSION = 0;
+ Z_BEST_SPEED = 1;
+ Z_BEST_COMPRESSION = 9;
+ Z_DEFAULT_COMPRESSION = (-1);
+
+ Z_FILTERED = 1;
+ Z_HUFFMAN_ONLY = 2;
+ Z_RLE = 3;
+ Z_DEFAULT_STRATEGY = 0;
+
+ Z_BINARY = 0;
+ Z_ASCII = 1;
+ Z_UNKNOWN = 2;
+
+ Z_DEFLATED = 8;
+
+
+{$L adler32.obj}
+{$L compress.obj}
+{$L crc32.obj}
+{$L deflate.obj}
+{$L infback.obj}
+{$L inffast.obj}
+{$L inflate.obj}
+{$L inftrees.obj}
+{$L trees.obj}
+{$L uncompr.obj}
+{$L zutil.obj}
+
+procedure adler32; external;
+procedure compressBound; external;
+procedure crc32; external;
+procedure deflateInit2_; external;
+procedure deflateParams; external;
+
+function _malloc(Size: Integer): Pointer; cdecl;
+begin
+ Result := AllocMem(Size);
+end;
+
+procedure _free(Block: Pointer); cdecl;
+begin
+ FreeMem(Block);
+end;
+
+procedure _memset(P: Pointer; B: Byte; count: Integer); cdecl;
+begin
+ FillChar(P^, count, B);
+end;
+
+procedure _memcpy(dest, source: Pointer; count: Integer); cdecl;
+begin
+ Move(source^, dest^, count);
+end;
+
+
+
+// deflate compresses data
+function deflateInit_(var strm: TZStreamRec; level: Integer; version: PChar;
+ recsize: Integer): Integer; external;
+function deflate(var strm: TZStreamRec; flush: Integer): Integer; external;
+function deflateEnd(var strm: TZStreamRec): Integer; external;
+
+// inflate decompresses data
+function inflateInit_(var strm: TZStreamRec; version: PChar;
+ recsize: Integer): Integer; external;
+function inflate(var strm: TZStreamRec; flush: Integer): Integer; external;
+function inflateEnd(var strm: TZStreamRec): Integer; external;
+function inflateReset(var strm: TZStreamRec): Integer; external;
+
+
+function zlibAllocMem(AppData: Pointer; Items, Size: Integer): Pointer; cdecl;
+begin
+// GetMem(Result, Items*Size);
+ Result := AllocMem(Items * Size);
+end;
+
+procedure zlibFreeMem(AppData, Block: Pointer); cdecl;
+begin
+ FreeMem(Block);
+end;
+
+{function zlibCheck(code: Integer): Integer;
+begin
+ Result := code;
+ if code < 0 then
+ raise EZlibError.Create('error'); //!!
+end;}
+
+function CCheck(code: Integer): Integer;
+begin
+ Result := code;
+ if code < 0 then
+ raise ECompressionError.Create('error'); //!!
+end;
+
+function DCheck(code: Integer): Integer;
+begin
+ Result := code;
+ if code < 0 then
+ raise EDecompressionError.Create('error'); //!!
+end;
+
+procedure CompressBuf(const InBuf: Pointer; InBytes: Integer;
+ out OutBuf: Pointer; out OutBytes: Integer);
+var
+ strm: TZStreamRec;
+ P: Pointer;
+begin
+ FillChar(strm, sizeof(strm), 0);
+ strm.zalloc := zlibAllocMem;
+ strm.zfree := zlibFreeMem;
+ OutBytes := ((InBytes + (InBytes div 10) + 12) + 255) and not 255;
+ GetMem(OutBuf, OutBytes);
+ try
+ strm.next_in := InBuf;
+ strm.avail_in := InBytes;
+ strm.next_out := OutBuf;
+ strm.avail_out := OutBytes;
+ CCheck(deflateInit_(strm, Z_BEST_COMPRESSION, zlib_version, sizeof(strm)));
+ try
+ while CCheck(deflate(strm, Z_FINISH)) <> Z_STREAM_END do
+ begin
+ P := OutBuf;
+ Inc(OutBytes, 256);
+ ReallocMem(OutBuf, OutBytes);
+ strm.next_out := PChar(Integer(OutBuf) + (Integer(strm.next_out) - Integer(P)));
+ strm.avail_out := 256;
+ end;
+ finally
+ CCheck(deflateEnd(strm));
+ end;
+ ReallocMem(OutBuf, strm.total_out);
+ OutBytes := strm.total_out;
+ except
+ FreeMem(OutBuf);
+ raise
+ end;
+end;
+
+
+procedure DecompressBuf(const InBuf: Pointer; InBytes: Integer;
+ OutEstimate: Integer; out OutBuf: Pointer; out OutBytes: Integer);
+var
+ strm: TZStreamRec;
+ P: Pointer;
+ BufInc: Integer;
+begin
+ FillChar(strm, sizeof(strm), 0);
+ strm.zalloc := zlibAllocMem;
+ strm.zfree := zlibFreeMem;
+ BufInc := (InBytes + 255) and not 255;
+ if OutEstimate = 0 then
+ OutBytes := BufInc
+ else
+ OutBytes := OutEstimate;
+ GetMem(OutBuf, OutBytes);
+ try
+ strm.next_in := InBuf;
+ strm.avail_in := InBytes;
+ strm.next_out := OutBuf;
+ strm.avail_out := OutBytes;
+ DCheck(inflateInit_(strm, zlib_version, sizeof(strm)));
+ try
+ while DCheck(inflate(strm, Z_NO_FLUSH)) <> Z_STREAM_END do
+ begin
+ P := OutBuf;
+ Inc(OutBytes, BufInc);
+ ReallocMem(OutBuf, OutBytes);
+ strm.next_out := PChar(Integer(OutBuf) + (Integer(strm.next_out) - Integer(P)));
+ strm.avail_out := BufInc;
+ end;
+ finally
+ DCheck(inflateEnd(strm));
+ end;
+ ReallocMem(OutBuf, strm.total_out);
+ OutBytes := strm.total_out;
+ except
+ FreeMem(OutBuf);
+ raise
+ end;
+end;
+
+procedure DecompressToUserBuf(const InBuf: Pointer; InBytes: Integer;
+ const OutBuf: Pointer; BufSize: Integer);
+var
+ strm: TZStreamRec;
+begin
+ FillChar(strm, sizeof(strm), 0);
+ strm.zalloc := zlibAllocMem;
+ strm.zfree := zlibFreeMem;
+ strm.next_in := InBuf;
+ strm.avail_in := InBytes;
+ strm.next_out := OutBuf;
+ strm.avail_out := BufSize;
+ DCheck(inflateInit_(strm, zlib_version, sizeof(strm)));
+ try
+ if DCheck(inflate(strm, Z_FINISH)) <> Z_STREAM_END then
+ raise EZlibError.CreateRes(@sTargetBufferTooSmall);
+ finally
+ DCheck(inflateEnd(strm));
+ end;
+end;
+
+// TCustomZlibStream
+
+constructor TCustomZLibStream.Create(Strm: TStream);
+begin
+ inherited Create;
+ FStrm := Strm;
+ FStrmPos := Strm.Position;
+ FZRec.zalloc := zlibAllocMem;
+ FZRec.zfree := zlibFreeMem;
+end;
+
+procedure TCustomZLibStream.Progress(Sender: TObject);
+begin
+ if Assigned(FOnProgress) then FOnProgress(Sender);
+end;
+
+
+// TCompressionStream
+
+constructor TCompressionStream.Create(CompressionLevel: TCompressionLevel;
+ Dest: TStream);
+const
+ Levels: array [TCompressionLevel] of ShortInt =
+ (Z_NO_COMPRESSION, Z_BEST_SPEED, Z_DEFAULT_COMPRESSION, Z_BEST_COMPRESSION);
+begin
+ inherited Create(Dest);
+ FZRec.next_out := FBuffer;
+ FZRec.avail_out := sizeof(FBuffer);
+ CCheck(deflateInit_(FZRec, Levels[CompressionLevel], zlib_version, sizeof(FZRec)));
+end;
+
+destructor TCompressionStream.Destroy;
+begin
+ FZRec.next_in := nil;
+ FZRec.avail_in := 0;
+ try
+ if FStrm.Position <> FStrmPos then FStrm.Position := FStrmPos;
+ while (CCheck(deflate(FZRec, Z_FINISH)) <> Z_STREAM_END)
+ and (FZRec.avail_out = 0) do
+ begin
+ FStrm.WriteBuffer(FBuffer, sizeof(FBuffer));
+ FZRec.next_out := FBuffer;
+ FZRec.avail_out := sizeof(FBuffer);
+ end;
+ if FZRec.avail_out < sizeof(FBuffer) then
+ FStrm.WriteBuffer(FBuffer, sizeof(FBuffer) - FZRec.avail_out);
+ finally
+ deflateEnd(FZRec);
+ end;
+ inherited Destroy;
+end;
+
+function TCompressionStream.Read(var Buffer; Count: Longint): Longint;
+begin
+ raise ECompressionError.CreateRes(@sInvalidStreamOp);
+end;
+
+function TCompressionStream.Write(const Buffer; Count: Longint): Longint;
+begin
+ FZRec.next_in := @Buffer;
+ FZRec.avail_in := Count;
+ if FStrm.Position <> FStrmPos then FStrm.Position := FStrmPos;
+ while (FZRec.avail_in > 0) do
+ begin
+ CCheck(deflate(FZRec, 0));
+ if FZRec.avail_out = 0 then
+ begin
+ FStrm.WriteBuffer(FBuffer, sizeof(FBuffer));
+ FZRec.next_out := FBuffer;
+ FZRec.avail_out := sizeof(FBuffer);
+ FStrmPos := FStrm.Position;
+ Progress(Self);
+ end;
+ end;
+ Result := Count;
+end;
+
+function TCompressionStream.Seek(Offset: Longint; Origin: Word): Longint;
+begin
+ if (Offset = 0) and (Origin = soFromCurrent) then
+ Result := FZRec.total_in
+ else
+ raise ECompressionError.CreateRes(@sInvalidStreamOp);
+end;
+
+function TCompressionStream.GetCompressionRate: Single;
+begin
+ if FZRec.total_in = 0 then
+ Result := 0
+ else
+ Result := (1.0 - (FZRec.total_out / FZRec.total_in)) * 100.0;
+end;
+
+
+// TDecompressionStream
+
+constructor TDecompressionStream.Create(Source: TStream);
+begin
+ inherited Create(Source);
+ FZRec.next_in := FBuffer;
+ FZRec.avail_in := 0;
+ DCheck(inflateInit_(FZRec, zlib_version, sizeof(FZRec)));
+end;
+
+destructor TDecompressionStream.Destroy;
+begin
+ FStrm.Seek(-FZRec.avail_in, 1);
+ inflateEnd(FZRec);
+ inherited Destroy;
+end;
+
+function TDecompressionStream.Read(var Buffer; Count: Longint): Longint;
+begin
+ FZRec.next_out := @Buffer;
+ FZRec.avail_out := Count;
+ if FStrm.Position <> FStrmPos then FStrm.Position := FStrmPos;
+ while (FZRec.avail_out > 0) do
+ begin
+ if FZRec.avail_in = 0 then
+ begin
+ FZRec.avail_in := FStrm.Read(FBuffer, sizeof(FBuffer));
+ if FZRec.avail_in = 0 then
+ begin
+ Result := Count - FZRec.avail_out;
+ Exit;
+ end;
+ FZRec.next_in := FBuffer;
+ FStrmPos := FStrm.Position;
+ Progress(Self);
+ end;
+ CCheck(inflate(FZRec, 0));
+ end;
+ Result := Count;
+end;
+
+function TDecompressionStream.Write(const Buffer; Count: Longint): Longint;
+begin
+ raise EDecompressionError.CreateRes(@sInvalidStreamOp);
+end;
+
+function TDecompressionStream.Seek(Offset: Longint; Origin: Word): Longint;
+var
+ I: Integer;
+ Buf: array [0..4095] of Char;
+begin
+ if (Offset = 0) and (Origin = soFromBeginning) then
+ begin
+ DCheck(inflateReset(FZRec));
+ FZRec.next_in := FBuffer;
+ FZRec.avail_in := 0;
+ FStrm.Position := 0;
+ FStrmPos := 0;
+ end
+ else if ( (Offset >= 0) and (Origin = soFromCurrent)) or
+ ( ((Offset - FZRec.total_out) > 0) and (Origin = soFromBeginning)) then
+ begin
+ if Origin = soFromBeginning then Dec(Offset, FZRec.total_out);
+ if Offset > 0 then
+ begin
+ for I := 1 to Offset div sizeof(Buf) do
+ ReadBuffer(Buf, sizeof(Buf));
+ ReadBuffer(Buf, Offset mod sizeof(Buf));
+ end;
+ end
+ else
+ raise EDecompressionError.CreateRes(@sInvalidStreamOp);
+ Result := FZRec.total_out;
+end;
+
+
+end.
diff --git a/protocols/Telegram/tgl/zlib/contrib/delphi/ZLibConst.pas b/protocols/Telegram/tgl/zlib/contrib/delphi/ZLibConst.pas
new file mode 100644
index 0000000000..cdfe13671d
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/delphi/ZLibConst.pas
@@ -0,0 +1,11 @@
+unit ZLibConst;
+
+interface
+
+resourcestring
+ sTargetBufferTooSmall = 'ZLib error: target buffer may be too small';
+ sInvalidStreamOp = 'Invalid stream operation';
+
+implementation
+
+end.
diff --git a/protocols/Telegram/tgl/zlib/contrib/delphi/readme.txt b/protocols/Telegram/tgl/zlib/contrib/delphi/readme.txt
new file mode 100644
index 0000000000..2dc9a8bba2
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/delphi/readme.txt
@@ -0,0 +1,76 @@
+
+Overview
+========
+
+This directory contains an update to the ZLib interface unit,
+distributed by Borland as a Delphi supplemental component.
+
+The original ZLib unit is Copyright (c) 1997,99 Borland Corp.,
+and is based on zlib version 1.0.4. There are a series of bugs
+and security problems associated with that old zlib version, and
+we recommend the users to update their ZLib unit.
+
+
+Summary of modifications
+========================
+
+- Improved makefile, adapted to zlib version 1.2.1.
+
+- Some field types from TZStreamRec are changed from Integer to
+ Longint, for consistency with the zlib.h header, and for 64-bit
+ readiness.
+
+- The zlib_version constant is updated.
+
+- The new Z_RLE strategy has its corresponding symbolic constant.
+
+- The allocation and deallocation functions and function types
+ (TAlloc, TFree, zlibAllocMem and zlibFreeMem) are now cdecl,
+ and _malloc and _free are added as C RTL stubs. As a result,
+ the original C sources of zlib can be compiled out of the box,
+ and linked to the ZLib unit.
+
+
+Suggestions for improvements
+============================
+
+Currently, the ZLib unit provides only a limited wrapper around
+the zlib library, and much of the original zlib functionality is
+missing. Handling compressed file formats like ZIP/GZIP or PNG
+cannot be implemented without having this functionality.
+Applications that handle these formats are either using their own,
+duplicated code, or not using the ZLib unit at all.
+
+Here are a few suggestions:
+
+- Checksum class wrappers around adler32() and crc32(), similar
+ to the Java classes that implement the java.util.zip.Checksum
+ interface.
+
+- The ability to read and write raw deflate streams, without the
+ zlib stream header and trailer. Raw deflate streams are used
+ in the ZIP file format.
+
+- The ability to read and write gzip streams, used in the GZIP
+ file format, and normally produced by the gzip program.
+
+- The ability to select a different compression strategy, useful
+ to PNG and MNG image compression, and to multimedia compression
+ in general. Besides the compression level
+
+ TCompressionLevel = (clNone, clFastest, clDefault, clMax);
+
+ which, in fact, could have used the 'z' prefix and avoided
+ TColor-like symbols
+
+ TCompressionLevel = (zcNone, zcFastest, zcDefault, zcMax);
+
+ there could be a compression strategy
+
+ TCompressionStrategy = (zsDefault, zsFiltered, zsHuffmanOnly, zsRle);
+
+- ZIP and GZIP stream handling via TStreams.
+
+
+--
+Cosmin Truta <cosmint@cs.ubbcluj.ro>
diff --git a/protocols/Telegram/tgl/zlib/contrib/delphi/zlibd32.mak b/protocols/Telegram/tgl/zlib/contrib/delphi/zlibd32.mak
new file mode 100644
index 0000000000..9bb00b7cc4
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/delphi/zlibd32.mak
@@ -0,0 +1,99 @@
+# Makefile for zlib
+# For use with Delphi and C++ Builder under Win32
+# Updated for zlib 1.2.x by Cosmin Truta
+
+# ------------ Borland C++ ------------
+
+# This project uses the Delphi (fastcall/register) calling convention:
+LOC = -DZEXPORT=__fastcall -DZEXPORTVA=__cdecl
+
+CC = bcc32
+LD = bcc32
+AR = tlib
+# do not use "-pr" in CFLAGS
+CFLAGS = -a -d -k- -O2 $(LOC)
+LDFLAGS =
+
+
+# variables
+ZLIB_LIB = zlib.lib
+
+OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj
+OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj
+OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj
+OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj
+
+
+# targets
+all: $(ZLIB_LIB) example.exe minigzip.exe
+
+.c.obj:
+ $(CC) -c $(CFLAGS) $*.c
+
+adler32.obj: adler32.c zlib.h zconf.h
+
+compress.obj: compress.c zlib.h zconf.h
+
+crc32.obj: crc32.c zlib.h zconf.h crc32.h
+
+deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
+
+gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h
+
+gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h
+
+gzread.obj: gzread.c zlib.h zconf.h gzguts.h
+
+gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h
+
+infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
+ inffast.h inffixed.h
+
+inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
+ inffast.h
+
+inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
+ inffast.h inffixed.h
+
+inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
+
+trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h
+
+uncompr.obj: uncompr.c zlib.h zconf.h
+
+zutil.obj: zutil.c zutil.h zlib.h zconf.h
+
+example.obj: test/example.c zlib.h zconf.h
+
+minigzip.obj: test/minigzip.c zlib.h zconf.h
+
+
+# For the sake of the old Borland make,
+# the command line is cut to fit in the MS-DOS 128 byte limit:
+$(ZLIB_LIB): $(OBJ1) $(OBJ2)
+ -del $(ZLIB_LIB)
+ $(AR) $(ZLIB_LIB) $(OBJP1)
+ $(AR) $(ZLIB_LIB) $(OBJP2)
+
+
+# testing
+test: example.exe minigzip.exe
+ example
+ echo hello world | minigzip | minigzip -d
+
+example.exe: example.obj $(ZLIB_LIB)
+ $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB)
+
+minigzip.exe: minigzip.obj $(ZLIB_LIB)
+ $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB)
+
+
+# cleanup
+clean:
+ -del *.obj
+ -del *.exe
+ -del *.lib
+ -del *.tds
+ -del zlib.bak
+ -del foo.gz
+
diff --git a/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib.build b/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib.build
new file mode 100644
index 0000000000..7f90d6bc7c
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib.build
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<project name="DotZLib" default="build" basedir="./DotZLib">
+ <description>A .Net wrapper library around ZLib1.dll</description>
+
+ <property name="nunit.location" value="c:/program files/NUnit V2.1/bin" />
+ <property name="build.root" value="bin" />
+
+ <property name="debug" value="true" />
+ <property name="nunit" value="true" />
+
+ <property name="build.folder" value="${build.root}/debug/" if="${debug}" />
+ <property name="build.folder" value="${build.root}/release/" unless="${debug}" />
+
+ <target name="clean" description="Remove all generated files">
+ <delete dir="${build.root}" failonerror="false" />
+ </target>
+
+ <target name="build" description="compiles the source code">
+
+ <mkdir dir="${build.folder}" />
+ <csc target="library" output="${build.folder}DotZLib.dll" debug="${debug}">
+ <references basedir="${nunit.location}">
+ <includes if="${nunit}" name="nunit.framework.dll" />
+ </references>
+ <sources>
+ <includes name="*.cs" />
+ <excludes name="UnitTests.cs" unless="${nunit}" />
+ </sources>
+ <arg value="/d:nunit" if="${nunit}" />
+ </csc>
+ </target>
+
+</project> \ No newline at end of file
diff --git a/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib.chm b/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib.chm
new file mode 100644
index 0000000000..f214a444ae
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib.chm
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib.sln b/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib.sln
new file mode 100644
index 0000000000..ac45ca048b
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib.sln
@@ -0,0 +1,21 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotZLib", "DotZLib\DotZLib.csproj", "{BB1EE0B1-1808-46CB-B786-949D91117FC5}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfiguration) = preSolution
+ Debug = Debug
+ Release = Release
+ EndGlobalSection
+ GlobalSection(ProjectConfiguration) = postSolution
+ {BB1EE0B1-1808-46CB-B786-949D91117FC5}.Debug.ActiveCfg = Debug|.NET
+ {BB1EE0B1-1808-46CB-B786-949D91117FC5}.Debug.Build.0 = Debug|.NET
+ {BB1EE0B1-1808-46CB-B786-949D91117FC5}.Release.ActiveCfg = Release|.NET
+ {BB1EE0B1-1808-46CB-B786-949D91117FC5}.Release.Build.0 = Release|.NET
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ EndGlobalSection
+ GlobalSection(ExtensibilityAddIns) = postSolution
+ EndGlobalSection
+EndGlobal
diff --git a/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/AssemblyInfo.cs b/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/AssemblyInfo.cs
new file mode 100644
index 0000000000..0491bfc2b0
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/AssemblyInfo.cs
@@ -0,0 +1,58 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+//
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+//
+[assembly: AssemblyTitle("DotZLib")]
+[assembly: AssemblyDescription(".Net bindings for ZLib compression dll 1.2.x")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Henrik Ravn")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("(c) 2004 by Henrik Ravn")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly: AssemblyVersion("1.0.*")]
+
+//
+// In order to sign your assembly you must specify a key to use. Refer to the
+// Microsoft .NET Framework documentation for more information on assembly signing.
+//
+// Use the attributes below to control which key is used for signing.
+//
+// Notes:
+// (*) If no key is specified, the assembly is not signed.
+// (*) KeyName refers to a key that has been installed in the Crypto Service
+// Provider (CSP) on your machine. KeyFile refers to a file which contains
+// a key.
+// (*) If the KeyFile and the KeyName values are both specified, the
+// following processing occurs:
+// (1) If the KeyName can be found in the CSP, that key is used.
+// (2) If the KeyName does not exist and the KeyFile does exist, the key
+// in the KeyFile is installed into the CSP and used.
+// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
+// When specifying the KeyFile, the location of the KeyFile should be
+// relative to the project output directory which is
+// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
+// located in the project directory, you would specify the AssemblyKeyFile
+// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
+// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+// documentation for more information on this.
+//
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("")]
+[assembly: AssemblyKeyName("")]
diff --git a/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs b/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs
new file mode 100644
index 0000000000..788b2fcece
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs
@@ -0,0 +1,202 @@
+//
+// © Copyright Henrik Ravn 2004
+//
+// Use, modification and distribution are subject to the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+using System;
+using System.Runtime.InteropServices;
+using System.Text;
+
+
+namespace DotZLib
+{
+ #region ChecksumGeneratorBase
+ /// <summary>
+ /// Implements the common functionality needed for all <see cref="ChecksumGenerator"/>s
+ /// </summary>
+ /// <example></example>
+ public abstract class ChecksumGeneratorBase : ChecksumGenerator
+ {
+ /// <summary>
+ /// The value of the current checksum
+ /// </summary>
+ protected uint _current;
+
+ /// <summary>
+ /// Initializes a new instance of the checksum generator base - the current checksum is
+ /// set to zero
+ /// </summary>
+ public ChecksumGeneratorBase()
+ {
+ _current = 0;
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the checksum generator basewith a specified value
+ /// </summary>
+ /// <param name="initialValue">The value to set the current checksum to</param>
+ public ChecksumGeneratorBase(uint initialValue)
+ {
+ _current = initialValue;
+ }
+
+ /// <summary>
+ /// Resets the current checksum to zero
+ /// </summary>
+ public void Reset() { _current = 0; }
+
+ /// <summary>
+ /// Gets the current checksum value
+ /// </summary>
+ public uint Value { get { return _current; } }
+
+ /// <summary>
+ /// Updates the current checksum with part of an array of bytes
+ /// </summary>
+ /// <param name="data">The data to update the checksum with</param>
+ /// <param name="offset">Where in <c>data</c> to start updating</param>
+ /// <param name="count">The number of bytes from <c>data</c> to use</param>
+ /// <exception cref="ArgumentException">The sum of offset and count is larger than the length of <c>data</c></exception>
+ /// <exception cref="NullReferenceException"><c>data</c> is a null reference</exception>
+ /// <exception cref="ArgumentOutOfRangeException">Offset or count is negative.</exception>
+ /// <remarks>All the other <c>Update</c> methods are implmeneted in terms of this one.
+ /// This is therefore the only method a derived class has to implement</remarks>
+ public abstract void Update(byte[] data, int offset, int count);
+
+ /// <summary>
+ /// Updates the current checksum with an array of bytes.
+ /// </summary>
+ /// <param name="data">The data to update the checksum with</param>
+ public void Update(byte[] data)
+ {
+ Update(data, 0, data.Length);
+ }
+
+ /// <summary>
+ /// Updates the current checksum with the data from a string
+ /// </summary>
+ /// <param name="data">The string to update the checksum with</param>
+ /// <remarks>The characters in the string are converted by the UTF-8 encoding</remarks>
+ public void Update(string data)
+ {
+ Update(Encoding.UTF8.GetBytes(data));
+ }
+
+ /// <summary>
+ /// Updates the current checksum with the data from a string, using a specific encoding
+ /// </summary>
+ /// <param name="data">The string to update the checksum with</param>
+ /// <param name="encoding">The encoding to use</param>
+ public void Update(string data, Encoding encoding)
+ {
+ Update(encoding.GetBytes(data));
+ }
+
+ }
+ #endregion
+
+ #region CRC32
+ /// <summary>
+ /// Implements a CRC32 checksum generator
+ /// </summary>
+ public sealed class CRC32Checksum : ChecksumGeneratorBase
+ {
+ #region DLL imports
+
+ [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
+ private static extern uint crc32(uint crc, int data, uint length);
+
+ #endregion
+
+ /// <summary>
+ /// Initializes a new instance of the CRC32 checksum generator
+ /// </summary>
+ public CRC32Checksum() : base() {}
+
+ /// <summary>
+ /// Initializes a new instance of the CRC32 checksum generator with a specified value
+ /// </summary>
+ /// <param name="initialValue">The value to set the current checksum to</param>
+ public CRC32Checksum(uint initialValue) : base(initialValue) {}
+
+ /// <summary>
+ /// Updates the current checksum with part of an array of bytes
+ /// </summary>
+ /// <param name="data">The data to update the checksum with</param>
+ /// <param name="offset">Where in <c>data</c> to start updating</param>
+ /// <param name="count">The number of bytes from <c>data</c> to use</param>
+ /// <exception cref="ArgumentException">The sum of offset and count is larger than the length of <c>data</c></exception>
+ /// <exception cref="NullReferenceException"><c>data</c> is a null reference</exception>
+ /// <exception cref="ArgumentOutOfRangeException">Offset or count is negative.</exception>
+ public override void Update(byte[] data, int offset, int count)
+ {
+ if (offset < 0 || count < 0) throw new ArgumentOutOfRangeException();
+ if ((offset+count) > data.Length) throw new ArgumentException();
+ GCHandle hData = GCHandle.Alloc(data, GCHandleType.Pinned);
+ try
+ {
+ _current = crc32(_current, hData.AddrOfPinnedObject().ToInt32()+offset, (uint)count);
+ }
+ finally
+ {
+ hData.Free();
+ }
+ }
+
+ }
+ #endregion
+
+ #region Adler
+ /// <summary>
+ /// Implements a checksum generator that computes the Adler checksum on data
+ /// </summary>
+ public sealed class AdlerChecksum : ChecksumGeneratorBase
+ {
+ #region DLL imports
+
+ [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
+ private static extern uint adler32(uint adler, int data, uint length);
+
+ #endregion
+
+ /// <summary>
+ /// Initializes a new instance of the Adler checksum generator
+ /// </summary>
+ public AdlerChecksum() : base() {}
+
+ /// <summary>
+ /// Initializes a new instance of the Adler checksum generator with a specified value
+ /// </summary>
+ /// <param name="initialValue">The value to set the current checksum to</param>
+ public AdlerChecksum(uint initialValue) : base(initialValue) {}
+
+ /// <summary>
+ /// Updates the current checksum with part of an array of bytes
+ /// </summary>
+ /// <param name="data">The data to update the checksum with</param>
+ /// <param name="offset">Where in <c>data</c> to start updating</param>
+ /// <param name="count">The number of bytes from <c>data</c> to use</param>
+ /// <exception cref="ArgumentException">The sum of offset and count is larger than the length of <c>data</c></exception>
+ /// <exception cref="NullReferenceException"><c>data</c> is a null reference</exception>
+ /// <exception cref="ArgumentOutOfRangeException">Offset or count is negative.</exception>
+ public override void Update(byte[] data, int offset, int count)
+ {
+ if (offset < 0 || count < 0) throw new ArgumentOutOfRangeException();
+ if ((offset+count) > data.Length) throw new ArgumentException();
+ GCHandle hData = GCHandle.Alloc(data, GCHandleType.Pinned);
+ try
+ {
+ _current = adler32(_current, hData.AddrOfPinnedObject().ToInt32()+offset, (uint)count);
+ }
+ finally
+ {
+ hData.Free();
+ }
+ }
+
+ }
+ #endregion
+
+} \ No newline at end of file
diff --git a/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/CircularBuffer.cs b/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/CircularBuffer.cs
new file mode 100644
index 0000000000..c1cab3a02c
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/CircularBuffer.cs
@@ -0,0 +1,83 @@
+//
+// © Copyright Henrik Ravn 2004
+//
+// Use, modification and distribution are subject to the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+using System;
+using System.Diagnostics;
+
+namespace DotZLib
+{
+
+ /// <summary>
+ /// This class implements a circular buffer
+ /// </summary>
+ internal class CircularBuffer
+ {
+ #region Private data
+ private int _capacity;
+ private int _head;
+ private int _tail;
+ private int _size;
+ private byte[] _buffer;
+ #endregion
+
+ public CircularBuffer(int capacity)
+ {
+ Debug.Assert( capacity > 0 );
+ _buffer = new byte[capacity];
+ _capacity = capacity;
+ _head = 0;
+ _tail = 0;
+ _size = 0;
+ }
+
+ public int Size { get { return _size; } }
+
+ public int Put(byte[] source, int offset, int count)
+ {
+ Debug.Assert( count > 0 );
+ int trueCount = Math.Min(count, _capacity - Size);
+ for (int i = 0; i < trueCount; ++i)
+ _buffer[(_tail+i) % _capacity] = source[offset+i];
+ _tail += trueCount;
+ _tail %= _capacity;
+ _size += trueCount;
+ return trueCount;
+ }
+
+ public bool Put(byte b)
+ {
+ if (Size == _capacity) // no room
+ return false;
+ _buffer[_tail++] = b;
+ _tail %= _capacity;
+ ++_size;
+ return true;
+ }
+
+ public int Get(byte[] destination, int offset, int count)
+ {
+ int trueCount = Math.Min(count,Size);
+ for (int i = 0; i < trueCount; ++i)
+ destination[offset + i] = _buffer[(_head+i) % _capacity];
+ _head += trueCount;
+ _head %= _capacity;
+ _size -= trueCount;
+ return trueCount;
+ }
+
+ public int Get()
+ {
+ if (Size == 0)
+ return -1;
+
+ int result = (int)_buffer[_head++ % _capacity];
+ --_size;
+ return result;
+ }
+
+ }
+}
diff --git a/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/CodecBase.cs b/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/CodecBase.cs
new file mode 100644
index 0000000000..42e6da3a56
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/CodecBase.cs
@@ -0,0 +1,198 @@
+//
+// © Copyright Henrik Ravn 2004
+//
+// Use, modification and distribution are subject to the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace DotZLib
+{
+ /// <summary>
+ /// Implements the common functionality needed for all <see cref="Codec"/>s
+ /// </summary>
+ public abstract class CodecBase : Codec, IDisposable
+ {
+
+ #region Data members
+
+ /// <summary>
+ /// Instance of the internal zlib buffer structure that is
+ /// passed to all functions in the zlib dll
+ /// </summary>
+ internal ZStream _ztream = new ZStream();
+
+ /// <summary>
+ /// True if the object instance has been disposed, false otherwise
+ /// </summary>
+ protected bool _isDisposed = false;
+
+ /// <summary>
+ /// The size of the internal buffers
+ /// </summary>
+ protected const int kBufferSize = 16384;
+
+ private byte[] _outBuffer = new byte[kBufferSize];
+ private byte[] _inBuffer = new byte[kBufferSize];
+
+ private GCHandle _hInput;
+ private GCHandle _hOutput;
+
+ private uint _checksum = 0;
+
+ #endregion
+
+ /// <summary>
+ /// Initializes a new instance of the <c>CodeBase</c> class.
+ /// </summary>
+ public CodecBase()
+ {
+ try
+ {
+ _hInput = GCHandle.Alloc(_inBuffer, GCHandleType.Pinned);
+ _hOutput = GCHandle.Alloc(_outBuffer, GCHandleType.Pinned);
+ }
+ catch (Exception)
+ {
+ CleanUp(false);
+ throw;
+ }
+ }
+
+
+ #region Codec Members
+
+ /// <summary>
+ /// Occurs when more processed data are available.
+ /// </summary>
+ public event DataAvailableHandler DataAvailable;
+
+ /// <summary>
+ /// Fires the <see cref="DataAvailable"/> event
+ /// </summary>
+ protected void OnDataAvailable()
+ {
+ if (_ztream.total_out > 0)
+ {
+ if (DataAvailable != null)
+ DataAvailable( _outBuffer, 0, (int)_ztream.total_out);
+ resetOutput();
+ }
+ }
+
+ /// <summary>
+ /// Adds more data to the codec to be processed.
+ /// </summary>
+ /// <param name="data">Byte array containing the data to be added to the codec</param>
+ /// <remarks>Adding data may, or may not, raise the <c>DataAvailable</c> event</remarks>
+ public void Add(byte[] data)
+ {
+ Add(data,0,data.Length);
+ }
+
+ /// <summary>
+ /// Adds more data to the codec to be processed.
+ /// </summary>
+ /// <param name="data">Byte array containing the data to be added to the codec</param>
+ /// <param name="offset">The index of the first byte to add from <c>data</c></param>
+ /// <param name="count">The number of bytes to add</param>
+ /// <remarks>Adding data may, or may not, raise the <c>DataAvailable</c> event</remarks>
+ /// <remarks>This must be implemented by a derived class</remarks>
+ public abstract void Add(byte[] data, int offset, int count);
+
+ /// <summary>
+ /// Finishes up any pending data that needs to be processed and handled.
+ /// </summary>
+ /// <remarks>This must be implemented by a derived class</remarks>
+ public abstract void Finish();
+
+ /// <summary>
+ /// Gets the checksum of the data that has been added so far
+ /// </summary>
+ public uint Checksum { get { return _checksum; } }
+
+ #endregion
+
+ #region Destructor & IDisposable stuff
+
+ /// <summary>
+ /// Destroys this instance
+ /// </summary>
+ ~CodecBase()
+ {
+ CleanUp(false);
+ }
+
+ /// <summary>
+ /// Releases any unmanaged resources and calls the <see cref="CleanUp()"/> method of the derived class
+ /// </summary>
+ public void Dispose()
+ {
+ CleanUp(true);
+ }
+
+ /// <summary>
+ /// Performs any codec specific cleanup
+ /// </summary>
+ /// <remarks>This must be implemented by a derived class</remarks>
+ protected abstract void CleanUp();
+
+ // performs the release of the handles and calls the dereived CleanUp()
+ private void CleanUp(bool isDisposing)
+ {
+ if (!_isDisposed)
+ {
+ CleanUp();
+ if (_hInput.IsAllocated)
+ _hInput.Free();
+ if (_hOutput.IsAllocated)
+ _hOutput.Free();
+
+ _isDisposed = true;
+ }
+ }
+
+
+ #endregion
+
+ #region Helper methods
+
+ /// <summary>
+ /// Copies a number of bytes to the internal codec buffer - ready for proccesing
+ /// </summary>
+ /// <param name="data">The byte array that contains the data to copy</param>
+ /// <param name="startIndex">The index of the first byte to copy</param>
+ /// <param name="count">The number of bytes to copy from <c>data</c></param>
+ protected void copyInput(byte[] data, int startIndex, int count)
+ {
+ Array.Copy(data, startIndex, _inBuffer,0, count);
+ _ztream.next_in = _hInput.AddrOfPinnedObject();
+ _ztream.total_in = 0;
+ _ztream.avail_in = (uint)count;
+
+ }
+
+ /// <summary>
+ /// Resets the internal output buffers to a known state - ready for processing
+ /// </summary>
+ protected void resetOutput()
+ {
+ _ztream.total_out = 0;
+ _ztream.avail_out = kBufferSize;
+ _ztream.next_out = _hOutput.AddrOfPinnedObject();
+ }
+
+ /// <summary>
+ /// Updates the running checksum property
+ /// </summary>
+ /// <param name="newSum">The new checksum value</param>
+ protected void setChecksum(uint newSum)
+ {
+ _checksum = newSum;
+ }
+ #endregion
+
+ }
+}
diff --git a/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/Deflater.cs b/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/Deflater.cs
new file mode 100644
index 0000000000..c2477925b6
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/Deflater.cs
@@ -0,0 +1,106 @@
+//
+// © Copyright Henrik Ravn 2004
+//
+// Use, modification and distribution are subject to the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+using System;
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+
+namespace DotZLib
+{
+
+ /// <summary>
+ /// Implements a data compressor, using the deflate algorithm in the ZLib dll
+ /// </summary>
+ public sealed class Deflater : CodecBase
+ {
+ #region Dll imports
+ [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)]
+ private static extern int deflateInit_(ref ZStream sz, int level, string vs, int size);
+
+ [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
+ private static extern int deflate(ref ZStream sz, int flush);
+
+ [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
+ private static extern int deflateReset(ref ZStream sz);
+
+ [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
+ private static extern int deflateEnd(ref ZStream sz);
+ #endregion
+
+ /// <summary>
+ /// Constructs an new instance of the <c>Deflater</c>
+ /// </summary>
+ /// <param name="level">The compression level to use for this <c>Deflater</c></param>
+ public Deflater(CompressLevel level) : base()
+ {
+ int retval = deflateInit_(ref _ztream, (int)level, Info.Version, Marshal.SizeOf(_ztream));
+ if (retval != 0)
+ throw new ZLibException(retval, "Could not initialize deflater");
+
+ resetOutput();
+ }
+
+ /// <summary>
+ /// Adds more data to the codec to be processed.
+ /// </summary>
+ /// <param name="data">Byte array containing the data to be added to the codec</param>
+ /// <param name="offset">The index of the first byte to add from <c>data</c></param>
+ /// <param name="count">The number of bytes to add</param>
+ /// <remarks>Adding data may, or may not, raise the <c>DataAvailable</c> event</remarks>
+ public override void Add(byte[] data, int offset, int count)
+ {
+ if (data == null) throw new ArgumentNullException();
+ if (offset < 0 || count < 0) throw new ArgumentOutOfRangeException();
+ if ((offset+count) > data.Length) throw new ArgumentException();
+
+ int total = count;
+ int inputIndex = offset;
+ int err = 0;
+
+ while (err >= 0 && inputIndex < total)
+ {
+ copyInput(data, inputIndex, Math.Min(total - inputIndex, kBufferSize));
+ while (err >= 0 && _ztream.avail_in > 0)
+ {
+ err = deflate(ref _ztream, (int)FlushTypes.None);
+ if (err == 0)
+ while (_ztream.avail_out == 0)
+ {
+ OnDataAvailable();
+ err = deflate(ref _ztream, (int)FlushTypes.None);
+ }
+ inputIndex += (int)_ztream.total_in;
+ }
+ }
+ setChecksum( _ztream.adler );
+ }
+
+
+ /// <summary>
+ /// Finishes up any pending data that needs to be processed and handled.
+ /// </summary>
+ public override void Finish()
+ {
+ int err;
+ do
+ {
+ err = deflate(ref _ztream, (int)FlushTypes.Finish);
+ OnDataAvailable();
+ }
+ while (err == 0);
+ setChecksum( _ztream.adler );
+ deflateReset(ref _ztream);
+ resetOutput();
+ }
+
+ /// <summary>
+ /// Closes the internal zlib deflate stream
+ /// </summary>
+ protected override void CleanUp() { deflateEnd(ref _ztream); }
+
+ }
+}
diff --git a/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/DotZLib.cs b/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/DotZLib.cs
new file mode 100644
index 0000000000..be184b4c71
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/DotZLib.cs
@@ -0,0 +1,288 @@
+//
+// © Copyright Henrik Ravn 2004
+//
+// Use, modification and distribution are subject to the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+using System;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Text;
+
+
+namespace DotZLib
+{
+
+ #region Internal types
+
+ /// <summary>
+ /// Defines constants for the various flush types used with zlib
+ /// </summary>
+ internal enum FlushTypes
+ {
+ None, Partial, Sync, Full, Finish, Block
+ }
+
+ #region ZStream structure
+ // internal mapping of the zlib zstream structure for marshalling
+ [StructLayoutAttribute(LayoutKind.Sequential, Pack=4, Size=0, CharSet=CharSet.Ansi)]
+ internal struct ZStream
+ {
+ public IntPtr next_in;
+ public uint avail_in;
+ public uint total_in;
+
+ public IntPtr next_out;
+ public uint avail_out;
+ public uint total_out;
+
+ [MarshalAs(UnmanagedType.LPStr)]
+ string msg;
+ uint state;
+
+ uint zalloc;
+ uint zfree;
+ uint opaque;
+
+ int data_type;
+ public uint adler;
+ uint reserved;
+ }
+
+ #endregion
+
+ #endregion
+
+ #region Public enums
+ /// <summary>
+ /// Defines constants for the available compression levels in zlib
+ /// </summary>
+ public enum CompressLevel : int
+ {
+ /// <summary>
+ /// The default compression level with a reasonable compromise between compression and speed
+ /// </summary>
+ Default = -1,
+ /// <summary>
+ /// No compression at all. The data are passed straight through.
+ /// </summary>
+ None = 0,
+ /// <summary>
+ /// The maximum compression rate available.
+ /// </summary>
+ Best = 9,
+ /// <summary>
+ /// The fastest available compression level.
+ /// </summary>
+ Fastest = 1
+ }
+ #endregion
+
+ #region Exception classes
+ /// <summary>
+ /// The exception that is thrown when an error occurs on the zlib dll
+ /// </summary>
+ public class ZLibException : ApplicationException
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ZLibException"/> class with a specified
+ /// error message and error code
+ /// </summary>
+ /// <param name="errorCode">The zlib error code that caused the exception</param>
+ /// <param name="msg">A message that (hopefully) describes the error</param>
+ public ZLibException(int errorCode, string msg) : base(String.Format("ZLib error {0} {1}", errorCode, msg))
+ {
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ZLibException"/> class with a specified
+ /// error code
+ /// </summary>
+ /// <param name="errorCode">The zlib error code that caused the exception</param>
+ public ZLibException(int errorCode) : base(String.Format("ZLib error {0}", errorCode))
+ {
+ }
+ }
+ #endregion
+
+ #region Interfaces
+
+ /// <summary>
+ /// Declares methods and properties that enables a running checksum to be calculated
+ /// </summary>
+ public interface ChecksumGenerator
+ {
+ /// <summary>
+ /// Gets the current value of the checksum
+ /// </summary>
+ uint Value { get; }
+
+ /// <summary>
+ /// Clears the current checksum to 0
+ /// </summary>
+ void Reset();
+
+ /// <summary>
+ /// Updates the current checksum with an array of bytes
+ /// </summary>
+ /// <param name="data">The data to update the checksum with</param>
+ void Update(byte[] data);
+
+ /// <summary>
+ /// Updates the current checksum with part of an array of bytes
+ /// </summary>
+ /// <param name="data">The data to update the checksum with</param>
+ /// <param name="offset">Where in <c>data</c> to start updating</param>
+ /// <param name="count">The number of bytes from <c>data</c> to use</param>
+ /// <exception cref="ArgumentException">The sum of offset and count is larger than the length of <c>data</c></exception>
+ /// <exception cref="ArgumentNullException"><c>data</c> is a null reference</exception>
+ /// <exception cref="ArgumentOutOfRangeException">Offset or count is negative.</exception>
+ void Update(byte[] data, int offset, int count);
+
+ /// <summary>
+ /// Updates the current checksum with the data from a string
+ /// </summary>
+ /// <param name="data">The string to update the checksum with</param>
+ /// <remarks>The characters in the string are converted by the UTF-8 encoding</remarks>
+ void Update(string data);
+
+ /// <summary>
+ /// Updates the current checksum with the data from a string, using a specific encoding
+ /// </summary>
+ /// <param name="data">The string to update the checksum with</param>
+ /// <param name="encoding">The encoding to use</param>
+ void Update(string data, Encoding encoding);
+ }
+
+
+ /// <summary>
+ /// Represents the method that will be called from a codec when new data
+ /// are available.
+ /// </summary>
+ /// <paramref name="data">The byte array containing the processed data</paramref>
+ /// <paramref name="startIndex">The index of the first processed byte in <c>data</c></paramref>
+ /// <paramref name="count">The number of processed bytes available</paramref>
+ /// <remarks>On return from this method, the data may be overwritten, so grab it while you can.
+ /// You cannot assume that startIndex will be zero.
+ /// </remarks>
+ public delegate void DataAvailableHandler(byte[] data, int startIndex, int count);
+
+ /// <summary>
+ /// Declares methods and events for implementing compressors/decompressors
+ /// </summary>
+ public interface Codec
+ {
+ /// <summary>
+ /// Occurs when more processed data are available.
+ /// </summary>
+ event DataAvailableHandler DataAvailable;
+
+ /// <summary>
+ /// Adds more data to the codec to be processed.
+ /// </summary>
+ /// <param name="data">Byte array containing the data to be added to the codec</param>
+ /// <remarks>Adding data may, or may not, raise the <c>DataAvailable</c> event</remarks>
+ void Add(byte[] data);
+
+ /// <summary>
+ /// Adds more data to the codec to be processed.
+ /// </summary>
+ /// <param name="data">Byte array containing the data to be added to the codec</param>
+ /// <param name="offset">The index of the first byte to add from <c>data</c></param>
+ /// <param name="count">The number of bytes to add</param>
+ /// <remarks>Adding data may, or may not, raise the <c>DataAvailable</c> event</remarks>
+ void Add(byte[] data, int offset, int count);
+
+ /// <summary>
+ /// Finishes up any pending data that needs to be processed and handled.
+ /// </summary>
+ void Finish();
+
+ /// <summary>
+ /// Gets the checksum of the data that has been added so far
+ /// </summary>
+ uint Checksum { get; }
+
+
+ }
+
+ #endregion
+
+ #region Classes
+ /// <summary>
+ /// Encapsulates general information about the ZLib library
+ /// </summary>
+ public class Info
+ {
+ #region DLL imports
+ [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
+ private static extern uint zlibCompileFlags();
+
+ [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
+ private static extern string zlibVersion();
+ #endregion
+
+ #region Private stuff
+ private uint _flags;
+
+ // helper function that unpacks a bitsize mask
+ private static int bitSize(uint bits)
+ {
+ switch (bits)
+ {
+ case 0: return 16;
+ case 1: return 32;
+ case 2: return 64;
+ }
+ return -1;
+ }
+ #endregion
+
+ /// <summary>
+ /// Constructs an instance of the <c>Info</c> class.
+ /// </summary>
+ public Info()
+ {
+ _flags = zlibCompileFlags();
+ }
+
+ /// <summary>
+ /// True if the library is compiled with debug info
+ /// </summary>
+ public bool HasDebugInfo { get { return 0 != (_flags & 0x100); } }
+
+ /// <summary>
+ /// True if the library is compiled with assembly optimizations
+ /// </summary>
+ public bool UsesAssemblyCode { get { return 0 != (_flags & 0x200); } }
+
+ /// <summary>
+ /// Gets the size of the unsigned int that was compiled into Zlib
+ /// </summary>
+ public int SizeOfUInt { get { return bitSize(_flags & 3); } }
+
+ /// <summary>
+ /// Gets the size of the unsigned long that was compiled into Zlib
+ /// </summary>
+ public int SizeOfULong { get { return bitSize((_flags >> 2) & 3); } }
+
+ /// <summary>
+ /// Gets the size of the pointers that were compiled into Zlib
+ /// </summary>
+ public int SizeOfPointer { get { return bitSize((_flags >> 4) & 3); } }
+
+ /// <summary>
+ /// Gets the size of the z_off_t type that was compiled into Zlib
+ /// </summary>
+ public int SizeOfOffset { get { return bitSize((_flags >> 6) & 3); } }
+
+ /// <summary>
+ /// Gets the version of ZLib as a string, e.g. "1.2.1"
+ /// </summary>
+ public static string Version { get { return zlibVersion(); } }
+ }
+
+ #endregion
+
+}
diff --git a/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/DotZLib.csproj b/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/DotZLib.csproj
new file mode 100644
index 0000000000..71eeb8590a
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/DotZLib.csproj
@@ -0,0 +1,141 @@
+<VisualStudioProject>
+ <CSHARP
+ ProjectType = "Local"
+ ProductVersion = "7.10.3077"
+ SchemaVersion = "2.0"
+ ProjectGuid = "{BB1EE0B1-1808-46CB-B786-949D91117FC5}"
+ >
+ <Build>
+ <Settings
+ ApplicationIcon = ""
+ AssemblyKeyContainerName = ""
+ AssemblyName = "DotZLib"
+ AssemblyOriginatorKeyFile = ""
+ DefaultClientScript = "JScript"
+ DefaultHTMLPageLayout = "Grid"
+ DefaultTargetSchema = "IE50"
+ DelaySign = "false"
+ OutputType = "Library"
+ PreBuildEvent = ""
+ PostBuildEvent = ""
+ RootNamespace = "DotZLib"
+ RunPostBuildEvent = "OnBuildSuccess"
+ StartupObject = ""
+ >
+ <Config
+ Name = "Debug"
+ AllowUnsafeBlocks = "false"
+ BaseAddress = "285212672"
+ CheckForOverflowUnderflow = "false"
+ ConfigurationOverrideFile = ""
+ DefineConstants = "DEBUG;TRACE"
+ DocumentationFile = "docs\DotZLib.xml"
+ DebugSymbols = "true"
+ FileAlignment = "4096"
+ IncrementalBuild = "false"
+ NoStdLib = "false"
+ NoWarn = "1591"
+ Optimize = "false"
+ OutputPath = "bin\Debug\"
+ RegisterForComInterop = "false"
+ RemoveIntegerChecks = "false"
+ TreatWarningsAsErrors = "false"
+ WarningLevel = "4"
+ />
+ <Config
+ Name = "Release"
+ AllowUnsafeBlocks = "false"
+ BaseAddress = "285212672"
+ CheckForOverflowUnderflow = "false"
+ ConfigurationOverrideFile = ""
+ DefineConstants = "TRACE"
+ DocumentationFile = "docs\DotZLib.xml"
+ DebugSymbols = "false"
+ FileAlignment = "4096"
+ IncrementalBuild = "false"
+ NoStdLib = "false"
+ NoWarn = ""
+ Optimize = "true"
+ OutputPath = "bin\Release\"
+ RegisterForComInterop = "false"
+ RemoveIntegerChecks = "false"
+ TreatWarningsAsErrors = "false"
+ WarningLevel = "4"
+ />
+ </Settings>
+ <References>
+ <Reference
+ Name = "System"
+ AssemblyName = "System"
+ HintPath = "C:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.dll"
+ />
+ <Reference
+ Name = "System.Data"
+ AssemblyName = "System.Data"
+ HintPath = "C:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"
+ />
+ <Reference
+ Name = "System.XML"
+ AssemblyName = "System.Xml"
+ HintPath = "C:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.XML.dll"
+ />
+ <Reference
+ Name = "nunit.framework"
+ AssemblyName = "nunit.framework"
+ HintPath = "E:\apps\NUnit V2.1\\bin\nunit.framework.dll"
+ AssemblyFolderKey = "hklm\dn\nunit.framework"
+ />
+ </References>
+ </Build>
+ <Files>
+ <Include>
+ <File
+ RelPath = "AssemblyInfo.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "ChecksumImpl.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "CircularBuffer.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "CodecBase.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "Deflater.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "DotZLib.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "GZipStream.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "Inflater.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "UnitTests.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ </Include>
+ </Files>
+ </CSHARP>
+</VisualStudioProject>
+
diff --git a/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/GZipStream.cs b/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/GZipStream.cs
new file mode 100644
index 0000000000..b161300b18
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/GZipStream.cs
@@ -0,0 +1,301 @@
+//
+// © Copyright Henrik Ravn 2004
+//
+// Use, modification and distribution are subject to the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+using System;
+using System.IO;
+using System.Runtime.InteropServices;
+
+namespace DotZLib
+{
+ /// <summary>
+ /// Implements a compressed <see cref="Stream"/>, in GZip (.gz) format.
+ /// </summary>
+ public class GZipStream : Stream, IDisposable
+ {
+ #region Dll Imports
+ [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)]
+ private static extern IntPtr gzopen(string name, string mode);
+
+ [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
+ private static extern int gzclose(IntPtr gzFile);
+
+ [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
+ private static extern int gzwrite(IntPtr gzFile, int data, int length);
+
+ [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
+ private static extern int gzread(IntPtr gzFile, int data, int length);
+
+ [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
+ private static extern int gzgetc(IntPtr gzFile);
+
+ [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
+ private static extern int gzputc(IntPtr gzFile, int c);
+
+ #endregion
+
+ #region Private data
+ private IntPtr _gzFile;
+ private bool _isDisposed = false;
+ private bool _isWriting;
+ #endregion
+
+ #region Constructors
+ /// <summary>
+ /// Creates a new file as a writeable GZipStream
+ /// </summary>
+ /// <param name="fileName">The name of the compressed file to create</param>
+ /// <param name="level">The compression level to use when adding data</param>
+ /// <exception cref="ZLibException">If an error occurred in the internal zlib function</exception>
+ public GZipStream(string fileName, CompressLevel level)
+ {
+ _isWriting = true;
+ _gzFile = gzopen(fileName, String.Format("wb{0}", (int)level));
+ if (_gzFile == IntPtr.Zero)
+ throw new ZLibException(-1, "Could not open " + fileName);
+ }
+
+ /// <summary>
+ /// Opens an existing file as a readable GZipStream
+ /// </summary>
+ /// <param name="fileName">The name of the file to open</param>
+ /// <exception cref="ZLibException">If an error occurred in the internal zlib function</exception>
+ public GZipStream(string fileName)
+ {
+ _isWriting = false;
+ _gzFile = gzopen(fileName, "rb");
+ if (_gzFile == IntPtr.Zero)
+ throw new ZLibException(-1, "Could not open " + fileName);
+
+ }
+ #endregion
+
+ #region Access properties
+ /// <summary>
+ /// Returns true of this stream can be read from, false otherwise
+ /// </summary>
+ public override bool CanRead
+ {
+ get
+ {
+ return !_isWriting;
+ }
+ }
+
+
+ /// <summary>
+ /// Returns false.
+ /// </summary>
+ public override bool CanSeek
+ {
+ get
+ {
+ return false;
+ }
+ }
+
+ /// <summary>
+ /// Returns true if this tsream is writeable, false otherwise
+ /// </summary>
+ public override bool CanWrite
+ {
+ get
+ {
+ return _isWriting;
+ }
+ }
+ #endregion
+
+ #region Destructor & IDispose stuff
+
+ /// <summary>
+ /// Destroys this instance
+ /// </summary>
+ ~GZipStream()
+ {
+ cleanUp(false);
+ }
+
+ /// <summary>
+ /// Closes the external file handle
+ /// </summary>
+ public void Dispose()
+ {
+ cleanUp(true);
+ }
+
+ // Does the actual closing of the file handle.
+ private void cleanUp(bool isDisposing)
+ {
+ if (!_isDisposed)
+ {
+ gzclose(_gzFile);
+ _isDisposed = true;
+ }
+ }
+ #endregion
+
+ #region Basic reading and writing
+ /// <summary>
+ /// Attempts to read a number of bytes from the stream.
+ /// </summary>
+ /// <param name="buffer">The destination data buffer</param>
+ /// <param name="offset">The index of the first destination byte in <c>buffer</c></param>
+ /// <param name="count">The number of bytes requested</param>
+ /// <returns>The number of bytes read</returns>
+ /// <exception cref="ArgumentNullException">If <c>buffer</c> is null</exception>
+ /// <exception cref="ArgumentOutOfRangeException">If <c>count</c> or <c>offset</c> are negative</exception>
+ /// <exception cref="ArgumentException">If <c>offset</c> + <c>count</c> is &gt; buffer.Length</exception>
+ /// <exception cref="NotSupportedException">If this stream is not readable.</exception>
+ /// <exception cref="ObjectDisposedException">If this stream has been disposed.</exception>
+ public override int Read(byte[] buffer, int offset, int count)
+ {
+ if (!CanRead) throw new NotSupportedException();
+ if (buffer == null) throw new ArgumentNullException();
+ if (offset < 0 || count < 0) throw new ArgumentOutOfRangeException();
+ if ((offset+count) > buffer.Length) throw new ArgumentException();
+ if (_isDisposed) throw new ObjectDisposedException("GZipStream");
+
+ GCHandle h = GCHandle.Alloc(buffer, GCHandleType.Pinned);
+ int result;
+ try
+ {
+ result = gzread(_gzFile, h.AddrOfPinnedObject().ToInt32() + offset, count);
+ if (result < 0)
+ throw new IOException();
+ }
+ finally
+ {
+ h.Free();
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// Attempts to read a single byte from the stream.
+ /// </summary>
+ /// <returns>The byte that was read, or -1 in case of error or End-Of-File</returns>
+ public override int ReadByte()
+ {
+ if (!CanRead) throw new NotSupportedException();
+ if (_isDisposed) throw new ObjectDisposedException("GZipStream");
+ return gzgetc(_gzFile);
+ }
+
+ /// <summary>
+ /// Writes a number of bytes to the stream
+ /// </summary>
+ /// <param name="buffer"></param>
+ /// <param name="offset"></param>
+ /// <param name="count"></param>
+ /// <exception cref="ArgumentNullException">If <c>buffer</c> is null</exception>
+ /// <exception cref="ArgumentOutOfRangeException">If <c>count</c> or <c>offset</c> are negative</exception>
+ /// <exception cref="ArgumentException">If <c>offset</c> + <c>count</c> is &gt; buffer.Length</exception>
+ /// <exception cref="NotSupportedException">If this stream is not writeable.</exception>
+ /// <exception cref="ObjectDisposedException">If this stream has been disposed.</exception>
+ public override void Write(byte[] buffer, int offset, int count)
+ {
+ if (!CanWrite) throw new NotSupportedException();
+ if (buffer == null) throw new ArgumentNullException();
+ if (offset < 0 || count < 0) throw new ArgumentOutOfRangeException();
+ if ((offset+count) > buffer.Length) throw new ArgumentException();
+ if (_isDisposed) throw new ObjectDisposedException("GZipStream");
+
+ GCHandle h = GCHandle.Alloc(buffer, GCHandleType.Pinned);
+ try
+ {
+ int result = gzwrite(_gzFile, h.AddrOfPinnedObject().ToInt32() + offset, count);
+ if (result < 0)
+ throw new IOException();
+ }
+ finally
+ {
+ h.Free();
+ }
+ }
+
+ /// <summary>
+ /// Writes a single byte to the stream
+ /// </summary>
+ /// <param name="value">The byte to add to the stream.</param>
+ /// <exception cref="NotSupportedException">If this stream is not writeable.</exception>
+ /// <exception cref="ObjectDisposedException">If this stream has been disposed.</exception>
+ public override void WriteByte(byte value)
+ {
+ if (!CanWrite) throw new NotSupportedException();
+ if (_isDisposed) throw new ObjectDisposedException("GZipStream");
+
+ int result = gzputc(_gzFile, (int)value);
+ if (result < 0)
+ throw new IOException();
+ }
+ #endregion
+
+ #region Position & length stuff
+ /// <summary>
+ /// Not supported.
+ /// </summary>
+ /// <param name="value"></param>
+ /// <exception cref="NotSupportedException">Always thrown</exception>
+ public override void SetLength(long value)
+ {
+ throw new NotSupportedException();
+ }
+
+ /// <summary>
+ /// Not suppported.
+ /// </summary>
+ /// <param name="offset"></param>
+ /// <param name="origin"></param>
+ /// <returns></returns>
+ /// <exception cref="NotSupportedException">Always thrown</exception>
+ public override long Seek(long offset, SeekOrigin origin)
+ {
+ throw new NotSupportedException();
+ }
+
+ /// <summary>
+ /// Flushes the <c>GZipStream</c>.
+ /// </summary>
+ /// <remarks>In this implementation, this method does nothing. This is because excessive
+ /// flushing may degrade the achievable compression rates.</remarks>
+ public override void Flush()
+ {
+ // left empty on purpose
+ }
+
+ /// <summary>
+ /// Gets/sets the current position in the <c>GZipStream</c>. Not suppported.
+ /// </summary>
+ /// <remarks>In this implementation this property is not supported</remarks>
+ /// <exception cref="NotSupportedException">Always thrown</exception>
+ public override long Position
+ {
+ get
+ {
+ throw new NotSupportedException();
+ }
+ set
+ {
+ throw new NotSupportedException();
+ }
+ }
+
+ /// <summary>
+ /// Gets the size of the stream. Not suppported.
+ /// </summary>
+ /// <remarks>In this implementation this property is not supported</remarks>
+ /// <exception cref="NotSupportedException">Always thrown</exception>
+ public override long Length
+ {
+ get
+ {
+ throw new NotSupportedException();
+ }
+ }
+ #endregion
+ }
+}
diff --git a/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/Inflater.cs b/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/Inflater.cs
new file mode 100644
index 0000000000..8ed5451d66
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/Inflater.cs
@@ -0,0 +1,105 @@
+//
+// © Copyright Henrik Ravn 2004
+//
+// Use, modification and distribution are subject to the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+using System;
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+
+namespace DotZLib
+{
+
+ /// <summary>
+ /// Implements a data decompressor, using the inflate algorithm in the ZLib dll
+ /// </summary>
+ public class Inflater : CodecBase
+ {
+ #region Dll imports
+ [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)]
+ private static extern int inflateInit_(ref ZStream sz, string vs, int size);
+
+ [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
+ private static extern int inflate(ref ZStream sz, int flush);
+
+ [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
+ private static extern int inflateReset(ref ZStream sz);
+
+ [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
+ private static extern int inflateEnd(ref ZStream sz);
+ #endregion
+
+ /// <summary>
+ /// Constructs an new instance of the <c>Inflater</c>
+ /// </summary>
+ public Inflater() : base()
+ {
+ int retval = inflateInit_(ref _ztream, Info.Version, Marshal.SizeOf(_ztream));
+ if (retval != 0)
+ throw new ZLibException(retval, "Could not initialize inflater");
+
+ resetOutput();
+ }
+
+
+ /// <summary>
+ /// Adds more data to the codec to be processed.
+ /// </summary>
+ /// <param name="data">Byte array containing the data to be added to the codec</param>
+ /// <param name="offset">The index of the first byte to add from <c>data</c></param>
+ /// <param name="count">The number of bytes to add</param>
+ /// <remarks>Adding data may, or may not, raise the <c>DataAvailable</c> event</remarks>
+ public override void Add(byte[] data, int offset, int count)
+ {
+ if (data == null) throw new ArgumentNullException();
+ if (offset < 0 || count < 0) throw new ArgumentOutOfRangeException();
+ if ((offset+count) > data.Length) throw new ArgumentException();
+
+ int total = count;
+ int inputIndex = offset;
+ int err = 0;
+
+ while (err >= 0 && inputIndex < total)
+ {
+ copyInput(data, inputIndex, Math.Min(total - inputIndex, kBufferSize));
+ err = inflate(ref _ztream, (int)FlushTypes.None);
+ if (err == 0)
+ while (_ztream.avail_out == 0)
+ {
+ OnDataAvailable();
+ err = inflate(ref _ztream, (int)FlushTypes.None);
+ }
+
+ inputIndex += (int)_ztream.total_in;
+ }
+ setChecksum( _ztream.adler );
+ }
+
+
+ /// <summary>
+ /// Finishes up any pending data that needs to be processed and handled.
+ /// </summary>
+ public override void Finish()
+ {
+ int err;
+ do
+ {
+ err = inflate(ref _ztream, (int)FlushTypes.Finish);
+ OnDataAvailable();
+ }
+ while (err == 0);
+ setChecksum( _ztream.adler );
+ inflateReset(ref _ztream);
+ resetOutput();
+ }
+
+ /// <summary>
+ /// Closes the internal zlib inflate stream
+ /// </summary>
+ protected override void CleanUp() { inflateEnd(ref _ztream); }
+
+
+ }
+}
diff --git a/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/UnitTests.cs b/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/UnitTests.cs
new file mode 100644
index 0000000000..b273d54b34
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/dotzlib/DotZLib/UnitTests.cs
@@ -0,0 +1,274 @@
+//
+// © Copyright Henrik Ravn 2004
+//
+// Use, modification and distribution are subject to the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+using System;
+using System.Collections;
+using System.IO;
+
+// uncomment the define below to include unit tests
+//#define nunit
+#if nunit
+using NUnit.Framework;
+
+// Unit tests for the DotZLib class library
+// ----------------------------------------
+//
+// Use this with NUnit 2 from http://www.nunit.org
+//
+
+namespace DotZLibTests
+{
+ using DotZLib;
+
+ // helper methods
+ internal class Utils
+ {
+ public static bool byteArrEqual( byte[] lhs, byte[] rhs )
+ {
+ if (lhs.Length != rhs.Length)
+ return false;
+ for (int i = lhs.Length-1; i >= 0; --i)
+ if (lhs[i] != rhs[i])
+ return false;
+ return true;
+ }
+
+ }
+
+
+ [TestFixture]
+ public class CircBufferTests
+ {
+ #region Circular buffer tests
+ [Test]
+ public void SinglePutGet()
+ {
+ CircularBuffer buf = new CircularBuffer(10);
+ Assert.AreEqual( 0, buf.Size );
+ Assert.AreEqual( -1, buf.Get() );
+
+ Assert.IsTrue(buf.Put( 1 ));
+ Assert.AreEqual( 1, buf.Size );
+ Assert.AreEqual( 1, buf.Get() );
+ Assert.AreEqual( 0, buf.Size );
+ Assert.AreEqual( -1, buf.Get() );
+ }
+
+ [Test]
+ public void BlockPutGet()
+ {
+ CircularBuffer buf = new CircularBuffer(10);
+ byte[] arr = {1,2,3,4,5,6,7,8,9,10};
+ Assert.AreEqual( 10, buf.Put(arr,0,10) );
+ Assert.AreEqual( 10, buf.Size );
+ Assert.IsFalse( buf.Put(11) );
+ Assert.AreEqual( 1, buf.Get() );
+ Assert.IsTrue( buf.Put(11) );
+
+ byte[] arr2 = (byte[])arr.Clone();
+ Assert.AreEqual( 9, buf.Get(arr2,1,9) );
+ Assert.IsTrue( Utils.byteArrEqual(arr,arr2) );
+ }
+
+ #endregion
+ }
+
+ [TestFixture]
+ public class ChecksumTests
+ {
+ #region CRC32 Tests
+ [Test]
+ public void CRC32_Null()
+ {
+ CRC32Checksum crc32 = new CRC32Checksum();
+ Assert.AreEqual( 0, crc32.Value );
+
+ crc32 = new CRC32Checksum(1);
+ Assert.AreEqual( 1, crc32.Value );
+
+ crc32 = new CRC32Checksum(556);
+ Assert.AreEqual( 556, crc32.Value );
+ }
+
+ [Test]
+ public void CRC32_Data()
+ {
+ CRC32Checksum crc32 = new CRC32Checksum();
+ byte[] data = { 1,2,3,4,5,6,7 };
+ crc32.Update(data);
+ Assert.AreEqual( 0x70e46888, crc32.Value );
+
+ crc32 = new CRC32Checksum();
+ crc32.Update("penguin");
+ Assert.AreEqual( 0x0e5c1a120, crc32.Value );
+
+ crc32 = new CRC32Checksum(1);
+ crc32.Update("penguin");
+ Assert.AreEqual(0x43b6aa94, crc32.Value);
+
+ }
+ #endregion
+
+ #region Adler tests
+
+ [Test]
+ public void Adler_Null()
+ {
+ AdlerChecksum adler = new AdlerChecksum();
+ Assert.AreEqual(0, adler.Value);
+
+ adler = new AdlerChecksum(1);
+ Assert.AreEqual( 1, adler.Value );
+
+ adler = new AdlerChecksum(556);
+ Assert.AreEqual( 556, adler.Value );
+ }
+
+ [Test]
+ public void Adler_Data()
+ {
+ AdlerChecksum adler = new AdlerChecksum(1);
+ byte[] data = { 1,2,3,4,5,6,7 };
+ adler.Update(data);
+ Assert.AreEqual( 0x5b001d, adler.Value );
+
+ adler = new AdlerChecksum();
+ adler.Update("penguin");
+ Assert.AreEqual(0x0bcf02f6, adler.Value );
+
+ adler = new AdlerChecksum(1);
+ adler.Update("penguin");
+ Assert.AreEqual(0x0bd602f7, adler.Value);
+
+ }
+ #endregion
+ }
+
+ [TestFixture]
+ public class InfoTests
+ {
+ #region Info tests
+ [Test]
+ public void Info_Version()
+ {
+ Info info = new Info();
+ Assert.AreEqual("1.2.8", Info.Version);
+ Assert.AreEqual(32, info.SizeOfUInt);
+ Assert.AreEqual(32, info.SizeOfULong);
+ Assert.AreEqual(32, info.SizeOfPointer);
+ Assert.AreEqual(32, info.SizeOfOffset);
+ }
+ #endregion
+ }
+
+ [TestFixture]
+ public class DeflateInflateTests
+ {
+ #region Deflate tests
+ [Test]
+ public void Deflate_Init()
+ {
+ using (Deflater def = new Deflater(CompressLevel.Default))
+ {
+ }
+ }
+
+ private ArrayList compressedData = new ArrayList();
+ private uint adler1;
+
+ private ArrayList uncompressedData = new ArrayList();
+ private uint adler2;
+
+ public void CDataAvail(byte[] data, int startIndex, int count)
+ {
+ for (int i = 0; i < count; ++i)
+ compressedData.Add(data[i+startIndex]);
+ }
+
+ [Test]
+ public void Deflate_Compress()
+ {
+ compressedData.Clear();
+
+ byte[] testData = new byte[35000];
+ for (int i = 0; i < testData.Length; ++i)
+ testData[i] = 5;
+
+ using (Deflater def = new Deflater((CompressLevel)5))
+ {
+ def.DataAvailable += new DataAvailableHandler(CDataAvail);
+ def.Add(testData);
+ def.Finish();
+ adler1 = def.Checksum;
+ }
+ }
+ #endregion
+
+ #region Inflate tests
+ [Test]
+ public void Inflate_Init()
+ {
+ using (Inflater inf = new Inflater())
+ {
+ }
+ }
+
+ private void DDataAvail(byte[] data, int startIndex, int count)
+ {
+ for (int i = 0; i < count; ++i)
+ uncompressedData.Add(data[i+startIndex]);
+ }
+
+ [Test]
+ public void Inflate_Expand()
+ {
+ uncompressedData.Clear();
+
+ using (Inflater inf = new Inflater())
+ {
+ inf.DataAvailable += new DataAvailableHandler(DDataAvail);
+ inf.Add((byte[])compressedData.ToArray(typeof(byte)));
+ inf.Finish();
+ adler2 = inf.Checksum;
+ }
+ Assert.AreEqual( adler1, adler2 );
+ }
+ #endregion
+ }
+
+ [TestFixture]
+ public class GZipStreamTests
+ {
+ #region GZipStream test
+ [Test]
+ public void GZipStream_WriteRead()
+ {
+ using (GZipStream gzOut = new GZipStream("gzstream.gz", CompressLevel.Best))
+ {
+ BinaryWriter writer = new BinaryWriter(gzOut);
+ writer.Write("hi there");
+ writer.Write(Math.PI);
+ writer.Write(42);
+ }
+
+ using (GZipStream gzIn = new GZipStream("gzstream.gz"))
+ {
+ BinaryReader reader = new BinaryReader(gzIn);
+ string s = reader.ReadString();
+ Assert.AreEqual("hi there",s);
+ double d = reader.ReadDouble();
+ Assert.AreEqual(Math.PI, d);
+ int i = reader.ReadInt32();
+ Assert.AreEqual(42,i);
+ }
+
+ }
+ #endregion
+ }
+}
+
+#endif
diff --git a/protocols/Telegram/tgl/zlib/contrib/dotzlib/LICENSE_1_0.txt b/protocols/Telegram/tgl/zlib/contrib/dotzlib/LICENSE_1_0.txt
new file mode 100644
index 0000000000..30aac2cf47
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/dotzlib/LICENSE_1_0.txt
@@ -0,0 +1,23 @@
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE. \ No newline at end of file
diff --git a/protocols/Telegram/tgl/zlib/contrib/dotzlib/readme.txt b/protocols/Telegram/tgl/zlib/contrib/dotzlib/readme.txt
new file mode 100644
index 0000000000..b2395720d4
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/dotzlib/readme.txt
@@ -0,0 +1,58 @@
+This directory contains a .Net wrapper class library for the ZLib1.dll
+
+The wrapper includes support for inflating/deflating memory buffers,
+.Net streaming wrappers for the gz streams part of zlib, and wrappers
+for the checksum parts of zlib. See DotZLib/UnitTests.cs for examples.
+
+Directory structure:
+--------------------
+
+LICENSE_1_0.txt - License file.
+readme.txt - This file.
+DotZLib.chm - Class library documentation
+DotZLib.build - NAnt build file
+DotZLib.sln - Microsoft Visual Studio 2003 solution file
+
+DotZLib\*.cs - Source files for the class library
+
+Unit tests:
+-----------
+The file DotZLib/UnitTests.cs contains unit tests for use with NUnit 2.1 or higher.
+To include unit tests in the build, define nunit before building.
+
+
+Build instructions:
+-------------------
+
+1. Using Visual Studio.Net 2003:
+ Open DotZLib.sln in VS.Net and build from there. Output file (DotZLib.dll)
+ will be found ./DotZLib/bin/release or ./DotZLib/bin/debug, depending on
+ you are building the release or debug version of the library. Check
+ DotZLib/UnitTests.cs for instructions on how to include unit tests in the
+ build.
+
+2. Using NAnt:
+ Open a command prompt with access to the build environment and run nant
+ in the same directory as the DotZLib.build file.
+ You can define 2 properties on the nant command-line to control the build:
+ debug={true|false} to toggle between release/debug builds (default=true).
+ nunit={true|false} to include or esclude unit tests (default=true).
+ Also the target clean will remove binaries.
+ Output file (DotZLib.dll) will be found in either ./DotZLib/bin/release
+ or ./DotZLib/bin/debug, depending on whether you are building the release
+ or debug version of the library.
+
+ Examples:
+ nant -D:debug=false -D:nunit=false
+ will build a release mode version of the library without unit tests.
+ nant
+ will build a debug version of the library with unit tests
+ nant clean
+ will remove all previously built files.
+
+
+---------------------------------
+Copyright (c) Henrik Ravn 2004
+
+Use, modification and distribution are subject to the Boost Software License, Version 1.0.
+(See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tgl/zlib/contrib/gcc_gvmat64/gvmat64.S b/protocols/Telegram/tgl/zlib/contrib/gcc_gvmat64/gvmat64.S
new file mode 100644
index 0000000000..dd858ddbd1
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/gcc_gvmat64/gvmat64.S
@@ -0,0 +1,574 @@
+/*
+;uInt longest_match_x64(
+; deflate_state *s,
+; IPos cur_match); // current match
+
+; gvmat64.S -- Asm portion of the optimized longest_match for 32 bits x86_64
+; (AMD64 on Athlon 64, Opteron, Phenom
+; and Intel EM64T on Pentium 4 with EM64T, Pentium D, Core 2 Duo, Core I5/I7)
+; this file is translation from gvmat64.asm to GCC 4.x (for Linux, Mac XCode)
+; Copyright (C) 1995-2010 Jean-loup Gailly, Brian Raiter and Gilles Vollant.
+;
+; File written by Gilles Vollant, by converting to assembly the longest_match
+; from Jean-loup Gailly in deflate.c of zLib and infoZip zip.
+; and by taking inspiration on asm686 with masm, optimised assembly code
+; from Brian Raiter, written 1998
+;
+; This software is provided 'as-is', without any express or implied
+; warranty. In no event will the authors be held liable for any damages
+; arising from the use of this software.
+;
+; Permission is granted to anyone to use this software for any purpose,
+; including commercial applications, and to alter it and redistribute it
+; freely, subject to the following restrictions:
+;
+; 1. The origin of this software must not be misrepresented; you must not
+; claim that you wrote the original software. If you use this software
+; in a product, an acknowledgment in the product documentation would be
+; appreciated but is not required.
+; 2. Altered source versions must be plainly marked as such, and must not be
+; misrepresented as being the original software
+; 3. This notice may not be removed or altered from any source distribution.
+;
+; http://www.zlib.net
+; http://www.winimage.com/zLibDll
+; http://www.muppetlabs.com/~breadbox/software/assembly.html
+;
+; to compile this file for zLib, I use option:
+; gcc -c -arch x86_64 gvmat64.S
+
+
+;uInt longest_match(s, cur_match)
+; deflate_state *s;
+; IPos cur_match; // current match /
+;
+; with XCode for Mac, I had strange error with some jump on intel syntax
+; this is why BEFORE_JMP and AFTER_JMP are used
+ */
+
+
+#define BEFORE_JMP .att_syntax
+#define AFTER_JMP .intel_syntax noprefix
+
+#ifndef NO_UNDERLINE
+# define match_init _match_init
+# define longest_match _longest_match
+#endif
+
+.intel_syntax noprefix
+
+.globl match_init, longest_match
+.text
+longest_match:
+
+
+
+#define LocalVarsSize 96
+/*
+; register used : rax,rbx,rcx,rdx,rsi,rdi,r8,r9,r10,r11,r12
+; free register : r14,r15
+; register can be saved : rsp
+*/
+
+#define chainlenwmask (rsp + 8 - LocalVarsSize)
+#define nicematch (rsp + 16 - LocalVarsSize)
+
+#define save_rdi (rsp + 24 - LocalVarsSize)
+#define save_rsi (rsp + 32 - LocalVarsSize)
+#define save_rbx (rsp + 40 - LocalVarsSize)
+#define save_rbp (rsp + 48 - LocalVarsSize)
+#define save_r12 (rsp + 56 - LocalVarsSize)
+#define save_r13 (rsp + 64 - LocalVarsSize)
+#define save_r14 (rsp + 72 - LocalVarsSize)
+#define save_r15 (rsp + 80 - LocalVarsSize)
+
+
+/*
+; all the +4 offsets are due to the addition of pending_buf_size (in zlib
+; in the deflate_state structure since the asm code was first written
+; (if you compile with zlib 1.0.4 or older, remove the +4).
+; Note : these value are good with a 8 bytes boundary pack structure
+*/
+
+#define MAX_MATCH 258
+#define MIN_MATCH 3
+#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
+
+/*
+;;; Offsets for fields in the deflate_state structure. These numbers
+;;; are calculated from the definition of deflate_state, with the
+;;; assumption that the compiler will dword-align the fields. (Thus,
+;;; changing the definition of deflate_state could easily cause this
+;;; program to crash horribly, without so much as a warning at
+;;; compile time. Sigh.)
+
+; all the +zlib1222add offsets are due to the addition of fields
+; in zlib in the deflate_state structure since the asm code was first written
+; (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)").
+; (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0").
+; if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8").
+*/
+
+
+
+/* you can check the structure offset by running
+
+#include <stdlib.h>
+#include <stdio.h>
+#include "deflate.h"
+
+void print_depl()
+{
+deflate_state ds;
+deflate_state *s=&ds;
+printf("size pointer=%u\n",(int)sizeof(void*));
+
+printf("#define dsWSize %u\n",(int)(((char*)&(s->w_size))-((char*)s)));
+printf("#define dsWMask %u\n",(int)(((char*)&(s->w_mask))-((char*)s)));
+printf("#define dsWindow %u\n",(int)(((char*)&(s->window))-((char*)s)));
+printf("#define dsPrev %u\n",(int)(((char*)&(s->prev))-((char*)s)));
+printf("#define dsMatchLen %u\n",(int)(((char*)&(s->match_length))-((char*)s)));
+printf("#define dsPrevMatch %u\n",(int)(((char*)&(s->prev_match))-((char*)s)));
+printf("#define dsStrStart %u\n",(int)(((char*)&(s->strstart))-((char*)s)));
+printf("#define dsMatchStart %u\n",(int)(((char*)&(s->match_start))-((char*)s)));
+printf("#define dsLookahead %u\n",(int)(((char*)&(s->lookahead))-((char*)s)));
+printf("#define dsPrevLen %u\n",(int)(((char*)&(s->prev_length))-((char*)s)));
+printf("#define dsMaxChainLen %u\n",(int)(((char*)&(s->max_chain_length))-((char*)s)));
+printf("#define dsGoodMatch %u\n",(int)(((char*)&(s->good_match))-((char*)s)));
+printf("#define dsNiceMatch %u\n",(int)(((char*)&(s->nice_match))-((char*)s)));
+}
+*/
+
+#define dsWSize 68
+#define dsWMask 76
+#define dsWindow 80
+#define dsPrev 96
+#define dsMatchLen 144
+#define dsPrevMatch 148
+#define dsStrStart 156
+#define dsMatchStart 160
+#define dsLookahead 164
+#define dsPrevLen 168
+#define dsMaxChainLen 172
+#define dsGoodMatch 188
+#define dsNiceMatch 192
+
+#define window_size [ rcx + dsWSize]
+#define WMask [ rcx + dsWMask]
+#define window_ad [ rcx + dsWindow]
+#define prev_ad [ rcx + dsPrev]
+#define strstart [ rcx + dsStrStart]
+#define match_start [ rcx + dsMatchStart]
+#define Lookahead [ rcx + dsLookahead] //; 0ffffffffh on infozip
+#define prev_length [ rcx + dsPrevLen]
+#define max_chain_length [ rcx + dsMaxChainLen]
+#define good_match [ rcx + dsGoodMatch]
+#define nice_match [ rcx + dsNiceMatch]
+
+/*
+; windows:
+; parameter 1 in rcx(deflate state s), param 2 in rdx (cur match)
+
+; see http://weblogs.asp.net/oldnewthing/archive/2004/01/14/58579.aspx and
+; http://msdn.microsoft.com/library/en-us/kmarch/hh/kmarch/64bitAMD_8e951dd2-ee77-4728-8702-55ce4b5dd24a.xml.asp
+;
+; All registers must be preserved across the call, except for
+; rax, rcx, rdx, r8, r9, r10, and r11, which are scratch.
+
+;
+; gcc on macosx-linux:
+; see http://www.x86-64.org/documentation/abi-0.99.pdf
+; param 1 in rdi, param 2 in rsi
+; rbx, rsp, rbp, r12 to r15 must be preserved
+
+;;; Save registers that the compiler may be using, and adjust esp to
+;;; make room for our stack frame.
+
+
+;;; Retrieve the function arguments. r8d will hold cur_match
+;;; throughout the entire function. edx will hold the pointer to the
+;;; deflate_state structure during the function's setup (before
+;;; entering the main loop.
+
+; ms: parameter 1 in rcx (deflate_state* s), param 2 in edx -> r8 (cur match)
+; mac: param 1 in rdi, param 2 rsi
+; this clear high 32 bits of r8, which can be garbage in both r8 and rdx
+*/
+ mov [save_rbx],rbx
+ mov [save_rbp],rbp
+
+
+ mov rcx,rdi
+
+ mov r8d,esi
+
+
+ mov [save_r12],r12
+ mov [save_r13],r13
+ mov [save_r14],r14
+ mov [save_r15],r15
+
+
+//;;; uInt wmask = s->w_mask;
+//;;; unsigned chain_length = s->max_chain_length;
+//;;; if (s->prev_length >= s->good_match) {
+//;;; chain_length >>= 2;
+//;;; }
+
+
+ mov edi, prev_length
+ mov esi, good_match
+ mov eax, WMask
+ mov ebx, max_chain_length
+ cmp edi, esi
+ jl LastMatchGood
+ shr ebx, 2
+LastMatchGood:
+
+//;;; chainlen is decremented once beforehand so that the function can
+//;;; use the sign flag instead of the zero flag for the exit test.
+//;;; It is then shifted into the high word, to make room for the wmask
+//;;; value, which it will always accompany.
+
+ dec ebx
+ shl ebx, 16
+ or ebx, eax
+
+//;;; on zlib only
+//;;; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
+
+
+
+ mov eax, nice_match
+ mov [chainlenwmask], ebx
+ mov r10d, Lookahead
+ cmp r10d, eax
+ cmovnl r10d, eax
+ mov [nicematch],r10d
+
+
+
+//;;; register Bytef *scan = s->window + s->strstart;
+ mov r10, window_ad
+ mov ebp, strstart
+ lea r13, [r10 + rbp]
+
+//;;; Determine how many bytes the scan ptr is off from being
+//;;; dword-aligned.
+
+ mov r9,r13
+ neg r13
+ and r13,3
+
+//;;; IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
+//;;; s->strstart - (IPos)MAX_DIST(s) : NIL;
+
+
+ mov eax, window_size
+ sub eax, MIN_LOOKAHEAD
+
+
+ xor edi,edi
+ sub ebp, eax
+
+ mov r11d, prev_length
+
+ cmovng ebp,edi
+
+//;;; int best_len = s->prev_length;
+
+
+//;;; Store the sum of s->window + best_len in esi locally, and in esi.
+
+ lea rsi,[r10+r11]
+
+//;;; register ush scan_start = *(ushf*)scan;
+//;;; register ush scan_end = *(ushf*)(scan+best_len-1);
+//;;; Posf *prev = s->prev;
+
+ movzx r12d,word ptr [r9]
+ movzx ebx, word ptr [r9 + r11 - 1]
+
+ mov rdi, prev_ad
+
+//;;; Jump into the main loop.
+
+ mov edx, [chainlenwmask]
+
+ cmp bx,word ptr [rsi + r8 - 1]
+ jz LookupLoopIsZero
+
+
+
+LookupLoop1:
+ and r8d, edx
+
+ movzx r8d, word ptr [rdi + r8*2]
+ cmp r8d, ebp
+ jbe LeaveNow
+
+
+
+ sub edx, 0x00010000
+ BEFORE_JMP
+ js LeaveNow
+ AFTER_JMP
+
+LoopEntry1:
+ cmp bx,word ptr [rsi + r8 - 1]
+ BEFORE_JMP
+ jz LookupLoopIsZero
+ AFTER_JMP
+
+LookupLoop2:
+ and r8d, edx
+
+ movzx r8d, word ptr [rdi + r8*2]
+ cmp r8d, ebp
+ BEFORE_JMP
+ jbe LeaveNow
+ AFTER_JMP
+ sub edx, 0x00010000
+ BEFORE_JMP
+ js LeaveNow
+ AFTER_JMP
+
+LoopEntry2:
+ cmp bx,word ptr [rsi + r8 - 1]
+ BEFORE_JMP
+ jz LookupLoopIsZero
+ AFTER_JMP
+
+LookupLoop4:
+ and r8d, edx
+
+ movzx r8d, word ptr [rdi + r8*2]
+ cmp r8d, ebp
+ BEFORE_JMP
+ jbe LeaveNow
+ AFTER_JMP
+ sub edx, 0x00010000
+ BEFORE_JMP
+ js LeaveNow
+ AFTER_JMP
+
+LoopEntry4:
+
+ cmp bx,word ptr [rsi + r8 - 1]
+ BEFORE_JMP
+ jnz LookupLoop1
+ jmp LookupLoopIsZero
+ AFTER_JMP
+/*
+;;; do {
+;;; match = s->window + cur_match;
+;;; if (*(ushf*)(match+best_len-1) != scan_end ||
+;;; *(ushf*)match != scan_start) continue;
+;;; [...]
+;;; } while ((cur_match = prev[cur_match & wmask]) > limit
+;;; && --chain_length != 0);
+;;;
+;;; Here is the inner loop of the function. The function will spend the
+;;; majority of its time in this loop, and majority of that time will
+;;; be spent in the first ten instructions.
+;;;
+;;; Within this loop:
+;;; ebx = scanend
+;;; r8d = curmatch
+;;; edx = chainlenwmask - i.e., ((chainlen << 16) | wmask)
+;;; esi = windowbestlen - i.e., (window + bestlen)
+;;; edi = prev
+;;; ebp = limit
+*/
+.balign 16
+LookupLoop:
+ and r8d, edx
+
+ movzx r8d, word ptr [rdi + r8*2]
+ cmp r8d, ebp
+ BEFORE_JMP
+ jbe LeaveNow
+ AFTER_JMP
+ sub edx, 0x00010000
+ BEFORE_JMP
+ js LeaveNow
+ AFTER_JMP
+
+LoopEntry:
+
+ cmp bx,word ptr [rsi + r8 - 1]
+ BEFORE_JMP
+ jnz LookupLoop1
+ AFTER_JMP
+LookupLoopIsZero:
+ cmp r12w, word ptr [r10 + r8]
+ BEFORE_JMP
+ jnz LookupLoop1
+ AFTER_JMP
+
+
+//;;; Store the current value of chainlen.
+ mov [chainlenwmask], edx
+/*
+;;; Point edi to the string under scrutiny, and esi to the string we
+;;; are hoping to match it up with. In actuality, esi and edi are
+;;; both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and edx is
+;;; initialized to -(MAX_MATCH_8 - scanalign).
+*/
+ lea rsi,[r8+r10]
+ mov rdx, 0xfffffffffffffef8 //; -(MAX_MATCH_8)
+ lea rsi, [rsi + r13 + 0x0108] //;MAX_MATCH_8]
+ lea rdi, [r9 + r13 + 0x0108] //;MAX_MATCH_8]
+
+ prefetcht1 [rsi+rdx]
+ prefetcht1 [rdi+rdx]
+
+/*
+;;; Test the strings for equality, 8 bytes at a time. At the end,
+;;; adjust rdx so that it is offset to the exact byte that mismatched.
+;;;
+;;; We already know at this point that the first three bytes of the
+;;; strings match each other, and they can be safely passed over before
+;;; starting the compare loop. So what this code does is skip over 0-3
+;;; bytes, as much as necessary in order to dword-align the edi
+;;; pointer. (rsi will still be misaligned three times out of four.)
+;;;
+;;; It should be confessed that this loop usually does not represent
+;;; much of the total running time. Replacing it with a more
+;;; straightforward "rep cmpsb" would not drastically degrade
+;;; performance.
+*/
+
+LoopCmps:
+ mov rax, [rsi + rdx]
+ xor rax, [rdi + rdx]
+ jnz LeaveLoopCmps
+
+ mov rax, [rsi + rdx + 8]
+ xor rax, [rdi + rdx + 8]
+ jnz LeaveLoopCmps8
+
+
+ mov rax, [rsi + rdx + 8+8]
+ xor rax, [rdi + rdx + 8+8]
+ jnz LeaveLoopCmps16
+
+ add rdx,8+8+8
+
+ BEFORE_JMP
+ jnz LoopCmps
+ jmp LenMaximum
+ AFTER_JMP
+
+LeaveLoopCmps16: add rdx,8
+LeaveLoopCmps8: add rdx,8
+LeaveLoopCmps:
+
+ test eax, 0x0000FFFF
+ jnz LenLower
+
+ test eax,0xffffffff
+
+ jnz LenLower32
+
+ add rdx,4
+ shr rax,32
+ or ax,ax
+ BEFORE_JMP
+ jnz LenLower
+ AFTER_JMP
+
+LenLower32:
+ shr eax,16
+ add rdx,2
+
+LenLower:
+ sub al, 1
+ adc rdx, 0
+//;;; Calculate the length of the match. If it is longer than MAX_MATCH,
+//;;; then automatically accept it as the best possible match and leave.
+
+ lea rax, [rdi + rdx]
+ sub rax, r9
+ cmp eax, MAX_MATCH
+ BEFORE_JMP
+ jge LenMaximum
+ AFTER_JMP
+/*
+;;; If the length of the match is not longer than the best match we
+;;; have so far, then forget it and return to the lookup loop.
+;///////////////////////////////////
+*/
+ cmp eax, r11d
+ jg LongerMatch
+
+ lea rsi,[r10+r11]
+
+ mov rdi, prev_ad
+ mov edx, [chainlenwmask]
+ BEFORE_JMP
+ jmp LookupLoop
+ AFTER_JMP
+/*
+;;; s->match_start = cur_match;
+;;; best_len = len;
+;;; if (len >= nice_match) break;
+;;; scan_end = *(ushf*)(scan+best_len-1);
+*/
+LongerMatch:
+ mov r11d, eax
+ mov match_start, r8d
+ cmp eax, [nicematch]
+ BEFORE_JMP
+ jge LeaveNow
+ AFTER_JMP
+
+ lea rsi,[r10+rax]
+
+ movzx ebx, word ptr [r9 + rax - 1]
+ mov rdi, prev_ad
+ mov edx, [chainlenwmask]
+ BEFORE_JMP
+ jmp LookupLoop
+ AFTER_JMP
+
+//;;; Accept the current string, with the maximum possible length.
+
+LenMaximum:
+ mov r11d,MAX_MATCH
+ mov match_start, r8d
+
+//;;; if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
+//;;; return s->lookahead;
+
+LeaveNow:
+ mov eax, Lookahead
+ cmp r11d, eax
+ cmovng eax, r11d
+
+
+
+//;;; Restore the stack and return from whence we came.
+
+
+// mov rsi,[save_rsi]
+// mov rdi,[save_rdi]
+ mov rbx,[save_rbx]
+ mov rbp,[save_rbp]
+ mov r12,[save_r12]
+ mov r13,[save_r13]
+ mov r14,[save_r14]
+ mov r15,[save_r15]
+
+
+ ret 0
+//; please don't remove this string !
+//; Your can freely use gvmat64 in any free or commercial app
+//; but it is far better don't remove the string in the binary!
+ // db 0dh,0ah,"asm686 with masm, optimised assembly code from Brian Raiter, written 1998, converted to amd 64 by Gilles Vollant 2005",0dh,0ah,0
+
+
+match_init:
+ ret 0
+
+
diff --git a/protocols/Telegram/tgl/zlib/contrib/infback9/README b/protocols/Telegram/tgl/zlib/contrib/infback9/README
new file mode 100644
index 0000000000..e75ed13294
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/infback9/README
@@ -0,0 +1 @@
+See infback9.h for what this is and how to use it.
diff --git a/protocols/Telegram/tgl/zlib/contrib/infback9/infback9.c b/protocols/Telegram/tgl/zlib/contrib/infback9/infback9.c
new file mode 100644
index 0000000000..05fb3e3380
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/infback9/infback9.c
@@ -0,0 +1,615 @@
+/* infback9.c -- inflate deflate64 data using a call-back interface
+ * Copyright (C) 1995-2008 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "infback9.h"
+#include "inftree9.h"
+#include "inflate9.h"
+
+#define WSIZE 65536UL
+
+/*
+ strm provides memory allocation functions in zalloc and zfree, or
+ Z_NULL to use the library memory allocation functions.
+
+ window is a user-supplied window and output buffer that is 64K bytes.
+ */
+int ZEXPORT inflateBack9Init_(strm, window, version, stream_size)
+z_stream FAR *strm;
+unsigned char FAR *window;
+const char *version;
+int stream_size;
+{
+ struct inflate_state FAR *state;
+
+ if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
+ stream_size != (int)(sizeof(z_stream)))
+ return Z_VERSION_ERROR;
+ if (strm == Z_NULL || window == Z_NULL)
+ return Z_STREAM_ERROR;
+ strm->msg = Z_NULL; /* in case we return an error */
+ if (strm->zalloc == (alloc_func)0) {
+ strm->zalloc = zcalloc;
+ strm->opaque = (voidpf)0;
+ }
+ if (strm->zfree == (free_func)0) strm->zfree = zcfree;
+ state = (struct inflate_state FAR *)ZALLOC(strm, 1,
+ sizeof(struct inflate_state));
+ if (state == Z_NULL) return Z_MEM_ERROR;
+ Tracev((stderr, "inflate: allocated\n"));
+ strm->state = (voidpf)state;
+ state->window = window;
+ return Z_OK;
+}
+
+/*
+ Build and output length and distance decoding tables for fixed code
+ decoding.
+ */
+#ifdef MAKEFIXED
+#include <stdio.h>
+
+void makefixed9(void)
+{
+ unsigned sym, bits, low, size;
+ code *next, *lenfix, *distfix;
+ struct inflate_state state;
+ code fixed[544];
+
+ /* literal/length table */
+ sym = 0;
+ while (sym < 144) state.lens[sym++] = 8;
+ while (sym < 256) state.lens[sym++] = 9;
+ while (sym < 280) state.lens[sym++] = 7;
+ while (sym < 288) state.lens[sym++] = 8;
+ next = fixed;
+ lenfix = next;
+ bits = 9;
+ inflate_table9(LENS, state.lens, 288, &(next), &(bits), state.work);
+
+ /* distance table */
+ sym = 0;
+ while (sym < 32) state.lens[sym++] = 5;
+ distfix = next;
+ bits = 5;
+ inflate_table9(DISTS, state.lens, 32, &(next), &(bits), state.work);
+
+ /* write tables */
+ puts(" /* inffix9.h -- table for decoding deflate64 fixed codes");
+ puts(" * Generated automatically by makefixed9().");
+ puts(" */");
+ puts("");
+ puts(" /* WARNING: this file should *not* be used by applications.");
+ puts(" It is part of the implementation of this library and is");
+ puts(" subject to change. Applications should only use zlib.h.");
+ puts(" */");
+ puts("");
+ size = 1U << 9;
+ printf(" static const code lenfix[%u] = {", size);
+ low = 0;
+ for (;;) {
+ if ((low % 6) == 0) printf("\n ");
+ printf("{%u,%u,%d}", lenfix[low].op, lenfix[low].bits,
+ lenfix[low].val);
+ if (++low == size) break;
+ putchar(',');
+ }
+ puts("\n };");
+ size = 1U << 5;
+ printf("\n static const code distfix[%u] = {", size);
+ low = 0;
+ for (;;) {
+ if ((low % 5) == 0) printf("\n ");
+ printf("{%u,%u,%d}", distfix[low].op, distfix[low].bits,
+ distfix[low].val);
+ if (++low == size) break;
+ putchar(',');
+ }
+ puts("\n };");
+}
+#endif /* MAKEFIXED */
+
+/* Macros for inflateBack(): */
+
+/* Clear the input bit accumulator */
+#define INITBITS() \
+ do { \
+ hold = 0; \
+ bits = 0; \
+ } while (0)
+
+/* Assure that some input is available. If input is requested, but denied,
+ then return a Z_BUF_ERROR from inflateBack(). */
+#define PULL() \
+ do { \
+ if (have == 0) { \
+ have = in(in_desc, &next); \
+ if (have == 0) { \
+ next = Z_NULL; \
+ ret = Z_BUF_ERROR; \
+ goto inf_leave; \
+ } \
+ } \
+ } while (0)
+
+/* Get a byte of input into the bit accumulator, or return from inflateBack()
+ with an error if there is no input available. */
+#define PULLBYTE() \
+ do { \
+ PULL(); \
+ have--; \
+ hold += (unsigned long)(*next++) << bits; \
+ bits += 8; \
+ } while (0)
+
+/* Assure that there are at least n bits in the bit accumulator. If there is
+ not enough available input to do that, then return from inflateBack() with
+ an error. */
+#define NEEDBITS(n) \
+ do { \
+ while (bits < (unsigned)(n)) \
+ PULLBYTE(); \
+ } while (0)
+
+/* Return the low n bits of the bit accumulator (n <= 16) */
+#define BITS(n) \
+ ((unsigned)hold & ((1U << (n)) - 1))
+
+/* Remove n bits from the bit accumulator */
+#define DROPBITS(n) \
+ do { \
+ hold >>= (n); \
+ bits -= (unsigned)(n); \
+ } while (0)
+
+/* Remove zero to seven bits as needed to go to a byte boundary */
+#define BYTEBITS() \
+ do { \
+ hold >>= bits & 7; \
+ bits -= bits & 7; \
+ } while (0)
+
+/* Assure that some output space is available, by writing out the window
+ if it's full. If the write fails, return from inflateBack() with a
+ Z_BUF_ERROR. */
+#define ROOM() \
+ do { \
+ if (left == 0) { \
+ put = window; \
+ left = WSIZE; \
+ wrap = 1; \
+ if (out(out_desc, put, (unsigned)left)) { \
+ ret = Z_BUF_ERROR; \
+ goto inf_leave; \
+ } \
+ } \
+ } while (0)
+
+/*
+ strm provides the memory allocation functions and window buffer on input,
+ and provides information on the unused input on return. For Z_DATA_ERROR
+ returns, strm will also provide an error message.
+
+ in() and out() are the call-back input and output functions. When
+ inflateBack() needs more input, it calls in(). When inflateBack() has
+ filled the window with output, or when it completes with data in the
+ window, it calls out() to write out the data. The application must not
+ change the provided input until in() is called again or inflateBack()
+ returns. The application must not change the window/output buffer until
+ inflateBack() returns.
+
+ in() and out() are called with a descriptor parameter provided in the
+ inflateBack() call. This parameter can be a structure that provides the
+ information required to do the read or write, as well as accumulated
+ information on the input and output such as totals and check values.
+
+ in() should return zero on failure. out() should return non-zero on
+ failure. If either in() or out() fails, than inflateBack() returns a
+ Z_BUF_ERROR. strm->next_in can be checked for Z_NULL to see whether it
+ was in() or out() that caused in the error. Otherwise, inflateBack()
+ returns Z_STREAM_END on success, Z_DATA_ERROR for an deflate format
+ error, or Z_MEM_ERROR if it could not allocate memory for the state.
+ inflateBack() can also return Z_STREAM_ERROR if the input parameters
+ are not correct, i.e. strm is Z_NULL or the state was not initialized.
+ */
+int ZEXPORT inflateBack9(strm, in, in_desc, out, out_desc)
+z_stream FAR *strm;
+in_func in;
+void FAR *in_desc;
+out_func out;
+void FAR *out_desc;
+{
+ struct inflate_state FAR *state;
+ z_const unsigned char FAR *next; /* next input */
+ unsigned char FAR *put; /* next output */
+ unsigned have; /* available input */
+ unsigned long left; /* available output */
+ inflate_mode mode; /* current inflate mode */
+ int lastblock; /* true if processing last block */
+ int wrap; /* true if the window has wrapped */
+ unsigned char FAR *window; /* allocated sliding window, if needed */
+ unsigned long hold; /* bit buffer */
+ unsigned bits; /* bits in bit buffer */
+ unsigned extra; /* extra bits needed */
+ unsigned long length; /* literal or length of data to copy */
+ unsigned long offset; /* distance back to copy string from */
+ unsigned long copy; /* number of stored or match bytes to copy */
+ unsigned char FAR *from; /* where to copy match bytes from */
+ code const FAR *lencode; /* starting table for length/literal codes */
+ code const FAR *distcode; /* starting table for distance codes */
+ unsigned lenbits; /* index bits for lencode */
+ unsigned distbits; /* index bits for distcode */
+ code here; /* current decoding table entry */
+ code last; /* parent table entry */
+ unsigned len; /* length to copy for repeats, bits to drop */
+ int ret; /* return code */
+ static const unsigned short order[19] = /* permutation of code lengths */
+ {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
+#include "inffix9.h"
+
+ /* Check that the strm exists and that the state was initialized */
+ if (strm == Z_NULL || strm->state == Z_NULL)
+ return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+
+ /* Reset the state */
+ strm->msg = Z_NULL;
+ mode = TYPE;
+ lastblock = 0;
+ wrap = 0;
+ window = state->window;
+ next = strm->next_in;
+ have = next != Z_NULL ? strm->avail_in : 0;
+ hold = 0;
+ bits = 0;
+ put = window;
+ left = WSIZE;
+ lencode = Z_NULL;
+ distcode = Z_NULL;
+
+ /* Inflate until end of block marked as last */
+ for (;;)
+ switch (mode) {
+ case TYPE:
+ /* determine and dispatch block type */
+ if (lastblock) {
+ BYTEBITS();
+ mode = DONE;
+ break;
+ }
+ NEEDBITS(3);
+ lastblock = BITS(1);
+ DROPBITS(1);
+ switch (BITS(2)) {
+ case 0: /* stored block */
+ Tracev((stderr, "inflate: stored block%s\n",
+ lastblock ? " (last)" : ""));
+ mode = STORED;
+ break;
+ case 1: /* fixed block */
+ lencode = lenfix;
+ lenbits = 9;
+ distcode = distfix;
+ distbits = 5;
+ Tracev((stderr, "inflate: fixed codes block%s\n",
+ lastblock ? " (last)" : ""));
+ mode = LEN; /* decode codes */
+ break;
+ case 2: /* dynamic block */
+ Tracev((stderr, "inflate: dynamic codes block%s\n",
+ lastblock ? " (last)" : ""));
+ mode = TABLE;
+ break;
+ case 3:
+ strm->msg = (char *)"invalid block type";
+ mode = BAD;
+ }
+ DROPBITS(2);
+ break;
+
+ case STORED:
+ /* get and verify stored block length */
+ BYTEBITS(); /* go to byte boundary */
+ NEEDBITS(32);
+ if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
+ strm->msg = (char *)"invalid stored block lengths";
+ mode = BAD;
+ break;
+ }
+ length = (unsigned)hold & 0xffff;
+ Tracev((stderr, "inflate: stored length %lu\n",
+ length));
+ INITBITS();
+
+ /* copy stored block from input to output */
+ while (length != 0) {
+ copy = length;
+ PULL();
+ ROOM();
+ if (copy > have) copy = have;
+ if (copy > left) copy = left;
+ zmemcpy(put, next, copy);
+ have -= copy;
+ next += copy;
+ left -= copy;
+ put += copy;
+ length -= copy;
+ }
+ Tracev((stderr, "inflate: stored end\n"));
+ mode = TYPE;
+ break;
+
+ case TABLE:
+ /* get dynamic table entries descriptor */
+ NEEDBITS(14);
+ state->nlen = BITS(5) + 257;
+ DROPBITS(5);
+ state->ndist = BITS(5) + 1;
+ DROPBITS(5);
+ state->ncode = BITS(4) + 4;
+ DROPBITS(4);
+ if (state->nlen > 286) {
+ strm->msg = (char *)"too many length symbols";
+ mode = BAD;
+ break;
+ }
+ Tracev((stderr, "inflate: table sizes ok\n"));
+
+ /* get code length code lengths (not a typo) */
+ state->have = 0;
+ while (state->have < state->ncode) {
+ NEEDBITS(3);
+ state->lens[order[state->have++]] = (unsigned short)BITS(3);
+ DROPBITS(3);
+ }
+ while (state->have < 19)
+ state->lens[order[state->have++]] = 0;
+ state->next = state->codes;
+ lencode = (code const FAR *)(state->next);
+ lenbits = 7;
+ ret = inflate_table9(CODES, state->lens, 19, &(state->next),
+ &(lenbits), state->work);
+ if (ret) {
+ strm->msg = (char *)"invalid code lengths set";
+ mode = BAD;
+ break;
+ }
+ Tracev((stderr, "inflate: code lengths ok\n"));
+
+ /* get length and distance code code lengths */
+ state->have = 0;
+ while (state->have < state->nlen + state->ndist) {
+ for (;;) {
+ here = lencode[BITS(lenbits)];
+ if ((unsigned)(here.bits) <= bits) break;
+ PULLBYTE();
+ }
+ if (here.val < 16) {
+ NEEDBITS(here.bits);
+ DROPBITS(here.bits);
+ state->lens[state->have++] = here.val;
+ }
+ else {
+ if (here.val == 16) {
+ NEEDBITS(here.bits + 2);
+ DROPBITS(here.bits);
+ if (state->have == 0) {
+ strm->msg = (char *)"invalid bit length repeat";
+ mode = BAD;
+ break;
+ }
+ len = (unsigned)(state->lens[state->have - 1]);
+ copy = 3 + BITS(2);
+ DROPBITS(2);
+ }
+ else if (here.val == 17) {
+ NEEDBITS(here.bits + 3);
+ DROPBITS(here.bits);
+ len = 0;
+ copy = 3 + BITS(3);
+ DROPBITS(3);
+ }
+ else {
+ NEEDBITS(here.bits + 7);
+ DROPBITS(here.bits);
+ len = 0;
+ copy = 11 + BITS(7);
+ DROPBITS(7);
+ }
+ if (state->have + copy > state->nlen + state->ndist) {
+ strm->msg = (char *)"invalid bit length repeat";
+ mode = BAD;
+ break;
+ }
+ while (copy--)
+ state->lens[state->have++] = (unsigned short)len;
+ }
+ }
+
+ /* handle error breaks in while */
+ if (mode == BAD) break;
+
+ /* check for end-of-block code (better have one) */
+ if (state->lens[256] == 0) {
+ strm->msg = (char *)"invalid code -- missing end-of-block";
+ mode = BAD;
+ break;
+ }
+
+ /* build code tables -- note: do not change the lenbits or distbits
+ values here (9 and 6) without reading the comments in inftree9.h
+ concerning the ENOUGH constants, which depend on those values */
+ state->next = state->codes;
+ lencode = (code const FAR *)(state->next);
+ lenbits = 9;
+ ret = inflate_table9(LENS, state->lens, state->nlen,
+ &(state->next), &(lenbits), state->work);
+ if (ret) {
+ strm->msg = (char *)"invalid literal/lengths set";
+ mode = BAD;
+ break;
+ }
+ distcode = (code const FAR *)(state->next);
+ distbits = 6;
+ ret = inflate_table9(DISTS, state->lens + state->nlen,
+ state->ndist, &(state->next), &(distbits),
+ state->work);
+ if (ret) {
+ strm->msg = (char *)"invalid distances set";
+ mode = BAD;
+ break;
+ }
+ Tracev((stderr, "inflate: codes ok\n"));
+ mode = LEN;
+
+ case LEN:
+ /* get a literal, length, or end-of-block code */
+ for (;;) {
+ here = lencode[BITS(lenbits)];
+ if ((unsigned)(here.bits) <= bits) break;
+ PULLBYTE();
+ }
+ if (here.op && (here.op & 0xf0) == 0) {
+ last = here;
+ for (;;) {
+ here = lencode[last.val +
+ (BITS(last.bits + last.op) >> last.bits)];
+ if ((unsigned)(last.bits + here.bits) <= bits) break;
+ PULLBYTE();
+ }
+ DROPBITS(last.bits);
+ }
+ DROPBITS(here.bits);
+ length = (unsigned)here.val;
+
+ /* process literal */
+ if (here.op == 0) {
+ Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
+ "inflate: literal '%c'\n" :
+ "inflate: literal 0x%02x\n", here.val));
+ ROOM();
+ *put++ = (unsigned char)(length);
+ left--;
+ mode = LEN;
+ break;
+ }
+
+ /* process end of block */
+ if (here.op & 32) {
+ Tracevv((stderr, "inflate: end of block\n"));
+ mode = TYPE;
+ break;
+ }
+
+ /* invalid code */
+ if (here.op & 64) {
+ strm->msg = (char *)"invalid literal/length code";
+ mode = BAD;
+ break;
+ }
+
+ /* length code -- get extra bits, if any */
+ extra = (unsigned)(here.op) & 31;
+ if (extra != 0) {
+ NEEDBITS(extra);
+ length += BITS(extra);
+ DROPBITS(extra);
+ }
+ Tracevv((stderr, "inflate: length %lu\n", length));
+
+ /* get distance code */
+ for (;;) {
+ here = distcode[BITS(distbits)];
+ if ((unsigned)(here.bits) <= bits) break;
+ PULLBYTE();
+ }
+ if ((here.op & 0xf0) == 0) {
+ last = here;
+ for (;;) {
+ here = distcode[last.val +
+ (BITS(last.bits + last.op) >> last.bits)];
+ if ((unsigned)(last.bits + here.bits) <= bits) break;
+ PULLBYTE();
+ }
+ DROPBITS(last.bits);
+ }
+ DROPBITS(here.bits);
+ if (here.op & 64) {
+ strm->msg = (char *)"invalid distance code";
+ mode = BAD;
+ break;
+ }
+ offset = (unsigned)here.val;
+
+ /* get distance extra bits, if any */
+ extra = (unsigned)(here.op) & 15;
+ if (extra != 0) {
+ NEEDBITS(extra);
+ offset += BITS(extra);
+ DROPBITS(extra);
+ }
+ if (offset > WSIZE - (wrap ? 0: left)) {
+ strm->msg = (char *)"invalid distance too far back";
+ mode = BAD;
+ break;
+ }
+ Tracevv((stderr, "inflate: distance %lu\n", offset));
+
+ /* copy match from window to output */
+ do {
+ ROOM();
+ copy = WSIZE - offset;
+ if (copy < left) {
+ from = put + copy;
+ copy = left - copy;
+ }
+ else {
+ from = put - offset;
+ copy = left;
+ }
+ if (copy > length) copy = length;
+ length -= copy;
+ left -= copy;
+ do {
+ *put++ = *from++;
+ } while (--copy);
+ } while (length != 0);
+ break;
+
+ case DONE:
+ /* inflate stream terminated properly -- write leftover output */
+ ret = Z_STREAM_END;
+ if (left < WSIZE) {
+ if (out(out_desc, window, (unsigned)(WSIZE - left)))
+ ret = Z_BUF_ERROR;
+ }
+ goto inf_leave;
+
+ case BAD:
+ ret = Z_DATA_ERROR;
+ goto inf_leave;
+
+ default: /* can't happen, but makes compilers happy */
+ ret = Z_STREAM_ERROR;
+ goto inf_leave;
+ }
+
+ /* Return unused input */
+ inf_leave:
+ strm->next_in = next;
+ strm->avail_in = have;
+ return ret;
+}
+
+int ZEXPORT inflateBack9End(strm)
+z_stream FAR *strm;
+{
+ if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
+ return Z_STREAM_ERROR;
+ ZFREE(strm, strm->state);
+ strm->state = Z_NULL;
+ Tracev((stderr, "inflate: end\n"));
+ return Z_OK;
+}
diff --git a/protocols/Telegram/tgl/zlib/contrib/infback9/infback9.h b/protocols/Telegram/tgl/zlib/contrib/infback9/infback9.h
new file mode 100644
index 0000000000..1073c0a38e
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/infback9/infback9.h
@@ -0,0 +1,37 @@
+/* infback9.h -- header for using inflateBack9 functions
+ * Copyright (C) 2003 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/*
+ * This header file and associated patches provide a decoder for PKWare's
+ * undocumented deflate64 compression method (method 9). Use with infback9.c,
+ * inftree9.h, inftree9.c, and inffix9.h. These patches are not supported.
+ * This should be compiled with zlib, since it uses zutil.h and zutil.o.
+ * This code has not yet been tested on 16-bit architectures. See the
+ * comments in zlib.h for inflateBack() usage. These functions are used
+ * identically, except that there is no windowBits parameter, and a 64K
+ * window must be provided. Also if int's are 16 bits, then a zero for
+ * the third parameter of the "out" function actually means 65536UL.
+ * zlib.h must be included before this header file.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ZEXTERN int ZEXPORT inflateBack9 OF((z_stream FAR *strm,
+ in_func in, void FAR *in_desc,
+ out_func out, void FAR *out_desc));
+ZEXTERN int ZEXPORT inflateBack9End OF((z_stream FAR *strm));
+ZEXTERN int ZEXPORT inflateBack9Init_ OF((z_stream FAR *strm,
+ unsigned char FAR *window,
+ const char *version,
+ int stream_size));
+#define inflateBack9Init(strm, window) \
+ inflateBack9Init_((strm), (window), \
+ ZLIB_VERSION, sizeof(z_stream))
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/protocols/Telegram/tgl/zlib/contrib/infback9/inffix9.h b/protocols/Telegram/tgl/zlib/contrib/infback9/inffix9.h
new file mode 100644
index 0000000000..ee5671d2df
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/infback9/inffix9.h
@@ -0,0 +1,107 @@
+ /* inffix9.h -- table for decoding deflate64 fixed codes
+ * Generated automatically by makefixed9().
+ */
+
+ /* WARNING: this file should *not* be used by applications.
+ It is part of the implementation of this library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+ static const code lenfix[512] = {
+ {96,7,0},{0,8,80},{0,8,16},{132,8,115},{130,7,31},{0,8,112},
+ {0,8,48},{0,9,192},{128,7,10},{0,8,96},{0,8,32},{0,9,160},
+ {0,8,0},{0,8,128},{0,8,64},{0,9,224},{128,7,6},{0,8,88},
+ {0,8,24},{0,9,144},{131,7,59},{0,8,120},{0,8,56},{0,9,208},
+ {129,7,17},{0,8,104},{0,8,40},{0,9,176},{0,8,8},{0,8,136},
+ {0,8,72},{0,9,240},{128,7,4},{0,8,84},{0,8,20},{133,8,227},
+ {131,7,43},{0,8,116},{0,8,52},{0,9,200},{129,7,13},{0,8,100},
+ {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},
+ {128,7,8},{0,8,92},{0,8,28},{0,9,152},{132,7,83},{0,8,124},
+ {0,8,60},{0,9,216},{130,7,23},{0,8,108},{0,8,44},{0,9,184},
+ {0,8,12},{0,8,140},{0,8,76},{0,9,248},{128,7,3},{0,8,82},
+ {0,8,18},{133,8,163},{131,7,35},{0,8,114},{0,8,50},{0,9,196},
+ {129,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2},{0,8,130},
+ {0,8,66},{0,9,228},{128,7,7},{0,8,90},{0,8,26},{0,9,148},
+ {132,7,67},{0,8,122},{0,8,58},{0,9,212},{130,7,19},{0,8,106},
+ {0,8,42},{0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},
+ {128,7,5},{0,8,86},{0,8,22},{65,8,0},{131,7,51},{0,8,118},
+ {0,8,54},{0,9,204},{129,7,15},{0,8,102},{0,8,38},{0,9,172},
+ {0,8,6},{0,8,134},{0,8,70},{0,9,236},{128,7,9},{0,8,94},
+ {0,8,30},{0,9,156},{132,7,99},{0,8,126},{0,8,62},{0,9,220},
+ {130,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142},
+ {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{133,8,131},
+ {130,7,31},{0,8,113},{0,8,49},{0,9,194},{128,7,10},{0,8,97},
+ {0,8,33},{0,9,162},{0,8,1},{0,8,129},{0,8,65},{0,9,226},
+ {128,7,6},{0,8,89},{0,8,25},{0,9,146},{131,7,59},{0,8,121},
+ {0,8,57},{0,9,210},{129,7,17},{0,8,105},{0,8,41},{0,9,178},
+ {0,8,9},{0,8,137},{0,8,73},{0,9,242},{128,7,4},{0,8,85},
+ {0,8,21},{144,8,3},{131,7,43},{0,8,117},{0,8,53},{0,9,202},
+ {129,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},
+ {0,8,69},{0,9,234},{128,7,8},{0,8,93},{0,8,29},{0,9,154},
+ {132,7,83},{0,8,125},{0,8,61},{0,9,218},{130,7,23},{0,8,109},
+ {0,8,45},{0,9,186},{0,8,13},{0,8,141},{0,8,77},{0,9,250},
+ {128,7,3},{0,8,83},{0,8,19},{133,8,195},{131,7,35},{0,8,115},
+ {0,8,51},{0,9,198},{129,7,11},{0,8,99},{0,8,35},{0,9,166},
+ {0,8,3},{0,8,131},{0,8,67},{0,9,230},{128,7,7},{0,8,91},
+ {0,8,27},{0,9,150},{132,7,67},{0,8,123},{0,8,59},{0,9,214},
+ {130,7,19},{0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},
+ {0,8,75},{0,9,246},{128,7,5},{0,8,87},{0,8,23},{77,8,0},
+ {131,7,51},{0,8,119},{0,8,55},{0,9,206},{129,7,15},{0,8,103},
+ {0,8,39},{0,9,174},{0,8,7},{0,8,135},{0,8,71},{0,9,238},
+ {128,7,9},{0,8,95},{0,8,31},{0,9,158},{132,7,99},{0,8,127},
+ {0,8,63},{0,9,222},{130,7,27},{0,8,111},{0,8,47},{0,9,190},
+ {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},
+ {0,8,16},{132,8,115},{130,7,31},{0,8,112},{0,8,48},{0,9,193},
+ {128,7,10},{0,8,96},{0,8,32},{0,9,161},{0,8,0},{0,8,128},
+ {0,8,64},{0,9,225},{128,7,6},{0,8,88},{0,8,24},{0,9,145},
+ {131,7,59},{0,8,120},{0,8,56},{0,9,209},{129,7,17},{0,8,104},
+ {0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72},{0,9,241},
+ {128,7,4},{0,8,84},{0,8,20},{133,8,227},{131,7,43},{0,8,116},
+ {0,8,52},{0,9,201},{129,7,13},{0,8,100},{0,8,36},{0,9,169},
+ {0,8,4},{0,8,132},{0,8,68},{0,9,233},{128,7,8},{0,8,92},
+ {0,8,28},{0,9,153},{132,7,83},{0,8,124},{0,8,60},{0,9,217},
+ {130,7,23},{0,8,108},{0,8,44},{0,9,185},{0,8,12},{0,8,140},
+ {0,8,76},{0,9,249},{128,7,3},{0,8,82},{0,8,18},{133,8,163},
+ {131,7,35},{0,8,114},{0,8,50},{0,9,197},{129,7,11},{0,8,98},
+ {0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229},
+ {128,7,7},{0,8,90},{0,8,26},{0,9,149},{132,7,67},{0,8,122},
+ {0,8,58},{0,9,213},{130,7,19},{0,8,106},{0,8,42},{0,9,181},
+ {0,8,10},{0,8,138},{0,8,74},{0,9,245},{128,7,5},{0,8,86},
+ {0,8,22},{65,8,0},{131,7,51},{0,8,118},{0,8,54},{0,9,205},
+ {129,7,15},{0,8,102},{0,8,38},{0,9,173},{0,8,6},{0,8,134},
+ {0,8,70},{0,9,237},{128,7,9},{0,8,94},{0,8,30},{0,9,157},
+ {132,7,99},{0,8,126},{0,8,62},{0,9,221},{130,7,27},{0,8,110},
+ {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},
+ {96,7,0},{0,8,81},{0,8,17},{133,8,131},{130,7,31},{0,8,113},
+ {0,8,49},{0,9,195},{128,7,10},{0,8,97},{0,8,33},{0,9,163},
+ {0,8,1},{0,8,129},{0,8,65},{0,9,227},{128,7,6},{0,8,89},
+ {0,8,25},{0,9,147},{131,7,59},{0,8,121},{0,8,57},{0,9,211},
+ {129,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9},{0,8,137},
+ {0,8,73},{0,9,243},{128,7,4},{0,8,85},{0,8,21},{144,8,3},
+ {131,7,43},{0,8,117},{0,8,53},{0,9,203},{129,7,13},{0,8,101},
+ {0,8,37},{0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},
+ {128,7,8},{0,8,93},{0,8,29},{0,9,155},{132,7,83},{0,8,125},
+ {0,8,61},{0,9,219},{130,7,23},{0,8,109},{0,8,45},{0,9,187},
+ {0,8,13},{0,8,141},{0,8,77},{0,9,251},{128,7,3},{0,8,83},
+ {0,8,19},{133,8,195},{131,7,35},{0,8,115},{0,8,51},{0,9,199},
+ {129,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131},
+ {0,8,67},{0,9,231},{128,7,7},{0,8,91},{0,8,27},{0,9,151},
+ {132,7,67},{0,8,123},{0,8,59},{0,9,215},{130,7,19},{0,8,107},
+ {0,8,43},{0,9,183},{0,8,11},{0,8,139},{0,8,75},{0,9,247},
+ {128,7,5},{0,8,87},{0,8,23},{77,8,0},{131,7,51},{0,8,119},
+ {0,8,55},{0,9,207},{129,7,15},{0,8,103},{0,8,39},{0,9,175},
+ {0,8,7},{0,8,135},{0,8,71},{0,9,239},{128,7,9},{0,8,95},
+ {0,8,31},{0,9,159},{132,7,99},{0,8,127},{0,8,63},{0,9,223},
+ {130,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},
+ {0,8,79},{0,9,255}
+ };
+
+ static const code distfix[32] = {
+ {128,5,1},{135,5,257},{131,5,17},{139,5,4097},{129,5,5},
+ {137,5,1025},{133,5,65},{141,5,16385},{128,5,3},{136,5,513},
+ {132,5,33},{140,5,8193},{130,5,9},{138,5,2049},{134,5,129},
+ {142,5,32769},{128,5,2},{135,5,385},{131,5,25},{139,5,6145},
+ {129,5,7},{137,5,1537},{133,5,97},{141,5,24577},{128,5,4},
+ {136,5,769},{132,5,49},{140,5,12289},{130,5,13},{138,5,3073},
+ {134,5,193},{142,5,49153}
+ };
diff --git a/protocols/Telegram/tgl/zlib/contrib/infback9/inflate9.h b/protocols/Telegram/tgl/zlib/contrib/infback9/inflate9.h
new file mode 100644
index 0000000000..ee9a79394b
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/infback9/inflate9.h
@@ -0,0 +1,47 @@
+/* inflate9.h -- internal inflate state definition
+ * Copyright (C) 1995-2003 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+/* Possible inflate modes between inflate() calls */
+typedef enum {
+ TYPE, /* i: waiting for type bits, including last-flag bit */
+ STORED, /* i: waiting for stored size (length and complement) */
+ TABLE, /* i: waiting for dynamic block table lengths */
+ LEN, /* i: waiting for length/lit code */
+ DONE, /* finished check, done -- remain here until reset */
+ BAD /* got a data error -- remain here until reset */
+} inflate_mode;
+
+/*
+ State transitions between above modes -
+
+ (most modes can go to the BAD mode -- not shown for clarity)
+
+ Read deflate blocks:
+ TYPE -> STORED or TABLE or LEN or DONE
+ STORED -> TYPE
+ TABLE -> LENLENS -> CODELENS -> LEN
+ Read deflate codes:
+ LEN -> LEN or TYPE
+ */
+
+/* state maintained between inflate() calls. Approximately 7K bytes. */
+struct inflate_state {
+ /* sliding window */
+ unsigned char FAR *window; /* allocated sliding window, if needed */
+ /* dynamic table building */
+ unsigned ncode; /* number of code length code lengths */
+ unsigned nlen; /* number of length code lengths */
+ unsigned ndist; /* number of distance code lengths */
+ unsigned have; /* number of code lengths in lens[] */
+ code FAR *next; /* next available space in codes[] */
+ unsigned short lens[320]; /* temporary storage for code lengths */
+ unsigned short work[288]; /* work area for code table building */
+ code codes[ENOUGH]; /* space for code tables */
+};
diff --git a/protocols/Telegram/tgl/zlib/contrib/infback9/inftree9.c b/protocols/Telegram/tgl/zlib/contrib/infback9/inftree9.c
new file mode 100644
index 0000000000..4a73ad215f
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/infback9/inftree9.c
@@ -0,0 +1,324 @@
+/* inftree9.c -- generate Huffman trees for efficient decoding
+ * Copyright (C) 1995-2013 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "inftree9.h"
+
+#define MAXBITS 15
+
+const char inflate9_copyright[] =
+ " inflate9 1.2.8 Copyright 1995-2013 Mark Adler ";
+/*
+ If you use the zlib library in a product, an acknowledgment is welcome
+ in the documentation of your product. If for some reason you cannot
+ include such an acknowledgment, I would appreciate that you keep this
+ copyright string in the executable of your product.
+ */
+
+/*
+ Build a set of tables to decode the provided canonical Huffman code.
+ The code lengths are lens[0..codes-1]. The result starts at *table,
+ whose indices are 0..2^bits-1. work is a writable array of at least
+ lens shorts, which is used as a work area. type is the type of code
+ to be generated, CODES, LENS, or DISTS. On return, zero is success,
+ -1 is an invalid code, and +1 means that ENOUGH isn't enough. table
+ on return points to the next available entry's address. bits is the
+ requested root table index bits, and on return it is the actual root
+ table index bits. It will differ if the request is greater than the
+ longest code or if it is less than the shortest code.
+ */
+int inflate_table9(type, lens, codes, table, bits, work)
+codetype type;
+unsigned short FAR *lens;
+unsigned codes;
+code FAR * FAR *table;
+unsigned FAR *bits;
+unsigned short FAR *work;
+{
+ unsigned len; /* a code's length in bits */
+ unsigned sym; /* index of code symbols */
+ unsigned min, max; /* minimum and maximum code lengths */
+ unsigned root; /* number of index bits for root table */
+ unsigned curr; /* number of index bits for current table */
+ unsigned drop; /* code bits to drop for sub-table */
+ int left; /* number of prefix codes available */
+ unsigned used; /* code entries in table used */
+ unsigned huff; /* Huffman code */
+ unsigned incr; /* for incrementing code, index */
+ unsigned fill; /* index for replicating entries */
+ unsigned low; /* low bits for current root entry */
+ unsigned mask; /* mask for low root bits */
+ code this; /* table entry for duplication */
+ code FAR *next; /* next available space in table */
+ const unsigned short FAR *base; /* base value table to use */
+ const unsigned short FAR *extra; /* extra bits table to use */
+ int end; /* use base and extra for symbol > end */
+ unsigned short count[MAXBITS+1]; /* number of codes of each length */
+ unsigned short offs[MAXBITS+1]; /* offsets in table for each length */
+ static const unsigned short lbase[31] = { /* Length codes 257..285 base */
+ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17,
+ 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115,
+ 131, 163, 195, 227, 3, 0, 0};
+ static const unsigned short lext[31] = { /* Length codes 257..285 extra */
+ 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129,
+ 130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132,
+ 133, 133, 133, 133, 144, 72, 78};
+ static const unsigned short dbase[32] = { /* Distance codes 0..31 base */
+ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49,
+ 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073,
+ 4097, 6145, 8193, 12289, 16385, 24577, 32769, 49153};
+ static const unsigned short dext[32] = { /* Distance codes 0..31 extra */
+ 128, 128, 128, 128, 129, 129, 130, 130, 131, 131, 132, 132,
+ 133, 133, 134, 134, 135, 135, 136, 136, 137, 137, 138, 138,
+ 139, 139, 140, 140, 141, 141, 142, 142};
+
+ /*
+ Process a set of code lengths to create a canonical Huffman code. The
+ code lengths are lens[0..codes-1]. Each length corresponds to the
+ symbols 0..codes-1. The Huffman code is generated by first sorting the
+ symbols by length from short to long, and retaining the symbol order
+ for codes with equal lengths. Then the code starts with all zero bits
+ for the first code of the shortest length, and the codes are integer
+ increments for the same length, and zeros are appended as the length
+ increases. For the deflate format, these bits are stored backwards
+ from their more natural integer increment ordering, and so when the
+ decoding tables are built in the large loop below, the integer codes
+ are incremented backwards.
+
+ This routine assumes, but does not check, that all of the entries in
+ lens[] are in the range 0..MAXBITS. The caller must assure this.
+ 1..MAXBITS is interpreted as that code length. zero means that that
+ symbol does not occur in this code.
+
+ The codes are sorted by computing a count of codes for each length,
+ creating from that a table of starting indices for each length in the
+ sorted table, and then entering the symbols in order in the sorted
+ table. The sorted table is work[], with that space being provided by
+ the caller.
+
+ The length counts are used for other purposes as well, i.e. finding
+ the minimum and maximum length codes, determining if there are any
+ codes at all, checking for a valid set of lengths, and looking ahead
+ at length counts to determine sub-table sizes when building the
+ decoding tables.
+ */
+
+ /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
+ for (len = 0; len <= MAXBITS; len++)
+ count[len] = 0;
+ for (sym = 0; sym < codes; sym++)
+ count[lens[sym]]++;
+
+ /* bound code lengths, force root to be within code lengths */
+ root = *bits;
+ for (max = MAXBITS; max >= 1; max--)
+ if (count[max] != 0) break;
+ if (root > max) root = max;
+ if (max == 0) return -1; /* no codes! */
+ for (min = 1; min <= MAXBITS; min++)
+ if (count[min] != 0) break;
+ if (root < min) root = min;
+
+ /* check for an over-subscribed or incomplete set of lengths */
+ left = 1;
+ for (len = 1; len <= MAXBITS; len++) {
+ left <<= 1;
+ left -= count[len];
+ if (left < 0) return -1; /* over-subscribed */
+ }
+ if (left > 0 && (type == CODES || max != 1))
+ return -1; /* incomplete set */
+
+ /* generate offsets into symbol table for each length for sorting */
+ offs[1] = 0;
+ for (len = 1; len < MAXBITS; len++)
+ offs[len + 1] = offs[len] + count[len];
+
+ /* sort symbols by length, by symbol order within each length */
+ for (sym = 0; sym < codes; sym++)
+ if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym;
+
+ /*
+ Create and fill in decoding tables. In this loop, the table being
+ filled is at next and has curr index bits. The code being used is huff
+ with length len. That code is converted to an index by dropping drop
+ bits off of the bottom. For codes where len is less than drop + curr,
+ those top drop + curr - len bits are incremented through all values to
+ fill the table with replicated entries.
+
+ root is the number of index bits for the root table. When len exceeds
+ root, sub-tables are created pointed to by the root entry with an index
+ of the low root bits of huff. This is saved in low to check for when a
+ new sub-table should be started. drop is zero when the root table is
+ being filled, and drop is root when sub-tables are being filled.
+
+ When a new sub-table is needed, it is necessary to look ahead in the
+ code lengths to determine what size sub-table is needed. The length
+ counts are used for this, and so count[] is decremented as codes are
+ entered in the tables.
+
+ used keeps track of how many table entries have been allocated from the
+ provided *table space. It is checked for LENS and DIST tables against
+ the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
+ the initial root table size constants. See the comments in inftree9.h
+ for more information.
+
+ sym increments through all symbols, and the loop terminates when
+ all codes of length max, i.e. all codes, have been processed. This
+ routine permits incomplete codes, so another loop after this one fills
+ in the rest of the decoding tables with invalid code markers.
+ */
+
+ /* set up for code type */
+ switch (type) {
+ case CODES:
+ base = extra = work; /* dummy value--not used */
+ end = 19;
+ break;
+ case LENS:
+ base = lbase;
+ base -= 257;
+ extra = lext;
+ extra -= 257;
+ end = 256;
+ break;
+ default: /* DISTS */
+ base = dbase;
+ extra = dext;
+ end = -1;
+ }
+
+ /* initialize state for loop */
+ huff = 0; /* starting code */
+ sym = 0; /* starting code symbol */
+ len = min; /* starting code length */
+ next = *table; /* current table to fill in */
+ curr = root; /* current table index bits */
+ drop = 0; /* current bits to drop from code for index */
+ low = (unsigned)(-1); /* trigger new sub-table when len > root */
+ used = 1U << root; /* use root table entries */
+ mask = used - 1; /* mask for comparing low */
+
+ /* check available table space */
+ if ((type == LENS && used >= ENOUGH_LENS) ||
+ (type == DISTS && used >= ENOUGH_DISTS))
+ return 1;
+
+ /* process all codes and make table entries */
+ for (;;) {
+ /* create table entry */
+ this.bits = (unsigned char)(len - drop);
+ if ((int)(work[sym]) < end) {
+ this.op = (unsigned char)0;
+ this.val = work[sym];
+ }
+ else if ((int)(work[sym]) > end) {
+ this.op = (unsigned char)(extra[work[sym]]);
+ this.val = base[work[sym]];
+ }
+ else {
+ this.op = (unsigned char)(32 + 64); /* end of block */
+ this.val = 0;
+ }
+
+ /* replicate for those indices with low len bits equal to huff */
+ incr = 1U << (len - drop);
+ fill = 1U << curr;
+ do {
+ fill -= incr;
+ next[(huff >> drop) + fill] = this;
+ } while (fill != 0);
+
+ /* backwards increment the len-bit code huff */
+ incr = 1U << (len - 1);
+ while (huff & incr)
+ incr >>= 1;
+ if (incr != 0) {
+ huff &= incr - 1;
+ huff += incr;
+ }
+ else
+ huff = 0;
+
+ /* go to next symbol, update count, len */
+ sym++;
+ if (--(count[len]) == 0) {
+ if (len == max) break;
+ len = lens[work[sym]];
+ }
+
+ /* create new sub-table if needed */
+ if (len > root && (huff & mask) != low) {
+ /* if first time, transition to sub-tables */
+ if (drop == 0)
+ drop = root;
+
+ /* increment past last table */
+ next += 1U << curr;
+
+ /* determine length of next table */
+ curr = len - drop;
+ left = (int)(1 << curr);
+ while (curr + drop < max) {
+ left -= count[curr + drop];
+ if (left <= 0) break;
+ curr++;
+ left <<= 1;
+ }
+
+ /* check for enough space */
+ used += 1U << curr;
+ if ((type == LENS && used >= ENOUGH_LENS) ||
+ (type == DISTS && used >= ENOUGH_DISTS))
+ return 1;
+
+ /* point entry in root table to sub-table */
+ low = huff & mask;
+ (*table)[low].op = (unsigned char)curr;
+ (*table)[low].bits = (unsigned char)root;
+ (*table)[low].val = (unsigned short)(next - *table);
+ }
+ }
+
+ /*
+ Fill in rest of table for incomplete codes. This loop is similar to the
+ loop above in incrementing huff for table indices. It is assumed that
+ len is equal to curr + drop, so there is no loop needed to increment
+ through high index bits. When the current sub-table is filled, the loop
+ drops back to the root table to fill in any remaining entries there.
+ */
+ this.op = (unsigned char)64; /* invalid code marker */
+ this.bits = (unsigned char)(len - drop);
+ this.val = (unsigned short)0;
+ while (huff != 0) {
+ /* when done with sub-table, drop back to root table */
+ if (drop != 0 && (huff & mask) != low) {
+ drop = 0;
+ len = root;
+ next = *table;
+ curr = root;
+ this.bits = (unsigned char)len;
+ }
+
+ /* put invalid code marker in table */
+ next[huff >> drop] = this;
+
+ /* backwards increment the len-bit code huff */
+ incr = 1U << (len - 1);
+ while (huff & incr)
+ incr >>= 1;
+ if (incr != 0) {
+ huff &= incr - 1;
+ huff += incr;
+ }
+ else
+ huff = 0;
+ }
+
+ /* set return parameters */
+ *table += used;
+ *bits = root;
+ return 0;
+}
diff --git a/protocols/Telegram/tgl/zlib/contrib/infback9/inftree9.h b/protocols/Telegram/tgl/zlib/contrib/infback9/inftree9.h
new file mode 100644
index 0000000000..5ab21f0c6d
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/infback9/inftree9.h
@@ -0,0 +1,61 @@
+/* inftree9.h -- header to use inftree9.c
+ * Copyright (C) 1995-2008 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+/* Structure for decoding tables. Each entry provides either the
+ information needed to do the operation requested by the code that
+ indexed that table entry, or it provides a pointer to another
+ table that indexes more bits of the code. op indicates whether
+ the entry is a pointer to another table, a literal, a length or
+ distance, an end-of-block, or an invalid code. For a table
+ pointer, the low four bits of op is the number of index bits of
+ that table. For a length or distance, the low four bits of op
+ is the number of extra bits to get after the code. bits is
+ the number of bits in this code or part of the code to drop off
+ of the bit buffer. val is the actual byte to output in the case
+ of a literal, the base length or distance, or the offset from
+ the current table to the next table. Each entry is four bytes. */
+typedef struct {
+ unsigned char op; /* operation, extra bits, table bits */
+ unsigned char bits; /* bits in this part of the code */
+ unsigned short val; /* offset in table or code value */
+} code;
+
+/* op values as set by inflate_table():
+ 00000000 - literal
+ 0000tttt - table link, tttt != 0 is the number of table index bits
+ 100eeeee - length or distance, eeee is the number of extra bits
+ 01100000 - end of block
+ 01000000 - invalid code
+ */
+
+/* Maximum size of the dynamic table. The maximum number of code structures is
+ 1446, which is the sum of 852 for literal/length codes and 594 for distance
+ codes. These values were found by exhaustive searches using the program
+ examples/enough.c found in the zlib distribtution. The arguments to that
+ program are the number of symbols, the initial root table size, and the
+ maximum bit length of a code. "enough 286 9 15" for literal/length codes
+ returns returns 852, and "enough 32 6 15" for distance codes returns 594.
+ The initial root table size (9 or 6) is found in the fifth argument of the
+ inflate_table() calls in infback9.c. If the root table size is changed,
+ then these maximum sizes would be need to be recalculated and updated. */
+#define ENOUGH_LENS 852
+#define ENOUGH_DISTS 594
+#define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS)
+
+/* Type of code to build for inflate_table9() */
+typedef enum {
+ CODES,
+ LENS,
+ DISTS
+} codetype;
+
+extern int inflate_table9 OF((codetype type, unsigned short FAR *lens,
+ unsigned codes, code FAR * FAR *table,
+ unsigned FAR *bits, unsigned short FAR *work));
diff --git a/protocols/Telegram/tgl/zlib/contrib/inflate86/inffas86.c b/protocols/Telegram/tgl/zlib/contrib/inflate86/inffas86.c
new file mode 100644
index 0000000000..7292f67b75
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/inflate86/inffas86.c
@@ -0,0 +1,1157 @@
+/* inffas86.c is a hand tuned assembler version of
+ *
+ * inffast.c -- fast decoding
+ * Copyright (C) 1995-2003 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ *
+ * Copyright (C) 2003 Chris Anderson <christop@charm.net>
+ * Please use the copyright conditions above.
+ *
+ * Dec-29-2003 -- I added AMD64 inflate asm support. This version is also
+ * slightly quicker on x86 systems because, instead of using rep movsb to copy
+ * data, it uses rep movsw, which moves data in 2-byte chunks instead of single
+ * bytes. I've tested the AMD64 code on a Fedora Core 1 + the x86_64 updates
+ * from http://fedora.linux.duke.edu/fc1_x86_64
+ * which is running on an Athlon 64 3000+ / Gigabyte GA-K8VT800M system with
+ * 1GB ram. The 64-bit version is about 4% faster than the 32-bit version,
+ * when decompressing mozilla-source-1.3.tar.gz.
+ *
+ * Mar-13-2003 -- Most of this is derived from inffast.S which is derived from
+ * the gcc -S output of zlib-1.2.0/inffast.c. Zlib-1.2.0 is in beta release at
+ * the moment. I have successfully compiled and tested this code with gcc2.96,
+ * gcc3.2, icc5.0, msvc6.0. It is very close to the speed of inffast.S
+ * compiled with gcc -DNO_MMX, but inffast.S is still faster on the P3 with MMX
+ * enabled. I will attempt to merge the MMX code into this version. Newer
+ * versions of this and inffast.S can be found at
+ * http://www.eetbeetee.com/zlib/ and http://www.charm.net/~christop/zlib/
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+#include "inflate.h"
+#include "inffast.h"
+
+/* Mark Adler's comments from inffast.c: */
+
+/*
+ Decode literal, length, and distance codes and write out the resulting
+ literal and match bytes until either not enough input or output is
+ available, an end-of-block is encountered, or a data error is encountered.
+ When large enough input and output buffers are supplied to inflate(), for
+ example, a 16K input buffer and a 64K output buffer, more than 95% of the
+ inflate execution time is spent in this routine.
+
+ Entry assumptions:
+
+ state->mode == LEN
+ strm->avail_in >= 6
+ strm->avail_out >= 258
+ start >= strm->avail_out
+ state->bits < 8
+
+ On return, state->mode is one of:
+
+ LEN -- ran out of enough output space or enough available input
+ TYPE -- reached end of block code, inflate() to interpret next block
+ BAD -- error in block data
+
+ Notes:
+
+ - The maximum input bits used by a length/distance pair is 15 bits for the
+ length code, 5 bits for the length extra, 15 bits for the distance code,
+ and 13 bits for the distance extra. This totals 48 bits, or six bytes.
+ Therefore if strm->avail_in >= 6, then there is enough input to avoid
+ checking for available input while decoding.
+
+ - The maximum bytes that a single length/distance pair can output is 258
+ bytes, which is the maximum length that can be coded. inflate_fast()
+ requires strm->avail_out >= 258 for each loop to avoid checking for
+ output space.
+ */
+void inflate_fast(strm, start)
+z_streamp strm;
+unsigned start; /* inflate()'s starting value for strm->avail_out */
+{
+ struct inflate_state FAR *state;
+ struct inffast_ar {
+/* 64 32 x86 x86_64 */
+/* ar offset register */
+/* 0 0 */ void *esp; /* esp save */
+/* 8 4 */ void *ebp; /* ebp save */
+/* 16 8 */ unsigned char FAR *in; /* esi rsi local strm->next_in */
+/* 24 12 */ unsigned char FAR *last; /* r9 while in < last */
+/* 32 16 */ unsigned char FAR *out; /* edi rdi local strm->next_out */
+/* 40 20 */ unsigned char FAR *beg; /* inflate()'s init next_out */
+/* 48 24 */ unsigned char FAR *end; /* r10 while out < end */
+/* 56 28 */ unsigned char FAR *window;/* size of window, wsize!=0 */
+/* 64 32 */ code const FAR *lcode; /* ebp rbp local strm->lencode */
+/* 72 36 */ code const FAR *dcode; /* r11 local strm->distcode */
+/* 80 40 */ unsigned long hold; /* edx rdx local strm->hold */
+/* 88 44 */ unsigned bits; /* ebx rbx local strm->bits */
+/* 92 48 */ unsigned wsize; /* window size */
+/* 96 52 */ unsigned write; /* window write index */
+/*100 56 */ unsigned lmask; /* r12 mask for lcode */
+/*104 60 */ unsigned dmask; /* r13 mask for dcode */
+/*108 64 */ unsigned len; /* r14 match length */
+/*112 68 */ unsigned dist; /* r15 match distance */
+/*116 72 */ unsigned status; /* set when state chng*/
+ } ar;
+
+#if defined( __GNUC__ ) && defined( __amd64__ ) && ! defined( __i386 )
+#define PAD_AVAIL_IN 6
+#define PAD_AVAIL_OUT 258
+#else
+#define PAD_AVAIL_IN 5
+#define PAD_AVAIL_OUT 257
+#endif
+
+ /* copy state to local variables */
+ state = (struct inflate_state FAR *)strm->state;
+ ar.in = strm->next_in;
+ ar.last = ar.in + (strm->avail_in - PAD_AVAIL_IN);
+ ar.out = strm->next_out;
+ ar.beg = ar.out - (start - strm->avail_out);
+ ar.end = ar.out + (strm->avail_out - PAD_AVAIL_OUT);
+ ar.wsize = state->wsize;
+ ar.write = state->wnext;
+ ar.window = state->window;
+ ar.hold = state->hold;
+ ar.bits = state->bits;
+ ar.lcode = state->lencode;
+ ar.dcode = state->distcode;
+ ar.lmask = (1U << state->lenbits) - 1;
+ ar.dmask = (1U << state->distbits) - 1;
+
+ /* decode literals and length/distances until end-of-block or not enough
+ input data or output space */
+
+ /* align in on 1/2 hold size boundary */
+ while (((unsigned long)(void *)ar.in & (sizeof(ar.hold) / 2 - 1)) != 0) {
+ ar.hold += (unsigned long)*ar.in++ << ar.bits;
+ ar.bits += 8;
+ }
+
+#if defined( __GNUC__ ) && defined( __amd64__ ) && ! defined( __i386 )
+ __asm__ __volatile__ (
+" leaq %0, %%rax\n"
+" movq %%rbp, 8(%%rax)\n" /* save regs rbp and rsp */
+" movq %%rsp, (%%rax)\n"
+" movq %%rax, %%rsp\n" /* make rsp point to &ar */
+" movq 16(%%rsp), %%rsi\n" /* rsi = in */
+" movq 32(%%rsp), %%rdi\n" /* rdi = out */
+" movq 24(%%rsp), %%r9\n" /* r9 = last */
+" movq 48(%%rsp), %%r10\n" /* r10 = end */
+" movq 64(%%rsp), %%rbp\n" /* rbp = lcode */
+" movq 72(%%rsp), %%r11\n" /* r11 = dcode */
+" movq 80(%%rsp), %%rdx\n" /* rdx = hold */
+" movl 88(%%rsp), %%ebx\n" /* ebx = bits */
+" movl 100(%%rsp), %%r12d\n" /* r12d = lmask */
+" movl 104(%%rsp), %%r13d\n" /* r13d = dmask */
+ /* r14d = len */
+ /* r15d = dist */
+" cld\n"
+" cmpq %%rdi, %%r10\n"
+" je .L_one_time\n" /* if only one decode left */
+" cmpq %%rsi, %%r9\n"
+" je .L_one_time\n"
+" jmp .L_do_loop\n"
+
+".L_one_time:\n"
+" movq %%r12, %%r8\n" /* r8 = lmask */
+" cmpb $32, %%bl\n"
+" ja .L_get_length_code_one_time\n"
+
+" lodsl\n" /* eax = *(uint *)in++ */
+" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */
+" addb $32, %%bl\n" /* bits += 32 */
+" shlq %%cl, %%rax\n"
+" orq %%rax, %%rdx\n" /* hold |= *((uint *)in)++ << bits */
+" jmp .L_get_length_code_one_time\n"
+
+".align 32,0x90\n"
+".L_while_test:\n"
+" cmpq %%rdi, %%r10\n"
+" jbe .L_break_loop\n"
+" cmpq %%rsi, %%r9\n"
+" jbe .L_break_loop\n"
+
+".L_do_loop:\n"
+" movq %%r12, %%r8\n" /* r8 = lmask */
+" cmpb $32, %%bl\n"
+" ja .L_get_length_code\n" /* if (32 < bits) */
+
+" lodsl\n" /* eax = *(uint *)in++ */
+" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */
+" addb $32, %%bl\n" /* bits += 32 */
+" shlq %%cl, %%rax\n"
+" orq %%rax, %%rdx\n" /* hold |= *((uint *)in)++ << bits */
+
+".L_get_length_code:\n"
+" andq %%rdx, %%r8\n" /* r8 &= hold */
+" movl (%%rbp,%%r8,4), %%eax\n" /* eax = lcode[hold & lmask] */
+
+" movb %%ah, %%cl\n" /* cl = this.bits */
+" subb %%ah, %%bl\n" /* bits -= this.bits */
+" shrq %%cl, %%rdx\n" /* hold >>= this.bits */
+
+" testb %%al, %%al\n"
+" jnz .L_test_for_length_base\n" /* if (op != 0) 45.7% */
+
+" movq %%r12, %%r8\n" /* r8 = lmask */
+" shrl $16, %%eax\n" /* output this.val char */
+" stosb\n"
+
+".L_get_length_code_one_time:\n"
+" andq %%rdx, %%r8\n" /* r8 &= hold */
+" movl (%%rbp,%%r8,4), %%eax\n" /* eax = lcode[hold & lmask] */
+
+".L_dolen:\n"
+" movb %%ah, %%cl\n" /* cl = this.bits */
+" subb %%ah, %%bl\n" /* bits -= this.bits */
+" shrq %%cl, %%rdx\n" /* hold >>= this.bits */
+
+" testb %%al, %%al\n"
+" jnz .L_test_for_length_base\n" /* if (op != 0) 45.7% */
+
+" shrl $16, %%eax\n" /* output this.val char */
+" stosb\n"
+" jmp .L_while_test\n"
+
+".align 32,0x90\n"
+".L_test_for_length_base:\n"
+" movl %%eax, %%r14d\n" /* len = this */
+" shrl $16, %%r14d\n" /* len = this.val */
+" movb %%al, %%cl\n"
+
+" testb $16, %%al\n"
+" jz .L_test_for_second_level_length\n" /* if ((op & 16) == 0) 8% */
+" andb $15, %%cl\n" /* op &= 15 */
+" jz .L_decode_distance\n" /* if (!op) */
+
+".L_add_bits_to_len:\n"
+" subb %%cl, %%bl\n"
+" xorl %%eax, %%eax\n"
+" incl %%eax\n"
+" shll %%cl, %%eax\n"
+" decl %%eax\n"
+" andl %%edx, %%eax\n" /* eax &= hold */
+" shrq %%cl, %%rdx\n"
+" addl %%eax, %%r14d\n" /* len += hold & mask[op] */
+
+".L_decode_distance:\n"
+" movq %%r13, %%r8\n" /* r8 = dmask */
+" cmpb $32, %%bl\n"
+" ja .L_get_distance_code\n" /* if (32 < bits) */
+
+" lodsl\n" /* eax = *(uint *)in++ */
+" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */
+" addb $32, %%bl\n" /* bits += 32 */
+" shlq %%cl, %%rax\n"
+" orq %%rax, %%rdx\n" /* hold |= *((uint *)in)++ << bits */
+
+".L_get_distance_code:\n"
+" andq %%rdx, %%r8\n" /* r8 &= hold */
+" movl (%%r11,%%r8,4), %%eax\n" /* eax = dcode[hold & dmask] */
+
+".L_dodist:\n"
+" movl %%eax, %%r15d\n" /* dist = this */
+" shrl $16, %%r15d\n" /* dist = this.val */
+" movb %%ah, %%cl\n"
+" subb %%ah, %%bl\n" /* bits -= this.bits */
+" shrq %%cl, %%rdx\n" /* hold >>= this.bits */
+" movb %%al, %%cl\n" /* cl = this.op */
+
+" testb $16, %%al\n" /* if ((op & 16) == 0) */
+" jz .L_test_for_second_level_dist\n"
+" andb $15, %%cl\n" /* op &= 15 */
+" jz .L_check_dist_one\n"
+
+".L_add_bits_to_dist:\n"
+" subb %%cl, %%bl\n"
+" xorl %%eax, %%eax\n"
+" incl %%eax\n"
+" shll %%cl, %%eax\n"
+" decl %%eax\n" /* (1 << op) - 1 */
+" andl %%edx, %%eax\n" /* eax &= hold */
+" shrq %%cl, %%rdx\n"
+" addl %%eax, %%r15d\n" /* dist += hold & ((1 << op) - 1) */
+
+".L_check_window:\n"
+" movq %%rsi, %%r8\n" /* save in so from can use it's reg */
+" movq %%rdi, %%rax\n"
+" subq 40(%%rsp), %%rax\n" /* nbytes = out - beg */
+
+" cmpl %%r15d, %%eax\n"
+" jb .L_clip_window\n" /* if (dist > nbytes) 4.2% */
+
+" movl %%r14d, %%ecx\n" /* ecx = len */
+" movq %%rdi, %%rsi\n"
+" subq %%r15, %%rsi\n" /* from = out - dist */
+
+" sarl %%ecx\n"
+" jnc .L_copy_two\n" /* if len % 2 == 0 */
+
+" rep movsw\n"
+" movb (%%rsi), %%al\n"
+" movb %%al, (%%rdi)\n"
+" incq %%rdi\n"
+
+" movq %%r8, %%rsi\n" /* move in back to %rsi, toss from */
+" jmp .L_while_test\n"
+
+".L_copy_two:\n"
+" rep movsw\n"
+" movq %%r8, %%rsi\n" /* move in back to %rsi, toss from */
+" jmp .L_while_test\n"
+
+".align 32,0x90\n"
+".L_check_dist_one:\n"
+" cmpl $1, %%r15d\n" /* if dist 1, is a memset */
+" jne .L_check_window\n"
+" cmpq %%rdi, 40(%%rsp)\n" /* if out == beg, outside window */
+" je .L_check_window\n"
+
+" movl %%r14d, %%ecx\n" /* ecx = len */
+" movb -1(%%rdi), %%al\n"
+" movb %%al, %%ah\n"
+
+" sarl %%ecx\n"
+" jnc .L_set_two\n"
+" movb %%al, (%%rdi)\n"
+" incq %%rdi\n"
+
+".L_set_two:\n"
+" rep stosw\n"
+" jmp .L_while_test\n"
+
+".align 32,0x90\n"
+".L_test_for_second_level_length:\n"
+" testb $64, %%al\n"
+" jnz .L_test_for_end_of_block\n" /* if ((op & 64) != 0) */
+
+" xorl %%eax, %%eax\n"
+" incl %%eax\n"
+" shll %%cl, %%eax\n"
+" decl %%eax\n"
+" andl %%edx, %%eax\n" /* eax &= hold */
+" addl %%r14d, %%eax\n" /* eax += len */
+" movl (%%rbp,%%rax,4), %%eax\n" /* eax = lcode[val+(hold&mask[op])]*/
+" jmp .L_dolen\n"
+
+".align 32,0x90\n"
+".L_test_for_second_level_dist:\n"
+" testb $64, %%al\n"
+" jnz .L_invalid_distance_code\n" /* if ((op & 64) != 0) */
+
+" xorl %%eax, %%eax\n"
+" incl %%eax\n"
+" shll %%cl, %%eax\n"
+" decl %%eax\n"
+" andl %%edx, %%eax\n" /* eax &= hold */
+" addl %%r15d, %%eax\n" /* eax += dist */
+" movl (%%r11,%%rax,4), %%eax\n" /* eax = dcode[val+(hold&mask[op])]*/
+" jmp .L_dodist\n"
+
+".align 32,0x90\n"
+".L_clip_window:\n"
+" movl %%eax, %%ecx\n" /* ecx = nbytes */
+" movl 92(%%rsp), %%eax\n" /* eax = wsize, prepare for dist cmp */
+" negl %%ecx\n" /* nbytes = -nbytes */
+
+" cmpl %%r15d, %%eax\n"
+" jb .L_invalid_distance_too_far\n" /* if (dist > wsize) */
+
+" addl %%r15d, %%ecx\n" /* nbytes = dist - nbytes */
+" cmpl $0, 96(%%rsp)\n"
+" jne .L_wrap_around_window\n" /* if (write != 0) */
+
+" movq 56(%%rsp), %%rsi\n" /* from = window */
+" subl %%ecx, %%eax\n" /* eax -= nbytes */
+" addq %%rax, %%rsi\n" /* from += wsize - nbytes */
+
+" movl %%r14d, %%eax\n" /* eax = len */
+" cmpl %%ecx, %%r14d\n"
+" jbe .L_do_copy\n" /* if (nbytes >= len) */
+
+" subl %%ecx, %%eax\n" /* eax -= nbytes */
+" rep movsb\n"
+" movq %%rdi, %%rsi\n"
+" subq %%r15, %%rsi\n" /* from = &out[ -dist ] */
+" jmp .L_do_copy\n"
+
+".align 32,0x90\n"
+".L_wrap_around_window:\n"
+" movl 96(%%rsp), %%eax\n" /* eax = write */
+" cmpl %%eax, %%ecx\n"
+" jbe .L_contiguous_in_window\n" /* if (write >= nbytes) */
+
+" movl 92(%%rsp), %%esi\n" /* from = wsize */
+" addq 56(%%rsp), %%rsi\n" /* from += window */
+" addq %%rax, %%rsi\n" /* from += write */
+" subq %%rcx, %%rsi\n" /* from -= nbytes */
+" subl %%eax, %%ecx\n" /* nbytes -= write */
+
+" movl %%r14d, %%eax\n" /* eax = len */
+" cmpl %%ecx, %%eax\n"
+" jbe .L_do_copy\n" /* if (nbytes >= len) */
+
+" subl %%ecx, %%eax\n" /* len -= nbytes */
+" rep movsb\n"
+" movq 56(%%rsp), %%rsi\n" /* from = window */
+" movl 96(%%rsp), %%ecx\n" /* nbytes = write */
+" cmpl %%ecx, %%eax\n"
+" jbe .L_do_copy\n" /* if (nbytes >= len) */
+
+" subl %%ecx, %%eax\n" /* len -= nbytes */
+" rep movsb\n"
+" movq %%rdi, %%rsi\n"
+" subq %%r15, %%rsi\n" /* from = out - dist */
+" jmp .L_do_copy\n"
+
+".align 32,0x90\n"
+".L_contiguous_in_window:\n"
+" movq 56(%%rsp), %%rsi\n" /* rsi = window */
+" addq %%rax, %%rsi\n"
+" subq %%rcx, %%rsi\n" /* from += write - nbytes */
+
+" movl %%r14d, %%eax\n" /* eax = len */
+" cmpl %%ecx, %%eax\n"
+" jbe .L_do_copy\n" /* if (nbytes >= len) */
+
+" subl %%ecx, %%eax\n" /* len -= nbytes */
+" rep movsb\n"
+" movq %%rdi, %%rsi\n"
+" subq %%r15, %%rsi\n" /* from = out - dist */
+" jmp .L_do_copy\n" /* if (nbytes >= len) */
+
+".align 32,0x90\n"
+".L_do_copy:\n"
+" movl %%eax, %%ecx\n" /* ecx = len */
+" rep movsb\n"
+
+" movq %%r8, %%rsi\n" /* move in back to %esi, toss from */
+" jmp .L_while_test\n"
+
+".L_test_for_end_of_block:\n"
+" testb $32, %%al\n"
+" jz .L_invalid_literal_length_code\n"
+" movl $1, 116(%%rsp)\n"
+" jmp .L_break_loop_with_status\n"
+
+".L_invalid_literal_length_code:\n"
+" movl $2, 116(%%rsp)\n"
+" jmp .L_break_loop_with_status\n"
+
+".L_invalid_distance_code:\n"
+" movl $3, 116(%%rsp)\n"
+" jmp .L_break_loop_with_status\n"
+
+".L_invalid_distance_too_far:\n"
+" movl $4, 116(%%rsp)\n"
+" jmp .L_break_loop_with_status\n"
+
+".L_break_loop:\n"
+" movl $0, 116(%%rsp)\n"
+
+".L_break_loop_with_status:\n"
+/* put in, out, bits, and hold back into ar and pop esp */
+" movq %%rsi, 16(%%rsp)\n" /* in */
+" movq %%rdi, 32(%%rsp)\n" /* out */
+" movl %%ebx, 88(%%rsp)\n" /* bits */
+" movq %%rdx, 80(%%rsp)\n" /* hold */
+" movq (%%rsp), %%rax\n" /* restore rbp and rsp */
+" movq 8(%%rsp), %%rbp\n"
+" movq %%rax, %%rsp\n"
+ :
+ : "m" (ar)
+ : "memory", "%rax", "%rbx", "%rcx", "%rdx", "%rsi", "%rdi",
+ "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"
+ );
+#elif ( defined( __GNUC__ ) || defined( __ICC ) ) && defined( __i386 )
+ __asm__ __volatile__ (
+" leal %0, %%eax\n"
+" movl %%esp, (%%eax)\n" /* save esp, ebp */
+" movl %%ebp, 4(%%eax)\n"
+" movl %%eax, %%esp\n"
+" movl 8(%%esp), %%esi\n" /* esi = in */
+" movl 16(%%esp), %%edi\n" /* edi = out */
+" movl 40(%%esp), %%edx\n" /* edx = hold */
+" movl 44(%%esp), %%ebx\n" /* ebx = bits */
+" movl 32(%%esp), %%ebp\n" /* ebp = lcode */
+
+" cld\n"
+" jmp .L_do_loop\n"
+
+".align 32,0x90\n"
+".L_while_test:\n"
+" cmpl %%edi, 24(%%esp)\n" /* out < end */
+" jbe .L_break_loop\n"
+" cmpl %%esi, 12(%%esp)\n" /* in < last */
+" jbe .L_break_loop\n"
+
+".L_do_loop:\n"
+" cmpb $15, %%bl\n"
+" ja .L_get_length_code\n" /* if (15 < bits) */
+
+" xorl %%eax, %%eax\n"
+" lodsw\n" /* al = *(ushort *)in++ */
+" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */
+" addb $16, %%bl\n" /* bits += 16 */
+" shll %%cl, %%eax\n"
+" orl %%eax, %%edx\n" /* hold |= *((ushort *)in)++ << bits */
+
+".L_get_length_code:\n"
+" movl 56(%%esp), %%eax\n" /* eax = lmask */
+" andl %%edx, %%eax\n" /* eax &= hold */
+" movl (%%ebp,%%eax,4), %%eax\n" /* eax = lcode[hold & lmask] */
+
+".L_dolen:\n"
+" movb %%ah, %%cl\n" /* cl = this.bits */
+" subb %%ah, %%bl\n" /* bits -= this.bits */
+" shrl %%cl, %%edx\n" /* hold >>= this.bits */
+
+" testb %%al, %%al\n"
+" jnz .L_test_for_length_base\n" /* if (op != 0) 45.7% */
+
+" shrl $16, %%eax\n" /* output this.val char */
+" stosb\n"
+" jmp .L_while_test\n"
+
+".align 32,0x90\n"
+".L_test_for_length_base:\n"
+" movl %%eax, %%ecx\n" /* len = this */
+" shrl $16, %%ecx\n" /* len = this.val */
+" movl %%ecx, 64(%%esp)\n" /* save len */
+" movb %%al, %%cl\n"
+
+" testb $16, %%al\n"
+" jz .L_test_for_second_level_length\n" /* if ((op & 16) == 0) 8% */
+" andb $15, %%cl\n" /* op &= 15 */
+" jz .L_decode_distance\n" /* if (!op) */
+" cmpb %%cl, %%bl\n"
+" jae .L_add_bits_to_len\n" /* if (op <= bits) */
+
+" movb %%cl, %%ch\n" /* stash op in ch, freeing cl */
+" xorl %%eax, %%eax\n"
+" lodsw\n" /* al = *(ushort *)in++ */
+" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */
+" addb $16, %%bl\n" /* bits += 16 */
+" shll %%cl, %%eax\n"
+" orl %%eax, %%edx\n" /* hold |= *((ushort *)in)++ << bits */
+" movb %%ch, %%cl\n" /* move op back to ecx */
+
+".L_add_bits_to_len:\n"
+" subb %%cl, %%bl\n"
+" xorl %%eax, %%eax\n"
+" incl %%eax\n"
+" shll %%cl, %%eax\n"
+" decl %%eax\n"
+" andl %%edx, %%eax\n" /* eax &= hold */
+" shrl %%cl, %%edx\n"
+" addl %%eax, 64(%%esp)\n" /* len += hold & mask[op] */
+
+".L_decode_distance:\n"
+" cmpb $15, %%bl\n"
+" ja .L_get_distance_code\n" /* if (15 < bits) */
+
+" xorl %%eax, %%eax\n"
+" lodsw\n" /* al = *(ushort *)in++ */
+" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */
+" addb $16, %%bl\n" /* bits += 16 */
+" shll %%cl, %%eax\n"
+" orl %%eax, %%edx\n" /* hold |= *((ushort *)in)++ << bits */
+
+".L_get_distance_code:\n"
+" movl 60(%%esp), %%eax\n" /* eax = dmask */
+" movl 36(%%esp), %%ecx\n" /* ecx = dcode */
+" andl %%edx, %%eax\n" /* eax &= hold */
+" movl (%%ecx,%%eax,4), %%eax\n"/* eax = dcode[hold & dmask] */
+
+".L_dodist:\n"
+" movl %%eax, %%ebp\n" /* dist = this */
+" shrl $16, %%ebp\n" /* dist = this.val */
+" movb %%ah, %%cl\n"
+" subb %%ah, %%bl\n" /* bits -= this.bits */
+" shrl %%cl, %%edx\n" /* hold >>= this.bits */
+" movb %%al, %%cl\n" /* cl = this.op */
+
+" testb $16, %%al\n" /* if ((op & 16) == 0) */
+" jz .L_test_for_second_level_dist\n"
+" andb $15, %%cl\n" /* op &= 15 */
+" jz .L_check_dist_one\n"
+" cmpb %%cl, %%bl\n"
+" jae .L_add_bits_to_dist\n" /* if (op <= bits) 97.6% */
+
+" movb %%cl, %%ch\n" /* stash op in ch, freeing cl */
+" xorl %%eax, %%eax\n"
+" lodsw\n" /* al = *(ushort *)in++ */
+" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */
+" addb $16, %%bl\n" /* bits += 16 */
+" shll %%cl, %%eax\n"
+" orl %%eax, %%edx\n" /* hold |= *((ushort *)in)++ << bits */
+" movb %%ch, %%cl\n" /* move op back to ecx */
+
+".L_add_bits_to_dist:\n"
+" subb %%cl, %%bl\n"
+" xorl %%eax, %%eax\n"
+" incl %%eax\n"
+" shll %%cl, %%eax\n"
+" decl %%eax\n" /* (1 << op) - 1 */
+" andl %%edx, %%eax\n" /* eax &= hold */
+" shrl %%cl, %%edx\n"
+" addl %%eax, %%ebp\n" /* dist += hold & ((1 << op) - 1) */
+
+".L_check_window:\n"
+" movl %%esi, 8(%%esp)\n" /* save in so from can use it's reg */
+" movl %%edi, %%eax\n"
+" subl 20(%%esp), %%eax\n" /* nbytes = out - beg */
+
+" cmpl %%ebp, %%eax\n"
+" jb .L_clip_window\n" /* if (dist > nbytes) 4.2% */
+
+" movl 64(%%esp), %%ecx\n" /* ecx = len */
+" movl %%edi, %%esi\n"
+" subl %%ebp, %%esi\n" /* from = out - dist */
+
+" sarl %%ecx\n"
+" jnc .L_copy_two\n" /* if len % 2 == 0 */
+
+" rep movsw\n"
+" movb (%%esi), %%al\n"
+" movb %%al, (%%edi)\n"
+" incl %%edi\n"
+
+" movl 8(%%esp), %%esi\n" /* move in back to %esi, toss from */
+" movl 32(%%esp), %%ebp\n" /* ebp = lcode */
+" jmp .L_while_test\n"
+
+".L_copy_two:\n"
+" rep movsw\n"
+" movl 8(%%esp), %%esi\n" /* move in back to %esi, toss from */
+" movl 32(%%esp), %%ebp\n" /* ebp = lcode */
+" jmp .L_while_test\n"
+
+".align 32,0x90\n"
+".L_check_dist_one:\n"
+" cmpl $1, %%ebp\n" /* if dist 1, is a memset */
+" jne .L_check_window\n"
+" cmpl %%edi, 20(%%esp)\n"
+" je .L_check_window\n" /* out == beg, if outside window */
+
+" movl 64(%%esp), %%ecx\n" /* ecx = len */
+" movb -1(%%edi), %%al\n"
+" movb %%al, %%ah\n"
+
+" sarl %%ecx\n"
+" jnc .L_set_two\n"
+" movb %%al, (%%edi)\n"
+" incl %%edi\n"
+
+".L_set_two:\n"
+" rep stosw\n"
+" movl 32(%%esp), %%ebp\n" /* ebp = lcode */
+" jmp .L_while_test\n"
+
+".align 32,0x90\n"
+".L_test_for_second_level_length:\n"
+" testb $64, %%al\n"
+" jnz .L_test_for_end_of_block\n" /* if ((op & 64) != 0) */
+
+" xorl %%eax, %%eax\n"
+" incl %%eax\n"
+" shll %%cl, %%eax\n"
+" decl %%eax\n"
+" andl %%edx, %%eax\n" /* eax &= hold */
+" addl 64(%%esp), %%eax\n" /* eax += len */
+" movl (%%ebp,%%eax,4), %%eax\n" /* eax = lcode[val+(hold&mask[op])]*/
+" jmp .L_dolen\n"
+
+".align 32,0x90\n"
+".L_test_for_second_level_dist:\n"
+" testb $64, %%al\n"
+" jnz .L_invalid_distance_code\n" /* if ((op & 64) != 0) */
+
+" xorl %%eax, %%eax\n"
+" incl %%eax\n"
+" shll %%cl, %%eax\n"
+" decl %%eax\n"
+" andl %%edx, %%eax\n" /* eax &= hold */
+" addl %%ebp, %%eax\n" /* eax += dist */
+" movl 36(%%esp), %%ecx\n" /* ecx = dcode */
+" movl (%%ecx,%%eax,4), %%eax\n" /* eax = dcode[val+(hold&mask[op])]*/
+" jmp .L_dodist\n"
+
+".align 32,0x90\n"
+".L_clip_window:\n"
+" movl %%eax, %%ecx\n"
+" movl 48(%%esp), %%eax\n" /* eax = wsize */
+" negl %%ecx\n" /* nbytes = -nbytes */
+" movl 28(%%esp), %%esi\n" /* from = window */
+
+" cmpl %%ebp, %%eax\n"
+" jb .L_invalid_distance_too_far\n" /* if (dist > wsize) */
+
+" addl %%ebp, %%ecx\n" /* nbytes = dist - nbytes */
+" cmpl $0, 52(%%esp)\n"
+" jne .L_wrap_around_window\n" /* if (write != 0) */
+
+" subl %%ecx, %%eax\n"
+" addl %%eax, %%esi\n" /* from += wsize - nbytes */
+
+" movl 64(%%esp), %%eax\n" /* eax = len */
+" cmpl %%ecx, %%eax\n"
+" jbe .L_do_copy\n" /* if (nbytes >= len) */
+
+" subl %%ecx, %%eax\n" /* len -= nbytes */
+" rep movsb\n"
+" movl %%edi, %%esi\n"
+" subl %%ebp, %%esi\n" /* from = out - dist */
+" jmp .L_do_copy\n"
+
+".align 32,0x90\n"
+".L_wrap_around_window:\n"
+" movl 52(%%esp), %%eax\n" /* eax = write */
+" cmpl %%eax, %%ecx\n"
+" jbe .L_contiguous_in_window\n" /* if (write >= nbytes) */
+
+" addl 48(%%esp), %%esi\n" /* from += wsize */
+" addl %%eax, %%esi\n" /* from += write */
+" subl %%ecx, %%esi\n" /* from -= nbytes */
+" subl %%eax, %%ecx\n" /* nbytes -= write */
+
+" movl 64(%%esp), %%eax\n" /* eax = len */
+" cmpl %%ecx, %%eax\n"
+" jbe .L_do_copy\n" /* if (nbytes >= len) */
+
+" subl %%ecx, %%eax\n" /* len -= nbytes */
+" rep movsb\n"
+" movl 28(%%esp), %%esi\n" /* from = window */
+" movl 52(%%esp), %%ecx\n" /* nbytes = write */
+" cmpl %%ecx, %%eax\n"
+" jbe .L_do_copy\n" /* if (nbytes >= len) */
+
+" subl %%ecx, %%eax\n" /* len -= nbytes */
+" rep movsb\n"
+" movl %%edi, %%esi\n"
+" subl %%ebp, %%esi\n" /* from = out - dist */
+" jmp .L_do_copy\n"
+
+".align 32,0x90\n"
+".L_contiguous_in_window:\n"
+" addl %%eax, %%esi\n"
+" subl %%ecx, %%esi\n" /* from += write - nbytes */
+
+" movl 64(%%esp), %%eax\n" /* eax = len */
+" cmpl %%ecx, %%eax\n"
+" jbe .L_do_copy\n" /* if (nbytes >= len) */
+
+" subl %%ecx, %%eax\n" /* len -= nbytes */
+" rep movsb\n"
+" movl %%edi, %%esi\n"
+" subl %%ebp, %%esi\n" /* from = out - dist */
+" jmp .L_do_copy\n" /* if (nbytes >= len) */
+
+".align 32,0x90\n"
+".L_do_copy:\n"
+" movl %%eax, %%ecx\n"
+" rep movsb\n"
+
+" movl 8(%%esp), %%esi\n" /* move in back to %esi, toss from */
+" movl 32(%%esp), %%ebp\n" /* ebp = lcode */
+" jmp .L_while_test\n"
+
+".L_test_for_end_of_block:\n"
+" testb $32, %%al\n"
+" jz .L_invalid_literal_length_code\n"
+" movl $1, 72(%%esp)\n"
+" jmp .L_break_loop_with_status\n"
+
+".L_invalid_literal_length_code:\n"
+" movl $2, 72(%%esp)\n"
+" jmp .L_break_loop_with_status\n"
+
+".L_invalid_distance_code:\n"
+" movl $3, 72(%%esp)\n"
+" jmp .L_break_loop_with_status\n"
+
+".L_invalid_distance_too_far:\n"
+" movl 8(%%esp), %%esi\n"
+" movl $4, 72(%%esp)\n"
+" jmp .L_break_loop_with_status\n"
+
+".L_break_loop:\n"
+" movl $0, 72(%%esp)\n"
+
+".L_break_loop_with_status:\n"
+/* put in, out, bits, and hold back into ar and pop esp */
+" movl %%esi, 8(%%esp)\n" /* save in */
+" movl %%edi, 16(%%esp)\n" /* save out */
+" movl %%ebx, 44(%%esp)\n" /* save bits */
+" movl %%edx, 40(%%esp)\n" /* save hold */
+" movl 4(%%esp), %%ebp\n" /* restore esp, ebp */
+" movl (%%esp), %%esp\n"
+ :
+ : "m" (ar)
+ : "memory", "%eax", "%ebx", "%ecx", "%edx", "%esi", "%edi"
+ );
+#elif defined( _MSC_VER ) && ! defined( _M_AMD64 )
+ __asm {
+ lea eax, ar
+ mov [eax], esp /* save esp, ebp */
+ mov [eax+4], ebp
+ mov esp, eax
+ mov esi, [esp+8] /* esi = in */
+ mov edi, [esp+16] /* edi = out */
+ mov edx, [esp+40] /* edx = hold */
+ mov ebx, [esp+44] /* ebx = bits */
+ mov ebp, [esp+32] /* ebp = lcode */
+
+ cld
+ jmp L_do_loop
+
+ALIGN 4
+L_while_test:
+ cmp [esp+24], edi
+ jbe L_break_loop
+ cmp [esp+12], esi
+ jbe L_break_loop
+
+L_do_loop:
+ cmp bl, 15
+ ja L_get_length_code /* if (15 < bits) */
+
+ xor eax, eax
+ lodsw /* al = *(ushort *)in++ */
+ mov cl, bl /* cl = bits, needs it for shifting */
+ add bl, 16 /* bits += 16 */
+ shl eax, cl
+ or edx, eax /* hold |= *((ushort *)in)++ << bits */
+
+L_get_length_code:
+ mov eax, [esp+56] /* eax = lmask */
+ and eax, edx /* eax &= hold */
+ mov eax, [ebp+eax*4] /* eax = lcode[hold & lmask] */
+
+L_dolen:
+ mov cl, ah /* cl = this.bits */
+ sub bl, ah /* bits -= this.bits */
+ shr edx, cl /* hold >>= this.bits */
+
+ test al, al
+ jnz L_test_for_length_base /* if (op != 0) 45.7% */
+
+ shr eax, 16 /* output this.val char */
+ stosb
+ jmp L_while_test
+
+ALIGN 4
+L_test_for_length_base:
+ mov ecx, eax /* len = this */
+ shr ecx, 16 /* len = this.val */
+ mov [esp+64], ecx /* save len */
+ mov cl, al
+
+ test al, 16
+ jz L_test_for_second_level_length /* if ((op & 16) == 0) 8% */
+ and cl, 15 /* op &= 15 */
+ jz L_decode_distance /* if (!op) */
+ cmp bl, cl
+ jae L_add_bits_to_len /* if (op <= bits) */
+
+ mov ch, cl /* stash op in ch, freeing cl */
+ xor eax, eax
+ lodsw /* al = *(ushort *)in++ */
+ mov cl, bl /* cl = bits, needs it for shifting */
+ add bl, 16 /* bits += 16 */
+ shl eax, cl
+ or edx, eax /* hold |= *((ushort *)in)++ << bits */
+ mov cl, ch /* move op back to ecx */
+
+L_add_bits_to_len:
+ sub bl, cl
+ xor eax, eax
+ inc eax
+ shl eax, cl
+ dec eax
+ and eax, edx /* eax &= hold */
+ shr edx, cl
+ add [esp+64], eax /* len += hold & mask[op] */
+
+L_decode_distance:
+ cmp bl, 15
+ ja L_get_distance_code /* if (15 < bits) */
+
+ xor eax, eax
+ lodsw /* al = *(ushort *)in++ */
+ mov cl, bl /* cl = bits, needs it for shifting */
+ add bl, 16 /* bits += 16 */
+ shl eax, cl
+ or edx, eax /* hold |= *((ushort *)in)++ << bits */
+
+L_get_distance_code:
+ mov eax, [esp+60] /* eax = dmask */
+ mov ecx, [esp+36] /* ecx = dcode */
+ and eax, edx /* eax &= hold */
+ mov eax, [ecx+eax*4]/* eax = dcode[hold & dmask] */
+
+L_dodist:
+ mov ebp, eax /* dist = this */
+ shr ebp, 16 /* dist = this.val */
+ mov cl, ah
+ sub bl, ah /* bits -= this.bits */
+ shr edx, cl /* hold >>= this.bits */
+ mov cl, al /* cl = this.op */
+
+ test al, 16 /* if ((op & 16) == 0) */
+ jz L_test_for_second_level_dist
+ and cl, 15 /* op &= 15 */
+ jz L_check_dist_one
+ cmp bl, cl
+ jae L_add_bits_to_dist /* if (op <= bits) 97.6% */
+
+ mov ch, cl /* stash op in ch, freeing cl */
+ xor eax, eax
+ lodsw /* al = *(ushort *)in++ */
+ mov cl, bl /* cl = bits, needs it for shifting */
+ add bl, 16 /* bits += 16 */
+ shl eax, cl
+ or edx, eax /* hold |= *((ushort *)in)++ << bits */
+ mov cl, ch /* move op back to ecx */
+
+L_add_bits_to_dist:
+ sub bl, cl
+ xor eax, eax
+ inc eax
+ shl eax, cl
+ dec eax /* (1 << op) - 1 */
+ and eax, edx /* eax &= hold */
+ shr edx, cl
+ add ebp, eax /* dist += hold & ((1 << op) - 1) */
+
+L_check_window:
+ mov [esp+8], esi /* save in so from can use it's reg */
+ mov eax, edi
+ sub eax, [esp+20] /* nbytes = out - beg */
+
+ cmp eax, ebp
+ jb L_clip_window /* if (dist > nbytes) 4.2% */
+
+ mov ecx, [esp+64] /* ecx = len */
+ mov esi, edi
+ sub esi, ebp /* from = out - dist */
+
+ sar ecx, 1
+ jnc L_copy_two
+
+ rep movsw
+ mov al, [esi]
+ mov [edi], al
+ inc edi
+
+ mov esi, [esp+8] /* move in back to %esi, toss from */
+ mov ebp, [esp+32] /* ebp = lcode */
+ jmp L_while_test
+
+L_copy_two:
+ rep movsw
+ mov esi, [esp+8] /* move in back to %esi, toss from */
+ mov ebp, [esp+32] /* ebp = lcode */
+ jmp L_while_test
+
+ALIGN 4
+L_check_dist_one:
+ cmp ebp, 1 /* if dist 1, is a memset */
+ jne L_check_window
+ cmp [esp+20], edi
+ je L_check_window /* out == beg, if outside window */
+
+ mov ecx, [esp+64] /* ecx = len */
+ mov al, [edi-1]
+ mov ah, al
+
+ sar ecx, 1
+ jnc L_set_two
+ mov [edi], al /* memset out with from[-1] */
+ inc edi
+
+L_set_two:
+ rep stosw
+ mov ebp, [esp+32] /* ebp = lcode */
+ jmp L_while_test
+
+ALIGN 4
+L_test_for_second_level_length:
+ test al, 64
+ jnz L_test_for_end_of_block /* if ((op & 64) != 0) */
+
+ xor eax, eax
+ inc eax
+ shl eax, cl
+ dec eax
+ and eax, edx /* eax &= hold */
+ add eax, [esp+64] /* eax += len */
+ mov eax, [ebp+eax*4] /* eax = lcode[val+(hold&mask[op])]*/
+ jmp L_dolen
+
+ALIGN 4
+L_test_for_second_level_dist:
+ test al, 64
+ jnz L_invalid_distance_code /* if ((op & 64) != 0) */
+
+ xor eax, eax
+ inc eax
+ shl eax, cl
+ dec eax
+ and eax, edx /* eax &= hold */
+ add eax, ebp /* eax += dist */
+ mov ecx, [esp+36] /* ecx = dcode */
+ mov eax, [ecx+eax*4] /* eax = dcode[val+(hold&mask[op])]*/
+ jmp L_dodist
+
+ALIGN 4
+L_clip_window:
+ mov ecx, eax
+ mov eax, [esp+48] /* eax = wsize */
+ neg ecx /* nbytes = -nbytes */
+ mov esi, [esp+28] /* from = window */
+
+ cmp eax, ebp
+ jb L_invalid_distance_too_far /* if (dist > wsize) */
+
+ add ecx, ebp /* nbytes = dist - nbytes */
+ cmp dword ptr [esp+52], 0
+ jne L_wrap_around_window /* if (write != 0) */
+
+ sub eax, ecx
+ add esi, eax /* from += wsize - nbytes */
+
+ mov eax, [esp+64] /* eax = len */
+ cmp eax, ecx
+ jbe L_do_copy /* if (nbytes >= len) */
+
+ sub eax, ecx /* len -= nbytes */
+ rep movsb
+ mov esi, edi
+ sub esi, ebp /* from = out - dist */
+ jmp L_do_copy
+
+ALIGN 4
+L_wrap_around_window:
+ mov eax, [esp+52] /* eax = write */
+ cmp ecx, eax
+ jbe L_contiguous_in_window /* if (write >= nbytes) */
+
+ add esi, [esp+48] /* from += wsize */
+ add esi, eax /* from += write */
+ sub esi, ecx /* from -= nbytes */
+ sub ecx, eax /* nbytes -= write */
+
+ mov eax, [esp+64] /* eax = len */
+ cmp eax, ecx
+ jbe L_do_copy /* if (nbytes >= len) */
+
+ sub eax, ecx /* len -= nbytes */
+ rep movsb
+ mov esi, [esp+28] /* from = window */
+ mov ecx, [esp+52] /* nbytes = write */
+ cmp eax, ecx
+ jbe L_do_copy /* if (nbytes >= len) */
+
+ sub eax, ecx /* len -= nbytes */
+ rep movsb
+ mov esi, edi
+ sub esi, ebp /* from = out - dist */
+ jmp L_do_copy
+
+ALIGN 4
+L_contiguous_in_window:
+ add esi, eax
+ sub esi, ecx /* from += write - nbytes */
+
+ mov eax, [esp+64] /* eax = len */
+ cmp eax, ecx
+ jbe L_do_copy /* if (nbytes >= len) */
+
+ sub eax, ecx /* len -= nbytes */
+ rep movsb
+ mov esi, edi
+ sub esi, ebp /* from = out - dist */
+ jmp L_do_copy
+
+ALIGN 4
+L_do_copy:
+ mov ecx, eax
+ rep movsb
+
+ mov esi, [esp+8] /* move in back to %esi, toss from */
+ mov ebp, [esp+32] /* ebp = lcode */
+ jmp L_while_test
+
+L_test_for_end_of_block:
+ test al, 32
+ jz L_invalid_literal_length_code
+ mov dword ptr [esp+72], 1
+ jmp L_break_loop_with_status
+
+L_invalid_literal_length_code:
+ mov dword ptr [esp+72], 2
+ jmp L_break_loop_with_status
+
+L_invalid_distance_code:
+ mov dword ptr [esp+72], 3
+ jmp L_break_loop_with_status
+
+L_invalid_distance_too_far:
+ mov esi, [esp+4]
+ mov dword ptr [esp+72], 4
+ jmp L_break_loop_with_status
+
+L_break_loop:
+ mov dword ptr [esp+72], 0
+
+L_break_loop_with_status:
+/* put in, out, bits, and hold back into ar and pop esp */
+ mov [esp+8], esi /* save in */
+ mov [esp+16], edi /* save out */
+ mov [esp+44], ebx /* save bits */
+ mov [esp+40], edx /* save hold */
+ mov ebp, [esp+4] /* restore esp, ebp */
+ mov esp, [esp]
+ }
+#else
+#error "x86 architecture not defined"
+#endif
+
+ if (ar.status > 1) {
+ if (ar.status == 2)
+ strm->msg = "invalid literal/length code";
+ else if (ar.status == 3)
+ strm->msg = "invalid distance code";
+ else
+ strm->msg = "invalid distance too far back";
+ state->mode = BAD;
+ }
+ else if ( ar.status == 1 ) {
+ state->mode = TYPE;
+ }
+
+ /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
+ ar.len = ar.bits >> 3;
+ ar.in -= ar.len;
+ ar.bits -= ar.len << 3;
+ ar.hold &= (1U << ar.bits) - 1;
+
+ /* update state and return */
+ strm->next_in = ar.in;
+ strm->next_out = ar.out;
+ strm->avail_in = (unsigned)(ar.in < ar.last ?
+ PAD_AVAIL_IN + (ar.last - ar.in) :
+ PAD_AVAIL_IN - (ar.in - ar.last));
+ strm->avail_out = (unsigned)(ar.out < ar.end ?
+ PAD_AVAIL_OUT + (ar.end - ar.out) :
+ PAD_AVAIL_OUT - (ar.out - ar.end));
+ state->hold = ar.hold;
+ state->bits = ar.bits;
+ return;
+}
+
diff --git a/protocols/Telegram/tgl/zlib/contrib/inflate86/inffast.S b/protocols/Telegram/tgl/zlib/contrib/inflate86/inffast.S
new file mode 100644
index 0000000000..2245a2905b
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/inflate86/inffast.S
@@ -0,0 +1,1368 @@
+/*
+ * inffast.S is a hand tuned assembler version of:
+ *
+ * inffast.c -- fast decoding
+ * Copyright (C) 1995-2003 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ *
+ * Copyright (C) 2003 Chris Anderson <christop@charm.net>
+ * Please use the copyright conditions above.
+ *
+ * This version (Jan-23-2003) of inflate_fast was coded and tested under
+ * GNU/Linux on a pentium 3, using the gcc-3.2 compiler distribution. On that
+ * machine, I found that gzip style archives decompressed about 20% faster than
+ * the gcc-3.2 -O3 -fomit-frame-pointer compiled version. Your results will
+ * depend on how large of a buffer is used for z_stream.next_in & next_out
+ * (8K-32K worked best for my 256K cpu cache) and how much overhead there is in
+ * stream processing I/O and crc32/addler32. In my case, this routine used
+ * 70% of the cpu time and crc32 used 20%.
+ *
+ * I am confident that this version will work in the general case, but I have
+ * not tested a wide variety of datasets or a wide variety of platforms.
+ *
+ * Jan-24-2003 -- Added -DUSE_MMX define for slightly faster inflating.
+ * It should be a runtime flag instead of compile time flag...
+ *
+ * Jan-26-2003 -- Added runtime check for MMX support with cpuid instruction.
+ * With -DUSE_MMX, only MMX code is compiled. With -DNO_MMX, only non-MMX code
+ * is compiled. Without either option, runtime detection is enabled. Runtime
+ * detection should work on all modern cpus and the recomended algorithm (flip
+ * ID bit on eflags and then use the cpuid instruction) is used in many
+ * multimedia applications. Tested under win2k with gcc-2.95 and gas-2.12
+ * distributed with cygwin3. Compiling with gcc-2.95 -c inffast.S -o
+ * inffast.obj generates a COFF object which can then be linked with MSVC++
+ * compiled code. Tested under FreeBSD 4.7 with gcc-2.95.
+ *
+ * Jan-28-2003 -- Tested Athlon XP... MMX mode is slower than no MMX (and
+ * slower than compiler generated code). Adjusted cpuid check to use the MMX
+ * code only for Pentiums < P4 until I have more data on the P4. Speed
+ * improvment is only about 15% on the Athlon when compared with code generated
+ * with MSVC++. Not sure yet, but I think the P4 will also be slower using the
+ * MMX mode because many of it's x86 ALU instructions execute in .5 cycles and
+ * have less latency than MMX ops. Added code to buffer the last 11 bytes of
+ * the input stream since the MMX code grabs bits in chunks of 32, which
+ * differs from the inffast.c algorithm. I don't think there would have been
+ * read overruns where a page boundary was crossed (a segfault), but there
+ * could have been overruns when next_in ends on unaligned memory (unintialized
+ * memory read).
+ *
+ * Mar-13-2003 -- P4 MMX is slightly slower than P4 NO_MMX. I created a C
+ * version of the non-MMX code so that it doesn't depend on zstrm and zstate
+ * structure offsets which are hard coded in this file. This was last tested
+ * with zlib-1.2.0 which is currently in beta testing, newer versions of this
+ * and inffas86.c can be found at http://www.eetbeetee.com/zlib/ and
+ * http://www.charm.net/~christop/zlib/
+ */
+
+
+/*
+ * if you have underscore linking problems (_inflate_fast undefined), try
+ * using -DGAS_COFF
+ */
+#if ! defined( GAS_COFF ) && ! defined( GAS_ELF )
+
+#if defined( WIN32 ) || defined( __CYGWIN__ )
+#define GAS_COFF /* windows object format */
+#else
+#define GAS_ELF
+#endif
+
+#endif /* ! GAS_COFF && ! GAS_ELF */
+
+
+#if defined( GAS_COFF )
+
+/* coff externals have underscores */
+#define inflate_fast _inflate_fast
+#define inflate_fast_use_mmx _inflate_fast_use_mmx
+
+#endif /* GAS_COFF */
+
+
+.file "inffast.S"
+
+.globl inflate_fast
+
+.text
+.align 4,0
+.L_invalid_literal_length_code_msg:
+.string "invalid literal/length code"
+
+.align 4,0
+.L_invalid_distance_code_msg:
+.string "invalid distance code"
+
+.align 4,0
+.L_invalid_distance_too_far_msg:
+.string "invalid distance too far back"
+
+#if ! defined( NO_MMX )
+.align 4,0
+.L_mask: /* mask[N] = ( 1 << N ) - 1 */
+.long 0
+.long 1
+.long 3
+.long 7
+.long 15
+.long 31
+.long 63
+.long 127
+.long 255
+.long 511
+.long 1023
+.long 2047
+.long 4095
+.long 8191
+.long 16383
+.long 32767
+.long 65535
+.long 131071
+.long 262143
+.long 524287
+.long 1048575
+.long 2097151
+.long 4194303
+.long 8388607
+.long 16777215
+.long 33554431
+.long 67108863
+.long 134217727
+.long 268435455
+.long 536870911
+.long 1073741823
+.long 2147483647
+.long 4294967295
+#endif /* NO_MMX */
+
+.text
+
+/*
+ * struct z_stream offsets, in zlib.h
+ */
+#define next_in_strm 0 /* strm->next_in */
+#define avail_in_strm 4 /* strm->avail_in */
+#define next_out_strm 12 /* strm->next_out */
+#define avail_out_strm 16 /* strm->avail_out */
+#define msg_strm 24 /* strm->msg */
+#define state_strm 28 /* strm->state */
+
+/*
+ * struct inflate_state offsets, in inflate.h
+ */
+#define mode_state 0 /* state->mode */
+#define wsize_state 32 /* state->wsize */
+#define write_state 40 /* state->write */
+#define window_state 44 /* state->window */
+#define hold_state 48 /* state->hold */
+#define bits_state 52 /* state->bits */
+#define lencode_state 68 /* state->lencode */
+#define distcode_state 72 /* state->distcode */
+#define lenbits_state 76 /* state->lenbits */
+#define distbits_state 80 /* state->distbits */
+
+/*
+ * inflate_fast's activation record
+ */
+#define local_var_size 64 /* how much local space for vars */
+#define strm_sp 88 /* first arg: z_stream * (local_var_size + 24) */
+#define start_sp 92 /* second arg: unsigned int (local_var_size + 28) */
+
+/*
+ * offsets for local vars on stack
+ */
+#define out 60 /* unsigned char* */
+#define window 56 /* unsigned char* */
+#define wsize 52 /* unsigned int */
+#define write 48 /* unsigned int */
+#define in 44 /* unsigned char* */
+#define beg 40 /* unsigned char* */
+#define buf 28 /* char[ 12 ] */
+#define len 24 /* unsigned int */
+#define last 20 /* unsigned char* */
+#define end 16 /* unsigned char* */
+#define dcode 12 /* code* */
+#define lcode 8 /* code* */
+#define dmask 4 /* unsigned int */
+#define lmask 0 /* unsigned int */
+
+/*
+ * typedef enum inflate_mode consts, in inflate.h
+ */
+#define INFLATE_MODE_TYPE 11 /* state->mode flags enum-ed in inflate.h */
+#define INFLATE_MODE_BAD 26
+
+
+#if ! defined( USE_MMX ) && ! defined( NO_MMX )
+
+#define RUN_TIME_MMX
+
+#define CHECK_MMX 1
+#define DO_USE_MMX 2
+#define DONT_USE_MMX 3
+
+.globl inflate_fast_use_mmx
+
+.data
+
+.align 4,0
+inflate_fast_use_mmx: /* integer flag for run time control 1=check,2=mmx,3=no */
+.long CHECK_MMX
+
+#if defined( GAS_ELF )
+/* elf info */
+.type inflate_fast_use_mmx,@object
+.size inflate_fast_use_mmx,4
+#endif
+
+#endif /* RUN_TIME_MMX */
+
+#if defined( GAS_COFF )
+/* coff info: scl 2 = extern, type 32 = function */
+.def inflate_fast; .scl 2; .type 32; .endef
+#endif
+
+.text
+
+.align 32,0x90
+inflate_fast:
+ pushl %edi
+ pushl %esi
+ pushl %ebp
+ pushl %ebx
+ pushf /* save eflags (strm_sp, state_sp assumes this is 32 bits) */
+ subl $local_var_size, %esp
+ cld
+
+#define strm_r %esi
+#define state_r %edi
+
+ movl strm_sp(%esp), strm_r
+ movl state_strm(strm_r), state_r
+
+ /* in = strm->next_in;
+ * out = strm->next_out;
+ * last = in + strm->avail_in - 11;
+ * beg = out - (start - strm->avail_out);
+ * end = out + (strm->avail_out - 257);
+ */
+ movl avail_in_strm(strm_r), %edx
+ movl next_in_strm(strm_r), %eax
+
+ addl %eax, %edx /* avail_in += next_in */
+ subl $11, %edx /* avail_in -= 11 */
+
+ movl %eax, in(%esp)
+ movl %edx, last(%esp)
+
+ movl start_sp(%esp), %ebp
+ movl avail_out_strm(strm_r), %ecx
+ movl next_out_strm(strm_r), %ebx
+
+ subl %ecx, %ebp /* start -= avail_out */
+ negl %ebp /* start = -start */
+ addl %ebx, %ebp /* start += next_out */
+
+ subl $257, %ecx /* avail_out -= 257 */
+ addl %ebx, %ecx /* avail_out += out */
+
+ movl %ebx, out(%esp)
+ movl %ebp, beg(%esp)
+ movl %ecx, end(%esp)
+
+ /* wsize = state->wsize;
+ * write = state->write;
+ * window = state->window;
+ * hold = state->hold;
+ * bits = state->bits;
+ * lcode = state->lencode;
+ * dcode = state->distcode;
+ * lmask = ( 1 << state->lenbits ) - 1;
+ * dmask = ( 1 << state->distbits ) - 1;
+ */
+
+ movl lencode_state(state_r), %eax
+ movl distcode_state(state_r), %ecx
+
+ movl %eax, lcode(%esp)
+ movl %ecx, dcode(%esp)
+
+ movl $1, %eax
+ movl lenbits_state(state_r), %ecx
+ shll %cl, %eax
+ decl %eax
+ movl %eax, lmask(%esp)
+
+ movl $1, %eax
+ movl distbits_state(state_r), %ecx
+ shll %cl, %eax
+ decl %eax
+ movl %eax, dmask(%esp)
+
+ movl wsize_state(state_r), %eax
+ movl write_state(state_r), %ecx
+ movl window_state(state_r), %edx
+
+ movl %eax, wsize(%esp)
+ movl %ecx, write(%esp)
+ movl %edx, window(%esp)
+
+ movl hold_state(state_r), %ebp
+ movl bits_state(state_r), %ebx
+
+#undef strm_r
+#undef state_r
+
+#define in_r %esi
+#define from_r %esi
+#define out_r %edi
+
+ movl in(%esp), in_r
+ movl last(%esp), %ecx
+ cmpl in_r, %ecx
+ ja .L_align_long /* if in < last */
+
+ addl $11, %ecx /* ecx = &in[ avail_in ] */
+ subl in_r, %ecx /* ecx = avail_in */
+ movl $12, %eax
+ subl %ecx, %eax /* eax = 12 - avail_in */
+ leal buf(%esp), %edi
+ rep movsb /* memcpy( buf, in, avail_in ) */
+ movl %eax, %ecx
+ xorl %eax, %eax
+ rep stosb /* memset( &buf[ avail_in ], 0, 12 - avail_in ) */
+ leal buf(%esp), in_r /* in = buf */
+ movl in_r, last(%esp) /* last = in, do just one iteration */
+ jmp .L_is_aligned
+
+ /* align in_r on long boundary */
+.L_align_long:
+ testl $3, in_r
+ jz .L_is_aligned
+ xorl %eax, %eax
+ movb (in_r), %al
+ incl in_r
+ movl %ebx, %ecx
+ addl $8, %ebx
+ shll %cl, %eax
+ orl %eax, %ebp
+ jmp .L_align_long
+
+.L_is_aligned:
+ movl out(%esp), out_r
+
+#if defined( NO_MMX )
+ jmp .L_do_loop
+#endif
+
+#if defined( USE_MMX )
+ jmp .L_init_mmx
+#endif
+
+/*** Runtime MMX check ***/
+
+#if defined( RUN_TIME_MMX )
+.L_check_mmx:
+ cmpl $DO_USE_MMX, inflate_fast_use_mmx
+ je .L_init_mmx
+ ja .L_do_loop /* > 2 */
+
+ pushl %eax
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ pushf
+ movl (%esp), %eax /* copy eflags to eax */
+ xorl $0x200000, (%esp) /* try toggling ID bit of eflags (bit 21)
+ * to see if cpu supports cpuid...
+ * ID bit method not supported by NexGen but
+ * bios may load a cpuid instruction and
+ * cpuid may be disabled on Cyrix 5-6x86 */
+ popf
+ pushf
+ popl %edx /* copy new eflags to edx */
+ xorl %eax, %edx /* test if ID bit is flipped */
+ jz .L_dont_use_mmx /* not flipped if zero */
+ xorl %eax, %eax
+ cpuid
+ cmpl $0x756e6547, %ebx /* check for GenuineIntel in ebx,ecx,edx */
+ jne .L_dont_use_mmx
+ cmpl $0x6c65746e, %ecx
+ jne .L_dont_use_mmx
+ cmpl $0x49656e69, %edx
+ jne .L_dont_use_mmx
+ movl $1, %eax
+ cpuid /* get cpu features */
+ shrl $8, %eax
+ andl $15, %eax
+ cmpl $6, %eax /* check for Pentium family, is 0xf for P4 */
+ jne .L_dont_use_mmx
+ testl $0x800000, %edx /* test if MMX feature is set (bit 23) */
+ jnz .L_use_mmx
+ jmp .L_dont_use_mmx
+.L_use_mmx:
+ movl $DO_USE_MMX, inflate_fast_use_mmx
+ jmp .L_check_mmx_pop
+.L_dont_use_mmx:
+ movl $DONT_USE_MMX, inflate_fast_use_mmx
+.L_check_mmx_pop:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ popl %eax
+ jmp .L_check_mmx
+#endif
+
+
+/*** Non-MMX code ***/
+
+#if defined ( NO_MMX ) || defined( RUN_TIME_MMX )
+
+#define hold_r %ebp
+#define bits_r %bl
+#define bitslong_r %ebx
+
+.align 32,0x90
+.L_while_test:
+ /* while (in < last && out < end)
+ */
+ cmpl out_r, end(%esp)
+ jbe .L_break_loop /* if (out >= end) */
+
+ cmpl in_r, last(%esp)
+ jbe .L_break_loop
+
+.L_do_loop:
+ /* regs: %esi = in, %ebp = hold, %bl = bits, %edi = out
+ *
+ * do {
+ * if (bits < 15) {
+ * hold |= *((unsigned short *)in)++ << bits;
+ * bits += 16
+ * }
+ * this = lcode[hold & lmask]
+ */
+ cmpb $15, bits_r
+ ja .L_get_length_code /* if (15 < bits) */
+
+ xorl %eax, %eax
+ lodsw /* al = *(ushort *)in++ */
+ movb bits_r, %cl /* cl = bits, needs it for shifting */
+ addb $16, bits_r /* bits += 16 */
+ shll %cl, %eax
+ orl %eax, hold_r /* hold |= *((ushort *)in)++ << bits */
+
+.L_get_length_code:
+ movl lmask(%esp), %edx /* edx = lmask */
+ movl lcode(%esp), %ecx /* ecx = lcode */
+ andl hold_r, %edx /* edx &= hold */
+ movl (%ecx,%edx,4), %eax /* eax = lcode[hold & lmask] */
+
+.L_dolen:
+ /* regs: %esi = in, %ebp = hold, %bl = bits, %edi = out
+ *
+ * dolen:
+ * bits -= this.bits;
+ * hold >>= this.bits
+ */
+ movb %ah, %cl /* cl = this.bits */
+ subb %ah, bits_r /* bits -= this.bits */
+ shrl %cl, hold_r /* hold >>= this.bits */
+
+ /* check if op is a literal
+ * if (op == 0) {
+ * PUP(out) = this.val;
+ * }
+ */
+ testb %al, %al
+ jnz .L_test_for_length_base /* if (op != 0) 45.7% */
+
+ shrl $16, %eax /* output this.val char */
+ stosb
+ jmp .L_while_test
+
+.L_test_for_length_base:
+ /* regs: %esi = in, %ebp = hold, %bl = bits, %edi = out, %edx = len
+ *
+ * else if (op & 16) {
+ * len = this.val
+ * op &= 15
+ * if (op) {
+ * if (op > bits) {
+ * hold |= *((unsigned short *)in)++ << bits;
+ * bits += 16
+ * }
+ * len += hold & mask[op];
+ * bits -= op;
+ * hold >>= op;
+ * }
+ */
+#define len_r %edx
+ movl %eax, len_r /* len = this */
+ shrl $16, len_r /* len = this.val */
+ movb %al, %cl
+
+ testb $16, %al
+ jz .L_test_for_second_level_length /* if ((op & 16) == 0) 8% */
+ andb $15, %cl /* op &= 15 */
+ jz .L_save_len /* if (!op) */
+ cmpb %cl, bits_r
+ jae .L_add_bits_to_len /* if (op <= bits) */
+
+ movb %cl, %ch /* stash op in ch, freeing cl */
+ xorl %eax, %eax
+ lodsw /* al = *(ushort *)in++ */
+ movb bits_r, %cl /* cl = bits, needs it for shifting */
+ addb $16, bits_r /* bits += 16 */
+ shll %cl, %eax
+ orl %eax, hold_r /* hold |= *((ushort *)in)++ << bits */
+ movb %ch, %cl /* move op back to ecx */
+
+.L_add_bits_to_len:
+ movl $1, %eax
+ shll %cl, %eax
+ decl %eax
+ subb %cl, bits_r
+ andl hold_r, %eax /* eax &= hold */
+ shrl %cl, hold_r
+ addl %eax, len_r /* len += hold & mask[op] */
+
+.L_save_len:
+ movl len_r, len(%esp) /* save len */
+#undef len_r
+
+.L_decode_distance:
+ /* regs: %esi = in, %ebp = hold, %bl = bits, %edi = out, %edx = dist
+ *
+ * if (bits < 15) {
+ * hold |= *((unsigned short *)in)++ << bits;
+ * bits += 16
+ * }
+ * this = dcode[hold & dmask];
+ * dodist:
+ * bits -= this.bits;
+ * hold >>= this.bits;
+ * op = this.op;
+ */
+
+ cmpb $15, bits_r
+ ja .L_get_distance_code /* if (15 < bits) */
+
+ xorl %eax, %eax
+ lodsw /* al = *(ushort *)in++ */
+ movb bits_r, %cl /* cl = bits, needs it for shifting */
+ addb $16, bits_r /* bits += 16 */
+ shll %cl, %eax
+ orl %eax, hold_r /* hold |= *((ushort *)in)++ << bits */
+
+.L_get_distance_code:
+ movl dmask(%esp), %edx /* edx = dmask */
+ movl dcode(%esp), %ecx /* ecx = dcode */
+ andl hold_r, %edx /* edx &= hold */
+ movl (%ecx,%edx,4), %eax /* eax = dcode[hold & dmask] */
+
+#define dist_r %edx
+.L_dodist:
+ movl %eax, dist_r /* dist = this */
+ shrl $16, dist_r /* dist = this.val */
+ movb %ah, %cl
+ subb %ah, bits_r /* bits -= this.bits */
+ shrl %cl, hold_r /* hold >>= this.bits */
+
+ /* if (op & 16) {
+ * dist = this.val
+ * op &= 15
+ * if (op > bits) {
+ * hold |= *((unsigned short *)in)++ << bits;
+ * bits += 16
+ * }
+ * dist += hold & mask[op];
+ * bits -= op;
+ * hold >>= op;
+ */
+ movb %al, %cl /* cl = this.op */
+
+ testb $16, %al /* if ((op & 16) == 0) */
+ jz .L_test_for_second_level_dist
+ andb $15, %cl /* op &= 15 */
+ jz .L_check_dist_one
+ cmpb %cl, bits_r
+ jae .L_add_bits_to_dist /* if (op <= bits) 97.6% */
+
+ movb %cl, %ch /* stash op in ch, freeing cl */
+ xorl %eax, %eax
+ lodsw /* al = *(ushort *)in++ */
+ movb bits_r, %cl /* cl = bits, needs it for shifting */
+ addb $16, bits_r /* bits += 16 */
+ shll %cl, %eax
+ orl %eax, hold_r /* hold |= *((ushort *)in)++ << bits */
+ movb %ch, %cl /* move op back to ecx */
+
+.L_add_bits_to_dist:
+ movl $1, %eax
+ shll %cl, %eax
+ decl %eax /* (1 << op) - 1 */
+ subb %cl, bits_r
+ andl hold_r, %eax /* eax &= hold */
+ shrl %cl, hold_r
+ addl %eax, dist_r /* dist += hold & ((1 << op) - 1) */
+ jmp .L_check_window
+
+.L_check_window:
+ /* regs: %esi = from, %ebp = hold, %bl = bits, %edi = out, %edx = dist
+ * %ecx = nbytes
+ *
+ * nbytes = out - beg;
+ * if (dist <= nbytes) {
+ * from = out - dist;
+ * do {
+ * PUP(out) = PUP(from);
+ * } while (--len > 0) {
+ * }
+ */
+
+ movl in_r, in(%esp) /* save in so from can use it's reg */
+ movl out_r, %eax
+ subl beg(%esp), %eax /* nbytes = out - beg */
+
+ cmpl dist_r, %eax
+ jb .L_clip_window /* if (dist > nbytes) 4.2% */
+
+ movl len(%esp), %ecx
+ movl out_r, from_r
+ subl dist_r, from_r /* from = out - dist */
+
+ subl $3, %ecx
+ movb (from_r), %al
+ movb %al, (out_r)
+ movb 1(from_r), %al
+ movb 2(from_r), %dl
+ addl $3, from_r
+ movb %al, 1(out_r)
+ movb %dl, 2(out_r)
+ addl $3, out_r
+ rep movsb
+
+ movl in(%esp), in_r /* move in back to %esi, toss from */
+ jmp .L_while_test
+
+.align 16,0x90
+.L_check_dist_one:
+ cmpl $1, dist_r
+ jne .L_check_window
+ cmpl out_r, beg(%esp)
+ je .L_check_window
+
+ decl out_r
+ movl len(%esp), %ecx
+ movb (out_r), %al
+ subl $3, %ecx
+
+ movb %al, 1(out_r)
+ movb %al, 2(out_r)
+ movb %al, 3(out_r)
+ addl $4, out_r
+ rep stosb
+
+ jmp .L_while_test
+
+.align 16,0x90
+.L_test_for_second_level_length:
+ /* else if ((op & 64) == 0) {
+ * this = lcode[this.val + (hold & mask[op])];
+ * }
+ */
+ testb $64, %al
+ jnz .L_test_for_end_of_block /* if ((op & 64) != 0) */
+
+ movl $1, %eax
+ shll %cl, %eax
+ decl %eax
+ andl hold_r, %eax /* eax &= hold */
+ addl %edx, %eax /* eax += this.val */
+ movl lcode(%esp), %edx /* edx = lcode */
+ movl (%edx,%eax,4), %eax /* eax = lcode[val + (hold&mask[op])] */
+ jmp .L_dolen
+
+.align 16,0x90
+.L_test_for_second_level_dist:
+ /* else if ((op & 64) == 0) {
+ * this = dcode[this.val + (hold & mask[op])];
+ * }
+ */
+ testb $64, %al
+ jnz .L_invalid_distance_code /* if ((op & 64) != 0) */
+
+ movl $1, %eax
+ shll %cl, %eax
+ decl %eax
+ andl hold_r, %eax /* eax &= hold */
+ addl %edx, %eax /* eax += this.val */
+ movl dcode(%esp), %edx /* edx = dcode */
+ movl (%edx,%eax,4), %eax /* eax = dcode[val + (hold&mask[op])] */
+ jmp .L_dodist
+
+.align 16,0x90
+.L_clip_window:
+ /* regs: %esi = from, %ebp = hold, %bl = bits, %edi = out, %edx = dist
+ * %ecx = nbytes
+ *
+ * else {
+ * if (dist > wsize) {
+ * invalid distance
+ * }
+ * from = window;
+ * nbytes = dist - nbytes;
+ * if (write == 0) {
+ * from += wsize - nbytes;
+ */
+#define nbytes_r %ecx
+ movl %eax, nbytes_r
+ movl wsize(%esp), %eax /* prepare for dist compare */
+ negl nbytes_r /* nbytes = -nbytes */
+ movl window(%esp), from_r /* from = window */
+
+ cmpl dist_r, %eax
+ jb .L_invalid_distance_too_far /* if (dist > wsize) */
+
+ addl dist_r, nbytes_r /* nbytes = dist - nbytes */
+ cmpl $0, write(%esp)
+ jne .L_wrap_around_window /* if (write != 0) */
+
+ subl nbytes_r, %eax
+ addl %eax, from_r /* from += wsize - nbytes */
+
+ /* regs: %esi = from, %ebp = hold, %bl = bits, %edi = out, %edx = dist
+ * %ecx = nbytes, %eax = len
+ *
+ * if (nbytes < len) {
+ * len -= nbytes;
+ * do {
+ * PUP(out) = PUP(from);
+ * } while (--nbytes);
+ * from = out - dist;
+ * }
+ * }
+ */
+#define len_r %eax
+ movl len(%esp), len_r
+ cmpl nbytes_r, len_r
+ jbe .L_do_copy1 /* if (nbytes >= len) */
+
+ subl nbytes_r, len_r /* len -= nbytes */
+ rep movsb
+ movl out_r, from_r
+ subl dist_r, from_r /* from = out - dist */
+ jmp .L_do_copy1
+
+ cmpl nbytes_r, len_r
+ jbe .L_do_copy1 /* if (nbytes >= len) */
+
+ subl nbytes_r, len_r /* len -= nbytes */
+ rep movsb
+ movl out_r, from_r
+ subl dist_r, from_r /* from = out - dist */
+ jmp .L_do_copy1
+
+.L_wrap_around_window:
+ /* regs: %esi = from, %ebp = hold, %bl = bits, %edi = out, %edx = dist
+ * %ecx = nbytes, %eax = write, %eax = len
+ *
+ * else if (write < nbytes) {
+ * from += wsize + write - nbytes;
+ * nbytes -= write;
+ * if (nbytes < len) {
+ * len -= nbytes;
+ * do {
+ * PUP(out) = PUP(from);
+ * } while (--nbytes);
+ * from = window;
+ * nbytes = write;
+ * if (nbytes < len) {
+ * len -= nbytes;
+ * do {
+ * PUP(out) = PUP(from);
+ * } while(--nbytes);
+ * from = out - dist;
+ * }
+ * }
+ * }
+ */
+#define write_r %eax
+ movl write(%esp), write_r
+ cmpl write_r, nbytes_r
+ jbe .L_contiguous_in_window /* if (write >= nbytes) */
+
+ addl wsize(%esp), from_r
+ addl write_r, from_r
+ subl nbytes_r, from_r /* from += wsize + write - nbytes */
+ subl write_r, nbytes_r /* nbytes -= write */
+#undef write_r
+
+ movl len(%esp), len_r
+ cmpl nbytes_r, len_r
+ jbe .L_do_copy1 /* if (nbytes >= len) */
+
+ subl nbytes_r, len_r /* len -= nbytes */
+ rep movsb
+ movl window(%esp), from_r /* from = window */
+ movl write(%esp), nbytes_r /* nbytes = write */
+ cmpl nbytes_r, len_r
+ jbe .L_do_copy1 /* if (nbytes >= len) */
+
+ subl nbytes_r, len_r /* len -= nbytes */
+ rep movsb
+ movl out_r, from_r
+ subl dist_r, from_r /* from = out - dist */
+ jmp .L_do_copy1
+
+.L_contiguous_in_window:
+ /* regs: %esi = from, %ebp = hold, %bl = bits, %edi = out, %edx = dist
+ * %ecx = nbytes, %eax = write, %eax = len
+ *
+ * else {
+ * from += write - nbytes;
+ * if (nbytes < len) {
+ * len -= nbytes;
+ * do {
+ * PUP(out) = PUP(from);
+ * } while (--nbytes);
+ * from = out - dist;
+ * }
+ * }
+ */
+#define write_r %eax
+ addl write_r, from_r
+ subl nbytes_r, from_r /* from += write - nbytes */
+#undef write_r
+
+ movl len(%esp), len_r
+ cmpl nbytes_r, len_r
+ jbe .L_do_copy1 /* if (nbytes >= len) */
+
+ subl nbytes_r, len_r /* len -= nbytes */
+ rep movsb
+ movl out_r, from_r
+ subl dist_r, from_r /* from = out - dist */
+
+.L_do_copy1:
+ /* regs: %esi = from, %esi = in, %ebp = hold, %bl = bits, %edi = out
+ * %eax = len
+ *
+ * while (len > 0) {
+ * PUP(out) = PUP(from);
+ * len--;
+ * }
+ * }
+ * } while (in < last && out < end);
+ */
+#undef nbytes_r
+#define in_r %esi
+ movl len_r, %ecx
+ rep movsb
+
+ movl in(%esp), in_r /* move in back to %esi, toss from */
+ jmp .L_while_test
+
+#undef len_r
+#undef dist_r
+
+#endif /* NO_MMX || RUN_TIME_MMX */
+
+
+/*** MMX code ***/
+
+#if defined( USE_MMX ) || defined( RUN_TIME_MMX )
+
+.align 32,0x90
+.L_init_mmx:
+ emms
+
+#undef bits_r
+#undef bitslong_r
+#define bitslong_r %ebp
+#define hold_mm %mm0
+ movd %ebp, hold_mm
+ movl %ebx, bitslong_r
+
+#define used_mm %mm1
+#define dmask2_mm %mm2
+#define lmask2_mm %mm3
+#define lmask_mm %mm4
+#define dmask_mm %mm5
+#define tmp_mm %mm6
+
+ movd lmask(%esp), lmask_mm
+ movq lmask_mm, lmask2_mm
+ movd dmask(%esp), dmask_mm
+ movq dmask_mm, dmask2_mm
+ pxor used_mm, used_mm
+ movl lcode(%esp), %ebx /* ebx = lcode */
+ jmp .L_do_loop_mmx
+
+.align 32,0x90
+.L_while_test_mmx:
+ /* while (in < last && out < end)
+ */
+ cmpl out_r, end(%esp)
+ jbe .L_break_loop /* if (out >= end) */
+
+ cmpl in_r, last(%esp)
+ jbe .L_break_loop
+
+.L_do_loop_mmx:
+ psrlq used_mm, hold_mm /* hold_mm >>= last bit length */
+
+ cmpl $32, bitslong_r
+ ja .L_get_length_code_mmx /* if (32 < bits) */
+
+ movd bitslong_r, tmp_mm
+ movd (in_r), %mm7
+ addl $4, in_r
+ psllq tmp_mm, %mm7
+ addl $32, bitslong_r
+ por %mm7, hold_mm /* hold_mm |= *((uint *)in)++ << bits */
+
+.L_get_length_code_mmx:
+ pand hold_mm, lmask_mm
+ movd lmask_mm, %eax
+ movq lmask2_mm, lmask_mm
+ movl (%ebx,%eax,4), %eax /* eax = lcode[hold & lmask] */
+
+.L_dolen_mmx:
+ movzbl %ah, %ecx /* ecx = this.bits */
+ movd %ecx, used_mm
+ subl %ecx, bitslong_r /* bits -= this.bits */
+
+ testb %al, %al
+ jnz .L_test_for_length_base_mmx /* if (op != 0) 45.7% */
+
+ shrl $16, %eax /* output this.val char */
+ stosb
+ jmp .L_while_test_mmx
+
+.L_test_for_length_base_mmx:
+#define len_r %edx
+ movl %eax, len_r /* len = this */
+ shrl $16, len_r /* len = this.val */
+
+ testb $16, %al
+ jz .L_test_for_second_level_length_mmx /* if ((op & 16) == 0) 8% */
+ andl $15, %eax /* op &= 15 */
+ jz .L_decode_distance_mmx /* if (!op) */
+
+ psrlq used_mm, hold_mm /* hold_mm >>= last bit length */
+ movd %eax, used_mm
+ movd hold_mm, %ecx
+ subl %eax, bitslong_r
+ andl .L_mask(,%eax,4), %ecx
+ addl %ecx, len_r /* len += hold & mask[op] */
+
+.L_decode_distance_mmx:
+ psrlq used_mm, hold_mm /* hold_mm >>= last bit length */
+
+ cmpl $32, bitslong_r
+ ja .L_get_dist_code_mmx /* if (32 < bits) */
+
+ movd bitslong_r, tmp_mm
+ movd (in_r), %mm7
+ addl $4, in_r
+ psllq tmp_mm, %mm7
+ addl $32, bitslong_r
+ por %mm7, hold_mm /* hold_mm |= *((uint *)in)++ << bits */
+
+.L_get_dist_code_mmx:
+ movl dcode(%esp), %ebx /* ebx = dcode */
+ pand hold_mm, dmask_mm
+ movd dmask_mm, %eax
+ movq dmask2_mm, dmask_mm
+ movl (%ebx,%eax,4), %eax /* eax = dcode[hold & lmask] */
+
+.L_dodist_mmx:
+#define dist_r %ebx
+ movzbl %ah, %ecx /* ecx = this.bits */
+ movl %eax, dist_r
+ shrl $16, dist_r /* dist = this.val */
+ subl %ecx, bitslong_r /* bits -= this.bits */
+ movd %ecx, used_mm
+
+ testb $16, %al /* if ((op & 16) == 0) */
+ jz .L_test_for_second_level_dist_mmx
+ andl $15, %eax /* op &= 15 */
+ jz .L_check_dist_one_mmx
+
+.L_add_bits_to_dist_mmx:
+ psrlq used_mm, hold_mm /* hold_mm >>= last bit length */
+ movd %eax, used_mm /* save bit length of current op */
+ movd hold_mm, %ecx /* get the next bits on input stream */
+ subl %eax, bitslong_r /* bits -= op bits */
+ andl .L_mask(,%eax,4), %ecx /* ecx = hold & mask[op] */
+ addl %ecx, dist_r /* dist += hold & mask[op] */
+
+.L_check_window_mmx:
+ movl in_r, in(%esp) /* save in so from can use it's reg */
+ movl out_r, %eax
+ subl beg(%esp), %eax /* nbytes = out - beg */
+
+ cmpl dist_r, %eax
+ jb .L_clip_window_mmx /* if (dist > nbytes) 4.2% */
+
+ movl len_r, %ecx
+ movl out_r, from_r
+ subl dist_r, from_r /* from = out - dist */
+
+ subl $3, %ecx
+ movb (from_r), %al
+ movb %al, (out_r)
+ movb 1(from_r), %al
+ movb 2(from_r), %dl
+ addl $3, from_r
+ movb %al, 1(out_r)
+ movb %dl, 2(out_r)
+ addl $3, out_r
+ rep movsb
+
+ movl in(%esp), in_r /* move in back to %esi, toss from */
+ movl lcode(%esp), %ebx /* move lcode back to %ebx, toss dist */
+ jmp .L_while_test_mmx
+
+.align 16,0x90
+.L_check_dist_one_mmx:
+ cmpl $1, dist_r
+ jne .L_check_window_mmx
+ cmpl out_r, beg(%esp)
+ je .L_check_window_mmx
+
+ decl out_r
+ movl len_r, %ecx
+ movb (out_r), %al
+ subl $3, %ecx
+
+ movb %al, 1(out_r)
+ movb %al, 2(out_r)
+ movb %al, 3(out_r)
+ addl $4, out_r
+ rep stosb
+
+ movl lcode(%esp), %ebx /* move lcode back to %ebx, toss dist */
+ jmp .L_while_test_mmx
+
+.align 16,0x90
+.L_test_for_second_level_length_mmx:
+ testb $64, %al
+ jnz .L_test_for_end_of_block /* if ((op & 64) != 0) */
+
+ andl $15, %eax
+ psrlq used_mm, hold_mm /* hold_mm >>= last bit length */
+ movd hold_mm, %ecx
+ andl .L_mask(,%eax,4), %ecx
+ addl len_r, %ecx
+ movl (%ebx,%ecx,4), %eax /* eax = lcode[hold & lmask] */
+ jmp .L_dolen_mmx
+
+.align 16,0x90
+.L_test_for_second_level_dist_mmx:
+ testb $64, %al
+ jnz .L_invalid_distance_code /* if ((op & 64) != 0) */
+
+ andl $15, %eax
+ psrlq used_mm, hold_mm /* hold_mm >>= last bit length */
+ movd hold_mm, %ecx
+ andl .L_mask(,%eax,4), %ecx
+ movl dcode(%esp), %eax /* ecx = dcode */
+ addl dist_r, %ecx
+ movl (%eax,%ecx,4), %eax /* eax = lcode[hold & lmask] */
+ jmp .L_dodist_mmx
+
+.align 16,0x90
+.L_clip_window_mmx:
+#define nbytes_r %ecx
+ movl %eax, nbytes_r
+ movl wsize(%esp), %eax /* prepare for dist compare */
+ negl nbytes_r /* nbytes = -nbytes */
+ movl window(%esp), from_r /* from = window */
+
+ cmpl dist_r, %eax
+ jb .L_invalid_distance_too_far /* if (dist > wsize) */
+
+ addl dist_r, nbytes_r /* nbytes = dist - nbytes */
+ cmpl $0, write(%esp)
+ jne .L_wrap_around_window_mmx /* if (write != 0) */
+
+ subl nbytes_r, %eax
+ addl %eax, from_r /* from += wsize - nbytes */
+
+ cmpl nbytes_r, len_r
+ jbe .L_do_copy1_mmx /* if (nbytes >= len) */
+
+ subl nbytes_r, len_r /* len -= nbytes */
+ rep movsb
+ movl out_r, from_r
+ subl dist_r, from_r /* from = out - dist */
+ jmp .L_do_copy1_mmx
+
+ cmpl nbytes_r, len_r
+ jbe .L_do_copy1_mmx /* if (nbytes >= len) */
+
+ subl nbytes_r, len_r /* len -= nbytes */
+ rep movsb
+ movl out_r, from_r
+ subl dist_r, from_r /* from = out - dist */
+ jmp .L_do_copy1_mmx
+
+.L_wrap_around_window_mmx:
+#define write_r %eax
+ movl write(%esp), write_r
+ cmpl write_r, nbytes_r
+ jbe .L_contiguous_in_window_mmx /* if (write >= nbytes) */
+
+ addl wsize(%esp), from_r
+ addl write_r, from_r
+ subl nbytes_r, from_r /* from += wsize + write - nbytes */
+ subl write_r, nbytes_r /* nbytes -= write */
+#undef write_r
+
+ cmpl nbytes_r, len_r
+ jbe .L_do_copy1_mmx /* if (nbytes >= len) */
+
+ subl nbytes_r, len_r /* len -= nbytes */
+ rep movsb
+ movl window(%esp), from_r /* from = window */
+ movl write(%esp), nbytes_r /* nbytes = write */
+ cmpl nbytes_r, len_r
+ jbe .L_do_copy1_mmx /* if (nbytes >= len) */
+
+ subl nbytes_r, len_r /* len -= nbytes */
+ rep movsb
+ movl out_r, from_r
+ subl dist_r, from_r /* from = out - dist */
+ jmp .L_do_copy1_mmx
+
+.L_contiguous_in_window_mmx:
+#define write_r %eax
+ addl write_r, from_r
+ subl nbytes_r, from_r /* from += write - nbytes */
+#undef write_r
+
+ cmpl nbytes_r, len_r
+ jbe .L_do_copy1_mmx /* if (nbytes >= len) */
+
+ subl nbytes_r, len_r /* len -= nbytes */
+ rep movsb
+ movl out_r, from_r
+ subl dist_r, from_r /* from = out - dist */
+
+.L_do_copy1_mmx:
+#undef nbytes_r
+#define in_r %esi
+ movl len_r, %ecx
+ rep movsb
+
+ movl in(%esp), in_r /* move in back to %esi, toss from */
+ movl lcode(%esp), %ebx /* move lcode back to %ebx, toss dist */
+ jmp .L_while_test_mmx
+
+#undef hold_r
+#undef bitslong_r
+
+#endif /* USE_MMX || RUN_TIME_MMX */
+
+
+/*** USE_MMX, NO_MMX, and RUNTIME_MMX from here on ***/
+
+.L_invalid_distance_code:
+ /* else {
+ * strm->msg = "invalid distance code";
+ * state->mode = BAD;
+ * }
+ */
+ movl $.L_invalid_distance_code_msg, %ecx
+ movl $INFLATE_MODE_BAD, %edx
+ jmp .L_update_stream_state
+
+.L_test_for_end_of_block:
+ /* else if (op & 32) {
+ * state->mode = TYPE;
+ * break;
+ * }
+ */
+ testb $32, %al
+ jz .L_invalid_literal_length_code /* if ((op & 32) == 0) */
+
+ movl $0, %ecx
+ movl $INFLATE_MODE_TYPE, %edx
+ jmp .L_update_stream_state
+
+.L_invalid_literal_length_code:
+ /* else {
+ * strm->msg = "invalid literal/length code";
+ * state->mode = BAD;
+ * }
+ */
+ movl $.L_invalid_literal_length_code_msg, %ecx
+ movl $INFLATE_MODE_BAD, %edx
+ jmp .L_update_stream_state
+
+.L_invalid_distance_too_far:
+ /* strm->msg = "invalid distance too far back";
+ * state->mode = BAD;
+ */
+ movl in(%esp), in_r /* from_r has in's reg, put in back */
+ movl $.L_invalid_distance_too_far_msg, %ecx
+ movl $INFLATE_MODE_BAD, %edx
+ jmp .L_update_stream_state
+
+.L_update_stream_state:
+ /* set strm->msg = %ecx, strm->state->mode = %edx */
+ movl strm_sp(%esp), %eax
+ testl %ecx, %ecx /* if (msg != NULL) */
+ jz .L_skip_msg
+ movl %ecx, msg_strm(%eax) /* strm->msg = msg */
+.L_skip_msg:
+ movl state_strm(%eax), %eax /* state = strm->state */
+ movl %edx, mode_state(%eax) /* state->mode = edx (BAD | TYPE) */
+ jmp .L_break_loop
+
+.align 32,0x90
+.L_break_loop:
+
+/*
+ * Regs:
+ *
+ * bits = %ebp when mmx, and in %ebx when non-mmx
+ * hold = %hold_mm when mmx, and in %ebp when non-mmx
+ * in = %esi
+ * out = %edi
+ */
+
+#if defined( USE_MMX ) || defined( RUN_TIME_MMX )
+
+#if defined( RUN_TIME_MMX )
+
+ cmpl $DO_USE_MMX, inflate_fast_use_mmx
+ jne .L_update_next_in
+
+#endif /* RUN_TIME_MMX */
+
+ movl %ebp, %ebx
+
+.L_update_next_in:
+
+#endif
+
+#define strm_r %eax
+#define state_r %edx
+
+ /* len = bits >> 3;
+ * in -= len;
+ * bits -= len << 3;
+ * hold &= (1U << bits) - 1;
+ * state->hold = hold;
+ * state->bits = bits;
+ * strm->next_in = in;
+ * strm->next_out = out;
+ */
+ movl strm_sp(%esp), strm_r
+ movl %ebx, %ecx
+ movl state_strm(strm_r), state_r
+ shrl $3, %ecx
+ subl %ecx, in_r
+ shll $3, %ecx
+ subl %ecx, %ebx
+ movl out_r, next_out_strm(strm_r)
+ movl %ebx, bits_state(state_r)
+ movl %ebx, %ecx
+
+ leal buf(%esp), %ebx
+ cmpl %ebx, last(%esp)
+ jne .L_buf_not_used /* if buf != last */
+
+ subl %ebx, in_r /* in -= buf */
+ movl next_in_strm(strm_r), %ebx
+ movl %ebx, last(%esp) /* last = strm->next_in */
+ addl %ebx, in_r /* in += strm->next_in */
+ movl avail_in_strm(strm_r), %ebx
+ subl $11, %ebx
+ addl %ebx, last(%esp) /* last = &strm->next_in[ avail_in - 11 ] */
+
+.L_buf_not_used:
+ movl in_r, next_in_strm(strm_r)
+
+ movl $1, %ebx
+ shll %cl, %ebx
+ decl %ebx
+
+#if defined( USE_MMX ) || defined( RUN_TIME_MMX )
+
+#if defined( RUN_TIME_MMX )
+
+ cmpl $DO_USE_MMX, inflate_fast_use_mmx
+ jne .L_update_hold
+
+#endif /* RUN_TIME_MMX */
+
+ psrlq used_mm, hold_mm /* hold_mm >>= last bit length */
+ movd hold_mm, %ebp
+
+ emms
+
+.L_update_hold:
+
+#endif /* USE_MMX || RUN_TIME_MMX */
+
+ andl %ebx, %ebp
+ movl %ebp, hold_state(state_r)
+
+#define last_r %ebx
+
+ /* strm->avail_in = in < last ? 11 + (last - in) : 11 - (in - last) */
+ movl last(%esp), last_r
+ cmpl in_r, last_r
+ jbe .L_last_is_smaller /* if (in >= last) */
+
+ subl in_r, last_r /* last -= in */
+ addl $11, last_r /* last += 11 */
+ movl last_r, avail_in_strm(strm_r)
+ jmp .L_fixup_out
+.L_last_is_smaller:
+ subl last_r, in_r /* in -= last */
+ negl in_r /* in = -in */
+ addl $11, in_r /* in += 11 */
+ movl in_r, avail_in_strm(strm_r)
+
+#undef last_r
+#define end_r %ebx
+
+.L_fixup_out:
+ /* strm->avail_out = out < end ? 257 + (end - out) : 257 - (out - end)*/
+ movl end(%esp), end_r
+ cmpl out_r, end_r
+ jbe .L_end_is_smaller /* if (out >= end) */
+
+ subl out_r, end_r /* end -= out */
+ addl $257, end_r /* end += 257 */
+ movl end_r, avail_out_strm(strm_r)
+ jmp .L_done
+.L_end_is_smaller:
+ subl end_r, out_r /* out -= end */
+ negl out_r /* out = -out */
+ addl $257, out_r /* out += 257 */
+ movl out_r, avail_out_strm(strm_r)
+
+#undef end_r
+#undef strm_r
+#undef state_r
+
+.L_done:
+ addl $local_var_size, %esp
+ popf
+ popl %ebx
+ popl %ebp
+ popl %esi
+ popl %edi
+ ret
+
+#if defined( GAS_ELF )
+/* elf info */
+.type inflate_fast,@function
+.size inflate_fast,.-inflate_fast
+#endif
diff --git a/protocols/Telegram/tgl/zlib/contrib/iostream/test.cpp b/protocols/Telegram/tgl/zlib/contrib/iostream/test.cpp
new file mode 100644
index 0000000000..7d265b3b5c
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/iostream/test.cpp
@@ -0,0 +1,24 @@
+
+#include "zfstream.h"
+
+int main() {
+
+ // Construct a stream object with this filebuffer. Anything sent
+ // to this stream will go to standard out.
+ gzofstream os( 1, ios::out );
+
+ // This text is getting compressed and sent to stdout.
+ // To prove this, run 'test | zcat'.
+ os << "Hello, Mommy" << endl;
+
+ os << setcompressionlevel( Z_NO_COMPRESSION );
+ os << "hello, hello, hi, ho!" << endl;
+
+ setcompressionlevel( os, Z_DEFAULT_COMPRESSION )
+ << "I'm compressing again" << endl;
+
+ os.close();
+
+ return 0;
+
+}
diff --git a/protocols/Telegram/tgl/zlib/contrib/iostream/zfstream.cpp b/protocols/Telegram/tgl/zlib/contrib/iostream/zfstream.cpp
new file mode 100644
index 0000000000..d0cd85faaf
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/iostream/zfstream.cpp
@@ -0,0 +1,329 @@
+
+#include "zfstream.h"
+
+gzfilebuf::gzfilebuf() :
+ file(NULL),
+ mode(0),
+ own_file_descriptor(0)
+{ }
+
+gzfilebuf::~gzfilebuf() {
+
+ sync();
+ if ( own_file_descriptor )
+ close();
+
+}
+
+gzfilebuf *gzfilebuf::open( const char *name,
+ int io_mode ) {
+
+ if ( is_open() )
+ return NULL;
+
+ char char_mode[10];
+ char *p = char_mode;
+
+ if ( io_mode & ios::in ) {
+ mode = ios::in;
+ *p++ = 'r';
+ } else if ( io_mode & ios::app ) {
+ mode = ios::app;
+ *p++ = 'a';
+ } else {
+ mode = ios::out;
+ *p++ = 'w';
+ }
+
+ if ( io_mode & ios::binary ) {
+ mode |= ios::binary;
+ *p++ = 'b';
+ }
+
+ // Hard code the compression level
+ if ( io_mode & (ios::out|ios::app )) {
+ *p++ = '9';
+ }
+
+ // Put the end-of-string indicator
+ *p = '\0';
+
+ if ( (file = gzopen(name, char_mode)) == NULL )
+ return NULL;
+
+ own_file_descriptor = 1;
+
+ return this;
+
+}
+
+gzfilebuf *gzfilebuf::attach( int file_descriptor,
+ int io_mode ) {
+
+ if ( is_open() )
+ return NULL;
+
+ char char_mode[10];
+ char *p = char_mode;
+
+ if ( io_mode & ios::in ) {
+ mode = ios::in;
+ *p++ = 'r';
+ } else if ( io_mode & ios::app ) {
+ mode = ios::app;
+ *p++ = 'a';
+ } else {
+ mode = ios::out;
+ *p++ = 'w';
+ }
+
+ if ( io_mode & ios::binary ) {
+ mode |= ios::binary;
+ *p++ = 'b';
+ }
+
+ // Hard code the compression level
+ if ( io_mode & (ios::out|ios::app )) {
+ *p++ = '9';
+ }
+
+ // Put the end-of-string indicator
+ *p = '\0';
+
+ if ( (file = gzdopen(file_descriptor, char_mode)) == NULL )
+ return NULL;
+
+ own_file_descriptor = 0;
+
+ return this;
+
+}
+
+gzfilebuf *gzfilebuf::close() {
+
+ if ( is_open() ) {
+
+ sync();
+ gzclose( file );
+ file = NULL;
+
+ }
+
+ return this;
+
+}
+
+int gzfilebuf::setcompressionlevel( int comp_level ) {
+
+ return gzsetparams(file, comp_level, -2);
+
+}
+
+int gzfilebuf::setcompressionstrategy( int comp_strategy ) {
+
+ return gzsetparams(file, -2, comp_strategy);
+
+}
+
+
+streampos gzfilebuf::seekoff( streamoff off, ios::seek_dir dir, int which ) {
+
+ return streampos(EOF);
+
+}
+
+int gzfilebuf::underflow() {
+
+ // If the file hasn't been opened for reading, error.
+ if ( !is_open() || !(mode & ios::in) )
+ return EOF;
+
+ // if a buffer doesn't exists, allocate one.
+ if ( !base() ) {
+
+ if ( (allocate()) == EOF )
+ return EOF;
+ setp(0,0);
+
+ } else {
+
+ if ( in_avail() )
+ return (unsigned char) *gptr();
+
+ if ( out_waiting() ) {
+ if ( flushbuf() == EOF )
+ return EOF;
+ }
+
+ }
+
+ // Attempt to fill the buffer.
+
+ int result = fillbuf();
+ if ( result == EOF ) {
+ // disable get area
+ setg(0,0,0);
+ return EOF;
+ }
+
+ return (unsigned char) *gptr();
+
+}
+
+int gzfilebuf::overflow( int c ) {
+
+ if ( !is_open() || !(mode & ios::out) )
+ return EOF;
+
+ if ( !base() ) {
+ if ( allocate() == EOF )
+ return EOF;
+ setg(0,0,0);
+ } else {
+ if (in_avail()) {
+ return EOF;
+ }
+ if (out_waiting()) {
+ if (flushbuf() == EOF)
+ return EOF;
+ }
+ }
+
+ int bl = blen();
+ setp( base(), base() + bl);
+
+ if ( c != EOF ) {
+
+ *pptr() = c;
+ pbump(1);
+
+ }
+
+ return 0;
+
+}
+
+int gzfilebuf::sync() {
+
+ if ( !is_open() )
+ return EOF;
+
+ if ( out_waiting() )
+ return flushbuf();
+
+ return 0;
+
+}
+
+int gzfilebuf::flushbuf() {
+
+ int n;
+ char *q;
+
+ q = pbase();
+ n = pptr() - q;
+
+ if ( gzwrite( file, q, n) < n )
+ return EOF;
+
+ setp(0,0);
+
+ return 0;
+
+}
+
+int gzfilebuf::fillbuf() {
+
+ int required;
+ char *p;
+
+ p = base();
+
+ required = blen();
+
+ int t = gzread( file, p, required );
+
+ if ( t <= 0) return EOF;
+
+ setg( base(), base(), base()+t);
+
+ return t;
+
+}
+
+gzfilestream_common::gzfilestream_common() :
+ ios( gzfilestream_common::rdbuf() )
+{ }
+
+gzfilestream_common::~gzfilestream_common()
+{ }
+
+void gzfilestream_common::attach( int fd, int io_mode ) {
+
+ if ( !buffer.attach( fd, io_mode) )
+ clear( ios::failbit | ios::badbit );
+ else
+ clear();
+
+}
+
+void gzfilestream_common::open( const char *name, int io_mode ) {
+
+ if ( !buffer.open( name, io_mode ) )
+ clear( ios::failbit | ios::badbit );
+ else
+ clear();
+
+}
+
+void gzfilestream_common::close() {
+
+ if ( !buffer.close() )
+ clear( ios::failbit | ios::badbit );
+
+}
+
+gzfilebuf *gzfilestream_common::rdbuf()
+{
+ return &buffer;
+}
+
+gzifstream::gzifstream() :
+ ios( gzfilestream_common::rdbuf() )
+{
+ clear( ios::badbit );
+}
+
+gzifstream::gzifstream( const char *name, int io_mode ) :
+ ios( gzfilestream_common::rdbuf() )
+{
+ gzfilestream_common::open( name, io_mode );
+}
+
+gzifstream::gzifstream( int fd, int io_mode ) :
+ ios( gzfilestream_common::rdbuf() )
+{
+ gzfilestream_common::attach( fd, io_mode );
+}
+
+gzifstream::~gzifstream() { }
+
+gzofstream::gzofstream() :
+ ios( gzfilestream_common::rdbuf() )
+{
+ clear( ios::badbit );
+}
+
+gzofstream::gzofstream( const char *name, int io_mode ) :
+ ios( gzfilestream_common::rdbuf() )
+{
+ gzfilestream_common::open( name, io_mode );
+}
+
+gzofstream::gzofstream( int fd, int io_mode ) :
+ ios( gzfilestream_common::rdbuf() )
+{
+ gzfilestream_common::attach( fd, io_mode );
+}
+
+gzofstream::~gzofstream() { }
diff --git a/protocols/Telegram/tgl/zlib/contrib/iostream/zfstream.h b/protocols/Telegram/tgl/zlib/contrib/iostream/zfstream.h
new file mode 100644
index 0000000000..ed79098a3a
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/iostream/zfstream.h
@@ -0,0 +1,128 @@
+
+#ifndef zfstream_h
+#define zfstream_h
+
+#include <fstream.h>
+#include "zlib.h"
+
+class gzfilebuf : public streambuf {
+
+public:
+
+ gzfilebuf( );
+ virtual ~gzfilebuf();
+
+ gzfilebuf *open( const char *name, int io_mode );
+ gzfilebuf *attach( int file_descriptor, int io_mode );
+ gzfilebuf *close();
+
+ int setcompressionlevel( int comp_level );
+ int setcompressionstrategy( int comp_strategy );
+
+ inline int is_open() const { return (file !=NULL); }
+
+ virtual streampos seekoff( streamoff, ios::seek_dir, int );
+
+ virtual int sync();
+
+protected:
+
+ virtual int underflow();
+ virtual int overflow( int = EOF );
+
+private:
+
+ gzFile file;
+ short mode;
+ short own_file_descriptor;
+
+ int flushbuf();
+ int fillbuf();
+
+};
+
+class gzfilestream_common : virtual public ios {
+
+ friend class gzifstream;
+ friend class gzofstream;
+ friend gzofstream &setcompressionlevel( gzofstream &, int );
+ friend gzofstream &setcompressionstrategy( gzofstream &, int );
+
+public:
+ virtual ~gzfilestream_common();
+
+ void attach( int fd, int io_mode );
+ void open( const char *name, int io_mode );
+ void close();
+
+protected:
+ gzfilestream_common();
+
+private:
+ gzfilebuf *rdbuf();
+
+ gzfilebuf buffer;
+
+};
+
+class gzifstream : public gzfilestream_common, public istream {
+
+public:
+
+ gzifstream();
+ gzifstream( const char *name, int io_mode = ios::in );
+ gzifstream( int fd, int io_mode = ios::in );
+
+ virtual ~gzifstream();
+
+};
+
+class gzofstream : public gzfilestream_common, public ostream {
+
+public:
+
+ gzofstream();
+ gzofstream( const char *name, int io_mode = ios::out );
+ gzofstream( int fd, int io_mode = ios::out );
+
+ virtual ~gzofstream();
+
+};
+
+template<class T> class gzomanip {
+ friend gzofstream &operator<<(gzofstream &, const gzomanip<T> &);
+public:
+ gzomanip(gzofstream &(*f)(gzofstream &, T), T v) : func(f), val(v) { }
+private:
+ gzofstream &(*func)(gzofstream &, T);
+ T val;
+};
+
+template<class T> gzofstream &operator<<(gzofstream &s, const gzomanip<T> &m)
+{
+ return (*m.func)(s, m.val);
+}
+
+inline gzofstream &setcompressionlevel( gzofstream &s, int l )
+{
+ (s.rdbuf())->setcompressionlevel(l);
+ return s;
+}
+
+inline gzofstream &setcompressionstrategy( gzofstream &s, int l )
+{
+ (s.rdbuf())->setcompressionstrategy(l);
+ return s;
+}
+
+inline gzomanip<int> setcompressionlevel(int l)
+{
+ return gzomanip<int>(&setcompressionlevel,l);
+}
+
+inline gzomanip<int> setcompressionstrategy(int l)
+{
+ return gzomanip<int>(&setcompressionstrategy,l);
+}
+
+#endif
diff --git a/protocols/Telegram/tgl/zlib/contrib/iostream2/zstream.h b/protocols/Telegram/tgl/zlib/contrib/iostream2/zstream.h
new file mode 100644
index 0000000000..43d2332b79
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/iostream2/zstream.h
@@ -0,0 +1,307 @@
+/*
+ *
+ * Copyright (c) 1997
+ * Christian Michelsen Research AS
+ * Advanced Computing
+ * Fantoftvegen 38, 5036 BERGEN, Norway
+ * http://www.cmr.no
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Christian Michelsen Research AS makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ */
+
+#ifndef ZSTREAM__H
+#define ZSTREAM__H
+
+/*
+ * zstream.h - C++ interface to the 'zlib' general purpose compression library
+ * $Id: zstream.h 1.1 1997-06-25 12:00:56+02 tyge Exp tyge $
+ */
+
+#include <strstream.h>
+#include <string.h>
+#include <stdio.h>
+#include "zlib.h"
+
+#if defined(_WIN32)
+# include <fcntl.h>
+# include <io.h>
+# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
+#else
+# define SET_BINARY_MODE(file)
+#endif
+
+class zstringlen {
+public:
+ zstringlen(class izstream&);
+ zstringlen(class ozstream&, const char*);
+ size_t value() const { return val.word; }
+private:
+ struct Val { unsigned char byte; size_t word; } val;
+};
+
+// ----------------------------- izstream -----------------------------
+
+class izstream
+{
+ public:
+ izstream() : m_fp(0) {}
+ izstream(FILE* fp) : m_fp(0) { open(fp); }
+ izstream(const char* name) : m_fp(0) { open(name); }
+ ~izstream() { close(); }
+
+ /* Opens a gzip (.gz) file for reading.
+ * open() can be used to read a file which is not in gzip format;
+ * in this case read() will directly read from the file without
+ * decompression. errno can be checked to distinguish two error
+ * cases (if errno is zero, the zlib error is Z_MEM_ERROR).
+ */
+ void open(const char* name) {
+ if (m_fp) close();
+ m_fp = ::gzopen(name, "rb");
+ }
+
+ void open(FILE* fp) {
+ SET_BINARY_MODE(fp);
+ if (m_fp) close();
+ m_fp = ::gzdopen(fileno(fp), "rb");
+ }
+
+ /* Flushes all pending input if necessary, closes the compressed file
+ * and deallocates all the (de)compression state. The return value is
+ * the zlib error number (see function error() below).
+ */
+ int close() {
+ int r = ::gzclose(m_fp);
+ m_fp = 0; return r;
+ }
+
+ /* Binary read the given number of bytes from the compressed file.
+ */
+ int read(void* buf, size_t len) {
+ return ::gzread(m_fp, buf, len);
+ }
+
+ /* Returns the error message for the last error which occurred on the
+ * given compressed file. errnum is set to zlib error number. If an
+ * error occurred in the file system and not in the compression library,
+ * errnum is set to Z_ERRNO and the application may consult errno
+ * to get the exact error code.
+ */
+ const char* error(int* errnum) {
+ return ::gzerror(m_fp, errnum);
+ }
+
+ gzFile fp() { return m_fp; }
+
+ private:
+ gzFile m_fp;
+};
+
+/*
+ * Binary read the given (array of) object(s) from the compressed file.
+ * If the input file was not in gzip format, read() copies the objects number
+ * of bytes into the buffer.
+ * returns the number of uncompressed bytes actually read
+ * (0 for end of file, -1 for error).
+ */
+template <class T, class Items>
+inline int read(izstream& zs, T* x, Items items) {
+ return ::gzread(zs.fp(), x, items*sizeof(T));
+}
+
+/*
+ * Binary input with the '>' operator.
+ */
+template <class T>
+inline izstream& operator>(izstream& zs, T& x) {
+ ::gzread(zs.fp(), &x, sizeof(T));
+ return zs;
+}
+
+
+inline zstringlen::zstringlen(izstream& zs) {
+ zs > val.byte;
+ if (val.byte == 255) zs > val.word;
+ else val.word = val.byte;
+}
+
+/*
+ * Read length of string + the string with the '>' operator.
+ */
+inline izstream& operator>(izstream& zs, char* x) {
+ zstringlen len(zs);
+ ::gzread(zs.fp(), x, len.value());
+ x[len.value()] = '\0';
+ return zs;
+}
+
+inline char* read_string(izstream& zs) {
+ zstringlen len(zs);
+ char* x = new char[len.value()+1];
+ ::gzread(zs.fp(), x, len.value());
+ x[len.value()] = '\0';
+ return x;
+}
+
+// ----------------------------- ozstream -----------------------------
+
+class ozstream
+{
+ public:
+ ozstream() : m_fp(0), m_os(0) {
+ }
+ ozstream(FILE* fp, int level = Z_DEFAULT_COMPRESSION)
+ : m_fp(0), m_os(0) {
+ open(fp, level);
+ }
+ ozstream(const char* name, int level = Z_DEFAULT_COMPRESSION)
+ : m_fp(0), m_os(0) {
+ open(name, level);
+ }
+ ~ozstream() {
+ close();
+ }
+
+ /* Opens a gzip (.gz) file for writing.
+ * The compression level parameter should be in 0..9
+ * errno can be checked to distinguish two error cases
+ * (if errno is zero, the zlib error is Z_MEM_ERROR).
+ */
+ void open(const char* name, int level = Z_DEFAULT_COMPRESSION) {
+ char mode[4] = "wb\0";
+ if (level != Z_DEFAULT_COMPRESSION) mode[2] = '0'+level;
+ if (m_fp) close();
+ m_fp = ::gzopen(name, mode);
+ }
+
+ /* open from a FILE pointer.
+ */
+ void open(FILE* fp, int level = Z_DEFAULT_COMPRESSION) {
+ SET_BINARY_MODE(fp);
+ char mode[4] = "wb\0";
+ if (level != Z_DEFAULT_COMPRESSION) mode[2] = '0'+level;
+ if (m_fp) close();
+ m_fp = ::gzdopen(fileno(fp), mode);
+ }
+
+ /* Flushes all pending output if necessary, closes the compressed file
+ * and deallocates all the (de)compression state. The return value is
+ * the zlib error number (see function error() below).
+ */
+ int close() {
+ if (m_os) {
+ ::gzwrite(m_fp, m_os->str(), m_os->pcount());
+ delete[] m_os->str(); delete m_os; m_os = 0;
+ }
+ int r = ::gzclose(m_fp); m_fp = 0; return r;
+ }
+
+ /* Binary write the given number of bytes into the compressed file.
+ */
+ int write(const void* buf, size_t len) {
+ return ::gzwrite(m_fp, (voidp) buf, len);
+ }
+
+ /* Flushes all pending output into the compressed file. The parameter
+ * _flush is as in the deflate() function. The return value is the zlib
+ * error number (see function gzerror below). flush() returns Z_OK if
+ * the flush_ parameter is Z_FINISH and all output could be flushed.
+ * flush() should be called only when strictly necessary because it can
+ * degrade compression.
+ */
+ int flush(int _flush) {
+ os_flush();
+ return ::gzflush(m_fp, _flush);
+ }
+
+ /* Returns the error message for the last error which occurred on the
+ * given compressed file. errnum is set to zlib error number. If an
+ * error occurred in the file system and not in the compression library,
+ * errnum is set to Z_ERRNO and the application may consult errno
+ * to get the exact error code.
+ */
+ const char* error(int* errnum) {
+ return ::gzerror(m_fp, errnum);
+ }
+
+ gzFile fp() { return m_fp; }
+
+ ostream& os() {
+ if (m_os == 0) m_os = new ostrstream;
+ return *m_os;
+ }
+
+ void os_flush() {
+ if (m_os && m_os->pcount()>0) {
+ ostrstream* oss = new ostrstream;
+ oss->fill(m_os->fill());
+ oss->flags(m_os->flags());
+ oss->precision(m_os->precision());
+ oss->width(m_os->width());
+ ::gzwrite(m_fp, m_os->str(), m_os->pcount());
+ delete[] m_os->str(); delete m_os; m_os = oss;
+ }
+ }
+
+ private:
+ gzFile m_fp;
+ ostrstream* m_os;
+};
+
+/*
+ * Binary write the given (array of) object(s) into the compressed file.
+ * returns the number of uncompressed bytes actually written
+ * (0 in case of error).
+ */
+template <class T, class Items>
+inline int write(ozstream& zs, const T* x, Items items) {
+ return ::gzwrite(zs.fp(), (voidp) x, items*sizeof(T));
+}
+
+/*
+ * Binary output with the '<' operator.
+ */
+template <class T>
+inline ozstream& operator<(ozstream& zs, const T& x) {
+ ::gzwrite(zs.fp(), (voidp) &x, sizeof(T));
+ return zs;
+}
+
+inline zstringlen::zstringlen(ozstream& zs, const char* x) {
+ val.byte = 255; val.word = ::strlen(x);
+ if (val.word < 255) zs < (val.byte = val.word);
+ else zs < val;
+}
+
+/*
+ * Write length of string + the string with the '<' operator.
+ */
+inline ozstream& operator<(ozstream& zs, const char* x) {
+ zstringlen len(zs, x);
+ ::gzwrite(zs.fp(), (voidp) x, len.value());
+ return zs;
+}
+
+#ifdef _MSC_VER
+inline ozstream& operator<(ozstream& zs, char* const& x) {
+ return zs < (const char*) x;
+}
+#endif
+
+/*
+ * Ascii write with the << operator;
+ */
+template <class T>
+inline ostream& operator<<(ozstream& zs, const T& x) {
+ zs.os_flush();
+ return zs.os() << x;
+}
+
+#endif
diff --git a/protocols/Telegram/tgl/zlib/contrib/iostream2/zstream_test.cpp b/protocols/Telegram/tgl/zlib/contrib/iostream2/zstream_test.cpp
new file mode 100644
index 0000000000..6273f62d62
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/iostream2/zstream_test.cpp
@@ -0,0 +1,25 @@
+#include "zstream.h"
+#include <math.h>
+#include <stdlib.h>
+#include <iomanip.h>
+
+void main() {
+ char h[256] = "Hello";
+ char* g = "Goodbye";
+ ozstream out("temp.gz");
+ out < "This works well" < h < g;
+ out.close();
+
+ izstream in("temp.gz"); // read it back
+ char *x = read_string(in), *y = new char[256], z[256];
+ in > y > z;
+ in.close();
+ cout << x << endl << y << endl << z << endl;
+
+ out.open("temp.gz"); // try ascii output; zcat temp.gz to see the results
+ out << setw(50) << setfill('#') << setprecision(20) << x << endl << y << endl << z << endl;
+ out << z << endl << y << endl << x << endl;
+ out << 1.1234567890123456789 << endl;
+
+ delete[] x; delete[] y;
+}
diff --git a/protocols/Telegram/tgl/zlib/contrib/iostream3/README b/protocols/Telegram/tgl/zlib/contrib/iostream3/README
new file mode 100644
index 0000000000..f7b319ab91
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/iostream3/README
@@ -0,0 +1,35 @@
+These classes provide a C++ stream interface to the zlib library. It allows you
+to do things like:
+
+ gzofstream outf("blah.gz");
+ outf << "These go into the gzip file " << 123 << endl;
+
+It does this by deriving a specialized stream buffer for gzipped files, which is
+the way Stroustrup would have done it. :->
+
+The gzifstream and gzofstream classes were originally written by Kevin Ruland
+and made available in the zlib contrib/iostream directory. The older version still
+compiles under gcc 2.xx, but not under gcc 3.xx, which sparked the development of
+this version.
+
+The new classes are as standard-compliant as possible, closely following the
+approach of the standard library's fstream classes. It compiles under gcc versions
+3.2 and 3.3, but not under gcc 2.xx. This is mainly due to changes in the standard
+library naming scheme. The new version of gzifstream/gzofstream/gzfilebuf differs
+from the previous one in the following respects:
+- added showmanyc
+- added setbuf, with support for unbuffered output via setbuf(0,0)
+- a few bug fixes of stream behavior
+- gzipped output file opened with default compression level instead of maximum level
+- setcompressionlevel()/strategy() members replaced by single setcompression()
+
+The code is provided "as is", with the permission to use, copy, modify, distribute
+and sell it for any purpose without fee.
+
+Ludwig Schwardt
+<schwardt@sun.ac.za>
+
+DSP Lab
+Electrical & Electronic Engineering Department
+University of Stellenbosch
+South Africa
diff --git a/protocols/Telegram/tgl/zlib/contrib/iostream3/TODO b/protocols/Telegram/tgl/zlib/contrib/iostream3/TODO
new file mode 100644
index 0000000000..7032f97be0
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/iostream3/TODO
@@ -0,0 +1,17 @@
+Possible upgrades to gzfilebuf:
+
+- The ability to do putback (e.g. putbackfail)
+
+- The ability to seek (zlib supports this, but could be slow/tricky)
+
+- Simultaneous read/write access (does it make sense?)
+
+- Support for ios_base::ate open mode
+
+- Locale support?
+
+- Check public interface to see which calls give problems
+ (due to dependence on library internals)
+
+- Override operator<<(ostream&, gzfilebuf*) to allow direct copying
+ of stream buffer to stream ( i.e. os << is.rdbuf(); )
diff --git a/protocols/Telegram/tgl/zlib/contrib/iostream3/test.cc b/protocols/Telegram/tgl/zlib/contrib/iostream3/test.cc
new file mode 100644
index 0000000000..94235334f2
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/iostream3/test.cc
@@ -0,0 +1,50 @@
+/*
+ * Test program for gzifstream and gzofstream
+ *
+ * by Ludwig Schwardt <schwardt@sun.ac.za>
+ * original version by Kevin Ruland <kevin@rodin.wustl.edu>
+ */
+
+#include "zfstream.h"
+#include <iostream> // for cout
+
+int main() {
+
+ gzofstream outf;
+ gzifstream inf;
+ char buf[80];
+
+ outf.open("test1.txt.gz");
+ outf << "The quick brown fox sidestepped the lazy canine\n"
+ << 1.3 << "\nPlan " << 9 << std::endl;
+ outf.close();
+ std::cout << "Wrote the following message to 'test1.txt.gz' (check with zcat or zless):\n"
+ << "The quick brown fox sidestepped the lazy canine\n"
+ << 1.3 << "\nPlan " << 9 << std::endl;
+
+ std::cout << "\nReading 'test1.txt.gz' (buffered) produces:\n";
+ inf.open("test1.txt.gz");
+ while (inf.getline(buf,80,'\n')) {
+ std::cout << buf << "\t(" << inf.rdbuf()->in_avail() << " chars left in buffer)\n";
+ }
+ inf.close();
+
+ outf.rdbuf()->pubsetbuf(0,0);
+ outf.open("test2.txt.gz");
+ outf << setcompression(Z_NO_COMPRESSION)
+ << "The quick brown fox sidestepped the lazy canine\n"
+ << 1.3 << "\nPlan " << 9 << std::endl;
+ outf.close();
+ std::cout << "\nWrote the same message to 'test2.txt.gz' in uncompressed form";
+
+ std::cout << "\nReading 'test2.txt.gz' (unbuffered) produces:\n";
+ inf.rdbuf()->pubsetbuf(0,0);
+ inf.open("test2.txt.gz");
+ while (inf.getline(buf,80,'\n')) {
+ std::cout << buf << "\t(" << inf.rdbuf()->in_avail() << " chars left in buffer)\n";
+ }
+ inf.close();
+
+ return 0;
+
+}
diff --git a/protocols/Telegram/tgl/zlib/contrib/iostream3/zfstream.cc b/protocols/Telegram/tgl/zlib/contrib/iostream3/zfstream.cc
new file mode 100644
index 0000000000..94eb933444
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/iostream3/zfstream.cc
@@ -0,0 +1,479 @@
+/*
+ * A C++ I/O streams interface to the zlib gz* functions
+ *
+ * by Ludwig Schwardt <schwardt@sun.ac.za>
+ * original version by Kevin Ruland <kevin@rodin.wustl.edu>
+ *
+ * This version is standard-compliant and compatible with gcc 3.x.
+ */
+
+#include "zfstream.h"
+#include <cstring> // for strcpy, strcat, strlen (mode strings)
+#include <cstdio> // for BUFSIZ
+
+// Internal buffer sizes (default and "unbuffered" versions)
+#define BIGBUFSIZE BUFSIZ
+#define SMALLBUFSIZE 1
+
+/*****************************************************************************/
+
+// Default constructor
+gzfilebuf::gzfilebuf()
+: file(NULL), io_mode(std::ios_base::openmode(0)), own_fd(false),
+ buffer(NULL), buffer_size(BIGBUFSIZE), own_buffer(true)
+{
+ // No buffers to start with
+ this->disable_buffer();
+}
+
+// Destructor
+gzfilebuf::~gzfilebuf()
+{
+ // Sync output buffer and close only if responsible for file
+ // (i.e. attached streams should be left open at this stage)
+ this->sync();
+ if (own_fd)
+ this->close();
+ // Make sure internal buffer is deallocated
+ this->disable_buffer();
+}
+
+// Set compression level and strategy
+int
+gzfilebuf::setcompression(int comp_level,
+ int comp_strategy)
+{
+ return gzsetparams(file, comp_level, comp_strategy);
+}
+
+// Open gzipped file
+gzfilebuf*
+gzfilebuf::open(const char *name,
+ std::ios_base::openmode mode)
+{
+ // Fail if file already open
+ if (this->is_open())
+ return NULL;
+ // Don't support simultaneous read/write access (yet)
+ if ((mode & std::ios_base::in) && (mode & std::ios_base::out))
+ return NULL;
+
+ // Build mode string for gzopen and check it [27.8.1.3.2]
+ char char_mode[6] = "\0\0\0\0\0";
+ if (!this->open_mode(mode, char_mode))
+ return NULL;
+
+ // Attempt to open file
+ if ((file = gzopen(name, char_mode)) == NULL)
+ return NULL;
+
+ // On success, allocate internal buffer and set flags
+ this->enable_buffer();
+ io_mode = mode;
+ own_fd = true;
+ return this;
+}
+
+// Attach to gzipped file
+gzfilebuf*
+gzfilebuf::attach(int fd,
+ std::ios_base::openmode mode)
+{
+ // Fail if file already open
+ if (this->is_open())
+ return NULL;
+ // Don't support simultaneous read/write access (yet)
+ if ((mode & std::ios_base::in) && (mode & std::ios_base::out))
+ return NULL;
+
+ // Build mode string for gzdopen and check it [27.8.1.3.2]
+ char char_mode[6] = "\0\0\0\0\0";
+ if (!this->open_mode(mode, char_mode))
+ return NULL;
+
+ // Attempt to attach to file
+ if ((file = gzdopen(fd, char_mode)) == NULL)
+ return NULL;
+
+ // On success, allocate internal buffer and set flags
+ this->enable_buffer();
+ io_mode = mode;
+ own_fd = false;
+ return this;
+}
+
+// Close gzipped file
+gzfilebuf*
+gzfilebuf::close()
+{
+ // Fail immediately if no file is open
+ if (!this->is_open())
+ return NULL;
+ // Assume success
+ gzfilebuf* retval = this;
+ // Attempt to sync and close gzipped file
+ if (this->sync() == -1)
+ retval = NULL;
+ if (gzclose(file) < 0)
+ retval = NULL;
+ // File is now gone anyway (postcondition [27.8.1.3.8])
+ file = NULL;
+ own_fd = false;
+ // Destroy internal buffer if it exists
+ this->disable_buffer();
+ return retval;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+// Convert int open mode to mode string
+bool
+gzfilebuf::open_mode(std::ios_base::openmode mode,
+ char* c_mode) const
+{
+ bool testb = mode & std::ios_base::binary;
+ bool testi = mode & std::ios_base::in;
+ bool testo = mode & std::ios_base::out;
+ bool testt = mode & std::ios_base::trunc;
+ bool testa = mode & std::ios_base::app;
+
+ // Check for valid flag combinations - see [27.8.1.3.2] (Table 92)
+ // Original zfstream hardcoded the compression level to maximum here...
+ // Double the time for less than 1% size improvement seems
+ // excessive though - keeping it at the default level
+ // To change back, just append "9" to the next three mode strings
+ if (!testi && testo && !testt && !testa)
+ strcpy(c_mode, "w");
+ if (!testi && testo && !testt && testa)
+ strcpy(c_mode, "a");
+ if (!testi && testo && testt && !testa)
+ strcpy(c_mode, "w");
+ if (testi && !testo && !testt && !testa)
+ strcpy(c_mode, "r");
+ // No read/write mode yet
+// if (testi && testo && !testt && !testa)
+// strcpy(c_mode, "r+");
+// if (testi && testo && testt && !testa)
+// strcpy(c_mode, "w+");
+
+ // Mode string should be empty for invalid combination of flags
+ if (strlen(c_mode) == 0)
+ return false;
+ if (testb)
+ strcat(c_mode, "b");
+ return true;
+}
+
+// Determine number of characters in internal get buffer
+std::streamsize
+gzfilebuf::showmanyc()
+{
+ // Calls to underflow will fail if file not opened for reading
+ if (!this->is_open() || !(io_mode & std::ios_base::in))
+ return -1;
+ // Make sure get area is in use
+ if (this->gptr() && (this->gptr() < this->egptr()))
+ return std::streamsize(this->egptr() - this->gptr());
+ else
+ return 0;
+}
+
+// Fill get area from gzipped file
+gzfilebuf::int_type
+gzfilebuf::underflow()
+{
+ // If something is left in the get area by chance, return it
+ // (this shouldn't normally happen, as underflow is only supposed
+ // to be called when gptr >= egptr, but it serves as error check)
+ if (this->gptr() && (this->gptr() < this->egptr()))
+ return traits_type::to_int_type(*(this->gptr()));
+
+ // If the file hasn't been opened for reading, produce error
+ if (!this->is_open() || !(io_mode & std::ios_base::in))
+ return traits_type::eof();
+
+ // Attempt to fill internal buffer from gzipped file
+ // (buffer must be guaranteed to exist...)
+ int bytes_read = gzread(file, buffer, buffer_size);
+ // Indicates error or EOF
+ if (bytes_read <= 0)
+ {
+ // Reset get area
+ this->setg(buffer, buffer, buffer);
+ return traits_type::eof();
+ }
+ // Make all bytes read from file available as get area
+ this->setg(buffer, buffer, buffer + bytes_read);
+
+ // Return next character in get area
+ return traits_type::to_int_type(*(this->gptr()));
+}
+
+// Write put area to gzipped file
+gzfilebuf::int_type
+gzfilebuf::overflow(int_type c)
+{
+ // Determine whether put area is in use
+ if (this->pbase())
+ {
+ // Double-check pointer range
+ if (this->pptr() > this->epptr() || this->pptr() < this->pbase())
+ return traits_type::eof();
+ // Add extra character to buffer if not EOF
+ if (!traits_type::eq_int_type(c, traits_type::eof()))
+ {
+ *(this->pptr()) = traits_type::to_char_type(c);
+ this->pbump(1);
+ }
+ // Number of characters to write to file
+ int bytes_to_write = this->pptr() - this->pbase();
+ // Overflow doesn't fail if nothing is to be written
+ if (bytes_to_write > 0)
+ {
+ // If the file hasn't been opened for writing, produce error
+ if (!this->is_open() || !(io_mode & std::ios_base::out))
+ return traits_type::eof();
+ // If gzipped file won't accept all bytes written to it, fail
+ if (gzwrite(file, this->pbase(), bytes_to_write) != bytes_to_write)
+ return traits_type::eof();
+ // Reset next pointer to point to pbase on success
+ this->pbump(-bytes_to_write);
+ }
+ }
+ // Write extra character to file if not EOF
+ else if (!traits_type::eq_int_type(c, traits_type::eof()))
+ {
+ // If the file hasn't been opened for writing, produce error
+ if (!this->is_open() || !(io_mode & std::ios_base::out))
+ return traits_type::eof();
+ // Impromptu char buffer (allows "unbuffered" output)
+ char_type last_char = traits_type::to_char_type(c);
+ // If gzipped file won't accept this character, fail
+ if (gzwrite(file, &last_char, 1) != 1)
+ return traits_type::eof();
+ }
+
+ // If you got here, you have succeeded (even if c was EOF)
+ // The return value should therefore be non-EOF
+ if (traits_type::eq_int_type(c, traits_type::eof()))
+ return traits_type::not_eof(c);
+ else
+ return c;
+}
+
+// Assign new buffer
+std::streambuf*
+gzfilebuf::setbuf(char_type* p,
+ std::streamsize n)
+{
+ // First make sure stuff is sync'ed, for safety
+ if (this->sync() == -1)
+ return NULL;
+ // If buffering is turned off on purpose via setbuf(0,0), still allocate one...
+ // "Unbuffered" only really refers to put [27.8.1.4.10], while get needs at
+ // least a buffer of size 1 (very inefficient though, therefore make it bigger?)
+ // This follows from [27.5.2.4.3]/12 (gptr needs to point at something, it seems)
+ if (!p || !n)
+ {
+ // Replace existing buffer (if any) with small internal buffer
+ this->disable_buffer();
+ buffer = NULL;
+ buffer_size = 0;
+ own_buffer = true;
+ this->enable_buffer();
+ }
+ else
+ {
+ // Replace existing buffer (if any) with external buffer
+ this->disable_buffer();
+ buffer = p;
+ buffer_size = n;
+ own_buffer = false;
+ this->enable_buffer();
+ }
+ return this;
+}
+
+// Write put area to gzipped file (i.e. ensures that put area is empty)
+int
+gzfilebuf::sync()
+{
+ return traits_type::eq_int_type(this->overflow(), traits_type::eof()) ? -1 : 0;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+// Allocate internal buffer
+void
+gzfilebuf::enable_buffer()
+{
+ // If internal buffer required, allocate one
+ if (own_buffer && !buffer)
+ {
+ // Check for buffered vs. "unbuffered"
+ if (buffer_size > 0)
+ {
+ // Allocate internal buffer
+ buffer = new char_type[buffer_size];
+ // Get area starts empty and will be expanded by underflow as need arises
+ this->setg(buffer, buffer, buffer);
+ // Setup entire internal buffer as put area.
+ // The one-past-end pointer actually points to the last element of the buffer,
+ // so that overflow(c) can safely add the extra character c to the sequence.
+ // These pointers remain in place for the duration of the buffer
+ this->setp(buffer, buffer + buffer_size - 1);
+ }
+ else
+ {
+ // Even in "unbuffered" case, (small?) get buffer is still required
+ buffer_size = SMALLBUFSIZE;
+ buffer = new char_type[buffer_size];
+ this->setg(buffer, buffer, buffer);
+ // "Unbuffered" means no put buffer
+ this->setp(0, 0);
+ }
+ }
+ else
+ {
+ // If buffer already allocated, reset buffer pointers just to make sure no
+ // stale chars are lying around
+ this->setg(buffer, buffer, buffer);
+ this->setp(buffer, buffer + buffer_size - 1);
+ }
+}
+
+// Destroy internal buffer
+void
+gzfilebuf::disable_buffer()
+{
+ // If internal buffer exists, deallocate it
+ if (own_buffer && buffer)
+ {
+ // Preserve unbuffered status by zeroing size
+ if (!this->pbase())
+ buffer_size = 0;
+ delete[] buffer;
+ buffer = NULL;
+ this->setg(0, 0, 0);
+ this->setp(0, 0);
+ }
+ else
+ {
+ // Reset buffer pointers to initial state if external buffer exists
+ this->setg(buffer, buffer, buffer);
+ if (buffer)
+ this->setp(buffer, buffer + buffer_size - 1);
+ else
+ this->setp(0, 0);
+ }
+}
+
+/*****************************************************************************/
+
+// Default constructor initializes stream buffer
+gzifstream::gzifstream()
+: std::istream(NULL), sb()
+{ this->init(&sb); }
+
+// Initialize stream buffer and open file
+gzifstream::gzifstream(const char* name,
+ std::ios_base::openmode mode)
+: std::istream(NULL), sb()
+{
+ this->init(&sb);
+ this->open(name, mode);
+}
+
+// Initialize stream buffer and attach to file
+gzifstream::gzifstream(int fd,
+ std::ios_base::openmode mode)
+: std::istream(NULL), sb()
+{
+ this->init(&sb);
+ this->attach(fd, mode);
+}
+
+// Open file and go into fail() state if unsuccessful
+void
+gzifstream::open(const char* name,
+ std::ios_base::openmode mode)
+{
+ if (!sb.open(name, mode | std::ios_base::in))
+ this->setstate(std::ios_base::failbit);
+ else
+ this->clear();
+}
+
+// Attach to file and go into fail() state if unsuccessful
+void
+gzifstream::attach(int fd,
+ std::ios_base::openmode mode)
+{
+ if (!sb.attach(fd, mode | std::ios_base::in))
+ this->setstate(std::ios_base::failbit);
+ else
+ this->clear();
+}
+
+// Close file
+void
+gzifstream::close()
+{
+ if (!sb.close())
+ this->setstate(std::ios_base::failbit);
+}
+
+/*****************************************************************************/
+
+// Default constructor initializes stream buffer
+gzofstream::gzofstream()
+: std::ostream(NULL), sb()
+{ this->init(&sb); }
+
+// Initialize stream buffer and open file
+gzofstream::gzofstream(const char* name,
+ std::ios_base::openmode mode)
+: std::ostream(NULL), sb()
+{
+ this->init(&sb);
+ this->open(name, mode);
+}
+
+// Initialize stream buffer and attach to file
+gzofstream::gzofstream(int fd,
+ std::ios_base::openmode mode)
+: std::ostream(NULL), sb()
+{
+ this->init(&sb);
+ this->attach(fd, mode);
+}
+
+// Open file and go into fail() state if unsuccessful
+void
+gzofstream::open(const char* name,
+ std::ios_base::openmode mode)
+{
+ if (!sb.open(name, mode | std::ios_base::out))
+ this->setstate(std::ios_base::failbit);
+ else
+ this->clear();
+}
+
+// Attach to file and go into fail() state if unsuccessful
+void
+gzofstream::attach(int fd,
+ std::ios_base::openmode mode)
+{
+ if (!sb.attach(fd, mode | std::ios_base::out))
+ this->setstate(std::ios_base::failbit);
+ else
+ this->clear();
+}
+
+// Close file
+void
+gzofstream::close()
+{
+ if (!sb.close())
+ this->setstate(std::ios_base::failbit);
+}
diff --git a/protocols/Telegram/tgl/zlib/contrib/iostream3/zfstream.h b/protocols/Telegram/tgl/zlib/contrib/iostream3/zfstream.h
new file mode 100644
index 0000000000..8574479ae1
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/iostream3/zfstream.h
@@ -0,0 +1,466 @@
+/*
+ * A C++ I/O streams interface to the zlib gz* functions
+ *
+ * by Ludwig Schwardt <schwardt@sun.ac.za>
+ * original version by Kevin Ruland <kevin@rodin.wustl.edu>
+ *
+ * This version is standard-compliant and compatible with gcc 3.x.
+ */
+
+#ifndef ZFSTREAM_H
+#define ZFSTREAM_H
+
+#include <istream> // not iostream, since we don't need cin/cout
+#include <ostream>
+#include "zlib.h"
+
+/*****************************************************************************/
+
+/**
+ * @brief Gzipped file stream buffer class.
+ *
+ * This class implements basic_filebuf for gzipped files. It doesn't yet support
+ * seeking (allowed by zlib but slow/limited), putback and read/write access
+ * (tricky). Otherwise, it attempts to be a drop-in replacement for the standard
+ * file streambuf.
+*/
+class gzfilebuf : public std::streambuf
+{
+public:
+ // Default constructor.
+ gzfilebuf();
+
+ // Destructor.
+ virtual
+ ~gzfilebuf();
+
+ /**
+ * @brief Set compression level and strategy on the fly.
+ * @param comp_level Compression level (see zlib.h for allowed values)
+ * @param comp_strategy Compression strategy (see zlib.h for allowed values)
+ * @return Z_OK on success, Z_STREAM_ERROR otherwise.
+ *
+ * Unfortunately, these parameters cannot be modified separately, as the
+ * previous zfstream version assumed. Since the strategy is seldom changed,
+ * it can default and setcompression(level) then becomes like the old
+ * setcompressionlevel(level).
+ */
+ int
+ setcompression(int comp_level,
+ int comp_strategy = Z_DEFAULT_STRATEGY);
+
+ /**
+ * @brief Check if file is open.
+ * @return True if file is open.
+ */
+ bool
+ is_open() const { return (file != NULL); }
+
+ /**
+ * @brief Open gzipped file.
+ * @param name File name.
+ * @param mode Open mode flags.
+ * @return @c this on success, NULL on failure.
+ */
+ gzfilebuf*
+ open(const char* name,
+ std::ios_base::openmode mode);
+
+ /**
+ * @brief Attach to already open gzipped file.
+ * @param fd File descriptor.
+ * @param mode Open mode flags.
+ * @return @c this on success, NULL on failure.
+ */
+ gzfilebuf*
+ attach(int fd,
+ std::ios_base::openmode mode);
+
+ /**
+ * @brief Close gzipped file.
+ * @return @c this on success, NULL on failure.
+ */
+ gzfilebuf*
+ close();
+
+protected:
+ /**
+ * @brief Convert ios open mode int to mode string used by zlib.
+ * @return True if valid mode flag combination.
+ */
+ bool
+ open_mode(std::ios_base::openmode mode,
+ char* c_mode) const;
+
+ /**
+ * @brief Number of characters available in stream buffer.
+ * @return Number of characters.
+ *
+ * This indicates number of characters in get area of stream buffer.
+ * These characters can be read without accessing the gzipped file.
+ */
+ virtual std::streamsize
+ showmanyc();
+
+ /**
+ * @brief Fill get area from gzipped file.
+ * @return First character in get area on success, EOF on error.
+ *
+ * This actually reads characters from gzipped file to stream
+ * buffer. Always buffered.
+ */
+ virtual int_type
+ underflow();
+
+ /**
+ * @brief Write put area to gzipped file.
+ * @param c Extra character to add to buffer contents.
+ * @return Non-EOF on success, EOF on error.
+ *
+ * This actually writes characters in stream buffer to
+ * gzipped file. With unbuffered output this is done one
+ * character at a time.
+ */
+ virtual int_type
+ overflow(int_type c = traits_type::eof());
+
+ /**
+ * @brief Installs external stream buffer.
+ * @param p Pointer to char buffer.
+ * @param n Size of external buffer.
+ * @return @c this on success, NULL on failure.
+ *
+ * Call setbuf(0,0) to enable unbuffered output.
+ */
+ virtual std::streambuf*
+ setbuf(char_type* p,
+ std::streamsize n);
+
+ /**
+ * @brief Flush stream buffer to file.
+ * @return 0 on success, -1 on error.
+ *
+ * This calls underflow(EOF) to do the job.
+ */
+ virtual int
+ sync();
+
+//
+// Some future enhancements
+//
+// virtual int_type uflow();
+// virtual int_type pbackfail(int_type c = traits_type::eof());
+// virtual pos_type
+// seekoff(off_type off,
+// std::ios_base::seekdir way,
+// std::ios_base::openmode mode = std::ios_base::in|std::ios_base::out);
+// virtual pos_type
+// seekpos(pos_type sp,
+// std::ios_base::openmode mode = std::ios_base::in|std::ios_base::out);
+
+private:
+ /**
+ * @brief Allocate internal buffer.
+ *
+ * This function is safe to call multiple times. It will ensure
+ * that a proper internal buffer exists if it is required. If the
+ * buffer already exists or is external, the buffer pointers will be
+ * reset to their original state.
+ */
+ void
+ enable_buffer();
+
+ /**
+ * @brief Destroy internal buffer.
+ *
+ * This function is safe to call multiple times. It will ensure
+ * that the internal buffer is deallocated if it exists. In any
+ * case, it will also reset the buffer pointers.
+ */
+ void
+ disable_buffer();
+
+ /**
+ * Underlying file pointer.
+ */
+ gzFile file;
+
+ /**
+ * Mode in which file was opened.
+ */
+ std::ios_base::openmode io_mode;
+
+ /**
+ * @brief True if this object owns file descriptor.
+ *
+ * This makes the class responsible for closing the file
+ * upon destruction.
+ */
+ bool own_fd;
+
+ /**
+ * @brief Stream buffer.
+ *
+ * For simplicity this remains allocated on the free store for the
+ * entire life span of the gzfilebuf object, unless replaced by setbuf.
+ */
+ char_type* buffer;
+
+ /**
+ * @brief Stream buffer size.
+ *
+ * Defaults to system default buffer size (typically 8192 bytes).
+ * Modified by setbuf.
+ */
+ std::streamsize buffer_size;
+
+ /**
+ * @brief True if this object owns stream buffer.
+ *
+ * This makes the class responsible for deleting the buffer
+ * upon destruction.
+ */
+ bool own_buffer;
+};
+
+/*****************************************************************************/
+
+/**
+ * @brief Gzipped file input stream class.
+ *
+ * This class implements ifstream for gzipped files. Seeking and putback
+ * is not supported yet.
+*/
+class gzifstream : public std::istream
+{
+public:
+ // Default constructor
+ gzifstream();
+
+ /**
+ * @brief Construct stream on gzipped file to be opened.
+ * @param name File name.
+ * @param mode Open mode flags (forced to contain ios::in).
+ */
+ explicit
+ gzifstream(const char* name,
+ std::ios_base::openmode mode = std::ios_base::in);
+
+ /**
+ * @brief Construct stream on already open gzipped file.
+ * @param fd File descriptor.
+ * @param mode Open mode flags (forced to contain ios::in).
+ */
+ explicit
+ gzifstream(int fd,
+ std::ios_base::openmode mode = std::ios_base::in);
+
+ /**
+ * Obtain underlying stream buffer.
+ */
+ gzfilebuf*
+ rdbuf() const
+ { return const_cast<gzfilebuf*>(&sb); }
+
+ /**
+ * @brief Check if file is open.
+ * @return True if file is open.
+ */
+ bool
+ is_open() { return sb.is_open(); }
+
+ /**
+ * @brief Open gzipped file.
+ * @param name File name.
+ * @param mode Open mode flags (forced to contain ios::in).
+ *
+ * Stream will be in state good() if file opens successfully;
+ * otherwise in state fail(). This differs from the behavior of
+ * ifstream, which never sets the state to good() and therefore
+ * won't allow you to reuse the stream for a second file unless
+ * you manually clear() the state. The choice is a matter of
+ * convenience.
+ */
+ void
+ open(const char* name,
+ std::ios_base::openmode mode = std::ios_base::in);
+
+ /**
+ * @brief Attach to already open gzipped file.
+ * @param fd File descriptor.
+ * @param mode Open mode flags (forced to contain ios::in).
+ *
+ * Stream will be in state good() if attach succeeded; otherwise
+ * in state fail().
+ */
+ void
+ attach(int fd,
+ std::ios_base::openmode mode = std::ios_base::in);
+
+ /**
+ * @brief Close gzipped file.
+ *
+ * Stream will be in state fail() if close failed.
+ */
+ void
+ close();
+
+private:
+ /**
+ * Underlying stream buffer.
+ */
+ gzfilebuf sb;
+};
+
+/*****************************************************************************/
+
+/**
+ * @brief Gzipped file output stream class.
+ *
+ * This class implements ofstream for gzipped files. Seeking and putback
+ * is not supported yet.
+*/
+class gzofstream : public std::ostream
+{
+public:
+ // Default constructor
+ gzofstream();
+
+ /**
+ * @brief Construct stream on gzipped file to be opened.
+ * @param name File name.
+ * @param mode Open mode flags (forced to contain ios::out).
+ */
+ explicit
+ gzofstream(const char* name,
+ std::ios_base::openmode mode = std::ios_base::out);
+
+ /**
+ * @brief Construct stream on already open gzipped file.
+ * @param fd File descriptor.
+ * @param mode Open mode flags (forced to contain ios::out).
+ */
+ explicit
+ gzofstream(int fd,
+ std::ios_base::openmode mode = std::ios_base::out);
+
+ /**
+ * Obtain underlying stream buffer.
+ */
+ gzfilebuf*
+ rdbuf() const
+ { return const_cast<gzfilebuf*>(&sb); }
+
+ /**
+ * @brief Check if file is open.
+ * @return True if file is open.
+ */
+ bool
+ is_open() { return sb.is_open(); }
+
+ /**
+ * @brief Open gzipped file.
+ * @param name File name.
+ * @param mode Open mode flags (forced to contain ios::out).
+ *
+ * Stream will be in state good() if file opens successfully;
+ * otherwise in state fail(). This differs from the behavior of
+ * ofstream, which never sets the state to good() and therefore
+ * won't allow you to reuse the stream for a second file unless
+ * you manually clear() the state. The choice is a matter of
+ * convenience.
+ */
+ void
+ open(const char* name,
+ std::ios_base::openmode mode = std::ios_base::out);
+
+ /**
+ * @brief Attach to already open gzipped file.
+ * @param fd File descriptor.
+ * @param mode Open mode flags (forced to contain ios::out).
+ *
+ * Stream will be in state good() if attach succeeded; otherwise
+ * in state fail().
+ */
+ void
+ attach(int fd,
+ std::ios_base::openmode mode = std::ios_base::out);
+
+ /**
+ * @brief Close gzipped file.
+ *
+ * Stream will be in state fail() if close failed.
+ */
+ void
+ close();
+
+private:
+ /**
+ * Underlying stream buffer.
+ */
+ gzfilebuf sb;
+};
+
+/*****************************************************************************/
+
+/**
+ * @brief Gzipped file output stream manipulator class.
+ *
+ * This class defines a two-argument manipulator for gzofstream. It is used
+ * as base for the setcompression(int,int) manipulator.
+*/
+template<typename T1, typename T2>
+ class gzomanip2
+ {
+ public:
+ // Allows insertor to peek at internals
+ template <typename Ta, typename Tb>
+ friend gzofstream&
+ operator<<(gzofstream&,
+ const gzomanip2<Ta,Tb>&);
+
+ // Constructor
+ gzomanip2(gzofstream& (*f)(gzofstream&, T1, T2),
+ T1 v1,
+ T2 v2);
+ private:
+ // Underlying manipulator function
+ gzofstream&
+ (*func)(gzofstream&, T1, T2);
+
+ // Arguments for manipulator function
+ T1 val1;
+ T2 val2;
+ };
+
+/*****************************************************************************/
+
+// Manipulator function thunks through to stream buffer
+inline gzofstream&
+setcompression(gzofstream &gzs, int l, int s = Z_DEFAULT_STRATEGY)
+{
+ (gzs.rdbuf())->setcompression(l, s);
+ return gzs;
+}
+
+// Manipulator constructor stores arguments
+template<typename T1, typename T2>
+ inline
+ gzomanip2<T1,T2>::gzomanip2(gzofstream &(*f)(gzofstream &, T1, T2),
+ T1 v1,
+ T2 v2)
+ : func(f), val1(v1), val2(v2)
+ { }
+
+// Insertor applies underlying manipulator function to stream
+template<typename T1, typename T2>
+ inline gzofstream&
+ operator<<(gzofstream& s, const gzomanip2<T1,T2>& m)
+ { return (*m.func)(s, m.val1, m.val2); }
+
+// Insert this onto stream to simplify setting of compression level
+inline gzomanip2<int,int>
+setcompression(int l, int s = Z_DEFAULT_STRATEGY)
+{ return gzomanip2<int,int>(&setcompression, l, s); }
+
+#endif // ZFSTREAM_H
diff --git a/protocols/Telegram/tgl/zlib/contrib/masmx64/bld_ml64.bat b/protocols/Telegram/tgl/zlib/contrib/masmx64/bld_ml64.bat
new file mode 100644
index 0000000000..8f9343d0af
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/masmx64/bld_ml64.bat
@@ -0,0 +1,2 @@
+ml64.exe /Flinffasx64 /c /Zi inffasx64.asm
+ml64.exe /Flgvmat64 /c /Zi gvmat64.asm
diff --git a/protocols/Telegram/tgl/zlib/contrib/masmx64/gvmat64.asm b/protocols/Telegram/tgl/zlib/contrib/masmx64/gvmat64.asm
new file mode 100644
index 0000000000..9879c28b90
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/masmx64/gvmat64.asm
@@ -0,0 +1,553 @@
+;uInt longest_match_x64(
+; deflate_state *s,
+; IPos cur_match); /* current match */
+
+; gvmat64.asm -- Asm portion of the optimized longest_match for 32 bits x86_64
+; (AMD64 on Athlon 64, Opteron, Phenom
+; and Intel EM64T on Pentium 4 with EM64T, Pentium D, Core 2 Duo, Core I5/I7)
+; Copyright (C) 1995-2010 Jean-loup Gailly, Brian Raiter and Gilles Vollant.
+;
+; File written by Gilles Vollant, by converting to assembly the longest_match
+; from Jean-loup Gailly in deflate.c of zLib and infoZip zip.
+;
+; and by taking inspiration on asm686 with masm, optimised assembly code
+; from Brian Raiter, written 1998
+;
+; This software is provided 'as-is', without any express or implied
+; warranty. In no event will the authors be held liable for any damages
+; arising from the use of this software.
+;
+; Permission is granted to anyone to use this software for any purpose,
+; including commercial applications, and to alter it and redistribute it
+; freely, subject to the following restrictions:
+;
+; 1. The origin of this software must not be misrepresented; you must not
+; claim that you wrote the original software. If you use this software
+; in a product, an acknowledgment in the product documentation would be
+; appreciated but is not required.
+; 2. Altered source versions must be plainly marked as such, and must not be
+; misrepresented as being the original software
+; 3. This notice may not be removed or altered from any source distribution.
+;
+;
+;
+; http://www.zlib.net
+; http://www.winimage.com/zLibDll
+; http://www.muppetlabs.com/~breadbox/software/assembly.html
+;
+; to compile this file for infozip Zip, I use option:
+; ml64.exe /Flgvmat64 /c /Zi /DINFOZIP gvmat64.asm
+;
+; to compile this file for zLib, I use option:
+; ml64.exe /Flgvmat64 /c /Zi gvmat64.asm
+; Be carrefull to adapt zlib1222add below to your version of zLib
+; (if you use a version of zLib before 1.0.4 or after 1.2.2.2, change
+; value of zlib1222add later)
+;
+; This file compile with Microsoft Macro Assembler (x64) for AMD64
+;
+; ml64.exe is given with Visual Studio 2005/2008/2010 and Windows WDK
+;
+; (you can get Windows WDK with ml64 for AMD64 from
+; http://www.microsoft.com/whdc/Devtools/wdk/default.mspx for low price)
+;
+
+
+;uInt longest_match(s, cur_match)
+; deflate_state *s;
+; IPos cur_match; /* current match */
+.code
+longest_match PROC
+
+
+;LocalVarsSize equ 88
+ LocalVarsSize equ 72
+
+; register used : rax,rbx,rcx,rdx,rsi,rdi,r8,r9,r10,r11,r12
+; free register : r14,r15
+; register can be saved : rsp
+
+ chainlenwmask equ rsp + 8 - LocalVarsSize ; high word: current chain len
+ ; low word: s->wmask
+;window equ rsp + xx - LocalVarsSize ; local copy of s->window ; stored in r10
+;windowbestlen equ rsp + xx - LocalVarsSize ; s->window + bestlen , use r10+r11
+;scanstart equ rsp + xx - LocalVarsSize ; first two bytes of string ; stored in r12w
+;scanend equ rsp + xx - LocalVarsSize ; last two bytes of string use ebx
+;scanalign equ rsp + xx - LocalVarsSize ; dword-misalignment of string r13
+;bestlen equ rsp + xx - LocalVarsSize ; size of best match so far -> r11d
+;scan equ rsp + xx - LocalVarsSize ; ptr to string wanting match -> r9
+IFDEF INFOZIP
+ELSE
+ nicematch equ (rsp + 16 - LocalVarsSize) ; a good enough match size
+ENDIF
+
+save_rdi equ rsp + 24 - LocalVarsSize
+save_rsi equ rsp + 32 - LocalVarsSize
+save_rbx equ rsp + 40 - LocalVarsSize
+save_rbp equ rsp + 48 - LocalVarsSize
+save_r12 equ rsp + 56 - LocalVarsSize
+save_r13 equ rsp + 64 - LocalVarsSize
+;save_r14 equ rsp + 72 - LocalVarsSize
+;save_r15 equ rsp + 80 - LocalVarsSize
+
+
+; summary of register usage
+; scanend ebx
+; scanendw bx
+; chainlenwmask edx
+; curmatch rsi
+; curmatchd esi
+; windowbestlen r8
+; scanalign r9
+; scanalignd r9d
+; window r10
+; bestlen r11
+; bestlend r11d
+; scanstart r12d
+; scanstartw r12w
+; scan r13
+; nicematch r14d
+; limit r15
+; limitd r15d
+; prev rcx
+
+; all the +4 offsets are due to the addition of pending_buf_size (in zlib
+; in the deflate_state structure since the asm code was first written
+; (if you compile with zlib 1.0.4 or older, remove the +4).
+; Note : these value are good with a 8 bytes boundary pack structure
+
+
+ MAX_MATCH equ 258
+ MIN_MATCH equ 3
+ MIN_LOOKAHEAD equ (MAX_MATCH+MIN_MATCH+1)
+
+
+;;; Offsets for fields in the deflate_state structure. These numbers
+;;; are calculated from the definition of deflate_state, with the
+;;; assumption that the compiler will dword-align the fields. (Thus,
+;;; changing the definition of deflate_state could easily cause this
+;;; program to crash horribly, without so much as a warning at
+;;; compile time. Sigh.)
+
+; all the +zlib1222add offsets are due to the addition of fields
+; in zlib in the deflate_state structure since the asm code was first written
+; (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)").
+; (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0").
+; if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8").
+
+
+IFDEF INFOZIP
+
+_DATA SEGMENT
+COMM window_size:DWORD
+; WMask ; 7fff
+COMM window:BYTE:010040H
+COMM prev:WORD:08000H
+; MatchLen : unused
+; PrevMatch : unused
+COMM strstart:DWORD
+COMM match_start:DWORD
+; Lookahead : ignore
+COMM prev_length:DWORD ; PrevLen
+COMM max_chain_length:DWORD
+COMM good_match:DWORD
+COMM nice_match:DWORD
+prev_ad equ OFFSET prev
+window_ad equ OFFSET window
+nicematch equ nice_match
+_DATA ENDS
+WMask equ 07fffh
+
+ELSE
+
+ IFNDEF zlib1222add
+ zlib1222add equ 8
+ ENDIF
+dsWSize equ 56+zlib1222add+(zlib1222add/2)
+dsWMask equ 64+zlib1222add+(zlib1222add/2)
+dsWindow equ 72+zlib1222add
+dsPrev equ 88+zlib1222add
+dsMatchLen equ 128+zlib1222add
+dsPrevMatch equ 132+zlib1222add
+dsStrStart equ 140+zlib1222add
+dsMatchStart equ 144+zlib1222add
+dsLookahead equ 148+zlib1222add
+dsPrevLen equ 152+zlib1222add
+dsMaxChainLen equ 156+zlib1222add
+dsGoodMatch equ 172+zlib1222add
+dsNiceMatch equ 176+zlib1222add
+
+window_size equ [ rcx + dsWSize]
+WMask equ [ rcx + dsWMask]
+window_ad equ [ rcx + dsWindow]
+prev_ad equ [ rcx + dsPrev]
+strstart equ [ rcx + dsStrStart]
+match_start equ [ rcx + dsMatchStart]
+Lookahead equ [ rcx + dsLookahead] ; 0ffffffffh on infozip
+prev_length equ [ rcx + dsPrevLen]
+max_chain_length equ [ rcx + dsMaxChainLen]
+good_match equ [ rcx + dsGoodMatch]
+nice_match equ [ rcx + dsNiceMatch]
+ENDIF
+
+; parameter 1 in r8(deflate state s), param 2 in rdx (cur match)
+
+; see http://weblogs.asp.net/oldnewthing/archive/2004/01/14/58579.aspx and
+; http://msdn.microsoft.com/library/en-us/kmarch/hh/kmarch/64bitAMD_8e951dd2-ee77-4728-8702-55ce4b5dd24a.xml.asp
+;
+; All registers must be preserved across the call, except for
+; rax, rcx, rdx, r8, r9, r10, and r11, which are scratch.
+
+
+
+;;; Save registers that the compiler may be using, and adjust esp to
+;;; make room for our stack frame.
+
+
+;;; Retrieve the function arguments. r8d will hold cur_match
+;;; throughout the entire function. edx will hold the pointer to the
+;;; deflate_state structure during the function's setup (before
+;;; entering the main loop.
+
+; parameter 1 in rcx (deflate_state* s), param 2 in edx -> r8 (cur match)
+
+; this clear high 32 bits of r8, which can be garbage in both r8 and rdx
+
+ mov [save_rdi],rdi
+ mov [save_rsi],rsi
+ mov [save_rbx],rbx
+ mov [save_rbp],rbp
+IFDEF INFOZIP
+ mov r8d,ecx
+ELSE
+ mov r8d,edx
+ENDIF
+ mov [save_r12],r12
+ mov [save_r13],r13
+; mov [save_r14],r14
+; mov [save_r15],r15
+
+
+;;; uInt wmask = s->w_mask;
+;;; unsigned chain_length = s->max_chain_length;
+;;; if (s->prev_length >= s->good_match) {
+;;; chain_length >>= 2;
+;;; }
+
+ mov edi, prev_length
+ mov esi, good_match
+ mov eax, WMask
+ mov ebx, max_chain_length
+ cmp edi, esi
+ jl LastMatchGood
+ shr ebx, 2
+LastMatchGood:
+
+;;; chainlen is decremented once beforehand so that the function can
+;;; use the sign flag instead of the zero flag for the exit test.
+;;; It is then shifted into the high word, to make room for the wmask
+;;; value, which it will always accompany.
+
+ dec ebx
+ shl ebx, 16
+ or ebx, eax
+
+;;; on zlib only
+;;; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
+
+IFDEF INFOZIP
+ mov [chainlenwmask], ebx
+; on infozip nice_match = [nice_match]
+ELSE
+ mov eax, nice_match
+ mov [chainlenwmask], ebx
+ mov r10d, Lookahead
+ cmp r10d, eax
+ cmovnl r10d, eax
+ mov [nicematch],r10d
+ENDIF
+
+;;; register Bytef *scan = s->window + s->strstart;
+ mov r10, window_ad
+ mov ebp, strstart
+ lea r13, [r10 + rbp]
+
+;;; Determine how many bytes the scan ptr is off from being
+;;; dword-aligned.
+
+ mov r9,r13
+ neg r13
+ and r13,3
+
+;;; IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
+;;; s->strstart - (IPos)MAX_DIST(s) : NIL;
+IFDEF INFOZIP
+ mov eax,07efah ; MAX_DIST = (WSIZE-MIN_LOOKAHEAD) (0x8000-(3+8+1))
+ELSE
+ mov eax, window_size
+ sub eax, MIN_LOOKAHEAD
+ENDIF
+ xor edi,edi
+ sub ebp, eax
+
+ mov r11d, prev_length
+
+ cmovng ebp,edi
+
+;;; int best_len = s->prev_length;
+
+
+;;; Store the sum of s->window + best_len in esi locally, and in esi.
+
+ lea rsi,[r10+r11]
+
+;;; register ush scan_start = *(ushf*)scan;
+;;; register ush scan_end = *(ushf*)(scan+best_len-1);
+;;; Posf *prev = s->prev;
+
+ movzx r12d,word ptr [r9]
+ movzx ebx, word ptr [r9 + r11 - 1]
+
+ mov rdi, prev_ad
+
+;;; Jump into the main loop.
+
+ mov edx, [chainlenwmask]
+
+ cmp bx,word ptr [rsi + r8 - 1]
+ jz LookupLoopIsZero
+
+LookupLoop1:
+ and r8d, edx
+
+ movzx r8d, word ptr [rdi + r8*2]
+ cmp r8d, ebp
+ jbe LeaveNow
+ sub edx, 00010000h
+ js LeaveNow
+
+LoopEntry1:
+ cmp bx,word ptr [rsi + r8 - 1]
+ jz LookupLoopIsZero
+
+LookupLoop2:
+ and r8d, edx
+
+ movzx r8d, word ptr [rdi + r8*2]
+ cmp r8d, ebp
+ jbe LeaveNow
+ sub edx, 00010000h
+ js LeaveNow
+
+LoopEntry2:
+ cmp bx,word ptr [rsi + r8 - 1]
+ jz LookupLoopIsZero
+
+LookupLoop4:
+ and r8d, edx
+
+ movzx r8d, word ptr [rdi + r8*2]
+ cmp r8d, ebp
+ jbe LeaveNow
+ sub edx, 00010000h
+ js LeaveNow
+
+LoopEntry4:
+
+ cmp bx,word ptr [rsi + r8 - 1]
+ jnz LookupLoop1
+ jmp LookupLoopIsZero
+
+
+;;; do {
+;;; match = s->window + cur_match;
+;;; if (*(ushf*)(match+best_len-1) != scan_end ||
+;;; *(ushf*)match != scan_start) continue;
+;;; [...]
+;;; } while ((cur_match = prev[cur_match & wmask]) > limit
+;;; && --chain_length != 0);
+;;;
+;;; Here is the inner loop of the function. The function will spend the
+;;; majority of its time in this loop, and majority of that time will
+;;; be spent in the first ten instructions.
+;;;
+;;; Within this loop:
+;;; ebx = scanend
+;;; r8d = curmatch
+;;; edx = chainlenwmask - i.e., ((chainlen << 16) | wmask)
+;;; esi = windowbestlen - i.e., (window + bestlen)
+;;; edi = prev
+;;; ebp = limit
+
+LookupLoop:
+ and r8d, edx
+
+ movzx r8d, word ptr [rdi + r8*2]
+ cmp r8d, ebp
+ jbe LeaveNow
+ sub edx, 00010000h
+ js LeaveNow
+
+LoopEntry:
+
+ cmp bx,word ptr [rsi + r8 - 1]
+ jnz LookupLoop1
+LookupLoopIsZero:
+ cmp r12w, word ptr [r10 + r8]
+ jnz LookupLoop1
+
+
+;;; Store the current value of chainlen.
+ mov [chainlenwmask], edx
+
+;;; Point edi to the string under scrutiny, and esi to the string we
+;;; are hoping to match it up with. In actuality, esi and edi are
+;;; both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and edx is
+;;; initialized to -(MAX_MATCH_8 - scanalign).
+
+ lea rsi,[r8+r10]
+ mov rdx, 0fffffffffffffef8h; -(MAX_MATCH_8)
+ lea rsi, [rsi + r13 + 0108h] ;MAX_MATCH_8]
+ lea rdi, [r9 + r13 + 0108h] ;MAX_MATCH_8]
+
+ prefetcht1 [rsi+rdx]
+ prefetcht1 [rdi+rdx]
+
+
+;;; Test the strings for equality, 8 bytes at a time. At the end,
+;;; adjust rdx so that it is offset to the exact byte that mismatched.
+;;;
+;;; We already know at this point that the first three bytes of the
+;;; strings match each other, and they can be safely passed over before
+;;; starting the compare loop. So what this code does is skip over 0-3
+;;; bytes, as much as necessary in order to dword-align the edi
+;;; pointer. (rsi will still be misaligned three times out of four.)
+;;;
+;;; It should be confessed that this loop usually does not represent
+;;; much of the total running time. Replacing it with a more
+;;; straightforward "rep cmpsb" would not drastically degrade
+;;; performance.
+
+
+LoopCmps:
+ mov rax, [rsi + rdx]
+ xor rax, [rdi + rdx]
+ jnz LeaveLoopCmps
+
+ mov rax, [rsi + rdx + 8]
+ xor rax, [rdi + rdx + 8]
+ jnz LeaveLoopCmps8
+
+
+ mov rax, [rsi + rdx + 8+8]
+ xor rax, [rdi + rdx + 8+8]
+ jnz LeaveLoopCmps16
+
+ add rdx,8+8+8
+
+ jnz short LoopCmps
+ jmp short LenMaximum
+LeaveLoopCmps16: add rdx,8
+LeaveLoopCmps8: add rdx,8
+LeaveLoopCmps:
+
+ test eax, 0000FFFFh
+ jnz LenLower
+
+ test eax,0ffffffffh
+
+ jnz LenLower32
+
+ add rdx,4
+ shr rax,32
+ or ax,ax
+ jnz LenLower
+
+LenLower32:
+ shr eax,16
+ add rdx,2
+LenLower: sub al, 1
+ adc rdx, 0
+;;; Calculate the length of the match. If it is longer than MAX_MATCH,
+;;; then automatically accept it as the best possible match and leave.
+
+ lea rax, [rdi + rdx]
+ sub rax, r9
+ cmp eax, MAX_MATCH
+ jge LenMaximum
+
+;;; If the length of the match is not longer than the best match we
+;;; have so far, then forget it and return to the lookup loop.
+;///////////////////////////////////
+
+ cmp eax, r11d
+ jg LongerMatch
+
+ lea rsi,[r10+r11]
+
+ mov rdi, prev_ad
+ mov edx, [chainlenwmask]
+ jmp LookupLoop
+
+;;; s->match_start = cur_match;
+;;; best_len = len;
+;;; if (len >= nice_match) break;
+;;; scan_end = *(ushf*)(scan+best_len-1);
+
+LongerMatch:
+ mov r11d, eax
+ mov match_start, r8d
+ cmp eax, [nicematch]
+ jge LeaveNow
+
+ lea rsi,[r10+rax]
+
+ movzx ebx, word ptr [r9 + rax - 1]
+ mov rdi, prev_ad
+ mov edx, [chainlenwmask]
+ jmp LookupLoop
+
+;;; Accept the current string, with the maximum possible length.
+
+LenMaximum:
+ mov r11d,MAX_MATCH
+ mov match_start, r8d
+
+;;; if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
+;;; return s->lookahead;
+
+LeaveNow:
+IFDEF INFOZIP
+ mov eax,r11d
+ELSE
+ mov eax, Lookahead
+ cmp r11d, eax
+ cmovng eax, r11d
+ENDIF
+
+;;; Restore the stack and return from whence we came.
+
+
+ mov rsi,[save_rsi]
+ mov rdi,[save_rdi]
+ mov rbx,[save_rbx]
+ mov rbp,[save_rbp]
+ mov r12,[save_r12]
+ mov r13,[save_r13]
+; mov r14,[save_r14]
+; mov r15,[save_r15]
+
+
+ ret 0
+; please don't remove this string !
+; Your can freely use gvmat64 in any free or commercial app
+; but it is far better don't remove the string in the binary!
+ db 0dh,0ah,"asm686 with masm, optimised assembly code from Brian Raiter, written 1998, converted to amd 64 by Gilles Vollant 2005",0dh,0ah,0
+longest_match ENDP
+
+match_init PROC
+ ret 0
+match_init ENDP
+
+
+END
diff --git a/protocols/Telegram/tgl/zlib/contrib/masmx64/inffas8664.c b/protocols/Telegram/tgl/zlib/contrib/masmx64/inffas8664.c
new file mode 100644
index 0000000000..e8af06fa02
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/masmx64/inffas8664.c
@@ -0,0 +1,186 @@
+/* inffas8664.c is a hand tuned assembler version of inffast.c - fast decoding
+ * version for AMD64 on Windows using Microsoft C compiler
+ *
+ * Copyright (C) 1995-2003 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ *
+ * Copyright (C) 2003 Chris Anderson <christop@charm.net>
+ * Please use the copyright conditions above.
+ *
+ * 2005 - Adaptation to Microsoft C Compiler for AMD64 by Gilles Vollant
+ *
+ * inffas8664.c call function inffas8664fnc in inffasx64.asm
+ * inffasx64.asm is automatically convert from AMD64 portion of inffas86.c
+ *
+ * Dec-29-2003 -- I added AMD64 inflate asm support. This version is also
+ * slightly quicker on x86 systems because, instead of using rep movsb to copy
+ * data, it uses rep movsw, which moves data in 2-byte chunks instead of single
+ * bytes. I've tested the AMD64 code on a Fedora Core 1 + the x86_64 updates
+ * from http://fedora.linux.duke.edu/fc1_x86_64
+ * which is running on an Athlon 64 3000+ / Gigabyte GA-K8VT800M system with
+ * 1GB ram. The 64-bit version is about 4% faster than the 32-bit version,
+ * when decompressing mozilla-source-1.3.tar.gz.
+ *
+ * Mar-13-2003 -- Most of this is derived from inffast.S which is derived from
+ * the gcc -S output of zlib-1.2.0/inffast.c. Zlib-1.2.0 is in beta release at
+ * the moment. I have successfully compiled and tested this code with gcc2.96,
+ * gcc3.2, icc5.0, msvc6.0. It is very close to the speed of inffast.S
+ * compiled with gcc -DNO_MMX, but inffast.S is still faster on the P3 with MMX
+ * enabled. I will attempt to merge the MMX code into this version. Newer
+ * versions of this and inffast.S can be found at
+ * http://www.eetbeetee.com/zlib/ and http://www.charm.net/~christop/zlib/
+ *
+ */
+
+#include <stdio.h>
+#include "zutil.h"
+#include "inftrees.h"
+#include "inflate.h"
+#include "inffast.h"
+
+/* Mark Adler's comments from inffast.c: */
+
+/*
+ Decode literal, length, and distance codes and write out the resulting
+ literal and match bytes until either not enough input or output is
+ available, an end-of-block is encountered, or a data error is encountered.
+ When large enough input and output buffers are supplied to inflate(), for
+ example, a 16K input buffer and a 64K output buffer, more than 95% of the
+ inflate execution time is spent in this routine.
+
+ Entry assumptions:
+
+ state->mode == LEN
+ strm->avail_in >= 6
+ strm->avail_out >= 258
+ start >= strm->avail_out
+ state->bits < 8
+
+ On return, state->mode is one of:
+
+ LEN -- ran out of enough output space or enough available input
+ TYPE -- reached end of block code, inflate() to interpret next block
+ BAD -- error in block data
+
+ Notes:
+
+ - The maximum input bits used by a length/distance pair is 15 bits for the
+ length code, 5 bits for the length extra, 15 bits for the distance code,
+ and 13 bits for the distance extra. This totals 48 bits, or six bytes.
+ Therefore if strm->avail_in >= 6, then there is enough input to avoid
+ checking for available input while decoding.
+
+ - The maximum bytes that a single length/distance pair can output is 258
+ bytes, which is the maximum length that can be coded. inflate_fast()
+ requires strm->avail_out >= 258 for each loop to avoid checking for
+ output space.
+ */
+
+
+
+ typedef struct inffast_ar {
+/* 64 32 x86 x86_64 */
+/* ar offset register */
+/* 0 0 */ void *esp; /* esp save */
+/* 8 4 */ void *ebp; /* ebp save */
+/* 16 8 */ unsigned char FAR *in; /* esi rsi local strm->next_in */
+/* 24 12 */ unsigned char FAR *last; /* r9 while in < last */
+/* 32 16 */ unsigned char FAR *out; /* edi rdi local strm->next_out */
+/* 40 20 */ unsigned char FAR *beg; /* inflate()'s init next_out */
+/* 48 24 */ unsigned char FAR *end; /* r10 while out < end */
+/* 56 28 */ unsigned char FAR *window;/* size of window, wsize!=0 */
+/* 64 32 */ code const FAR *lcode; /* ebp rbp local strm->lencode */
+/* 72 36 */ code const FAR *dcode; /* r11 local strm->distcode */
+/* 80 40 */ size_t /*unsigned long */hold; /* edx rdx local strm->hold */
+/* 88 44 */ unsigned bits; /* ebx rbx local strm->bits */
+/* 92 48 */ unsigned wsize; /* window size */
+/* 96 52 */ unsigned write; /* window write index */
+/*100 56 */ unsigned lmask; /* r12 mask for lcode */
+/*104 60 */ unsigned dmask; /* r13 mask for dcode */
+/*108 64 */ unsigned len; /* r14 match length */
+/*112 68 */ unsigned dist; /* r15 match distance */
+/*116 72 */ unsigned status; /* set when state chng*/
+ } type_ar;
+#ifdef ASMINF
+
+void inflate_fast(strm, start)
+z_streamp strm;
+unsigned start; /* inflate()'s starting value for strm->avail_out */
+{
+ struct inflate_state FAR *state;
+ type_ar ar;
+ void inffas8664fnc(struct inffast_ar * par);
+
+
+
+#if (defined( __GNUC__ ) && defined( __amd64__ ) && ! defined( __i386 )) || (defined(_MSC_VER) && defined(_M_AMD64))
+#define PAD_AVAIL_IN 6
+#define PAD_AVAIL_OUT 258
+#else
+#define PAD_AVAIL_IN 5
+#define PAD_AVAIL_OUT 257
+#endif
+
+ /* copy state to local variables */
+ state = (struct inflate_state FAR *)strm->state;
+
+ ar.in = strm->next_in;
+ ar.last = ar.in + (strm->avail_in - PAD_AVAIL_IN);
+ ar.out = strm->next_out;
+ ar.beg = ar.out - (start - strm->avail_out);
+ ar.end = ar.out + (strm->avail_out - PAD_AVAIL_OUT);
+ ar.wsize = state->wsize;
+ ar.write = state->wnext;
+ ar.window = state->window;
+ ar.hold = state->hold;
+ ar.bits = state->bits;
+ ar.lcode = state->lencode;
+ ar.dcode = state->distcode;
+ ar.lmask = (1U << state->lenbits) - 1;
+ ar.dmask = (1U << state->distbits) - 1;
+
+ /* decode literals and length/distances until end-of-block or not enough
+ input data or output space */
+
+ /* align in on 1/2 hold size boundary */
+ while (((size_t)(void *)ar.in & (sizeof(ar.hold) / 2 - 1)) != 0) {
+ ar.hold += (unsigned long)*ar.in++ << ar.bits;
+ ar.bits += 8;
+ }
+
+ inffas8664fnc(&ar);
+
+ if (ar.status > 1) {
+ if (ar.status == 2)
+ strm->msg = "invalid literal/length code";
+ else if (ar.status == 3)
+ strm->msg = "invalid distance code";
+ else
+ strm->msg = "invalid distance too far back";
+ state->mode = BAD;
+ }
+ else if ( ar.status == 1 ) {
+ state->mode = TYPE;
+ }
+
+ /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
+ ar.len = ar.bits >> 3;
+ ar.in -= ar.len;
+ ar.bits -= ar.len << 3;
+ ar.hold &= (1U << ar.bits) - 1;
+
+ /* update state and return */
+ strm->next_in = ar.in;
+ strm->next_out = ar.out;
+ strm->avail_in = (unsigned)(ar.in < ar.last ?
+ PAD_AVAIL_IN + (ar.last - ar.in) :
+ PAD_AVAIL_IN - (ar.in - ar.last));
+ strm->avail_out = (unsigned)(ar.out < ar.end ?
+ PAD_AVAIL_OUT + (ar.end - ar.out) :
+ PAD_AVAIL_OUT - (ar.out - ar.end));
+ state->hold = (unsigned long)ar.hold;
+ state->bits = ar.bits;
+ return;
+}
+
+#endif
diff --git a/protocols/Telegram/tgl/zlib/contrib/masmx64/inffasx64.asm b/protocols/Telegram/tgl/zlib/contrib/masmx64/inffasx64.asm
new file mode 100644
index 0000000000..60a8d89b71
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/masmx64/inffasx64.asm
@@ -0,0 +1,396 @@
+; inffasx64.asm is a hand tuned assembler version of inffast.c - fast decoding
+; version for AMD64 on Windows using Microsoft C compiler
+;
+; inffasx64.asm is automatically convert from AMD64 portion of inffas86.c
+; inffasx64.asm is called by inffas8664.c, which contain more info.
+
+
+; to compile this file, I use option
+; ml64.exe /Flinffasx64 /c /Zi inffasx64.asm
+; with Microsoft Macro Assembler (x64) for AMD64
+;
+
+; This file compile with Microsoft Macro Assembler (x64) for AMD64
+;
+; ml64.exe is given with Visual Studio 2005/2008/2010 and Windows WDK
+;
+; (you can get Windows WDK with ml64 for AMD64 from
+; http://www.microsoft.com/whdc/Devtools/wdk/default.mspx for low price)
+;
+
+
+.code
+inffas8664fnc PROC
+
+; see http://weblogs.asp.net/oldnewthing/archive/2004/01/14/58579.aspx and
+; http://msdn.microsoft.com/library/en-us/kmarch/hh/kmarch/64bitAMD_8e951dd2-ee77-4728-8702-55ce4b5dd24a.xml.asp
+;
+; All registers must be preserved across the call, except for
+; rax, rcx, rdx, r8, r-9, r10, and r11, which are scratch.
+
+
+ mov [rsp-8],rsi
+ mov [rsp-16],rdi
+ mov [rsp-24],r12
+ mov [rsp-32],r13
+ mov [rsp-40],r14
+ mov [rsp-48],r15
+ mov [rsp-56],rbx
+
+ mov rax,rcx
+
+ mov [rax+8], rbp ; /* save regs rbp and rsp */
+ mov [rax], rsp
+
+ mov rsp, rax ; /* make rsp point to &ar */
+
+ mov rsi, [rsp+16] ; /* rsi = in */
+ mov rdi, [rsp+32] ; /* rdi = out */
+ mov r9, [rsp+24] ; /* r9 = last */
+ mov r10, [rsp+48] ; /* r10 = end */
+ mov rbp, [rsp+64] ; /* rbp = lcode */
+ mov r11, [rsp+72] ; /* r11 = dcode */
+ mov rdx, [rsp+80] ; /* rdx = hold */
+ mov ebx, [rsp+88] ; /* ebx = bits */
+ mov r12d, [rsp+100] ; /* r12d = lmask */
+ mov r13d, [rsp+104] ; /* r13d = dmask */
+ ; /* r14d = len */
+ ; /* r15d = dist */
+
+
+ cld
+ cmp r10, rdi
+ je L_one_time ; /* if only one decode left */
+ cmp r9, rsi
+
+ jne L_do_loop
+
+
+L_one_time:
+ mov r8, r12 ; /* r8 = lmask */
+ cmp bl, 32
+ ja L_get_length_code_one_time
+
+ lodsd ; /* eax = *(uint *)in++ */
+ mov cl, bl ; /* cl = bits, needs it for shifting */
+ add bl, 32 ; /* bits += 32 */
+ shl rax, cl
+ or rdx, rax ; /* hold |= *((uint *)in)++ << bits */
+ jmp L_get_length_code_one_time
+
+ALIGN 4
+L_while_test:
+ cmp r10, rdi
+ jbe L_break_loop
+ cmp r9, rsi
+ jbe L_break_loop
+
+L_do_loop:
+ mov r8, r12 ; /* r8 = lmask */
+ cmp bl, 32
+ ja L_get_length_code ; /* if (32 < bits) */
+
+ lodsd ; /* eax = *(uint *)in++ */
+ mov cl, bl ; /* cl = bits, needs it for shifting */
+ add bl, 32 ; /* bits += 32 */
+ shl rax, cl
+ or rdx, rax ; /* hold |= *((uint *)in)++ << bits */
+
+L_get_length_code:
+ and r8, rdx ; /* r8 &= hold */
+ mov eax, [rbp+r8*4] ; /* eax = lcode[hold & lmask] */
+
+ mov cl, ah ; /* cl = this.bits */
+ sub bl, ah ; /* bits -= this.bits */
+ shr rdx, cl ; /* hold >>= this.bits */
+
+ test al, al
+ jnz L_test_for_length_base ; /* if (op != 0) 45.7% */
+
+ mov r8, r12 ; /* r8 = lmask */
+ shr eax, 16 ; /* output this.val char */
+ stosb
+
+L_get_length_code_one_time:
+ and r8, rdx ; /* r8 &= hold */
+ mov eax, [rbp+r8*4] ; /* eax = lcode[hold & lmask] */
+
+L_dolen:
+ mov cl, ah ; /* cl = this.bits */
+ sub bl, ah ; /* bits -= this.bits */
+ shr rdx, cl ; /* hold >>= this.bits */
+
+ test al, al
+ jnz L_test_for_length_base ; /* if (op != 0) 45.7% */
+
+ shr eax, 16 ; /* output this.val char */
+ stosb
+ jmp L_while_test
+
+ALIGN 4
+L_test_for_length_base:
+ mov r14d, eax ; /* len = this */
+ shr r14d, 16 ; /* len = this.val */
+ mov cl, al
+
+ test al, 16
+ jz L_test_for_second_level_length ; /* if ((op & 16) == 0) 8% */
+ and cl, 15 ; /* op &= 15 */
+ jz L_decode_distance ; /* if (!op) */
+
+L_add_bits_to_len:
+ sub bl, cl
+ xor eax, eax
+ inc eax
+ shl eax, cl
+ dec eax
+ and eax, edx ; /* eax &= hold */
+ shr rdx, cl
+ add r14d, eax ; /* len += hold & mask[op] */
+
+L_decode_distance:
+ mov r8, r13 ; /* r8 = dmask */
+ cmp bl, 32
+ ja L_get_distance_code ; /* if (32 < bits) */
+
+ lodsd ; /* eax = *(uint *)in++ */
+ mov cl, bl ; /* cl = bits, needs it for shifting */
+ add bl, 32 ; /* bits += 32 */
+ shl rax, cl
+ or rdx, rax ; /* hold |= *((uint *)in)++ << bits */
+
+L_get_distance_code:
+ and r8, rdx ; /* r8 &= hold */
+ mov eax, [r11+r8*4] ; /* eax = dcode[hold & dmask] */
+
+L_dodist:
+ mov r15d, eax ; /* dist = this */
+ shr r15d, 16 ; /* dist = this.val */
+ mov cl, ah
+ sub bl, ah ; /* bits -= this.bits */
+ shr rdx, cl ; /* hold >>= this.bits */
+ mov cl, al ; /* cl = this.op */
+
+ test al, 16 ; /* if ((op & 16) == 0) */
+ jz L_test_for_second_level_dist
+ and cl, 15 ; /* op &= 15 */
+ jz L_check_dist_one
+
+L_add_bits_to_dist:
+ sub bl, cl
+ xor eax, eax
+ inc eax
+ shl eax, cl
+ dec eax ; /* (1 << op) - 1 */
+ and eax, edx ; /* eax &= hold */
+ shr rdx, cl
+ add r15d, eax ; /* dist += hold & ((1 << op) - 1) */
+
+L_check_window:
+ mov r8, rsi ; /* save in so from can use it's reg */
+ mov rax, rdi
+ sub rax, [rsp+40] ; /* nbytes = out - beg */
+
+ cmp eax, r15d
+ jb L_clip_window ; /* if (dist > nbytes) 4.2% */
+
+ mov ecx, r14d ; /* ecx = len */
+ mov rsi, rdi
+ sub rsi, r15 ; /* from = out - dist */
+
+ sar ecx, 1
+ jnc L_copy_two ; /* if len % 2 == 0 */
+
+ rep movsw
+ mov al, [rsi]
+ mov [rdi], al
+ inc rdi
+
+ mov rsi, r8 ; /* move in back to %rsi, toss from */
+ jmp L_while_test
+
+L_copy_two:
+ rep movsw
+ mov rsi, r8 ; /* move in back to %rsi, toss from */
+ jmp L_while_test
+
+ALIGN 4
+L_check_dist_one:
+ cmp r15d, 1 ; /* if dist 1, is a memset */
+ jne L_check_window
+ cmp [rsp+40], rdi ; /* if out == beg, outside window */
+ je L_check_window
+
+ mov ecx, r14d ; /* ecx = len */
+ mov al, [rdi-1]
+ mov ah, al
+
+ sar ecx, 1
+ jnc L_set_two
+ mov [rdi], al
+ inc rdi
+
+L_set_two:
+ rep stosw
+ jmp L_while_test
+
+ALIGN 4
+L_test_for_second_level_length:
+ test al, 64
+ jnz L_test_for_end_of_block ; /* if ((op & 64) != 0) */
+
+ xor eax, eax
+ inc eax
+ shl eax, cl
+ dec eax
+ and eax, edx ; /* eax &= hold */
+ add eax, r14d ; /* eax += len */
+ mov eax, [rbp+rax*4] ; /* eax = lcode[val+(hold&mask[op])]*/
+ jmp L_dolen
+
+ALIGN 4
+L_test_for_second_level_dist:
+ test al, 64
+ jnz L_invalid_distance_code ; /* if ((op & 64) != 0) */
+
+ xor eax, eax
+ inc eax
+ shl eax, cl
+ dec eax
+ and eax, edx ; /* eax &= hold */
+ add eax, r15d ; /* eax += dist */
+ mov eax, [r11+rax*4] ; /* eax = dcode[val+(hold&mask[op])]*/
+ jmp L_dodist
+
+ALIGN 4
+L_clip_window:
+ mov ecx, eax ; /* ecx = nbytes */
+ mov eax, [rsp+92] ; /* eax = wsize, prepare for dist cmp */
+ neg ecx ; /* nbytes = -nbytes */
+
+ cmp eax, r15d
+ jb L_invalid_distance_too_far ; /* if (dist > wsize) */
+
+ add ecx, r15d ; /* nbytes = dist - nbytes */
+ cmp dword ptr [rsp+96], 0
+ jne L_wrap_around_window ; /* if (write != 0) */
+
+ mov rsi, [rsp+56] ; /* from = window */
+ sub eax, ecx ; /* eax -= nbytes */
+ add rsi, rax ; /* from += wsize - nbytes */
+
+ mov eax, r14d ; /* eax = len */
+ cmp r14d, ecx
+ jbe L_do_copy ; /* if (nbytes >= len) */
+
+ sub eax, ecx ; /* eax -= nbytes */
+ rep movsb
+ mov rsi, rdi
+ sub rsi, r15 ; /* from = &out[ -dist ] */
+ jmp L_do_copy
+
+ALIGN 4
+L_wrap_around_window:
+ mov eax, [rsp+96] ; /* eax = write */
+ cmp ecx, eax
+ jbe L_contiguous_in_window ; /* if (write >= nbytes) */
+
+ mov esi, [rsp+92] ; /* from = wsize */
+ add rsi, [rsp+56] ; /* from += window */
+ add rsi, rax ; /* from += write */
+ sub rsi, rcx ; /* from -= nbytes */
+ sub ecx, eax ; /* nbytes -= write */
+
+ mov eax, r14d ; /* eax = len */
+ cmp eax, ecx
+ jbe L_do_copy ; /* if (nbytes >= len) */
+
+ sub eax, ecx ; /* len -= nbytes */
+ rep movsb
+ mov rsi, [rsp+56] ; /* from = window */
+ mov ecx, [rsp+96] ; /* nbytes = write */
+ cmp eax, ecx
+ jbe L_do_copy ; /* if (nbytes >= len) */
+
+ sub eax, ecx ; /* len -= nbytes */
+ rep movsb
+ mov rsi, rdi
+ sub rsi, r15 ; /* from = out - dist */
+ jmp L_do_copy
+
+ALIGN 4
+L_contiguous_in_window:
+ mov rsi, [rsp+56] ; /* rsi = window */
+ add rsi, rax
+ sub rsi, rcx ; /* from += write - nbytes */
+
+ mov eax, r14d ; /* eax = len */
+ cmp eax, ecx
+ jbe L_do_copy ; /* if (nbytes >= len) */
+
+ sub eax, ecx ; /* len -= nbytes */
+ rep movsb
+ mov rsi, rdi
+ sub rsi, r15 ; /* from = out - dist */
+ jmp L_do_copy ; /* if (nbytes >= len) */
+
+ALIGN 4
+L_do_copy:
+ mov ecx, eax ; /* ecx = len */
+ rep movsb
+
+ mov rsi, r8 ; /* move in back to %esi, toss from */
+ jmp L_while_test
+
+L_test_for_end_of_block:
+ test al, 32
+ jz L_invalid_literal_length_code
+ mov dword ptr [rsp+116], 1
+ jmp L_break_loop_with_status
+
+L_invalid_literal_length_code:
+ mov dword ptr [rsp+116], 2
+ jmp L_break_loop_with_status
+
+L_invalid_distance_code:
+ mov dword ptr [rsp+116], 3
+ jmp L_break_loop_with_status
+
+L_invalid_distance_too_far:
+ mov dword ptr [rsp+116], 4
+ jmp L_break_loop_with_status
+
+L_break_loop:
+ mov dword ptr [rsp+116], 0
+
+L_break_loop_with_status:
+; /* put in, out, bits, and hold back into ar and pop esp */
+ mov [rsp+16], rsi ; /* in */
+ mov [rsp+32], rdi ; /* out */
+ mov [rsp+88], ebx ; /* bits */
+ mov [rsp+80], rdx ; /* hold */
+
+ mov rax, [rsp] ; /* restore rbp and rsp */
+ mov rbp, [rsp+8]
+ mov rsp, rax
+
+
+
+ mov rsi,[rsp-8]
+ mov rdi,[rsp-16]
+ mov r12,[rsp-24]
+ mov r13,[rsp-32]
+ mov r14,[rsp-40]
+ mov r15,[rsp-48]
+ mov rbx,[rsp-56]
+
+ ret 0
+; :
+; : "m" (ar)
+; : "memory", "%rax", "%rbx", "%rcx", "%rdx", "%rsi", "%rdi",
+; "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"
+; );
+
+inffas8664fnc ENDP
+;_TEXT ENDS
+END
diff --git a/protocols/Telegram/tgl/zlib/contrib/masmx64/readme.txt b/protocols/Telegram/tgl/zlib/contrib/masmx64/readme.txt
new file mode 100644
index 0000000000..2da6733412
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/masmx64/readme.txt
@@ -0,0 +1,31 @@
+Summary
+-------
+This directory contains ASM implementations of the functions
+longest_match() and inflate_fast(), for 64 bits x86 (both AMD64 and Intel EM64t),
+for use with Microsoft Macro Assembler (x64) for AMD64 and Microsoft C++ 64 bits.
+
+gvmat64.asm is written by Gilles Vollant (2005), by using Brian Raiter 686/32 bits
+ assembly optimized version from Jean-loup Gailly original longest_match function
+
+inffasx64.asm and inffas8664.c were written by Chris Anderson, by optimizing
+ original function from Mark Adler
+
+Use instructions
+----------------
+Assemble the .asm files using MASM and put the object files into the zlib source
+directory. You can also get object files here:
+
+ http://www.winimage.com/zLibDll/zlib124_masm_obj.zip
+
+define ASMV and ASMINF in your project. Include inffas8664.c in your source tree,
+and inffasx64.obj and gvmat64.obj as object to link.
+
+
+Build instructions
+------------------
+run bld_64.bat with Microsoft Macro Assembler (x64) for AMD64 (ml64.exe)
+
+ml64.exe is given with Visual Studio 2005, Windows 2003 server DDK
+
+You can get Windows 2003 server DDK with ml64 and cl for AMD64 from
+ http://www.microsoft.com/whdc/devtools/ddk/default.mspx for low price)
diff --git a/protocols/Telegram/tgl/zlib/contrib/masmx86/bld_ml32.bat b/protocols/Telegram/tgl/zlib/contrib/masmx86/bld_ml32.bat
new file mode 100644
index 0000000000..e1b86bf68a
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/masmx86/bld_ml32.bat
@@ -0,0 +1,2 @@
+ml /coff /Zi /c /Flmatch686.lst match686.asm
+ml /coff /Zi /c /Flinffas32.lst inffas32.asm
diff --git a/protocols/Telegram/tgl/zlib/contrib/masmx86/inffas32.asm b/protocols/Telegram/tgl/zlib/contrib/masmx86/inffas32.asm
new file mode 100644
index 0000000000..03d20f838b
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/masmx86/inffas32.asm
@@ -0,0 +1,1080 @@
+;/* inffas32.asm is a hand tuned assembler version of inffast.c -- fast decoding
+; *
+; * inffas32.asm is derivated from inffas86.c, with translation of assembly code
+; *
+; * Copyright (C) 1995-2003 Mark Adler
+; * For conditions of distribution and use, see copyright notice in zlib.h
+; *
+; * Copyright (C) 2003 Chris Anderson <christop@charm.net>
+; * Please use the copyright conditions above.
+; *
+; * Mar-13-2003 -- Most of this is derived from inffast.S which is derived from
+; * the gcc -S output of zlib-1.2.0/inffast.c. Zlib-1.2.0 is in beta release at
+; * the moment. I have successfully compiled and tested this code with gcc2.96,
+; * gcc3.2, icc5.0, msvc6.0. It is very close to the speed of inffast.S
+; * compiled with gcc -DNO_MMX, but inffast.S is still faster on the P3 with MMX
+; * enabled. I will attempt to merge the MMX code into this version. Newer
+; * versions of this and inffast.S can be found at
+; * http://www.eetbeetee.com/zlib/ and http://www.charm.net/~christop/zlib/
+; *
+; * 2005 : modification by Gilles Vollant
+; */
+; For Visual C++ 4.x and higher and ML 6.x and higher
+; ml.exe is in directory \MASM611C of Win95 DDK
+; ml.exe is also distributed in http://www.masm32.com/masmdl.htm
+; and in VC++2003 toolkit at http://msdn.microsoft.com/visualc/vctoolkit2003/
+;
+;
+; compile with command line option
+; ml /coff /Zi /c /Flinffas32.lst inffas32.asm
+
+; if you define NO_GZIP (see inflate.h), compile with
+; ml /coff /Zi /c /Flinffas32.lst /DNO_GUNZIP inffas32.asm
+
+
+; zlib122sup is 0 fort zlib 1.2.2.1 and lower
+; zlib122sup is 8 fort zlib 1.2.2.2 and more (with addition of dmax and head
+; in inflate_state in inflate.h)
+zlib1222sup equ 8
+
+
+IFDEF GUNZIP
+ INFLATE_MODE_TYPE equ 11
+ INFLATE_MODE_BAD equ 26
+ELSE
+ IFNDEF NO_GUNZIP
+ INFLATE_MODE_TYPE equ 11
+ INFLATE_MODE_BAD equ 26
+ ELSE
+ INFLATE_MODE_TYPE equ 3
+ INFLATE_MODE_BAD equ 17
+ ENDIF
+ENDIF
+
+
+; 75 "inffast.S"
+;FILE "inffast.S"
+
+;;;GLOBAL _inflate_fast
+
+;;;SECTION .text
+
+
+
+ .586p
+ .mmx
+
+ name inflate_fast_x86
+ .MODEL FLAT
+
+_DATA segment
+inflate_fast_use_mmx:
+ dd 1
+
+
+_TEXT segment
+
+
+
+ALIGN 4
+ db 'Fast decoding Code from Chris Anderson'
+ db 0
+
+ALIGN 4
+invalid_literal_length_code_msg:
+ db 'invalid literal/length code'
+ db 0
+
+ALIGN 4
+invalid_distance_code_msg:
+ db 'invalid distance code'
+ db 0
+
+ALIGN 4
+invalid_distance_too_far_msg:
+ db 'invalid distance too far back'
+ db 0
+
+
+ALIGN 4
+inflate_fast_mask:
+dd 0
+dd 1
+dd 3
+dd 7
+dd 15
+dd 31
+dd 63
+dd 127
+dd 255
+dd 511
+dd 1023
+dd 2047
+dd 4095
+dd 8191
+dd 16383
+dd 32767
+dd 65535
+dd 131071
+dd 262143
+dd 524287
+dd 1048575
+dd 2097151
+dd 4194303
+dd 8388607
+dd 16777215
+dd 33554431
+dd 67108863
+dd 134217727
+dd 268435455
+dd 536870911
+dd 1073741823
+dd 2147483647
+dd 4294967295
+
+
+mode_state equ 0 ;/* state->mode */
+wsize_state equ (32+zlib1222sup) ;/* state->wsize */
+write_state equ (36+4+zlib1222sup) ;/* state->write */
+window_state equ (40+4+zlib1222sup) ;/* state->window */
+hold_state equ (44+4+zlib1222sup) ;/* state->hold */
+bits_state equ (48+4+zlib1222sup) ;/* state->bits */
+lencode_state equ (64+4+zlib1222sup) ;/* state->lencode */
+distcode_state equ (68+4+zlib1222sup) ;/* state->distcode */
+lenbits_state equ (72+4+zlib1222sup) ;/* state->lenbits */
+distbits_state equ (76+4+zlib1222sup) ;/* state->distbits */
+
+
+;;SECTION .text
+; 205 "inffast.S"
+;GLOBAL inflate_fast_use_mmx
+
+;SECTION .data
+
+
+; GLOBAL inflate_fast_use_mmx:object
+;.size inflate_fast_use_mmx, 4
+; 226 "inffast.S"
+;SECTION .text
+
+ALIGN 4
+_inflate_fast proc near
+.FPO (16, 4, 0, 0, 1, 0)
+ push edi
+ push esi
+ push ebp
+ push ebx
+ pushfd
+ sub esp,64
+ cld
+
+
+
+
+ mov esi, [esp+88]
+ mov edi, [esi+28]
+
+
+
+
+
+
+
+ mov edx, [esi+4]
+ mov eax, [esi+0]
+
+ add edx,eax
+ sub edx,11
+
+ mov [esp+44],eax
+ mov [esp+20],edx
+
+ mov ebp, [esp+92]
+ mov ecx, [esi+16]
+ mov ebx, [esi+12]
+
+ sub ebp,ecx
+ neg ebp
+ add ebp,ebx
+
+ sub ecx,257
+ add ecx,ebx
+
+ mov [esp+60],ebx
+ mov [esp+40],ebp
+ mov [esp+16],ecx
+; 285 "inffast.S"
+ mov eax, [edi+lencode_state]
+ mov ecx, [edi+distcode_state]
+
+ mov [esp+8],eax
+ mov [esp+12],ecx
+
+ mov eax,1
+ mov ecx, [edi+lenbits_state]
+ shl eax,cl
+ dec eax
+ mov [esp+0],eax
+
+ mov eax,1
+ mov ecx, [edi+distbits_state]
+ shl eax,cl
+ dec eax
+ mov [esp+4],eax
+
+ mov eax, [edi+wsize_state]
+ mov ecx, [edi+write_state]
+ mov edx, [edi+window_state]
+
+ mov [esp+52],eax
+ mov [esp+48],ecx
+ mov [esp+56],edx
+
+ mov ebp, [edi+hold_state]
+ mov ebx, [edi+bits_state]
+; 321 "inffast.S"
+ mov esi, [esp+44]
+ mov ecx, [esp+20]
+ cmp ecx,esi
+ ja L_align_long
+
+ add ecx,11
+ sub ecx,esi
+ mov eax,12
+ sub eax,ecx
+ lea edi, [esp+28]
+ rep movsb
+ mov ecx,eax
+ xor eax,eax
+ rep stosb
+ lea esi, [esp+28]
+ mov [esp+20],esi
+ jmp L_is_aligned
+
+
+L_align_long:
+ test esi,3
+ jz L_is_aligned
+ xor eax,eax
+ mov al, [esi]
+ inc esi
+ mov ecx,ebx
+ add ebx,8
+ shl eax,cl
+ or ebp,eax
+ jmp L_align_long
+
+L_is_aligned:
+ mov edi, [esp+60]
+; 366 "inffast.S"
+L_check_mmx:
+ cmp dword ptr [inflate_fast_use_mmx],2
+ je L_init_mmx
+ ja L_do_loop
+
+ push eax
+ push ebx
+ push ecx
+ push edx
+ pushfd
+ mov eax, [esp]
+ xor dword ptr [esp],0200000h
+
+
+
+
+ popfd
+ pushfd
+ pop edx
+ xor edx,eax
+ jz L_dont_use_mmx
+ xor eax,eax
+ cpuid
+ cmp ebx,0756e6547h
+ jne L_dont_use_mmx
+ cmp ecx,06c65746eh
+ jne L_dont_use_mmx
+ cmp edx,049656e69h
+ jne L_dont_use_mmx
+ mov eax,1
+ cpuid
+ shr eax,8
+ and eax,15
+ cmp eax,6
+ jne L_dont_use_mmx
+ test edx,0800000h
+ jnz L_use_mmx
+ jmp L_dont_use_mmx
+L_use_mmx:
+ mov dword ptr [inflate_fast_use_mmx],2
+ jmp L_check_mmx_pop
+L_dont_use_mmx:
+ mov dword ptr [inflate_fast_use_mmx],3
+L_check_mmx_pop:
+ pop edx
+ pop ecx
+ pop ebx
+ pop eax
+ jmp L_check_mmx
+; 426 "inffast.S"
+ALIGN 4
+L_do_loop:
+; 437 "inffast.S"
+ cmp bl,15
+ ja L_get_length_code
+
+ xor eax,eax
+ lodsw
+ mov cl,bl
+ add bl,16
+ shl eax,cl
+ or ebp,eax
+
+L_get_length_code:
+ mov edx, [esp+0]
+ mov ecx, [esp+8]
+ and edx,ebp
+ mov eax, [ecx+edx*4]
+
+L_dolen:
+
+
+
+
+
+
+ mov cl,ah
+ sub bl,ah
+ shr ebp,cl
+
+
+
+
+
+
+ test al,al
+ jnz L_test_for_length_base
+
+ shr eax,16
+ stosb
+
+L_while_test:
+
+
+ cmp [esp+16],edi
+ jbe L_break_loop
+
+ cmp [esp+20],esi
+ ja L_do_loop
+ jmp L_break_loop
+
+L_test_for_length_base:
+; 502 "inffast.S"
+ mov edx,eax
+ shr edx,16
+ mov cl,al
+
+ test al,16
+ jz L_test_for_second_level_length
+ and cl,15
+ jz L_save_len
+ cmp bl,cl
+ jae L_add_bits_to_len
+
+ mov ch,cl
+ xor eax,eax
+ lodsw
+ mov cl,bl
+ add bl,16
+ shl eax,cl
+ or ebp,eax
+ mov cl,ch
+
+L_add_bits_to_len:
+ mov eax,1
+ shl eax,cl
+ dec eax
+ sub bl,cl
+ and eax,ebp
+ shr ebp,cl
+ add edx,eax
+
+L_save_len:
+ mov [esp+24],edx
+
+
+L_decode_distance:
+; 549 "inffast.S"
+ cmp bl,15
+ ja L_get_distance_code
+
+ xor eax,eax
+ lodsw
+ mov cl,bl
+ add bl,16
+ shl eax,cl
+ or ebp,eax
+
+L_get_distance_code:
+ mov edx, [esp+4]
+ mov ecx, [esp+12]
+ and edx,ebp
+ mov eax, [ecx+edx*4]
+
+
+L_dodist:
+ mov edx,eax
+ shr edx,16
+ mov cl,ah
+ sub bl,ah
+ shr ebp,cl
+; 584 "inffast.S"
+ mov cl,al
+
+ test al,16
+ jz L_test_for_second_level_dist
+ and cl,15
+ jz L_check_dist_one
+ cmp bl,cl
+ jae L_add_bits_to_dist
+
+ mov ch,cl
+ xor eax,eax
+ lodsw
+ mov cl,bl
+ add bl,16
+ shl eax,cl
+ or ebp,eax
+ mov cl,ch
+
+L_add_bits_to_dist:
+ mov eax,1
+ shl eax,cl
+ dec eax
+ sub bl,cl
+ and eax,ebp
+ shr ebp,cl
+ add edx,eax
+ jmp L_check_window
+
+L_check_window:
+; 625 "inffast.S"
+ mov [esp+44],esi
+ mov eax,edi
+ sub eax, [esp+40]
+
+ cmp eax,edx
+ jb L_clip_window
+
+ mov ecx, [esp+24]
+ mov esi,edi
+ sub esi,edx
+
+ sub ecx,3
+ mov al, [esi]
+ mov [edi],al
+ mov al, [esi+1]
+ mov dl, [esi+2]
+ add esi,3
+ mov [edi+1],al
+ mov [edi+2],dl
+ add edi,3
+ rep movsb
+
+ mov esi, [esp+44]
+ jmp L_while_test
+
+ALIGN 4
+L_check_dist_one:
+ cmp edx,1
+ jne L_check_window
+ cmp [esp+40],edi
+ je L_check_window
+
+ dec edi
+ mov ecx, [esp+24]
+ mov al, [edi]
+ sub ecx,3
+
+ mov [edi+1],al
+ mov [edi+2],al
+ mov [edi+3],al
+ add edi,4
+ rep stosb
+
+ jmp L_while_test
+
+ALIGN 4
+L_test_for_second_level_length:
+
+
+
+
+ test al,64
+ jnz L_test_for_end_of_block
+
+ mov eax,1
+ shl eax,cl
+ dec eax
+ and eax,ebp
+ add eax,edx
+ mov edx, [esp+8]
+ mov eax, [edx+eax*4]
+ jmp L_dolen
+
+ALIGN 4
+L_test_for_second_level_dist:
+
+
+
+
+ test al,64
+ jnz L_invalid_distance_code
+
+ mov eax,1
+ shl eax,cl
+ dec eax
+ and eax,ebp
+ add eax,edx
+ mov edx, [esp+12]
+ mov eax, [edx+eax*4]
+ jmp L_dodist
+
+ALIGN 4
+L_clip_window:
+; 721 "inffast.S"
+ mov ecx,eax
+ mov eax, [esp+52]
+ neg ecx
+ mov esi, [esp+56]
+
+ cmp eax,edx
+ jb L_invalid_distance_too_far
+
+ add ecx,edx
+ cmp dword ptr [esp+48],0
+ jne L_wrap_around_window
+
+ sub eax,ecx
+ add esi,eax
+; 749 "inffast.S"
+ mov eax, [esp+24]
+ cmp eax,ecx
+ jbe L_do_copy1
+
+ sub eax,ecx
+ rep movsb
+ mov esi,edi
+ sub esi,edx
+ jmp L_do_copy1
+
+ cmp eax,ecx
+ jbe L_do_copy1
+
+ sub eax,ecx
+ rep movsb
+ mov esi,edi
+ sub esi,edx
+ jmp L_do_copy1
+
+L_wrap_around_window:
+; 793 "inffast.S"
+ mov eax, [esp+48]
+ cmp ecx,eax
+ jbe L_contiguous_in_window
+
+ add esi, [esp+52]
+ add esi,eax
+ sub esi,ecx
+ sub ecx,eax
+
+
+ mov eax, [esp+24]
+ cmp eax,ecx
+ jbe L_do_copy1
+
+ sub eax,ecx
+ rep movsb
+ mov esi, [esp+56]
+ mov ecx, [esp+48]
+ cmp eax,ecx
+ jbe L_do_copy1
+
+ sub eax,ecx
+ rep movsb
+ mov esi,edi
+ sub esi,edx
+ jmp L_do_copy1
+
+L_contiguous_in_window:
+; 836 "inffast.S"
+ add esi,eax
+ sub esi,ecx
+
+
+ mov eax, [esp+24]
+ cmp eax,ecx
+ jbe L_do_copy1
+
+ sub eax,ecx
+ rep movsb
+ mov esi,edi
+ sub esi,edx
+
+L_do_copy1:
+; 862 "inffast.S"
+ mov ecx,eax
+ rep movsb
+
+ mov esi, [esp+44]
+ jmp L_while_test
+; 878 "inffast.S"
+ALIGN 4
+L_init_mmx:
+ emms
+
+
+
+
+
+ movd mm0,ebp
+ mov ebp,ebx
+; 896 "inffast.S"
+ movd mm4,dword ptr [esp+0]
+ movq mm3,mm4
+ movd mm5,dword ptr [esp+4]
+ movq mm2,mm5
+ pxor mm1,mm1
+ mov ebx, [esp+8]
+ jmp L_do_loop_mmx
+
+ALIGN 4
+L_do_loop_mmx:
+ psrlq mm0,mm1
+
+ cmp ebp,32
+ ja L_get_length_code_mmx
+
+ movd mm6,ebp
+ movd mm7,dword ptr [esi]
+ add esi,4
+ psllq mm7,mm6
+ add ebp,32
+ por mm0,mm7
+
+L_get_length_code_mmx:
+ pand mm4,mm0
+ movd eax,mm4
+ movq mm4,mm3
+ mov eax, [ebx+eax*4]
+
+L_dolen_mmx:
+ movzx ecx,ah
+ movd mm1,ecx
+ sub ebp,ecx
+
+ test al,al
+ jnz L_test_for_length_base_mmx
+
+ shr eax,16
+ stosb
+
+L_while_test_mmx:
+
+
+ cmp [esp+16],edi
+ jbe L_break_loop
+
+ cmp [esp+20],esi
+ ja L_do_loop_mmx
+ jmp L_break_loop
+
+L_test_for_length_base_mmx:
+
+ mov edx,eax
+ shr edx,16
+
+ test al,16
+ jz L_test_for_second_level_length_mmx
+ and eax,15
+ jz L_decode_distance_mmx
+
+ psrlq mm0,mm1
+ movd mm1,eax
+ movd ecx,mm0
+ sub ebp,eax
+ and ecx, [inflate_fast_mask+eax*4]
+ add edx,ecx
+
+L_decode_distance_mmx:
+ psrlq mm0,mm1
+
+ cmp ebp,32
+ ja L_get_dist_code_mmx
+
+ movd mm6,ebp
+ movd mm7,dword ptr [esi]
+ add esi,4
+ psllq mm7,mm6
+ add ebp,32
+ por mm0,mm7
+
+L_get_dist_code_mmx:
+ mov ebx, [esp+12]
+ pand mm5,mm0
+ movd eax,mm5
+ movq mm5,mm2
+ mov eax, [ebx+eax*4]
+
+L_dodist_mmx:
+
+ movzx ecx,ah
+ mov ebx,eax
+ shr ebx,16
+ sub ebp,ecx
+ movd mm1,ecx
+
+ test al,16
+ jz L_test_for_second_level_dist_mmx
+ and eax,15
+ jz L_check_dist_one_mmx
+
+L_add_bits_to_dist_mmx:
+ psrlq mm0,mm1
+ movd mm1,eax
+ movd ecx,mm0
+ sub ebp,eax
+ and ecx, [inflate_fast_mask+eax*4]
+ add ebx,ecx
+
+L_check_window_mmx:
+ mov [esp+44],esi
+ mov eax,edi
+ sub eax, [esp+40]
+
+ cmp eax,ebx
+ jb L_clip_window_mmx
+
+ mov ecx,edx
+ mov esi,edi
+ sub esi,ebx
+
+ sub ecx,3
+ mov al, [esi]
+ mov [edi],al
+ mov al, [esi+1]
+ mov dl, [esi+2]
+ add esi,3
+ mov [edi+1],al
+ mov [edi+2],dl
+ add edi,3
+ rep movsb
+
+ mov esi, [esp+44]
+ mov ebx, [esp+8]
+ jmp L_while_test_mmx
+
+ALIGN 4
+L_check_dist_one_mmx:
+ cmp ebx,1
+ jne L_check_window_mmx
+ cmp [esp+40],edi
+ je L_check_window_mmx
+
+ dec edi
+ mov ecx,edx
+ mov al, [edi]
+ sub ecx,3
+
+ mov [edi+1],al
+ mov [edi+2],al
+ mov [edi+3],al
+ add edi,4
+ rep stosb
+
+ mov ebx, [esp+8]
+ jmp L_while_test_mmx
+
+ALIGN 4
+L_test_for_second_level_length_mmx:
+ test al,64
+ jnz L_test_for_end_of_block
+
+ and eax,15
+ psrlq mm0,mm1
+ movd ecx,mm0
+ and ecx, [inflate_fast_mask+eax*4]
+ add ecx,edx
+ mov eax, [ebx+ecx*4]
+ jmp L_dolen_mmx
+
+ALIGN 4
+L_test_for_second_level_dist_mmx:
+ test al,64
+ jnz L_invalid_distance_code
+
+ and eax,15
+ psrlq mm0,mm1
+ movd ecx,mm0
+ and ecx, [inflate_fast_mask+eax*4]
+ mov eax, [esp+12]
+ add ecx,ebx
+ mov eax, [eax+ecx*4]
+ jmp L_dodist_mmx
+
+ALIGN 4
+L_clip_window_mmx:
+
+ mov ecx,eax
+ mov eax, [esp+52]
+ neg ecx
+ mov esi, [esp+56]
+
+ cmp eax,ebx
+ jb L_invalid_distance_too_far
+
+ add ecx,ebx
+ cmp dword ptr [esp+48],0
+ jne L_wrap_around_window_mmx
+
+ sub eax,ecx
+ add esi,eax
+
+ cmp edx,ecx
+ jbe L_do_copy1_mmx
+
+ sub edx,ecx
+ rep movsb
+ mov esi,edi
+ sub esi,ebx
+ jmp L_do_copy1_mmx
+
+ cmp edx,ecx
+ jbe L_do_copy1_mmx
+
+ sub edx,ecx
+ rep movsb
+ mov esi,edi
+ sub esi,ebx
+ jmp L_do_copy1_mmx
+
+L_wrap_around_window_mmx:
+
+ mov eax, [esp+48]
+ cmp ecx,eax
+ jbe L_contiguous_in_window_mmx
+
+ add esi, [esp+52]
+ add esi,eax
+ sub esi,ecx
+ sub ecx,eax
+
+
+ cmp edx,ecx
+ jbe L_do_copy1_mmx
+
+ sub edx,ecx
+ rep movsb
+ mov esi, [esp+56]
+ mov ecx, [esp+48]
+ cmp edx,ecx
+ jbe L_do_copy1_mmx
+
+ sub edx,ecx
+ rep movsb
+ mov esi,edi
+ sub esi,ebx
+ jmp L_do_copy1_mmx
+
+L_contiguous_in_window_mmx:
+
+ add esi,eax
+ sub esi,ecx
+
+
+ cmp edx,ecx
+ jbe L_do_copy1_mmx
+
+ sub edx,ecx
+ rep movsb
+ mov esi,edi
+ sub esi,ebx
+
+L_do_copy1_mmx:
+
+
+ mov ecx,edx
+ rep movsb
+
+ mov esi, [esp+44]
+ mov ebx, [esp+8]
+ jmp L_while_test_mmx
+; 1174 "inffast.S"
+L_invalid_distance_code:
+
+
+
+
+
+ mov ecx, invalid_distance_code_msg
+ mov edx,INFLATE_MODE_BAD
+ jmp L_update_stream_state
+
+L_test_for_end_of_block:
+
+
+
+
+
+ test al,32
+ jz L_invalid_literal_length_code
+
+ mov ecx,0
+ mov edx,INFLATE_MODE_TYPE
+ jmp L_update_stream_state
+
+L_invalid_literal_length_code:
+
+
+
+
+
+ mov ecx, invalid_literal_length_code_msg
+ mov edx,INFLATE_MODE_BAD
+ jmp L_update_stream_state
+
+L_invalid_distance_too_far:
+
+
+
+ mov esi, [esp+44]
+ mov ecx, invalid_distance_too_far_msg
+ mov edx,INFLATE_MODE_BAD
+ jmp L_update_stream_state
+
+L_update_stream_state:
+
+ mov eax, [esp+88]
+ test ecx,ecx
+ jz L_skip_msg
+ mov [eax+24],ecx
+L_skip_msg:
+ mov eax, [eax+28]
+ mov [eax+mode_state],edx
+ jmp L_break_loop
+
+ALIGN 4
+L_break_loop:
+; 1243 "inffast.S"
+ cmp dword ptr [inflate_fast_use_mmx],2
+ jne L_update_next_in
+
+
+
+ mov ebx,ebp
+
+L_update_next_in:
+; 1266 "inffast.S"
+ mov eax, [esp+88]
+ mov ecx,ebx
+ mov edx, [eax+28]
+ shr ecx,3
+ sub esi,ecx
+ shl ecx,3
+ sub ebx,ecx
+ mov [eax+12],edi
+ mov [edx+bits_state],ebx
+ mov ecx,ebx
+
+ lea ebx, [esp+28]
+ cmp [esp+20],ebx
+ jne L_buf_not_used
+
+ sub esi,ebx
+ mov ebx, [eax+0]
+ mov [esp+20],ebx
+ add esi,ebx
+ mov ebx, [eax+4]
+ sub ebx,11
+ add [esp+20],ebx
+
+L_buf_not_used:
+ mov [eax+0],esi
+
+ mov ebx,1
+ shl ebx,cl
+ dec ebx
+
+
+
+
+
+ cmp dword ptr [inflate_fast_use_mmx],2
+ jne L_update_hold
+
+
+
+ psrlq mm0,mm1
+ movd ebp,mm0
+
+ emms
+
+L_update_hold:
+
+
+
+ and ebp,ebx
+ mov [edx+hold_state],ebp
+
+
+
+
+ mov ebx, [esp+20]
+ cmp ebx,esi
+ jbe L_last_is_smaller
+
+ sub ebx,esi
+ add ebx,11
+ mov [eax+4],ebx
+ jmp L_fixup_out
+L_last_is_smaller:
+ sub esi,ebx
+ neg esi
+ add esi,11
+ mov [eax+4],esi
+
+
+
+
+L_fixup_out:
+
+ mov ebx, [esp+16]
+ cmp ebx,edi
+ jbe L_end_is_smaller
+
+ sub ebx,edi
+ add ebx,257
+ mov [eax+16],ebx
+ jmp L_done
+L_end_is_smaller:
+ sub edi,ebx
+ neg edi
+ add edi,257
+ mov [eax+16],edi
+
+
+
+
+
+L_done:
+ add esp,64
+ popfd
+ pop ebx
+ pop ebp
+ pop esi
+ pop edi
+ ret
+_inflate_fast endp
+
+_TEXT ends
+end
diff --git a/protocols/Telegram/tgl/zlib/contrib/masmx86/match686.asm b/protocols/Telegram/tgl/zlib/contrib/masmx86/match686.asm
new file mode 100644
index 0000000000..3b09212f8a
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/masmx86/match686.asm
@@ -0,0 +1,479 @@
+; match686.asm -- Asm portion of the optimized longest_match for 32 bits x86
+; Copyright (C) 1995-1996 Jean-loup Gailly, Brian Raiter and Gilles Vollant.
+; File written by Gilles Vollant, by converting match686.S from Brian Raiter
+; for MASM. This is as assembly version of longest_match
+; from Jean-loup Gailly in deflate.c
+;
+; http://www.zlib.net
+; http://www.winimage.com/zLibDll
+; http://www.muppetlabs.com/~breadbox/software/assembly.html
+;
+; For Visual C++ 4.x and higher and ML 6.x and higher
+; ml.exe is distributed in
+; http://www.microsoft.com/downloads/details.aspx?FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64
+;
+; this file contain two implementation of longest_match
+;
+; this longest_match was written by Brian raiter (1998), optimized for Pentium Pro
+; (and the faster known version of match_init on modern Core 2 Duo and AMD Phenom)
+;
+; for using an assembly version of longest_match, you need define ASMV in project
+;
+; compile the asm file running
+; ml /coff /Zi /c /Flmatch686.lst match686.asm
+; and do not include match686.obj in your project
+;
+; note: contrib of zLib 1.2.3 and earlier contained both a deprecated version for
+; Pentium (prior Pentium Pro) and this version for Pentium Pro and modern processor
+; with autoselect (with cpu detection code)
+; if you want support the old pentium optimization, you can still use these version
+;
+; this file is not optimized for old pentium, but it compatible with all x86 32 bits
+; processor (starting 80386)
+;
+;
+; see below : zlib1222add must be adjuster if you use a zlib version < 1.2.2.2
+
+;uInt longest_match(s, cur_match)
+; deflate_state *s;
+; IPos cur_match; /* current match */
+
+ NbStack equ 76
+ cur_match equ dword ptr[esp+NbStack-0]
+ str_s equ dword ptr[esp+NbStack-4]
+; 5 dword on top (ret,ebp,esi,edi,ebx)
+ adrret equ dword ptr[esp+NbStack-8]
+ pushebp equ dword ptr[esp+NbStack-12]
+ pushedi equ dword ptr[esp+NbStack-16]
+ pushesi equ dword ptr[esp+NbStack-20]
+ pushebx equ dword ptr[esp+NbStack-24]
+
+ chain_length equ dword ptr [esp+NbStack-28]
+ limit equ dword ptr [esp+NbStack-32]
+ best_len equ dword ptr [esp+NbStack-36]
+ window equ dword ptr [esp+NbStack-40]
+ prev equ dword ptr [esp+NbStack-44]
+ scan_start equ word ptr [esp+NbStack-48]
+ wmask equ dword ptr [esp+NbStack-52]
+ match_start_ptr equ dword ptr [esp+NbStack-56]
+ nice_match equ dword ptr [esp+NbStack-60]
+ scan equ dword ptr [esp+NbStack-64]
+
+ windowlen equ dword ptr [esp+NbStack-68]
+ match_start equ dword ptr [esp+NbStack-72]
+ strend equ dword ptr [esp+NbStack-76]
+ NbStackAdd equ (NbStack-24)
+
+ .386p
+
+ name gvmatch
+ .MODEL FLAT
+
+
+
+; all the +zlib1222add offsets are due to the addition of fields
+; in zlib in the deflate_state structure since the asm code was first written
+; (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)").
+; (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0").
+; if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8").
+
+ zlib1222add equ 8
+
+; Note : these value are good with a 8 bytes boundary pack structure
+ dep_chain_length equ 74h+zlib1222add
+ dep_window equ 30h+zlib1222add
+ dep_strstart equ 64h+zlib1222add
+ dep_prev_length equ 70h+zlib1222add
+ dep_nice_match equ 88h+zlib1222add
+ dep_w_size equ 24h+zlib1222add
+ dep_prev equ 38h+zlib1222add
+ dep_w_mask equ 2ch+zlib1222add
+ dep_good_match equ 84h+zlib1222add
+ dep_match_start equ 68h+zlib1222add
+ dep_lookahead equ 6ch+zlib1222add
+
+
+_TEXT segment
+
+IFDEF NOUNDERLINE
+ public longest_match
+ public match_init
+ELSE
+ public _longest_match
+ public _match_init
+ENDIF
+
+ MAX_MATCH equ 258
+ MIN_MATCH equ 3
+ MIN_LOOKAHEAD equ (MAX_MATCH+MIN_MATCH+1)
+
+
+
+MAX_MATCH equ 258
+MIN_MATCH equ 3
+MIN_LOOKAHEAD equ (MAX_MATCH + MIN_MATCH + 1)
+MAX_MATCH_8_ equ ((MAX_MATCH + 7) AND 0FFF0h)
+
+
+;;; stack frame offsets
+
+chainlenwmask equ esp + 0 ; high word: current chain len
+ ; low word: s->wmask
+window equ esp + 4 ; local copy of s->window
+windowbestlen equ esp + 8 ; s->window + bestlen
+scanstart equ esp + 16 ; first two bytes of string
+scanend equ esp + 12 ; last two bytes of string
+scanalign equ esp + 20 ; dword-misalignment of string
+nicematch equ esp + 24 ; a good enough match size
+bestlen equ esp + 28 ; size of best match so far
+scan equ esp + 32 ; ptr to string wanting match
+
+LocalVarsSize equ 36
+; saved ebx byte esp + 36
+; saved edi byte esp + 40
+; saved esi byte esp + 44
+; saved ebp byte esp + 48
+; return address byte esp + 52
+deflatestate equ esp + 56 ; the function arguments
+curmatch equ esp + 60
+
+;;; Offsets for fields in the deflate_state structure. These numbers
+;;; are calculated from the definition of deflate_state, with the
+;;; assumption that the compiler will dword-align the fields. (Thus,
+;;; changing the definition of deflate_state could easily cause this
+;;; program to crash horribly, without so much as a warning at
+;;; compile time. Sigh.)
+
+dsWSize equ 36+zlib1222add
+dsWMask equ 44+zlib1222add
+dsWindow equ 48+zlib1222add
+dsPrev equ 56+zlib1222add
+dsMatchLen equ 88+zlib1222add
+dsPrevMatch equ 92+zlib1222add
+dsStrStart equ 100+zlib1222add
+dsMatchStart equ 104+zlib1222add
+dsLookahead equ 108+zlib1222add
+dsPrevLen equ 112+zlib1222add
+dsMaxChainLen equ 116+zlib1222add
+dsGoodMatch equ 132+zlib1222add
+dsNiceMatch equ 136+zlib1222add
+
+
+;;; match686.asm -- Pentium-Pro-optimized version of longest_match()
+;;; Written for zlib 1.1.2
+;;; Copyright (C) 1998 Brian Raiter <breadbox@muppetlabs.com>
+;;; You can look at http://www.muppetlabs.com/~breadbox/software/assembly.html
+;;;
+;;
+;; This software is provided 'as-is', without any express or implied
+;; warranty. In no event will the authors be held liable for any damages
+;; arising from the use of this software.
+;;
+;; Permission is granted to anyone to use this software for any purpose,
+;; including commercial applications, and to alter it and redistribute it
+;; freely, subject to the following restrictions:
+;;
+;; 1. The origin of this software must not be misrepresented; you must not
+;; claim that you wrote the original software. If you use this software
+;; in a product, an acknowledgment in the product documentation would be
+;; appreciated but is not required.
+;; 2. Altered source versions must be plainly marked as such, and must not be
+;; misrepresented as being the original software
+;; 3. This notice may not be removed or altered from any source distribution.
+;;
+
+;GLOBAL _longest_match, _match_init
+
+
+;SECTION .text
+
+;;; uInt longest_match(deflate_state *deflatestate, IPos curmatch)
+
+;_longest_match:
+ IFDEF NOUNDERLINE
+ longest_match proc near
+ ELSE
+ _longest_match proc near
+ ENDIF
+.FPO (9, 4, 0, 0, 1, 0)
+
+;;; Save registers that the compiler may be using, and adjust esp to
+;;; make room for our stack frame.
+
+ push ebp
+ push edi
+ push esi
+ push ebx
+ sub esp, LocalVarsSize
+
+;;; Retrieve the function arguments. ecx will hold cur_match
+;;; throughout the entire function. edx will hold the pointer to the
+;;; deflate_state structure during the function's setup (before
+;;; entering the main loop.
+
+ mov edx, [deflatestate]
+ mov ecx, [curmatch]
+
+;;; uInt wmask = s->w_mask;
+;;; unsigned chain_length = s->max_chain_length;
+;;; if (s->prev_length >= s->good_match) {
+;;; chain_length >>= 2;
+;;; }
+
+ mov eax, [edx + dsPrevLen]
+ mov ebx, [edx + dsGoodMatch]
+ cmp eax, ebx
+ mov eax, [edx + dsWMask]
+ mov ebx, [edx + dsMaxChainLen]
+ jl LastMatchGood
+ shr ebx, 2
+LastMatchGood:
+
+;;; chainlen is decremented once beforehand so that the function can
+;;; use the sign flag instead of the zero flag for the exit test.
+;;; It is then shifted into the high word, to make room for the wmask
+;;; value, which it will always accompany.
+
+ dec ebx
+ shl ebx, 16
+ or ebx, eax
+ mov [chainlenwmask], ebx
+
+;;; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
+
+ mov eax, [edx + dsNiceMatch]
+ mov ebx, [edx + dsLookahead]
+ cmp ebx, eax
+ jl LookaheadLess
+ mov ebx, eax
+LookaheadLess: mov [nicematch], ebx
+
+;;; register Bytef *scan = s->window + s->strstart;
+
+ mov esi, [edx + dsWindow]
+ mov [window], esi
+ mov ebp, [edx + dsStrStart]
+ lea edi, [esi + ebp]
+ mov [scan], edi
+
+;;; Determine how many bytes the scan ptr is off from being
+;;; dword-aligned.
+
+ mov eax, edi
+ neg eax
+ and eax, 3
+ mov [scanalign], eax
+
+;;; IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
+;;; s->strstart - (IPos)MAX_DIST(s) : NIL;
+
+ mov eax, [edx + dsWSize]
+ sub eax, MIN_LOOKAHEAD
+ sub ebp, eax
+ jg LimitPositive
+ xor ebp, ebp
+LimitPositive:
+
+;;; int best_len = s->prev_length;
+
+ mov eax, [edx + dsPrevLen]
+ mov [bestlen], eax
+
+;;; Store the sum of s->window + best_len in esi locally, and in esi.
+
+ add esi, eax
+ mov [windowbestlen], esi
+
+;;; register ush scan_start = *(ushf*)scan;
+;;; register ush scan_end = *(ushf*)(scan+best_len-1);
+;;; Posf *prev = s->prev;
+
+ movzx ebx, word ptr [edi]
+ mov [scanstart], ebx
+ movzx ebx, word ptr [edi + eax - 1]
+ mov [scanend], ebx
+ mov edi, [edx + dsPrev]
+
+;;; Jump into the main loop.
+
+ mov edx, [chainlenwmask]
+ jmp short LoopEntry
+
+align 4
+
+;;; do {
+;;; match = s->window + cur_match;
+;;; if (*(ushf*)(match+best_len-1) != scan_end ||
+;;; *(ushf*)match != scan_start) continue;
+;;; [...]
+;;; } while ((cur_match = prev[cur_match & wmask]) > limit
+;;; && --chain_length != 0);
+;;;
+;;; Here is the inner loop of the function. The function will spend the
+;;; majority of its time in this loop, and majority of that time will
+;;; be spent in the first ten instructions.
+;;;
+;;; Within this loop:
+;;; ebx = scanend
+;;; ecx = curmatch
+;;; edx = chainlenwmask - i.e., ((chainlen << 16) | wmask)
+;;; esi = windowbestlen - i.e., (window + bestlen)
+;;; edi = prev
+;;; ebp = limit
+
+LookupLoop:
+ and ecx, edx
+ movzx ecx, word ptr [edi + ecx*2]
+ cmp ecx, ebp
+ jbe LeaveNow
+ sub edx, 00010000h
+ js LeaveNow
+LoopEntry: movzx eax, word ptr [esi + ecx - 1]
+ cmp eax, ebx
+ jnz LookupLoop
+ mov eax, [window]
+ movzx eax, word ptr [eax + ecx]
+ cmp eax, [scanstart]
+ jnz LookupLoop
+
+;;; Store the current value of chainlen.
+
+ mov [chainlenwmask], edx
+
+;;; Point edi to the string under scrutiny, and esi to the string we
+;;; are hoping to match it up with. In actuality, esi and edi are
+;;; both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and edx is
+;;; initialized to -(MAX_MATCH_8 - scanalign).
+
+ mov esi, [window]
+ mov edi, [scan]
+ add esi, ecx
+ mov eax, [scanalign]
+ mov edx, 0fffffef8h; -(MAX_MATCH_8)
+ lea edi, [edi + eax + 0108h] ;MAX_MATCH_8]
+ lea esi, [esi + eax + 0108h] ;MAX_MATCH_8]
+
+;;; Test the strings for equality, 8 bytes at a time. At the end,
+;;; adjust edx so that it is offset to the exact byte that mismatched.
+;;;
+;;; We already know at this point that the first three bytes of the
+;;; strings match each other, and they can be safely passed over before
+;;; starting the compare loop. So what this code does is skip over 0-3
+;;; bytes, as much as necessary in order to dword-align the edi
+;;; pointer. (esi will still be misaligned three times out of four.)
+;;;
+;;; It should be confessed that this loop usually does not represent
+;;; much of the total running time. Replacing it with a more
+;;; straightforward "rep cmpsb" would not drastically degrade
+;;; performance.
+
+LoopCmps:
+ mov eax, [esi + edx]
+ xor eax, [edi + edx]
+ jnz LeaveLoopCmps
+ mov eax, [esi + edx + 4]
+ xor eax, [edi + edx + 4]
+ jnz LeaveLoopCmps4
+ add edx, 8
+ jnz LoopCmps
+ jmp short LenMaximum
+LeaveLoopCmps4: add edx, 4
+LeaveLoopCmps: test eax, 0000FFFFh
+ jnz LenLower
+ add edx, 2
+ shr eax, 16
+LenLower: sub al, 1
+ adc edx, 0
+
+;;; Calculate the length of the match. If it is longer than MAX_MATCH,
+;;; then automatically accept it as the best possible match and leave.
+
+ lea eax, [edi + edx]
+ mov edi, [scan]
+ sub eax, edi
+ cmp eax, MAX_MATCH
+ jge LenMaximum
+
+;;; If the length of the match is not longer than the best match we
+;;; have so far, then forget it and return to the lookup loop.
+
+ mov edx, [deflatestate]
+ mov ebx, [bestlen]
+ cmp eax, ebx
+ jg LongerMatch
+ mov esi, [windowbestlen]
+ mov edi, [edx + dsPrev]
+ mov ebx, [scanend]
+ mov edx, [chainlenwmask]
+ jmp LookupLoop
+
+;;; s->match_start = cur_match;
+;;; best_len = len;
+;;; if (len >= nice_match) break;
+;;; scan_end = *(ushf*)(scan+best_len-1);
+
+LongerMatch: mov ebx, [nicematch]
+ mov [bestlen], eax
+ mov [edx + dsMatchStart], ecx
+ cmp eax, ebx
+ jge LeaveNow
+ mov esi, [window]
+ add esi, eax
+ mov [windowbestlen], esi
+ movzx ebx, word ptr [edi + eax - 1]
+ mov edi, [edx + dsPrev]
+ mov [scanend], ebx
+ mov edx, [chainlenwmask]
+ jmp LookupLoop
+
+;;; Accept the current string, with the maximum possible length.
+
+LenMaximum: mov edx, [deflatestate]
+ mov dword ptr [bestlen], MAX_MATCH
+ mov [edx + dsMatchStart], ecx
+
+;;; if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
+;;; return s->lookahead;
+
+LeaveNow:
+ mov edx, [deflatestate]
+ mov ebx, [bestlen]
+ mov eax, [edx + dsLookahead]
+ cmp ebx, eax
+ jg LookaheadRet
+ mov eax, ebx
+LookaheadRet:
+
+;;; Restore the stack and return from whence we came.
+
+ add esp, LocalVarsSize
+ pop ebx
+ pop esi
+ pop edi
+ pop ebp
+
+ ret
+; please don't remove this string !
+; Your can freely use match686 in any free or commercial app if you don't remove the string in the binary!
+ db 0dh,0ah,"asm686 with masm, optimised assembly code from Brian Raiter, written 1998",0dh,0ah
+
+
+ IFDEF NOUNDERLINE
+ longest_match endp
+ ELSE
+ _longest_match endp
+ ENDIF
+
+ IFDEF NOUNDERLINE
+ match_init proc near
+ ret
+ match_init endp
+ ELSE
+ _match_init proc near
+ ret
+ _match_init endp
+ ENDIF
+
+
+_TEXT ends
+end
diff --git a/protocols/Telegram/tgl/zlib/contrib/masmx86/readme.txt b/protocols/Telegram/tgl/zlib/contrib/masmx86/readme.txt
new file mode 100644
index 0000000000..3271f720a1
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/masmx86/readme.txt
@@ -0,0 +1,27 @@
+
+Summary
+-------
+This directory contains ASM implementations of the functions
+longest_match() and inflate_fast().
+
+
+Use instructions
+----------------
+Assemble using MASM, and copy the object files into the zlib source
+directory, then run the appropriate makefile, as suggested below. You can
+donwload MASM from here:
+
+ http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64
+
+You can also get objects files here:
+
+ http://www.winimage.com/zLibDll/zlib124_masm_obj.zip
+
+Build instructions
+------------------
+* With Microsoft C and MASM:
+nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj"
+
+* With Borland C and TASM:
+make -f win32/Makefile.bor LOCAL_ZLIB="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj" OBJPA="+match686c.obj+match686.obj+inffas32.obj"
+
diff --git a/protocols/Telegram/tgl/zlib/contrib/minizip/Makefile b/protocols/Telegram/tgl/zlib/contrib/minizip/Makefile
new file mode 100644
index 0000000000..84eaad20d4
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/minizip/Makefile
@@ -0,0 +1,25 @@
+CC=cc
+CFLAGS=-O -I../..
+
+UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a
+ZIP_OBJS = minizip.o zip.o ioapi.o ../../libz.a
+
+.c.o:
+ $(CC) -c $(CFLAGS) $*.c
+
+all: miniunz minizip
+
+miniunz: $(UNZ_OBJS)
+ $(CC) $(CFLAGS) -o $@ $(UNZ_OBJS)
+
+minizip: $(ZIP_OBJS)
+ $(CC) $(CFLAGS) -o $@ $(ZIP_OBJS)
+
+test: miniunz minizip
+ ./minizip test readme.txt
+ ./miniunz -l test.zip
+ mv readme.txt readme.old
+ ./miniunz test.zip
+
+clean:
+ /bin/rm -f *.o *~ minizip miniunz
diff --git a/protocols/Telegram/tgl/zlib/contrib/minizip/Makefile.am b/protocols/Telegram/tgl/zlib/contrib/minizip/Makefile.am
new file mode 100644
index 0000000000..d343011ebc
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/minizip/Makefile.am
@@ -0,0 +1,45 @@
+lib_LTLIBRARIES = libminizip.la
+
+if COND_DEMOS
+bin_PROGRAMS = miniunzip minizip
+endif
+
+zlib_top_srcdir = $(top_srcdir)/../..
+zlib_top_builddir = $(top_builddir)/../..
+
+AM_CPPFLAGS = -I$(zlib_top_srcdir)
+AM_LDFLAGS = -L$(zlib_top_builddir)
+
+if WIN32
+iowin32_src = iowin32.c
+iowin32_h = iowin32.h
+endif
+
+libminizip_la_SOURCES = \
+ ioapi.c \
+ mztools.c \
+ unzip.c \
+ zip.c \
+ ${iowin32_src}
+
+libminizip_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0 -lz
+
+minizip_includedir = $(includedir)/minizip
+minizip_include_HEADERS = \
+ crypt.h \
+ ioapi.h \
+ mztools.h \
+ unzip.h \
+ zip.h \
+ ${iowin32_h}
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = minizip.pc
+
+EXTRA_PROGRAMS = miniunzip minizip
+
+miniunzip_SOURCES = miniunz.c
+miniunzip_LDADD = libminizip.la
+
+minizip_SOURCES = minizip.c
+minizip_LDADD = libminizip.la -lz
diff --git a/protocols/Telegram/tgl/zlib/contrib/minizip/MiniZip64_Changes.txt b/protocols/Telegram/tgl/zlib/contrib/minizip/MiniZip64_Changes.txt
new file mode 100644
index 0000000000..13a1bd91a9
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/minizip/MiniZip64_Changes.txt
@@ -0,0 +1,6 @@
+
+MiniZip 1.1 was derrived from MiniZip at version 1.01f
+
+Change in 1.0 (Okt 2009)
+ - **TODO - Add history**
+
diff --git a/protocols/Telegram/tgl/zlib/contrib/minizip/MiniZip64_info.txt b/protocols/Telegram/tgl/zlib/contrib/minizip/MiniZip64_info.txt
new file mode 100644
index 0000000000..57d7152420
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/minizip/MiniZip64_info.txt
@@ -0,0 +1,74 @@
+MiniZip - Copyright (c) 1998-2010 - by Gilles Vollant - version 1.1 64 bits from Mathias Svensson
+
+Introduction
+---------------------
+MiniZip 1.1 is built from MiniZip 1.0 by Gilles Vollant ( http://www.winimage.com/zLibDll/minizip.html )
+
+When adding ZIP64 support into minizip it would result into risk of breaking compatibility with minizip 1.0.
+All possible work was done for compatibility.
+
+
+Background
+---------------------
+When adding ZIP64 support Mathias Svensson found that Even Rouault have added ZIP64
+support for unzip.c into minizip for a open source project called gdal ( http://www.gdal.org/ )
+
+That was used as a starting point. And after that ZIP64 support was added to zip.c
+some refactoring and code cleanup was also done.
+
+
+Changed from MiniZip 1.0 to MiniZip 1.1
+---------------------------------------
+* Added ZIP64 support for unzip ( by Even Rouault )
+* Added ZIP64 support for zip ( by Mathias Svensson )
+* Reverted some changed that Even Rouault did.
+* Bunch of patches received from Gulles Vollant that he received for MiniZip from various users.
+* Added unzip patch for BZIP Compression method (patch create by Daniel Borca)
+* Added BZIP Compress method for zip
+* Did some refactoring and code cleanup
+
+
+Credits
+
+ Gilles Vollant - Original MiniZip author
+ Even Rouault - ZIP64 unzip Support
+ Daniel Borca - BZip Compression method support in unzip
+ Mathias Svensson - ZIP64 zip support
+ Mathias Svensson - BZip Compression method support in zip
+
+ Resources
+
+ ZipLayout http://result42.com/projects/ZipFileLayout
+ Command line tool for Windows that shows the layout and information of the headers in a zip archive.
+ Used when debugging and validating the creation of zip files using MiniZip64
+
+
+ ZIP App Note http://www.pkware.com/documents/casestudies/APPNOTE.TXT
+ Zip File specification
+
+
+Notes.
+ * To be able to use BZip compression method in zip64.c or unzip64.c the BZIP2 lib is needed and HAVE_BZIP2 need to be defined.
+
+License
+----------------------------------------------------------
+ Condition of use and distribution are the same than zlib :
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+----------------------------------------------------------
+
diff --git a/protocols/Telegram/tgl/zlib/contrib/minizip/configure.ac b/protocols/Telegram/tgl/zlib/contrib/minizip/configure.ac
new file mode 100644
index 0000000000..827a4e0577
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/minizip/configure.ac
@@ -0,0 +1,32 @@
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_INIT([minizip], [1.2.8], [bugzilla.redhat.com])
+AC_CONFIG_SRCDIR([minizip.c])
+AM_INIT_AUTOMAKE([foreign])
+LT_INIT
+
+AC_MSG_CHECKING([whether to build example programs])
+AC_ARG_ENABLE([demos], AC_HELP_STRING([--enable-demos], [build example programs]))
+AM_CONDITIONAL([COND_DEMOS], [test "$enable_demos" = yes])
+if test "$enable_demos" = yes
+then
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_RESULT([no])
+fi
+
+case "${host}" in
+ *-mingw* | mingw*)
+ WIN32="yes"
+ ;;
+ *)
+ ;;
+esac
+AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"])
+
+
+AC_SUBST([HAVE_UNISTD_H], [0])
+AC_CHECK_HEADER([unistd.h], [HAVE_UNISTD_H=1], [])
+AC_CONFIG_FILES([Makefile minizip.pc])
+AC_OUTPUT
diff --git a/protocols/Telegram/tgl/zlib/contrib/minizip/crypt.h b/protocols/Telegram/tgl/zlib/contrib/minizip/crypt.h
new file mode 100644
index 0000000000..1e9e8200b2
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/minizip/crypt.h
@@ -0,0 +1,131 @@
+/* crypt.h -- base code for crypt/uncrypt ZIPfile
+
+
+ Version 1.01e, February 12th, 2005
+
+ Copyright (C) 1998-2005 Gilles Vollant
+
+ This code is a modified version of crypting code in Infozip distribution
+
+ The encryption/decryption parts of this source code (as opposed to the
+ non-echoing password parts) were originally written in Europe. The
+ whole source package can be freely distributed, including from the USA.
+ (Prior to January 2000, re-export from the US was a violation of US law.)
+
+ This encryption code is a direct transcription of the algorithm from
+ Roger Schlafly, described by Phil Katz in the file appnote.txt. This
+ file (appnote.txt) is distributed with the PKZIP program (even in the
+ version without encryption capabilities).
+
+ If you don't need crypting in your application, just define symbols
+ NOCRYPT and NOUNCRYPT.
+
+ This code support the "Traditional PKWARE Encryption".
+
+ The new AES encryption added on Zip format by Winzip (see the page
+ http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong
+ Encryption is not supported.
+*/
+
+#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8))
+
+/***********************************************************************
+ * Return the next byte in the pseudo-random sequence
+ */
+static int decrypt_byte(unsigned long* pkeys, const z_crc_t* pcrc_32_tab)
+{
+ unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
+ * unpredictable manner on 16-bit systems; not a problem
+ * with any known compiler so far, though */
+
+ temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2;
+ return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
+}
+
+/***********************************************************************
+ * Update the encryption keys with the next byte of plain text
+ */
+static int update_keys(unsigned long* pkeys,const z_crc_t* pcrc_32_tab,int c)
+{
+ (*(pkeys+0)) = CRC32((*(pkeys+0)), c);
+ (*(pkeys+1)) += (*(pkeys+0)) & 0xff;
+ (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1;
+ {
+ register int keyshift = (int)((*(pkeys+1)) >> 24);
+ (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift);
+ }
+ return c;
+}
+
+
+/***********************************************************************
+ * Initialize the encryption keys and the random header according to
+ * the given password.
+ */
+static void init_keys(const char* passwd,unsigned long* pkeys,const z_crc_t* pcrc_32_tab)
+{
+ *(pkeys+0) = 305419896L;
+ *(pkeys+1) = 591751049L;
+ *(pkeys+2) = 878082192L;
+ while (*passwd != '\0') {
+ update_keys(pkeys,pcrc_32_tab,(int)*passwd);
+ passwd++;
+ }
+}
+
+#define zdecode(pkeys,pcrc_32_tab,c) \
+ (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab)))
+
+#define zencode(pkeys,pcrc_32_tab,c,t) \
+ (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c))
+
+#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED
+
+#define RAND_HEAD_LEN 12
+ /* "last resort" source for second part of crypt seed pattern */
+# ifndef ZCR_SEED2
+# define ZCR_SEED2 3141592654UL /* use PI as default pattern */
+# endif
+
+static int crypthead(const char* passwd, /* password string */
+ unsigned char* buf, /* where to write header */
+ int bufSize,
+ unsigned long* pkeys,
+ const z_crc_t* pcrc_32_tab,
+ unsigned long crcForCrypting)
+{
+ int n; /* index in random header */
+ int t; /* temporary */
+ int c; /* random byte */
+ unsigned char header[RAND_HEAD_LEN-2]; /* random header */
+ static unsigned calls = 0; /* ensure different random header each time */
+
+ if (bufSize<RAND_HEAD_LEN)
+ return 0;
+
+ /* First generate RAND_HEAD_LEN-2 random bytes. We encrypt the
+ * output of rand() to get less predictability, since rand() is
+ * often poorly implemented.
+ */
+ if (++calls == 1)
+ {
+ srand((unsigned)(time(NULL) ^ ZCR_SEED2));
+ }
+ init_keys(passwd, pkeys, pcrc_32_tab);
+ for (n = 0; n < RAND_HEAD_LEN-2; n++)
+ {
+ c = (rand() >> 7) & 0xff;
+ header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t);
+ }
+ /* Encrypt random header (last two bytes is high word of crc) */
+ init_keys(passwd, pkeys, pcrc_32_tab);
+ for (n = 0; n < RAND_HEAD_LEN-2; n++)
+ {
+ buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t);
+ }
+ buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t);
+ buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t);
+ return n;
+}
+
+#endif
diff --git a/protocols/Telegram/tgl/zlib/contrib/minizip/ioapi.c b/protocols/Telegram/tgl/zlib/contrib/minizip/ioapi.c
new file mode 100644
index 0000000000..7f5c191b2a
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/minizip/ioapi.c
@@ -0,0 +1,247 @@
+/* ioapi.h -- IO base function header for compress/uncompress .zip
+ part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
+
+ Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
+
+ Modifications for Zip64 support
+ Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
+
+ For more info read MiniZip_info.txt
+
+*/
+
+#if defined(_WIN32) && (!(defined(_CRT_SECURE_NO_WARNINGS)))
+ #define _CRT_SECURE_NO_WARNINGS
+#endif
+
+#if defined(__APPLE__) || defined(IOAPI_NO_64)
+// In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions
+#define FOPEN_FUNC(filename, mode) fopen(filename, mode)
+#define FTELLO_FUNC(stream) ftello(stream)
+#define FSEEKO_FUNC(stream, offset, origin) fseeko(stream, offset, origin)
+#else
+#define FOPEN_FUNC(filename, mode) fopen64(filename, mode)
+#define FTELLO_FUNC(stream) ftello64(stream)
+#define FSEEKO_FUNC(stream, offset, origin) fseeko64(stream, offset, origin)
+#endif
+
+
+#include "ioapi.h"
+
+voidpf call_zopen64 (const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode)
+{
+ if (pfilefunc->zfile_func64.zopen64_file != NULL)
+ return (*(pfilefunc->zfile_func64.zopen64_file)) (pfilefunc->zfile_func64.opaque,filename,mode);
+ else
+ {
+ return (*(pfilefunc->zopen32_file))(pfilefunc->zfile_func64.opaque,(const char*)filename,mode);
+ }
+}
+
+long call_zseek64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin)
+{
+ if (pfilefunc->zfile_func64.zseek64_file != NULL)
+ return (*(pfilefunc->zfile_func64.zseek64_file)) (pfilefunc->zfile_func64.opaque,filestream,offset,origin);
+ else
+ {
+ uLong offsetTruncated = (uLong)offset;
+ if (offsetTruncated != offset)
+ return -1;
+ else
+ return (*(pfilefunc->zseek32_file))(pfilefunc->zfile_func64.opaque,filestream,offsetTruncated,origin);
+ }
+}
+
+ZPOS64_T call_ztell64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream)
+{
+ if (pfilefunc->zfile_func64.zseek64_file != NULL)
+ return (*(pfilefunc->zfile_func64.ztell64_file)) (pfilefunc->zfile_func64.opaque,filestream);
+ else
+ {
+ uLong tell_uLong = (*(pfilefunc->ztell32_file))(pfilefunc->zfile_func64.opaque,filestream);
+ if ((tell_uLong) == MAXU32)
+ return (ZPOS64_T)-1;
+ else
+ return tell_uLong;
+ }
+}
+
+void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32)
+{
+ p_filefunc64_32->zfile_func64.zopen64_file = NULL;
+ p_filefunc64_32->zopen32_file = p_filefunc32->zopen_file;
+ p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file;
+ p_filefunc64_32->zfile_func64.zread_file = p_filefunc32->zread_file;
+ p_filefunc64_32->zfile_func64.zwrite_file = p_filefunc32->zwrite_file;
+ p_filefunc64_32->zfile_func64.ztell64_file = NULL;
+ p_filefunc64_32->zfile_func64.zseek64_file = NULL;
+ p_filefunc64_32->zfile_func64.zclose_file = p_filefunc32->zclose_file;
+ p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file;
+ p_filefunc64_32->zfile_func64.opaque = p_filefunc32->opaque;
+ p_filefunc64_32->zseek32_file = p_filefunc32->zseek_file;
+ p_filefunc64_32->ztell32_file = p_filefunc32->ztell_file;
+}
+
+
+
+static voidpf ZCALLBACK fopen_file_func OF((voidpf opaque, const char* filename, int mode));
+static uLong ZCALLBACK fread_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size));
+static uLong ZCALLBACK fwrite_file_func OF((voidpf opaque, voidpf stream, const void* buf,uLong size));
+static ZPOS64_T ZCALLBACK ftell64_file_func OF((voidpf opaque, voidpf stream));
+static long ZCALLBACK fseek64_file_func OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin));
+static int ZCALLBACK fclose_file_func OF((voidpf opaque, voidpf stream));
+static int ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream));
+
+static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode)
+{
+ FILE* file = NULL;
+ const char* mode_fopen = NULL;
+ if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
+ mode_fopen = "rb";
+ else
+ if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
+ mode_fopen = "r+b";
+ else
+ if (mode & ZLIB_FILEFUNC_MODE_CREATE)
+ mode_fopen = "wb";
+
+ if ((filename!=NULL) && (mode_fopen != NULL))
+ file = fopen(filename, mode_fopen);
+ return file;
+}
+
+static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode)
+{
+ FILE* file = NULL;
+ const char* mode_fopen = NULL;
+ if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
+ mode_fopen = "rb";
+ else
+ if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
+ mode_fopen = "r+b";
+ else
+ if (mode & ZLIB_FILEFUNC_MODE_CREATE)
+ mode_fopen = "wb";
+
+ if ((filename!=NULL) && (mode_fopen != NULL))
+ file = FOPEN_FUNC((const char*)filename, mode_fopen);
+ return file;
+}
+
+
+static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size)
+{
+ uLong ret;
+ ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream);
+ return ret;
+}
+
+static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size)
+{
+ uLong ret;
+ ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream);
+ return ret;
+}
+
+static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream)
+{
+ long ret;
+ ret = ftell((FILE *)stream);
+ return ret;
+}
+
+
+static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream)
+{
+ ZPOS64_T ret;
+ ret = FTELLO_FUNC((FILE *)stream);
+ return ret;
+}
+
+static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offset, int origin)
+{
+ int fseek_origin=0;
+ long ret;
+ switch (origin)
+ {
+ case ZLIB_FILEFUNC_SEEK_CUR :
+ fseek_origin = SEEK_CUR;
+ break;
+ case ZLIB_FILEFUNC_SEEK_END :
+ fseek_origin = SEEK_END;
+ break;
+ case ZLIB_FILEFUNC_SEEK_SET :
+ fseek_origin = SEEK_SET;
+ break;
+ default: return -1;
+ }
+ ret = 0;
+ if (fseek((FILE *)stream, offset, fseek_origin) != 0)
+ ret = -1;
+ return ret;
+}
+
+static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)
+{
+ int fseek_origin=0;
+ long ret;
+ switch (origin)
+ {
+ case ZLIB_FILEFUNC_SEEK_CUR :
+ fseek_origin = SEEK_CUR;
+ break;
+ case ZLIB_FILEFUNC_SEEK_END :
+ fseek_origin = SEEK_END;
+ break;
+ case ZLIB_FILEFUNC_SEEK_SET :
+ fseek_origin = SEEK_SET;
+ break;
+ default: return -1;
+ }
+ ret = 0;
+
+ if(FSEEKO_FUNC((FILE *)stream, offset, fseek_origin) != 0)
+ ret = -1;
+
+ return ret;
+}
+
+
+static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream)
+{
+ int ret;
+ ret = fclose((FILE *)stream);
+ return ret;
+}
+
+static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream)
+{
+ int ret;
+ ret = ferror((FILE *)stream);
+ return ret;
+}
+
+void fill_fopen_filefunc (pzlib_filefunc_def)
+ zlib_filefunc_def* pzlib_filefunc_def;
+{
+ pzlib_filefunc_def->zopen_file = fopen_file_func;
+ pzlib_filefunc_def->zread_file = fread_file_func;
+ pzlib_filefunc_def->zwrite_file = fwrite_file_func;
+ pzlib_filefunc_def->ztell_file = ftell_file_func;
+ pzlib_filefunc_def->zseek_file = fseek_file_func;
+ pzlib_filefunc_def->zclose_file = fclose_file_func;
+ pzlib_filefunc_def->zerror_file = ferror_file_func;
+ pzlib_filefunc_def->opaque = NULL;
+}
+
+void fill_fopen64_filefunc (zlib_filefunc64_def* pzlib_filefunc_def)
+{
+ pzlib_filefunc_def->zopen64_file = fopen64_file_func;
+ pzlib_filefunc_def->zread_file = fread_file_func;
+ pzlib_filefunc_def->zwrite_file = fwrite_file_func;
+ pzlib_filefunc_def->ztell64_file = ftell64_file_func;
+ pzlib_filefunc_def->zseek64_file = fseek64_file_func;
+ pzlib_filefunc_def->zclose_file = fclose_file_func;
+ pzlib_filefunc_def->zerror_file = ferror_file_func;
+ pzlib_filefunc_def->opaque = NULL;
+}
diff --git a/protocols/Telegram/tgl/zlib/contrib/minizip/ioapi.h b/protocols/Telegram/tgl/zlib/contrib/minizip/ioapi.h
new file mode 100644
index 0000000000..8dcbdb06e3
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/minizip/ioapi.h
@@ -0,0 +1,208 @@
+/* ioapi.h -- IO base function header for compress/uncompress .zip
+ part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
+
+ Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
+
+ Modifications for Zip64 support
+ Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
+
+ For more info read MiniZip_info.txt
+
+ Changes
+
+ Oct-2009 - Defined ZPOS64_T to fpos_t on windows and u_int64_t on linux. (might need to find a better why for this)
+ Oct-2009 - Change to fseeko64, ftello64 and fopen64 so large files would work on linux.
+ More if/def section may be needed to support other platforms
+ Oct-2009 - Defined fxxxx64 calls to normal fopen/ftell/fseek so they would compile on windows.
+ (but you should use iowin32.c for windows instead)
+
+*/
+
+#ifndef _ZLIBIOAPI64_H
+#define _ZLIBIOAPI64_H
+
+#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__))
+
+ // Linux needs this to support file operation on files larger then 4+GB
+ // But might need better if/def to select just the platforms that needs them.
+
+ #ifndef __USE_FILE_OFFSET64
+ #define __USE_FILE_OFFSET64
+ #endif
+ #ifndef __USE_LARGEFILE64
+ #define __USE_LARGEFILE64
+ #endif
+ #ifndef _LARGEFILE64_SOURCE
+ #define _LARGEFILE64_SOURCE
+ #endif
+ #ifndef _FILE_OFFSET_BIT
+ #define _FILE_OFFSET_BIT 64
+ #endif
+
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "zlib.h"
+
+#if defined(USE_FILE32API)
+#define fopen64 fopen
+#define ftello64 ftell
+#define fseeko64 fseek
+#else
+#ifdef __FreeBSD__
+#define fopen64 fopen
+#define ftello64 ftello
+#define fseeko64 fseeko
+#endif
+#ifdef _MSC_VER
+ #define fopen64 fopen
+ #if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC)))
+ #define ftello64 _ftelli64
+ #define fseeko64 _fseeki64
+ #else // old MSC
+ #define ftello64 ftell
+ #define fseeko64 fseek
+ #endif
+#endif
+#endif
+
+/*
+#ifndef ZPOS64_T
+ #ifdef _WIN32
+ #define ZPOS64_T fpos_t
+ #else
+ #include <stdint.h>
+ #define ZPOS64_T uint64_t
+ #endif
+#endif
+*/
+
+#ifdef HAVE_MINIZIP64_CONF_H
+#include "mz64conf.h"
+#endif
+
+/* a type choosen by DEFINE */
+#ifdef HAVE_64BIT_INT_CUSTOM
+typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T;
+#else
+#ifdef HAS_STDINT_H
+#include "stdint.h"
+typedef uint64_t ZPOS64_T;
+#else
+
+/* Maximum unsigned 32-bit value used as placeholder for zip64 */
+#define MAXU32 0xffffffff
+
+#if defined(_MSC_VER) || defined(__BORLANDC__)
+typedef unsigned __int64 ZPOS64_T;
+#else
+typedef unsigned long long int ZPOS64_T;
+#endif
+#endif
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#define ZLIB_FILEFUNC_SEEK_CUR (1)
+#define ZLIB_FILEFUNC_SEEK_END (2)
+#define ZLIB_FILEFUNC_SEEK_SET (0)
+
+#define ZLIB_FILEFUNC_MODE_READ (1)
+#define ZLIB_FILEFUNC_MODE_WRITE (2)
+#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3)
+
+#define ZLIB_FILEFUNC_MODE_EXISTING (4)
+#define ZLIB_FILEFUNC_MODE_CREATE (8)
+
+
+#ifndef ZCALLBACK
+ #if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK)
+ #define ZCALLBACK CALLBACK
+ #else
+ #define ZCALLBACK
+ #endif
+#endif
+
+
+
+
+typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode));
+typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size));
+typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
+typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream));
+typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream));
+
+typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream));
+typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin));
+
+
+/* here is the "old" 32 bits structure structure */
+typedef struct zlib_filefunc_def_s
+{
+ open_file_func zopen_file;
+ read_file_func zread_file;
+ write_file_func zwrite_file;
+ tell_file_func ztell_file;
+ seek_file_func zseek_file;
+ close_file_func zclose_file;
+ testerror_file_func zerror_file;
+ voidpf opaque;
+} zlib_filefunc_def;
+
+typedef ZPOS64_T (ZCALLBACK *tell64_file_func) OF((voidpf opaque, voidpf stream));
+typedef long (ZCALLBACK *seek64_file_func) OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin));
+typedef voidpf (ZCALLBACK *open64_file_func) OF((voidpf opaque, const void* filename, int mode));
+
+typedef struct zlib_filefunc64_def_s
+{
+ open64_file_func zopen64_file;
+ read_file_func zread_file;
+ write_file_func zwrite_file;
+ tell64_file_func ztell64_file;
+ seek64_file_func zseek64_file;
+ close_file_func zclose_file;
+ testerror_file_func zerror_file;
+ voidpf opaque;
+} zlib_filefunc64_def;
+
+void fill_fopen64_filefunc OF((zlib_filefunc64_def* pzlib_filefunc_def));
+void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def));
+
+/* now internal definition, only for zip.c and unzip.h */
+typedef struct zlib_filefunc64_32_def_s
+{
+ zlib_filefunc64_def zfile_func64;
+ open_file_func zopen32_file;
+ tell_file_func ztell32_file;
+ seek_file_func zseek32_file;
+} zlib_filefunc64_32_def;
+
+
+#define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size))
+#define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size))
+//#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream))
+//#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode))
+#define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream))
+#define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream))
+
+voidpf call_zopen64 OF((const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode));
+long call_zseek64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin));
+ZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream));
+
+void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32);
+
+#define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(filename),(mode)))
+#define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(filestream)))
+#define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(filestream),(pos),(mode)))
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocols/Telegram/tgl/zlib/contrib/minizip/iowin32.c b/protocols/Telegram/tgl/zlib/contrib/minizip/iowin32.c
new file mode 100644
index 0000000000..a46d96c7fd
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/minizip/iowin32.c
@@ -0,0 +1,461 @@
+/* iowin32.c -- IO base function header for compress/uncompress .zip
+ Version 1.1, February 14h, 2010
+ part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
+
+ Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
+
+ Modifications for Zip64 support
+ Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
+
+ For more info read MiniZip_info.txt
+
+*/
+
+#include <stdlib.h>
+
+#include "zlib.h"
+#include "ioapi.h"
+#include "iowin32.h"
+
+#ifndef INVALID_HANDLE_VALUE
+#define INVALID_HANDLE_VALUE (0xFFFFFFFF)
+#endif
+
+#ifndef INVALID_SET_FILE_POINTER
+#define INVALID_SET_FILE_POINTER ((DWORD)-1)
+#endif
+
+
+#if defined(WINAPI_FAMILY_PARTITION) && (!(defined(IOWIN32_USING_WINRT_API)))
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
+#define IOWIN32_USING_WINRT_API 1
+#endif
+#endif
+
+voidpf ZCALLBACK win32_open_file_func OF((voidpf opaque, const char* filename, int mode));
+uLong ZCALLBACK win32_read_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size));
+uLong ZCALLBACK win32_write_file_func OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
+ZPOS64_T ZCALLBACK win32_tell64_file_func OF((voidpf opaque, voidpf stream));
+long ZCALLBACK win32_seek64_file_func OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin));
+int ZCALLBACK win32_close_file_func OF((voidpf opaque, voidpf stream));
+int ZCALLBACK win32_error_file_func OF((voidpf opaque, voidpf stream));
+
+typedef struct
+{
+ HANDLE hf;
+ int error;
+} WIN32FILE_IOWIN;
+
+
+static void win32_translate_open_mode(int mode,
+ DWORD* lpdwDesiredAccess,
+ DWORD* lpdwCreationDisposition,
+ DWORD* lpdwShareMode,
+ DWORD* lpdwFlagsAndAttributes)
+{
+ *lpdwDesiredAccess = *lpdwShareMode = *lpdwFlagsAndAttributes = *lpdwCreationDisposition = 0;
+
+ if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
+ {
+ *lpdwDesiredAccess = GENERIC_READ;
+ *lpdwCreationDisposition = OPEN_EXISTING;
+ *lpdwShareMode = FILE_SHARE_READ;
+ }
+ else if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
+ {
+ *lpdwDesiredAccess = GENERIC_WRITE | GENERIC_READ;
+ *lpdwCreationDisposition = OPEN_EXISTING;
+ }
+ else if (mode & ZLIB_FILEFUNC_MODE_CREATE)
+ {
+ *lpdwDesiredAccess = GENERIC_WRITE | GENERIC_READ;
+ *lpdwCreationDisposition = CREATE_ALWAYS;
+ }
+}
+
+static voidpf win32_build_iowin(HANDLE hFile)
+{
+ voidpf ret=NULL;
+
+ if ((hFile != NULL) && (hFile != INVALID_HANDLE_VALUE))
+ {
+ WIN32FILE_IOWIN w32fiow;
+ w32fiow.hf = hFile;
+ w32fiow.error = 0;
+ ret = malloc(sizeof(WIN32FILE_IOWIN));
+
+ if (ret==NULL)
+ CloseHandle(hFile);
+ else
+ *((WIN32FILE_IOWIN*)ret) = w32fiow;
+ }
+ return ret;
+}
+
+voidpf ZCALLBACK win32_open64_file_func (voidpf opaque,const void* filename,int mode)
+{
+ const char* mode_fopen = NULL;
+ DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ;
+ HANDLE hFile = NULL;
+
+ win32_translate_open_mode(mode,&dwDesiredAccess,&dwCreationDisposition,&dwShareMode,&dwFlagsAndAttributes);
+
+#ifdef IOWIN32_USING_WINRT_API
+#ifdef UNICODE
+ if ((filename!=NULL) && (dwDesiredAccess != 0))
+ hFile = CreateFile2((LPCTSTR)filename, dwDesiredAccess, dwShareMode, dwCreationDisposition, NULL);
+#else
+ if ((filename!=NULL) && (dwDesiredAccess != 0))
+ {
+ WCHAR filenameW[FILENAME_MAX + 0x200 + 1];
+ MultiByteToWideChar(CP_ACP,0,(const char*)filename,-1,filenameW,FILENAME_MAX + 0x200);
+ hFile = CreateFile2(filenameW, dwDesiredAccess, dwShareMode, dwCreationDisposition, NULL);
+ }
+#endif
+#else
+ if ((filename!=NULL) && (dwDesiredAccess != 0))
+ hFile = CreateFile((LPCTSTR)filename, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL);
+#endif
+
+ return win32_build_iowin(hFile);
+}
+
+
+voidpf ZCALLBACK win32_open64_file_funcA (voidpf opaque,const void* filename,int mode)
+{
+ const char* mode_fopen = NULL;
+ DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ;
+ HANDLE hFile = NULL;
+
+ win32_translate_open_mode(mode,&dwDesiredAccess,&dwCreationDisposition,&dwShareMode,&dwFlagsAndAttributes);
+
+#ifdef IOWIN32_USING_WINRT_API
+ if ((filename!=NULL) && (dwDesiredAccess != 0))
+ {
+ WCHAR filenameW[FILENAME_MAX + 0x200 + 1];
+ MultiByteToWideChar(CP_ACP,0,(const char*)filename,-1,filenameW,FILENAME_MAX + 0x200);
+ hFile = CreateFile2(filenameW, dwDesiredAccess, dwShareMode, dwCreationDisposition, NULL);
+ }
+#else
+ if ((filename!=NULL) && (dwDesiredAccess != 0))
+ hFile = CreateFileA((LPCSTR)filename, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL);
+#endif
+
+ return win32_build_iowin(hFile);
+}
+
+
+voidpf ZCALLBACK win32_open64_file_funcW (voidpf opaque,const void* filename,int mode)
+{
+ const char* mode_fopen = NULL;
+ DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ;
+ HANDLE hFile = NULL;
+
+ win32_translate_open_mode(mode,&dwDesiredAccess,&dwCreationDisposition,&dwShareMode,&dwFlagsAndAttributes);
+
+#ifdef IOWIN32_USING_WINRT_API
+ if ((filename!=NULL) && (dwDesiredAccess != 0))
+ hFile = CreateFile2((LPCWSTR)filename, dwDesiredAccess, dwShareMode, dwCreationDisposition,NULL);
+#else
+ if ((filename!=NULL) && (dwDesiredAccess != 0))
+ hFile = CreateFileW((LPCWSTR)filename, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL);
+#endif
+
+ return win32_build_iowin(hFile);
+}
+
+
+voidpf ZCALLBACK win32_open_file_func (voidpf opaque,const char* filename,int mode)
+{
+ const char* mode_fopen = NULL;
+ DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ;
+ HANDLE hFile = NULL;
+
+ win32_translate_open_mode(mode,&dwDesiredAccess,&dwCreationDisposition,&dwShareMode,&dwFlagsAndAttributes);
+
+#ifdef IOWIN32_USING_WINRT_API
+#ifdef UNICODE
+ if ((filename!=NULL) && (dwDesiredAccess != 0))
+ hFile = CreateFile2((LPCTSTR)filename, dwDesiredAccess, dwShareMode, dwCreationDisposition, NULL);
+#else
+ if ((filename!=NULL) && (dwDesiredAccess != 0))
+ {
+ WCHAR filenameW[FILENAME_MAX + 0x200 + 1];
+ MultiByteToWideChar(CP_ACP,0,(const char*)filename,-1,filenameW,FILENAME_MAX + 0x200);
+ hFile = CreateFile2(filenameW, dwDesiredAccess, dwShareMode, dwCreationDisposition, NULL);
+ }
+#endif
+#else
+ if ((filename!=NULL) && (dwDesiredAccess != 0))
+ hFile = CreateFile((LPCTSTR)filename, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL);
+#endif
+
+ return win32_build_iowin(hFile);
+}
+
+
+uLong ZCALLBACK win32_read_file_func (voidpf opaque, voidpf stream, void* buf,uLong size)
+{
+ uLong ret=0;
+ HANDLE hFile = NULL;
+ if (stream!=NULL)
+ hFile = ((WIN32FILE_IOWIN*)stream) -> hf;
+
+ if (hFile != NULL)
+ {
+ if (!ReadFile(hFile, buf, size, &ret, NULL))
+ {
+ DWORD dwErr = GetLastError();
+ if (dwErr == ERROR_HANDLE_EOF)
+ dwErr = 0;
+ ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr;
+ }
+ }
+
+ return ret;
+}
+
+
+uLong ZCALLBACK win32_write_file_func (voidpf opaque,voidpf stream,const void* buf,uLong size)
+{
+ uLong ret=0;
+ HANDLE hFile = NULL;
+ if (stream!=NULL)
+ hFile = ((WIN32FILE_IOWIN*)stream) -> hf;
+
+ if (hFile != NULL)
+ {
+ if (!WriteFile(hFile, buf, size, &ret, NULL))
+ {
+ DWORD dwErr = GetLastError();
+ if (dwErr == ERROR_HANDLE_EOF)
+ dwErr = 0;
+ ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr;
+ }
+ }
+
+ return ret;
+}
+
+static BOOL MySetFilePointerEx(HANDLE hFile, LARGE_INTEGER pos, LARGE_INTEGER *newPos, DWORD dwMoveMethod)
+{
+#ifdef IOWIN32_USING_WINRT_API
+ return SetFilePointerEx(hFile, pos, newPos, dwMoveMethod);
+#else
+ LONG lHigh = pos.HighPart;
+ DWORD dwNewPos = SetFilePointer(hFile, pos.LowPart, &lHigh, FILE_CURRENT);
+ BOOL fOk = TRUE;
+ if (dwNewPos == 0xFFFFFFFF)
+ if (GetLastError() != NO_ERROR)
+ fOk = FALSE;
+ if ((newPos != NULL) && (fOk))
+ {
+ newPos->LowPart = dwNewPos;
+ newPos->HighPart = lHigh;
+ }
+ return fOk;
+#endif
+}
+
+long ZCALLBACK win32_tell_file_func (voidpf opaque,voidpf stream)
+{
+ long ret=-1;
+ HANDLE hFile = NULL;
+ if (stream!=NULL)
+ hFile = ((WIN32FILE_IOWIN*)stream) -> hf;
+ if (hFile != NULL)
+ {
+ LARGE_INTEGER pos;
+ pos.QuadPart = 0;
+
+ if (!MySetFilePointerEx(hFile, pos, &pos, FILE_CURRENT))
+ {
+ DWORD dwErr = GetLastError();
+ ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr;
+ ret = -1;
+ }
+ else
+ ret=(long)pos.LowPart;
+ }
+ return ret;
+}
+
+ZPOS64_T ZCALLBACK win32_tell64_file_func (voidpf opaque, voidpf stream)
+{
+ ZPOS64_T ret= (ZPOS64_T)-1;
+ HANDLE hFile = NULL;
+ if (stream!=NULL)
+ hFile = ((WIN32FILE_IOWIN*)stream)->hf;
+
+ if (hFile)
+ {
+ LARGE_INTEGER pos;
+ pos.QuadPart = 0;
+
+ if (!MySetFilePointerEx(hFile, pos, &pos, FILE_CURRENT))
+ {
+ DWORD dwErr = GetLastError();
+ ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr;
+ ret = (ZPOS64_T)-1;
+ }
+ else
+ ret=pos.QuadPart;
+ }
+ return ret;
+}
+
+
+long ZCALLBACK win32_seek_file_func (voidpf opaque,voidpf stream,uLong offset,int origin)
+{
+ DWORD dwMoveMethod=0xFFFFFFFF;
+ HANDLE hFile = NULL;
+
+ long ret=-1;
+ if (stream!=NULL)
+ hFile = ((WIN32FILE_IOWIN*)stream) -> hf;
+ switch (origin)
+ {
+ case ZLIB_FILEFUNC_SEEK_CUR :
+ dwMoveMethod = FILE_CURRENT;
+ break;
+ case ZLIB_FILEFUNC_SEEK_END :
+ dwMoveMethod = FILE_END;
+ break;
+ case ZLIB_FILEFUNC_SEEK_SET :
+ dwMoveMethod = FILE_BEGIN;
+ break;
+ default: return -1;
+ }
+
+ if (hFile != NULL)
+ {
+ LARGE_INTEGER pos;
+ pos.QuadPart = offset;
+ if (!MySetFilePointerEx(hFile, pos, NULL, dwMoveMethod))
+ {
+ DWORD dwErr = GetLastError();
+ ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr;
+ ret = -1;
+ }
+ else
+ ret=0;
+ }
+ return ret;
+}
+
+long ZCALLBACK win32_seek64_file_func (voidpf opaque, voidpf stream,ZPOS64_T offset,int origin)
+{
+ DWORD dwMoveMethod=0xFFFFFFFF;
+ HANDLE hFile = NULL;
+ long ret=-1;
+
+ if (stream!=NULL)
+ hFile = ((WIN32FILE_IOWIN*)stream)->hf;
+
+ switch (origin)
+ {
+ case ZLIB_FILEFUNC_SEEK_CUR :
+ dwMoveMethod = FILE_CURRENT;
+ break;
+ case ZLIB_FILEFUNC_SEEK_END :
+ dwMoveMethod = FILE_END;
+ break;
+ case ZLIB_FILEFUNC_SEEK_SET :
+ dwMoveMethod = FILE_BEGIN;
+ break;
+ default: return -1;
+ }
+
+ if (hFile)
+ {
+ LARGE_INTEGER pos;
+ pos.QuadPart = offset;
+ if (!MySetFilePointerEx(hFile, pos, NULL, FILE_CURRENT))
+ {
+ DWORD dwErr = GetLastError();
+ ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr;
+ ret = -1;
+ }
+ else
+ ret=0;
+ }
+ return ret;
+}
+
+int ZCALLBACK win32_close_file_func (voidpf opaque, voidpf stream)
+{
+ int ret=-1;
+
+ if (stream!=NULL)
+ {
+ HANDLE hFile;
+ hFile = ((WIN32FILE_IOWIN*)stream) -> hf;
+ if (hFile != NULL)
+ {
+ CloseHandle(hFile);
+ ret=0;
+ }
+ free(stream);
+ }
+ return ret;
+}
+
+int ZCALLBACK win32_error_file_func (voidpf opaque,voidpf stream)
+{
+ int ret=-1;
+ if (stream!=NULL)
+ {
+ ret = ((WIN32FILE_IOWIN*)stream) -> error;
+ }
+ return ret;
+}
+
+void fill_win32_filefunc (zlib_filefunc_def* pzlib_filefunc_def)
+{
+ pzlib_filefunc_def->zopen_file = win32_open_file_func;
+ pzlib_filefunc_def->zread_file = win32_read_file_func;
+ pzlib_filefunc_def->zwrite_file = win32_write_file_func;
+ pzlib_filefunc_def->ztell_file = win32_tell_file_func;
+ pzlib_filefunc_def->zseek_file = win32_seek_file_func;
+ pzlib_filefunc_def->zclose_file = win32_close_file_func;
+ pzlib_filefunc_def->zerror_file = win32_error_file_func;
+ pzlib_filefunc_def->opaque = NULL;
+}
+
+void fill_win32_filefunc64(zlib_filefunc64_def* pzlib_filefunc_def)
+{
+ pzlib_filefunc_def->zopen64_file = win32_open64_file_func;
+ pzlib_filefunc_def->zread_file = win32_read_file_func;
+ pzlib_filefunc_def->zwrite_file = win32_write_file_func;
+ pzlib_filefunc_def->ztell64_file = win32_tell64_file_func;
+ pzlib_filefunc_def->zseek64_file = win32_seek64_file_func;
+ pzlib_filefunc_def->zclose_file = win32_close_file_func;
+ pzlib_filefunc_def->zerror_file = win32_error_file_func;
+ pzlib_filefunc_def->opaque = NULL;
+}
+
+
+void fill_win32_filefunc64A(zlib_filefunc64_def* pzlib_filefunc_def)
+{
+ pzlib_filefunc_def->zopen64_file = win32_open64_file_funcA;
+ pzlib_filefunc_def->zread_file = win32_read_file_func;
+ pzlib_filefunc_def->zwrite_file = win32_write_file_func;
+ pzlib_filefunc_def->ztell64_file = win32_tell64_file_func;
+ pzlib_filefunc_def->zseek64_file = win32_seek64_file_func;
+ pzlib_filefunc_def->zclose_file = win32_close_file_func;
+ pzlib_filefunc_def->zerror_file = win32_error_file_func;
+ pzlib_filefunc_def->opaque = NULL;
+}
+
+
+void fill_win32_filefunc64W(zlib_filefunc64_def* pzlib_filefunc_def)
+{
+ pzlib_filefunc_def->zopen64_file = win32_open64_file_funcW;
+ pzlib_filefunc_def->zread_file = win32_read_file_func;
+ pzlib_filefunc_def->zwrite_file = win32_write_file_func;
+ pzlib_filefunc_def->ztell64_file = win32_tell64_file_func;
+ pzlib_filefunc_def->zseek64_file = win32_seek64_file_func;
+ pzlib_filefunc_def->zclose_file = win32_close_file_func;
+ pzlib_filefunc_def->zerror_file = win32_error_file_func;
+ pzlib_filefunc_def->opaque = NULL;
+}
diff --git a/protocols/Telegram/tgl/zlib/contrib/minizip/iowin32.h b/protocols/Telegram/tgl/zlib/contrib/minizip/iowin32.h
new file mode 100644
index 0000000000..0ca0969a7d
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/minizip/iowin32.h
@@ -0,0 +1,28 @@
+/* iowin32.h -- IO base function header for compress/uncompress .zip
+ Version 1.1, February 14h, 2010
+ part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
+
+ Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
+
+ Modifications for Zip64 support
+ Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
+
+ For more info read MiniZip_info.txt
+
+*/
+
+#include <windows.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void fill_win32_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def));
+void fill_win32_filefunc64 OF((zlib_filefunc64_def* pzlib_filefunc_def));
+void fill_win32_filefunc64A OF((zlib_filefunc64_def* pzlib_filefunc_def));
+void fill_win32_filefunc64W OF((zlib_filefunc64_def* pzlib_filefunc_def));
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/protocols/Telegram/tgl/zlib/contrib/minizip/make_vms.com b/protocols/Telegram/tgl/zlib/contrib/minizip/make_vms.com
new file mode 100644
index 0000000000..9ac13a98fa
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/minizip/make_vms.com
@@ -0,0 +1,25 @@
+$ if f$search("ioapi.h_orig") .eqs. "" then copy ioapi.h ioapi.h_orig
+$ open/write zdef vmsdefs.h
+$ copy sys$input: zdef
+$ deck
+#define unix
+#define fill_zlib_filefunc64_32_def_from_filefunc32 fillzffunc64from
+#define Write_Zip64EndOfCentralDirectoryLocator Write_Zip64EoDLocator
+#define Write_Zip64EndOfCentralDirectoryRecord Write_Zip64EoDRecord
+#define Write_EndOfCentralDirectoryRecord Write_EoDRecord
+$ eod
+$ close zdef
+$ copy vmsdefs.h,ioapi.h_orig ioapi.h
+$ cc/include=[--]/prefix=all ioapi.c
+$ cc/include=[--]/prefix=all miniunz.c
+$ cc/include=[--]/prefix=all unzip.c
+$ cc/include=[--]/prefix=all minizip.c
+$ cc/include=[--]/prefix=all zip.c
+$ link miniunz,unzip,ioapi,[--]libz.olb/lib
+$ link minizip,zip,ioapi,[--]libz.olb/lib
+$ mcr []minizip test minizip_info.txt
+$ mcr []miniunz -l test.zip
+$ rename minizip_info.txt; minizip_info.txt_old
+$ mcr []miniunz test.zip
+$ delete test.zip;*
+$exit
diff --git a/protocols/Telegram/tgl/zlib/contrib/minizip/miniunz.c b/protocols/Telegram/tgl/zlib/contrib/minizip/miniunz.c
new file mode 100644
index 0000000000..3d65401be5
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/minizip/miniunz.c
@@ -0,0 +1,660 @@
+/*
+ miniunz.c
+ Version 1.1, February 14h, 2010
+ sample part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
+
+ Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
+
+ Modifications of Unzip for Zip64
+ Copyright (C) 2007-2008 Even Rouault
+
+ Modifications for Zip64 support on both zip and unzip
+ Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
+*/
+
+#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__))
+ #ifndef __USE_FILE_OFFSET64
+ #define __USE_FILE_OFFSET64
+ #endif
+ #ifndef __USE_LARGEFILE64
+ #define __USE_LARGEFILE64
+ #endif
+ #ifndef _LARGEFILE64_SOURCE
+ #define _LARGEFILE64_SOURCE
+ #endif
+ #ifndef _FILE_OFFSET_BIT
+ #define _FILE_OFFSET_BIT 64
+ #endif
+#endif
+
+#ifdef __APPLE__
+// In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions
+#define FOPEN_FUNC(filename, mode) fopen(filename, mode)
+#define FTELLO_FUNC(stream) ftello(stream)
+#define FSEEKO_FUNC(stream, offset, origin) fseeko(stream, offset, origin)
+#else
+#define FOPEN_FUNC(filename, mode) fopen64(filename, mode)
+#define FTELLO_FUNC(stream) ftello64(stream)
+#define FSEEKO_FUNC(stream, offset, origin) fseeko64(stream, offset, origin)
+#endif
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <errno.h>
+#include <fcntl.h>
+
+#ifdef _WIN32
+# include <direct.h>
+# include <io.h>
+#else
+# include <unistd.h>
+# include <utime.h>
+#endif
+
+
+#include "unzip.h"
+
+#define CASESENSITIVITY (0)
+#define WRITEBUFFERSIZE (8192)
+#define MAXFILENAME (256)
+
+#ifdef _WIN32
+#define USEWIN32IOAPI
+#include "iowin32.h"
+#endif
+/*
+ mini unzip, demo of unzip package
+
+ usage :
+ Usage : miniunz [-exvlo] file.zip [file_to_extract] [-d extractdir]
+
+ list the file in the zipfile, and print the content of FILE_ID.ZIP or README.TXT
+ if it exists
+*/
+
+
+/* change_file_date : change the date/time of a file
+ filename : the filename of the file where date/time must be modified
+ dosdate : the new date at the MSDos format (4 bytes)
+ tmu_date : the SAME new date at the tm_unz format */
+void change_file_date(filename,dosdate,tmu_date)
+ const char *filename;
+ uLong dosdate;
+ tm_unz tmu_date;
+{
+#ifdef _WIN32
+ HANDLE hFile;
+ FILETIME ftm,ftLocal,ftCreate,ftLastAcc,ftLastWrite;
+
+ hFile = CreateFileA(filename,GENERIC_READ | GENERIC_WRITE,
+ 0,NULL,OPEN_EXISTING,0,NULL);
+ GetFileTime(hFile,&ftCreate,&ftLastAcc,&ftLastWrite);
+ DosDateTimeToFileTime((WORD)(dosdate>>16),(WORD)dosdate,&ftLocal);
+ LocalFileTimeToFileTime(&ftLocal,&ftm);
+ SetFileTime(hFile,&ftm,&ftLastAcc,&ftm);
+ CloseHandle(hFile);
+#else
+#ifdef unix || __APPLE__
+ struct utimbuf ut;
+ struct tm newdate;
+ newdate.tm_sec = tmu_date.tm_sec;
+ newdate.tm_min=tmu_date.tm_min;
+ newdate.tm_hour=tmu_date.tm_hour;
+ newdate.tm_mday=tmu_date.tm_mday;
+ newdate.tm_mon=tmu_date.tm_mon;
+ if (tmu_date.tm_year > 1900)
+ newdate.tm_year=tmu_date.tm_year - 1900;
+ else
+ newdate.tm_year=tmu_date.tm_year ;
+ newdate.tm_isdst=-1;
+
+ ut.actime=ut.modtime=mktime(&newdate);
+ utime(filename,&ut);
+#endif
+#endif
+}
+
+
+/* mymkdir and change_file_date are not 100 % portable
+ As I don't know well Unix, I wait feedback for the unix portion */
+
+int mymkdir(dirname)
+ const char* dirname;
+{
+ int ret=0;
+#ifdef _WIN32
+ ret = _mkdir(dirname);
+#elif unix
+ ret = mkdir (dirname,0775);
+#elif __APPLE__
+ ret = mkdir (dirname,0775);
+#endif
+ return ret;
+}
+
+int makedir (newdir)
+ char *newdir;
+{
+ char *buffer ;
+ char *p;
+ int len = (int)strlen(newdir);
+
+ if (len <= 0)
+ return 0;
+
+ buffer = (char*)malloc(len+1);
+ if (buffer==NULL)
+ {
+ printf("Error allocating memory\n");
+ return UNZ_INTERNALERROR;
+ }
+ strcpy(buffer,newdir);
+
+ if (buffer[len-1] == '/') {
+ buffer[len-1] = '\0';
+ }
+ if (mymkdir(buffer) == 0)
+ {
+ free(buffer);
+ return 1;
+ }
+
+ p = buffer+1;
+ while (1)
+ {
+ char hold;
+
+ while(*p && *p != '\\' && *p != '/')
+ p++;
+ hold = *p;
+ *p = 0;
+ if ((mymkdir(buffer) == -1) && (errno == ENOENT))
+ {
+ printf("couldn't create directory %s\n",buffer);
+ free(buffer);
+ return 0;
+ }
+ if (hold == 0)
+ break;
+ *p++ = hold;
+ }
+ free(buffer);
+ return 1;
+}
+
+void do_banner()
+{
+ printf("MiniUnz 1.01b, demo of zLib + Unz package written by Gilles Vollant\n");
+ printf("more info at http://www.winimage.com/zLibDll/unzip.html\n\n");
+}
+
+void do_help()
+{
+ printf("Usage : miniunz [-e] [-x] [-v] [-l] [-o] [-p password] file.zip [file_to_extr.] [-d extractdir]\n\n" \
+ " -e Extract without pathname (junk paths)\n" \
+ " -x Extract with pathname\n" \
+ " -v list files\n" \
+ " -l list files\n" \
+ " -d directory to extract into\n" \
+ " -o overwrite files without prompting\n" \
+ " -p extract crypted file using password\n\n");
+}
+
+void Display64BitsSize(ZPOS64_T n, int size_char)
+{
+ /* to avoid compatibility problem , we do here the conversion */
+ char number[21];
+ int offset=19;
+ int pos_string = 19;
+ number[20]=0;
+ for (;;) {
+ number[offset]=(char)((n%10)+'0');
+ if (number[offset] != '0')
+ pos_string=offset;
+ n/=10;
+ if (offset==0)
+ break;
+ offset--;
+ }
+ {
+ int size_display_string = 19-pos_string;
+ while (size_char > size_display_string)
+ {
+ size_char--;
+ printf(" ");
+ }
+ }
+
+ printf("%s",&number[pos_string]);
+}
+
+int do_list(uf)
+ unzFile uf;
+{
+ uLong i;
+ unz_global_info64 gi;
+ int err;
+
+ err = unzGetGlobalInfo64(uf,&gi);
+ if (err!=UNZ_OK)
+ printf("error %d with zipfile in unzGetGlobalInfo \n",err);
+ printf(" Length Method Size Ratio Date Time CRC-32 Name\n");
+ printf(" ------ ------ ---- ----- ---- ---- ------ ----\n");
+ for (i=0;i<gi.number_entry;i++)
+ {
+ char filename_inzip[256];
+ unz_file_info64 file_info;
+ uLong ratio=0;
+ const char *string_method;
+ char charCrypt=' ';
+ err = unzGetCurrentFileInfo64(uf,&file_info,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0);
+ if (err!=UNZ_OK)
+ {
+ printf("error %d with zipfile in unzGetCurrentFileInfo\n",err);
+ break;
+ }
+ if (file_info.uncompressed_size>0)
+ ratio = (uLong)((file_info.compressed_size*100)/file_info.uncompressed_size);
+
+ /* display a '*' if the file is crypted */
+ if ((file_info.flag & 1) != 0)
+ charCrypt='*';
+
+ if (file_info.compression_method==0)
+ string_method="Stored";
+ else
+ if (file_info.compression_method==Z_DEFLATED)
+ {
+ uInt iLevel=(uInt)((file_info.flag & 0x6)/2);
+ if (iLevel==0)
+ string_method="Defl:N";
+ else if (iLevel==1)
+ string_method="Defl:X";
+ else if ((iLevel==2) || (iLevel==3))
+ string_method="Defl:F"; /* 2:fast , 3 : extra fast*/
+ }
+ else
+ if (file_info.compression_method==Z_BZIP2ED)
+ {
+ string_method="BZip2 ";
+ }
+ else
+ string_method="Unkn. ";
+
+ Display64BitsSize(file_info.uncompressed_size,7);
+ printf(" %6s%c",string_method,charCrypt);
+ Display64BitsSize(file_info.compressed_size,7);
+ printf(" %3lu%% %2.2lu-%2.2lu-%2.2lu %2.2lu:%2.2lu %8.8lx %s\n",
+ ratio,
+ (uLong)file_info.tmu_date.tm_mon + 1,
+ (uLong)file_info.tmu_date.tm_mday,
+ (uLong)file_info.tmu_date.tm_year % 100,
+ (uLong)file_info.tmu_date.tm_hour,(uLong)file_info.tmu_date.tm_min,
+ (uLong)file_info.crc,filename_inzip);
+ if ((i+1)<gi.number_entry)
+ {
+ err = unzGoToNextFile(uf);
+ if (err!=UNZ_OK)
+ {
+ printf("error %d with zipfile in unzGoToNextFile\n",err);
+ break;
+ }
+ }
+ }
+
+ return 0;
+}
+
+
+int do_extract_currentfile(uf,popt_extract_without_path,popt_overwrite,password)
+ unzFile uf;
+ const int* popt_extract_without_path;
+ int* popt_overwrite;
+ const char* password;
+{
+ char filename_inzip[256];
+ char* filename_withoutpath;
+ char* p;
+ int err=UNZ_OK;
+ FILE *fout=NULL;
+ void* buf;
+ uInt size_buf;
+
+ unz_file_info64 file_info;
+ uLong ratio=0;
+ err = unzGetCurrentFileInfo64(uf,&file_info,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0);
+
+ if (err!=UNZ_OK)
+ {
+ printf("error %d with zipfile in unzGetCurrentFileInfo\n",err);
+ return err;
+ }
+
+ size_buf = WRITEBUFFERSIZE;
+ buf = (void*)malloc(size_buf);
+ if (buf==NULL)
+ {
+ printf("Error allocating memory\n");
+ return UNZ_INTERNALERROR;
+ }
+
+ p = filename_withoutpath = filename_inzip;
+ while ((*p) != '\0')
+ {
+ if (((*p)=='/') || ((*p)=='\\'))
+ filename_withoutpath = p+1;
+ p++;
+ }
+
+ if ((*filename_withoutpath)=='\0')
+ {
+ if ((*popt_extract_without_path)==0)
+ {
+ printf("creating directory: %s\n",filename_inzip);
+ mymkdir(filename_inzip);
+ }
+ }
+ else
+ {
+ const char* write_filename;
+ int skip=0;
+
+ if ((*popt_extract_without_path)==0)
+ write_filename = filename_inzip;
+ else
+ write_filename = filename_withoutpath;
+
+ err = unzOpenCurrentFilePassword(uf,password);
+ if (err!=UNZ_OK)
+ {
+ printf("error %d with zipfile in unzOpenCurrentFilePassword\n",err);
+ }
+
+ if (((*popt_overwrite)==0) && (err==UNZ_OK))
+ {
+ char rep=0;
+ FILE* ftestexist;
+ ftestexist = FOPEN_FUNC(write_filename,"rb");
+ if (ftestexist!=NULL)
+ {
+ fclose(ftestexist);
+ do
+ {
+ char answer[128];
+ int ret;
+
+ printf("The file %s exists. Overwrite ? [y]es, [n]o, [A]ll: ",write_filename);
+ ret = scanf("%1s",answer);
+ if (ret != 1)
+ {
+ exit(EXIT_FAILURE);
+ }
+ rep = answer[0] ;
+ if ((rep>='a') && (rep<='z'))
+ rep -= 0x20;
+ }
+ while ((rep!='Y') && (rep!='N') && (rep!='A'));
+ }
+
+ if (rep == 'N')
+ skip = 1;
+
+ if (rep == 'A')
+ *popt_overwrite=1;
+ }
+
+ if ((skip==0) && (err==UNZ_OK))
+ {
+ fout=FOPEN_FUNC(write_filename,"wb");
+ /* some zipfile don't contain directory alone before file */
+ if ((fout==NULL) && ((*popt_extract_without_path)==0) &&
+ (filename_withoutpath!=(char*)filename_inzip))
+ {
+ char c=*(filename_withoutpath-1);
+ *(filename_withoutpath-1)='\0';
+ makedir(write_filename);
+ *(filename_withoutpath-1)=c;
+ fout=FOPEN_FUNC(write_filename,"wb");
+ }
+
+ if (fout==NULL)
+ {
+ printf("error opening %s\n",write_filename);
+ }
+ }
+
+ if (fout!=NULL)
+ {
+ printf(" extracting: %s\n",write_filename);
+
+ do
+ {
+ err = unzReadCurrentFile(uf,buf,size_buf);
+ if (err<0)
+ {
+ printf("error %d with zipfile in unzReadCurrentFile\n",err);
+ break;
+ }
+ if (err>0)
+ if (fwrite(buf,err,1,fout)!=1)
+ {
+ printf("error in writing extracted file\n");
+ err=UNZ_ERRNO;
+ break;
+ }
+ }
+ while (err>0);
+ if (fout)
+ fclose(fout);
+
+ if (err==0)
+ change_file_date(write_filename,file_info.dosDate,
+ file_info.tmu_date);
+ }
+
+ if (err==UNZ_OK)
+ {
+ err = unzCloseCurrentFile (uf);
+ if (err!=UNZ_OK)
+ {
+ printf("error %d with zipfile in unzCloseCurrentFile\n",err);
+ }
+ }
+ else
+ unzCloseCurrentFile(uf); /* don't lose the error */
+ }
+
+ free(buf);
+ return err;
+}
+
+
+int do_extract(uf,opt_extract_without_path,opt_overwrite,password)
+ unzFile uf;
+ int opt_extract_without_path;
+ int opt_overwrite;
+ const char* password;
+{
+ uLong i;
+ unz_global_info64 gi;
+ int err;
+ FILE* fout=NULL;
+
+ err = unzGetGlobalInfo64(uf,&gi);
+ if (err!=UNZ_OK)
+ printf("error %d with zipfile in unzGetGlobalInfo \n",err);
+
+ for (i=0;i<gi.number_entry;i++)
+ {
+ if (do_extract_currentfile(uf,&opt_extract_without_path,
+ &opt_overwrite,
+ password) != UNZ_OK)
+ break;
+
+ if ((i+1)<gi.number_entry)
+ {
+ err = unzGoToNextFile(uf);
+ if (err!=UNZ_OK)
+ {
+ printf("error %d with zipfile in unzGoToNextFile\n",err);
+ break;
+ }
+ }
+ }
+
+ return 0;
+}
+
+int do_extract_onefile(uf,filename,opt_extract_without_path,opt_overwrite,password)
+ unzFile uf;
+ const char* filename;
+ int opt_extract_without_path;
+ int opt_overwrite;
+ const char* password;
+{
+ int err = UNZ_OK;
+ if (unzLocateFile(uf,filename,CASESENSITIVITY)!=UNZ_OK)
+ {
+ printf("file %s not found in the zipfile\n",filename);
+ return 2;
+ }
+
+ if (do_extract_currentfile(uf,&opt_extract_without_path,
+ &opt_overwrite,
+ password) == UNZ_OK)
+ return 0;
+ else
+ return 1;
+}
+
+
+int main(argc,argv)
+ int argc;
+ char *argv[];
+{
+ const char *zipfilename=NULL;
+ const char *filename_to_extract=NULL;
+ const char *password=NULL;
+ char filename_try[MAXFILENAME+16] = "";
+ int i;
+ int ret_value=0;
+ int opt_do_list=0;
+ int opt_do_extract=1;
+ int opt_do_extract_withoutpath=0;
+ int opt_overwrite=0;
+ int opt_extractdir=0;
+ const char *dirname=NULL;
+ unzFile uf=NULL;
+
+ do_banner();
+ if (argc==1)
+ {
+ do_help();
+ return 0;
+ }
+ else
+ {
+ for (i=1;i<argc;i++)
+ {
+ if ((*argv[i])=='-')
+ {
+ const char *p=argv[i]+1;
+
+ while ((*p)!='\0')
+ {
+ char c=*(p++);;
+ if ((c=='l') || (c=='L'))
+ opt_do_list = 1;
+ if ((c=='v') || (c=='V'))
+ opt_do_list = 1;
+ if ((c=='x') || (c=='X'))
+ opt_do_extract = 1;
+ if ((c=='e') || (c=='E'))
+ opt_do_extract = opt_do_extract_withoutpath = 1;
+ if ((c=='o') || (c=='O'))
+ opt_overwrite=1;
+ if ((c=='d') || (c=='D'))
+ {
+ opt_extractdir=1;
+ dirname=argv[i+1];
+ }
+
+ if (((c=='p') || (c=='P')) && (i+1<argc))
+ {
+ password=argv[i+1];
+ i++;
+ }
+ }
+ }
+ else
+ {
+ if (zipfilename == NULL)
+ zipfilename = argv[i];
+ else if ((filename_to_extract==NULL) && (!opt_extractdir))
+ filename_to_extract = argv[i] ;
+ }
+ }
+ }
+
+ if (zipfilename!=NULL)
+ {
+
+# ifdef USEWIN32IOAPI
+ zlib_filefunc64_def ffunc;
+# endif
+
+ strncpy(filename_try, zipfilename,MAXFILENAME-1);
+ /* strncpy doesnt append the trailing NULL, of the string is too long. */
+ filename_try[ MAXFILENAME ] = '\0';
+
+# ifdef USEWIN32IOAPI
+ fill_win32_filefunc64A(&ffunc);
+ uf = unzOpen2_64(zipfilename,&ffunc);
+# else
+ uf = unzOpen64(zipfilename);
+# endif
+ if (uf==NULL)
+ {
+ strcat(filename_try,".zip");
+# ifdef USEWIN32IOAPI
+ uf = unzOpen2_64(filename_try,&ffunc);
+# else
+ uf = unzOpen64(filename_try);
+# endif
+ }
+ }
+
+ if (uf==NULL)
+ {
+ printf("Cannot open %s or %s.zip\n",zipfilename,zipfilename);
+ return 1;
+ }
+ printf("%s opened\n",filename_try);
+
+ if (opt_do_list==1)
+ ret_value = do_list(uf);
+ else if (opt_do_extract==1)
+ {
+#ifdef _WIN32
+ if (opt_extractdir && _chdir(dirname))
+#else
+ if (opt_extractdir && chdir(dirname))
+#endif
+ {
+ printf("Error changing into %s, aborting\n", dirname);
+ exit(-1);
+ }
+
+ if (filename_to_extract == NULL)
+ ret_value = do_extract(uf, opt_do_extract_withoutpath, opt_overwrite, password);
+ else
+ ret_value = do_extract_onefile(uf, filename_to_extract, opt_do_extract_withoutpath, opt_overwrite, password);
+ }
+
+ unzClose(uf);
+
+ return ret_value;
+}
diff --git a/protocols/Telegram/tgl/zlib/contrib/minizip/miniunzip.1 b/protocols/Telegram/tgl/zlib/contrib/minizip/miniunzip.1
new file mode 100644
index 0000000000..111ac69190
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/minizip/miniunzip.1
@@ -0,0 +1,63 @@
+.\" Hey, EMACS: -*- nroff -*-
+.TH miniunzip 1 "Nov 7, 2001"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh disable hyphenation
+.\" .hy enable hyphenation
+.\" .ad l left justify
+.\" .ad b justify to both left and right margins
+.\" .nf disable filling
+.\" .fi enable filling
+.\" .br insert line break
+.\" .sp <n> insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+miniunzip - uncompress and examine ZIP archives
+.SH SYNOPSIS
+.B miniunzip
+.RI [ -exvlo ]
+zipfile [ files_to_extract ] [-d tempdir]
+.SH DESCRIPTION
+.B minizip
+is a simple tool which allows the extraction of compressed file
+archives in the ZIP format used by the MS-DOS utility PKZIP. It was
+written as a demonstration of the
+.IR zlib (3)
+library and therefore lack many of the features of the
+.IR unzip (1)
+program.
+.SH OPTIONS
+A number of options are supported. With the exception of
+.BI \-d\ tempdir
+these must be supplied before any
+other arguments and are:
+.TP
+.BI \-l\ ,\ \-\-v
+List the files in the archive without extracting them.
+.TP
+.B \-o
+Overwrite files without prompting for confirmation.
+.TP
+.B \-x
+Extract files (default).
+.PP
+The
+.I zipfile
+argument is the name of the archive to process. The next argument can be used
+to specify a single file to extract from the archive.
+
+Lastly, the following option can be specified at the end of the command-line:
+.TP
+.BI \-d\ tempdir
+Extract the archive in the directory
+.I tempdir
+rather than the current directory.
+.SH SEE ALSO
+.BR minizip (1),
+.BR zlib (3),
+.BR unzip (1).
+.SH AUTHOR
+This program was written by Gilles Vollant. This manual page was
+written by Mark Brown <broonie@sirena.org.uk>. The -d tempdir option
+was added by Dirk Eddelbuettel <edd@debian.org>.
diff --git a/protocols/Telegram/tgl/zlib/contrib/minizip/minizip.1 b/protocols/Telegram/tgl/zlib/contrib/minizip/minizip.1
new file mode 100644
index 0000000000..1154484c1c
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/minizip/minizip.1
@@ -0,0 +1,46 @@
+.\" Hey, EMACS: -*- nroff -*-
+.TH minizip 1 "May 2, 2001"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh disable hyphenation
+.\" .hy enable hyphenation
+.\" .ad l left justify
+.\" .ad b justify to both left and right margins
+.\" .nf disable filling
+.\" .fi enable filling
+.\" .br insert line break
+.\" .sp <n> insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+minizip - create ZIP archives
+.SH SYNOPSIS
+.B minizip
+.RI [ -o ]
+zipfile [ " files" ... ]
+.SH DESCRIPTION
+.B minizip
+is a simple tool which allows the creation of compressed file archives
+in the ZIP format used by the MS-DOS utility PKZIP. It was written as
+a demonstration of the
+.IR zlib (3)
+library and therefore lack many of the features of the
+.IR zip (1)
+program.
+.SH OPTIONS
+The first argument supplied is the name of the ZIP archive to create or
+.RI -o
+in which case it is ignored and the second argument treated as the
+name of the ZIP file. If the ZIP file already exists it will be
+overwritten.
+.PP
+Subsequent arguments specify a list of files to place in the ZIP
+archive. If none are specified then an empty archive will be created.
+.SH SEE ALSO
+.BR miniunzip (1),
+.BR zlib (3),
+.BR zip (1).
+.SH AUTHOR
+This program was written by Gilles Vollant. This manual page was
+written by Mark Brown <broonie@sirena.org.uk>.
+
diff --git a/protocols/Telegram/tgl/zlib/contrib/minizip/minizip.c b/protocols/Telegram/tgl/zlib/contrib/minizip/minizip.c
new file mode 100644
index 0000000000..4288962ece
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/minizip/minizip.c
@@ -0,0 +1,520 @@
+/*
+ minizip.c
+ Version 1.1, February 14h, 2010
+ sample part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
+
+ Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
+
+ Modifications of Unzip for Zip64
+ Copyright (C) 2007-2008 Even Rouault
+
+ Modifications for Zip64 support on both zip and unzip
+ Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
+*/
+
+
+#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__))
+ #ifndef __USE_FILE_OFFSET64
+ #define __USE_FILE_OFFSET64
+ #endif
+ #ifndef __USE_LARGEFILE64
+ #define __USE_LARGEFILE64
+ #endif
+ #ifndef _LARGEFILE64_SOURCE
+ #define _LARGEFILE64_SOURCE
+ #endif
+ #ifndef _FILE_OFFSET_BIT
+ #define _FILE_OFFSET_BIT 64
+ #endif
+#endif
+
+#ifdef __APPLE__
+// In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions
+#define FOPEN_FUNC(filename, mode) fopen(filename, mode)
+#define FTELLO_FUNC(stream) ftello(stream)
+#define FSEEKO_FUNC(stream, offset, origin) fseeko(stream, offset, origin)
+#else
+#define FOPEN_FUNC(filename, mode) fopen64(filename, mode)
+#define FTELLO_FUNC(stream) ftello64(stream)
+#define FSEEKO_FUNC(stream, offset, origin) fseeko64(stream, offset, origin)
+#endif
+
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <errno.h>
+#include <fcntl.h>
+
+#ifdef _WIN32
+# include <direct.h>
+# include <io.h>
+#else
+# include <unistd.h>
+# include <utime.h>
+# include <sys/types.h>
+# include <sys/stat.h>
+#endif
+
+#include "zip.h"
+
+#ifdef _WIN32
+ #define USEWIN32IOAPI
+ #include "iowin32.h"
+#endif
+
+
+
+#define WRITEBUFFERSIZE (16384)
+#define MAXFILENAME (256)
+
+#ifdef _WIN32
+uLong filetime(f, tmzip, dt)
+ char *f; /* name of file to get info on */
+ tm_zip *tmzip; /* return value: access, modific. and creation times */
+ uLong *dt; /* dostime */
+{
+ int ret = 0;
+ {
+ FILETIME ftLocal;
+ HANDLE hFind;
+ WIN32_FIND_DATAA ff32;
+
+ hFind = FindFirstFileA(f,&ff32);
+ if (hFind != INVALID_HANDLE_VALUE)
+ {
+ FileTimeToLocalFileTime(&(ff32.ftLastWriteTime),&ftLocal);
+ FileTimeToDosDateTime(&ftLocal,((LPWORD)dt)+1,((LPWORD)dt)+0);
+ FindClose(hFind);
+ ret = 1;
+ }
+ }
+ return ret;
+}
+#else
+#ifdef unix || __APPLE__
+uLong filetime(f, tmzip, dt)
+ char *f; /* name of file to get info on */
+ tm_zip *tmzip; /* return value: access, modific. and creation times */
+ uLong *dt; /* dostime */
+{
+ int ret=0;
+ struct stat s; /* results of stat() */
+ struct tm* filedate;
+ time_t tm_t=0;
+
+ if (strcmp(f,"-")!=0)
+ {
+ char name[MAXFILENAME+1];
+ int len = strlen(f);
+ if (len > MAXFILENAME)
+ len = MAXFILENAME;
+
+ strncpy(name, f,MAXFILENAME-1);
+ /* strncpy doesnt append the trailing NULL, of the string is too long. */
+ name[ MAXFILENAME ] = '\0';
+
+ if (name[len - 1] == '/')
+ name[len - 1] = '\0';
+ /* not all systems allow stat'ing a file with / appended */
+ if (stat(name,&s)==0)
+ {
+ tm_t = s.st_mtime;
+ ret = 1;
+ }
+ }
+ filedate = localtime(&tm_t);
+
+ tmzip->tm_sec = filedate->tm_sec;
+ tmzip->tm_min = filedate->tm_min;
+ tmzip->tm_hour = filedate->tm_hour;
+ tmzip->tm_mday = filedate->tm_mday;
+ tmzip->tm_mon = filedate->tm_mon ;
+ tmzip->tm_year = filedate->tm_year;
+
+ return ret;
+}
+#else
+uLong filetime(f, tmzip, dt)
+ char *f; /* name of file to get info on */
+ tm_zip *tmzip; /* return value: access, modific. and creation times */
+ uLong *dt; /* dostime */
+{
+ return 0;
+}
+#endif
+#endif
+
+
+
+
+int check_exist_file(filename)
+ const char* filename;
+{
+ FILE* ftestexist;
+ int ret = 1;
+ ftestexist = FOPEN_FUNC(filename,"rb");
+ if (ftestexist==NULL)
+ ret = 0;
+ else
+ fclose(ftestexist);
+ return ret;
+}
+
+void do_banner()
+{
+ printf("MiniZip 1.1, demo of zLib + MiniZip64 package, written by Gilles Vollant\n");
+ printf("more info on MiniZip at http://www.winimage.com/zLibDll/minizip.html\n\n");
+}
+
+void do_help()
+{
+ printf("Usage : minizip [-o] [-a] [-0 to -9] [-p password] [-j] file.zip [files_to_add]\n\n" \
+ " -o Overwrite existing file.zip\n" \
+ " -a Append to existing file.zip\n" \
+ " -0 Store only\n" \
+ " -1 Compress faster\n" \
+ " -9 Compress better\n\n" \
+ " -j exclude path. store only the file name.\n\n");
+}
+
+/* calculate the CRC32 of a file,
+ because to encrypt a file, we need known the CRC32 of the file before */
+int getFileCrc(const char* filenameinzip,void*buf,unsigned long size_buf,unsigned long* result_crc)
+{
+ unsigned long calculate_crc=0;
+ int err=ZIP_OK;
+ FILE * fin = FOPEN_FUNC(filenameinzip,"rb");
+
+ unsigned long size_read = 0;
+ unsigned long total_read = 0;
+ if (fin==NULL)
+ {
+ err = ZIP_ERRNO;
+ }
+
+ if (err == ZIP_OK)
+ do
+ {
+ err = ZIP_OK;
+ size_read = (int)fread(buf,1,size_buf,fin);
+ if (size_read < size_buf)
+ if (feof(fin)==0)
+ {
+ printf("error in reading %s\n",filenameinzip);
+ err = ZIP_ERRNO;
+ }
+
+ if (size_read>0)
+ calculate_crc = crc32(calculate_crc,buf,size_read);
+ total_read += size_read;
+
+ } while ((err == ZIP_OK) && (size_read>0));
+
+ if (fin)
+ fclose(fin);
+
+ *result_crc=calculate_crc;
+ printf("file %s crc %lx\n", filenameinzip, calculate_crc);
+ return err;
+}
+
+int isLargeFile(const char* filename)
+{
+ int largeFile = 0;
+ ZPOS64_T pos = 0;
+ FILE* pFile = FOPEN_FUNC(filename, "rb");
+
+ if(pFile != NULL)
+ {
+ int n = FSEEKO_FUNC(pFile, 0, SEEK_END);
+ pos = FTELLO_FUNC(pFile);
+
+ printf("File : %s is %lld bytes\n", filename, pos);
+
+ if(pos >= 0xffffffff)
+ largeFile = 1;
+
+ fclose(pFile);
+ }
+
+ return largeFile;
+}
+
+int main(argc,argv)
+ int argc;
+ char *argv[];
+{
+ int i;
+ int opt_overwrite=0;
+ int opt_compress_level=Z_DEFAULT_COMPRESSION;
+ int opt_exclude_path=0;
+ int zipfilenamearg = 0;
+ char filename_try[MAXFILENAME+16];
+ int zipok;
+ int err=0;
+ int size_buf=0;
+ void* buf=NULL;
+ const char* password=NULL;
+
+
+ do_banner();
+ if (argc==1)
+ {
+ do_help();
+ return 0;
+ }
+ else
+ {
+ for (i=1;i<argc;i++)
+ {
+ if ((*argv[i])=='-')
+ {
+ const char *p=argv[i]+1;
+
+ while ((*p)!='\0')
+ {
+ char c=*(p++);;
+ if ((c=='o') || (c=='O'))
+ opt_overwrite = 1;
+ if ((c=='a') || (c=='A'))
+ opt_overwrite = 2;
+ if ((c>='0') && (c<='9'))
+ opt_compress_level = c-'0';
+ if ((c=='j') || (c=='J'))
+ opt_exclude_path = 1;
+
+ if (((c=='p') || (c=='P')) && (i+1<argc))
+ {
+ password=argv[i+1];
+ i++;
+ }
+ }
+ }
+ else
+ {
+ if (zipfilenamearg == 0)
+ {
+ zipfilenamearg = i ;
+ }
+ }
+ }
+ }
+
+ size_buf = WRITEBUFFERSIZE;
+ buf = (void*)malloc(size_buf);
+ if (buf==NULL)
+ {
+ printf("Error allocating memory\n");
+ return ZIP_INTERNALERROR;
+ }
+
+ if (zipfilenamearg==0)
+ {
+ zipok=0;
+ }
+ else
+ {
+ int i,len;
+ int dot_found=0;
+
+ zipok = 1 ;
+ strncpy(filename_try, argv[zipfilenamearg],MAXFILENAME-1);
+ /* strncpy doesnt append the trailing NULL, of the string is too long. */
+ filename_try[ MAXFILENAME ] = '\0';
+
+ len=(int)strlen(filename_try);
+ for (i=0;i<len;i++)
+ if (filename_try[i]=='.')
+ dot_found=1;
+
+ if (dot_found==0)
+ strcat(filename_try,".zip");
+
+ if (opt_overwrite==2)
+ {
+ /* if the file don't exist, we not append file */
+ if (check_exist_file(filename_try)==0)
+ opt_overwrite=1;
+ }
+ else
+ if (opt_overwrite==0)
+ if (check_exist_file(filename_try)!=0)
+ {
+ char rep=0;
+ do
+ {
+ char answer[128];
+ int ret;
+ printf("The file %s exists. Overwrite ? [y]es, [n]o, [a]ppend : ",filename_try);
+ ret = scanf("%1s",answer);
+ if (ret != 1)
+ {
+ exit(EXIT_FAILURE);
+ }
+ rep = answer[0] ;
+ if ((rep>='a') && (rep<='z'))
+ rep -= 0x20;
+ }
+ while ((rep!='Y') && (rep!='N') && (rep!='A'));
+ if (rep=='N')
+ zipok = 0;
+ if (rep=='A')
+ opt_overwrite = 2;
+ }
+ }
+
+ if (zipok==1)
+ {
+ zipFile zf;
+ int errclose;
+# ifdef USEWIN32IOAPI
+ zlib_filefunc64_def ffunc;
+ fill_win32_filefunc64A(&ffunc);
+ zf = zipOpen2_64(filename_try,(opt_overwrite==2) ? 2 : 0,NULL,&ffunc);
+# else
+ zf = zipOpen64(filename_try,(opt_overwrite==2) ? 2 : 0);
+# endif
+
+ if (zf == NULL)
+ {
+ printf("error opening %s\n",filename_try);
+ err= ZIP_ERRNO;
+ }
+ else
+ printf("creating %s\n",filename_try);
+
+ for (i=zipfilenamearg+1;(i<argc) && (err==ZIP_OK);i++)
+ {
+ if (!((((*(argv[i]))=='-') || ((*(argv[i]))=='/')) &&
+ ((argv[i][1]=='o') || (argv[i][1]=='O') ||
+ (argv[i][1]=='a') || (argv[i][1]=='A') ||
+ (argv[i][1]=='p') || (argv[i][1]=='P') ||
+ ((argv[i][1]>='0') || (argv[i][1]<='9'))) &&
+ (strlen(argv[i]) == 2)))
+ {
+ FILE * fin;
+ int size_read;
+ const char* filenameinzip = argv[i];
+ const char *savefilenameinzip;
+ zip_fileinfo zi;
+ unsigned long crcFile=0;
+ int zip64 = 0;
+
+ zi.tmz_date.tm_sec = zi.tmz_date.tm_min = zi.tmz_date.tm_hour =
+ zi.tmz_date.tm_mday = zi.tmz_date.tm_mon = zi.tmz_date.tm_year = 0;
+ zi.dosDate = 0;
+ zi.internal_fa = 0;
+ zi.external_fa = 0;
+ filetime(filenameinzip,&zi.tmz_date,&zi.dosDate);
+
+/*
+ err = zipOpenNewFileInZip(zf,filenameinzip,&zi,
+ NULL,0,NULL,0,NULL / * comment * /,
+ (opt_compress_level != 0) ? Z_DEFLATED : 0,
+ opt_compress_level);
+*/
+ if ((password != NULL) && (err==ZIP_OK))
+ err = getFileCrc(filenameinzip,buf,size_buf,&crcFile);
+
+ zip64 = isLargeFile(filenameinzip);
+
+ /* The path name saved, should not include a leading slash. */
+ /*if it did, windows/xp and dynazip couldn't read the zip file. */
+ savefilenameinzip = filenameinzip;
+ while( savefilenameinzip[0] == '\\' || savefilenameinzip[0] == '/' )
+ {
+ savefilenameinzip++;
+ }
+
+ /*should the zip file contain any path at all?*/
+ if( opt_exclude_path )
+ {
+ const char *tmpptr;
+ const char *lastslash = 0;
+ for( tmpptr = savefilenameinzip; *tmpptr; tmpptr++)
+ {
+ if( *tmpptr == '\\' || *tmpptr == '/')
+ {
+ lastslash = tmpptr;
+ }
+ }
+ if( lastslash != NULL )
+ {
+ savefilenameinzip = lastslash+1; // base filename follows last slash.
+ }
+ }
+
+ /**/
+ err = zipOpenNewFileInZip3_64(zf,savefilenameinzip,&zi,
+ NULL,0,NULL,0,NULL /* comment*/,
+ (opt_compress_level != 0) ? Z_DEFLATED : 0,
+ opt_compress_level,0,
+ /* -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, */
+ -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY,
+ password,crcFile, zip64);
+
+ if (err != ZIP_OK)
+ printf("error in opening %s in zipfile\n",filenameinzip);
+ else
+ {
+ fin = FOPEN_FUNC(filenameinzip,"rb");
+ if (fin==NULL)
+ {
+ err=ZIP_ERRNO;
+ printf("error in opening %s for reading\n",filenameinzip);
+ }
+ }
+
+ if (err == ZIP_OK)
+ do
+ {
+ err = ZIP_OK;
+ size_read = (int)fread(buf,1,size_buf,fin);
+ if (size_read < size_buf)
+ if (feof(fin)==0)
+ {
+ printf("error in reading %s\n",filenameinzip);
+ err = ZIP_ERRNO;
+ }
+
+ if (size_read>0)
+ {
+ err = zipWriteInFileInZip (zf,buf,size_read);
+ if (err<0)
+ {
+ printf("error in writing %s in the zipfile\n",
+ filenameinzip);
+ }
+
+ }
+ } while ((err == ZIP_OK) && (size_read>0));
+
+ if (fin)
+ fclose(fin);
+
+ if (err<0)
+ err=ZIP_ERRNO;
+ else
+ {
+ err = zipCloseFileInZip(zf);
+ if (err!=ZIP_OK)
+ printf("error in closing %s in the zipfile\n",
+ filenameinzip);
+ }
+ }
+ }
+ errclose = zipClose(zf,NULL);
+ if (errclose != ZIP_OK)
+ printf("error in closing %s\n",filename_try);
+ }
+ else
+ {
+ do_help();
+ }
+
+ free(buf);
+ return 0;
+}
diff --git a/protocols/Telegram/tgl/zlib/contrib/minizip/minizip.pc.in b/protocols/Telegram/tgl/zlib/contrib/minizip/minizip.pc.in
new file mode 100644
index 0000000000..69b5b7fdcb
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/minizip/minizip.pc.in
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@/minizip
+
+Name: minizip
+Description: Minizip zip file manipulation library
+Requires:
+Version: @PACKAGE_VERSION@
+Libs: -L${libdir} -lminizip
+Libs.private: -lz
+Cflags: -I${includedir}
diff --git a/protocols/Telegram/tgl/zlib/contrib/minizip/mztools.c b/protocols/Telegram/tgl/zlib/contrib/minizip/mztools.c
new file mode 100644
index 0000000000..96891c2e0b
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/minizip/mztools.c
@@ -0,0 +1,291 @@
+/*
+ Additional tools for Minizip
+ Code: Xavier Roche '2004
+ License: Same as ZLIB (www.gzip.org)
+*/
+
+/* Code */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "zlib.h"
+#include "unzip.h"
+
+#define READ_8(adr) ((unsigned char)*(adr))
+#define READ_16(adr) ( READ_8(adr) | (READ_8(adr+1) << 8) )
+#define READ_32(adr) ( READ_16(adr) | (READ_16((adr)+2) << 16) )
+
+#define WRITE_8(buff, n) do { \
+ *((unsigned char*)(buff)) = (unsigned char) ((n) & 0xff); \
+} while(0)
+#define WRITE_16(buff, n) do { \
+ WRITE_8((unsigned char*)(buff), n); \
+ WRITE_8(((unsigned char*)(buff)) + 1, (n) >> 8); \
+} while(0)
+#define WRITE_32(buff, n) do { \
+ WRITE_16((unsigned char*)(buff), (n) & 0xffff); \
+ WRITE_16((unsigned char*)(buff) + 2, (n) >> 16); \
+} while(0)
+
+extern int ZEXPORT unzRepair(file, fileOut, fileOutTmp, nRecovered, bytesRecovered)
+const char* file;
+const char* fileOut;
+const char* fileOutTmp;
+uLong* nRecovered;
+uLong* bytesRecovered;
+{
+ int err = Z_OK;
+ FILE* fpZip = fopen(file, "rb");
+ FILE* fpOut = fopen(fileOut, "wb");
+ FILE* fpOutCD = fopen(fileOutTmp, "wb");
+ if (fpZip != NULL && fpOut != NULL) {
+ int entries = 0;
+ uLong totalBytes = 0;
+ char header[30];
+ char filename[1024];
+ char extra[1024];
+ int offset = 0;
+ int offsetCD = 0;
+ while ( fread(header, 1, 30, fpZip) == 30 ) {
+ int currentOffset = offset;
+
+ /* File entry */
+ if (READ_32(header) == 0x04034b50) {
+ unsigned int version = READ_16(header + 4);
+ unsigned int gpflag = READ_16(header + 6);
+ unsigned int method = READ_16(header + 8);
+ unsigned int filetime = READ_16(header + 10);
+ unsigned int filedate = READ_16(header + 12);
+ unsigned int crc = READ_32(header + 14); /* crc */
+ unsigned int cpsize = READ_32(header + 18); /* compressed size */
+ unsigned int uncpsize = READ_32(header + 22); /* uncompressed sz */
+ unsigned int fnsize = READ_16(header + 26); /* file name length */
+ unsigned int extsize = READ_16(header + 28); /* extra field length */
+ filename[0] = extra[0] = '\0';
+
+ /* Header */
+ if (fwrite(header, 1, 30, fpOut) == 30) {
+ offset += 30;
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+
+ /* Filename */
+ if (fnsize > 0) {
+ if (fnsize < sizeof(filename)) {
+ if (fread(filename, 1, fnsize, fpZip) == fnsize) {
+ if (fwrite(filename, 1, fnsize, fpOut) == fnsize) {
+ offset += fnsize;
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ } else {
+ err = Z_STREAM_ERROR;
+ break;
+ }
+
+ /* Extra field */
+ if (extsize > 0) {
+ if (extsize < sizeof(extra)) {
+ if (fread(extra, 1, extsize, fpZip) == extsize) {
+ if (fwrite(extra, 1, extsize, fpOut) == extsize) {
+ offset += extsize;
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ }
+
+ /* Data */
+ {
+ int dataSize = cpsize;
+ if (dataSize == 0) {
+ dataSize = uncpsize;
+ }
+ if (dataSize > 0) {
+ char* data = malloc(dataSize);
+ if (data != NULL) {
+ if ((int)fread(data, 1, dataSize, fpZip) == dataSize) {
+ if ((int)fwrite(data, 1, dataSize, fpOut) == dataSize) {
+ offset += dataSize;
+ totalBytes += dataSize;
+ } else {
+ err = Z_ERRNO;
+ }
+ } else {
+ err = Z_ERRNO;
+ }
+ free(data);
+ if (err != Z_OK) {
+ break;
+ }
+ } else {
+ err = Z_MEM_ERROR;
+ break;
+ }
+ }
+ }
+
+ /* Central directory entry */
+ {
+ char header[46];
+ char* comment = "";
+ int comsize = (int) strlen(comment);
+ WRITE_32(header, 0x02014b50);
+ WRITE_16(header + 4, version);
+ WRITE_16(header + 6, version);
+ WRITE_16(header + 8, gpflag);
+ WRITE_16(header + 10, method);
+ WRITE_16(header + 12, filetime);
+ WRITE_16(header + 14, filedate);
+ WRITE_32(header + 16, crc);
+ WRITE_32(header + 20, cpsize);
+ WRITE_32(header + 24, uncpsize);
+ WRITE_16(header + 28, fnsize);
+ WRITE_16(header + 30, extsize);
+ WRITE_16(header + 32, comsize);
+ WRITE_16(header + 34, 0); /* disk # */
+ WRITE_16(header + 36, 0); /* int attrb */
+ WRITE_32(header + 38, 0); /* ext attrb */
+ WRITE_32(header + 42, currentOffset);
+ /* Header */
+ if (fwrite(header, 1, 46, fpOutCD) == 46) {
+ offsetCD += 46;
+
+ /* Filename */
+ if (fnsize > 0) {
+ if (fwrite(filename, 1, fnsize, fpOutCD) == fnsize) {
+ offsetCD += fnsize;
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ } else {
+ err = Z_STREAM_ERROR;
+ break;
+ }
+
+ /* Extra field */
+ if (extsize > 0) {
+ if (fwrite(extra, 1, extsize, fpOutCD) == extsize) {
+ offsetCD += extsize;
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ }
+
+ /* Comment field */
+ if (comsize > 0) {
+ if ((int)fwrite(comment, 1, comsize, fpOutCD) == comsize) {
+ offsetCD += comsize;
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ }
+
+
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ }
+
+ /* Success */
+ entries++;
+
+ } else {
+ break;
+ }
+ }
+
+ /* Final central directory */
+ {
+ int entriesZip = entries;
+ char header[22];
+ char* comment = ""; // "ZIP File recovered by zlib/minizip/mztools";
+ int comsize = (int) strlen(comment);
+ if (entriesZip > 0xffff) {
+ entriesZip = 0xffff;
+ }
+ WRITE_32(header, 0x06054b50);
+ WRITE_16(header + 4, 0); /* disk # */
+ WRITE_16(header + 6, 0); /* disk # */
+ WRITE_16(header + 8, entriesZip); /* hack */
+ WRITE_16(header + 10, entriesZip); /* hack */
+ WRITE_32(header + 12, offsetCD); /* size of CD */
+ WRITE_32(header + 16, offset); /* offset to CD */
+ WRITE_16(header + 20, comsize); /* comment */
+
+ /* Header */
+ if (fwrite(header, 1, 22, fpOutCD) == 22) {
+
+ /* Comment field */
+ if (comsize > 0) {
+ if ((int)fwrite(comment, 1, comsize, fpOutCD) != comsize) {
+ err = Z_ERRNO;
+ }
+ }
+
+ } else {
+ err = Z_ERRNO;
+ }
+ }
+
+ /* Final merge (file + central directory) */
+ fclose(fpOutCD);
+ if (err == Z_OK) {
+ fpOutCD = fopen(fileOutTmp, "rb");
+ if (fpOutCD != NULL) {
+ int nRead;
+ char buffer[8192];
+ while ( (nRead = (int)fread(buffer, 1, sizeof(buffer), fpOutCD)) > 0) {
+ if ((int)fwrite(buffer, 1, nRead, fpOut) != nRead) {
+ err = Z_ERRNO;
+ break;
+ }
+ }
+ fclose(fpOutCD);
+ }
+ }
+
+ /* Close */
+ fclose(fpZip);
+ fclose(fpOut);
+
+ /* Wipe temporary file */
+ (void)remove(fileOutTmp);
+
+ /* Number of recovered entries */
+ if (err == Z_OK) {
+ if (nRecovered != NULL) {
+ *nRecovered = entries;
+ }
+ if (bytesRecovered != NULL) {
+ *bytesRecovered = totalBytes;
+ }
+ }
+ } else {
+ err = Z_STREAM_ERROR;
+ }
+ return err;
+}
diff --git a/protocols/Telegram/tgl/zlib/contrib/minizip/mztools.h b/protocols/Telegram/tgl/zlib/contrib/minizip/mztools.h
new file mode 100644
index 0000000000..a49a426ec2
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/minizip/mztools.h
@@ -0,0 +1,37 @@
+/*
+ Additional tools for Minizip
+ Code: Xavier Roche '2004
+ License: Same as ZLIB (www.gzip.org)
+*/
+
+#ifndef _zip_tools_H
+#define _zip_tools_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _ZLIB_H
+#include "zlib.h"
+#endif
+
+#include "unzip.h"
+
+/* Repair a ZIP file (missing central directory)
+ file: file to recover
+ fileOut: output file after recovery
+ fileOutTmp: temporary file name used for recovery
+*/
+extern int ZEXPORT unzRepair(const char* file,
+ const char* fileOut,
+ const char* fileOutTmp,
+ uLong* nRecovered,
+ uLong* bytesRecovered);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/protocols/Telegram/tgl/zlib/contrib/minizip/unzip.c b/protocols/Telegram/tgl/zlib/contrib/minizip/unzip.c
new file mode 100644
index 0000000000..909350435a
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/minizip/unzip.c
@@ -0,0 +1,2125 @@
+/* unzip.c -- IO for uncompress .zip files using zlib
+ Version 1.1, February 14h, 2010
+ part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
+
+ Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
+
+ Modifications of Unzip for Zip64
+ Copyright (C) 2007-2008 Even Rouault
+
+ Modifications for Zip64 support on both zip and unzip
+ Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
+
+ For more info read MiniZip_info.txt
+
+
+ ------------------------------------------------------------------------------------
+ Decryption code comes from crypt.c by Info-ZIP but has been greatly reduced in terms of
+ compatibility with older software. The following is from the original crypt.c.
+ Code woven in by Terry Thorsen 1/2003.
+
+ Copyright (c) 1990-2000 Info-ZIP. All rights reserved.
+
+ See the accompanying file LICENSE, version 2000-Apr-09 or later
+ (the contents of which are also included in zip.h) for terms of use.
+ If, for some reason, all these files are missing, the Info-ZIP license
+ also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html
+
+ crypt.c (full version) by Info-ZIP. Last revised: [see crypt.h]
+
+ The encryption/decryption parts of this source code (as opposed to the
+ non-echoing password parts) were originally written in Europe. The
+ whole source package can be freely distributed, including from the USA.
+ (Prior to January 2000, re-export from the US was a violation of US law.)
+
+ This encryption code is a direct transcription of the algorithm from
+ Roger Schlafly, described by Phil Katz in the file appnote.txt. This
+ file (appnote.txt) is distributed with the PKZIP program (even in the
+ version without encryption capabilities).
+
+ ------------------------------------------------------------------------------------
+
+ Changes in unzip.c
+
+ 2007-2008 - Even Rouault - Addition of cpl_unzGetCurrentFileZStreamPos
+ 2007-2008 - Even Rouault - Decoration of symbol names unz* -> cpl_unz*
+ 2007-2008 - Even Rouault - Remove old C style function prototypes
+ 2007-2008 - Even Rouault - Add unzip support for ZIP64
+
+ Copyright (C) 2007-2008 Even Rouault
+
+
+ Oct-2009 - Mathias Svensson - Removed cpl_* from symbol names (Even Rouault added them but since this is now moved to a new project (minizip64) I renamed them again).
+ Oct-2009 - Mathias Svensson - Fixed problem if uncompressed size was > 4G and compressed size was <4G
+ should only read the compressed/uncompressed size from the Zip64 format if
+ the size from normal header was 0xFFFFFFFF
+ Oct-2009 - Mathias Svensson - Applied some bug fixes from paches recived from Gilles Vollant
+ Oct-2009 - Mathias Svensson - Applied support to unzip files with compression mathod BZIP2 (bzip2 lib is required)
+ Patch created by Daniel Borca
+
+ Jan-2010 - back to unzip and minizip 1.0 name scheme, with compatibility layer
+
+ Copyright (C) 1998 - 2010 Gilles Vollant, Even Rouault, Mathias Svensson
+
+*/
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifndef NOUNCRYPT
+ #define NOUNCRYPT
+#endif
+
+#include "zlib.h"
+#include "unzip.h"
+
+#ifdef STDC
+# include <stddef.h>
+# include <string.h>
+# include <stdlib.h>
+#endif
+#ifdef NO_ERRNO_H
+ extern int errno;
+#else
+# include <errno.h>
+#endif
+
+
+#ifndef local
+# define local static
+#endif
+/* compile with -Dlocal if your debugger can't find static symbols */
+
+
+#ifndef CASESENSITIVITYDEFAULT_NO
+# if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES)
+# define CASESENSITIVITYDEFAULT_NO
+# endif
+#endif
+
+
+#ifndef UNZ_BUFSIZE
+#define UNZ_BUFSIZE (16384)
+#endif
+
+#ifndef UNZ_MAXFILENAMEINZIP
+#define UNZ_MAXFILENAMEINZIP (256)
+#endif
+
+#ifndef ALLOC
+# define ALLOC(size) (malloc(size))
+#endif
+#ifndef TRYFREE
+# define TRYFREE(p) {if (p) free(p);}
+#endif
+
+#define SIZECENTRALDIRITEM (0x2e)
+#define SIZEZIPLOCALHEADER (0x1e)
+
+
+const char unz_copyright[] =
+ " unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll";
+
+/* unz_file_info_interntal contain internal info about a file in zipfile*/
+typedef struct unz_file_info64_internal_s
+{
+ ZPOS64_T offset_curfile;/* relative offset of local header 8 bytes */
+} unz_file_info64_internal;
+
+
+/* file_in_zip_read_info_s contain internal information about a file in zipfile,
+ when reading and decompress it */
+typedef struct
+{
+ char *read_buffer; /* internal buffer for compressed data */
+ z_stream stream; /* zLib stream structure for inflate */
+
+#ifdef HAVE_BZIP2
+ bz_stream bstream; /* bzLib stream structure for bziped */
+#endif
+
+ ZPOS64_T pos_in_zipfile; /* position in byte on the zipfile, for fseek*/
+ uLong stream_initialised; /* flag set if stream structure is initialised*/
+
+ ZPOS64_T offset_local_extrafield;/* offset of the local extra field */
+ uInt size_local_extrafield;/* size of the local extra field */
+ ZPOS64_T pos_local_extrafield; /* position in the local extra field in read*/
+ ZPOS64_T total_out_64;
+
+ uLong crc32; /* crc32 of all data uncompressed */
+ uLong crc32_wait; /* crc32 we must obtain after decompress all */
+ ZPOS64_T rest_read_compressed; /* number of byte to be decompressed */
+ ZPOS64_T rest_read_uncompressed;/*number of byte to be obtained after decomp*/
+ zlib_filefunc64_32_def z_filefunc;
+ voidpf filestream; /* io structore of the zipfile */
+ uLong compression_method; /* compression method (0==store) */
+ ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/
+ int raw;
+} file_in_zip64_read_info_s;
+
+
+/* unz64_s contain internal information about the zipfile
+*/
+typedef struct
+{
+ zlib_filefunc64_32_def z_filefunc;
+ int is64bitOpenFunction;
+ voidpf filestream; /* io structore of the zipfile */
+ unz_global_info64 gi; /* public global information */
+ ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/
+ ZPOS64_T num_file; /* number of the current file in the zipfile*/
+ ZPOS64_T pos_in_central_dir; /* pos of the current file in the central dir*/
+ ZPOS64_T current_file_ok; /* flag about the usability of the current file*/
+ ZPOS64_T central_pos; /* position of the beginning of the central dir*/
+
+ ZPOS64_T size_central_dir; /* size of the central directory */
+ ZPOS64_T offset_central_dir; /* offset of start of central directory with
+ respect to the starting disk number */
+
+ unz_file_info64 cur_file_info; /* public info about the current file in zip*/
+ unz_file_info64_internal cur_file_info_internal; /* private info about it*/
+ file_in_zip64_read_info_s* pfile_in_zip_read; /* structure about the current
+ file if we are decompressing it */
+ int encrypted;
+
+ int isZip64;
+
+# ifndef NOUNCRYPT
+ unsigned long keys[3]; /* keys defining the pseudo-random sequence */
+ const z_crc_t* pcrc_32_tab;
+# endif
+} unz64_s;
+
+
+#ifndef NOUNCRYPT
+#include "crypt.h"
+#endif
+
+/* ===========================================================================
+ Read a byte from a gz_stream; update next_in and avail_in. Return EOF
+ for end of file.
+ IN assertion: the stream s has been sucessfully opened for reading.
+*/
+
+
+local int unz64local_getByte OF((
+ const zlib_filefunc64_32_def* pzlib_filefunc_def,
+ voidpf filestream,
+ int *pi));
+
+local int unz64local_getByte(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, int *pi)
+{
+ unsigned char c;
+ int err = (int)ZREAD64(*pzlib_filefunc_def,filestream,&c,1);
+ if (err==1)
+ {
+ *pi = (int)c;
+ return UNZ_OK;
+ }
+ else
+ {
+ if (ZERROR64(*pzlib_filefunc_def,filestream))
+ return UNZ_ERRNO;
+ else
+ return UNZ_EOF;
+ }
+}
+
+
+/* ===========================================================================
+ Reads a long in LSB order from the given gz_stream. Sets
+*/
+local int unz64local_getShort OF((
+ const zlib_filefunc64_32_def* pzlib_filefunc_def,
+ voidpf filestream,
+ uLong *pX));
+
+local int unz64local_getShort (const zlib_filefunc64_32_def* pzlib_filefunc_def,
+ voidpf filestream,
+ uLong *pX)
+{
+ uLong x ;
+ int i = 0;
+ int err;
+
+ err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);
+ x = (uLong)i;
+
+ if (err==UNZ_OK)
+ err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);
+ x |= ((uLong)i)<<8;
+
+ if (err==UNZ_OK)
+ *pX = x;
+ else
+ *pX = 0;
+ return err;
+}
+
+local int unz64local_getLong OF((
+ const zlib_filefunc64_32_def* pzlib_filefunc_def,
+ voidpf filestream,
+ uLong *pX));
+
+local int unz64local_getLong (const zlib_filefunc64_32_def* pzlib_filefunc_def,
+ voidpf filestream,
+ uLong *pX)
+{
+ uLong x ;
+ int i = 0;
+ int err;
+
+ err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);
+ x = (uLong)i;
+
+ if (err==UNZ_OK)
+ err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);
+ x |= ((uLong)i)<<8;
+
+ if (err==UNZ_OK)
+ err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);
+ x |= ((uLong)i)<<16;
+
+ if (err==UNZ_OK)
+ err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);
+ x += ((uLong)i)<<24;
+
+ if (err==UNZ_OK)
+ *pX = x;
+ else
+ *pX = 0;
+ return err;
+}
+
+local int unz64local_getLong64 OF((
+ const zlib_filefunc64_32_def* pzlib_filefunc_def,
+ voidpf filestream,
+ ZPOS64_T *pX));
+
+
+local int unz64local_getLong64 (const zlib_filefunc64_32_def* pzlib_filefunc_def,
+ voidpf filestream,
+ ZPOS64_T *pX)
+{
+ ZPOS64_T x ;
+ int i = 0;
+ int err;
+
+ err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);
+ x = (ZPOS64_T)i;
+
+ if (err==UNZ_OK)
+ err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);
+ x |= ((ZPOS64_T)i)<<8;
+
+ if (err==UNZ_OK)
+ err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);
+ x |= ((ZPOS64_T)i)<<16;
+
+ if (err==UNZ_OK)
+ err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);
+ x |= ((ZPOS64_T)i)<<24;
+
+ if (err==UNZ_OK)
+ err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);
+ x |= ((ZPOS64_T)i)<<32;
+
+ if (err==UNZ_OK)
+ err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);
+ x |= ((ZPOS64_T)i)<<40;
+
+ if (err==UNZ_OK)
+ err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);
+ x |= ((ZPOS64_T)i)<<48;
+
+ if (err==UNZ_OK)
+ err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);
+ x |= ((ZPOS64_T)i)<<56;
+
+ if (err==UNZ_OK)
+ *pX = x;
+ else
+ *pX = 0;
+ return err;
+}
+
+/* My own strcmpi / strcasecmp */
+local int strcmpcasenosensitive_internal (const char* fileName1, const char* fileName2)
+{
+ for (;;)
+ {
+ char c1=*(fileName1++);
+ char c2=*(fileName2++);
+ if ((c1>='a') && (c1<='z'))
+ c1 -= 0x20;
+ if ((c2>='a') && (c2<='z'))
+ c2 -= 0x20;
+ if (c1=='\0')
+ return ((c2=='\0') ? 0 : -1);
+ if (c2=='\0')
+ return 1;
+ if (c1<c2)
+ return -1;
+ if (c1>c2)
+ return 1;
+ }
+}
+
+
+#ifdef CASESENSITIVITYDEFAULT_NO
+#define CASESENSITIVITYDEFAULTVALUE 2
+#else
+#define CASESENSITIVITYDEFAULTVALUE 1
+#endif
+
+#ifndef STRCMPCASENOSENTIVEFUNCTION
+#define STRCMPCASENOSENTIVEFUNCTION strcmpcasenosensitive_internal
+#endif
+
+/*
+ Compare two filename (fileName1,fileName2).
+ If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
+ If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
+ or strcasecmp)
+ If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
+ (like 1 on Unix, 2 on Windows)
+
+*/
+extern int ZEXPORT unzStringFileNameCompare (const char* fileName1,
+ const char* fileName2,
+ int iCaseSensitivity)
+
+{
+ if (iCaseSensitivity==0)
+ iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE;
+
+ if (iCaseSensitivity==1)
+ return strcmp(fileName1,fileName2);
+
+ return STRCMPCASENOSENTIVEFUNCTION(fileName1,fileName2);
+}
+
+#ifndef BUFREADCOMMENT
+#define BUFREADCOMMENT (0x400)
+#endif
+
+/*
+ Locate the Central directory of a zipfile (at the end, just before
+ the global comment)
+*/
+local ZPOS64_T unz64local_SearchCentralDir OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream));
+local ZPOS64_T unz64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream)
+{
+ unsigned char* buf;
+ ZPOS64_T uSizeFile;
+ ZPOS64_T uBackRead;
+ ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */
+ ZPOS64_T uPosFound=0;
+
+ if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0)
+ return 0;
+
+
+ uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream);
+
+ if (uMaxBack>uSizeFile)
+ uMaxBack = uSizeFile;
+
+ buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4);
+ if (buf==NULL)
+ return 0;
+
+ uBackRead = 4;
+ while (uBackRead<uMaxBack)
+ {
+ uLong uReadSize;
+ ZPOS64_T uReadPos ;
+ int i;
+ if (uBackRead+BUFREADCOMMENT>uMaxBack)
+ uBackRead = uMaxBack;
+ else
+ uBackRead+=BUFREADCOMMENT;
+ uReadPos = uSizeFile-uBackRead ;
+
+ uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ?
+ (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos);
+ if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0)
+ break;
+
+ if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize)
+ break;
+
+ for (i=(int)uReadSize-3; (i--)>0;)
+ if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
+ ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06))
+ {
+ uPosFound = uReadPos+i;
+ break;
+ }
+
+ if (uPosFound!=0)
+ break;
+ }
+ TRYFREE(buf);
+ return uPosFound;
+}
+
+
+/*
+ Locate the Central directory 64 of a zipfile (at the end, just before
+ the global comment)
+*/
+local ZPOS64_T unz64local_SearchCentralDir64 OF((
+ const zlib_filefunc64_32_def* pzlib_filefunc_def,
+ voidpf filestream));
+
+local ZPOS64_T unz64local_SearchCentralDir64(const zlib_filefunc64_32_def* pzlib_filefunc_def,
+ voidpf filestream)
+{
+ unsigned char* buf;
+ ZPOS64_T uSizeFile;
+ ZPOS64_T uBackRead;
+ ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */
+ ZPOS64_T uPosFound=0;
+ uLong uL;
+ ZPOS64_T relativeOffset;
+
+ if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0)
+ return 0;
+
+
+ uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream);
+
+ if (uMaxBack>uSizeFile)
+ uMaxBack = uSizeFile;
+
+ buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4);
+ if (buf==NULL)
+ return 0;
+
+ uBackRead = 4;
+ while (uBackRead<uMaxBack)
+ {
+ uLong uReadSize;
+ ZPOS64_T uReadPos;
+ int i;
+ if (uBackRead+BUFREADCOMMENT>uMaxBack)
+ uBackRead = uMaxBack;
+ else
+ uBackRead+=BUFREADCOMMENT;
+ uReadPos = uSizeFile-uBackRead ;
+
+ uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ?
+ (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos);
+ if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0)
+ break;
+
+ if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize)
+ break;
+
+ for (i=(int)uReadSize-3; (i--)>0;)
+ if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
+ ((*(buf+i+2))==0x06) && ((*(buf+i+3))==0x07))
+ {
+ uPosFound = uReadPos+i;
+ break;
+ }
+
+ if (uPosFound!=0)
+ break;
+ }
+ TRYFREE(buf);
+ if (uPosFound == 0)
+ return 0;
+
+ /* Zip64 end of central directory locator */
+ if (ZSEEK64(*pzlib_filefunc_def,filestream, uPosFound,ZLIB_FILEFUNC_SEEK_SET)!=0)
+ return 0;
+
+ /* the signature, already checked */
+ if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK)
+ return 0;
+
+ /* number of the disk with the start of the zip64 end of central directory */
+ if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK)
+ return 0;
+ if (uL != 0)
+ return 0;
+
+ /* relative offset of the zip64 end of central directory record */
+ if (unz64local_getLong64(pzlib_filefunc_def,filestream,&relativeOffset)!=UNZ_OK)
+ return 0;
+
+ /* total number of disks */
+ if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK)
+ return 0;
+ if (uL != 1)
+ return 0;
+
+ /* Goto end of central directory record */
+ if (ZSEEK64(*pzlib_filefunc_def,filestream, relativeOffset,ZLIB_FILEFUNC_SEEK_SET)!=0)
+ return 0;
+
+ /* the signature */
+ if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK)
+ return 0;
+
+ if (uL != 0x06064b50)
+ return 0;
+
+ return relativeOffset;
+}
+
+/*
+ Open a Zip file. path contain the full pathname (by example,
+ on a Windows NT computer "c:\\test\\zlib114.zip" or on an Unix computer
+ "zlib/zlib114.zip".
+ If the zipfile cannot be opened (file doesn't exist or in not valid), the
+ return value is NULL.
+ Else, the return value is a unzFile Handle, usable with other function
+ of this unzip package.
+*/
+local unzFile unzOpenInternal (const void *path,
+ zlib_filefunc64_32_def* pzlib_filefunc64_32_def,
+ int is64bitOpenFunction)
+{
+ unz64_s us;
+ unz64_s *s;
+ ZPOS64_T central_pos;
+ uLong uL;
+
+ uLong number_disk; /* number of the current dist, used for
+ spaning ZIP, unsupported, always 0*/
+ uLong number_disk_with_CD; /* number the the disk with central dir, used
+ for spaning ZIP, unsupported, always 0*/
+ ZPOS64_T number_entry_CD; /* total number of entries in
+ the central dir
+ (same than number_entry on nospan) */
+
+ int err=UNZ_OK;
+
+ if (unz_copyright[0]!=' ')
+ return NULL;
+
+ us.z_filefunc.zseek32_file = NULL;
+ us.z_filefunc.ztell32_file = NULL;
+ if (pzlib_filefunc64_32_def==NULL)
+ fill_fopen64_filefunc(&us.z_filefunc.zfile_func64);
+ else
+ us.z_filefunc = *pzlib_filefunc64_32_def;
+ us.is64bitOpenFunction = is64bitOpenFunction;
+
+
+
+ us.filestream = ZOPEN64(us.z_filefunc,
+ path,
+ ZLIB_FILEFUNC_MODE_READ |
+ ZLIB_FILEFUNC_MODE_EXISTING);
+ if (us.filestream==NULL)
+ return NULL;
+
+ central_pos = unz64local_SearchCentralDir64(&us.z_filefunc,us.filestream);
+ if (central_pos)
+ {
+ uLong uS;
+ ZPOS64_T uL64;
+
+ us.isZip64 = 1;
+
+ if (ZSEEK64(us.z_filefunc, us.filestream,
+ central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0)
+ err=UNZ_ERRNO;
+
+ /* the signature, already checked */
+ if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK)
+ err=UNZ_ERRNO;
+
+ /* size of zip64 end of central directory record */
+ if (unz64local_getLong64(&us.z_filefunc, us.filestream,&uL64)!=UNZ_OK)
+ err=UNZ_ERRNO;
+
+ /* version made by */
+ if (unz64local_getShort(&us.z_filefunc, us.filestream,&uS)!=UNZ_OK)
+ err=UNZ_ERRNO;
+
+ /* version needed to extract */
+ if (unz64local_getShort(&us.z_filefunc, us.filestream,&uS)!=UNZ_OK)
+ err=UNZ_ERRNO;
+
+ /* number of this disk */
+ if (unz64local_getLong(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK)
+ err=UNZ_ERRNO;
+
+ /* number of the disk with the start of the central directory */
+ if (unz64local_getLong(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK)
+ err=UNZ_ERRNO;
+
+ /* total number of entries in the central directory on this disk */
+ if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.gi.number_entry)!=UNZ_OK)
+ err=UNZ_ERRNO;
+
+ /* total number of entries in the central directory */
+ if (unz64local_getLong64(&us.z_filefunc, us.filestream,&number_entry_CD)!=UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if ((number_entry_CD!=us.gi.number_entry) ||
+ (number_disk_with_CD!=0) ||
+ (number_disk!=0))
+ err=UNZ_BADZIPFILE;
+
+ /* size of the central directory */
+ if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.size_central_dir)!=UNZ_OK)
+ err=UNZ_ERRNO;
+
+ /* offset of start of central directory with respect to the
+ starting disk number */
+ if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.offset_central_dir)!=UNZ_OK)
+ err=UNZ_ERRNO;
+
+ us.gi.size_comment = 0;
+ }
+ else
+ {
+ central_pos = unz64local_SearchCentralDir(&us.z_filefunc,us.filestream);
+ if (central_pos==0)
+ err=UNZ_ERRNO;
+
+ us.isZip64 = 0;
+
+ if (ZSEEK64(us.z_filefunc, us.filestream,
+ central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0)
+ err=UNZ_ERRNO;
+
+ /* the signature, already checked */
+ if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK)
+ err=UNZ_ERRNO;
+
+ /* number of this disk */
+ if (unz64local_getShort(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK)
+ err=UNZ_ERRNO;
+
+ /* number of the disk with the start of the central directory */
+ if (unz64local_getShort(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK)
+ err=UNZ_ERRNO;
+
+ /* total number of entries in the central dir on this disk */
+ if (unz64local_getShort(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK)
+ err=UNZ_ERRNO;
+ us.gi.number_entry = uL;
+
+ /* total number of entries in the central dir */
+ if (unz64local_getShort(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK)
+ err=UNZ_ERRNO;
+ number_entry_CD = uL;
+
+ if ((number_entry_CD!=us.gi.number_entry) ||
+ (number_disk_with_CD!=0) ||
+ (number_disk!=0))
+ err=UNZ_BADZIPFILE;
+
+ /* size of the central directory */
+ if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK)
+ err=UNZ_ERRNO;
+ us.size_central_dir = uL;
+
+ /* offset of start of central directory with respect to the
+ starting disk number */
+ if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK)
+ err=UNZ_ERRNO;
+ us.offset_central_dir = uL;
+
+ /* zipfile comment length */
+ if (unz64local_getShort(&us.z_filefunc, us.filestream,&us.gi.size_comment)!=UNZ_OK)
+ err=UNZ_ERRNO;
+ }
+
+ if ((central_pos<us.offset_central_dir+us.size_central_dir) &&
+ (err==UNZ_OK))
+ err=UNZ_BADZIPFILE;
+
+ if (err!=UNZ_OK)
+ {
+ ZCLOSE64(us.z_filefunc, us.filestream);
+ return NULL;
+ }
+
+ us.byte_before_the_zipfile = central_pos -
+ (us.offset_central_dir+us.size_central_dir);
+ us.central_pos = central_pos;
+ us.pfile_in_zip_read = NULL;
+ us.encrypted = 0;
+
+
+ s=(unz64_s*)ALLOC(sizeof(unz64_s));
+ if( s != NULL)
+ {
+ *s=us;
+ unzGoToFirstFile((unzFile)s);
+ }
+ return (unzFile)s;
+}
+
+
+extern unzFile ZEXPORT unzOpen2 (const char *path,
+ zlib_filefunc_def* pzlib_filefunc32_def)
+{
+ if (pzlib_filefunc32_def != NULL)
+ {
+ zlib_filefunc64_32_def zlib_filefunc64_32_def_fill;
+ fill_zlib_filefunc64_32_def_from_filefunc32(&zlib_filefunc64_32_def_fill,pzlib_filefunc32_def);
+ return unzOpenInternal(path, &zlib_filefunc64_32_def_fill, 0);
+ }
+ else
+ return unzOpenInternal(path, NULL, 0);
+}
+
+extern unzFile ZEXPORT unzOpen2_64 (const void *path,
+ zlib_filefunc64_def* pzlib_filefunc_def)
+{
+ if (pzlib_filefunc_def != NULL)
+ {
+ zlib_filefunc64_32_def zlib_filefunc64_32_def_fill;
+ zlib_filefunc64_32_def_fill.zfile_func64 = *pzlib_filefunc_def;
+ zlib_filefunc64_32_def_fill.ztell32_file = NULL;
+ zlib_filefunc64_32_def_fill.zseek32_file = NULL;
+ return unzOpenInternal(path, &zlib_filefunc64_32_def_fill, 1);
+ }
+ else
+ return unzOpenInternal(path, NULL, 1);
+}
+
+extern unzFile ZEXPORT unzOpen (const char *path)
+{
+ return unzOpenInternal(path, NULL, 0);
+}
+
+extern unzFile ZEXPORT unzOpen64 (const void *path)
+{
+ return unzOpenInternal(path, NULL, 1);
+}
+
+/*
+ Close a ZipFile opened with unzOpen.
+ If there is files inside the .Zip opened with unzOpenCurrentFile (see later),
+ these files MUST be closed with unzCloseCurrentFile before call unzClose.
+ return UNZ_OK if there is no problem. */
+extern int ZEXPORT unzClose (unzFile file)
+{
+ unz64_s* s;
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz64_s*)file;
+
+ if (s->pfile_in_zip_read!=NULL)
+ unzCloseCurrentFile(file);
+
+ ZCLOSE64(s->z_filefunc, s->filestream);
+ TRYFREE(s);
+ return UNZ_OK;
+}
+
+
+/*
+ Write info about the ZipFile in the *pglobal_info structure.
+ No preparation of the structure is needed
+ return UNZ_OK if there is no problem. */
+extern int ZEXPORT unzGetGlobalInfo64 (unzFile file, unz_global_info64* pglobal_info)
+{
+ unz64_s* s;
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz64_s*)file;
+ *pglobal_info=s->gi;
+ return UNZ_OK;
+}
+
+extern int ZEXPORT unzGetGlobalInfo (unzFile file, unz_global_info* pglobal_info32)
+{
+ unz64_s* s;
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz64_s*)file;
+ /* to do : check if number_entry is not truncated */
+ pglobal_info32->number_entry = (uLong)s->gi.number_entry;
+ pglobal_info32->size_comment = s->gi.size_comment;
+ return UNZ_OK;
+}
+/*
+ Translate date/time from Dos format to tm_unz (readable more easilty)
+*/
+local void unz64local_DosDateToTmuDate (ZPOS64_T ulDosDate, tm_unz* ptm)
+{
+ ZPOS64_T uDate;
+ uDate = (ZPOS64_T)(ulDosDate>>16);
+ ptm->tm_mday = (uInt)(uDate&0x1f) ;
+ ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ;
+ ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ;
+
+ ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800);
+ ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20) ;
+ ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)) ;
+}
+
+/*
+ Get Info about the current file in the zipfile, with internal only info
+*/
+local int unz64local_GetCurrentFileInfoInternal OF((unzFile file,
+ unz_file_info64 *pfile_info,
+ unz_file_info64_internal
+ *pfile_info_internal,
+ char *szFileName,
+ uLong fileNameBufferSize,
+ void *extraField,
+ uLong extraFieldBufferSize,
+ char *szComment,
+ uLong commentBufferSize));
+
+local int unz64local_GetCurrentFileInfoInternal (unzFile file,
+ unz_file_info64 *pfile_info,
+ unz_file_info64_internal
+ *pfile_info_internal,
+ char *szFileName,
+ uLong fileNameBufferSize,
+ void *extraField,
+ uLong extraFieldBufferSize,
+ char *szComment,
+ uLong commentBufferSize)
+{
+ unz64_s* s;
+ unz_file_info64 file_info;
+ unz_file_info64_internal file_info_internal;
+ int err=UNZ_OK;
+ uLong uMagic;
+ long lSeek=0;
+ uLong uL;
+
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz64_s*)file;
+ if (ZSEEK64(s->z_filefunc, s->filestream,
+ s->pos_in_central_dir+s->byte_before_the_zipfile,
+ ZLIB_FILEFUNC_SEEK_SET)!=0)
+ err=UNZ_ERRNO;
+
+
+ /* we check the magic */
+ if (err==UNZ_OK)
+ {
+ if (unz64local_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK)
+ err=UNZ_ERRNO;
+ else if (uMagic!=0x02014b50)
+ err=UNZ_BADZIPFILE;
+ }
+
+ if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.version) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.version_needed) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.flag) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.compression_method) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.dosDate) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ unz64local_DosDateToTmuDate(file_info.dosDate,&file_info.tmu_date);
+
+ if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.crc) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK)
+ err=UNZ_ERRNO;
+ file_info.compressed_size = uL;
+
+ if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK)
+ err=UNZ_ERRNO;
+ file_info.uncompressed_size = uL;
+
+ if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_filename) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_extra) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_comment) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.disk_num_start) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.internal_fa) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.external_fa) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ // relative offset of local header
+ if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK)
+ err=UNZ_ERRNO;
+ file_info_internal.offset_curfile = uL;
+
+ lSeek+=file_info.size_filename;
+ if ((err==UNZ_OK) && (szFileName!=NULL))
+ {
+ uLong uSizeRead ;
+ if (file_info.size_filename<fileNameBufferSize)
+ {
+ *(szFileName+file_info.size_filename)='\0';
+ uSizeRead = file_info.size_filename;
+ }
+ else
+ uSizeRead = fileNameBufferSize;
+
+ if ((file_info.size_filename>0) && (fileNameBufferSize>0))
+ if (ZREAD64(s->z_filefunc, s->filestream,szFileName,uSizeRead)!=uSizeRead)
+ err=UNZ_ERRNO;
+ lSeek -= uSizeRead;
+ }
+
+ // Read extrafield
+ if ((err==UNZ_OK) && (extraField!=NULL))
+ {
+ ZPOS64_T uSizeRead ;
+ if (file_info.size_file_extra<extraFieldBufferSize)
+ uSizeRead = file_info.size_file_extra;
+ else
+ uSizeRead = extraFieldBufferSize;
+
+ if (lSeek!=0)
+ {
+ if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
+ lSeek=0;
+ else
+ err=UNZ_ERRNO;
+ }
+
+ if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0))
+ if (ZREAD64(s->z_filefunc, s->filestream,extraField,(uLong)uSizeRead)!=uSizeRead)
+ err=UNZ_ERRNO;
+
+ lSeek += file_info.size_file_extra - (uLong)uSizeRead;
+ }
+ else
+ lSeek += file_info.size_file_extra;
+
+
+ if ((err==UNZ_OK) && (file_info.size_file_extra != 0))
+ {
+ uLong acc = 0;
+
+ // since lSeek now points to after the extra field we need to move back
+ lSeek -= file_info.size_file_extra;
+
+ if (lSeek!=0)
+ {
+ if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
+ lSeek=0;
+ else
+ err=UNZ_ERRNO;
+ }
+
+ while(acc < file_info.size_file_extra)
+ {
+ uLong headerId;
+ uLong dataSize;
+
+ if (unz64local_getShort(&s->z_filefunc, s->filestream,&headerId) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unz64local_getShort(&s->z_filefunc, s->filestream,&dataSize) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ /* ZIP64 extra fields */
+ if (headerId == 0x0001)
+ {
+ uLong uL;
+
+ if(file_info.uncompressed_size == MAXU32)
+ {
+ if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info.uncompressed_size) != UNZ_OK)
+ err=UNZ_ERRNO;
+ }
+
+ if(file_info.compressed_size == MAXU32)
+ {
+ if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info.compressed_size) != UNZ_OK)
+ err=UNZ_ERRNO;
+ }
+
+ if(file_info_internal.offset_curfile == MAXU32)
+ {
+ /* Relative Header offset */
+ if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info_internal.offset_curfile) != UNZ_OK)
+ err=UNZ_ERRNO;
+ }
+
+ if(file_info.disk_num_start == MAXU32)
+ {
+ /* Disk Start Number */
+ if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK)
+ err=UNZ_ERRNO;
+ }
+
+ }
+ else
+ {
+ if (ZSEEK64(s->z_filefunc, s->filestream,dataSize,ZLIB_FILEFUNC_SEEK_CUR)!=0)
+ err=UNZ_ERRNO;
+ }
+
+ acc += 2 + 2 + dataSize;
+ }
+ }
+
+ if ((err==UNZ_OK) && (szComment!=NULL))
+ {
+ uLong uSizeRead ;
+ if (file_info.size_file_comment<commentBufferSize)
+ {
+ *(szComment+file_info.size_file_comment)='\0';
+ uSizeRead = file_info.size_file_comment;
+ }
+ else
+ uSizeRead = commentBufferSize;
+
+ if (lSeek!=0)
+ {
+ if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
+ lSeek=0;
+ else
+ err=UNZ_ERRNO;
+ }
+
+ if ((file_info.size_file_comment>0) && (commentBufferSize>0))
+ if (ZREAD64(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead)
+ err=UNZ_ERRNO;
+ lSeek+=file_info.size_file_comment - uSizeRead;
+ }
+ else
+ lSeek+=file_info.size_file_comment;
+
+
+ if ((err==UNZ_OK) && (pfile_info!=NULL))
+ *pfile_info=file_info;
+
+ if ((err==UNZ_OK) && (pfile_info_internal!=NULL))
+ *pfile_info_internal=file_info_internal;
+
+ return err;
+}
+
+
+
+/*
+ Write info about the ZipFile in the *pglobal_info structure.
+ No preparation of the structure is needed
+ return UNZ_OK if there is no problem.
+*/
+extern int ZEXPORT unzGetCurrentFileInfo64 (unzFile file,
+ unz_file_info64 * pfile_info,
+ char * szFileName, uLong fileNameBufferSize,
+ void *extraField, uLong extraFieldBufferSize,
+ char* szComment, uLong commentBufferSize)
+{
+ return unz64local_GetCurrentFileInfoInternal(file,pfile_info,NULL,
+ szFileName,fileNameBufferSize,
+ extraField,extraFieldBufferSize,
+ szComment,commentBufferSize);
+}
+
+extern int ZEXPORT unzGetCurrentFileInfo (unzFile file,
+ unz_file_info * pfile_info,
+ char * szFileName, uLong fileNameBufferSize,
+ void *extraField, uLong extraFieldBufferSize,
+ char* szComment, uLong commentBufferSize)
+{
+ int err;
+ unz_file_info64 file_info64;
+ err = unz64local_GetCurrentFileInfoInternal(file,&file_info64,NULL,
+ szFileName,fileNameBufferSize,
+ extraField,extraFieldBufferSize,
+ szComment,commentBufferSize);
+ if ((err==UNZ_OK) && (pfile_info != NULL))
+ {
+ pfile_info->version = file_info64.version;
+ pfile_info->version_needed = file_info64.version_needed;
+ pfile_info->flag = file_info64.flag;
+ pfile_info->compression_method = file_info64.compression_method;
+ pfile_info->dosDate = file_info64.dosDate;
+ pfile_info->crc = file_info64.crc;
+
+ pfile_info->size_filename = file_info64.size_filename;
+ pfile_info->size_file_extra = file_info64.size_file_extra;
+ pfile_info->size_file_comment = file_info64.size_file_comment;
+
+ pfile_info->disk_num_start = file_info64.disk_num_start;
+ pfile_info->internal_fa = file_info64.internal_fa;
+ pfile_info->external_fa = file_info64.external_fa;
+
+ pfile_info->tmu_date = file_info64.tmu_date,
+
+
+ pfile_info->compressed_size = (uLong)file_info64.compressed_size;
+ pfile_info->uncompressed_size = (uLong)file_info64.uncompressed_size;
+
+ }
+ return err;
+}
+/*
+ Set the current file of the zipfile to the first file.
+ return UNZ_OK if there is no problem
+*/
+extern int ZEXPORT unzGoToFirstFile (unzFile file)
+{
+ int err=UNZ_OK;
+ unz64_s* s;
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz64_s*)file;
+ s->pos_in_central_dir=s->offset_central_dir;
+ s->num_file=0;
+ err=unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info,
+ &s->cur_file_info_internal,
+ NULL,0,NULL,0,NULL,0);
+ s->current_file_ok = (err == UNZ_OK);
+ return err;
+}
+
+/*
+ Set the current file of the zipfile to the next file.
+ return UNZ_OK if there is no problem
+ return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
+*/
+extern int ZEXPORT unzGoToNextFile (unzFile file)
+{
+ unz64_s* s;
+ int err;
+
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz64_s*)file;
+ if (!s->current_file_ok)
+ return UNZ_END_OF_LIST_OF_FILE;
+ if (s->gi.number_entry != 0xffff) /* 2^16 files overflow hack */
+ if (s->num_file+1==s->gi.number_entry)
+ return UNZ_END_OF_LIST_OF_FILE;
+
+ s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename +
+ s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ;
+ s->num_file++;
+ err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info,
+ &s->cur_file_info_internal,
+ NULL,0,NULL,0,NULL,0);
+ s->current_file_ok = (err == UNZ_OK);
+ return err;
+}
+
+
+/*
+ Try locate the file szFileName in the zipfile.
+ For the iCaseSensitivity signification, see unzStringFileNameCompare
+
+ return value :
+ UNZ_OK if the file is found. It becomes the current file.
+ UNZ_END_OF_LIST_OF_FILE if the file is not found
+*/
+extern int ZEXPORT unzLocateFile (unzFile file, const char *szFileName, int iCaseSensitivity)
+{
+ unz64_s* s;
+ int err;
+
+ /* We remember the 'current' position in the file so that we can jump
+ * back there if we fail.
+ */
+ unz_file_info64 cur_file_infoSaved;
+ unz_file_info64_internal cur_file_info_internalSaved;
+ ZPOS64_T num_fileSaved;
+ ZPOS64_T pos_in_central_dirSaved;
+
+
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+
+ if (strlen(szFileName)>=UNZ_MAXFILENAMEINZIP)
+ return UNZ_PARAMERROR;
+
+ s=(unz64_s*)file;
+ if (!s->current_file_ok)
+ return UNZ_END_OF_LIST_OF_FILE;
+
+ /* Save the current state */
+ num_fileSaved = s->num_file;
+ pos_in_central_dirSaved = s->pos_in_central_dir;
+ cur_file_infoSaved = s->cur_file_info;
+ cur_file_info_internalSaved = s->cur_file_info_internal;
+
+ err = unzGoToFirstFile(file);
+
+ while (err == UNZ_OK)
+ {
+ char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1];
+ err = unzGetCurrentFileInfo64(file,NULL,
+ szCurrentFileName,sizeof(szCurrentFileName)-1,
+ NULL,0,NULL,0);
+ if (err == UNZ_OK)
+ {
+ if (unzStringFileNameCompare(szCurrentFileName,
+ szFileName,iCaseSensitivity)==0)
+ return UNZ_OK;
+ err = unzGoToNextFile(file);
+ }
+ }
+
+ /* We failed, so restore the state of the 'current file' to where we
+ * were.
+ */
+ s->num_file = num_fileSaved ;
+ s->pos_in_central_dir = pos_in_central_dirSaved ;
+ s->cur_file_info = cur_file_infoSaved;
+ s->cur_file_info_internal = cur_file_info_internalSaved;
+ return err;
+}
+
+
+/*
+///////////////////////////////////////////
+// Contributed by Ryan Haksi (mailto://cryogen@infoserve.net)
+// I need random access
+//
+// Further optimization could be realized by adding an ability
+// to cache the directory in memory. The goal being a single
+// comprehensive file read to put the file I need in a memory.
+*/
+
+/*
+typedef struct unz_file_pos_s
+{
+ ZPOS64_T pos_in_zip_directory; // offset in file
+ ZPOS64_T num_of_file; // # of file
+} unz_file_pos;
+*/
+
+extern int ZEXPORT unzGetFilePos64(unzFile file, unz64_file_pos* file_pos)
+{
+ unz64_s* s;
+
+ if (file==NULL || file_pos==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz64_s*)file;
+ if (!s->current_file_ok)
+ return UNZ_END_OF_LIST_OF_FILE;
+
+ file_pos->pos_in_zip_directory = s->pos_in_central_dir;
+ file_pos->num_of_file = s->num_file;
+
+ return UNZ_OK;
+}
+
+extern int ZEXPORT unzGetFilePos(
+ unzFile file,
+ unz_file_pos* file_pos)
+{
+ unz64_file_pos file_pos64;
+ int err = unzGetFilePos64(file,&file_pos64);
+ if (err==UNZ_OK)
+ {
+ file_pos->pos_in_zip_directory = (uLong)file_pos64.pos_in_zip_directory;
+ file_pos->num_of_file = (uLong)file_pos64.num_of_file;
+ }
+ return err;
+}
+
+extern int ZEXPORT unzGoToFilePos64(unzFile file, const unz64_file_pos* file_pos)
+{
+ unz64_s* s;
+ int err;
+
+ if (file==NULL || file_pos==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz64_s*)file;
+
+ /* jump to the right spot */
+ s->pos_in_central_dir = file_pos->pos_in_zip_directory;
+ s->num_file = file_pos->num_of_file;
+
+ /* set the current file */
+ err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info,
+ &s->cur_file_info_internal,
+ NULL,0,NULL,0,NULL,0);
+ /* return results */
+ s->current_file_ok = (err == UNZ_OK);
+ return err;
+}
+
+extern int ZEXPORT unzGoToFilePos(
+ unzFile file,
+ unz_file_pos* file_pos)
+{
+ unz64_file_pos file_pos64;
+ if (file_pos == NULL)
+ return UNZ_PARAMERROR;
+
+ file_pos64.pos_in_zip_directory = file_pos->pos_in_zip_directory;
+ file_pos64.num_of_file = file_pos->num_of_file;
+ return unzGoToFilePos64(file,&file_pos64);
+}
+
+/*
+// Unzip Helper Functions - should be here?
+///////////////////////////////////////////
+*/
+
+/*
+ Read the local header of the current zipfile
+ Check the coherency of the local header and info in the end of central
+ directory about this file
+ store in *piSizeVar the size of extra info in local header
+ (filename and size of extra field data)
+*/
+local int unz64local_CheckCurrentFileCoherencyHeader (unz64_s* s, uInt* piSizeVar,
+ ZPOS64_T * poffset_local_extrafield,
+ uInt * psize_local_extrafield)
+{
+ uLong uMagic,uData,uFlags;
+ uLong size_filename;
+ uLong size_extra_field;
+ int err=UNZ_OK;
+
+ *piSizeVar = 0;
+ *poffset_local_extrafield = 0;
+ *psize_local_extrafield = 0;
+
+ if (ZSEEK64(s->z_filefunc, s->filestream,s->cur_file_info_internal.offset_curfile +
+ s->byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0)
+ return UNZ_ERRNO;
+
+
+ if (err==UNZ_OK)
+ {
+ if (unz64local_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK)
+ err=UNZ_ERRNO;
+ else if (uMagic!=0x04034b50)
+ err=UNZ_BADZIPFILE;
+ }
+
+ if (unz64local_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK)
+ err=UNZ_ERRNO;
+/*
+ else if ((err==UNZ_OK) && (uData!=s->cur_file_info.wVersion))
+ err=UNZ_BADZIPFILE;
+*/
+ if (unz64local_getShort(&s->z_filefunc, s->filestream,&uFlags) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unz64local_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK)
+ err=UNZ_ERRNO;
+ else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compression_method))
+ err=UNZ_BADZIPFILE;
+
+ if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) &&
+/* #ifdef HAVE_BZIP2 */
+ (s->cur_file_info.compression_method!=Z_BZIP2ED) &&
+/* #endif */
+ (s->cur_file_info.compression_method!=Z_DEFLATED))
+ err=UNZ_BADZIPFILE;
+
+ if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* date/time */
+ err=UNZ_ERRNO;
+
+ if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* crc */
+ err=UNZ_ERRNO;
+ else if ((err==UNZ_OK) && (uData!=s->cur_file_info.crc) && ((uFlags & 8)==0))
+ err=UNZ_BADZIPFILE;
+
+ if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size compr */
+ err=UNZ_ERRNO;
+ else if (uData != 0xFFFFFFFF && (err==UNZ_OK) && (uData!=s->cur_file_info.compressed_size) && ((uFlags & 8)==0))
+ err=UNZ_BADZIPFILE;
+
+ if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size uncompr */
+ err=UNZ_ERRNO;
+ else if (uData != 0xFFFFFFFF && (err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) && ((uFlags & 8)==0))
+ err=UNZ_BADZIPFILE;
+
+ if (unz64local_getShort(&s->z_filefunc, s->filestream,&size_filename) != UNZ_OK)
+ err=UNZ_ERRNO;
+ else if ((err==UNZ_OK) && (size_filename!=s->cur_file_info.size_filename))
+ err=UNZ_BADZIPFILE;
+
+ *piSizeVar += (uInt)size_filename;
+
+ if (unz64local_getShort(&s->z_filefunc, s->filestream,&size_extra_field) != UNZ_OK)
+ err=UNZ_ERRNO;
+ *poffset_local_extrafield= s->cur_file_info_internal.offset_curfile +
+ SIZEZIPLOCALHEADER + size_filename;
+ *psize_local_extrafield = (uInt)size_extra_field;
+
+ *piSizeVar += (uInt)size_extra_field;
+
+ return err;
+}
+
+/*
+ Open for reading data the current file in the zipfile.
+ If there is no error and the file is opened, the return value is UNZ_OK.
+*/
+extern int ZEXPORT unzOpenCurrentFile3 (unzFile file, int* method,
+ int* level, int raw, const char* password)
+{
+ int err=UNZ_OK;
+ uInt iSizeVar;
+ unz64_s* s;
+ file_in_zip64_read_info_s* pfile_in_zip_read_info;
+ ZPOS64_T offset_local_extrafield; /* offset of the local extra field */
+ uInt size_local_extrafield; /* size of the local extra field */
+# ifndef NOUNCRYPT
+ char source[12];
+# else
+ if (password != NULL)
+ return UNZ_PARAMERROR;
+# endif
+
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz64_s*)file;
+ if (!s->current_file_ok)
+ return UNZ_PARAMERROR;
+
+ if (s->pfile_in_zip_read != NULL)
+ unzCloseCurrentFile(file);
+
+ if (unz64local_CheckCurrentFileCoherencyHeader(s,&iSizeVar, &offset_local_extrafield,&size_local_extrafield)!=UNZ_OK)
+ return UNZ_BADZIPFILE;
+
+ pfile_in_zip_read_info = (file_in_zip64_read_info_s*)ALLOC(sizeof(file_in_zip64_read_info_s));
+ if (pfile_in_zip_read_info==NULL)
+ return UNZ_INTERNALERROR;
+
+ pfile_in_zip_read_info->read_buffer=(char*)ALLOC(UNZ_BUFSIZE);
+ pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield;
+ pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield;
+ pfile_in_zip_read_info->pos_local_extrafield=0;
+ pfile_in_zip_read_info->raw=raw;
+
+ if (pfile_in_zip_read_info->read_buffer==NULL)
+ {
+ TRYFREE(pfile_in_zip_read_info);
+ return UNZ_INTERNALERROR;
+ }
+
+ pfile_in_zip_read_info->stream_initialised=0;
+
+ if (method!=NULL)
+ *method = (int)s->cur_file_info.compression_method;
+
+ if (level!=NULL)
+ {
+ *level = 6;
+ switch (s->cur_file_info.flag & 0x06)
+ {
+ case 6 : *level = 1; break;
+ case 4 : *level = 2; break;
+ case 2 : *level = 9; break;
+ }
+ }
+
+ if ((s->cur_file_info.compression_method!=0) &&
+/* #ifdef HAVE_BZIP2 */
+ (s->cur_file_info.compression_method!=Z_BZIP2ED) &&
+/* #endif */
+ (s->cur_file_info.compression_method!=Z_DEFLATED))
+
+ err=UNZ_BADZIPFILE;
+
+ pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc;
+ pfile_in_zip_read_info->crc32=0;
+ pfile_in_zip_read_info->total_out_64=0;
+ pfile_in_zip_read_info->compression_method = s->cur_file_info.compression_method;
+ pfile_in_zip_read_info->filestream=s->filestream;
+ pfile_in_zip_read_info->z_filefunc=s->z_filefunc;
+ pfile_in_zip_read_info->byte_before_the_zipfile=s->byte_before_the_zipfile;
+
+ pfile_in_zip_read_info->stream.total_out = 0;
+
+ if ((s->cur_file_info.compression_method==Z_BZIP2ED) && (!raw))
+ {
+#ifdef HAVE_BZIP2
+ pfile_in_zip_read_info->bstream.bzalloc = (void *(*) (void *, int, int))0;
+ pfile_in_zip_read_info->bstream.bzfree = (free_func)0;
+ pfile_in_zip_read_info->bstream.opaque = (voidpf)0;
+ pfile_in_zip_read_info->bstream.state = (voidpf)0;
+
+ pfile_in_zip_read_info->stream.zalloc = (alloc_func)0;
+ pfile_in_zip_read_info->stream.zfree = (free_func)0;
+ pfile_in_zip_read_info->stream.opaque = (voidpf)0;
+ pfile_in_zip_read_info->stream.next_in = (voidpf)0;
+ pfile_in_zip_read_info->stream.avail_in = 0;
+
+ err=BZ2_bzDecompressInit(&pfile_in_zip_read_info->bstream, 0, 0);
+ if (err == Z_OK)
+ pfile_in_zip_read_info->stream_initialised=Z_BZIP2ED;
+ else
+ {
+ TRYFREE(pfile_in_zip_read_info);
+ return err;
+ }
+#else
+ pfile_in_zip_read_info->raw=1;
+#endif
+ }
+ else if ((s->cur_file_info.compression_method==Z_DEFLATED) && (!raw))
+ {
+ pfile_in_zip_read_info->stream.zalloc = (alloc_func)0;
+ pfile_in_zip_read_info->stream.zfree = (free_func)0;
+ pfile_in_zip_read_info->stream.opaque = (voidpf)0;
+ pfile_in_zip_read_info->stream.next_in = 0;
+ pfile_in_zip_read_info->stream.avail_in = 0;
+
+ err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS);
+ if (err == Z_OK)
+ pfile_in_zip_read_info->stream_initialised=Z_DEFLATED;
+ else
+ {
+ TRYFREE(pfile_in_zip_read_info);
+ return err;
+ }
+ /* windowBits is passed < 0 to tell that there is no zlib header.
+ * Note that in this case inflate *requires* an extra "dummy" byte
+ * after the compressed stream in order to complete decompression and
+ * return Z_STREAM_END.
+ * In unzip, i don't wait absolutely Z_STREAM_END because I known the
+ * size of both compressed and uncompressed data
+ */
+ }
+ pfile_in_zip_read_info->rest_read_compressed =
+ s->cur_file_info.compressed_size ;
+ pfile_in_zip_read_info->rest_read_uncompressed =
+ s->cur_file_info.uncompressed_size ;
+
+
+ pfile_in_zip_read_info->pos_in_zipfile =
+ s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER +
+ iSizeVar;
+
+ pfile_in_zip_read_info->stream.avail_in = (uInt)0;
+
+ s->pfile_in_zip_read = pfile_in_zip_read_info;
+ s->encrypted = 0;
+
+# ifndef NOUNCRYPT
+ if (password != NULL)
+ {
+ int i;
+ s->pcrc_32_tab = get_crc_table();
+ init_keys(password,s->keys,s->pcrc_32_tab);
+ if (ZSEEK64(s->z_filefunc, s->filestream,
+ s->pfile_in_zip_read->pos_in_zipfile +
+ s->pfile_in_zip_read->byte_before_the_zipfile,
+ SEEK_SET)!=0)
+ return UNZ_INTERNALERROR;
+ if(ZREAD64(s->z_filefunc, s->filestream,source, 12)<12)
+ return UNZ_INTERNALERROR;
+
+ for (i = 0; i<12; i++)
+ zdecode(s->keys,s->pcrc_32_tab,source[i]);
+
+ s->pfile_in_zip_read->pos_in_zipfile+=12;
+ s->encrypted=1;
+ }
+# endif
+
+
+ return UNZ_OK;
+}
+
+extern int ZEXPORT unzOpenCurrentFile (unzFile file)
+{
+ return unzOpenCurrentFile3(file, NULL, NULL, 0, NULL);
+}
+
+extern int ZEXPORT unzOpenCurrentFilePassword (unzFile file, const char* password)
+{
+ return unzOpenCurrentFile3(file, NULL, NULL, 0, password);
+}
+
+extern int ZEXPORT unzOpenCurrentFile2 (unzFile file, int* method, int* level, int raw)
+{
+ return unzOpenCurrentFile3(file, method, level, raw, NULL);
+}
+
+/** Addition for GDAL : START */
+
+extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64( unzFile file)
+{
+ unz64_s* s;
+ file_in_zip64_read_info_s* pfile_in_zip_read_info;
+ s=(unz64_s*)file;
+ if (file==NULL)
+ return 0; //UNZ_PARAMERROR;
+ pfile_in_zip_read_info=s->pfile_in_zip_read;
+ if (pfile_in_zip_read_info==NULL)
+ return 0; //UNZ_PARAMERROR;
+ return pfile_in_zip_read_info->pos_in_zipfile +
+ pfile_in_zip_read_info->byte_before_the_zipfile;
+}
+
+/** Addition for GDAL : END */
+
+/*
+ Read bytes from the current file.
+ buf contain buffer where data must be copied
+ len the size of buf.
+
+ return the number of byte copied if somes bytes are copied
+ return 0 if the end of file was reached
+ return <0 with error code if there is an error
+ (UNZ_ERRNO for IO error, or zLib error for uncompress error)
+*/
+extern int ZEXPORT unzReadCurrentFile (unzFile file, voidp buf, unsigned len)
+{
+ int err=UNZ_OK;
+ uInt iRead = 0;
+ unz64_s* s;
+ file_in_zip64_read_info_s* pfile_in_zip_read_info;
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz64_s*)file;
+ pfile_in_zip_read_info=s->pfile_in_zip_read;
+
+ if (pfile_in_zip_read_info==NULL)
+ return UNZ_PARAMERROR;
+
+
+ if (pfile_in_zip_read_info->read_buffer == NULL)
+ return UNZ_END_OF_LIST_OF_FILE;
+ if (len==0)
+ return 0;
+
+ pfile_in_zip_read_info->stream.next_out = (Bytef*)buf;
+
+ pfile_in_zip_read_info->stream.avail_out = (uInt)len;
+
+ if ((len>pfile_in_zip_read_info->rest_read_uncompressed) &&
+ (!(pfile_in_zip_read_info->raw)))
+ pfile_in_zip_read_info->stream.avail_out =
+ (uInt)pfile_in_zip_read_info->rest_read_uncompressed;
+
+ if ((len>pfile_in_zip_read_info->rest_read_compressed+
+ pfile_in_zip_read_info->stream.avail_in) &&
+ (pfile_in_zip_read_info->raw))
+ pfile_in_zip_read_info->stream.avail_out =
+ (uInt)pfile_in_zip_read_info->rest_read_compressed+
+ pfile_in_zip_read_info->stream.avail_in;
+
+ while (pfile_in_zip_read_info->stream.avail_out>0)
+ {
+ if ((pfile_in_zip_read_info->stream.avail_in==0) &&
+ (pfile_in_zip_read_info->rest_read_compressed>0))
+ {
+ uInt uReadThis = UNZ_BUFSIZE;
+ if (pfile_in_zip_read_info->rest_read_compressed<uReadThis)
+ uReadThis = (uInt)pfile_in_zip_read_info->rest_read_compressed;
+ if (uReadThis == 0)
+ return UNZ_EOF;
+ if (ZSEEK64(pfile_in_zip_read_info->z_filefunc,
+ pfile_in_zip_read_info->filestream,
+ pfile_in_zip_read_info->pos_in_zipfile +
+ pfile_in_zip_read_info->byte_before_the_zipfile,
+ ZLIB_FILEFUNC_SEEK_SET)!=0)
+ return UNZ_ERRNO;
+ if (ZREAD64(pfile_in_zip_read_info->z_filefunc,
+ pfile_in_zip_read_info->filestream,
+ pfile_in_zip_read_info->read_buffer,
+ uReadThis)!=uReadThis)
+ return UNZ_ERRNO;
+
+
+# ifndef NOUNCRYPT
+ if(s->encrypted)
+ {
+ uInt i;
+ for(i=0;i<uReadThis;i++)
+ pfile_in_zip_read_info->read_buffer[i] =
+ zdecode(s->keys,s->pcrc_32_tab,
+ pfile_in_zip_read_info->read_buffer[i]);
+ }
+# endif
+
+
+ pfile_in_zip_read_info->pos_in_zipfile += uReadThis;
+
+ pfile_in_zip_read_info->rest_read_compressed-=uReadThis;
+
+ pfile_in_zip_read_info->stream.next_in =
+ (Bytef*)pfile_in_zip_read_info->read_buffer;
+ pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis;
+ }
+
+ if ((pfile_in_zip_read_info->compression_method==0) || (pfile_in_zip_read_info->raw))
+ {
+ uInt uDoCopy,i ;
+
+ if ((pfile_in_zip_read_info->stream.avail_in == 0) &&
+ (pfile_in_zip_read_info->rest_read_compressed == 0))
+ return (iRead==0) ? UNZ_EOF : iRead;
+
+ if (pfile_in_zip_read_info->stream.avail_out <
+ pfile_in_zip_read_info->stream.avail_in)
+ uDoCopy = pfile_in_zip_read_info->stream.avail_out ;
+ else
+ uDoCopy = pfile_in_zip_read_info->stream.avail_in ;
+
+ for (i=0;i<uDoCopy;i++)
+ *(pfile_in_zip_read_info->stream.next_out+i) =
+ *(pfile_in_zip_read_info->stream.next_in+i);
+
+ pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uDoCopy;
+
+ pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32,
+ pfile_in_zip_read_info->stream.next_out,
+ uDoCopy);
+ pfile_in_zip_read_info->rest_read_uncompressed-=uDoCopy;
+ pfile_in_zip_read_info->stream.avail_in -= uDoCopy;
+ pfile_in_zip_read_info->stream.avail_out -= uDoCopy;
+ pfile_in_zip_read_info->stream.next_out += uDoCopy;
+ pfile_in_zip_read_info->stream.next_in += uDoCopy;
+ pfile_in_zip_read_info->stream.total_out += uDoCopy;
+ iRead += uDoCopy;
+ }
+ else if (pfile_in_zip_read_info->compression_method==Z_BZIP2ED)
+ {
+#ifdef HAVE_BZIP2
+ uLong uTotalOutBefore,uTotalOutAfter;
+ const Bytef *bufBefore;
+ uLong uOutThis;
+
+ pfile_in_zip_read_info->bstream.next_in = (char*)pfile_in_zip_read_info->stream.next_in;
+ pfile_in_zip_read_info->bstream.avail_in = pfile_in_zip_read_info->stream.avail_in;
+ pfile_in_zip_read_info->bstream.total_in_lo32 = pfile_in_zip_read_info->stream.total_in;
+ pfile_in_zip_read_info->bstream.total_in_hi32 = 0;
+ pfile_in_zip_read_info->bstream.next_out = (char*)pfile_in_zip_read_info->stream.next_out;
+ pfile_in_zip_read_info->bstream.avail_out = pfile_in_zip_read_info->stream.avail_out;
+ pfile_in_zip_read_info->bstream.total_out_lo32 = pfile_in_zip_read_info->stream.total_out;
+ pfile_in_zip_read_info->bstream.total_out_hi32 = 0;
+
+ uTotalOutBefore = pfile_in_zip_read_info->bstream.total_out_lo32;
+ bufBefore = (const Bytef *)pfile_in_zip_read_info->bstream.next_out;
+
+ err=BZ2_bzDecompress(&pfile_in_zip_read_info->bstream);
+
+ uTotalOutAfter = pfile_in_zip_read_info->bstream.total_out_lo32;
+ uOutThis = uTotalOutAfter-uTotalOutBefore;
+
+ pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis;
+
+ pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32,bufBefore, (uInt)(uOutThis));
+ pfile_in_zip_read_info->rest_read_uncompressed -= uOutThis;
+ iRead += (uInt)(uTotalOutAfter - uTotalOutBefore);
+
+ pfile_in_zip_read_info->stream.next_in = (Bytef*)pfile_in_zip_read_info->bstream.next_in;
+ pfile_in_zip_read_info->stream.avail_in = pfile_in_zip_read_info->bstream.avail_in;
+ pfile_in_zip_read_info->stream.total_in = pfile_in_zip_read_info->bstream.total_in_lo32;
+ pfile_in_zip_read_info->stream.next_out = (Bytef*)pfile_in_zip_read_info->bstream.next_out;
+ pfile_in_zip_read_info->stream.avail_out = pfile_in_zip_read_info->bstream.avail_out;
+ pfile_in_zip_read_info->stream.total_out = pfile_in_zip_read_info->bstream.total_out_lo32;
+
+ if (err==BZ_STREAM_END)
+ return (iRead==0) ? UNZ_EOF : iRead;
+ if (err!=BZ_OK)
+ break;
+#endif
+ } // end Z_BZIP2ED
+ else
+ {
+ ZPOS64_T uTotalOutBefore,uTotalOutAfter;
+ const Bytef *bufBefore;
+ ZPOS64_T uOutThis;
+ int flush=Z_SYNC_FLUSH;
+
+ uTotalOutBefore = pfile_in_zip_read_info->stream.total_out;
+ bufBefore = pfile_in_zip_read_info->stream.next_out;
+
+ /*
+ if ((pfile_in_zip_read_info->rest_read_uncompressed ==
+ pfile_in_zip_read_info->stream.avail_out) &&
+ (pfile_in_zip_read_info->rest_read_compressed == 0))
+ flush = Z_FINISH;
+ */
+ err=inflate(&pfile_in_zip_read_info->stream,flush);
+
+ if ((err>=0) && (pfile_in_zip_read_info->stream.msg!=NULL))
+ err = Z_DATA_ERROR;
+
+ uTotalOutAfter = pfile_in_zip_read_info->stream.total_out;
+ uOutThis = uTotalOutAfter-uTotalOutBefore;
+
+ pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis;
+
+ pfile_in_zip_read_info->crc32 =
+ crc32(pfile_in_zip_read_info->crc32,bufBefore,
+ (uInt)(uOutThis));
+
+ pfile_in_zip_read_info->rest_read_uncompressed -=
+ uOutThis;
+
+ iRead += (uInt)(uTotalOutAfter - uTotalOutBefore);
+
+ if (err==Z_STREAM_END)
+ return (iRead==0) ? UNZ_EOF : iRead;
+ if (err!=Z_OK)
+ break;
+ }
+ }
+
+ if (err==Z_OK)
+ return iRead;
+ return err;
+}
+
+
+/*
+ Give the current position in uncompressed data
+*/
+extern z_off_t ZEXPORT unztell (unzFile file)
+{
+ unz64_s* s;
+ file_in_zip64_read_info_s* pfile_in_zip_read_info;
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz64_s*)file;
+ pfile_in_zip_read_info=s->pfile_in_zip_read;
+
+ if (pfile_in_zip_read_info==NULL)
+ return UNZ_PARAMERROR;
+
+ return (z_off_t)pfile_in_zip_read_info->stream.total_out;
+}
+
+extern ZPOS64_T ZEXPORT unztell64 (unzFile file)
+{
+
+ unz64_s* s;
+ file_in_zip64_read_info_s* pfile_in_zip_read_info;
+ if (file==NULL)
+ return (ZPOS64_T)-1;
+ s=(unz64_s*)file;
+ pfile_in_zip_read_info=s->pfile_in_zip_read;
+
+ if (pfile_in_zip_read_info==NULL)
+ return (ZPOS64_T)-1;
+
+ return pfile_in_zip_read_info->total_out_64;
+}
+
+
+/*
+ return 1 if the end of file was reached, 0 elsewhere
+*/
+extern int ZEXPORT unzeof (unzFile file)
+{
+ unz64_s* s;
+ file_in_zip64_read_info_s* pfile_in_zip_read_info;
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz64_s*)file;
+ pfile_in_zip_read_info=s->pfile_in_zip_read;
+
+ if (pfile_in_zip_read_info==NULL)
+ return UNZ_PARAMERROR;
+
+ if (pfile_in_zip_read_info->rest_read_uncompressed == 0)
+ return 1;
+ else
+ return 0;
+}
+
+
+
+/*
+Read extra field from the current file (opened by unzOpenCurrentFile)
+This is the local-header version of the extra field (sometimes, there is
+more info in the local-header version than in the central-header)
+
+ if buf==NULL, it return the size of the local extra field that can be read
+
+ if buf!=NULL, len is the size of the buffer, the extra header is copied in
+ buf.
+ the return value is the number of bytes copied in buf, or (if <0)
+ the error code
+*/
+extern int ZEXPORT unzGetLocalExtrafield (unzFile file, voidp buf, unsigned len)
+{
+ unz64_s* s;
+ file_in_zip64_read_info_s* pfile_in_zip_read_info;
+ uInt read_now;
+ ZPOS64_T size_to_read;
+
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz64_s*)file;
+ pfile_in_zip_read_info=s->pfile_in_zip_read;
+
+ if (pfile_in_zip_read_info==NULL)
+ return UNZ_PARAMERROR;
+
+ size_to_read = (pfile_in_zip_read_info->size_local_extrafield -
+ pfile_in_zip_read_info->pos_local_extrafield);
+
+ if (buf==NULL)
+ return (int)size_to_read;
+
+ if (len>size_to_read)
+ read_now = (uInt)size_to_read;
+ else
+ read_now = (uInt)len ;
+
+ if (read_now==0)
+ return 0;
+
+ if (ZSEEK64(pfile_in_zip_read_info->z_filefunc,
+ pfile_in_zip_read_info->filestream,
+ pfile_in_zip_read_info->offset_local_extrafield +
+ pfile_in_zip_read_info->pos_local_extrafield,
+ ZLIB_FILEFUNC_SEEK_SET)!=0)
+ return UNZ_ERRNO;
+
+ if (ZREAD64(pfile_in_zip_read_info->z_filefunc,
+ pfile_in_zip_read_info->filestream,
+ buf,read_now)!=read_now)
+ return UNZ_ERRNO;
+
+ return (int)read_now;
+}
+
+/*
+ Close the file in zip opened with unzOpenCurrentFile
+ Return UNZ_CRCERROR if all the file was read but the CRC is not good
+*/
+extern int ZEXPORT unzCloseCurrentFile (unzFile file)
+{
+ int err=UNZ_OK;
+
+ unz64_s* s;
+ file_in_zip64_read_info_s* pfile_in_zip_read_info;
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz64_s*)file;
+ pfile_in_zip_read_info=s->pfile_in_zip_read;
+
+ if (pfile_in_zip_read_info==NULL)
+ return UNZ_PARAMERROR;
+
+
+ if ((pfile_in_zip_read_info->rest_read_uncompressed == 0) &&
+ (!pfile_in_zip_read_info->raw))
+ {
+ if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait)
+ err=UNZ_CRCERROR;
+ }
+
+
+ TRYFREE(pfile_in_zip_read_info->read_buffer);
+ pfile_in_zip_read_info->read_buffer = NULL;
+ if (pfile_in_zip_read_info->stream_initialised == Z_DEFLATED)
+ inflateEnd(&pfile_in_zip_read_info->stream);
+#ifdef HAVE_BZIP2
+ else if (pfile_in_zip_read_info->stream_initialised == Z_BZIP2ED)
+ BZ2_bzDecompressEnd(&pfile_in_zip_read_info->bstream);
+#endif
+
+
+ pfile_in_zip_read_info->stream_initialised = 0;
+ TRYFREE(pfile_in_zip_read_info);
+
+ s->pfile_in_zip_read=NULL;
+
+ return err;
+}
+
+
+/*
+ Get the global comment string of the ZipFile, in the szComment buffer.
+ uSizeBuf is the size of the szComment buffer.
+ return the number of byte copied or an error code <0
+*/
+extern int ZEXPORT unzGetGlobalComment (unzFile file, char * szComment, uLong uSizeBuf)
+{
+ unz64_s* s;
+ uLong uReadThis ;
+ if (file==NULL)
+ return (int)UNZ_PARAMERROR;
+ s=(unz64_s*)file;
+
+ uReadThis = uSizeBuf;
+ if (uReadThis>s->gi.size_comment)
+ uReadThis = s->gi.size_comment;
+
+ if (ZSEEK64(s->z_filefunc,s->filestream,s->central_pos+22,ZLIB_FILEFUNC_SEEK_SET)!=0)
+ return UNZ_ERRNO;
+
+ if (uReadThis>0)
+ {
+ *szComment='\0';
+ if (ZREAD64(s->z_filefunc,s->filestream,szComment,uReadThis)!=uReadThis)
+ return UNZ_ERRNO;
+ }
+
+ if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment))
+ *(szComment+s->gi.size_comment)='\0';
+ return (int)uReadThis;
+}
+
+/* Additions by RX '2004 */
+extern ZPOS64_T ZEXPORT unzGetOffset64(unzFile file)
+{
+ unz64_s* s;
+
+ if (file==NULL)
+ return 0; //UNZ_PARAMERROR;
+ s=(unz64_s*)file;
+ if (!s->current_file_ok)
+ return 0;
+ if (s->gi.number_entry != 0 && s->gi.number_entry != 0xffff)
+ if (s->num_file==s->gi.number_entry)
+ return 0;
+ return s->pos_in_central_dir;
+}
+
+extern uLong ZEXPORT unzGetOffset (unzFile file)
+{
+ ZPOS64_T offset64;
+
+ if (file==NULL)
+ return 0; //UNZ_PARAMERROR;
+ offset64 = unzGetOffset64(file);
+ return (uLong)offset64;
+}
+
+extern int ZEXPORT unzSetOffset64(unzFile file, ZPOS64_T pos)
+{
+ unz64_s* s;
+ int err;
+
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz64_s*)file;
+
+ s->pos_in_central_dir = pos;
+ s->num_file = s->gi.number_entry; /* hack */
+ err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info,
+ &s->cur_file_info_internal,
+ NULL,0,NULL,0,NULL,0);
+ s->current_file_ok = (err == UNZ_OK);
+ return err;
+}
+
+extern int ZEXPORT unzSetOffset (unzFile file, uLong pos)
+{
+ return unzSetOffset64(file,pos);
+}
diff --git a/protocols/Telegram/tgl/zlib/contrib/minizip/unzip.h b/protocols/Telegram/tgl/zlib/contrib/minizip/unzip.h
new file mode 100644
index 0000000000..2104e39150
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/minizip/unzip.h
@@ -0,0 +1,437 @@
+/* unzip.h -- IO for uncompress .zip files using zlib
+ Version 1.1, February 14h, 2010
+ part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
+
+ Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
+
+ Modifications of Unzip for Zip64
+ Copyright (C) 2007-2008 Even Rouault
+
+ Modifications for Zip64 support on both zip and unzip
+ Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
+
+ For more info read MiniZip_info.txt
+
+ ---------------------------------------------------------------------------------
+
+ Condition of use and distribution are the same than zlib :
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ ---------------------------------------------------------------------------------
+
+ Changes
+
+ See header of unzip64.c
+
+*/
+
+#ifndef _unz64_H
+#define _unz64_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _ZLIB_H
+#include "zlib.h"
+#endif
+
+#ifndef _ZLIBIOAPI_H
+#include "ioapi.h"
+#endif
+
+#ifdef HAVE_BZIP2
+#include "bzlib.h"
+#endif
+
+#define Z_BZIP2ED 12
+
+#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
+/* like the STRICT of WIN32, we define a pointer that cannot be converted
+ from (void*) without cast */
+typedef struct TagunzFile__ { int unused; } unzFile__;
+typedef unzFile__ *unzFile;
+#else
+typedef voidp unzFile;
+#endif
+
+
+#define UNZ_OK (0)
+#define UNZ_END_OF_LIST_OF_FILE (-100)
+#define UNZ_ERRNO (Z_ERRNO)
+#define UNZ_EOF (0)
+#define UNZ_PARAMERROR (-102)
+#define UNZ_BADZIPFILE (-103)
+#define UNZ_INTERNALERROR (-104)
+#define UNZ_CRCERROR (-105)
+
+/* tm_unz contain date/time info */
+typedef struct tm_unz_s
+{
+ uInt tm_sec; /* seconds after the minute - [0,59] */
+ uInt tm_min; /* minutes after the hour - [0,59] */
+ uInt tm_hour; /* hours since midnight - [0,23] */
+ uInt tm_mday; /* day of the month - [1,31] */
+ uInt tm_mon; /* months since January - [0,11] */
+ uInt tm_year; /* years - [1980..2044] */
+} tm_unz;
+
+/* unz_global_info structure contain global data about the ZIPfile
+ These data comes from the end of central dir */
+typedef struct unz_global_info64_s
+{
+ ZPOS64_T number_entry; /* total number of entries in
+ the central dir on this disk */
+ uLong size_comment; /* size of the global comment of the zipfile */
+} unz_global_info64;
+
+typedef struct unz_global_info_s
+{
+ uLong number_entry; /* total number of entries in
+ the central dir on this disk */
+ uLong size_comment; /* size of the global comment of the zipfile */
+} unz_global_info;
+
+/* unz_file_info contain information about a file in the zipfile */
+typedef struct unz_file_info64_s
+{
+ uLong version; /* version made by 2 bytes */
+ uLong version_needed; /* version needed to extract 2 bytes */
+ uLong flag; /* general purpose bit flag 2 bytes */
+ uLong compression_method; /* compression method 2 bytes */
+ uLong dosDate; /* last mod file date in Dos fmt 4 bytes */
+ uLong crc; /* crc-32 4 bytes */
+ ZPOS64_T compressed_size; /* compressed size 8 bytes */
+ ZPOS64_T uncompressed_size; /* uncompressed size 8 bytes */
+ uLong size_filename; /* filename length 2 bytes */
+ uLong size_file_extra; /* extra field length 2 bytes */
+ uLong size_file_comment; /* file comment length 2 bytes */
+
+ uLong disk_num_start; /* disk number start 2 bytes */
+ uLong internal_fa; /* internal file attributes 2 bytes */
+ uLong external_fa; /* external file attributes 4 bytes */
+
+ tm_unz tmu_date;
+} unz_file_info64;
+
+typedef struct unz_file_info_s
+{
+ uLong version; /* version made by 2 bytes */
+ uLong version_needed; /* version needed to extract 2 bytes */
+ uLong flag; /* general purpose bit flag 2 bytes */
+ uLong compression_method; /* compression method 2 bytes */
+ uLong dosDate; /* last mod file date in Dos fmt 4 bytes */
+ uLong crc; /* crc-32 4 bytes */
+ uLong compressed_size; /* compressed size 4 bytes */
+ uLong uncompressed_size; /* uncompressed size 4 bytes */
+ uLong size_filename; /* filename length 2 bytes */
+ uLong size_file_extra; /* extra field length 2 bytes */
+ uLong size_file_comment; /* file comment length 2 bytes */
+
+ uLong disk_num_start; /* disk number start 2 bytes */
+ uLong internal_fa; /* internal file attributes 2 bytes */
+ uLong external_fa; /* external file attributes 4 bytes */
+
+ tm_unz tmu_date;
+} unz_file_info;
+
+extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
+ const char* fileName2,
+ int iCaseSensitivity));
+/*
+ Compare two filename (fileName1,fileName2).
+ If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
+ If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
+ or strcasecmp)
+ If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
+ (like 1 on Unix, 2 on Windows)
+*/
+
+
+extern unzFile ZEXPORT unzOpen OF((const char *path));
+extern unzFile ZEXPORT unzOpen64 OF((const void *path));
+/*
+ Open a Zip file. path contain the full pathname (by example,
+ on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer
+ "zlib/zlib113.zip".
+ If the zipfile cannot be opened (file don't exist or in not valid), the
+ return value is NULL.
+ Else, the return value is a unzFile Handle, usable with other function
+ of this unzip package.
+ the "64" function take a const void* pointer, because the path is just the
+ value passed to the open64_file_func callback.
+ Under Windows, if UNICODE is defined, using fill_fopen64_filefunc, the path
+ is a pointer to a wide unicode string (LPCTSTR is LPCWSTR), so const char*
+ does not describe the reality
+*/
+
+
+extern unzFile ZEXPORT unzOpen2 OF((const char *path,
+ zlib_filefunc_def* pzlib_filefunc_def));
+/*
+ Open a Zip file, like unzOpen, but provide a set of file low level API
+ for read/write the zip file (see ioapi.h)
+*/
+
+extern unzFile ZEXPORT unzOpen2_64 OF((const void *path,
+ zlib_filefunc64_def* pzlib_filefunc_def));
+/*
+ Open a Zip file, like unz64Open, but provide a set of file low level API
+ for read/write the zip file (see ioapi.h)
+*/
+
+extern int ZEXPORT unzClose OF((unzFile file));
+/*
+ Close a ZipFile opened with unzOpen.
+ If there is files inside the .Zip opened with unzOpenCurrentFile (see later),
+ these files MUST be closed with unzCloseCurrentFile before call unzClose.
+ return UNZ_OK if there is no problem. */
+
+extern int ZEXPORT unzGetGlobalInfo OF((unzFile file,
+ unz_global_info *pglobal_info));
+
+extern int ZEXPORT unzGetGlobalInfo64 OF((unzFile file,
+ unz_global_info64 *pglobal_info));
+/*
+ Write info about the ZipFile in the *pglobal_info structure.
+ No preparation of the structure is needed
+ return UNZ_OK if there is no problem. */
+
+
+extern int ZEXPORT unzGetGlobalComment OF((unzFile file,
+ char *szComment,
+ uLong uSizeBuf));
+/*
+ Get the global comment string of the ZipFile, in the szComment buffer.
+ uSizeBuf is the size of the szComment buffer.
+ return the number of byte copied or an error code <0
+*/
+
+
+/***************************************************************************/
+/* Unzip package allow you browse the directory of the zipfile */
+
+extern int ZEXPORT unzGoToFirstFile OF((unzFile file));
+/*
+ Set the current file of the zipfile to the first file.
+ return UNZ_OK if there is no problem
+*/
+
+extern int ZEXPORT unzGoToNextFile OF((unzFile file));
+/*
+ Set the current file of the zipfile to the next file.
+ return UNZ_OK if there is no problem
+ return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
+*/
+
+extern int ZEXPORT unzLocateFile OF((unzFile file,
+ const char *szFileName,
+ int iCaseSensitivity));
+/*
+ Try locate the file szFileName in the zipfile.
+ For the iCaseSensitivity signification, see unzStringFileNameCompare
+
+ return value :
+ UNZ_OK if the file is found. It becomes the current file.
+ UNZ_END_OF_LIST_OF_FILE if the file is not found
+*/
+
+
+/* ****************************************** */
+/* Ryan supplied functions */
+/* unz_file_info contain information about a file in the zipfile */
+typedef struct unz_file_pos_s
+{
+ uLong pos_in_zip_directory; /* offset in zip file directory */
+ uLong num_of_file; /* # of file */
+} unz_file_pos;
+
+extern int ZEXPORT unzGetFilePos(
+ unzFile file,
+ unz_file_pos* file_pos);
+
+extern int ZEXPORT unzGoToFilePos(
+ unzFile file,
+ unz_file_pos* file_pos);
+
+typedef struct unz64_file_pos_s
+{
+ ZPOS64_T pos_in_zip_directory; /* offset in zip file directory */
+ ZPOS64_T num_of_file; /* # of file */
+} unz64_file_pos;
+
+extern int ZEXPORT unzGetFilePos64(
+ unzFile file,
+ unz64_file_pos* file_pos);
+
+extern int ZEXPORT unzGoToFilePos64(
+ unzFile file,
+ const unz64_file_pos* file_pos);
+
+/* ****************************************** */
+
+extern int ZEXPORT unzGetCurrentFileInfo64 OF((unzFile file,
+ unz_file_info64 *pfile_info,
+ char *szFileName,
+ uLong fileNameBufferSize,
+ void *extraField,
+ uLong extraFieldBufferSize,
+ char *szComment,
+ uLong commentBufferSize));
+
+extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
+ unz_file_info *pfile_info,
+ char *szFileName,
+ uLong fileNameBufferSize,
+ void *extraField,
+ uLong extraFieldBufferSize,
+ char *szComment,
+ uLong commentBufferSize));
+/*
+ Get Info about the current file
+ if pfile_info!=NULL, the *pfile_info structure will contain somes info about
+ the current file
+ if szFileName!=NULL, the filemane string will be copied in szFileName
+ (fileNameBufferSize is the size of the buffer)
+ if extraField!=NULL, the extra field information will be copied in extraField
+ (extraFieldBufferSize is the size of the buffer).
+ This is the Central-header version of the extra field
+ if szComment!=NULL, the comment string of the file will be copied in szComment
+ (commentBufferSize is the size of the buffer)
+*/
+
+
+/** Addition for GDAL : START */
+
+extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 OF((unzFile file));
+
+/** Addition for GDAL : END */
+
+
+/***************************************************************************/
+/* for reading the content of the current zipfile, you can open it, read data
+ from it, and close it (you can close it before reading all the file)
+ */
+
+extern int ZEXPORT unzOpenCurrentFile OF((unzFile file));
+/*
+ Open for reading data the current file in the zipfile.
+ If there is no error, the return value is UNZ_OK.
+*/
+
+extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file,
+ const char* password));
+/*
+ Open for reading data the current file in the zipfile.
+ password is a crypting password
+ If there is no error, the return value is UNZ_OK.
+*/
+
+extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file,
+ int* method,
+ int* level,
+ int raw));
+/*
+ Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
+ if raw==1
+ *method will receive method of compression, *level will receive level of
+ compression
+ note : you can set level parameter as NULL (if you did not want known level,
+ but you CANNOT set method parameter as NULL
+*/
+
+extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file,
+ int* method,
+ int* level,
+ int raw,
+ const char* password));
+/*
+ Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
+ if raw==1
+ *method will receive method of compression, *level will receive level of
+ compression
+ note : you can set level parameter as NULL (if you did not want known level,
+ but you CANNOT set method parameter as NULL
+*/
+
+
+extern int ZEXPORT unzCloseCurrentFile OF((unzFile file));
+/*
+ Close the file in zip opened with unzOpenCurrentFile
+ Return UNZ_CRCERROR if all the file was read but the CRC is not good
+*/
+
+extern int ZEXPORT unzReadCurrentFile OF((unzFile file,
+ voidp buf,
+ unsigned len));
+/*
+ Read bytes from the current file (opened by unzOpenCurrentFile)
+ buf contain buffer where data must be copied
+ len the size of buf.
+
+ return the number of byte copied if somes bytes are copied
+ return 0 if the end of file was reached
+ return <0 with error code if there is an error
+ (UNZ_ERRNO for IO error, or zLib error for uncompress error)
+*/
+
+extern z_off_t ZEXPORT unztell OF((unzFile file));
+
+extern ZPOS64_T ZEXPORT unztell64 OF((unzFile file));
+/*
+ Give the current position in uncompressed data
+*/
+
+extern int ZEXPORT unzeof OF((unzFile file));
+/*
+ return 1 if the end of file was reached, 0 elsewhere
+*/
+
+extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file,
+ voidp buf,
+ unsigned len));
+/*
+ Read extra field from the current file (opened by unzOpenCurrentFile)
+ This is the local-header version of the extra field (sometimes, there is
+ more info in the local-header version than in the central-header)
+
+ if buf==NULL, it return the size of the local extra field
+
+ if buf!=NULL, len is the size of the buffer, the extra header is copied in
+ buf.
+ the return value is the number of bytes copied in buf, or (if <0)
+ the error code
+*/
+
+/***************************************************************************/
+
+/* Get the current file offset */
+extern ZPOS64_T ZEXPORT unzGetOffset64 (unzFile file);
+extern uLong ZEXPORT unzGetOffset (unzFile file);
+
+/* Set the current file offset */
+extern int ZEXPORT unzSetOffset64 (unzFile file, ZPOS64_T pos);
+extern int ZEXPORT unzSetOffset (unzFile file, uLong pos);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _unz64_H */
diff --git a/protocols/Telegram/tgl/zlib/contrib/minizip/zip.c b/protocols/Telegram/tgl/zlib/contrib/minizip/zip.c
new file mode 100644
index 0000000000..ea54853e85
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/minizip/zip.c
@@ -0,0 +1,2007 @@
+/* zip.c -- IO on .zip files using zlib
+ Version 1.1, February 14h, 2010
+ part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
+
+ Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
+
+ Modifications for Zip64 support
+ Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
+
+ For more info read MiniZip_info.txt
+
+ Changes
+ Oct-2009 - Mathias Svensson - Remove old C style function prototypes
+ Oct-2009 - Mathias Svensson - Added Zip64 Support when creating new file archives
+ Oct-2009 - Mathias Svensson - Did some code cleanup and refactoring to get better overview of some functions.
+ Oct-2009 - Mathias Svensson - Added zipRemoveExtraInfoBlock to strip extra field data from its ZIP64 data
+ It is used when recreting zip archive with RAW when deleting items from a zip.
+ ZIP64 data is automaticly added to items that needs it, and existing ZIP64 data need to be removed.
+ Oct-2009 - Mathias Svensson - Added support for BZIP2 as compression mode (bzip2 lib is required)
+ Jan-2010 - back to unzip and minizip 1.0 name scheme, with compatibility layer
+
+*/
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include "zlib.h"
+#include "zip.h"
+
+#ifdef STDC
+# include <stddef.h>
+# include <string.h>
+# include <stdlib.h>
+#endif
+#ifdef NO_ERRNO_H
+ extern int errno;
+#else
+# include <errno.h>
+#endif
+
+
+#ifndef local
+# define local static
+#endif
+/* compile with -Dlocal if your debugger can't find static symbols */
+
+#ifndef VERSIONMADEBY
+# define VERSIONMADEBY (0x0) /* platform depedent */
+#endif
+
+#ifndef Z_BUFSIZE
+#define Z_BUFSIZE (64*1024) //(16384)
+#endif
+
+#ifndef Z_MAXFILENAMEINZIP
+#define Z_MAXFILENAMEINZIP (256)
+#endif
+
+#ifndef ALLOC
+# define ALLOC(size) (malloc(size))
+#endif
+#ifndef TRYFREE
+# define TRYFREE(p) {if (p) free(p);}
+#endif
+
+/*
+#define SIZECENTRALDIRITEM (0x2e)
+#define SIZEZIPLOCALHEADER (0x1e)
+*/
+
+/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */
+
+
+// NOT sure that this work on ALL platform
+#define MAKEULONG64(a, b) ((ZPOS64_T)(((unsigned long)(a)) | ((ZPOS64_T)((unsigned long)(b))) << 32))
+
+#ifndef SEEK_CUR
+#define SEEK_CUR 1
+#endif
+
+#ifndef SEEK_END
+#define SEEK_END 2
+#endif
+
+#ifndef SEEK_SET
+#define SEEK_SET 0
+#endif
+
+#ifndef DEF_MEM_LEVEL
+#if MAX_MEM_LEVEL >= 8
+# define DEF_MEM_LEVEL 8
+#else
+# define DEF_MEM_LEVEL MAX_MEM_LEVEL
+#endif
+#endif
+const char zip_copyright[] =" zip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll";
+
+
+#define SIZEDATA_INDATABLOCK (4096-(4*4))
+
+#define LOCALHEADERMAGIC (0x04034b50)
+#define CENTRALHEADERMAGIC (0x02014b50)
+#define ENDHEADERMAGIC (0x06054b50)
+#define ZIP64ENDHEADERMAGIC (0x6064b50)
+#define ZIP64ENDLOCHEADERMAGIC (0x7064b50)
+
+#define FLAG_LOCALHEADER_OFFSET (0x06)
+#define CRC_LOCALHEADER_OFFSET (0x0e)
+
+#define SIZECENTRALHEADER (0x2e) /* 46 */
+
+typedef struct linkedlist_datablock_internal_s
+{
+ struct linkedlist_datablock_internal_s* next_datablock;
+ uLong avail_in_this_block;
+ uLong filled_in_this_block;
+ uLong unused; /* for future use and alignement */
+ unsigned char data[SIZEDATA_INDATABLOCK];
+} linkedlist_datablock_internal;
+
+typedef struct linkedlist_data_s
+{
+ linkedlist_datablock_internal* first_block;
+ linkedlist_datablock_internal* last_block;
+} linkedlist_data;
+
+
+typedef struct
+{
+ z_stream stream; /* zLib stream structure for inflate */
+#ifdef HAVE_BZIP2
+ bz_stream bstream; /* bzLib stream structure for bziped */
+#endif
+
+ int stream_initialised; /* 1 is stream is initialised */
+ uInt pos_in_buffered_data; /* last written byte in buffered_data */
+
+ ZPOS64_T pos_local_header; /* offset of the local header of the file
+ currenty writing */
+ char* central_header; /* central header data for the current file */
+ uLong size_centralExtra;
+ uLong size_centralheader; /* size of the central header for cur file */
+ uLong size_centralExtraFree; /* Extra bytes allocated to the centralheader but that are not used */
+ uLong flag; /* flag of the file currently writing */
+
+ int method; /* compression method of file currenty wr.*/
+ int raw; /* 1 for directly writing raw data */
+ Byte buffered_data[Z_BUFSIZE];/* buffer contain compressed data to be writ*/
+ uLong dosDate;
+ uLong crc32;
+ int encrypt;
+ int zip64; /* Add ZIP64 extened information in the extra field */
+ ZPOS64_T pos_zip64extrainfo;
+ ZPOS64_T totalCompressedData;
+ ZPOS64_T totalUncompressedData;
+#ifndef NOCRYPT
+ unsigned long keys[3]; /* keys defining the pseudo-random sequence */
+ const z_crc_t* pcrc_32_tab;
+ int crypt_header_size;
+#endif
+} curfile64_info;
+
+typedef struct
+{
+ zlib_filefunc64_32_def z_filefunc;
+ voidpf filestream; /* io structore of the zipfile */
+ linkedlist_data central_dir;/* datablock with central dir in construction*/
+ int in_opened_file_inzip; /* 1 if a file in the zip is currently writ.*/
+ curfile64_info ci; /* info on the file curretly writing */
+
+ ZPOS64_T begin_pos; /* position of the beginning of the zipfile */
+ ZPOS64_T add_position_when_writting_offset;
+ ZPOS64_T number_entry;
+
+#ifndef NO_ADDFILEINEXISTINGZIP
+ char *globalcomment;
+#endif
+
+} zip64_internal;
+
+
+#ifndef NOCRYPT
+#define INCLUDECRYPTINGCODE_IFCRYPTALLOWED
+#include "crypt.h"
+#endif
+
+local linkedlist_datablock_internal* allocate_new_datablock()
+{
+ linkedlist_datablock_internal* ldi;
+ ldi = (linkedlist_datablock_internal*)
+ ALLOC(sizeof(linkedlist_datablock_internal));
+ if (ldi!=NULL)
+ {
+ ldi->next_datablock = NULL ;
+ ldi->filled_in_this_block = 0 ;
+ ldi->avail_in_this_block = SIZEDATA_INDATABLOCK ;
+ }
+ return ldi;
+}
+
+local void free_datablock(linkedlist_datablock_internal* ldi)
+{
+ while (ldi!=NULL)
+ {
+ linkedlist_datablock_internal* ldinext = ldi->next_datablock;
+ TRYFREE(ldi);
+ ldi = ldinext;
+ }
+}
+
+local void init_linkedlist(linkedlist_data* ll)
+{
+ ll->first_block = ll->last_block = NULL;
+}
+
+local void free_linkedlist(linkedlist_data* ll)
+{
+ free_datablock(ll->first_block);
+ ll->first_block = ll->last_block = NULL;
+}
+
+
+local int add_data_in_datablock(linkedlist_data* ll, const void* buf, uLong len)
+{
+ linkedlist_datablock_internal* ldi;
+ const unsigned char* from_copy;
+
+ if (ll==NULL)
+ return ZIP_INTERNALERROR;
+
+ if (ll->last_block == NULL)
+ {
+ ll->first_block = ll->last_block = allocate_new_datablock();
+ if (ll->first_block == NULL)
+ return ZIP_INTERNALERROR;
+ }
+
+ ldi = ll->last_block;
+ from_copy = (unsigned char*)buf;
+
+ while (len>0)
+ {
+ uInt copy_this;
+ uInt i;
+ unsigned char* to_copy;
+
+ if (ldi->avail_in_this_block==0)
+ {
+ ldi->next_datablock = allocate_new_datablock();
+ if (ldi->next_datablock == NULL)
+ return ZIP_INTERNALERROR;
+ ldi = ldi->next_datablock ;
+ ll->last_block = ldi;
+ }
+
+ if (ldi->avail_in_this_block < len)
+ copy_this = (uInt)ldi->avail_in_this_block;
+ else
+ copy_this = (uInt)len;
+
+ to_copy = &(ldi->data[ldi->filled_in_this_block]);
+
+ for (i=0;i<copy_this;i++)
+ *(to_copy+i)=*(from_copy+i);
+
+ ldi->filled_in_this_block += copy_this;
+ ldi->avail_in_this_block -= copy_this;
+ from_copy += copy_this ;
+ len -= copy_this;
+ }
+ return ZIP_OK;
+}
+
+
+
+/****************************************************************************/
+
+#ifndef NO_ADDFILEINEXISTINGZIP
+/* ===========================================================================
+ Inputs a long in LSB order to the given file
+ nbByte == 1, 2 ,4 or 8 (byte, short or long, ZPOS64_T)
+*/
+
+local int zip64local_putValue OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, ZPOS64_T x, int nbByte));
+local int zip64local_putValue (const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, ZPOS64_T x, int nbByte)
+{
+ unsigned char buf[8];
+ int n;
+ for (n = 0; n < nbByte; n++)
+ {
+ buf[n] = (unsigned char)(x & 0xff);
+ x >>= 8;
+ }
+ if (x != 0)
+ { /* data overflow - hack for ZIP64 (X Roche) */
+ for (n = 0; n < nbByte; n++)
+ {
+ buf[n] = 0xff;
+ }
+ }
+
+ if (ZWRITE64(*pzlib_filefunc_def,filestream,buf,nbByte)!=(uLong)nbByte)
+ return ZIP_ERRNO;
+ else
+ return ZIP_OK;
+}
+
+local void zip64local_putValue_inmemory OF((void* dest, ZPOS64_T x, int nbByte));
+local void zip64local_putValue_inmemory (void* dest, ZPOS64_T x, int nbByte)
+{
+ unsigned char* buf=(unsigned char*)dest;
+ int n;
+ for (n = 0; n < nbByte; n++) {
+ buf[n] = (unsigned char)(x & 0xff);
+ x >>= 8;
+ }
+
+ if (x != 0)
+ { /* data overflow - hack for ZIP64 */
+ for (n = 0; n < nbByte; n++)
+ {
+ buf[n] = 0xff;
+ }
+ }
+}
+
+/****************************************************************************/
+
+
+local uLong zip64local_TmzDateToDosDate(const tm_zip* ptm)
+{
+ uLong year = (uLong)ptm->tm_year;
+ if (year>=1980)
+ year-=1980;
+ else if (year>=80)
+ year-=80;
+ return
+ (uLong) (((ptm->tm_mday) + (32 * (ptm->tm_mon+1)) + (512 * year)) << 16) |
+ ((ptm->tm_sec/2) + (32* ptm->tm_min) + (2048 * (uLong)ptm->tm_hour));
+}
+
+
+/****************************************************************************/
+
+local int zip64local_getByte OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, int *pi));
+
+local int zip64local_getByte(const zlib_filefunc64_32_def* pzlib_filefunc_def,voidpf filestream,int* pi)
+{
+ unsigned char c;
+ int err = (int)ZREAD64(*pzlib_filefunc_def,filestream,&c,1);
+ if (err==1)
+ {
+ *pi = (int)c;
+ return ZIP_OK;
+ }
+ else
+ {
+ if (ZERROR64(*pzlib_filefunc_def,filestream))
+ return ZIP_ERRNO;
+ else
+ return ZIP_EOF;
+ }
+}
+
+
+/* ===========================================================================
+ Reads a long in LSB order from the given gz_stream. Sets
+*/
+local int zip64local_getShort OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, uLong *pX));
+
+local int zip64local_getShort (const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, uLong* pX)
+{
+ uLong x ;
+ int i = 0;
+ int err;
+
+ err = zip64local_getByte(pzlib_filefunc_def,filestream,&i);
+ x = (uLong)i;
+
+ if (err==ZIP_OK)
+ err = zip64local_getByte(pzlib_filefunc_def,filestream,&i);
+ x += ((uLong)i)<<8;
+
+ if (err==ZIP_OK)
+ *pX = x;
+ else
+ *pX = 0;
+ return err;
+}
+
+local int zip64local_getLong OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, uLong *pX));
+
+local int zip64local_getLong (const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, uLong* pX)
+{
+ uLong x ;
+ int i = 0;
+ int err;
+
+ err = zip64local_getByte(pzlib_filefunc_def,filestream,&i);
+ x = (uLong)i;
+
+ if (err==ZIP_OK)
+ err = zip64local_getByte(pzlib_filefunc_def,filestream,&i);
+ x += ((uLong)i)<<8;
+
+ if (err==ZIP_OK)
+ err = zip64local_getByte(pzlib_filefunc_def,filestream,&i);
+ x += ((uLong)i)<<16;
+
+ if (err==ZIP_OK)
+ err = zip64local_getByte(pzlib_filefunc_def,filestream,&i);
+ x += ((uLong)i)<<24;
+
+ if (err==ZIP_OK)
+ *pX = x;
+ else
+ *pX = 0;
+ return err;
+}
+
+local int zip64local_getLong64 OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, ZPOS64_T *pX));
+
+
+local int zip64local_getLong64 (const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, ZPOS64_T *pX)
+{
+ ZPOS64_T x;
+ int i = 0;
+ int err;
+
+ err = zip64local_getByte(pzlib_filefunc_def,filestream,&i);
+ x = (ZPOS64_T)i;
+
+ if (err==ZIP_OK)
+ err = zip64local_getByte(pzlib_filefunc_def,filestream,&i);
+ x += ((ZPOS64_T)i)<<8;
+
+ if (err==ZIP_OK)
+ err = zip64local_getByte(pzlib_filefunc_def,filestream,&i);
+ x += ((ZPOS64_T)i)<<16;
+
+ if (err==ZIP_OK)
+ err = zip64local_getByte(pzlib_filefunc_def,filestream,&i);
+ x += ((ZPOS64_T)i)<<24;
+
+ if (err==ZIP_OK)
+ err = zip64local_getByte(pzlib_filefunc_def,filestream,&i);
+ x += ((ZPOS64_T)i)<<32;
+
+ if (err==ZIP_OK)
+ err = zip64local_getByte(pzlib_filefunc_def,filestream,&i);
+ x += ((ZPOS64_T)i)<<40;
+
+ if (err==ZIP_OK)
+ err = zip64local_getByte(pzlib_filefunc_def,filestream,&i);
+ x += ((ZPOS64_T)i)<<48;
+
+ if (err==ZIP_OK)
+ err = zip64local_getByte(pzlib_filefunc_def,filestream,&i);
+ x += ((ZPOS64_T)i)<<56;
+
+ if (err==ZIP_OK)
+ *pX = x;
+ else
+ *pX = 0;
+
+ return err;
+}
+
+#ifndef BUFREADCOMMENT
+#define BUFREADCOMMENT (0x400)
+#endif
+/*
+ Locate the Central directory of a zipfile (at the end, just before
+ the global comment)
+*/
+local ZPOS64_T zip64local_SearchCentralDir OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream));
+
+local ZPOS64_T zip64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream)
+{
+ unsigned char* buf;
+ ZPOS64_T uSizeFile;
+ ZPOS64_T uBackRead;
+ ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */
+ ZPOS64_T uPosFound=0;
+
+ if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0)
+ return 0;
+
+
+ uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream);
+
+ if (uMaxBack>uSizeFile)
+ uMaxBack = uSizeFile;
+
+ buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4);
+ if (buf==NULL)
+ return 0;
+
+ uBackRead = 4;
+ while (uBackRead<uMaxBack)
+ {
+ uLong uReadSize;
+ ZPOS64_T uReadPos ;
+ int i;
+ if (uBackRead+BUFREADCOMMENT>uMaxBack)
+ uBackRead = uMaxBack;
+ else
+ uBackRead+=BUFREADCOMMENT;
+ uReadPos = uSizeFile-uBackRead ;
+
+ uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ?
+ (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos);
+ if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0)
+ break;
+
+ if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize)
+ break;
+
+ for (i=(int)uReadSize-3; (i--)>0;)
+ if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
+ ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06))
+ {
+ uPosFound = uReadPos+i;
+ break;
+ }
+
+ if (uPosFound!=0)
+ break;
+ }
+ TRYFREE(buf);
+ return uPosFound;
+}
+
+/*
+Locate the End of Zip64 Central directory locator and from there find the CD of a zipfile (at the end, just before
+the global comment)
+*/
+local ZPOS64_T zip64local_SearchCentralDir64 OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream));
+
+local ZPOS64_T zip64local_SearchCentralDir64(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream)
+{
+ unsigned char* buf;
+ ZPOS64_T uSizeFile;
+ ZPOS64_T uBackRead;
+ ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */
+ ZPOS64_T uPosFound=0;
+ uLong uL;
+ ZPOS64_T relativeOffset;
+
+ if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0)
+ return 0;
+
+ uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream);
+
+ if (uMaxBack>uSizeFile)
+ uMaxBack = uSizeFile;
+
+ buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4);
+ if (buf==NULL)
+ return 0;
+
+ uBackRead = 4;
+ while (uBackRead<uMaxBack)
+ {
+ uLong uReadSize;
+ ZPOS64_T uReadPos;
+ int i;
+ if (uBackRead+BUFREADCOMMENT>uMaxBack)
+ uBackRead = uMaxBack;
+ else
+ uBackRead+=BUFREADCOMMENT;
+ uReadPos = uSizeFile-uBackRead ;
+
+ uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ?
+ (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos);
+ if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0)
+ break;
+
+ if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize)
+ break;
+
+ for (i=(int)uReadSize-3; (i--)>0;)
+ {
+ // Signature "0x07064b50" Zip64 end of central directory locater
+ if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && ((*(buf+i+2))==0x06) && ((*(buf+i+3))==0x07))
+ {
+ uPosFound = uReadPos+i;
+ break;
+ }
+ }
+
+ if (uPosFound!=0)
+ break;
+ }
+
+ TRYFREE(buf);
+ if (uPosFound == 0)
+ return 0;
+
+ /* Zip64 end of central directory locator */
+ if (ZSEEK64(*pzlib_filefunc_def,filestream, uPosFound,ZLIB_FILEFUNC_SEEK_SET)!=0)
+ return 0;
+
+ /* the signature, already checked */
+ if (zip64local_getLong(pzlib_filefunc_def,filestream,&uL)!=ZIP_OK)
+ return 0;
+
+ /* number of the disk with the start of the zip64 end of central directory */
+ if (zip64local_getLong(pzlib_filefunc_def,filestream,&uL)!=ZIP_OK)
+ return 0;
+ if (uL != 0)
+ return 0;
+
+ /* relative offset of the zip64 end of central directory record */
+ if (zip64local_getLong64(pzlib_filefunc_def,filestream,&relativeOffset)!=ZIP_OK)
+ return 0;
+
+ /* total number of disks */
+ if (zip64local_getLong(pzlib_filefunc_def,filestream,&uL)!=ZIP_OK)
+ return 0;
+ if (uL != 1)
+ return 0;
+
+ /* Goto Zip64 end of central directory record */
+ if (ZSEEK64(*pzlib_filefunc_def,filestream, relativeOffset,ZLIB_FILEFUNC_SEEK_SET)!=0)
+ return 0;
+
+ /* the signature */
+ if (zip64local_getLong(pzlib_filefunc_def,filestream,&uL)!=ZIP_OK)
+ return 0;
+
+ if (uL != 0x06064b50) // signature of 'Zip64 end of central directory'
+ return 0;
+
+ return relativeOffset;
+}
+
+int LoadCentralDirectoryRecord(zip64_internal* pziinit)
+{
+ int err=ZIP_OK;
+ ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/
+
+ ZPOS64_T size_central_dir; /* size of the central directory */
+ ZPOS64_T offset_central_dir; /* offset of start of central directory */
+ ZPOS64_T central_pos;
+ uLong uL;
+
+ uLong number_disk; /* number of the current dist, used for
+ spaning ZIP, unsupported, always 0*/
+ uLong number_disk_with_CD; /* number the the disk with central dir, used
+ for spaning ZIP, unsupported, always 0*/
+ ZPOS64_T number_entry;
+ ZPOS64_T number_entry_CD; /* total number of entries in
+ the central dir
+ (same than number_entry on nospan) */
+ uLong VersionMadeBy;
+ uLong VersionNeeded;
+ uLong size_comment;
+
+ int hasZIP64Record = 0;
+
+ // check first if we find a ZIP64 record
+ central_pos = zip64local_SearchCentralDir64(&pziinit->z_filefunc,pziinit->filestream);
+ if(central_pos > 0)
+ {
+ hasZIP64Record = 1;
+ }
+ else if(central_pos == 0)
+ {
+ central_pos = zip64local_SearchCentralDir(&pziinit->z_filefunc,pziinit->filestream);
+ }
+
+/* disable to allow appending to empty ZIP archive
+ if (central_pos==0)
+ err=ZIP_ERRNO;
+*/
+
+ if(hasZIP64Record)
+ {
+ ZPOS64_T sizeEndOfCentralDirectory;
+ if (ZSEEK64(pziinit->z_filefunc, pziinit->filestream, central_pos, ZLIB_FILEFUNC_SEEK_SET) != 0)
+ err=ZIP_ERRNO;
+
+ /* the signature, already checked */
+ if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream,&uL)!=ZIP_OK)
+ err=ZIP_ERRNO;
+
+ /* size of zip64 end of central directory record */
+ if (zip64local_getLong64(&pziinit->z_filefunc, pziinit->filestream, &sizeEndOfCentralDirectory)!=ZIP_OK)
+ err=ZIP_ERRNO;
+
+ /* version made by */
+ if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream, &VersionMadeBy)!=ZIP_OK)
+ err=ZIP_ERRNO;
+
+ /* version needed to extract */
+ if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream, &VersionNeeded)!=ZIP_OK)
+ err=ZIP_ERRNO;
+
+ /* number of this disk */
+ if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream,&number_disk)!=ZIP_OK)
+ err=ZIP_ERRNO;
+
+ /* number of the disk with the start of the central directory */
+ if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream,&number_disk_with_CD)!=ZIP_OK)
+ err=ZIP_ERRNO;
+
+ /* total number of entries in the central directory on this disk */
+ if (zip64local_getLong64(&pziinit->z_filefunc, pziinit->filestream, &number_entry)!=ZIP_OK)
+ err=ZIP_ERRNO;
+
+ /* total number of entries in the central directory */
+ if (zip64local_getLong64(&pziinit->z_filefunc, pziinit->filestream,&number_entry_CD)!=ZIP_OK)
+ err=ZIP_ERRNO;
+
+ if ((number_entry_CD!=number_entry) || (number_disk_with_CD!=0) || (number_disk!=0))
+ err=ZIP_BADZIPFILE;
+
+ /* size of the central directory */
+ if (zip64local_getLong64(&pziinit->z_filefunc, pziinit->filestream,&size_central_dir)!=ZIP_OK)
+ err=ZIP_ERRNO;
+
+ /* offset of start of central directory with respect to the
+ starting disk number */
+ if (zip64local_getLong64(&pziinit->z_filefunc, pziinit->filestream,&offset_central_dir)!=ZIP_OK)
+ err=ZIP_ERRNO;
+
+ // TODO..
+ // read the comment from the standard central header.
+ size_comment = 0;
+ }
+ else
+ {
+ // Read End of central Directory info
+ if (ZSEEK64(pziinit->z_filefunc, pziinit->filestream, central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0)
+ err=ZIP_ERRNO;
+
+ /* the signature, already checked */
+ if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream,&uL)!=ZIP_OK)
+ err=ZIP_ERRNO;
+
+ /* number of this disk */
+ if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream,&number_disk)!=ZIP_OK)
+ err=ZIP_ERRNO;
+
+ /* number of the disk with the start of the central directory */
+ if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream,&number_disk_with_CD)!=ZIP_OK)
+ err=ZIP_ERRNO;
+
+ /* total number of entries in the central dir on this disk */
+ number_entry = 0;
+ if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream, &uL)!=ZIP_OK)
+ err=ZIP_ERRNO;
+ else
+ number_entry = uL;
+
+ /* total number of entries in the central dir */
+ number_entry_CD = 0;
+ if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream, &uL)!=ZIP_OK)
+ err=ZIP_ERRNO;
+ else
+ number_entry_CD = uL;
+
+ if ((number_entry_CD!=number_entry) || (number_disk_with_CD!=0) || (number_disk!=0))
+ err=ZIP_BADZIPFILE;
+
+ /* size of the central directory */
+ size_central_dir = 0;
+ if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream, &uL)!=ZIP_OK)
+ err=ZIP_ERRNO;
+ else
+ size_central_dir = uL;
+
+ /* offset of start of central directory with respect to the starting disk number */
+ offset_central_dir = 0;
+ if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream, &uL)!=ZIP_OK)
+ err=ZIP_ERRNO;
+ else
+ offset_central_dir = uL;
+
+
+ /* zipfile global comment length */
+ if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream, &size_comment)!=ZIP_OK)
+ err=ZIP_ERRNO;
+ }
+
+ if ((central_pos<offset_central_dir+size_central_dir) &&
+ (err==ZIP_OK))
+ err=ZIP_BADZIPFILE;
+
+ if (err!=ZIP_OK)
+ {
+ ZCLOSE64(pziinit->z_filefunc, pziinit->filestream);
+ return ZIP_ERRNO;
+ }
+
+ if (size_comment>0)
+ {
+ pziinit->globalcomment = (char*)ALLOC(size_comment+1);
+ if (pziinit->globalcomment)
+ {
+ size_comment = ZREAD64(pziinit->z_filefunc, pziinit->filestream, pziinit->globalcomment,size_comment);
+ pziinit->globalcomment[size_comment]=0;
+ }
+ }
+
+ byte_before_the_zipfile = central_pos - (offset_central_dir+size_central_dir);
+ pziinit->add_position_when_writting_offset = byte_before_the_zipfile;
+
+ {
+ ZPOS64_T size_central_dir_to_read = size_central_dir;
+ size_t buf_size = SIZEDATA_INDATABLOCK;
+ void* buf_read = (void*)ALLOC(buf_size);
+ if (ZSEEK64(pziinit->z_filefunc, pziinit->filestream, offset_central_dir + byte_before_the_zipfile, ZLIB_FILEFUNC_SEEK_SET) != 0)
+ err=ZIP_ERRNO;
+
+ while ((size_central_dir_to_read>0) && (err==ZIP_OK))
+ {
+ ZPOS64_T read_this = SIZEDATA_INDATABLOCK;
+ if (read_this > size_central_dir_to_read)
+ read_this = size_central_dir_to_read;
+
+ if (ZREAD64(pziinit->z_filefunc, pziinit->filestream,buf_read,(uLong)read_this) != read_this)
+ err=ZIP_ERRNO;
+
+ if (err==ZIP_OK)
+ err = add_data_in_datablock(&pziinit->central_dir,buf_read, (uLong)read_this);
+
+ size_central_dir_to_read-=read_this;
+ }
+ TRYFREE(buf_read);
+ }
+ pziinit->begin_pos = byte_before_the_zipfile;
+ pziinit->number_entry = number_entry_CD;
+
+ if (ZSEEK64(pziinit->z_filefunc, pziinit->filestream, offset_central_dir+byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET) != 0)
+ err=ZIP_ERRNO;
+
+ return err;
+}
+
+
+#endif /* !NO_ADDFILEINEXISTINGZIP*/
+
+
+/************************************************************/
+extern zipFile ZEXPORT zipOpen3 (const void *pathname, int append, zipcharpc* globalcomment, zlib_filefunc64_32_def* pzlib_filefunc64_32_def)
+{
+ zip64_internal ziinit;
+ zip64_internal* zi;
+ int err=ZIP_OK;
+
+ ziinit.z_filefunc.zseek32_file = NULL;
+ ziinit.z_filefunc.ztell32_file = NULL;
+ if (pzlib_filefunc64_32_def==NULL)
+ fill_fopen64_filefunc(&ziinit.z_filefunc.zfile_func64);
+ else
+ ziinit.z_filefunc = *pzlib_filefunc64_32_def;
+
+ ziinit.filestream = ZOPEN64(ziinit.z_filefunc,
+ pathname,
+ (append == APPEND_STATUS_CREATE) ?
+ (ZLIB_FILEFUNC_MODE_READ | ZLIB_FILEFUNC_MODE_WRITE | ZLIB_FILEFUNC_MODE_CREATE) :
+ (ZLIB_FILEFUNC_MODE_READ | ZLIB_FILEFUNC_MODE_WRITE | ZLIB_FILEFUNC_MODE_EXISTING));
+
+ if (ziinit.filestream == NULL)
+ return NULL;
+
+ if (append == APPEND_STATUS_CREATEAFTER)
+ ZSEEK64(ziinit.z_filefunc,ziinit.filestream,0,SEEK_END);
+
+ ziinit.begin_pos = ZTELL64(ziinit.z_filefunc,ziinit.filestream);
+ ziinit.in_opened_file_inzip = 0;
+ ziinit.ci.stream_initialised = 0;
+ ziinit.number_entry = 0;
+ ziinit.add_position_when_writting_offset = 0;
+ init_linkedlist(&(ziinit.central_dir));
+
+
+
+ zi = (zip64_internal*)ALLOC(sizeof(zip64_internal));
+ if (zi==NULL)
+ {
+ ZCLOSE64(ziinit.z_filefunc,ziinit.filestream);
+ return NULL;
+ }
+
+ /* now we add file in a zipfile */
+# ifndef NO_ADDFILEINEXISTINGZIP
+ ziinit.globalcomment = NULL;
+ if (append == APPEND_STATUS_ADDINZIP)
+ {
+ // Read and Cache Central Directory Records
+ err = LoadCentralDirectoryRecord(&ziinit);
+ }
+
+ if (globalcomment)
+ {
+ *globalcomment = ziinit.globalcomment;
+ }
+# endif /* !NO_ADDFILEINEXISTINGZIP*/
+
+ if (err != ZIP_OK)
+ {
+# ifndef NO_ADDFILEINEXISTINGZIP
+ TRYFREE(ziinit.globalcomment);
+# endif /* !NO_ADDFILEINEXISTINGZIP*/
+ TRYFREE(zi);
+ return NULL;
+ }
+ else
+ {
+ *zi = ziinit;
+ return (zipFile)zi;
+ }
+}
+
+extern zipFile ZEXPORT zipOpen2 (const char *pathname, int append, zipcharpc* globalcomment, zlib_filefunc_def* pzlib_filefunc32_def)
+{
+ if (pzlib_filefunc32_def != NULL)
+ {
+ zlib_filefunc64_32_def zlib_filefunc64_32_def_fill;
+ fill_zlib_filefunc64_32_def_from_filefunc32(&zlib_filefunc64_32_def_fill,pzlib_filefunc32_def);
+ return zipOpen3(pathname, append, globalcomment, &zlib_filefunc64_32_def_fill);
+ }
+ else
+ return zipOpen3(pathname, append, globalcomment, NULL);
+}
+
+extern zipFile ZEXPORT zipOpen2_64 (const void *pathname, int append, zipcharpc* globalcomment, zlib_filefunc64_def* pzlib_filefunc_def)
+{
+ if (pzlib_filefunc_def != NULL)
+ {
+ zlib_filefunc64_32_def zlib_filefunc64_32_def_fill;
+ zlib_filefunc64_32_def_fill.zfile_func64 = *pzlib_filefunc_def;
+ zlib_filefunc64_32_def_fill.ztell32_file = NULL;
+ zlib_filefunc64_32_def_fill.zseek32_file = NULL;
+ return zipOpen3(pathname, append, globalcomment, &zlib_filefunc64_32_def_fill);
+ }
+ else
+ return zipOpen3(pathname, append, globalcomment, NULL);
+}
+
+
+
+extern zipFile ZEXPORT zipOpen (const char* pathname, int append)
+{
+ return zipOpen3((const void*)pathname,append,NULL,NULL);
+}
+
+extern zipFile ZEXPORT zipOpen64 (const void* pathname, int append)
+{
+ return zipOpen3(pathname,append,NULL,NULL);
+}
+
+int Write_LocalFileHeader(zip64_internal* zi, const char* filename, uInt size_extrafield_local, const void* extrafield_local)
+{
+ /* write the local header */
+ int err;
+ uInt size_filename = (uInt)strlen(filename);
+ uInt size_extrafield = size_extrafield_local;
+
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)LOCALHEADERMAGIC, 4);
+
+ if (err==ZIP_OK)
+ {
+ if(zi->ci.zip64)
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)45,2);/* version needed to extract */
+ else
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)20,2);/* version needed to extract */
+ }
+
+ if (err==ZIP_OK)
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.flag,2);
+
+ if (err==ZIP_OK)
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.method,2);
+
+ if (err==ZIP_OK)
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.dosDate,4);
+
+ // CRC / Compressed size / Uncompressed size will be filled in later and rewritten later
+ if (err==ZIP_OK)
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* crc 32, unknown */
+ if (err==ZIP_OK)
+ {
+ if(zi->ci.zip64)
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0xFFFFFFFF,4); /* compressed size, unknown */
+ else
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* compressed size, unknown */
+ }
+ if (err==ZIP_OK)
+ {
+ if(zi->ci.zip64)
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0xFFFFFFFF,4); /* uncompressed size, unknown */
+ else
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* uncompressed size, unknown */
+ }
+
+ if (err==ZIP_OK)
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_filename,2);
+
+ if(zi->ci.zip64)
+ {
+ size_extrafield += 20;
+ }
+
+ if (err==ZIP_OK)
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_extrafield,2);
+
+ if ((err==ZIP_OK) && (size_filename > 0))
+ {
+ if (ZWRITE64(zi->z_filefunc,zi->filestream,filename,size_filename)!=size_filename)
+ err = ZIP_ERRNO;
+ }
+
+ if ((err==ZIP_OK) && (size_extrafield_local > 0))
+ {
+ if (ZWRITE64(zi->z_filefunc, zi->filestream, extrafield_local, size_extrafield_local) != size_extrafield_local)
+ err = ZIP_ERRNO;
+ }
+
+
+ if ((err==ZIP_OK) && (zi->ci.zip64))
+ {
+ // write the Zip64 extended info
+ short HeaderID = 1;
+ short DataSize = 16;
+ ZPOS64_T CompressedSize = 0;
+ ZPOS64_T UncompressedSize = 0;
+
+ // Remember position of Zip64 extended info for the local file header. (needed when we update size after done with file)
+ zi->ci.pos_zip64extrainfo = ZTELL64(zi->z_filefunc,zi->filestream);
+
+ err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (short)HeaderID,2);
+ err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (short)DataSize,2);
+
+ err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)UncompressedSize,8);
+ err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)CompressedSize,8);
+ }
+
+ return err;
+}
+
+/*
+ NOTE.
+ When writing RAW the ZIP64 extended information in extrafield_local and extrafield_global needs to be stripped
+ before calling this function it can be done with zipRemoveExtraInfoBlock
+
+ It is not done here because then we need to realloc a new buffer since parameters are 'const' and I want to minimize
+ unnecessary allocations.
+ */
+extern int ZEXPORT zipOpenNewFileInZip4_64 (zipFile file, const char* filename, const zip_fileinfo* zipfi,
+ const void* extrafield_local, uInt size_extrafield_local,
+ const void* extrafield_global, uInt size_extrafield_global,
+ const char* comment, int method, int level, int raw,
+ int windowBits,int memLevel, int strategy,
+ const char* password, uLong crcForCrypting,
+ uLong versionMadeBy, uLong flagBase, int zip64)
+{
+ zip64_internal* zi;
+ uInt size_filename;
+ uInt size_comment;
+ uInt i;
+ int err = ZIP_OK;
+
+# ifdef NOCRYPT
+ (crcForCrypting);
+ if (password != NULL)
+ return ZIP_PARAMERROR;
+# endif
+
+ if (file == NULL)
+ return ZIP_PARAMERROR;
+
+#ifdef HAVE_BZIP2
+ if ((method!=0) && (method!=Z_DEFLATED) && (method!=Z_BZIP2ED))
+ return ZIP_PARAMERROR;
+#else
+ if ((method!=0) && (method!=Z_DEFLATED))
+ return ZIP_PARAMERROR;
+#endif
+
+ zi = (zip64_internal*)file;
+
+ if (zi->in_opened_file_inzip == 1)
+ {
+ err = zipCloseFileInZip (file);
+ if (err != ZIP_OK)
+ return err;
+ }
+
+ if (filename==NULL)
+ filename="-";
+
+ if (comment==NULL)
+ size_comment = 0;
+ else
+ size_comment = (uInt)strlen(comment);
+
+ size_filename = (uInt)strlen(filename);
+
+ if (zipfi == NULL)
+ zi->ci.dosDate = 0;
+ else
+ {
+ if (zipfi->dosDate != 0)
+ zi->ci.dosDate = zipfi->dosDate;
+ else
+ zi->ci.dosDate = zip64local_TmzDateToDosDate(&zipfi->tmz_date);
+ }
+
+ zi->ci.flag = flagBase;
+ if ((level==8) || (level==9))
+ zi->ci.flag |= 2;
+ if (level==2)
+ zi->ci.flag |= 4;
+ if (level==1)
+ zi->ci.flag |= 6;
+ if (password != NULL)
+ zi->ci.flag |= 1;
+
+ zi->ci.crc32 = 0;
+ zi->ci.method = method;
+ zi->ci.encrypt = 0;
+ zi->ci.stream_initialised = 0;
+ zi->ci.pos_in_buffered_data = 0;
+ zi->ci.raw = raw;
+ zi->ci.pos_local_header = ZTELL64(zi->z_filefunc,zi->filestream);
+
+ zi->ci.size_centralheader = SIZECENTRALHEADER + size_filename + size_extrafield_global + size_comment;
+ zi->ci.size_centralExtraFree = 32; // Extra space we have reserved in case we need to add ZIP64 extra info data
+
+ zi->ci.central_header = (char*)ALLOC((uInt)zi->ci.size_centralheader + zi->ci.size_centralExtraFree);
+
+ zi->ci.size_centralExtra = size_extrafield_global;
+ zip64local_putValue_inmemory(zi->ci.central_header,(uLong)CENTRALHEADERMAGIC,4);
+ /* version info */
+ zip64local_putValue_inmemory(zi->ci.central_header+4,(uLong)versionMadeBy,2);
+ zip64local_putValue_inmemory(zi->ci.central_header+6,(uLong)20,2);
+ zip64local_putValue_inmemory(zi->ci.central_header+8,(uLong)zi->ci.flag,2);
+ zip64local_putValue_inmemory(zi->ci.central_header+10,(uLong)zi->ci.method,2);
+ zip64local_putValue_inmemory(zi->ci.central_header+12,(uLong)zi->ci.dosDate,4);
+ zip64local_putValue_inmemory(zi->ci.central_header+16,(uLong)0,4); /*crc*/
+ zip64local_putValue_inmemory(zi->ci.central_header+20,(uLong)0,4); /*compr size*/
+ zip64local_putValue_inmemory(zi->ci.central_header+24,(uLong)0,4); /*uncompr size*/
+ zip64local_putValue_inmemory(zi->ci.central_header+28,(uLong)size_filename,2);
+ zip64local_putValue_inmemory(zi->ci.central_header+30,(uLong)size_extrafield_global,2);
+ zip64local_putValue_inmemory(zi->ci.central_header+32,(uLong)size_comment,2);
+ zip64local_putValue_inmemory(zi->ci.central_header+34,(uLong)0,2); /*disk nm start*/
+
+ if (zipfi==NULL)
+ zip64local_putValue_inmemory(zi->ci.central_header+36,(uLong)0,2);
+ else
+ zip64local_putValue_inmemory(zi->ci.central_header+36,(uLong)zipfi->internal_fa,2);
+
+ if (zipfi==NULL)
+ zip64local_putValue_inmemory(zi->ci.central_header+38,(uLong)0,4);
+ else
+ zip64local_putValue_inmemory(zi->ci.central_header+38,(uLong)zipfi->external_fa,4);
+
+ if(zi->ci.pos_local_header >= 0xffffffff)
+ zip64local_putValue_inmemory(zi->ci.central_header+42,(uLong)0xffffffff,4);
+ else
+ zip64local_putValue_inmemory(zi->ci.central_header+42,(uLong)zi->ci.pos_local_header - zi->add_position_when_writting_offset,4);
+
+ for (i=0;i<size_filename;i++)
+ *(zi->ci.central_header+SIZECENTRALHEADER+i) = *(filename+i);
+
+ for (i=0;i<size_extrafield_global;i++)
+ *(zi->ci.central_header+SIZECENTRALHEADER+size_filename+i) =
+ *(((const char*)extrafield_global)+i);
+
+ for (i=0;i<size_comment;i++)
+ *(zi->ci.central_header+SIZECENTRALHEADER+size_filename+
+ size_extrafield_global+i) = *(comment+i);
+ if (zi->ci.central_header == NULL)
+ return ZIP_INTERNALERROR;
+
+ zi->ci.zip64 = zip64;
+ zi->ci.totalCompressedData = 0;
+ zi->ci.totalUncompressedData = 0;
+ zi->ci.pos_zip64extrainfo = 0;
+
+ err = Write_LocalFileHeader(zi, filename, size_extrafield_local, extrafield_local);
+
+#ifdef HAVE_BZIP2
+ zi->ci.bstream.avail_in = (uInt)0;
+ zi->ci.bstream.avail_out = (uInt)Z_BUFSIZE;
+ zi->ci.bstream.next_out = (char*)zi->ci.buffered_data;
+ zi->ci.bstream.total_in_hi32 = 0;
+ zi->ci.bstream.total_in_lo32 = 0;
+ zi->ci.bstream.total_out_hi32 = 0;
+ zi->ci.bstream.total_out_lo32 = 0;
+#endif
+
+ zi->ci.stream.avail_in = (uInt)0;
+ zi->ci.stream.avail_out = (uInt)Z_BUFSIZE;
+ zi->ci.stream.next_out = zi->ci.buffered_data;
+ zi->ci.stream.total_in = 0;
+ zi->ci.stream.total_out = 0;
+ zi->ci.stream.data_type = Z_BINARY;
+
+#ifdef HAVE_BZIP2
+ if ((err==ZIP_OK) && (zi->ci.method == Z_DEFLATED || zi->ci.method == Z_BZIP2ED) && (!zi->ci.raw))
+#else
+ if ((err==ZIP_OK) && (zi->ci.method == Z_DEFLATED) && (!zi->ci.raw))
+#endif
+ {
+ if(zi->ci.method == Z_DEFLATED)
+ {
+ zi->ci.stream.zalloc = (alloc_func)0;
+ zi->ci.stream.zfree = (free_func)0;
+ zi->ci.stream.opaque = (voidpf)0;
+
+ if (windowBits>0)
+ windowBits = -windowBits;
+
+ err = deflateInit2(&zi->ci.stream, level, Z_DEFLATED, windowBits, memLevel, strategy);
+
+ if (err==Z_OK)
+ zi->ci.stream_initialised = Z_DEFLATED;
+ }
+ else if(zi->ci.method == Z_BZIP2ED)
+ {
+#ifdef HAVE_BZIP2
+ // Init BZip stuff here
+ zi->ci.bstream.bzalloc = 0;
+ zi->ci.bstream.bzfree = 0;
+ zi->ci.bstream.opaque = (voidpf)0;
+
+ err = BZ2_bzCompressInit(&zi->ci.bstream, level, 0,35);
+ if(err == BZ_OK)
+ zi->ci.stream_initialised = Z_BZIP2ED;
+#endif
+ }
+
+ }
+
+# ifndef NOCRYPT
+ zi->ci.crypt_header_size = 0;
+ if ((err==Z_OK) && (password != NULL))
+ {
+ unsigned char bufHead[RAND_HEAD_LEN];
+ unsigned int sizeHead;
+ zi->ci.encrypt = 1;
+ zi->ci.pcrc_32_tab = get_crc_table();
+ /*init_keys(password,zi->ci.keys,zi->ci.pcrc_32_tab);*/
+
+ sizeHead=crypthead(password,bufHead,RAND_HEAD_LEN,zi->ci.keys,zi->ci.pcrc_32_tab,crcForCrypting);
+ zi->ci.crypt_header_size = sizeHead;
+
+ if (ZWRITE64(zi->z_filefunc,zi->filestream,bufHead,sizeHead) != sizeHead)
+ err = ZIP_ERRNO;
+ }
+# endif
+
+ if (err==Z_OK)
+ zi->in_opened_file_inzip = 1;
+ return err;
+}
+
+extern int ZEXPORT zipOpenNewFileInZip4 (zipFile file, const char* filename, const zip_fileinfo* zipfi,
+ const void* extrafield_local, uInt size_extrafield_local,
+ const void* extrafield_global, uInt size_extrafield_global,
+ const char* comment, int method, int level, int raw,
+ int windowBits,int memLevel, int strategy,
+ const char* password, uLong crcForCrypting,
+ uLong versionMadeBy, uLong flagBase)
+{
+ return zipOpenNewFileInZip4_64 (file, filename, zipfi,
+ extrafield_local, size_extrafield_local,
+ extrafield_global, size_extrafield_global,
+ comment, method, level, raw,
+ windowBits, memLevel, strategy,
+ password, crcForCrypting, versionMadeBy, flagBase, 0);
+}
+
+extern int ZEXPORT zipOpenNewFileInZip3 (zipFile file, const char* filename, const zip_fileinfo* zipfi,
+ const void* extrafield_local, uInt size_extrafield_local,
+ const void* extrafield_global, uInt size_extrafield_global,
+ const char* comment, int method, int level, int raw,
+ int windowBits,int memLevel, int strategy,
+ const char* password, uLong crcForCrypting)
+{
+ return zipOpenNewFileInZip4_64 (file, filename, zipfi,
+ extrafield_local, size_extrafield_local,
+ extrafield_global, size_extrafield_global,
+ comment, method, level, raw,
+ windowBits, memLevel, strategy,
+ password, crcForCrypting, VERSIONMADEBY, 0, 0);
+}
+
+extern int ZEXPORT zipOpenNewFileInZip3_64(zipFile file, const char* filename, const zip_fileinfo* zipfi,
+ const void* extrafield_local, uInt size_extrafield_local,
+ const void* extrafield_global, uInt size_extrafield_global,
+ const char* comment, int method, int level, int raw,
+ int windowBits,int memLevel, int strategy,
+ const char* password, uLong crcForCrypting, int zip64)
+{
+ return zipOpenNewFileInZip4_64 (file, filename, zipfi,
+ extrafield_local, size_extrafield_local,
+ extrafield_global, size_extrafield_global,
+ comment, method, level, raw,
+ windowBits, memLevel, strategy,
+ password, crcForCrypting, VERSIONMADEBY, 0, zip64);
+}
+
+extern int ZEXPORT zipOpenNewFileInZip2(zipFile file, const char* filename, const zip_fileinfo* zipfi,
+ const void* extrafield_local, uInt size_extrafield_local,
+ const void* extrafield_global, uInt size_extrafield_global,
+ const char* comment, int method, int level, int raw)
+{
+ return zipOpenNewFileInZip4_64 (file, filename, zipfi,
+ extrafield_local, size_extrafield_local,
+ extrafield_global, size_extrafield_global,
+ comment, method, level, raw,
+ -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY,
+ NULL, 0, VERSIONMADEBY, 0, 0);
+}
+
+extern int ZEXPORT zipOpenNewFileInZip2_64(zipFile file, const char* filename, const zip_fileinfo* zipfi,
+ const void* extrafield_local, uInt size_extrafield_local,
+ const void* extrafield_global, uInt size_extrafield_global,
+ const char* comment, int method, int level, int raw, int zip64)
+{
+ return zipOpenNewFileInZip4_64 (file, filename, zipfi,
+ extrafield_local, size_extrafield_local,
+ extrafield_global, size_extrafield_global,
+ comment, method, level, raw,
+ -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY,
+ NULL, 0, VERSIONMADEBY, 0, zip64);
+}
+
+extern int ZEXPORT zipOpenNewFileInZip64 (zipFile file, const char* filename, const zip_fileinfo* zipfi,
+ const void* extrafield_local, uInt size_extrafield_local,
+ const void*extrafield_global, uInt size_extrafield_global,
+ const char* comment, int method, int level, int zip64)
+{
+ return zipOpenNewFileInZip4_64 (file, filename, zipfi,
+ extrafield_local, size_extrafield_local,
+ extrafield_global, size_extrafield_global,
+ comment, method, level, 0,
+ -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY,
+ NULL, 0, VERSIONMADEBY, 0, zip64);
+}
+
+extern int ZEXPORT zipOpenNewFileInZip (zipFile file, const char* filename, const zip_fileinfo* zipfi,
+ const void* extrafield_local, uInt size_extrafield_local,
+ const void*extrafield_global, uInt size_extrafield_global,
+ const char* comment, int method, int level)
+{
+ return zipOpenNewFileInZip4_64 (file, filename, zipfi,
+ extrafield_local, size_extrafield_local,
+ extrafield_global, size_extrafield_global,
+ comment, method, level, 0,
+ -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY,
+ NULL, 0, VERSIONMADEBY, 0, 0);
+}
+
+local int zip64FlushWriteBuffer(zip64_internal* zi)
+{
+ int err=ZIP_OK;
+
+ if (zi->ci.encrypt != 0)
+ {
+#ifndef NOCRYPT
+ uInt i;
+ int t;
+ for (i=0;i<zi->ci.pos_in_buffered_data;i++)
+ zi->ci.buffered_data[i] = zencode(zi->ci.keys, zi->ci.pcrc_32_tab, zi->ci.buffered_data[i],t);
+#endif
+ }
+
+ if (ZWRITE64(zi->z_filefunc,zi->filestream,zi->ci.buffered_data,zi->ci.pos_in_buffered_data) != zi->ci.pos_in_buffered_data)
+ err = ZIP_ERRNO;
+
+ zi->ci.totalCompressedData += zi->ci.pos_in_buffered_data;
+
+#ifdef HAVE_BZIP2
+ if(zi->ci.method == Z_BZIP2ED)
+ {
+ zi->ci.totalUncompressedData += zi->ci.bstream.total_in_lo32;
+ zi->ci.bstream.total_in_lo32 = 0;
+ zi->ci.bstream.total_in_hi32 = 0;
+ }
+ else
+#endif
+ {
+ zi->ci.totalUncompressedData += zi->ci.stream.total_in;
+ zi->ci.stream.total_in = 0;
+ }
+
+
+ zi->ci.pos_in_buffered_data = 0;
+
+ return err;
+}
+
+extern int ZEXPORT zipWriteInFileInZip (zipFile file,const void* buf,unsigned int len)
+{
+ zip64_internal* zi;
+ int err=ZIP_OK;
+
+ if (file == NULL)
+ return ZIP_PARAMERROR;
+ zi = (zip64_internal*)file;
+
+ if (zi->in_opened_file_inzip == 0)
+ return ZIP_PARAMERROR;
+
+ zi->ci.crc32 = crc32(zi->ci.crc32,buf,(uInt)len);
+
+#ifdef HAVE_BZIP2
+ if(zi->ci.method == Z_BZIP2ED && (!zi->ci.raw))
+ {
+ zi->ci.bstream.next_in = (void*)buf;
+ zi->ci.bstream.avail_in = len;
+ err = BZ_RUN_OK;
+
+ while ((err==BZ_RUN_OK) && (zi->ci.bstream.avail_in>0))
+ {
+ if (zi->ci.bstream.avail_out == 0)
+ {
+ if (zip64FlushWriteBuffer(zi) == ZIP_ERRNO)
+ err = ZIP_ERRNO;
+ zi->ci.bstream.avail_out = (uInt)Z_BUFSIZE;
+ zi->ci.bstream.next_out = (char*)zi->ci.buffered_data;
+ }
+
+
+ if(err != BZ_RUN_OK)
+ break;
+
+ if ((zi->ci.method == Z_BZIP2ED) && (!zi->ci.raw))
+ {
+ uLong uTotalOutBefore_lo = zi->ci.bstream.total_out_lo32;
+// uLong uTotalOutBefore_hi = zi->ci.bstream.total_out_hi32;
+ err=BZ2_bzCompress(&zi->ci.bstream, BZ_RUN);
+
+ zi->ci.pos_in_buffered_data += (uInt)(zi->ci.bstream.total_out_lo32 - uTotalOutBefore_lo) ;
+ }
+ }
+
+ if(err == BZ_RUN_OK)
+ err = ZIP_OK;
+ }
+ else
+#endif
+ {
+ zi->ci.stream.next_in = (Bytef*)buf;
+ zi->ci.stream.avail_in = len;
+
+ while ((err==ZIP_OK) && (zi->ci.stream.avail_in>0))
+ {
+ if (zi->ci.stream.avail_out == 0)
+ {
+ if (zip64FlushWriteBuffer(zi) == ZIP_ERRNO)
+ err = ZIP_ERRNO;
+ zi->ci.stream.avail_out = (uInt)Z_BUFSIZE;
+ zi->ci.stream.next_out = zi->ci.buffered_data;
+ }
+
+
+ if(err != ZIP_OK)
+ break;
+
+ if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw))
+ {
+ uLong uTotalOutBefore = zi->ci.stream.total_out;
+ err=deflate(&zi->ci.stream, Z_NO_FLUSH);
+ if(uTotalOutBefore > zi->ci.stream.total_out)
+ {
+ int bBreak = 0;
+ bBreak++;
+ }
+
+ zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ;
+ }
+ else
+ {
+ uInt copy_this,i;
+ if (zi->ci.stream.avail_in < zi->ci.stream.avail_out)
+ copy_this = zi->ci.stream.avail_in;
+ else
+ copy_this = zi->ci.stream.avail_out;
+
+ for (i = 0; i < copy_this; i++)
+ *(((char*)zi->ci.stream.next_out)+i) =
+ *(((const char*)zi->ci.stream.next_in)+i);
+ {
+ zi->ci.stream.avail_in -= copy_this;
+ zi->ci.stream.avail_out-= copy_this;
+ zi->ci.stream.next_in+= copy_this;
+ zi->ci.stream.next_out+= copy_this;
+ zi->ci.stream.total_in+= copy_this;
+ zi->ci.stream.total_out+= copy_this;
+ zi->ci.pos_in_buffered_data += copy_this;
+ }
+ }
+ }// while(...)
+ }
+
+ return err;
+}
+
+extern int ZEXPORT zipCloseFileInZipRaw (zipFile file, uLong uncompressed_size, uLong crc32)
+{
+ return zipCloseFileInZipRaw64 (file, uncompressed_size, crc32);
+}
+
+extern int ZEXPORT zipCloseFileInZipRaw64 (zipFile file, ZPOS64_T uncompressed_size, uLong crc32)
+{
+ zip64_internal* zi;
+ ZPOS64_T compressed_size;
+ uLong invalidValue = 0xffffffff;
+ short datasize = 0;
+ int err=ZIP_OK;
+
+ if (file == NULL)
+ return ZIP_PARAMERROR;
+ zi = (zip64_internal*)file;
+
+ if (zi->in_opened_file_inzip == 0)
+ return ZIP_PARAMERROR;
+ zi->ci.stream.avail_in = 0;
+
+ if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw))
+ {
+ while (err==ZIP_OK)
+ {
+ uLong uTotalOutBefore;
+ if (zi->ci.stream.avail_out == 0)
+ {
+ if (zip64FlushWriteBuffer(zi) == ZIP_ERRNO)
+ err = ZIP_ERRNO;
+ zi->ci.stream.avail_out = (uInt)Z_BUFSIZE;
+ zi->ci.stream.next_out = zi->ci.buffered_data;
+ }
+ uTotalOutBefore = zi->ci.stream.total_out;
+ err=deflate(&zi->ci.stream, Z_FINISH);
+ zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ;
+ }
+ }
+ else if ((zi->ci.method == Z_BZIP2ED) && (!zi->ci.raw))
+ {
+#ifdef HAVE_BZIP2
+ err = BZ_FINISH_OK;
+ while (err==BZ_FINISH_OK)
+ {
+ uLong uTotalOutBefore;
+ if (zi->ci.bstream.avail_out == 0)
+ {
+ if (zip64FlushWriteBuffer(zi) == ZIP_ERRNO)
+ err = ZIP_ERRNO;
+ zi->ci.bstream.avail_out = (uInt)Z_BUFSIZE;
+ zi->ci.bstream.next_out = (char*)zi->ci.buffered_data;
+ }
+ uTotalOutBefore = zi->ci.bstream.total_out_lo32;
+ err=BZ2_bzCompress(&zi->ci.bstream, BZ_FINISH);
+ if(err == BZ_STREAM_END)
+ err = Z_STREAM_END;
+
+ zi->ci.pos_in_buffered_data += (uInt)(zi->ci.bstream.total_out_lo32 - uTotalOutBefore);
+ }
+
+ if(err == BZ_FINISH_OK)
+ err = ZIP_OK;
+#endif
+ }
+
+ if (err==Z_STREAM_END)
+ err=ZIP_OK; /* this is normal */
+
+ if ((zi->ci.pos_in_buffered_data>0) && (err==ZIP_OK))
+ {
+ if (zip64FlushWriteBuffer(zi)==ZIP_ERRNO)
+ err = ZIP_ERRNO;
+ }
+
+ if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw))
+ {
+ int tmp_err = deflateEnd(&zi->ci.stream);
+ if (err == ZIP_OK)
+ err = tmp_err;
+ zi->ci.stream_initialised = 0;
+ }
+#ifdef HAVE_BZIP2
+ else if((zi->ci.method == Z_BZIP2ED) && (!zi->ci.raw))
+ {
+ int tmperr = BZ2_bzCompressEnd(&zi->ci.bstream);
+ if (err==ZIP_OK)
+ err = tmperr;
+ zi->ci.stream_initialised = 0;
+ }
+#endif
+
+ if (!zi->ci.raw)
+ {
+ crc32 = (uLong)zi->ci.crc32;
+ uncompressed_size = zi->ci.totalUncompressedData;
+ }
+ compressed_size = zi->ci.totalCompressedData;
+
+# ifndef NOCRYPT
+ compressed_size += zi->ci.crypt_header_size;
+# endif
+
+ // update Current Item crc and sizes,
+ if(compressed_size >= 0xffffffff || uncompressed_size >= 0xffffffff || zi->ci.pos_local_header >= 0xffffffff)
+ {
+ /*version Made by*/
+ zip64local_putValue_inmemory(zi->ci.central_header+4,(uLong)45,2);
+ /*version needed*/
+ zip64local_putValue_inmemory(zi->ci.central_header+6,(uLong)45,2);
+
+ }
+
+ zip64local_putValue_inmemory(zi->ci.central_header+16,crc32,4); /*crc*/
+
+
+ if(compressed_size >= 0xffffffff)
+ zip64local_putValue_inmemory(zi->ci.central_header+20, invalidValue,4); /*compr size*/
+ else
+ zip64local_putValue_inmemory(zi->ci.central_header+20, compressed_size,4); /*compr size*/
+
+ /// set internal file attributes field
+ if (zi->ci.stream.data_type == Z_ASCII)
+ zip64local_putValue_inmemory(zi->ci.central_header+36,(uLong)Z_ASCII,2);
+
+ if(uncompressed_size >= 0xffffffff)
+ zip64local_putValue_inmemory(zi->ci.central_header+24, invalidValue,4); /*uncompr size*/
+ else
+ zip64local_putValue_inmemory(zi->ci.central_header+24, uncompressed_size,4); /*uncompr size*/
+
+ // Add ZIP64 extra info field for uncompressed size
+ if(uncompressed_size >= 0xffffffff)
+ datasize += 8;
+
+ // Add ZIP64 extra info field for compressed size
+ if(compressed_size >= 0xffffffff)
+ datasize += 8;
+
+ // Add ZIP64 extra info field for relative offset to local file header of current file
+ if(zi->ci.pos_local_header >= 0xffffffff)
+ datasize += 8;
+
+ if(datasize > 0)
+ {
+ char* p = NULL;
+
+ if((uLong)(datasize + 4) > zi->ci.size_centralExtraFree)
+ {
+ // we can not write more data to the buffer that we have room for.
+ return ZIP_BADZIPFILE;
+ }
+
+ p = zi->ci.central_header + zi->ci.size_centralheader;
+
+ // Add Extra Information Header for 'ZIP64 information'
+ zip64local_putValue_inmemory(p, 0x0001, 2); // HeaderID
+ p += 2;
+ zip64local_putValue_inmemory(p, datasize, 2); // DataSize
+ p += 2;
+
+ if(uncompressed_size >= 0xffffffff)
+ {
+ zip64local_putValue_inmemory(p, uncompressed_size, 8);
+ p += 8;
+ }
+
+ if(compressed_size >= 0xffffffff)
+ {
+ zip64local_putValue_inmemory(p, compressed_size, 8);
+ p += 8;
+ }
+
+ if(zi->ci.pos_local_header >= 0xffffffff)
+ {
+ zip64local_putValue_inmemory(p, zi->ci.pos_local_header, 8);
+ p += 8;
+ }
+
+ // Update how much extra free space we got in the memory buffer
+ // and increase the centralheader size so the new ZIP64 fields are included
+ // ( 4 below is the size of HeaderID and DataSize field )
+ zi->ci.size_centralExtraFree -= datasize + 4;
+ zi->ci.size_centralheader += datasize + 4;
+
+ // Update the extra info size field
+ zi->ci.size_centralExtra += datasize + 4;
+ zip64local_putValue_inmemory(zi->ci.central_header+30,(uLong)zi->ci.size_centralExtra,2);
+ }
+
+ if (err==ZIP_OK)
+ err = add_data_in_datablock(&zi->central_dir, zi->ci.central_header, (uLong)zi->ci.size_centralheader);
+
+ free(zi->ci.central_header);
+
+ if (err==ZIP_OK)
+ {
+ // Update the LocalFileHeader with the new values.
+
+ ZPOS64_T cur_pos_inzip = ZTELL64(zi->z_filefunc,zi->filestream);
+
+ if (ZSEEK64(zi->z_filefunc,zi->filestream, zi->ci.pos_local_header + 14,ZLIB_FILEFUNC_SEEK_SET)!=0)
+ err = ZIP_ERRNO;
+
+ if (err==ZIP_OK)
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,crc32,4); /* crc 32, unknown */
+
+ if(uncompressed_size >= 0xffffffff || compressed_size >= 0xffffffff )
+ {
+ if(zi->ci.pos_zip64extrainfo > 0)
+ {
+ // Update the size in the ZIP64 extended field.
+ if (ZSEEK64(zi->z_filefunc,zi->filestream, zi->ci.pos_zip64extrainfo + 4,ZLIB_FILEFUNC_SEEK_SET)!=0)
+ err = ZIP_ERRNO;
+
+ if (err==ZIP_OK) /* compressed size, unknown */
+ err = zip64local_putValue(&zi->z_filefunc, zi->filestream, uncompressed_size, 8);
+
+ if (err==ZIP_OK) /* uncompressed size, unknown */
+ err = zip64local_putValue(&zi->z_filefunc, zi->filestream, compressed_size, 8);
+ }
+ else
+ err = ZIP_BADZIPFILE; // Caller passed zip64 = 0, so no room for zip64 info -> fatal
+ }
+ else
+ {
+ if (err==ZIP_OK) /* compressed size, unknown */
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,compressed_size,4);
+
+ if (err==ZIP_OK) /* uncompressed size, unknown */
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,uncompressed_size,4);
+ }
+
+ if (ZSEEK64(zi->z_filefunc,zi->filestream, cur_pos_inzip,ZLIB_FILEFUNC_SEEK_SET)!=0)
+ err = ZIP_ERRNO;
+ }
+
+ zi->number_entry ++;
+ zi->in_opened_file_inzip = 0;
+
+ return err;
+}
+
+extern int ZEXPORT zipCloseFileInZip (zipFile file)
+{
+ return zipCloseFileInZipRaw (file,0,0);
+}
+
+int Write_Zip64EndOfCentralDirectoryLocator(zip64_internal* zi, ZPOS64_T zip64eocd_pos_inzip)
+{
+ int err = ZIP_OK;
+ ZPOS64_T pos = zip64eocd_pos_inzip - zi->add_position_when_writting_offset;
+
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)ZIP64ENDLOCHEADERMAGIC,4);
+
+ /*num disks*/
+ if (err==ZIP_OK) /* number of the disk with the start of the central directory */
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4);
+
+ /*relative offset*/
+ if (err==ZIP_OK) /* Relative offset to the Zip64EndOfCentralDirectory */
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream, pos,8);
+
+ /*total disks*/ /* Do not support spawning of disk so always say 1 here*/
+ if (err==ZIP_OK) /* number of the disk with the start of the central directory */
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)1,4);
+
+ return err;
+}
+
+int Write_Zip64EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip)
+{
+ int err = ZIP_OK;
+
+ uLong Zip64DataSize = 44;
+
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)ZIP64ENDHEADERMAGIC,4);
+
+ if (err==ZIP_OK) /* size of this 'zip64 end of central directory' */
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(ZPOS64_T)Zip64DataSize,8); // why ZPOS64_T of this ?
+
+ if (err==ZIP_OK) /* version made by */
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)45,2);
+
+ if (err==ZIP_OK) /* version needed */
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)45,2);
+
+ if (err==ZIP_OK) /* number of this disk */
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4);
+
+ if (err==ZIP_OK) /* number of the disk with the start of the central directory */
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4);
+
+ if (err==ZIP_OK) /* total number of entries in the central dir on this disk */
+ err = zip64local_putValue(&zi->z_filefunc, zi->filestream, zi->number_entry, 8);
+
+ if (err==ZIP_OK) /* total number of entries in the central dir */
+ err = zip64local_putValue(&zi->z_filefunc, zi->filestream, zi->number_entry, 8);
+
+ if (err==ZIP_OK) /* size of the central directory */
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(ZPOS64_T)size_centraldir,8);
+
+ if (err==ZIP_OK) /* offset of start of central directory with respect to the starting disk number */
+ {
+ ZPOS64_T pos = centraldir_pos_inzip - zi->add_position_when_writting_offset;
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (ZPOS64_T)pos,8);
+ }
+ return err;
+}
+int Write_EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip)
+{
+ int err = ZIP_OK;
+
+ /*signature*/
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)ENDHEADERMAGIC,4);
+
+ if (err==ZIP_OK) /* number of this disk */
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,2);
+
+ if (err==ZIP_OK) /* number of the disk with the start of the central directory */
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,2);
+
+ if (err==ZIP_OK) /* total number of entries in the central dir on this disk */
+ {
+ {
+ if(zi->number_entry >= 0xFFFF)
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0xffff,2); // use value in ZIP64 record
+ else
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->number_entry,2);
+ }
+ }
+
+ if (err==ZIP_OK) /* total number of entries in the central dir */
+ {
+ if(zi->number_entry >= 0xFFFF)
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0xffff,2); // use value in ZIP64 record
+ else
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->number_entry,2);
+ }
+
+ if (err==ZIP_OK) /* size of the central directory */
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_centraldir,4);
+
+ if (err==ZIP_OK) /* offset of start of central directory with respect to the starting disk number */
+ {
+ ZPOS64_T pos = centraldir_pos_inzip - zi->add_position_when_writting_offset;
+ if(pos >= 0xffffffff)
+ {
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (uLong)0xffffffff,4);
+ }
+ else
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (uLong)(centraldir_pos_inzip - zi->add_position_when_writting_offset),4);
+ }
+
+ return err;
+}
+
+int Write_GlobalComment(zip64_internal* zi, const char* global_comment)
+{
+ int err = ZIP_OK;
+ uInt size_global_comment = 0;
+
+ if(global_comment != NULL)
+ size_global_comment = (uInt)strlen(global_comment);
+
+ err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_global_comment,2);
+
+ if (err == ZIP_OK && size_global_comment > 0)
+ {
+ if (ZWRITE64(zi->z_filefunc,zi->filestream, global_comment, size_global_comment) != size_global_comment)
+ err = ZIP_ERRNO;
+ }
+ return err;
+}
+
+extern int ZEXPORT zipClose (zipFile file, const char* global_comment)
+{
+ zip64_internal* zi;
+ int err = 0;
+ uLong size_centraldir = 0;
+ ZPOS64_T centraldir_pos_inzip;
+ ZPOS64_T pos;
+
+ if (file == NULL)
+ return ZIP_PARAMERROR;
+
+ zi = (zip64_internal*)file;
+
+ if (zi->in_opened_file_inzip == 1)
+ {
+ err = zipCloseFileInZip (file);
+ }
+
+#ifndef NO_ADDFILEINEXISTINGZIP
+ if (global_comment==NULL)
+ global_comment = zi->globalcomment;
+#endif
+
+ centraldir_pos_inzip = ZTELL64(zi->z_filefunc,zi->filestream);
+
+ if (err==ZIP_OK)
+ {
+ linkedlist_datablock_internal* ldi = zi->central_dir.first_block;
+ while (ldi!=NULL)
+ {
+ if ((err==ZIP_OK) && (ldi->filled_in_this_block>0))
+ {
+ if (ZWRITE64(zi->z_filefunc,zi->filestream, ldi->data, ldi->filled_in_this_block) != ldi->filled_in_this_block)
+ err = ZIP_ERRNO;
+ }
+
+ size_centraldir += ldi->filled_in_this_block;
+ ldi = ldi->next_datablock;
+ }
+ }
+ free_linkedlist(&(zi->central_dir));
+
+ pos = centraldir_pos_inzip - zi->add_position_when_writting_offset;
+ if(pos >= 0xffffffff || zi->number_entry > 0xFFFF)
+ {
+ ZPOS64_T Zip64EOCDpos = ZTELL64(zi->z_filefunc,zi->filestream);
+ Write_Zip64EndOfCentralDirectoryRecord(zi, size_centraldir, centraldir_pos_inzip);
+
+ Write_Zip64EndOfCentralDirectoryLocator(zi, Zip64EOCDpos);
+ }
+
+ if (err==ZIP_OK)
+ err = Write_EndOfCentralDirectoryRecord(zi, size_centraldir, centraldir_pos_inzip);
+
+ if(err == ZIP_OK)
+ err = Write_GlobalComment(zi, global_comment);
+
+ if (ZCLOSE64(zi->z_filefunc,zi->filestream) != 0)
+ if (err == ZIP_OK)
+ err = ZIP_ERRNO;
+
+#ifndef NO_ADDFILEINEXISTINGZIP
+ TRYFREE(zi->globalcomment);
+#endif
+ TRYFREE(zi);
+
+ return err;
+}
+
+extern int ZEXPORT zipRemoveExtraInfoBlock (char* pData, int* dataLen, short sHeader)
+{
+ char* p = pData;
+ int size = 0;
+ char* pNewHeader;
+ char* pTmp;
+ short header;
+ short dataSize;
+
+ int retVal = ZIP_OK;
+
+ if(pData == NULL || *dataLen < 4)
+ return ZIP_PARAMERROR;
+
+ pNewHeader = (char*)ALLOC(*dataLen);
+ pTmp = pNewHeader;
+
+ while(p < (pData + *dataLen))
+ {
+ header = *(short*)p;
+ dataSize = *(((short*)p)+1);
+
+ if( header == sHeader ) // Header found.
+ {
+ p += dataSize + 4; // skip it. do not copy to temp buffer
+ }
+ else
+ {
+ // Extra Info block should not be removed, So copy it to the temp buffer.
+ memcpy(pTmp, p, dataSize + 4);
+ p += dataSize + 4;
+ size += dataSize + 4;
+ }
+
+ }
+
+ if(size < *dataLen)
+ {
+ // clean old extra info block.
+ memset(pData,0, *dataLen);
+
+ // copy the new extra info block over the old
+ if(size > 0)
+ memcpy(pData, pNewHeader, size);
+
+ // set the new extra info size
+ *dataLen = size;
+
+ retVal = ZIP_OK;
+ }
+ else
+ retVal = ZIP_ERRNO;
+
+ TRYFREE(pNewHeader);
+
+ return retVal;
+}
diff --git a/protocols/Telegram/tgl/zlib/contrib/minizip/zip.h b/protocols/Telegram/tgl/zlib/contrib/minizip/zip.h
new file mode 100644
index 0000000000..8aaebb6234
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/minizip/zip.h
@@ -0,0 +1,362 @@
+/* zip.h -- IO on .zip files using zlib
+ Version 1.1, February 14h, 2010
+ part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
+
+ Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
+
+ Modifications for Zip64 support
+ Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
+
+ For more info read MiniZip_info.txt
+
+ ---------------------------------------------------------------------------
+
+ Condition of use and distribution are the same than zlib :
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ ---------------------------------------------------------------------------
+
+ Changes
+
+ See header of zip.h
+
+*/
+
+#ifndef _zip12_H
+#define _zip12_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//#define HAVE_BZIP2
+
+#ifndef _ZLIB_H
+#include "zlib.h"
+#endif
+
+#ifndef _ZLIBIOAPI_H
+#include "ioapi.h"
+#endif
+
+#ifdef HAVE_BZIP2
+#include "bzlib.h"
+#endif
+
+#define Z_BZIP2ED 12
+
+#if defined(STRICTZIP) || defined(STRICTZIPUNZIP)
+/* like the STRICT of WIN32, we define a pointer that cannot be converted
+ from (void*) without cast */
+typedef struct TagzipFile__ { int unused; } zipFile__;
+typedef zipFile__ *zipFile;
+#else
+typedef voidp zipFile;
+#endif
+
+#define ZIP_OK (0)
+#define ZIP_EOF (0)
+#define ZIP_ERRNO (Z_ERRNO)
+#define ZIP_PARAMERROR (-102)
+#define ZIP_BADZIPFILE (-103)
+#define ZIP_INTERNALERROR (-104)
+
+#ifndef DEF_MEM_LEVEL
+# if MAX_MEM_LEVEL >= 8
+# define DEF_MEM_LEVEL 8
+# else
+# define DEF_MEM_LEVEL MAX_MEM_LEVEL
+# endif
+#endif
+/* default memLevel */
+
+/* tm_zip contain date/time info */
+typedef struct tm_zip_s
+{
+ uInt tm_sec; /* seconds after the minute - [0,59] */
+ uInt tm_min; /* minutes after the hour - [0,59] */
+ uInt tm_hour; /* hours since midnight - [0,23] */
+ uInt tm_mday; /* day of the month - [1,31] */
+ uInt tm_mon; /* months since January - [0,11] */
+ uInt tm_year; /* years - [1980..2044] */
+} tm_zip;
+
+typedef struct
+{
+ tm_zip tmz_date; /* date in understandable format */
+ uLong dosDate; /* if dos_date == 0, tmu_date is used */
+/* uLong flag; */ /* general purpose bit flag 2 bytes */
+
+ uLong internal_fa; /* internal file attributes 2 bytes */
+ uLong external_fa; /* external file attributes 4 bytes */
+} zip_fileinfo;
+
+typedef const char* zipcharpc;
+
+
+#define APPEND_STATUS_CREATE (0)
+#define APPEND_STATUS_CREATEAFTER (1)
+#define APPEND_STATUS_ADDINZIP (2)
+
+extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append));
+extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append));
+/*
+ Create a zipfile.
+ pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on
+ an Unix computer "zlib/zlib113.zip".
+ if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip
+ will be created at the end of the file.
+ (useful if the file contain a self extractor code)
+ if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will
+ add files in existing zip (be sure you don't add file that doesn't exist)
+ If the zipfile cannot be opened, the return value is NULL.
+ Else, the return value is a zipFile Handle, usable with other function
+ of this zip package.
+*/
+
+/* Note : there is no delete function into a zipfile.
+ If you want delete file into a zipfile, you must open a zipfile, and create another
+ Of couse, you can use RAW reading and writing to copy the file you did not want delte
+*/
+
+extern zipFile ZEXPORT zipOpen2 OF((const char *pathname,
+ int append,
+ zipcharpc* globalcomment,
+ zlib_filefunc_def* pzlib_filefunc_def));
+
+extern zipFile ZEXPORT zipOpen2_64 OF((const void *pathname,
+ int append,
+ zipcharpc* globalcomment,
+ zlib_filefunc64_def* pzlib_filefunc_def));
+
+extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file,
+ const char* filename,
+ const zip_fileinfo* zipfi,
+ const void* extrafield_local,
+ uInt size_extrafield_local,
+ const void* extrafield_global,
+ uInt size_extrafield_global,
+ const char* comment,
+ int method,
+ int level));
+
+extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file,
+ const char* filename,
+ const zip_fileinfo* zipfi,
+ const void* extrafield_local,
+ uInt size_extrafield_local,
+ const void* extrafield_global,
+ uInt size_extrafield_global,
+ const char* comment,
+ int method,
+ int level,
+ int zip64));
+
+/*
+ Open a file in the ZIP for writing.
+ filename : the filename in zip (if NULL, '-' without quote will be used
+ *zipfi contain supplemental information
+ if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local
+ contains the extrafield data the the local header
+ if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global
+ contains the extrafield data the the local header
+ if comment != NULL, comment contain the comment string
+ method contain the compression method (0 for store, Z_DEFLATED for deflate)
+ level contain the level of compression (can be Z_DEFAULT_COMPRESSION)
+ zip64 is set to 1 if a zip64 extended information block should be added to the local file header.
+ this MUST be '1' if the uncompressed size is >= 0xffffffff.
+
+*/
+
+
+extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file,
+ const char* filename,
+ const zip_fileinfo* zipfi,
+ const void* extrafield_local,
+ uInt size_extrafield_local,
+ const void* extrafield_global,
+ uInt size_extrafield_global,
+ const char* comment,
+ int method,
+ int level,
+ int raw));
+
+
+extern int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file,
+ const char* filename,
+ const zip_fileinfo* zipfi,
+ const void* extrafield_local,
+ uInt size_extrafield_local,
+ const void* extrafield_global,
+ uInt size_extrafield_global,
+ const char* comment,
+ int method,
+ int level,
+ int raw,
+ int zip64));
+/*
+ Same than zipOpenNewFileInZip, except if raw=1, we write raw file
+ */
+
+extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file,
+ const char* filename,
+ const zip_fileinfo* zipfi,
+ const void* extrafield_local,
+ uInt size_extrafield_local,
+ const void* extrafield_global,
+ uInt size_extrafield_global,
+ const char* comment,
+ int method,
+ int level,
+ int raw,
+ int windowBits,
+ int memLevel,
+ int strategy,
+ const char* password,
+ uLong crcForCrypting));
+
+extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file,
+ const char* filename,
+ const zip_fileinfo* zipfi,
+ const void* extrafield_local,
+ uInt size_extrafield_local,
+ const void* extrafield_global,
+ uInt size_extrafield_global,
+ const char* comment,
+ int method,
+ int level,
+ int raw,
+ int windowBits,
+ int memLevel,
+ int strategy,
+ const char* password,
+ uLong crcForCrypting,
+ int zip64
+ ));
+
+/*
+ Same than zipOpenNewFileInZip2, except
+ windowBits,memLevel,,strategy : see parameter strategy in deflateInit2
+ password : crypting password (NULL for no crypting)
+ crcForCrypting : crc of file to compress (needed for crypting)
+ */
+
+extern int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file,
+ const char* filename,
+ const zip_fileinfo* zipfi,
+ const void* extrafield_local,
+ uInt size_extrafield_local,
+ const void* extrafield_global,
+ uInt size_extrafield_global,
+ const char* comment,
+ int method,
+ int level,
+ int raw,
+ int windowBits,
+ int memLevel,
+ int strategy,
+ const char* password,
+ uLong crcForCrypting,
+ uLong versionMadeBy,
+ uLong flagBase
+ ));
+
+
+extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file,
+ const char* filename,
+ const zip_fileinfo* zipfi,
+ const void* extrafield_local,
+ uInt size_extrafield_local,
+ const void* extrafield_global,
+ uInt size_extrafield_global,
+ const char* comment,
+ int method,
+ int level,
+ int raw,
+ int windowBits,
+ int memLevel,
+ int strategy,
+ const char* password,
+ uLong crcForCrypting,
+ uLong versionMadeBy,
+ uLong flagBase,
+ int zip64
+ ));
+/*
+ Same than zipOpenNewFileInZip4, except
+ versionMadeBy : value for Version made by field
+ flag : value for flag field (compression level info will be added)
+ */
+
+
+extern int ZEXPORT zipWriteInFileInZip OF((zipFile file,
+ const void* buf,
+ unsigned len));
+/*
+ Write data in the zipfile
+*/
+
+extern int ZEXPORT zipCloseFileInZip OF((zipFile file));
+/*
+ Close the current file in the zipfile
+*/
+
+extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file,
+ uLong uncompressed_size,
+ uLong crc32));
+
+extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file,
+ ZPOS64_T uncompressed_size,
+ uLong crc32));
+
+/*
+ Close the current file in the zipfile, for file opened with
+ parameter raw=1 in zipOpenNewFileInZip2
+ uncompressed_size and crc32 are value for the uncompressed size
+*/
+
+extern int ZEXPORT zipClose OF((zipFile file,
+ const char* global_comment));
+/*
+ Close the zipfile
+*/
+
+
+extern int ZEXPORT zipRemoveExtraInfoBlock OF((char* pData, int* dataLen, short sHeader));
+/*
+ zipRemoveExtraInfoBlock - Added by Mathias Svensson
+
+ Remove extra information block from a extra information data for the local file header or central directory header
+
+ It is needed to remove ZIP64 extra information blocks when before data is written if using RAW mode.
+
+ 0x0001 is the signature header for the ZIP64 extra information blocks
+
+ usage.
+ Remove ZIP64 Extra information from a central director extra field data
+ zipRemoveExtraInfoBlock(pCenDirExtraFieldData, &nCenDirExtraFieldDataLen, 0x0001);
+
+ Remove ZIP64 Extra information from a Local File Header extra field data
+ zipRemoveExtraInfoBlock(pLocalHeaderExtraFieldData, &nLocalHeaderExtraFieldDataLen, 0x0001);
+*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _zip64_H */
diff --git a/protocols/Telegram/tgl/zlib/contrib/pascal/example.pas b/protocols/Telegram/tgl/zlib/contrib/pascal/example.pas
new file mode 100644
index 0000000000..5518b36a73
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/pascal/example.pas
@@ -0,0 +1,599 @@
+(* example.c -- usage example of the zlib compression library
+ * Copyright (C) 1995-2003 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ *
+ * Pascal translation
+ * Copyright (C) 1998 by Jacques Nomssi Nzali.
+ * For conditions of distribution and use, see copyright notice in readme.txt
+ *
+ * Adaptation to the zlibpas interface
+ * Copyright (C) 2003 by Cosmin Truta.
+ * For conditions of distribution and use, see copyright notice in readme.txt
+ *)
+
+program example;
+
+{$DEFINE TEST_COMPRESS}
+{DO NOT $DEFINE TEST_GZIO}
+{$DEFINE TEST_DEFLATE}
+{$DEFINE TEST_INFLATE}
+{$DEFINE TEST_FLUSH}
+{$DEFINE TEST_SYNC}
+{$DEFINE TEST_DICT}
+
+uses SysUtils, zlibpas;
+
+const TESTFILE = 'foo.gz';
+
+(* "hello world" would be more standard, but the repeated "hello"
+ * stresses the compression code better, sorry...
+ *)
+const hello: PChar = 'hello, hello!';
+
+const dictionary: PChar = 'hello';
+
+var dictId: LongInt; (* Adler32 value of the dictionary *)
+
+procedure CHECK_ERR(err: Integer; msg: String);
+begin
+ if err <> Z_OK then
+ begin
+ WriteLn(msg, ' error: ', err);
+ Halt(1);
+ end;
+end;
+
+procedure EXIT_ERR(const msg: String);
+begin
+ WriteLn('Error: ', msg);
+ Halt(1);
+end;
+
+(* ===========================================================================
+ * Test compress and uncompress
+ *)
+{$IFDEF TEST_COMPRESS}
+procedure test_compress(compr: Pointer; comprLen: LongInt;
+ uncompr: Pointer; uncomprLen: LongInt);
+var err: Integer;
+ len: LongInt;
+begin
+ len := StrLen(hello)+1;
+
+ err := compress(compr, comprLen, hello, len);
+ CHECK_ERR(err, 'compress');
+
+ StrCopy(PChar(uncompr), 'garbage');
+
+ err := uncompress(uncompr, uncomprLen, compr, comprLen);
+ CHECK_ERR(err, 'uncompress');
+
+ if StrComp(PChar(uncompr), hello) <> 0 then
+ EXIT_ERR('bad uncompress')
+ else
+ WriteLn('uncompress(): ', PChar(uncompr));
+end;
+{$ENDIF}
+
+(* ===========================================================================
+ * Test read/write of .gz files
+ *)
+{$IFDEF TEST_GZIO}
+procedure test_gzio(const fname: PChar; (* compressed file name *)
+ uncompr: Pointer;
+ uncomprLen: LongInt);
+var err: Integer;
+ len: Integer;
+ zfile: gzFile;
+ pos: LongInt;
+begin
+ len := StrLen(hello)+1;
+
+ zfile := gzopen(fname, 'wb');
+ if zfile = NIL then
+ begin
+ WriteLn('gzopen error');
+ Halt(1);
+ end;
+ gzputc(zfile, 'h');
+ if gzputs(zfile, 'ello') <> 4 then
+ begin
+ WriteLn('gzputs err: ', gzerror(zfile, err));
+ Halt(1);
+ end;
+ {$IFDEF GZ_FORMAT_STRING}
+ if gzprintf(zfile, ', %s!', 'hello') <> 8 then
+ begin
+ WriteLn('gzprintf err: ', gzerror(zfile, err));
+ Halt(1);
+ end;
+ {$ELSE}
+ if gzputs(zfile, ', hello!') <> 8 then
+ begin
+ WriteLn('gzputs err: ', gzerror(zfile, err));
+ Halt(1);
+ end;
+ {$ENDIF}
+ gzseek(zfile, 1, SEEK_CUR); (* add one zero byte *)
+ gzclose(zfile);
+
+ zfile := gzopen(fname, 'rb');
+ if zfile = NIL then
+ begin
+ WriteLn('gzopen error');
+ Halt(1);
+ end;
+
+ StrCopy(PChar(uncompr), 'garbage');
+
+ if gzread(zfile, uncompr, uncomprLen) <> len then
+ begin
+ WriteLn('gzread err: ', gzerror(zfile, err));
+ Halt(1);
+ end;
+ if StrComp(PChar(uncompr), hello) <> 0 then
+ begin
+ WriteLn('bad gzread: ', PChar(uncompr));
+ Halt(1);
+ end
+ else
+ WriteLn('gzread(): ', PChar(uncompr));
+
+ pos := gzseek(zfile, -8, SEEK_CUR);
+ if (pos <> 6) or (gztell(zfile) <> pos) then
+ begin
+ WriteLn('gzseek error, pos=', pos, ', gztell=', gztell(zfile));
+ Halt(1);
+ end;
+
+ if gzgetc(zfile) <> ' ' then
+ begin
+ WriteLn('gzgetc error');
+ Halt(1);
+ end;
+
+ if gzungetc(' ', zfile) <> ' ' then
+ begin
+ WriteLn('gzungetc error');
+ Halt(1);
+ end;
+
+ gzgets(zfile, PChar(uncompr), uncomprLen);
+ uncomprLen := StrLen(PChar(uncompr));
+ if uncomprLen <> 7 then (* " hello!" *)
+ begin
+ WriteLn('gzgets err after gzseek: ', gzerror(zfile, err));
+ Halt(1);
+ end;
+ if StrComp(PChar(uncompr), hello + 6) <> 0 then
+ begin
+ WriteLn('bad gzgets after gzseek');
+ Halt(1);
+ end
+ else
+ WriteLn('gzgets() after gzseek: ', PChar(uncompr));
+
+ gzclose(zfile);
+end;
+{$ENDIF}
+
+(* ===========================================================================
+ * Test deflate with small buffers
+ *)
+{$IFDEF TEST_DEFLATE}
+procedure test_deflate(compr: Pointer; comprLen: LongInt);
+var c_stream: z_stream; (* compression stream *)
+ err: Integer;
+ len: LongInt;
+begin
+ len := StrLen(hello)+1;
+
+ c_stream.zalloc := NIL;
+ c_stream.zfree := NIL;
+ c_stream.opaque := NIL;
+
+ err := deflateInit(c_stream, Z_DEFAULT_COMPRESSION);
+ CHECK_ERR(err, 'deflateInit');
+
+ c_stream.next_in := hello;
+ c_stream.next_out := compr;
+
+ while (c_stream.total_in <> len) and
+ (c_stream.total_out < comprLen) do
+ begin
+ c_stream.avail_out := 1; { force small buffers }
+ c_stream.avail_in := 1;
+ err := deflate(c_stream, Z_NO_FLUSH);
+ CHECK_ERR(err, 'deflate');
+ end;
+
+ (* Finish the stream, still forcing small buffers: *)
+ while TRUE do
+ begin
+ c_stream.avail_out := 1;
+ err := deflate(c_stream, Z_FINISH);
+ if err = Z_STREAM_END then
+ break;
+ CHECK_ERR(err, 'deflate');
+ end;
+
+ err := deflateEnd(c_stream);
+ CHECK_ERR(err, 'deflateEnd');
+end;
+{$ENDIF}
+
+(* ===========================================================================
+ * Test inflate with small buffers
+ *)
+{$IFDEF TEST_INFLATE}
+procedure test_inflate(compr: Pointer; comprLen : LongInt;
+ uncompr: Pointer; uncomprLen : LongInt);
+var err: Integer;
+ d_stream: z_stream; (* decompression stream *)
+begin
+ StrCopy(PChar(uncompr), 'garbage');
+
+ d_stream.zalloc := NIL;
+ d_stream.zfree := NIL;
+ d_stream.opaque := NIL;
+
+ d_stream.next_in := compr;
+ d_stream.avail_in := 0;
+ d_stream.next_out := uncompr;
+
+ err := inflateInit(d_stream);
+ CHECK_ERR(err, 'inflateInit');
+
+ while (d_stream.total_out < uncomprLen) and
+ (d_stream.total_in < comprLen) do
+ begin
+ d_stream.avail_out := 1; (* force small buffers *)
+ d_stream.avail_in := 1;
+ err := inflate(d_stream, Z_NO_FLUSH);
+ if err = Z_STREAM_END then
+ break;
+ CHECK_ERR(err, 'inflate');
+ end;
+
+ err := inflateEnd(d_stream);
+ CHECK_ERR(err, 'inflateEnd');
+
+ if StrComp(PChar(uncompr), hello) <> 0 then
+ EXIT_ERR('bad inflate')
+ else
+ WriteLn('inflate(): ', PChar(uncompr));
+end;
+{$ENDIF}
+
+(* ===========================================================================
+ * Test deflate with large buffers and dynamic change of compression level
+ *)
+{$IFDEF TEST_DEFLATE}
+procedure test_large_deflate(compr: Pointer; comprLen: LongInt;
+ uncompr: Pointer; uncomprLen: LongInt);
+var c_stream: z_stream; (* compression stream *)
+ err: Integer;
+begin
+ c_stream.zalloc := NIL;
+ c_stream.zfree := NIL;
+ c_stream.opaque := NIL;
+
+ err := deflateInit(c_stream, Z_BEST_SPEED);
+ CHECK_ERR(err, 'deflateInit');
+
+ c_stream.next_out := compr;
+ c_stream.avail_out := Integer(comprLen);
+
+ (* At this point, uncompr is still mostly zeroes, so it should compress
+ * very well:
+ *)
+ c_stream.next_in := uncompr;
+ c_stream.avail_in := Integer(uncomprLen);
+ err := deflate(c_stream, Z_NO_FLUSH);
+ CHECK_ERR(err, 'deflate');
+ if c_stream.avail_in <> 0 then
+ EXIT_ERR('deflate not greedy');
+
+ (* Feed in already compressed data and switch to no compression: *)
+ deflateParams(c_stream, Z_NO_COMPRESSION, Z_DEFAULT_STRATEGY);
+ c_stream.next_in := compr;
+ c_stream.avail_in := Integer(comprLen div 2);
+ err := deflate(c_stream, Z_NO_FLUSH);
+ CHECK_ERR(err, 'deflate');
+
+ (* Switch back to compressing mode: *)
+ deflateParams(c_stream, Z_BEST_COMPRESSION, Z_FILTERED);
+ c_stream.next_in := uncompr;
+ c_stream.avail_in := Integer(uncomprLen);
+ err := deflate(c_stream, Z_NO_FLUSH);
+ CHECK_ERR(err, 'deflate');
+
+ err := deflate(c_stream, Z_FINISH);
+ if err <> Z_STREAM_END then
+ EXIT_ERR('deflate should report Z_STREAM_END');
+
+ err := deflateEnd(c_stream);
+ CHECK_ERR(err, 'deflateEnd');
+end;
+{$ENDIF}
+
+(* ===========================================================================
+ * Test inflate with large buffers
+ *)
+{$IFDEF TEST_INFLATE}
+procedure test_large_inflate(compr: Pointer; comprLen: LongInt;
+ uncompr: Pointer; uncomprLen: LongInt);
+var err: Integer;
+ d_stream: z_stream; (* decompression stream *)
+begin
+ StrCopy(PChar(uncompr), 'garbage');
+
+ d_stream.zalloc := NIL;
+ d_stream.zfree := NIL;
+ d_stream.opaque := NIL;
+
+ d_stream.next_in := compr;
+ d_stream.avail_in := Integer(comprLen);
+
+ err := inflateInit(d_stream);
+ CHECK_ERR(err, 'inflateInit');
+
+ while TRUE do
+ begin
+ d_stream.next_out := uncompr; (* discard the output *)
+ d_stream.avail_out := Integer(uncomprLen);
+ err := inflate(d_stream, Z_NO_FLUSH);
+ if err = Z_STREAM_END then
+ break;
+ CHECK_ERR(err, 'large inflate');
+ end;
+
+ err := inflateEnd(d_stream);
+ CHECK_ERR(err, 'inflateEnd');
+
+ if d_stream.total_out <> 2 * uncomprLen + comprLen div 2 then
+ begin
+ WriteLn('bad large inflate: ', d_stream.total_out);
+ Halt(1);
+ end
+ else
+ WriteLn('large_inflate(): OK');
+end;
+{$ENDIF}
+
+(* ===========================================================================
+ * Test deflate with full flush
+ *)
+{$IFDEF TEST_FLUSH}
+procedure test_flush(compr: Pointer; var comprLen : LongInt);
+var c_stream: z_stream; (* compression stream *)
+ err: Integer;
+ len: Integer;
+begin
+ len := StrLen(hello)+1;
+
+ c_stream.zalloc := NIL;
+ c_stream.zfree := NIL;
+ c_stream.opaque := NIL;
+
+ err := deflateInit(c_stream, Z_DEFAULT_COMPRESSION);
+ CHECK_ERR(err, 'deflateInit');
+
+ c_stream.next_in := hello;
+ c_stream.next_out := compr;
+ c_stream.avail_in := 3;
+ c_stream.avail_out := Integer(comprLen);
+ err := deflate(c_stream, Z_FULL_FLUSH);
+ CHECK_ERR(err, 'deflate');
+
+ Inc(PByteArray(compr)^[3]); (* force an error in first compressed block *)
+ c_stream.avail_in := len - 3;
+
+ err := deflate(c_stream, Z_FINISH);
+ if err <> Z_STREAM_END then
+ CHECK_ERR(err, 'deflate');
+
+ err := deflateEnd(c_stream);
+ CHECK_ERR(err, 'deflateEnd');
+
+ comprLen := c_stream.total_out;
+end;
+{$ENDIF}
+
+(* ===========================================================================
+ * Test inflateSync()
+ *)
+{$IFDEF TEST_SYNC}
+procedure test_sync(compr: Pointer; comprLen: LongInt;
+ uncompr: Pointer; uncomprLen : LongInt);
+var err: Integer;
+ d_stream: z_stream; (* decompression stream *)
+begin
+ StrCopy(PChar(uncompr), 'garbage');
+
+ d_stream.zalloc := NIL;
+ d_stream.zfree := NIL;
+ d_stream.opaque := NIL;
+
+ d_stream.next_in := compr;
+ d_stream.avail_in := 2; (* just read the zlib header *)
+
+ err := inflateInit(d_stream);
+ CHECK_ERR(err, 'inflateInit');
+
+ d_stream.next_out := uncompr;
+ d_stream.avail_out := Integer(uncomprLen);
+
+ inflate(d_stream, Z_NO_FLUSH);
+ CHECK_ERR(err, 'inflate');
+
+ d_stream.avail_in := Integer(comprLen-2); (* read all compressed data *)
+ err := inflateSync(d_stream); (* but skip the damaged part *)
+ CHECK_ERR(err, 'inflateSync');
+
+ err := inflate(d_stream, Z_FINISH);
+ if err <> Z_DATA_ERROR then
+ EXIT_ERR('inflate should report DATA_ERROR');
+ (* Because of incorrect adler32 *)
+
+ err := inflateEnd(d_stream);
+ CHECK_ERR(err, 'inflateEnd');
+
+ WriteLn('after inflateSync(): hel', PChar(uncompr));
+end;
+{$ENDIF}
+
+(* ===========================================================================
+ * Test deflate with preset dictionary
+ *)
+{$IFDEF TEST_DICT}
+procedure test_dict_deflate(compr: Pointer; comprLen: LongInt);
+var c_stream: z_stream; (* compression stream *)
+ err: Integer;
+begin
+ c_stream.zalloc := NIL;
+ c_stream.zfree := NIL;
+ c_stream.opaque := NIL;
+
+ err := deflateInit(c_stream, Z_BEST_COMPRESSION);
+ CHECK_ERR(err, 'deflateInit');
+
+ err := deflateSetDictionary(c_stream, dictionary, StrLen(dictionary));
+ CHECK_ERR(err, 'deflateSetDictionary');
+
+ dictId := c_stream.adler;
+ c_stream.next_out := compr;
+ c_stream.avail_out := Integer(comprLen);
+
+ c_stream.next_in := hello;
+ c_stream.avail_in := StrLen(hello)+1;
+
+ err := deflate(c_stream, Z_FINISH);
+ if err <> Z_STREAM_END then
+ EXIT_ERR('deflate should report Z_STREAM_END');
+
+ err := deflateEnd(c_stream);
+ CHECK_ERR(err, 'deflateEnd');
+end;
+{$ENDIF}
+
+(* ===========================================================================
+ * Test inflate with a preset dictionary
+ *)
+{$IFDEF TEST_DICT}
+procedure test_dict_inflate(compr: Pointer; comprLen: LongInt;
+ uncompr: Pointer; uncomprLen: LongInt);
+var err: Integer;
+ d_stream: z_stream; (* decompression stream *)
+begin
+ StrCopy(PChar(uncompr), 'garbage');
+
+ d_stream.zalloc := NIL;
+ d_stream.zfree := NIL;
+ d_stream.opaque := NIL;
+
+ d_stream.next_in := compr;
+ d_stream.avail_in := Integer(comprLen);
+
+ err := inflateInit(d_stream);
+ CHECK_ERR(err, 'inflateInit');
+
+ d_stream.next_out := uncompr;
+ d_stream.avail_out := Integer(uncomprLen);
+
+ while TRUE do
+ begin
+ err := inflate(d_stream, Z_NO_FLUSH);
+ if err = Z_STREAM_END then
+ break;
+ if err = Z_NEED_DICT then
+ begin
+ if d_stream.adler <> dictId then
+ EXIT_ERR('unexpected dictionary');
+ err := inflateSetDictionary(d_stream, dictionary, StrLen(dictionary));
+ end;
+ CHECK_ERR(err, 'inflate with dict');
+ end;
+
+ err := inflateEnd(d_stream);
+ CHECK_ERR(err, 'inflateEnd');
+
+ if StrComp(PChar(uncompr), hello) <> 0 then
+ EXIT_ERR('bad inflate with dict')
+ else
+ WriteLn('inflate with dictionary: ', PChar(uncompr));
+end;
+{$ENDIF}
+
+var compr, uncompr: Pointer;
+ comprLen, uncomprLen: LongInt;
+
+begin
+ if zlibVersion^ <> ZLIB_VERSION[1] then
+ EXIT_ERR('Incompatible zlib version');
+
+ WriteLn('zlib version: ', zlibVersion);
+ WriteLn('zlib compile flags: ', Format('0x%x', [zlibCompileFlags]));
+
+ comprLen := 10000 * SizeOf(Integer); (* don't overflow on MSDOS *)
+ uncomprLen := comprLen;
+ GetMem(compr, comprLen);
+ GetMem(uncompr, uncomprLen);
+ if (compr = NIL) or (uncompr = NIL) then
+ EXIT_ERR('Out of memory');
+ (* compr and uncompr are cleared to avoid reading uninitialized
+ * data and to ensure that uncompr compresses well.
+ *)
+ FillChar(compr^, comprLen, 0);
+ FillChar(uncompr^, uncomprLen, 0);
+
+ {$IFDEF TEST_COMPRESS}
+ WriteLn('** Testing compress');
+ test_compress(compr, comprLen, uncompr, uncomprLen);
+ {$ENDIF}
+
+ {$IFDEF TEST_GZIO}
+ WriteLn('** Testing gzio');
+ if ParamCount >= 1 then
+ test_gzio(ParamStr(1), uncompr, uncomprLen)
+ else
+ test_gzio(TESTFILE, uncompr, uncomprLen);
+ {$ENDIF}
+
+ {$IFDEF TEST_DEFLATE}
+ WriteLn('** Testing deflate with small buffers');
+ test_deflate(compr, comprLen);
+ {$ENDIF}
+ {$IFDEF TEST_INFLATE}
+ WriteLn('** Testing inflate with small buffers');
+ test_inflate(compr, comprLen, uncompr, uncomprLen);
+ {$ENDIF}
+
+ {$IFDEF TEST_DEFLATE}
+ WriteLn('** Testing deflate with large buffers');
+ test_large_deflate(compr, comprLen, uncompr, uncomprLen);
+ {$ENDIF}
+ {$IFDEF TEST_INFLATE}
+ WriteLn('** Testing inflate with large buffers');
+ test_large_inflate(compr, comprLen, uncompr, uncomprLen);
+ {$ENDIF}
+
+ {$IFDEF TEST_FLUSH}
+ WriteLn('** Testing deflate with full flush');
+ test_flush(compr, comprLen);
+ {$ENDIF}
+ {$IFDEF TEST_SYNC}
+ WriteLn('** Testing inflateSync');
+ test_sync(compr, comprLen, uncompr, uncomprLen);
+ {$ENDIF}
+ comprLen := uncomprLen;
+
+ {$IFDEF TEST_DICT}
+ WriteLn('** Testing deflate and inflate with preset dictionary');
+ test_dict_deflate(compr, comprLen);
+ test_dict_inflate(compr, comprLen, uncompr, uncomprLen);
+ {$ENDIF}
+
+ FreeMem(compr, comprLen);
+ FreeMem(uncompr, uncomprLen);
+end.
diff --git a/protocols/Telegram/tgl/zlib/contrib/pascal/readme.txt b/protocols/Telegram/tgl/zlib/contrib/pascal/readme.txt
new file mode 100644
index 0000000000..60e87c8a33
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/pascal/readme.txt
@@ -0,0 +1,76 @@
+
+This directory contains a Pascal (Delphi, Kylix) interface to the
+zlib data compression library.
+
+
+Directory listing
+=================
+
+zlibd32.mak makefile for Borland C++
+example.pas usage example of zlib
+zlibpas.pas the Pascal interface to zlib
+readme.txt this file
+
+
+Compatibility notes
+===================
+
+- Although the name "zlib" would have been more normal for the
+ zlibpas unit, this name is already taken by Borland's ZLib unit.
+ This is somehow unfortunate, because that unit is not a genuine
+ interface to the full-fledged zlib functionality, but a suite of
+ class wrappers around zlib streams. Other essential features,
+ such as checksums, are missing.
+ It would have been more appropriate for that unit to have a name
+ like "ZStreams", or something similar.
+
+- The C and zlib-supplied types int, uInt, long, uLong, etc. are
+ translated directly into Pascal types of similar sizes (Integer,
+ LongInt, etc.), to avoid namespace pollution. In particular,
+ there is no conversion of unsigned int into a Pascal unsigned
+ integer. The Word type is non-portable and has the same size
+ (16 bits) both in a 16-bit and in a 32-bit environment, unlike
+ Integer. Even if there is a 32-bit Cardinal type, there is no
+ real need for unsigned int in zlib under a 32-bit environment.
+
+- Except for the callbacks, the zlib function interfaces are
+ assuming the calling convention normally used in Pascal
+ (__pascal for DOS and Windows16, __fastcall for Windows32).
+ Since the cdecl keyword is used, the old Turbo Pascal does
+ not work with this interface.
+
+- The gz* function interfaces are not translated, to avoid
+ interfacing problems with the C runtime library. Besides,
+ gzprintf(gzFile file, const char *format, ...)
+ cannot be translated into Pascal.
+
+
+Legal issues
+============
+
+The zlibpas interface is:
+ Copyright (C) 1995-2003 Jean-loup Gailly and Mark Adler.
+ Copyright (C) 1998 by Bob Dellaca.
+ Copyright (C) 2003 by Cosmin Truta.
+
+The example program is:
+ Copyright (C) 1995-2003 by Jean-loup Gailly.
+ Copyright (C) 1998,1999,2000 by Jacques Nomssi Nzali.
+ Copyright (C) 2003 by Cosmin Truta.
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the author be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
diff --git a/protocols/Telegram/tgl/zlib/contrib/pascal/zlibd32.mak b/protocols/Telegram/tgl/zlib/contrib/pascal/zlibd32.mak
new file mode 100644
index 0000000000..9bb00b7cc4
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/pascal/zlibd32.mak
@@ -0,0 +1,99 @@
+# Makefile for zlib
+# For use with Delphi and C++ Builder under Win32
+# Updated for zlib 1.2.x by Cosmin Truta
+
+# ------------ Borland C++ ------------
+
+# This project uses the Delphi (fastcall/register) calling convention:
+LOC = -DZEXPORT=__fastcall -DZEXPORTVA=__cdecl
+
+CC = bcc32
+LD = bcc32
+AR = tlib
+# do not use "-pr" in CFLAGS
+CFLAGS = -a -d -k- -O2 $(LOC)
+LDFLAGS =
+
+
+# variables
+ZLIB_LIB = zlib.lib
+
+OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj
+OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj
+OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj
+OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj
+
+
+# targets
+all: $(ZLIB_LIB) example.exe minigzip.exe
+
+.c.obj:
+ $(CC) -c $(CFLAGS) $*.c
+
+adler32.obj: adler32.c zlib.h zconf.h
+
+compress.obj: compress.c zlib.h zconf.h
+
+crc32.obj: crc32.c zlib.h zconf.h crc32.h
+
+deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
+
+gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h
+
+gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h
+
+gzread.obj: gzread.c zlib.h zconf.h gzguts.h
+
+gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h
+
+infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
+ inffast.h inffixed.h
+
+inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
+ inffast.h
+
+inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
+ inffast.h inffixed.h
+
+inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
+
+trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h
+
+uncompr.obj: uncompr.c zlib.h zconf.h
+
+zutil.obj: zutil.c zutil.h zlib.h zconf.h
+
+example.obj: test/example.c zlib.h zconf.h
+
+minigzip.obj: test/minigzip.c zlib.h zconf.h
+
+
+# For the sake of the old Borland make,
+# the command line is cut to fit in the MS-DOS 128 byte limit:
+$(ZLIB_LIB): $(OBJ1) $(OBJ2)
+ -del $(ZLIB_LIB)
+ $(AR) $(ZLIB_LIB) $(OBJP1)
+ $(AR) $(ZLIB_LIB) $(OBJP2)
+
+
+# testing
+test: example.exe minigzip.exe
+ example
+ echo hello world | minigzip | minigzip -d
+
+example.exe: example.obj $(ZLIB_LIB)
+ $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB)
+
+minigzip.exe: minigzip.obj $(ZLIB_LIB)
+ $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB)
+
+
+# cleanup
+clean:
+ -del *.obj
+ -del *.exe
+ -del *.lib
+ -del *.tds
+ -del zlib.bak
+ -del foo.gz
+
diff --git a/protocols/Telegram/tgl/zlib/contrib/pascal/zlibpas.pas b/protocols/Telegram/tgl/zlib/contrib/pascal/zlibpas.pas
new file mode 100644
index 0000000000..e6a0782b48
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/pascal/zlibpas.pas
@@ -0,0 +1,276 @@
+(* zlibpas -- Pascal interface to the zlib data compression library
+ *
+ * Copyright (C) 2003 Cosmin Truta.
+ * Derived from original sources by Bob Dellaca.
+ * For conditions of distribution and use, see copyright notice in readme.txt
+ *)
+
+unit zlibpas;
+
+interface
+
+const
+ ZLIB_VERSION = '1.2.8';
+ ZLIB_VERNUM = $1280;
+
+type
+ alloc_func = function(opaque: Pointer; items, size: Integer): Pointer;
+ cdecl;
+ free_func = procedure(opaque, address: Pointer);
+ cdecl;
+
+ in_func = function(opaque: Pointer; var buf: PByte): Integer;
+ cdecl;
+ out_func = function(opaque: Pointer; buf: PByte; size: Integer): Integer;
+ cdecl;
+
+ z_streamp = ^z_stream;
+ z_stream = packed record
+ next_in: PChar; (* next input byte *)
+ avail_in: Integer; (* number of bytes available at next_in *)
+ total_in: LongInt; (* total nb of input bytes read so far *)
+
+ next_out: PChar; (* next output byte should be put there *)
+ avail_out: Integer; (* remaining free space at next_out *)
+ total_out: LongInt; (* total nb of bytes output so far *)
+
+ msg: PChar; (* last error message, NULL if no error *)
+ state: Pointer; (* not visible by applications *)
+
+ zalloc: alloc_func; (* used to allocate the internal state *)
+ zfree: free_func; (* used to free the internal state *)
+ opaque: Pointer; (* private data object passed to zalloc and zfree *)
+
+ data_type: Integer; (* best guess about the data type: ascii or binary *)
+ adler: LongInt; (* adler32 value of the uncompressed data *)
+ reserved: LongInt; (* reserved for future use *)
+ end;
+
+ gz_headerp = ^gz_header;
+ gz_header = packed record
+ text: Integer; (* true if compressed data believed to be text *)
+ time: LongInt; (* modification time *)
+ xflags: Integer; (* extra flags (not used when writing a gzip file) *)
+ os: Integer; (* operating system *)
+ extra: PChar; (* pointer to extra field or Z_NULL if none *)
+ extra_len: Integer; (* extra field length (valid if extra != Z_NULL) *)
+ extra_max: Integer; (* space at extra (only when reading header) *)
+ name: PChar; (* pointer to zero-terminated file name or Z_NULL *)
+ name_max: Integer; (* space at name (only when reading header) *)
+ comment: PChar; (* pointer to zero-terminated comment or Z_NULL *)
+ comm_max: Integer; (* space at comment (only when reading header) *)
+ hcrc: Integer; (* true if there was or will be a header crc *)
+ done: Integer; (* true when done reading gzip header *)
+ end;
+
+(* constants *)
+const
+ Z_NO_FLUSH = 0;
+ Z_PARTIAL_FLUSH = 1;
+ Z_SYNC_FLUSH = 2;
+ Z_FULL_FLUSH = 3;
+ Z_FINISH = 4;
+ Z_BLOCK = 5;
+ Z_TREES = 6;
+
+ Z_OK = 0;
+ Z_STREAM_END = 1;
+ Z_NEED_DICT = 2;
+ Z_ERRNO = -1;
+ Z_STREAM_ERROR = -2;
+ Z_DATA_ERROR = -3;
+ Z_MEM_ERROR = -4;
+ Z_BUF_ERROR = -5;
+ Z_VERSION_ERROR = -6;
+
+ Z_NO_COMPRESSION = 0;
+ Z_BEST_SPEED = 1;
+ Z_BEST_COMPRESSION = 9;
+ Z_DEFAULT_COMPRESSION = -1;
+
+ Z_FILTERED = 1;
+ Z_HUFFMAN_ONLY = 2;
+ Z_RLE = 3;
+ Z_FIXED = 4;
+ Z_DEFAULT_STRATEGY = 0;
+
+ Z_BINARY = 0;
+ Z_TEXT = 1;
+ Z_ASCII = 1;
+ Z_UNKNOWN = 2;
+
+ Z_DEFLATED = 8;
+
+(* basic functions *)
+function zlibVersion: PChar;
+function deflateInit(var strm: z_stream; level: Integer): Integer;
+function deflate(var strm: z_stream; flush: Integer): Integer;
+function deflateEnd(var strm: z_stream): Integer;
+function inflateInit(var strm: z_stream): Integer;
+function inflate(var strm: z_stream; flush: Integer): Integer;
+function inflateEnd(var strm: z_stream): Integer;
+
+(* advanced functions *)
+function deflateInit2(var strm: z_stream; level, method, windowBits,
+ memLevel, strategy: Integer): Integer;
+function deflateSetDictionary(var strm: z_stream; const dictionary: PChar;
+ dictLength: Integer): Integer;
+function deflateCopy(var dest, source: z_stream): Integer;
+function deflateReset(var strm: z_stream): Integer;
+function deflateParams(var strm: z_stream; level, strategy: Integer): Integer;
+function deflateTune(var strm: z_stream; good_length, max_lazy, nice_length, max_chain: Integer): Integer;
+function deflateBound(var strm: z_stream; sourceLen: LongInt): LongInt;
+function deflatePending(var strm: z_stream; var pending: Integer; var bits: Integer): Integer;
+function deflatePrime(var strm: z_stream; bits, value: Integer): Integer;
+function deflateSetHeader(var strm: z_stream; head: gz_header): Integer;
+function inflateInit2(var strm: z_stream; windowBits: Integer): Integer;
+function inflateSetDictionary(var strm: z_stream; const dictionary: PChar;
+ dictLength: Integer): Integer;
+function inflateSync(var strm: z_stream): Integer;
+function inflateCopy(var dest, source: z_stream): Integer;
+function inflateReset(var strm: z_stream): Integer;
+function inflateReset2(var strm: z_stream; windowBits: Integer): Integer;
+function inflatePrime(var strm: z_stream; bits, value: Integer): Integer;
+function inflateMark(var strm: z_stream): LongInt;
+function inflateGetHeader(var strm: z_stream; var head: gz_header): Integer;
+function inflateBackInit(var strm: z_stream;
+ windowBits: Integer; window: PChar): Integer;
+function inflateBack(var strm: z_stream; in_fn: in_func; in_desc: Pointer;
+ out_fn: out_func; out_desc: Pointer): Integer;
+function inflateBackEnd(var strm: z_stream): Integer;
+function zlibCompileFlags: LongInt;
+
+(* utility functions *)
+function compress(dest: PChar; var destLen: LongInt;
+ const source: PChar; sourceLen: LongInt): Integer;
+function compress2(dest: PChar; var destLen: LongInt;
+ const source: PChar; sourceLen: LongInt;
+ level: Integer): Integer;
+function compressBound(sourceLen: LongInt): LongInt;
+function uncompress(dest: PChar; var destLen: LongInt;
+ const source: PChar; sourceLen: LongInt): Integer;
+
+(* checksum functions *)
+function adler32(adler: LongInt; const buf: PChar; len: Integer): LongInt;
+function adler32_combine(adler1, adler2, len2: LongInt): LongInt;
+function crc32(crc: LongInt; const buf: PChar; len: Integer): LongInt;
+function crc32_combine(crc1, crc2, len2: LongInt): LongInt;
+
+(* various hacks, don't look :) *)
+function deflateInit_(var strm: z_stream; level: Integer;
+ const version: PChar; stream_size: Integer): Integer;
+function inflateInit_(var strm: z_stream; const version: PChar;
+ stream_size: Integer): Integer;
+function deflateInit2_(var strm: z_stream;
+ level, method, windowBits, memLevel, strategy: Integer;
+ const version: PChar; stream_size: Integer): Integer;
+function inflateInit2_(var strm: z_stream; windowBits: Integer;
+ const version: PChar; stream_size: Integer): Integer;
+function inflateBackInit_(var strm: z_stream;
+ windowBits: Integer; window: PChar;
+ const version: PChar; stream_size: Integer): Integer;
+
+
+implementation
+
+{$L adler32.obj}
+{$L compress.obj}
+{$L crc32.obj}
+{$L deflate.obj}
+{$L infback.obj}
+{$L inffast.obj}
+{$L inflate.obj}
+{$L inftrees.obj}
+{$L trees.obj}
+{$L uncompr.obj}
+{$L zutil.obj}
+
+function adler32; external;
+function adler32_combine; external;
+function compress; external;
+function compress2; external;
+function compressBound; external;
+function crc32; external;
+function crc32_combine; external;
+function deflate; external;
+function deflateBound; external;
+function deflateCopy; external;
+function deflateEnd; external;
+function deflateInit_; external;
+function deflateInit2_; external;
+function deflateParams; external;
+function deflatePending; external;
+function deflatePrime; external;
+function deflateReset; external;
+function deflateSetDictionary; external;
+function deflateSetHeader; external;
+function deflateTune; external;
+function inflate; external;
+function inflateBack; external;
+function inflateBackEnd; external;
+function inflateBackInit_; external;
+function inflateCopy; external;
+function inflateEnd; external;
+function inflateGetHeader; external;
+function inflateInit_; external;
+function inflateInit2_; external;
+function inflateMark; external;
+function inflatePrime; external;
+function inflateReset; external;
+function inflateReset2; external;
+function inflateSetDictionary; external;
+function inflateSync; external;
+function uncompress; external;
+function zlibCompileFlags; external;
+function zlibVersion; external;
+
+function deflateInit(var strm: z_stream; level: Integer): Integer;
+begin
+ Result := deflateInit_(strm, level, ZLIB_VERSION, sizeof(z_stream));
+end;
+
+function deflateInit2(var strm: z_stream; level, method, windowBits, memLevel,
+ strategy: Integer): Integer;
+begin
+ Result := deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
+ ZLIB_VERSION, sizeof(z_stream));
+end;
+
+function inflateInit(var strm: z_stream): Integer;
+begin
+ Result := inflateInit_(strm, ZLIB_VERSION, sizeof(z_stream));
+end;
+
+function inflateInit2(var strm: z_stream; windowBits: Integer): Integer;
+begin
+ Result := inflateInit2_(strm, windowBits, ZLIB_VERSION, sizeof(z_stream));
+end;
+
+function inflateBackInit(var strm: z_stream;
+ windowBits: Integer; window: PChar): Integer;
+begin
+ Result := inflateBackInit_(strm, windowBits, window,
+ ZLIB_VERSION, sizeof(z_stream));
+end;
+
+function _malloc(Size: Integer): Pointer; cdecl;
+begin
+ GetMem(Result, Size);
+end;
+
+procedure _free(Block: Pointer); cdecl;
+begin
+ FreeMem(Block);
+end;
+
+procedure _memset(P: Pointer; B: Byte; count: Integer); cdecl;
+begin
+ FillChar(P^, count, B);
+end;
+
+procedure _memcpy(dest, source: Pointer; count: Integer); cdecl;
+begin
+ Move(source^, dest^, count);
+end;
+
+end.
diff --git a/protocols/Telegram/tgl/zlib/contrib/puff/Makefile b/protocols/Telegram/tgl/zlib/contrib/puff/Makefile
new file mode 100644
index 0000000000..0e2594c808
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/puff/Makefile
@@ -0,0 +1,42 @@
+CFLAGS=-O
+
+puff: puff.o pufftest.o
+
+puff.o: puff.h
+
+pufftest.o: puff.h
+
+test: puff
+ puff zeros.raw
+
+puft: puff.c puff.h pufftest.o
+ cc -fprofile-arcs -ftest-coverage -o puft puff.c pufftest.o
+
+# puff full coverage test (should say 100%)
+cov: puft
+ @rm -f *.gcov *.gcda
+ @puft -w zeros.raw 2>&1 | cat > /dev/null
+ @echo '04' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2
+ @echo '00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2
+ @echo '00 00 00 00 00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 254
+ @echo '00 01 00 fe ff' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2
+ @echo '01 01 00 fe ff 0a' | xxd -r -p | puft -f 2>&1 | cat > /dev/null
+ @echo '02 7e ff ff' | xxd -r -p | puft 2> /dev/null || test $$? -eq 246
+ @echo '02' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2
+ @echo '04 80 49 92 24 49 92 24 0f b4 ff ff c3 04' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2
+ @echo '04 80 49 92 24 49 92 24 71 ff ff 93 11 00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 249
+ @echo '04 c0 81 08 00 00 00 00 20 7f eb 0b 00 00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 246
+ @echo '0b 00 00' | xxd -r -p | puft -f 2>&1 | cat > /dev/null
+ @echo '1a 07' | xxd -r -p | puft 2> /dev/null || test $$? -eq 246
+ @echo '0c c0 81 00 00 00 00 00 90 ff 6b 04' | xxd -r -p | puft 2> /dev/null || test $$? -eq 245
+ @puft -f zeros.raw 2>&1 | cat > /dev/null
+ @echo 'fc 00 00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 253
+ @echo '04 00 fe ff' | xxd -r -p | puft 2> /dev/null || test $$? -eq 252
+ @echo '04 00 24 49' | xxd -r -p | puft 2> /dev/null || test $$? -eq 251
+ @echo '04 80 49 92 24 49 92 24 0f b4 ff ff c3 84' | xxd -r -p | puft 2> /dev/null || test $$? -eq 248
+ @echo '04 00 24 e9 ff ff' | xxd -r -p | puft 2> /dev/null || test $$? -eq 250
+ @echo '04 00 24 e9 ff 6d' | xxd -r -p | puft 2> /dev/null || test $$? -eq 247
+ @gcov -n puff.c
+
+clean:
+ rm -f puff puft *.o *.gc*
diff --git a/protocols/Telegram/tgl/zlib/contrib/puff/README b/protocols/Telegram/tgl/zlib/contrib/puff/README
new file mode 100644
index 0000000000..bbc4cb595e
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/puff/README
@@ -0,0 +1,63 @@
+Puff -- A Simple Inflate
+3 Mar 2003
+Mark Adler
+madler@alumni.caltech.edu
+
+What this is --
+
+puff.c provides the routine puff() to decompress the deflate data format. It
+does so more slowly than zlib, but the code is about one-fifth the size of the
+inflate code in zlib, and written to be very easy to read.
+
+Why I wrote this --
+
+puff.c was written to document the deflate format unambiguously, by virtue of
+being working C code. It is meant to supplement RFC 1951, which formally
+describes the deflate format. I have received many questions on details of the
+deflate format, and I hope that reading this code will answer those questions.
+puff.c is heavily commented with details of the deflate format, especially
+those little nooks and cranies of the format that might not be obvious from a
+specification.
+
+puff.c may also be useful in applications where code size or memory usage is a
+very limited resource, and speed is not as important.
+
+How to use it --
+
+Well, most likely you should just be reading puff.c and using zlib for actual
+applications, but if you must ...
+
+Include puff.h in your code, which provides this prototype:
+
+int puff(unsigned char *dest, /* pointer to destination pointer */
+ unsigned long *destlen, /* amount of output space */
+ unsigned char *source, /* pointer to source data pointer */
+ unsigned long *sourcelen); /* amount of input available */
+
+Then you can call puff() to decompress a deflate stream that is in memory in
+its entirety at source, to a sufficiently sized block of memory for the
+decompressed data at dest. puff() is the only external symbol in puff.c The
+only C library functions that puff.c needs are setjmp() and longjmp(), which
+are used to simplify error checking in the code to improve readabilty. puff.c
+does no memory allocation, and uses less than 2K bytes off of the stack.
+
+If destlen is not enough space for the uncompressed data, then inflate will
+return an error without writing more than destlen bytes. Note that this means
+that in order to decompress the deflate data successfully, you need to know
+the size of the uncompressed data ahead of time.
+
+If needed, puff() can determine the size of the uncompressed data with no
+output space. This is done by passing dest equal to (unsigned char *)0. Then
+the initial value of *destlen is ignored and *destlen is set to the length of
+the uncompressed data. So if the size of the uncompressed data is not known,
+then two passes of puff() can be used--first to determine the size, and second
+to do the actual inflation after allocating the appropriate memory. Not
+pretty, but it works. (This is one of the reasons you should be using zlib.)
+
+The deflate format is self-terminating. If the deflate stream does not end
+in *sourcelen bytes, puff() will return an error without reading at or past
+endsource.
+
+On return, *sourcelen is updated to the amount of input data consumed, and
+*destlen is updated to the size of the uncompressed data. See the comments
+in puff.c for the possible return codes for puff().
diff --git a/protocols/Telegram/tgl/zlib/contrib/puff/puff.c b/protocols/Telegram/tgl/zlib/contrib/puff/puff.c
new file mode 100644
index 0000000000..ba58483d57
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/puff/puff.c
@@ -0,0 +1,840 @@
+/*
+ * puff.c
+ * Copyright (C) 2002-2013 Mark Adler
+ * For conditions of distribution and use, see copyright notice in puff.h
+ * version 2.3, 21 Jan 2013
+ *
+ * puff.c is a simple inflate written to be an unambiguous way to specify the
+ * deflate format. It is not written for speed but rather simplicity. As a
+ * side benefit, this code might actually be useful when small code is more
+ * important than speed, such as bootstrap applications. For typical deflate
+ * data, zlib's inflate() is about four times as fast as puff(). zlib's
+ * inflate compiles to around 20K on my machine, whereas puff.c compiles to
+ * around 4K on my machine (a PowerPC using GNU cc). If the faster decode()
+ * function here is used, then puff() is only twice as slow as zlib's
+ * inflate().
+ *
+ * All dynamically allocated memory comes from the stack. The stack required
+ * is less than 2K bytes. This code is compatible with 16-bit int's and
+ * assumes that long's are at least 32 bits. puff.c uses the short data type,
+ * assumed to be 16 bits, for arrays in order to to conserve memory. The code
+ * works whether integers are stored big endian or little endian.
+ *
+ * In the comments below are "Format notes" that describe the inflate process
+ * and document some of the less obvious aspects of the format. This source
+ * code is meant to supplement RFC 1951, which formally describes the deflate
+ * format:
+ *
+ * http://www.zlib.org/rfc-deflate.html
+ */
+
+/*
+ * Change history:
+ *
+ * 1.0 10 Feb 2002 - First version
+ * 1.1 17 Feb 2002 - Clarifications of some comments and notes
+ * - Update puff() dest and source pointers on negative
+ * errors to facilitate debugging deflators
+ * - Remove longest from struct huffman -- not needed
+ * - Simplify offs[] index in construct()
+ * - Add input size and checking, using longjmp() to
+ * maintain easy readability
+ * - Use short data type for large arrays
+ * - Use pointers instead of long to specify source and
+ * destination sizes to avoid arbitrary 4 GB limits
+ * 1.2 17 Mar 2002 - Add faster version of decode(), doubles speed (!),
+ * but leave simple version for readabilty
+ * - Make sure invalid distances detected if pointers
+ * are 16 bits
+ * - Fix fixed codes table error
+ * - Provide a scanning mode for determining size of
+ * uncompressed data
+ * 1.3 20 Mar 2002 - Go back to lengths for puff() parameters [Gailly]
+ * - Add a puff.h file for the interface
+ * - Add braces in puff() for else do [Gailly]
+ * - Use indexes instead of pointers for readability
+ * 1.4 31 Mar 2002 - Simplify construct() code set check
+ * - Fix some comments
+ * - Add FIXLCODES #define
+ * 1.5 6 Apr 2002 - Minor comment fixes
+ * 1.6 7 Aug 2002 - Minor format changes
+ * 1.7 3 Mar 2003 - Added test code for distribution
+ * - Added zlib-like license
+ * 1.8 9 Jan 2004 - Added some comments on no distance codes case
+ * 1.9 21 Feb 2008 - Fix bug on 16-bit integer architectures [Pohland]
+ * - Catch missing end-of-block symbol error
+ * 2.0 25 Jul 2008 - Add #define to permit distance too far back
+ * - Add option in TEST code for puff to write the data
+ * - Add option in TEST code to skip input bytes
+ * - Allow TEST code to read from piped stdin
+ * 2.1 4 Apr 2010 - Avoid variable initialization for happier compilers
+ * - Avoid unsigned comparisons for even happier compilers
+ * 2.2 25 Apr 2010 - Fix bug in variable initializations [Oberhumer]
+ * - Add const where appropriate [Oberhumer]
+ * - Split if's and ?'s for coverage testing
+ * - Break out test code to separate file
+ * - Move NIL to puff.h
+ * - Allow incomplete code only if single code length is 1
+ * - Add full code coverage test to Makefile
+ * 2.3 21 Jan 2013 - Check for invalid code length codes in dynamic blocks
+ */
+
+#include <setjmp.h> /* for setjmp(), longjmp(), and jmp_buf */
+#include "puff.h" /* prototype for puff() */
+
+#define local static /* for local function definitions */
+
+/*
+ * Maximums for allocations and loops. It is not useful to change these --
+ * they are fixed by the deflate format.
+ */
+#define MAXBITS 15 /* maximum bits in a code */
+#define MAXLCODES 286 /* maximum number of literal/length codes */
+#define MAXDCODES 30 /* maximum number of distance codes */
+#define MAXCODES (MAXLCODES+MAXDCODES) /* maximum codes lengths to read */
+#define FIXLCODES 288 /* number of fixed literal/length codes */
+
+/* input and output state */
+struct state {
+ /* output state */
+ unsigned char *out; /* output buffer */
+ unsigned long outlen; /* available space at out */
+ unsigned long outcnt; /* bytes written to out so far */
+
+ /* input state */
+ const unsigned char *in; /* input buffer */
+ unsigned long inlen; /* available input at in */
+ unsigned long incnt; /* bytes read so far */
+ int bitbuf; /* bit buffer */
+ int bitcnt; /* number of bits in bit buffer */
+
+ /* input limit error return state for bits() and decode() */
+ jmp_buf env;
+};
+
+/*
+ * Return need bits from the input stream. This always leaves less than
+ * eight bits in the buffer. bits() works properly for need == 0.
+ *
+ * Format notes:
+ *
+ * - Bits are stored in bytes from the least significant bit to the most
+ * significant bit. Therefore bits are dropped from the bottom of the bit
+ * buffer, using shift right, and new bytes are appended to the top of the
+ * bit buffer, using shift left.
+ */
+local int bits(struct state *s, int need)
+{
+ long val; /* bit accumulator (can use up to 20 bits) */
+
+ /* load at least need bits into val */
+ val = s->bitbuf;
+ while (s->bitcnt < need) {
+ if (s->incnt == s->inlen)
+ longjmp(s->env, 1); /* out of input */
+ val |= (long)(s->in[s->incnt++]) << s->bitcnt; /* load eight bits */
+ s->bitcnt += 8;
+ }
+
+ /* drop need bits and update buffer, always zero to seven bits left */
+ s->bitbuf = (int)(val >> need);
+ s->bitcnt -= need;
+
+ /* return need bits, zeroing the bits above that */
+ return (int)(val & ((1L << need) - 1));
+}
+
+/*
+ * Process a stored block.
+ *
+ * Format notes:
+ *
+ * - After the two-bit stored block type (00), the stored block length and
+ * stored bytes are byte-aligned for fast copying. Therefore any leftover
+ * bits in the byte that has the last bit of the type, as many as seven, are
+ * discarded. The value of the discarded bits are not defined and should not
+ * be checked against any expectation.
+ *
+ * - The second inverted copy of the stored block length does not have to be
+ * checked, but it's probably a good idea to do so anyway.
+ *
+ * - A stored block can have zero length. This is sometimes used to byte-align
+ * subsets of the compressed data for random access or partial recovery.
+ */
+local int stored(struct state *s)
+{
+ unsigned len; /* length of stored block */
+
+ /* discard leftover bits from current byte (assumes s->bitcnt < 8) */
+ s->bitbuf = 0;
+ s->bitcnt = 0;
+
+ /* get length and check against its one's complement */
+ if (s->incnt + 4 > s->inlen)
+ return 2; /* not enough input */
+ len = s->in[s->incnt++];
+ len |= s->in[s->incnt++] << 8;
+ if (s->in[s->incnt++] != (~len & 0xff) ||
+ s->in[s->incnt++] != ((~len >> 8) & 0xff))
+ return -2; /* didn't match complement! */
+
+ /* copy len bytes from in to out */
+ if (s->incnt + len > s->inlen)
+ return 2; /* not enough input */
+ if (s->out != NIL) {
+ if (s->outcnt + len > s->outlen)
+ return 1; /* not enough output space */
+ while (len--)
+ s->out[s->outcnt++] = s->in[s->incnt++];
+ }
+ else { /* just scanning */
+ s->outcnt += len;
+ s->incnt += len;
+ }
+
+ /* done with a valid stored block */
+ return 0;
+}
+
+/*
+ * Huffman code decoding tables. count[1..MAXBITS] is the number of symbols of
+ * each length, which for a canonical code are stepped through in order.
+ * symbol[] are the symbol values in canonical order, where the number of
+ * entries is the sum of the counts in count[]. The decoding process can be
+ * seen in the function decode() below.
+ */
+struct huffman {
+ short *count; /* number of symbols of each length */
+ short *symbol; /* canonically ordered symbols */
+};
+
+/*
+ * Decode a code from the stream s using huffman table h. Return the symbol or
+ * a negative value if there is an error. If all of the lengths are zero, i.e.
+ * an empty code, or if the code is incomplete and an invalid code is received,
+ * then -10 is returned after reading MAXBITS bits.
+ *
+ * Format notes:
+ *
+ * - The codes as stored in the compressed data are bit-reversed relative to
+ * a simple integer ordering of codes of the same lengths. Hence below the
+ * bits are pulled from the compressed data one at a time and used to
+ * build the code value reversed from what is in the stream in order to
+ * permit simple integer comparisons for decoding. A table-based decoding
+ * scheme (as used in zlib) does not need to do this reversal.
+ *
+ * - The first code for the shortest length is all zeros. Subsequent codes of
+ * the same length are simply integer increments of the previous code. When
+ * moving up a length, a zero bit is appended to the code. For a complete
+ * code, the last code of the longest length will be all ones.
+ *
+ * - Incomplete codes are handled by this decoder, since they are permitted
+ * in the deflate format. See the format notes for fixed() and dynamic().
+ */
+#ifdef SLOW
+local int decode(struct state *s, const struct huffman *h)
+{
+ int len; /* current number of bits in code */
+ int code; /* len bits being decoded */
+ int first; /* first code of length len */
+ int count; /* number of codes of length len */
+ int index; /* index of first code of length len in symbol table */
+
+ code = first = index = 0;
+ for (len = 1; len <= MAXBITS; len++) {
+ code |= bits(s, 1); /* get next bit */
+ count = h->count[len];
+ if (code - count < first) /* if length len, return symbol */
+ return h->symbol[index + (code - first)];
+ index += count; /* else update for next length */
+ first += count;
+ first <<= 1;
+ code <<= 1;
+ }
+ return -10; /* ran out of codes */
+}
+
+/*
+ * A faster version of decode() for real applications of this code. It's not
+ * as readable, but it makes puff() twice as fast. And it only makes the code
+ * a few percent larger.
+ */
+#else /* !SLOW */
+local int decode(struct state *s, const struct huffman *h)
+{
+ int len; /* current number of bits in code */
+ int code; /* len bits being decoded */
+ int first; /* first code of length len */
+ int count; /* number of codes of length len */
+ int index; /* index of first code of length len in symbol table */
+ int bitbuf; /* bits from stream */
+ int left; /* bits left in next or left to process */
+ short *next; /* next number of codes */
+
+ bitbuf = s->bitbuf;
+ left = s->bitcnt;
+ code = first = index = 0;
+ len = 1;
+ next = h->count + 1;
+ while (1) {
+ while (left--) {
+ code |= bitbuf & 1;
+ bitbuf >>= 1;
+ count = *next++;
+ if (code - count < first) { /* if length len, return symbol */
+ s->bitbuf = bitbuf;
+ s->bitcnt = (s->bitcnt - len) & 7;
+ return h->symbol[index + (code - first)];
+ }
+ index += count; /* else update for next length */
+ first += count;
+ first <<= 1;
+ code <<= 1;
+ len++;
+ }
+ left = (MAXBITS+1) - len;
+ if (left == 0)
+ break;
+ if (s->incnt == s->inlen)
+ longjmp(s->env, 1); /* out of input */
+ bitbuf = s->in[s->incnt++];
+ if (left > 8)
+ left = 8;
+ }
+ return -10; /* ran out of codes */
+}
+#endif /* SLOW */
+
+/*
+ * Given the list of code lengths length[0..n-1] representing a canonical
+ * Huffman code for n symbols, construct the tables required to decode those
+ * codes. Those tables are the number of codes of each length, and the symbols
+ * sorted by length, retaining their original order within each length. The
+ * return value is zero for a complete code set, negative for an over-
+ * subscribed code set, and positive for an incomplete code set. The tables
+ * can be used if the return value is zero or positive, but they cannot be used
+ * if the return value is negative. If the return value is zero, it is not
+ * possible for decode() using that table to return an error--any stream of
+ * enough bits will resolve to a symbol. If the return value is positive, then
+ * it is possible for decode() using that table to return an error for received
+ * codes past the end of the incomplete lengths.
+ *
+ * Not used by decode(), but used for error checking, h->count[0] is the number
+ * of the n symbols not in the code. So n - h->count[0] is the number of
+ * codes. This is useful for checking for incomplete codes that have more than
+ * one symbol, which is an error in a dynamic block.
+ *
+ * Assumption: for all i in 0..n-1, 0 <= length[i] <= MAXBITS
+ * This is assured by the construction of the length arrays in dynamic() and
+ * fixed() and is not verified by construct().
+ *
+ * Format notes:
+ *
+ * - Permitted and expected examples of incomplete codes are one of the fixed
+ * codes and any code with a single symbol which in deflate is coded as one
+ * bit instead of zero bits. See the format notes for fixed() and dynamic().
+ *
+ * - Within a given code length, the symbols are kept in ascending order for
+ * the code bits definition.
+ */
+local int construct(struct huffman *h, const short *length, int n)
+{
+ int symbol; /* current symbol when stepping through length[] */
+ int len; /* current length when stepping through h->count[] */
+ int left; /* number of possible codes left of current length */
+ short offs[MAXBITS+1]; /* offsets in symbol table for each length */
+
+ /* count number of codes of each length */
+ for (len = 0; len <= MAXBITS; len++)
+ h->count[len] = 0;
+ for (symbol = 0; symbol < n; symbol++)
+ (h->count[length[symbol]])++; /* assumes lengths are within bounds */
+ if (h->count[0] == n) /* no codes! */
+ return 0; /* complete, but decode() will fail */
+
+ /* check for an over-subscribed or incomplete set of lengths */
+ left = 1; /* one possible code of zero length */
+ for (len = 1; len <= MAXBITS; len++) {
+ left <<= 1; /* one more bit, double codes left */
+ left -= h->count[len]; /* deduct count from possible codes */
+ if (left < 0)
+ return left; /* over-subscribed--return negative */
+ } /* left > 0 means incomplete */
+
+ /* generate offsets into symbol table for each length for sorting */
+ offs[1] = 0;
+ for (len = 1; len < MAXBITS; len++)
+ offs[len + 1] = offs[len] + h->count[len];
+
+ /*
+ * put symbols in table sorted by length, by symbol order within each
+ * length
+ */
+ for (symbol = 0; symbol < n; symbol++)
+ if (length[symbol] != 0)
+ h->symbol[offs[length[symbol]]++] = symbol;
+
+ /* return zero for complete set, positive for incomplete set */
+ return left;
+}
+
+/*
+ * Decode literal/length and distance codes until an end-of-block code.
+ *
+ * Format notes:
+ *
+ * - Compressed data that is after the block type if fixed or after the code
+ * description if dynamic is a combination of literals and length/distance
+ * pairs terminated by and end-of-block code. Literals are simply Huffman
+ * coded bytes. A length/distance pair is a coded length followed by a
+ * coded distance to represent a string that occurs earlier in the
+ * uncompressed data that occurs again at the current location.
+ *
+ * - Literals, lengths, and the end-of-block code are combined into a single
+ * code of up to 286 symbols. They are 256 literals (0..255), 29 length
+ * symbols (257..285), and the end-of-block symbol (256).
+ *
+ * - There are 256 possible lengths (3..258), and so 29 symbols are not enough
+ * to represent all of those. Lengths 3..10 and 258 are in fact represented
+ * by just a length symbol. Lengths 11..257 are represented as a symbol and
+ * some number of extra bits that are added as an integer to the base length
+ * of the length symbol. The number of extra bits is determined by the base
+ * length symbol. These are in the static arrays below, lens[] for the base
+ * lengths and lext[] for the corresponding number of extra bits.
+ *
+ * - The reason that 258 gets its own symbol is that the longest length is used
+ * often in highly redundant files. Note that 258 can also be coded as the
+ * base value 227 plus the maximum extra value of 31. While a good deflate
+ * should never do this, it is not an error, and should be decoded properly.
+ *
+ * - If a length is decoded, including its extra bits if any, then it is
+ * followed a distance code. There are up to 30 distance symbols. Again
+ * there are many more possible distances (1..32768), so extra bits are added
+ * to a base value represented by the symbol. The distances 1..4 get their
+ * own symbol, but the rest require extra bits. The base distances and
+ * corresponding number of extra bits are below in the static arrays dist[]
+ * and dext[].
+ *
+ * - Literal bytes are simply written to the output. A length/distance pair is
+ * an instruction to copy previously uncompressed bytes to the output. The
+ * copy is from distance bytes back in the output stream, copying for length
+ * bytes.
+ *
+ * - Distances pointing before the beginning of the output data are not
+ * permitted.
+ *
+ * - Overlapped copies, where the length is greater than the distance, are
+ * allowed and common. For example, a distance of one and a length of 258
+ * simply copies the last byte 258 times. A distance of four and a length of
+ * twelve copies the last four bytes three times. A simple forward copy
+ * ignoring whether the length is greater than the distance or not implements
+ * this correctly. You should not use memcpy() since its behavior is not
+ * defined for overlapped arrays. You should not use memmove() or bcopy()
+ * since though their behavior -is- defined for overlapping arrays, it is
+ * defined to do the wrong thing in this case.
+ */
+local int codes(struct state *s,
+ const struct huffman *lencode,
+ const struct huffman *distcode)
+{
+ int symbol; /* decoded symbol */
+ int len; /* length for copy */
+ unsigned dist; /* distance for copy */
+ static const short lens[29] = { /* Size base for length codes 257..285 */
+ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
+ 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258};
+ static const short lext[29] = { /* Extra bits for length codes 257..285 */
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
+ 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0};
+ static const short dists[30] = { /* Offset base for distance codes 0..29 */
+ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
+ 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
+ 8193, 12289, 16385, 24577};
+ static const short dext[30] = { /* Extra bits for distance codes 0..29 */
+ 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
+ 7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
+ 12, 12, 13, 13};
+
+ /* decode literals and length/distance pairs */
+ do {
+ symbol = decode(s, lencode);
+ if (symbol < 0)
+ return symbol; /* invalid symbol */
+ if (symbol < 256) { /* literal: symbol is the byte */
+ /* write out the literal */
+ if (s->out != NIL) {
+ if (s->outcnt == s->outlen)
+ return 1;
+ s->out[s->outcnt] = symbol;
+ }
+ s->outcnt++;
+ }
+ else if (symbol > 256) { /* length */
+ /* get and compute length */
+ symbol -= 257;
+ if (symbol >= 29)
+ return -10; /* invalid fixed code */
+ len = lens[symbol] + bits(s, lext[symbol]);
+
+ /* get and check distance */
+ symbol = decode(s, distcode);
+ if (symbol < 0)
+ return symbol; /* invalid symbol */
+ dist = dists[symbol] + bits(s, dext[symbol]);
+#ifndef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
+ if (dist > s->outcnt)
+ return -11; /* distance too far back */
+#endif
+
+ /* copy length bytes from distance bytes back */
+ if (s->out != NIL) {
+ if (s->outcnt + len > s->outlen)
+ return 1;
+ while (len--) {
+ s->out[s->outcnt] =
+#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
+ dist > s->outcnt ?
+ 0 :
+#endif
+ s->out[s->outcnt - dist];
+ s->outcnt++;
+ }
+ }
+ else
+ s->outcnt += len;
+ }
+ } while (symbol != 256); /* end of block symbol */
+
+ /* done with a valid fixed or dynamic block */
+ return 0;
+}
+
+/*
+ * Process a fixed codes block.
+ *
+ * Format notes:
+ *
+ * - This block type can be useful for compressing small amounts of data for
+ * which the size of the code descriptions in a dynamic block exceeds the
+ * benefit of custom codes for that block. For fixed codes, no bits are
+ * spent on code descriptions. Instead the code lengths for literal/length
+ * codes and distance codes are fixed. The specific lengths for each symbol
+ * can be seen in the "for" loops below.
+ *
+ * - The literal/length code is complete, but has two symbols that are invalid
+ * and should result in an error if received. This cannot be implemented
+ * simply as an incomplete code since those two symbols are in the "middle"
+ * of the code. They are eight bits long and the longest literal/length\
+ * code is nine bits. Therefore the code must be constructed with those
+ * symbols, and the invalid symbols must be detected after decoding.
+ *
+ * - The fixed distance codes also have two invalid symbols that should result
+ * in an error if received. Since all of the distance codes are the same
+ * length, this can be implemented as an incomplete code. Then the invalid
+ * codes are detected while decoding.
+ */
+local int fixed(struct state *s)
+{
+ static int virgin = 1;
+ static short lencnt[MAXBITS+1], lensym[FIXLCODES];
+ static short distcnt[MAXBITS+1], distsym[MAXDCODES];
+ static struct huffman lencode, distcode;
+
+ /* build fixed huffman tables if first call (may not be thread safe) */
+ if (virgin) {
+ int symbol;
+ short lengths[FIXLCODES];
+
+ /* construct lencode and distcode */
+ lencode.count = lencnt;
+ lencode.symbol = lensym;
+ distcode.count = distcnt;
+ distcode.symbol = distsym;
+
+ /* literal/length table */
+ for (symbol = 0; symbol < 144; symbol++)
+ lengths[symbol] = 8;
+ for (; symbol < 256; symbol++)
+ lengths[symbol] = 9;
+ for (; symbol < 280; symbol++)
+ lengths[symbol] = 7;
+ for (; symbol < FIXLCODES; symbol++)
+ lengths[symbol] = 8;
+ construct(&lencode, lengths, FIXLCODES);
+
+ /* distance table */
+ for (symbol = 0; symbol < MAXDCODES; symbol++)
+ lengths[symbol] = 5;
+ construct(&distcode, lengths, MAXDCODES);
+
+ /* do this just once */
+ virgin = 0;
+ }
+
+ /* decode data until end-of-block code */
+ return codes(s, &lencode, &distcode);
+}
+
+/*
+ * Process a dynamic codes block.
+ *
+ * Format notes:
+ *
+ * - A dynamic block starts with a description of the literal/length and
+ * distance codes for that block. New dynamic blocks allow the compressor to
+ * rapidly adapt to changing data with new codes optimized for that data.
+ *
+ * - The codes used by the deflate format are "canonical", which means that
+ * the actual bits of the codes are generated in an unambiguous way simply
+ * from the number of bits in each code. Therefore the code descriptions
+ * are simply a list of code lengths for each symbol.
+ *
+ * - The code lengths are stored in order for the symbols, so lengths are
+ * provided for each of the literal/length symbols, and for each of the
+ * distance symbols.
+ *
+ * - If a symbol is not used in the block, this is represented by a zero as
+ * as the code length. This does not mean a zero-length code, but rather
+ * that no code should be created for this symbol. There is no way in the
+ * deflate format to represent a zero-length code.
+ *
+ * - The maximum number of bits in a code is 15, so the possible lengths for
+ * any code are 1..15.
+ *
+ * - The fact that a length of zero is not permitted for a code has an
+ * interesting consequence. Normally if only one symbol is used for a given
+ * code, then in fact that code could be represented with zero bits. However
+ * in deflate, that code has to be at least one bit. So for example, if
+ * only a single distance base symbol appears in a block, then it will be
+ * represented by a single code of length one, in particular one 0 bit. This
+ * is an incomplete code, since if a 1 bit is received, it has no meaning,
+ * and should result in an error. So incomplete distance codes of one symbol
+ * should be permitted, and the receipt of invalid codes should be handled.
+ *
+ * - It is also possible to have a single literal/length code, but that code
+ * must be the end-of-block code, since every dynamic block has one. This
+ * is not the most efficient way to create an empty block (an empty fixed
+ * block is fewer bits), but it is allowed by the format. So incomplete
+ * literal/length codes of one symbol should also be permitted.
+ *
+ * - If there are only literal codes and no lengths, then there are no distance
+ * codes. This is represented by one distance code with zero bits.
+ *
+ * - The list of up to 286 length/literal lengths and up to 30 distance lengths
+ * are themselves compressed using Huffman codes and run-length encoding. In
+ * the list of code lengths, a 0 symbol means no code, a 1..15 symbol means
+ * that length, and the symbols 16, 17, and 18 are run-length instructions.
+ * Each of 16, 17, and 18 are follwed by extra bits to define the length of
+ * the run. 16 copies the last length 3 to 6 times. 17 represents 3 to 10
+ * zero lengths, and 18 represents 11 to 138 zero lengths. Unused symbols
+ * are common, hence the special coding for zero lengths.
+ *
+ * - The symbols for 0..18 are Huffman coded, and so that code must be
+ * described first. This is simply a sequence of up to 19 three-bit values
+ * representing no code (0) or the code length for that symbol (1..7).
+ *
+ * - A dynamic block starts with three fixed-size counts from which is computed
+ * the number of literal/length code lengths, the number of distance code
+ * lengths, and the number of code length code lengths (ok, you come up with
+ * a better name!) in the code descriptions. For the literal/length and
+ * distance codes, lengths after those provided are considered zero, i.e. no
+ * code. The code length code lengths are received in a permuted order (see
+ * the order[] array below) to make a short code length code length list more
+ * likely. As it turns out, very short and very long codes are less likely
+ * to be seen in a dynamic code description, hence what may appear initially
+ * to be a peculiar ordering.
+ *
+ * - Given the number of literal/length code lengths (nlen) and distance code
+ * lengths (ndist), then they are treated as one long list of nlen + ndist
+ * code lengths. Therefore run-length coding can and often does cross the
+ * boundary between the two sets of lengths.
+ *
+ * - So to summarize, the code description at the start of a dynamic block is
+ * three counts for the number of code lengths for the literal/length codes,
+ * the distance codes, and the code length codes. This is followed by the
+ * code length code lengths, three bits each. This is used to construct the
+ * code length code which is used to read the remainder of the lengths. Then
+ * the literal/length code lengths and distance lengths are read as a single
+ * set of lengths using the code length codes. Codes are constructed from
+ * the resulting two sets of lengths, and then finally you can start
+ * decoding actual compressed data in the block.
+ *
+ * - For reference, a "typical" size for the code description in a dynamic
+ * block is around 80 bytes.
+ */
+local int dynamic(struct state *s)
+{
+ int nlen, ndist, ncode; /* number of lengths in descriptor */
+ int index; /* index of lengths[] */
+ int err; /* construct() return value */
+ short lengths[MAXCODES]; /* descriptor code lengths */
+ short lencnt[MAXBITS+1], lensym[MAXLCODES]; /* lencode memory */
+ short distcnt[MAXBITS+1], distsym[MAXDCODES]; /* distcode memory */
+ struct huffman lencode, distcode; /* length and distance codes */
+ static const short order[19] = /* permutation of code length codes */
+ {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
+
+ /* construct lencode and distcode */
+ lencode.count = lencnt;
+ lencode.symbol = lensym;
+ distcode.count = distcnt;
+ distcode.symbol = distsym;
+
+ /* get number of lengths in each table, check lengths */
+ nlen = bits(s, 5) + 257;
+ ndist = bits(s, 5) + 1;
+ ncode = bits(s, 4) + 4;
+ if (nlen > MAXLCODES || ndist > MAXDCODES)
+ return -3; /* bad counts */
+
+ /* read code length code lengths (really), missing lengths are zero */
+ for (index = 0; index < ncode; index++)
+ lengths[order[index]] = bits(s, 3);
+ for (; index < 19; index++)
+ lengths[order[index]] = 0;
+
+ /* build huffman table for code lengths codes (use lencode temporarily) */
+ err = construct(&lencode, lengths, 19);
+ if (err != 0) /* require complete code set here */
+ return -4;
+
+ /* read length/literal and distance code length tables */
+ index = 0;
+ while (index < nlen + ndist) {
+ int symbol; /* decoded value */
+ int len; /* last length to repeat */
+
+ symbol = decode(s, &lencode);
+ if (symbol < 0)
+ return symbol; /* invalid symbol */
+ if (symbol < 16) /* length in 0..15 */
+ lengths[index++] = symbol;
+ else { /* repeat instruction */
+ len = 0; /* assume repeating zeros */
+ if (symbol == 16) { /* repeat last length 3..6 times */
+ if (index == 0)
+ return -5; /* no last length! */
+ len = lengths[index - 1]; /* last length */
+ symbol = 3 + bits(s, 2);
+ }
+ else if (symbol == 17) /* repeat zero 3..10 times */
+ symbol = 3 + bits(s, 3);
+ else /* == 18, repeat zero 11..138 times */
+ symbol = 11 + bits(s, 7);
+ if (index + symbol > nlen + ndist)
+ return -6; /* too many lengths! */
+ while (symbol--) /* repeat last or zero symbol times */
+ lengths[index++] = len;
+ }
+ }
+
+ /* check for end-of-block code -- there better be one! */
+ if (lengths[256] == 0)
+ return -9;
+
+ /* build huffman table for literal/length codes */
+ err = construct(&lencode, lengths, nlen);
+ if (err && (err < 0 || nlen != lencode.count[0] + lencode.count[1]))
+ return -7; /* incomplete code ok only for single length 1 code */
+
+ /* build huffman table for distance codes */
+ err = construct(&distcode, lengths + nlen, ndist);
+ if (err && (err < 0 || ndist != distcode.count[0] + distcode.count[1]))
+ return -8; /* incomplete code ok only for single length 1 code */
+
+ /* decode data until end-of-block code */
+ return codes(s, &lencode, &distcode);
+}
+
+/*
+ * Inflate source to dest. On return, destlen and sourcelen are updated to the
+ * size of the uncompressed data and the size of the deflate data respectively.
+ * On success, the return value of puff() is zero. If there is an error in the
+ * source data, i.e. it is not in the deflate format, then a negative value is
+ * returned. If there is not enough input available or there is not enough
+ * output space, then a positive error is returned. In that case, destlen and
+ * sourcelen are not updated to facilitate retrying from the beginning with the
+ * provision of more input data or more output space. In the case of invalid
+ * inflate data (a negative error), the dest and source pointers are updated to
+ * facilitate the debugging of deflators.
+ *
+ * puff() also has a mode to determine the size of the uncompressed output with
+ * no output written. For this dest must be (unsigned char *)0. In this case,
+ * the input value of *destlen is ignored, and on return *destlen is set to the
+ * size of the uncompressed output.
+ *
+ * The return codes are:
+ *
+ * 2: available inflate data did not terminate
+ * 1: output space exhausted before completing inflate
+ * 0: successful inflate
+ * -1: invalid block type (type == 3)
+ * -2: stored block length did not match one's complement
+ * -3: dynamic block code description: too many length or distance codes
+ * -4: dynamic block code description: code lengths codes incomplete
+ * -5: dynamic block code description: repeat lengths with no first length
+ * -6: dynamic block code description: repeat more than specified lengths
+ * -7: dynamic block code description: invalid literal/length code lengths
+ * -8: dynamic block code description: invalid distance code lengths
+ * -9: dynamic block code description: missing end-of-block code
+ * -10: invalid literal/length or distance code in fixed or dynamic block
+ * -11: distance is too far back in fixed or dynamic block
+ *
+ * Format notes:
+ *
+ * - Three bits are read for each block to determine the kind of block and
+ * whether or not it is the last block. Then the block is decoded and the
+ * process repeated if it was not the last block.
+ *
+ * - The leftover bits in the last byte of the deflate data after the last
+ * block (if it was a fixed or dynamic block) are undefined and have no
+ * expected values to check.
+ */
+int puff(unsigned char *dest, /* pointer to destination pointer */
+ unsigned long *destlen, /* amount of output space */
+ const unsigned char *source, /* pointer to source data pointer */
+ unsigned long *sourcelen) /* amount of input available */
+{
+ struct state s; /* input/output state */
+ int last, type; /* block information */
+ int err; /* return value */
+
+ /* initialize output state */
+ s.out = dest;
+ s.outlen = *destlen; /* ignored if dest is NIL */
+ s.outcnt = 0;
+
+ /* initialize input state */
+ s.in = source;
+ s.inlen = *sourcelen;
+ s.incnt = 0;
+ s.bitbuf = 0;
+ s.bitcnt = 0;
+
+ /* return if bits() or decode() tries to read past available input */
+ if (setjmp(s.env) != 0) /* if came back here via longjmp() */
+ err = 2; /* then skip do-loop, return error */
+ else {
+ /* process blocks until last block or error */
+ do {
+ last = bits(&s, 1); /* one if last block */
+ type = bits(&s, 2); /* block type 0..3 */
+ err = type == 0 ?
+ stored(&s) :
+ (type == 1 ?
+ fixed(&s) :
+ (type == 2 ?
+ dynamic(&s) :
+ -1)); /* type == 3, invalid */
+ if (err != 0)
+ break; /* return with error */
+ } while (!last);
+ }
+
+ /* update the lengths and return */
+ if (err <= 0) {
+ *destlen = s.outcnt;
+ *sourcelen = s.incnt;
+ }
+ return err;
+}
diff --git a/protocols/Telegram/tgl/zlib/contrib/puff/puff.h b/protocols/Telegram/tgl/zlib/contrib/puff/puff.h
new file mode 100644
index 0000000000..e23a245431
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/puff/puff.h
@@ -0,0 +1,35 @@
+/* puff.h
+ Copyright (C) 2002-2013 Mark Adler, all rights reserved
+ version 2.3, 21 Jan 2013
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the author be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Mark Adler madler@alumni.caltech.edu
+ */
+
+
+/*
+ * See puff.c for purpose and usage.
+ */
+#ifndef NIL
+# define NIL ((unsigned char *)0) /* for no output option */
+#endif
+
+int puff(unsigned char *dest, /* pointer to destination pointer */
+ unsigned long *destlen, /* amount of output space */
+ const unsigned char *source, /* pointer to source data pointer */
+ unsigned long *sourcelen); /* amount of input available */
diff --git a/protocols/Telegram/tgl/zlib/contrib/puff/pufftest.c b/protocols/Telegram/tgl/zlib/contrib/puff/pufftest.c
new file mode 100644
index 0000000000..776481488c
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/puff/pufftest.c
@@ -0,0 +1,165 @@
+/*
+ * pufftest.c
+ * Copyright (C) 2002-2013 Mark Adler
+ * For conditions of distribution and use, see copyright notice in puff.h
+ * version 2.3, 21 Jan 2013
+ */
+
+/* Example of how to use puff().
+
+ Usage: puff [-w] [-f] [-nnn] file
+ ... | puff [-w] [-f] [-nnn]
+
+ where file is the input file with deflate data, nnn is the number of bytes
+ of input to skip before inflating (e.g. to skip a zlib or gzip header), and
+ -w is used to write the decompressed data to stdout. -f is for coverage
+ testing, and causes pufftest to fail with not enough output space (-f does
+ a write like -w, so -w is not required). */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "puff.h"
+
+#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__)
+# include <fcntl.h>
+# include <io.h>
+# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
+#else
+# define SET_BINARY_MODE(file)
+#endif
+
+#define local static
+
+/* Return size times approximately the cube root of 2, keeping the result as 1,
+ 3, or 5 times a power of 2 -- the result is always > size, until the result
+ is the maximum value of an unsigned long, where it remains. This is useful
+ to keep reallocations less than ~33% over the actual data. */
+local size_t bythirds(size_t size)
+{
+ int n;
+ size_t m;
+
+ m = size;
+ for (n = 0; m; n++)
+ m >>= 1;
+ if (n < 3)
+ return size + 1;
+ n -= 3;
+ m = size >> n;
+ m += m == 6 ? 2 : 1;
+ m <<= n;
+ return m > size ? m : (size_t)(-1);
+}
+
+/* Read the input file *name, or stdin if name is NULL, into allocated memory.
+ Reallocate to larger buffers until the entire file is read in. Return a
+ pointer to the allocated data, or NULL if there was a memory allocation
+ failure. *len is the number of bytes of data read from the input file (even
+ if load() returns NULL). If the input file was empty or could not be opened
+ or read, *len is zero. */
+local void *load(const char *name, size_t *len)
+{
+ size_t size;
+ void *buf, *swap;
+ FILE *in;
+
+ *len = 0;
+ buf = malloc(size = 4096);
+ if (buf == NULL)
+ return NULL;
+ in = name == NULL ? stdin : fopen(name, "rb");
+ if (in != NULL) {
+ for (;;) {
+ *len += fread((char *)buf + *len, 1, size - *len, in);
+ if (*len < size) break;
+ size = bythirds(size);
+ if (size == *len || (swap = realloc(buf, size)) == NULL) {
+ free(buf);
+ buf = NULL;
+ break;
+ }
+ buf = swap;
+ }
+ fclose(in);
+ }
+ return buf;
+}
+
+int main(int argc, char **argv)
+{
+ int ret, put = 0, fail = 0;
+ unsigned skip = 0;
+ char *arg, *name = NULL;
+ unsigned char *source = NULL, *dest;
+ size_t len = 0;
+ unsigned long sourcelen, destlen;
+
+ /* process arguments */
+ while (arg = *++argv, --argc)
+ if (arg[0] == '-') {
+ if (arg[1] == 'w' && arg[2] == 0)
+ put = 1;
+ else if (arg[1] == 'f' && arg[2] == 0)
+ fail = 1, put = 1;
+ else if (arg[1] >= '0' && arg[1] <= '9')
+ skip = (unsigned)atoi(arg + 1);
+ else {
+ fprintf(stderr, "invalid option %s\n", arg);
+ return 3;
+ }
+ }
+ else if (name != NULL) {
+ fprintf(stderr, "only one file name allowed\n");
+ return 3;
+ }
+ else
+ name = arg;
+ source = load(name, &len);
+ if (source == NULL) {
+ fprintf(stderr, "memory allocation failure\n");
+ return 4;
+ }
+ if (len == 0) {
+ fprintf(stderr, "could not read %s, or it was empty\n",
+ name == NULL ? "<stdin>" : name);
+ free(source);
+ return 3;
+ }
+ if (skip >= len) {
+ fprintf(stderr, "skip request of %d leaves no input\n", skip);
+ free(source);
+ return 3;
+ }
+
+ /* test inflate data with offset skip */
+ len -= skip;
+ sourcelen = (unsigned long)len;
+ ret = puff(NIL, &destlen, source + skip, &sourcelen);
+ if (ret)
+ fprintf(stderr, "puff() failed with return code %d\n", ret);
+ else {
+ fprintf(stderr, "puff() succeeded uncompressing %lu bytes\n", destlen);
+ if (sourcelen < len) fprintf(stderr, "%lu compressed bytes unused\n",
+ len - sourcelen);
+ }
+
+ /* if requested, inflate again and write decompressd data to stdout */
+ if (put && ret == 0) {
+ if (fail)
+ destlen >>= 1;
+ dest = malloc(destlen);
+ if (dest == NULL) {
+ fprintf(stderr, "memory allocation failure\n");
+ free(source);
+ return 4;
+ }
+ puff(dest, &destlen, source + skip, &sourcelen);
+ SET_BINARY_MODE(stdout);
+ fwrite(dest, 1, destlen, stdout);
+ free(dest);
+ }
+
+ /* clean up */
+ free(source);
+ return ret;
+}
diff --git a/protocols/Telegram/tgl/zlib/contrib/puff/zeros.raw b/protocols/Telegram/tgl/zlib/contrib/puff/zeros.raw
new file mode 100644
index 0000000000..0a90e76b30
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/puff/zeros.raw
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/testzlib/testzlib.c b/protocols/Telegram/tgl/zlib/contrib/testzlib/testzlib.c
new file mode 100644
index 0000000000..5f659dea00
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/testzlib/testzlib.c
@@ -0,0 +1,275 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <windows.h>
+
+#include "zlib.h"
+
+
+void MyDoMinus64(LARGE_INTEGER *R,LARGE_INTEGER A,LARGE_INTEGER B)
+{
+ R->HighPart = A.HighPart - B.HighPart;
+ if (A.LowPart >= B.LowPart)
+ R->LowPart = A.LowPart - B.LowPart;
+ else
+ {
+ R->LowPart = A.LowPart - B.LowPart;
+ R->HighPart --;
+ }
+}
+
+#ifdef _M_X64
+// see http://msdn2.microsoft.com/library/twchhe95(en-us,vs.80).aspx for __rdtsc
+unsigned __int64 __rdtsc(void);
+void BeginCountRdtsc(LARGE_INTEGER * pbeginTime64)
+{
+ // printf("rdtsc = %I64x\n",__rdtsc());
+ pbeginTime64->QuadPart=__rdtsc();
+}
+
+LARGE_INTEGER GetResRdtsc(LARGE_INTEGER beginTime64,BOOL fComputeTimeQueryPerf)
+{
+ LARGE_INTEGER LIres;
+ unsigned _int64 res=__rdtsc()-((unsigned _int64)(beginTime64.QuadPart));
+ LIres.QuadPart=res;
+ // printf("rdtsc = %I64x\n",__rdtsc());
+ return LIres;
+}
+#else
+#ifdef _M_IX86
+void myGetRDTSC32(LARGE_INTEGER * pbeginTime64)
+{
+ DWORD dwEdx,dwEax;
+ _asm
+ {
+ rdtsc
+ mov dwEax,eax
+ mov dwEdx,edx
+ }
+ pbeginTime64->LowPart=dwEax;
+ pbeginTime64->HighPart=dwEdx;
+}
+
+void BeginCountRdtsc(LARGE_INTEGER * pbeginTime64)
+{
+ myGetRDTSC32(pbeginTime64);
+}
+
+LARGE_INTEGER GetResRdtsc(LARGE_INTEGER beginTime64,BOOL fComputeTimeQueryPerf)
+{
+ LARGE_INTEGER LIres,endTime64;
+ myGetRDTSC32(&endTime64);
+
+ LIres.LowPart=LIres.HighPart=0;
+ MyDoMinus64(&LIres,endTime64,beginTime64);
+ return LIres;
+}
+#else
+void myGetRDTSC32(LARGE_INTEGER * pbeginTime64)
+{
+}
+
+void BeginCountRdtsc(LARGE_INTEGER * pbeginTime64)
+{
+}
+
+LARGE_INTEGER GetResRdtsc(LARGE_INTEGER beginTime64,BOOL fComputeTimeQueryPerf)
+{
+ LARGE_INTEGER lr;
+ lr.QuadPart=0;
+ return lr;
+}
+#endif
+#endif
+
+void BeginCountPerfCounter(LARGE_INTEGER * pbeginTime64,BOOL fComputeTimeQueryPerf)
+{
+ if ((!fComputeTimeQueryPerf) || (!QueryPerformanceCounter(pbeginTime64)))
+ {
+ pbeginTime64->LowPart = GetTickCount();
+ pbeginTime64->HighPart = 0;
+ }
+}
+
+DWORD GetMsecSincePerfCounter(LARGE_INTEGER beginTime64,BOOL fComputeTimeQueryPerf)
+{
+ LARGE_INTEGER endTime64,ticksPerSecond,ticks;
+ DWORDLONG ticksShifted,tickSecShifted;
+ DWORD dwLog=16+0;
+ DWORD dwRet;
+ if ((!fComputeTimeQueryPerf) || (!QueryPerformanceCounter(&endTime64)))
+ dwRet = (GetTickCount() - beginTime64.LowPart)*1;
+ else
+ {
+ MyDoMinus64(&ticks,endTime64,beginTime64);
+ QueryPerformanceFrequency(&ticksPerSecond);
+
+
+ {
+ ticksShifted = Int64ShrlMod32(*(DWORDLONG*)&ticks,dwLog);
+ tickSecShifted = Int64ShrlMod32(*(DWORDLONG*)&ticksPerSecond,dwLog);
+
+ }
+
+ dwRet = (DWORD)((((DWORD)ticksShifted)*1000)/(DWORD)(tickSecShifted));
+ dwRet *=1;
+ }
+ return dwRet;
+}
+
+int ReadFileMemory(const char* filename,long* plFileSize,unsigned char** pFilePtr)
+{
+ FILE* stream;
+ unsigned char* ptr;
+ int retVal=1;
+ stream=fopen(filename, "rb");
+ if (stream==NULL)
+ return 0;
+
+ fseek(stream,0,SEEK_END);
+
+ *plFileSize=ftell(stream);
+ fseek(stream,0,SEEK_SET);
+ ptr=malloc((*plFileSize)+1);
+ if (ptr==NULL)
+ retVal=0;
+ else
+ {
+ if (fread(ptr, 1, *plFileSize,stream) != (*plFileSize))
+ retVal=0;
+ }
+ fclose(stream);
+ *pFilePtr=ptr;
+ return retVal;
+}
+
+int main(int argc, char *argv[])
+{
+ int BlockSizeCompress=0x8000;
+ int BlockSizeUncompress=0x8000;
+ int cprLevel=Z_DEFAULT_COMPRESSION ;
+ long lFileSize;
+ unsigned char* FilePtr;
+ long lBufferSizeCpr;
+ long lBufferSizeUncpr;
+ long lCompressedSize=0;
+ unsigned char* CprPtr;
+ unsigned char* UncprPtr;
+ long lSizeCpr,lSizeUncpr;
+ DWORD dwGetTick,dwMsecQP;
+ LARGE_INTEGER li_qp,li_rdtsc,dwResRdtsc;
+
+ if (argc<=1)
+ {
+ printf("run TestZlib <File> [BlockSizeCompress] [BlockSizeUncompress] [compres. level]\n");
+ return 0;
+ }
+
+ if (ReadFileMemory(argv[1],&lFileSize,&FilePtr)==0)
+ {
+ printf("error reading %s\n",argv[1]);
+ return 1;
+ }
+ else printf("file %s read, %u bytes\n",argv[1],lFileSize);
+
+ if (argc>=3)
+ BlockSizeCompress=atol(argv[2]);
+
+ if (argc>=4)
+ BlockSizeUncompress=atol(argv[3]);
+
+ if (argc>=5)
+ cprLevel=(int)atol(argv[4]);
+
+ lBufferSizeCpr = lFileSize + (lFileSize/0x10) + 0x200;
+ lBufferSizeUncpr = lBufferSizeCpr;
+
+ CprPtr=(unsigned char*)malloc(lBufferSizeCpr + BlockSizeCompress);
+
+ BeginCountPerfCounter(&li_qp,TRUE);
+ dwGetTick=GetTickCount();
+ BeginCountRdtsc(&li_rdtsc);
+ {
+ z_stream zcpr;
+ int ret=Z_OK;
+ long lOrigToDo = lFileSize;
+ long lOrigDone = 0;
+ int step=0;
+ memset(&zcpr,0,sizeof(z_stream));
+ deflateInit(&zcpr,cprLevel);
+
+ zcpr.next_in = FilePtr;
+ zcpr.next_out = CprPtr;
+
+
+ do
+ {
+ long all_read_before = zcpr.total_in;
+ zcpr.avail_in = min(lOrigToDo,BlockSizeCompress);
+ zcpr.avail_out = BlockSizeCompress;
+ ret=deflate(&zcpr,(zcpr.avail_in==lOrigToDo) ? Z_FINISH : Z_SYNC_FLUSH);
+ lOrigDone += (zcpr.total_in-all_read_before);
+ lOrigToDo -= (zcpr.total_in-all_read_before);
+ step++;
+ } while (ret==Z_OK);
+
+ lSizeCpr=zcpr.total_out;
+ deflateEnd(&zcpr);
+ dwGetTick=GetTickCount()-dwGetTick;
+ dwMsecQP=GetMsecSincePerfCounter(li_qp,TRUE);
+ dwResRdtsc=GetResRdtsc(li_rdtsc,TRUE);
+ printf("total compress size = %u, in %u step\n",lSizeCpr,step);
+ printf("time = %u msec = %f sec\n",dwGetTick,dwGetTick/(double)1000.);
+ printf("defcpr time QP = %u msec = %f sec\n",dwMsecQP,dwMsecQP/(double)1000.);
+ printf("defcpr result rdtsc = %I64x\n\n",dwResRdtsc.QuadPart);
+ }
+
+ CprPtr=(unsigned char*)realloc(CprPtr,lSizeCpr);
+ UncprPtr=(unsigned char*)malloc(lBufferSizeUncpr + BlockSizeUncompress);
+
+ BeginCountPerfCounter(&li_qp,TRUE);
+ dwGetTick=GetTickCount();
+ BeginCountRdtsc(&li_rdtsc);
+ {
+ z_stream zcpr;
+ int ret=Z_OK;
+ long lOrigToDo = lSizeCpr;
+ long lOrigDone = 0;
+ int step=0;
+ memset(&zcpr,0,sizeof(z_stream));
+ inflateInit(&zcpr);
+
+ zcpr.next_in = CprPtr;
+ zcpr.next_out = UncprPtr;
+
+
+ do
+ {
+ long all_read_before = zcpr.total_in;
+ zcpr.avail_in = min(lOrigToDo,BlockSizeUncompress);
+ zcpr.avail_out = BlockSizeUncompress;
+ ret=inflate(&zcpr,Z_SYNC_FLUSH);
+ lOrigDone += (zcpr.total_in-all_read_before);
+ lOrigToDo -= (zcpr.total_in-all_read_before);
+ step++;
+ } while (ret==Z_OK);
+
+ lSizeUncpr=zcpr.total_out;
+ inflateEnd(&zcpr);
+ dwGetTick=GetTickCount()-dwGetTick;
+ dwMsecQP=GetMsecSincePerfCounter(li_qp,TRUE);
+ dwResRdtsc=GetResRdtsc(li_rdtsc,TRUE);
+ printf("total uncompress size = %u, in %u step\n",lSizeUncpr,step);
+ printf("time = %u msec = %f sec\n",dwGetTick,dwGetTick/(double)1000.);
+ printf("uncpr time QP = %u msec = %f sec\n",dwMsecQP,dwMsecQP/(double)1000.);
+ printf("uncpr result rdtsc = %I64x\n\n",dwResRdtsc.QuadPart);
+ }
+
+ if (lSizeUncpr==lFileSize)
+ {
+ if (memcmp(FilePtr,UncprPtr,lFileSize)==0)
+ printf("compare ok\n");
+
+ }
+
+ return 0;
+}
diff --git a/protocols/Telegram/tgl/zlib/contrib/testzlib/testzlib.txt b/protocols/Telegram/tgl/zlib/contrib/testzlib/testzlib.txt
new file mode 100644
index 0000000000..62258f1495
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/testzlib/testzlib.txt
@@ -0,0 +1,10 @@
+To build testzLib with Visual Studio 2005:
+
+copy to a directory file from :
+- root of zLib tree
+- contrib/testzlib
+- contrib/masmx86
+- contrib/masmx64
+- contrib/vstudio/vc7
+
+and open testzlib8.sln \ No newline at end of file
diff --git a/protocols/Telegram/tgl/zlib/contrib/untgz/Makefile b/protocols/Telegram/tgl/zlib/contrib/untgz/Makefile
new file mode 100644
index 0000000000..b54266fba2
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/untgz/Makefile
@@ -0,0 +1,14 @@
+CC=cc
+CFLAGS=-g
+
+untgz: untgz.o ../../libz.a
+ $(CC) $(CFLAGS) -o untgz untgz.o -L../.. -lz
+
+untgz.o: untgz.c ../../zlib.h
+ $(CC) $(CFLAGS) -c -I../.. untgz.c
+
+../../libz.a:
+ cd ../..; ./configure; make
+
+clean:
+ rm -f untgz untgz.o *~
diff --git a/protocols/Telegram/tgl/zlib/contrib/untgz/Makefile.msc b/protocols/Telegram/tgl/zlib/contrib/untgz/Makefile.msc
new file mode 100644
index 0000000000..77b8602213
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/untgz/Makefile.msc
@@ -0,0 +1,17 @@
+CC=cl
+CFLAGS=-MD
+
+untgz.exe: untgz.obj ..\..\zlib.lib
+ $(CC) $(CFLAGS) untgz.obj ..\..\zlib.lib
+
+untgz.obj: untgz.c ..\..\zlib.h
+ $(CC) $(CFLAGS) -c -I..\.. untgz.c
+
+..\..\zlib.lib:
+ cd ..\..
+ $(MAKE) -f win32\makefile.msc
+ cd contrib\untgz
+
+clean:
+ -del untgz.obj
+ -del untgz.exe
diff --git a/protocols/Telegram/tgl/zlib/contrib/untgz/untgz.c b/protocols/Telegram/tgl/zlib/contrib/untgz/untgz.c
new file mode 100644
index 0000000000..2c391e5986
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/untgz/untgz.c
@@ -0,0 +1,674 @@
+/*
+ * untgz.c -- Display contents and extract files from a gzip'd TAR file
+ *
+ * written by Pedro A. Aranda Gutierrez <paag@tid.es>
+ * adaptation to Unix by Jean-loup Gailly <jloup@gzip.org>
+ * various fixes by Cosmin Truta <cosmint@cs.ubbcluj.ro>
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <errno.h>
+
+#include "zlib.h"
+
+#ifdef unix
+# include <unistd.h>
+#else
+# include <direct.h>
+# include <io.h>
+#endif
+
+#ifdef WIN32
+#include <windows.h>
+# ifndef F_OK
+# define F_OK 0
+# endif
+# define mkdir(dirname,mode) _mkdir(dirname)
+# ifdef _MSC_VER
+# define access(path,mode) _access(path,mode)
+# define chmod(path,mode) _chmod(path,mode)
+# define strdup(str) _strdup(str)
+# endif
+#else
+# include <utime.h>
+#endif
+
+
+/* values used in typeflag field */
+
+#define REGTYPE '0' /* regular file */
+#define AREGTYPE '\0' /* regular file */
+#define LNKTYPE '1' /* link */
+#define SYMTYPE '2' /* reserved */
+#define CHRTYPE '3' /* character special */
+#define BLKTYPE '4' /* block special */
+#define DIRTYPE '5' /* directory */
+#define FIFOTYPE '6' /* FIFO special */
+#define CONTTYPE '7' /* reserved */
+
+/* GNU tar extensions */
+
+#define GNUTYPE_DUMPDIR 'D' /* file names from dumped directory */
+#define GNUTYPE_LONGLINK 'K' /* long link name */
+#define GNUTYPE_LONGNAME 'L' /* long file name */
+#define GNUTYPE_MULTIVOL 'M' /* continuation of file from another volume */
+#define GNUTYPE_NAMES 'N' /* file name that does not fit into main hdr */
+#define GNUTYPE_SPARSE 'S' /* sparse file */
+#define GNUTYPE_VOLHDR 'V' /* tape/volume header */
+
+
+/* tar header */
+
+#define BLOCKSIZE 512
+#define SHORTNAMESIZE 100
+
+struct tar_header
+{ /* byte offset */
+ char name[100]; /* 0 */
+ char mode[8]; /* 100 */
+ char uid[8]; /* 108 */
+ char gid[8]; /* 116 */
+ char size[12]; /* 124 */
+ char mtime[12]; /* 136 */
+ char chksum[8]; /* 148 */
+ char typeflag; /* 156 */
+ char linkname[100]; /* 157 */
+ char magic[6]; /* 257 */
+ char version[2]; /* 263 */
+ char uname[32]; /* 265 */
+ char gname[32]; /* 297 */
+ char devmajor[8]; /* 329 */
+ char devminor[8]; /* 337 */
+ char prefix[155]; /* 345 */
+ /* 500 */
+};
+
+union tar_buffer
+{
+ char buffer[BLOCKSIZE];
+ struct tar_header header;
+};
+
+struct attr_item
+{
+ struct attr_item *next;
+ char *fname;
+ int mode;
+ time_t time;
+};
+
+enum { TGZ_EXTRACT, TGZ_LIST, TGZ_INVALID };
+
+char *TGZfname OF((const char *));
+void TGZnotfound OF((const char *));
+
+int getoct OF((char *, int));
+char *strtime OF((time_t *));
+int setfiletime OF((char *, time_t));
+void push_attr OF((struct attr_item **, char *, int, time_t));
+void restore_attr OF((struct attr_item **));
+
+int ExprMatch OF((char *, char *));
+
+int makedir OF((char *));
+int matchname OF((int, int, char **, char *));
+
+void error OF((const char *));
+int tar OF((gzFile, int, int, int, char **));
+
+void help OF((int));
+int main OF((int, char **));
+
+char *prog;
+
+const char *TGZsuffix[] = { "\0", ".tar", ".tar.gz", ".taz", ".tgz", NULL };
+
+/* return the file name of the TGZ archive */
+/* or NULL if it does not exist */
+
+char *TGZfname (const char *arcname)
+{
+ static char buffer[1024];
+ int origlen,i;
+
+ strcpy(buffer,arcname);
+ origlen = strlen(buffer);
+
+ for (i=0; TGZsuffix[i]; i++)
+ {
+ strcpy(buffer+origlen,TGZsuffix[i]);
+ if (access(buffer,F_OK) == 0)
+ return buffer;
+ }
+ return NULL;
+}
+
+
+/* error message for the filename */
+
+void TGZnotfound (const char *arcname)
+{
+ int i;
+
+ fprintf(stderr,"%s: Couldn't find ",prog);
+ for (i=0;TGZsuffix[i];i++)
+ fprintf(stderr,(TGZsuffix[i+1]) ? "%s%s, " : "or %s%s\n",
+ arcname,
+ TGZsuffix[i]);
+ exit(1);
+}
+
+
+/* convert octal digits to int */
+/* on error return -1 */
+
+int getoct (char *p,int width)
+{
+ int result = 0;
+ char c;
+
+ while (width--)
+ {
+ c = *p++;
+ if (c == 0)
+ break;
+ if (c == ' ')
+ continue;
+ if (c < '0' || c > '7')
+ return -1;
+ result = result * 8 + (c - '0');
+ }
+ return result;
+}
+
+
+/* convert time_t to string */
+/* use the "YYYY/MM/DD hh:mm:ss" format */
+
+char *strtime (time_t *t)
+{
+ struct tm *local;
+ static char result[32];
+
+ local = localtime(t);
+ sprintf(result,"%4d/%02d/%02d %02d:%02d:%02d",
+ local->tm_year+1900, local->tm_mon+1, local->tm_mday,
+ local->tm_hour, local->tm_min, local->tm_sec);
+ return result;
+}
+
+
+/* set file time */
+
+int setfiletime (char *fname,time_t ftime)
+{
+#ifdef WIN32
+ static int isWinNT = -1;
+ SYSTEMTIME st;
+ FILETIME locft, modft;
+ struct tm *loctm;
+ HANDLE hFile;
+ int result;
+
+ loctm = localtime(&ftime);
+ if (loctm == NULL)
+ return -1;
+
+ st.wYear = (WORD)loctm->tm_year + 1900;
+ st.wMonth = (WORD)loctm->tm_mon + 1;
+ st.wDayOfWeek = (WORD)loctm->tm_wday;
+ st.wDay = (WORD)loctm->tm_mday;
+ st.wHour = (WORD)loctm->tm_hour;
+ st.wMinute = (WORD)loctm->tm_min;
+ st.wSecond = (WORD)loctm->tm_sec;
+ st.wMilliseconds = 0;
+ if (!SystemTimeToFileTime(&st, &locft) ||
+ !LocalFileTimeToFileTime(&locft, &modft))
+ return -1;
+
+ if (isWinNT < 0)
+ isWinNT = (GetVersion() < 0x80000000) ? 1 : 0;
+ hFile = CreateFile(fname, GENERIC_WRITE, 0, NULL, OPEN_EXISTING,
+ (isWinNT ? FILE_FLAG_BACKUP_SEMANTICS : 0),
+ NULL);
+ if (hFile == INVALID_HANDLE_VALUE)
+ return -1;
+ result = SetFileTime(hFile, NULL, NULL, &modft) ? 0 : -1;
+ CloseHandle(hFile);
+ return result;
+#else
+ struct utimbuf settime;
+
+ settime.actime = settime.modtime = ftime;
+ return utime(fname,&settime);
+#endif
+}
+
+
+/* push file attributes */
+
+void push_attr(struct attr_item **list,char *fname,int mode,time_t time)
+{
+ struct attr_item *item;
+
+ item = (struct attr_item *)malloc(sizeof(struct attr_item));
+ if (item == NULL)
+ error("Out of memory");
+ item->fname = strdup(fname);
+ item->mode = mode;
+ item->time = time;
+ item->next = *list;
+ *list = item;
+}
+
+
+/* restore file attributes */
+
+void restore_attr(struct attr_item **list)
+{
+ struct attr_item *item, *prev;
+
+ for (item = *list; item != NULL; )
+ {
+ setfiletime(item->fname,item->time);
+ chmod(item->fname,item->mode);
+ prev = item;
+ item = item->next;
+ free(prev);
+ }
+ *list = NULL;
+}
+
+
+/* match regular expression */
+
+#define ISSPECIAL(c) (((c) == '*') || ((c) == '/'))
+
+int ExprMatch (char *string,char *expr)
+{
+ while (1)
+ {
+ if (ISSPECIAL(*expr))
+ {
+ if (*expr == '/')
+ {
+ if (*string != '\\' && *string != '/')
+ return 0;
+ string ++; expr++;
+ }
+ else if (*expr == '*')
+ {
+ if (*expr ++ == 0)
+ return 1;
+ while (*++string != *expr)
+ if (*string == 0)
+ return 0;
+ }
+ }
+ else
+ {
+ if (*string != *expr)
+ return 0;
+ if (*expr++ == 0)
+ return 1;
+ string++;
+ }
+ }
+}
+
+
+/* recursive mkdir */
+/* abort on ENOENT; ignore other errors like "directory already exists" */
+/* return 1 if OK */
+/* 0 on error */
+
+int makedir (char *newdir)
+{
+ char *buffer = strdup(newdir);
+ char *p;
+ int len = strlen(buffer);
+
+ if (len <= 0) {
+ free(buffer);
+ return 0;
+ }
+ if (buffer[len-1] == '/') {
+ buffer[len-1] = '\0';
+ }
+ if (mkdir(buffer, 0755) == 0)
+ {
+ free(buffer);
+ return 1;
+ }
+
+ p = buffer+1;
+ while (1)
+ {
+ char hold;
+
+ while(*p && *p != '\\' && *p != '/')
+ p++;
+ hold = *p;
+ *p = 0;
+ if ((mkdir(buffer, 0755) == -1) && (errno == ENOENT))
+ {
+ fprintf(stderr,"%s: Couldn't create directory %s\n",prog,buffer);
+ free(buffer);
+ return 0;
+ }
+ if (hold == 0)
+ break;
+ *p++ = hold;
+ }
+ free(buffer);
+ return 1;
+}
+
+
+int matchname (int arg,int argc,char **argv,char *fname)
+{
+ if (arg == argc) /* no arguments given (untgz tgzarchive) */
+ return 1;
+
+ while (arg < argc)
+ if (ExprMatch(fname,argv[arg++]))
+ return 1;
+
+ return 0; /* ignore this for the moment being */
+}
+
+
+/* tar file list or extract */
+
+int tar (gzFile in,int action,int arg,int argc,char **argv)
+{
+ union tar_buffer buffer;
+ int len;
+ int err;
+ int getheader = 1;
+ int remaining = 0;
+ FILE *outfile = NULL;
+ char fname[BLOCKSIZE];
+ int tarmode;
+ time_t tartime;
+ struct attr_item *attributes = NULL;
+
+ if (action == TGZ_LIST)
+ printf(" date time size file\n"
+ " ---------- -------- --------- -------------------------------------\n");
+ while (1)
+ {
+ len = gzread(in, &buffer, BLOCKSIZE);
+ if (len < 0)
+ error(gzerror(in, &err));
+ /*
+ * Always expect complete blocks to process
+ * the tar information.
+ */
+ if (len != BLOCKSIZE)
+ {
+ action = TGZ_INVALID; /* force error exit */
+ remaining = 0; /* force I/O cleanup */
+ }
+
+ /*
+ * If we have to get a tar header
+ */
+ if (getheader >= 1)
+ {
+ /*
+ * if we met the end of the tar
+ * or the end-of-tar block,
+ * we are done
+ */
+ if (len == 0 || buffer.header.name[0] == 0)
+ break;
+
+ tarmode = getoct(buffer.header.mode,8);
+ tartime = (time_t)getoct(buffer.header.mtime,12);
+ if (tarmode == -1 || tartime == (time_t)-1)
+ {
+ buffer.header.name[0] = 0;
+ action = TGZ_INVALID;
+ }
+
+ if (getheader == 1)
+ {
+ strncpy(fname,buffer.header.name,SHORTNAMESIZE);
+ if (fname[SHORTNAMESIZE-1] != 0)
+ fname[SHORTNAMESIZE] = 0;
+ }
+ else
+ {
+ /*
+ * The file name is longer than SHORTNAMESIZE
+ */
+ if (strncmp(fname,buffer.header.name,SHORTNAMESIZE-1) != 0)
+ error("bad long name");
+ getheader = 1;
+ }
+
+ /*
+ * Act according to the type flag
+ */
+ switch (buffer.header.typeflag)
+ {
+ case DIRTYPE:
+ if (action == TGZ_LIST)
+ printf(" %s <dir> %s\n",strtime(&tartime),fname);
+ if (action == TGZ_EXTRACT)
+ {
+ makedir(fname);
+ push_attr(&attributes,fname,tarmode,tartime);
+ }
+ break;
+ case REGTYPE:
+ case AREGTYPE:
+ remaining = getoct(buffer.header.size,12);
+ if (remaining == -1)
+ {
+ action = TGZ_INVALID;
+ break;
+ }
+ if (action == TGZ_LIST)
+ printf(" %s %9d %s\n",strtime(&tartime),remaining,fname);
+ else if (action == TGZ_EXTRACT)
+ {
+ if (matchname(arg,argc,argv,fname))
+ {
+ outfile = fopen(fname,"wb");
+ if (outfile == NULL) {
+ /* try creating directory */
+ char *p = strrchr(fname, '/');
+ if (p != NULL) {
+ *p = '\0';
+ makedir(fname);
+ *p = '/';
+ outfile = fopen(fname,"wb");
+ }
+ }
+ if (outfile != NULL)
+ printf("Extracting %s\n",fname);
+ else
+ fprintf(stderr, "%s: Couldn't create %s",prog,fname);
+ }
+ else
+ outfile = NULL;
+ }
+ getheader = 0;
+ break;
+ case GNUTYPE_LONGLINK:
+ case GNUTYPE_LONGNAME:
+ remaining = getoct(buffer.header.size,12);
+ if (remaining < 0 || remaining >= BLOCKSIZE)
+ {
+ action = TGZ_INVALID;
+ break;
+ }
+ len = gzread(in, fname, BLOCKSIZE);
+ if (len < 0)
+ error(gzerror(in, &err));
+ if (fname[BLOCKSIZE-1] != 0 || (int)strlen(fname) > remaining)
+ {
+ action = TGZ_INVALID;
+ break;
+ }
+ getheader = 2;
+ break;
+ default:
+ if (action == TGZ_LIST)
+ printf(" %s <---> %s\n",strtime(&tartime),fname);
+ break;
+ }
+ }
+ else
+ {
+ unsigned int bytes = (remaining > BLOCKSIZE) ? BLOCKSIZE : remaining;
+
+ if (outfile != NULL)
+ {
+ if (fwrite(&buffer,sizeof(char),bytes,outfile) != bytes)
+ {
+ fprintf(stderr,
+ "%s: Error writing %s -- skipping\n",prog,fname);
+ fclose(outfile);
+ outfile = NULL;
+ remove(fname);
+ }
+ }
+ remaining -= bytes;
+ }
+
+ if (remaining == 0)
+ {
+ getheader = 1;
+ if (outfile != NULL)
+ {
+ fclose(outfile);
+ outfile = NULL;
+ if (action != TGZ_INVALID)
+ push_attr(&attributes,fname,tarmode,tartime);
+ }
+ }
+
+ /*
+ * Abandon if errors are found
+ */
+ if (action == TGZ_INVALID)
+ {
+ error("broken archive");
+ break;
+ }
+ }
+
+ /*
+ * Restore file modes and time stamps
+ */
+ restore_attr(&attributes);
+
+ if (gzclose(in) != Z_OK)
+ error("failed gzclose");
+
+ return 0;
+}
+
+
+/* ============================================================ */
+
+void help(int exitval)
+{
+ printf("untgz version 0.2.1\n"
+ " using zlib version %s\n\n",
+ zlibVersion());
+ printf("Usage: untgz file.tgz extract all files\n"
+ " untgz file.tgz fname ... extract selected files\n"
+ " untgz -l file.tgz list archive contents\n"
+ " untgz -h display this help\n");
+ exit(exitval);
+}
+
+void error(const char *msg)
+{
+ fprintf(stderr, "%s: %s\n", prog, msg);
+ exit(1);
+}
+
+
+/* ============================================================ */
+
+#if defined(WIN32) && defined(__GNUC__)
+int _CRT_glob = 0; /* disable argument globbing in MinGW */
+#endif
+
+int main(int argc,char **argv)
+{
+ int action = TGZ_EXTRACT;
+ int arg = 1;
+ char *TGZfile;
+ gzFile *f;
+
+ prog = strrchr(argv[0],'\\');
+ if (prog == NULL)
+ {
+ prog = strrchr(argv[0],'/');
+ if (prog == NULL)
+ {
+ prog = strrchr(argv[0],':');
+ if (prog == NULL)
+ prog = argv[0];
+ else
+ prog++;
+ }
+ else
+ prog++;
+ }
+ else
+ prog++;
+
+ if (argc == 1)
+ help(0);
+
+ if (strcmp(argv[arg],"-l") == 0)
+ {
+ action = TGZ_LIST;
+ if (argc == ++arg)
+ help(0);
+ }
+ else if (strcmp(argv[arg],"-h") == 0)
+ {
+ help(0);
+ }
+
+ if ((TGZfile = TGZfname(argv[arg])) == NULL)
+ TGZnotfound(argv[arg]);
+
+ ++arg;
+ if ((action == TGZ_LIST) && (arg != argc))
+ help(1);
+
+/*
+ * Process the TGZ file
+ */
+ switch(action)
+ {
+ case TGZ_LIST:
+ case TGZ_EXTRACT:
+ f = gzopen(TGZfile,"rb");
+ if (f == NULL)
+ {
+ fprintf(stderr,"%s: Couldn't gzopen %s\n",prog,TGZfile);
+ return 1;
+ }
+ exit(tar(f, action, arg, argc, argv));
+ break;
+
+ default:
+ error("Unknown option");
+ exit(1);
+ }
+
+ return 0;
+}
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/readme.txt b/protocols/Telegram/tgl/zlib/contrib/vstudio/readme.txt
new file mode 100644
index 0000000000..bfdcd9dd01
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/readme.txt
@@ -0,0 +1,65 @@
+Building instructions for the DLL versions of Zlib 1.2.8
+========================================================
+
+This directory contains projects that build zlib and minizip using
+Microsoft Visual C++ 9.0/10.0.
+
+You don't need to build these projects yourself. You can download the
+binaries from:
+ http://www.winimage.com/zLibDll
+
+More information can be found at this site.
+
+
+
+
+
+Build instructions for Visual Studio 2008 (32 bits or 64 bits)
+--------------------------------------------------------------
+- Uncompress current zlib, including all contrib/* files
+- Compile assembly code (with Visual Studio Command Prompt) by running:
+ bld_ml64.bat (in contrib\masmx64)
+ bld_ml32.bat (in contrib\masmx86)
+- Open contrib\vstudio\vc9\zlibvc.sln with Microsoft Visual C++ 2008
+- Or run: vcbuild /rebuild contrib\vstudio\vc9\zlibvc.sln "Release|Win32"
+
+Build instructions for Visual Studio 2010 (32 bits or 64 bits)
+--------------------------------------------------------------
+- Uncompress current zlib, including all contrib/* files
+- Open contrib\vstudio\vc10\zlibvc.sln with Microsoft Visual C++ 2010
+
+Build instructions for Visual Studio 2012 (32 bits or 64 bits)
+--------------------------------------------------------------
+- Uncompress current zlib, including all contrib/* files
+- Open contrib\vstudio\vc11\zlibvc.sln with Microsoft Visual C++ 2012
+
+
+Important
+---------
+- To use zlibwapi.dll in your application, you must define the
+ macro ZLIB_WINAPI when compiling your application's source files.
+
+
+Additional notes
+----------------
+- This DLL, named zlibwapi.dll, is compatible to the old zlib.dll built
+ by Gilles Vollant from the zlib 1.1.x sources, and distributed at
+ http://www.winimage.com/zLibDll
+ It uses the WINAPI calling convention for the exported functions, and
+ includes the minizip functionality. If your application needs that
+ particular build of zlib.dll, you can rename zlibwapi.dll to zlib.dll.
+
+- The new DLL was renamed because there exist several incompatible
+ versions of zlib.dll on the Internet.
+
+- There is also an official DLL build of zlib, named zlib1.dll. This one
+ is exporting the functions using the CDECL convention. See the file
+ win32\DLL_FAQ.txt found in this zlib distribution.
+
+- There used to be a ZLIB_DLL macro in zlib 1.1.x, but now this symbol
+ has a slightly different effect. To avoid compatibility problems, do
+ not define it here.
+
+
+Gilles Vollant
+info@winimage.com
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/miniunz.vcxproj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/miniunz.vcxproj
new file mode 100644
index 0000000000..74e15c90d3
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/miniunz.vcxproj
@@ -0,0 +1,310 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Itanium">
+ <Configuration>Debug</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Itanium">
+ <Configuration>Release</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{C52F9E7B-498A-42BE-8DB4-85A15694382A}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30128.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\MiniUnzip$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\MiniUnzip$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\MiniUnzip$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\MiniUnzip$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\MiniUnzip$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\MiniUnzip$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">ia64\MiniUnzip$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">ia64\MiniUnzip$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\MiniUnzip$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\MiniUnzip$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ia64\MiniUnzip$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ia64\MiniUnzip$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">false</GenerateManifest>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x86\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)miniunz.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)miniunz.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x86\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)miniunz.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)miniunz.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)miniunz.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">
+ <Midl>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>ia64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)miniunz.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)miniunz.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineIA64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)miniunz.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">
+ <Midl>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>ia64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)miniunz.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineIA64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\minizip\miniunz.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="zlibvc.vcxproj">
+ <Project>{8fd826f8-3739-44e6-8cc8-997122e53b8d}</Project>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/miniunz.vcxproj.filters b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/miniunz.vcxproj.filters
new file mode 100644
index 0000000000..0b2a3de2df
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/miniunz.vcxproj.filters
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{048af943-022b-4db6-beeb-a54c34774ee2}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{c1d600d2-888f-4aea-b73e-8b0dd9befa0c}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{0844199a-966b-4f19-81db-1e0125e141b9}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\minizip\miniunz.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/minizip.vcxproj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/minizip.vcxproj
new file mode 100644
index 0000000000..917e15652b
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/minizip.vcxproj
@@ -0,0 +1,307 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Itanium">
+ <Configuration>Debug</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Itanium">
+ <Configuration>Release</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30128.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\MiniZip$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\MiniZip$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\MiniZip$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\MiniZip$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">ia64\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">ia64\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ia64\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ia64\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">false</LinkIncremental>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x86\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)minizip.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)minizip.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x86\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)minizip.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)minizip.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)minizip.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">
+ <Midl>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>ia64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)minizip.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)minizip.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineIA64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)minizip.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">
+ <Midl>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>ia64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)minizip.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineIA64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\minizip\minizip.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="zlibvc.vcxproj">
+ <Project>{8fd826f8-3739-44e6-8cc8-997122e53b8d}</Project>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/minizip.vcxproj.filters b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/minizip.vcxproj.filters
new file mode 100644
index 0000000000..dd73cd3132
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/minizip.vcxproj.filters
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{c0419b40-bf50-40da-b153-ff74215b79de}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{bb87b070-735b-478e-92ce-7383abb2f36c}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{f46ab6a6-548f-43cb-ae96-681abb5bd5db}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\minizip\minizip.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/testzlib.vcxproj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/testzlib.vcxproj
new file mode 100644
index 0000000000..9088d176f8
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/testzlib.vcxproj
@@ -0,0 +1,420 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Itanium">
+ <Configuration>Debug</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|Itanium">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|Win32">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|x64">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Itanium">
+ <Configuration>Release</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}</ProjectGuid>
+ <RootNamespace>testzlib</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30128.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\TestZlib$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\TestZlib$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">x86\TestZlib$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">x86\TestZlib$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\TestZlib$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\TestZlib$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\TestZlib$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\TestZlib$(Configuration)\Tmp\</IntDir>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">ia64\TestZlib$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">ia64\TestZlib$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">x64\TestZlib$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">x64\TestZlib$(Configuration)\Tmp\</IntDir>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">ia64\TestZlib$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">ia64\TestZlib$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\TestZlib$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\TestZlib$(Configuration)\Tmp\</IntDir>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ia64\TestZlib$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ia64\TestZlib$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">false</GenerateManifest>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)testzlib.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)testzlib.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <OutputFile>$(OutDir)testzlib.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)testzlib.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">
+ <Midl>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <OutputFile>$(OutDir)testzlib.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)testzlib.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineIA64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">
+ <Midl>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <OutputFile>$(OutDir)testzlib.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineIA64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">
+ <Midl>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <OutputFile>$(OutDir)testzlib.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineIA64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\adler32.c" />
+ <ClCompile Include="..\..\..\compress.c" />
+ <ClCompile Include="..\..\..\crc32.c" />
+ <ClCompile Include="..\..\..\deflate.c" />
+ <ClCompile Include="..\..\..\infback.c" />
+ <ClCompile Include="..\..\masmx64\inffas8664.c">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </ClCompile>
+ <ClCompile Include="..\..\..\inffast.c" />
+ <ClCompile Include="..\..\..\inflate.c" />
+ <ClCompile Include="..\..\..\inftrees.c" />
+ <ClCompile Include="..\..\testzlib\testzlib.c" />
+ <ClCompile Include="..\..\..\trees.c" />
+ <ClCompile Include="..\..\..\uncompr.c" />
+ <ClCompile Include="..\..\..\zutil.c" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/testzlib.vcxproj.filters b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/testzlib.vcxproj.filters
new file mode 100644
index 0000000000..249daa89ca
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/testzlib.vcxproj.filters
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{c1f6a2e3-5da5-4955-8653-310d3efe05a9}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{c2aaffdc-2c95-4d6f-8466-4bec5890af2c}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{c274fe07-05f2-461c-964b-f6341e4e7eb5}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\adler32.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\compress.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\crc32.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\deflate.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\infback.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\masmx64\inffas8664.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\inffast.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\inflate.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\inftrees.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\testzlib\testzlib.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\trees.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\uncompr.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\zutil.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj
new file mode 100644
index 0000000000..bcb08ff95d
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj
@@ -0,0 +1,310 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Itanium">
+ <Configuration>Debug</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Itanium">
+ <Configuration>Release</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{C52F9E7B-498A-42BE-8DB4-85A15694366A}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30128.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\TestZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\TestZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\TestZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\TestZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\TestZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\TestZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">ia64\TestZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">ia64\TestZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\TestZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\TestZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ia64\TestZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ia64\TestZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">false</GenerateManifest>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x86\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)testzlibdll.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)testzlib.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x86\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)testzlibdll.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)testzlibdll.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)testzlib.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">
+ <Midl>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>ia64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)testzlibdll.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)testzlib.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineIA64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)testzlibdll.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">
+ <Midl>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>ia64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)testzlibdll.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineIA64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\testzlib\testzlib.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="zlibvc.vcxproj">
+ <Project>{8fd826f8-3739-44e6-8cc8-997122e53b8d}</Project>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj.filters b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj.filters
new file mode 100644
index 0000000000..53a8693bb0
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj.filters
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{fa61a89f-93fc-4c89-b29e-36224b7592f4}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{d4b85da0-2ba2-4934-b57f-e2584e3848ee}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{e573e075-00bd-4a7d-bd67-a8cc9bfc5aca}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\testzlib\testzlib.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/zlib.rc b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/zlib.rc
new file mode 100644
index 0000000000..73f6476d60
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/zlib.rc
@@ -0,0 +1,32 @@
+#include <windows.h>
+
+#define IDR_VERSION1 1
+IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
+ FILEVERSION 1,2,8,0
+ PRODUCTVERSION 1,2,8,0
+ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+ FILEFLAGS 0
+ FILEOS VOS_DOS_WINDOWS32
+ FILETYPE VFT_DLL
+ FILESUBTYPE 0 // not used
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904E4"
+ //language ID = U.S. English, char set = Windows, Multilingual
+
+ BEGIN
+ VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
+ VALUE "FileVersion", "1.2.8\0"
+ VALUE "InternalName", "zlib\0"
+ VALUE "OriginalFilename", "zlibwapi.dll\0"
+ VALUE "ProductName", "ZLib.DLL\0"
+ VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
+ VALUE "LegalCopyright", "(C) 1995-2013 Jean-loup Gailly & Mark Adler\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x0409, 1252
+ END
+END
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/zlibstat.vcxproj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/zlibstat.vcxproj
new file mode 100644
index 0000000000..b9f2bbe5f0
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/zlibstat.vcxproj
@@ -0,0 +1,473 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Itanium">
+ <Configuration>Debug</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|Itanium">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|Win32">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|x64">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Itanium">
+ <Configuration>Release</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}</ProjectGuid>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30128.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\ZlibStat$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\ZlibStat$(Configuration)\Tmp\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\ZlibStat$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\ZlibStat$(Configuration)\Tmp\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">x86\ZlibStat$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">x86\ZlibStat$(Configuration)\Tmp\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\ZlibStat$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\ZlibStat$(Configuration)\Tmp\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">ia64\ZlibStat$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">ia64\ZlibStat$(Configuration)\Tmp\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\ZlibStat$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\ZlibStat$(Configuration)\Tmp\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ia64\ZlibStat$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ia64\ZlibStat$(Configuration)\Tmp\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">x64\ZlibStat$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">x64\ZlibStat$(Configuration)\Tmp\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">ia64\ZlibStat$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">ia64\ZlibStat$(Configuration)\Tmp\</IntDir>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>OldStyle</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:X86 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ <PreBuildEvent>
+ <Command>cd ..\..\masmx86
+bld_ml32.bat</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:X86 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ <PreBuildEvent>
+ <Command>cd ..\..\masmx86
+bld_ml32.bat</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:X86 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>OldStyle</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:AMD64 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ <PreBuildEvent>
+ <Command>cd ..\..\masmx64
+bld_ml64.bat</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">
+ <Midl>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>OldStyle</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:IA64 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:AMD64 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ <PreBuildEvent>
+ <Command>cd ..\..\masmx64
+bld_ml64.bat</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">
+ <Midl>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:IA64 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:AMD64 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">
+ <Midl>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:IA64 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\adler32.c" />
+ <ClCompile Include="..\..\..\compress.c" />
+ <ClCompile Include="..\..\..\crc32.c" />
+ <ClCompile Include="..\..\..\deflate.c" />
+ <ClCompile Include="..\..\..\gzclose.c" />
+ <ClCompile Include="..\..\..\gzlib.c" />
+ <ClCompile Include="..\..\..\gzread.c" />
+ <ClCompile Include="..\..\..\gzwrite.c" />
+ <ClCompile Include="..\..\..\infback.c" />
+ <ClCompile Include="..\..\masmx64\inffas8664.c">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </ClCompile>
+ <ClCompile Include="..\..\..\inffast.c" />
+ <ClCompile Include="..\..\..\inflate.c" />
+ <ClCompile Include="..\..\..\inftrees.c" />
+ <ClCompile Include="..\..\minizip\ioapi.c" />
+ <ClCompile Include="..\..\..\trees.c" />
+ <ClCompile Include="..\..\..\uncompr.c" />
+ <ClCompile Include="..\..\minizip\unzip.c" />
+ <ClCompile Include="..\..\minizip\zip.c" />
+ <ClCompile Include="..\..\..\zutil.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="zlib.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="zlibvc.def" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/zlibstat.vcxproj.filters b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/zlibstat.vcxproj.filters
new file mode 100644
index 0000000000..c8c7f7ea39
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/zlibstat.vcxproj.filters
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{174213f6-7f66-4ae8-a3a8-a1e0a1e6ffdd}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\adler32.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\compress.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\crc32.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\deflate.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\gzclose.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\gzlib.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\gzread.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\gzwrite.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\infback.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\masmx64\inffas8664.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\inffast.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\inflate.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\inftrees.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\minizip\ioapi.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\trees.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\uncompr.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\minizip\unzip.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\minizip\zip.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\zutil.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="zlib.rc">
+ <Filter>Source Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="zlibvc.def">
+ <Filter>Source Files</Filter>
+ </None>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/zlibvc.def b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/zlibvc.def
new file mode 100644
index 0000000000..6367046722
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/zlibvc.def
@@ -0,0 +1,143 @@
+LIBRARY
+; zlib data compression and ZIP file I/O library
+
+VERSION 1.2.8
+
+EXPORTS
+ adler32 @1
+ compress @2
+ crc32 @3
+ deflate @4
+ deflateCopy @5
+ deflateEnd @6
+ deflateInit2_ @7
+ deflateInit_ @8
+ deflateParams @9
+ deflateReset @10
+ deflateSetDictionary @11
+ gzclose @12
+ gzdopen @13
+ gzerror @14
+ gzflush @15
+ gzopen @16
+ gzread @17
+ gzwrite @18
+ inflate @19
+ inflateEnd @20
+ inflateInit2_ @21
+ inflateInit_ @22
+ inflateReset @23
+ inflateSetDictionary @24
+ inflateSync @25
+ uncompress @26
+ zlibVersion @27
+ gzprintf @28
+ gzputc @29
+ gzgetc @30
+ gzseek @31
+ gzrewind @32
+ gztell @33
+ gzeof @34
+ gzsetparams @35
+ zError @36
+ inflateSyncPoint @37
+ get_crc_table @38
+ compress2 @39
+ gzputs @40
+ gzgets @41
+ inflateCopy @42
+ inflateBackInit_ @43
+ inflateBack @44
+ inflateBackEnd @45
+ compressBound @46
+ deflateBound @47
+ gzclearerr @48
+ gzungetc @49
+ zlibCompileFlags @50
+ deflatePrime @51
+ deflatePending @52
+
+ unzOpen @61
+ unzClose @62
+ unzGetGlobalInfo @63
+ unzGetCurrentFileInfo @64
+ unzGoToFirstFile @65
+ unzGoToNextFile @66
+ unzOpenCurrentFile @67
+ unzReadCurrentFile @68
+ unzOpenCurrentFile3 @69
+ unztell @70
+ unzeof @71
+ unzCloseCurrentFile @72
+ unzGetGlobalComment @73
+ unzStringFileNameCompare @74
+ unzLocateFile @75
+ unzGetLocalExtrafield @76
+ unzOpen2 @77
+ unzOpenCurrentFile2 @78
+ unzOpenCurrentFilePassword @79
+
+ zipOpen @80
+ zipOpenNewFileInZip @81
+ zipWriteInFileInZip @82
+ zipCloseFileInZip @83
+ zipClose @84
+ zipOpenNewFileInZip2 @86
+ zipCloseFileInZipRaw @87
+ zipOpen2 @88
+ zipOpenNewFileInZip3 @89
+
+ unzGetFilePos @100
+ unzGoToFilePos @101
+
+ fill_win32_filefunc @110
+
+; zlibwapi v1.2.4 added:
+ fill_win32_filefunc64 @111
+ fill_win32_filefunc64A @112
+ fill_win32_filefunc64W @113
+
+ unzOpen64 @120
+ unzOpen2_64 @121
+ unzGetGlobalInfo64 @122
+ unzGetCurrentFileInfo64 @124
+ unzGetCurrentFileZStreamPos64 @125
+ unztell64 @126
+ unzGetFilePos64 @127
+ unzGoToFilePos64 @128
+
+ zipOpen64 @130
+ zipOpen2_64 @131
+ zipOpenNewFileInZip64 @132
+ zipOpenNewFileInZip2_64 @133
+ zipOpenNewFileInZip3_64 @134
+ zipOpenNewFileInZip4_64 @135
+ zipCloseFileInZipRaw64 @136
+
+; zlib1 v1.2.4 added:
+ adler32_combine @140
+ crc32_combine @142
+ deflateSetHeader @144
+ deflateTune @145
+ gzbuffer @146
+ gzclose_r @147
+ gzclose_w @148
+ gzdirect @149
+ gzoffset @150
+ inflateGetHeader @156
+ inflateMark @157
+ inflatePrime @158
+ inflateReset2 @159
+ inflateUndermine @160
+
+; zlib1 v1.2.6 added:
+ gzgetc_ @161
+ inflateResetKeep @163
+ deflateResetKeep @164
+
+; zlib1 v1.2.7 added:
+ gzopen_w @165
+
+; zlib1 v1.2.8 added:
+ inflateGetDictionary @166
+ gzvprintf @167
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/zlibvc.sln b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/zlibvc.sln
new file mode 100644
index 0000000000..6f6ffd5eea
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/zlibvc.sln
@@ -0,0 +1,135 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibvc", "zlibvc.vcxproj", "{8FD826F8-3739-44E6-8CC8-997122E53B8D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibstat", "zlibstat.vcxproj", "{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testzlib", "testzlib.vcxproj", "{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testzlibdll", "testzlibdll.vcxproj", "{C52F9E7B-498A-42BE-8DB4-85A15694366A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "minizip", "minizip.vcxproj", "{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "miniunz", "miniunz.vcxproj", "{C52F9E7B-498A-42BE-8DB4-85A15694382A}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Itanium = Debug|Itanium
+ Debug|Win32 = Debug|Win32
+ Debug|x64 = Debug|x64
+ Release|Itanium = Release|Itanium
+ Release|Win32 = Release|Win32
+ Release|x64 = Release|x64
+ ReleaseWithoutAsm|Itanium = ReleaseWithoutAsm|Itanium
+ ReleaseWithoutAsm|Win32 = ReleaseWithoutAsm|Win32
+ ReleaseWithoutAsm|x64 = ReleaseWithoutAsm|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Itanium.ActiveCfg = Debug|Itanium
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Itanium.Build.0 = Debug|Itanium
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Win32.ActiveCfg = Debug|Win32
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Win32.Build.0 = Debug|Win32
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|x64.ActiveCfg = Debug|x64
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|x64.Build.0 = Debug|x64
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Itanium.ActiveCfg = Release|Itanium
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Itanium.Build.0 = Release|Itanium
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.ActiveCfg = Release|Win32
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.Build.0 = Release|Win32
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.ActiveCfg = Release|x64
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.Build.0 = Release|x64
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Itanium
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Itanium.Build.0 = ReleaseWithoutAsm|Itanium
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Itanium.ActiveCfg = Debug|Itanium
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Itanium.Build.0 = Debug|Itanium
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.ActiveCfg = Debug|Win32
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.Build.0 = Debug|Win32
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.ActiveCfg = Debug|x64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.Build.0 = Debug|x64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Itanium.ActiveCfg = Release|Itanium
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Itanium.Build.0 = Release|Itanium
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.ActiveCfg = Release|Win32
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.Build.0 = Release|Win32
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.ActiveCfg = Release|x64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.Build.0 = Release|x64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Itanium
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Itanium.Build.0 = ReleaseWithoutAsm|Itanium
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.ActiveCfg = Debug|Itanium
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.Build.0 = Debug|Itanium
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.Build.0 = Debug|Win32
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.ActiveCfg = Debug|x64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.Build.0 = Debug|x64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.ActiveCfg = Release|Itanium
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.Build.0 = Release|Itanium
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.ActiveCfg = Release|Win32
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.Build.0 = Release|Win32
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.ActiveCfg = Release|x64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.Build.0 = Release|x64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Itanium
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.Build.0 = ReleaseWithoutAsm|Itanium
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Itanium.ActiveCfg = Debug|Itanium
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Itanium.Build.0 = Debug|Itanium
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Win32.ActiveCfg = Debug|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Win32.Build.0 = Debug|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|x64.ActiveCfg = Debug|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|x64.Build.0 = Debug|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Itanium.ActiveCfg = Release|Itanium
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Itanium.Build.0 = Release|Itanium
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Win32.ActiveCfg = Release|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Win32.Build.0 = Release|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|x64.ActiveCfg = Release|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|x64.Build.0 = Release|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Itanium
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Itanium.Build.0 = Release|Itanium
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.ActiveCfg = Debug|Itanium
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.Build.0 = Debug|Itanium
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.Build.0 = Debug|Win32
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.ActiveCfg = Debug|x64
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.Build.0 = Debug|x64
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.ActiveCfg = Release|Itanium
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.Build.0 = Release|Itanium
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.ActiveCfg = Release|Win32
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.Build.0 = Release|Win32
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.ActiveCfg = Release|x64
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.Build.0 = Release|x64
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Itanium
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.Build.0 = Release|Itanium
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Itanium.ActiveCfg = Debug|Itanium
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Itanium.Build.0 = Debug|Itanium
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Win32.ActiveCfg = Debug|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Win32.Build.0 = Debug|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|x64.ActiveCfg = Debug|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|x64.Build.0 = Debug|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Itanium.ActiveCfg = Release|Itanium
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Itanium.Build.0 = Release|Itanium
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Win32.ActiveCfg = Release|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Win32.Build.0 = Release|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|x64.ActiveCfg = Release|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|x64.Build.0 = Release|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Itanium
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Itanium.Build.0 = Release|Itanium
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/zlibvc.vcxproj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/zlibvc.vcxproj
new file mode 100644
index 0000000000..6ff9ddb077
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/zlibvc.vcxproj
@@ -0,0 +1,657 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Itanium">
+ <Configuration>Debug</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|Itanium">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|Win32">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|x64">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Itanium">
+ <Configuration>Release</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{8FD826F8-3739-44E6-8CC8-997122E53B8D}</ProjectGuid>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30128.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\ZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\ZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">x86\ZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">x86\ZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\ZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\ZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\ZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\ZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">ia64\ZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">ia64\ZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">x64\ZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">x64\ZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">ia64\ZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">ia64\ZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\ZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\ZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ia64\ZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ia64\ZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">false</GenerateManifest>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">zlibwapid</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">zlibwapi</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">zlibwapi</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">zlibwapid</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">zlibwapi</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">zlibwapi</TargetName>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <GenerateMapFile>true</GenerateMapFile>
+ <SubSystem>Windows</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ <PreBuildEvent>
+ <Command>cd ..\..\masmx86
+bld_ml32.bat</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <GenerateMapFile>true</GenerateMapFile>
+ <SubSystem>Windows</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <GenerateMapFile>true</GenerateMapFile>
+ <SubSystem>Windows</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ <PreBuildEvent>
+ <Command>cd ..\..\masmx86
+bld_ml32.bat</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>X64</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <GenerateMapFile>true</GenerateMapFile>
+ <SubSystem>Windows</SubSystem>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ <PreBuildEvent>
+ <Command>cd ..\..\masmx64
+bld_ml64.bat</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)zlibwapi.pdb</ProgramDatabaseFile>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapFileName>$(OutDir)zlibwapi.map</MapFileName>
+ <SubSystem>Windows</SubSystem>
+ <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
+ <TargetMachine>MachineIA64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>X64</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <GenerateMapFile>true</GenerateMapFile>
+ <SubSystem>Windows</SubSystem>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <ProgramDatabaseFile>$(OutDir)zlibwapi.pdb</ProgramDatabaseFile>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapFileName>$(OutDir)zlibwapi.map</MapFileName>
+ <SubSystem>Windows</SubSystem>
+ <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
+ <TargetMachine>MachineIA64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>X64</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <GenerateMapFile>true</GenerateMapFile>
+ <SubSystem>Windows</SubSystem>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ <PreBuildEvent>
+ <Command>cd ..\..\masmx64
+bld_ml64.bat</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <ProgramDatabaseFile>$(OutDir)zlibwapi.pdb</ProgramDatabaseFile>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapFileName>$(OutDir)zlibwapi.map</MapFileName>
+ <SubSystem>Windows</SubSystem>
+ <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
+ <TargetMachine>MachineIA64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\adler32.c" />
+ <ClCompile Include="..\..\..\compress.c" />
+ <ClCompile Include="..\..\..\crc32.c" />
+ <ClCompile Include="..\..\..\deflate.c" />
+ <ClCompile Include="..\..\..\gzclose.c" />
+ <ClCompile Include="..\..\..\gzlib.c" />
+ <ClCompile Include="..\..\..\gzread.c" />
+ <ClCompile Include="..\..\..\gzwrite.c" />
+ <ClCompile Include="..\..\..\infback.c" />
+ <ClCompile Include="..\..\masmx64\inffas8664.c">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </ClCompile>
+ <ClCompile Include="..\..\..\inffast.c" />
+ <ClCompile Include="..\..\..\inflate.c" />
+ <ClCompile Include="..\..\..\inftrees.c" />
+ <ClCompile Include="..\..\minizip\ioapi.c" />
+ <ClCompile Include="..\..\minizip\iowin32.c" />
+ <ClCompile Include="..\..\..\trees.c" />
+ <ClCompile Include="..\..\..\uncompr.c" />
+ <ClCompile Include="..\..\minizip\unzip.c">
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ZLIB_INTERNAL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">ZLIB_INTERNAL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">ZLIB_INTERNAL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <ClCompile Include="..\..\minizip\zip.c">
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ZLIB_INTERNAL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">ZLIB_INTERNAL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">ZLIB_INTERNAL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <ClCompile Include="..\..\..\zutil.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="zlib.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="zlibvc.def" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\deflate.h" />
+ <ClInclude Include="..\..\..\infblock.h" />
+ <ClInclude Include="..\..\..\infcodes.h" />
+ <ClInclude Include="..\..\..\inffast.h" />
+ <ClInclude Include="..\..\..\inftrees.h" />
+ <ClInclude Include="..\..\..\infutil.h" />
+ <ClInclude Include="..\..\..\zconf.h" />
+ <ClInclude Include="..\..\..\zlib.h" />
+ <ClInclude Include="..\..\..\zutil.h" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/zlibvc.vcxproj.filters b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/zlibvc.vcxproj.filters
new file mode 100644
index 0000000000..180b71cd61
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc10/zlibvc.vcxproj.filters
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{07934a85-8b61-443d-a0ee-b2eedb74f3cd}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{1d99675b-433d-4a21-9e50-ed4ab8b19762}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;fi;fd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{431c0958-fa71-44d0-9084-2d19d100c0cc}</UniqueIdentifier>
+ <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\adler32.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\compress.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\crc32.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\deflate.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\gzclose.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\gzlib.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\gzread.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\gzwrite.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\infback.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\masmx64\inffas8664.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\inffast.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\inflate.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\inftrees.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\minizip\ioapi.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\minizip\iowin32.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\trees.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\uncompr.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\minizip\unzip.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\minizip\zip.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\zutil.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="zlib.rc">
+ <Filter>Source Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="zlibvc.def">
+ <Filter>Source Files</Filter>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\deflate.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\infblock.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\infcodes.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\inffast.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\inftrees.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\infutil.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\zconf.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\zlib.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\zutil.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/miniunz.vcxproj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/miniunz.vcxproj
new file mode 100644
index 0000000000..8c31d9d61c
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/miniunz.vcxproj
@@ -0,0 +1,314 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Itanium">
+ <Configuration>Debug</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Itanium">
+ <Configuration>Release</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{C52F9E7B-498A-42BE-8DB4-85A15694382A}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v140</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v140</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v140</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v140</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30128.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\MiniUnzip$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\MiniUnzip$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\MiniUnzip$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\MiniUnzip$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\MiniUnzip$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\MiniUnzip$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">ia64\MiniUnzip$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">ia64\MiniUnzip$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\MiniUnzip$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\MiniUnzip$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ia64\MiniUnzip$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ia64\MiniUnzip$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">false</GenerateManifest>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x86\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)miniunz.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)miniunz.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x86\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)miniunz.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)miniunz.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)miniunz.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">
+ <Midl>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>ia64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)miniunz.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)miniunz.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineIA64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)miniunz.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">
+ <Midl>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>ia64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)miniunz.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineIA64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\minizip\miniunz.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="zlibvc.vcxproj">
+ <Project>{8fd826f8-3739-44e6-8cc8-997122e53b8d}</Project>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/minizip.vcxproj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/minizip.vcxproj
new file mode 100644
index 0000000000..143d300f9e
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/minizip.vcxproj
@@ -0,0 +1,311 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Itanium">
+ <Configuration>Debug</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Itanium">
+ <Configuration>Release</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v140</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v140</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v140</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v140</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30128.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\MiniZip$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\MiniZip$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\MiniZip$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\MiniZip$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">ia64\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">ia64\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ia64\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ia64\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">false</LinkIncremental>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x86\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)minizip.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)minizip.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x86\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)minizip.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)minizip.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)minizip.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">
+ <Midl>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>ia64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)minizip.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)minizip.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineIA64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)minizip.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">
+ <Midl>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>ia64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)minizip.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineIA64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\minizip\minizip.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="zlibvc.vcxproj">
+ <Project>{8fd826f8-3739-44e6-8cc8-997122e53b8d}</Project>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/testzlib.vcxproj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/testzlib.vcxproj
new file mode 100644
index 0000000000..874a5f2444
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/testzlib.vcxproj
@@ -0,0 +1,426 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Itanium">
+ <Configuration>Debug</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|Itanium">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|Win32">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|x64">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Itanium">
+ <Configuration>Release</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}</ProjectGuid>
+ <RootNamespace>testzlib</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v140</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v140</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v140</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v140</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v140</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v140</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30128.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\TestZlib$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\TestZlib$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">x86\TestZlib$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">x86\TestZlib$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\TestZlib$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\TestZlib$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\TestZlib$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\TestZlib$(Configuration)\Tmp\</IntDir>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">ia64\TestZlib$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">ia64\TestZlib$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">x64\TestZlib$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">x64\TestZlib$(Configuration)\Tmp\</IntDir>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">ia64\TestZlib$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">ia64\TestZlib$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\TestZlib$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\TestZlib$(Configuration)\Tmp\</IntDir>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ia64\TestZlib$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ia64\TestZlib$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">false</GenerateManifest>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)testzlib.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)testzlib.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <OutputFile>$(OutDir)testzlib.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)testzlib.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">
+ <Midl>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <OutputFile>$(OutDir)testzlib.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)testzlib.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineIA64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">
+ <Midl>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <OutputFile>$(OutDir)testzlib.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineIA64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">
+ <Midl>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <OutputFile>$(OutDir)testzlib.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineIA64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\adler32.c" />
+ <ClCompile Include="..\..\..\compress.c" />
+ <ClCompile Include="..\..\..\crc32.c" />
+ <ClCompile Include="..\..\..\deflate.c" />
+ <ClCompile Include="..\..\..\infback.c" />
+ <ClCompile Include="..\..\masmx64\inffas8664.c">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </ClCompile>
+ <ClCompile Include="..\..\..\inffast.c" />
+ <ClCompile Include="..\..\..\inflate.c" />
+ <ClCompile Include="..\..\..\inftrees.c" />
+ <ClCompile Include="..\..\testzlib\testzlib.c" />
+ <ClCompile Include="..\..\..\trees.c" />
+ <ClCompile Include="..\..\..\uncompr.c" />
+ <ClCompile Include="..\..\..\zutil.c" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/testzlibdll.vcxproj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/testzlibdll.vcxproj
new file mode 100644
index 0000000000..f6866af8f2
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/testzlibdll.vcxproj
@@ -0,0 +1,314 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Itanium">
+ <Configuration>Debug</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Itanium">
+ <Configuration>Release</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{C52F9E7B-498A-42BE-8DB4-85A15694366A}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v140</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v140</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v140</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v140</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30128.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\TestZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\TestZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\TestZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\TestZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\TestZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\TestZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">ia64\TestZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">ia64\TestZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\TestZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\TestZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ia64\TestZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ia64\TestZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">false</GenerateManifest>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x86\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)testzlibdll.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)testzlib.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x86\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)testzlibdll.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)testzlibdll.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)testzlib.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">
+ <Midl>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>ia64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)testzlibdll.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)testzlib.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineIA64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>x64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)testzlibdll.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">
+ <Midl>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\..;..\..\minizip;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>ia64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)testzlibdll.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineIA64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\testzlib\testzlib.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="zlibvc.vcxproj">
+ <Project>{8fd826f8-3739-44e6-8cc8-997122e53b8d}</Project>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/adler32.cod b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/adler32.cod
new file mode 100644
index 0000000000..0433d789dc
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/adler32.cod
@@ -0,0 +1,610 @@
+; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.23506.0
+
+ TITLE d:\downloads\tgl-master\tgl-master\zlib\adler32.c
+ .686P
+ .XMM
+ include listing.inc
+ .model flat
+
+INCLUDELIB OLDNAMES
+
+PUBLIC _adler32_combine@12
+PUBLIC _adler32@12
+EXTRN __alldiv:PROC
+EXTRN __chkstk:PROC
+EXTRN _memcpy:PROC
+EXTRN _memset:PROC
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\adler32.c
+; COMDAT _adler32@12
+_TEXT SEGMENT
+_adler$ = 8 ; size = 4
+tv1591 = 12 ; size = 4
+_buf$ = 12 ; size = 4
+_len$ = 16 ; size = 4
+_adler32@12 PROC ; COMDAT
+
+; 69 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 70 : unsigned long sum2;
+; 71 : unsigned n;
+; 72 :
+; 73 : /* split Adler-32 into component sums */
+; 74 : sum2 = (adler >> 16) & 0xffff;
+
+ 00003 8b 45 08 mov eax, DWORD PTR _adler$[ebp]
+ 00006 53 push ebx
+
+; 75 : adler &= 0xffff;
+; 76 :
+; 77 : /* in case user likes doing a byte at a time, keep it fast */
+; 78 : if (len == 1) {
+
+ 00007 8b 5d 10 mov ebx, DWORD PTR _len$[ebp]
+ 0000a 56 push esi
+ 0000b 8b f0 mov esi, eax
+ 0000d 0f b7 c8 movzx ecx, ax
+ 00010 c1 ee 10 shr esi, 16 ; 00000010H
+ 00013 83 fb 01 cmp ebx, 1
+ 00016 75 33 jne SHORT $LN13@adler32
+
+; 79 : adler += buf[0];
+
+ 00018 8b 45 0c mov eax, DWORD PTR _buf$[ebp]
+ 0001b 0f b6 00 movzx eax, BYTE PTR [eax]
+ 0001e 03 c8 add ecx, eax
+
+; 80 : if (adler >= BASE)
+
+ 00020 81 f9 f1 ff 00
+ 00 cmp ecx, 65521 ; 0000fff1H
+ 00026 72 06 jb SHORT $LN14@adler32
+
+; 81 : adler -= BASE;
+
+ 00028 81 e9 f1 ff 00
+ 00 sub ecx, 65521 ; 0000fff1H
+$LN14@adler32:
+
+; 82 : sum2 += adler;
+
+ 0002e 03 f1 add esi, ecx
+
+; 83 : if (sum2 >= BASE)
+
+ 00030 81 fe f1 ff 00
+ 00 cmp esi, 65521 ; 0000fff1H
+ 00036 72 06 jb SHORT $LN15@adler32
+
+; 84 : sum2 -= BASE;
+
+ 00038 81 ee f1 ff 00
+ 00 sub esi, 65521 ; 0000fff1H
+$LN15@adler32:
+
+; 85 : return adler | (sum2 << 16);
+
+ 0003e c1 e6 10 shl esi, 16 ; 00000010H
+ 00041 0b f1 or esi, ecx
+ 00043 8b c6 mov eax, esi
+ 00045 5e pop esi
+ 00046 5b pop ebx
+
+; 133 : }
+
+ 00047 5d pop ebp
+ 00048 c2 0c 00 ret 12 ; 0000000cH
+$LN13@adler32:
+ 0004b 57 push edi
+
+; 86 : }
+; 87 :
+; 88 : /* initial Adler-32 value (deferred check for len == 1 speed) */
+; 89 : if (buf == Z_NULL)
+
+ 0004c 8b 7d 0c mov edi, DWORD PTR _buf$[ebp]
+ 0004f 85 ff test edi, edi
+ 00051 75 0a jne SHORT $LN16@adler32
+
+; 90 : return 1L;
+
+ 00053 8d 47 01 lea eax, DWORD PTR [edi+1]
+ 00056 5f pop edi
+ 00057 5e pop esi
+ 00058 5b pop ebx
+
+; 133 : }
+
+ 00059 5d pop ebp
+ 0005a c2 0c 00 ret 12 ; 0000000cH
+$LN16@adler32:
+
+; 91 :
+; 92 : /* in case short lengths are provided, keep it somewhat fast */
+; 93 : if (len < 16) {
+
+ 0005d 83 fb 10 cmp ebx, 16 ; 00000010H
+ 00060 73 40 jae SHORT $LN22@adler32
+
+; 94 : while (len--) {
+
+ 00062 85 db test ebx, ebx
+ 00064 74 0f je SHORT $LN26@adler32
+$LL2@adler32:
+
+; 95 : adler += *buf++;
+
+ 00066 0f b6 07 movzx eax, BYTE PTR [edi]
+ 00069 8d 7f 01 lea edi, DWORD PTR [edi+1]
+ 0006c 03 c8 add ecx, eax
+
+; 96 : sum2 += adler;
+
+ 0006e 03 f1 add esi, ecx
+ 00070 83 eb 01 sub ebx, 1
+ 00073 75 f1 jne SHORT $LL2@adler32
+$LN26@adler32:
+
+; 97 : }
+; 98 : if (adler >= BASE)
+
+ 00075 81 f9 f1 ff 00
+ 00 cmp ecx, 65521 ; 0000fff1H
+ 0007b 72 06 jb SHORT $LN18@adler32
+
+; 99 : adler -= BASE;
+
+ 0007d 81 e9 f1 ff 00
+ 00 sub ecx, 65521 ; 0000fff1H
+$LN18@adler32:
+
+; 100 : MOD28(sum2); /* only added so many BASE's */
+
+ 00083 b8 71 80 07 80 mov eax, -2146992015 ; 80078071H
+ 00088 f7 e6 mul esi
+ 0008a 5f pop edi
+ 0008b c1 ea 0f shr edx, 15 ; 0000000fH
+
+; 101 : return adler | (sum2 << 16);
+
+ 0008e 8b c2 mov eax, edx
+ 00090 c1 e0 04 shl eax, 4
+ 00093 2b c2 sub eax, edx
+ 00095 03 c6 add eax, esi
+ 00097 c1 e0 10 shl eax, 16 ; 00000010H
+ 0009a 5e pop esi
+ 0009b 0b c1 or eax, ecx
+ 0009d 5b pop ebx
+
+; 133 : }
+
+ 0009e 5d pop ebp
+ 0009f c2 0c 00 ret 12 ; 0000000cH
+$LN22@adler32:
+
+; 102 : }
+; 103 :
+; 104 : /* do length NMAX blocks -- requires just one modulo operation */
+; 105 : while (len >= NMAX) {
+
+ 000a2 81 fb b0 15 00
+ 00 cmp ebx, 5552 ; 000015b0H
+ 000a8 0f 82 db 00 00
+ 00 jb $LN5@adler32
+ 000ae b8 af a9 6e 5e mov eax, 1584310703 ; 5e6ea9afH
+ 000b3 f7 e3 mul ebx
+ 000b5 c1 ea 0b shr edx, 11 ; 0000000bH
+ 000b8 89 55 0c mov DWORD PTR tv1591[ebp], edx
+ 000bb 0f 1f 44 00 00 npad 5
+$LL4@adler32:
+
+; 106 : len -= NMAX;
+
+ 000c0 81 eb b0 15 00
+ 00 sub ebx, 5552 ; 000015b0H
+
+; 107 : n = NMAX / 16; /* NMAX is divisible by 16 */
+
+ 000c6 ba 5b 01 00 00 mov edx, 347 ; 0000015bH
+ 000cb 0f 1f 44 00 00 npad 5
+$LL8@adler32:
+
+; 108 : do {
+; 109 : DO16(buf); /* 16 sums unrolled */
+
+ 000d0 0f b6 07 movzx eax, BYTE PTR [edi]
+ 000d3 03 c8 add ecx, eax
+ 000d5 0f b6 47 01 movzx eax, BYTE PTR [edi+1]
+ 000d9 03 f1 add esi, ecx
+ 000db 03 c8 add ecx, eax
+ 000dd 0f b6 47 02 movzx eax, BYTE PTR [edi+2]
+ 000e1 03 f1 add esi, ecx
+ 000e3 03 c8 add ecx, eax
+ 000e5 0f b6 47 03 movzx eax, BYTE PTR [edi+3]
+ 000e9 03 f1 add esi, ecx
+ 000eb 03 c8 add ecx, eax
+ 000ed 0f b6 47 04 movzx eax, BYTE PTR [edi+4]
+ 000f1 03 f1 add esi, ecx
+ 000f3 03 c8 add ecx, eax
+ 000f5 0f b6 47 05 movzx eax, BYTE PTR [edi+5]
+ 000f9 03 f1 add esi, ecx
+ 000fb 03 c8 add ecx, eax
+ 000fd 0f b6 47 06 movzx eax, BYTE PTR [edi+6]
+ 00101 03 f1 add esi, ecx
+ 00103 03 c8 add ecx, eax
+ 00105 0f b6 47 07 movzx eax, BYTE PTR [edi+7]
+ 00109 03 f1 add esi, ecx
+ 0010b 03 c8 add ecx, eax
+ 0010d 0f b6 47 08 movzx eax, BYTE PTR [edi+8]
+ 00111 03 f1 add esi, ecx
+ 00113 03 c8 add ecx, eax
+ 00115 0f b6 47 09 movzx eax, BYTE PTR [edi+9]
+ 00119 03 f1 add esi, ecx
+ 0011b 03 c8 add ecx, eax
+ 0011d 0f b6 47 0a movzx eax, BYTE PTR [edi+10]
+ 00121 03 f1 add esi, ecx
+ 00123 03 c8 add ecx, eax
+ 00125 0f b6 47 0b movzx eax, BYTE PTR [edi+11]
+ 00129 03 f1 add esi, ecx
+ 0012b 03 c8 add ecx, eax
+ 0012d 0f b6 47 0c movzx eax, BYTE PTR [edi+12]
+ 00131 03 f1 add esi, ecx
+ 00133 03 c8 add ecx, eax
+ 00135 0f b6 47 0d movzx eax, BYTE PTR [edi+13]
+ 00139 03 f1 add esi, ecx
+ 0013b 03 c8 add ecx, eax
+ 0013d 0f b6 47 0e movzx eax, BYTE PTR [edi+14]
+ 00141 03 f1 add esi, ecx
+ 00143 03 c8 add ecx, eax
+ 00145 0f b6 47 0f movzx eax, BYTE PTR [edi+15]
+ 00149 03 f1 add esi, ecx
+
+; 110 : buf += 16;
+
+ 0014b 83 c7 10 add edi, 16 ; 00000010H
+ 0014e 03 c8 add ecx, eax
+ 00150 03 f1 add esi, ecx
+
+; 111 : } while (--n);
+
+ 00152 83 ea 01 sub edx, 1
+ 00155 0f 85 75 ff ff
+ ff jne $LL8@adler32
+
+; 112 : MOD(adler);
+
+ 0015b b8 71 80 07 80 mov eax, -2146992015 ; 80078071H
+ 00160 f7 e1 mul ecx
+ 00162 c1 ea 0f shr edx, 15 ; 0000000fH
+ 00165 69 c2 0f 00 ff
+ ff imul eax, edx, -65521
+ 0016b 03 c8 add ecx, eax
+
+; 113 : MOD(sum2);
+
+ 0016d b8 71 80 07 80 mov eax, -2146992015 ; 80078071H
+ 00172 f7 e6 mul esi
+ 00174 c1 ea 0f shr edx, 15 ; 0000000fH
+ 00177 69 c2 0f 00 ff
+ ff imul eax, edx, -65521
+ 0017d 03 f0 add esi, eax
+ 0017f 83 6d 0c 01 sub DWORD PTR tv1591[ebp], 1
+ 00183 0f 85 37 ff ff
+ ff jne $LL4@adler32
+$LN5@adler32:
+
+; 114 : }
+; 115 :
+; 116 : /* do remaining bytes (less than NMAX, still just one modulo) */
+; 117 : if (len) { /* avoid modulos if none remaining */
+
+ 00189 85 db test ebx, ebx
+ 0018b 0f 84 d4 00 00
+ 00 je $LN19@adler32
+
+; 118 : while (len >= 16) {
+
+ 00191 83 fb 10 cmp ebx, 16 ; 00000010H
+ 00194 0f 82 94 00 00
+ 00 jb $LN25@adler32
+ 0019a 8b d3 mov edx, ebx
+ 0019c c1 ea 04 shr edx, 4
+ 0019f 90 npad 1
+$LL9@adler32:
+
+; 119 : len -= 16;
+; 120 : DO16(buf);
+
+ 001a0 0f b6 07 movzx eax, BYTE PTR [edi]
+ 001a3 83 eb 10 sub ebx, 16 ; 00000010H
+ 001a6 03 c8 add ecx, eax
+ 001a8 0f b6 47 01 movzx eax, BYTE PTR [edi+1]
+ 001ac 03 f1 add esi, ecx
+ 001ae 03 c8 add ecx, eax
+ 001b0 0f b6 47 02 movzx eax, BYTE PTR [edi+2]
+ 001b4 03 f1 add esi, ecx
+ 001b6 03 c8 add ecx, eax
+ 001b8 0f b6 47 03 movzx eax, BYTE PTR [edi+3]
+ 001bc 03 f1 add esi, ecx
+ 001be 03 c8 add ecx, eax
+ 001c0 0f b6 47 04 movzx eax, BYTE PTR [edi+4]
+ 001c4 03 f1 add esi, ecx
+ 001c6 03 c8 add ecx, eax
+ 001c8 0f b6 47 05 movzx eax, BYTE PTR [edi+5]
+ 001cc 03 f1 add esi, ecx
+ 001ce 03 c8 add ecx, eax
+ 001d0 0f b6 47 06 movzx eax, BYTE PTR [edi+6]
+ 001d4 03 f1 add esi, ecx
+ 001d6 03 c8 add ecx, eax
+ 001d8 0f b6 47 07 movzx eax, BYTE PTR [edi+7]
+ 001dc 03 f1 add esi, ecx
+ 001de 03 c8 add ecx, eax
+ 001e0 0f b6 47 08 movzx eax, BYTE PTR [edi+8]
+ 001e4 03 f1 add esi, ecx
+ 001e6 03 c8 add ecx, eax
+ 001e8 0f b6 47 09 movzx eax, BYTE PTR [edi+9]
+ 001ec 03 f1 add esi, ecx
+ 001ee 03 c8 add ecx, eax
+ 001f0 0f b6 47 0a movzx eax, BYTE PTR [edi+10]
+ 001f4 03 f1 add esi, ecx
+ 001f6 03 c8 add ecx, eax
+ 001f8 0f b6 47 0b movzx eax, BYTE PTR [edi+11]
+ 001fc 03 f1 add esi, ecx
+ 001fe 03 c8 add ecx, eax
+ 00200 0f b6 47 0c movzx eax, BYTE PTR [edi+12]
+ 00204 03 f1 add esi, ecx
+ 00206 03 c8 add ecx, eax
+ 00208 0f b6 47 0d movzx eax, BYTE PTR [edi+13]
+ 0020c 03 f1 add esi, ecx
+ 0020e 03 c8 add ecx, eax
+ 00210 0f b6 47 0e movzx eax, BYTE PTR [edi+14]
+ 00214 03 f1 add esi, ecx
+ 00216 03 c8 add ecx, eax
+ 00218 0f b6 47 0f movzx eax, BYTE PTR [edi+15]
+ 0021c 03 f1 add esi, ecx
+
+; 121 : buf += 16;
+
+ 0021e 83 c7 10 add edi, 16 ; 00000010H
+ 00221 03 c8 add ecx, eax
+ 00223 03 f1 add esi, ecx
+ 00225 83 ea 01 sub edx, 1
+ 00228 0f 85 72 ff ff
+ ff jne $LL9@adler32
+$LN25@adler32:
+
+; 122 : }
+; 123 : while (len--) {
+
+ 0022e 85 db test ebx, ebx
+ 00230 74 0f je SHORT $LN30@adler32
+$LL11@adler32:
+
+; 124 : adler += *buf++;
+
+ 00232 0f b6 07 movzx eax, BYTE PTR [edi]
+ 00235 8d 7f 01 lea edi, DWORD PTR [edi+1]
+ 00238 03 c8 add ecx, eax
+
+; 125 : sum2 += adler;
+
+ 0023a 03 f1 add esi, ecx
+ 0023c 83 eb 01 sub ebx, 1
+ 0023f 75 f1 jne SHORT $LL11@adler32
+$LN30@adler32:
+
+; 126 : }
+; 127 : MOD(adler);
+
+ 00241 b8 71 80 07 80 mov eax, -2146992015 ; 80078071H
+ 00246 f7 e1 mul ecx
+
+; 128 : MOD(sum2);
+
+ 00248 b8 71 80 07 80 mov eax, -2146992015 ; 80078071H
+ 0024d c1 ea 0f shr edx, 15 ; 0000000fH
+ 00250 69 d2 0f 00 ff
+ ff imul edx, edx, -65521
+ 00256 03 ca add ecx, edx
+ 00258 f7 e6 mul esi
+ 0025a c1 ea 0f shr edx, 15 ; 0000000fH
+ 0025d 69 c2 0f 00 ff
+ ff imul eax, edx, -65521
+ 00263 03 f0 add esi, eax
+$LN19@adler32:
+
+; 129 : }
+; 130 :
+; 131 : /* return recombined sums */
+; 132 : return adler | (sum2 << 16);
+
+ 00265 c1 e6 10 shl esi, 16 ; 00000010H
+ 00268 0b f1 or esi, ecx
+ 0026a 5f pop edi
+ 0026b 8b c6 mov eax, esi
+ 0026d 5e pop esi
+ 0026e 5b pop ebx
+
+; 133 : }
+
+ 0026f 5d pop ebp
+ 00270 c2 0c 00 ret 12 ; 0000000cH
+_adler32@12 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\adler32.c
+; COMDAT _adler32_combine_
+_TEXT SEGMENT
+_adler2$1$ = -4 ; size = 4
+_len2$ = 8 ; size = 8
+_adler32_combine_ PROC ; COMDAT
+; _adler1$ = ecx
+; _adler2$ = edx
+
+; 140 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 51 push ecx
+
+; 141 : unsigned long sum1;
+; 142 : unsigned long sum2;
+; 143 : unsigned rem;
+; 144 :
+; 145 : /* for negative len, return invalid adler32 as a clue for debugging */
+; 146 : if (len2 < 0)
+
+ 00004 8b 45 0c mov eax, DWORD PTR _len2$[ebp+4]
+ 00007 89 55 fc mov DWORD PTR _adler2$1$[ebp], edx
+ 0000a 53 push ebx
+ 0000b 8b d9 mov ebx, ecx
+ 0000d 57 push edi
+ 0000e 8b 7d 08 mov edi, DWORD PTR _len2$[ebp]
+ 00011 85 c0 test eax, eax
+ 00013 7f 0f jg SHORT $LN2@adler32_co
+ 00015 7c 04 jl SHORT $LN8@adler32_co
+ 00017 85 ff test edi, edi
+ 00019 73 09 jae SHORT $LN2@adler32_co
+$LN8@adler32_co:
+ 0001b 5f pop edi
+
+; 147 : return 0xffffffffUL;
+
+ 0001c 83 c8 ff or eax, -1
+ 0001f 5b pop ebx
+
+; 162 : }
+
+ 00020 8b e5 mov esp, ebp
+ 00022 5d pop ebp
+ 00023 c3 ret 0
+$LN2@adler32_co:
+ 00024 56 push esi
+
+; 148 :
+; 149 : /* the derivation of this formula is left as an exercise for the reader */
+; 150 : MOD63(len2); /* assumes len2 >= 0 */
+
+ 00025 6a 00 push 0
+ 00027 68 f1 ff 00 00 push 65521 ; 0000fff1H
+ 0002c 50 push eax
+ 0002d 57 push edi
+ 0002e e8 00 00 00 00 call __alldiv
+ 00033 69 c0 f1 ff 00
+ 00 imul eax, eax, 65521
+
+; 151 : rem = (unsigned)len2;
+; 152 : sum1 = adler1 & 0xffff;
+
+ 00039 0f b7 cb movzx ecx, bx
+
+; 153 : sum2 = rem * sum1;
+
+ 0003c 8b f1 mov esi, ecx
+
+; 154 : MOD(sum2);
+; 155 : sum1 += (adler2 & 0xffff) + BASE - 1;
+; 156 : sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;
+
+ 0003e c1 eb 10 shr ebx, 16 ; 00000010H
+ 00041 2b f8 sub edi, eax
+ 00043 8b 45 fc mov eax, DWORD PTR _adler2$1$[ebp]
+ 00046 0f b7 c0 movzx eax, ax
+ 00049 05 f0 ff 00 00 add eax, 65520 ; 0000fff0H
+ 0004e 0f af f7 imul esi, edi
+ 00051 03 c8 add ecx, eax
+ 00053 b8 71 80 07 80 mov eax, -2146992015 ; 80078071H
+ 00058 f7 e6 mul esi
+ 0005a 81 c6 f1 ff 00
+ 00 add esi, 65521 ; 0000fff1H
+ 00060 c1 ea 0f shr edx, 15 ; 0000000fH
+ 00063 69 c2 f1 ff 00
+ 00 imul eax, edx, 65521
+ 00069 2b d8 sub ebx, eax
+ 0006b 8b 45 fc mov eax, DWORD PTR _adler2$1$[ebp]
+ 0006e c1 e8 10 shr eax, 16 ; 00000010H
+ 00071 03 c3 add eax, ebx
+ 00073 2b c7 sub eax, edi
+ 00075 03 c6 add eax, esi
+ 00077 5e pop esi
+
+; 157 : if (sum1 >= BASE) sum1 -= BASE;
+
+ 00078 81 f9 f1 ff 00
+ 00 cmp ecx, 65521 ; 0000fff1H
+ 0007e 72 14 jb SHORT $LN4@adler32_co
+ 00080 81 e9 f1 ff 00
+ 00 sub ecx, 65521 ; 0000fff1H
+
+; 158 : if (sum1 >= BASE) sum1 -= BASE;
+
+ 00086 81 f9 f1 ff 00
+ 00 cmp ecx, 65521 ; 0000fff1H
+ 0008c 72 06 jb SHORT $LN4@adler32_co
+ 0008e 81 e9 f1 ff 00
+ 00 sub ecx, 65521 ; 0000fff1H
+$LN4@adler32_co:
+
+; 159 : if (sum2 >= (BASE << 1)) sum2 -= (BASE << 1);
+
+ 00094 3d e2 ff 01 00 cmp eax, 131042 ; 0001ffe2H
+ 00099 72 05 jb SHORT $LN5@adler32_co
+ 0009b 2d e2 ff 01 00 sub eax, 131042 ; 0001ffe2H
+$LN5@adler32_co:
+
+; 160 : if (sum2 >= BASE) sum2 -= BASE;
+
+ 000a0 3d f1 ff 00 00 cmp eax, 65521 ; 0000fff1H
+ 000a5 72 05 jb SHORT $LN6@adler32_co
+ 000a7 2d f1 ff 00 00 sub eax, 65521 ; 0000fff1H
+$LN6@adler32_co:
+
+; 161 : return sum1 | (sum2 << 16);
+
+ 000ac c1 e0 10 shl eax, 16 ; 00000010H
+ 000af 5f pop edi
+ 000b0 0b c1 or eax, ecx
+ 000b2 5b pop ebx
+
+; 162 : }
+
+ 000b3 8b e5 mov esp, ebp
+ 000b5 5d pop ebp
+ 000b6 c3 ret 0
+_adler32_combine_ ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\adler32.c
+; COMDAT _adler32_combine@12
+_TEXT SEGMENT
+_adler1$ = 8 ; size = 4
+_adler2$ = 12 ; size = 4
+_len2$ = 16 ; size = 4
+_adler32_combine@12 PROC ; COMDAT
+
+; 169 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 170 : return adler32_combine_(adler1, adler2, len2);
+
+ 00003 8b 45 10 mov eax, DWORD PTR _len2$[ebp]
+ 00006 8b 4d 08 mov ecx, DWORD PTR _adler1$[ebp]
+ 00009 99 cdq
+ 0000a 52 push edx
+ 0000b 8b 55 0c mov edx, DWORD PTR _adler2$[ebp]
+ 0000e 50 push eax
+ 0000f e8 00 00 00 00 call _adler32_combine_
+ 00014 83 c4 08 add esp, 8
+
+; 171 : }
+
+ 00017 5d pop ebp
+ 00018 c2 0c 00 ret 12 ; 0000000cH
+_adler32_combine@12 ENDP
+_TEXT ENDS
+END
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/adler32.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/adler32.obj
new file mode 100644
index 0000000000..8b7e7eda4b
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/adler32.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/compress.cod b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/compress.cod
new file mode 100644
index 0000000000..0a573cab58
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/compress.cod
@@ -0,0 +1,214 @@
+; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.23506.0
+
+ TITLE d:\downloads\tgl-master\tgl-master\zlib\compress.c
+ .686P
+ .XMM
+ include listing.inc
+ .model flat
+
+INCLUDELIB OLDNAMES
+
+PUBLIC ??_C@_05IAIEPMAK@1?42?48?$AA@ ; `string'
+CONST ENDS
+; COMDAT ??_C@_05IAIEPMAK@1?42?48?$AA@
+CONST SEGMENT
+??_C@_05IAIEPMAK@1?42?48?$AA@ DB '1.2.8', 00H ; `string'
+CONST ENDS
+PUBLIC _compressBound@4
+PUBLIC _compress@16
+PUBLIC _compress2@20
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\compress.c
+; COMDAT _compress2@20
+_TEXT SEGMENT
+_stream$ = -56 ; size = 56
+_dest$ = 8 ; size = 4
+_destLen$ = 12 ; size = 4
+_source$ = 16 ; size = 4
+_sourceLen$ = 20 ; size = 4
+_level$ = 24 ; size = 4
+_compress2@20 PROC ; COMDAT
+
+; 28 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 e4 f8 and esp, -8 ; fffffff8H
+ 00006 83 ec 38 sub esp, 56 ; 00000038H
+
+; 29 : z_stream stream;
+; 30 : int err;
+; 31 :
+; 32 : stream.next_in = (z_const Bytef *)source;
+
+ 00009 8b 45 10 mov eax, DWORD PTR _source$[ebp]
+ 0000c 56 push esi
+ 0000d 57 push edi
+
+; 33 : stream.avail_in = (uInt)sourceLen;
+; 34 : #ifdef MAXSEG_64K
+; 35 : /* Check for source > 64K on 16-bit machine: */
+; 36 : if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
+; 37 : #endif
+; 38 : stream.next_out = dest;
+; 39 : stream.avail_out = (uInt)*destLen;
+
+ 0000e 8b 7d 0c mov edi, DWORD PTR _destLen$[ebp]
+ 00011 89 44 24 08 mov DWORD PTR _stream$[esp+64], eax
+ 00015 8b 45 14 mov eax, DWORD PTR _sourceLen$[ebp]
+ 00018 89 44 24 0c mov DWORD PTR _stream$[esp+68], eax
+ 0001c 8b 45 08 mov eax, DWORD PTR _dest$[ebp]
+
+; 40 : if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
+; 41 :
+; 42 : stream.zalloc = (alloc_func)0;
+; 43 : stream.zfree = (free_func)0;
+; 44 : stream.opaque = (voidpf)0;
+; 45 :
+; 46 : err = deflateInit(&stream, level);
+
+ 0001f 6a 38 push 56 ; 00000038H
+ 00021 89 44 24 18 mov DWORD PTR _stream$[esp+80], eax
+ 00025 8b 07 mov eax, DWORD PTR [edi]
+ 00027 68 00 00 00 00 push OFFSET ??_C@_05IAIEPMAK@1?42?48?$AA@
+ 0002c ff 75 18 push DWORD PTR _level$[ebp]
+ 0002f 89 44 24 24 mov DWORD PTR _stream$[esp+92], eax
+ 00033 8d 44 24 14 lea eax, DWORD PTR _stream$[esp+76]
+ 00037 50 push eax
+ 00038 c7 44 24 38 00
+ 00 00 00 mov DWORD PTR _stream$[esp+112], 0
+ 00040 c7 44 24 3c 00
+ 00 00 00 mov DWORD PTR _stream$[esp+116], 0
+ 00048 c7 44 24 40 00
+ 00 00 00 mov DWORD PTR _stream$[esp+120], 0
+ 00050 e8 00 00 00 00 call _deflateInit_@16
+
+; 47 : if (err != Z_OK) return err;
+
+ 00055 85 c0 test eax, eax
+ 00057 75 41 jne SHORT $LN1@compress2
+
+; 48 :
+; 49 : err = deflate(&stream, Z_FINISH);
+
+ 00059 6a 04 push 4
+ 0005b 8d 44 24 0c lea eax, DWORD PTR _stream$[esp+68]
+ 0005f 50 push eax
+ 00060 e8 00 00 00 00 call _deflate@8
+ 00065 8b f0 mov esi, eax
+
+; 50 : if (err != Z_STREAM_END) {
+
+ 00067 83 fe 01 cmp esi, 1
+ 0006a 74 1e je SHORT $LN4@compress2
+
+; 51 : deflateEnd(&stream);
+
+ 0006c 8d 44 24 08 lea eax, DWORD PTR _stream$[esp+64]
+ 00070 50 push eax
+ 00071 e8 00 00 00 00 call _deflateEnd@4
+
+; 52 : return err == Z_OK ? Z_BUF_ERROR : err;
+
+ 00076 b8 fb ff ff ff mov eax, -5 ; fffffffbH
+ 0007b 85 f6 test esi, esi
+ 0007d 0f 44 f0 cmove esi, eax
+ 00080 8b c6 mov eax, esi
+
+; 57 : return err;
+; 58 : }
+
+ 00082 5f pop edi
+ 00083 5e pop esi
+ 00084 8b e5 mov esp, ebp
+ 00086 5d pop ebp
+ 00087 c2 14 00 ret 20 ; 00000014H
+$LN4@compress2:
+
+; 53 : }
+; 54 : *destLen = stream.total_out;
+
+ 0008a 8b 44 24 1c mov eax, DWORD PTR _stream$[esp+84]
+ 0008e 89 07 mov DWORD PTR [edi], eax
+
+; 55 :
+; 56 : err = deflateEnd(&stream);
+
+ 00090 8d 44 24 08 lea eax, DWORD PTR _stream$[esp+64]
+ 00094 50 push eax
+ 00095 e8 00 00 00 00 call _deflateEnd@4
+$LN1@compress2:
+
+; 57 : return err;
+; 58 : }
+
+ 0009a 5f pop edi
+ 0009b 5e pop esi
+ 0009c 8b e5 mov esp, ebp
+ 0009e 5d pop ebp
+ 0009f c2 14 00 ret 20 ; 00000014H
+_compress2@20 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\compress.c
+; COMDAT _compress@16
+_TEXT SEGMENT
+_dest$ = 8 ; size = 4
+_destLen$ = 12 ; size = 4
+_source$ = 16 ; size = 4
+_sourceLen$ = 20 ; size = 4
+_compress@16 PROC ; COMDAT
+
+; 67 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 68 : return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
+
+ 00003 6a ff push -1
+ 00005 ff 75 14 push DWORD PTR _sourceLen$[ebp]
+ 00008 ff 75 10 push DWORD PTR _source$[ebp]
+ 0000b ff 75 0c push DWORD PTR _destLen$[ebp]
+ 0000e ff 75 08 push DWORD PTR _dest$[ebp]
+ 00011 e8 00 00 00 00 call _compress2@20
+
+; 69 : }
+
+ 00016 5d pop ebp
+ 00017 c2 10 00 ret 16 ; 00000010H
+_compress@16 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\compress.c
+; COMDAT _compressBound@4
+_TEXT SEGMENT
+_sourceLen$ = 8 ; size = 4
+_compressBound@4 PROC ; COMDAT
+
+; 77 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 78 : return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
+
+ 00003 8b 55 08 mov edx, DWORD PTR _sourceLen$[ebp]
+ 00006 8b c2 mov eax, edx
+ 00008 c1 e8 0e shr eax, 14 ; 0000000eH
+ 0000b 8b ca mov ecx, edx
+ 0000d 03 c2 add eax, edx
+ 0000f c1 e9 19 shr ecx, 25 ; 00000019H
+ 00012 c1 ea 0c shr edx, 12 ; 0000000cH
+ 00015 03 c1 add eax, ecx
+ 00017 83 c2 0d add edx, 13 ; 0000000dH
+ 0001a 03 c2 add eax, edx
+
+; 79 : (sourceLen >> 25) + 13;
+; 80 : }
+
+ 0001c 5d pop ebp
+ 0001d c2 04 00 ret 4
+_compressBound@4 ENDP
+_TEXT ENDS
+END
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/compress.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/compress.obj
new file mode 100644
index 0000000000..3d0a063e87
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/compress.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/crc32.cod b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/crc32.cod
new file mode 100644
index 0000000000..e344758a46
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/crc32.cod
@@ -0,0 +1,3150 @@
+; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.23506.0
+
+ TITLE d:\downloads\tgl-master\tgl-master\zlib\crc32.c
+ .686P
+ .XMM
+ include listing.inc
+ .model flat
+
+INCLUDELIB OLDNAMES
+
+_crc_table DD 00H
+ DD 077073096H
+ DD 0ee0e612cH
+ DD 0990951baH
+ DD 076dc419H
+ DD 0706af48fH
+ DD 0e963a535H
+ DD 09e6495a3H
+ DD 0edb8832H
+ DD 079dcb8a4H
+ DD 0e0d5e91eH
+ DD 097d2d988H
+ DD 09b64c2bH
+ DD 07eb17cbdH
+ DD 0e7b82d07H
+ DD 090bf1d91H
+ DD 01db71064H
+ DD 06ab020f2H
+ DD 0f3b97148H
+ DD 084be41deH
+ DD 01adad47dH
+ DD 06ddde4ebH
+ DD 0f4d4b551H
+ DD 083d385c7H
+ DD 0136c9856H
+ DD 0646ba8c0H
+ DD 0fd62f97aH
+ DD 08a65c9ecH
+ DD 014015c4fH
+ DD 063066cd9H
+ DD 0fa0f3d63H
+ DD 08d080df5H
+ DD 03b6e20c8H
+ DD 04c69105eH
+ DD 0d56041e4H
+ DD 0a2677172H
+ DD 03c03e4d1H
+ DD 04b04d447H
+ DD 0d20d85fdH
+ DD 0a50ab56bH
+ DD 035b5a8faH
+ DD 042b2986cH
+ DD 0dbbbc9d6H
+ DD 0acbcf940H
+ DD 032d86ce3H
+ DD 045df5c75H
+ DD 0dcd60dcfH
+ DD 0abd13d59H
+ DD 026d930acH
+ DD 051de003aH
+ DD 0c8d75180H
+ DD 0bfd06116H
+ DD 021b4f4b5H
+ DD 056b3c423H
+ DD 0cfba9599H
+ DD 0b8bda50fH
+ DD 02802b89eH
+ DD 05f058808H
+ DD 0c60cd9b2H
+ DD 0b10be924H
+ DD 02f6f7c87H
+ DD 058684c11H
+ DD 0c1611dabH
+ DD 0b6662d3dH
+ DD 076dc4190H
+ DD 01db7106H
+ DD 098d220bcH
+ DD 0efd5102aH
+ DD 071b18589H
+ DD 06b6b51fH
+ DD 09fbfe4a5H
+ DD 0e8b8d433H
+ DD 07807c9a2H
+ DD 0f00f934H
+ DD 09609a88eH
+ DD 0e10e9818H
+ DD 07f6a0dbbH
+ DD 086d3d2dH
+ DD 091646c97H
+ DD 0e6635c01H
+ DD 06b6b51f4H
+ DD 01c6c6162H
+ DD 0856530d8H
+ DD 0f262004eH
+ DD 06c0695edH
+ DD 01b01a57bH
+ DD 08208f4c1H
+ DD 0f50fc457H
+ DD 065b0d9c6H
+ DD 012b7e950H
+ DD 08bbeb8eaH
+ DD 0fcb9887cH
+ DD 062dd1ddfH
+ DD 015da2d49H
+ DD 08cd37cf3H
+ DD 0fbd44c65H
+ DD 04db26158H
+ DD 03ab551ceH
+ DD 0a3bc0074H
+ DD 0d4bb30e2H
+ DD 04adfa541H
+ DD 03dd895d7H
+ DD 0a4d1c46dH
+ DD 0d3d6f4fbH
+ DD 04369e96aH
+ DD 0346ed9fcH
+ DD 0ad678846H
+ DD 0da60b8d0H
+ DD 044042d73H
+ DD 033031de5H
+ DD 0aa0a4c5fH
+ DD 0dd0d7cc9H
+ DD 05005713cH
+ DD 0270241aaH
+ DD 0be0b1010H
+ DD 0c90c2086H
+ DD 05768b525H
+ DD 0206f85b3H
+ DD 0b966d409H
+ DD 0ce61e49fH
+ DD 05edef90eH
+ DD 029d9c998H
+ DD 0b0d09822H
+ DD 0c7d7a8b4H
+ DD 059b33d17H
+ DD 02eb40d81H
+ DD 0b7bd5c3bH
+ DD 0c0ba6cadH
+ DD 0edb88320H
+ DD 09abfb3b6H
+ DD 03b6e20cH
+ DD 074b1d29aH
+ DD 0ead54739H
+ DD 09dd277afH
+ DD 04db2615H
+ DD 073dc1683H
+ DD 0e3630b12H
+ DD 094643b84H
+ DD 0d6d6a3eH
+ DD 07a6a5aa8H
+ DD 0e40ecf0bH
+ DD 09309ff9dH
+ DD 0a00ae27H
+ DD 07d079eb1H
+ DD 0f00f9344H
+ DD 08708a3d2H
+ DD 01e01f268H
+ DD 06906c2feH
+ DD 0f762575dH
+ DD 0806567cbH
+ DD 0196c3671H
+ DD 06e6b06e7H
+ DD 0fed41b76H
+ DD 089d32be0H
+ DD 010da7a5aH
+ DD 067dd4accH
+ DD 0f9b9df6fH
+ DD 08ebeeff9H
+ DD 017b7be43H
+ DD 060b08ed5H
+ DD 0d6d6a3e8H
+ DD 0a1d1937eH
+ DD 038d8c2c4H
+ DD 04fdff252H
+ DD 0d1bb67f1H
+ DD 0a6bc5767H
+ DD 03fb506ddH
+ DD 048b2364bH
+ DD 0d80d2bdaH
+ DD 0af0a1b4cH
+ DD 036034af6H
+ DD 041047a60H
+ DD 0df60efc3H
+ DD 0a867df55H
+ DD 0316e8eefH
+ DD 04669be79H
+ DD 0cb61b38cH
+ DD 0bc66831aH
+ DD 0256fd2a0H
+ DD 05268e236H
+ DD 0cc0c7795H
+ DD 0bb0b4703H
+ DD 0220216b9H
+ DD 05505262fH
+ DD 0c5ba3bbeH
+ DD 0b2bd0b28H
+ DD 02bb45a92H
+ DD 05cb36a04H
+ DD 0c2d7ffa7H
+ DD 0b5d0cf31H
+ DD 02cd99e8bH
+ DD 05bdeae1dH
+ DD 09b64c2b0H
+ DD 0ec63f226H
+ DD 0756aa39cH
+ DD 026d930aH
+ DD 09c0906a9H
+ DD 0eb0e363fH
+ DD 072076785H
+ DD 05005713H
+ DD 095bf4a82H
+ DD 0e2b87a14H
+ DD 07bb12baeH
+ DD 0cb61b38H
+ DD 092d28e9bH
+ DD 0e5d5be0dH
+ DD 07cdcefb7H
+ DD 0bdbdf21H
+ DD 086d3d2d4H
+ DD 0f1d4e242H
+ DD 068ddb3f8H
+ DD 01fda836eH
+ DD 081be16cdH
+ DD 0f6b9265bH
+ DD 06fb077e1H
+ DD 018b74777H
+ DD 088085ae6H
+ DD 0ff0f6a70H
+ DD 066063bcaH
+ DD 011010b5cH
+ DD 08f659effH
+ DD 0f862ae69H
+ DD 0616bffd3H
+ DD 0166ccf45H
+ DD 0a00ae278H
+ DD 0d70dd2eeH
+ DD 04e048354H
+ DD 03903b3c2H
+ DD 0a7672661H
+ DD 0d06016f7H
+ DD 04969474dH
+ DD 03e6e77dbH
+ DD 0aed16a4aH
+ DD 0d9d65adcH
+ DD 040df0b66H
+ DD 037d83bf0H
+ DD 0a9bcae53H
+ DD 0debb9ec5H
+ DD 047b2cf7fH
+ DD 030b5ffe9H
+ DD 0bdbdf21cH
+ DD 0cabac28aH
+ DD 053b39330H
+ DD 024b4a3a6H
+ DD 0bad03605H
+ DD 0cdd70693H
+ DD 054de5729H
+ DD 023d967bfH
+ DD 0b3667a2eH
+ DD 0c4614ab8H
+ DD 05d681b02H
+ DD 02a6f2b94H
+ DD 0b40bbe37H
+ DD 0c30c8ea1H
+ DD 05a05df1bH
+ DD 02d02ef8dH
+ DD 00H
+ DD 0191b3141H
+ DD 032366282H
+ DD 02b2d53c3H
+ DD 0646cc504H
+ DD 07d77f445H
+ DD 0565aa786H
+ DD 04f4196c7H
+ DD 0c8d98a08H
+ DD 0d1c2bb49H
+ DD 0faefe88aH
+ DD 0e3f4d9cbH
+ DD 0acb54f0cH
+ DD 0b5ae7e4dH
+ DD 09e832d8eH
+ DD 087981ccfH
+ DD 04ac21251H
+ DD 053d92310H
+ DD 078f470d3H
+ DD 061ef4192H
+ DD 02eaed755H
+ DD 037b5e614H
+ DD 01c98b5d7H
+ DD 05838496H
+ DD 0821b9859H
+ DD 09b00a918H
+ DD 0b02dfadbH
+ DD 0a936cb9aH
+ DD 0e6775d5dH
+ DD 0ff6c6c1cH
+ DD 0d4413fdfH
+ DD 0cd5a0e9eH
+ DD 0958424a2H
+ DD 08c9f15e3H
+ DD 0a7b24620H
+ DD 0bea97761H
+ DD 0f1e8e1a6H
+ DD 0e8f3d0e7H
+ DD 0c3de8324H
+ DD 0dac5b265H
+ DD 05d5daeaaH
+ DD 044469febH
+ DD 06f6bcc28H
+ DD 07670fd69H
+ DD 039316baeH
+ DD 0202a5aefH
+ DD 0b07092cH
+ DD 0121c386dH
+ DD 0df4636f3H
+ DD 0c65d07b2H
+ DD 0ed705471H
+ DD 0f46b6530H
+ DD 0bb2af3f7H
+ DD 0a231c2b6H
+ DD 0891c9175H
+ DD 09007a034H
+ DD 0179fbcfbH
+ DD 0e848dbaH
+ DD 025a9de79H
+ DD 03cb2ef38H
+ DD 073f379ffH
+ DD 06ae848beH
+ DD 041c51b7dH
+ DD 058de2a3cH
+ DD 0f0794f05H
+ DD 0e9627e44H
+ DD 0c24f2d87H
+ DD 0db541cc6H
+ DD 094158a01H
+ DD 08d0ebb40H
+ DD 0a623e883H
+ DD 0bf38d9c2H
+ DD 038a0c50dH
+ DD 021bbf44cH
+ DD 0a96a78fH
+ DD 0138d96ceH
+ DD 05ccc0009H
+ DD 045d73148H
+ DD 06efa628bH
+ DD 077e153caH
+ DD 0babb5d54H
+ DD 0a3a06c15H
+ DD 0888d3fd6H
+ DD 091960e97H
+ DD 0ded79850H
+ DD 0c7cca911H
+ DD 0ece1fad2H
+ DD 0f5facb93H
+ DD 07262d75cH
+ DD 06b79e61dH
+ DD 04054b5deH
+ DD 0594f849fH
+ DD 0160e1258H
+ DD 0f152319H
+ DD 0243870daH
+ DD 03d23419bH
+ DD 065fd6ba7H
+ DD 07ce65ae6H
+ DD 057cb0925H
+ DD 04ed03864H
+ DD 0191aea3H
+ DD 0188a9fe2H
+ DD 033a7cc21H
+ DD 02abcfd60H
+ DD 0ad24e1afH
+ DD 0b43fd0eeH
+ DD 09f12832dH
+ DD 08609b26cH
+ DD 0c94824abH
+ DD 0d05315eaH
+ DD 0fb7e4629H
+ DD 0e2657768H
+ DD 02f3f79f6H
+ DD 0362448b7H
+ DD 01d091b74H
+ DD 04122a35H
+ DD 04b53bcf2H
+ DD 052488db3H
+ DD 07965de70H
+ DD 0607eef31H
+ DD 0e7e6f3feH
+ DD 0fefdc2bfH
+ DD 0d5d0917cH
+ DD 0cccba03dH
+ DD 0838a36faH
+ DD 09a9107bbH
+ DD 0b1bc5478H
+ DD 0a8a76539H
+ DD 03b83984bH
+ DD 02298a90aH
+ DD 09b5fac9H
+ DD 010aecb88H
+ DD 05fef5d4fH
+ DD 046f46c0eH
+ DD 06dd93fcdH
+ DD 074c20e8cH
+ DD 0f35a1243H
+ DD 0ea412302H
+ DD 0c16c70c1H
+ DD 0d8774180H
+ DD 09736d747H
+ DD 08e2de606H
+ DD 0a500b5c5H
+ DD 0bc1b8484H
+ DD 071418a1aH
+ DD 0685abb5bH
+ DD 04377e898H
+ DD 05a6cd9d9H
+ DD 0152d4f1eH
+ DD 0c367e5fH
+ DD 0271b2d9cH
+ DD 03e001cddH
+ DD 0b9980012H
+ DD 0a0833153H
+ DD 08bae6290H
+ DD 092b553d1H
+ DD 0ddf4c516H
+ DD 0c4eff457H
+ DD 0efc2a794H
+ DD 0f6d996d5H
+ DD 0ae07bce9H
+ DD 0b71c8da8H
+ DD 09c31de6bH
+ DD 0852aef2aH
+ DD 0ca6b79edH
+ DD 0d37048acH
+ DD 0f85d1b6fH
+ DD 0e1462a2eH
+ DD 066de36e1H
+ DD 07fc507a0H
+ DD 054e85463H
+ DD 04df36522H
+ DD 02b2f3e5H
+ DD 01ba9c2a4H
+ DD 030849167H
+ DD 0299fa026H
+ DD 0e4c5aeb8H
+ DD 0fdde9ff9H
+ DD 0d6f3cc3aH
+ DD 0cfe8fd7bH
+ DD 080a96bbcH
+ DD 099b25afdH
+ DD 0b29f093eH
+ DD 0ab84387fH
+ DD 02c1c24b0H
+ DD 0350715f1H
+ DD 01e2a4632H
+ DD 07317773H
+ DD 04870e1b4H
+ DD 0516bd0f5H
+ DD 07a468336H
+ DD 0635db277H
+ DD 0cbfad74eH
+ DD 0d2e1e60fH
+ DD 0f9ccb5ccH
+ DD 0e0d7848dH
+ DD 0af96124aH
+ DD 0b68d230bH
+ DD 09da070c8H
+ DD 084bb4189H
+ DD 03235d46H
+ DD 01a386c07H
+ DD 031153fc4H
+ DD 0280e0e85H
+ DD 0674f9842H
+ DD 07e54a903H
+ DD 05579fac0H
+ DD 04c62cb81H
+ DD 08138c51fH
+ DD 09823f45eH
+ DD 0b30ea79dH
+ DD 0aa1596dcH
+ DD 0e554001bH
+ DD 0fc4f315aH
+ DD 0d7626299H
+ DD 0ce7953d8H
+ DD 049e14f17H
+ DD 050fa7e56H
+ DD 07bd72d95H
+ DD 062cc1cd4H
+ DD 02d8d8a13H
+ DD 03496bb52H
+ DD 01fbbe891H
+ DD 06a0d9d0H
+ DD 05e7ef3ecH
+ DD 04765c2adH
+ DD 06c48916eH
+ DD 07553a02fH
+ DD 03a1236e8H
+ DD 0230907a9H
+ DD 0824546aH
+ DD 0113f652bH
+ DD 096a779e4H
+ DD 08fbc48a5H
+ DD 0a4911b66H
+ DD 0bd8a2a27H
+ DD 0f2cbbce0H
+ DD 0ebd08da1H
+ DD 0c0fdde62H
+ DD 0d9e6ef23H
+ DD 014bce1bdH
+ DD 0da7d0fcH
+ DD 0268a833fH
+ DD 03f91b27eH
+ DD 070d024b9H
+ DD 069cb15f8H
+ DD 042e6463bH
+ DD 05bfd777aH
+ DD 0dc656bb5H
+ DD 0c57e5af4H
+ DD 0ee530937H
+ DD 0f7483876H
+ DD 0b809aeb1H
+ DD 0a1129ff0H
+ DD 08a3fcc33H
+ DD 09324fd72H
+ DD 00H
+ DD 01c26a37H
+ DD 0384d46eH
+ DD 0246be59H
+ DD 0709a8dcH
+ DD 06cbc2ebH
+ DD 048d7cb2H
+ DD 054f1685H
+ DD 0e1351b8H
+ DD 0fd13b8fH
+ DD 0d9785d6H
+ DD 0c55efe1H
+ DD 091af964H
+ DD 08d89353H
+ DD 0a9e2d0aH
+ DD 0b5c473dH
+ DD 01c26a370H
+ DD 01de4c947H
+ DD 01fa2771eH
+ DD 01e601d29H
+ DD 01b2f0bacH
+ DD 01aed619bH
+ DD 018abdfc2H
+ DD 01969b5f5H
+ DD 01235f2c8H
+ DD 013f798ffH
+ DD 011b126a6H
+ DD 010734c91H
+ DD 0153c5a14H
+ DD 014fe3023H
+ DD 016b88e7aH
+ DD 0177ae44dH
+ DD 0384d46e0H
+ DD 0398f2cd7H
+ DD 03bc9928eH
+ DD 03a0bf8b9H
+ DD 03f44ee3cH
+ DD 03e86840bH
+ DD 03cc03a52H
+ DD 03d025065H
+ DD 0365e1758H
+ DD 0379c7d6fH
+ DD 035dac336H
+ DD 03418a901H
+ DD 03157bf84H
+ DD 03095d5b3H
+ DD 032d36beaH
+ DD 0331101ddH
+ DD 0246be590H
+ DD 025a98fa7H
+ DD 027ef31feH
+ DD 0262d5bc9H
+ DD 023624d4cH
+ DD 022a0277bH
+ DD 020e69922H
+ DD 02124f315H
+ DD 02a78b428H
+ DD 02bbade1fH
+ DD 029fc6046H
+ DD 0283e0a71H
+ DD 02d711cf4H
+ DD 02cb376c3H
+ DD 02ef5c89aH
+ DD 02f37a2adH
+ DD 0709a8dc0H
+ DD 07158e7f7H
+ DD 0731e59aeH
+ DD 072dc3399H
+ DD 07793251cH
+ DD 076514f2bH
+ DD 07417f172H
+ DD 075d59b45H
+ DD 07e89dc78H
+ DD 07f4bb64fH
+ DD 07d0d0816H
+ DD 07ccf6221H
+ DD 0798074a4H
+ DD 078421e93H
+ DD 07a04a0caH
+ DD 07bc6cafdH
+ DD 06cbc2eb0H
+ DD 06d7e4487H
+ DD 06f38fadeH
+ DD 06efa90e9H
+ DD 06bb5866cH
+ DD 06a77ec5bH
+ DD 068315202H
+ DD 069f33835H
+ DD 062af7f08H
+ DD 0636d153fH
+ DD 0612bab66H
+ DD 060e9c151H
+ DD 065a6d7d4H
+ DD 06464bde3H
+ DD 0662203baH
+ DD 067e0698dH
+ DD 048d7cb20H
+ DD 04915a117H
+ DD 04b531f4eH
+ DD 04a917579H
+ DD 04fde63fcH
+ DD 04e1c09cbH
+ DD 04c5ab792H
+ DD 04d98dda5H
+ DD 046c49a98H
+ DD 04706f0afH
+ DD 045404ef6H
+ DD 0448224c1H
+ DD 041cd3244H
+ DD 0400f5873H
+ DD 04249e62aH
+ DD 0438b8c1dH
+ DD 054f16850H
+ DD 055330267H
+ DD 05775bc3eH
+ DD 056b7d609H
+ DD 053f8c08cH
+ DD 0523aaabbH
+ DD 0507c14e2H
+ DD 051be7ed5H
+ DD 05ae239e8H
+ DD 05b2053dfH
+ DD 05966ed86H
+ DD 058a487b1H
+ DD 05deb9134H
+ DD 05c29fb03H
+ DD 05e6f455aH
+ DD 05fad2f6dH
+ DD 0e1351b80H
+ DD 0e0f771b7H
+ DD 0e2b1cfeeH
+ DD 0e373a5d9H
+ DD 0e63cb35cH
+ DD 0e7fed96bH
+ DD 0e5b86732H
+ DD 0e47a0d05H
+ DD 0ef264a38H
+ DD 0eee4200fH
+ DD 0eca29e56H
+ DD 0ed60f461H
+ DD 0e82fe2e4H
+ DD 0e9ed88d3H
+ DD 0ebab368aH
+ DD 0ea695cbdH
+ DD 0fd13b8f0H
+ DD 0fcd1d2c7H
+ DD 0fe976c9eH
+ DD 0ff5506a9H
+ DD 0fa1a102cH
+ DD 0fbd87a1bH
+ DD 0f99ec442H
+ DD 0f85cae75H
+ DD 0f300e948H
+ DD 0f2c2837fH
+ DD 0f0843d26H
+ DD 0f1465711H
+ DD 0f4094194H
+ DD 0f5cb2ba3H
+ DD 0f78d95faH
+ DD 0f64fffcdH
+ DD 0d9785d60H
+ DD 0d8ba3757H
+ DD 0dafc890eH
+ DD 0db3ee339H
+ DD 0de71f5bcH
+ DD 0dfb39f8bH
+ DD 0ddf521d2H
+ DD 0dc374be5H
+ DD 0d76b0cd8H
+ DD 0d6a966efH
+ DD 0d4efd8b6H
+ DD 0d52db281H
+ DD 0d062a404H
+ DD 0d1a0ce33H
+ DD 0d3e6706aH
+ DD 0d2241a5dH
+ DD 0c55efe10H
+ DD 0c49c9427H
+ DD 0c6da2a7eH
+ DD 0c7184049H
+ DD 0c25756ccH
+ DD 0c3953cfbH
+ DD 0c1d382a2H
+ DD 0c011e895H
+ DD 0cb4dafa8H
+ DD 0ca8fc59fH
+ DD 0c8c97bc6H
+ DD 0c90b11f1H
+ DD 0cc440774H
+ DD 0cd866d43H
+ DD 0cfc0d31aH
+ DD 0ce02b92dH
+ DD 091af9640H
+ DD 0906dfc77H
+ DD 0922b422eH
+ DD 093e92819H
+ DD 096a63e9cH
+ DD 0976454abH
+ DD 09522eaf2H
+ DD 094e080c5H
+ DD 09fbcc7f8H
+ DD 09e7eadcfH
+ DD 09c381396H
+ DD 09dfa79a1H
+ DD 098b56f24H
+ DD 099770513H
+ DD 09b31bb4aH
+ DD 09af3d17dH
+ DD 08d893530H
+ DD 08c4b5f07H
+ DD 08e0de15eH
+ DD 08fcf8b69H
+ DD 08a809decH
+ DD 08b42f7dbH
+ DD 089044982H
+ DD 088c623b5H
+ DD 0839a6488H
+ DD 082580ebfH
+ DD 0801eb0e6H
+ DD 081dcdad1H
+ DD 08493cc54H
+ DD 08551a663H
+ DD 08717183aH
+ DD 086d5720dH
+ DD 0a9e2d0a0H
+ DD 0a820ba97H
+ DD 0aa6604ceH
+ DD 0aba46ef9H
+ DD 0aeeb787cH
+ DD 0af29124bH
+ DD 0ad6fac12H
+ DD 0acadc625H
+ DD 0a7f18118H
+ DD 0a633eb2fH
+ DD 0a4755576H
+ DD 0a5b73f41H
+ DD 0a0f829c4H
+ DD 0a13a43f3H
+ DD 0a37cfdaaH
+ DD 0a2be979dH
+ DD 0b5c473d0H
+ DD 0b40619e7H
+ DD 0b640a7beH
+ DD 0b782cd89H
+ DD 0b2cddb0cH
+ DD 0b30fb13bH
+ DD 0b1490f62H
+ DD 0b08b6555H
+ DD 0bbd72268H
+ DD 0ba15485fH
+ DD 0b853f606H
+ DD 0b9919c31H
+ DD 0bcde8ab4H
+ DD 0bd1ce083H
+ DD 0bf5a5edaH
+ DD 0be9834edH
+ DD 00H
+ DD 0b8bc6765H
+ DD 0aa09c88bH
+ DD 012b5afeeH
+ DD 08f629757H
+ DD 037def032H
+ DD 0256b5fdcH
+ DD 09dd738b9H
+ DD 0c5b428efH
+ DD 07d084f8aH
+ DD 06fbde064H
+ DD 0d7018701H
+ DD 04ad6bfb8H
+ DD 0f26ad8ddH
+ DD 0e0df7733H
+ DD 058631056H
+ DD 05019579fH
+ DD 0e8a530faH
+ DD 0fa109f14H
+ DD 042acf871H
+ DD 0df7bc0c8H
+ DD 067c7a7adH
+ DD 075720843H
+ DD 0cdce6f26H
+ DD 095ad7f70H
+ DD 02d111815H
+ DD 03fa4b7fbH
+ DD 08718d09eH
+ DD 01acfe827H
+ DD 0a2738f42H
+ DD 0b0c620acH
+ DD 087a47c9H
+ DD 0a032af3eH
+ DD 0188ec85bH
+ DD 0a3b67b5H
+ DD 0b28700d0H
+ DD 02f503869H
+ DD 097ec5f0cH
+ DD 08559f0e2H
+ DD 03de59787H
+ DD 0658687d1H
+ DD 0dd3ae0b4H
+ DD 0cf8f4f5aH
+ DD 07733283fH
+ DD 0eae41086H
+ DD 0525877e3H
+ DD 040edd80dH
+ DD 0f851bf68H
+ DD 0f02bf8a1H
+ DD 048979fc4H
+ DD 05a22302aH
+ DD 0e29e574fH
+ DD 07f496ff6H
+ DD 0c7f50893H
+ DD 0d540a77dH
+ DD 06dfcc018H
+ DD 0359fd04eH
+ DD 08d23b72bH
+ DD 09f9618c5H
+ DD 0272a7fa0H
+ DD 0bafd4719H
+ DD 0241207cH
+ DD 010f48f92H
+ DD 0a848e8f7H
+ DD 09b14583dH
+ DD 023a83f58H
+ DD 0311d90b6H
+ DD 089a1f7d3H
+ DD 01476cf6aH
+ DD 0accaa80fH
+ DD 0be7f07e1H
+ DD 06c36084H
+ DD 05ea070d2H
+ DD 0e61c17b7H
+ DD 0f4a9b859H
+ DD 04c15df3cH
+ DD 0d1c2e785H
+ DD 0697e80e0H
+ DD 07bcb2f0eH
+ DD 0c377486bH
+ DD 0cb0d0fa2H
+ DD 073b168c7H
+ DD 06104c729H
+ DD 0d9b8a04cH
+ DD 0446f98f5H
+ DD 0fcd3ff90H
+ DD 0ee66507eH
+ DD 056da371bH
+ DD 0eb9274dH
+ DD 0b6054028H
+ DD 0a4b0efc6H
+ DD 01c0c88a3H
+ DD 081dbb01aH
+ DD 03967d77fH
+ DD 02bd27891H
+ DD 0936e1ff4H
+ DD 03b26f703H
+ DD 0839a9066H
+ DD 0912f3f88H
+ DD 0299358edH
+ DD 0b4446054H
+ DD 0cf80731H
+ DD 01e4da8dfH
+ DD 0a6f1cfbaH
+ DD 0fe92dfecH
+ DD 0462eb889H
+ DD 0549b1767H
+ DD 0ec277002H
+ DD 071f048bbH
+ DD 0c94c2fdeH
+ DD 0dbf98030H
+ DD 06345e755H
+ DD 06b3fa09cH
+ DD 0d383c7f9H
+ DD 0c1366817H
+ DD 0798a0f72H
+ DD 0e45d37cbH
+ DD 05ce150aeH
+ DD 04e54ff40H
+ DD 0f6e89825H
+ DD 0ae8b8873H
+ DD 01637ef16H
+ DD 048240f8H
+ DD 0bc3e279dH
+ DD 021e91f24H
+ DD 099557841H
+ DD 08be0d7afH
+ DD 0335cb0caH
+ DD 0ed59b63bH
+ DD 055e5d15eH
+ DD 047507eb0H
+ DD 0ffec19d5H
+ DD 0623b216cH
+ DD 0da874609H
+ DD 0c832e9e7H
+ DD 0708e8e82H
+ DD 028ed9ed4H
+ DD 09051f9b1H
+ DD 082e4565fH
+ DD 03a58313aH
+ DD 0a78f0983H
+ DD 01f336ee6H
+ DD 0d86c108H
+ DD 0b53aa66dH
+ DD 0bd40e1a4H
+ DD 05fc86c1H
+ DD 01749292fH
+ DD 0aff54e4aH
+ DD 0322276f3H
+ DD 08a9e1196H
+ DD 0982bbe78H
+ DD 02097d91dH
+ DD 078f4c94bH
+ DD 0c048ae2eH
+ DD 0d2fd01c0H
+ DD 06a4166a5H
+ DD 0f7965e1cH
+ DD 04f2a3979H
+ DD 05d9f9697H
+ DD 0e523f1f2H
+ DD 04d6b1905H
+ DD 0f5d77e60H
+ DD 0e762d18eH
+ DD 05fdeb6ebH
+ DD 0c2098e52H
+ DD 07ab5e937H
+ DD 0680046d9H
+ DD 0d0bc21bcH
+ DD 088df31eaH
+ DD 03063568fH
+ DD 022d6f961H
+ DD 09a6a9e04H
+ DD 07bda6bdH
+ DD 0bf01c1d8H
+ DD 0adb46e36H
+ DD 015080953H
+ DD 01d724e9aH
+ DD 0a5ce29ffH
+ DD 0b77b8611H
+ DD 0fc7e174H
+ DD 09210d9cdH
+ DD 02aacbea8H
+ DD 038191146H
+ DD 080a57623H
+ DD 0d8c66675H
+ DD 0607a0110H
+ DD 072cfaefeH
+ DD 0ca73c99bH
+ DD 057a4f122H
+ DD 0ef189647H
+ DD 0fdad39a9H
+ DD 045115eccH
+ DD 0764dee06H
+ DD 0cef18963H
+ DD 0dc44268dH
+ DD 064f841e8H
+ DD 0f92f7951H
+ DD 041931e34H
+ DD 05326b1daH
+ DD 0eb9ad6bfH
+ DD 0b3f9c6e9H
+ DD 0b45a18cH
+ DD 019f00e62H
+ DD 0a14c6907H
+ DD 03c9b51beH
+ DD 0842736dbH
+ DD 096929935H
+ DD 02e2efe50H
+ DD 02654b999H
+ DD 09ee8defcH
+ DD 08c5d7112H
+ DD 034e11677H
+ DD 0a9362eceH
+ DD 0118a49abH
+ DD 033fe645H
+ DD 0bb838120H
+ DD 0e3e09176H
+ DD 05b5cf613H
+ DD 049e959fdH
+ DD 0f1553e98H
+ DD 06c820621H
+ DD 0d43e6144H
+ DD 0c68bceaaH
+ DD 07e37a9cfH
+ DD 0d67f4138H
+ DD 06ec3265dH
+ DD 07c7689b3H
+ DD 0c4caeed6H
+ DD 0591dd66fH
+ DD 0e1a1b10aH
+ DD 0f3141ee4H
+ DD 04ba87981H
+ DD 013cb69d7H
+ DD 0ab770eb2H
+ DD 0b9c2a15cH
+ DD 017ec639H
+ DD 09ca9fe80H
+ DD 0241599e5H
+ DD 036a0360bH
+ DD 08e1c516eH
+ DD 0866616a7H
+ DD 03eda71c2H
+ DD 02c6fde2cH
+ DD 094d3b949H
+ DD 090481f0H
+ DD 0b1b8e695H
+ DD 0a30d497bH
+ DD 01bb12e1eH
+ DD 043d23e48H
+ DD 0fb6e592dH
+ DD 0e9dbf6c3H
+ DD 0516791a6H
+ DD 0ccb0a91fH
+ DD 0740cce7aH
+ DD 066b96194H
+ DD 0de0506f1H
+ DD 00H
+ DD 096300777H
+ DD 02c610eeeH
+ DD 0ba510999H
+ DD 019c46d07H
+ DD 08ff46a70H
+ DD 035a563e9H
+ DD 0a395649eH
+ DD 03288db0eH
+ DD 0a4b8dc79H
+ DD 01ee9d5e0H
+ DD 088d9d297H
+ DD 02b4cb609H
+ DD 0bd7cb17eH
+ DD 072db8e7H
+ DD 0911dbf90H
+ DD 06410b71dH
+ DD 0f220b06aH
+ DD 04871b9f3H
+ DD 0de41be84H
+ DD 07dd4da1aH
+ DD 0ebe4dd6dH
+ DD 051b5d4f4H
+ DD 0c785d383H
+ DD 056986c13H
+ DD 0c0a86b64H
+ DD 07af962fdH
+ DD 0ecc9658aH
+ DD 04f5c0114H
+ DD 0d96c0663H
+ DD 0633d0ffaH
+ DD 0f50d088dH
+ DD 0c8206e3bH
+ DD 05e10694cH
+ DD 0e44160d5H
+ DD 0727167a2H
+ DD 0d1e4033cH
+ DD 047d4044bH
+ DD 0fd850dd2H
+ DD 06bb50aa5H
+ DD 0faa8b535H
+ DD 06c98b242H
+ DD 0d6c9bbdbH
+ DD 040f9bcacH
+ DD 0e36cd832H
+ DD 0755cdf45H
+ DD 0cf0dd6dcH
+ DD 0593dd1abH
+ DD 0ac30d926H
+ DD 03a00de51H
+ DD 08051d7c8H
+ DD 01661d0bfH
+ DD 0b5f4b421H
+ DD 023c4b356H
+ DD 09995bacfH
+ DD 0fa5bdb8H
+ DD 09eb80228H
+ DD 0888055fH
+ DD 0b2d90cc6H
+ DD 024e90bb1H
+ DD 0877c6f2fH
+ DD 0114c6858H
+ DD 0ab1d61c1H
+ DD 03d2d66b6H
+ DD 09041dc76H
+ DD 0671db01H
+ DD 0bc20d298H
+ DD 02a10d5efH
+ DD 08985b171H
+ DD 01fb5b606H
+ DD 0a5e4bf9fH
+ DD 033d4b8e8H
+ DD 0a2c90778H
+ DD 034f9000fH
+ DD 08ea80996H
+ DD 018980ee1H
+ DD 0bb0d6a7fH
+ DD 02d3d6d08H
+ DD 0976c6491H
+ DD 015c63e6H
+ DD 0f4516b6bH
+ DD 062616c1cH
+ DD 0d8306585H
+ DD 04e0062f2H
+ DD 0ed95066cH
+ DD 07ba5011bH
+ DD 0c1f40882H
+ DD 057c40ff5H
+ DD 0c6d9b065H
+ DD 050e9b712H
+ DD 0eab8be8bH
+ DD 07c88b9fcH
+ DD 0df1ddd62H
+ DD 0492dda15H
+ DD 0f37cd38cH
+ DD 0654cd4fbH
+ DD 05861b24dH
+ DD 0ce51b53aH
+ DD 07400bca3H
+ DD 0e230bbd4H
+ DD 041a5df4aH
+ DD 0d795d83dH
+ DD 06dc4d1a4H
+ DD 0fbf4d6d3H
+ DD 06ae96943H
+ DD 0fcd96e34H
+ DD 0468867adH
+ DD 0d0b860daH
+ DD 0732d0444H
+ DD 0e51d0333H
+ DD 05f4c0aaaH
+ DD 0c97c0dddH
+ DD 03c710550H
+ DD 0aa410227H
+ DD 010100bbeH
+ DD 086200cc9H
+ DD 025b56857H
+ DD 0b3856f20H
+ DD 09d466b9H
+ DD 09fe461ceH
+ DD 0ef9de5eH
+ DD 098c9d929H
+ DD 02298d0b0H
+ DD 0b4a8d7c7H
+ DD 0173db359H
+ DD 0810db42eH
+ DD 03b5cbdb7H
+ DD 0ad6cbac0H
+ DD 02083b8edH
+ DD 0b6b3bf9aH
+ DD 0ce2b603H
+ DD 09ad2b174H
+ DD 03947d5eaH
+ DD 0af77d29dH
+ DD 01526db04H
+ DD 08316dc73H
+ DD 0120b63e3H
+ DD 0843b6494H
+ DD 03e6a6d0dH
+ DD 0a85a6a7aH
+ DD 0bcf0ee4H
+ DD 09dff0993H
+ DD 027ae000aH
+ DD 0b19e077dH
+ DD 044930ff0H
+ DD 0d2a30887H
+ DD 068f2011eH
+ DD 0fec20669H
+ DD 05d5762f7H
+ DD 0cb676580H
+ DD 071366c19H
+ DD 0e7066b6eH
+ DD 0761bd4feH
+ DD 0e02bd389H
+ DD 05a7ada10H
+ DD 0cc4add67H
+ DD 06fdfb9f9H
+ DD 0f9efbe8eH
+ DD 043beb717H
+ DD 0d58eb060H
+ DD 0e8a3d6d6H
+ DD 07e93d1a1H
+ DD 0c4c2d838H
+ DD 052f2df4fH
+ DD 0f167bbd1H
+ DD 06757bca6H
+ DD 0dd06b53fH
+ DD 04b36b248H
+ DD 0da2b0dd8H
+ DD 04c1b0aafH
+ DD 0f64a0336H
+ DD 0607a0441H
+ DD 0c3ef60dfH
+ DD 055df67a8H
+ DD 0ef8e6e31H
+ DD 079be6946H
+ DD 08cb361cbH
+ DD 01a8366bcH
+ DD 0a0d26f25H
+ DD 036e26852H
+ DD 095770cccH
+ DD 03470bbbH
+ DD 0b9160222H
+ DD 02f260555H
+ DD 0be3bbac5H
+ DD 0280bbdb2H
+ DD 0925ab42bH
+ DD 046ab35cH
+ DD 0a7ffd7c2H
+ DD 031cfd0b5H
+ DD 08b9ed92cH
+ DD 01daede5bH
+ DD 0b0c2649bH
+ DD 026f263ecH
+ DD 09ca36a75H
+ DD 0a936d02H
+ DD 0a906099cH
+ DD 03f360eebH
+ DD 085670772H
+ DD 013570005H
+ DD 0824abf95H
+ DD 0147ab8e2H
+ DD 0ae2bb17bH
+ DD 0381bb60cH
+ DD 09b8ed292H
+ DD 0dbed5e5H
+ DD 0b7efdc7cH
+ DD 021dfdb0bH
+ DD 0d4d2d386H
+ DD 042e2d4f1H
+ DD 0f8b3dd68H
+ DD 06e83da1fH
+ DD 0cd16be81H
+ DD 05b26b9f6H
+ DD 0e177b06fH
+ DD 07747b718H
+ DD 0e65a0888H
+ DD 0706a0fffH
+ DD 0ca3b0666H
+ DD 05c0b0111H
+ DD 0ff9e658fH
+ DD 069ae62f8H
+ DD 0d3ff6b61H
+ DD 045cf6c16H
+ DD 078e20aa0H
+ DD 0eed20dd7H
+ DD 05483044eH
+ DD 0c2b30339H
+ DD 0612667a7H
+ DD 0f71660d0H
+ DD 04d476949H
+ DD 0db776e3eH
+ DD 04a6ad1aeH
+ DD 0dc5ad6d9H
+ DD 0660bdf40H
+ DD 0f03bd837H
+ DD 053aebca9H
+ DD 0c59ebbdeH
+ DD 07fcfb247H
+ DD 0e9ffb530H
+ DD 01cf2bdbdH
+ DD 08ac2bacaH
+ DD 03093b353H
+ DD 0a6a3b424H
+ DD 0536d0baH
+ DD 09306d7cdH
+ DD 02957de54H
+ DD 0bf67d923H
+ DD 02e7a66b3H
+ DD 0b84a61c4H
+ DD 021b685dH
+ DD 0942b6f2aH
+ DD 037be0bb4H
+ DD 0a18e0cc3H
+ DD 01bdf055aH
+ DD 08def022dH
+ DD 00H
+ DD 041311b19H
+ DD 082623632H
+ DD 0c3532d2bH
+ DD 04c56c64H
+ DD 045f4777dH
+ DD 086a75a56H
+ DD 0c796414fH
+ DD 088ad9c8H
+ DD 049bbc2d1H
+ DD 08ae8effaH
+ DD 0cbd9f4e3H
+ DD 0c4fb5acH
+ DD 04d7eaeb5H
+ DD 08e2d839eH
+ DD 0cf1c9887H
+ DD 05112c24aH
+ DD 01023d953H
+ DD 0d370f478H
+ DD 09241ef61H
+ DD 055d7ae2eH
+ DD 014e6b537H
+ DD 0d7b5981cH
+ DD 096848305H
+ DD 059981b82H
+ DD 018a9009bH
+ DD 0dbfa2db0H
+ DD 09acb36a9H
+ DD 05d5d77e6H
+ DD 01c6c6cffH
+ DD 0df3f41d4H
+ DD 09e0e5acdH
+ DD 0a2248495H
+ DD 0e3159f8cH
+ DD 02046b2a7H
+ DD 06177a9beH
+ DD 0a6e1e8f1H
+ DD 0e7d0f3e8H
+ DD 02483dec3H
+ DD 065b2c5daH
+ DD 0aaae5d5dH
+ DD 0eb9f4644H
+ DD 028cc6b6fH
+ DD 069fd7076H
+ DD 0ae6b3139H
+ DD 0ef5a2a20H
+ DD 02c09070bH
+ DD 06d381c12H
+ DD 0f33646dfH
+ DD 0b2075dc6H
+ DD 0715470edH
+ DD 030656bf4H
+ DD 0f7f32abbH
+ DD 0b6c231a2H
+ DD 075911c89H
+ DD 034a00790H
+ DD 0fbbc9f17H
+ DD 0ba8d840eH
+ DD 079dea925H
+ DD 038efb23cH
+ DD 0ff79f373H
+ DD 0be48e86aH
+ DD 07d1bc541H
+ DD 03c2ade58H
+ DD 054f79f0H
+ DD 0447e62e9H
+ DD 0872d4fc2H
+ DD 0c61c54dbH
+ DD 018a1594H
+ DD 040bb0e8dH
+ DD 083e823a6H
+ DD 0c2d938bfH
+ DD 0dc5a038H
+ DD 04cf4bb21H
+ DD 08fa7960aH
+ DD 0ce968d13H
+ DD 0900cc5cH
+ DD 04831d745H
+ DD 08b62fa6eH
+ DD 0ca53e177H
+ DD 0545dbbbaH
+ DD 0156ca0a3H
+ DD 0d63f8d88H
+ DD 0970e9691H
+ DD 05098d7deH
+ DD 011a9ccc7H
+ DD 0d2fae1ecH
+ DD 093cbfaf5H
+ DD 05cd76272H
+ DD 01de6796bH
+ DD 0deb55440H
+ DD 09f844f59H
+ DD 058120e16H
+ DD 01923150fH
+ DD 0da703824H
+ DD 09b41233dH
+ DD 0a76bfd65H
+ DD 0e65ae67cH
+ DD 02509cb57H
+ DD 06438d04eH
+ DD 0a3ae9101H
+ DD 0e29f8a18H
+ DD 021cca733H
+ DD 060fdbc2aH
+ DD 0afe124adH
+ DD 0eed03fb4H
+ DD 02d83129fH
+ DD 06cb20986H
+ DD 0ab2448c9H
+ DD 0ea1553d0H
+ DD 029467efbH
+ DD 0687765e2H
+ DD 0f6793f2fH
+ DD 0b7482436H
+ DD 0741b091dH
+ DD 0352a1204H
+ DD 0f2bc534bH
+ DD 0b38d4852H
+ DD 070de6579H
+ DD 031ef7e60H
+ DD 0fef3e6e7H
+ DD 0bfc2fdfeH
+ DD 07c91d0d5H
+ DD 03da0cbccH
+ DD 0fa368a83H
+ DD 0bb07919aH
+ DD 07854bcb1H
+ DD 03965a7a8H
+ DD 04b98833bH
+ DD 0aa99822H
+ DD 0c9fab509H
+ DD 088cbae10H
+ DD 04f5def5fH
+ DD 0e6cf446H
+ DD 0cd3fd96dH
+ DD 08c0ec274H
+ DD 043125af3H
+ DD 022341eaH
+ DD 0c1706cc1H
+ DD 0804177d8H
+ DD 047d73697H
+ DD 06e62d8eH
+ DD 0c5b500a5H
+ DD 084841bbcH
+ DD 01a8a4171H
+ DD 05bbb5a68H
+ DD 098e87743H
+ DD 0d9d96c5aH
+ DD 01e4f2d15H
+ DD 05f7e360cH
+ DD 09c2d1b27H
+ DD 0dd1c003eH
+ DD 0120098b9H
+ DD 0533183a0H
+ DD 09062ae8bH
+ DD 0d153b592H
+ DD 016c5f4ddH
+ DD 057f4efc4H
+ DD 094a7c2efH
+ DD 0d596d9f6H
+ DD 0e9bc07aeH
+ DD 0a88d1cb7H
+ DD 06bde319cH
+ DD 02aef2a85H
+ DD 0ed796bcaH
+ DD 0ac4870d3H
+ DD 06f1b5df8H
+ DD 02e2a46e1H
+ DD 0e136de66H
+ DD 0a007c57fH
+ DD 06354e854H
+ DD 02265f34dH
+ DD 0e5f3b202H
+ DD 0a4c2a91bH
+ DD 067918430H
+ DD 026a09f29H
+ DD 0b8aec5e4H
+ DD 0f99fdefdH
+ DD 03accf3d6H
+ DD 07bfde8cfH
+ DD 0bc6ba980H
+ DD 0fd5ab299H
+ DD 03e099fb2H
+ DD 07f3884abH
+ DD 0b0241c2cH
+ DD 0f1150735H
+ DD 032462a1eH
+ DD 073773107H
+ DD 0b4e17048H
+ DD 0f5d06b51H
+ DD 03683467aH
+ DD 077b25d63H
+ DD 04ed7facbH
+ DD 0fe6e1d2H
+ DD 0ccb5ccf9H
+ DD 08d84d7e0H
+ DD 04a1296afH
+ DD 0b238db6H
+ DD 0c870a09dH
+ DD 08941bb84H
+ DD 0465d2303H
+ DD 076c381aH
+ DD 0c43f1531H
+ DD 0850e0e28H
+ DD 042984f67H
+ DD 03a9547eH
+ DD 0c0fa7955H
+ DD 081cb624cH
+ DD 01fc53881H
+ DD 05ef42398H
+ DD 09da70eb3H
+ DD 0dc9615aaH
+ DD 01b0054e5H
+ DD 05a314ffcH
+ DD 0996262d7H
+ DD 0d85379ceH
+ DD 0174fe149H
+ DD 0567efa50H
+ DD 0952dd77bH
+ DD 0d41ccc62H
+ DD 0138a8d2dH
+ DD 052bb9634H
+ DD 091e8bb1fH
+ DD 0d0d9a006H
+ DD 0ecf37e5eH
+ DD 0adc26547H
+ DD 06e91486cH
+ DD 02fa05375H
+ DD 0e836123aH
+ DD 0a9070923H
+ DD 06a542408H
+ DD 02b653f11H
+ DD 0e479a796H
+ DD 0a548bc8fH
+ DD 0661b91a4H
+ DD 0272a8abdH
+ DD 0e0bccbf2H
+ DD 0a18dd0ebH
+ DD 062defdc0H
+ DD 023efe6d9H
+ DD 0bde1bc14H
+ DD 0fcd0a70dH
+ DD 03f838a26H
+ DD 07eb2913fH
+ DD 0b924d070H
+ DD 0f815cb69H
+ DD 03b46e642H
+ DD 07a77fd5bH
+ DD 0b56b65dcH
+ DD 0f45a7ec5H
+ DD 0370953eeH
+ DD 0763848f7H
+ DD 0b1ae09b8H
+ DD 0f09f12a1H
+ DD 033cc3f8aH
+ DD 072fd2493H
+ DD 00H
+ DD 0376ac201H
+ DD 06ed48403H
+ DD 059be4602H
+ DD 0dca80907H
+ DD 0ebc2cb06H
+ DD 0b27c8d04H
+ DD 085164f05H
+ DD 0b851130eH
+ DD 08f3bd10fH
+ DD 0d685970dH
+ DD 0e1ef550cH
+ DD 064f91a09H
+ DD 05393d808H
+ DD 0a2d9e0aH
+ DD 03d475c0bH
+ DD 070a3261cH
+ DD 047c9e41dH
+ DD 01e77a21fH
+ DD 0291d601eH
+ DD 0ac0b2f1bH
+ DD 09b61ed1aH
+ DD 0c2dfab18H
+ DD 0f5b56919H
+ DD 0c8f23512H
+ DD 0ff98f713H
+ DD 0a626b111H
+ DD 0914c7310H
+ DD 0145a3c15H
+ DD 02330fe14H
+ DD 07a8eb816H
+ DD 04de47a17H
+ DD 0e0464d38H
+ DD 0d72c8f39H
+ DD 08e92c93bH
+ DD 0b9f80b3aH
+ DD 03cee443fH
+ DD 0b84863eH
+ DD 0523ac03cH
+ DD 06550023dH
+ DD 058175e36H
+ DD 06f7d9c37H
+ DD 036c3da35H
+ DD 01a91834H
+ DD 084bf5731H
+ DD 0b3d59530H
+ DD 0ea6bd332H
+ DD 0dd011133H
+ DD 090e56b24H
+ DD 0a78fa925H
+ DD 0fe31ef27H
+ DD 0c95b2d26H
+ DD 04c4d6223H
+ DD 07b27a022H
+ DD 02299e620H
+ DD 015f32421H
+ DD 028b4782aH
+ DD 01fdeba2bH
+ DD 04660fc29H
+ DD 0710a3e28H
+ DD 0f41c712dH
+ DD 0c376b32cH
+ DD 09ac8f52eH
+ DD 0ada2372fH
+ DD 0c08d9a70H
+ DD 0f7e75871H
+ DD 0ae591e73H
+ DD 09933dc72H
+ DD 01c259377H
+ DD 02b4f5176H
+ DD 072f11774H
+ DD 0459bd575H
+ DD 078dc897eH
+ DD 04fb64b7fH
+ DD 016080d7dH
+ DD 02162cf7cH
+ DD 0a4748079H
+ DD 0931e4278H
+ DD 0caa0047aH
+ DD 0fdcac67bH
+ DD 0b02ebc6cH
+ DD 087447e6dH
+ DD 0defa386fH
+ DD 0e990fa6eH
+ DD 06c86b56bH
+ DD 05bec776aH
+ DD 02523168H
+ DD 03538f369H
+ DD 087faf62H
+ DD 03f156d63H
+ DD 066ab2b61H
+ DD 051c1e960H
+ DD 0d4d7a665H
+ DD 0e3bd6464H
+ DD 0ba032266H
+ DD 08d69e067H
+ DD 020cbd748H
+ DD 017a11549H
+ DD 04e1f534bH
+ DD 07975914aH
+ DD 0fc63de4fH
+ DD 0cb091c4eH
+ DD 092b75a4cH
+ DD 0a5dd984dH
+ DD 0989ac446H
+ DD 0aff00647H
+ DD 0f64e4045H
+ DD 0c1248244H
+ DD 04432cd41H
+ DD 073580f40H
+ DD 02ae64942H
+ DD 01d8c8b43H
+ DD 05068f154H
+ DD 067023355H
+ DD 03ebc7557H
+ DD 09d6b756H
+ DD 08cc0f853H
+ DD 0bbaa3a52H
+ DD 0e2147c50H
+ DD 0d57ebe51H
+ DD 0e839e25aH
+ DD 0df53205bH
+ DD 086ed6659H
+ DD 0b187a458H
+ DD 03491eb5dH
+ DD 03fb295cH
+ DD 05a456f5eH
+ DD 06d2fad5fH
+ DD 0801b35e1H
+ DD 0b771f7e0H
+ DD 0eecfb1e2H
+ DD 0d9a573e3H
+ DD 05cb33ce6H
+ DD 06bd9fee7H
+ DD 03267b8e5H
+ DD 050d7ae4H
+ DD 0384a26efH
+ DD 0f20e4eeH
+ DD 0569ea2ecH
+ DD 061f460edH
+ DD 0e4e22fe8H
+ DD 0d388ede9H
+ DD 08a36abebH
+ DD 0bd5c69eaH
+ DD 0f0b813fdH
+ DD 0c7d2d1fcH
+ DD 09e6c97feH
+ DD 0a90655ffH
+ DD 02c101afaH
+ DD 01b7ad8fbH
+ DD 042c49ef9H
+ DD 075ae5cf8H
+ DD 048e900f3H
+ DD 07f83c2f2H
+ DD 0263d84f0H
+ DD 0115746f1H
+ DD 0944109f4H
+ DD 0a32bcbf5H
+ DD 0fa958df7H
+ DD 0cdff4ff6H
+ DD 0605d78d9H
+ DD 05737bad8H
+ DD 0e89fcdaH
+ DD 039e33edbH
+ DD 0bcf571deH
+ DD 08b9fb3dfH
+ DD 0d221f5ddH
+ DD 0e54b37dcH
+ DD 0d80c6bd7H
+ DD 0ef66a9d6H
+ DD 0b6d8efd4H
+ DD 081b22dd5H
+ DD 04a462d0H
+ DD 033cea0d1H
+ DD 06a70e6d3H
+ DD 05d1a24d2H
+ DD 010fe5ec5H
+ DD 027949cc4H
+ DD 07e2adac6H
+ DD 0494018c7H
+ DD 0cc5657c2H
+ DD 0fb3c95c3H
+ DD 0a282d3c1H
+ DD 095e811c0H
+ DD 0a8af4dcbH
+ DD 09fc58fcaH
+ DD 0c67bc9c8H
+ DD 0f1110bc9H
+ DD 0740744ccH
+ DD 0436d86cdH
+ DD 01ad3c0cfH
+ DD 02db902ceH
+ DD 04096af91H
+ DD 077fc6d90H
+ DD 02e422b92H
+ DD 01928e993H
+ DD 09c3ea696H
+ DD 0ab546497H
+ DD 0f2ea2295H
+ DD 0c580e094H
+ DD 0f8c7bc9fH
+ DD 0cfad7e9eH
+ DD 09613389cH
+ DD 0a179fa9dH
+ DD 0246fb598H
+ DD 013057799H
+ DD 04abb319bH
+ DD 07dd1f39aH
+ DD 03035898dH
+ DD 075f4b8cH
+ DD 05ee10d8eH
+ DD 0698bcf8fH
+ DD 0ec9d808aH
+ DD 0dbf7428bH
+ DD 082490489H
+ DD 0b523c688H
+ DD 088649a83H
+ DD 0bf0e5882H
+ DD 0e6b01e80H
+ DD 0d1dadc81H
+ DD 054cc9384H
+ DD 063a65185H
+ DD 03a181787H
+ DD 0d72d586H
+ DD 0a0d0e2a9H
+ DD 097ba20a8H
+ DD 0ce0466aaH
+ DD 0f96ea4abH
+ DD 07c78ebaeH
+ DD 04b1229afH
+ DD 012ac6fadH
+ DD 025c6adacH
+ DD 01881f1a7H
+ DD 02feb33a6H
+ DD 0765575a4H
+ DD 0413fb7a5H
+ DD 0c429f8a0H
+ DD 0f3433aa1H
+ DD 0aafd7ca3H
+ DD 09d97bea2H
+ DD 0d073c4b5H
+ DD 0e71906b4H
+ DD 0bea740b6H
+ DD 089cd82b7H
+ DD 0cdbcdb2H
+ DD 03bb10fb3H
+ DD 0620f49b1H
+ DD 055658bb0H
+ DD 06822d7bbH
+ DD 05f4815baH
+ DD 06f653b8H
+ DD 0319c91b9H
+ DD 0b48adebcH
+ DD 083e01cbdH
+ DD 0da5e5abfH
+ DD 0ed3498beH
+ DD 00H
+ DD 06567bcb8H
+ DD 08bc809aaH
+ DD 0eeafb512H
+ DD 05797628fH
+ DD 032f0de37H
+ DD 0dc5f6b25H
+ DD 0b938d79dH
+ DD 0ef28b4c5H
+ DD 08a4f087dH
+ DD 064e0bd6fH
+ DD 018701d7H
+ DD 0b8bfd64aH
+ DD 0ddd86af2H
+ DD 03377dfe0H
+ DD 056106358H
+ DD 09f571950H
+ DD 0fa30a5e8H
+ DD 0149f10faH
+ DD 071f8ac42H
+ DD 0c8c07bdfH
+ DD 0ada7c767H
+ DD 043087275H
+ DD 0266fcecdH
+ DD 0707fad95H
+ DD 01518112dH
+ DD 0fbb7a43fH
+ DD 09ed01887H
+ DD 027e8cf1aH
+ DD 0428f73a2H
+ DD 0ac20c6b0H
+ DD 0c9477a08H
+ DD 03eaf32a0H
+ DD 05bc88e18H
+ DD 0b5673b0aH
+ DD 0d00087b2H
+ DD 06938502fH
+ DD 0c5fec97H
+ DD 0e2f05985H
+ DD 08797e53dH
+ DD 0d1878665H
+ DD 0b4e03addH
+ DD 05a4f8fcfH
+ DD 03f283377H
+ DD 08610e4eaH
+ DD 0e3775852H
+ DD 0dd8ed40H
+ DD 068bf51f8H
+ DD 0a1f82bf0H
+ DD 0c49f9748H
+ DD 02a30225aH
+ DD 04f579ee2H
+ DD 0f66f497fH
+ DD 09308f5c7H
+ DD 07da740d5H
+ DD 018c0fc6dH
+ DD 04ed09f35H
+ DD 02bb7238dH
+ DD 0c518969fH
+ DD 0a07f2a27H
+ DD 01947fdbaH
+ DD 07c204102H
+ DD 0928ff410H
+ DD 0f7e848a8H
+ DD 03d58149bH
+ DD 0583fa823H
+ DD 0b6901d31H
+ DD 0d3f7a189H
+ DD 06acf7614H
+ DD 0fa8caacH
+ DD 0e1077fbeH
+ DD 08460c306H
+ DD 0d270a05eH
+ DD 0b7171ce6H
+ DD 059b8a9f4H
+ DD 03cdf154cH
+ DD 085e7c2d1H
+ DD 0e0807e69H
+ DD 0e2fcb7bH
+ DD 06b4877c3H
+ DD 0a20f0dcbH
+ DD 0c768b173H
+ DD 029c70461H
+ DD 04ca0b8d9H
+ DD 0f5986f44H
+ DD 090ffd3fcH
+ DD 07e5066eeH
+ DD 01b37da56H
+ DD 04d27b90eH
+ DD 0284005b6H
+ DD 0c6efb0a4H
+ DD 0a3880c1cH
+ DD 01ab0db81H
+ DD 07fd76739H
+ DD 09178d22bH
+ DD 0f41f6e93H
+ DD 03f7263bH
+ DD 066909a83H
+ DD 0883f2f91H
+ DD 0ed589329H
+ DD 0546044b4H
+ DD 03107f80cH
+ DD 0dfa84d1eH
+ DD 0bacff1a6H
+ DD 0ecdf92feH
+ DD 089b82e46H
+ DD 067179b54H
+ DD 027027ecH
+ DD 0bb48f071H
+ DD 0de2f4cc9H
+ DD 03080f9dbH
+ DD 055e74563H
+ DD 09ca03f6bH
+ DD 0f9c783d3H
+ DD 0176836c1H
+ DD 0720f8a79H
+ DD 0cb375de4H
+ DD 0ae50e15cH
+ DD 040ff544eH
+ DD 02598e8f6H
+ DD 073888baeH
+ DD 016ef3716H
+ DD 0f8408204H
+ DD 09d273ebcH
+ DD 0241fe921H
+ DD 041785599H
+ DD 0afd7e08bH
+ DD 0cab05c33H
+ DD 03bb659edH
+ DD 05ed1e555H
+ DD 0b07e5047H
+ DD 0d519ecffH
+ DD 06c213b62H
+ DD 094687daH
+ DD 0e7e932c8H
+ DD 0828e8e70H
+ DD 0d49eed28H
+ DD 0b1f95190H
+ DD 05f56e482H
+ DD 03a31583aH
+ DD 083098fa7H
+ DD 0e66e331fH
+ DD 08c1860dH
+ DD 06da63ab5H
+ DD 0a4e140bdH
+ DD 0c186fc05H
+ DD 02f294917H
+ DD 04a4ef5afH
+ DD 0f3762232H
+ DD 096119e8aH
+ DD 078be2b98H
+ DD 01dd99720H
+ DD 04bc9f478H
+ DD 02eae48c0H
+ DD 0c001fdd2H
+ DD 0a566416aH
+ DD 01c5e96f7H
+ DD 079392a4fH
+ DD 097969f5dH
+ DD 0f2f123e5H
+ DD 05196b4dH
+ DD 0607ed7f5H
+ DD 08ed162e7H
+ DD 0ebb6de5fH
+ DD 0528e09c2H
+ DD 037e9b57aH
+ DD 0d9460068H
+ DD 0bc21bcd0H
+ DD 0ea31df88H
+ DD 08f566330H
+ DD 061f9d622H
+ DD 049e6a9aH
+ DD 0bda6bd07H
+ DD 0d8c101bfH
+ DD 0366eb4adH
+ DD 053090815H
+ DD 09a4e721dH
+ DD 0ff29cea5H
+ DD 011867bb7H
+ DD 074e1c70fH
+ DD 0cdd91092H
+ DD 0a8beac2aH
+ DD 046111938H
+ DD 02376a580H
+ DD 07566c6d8H
+ DD 010017a60H
+ DD 0feaecf72H
+ DD 09bc973caH
+ DD 022f1a457H
+ DD 0479618efH
+ DD 0a939adfdH
+ DD 0cc5e1145H
+ DD 06ee4d76H
+ DD 06389f1ceH
+ DD 08d2644dcH
+ DD 0e841f864H
+ DD 051792ff9H
+ DD 0341e9341H
+ DD 0dab12653H
+ DD 0bfd69aebH
+ DD 0e9c6f9b3H
+ DD 08ca1450bH
+ DD 0620ef019H
+ DD 07694ca1H
+ DD 0be519b3cH
+ DD 0db362784H
+ DD 035999296H
+ DD 050fe2e2eH
+ DD 099b95426H
+ DD 0fcdee89eH
+ DD 012715d8cH
+ DD 07716e134H
+ DD 0ce2e36a9H
+ DD 0ab498a11H
+ DD 045e63f03H
+ DD 0208183bbH
+ DD 07691e0e3H
+ DD 013f65c5bH
+ DD 0fd59e949H
+ DD 0983e55f1H
+ DD 02106826cH
+ DD 044613ed4H
+ DD 0aace8bc6H
+ DD 0cfa9377eH
+ DD 038417fd6H
+ DD 05d26c36eH
+ DD 0b389767cH
+ DD 0d6eecac4H
+ DD 06fd61d59H
+ DD 0ab1a1e1H
+ DD 0e41e14f3H
+ DD 08179a84bH
+ DD 0d769cb13H
+ DD 0b20e77abH
+ DD 05ca1c2b9H
+ DD 039c67e01H
+ DD 080fea99cH
+ DD 0e5991524H
+ DD 0b36a036H
+ DD 06e511c8eH
+ DD 0a7166686H
+ DD 0c271da3eH
+ DD 02cde6f2cH
+ DD 049b9d394H
+ DD 0f0810409H
+ DD 095e6b8b1H
+ DD 07b490da3H
+ DD 01e2eb11bH
+ DD 0483ed243H
+ DD 02d596efbH
+ DD 0c3f6dbe9H
+ DD 0a6916751H
+ DD 01fa9b0ccH
+ DD 07ace0c74H
+ DD 09461b966H
+ DD 0f10605deH
+PUBLIC _crc32_combine@12
+PUBLIC _crc32@12
+PUBLIC _get_crc_table@0
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\crc32.c
+; COMDAT _get_crc_table@0
+_TEXT SEGMENT
+_get_crc_table@0 PROC ; COMDAT
+
+; 192 : #ifdef DYNAMIC_CRC_TABLE
+; 193 : if (crc_table_empty)
+; 194 : make_crc_table();
+; 195 : #endif /* DYNAMIC_CRC_TABLE */
+; 196 : return (const z_crc_t FAR *)crc_table;
+
+ 00000 b8 00 00 00 00 mov eax, OFFSET _crc_table
+
+; 197 : }
+
+ 00005 c3 ret 0
+_get_crc_table@0 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\crc32.c
+; COMDAT _crc32@12
+_TEXT SEGMENT
+_crc$ = 8 ; size = 4
+_buf$ = 12 ; size = 4
+_len$ = 16 ; size = 4
+_crc32@12 PROC ; COMDAT
+
+; 208 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 209 : if (buf == Z_NULL) return 0UL;
+
+ 00003 8b 55 0c mov edx, DWORD PTR _buf$[ebp]
+ 00006 85 d2 test edx, edx
+ 00008 75 06 jne SHORT $LN7@crc32
+ 0000a 33 c0 xor eax, eax
+
+; 223 : else
+; 224 : return crc32_big(crc, buf, len);
+; 225 : }
+; 226 : #endif /* BYFOUR */
+; 227 : crc = crc ^ 0xffffffffUL;
+; 228 : while (len >= 8) {
+; 229 : DO8;
+; 230 : len -= 8;
+; 231 : }
+; 232 : if (len) do {
+; 233 : DO1;
+; 234 : } while (--len);
+; 235 : return crc ^ 0xffffffffUL;
+; 236 : }
+
+ 0000c 5d pop ebp
+ 0000d c2 0c 00 ret 12 ; 0000000cH
+$LN7@crc32:
+
+; 210 :
+; 211 : #ifdef DYNAMIC_CRC_TABLE
+; 212 : if (crc_table_empty)
+; 213 : make_crc_table();
+; 214 : #endif /* DYNAMIC_CRC_TABLE */
+; 215 :
+; 216 : #ifdef BYFOUR
+; 217 : if (sizeof(void *) == sizeof(ptrdiff_t)) {
+; 218 : z_crc_t endian;
+; 219 :
+; 220 : endian = 1;
+; 221 : if (*((unsigned char *)(&endian)))
+; 222 : return crc32_little(crc, buf, len);
+
+ 00010 ff 75 10 push DWORD PTR _len$[ebp]
+ 00013 8b 4d 08 mov ecx, DWORD PTR _crc$[ebp]
+ 00016 e8 00 00 00 00 call _crc32_little
+ 0001b 83 c4 04 add esp, 4
+
+; 223 : else
+; 224 : return crc32_big(crc, buf, len);
+; 225 : }
+; 226 : #endif /* BYFOUR */
+; 227 : crc = crc ^ 0xffffffffUL;
+; 228 : while (len >= 8) {
+; 229 : DO8;
+; 230 : len -= 8;
+; 231 : }
+; 232 : if (len) do {
+; 233 : DO1;
+; 234 : } while (--len);
+; 235 : return crc ^ 0xffffffffUL;
+; 236 : }
+
+ 0001e 5d pop ebp
+ 0001f c2 0c 00 ret 12 ; 0000000cH
+_crc32@12 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\crc32.c
+; COMDAT _crc32_little
+_TEXT SEGMENT
+tv537 = -4 ; size = 4
+_buf$2$ = 8 ; size = 4
+_len$ = 8 ; size = 4
+_crc32_little PROC ; COMDAT
+; _crc$ = ecx
+; _buf$ = edx
+
+; 251 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 51 push ecx
+ 00004 53 push ebx
+ 00005 57 push edi
+
+; 252 : register z_crc_t c;
+; 253 : register const z_crc_t FAR *buf4;
+; 254 :
+; 255 : c = (z_crc_t)crc;
+; 256 : c = ~c;
+; 257 : while (len && ((ptrdiff_t)buf & 3)) {
+
+ 00006 8b 7d 08 mov edi, DWORD PTR _len$[ebp]
+ 00009 8b da mov ebx, edx
+ 0000b f7 d1 not ecx
+ 0000d 85 ff test edi, edi
+ 0000f 74 1d je SHORT $LN28@crc32_litt
+$LL2@crc32_litt:
+ 00011 f6 c3 03 test bl, 3
+ 00014 74 18 je SHORT $LN28@crc32_litt
+
+; 258 : c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
+
+ 00016 0f b6 03 movzx eax, BYTE PTR [ebx]
+ 00019 43 inc ebx
+ 0001a 33 c1 xor eax, ecx
+ 0001c c1 e9 08 shr ecx, 8
+ 0001f 0f b6 c0 movzx eax, al
+ 00022 33 0c 85 00 00
+ 00 00 xor ecx, DWORD PTR _crc_table[eax*4]
+
+; 259 : len--;
+
+ 00029 83 ef 01 sub edi, 1
+ 0002c 75 e3 jne SHORT $LL2@crc32_litt
+$LN28@crc32_litt:
+ 0002e 56 push esi
+
+; 263 : while (len >= 32) {
+
+ 0002f 83 ff 20 cmp edi, 32 ; 00000020H
+ 00032 0f 82 de 01 00
+ 00 jb $LN15@crc32_litt
+
+; 260 : }
+; 261 :
+; 262 : buf4 = (const z_crc_t FAR *)(const void FAR *)buf;
+
+ 00038 8b c7 mov eax, edi
+ 0003a c1 e8 05 shr eax, 5
+ 0003d 89 45 fc mov DWORD PTR tv537[ebp], eax
+$LL4@crc32_litt:
+
+; 264 : DOLIT32;
+
+ 00040 33 0b xor ecx, DWORD PTR [ebx]
+ 00042 8b c1 mov eax, ecx
+ 00044 c1 e8 10 shr eax, 16 ; 00000010H
+ 00047 0f b6 d0 movzx edx, al
+ 0004a 8b c1 mov eax, ecx
+ 0004c c1 e8 08 shr eax, 8
+ 0004f 0f b6 c0 movzx eax, al
+ 00052 8b 14 95 00 04
+ 00 00 mov edx, DWORD PTR _crc_table[edx*4+1024]
+ 00059 33 14 85 00 08
+ 00 00 xor edx, DWORD PTR _crc_table[eax*4+2048]
+ 00060 8b c1 mov eax, ecx
+ 00062 c1 e8 18 shr eax, 24 ; 00000018H
+ 00065 33 14 85 00 00
+ 00 00 xor edx, DWORD PTR _crc_table[eax*4]
+ 0006c 0f b6 c1 movzx eax, cl
+ 0006f 33 14 85 00 0c
+ 00 00 xor edx, DWORD PTR _crc_table[eax*4+3072]
+ 00076 33 53 04 xor edx, DWORD PTR [ebx+4]
+ 00079 83 c3 08 add ebx, 8
+ 0007c 8b c2 mov eax, edx
+ 0007e 89 5d 08 mov DWORD PTR _buf$2$[ebp], ebx
+ 00081 c1 e8 10 shr eax, 16 ; 00000010H
+ 00084 0f b6 c8 movzx ecx, al
+ 00087 8b c2 mov eax, edx
+ 00089 c1 e8 08 shr eax, 8
+ 0008c 0f b6 c0 movzx eax, al
+ 0008f 8b 75 08 mov esi, DWORD PTR _buf$2$[ebp]
+ 00092 8b 1c 8d 00 04
+ 00 00 mov ebx, DWORD PTR _crc_table[ecx*4+1024]
+ 00099 33 1c 85 00 08
+ 00 00 xor ebx, DWORD PTR _crc_table[eax*4+2048]
+ 000a0 8b c2 mov eax, edx
+ 000a2 c1 e8 18 shr eax, 24 ; 00000018H
+ 000a5 33 1c 85 00 00
+ 00 00 xor ebx, DWORD PTR _crc_table[eax*4]
+ 000ac 0f b6 c2 movzx eax, dl
+ 000af 33 1c 85 00 0c
+ 00 00 xor ebx, DWORD PTR _crc_table[eax*4+3072]
+ 000b6 33 1e xor ebx, DWORD PTR [esi]
+ 000b8 8b c3 mov eax, ebx
+ 000ba c1 e8 10 shr eax, 16 ; 00000010H
+ 000bd 0f b6 c8 movzx ecx, al
+ 000c0 8b c3 mov eax, ebx
+ 000c2 c1 e8 08 shr eax, 8
+ 000c5 0f b6 c0 movzx eax, al
+ 000c8 8b 14 8d 00 04
+ 00 00 mov edx, DWORD PTR _crc_table[ecx*4+1024]
+ 000cf 33 14 85 00 08
+ 00 00 xor edx, DWORD PTR _crc_table[eax*4+2048]
+ 000d6 8b c3 mov eax, ebx
+ 000d8 c1 e8 18 shr eax, 24 ; 00000018H
+ 000db 33 14 85 00 00
+ 00 00 xor edx, DWORD PTR _crc_table[eax*4]
+ 000e2 0f b6 c3 movzx eax, bl
+ 000e5 33 14 85 00 0c
+ 00 00 xor edx, DWORD PTR _crc_table[eax*4+3072]
+ 000ec 33 56 04 xor edx, DWORD PTR [esi+4]
+ 000ef 8b c2 mov eax, edx
+ 000f1 c1 e8 10 shr eax, 16 ; 00000010H
+ 000f4 0f b6 c8 movzx ecx, al
+ 000f7 8b c2 mov eax, edx
+ 000f9 c1 e8 08 shr eax, 8
+ 000fc 0f b6 c0 movzx eax, al
+ 000ff 8b 1c 8d 00 04
+ 00 00 mov ebx, DWORD PTR _crc_table[ecx*4+1024]
+ 00106 33 1c 85 00 08
+ 00 00 xor ebx, DWORD PTR _crc_table[eax*4+2048]
+ 0010d 8b c2 mov eax, edx
+ 0010f c1 e8 18 shr eax, 24 ; 00000018H
+ 00112 33 1c 85 00 00
+ 00 00 xor ebx, DWORD PTR _crc_table[eax*4]
+ 00119 0f b6 c2 movzx eax, dl
+ 0011c 33 1c 85 00 0c
+ 00 00 xor ebx, DWORD PTR _crc_table[eax*4+3072]
+ 00123 33 5e 08 xor ebx, DWORD PTR [esi+8]
+ 00126 8b c3 mov eax, ebx
+ 00128 c1 e8 10 shr eax, 16 ; 00000010H
+ 0012b 0f b6 c8 movzx ecx, al
+ 0012e 8b c3 mov eax, ebx
+ 00130 c1 e8 08 shr eax, 8
+ 00133 0f b6 c0 movzx eax, al
+ 00136 8b 14 8d 00 04
+ 00 00 mov edx, DWORD PTR _crc_table[ecx*4+1024]
+ 0013d 33 14 85 00 08
+ 00 00 xor edx, DWORD PTR _crc_table[eax*4+2048]
+ 00144 8b c3 mov eax, ebx
+ 00146 c1 e8 18 shr eax, 24 ; 00000018H
+ 00149 33 14 85 00 00
+ 00 00 xor edx, DWORD PTR _crc_table[eax*4]
+ 00150 0f b6 c3 movzx eax, bl
+ 00153 33 14 85 00 0c
+ 00 00 xor edx, DWORD PTR _crc_table[eax*4+3072]
+ 0015a 33 56 0c xor edx, DWORD PTR [esi+12]
+ 0015d 8b c2 mov eax, edx
+ 0015f c1 e8 10 shr eax, 16 ; 00000010H
+ 00162 0f b6 c8 movzx ecx, al
+ 00165 8b c2 mov eax, edx
+ 00167 c1 e8 08 shr eax, 8
+ 0016a 0f b6 c0 movzx eax, al
+ 0016d 8b 1c 8d 00 04
+ 00 00 mov ebx, DWORD PTR _crc_table[ecx*4+1024]
+ 00174 33 1c 85 00 08
+ 00 00 xor ebx, DWORD PTR _crc_table[eax*4+2048]
+
+; 265 : len -= 32;
+
+ 0017b 83 ef 20 sub edi, 32 ; 00000020H
+ 0017e 8b c2 mov eax, edx
+ 00180 c1 e8 18 shr eax, 24 ; 00000018H
+ 00183 33 1c 85 00 00
+ 00 00 xor ebx, DWORD PTR _crc_table[eax*4]
+ 0018a 0f b6 c2 movzx eax, dl
+ 0018d 33 1c 85 00 0c
+ 00 00 xor ebx, DWORD PTR _crc_table[eax*4+3072]
+ 00194 33 5e 10 xor ebx, DWORD PTR [esi+16]
+ 00197 83 c6 14 add esi, 20 ; 00000014H
+ 0019a 8b c3 mov eax, ebx
+ 0019c 89 75 08 mov DWORD PTR _buf$2$[ebp], esi
+ 0019f c1 e8 10 shr eax, 16 ; 00000010H
+ 001a2 0f b6 c8 movzx ecx, al
+ 001a5 8b c3 mov eax, ebx
+ 001a7 c1 e8 08 shr eax, 8
+ 001aa 0f b6 c0 movzx eax, al
+ 001ad 8b 14 8d 00 04
+ 00 00 mov edx, DWORD PTR _crc_table[ecx*4+1024]
+ 001b4 33 14 85 00 08
+ 00 00 xor edx, DWORD PTR _crc_table[eax*4+2048]
+ 001bb 8b c3 mov eax, ebx
+ 001bd c1 e8 18 shr eax, 24 ; 00000018H
+ 001c0 33 14 85 00 00
+ 00 00 xor edx, DWORD PTR _crc_table[eax*4]
+ 001c7 0f b6 c3 movzx eax, bl
+ 001ca 8b de mov ebx, esi
+ 001cc 33 14 85 00 0c
+ 00 00 xor edx, DWORD PTR _crc_table[eax*4+3072]
+ 001d3 33 13 xor edx, DWORD PTR [ebx]
+ 001d5 83 c3 04 add ebx, 4
+ 001d8 8b c2 mov eax, edx
+ 001da c1 e8 10 shr eax, 16 ; 00000010H
+ 001dd 0f b6 c8 movzx ecx, al
+ 001e0 8b c2 mov eax, edx
+ 001e2 c1 e8 08 shr eax, 8
+ 001e5 0f b6 c0 movzx eax, al
+ 001e8 8b 0c 8d 00 04
+ 00 00 mov ecx, DWORD PTR _crc_table[ecx*4+1024]
+ 001ef 33 0c 85 00 08
+ 00 00 xor ecx, DWORD PTR _crc_table[eax*4+2048]
+ 001f6 8b c2 mov eax, edx
+ 001f8 c1 e8 18 shr eax, 24 ; 00000018H
+ 001fb 33 0c 85 00 00
+ 00 00 xor ecx, DWORD PTR _crc_table[eax*4]
+ 00202 0f b6 c2 movzx eax, dl
+ 00205 33 0c 85 00 0c
+ 00 00 xor ecx, DWORD PTR _crc_table[eax*4+3072]
+ 0020c 83 6d fc 01 sub DWORD PTR tv537[ebp], 1
+ 00210 0f 85 2a fe ff
+ ff jne $LL4@crc32_litt
+$LN15@crc32_litt:
+
+; 266 : }
+; 267 : while (len >= 4) {
+
+ 00216 83 ff 04 cmp edi, 4
+ 00219 72 48 jb SHORT $LN7@crc32_litt
+ 0021b 8b f7 mov esi, edi
+ 0021d c1 ee 02 shr esi, 2
+$LL6@crc32_litt:
+
+; 268 : DOLIT4;
+
+ 00220 33 0b xor ecx, DWORD PTR [ebx]
+
+; 269 : len -= 4;
+
+ 00222 83 ef 04 sub edi, 4
+ 00225 8b c1 mov eax, ecx
+ 00227 83 c3 04 add ebx, 4
+ 0022a c1 e8 10 shr eax, 16 ; 00000010H
+ 0022d 0f b6 d0 movzx edx, al
+ 00230 8b c1 mov eax, ecx
+ 00232 c1 e8 08 shr eax, 8
+ 00235 0f b6 c0 movzx eax, al
+ 00238 8b 14 95 00 04
+ 00 00 mov edx, DWORD PTR _crc_table[edx*4+1024]
+ 0023f 33 14 85 00 08
+ 00 00 xor edx, DWORD PTR _crc_table[eax*4+2048]
+ 00246 8b c1 mov eax, ecx
+ 00248 c1 e8 18 shr eax, 24 ; 00000018H
+ 0024b 33 14 85 00 00
+ 00 00 xor edx, DWORD PTR _crc_table[eax*4]
+ 00252 0f b6 c1 movzx eax, cl
+ 00255 33 14 85 00 0c
+ 00 00 xor edx, DWORD PTR _crc_table[eax*4+3072]
+ 0025c 8b ca mov ecx, edx
+ 0025e 83 ee 01 sub esi, 1
+ 00261 75 bd jne SHORT $LL6@crc32_litt
+$LN7@crc32_litt:
+ 00263 5e pop esi
+
+; 270 : }
+; 271 : buf = (const unsigned char FAR *)buf4;
+; 272 :
+; 273 : if (len) do {
+
+ 00264 85 ff test edi, edi
+ 00266 74 1a je SHORT $LN9@crc32_litt
+$LL10@crc32_litt:
+
+; 274 : c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
+
+ 00268 0f b6 03 movzx eax, BYTE PTR [ebx]
+ 0026b 8d 5b 01 lea ebx, DWORD PTR [ebx+1]
+ 0026e 33 c1 xor eax, ecx
+ 00270 c1 e9 08 shr ecx, 8
+ 00273 0f b6 c0 movzx eax, al
+ 00276 33 0c 85 00 00
+ 00 00 xor ecx, DWORD PTR _crc_table[eax*4]
+
+; 275 : } while (--len);
+
+ 0027d 83 ef 01 sub edi, 1
+ 00280 75 e6 jne SHORT $LL10@crc32_litt
+$LN9@crc32_litt:
+
+; 276 : c = ~c;
+
+ 00282 f7 d1 not ecx
+ 00284 5f pop edi
+
+; 277 : return (unsigned long)c;
+
+ 00285 8b c1 mov eax, ecx
+ 00287 5b pop ebx
+
+; 278 : }
+
+ 00288 8b e5 mov esp, ebp
+ 0028a 5d pop ebp
+ 0028b c3 ret 0
+_crc32_little ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\crc32.c
+; COMDAT _crc32_big
+_TEXT SEGMENT
+_c$6$ = -4 ; size = 4
+tv575 = 8 ; size = 4
+_len$ = 8 ; size = 4
+_crc32_big PROC ; COMDAT
+; _crc$ = ecx
+; _buf$ = edx
+
+; 291 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 51 push ecx
+ 00004 53 push ebx
+ 00005 56 push esi
+
+; 292 : register z_crc_t c;
+; 293 : register const z_crc_t FAR *buf4;
+; 294 :
+; 295 : c = ZSWAP32((z_crc_t)crc);
+
+ 00006 8b c1 mov eax, ecx
+
+; 296 : c = ~c;
+
+ 00008 8b f1 mov esi, ecx
+ 0000a 25 00 ff 00 00 and eax, 65280 ; 0000ff00H
+ 0000f c1 e6 10 shl esi, 16 ; 00000010H
+ 00012 03 c6 add eax, esi
+ 00014 8b da mov ebx, edx
+ 00016 8b f1 mov esi, ecx
+ 00018 c1 e0 08 shl eax, 8
+ 0001b c1 ee 08 shr esi, 8
+ 0001e 81 e6 00 ff 00
+ 00 and esi, 65280 ; 0000ff00H
+ 00024 c1 e9 18 shr ecx, 24 ; 00000018H
+ 00027 03 c6 add eax, esi
+
+; 297 : while (len && ((ptrdiff_t)buf & 3)) {
+
+ 00029 8b 75 08 mov esi, DWORD PTR _len$[ebp]
+ 0002c 03 c1 add eax, ecx
+ 0002e f7 d0 not eax
+ 00030 57 push edi
+ 00031 85 f6 test esi, esi
+ 00033 74 1f je SHORT $LN28@crc32_big
+$LL2@crc32_big:
+ 00035 f6 c3 03 test bl, 3
+ 00038 74 1a je SHORT $LN28@crc32_big
+
+; 298 : c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
+
+ 0003a 0f b6 0b movzx ecx, BYTE PTR [ebx]
+ 0003d 8b d0 mov edx, eax
+ 0003f c1 ea 18 shr edx, 24 ; 00000018H
+ 00042 43 inc ebx
+ 00043 33 d1 xor edx, ecx
+ 00045 c1 e0 08 shl eax, 8
+ 00048 33 04 95 00 10
+ 00 00 xor eax, DWORD PTR _crc_table[edx*4+4096]
+
+; 299 : len--;
+
+ 0004f 83 ee 01 sub esi, 1
+ 00052 75 e1 jne SHORT $LL2@crc32_big
+$LN28@crc32_big:
+
+; 300 : }
+; 301 :
+; 302 : buf4 = (const z_crc_t FAR *)(const void FAR *)buf;
+; 303 : buf4--;
+
+ 00054 8d 7b fc lea edi, DWORD PTR [ebx-4]
+
+; 304 : while (len >= 32) {
+
+ 00057 83 fe 20 cmp esi, 32 ; 00000020H
+ 0005a 0f 82 d5 01 00
+ 00 jb $LN15@crc32_big
+
+; 300 : }
+; 301 :
+; 302 : buf4 = (const z_crc_t FAR *)(const void FAR *)buf;
+; 303 : buf4--;
+
+ 00060 8b ce mov ecx, esi
+ 00062 c1 e9 05 shr ecx, 5
+ 00065 89 4d 08 mov DWORD PTR tv575[ebp], ecx
+$LL4@crc32_big:
+
+; 305 : DOBIG32;
+
+ 00068 33 47 04 xor eax, DWORD PTR [edi+4]
+ 0006b 8b c8 mov ecx, eax
+ 0006d c1 e9 10 shr ecx, 16 ; 00000010H
+ 00070 0f b6 d1 movzx edx, cl
+ 00073 8b c8 mov ecx, eax
+ 00075 c1 e9 08 shr ecx, 8
+ 00078 0f b6 c9 movzx ecx, cl
+ 0007b 8b 14 95 00 18
+ 00 00 mov edx, DWORD PTR _crc_table[edx*4+6144]
+ 00082 33 14 8d 00 14
+ 00 00 xor edx, DWORD PTR _crc_table[ecx*4+5120]
+ 00089 8b c8 mov ecx, eax
+ 0008b 0f b6 c0 movzx eax, al
+ 0008e c1 e9 18 shr ecx, 24 ; 00000018H
+ 00091 33 14 8d 00 1c
+ 00 00 xor edx, DWORD PTR _crc_table[ecx*4+7168]
+ 00098 33 14 85 00 10
+ 00 00 xor edx, DWORD PTR _crc_table[eax*4+4096]
+ 0009f 33 57 08 xor edx, DWORD PTR [edi+8]
+ 000a2 8b c2 mov eax, edx
+ 000a4 c1 e8 10 shr eax, 16 ; 00000010H
+ 000a7 0f b6 c8 movzx ecx, al
+ 000aa 8b c2 mov eax, edx
+ 000ac c1 e8 08 shr eax, 8
+ 000af 0f b6 c0 movzx eax, al
+ 000b2 8b 1c 8d 00 18
+ 00 00 mov ebx, DWORD PTR _crc_table[ecx*4+6144]
+ 000b9 33 1c 85 00 14
+ 00 00 xor ebx, DWORD PTR _crc_table[eax*4+5120]
+ 000c0 8b c2 mov eax, edx
+ 000c2 c1 e8 18 shr eax, 24 ; 00000018H
+ 000c5 33 1c 85 00 1c
+ 00 00 xor ebx, DWORD PTR _crc_table[eax*4+7168]
+ 000cc 0f b6 c2 movzx eax, dl
+ 000cf 33 1c 85 00 10
+ 00 00 xor ebx, DWORD PTR _crc_table[eax*4+4096]
+ 000d6 33 5f 0c xor ebx, DWORD PTR [edi+12]
+ 000d9 8b c3 mov eax, ebx
+ 000db c1 e8 10 shr eax, 16 ; 00000010H
+ 000de 0f b6 c8 movzx ecx, al
+ 000e1 8b c3 mov eax, ebx
+ 000e3 c1 e8 08 shr eax, 8
+ 000e6 0f b6 c0 movzx eax, al
+ 000e9 8b 14 8d 00 18
+ 00 00 mov edx, DWORD PTR _crc_table[ecx*4+6144]
+ 000f0 33 14 85 00 14
+ 00 00 xor edx, DWORD PTR _crc_table[eax*4+5120]
+ 000f7 8b c3 mov eax, ebx
+ 000f9 c1 e8 18 shr eax, 24 ; 00000018H
+ 000fc 33 14 85 00 1c
+ 00 00 xor edx, DWORD PTR _crc_table[eax*4+7168]
+ 00103 0f b6 c3 movzx eax, bl
+ 00106 33 14 85 00 10
+ 00 00 xor edx, DWORD PTR _crc_table[eax*4+4096]
+ 0010d 33 57 10 xor edx, DWORD PTR [edi+16]
+ 00110 8b c2 mov eax, edx
+ 00112 c1 e8 10 shr eax, 16 ; 00000010H
+ 00115 0f b6 c8 movzx ecx, al
+ 00118 8b c2 mov eax, edx
+ 0011a c1 e8 08 shr eax, 8
+ 0011d 0f b6 c0 movzx eax, al
+ 00120 8b 1c 8d 00 18
+ 00 00 mov ebx, DWORD PTR _crc_table[ecx*4+6144]
+ 00127 33 1c 85 00 14
+ 00 00 xor ebx, DWORD PTR _crc_table[eax*4+5120]
+ 0012e 8b c2 mov eax, edx
+ 00130 c1 e8 18 shr eax, 24 ; 00000018H
+ 00133 33 1c 85 00 1c
+ 00 00 xor ebx, DWORD PTR _crc_table[eax*4+7168]
+ 0013a 0f b6 c2 movzx eax, dl
+ 0013d 33 1c 85 00 10
+ 00 00 xor ebx, DWORD PTR _crc_table[eax*4+4096]
+ 00144 33 5f 14 xor ebx, DWORD PTR [edi+20]
+ 00147 8b c3 mov eax, ebx
+ 00149 c1 e8 10 shr eax, 16 ; 00000010H
+ 0014c 0f b6 c8 movzx ecx, al
+ 0014f 8b c3 mov eax, ebx
+ 00151 c1 e8 08 shr eax, 8
+ 00154 0f b6 c0 movzx eax, al
+ 00157 8b 14 8d 00 18
+ 00 00 mov edx, DWORD PTR _crc_table[ecx*4+6144]
+ 0015e 33 14 85 00 14
+ 00 00 xor edx, DWORD PTR _crc_table[eax*4+5120]
+ 00165 8b c3 mov eax, ebx
+ 00167 c1 e8 18 shr eax, 24 ; 00000018H
+ 0016a 33 14 85 00 1c
+ 00 00 xor edx, DWORD PTR _crc_table[eax*4+7168]
+ 00171 0f b6 c3 movzx eax, bl
+ 00174 33 14 85 00 10
+ 00 00 xor edx, DWORD PTR _crc_table[eax*4+4096]
+ 0017b 33 57 18 xor edx, DWORD PTR [edi+24]
+ 0017e 8b c2 mov eax, edx
+ 00180 c1 e8 10 shr eax, 16 ; 00000010H
+ 00183 0f b6 c8 movzx ecx, al
+ 00186 8b c2 mov eax, edx
+ 00188 c1 e8 08 shr eax, 8
+ 0018b 0f b6 c0 movzx eax, al
+ 0018e 8b 1c 8d 00 18
+ 00 00 mov ebx, DWORD PTR _crc_table[ecx*4+6144]
+ 00195 33 1c 85 00 14
+ 00 00 xor ebx, DWORD PTR _crc_table[eax*4+5120]
+ 0019c 8b c2 mov eax, edx
+ 0019e c1 e8 18 shr eax, 24 ; 00000018H
+ 001a1 33 1c 85 00 1c
+ 00 00 xor ebx, DWORD PTR _crc_table[eax*4+7168]
+
+; 306 : len -= 32;
+
+ 001a8 83 ee 20 sub esi, 32 ; 00000020H
+ 001ab 0f b6 c2 movzx eax, dl
+ 001ae 33 1c 85 00 10
+ 00 00 xor ebx, DWORD PTR _crc_table[eax*4+4096]
+ 001b5 33 5f 1c xor ebx, DWORD PTR [edi+28]
+ 001b8 83 c7 20 add edi, 32 ; 00000020H
+ 001bb 8b c3 mov eax, ebx
+ 001bd 89 5d fc mov DWORD PTR _c$6$[ebp], ebx
+ 001c0 c1 e8 10 shr eax, 16 ; 00000010H
+ 001c3 0f b6 c8 movzx ecx, al
+ 001c6 8b c3 mov eax, ebx
+ 001c8 c1 e8 08 shr eax, 8
+ 001cb 0f b6 c0 movzx eax, al
+ 001ce 8b 1c 8d 00 18
+ 00 00 mov ebx, DWORD PTR _crc_table[ecx*4+6144]
+ 001d5 8b 4d fc mov ecx, DWORD PTR _c$6$[ebp]
+ 001d8 33 1c 85 00 14
+ 00 00 xor ebx, DWORD PTR _crc_table[eax*4+5120]
+ 001df 8b c1 mov eax, ecx
+ 001e1 c1 e8 18 shr eax, 24 ; 00000018H
+ 001e4 33 1c 85 00 1c
+ 00 00 xor ebx, DWORD PTR _crc_table[eax*4+7168]
+ 001eb 0f b6 c1 movzx eax, cl
+ 001ee 33 1c 85 00 10
+ 00 00 xor ebx, DWORD PTR _crc_table[eax*4+4096]
+ 001f5 33 1f xor ebx, DWORD PTR [edi]
+ 001f7 8b c3 mov eax, ebx
+ 001f9 c1 e8 10 shr eax, 16 ; 00000010H
+ 001fc 0f b6 d0 movzx edx, al
+ 001ff 8b c3 mov eax, ebx
+ 00201 c1 e8 08 shr eax, 8
+ 00204 0f b6 c8 movzx ecx, al
+ 00207 8b 04 95 00 18
+ 00 00 mov eax, DWORD PTR _crc_table[edx*4+6144]
+ 0020e 33 04 8d 00 14
+ 00 00 xor eax, DWORD PTR _crc_table[ecx*4+5120]
+ 00215 8b cb mov ecx, ebx
+ 00217 c1 e9 18 shr ecx, 24 ; 00000018H
+ 0021a 33 04 8d 00 1c
+ 00 00 xor eax, DWORD PTR _crc_table[ecx*4+7168]
+ 00221 0f b6 cb movzx ecx, bl
+ 00224 33 04 8d 00 10
+ 00 00 xor eax, DWORD PTR _crc_table[ecx*4+4096]
+ 0022b 83 6d 08 01 sub DWORD PTR tv575[ebp], 1
+ 0022f 0f 85 33 fe ff
+ ff jne $LL4@crc32_big
+$LN15@crc32_big:
+
+; 307 : }
+; 308 : while (len >= 4) {
+
+ 00235 83 fe 04 cmp esi, 4
+ 00238 72 4a jb SHORT $LN7@crc32_big
+ 0023a 8b de mov ebx, esi
+ 0023c c1 eb 02 shr ebx, 2
+ 0023f 90 npad 1
+$LL6@crc32_big:
+
+; 309 : DOBIG4;
+
+ 00240 33 47 04 xor eax, DWORD PTR [edi+4]
+ 00243 83 c7 04 add edi, 4
+ 00246 8b c8 mov ecx, eax
+
+; 310 : len -= 4;
+
+ 00248 83 ee 04 sub esi, 4
+ 0024b c1 e9 10 shr ecx, 16 ; 00000010H
+ 0024e 0f b6 d1 movzx edx, cl
+ 00251 8b c8 mov ecx, eax
+ 00253 c1 e9 08 shr ecx, 8
+ 00256 0f b6 c9 movzx ecx, cl
+ 00259 8b 14 95 00 18
+ 00 00 mov edx, DWORD PTR _crc_table[edx*4+6144]
+ 00260 33 14 8d 00 14
+ 00 00 xor edx, DWORD PTR _crc_table[ecx*4+5120]
+ 00267 8b c8 mov ecx, eax
+ 00269 c1 e9 18 shr ecx, 24 ; 00000018H
+ 0026c 0f b6 c0 movzx eax, al
+ 0026f 33 14 8d 00 1c
+ 00 00 xor edx, DWORD PTR _crc_table[ecx*4+7168]
+ 00276 33 14 85 00 10
+ 00 00 xor edx, DWORD PTR _crc_table[eax*4+4096]
+ 0027d 8b c2 mov eax, edx
+ 0027f 83 eb 01 sub ebx, 1
+ 00282 75 bc jne SHORT $LL6@crc32_big
+$LN7@crc32_big:
+
+; 311 : }
+; 312 : buf4++;
+
+ 00284 83 c7 04 add edi, 4
+
+; 313 : buf = (const unsigned char FAR *)buf4;
+; 314 :
+; 315 : if (len) do {
+
+ 00287 85 f6 test esi, esi
+ 00289 74 21 je SHORT $LN9@crc32_big
+ 0028b 0f 1f 44 00 00 npad 5
+$LL10@crc32_big:
+
+; 316 : c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
+
+ 00290 0f b6 0f movzx ecx, BYTE PTR [edi]
+ 00293 8d 7f 01 lea edi, DWORD PTR [edi+1]
+ 00296 8b d0 mov edx, eax
+ 00298 c1 e0 08 shl eax, 8
+ 0029b c1 ea 18 shr edx, 24 ; 00000018H
+ 0029e 33 d1 xor edx, ecx
+ 002a0 33 04 95 00 10
+ 00 00 xor eax, DWORD PTR _crc_table[edx*4+4096]
+
+; 317 : } while (--len);
+
+ 002a7 83 ee 01 sub esi, 1
+ 002aa 75 e4 jne SHORT $LL10@crc32_big
+$LN9@crc32_big:
+
+; 318 : c = ~c;
+
+ 002ac f7 d0 not eax
+
+; 319 : return (unsigned long)(ZSWAP32(c));
+
+ 002ae 8b d0 mov edx, eax
+ 002b0 8b c8 mov ecx, eax
+ 002b2 c1 e1 10 shl ecx, 16 ; 00000010H
+ 002b5 81 e2 00 ff 00
+ 00 and edx, 65280 ; 0000ff00H
+ 002bb 03 d1 add edx, ecx
+ 002bd 8b c8 mov ecx, eax
+ 002bf c1 e9 08 shr ecx, 8
+ 002c2 c1 e2 08 shl edx, 8
+ 002c5 81 e1 00 ff 00
+ 00 and ecx, 65280 ; 0000ff00H
+ 002cb 5f pop edi
+ 002cc 03 d1 add edx, ecx
+ 002ce c1 e8 18 shr eax, 24 ; 00000018H
+ 002d1 5e pop esi
+ 002d2 03 c2 add eax, edx
+ 002d4 5b pop ebx
+
+; 320 : }
+
+ 002d5 8b e5 mov esp, ebp
+ 002d7 5d pop ebp
+ 002d8 c3 ret 0
+_crc32_big ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\crc32.c
+; COMDAT _gf2_matrix_times
+_TEXT SEGMENT
+_gf2_matrix_times PROC ; COMDAT
+; _mat$ = ecx
+; _vec$ = edx
+
+; 331 : unsigned long sum;
+; 332 :
+; 333 : sum = 0;
+
+ 00000 33 c0 xor eax, eax
+
+; 334 : while (vec) {
+
+ 00002 85 d2 test edx, edx
+ 00004 74 0e je SHORT $LN3@gf2_matrix
+$LL2@gf2_matrix:
+
+; 335 : if (vec & 1)
+
+ 00006 f6 c2 01 test dl, 1
+ 00009 74 02 je SHORT $LN4@gf2_matrix
+
+; 336 : sum ^= *mat;
+
+ 0000b 33 01 xor eax, DWORD PTR [ecx]
+$LN4@gf2_matrix:
+
+; 337 : vec >>= 1;
+; 338 : mat++;
+
+ 0000d 83 c1 04 add ecx, 4
+ 00010 d1 ea shr edx, 1
+ 00012 75 f2 jne SHORT $LL2@gf2_matrix
+$LN3@gf2_matrix:
+
+; 339 : }
+; 340 : return sum;
+; 341 : }
+
+ 00014 c3 ret 0
+_gf2_matrix_times ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\crc32.c
+; COMDAT _gf2_matrix_square
+_TEXT SEGMENT
+_mat$1$ = -4 ; size = 4
+_gf2_matrix_square PROC ; COMDAT
+; _square$ = ecx
+; _mat$ = edx
+
+; 347 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 51 push ecx
+ 00004 53 push ebx
+ 00005 8b c2 mov eax, edx
+ 00007 56 push esi
+ 00008 8b f1 mov esi, ecx
+ 0000a 89 45 fc mov DWORD PTR _mat$1$[ebp], eax
+
+; 348 : int n;
+; 349 :
+; 350 : for (n = 0; n < GF2_DIM; n++)
+
+ 0000d 8b d8 mov ebx, eax
+ 0000f 57 push edi
+ 00010 2b de sub ebx, esi
+ 00012 bf 20 00 00 00 mov edi, 32 ; 00000020H
+ 00017 66 0f 1f 84 00
+ 00 00 00 00 npad 9
+$LL4@gf2_matrix:
+
+; 351 : square[n] = gf2_matrix_times(mat, mat[n]);
+
+ 00020 8b 14 33 mov edx, DWORD PTR [ebx+esi]
+ 00023 8b c8 mov ecx, eax
+ 00025 e8 00 00 00 00 call _gf2_matrix_times
+ 0002a 89 06 mov DWORD PTR [esi], eax
+ 0002c 8d 76 04 lea esi, DWORD PTR [esi+4]
+ 0002f 8b 45 fc mov eax, DWORD PTR _mat$1$[ebp]
+ 00032 83 ef 01 sub edi, 1
+ 00035 75 e9 jne SHORT $LL4@gf2_matrix
+ 00037 5f pop edi
+ 00038 5e pop esi
+ 00039 5b pop ebx
+
+; 352 : }
+
+ 0003a 8b e5 mov esp, ebp
+ 0003c 5d pop ebp
+ 0003d c3 ret 0
+_gf2_matrix_square ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\crc32.c
+; COMDAT _crc32_combine_
+_TEXT SEGMENT
+_even$ = -260 ; size = 128
+_odd$ = -132 ; size = 128
+_crc2$1$ = -4 ; size = 4
+_len2$ = 8 ; size = 8
+_crc32_combine_ PROC ; COMDAT
+; _crc1$ = ecx
+; _crc2$ = edx
+
+; 359 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 81 ec 04 01 00
+ 00 sub esp, 260 ; 00000104H
+ 00009 53 push ebx
+ 0000a 56 push esi
+
+; 360 : int n;
+; 361 : unsigned long row;
+; 362 : unsigned long even[GF2_DIM]; /* even-power-of-two zeros operator */
+; 363 : unsigned long odd[GF2_DIM]; /* odd-power-of-two zeros operator */
+; 364 :
+; 365 : /* degenerate case (also disallow negative lengths) */
+; 366 : if (len2 <= 0)
+
+ 0000b 8b 75 0c mov esi, DWORD PTR _len2$[ebp+4]
+ 0000e 8b d9 mov ebx, ecx
+ 00010 89 55 fc mov DWORD PTR _crc2$1$[ebp], edx
+ 00013 57 push edi
+ 00014 8b 7d 08 mov edi, DWORD PTR _len2$[ebp]
+ 00017 85 f6 test esi, esi
+ 00019 7f 0e jg SHORT $LN8@crc32_comb
+ 0001b 0f 8c bf 00 00
+ 00 jl $LN23@crc32_comb
+ 00021 85 ff test edi, edi
+ 00023 0f 84 b7 00 00
+ 00 je $LN23@crc32_comb
+$LN8@crc32_comb:
+
+; 367 : return crc1;
+; 368 :
+; 369 : /* put operator for one zero bit in odd */
+; 370 : odd[0] = 0xedb88320UL; /* CRC-32 polynomial */
+; 371 : row = 1;
+
+ 00029 b9 01 00 00 00 mov ecx, 1
+ 0002e c7 85 7c ff ff
+ ff 20 83 b8 ed mov DWORD PTR _odd$[ebp], -306674912 ; edb88320H
+
+; 372 : for (n = 1; n < GF2_DIM; n++) {
+
+ 00038 8b c1 mov eax, ecx
+ 0003a 66 0f 1f 44 00
+ 00 npad 6
+$LL17@crc32_comb:
+
+; 373 : odd[n] = row;
+
+ 00040 89 8c 85 7c ff
+ ff ff mov DWORD PTR _odd$[ebp+eax*4], ecx
+ 00047 40 inc eax
+
+; 374 : row <<= 1;
+
+ 00048 03 c9 add ecx, ecx
+ 0004a 83 f8 20 cmp eax, 32 ; 00000020H
+ 0004d 7c f1 jl SHORT $LL17@crc32_comb
+
+; 375 : }
+; 376 :
+; 377 : /* put operator for two zero bits in even */
+; 378 : gf2_matrix_square(even, odd);
+
+ 0004f 8d 95 7c ff ff
+ ff lea edx, DWORD PTR _odd$[ebp]
+ 00055 8d 8d fc fe ff
+ ff lea ecx, DWORD PTR _even$[ebp]
+ 0005b e8 00 00 00 00 call _gf2_matrix_square
+
+; 379 :
+; 380 : /* put operator for four zero bits in odd */
+; 381 : gf2_matrix_square(odd, even);
+
+ 00060 8d 95 fc fe ff
+ ff lea edx, DWORD PTR _even$[ebp]
+ 00066 8d 8d 7c ff ff
+ ff lea ecx, DWORD PTR _odd$[ebp]
+ 0006c e8 00 00 00 00 call _gf2_matrix_square
+$LL7@crc32_comb:
+
+; 382 :
+; 383 : /* apply len2 zeros to crc1 (first square will put the operator for one
+; 384 : zero byte, eight zero bits, in even) */
+; 385 : do {
+; 386 : /* apply zeros operator for this bit of len2 */
+; 387 : gf2_matrix_square(even, odd);
+
+ 00071 8d 95 7c ff ff
+ ff lea edx, DWORD PTR _odd$[ebp]
+ 00077 8d 8d fc fe ff
+ ff lea ecx, DWORD PTR _even$[ebp]
+ 0007d e8 00 00 00 00 call _gf2_matrix_square
+
+; 388 : if (len2 & 1)
+
+ 00082 8b c7 mov eax, edi
+ 00084 83 e0 01 and eax, 1
+ 00087 83 c8 00 or eax, 0
+ 0008a 74 0f je SHORT $LN9@crc32_comb
+
+; 389 : crc1 = gf2_matrix_times(even, crc1);
+
+ 0008c 8b d3 mov edx, ebx
+ 0008e 8d 8d fc fe ff
+ ff lea ecx, DWORD PTR _even$[ebp]
+ 00094 e8 00 00 00 00 call _gf2_matrix_times
+ 00099 8b d8 mov ebx, eax
+$LN9@crc32_comb:
+
+; 390 : len2 >>= 1;
+
+ 0009b 0f ac f7 01 shrd edi, esi, 1
+ 0009f d1 fe sar esi, 1
+
+; 391 :
+; 392 : /* if no more bits set, then done */
+; 393 : if (len2 == 0)
+
+ 000a1 8b c7 mov eax, edi
+ 000a3 0b c6 or eax, esi
+ 000a5 74 36 je SHORT $LN6@crc32_comb
+
+; 394 : break;
+; 395 :
+; 396 : /* another iteration of the loop with odd and even swapped */
+; 397 : gf2_matrix_square(odd, even);
+
+ 000a7 8d 95 fc fe ff
+ ff lea edx, DWORD PTR _even$[ebp]
+ 000ad 8d 8d 7c ff ff
+ ff lea ecx, DWORD PTR _odd$[ebp]
+ 000b3 e8 00 00 00 00 call _gf2_matrix_square
+
+; 398 : if (len2 & 1)
+
+ 000b8 8b c7 mov eax, edi
+ 000ba 83 e0 01 and eax, 1
+ 000bd 83 c8 00 or eax, 0
+ 000c0 74 0f je SHORT $LN11@crc32_comb
+
+; 399 : crc1 = gf2_matrix_times(odd, crc1);
+
+ 000c2 8b d3 mov edx, ebx
+ 000c4 8d 8d 7c ff ff
+ ff lea ecx, DWORD PTR _odd$[ebp]
+ 000ca e8 00 00 00 00 call _gf2_matrix_times
+ 000cf 8b d8 mov ebx, eax
+$LN11@crc32_comb:
+
+; 400 : len2 >>= 1;
+
+ 000d1 0f ac f7 01 shrd edi, esi, 1
+ 000d5 d1 fe sar esi, 1
+
+; 401 :
+; 402 : /* if no more bits set, then done */
+; 403 : } while (len2 != 0);
+
+ 000d7 8b c7 mov eax, edi
+ 000d9 0b c6 or eax, esi
+ 000db 75 94 jne SHORT $LL7@crc32_comb
+$LN6@crc32_comb:
+
+; 404 :
+; 405 : /* return combined crc */
+; 406 : crc1 ^= crc2;
+
+ 000dd 33 5d fc xor ebx, DWORD PTR _crc2$1$[ebp]
+$LN23@crc32_comb:
+ 000e0 5f pop edi
+ 000e1 5e pop esi
+
+; 407 : return crc1;
+
+ 000e2 8b c3 mov eax, ebx
+ 000e4 5b pop ebx
+
+; 408 : }
+
+ 000e5 8b e5 mov esp, ebp
+ 000e7 5d pop ebp
+ 000e8 c3 ret 0
+_crc32_combine_ ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\crc32.c
+; COMDAT _crc32_combine@12
+_TEXT SEGMENT
+_crc1$ = 8 ; size = 4
+_crc2$ = 12 ; size = 4
+_len2$ = 16 ; size = 4
+_crc32_combine@12 PROC ; COMDAT
+
+; 415 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 416 : return crc32_combine_(crc1, crc2, len2);
+
+ 00003 8b 45 10 mov eax, DWORD PTR _len2$[ebp]
+ 00006 8b 4d 08 mov ecx, DWORD PTR _crc1$[ebp]
+ 00009 99 cdq
+ 0000a 52 push edx
+ 0000b 8b 55 0c mov edx, DWORD PTR _crc2$[ebp]
+ 0000e 50 push eax
+ 0000f e8 00 00 00 00 call _crc32_combine_
+ 00014 83 c4 08 add esp, 8
+
+; 417 : }
+
+ 00017 5d pop ebp
+ 00018 c2 0c 00 ret 12 ; 0000000cH
+_crc32_combine@12 ENDP
+_TEXT ENDS
+END
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/crc32.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/crc32.obj
new file mode 100644
index 0000000000..5df3a63aaf
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/crc32.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/deflate.cod b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/deflate.cod
new file mode 100644
index 0000000000..ec19286e9f
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/deflate.cod
@@ -0,0 +1,6858 @@
+; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.23506.0
+
+ TITLE d:\downloads\tgl-master\tgl-master\zlib\deflate.c
+ .686P
+ .XMM
+ include listing.inc
+ .model flat
+
+INCLUDELIB OLDNAMES
+
+?my_version@?1??deflateInit2_@@9@9 DB '1.2.8', 00H ; `deflateInit2_'::`2'::my_version
+ ORG $+2
+_configuration_table DW 00H
+ DW 00H
+ DW 00H
+ DW 00H
+ DD FLAT:_deflate_stored
+ DW 04H
+ DW 04H
+ DW 08H
+ DW 04H
+ DD FLAT:_deflate_fast
+ DW 04H
+ DW 05H
+ DW 010H
+ DW 08H
+ DD FLAT:_deflate_fast
+ DW 04H
+ DW 06H
+ DW 020H
+ DW 020H
+ DD FLAT:_deflate_fast
+ DW 04H
+ DW 04H
+ DW 010H
+ DW 010H
+ DD FLAT:_deflate_slow
+ DW 08H
+ DW 010H
+ DW 020H
+ DW 020H
+ DD FLAT:_deflate_slow
+ DW 08H
+ DW 010H
+ DW 080H
+ DW 080H
+ DD FLAT:_deflate_slow
+ DW 08H
+ DW 020H
+ DW 080H
+ DW 0100H
+ DD FLAT:_deflate_slow
+ DW 020H
+ DW 080H
+ DW 0102H
+ DW 0400H
+ DD FLAT:_deflate_slow
+ DW 020H
+ DW 0102H
+ DW 0102H
+ DW 01000H
+ DD FLAT:_deflate_slow
+PUBLIC _deflateCopy@8
+PUBLIC _deflateBound@8
+PUBLIC _deflateTune@20
+PUBLIC _deflateParams@12
+PUBLIC _deflatePrime@12
+PUBLIC _deflatePending@12
+PUBLIC _deflateSetHeader@8
+PUBLIC _deflateReset@4
+PUBLIC _deflateResetKeep@4
+PUBLIC _deflateSetDictionary@12
+PUBLIC _deflateInit2_@32
+PUBLIC _deflateInit_@16
+PUBLIC _deflateEnd@4
+PUBLIC _deflate@8
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\deflate.c
+; COMDAT _deflate@8
+_TEXT SEGMENT
+_old_flush$1$ = -4 ; size = 4
+_val$1$ = 8 ; size = 4
+_val$1$ = 8 ; size = 4
+_beg$1$ = 8 ; size = 4
+_strm$ = 8 ; size = 4
+_flush$ = 12 ; size = 4
+_deflate@8 PROC ; COMDAT
+
+; 668 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 51 push ecx
+ 00004 56 push esi
+ 00005 57 push edi
+
+; 669 : int old_flush; /* value of flush param for previous deflate call */
+; 670 : deflate_state *s;
+; 671 :
+; 672 : if (strm == Z_NULL || strm->state == Z_NULL ||
+; 673 : flush > Z_BLOCK || flush < 0) {
+
+ 00006 8b 7d 08 mov edi, DWORD PTR _strm$[ebp]
+ 00009 85 ff test edi, edi
+ 0000b 0f 84 46 08 00
+ 00 je $LN11@deflate
+ 00011 8b 77 1c mov esi, DWORD PTR [edi+28]
+ 00014 85 f6 test esi, esi
+ 00016 0f 84 3b 08 00
+ 00 je $LN11@deflate
+ 0001c 8b 45 0c mov eax, DWORD PTR _flush$[ebp]
+ 0001f 83 f8 05 cmp eax, 5
+ 00022 0f 87 2f 08 00
+ 00 ja $LN11@deflate
+
+; 674 : return Z_STREAM_ERROR;
+; 675 : }
+; 676 : s = strm->state;
+; 677 :
+; 678 : if (strm->next_out == Z_NULL ||
+; 679 : (strm->next_in == Z_NULL && strm->avail_in != 0) ||
+
+ 00028 83 7f 0c 00 cmp DWORD PTR [edi+12], 0
+ 0002c 0f 84 1d 08 00
+ 00 je $LN13@deflate
+ 00032 83 3f 00 cmp DWORD PTR [edi], 0
+ 00035 75 0a jne SHORT $LN14@deflate
+ 00037 83 7f 04 00 cmp DWORD PTR [edi+4], 0
+ 0003b 0f 85 0e 08 00
+ 00 jne $LN13@deflate
+$LN14@deflate:
+ 00041 8b 4e 04 mov ecx, DWORD PTR [esi+4]
+ 00044 81 f9 9a 02 00
+ 00 cmp ecx, 666 ; 0000029aH
+ 0004a 75 09 jne SHORT $LN12@deflate
+ 0004c 83 f8 04 cmp eax, 4
+ 0004f 0f 85 fa 07 00
+ 00 jne $LN13@deflate
+$LN12@deflate:
+
+; 682 : }
+; 683 : if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR);
+
+ 00055 83 7f 10 00 cmp DWORD PTR [edi+16], 0
+ 00059 75 15 jne SHORT $LN15@deflate
+ 0005b a1 1c 00 00 00 mov eax, DWORD PTR _z_errmsg+28
+ 00060 89 47 18 mov DWORD PTR [edi+24], eax
+ 00063 b8 fb ff ff ff mov eax, -5 ; fffffffbH
+ 00068 5f pop edi
+ 00069 5e pop esi
+
+; 976 : }
+
+ 0006a 8b e5 mov esp, ebp
+ 0006c 5d pop ebp
+ 0006d c2 08 00 ret 8
+$LN15@deflate:
+
+; 684 :
+; 685 : s->strm = strm; /* just in case */
+; 686 : old_flush = s->last_flush;
+
+ 00070 8b 56 28 mov edx, DWORD PTR [esi+40]
+ 00073 89 3e mov DWORD PTR [esi], edi
+ 00075 89 55 fc mov DWORD PTR _old_flush$1$[ebp], edx
+
+; 687 : s->last_flush = flush;
+
+ 00078 89 46 28 mov DWORD PTR [esi+40], eax
+ 0007b 53 push ebx
+
+; 688 :
+; 689 : /* Write the header */
+; 690 : if (s->status == INIT_STATE) {
+
+ 0007c 83 f9 2a cmp ecx, 42 ; 0000002aH
+ 0007f 0f 85 95 02 00
+ 00 jne $LN18@deflate
+
+; 691 : #ifdef GZIP
+; 692 : if (s->wrap == 2) {
+
+ 00085 83 7e 18 02 cmp DWORD PTR [esi+24], 2
+ 00089 0f 85 ef 01 00
+ 00 jne $LN17@deflate
+
+; 693 : strm->adler = crc32(0L, Z_NULL, 0);
+
+ 0008f 6a 00 push 0
+ 00091 6a 00 push 0
+ 00093 6a 00 push 0
+ 00095 e8 00 00 00 00 call _crc32@12
+ 0009a 89 47 30 mov DWORD PTR [edi+48], eax
+
+; 694 : put_byte(s, 31);
+
+ 0009d 8b 46 14 mov eax, DWORD PTR [esi+20]
+ 000a0 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 000a3 c6 04 01 1f mov BYTE PTR [ecx+eax], 31 ; 0000001fH
+ 000a7 ff 46 14 inc DWORD PTR [esi+20]
+ 000aa 8b 4e 14 mov ecx, DWORD PTR [esi+20]
+
+; 695 : put_byte(s, 139);
+
+ 000ad 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 000b0 c6 04 01 8b mov BYTE PTR [ecx+eax], 139 ; 0000008bH
+ 000b4 ff 46 14 inc DWORD PTR [esi+20]
+ 000b7 8b 4e 14 mov ecx, DWORD PTR [esi+20]
+
+; 696 : put_byte(s, 8);
+
+ 000ba 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 000bd c6 04 01 08 mov BYTE PTR [ecx+eax], 8
+ 000c1 ff 46 14 inc DWORD PTR [esi+20]
+
+; 697 : if (s->gzhead == Z_NULL) {
+
+ 000c4 8b 56 1c mov edx, DWORD PTR [esi+28]
+ 000c7 8b 5e 14 mov ebx, DWORD PTR [esi+20]
+ 000ca 85 d2 test edx, edx
+ 000cc 0f 85 85 00 00
+ 00 jne $LN19@deflate
+
+; 698 : put_byte(s, 0);
+
+ 000d2 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 000d5 88 14 03 mov BYTE PTR [ebx+eax], dl
+ 000d8 ff 46 14 inc DWORD PTR [esi+20]
+ 000db 8b 4e 14 mov ecx, DWORD PTR [esi+20]
+
+; 699 : put_byte(s, 0);
+
+ 000de 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 000e1 88 14 01 mov BYTE PTR [ecx+eax], dl
+ 000e4 ff 46 14 inc DWORD PTR [esi+20]
+ 000e7 8b 4e 14 mov ecx, DWORD PTR [esi+20]
+
+; 700 : put_byte(s, 0);
+
+ 000ea 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 000ed 88 14 01 mov BYTE PTR [ecx+eax], dl
+ 000f0 ff 46 14 inc DWORD PTR [esi+20]
+ 000f3 8b 4e 14 mov ecx, DWORD PTR [esi+20]
+
+; 701 : put_byte(s, 0);
+
+ 000f6 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 000f9 88 14 01 mov BYTE PTR [ecx+eax], dl
+ 000fc ff 46 14 inc DWORD PTR [esi+20]
+ 000ff 8b 4e 14 mov ecx, DWORD PTR [esi+20]
+
+; 702 : put_byte(s, 0);
+
+ 00102 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 00105 88 14 01 mov BYTE PTR [ecx+eax], dl
+ 00108 ff 46 14 inc DWORD PTR [esi+20]
+
+; 703 : put_byte(s, s->level == 9 ? 2 :
+
+ 0010b 8b 86 84 00 00
+ 00 mov eax, DWORD PTR [esi+132]
+ 00111 8b 56 14 mov edx, DWORD PTR [esi+20]
+ 00114 83 f8 09 cmp eax, 9
+ 00117 75 05 jne SHORT $LN88@deflate
+ 00119 8d 48 f9 lea ecx, DWORD PTR [eax-7]
+ 0011c eb 17 jmp SHORT $LN87@deflate
+$LN88@deflate:
+ 0011e 83 be 88 00 00
+ 00 02 cmp DWORD PTR [esi+136], 2
+ 00125 7d 09 jge SHORT $LN86@deflate
+ 00127 83 f8 02 cmp eax, 2
+ 0012a 7c 04 jl SHORT $LN86@deflate
+ 0012c 33 c9 xor ecx, ecx
+ 0012e eb 05 jmp SHORT $LN87@deflate
+$LN86@deflate:
+ 00130 b9 04 00 00 00 mov ecx, 4
+$LN87@deflate:
+ 00135 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 00138 88 0c 02 mov BYTE PTR [edx+eax], cl
+ 0013b ff 46 14 inc DWORD PTR [esi+20]
+ 0013e 8b 4e 14 mov ecx, DWORD PTR [esi+20]
+
+; 704 : (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
+; 705 : 4 : 0));
+; 706 : put_byte(s, OS_CODE);
+
+ 00141 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 00144 c6 04 01 0b mov BYTE PTR [ecx+eax], 11 ; 0000000bH
+ 00148 ff 46 14 inc DWORD PTR [esi+20]
+
+; 707 : s->status = BUSY_STATE;
+
+ 0014b c7 46 04 71 00
+ 00 00 mov DWORD PTR [esi+4], 113 ; 00000071H
+
+; 708 : }
+
+ 00152 e9 c3 01 00 00 jmp $LN18@deflate
+$LN19@deflate:
+
+; 709 : else {
+; 710 : put_byte(s, (s->gzhead->text ? 1 : 0) +
+
+ 00157 8b 4a 24 mov ecx, DWORD PTR [edx+36]
+ 0015a 8b 42 2c mov eax, DWORD PTR [edx+44]
+ 0015d f7 d9 neg ecx
+ 0015f 1a c9 sbb cl, cl
+ 00161 80 e1 10 and cl, 16 ; 00000010H
+ 00164 f7 d8 neg eax
+ 00166 1a c0 sbb al, al
+ 00168 24 02 and al, 2
+ 0016a 02 c8 add cl, al
+ 0016c 8b 42 1c mov eax, DWORD PTR [edx+28]
+ 0016f f7 d8 neg eax
+ 00171 1a c0 sbb al, al
+ 00173 24 08 and al, 8
+ 00175 02 c8 add cl, al
+ 00177 8b 42 10 mov eax, DWORD PTR [edx+16]
+ 0017a f7 d8 neg eax
+ 0017c 1a c0 sbb al, al
+ 0017e 24 04 and al, 4
+ 00180 02 c8 add cl, al
+ 00182 83 3a 00 cmp DWORD PTR [edx], 0
+ 00185 0f 95 c0 setne al
+ 00188 02 c8 add cl, al
+ 0018a 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 0018d 88 0c 03 mov BYTE PTR [ebx+eax], cl
+ 00190 ff 46 14 inc DWORD PTR [esi+20]
+ 00193 8b 56 14 mov edx, DWORD PTR [esi+20]
+
+; 711 : (s->gzhead->hcrc ? 2 : 0) +
+; 712 : (s->gzhead->extra == Z_NULL ? 0 : 4) +
+; 713 : (s->gzhead->name == Z_NULL ? 0 : 8) +
+; 714 : (s->gzhead->comment == Z_NULL ? 0 : 16)
+; 715 : );
+; 716 : put_byte(s, (Byte)(s->gzhead->time & 0xff));
+
+ 00196 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 00199 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 0019c 0f b6 40 04 movzx eax, BYTE PTR [eax+4]
+ 001a0 88 04 0a mov BYTE PTR [edx+ecx], al
+ 001a3 ff 46 14 inc DWORD PTR [esi+20]
+ 001a6 8b 56 14 mov edx, DWORD PTR [esi+20]
+
+; 717 : put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff));
+
+ 001a9 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 001ac 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 001af 0f b6 40 05 movzx eax, BYTE PTR [eax+5]
+ 001b3 88 04 0a mov BYTE PTR [edx+ecx], al
+ 001b6 ff 46 14 inc DWORD PTR [esi+20]
+ 001b9 8b 56 14 mov edx, DWORD PTR [esi+20]
+
+; 718 : put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff));
+
+ 001bc 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 001bf 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 001c2 0f b6 40 06 movzx eax, BYTE PTR [eax+6]
+ 001c6 88 04 0a mov BYTE PTR [edx+ecx], al
+ 001c9 ff 46 14 inc DWORD PTR [esi+20]
+
+; 719 : put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff));
+
+ 001cc 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 001cf 8b 56 14 mov edx, DWORD PTR [esi+20]
+ 001d2 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 001d5 0f b6 40 07 movzx eax, BYTE PTR [eax+7]
+ 001d9 88 04 0a mov BYTE PTR [edx+ecx], al
+ 001dc ff 46 14 inc DWORD PTR [esi+20]
+
+; 720 : put_byte(s, s->level == 9 ? 2 :
+
+ 001df 8b 86 84 00 00
+ 00 mov eax, DWORD PTR [esi+132]
+ 001e5 8b 56 14 mov edx, DWORD PTR [esi+20]
+ 001e8 83 f8 09 cmp eax, 9
+ 001eb 75 05 jne SHORT $LN92@deflate
+ 001ed 8d 48 f9 lea ecx, DWORD PTR [eax-7]
+ 001f0 eb 17 jmp SHORT $LN91@deflate
+$LN92@deflate:
+ 001f2 83 be 88 00 00
+ 00 02 cmp DWORD PTR [esi+136], 2
+ 001f9 7d 09 jge SHORT $LN90@deflate
+ 001fb 83 f8 02 cmp eax, 2
+ 001fe 7c 04 jl SHORT $LN90@deflate
+ 00200 33 c9 xor ecx, ecx
+ 00202 eb 05 jmp SHORT $LN91@deflate
+$LN90@deflate:
+ 00204 b9 04 00 00 00 mov ecx, 4
+$LN91@deflate:
+ 00209 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 0020c 88 0c 02 mov BYTE PTR [edx+eax], cl
+ 0020f ff 46 14 inc DWORD PTR [esi+20]
+
+; 721 : (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
+; 722 : 4 : 0));
+; 723 : put_byte(s, s->gzhead->os & 0xff);
+
+ 00212 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 00215 8b 56 14 mov edx, DWORD PTR [esi+20]
+ 00218 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 0021b 8a 40 0c mov al, BYTE PTR [eax+12]
+ 0021e 88 04 0a mov BYTE PTR [edx+ecx], al
+
+; 724 : if (s->gzhead->extra != Z_NULL) {
+
+ 00221 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 00224 ff 46 14 inc DWORD PTR [esi+20]
+ 00227 8b 56 14 mov edx, DWORD PTR [esi+20]
+ 0022a 83 78 10 00 cmp DWORD PTR [eax+16], 0
+ 0022e 74 23 je SHORT $LN21@deflate
+
+; 725 : put_byte(s, s->gzhead->extra_len & 0xff);
+
+ 00230 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 00233 0f b6 40 14 movzx eax, BYTE PTR [eax+20]
+ 00237 88 04 0a mov BYTE PTR [edx+ecx], al
+ 0023a ff 46 14 inc DWORD PTR [esi+20]
+
+; 726 : put_byte(s, (s->gzhead->extra_len >> 8) & 0xff);
+
+ 0023d 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 00240 8b 56 14 mov edx, DWORD PTR [esi+20]
+ 00243 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 00246 0f b6 40 15 movzx eax, BYTE PTR [eax+21]
+ 0024a 88 04 0a mov BYTE PTR [edx+ecx], al
+ 0024d ff 46 14 inc DWORD PTR [esi+20]
+ 00250 8b 56 14 mov edx, DWORD PTR [esi+20]
+$LN21@deflate:
+
+; 727 : }
+; 728 : if (s->gzhead->hcrc)
+
+ 00253 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 00256 83 78 2c 00 cmp DWORD PTR [eax+44], 0
+ 0025a 74 0f je SHORT $LN22@deflate
+
+; 729 : strm->adler = crc32(strm->adler, s->pending_buf,
+
+ 0025c 52 push edx
+ 0025d ff 76 08 push DWORD PTR [esi+8]
+ 00260 ff 77 30 push DWORD PTR [edi+48]
+ 00263 e8 00 00 00 00 call _crc32@12
+ 00268 89 47 30 mov DWORD PTR [edi+48], eax
+$LN22@deflate:
+
+; 730 : s->pending);
+; 731 : s->gzindex = 0;
+
+ 0026b c7 46 20 00 00
+ 00 00 mov DWORD PTR [esi+32], 0
+
+; 732 : s->status = EXTRA_STATE;
+
+ 00272 c7 46 04 45 00
+ 00 00 mov DWORD PTR [esi+4], 69 ; 00000045H
+
+; 733 : }
+; 734 : }
+
+ 00279 e9 9c 00 00 00 jmp $LN18@deflate
+$LN17@deflate:
+
+; 735 : else
+; 736 : #endif
+; 737 : {
+; 738 : uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8;
+
+ 0027e 8b 4e 30 mov ecx, DWORD PTR [esi+48]
+ 00281 83 e9 08 sub ecx, 8
+ 00284 c1 e1 0c shl ecx, 12 ; 0000000cH
+ 00287 81 c1 00 08 00
+ 00 add ecx, 2048 ; 00000800H
+
+; 739 : uInt level_flags;
+; 740 :
+; 741 : if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2)
+
+ 0028d 83 be 88 00 00
+ 00 02 cmp DWORD PTR [esi+136], 2
+ 00294 7d 24 jge SHORT $LN25@deflate
+ 00296 8b 96 84 00 00
+ 00 mov edx, DWORD PTR [esi+132]
+ 0029c 83 fa 02 cmp edx, 2
+ 0029f 7c 19 jl SHORT $LN25@deflate
+
+; 743 : else if (s->level < 6)
+
+ 002a1 83 fa 06 cmp edx, 6
+ 002a4 7d 07 jge SHORT $LN26@deflate
+
+; 744 : level_flags = 1;
+
+ 002a6 b8 01 00 00 00 mov eax, 1
+ 002ab eb 0f jmp SHORT $LN29@deflate
+$LN26@deflate:
+
+; 745 : else if (s->level == 6)
+
+ 002ad 33 c0 xor eax, eax
+ 002af 83 fa 06 cmp edx, 6
+ 002b2 0f 95 c0 setne al
+ 002b5 83 c0 02 add eax, 2
+
+; 746 : level_flags = 2;
+; 747 : else
+; 748 : level_flags = 3;
+
+ 002b8 eb 02 jmp SHORT $LN29@deflate
+$LN25@deflate:
+
+; 742 : level_flags = 0;
+
+ 002ba 33 c0 xor eax, eax
+$LN29@deflate:
+
+; 749 : header |= (level_flags << 6);
+
+ 002bc c1 e0 06 shl eax, 6
+ 002bf 0b c8 or ecx, eax
+
+; 750 : if (s->strstart != 0) header |= PRESET_DICT;
+
+ 002c1 83 7e 6c 00 cmp DWORD PTR [esi+108], 0
+ 002c5 74 03 je SHORT $LN30@deflate
+ 002c7 83 c9 20 or ecx, 32 ; 00000020H
+$LN30@deflate:
+
+; 751 : header += 31 - (header % 31);
+
+ 002ca b8 85 10 42 08 mov eax, 138547333 ; 08421085H
+
+; 752 :
+; 753 : s->status = BUSY_STATE;
+
+ 002cf c7 46 04 71 00
+ 00 00 mov DWORD PTR [esi+4], 113 ; 00000071H
+ 002d6 f7 e1 mul ecx
+ 002d8 2b ca sub ecx, edx
+ 002da d1 e9 shr ecx, 1
+ 002dc 03 ca add ecx, edx
+ 002de c1 e9 04 shr ecx, 4
+
+; 754 : putShortMSB(s, header);
+
+ 002e1 41 inc ecx
+ 002e2 8b d1 mov edx, ecx
+ 002e4 c1 e2 05 shl edx, 5
+ 002e7 2b d1 sub edx, ecx
+ 002e9 8b ce mov ecx, esi
+ 002eb e8 00 00 00 00 call _putShortMSB
+
+; 755 :
+; 756 : /* Save the adler32 of the preset dictionary: */
+; 757 : if (s->strstart != 0) {
+
+ 002f0 83 7e 6c 00 cmp DWORD PTR [esi+108], 0
+ 002f4 74 16 je SHORT $LN31@deflate
+
+; 758 : putShortMSB(s, (uInt)(strm->adler >> 16));
+
+ 002f6 0f b7 57 32 movzx edx, WORD PTR [edi+50]
+ 002fa 8b ce mov ecx, esi
+ 002fc e8 00 00 00 00 call _putShortMSB
+
+; 759 : putShortMSB(s, (uInt)(strm->adler & 0xffff));
+
+ 00301 0f b7 57 30 movzx edx, WORD PTR [edi+48]
+ 00305 8b ce mov ecx, esi
+ 00307 e8 00 00 00 00 call _putShortMSB
+$LN31@deflate:
+
+; 760 : }
+; 761 : strm->adler = adler32(0L, Z_NULL, 0);
+
+ 0030c 6a 00 push 0
+ 0030e 6a 00 push 0
+ 00310 6a 00 push 0
+ 00312 e8 00 00 00 00 call _adler32@12
+ 00317 89 47 30 mov DWORD PTR [edi+48], eax
+$LN18@deflate:
+
+; 762 : }
+; 763 : }
+; 764 : #ifdef GZIP
+; 765 : if (s->status == EXTRA_STATE) {
+
+ 0031a 83 7e 04 45 cmp DWORD PTR [esi+4], 69 ; 00000045H
+ 0031e 0f 85 bd 00 00
+ 00 jne $LN34@deflate
+
+; 766 : if (s->gzhead->extra != Z_NULL) {
+
+ 00324 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 00327 83 78 10 00 cmp DWORD PTR [eax+16], 0
+ 0032b 0f 84 a9 00 00
+ 00 je $LN33@deflate
+
+; 767 : uInt beg = s->pending; /* start of bytes to update crc */
+; 768 :
+; 769 : while (s->gzindex < (s->gzhead->extra_len & 0xffff)) {
+
+ 00331 0f b7 40 14 movzx eax, WORD PTR [eax+20]
+ 00335 8b 4e 14 mov ecx, DWORD PTR [esi+20]
+ 00338 89 4d 08 mov DWORD PTR _beg$1$[ebp], ecx
+ 0033b 39 46 20 cmp DWORD PTR [esi+32], eax
+ 0033e 73 64 jae SHORT $LN111@deflate
+$LL2@deflate:
+
+; 770 : if (s->pending == s->pending_buf_size) {
+
+ 00340 8b 5e 14 mov ebx, DWORD PTR [esi+20]
+ 00343 3b 5e 0c cmp ebx, DWORD PTR [esi+12]
+ 00346 75 35 jne SHORT $LN37@deflate
+
+; 771 : if (s->gzhead->hcrc && s->pending > beg)
+
+ 00348 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 0034b 83 78 2c 00 cmp DWORD PTR [eax+44], 0
+ 0034f 74 18 je SHORT $LN36@deflate
+ 00351 3b d9 cmp ebx, ecx
+ 00353 76 14 jbe SHORT $LN36@deflate
+
+; 772 : strm->adler = crc32(strm->adler, s->pending_buf + beg,
+
+ 00355 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 00358 2b d9 sub ebx, ecx
+ 0035a 53 push ebx
+ 0035b 03 c1 add eax, ecx
+ 0035d 50 push eax
+ 0035e ff 77 30 push DWORD PTR [edi+48]
+ 00361 e8 00 00 00 00 call _crc32@12
+ 00366 89 47 30 mov DWORD PTR [edi+48], eax
+$LN36@deflate:
+
+; 773 : s->pending - beg);
+; 774 : flush_pending(strm);
+
+ 00369 8b cf mov ecx, edi
+ 0036b e8 00 00 00 00 call _flush_pending
+
+; 775 : beg = s->pending;
+
+ 00370 8b 5e 14 mov ebx, DWORD PTR [esi+20]
+ 00373 8b cb mov ecx, ebx
+ 00375 89 4d 08 mov DWORD PTR _beg$1$[ebp], ecx
+
+; 776 : if (s->pending == s->pending_buf_size)
+
+ 00378 3b 5e 0c cmp ebx, DWORD PTR [esi+12]
+ 0037b 74 27 je SHORT $LN111@deflate
+$LN37@deflate:
+
+; 777 : break;
+; 778 : }
+; 779 : put_byte(s, s->gzhead->extra[s->gzindex]);
+
+ 0037d 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 00380 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 00383 8b 50 10 mov edx, DWORD PTR [eax+16]
+ 00386 8b 46 20 mov eax, DWORD PTR [esi+32]
+ 00389 8a 04 02 mov al, BYTE PTR [edx+eax]
+ 0038c 88 04 0b mov BYTE PTR [ebx+ecx], al
+ 0038f ff 46 14 inc DWORD PTR [esi+20]
+
+; 780 : s->gzindex++;
+
+ 00392 ff 46 20 inc DWORD PTR [esi+32]
+ 00395 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 00398 8b 4d 08 mov ecx, DWORD PTR _beg$1$[ebp]
+ 0039b 0f b7 40 14 movzx eax, WORD PTR [eax+20]
+ 0039f 39 46 20 cmp DWORD PTR [esi+32], eax
+ 003a2 72 9c jb SHORT $LL2@deflate
+$LN111@deflate:
+
+; 781 : }
+; 782 : if (s->gzhead->hcrc && s->pending > beg)
+
+ 003a4 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 003a7 83 78 2c 00 cmp DWORD PTR [eax+44], 0
+ 003ab 74 1b je SHORT $LN38@deflate
+ 003ad 8b 46 14 mov eax, DWORD PTR [esi+20]
+ 003b0 3b c1 cmp eax, ecx
+ 003b2 76 14 jbe SHORT $LN38@deflate
+
+; 783 : strm->adler = crc32(strm->adler, s->pending_buf + beg,
+
+ 003b4 2b c1 sub eax, ecx
+ 003b6 50 push eax
+ 003b7 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 003ba 03 c1 add eax, ecx
+ 003bc 50 push eax
+ 003bd ff 77 30 push DWORD PTR [edi+48]
+ 003c0 e8 00 00 00 00 call _crc32@12
+ 003c5 89 47 30 mov DWORD PTR [edi+48], eax
+$LN38@deflate:
+
+; 784 : s->pending - beg);
+; 785 : if (s->gzindex == s->gzhead->extra_len) {
+
+ 003c8 8b 4e 1c mov ecx, DWORD PTR [esi+28]
+ 003cb 8b 46 20 mov eax, DWORD PTR [esi+32]
+ 003ce 3b 41 14 cmp eax, DWORD PTR [ecx+20]
+ 003d1 75 0e jne SHORT $LN34@deflate
+
+; 786 : s->gzindex = 0;
+
+ 003d3 c7 46 20 00 00
+ 00 00 mov DWORD PTR [esi+32], 0
+$LN33@deflate:
+
+; 787 : s->status = NAME_STATE;
+; 788 : }
+; 789 : }
+; 790 : else
+; 791 : s->status = NAME_STATE;
+
+ 003da c7 46 04 49 00
+ 00 00 mov DWORD PTR [esi+4], 73 ; 00000049H
+$LN34@deflate:
+
+; 792 : }
+; 793 : if (s->status == NAME_STATE) {
+
+ 003e1 83 7e 04 49 cmp DWORD PTR [esi+4], 73 ; 00000049H
+ 003e5 0f 85 b6 00 00
+ 00 jne $LN42@deflate
+
+; 794 : if (s->gzhead->name != Z_NULL) {
+
+ 003eb 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 003ee 83 78 1c 00 cmp DWORD PTR [eax+28], 0
+ 003f2 0f 84 a2 00 00
+ 00 je $LN41@deflate
+
+; 795 : uInt beg = s->pending; /* start of bytes to update crc */
+
+ 003f8 8b 5e 14 mov ebx, DWORD PTR [esi+20]
+ 003fb 0f 1f 44 00 00 npad 5
+$LL6@deflate:
+
+; 796 : int val;
+; 797 :
+; 798 : do {
+; 799 : if (s->pending == s->pending_buf_size) {
+
+ 00400 8b 56 14 mov edx, DWORD PTR [esi+20]
+ 00403 3b 56 0c cmp edx, DWORD PTR [esi+12]
+ 00406 75 32 jne SHORT $LN45@deflate
+
+; 800 : if (s->gzhead->hcrc && s->pending > beg)
+
+ 00408 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 0040b 83 78 2c 00 cmp DWORD PTR [eax+44], 0
+ 0040f 74 18 je SHORT $LN44@deflate
+ 00411 3b d3 cmp edx, ebx
+ 00413 76 14 jbe SHORT $LN44@deflate
+
+; 801 : strm->adler = crc32(strm->adler, s->pending_buf + beg,
+
+ 00415 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 00418 2b d3 sub edx, ebx
+ 0041a 52 push edx
+ 0041b 03 c3 add eax, ebx
+ 0041d 50 push eax
+ 0041e ff 77 30 push DWORD PTR [edi+48]
+ 00421 e8 00 00 00 00 call _crc32@12
+ 00426 89 47 30 mov DWORD PTR [edi+48], eax
+$LN44@deflate:
+
+; 802 : s->pending - beg);
+; 803 : flush_pending(strm);
+
+ 00429 8b cf mov ecx, edi
+ 0042b e8 00 00 00 00 call _flush_pending
+
+; 804 : beg = s->pending;
+
+ 00430 8b 56 14 mov edx, DWORD PTR [esi+20]
+ 00433 8b da mov ebx, edx
+
+; 805 : if (s->pending == s->pending_buf_size) {
+
+ 00435 3b 56 0c cmp edx, DWORD PTR [esi+12]
+ 00438 74 28 je SHORT $LN102@deflate
+$LN45@deflate:
+
+; 807 : break;
+; 808 : }
+; 809 : }
+; 810 : val = s->gzhead->name[s->gzindex++];
+
+ 0043a 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 0043d 8b 4e 20 mov ecx, DWORD PTR [esi+32]
+ 00440 8b 40 1c mov eax, DWORD PTR [eax+28]
+ 00443 0f b6 04 08 movzx eax, BYTE PTR [eax+ecx]
+ 00447 89 45 08 mov DWORD PTR _val$1$[ebp], eax
+ 0044a 8d 41 01 lea eax, DWORD PTR [ecx+1]
+
+; 811 : put_byte(s, val);
+
+ 0044d 8b 4d 08 mov ecx, DWORD PTR _val$1$[ebp]
+ 00450 89 46 20 mov DWORD PTR [esi+32], eax
+ 00453 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 00456 88 0c 02 mov BYTE PTR [edx+eax], cl
+ 00459 ff 46 14 inc DWORD PTR [esi+20]
+
+; 812 : } while (val != 0);
+
+ 0045c 85 c9 test ecx, ecx
+ 0045e 75 a0 jne SHORT $LL6@deflate
+ 00460 eb 07 jmp SHORT $LN5@deflate
+$LN102@deflate:
+
+; 806 : val = 1;
+
+ 00462 c7 45 08 01 00
+ 00 00 mov DWORD PTR _val$1$[ebp], 1
+$LN5@deflate:
+
+; 813 : if (s->gzhead->hcrc && s->pending > beg)
+
+ 00469 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 0046c 83 78 2c 00 cmp DWORD PTR [eax+44], 0
+ 00470 74 1b je SHORT $LN46@deflate
+ 00472 8b 46 14 mov eax, DWORD PTR [esi+20]
+ 00475 3b c3 cmp eax, ebx
+ 00477 76 14 jbe SHORT $LN46@deflate
+
+; 814 : strm->adler = crc32(strm->adler, s->pending_buf + beg,
+
+ 00479 2b c3 sub eax, ebx
+ 0047b 50 push eax
+ 0047c 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 0047f 03 c3 add eax, ebx
+ 00481 50 push eax
+ 00482 ff 77 30 push DWORD PTR [edi+48]
+ 00485 e8 00 00 00 00 call _crc32@12
+ 0048a 89 47 30 mov DWORD PTR [edi+48], eax
+$LN46@deflate:
+
+; 815 : s->pending - beg);
+; 816 : if (val == 0) {
+
+ 0048d 83 7d 08 00 cmp DWORD PTR _val$1$[ebp], 0
+ 00491 75 0e jne SHORT $LN42@deflate
+
+; 817 : s->gzindex = 0;
+
+ 00493 c7 46 20 00 00
+ 00 00 mov DWORD PTR [esi+32], 0
+$LN41@deflate:
+
+; 818 : s->status = COMMENT_STATE;
+; 819 : }
+; 820 : }
+; 821 : else
+; 822 : s->status = COMMENT_STATE;
+
+ 0049a c7 46 04 5b 00
+ 00 00 mov DWORD PTR [esi+4], 91 ; 0000005bH
+$LN42@deflate:
+
+; 823 : }
+; 824 : if (s->status == COMMENT_STATE) {
+
+ 004a1 83 7e 04 5b cmp DWORD PTR [esi+4], 91 ; 0000005bH
+ 004a5 0f 85 af 00 00
+ 00 jne $LN50@deflate
+
+; 825 : if (s->gzhead->comment != Z_NULL) {
+
+ 004ab 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 004ae 83 78 24 00 cmp DWORD PTR [eax+36], 0
+ 004b2 0f 84 9b 00 00
+ 00 je $LN49@deflate
+
+; 826 : uInt beg = s->pending; /* start of bytes to update crc */
+
+ 004b8 8b 5e 14 mov ebx, DWORD PTR [esi+20]
+ 004bb 0f 1f 44 00 00 npad 5
+$LL9@deflate:
+
+; 827 : int val;
+; 828 :
+; 829 : do {
+; 830 : if (s->pending == s->pending_buf_size) {
+
+ 004c0 8b 56 14 mov edx, DWORD PTR [esi+20]
+ 004c3 3b 56 0c cmp edx, DWORD PTR [esi+12]
+ 004c6 75 32 jne SHORT $LN53@deflate
+
+; 831 : if (s->gzhead->hcrc && s->pending > beg)
+
+ 004c8 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 004cb 83 78 2c 00 cmp DWORD PTR [eax+44], 0
+ 004cf 74 18 je SHORT $LN52@deflate
+ 004d1 3b d3 cmp edx, ebx
+ 004d3 76 14 jbe SHORT $LN52@deflate
+
+; 832 : strm->adler = crc32(strm->adler, s->pending_buf + beg,
+
+ 004d5 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 004d8 2b d3 sub edx, ebx
+ 004da 52 push edx
+ 004db 03 c3 add eax, ebx
+ 004dd 50 push eax
+ 004de ff 77 30 push DWORD PTR [edi+48]
+ 004e1 e8 00 00 00 00 call _crc32@12
+ 004e6 89 47 30 mov DWORD PTR [edi+48], eax
+$LN52@deflate:
+
+; 833 : s->pending - beg);
+; 834 : flush_pending(strm);
+
+ 004e9 8b cf mov ecx, edi
+ 004eb e8 00 00 00 00 call _flush_pending
+
+; 835 : beg = s->pending;
+
+ 004f0 8b 56 14 mov edx, DWORD PTR [esi+20]
+ 004f3 8b da mov ebx, edx
+
+; 836 : if (s->pending == s->pending_buf_size) {
+
+ 004f5 3b 56 0c cmp edx, DWORD PTR [esi+12]
+ 004f8 74 28 je SHORT $LN103@deflate
+$LN53@deflate:
+
+; 838 : break;
+; 839 : }
+; 840 : }
+; 841 : val = s->gzhead->comment[s->gzindex++];
+
+ 004fa 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 004fd 8b 4e 20 mov ecx, DWORD PTR [esi+32]
+ 00500 8b 40 24 mov eax, DWORD PTR [eax+36]
+ 00503 0f b6 04 08 movzx eax, BYTE PTR [eax+ecx]
+ 00507 89 45 08 mov DWORD PTR _val$1$[ebp], eax
+ 0050a 8d 41 01 lea eax, DWORD PTR [ecx+1]
+
+; 842 : put_byte(s, val);
+
+ 0050d 8b 4d 08 mov ecx, DWORD PTR _val$1$[ebp]
+ 00510 89 46 20 mov DWORD PTR [esi+32], eax
+ 00513 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 00516 88 0c 02 mov BYTE PTR [edx+eax], cl
+ 00519 ff 46 14 inc DWORD PTR [esi+20]
+
+; 843 : } while (val != 0);
+
+ 0051c 85 c9 test ecx, ecx
+ 0051e 75 a0 jne SHORT $LL9@deflate
+ 00520 eb 07 jmp SHORT $LN8@deflate
+$LN103@deflate:
+
+; 837 : val = 1;
+
+ 00522 c7 45 08 01 00
+ 00 00 mov DWORD PTR _val$1$[ebp], 1
+$LN8@deflate:
+
+; 844 : if (s->gzhead->hcrc && s->pending > beg)
+
+ 00529 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 0052c 83 78 2c 00 cmp DWORD PTR [eax+44], 0
+ 00530 74 1b je SHORT $LN54@deflate
+ 00532 8b 46 14 mov eax, DWORD PTR [esi+20]
+ 00535 3b c3 cmp eax, ebx
+ 00537 76 14 jbe SHORT $LN54@deflate
+
+; 845 : strm->adler = crc32(strm->adler, s->pending_buf + beg,
+
+ 00539 2b c3 sub eax, ebx
+ 0053b 50 push eax
+ 0053c 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 0053f 03 c3 add eax, ebx
+ 00541 50 push eax
+ 00542 ff 77 30 push DWORD PTR [edi+48]
+ 00545 e8 00 00 00 00 call _crc32@12
+ 0054a 89 47 30 mov DWORD PTR [edi+48], eax
+$LN54@deflate:
+
+; 846 : s->pending - beg);
+; 847 : if (val == 0)
+
+ 0054d 83 7d 08 00 cmp DWORD PTR _val$1$[ebp], 0
+ 00551 75 07 jne SHORT $LN50@deflate
+$LN49@deflate:
+
+; 848 : s->status = HCRC_STATE;
+; 849 : }
+; 850 : else
+; 851 : s->status = HCRC_STATE;
+
+ 00553 c7 46 04 67 00
+ 00 00 mov DWORD PTR [esi+4], 103 ; 00000067H
+$LN50@deflate:
+
+; 852 : }
+; 853 : if (s->status == HCRC_STATE) {
+
+ 0055a 83 7e 04 67 cmp DWORD PTR [esi+4], 103 ; 00000067H
+ 0055e 75 58 jne SHORT $LN58@deflate
+
+; 854 : if (s->gzhead->hcrc) {
+
+ 00560 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 00563 83 78 2c 00 cmp DWORD PTR [eax+44], 0
+ 00567 74 48 je SHORT $LN57@deflate
+
+; 855 : if (s->pending + 2 > s->pending_buf_size)
+
+ 00569 8b 46 14 mov eax, DWORD PTR [esi+20]
+ 0056c 83 c0 02 add eax, 2
+ 0056f 3b 46 0c cmp eax, DWORD PTR [esi+12]
+ 00572 76 07 jbe SHORT $LN59@deflate
+
+; 856 : flush_pending(strm);
+
+ 00574 8b cf mov ecx, edi
+ 00576 e8 00 00 00 00 call _flush_pending
+$LN59@deflate:
+
+; 857 : if (s->pending + 2 <= s->pending_buf_size) {
+
+ 0057b 8b 56 14 mov edx, DWORD PTR [esi+20]
+ 0057e 8d 42 02 lea eax, DWORD PTR [edx+2]
+ 00581 3b 46 0c cmp eax, DWORD PTR [esi+12]
+ 00584 77 32 ja SHORT $LN58@deflate
+
+; 858 : put_byte(s, (Byte)(strm->adler & 0xff));
+
+ 00586 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 00589 0f b6 47 30 movzx eax, BYTE PTR [edi+48]
+
+; 859 : put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
+; 860 : strm->adler = crc32(0L, Z_NULL, 0);
+
+ 0058d 6a 00 push 0
+ 0058f 6a 00 push 0
+ 00591 88 04 0a mov BYTE PTR [edx+ecx], al
+ 00594 ff 46 14 inc DWORD PTR [esi+20]
+ 00597 8b 56 14 mov edx, DWORD PTR [esi+20]
+ 0059a 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 0059d 0f b6 47 31 movzx eax, BYTE PTR [edi+49]
+ 005a1 6a 00 push 0
+ 005a3 88 04 0a mov BYTE PTR [edx+ecx], al
+ 005a6 ff 46 14 inc DWORD PTR [esi+20]
+ 005a9 e8 00 00 00 00 call _crc32@12
+ 005ae 89 47 30 mov DWORD PTR [edi+48], eax
+$LN57@deflate:
+
+; 861 : s->status = BUSY_STATE;
+; 862 : }
+; 863 : }
+; 864 : else
+; 865 : s->status = BUSY_STATE;
+
+ 005b1 c7 46 04 71 00
+ 00 00 mov DWORD PTR [esi+4], 113 ; 00000071H
+$LN58@deflate:
+
+; 866 : }
+; 867 : #endif
+; 868 :
+; 869 : /* Flush as much pending output as possible */
+; 870 : if (s->pending != 0) {
+
+ 005b8 83 7e 14 00 cmp DWORD PTR [esi+20], 0
+ 005bc 74 1f je SHORT $LN61@deflate
+
+; 871 : flush_pending(strm);
+
+ 005be 8b cf mov ecx, edi
+ 005c0 e8 00 00 00 00 call _flush_pending
+
+; 872 : if (strm->avail_out == 0) {
+
+ 005c5 83 7f 10 00 cmp DWORD PTR [edi+16], 0
+ 005c9 75 61 jne SHORT $LN112@deflate
+$LN117@deflate:
+
+; 873 : /* Since avail_out is 0, deflate will be called again with
+; 874 : * more output space, but possibly with both pending and
+; 875 : * avail_in equal to zero. There won't be anything to do,
+; 876 : * but this is not an error situation so make sure we
+; 877 : * return OK instead of BUF_ERROR at next call of deflate:
+; 878 : */
+; 879 : s->last_flush = -1;
+
+ 005cb c7 46 28 ff ff
+ ff ff mov DWORD PTR [esi+40], -1
+$LN72@deflate:
+ 005d2 5b pop ebx
+ 005d3 5f pop edi
+
+; 880 : return Z_OK;
+
+ 005d4 33 c0 xor eax, eax
+ 005d6 5e pop esi
+
+; 976 : }
+
+ 005d7 8b e5 mov esp, ebp
+ 005d9 5d pop ebp
+ 005da c2 08 00 ret 8
+$LN61@deflate:
+
+; 881 : }
+; 882 :
+; 883 : /* Make sure there is something to do and avoid duplicate consecutive
+; 884 : * flushes. For repeated and useless calls with Z_FINISH, we keep
+; 885 : * returning Z_STREAM_END instead of Z_BUF_ERROR.
+; 886 : */
+; 887 : } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) &&
+
+ 005dd 83 7f 04 00 cmp DWORD PTR [edi+4], 0
+ 005e1 8b 5d 0c mov ebx, DWORD PTR _flush$[ebp]
+ 005e4 75 49 jne SHORT $LN64@deflate
+ 005e6 8b 4d fc mov ecx, DWORD PTR _old_flush$1$[ebp]
+ 005e9 33 c0 xor eax, eax
+ 005eb 83 f9 04 cmp ecx, 4
+ 005ee ba 09 00 00 00 mov edx, 9
+ 005f3 0f 4f c2 cmovg eax, edx
+ 005f6 8d 14 09 lea edx, DWORD PTR [ecx+ecx]
+ 005f9 33 c9 xor ecx, ecx
+ 005fb 2b d0 sub edx, eax
+ 005fd 83 fb 04 cmp ebx, 4
+ 00600 b8 09 00 00 00 mov eax, 9
+ 00605 0f 4f c8 cmovg ecx, eax
+ 00608 8d 04 1b lea eax, DWORD PTR [ebx+ebx]
+ 0060b 2b c1 sub eax, ecx
+ 0060d 3b c2 cmp eax, edx
+ 0060f 7f 1e jg SHORT $LN64@deflate
+ 00611 83 fb 04 cmp ebx, 4
+ 00614 74 19 je SHORT $LN64@deflate
+
+; 888 : flush != Z_FINISH) {
+; 889 : ERR_RETURN(strm, Z_BUF_ERROR);
+
+ 00616 a1 1c 00 00 00 mov eax, DWORD PTR _z_errmsg+28
+ 0061b 5b pop ebx
+ 0061c 89 47 18 mov DWORD PTR [edi+24], eax
+ 0061f b8 fb ff ff ff mov eax, -5 ; fffffffbH
+ 00624 5f pop edi
+ 00625 5e pop esi
+
+; 976 : }
+
+ 00626 8b e5 mov esp, ebp
+ 00628 5d pop ebp
+ 00629 c2 08 00 ret 8
+$LN112@deflate:
+ 0062c 8b 5d 0c mov ebx, DWORD PTR _flush$[ebp]
+$LN64@deflate:
+
+; 890 : }
+; 891 :
+; 892 : /* User must not provide more input after the first FINISH: */
+; 893 : if (s->status == FINISH_STATE && strm->avail_in != 0) {
+
+ 0062f 8b 46 04 mov eax, DWORD PTR [esi+4]
+ 00632 3d 9a 02 00 00 cmp eax, 666 ; 0000029aH
+ 00637 75 1c jne SHORT $LN65@deflate
+ 00639 83 7f 04 00 cmp DWORD PTR [edi+4], 0
+ 0063d 74 1c je SHORT $LN116@deflate
+
+; 894 : ERR_RETURN(strm, Z_BUF_ERROR);
+
+ 0063f a1 1c 00 00 00 mov eax, DWORD PTR _z_errmsg+28
+ 00644 5b pop ebx
+ 00645 89 47 18 mov DWORD PTR [edi+24], eax
+ 00648 b8 fb ff ff ff mov eax, -5 ; fffffffbH
+ 0064d 5f pop edi
+ 0064e 5e pop esi
+
+; 976 : }
+
+ 0064f 8b e5 mov esp, ebp
+ 00651 5d pop ebp
+ 00652 c2 08 00 ret 8
+$LN65@deflate:
+
+; 895 : }
+; 896 :
+; 897 : /* Start a new block or continue the current one.
+; 898 : */
+; 899 : if (strm->avail_in != 0 || s->lookahead != 0 ||
+
+ 00655 83 7f 04 00 cmp DWORD PTR [edi+4], 0
+ 00659 75 19 jne SHORT $LN67@deflate
+$LN116@deflate:
+ 0065b 83 7e 74 00 cmp DWORD PTR [esi+116], 0
+ 0065f 75 13 jne SHORT $LN67@deflate
+ 00661 85 db test ebx, ebx
+ 00663 0f 84 e9 00 00
+ 00 je $LN79@deflate
+ 00669 3d 9a 02 00 00 cmp eax, 666 ; 0000029aH
+ 0066e 0f 84 de 00 00
+ 00 je $LN79@deflate
+$LN67@deflate:
+
+; 900 : (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
+; 901 : block_state bstate;
+; 902 :
+; 903 : bstate = s->strategy == Z_HUFFMAN_ONLY ? deflate_huff(s, flush) :
+
+ 00674 8b 86 88 00 00
+ 00 mov eax, DWORD PTR [esi+136]
+ 0067a 83 f8 02 cmp eax, 2
+ 0067d 75 0b jne SHORT $LN96@deflate
+ 0067f 8b d3 mov edx, ebx
+ 00681 8b ce mov ecx, esi
+ 00683 e8 00 00 00 00 call _deflate_huff
+ 00688 eb 27 jmp SHORT $LN95@deflate
+$LN96@deflate:
+ 0068a 83 f8 03 cmp eax, 3
+ 0068d 75 0b jne SHORT $LN94@deflate
+ 0068f 8b d3 mov edx, ebx
+ 00691 8b ce mov ecx, esi
+ 00693 e8 00 00 00 00 call _deflate_rle
+ 00698 eb 17 jmp SHORT $LN95@deflate
+$LN94@deflate:
+ 0069a 8b 86 84 00 00
+ 00 mov eax, DWORD PTR [esi+132]
+ 006a0 53 push ebx
+ 006a1 56 push esi
+ 006a2 8d 04 40 lea eax, DWORD PTR [eax+eax*2]
+ 006a5 8b 04 85 08 00
+ 00 00 mov eax, DWORD PTR _configuration_table[eax*4+8]
+ 006ac ff d0 call eax
+ 006ae 83 c4 08 add esp, 8
+$LN95@deflate:
+
+; 904 : (s->strategy == Z_RLE ? deflate_rle(s, flush) :
+; 905 : (*(configuration_table[s->level].func))(s, flush));
+; 906 :
+; 907 : if (bstate == finish_started || bstate == finish_done) {
+
+ 006b1 83 f8 02 cmp eax, 2
+ 006b4 74 05 je SHORT $LN69@deflate
+ 006b6 83 f8 03 cmp eax, 3
+ 006b9 75 07 jne SHORT $LN68@deflate
+$LN69@deflate:
+
+; 908 : s->status = FINISH_STATE;
+
+ 006bb c7 46 04 9a 02
+ 00 00 mov DWORD PTR [esi+4], 666 ; 0000029aH
+$LN68@deflate:
+
+; 909 : }
+; 910 : if (bstate == need_more || bstate == finish_started) {
+
+ 006c2 85 c0 test eax, eax
+ 006c4 0f 84 69 01 00
+ 00 je $LN71@deflate
+ 006ca 83 f8 02 cmp eax, 2
+ 006cd 0f 84 60 01 00
+ 00 je $LN71@deflate
+
+; 912 : s->last_flush = -1; /* avoid BUF_ERROR next call, see above */
+; 913 : }
+; 914 : return Z_OK;
+; 915 : /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
+; 916 : * of deflate should use the same flush parameter to make sure
+; 917 : * that the flush is complete. So we don't have to output an
+; 918 : * empty block here, this will be done at next call. This also
+; 919 : * ensures that for a very small output buffer, we emit at most
+; 920 : * one empty block.
+; 921 : */
+; 922 : }
+; 923 : if (bstate == block_done) {
+
+ 006d3 83 f8 01 cmp eax, 1
+ 006d6 75 7a jne SHORT $LN79@deflate
+
+; 924 : if (flush == Z_PARTIAL_FLUSH) {
+
+ 006d8 3b d8 cmp ebx, eax
+ 006da 75 09 jne SHORT $LN74@deflate
+
+; 925 : _tr_align(s);
+
+ 006dc 8b ce mov ecx, esi
+ 006de e8 00 00 00 00 call __tr_align
+ 006e3 eb 5c jmp SHORT $LN78@deflate
+$LN74@deflate:
+
+; 926 : } else if (flush != Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */
+
+ 006e5 83 fb 05 cmp ebx, 5
+ 006e8 74 57 je SHORT $LN78@deflate
+
+; 927 : _tr_stored_block(s, (char*)0, 0L, 0);
+
+ 006ea 6a 00 push 0
+ 006ec 6a 00 push 0
+ 006ee 33 d2 xor edx, edx
+ 006f0 8b ce mov ecx, esi
+ 006f2 e8 00 00 00 00 call __tr_stored_block
+ 006f7 83 c4 08 add esp, 8
+
+; 928 : /* For a full flush, this empty block will be recognized
+; 929 : * as a special marker by inflate_sync().
+; 930 : */
+; 931 : if (flush == Z_FULL_FLUSH) {
+
+ 006fa 83 fb 03 cmp ebx, 3
+ 006fd 75 42 jne SHORT $LN78@deflate
+
+; 932 : CLEAR_HASH(s); /* forget history */
+
+ 006ff 8b 46 44 mov eax, DWORD PTR [esi+68]
+ 00702 33 d2 xor edx, edx
+ 00704 8b 4e 4c mov ecx, DWORD PTR [esi+76]
+ 00707 66 89 54 48 fe mov WORD PTR [eax+ecx*2-2], dx
+ 0070c 8b 46 4c mov eax, DWORD PTR [esi+76]
+ 0070f 8d 04 45 fe ff
+ ff ff lea eax, DWORD PTR [eax*2-2]
+ 00716 50 push eax
+ 00717 52 push edx
+ 00718 ff 76 44 push DWORD PTR [esi+68]
+ 0071b e8 00 00 00 00 call _memset
+ 00720 83 c4 0c add esp, 12 ; 0000000cH
+
+; 933 : if (s->lookahead == 0) {
+
+ 00723 83 7e 74 00 cmp DWORD PTR [esi+116], 0
+ 00727 75 18 jne SHORT $LN78@deflate
+
+; 934 : s->strstart = 0;
+
+ 00729 c7 46 6c 00 00
+ 00 00 mov DWORD PTR [esi+108], 0
+
+; 935 : s->block_start = 0L;
+
+ 00730 c7 46 5c 00 00
+ 00 00 mov DWORD PTR [esi+92], 0
+
+; 936 : s->insert = 0;
+
+ 00737 c7 86 b4 16 00
+ 00 00 00 00 00 mov DWORD PTR [esi+5812], 0
+$LN78@deflate:
+
+; 937 : }
+; 938 : }
+; 939 : }
+; 940 : flush_pending(strm);
+
+ 00741 8b cf mov ecx, edi
+ 00743 e8 00 00 00 00 call _flush_pending
+
+; 941 : if (strm->avail_out == 0) {
+
+ 00748 83 7f 10 00 cmp DWORD PTR [edi+16], 0
+ 0074c 0f 84 79 fe ff
+ ff je $LN117@deflate
+$LN79@deflate:
+
+; 942 : s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */
+; 943 : return Z_OK;
+; 944 : }
+; 945 : }
+; 946 : }
+; 947 : Assert(strm->avail_out > 0, "bug2");
+; 948 :
+; 949 : if (flush != Z_FINISH) return Z_OK;
+
+ 00752 83 fb 04 cmp ebx, 4
+ 00755 0f 85 77 fe ff
+ ff jne $LN72@deflate
+
+; 950 : if (s->wrap <= 0) return Z_STREAM_END;
+
+ 0075b 8b 46 18 mov eax, DWORD PTR [esi+24]
+ 0075e 85 c0 test eax, eax
+ 00760 7f 0c jg SHORT $LN81@deflate
+ 00762 8d 43 fd lea eax, DWORD PTR [ebx-3]
+ 00765 5b pop ebx
+ 00766 5f pop edi
+ 00767 5e pop esi
+
+; 976 : }
+
+ 00768 8b e5 mov esp, ebp
+ 0076a 5d pop ebp
+ 0076b c2 08 00 ret 8
+$LN81@deflate:
+
+; 951 :
+; 952 : /* Write the trailer */
+; 953 : #ifdef GZIP
+; 954 : if (s->wrap == 2) {
+
+ 0076e 83 f8 02 cmp eax, 2
+ 00771 0f 85 82 00 00
+ 00 jne $LN82@deflate
+
+; 955 : put_byte(s, (Byte)(strm->adler & 0xff));
+
+ 00777 8b 4e 14 mov ecx, DWORD PTR [esi+20]
+ 0077a 0f b6 47 30 movzx eax, BYTE PTR [edi+48]
+ 0077e 8b 56 08 mov edx, DWORD PTR [esi+8]
+ 00781 88 04 0a mov BYTE PTR [edx+ecx], al
+ 00784 ff 46 14 inc DWORD PTR [esi+20]
+ 00787 8b 56 14 mov edx, DWORD PTR [esi+20]
+
+; 956 : put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
+
+ 0078a 0f b6 47 31 movzx eax, BYTE PTR [edi+49]
+ 0078e 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 00791 88 04 0a mov BYTE PTR [edx+ecx], al
+ 00794 ff 46 14 inc DWORD PTR [esi+20]
+ 00797 8b 56 14 mov edx, DWORD PTR [esi+20]
+
+; 957 : put_byte(s, (Byte)((strm->adler >> 16) & 0xff));
+
+ 0079a 0f b6 47 32 movzx eax, BYTE PTR [edi+50]
+ 0079e 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 007a1 88 04 0a mov BYTE PTR [edx+ecx], al
+ 007a4 ff 46 14 inc DWORD PTR [esi+20]
+ 007a7 8b 56 14 mov edx, DWORD PTR [esi+20]
+
+; 958 : put_byte(s, (Byte)((strm->adler >> 24) & 0xff));
+
+ 007aa 0f b6 47 33 movzx eax, BYTE PTR [edi+51]
+ 007ae 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 007b1 88 04 0a mov BYTE PTR [edx+ecx], al
+ 007b4 ff 46 14 inc DWORD PTR [esi+20]
+ 007b7 8b 56 14 mov edx, DWORD PTR [esi+20]
+
+; 959 : put_byte(s, (Byte)(strm->total_in & 0xff));
+
+ 007ba 0f b6 47 08 movzx eax, BYTE PTR [edi+8]
+ 007be 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 007c1 88 04 0a mov BYTE PTR [edx+ecx], al
+ 007c4 ff 46 14 inc DWORD PTR [esi+20]
+ 007c7 8b 56 14 mov edx, DWORD PTR [esi+20]
+
+; 960 : put_byte(s, (Byte)((strm->total_in >> 8) & 0xff));
+
+ 007ca 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 007cd 0f b6 47 09 movzx eax, BYTE PTR [edi+9]
+ 007d1 88 04 0a mov BYTE PTR [edx+ecx], al
+ 007d4 ff 46 14 inc DWORD PTR [esi+20]
+ 007d7 8b 56 14 mov edx, DWORD PTR [esi+20]
+
+; 961 : put_byte(s, (Byte)((strm->total_in >> 16) & 0xff));
+
+ 007da 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 007dd 0f b6 47 0a movzx eax, BYTE PTR [edi+10]
+ 007e1 88 04 0a mov BYTE PTR [edx+ecx], al
+ 007e4 ff 46 14 inc DWORD PTR [esi+20]
+ 007e7 8b 56 14 mov edx, DWORD PTR [esi+20]
+
+; 962 : put_byte(s, (Byte)((strm->total_in >> 24) & 0xff));
+
+ 007ea 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 007ed 0f b6 47 0b movzx eax, BYTE PTR [edi+11]
+ 007f1 88 04 0a mov BYTE PTR [edx+ecx], al
+ 007f4 ff 46 14 inc DWORD PTR [esi+20]
+
+; 963 : }
+
+ 007f7 eb 16 jmp SHORT $LN83@deflate
+$LN82@deflate:
+
+; 964 : else
+; 965 : #endif
+; 966 : {
+; 967 : putShortMSB(s, (uInt)(strm->adler >> 16));
+
+ 007f9 0f b7 57 32 movzx edx, WORD PTR [edi+50]
+ 007fd 8b ce mov ecx, esi
+ 007ff e8 00 00 00 00 call _putShortMSB
+
+; 968 : putShortMSB(s, (uInt)(strm->adler & 0xffff));
+
+ 00804 0f b7 57 30 movzx edx, WORD PTR [edi+48]
+ 00808 8b ce mov ecx, esi
+ 0080a e8 00 00 00 00 call _putShortMSB
+$LN83@deflate:
+
+; 969 : }
+; 970 : flush_pending(strm);
+
+ 0080f 8b cf mov ecx, edi
+ 00811 e8 00 00 00 00 call _flush_pending
+
+; 971 : /* If avail_out is zero, the application will call deflate again
+; 972 : * to flush the rest.
+; 973 : */
+; 974 : if (s->wrap > 0) s->wrap = -s->wrap; /* write the trailer only once! */
+
+ 00816 8b 46 18 mov eax, DWORD PTR [esi+24]
+ 00819 85 c0 test eax, eax
+ 0081b 7e 05 jle SHORT $LN84@deflate
+ 0081d f7 d8 neg eax
+ 0081f 89 46 18 mov DWORD PTR [esi+24], eax
+$LN84@deflate:
+
+; 975 : return s->pending != 0 ? Z_OK : Z_STREAM_END;
+
+ 00822 33 c0 xor eax, eax
+ 00824 39 46 14 cmp DWORD PTR [esi+20], eax
+ 00827 5b pop ebx
+ 00828 5f pop edi
+ 00829 0f 94 c0 sete al
+ 0082c 5e pop esi
+
+; 976 : }
+
+ 0082d 8b e5 mov esp, ebp
+ 0082f 5d pop ebp
+ 00830 c2 08 00 ret 8
+$LN71@deflate:
+
+; 911 : if (strm->avail_out == 0) {
+
+ 00833 83 7f 10 00 cmp DWORD PTR [edi+16], 0
+ 00837 0f 85 95 fd ff
+ ff jne $LN72@deflate
+
+; 873 : /* Since avail_out is 0, deflate will be called again with
+; 874 : * more output space, but possibly with both pending and
+; 875 : * avail_in equal to zero. There won't be anything to do,
+; 876 : * but this is not an error situation so make sure we
+; 877 : * return OK instead of BUF_ERROR at next call of deflate:
+; 878 : */
+; 879 : s->last_flush = -1;
+
+ 0083d 5b pop ebx
+ 0083e 5f pop edi
+ 0083f c7 46 28 ff ff
+ ff ff mov DWORD PTR [esi+40], -1
+
+; 880 : return Z_OK;
+
+ 00846 33 c0 xor eax, eax
+ 00848 5e pop esi
+
+; 976 : }
+
+ 00849 8b e5 mov esp, ebp
+ 0084b 5d pop ebp
+ 0084c c2 08 00 ret 8
+$LN13@deflate:
+
+; 680 : (s->status == FINISH_STATE && flush != Z_FINISH)) {
+; 681 : ERR_RETURN(strm, Z_STREAM_ERROR);
+
+ 0084f a1 10 00 00 00 mov eax, DWORD PTR _z_errmsg+16
+ 00854 89 47 18 mov DWORD PTR [edi+24], eax
+$LN11@deflate:
+ 00857 5f pop edi
+ 00858 b8 fe ff ff ff mov eax, -2 ; fffffffeH
+ 0085d 5e pop esi
+
+; 976 : }
+
+ 0085e 8b e5 mov esp, ebp
+ 00860 5d pop ebp
+ 00861 c2 08 00 ret 8
+_deflate@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\deflate.c
+; COMDAT _deflateEnd@4
+_TEXT SEGMENT
+_strm$ = 8 ; size = 4
+_deflateEnd@4 PROC ; COMDAT
+
+; 981 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 56 push esi
+
+; 982 : int status;
+; 983 :
+; 984 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 00004 8b 75 08 mov esi, DWORD PTR _strm$[ebp]
+ 00007 85 f6 test esi, esi
+ 00009 0f 84 bd 00 00
+ 00 je $LN3@deflateEnd
+ 0000f 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 00012 85 c0 test eax, eax
+ 00014 0f 84 b2 00 00
+ 00 je $LN3@deflateEnd
+
+; 985 :
+; 986 : status = strm->state->status;
+
+ 0001a 57 push edi
+ 0001b 8b 78 04 mov edi, DWORD PTR [eax+4]
+
+; 987 : if (status != INIT_STATE &&
+; 988 : status != EXTRA_STATE &&
+; 989 : status != NAME_STATE &&
+; 990 : status != COMMENT_STATE &&
+; 991 : status != HCRC_STATE &&
+; 992 : status != BUSY_STATE &&
+
+ 0001e 83 ff 2a cmp edi, 42 ; 0000002aH
+ 00021 74 2c je SHORT $LN4@deflateEnd
+ 00023 83 ff 45 cmp edi, 69 ; 00000045H
+ 00026 74 27 je SHORT $LN4@deflateEnd
+ 00028 83 ff 49 cmp edi, 73 ; 00000049H
+ 0002b 74 22 je SHORT $LN4@deflateEnd
+ 0002d 83 ff 5b cmp edi, 91 ; 0000005bH
+ 00030 74 1d je SHORT $LN4@deflateEnd
+ 00032 83 ff 67 cmp edi, 103 ; 00000067H
+ 00035 74 18 je SHORT $LN4@deflateEnd
+ 00037 83 ff 71 cmp edi, 113 ; 00000071H
+ 0003a 74 13 je SHORT $LN4@deflateEnd
+ 0003c 81 ff 9a 02 00
+ 00 cmp edi, 666 ; 0000029aH
+ 00042 74 0b je SHORT $LN4@deflateEnd
+
+; 993 : status != FINISH_STATE) {
+; 994 : return Z_STREAM_ERROR;
+
+ 00044 5f pop edi
+ 00045 b8 fe ff ff ff mov eax, -2 ; fffffffeH
+ 0004a 5e pop esi
+
+; 1007 : }
+
+ 0004b 5d pop ebp
+ 0004c c2 04 00 ret 4
+$LN4@deflateEnd:
+
+; 995 : }
+; 996 :
+; 997 : /* Deallocate in reverse order of allocations: */
+; 998 : TRY_FREE(strm, strm->state->pending_buf);
+
+ 0004f 8b 40 08 mov eax, DWORD PTR [eax+8]
+ 00052 85 c0 test eax, eax
+ 00054 74 0c je SHORT $LN5@deflateEnd
+ 00056 50 push eax
+ 00057 ff 76 28 push DWORD PTR [esi+40]
+ 0005a 8b 46 24 mov eax, DWORD PTR [esi+36]
+ 0005d ff d0 call eax
+ 0005f 83 c4 08 add esp, 8
+$LN5@deflateEnd:
+
+; 999 : TRY_FREE(strm, strm->state->head);
+
+ 00062 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 00065 8b 40 44 mov eax, DWORD PTR [eax+68]
+ 00068 85 c0 test eax, eax
+ 0006a 74 0c je SHORT $LN6@deflateEnd
+ 0006c 50 push eax
+ 0006d ff 76 28 push DWORD PTR [esi+40]
+ 00070 8b 46 24 mov eax, DWORD PTR [esi+36]
+ 00073 ff d0 call eax
+ 00075 83 c4 08 add esp, 8
+$LN6@deflateEnd:
+
+; 1000 : TRY_FREE(strm, strm->state->prev);
+
+ 00078 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 0007b 8b 40 40 mov eax, DWORD PTR [eax+64]
+ 0007e 85 c0 test eax, eax
+ 00080 74 0c je SHORT $LN7@deflateEnd
+ 00082 50 push eax
+ 00083 ff 76 28 push DWORD PTR [esi+40]
+ 00086 8b 46 24 mov eax, DWORD PTR [esi+36]
+ 00089 ff d0 call eax
+ 0008b 83 c4 08 add esp, 8
+$LN7@deflateEnd:
+
+; 1001 : TRY_FREE(strm, strm->state->window);
+
+ 0008e 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 00091 8b 40 38 mov eax, DWORD PTR [eax+56]
+ 00094 85 c0 test eax, eax
+ 00096 74 0c je SHORT $LN8@deflateEnd
+ 00098 50 push eax
+ 00099 ff 76 28 push DWORD PTR [esi+40]
+ 0009c 8b 46 24 mov eax, DWORD PTR [esi+36]
+ 0009f ff d0 call eax
+ 000a1 83 c4 08 add esp, 8
+$LN8@deflateEnd:
+
+; 1002 :
+; 1003 : ZFREE(strm, strm->state);
+
+ 000a4 ff 76 1c push DWORD PTR [esi+28]
+ 000a7 8b 46 24 mov eax, DWORD PTR [esi+36]
+ 000aa ff 76 28 push DWORD PTR [esi+40]
+ 000ad ff d0 call eax
+ 000af 83 c4 08 add esp, 8
+
+; 1004 : strm->state = Z_NULL;
+
+ 000b2 c7 46 1c 00 00
+ 00 00 mov DWORD PTR [esi+28], 0
+
+; 1005 :
+; 1006 : return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;
+
+ 000b9 33 c0 xor eax, eax
+ 000bb b9 fd ff ff ff mov ecx, -3 ; fffffffdH
+ 000c0 83 ff 71 cmp edi, 113 ; 00000071H
+ 000c3 5f pop edi
+ 000c4 0f 44 c1 cmove eax, ecx
+ 000c7 5e pop esi
+
+; 1007 : }
+
+ 000c8 5d pop ebp
+ 000c9 c2 04 00 ret 4
+$LN3@deflateEnd:
+
+; 982 : int status;
+; 983 :
+; 984 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 000cc b8 fe ff ff ff mov eax, -2 ; fffffffeH
+ 000d1 5e pop esi
+
+; 1007 : }
+
+ 000d2 5d pop ebp
+ 000d3 c2 04 00 ret 4
+_deflateEnd@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\deflate.c
+; COMDAT _deflateInit_@16
+_TEXT SEGMENT
+_strm$ = 8 ; size = 4
+_level$ = 12 ; size = 4
+_version$ = 16 ; size = 4
+_stream_size$ = 20 ; size = 4
+_deflateInit_@16 PROC ; COMDAT
+
+; 206 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 207 : return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL,
+
+ 00003 ff 75 14 push DWORD PTR _stream_size$[ebp]
+ 00006 ff 75 10 push DWORD PTR _version$[ebp]
+ 00009 6a 00 push 0
+ 0000b 6a 08 push 8
+ 0000d 6a 0f push 15 ; 0000000fH
+ 0000f 6a 08 push 8
+ 00011 ff 75 0c push DWORD PTR _level$[ebp]
+ 00014 ff 75 08 push DWORD PTR _strm$[ebp]
+ 00017 e8 00 00 00 00 call _deflateInit2_@32
+
+; 208 : Z_DEFAULT_STRATEGY, version, stream_size);
+; 209 : /* To do: ignore strm->next_in if we use it as window */
+; 210 : }
+
+ 0001c 5d pop ebp
+ 0001d c2 10 00 ret 16 ; 00000010H
+_deflateInit_@16 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\deflate.c
+; COMDAT _deflateInit2_@32
+_TEXT SEGMENT
+_strm$ = 8 ; size = 4
+_level$ = 12 ; size = 4
+_method$ = 16 ; size = 4
+_windowBits$ = 20 ; size = 4
+_memLevel$ = 24 ; size = 4
+_strategy$ = 28 ; size = 4
+_version$ = 32 ; size = 4
+_stream_size$ = 36 ; size = 4
+_deflateInit2_@32 PROC ; COMDAT
+
+; 223 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 224 : deflate_state *s;
+; 225 : int wrap = 1;
+; 226 : static const char my_version[] = ZLIB_VERSION;
+; 227 :
+; 228 : ushf *overlay;
+; 229 : /* We overlay pending_buf and d_buf+l_buf. This works since the average
+; 230 : * output size for (length,distance) codes is <= 24 bits.
+; 231 : */
+; 232 :
+; 233 : if (version == Z_NULL || version[0] != my_version[0] ||
+
+ 00003 8b 45 20 mov eax, DWORD PTR _version$[ebp]
+ 00006 56 push esi
+ 00007 be 01 00 00 00 mov esi, 1
+ 0000c 85 c0 test eax, eax
+ 0000e 0f 84 0b 02 00
+ 00 je $LN3@deflateIni
+ 00014 80 38 31 cmp BYTE PTR [eax], 49 ; 00000031H
+ 00017 0f 85 02 02 00
+ 00 jne $LN3@deflateIni
+ 0001d 83 7d 24 38 cmp DWORD PTR _stream_size$[ebp], 56 ; 00000038H
+ 00021 0f 85 f8 01 00
+ 00 jne $LN3@deflateIni
+
+; 236 : }
+; 237 : if (strm == Z_NULL) return Z_STREAM_ERROR;
+
+ 00027 57 push edi
+ 00028 8b 7d 08 mov edi, DWORD PTR _strm$[ebp]
+ 0002b 85 ff test edi, edi
+ 0002d 75 09 jne SHORT $LN4@deflateIni
+ 0002f 5f pop edi
+ 00030 8d 46 fd lea eax, DWORD PTR [esi-3]
+ 00033 5e pop esi
+
+; 320 : }
+
+ 00034 5d pop ebp
+ 00035 c2 20 00 ret 32 ; 00000020H
+$LN4@deflateIni:
+
+; 238 :
+; 239 : strm->msg = Z_NULL;
+; 240 : if (strm->zalloc == (alloc_func)0) {
+
+ 00038 83 7f 20 00 cmp DWORD PTR [edi+32], 0
+ 0003c c7 47 18 00 00
+ 00 00 mov DWORD PTR [edi+24], 0
+ 00043 75 0e jne SHORT $LN5@deflateIni
+
+; 241 : #ifdef Z_SOLO
+; 242 : return Z_STREAM_ERROR;
+; 243 : #else
+; 244 : strm->zalloc = zcalloc;
+
+ 00045 c7 47 20 00 00
+ 00 00 mov DWORD PTR [edi+32], OFFSET _zcalloc
+
+; 245 : strm->opaque = (voidpf)0;
+
+ 0004c c7 47 28 00 00
+ 00 00 mov DWORD PTR [edi+40], 0
+$LN5@deflateIni:
+
+; 246 : #endif
+; 247 : }
+; 248 : if (strm->zfree == (free_func)0)
+
+ 00053 83 7f 24 00 cmp DWORD PTR [edi+36], 0
+ 00057 75 07 jne SHORT $LN6@deflateIni
+
+; 249 : #ifdef Z_SOLO
+; 250 : return Z_STREAM_ERROR;
+; 251 : #else
+; 252 : strm->zfree = zcfree;
+
+ 00059 c7 47 24 00 00
+ 00 00 mov DWORD PTR [edi+36], OFFSET _zcfree
+$LN6@deflateIni:
+
+; 253 : #endif
+; 254 :
+; 255 : #ifdef FASTEST
+; 256 : if (level != 0) level = 1;
+; 257 : #else
+; 258 : if (level == Z_DEFAULT_COMPRESSION) level = 6;
+
+ 00060 8b 4d 0c mov ecx, DWORD PTR _level$[ebp]
+ 00063 b8 06 00 00 00 mov eax, 6
+ 00068 83 f9 ff cmp ecx, -1
+ 0006b 53 push ebx
+
+; 259 : #endif
+; 260 :
+; 261 : if (windowBits < 0) { /* suppress zlib wrapper */
+
+ 0006c 8b 5d 14 mov ebx, DWORD PTR _windowBits$[ebp]
+ 0006f 0f 44 c8 cmove ecx, eax
+ 00072 89 4d 0c mov DWORD PTR _level$[ebp], ecx
+ 00075 85 db test ebx, ebx
+ 00077 79 06 jns SHORT $LN8@deflateIni
+
+; 262 : wrap = 0;
+
+ 00079 33 f6 xor esi, esi
+
+; 263 : windowBits = -windowBits;
+
+ 0007b f7 db neg ebx
+
+; 264 : }
+
+ 0007d eb 0d jmp SHORT $LN10@deflateIni
+$LN8@deflateIni:
+
+; 265 : #ifdef GZIP
+; 266 : else if (windowBits > 15) {
+
+ 0007f 83 fb 0f cmp ebx, 15 ; 0000000fH
+ 00082 7e 08 jle SHORT $LN10@deflateIni
+
+; 267 : wrap = 2; /* write gzip wrapper instead */
+
+ 00084 be 02 00 00 00 mov esi, 2
+
+; 268 : windowBits -= 16;
+
+ 00089 83 eb 10 sub ebx, 16 ; 00000010H
+$LN10@deflateIni:
+
+; 269 : }
+; 270 : #endif
+; 271 : if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
+; 272 : windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
+; 273 : strategy < 0 || strategy > Z_FIXED) {
+
+ 0008c 8b 45 18 mov eax, DWORD PTR _memLevel$[ebp]
+ 0008f 48 dec eax
+ 00090 83 f8 08 cmp eax, 8
+ 00093 0f 87 7a 01 00
+ 00 ja $LN12@deflateIni
+ 00099 83 7d 10 08 cmp DWORD PTR _method$[ebp], 8
+ 0009d 0f 85 70 01 00
+ 00 jne $LN12@deflateIni
+ 000a3 8d 43 f8 lea eax, DWORD PTR [ebx-8]
+ 000a6 83 f8 07 cmp eax, 7
+ 000a9 0f 87 64 01 00
+ 00 ja $LN12@deflateIni
+ 000af 83 f9 09 cmp ecx, 9
+ 000b2 0f 87 5b 01 00
+ 00 ja $LN12@deflateIni
+ 000b8 83 7d 1c 04 cmp DWORD PTR _strategy$[ebp], 4
+ 000bc 0f 87 51 01 00
+ 00 ja $LN12@deflateIni
+
+; 275 : }
+; 276 : if (windowBits == 8) windowBits = 9; /* until 256-byte window bug fixed */
+; 277 : s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state));
+
+ 000c2 68 c4 16 00 00 push 5828 ; 000016c4H
+ 000c7 b8 09 00 00 00 mov eax, 9
+ 000cc 83 fb 08 cmp ebx, 8
+ 000cf 6a 01 push 1
+ 000d1 ff 77 28 push DWORD PTR [edi+40]
+ 000d4 0f 44 d8 cmove ebx, eax
+ 000d7 8b 47 20 mov eax, DWORD PTR [edi+32]
+ 000da ff d0 call eax
+ 000dc 83 c4 0c add esp, 12 ; 0000000cH
+
+; 278 : if (s == Z_NULL) return Z_MEM_ERROR;
+
+ 000df 85 c0 test eax, eax
+ 000e1 0f 84 20 01 00
+ 00 je $LN20@deflateIni
+
+; 279 : strm->state = (struct internal_state FAR *)s;
+
+ 000e7 89 47 1c mov DWORD PTR [edi+28], eax
+
+; 280 : s->strm = strm;
+; 281 :
+; 282 : s->wrap = wrap;
+; 283 : s->gzhead = Z_NULL;
+; 284 : s->w_bits = windowBits;
+; 285 : s->w_size = 1 << s->w_bits;
+
+ 000ea 8b cb mov ecx, ebx
+ 000ec 89 70 18 mov DWORD PTR [eax+24], esi
+ 000ef be 01 00 00 00 mov esi, 1
+ 000f4 89 58 30 mov DWORD PTR [eax+48], ebx
+ 000f7 8b d8 mov ebx, eax
+ 000f9 d3 e6 shl esi, cl
+
+; 286 : s->w_mask = s->w_size - 1;
+; 287 :
+; 288 : s->hash_bits = memLevel + 7;
+
+ 000fb 8b 4d 18 mov ecx, DWORD PTR _memLevel$[ebp]
+ 000fe 89 38 mov DWORD PTR [eax], edi
+ 00100 83 c1 07 add ecx, 7
+ 00103 c7 40 1c 00 00
+ 00 00 mov DWORD PTR [eax+28], 0
+ 0010a 8d 46 ff lea eax, DWORD PTR [esi-1]
+ 0010d 89 4b 50 mov DWORD PTR [ebx+80], ecx
+ 00110 89 43 34 mov DWORD PTR [ebx+52], eax
+
+; 289 : s->hash_size = 1 << s->hash_bits;
+
+ 00113 b8 01 00 00 00 mov eax, 1
+ 00118 d3 e0 shl eax, cl
+
+; 290 : s->hash_mask = s->hash_size - 1;
+; 291 : s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH);
+
+ 0011a 83 c1 02 add ecx, 2
+ 0011d 89 43 4c mov DWORD PTR [ebx+76], eax
+ 00120 48 dec eax
+ 00121 89 43 54 mov DWORD PTR [ebx+84], eax
+ 00124 b8 ab aa aa aa mov eax, -1431655765 ; aaaaaaabH
+ 00129 f7 e1 mul ecx
+
+; 292 :
+; 293 : s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));
+
+ 0012b 6a 02 push 2
+ 0012d d1 ea shr edx, 1
+ 0012f 89 73 2c mov DWORD PTR [ebx+44], esi
+ 00132 89 53 58 mov DWORD PTR [ebx+88], edx
+ 00135 8b 47 20 mov eax, DWORD PTR [edi+32]
+ 00138 56 push esi
+ 00139 ff 77 28 push DWORD PTR [edi+40]
+ 0013c ff d0 call eax
+
+; 294 : s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos));
+
+ 0013e 6a 02 push 2
+ 00140 ff 73 2c push DWORD PTR [ebx+44]
+ 00143 89 43 38 mov DWORD PTR [ebx+56], eax
+ 00146 ff 77 28 push DWORD PTR [edi+40]
+ 00149 8b 47 20 mov eax, DWORD PTR [edi+32]
+ 0014c ff d0 call eax
+
+; 295 : s->head = (Posf *) ZALLOC(strm, s->hash_size, sizeof(Pos));
+
+ 0014e 6a 02 push 2
+ 00150 ff 73 4c push DWORD PTR [ebx+76]
+ 00153 89 43 40 mov DWORD PTR [ebx+64], eax
+ 00156 ff 77 28 push DWORD PTR [edi+40]
+ 00159 8b 47 20 mov eax, DWORD PTR [edi+32]
+ 0015c ff d0 call eax
+
+; 296 :
+; 297 : s->high_water = 0; /* nothing written to s->window yet */
+; 298 :
+; 299 : s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
+
+ 0015e 8b 4d 18 mov ecx, DWORD PTR _memLevel$[ebp]
+ 00161 89 43 44 mov DWORD PTR [ebx+68], eax
+ 00164 b8 01 00 00 00 mov eax, 1
+
+; 300 :
+; 301 : overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
+
+ 00169 6a 04 push 4
+ 0016b c7 83 c0 16 00
+ 00 00 00 00 00 mov DWORD PTR [ebx+5824], 0
+ 00175 8d 49 06 lea ecx, DWORD PTR [ecx+6]
+ 00178 d3 e0 shl eax, cl
+ 0017a 50 push eax
+ 0017b 89 83 9c 16 00
+ 00 mov DWORD PTR [ebx+5788], eax
+ 00181 ff 77 28 push DWORD PTR [edi+40]
+ 00184 8b 47 20 mov eax, DWORD PTR [edi+32]
+ 00187 ff d0 call eax
+
+; 302 : s->pending_buf = (uchf *) overlay;
+; 303 : s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L);
+
+ 00189 8b b3 9c 16 00
+ 00 mov esi, DWORD PTR [ebx+5788]
+ 0018f 83 c4 30 add esp, 48 ; 00000030H
+
+; 304 :
+; 305 : if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
+
+ 00192 83 7b 38 00 cmp DWORD PTR [ebx+56], 0
+ 00196 8b d0 mov edx, eax
+ 00198 89 53 08 mov DWORD PTR [ebx+8], edx
+ 0019b 8d 0c b5 00 00
+ 00 00 lea ecx, DWORD PTR [esi*4]
+ 001a2 89 4b 0c mov DWORD PTR [ebx+12], ecx
+ 001a5 74 4b je SHORT $LN16@deflateIni
+ 001a7 83 7b 40 00 cmp DWORD PTR [ebx+64], 0
+ 001ab 74 45 je SHORT $LN16@deflateIni
+ 001ad 83 7b 44 00 cmp DWORD PTR [ebx+68], 0
+ 001b1 74 3f je SHORT $LN16@deflateIni
+ 001b3 85 d2 test edx, edx
+ 001b5 74 3b je SHORT $LN16@deflateIni
+
+; 311 : }
+; 312 : s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
+
+ 001b7 8b c6 mov eax, esi
+
+; 313 : s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
+; 314 :
+; 315 : s->level = level;
+; 316 : s->strategy = strategy;
+; 317 : s->method = (Byte)method;
+
+ 001b9 c6 43 24 08 mov BYTE PTR [ebx+36], 8
+ 001bd d1 e8 shr eax, 1
+
+; 318 :
+; 319 : return deflateReset(strm);
+
+ 001bf 57 push edi
+ 001c0 8d 04 42 lea eax, DWORD PTR [edx+eax*2]
+ 001c3 89 83 a4 16 00
+ 00 mov DWORD PTR [ebx+5796], eax
+ 001c9 8d 04 72 lea eax, DWORD PTR [edx+esi*2]
+ 001cc 03 c6 add eax, esi
+ 001ce 89 83 98 16 00
+ 00 mov DWORD PTR [ebx+5784], eax
+ 001d4 8b 45 0c mov eax, DWORD PTR _level$[ebp]
+ 001d7 89 83 84 00 00
+ 00 mov DWORD PTR [ebx+132], eax
+ 001dd 8b 45 1c mov eax, DWORD PTR _strategy$[ebp]
+ 001e0 89 83 88 00 00
+ 00 mov DWORD PTR [ebx+136], eax
+ 001e6 e8 00 00 00 00 call _deflateReset@4
+ 001eb 5b pop ebx
+ 001ec 5f pop edi
+ 001ed 5e pop esi
+
+; 320 : }
+
+ 001ee 5d pop ebp
+ 001ef c2 20 00 ret 32 ; 00000020H
+$LN16@deflateIni:
+
+; 306 : s->pending_buf == Z_NULL) {
+; 307 : s->status = FINISH_STATE;
+; 308 : strm->msg = ERR_MSG(Z_MEM_ERROR);
+
+ 001f2 a1 18 00 00 00 mov eax, DWORD PTR _z_errmsg+24
+ 001f7 c7 43 04 9a 02
+ 00 00 mov DWORD PTR [ebx+4], 666 ; 0000029aH
+
+; 309 : deflateEnd (strm);
+
+ 001fe 57 push edi
+ 001ff 89 47 18 mov DWORD PTR [edi+24], eax
+ 00202 e8 00 00 00 00 call _deflateEnd@4
+$LN20@deflateIni:
+
+; 310 : return Z_MEM_ERROR;
+
+ 00207 5b pop ebx
+ 00208 5f pop edi
+ 00209 b8 fc ff ff ff mov eax, -4 ; fffffffcH
+ 0020e 5e pop esi
+
+; 320 : }
+
+ 0020f 5d pop ebp
+ 00210 c2 20 00 ret 32 ; 00000020H
+$LN12@deflateIni:
+ 00213 5b pop ebx
+ 00214 5f pop edi
+
+; 274 : return Z_STREAM_ERROR;
+
+ 00215 b8 fe ff ff ff mov eax, -2 ; fffffffeH
+ 0021a 5e pop esi
+
+; 320 : }
+
+ 0021b 5d pop ebp
+ 0021c c2 20 00 ret 32 ; 00000020H
+$LN3@deflateIni:
+
+; 234 : stream_size != sizeof(z_stream)) {
+; 235 : return Z_VERSION_ERROR;
+
+ 0021f b8 fa ff ff ff mov eax, -6 ; fffffffaH
+ 00224 5e pop esi
+
+; 320 : }
+
+ 00225 5d pop ebp
+ 00226 c2 20 00 ret 32 ; 00000020H
+_deflateInit2_@32 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\deflate.c
+; COMDAT _deflateSetDictionary@12
+_TEXT SEGMENT
+_avail$1$ = -8 ; size = 4
+_wrap$1$ = -4 ; size = 4
+_strm$ = 8 ; size = 4
+_n$1$ = 12 ; size = 4
+_dictionary$ = 12 ; size = 4
+_next$1$ = 16 ; size = 4
+_dictLength$ = 16 ; size = 4
+_deflateSetDictionary@12 PROC ; COMDAT
+
+; 327 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 08 sub esp, 8
+ 00006 53 push ebx
+
+; 328 : deflate_state *s;
+; 329 : uInt str, n;
+; 330 : int wrap;
+; 331 : unsigned avail;
+; 332 : z_const unsigned char *next;
+; 333 :
+; 334 : if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL)
+
+ 00007 8b 5d 08 mov ebx, DWORD PTR _strm$[ebp]
+ 0000a 56 push esi
+ 0000b 85 db test ebx, ebx
+ 0000d 0f 84 7d 01 00
+ 00 je $LN8@deflateSet
+ 00013 8b 73 1c mov esi, DWORD PTR [ebx+28]
+ 00016 85 f6 test esi, esi
+ 00018 0f 84 72 01 00
+ 00 je $LN8@deflateSet
+ 0001e 8b 4d 0c mov ecx, DWORD PTR _dictionary$[ebp]
+ 00021 85 c9 test ecx, ecx
+ 00023 0f 84 67 01 00
+ 00 je $LN8@deflateSet
+
+; 336 : s = strm->state;
+; 337 : wrap = s->wrap;
+
+ 00029 8b 46 18 mov eax, DWORD PTR [esi+24]
+ 0002c 89 45 fc mov DWORD PTR _wrap$1$[ebp], eax
+
+; 338 : if (wrap == 2 || (wrap == 1 && s->status != INIT_STATE) || s->lookahead)
+
+ 0002f 83 f8 02 cmp eax, 2
+ 00032 0f 84 58 01 00
+ 00 je $LN8@deflateSet
+ 00038 83 f8 01 cmp eax, 1
+ 0003b 75 0a jne SHORT $LN11@deflateSet
+ 0003d 83 7e 04 2a cmp DWORD PTR [esi+4], 42 ; 0000002aH
+ 00041 0f 85 49 01 00
+ 00 jne $LN8@deflateSet
+$LN11@deflateSet:
+ 00047 83 7e 74 00 cmp DWORD PTR [esi+116], 0
+ 0004b 0f 85 3f 01 00
+ 00 jne $LN8@deflateSet
+
+; 339 : return Z_STREAM_ERROR;
+; 340 :
+; 341 : /* when using zlib wrappers, compute Adler-32 for provided dictionary */
+; 342 : if (wrap == 1)
+
+ 00051 57 push edi
+ 00052 8b 7d 10 mov edi, DWORD PTR _dictLength$[ebp]
+ 00055 83 f8 01 cmp eax, 1
+ 00058 75 13 jne SHORT $LN12@deflateSet
+
+; 343 : strm->adler = adler32(strm->adler, dictionary, dictLength);
+
+ 0005a 57 push edi
+ 0005b 51 push ecx
+ 0005c ff 73 30 push DWORD PTR [ebx+48]
+ 0005f e8 00 00 00 00 call _adler32@12
+ 00064 8b 4d 0c mov ecx, DWORD PTR _dictionary$[ebp]
+ 00067 89 43 30 mov DWORD PTR [ebx+48], eax
+ 0006a 8b 45 fc mov eax, DWORD PTR _wrap$1$[ebp]
+$LN12@deflateSet:
+
+; 344 : s->wrap = 0; /* avoid computing Adler-32 in read_buf */
+
+ 0006d c7 46 18 00 00
+ 00 00 mov DWORD PTR [esi+24], 0
+
+; 345 :
+; 346 : /* if dictionary would fill window, just replace the history */
+; 347 : if (dictLength >= s->w_size) {
+
+ 00074 3b 7e 2c cmp edi, DWORD PTR [esi+44]
+ 00077 72 4b jb SHORT $LN13@deflateSet
+
+; 348 : if (wrap == 0) { /* already empty otherwise */
+
+ 00079 85 c0 test eax, eax
+ 0007b 75 3f jne SHORT $LN14@deflateSet
+
+; 349 : CLEAR_HASH(s);
+
+ 0007d 8b 46 44 mov eax, DWORD PTR [esi+68]
+ 00080 33 d2 xor edx, edx
+ 00082 8b 4e 4c mov ecx, DWORD PTR [esi+76]
+ 00085 66 89 54 48 fe mov WORD PTR [eax+ecx*2-2], dx
+ 0008a 8b 46 4c mov eax, DWORD PTR [esi+76]
+ 0008d 8d 04 45 fe ff
+ ff ff lea eax, DWORD PTR [eax*2-2]
+ 00094 50 push eax
+ 00095 52 push edx
+ 00096 ff 76 44 push DWORD PTR [esi+68]
+ 00099 e8 00 00 00 00 call _memset
+ 0009e 8b 4d 0c mov ecx, DWORD PTR _dictionary$[ebp]
+ 000a1 83 c4 0c add esp, 12 ; 0000000cH
+
+; 350 : s->strstart = 0;
+
+ 000a4 c7 46 6c 00 00
+ 00 00 mov DWORD PTR [esi+108], 0
+
+; 351 : s->block_start = 0L;
+
+ 000ab c7 46 5c 00 00
+ 00 00 mov DWORD PTR [esi+92], 0
+
+; 352 : s->insert = 0;
+
+ 000b2 c7 86 b4 16 00
+ 00 00 00 00 00 mov DWORD PTR [esi+5812], 0
+$LN14@deflateSet:
+
+; 353 : }
+; 354 : dictionary += dictLength - s->w_size; /* use the tail */
+
+ 000bc 2b 7e 2c sub edi, DWORD PTR [esi+44]
+ 000bf 03 cf add ecx, edi
+
+; 355 : dictLength = s->w_size;
+
+ 000c1 8b 7e 2c mov edi, DWORD PTR [esi+44]
+$LN13@deflateSet:
+
+; 356 : }
+; 357 :
+; 358 : /* insert dictionary into window and hash */
+; 359 : avail = strm->avail_in;
+
+ 000c4 8b 43 04 mov eax, DWORD PTR [ebx+4]
+ 000c7 89 45 f8 mov DWORD PTR _avail$1$[ebp], eax
+
+; 360 : next = strm->next_in;
+
+ 000ca 8b 03 mov eax, DWORD PTR [ebx]
+
+; 361 : strm->avail_in = dictLength;
+; 362 : strm->next_in = (z_const Bytef *)dictionary;
+
+ 000cc 89 0b mov DWORD PTR [ebx], ecx
+
+; 363 : fill_window(s);
+
+ 000ce 8b ce mov ecx, esi
+ 000d0 89 45 10 mov DWORD PTR _next$1$[ebp], eax
+ 000d3 89 7b 04 mov DWORD PTR [ebx+4], edi
+ 000d6 e8 00 00 00 00 call _fill_window
+
+; 364 : while (s->lookahead >= MIN_MATCH) {
+
+ 000db 83 7e 74 03 cmp DWORD PTR [esi+116], 3
+ 000df 72 65 jb SHORT $LN3@deflateSet
+$LL2@deflateSet:
+
+; 365 : str = s->strstart;
+; 366 : n = s->lookahead - (MIN_MATCH-1);
+
+ 000e1 8b 46 74 mov eax, DWORD PTR [esi+116]
+ 000e4 8b 5e 6c mov ebx, DWORD PTR [esi+108]
+ 000e7 83 e8 02 sub eax, 2
+ 000ea 89 45 0c mov DWORD PTR _n$1$[ebp], eax
+ 000ed 0f 1f 00 npad 3
+$LL6@deflateSet:
+
+; 367 : do {
+; 368 : UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]);
+
+ 000f0 8b 46 38 mov eax, DWORD PTR [esi+56]
+ 000f3 8b 4e 58 mov ecx, DWORD PTR [esi+88]
+
+; 369 : #ifndef FASTEST
+; 370 : s->prev[str & s->w_mask] = s->head[s->ins_h];
+
+ 000f6 8b 56 34 mov edx, DWORD PTR [esi+52]
+ 000f9 23 d3 and edx, ebx
+ 000fb 0f b6 7c 18 02 movzx edi, BYTE PTR [eax+ebx+2]
+ 00100 8b 46 48 mov eax, DWORD PTR [esi+72]
+ 00103 d3 e0 shl eax, cl
+ 00105 8b 4e 40 mov ecx, DWORD PTR [esi+64]
+ 00108 33 f8 xor edi, eax
+ 0010a 23 7e 54 and edi, DWORD PTR [esi+84]
+ 0010d 8b 46 44 mov eax, DWORD PTR [esi+68]
+ 00110 89 7e 48 mov DWORD PTR [esi+72], edi
+ 00113 66 8b 04 78 mov ax, WORD PTR [eax+edi*2]
+ 00117 66 89 04 51 mov WORD PTR [ecx+edx*2], ax
+
+; 371 : #endif
+; 372 : s->head[s->ins_h] = (Pos)str;
+
+ 0011b 8b 4e 48 mov ecx, DWORD PTR [esi+72]
+ 0011e 8b 46 44 mov eax, DWORD PTR [esi+68]
+ 00121 66 89 1c 48 mov WORD PTR [eax+ecx*2], bx
+
+; 373 : str++;
+
+ 00125 43 inc ebx
+
+; 374 : } while (--n);
+
+ 00126 83 6d 0c 01 sub DWORD PTR _n$1$[ebp], 1
+ 0012a 75 c4 jne SHORT $LL6@deflateSet
+
+; 375 : s->strstart = str;
+; 376 : s->lookahead = MIN_MATCH-1;
+; 377 : fill_window(s);
+
+ 0012c 8b ce mov ecx, esi
+ 0012e 89 5e 6c mov DWORD PTR [esi+108], ebx
+ 00131 c7 46 74 02 00
+ 00 00 mov DWORD PTR [esi+116], 2
+ 00138 e8 00 00 00 00 call _fill_window
+ 0013d 83 7e 74 03 cmp DWORD PTR [esi+116], 3
+ 00141 73 9e jae SHORT $LL2@deflateSet
+ 00143 8b 5d 08 mov ebx, DWORD PTR _strm$[ebp]
+$LN3@deflateSet:
+
+; 378 : }
+; 379 : s->strstart += s->lookahead;
+
+ 00146 8b 4e 74 mov ecx, DWORD PTR [esi+116]
+ 00149 01 4e 6c add DWORD PTR [esi+108], ecx
+ 0014c 8b 46 6c mov eax, DWORD PTR [esi+108]
+
+; 380 : s->block_start = (long)s->strstart;
+
+ 0014f 89 46 5c mov DWORD PTR [esi+92], eax
+
+; 381 : s->insert = s->lookahead;
+; 382 : s->lookahead = 0;
+; 383 : s->match_length = s->prev_length = MIN_MATCH-1;
+; 384 : s->match_available = 0;
+; 385 : strm->next_in = next;
+
+ 00152 8b 45 10 mov eax, DWORD PTR _next$1$[ebp]
+ 00155 89 8e b4 16 00
+ 00 mov DWORD PTR [esi+5812], ecx
+ 0015b c7 46 74 00 00
+ 00 00 mov DWORD PTR [esi+116], 0
+ 00162 c7 46 78 02 00
+ 00 00 mov DWORD PTR [esi+120], 2
+ 00169 c7 46 60 02 00
+ 00 00 mov DWORD PTR [esi+96], 2
+ 00170 c7 46 68 00 00
+ 00 00 mov DWORD PTR [esi+104], 0
+ 00177 89 03 mov DWORD PTR [ebx], eax
+
+; 386 : strm->avail_in = avail;
+
+ 00179 8b 45 f8 mov eax, DWORD PTR _avail$1$[ebp]
+ 0017c 89 43 04 mov DWORD PTR [ebx+4], eax
+
+; 387 : s->wrap = wrap;
+
+ 0017f 8b 45 fc mov eax, DWORD PTR _wrap$1$[ebp]
+ 00182 5f pop edi
+ 00183 89 46 18 mov DWORD PTR [esi+24], eax
+
+; 388 : return Z_OK;
+
+ 00186 33 c0 xor eax, eax
+ 00188 5e pop esi
+ 00189 5b pop ebx
+
+; 389 : }
+
+ 0018a 8b e5 mov esp, ebp
+ 0018c 5d pop ebp
+ 0018d c2 0c 00 ret 12 ; 0000000cH
+$LN8@deflateSet:
+ 00190 5e pop esi
+
+; 335 : return Z_STREAM_ERROR;
+
+ 00191 b8 fe ff ff ff mov eax, -2 ; fffffffeH
+ 00196 5b pop ebx
+
+; 389 : }
+
+ 00197 8b e5 mov esp, ebp
+ 00199 5d pop ebp
+ 0019a c2 0c 00 ret 12 ; 0000000cH
+_deflateSetDictionary@12 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\deflate.c
+; COMDAT _deflateResetKeep@4
+_TEXT SEGMENT
+_strm$ = 8 ; size = 4
+_deflateResetKeep@4 PROC ; COMDAT
+
+; 394 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 56 push esi
+
+; 395 : deflate_state *s;
+; 396 :
+; 397 : if (strm == Z_NULL || strm->state == Z_NULL ||
+; 398 : strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) {
+
+ 00004 8b 75 08 mov esi, DWORD PTR _strm$[ebp]
+ 00007 57 push edi
+ 00008 85 f6 test esi, esi
+ 0000a 0f 84 95 00 00
+ 00 je $LN3@deflateRes
+ 00010 8b 7e 1c mov edi, DWORD PTR [esi+28]
+ 00013 85 ff test edi, edi
+ 00015 0f 84 8a 00 00
+ 00 je $LN3@deflateRes
+ 0001b 83 7e 20 00 cmp DWORD PTR [esi+32], 0
+ 0001f 0f 84 80 00 00
+ 00 je $LN3@deflateRes
+ 00025 83 7e 24 00 cmp DWORD PTR [esi+36], 0
+ 00029 74 7a je SHORT $LN3@deflateRes
+
+; 400 : }
+; 401 :
+; 402 : strm->total_in = strm->total_out = 0;
+
+ 0002b c7 46 14 00 00
+ 00 00 mov DWORD PTR [esi+20], 0
+ 00032 c7 46 08 00 00
+ 00 00 mov DWORD PTR [esi+8], 0
+
+; 403 : strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */
+
+ 00039 c7 46 18 00 00
+ 00 00 mov DWORD PTR [esi+24], 0
+
+; 404 : strm->data_type = Z_UNKNOWN;
+
+ 00040 c7 46 2c 02 00
+ 00 00 mov DWORD PTR [esi+44], 2
+
+; 405 :
+; 406 : s = (deflate_state *)strm->state;
+; 407 : s->pending = 0;
+; 408 : s->pending_out = s->pending_buf;
+
+ 00047 8b 47 08 mov eax, DWORD PTR [edi+8]
+ 0004a 89 47 10 mov DWORD PTR [edi+16], eax
+
+; 409 :
+; 410 : if (s->wrap < 0) {
+
+ 0004d 8b 47 18 mov eax, DWORD PTR [edi+24]
+ 00050 c7 47 14 00 00
+ 00 00 mov DWORD PTR [edi+20], 0
+ 00057 85 c0 test eax, eax
+ 00059 79 05 jns SHORT $LN4@deflateRes
+
+; 411 : s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */
+
+ 0005b f7 d8 neg eax
+ 0005d 89 47 18 mov DWORD PTR [edi+24], eax
+$LN4@deflateRes:
+
+; 412 : }
+; 413 : s->status = s->wrap ? INIT_STATE : BUSY_STATE;
+
+ 00060 8b 4f 18 mov ecx, DWORD PTR [edi+24]
+ 00063 b8 71 00 00 00 mov eax, 113 ; 00000071H
+ 00068 85 c9 test ecx, ecx
+ 0006a ba 2a 00 00 00 mov edx, 42 ; 0000002aH
+
+; 414 : strm->adler =
+
+ 0006f 6a 00 push 0
+ 00071 0f 45 c2 cmovne eax, edx
+ 00074 89 47 04 mov DWORD PTR [edi+4], eax
+ 00077 6a 00 push 0
+ 00079 6a 00 push 0
+ 0007b 83 f9 02 cmp ecx, 2
+ 0007e 75 07 jne SHORT $LN6@deflateRes
+ 00080 e8 00 00 00 00 call _crc32@12
+ 00085 eb 05 jmp SHORT $LN7@deflateRes
+$LN6@deflateRes:
+ 00087 e8 00 00 00 00 call _adler32@12
+$LN7@deflateRes:
+ 0008c 89 46 30 mov DWORD PTR [esi+48], eax
+
+; 415 : #ifdef GZIP
+; 416 : s->wrap == 2 ? crc32(0L, Z_NULL, 0) :
+; 417 : #endif
+; 418 : adler32(0L, Z_NULL, 0);
+; 419 : s->last_flush = Z_NO_FLUSH;
+; 420 :
+; 421 : _tr_init(s);
+
+ 0008f 8b cf mov ecx, edi
+ 00091 c7 47 28 00 00
+ 00 00 mov DWORD PTR [edi+40], 0
+ 00098 e8 00 00 00 00 call __tr_init
+ 0009d 5f pop edi
+
+; 422 :
+; 423 : return Z_OK;
+
+ 0009e 33 c0 xor eax, eax
+ 000a0 5e pop esi
+
+; 424 : }
+
+ 000a1 5d pop ebp
+ 000a2 c2 04 00 ret 4
+$LN3@deflateRes:
+ 000a5 5f pop edi
+
+; 399 : return Z_STREAM_ERROR;
+
+ 000a6 b8 fe ff ff ff mov eax, -2 ; fffffffeH
+ 000ab 5e pop esi
+
+; 424 : }
+
+ 000ac 5d pop ebp
+ 000ad c2 04 00 ret 4
+_deflateResetKeep@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\deflate.c
+; COMDAT _deflateReset@4
+_TEXT SEGMENT
+_strm$ = 8 ; size = 4
+_deflateReset@4 PROC ; COMDAT
+
+; 429 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 56 push esi
+ 00004 57 push edi
+
+; 430 : int ret;
+; 431 :
+; 432 : ret = deflateResetKeep(strm);
+
+ 00005 8b 7d 08 mov edi, DWORD PTR _strm$[ebp]
+ 00008 57 push edi
+ 00009 e8 00 00 00 00 call _deflateResetKeep@4
+ 0000e 8b f0 mov esi, eax
+
+; 433 : if (ret == Z_OK)
+
+ 00010 85 f6 test esi, esi
+ 00012 75 0a jne SHORT $LN2@deflateRes
+
+; 434 : lm_init(strm->state);
+
+ 00014 8b 4f 1c mov ecx, DWORD PTR [edi+28]
+ 00017 e8 00 00 00 00 call _lm_init
+
+; 435 : return ret;
+
+ 0001c 8b c6 mov eax, esi
+$LN2@deflateRes:
+ 0001e 5f pop edi
+ 0001f 5e pop esi
+
+; 436 : }
+
+ 00020 5d pop ebp
+ 00021 c2 04 00 ret 4
+_deflateReset@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\deflate.c
+; COMDAT _deflateSetHeader@8
+_TEXT SEGMENT
+_strm$ = 8 ; size = 4
+_head$ = 12 ; size = 4
+_deflateSetHeader@8 PROC ; COMDAT
+
+; 442 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 443 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 00003 8b 4d 08 mov ecx, DWORD PTR _strm$[ebp]
+ 00006 85 c9 test ecx, ecx
+ 00008 74 19 je SHORT $LN3@deflateSet
+ 0000a 8b 49 1c mov ecx, DWORD PTR [ecx+28]
+ 0000d 85 c9 test ecx, ecx
+ 0000f 74 12 je SHORT $LN3@deflateSet
+
+; 444 : if (strm->state->wrap != 2) return Z_STREAM_ERROR;
+
+ 00011 83 79 18 02 cmp DWORD PTR [ecx+24], 2
+ 00015 75 0c jne SHORT $LN3@deflateSet
+
+; 445 : strm->state->gzhead = head;
+
+ 00017 8b 45 0c mov eax, DWORD PTR _head$[ebp]
+ 0001a 89 41 1c mov DWORD PTR [ecx+28], eax
+
+; 446 : return Z_OK;
+
+ 0001d 33 c0 xor eax, eax
+
+; 447 : }
+
+ 0001f 5d pop ebp
+ 00020 c2 08 00 ret 8
+$LN3@deflateSet:
+
+; 443 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 00023 b8 fe ff ff ff mov eax, -2 ; fffffffeH
+
+; 447 : }
+
+ 00028 5d pop ebp
+ 00029 c2 08 00 ret 8
+_deflateSetHeader@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\deflate.c
+; COMDAT _deflatePending@12
+_TEXT SEGMENT
+_strm$ = 8 ; size = 4
+_pending$ = 12 ; size = 4
+_bits$ = 16 ; size = 4
+_deflatePending@12 PROC ; COMDAT
+
+; 454 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 455 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 00003 8b 4d 08 mov ecx, DWORD PTR _strm$[ebp]
+ 00006 85 c9 test ecx, ecx
+ 00008 74 2b je SHORT $LN3@deflatePen
+ 0000a 8b 41 1c mov eax, DWORD PTR [ecx+28]
+ 0000d 85 c0 test eax, eax
+ 0000f 74 24 je SHORT $LN3@deflatePen
+
+; 456 : if (pending != Z_NULL)
+
+ 00011 8b 55 0c mov edx, DWORD PTR _pending$[ebp]
+ 00014 85 d2 test edx, edx
+ 00016 74 05 je SHORT $LN4@deflatePen
+
+; 457 : *pending = strm->state->pending;
+
+ 00018 8b 40 14 mov eax, DWORD PTR [eax+20]
+ 0001b 89 02 mov DWORD PTR [edx], eax
+$LN4@deflatePen:
+
+; 458 : if (bits != Z_NULL)
+
+ 0001d 8b 55 10 mov edx, DWORD PTR _bits$[ebp]
+ 00020 85 d2 test edx, edx
+ 00022 74 0b je SHORT $LN5@deflatePen
+
+; 459 : *bits = strm->state->bi_valid;
+
+ 00024 8b 41 1c mov eax, DWORD PTR [ecx+28]
+ 00027 8b 80 bc 16 00
+ 00 mov eax, DWORD PTR [eax+5820]
+ 0002d 89 02 mov DWORD PTR [edx], eax
+$LN5@deflatePen:
+
+; 460 : return Z_OK;
+
+ 0002f 33 c0 xor eax, eax
+
+; 461 : }
+
+ 00031 5d pop ebp
+ 00032 c2 0c 00 ret 12 ; 0000000cH
+$LN3@deflatePen:
+
+; 455 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 00035 b8 fe ff ff ff mov eax, -2 ; fffffffeH
+
+; 461 : }
+
+ 0003a 5d pop ebp
+ 0003b c2 0c 00 ret 12 ; 0000000cH
+_deflatePending@12 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\deflate.c
+; COMDAT _deflatePrime@12
+_TEXT SEGMENT
+_strm$ = 8 ; size = 4
+_bits$ = 12 ; size = 4
+_value$ = 16 ; size = 4
+_deflatePrime@12 PROC ; COMDAT
+
+; 468 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 56 push esi
+
+; 469 : deflate_state *s;
+; 470 : int put;
+; 471 :
+; 472 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 00004 8b 75 08 mov esi, DWORD PTR _strm$[ebp]
+ 00007 85 f6 test esi, esi
+ 00009 74 75 je SHORT $LN6@deflatePri
+ 0000b 8b 76 1c mov esi, DWORD PTR [esi+28]
+ 0000e 85 f6 test esi, esi
+ 00010 74 6e je SHORT $LN6@deflatePri
+
+; 473 : s = strm->state;
+; 474 : if ((Bytef *)(s->d_buf) < s->pending_out + ((Buf_size + 7) >> 3))
+
+ 00012 8b 46 10 mov eax, DWORD PTR [esi+16]
+ 00015 83 c0 02 add eax, 2
+ 00018 39 86 a4 16 00
+ 00 cmp DWORD PTR [esi+5796], eax
+ 0001e 73 0a jae SHORT $LN12@deflatePri
+
+; 475 : return Z_BUF_ERROR;
+
+ 00020 b8 fb ff ff ff mov eax, -5 ; fffffffbH
+ 00025 5e pop esi
+
+; 487 : }
+
+ 00026 5d pop ebp
+ 00027 c2 0c 00 ret 12 ; 0000000cH
+$LN12@deflatePri:
+ 0002a 53 push ebx
+
+; 475 : return Z_BUF_ERROR;
+
+ 0002b 8b 5d 0c mov ebx, DWORD PTR _bits$[ebp]
+ 0002e 57 push edi
+ 0002f 90 npad 1
+$LL4@deflatePri:
+
+; 476 : do {
+; 477 : put = Buf_size - s->bi_valid;
+
+ 00030 8b 96 bc 16 00
+ 00 mov edx, DWORD PTR [esi+5820]
+ 00036 bf 10 00 00 00 mov edi, 16 ; 00000010H
+ 0003b 2b fa sub edi, edx
+
+; 478 : if (put > bits)
+; 479 : put = bits;
+; 480 : s->bi_buf |= (ush)((value & ((1 << put) - 1)) << s->bi_valid);
+
+ 0003d b8 01 00 00 00 mov eax, 1
+ 00042 3b fb cmp edi, ebx
+ 00044 0f 4f fb cmovg edi, ebx
+ 00047 8b cf mov ecx, edi
+ 00049 66 d3 e0 shl ax, cl
+ 0004c 8b ca mov ecx, edx
+ 0004e 66 48 dec ax
+ 00050 66 23 45 10 and ax, WORD PTR _value$[ebp]
+ 00054 66 d3 e0 shl ax, cl
+
+; 481 : s->bi_valid += put;
+; 482 : _tr_flush_bits(s);
+
+ 00057 8b ce mov ecx, esi
+ 00059 66 09 86 b8 16
+ 00 00 or WORD PTR [esi+5816], ax
+ 00060 8d 04 3a lea eax, DWORD PTR [edx+edi]
+ 00063 89 86 bc 16 00
+ 00 mov DWORD PTR [esi+5820], eax
+ 00069 e8 00 00 00 00 call __tr_flush_bits
+
+; 483 : value >>= put;
+
+ 0006e 8b cf mov ecx, edi
+ 00070 d3 7d 10 sar DWORD PTR _value$[ebp], cl
+
+; 484 : bits -= put;
+
+ 00073 2b df sub ebx, edi
+
+; 485 : } while (bits);
+
+ 00075 75 b9 jne SHORT $LL4@deflatePri
+
+; 486 : return Z_OK;
+
+ 00077 5f pop edi
+ 00078 5b pop ebx
+ 00079 33 c0 xor eax, eax
+ 0007b 5e pop esi
+
+; 487 : }
+
+ 0007c 5d pop ebp
+ 0007d c2 0c 00 ret 12 ; 0000000cH
+$LN6@deflatePri:
+
+; 469 : deflate_state *s;
+; 470 : int put;
+; 471 :
+; 472 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 00080 b8 fe ff ff ff mov eax, -2 ; fffffffeH
+ 00085 5e pop esi
+
+; 487 : }
+
+ 00086 5d pop ebp
+ 00087 c2 0c 00 ret 12 ; 0000000cH
+_deflatePrime@12 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\deflate.c
+; COMDAT _deflateParams@12
+_TEXT SEGMENT
+_strm$ = 8 ; size = 4
+_level$ = 12 ; size = 4
+_strategy$ = 16 ; size = 4
+_deflateParams@12 PROC ; COMDAT
+
+; 494 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 53 push ebx
+
+; 495 : deflate_state *s;
+; 496 : compress_func func;
+; 497 : int err = Z_OK;
+; 498 :
+; 499 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 00004 8b 5d 08 mov ebx, DWORD PTR _strm$[ebp]
+ 00007 33 d2 xor edx, edx
+ 00009 57 push edi
+ 0000a 85 db test ebx, ebx
+ 0000c 0f 84 da 00 00
+ 00 je $LN3@deflatePar
+ 00012 8b 7b 1c mov edi, DWORD PTR [ebx+28]
+ 00015 85 ff test edi, edi
+ 00017 0f 84 cf 00 00
+ 00 je $LN3@deflatePar
+
+; 500 : s = strm->state;
+; 501 :
+; 502 : #ifdef FASTEST
+; 503 : if (level != 0) level = 1;
+; 504 : #else
+; 505 : if (level == Z_DEFAULT_COMPRESSION) level = 6;
+
+ 0001d 56 push esi
+ 0001e 8b 75 0c mov esi, DWORD PTR _level$[ebp]
+ 00021 83 fe ff cmp esi, -1
+ 00024 75 05 jne SHORT $LN4@deflatePar
+ 00026 8d 72 06 lea esi, DWORD PTR [edx+6]
+
+; 506 : #endif
+; 507 : if (level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) {
+
+ 00029 eb 11 jmp SHORT $LN13@deflatePar
+$LN4@deflatePar:
+ 0002b 85 f6 test esi, esi
+ 0002d 0f 88 ad 00 00
+ 00 js $LN6@deflatePar
+ 00033 83 fe 09 cmp esi, 9
+ 00036 0f 8f a4 00 00
+ 00 jg $LN6@deflatePar
+$LN13@deflatePar:
+ 0003c 8b 45 10 mov eax, DWORD PTR _strategy$[ebp]
+ 0003f 83 f8 04 cmp eax, 4
+ 00042 0f 87 98 00 00
+ 00 ja $LN6@deflatePar
+
+; 509 : }
+; 510 : func = configuration_table[s->level].func;
+; 511 :
+; 512 : if ((strategy != s->strategy || func != configuration_table[level].func) &&
+
+ 00048 3b 87 88 00 00
+ 00 cmp eax, DWORD PTR [edi+136]
+ 0004e 75 1c jne SHORT $LN8@deflatePar
+ 00050 8b 87 84 00 00
+ 00 mov eax, DWORD PTR [edi+132]
+ 00056 8d 0c 76 lea ecx, DWORD PTR [esi+esi*2]
+ 00059 8d 04 40 lea eax, DWORD PTR [eax+eax*2]
+ 0005c 8b 04 85 08 00
+ 00 00 mov eax, DWORD PTR _configuration_table[eax*4+8]
+ 00063 3b 04 8d 08 00
+ 00 00 cmp eax, DWORD PTR _configuration_table[ecx*4+8]
+ 0006a 74 1c je SHORT $LN9@deflatePar
+$LN8@deflatePar:
+ 0006c 39 53 08 cmp DWORD PTR [ebx+8], edx
+ 0006f 74 17 je SHORT $LN9@deflatePar
+
+; 513 : strm->total_in != 0) {
+; 514 : /* Flush the last buffer: */
+; 515 : err = deflate(strm, Z_BLOCK);
+
+ 00071 6a 05 push 5
+ 00073 53 push ebx
+ 00074 e8 00 00 00 00 call _deflate@8
+ 00079 8b d0 mov edx, eax
+
+; 516 : if (err == Z_BUF_ERROR && s->pending == 0)
+
+ 0007b 83 fa fb cmp edx, -5 ; fffffffbH
+ 0007e 75 08 jne SHORT $LN9@deflatePar
+ 00080 33 c0 xor eax, eax
+ 00082 39 47 14 cmp DWORD PTR [edi+20], eax
+ 00085 0f 44 d0 cmove edx, eax
+$LN9@deflatePar:
+
+; 517 : err = Z_OK;
+; 518 : }
+; 519 : if (s->level != level) {
+
+ 00088 39 b7 84 00 00
+ 00 cmp DWORD PTR [edi+132], esi
+ 0008e 74 3e je SHORT $LN10@deflatePar
+
+; 520 : s->level = level;
+; 521 : s->max_lazy_match = configuration_table[level].max_lazy;
+
+ 00090 8d 0c 76 lea ecx, DWORD PTR [esi+esi*2]
+ 00093 89 b7 84 00 00
+ 00 mov DWORD PTR [edi+132], esi
+ 00099 0f b7 04 8d 02
+ 00 00 00 movzx eax, WORD PTR _configuration_table[ecx*4+2]
+ 000a1 89 87 80 00 00
+ 00 mov DWORD PTR [edi+128], eax
+
+; 522 : s->good_match = configuration_table[level].good_length;
+
+ 000a7 0f b7 04 8d 00
+ 00 00 00 movzx eax, WORD PTR _configuration_table[ecx*4]
+ 000af 89 87 8c 00 00
+ 00 mov DWORD PTR [edi+140], eax
+
+; 523 : s->nice_match = configuration_table[level].nice_length;
+
+ 000b5 0f b7 04 8d 04
+ 00 00 00 movzx eax, WORD PTR _configuration_table[ecx*4+4]
+ 000bd 89 87 90 00 00
+ 00 mov DWORD PTR [edi+144], eax
+
+; 524 : s->max_chain_length = configuration_table[level].max_chain;
+
+ 000c3 0f b7 04 8d 06
+ 00 00 00 movzx eax, WORD PTR _configuration_table[ecx*4+6]
+ 000cb 89 47 7c mov DWORD PTR [edi+124], eax
+$LN10@deflatePar:
+
+; 525 : }
+; 526 : s->strategy = strategy;
+
+ 000ce 8b 45 10 mov eax, DWORD PTR _strategy$[ebp]
+ 000d1 5e pop esi
+ 000d2 89 87 88 00 00
+ 00 mov DWORD PTR [edi+136], eax
+
+; 527 : return err;
+
+ 000d8 8b c2 mov eax, edx
+ 000da 5f pop edi
+ 000db 5b pop ebx
+
+; 528 : }
+
+ 000dc 5d pop ebp
+ 000dd c2 0c 00 ret 12 ; 0000000cH
+$LN6@deflatePar:
+ 000e0 5e pop esi
+ 000e1 5f pop edi
+
+; 508 : return Z_STREAM_ERROR;
+
+ 000e2 b8 fe ff ff ff mov eax, -2 ; fffffffeH
+ 000e7 5b pop ebx
+
+; 528 : }
+
+ 000e8 5d pop ebp
+ 000e9 c2 0c 00 ret 12 ; 0000000cH
+$LN3@deflatePar:
+ 000ec 5f pop edi
+
+; 495 : deflate_state *s;
+; 496 : compress_func func;
+; 497 : int err = Z_OK;
+; 498 :
+; 499 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 000ed b8 fe ff ff ff mov eax, -2 ; fffffffeH
+ 000f2 5b pop ebx
+
+; 528 : }
+
+ 000f3 5d pop ebp
+ 000f4 c2 0c 00 ret 12 ; 0000000cH
+_deflateParams@12 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\deflate.c
+; COMDAT _deflateTune@20
+_TEXT SEGMENT
+_strm$ = 8 ; size = 4
+_good_length$ = 12 ; size = 4
+_max_lazy$ = 16 ; size = 4
+_nice_length$ = 20 ; size = 4
+_max_chain$ = 24 ; size = 4
+_deflateTune@20 PROC ; COMDAT
+
+; 537 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 538 : deflate_state *s;
+; 539 :
+; 540 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 00003 8b 4d 08 mov ecx, DWORD PTR _strm$[ebp]
+ 00006 85 c9 test ecx, ecx
+ 00008 74 2e je SHORT $LN3@deflateTun
+ 0000a 8b 49 1c mov ecx, DWORD PTR [ecx+28]
+ 0000d 85 c9 test ecx, ecx
+ 0000f 74 27 je SHORT $LN3@deflateTun
+
+; 541 : s = strm->state;
+; 542 : s->good_match = good_length;
+
+ 00011 8b 45 0c mov eax, DWORD PTR _good_length$[ebp]
+ 00014 89 81 8c 00 00
+ 00 mov DWORD PTR [ecx+140], eax
+
+; 543 : s->max_lazy_match = max_lazy;
+
+ 0001a 8b 45 10 mov eax, DWORD PTR _max_lazy$[ebp]
+ 0001d 89 81 80 00 00
+ 00 mov DWORD PTR [ecx+128], eax
+
+; 544 : s->nice_match = nice_length;
+
+ 00023 8b 45 14 mov eax, DWORD PTR _nice_length$[ebp]
+ 00026 89 81 90 00 00
+ 00 mov DWORD PTR [ecx+144], eax
+
+; 545 : s->max_chain_length = max_chain;
+
+ 0002c 8b 45 18 mov eax, DWORD PTR _max_chain$[ebp]
+ 0002f 89 41 7c mov DWORD PTR [ecx+124], eax
+
+; 546 : return Z_OK;
+
+ 00032 33 c0 xor eax, eax
+
+; 547 : }
+
+ 00034 5d pop ebp
+ 00035 c2 14 00 ret 20 ; 00000014H
+$LN3@deflateTun:
+
+; 538 : deflate_state *s;
+; 539 :
+; 540 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 00038 b8 fe ff ff ff mov eax, -2 ; fffffffeH
+
+; 547 : }
+
+ 0003d 5d pop ebp
+ 0003e c2 14 00 ret 20 ; 00000014H
+_deflateTune@20 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\deflate.c
+; COMDAT _deflateBound@8
+_TEXT SEGMENT
+_strm$ = 8 ; size = 4
+_complen$1$ = 12 ; size = 4
+_sourceLen$ = 12 ; size = 4
+_deflateBound@8 PROC ; COMDAT
+
+; 569 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 570 : deflate_state *s;
+; 571 : uLong complen, wraplen;
+; 572 : Bytef *str;
+; 573 :
+; 574 : /* conservative upper bound for compressed data */
+; 575 : complen = sourceLen +
+; 576 : ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 5;
+; 577 :
+; 578 : /* if can't get parameters, return conservative bound plus zlib wrapper */
+; 579 : if (strm == Z_NULL || strm->state == Z_NULL)
+
+ 00003 8b 55 08 mov edx, DWORD PTR _strm$[ebp]
+ 00006 53 push ebx
+ 00007 8b 5d 0c mov ebx, DWORD PTR _sourceLen$[ebp]
+ 0000a 8d 4b 3f lea ecx, DWORD PTR [ebx+63]
+ 0000d c1 e9 06 shr ecx, 6
+ 00010 8d 43 07 lea eax, DWORD PTR [ebx+7]
+ 00013 c1 e8 03 shr eax, 3
+ 00016 03 cb add ecx, ebx
+ 00018 83 c0 05 add eax, 5
+ 0001b 03 c8 add ecx, eax
+ 0001d 89 4d 0c mov DWORD PTR _complen$1$[ebp], ecx
+ 00020 85 d2 test edx, edx
+ 00022 0f 84 bd 00 00
+ 00 je $LN11@deflateBou
+ 00028 8b 52 1c mov edx, DWORD PTR [edx+28]
+ 0002b 85 d2 test edx, edx
+ 0002d 0f 84 b2 00 00
+ 00 je $LN11@deflateBou
+
+; 581 :
+; 582 : /* compute wrapper length */
+; 583 : s = strm->state;
+; 584 : switch (s->wrap) {
+
+ 00033 8b 42 18 mov eax, DWORD PTR [edx+24]
+ 00036 56 push esi
+ 00037 83 e8 00 sub eax, 0
+ 0003a 0f 84 98 00 00
+ 00 je $LN12@deflateBou
+ 00040 83 e8 01 sub eax, 1
+ 00043 0f 84 80 00 00
+ 00 je $LN13@deflateBou
+ 00049 83 e8 01 sub eax, 1
+ 0004c 74 07 je SHORT $LN14@deflateBou
+
+; 610 : default: /* for compiler happiness */
+; 611 : wraplen = 6;
+
+ 0004e be 06 00 00 00 mov esi, 6
+ 00053 eb 48 jmp SHORT $LN2@deflateBou
+$LN14@deflateBou:
+ 00055 57 push edi
+
+; 591 : case 2: /* gzip wrapper */
+; 592 : wraplen = 18;
+; 593 : if (s->gzhead != Z_NULL) { /* user-supplied gzip header */
+
+ 00056 8b 7a 1c mov edi, DWORD PTR [edx+28]
+ 00059 be 12 00 00 00 mov esi, 18 ; 00000012H
+ 0005e 85 ff test edi, edi
+ 00060 74 3a je SHORT $LN32@deflateBou
+
+; 594 : if (s->gzhead->extra != Z_NULL)
+
+ 00062 83 7f 10 00 cmp DWORD PTR [edi+16], 0
+ 00066 74 06 je SHORT $LN16@deflateBou
+
+; 595 : wraplen += 2 + s->gzhead->extra_len;
+
+ 00068 8b 77 14 mov esi, DWORD PTR [edi+20]
+ 0006b 83 c6 14 add esi, 20 ; 00000014H
+$LN16@deflateBou:
+
+; 596 : str = s->gzhead->name;
+
+ 0006e 8b 4f 1c mov ecx, DWORD PTR [edi+28]
+
+; 597 : if (str != Z_NULL)
+
+ 00071 85 c9 test ecx, ecx
+ 00073 74 0a je SHORT $LN5@deflateBou
+$LL6@deflateBou:
+
+; 598 : do {
+; 599 : wraplen++;
+; 600 : } while (*str++);
+
+ 00075 8a 01 mov al, BYTE PTR [ecx]
+ 00077 8d 49 01 lea ecx, DWORD PTR [ecx+1]
+ 0007a 46 inc esi
+ 0007b 84 c0 test al, al
+ 0007d 75 f6 jne SHORT $LL6@deflateBou
+$LN5@deflateBou:
+
+; 601 : str = s->gzhead->comment;
+
+ 0007f 8b 4f 24 mov ecx, DWORD PTR [edi+36]
+
+; 602 : if (str != Z_NULL)
+
+ 00082 85 c9 test ecx, ecx
+ 00084 74 0a je SHORT $LN8@deflateBou
+$LL9@deflateBou:
+
+; 603 : do {
+; 604 : wraplen++;
+; 605 : } while (*str++);
+
+ 00086 8a 01 mov al, BYTE PTR [ecx]
+ 00088 8d 49 01 lea ecx, DWORD PTR [ecx+1]
+ 0008b 46 inc esi
+ 0008c 84 c0 test al, al
+ 0008e 75 f6 jne SHORT $LL9@deflateBou
+$LN8@deflateBou:
+
+; 606 : if (s->gzhead->hcrc)
+
+ 00090 83 7f 2c 00 cmp DWORD PTR [edi+44], 0
+
+; 608 : }
+; 609 : break;
+
+ 00094 8b 4d 0c mov ecx, DWORD PTR _complen$1$[ebp]
+ 00097 74 03 je SHORT $LN32@deflateBou
+
+; 607 : wraplen += 2;
+
+ 00099 83 c6 02 add esi, 2
+$LN32@deflateBou:
+ 0009c 5f pop edi
+$LN2@deflateBou:
+
+; 612 : }
+; 613 :
+; 614 : /* if not default parameters, return conservative bound */
+; 615 : if (s->w_bits != 15 || s->hash_bits != 8 + 7)
+
+ 0009d 83 7a 30 0f cmp DWORD PTR [edx+48], 15 ; 0000000fH
+ 000a1 75 39 jne SHORT $LN22@deflateBou
+ 000a3 83 7a 50 0f cmp DWORD PTR [edx+80], 15 ; 0000000fH
+ 000a7 75 33 jne SHORT $LN22@deflateBou
+
+; 617 :
+; 618 : /* default settings: return tight bound for that case */
+; 619 : return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
+
+ 000a9 8b cb mov ecx, ebx
+ 000ab 8b d3 mov edx, ebx
+ 000ad c1 e9 0e shr ecx, 14 ; 0000000eH
+ 000b0 8b c3 mov eax, ebx
+ 000b2 03 ce add ecx, esi
+ 000b4 c1 e8 0c shr eax, 12 ; 0000000cH
+ 000b7 c1 ea 19 shr edx, 25 ; 00000019H
+ 000ba 83 c0 07 add eax, 7
+ 000bd 03 ca add ecx, edx
+ 000bf 03 c1 add eax, ecx
+ 000c1 5e pop esi
+ 000c2 03 c3 add eax, ebx
+ 000c4 5b pop ebx
+
+; 620 : (sourceLen >> 25) + 13 - 6 + wraplen;
+; 621 : }
+
+ 000c5 5d pop ebp
+ 000c6 c2 08 00 ret 8
+$LN13@deflateBou:
+
+; 587 : break;
+; 588 : case 1: /* zlib wrapper */
+; 589 : wraplen = 6 + (s->strstart ? 4 : 0);
+
+ 000c9 8b 72 6c mov esi, DWORD PTR [edx+108]
+ 000cc f7 de neg esi
+ 000ce 1b f6 sbb esi, esi
+ 000d0 83 e6 04 and esi, 4
+ 000d3 83 c6 06 add esi, 6
+
+; 590 : break;
+
+ 000d6 eb c5 jmp SHORT $LN2@deflateBou
+$LN12@deflateBou:
+
+; 585 : case 0: /* raw deflate */
+; 586 : wraplen = 0;
+
+ 000d8 33 f6 xor esi, esi
+ 000da eb c1 jmp SHORT $LN2@deflateBou
+$LN22@deflateBou:
+
+; 616 : return complen + wraplen;
+
+ 000dc 8d 04 0e lea eax, DWORD PTR [esi+ecx]
+ 000df 5e pop esi
+ 000e0 5b pop ebx
+
+; 620 : (sourceLen >> 25) + 13 - 6 + wraplen;
+; 621 : }
+
+ 000e1 5d pop ebp
+ 000e2 c2 08 00 ret 8
+$LN11@deflateBou:
+
+; 580 : return complen + 6;
+
+ 000e5 8d 41 06 lea eax, DWORD PTR [ecx+6]
+ 000e8 5b pop ebx
+
+; 620 : (sourceLen >> 25) + 13 - 6 + wraplen;
+; 621 : }
+
+ 000e9 5d pop ebp
+ 000ea c2 08 00 ret 8
+_deflateBound@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\deflate.c
+; COMDAT _putShortMSB
+_TEXT SEGMENT
+_putShortMSB PROC ; COMDAT
+; _s$ = ecx
+; _b$ = edx
+
+; 631 : {
+
+ 00000 56 push esi
+ 00001 57 push edi
+ 00002 8b f9 mov edi, ecx
+
+; 632 : put_byte(s, (Byte)(b >> 8));
+
+ 00004 8b ca mov ecx, edx
+ 00006 c1 e9 08 shr ecx, 8
+ 00009 8b 47 14 mov eax, DWORD PTR [edi+20]
+ 0000c 8b 77 08 mov esi, DWORD PTR [edi+8]
+ 0000f 88 0c 06 mov BYTE PTR [esi+eax], cl
+ 00012 ff 47 14 inc DWORD PTR [edi+20]
+ 00015 8b 4f 14 mov ecx, DWORD PTR [edi+20]
+
+; 633 : put_byte(s, (Byte)(b & 0xff));
+
+ 00018 8b 47 08 mov eax, DWORD PTR [edi+8]
+ 0001b 88 14 01 mov BYTE PTR [ecx+eax], dl
+ 0001e ff 47 14 inc DWORD PTR [edi+20]
+ 00021 5f pop edi
+ 00022 5e pop esi
+
+; 634 : }
+
+ 00023 c3 ret 0
+_putShortMSB ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\deflate.c
+; COMDAT _flush_pending
+_TEXT SEGMENT
+_flush_pending PROC ; COMDAT
+; _strm$ = ecx
+
+; 644 : {
+
+ 00000 53 push ebx
+ 00001 8b d9 mov ebx, ecx
+ 00003 56 push esi
+ 00004 57 push edi
+
+; 645 : unsigned len;
+; 646 : deflate_state *s = strm->state;
+
+ 00005 8b 73 1c mov esi, DWORD PTR [ebx+28]
+
+; 647 :
+; 648 : _tr_flush_bits(s);
+
+ 00008 8b ce mov ecx, esi
+ 0000a e8 00 00 00 00 call __tr_flush_bits
+
+; 649 : len = s->pending;
+
+ 0000f 8b 7e 14 mov edi, DWORD PTR [esi+20]
+
+; 650 : if (len > strm->avail_out) len = strm->avail_out;
+
+ 00012 3b 7b 10 cmp edi, DWORD PTR [ebx+16]
+ 00015 0f 47 7b 10 cmova edi, DWORD PTR [ebx+16]
+
+; 651 : if (len == 0) return;
+
+ 00019 85 ff test edi, edi
+ 0001b 74 26 je SHORT $LN4@flush_pend
+
+; 652 :
+; 653 : zmemcpy(strm->next_out, s->pending_out, len);
+
+ 0001d 57 push edi
+ 0001e ff 76 10 push DWORD PTR [esi+16]
+ 00021 ff 73 0c push DWORD PTR [ebx+12]
+ 00024 e8 00 00 00 00 call _memcpy
+
+; 654 : strm->next_out += len;
+
+ 00029 01 7b 0c add DWORD PTR [ebx+12], edi
+ 0002c 83 c4 0c add esp, 12 ; 0000000cH
+
+; 655 : s->pending_out += len;
+
+ 0002f 01 7e 10 add DWORD PTR [esi+16], edi
+
+; 656 : strm->total_out += len;
+
+ 00032 01 7b 14 add DWORD PTR [ebx+20], edi
+
+; 657 : strm->avail_out -= len;
+
+ 00035 29 7b 10 sub DWORD PTR [ebx+16], edi
+
+; 658 : s->pending -= len;
+
+ 00038 29 7e 14 sub DWORD PTR [esi+20], edi
+
+; 659 : if (s->pending == 0) {
+
+ 0003b 75 06 jne SHORT $LN4@flush_pend
+
+; 660 : s->pending_out = s->pending_buf;
+
+ 0003d 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 00040 89 46 10 mov DWORD PTR [esi+16], eax
+$LN4@flush_pend:
+
+; 661 : }
+; 662 : }
+
+ 00043 5f pop edi
+ 00044 5e pop esi
+ 00045 5b pop ebx
+ 00046 c3 ret 0
+_flush_pending ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\deflate.c
+; COMDAT _deflateCopy@8
+_TEXT SEGMENT
+_dest$ = 8 ; size = 4
+_overlay$1$ = 12 ; size = 4
+_source$ = 12 ; size = 4
+_deflateCopy@8 PROC ; COMDAT
+
+; 1017 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 1018 : #ifdef MAXSEG_64K
+; 1019 : return Z_STREAM_ERROR;
+; 1020 : #else
+; 1021 : deflate_state *ds;
+; 1022 : deflate_state *ss;
+; 1023 : ushf *overlay;
+; 1024 :
+; 1025 :
+; 1026 : if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) {
+
+ 00003 8b 45 0c mov eax, DWORD PTR _source$[ebp]
+ 00006 53 push ebx
+ 00007 56 push esi
+ 00008 85 c0 test eax, eax
+ 0000a 0f 84 84 01 00
+ 00 je $LN3@deflateCop
+ 00010 8b 75 08 mov esi, DWORD PTR _dest$[ebp]
+ 00013 85 f6 test esi, esi
+ 00015 0f 84 79 01 00
+ 00 je $LN3@deflateCop
+ 0001b 8b 58 1c mov ebx, DWORD PTR [eax+28]
+ 0001e 85 db test ebx, ebx
+ 00020 0f 84 6e 01 00
+ 00 je $LN3@deflateCop
+
+; 1028 : }
+; 1029 :
+; 1030 : ss = source->state;
+; 1031 :
+; 1032 : zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream));
+
+ 00026 0f 10 00 movups xmm0, XMMWORD PTR [eax]
+ 00029 57 push edi
+
+; 1033 :
+; 1034 : ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state));
+
+ 0002a 68 c4 16 00 00 push 5828 ; 000016c4H
+ 0002f 0f 11 06 movups XMMWORD PTR [esi], xmm0
+ 00032 6a 01 push 1
+ 00034 0f 10 40 10 movups xmm0, XMMWORD PTR [eax+16]
+ 00038 0f 11 46 10 movups XMMWORD PTR [esi+16], xmm0
+ 0003c 0f 10 40 20 movups xmm0, XMMWORD PTR [eax+32]
+ 00040 0f 11 46 20 movups XMMWORD PTR [esi+32], xmm0
+ 00044 f3 0f 7e 40 30 movq xmm0, QWORD PTR [eax+48]
+ 00049 66 0f d6 46 30 movq QWORD PTR [esi+48], xmm0
+ 0004e ff 76 28 push DWORD PTR [esi+40]
+ 00051 8b 46 20 mov eax, DWORD PTR [esi+32]
+ 00054 ff d0 call eax
+ 00056 8b f8 mov edi, eax
+ 00058 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1035 : if (ds == Z_NULL) return Z_MEM_ERROR;
+
+ 0005b 85 ff test edi, edi
+ 0005d 0f 84 25 01 00
+ 00 je $LN9@deflateCop
+
+; 1036 : dest->state = (struct internal_state FAR *) ds;
+; 1037 : zmemcpy((voidpf)ds, (voidpf)ss, sizeof(deflate_state));
+
+ 00063 68 c4 16 00 00 push 5828 ; 000016c4H
+ 00068 53 push ebx
+ 00069 57 push edi
+ 0006a 89 7e 1c mov DWORD PTR [esi+28], edi
+ 0006d e8 00 00 00 00 call _memcpy
+
+; 1038 : ds->strm = dest;
+; 1039 :
+; 1040 : ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte));
+
+ 00072 6a 02 push 2
+ 00074 ff 77 2c push DWORD PTR [edi+44]
+ 00077 89 37 mov DWORD PTR [edi], esi
+ 00079 ff 76 28 push DWORD PTR [esi+40]
+ 0007c 8b 46 20 mov eax, DWORD PTR [esi+32]
+ 0007f ff d0 call eax
+
+; 1041 : ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos));
+
+ 00081 6a 02 push 2
+ 00083 ff 77 2c push DWORD PTR [edi+44]
+ 00086 89 47 38 mov DWORD PTR [edi+56], eax
+ 00089 ff 76 28 push DWORD PTR [esi+40]
+ 0008c 8b 46 20 mov eax, DWORD PTR [esi+32]
+ 0008f ff d0 call eax
+
+; 1042 : ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos));
+
+ 00091 6a 02 push 2
+ 00093 ff 77 4c push DWORD PTR [edi+76]
+ 00096 89 47 40 mov DWORD PTR [edi+64], eax
+ 00099 ff 76 28 push DWORD PTR [esi+40]
+ 0009c 8b 46 20 mov eax, DWORD PTR [esi+32]
+ 0009f ff d0 call eax
+
+; 1043 : overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2);
+
+ 000a1 6a 04 push 4
+ 000a3 ff b7 9c 16 00
+ 00 push DWORD PTR [edi+5788]
+ 000a9 89 47 44 mov DWORD PTR [edi+68], eax
+ 000ac ff 76 28 push DWORD PTR [esi+40]
+ 000af 8b 46 20 mov eax, DWORD PTR [esi+32]
+ 000b2 ff d0 call eax
+
+; 1044 : ds->pending_buf = (uchf *) overlay;
+; 1045 :
+; 1046 : if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL ||
+
+ 000b4 8b 4f 38 mov ecx, DWORD PTR [edi+56]
+ 000b7 83 c4 3c add esp, 60 ; 0000003cH
+ 000ba 89 45 0c mov DWORD PTR _overlay$1$[ebp], eax
+ 000bd 89 47 08 mov DWORD PTR [edi+8], eax
+ 000c0 85 c9 test ecx, ecx
+ 000c2 0f 84 ba 00 00
+ 00 je $LN6@deflateCop
+ 000c8 83 7f 40 00 cmp DWORD PTR [edi+64], 0
+ 000cc 0f 84 b0 00 00
+ 00 je $LN6@deflateCop
+ 000d2 83 7f 44 00 cmp DWORD PTR [edi+68], 0
+ 000d6 0f 84 a6 00 00
+ 00 je $LN6@deflateCop
+ 000dc 85 c0 test eax, eax
+ 000de 0f 84 9e 00 00
+ 00 je $LN6@deflateCop
+
+; 1050 : }
+; 1051 : /* following zmemcpy do not work for 16-bit MSDOS */
+; 1052 : zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte));
+
+ 000e4 8b 47 2c mov eax, DWORD PTR [edi+44]
+ 000e7 03 c0 add eax, eax
+ 000e9 50 push eax
+ 000ea ff 73 38 push DWORD PTR [ebx+56]
+ 000ed 51 push ecx
+ 000ee e8 00 00 00 00 call _memcpy
+
+; 1053 : zmemcpy((voidpf)ds->prev, (voidpf)ss->prev, ds->w_size * sizeof(Pos));
+
+ 000f3 8b 47 2c mov eax, DWORD PTR [edi+44]
+ 000f6 03 c0 add eax, eax
+ 000f8 50 push eax
+ 000f9 ff 73 40 push DWORD PTR [ebx+64]
+ 000fc ff 77 40 push DWORD PTR [edi+64]
+ 000ff e8 00 00 00 00 call _memcpy
+
+; 1054 : zmemcpy((voidpf)ds->head, (voidpf)ss->head, ds->hash_size * sizeof(Pos));
+
+ 00104 8b 47 4c mov eax, DWORD PTR [edi+76]
+ 00107 03 c0 add eax, eax
+ 00109 50 push eax
+ 0010a ff 73 44 push DWORD PTR [ebx+68]
+ 0010d ff 77 44 push DWORD PTR [edi+68]
+ 00110 e8 00 00 00 00 call _memcpy
+
+; 1055 : zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);
+
+ 00115 ff 77 0c push DWORD PTR [edi+12]
+ 00118 ff 73 08 push DWORD PTR [ebx+8]
+ 0011b ff 77 08 push DWORD PTR [edi+8]
+ 0011e e8 00 00 00 00 call _memcpy
+
+; 1056 :
+; 1057 : ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);
+
+ 00123 8b 43 10 mov eax, DWORD PTR [ebx+16]
+ 00126 83 c4 30 add esp, 48 ; 00000030H
+ 00129 2b 43 08 sub eax, DWORD PTR [ebx+8]
+ 0012c 8b 57 08 mov edx, DWORD PTR [edi+8]
+ 0012f 03 c2 add eax, edx
+
+; 1058 : ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush);
+
+ 00131 8b 8f 9c 16 00
+ 00 mov ecx, DWORD PTR [edi+5788]
+ 00137 8b 75 0c mov esi, DWORD PTR _overlay$1$[ebp]
+ 0013a 89 47 10 mov DWORD PTR [edi+16], eax
+ 0013d 8b c1 mov eax, ecx
+ 0013f d1 e8 shr eax, 1
+ 00141 8d 04 46 lea eax, DWORD PTR [esi+eax*2]
+ 00144 89 87 a4 16 00
+ 00 mov DWORD PTR [edi+5796], eax
+
+; 1059 : ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize;
+
+ 0014a 8d 04 4a lea eax, DWORD PTR [edx+ecx*2]
+ 0014d 03 c1 add eax, ecx
+ 0014f 89 87 98 16 00
+ 00 mov DWORD PTR [edi+5784], eax
+
+; 1060 :
+; 1061 : ds->l_desc.dyn_tree = ds->dyn_ltree;
+
+ 00155 8d 87 94 00 00
+ 00 lea eax, DWORD PTR [edi+148]
+ 0015b 89 87 18 0b 00
+ 00 mov DWORD PTR [edi+2840], eax
+
+; 1062 : ds->d_desc.dyn_tree = ds->dyn_dtree;
+
+ 00161 8d 87 88 09 00
+ 00 lea eax, DWORD PTR [edi+2440]
+ 00167 89 87 24 0b 00
+ 00 mov DWORD PTR [edi+2852], eax
+
+; 1063 : ds->bl_desc.dyn_tree = ds->bl_tree;
+
+ 0016d 8d 87 7c 0a 00
+ 00 lea eax, DWORD PTR [edi+2684]
+ 00173 89 87 30 0b 00
+ 00 mov DWORD PTR [edi+2864], eax
+
+; 1064 :
+; 1065 : return Z_OK;
+
+ 00179 33 c0 xor eax, eax
+ 0017b 5f pop edi
+ 0017c 5e pop esi
+ 0017d 5b pop ebx
+
+; 1066 : #endif /* MAXSEG_64K */
+; 1067 : }
+
+ 0017e 5d pop ebp
+ 0017f c2 08 00 ret 8
+$LN6@deflateCop:
+
+; 1047 : ds->pending_buf == Z_NULL) {
+; 1048 : deflateEnd (dest);
+
+ 00182 56 push esi
+ 00183 e8 00 00 00 00 call _deflateEnd@4
+$LN9@deflateCop:
+
+; 1049 : return Z_MEM_ERROR;
+
+ 00188 5f pop edi
+ 00189 5e pop esi
+ 0018a b8 fc ff ff ff mov eax, -4 ; fffffffcH
+ 0018f 5b pop ebx
+
+; 1066 : #endif /* MAXSEG_64K */
+; 1067 : }
+
+ 00190 5d pop ebp
+ 00191 c2 08 00 ret 8
+$LN3@deflateCop:
+ 00194 5e pop esi
+
+; 1027 : return Z_STREAM_ERROR;
+
+ 00195 b8 fe ff ff ff mov eax, -2 ; fffffffeH
+ 0019a 5b pop ebx
+
+; 1066 : #endif /* MAXSEG_64K */
+; 1067 : }
+
+ 0019b 5d pop ebp
+ 0019c c2 08 00 ret 8
+_deflateCopy@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\deflate.c
+; COMDAT _read_buf
+_TEXT SEGMENT
+_size$ = 8 ; size = 4
+_read_buf PROC ; COMDAT
+; _strm$ = ecx
+; _buf$ = edx
+
+; 1080 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 53 push ebx
+ 00004 56 push esi
+ 00005 8b f1 mov esi, ecx
+ 00007 8b da mov ebx, edx
+ 00009 57 push edi
+
+; 1081 : unsigned len = strm->avail_in;
+
+ 0000a 8b 4e 04 mov ecx, DWORD PTR [esi+4]
+
+; 1082 :
+; 1083 : if (len > size) len = size;
+
+ 0000d 8b f9 mov edi, ecx
+ 0000f 3b 4d 08 cmp ecx, DWORD PTR _size$[ebp]
+ 00012 0f 47 7d 08 cmova edi, DWORD PTR _size$[ebp]
+
+; 1084 : if (len == 0) return 0;
+
+ 00016 85 ff test edi, edi
+ 00018 75 07 jne SHORT $LN3@read_buf
+ 0001a 5f pop edi
+ 0001b 5e pop esi
+ 0001c 33 c0 xor eax, eax
+ 0001e 5b pop ebx
+
+; 1101 : }
+
+ 0001f 5d pop ebp
+ 00020 c3 ret 0
+$LN3@read_buf:
+
+; 1085 :
+; 1086 : strm->avail_in -= len;
+; 1087 :
+; 1088 : zmemcpy(buf, strm->next_in, len);
+
+ 00021 57 push edi
+ 00022 ff 36 push DWORD PTR [esi]
+ 00024 2b cf sub ecx, edi
+ 00026 53 push ebx
+ 00027 89 4e 04 mov DWORD PTR [esi+4], ecx
+ 0002a e8 00 00 00 00 call _memcpy
+
+; 1089 : if (strm->state->wrap == 1) {
+
+ 0002f 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 00032 83 c4 0c add esp, 12 ; 0000000cH
+ 00035 8b 40 18 mov eax, DWORD PTR [eax+24]
+ 00038 83 f8 01 cmp eax, 1
+ 0003b 75 19 jne SHORT $LN4@read_buf
+
+; 1090 : strm->adler = adler32(strm->adler, buf, len);
+
+ 0003d 57 push edi
+ 0003e 53 push ebx
+ 0003f ff 76 30 push DWORD PTR [esi+48]
+ 00042 e8 00 00 00 00 call _adler32@12
+
+; 1095 : }
+; 1096 : #endif
+; 1097 : strm->next_in += len;
+
+ 00047 01 3e add DWORD PTR [esi], edi
+
+; 1098 : strm->total_in += len;
+
+ 00049 01 7e 08 add DWORD PTR [esi+8], edi
+ 0004c 89 46 30 mov DWORD PTR [esi+48], eax
+
+; 1099 :
+; 1100 : return (int)len;
+
+ 0004f 8b c7 mov eax, edi
+ 00051 5f pop edi
+ 00052 5e pop esi
+ 00053 5b pop ebx
+
+; 1101 : }
+
+ 00054 5d pop ebp
+ 00055 c3 ret 0
+$LN4@read_buf:
+
+; 1091 : }
+; 1092 : #ifdef GZIP
+; 1093 : else if (strm->state->wrap == 2) {
+
+ 00056 83 f8 02 cmp eax, 2
+ 00059 75 0d jne SHORT $LN6@read_buf
+
+; 1094 : strm->adler = crc32(strm->adler, buf, len);
+
+ 0005b 57 push edi
+ 0005c 53 push ebx
+ 0005d ff 76 30 push DWORD PTR [esi+48]
+ 00060 e8 00 00 00 00 call _crc32@12
+ 00065 89 46 30 mov DWORD PTR [esi+48], eax
+$LN6@read_buf:
+
+; 1095 : }
+; 1096 : #endif
+; 1097 : strm->next_in += len;
+
+ 00068 01 3e add DWORD PTR [esi], edi
+
+; 1099 :
+; 1100 : return (int)len;
+
+ 0006a 8b c7 mov eax, edi
+ 0006c 01 7e 08 add DWORD PTR [esi+8], edi
+ 0006f 5f pop edi
+ 00070 5e pop esi
+ 00071 5b pop ebx
+
+; 1101 : }
+
+ 00072 5d pop ebp
+ 00073 c3 ret 0
+_read_buf ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\deflate.c
+; COMDAT _lm_init
+_TEXT SEGMENT
+_lm_init PROC ; COMDAT
+; _s$ = ecx
+
+; 1108 : {
+
+ 00000 56 push esi
+ 00001 8b f1 mov esi, ecx
+
+; 1109 : s->window_size = (ulg)2L*s->w_size;
+; 1110 :
+; 1111 : CLEAR_HASH(s);
+
+ 00003 33 c9 xor ecx, ecx
+ 00005 8b 46 2c mov eax, DWORD PTR [esi+44]
+ 00008 8b 56 4c mov edx, DWORD PTR [esi+76]
+ 0000b 03 c0 add eax, eax
+ 0000d 89 46 3c mov DWORD PTR [esi+60], eax
+ 00010 8b 46 44 mov eax, DWORD PTR [esi+68]
+ 00013 66 89 4c 50 fe mov WORD PTR [eax+edx*2-2], cx
+ 00018 8b 46 4c mov eax, DWORD PTR [esi+76]
+ 0001b 8d 04 45 fe ff
+ ff ff lea eax, DWORD PTR [eax*2-2]
+ 00022 50 push eax
+ 00023 51 push ecx
+ 00024 ff 76 44 push DWORD PTR [esi+68]
+ 00027 e8 00 00 00 00 call _memset
+
+; 1112 :
+; 1113 : /* Set the default configuration parameters:
+; 1114 : */
+; 1115 : s->max_lazy_match = configuration_table[s->level].max_lazy;
+
+ 0002c 8b 86 84 00 00
+ 00 mov eax, DWORD PTR [esi+132]
+ 00032 83 c4 0c add esp, 12 ; 0000000cH
+ 00035 8d 0c 40 lea ecx, DWORD PTR [eax+eax*2]
+ 00038 0f b7 04 8d 02
+ 00 00 00 movzx eax, WORD PTR _configuration_table[ecx*4+2]
+ 00040 89 86 80 00 00
+ 00 mov DWORD PTR [esi+128], eax
+
+; 1116 : s->good_match = configuration_table[s->level].good_length;
+
+ 00046 0f b7 04 8d 00
+ 00 00 00 movzx eax, WORD PTR _configuration_table[ecx*4]
+ 0004e 89 86 8c 00 00
+ 00 mov DWORD PTR [esi+140], eax
+
+; 1117 : s->nice_match = configuration_table[s->level].nice_length;
+
+ 00054 0f b7 04 8d 04
+ 00 00 00 movzx eax, WORD PTR _configuration_table[ecx*4+4]
+ 0005c 89 86 90 00 00
+ 00 mov DWORD PTR [esi+144], eax
+
+; 1118 : s->max_chain_length = configuration_table[s->level].max_chain;
+
+ 00062 0f b7 04 8d 06
+ 00 00 00 movzx eax, WORD PTR _configuration_table[ecx*4+6]
+ 0006a 89 46 7c mov DWORD PTR [esi+124], eax
+
+; 1119 :
+; 1120 : s->strstart = 0;
+
+ 0006d c7 46 6c 00 00
+ 00 00 mov DWORD PTR [esi+108], 0
+
+; 1121 : s->block_start = 0L;
+
+ 00074 c7 46 5c 00 00
+ 00 00 mov DWORD PTR [esi+92], 0
+
+; 1122 : s->lookahead = 0;
+
+ 0007b c7 46 74 00 00
+ 00 00 mov DWORD PTR [esi+116], 0
+
+; 1123 : s->insert = 0;
+
+ 00082 c7 86 b4 16 00
+ 00 00 00 00 00 mov DWORD PTR [esi+5812], 0
+
+; 1124 : s->match_length = s->prev_length = MIN_MATCH-1;
+
+ 0008c c7 46 78 02 00
+ 00 00 mov DWORD PTR [esi+120], 2
+ 00093 c7 46 60 02 00
+ 00 00 mov DWORD PTR [esi+96], 2
+
+; 1125 : s->match_available = 0;
+
+ 0009a c7 46 68 00 00
+ 00 00 mov DWORD PTR [esi+104], 0
+
+; 1126 : s->ins_h = 0;
+
+ 000a1 c7 46 48 00 00
+ 00 00 mov DWORD PTR [esi+72], 0
+ 000a8 5e pop esi
+
+; 1127 : #ifndef FASTEST
+; 1128 : #ifdef ASMV
+; 1129 : match_init(); /* initialize the asm code */
+; 1130 : #endif
+; 1131 : #endif
+; 1132 : }
+
+ 000a9 c3 ret 0
+_lm_init ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\deflate.c
+; COMDAT _longest_match
+_TEXT SEGMENT
+tv373 = -36 ; size = 4
+_prev$1$ = -32 ; size = 4
+_wmask$1$ = -28 ; size = 4
+tv381 = -24 ; size = 4
+_limit$1$ = -20 ; size = 4
+_s$1$ = -16 ; size = 4
+_chain_length$1$ = -12 ; size = 4
+_nice_match$2$ = -8 ; size = 4
+_scan_end$1$ = -2 ; size = 1
+_scan_end1$1$ = -1 ; size = 1
+_longest_match PROC ; COMDAT
+; _s$ = ecx
+; _cur_match$ = edx
+
+; 1151 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 24 sub esp, 36 ; 00000024H
+ 00006 53 push ebx
+ 00007 56 push esi
+ 00008 8b f1 mov esi, ecx
+ 0000a 8b da mov ebx, edx
+ 0000c 57 push edi
+ 0000d 89 75 f0 mov DWORD PTR _s$1$[ebp], esi
+
+; 1152 : unsigned chain_length = s->max_chain_length;/* max hash chain length */
+
+ 00010 8b 46 7c mov eax, DWORD PTR [esi+124]
+
+; 1153 : register Bytef *scan = s->window + s->strstart; /* current string */
+
+ 00013 8b 4e 38 mov ecx, DWORD PTR [esi+56]
+
+; 1154 : register Bytef *match; /* matched string */
+; 1155 : register int len; /* length of current match */
+; 1156 : int best_len = s->prev_length; /* best match length so far */
+; 1157 : int nice_match = s->nice_match; /* stop if match long enough */
+; 1158 : IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
+
+ 00016 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00019 8b 7e 78 mov edi, DWORD PTR [esi+120]
+ 0001c 89 45 f4 mov DWORD PTR _chain_length$1$[ebp], eax
+ 0001f 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 00022 03 c1 add eax, ecx
+ 00024 89 4d e8 mov DWORD PTR tv381[ebp], ecx
+ 00027 8b 8e 90 00 00
+ 00 mov ecx, DWORD PTR [esi+144]
+ 0002d 89 4d f8 mov DWORD PTR _nice_match$2$[ebp], ecx
+ 00030 8d 8a fa fe ff
+ ff lea ecx, DWORD PTR [edx-262]
+ 00036 39 4e 6c cmp DWORD PTR [esi+108], ecx
+ 00039 76 10 jbe SHORT $LN18@longest_ma
+ 0003b 8b 4e 6c mov ecx, DWORD PTR [esi+108]
+ 0003e 2b ca sub ecx, edx
+ 00040 81 c1 06 01 00
+ 00 add ecx, 262 ; 00000106H
+ 00046 89 4d ec mov DWORD PTR _limit$1$[ebp], ecx
+ 00049 eb 07 jmp SHORT $LN19@longest_ma
+$LN18@longest_ma:
+ 0004b c7 45 ec 00 00
+ 00 00 mov DWORD PTR _limit$1$[ebp], 0
+$LN19@longest_ma:
+
+; 1159 : s->strstart - (IPos)MAX_DIST(s) : NIL;
+; 1160 : /* Stop when cur_match becomes <= limit. To simplify the code,
+; 1161 : * we prevent matches with the string of window index 0.
+; 1162 : */
+; 1163 : Posf *prev = s->prev;
+
+ 00052 8b 4e 40 mov ecx, DWORD PTR [esi+64]
+ 00055 89 4d e0 mov DWORD PTR _prev$1$[ebp], ecx
+
+; 1164 : uInt wmask = s->w_mask;
+
+ 00058 8b 4e 34 mov ecx, DWORD PTR [esi+52]
+
+; 1165 :
+; 1166 : #ifdef UNALIGNED_OK
+; 1167 : /* Compare two bytes at a time. Note: this is not always beneficial.
+; 1168 : * Try with and without -DUNALIGNED_OK to check.
+; 1169 : */
+; 1170 : register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
+; 1171 : register ush scan_start = *(ushf*)scan;
+; 1172 : register ush scan_end = *(ushf*)(scan+best_len-1);
+; 1173 : #else
+; 1174 : register Bytef *strend = s->window + s->strstart + MAX_MATCH;
+
+ 0005b 8d b0 02 01 00
+ 00 lea esi, DWORD PTR [eax+258]
+ 00061 89 4d e4 mov DWORD PTR _wmask$1$[ebp], ecx
+
+; 1175 : register Byte scan_end1 = scan[best_len-1];
+
+ 00064 8a 4c 07 ff mov cl, BYTE PTR [edi+eax-1]
+ 00068 88 4d ff mov BYTE PTR _scan_end1$1$[ebp], cl
+
+; 1176 : register Byte scan_end = scan[best_len];
+
+ 0006b 8a 0c 07 mov cl, BYTE PTR [edi+eax]
+ 0006e 88 4d fe mov BYTE PTR _scan_end$1$[ebp], cl
+
+; 1177 : #endif
+; 1178 :
+; 1179 : /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
+; 1180 : * It is easy to get rid of this optimization if necessary.
+; 1181 : */
+; 1182 : Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
+; 1183 :
+; 1184 : /* Do not waste too much time if we already have a good match: */
+; 1185 : if (s->prev_length >= s->good_match) {
+
+ 00071 8b 4d f0 mov ecx, DWORD PTR _s$1$[ebp]
+ 00074 3b b9 8c 00 00
+ 00 cmp edi, DWORD PTR [ecx+140]
+ 0007a 72 09 jb SHORT $LN8@longest_ma
+
+; 1186 : chain_length >>= 2;
+
+ 0007c 8b 51 7c mov edx, DWORD PTR [ecx+124]
+ 0007f c1 ea 02 shr edx, 2
+ 00082 89 55 f4 mov DWORD PTR _chain_length$1$[ebp], edx
+$LN8@longest_ma:
+
+; 1187 : }
+; 1188 : /* Do not look for matches beyond the end of the input. This is necessary
+; 1189 : * to make deflate deterministic.
+; 1190 : */
+; 1191 : if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
+
+ 00085 8b 49 74 mov ecx, DWORD PTR [ecx+116]
+ 00088 8b 55 f8 mov edx, DWORD PTR _nice_match$2$[ebp]
+ 0008b 3b d1 cmp edx, ecx
+ 0008d 89 4d dc mov DWORD PTR tv373[ebp], ecx
+ 00090 0f 47 d1 cmova edx, ecx
+ 00093 89 55 f8 mov DWORD PTR _nice_match$2$[ebp], edx
+$LL4@longest_ma:
+
+; 1192 :
+; 1193 : Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
+; 1194 :
+; 1195 : do {
+; 1196 : Assert(cur_match < s->strstart, "no future");
+; 1197 : match = s->window + cur_match;
+
+ 00096 8b 55 e8 mov edx, DWORD PTR tv381[ebp]
+
+; 1198 :
+; 1199 : /* Skip to next match if the match length cannot increase
+; 1200 : * or if the match length is less than 2. Note that the checks below
+; 1201 : * for insufficient lookahead only occur occasionally for performance
+; 1202 : * reasons. Therefore uninitialized memory will be accessed, and
+; 1203 : * conditional jumps will be made that depend on those values.
+; 1204 : * However the length of the match is limited to the lookahead, so
+; 1205 : * the output of deflate is not affected by the uninitialized values.
+; 1206 : */
+; 1207 : #if (defined(UNALIGNED_OK) && MAX_MATCH == 258)
+; 1208 : /* This code assumes sizeof(unsigned short) == 2. Do not use
+; 1209 : * UNALIGNED_OK if your compiler uses a different size.
+; 1210 : */
+; 1211 : if (*(ushf*)(match+best_len-1) != scan_end ||
+; 1212 : *(ushf*)match != scan_start) continue;
+; 1213 :
+; 1214 : /* It is not necessary to compare scan[2] and match[2] since they are
+; 1215 : * always equal when the other bytes match, given that the hash keys
+; 1216 : * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at
+; 1217 : * strstart+3, +5, ... up to strstart+257. We check for insufficient
+; 1218 : * lookahead only every 4th comparison; the 128th check will be made
+; 1219 : * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is
+; 1220 : * necessary to put more guard bytes at the end of the window, or
+; 1221 : * to check more often for insufficient lookahead.
+; 1222 : */
+; 1223 : Assert(scan[2] == match[2], "scan[2]?");
+; 1224 : scan++, match++;
+; 1225 : do {
+; 1226 : } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+; 1227 : *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+; 1228 : *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+; 1229 : *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+; 1230 : scan < strend);
+; 1231 : /* The funny "do {}" generates better code on most compilers */
+; 1232 :
+; 1233 : /* Here, scan <= window+strstart+257 */
+; 1234 : Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+; 1235 : if (*scan == *match) scan++;
+; 1236 :
+; 1237 : len = (MAX_MATCH - 1) - (int)(strend-scan);
+; 1238 : scan = strend - (MAX_MATCH-1);
+; 1239 :
+; 1240 : #else /* UNALIGNED_OK */
+; 1241 :
+; 1242 : if (match[best_len] != scan_end ||
+; 1243 : match[best_len-1] != scan_end1 ||
+; 1244 : *match != *scan ||
+
+ 00099 8a 4d fe mov cl, BYTE PTR _scan_end$1$[ebp]
+ 0009c 03 d3 add edx, ebx
+ 0009e 38 0c 3a cmp BYTE PTR [edx+edi], cl
+ 000a1 0f 85 a3 00 00
+ 00 jne $LN2@longest_ma
+ 000a7 8a 4d ff mov cl, BYTE PTR _scan_end1$1$[ebp]
+ 000aa 38 4c 3a ff cmp BYTE PTR [edx+edi-1], cl
+ 000ae 0f 85 96 00 00
+ 00 jne $LN2@longest_ma
+ 000b4 8a 0a mov cl, BYTE PTR [edx]
+ 000b6 3a 08 cmp cl, BYTE PTR [eax]
+ 000b8 0f 85 8c 00 00
+ 00 jne $LN2@longest_ma
+ 000be 8a 4a 01 mov cl, BYTE PTR [edx+1]
+ 000c1 3a 48 01 cmp cl, BYTE PTR [eax+1]
+ 000c4 0f 85 80 00 00
+ 00 jne $LN2@longest_ma
+
+; 1245 : *++match != scan[1]) continue;
+; 1246 :
+; 1247 : /* The check at best_len-1 can be removed because it will be made
+; 1248 : * again later. (This heuristic is not always a win.)
+; 1249 : * It is not necessary to compare scan[2] and match[2] since they
+; 1250 : * are always equal when the other bytes match, given that
+; 1251 : * the hash keys are equal and that HASH_BITS >= 8.
+; 1252 : */
+; 1253 : scan += 2, match++;
+
+ 000ca 83 c0 02 add eax, 2
+ 000cd 83 c2 02 add edx, 2
+$LL7@longest_ma:
+
+; 1254 : Assert(*scan == *match, "match[2]?");
+; 1255 :
+; 1256 : /* We check for insufficient lookahead only every 8th comparison;
+; 1257 : * the 256th check will be made at strstart+258.
+; 1258 : */
+; 1259 : do {
+; 1260 : } while (*++scan == *++match && *++scan == *++match &&
+; 1261 : *++scan == *++match && *++scan == *++match &&
+; 1262 : *++scan == *++match && *++scan == *++match &&
+; 1263 : *++scan == *++match && *++scan == *++match &&
+
+ 000d0 8a 48 01 mov cl, BYTE PTR [eax+1]
+ 000d3 40 inc eax
+ 000d4 3a 4a 01 cmp cl, BYTE PTR [edx+1]
+ 000d7 75 45 jne SHORT $LN12@longest_ma
+ 000d9 8a 48 01 mov cl, BYTE PTR [eax+1]
+ 000dc 40 inc eax
+ 000dd 3a 4a 02 cmp cl, BYTE PTR [edx+2]
+ 000e0 75 3c jne SHORT $LN12@longest_ma
+ 000e2 8a 48 01 mov cl, BYTE PTR [eax+1]
+ 000e5 40 inc eax
+ 000e6 3a 4a 03 cmp cl, BYTE PTR [edx+3]
+ 000e9 75 33 jne SHORT $LN12@longest_ma
+ 000eb 8a 48 01 mov cl, BYTE PTR [eax+1]
+ 000ee 40 inc eax
+ 000ef 3a 4a 04 cmp cl, BYTE PTR [edx+4]
+ 000f2 75 2a jne SHORT $LN12@longest_ma
+ 000f4 8a 48 01 mov cl, BYTE PTR [eax+1]
+ 000f7 40 inc eax
+ 000f8 3a 4a 05 cmp cl, BYTE PTR [edx+5]
+ 000fb 75 21 jne SHORT $LN12@longest_ma
+ 000fd 8a 48 01 mov cl, BYTE PTR [eax+1]
+ 00100 40 inc eax
+ 00101 3a 4a 06 cmp cl, BYTE PTR [edx+6]
+ 00104 75 18 jne SHORT $LN12@longest_ma
+ 00106 8a 48 01 mov cl, BYTE PTR [eax+1]
+ 00109 40 inc eax
+ 0010a 3a 4a 07 cmp cl, BYTE PTR [edx+7]
+ 0010d 75 0f jne SHORT $LN12@longest_ma
+ 0010f 8a 48 01 mov cl, BYTE PTR [eax+1]
+ 00112 40 inc eax
+ 00113 83 c2 08 add edx, 8
+ 00116 3a 0a cmp cl, BYTE PTR [edx]
+ 00118 75 04 jne SHORT $LN12@longest_ma
+ 0011a 3b c6 cmp eax, esi
+ 0011c 72 b2 jb SHORT $LL7@longest_ma
+$LN12@longest_ma:
+
+; 1264 : scan < strend);
+; 1265 :
+; 1266 : Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+; 1267 :
+; 1268 : len = MAX_MATCH - (int)(strend - scan);
+
+ 0011e 2b c6 sub eax, esi
+ 00120 8d 88 02 01 00
+ 00 lea ecx, DWORD PTR [eax+258]
+
+; 1269 : scan = strend - MAX_MATCH;
+
+ 00126 8d 86 fe fe ff
+ ff lea eax, DWORD PTR [esi-258]
+
+; 1270 :
+; 1271 : #endif /* UNALIGNED_OK */
+; 1272 :
+; 1273 : if (len > best_len) {
+
+ 0012c 3b cf cmp ecx, edi
+ 0012e 7e 1a jle SHORT $LN2@longest_ma
+
+; 1274 : s->match_start = cur_match;
+; 1275 : best_len = len;
+
+ 00130 8b f9 mov edi, ecx
+ 00132 8b 55 f0 mov edx, DWORD PTR _s$1$[ebp]
+ 00135 89 5a 70 mov DWORD PTR [edx+112], ebx
+
+; 1276 : if (len >= nice_match) break;
+
+ 00138 3b 4d f8 cmp ecx, DWORD PTR _nice_match$2$[ebp]
+ 0013b 7d 28 jge SHORT $LN3@longest_ma
+
+; 1277 : #ifdef UNALIGNED_OK
+; 1278 : scan_end = *(ushf*)(scan+best_len-1);
+; 1279 : #else
+; 1280 : scan_end1 = scan[best_len-1];
+
+ 0013d 8a 54 01 ff mov dl, BYTE PTR [ecx+eax-1]
+
+; 1281 : scan_end = scan[best_len];
+
+ 00141 8a 0c 01 mov cl, BYTE PTR [ecx+eax]
+ 00144 88 55 ff mov BYTE PTR _scan_end1$1$[ebp], dl
+ 00147 88 4d fe mov BYTE PTR _scan_end$1$[ebp], cl
+$LN2@longest_ma:
+
+; 1282 : #endif
+; 1283 : }
+; 1284 : } while ((cur_match = prev[cur_match & wmask]) > limit
+; 1285 : && --chain_length != 0);
+
+ 0014a 8b 4d e4 mov ecx, DWORD PTR _wmask$1$[ebp]
+ 0014d 8b 55 e0 mov edx, DWORD PTR _prev$1$[ebp]
+ 00150 23 cb and ecx, ebx
+ 00152 0f b7 1c 4a movzx ebx, WORD PTR [edx+ecx*2]
+ 00156 3b 5d ec cmp ebx, DWORD PTR _limit$1$[ebp]
+ 00159 76 0a jbe SHORT $LN3@longest_ma
+ 0015b 83 6d f4 01 sub DWORD PTR _chain_length$1$[ebp], 1
+ 0015f 0f 85 31 ff ff
+ ff jne $LL4@longest_ma
+$LN3@longest_ma:
+
+; 1286 :
+; 1287 : if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
+
+ 00165 8b 45 dc mov eax, DWORD PTR tv373[ebp]
+ 00168 3b f8 cmp edi, eax
+ 0016a 0f 46 c7 cmovbe eax, edi
+ 0016d 5f pop edi
+ 0016e 5e pop esi
+ 0016f 5b pop ebx
+
+; 1288 : return s->lookahead;
+; 1289 : }
+
+ 00170 8b e5 mov esp, ebp
+ 00172 5d pop ebp
+ 00173 c3 ret 0
+_longest_match ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\deflate.c
+; COMDAT _fill_window
+_TEXT SEGMENT
+_wsize$1$ = -8 ; size = 4
+_str$1$ = -4 ; size = 4
+_fill_window PROC ; COMDAT
+; _s$ = ecx
+
+; 1392 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 08 sub esp, 8
+ 00006 53 push ebx
+ 00007 56 push esi
+ 00008 8b f1 mov esi, ecx
+ 0000a 57 push edi
+
+; 1393 : register unsigned n, m;
+; 1394 : register Posf *p;
+; 1395 : unsigned more; /* Amount of free space at the end of the window. */
+; 1396 : uInt wsize = s->w_size;
+
+ 0000b 8b 5e 2c mov ebx, DWORD PTR [esi+44]
+ 0000e 89 5d f8 mov DWORD PTR _wsize$1$[ebp], ebx
+$LL4@fill_windo:
+
+; 1397 :
+; 1398 : Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
+; 1399 :
+; 1400 : do {
+; 1401 : more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);
+; 1402 :
+; 1403 : /* Deal with !@#$% 64K limit: */
+; 1404 : if (sizeof(int) <= 2) {
+; 1405 : if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
+; 1406 : more = wsize;
+; 1407 :
+; 1408 : } else if (more == (unsigned)(-1)) {
+; 1409 : /* Very unlikely, but possible on 16 bit machine if
+; 1410 : * strstart == 0 && lookahead == 1 (input done a byte at time)
+; 1411 : */
+; 1412 : more--;
+; 1413 : }
+; 1414 : }
+; 1415 :
+; 1416 : /* If the window is almost full and there is insufficient lookahead,
+; 1417 : * move the upper half to the lower one to make room in the upper half.
+; 1418 : */
+; 1419 : if (s->strstart >= wsize+MAX_DIST(s)) {
+
+ 00011 8b 46 2c mov eax, DWORD PTR [esi+44]
+ 00014 8b 7e 3c mov edi, DWORD PTR [esi+60]
+ 00017 05 fa fe ff ff add eax, -262 ; fffffefaH
+ 0001c 2b 7e 74 sub edi, DWORD PTR [esi+116]
+ 0001f 03 c3 add eax, ebx
+ 00021 2b 7e 6c sub edi, DWORD PTR [esi+108]
+ 00024 39 46 6c cmp DWORD PTR [esi+108], eax
+ 00027 72 63 jb SHORT $LN17@fill_windo
+
+; 1420 :
+; 1421 : zmemcpy(s->window, s->window+wsize, (unsigned)wsize);
+
+ 00029 8b 4e 38 mov ecx, DWORD PTR [esi+56]
+ 0002c 53 push ebx
+ 0002d 8d 04 19 lea eax, DWORD PTR [ecx+ebx]
+ 00030 50 push eax
+ 00031 51 push ecx
+ 00032 e8 00 00 00 00 call _memcpy
+
+; 1422 : s->match_start -= wsize;
+; 1423 : s->strstart -= wsize; /* we now have strstart >= MAX_DIST */
+; 1424 : s->block_start -= (long) wsize;
+; 1425 :
+; 1426 : /* Slide the hash table (could be avoided with 32 bit values
+; 1427 : at the expense of memory usage). We slide even when level == 0
+; 1428 : to keep the hash table consistent if we switch back to level > 0
+; 1429 : later. (Using level 0 permanently is not an optimal usage of
+; 1430 : zlib, so we don't care about this pathological case.)
+; 1431 : */
+; 1432 : n = s->hash_size;
+
+ 00037 8b 56 4c mov edx, DWORD PTR [esi+76]
+ 0003a 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1433 : p = &s->head[n];
+
+ 0003d 8b 46 44 mov eax, DWORD PTR [esi+68]
+ 00040 29 5e 70 sub DWORD PTR [esi+112], ebx
+ 00043 29 5e 6c sub DWORD PTR [esi+108], ebx
+ 00046 29 5e 5c sub DWORD PTR [esi+92], ebx
+ 00049 8d 0c 50 lea ecx, DWORD PTR [eax+edx*2]
+ 0004c 0f 1f 40 00 npad 4
+$LL7@fill_windo:
+
+; 1434 : do {
+; 1435 : m = *--p;
+
+ 00050 0f b7 41 fe movzx eax, WORD PTR [ecx-2]
+ 00054 8d 49 fe lea ecx, DWORD PTR [ecx-2]
+
+; 1436 : *p = (Pos)(m >= wsize ? m-wsize : NIL);
+
+ 00057 3b c3 cmp eax, ebx
+ 00059 72 04 jb SHORT $LN29@fill_windo
+ 0005b 2b c3 sub eax, ebx
+ 0005d eb 02 jmp SHORT $LN30@fill_windo
+$LN29@fill_windo:
+ 0005f 33 c0 xor eax, eax
+$LN30@fill_windo:
+ 00061 66 89 01 mov WORD PTR [ecx], ax
+
+; 1437 : } while (--n);
+
+ 00064 83 ea 01 sub edx, 1
+ 00067 75 e7 jne SHORT $LL7@fill_windo
+
+; 1438 :
+; 1439 : n = wsize;
+; 1440 : #ifndef FASTEST
+; 1441 : p = &s->prev[n];
+
+ 00069 8b 46 40 mov eax, DWORD PTR [esi+64]
+ 0006c 8b d3 mov edx, ebx
+ 0006e 8d 0c 58 lea ecx, DWORD PTR [eax+ebx*2]
+$LL10@fill_windo:
+
+; 1442 : do {
+; 1443 : m = *--p;
+
+ 00071 0f b7 41 fe movzx eax, WORD PTR [ecx-2]
+ 00075 8d 49 fe lea ecx, DWORD PTR [ecx-2]
+
+; 1444 : *p = (Pos)(m >= wsize ? m-wsize : NIL);
+
+ 00078 3b c3 cmp eax, ebx
+ 0007a 72 04 jb SHORT $LN31@fill_windo
+ 0007c 2b c3 sub eax, ebx
+ 0007e eb 02 jmp SHORT $LN32@fill_windo
+$LN31@fill_windo:
+ 00080 33 c0 xor eax, eax
+$LN32@fill_windo:
+ 00082 66 89 01 mov WORD PTR [ecx], ax
+
+; 1445 : /* If n is not on any hash chain, prev[n] is garbage but
+; 1446 : * its value will never be used.
+; 1447 : */
+; 1448 : } while (--n);
+
+ 00085 83 ea 01 sub edx, 1
+ 00088 75 e7 jne SHORT $LL10@fill_windo
+
+; 1449 : #endif
+; 1450 : more += wsize;
+
+ 0008a 03 fb add edi, ebx
+$LN17@fill_windo:
+
+; 1451 : }
+; 1452 : if (s->strm->avail_in == 0) break;
+
+ 0008c 8b 0e mov ecx, DWORD PTR [esi]
+ 0008e 83 79 04 00 cmp DWORD PTR [ecx+4], 0
+ 00092 0f 84 c0 00 00
+ 00 je $LN3@fill_windo
+
+; 1453 :
+; 1454 : /* If there was no sliding:
+; 1455 : * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
+; 1456 : * more == window_size - lookahead - strstart
+; 1457 : * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
+; 1458 : * => more >= window_size - 2*WSIZE + 2
+; 1459 : * In the BIG_MEM or MMAP case (not yet supported),
+; 1460 : * window_size == input_size + MIN_LOOKAHEAD &&
+; 1461 : * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
+; 1462 : * Otherwise, window_size == 2*WSIZE so more >= 2.
+; 1463 : * If there was sliding, more >= WSIZE. So in all cases, more >= 2.
+; 1464 : */
+; 1465 : Assert(more >= 2, "more < 2");
+; 1466 :
+; 1467 : n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more);
+
+ 00098 8b 56 74 mov edx, DWORD PTR [esi+116]
+ 0009b 03 56 6c add edx, DWORD PTR [esi+108]
+ 0009e 03 56 38 add edx, DWORD PTR [esi+56]
+ 000a1 57 push edi
+ 000a2 e8 00 00 00 00 call _read_buf
+
+; 1468 : s->lookahead += n;
+
+ 000a7 01 46 74 add DWORD PTR [esi+116], eax
+ 000aa 83 c4 04 add esp, 4
+ 000ad 8b 46 74 mov eax, DWORD PTR [esi+116]
+
+; 1469 :
+; 1470 : /* Initialize the hash value now that we have some input: */
+; 1471 : if (s->lookahead + s->insert >= MIN_MATCH) {
+
+ 000b0 8b 8e b4 16 00
+ 00 mov ecx, DWORD PTR [esi+5812]
+ 000b6 03 c1 add eax, ecx
+ 000b8 83 f8 03 cmp eax, 3
+ 000bb 0f 82 82 00 00
+ 00 jb $LN2@fill_windo
+
+; 1472 : uInt str = s->strstart - s->insert;
+
+ 000c1 8b 7e 6c mov edi, DWORD PTR [esi+108]
+
+; 1473 : s->ins_h = s->window[str];
+
+ 000c4 8b 46 38 mov eax, DWORD PTR [esi+56]
+ 000c7 2b f9 sub edi, ecx
+
+; 1474 : UPDATE_HASH(s, s->ins_h, s->window[str + 1]);
+
+ 000c9 8b 4e 58 mov ecx, DWORD PTR [esi+88]
+ 000cc 89 7d fc mov DWORD PTR _str$1$[ebp], edi
+ 000cf 0f b6 14 38 movzx edx, BYTE PTR [eax+edi]
+ 000d3 89 56 48 mov DWORD PTR [esi+72], edx
+ 000d6 0f b6 44 38 01 movzx eax, BYTE PTR [eax+edi+1]
+ 000db d3 e2 shl edx, cl
+ 000dd 33 d0 xor edx, eax
+ 000df 23 56 54 and edx, DWORD PTR [esi+84]
+
+; 1475 : #if MIN_MATCH != 3
+; 1476 : Call UPDATE_HASH() MIN_MATCH-3 more times
+; 1477 : #endif
+; 1478 : while (s->insert) {
+
+ 000e2 83 be b4 16 00
+ 00 00 cmp DWORD PTR [esi+5812], 0
+ 000e9 89 56 48 mov DWORD PTR [esi+72], edx
+ 000ec 74 55 je SHORT $LN2@fill_windo
+ 000ee 8b df mov ebx, edi
+$LL11@fill_windo:
+
+; 1479 : UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]);
+
+ 000f0 8b 46 38 mov eax, DWORD PTR [esi+56]
+ 000f3 8b 4e 58 mov ecx, DWORD PTR [esi+88]
+
+; 1480 : #ifndef FASTEST
+; 1481 : s->prev[str & s->w_mask] = s->head[s->ins_h];
+
+ 000f6 8b 56 34 mov edx, DWORD PTR [esi+52]
+ 000f9 23 d3 and edx, ebx
+ 000fb 0f b6 7c 18 02 movzx edi, BYTE PTR [eax+ebx+2]
+ 00100 8b 46 48 mov eax, DWORD PTR [esi+72]
+ 00103 d3 e0 shl eax, cl
+ 00105 8b 4e 40 mov ecx, DWORD PTR [esi+64]
+ 00108 33 f8 xor edi, eax
+ 0010a 23 7e 54 and edi, DWORD PTR [esi+84]
+ 0010d 8b 46 44 mov eax, DWORD PTR [esi+68]
+ 00110 89 7e 48 mov DWORD PTR [esi+72], edi
+ 00113 66 8b 04 78 mov ax, WORD PTR [eax+edi*2]
+ 00117 66 89 04 51 mov WORD PTR [ecx+edx*2], ax
+
+; 1482 : #endif
+; 1483 : s->head[s->ins_h] = (Pos)str;
+
+ 0011b 8b 4e 48 mov ecx, DWORD PTR [esi+72]
+ 0011e 8b 46 44 mov eax, DWORD PTR [esi+68]
+ 00121 66 89 1c 48 mov WORD PTR [eax+ecx*2], bx
+
+; 1484 : str++;
+
+ 00125 43 inc ebx
+
+; 1485 : s->insert--;
+
+ 00126 ff 8e b4 16 00
+ 00 dec DWORD PTR [esi+5812]
+
+; 1486 : if (s->lookahead + s->insert < MIN_MATCH)
+
+ 0012c 8b 46 74 mov eax, DWORD PTR [esi+116]
+ 0012f 8b 8e b4 16 00
+ 00 mov ecx, DWORD PTR [esi+5812]
+ 00135 03 c1 add eax, ecx
+ 00137 83 f8 03 cmp eax, 3
+ 0013a 72 04 jb SHORT $LN48@fill_windo
+
+; 1475 : #if MIN_MATCH != 3
+; 1476 : Call UPDATE_HASH() MIN_MATCH-3 more times
+; 1477 : #endif
+; 1478 : while (s->insert) {
+
+ 0013c 85 c9 test ecx, ecx
+ 0013e 75 b0 jne SHORT $LL11@fill_windo
+$LN48@fill_windo:
+ 00140 8b 5d f8 mov ebx, DWORD PTR _wsize$1$[ebp]
+$LN2@fill_windo:
+
+; 1487 : break;
+; 1488 : }
+; 1489 : }
+; 1490 : /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
+; 1491 : * but this is not important since only literal bytes will be emitted.
+; 1492 : */
+; 1493 :
+; 1494 : } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
+
+ 00143 81 7e 74 06 01
+ 00 00 cmp DWORD PTR [esi+116], 262 ; 00000106H
+ 0014a 73 0c jae SHORT $LN3@fill_windo
+ 0014c 8b 06 mov eax, DWORD PTR [esi]
+ 0014e 83 78 04 00 cmp DWORD PTR [eax+4], 0
+ 00152 0f 85 b9 fe ff
+ ff jne $LL4@fill_windo
+$LN3@fill_windo:
+
+; 1495 :
+; 1496 : /* If the WIN_INIT bytes after the end of the current data have never been
+; 1497 : * written, then zero those bytes in order to avoid memory check reports of
+; 1498 : * the use of uninitialized (or uninitialised as Julian writes) bytes by
+; 1499 : * the longest match routines. Update the high water mark for the next
+; 1500 : * time through here. WIN_INIT is set to MAX_MATCH since the longest match
+; 1501 : * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
+; 1502 : */
+; 1503 : if (s->high_water < s->window_size) {
+
+ 00158 8b 8e c0 16 00
+ 00 mov ecx, DWORD PTR [esi+5824]
+ 0015e 8b 5e 3c mov ebx, DWORD PTR [esi+60]
+ 00161 3b cb cmp ecx, ebx
+ 00163 73 67 jae SHORT $LN26@fill_windo
+
+; 1504 : ulg curr = s->strstart + (ulg)(s->lookahead);
+
+ 00165 8b 7e 74 mov edi, DWORD PTR [esi+116]
+ 00168 03 7e 6c add edi, DWORD PTR [esi+108]
+
+; 1505 : ulg init;
+; 1506 :
+; 1507 : if (s->high_water < curr) {
+
+ 0016b 3b cf cmp ecx, edi
+ 0016d 73 2d jae SHORT $LN23@fill_windo
+
+; 1508 : /* Previous high water mark below current data -- zero WIN_INIT
+; 1509 : * bytes or up to end of window, whichever is less.
+; 1510 : */
+; 1511 : init = s->window_size - curr;
+; 1512 : if (init > WIN_INIT)
+
+ 0016f b8 02 01 00 00 mov eax, 258 ; 00000102H
+ 00174 2b df sub ebx, edi
+ 00176 3b d8 cmp ebx, eax
+ 00178 0f 47 d8 cmova ebx, eax
+
+; 1513 : init = WIN_INIT;
+; 1514 : zmemzero(s->window + curr, (unsigned)init);
+
+ 0017b 8b 46 38 mov eax, DWORD PTR [esi+56]
+ 0017e 53 push ebx
+ 0017f 03 c7 add eax, edi
+ 00181 6a 00 push 0
+ 00183 50 push eax
+ 00184 e8 00 00 00 00 call _memset
+ 00189 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1515 : s->high_water = curr + init;
+
+ 0018c 8d 04 3b lea eax, DWORD PTR [ebx+edi]
+ 0018f 89 86 c0 16 00
+ 00 mov DWORD PTR [esi+5824], eax
+ 00195 5f pop edi
+ 00196 5e pop esi
+ 00197 5b pop ebx
+
+; 1527 : }
+; 1528 : }
+; 1529 :
+; 1530 : Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
+; 1531 : "not enough room for search");
+; 1532 : }
+
+ 00198 8b e5 mov esp, ebp
+ 0019a 5d pop ebp
+ 0019b c3 ret 0
+$LN23@fill_windo:
+
+; 1516 : }
+; 1517 : else if (s->high_water < (ulg)curr + WIN_INIT) {
+
+ 0019c 8d 87 02 01 00
+ 00 lea eax, DWORD PTR [edi+258]
+ 001a2 3b c8 cmp ecx, eax
+ 001a4 73 26 jae SHORT $LN26@fill_windo
+
+; 1518 : /* High water mark at or above current data, but below current data
+; 1519 : * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up
+; 1520 : * to end of window, whichever is less.
+; 1521 : */
+; 1522 : init = (ulg)curr + WIN_INIT - s->high_water;
+; 1523 : if (init > s->window_size - s->high_water)
+; 1524 : init = s->window_size - s->high_water;
+; 1525 : zmemzero(s->window + s->high_water, (unsigned)init);
+
+ 001a6 8b 46 38 mov eax, DWORD PTR [esi+56]
+ 001a9 2b f9 sub edi, ecx
+ 001ab 2b d9 sub ebx, ecx
+ 001ad 81 c7 02 01 00
+ 00 add edi, 258 ; 00000102H
+ 001b3 3b fb cmp edi, ebx
+ 001b5 0f 47 fb cmova edi, ebx
+ 001b8 03 c1 add eax, ecx
+ 001ba 57 push edi
+ 001bb 6a 00 push 0
+ 001bd 50 push eax
+ 001be e8 00 00 00 00 call _memset
+ 001c3 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1526 : s->high_water += init;
+
+ 001c6 01 be c0 16 00
+ 00 add DWORD PTR [esi+5824], edi
+$LN26@fill_windo:
+ 001cc 5f pop edi
+ 001cd 5e pop esi
+ 001ce 5b pop ebx
+
+; 1527 : }
+; 1528 : }
+; 1529 :
+; 1530 : Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
+; 1531 : "not enough room for search");
+; 1532 : }
+
+ 001cf 8b e5 mov esp, ebp
+ 001d1 5d pop ebp
+ 001d2 c3 ret 0
+_fill_window ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\deflate.c
+; COMDAT _deflate_stored
+_TEXT SEGMENT
+_s$ = 8 ; size = 4
+_flush$ = 12 ; size = 4
+_deflate_stored PROC ; COMDAT
+
+; 1567 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 53 push ebx
+ 00004 56 push esi
+
+; 1568 : /* Stored blocks are limited to 0xffff bytes, pending_buf is limited
+; 1569 : * to pending_buf_size, and each stored block has a 5 byte header:
+; 1570 : */
+; 1571 : ulg max_block_size = 0xffff;
+; 1572 : ulg max_start;
+; 1573 :
+; 1574 : if (max_block_size > s->pending_buf_size - 5) {
+
+ 00005 8b 75 08 mov esi, DWORD PTR _s$[ebp]
+ 00008 bb ff ff 00 00 mov ebx, 65535 ; 0000ffffH
+ 0000d 57 push edi
+ 0000e 8b 46 0c mov eax, DWORD PTR [esi+12]
+ 00011 83 c0 fb add eax, -5 ; fffffffbH
+ 00014 3b c3 cmp eax, ebx
+ 00016 0f 42 d8 cmovb ebx, eax
+ 00019 0f 1f 80 00 00
+ 00 00 npad 7
+$LL2@deflate_st:
+
+; 1575 : max_block_size = s->pending_buf_size - 5;
+; 1576 : }
+; 1577 :
+; 1578 : /* Copy as much as possible from input to output: */
+; 1579 : for (;;) {
+; 1580 : /* Fill the window as much as possible: */
+; 1581 : if (s->lookahead <= 1) {
+
+ 00020 8b 46 74 mov eax, DWORD PTR [esi+116]
+ 00023 83 f8 01 cmp eax, 1
+ 00026 77 12 ja SHORT $LN8@deflate_st
+
+; 1582 :
+; 1583 : Assert(s->strstart < s->w_size+MAX_DIST(s) ||
+; 1584 : s->block_start >= (long)s->w_size, "slide too late");
+; 1585 :
+; 1586 : fill_window(s);
+
+ 00028 8b ce mov ecx, esi
+ 0002a e8 00 00 00 00 call _fill_window
+
+; 1587 : if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more;
+
+ 0002f 8b 46 74 mov eax, DWORD PTR [esi+116]
+ 00032 85 c0 test eax, eax
+ 00034 0f 84 a0 00 00
+ 00 je $LN37@deflate_st
+$LN8@deflate_st:
+
+; 1588 :
+; 1589 : if (s->lookahead == 0) break; /* flush the current block */
+; 1590 : }
+; 1591 : Assert(s->block_start >= 0L, "block gone");
+; 1592 :
+; 1593 : s->strstart += s->lookahead;
+; 1594 : s->lookahead = 0;
+; 1595 :
+; 1596 : /* Emit a stored block if pending_buf will be full: */
+; 1597 : max_start = s->block_start + max_block_size;
+
+ 0003a 8b 7e 5c mov edi, DWORD PTR [esi+92]
+ 0003d 01 46 6c add DWORD PTR [esi+108], eax
+
+; 1598 : if (s->strstart == 0 || (ulg)s->strstart >= max_start) {
+
+ 00040 8b 4e 6c mov ecx, DWORD PTR [esi+108]
+ 00043 c7 46 74 00 00
+ 00 00 mov DWORD PTR [esi+116], 0
+ 0004a 8d 04 1f lea eax, DWORD PTR [edi+ebx]
+ 0004d 74 04 je SHORT $LN10@deflate_st
+ 0004f 3b c8 cmp ecx, eax
+ 00051 72 39 jb SHORT $LN11@deflate_st
+$LN10@deflate_st:
+
+; 1599 : /* strstart == 0 is possible when wraparound on 16-bit machine */
+; 1600 : s->lookahead = (uInt)(s->strstart - max_start);
+
+ 00053 2b c8 sub ecx, eax
+
+; 1601 : s->strstart = (uInt)max_start;
+
+ 00055 89 46 6c mov DWORD PTR [esi+108], eax
+ 00058 89 4e 74 mov DWORD PTR [esi+116], ecx
+
+; 1602 : FLUSH_BLOCK(s, 0);
+
+ 0005b 85 ff test edi, edi
+ 0005d 78 07 js SHORT $LN19@deflate_st
+ 0005f 8b 56 38 mov edx, DWORD PTR [esi+56]
+ 00062 03 d7 add edx, edi
+ 00064 eb 02 jmp SHORT $LN20@deflate_st
+$LN19@deflate_st:
+ 00066 33 d2 xor edx, edx
+$LN20@deflate_st:
+ 00068 2b c7 sub eax, edi
+ 0006a 8b ce mov ecx, esi
+ 0006c 6a 00 push 0
+ 0006e 50 push eax
+ 0006f e8 00 00 00 00 call __tr_flush_block
+ 00074 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 00077 83 c4 08 add esp, 8
+ 0007a 8b 0e mov ecx, DWORD PTR [esi]
+ 0007c 89 46 5c mov DWORD PTR [esi+92], eax
+ 0007f e8 00 00 00 00 call _flush_pending
+ 00084 8b 06 mov eax, DWORD PTR [esi]
+ 00086 83 78 10 00 cmp DWORD PTR [eax+16], 0
+ 0008a 74 47 je SHORT $LN31@deflate_st
+$LN11@deflate_st:
+
+; 1603 : }
+; 1604 : /* Flush if we may have to slide, otherwise block_start may become
+; 1605 : * negative and the data will be gone:
+; 1606 : */
+; 1607 : if (s->strstart - (uInt)s->block_start >= MAX_DIST(s)) {
+
+ 0008c 8b 4e 6c mov ecx, DWORD PTR [esi+108]
+ 0008f 8b 46 2c mov eax, DWORD PTR [esi+44]
+ 00092 8b 7e 5c mov edi, DWORD PTR [esi+92]
+ 00095 2d 06 01 00 00 sub eax, 262 ; 00000106H
+ 0009a 2b cf sub ecx, edi
+ 0009c 3b c8 cmp ecx, eax
+ 0009e 72 80 jb SHORT $LL2@deflate_st
+
+; 1608 : FLUSH_BLOCK(s, 0);
+
+ 000a0 85 ff test edi, edi
+ 000a2 78 07 js SHORT $LN21@deflate_st
+ 000a4 8b 56 38 mov edx, DWORD PTR [esi+56]
+ 000a7 03 d7 add edx, edi
+ 000a9 eb 02 jmp SHORT $LN22@deflate_st
+$LN21@deflate_st:
+ 000ab 33 d2 xor edx, edx
+$LN22@deflate_st:
+ 000ad 6a 00 push 0
+ 000af 51 push ecx
+ 000b0 8b ce mov ecx, esi
+ 000b2 e8 00 00 00 00 call __tr_flush_block
+ 000b7 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 000ba 83 c4 08 add esp, 8
+ 000bd 8b 0e mov ecx, DWORD PTR [esi]
+ 000bf 89 46 5c mov DWORD PTR [esi+92], eax
+ 000c2 e8 00 00 00 00 call _flush_pending
+ 000c7 8b 06 mov eax, DWORD PTR [esi]
+ 000c9 83 78 10 00 cmp DWORD PTR [eax+16], 0
+ 000cd 0f 85 4d ff ff
+ ff jne $LL2@deflate_st
+$LN31@deflate_st:
+ 000d3 5f pop edi
+ 000d4 5e pop esi
+
+; 1602 : FLUSH_BLOCK(s, 0);
+
+ 000d5 33 c0 xor eax, eax
+ 000d7 5b pop ebx
+
+; 1619 : }
+
+ 000d8 5d pop ebp
+ 000d9 c3 ret 0
+$LN37@deflate_st:
+
+; 1587 : if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more;
+
+ 000da 8b 45 0c mov eax, DWORD PTR _flush$[ebp]
+ 000dd 85 c0 test eax, eax
+ 000df 74 f2 je SHORT $LN31@deflate_st
+
+; 1609 : }
+; 1610 : }
+; 1611 : s->insert = 0;
+
+ 000e1 c7 86 b4 16 00
+ 00 00 00 00 00 mov DWORD PTR [esi+5812], 0
+
+; 1612 : if (flush == Z_FINISH) {
+
+ 000eb 83 f8 04 cmp eax, 4
+ 000ee 75 41 jne SHORT $LN14@deflate_st
+
+; 1613 : FLUSH_BLOCK(s, 1);
+
+ 000f0 8b 4e 5c mov ecx, DWORD PTR [esi+92]
+ 000f3 85 c9 test ecx, ecx
+ 000f5 78 07 js SHORT $LN23@deflate_st
+ 000f7 8b 56 38 mov edx, DWORD PTR [esi+56]
+ 000fa 03 d1 add edx, ecx
+ 000fc eb 02 jmp SHORT $LN24@deflate_st
+$LN23@deflate_st:
+ 000fe 33 d2 xor edx, edx
+$LN24@deflate_st:
+ 00100 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 00103 2b c1 sub eax, ecx
+ 00105 8b ce mov ecx, esi
+ 00107 6a 01 push 1
+ 00109 50 push eax
+ 0010a e8 00 00 00 00 call __tr_flush_block
+ 0010f 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 00112 83 c4 08 add esp, 8
+ 00115 8b 0e mov ecx, DWORD PTR [esi]
+ 00117 89 46 5c mov DWORD PTR [esi+92], eax
+ 0011a e8 00 00 00 00 call _flush_pending
+ 0011f 8b 0e mov ecx, DWORD PTR [esi]
+ 00121 33 c0 xor eax, eax
+ 00123 5f pop edi
+ 00124 5e pop esi
+ 00125 5b pop ebx
+ 00126 39 41 10 cmp DWORD PTR [ecx+16], eax
+ 00129 0f 95 c0 setne al
+ 0012c 83 c0 02 add eax, 2
+
+; 1619 : }
+
+ 0012f 5d pop ebp
+ 00130 c3 ret 0
+$LN14@deflate_st:
+
+; 1614 : return finish_done;
+; 1615 : }
+; 1616 : if ((long)s->strstart > s->block_start)
+
+ 00131 8b 4e 6c mov ecx, DWORD PTR [esi+108]
+ 00134 8b 46 5c mov eax, DWORD PTR [esi+92]
+ 00137 3b c8 cmp ecx, eax
+ 00139 7e 35 jle SHORT $LN17@deflate_st
+
+; 1617 : FLUSH_BLOCK(s, 0);
+
+ 0013b 85 c0 test eax, eax
+ 0013d 78 07 js SHORT $LN25@deflate_st
+ 0013f 8b 56 38 mov edx, DWORD PTR [esi+56]
+ 00142 03 d0 add edx, eax
+ 00144 eb 02 jmp SHORT $LN26@deflate_st
+$LN25@deflate_st:
+ 00146 33 d2 xor edx, edx
+$LN26@deflate_st:
+ 00148 2b c8 sub ecx, eax
+ 0014a 6a 00 push 0
+ 0014c 51 push ecx
+ 0014d 8b ce mov ecx, esi
+ 0014f e8 00 00 00 00 call __tr_flush_block
+ 00154 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 00157 83 c4 08 add esp, 8
+ 0015a 8b 0e mov ecx, DWORD PTR [esi]
+ 0015c 89 46 5c mov DWORD PTR [esi+92], eax
+ 0015f e8 00 00 00 00 call _flush_pending
+ 00164 8b 06 mov eax, DWORD PTR [esi]
+ 00166 83 78 10 00 cmp DWORD PTR [eax+16], 0
+ 0016a 0f 84 63 ff ff
+ ff je $LN31@deflate_st
+$LN17@deflate_st:
+ 00170 5f pop edi
+ 00171 5e pop esi
+
+; 1618 : return block_done;
+
+ 00172 b8 01 00 00 00 mov eax, 1
+ 00177 5b pop ebx
+
+; 1619 : }
+
+ 00178 5d pop ebp
+ 00179 c3 ret 0
+_deflate_stored ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\deflate.c
+; COMDAT _deflate_fast
+_TEXT SEGMENT
+_bflush$1$ = 8 ; size = 4
+_s$ = 8 ; size = 4
+_flush$ = 12 ; size = 4
+_deflate_fast PROC ; COMDAT
+
+; 1631 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 53 push ebx
+ 00004 8b 5d 0c mov ebx, DWORD PTR _flush$[ebp]
+ 00007 56 push esi
+ 00008 8b 75 08 mov esi, DWORD PTR _s$[ebp]
+ 0000b 57 push edi
+ 0000c 0f 1f 40 00 npad 4
+$LL2@deflate_fa:
+
+; 1632 : IPos hash_head; /* head of the hash chain */
+; 1633 : int bflush; /* set if current block must be flushed */
+; 1634 :
+; 1635 : for (;;) {
+; 1636 : /* Make sure that we always have enough lookahead, except
+; 1637 : * at the end of the input file. We need MAX_MATCH bytes
+; 1638 : * for the next match, plus MIN_MATCH bytes to insert the
+; 1639 : * string following the next match.
+; 1640 : */
+; 1641 : if (s->lookahead < MIN_LOOKAHEAD) {
+
+ 00010 8b 46 74 mov eax, DWORD PTR [esi+116]
+ 00013 3d 06 01 00 00 cmp eax, 262 ; 00000106H
+ 00018 73 21 jae SHORT $LN10@deflate_fa
+
+; 1642 : fill_window(s);
+
+ 0001a 8b ce mov ecx, esi
+ 0001c e8 00 00 00 00 call _fill_window
+
+; 1643 : if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
+
+ 00021 8b 46 74 mov eax, DWORD PTR [esi+116]
+ 00024 3d 06 01 00 00 cmp eax, 262 ; 00000106H
+ 00029 73 08 jae SHORT $LN9@deflate_fa
+ 0002b 85 db test ebx, ebx
+ 0002d 0f 84 30 02 00
+ 00 je $LN39@deflate_fa
+$LN9@deflate_fa:
+
+; 1644 : return need_more;
+; 1645 : }
+; 1646 : if (s->lookahead == 0) break; /* flush the current block */
+
+ 00033 85 c0 test eax, eax
+ 00035 0f 84 2f 02 00
+ 00 je $LN38@deflate_fa
+$LN10@deflate_fa:
+
+; 1647 : }
+; 1648 :
+; 1649 : /* Insert the string window[strstart .. strstart+2] in the
+; 1650 : * dictionary, and set hash_head to the head of the hash chain:
+; 1651 : */
+; 1652 : hash_head = NIL;
+; 1653 : if (s->lookahead >= MIN_MATCH) {
+
+ 0003b 83 f8 03 cmp eax, 3
+ 0003e 72 6a jb SHORT $LN12@deflate_fa
+
+; 1654 : INSERT_STRING(s, s->strstart, hash_head);
+
+ 00040 8b 7e 6c mov edi, DWORD PTR [esi+108]
+ 00043 8b 46 38 mov eax, DWORD PTR [esi+56]
+ 00046 8b 5e 48 mov ebx, DWORD PTR [esi+72]
+ 00049 8b 4e 58 mov ecx, DWORD PTR [esi+88]
+ 0004c 8b 56 34 mov edx, DWORD PTR [esi+52]
+ 0004f 0f b6 44 38 02 movzx eax, BYTE PTR [eax+edi+2]
+ 00054 23 d7 and edx, edi
+ 00056 d3 e3 shl ebx, cl
+ 00058 8b 4e 40 mov ecx, DWORD PTR [esi+64]
+ 0005b 33 d8 xor ebx, eax
+ 0005d 23 5e 54 and ebx, DWORD PTR [esi+84]
+ 00060 8b 46 44 mov eax, DWORD PTR [esi+68]
+ 00063 89 5e 48 mov DWORD PTR [esi+72], ebx
+ 00066 0f b7 04 58 movzx eax, WORD PTR [eax+ebx*2]
+ 0006a 66 89 04 51 mov WORD PTR [ecx+edx*2], ax
+ 0006e 8b 4e 6c mov ecx, DWORD PTR [esi+108]
+ 00071 23 4e 34 and ecx, DWORD PTR [esi+52]
+ 00074 8b 46 40 mov eax, DWORD PTR [esi+64]
+ 00077 8b 56 48 mov edx, DWORD PTR [esi+72]
+ 0007a 0f b7 3c 48 movzx edi, WORD PTR [eax+ecx*2]
+ 0007e 8b 4e 44 mov ecx, DWORD PTR [esi+68]
+ 00081 0f b7 46 6c movzx eax, WORD PTR [esi+108]
+ 00085 66 89 04 51 mov WORD PTR [ecx+edx*2], ax
+
+; 1655 : }
+; 1656 :
+; 1657 : /* Find the longest match, discarding those <= prev_length.
+; 1658 : * At this point we have always match_length < MIN_MATCH
+; 1659 : */
+; 1660 : if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) {
+
+ 00089 85 ff test edi, edi
+ 0008b 74 1d je SHORT $LN12@deflate_fa
+ 0008d 8b 4e 6c mov ecx, DWORD PTR [esi+108]
+ 00090 8b 46 2c mov eax, DWORD PTR [esi+44]
+ 00093 2b cf sub ecx, edi
+ 00095 2d 06 01 00 00 sub eax, 262 ; 00000106H
+ 0009a 3b c8 cmp ecx, eax
+ 0009c 77 0c ja SHORT $LN12@deflate_fa
+
+; 1661 : /* To simplify the code, we prevent matches with the string
+; 1662 : * of window index 0 (in particular we have to avoid a match
+; 1663 : * of the string with itself at the start of the input file).
+; 1664 : */
+; 1665 : s->match_length = longest_match (s, hash_head);
+
+ 0009e 8b d7 mov edx, edi
+ 000a0 8b ce mov ecx, esi
+ 000a2 e8 00 00 00 00 call _longest_match
+ 000a7 89 46 60 mov DWORD PTR [esi+96], eax
+$LN12@deflate_fa:
+
+; 1666 : /* longest_match() sets match_start */
+; 1667 : }
+; 1668 : if (s->match_length >= MIN_MATCH) {
+
+ 000aa 83 7e 60 03 cmp DWORD PTR [esi+96], 3
+ 000ae 0f 82 16 01 00
+ 00 jb $LN13@deflate_fa
+
+; 1669 : check_match(s, s->strstart, s->match_start, s->match_length);
+; 1670 :
+; 1671 : _tr_tally_dist(s, s->strstart - s->match_start,
+
+ 000b4 66 8b 46 6c mov ax, WORD PTR [esi+108]
+ 000b8 66 2b 46 70 sub ax, WORD PTR [esi+112]
+ 000bc 8b 8e a0 16 00
+ 00 mov ecx, DWORD PTR [esi+5792]
+ 000c2 8a 56 60 mov dl, BYTE PTR [esi+96]
+ 000c5 0f b7 f8 movzx edi, ax
+ 000c8 80 ea 03 sub dl, 3
+ 000cb 8b 86 a4 16 00
+ 00 mov eax, DWORD PTR [esi+5796]
+ 000d1 66 89 3c 48 mov WORD PTR [eax+ecx*2], di
+ 000d5 81 c7 ff ff 00
+ 00 add edi, 65535 ; 0000ffffH
+ 000db 8b 86 a0 16 00
+ 00 mov eax, DWORD PTR [esi+5792]
+ 000e1 8b 8e 98 16 00
+ 00 mov ecx, DWORD PTR [esi+5784]
+ 000e7 88 14 01 mov BYTE PTR [ecx+eax], dl
+ 000ea ff 86 a0 16 00
+ 00 inc DWORD PTR [esi+5792]
+ 000f0 0f b6 c2 movzx eax, dl
+ 000f3 0f b6 80 00 00
+ 00 00 movzx eax, BYTE PTR __length_code[eax]
+ 000fa 66 ff 84 86 98
+ 04 00 00 inc WORD PTR [esi+eax*4+1176]
+ 00102 b8 00 01 00 00 mov eax, 256 ; 00000100H
+ 00107 66 3b f8 cmp di, ax
+ 0010a 0f b7 c7 movzx eax, di
+ 0010d 73 09 jae SHORT $LN24@deflate_fa
+ 0010f 0f b6 80 00 00
+ 00 00 movzx eax, BYTE PTR __dist_code[eax]
+ 00116 eb 0a jmp SHORT $LN25@deflate_fa
+$LN24@deflate_fa:
+ 00118 c1 e8 07 shr eax, 7
+ 0011b 0f b6 80 00 01
+ 00 00 movzx eax, BYTE PTR __dist_code[eax+256]
+$LN25@deflate_fa:
+ 00122 66 ff 84 86 88
+ 09 00 00 inc WORD PTR [esi+eax*4+2440]
+ 0012a 33 db xor ebx, ebx
+ 0012c 8b 86 9c 16 00
+ 00 mov eax, DWORD PTR [esi+5788]
+ 00132 48 dec eax
+ 00133 39 86 a0 16 00
+ 00 cmp DWORD PTR [esi+5792], eax
+
+; 1672 : s->match_length - MIN_MATCH, bflush);
+; 1673 :
+; 1674 : s->lookahead -= s->match_length;
+
+ 00139 8b 46 60 mov eax, DWORD PTR [esi+96]
+ 0013c 0f 94 c3 sete bl
+ 0013f 29 46 74 sub DWORD PTR [esi+116], eax
+ 00142 89 5d 08 mov DWORD PTR _bflush$1$[ebp], ebx
+
+; 1675 :
+; 1676 : /* Insert new strings in the hash table only if the match length
+; 1677 : * is not too large. This saves time but degrades compression.
+; 1678 : */
+; 1679 : #ifndef FASTEST
+; 1680 : if (s->match_length <= s->max_insert_length &&
+
+ 00145 3b 86 80 00 00
+ 00 cmp eax, DWORD PTR [esi+128]
+ 0014b 77 54 ja SHORT $LN15@deflate_fa
+ 0014d 83 7e 74 03 cmp DWORD PTR [esi+116], 3
+ 00151 72 4e jb SHORT $LN15@deflate_fa
+
+; 1681 : s->lookahead >= MIN_MATCH) {
+; 1682 : s->match_length--; /* string at strstart already in table */
+
+ 00153 48 dec eax
+ 00154 89 46 60 mov DWORD PTR [esi+96], eax
+$LL7@deflate_fa:
+
+; 1683 : do {
+; 1684 : s->strstart++;
+
+ 00157 ff 46 6c inc DWORD PTR [esi+108]
+ 0015a 8b 7e 6c mov edi, DWORD PTR [esi+108]
+
+; 1685 : INSERT_STRING(s, s->strstart, hash_head);
+
+ 0015d 8b 46 38 mov eax, DWORD PTR [esi+56]
+ 00160 8b 4e 58 mov ecx, DWORD PTR [esi+88]
+ 00163 8b 56 34 mov edx, DWORD PTR [esi+52]
+ 00166 23 d7 and edx, edi
+ 00168 0f b6 5c 07 02 movzx ebx, BYTE PTR [edi+eax+2]
+ 0016d 8b 46 48 mov eax, DWORD PTR [esi+72]
+ 00170 d3 e0 shl eax, cl
+ 00172 8b 4e 40 mov ecx, DWORD PTR [esi+64]
+ 00175 33 d8 xor ebx, eax
+ 00177 23 5e 54 and ebx, DWORD PTR [esi+84]
+ 0017a 8b 46 44 mov eax, DWORD PTR [esi+68]
+ 0017d 89 5e 48 mov DWORD PTR [esi+72], ebx
+ 00180 0f b7 04 58 movzx eax, WORD PTR [eax+ebx*2]
+ 00184 66 89 04 51 mov WORD PTR [ecx+edx*2], ax
+ 00188 8b 56 48 mov edx, DWORD PTR [esi+72]
+ 0018b 8b 4e 44 mov ecx, DWORD PTR [esi+68]
+ 0018e 0f b7 46 6c movzx eax, WORD PTR [esi+108]
+ 00192 66 89 04 51 mov WORD PTR [ecx+edx*2], ax
+
+; 1686 : /* strstart never exceeds WSIZE-MAX_MATCH, so there are
+; 1687 : * always MIN_MATCH bytes ahead.
+; 1688 : */
+; 1689 : } while (--s->match_length != 0);
+
+ 00196 83 46 60 ff add DWORD PTR [esi+96], -1
+ 0019a 75 bb jne SHORT $LL7@deflate_fa
+
+; 1690 : s->strstart++;
+; 1691 : } else
+
+ 0019c 8b 5d 08 mov ebx, DWORD PTR _bflush$1$[ebp]
+ 0019f eb 79 jmp SHORT $LN44@deflate_fa
+$LN15@deflate_fa:
+
+; 1692 : #endif
+; 1693 : {
+; 1694 : s->strstart += s->match_length;
+
+ 001a1 01 46 6c add DWORD PTR [esi+108], eax
+
+; 1695 : s->match_length = 0;
+; 1696 : s->ins_h = s->window[s->strstart];
+
+ 001a4 8b 46 38 mov eax, DWORD PTR [esi+56]
+ 001a7 03 46 6c add eax, DWORD PTR [esi+108]
+
+; 1697 : UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
+
+ 001aa 8b 4e 58 mov ecx, DWORD PTR [esi+88]
+ 001ad c7 46 60 00 00
+ 00 00 mov DWORD PTR [esi+96], 0
+ 001b4 0f b6 10 movzx edx, BYTE PTR [eax]
+ 001b7 89 56 48 mov DWORD PTR [esi+72], edx
+ 001ba 0f b6 40 01 movzx eax, BYTE PTR [eax+1]
+ 001be d3 e2 shl edx, cl
+ 001c0 33 d0 xor edx, eax
+ 001c2 23 56 54 and edx, DWORD PTR [esi+84]
+ 001c5 89 56 48 mov DWORD PTR [esi+72], edx
+
+; 1698 : #if MIN_MATCH != 3
+; 1699 : Call UPDATE_HASH() MIN_MATCH-3 more times
+; 1700 : #endif
+; 1701 : /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
+; 1702 : * matter since it will be recomputed at next deflate call.
+; 1703 : */
+; 1704 : }
+; 1705 : } else {
+
+ 001c8 eb 53 jmp SHORT $LN14@deflate_fa
+$LN13@deflate_fa:
+
+; 1706 : /* No match, output a literal byte */
+; 1707 : Tracevv((stderr,"%c", s->window[s->strstart]));
+; 1708 : _tr_tally_lit (s, s->window[s->strstart], bflush);
+
+ 001ca 8b 4e 6c mov ecx, DWORD PTR [esi+108]
+ 001cd 33 ff xor edi, edi
+ 001cf 8b 46 38 mov eax, DWORD PTR [esi+56]
+ 001d2 33 db xor ebx, ebx
+ 001d4 8a 14 01 mov dl, BYTE PTR [ecx+eax]
+ 001d7 8b 8e a0 16 00
+ 00 mov ecx, DWORD PTR [esi+5792]
+ 001dd 8b 86 a4 16 00
+ 00 mov eax, DWORD PTR [esi+5796]
+ 001e3 66 89 3c 48 mov WORD PTR [eax+ecx*2], di
+ 001e7 8b 86 a0 16 00
+ 00 mov eax, DWORD PTR [esi+5792]
+ 001ed 8b 8e 98 16 00
+ 00 mov ecx, DWORD PTR [esi+5784]
+ 001f3 88 14 01 mov BYTE PTR [ecx+eax], dl
+ 001f6 ff 86 a0 16 00
+ 00 inc DWORD PTR [esi+5792]
+ 001fc 0f b6 c2 movzx eax, dl
+ 001ff 66 ff 84 86 94
+ 00 00 00 inc WORD PTR [esi+eax*4+148]
+ 00207 8b 86 9c 16 00
+ 00 mov eax, DWORD PTR [esi+5788]
+ 0020d 48 dec eax
+ 0020e 39 86 a0 16 00
+ 00 cmp DWORD PTR [esi+5792], eax
+ 00214 0f 94 c3 sete bl
+
+; 1709 : s->lookahead--;
+
+ 00217 ff 4e 74 dec DWORD PTR [esi+116]
+$LN44@deflate_fa:
+
+; 1710 : s->strstart++;
+
+ 0021a ff 46 6c inc DWORD PTR [esi+108]
+$LN14@deflate_fa:
+
+; 1711 : }
+; 1712 : if (bflush) FLUSH_BLOCK(s, 0);
+
+ 0021d 85 db test ebx, ebx
+ 0021f 8b 5d 0c mov ebx, DWORD PTR _flush$[ebp]
+ 00222 0f 84 e8 fd ff
+ ff je $LL2@deflate_fa
+ 00228 8b 4e 5c mov ecx, DWORD PTR [esi+92]
+ 0022b 85 c9 test ecx, ecx
+ 0022d 78 07 js SHORT $LN26@deflate_fa
+ 0022f 8b 56 38 mov edx, DWORD PTR [esi+56]
+ 00232 03 d1 add edx, ecx
+ 00234 eb 02 jmp SHORT $LN27@deflate_fa
+$LN26@deflate_fa:
+ 00236 33 d2 xor edx, edx
+$LN27@deflate_fa:
+ 00238 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 0023b 2b c1 sub eax, ecx
+ 0023d 8b ce mov ecx, esi
+ 0023f 6a 00 push 0
+ 00241 50 push eax
+ 00242 e8 00 00 00 00 call __tr_flush_block
+ 00247 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 0024a 83 c4 08 add esp, 8
+ 0024d 8b 0e mov ecx, DWORD PTR [esi]
+ 0024f 89 46 5c mov DWORD PTR [esi+92], eax
+ 00252 e8 00 00 00 00 call _flush_pending
+ 00257 8b 06 mov eax, DWORD PTR [esi]
+ 00259 83 78 10 00 cmp DWORD PTR [eax+16], 0
+ 0025d 0f 85 ad fd ff
+ ff jne $LL2@deflate_fa
+$LN39@deflate_fa:
+ 00263 5f pop edi
+ 00264 5e pop esi
+ 00265 33 c0 xor eax, eax
+ 00267 5b pop ebx
+
+; 1722 : }
+
+ 00268 5d pop ebp
+ 00269 c3 ret 0
+$LN38@deflate_fa:
+
+; 1713 : }
+; 1714 : s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
+
+ 0026a 8b 4e 6c mov ecx, DWORD PTR [esi+108]
+ 0026d b8 02 00 00 00 mov eax, 2
+ 00272 3b c8 cmp ecx, eax
+ 00274 0f 42 c1 cmovb eax, ecx
+ 00277 89 86 b4 16 00
+ 00 mov DWORD PTR [esi+5812], eax
+
+; 1715 : if (flush == Z_FINISH) {
+
+ 0027d 83 fb 04 cmp ebx, 4
+ 00280 75 3e jne SHORT $LN19@deflate_fa
+
+; 1716 : FLUSH_BLOCK(s, 1);
+
+ 00282 8b 46 5c mov eax, DWORD PTR [esi+92]
+ 00285 85 c0 test eax, eax
+ 00287 78 07 js SHORT $LN30@deflate_fa
+ 00289 8b 56 38 mov edx, DWORD PTR [esi+56]
+ 0028c 03 d0 add edx, eax
+ 0028e eb 02 jmp SHORT $LN31@deflate_fa
+$LN30@deflate_fa:
+ 00290 33 d2 xor edx, edx
+$LN31@deflate_fa:
+ 00292 2b c8 sub ecx, eax
+ 00294 6a 01 push 1
+ 00296 51 push ecx
+ 00297 8b ce mov ecx, esi
+ 00299 e8 00 00 00 00 call __tr_flush_block
+ 0029e 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 002a1 83 c4 08 add esp, 8
+ 002a4 8b 0e mov ecx, DWORD PTR [esi]
+ 002a6 89 46 5c mov DWORD PTR [esi+92], eax
+ 002a9 e8 00 00 00 00 call _flush_pending
+ 002ae 8b 0e mov ecx, DWORD PTR [esi]
+ 002b0 33 c0 xor eax, eax
+ 002b2 5f pop edi
+ 002b3 5e pop esi
+ 002b4 5b pop ebx
+ 002b5 39 41 10 cmp DWORD PTR [ecx+16], eax
+ 002b8 0f 95 c0 setne al
+ 002bb 83 c0 02 add eax, 2
+
+; 1722 : }
+
+ 002be 5d pop ebp
+ 002bf c3 ret 0
+$LN19@deflate_fa:
+
+; 1717 : return finish_done;
+; 1718 : }
+; 1719 : if (s->last_lit)
+
+ 002c0 83 be a0 16 00
+ 00 00 cmp DWORD PTR [esi+5792], 0
+ 002c7 74 38 je SHORT $LN22@deflate_fa
+
+; 1720 : FLUSH_BLOCK(s, 0);
+
+ 002c9 8b 46 5c mov eax, DWORD PTR [esi+92]
+ 002cc 85 c0 test eax, eax
+ 002ce 78 07 js SHORT $LN32@deflate_fa
+ 002d0 8b 56 38 mov edx, DWORD PTR [esi+56]
+ 002d3 03 d0 add edx, eax
+ 002d5 eb 02 jmp SHORT $LN33@deflate_fa
+$LN32@deflate_fa:
+ 002d7 33 d2 xor edx, edx
+$LN33@deflate_fa:
+ 002d9 2b c8 sub ecx, eax
+ 002db 6a 00 push 0
+ 002dd 51 push ecx
+ 002de 8b ce mov ecx, esi
+ 002e0 e8 00 00 00 00 call __tr_flush_block
+ 002e5 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 002e8 83 c4 08 add esp, 8
+ 002eb 8b 0e mov ecx, DWORD PTR [esi]
+ 002ed 89 46 5c mov DWORD PTR [esi+92], eax
+ 002f0 e8 00 00 00 00 call _flush_pending
+ 002f5 8b 06 mov eax, DWORD PTR [esi]
+ 002f7 83 78 10 00 cmp DWORD PTR [eax+16], 0
+ 002fb 0f 84 62 ff ff
+ ff je $LN39@deflate_fa
+$LN22@deflate_fa:
+ 00301 5f pop edi
+ 00302 5e pop esi
+
+; 1721 : return block_done;
+
+ 00303 b8 01 00 00 00 mov eax, 1
+ 00308 5b pop ebx
+
+; 1722 : }
+
+ 00309 5d pop ebp
+ 0030a c3 ret 0
+_deflate_fast ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\deflate.c
+; COMDAT _deflate_slow
+_TEXT SEGMENT
+_bflush$1$ = -4 ; size = 4
+_max_insert$1$ = 8 ; size = 4
+_s$ = 8 ; size = 4
+_flush$ = 12 ; size = 4
+_deflate_slow PROC ; COMDAT
+
+; 1733 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 51 push ecx
+ 00004 53 push ebx
+ 00005 8b 5d 0c mov ebx, DWORD PTR _flush$[ebp]
+ 00008 56 push esi
+ 00009 8b 75 08 mov esi, DWORD PTR _s$[ebp]
+ 0000c 57 push edi
+ 0000d 0f 1f 00 npad 3
+$LL2@deflate_sl:
+
+; 1734 : IPos hash_head; /* head of hash chain */
+; 1735 : int bflush; /* set if current block must be flushed */
+; 1736 :
+; 1737 : /* Process the input block. */
+; 1738 : for (;;) {
+; 1739 : /* Make sure that we always have enough lookahead, except
+; 1740 : * at the end of the input file. We need MAX_MATCH bytes
+; 1741 : * for the next match, plus MIN_MATCH bytes to insert the
+; 1742 : * string following the next match.
+; 1743 : */
+; 1744 : if (s->lookahead < MIN_LOOKAHEAD) {
+
+ 00010 8b 46 74 mov eax, DWORD PTR [esi+116]
+ 00013 3d 06 01 00 00 cmp eax, 262 ; 00000106H
+ 00018 73 21 jae SHORT $LN10@deflate_sl
+
+; 1745 : fill_window(s);
+
+ 0001a 8b ce mov ecx, esi
+ 0001c e8 00 00 00 00 call _fill_window
+
+; 1746 : if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
+
+ 00021 8b 46 74 mov eax, DWORD PTR [esi+116]
+ 00024 3d 06 01 00 00 cmp eax, 262 ; 00000106H
+ 00029 73 08 jae SHORT $LN9@deflate_sl
+ 0002b 85 db test ebx, ebx
+ 0002d 0f 84 28 02 00
+ 00 je $LN48@deflate_sl
+$LN9@deflate_sl:
+
+; 1747 : return need_more;
+; 1748 : }
+; 1749 : if (s->lookahead == 0) break; /* flush the current block */
+
+ 00033 85 c0 test eax, eax
+ 00035 0f 84 d9 02 00
+ 00 je $LN46@deflate_sl
+$LN10@deflate_sl:
+
+; 1750 : }
+; 1751 :
+; 1752 : /* Insert the string window[strstart .. strstart+2] in the
+; 1753 : * dictionary, and set hash_head to the head of the hash chain:
+; 1754 : */
+; 1755 : hash_head = NIL;
+
+ 0003b 33 ff xor edi, edi
+
+; 1756 : if (s->lookahead >= MIN_MATCH) {
+
+ 0003d 83 f8 03 cmp eax, 3
+ 00040 72 4c jb SHORT $LN11@deflate_sl
+
+; 1757 : INSERT_STRING(s, s->strstart, hash_head);
+
+ 00042 8b 7e 6c mov edi, DWORD PTR [esi+108]
+ 00045 8b 46 38 mov eax, DWORD PTR [esi+56]
+ 00048 8b 5e 48 mov ebx, DWORD PTR [esi+72]
+ 0004b 8b 4e 58 mov ecx, DWORD PTR [esi+88]
+ 0004e 8b 56 34 mov edx, DWORD PTR [esi+52]
+ 00051 0f b6 44 38 02 movzx eax, BYTE PTR [eax+edi+2]
+ 00056 23 d7 and edx, edi
+ 00058 d3 e3 shl ebx, cl
+ 0005a 8b 4e 40 mov ecx, DWORD PTR [esi+64]
+ 0005d 33 d8 xor ebx, eax
+ 0005f 23 5e 54 and ebx, DWORD PTR [esi+84]
+ 00062 8b 46 44 mov eax, DWORD PTR [esi+68]
+ 00065 89 5e 48 mov DWORD PTR [esi+72], ebx
+ 00068 0f b7 04 58 movzx eax, WORD PTR [eax+ebx*2]
+ 0006c 8b 5d 0c mov ebx, DWORD PTR _flush$[ebp]
+ 0006f 66 89 04 51 mov WORD PTR [ecx+edx*2], ax
+ 00073 8b 4e 6c mov ecx, DWORD PTR [esi+108]
+ 00076 23 4e 34 and ecx, DWORD PTR [esi+52]
+ 00079 8b 46 40 mov eax, DWORD PTR [esi+64]
+ 0007c 8b 56 48 mov edx, DWORD PTR [esi+72]
+ 0007f 0f b7 3c 48 movzx edi, WORD PTR [eax+ecx*2]
+ 00083 8b 4e 44 mov ecx, DWORD PTR [esi+68]
+ 00086 0f b7 46 6c movzx eax, WORD PTR [esi+108]
+ 0008a 66 89 04 51 mov WORD PTR [ecx+edx*2], ax
+$LN11@deflate_sl:
+
+; 1758 : }
+; 1759 :
+; 1760 : /* Find the longest match, discarding those <= prev_length.
+; 1761 : */
+; 1762 : s->prev_length = s->match_length, s->prev_match = s->match_start;
+
+ 0008e 8b 46 60 mov eax, DWORD PTR [esi+96]
+ 00091 89 46 78 mov DWORD PTR [esi+120], eax
+ 00094 8b 46 70 mov eax, DWORD PTR [esi+112]
+ 00097 89 46 64 mov DWORD PTR [esi+100], eax
+
+; 1763 : s->match_length = MIN_MATCH-1;
+
+ 0009a c7 46 60 02 00
+ 00 00 mov DWORD PTR [esi+96], 2
+
+; 1764 :
+; 1765 : if (hash_head != NIL && s->prev_length < s->max_lazy_match &&
+
+ 000a1 85 ff test edi, edi
+ 000a3 74 4f je SHORT $LN13@deflate_sl
+ 000a5 8b 46 78 mov eax, DWORD PTR [esi+120]
+ 000a8 3b 86 80 00 00
+ 00 cmp eax, DWORD PTR [esi+128]
+ 000ae 73 44 jae SHORT $LN13@deflate_sl
+ 000b0 8b 4e 6c mov ecx, DWORD PTR [esi+108]
+ 000b3 8b 46 2c mov eax, DWORD PTR [esi+44]
+ 000b6 2b cf sub ecx, edi
+ 000b8 2d 06 01 00 00 sub eax, 262 ; 00000106H
+ 000bd 3b c8 cmp ecx, eax
+ 000bf 77 33 ja SHORT $LN13@deflate_sl
+
+; 1766 : s->strstart - hash_head <= MAX_DIST(s)) {
+; 1767 : /* To simplify the code, we prevent matches with the string
+; 1768 : * of window index 0 (in particular we have to avoid a match
+; 1769 : * of the string with itself at the start of the input file).
+; 1770 : */
+; 1771 : s->match_length = longest_match (s, hash_head);
+
+ 000c1 8b d7 mov edx, edi
+ 000c3 8b ce mov ecx, esi
+ 000c5 e8 00 00 00 00 call _longest_match
+ 000ca 89 46 60 mov DWORD PTR [esi+96], eax
+
+; 1772 : /* longest_match() sets match_start */
+; 1773 :
+; 1774 : if (s->match_length <= 5 && (s->strategy == Z_FILTERED
+
+ 000cd 83 f8 05 cmp eax, 5
+ 000d0 77 22 ja SHORT $LN13@deflate_sl
+ 000d2 83 be 88 00 00
+ 00 01 cmp DWORD PTR [esi+136], 1
+ 000d9 74 12 je SHORT $LN14@deflate_sl
+ 000db 83 f8 03 cmp eax, 3
+ 000de 75 14 jne SHORT $LN13@deflate_sl
+ 000e0 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 000e3 2b 46 70 sub eax, DWORD PTR [esi+112]
+ 000e6 3d 00 10 00 00 cmp eax, 4096 ; 00001000H
+ 000eb 76 07 jbe SHORT $LN13@deflate_sl
+$LN14@deflate_sl:
+
+; 1775 : #if TOO_FAR <= 32767
+; 1776 : || (s->match_length == MIN_MATCH &&
+; 1777 : s->strstart - s->match_start > TOO_FAR)
+; 1778 : #endif
+; 1779 : )) {
+; 1780 :
+; 1781 : /* If prev_match is also MIN_MATCH, match_start is garbage
+; 1782 : * but we will ignore the current match anyway.
+; 1783 : */
+; 1784 : s->match_length = MIN_MATCH-1;
+
+ 000ed c7 46 60 02 00
+ 00 00 mov DWORD PTR [esi+96], 2
+$LN13@deflate_sl:
+
+; 1785 : }
+; 1786 : }
+; 1787 : /* If there was a match at the previous step and the current
+; 1788 : * match is not better, output the previous match:
+; 1789 : */
+; 1790 : if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) {
+
+ 000f4 8b 46 78 mov eax, DWORD PTR [esi+120]
+ 000f7 83 f8 03 cmp eax, 3
+ 000fa 0f 82 64 01 00
+ 00 jb $LN15@deflate_sl
+ 00100 39 46 60 cmp DWORD PTR [esi+96], eax
+ 00103 0f 87 5b 01 00
+ 00 ja $LN15@deflate_sl
+
+; 1791 : uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
+
+ 00109 8b 4e 6c mov ecx, DWORD PTR [esi+108]
+
+; 1792 : /* Do not insert strings in hash table beyond this. */
+; 1793 :
+; 1794 : check_match(s, s->strstart-1, s->prev_match, s->prev_length);
+; 1795 :
+; 1796 : _tr_tally_dist(s, s->strstart -1 - s->prev_match,
+
+ 0010c 8a d0 mov dl, al
+ 0010e 66 8b 46 6c mov ax, WORD PTR [esi+108]
+ 00112 83 c1 fd add ecx, -3 ; fffffffdH
+ 00115 66 2b 46 64 sub ax, WORD PTR [esi+100]
+ 00119 80 ea 03 sub dl, 3
+ 0011c 8b 7e 74 mov edi, DWORD PTR [esi+116]
+ 0011f 66 48 dec ax
+ 00121 0f b7 d8 movzx ebx, ax
+ 00124 03 f9 add edi, ecx
+ 00126 8b 8e a0 16 00
+ 00 mov ecx, DWORD PTR [esi+5792]
+ 0012c 8b 86 a4 16 00
+ 00 mov eax, DWORD PTR [esi+5796]
+ 00132 89 7d 08 mov DWORD PTR _max_insert$1$[ebp], edi
+ 00135 66 89 1c 48 mov WORD PTR [eax+ecx*2], bx
+ 00139 81 c3 ff ff 00
+ 00 add ebx, 65535 ; 0000ffffH
+ 0013f 8b 86 a0 16 00
+ 00 mov eax, DWORD PTR [esi+5792]
+ 00145 8b 8e 98 16 00
+ 00 mov ecx, DWORD PTR [esi+5784]
+ 0014b 88 14 01 mov BYTE PTR [ecx+eax], dl
+ 0014e ff 86 a0 16 00
+ 00 inc DWORD PTR [esi+5792]
+ 00154 0f b6 c2 movzx eax, dl
+ 00157 0f b6 80 00 00
+ 00 00 movzx eax, BYTE PTR __length_code[eax]
+ 0015e 66 ff 84 86 98
+ 04 00 00 inc WORD PTR [esi+eax*4+1176]
+ 00166 b8 00 01 00 00 mov eax, 256 ; 00000100H
+ 0016b 66 3b d8 cmp bx, ax
+ 0016e 0f b7 c3 movzx eax, bx
+ 00171 73 09 jae SHORT $LN30@deflate_sl
+ 00173 0f b6 80 00 00
+ 00 00 movzx eax, BYTE PTR __dist_code[eax]
+ 0017a eb 0a jmp SHORT $LN31@deflate_sl
+$LN30@deflate_sl:
+ 0017c c1 e8 07 shr eax, 7
+ 0017f 0f b6 80 00 01
+ 00 00 movzx eax, BYTE PTR __dist_code[eax+256]
+$LN31@deflate_sl:
+ 00186 66 ff 84 86 88
+ 09 00 00 inc WORD PTR [esi+eax*4+2440]
+ 0018e 33 c9 xor ecx, ecx
+ 00190 8b 86 9c 16 00
+ 00 mov eax, DWORD PTR [esi+5788]
+ 00196 48 dec eax
+ 00197 39 86 a0 16 00
+ 00 cmp DWORD PTR [esi+5792], eax
+
+; 1797 : s->prev_length - MIN_MATCH, bflush);
+; 1798 :
+; 1799 : /* Insert in hash table all strings up to the end of the match.
+; 1800 : * strstart-1 and strstart are already inserted. If there is not
+; 1801 : * enough lookahead, the last two strings are not inserted in
+; 1802 : * the hash table.
+; 1803 : */
+; 1804 : s->lookahead -= s->prev_length-1;
+
+ 0019d b8 01 00 00 00 mov eax, 1
+ 001a2 0f 94 c1 sete cl
+ 001a5 89 4d fc mov DWORD PTR _bflush$1$[ebp], ecx
+ 001a8 8b 4e 78 mov ecx, DWORD PTR [esi+120]
+ 001ab 2b c1 sub eax, ecx
+ 001ad 01 46 74 add DWORD PTR [esi+116], eax
+
+; 1805 : s->prev_length -= 2;
+
+ 001b0 8d 41 fe lea eax, DWORD PTR [ecx-2]
+ 001b3 89 46 78 mov DWORD PTR [esi+120], eax
+$LL7@deflate_sl:
+
+; 1806 : do {
+; 1807 : if (++s->strstart <= max_insert) {
+
+ 001b6 ff 46 6c inc DWORD PTR [esi+108]
+ 001b9 8b 5e 6c mov ebx, DWORD PTR [esi+108]
+ 001bc 3b df cmp ebx, edi
+ 001be 77 3c ja SHORT $LN5@deflate_sl
+
+; 1808 : INSERT_STRING(s, s->strstart, hash_head);
+
+ 001c0 8b 46 38 mov eax, DWORD PTR [esi+56]
+ 001c3 8b 7e 48 mov edi, DWORD PTR [esi+72]
+ 001c6 8b 4e 58 mov ecx, DWORD PTR [esi+88]
+ 001c9 8b 56 34 mov edx, DWORD PTR [esi+52]
+ 001cc 0f b6 44 18 02 movzx eax, BYTE PTR [eax+ebx+2]
+ 001d1 d3 e7 shl edi, cl
+ 001d3 8b 4e 40 mov ecx, DWORD PTR [esi+64]
+ 001d6 33 f8 xor edi, eax
+ 001d8 23 7e 54 and edi, DWORD PTR [esi+84]
+ 001db 23 d3 and edx, ebx
+ 001dd 8b 46 44 mov eax, DWORD PTR [esi+68]
+ 001e0 89 7e 48 mov DWORD PTR [esi+72], edi
+ 001e3 0f b7 04 78 movzx eax, WORD PTR [eax+edi*2]
+ 001e7 8b 7d 08 mov edi, DWORD PTR _max_insert$1$[ebp]
+ 001ea 66 89 04 51 mov WORD PTR [ecx+edx*2], ax
+ 001ee 8b 56 48 mov edx, DWORD PTR [esi+72]
+ 001f1 8b 4e 44 mov ecx, DWORD PTR [esi+68]
+ 001f4 0f b7 46 6c movzx eax, WORD PTR [esi+108]
+ 001f8 66 89 04 51 mov WORD PTR [ecx+edx*2], ax
+$LN5@deflate_sl:
+
+; 1809 : }
+; 1810 : } while (--s->prev_length != 0);
+
+ 001fc 83 46 78 ff add DWORD PTR [esi+120], -1
+ 00200 75 b4 jne SHORT $LL7@deflate_sl
+
+; 1811 : s->match_available = 0;
+; 1812 : s->match_length = MIN_MATCH-1;
+; 1813 : s->strstart++;
+
+ 00202 ff 46 6c inc DWORD PTR [esi+108]
+
+; 1814 :
+; 1815 : if (bflush) FLUSH_BLOCK(s, 0);
+
+ 00205 83 7d fc 00 cmp DWORD PTR _bflush$1$[ebp], 0
+ 00209 8b 4e 6c mov ecx, DWORD PTR [esi+108]
+ 0020c 8b 5d 0c mov ebx, DWORD PTR _flush$[ebp]
+ 0020f c7 46 68 00 00
+ 00 00 mov DWORD PTR [esi+104], 0
+ 00216 c7 46 60 02 00
+ 00 00 mov DWORD PTR [esi+96], 2
+ 0021d 0f 84 ed fd ff
+ ff je $LL2@deflate_sl
+ 00223 8b 46 5c mov eax, DWORD PTR [esi+92]
+ 00226 85 c0 test eax, eax
+ 00228 78 07 js SHORT $LN32@deflate_sl
+ 0022a 8b 56 38 mov edx, DWORD PTR [esi+56]
+ 0022d 03 d0 add edx, eax
+ 0022f eb 02 jmp SHORT $LN33@deflate_sl
+$LN32@deflate_sl:
+ 00231 33 d2 xor edx, edx
+$LN33@deflate_sl:
+ 00233 2b c8 sub ecx, eax
+ 00235 6a 00 push 0
+ 00237 51 push ecx
+ 00238 8b ce mov ecx, esi
+ 0023a e8 00 00 00 00 call __tr_flush_block
+ 0023f 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 00242 83 c4 08 add esp, 8
+ 00245 8b 0e mov ecx, DWORD PTR [esi]
+ 00247 89 46 5c mov DWORD PTR [esi+92], eax
+ 0024a e8 00 00 00 00 call _flush_pending
+ 0024f 8b 06 mov eax, DWORD PTR [esi]
+ 00251 83 78 10 00 cmp DWORD PTR [eax+16], 0
+ 00255 0f 85 b5 fd ff
+ ff jne $LL2@deflate_sl
+$LN48@deflate_sl:
+ 0025b 5f pop edi
+ 0025c 5e pop esi
+
+; 1826 : }
+; 1827 : s->strstart++;
+; 1828 : s->lookahead--;
+; 1829 : if (s->strm->avail_out == 0) return need_more;
+
+ 0025d 33 c0 xor eax, eax
+ 0025f 5b pop ebx
+
+; 1853 : }
+
+ 00260 8b e5 mov esp, ebp
+ 00262 5d pop ebp
+ 00263 c3 ret 0
+$LN15@deflate_sl:
+
+; 1816 :
+; 1817 : } else if (s->match_available) {
+
+ 00264 83 7e 68 00 cmp DWORD PTR [esi+104], 0
+ 00268 0f 84 94 00 00
+ 00 je $LN20@deflate_sl
+
+; 1818 : /* If there was no match at the previous position, output a
+; 1819 : * single literal. If there was a match but the current match
+; 1820 : * is longer, truncate the previous match to a single literal.
+; 1821 : */
+; 1822 : Tracevv((stderr,"%c", s->window[s->strstart-1]));
+; 1823 : _tr_tally_lit(s, s->window[s->strstart-1], bflush);
+
+ 0026e 8b 4e 6c mov ecx, DWORD PTR [esi+108]
+ 00271 33 ff xor edi, edi
+ 00273 8b 46 38 mov eax, DWORD PTR [esi+56]
+ 00276 8a 54 01 ff mov dl, BYTE PTR [ecx+eax-1]
+ 0027a 8b 8e a0 16 00
+ 00 mov ecx, DWORD PTR [esi+5792]
+ 00280 8b 86 a4 16 00
+ 00 mov eax, DWORD PTR [esi+5796]
+ 00286 66 89 3c 48 mov WORD PTR [eax+ecx*2], di
+ 0028a 8b 86 a0 16 00
+ 00 mov eax, DWORD PTR [esi+5792]
+ 00290 8b 8e 98 16 00
+ 00 mov ecx, DWORD PTR [esi+5784]
+ 00296 88 14 01 mov BYTE PTR [ecx+eax], dl
+ 00299 ff 86 a0 16 00
+ 00 inc DWORD PTR [esi+5792]
+ 0029f 0f b6 c2 movzx eax, dl
+ 002a2 66 ff 84 86 94
+ 00 00 00 inc WORD PTR [esi+eax*4+148]
+ 002aa 8b 86 9c 16 00
+ 00 mov eax, DWORD PTR [esi+5788]
+ 002b0 48 dec eax
+ 002b1 39 86 a0 16 00
+ 00 cmp DWORD PTR [esi+5792], eax
+
+; 1824 : if (bflush) {
+
+ 002b7 75 2f jne SHORT $LN22@deflate_sl
+
+; 1825 : FLUSH_BLOCK_ONLY(s, 0);
+
+ 002b9 8b 4e 5c mov ecx, DWORD PTR [esi+92]
+ 002bc 85 c9 test ecx, ecx
+ 002be 78 07 js SHORT $LN34@deflate_sl
+ 002c0 8b 56 38 mov edx, DWORD PTR [esi+56]
+ 002c3 03 d1 add edx, ecx
+ 002c5 eb 02 jmp SHORT $LN35@deflate_sl
+$LN34@deflate_sl:
+ 002c7 33 d2 xor edx, edx
+$LN35@deflate_sl:
+ 002c9 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 002cc 2b c1 sub eax, ecx
+ 002ce 8b ce mov ecx, esi
+ 002d0 6a 00 push 0
+ 002d2 50 push eax
+ 002d3 e8 00 00 00 00 call __tr_flush_block
+ 002d8 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 002db 83 c4 08 add esp, 8
+ 002de 8b 0e mov ecx, DWORD PTR [esi]
+ 002e0 89 46 5c mov DWORD PTR [esi+92], eax
+ 002e3 e8 00 00 00 00 call _flush_pending
+$LN22@deflate_sl:
+
+; 1826 : }
+; 1827 : s->strstart++;
+; 1828 : s->lookahead--;
+; 1829 : if (s->strm->avail_out == 0) return need_more;
+
+ 002e8 8b 06 mov eax, DWORD PTR [esi]
+ 002ea ff 46 6c inc DWORD PTR [esi+108]
+ 002ed ff 4e 74 dec DWORD PTR [esi+116]
+ 002f0 39 78 10 cmp DWORD PTR [eax+16], edi
+ 002f3 0f 85 17 fd ff
+ ff jne $LL2@deflate_sl
+ 002f9 5f pop edi
+ 002fa 5e pop esi
+ 002fb 33 c0 xor eax, eax
+ 002fd 5b pop ebx
+
+; 1853 : }
+
+ 002fe 8b e5 mov esp, ebp
+ 00300 5d pop ebp
+ 00301 c3 ret 0
+$LN20@deflate_sl:
+
+; 1830 : } else {
+; 1831 : /* There is no previous match to compare with, wait for
+; 1832 : * the next step to decide.
+; 1833 : */
+; 1834 : s->match_available = 1;
+; 1835 : s->strstart++;
+
+ 00302 ff 46 6c inc DWORD PTR [esi+108]
+
+; 1836 : s->lookahead--;
+
+ 00305 ff 4e 74 dec DWORD PTR [esi+116]
+ 00308 c7 46 68 01 00
+ 00 00 mov DWORD PTR [esi+104], 1
+
+; 1837 : }
+; 1838 : }
+
+ 0030f e9 fc fc ff ff jmp $LL2@deflate_sl
+$LN46@deflate_sl:
+
+; 1839 : Assert (flush != Z_NO_FLUSH, "no flush?");
+; 1840 : if (s->match_available) {
+
+ 00314 83 7e 68 00 cmp DWORD PTR [esi+104], 0
+ 00318 74 3f je SHORT $LN24@deflate_sl
+
+; 1841 : Tracevv((stderr,"%c", s->window[s->strstart-1]));
+; 1842 : _tr_tally_lit(s, s->window[s->strstart-1], bflush);
+
+ 0031a 8b 4e 6c mov ecx, DWORD PTR [esi+108]
+ 0031d 33 ff xor edi, edi
+ 0031f 8b 46 38 mov eax, DWORD PTR [esi+56]
+ 00322 8a 54 01 ff mov dl, BYTE PTR [ecx+eax-1]
+ 00326 8b 8e a0 16 00
+ 00 mov ecx, DWORD PTR [esi+5792]
+ 0032c 8b 86 a4 16 00
+ 00 mov eax, DWORD PTR [esi+5796]
+ 00332 66 89 3c 48 mov WORD PTR [eax+ecx*2], di
+ 00336 8b 86 a0 16 00
+ 00 mov eax, DWORD PTR [esi+5792]
+ 0033c 8b 8e 98 16 00
+ 00 mov ecx, DWORD PTR [esi+5784]
+ 00342 88 14 01 mov BYTE PTR [ecx+eax], dl
+ 00345 ff 86 a0 16 00
+ 00 inc DWORD PTR [esi+5792]
+ 0034b 0f b6 c2 movzx eax, dl
+ 0034e 66 ff 84 86 94
+ 00 00 00 inc WORD PTR [esi+eax*4+148]
+
+; 1843 : s->match_available = 0;
+
+ 00356 89 7e 68 mov DWORD PTR [esi+104], edi
+$LN24@deflate_sl:
+
+; 1844 : }
+; 1845 : s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
+
+ 00359 8b 4e 6c mov ecx, DWORD PTR [esi+108]
+ 0035c b8 02 00 00 00 mov eax, 2
+ 00361 3b c8 cmp ecx, eax
+ 00363 0f 42 c1 cmovb eax, ecx
+ 00366 89 86 b4 16 00
+ 00 mov DWORD PTR [esi+5812], eax
+
+; 1846 : if (flush == Z_FINISH) {
+
+ 0036c 83 fb 04 cmp ebx, 4
+ 0036f 75 40 jne SHORT $LN25@deflate_sl
+
+; 1847 : FLUSH_BLOCK(s, 1);
+
+ 00371 8b 46 5c mov eax, DWORD PTR [esi+92]
+ 00374 85 c0 test eax, eax
+ 00376 78 07 js SHORT $LN38@deflate_sl
+ 00378 8b 56 38 mov edx, DWORD PTR [esi+56]
+ 0037b 03 d0 add edx, eax
+ 0037d eb 02 jmp SHORT $LN39@deflate_sl
+$LN38@deflate_sl:
+ 0037f 33 d2 xor edx, edx
+$LN39@deflate_sl:
+ 00381 2b c8 sub ecx, eax
+ 00383 6a 01 push 1
+ 00385 51 push ecx
+ 00386 8b ce mov ecx, esi
+ 00388 e8 00 00 00 00 call __tr_flush_block
+ 0038d 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 00390 83 c4 08 add esp, 8
+ 00393 8b 0e mov ecx, DWORD PTR [esi]
+ 00395 89 46 5c mov DWORD PTR [esi+92], eax
+ 00398 e8 00 00 00 00 call _flush_pending
+ 0039d 8b 06 mov eax, DWORD PTR [esi]
+ 0039f 33 c9 xor ecx, ecx
+ 003a1 5f pop edi
+ 003a2 5e pop esi
+ 003a3 5b pop ebx
+ 003a4 39 48 10 cmp DWORD PTR [eax+16], ecx
+ 003a7 0f 95 c1 setne cl
+ 003aa 8d 41 02 lea eax, DWORD PTR [ecx+2]
+
+; 1853 : }
+
+ 003ad 8b e5 mov esp, ebp
+ 003af 5d pop ebp
+ 003b0 c3 ret 0
+$LN25@deflate_sl:
+
+; 1848 : return finish_done;
+; 1849 : }
+; 1850 : if (s->last_lit)
+
+ 003b1 83 be a0 16 00
+ 00 00 cmp DWORD PTR [esi+5792], 0
+ 003b8 74 38 je SHORT $LN28@deflate_sl
+
+; 1851 : FLUSH_BLOCK(s, 0);
+
+ 003ba 8b 46 5c mov eax, DWORD PTR [esi+92]
+ 003bd 85 c0 test eax, eax
+ 003bf 78 07 js SHORT $LN40@deflate_sl
+ 003c1 8b 56 38 mov edx, DWORD PTR [esi+56]
+ 003c4 03 d0 add edx, eax
+ 003c6 eb 02 jmp SHORT $LN41@deflate_sl
+$LN40@deflate_sl:
+ 003c8 33 d2 xor edx, edx
+$LN41@deflate_sl:
+ 003ca 2b c8 sub ecx, eax
+ 003cc 6a 00 push 0
+ 003ce 51 push ecx
+ 003cf 8b ce mov ecx, esi
+ 003d1 e8 00 00 00 00 call __tr_flush_block
+ 003d6 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 003d9 83 c4 08 add esp, 8
+ 003dc 8b 0e mov ecx, DWORD PTR [esi]
+ 003de 89 46 5c mov DWORD PTR [esi+92], eax
+ 003e1 e8 00 00 00 00 call _flush_pending
+ 003e6 8b 06 mov eax, DWORD PTR [esi]
+ 003e8 83 78 10 00 cmp DWORD PTR [eax+16], 0
+ 003ec 0f 84 69 fe ff
+ ff je $LN48@deflate_sl
+$LN28@deflate_sl:
+ 003f2 5f pop edi
+ 003f3 5e pop esi
+
+; 1852 : return block_done;
+
+ 003f4 b8 01 00 00 00 mov eax, 1
+ 003f9 5b pop ebx
+
+; 1853 : }
+
+ 003fa 8b e5 mov esp, ebp
+ 003fc 5d pop ebp
+ 003fd c3 ret 0
+_deflate_slow ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\deflate.c
+; COMDAT _deflate_rle
+_TEXT SEGMENT
+_flush$1$ = -4 ; size = 4
+_deflate_rle PROC ; COMDAT
+; _s$ = ecx
+; _flush$ = edx
+
+; 1864 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 51 push ecx
+ 00004 53 push ebx
+ 00005 56 push esi
+ 00006 8b da mov ebx, edx
+ 00008 8b f1 mov esi, ecx
+ 0000a 57 push edi
+ 0000b 89 5d fc mov DWORD PTR _flush$1$[ebp], ebx
+ 0000e 66 90 npad 2
+$LL2@deflate_rl:
+
+; 1865 : int bflush; /* set if current block must be flushed */
+; 1866 : uInt prev; /* byte at distance one to match */
+; 1867 : Bytef *scan, *strend; /* scan goes up to strend for length of run */
+; 1868 :
+; 1869 : for (;;) {
+; 1870 : /* Make sure that we always have enough lookahead, except
+; 1871 : * at the end of the input file. We need MAX_MATCH bytes
+; 1872 : * for the longest run, plus one for the unrolled loop.
+; 1873 : */
+; 1874 : if (s->lookahead <= MAX_MATCH) {
+
+ 00010 8b 7e 74 mov edi, DWORD PTR [esi+116]
+ 00013 81 ff 02 01 00
+ 00 cmp edi, 258 ; 00000102H
+ 00019 77 22 ja SHORT $LN10@deflate_rl
+
+; 1875 : fill_window(s);
+
+ 0001b 8b ce mov ecx, esi
+ 0001d e8 00 00 00 00 call _fill_window
+
+; 1876 : if (s->lookahead <= MAX_MATCH && flush == Z_NO_FLUSH) {
+
+ 00022 8b 7e 74 mov edi, DWORD PTR [esi+116]
+ 00025 81 ff 02 01 00
+ 00 cmp edi, 258 ; 00000102H
+ 0002b 77 08 ja SHORT $LN9@deflate_rl
+ 0002d 85 db test ebx, ebx
+ 0002f 0f 84 b6 01 00
+ 00 je $LN37@deflate_rl
+$LN9@deflate_rl:
+
+; 1877 : return need_more;
+; 1878 : }
+; 1879 : if (s->lookahead == 0) break; /* flush the current block */
+
+ 00035 85 ff test edi, edi
+ 00037 0f 84 b7 01 00
+ 00 je $LN36@deflate_rl
+$LN10@deflate_rl:
+
+; 1880 : }
+; 1881 :
+; 1882 : /* See how many times the previous byte repeats */
+; 1883 : s->match_length = 0;
+
+ 0003d c7 46 60 00 00
+ 00 00 mov DWORD PTR [esi+96], 0
+
+; 1884 : if (s->lookahead >= MIN_MATCH && s->strstart > 0) {
+
+ 00044 83 ff 03 cmp edi, 3
+ 00047 0f 82 95 00 00
+ 00 jb $LN14@deflate_rl
+ 0004d 8b 4e 6c mov ecx, DWORD PTR [esi+108]
+ 00050 85 c9 test ecx, ecx
+ 00052 0f 84 8a 00 00
+ 00 je $LN14@deflate_rl
+
+; 1885 : scan = s->window + s->strstart - 1;
+
+ 00058 8b 5e 38 mov ebx, DWORD PTR [esi+56]
+ 0005b 03 d9 add ebx, ecx
+
+; 1886 : prev = *scan;
+; 1887 : if (prev == *++scan && prev == *++scan && prev == *++scan) {
+
+ 0005d 0f b6 0b movzx ecx, BYTE PTR [ebx]
+ 00060 0f b6 53 ff movzx edx, BYTE PTR [ebx-1]
+ 00064 8d 43 ff lea eax, DWORD PTR [ebx-1]
+ 00067 3b d1 cmp edx, ecx
+ 00069 75 74 jne SHORT $LN44@deflate_rl
+ 0006b 0f b6 48 02 movzx ecx, BYTE PTR [eax+2]
+ 0006f 3b d1 cmp edx, ecx
+ 00071 75 6c jne SHORT $LN44@deflate_rl
+ 00073 0f b6 48 03 movzx ecx, BYTE PTR [eax+3]
+ 00077 83 c0 03 add eax, 3
+ 0007a 3b d1 cmp edx, ecx
+ 0007c 75 61 jne SHORT $LN44@deflate_rl
+
+; 1888 : strend = s->window + s->strstart + MAX_MATCH;
+
+ 0007e 81 c3 02 01 00
+ 00 add ebx, 258 ; 00000102H
+$LL7@deflate_rl:
+
+; 1889 : do {
+; 1890 : } while (prev == *++scan && prev == *++scan &&
+; 1891 : prev == *++scan && prev == *++scan &&
+; 1892 : prev == *++scan && prev == *++scan &&
+; 1893 : prev == *++scan && prev == *++scan &&
+
+ 00084 0f b6 48 01 movzx ecx, BYTE PTR [eax+1]
+ 00088 40 inc eax
+ 00089 3b d1 cmp edx, ecx
+ 0008b 75 43 jne SHORT $LN13@deflate_rl
+ 0008d 0f b6 48 01 movzx ecx, BYTE PTR [eax+1]
+ 00091 40 inc eax
+ 00092 3b d1 cmp edx, ecx
+ 00094 75 3a jne SHORT $LN13@deflate_rl
+ 00096 0f b6 48 01 movzx ecx, BYTE PTR [eax+1]
+ 0009a 40 inc eax
+ 0009b 3b d1 cmp edx, ecx
+ 0009d 75 31 jne SHORT $LN13@deflate_rl
+ 0009f 0f b6 48 01 movzx ecx, BYTE PTR [eax+1]
+ 000a3 40 inc eax
+ 000a4 3b d1 cmp edx, ecx
+ 000a6 75 28 jne SHORT $LN13@deflate_rl
+ 000a8 0f b6 48 01 movzx ecx, BYTE PTR [eax+1]
+ 000ac 40 inc eax
+ 000ad 3b d1 cmp edx, ecx
+ 000af 75 1f jne SHORT $LN13@deflate_rl
+ 000b1 0f b6 48 01 movzx ecx, BYTE PTR [eax+1]
+ 000b5 40 inc eax
+ 000b6 3b d1 cmp edx, ecx
+ 000b8 75 16 jne SHORT $LN13@deflate_rl
+ 000ba 0f b6 48 01 movzx ecx, BYTE PTR [eax+1]
+ 000be 40 inc eax
+ 000bf 3b d1 cmp edx, ecx
+ 000c1 75 0d jne SHORT $LN13@deflate_rl
+ 000c3 0f b6 48 01 movzx ecx, BYTE PTR [eax+1]
+ 000c7 40 inc eax
+ 000c8 3b d1 cmp edx, ecx
+ 000ca 75 04 jne SHORT $LN13@deflate_rl
+ 000cc 3b c3 cmp eax, ebx
+ 000ce 72 b4 jb SHORT $LL7@deflate_rl
+$LN13@deflate_rl:
+
+; 1894 : scan < strend);
+; 1895 : s->match_length = MAX_MATCH - (int)(strend - scan);
+
+ 000d0 2b c3 sub eax, ebx
+ 000d2 05 02 01 00 00 add eax, 258 ; 00000102H
+
+; 1896 : if (s->match_length > s->lookahead)
+
+ 000d7 3b c7 cmp eax, edi
+ 000d9 0f 47 c7 cmova eax, edi
+ 000dc 89 46 60 mov DWORD PTR [esi+96], eax
+$LN44@deflate_rl:
+ 000df 8b 5d fc mov ebx, DWORD PTR _flush$1$[ebp]
+$LN14@deflate_rl:
+
+; 1897 : s->match_length = s->lookahead;
+; 1898 : }
+; 1899 : Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan");
+; 1900 : }
+; 1901 :
+; 1902 : /* Emit match if have run of MIN_MATCH or longer, else emit literal */
+; 1903 : if (s->match_length >= MIN_MATCH) {
+
+ 000e2 83 7e 60 03 cmp DWORD PTR [esi+96], 3
+ 000e6 72 6d jb SHORT $LN15@deflate_rl
+
+; 1904 : check_match(s, s->strstart, s->strstart - 1, s->match_length);
+; 1905 :
+; 1906 : _tr_tally_dist(s, 1, s->match_length - MIN_MATCH, bflush);
+
+ 000e8 8b 8e a0 16 00
+ 00 mov ecx, DWORD PTR [esi+5792]
+ 000ee bf 01 00 00 00 mov edi, 1
+ 000f3 8b 86 a4 16 00
+ 00 mov eax, DWORD PTR [esi+5796]
+ 000f9 8a 56 60 mov dl, BYTE PTR [esi+96]
+ 000fc 80 ea 03 sub dl, 3
+ 000ff 66 89 3c 48 mov WORD PTR [eax+ecx*2], di
+ 00103 8b 86 a0 16 00
+ 00 mov eax, DWORD PTR [esi+5792]
+ 00109 8b 8e 98 16 00
+ 00 mov ecx, DWORD PTR [esi+5784]
+ 0010f 88 14 01 mov BYTE PTR [ecx+eax], dl
+ 00112 33 c9 xor ecx, ecx
+ 00114 ff 86 a0 16 00
+ 00 inc DWORD PTR [esi+5792]
+ 0011a 0f b6 c2 movzx eax, dl
+ 0011d 0f b6 80 00 00
+ 00 00 movzx eax, BYTE PTR __length_code[eax]
+ 00124 66 ff 84 86 98
+ 04 00 00 inc WORD PTR [esi+eax*4+1176]
+ 0012c 66 ff 86 88 09
+ 00 00 inc WORD PTR [esi+2440]
+ 00133 8b 86 9c 16 00
+ 00 mov eax, DWORD PTR [esi+5788]
+ 00139 48 dec eax
+ 0013a 39 86 a0 16 00
+ 00 cmp DWORD PTR [esi+5792], eax
+
+; 1907 :
+; 1908 : s->lookahead -= s->match_length;
+
+ 00140 8b 46 60 mov eax, DWORD PTR [esi+96]
+ 00143 0f 94 c1 sete cl
+
+; 1909 : s->strstart += s->match_length;
+; 1910 : s->match_length = 0;
+
+ 00146 c7 46 60 00 00
+ 00 00 mov DWORD PTR [esi+96], 0
+ 0014d 29 46 74 sub DWORD PTR [esi+116], eax
+ 00150 01 46 6c add DWORD PTR [esi+108], eax
+
+; 1911 : } else {
+
+ 00153 eb 53 jmp SHORT $LN16@deflate_rl
+$LN15@deflate_rl:
+
+; 1912 : /* No match, output a literal byte */
+; 1913 : Tracevv((stderr,"%c", s->window[s->strstart]));
+; 1914 : _tr_tally_lit (s, s->window[s->strstart], bflush);
+
+ 00155 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 00158 33 ff xor edi, edi
+ 0015a 8b 4e 38 mov ecx, DWORD PTR [esi+56]
+ 0015d 8a 14 01 mov dl, BYTE PTR [ecx+eax]
+ 00160 8b 8e a0 16 00
+ 00 mov ecx, DWORD PTR [esi+5792]
+ 00166 8b 86 a4 16 00
+ 00 mov eax, DWORD PTR [esi+5796]
+ 0016c 66 89 3c 48 mov WORD PTR [eax+ecx*2], di
+ 00170 8b 86 a0 16 00
+ 00 mov eax, DWORD PTR [esi+5792]
+ 00176 8b 8e 98 16 00
+ 00 mov ecx, DWORD PTR [esi+5784]
+ 0017c 88 14 01 mov BYTE PTR [ecx+eax], dl
+ 0017f 33 c9 xor ecx, ecx
+ 00181 ff 86 a0 16 00
+ 00 inc DWORD PTR [esi+5792]
+ 00187 0f b6 c2 movzx eax, dl
+ 0018a 66 ff 84 86 94
+ 00 00 00 inc WORD PTR [esi+eax*4+148]
+ 00192 8b 86 9c 16 00
+ 00 mov eax, DWORD PTR [esi+5788]
+ 00198 48 dec eax
+ 00199 39 86 a0 16 00
+ 00 cmp DWORD PTR [esi+5792], eax
+ 0019f 0f 94 c1 sete cl
+
+; 1915 : s->lookahead--;
+
+ 001a2 ff 4e 74 dec DWORD PTR [esi+116]
+
+; 1916 : s->strstart++;
+
+ 001a5 ff 46 6c inc DWORD PTR [esi+108]
+$LN16@deflate_rl:
+
+; 1917 : }
+; 1918 : if (bflush) FLUSH_BLOCK(s, 0);
+
+ 001a8 85 c9 test ecx, ecx
+ 001aa 0f 84 60 fe ff
+ ff je $LL2@deflate_rl
+ 001b0 8b 4e 5c mov ecx, DWORD PTR [esi+92]
+ 001b3 85 c9 test ecx, ecx
+ 001b5 78 07 js SHORT $LN26@deflate_rl
+ 001b7 8b 56 38 mov edx, DWORD PTR [esi+56]
+ 001ba 03 d1 add edx, ecx
+ 001bc eb 02 jmp SHORT $LN27@deflate_rl
+$LN26@deflate_rl:
+ 001be 33 d2 xor edx, edx
+$LN27@deflate_rl:
+ 001c0 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 001c3 2b c1 sub eax, ecx
+ 001c5 8b ce mov ecx, esi
+ 001c7 6a 00 push 0
+ 001c9 50 push eax
+ 001ca e8 00 00 00 00 call __tr_flush_block
+ 001cf 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 001d2 83 c4 08 add esp, 8
+ 001d5 8b 0e mov ecx, DWORD PTR [esi]
+ 001d7 89 46 5c mov DWORD PTR [esi+92], eax
+ 001da e8 00 00 00 00 call _flush_pending
+ 001df 8b 06 mov eax, DWORD PTR [esi]
+ 001e1 83 78 10 00 cmp DWORD PTR [eax+16], 0
+ 001e5 0f 85 25 fe ff
+ ff jne $LL2@deflate_rl
+$LN37@deflate_rl:
+ 001eb 5f pop edi
+ 001ec 5e pop esi
+ 001ed 33 c0 xor eax, eax
+ 001ef 5b pop ebx
+
+; 1928 : }
+
+ 001f0 8b e5 mov esp, ebp
+ 001f2 5d pop ebp
+ 001f3 c3 ret 0
+$LN36@deflate_rl:
+
+; 1919 : }
+; 1920 : s->insert = 0;
+
+ 001f4 c7 86 b4 16 00
+ 00 00 00 00 00 mov DWORD PTR [esi+5812], 0
+
+; 1921 : if (flush == Z_FINISH) {
+
+ 001fe 83 fb 04 cmp ebx, 4
+ 00201 75 43 jne SHORT $LN19@deflate_rl
+
+; 1922 : FLUSH_BLOCK(s, 1);
+
+ 00203 8b 4e 5c mov ecx, DWORD PTR [esi+92]
+ 00206 85 c9 test ecx, ecx
+ 00208 78 07 js SHORT $LN28@deflate_rl
+ 0020a 8b 56 38 mov edx, DWORD PTR [esi+56]
+ 0020d 03 d1 add edx, ecx
+ 0020f eb 02 jmp SHORT $LN29@deflate_rl
+$LN28@deflate_rl:
+ 00211 33 d2 xor edx, edx
+$LN29@deflate_rl:
+ 00213 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 00216 2b c1 sub eax, ecx
+ 00218 8b ce mov ecx, esi
+ 0021a 6a 01 push 1
+ 0021c 50 push eax
+ 0021d e8 00 00 00 00 call __tr_flush_block
+ 00222 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 00225 83 c4 08 add esp, 8
+ 00228 8b 0e mov ecx, DWORD PTR [esi]
+ 0022a 89 46 5c mov DWORD PTR [esi+92], eax
+ 0022d e8 00 00 00 00 call _flush_pending
+ 00232 8b 06 mov eax, DWORD PTR [esi]
+ 00234 33 c9 xor ecx, ecx
+ 00236 5f pop edi
+ 00237 5e pop esi
+ 00238 5b pop ebx
+ 00239 39 48 10 cmp DWORD PTR [eax+16], ecx
+ 0023c 0f 95 c1 setne cl
+ 0023f 8d 41 02 lea eax, DWORD PTR [ecx+2]
+
+; 1928 : }
+
+ 00242 8b e5 mov esp, ebp
+ 00244 5d pop ebp
+ 00245 c3 ret 0
+$LN19@deflate_rl:
+
+; 1923 : return finish_done;
+; 1924 : }
+; 1925 : if (s->last_lit)
+
+ 00246 83 be a0 16 00
+ 00 00 cmp DWORD PTR [esi+5792], 0
+ 0024d 74 3b je SHORT $LN22@deflate_rl
+
+; 1926 : FLUSH_BLOCK(s, 0);
+
+ 0024f 8b 4e 5c mov ecx, DWORD PTR [esi+92]
+ 00252 85 c9 test ecx, ecx
+ 00254 78 07 js SHORT $LN30@deflate_rl
+ 00256 8b 56 38 mov edx, DWORD PTR [esi+56]
+ 00259 03 d1 add edx, ecx
+ 0025b eb 02 jmp SHORT $LN31@deflate_rl
+$LN30@deflate_rl:
+ 0025d 33 d2 xor edx, edx
+$LN31@deflate_rl:
+ 0025f 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 00262 2b c1 sub eax, ecx
+ 00264 8b ce mov ecx, esi
+ 00266 6a 00 push 0
+ 00268 50 push eax
+ 00269 e8 00 00 00 00 call __tr_flush_block
+ 0026e 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 00271 83 c4 08 add esp, 8
+ 00274 8b 0e mov ecx, DWORD PTR [esi]
+ 00276 89 46 5c mov DWORD PTR [esi+92], eax
+ 00279 e8 00 00 00 00 call _flush_pending
+ 0027e 8b 06 mov eax, DWORD PTR [esi]
+ 00280 83 78 10 00 cmp DWORD PTR [eax+16], 0
+ 00284 0f 84 61 ff ff
+ ff je $LN37@deflate_rl
+$LN22@deflate_rl:
+ 0028a 5f pop edi
+ 0028b 5e pop esi
+
+; 1927 : return block_done;
+
+ 0028c b8 01 00 00 00 mov eax, 1
+ 00291 5b pop ebx
+
+; 1928 : }
+
+ 00292 8b e5 mov esp, ebp
+ 00294 5d pop ebp
+ 00295 c3 ret 0
+_deflate_rle ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\deflate.c
+; COMDAT _deflate_huff
+_TEXT SEGMENT
+_deflate_huff PROC ; COMDAT
+; _s$ = ecx
+; _flush$ = edx
+
+; 1937 : {
+
+ 00000 53 push ebx
+ 00001 56 push esi
+ 00002 57 push edi
+ 00003 8b fa mov edi, edx
+ 00005 8b f1 mov esi, ecx
+$LL2@deflate_hu:
+
+; 1938 : int bflush; /* set if current block must be flushed */
+; 1939 :
+; 1940 : for (;;) {
+; 1941 : /* Make sure that we have a literal to write. */
+; 1942 : if (s->lookahead == 0) {
+
+ 00007 83 7e 74 00 cmp DWORD PTR [esi+116], 0
+ 0000b 75 11 jne SHORT $LN6@deflate_hu
+
+; 1943 : fill_window(s);
+
+ 0000d 8b ce mov ecx, esi
+ 0000f e8 00 00 00 00 call _fill_window
+
+; 1944 : if (s->lookahead == 0) {
+
+ 00014 83 7e 74 00 cmp DWORD PTR [esi+116], 0
+ 00018 0f 84 97 00 00
+ 00 je $LN23@deflate_hu
+$LN6@deflate_hu:
+
+; 1946 : return need_more;
+; 1947 : break; /* flush the current block */
+; 1948 : }
+; 1949 : }
+; 1950 :
+; 1951 : /* Output a literal byte */
+; 1952 : s->match_length = 0;
+; 1953 : Tracevv((stderr,"%c", s->window[s->strstart]));
+; 1954 : _tr_tally_lit (s, s->window[s->strstart], bflush);
+
+ 0001e 8b 4e 6c mov ecx, DWORD PTR [esi+108]
+ 00021 33 db xor ebx, ebx
+ 00023 8b 46 38 mov eax, DWORD PTR [esi+56]
+ 00026 c7 46 60 00 00
+ 00 00 mov DWORD PTR [esi+96], 0
+ 0002d 8a 14 01 mov dl, BYTE PTR [ecx+eax]
+ 00030 8b 8e a0 16 00
+ 00 mov ecx, DWORD PTR [esi+5792]
+ 00036 8b 86 a4 16 00
+ 00 mov eax, DWORD PTR [esi+5796]
+ 0003c 66 89 1c 48 mov WORD PTR [eax+ecx*2], bx
+ 00040 8b 86 a0 16 00
+ 00 mov eax, DWORD PTR [esi+5792]
+ 00046 8b 8e 98 16 00
+ 00 mov ecx, DWORD PTR [esi+5784]
+ 0004c 88 14 01 mov BYTE PTR [ecx+eax], dl
+ 0004f ff 86 a0 16 00
+ 00 inc DWORD PTR [esi+5792]
+ 00055 0f b6 c2 movzx eax, dl
+ 00058 66 ff 84 86 94
+ 00 00 00 inc WORD PTR [esi+eax*4+148]
+ 00060 8b 86 9c 16 00
+ 00 mov eax, DWORD PTR [esi+5788]
+
+; 1955 : s->lookahead--;
+; 1956 : s->strstart++;
+
+ 00066 ff 46 6c inc DWORD PTR [esi+108]
+ 00069 48 dec eax
+ 0006a ff 4e 74 dec DWORD PTR [esi+116]
+ 0006d 8b 4e 6c mov ecx, DWORD PTR [esi+108]
+ 00070 39 86 a0 16 00
+ 00 cmp DWORD PTR [esi+5792], eax
+
+; 1957 : if (bflush) FLUSH_BLOCK(s, 0);
+
+ 00076 75 8f jne SHORT $LL2@deflate_hu
+ 00078 8b 46 5c mov eax, DWORD PTR [esi+92]
+ 0007b 85 c0 test eax, eax
+ 0007d 78 07 js SHORT $LN15@deflate_hu
+ 0007f 8b 56 38 mov edx, DWORD PTR [esi+56]
+ 00082 03 d0 add edx, eax
+ 00084 eb 02 jmp SHORT $LN16@deflate_hu
+$LN15@deflate_hu:
+ 00086 33 d2 xor edx, edx
+$LN16@deflate_hu:
+ 00088 2b c8 sub ecx, eax
+ 0008a 6a 00 push 0
+ 0008c 51 push ecx
+ 0008d 8b ce mov ecx, esi
+ 0008f e8 00 00 00 00 call __tr_flush_block
+ 00094 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 00097 83 c4 08 add esp, 8
+ 0009a 8b 0e mov ecx, DWORD PTR [esi]
+ 0009c 89 46 5c mov DWORD PTR [esi+92], eax
+ 0009f e8 00 00 00 00 call _flush_pending
+ 000a4 8b 06 mov eax, DWORD PTR [esi]
+ 000a6 39 58 10 cmp DWORD PTR [eax+16], ebx
+ 000a9 0f 85 58 ff ff
+ ff jne $LL2@deflate_hu
+$LN24@deflate_hu:
+ 000af 5f pop edi
+ 000b0 5e pop esi
+ 000b1 33 c0 xor eax, eax
+ 000b3 5b pop ebx
+
+; 1967 : }
+
+ 000b4 c3 ret 0
+$LN23@deflate_hu:
+
+; 1945 : if (flush == Z_NO_FLUSH)
+
+ 000b5 85 ff test edi, edi
+ 000b7 74 f6 je SHORT $LN24@deflate_hu
+
+; 1958 : }
+; 1959 : s->insert = 0;
+
+ 000b9 c7 86 b4 16 00
+ 00 00 00 00 00 mov DWORD PTR [esi+5812], 0
+
+; 1960 : if (flush == Z_FINISH) {
+
+ 000c3 83 ff 04 cmp edi, 4
+ 000c6 75 40 jne SHORT $LN10@deflate_hu
+
+; 1961 : FLUSH_BLOCK(s, 1);
+
+ 000c8 8b 4e 5c mov ecx, DWORD PTR [esi+92]
+ 000cb 85 c9 test ecx, ecx
+ 000cd 78 07 js SHORT $LN17@deflate_hu
+ 000cf 8b 56 38 mov edx, DWORD PTR [esi+56]
+ 000d2 03 d1 add edx, ecx
+ 000d4 eb 02 jmp SHORT $LN18@deflate_hu
+$LN17@deflate_hu:
+ 000d6 33 d2 xor edx, edx
+$LN18@deflate_hu:
+ 000d8 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 000db 2b c1 sub eax, ecx
+ 000dd 8b ce mov ecx, esi
+ 000df 6a 01 push 1
+ 000e1 50 push eax
+ 000e2 e8 00 00 00 00 call __tr_flush_block
+ 000e7 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 000ea 83 c4 08 add esp, 8
+ 000ed 8b 0e mov ecx, DWORD PTR [esi]
+ 000ef 89 46 5c mov DWORD PTR [esi+92], eax
+ 000f2 e8 00 00 00 00 call _flush_pending
+ 000f7 8b 0e mov ecx, DWORD PTR [esi]
+ 000f9 33 c0 xor eax, eax
+ 000fb 5f pop edi
+ 000fc 5e pop esi
+ 000fd 5b pop ebx
+ 000fe 39 41 10 cmp DWORD PTR [ecx+16], eax
+ 00101 0f 95 c0 setne al
+ 00104 83 c0 02 add eax, 2
+
+; 1967 : }
+
+ 00107 c3 ret 0
+$LN10@deflate_hu:
+
+; 1962 : return finish_done;
+; 1963 : }
+; 1964 : if (s->last_lit)
+
+ 00108 83 be a0 16 00
+ 00 00 cmp DWORD PTR [esi+5792], 0
+ 0010f 74 3b je SHORT $LN13@deflate_hu
+
+; 1965 : FLUSH_BLOCK(s, 0);
+
+ 00111 8b 4e 5c mov ecx, DWORD PTR [esi+92]
+ 00114 85 c9 test ecx, ecx
+ 00116 78 07 js SHORT $LN19@deflate_hu
+ 00118 8b 56 38 mov edx, DWORD PTR [esi+56]
+ 0011b 03 d1 add edx, ecx
+ 0011d eb 02 jmp SHORT $LN20@deflate_hu
+$LN19@deflate_hu:
+ 0011f 33 d2 xor edx, edx
+$LN20@deflate_hu:
+ 00121 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 00124 2b c1 sub eax, ecx
+ 00126 8b ce mov ecx, esi
+ 00128 6a 00 push 0
+ 0012a 50 push eax
+ 0012b e8 00 00 00 00 call __tr_flush_block
+ 00130 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 00133 83 c4 08 add esp, 8
+ 00136 8b 0e mov ecx, DWORD PTR [esi]
+ 00138 89 46 5c mov DWORD PTR [esi+92], eax
+ 0013b e8 00 00 00 00 call _flush_pending
+ 00140 8b 06 mov eax, DWORD PTR [esi]
+ 00142 83 78 10 00 cmp DWORD PTR [eax+16], 0
+ 00146 0f 84 63 ff ff
+ ff je $LN24@deflate_hu
+$LN13@deflate_hu:
+ 0014c 5f pop edi
+ 0014d 5e pop esi
+
+; 1966 : return block_done;
+
+ 0014e b8 01 00 00 00 mov eax, 1
+ 00153 5b pop ebx
+
+; 1967 : }
+
+ 00154 c3 ret 0
+_deflate_huff ENDP
+_TEXT ENDS
+END
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/deflate.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/deflate.obj
new file mode 100644
index 0000000000..15d8295fe3
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/deflate.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzclose.cod b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzclose.cod
new file mode 100644
index 0000000000..142cbc2a2e
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzclose.cod
@@ -0,0 +1,87 @@
+; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.23506.0
+
+ TITLE d:\downloads\tgl-master\tgl-master\zlib\gzclose.c
+ .686P
+ .XMM
+ include listing.inc
+ .model flat
+
+INCLUDELIB OLDNAMES
+
+COMM ?_OptionsStorage@?1??__local_stdio_scanf_options@@9@9:QWORD ; `__local_stdio_scanf_options'::`2'::_OptionsStorage
+COMM ?_OptionsStorage@?1??__local_stdio_printf_options@@9@9:QWORD ; `__local_stdio_printf_options'::`2'::_OptionsStorage
+_DATA ENDS
+PUBLIC _gzclose@4
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzclose.c
+; COMDAT _gzclose@4
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_gzclose@4 PROC ; COMDAT
+
+; 13 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 14 : #ifndef NO_GZCOMPRESS
+; 15 : gz_statep state;
+; 16 :
+; 17 : if (file == NULL)
+
+ 00003 8b 45 08 mov eax, DWORD PTR _file$[ebp]
+ 00006 85 c0 test eax, eax
+ 00008 75 09 jne SHORT $LN2@gzclose
+
+; 18 : return Z_STREAM_ERROR;
+
+ 0000a b8 fe ff ff ff mov eax, -2 ; fffffffeH
+
+; 22 : #else
+; 23 : return gzclose_r(file);
+; 24 : #endif
+; 25 : }
+
+ 0000f 5d pop ebp
+ 00010 c2 04 00 ret 4
+$LN2@gzclose:
+
+; 19 : state = (gz_statep)file;
+; 20 :
+; 21 : return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file);
+
+ 00013 81 78 10 4f 1c
+ 00 00 cmp DWORD PTR [eax+16], 7247 ; 00001c4fH
+ 0001a 75 09 jne SHORT $LN4@gzclose
+ 0001c 89 45 08 mov DWORD PTR _file$[ebp], eax
+
+; 22 : #else
+; 23 : return gzclose_r(file);
+; 24 : #endif
+; 25 : }
+
+ 0001f 5d pop ebp
+
+; 19 : state = (gz_statep)file;
+; 20 :
+; 21 : return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file);
+
+ 00020 e9 00 00 00 00 jmp _gzclose_r@4
+$LN4@gzclose:
+ 00025 89 45 08 mov DWORD PTR _file$[ebp], eax
+
+; 22 : #else
+; 23 : return gzclose_r(file);
+; 24 : #endif
+; 25 : }
+
+ 00028 5d pop ebp
+
+; 19 : state = (gz_statep)file;
+; 20 :
+; 21 : return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file);
+
+ 00029 e9 00 00 00 00 jmp _gzclose_w@4
+_gzclose@4 ENDP
+_TEXT ENDS
+END
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzclose.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzclose.obj
new file mode 100644
index 0000000000..1f1b12830f
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzclose.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzlib.cod b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzlib.cod
new file mode 100644
index 0000000000..ee1d4eb932
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzlib.cod
@@ -0,0 +1,2360 @@
+; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.23506.0
+
+ TITLE d:\downloads\tgl-master\tgl-master\zlib\gzlib.c
+ .686P
+ .XMM
+ include listing.inc
+ .model flat
+
+INCLUDELIB OLDNAMES
+
+PUBLIC ??_C@_02DKCKIIND@?$CFs?$AA@ ; `string'
+PUBLIC ??_C@_07EBNKNFJN@?$DMfd?3?$CFd?$DO?$AA@ ; `string'
+PUBLIC ??_C@_0O@BNNCBLEN@out?5of?5memory?$AA@ ; `string'
+PUBLIC ??_C@_00CNPNBAHC@?$AA@ ; `string'
+PUBLIC ??_C@_02LMMGGCAJ@?3?5?$AA@ ; `string'
+PUBLIC ??_C@_06DIJPEION@?$CFs?$CFs?$CFs?$AA@ ; `string'
+EXTRN __imp__malloc:PROC
+EXTRN __imp__free:PROC
+EXTRN __imp____stdio_common_vsprintf:PROC
+EXTRN __imp__wcstombs:PROC
+EXTRN __imp___open:PROC
+EXTRN __imp___wopen:PROC
+EXTRN __imp___lseeki64:PROC
+; COMDAT ??_C@_06DIJPEION@?$CFs?$CFs?$CFs?$AA@
+CONST SEGMENT
+??_C@_06DIJPEION@?$CFs?$CFs?$CFs?$AA@ DB '%s%s%s', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_02LMMGGCAJ@?3?5?$AA@
+CONST SEGMENT
+??_C@_02LMMGGCAJ@?3?5?$AA@ DB ': ', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_00CNPNBAHC@?$AA@
+CONST SEGMENT
+??_C@_00CNPNBAHC@?$AA@ DB 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_0O@BNNCBLEN@out?5of?5memory?$AA@
+CONST SEGMENT
+??_C@_0O@BNNCBLEN@out?5of?5memory?$AA@ DB 'out of memory', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_07EBNKNFJN@?$DMfd?3?$CFd?$DO?$AA@
+CONST SEGMENT
+??_C@_07EBNKNFJN@?$DMfd?3?$CFd?$DO?$AA@ DB '<fd:%d>', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_02DKCKIIND@?$CFs?$AA@
+CONST SEGMENT
+??_C@_02DKCKIIND@?$CFs?$AA@ DB '%s', 00H ; `string'
+PUBLIC _gz_error
+PUBLIC _gzclearerr@4
+PUBLIC _gzerror@8
+PUBLIC _gzeof@4
+PUBLIC _gzoffset@4
+PUBLIC _gzoffset64@4
+PUBLIC _gztell@4
+PUBLIC _gztell64@4
+PUBLIC _gzseek@12
+PUBLIC _gzseek64@16
+PUBLIC _gzrewind@4
+PUBLIC _gzbuffer@8
+PUBLIC _gzopen_w@8
+PUBLIC _gzdopen@8
+PUBLIC _gzopen@8
+PUBLIC __snprintf
+PUBLIC __vsnprintf
+PUBLIC __vsnprintf_l
+PUBLIC ___local_stdio_printf_options
+; Function compile flags: /Ogtp
+; File c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\corecrt_stdio_config.h
+; COMDAT ___local_stdio_printf_options
+_TEXT SEGMENT
+___local_stdio_printf_options PROC ; COMDAT
+
+; 74 : static unsigned __int64 _OptionsStorage;
+; 75 : return &_OptionsStorage;
+
+ 00000 b8 00 00 00 00 mov eax, OFFSET ?_OptionsStorage@?1??__local_stdio_printf_options@@9@9 ; `__local_stdio_printf_options'::`2'::_OptionsStorage
+
+; 76 : }
+
+ 00005 c3 ret 0
+___local_stdio_printf_options ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h
+; COMDAT __vsnprintf_l
+_TEXT SEGMENT
+__Format$ = 8 ; size = 4
+__Locale$dead$ = 12 ; size = 4
+__ArgList$ = 16 ; size = 4
+__vsnprintf_l PROC ; COMDAT
+; __Buffer$ = ecx
+; __BufferCount$ = edx
+
+; 1385 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 1386 : int const _Result = __stdio_common_vsprintf(
+
+ 00003 ff 75 10 push DWORD PTR __ArgList$[ebp]
+ 00006 6a 00 push 0
+ 00008 ff 75 08 push DWORD PTR __Format$[ebp]
+ 0000b 52 push edx
+ 0000c 51 push ecx
+ 0000d e8 00 00 00 00 call ___local_stdio_printf_options
+ 00012 8b 08 mov ecx, DWORD PTR [eax]
+ 00014 ff 70 04 push DWORD PTR [eax+4]
+ 00017 83 c9 01 or ecx, 1
+ 0001a 51 push ecx
+ 0001b ff 15 00 00 00
+ 00 call DWORD PTR __imp____stdio_common_vsprintf
+
+; 1387 : _CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION,
+; 1388 : _Buffer, _BufferCount, _Format, _Locale, _ArgList);
+; 1389 :
+; 1390 : return _Result < 0 ? -1 : _Result;
+
+ 00021 83 c9 ff or ecx, -1
+ 00024 83 c4 1c add esp, 28 ; 0000001cH
+ 00027 85 c0 test eax, eax
+ 00029 0f 48 c1 cmovs eax, ecx
+
+; 1391 : }
+
+ 0002c 5d pop ebp
+ 0002d c3 ret 0
+__vsnprintf_l ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h
+; COMDAT __vsnprintf
+_TEXT SEGMENT
+__Format$ = 8 ; size = 4
+__ArgList$ = 12 ; size = 4
+__vsnprintf PROC ; COMDAT
+; __Buffer$ = ecx
+; __BufferCount$ = edx
+
+; 1405 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 1386 : int const _Result = __stdio_common_vsprintf(
+
+ 00003 ff 75 0c push DWORD PTR __ArgList$[ebp]
+ 00006 6a 00 push 0
+ 00008 ff 75 08 push DWORD PTR __Format$[ebp]
+ 0000b 52 push edx
+ 0000c 51 push ecx
+ 0000d e8 00 00 00 00 call ___local_stdio_printf_options
+ 00012 8b 08 mov ecx, DWORD PTR [eax]
+ 00014 ff 70 04 push DWORD PTR [eax+4]
+ 00017 83 c9 01 or ecx, 1
+ 0001a 51 push ecx
+ 0001b ff 15 00 00 00
+ 00 call DWORD PTR __imp____stdio_common_vsprintf
+
+; 1387 : _CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION,
+; 1388 : _Buffer, _BufferCount, _Format, _Locale, _ArgList);
+; 1389 :
+; 1390 : return _Result < 0 ? -1 : _Result;
+
+ 00021 83 c9 ff or ecx, -1
+ 00024 83 c4 1c add esp, 28 ; 0000001cH
+ 00027 85 c0 test eax, eax
+ 00029 0f 48 c1 cmovs eax, ecx
+
+; 1406 : #pragma warning(push)
+; 1407 : #pragma warning(disable: 4996) // Deprecation
+; 1408 : return _vsnprintf_l(_Buffer, _BufferCount, _Format, NULL, _ArgList);
+; 1409 : #pragma warning(pop)
+; 1410 : }
+
+ 0002c 5d pop ebp
+ 0002d c3 ret 0
+__vsnprintf ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h
+; COMDAT __snprintf
+_TEXT SEGMENT
+__Buffer$ = 8 ; size = 4
+__BufferCount$ = 12 ; size = 4
+__Format$ = 16 ; size = 4
+__snprintf PROC ; COMDAT
+
+; 1960 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 1386 : int const _Result = __stdio_common_vsprintf(
+
+ 00003 8d 45 14 lea eax, DWORD PTR __Format$[ebp+4]
+ 00006 50 push eax
+ 00007 6a 00 push 0
+ 00009 ff 75 10 push DWORD PTR __Format$[ebp]
+ 0000c ff 75 0c push DWORD PTR __BufferCount$[ebp]
+ 0000f ff 75 08 push DWORD PTR __Buffer$[ebp]
+ 00012 e8 00 00 00 00 call ___local_stdio_printf_options
+ 00017 8b 08 mov ecx, DWORD PTR [eax]
+ 00019 ff 70 04 push DWORD PTR [eax+4]
+ 0001c 83 c9 01 or ecx, 1
+ 0001f 51 push ecx
+ 00020 ff 15 00 00 00
+ 00 call DWORD PTR __imp____stdio_common_vsprintf
+
+; 1387 : _CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION,
+; 1388 : _Buffer, _BufferCount, _Format, _Locale, _ArgList);
+; 1389 :
+; 1390 : return _Result < 0 ? -1 : _Result;
+
+ 00026 83 c9 ff or ecx, -1
+ 00029 83 c4 1c add esp, 28 ; 0000001cH
+ 0002c 85 c0 test eax, eax
+ 0002e 0f 48 c1 cmovs eax, ecx
+
+; 1961 : int _Result;
+; 1962 : va_list _ArgList;
+; 1963 : __crt_va_start(_ArgList, _Format);
+; 1964 : #pragma warning(suppress:28719) // __WARNING_BANNED_API_USAGE
+; 1965 : _Result = _vsnprintf(_Buffer, _BufferCount, _Format, _ArgList);
+; 1966 : __crt_va_end(_ArgList);
+; 1967 : return _Result;
+; 1968 : }
+
+ 00031 5d pop ebp
+ 00032 c3 ret 0
+__snprintf ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzlib.c
+; COMDAT _gz_reset
+_TEXT SEGMENT
+_gz_reset PROC ; COMDAT
+; _state$ = ecx
+
+; 77 : {
+
+ 00000 56 push esi
+ 00001 8b f1 mov esi, ecx
+
+; 78 : state->x.have = 0; /* no output data available */
+; 79 : if (state->mode == GZ_READ) { /* for reading ... */
+
+ 00003 81 7e 10 4f 1c
+ 00 00 cmp DWORD PTR [esi+16], 7247 ; 00001c4fH
+ 0000a c7 06 00 00 00
+ 00 mov DWORD PTR [esi], 0
+ 00010 75 15 jne SHORT $LN2@gz_reset
+
+; 80 : state->eof = 0; /* not at end of file */
+
+ 00012 c7 46 40 00 00
+ 00 00 mov DWORD PTR [esi+64], 0
+
+; 81 : state->past = 0; /* have not read past end yet */
+
+ 00019 c7 46 44 00 00
+ 00 00 mov DWORD PTR [esi+68], 0
+
+; 82 : state->how = LOOK; /* look for gzip header */
+
+ 00020 c7 46 30 00 00
+ 00 00 mov DWORD PTR [esi+48], 0
+$LN2@gz_reset:
+
+; 83 : }
+; 84 : state->seek = 0; /* no seek request pending */
+; 85 : gz_error(state, Z_OK, NULL); /* clear error */
+
+ 00027 6a 00 push 0
+ 00029 33 d2 xor edx, edx
+ 0002b c7 46 58 00 00
+ 00 00 mov DWORD PTR [esi+88], 0
+ 00032 e8 00 00 00 00 call _gz_error
+ 00037 83 c4 04 add esp, 4
+
+; 86 : state->x.pos = 0; /* no uncompressed data yet */
+
+ 0003a c7 46 08 00 00
+ 00 00 mov DWORD PTR [esi+8], 0
+ 00041 c7 46 0c 00 00
+ 00 00 mov DWORD PTR [esi+12], 0
+
+; 87 : state->strm.avail_in = 0; /* no input data yet */
+
+ 00048 c7 46 68 00 00
+ 00 00 mov DWORD PTR [esi+104], 0
+ 0004f 5e pop esi
+
+; 88 : }
+
+ 00050 c3 ret 0
+_gz_reset ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzlib.c
+; COMDAT _gz_open
+_TEXT SEGMENT
+_exclusive$1$ = -12 ; size = 4
+_fd$1$ = -8 ; size = 4
+_path$1$ = -4 ; size = 4
+_mode$ = 8 ; size = 4
+_gz_open PROC ; COMDAT
+; _path$ = ecx
+; _fd$ = edx
+
+; 95 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 0c sub esp, 12 ; 0000000cH
+ 00006 53 push ebx
+ 00007 8b d9 mov ebx, ecx
+
+; 96 : gz_statep state;
+; 97 : size_t len;
+; 98 : int oflag;
+; 99 : #ifdef O_CLOEXEC
+; 100 : int cloexec = 0;
+; 101 : #endif
+; 102 : #ifdef O_EXCL
+; 103 : int exclusive = 0;
+
+ 00009 33 c0 xor eax, eax
+ 0000b 89 5d fc mov DWORD PTR _path$1$[ebp], ebx
+ 0000e 89 45 f4 mov DWORD PTR _exclusive$1$[ebp], eax
+ 00011 56 push esi
+ 00012 8b f2 mov esi, edx
+ 00014 89 75 f8 mov DWORD PTR _fd$1$[ebp], esi
+
+; 104 : #endif
+; 105 :
+; 106 : /* check input */
+; 107 : if (path == NULL)
+
+ 00017 85 db test ebx, ebx
+ 00019 75 06 jne SHORT $LN6@gz_open
+ 0001b 5e pop esi
+ 0001c 5b pop ebx
+
+; 265 : }
+
+ 0001d 8b e5 mov esp, ebp
+ 0001f 5d pop ebp
+ 00020 c3 ret 0
+$LN6@gz_open:
+ 00021 57 push edi
+
+; 108 : return NULL;
+; 109 :
+; 110 : /* allocate gzFile structure to return */
+; 111 : state = (gz_statep)malloc(sizeof(gz_state));
+
+ 00022 68 a0 00 00 00 push 160 ; 000000a0H
+ 00027 ff 15 00 00 00
+ 00 call DWORD PTR __imp__malloc
+ 0002d 8b f8 mov edi, eax
+ 0002f 83 c4 04 add esp, 4
+
+; 112 : if (state == NULL)
+
+ 00032 85 ff test edi, edi
+ 00034 0f 84 e6 01 00
+ 00 je $LN54@gz_open
+
+; 113 : return NULL;
+; 114 : state->size = 0; /* no buffers allocated yet */
+; 115 : state->want = GZBUFSIZE; /* requested buffer size */
+; 116 : state->msg = NULL; /* no error message yet */
+; 117 :
+; 118 : /* interpret mode */
+; 119 : state->mode = GZ_NONE;
+; 120 : state->level = Z_DEFAULT_COMPRESSION;
+; 121 : state->strategy = Z_DEFAULT_STRATEGY;
+; 122 : state->direct = 0;
+; 123 : while (*mode) {
+
+ 0003a 8b 4d 08 mov ecx, DWORD PTR _mode$[ebp]
+ 0003d c7 47 1c 00 00
+ 00 00 mov DWORD PTR [edi+28], 0
+ 00044 c7 47 20 00 20
+ 00 00 mov DWORD PTR [edi+32], 8192 ; 00002000H
+ 0004b c7 47 60 00 00
+ 00 00 mov DWORD PTR [edi+96], 0
+ 00052 c7 47 10 00 00
+ 00 00 mov DWORD PTR [edi+16], 0
+ 00059 c7 47 48 ff ff
+ ff ff mov DWORD PTR [edi+72], -1
+ 00060 c7 47 4c 00 00
+ 00 00 mov DWORD PTR [edi+76], 0
+ 00067 c7 47 2c 00 00
+ 00 00 mov DWORD PTR [edi+44], 0
+ 0006e 8a 01 mov al, BYTE PTR [ecx]
+ 00070 84 c0 test al, al
+ 00072 0f 84 88 00 00
+ 00 je $LN48@gz_open
+$LL2@gz_open:
+
+; 124 : if (*mode >= '0' && *mode <= '9')
+
+ 00078 3c 30 cmp al, 48 ; 00000030H
+ 0007a 7c 0f jl SHORT $LN8@gz_open
+ 0007c 3c 39 cmp al, 57 ; 00000039H
+ 0007e 7f 0b jg SHORT $LN8@gz_open
+
+; 125 : state->level = *mode - '0';
+
+ 00080 0f be c0 movsx eax, al
+ 00083 83 e8 30 sub eax, 48 ; 00000030H
+ 00086 89 47 48 mov DWORD PTR [edi+72], eax
+ 00089 eb 69 jmp SHORT $LN21@gz_open
+$LN8@gz_open:
+
+; 126 : else
+; 127 : switch (*mode) {
+
+ 0008b 0f be c0 movsx eax, al
+ 0008e 83 c0 d5 add eax, -43 ; ffffffd5H
+ 00091 83 f8 4d cmp eax, 77 ; 0000004dH
+ 00094 77 5e ja SHORT $LN21@gz_open
+ 00096 0f b6 80 00 00
+ 00 00 movzx eax, BYTE PTR $LN49@gz_open[eax]
+ 0009d ff 24 85 00 00
+ 00 00 jmp DWORD PTR $LN57@gz_open[eax*4]
+$LN10@gz_open:
+
+; 128 : case 'r':
+; 129 : state->mode = GZ_READ;
+
+ 000a4 c7 47 10 4f 1c
+ 00 00 mov DWORD PTR [edi+16], 7247 ; 00001c4fH
+
+; 130 : break;
+
+ 000ab eb 47 jmp SHORT $LN21@gz_open
+$LN11@gz_open:
+
+; 131 : #ifndef NO_GZCOMPRESS
+; 132 : case 'w':
+; 133 : state->mode = GZ_WRITE;
+
+ 000ad c7 47 10 b1 79
+ 00 00 mov DWORD PTR [edi+16], 31153 ; 000079b1H
+
+; 134 : break;
+
+ 000b4 eb 3e jmp SHORT $LN21@gz_open
+$LN12@gz_open:
+
+; 135 : case 'a':
+; 136 : state->mode = GZ_APPEND;
+
+ 000b6 c7 47 10 01 00
+ 00 00 mov DWORD PTR [edi+16], 1
+
+; 137 : break;
+
+ 000bd eb 35 jmp SHORT $LN21@gz_open
+$LN15@gz_open:
+
+; 138 : #endif
+; 139 : case '+': /* can't read and write at the same time */
+; 140 : free(state);
+; 141 : return NULL;
+; 142 : case 'b': /* ignore -- will request binary anyway */
+; 143 : break;
+; 144 : #ifdef O_CLOEXEC
+; 145 : case 'e':
+; 146 : cloexec = 1;
+; 147 : break;
+; 148 : #endif
+; 149 : #ifdef O_EXCL
+; 150 : case 'x':
+; 151 : exclusive = 1;
+
+ 000bf b8 01 00 00 00 mov eax, 1
+ 000c4 89 45 f4 mov DWORD PTR _exclusive$1$[ebp], eax
+
+; 152 : break;
+
+ 000c7 eb 2b jmp SHORT $LN21@gz_open
+$LN16@gz_open:
+
+; 153 : #endif
+; 154 : case 'f':
+; 155 : state->strategy = Z_FILTERED;
+
+ 000c9 c7 47 4c 01 00
+ 00 00 mov DWORD PTR [edi+76], 1
+
+; 156 : break;
+
+ 000d0 eb 22 jmp SHORT $LN21@gz_open
+$LN17@gz_open:
+
+; 157 : case 'h':
+; 158 : state->strategy = Z_HUFFMAN_ONLY;
+
+ 000d2 c7 47 4c 02 00
+ 00 00 mov DWORD PTR [edi+76], 2
+
+; 159 : break;
+
+ 000d9 eb 19 jmp SHORT $LN21@gz_open
+$LN18@gz_open:
+
+; 160 : case 'R':
+; 161 : state->strategy = Z_RLE;
+
+ 000db c7 47 4c 03 00
+ 00 00 mov DWORD PTR [edi+76], 3
+
+; 162 : break;
+
+ 000e2 eb 10 jmp SHORT $LN21@gz_open
+$LN19@gz_open:
+
+; 163 : case 'F':
+; 164 : state->strategy = Z_FIXED;
+
+ 000e4 c7 47 4c 04 00
+ 00 00 mov DWORD PTR [edi+76], 4
+
+; 165 : break;
+
+ 000eb eb 07 jmp SHORT $LN21@gz_open
+$LN20@gz_open:
+
+; 166 : case 'T':
+; 167 : state->direct = 1;
+
+ 000ed c7 47 2c 01 00
+ 00 00 mov DWORD PTR [edi+44], 1
+$LN21@gz_open:
+
+; 113 : return NULL;
+; 114 : state->size = 0; /* no buffers allocated yet */
+; 115 : state->want = GZBUFSIZE; /* requested buffer size */
+; 116 : state->msg = NULL; /* no error message yet */
+; 117 :
+; 118 : /* interpret mode */
+; 119 : state->mode = GZ_NONE;
+; 120 : state->level = Z_DEFAULT_COMPRESSION;
+; 121 : state->strategy = Z_DEFAULT_STRATEGY;
+; 122 : state->direct = 0;
+; 123 : while (*mode) {
+
+ 000f4 8a 41 01 mov al, BYTE PTR [ecx+1]
+
+; 168 : break;
+; 169 : default: /* could consider as an error, but just ignore */
+; 170 : ;
+; 171 : }
+; 172 : mode++;
+
+ 000f7 41 inc ecx
+ 000f8 84 c0 test al, al
+ 000fa 0f 85 78 ff ff
+ ff jne $LL2@gz_open
+$LN48@gz_open:
+
+; 173 : }
+; 174 :
+; 175 : /* must provide an "r", "w", or "a" */
+; 176 : if (state->mode == GZ_NONE) {
+
+ 00100 8b 47 10 mov eax, DWORD PTR [edi+16]
+ 00103 85 c0 test eax, eax
+ 00105 74 56 je SHORT $LN55@gz_open
+
+; 177 : free(state);
+; 178 : return NULL;
+; 179 : }
+; 180 :
+; 181 : /* can't force transparent read */
+; 182 : if (state->mode == GZ_READ) {
+
+ 00107 3d 4f 1c 00 00 cmp eax, 7247 ; 00001c4fH
+ 0010c 75 0d jne SHORT $LN23@gz_open
+
+; 183 : if (state->direct) {
+
+ 0010e 83 7f 2c 00 cmp DWORD PTR [edi+44], 0
+ 00112 75 49 jne SHORT $LN55@gz_open
+
+; 184 : free(state);
+; 185 : return NULL;
+; 186 : }
+; 187 : state->direct = 1; /* for empty file */
+
+ 00114 c7 47 2c 01 00
+ 00 00 mov DWORD PTR [edi+44], 1
+$LN23@gz_open:
+
+; 188 : }
+; 189 :
+; 190 : /* save the path name for error messages */
+; 191 : #ifdef _WIN32
+; 192 : if (fd == -2) {
+
+ 0011b 83 fe fe cmp esi, -2 ; fffffffeH
+ 0011e 75 19 jne SHORT $LN25@gz_open
+
+; 193 : len = wcstombs(NULL, path, 0);
+
+ 00120 6a 00 push 0
+ 00122 53 push ebx
+ 00123 6a 00 push 0
+ 00125 ff 15 00 00 00
+ 00 call DWORD PTR __imp__wcstombs
+ 0012b 8b f0 mov esi, eax
+ 0012d 83 c4 0c add esp, 12 ; 0000000cH
+
+; 194 : if (len == (size_t)-1)
+
+ 00130 83 fe ff cmp esi, -1
+ 00133 75 14 jne SHORT $LN26@gz_open
+
+; 195 : len = 0;
+
+ 00135 33 f6 xor esi, esi
+
+; 196 : }
+
+ 00137 eb 10 jmp SHORT $LN26@gz_open
+$LN25@gz_open:
+
+; 197 : else
+; 198 : #endif
+; 199 : len = strlen((const char *)path);
+
+ 00139 8b f3 mov esi, ebx
+ 0013b 8d 4e 01 lea ecx, DWORD PTR [esi+1]
+ 0013e 66 90 npad 2
+$LL50@gz_open:
+ 00140 8a 06 mov al, BYTE PTR [esi]
+ 00142 46 inc esi
+ 00143 84 c0 test al, al
+ 00145 75 f9 jne SHORT $LL50@gz_open
+ 00147 2b f1 sub esi, ecx
+$LN26@gz_open:
+
+; 200 : state->path = (char *)malloc(len + 1);
+
+ 00149 8d 5e 01 lea ebx, DWORD PTR [esi+1]
+ 0014c 53 push ebx
+ 0014d ff 15 00 00 00
+ 00 call DWORD PTR __imp__malloc
+ 00153 83 c4 04 add esp, 4
+ 00156 89 47 18 mov DWORD PTR [edi+24], eax
+
+; 201 : if (state->path == NULL) {
+
+ 00159 85 c0 test eax, eax
+ 0015b 75 13 jne SHORT $LN28@gz_open
+$LN55@gz_open:
+
+; 202 : free(state);
+
+ 0015d 57 push edi
+ 0015e ff 15 00 00 00
+ 00 call DWORD PTR __imp__free
+ 00164 83 c4 04 add esp, 4
+
+; 203 : return NULL;
+
+ 00167 33 c0 xor eax, eax
+ 00169 5f pop edi
+ 0016a 5e pop esi
+ 0016b 5b pop ebx
+
+; 265 : }
+
+ 0016c 8b e5 mov esp, ebp
+ 0016e 5d pop ebp
+ 0016f c3 ret 0
+$LN28@gz_open:
+
+; 204 : }
+; 205 : #ifdef _WIN32
+; 206 : if (fd == -2)
+
+ 00170 8b 55 f8 mov edx, DWORD PTR _fd$1$[ebp]
+ 00173 83 fa fe cmp edx, -2 ; fffffffeH
+ 00176 75 1a jne SHORT $LN29@gz_open
+
+; 207 : if (len)
+
+ 00178 85 f6 test esi, esi
+
+; 208 : wcstombs(state->path, path, len + 1);
+
+ 0017a 8b 75 fc mov esi, DWORD PTR _path$1$[ebp]
+ 0017d 74 0e je SHORT $LN31@gz_open
+ 0017f 53 push ebx
+ 00180 56 push esi
+ 00181 50 push eax
+ 00182 ff 15 00 00 00
+ 00 call DWORD PTR __imp__wcstombs
+ 00188 83 c4 0c add esp, 12 ; 0000000cH
+ 0018b eb 18 jmp SHORT $LN52@gz_open
+$LN31@gz_open:
+
+; 209 : else
+; 210 : *(state->path) = 0;
+
+ 0018d c6 00 00 mov BYTE PTR [eax], 0
+ 00190 eb 16 jmp SHORT $LN30@gz_open
+$LN29@gz_open:
+
+; 211 : else
+; 212 : #endif
+; 213 : #if !defined(NO_snprintf) && !defined(NO_vsnprintf)
+; 214 : snprintf(state->path, len + 1, "%s", (const char *)path);
+
+ 00192 8b 75 fc mov esi, DWORD PTR _path$1$[ebp]
+ 00195 56 push esi
+ 00196 68 00 00 00 00 push OFFSET ??_C@_02DKCKIIND@?$CFs?$AA@
+ 0019b 53 push ebx
+ 0019c 50 push eax
+ 0019d e8 00 00 00 00 call __snprintf
+ 001a2 83 c4 10 add esp, 16 ; 00000010H
+$LN52@gz_open:
+ 001a5 8b 55 f8 mov edx, DWORD PTR _fd$1$[ebp]
+$LN30@gz_open:
+
+; 215 : #else
+; 216 : strcpy(state->path, path);
+; 217 : #endif
+; 218 :
+; 219 : /* compute the flags for open() */
+; 220 : oflag =
+
+ 001a8 8b 4f 10 mov ecx, DWORD PTR [edi+16]
+ 001ab 81 f9 4f 1c 00
+ 00 cmp ecx, 7247 ; 00001c4fH
+ 001b1 75 04 jne SHORT $LN38@gz_open
+ 001b3 33 c0 xor eax, eax
+ 001b5 eb 27 jmp SHORT $LN39@gz_open
+$LN38@gz_open:
+ 001b7 81 f9 b1 79 00
+ 00 cmp ecx, 31153 ; 000079b1H
+ 001bd b8 08 00 00 00 mov eax, 8
+ 001c2 8b 4d f4 mov ecx, DWORD PTR _exclusive$1$[ebp]
+ 001c5 bb 00 02 00 00 mov ebx, 512 ; 00000200H
+ 001ca 0f 44 c3 cmove eax, ebx
+ 001cd f7 d9 neg ecx
+ 001cf 1b c9 sbb ecx, ecx
+ 001d1 81 e1 00 04 00
+ 00 and ecx, 1024 ; 00000400H
+ 001d7 0b c1 or eax, ecx
+ 001d9 0d 01 01 00 00 or eax, 257 ; 00000101H
+$LN39@gz_open:
+ 001de 0d 00 80 00 00 or eax, 32768 ; 00008000H
+
+; 221 : #ifdef O_LARGEFILE
+; 222 : O_LARGEFILE |
+; 223 : #endif
+; 224 : #ifdef O_BINARY
+; 225 : O_BINARY |
+; 226 : #endif
+; 227 : #ifdef O_CLOEXEC
+; 228 : (cloexec ? O_CLOEXEC : 0) |
+; 229 : #endif
+; 230 : (state->mode == GZ_READ ?
+; 231 : O_RDONLY :
+; 232 : (O_WRONLY | O_CREAT |
+; 233 : #ifdef O_EXCL
+; 234 : (exclusive ? O_EXCL : 0) |
+; 235 : #endif
+; 236 : (state->mode == GZ_WRITE ?
+; 237 : O_TRUNC :
+; 238 : O_APPEND)));
+; 239 :
+; 240 : /* open the file with the appropriate flags (or just use fd) */
+; 241 : state->fd = fd > -1 ? fd : (
+
+ 001e3 83 fa ff cmp edx, -1
+ 001e6 7f 1f jg SHORT $LN41@gz_open
+ 001e8 68 b6 01 00 00 push 438 ; 000001b6H
+ 001ed 50 push eax
+ 001ee 56 push esi
+ 001ef 83 fa fe cmp edx, -2 ; fffffffeH
+ 001f2 75 08 jne SHORT $LN40@gz_open
+ 001f4 ff 15 00 00 00
+ 00 call DWORD PTR __imp___wopen
+ 001fa eb 06 jmp SHORT $LN53@gz_open
+$LN40@gz_open:
+ 001fc ff 15 00 00 00
+ 00 call DWORD PTR __imp___open
+$LN53@gz_open:
+ 00202 8b d0 mov edx, eax
+ 00204 83 c4 0c add esp, 12 ; 0000000cH
+$LN41@gz_open:
+ 00207 89 57 14 mov DWORD PTR [edi+20], edx
+
+; 242 : #ifdef _WIN32
+; 243 : fd == -2 ? _wopen(path, oflag, 0666) :
+; 244 : #endif
+; 245 : open((const char *)path, oflag, 0666));
+; 246 : if (state->fd == -1) {
+
+ 0020a 83 fa ff cmp edx, -1
+ 0020d 75 1a jne SHORT $LN33@gz_open
+
+; 247 : free(state->path);
+
+ 0020f ff 77 18 push DWORD PTR [edi+24]
+ 00212 8b 35 00 00 00
+ 00 mov esi, DWORD PTR __imp__free
+ 00218 ff d6 call esi
+
+; 248 : free(state);
+
+ 0021a 57 push edi
+ 0021b ff d6 call esi
+ 0021d 83 c4 08 add esp, 8
+$LN54@gz_open:
+
+; 249 : return NULL;
+
+ 00220 5f pop edi
+ 00221 5e pop esi
+ 00222 33 c0 xor eax, eax
+ 00224 5b pop ebx
+
+; 265 : }
+
+ 00225 8b e5 mov esp, ebp
+ 00227 5d pop ebp
+ 00228 c3 ret 0
+$LN33@gz_open:
+
+; 250 : }
+; 251 : if (state->mode == GZ_APPEND)
+
+ 00229 83 7f 10 01 cmp DWORD PTR [edi+16], 1
+ 0022d 75 07 jne SHORT $LN34@gz_open
+
+; 252 : state->mode = GZ_WRITE; /* simplify later checks */
+
+ 0022f c7 47 10 b1 79
+ 00 00 mov DWORD PTR [edi+16], 31153 ; 000079b1H
+$LN34@gz_open:
+
+; 253 :
+; 254 : /* save the current position for rewinding (only if reading) */
+; 255 : if (state->mode == GZ_READ) {
+
+ 00236 81 7f 10 4f 1c
+ 00 00 cmp DWORD PTR [edi+16], 7247 ; 00001c4fH
+ 0023d 75 2b jne SHORT $LN36@gz_open
+
+; 256 : state->start = LSEEK(state->fd, 0, SEEK_CUR);
+
+ 0023f 6a 01 push 1
+ 00241 6a 00 push 0
+ 00243 6a 00 push 0
+ 00245 52 push edx
+ 00246 ff 15 00 00 00
+ 00 call DWORD PTR __imp___lseeki64
+ 0024c 89 47 38 mov DWORD PTR [edi+56], eax
+ 0024f 83 c4 10 add esp, 16 ; 00000010H
+
+; 257 : if (state->start == -1) state->start = 0;
+
+ 00252 23 c2 and eax, edx
+ 00254 89 57 3c mov DWORD PTR [edi+60], edx
+ 00257 83 f8 ff cmp eax, -1
+ 0025a 75 0e jne SHORT $LN36@gz_open
+ 0025c c7 47 38 00 00
+ 00 00 mov DWORD PTR [edi+56], 0
+ 00263 c7 47 3c 00 00
+ 00 00 mov DWORD PTR [edi+60], 0
+$LN36@gz_open:
+
+; 258 : }
+; 259 :
+; 260 : /* initialize stream */
+; 261 : gz_reset(state);
+
+ 0026a 8b cf mov ecx, edi
+ 0026c e8 00 00 00 00 call _gz_reset
+
+; 262 :
+; 263 : /* return stream */
+; 264 : return (gzFile)state;
+
+ 00271 8b c7 mov eax, edi
+ 00273 5f pop edi
+ 00274 5e pop esi
+ 00275 5b pop ebx
+
+; 265 : }
+
+ 00276 8b e5 mov esp, ebp
+ 00278 5d pop ebp
+ 00279 c3 ret 0
+ 0027a 66 90 npad 2
+$LN57@gz_open:
+ 0027c 00 00 00 00 DD $LN55@gz_open
+ 00280 00 00 00 00 DD $LN19@gz_open
+ 00284 00 00 00 00 DD $LN18@gz_open
+ 00288 00 00 00 00 DD $LN20@gz_open
+ 0028c 00 00 00 00 DD $LN12@gz_open
+ 00290 00 00 00 00 DD $LN16@gz_open
+ 00294 00 00 00 00 DD $LN17@gz_open
+ 00298 00 00 00 00 DD $LN10@gz_open
+ 0029c 00 00 00 00 DD $LN11@gz_open
+ 002a0 00 00 00 00 DD $LN15@gz_open
+ 002a4 00 00 00 00 DD $LN21@gz_open
+$LN49@gz_open:
+ 002a8 00 DB 0
+ 002a9 0a DB 10 ; 0000000aH
+ 002aa 0a DB 10 ; 0000000aH
+ 002ab 0a DB 10 ; 0000000aH
+ 002ac 0a DB 10 ; 0000000aH
+ 002ad 0a DB 10 ; 0000000aH
+ 002ae 0a DB 10 ; 0000000aH
+ 002af 0a DB 10 ; 0000000aH
+ 002b0 0a DB 10 ; 0000000aH
+ 002b1 0a DB 10 ; 0000000aH
+ 002b2 0a DB 10 ; 0000000aH
+ 002b3 0a DB 10 ; 0000000aH
+ 002b4 0a DB 10 ; 0000000aH
+ 002b5 0a DB 10 ; 0000000aH
+ 002b6 0a DB 10 ; 0000000aH
+ 002b7 0a DB 10 ; 0000000aH
+ 002b8 0a DB 10 ; 0000000aH
+ 002b9 0a DB 10 ; 0000000aH
+ 002ba 0a DB 10 ; 0000000aH
+ 002bb 0a DB 10 ; 0000000aH
+ 002bc 0a DB 10 ; 0000000aH
+ 002bd 0a DB 10 ; 0000000aH
+ 002be 0a DB 10 ; 0000000aH
+ 002bf 0a DB 10 ; 0000000aH
+ 002c0 0a DB 10 ; 0000000aH
+ 002c1 0a DB 10 ; 0000000aH
+ 002c2 0a DB 10 ; 0000000aH
+ 002c3 01 DB 1
+ 002c4 0a DB 10 ; 0000000aH
+ 002c5 0a DB 10 ; 0000000aH
+ 002c6 0a DB 10 ; 0000000aH
+ 002c7 0a DB 10 ; 0000000aH
+ 002c8 0a DB 10 ; 0000000aH
+ 002c9 0a DB 10 ; 0000000aH
+ 002ca 0a DB 10 ; 0000000aH
+ 002cb 0a DB 10 ; 0000000aH
+ 002cc 0a DB 10 ; 0000000aH
+ 002cd 0a DB 10 ; 0000000aH
+ 002ce 0a DB 10 ; 0000000aH
+ 002cf 02 DB 2
+ 002d0 0a DB 10 ; 0000000aH
+ 002d1 03 DB 3
+ 002d2 0a DB 10 ; 0000000aH
+ 002d3 0a DB 10 ; 0000000aH
+ 002d4 0a DB 10 ; 0000000aH
+ 002d5 0a DB 10 ; 0000000aH
+ 002d6 0a DB 10 ; 0000000aH
+ 002d7 0a DB 10 ; 0000000aH
+ 002d8 0a DB 10 ; 0000000aH
+ 002d9 0a DB 10 ; 0000000aH
+ 002da 0a DB 10 ; 0000000aH
+ 002db 0a DB 10 ; 0000000aH
+ 002dc 0a DB 10 ; 0000000aH
+ 002dd 0a DB 10 ; 0000000aH
+ 002de 04 DB 4
+ 002df 0a DB 10 ; 0000000aH
+ 002e0 0a DB 10 ; 0000000aH
+ 002e1 0a DB 10 ; 0000000aH
+ 002e2 0a DB 10 ; 0000000aH
+ 002e3 05 DB 5
+ 002e4 0a DB 10 ; 0000000aH
+ 002e5 06 DB 6
+ 002e6 0a DB 10 ; 0000000aH
+ 002e7 0a DB 10 ; 0000000aH
+ 002e8 0a DB 10 ; 0000000aH
+ 002e9 0a DB 10 ; 0000000aH
+ 002ea 0a DB 10 ; 0000000aH
+ 002eb 0a DB 10 ; 0000000aH
+ 002ec 0a DB 10 ; 0000000aH
+ 002ed 0a DB 10 ; 0000000aH
+ 002ee 0a DB 10 ; 0000000aH
+ 002ef 07 DB 7
+ 002f0 0a DB 10 ; 0000000aH
+ 002f1 0a DB 10 ; 0000000aH
+ 002f2 0a DB 10 ; 0000000aH
+ 002f3 0a DB 10 ; 0000000aH
+ 002f4 08 DB 8
+ 002f5 09 DB 9
+_gz_open ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzlib.c
+; COMDAT _gzopen@8
+_TEXT SEGMENT
+_path$ = 8 ; size = 4
+_mode$ = 12 ; size = 4
+_gzopen@8 PROC ; COMDAT
+
+; 271 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 272 : return gz_open(path, -1, mode);
+
+ 00003 ff 75 0c push DWORD PTR _mode$[ebp]
+ 00006 8b 4d 08 mov ecx, DWORD PTR _path$[ebp]
+ 00009 83 ca ff or edx, -1
+ 0000c e8 00 00 00 00 call _gz_open
+ 00011 83 c4 04 add esp, 4
+
+; 273 : }
+
+ 00014 5d pop ebp
+ 00015 c2 08 00 ret 8
+_gzopen@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzlib.c
+; COMDAT _gzdopen@8
+_TEXT SEGMENT
+_fd$ = 8 ; size = 4
+_mode$ = 12 ; size = 4
+_gzdopen@8 PROC ; COMDAT
+
+; 287 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 56 push esi
+
+; 288 : char *path; /* identifier for error messages */
+; 289 : gzFile gz;
+; 290 :
+; 291 : if (fd == -1 || (path = (char *)malloc(7 + 3 * sizeof(int))) == NULL)
+
+ 00004 8b 75 08 mov esi, DWORD PTR _fd$[ebp]
+ 00007 57 push edi
+ 00008 83 fe ff cmp esi, -1
+ 0000b 74 3f je SHORT $LN3@gzdopen
+ 0000d 6a 13 push 19 ; 00000013H
+ 0000f ff 15 00 00 00
+ 00 call DWORD PTR __imp__malloc
+ 00015 8b f8 mov edi, eax
+ 00017 83 c4 04 add esp, 4
+ 0001a 85 ff test edi, edi
+ 0001c 74 2e je SHORT $LN3@gzdopen
+
+; 293 : #if !defined(NO_snprintf) && !defined(NO_vsnprintf)
+; 294 : snprintf(path, 7 + 3 * sizeof(int), "<fd:%d>", fd); /* for debugging */
+
+ 0001e 56 push esi
+ 0001f 68 00 00 00 00 push OFFSET ??_C@_07EBNKNFJN@?$DMfd?3?$CFd?$DO?$AA@
+ 00024 6a 13 push 19 ; 00000013H
+ 00026 57 push edi
+ 00027 e8 00 00 00 00 call __snprintf
+
+; 295 : #else
+; 296 : sprintf(path, "<fd:%d>", fd); /* for debugging */
+; 297 : #endif
+; 298 : gz = gz_open(path, fd, mode);
+
+ 0002c ff 75 0c push DWORD PTR _mode$[ebp]
+ 0002f 8b d6 mov edx, esi
+ 00031 8b cf mov ecx, edi
+ 00033 e8 00 00 00 00 call _gz_open
+
+; 299 : free(path);
+
+ 00038 57 push edi
+ 00039 8b f0 mov esi, eax
+ 0003b ff 15 00 00 00
+ 00 call DWORD PTR __imp__free
+ 00041 83 c4 18 add esp, 24 ; 00000018H
+
+; 300 : return gz;
+
+ 00044 8b c6 mov eax, esi
+ 00046 5f pop edi
+ 00047 5e pop esi
+
+; 301 : }
+
+ 00048 5d pop ebp
+ 00049 c2 08 00 ret 8
+$LN3@gzdopen:
+ 0004c 5f pop edi
+
+; 292 : return NULL;
+
+ 0004d 33 c0 xor eax, eax
+ 0004f 5e pop esi
+
+; 301 : }
+
+ 00050 5d pop ebp
+ 00051 c2 08 00 ret 8
+_gzdopen@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzlib.c
+; COMDAT _gzopen_w@8
+_TEXT SEGMENT
+_path$ = 8 ; size = 4
+_mode$ = 12 ; size = 4
+_gzopen_w@8 PROC ; COMDAT
+
+; 308 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 309 : return gz_open(path, -2, mode);
+
+ 00003 ff 75 0c push DWORD PTR _mode$[ebp]
+ 00006 8b 4d 08 mov ecx, DWORD PTR _path$[ebp]
+ 00009 ba fe ff ff ff mov edx, -2 ; fffffffeH
+ 0000e e8 00 00 00 00 call _gz_open
+ 00013 83 c4 04 add esp, 4
+
+; 310 : }
+
+ 00016 5d pop ebp
+ 00017 c2 08 00 ret 8
+_gzopen_w@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzlib.c
+; COMDAT _gzbuffer@8
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_size$ = 12 ; size = 4
+_gzbuffer@8 PROC ; COMDAT
+
+; 317 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 318 : gz_statep state;
+; 319 :
+; 320 : /* get internal structure and check integrity */
+; 321 : if (file == NULL)
+
+ 00003 8b 4d 08 mov ecx, DWORD PTR _file$[ebp]
+ 00006 85 c9 test ecx, ecx
+ 00008 75 07 jne SHORT $LN2@gzbuffer
+$LN7@gzbuffer:
+
+; 322 : return -1;
+
+ 0000a 83 c8 ff or eax, -1
+
+; 336 : }
+
+ 0000d 5d pop ebp
+ 0000e c2 08 00 ret 8
+$LN2@gzbuffer:
+
+; 323 : state = (gz_statep)file;
+; 324 : if (state->mode != GZ_READ && state->mode != GZ_WRITE)
+
+ 00011 8b 41 10 mov eax, DWORD PTR [ecx+16]
+ 00014 3d 4f 1c 00 00 cmp eax, 7247 ; 00001c4fH
+ 00019 74 07 je SHORT $LN3@gzbuffer
+ 0001b 3d b1 79 00 00 cmp eax, 31153 ; 000079b1H
+ 00020 75 e8 jne SHORT $LN7@gzbuffer
+$LN3@gzbuffer:
+
+; 325 : return -1;
+; 326 :
+; 327 : /* make sure we haven't already allocated memory */
+; 328 : if (state->size != 0)
+
+ 00022 83 79 1c 00 cmp DWORD PTR [ecx+28], 0
+ 00026 75 e2 jne SHORT $LN7@gzbuffer
+
+; 329 : return -1;
+; 330 :
+; 331 : /* check and set requested size */
+; 332 : if (size < 2)
+
+ 00028 8b 45 0c mov eax, DWORD PTR _size$[ebp]
+ 0002b ba 02 00 00 00 mov edx, 2
+ 00030 3b c2 cmp eax, edx
+ 00032 0f 42 c2 cmovb eax, edx
+
+; 333 : size = 2; /* need two bytes to check magic header */
+; 334 : state->want = size;
+
+ 00035 89 41 20 mov DWORD PTR [ecx+32], eax
+
+; 335 : return 0;
+
+ 00038 33 c0 xor eax, eax
+
+; 336 : }
+
+ 0003a 5d pop ebp
+ 0003b c2 08 00 ret 8
+_gzbuffer@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzlib.c
+; COMDAT _gzrewind@4
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_gzrewind@4 PROC ; COMDAT
+
+; 341 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 e4 f8 and esp, -8 ; fffffff8H
+ 00006 51 push ecx
+ 00007 56 push esi
+
+; 342 : gz_statep state;
+; 343 :
+; 344 : /* get internal structure */
+; 345 : if (file == NULL)
+
+ 00008 8b 75 08 mov esi, DWORD PTR _file$[ebp]
+ 0000b 85 f6 test esi, esi
+ 0000d 74 40 je SHORT $LN4@gzrewind
+
+; 346 : return -1;
+; 347 : state = (gz_statep)file;
+; 348 :
+; 349 : /* check that we're reading and that there's no error */
+; 350 : if (state->mode != GZ_READ ||
+
+ 0000f 81 7e 10 4f 1c
+ 00 00 cmp DWORD PTR [esi+16], 7247 ; 00001c4fH
+ 00016 75 37 jne SHORT $LN4@gzrewind
+ 00018 8b 46 5c mov eax, DWORD PTR [esi+92]
+ 0001b 85 c0 test eax, eax
+ 0001d 74 05 je SHORT $LN3@gzrewind
+ 0001f 83 f8 fb cmp eax, -5 ; fffffffbH
+ 00022 75 2b jne SHORT $LN4@gzrewind
+$LN3@gzrewind:
+
+; 353 :
+; 354 : /* back up and start over */
+; 355 : if (LSEEK(state->fd, state->start, SEEK_SET) == -1)
+
+ 00024 6a 00 push 0
+ 00026 ff 76 3c push DWORD PTR [esi+60]
+ 00029 ff 76 38 push DWORD PTR [esi+56]
+ 0002c ff 76 14 push DWORD PTR [esi+20]
+ 0002f ff 15 00 00 00
+ 00 call DWORD PTR __imp___lseeki64
+ 00035 23 c2 and eax, edx
+ 00037 83 c4 10 add esp, 16 ; 00000010H
+ 0003a 83 f8 ff cmp eax, -1
+ 0003d 74 10 je SHORT $LN4@gzrewind
+
+; 356 : return -1;
+; 357 : gz_reset(state);
+
+ 0003f 8b ce mov ecx, esi
+ 00041 e8 00 00 00 00 call _gz_reset
+
+; 358 : return 0;
+
+ 00046 33 c0 xor eax, eax
+
+; 359 : }
+
+ 00048 5e pop esi
+ 00049 8b e5 mov esp, ebp
+ 0004b 5d pop ebp
+ 0004c c2 04 00 ret 4
+$LN4@gzrewind:
+
+; 351 : (state->err != Z_OK && state->err != Z_BUF_ERROR))
+; 352 : return -1;
+
+ 0004f 83 c8 ff or eax, -1
+
+; 359 : }
+
+ 00052 5e pop esi
+ 00053 8b e5 mov esp, ebp
+ 00055 5d pop ebp
+ 00056 c2 04 00 ret 4
+_gzrewind@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzlib.c
+; COMDAT _gzseek64@16
+_TEXT SEGMENT
+tv405 = 8 ; size = 8
+_offset$ = 8 ; size = 8
+_gzseek64@16 PROC ; COMDAT
+; _file$ = ecx
+; _whence$ = edx
+
+; 366 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 51 push ecx
+ 00004 53 push ebx
+ 00005 56 push esi
+ 00006 8b f1 mov esi, ecx
+ 00008 57 push edi
+
+; 367 : unsigned n;
+; 368 : z_off64_t ret;
+; 369 : gz_statep state;
+; 370 :
+; 371 : /* get internal structure and check integrity */
+; 372 : if (file == NULL)
+
+ 00009 85 f6 test esi, esi
+ 0000b 75 0d jne SHORT $LN2@gzseek64
+$LN26@gzseek64:
+
+; 373 : return -1;
+
+ 0000d 83 c8 ff or eax, -1
+ 00010 0b d0 or edx, eax
+
+; 436 : }
+
+ 00012 5f pop edi
+ 00013 5e pop esi
+ 00014 5b pop ebx
+ 00015 59 pop ecx
+ 00016 5d pop ebp
+ 00017 c2 08 00 ret 8
+$LN2@gzseek64:
+
+; 374 : state = (gz_statep)file;
+; 375 : if (state->mode != GZ_READ && state->mode != GZ_WRITE)
+
+ 0001a 8b 4e 10 mov ecx, DWORD PTR [esi+16]
+ 0001d 81 f9 4f 1c 00
+ 00 cmp ecx, 7247 ; 00001c4fH
+ 00023 74 08 je SHORT $LN3@gzseek64
+ 00025 81 f9 b1 79 00
+ 00 cmp ecx, 31153 ; 000079b1H
+ 0002b 75 e0 jne SHORT $LN26@gzseek64
+$LN3@gzseek64:
+
+; 376 : return -1;
+; 377 :
+; 378 : /* check that there's no error */
+; 379 : if (state->err != Z_OK && state->err != Z_BUF_ERROR)
+
+ 0002d 8b 46 5c mov eax, DWORD PTR [esi+92]
+ 00030 85 c0 test eax, eax
+ 00032 74 05 je SHORT $LN4@gzseek64
+ 00034 83 f8 fb cmp eax, -5 ; fffffffbH
+ 00037 75 d4 jne SHORT $LN26@gzseek64
+$LN4@gzseek64:
+
+; 380 : return -1;
+; 381 :
+; 382 : /* can only seek from start or relative to current position */
+; 383 : if (whence != SEEK_SET && whence != SEEK_CUR)
+
+ 00039 85 d2 test edx, edx
+ 0003b 74 19 je SHORT $LN20@gzseek64
+ 0003d 83 fa 01 cmp edx, 1
+ 00040 75 cb jne SHORT $LN26@gzseek64
+
+; 389 : else if (state->seek)
+
+ 00042 83 7e 58 00 cmp DWORD PTR [esi+88], 0
+
+; 390 : offset += state->skip;
+
+ 00046 8b 7d 08 mov edi, DWORD PTR _offset$[ebp]
+ 00049 8b 5d 0c mov ebx, DWORD PTR _offset$[ebp+4]
+ 0004c 74 14 je SHORT $LN8@gzseek64
+ 0004e 03 7e 50 add edi, DWORD PTR [esi+80]
+ 00051 13 5e 54 adc ebx, DWORD PTR [esi+84]
+ 00054 eb 0c jmp SHORT $LN8@gzseek64
+$LN20@gzseek64:
+
+; 384 : return -1;
+; 385 :
+; 386 : /* normalize offset to a SEEK_CUR specification */
+; 387 : if (whence == SEEK_SET)
+; 388 : offset -= state->x.pos;
+
+ 00056 8b 7d 08 mov edi, DWORD PTR _offset$[ebp]
+ 00059 2b 7e 08 sub edi, DWORD PTR [esi+8]
+ 0005c 8b 5d 0c mov ebx, DWORD PTR _offset$[ebp+4]
+ 0005f 1b 5e 0c sbb ebx, DWORD PTR [esi+12]
+$LN8@gzseek64:
+
+; 391 : state->seek = 0;
+
+ 00062 c7 46 58 00 00
+ 00 00 mov DWORD PTR [esi+88], 0
+
+; 392 :
+; 393 : /* if within raw area while reading, just go there */
+; 394 : if (state->mode == GZ_READ && state->how == COPY &&
+
+ 00069 81 f9 4f 1c 00
+ 00 cmp ecx, 7247 ; 00001c4fH
+ 0006f 0f 85 83 00 00
+ 00 jne $LN9@gzseek64
+ 00075 83 7e 30 01 cmp DWORD PTR [esi+48], 1
+ 00079 75 7d jne SHORT $LN9@gzseek64
+ 0007b 8b d7 mov edx, edi
+ 0007d 8b c3 mov eax, ebx
+ 0007f 03 56 08 add edx, DWORD PTR [esi+8]
+ 00082 13 46 0c adc eax, DWORD PTR [esi+12]
+ 00085 89 45 0c mov DWORD PTR tv405[ebp+4], eax
+ 00088 78 6e js SHORT $LN9@gzseek64
+ 0008a 7f 04 jg SHORT $LN21@gzseek64
+ 0008c 85 d2 test edx, edx
+ 0008e 72 68 jb SHORT $LN9@gzseek64
+$LN21@gzseek64:
+
+; 395 : state->x.pos + offset >= 0) {
+; 396 : ret = LSEEK(state->fd, offset - state->x.have, SEEK_CUR);
+
+ 00090 8b cf mov ecx, edi
+ 00092 8b c3 mov eax, ebx
+ 00094 2b 0e sub ecx, DWORD PTR [esi]
+ 00096 6a 01 push 1
+ 00098 83 d8 00 sbb eax, 0
+ 0009b 50 push eax
+ 0009c 51 push ecx
+ 0009d ff 76 14 push DWORD PTR [esi+20]
+ 000a0 ff 15 00 00 00
+ 00 call DWORD PTR __imp___lseeki64
+
+; 397 : if (ret == -1)
+
+ 000a6 23 c2 and eax, edx
+ 000a8 83 c4 10 add esp, 16 ; 00000010H
+ 000ab 83 f8 ff cmp eax, -1
+ 000ae 0f 84 59 ff ff
+ ff je $LN26@gzseek64
+
+; 398 : return -1;
+; 399 : state->x.have = 0;
+; 400 : state->eof = 0;
+; 401 : state->past = 0;
+; 402 : state->seek = 0;
+; 403 : gz_error(state, Z_OK, NULL);
+
+ 000b4 6a 00 push 0
+ 000b6 33 d2 xor edx, edx
+ 000b8 c7 06 00 00 00
+ 00 mov DWORD PTR [esi], 0
+ 000be 8b ce mov ecx, esi
+ 000c0 c7 46 40 00 00
+ 00 00 mov DWORD PTR [esi+64], 0
+ 000c7 c7 46 44 00 00
+ 00 00 mov DWORD PTR [esi+68], 0
+ 000ce c7 46 58 00 00
+ 00 00 mov DWORD PTR [esi+88], 0
+ 000d5 e8 00 00 00 00 call _gz_error
+ 000da 83 c4 04 add esp, 4
+
+; 404 : state->strm.avail_in = 0;
+
+ 000dd c7 46 68 00 00
+ 00 00 mov DWORD PTR [esi+104], 0
+
+; 405 : state->x.pos += offset;
+
+ 000e4 01 7e 08 add DWORD PTR [esi+8], edi
+
+; 406 : return state->x.pos;
+
+ 000e7 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 000ea 11 5e 0c adc DWORD PTR [esi+12], ebx
+ 000ed 8b 56 0c mov edx, DWORD PTR [esi+12]
+
+; 436 : }
+
+ 000f0 5f pop edi
+ 000f1 5e pop esi
+ 000f2 5b pop ebx
+ 000f3 59 pop ecx
+ 000f4 5d pop ebp
+ 000f5 c2 08 00 ret 8
+$LN9@gzseek64:
+
+; 407 : }
+; 408 :
+; 409 : /* calculate skip amount, rewinding if needed for back seek when reading */
+; 410 : if (offset < 0) {
+
+ 000f8 85 db test ebx, ebx
+ 000fa 7f 39 jg SHORT $LN14@gzseek64
+ 000fc 7c 04 jl SHORT $LN22@gzseek64
+ 000fe 85 ff test edi, edi
+ 00100 73 33 jae SHORT $LN14@gzseek64
+$LN22@gzseek64:
+
+; 411 : if (state->mode != GZ_READ) /* writing -- can't go backwards */
+
+ 00102 81 f9 4f 1c 00
+ 00 cmp ecx, 7247 ; 00001c4fH
+ 00108 0f 85 ff fe ff
+ ff jne $LN26@gzseek64
+
+; 412 : return -1;
+; 413 : offset += state->x.pos;
+
+ 0010e 03 7e 08 add edi, DWORD PTR [esi+8]
+ 00111 13 5e 0c adc ebx, DWORD PTR [esi+12]
+
+; 414 : if (offset < 0) /* before start of file! */
+
+ 00114 85 db test ebx, ebx
+ 00116 7f 0e jg SHORT $LN13@gzseek64
+ 00118 0f 8c ef fe ff
+ ff jl $LN26@gzseek64
+ 0011e 85 ff test edi, edi
+ 00120 0f 82 e7 fe ff
+ ff jb $LN26@gzseek64
+$LN13@gzseek64:
+
+; 415 : return -1;
+; 416 : if (gzrewind(file) == -1) /* rewind, then skip to offset */
+
+ 00126 56 push esi
+ 00127 e8 00 00 00 00 call _gzrewind@4
+ 0012c 83 f8 ff cmp eax, -1
+ 0012f 0f 84 d8 fe ff
+ ff je $LN26@gzseek64
+$LN14@gzseek64:
+
+; 417 : return -1;
+; 418 : }
+; 419 :
+; 420 : /* if reading, skip what's in output buffer (one less gzgetc() check) */
+; 421 : if (state->mode == GZ_READ) {
+
+ 00135 81 7e 10 4f 1c
+ 00 00 cmp DWORD PTR [esi+16], 7247 ; 00001c4fH
+ 0013c 75 27 jne SHORT $LN15@gzseek64
+
+; 422 : n = GT_OFF(state->x.have) || (z_off64_t)state->x.have > offset ?
+
+ 0013e 8b 06 mov eax, DWORD PTR [esi]
+ 00140 33 c9 xor ecx, ecx
+ 00142 3b cb cmp ecx, ebx
+ 00144 7f 0a jg SHORT $LN18@gzseek64
+ 00146 7c 04 jl SHORT $LN24@gzseek64
+ 00148 3b c7 cmp eax, edi
+ 0014a 77 04 ja SHORT $LN18@gzseek64
+$LN24@gzseek64:
+ 0014c 8b c8 mov ecx, eax
+ 0014e eb 02 jmp SHORT $LN19@gzseek64
+$LN18@gzseek64:
+ 00150 8b cf mov ecx, edi
+$LN19@gzseek64:
+
+; 423 : (unsigned)offset : state->x.have;
+; 424 : state->x.have -= n;
+; 425 : state->x.next += n;
+
+ 00152 01 4e 04 add DWORD PTR [esi+4], ecx
+ 00155 2b c1 sub eax, ecx
+
+; 426 : state->x.pos += n;
+
+ 00157 01 4e 08 add DWORD PTR [esi+8], ecx
+ 0015a 89 06 mov DWORD PTR [esi], eax
+ 0015c 83 56 0c 00 adc DWORD PTR [esi+12], 0
+
+; 427 : offset -= n;
+
+ 00160 2b f9 sub edi, ecx
+ 00162 83 db 00 sbb ebx, 0
+$LN15@gzseek64:
+
+; 428 : }
+; 429 :
+; 430 : /* request skip (if not zero) */
+; 431 : if (offset) {
+
+ 00165 8b c7 mov eax, edi
+ 00167 0b c3 or eax, ebx
+ 00169 74 0d je SHORT $LN16@gzseek64
+
+; 432 : state->seek = 1;
+
+ 0016b c7 46 58 01 00
+ 00 00 mov DWORD PTR [esi+88], 1
+
+; 433 : state->skip = offset;
+
+ 00172 89 7e 50 mov DWORD PTR [esi+80], edi
+ 00175 89 5e 54 mov DWORD PTR [esi+84], ebx
+$LN16@gzseek64:
+
+; 434 : }
+; 435 : return state->x.pos + offset;
+
+ 00178 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 0017b 8b 56 0c mov edx, DWORD PTR [esi+12]
+ 0017e 03 c7 add eax, edi
+
+; 436 : }
+
+ 00180 5f pop edi
+ 00181 5e pop esi
+ 00182 13 d3 adc edx, ebx
+ 00184 5b pop ebx
+ 00185 59 pop ecx
+ 00186 5d pop ebp
+ 00187 c2 08 00 ret 8
+_gzseek64@16 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzlib.c
+; COMDAT _gzseek@12
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_offset$ = 12 ; size = 4
+_whence$ = 16 ; size = 4
+_gzseek@12 PROC ; COMDAT
+
+; 443 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 e4 f8 and esp, -8 ; fffffff8H
+ 00006 51 push ecx
+
+; 444 : z_off64_t ret;
+; 445 :
+; 446 : ret = gzseek64(file, (z_off64_t)offset, whence);
+
+ 00007 8b 45 0c mov eax, DWORD PTR _offset$[ebp]
+ 0000a 8b 4d 08 mov ecx, DWORD PTR _file$[ebp]
+ 0000d 99 cdq
+ 0000e 56 push esi
+ 0000f 52 push edx
+ 00010 8b 55 10 mov edx, DWORD PTR _whence$[ebp]
+ 00013 50 push eax
+ 00014 e8 00 00 00 00 call _gzseek64@16
+ 00019 8b c8 mov ecx, eax
+ 0001b 8b f2 mov esi, edx
+
+; 447 : return ret == (z_off_t)ret ? (z_off_t)ret : -1;
+
+ 0001d 99 cdq
+ 0001e 3b c8 cmp ecx, eax
+ 00020 75 0d jne SHORT $LN3@gzseek
+ 00022 3b f2 cmp esi, edx
+ 00024 75 09 jne SHORT $LN3@gzseek
+ 00026 8b c1 mov eax, ecx
+
+; 448 : }
+
+ 00028 5e pop esi
+ 00029 8b e5 mov esp, ebp
+ 0002b 5d pop ebp
+ 0002c c2 0c 00 ret 12 ; 0000000cH
+$LN3@gzseek:
+
+; 447 : return ret == (z_off_t)ret ? (z_off_t)ret : -1;
+
+ 0002f 83 c8 ff or eax, -1
+
+; 448 : }
+
+ 00032 5e pop esi
+ 00033 8b e5 mov esp, ebp
+ 00035 5d pop ebp
+ 00036 c2 0c 00 ret 12 ; 0000000cH
+_gzseek@12 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzlib.c
+; COMDAT _gztell64@4
+_TEXT SEGMENT
+tv73 = -8 ; size = 8
+_gztell64@4 PROC ; COMDAT
+; _file$ = ecx
+
+; 453 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 08 sub esp, 8
+
+; 454 : gz_statep state;
+; 455 :
+; 456 : /* get internal structure and check integrity */
+; 457 : if (file == NULL)
+
+ 00006 85 c9 test ecx, ecx
+ 00008 75 09 jne SHORT $LN2@gztell64
+$LN7@gztell64:
+
+; 458 : return -1;
+
+ 0000a 83 c8 ff or eax, -1
+ 0000d 0b d0 or edx, eax
+
+; 465 : }
+
+ 0000f 8b e5 mov esp, ebp
+ 00011 5d pop ebp
+ 00012 c3 ret 0
+$LN2@gztell64:
+
+; 459 : state = (gz_statep)file;
+; 460 : if (state->mode != GZ_READ && state->mode != GZ_WRITE)
+
+ 00013 8b 41 10 mov eax, DWORD PTR [ecx+16]
+ 00016 3d 4f 1c 00 00 cmp eax, 7247 ; 00001c4fH
+ 0001b 74 07 je SHORT $LN3@gztell64
+ 0001d 3d b1 79 00 00 cmp eax, 31153 ; 000079b1H
+ 00022 75 e6 jne SHORT $LN7@gztell64
+$LN3@gztell64:
+
+; 461 : return -1;
+; 462 :
+; 463 : /* return position */
+; 464 : return state->x.pos + (state->seek ? state->skip : 0);
+
+ 00024 83 79 58 00 cmp DWORD PTR [ecx+88], 0
+ 00028 56 push esi
+ 00029 74 15 je SHORT $LN5@gztell64
+ 0002b 8b 51 50 mov edx, DWORD PTR [ecx+80]
+ 0002e 8b 41 08 mov eax, DWORD PTR [ecx+8]
+ 00031 8b 71 54 mov esi, DWORD PTR [ecx+84]
+ 00034 03 c2 add eax, edx
+ 00036 8b 51 0c mov edx, DWORD PTR [ecx+12]
+ 00039 13 d6 adc edx, esi
+ 0003b 5e pop esi
+
+; 465 : }
+
+ 0003c 8b e5 mov esp, ebp
+ 0003e 5d pop ebp
+ 0003f c3 ret 0
+$LN5@gztell64:
+
+; 461 : return -1;
+; 462 :
+; 463 : /* return position */
+; 464 : return state->x.pos + (state->seek ? state->skip : 0);
+
+ 00040 8b 41 08 mov eax, DWORD PTR [ecx+8]
+ 00043 0f 57 c0 xorps xmm0, xmm0
+ 00046 66 0f 13 45 f8 movlpd QWORD PTR tv73[ebp], xmm0
+ 0004b 8b 55 f8 mov edx, DWORD PTR tv73[ebp]
+ 0004e 03 c2 add eax, edx
+ 00050 8b 75 fc mov esi, DWORD PTR tv73[ebp+4]
+ 00053 8b 51 0c mov edx, DWORD PTR [ecx+12]
+ 00056 13 d6 adc edx, esi
+ 00058 5e pop esi
+
+; 465 : }
+
+ 00059 8b e5 mov esp, ebp
+ 0005b 5d pop ebp
+ 0005c c3 ret 0
+_gztell64@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzlib.c
+; COMDAT _gztell@4
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_gztell@4 PROC ; COMDAT
+
+; 470 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 471 : z_off64_t ret;
+; 472 :
+; 473 : ret = gztell64(file);
+
+ 00003 8b 4d 08 mov ecx, DWORD PTR _file$[ebp]
+ 00006 56 push esi
+ 00007 e8 00 00 00 00 call _gztell64@4
+ 0000c 8b c8 mov ecx, eax
+ 0000e 8b f2 mov esi, edx
+
+; 474 : return ret == (z_off_t)ret ? (z_off_t)ret : -1;
+
+ 00010 99 cdq
+ 00011 3b c8 cmp ecx, eax
+ 00013 75 0b jne SHORT $LN3@gztell
+ 00015 3b f2 cmp esi, edx
+ 00017 75 07 jne SHORT $LN3@gztell
+ 00019 8b c1 mov eax, ecx
+ 0001b 5e pop esi
+
+; 475 : }
+
+ 0001c 5d pop ebp
+ 0001d c2 04 00 ret 4
+$LN3@gztell:
+
+; 474 : return ret == (z_off_t)ret ? (z_off_t)ret : -1;
+
+ 00020 83 c8 ff or eax, -1
+ 00023 5e pop esi
+
+; 475 : }
+
+ 00024 5d pop ebp
+ 00025 c2 04 00 ret 4
+_gztell@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzlib.c
+; COMDAT _gzoffset64@4
+_TEXT SEGMENT
+_gzoffset64@4 PROC ; COMDAT
+; _file$ = ecx
+
+; 480 : {
+
+ 00000 56 push esi
+ 00001 8b f1 mov esi, ecx
+
+; 481 : z_off64_t offset;
+; 482 : gz_statep state;
+; 483 :
+; 484 : /* get internal structure and check integrity */
+; 485 : if (file == NULL)
+
+ 00003 85 f6 test esi, esi
+ 00005 75 07 jne SHORT $LN2@gzoffset64
+$LN7@gzoffset64:
+
+; 486 : return -1;
+
+ 00007 83 c8 ff or eax, -1
+ 0000a 0b d0 or edx, eax
+
+; 497 : return offset;
+; 498 : }
+
+ 0000c 5e pop esi
+ 0000d c3 ret 0
+$LN2@gzoffset64:
+
+; 487 : state = (gz_statep)file;
+; 488 : if (state->mode != GZ_READ && state->mode != GZ_WRITE)
+
+ 0000e 8b 46 10 mov eax, DWORD PTR [esi+16]
+ 00011 3d 4f 1c 00 00 cmp eax, 7247 ; 00001c4fH
+ 00016 74 07 je SHORT $LN3@gzoffset64
+ 00018 3d b1 79 00 00 cmp eax, 31153 ; 000079b1H
+ 0001d 75 e8 jne SHORT $LN7@gzoffset64
+$LN3@gzoffset64:
+
+; 489 : return -1;
+; 490 :
+; 491 : /* compute and return effective offset in file */
+; 492 : offset = LSEEK(state->fd, 0, SEEK_CUR);
+
+ 0001f 6a 01 push 1
+ 00021 6a 00 push 0
+ 00023 6a 00 push 0
+ 00025 ff 76 14 push DWORD PTR [esi+20]
+ 00028 ff 15 00 00 00
+ 00 call DWORD PTR __imp___lseeki64
+
+; 493 : if (offset == -1)
+
+ 0002e 8b c8 mov ecx, eax
+ 00030 83 c4 10 add esp, 16 ; 00000010H
+ 00033 23 ca and ecx, edx
+ 00035 83 f9 ff cmp ecx, -1
+ 00038 74 cd je SHORT $LN7@gzoffset64
+
+; 494 : return -1;
+; 495 : if (state->mode == GZ_READ) /* reading */
+
+ 0003a 81 7e 10 4f 1c
+ 00 00 cmp DWORD PTR [esi+16], 7247 ; 00001c4fH
+ 00041 75 06 jne SHORT $LN1@gzoffset64
+
+; 496 : offset -= state->strm.avail_in; /* don't count buffered input */
+
+ 00043 2b 46 68 sub eax, DWORD PTR [esi+104]
+ 00046 83 da 00 sbb edx, 0
+$LN1@gzoffset64:
+
+; 497 : return offset;
+; 498 : }
+
+ 00049 5e pop esi
+ 0004a c3 ret 0
+_gzoffset64@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzlib.c
+; COMDAT _gzoffset@4
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_gzoffset@4 PROC ; COMDAT
+
+; 503 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 e4 f8 and esp, -8 ; fffffff8H
+ 00006 51 push ecx
+
+; 504 : z_off64_t ret;
+; 505 :
+; 506 : ret = gzoffset64(file);
+
+ 00007 8b 4d 08 mov ecx, DWORD PTR _file$[ebp]
+ 0000a 56 push esi
+ 0000b e8 00 00 00 00 call _gzoffset64@4
+ 00010 8b c8 mov ecx, eax
+ 00012 8b f2 mov esi, edx
+
+; 507 : return ret == (z_off_t)ret ? (z_off_t)ret : -1;
+
+ 00014 99 cdq
+ 00015 3b c8 cmp ecx, eax
+ 00017 75 0d jne SHORT $LN3@gzoffset
+ 00019 3b f2 cmp esi, edx
+ 0001b 75 09 jne SHORT $LN3@gzoffset
+ 0001d 8b c1 mov eax, ecx
+
+; 508 : }
+
+ 0001f 5e pop esi
+ 00020 8b e5 mov esp, ebp
+ 00022 5d pop ebp
+ 00023 c2 04 00 ret 4
+$LN3@gzoffset:
+
+; 507 : return ret == (z_off_t)ret ? (z_off_t)ret : -1;
+
+ 00026 83 c8 ff or eax, -1
+
+; 508 : }
+
+ 00029 5e pop esi
+ 0002a 8b e5 mov esp, ebp
+ 0002c 5d pop ebp
+ 0002d c2 04 00 ret 4
+_gzoffset@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzlib.c
+; COMDAT _gzeof@4
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_gzeof@4 PROC ; COMDAT
+
+; 513 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 514 : gz_statep state;
+; 515 :
+; 516 : /* get internal structure and check integrity */
+; 517 : if (file == NULL)
+
+ 00003 8b 45 08 mov eax, DWORD PTR _file$[ebp]
+ 00006 85 c0 test eax, eax
+ 00008 74 22 je SHORT $LN5@gzeof
+
+; 518 : return 0;
+; 519 : state = (gz_statep)file;
+; 520 : if (state->mode != GZ_READ && state->mode != GZ_WRITE)
+
+ 0000a 8b 48 10 mov ecx, DWORD PTR [eax+16]
+ 0000d 81 f9 4f 1c 00
+ 00 cmp ecx, 7247 ; 00001c4fH
+ 00013 74 10 je SHORT $LN8@gzeof
+ 00015 81 f9 b1 79 00
+ 00 cmp ecx, 31153 ; 000079b1H
+ 0001b 75 0f jne SHORT $LN5@gzeof
+
+; 521 : return 0;
+; 522 :
+; 523 : /* return end-of-file state */
+; 524 : return state->mode == GZ_READ ? state->past : 0;
+
+ 0001d 81 f9 4f 1c 00
+ 00 cmp ecx, 7247 ; 00001c4fH
+ 00023 75 07 jne SHORT $LN5@gzeof
+$LN8@gzeof:
+ 00025 8b 40 44 mov eax, DWORD PTR [eax+68]
+
+; 525 : }
+
+ 00028 5d pop ebp
+ 00029 c2 04 00 ret 4
+$LN5@gzeof:
+
+; 521 : return 0;
+; 522 :
+; 523 : /* return end-of-file state */
+; 524 : return state->mode == GZ_READ ? state->past : 0;
+
+ 0002c 33 c0 xor eax, eax
+
+; 525 : }
+
+ 0002e 5d pop ebp
+ 0002f c2 04 00 ret 4
+_gzeof@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzlib.c
+; COMDAT _gzerror@8
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_errnum$ = 12 ; size = 4
+_gzerror@8 PROC ; COMDAT
+
+; 531 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 532 : gz_statep state;
+; 533 :
+; 534 : /* get internal structure and check integrity */
+; 535 : if (file == NULL)
+
+ 00003 8b 4d 08 mov ecx, DWORD PTR _file$[ebp]
+ 00006 85 c9 test ecx, ecx
+ 00008 75 06 jne SHORT $LN2@gzerror
+$LN10@gzerror:
+
+; 536 : return NULL;
+
+ 0000a 33 c0 xor eax, eax
+
+; 545 : (state->msg == NULL ? "" : state->msg);
+; 546 : }
+
+ 0000c 5d pop ebp
+ 0000d c2 08 00 ret 8
+$LN2@gzerror:
+
+; 537 : state = (gz_statep)file;
+; 538 : if (state->mode != GZ_READ && state->mode != GZ_WRITE)
+
+ 00010 8b 41 10 mov eax, DWORD PTR [ecx+16]
+ 00013 3d 4f 1c 00 00 cmp eax, 7247 ; 00001c4fH
+ 00018 74 07 je SHORT $LN3@gzerror
+ 0001a 3d b1 79 00 00 cmp eax, 31153 ; 000079b1H
+ 0001f 75 e9 jne SHORT $LN10@gzerror
+$LN3@gzerror:
+
+; 539 : return NULL;
+; 540 :
+; 541 : /* return error information */
+; 542 : if (errnum != NULL)
+
+ 00021 8b 55 0c mov edx, DWORD PTR _errnum$[ebp]
+ 00024 85 d2 test edx, edx
+ 00026 74 05 je SHORT $LN4@gzerror
+
+; 543 : *errnum = state->err;
+
+ 00028 8b 41 5c mov eax, DWORD PTR [ecx+92]
+ 0002b 89 02 mov DWORD PTR [edx], eax
+$LN4@gzerror:
+
+; 544 : return state->err == Z_MEM_ERROR ? "out of memory" :
+
+ 0002d 83 79 5c fc cmp DWORD PTR [ecx+92], -4 ; fffffffcH
+ 00031 75 09 jne SHORT $LN8@gzerror
+ 00033 b8 00 00 00 00 mov eax, OFFSET ??_C@_0O@BNNCBLEN@out?5of?5memory?$AA@
+
+; 545 : (state->msg == NULL ? "" : state->msg);
+; 546 : }
+
+ 00038 5d pop ebp
+ 00039 c2 08 00 ret 8
+$LN8@gzerror:
+
+; 544 : return state->err == Z_MEM_ERROR ? "out of memory" :
+
+ 0003c 8b 49 60 mov ecx, DWORD PTR [ecx+96]
+ 0003f b8 00 00 00 00 mov eax, OFFSET ??_C@_00CNPNBAHC@?$AA@
+ 00044 85 c9 test ecx, ecx
+ 00046 0f 45 c1 cmovne eax, ecx
+
+; 545 : (state->msg == NULL ? "" : state->msg);
+; 546 : }
+
+ 00049 5d pop ebp
+ 0004a c2 08 00 ret 8
+_gzerror@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzlib.c
+; COMDAT _gzclearerr@4
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_gzclearerr@4 PROC ; COMDAT
+
+; 551 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 552 : gz_statep state;
+; 553 :
+; 554 : /* get internal structure and check integrity */
+; 555 : if (file == NULL)
+
+ 00003 8b 4d 08 mov ecx, DWORD PTR _file$[ebp]
+ 00006 85 c9 test ecx, ecx
+ 00008 74 32 je SHORT $LN1@gzclearerr
+
+; 556 : return;
+; 557 : state = (gz_statep)file;
+; 558 : if (state->mode != GZ_READ && state->mode != GZ_WRITE)
+
+ 0000a 8b 41 10 mov eax, DWORD PTR [ecx+16]
+ 0000d 3d 4f 1c 00 00 cmp eax, 7247 ; 00001c4fH
+ 00012 74 0e je SHORT $LN7@gzclearerr
+ 00014 3d b1 79 00 00 cmp eax, 31153 ; 000079b1H
+ 00019 75 21 jne SHORT $LN1@gzclearerr
+
+; 559 : return;
+; 560 :
+; 561 : /* clear error and end-of-file */
+; 562 : if (state->mode == GZ_READ) {
+
+ 0001b 3d 4f 1c 00 00 cmp eax, 7247 ; 00001c4fH
+ 00020 75 0e jne SHORT $LN4@gzclearerr
+$LN7@gzclearerr:
+
+; 563 : state->eof = 0;
+
+ 00022 c7 41 40 00 00
+ 00 00 mov DWORD PTR [ecx+64], 0
+
+; 564 : state->past = 0;
+
+ 00029 c7 41 44 00 00
+ 00 00 mov DWORD PTR [ecx+68], 0
+$LN4@gzclearerr:
+
+; 565 : }
+; 566 : gz_error(state, Z_OK, NULL);
+
+ 00030 6a 00 push 0
+ 00032 33 d2 xor edx, edx
+ 00034 e8 00 00 00 00 call _gz_error
+ 00039 83 c4 04 add esp, 4
+$LN1@gzclearerr:
+
+; 567 : }
+
+ 0003c 5d pop ebp
+ 0003d c2 04 00 ret 4
+_gzclearerr@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzlib.c
+; COMDAT _gz_error
+_TEXT SEGMENT
+tv144 = 8 ; size = 4
+_msg$ = 8 ; size = 4
+_gz_error PROC ; COMDAT
+; _state$ = ecx
+; _err$ = edx
+
+; 579 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 53 push ebx
+ 00004 56 push esi
+ 00005 8b f1 mov esi, ecx
+ 00007 57 push edi
+ 00008 8b fa mov edi, edx
+
+; 580 : /* free previously allocated message and clear */
+; 581 : if (state->msg != NULL) {
+
+ 0000a 8b 46 60 mov eax, DWORD PTR [esi+96]
+ 0000d 85 c0 test eax, eax
+ 0000f 74 17 je SHORT $LN2@gz_error
+
+; 582 : if (state->err != Z_MEM_ERROR)
+
+ 00011 83 7e 5c fc cmp DWORD PTR [esi+92], -4 ; fffffffcH
+ 00015 74 0a je SHORT $LN3@gz_error
+
+; 583 : free(state->msg);
+
+ 00017 50 push eax
+ 00018 ff 15 00 00 00
+ 00 call DWORD PTR __imp__free
+ 0001e 83 c4 04 add esp, 4
+$LN3@gz_error:
+
+; 584 : state->msg = NULL;
+
+ 00021 c7 46 60 00 00
+ 00 00 mov DWORD PTR [esi+96], 0
+$LN2@gz_error:
+
+; 585 : }
+; 586 :
+; 587 : /* if fatal, set state->x.have to 0 so that the gzgetc() macro fails */
+; 588 : if (err != Z_OK && err != Z_BUF_ERROR)
+
+ 00028 85 ff test edi, edi
+ 0002a 74 0b je SHORT $LN4@gz_error
+ 0002c 83 ff fb cmp edi, -5 ; fffffffbH
+ 0002f 74 06 je SHORT $LN4@gz_error
+
+; 589 : state->x.have = 0;
+
+ 00031 c7 06 00 00 00
+ 00 mov DWORD PTR [esi], 0
+$LN4@gz_error:
+
+; 590 :
+; 591 : /* set error code, and if no message, then done */
+; 592 : state->err = err;
+; 593 : if (msg == NULL)
+
+ 00037 8b 5d 08 mov ebx, DWORD PTR _msg$[ebp]
+ 0003a 89 7e 5c mov DWORD PTR [esi+92], edi
+ 0003d 85 db test ebx, ebx
+ 0003f 0f 84 87 00 00
+ 00 je $LN1@gz_error
+
+; 594 : return;
+; 595 :
+; 596 : /* for an out of memory error, return literal string when requested */
+; 597 : if (err == Z_MEM_ERROR)
+
+ 00045 83 ff fc cmp edi, -4 ; fffffffcH
+ 00048 0f 84 7e 00 00
+ 00 je $LN1@gz_error
+
+; 598 : return;
+; 599 :
+; 600 : /* construct error message with path */
+; 601 : if ((state->msg = (char *)malloc(strlen(state->path) + strlen(msg) + 3)) ==
+
+ 0004e 8b 4e 18 mov ecx, DWORD PTR [esi+24]
+ 00051 8d 51 01 lea edx, DWORD PTR [ecx+1]
+$LL9@gz_error:
+ 00054 8a 01 mov al, BYTE PTR [ecx]
+ 00056 41 inc ecx
+ 00057 84 c0 test al, al
+ 00059 75 f9 jne SHORT $LL9@gz_error
+ 0005b 2b ca sub ecx, edx
+ 0005d 8b d3 mov edx, ebx
+ 0005f 8d 7a 01 lea edi, DWORD PTR [edx+1]
+$LL10@gz_error:
+ 00062 8a 02 mov al, BYTE PTR [edx]
+ 00064 42 inc edx
+ 00065 84 c0 test al, al
+ 00067 75 f9 jne SHORT $LL10@gz_error
+ 00069 2b d7 sub edx, edi
+ 0006b 8d 41 03 lea eax, DWORD PTR [ecx+3]
+ 0006e 03 c2 add eax, edx
+ 00070 50 push eax
+ 00071 ff 15 00 00 00
+ 00 call DWORD PTR __imp__malloc
+ 00077 83 c4 04 add esp, 4
+ 0007a 89 45 08 mov DWORD PTR tv144[ebp], eax
+ 0007d 89 46 60 mov DWORD PTR [esi+96], eax
+ 00080 85 c0 test eax, eax
+ 00082 75 0c jne SHORT $LN7@gz_error
+
+; 602 : NULL) {
+; 603 : state->err = Z_MEM_ERROR;
+
+ 00084 5f pop edi
+ 00085 c7 46 5c fc ff
+ ff ff mov DWORD PTR [esi+92], -4 ; fffffffcH
+ 0008c 5e pop esi
+ 0008d 5b pop ebx
+
+; 608 : "%s%s%s", state->path, ": ", msg);
+; 609 : #else
+; 610 : strcpy(state->msg, state->path);
+; 611 : strcat(state->msg, ": ");
+; 612 : strcat(state->msg, msg);
+; 613 : #endif
+; 614 : return;
+; 615 : }
+
+ 0008e 5d pop ebp
+ 0008f c3 ret 0
+$LN7@gz_error:
+
+; 604 : return;
+; 605 : }
+; 606 : #if !defined(NO_snprintf) && !defined(NO_vsnprintf)
+; 607 : snprintf(state->msg, strlen(state->path) + strlen(msg) + 3,
+
+ 00090 8b 76 18 mov esi, DWORD PTR [esi+24]
+ 00093 8b ce mov ecx, esi
+ 00095 8d 51 01 lea edx, DWORD PTR [ecx+1]
+$LL11@gz_error:
+ 00098 8a 01 mov al, BYTE PTR [ecx]
+ 0009a 41 inc ecx
+ 0009b 84 c0 test al, al
+ 0009d 75 f9 jne SHORT $LL11@gz_error
+ 0009f 2b ca sub ecx, edx
+ 000a1 8b d3 mov edx, ebx
+ 000a3 8d 7a 01 lea edi, DWORD PTR [edx+1]
+$LL12@gz_error:
+ 000a6 8a 02 mov al, BYTE PTR [edx]
+ 000a8 42 inc edx
+ 000a9 84 c0 test al, al
+ 000ab 75 f9 jne SHORT $LL12@gz_error
+ 000ad 53 push ebx
+ 000ae 68 00 00 00 00 push OFFSET ??_C@_02LMMGGCAJ@?3?5?$AA@
+ 000b3 56 push esi
+ 000b4 2b d7 sub edx, edi
+ 000b6 8d 41 03 lea eax, DWORD PTR [ecx+3]
+ 000b9 68 00 00 00 00 push OFFSET ??_C@_06DIJPEION@?$CFs?$CFs?$CFs?$AA@
+ 000be 03 c2 add eax, edx
+ 000c0 50 push eax
+ 000c1 ff 75 08 push DWORD PTR tv144[ebp]
+ 000c4 e8 00 00 00 00 call __snprintf
+ 000c9 83 c4 18 add esp, 24 ; 00000018H
+$LN1@gz_error:
+ 000cc 5f pop edi
+ 000cd 5e pop esi
+ 000ce 5b pop ebx
+
+; 608 : "%s%s%s", state->path, ": ", msg);
+; 609 : #else
+; 610 : strcpy(state->msg, state->path);
+; 611 : strcat(state->msg, ": ");
+; 612 : strcat(state->msg, msg);
+; 613 : #endif
+; 614 : return;
+; 615 : }
+
+ 000cf 5d pop ebp
+ 000d0 c3 ret 0
+_gz_error ENDP
+_TEXT ENDS
+END
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzlib.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzlib.obj
new file mode 100644
index 0000000000..21cea7b7f9
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzlib.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzread.cod b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzread.cod
new file mode 100644
index 0000000000..72b6299a39
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzread.cod
@@ -0,0 +1,2216 @@
+; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.23506.0
+
+ TITLE d:\downloads\tgl-master\tgl-master\zlib\gzread.c
+ .686P
+ .XMM
+ include listing.inc
+ .model flat
+
+INCLUDELIB OLDNAMES
+
+PUBLIC ??_C@_0BH@CFIIDOJD@unexpected?5end?5of?5file?$AA@ ; `string'
+PUBLIC ??_C@_0CH@CPOLIEKA@internal?5error?3?5inflate?5stream?5c@ ; `string'
+PUBLIC ??_C@_0BG@HCKBMIHF@compressed?5data?5error?$AA@ ; `string'
+PUBLIC ??_C@_0CF@MLPJFDMM@requested?5length?5does?5not?5fit?5in@ ; `string'
+PUBLIC ??_C@_0BP@IIKIGMCC@out?5of?5room?5to?5push?5characters?$AA@ ; `string'
+EXTRN __imp__strerror:PROC
+EXTRN __imp__memchr:PROC
+EXTRN __imp___errno:PROC
+EXTRN __imp___close:PROC
+EXTRN __imp___read:PROC
+; COMDAT ??_C@_0BP@IIKIGMCC@out?5of?5room?5to?5push?5characters?$AA@
+CONST SEGMENT
+??_C@_0BP@IIKIGMCC@out?5of?5room?5to?5push?5characters?$AA@ DB 'out of ro'
+ DB 'om to push characters', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_0CF@MLPJFDMM@requested?5length?5does?5not?5fit?5in@
+CONST SEGMENT
+??_C@_0CF@MLPJFDMM@requested?5length?5does?5not?5fit?5in@ DB 'requested l'
+ DB 'ength does not fit in int', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_0BG@HCKBMIHF@compressed?5data?5error?$AA@
+CONST SEGMENT
+??_C@_0BG@HCKBMIHF@compressed?5data?5error?$AA@ DB 'compressed data error'
+ DB 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_0CH@CPOLIEKA@internal?5error?3?5inflate?5stream?5c@
+CONST SEGMENT
+??_C@_0CH@CPOLIEKA@internal?5error?3?5inflate?5stream?5c@ DB 'internal er'
+ DB 'ror: inflate stream corrupt', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_0BH@CFIIDOJD@unexpected?5end?5of?5file?$AA@
+CONST SEGMENT
+??_C@_0BH@CFIIDOJD@unexpected?5end?5of?5file?$AA@ DB 'unexpected end of f'
+ DB 'ile', 00H ; `string'
+PUBLIC _gzdirect@4
+PUBLIC _gzgets@12
+PUBLIC _gzungetc@8
+PUBLIC _gzgetc_@4
+PUBLIC _gzgetc@4
+PUBLIC _gzread@12
+PUBLIC _gzclose_r@4
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzread.c
+; COMDAT _gzclose_r@4
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_gzclose_r@4 PROC ; COMDAT
+
+; 569 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 53 push ebx
+
+; 570 : int ret, err;
+; 571 : gz_statep state;
+; 572 :
+; 573 : /* get internal structure */
+; 574 : if (file == NULL)
+
+ 00004 8b 5d 08 mov ebx, DWORD PTR _file$[ebp]
+ 00007 85 db test ebx, ebx
+ 00009 75 0a jne SHORT $LN2@gzclose_r
+$LN6@gzclose_r:
+
+; 575 : return Z_STREAM_ERROR;
+
+ 0000b b8 fe ff ff ff mov eax, -2 ; fffffffeH
+ 00010 5b pop ebx
+
+; 594 : }
+
+ 00011 5d pop ebp
+ 00012 c2 04 00 ret 4
+$LN2@gzclose_r:
+
+; 576 : state = (gz_statep)file;
+; 577 :
+; 578 : /* check that we're reading */
+; 579 : if (state->mode != GZ_READ)
+
+ 00015 81 7b 10 4f 1c
+ 00 00 cmp DWORD PTR [ebx+16], 7247 ; 00001c4fH
+ 0001c 75 ed jne SHORT $LN6@gzclose_r
+
+; 580 : return Z_STREAM_ERROR;
+; 581 :
+; 582 : /* free memory and close file */
+; 583 : if (state->size) {
+
+ 0001e 83 7b 1c 00 cmp DWORD PTR [ebx+28], 0
+ 00022 56 push esi
+ 00023 8b 35 00 00 00
+ 00 mov esi, DWORD PTR __imp__free
+ 00029 57 push edi
+ 0002a 74 16 je SHORT $LN4@gzclose_r
+
+; 584 : inflateEnd(&(state->strm));
+
+ 0002c 8d 43 64 lea eax, DWORD PTR [ebx+100]
+ 0002f 50 push eax
+ 00030 e8 00 00 00 00 call _inflateEnd@4
+
+; 585 : free(state->out);
+
+ 00035 ff 73 28 push DWORD PTR [ebx+40]
+ 00038 ff d6 call esi
+
+; 586 : free(state->in);
+
+ 0003a ff 73 24 push DWORD PTR [ebx+36]
+ 0003d ff d6 call esi
+ 0003f 83 c4 08 add esp, 8
+$LN4@gzclose_r:
+
+; 587 : }
+; 588 : err = state->err == Z_BUF_ERROR ? Z_BUF_ERROR : Z_OK;
+
+ 00042 b8 fb ff ff ff mov eax, -5 ; fffffffbH
+ 00047 33 ff xor edi, edi
+ 00049 39 43 5c cmp DWORD PTR [ebx+92], eax
+
+; 589 : gz_error(state, Z_OK, NULL);
+
+ 0004c 8b cb mov ecx, ebx
+ 0004e 6a 00 push 0
+ 00050 0f 44 f8 cmove edi, eax
+ 00053 33 d2 xor edx, edx
+ 00055 e8 00 00 00 00 call _gz_error
+
+; 590 : free(state->path);
+
+ 0005a ff 73 18 push DWORD PTR [ebx+24]
+ 0005d ff d6 call esi
+
+; 591 : ret = close(state->fd);
+
+ 0005f ff 73 14 push DWORD PTR [ebx+20]
+ 00062 ff 15 00 00 00
+ 00 call DWORD PTR __imp___close
+
+; 592 : free(state);
+
+ 00068 53 push ebx
+ 00069 8b f0 mov esi, eax
+ 0006b ff 15 00 00 00
+ 00 call DWORD PTR __imp__free
+ 00071 83 c4 10 add esp, 16 ; 00000010H
+
+; 593 : return ret ? Z_ERRNO : err;
+
+ 00074 83 c8 ff or eax, -1
+ 00077 85 f6 test esi, esi
+ 00079 0f 45 f8 cmovne edi, eax
+ 0007c 8b c7 mov eax, edi
+ 0007e 5f pop edi
+ 0007f 5e pop esi
+ 00080 5b pop ebx
+
+; 594 : }
+
+ 00081 5d pop ebp
+ 00082 c2 04 00 ret 4
+_gzclose_r@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzread.c
+; COMDAT _gz_load
+_TEXT SEGMENT
+_buf$1$ = -4 ; size = 4
+_len$ = 8 ; size = 4
+_have$ = 12 ; size = 4
+_gz_load PROC ; COMDAT
+; _state$ = ecx
+; _buf$ = edx
+
+; 25 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 51 push ecx
+ 00004 53 push ebx
+ 00005 56 push esi
+
+; 26 : int ret;
+; 27 :
+; 28 : *have = 0;
+
+ 00006 8b 75 0c mov esi, DWORD PTR _have$[ebp]
+ 00009 8b d9 mov ebx, ecx
+ 0000b 57 push edi
+ 0000c 8b 7d 08 mov edi, DWORD PTR _len$[ebp]
+ 0000f 89 55 fc mov DWORD PTR _buf$1$[ebp], edx
+ 00012 c7 06 00 00 00
+ 00 mov DWORD PTR [esi], 0
+$LL4@gz_load:
+
+; 29 : do {
+; 30 : ret = read(state->fd, buf + *have, len - *have);
+
+ 00018 8b 0e mov ecx, DWORD PTR [esi]
+ 0001a 8b c7 mov eax, edi
+ 0001c 2b c1 sub eax, ecx
+ 0001e 50 push eax
+ 0001f 8d 04 11 lea eax, DWORD PTR [ecx+edx]
+ 00022 50 push eax
+ 00023 ff 73 14 push DWORD PTR [ebx+20]
+ 00026 ff 15 00 00 00
+ 00 call DWORD PTR __imp___read
+ 0002c 83 c4 0c add esp, 12 ; 0000000cH
+
+; 31 : if (ret <= 0)
+
+ 0002f 85 c0 test eax, eax
+ 00031 7e 0b jle SHORT $LN13@gz_load
+
+; 32 : break;
+; 33 : *have += ret;
+
+ 00033 01 06 add DWORD PTR [esi], eax
+
+; 34 : } while (*have < len);
+
+ 00035 8b 55 fc mov edx, DWORD PTR _buf$1$[ebp]
+ 00038 39 3e cmp DWORD PTR [esi], edi
+ 0003a 72 dc jb SHORT $LL4@gz_load
+
+; 35 : if (ret < 0) {
+
+ 0003c 85 c0 test eax, eax
+$LN13@gz_load:
+ 0003e 79 26 jns SHORT $LN6@gz_load
+
+; 36 : gz_error(state, Z_ERRNO, zstrerror());
+
+ 00040 ff 15 00 00 00
+ 00 call DWORD PTR __imp___errno
+ 00046 ff 30 push DWORD PTR [eax]
+ 00048 ff 15 00 00 00
+ 00 call DWORD PTR __imp__strerror
+ 0004e 50 push eax
+ 0004f 83 ca ff or edx, -1
+ 00052 8b cb mov ecx, ebx
+ 00054 e8 00 00 00 00 call _gz_error
+ 00059 83 c4 08 add esp, 8
+
+; 37 : return -1;
+
+ 0005c 83 c8 ff or eax, -1
+ 0005f 5f pop edi
+ 00060 5e pop esi
+ 00061 5b pop ebx
+
+; 42 : }
+
+ 00062 8b e5 mov esp, ebp
+ 00064 5d pop ebp
+ 00065 c3 ret 0
+$LN6@gz_load:
+
+; 38 : }
+; 39 : if (ret == 0)
+
+ 00066 85 c0 test eax, eax
+ 00068 75 07 jne SHORT $LN7@gz_load
+
+; 40 : state->eof = 1;
+
+ 0006a c7 43 40 01 00
+ 00 00 mov DWORD PTR [ebx+64], 1
+$LN7@gz_load:
+ 00071 5f pop edi
+ 00072 5e pop esi
+
+; 41 : return 0;
+
+ 00073 33 c0 xor eax, eax
+ 00075 5b pop ebx
+
+; 42 : }
+
+ 00076 8b e5 mov esp, ebp
+ 00078 5d pop ebp
+ 00079 c3 ret 0
+_gz_load ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzread.c
+; COMDAT _gz_avail
+_TEXT SEGMENT
+_got$ = -4 ; size = 4
+_gz_avail PROC ; COMDAT
+; _state$ = ecx
+
+; 53 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 51 push ecx
+ 00004 56 push esi
+ 00005 8b f1 mov esi, ecx
+
+; 54 : unsigned got;
+; 55 : z_streamp strm = &(state->strm);
+; 56 :
+; 57 : if (state->err != Z_OK && state->err != Z_BUF_ERROR)
+
+ 00007 8b 46 5c mov eax, DWORD PTR [esi+92]
+ 0000a 85 c0 test eax, eax
+ 0000c 74 0d je SHORT $LN5@gz_avail
+ 0000e 83 f8 fb cmp eax, -5 ; fffffffbH
+ 00011 74 08 je SHORT $LN5@gz_avail
+$LN13@gz_avail:
+
+; 58 : return -1;
+
+ 00013 83 c8 ff or eax, -1
+ 00016 5e pop esi
+
+; 75 : }
+
+ 00017 8b e5 mov esp, ebp
+ 00019 5d pop ebp
+ 0001a c3 ret 0
+$LN5@gz_avail:
+
+; 59 : if (state->eof == 0) {
+
+ 0001b 83 7e 40 00 cmp DWORD PTR [esi+64], 0
+ 0001f 75 4c jne SHORT $LN6@gz_avail
+
+; 60 : if (strm->avail_in) { /* copy what's there to the start */
+
+ 00021 57 push edi
+ 00022 8b 7e 68 mov edi, DWORD PTR [esi+104]
+ 00025 85 ff test edi, edi
+ 00027 74 17 je SHORT $LN3@gz_avail
+
+; 61 : unsigned char *p = state->in;
+
+ 00029 8b 4e 24 mov ecx, DWORD PTR [esi+36]
+
+; 62 : unsigned const char *q = strm->next_in;
+
+ 0002c 8b 56 64 mov edx, DWORD PTR [esi+100]
+ 0002f 90 npad 1
+$LL4@gz_avail:
+
+; 63 : unsigned n = strm->avail_in;
+; 64 : do {
+; 65 : *p++ = *q++;
+
+ 00030 8a 02 mov al, BYTE PTR [edx]
+ 00032 8d 49 01 lea ecx, DWORD PTR [ecx+1]
+ 00035 88 41 ff mov BYTE PTR [ecx-1], al
+ 00038 8d 52 01 lea edx, DWORD PTR [edx+1]
+
+; 66 : } while (--n);
+
+ 0003b 83 ef 01 sub edi, 1
+ 0003e 75 f0 jne SHORT $LL4@gz_avail
+$LN3@gz_avail:
+
+; 67 : }
+; 68 : if (gz_load(state, state->in + strm->avail_in,
+; 69 : state->size - strm->avail_in, &got) == -1)
+
+ 00040 8b 56 24 mov edx, DWORD PTR [esi+36]
+ 00043 8d 45 fc lea eax, DWORD PTR _got$[ebp]
+ 00046 03 56 68 add edx, DWORD PTR [esi+104]
+ 00049 8b ce mov ecx, esi
+ 0004b 50 push eax
+ 0004c 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 0004f 2b 46 68 sub eax, DWORD PTR [esi+104]
+ 00052 50 push eax
+ 00053 e8 00 00 00 00 call _gz_load
+ 00058 83 c4 08 add esp, 8
+ 0005b 5f pop edi
+ 0005c 83 f8 ff cmp eax, -1
+ 0005f 74 b2 je SHORT $LN13@gz_avail
+
+; 70 : return -1;
+; 71 : strm->avail_in += got;
+
+ 00061 8b 45 fc mov eax, DWORD PTR _got$[ebp]
+ 00064 01 46 68 add DWORD PTR [esi+104], eax
+
+; 72 : strm->next_in = state->in;
+
+ 00067 8b 46 24 mov eax, DWORD PTR [esi+36]
+ 0006a 89 46 64 mov DWORD PTR [esi+100], eax
+$LN6@gz_avail:
+
+; 73 : }
+; 74 : return 0;
+
+ 0006d 33 c0 xor eax, eax
+ 0006f 5e pop esi
+
+; 75 : }
+
+ 00070 8b e5 mov esp, ebp
+ 00072 5d pop ebp
+ 00073 c3 ret 0
+_gz_avail ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzread.c
+; COMDAT _gz_look
+_TEXT SEGMENT
+_gz_look PROC ; COMDAT
+; _state$ = ecx
+
+; 88 : {
+
+ 00000 53 push ebx
+ 00001 56 push esi
+ 00002 57 push edi
+ 00003 8b f9 mov edi, ecx
+
+; 89 : z_streamp strm = &(state->strm);
+; 90 :
+; 91 : /* allocate read buffers and inflate memory */
+; 92 : if (state->size == 0) {
+
+ 00005 83 7f 1c 00 cmp DWORD PTR [edi+28], 0
+ 00009 8d 5f 64 lea ebx, DWORD PTR [edi+100]
+ 0000c 0f 85 ce 00 00
+ 00 jne $LN7@gz_look
+
+; 93 : /* allocate buffers */
+; 94 : state->in = (unsigned char *)malloc(state->want);
+
+ 00012 ff 77 20 push DWORD PTR [edi+32]
+ 00015 8b 35 00 00 00
+ 00 mov esi, DWORD PTR __imp__malloc
+ 0001b ff d6 call esi
+ 0001d 89 47 24 mov DWORD PTR [edi+36], eax
+
+; 95 : state->out = (unsigned char *)malloc(state->want << 1);
+
+ 00020 8b 47 20 mov eax, DWORD PTR [edi+32]
+ 00023 03 c0 add eax, eax
+ 00025 50 push eax
+ 00026 ff d6 call esi
+
+; 96 : if (state->in == NULL || state->out == NULL) {
+
+ 00028 8b 35 00 00 00
+ 00 mov esi, DWORD PTR __imp__free
+ 0002e 83 c4 08 add esp, 8
+ 00031 83 7f 24 00 cmp DWORD PTR [edi+36], 0
+ 00035 89 47 28 mov DWORD PTR [edi+40], eax
+ 00038 74 74 je SHORT $LN4@gz_look
+ 0003a 85 c0 test eax, eax
+ 0003c 74 7a je SHORT $LN5@gz_look
+
+; 103 : }
+; 104 : state->size = state->want;
+
+ 0003e 8b 47 20 mov eax, DWORD PTR [edi+32]
+
+; 105 :
+; 106 : /* allocate inflate memory */
+; 107 : state->strm.zalloc = Z_NULL;
+; 108 : state->strm.zfree = Z_NULL;
+; 109 : state->strm.opaque = Z_NULL;
+; 110 : state->strm.avail_in = 0;
+; 111 : state->strm.next_in = Z_NULL;
+; 112 : if (inflateInit2(&(state->strm), 15 + 16) != Z_OK) { /* gunzip */
+
+ 00041 6a 38 push 56 ; 00000038H
+ 00043 68 00 00 00 00 push OFFSET ??_C@_05IAIEPMAK@1?42?48?$AA@
+ 00048 6a 1f push 31 ; 0000001fH
+ 0004a 53 push ebx
+ 0004b 89 47 1c mov DWORD PTR [edi+28], eax
+ 0004e c7 87 84 00 00
+ 00 00 00 00 00 mov DWORD PTR [edi+132], 0
+ 00058 c7 87 88 00 00
+ 00 00 00 00 00 mov DWORD PTR [edi+136], 0
+ 00062 c7 87 8c 00 00
+ 00 00 00 00 00 mov DWORD PTR [edi+140], 0
+ 0006c c7 47 68 00 00
+ 00 00 mov DWORD PTR [edi+104], 0
+ 00073 c7 03 00 00 00
+ 00 mov DWORD PTR [ebx], 0
+ 00079 e8 00 00 00 00 call _inflateInit2_@16
+ 0007e 85 c0 test eax, eax
+ 00080 74 5e je SHORT $LN7@gz_look
+
+; 113 : free(state->out);
+
+ 00082 ff 77 28 push DWORD PTR [edi+40]
+ 00085 ff d6 call esi
+
+; 114 : free(state->in);
+
+ 00087 ff 77 24 push DWORD PTR [edi+36]
+ 0008a ff d6 call esi
+
+; 115 : state->size = 0;
+; 116 : gz_error(state, Z_MEM_ERROR, "out of memory");
+
+ 0008c 68 00 00 00 00 push OFFSET ??_C@_0O@BNNCBLEN@out?5of?5memory?$AA@
+ 00091 ba fc ff ff ff mov edx, -4 ; fffffffcH
+ 00096 c7 47 1c 00 00
+ 00 00 mov DWORD PTR [edi+28], 0
+ 0009d 8b cf mov ecx, edi
+ 0009f e8 00 00 00 00 call _gz_error
+ 000a4 83 c4 0c add esp, 12 ; 0000000cH
+
+; 117 : return -1;
+
+ 000a7 83 c8 ff or eax, -1
+ 000aa 5f pop edi
+ 000ab 5e pop esi
+ 000ac 5b pop ebx
+
+; 165 : }
+
+ 000ad c3 ret 0
+$LN4@gz_look:
+
+; 97 : if (state->out != NULL)
+
+ 000ae 85 c0 test eax, eax
+ 000b0 74 06 je SHORT $LN5@gz_look
+
+; 98 : free(state->out);
+
+ 000b2 50 push eax
+ 000b3 ff d6 call esi
+ 000b5 83 c4 04 add esp, 4
+$LN5@gz_look:
+
+; 99 : if (state->in != NULL)
+
+ 000b8 8b 47 24 mov eax, DWORD PTR [edi+36]
+ 000bb 85 c0 test eax, eax
+ 000bd 74 06 je SHORT $LN6@gz_look
+
+; 100 : free(state->in);
+
+ 000bf 50 push eax
+ 000c0 ff d6 call esi
+ 000c2 83 c4 04 add esp, 4
+$LN6@gz_look:
+
+; 101 : gz_error(state, Z_MEM_ERROR, "out of memory");
+
+ 000c5 68 00 00 00 00 push OFFSET ??_C@_0O@BNNCBLEN@out?5of?5memory?$AA@
+ 000ca ba fc ff ff ff mov edx, -4 ; fffffffcH
+ 000cf 8b cf mov ecx, edi
+ 000d1 e8 00 00 00 00 call _gz_error
+ 000d6 83 c4 04 add esp, 4
+$LN16@gz_look:
+
+; 102 : return -1;
+
+ 000d9 5f pop edi
+ 000da 5e pop esi
+ 000db 83 c8 ff or eax, -1
+ 000de 5b pop ebx
+
+; 165 : }
+
+ 000df c3 ret 0
+$LN7@gz_look:
+
+; 118 : }
+; 119 : }
+; 120 :
+; 121 : /* get at least the magic bytes in the input buffer */
+; 122 : if (strm->avail_in < 2) {
+
+ 000e0 8b 43 04 mov eax, DWORD PTR [ebx+4]
+ 000e3 83 f8 02 cmp eax, 2
+ 000e6 73 13 jae SHORT $LN10@gz_look
+
+; 123 : if (gz_avail(state) == -1)
+
+ 000e8 8b cf mov ecx, edi
+ 000ea e8 00 00 00 00 call _gz_avail
+ 000ef 83 f8 ff cmp eax, -1
+ 000f2 74 e5 je SHORT $LN16@gz_look
+
+; 124 : return -1;
+; 125 : if (strm->avail_in == 0)
+
+ 000f4 8b 43 04 mov eax, DWORD PTR [ebx+4]
+ 000f7 85 c0 test eax, eax
+ 000f9 74 7f je SHORT $LN15@gz_look
+$LN10@gz_look:
+
+; 126 : return 0;
+; 127 : }
+; 128 :
+; 129 : /* look for gzip magic bytes -- if there, do gzip decoding (note: there is
+; 130 : a logical dilemma here when considering the case of a partially written
+; 131 : gzip file, to wit, if a single 31 byte is written, then we cannot tell
+; 132 : whether this is a single-byte file, or just a partially written gzip
+; 133 : file -- for here we assume that if a gzip file is being written, then
+; 134 : the header will be written in a single operation, so that reading a
+; 135 : single byte is sufficient indication that it is not a gzip file) */
+; 136 : if (strm->avail_in > 1 &&
+; 137 : strm->next_in[0] == 31 && strm->next_in[1] == 139) {
+
+ 000fb 83 f8 01 cmp eax, 1
+ 000fe 76 27 jbe SHORT $LN11@gz_look
+ 00100 8b 03 mov eax, DWORD PTR [ebx]
+ 00102 80 38 1f cmp BYTE PTR [eax], 31 ; 0000001fH
+ 00105 75 20 jne SHORT $LN11@gz_look
+ 00107 80 78 01 8b cmp BYTE PTR [eax+1], 139 ; 0000008bH
+ 0010b 75 1a jne SHORT $LN11@gz_look
+
+; 138 : inflateReset(strm);
+
+ 0010d 53 push ebx
+ 0010e e8 00 00 00 00 call _inflateReset@4
+
+; 139 : state->how = GZIP;
+
+ 00113 c7 47 30 02 00
+ 00 00 mov DWORD PTR [edi+48], 2
+
+; 164 : return 0;
+
+ 0011a 33 c0 xor eax, eax
+ 0011c c7 47 2c 00 00
+ 00 00 mov DWORD PTR [edi+44], 0
+ 00123 5f pop edi
+ 00124 5e pop esi
+ 00125 5b pop ebx
+
+; 165 : }
+
+ 00126 c3 ret 0
+$LN11@gz_look:
+
+; 140 : state->direct = 0;
+; 141 : return 0;
+; 142 : }
+; 143 :
+; 144 : /* no gzip header -- if we were decoding gzip before, then this is trailing
+; 145 : garbage. Ignore the trailing garbage and finish. */
+; 146 : if (state->direct == 0) {
+
+ 00127 83 7f 2c 00 cmp DWORD PTR [edi+44], 0
+ 0012b 75 1a jne SHORT $LN12@gz_look
+
+; 147 : strm->avail_in = 0;
+
+ 0012d c7 43 04 00 00
+ 00 00 mov DWORD PTR [ebx+4], 0
+
+; 164 : return 0;
+
+ 00134 33 c0 xor eax, eax
+ 00136 c7 47 40 01 00
+ 00 00 mov DWORD PTR [edi+64], 1
+ 0013d c7 07 00 00 00
+ 00 mov DWORD PTR [edi], 0
+ 00143 5f pop edi
+ 00144 5e pop esi
+ 00145 5b pop ebx
+
+; 165 : }
+
+ 00146 c3 ret 0
+$LN12@gz_look:
+
+; 148 : state->eof = 1;
+; 149 : state->x.have = 0;
+; 150 : return 0;
+; 151 : }
+; 152 :
+; 153 : /* doing raw i/o, copy any leftover input to output -- this assumes that
+; 154 : the output buffer is larger than the input buffer, which also assures
+; 155 : space for gzungetc() */
+; 156 : state->x.next = state->out;
+
+ 00147 8b 47 28 mov eax, DWORD PTR [edi+40]
+ 0014a 89 47 04 mov DWORD PTR [edi+4], eax
+
+; 157 : if (strm->avail_in) {
+
+ 0014d 8b 4b 04 mov ecx, DWORD PTR [ebx+4]
+ 00150 85 c9 test ecx, ecx
+ 00152 74 18 je SHORT $LN13@gz_look
+
+; 158 : memcpy(state->x.next, strm->next_in, strm->avail_in);
+
+ 00154 51 push ecx
+ 00155 ff 33 push DWORD PTR [ebx]
+ 00157 50 push eax
+ 00158 e8 00 00 00 00 call _memcpy
+
+; 159 : state->x.have = strm->avail_in;
+
+ 0015d 8b 43 04 mov eax, DWORD PTR [ebx+4]
+ 00160 83 c4 0c add esp, 12 ; 0000000cH
+ 00163 89 07 mov DWORD PTR [edi], eax
+
+; 160 : strm->avail_in = 0;
+
+ 00165 c7 43 04 00 00
+ 00 00 mov DWORD PTR [ebx+4], 0
+$LN13@gz_look:
+
+; 161 : }
+; 162 : state->how = COPY;
+
+ 0016c c7 47 30 01 00
+ 00 00 mov DWORD PTR [edi+48], 1
+
+; 163 : state->direct = 1;
+
+ 00173 c7 47 2c 01 00
+ 00 00 mov DWORD PTR [edi+44], 1
+$LN15@gz_look:
+
+; 164 : return 0;
+
+ 0017a 5f pop edi
+ 0017b 5e pop esi
+ 0017c 33 c0 xor eax, eax
+ 0017e 5b pop ebx
+
+; 165 : }
+
+ 0017f c3 ret 0
+_gz_look ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzread.c
+; COMDAT _gz_decomp
+_TEXT SEGMENT
+_had$1$ = -4 ; size = 4
+_gz_decomp PROC ; COMDAT
+; _state$ = ecx
+
+; 174 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 51 push ecx
+ 00004 53 push ebx
+ 00005 8b d9 mov ebx, ecx
+
+; 175 : int ret = Z_OK;
+; 176 : unsigned had;
+; 177 : z_streamp strm = &(state->strm);
+; 178 :
+; 179 : /* fill output buffer up to end of deflate stream */
+; 180 : had = strm->avail_out;
+
+ 00007 8b 43 74 mov eax, DWORD PTR [ebx+116]
+ 0000a 56 push esi
+ 0000b 57 push edi
+ 0000c 8d 7b 64 lea edi, DWORD PTR [ebx+100]
+ 0000f 89 45 fc mov DWORD PTR _had$1$[ebp], eax
+ 00012 33 f6 xor esi, esi
+$LL4@gz_decomp:
+
+; 181 : do {
+; 182 : /* get more input for inflate() */
+; 183 : if (strm->avail_in == 0 && gz_avail(state) == -1)
+
+ 00014 83 7f 04 00 cmp DWORD PTR [edi+4], 0
+ 00018 75 16 jne SHORT $LN24@gz_decomp
+ 0001a 8b cb mov ecx, ebx
+ 0001c e8 00 00 00 00 call _gz_avail
+ 00021 83 f8 ff cmp eax, -1
+ 00024 0f 84 cb 00 00
+ 00 je $LN17@gz_decomp
+
+; 184 : return -1;
+; 185 : if (strm->avail_in == 0) {
+
+ 0002a 83 7f 04 00 cmp DWORD PTR [edi+4], 0
+ 0002e 74 33 je SHORT $LN18@gz_decomp
+$LN24@gz_decomp:
+
+; 187 : break;
+; 188 : }
+; 189 :
+; 190 : /* decompress and handle errors */
+; 191 : ret = inflate(strm, Z_NO_FLUSH);
+
+ 00030 6a 00 push 0
+ 00032 57 push edi
+ 00033 e8 00 00 00 00 call _inflate@8
+ 00038 8b f0 mov esi, eax
+
+; 192 : if (ret == Z_STREAM_ERROR || ret == Z_NEED_DICT) {
+
+ 0003a 83 fe fe cmp esi, -2 ; fffffffeH
+ 0003d 0f 84 9e 00 00
+ 00 je $LN8@gz_decomp
+ 00043 83 fe 02 cmp esi, 2
+ 00046 0f 84 95 00 00
+ 00 je $LN8@gz_decomp
+
+; 196 : }
+; 197 : if (ret == Z_MEM_ERROR) {
+
+ 0004c 83 fe fc cmp esi, -4 ; fffffffcH
+ 0004f 74 72 je SHORT $LN20@gz_decomp
+
+; 199 : return -1;
+; 200 : }
+; 201 : if (ret == Z_DATA_ERROR) { /* deflate stream invalid */
+
+ 00051 83 fe fd cmp esi, -3 ; fffffffdH
+ 00054 74 46 je SHORT $LN21@gz_decomp
+
+; 203 : strm->msg == NULL ? "compressed data error" : strm->msg);
+; 204 : return -1;
+; 205 : }
+; 206 : } while (strm->avail_out && ret != Z_STREAM_END);
+
+ 00056 83 7f 10 00 cmp DWORD PTR [edi+16], 0
+ 0005a 74 1b je SHORT $LN3@gz_decomp
+ 0005c 83 fe 01 cmp esi, 1
+ 0005f 75 b3 jne SHORT $LL4@gz_decomp
+ 00061 eb 14 jmp SHORT $LN3@gz_decomp
+$LN18@gz_decomp:
+
+; 186 : gz_error(state, Z_BUF_ERROR, "unexpected end of file");
+
+ 00063 68 00 00 00 00 push OFFSET ??_C@_0BH@CFIIDOJD@unexpected?5end?5of?5file?$AA@
+ 00068 ba fb ff ff ff mov edx, -5 ; fffffffbH
+ 0006d 8b cb mov ecx, ebx
+ 0006f e8 00 00 00 00 call _gz_error
+ 00074 83 c4 04 add esp, 4
+$LN3@gz_decomp:
+
+; 207 :
+; 208 : /* update available output */
+; 209 : state->x.have = had - strm->avail_out;
+
+ 00077 8b 4d fc mov ecx, DWORD PTR _had$1$[ebp]
+ 0007a 2b 4f 10 sub ecx, DWORD PTR [edi+16]
+ 0007d 89 0b mov DWORD PTR [ebx], ecx
+
+; 210 : state->x.next = strm->next_out - state->x.have;
+
+ 0007f 8b 47 0c mov eax, DWORD PTR [edi+12]
+ 00082 2b c1 sub eax, ecx
+ 00084 89 43 04 mov DWORD PTR [ebx+4], eax
+
+; 211 :
+; 212 : /* if the gzip stream completed successfully, look for another */
+; 213 : if (ret == Z_STREAM_END)
+
+ 00087 83 fe 01 cmp esi, 1
+ 0008a 75 07 jne SHORT $LN12@gz_decomp
+
+; 214 : state->how = LOOK;
+
+ 0008c c7 43 30 00 00
+ 00 00 mov DWORD PTR [ebx+48], 0
+$LN12@gz_decomp:
+ 00093 5f pop edi
+ 00094 5e pop esi
+
+; 215 :
+; 216 : /* good decompression */
+; 217 : return 0;
+
+ 00095 33 c0 xor eax, eax
+ 00097 5b pop ebx
+
+; 218 : }
+
+ 00098 8b e5 mov esp, ebp
+ 0009a 5d pop ebp
+ 0009b c3 ret 0
+$LN21@gz_decomp:
+
+; 202 : gz_error(state, Z_DATA_ERROR,
+
+ 0009c 8b 47 18 mov eax, DWORD PTR [edi+24]
+ 0009f b9 00 00 00 00 mov ecx, OFFSET ??_C@_0BG@HCKBMIHF@compressed?5data?5error?$AA@
+ 000a4 85 c0 test eax, eax
+ 000a6 ba fd ff ff ff mov edx, -3 ; fffffffdH
+ 000ab 0f 45 c8 cmovne ecx, eax
+ 000ae 51 push ecx
+ 000af 8b cb mov ecx, ebx
+ 000b1 e8 00 00 00 00 call _gz_error
+ 000b6 83 c4 04 add esp, 4
+ 000b9 83 c8 ff or eax, -1
+ 000bc 5f pop edi
+ 000bd 5e pop esi
+ 000be 5b pop ebx
+
+; 218 : }
+
+ 000bf 8b e5 mov esp, ebp
+ 000c1 5d pop ebp
+ 000c2 c3 ret 0
+$LN20@gz_decomp:
+
+; 198 : gz_error(state, Z_MEM_ERROR, "out of memory");
+
+ 000c3 68 00 00 00 00 push OFFSET ??_C@_0O@BNNCBLEN@out?5of?5memory?$AA@
+ 000c8 ba fc ff ff ff mov edx, -4 ; fffffffcH
+ 000cd 8b cb mov ecx, ebx
+ 000cf e8 00 00 00 00 call _gz_error
+ 000d4 83 c4 04 add esp, 4
+ 000d7 83 c8 ff or eax, -1
+ 000da 5f pop edi
+ 000db 5e pop esi
+ 000dc 5b pop ebx
+
+; 218 : }
+
+ 000dd 8b e5 mov esp, ebp
+ 000df 5d pop ebp
+ 000e0 c3 ret 0
+$LN8@gz_decomp:
+
+; 193 : gz_error(state, Z_STREAM_ERROR,
+
+ 000e1 68 00 00 00 00 push OFFSET ??_C@_0CH@CPOLIEKA@internal?5error?3?5inflate?5stream?5c@
+ 000e6 ba fe ff ff ff mov edx, -2 ; fffffffeH
+ 000eb 8b cb mov ecx, ebx
+ 000ed e8 00 00 00 00 call _gz_error
+ 000f2 83 c4 04 add esp, 4
+$LN17@gz_decomp:
+
+; 194 : "internal error: inflate stream corrupt");
+; 195 : return -1;
+
+ 000f5 5f pop edi
+ 000f6 5e pop esi
+ 000f7 83 c8 ff or eax, -1
+ 000fa 5b pop ebx
+
+; 218 : }
+
+ 000fb 8b e5 mov esp, ebp
+ 000fd 5d pop ebp
+ 000fe c3 ret 0
+_gz_decomp ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzread.c
+; COMDAT _gz_fetch
+_TEXT SEGMENT
+_gz_fetch PROC ; COMDAT
+; _state$ = ecx
+
+; 228 : {
+
+ 00000 56 push esi
+ 00001 8b f1 mov esi, ecx
+$LL4@gz_fetch:
+
+; 229 : z_streamp strm = &(state->strm);
+; 230 :
+; 231 : do {
+; 232 : switch(state->how) {
+
+ 00003 8b 46 30 mov eax, DWORD PTR [esi+48]
+ 00006 83 e8 00 sub eax, 0
+ 00009 74 29 je SHORT $LN7@gz_fetch
+ 0000b 83 e8 01 sub eax, 1
+ 0000e 74 4b je SHORT $LN10@gz_fetch
+ 00010 83 e8 01 sub eax, 1
+ 00013 75 31 jne SHORT $LN2@gz_fetch
+
+; 245 : case GZIP: /* -> GZIP or LOOK (if end of gzip stream) */
+; 246 : strm->avail_out = state->size << 1;
+
+ 00015 8b 46 1c mov eax, DWORD PTR [esi+28]
+
+; 247 : strm->next_out = state->out;
+; 248 : if (gz_decomp(state) == -1)
+
+ 00018 8b ce mov ecx, esi
+ 0001a 03 c0 add eax, eax
+ 0001c 89 46 74 mov DWORD PTR [esi+116], eax
+ 0001f 8b 46 28 mov eax, DWORD PTR [esi+40]
+ 00022 89 46 70 mov DWORD PTR [esi+112], eax
+ 00025 e8 00 00 00 00 call _gz_decomp
+ 0002a 83 f8 ff cmp eax, -1
+ 0002d 75 17 jne SHORT $LN2@gz_fetch
+$LN19@gz_fetch:
+
+; 235 : return -1;
+
+ 0002f 83 c8 ff or eax, -1
+ 00032 5e pop esi
+
+; 252 : return 0;
+; 253 : }
+
+ 00033 c3 ret 0
+$LN7@gz_fetch:
+
+; 233 : case LOOK: /* -> LOOK, COPY (only if never GZIP), or GZIP */
+; 234 : if (gz_look(state) == -1)
+
+ 00034 8b ce mov ecx, esi
+ 00036 e8 00 00 00 00 call _gz_look
+ 0003b 83 f8 ff cmp eax, -1
+ 0003e 74 ef je SHORT $LN19@gz_fetch
+
+; 236 : if (state->how == LOOK)
+
+ 00040 83 7e 30 00 cmp DWORD PTR [esi+48], 0
+ 00044 74 34 je SHORT $LN20@gz_fetch
+$LN2@gz_fetch:
+
+; 249 : return -1;
+; 250 : }
+; 251 : } while (state->x.have == 0 && (!state->eof || strm->avail_in));
+
+ 00046 83 3e 00 cmp DWORD PTR [esi], 0
+ 00049 75 2f jne SHORT $LN20@gz_fetch
+ 0004b 83 7e 40 00 cmp DWORD PTR [esi+64], 0
+ 0004f 74 b2 je SHORT $LL4@gz_fetch
+ 00051 83 7e 68 00 cmp DWORD PTR [esi+104], 0
+ 00055 75 ac jne SHORT $LL4@gz_fetch
+
+; 244 : return 0;
+
+ 00057 33 c0 xor eax, eax
+ 00059 5e pop esi
+
+; 252 : return 0;
+; 253 : }
+
+ 0005a c3 ret 0
+$LN10@gz_fetch:
+
+; 237 : return 0;
+; 238 : break;
+; 239 : case COPY: /* -> COPY */
+; 240 : if (gz_load(state, state->out, state->size << 1, &(state->x.have))
+; 241 : == -1)
+
+ 0005b 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 0005e 8b ce mov ecx, esi
+ 00060 8b 56 28 mov edx, DWORD PTR [esi+40]
+ 00063 03 c0 add eax, eax
+ 00065 56 push esi
+ 00066 50 push eax
+ 00067 e8 00 00 00 00 call _gz_load
+ 0006c 83 c4 08 add esp, 8
+ 0006f 83 f8 ff cmp eax, -1
+ 00072 74 bb je SHORT $LN19@gz_fetch
+
+; 242 : return -1;
+; 243 : state->x.next = state->out;
+
+ 00074 8b 46 28 mov eax, DWORD PTR [esi+40]
+ 00077 89 46 04 mov DWORD PTR [esi+4], eax
+$LN20@gz_fetch:
+
+; 244 : return 0;
+
+ 0007a 33 c0 xor eax, eax
+ 0007c 5e pop esi
+
+; 252 : return 0;
+; 253 : }
+
+ 0007d c3 ret 0
+_gz_fetch ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzread.c
+; COMDAT _gz_skip
+_TEXT SEGMENT
+_len$ = 8 ; size = 8
+_gz_skip PROC ; COMDAT
+; _state$ = ecx
+
+; 259 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 53 push ebx
+
+; 260 : unsigned n;
+; 261 :
+; 262 : /* skip over len bytes or reach end-of-file, whichever comes first */
+; 263 : while (len)
+
+ 00004 8b 5d 0c mov ebx, DWORD PTR _len$[ebp+4]
+ 00007 56 push esi
+ 00008 57 push edi
+ 00009 8b 7d 08 mov edi, DWORD PTR _len$[ebp]
+ 0000c 8b f1 mov esi, ecx
+ 0000e 8b c7 mov eax, edi
+ 00010 0b c3 or eax, ebx
+ 00012 74 4b je SHORT $LN3@gz_skip
+$LL2@gz_skip:
+
+; 264 : /* skip over whatever is in output buffer */
+; 265 : if (state->x.have) {
+
+ 00014 8b 06 mov eax, DWORD PTR [esi]
+ 00016 85 c0 test eax, eax
+ 00018 74 27 je SHORT $LN4@gz_skip
+
+; 266 : n = GT_OFF(state->x.have) || (z_off64_t)state->x.have > len ?
+
+ 0001a 33 c9 xor ecx, ecx
+ 0001c 3b cb cmp ecx, ebx
+ 0001e 7f 0a jg SHORT $LN10@gz_skip
+ 00020 7c 04 jl SHORT $LN17@gz_skip
+ 00022 3b c7 cmp eax, edi
+ 00024 77 04 ja SHORT $LN10@gz_skip
+$LN17@gz_skip:
+ 00026 8b c8 mov ecx, eax
+ 00028 eb 02 jmp SHORT $LN11@gz_skip
+$LN10@gz_skip:
+ 0002a 8b cf mov ecx, edi
+$LN11@gz_skip:
+
+; 267 : (unsigned)len : state->x.have;
+; 268 : state->x.have -= n;
+; 269 : state->x.next += n;
+
+ 0002c 01 4e 04 add DWORD PTR [esi+4], ecx
+ 0002f 2b c1 sub eax, ecx
+
+; 270 : state->x.pos += n;
+
+ 00031 01 4e 08 add DWORD PTR [esi+8], ecx
+ 00034 89 06 mov DWORD PTR [esi], eax
+ 00036 83 56 0c 00 adc DWORD PTR [esi+12], 0
+
+; 271 : len -= n;
+
+ 0003a 2b f9 sub edi, ecx
+ 0003c 83 db 00 sbb ebx, 0
+
+; 272 : }
+
+ 0003f eb 18 jmp SHORT $LN8@gz_skip
+$LN4@gz_skip:
+
+; 273 :
+; 274 : /* output buffer empty -- return if we're at the end of the input */
+; 275 : else if (state->eof && state->strm.avail_in == 0)
+
+ 00041 83 7e 40 00 cmp DWORD PTR [esi+64], 0
+ 00045 74 06 je SHORT $LN6@gz_skip
+ 00047 83 7e 68 00 cmp DWORD PTR [esi+104], 0
+ 0004b 74 12 je SHORT $LN3@gz_skip
+$LN6@gz_skip:
+
+; 276 : break;
+; 277 :
+; 278 : /* need more data to skip -- load up output buffer */
+; 279 : else {
+; 280 : /* get more output, looking for header if required */
+; 281 : if (gz_fetch(state) == -1)
+
+ 0004d 8b ce mov ecx, esi
+ 0004f e8 00 00 00 00 call _gz_fetch
+ 00054 83 f8 ff cmp eax, -1
+ 00057 74 0d je SHORT $LN14@gz_skip
+$LN8@gz_skip:
+
+; 260 : unsigned n;
+; 261 :
+; 262 : /* skip over len bytes or reach end-of-file, whichever comes first */
+; 263 : while (len)
+
+ 00059 8b c7 mov eax, edi
+ 0005b 0b c3 or eax, ebx
+ 0005d 75 b5 jne SHORT $LL2@gz_skip
+$LN3@gz_skip:
+ 0005f 5f pop edi
+ 00060 5e pop esi
+
+; 283 : }
+; 284 : return 0;
+
+ 00061 33 c0 xor eax, eax
+ 00063 5b pop ebx
+
+; 285 : }
+
+ 00064 5d pop ebp
+ 00065 c3 ret 0
+$LN14@gz_skip:
+ 00066 5f pop edi
+ 00067 5e pop esi
+
+; 282 : return -1;
+
+ 00068 83 c8 ff or eax, -1
+ 0006b 5b pop ebx
+
+; 285 : }
+
+ 0006c 5d pop ebp
+ 0006d c3 ret 0
+_gz_skip ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzread.c
+; COMDAT _gzread@12
+_TEXT SEGMENT
+_n$ = 8 ; size = 4
+_file$ = 8 ; size = 4
+_buf$ = 12 ; size = 4
+_got$1$ = 16 ; size = 4
+_len$ = 16 ; size = 4
+_gzread@12 PROC ; COMDAT
+
+; 292 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 56 push esi
+
+; 293 : unsigned got, n;
+; 294 : gz_statep state;
+; 295 : z_streamp strm;
+; 296 :
+; 297 : /* get internal structure */
+; 298 : if (file == NULL)
+
+ 00004 8b 75 08 mov esi, DWORD PTR _file$[ebp]
+ 00007 85 f6 test esi, esi
+ 00009 75 08 jne SHORT $LN5@gzread
+$LN7@gzread:
+
+; 299 : return -1;
+
+ 0000b 83 c8 ff or eax, -1
+ 0000e 5e pop esi
+
+; 376 :
+; 377 : /* return number of bytes read into user buffer (will fit in int) */
+; 378 : return (int)got;
+; 379 : }
+
+ 0000f 5d pop ebp
+ 00010 c2 0c 00 ret 12 ; 0000000cH
+$LN5@gzread:
+
+; 300 : state = (gz_statep)file;
+; 301 : strm = &(state->strm);
+; 302 :
+; 303 : /* check that we're reading and that there's no (serious) error */
+; 304 : if (state->mode != GZ_READ ||
+
+ 00013 81 7e 10 4f 1c
+ 00 00 cmp DWORD PTR [esi+16], 7247 ; 00001c4fH
+ 0001a 75 ef jne SHORT $LN7@gzread
+ 0001c 8b 46 5c mov eax, DWORD PTR [esi+92]
+ 0001f 85 c0 test eax, eax
+ 00021 74 05 je SHORT $LN6@gzread
+ 00023 83 f8 fb cmp eax, -5 ; fffffffbH
+ 00026 75 e3 jne SHORT $LN7@gzread
+$LN6@gzread:
+ 00028 53 push ebx
+
+; 305 : (state->err != Z_OK && state->err != Z_BUF_ERROR))
+; 306 : return -1;
+; 307 :
+; 308 : /* since an int is returned, make sure len fits in one, otherwise return
+; 309 : with an error (this avoids the flaw in the interface) */
+; 310 : if ((int)len < 0) {
+
+ 00029 8b 5d 10 mov ebx, DWORD PTR _len$[ebp]
+ 0002c 85 db test ebx, ebx
+ 0002e 79 1d jns SHORT $LN36@gzread
+
+; 311 : gz_error(state, Z_DATA_ERROR, "requested length does not fit in int");
+
+ 00030 68 00 00 00 00 push OFFSET ??_C@_0CF@MLPJFDMM@requested?5length?5does?5not?5fit?5in@
+ 00035 ba fd ff ff ff mov edx, -3 ; fffffffdH
+ 0003a 8b ce mov ecx, esi
+ 0003c e8 00 00 00 00 call _gz_error
+ 00041 83 c4 04 add esp, 4
+$LN37@gzread:
+
+; 312 : return -1;
+
+ 00044 5b pop ebx
+ 00045 83 c8 ff or eax, -1
+ 00048 5e pop esi
+
+; 376 :
+; 377 : /* return number of bytes read into user buffer (will fit in int) */
+; 378 : return (int)got;
+; 379 : }
+
+ 00049 5d pop ebp
+ 0004a c2 0c 00 ret 12 ; 0000000cH
+$LN36@gzread:
+
+; 313 : }
+; 314 :
+; 315 : /* if len is zero, avoid unnecessary operations */
+; 316 : if (len == 0)
+
+ 0004d 75 08 jne SHORT $LN9@gzread
+
+; 317 : return 0;
+
+ 0004f 5b pop ebx
+ 00050 33 c0 xor eax, eax
+ 00052 5e pop esi
+
+; 376 :
+; 377 : /* return number of bytes read into user buffer (will fit in int) */
+; 378 : return (int)got;
+; 379 : }
+
+ 00053 5d pop ebp
+ 00054 c2 0c 00 ret 12 ; 0000000cH
+$LN9@gzread:
+
+; 318 :
+; 319 : /* process a skip request */
+; 320 : if (state->seek) {
+
+ 00057 83 7e 58 00 cmp DWORD PTR [esi+88], 0
+ 0005b 74 1c je SHORT $LN11@gzread
+
+; 321 : state->seek = 0;
+; 322 : if (gz_skip(state, state->skip) == -1)
+
+ 0005d ff 76 54 push DWORD PTR [esi+84]
+ 00060 8b ce mov ecx, esi
+ 00062 c7 46 58 00 00
+ 00 00 mov DWORD PTR [esi+88], 0
+ 00069 ff 76 50 push DWORD PTR [esi+80]
+ 0006c e8 00 00 00 00 call _gz_skip
+ 00071 83 c4 08 add esp, 8
+ 00074 83 f8 ff cmp eax, -1
+ 00077 74 cb je SHORT $LN37@gzread
+$LN11@gzread:
+
+; 323 : return -1;
+; 324 : }
+; 325 :
+; 326 : /* get len bytes to buf, or less than len if at the end */
+; 327 : got = 0;
+
+ 00079 33 c0 xor eax, eax
+ 0007b 89 45 10 mov DWORD PTR _got$1$[ebp], eax
+ 0007e 57 push edi
+ 0007f 90 npad 1
+$LL4@gzread:
+
+; 328 : do {
+; 329 : /* first just try copying data from the output buffer */
+; 330 : if (state->x.have) {
+
+ 00080 8b 3e mov edi, DWORD PTR [esi]
+ 00082 85 ff test edi, edi
+ 00084 74 1f je SHORT $LN12@gzread
+
+; 331 : n = state->x.have > len ? len : state->x.have;
+; 332 : memcpy(buf, state->x.next, n);
+
+ 00086 8b 45 0c mov eax, DWORD PTR _buf$[ebp]
+ 00089 3b fb cmp edi, ebx
+ 0008b 0f 47 fb cmova edi, ebx
+ 0008e 57 push edi
+ 0008f ff 76 04 push DWORD PTR [esi+4]
+ 00092 89 7d 08 mov DWORD PTR _n$[ebp], edi
+ 00095 50 push eax
+ 00096 e8 00 00 00 00 call _memcpy
+
+; 333 : state->x.next += n;
+
+ 0009b 01 7e 04 add DWORD PTR [esi+4], edi
+ 0009e 83 c4 0c add esp, 12 ; 0000000cH
+
+; 334 : state->x.have -= n;
+
+ 000a1 29 3e sub DWORD PTR [esi], edi
+
+; 335 : }
+
+ 000a3 eb 5f jmp SHORT $LN21@gzread
+$LN12@gzread:
+
+; 336 :
+; 337 : /* output buffer empty -- return if we're at the end of the input */
+; 338 : else if (state->eof && strm->avail_in == 0) {
+
+ 000a5 83 7e 40 00 cmp DWORD PTR [esi+64], 0
+ 000a9 74 0a je SHORT $LN14@gzread
+ 000ab 83 7e 68 00 cmp DWORD PTR [esi+104], 0
+ 000af 0f 84 83 00 00
+ 00 je $LN28@gzread
+$LN14@gzread:
+
+; 340 : break;
+; 341 : }
+; 342 :
+; 343 : /* need output data -- for small len or new stream load up our output
+; 344 : buffer */
+; 345 : else if (state->how == LOOK || len < (state->size << 1)) {
+
+ 000b5 8b 4e 30 mov ecx, DWORD PTR [esi+48]
+ 000b8 85 c9 test ecx, ecx
+ 000ba 74 5e je SHORT $LN18@gzread
+ 000bc 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 000bf 03 c0 add eax, eax
+ 000c1 3b d8 cmp ebx, eax
+ 000c3 72 55 jb SHORT $LN18@gzread
+
+; 349 : continue; /* no progress yet -- go back to copy above */
+; 350 : /* the copy above assures that we will leave with space in the
+; 351 : output buffer, allowing at least one gzungetc() to succeed */
+; 352 : }
+; 353 :
+; 354 : /* large len -- read directly into user buffer */
+; 355 : else if (state->how == COPY) { /* read directly */
+
+ 000c5 83 f9 01 cmp ecx, 1
+
+; 356 : if (gz_load(state, (unsigned char *)buf, len, &n) == -1)
+
+ 000c8 8b ce mov ecx, esi
+ 000ca 75 1a jne SHORT $LN20@gzread
+ 000cc 8b 55 0c mov edx, DWORD PTR _buf$[ebp]
+ 000cf 8d 45 08 lea eax, DWORD PTR _n$[ebp]
+ 000d2 50 push eax
+ 000d3 53 push ebx
+ 000d4 e8 00 00 00 00 call _gz_load
+ 000d9 83 c4 08 add esp, 8
+ 000dc 83 f8 ff cmp eax, -1
+ 000df 74 65 je SHORT $LN31@gzread
+
+; 357 : return -1;
+; 358 : }
+
+ 000e1 8b 7d 08 mov edi, DWORD PTR _n$[ebp]
+ 000e4 eb 1e jmp SHORT $LN21@gzread
+$LN20@gzread:
+
+; 359 :
+; 360 : /* large len -- decompress directly into user buffer */
+; 361 : else { /* state->how == GZIP */
+; 362 : strm->avail_out = len;
+; 363 : strm->next_out = (unsigned char *)buf;
+
+ 000e6 8b 45 0c mov eax, DWORD PTR _buf$[ebp]
+ 000e9 89 5e 74 mov DWORD PTR [esi+116], ebx
+ 000ec 89 46 70 mov DWORD PTR [esi+112], eax
+
+; 364 : if (gz_decomp(state) == -1)
+
+ 000ef e8 00 00 00 00 call _gz_decomp
+ 000f4 83 f8 ff cmp eax, -1
+ 000f7 74 4d je SHORT $LN31@gzread
+
+; 365 : return -1;
+; 366 : n = state->x.have;
+
+ 000f9 8b 3e mov edi, DWORD PTR [esi]
+ 000fb 89 7d 08 mov DWORD PTR _n$[ebp], edi
+
+; 367 : state->x.have = 0;
+
+ 000fe c7 06 00 00 00
+ 00 mov DWORD PTR [esi], 0
+$LN21@gzread:
+
+; 368 : }
+; 369 :
+; 370 : /* update progress */
+; 371 : len -= n;
+; 372 : buf = (char *)buf + n;
+; 373 : got += n;
+
+ 00104 8b 45 10 mov eax, DWORD PTR _got$1$[ebp]
+ 00107 2b df sub ebx, edi
+ 00109 01 7d 0c add DWORD PTR _buf$[ebp], edi
+ 0010c 03 c7 add eax, edi
+
+; 374 : state->x.pos += n;
+
+ 0010e 01 7e 08 add DWORD PTR [esi+8], edi
+ 00111 89 45 10 mov DWORD PTR _got$1$[ebp], eax
+ 00114 83 56 0c 00 adc DWORD PTR [esi+12], 0
+ 00118 eb 0f jmp SHORT $LN2@gzread
+$LN18@gzread:
+
+; 346 : /* get more output, looking for header if required */
+; 347 : if (gz_fetch(state) == -1)
+
+ 0011a 8b ce mov ecx, esi
+ 0011c e8 00 00 00 00 call _gz_fetch
+ 00121 83 f8 ff cmp eax, -1
+ 00124 74 20 je SHORT $LN31@gzread
+ 00126 8b 45 10 mov eax, DWORD PTR _got$1$[ebp]
+$LN2@gzread:
+
+; 375 : } while (len);
+
+ 00129 85 db test ebx, ebx
+ 0012b 0f 85 4f ff ff
+ ff jne $LL4@gzread
+ 00131 5f pop edi
+ 00132 5b pop ebx
+ 00133 5e pop esi
+
+; 376 :
+; 377 : /* return number of bytes read into user buffer (will fit in int) */
+; 378 : return (int)got;
+; 379 : }
+
+ 00134 5d pop ebp
+ 00135 c2 0c 00 ret 12 ; 0000000cH
+$LN28@gzread:
+ 00138 5f pop edi
+ 00139 5b pop ebx
+
+; 339 : state->past = 1; /* tried to read past end */
+
+ 0013a c7 46 44 01 00
+ 00 00 mov DWORD PTR [esi+68], 1
+ 00141 5e pop esi
+
+; 376 :
+; 377 : /* return number of bytes read into user buffer (will fit in int) */
+; 378 : return (int)got;
+; 379 : }
+
+ 00142 5d pop ebp
+ 00143 c2 0c 00 ret 12 ; 0000000cH
+$LN31@gzread:
+ 00146 5f pop edi
+ 00147 5b pop ebx
+
+; 348 : return -1;
+
+ 00148 83 c8 ff or eax, -1
+ 0014b 5e pop esi
+
+; 376 :
+; 377 : /* return number of bytes read into user buffer (will fit in int) */
+; 378 : return (int)got;
+; 379 : }
+
+ 0014c 5d pop ebp
+ 0014d c2 0c 00 ret 12 ; 0000000cH
+_gzread@12 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzread.c
+; COMDAT _gzgetc@4
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_buf$ = 11 ; size = 1
+_gzgetc@4 PROC ; COMDAT
+
+; 389 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 390 : int ret;
+; 391 : unsigned char buf[1];
+; 392 : gz_statep state;
+; 393 :
+; 394 : /* get internal structure */
+; 395 : if (file == NULL)
+
+ 00003 8b 55 08 mov edx, DWORD PTR _file$[ebp]
+ 00006 85 d2 test edx, edx
+ 00008 74 4f je SHORT $LN4@gzgetc
+
+; 396 : return -1;
+; 397 : state = (gz_statep)file;
+; 398 :
+; 399 : /* check that we're reading and that there's no (serious) error */
+; 400 : if (state->mode != GZ_READ ||
+
+ 0000a 81 7a 10 4f 1c
+ 00 00 cmp DWORD PTR [edx+16], 7247 ; 00001c4fH
+ 00011 75 46 jne SHORT $LN4@gzgetc
+ 00013 8b 42 5c mov eax, DWORD PTR [edx+92]
+ 00016 85 c0 test eax, eax
+ 00018 74 05 je SHORT $LN3@gzgetc
+ 0001a 83 f8 fb cmp eax, -5 ; fffffffbH
+ 0001d 75 3a jne SHORT $LN4@gzgetc
+$LN3@gzgetc:
+
+; 403 :
+; 404 : /* try output buffer (no need to check for skip request) */
+; 405 : if (state->x.have) {
+
+ 0001f 8b 02 mov eax, DWORD PTR [edx]
+ 00021 85 c0 test eax, eax
+ 00023 74 1b je SHORT $LN5@gzgetc
+
+; 406 : state->x.have--;
+
+ 00025 48 dec eax
+
+; 407 : state->x.pos++;
+
+ 00026 83 42 08 01 add DWORD PTR [edx+8], 1
+ 0002a 89 02 mov DWORD PTR [edx], eax
+
+; 408 : return *(state->x.next)++;
+
+ 0002c 8b 42 04 mov eax, DWORD PTR [edx+4]
+ 0002f 83 52 0c 00 adc DWORD PTR [edx+12], 0
+ 00033 8a 08 mov cl, BYTE PTR [eax]
+ 00035 40 inc eax
+ 00036 89 42 04 mov DWORD PTR [edx+4], eax
+ 00039 0f b6 c1 movzx eax, cl
+
+; 414 : }
+
+ 0003c 5d pop ebp
+ 0003d c2 04 00 ret 4
+$LN5@gzgetc:
+
+; 409 : }
+; 410 :
+; 411 : /* nothing there -- try gzread() */
+; 412 : ret = gzread(file, buf, 1);
+
+ 00040 6a 01 push 1
+ 00042 8d 45 0b lea eax, DWORD PTR _buf$[ebp]
+ 00045 50 push eax
+ 00046 52 push edx
+ 00047 e8 00 00 00 00 call _gzread@12
+
+; 413 : return ret < 1 ? -1 : buf[0];
+
+ 0004c 83 f8 01 cmp eax, 1
+ 0004f 7c 08 jl SHORT $LN4@gzgetc
+ 00051 0f b6 45 0b movzx eax, BYTE PTR _buf$[ebp]
+
+; 414 : }
+
+ 00055 5d pop ebp
+ 00056 c2 04 00 ret 4
+$LN4@gzgetc:
+
+; 401 : (state->err != Z_OK && state->err != Z_BUF_ERROR))
+; 402 : return -1;
+
+ 00059 83 c8 ff or eax, -1
+
+; 414 : }
+
+ 0005c 5d pop ebp
+ 0005d c2 04 00 ret 4
+_gzgetc@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzread.c
+; COMDAT _gzgetc_@4
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_gzgetc_@4 PROC ; COMDAT
+
+; 418 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 420 : }
+
+ 00003 5d pop ebp
+
+; 419 : return gzgetc(file);
+
+ 00004 e9 00 00 00 00 jmp _gzgetc@4
+_gzgetc_@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzread.c
+; COMDAT _gzungetc@8
+_TEXT SEGMENT
+_c$ = 8 ; size = 4
+_file$ = 12 ; size = 4
+_gzungetc@8 PROC ; COMDAT
+
+; 426 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 56 push esi
+
+; 427 : gz_statep state;
+; 428 :
+; 429 : /* get internal structure */
+; 430 : if (file == NULL)
+
+ 00004 8b 75 0c mov esi, DWORD PTR _file$[ebp]
+ 00007 85 f6 test esi, esi
+ 00009 75 08 jne SHORT $LN4@gzungetc
+$LN21@gzungetc:
+
+; 431 : return -1;
+
+ 0000b 83 c8 ff or eax, -1
+ 0000e 5e pop esi
+
+; 480 : }
+
+ 0000f 5d pop ebp
+ 00010 c2 08 00 ret 8
+$LN4@gzungetc:
+
+; 432 : state = (gz_statep)file;
+; 433 :
+; 434 : /* check that we're reading and that there's no (serious) error */
+; 435 : if (state->mode != GZ_READ ||
+
+ 00013 81 7e 10 4f 1c
+ 00 00 cmp DWORD PTR [esi+16], 7247 ; 00001c4fH
+ 0001a 75 ef jne SHORT $LN21@gzungetc
+ 0001c 8b 46 5c mov eax, DWORD PTR [esi+92]
+ 0001f 85 c0 test eax, eax
+ 00021 74 05 je SHORT $LN5@gzungetc
+ 00023 83 f8 fb cmp eax, -5 ; fffffffbH
+ 00026 75 e3 jne SHORT $LN21@gzungetc
+$LN5@gzungetc:
+
+; 436 : (state->err != Z_OK && state->err != Z_BUF_ERROR))
+; 437 : return -1;
+; 438 :
+; 439 : /* process a skip request */
+; 440 : if (state->seek) {
+
+ 00028 83 7e 58 00 cmp DWORD PTR [esi+88], 0
+ 0002c 74 1c je SHORT $LN8@gzungetc
+
+; 441 : state->seek = 0;
+; 442 : if (gz_skip(state, state->skip) == -1)
+
+ 0002e ff 76 54 push DWORD PTR [esi+84]
+ 00031 8b ce mov ecx, esi
+ 00033 c7 46 58 00 00
+ 00 00 mov DWORD PTR [esi+88], 0
+ 0003a ff 76 50 push DWORD PTR [esi+80]
+ 0003d e8 00 00 00 00 call _gz_skip
+ 00042 83 c4 08 add esp, 8
+ 00045 83 f8 ff cmp eax, -1
+ 00048 74 c1 je SHORT $LN21@gzungetc
+$LN8@gzungetc:
+ 0004a 53 push ebx
+
+; 443 : return -1;
+; 444 : }
+; 445 :
+; 446 : /* can't push EOF */
+; 447 : if (c < 0)
+
+ 0004b 8b 5d 08 mov ebx, DWORD PTR _c$[ebp]
+ 0004e 85 db test ebx, ebx
+ 00050 78 38 js SHORT $LN20@gzungetc
+
+; 448 : return -1;
+; 449 :
+; 450 : /* if output buffer empty, put byte at end (allows more pushing) */
+; 451 : if (state->x.have == 0) {
+
+ 00052 8b 0e mov ecx, DWORD PTR [esi]
+
+; 452 : state->x.have = 1;
+; 453 : state->x.next = state->out + (state->size << 1) - 1;
+
+ 00054 8b 56 1c mov edx, DWORD PTR [esi+28]
+ 00057 85 c9 test ecx, ecx
+ 00059 75 14 jne SHORT $LN10@gzungetc
+ 0005b 8b 4e 28 mov ecx, DWORD PTR [esi+40]
+ 0005e c7 06 01 00 00
+ 00 mov DWORD PTR [esi], 1
+ 00064 8d 0c 51 lea ecx, DWORD PTR [ecx+edx*2]
+ 00067 49 dec ecx
+ 00068 89 4e 04 mov DWORD PTR [esi+4], ecx
+
+; 454 : state->x.next[0] = c;
+
+ 0006b 88 19 mov BYTE PTR [ecx], bl
+
+; 455 : state->x.pos--;
+; 456 : state->past = 0;
+; 457 : return c;
+
+ 0006d eb 4e jmp SHORT $LN19@gzungetc
+$LN10@gzungetc:
+
+; 458 : }
+; 459 :
+; 460 : /* if no room, give up (must have already done a gzungetc()) */
+; 461 : if (state->x.have == (state->size << 1)) {
+
+ 0006f 8d 04 12 lea eax, DWORD PTR [edx+edx]
+ 00072 3b c8 cmp ecx, eax
+ 00074 75 1d jne SHORT $LN11@gzungetc
+
+; 462 : gz_error(state, Z_DATA_ERROR, "out of room to push characters");
+
+ 00076 68 00 00 00 00 push OFFSET ??_C@_0BP@IIKIGMCC@out?5of?5room?5to?5push?5characters?$AA@
+ 0007b ba fd ff ff ff mov edx, -3 ; fffffffdH
+ 00080 8b ce mov ecx, esi
+ 00082 e8 00 00 00 00 call _gz_error
+ 00087 83 c4 04 add esp, 4
+$LN20@gzungetc:
+
+; 463 : return -1;
+
+ 0008a 5b pop ebx
+ 0008b 83 c8 ff or eax, -1
+ 0008e 5e pop esi
+
+; 480 : }
+
+ 0008f 5d pop ebp
+ 00090 c2 08 00 ret 8
+$LN11@gzungetc:
+
+; 464 : }
+; 465 :
+; 466 : /* slide output data if needed and insert byte before existing data */
+; 467 : if (state->x.next == state->out) {
+
+ 00093 8b 46 28 mov eax, DWORD PTR [esi+40]
+ 00096 39 46 04 cmp DWORD PTR [esi+4], eax
+ 00099 75 18 jne SHORT $LN12@gzungetc
+
+; 468 : unsigned char *src = state->out + state->x.have;
+
+ 0009b 03 c8 add ecx, eax
+
+; 469 : unsigned char *dest = state->out + (state->size << 1);
+
+ 0009d 8d 14 50 lea edx, DWORD PTR [eax+edx*2]
+
+; 470 : while (src > state->out)
+
+ 000a0 3b c8 cmp ecx, eax
+ 000a2 76 0c jbe SHORT $LN3@gzungetc
+$LL2@gzungetc:
+
+; 471 : *--dest = *--src;
+
+ 000a4 8a 41 ff mov al, BYTE PTR [ecx-1]
+ 000a7 49 dec ecx
+ 000a8 4a dec edx
+ 000a9 88 02 mov BYTE PTR [edx], al
+ 000ab 3b 4e 28 cmp ecx, DWORD PTR [esi+40]
+ 000ae 77 f4 ja SHORT $LL2@gzungetc
+$LN3@gzungetc:
+
+; 472 : state->x.next = dest;
+
+ 000b0 89 56 04 mov DWORD PTR [esi+4], edx
+$LN12@gzungetc:
+
+; 473 : }
+; 474 : state->x.have++;
+
+ 000b3 ff 06 inc DWORD PTR [esi]
+
+; 475 : state->x.next--;
+
+ 000b5 ff 4e 04 dec DWORD PTR [esi+4]
+ 000b8 8b 46 04 mov eax, DWORD PTR [esi+4]
+
+; 476 : state->x.next[0] = c;
+
+ 000bb 88 18 mov BYTE PTR [eax], bl
+$LN19@gzungetc:
+
+; 477 : state->x.pos--;
+
+ 000bd 83 46 08 ff add DWORD PTR [esi+8], -1
+
+; 478 : state->past = 0;
+; 479 : return c;
+
+ 000c1 8b c3 mov eax, ebx
+ 000c3 5b pop ebx
+ 000c4 83 56 0c ff adc DWORD PTR [esi+12], -1
+ 000c8 c7 46 44 00 00
+ 00 00 mov DWORD PTR [esi+68], 0
+ 000cf 5e pop esi
+
+; 480 : }
+
+ 000d0 5d pop ebp
+ 000d1 c2 08 00 ret 8
+_gzungetc@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzread.c
+; COMDAT _gzgets@12
+_TEXT SEGMENT
+_left$1$ = 8 ; size = 4
+_file$ = 8 ; size = 4
+_eol$1$ = 12 ; size = 4
+_buf$ = 12 ; size = 4
+_str$1$ = 16 ; size = 4
+_len$ = 16 ; size = 4
+_gzgets@12 PROC ; COMDAT
+
+; 487 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 53 push ebx
+ 00004 56 push esi
+ 00005 57 push edi
+
+; 488 : unsigned left, n;
+; 489 : char *str;
+; 490 : unsigned char *eol;
+; 491 : gz_statep state;
+; 492 :
+; 493 : /* check parameters and get internal structure */
+; 494 : if (file == NULL || buf == NULL || len < 1)
+
+ 00006 8b 7d 08 mov edi, DWORD PTR _file$[ebp]
+ 00009 85 ff test edi, edi
+ 0000b 0f 84 f2 00 00
+ 00 je $LN6@gzgets
+ 00011 8b 5d 0c mov ebx, DWORD PTR _buf$[ebp]
+ 00014 85 db test ebx, ebx
+ 00016 0f 84 e7 00 00
+ 00 je $LN6@gzgets
+ 0001c 8b 75 10 mov esi, DWORD PTR _len$[ebp]
+ 0001f 83 fe 01 cmp esi, 1
+ 00022 0f 8c db 00 00
+ 00 jl $LN6@gzgets
+
+; 496 : state = (gz_statep)file;
+; 497 :
+; 498 : /* check that we're reading and that there's no (serious) error */
+; 499 : if (state->mode != GZ_READ ||
+
+ 00028 81 7f 10 4f 1c
+ 00 00 cmp DWORD PTR [edi+16], 7247 ; 00001c4fH
+ 0002f 0f 85 ce 00 00
+ 00 jne $LN6@gzgets
+ 00035 8b 47 5c mov eax, DWORD PTR [edi+92]
+ 00038 85 c0 test eax, eax
+ 0003a 74 09 je SHORT $LN7@gzgets
+ 0003c 83 f8 fb cmp eax, -5 ; fffffffbH
+ 0003f 0f 85 be 00 00
+ 00 jne $LN6@gzgets
+$LN7@gzgets:
+
+; 500 : (state->err != Z_OK && state->err != Z_BUF_ERROR))
+; 501 : return NULL;
+; 502 :
+; 503 : /* process a skip request */
+; 504 : if (state->seek) {
+
+ 00045 83 7f 58 00 cmp DWORD PTR [edi+88], 0
+ 00049 74 20 je SHORT $LN10@gzgets
+
+; 505 : state->seek = 0;
+; 506 : if (gz_skip(state, state->skip) == -1)
+
+ 0004b ff 77 54 push DWORD PTR [edi+84]
+ 0004e 8b cf mov ecx, edi
+ 00050 c7 47 58 00 00
+ 00 00 mov DWORD PTR [edi+88], 0
+ 00057 ff 77 50 push DWORD PTR [edi+80]
+ 0005a e8 00 00 00 00 call _gz_skip
+ 0005f 83 c4 08 add esp, 8
+ 00062 83 f8 ff cmp eax, -1
+ 00065 0f 84 98 00 00
+ 00 je $LN6@gzgets
+$LN10@gzgets:
+
+; 507 : return NULL;
+; 508 : }
+; 509 :
+; 510 : /* copy output bytes up to new line or len - 1, whichever comes first --
+; 511 : append a terminating zero to the string (we don't check for a zero in
+; 512 : the contents, let the user worry about that) */
+; 513 : str = buf;
+; 514 : left = (unsigned)len - 1;
+
+ 0006b 8d 46 ff lea eax, DWORD PTR [esi-1]
+ 0006e 89 5d 10 mov DWORD PTR _str$1$[ebp], ebx
+ 00071 89 45 08 mov DWORD PTR _left$1$[ebp], eax
+
+; 515 : if (left) do {
+
+ 00074 85 c0 test eax, eax
+ 00076 0f 84 87 00 00
+ 00 je $LN6@gzgets
+ 0007c 0f 1f 40 00 npad 4
+$LL4@gzgets:
+
+; 516 : /* assure that something is in the output buffer */
+; 517 : if (state->x.have == 0 && gz_fetch(state) == -1)
+
+ 00080 8b 37 mov esi, DWORD PTR [edi]
+ 00082 85 f6 test esi, esi
+ 00084 75 15 jne SHORT $LN26@gzgets
+ 00086 8b cf mov ecx, edi
+ 00088 e8 00 00 00 00 call _gz_fetch
+ 0008d 83 f8 ff cmp eax, -1
+ 00090 74 71 je SHORT $LN6@gzgets
+
+; 518 : return NULL; /* error */
+; 519 : if (state->x.have == 0) { /* end of file */
+
+ 00092 8b 37 mov esi, DWORD PTR [edi]
+ 00094 85 f6 test esi, esi
+ 00096 74 53 je SHORT $LN22@gzgets
+ 00098 8b 45 08 mov eax, DWORD PTR _left$1$[ebp]
+$LN26@gzgets:
+
+; 521 : break; /* return what we have */
+; 522 : }
+; 523 :
+; 524 : /* look for end-of-line in current output buffer */
+; 525 : n = state->x.have > left ? left : state->x.have;
+
+ 0009b 3b f0 cmp esi, eax
+ 0009d 0f 47 f0 cmova esi, eax
+
+; 526 : eol = (unsigned char *)memchr(state->x.next, '\n', n);
+
+ 000a0 56 push esi
+ 000a1 6a 0a push 10 ; 0000000aH
+ 000a3 ff 77 04 push DWORD PTR [edi+4]
+ 000a6 ff 15 00 00 00
+ 00 call DWORD PTR __imp__memchr
+ 000ac 83 c4 0c add esp, 12 ; 0000000cH
+ 000af 89 45 0c mov DWORD PTR _eol$1$[ebp], eax
+
+; 527 : if (eol != NULL)
+
+ 000b2 85 c0 test eax, eax
+ 000b4 74 06 je SHORT $LN14@gzgets
+
+; 528 : n = (unsigned)(eol - state->x.next) + 1;
+
+ 000b6 8b f0 mov esi, eax
+ 000b8 2b 77 04 sub esi, DWORD PTR [edi+4]
+ 000bb 46 inc esi
+$LN14@gzgets:
+
+; 529 :
+; 530 : /* copy through end-of-line, or remainder if not found */
+; 531 : memcpy(buf, state->x.next, n);
+
+ 000bc 56 push esi
+ 000bd ff 77 04 push DWORD PTR [edi+4]
+ 000c0 53 push ebx
+ 000c1 e8 00 00 00 00 call _memcpy
+
+; 532 : state->x.have -= n;
+
+ 000c6 29 37 sub DWORD PTR [edi], esi
+ 000c8 83 c4 0c add esp, 12 ; 0000000cH
+
+; 533 : state->x.next += n;
+
+ 000cb 01 77 04 add DWORD PTR [edi+4], esi
+
+; 534 : state->x.pos += n;
+
+ 000ce 01 77 08 add DWORD PTR [edi+8], esi
+
+; 535 : left -= n;
+
+ 000d1 8b 45 08 mov eax, DWORD PTR _left$1$[ebp]
+ 000d4 83 57 0c 00 adc DWORD PTR [edi+12], 0
+ 000d8 2b c6 sub eax, esi
+
+; 536 : buf += n;
+
+ 000da 03 de add ebx, esi
+ 000dc 89 45 08 mov DWORD PTR _left$1$[ebp], eax
+
+; 537 : } while (left && eol == NULL);
+
+ 000df 85 c0 test eax, eax
+ 000e1 74 0f je SHORT $LN15@gzgets
+ 000e3 83 7d 0c 00 cmp DWORD PTR _eol$1$[ebp], 0
+ 000e7 74 97 je SHORT $LL4@gzgets
+ 000e9 eb 07 jmp SHORT $LN15@gzgets
+$LN22@gzgets:
+
+; 520 : state->past = 1; /* read past end */
+
+ 000eb c7 47 44 01 00
+ 00 00 mov DWORD PTR [edi+68], 1
+$LN15@gzgets:
+
+; 538 :
+; 539 : /* return terminated string, or if nothing, end of file */
+; 540 : if (buf == str)
+
+ 000f2 8b 45 10 mov eax, DWORD PTR _str$1$[ebp]
+ 000f5 3b d8 cmp ebx, eax
+ 000f7 74 0a je SHORT $LN6@gzgets
+
+; 541 : return NULL;
+; 542 : buf[0] = 0;
+
+ 000f9 5f pop edi
+ 000fa 5e pop esi
+ 000fb c6 03 00 mov BYTE PTR [ebx], 0
+ 000fe 5b pop ebx
+
+; 543 : return str;
+; 544 : }
+
+ 000ff 5d pop ebp
+ 00100 c2 0c 00 ret 12 ; 0000000cH
+$LN6@gzgets:
+ 00103 5f pop edi
+ 00104 5e pop esi
+
+; 495 : return NULL;
+
+ 00105 33 c0 xor eax, eax
+ 00107 5b pop ebx
+
+; 543 : return str;
+; 544 : }
+
+ 00108 5d pop ebp
+ 00109 c2 0c 00 ret 12 ; 0000000cH
+_gzgets@12 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzread.c
+; COMDAT _gzdirect@4
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_gzdirect@4 PROC ; COMDAT
+
+; 549 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 56 push esi
+
+; 550 : gz_statep state;
+; 551 :
+; 552 : /* get internal structure */
+; 553 : if (file == NULL)
+
+ 00004 8b 75 08 mov esi, DWORD PTR _file$[ebp]
+ 00007 85 f6 test esi, esi
+ 00009 75 07 jne SHORT $LN2@gzdirect
+
+; 554 : return 0;
+
+ 0000b 33 c0 xor eax, eax
+ 0000d 5e pop esi
+
+; 564 : }
+
+ 0000e 5d pop ebp
+ 0000f c2 04 00 ret 4
+$LN2@gzdirect:
+
+; 555 : state = (gz_statep)file;
+; 556 :
+; 557 : /* if the state is not known, but we can find out, then do so (this is
+; 558 : mainly for right after a gzopen() or gzdopen()) */
+; 559 : if (state->mode == GZ_READ && state->how == LOOK && state->x.have == 0)
+
+ 00012 81 7e 10 4f 1c
+ 00 00 cmp DWORD PTR [esi+16], 7247 ; 00001c4fH
+ 00019 75 12 jne SHORT $LN3@gzdirect
+ 0001b 83 7e 30 00 cmp DWORD PTR [esi+48], 0
+ 0001f 75 0c jne SHORT $LN3@gzdirect
+ 00021 83 3e 00 cmp DWORD PTR [esi], 0
+ 00024 75 07 jne SHORT $LN3@gzdirect
+
+; 560 : (void)gz_look(state);
+
+ 00026 8b ce mov ecx, esi
+ 00028 e8 00 00 00 00 call _gz_look
+$LN3@gzdirect:
+
+; 561 :
+; 562 : /* return 1 if transparent, 0 if processing a gzip stream */
+; 563 : return state->direct;
+
+ 0002d 8b 46 2c mov eax, DWORD PTR [esi+44]
+ 00030 5e pop esi
+
+; 564 : }
+
+ 00031 5d pop ebp
+ 00032 c2 04 00 ret 4
+_gzdirect@4 ENDP
+_TEXT ENDS
+END
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzread.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzread.obj
new file mode 100644
index 0000000000..cab7e2ac58
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzread.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzwrite.cod b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzwrite.cod
new file mode 100644
index 0000000000..f46513b8af
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzwrite.cod
@@ -0,0 +1,1895 @@
+; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.23506.0
+
+ TITLE d:\downloads\tgl-master\tgl-master\zlib\gzwrite.c
+ .686P
+ .XMM
+ include listing.inc
+ .model flat
+
+INCLUDELIB OLDNAMES
+
+PUBLIC ??_C@_0CH@DEEGAHIB@internal?5error?3?5deflate?5stream?5c@ ; `string'
+EXTRN __imp___write:PROC
+; COMDAT ??_C@_0CH@DEEGAHIB@internal?5error?3?5deflate?5stream?5c@
+CONST SEGMENT
+??_C@_0CH@DEEGAHIB@internal?5error?3?5deflate?5stream?5c@ DB 'internal er'
+ DB 'ror: deflate stream corrupt', 00H ; `string'
+PUBLIC _gzsetparams@12
+PUBLIC _gzflush@8
+PUBLIC _gzprintf
+PUBLIC _gzvprintf
+PUBLIC _gzputs@8
+PUBLIC _gzputc@8
+PUBLIC _gzwrite@12
+PUBLIC _vsnprintf
+PUBLIC _gzclose_w@4
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzwrite.c
+; COMDAT _gzclose_w@4
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_gzclose_w@4 PROC ; COMDAT
+
+; 541 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 56 push esi
+
+; 542 : int ret = Z_OK;
+; 543 : gz_statep state;
+; 544 :
+; 545 : /* get internal structure */
+; 546 : if (file == NULL)
+
+ 00004 8b 75 08 mov esi, DWORD PTR _file$[ebp]
+ 00007 57 push edi
+ 00008 33 ff xor edi, edi
+ 0000a 85 f6 test esi, esi
+ 0000c 75 0b jne SHORT $LN2@gzclose_w
+$LN11@gzclose_w:
+ 0000e 5f pop edi
+
+; 547 : return Z_STREAM_ERROR;
+
+ 0000f b8 fe ff ff ff mov eax, -2 ; fffffffeH
+ 00014 5e pop esi
+
+; 577 : }
+
+ 00015 5d pop ebp
+ 00016 c2 04 00 ret 4
+$LN2@gzclose_w:
+
+; 548 : state = (gz_statep)file;
+; 549 :
+; 550 : /* check that we're writing */
+; 551 : if (state->mode != GZ_WRITE)
+
+ 00019 81 7e 10 b1 79
+ 00 00 cmp DWORD PTR [esi+16], 31153 ; 000079b1H
+ 00020 75 ec jne SHORT $LN11@gzclose_w
+
+; 552 : return Z_STREAM_ERROR;
+; 553 :
+; 554 : /* check for seek request */
+; 555 : if (state->seek) {
+
+ 00022 39 7e 58 cmp DWORD PTR [esi+88], edi
+ 00025 74 1b je SHORT $LN5@gzclose_w
+
+; 556 : state->seek = 0;
+; 557 : if (gz_zero(state, state->skip) == -1)
+
+ 00027 ff 76 54 push DWORD PTR [esi+84]
+ 0002a 8b ce mov ecx, esi
+ 0002c 89 7e 58 mov DWORD PTR [esi+88], edi
+ 0002f ff 76 50 push DWORD PTR [esi+80]
+ 00032 e8 00 00 00 00 call _gz_zero
+ 00037 83 c4 08 add esp, 8
+ 0003a 83 f8 ff cmp eax, -1
+ 0003d 75 03 jne SHORT $LN5@gzclose_w
+
+; 558 : ret = state->err;
+
+ 0003f 8b 7e 5c mov edi, DWORD PTR [esi+92]
+$LN5@gzclose_w:
+
+; 559 : }
+; 560 :
+; 561 : /* flush, free memory, and close file */
+; 562 : if (gz_comp(state, Z_FINISH) == -1)
+
+ 00042 ba 04 00 00 00 mov edx, 4
+ 00047 8b ce mov ecx, esi
+ 00049 e8 00 00 00 00 call _gz_comp
+ 0004e 83 f8 ff cmp eax, -1
+ 00051 75 03 jne SHORT $LN6@gzclose_w
+
+; 563 : ret = state->err;
+
+ 00053 8b 7e 5c mov edi, DWORD PTR [esi+92]
+$LN6@gzclose_w:
+
+; 564 : if (state->size) {
+
+ 00056 83 7e 1c 00 cmp DWORD PTR [esi+28], 0
+ 0005a 53 push ebx
+ 0005b 8b 1d 00 00 00
+ 00 mov ebx, DWORD PTR __imp__free
+ 00061 74 1f je SHORT $LN7@gzclose_w
+
+; 565 : if (!state->direct) {
+
+ 00063 83 7e 2c 00 cmp DWORD PTR [esi+44], 0
+ 00067 75 11 jne SHORT $LN8@gzclose_w
+
+; 566 : (void)deflateEnd(&(state->strm));
+
+ 00069 8d 46 64 lea eax, DWORD PTR [esi+100]
+ 0006c 50 push eax
+ 0006d e8 00 00 00 00 call _deflateEnd@4
+
+; 567 : free(state->out);
+
+ 00072 ff 76 28 push DWORD PTR [esi+40]
+ 00075 ff d3 call ebx
+ 00077 83 c4 04 add esp, 4
+$LN8@gzclose_w:
+
+; 568 : }
+; 569 : free(state->in);
+
+ 0007a ff 76 24 push DWORD PTR [esi+36]
+ 0007d ff d3 call ebx
+ 0007f 83 c4 04 add esp, 4
+$LN7@gzclose_w:
+
+; 570 : }
+; 571 : gz_error(state, Z_OK, NULL);
+
+ 00082 6a 00 push 0
+ 00084 33 d2 xor edx, edx
+ 00086 8b ce mov ecx, esi
+ 00088 e8 00 00 00 00 call _gz_error
+
+; 572 : free(state->path);
+
+ 0008d ff 76 18 push DWORD PTR [esi+24]
+ 00090 ff d3 call ebx
+
+; 573 : if (close(state->fd) == -1)
+
+ 00092 ff 76 14 push DWORD PTR [esi+20]
+ 00095 ff 15 00 00 00
+ 00 call DWORD PTR __imp___close
+ 0009b 83 c9 ff or ecx, -1
+ 0009e 3b c1 cmp eax, ecx
+
+; 574 : ret = Z_ERRNO;
+; 575 : free(state);
+
+ 000a0 56 push esi
+ 000a1 0f 44 f9 cmove edi, ecx
+ 000a4 ff d3 call ebx
+ 000a6 83 c4 10 add esp, 16 ; 00000010H
+
+; 576 : return ret;
+
+ 000a9 8b c7 mov eax, edi
+ 000ab 5b pop ebx
+ 000ac 5f pop edi
+ 000ad 5e pop esi
+
+; 577 : }
+
+ 000ae 5d pop ebp
+ 000af c2 04 00 ret 4
+_gzclose_w@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h
+; COMDAT _vsnprintf
+_TEXT SEGMENT
+__Format$ = 8 ; size = 4
+__ArgList$ = 12 ; size = 4
+_vsnprintf PROC ; COMDAT
+; __Buffer$ = ecx
+; __BufferCount$ = edx
+
+; 1435 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 1436 : int const _Result = __stdio_common_vsprintf(
+
+ 00003 ff 75 0c push DWORD PTR __ArgList$[ebp]
+ 00006 6a 00 push 0
+ 00008 ff 75 08 push DWORD PTR __Format$[ebp]
+ 0000b 52 push edx
+ 0000c 51 push ecx
+ 0000d e8 00 00 00 00 call ___local_stdio_printf_options
+ 00012 8b 08 mov ecx, DWORD PTR [eax]
+ 00014 ff 70 04 push DWORD PTR [eax+4]
+ 00017 83 c9 02 or ecx, 2
+ 0001a 51 push ecx
+ 0001b ff 15 00 00 00
+ 00 call DWORD PTR __imp____stdio_common_vsprintf
+
+; 1437 : _CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR,
+; 1438 : _Buffer, _BufferCount, _Format, NULL, _ArgList);
+; 1439 :
+; 1440 : return _Result < 0 ? -1 : _Result;
+
+ 00021 83 c9 ff or ecx, -1
+ 00024 83 c4 1c add esp, 28 ; 0000001cH
+ 00027 85 c0 test eax, eax
+ 00029 0f 48 c1 cmovs eax, ecx
+
+; 1441 : }
+
+ 0002c 5d pop ebp
+ 0002d c3 ret 0
+_vsnprintf ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzwrite.c
+; COMDAT _gz_init
+_TEXT SEGMENT
+_gz_init PROC ; COMDAT
+; _state$ = ecx
+
+; 17 : {
+
+ 00000 56 push esi
+ 00001 57 push edi
+ 00002 8b f9 mov edi, ecx
+
+; 18 : int ret;
+; 19 : z_streamp strm = &(state->strm);
+; 20 :
+; 21 : /* allocate input buffer */
+; 22 : state->in = (unsigned char *)malloc(state->want);
+
+ 00004 ff 77 20 push DWORD PTR [edi+32]
+ 00007 8d 77 64 lea esi, DWORD PTR [edi+100]
+ 0000a ff 15 00 00 00
+ 00 call DWORD PTR __imp__malloc
+ 00010 83 c4 04 add esp, 4
+ 00013 89 47 24 mov DWORD PTR [edi+36], eax
+
+; 23 : if (state->in == NULL) {
+
+ 00016 85 c0 test eax, eax
+ 00018 75 18 jne SHORT $LN2@gz_init
+
+; 24 : gz_error(state, Z_MEM_ERROR, "out of memory");
+
+ 0001a 68 00 00 00 00 push OFFSET ??_C@_0O@BNNCBLEN@out?5of?5memory?$AA@
+ 0001f 8d 50 fc lea edx, DWORD PTR [eax-4]
+ 00022 8b cf mov ecx, edi
+ 00024 e8 00 00 00 00 call _gz_error
+ 00029 83 c4 04 add esp, 4
+
+; 25 : return -1;
+
+ 0002c 83 c8 ff or eax, -1
+ 0002f 5f pop edi
+ 00030 5e pop esi
+
+; 62 : }
+
+ 00031 c3 ret 0
+$LN2@gz_init:
+
+; 26 : }
+; 27 :
+; 28 : /* only need output buffer and deflate state if compressing */
+; 29 : if (!state->direct) {
+
+ 00032 83 7f 2c 00 cmp DWORD PTR [edi+44], 0
+ 00036 0f 85 92 00 00
+ 00 jne $LN5@gz_init
+
+; 30 : /* allocate output buffer */
+; 31 : state->out = (unsigned char *)malloc(state->want);
+
+ 0003c ff 77 20 push DWORD PTR [edi+32]
+ 0003f ff 15 00 00 00
+ 00 call DWORD PTR __imp__malloc
+ 00045 83 c4 04 add esp, 4
+ 00048 89 47 28 mov DWORD PTR [edi+40], eax
+
+; 32 : if (state->out == NULL) {
+
+ 0004b 85 c0 test eax, eax
+ 0004d 75 23 jne SHORT $LN4@gz_init
+
+; 33 : free(state->in);
+
+ 0004f ff 77 24 push DWORD PTR [edi+36]
+ 00052 ff 15 00 00 00
+ 00 call DWORD PTR __imp__free
+
+; 34 : gz_error(state, Z_MEM_ERROR, "out of memory");
+
+ 00058 68 00 00 00 00 push OFFSET ??_C@_0O@BNNCBLEN@out?5of?5memory?$AA@
+ 0005d ba fc ff ff ff mov edx, -4 ; fffffffcH
+ 00062 8b cf mov ecx, edi
+ 00064 e8 00 00 00 00 call _gz_error
+ 00069 83 c4 08 add esp, 8
+
+; 35 : return -1;
+
+ 0006c 83 c8 ff or eax, -1
+ 0006f 5f pop edi
+ 00070 5e pop esi
+
+; 62 : }
+
+ 00071 c3 ret 0
+$LN4@gz_init:
+
+; 36 : }
+; 37 :
+; 38 : /* allocate deflate memory, set up for gzip compression */
+; 39 : strm->zalloc = Z_NULL;
+; 40 : strm->zfree = Z_NULL;
+; 41 : strm->opaque = Z_NULL;
+; 42 : ret = deflateInit2(strm, state->level, Z_DEFLATED,
+
+ 00072 6a 38 push 56 ; 00000038H
+ 00074 68 00 00 00 00 push OFFSET ??_C@_05IAIEPMAK@1?42?48?$AA@
+ 00079 c7 46 20 00 00
+ 00 00 mov DWORD PTR [esi+32], 0
+ 00080 c7 46 24 00 00
+ 00 00 mov DWORD PTR [esi+36], 0
+ 00087 c7 46 28 00 00
+ 00 00 mov DWORD PTR [esi+40], 0
+ 0008e ff 77 4c push DWORD PTR [edi+76]
+ 00091 6a 08 push 8
+ 00093 6a 1f push 31 ; 0000001fH
+ 00095 6a 08 push 8
+ 00097 ff 77 48 push DWORD PTR [edi+72]
+ 0009a 56 push esi
+ 0009b e8 00 00 00 00 call _deflateInit2_@32
+
+; 43 : MAX_WBITS + 16, DEF_MEM_LEVEL, state->strategy);
+; 44 : if (ret != Z_OK) {
+
+ 000a0 85 c0 test eax, eax
+ 000a2 74 2a je SHORT $LN5@gz_init
+
+; 45 : free(state->out);
+
+ 000a4 ff 77 28 push DWORD PTR [edi+40]
+ 000a7 8b 35 00 00 00
+ 00 mov esi, DWORD PTR __imp__free
+ 000ad ff d6 call esi
+
+; 46 : free(state->in);
+
+ 000af ff 77 24 push DWORD PTR [edi+36]
+ 000b2 ff d6 call esi
+
+; 47 : gz_error(state, Z_MEM_ERROR, "out of memory");
+
+ 000b4 68 00 00 00 00 push OFFSET ??_C@_0O@BNNCBLEN@out?5of?5memory?$AA@
+ 000b9 ba fc ff ff ff mov edx, -4 ; fffffffcH
+ 000be 8b cf mov ecx, edi
+ 000c0 e8 00 00 00 00 call _gz_error
+ 000c5 83 c4 0c add esp, 12 ; 0000000cH
+
+; 48 : return -1;
+
+ 000c8 83 c8 ff or eax, -1
+ 000cb 5f pop edi
+ 000cc 5e pop esi
+
+; 62 : }
+
+ 000cd c3 ret 0
+$LN5@gz_init:
+
+; 49 : }
+; 50 : }
+; 51 :
+; 52 : /* mark state as initialized */
+; 53 : state->size = state->want;
+; 54 :
+; 55 : /* initialize write buffer if compressing */
+; 56 : if (!state->direct) {
+
+ 000ce 83 7f 2c 00 cmp DWORD PTR [edi+44], 0
+ 000d2 8b 47 20 mov eax, DWORD PTR [edi+32]
+ 000d5 89 47 1c mov DWORD PTR [edi+28], eax
+ 000d8 75 0c jne SHORT $LN6@gz_init
+
+; 57 : strm->avail_out = state->size;
+
+ 000da 89 46 10 mov DWORD PTR [esi+16], eax
+
+; 58 : strm->next_out = state->out;
+
+ 000dd 8b 47 28 mov eax, DWORD PTR [edi+40]
+ 000e0 89 46 0c mov DWORD PTR [esi+12], eax
+
+; 59 : state->x.next = strm->next_out;
+
+ 000e3 89 47 04 mov DWORD PTR [edi+4], eax
+$LN6@gz_init:
+
+; 60 : }
+; 61 : return 0;
+
+ 000e6 5f pop edi
+ 000e7 33 c0 xor eax, eax
+ 000e9 5e pop esi
+
+; 62 : }
+
+ 000ea c3 ret 0
+_gz_init ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzwrite.c
+; COMDAT _gz_comp
+_TEXT SEGMENT
+_flush$1$ = -4 ; size = 4
+_gz_comp PROC ; COMDAT
+; _state$ = ecx
+; _flush$ = edx
+
+; 73 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 51 push ecx
+ 00004 56 push esi
+ 00005 57 push edi
+ 00006 8b f9 mov edi, ecx
+ 00008 89 55 fc mov DWORD PTR _flush$1$[ebp], edx
+
+; 74 : int ret, got;
+; 75 : unsigned have;
+; 76 : z_streamp strm = &(state->strm);
+; 77 :
+; 78 : /* allocate memory if this is the first time through */
+; 79 : if (state->size == 0 && gz_init(state) == -1)
+
+ 0000b 83 7f 1c 00 cmp DWORD PTR [edi+28], 0
+ 0000f 8d 77 64 lea esi, DWORD PTR [edi+100]
+ 00012 75 0d jne SHORT $LN5@gz_comp
+ 00014 e8 00 00 00 00 call _gz_init
+ 00019 83 f8 ff cmp eax, -1
+ 0001c 74 4e je SHORT $LN26@gz_comp
+ 0001e 8b 55 fc mov edx, DWORD PTR _flush$1$[ebp]
+$LN5@gz_comp:
+
+; 80 : return -1;
+; 81 :
+; 82 : /* write directly if requested */
+; 83 : if (state->direct) {
+
+ 00021 83 7f 2c 00 cmp DWORD PTR [edi+44], 0
+ 00025 74 4e je SHORT $LN6@gz_comp
+
+; 84 : got = write(state->fd, strm->next_in, strm->avail_in);
+
+ 00027 ff 76 04 push DWORD PTR [esi+4]
+ 0002a ff 36 push DWORD PTR [esi]
+ 0002c ff 77 14 push DWORD PTR [edi+20]
+ 0002f ff 15 00 00 00
+ 00 call DWORD PTR __imp___write
+ 00035 83 c4 0c add esp, 12 ; 0000000cH
+
+; 85 : if (got < 0 || (unsigned)got != strm->avail_in) {
+
+ 00038 85 c0 test eax, eax
+ 0003a 78 14 js SHORT $LN8@gz_comp
+ 0003c 3b 46 04 cmp eax, DWORD PTR [esi+4]
+ 0003f 75 0f jne SHORT $LN8@gz_comp
+
+; 88 : }
+; 89 : strm->avail_in = 0;
+
+ 00041 5f pop edi
+ 00042 c7 46 04 00 00
+ 00 00 mov DWORD PTR [esi+4], 0
+
+; 90 : return 0;
+
+ 00049 33 c0 xor eax, eax
+ 0004b 5e pop esi
+
+; 130 : }
+
+ 0004c 8b e5 mov esp, ebp
+ 0004e 5d pop ebp
+ 0004f c3 ret 0
+$LN8@gz_comp:
+
+; 86 : gz_error(state, Z_ERRNO, zstrerror());
+
+ 00050 ff 15 00 00 00
+ 00 call DWORD PTR __imp___errno
+ 00056 ff 30 push DWORD PTR [eax]
+ 00058 ff 15 00 00 00
+ 00 call DWORD PTR __imp__strerror
+ 0005e 50 push eax
+ 0005f 83 ca ff or edx, -1
+ 00062 8b cf mov ecx, edi
+ 00064 e8 00 00 00 00 call _gz_error
+ 00069 83 c4 08 add esp, 8
+$LN26@gz_comp:
+
+; 87 : return -1;
+
+ 0006c 5f pop edi
+ 0006d 83 c8 ff or eax, -1
+ 00070 5e pop esi
+
+; 130 : }
+
+ 00071 8b e5 mov esp, ebp
+ 00073 5d pop ebp
+ 00074 c3 ret 0
+$LN6@gz_comp:
+
+; 91 : }
+; 92 :
+; 93 : /* run deflate() on provided input until it produces no more output */
+; 94 : ret = Z_OK;
+
+ 00075 33 c0 xor eax, eax
+ 00077 53 push ebx
+$LL4@gz_comp:
+
+; 95 : do {
+; 96 : /* write out current buffer contents if full, or if flushing, but if
+; 97 : doing Z_FINISH then don't write until we get to Z_STREAM_END */
+; 98 : if (strm->avail_out == 0 || (flush != Z_NO_FLUSH &&
+
+ 00078 83 7e 10 00 cmp DWORD PTR [esi+16], 0
+ 0007c 74 0e je SHORT $LN11@gz_comp
+ 0007e 85 d2 test edx, edx
+ 00080 74 45 je SHORT $LN9@gz_comp
+ 00082 83 fa 04 cmp edx, 4
+ 00085 75 05 jne SHORT $LN11@gz_comp
+ 00087 83 f8 01 cmp eax, 1
+ 0008a 75 3b jne SHORT $LN9@gz_comp
+$LN11@gz_comp:
+
+; 99 : (flush != Z_FINISH || ret == Z_STREAM_END))) {
+; 100 : have = (unsigned)(strm->next_out - state->x.next);
+
+ 0008c 8b 5e 0c mov ebx, DWORD PTR [esi+12]
+ 0008f 8b 47 04 mov eax, DWORD PTR [edi+4]
+ 00092 2b d8 sub ebx, eax
+
+; 101 : if (have && ((got = write(state->fd, state->x.next, have)) < 0 ||
+
+ 00094 74 16 je SHORT $LN12@gz_comp
+ 00096 53 push ebx
+ 00097 50 push eax
+ 00098 ff 77 14 push DWORD PTR [edi+20]
+ 0009b ff 15 00 00 00
+ 00 call DWORD PTR __imp___write
+ 000a1 83 c4 0c add esp, 12 ; 0000000cH
+ 000a4 85 c0 test eax, eax
+ 000a6 78 38 js SHORT $LN13@gz_comp
+ 000a8 3b c3 cmp eax, ebx
+ 000aa 75 34 jne SHORT $LN13@gz_comp
+$LN12@gz_comp:
+
+; 104 : return -1;
+; 105 : }
+; 106 : if (strm->avail_out == 0) {
+
+ 000ac 83 7e 10 00 cmp DWORD PTR [esi+16], 0
+ 000b0 75 0c jne SHORT $LN14@gz_comp
+
+; 107 : strm->avail_out = state->size;
+
+ 000b2 8b 47 1c mov eax, DWORD PTR [edi+28]
+ 000b5 89 46 10 mov DWORD PTR [esi+16], eax
+
+; 108 : strm->next_out = state->out;
+
+ 000b8 8b 47 28 mov eax, DWORD PTR [edi+40]
+ 000bb 89 46 0c mov DWORD PTR [esi+12], eax
+$LN14@gz_comp:
+
+; 109 : }
+; 110 : state->x.next = strm->next_out;
+
+ 000be 8b 46 0c mov eax, DWORD PTR [esi+12]
+ 000c1 8b 55 fc mov edx, DWORD PTR _flush$1$[ebp]
+ 000c4 89 47 04 mov DWORD PTR [edi+4], eax
+$LN9@gz_comp:
+
+; 111 : }
+; 112 :
+; 113 : /* compress */
+; 114 : have = strm->avail_out;
+
+ 000c7 8b 5e 10 mov ebx, DWORD PTR [esi+16]
+
+; 115 : ret = deflate(strm, flush);
+
+ 000ca 52 push edx
+ 000cb 56 push esi
+ 000cc e8 00 00 00 00 call _deflate@8
+
+; 116 : if (ret == Z_STREAM_ERROR) {
+
+ 000d1 83 f8 fe cmp eax, -2 ; fffffffeH
+ 000d4 74 45 je SHORT $LN20@gz_comp
+
+; 120 : }
+; 121 : have -= strm->avail_out;
+
+ 000d6 2b 5e 10 sub ebx, DWORD PTR [esi+16]
+
+; 122 : } while (have);
+
+ 000d9 74 2b je SHORT $LN19@gz_comp
+ 000db 8b 55 fc mov edx, DWORD PTR _flush$1$[ebp]
+ 000de eb 98 jmp SHORT $LL4@gz_comp
+$LN13@gz_comp:
+
+; 102 : (unsigned)got != have)) {
+; 103 : gz_error(state, Z_ERRNO, zstrerror());
+
+ 000e0 ff 15 00 00 00
+ 00 call DWORD PTR __imp___errno
+ 000e6 ff 30 push DWORD PTR [eax]
+ 000e8 ff 15 00 00 00
+ 00 call DWORD PTR __imp__strerror
+ 000ee 50 push eax
+ 000ef 83 ca ff or edx, -1
+ 000f2 8b cf mov ecx, edi
+ 000f4 e8 00 00 00 00 call _gz_error
+ 000f9 83 c4 08 add esp, 8
+
+; 118 : "internal error: deflate stream corrupt");
+; 119 : return -1;
+
+ 000fc 83 c8 ff or eax, -1
+ 000ff 5b pop ebx
+ 00100 5f pop edi
+ 00101 5e pop esi
+
+; 130 : }
+
+ 00102 8b e5 mov esp, ebp
+ 00104 5d pop ebp
+ 00105 c3 ret 0
+$LN19@gz_comp:
+
+; 123 :
+; 124 : /* if that completed a deflate stream, allow another to start */
+; 125 : if (flush == Z_FINISH)
+
+ 00106 83 7d fc 04 cmp DWORD PTR _flush$1$[ebp], 4
+ 0010a 75 06 jne SHORT $LN16@gz_comp
+
+; 126 : deflateReset(strm);
+
+ 0010c 56 push esi
+ 0010d e8 00 00 00 00 call _deflateReset@4
+$LN16@gz_comp:
+
+; 127 :
+; 128 : /* all done, no errors */
+; 129 : return 0;
+
+ 00112 5b pop ebx
+ 00113 5f pop edi
+ 00114 33 c0 xor eax, eax
+ 00116 5e pop esi
+
+; 130 : }
+
+ 00117 8b e5 mov esp, ebp
+ 00119 5d pop ebp
+ 0011a c3 ret 0
+$LN20@gz_comp:
+
+; 117 : gz_error(state, Z_STREAM_ERROR,
+
+ 0011b 68 00 00 00 00 push OFFSET ??_C@_0CH@DEEGAHIB@internal?5error?3?5deflate?5stream?5c@
+ 00120 ba fe ff ff ff mov edx, -2 ; fffffffeH
+ 00125 8b cf mov ecx, edi
+ 00127 e8 00 00 00 00 call _gz_error
+ 0012c 83 c4 04 add esp, 4
+
+; 118 : "internal error: deflate stream corrupt");
+; 119 : return -1;
+
+ 0012f 83 c8 ff or eax, -1
+ 00132 5b pop ebx
+ 00133 5f pop edi
+ 00134 5e pop esi
+
+; 130 : }
+
+ 00135 8b e5 mov esp, ebp
+ 00137 5d pop ebp
+ 00138 c3 ret 0
+_gz_comp ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzwrite.c
+; COMDAT _gz_zero
+_TEXT SEGMENT
+_first$1$ = -8 ; size = 4
+_len$2$ = -4 ; size = 4
+_len$ = 8 ; size = 8
+_gz_zero PROC ; COMDAT
+; _state$ = ecx
+
+; 136 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 08 sub esp, 8
+ 00006 56 push esi
+ 00007 8b f1 mov esi, ecx
+
+; 137 : int first;
+; 138 : unsigned n;
+; 139 : z_streamp strm = &(state->strm);
+; 140 :
+; 141 : /* consume whatever's left in the input buffer */
+; 142 : if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
+
+ 00009 83 7e 68 00 cmp DWORD PTR [esi+104], 0
+ 0000d 74 13 je SHORT $LN4@gz_zero
+ 0000f 33 d2 xor edx, edx
+ 00011 e8 00 00 00 00 call _gz_comp
+ 00016 83 f8 ff cmp eax, -1
+ 00019 75 07 jne SHORT $LN4@gz_zero
+
+; 143 : return -1;
+
+ 0001b 0b c0 or eax, eax
+ 0001d 5e pop esi
+
+; 162 : }
+
+ 0001e 8b e5 mov esp, ebp
+ 00020 5d pop ebp
+ 00021 c3 ret 0
+$LN4@gz_zero:
+
+; 144 :
+; 145 : /* compress len zeros (len guaranteed > 0) */
+; 146 : first = 1;
+; 147 : while (len) {
+
+ 00022 8b 4d 0c mov ecx, DWORD PTR _len$[ebp+4]
+ 00025 ba 01 00 00 00 mov edx, 1
+ 0002a 53 push ebx
+ 0002b 8b 5d 08 mov ebx, DWORD PTR _len$[ebp]
+ 0002e 8b c3 mov eax, ebx
+ 00030 0b c1 or eax, ecx
+ 00032 89 55 f8 mov DWORD PTR _first$1$[ebp], edx
+ 00035 57 push edi
+ 00036 89 4d fc mov DWORD PTR _len$2$[ebp], ecx
+ 00039 74 61 je SHORT $LN3@gz_zero
+ 0003b 0f 1f 44 00 00 npad 5
+$LL2@gz_zero:
+
+; 148 : n = GT_OFF(state->size) || (z_off64_t)state->size > len ?
+
+ 00040 8b 7e 1c mov edi, DWORD PTR [esi+28]
+ 00043 33 c0 xor eax, eax
+ 00045 3b c1 cmp eax, ecx
+ 00047 7f 06 jg SHORT $LN8@gz_zero
+ 00049 7c 06 jl SHORT $LN9@gz_zero
+ 0004b 3b fb cmp edi, ebx
+ 0004d 76 02 jbe SHORT $LN9@gz_zero
+$LN8@gz_zero:
+ 0004f 8b fb mov edi, ebx
+$LN9@gz_zero:
+
+; 149 : (unsigned)len : state->size;
+; 150 : if (first) {
+
+ 00051 85 d2 test edx, edx
+ 00053 74 15 je SHORT $LN5@gz_zero
+
+; 151 : memset(state->in, 0, n);
+
+ 00055 57 push edi
+ 00056 6a 00 push 0
+ 00058 ff 76 24 push DWORD PTR [esi+36]
+ 0005b e8 00 00 00 00 call _memset
+ 00060 83 c4 0c add esp, 12 ; 0000000cH
+
+; 152 : first = 0;
+
+ 00063 c7 45 f8 00 00
+ 00 00 mov DWORD PTR _first$1$[ebp], 0
+$LN5@gz_zero:
+
+; 153 : }
+; 154 : strm->avail_in = n;
+
+ 0006a 89 7e 68 mov DWORD PTR [esi+104], edi
+
+; 155 : strm->next_in = state->in;
+; 156 : state->x.pos += n;
+; 157 : if (gz_comp(state, Z_NO_FLUSH) == -1)
+
+ 0006d 8b ce mov ecx, esi
+ 0006f 8b 46 24 mov eax, DWORD PTR [esi+36]
+ 00072 89 46 64 mov DWORD PTR [esi+100], eax
+ 00075 01 7e 08 add DWORD PTR [esi+8], edi
+ 00078 83 56 0c 00 adc DWORD PTR [esi+12], 0
+ 0007c 33 d2 xor edx, edx
+ 0007e e8 00 00 00 00 call _gz_comp
+ 00083 83 f8 ff cmp eax, -1
+ 00086 74 1d je SHORT $LN11@gz_zero
+
+; 159 : len -= n;
+
+ 00088 8b 4d fc mov ecx, DWORD PTR _len$2$[ebp]
+ 0008b 2b df sub ebx, edi
+ 0008d 8b 55 f8 mov edx, DWORD PTR _first$1$[ebp]
+ 00090 8b c3 mov eax, ebx
+ 00092 83 d9 00 sbb ecx, 0
+ 00095 0b c1 or eax, ecx
+ 00097 89 4d fc mov DWORD PTR _len$2$[ebp], ecx
+ 0009a 75 a4 jne SHORT $LL2@gz_zero
+$LN3@gz_zero:
+ 0009c 5f pop edi
+ 0009d 5b pop ebx
+
+; 160 : }
+; 161 : return 0;
+
+ 0009e 33 c0 xor eax, eax
+ 000a0 5e pop esi
+
+; 162 : }
+
+ 000a1 8b e5 mov esp, ebp
+ 000a3 5d pop ebp
+ 000a4 c3 ret 0
+$LN11@gz_zero:
+ 000a5 5f pop edi
+ 000a6 5b pop ebx
+
+; 158 : return -1;
+
+ 000a7 83 c8 ff or eax, -1
+ 000aa 5e pop esi
+
+; 162 : }
+
+ 000ab 8b e5 mov esp, ebp
+ 000ad 5d pop ebp
+ 000ae c3 ret 0
+_gz_zero ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzwrite.c
+; COMDAT _gzwrite@12
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_buf$1$ = 12 ; size = 4
+_buf$ = 12 ; size = 4
+_put$1$ = 16 ; size = 4
+_len$ = 16 ; size = 4
+_gzwrite@12 PROC ; COMDAT
+
+; 169 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 53 push ebx
+
+; 170 : unsigned put = len;
+
+ 00004 8b 5d 10 mov ebx, DWORD PTR _len$[ebp]
+ 00007 56 push esi
+
+; 171 : gz_statep state;
+; 172 : z_streamp strm;
+; 173 :
+; 174 : /* get internal structure */
+; 175 : if (file == NULL)
+
+ 00008 8b 75 08 mov esi, DWORD PTR _file$[ebp]
+ 0000b 89 5d 10 mov DWORD PTR _put$1$[ebp], ebx
+ 0000e 85 f6 test esi, esi
+ 00010 74 27 je SHORT $LN29@gzwrite
+
+; 176 : return 0;
+; 177 : state = (gz_statep)file;
+; 178 : strm = &(state->strm);
+; 179 :
+; 180 : /* check that we're writing and that there's no error */
+; 181 : if (state->mode != GZ_WRITE || state->err != Z_OK)
+
+ 00012 81 7e 10 b1 79
+ 00 00 cmp DWORD PTR [esi+16], 31153 ; 000079b1H
+ 00019 75 1e jne SHORT $LN29@gzwrite
+ 0001b 83 7e 5c 00 cmp DWORD PTR [esi+92], 0
+ 0001f 75 18 jne SHORT $LN29@gzwrite
+
+; 182 : return 0;
+; 183 :
+; 184 : /* since an int is returned, make sure len fits in one, otherwise return
+; 185 : with an error (this avoids the flaw in the interface) */
+; 186 : if ((int)len < 0) {
+
+ 00021 85 db test ebx, ebx
+ 00023 79 1c jns SHORT $LN27@gzwrite
+
+; 187 : gz_error(state, Z_DATA_ERROR, "requested length does not fit in int");
+
+ 00025 68 00 00 00 00 push OFFSET ??_C@_0CF@MLPJFDMM@requested?5length?5does?5not?5fit?5in@
+ 0002a ba fd ff ff ff mov edx, -3 ; fffffffdH
+ 0002f 8b ce mov ecx, esi
+ 00031 e8 00 00 00 00 call _gz_error
+ 00036 83 c4 04 add esp, 4
+$LN29@gzwrite:
+
+; 188 : return 0;
+
+ 00039 5e pop esi
+ 0003a 33 c0 xor eax, eax
+ 0003c 5b pop ebx
+
+; 242 : }
+
+ 0003d 5d pop ebp
+ 0003e c2 0c 00 ret 12 ; 0000000cH
+$LN27@gzwrite:
+
+; 189 : }
+; 190 :
+; 191 : /* if len is zero, avoid unnecessary operations */
+; 192 : if (len == 0)
+
+ 00041 74 f6 je SHORT $LN29@gzwrite
+
+; 193 : return 0;
+; 194 :
+; 195 : /* allocate memory if this is the first time through */
+; 196 : if (state->size == 0 && gz_init(state) == -1)
+
+ 00043 83 7e 1c 00 cmp DWORD PTR [esi+28], 0
+ 00047 75 0c jne SHORT $LN10@gzwrite
+ 00049 8b ce mov ecx, esi
+ 0004b e8 00 00 00 00 call _gz_init
+ 00050 83 f8 ff cmp eax, -1
+ 00053 74 e4 je SHORT $LN29@gzwrite
+$LN10@gzwrite:
+
+; 197 : return 0;
+; 198 :
+; 199 : /* check for seek request */
+; 200 : if (state->seek) {
+
+ 00055 83 7e 58 00 cmp DWORD PTR [esi+88], 0
+ 00059 74 1c je SHORT $LN12@gzwrite
+
+; 201 : state->seek = 0;
+; 202 : if (gz_zero(state, state->skip) == -1)
+
+ 0005b ff 76 54 push DWORD PTR [esi+84]
+ 0005e 8b ce mov ecx, esi
+ 00060 c7 46 58 00 00
+ 00 00 mov DWORD PTR [esi+88], 0
+ 00067 ff 76 50 push DWORD PTR [esi+80]
+ 0006a e8 00 00 00 00 call _gz_zero
+ 0006f 83 c4 08 add esp, 8
+ 00072 83 f8 ff cmp eax, -1
+ 00075 74 c2 je SHORT $LN29@gzwrite
+$LN12@gzwrite:
+ 00077 57 push edi
+
+; 203 : return 0;
+; 204 : }
+; 205 :
+; 206 : /* for small len, copy to input buffer, otherwise compress directly */
+; 207 : if (len < state->size) {
+
+ 00078 3b 5e 1c cmp ebx, DWORD PTR [esi+28]
+ 0007b 73 5d jae SHORT $LN13@gzwrite
+ 0007d 8b 45 0c mov eax, DWORD PTR _buf$[ebp]
+ 00080 89 45 0c mov DWORD PTR _buf$1$[ebp], eax
+$LL4@gzwrite:
+
+; 208 : /* copy to input buffer, compress when full */
+; 209 : do {
+; 210 : unsigned have, copy;
+; 211 :
+; 212 : if (strm->avail_in == 0)
+
+ 00083 8b 56 68 mov edx, DWORD PTR [esi+104]
+ 00086 85 d2 test edx, edx
+ 00088 75 06 jne SHORT $LN15@gzwrite
+
+; 213 : strm->next_in = state->in;
+
+ 0008a 8b 46 24 mov eax, DWORD PTR [esi+36]
+ 0008d 89 46 64 mov DWORD PTR [esi+100], eax
+$LN15@gzwrite:
+
+; 214 : have = (unsigned)((strm->next_in + strm->avail_in) - state->in);
+
+ 00090 8b 46 64 mov eax, DWORD PTR [esi+100]
+ 00093 2b 46 24 sub eax, DWORD PTR [esi+36]
+
+; 215 : copy = state->size - have;
+
+ 00096 8b 7e 1c mov edi, DWORD PTR [esi+28]
+ 00099 03 c2 add eax, edx
+ 0009b 2b f8 sub edi, eax
+
+; 216 : if (copy > len)
+
+ 0009d 3b fb cmp edi, ebx
+ 0009f 0f 47 fb cmova edi, ebx
+
+; 217 : copy = len;
+; 218 : memcpy(state->in + have, buf, copy);
+
+ 000a2 03 46 24 add eax, DWORD PTR [esi+36]
+ 000a5 57 push edi
+ 000a6 ff 75 0c push DWORD PTR _buf$1$[ebp]
+ 000a9 50 push eax
+ 000aa e8 00 00 00 00 call _memcpy
+
+; 219 : strm->avail_in += copy;
+
+ 000af 01 7e 68 add DWORD PTR [esi+104], edi
+ 000b2 83 c4 0c add esp, 12 ; 0000000cH
+
+; 220 : state->x.pos += copy;
+
+ 000b5 01 7e 08 add DWORD PTR [esi+8], edi
+ 000b8 83 56 0c 00 adc DWORD PTR [esi+12], 0
+
+; 221 : buf = (const char *)buf + copy;
+
+ 000bc 01 7d 0c add DWORD PTR _buf$1$[ebp], edi
+
+; 222 : len -= copy;
+
+ 000bf 2b df sub ebx, edi
+
+; 223 : if (len && gz_comp(state, Z_NO_FLUSH) == -1)
+
+ 000c1 74 49 je SHORT $LN19@gzwrite
+ 000c3 33 d2 xor edx, edx
+ 000c5 8b ce mov ecx, esi
+ 000c7 e8 00 00 00 00 call _gz_comp
+ 000cc 83 f8 ff cmp eax, -1
+ 000cf 75 b2 jne SHORT $LL4@gzwrite
+$LN28@gzwrite:
+ 000d1 5f pop edi
+ 000d2 5e pop esi
+
+; 224 : return 0;
+
+ 000d3 33 c0 xor eax, eax
+ 000d5 5b pop ebx
+
+; 242 : }
+
+ 000d6 5d pop ebp
+ 000d7 c2 0c 00 ret 12 ; 0000000cH
+$LN13@gzwrite:
+
+; 225 : } while (len);
+; 226 : }
+; 227 : else {
+; 228 : /* consume whatever's left in the input buffer */
+; 229 : if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
+
+ 000da 83 7e 68 00 cmp DWORD PTR [esi+104], 0
+ 000de 74 0e je SHORT $LN18@gzwrite
+ 000e0 33 d2 xor edx, edx
+ 000e2 8b ce mov ecx, esi
+ 000e4 e8 00 00 00 00 call _gz_comp
+ 000e9 83 f8 ff cmp eax, -1
+ 000ec 74 e3 je SHORT $LN28@gzwrite
+$LN18@gzwrite:
+
+; 230 : return 0;
+; 231 :
+; 232 : /* directly compress user buffer to file */
+; 233 : strm->avail_in = len;
+; 234 : strm->next_in = (z_const Bytef *)buf;
+
+ 000ee 8b 45 0c mov eax, DWORD PTR _buf$[ebp]
+
+; 235 : state->x.pos += len;
+; 236 : if (gz_comp(state, Z_NO_FLUSH) == -1)
+
+ 000f1 8b ce mov ecx, esi
+ 000f3 89 5e 68 mov DWORD PTR [esi+104], ebx
+ 000f6 89 46 64 mov DWORD PTR [esi+100], eax
+ 000f9 01 5e 08 add DWORD PTR [esi+8], ebx
+ 000fc 83 56 0c 00 adc DWORD PTR [esi+12], 0
+ 00100 33 d2 xor edx, edx
+ 00102 e8 00 00 00 00 call _gz_comp
+ 00107 83 f8 ff cmp eax, -1
+ 0010a 74 c5 je SHORT $LN28@gzwrite
+$LN19@gzwrite:
+
+; 237 : return 0;
+; 238 : }
+; 239 :
+; 240 : /* input was all buffered or compressed (put will fit in int) */
+; 241 : return (int)put;
+
+ 0010c 8b 45 10 mov eax, DWORD PTR _put$1$[ebp]
+ 0010f 5f pop edi
+ 00110 5e pop esi
+ 00111 5b pop ebx
+
+; 242 : }
+
+ 00112 5d pop ebp
+ 00113 c2 0c 00 ret 12 ; 0000000cH
+_gzwrite@12 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzwrite.c
+; COMDAT _gzputc@8
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_buf$ = 11 ; size = 1
+_c$ = 12 ; size = 4
+_gzputc@8 PROC ; COMDAT
+
+; 248 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 56 push esi
+
+; 249 : unsigned have;
+; 250 : unsigned char buf[1];
+; 251 : gz_statep state;
+; 252 : z_streamp strm;
+; 253 :
+; 254 : /* get internal structure */
+; 255 : if (file == NULL)
+
+ 00004 8b 75 08 mov esi, DWORD PTR _file$[ebp]
+ 00007 85 f6 test esi, esi
+ 00009 75 08 jne SHORT $LN2@gzputc
+$LN14@gzputc:
+
+; 256 : return -1;
+
+ 0000b 83 c8 ff or eax, -1
+ 0000e 5e pop esi
+
+; 290 : }
+
+ 0000f 5d pop ebp
+ 00010 c2 08 00 ret 8
+$LN2@gzputc:
+
+; 257 : state = (gz_statep)file;
+; 258 : strm = &(state->strm);
+; 259 :
+; 260 : /* check that we're writing and that there's no error */
+; 261 : if (state->mode != GZ_WRITE || state->err != Z_OK)
+
+ 00013 81 7e 10 b1 79
+ 00 00 cmp DWORD PTR [esi+16], 31153 ; 000079b1H
+ 0001a 75 ef jne SHORT $LN14@gzputc
+ 0001c 83 7e 5c 00 cmp DWORD PTR [esi+92], 0
+ 00020 75 e9 jne SHORT $LN14@gzputc
+
+; 262 : return -1;
+; 263 :
+; 264 : /* check for seek request */
+; 265 : if (state->seek) {
+
+ 00022 83 7e 58 00 cmp DWORD PTR [esi+88], 0
+ 00026 74 1c je SHORT $LN6@gzputc
+
+; 266 : state->seek = 0;
+; 267 : if (gz_zero(state, state->skip) == -1)
+
+ 00028 ff 76 54 push DWORD PTR [esi+84]
+ 0002b 8b ce mov ecx, esi
+ 0002d c7 46 58 00 00
+ 00 00 mov DWORD PTR [esi+88], 0
+ 00034 ff 76 50 push DWORD PTR [esi+80]
+ 00037 e8 00 00 00 00 call _gz_zero
+ 0003c 83 c4 08 add esp, 8
+ 0003f 83 f8 ff cmp eax, -1
+ 00042 74 c7 je SHORT $LN14@gzputc
+$LN6@gzputc:
+
+; 268 : return -1;
+; 269 : }
+; 270 :
+; 271 : /* try writing to input buffer for speed (state->size == 0 if buffer not
+; 272 : initialized) */
+; 273 : if (state->size) {
+
+ 00044 83 7e 1c 00 cmp DWORD PTR [esi+28], 0
+ 00048 57 push edi
+ 00049 74 36 je SHORT $LN9@gzputc
+
+; 274 : if (strm->avail_in == 0)
+
+ 0004b 8b 56 68 mov edx, DWORD PTR [esi+104]
+ 0004e 85 d2 test edx, edx
+ 00050 75 06 jne SHORT $LN8@gzputc
+
+; 275 : strm->next_in = state->in;
+
+ 00052 8b 46 24 mov eax, DWORD PTR [esi+36]
+ 00055 89 46 64 mov DWORD PTR [esi+100], eax
+$LN8@gzputc:
+
+; 276 : have = (unsigned)((strm->next_in + strm->avail_in) - state->in);
+
+ 00058 8b 4e 64 mov ecx, DWORD PTR [esi+100]
+ 0005b 8b 7e 24 mov edi, DWORD PTR [esi+36]
+ 0005e 2b cf sub ecx, edi
+ 00060 03 ca add ecx, edx
+
+; 277 : if (have < state->size) {
+
+ 00062 3b 4e 1c cmp ecx, DWORD PTR [esi+28]
+ 00065 73 1a jae SHORT $LN9@gzputc
+
+; 278 : state->in[have] = c;
+
+ 00067 8b 45 0c mov eax, DWORD PTR _c$[ebp]
+ 0006a 88 04 0f mov BYTE PTR [edi+ecx], al
+
+; 279 : strm->avail_in++;
+
+ 0006d ff 46 68 inc DWORD PTR [esi+104]
+
+; 280 : state->x.pos++;
+
+ 00070 83 46 08 01 add DWORD PTR [esi+8], 1
+ 00074 5f pop edi
+ 00075 83 56 0c 00 adc DWORD PTR [esi+12], 0
+
+; 281 : return c & 0xff;
+
+ 00079 0f b6 c0 movzx eax, al
+ 0007c 5e pop esi
+
+; 290 : }
+
+ 0007d 5d pop ebp
+ 0007e c2 08 00 ret 8
+$LN9@gzputc:
+ 00081 53 push ebx
+
+; 282 : }
+; 283 : }
+; 284 :
+; 285 : /* no room in buffer or not initialized, use gz_write() */
+; 286 : buf[0] = c;
+
+ 00082 8b 5d 0c mov ebx, DWORD PTR _c$[ebp]
+
+; 287 : if (gzwrite(file, buf, 1) != 1)
+
+ 00085 8d 45 0b lea eax, DWORD PTR _buf$[ebp]
+ 00088 6a 01 push 1
+ 0008a 50 push eax
+ 0008b 56 push esi
+ 0008c 88 5d 0b mov BYTE PTR _buf$[ebp], bl
+ 0008f e8 00 00 00 00 call _gzwrite@12
+ 00094 83 f8 01 cmp eax, 1
+ 00097 74 0a je SHORT $LN10@gzputc
+
+; 288 : return -1;
+
+ 00099 5b pop ebx
+ 0009a 5f pop edi
+ 0009b 83 c8 ff or eax, -1
+ 0009e 5e pop esi
+
+; 290 : }
+
+ 0009f 5d pop ebp
+ 000a0 c2 08 00 ret 8
+$LN10@gzputc:
+
+; 289 : return c & 0xff;
+
+ 000a3 0f b6 c3 movzx eax, bl
+ 000a6 5b pop ebx
+ 000a7 5f pop edi
+ 000a8 5e pop esi
+
+; 290 : }
+
+ 000a9 5d pop ebp
+ 000aa c2 08 00 ret 8
+_gzputc@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzwrite.c
+; COMDAT _gzputs@8
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_str$ = 12 ; size = 4
+_gzputs@8 PROC ; COMDAT
+
+; 296 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 297 : int ret;
+; 298 : unsigned len;
+; 299 :
+; 300 : /* write string */
+; 301 : len = (unsigned)strlen(str);
+
+ 00003 8b 4d 0c mov ecx, DWORD PTR _str$[ebp]
+ 00006 56 push esi
+ 00007 8b f1 mov esi, ecx
+ 00009 8d 56 01 lea edx, DWORD PTR [esi+1]
+ 0000c 0f 1f 40 00 npad 4
+$LL5@gzputs:
+ 00010 8a 06 mov al, BYTE PTR [esi]
+ 00012 46 inc esi
+ 00013 84 c0 test al, al
+ 00015 75 f9 jne SHORT $LL5@gzputs
+ 00017 2b f2 sub esi, edx
+
+; 302 : ret = gzwrite(file, str, len);
+
+ 00019 56 push esi
+ 0001a 51 push ecx
+ 0001b ff 75 08 push DWORD PTR _file$[ebp]
+ 0001e e8 00 00 00 00 call _gzwrite@12
+
+; 303 : return ret == 0 && len != 0 ? -1 : ret;
+
+ 00023 85 c0 test eax, eax
+ 00025 75 07 jne SHORT $LN4@gzputs
+ 00027 85 f6 test esi, esi
+ 00029 74 03 je SHORT $LN4@gzputs
+ 0002b 83 c8 ff or eax, -1
+$LN4@gzputs:
+ 0002e 5e pop esi
+
+; 304 : }
+
+ 0002f 5d pop ebp
+ 00030 c2 08 00 ret 8
+_gzputs@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzwrite.c
+; File c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h
+; File d:\downloads\tgl-master\tgl-master\zlib\gzwrite.c
+; File c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h
+; File d:\downloads\tgl-master\tgl-master\zlib\gzwrite.c
+; COMDAT _gzvprintf
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_format$ = 12 ; size = 4
+_va$ = 16 ; size = 4
+_gzvprintf PROC ; COMDAT
+
+; 311 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 56 push esi
+
+; 312 : int size, len;
+; 313 : gz_statep state;
+; 314 : z_streamp strm;
+; 315 :
+; 316 : /* get internal structure */
+; 317 : if (file == NULL)
+
+ 00004 8b 75 08 mov esi, DWORD PTR _file$[ebp]
+ 00007 85 f6 test esi, esi
+ 00009 75 06 jne SHORT $LN2@gzvprintf
+
+; 318 : return -1;
+
+ 0000b 83 c8 ff or eax, -1
+ 0000e 5e pop esi
+
+; 370 : }
+
+ 0000f 5d pop ebp
+ 00010 c3 ret 0
+$LN2@gzvprintf:
+
+; 319 : state = (gz_statep)file;
+; 320 : strm = &(state->strm);
+; 321 :
+; 322 : /* check that we're writing and that there's no error */
+; 323 : if (state->mode != GZ_WRITE || state->err != Z_OK)
+
+ 00011 81 7e 10 b1 79
+ 00 00 cmp DWORD PTR [esi+16], 31153 ; 000079b1H
+ 00018 75 18 jne SHORT $LN16@gzvprintf
+ 0001a 83 7e 5c 00 cmp DWORD PTR [esi+92], 0
+ 0001e 75 12 jne SHORT $LN16@gzvprintf
+
+; 324 : return 0;
+; 325 :
+; 326 : /* make sure we have some buffer space */
+; 327 : if (state->size == 0 && gz_init(state) == -1)
+
+ 00020 83 7e 1c 00 cmp DWORD PTR [esi+28], 0
+ 00024 75 11 jne SHORT $LN5@gzvprintf
+ 00026 8b ce mov ecx, esi
+ 00028 e8 00 00 00 00 call _gz_init
+ 0002d 83 f8 ff cmp eax, -1
+ 00030 75 05 jne SHORT $LN5@gzvprintf
+$LN16@gzvprintf:
+
+; 328 : return 0;
+
+ 00032 33 c0 xor eax, eax
+ 00034 5e pop esi
+
+; 370 : }
+
+ 00035 5d pop ebp
+ 00036 c3 ret 0
+$LN5@gzvprintf:
+
+; 329 :
+; 330 : /* check for seek request */
+; 331 : if (state->seek) {
+
+ 00037 83 7e 58 00 cmp DWORD PTR [esi+88], 0
+ 0003b 74 1c je SHORT $LN7@gzvprintf
+
+; 332 : state->seek = 0;
+; 333 : if (gz_zero(state, state->skip) == -1)
+
+ 0003d ff 76 54 push DWORD PTR [esi+84]
+ 00040 8b ce mov ecx, esi
+ 00042 c7 46 58 00 00
+ 00 00 mov DWORD PTR [esi+88], 0
+ 00049 ff 76 50 push DWORD PTR [esi+80]
+ 0004c e8 00 00 00 00 call _gz_zero
+ 00051 83 c4 08 add esp, 8
+ 00054 83 f8 ff cmp eax, -1
+ 00057 74 d9 je SHORT $LN16@gzvprintf
+$LN7@gzvprintf:
+
+; 334 : return 0;
+; 335 : }
+; 336 :
+; 337 : /* consume whatever's left in the input buffer */
+; 338 : if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
+
+ 00059 83 7e 68 00 cmp DWORD PTR [esi+104], 0
+ 0005d 74 0e je SHORT $LN8@gzvprintf
+ 0005f 33 d2 xor edx, edx
+ 00061 8b ce mov ecx, esi
+ 00063 e8 00 00 00 00 call _gz_comp
+ 00068 83 f8 ff cmp eax, -1
+ 0006b 74 c5 je SHORT $LN16@gzvprintf
+$LN8@gzvprintf:
+
+; 343 : state->in[size - 1] = 0;
+
+ 0006d 8b 46 24 mov eax, DWORD PTR [esi+36]
+ 00070 53 push ebx
+ 00071 8b 5e 1c mov ebx, DWORD PTR [esi+28]
+ 00074 57 push edi
+; File c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h
+
+; 1436 : int const _Result = __stdio_common_vsprintf(
+
+ 00075 ff 75 10 push DWORD PTR _va$[ebp]
+ 00078 6a 00 push 0
+ 0007a ff 75 0c push DWORD PTR _format$[ebp]
+; File d:\downloads\tgl-master\tgl-master\zlib\gzwrite.c
+
+; 343 : state->in[size - 1] = 0;
+
+ 0007d c6 44 03 ff 00 mov BYTE PTR [ebx+eax-1], 0
+; File c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h
+
+; 1436 : int const _Result = __stdio_common_vsprintf(
+
+ 00082 53 push ebx
+ 00083 ff 76 24 push DWORD PTR [esi+36]
+ 00086 e8 00 00 00 00 call ___local_stdio_printf_options
+ 0008b 8b 08 mov ecx, DWORD PTR [eax]
+ 0008d ff 70 04 push DWORD PTR [eax+4]
+ 00090 83 c9 02 or ecx, 2
+ 00093 51 push ecx
+ 00094 ff 15 00 00 00
+ 00 call DWORD PTR __imp____stdio_common_vsprintf
+ 0009a 8b f8 mov edi, eax
+ 0009c 83 c4 1c add esp, 28 ; 0000001cH
+
+; 1437 : _CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR,
+; 1438 : _Buffer, _BufferCount, _Format, NULL, _ArgList);
+; 1439 :
+; 1440 : return _Result < 0 ? -1 : _Result;
+
+ 0009f 83 c8 ff or eax, -1
+ 000a2 85 ff test edi, edi
+ 000a4 0f 48 f8 cmovs edi, eax
+; File d:\downloads\tgl-master\tgl-master\zlib\gzwrite.c
+
+; 362 : if (len <= 0 || len >= (int)size || state->in[size - 1] != 0)
+
+ 000a7 85 ff test edi, edi
+ 000a9 7e 26 jle SHORT $LN10@gzvprintf
+ 000ab 3b fb cmp edi, ebx
+ 000ad 7d 22 jge SHORT $LN10@gzvprintf
+ 000af 8b 46 24 mov eax, DWORD PTR [esi+36]
+ 000b2 80 7c 03 ff 00 cmp BYTE PTR [ebx+eax-1], 0
+ 000b7 75 18 jne SHORT $LN10@gzvprintf
+
+; 364 :
+; 365 : /* update buffer and position, defer compression until needed */
+; 366 : strm->avail_in = (unsigned)len;
+; 367 : strm->next_in = state->in;
+
+ 000b9 8b c8 mov ecx, eax
+ 000bb 89 7e 68 mov DWORD PTR [esi+104], edi
+
+; 368 : state->x.pos += len;
+
+ 000be 8b c7 mov eax, edi
+ 000c0 89 4e 64 mov DWORD PTR [esi+100], ecx
+ 000c3 99 cdq
+ 000c4 01 46 08 add DWORD PTR [esi+8], eax
+
+; 369 : return len;
+
+ 000c7 8b c7 mov eax, edi
+ 000c9 5f pop edi
+ 000ca 11 56 0c adc DWORD PTR [esi+12], edx
+ 000cd 5b pop ebx
+ 000ce 5e pop esi
+
+; 370 : }
+
+ 000cf 5d pop ebp
+ 000d0 c3 ret 0
+$LN10@gzvprintf:
+ 000d1 5f pop edi
+ 000d2 5b pop ebx
+
+; 363 : return 0;
+
+ 000d3 33 c0 xor eax, eax
+ 000d5 5e pop esi
+
+; 370 : }
+
+ 000d6 5d pop ebp
+ 000d7 c3 ret 0
+_gzvprintf ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzwrite.c
+; COMDAT _gzprintf
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_format$ = 12 ; size = 4
+_gzprintf PROC ; COMDAT
+
+; 373 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 374 : va_list va;
+; 375 : int ret;
+; 376 :
+; 377 : va_start(va, format);
+; 378 : ret = gzvprintf(file, format, va);
+
+ 00003 8d 45 10 lea eax, DWORD PTR _format$[ebp+4]
+ 00006 50 push eax
+ 00007 ff 75 0c push DWORD PTR _format$[ebp]
+ 0000a ff 75 08 push DWORD PTR _file$[ebp]
+ 0000d e8 00 00 00 00 call _gzvprintf
+ 00012 83 c4 0c add esp, 12 ; 0000000cH
+
+; 379 : va_end(va);
+; 380 : return ret;
+; 381 : }
+
+ 00015 5d pop ebp
+ 00016 c3 ret 0
+_gzprintf ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzwrite.c
+; COMDAT _gzflush@8
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_flush$ = 12 ; size = 4
+_gzflush@8 PROC ; COMDAT
+
+; 468 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 56 push esi
+
+; 469 : gz_statep state;
+; 470 :
+; 471 : /* get internal structure */
+; 472 : if (file == NULL)
+
+ 00004 8b 75 08 mov esi, DWORD PTR _file$[ebp]
+ 00007 85 f6 test esi, esi
+ 00009 75 08 jne SHORT $LN2@gzflush
+$LN10@gzflush:
+
+; 473 : return -1;
+
+ 0000b 83 c8 ff or eax, -1
+ 0000e 5e pop esi
+
+; 494 : }
+
+ 0000f 5d pop ebp
+ 00010 c2 08 00 ret 8
+$LN2@gzflush:
+
+; 474 : state = (gz_statep)file;
+; 475 :
+; 476 : /* check that we're writing and that there's no error */
+; 477 : if (state->mode != GZ_WRITE || state->err != Z_OK)
+
+ 00013 81 7e 10 b1 79
+ 00 00 cmp DWORD PTR [esi+16], 31153 ; 000079b1H
+ 0001a 75 40 jne SHORT $LN4@gzflush
+ 0001c 83 7e 5c 00 cmp DWORD PTR [esi+92], 0
+ 00020 75 3a jne SHORT $LN4@gzflush
+
+; 479 :
+; 480 : /* check flush parameter */
+; 481 : if (flush < 0 || flush > Z_FINISH)
+
+ 00022 83 7d 0c 04 cmp DWORD PTR _flush$[ebp], 4
+ 00026 77 34 ja SHORT $LN4@gzflush
+
+; 482 : return Z_STREAM_ERROR;
+; 483 :
+; 484 : /* check for seek request */
+; 485 : if (state->seek) {
+
+ 00028 83 7e 58 00 cmp DWORD PTR [esi+88], 0
+ 0002c 74 1c je SHORT $LN8@gzflush
+
+; 486 : state->seek = 0;
+; 487 : if (gz_zero(state, state->skip) == -1)
+
+ 0002e ff 76 54 push DWORD PTR [esi+84]
+ 00031 8b ce mov ecx, esi
+ 00033 c7 46 58 00 00
+ 00 00 mov DWORD PTR [esi+88], 0
+ 0003a ff 76 50 push DWORD PTR [esi+80]
+ 0003d e8 00 00 00 00 call _gz_zero
+ 00042 83 c4 08 add esp, 8
+ 00045 83 f8 ff cmp eax, -1
+ 00048 74 c1 je SHORT $LN10@gzflush
+$LN8@gzflush:
+
+; 488 : return -1;
+; 489 : }
+; 490 :
+; 491 : /* compress remaining data with requested flush */
+; 492 : gz_comp(state, flush);
+
+ 0004a 8b 55 0c mov edx, DWORD PTR _flush$[ebp]
+ 0004d 8b ce mov ecx, esi
+ 0004f e8 00 00 00 00 call _gz_comp
+
+; 493 : return state->err;
+
+ 00054 8b 46 5c mov eax, DWORD PTR [esi+92]
+ 00057 5e pop esi
+
+; 494 : }
+
+ 00058 5d pop ebp
+ 00059 c2 08 00 ret 8
+$LN4@gzflush:
+
+; 478 : return Z_STREAM_ERROR;
+
+ 0005c b8 fe ff ff ff mov eax, -2 ; fffffffeH
+ 00061 5e pop esi
+
+; 494 : }
+
+ 00062 5d pop ebp
+ 00063 c2 08 00 ret 8
+_gzflush@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\gzwrite.c
+; COMDAT _gzsetparams@12
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_level$ = 12 ; size = 4
+_strategy$ = 16 ; size = 4
+_gzsetparams@12 PROC ; COMDAT
+
+; 501 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 56 push esi
+
+; 502 : gz_statep state;
+; 503 : z_streamp strm;
+; 504 :
+; 505 : /* get internal structure */
+; 506 : if (file == NULL)
+
+ 00004 8b 75 08 mov esi, DWORD PTR _file$[ebp]
+ 00007 85 f6 test esi, esi
+ 00009 75 0a jne SHORT $LN2@gzsetparam
+$LN4@gzsetparam:
+
+; 507 : return Z_STREAM_ERROR;
+
+ 0000b b8 fe ff ff ff mov eax, -2 ; fffffffeH
+ 00010 5e pop esi
+
+; 536 : }
+
+ 00011 5d pop ebp
+ 00012 c2 0c 00 ret 12 ; 0000000cH
+$LN2@gzsetparam:
+
+; 508 : state = (gz_statep)file;
+; 509 : strm = &(state->strm);
+; 510 :
+; 511 : /* check that we're writing and that there's no error */
+; 512 : if (state->mode != GZ_WRITE || state->err != Z_OK)
+
+ 00015 81 7e 10 b1 79
+ 00 00 cmp DWORD PTR [esi+16], 31153 ; 000079b1H
+ 0001c 8d 46 64 lea eax, DWORD PTR [esi+100]
+ 0001f 75 ea jne SHORT $LN4@gzsetparam
+ 00021 83 7e 5c 00 cmp DWORD PTR [esi+92], 0
+ 00025 75 e4 jne SHORT $LN4@gzsetparam
+
+; 513 : return Z_STREAM_ERROR;
+; 514 :
+; 515 : /* if no change is requested, then do nothing */
+; 516 : if (level == state->level && strategy == state->strategy)
+
+ 00027 53 push ebx
+ 00028 8b 5d 0c mov ebx, DWORD PTR _level$[ebp]
+ 0002b 57 push edi
+ 0002c 8b 7d 10 mov edi, DWORD PTR _strategy$[ebp]
+ 0002f 3b 5e 48 cmp ebx, DWORD PTR [esi+72]
+ 00032 75 05 jne SHORT $LN5@gzsetparam
+ 00034 3b 7e 4c cmp edi, DWORD PTR [esi+76]
+ 00037 74 66 je SHORT $LN15@gzsetparam
+$LN5@gzsetparam:
+
+; 517 : return Z_OK;
+; 518 :
+; 519 : /* check for seek request */
+; 520 : if (state->seek) {
+
+ 00039 83 7e 58 00 cmp DWORD PTR [esi+88], 0
+ 0003d 74 28 je SHORT $LN7@gzsetparam
+
+; 521 : state->seek = 0;
+; 522 : if (gz_zero(state, state->skip) == -1)
+
+ 0003f ff 76 54 push DWORD PTR [esi+84]
+ 00042 8b ce mov ecx, esi
+ 00044 c7 46 58 00 00
+ 00 00 mov DWORD PTR [esi+88], 0
+ 0004b ff 76 50 push DWORD PTR [esi+80]
+ 0004e e8 00 00 00 00 call _gz_zero
+ 00053 83 c4 08 add esp, 8
+ 00056 83 f8 ff cmp eax, -1
+ 00059 75 09 jne SHORT $LN12@gzsetparam
+
+; 523 : return -1;
+
+ 0005b 5f pop edi
+ 0005c 5b pop ebx
+ 0005d 0b c0 or eax, eax
+ 0005f 5e pop esi
+
+; 536 : }
+
+ 00060 5d pop ebp
+ 00061 c2 0c 00 ret 12 ; 0000000cH
+$LN12@gzsetparam:
+ 00064 8d 46 64 lea eax, DWORD PTR [esi+100]
+$LN7@gzsetparam:
+
+; 524 : }
+; 525 :
+; 526 : /* change compression parameters for subsequent input */
+; 527 : if (state->size) {
+
+ 00067 83 7e 1c 00 cmp DWORD PTR [esi+28], 0
+ 0006b 74 2c je SHORT $LN8@gzsetparam
+
+; 528 : /* flush previous input with previous parameters before changing */
+; 529 : if (strm->avail_in && gz_comp(state, Z_PARTIAL_FLUSH) == -1)
+
+ 0006d 83 78 04 00 cmp DWORD PTR [eax+4], 0
+ 00071 74 1e je SHORT $LN9@gzsetparam
+ 00073 ba 01 00 00 00 mov edx, 1
+ 00078 8b ce mov ecx, esi
+ 0007a e8 00 00 00 00 call _gz_comp
+ 0007f 83 f8 ff cmp eax, -1
+ 00082 75 0a jne SHORT $LN11@gzsetparam
+
+; 530 : return state->err;
+
+ 00084 8b 46 5c mov eax, DWORD PTR [esi+92]
+ 00087 5f pop edi
+ 00088 5b pop ebx
+ 00089 5e pop esi
+
+; 536 : }
+
+ 0008a 5d pop ebp
+ 0008b c2 0c 00 ret 12 ; 0000000cH
+$LN11@gzsetparam:
+ 0008e 8d 46 64 lea eax, DWORD PTR [esi+100]
+$LN9@gzsetparam:
+
+; 531 : deflateParams(strm, level, strategy);
+
+ 00091 57 push edi
+ 00092 53 push ebx
+ 00093 50 push eax
+ 00094 e8 00 00 00 00 call _deflateParams@12
+$LN8@gzsetparam:
+
+; 532 : }
+; 533 : state->level = level;
+
+ 00099 89 5e 48 mov DWORD PTR [esi+72], ebx
+
+; 534 : state->strategy = strategy;
+
+ 0009c 89 7e 4c mov DWORD PTR [esi+76], edi
+$LN15@gzsetparam:
+
+; 535 : return Z_OK;
+
+ 0009f 5f pop edi
+ 000a0 5b pop ebx
+ 000a1 33 c0 xor eax, eax
+ 000a3 5e pop esi
+
+; 536 : }
+
+ 000a4 5d pop ebp
+ 000a5 c2 0c 00 ret 12 ; 0000000cH
+_gzsetparams@12 ENDP
+_TEXT ENDS
+END
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzwrite.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzwrite.obj
new file mode 100644
index 0000000000..ebc4fb6798
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/gzwrite.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/infback.cod b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/infback.cod
new file mode 100644
index 0000000000..54b07f8d38
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/infback.cod
@@ -0,0 +1,4354 @@
+; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.23506.0
+
+ TITLE d:\downloads\tgl-master\tgl-master\zlib\infback.c
+ .686P
+ .XMM
+ include listing.inc
+ .model flat
+
+INCLUDELIB OLDNAMES
+
+PUBLIC ??_C@_0BD@PJCBIDD@invalid?5block?5type?$AA@ ; `string'
+PUBLIC ??_C@_0BN@LGAADGOK@invalid?5stored?5block?5lengths?$AA@ ; `string'
+PUBLIC ??_C@_0CE@GMIGFPBB@too?5many?5length?5or?5distance?5symb@ ; `string'
+PUBLIC ??_C@_0BJ@HDEPPGOH@invalid?5code?5lengths?5set?$AA@ ; `string'
+PUBLIC ??_C@_0BK@BMMPFBBH@invalid?5bit?5length?5repeat?$AA@ ; `string'
+PUBLIC ??_C@_0CF@DGDMADCD@invalid?5code?5?9?9?5missing?5end?9of?9b@ ; `string'
+PUBLIC ??_C@_0BM@IIMGAINC@invalid?5literal?1lengths?5set?$AA@ ; `string'
+PUBLIC ??_C@_0BG@GMDFCBGP@invalid?5distances?5set?$AA@ ; `string'
+PUBLIC ??_C@_0BM@FFFLPBBC@invalid?5literal?1length?5code?$AA@ ; `string'
+PUBLIC ??_C@_0BG@LBKINIKP@invalid?5distance?5code?$AA@ ; `string'
+PUBLIC ??_C@_0BO@ECPMAOGG@invalid?5distance?5too?5far?5back?$AA@ ; `string'
+; COMDAT ??_C@_0BO@ECPMAOGG@invalid?5distance?5too?5far?5back?$AA@
+CONST SEGMENT
+??_C@_0BO@ECPMAOGG@invalid?5distance?5too?5far?5back?$AA@ DB 'invalid dis'
+ DB 'tance too far back', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_0BG@LBKINIKP@invalid?5distance?5code?$AA@
+CONST SEGMENT
+??_C@_0BG@LBKINIKP@invalid?5distance?5code?$AA@ DB 'invalid distance code'
+ DB 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_0BM@FFFLPBBC@invalid?5literal?1length?5code?$AA@
+CONST SEGMENT
+??_C@_0BM@FFFLPBBC@invalid?5literal?1length?5code?$AA@ DB 'invalid litera'
+ DB 'l/length code', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_0BG@GMDFCBGP@invalid?5distances?5set?$AA@
+CONST SEGMENT
+??_C@_0BG@GMDFCBGP@invalid?5distances?5set?$AA@ DB 'invalid distances set'
+ DB 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_0BM@IIMGAINC@invalid?5literal?1lengths?5set?$AA@
+CONST SEGMENT
+??_C@_0BM@IIMGAINC@invalid?5literal?1lengths?5set?$AA@ DB 'invalid litera'
+ DB 'l/lengths set', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_0CF@DGDMADCD@invalid?5code?5?9?9?5missing?5end?9of?9b@
+CONST SEGMENT
+??_C@_0CF@DGDMADCD@invalid?5code?5?9?9?5missing?5end?9of?9b@ DB 'invalid '
+ DB 'code -- missing end-of-block', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_0BK@BMMPFBBH@invalid?5bit?5length?5repeat?$AA@
+CONST SEGMENT
+??_C@_0BK@BMMPFBBH@invalid?5bit?5length?5repeat?$AA@ DB 'invalid bit leng'
+ DB 'th repeat', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_0BJ@HDEPPGOH@invalid?5code?5lengths?5set?$AA@
+CONST SEGMENT
+??_C@_0BJ@HDEPPGOH@invalid?5code?5lengths?5set?$AA@ DB 'invalid code leng'
+ DB 'ths set', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_0CE@GMIGFPBB@too?5many?5length?5or?5distance?5symb@
+CONST SEGMENT
+??_C@_0CE@GMIGFPBB@too?5many?5length?5or?5distance?5symb@ DB 'too many le'
+ DB 'ngth or distance symbols', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_0BN@LGAADGOK@invalid?5stored?5block?5lengths?$AA@
+CONST SEGMENT
+??_C@_0BN@LGAADGOK@invalid?5stored?5block?5lengths?$AA@ DB 'invalid store'
+ DB 'd block lengths', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_0BD@PJCBIDD@invalid?5block?5type?$AA@
+CONST SEGMENT
+??_C@_0BD@PJCBIDD@invalid?5block?5type?$AA@ DB 'invalid block type', 00H ; `string'
+?lenfix@?1??fixedtables@@9@9 DB 060H ; `fixedtables'::`2'::lenfix
+ DB 07H
+ DW 00H
+ DB 00H
+ DB 08H
+ DW 050H
+ DB 00H
+ DB 08H
+ DW 010H
+ DB 014H
+ DB 08H
+ DW 073H
+ DB 012H
+ DB 07H
+ DW 01fH
+ DB 00H
+ DB 08H
+ DW 070H
+ DB 00H
+ DB 08H
+ DW 030H
+ DB 00H
+ DB 09H
+ DW 0c0H
+ DB 010H
+ DB 07H
+ DW 0aH
+ DB 00H
+ DB 08H
+ DW 060H
+ DB 00H
+ DB 08H
+ DW 020H
+ DB 00H
+ DB 09H
+ DW 0a0H
+ DB 00H
+ DB 08H
+ DW 00H
+ DB 00H
+ DB 08H
+ DW 080H
+ DB 00H
+ DB 08H
+ DW 040H
+ DB 00H
+ DB 09H
+ DW 0e0H
+ DB 010H
+ DB 07H
+ DW 06H
+ DB 00H
+ DB 08H
+ DW 058H
+ DB 00H
+ DB 08H
+ DW 018H
+ DB 00H
+ DB 09H
+ DW 090H
+ DB 013H
+ DB 07H
+ DW 03bH
+ DB 00H
+ DB 08H
+ DW 078H
+ DB 00H
+ DB 08H
+ DW 038H
+ DB 00H
+ DB 09H
+ DW 0d0H
+ DB 011H
+ DB 07H
+ DW 011H
+ DB 00H
+ DB 08H
+ DW 068H
+ DB 00H
+ DB 08H
+ DW 028H
+ DB 00H
+ DB 09H
+ DW 0b0H
+ DB 00H
+ DB 08H
+ DW 08H
+ DB 00H
+ DB 08H
+ DW 088H
+ DB 00H
+ DB 08H
+ DW 048H
+ DB 00H
+ DB 09H
+ DW 0f0H
+ DB 010H
+ DB 07H
+ DW 04H
+ DB 00H
+ DB 08H
+ DW 054H
+ DB 00H
+ DB 08H
+ DW 014H
+ DB 015H
+ DB 08H
+ DW 0e3H
+ DB 013H
+ DB 07H
+ DW 02bH
+ DB 00H
+ DB 08H
+ DW 074H
+ DB 00H
+ DB 08H
+ DW 034H
+ DB 00H
+ DB 09H
+ DW 0c8H
+ DB 011H
+ DB 07H
+ DW 0dH
+ DB 00H
+ DB 08H
+ DW 064H
+ DB 00H
+ DB 08H
+ DW 024H
+ DB 00H
+ DB 09H
+ DW 0a8H
+ DB 00H
+ DB 08H
+ DW 04H
+ DB 00H
+ DB 08H
+ DW 084H
+ DB 00H
+ DB 08H
+ DW 044H
+ DB 00H
+ DB 09H
+ DW 0e8H
+ DB 010H
+ DB 07H
+ DW 08H
+ DB 00H
+ DB 08H
+ DW 05cH
+ DB 00H
+ DB 08H
+ DW 01cH
+ DB 00H
+ DB 09H
+ DW 098H
+ DB 014H
+ DB 07H
+ DW 053H
+ DB 00H
+ DB 08H
+ DW 07cH
+ DB 00H
+ DB 08H
+ DW 03cH
+ DB 00H
+ DB 09H
+ DW 0d8H
+ DB 012H
+ DB 07H
+ DW 017H
+ DB 00H
+ DB 08H
+ DW 06cH
+ DB 00H
+ DB 08H
+ DW 02cH
+ DB 00H
+ DB 09H
+ DW 0b8H
+ DB 00H
+ DB 08H
+ DW 0cH
+ DB 00H
+ DB 08H
+ DW 08cH
+ DB 00H
+ DB 08H
+ DW 04cH
+ DB 00H
+ DB 09H
+ DW 0f8H
+ DB 010H
+ DB 07H
+ DW 03H
+ DB 00H
+ DB 08H
+ DW 052H
+ DB 00H
+ DB 08H
+ DW 012H
+ DB 015H
+ DB 08H
+ DW 0a3H
+ DB 013H
+ DB 07H
+ DW 023H
+ DB 00H
+ DB 08H
+ DW 072H
+ DB 00H
+ DB 08H
+ DW 032H
+ DB 00H
+ DB 09H
+ DW 0c4H
+ DB 011H
+ DB 07H
+ DW 0bH
+ DB 00H
+ DB 08H
+ DW 062H
+ DB 00H
+ DB 08H
+ DW 022H
+ DB 00H
+ DB 09H
+ DW 0a4H
+ DB 00H
+ DB 08H
+ DW 02H
+ DB 00H
+ DB 08H
+ DW 082H
+ DB 00H
+ DB 08H
+ DW 042H
+ DB 00H
+ DB 09H
+ DW 0e4H
+ DB 010H
+ DB 07H
+ DW 07H
+ DB 00H
+ DB 08H
+ DW 05aH
+ DB 00H
+ DB 08H
+ DW 01aH
+ DB 00H
+ DB 09H
+ DW 094H
+ DB 014H
+ DB 07H
+ DW 043H
+ DB 00H
+ DB 08H
+ DW 07aH
+ DB 00H
+ DB 08H
+ DW 03aH
+ DB 00H
+ DB 09H
+ DW 0d4H
+ DB 012H
+ DB 07H
+ DW 013H
+ DB 00H
+ DB 08H
+ DW 06aH
+ DB 00H
+ DB 08H
+ DW 02aH
+ DB 00H
+ DB 09H
+ DW 0b4H
+ DB 00H
+ DB 08H
+ DW 0aH
+ DB 00H
+ DB 08H
+ DW 08aH
+ DB 00H
+ DB 08H
+ DW 04aH
+ DB 00H
+ DB 09H
+ DW 0f4H
+ DB 010H
+ DB 07H
+ DW 05H
+ DB 00H
+ DB 08H
+ DW 056H
+ DB 00H
+ DB 08H
+ DW 016H
+ DB 040H
+ DB 08H
+ DW 00H
+ DB 013H
+ DB 07H
+ DW 033H
+ DB 00H
+ DB 08H
+ DW 076H
+ DB 00H
+ DB 08H
+ DW 036H
+ DB 00H
+ DB 09H
+ DW 0ccH
+ DB 011H
+ DB 07H
+ DW 0fH
+ DB 00H
+ DB 08H
+ DW 066H
+ DB 00H
+ DB 08H
+ DW 026H
+ DB 00H
+ DB 09H
+ DW 0acH
+ DB 00H
+ DB 08H
+ DW 06H
+ DB 00H
+ DB 08H
+ DW 086H
+ DB 00H
+ DB 08H
+ DW 046H
+ DB 00H
+ DB 09H
+ DW 0ecH
+ DB 010H
+ DB 07H
+ DW 09H
+ DB 00H
+ DB 08H
+ DW 05eH
+ DB 00H
+ DB 08H
+ DW 01eH
+ DB 00H
+ DB 09H
+ DW 09cH
+ DB 014H
+ DB 07H
+ DW 063H
+ DB 00H
+ DB 08H
+ DW 07eH
+ DB 00H
+ DB 08H
+ DW 03eH
+ DB 00H
+ DB 09H
+ DW 0dcH
+ DB 012H
+ DB 07H
+ DW 01bH
+ DB 00H
+ DB 08H
+ DW 06eH
+ DB 00H
+ DB 08H
+ DW 02eH
+ DB 00H
+ DB 09H
+ DW 0bcH
+ DB 00H
+ DB 08H
+ DW 0eH
+ DB 00H
+ DB 08H
+ DW 08eH
+ DB 00H
+ DB 08H
+ DW 04eH
+ DB 00H
+ DB 09H
+ DW 0fcH
+ DB 060H
+ DB 07H
+ DW 00H
+ DB 00H
+ DB 08H
+ DW 051H
+ DB 00H
+ DB 08H
+ DW 011H
+ DB 015H
+ DB 08H
+ DW 083H
+ DB 012H
+ DB 07H
+ DW 01fH
+ DB 00H
+ DB 08H
+ DW 071H
+ DB 00H
+ DB 08H
+ DW 031H
+ DB 00H
+ DB 09H
+ DW 0c2H
+ DB 010H
+ DB 07H
+ DW 0aH
+ DB 00H
+ DB 08H
+ DW 061H
+ DB 00H
+ DB 08H
+ DW 021H
+ DB 00H
+ DB 09H
+ DW 0a2H
+ DB 00H
+ DB 08H
+ DW 01H
+ DB 00H
+ DB 08H
+ DW 081H
+ DB 00H
+ DB 08H
+ DW 041H
+ DB 00H
+ DB 09H
+ DW 0e2H
+ DB 010H
+ DB 07H
+ DW 06H
+ DB 00H
+ DB 08H
+ DW 059H
+ DB 00H
+ DB 08H
+ DW 019H
+ DB 00H
+ DB 09H
+ DW 092H
+ DB 013H
+ DB 07H
+ DW 03bH
+ DB 00H
+ DB 08H
+ DW 079H
+ DB 00H
+ DB 08H
+ DW 039H
+ DB 00H
+ DB 09H
+ DW 0d2H
+ DB 011H
+ DB 07H
+ DW 011H
+ DB 00H
+ DB 08H
+ DW 069H
+ DB 00H
+ DB 08H
+ DW 029H
+ DB 00H
+ DB 09H
+ DW 0b2H
+ DB 00H
+ DB 08H
+ DW 09H
+ DB 00H
+ DB 08H
+ DW 089H
+ DB 00H
+ DB 08H
+ DW 049H
+ DB 00H
+ DB 09H
+ DW 0f2H
+ DB 010H
+ DB 07H
+ DW 04H
+ DB 00H
+ DB 08H
+ DW 055H
+ DB 00H
+ DB 08H
+ DW 015H
+ DB 010H
+ DB 08H
+ DW 0102H
+ DB 013H
+ DB 07H
+ DW 02bH
+ DB 00H
+ DB 08H
+ DW 075H
+ DB 00H
+ DB 08H
+ DW 035H
+ DB 00H
+ DB 09H
+ DW 0caH
+ DB 011H
+ DB 07H
+ DW 0dH
+ DB 00H
+ DB 08H
+ DW 065H
+ DB 00H
+ DB 08H
+ DW 025H
+ DB 00H
+ DB 09H
+ DW 0aaH
+ DB 00H
+ DB 08H
+ DW 05H
+ DB 00H
+ DB 08H
+ DW 085H
+ DB 00H
+ DB 08H
+ DW 045H
+ DB 00H
+ DB 09H
+ DW 0eaH
+ DB 010H
+ DB 07H
+ DW 08H
+ DB 00H
+ DB 08H
+ DW 05dH
+ DB 00H
+ DB 08H
+ DW 01dH
+ DB 00H
+ DB 09H
+ DW 09aH
+ DB 014H
+ DB 07H
+ DW 053H
+ DB 00H
+ DB 08H
+ DW 07dH
+ DB 00H
+ DB 08H
+ DW 03dH
+ DB 00H
+ DB 09H
+ DW 0daH
+ DB 012H
+ DB 07H
+ DW 017H
+ DB 00H
+ DB 08H
+ DW 06dH
+ DB 00H
+ DB 08H
+ DW 02dH
+ DB 00H
+ DB 09H
+ DW 0baH
+ DB 00H
+ DB 08H
+ DW 0dH
+ DB 00H
+ DB 08H
+ DW 08dH
+ DB 00H
+ DB 08H
+ DW 04dH
+ DB 00H
+ DB 09H
+ DW 0faH
+ DB 010H
+ DB 07H
+ DW 03H
+ DB 00H
+ DB 08H
+ DW 053H
+ DB 00H
+ DB 08H
+ DW 013H
+ DB 015H
+ DB 08H
+ DW 0c3H
+ DB 013H
+ DB 07H
+ DW 023H
+ DB 00H
+ DB 08H
+ DW 073H
+ DB 00H
+ DB 08H
+ DW 033H
+ DB 00H
+ DB 09H
+ DW 0c6H
+ DB 011H
+ DB 07H
+ DW 0bH
+ DB 00H
+ DB 08H
+ DW 063H
+ DB 00H
+ DB 08H
+ DW 023H
+ DB 00H
+ DB 09H
+ DW 0a6H
+ DB 00H
+ DB 08H
+ DW 03H
+ DB 00H
+ DB 08H
+ DW 083H
+ DB 00H
+ DB 08H
+ DW 043H
+ DB 00H
+ DB 09H
+ DW 0e6H
+ DB 010H
+ DB 07H
+ DW 07H
+ DB 00H
+ DB 08H
+ DW 05bH
+ DB 00H
+ DB 08H
+ DW 01bH
+ DB 00H
+ DB 09H
+ DW 096H
+ DB 014H
+ DB 07H
+ DW 043H
+ DB 00H
+ DB 08H
+ DW 07bH
+ DB 00H
+ DB 08H
+ DW 03bH
+ DB 00H
+ DB 09H
+ DW 0d6H
+ DB 012H
+ DB 07H
+ DW 013H
+ DB 00H
+ DB 08H
+ DW 06bH
+ DB 00H
+ DB 08H
+ DW 02bH
+ DB 00H
+ DB 09H
+ DW 0b6H
+ DB 00H
+ DB 08H
+ DW 0bH
+ DB 00H
+ DB 08H
+ DW 08bH
+ DB 00H
+ DB 08H
+ DW 04bH
+ DB 00H
+ DB 09H
+ DW 0f6H
+ DB 010H
+ DB 07H
+ DW 05H
+ DB 00H
+ DB 08H
+ DW 057H
+ DB 00H
+ DB 08H
+ DW 017H
+ DB 040H
+ DB 08H
+ DW 00H
+ DB 013H
+ DB 07H
+ DW 033H
+ DB 00H
+ DB 08H
+ DW 077H
+ DB 00H
+ DB 08H
+ DW 037H
+ DB 00H
+ DB 09H
+ DW 0ceH
+ DB 011H
+ DB 07H
+ DW 0fH
+ DB 00H
+ DB 08H
+ DW 067H
+ DB 00H
+ DB 08H
+ DW 027H
+ DB 00H
+ DB 09H
+ DW 0aeH
+ DB 00H
+ DB 08H
+ DW 07H
+ DB 00H
+ DB 08H
+ DW 087H
+ DB 00H
+ DB 08H
+ DW 047H
+ DB 00H
+ DB 09H
+ DW 0eeH
+ DB 010H
+ DB 07H
+ DW 09H
+ DB 00H
+ DB 08H
+ DW 05fH
+ DB 00H
+ DB 08H
+ DW 01fH
+ DB 00H
+ DB 09H
+ DW 09eH
+ DB 014H
+ DB 07H
+ DW 063H
+ DB 00H
+ DB 08H
+ DW 07fH
+ DB 00H
+ DB 08H
+ DW 03fH
+ DB 00H
+ DB 09H
+ DW 0deH
+ DB 012H
+ DB 07H
+ DW 01bH
+ DB 00H
+ DB 08H
+ DW 06fH
+ DB 00H
+ DB 08H
+ DW 02fH
+ DB 00H
+ DB 09H
+ DW 0beH
+ DB 00H
+ DB 08H
+ DW 0fH
+ DB 00H
+ DB 08H
+ DW 08fH
+ DB 00H
+ DB 08H
+ DW 04fH
+ DB 00H
+ DB 09H
+ DW 0feH
+ DB 060H
+ DB 07H
+ DW 00H
+ DB 00H
+ DB 08H
+ DW 050H
+ DB 00H
+ DB 08H
+ DW 010H
+ DB 014H
+ DB 08H
+ DW 073H
+ DB 012H
+ DB 07H
+ DW 01fH
+ DB 00H
+ DB 08H
+ DW 070H
+ DB 00H
+ DB 08H
+ DW 030H
+ DB 00H
+ DB 09H
+ DW 0c1H
+ DB 010H
+ DB 07H
+ DW 0aH
+ DB 00H
+ DB 08H
+ DW 060H
+ DB 00H
+ DB 08H
+ DW 020H
+ DB 00H
+ DB 09H
+ DW 0a1H
+ DB 00H
+ DB 08H
+ DW 00H
+ DB 00H
+ DB 08H
+ DW 080H
+ DB 00H
+ DB 08H
+ DW 040H
+ DB 00H
+ DB 09H
+ DW 0e1H
+ DB 010H
+ DB 07H
+ DW 06H
+ DB 00H
+ DB 08H
+ DW 058H
+ DB 00H
+ DB 08H
+ DW 018H
+ DB 00H
+ DB 09H
+ DW 091H
+ DB 013H
+ DB 07H
+ DW 03bH
+ DB 00H
+ DB 08H
+ DW 078H
+ DB 00H
+ DB 08H
+ DW 038H
+ DB 00H
+ DB 09H
+ DW 0d1H
+ DB 011H
+ DB 07H
+ DW 011H
+ DB 00H
+ DB 08H
+ DW 068H
+ DB 00H
+ DB 08H
+ DW 028H
+ DB 00H
+ DB 09H
+ DW 0b1H
+ DB 00H
+ DB 08H
+ DW 08H
+ DB 00H
+ DB 08H
+ DW 088H
+ DB 00H
+ DB 08H
+ DW 048H
+ DB 00H
+ DB 09H
+ DW 0f1H
+ DB 010H
+ DB 07H
+ DW 04H
+ DB 00H
+ DB 08H
+ DW 054H
+ DB 00H
+ DB 08H
+ DW 014H
+ DB 015H
+ DB 08H
+ DW 0e3H
+ DB 013H
+ DB 07H
+ DW 02bH
+ DB 00H
+ DB 08H
+ DW 074H
+ DB 00H
+ DB 08H
+ DW 034H
+ DB 00H
+ DB 09H
+ DW 0c9H
+ DB 011H
+ DB 07H
+ DW 0dH
+ DB 00H
+ DB 08H
+ DW 064H
+ DB 00H
+ DB 08H
+ DW 024H
+ DB 00H
+ DB 09H
+ DW 0a9H
+ DB 00H
+ DB 08H
+ DW 04H
+ DB 00H
+ DB 08H
+ DW 084H
+ DB 00H
+ DB 08H
+ DW 044H
+ DB 00H
+ DB 09H
+ DW 0e9H
+ DB 010H
+ DB 07H
+ DW 08H
+ DB 00H
+ DB 08H
+ DW 05cH
+ DB 00H
+ DB 08H
+ DW 01cH
+ DB 00H
+ DB 09H
+ DW 099H
+ DB 014H
+ DB 07H
+ DW 053H
+ DB 00H
+ DB 08H
+ DW 07cH
+ DB 00H
+ DB 08H
+ DW 03cH
+ DB 00H
+ DB 09H
+ DW 0d9H
+ DB 012H
+ DB 07H
+ DW 017H
+ DB 00H
+ DB 08H
+ DW 06cH
+ DB 00H
+ DB 08H
+ DW 02cH
+ DB 00H
+ DB 09H
+ DW 0b9H
+ DB 00H
+ DB 08H
+ DW 0cH
+ DB 00H
+ DB 08H
+ DW 08cH
+ DB 00H
+ DB 08H
+ DW 04cH
+ DB 00H
+ DB 09H
+ DW 0f9H
+ DB 010H
+ DB 07H
+ DW 03H
+ DB 00H
+ DB 08H
+ DW 052H
+ DB 00H
+ DB 08H
+ DW 012H
+ DB 015H
+ DB 08H
+ DW 0a3H
+ DB 013H
+ DB 07H
+ DW 023H
+ DB 00H
+ DB 08H
+ DW 072H
+ DB 00H
+ DB 08H
+ DW 032H
+ DB 00H
+ DB 09H
+ DW 0c5H
+ DB 011H
+ DB 07H
+ DW 0bH
+ DB 00H
+ DB 08H
+ DW 062H
+ DB 00H
+ DB 08H
+ DW 022H
+ DB 00H
+ DB 09H
+ DW 0a5H
+ DB 00H
+ DB 08H
+ DW 02H
+ DB 00H
+ DB 08H
+ DW 082H
+ DB 00H
+ DB 08H
+ DW 042H
+ DB 00H
+ DB 09H
+ DW 0e5H
+ DB 010H
+ DB 07H
+ DW 07H
+ DB 00H
+ DB 08H
+ DW 05aH
+ DB 00H
+ DB 08H
+ DW 01aH
+ DB 00H
+ DB 09H
+ DW 095H
+ DB 014H
+ DB 07H
+ DW 043H
+ DB 00H
+ DB 08H
+ DW 07aH
+ DB 00H
+ DB 08H
+ DW 03aH
+ DB 00H
+ DB 09H
+ DW 0d5H
+ DB 012H
+ DB 07H
+ DW 013H
+ DB 00H
+ DB 08H
+ DW 06aH
+ DB 00H
+ DB 08H
+ DW 02aH
+ DB 00H
+ DB 09H
+ DW 0b5H
+ DB 00H
+ DB 08H
+ DW 0aH
+ DB 00H
+ DB 08H
+ DW 08aH
+ DB 00H
+ DB 08H
+ DW 04aH
+ DB 00H
+ DB 09H
+ DW 0f5H
+ DB 010H
+ DB 07H
+ DW 05H
+ DB 00H
+ DB 08H
+ DW 056H
+ DB 00H
+ DB 08H
+ DW 016H
+ DB 040H
+ DB 08H
+ DW 00H
+ DB 013H
+ DB 07H
+ DW 033H
+ DB 00H
+ DB 08H
+ DW 076H
+ DB 00H
+ DB 08H
+ DW 036H
+ DB 00H
+ DB 09H
+ DW 0cdH
+ DB 011H
+ DB 07H
+ DW 0fH
+ DB 00H
+ DB 08H
+ DW 066H
+ DB 00H
+ DB 08H
+ DW 026H
+ DB 00H
+ DB 09H
+ DW 0adH
+ DB 00H
+ DB 08H
+ DW 06H
+ DB 00H
+ DB 08H
+ DW 086H
+ DB 00H
+ DB 08H
+ DW 046H
+ DB 00H
+ DB 09H
+ DW 0edH
+ DB 010H
+ DB 07H
+ DW 09H
+ DB 00H
+ DB 08H
+ DW 05eH
+ DB 00H
+ DB 08H
+ DW 01eH
+ DB 00H
+ DB 09H
+ DW 09dH
+ DB 014H
+ DB 07H
+ DW 063H
+ DB 00H
+ DB 08H
+ DW 07eH
+ DB 00H
+ DB 08H
+ DW 03eH
+ DB 00H
+ DB 09H
+ DW 0ddH
+ DB 012H
+ DB 07H
+ DW 01bH
+ DB 00H
+ DB 08H
+ DW 06eH
+ DB 00H
+ DB 08H
+ DW 02eH
+ DB 00H
+ DB 09H
+ DW 0bdH
+ DB 00H
+ DB 08H
+ DW 0eH
+ DB 00H
+ DB 08H
+ DW 08eH
+ DB 00H
+ DB 08H
+ DW 04eH
+ DB 00H
+ DB 09H
+ DW 0fdH
+ DB 060H
+ DB 07H
+ DW 00H
+ DB 00H
+ DB 08H
+ DW 051H
+ DB 00H
+ DB 08H
+ DW 011H
+ DB 015H
+ DB 08H
+ DW 083H
+ DB 012H
+ DB 07H
+ DW 01fH
+ DB 00H
+ DB 08H
+ DW 071H
+ DB 00H
+ DB 08H
+ DW 031H
+ DB 00H
+ DB 09H
+ DW 0c3H
+ DB 010H
+ DB 07H
+ DW 0aH
+ DB 00H
+ DB 08H
+ DW 061H
+ DB 00H
+ DB 08H
+ DW 021H
+ DB 00H
+ DB 09H
+ DW 0a3H
+ DB 00H
+ DB 08H
+ DW 01H
+ DB 00H
+ DB 08H
+ DW 081H
+ DB 00H
+ DB 08H
+ DW 041H
+ DB 00H
+ DB 09H
+ DW 0e3H
+ DB 010H
+ DB 07H
+ DW 06H
+ DB 00H
+ DB 08H
+ DW 059H
+ DB 00H
+ DB 08H
+ DW 019H
+ DB 00H
+ DB 09H
+ DW 093H
+ DB 013H
+ DB 07H
+ DW 03bH
+ DB 00H
+ DB 08H
+ DW 079H
+ DB 00H
+ DB 08H
+ DW 039H
+ DB 00H
+ DB 09H
+ DW 0d3H
+ DB 011H
+ DB 07H
+ DW 011H
+ DB 00H
+ DB 08H
+ DW 069H
+ DB 00H
+ DB 08H
+ DW 029H
+ DB 00H
+ DB 09H
+ DW 0b3H
+ DB 00H
+ DB 08H
+ DW 09H
+ DB 00H
+ DB 08H
+ DW 089H
+ DB 00H
+ DB 08H
+ DW 049H
+ DB 00H
+ DB 09H
+ DW 0f3H
+ DB 010H
+ DB 07H
+ DW 04H
+ DB 00H
+ DB 08H
+ DW 055H
+ DB 00H
+ DB 08H
+ DW 015H
+ DB 010H
+ DB 08H
+ DW 0102H
+ DB 013H
+ DB 07H
+ DW 02bH
+ DB 00H
+ DB 08H
+ DW 075H
+ DB 00H
+ DB 08H
+ DW 035H
+ DB 00H
+ DB 09H
+ DW 0cbH
+ DB 011H
+ DB 07H
+ DW 0dH
+ DB 00H
+ DB 08H
+ DW 065H
+ DB 00H
+ DB 08H
+ DW 025H
+ DB 00H
+ DB 09H
+ DW 0abH
+ DB 00H
+ DB 08H
+ DW 05H
+ DB 00H
+ DB 08H
+ DW 085H
+ DB 00H
+ DB 08H
+ DW 045H
+ DB 00H
+ DB 09H
+ DW 0ebH
+ DB 010H
+ DB 07H
+ DW 08H
+ DB 00H
+ DB 08H
+ DW 05dH
+ DB 00H
+ DB 08H
+ DW 01dH
+ DB 00H
+ DB 09H
+ DW 09bH
+ DB 014H
+ DB 07H
+ DW 053H
+ DB 00H
+ DB 08H
+ DW 07dH
+ DB 00H
+ DB 08H
+ DW 03dH
+ DB 00H
+ DB 09H
+ DW 0dbH
+ DB 012H
+ DB 07H
+ DW 017H
+ DB 00H
+ DB 08H
+ DW 06dH
+ DB 00H
+ DB 08H
+ DW 02dH
+ DB 00H
+ DB 09H
+ DW 0bbH
+ DB 00H
+ DB 08H
+ DW 0dH
+ DB 00H
+ DB 08H
+ DW 08dH
+ DB 00H
+ DB 08H
+ DW 04dH
+ DB 00H
+ DB 09H
+ DW 0fbH
+ DB 010H
+ DB 07H
+ DW 03H
+ DB 00H
+ DB 08H
+ DW 053H
+ DB 00H
+ DB 08H
+ DW 013H
+ DB 015H
+ DB 08H
+ DW 0c3H
+ DB 013H
+ DB 07H
+ DW 023H
+ DB 00H
+ DB 08H
+ DW 073H
+ DB 00H
+ DB 08H
+ DW 033H
+ DB 00H
+ DB 09H
+ DW 0c7H
+ DB 011H
+ DB 07H
+ DW 0bH
+ DB 00H
+ DB 08H
+ DW 063H
+ DB 00H
+ DB 08H
+ DW 023H
+ DB 00H
+ DB 09H
+ DW 0a7H
+ DB 00H
+ DB 08H
+ DW 03H
+ DB 00H
+ DB 08H
+ DW 083H
+ DB 00H
+ DB 08H
+ DW 043H
+ DB 00H
+ DB 09H
+ DW 0e7H
+ DB 010H
+ DB 07H
+ DW 07H
+ DB 00H
+ DB 08H
+ DW 05bH
+ DB 00H
+ DB 08H
+ DW 01bH
+ DB 00H
+ DB 09H
+ DW 097H
+ DB 014H
+ DB 07H
+ DW 043H
+ DB 00H
+ DB 08H
+ DW 07bH
+ DB 00H
+ DB 08H
+ DW 03bH
+ DB 00H
+ DB 09H
+ DW 0d7H
+ DB 012H
+ DB 07H
+ DW 013H
+ DB 00H
+ DB 08H
+ DW 06bH
+ DB 00H
+ DB 08H
+ DW 02bH
+ DB 00H
+ DB 09H
+ DW 0b7H
+ DB 00H
+ DB 08H
+ DW 0bH
+ DB 00H
+ DB 08H
+ DW 08bH
+ DB 00H
+ DB 08H
+ DW 04bH
+ DB 00H
+ DB 09H
+ DW 0f7H
+ DB 010H
+ DB 07H
+ DW 05H
+ DB 00H
+ DB 08H
+ DW 057H
+ DB 00H
+ DB 08H
+ DW 017H
+ DB 040H
+ DB 08H
+ DW 00H
+ DB 013H
+ DB 07H
+ DW 033H
+ DB 00H
+ DB 08H
+ DW 077H
+ DB 00H
+ DB 08H
+ DW 037H
+ DB 00H
+ DB 09H
+ DW 0cfH
+ DB 011H
+ DB 07H
+ DW 0fH
+ DB 00H
+ DB 08H
+ DW 067H
+ DB 00H
+ DB 08H
+ DW 027H
+ DB 00H
+ DB 09H
+ DW 0afH
+ DB 00H
+ DB 08H
+ DW 07H
+ DB 00H
+ DB 08H
+ DW 087H
+ DB 00H
+ DB 08H
+ DW 047H
+ DB 00H
+ DB 09H
+ DW 0efH
+ DB 010H
+ DB 07H
+ DW 09H
+ DB 00H
+ DB 08H
+ DW 05fH
+ DB 00H
+ DB 08H
+ DW 01fH
+ DB 00H
+ DB 09H
+ DW 09fH
+ DB 014H
+ DB 07H
+ DW 063H
+ DB 00H
+ DB 08H
+ DW 07fH
+ DB 00H
+ DB 08H
+ DW 03fH
+ DB 00H
+ DB 09H
+ DW 0dfH
+ DB 012H
+ DB 07H
+ DW 01bH
+ DB 00H
+ DB 08H
+ DW 06fH
+ DB 00H
+ DB 08H
+ DW 02fH
+ DB 00H
+ DB 09H
+ DW 0bfH
+ DB 00H
+ DB 08H
+ DW 0fH
+ DB 00H
+ DB 08H
+ DW 08fH
+ DB 00H
+ DB 08H
+ DW 04fH
+ DB 00H
+ DB 09H
+ DW 0ffH
+?distfix@?1??fixedtables@@9@9 DB 010H ; `fixedtables'::`2'::distfix
+ DB 05H
+ DW 01H
+ DB 017H
+ DB 05H
+ DW 0101H
+ DB 013H
+ DB 05H
+ DW 011H
+ DB 01bH
+ DB 05H
+ DW 01001H
+ DB 011H
+ DB 05H
+ DW 05H
+ DB 019H
+ DB 05H
+ DW 0401H
+ DB 015H
+ DB 05H
+ DW 041H
+ DB 01dH
+ DB 05H
+ DW 04001H
+ DB 010H
+ DB 05H
+ DW 03H
+ DB 018H
+ DB 05H
+ DW 0201H
+ DB 014H
+ DB 05H
+ DW 021H
+ DB 01cH
+ DB 05H
+ DW 02001H
+ DB 012H
+ DB 05H
+ DW 09H
+ DB 01aH
+ DB 05H
+ DW 0801H
+ DB 016H
+ DB 05H
+ DW 081H
+ DB 040H
+ DB 05H
+ DW 00H
+ DB 010H
+ DB 05H
+ DW 02H
+ DB 017H
+ DB 05H
+ DW 0181H
+ DB 013H
+ DB 05H
+ DW 019H
+ DB 01bH
+ DB 05H
+ DW 01801H
+ DB 011H
+ DB 05H
+ DW 07H
+ DB 019H
+ DB 05H
+ DW 0601H
+ DB 015H
+ DB 05H
+ DW 061H
+ DB 01dH
+ DB 05H
+ DW 06001H
+ DB 010H
+ DB 05H
+ DW 04H
+ DB 018H
+ DB 05H
+ DW 0301H
+ DB 014H
+ DB 05H
+ DW 031H
+ DB 01cH
+ DB 05H
+ DW 03001H
+ DB 012H
+ DB 05H
+ DW 0dH
+ DB 01aH
+ DB 05H
+ DW 0c01H
+ DB 016H
+ DB 05H
+ DW 0c1H
+ DB 040H
+ DB 05H
+ DW 00H
+?order@?1??inflateBack@@9@9 DW 010H ; `inflateBack'::`2'::order
+ DW 011H
+ DW 012H
+ DW 00H
+ DW 08H
+ DW 07H
+ DW 09H
+ DW 06H
+ DW 0aH
+ DW 05H
+ DW 0bH
+ DW 04H
+ DW 0cH
+ DW 03H
+ DW 0dH
+ DW 02H
+ DW 0eH
+ DW 01H
+ DW 0fH
+PUBLIC _inflateBackEnd@4
+PUBLIC _inflateBack@20
+PUBLIC _inflateBackInit_@20
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\infback.c
+; COMDAT _inflateBackInit_@20
+_TEXT SEGMENT
+_strm$ = 8 ; size = 4
+_windowBits$ = 12 ; size = 4
+_window$ = 16 ; size = 4
+_version$ = 20 ; size = 4
+_stream_size$ = 24 ; size = 4
+_inflateBackInit_@20 PROC ; COMDAT
+
+; 34 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 35 : struct inflate_state FAR *state;
+; 36 :
+; 37 : if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
+
+ 00003 8b 45 14 mov eax, DWORD PTR _version$[ebp]
+ 00006 85 c0 test eax, eax
+ 00008 0f 84 c0 00 00
+ 00 je $LN3@inflateBac
+ 0000e 80 38 31 cmp BYTE PTR [eax], 49 ; 00000031H
+ 00011 0f 85 b7 00 00
+ 00 jne $LN3@inflateBac
+ 00017 83 7d 18 38 cmp DWORD PTR _stream_size$[ebp], 56 ; 00000038H
+ 0001b 0f 85 ad 00 00
+ 00 jne $LN3@inflateBac
+
+; 40 : if (strm == Z_NULL || window == Z_NULL ||
+; 41 : windowBits < 8 || windowBits > 15)
+
+ 00021 53 push ebx
+ 00022 56 push esi
+ 00023 8b 75 08 mov esi, DWORD PTR _strm$[ebp]
+ 00026 57 push edi
+ 00027 85 f6 test esi, esi
+ 00029 0f 84 93 00 00
+ 00 je $LN5@inflateBac
+ 0002f 8b 5d 10 mov ebx, DWORD PTR _window$[ebp]
+ 00032 85 db test ebx, ebx
+ 00034 0f 84 88 00 00
+ 00 je $LN5@inflateBac
+ 0003a 8b 7d 0c mov edi, DWORD PTR _windowBits$[ebp]
+ 0003d 8d 47 f8 lea eax, DWORD PTR [edi-8]
+ 00040 83 f8 07 cmp eax, 7
+ 00043 77 7d ja SHORT $LN5@inflateBac
+
+; 43 : strm->msg = Z_NULL; /* in case we return an error */
+; 44 : if (strm->zalloc == (alloc_func)0) {
+
+ 00045 83 7e 20 00 cmp DWORD PTR [esi+32], 0
+ 00049 c7 46 18 00 00
+ 00 00 mov DWORD PTR [esi+24], 0
+ 00050 75 0e jne SHORT $LN6@inflateBac
+
+; 45 : #ifdef Z_SOLO
+; 46 : return Z_STREAM_ERROR;
+; 47 : #else
+; 48 : strm->zalloc = zcalloc;
+
+ 00052 c7 46 20 00 00
+ 00 00 mov DWORD PTR [esi+32], OFFSET _zcalloc
+
+; 49 : strm->opaque = (voidpf)0;
+
+ 00059 c7 46 28 00 00
+ 00 00 mov DWORD PTR [esi+40], 0
+$LN6@inflateBac:
+
+; 50 : #endif
+; 51 : }
+; 52 : if (strm->zfree == (free_func)0)
+
+ 00060 83 7e 24 00 cmp DWORD PTR [esi+36], 0
+ 00064 75 07 jne SHORT $LN7@inflateBac
+
+; 53 : #ifdef Z_SOLO
+; 54 : return Z_STREAM_ERROR;
+; 55 : #else
+; 56 : strm->zfree = zcfree;
+
+ 00066 c7 46 24 00 00
+ 00 00 mov DWORD PTR [esi+36], OFFSET _zcfree
+$LN7@inflateBac:
+
+; 57 : #endif
+; 58 : state = (struct inflate_state FAR *)ZALLOC(strm, 1,
+
+ 0006d 8b 46 20 mov eax, DWORD PTR [esi+32]
+ 00070 68 cc 1b 00 00 push 7116 ; 00001bccH
+ 00075 6a 01 push 1
+ 00077 ff 76 28 push DWORD PTR [esi+40]
+ 0007a ff d0 call eax
+ 0007c 8b d0 mov edx, eax
+ 0007e 83 c4 0c add esp, 12 ; 0000000cH
+
+; 59 : sizeof(struct inflate_state));
+; 60 : if (state == Z_NULL) return Z_MEM_ERROR;
+
+ 00081 85 d2 test edx, edx
+ 00083 75 0a jne SHORT $LN8@inflateBac
+ 00085 5f pop edi
+ 00086 5e pop esi
+ 00087 8d 42 fc lea eax, DWORD PTR [edx-4]
+ 0008a 5b pop ebx
+
+; 70 : }
+
+ 0008b 5d pop ebp
+ 0008c c2 14 00 ret 20 ; 00000014H
+$LN8@inflateBac:
+
+; 61 : Tracev((stderr, "inflate: allocated\n"));
+; 62 : strm->state = (struct internal_state FAR *)state;
+
+ 0008f 89 56 1c mov DWORD PTR [esi+28], edx
+
+; 63 : state->dmax = 32768U;
+; 64 : state->wbits = windowBits;
+; 65 : state->wsize = 1U << windowBits;
+
+ 00092 8b cf mov ecx, edi
+ 00094 89 7a 24 mov DWORD PTR [edx+36], edi
+ 00097 b8 01 00 00 00 mov eax, 1
+ 0009c 5f pop edi
+ 0009d d3 e0 shl eax, cl
+ 0009f 5e pop esi
+ 000a0 89 42 28 mov DWORD PTR [edx+40], eax
+
+; 66 : state->window = window;
+; 67 : state->wnext = 0;
+; 68 : state->whave = 0;
+; 69 : return Z_OK;
+
+ 000a3 33 c0 xor eax, eax
+ 000a5 89 5a 34 mov DWORD PTR [edx+52], ebx
+ 000a8 c7 42 14 00 80
+ 00 00 mov DWORD PTR [edx+20], 32768 ; 00008000H
+ 000af c7 42 30 00 00
+ 00 00 mov DWORD PTR [edx+48], 0
+ 000b6 c7 42 2c 00 00
+ 00 00 mov DWORD PTR [edx+44], 0
+ 000bd 5b pop ebx
+
+; 70 : }
+
+ 000be 5d pop ebp
+ 000bf c2 14 00 ret 20 ; 00000014H
+$LN5@inflateBac:
+ 000c2 5f pop edi
+ 000c3 5e pop esi
+
+; 42 : return Z_STREAM_ERROR;
+
+ 000c4 b8 fe ff ff ff mov eax, -2 ; fffffffeH
+ 000c9 5b pop ebx
+
+; 70 : }
+
+ 000ca 5d pop ebp
+ 000cb c2 14 00 ret 20 ; 00000014H
+$LN3@inflateBac:
+
+; 38 : stream_size != (int)(sizeof(z_stream)))
+; 39 : return Z_VERSION_ERROR;
+
+ 000ce b8 fa ff ff ff mov eax, -6 ; fffffffaH
+
+; 70 : }
+
+ 000d3 5d pop ebp
+ 000d4 c2 14 00 ret 20 ; 00000014H
+_inflateBackInit_@20 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\infback.c
+; COMDAT _fixedtables
+_TEXT SEGMENT
+_fixedtables PROC ; COMDAT
+; _state$ = ecx
+
+; 85 : #ifdef BUILDFIXED
+; 86 : static int virgin = 1;
+; 87 : static code *lenfix, *distfix;
+; 88 : static code fixed[544];
+; 89 :
+; 90 : /* build fixed huffman tables if first call (may not be thread safe) */
+; 91 : if (virgin) {
+; 92 : unsigned sym, bits;
+; 93 : static code *next;
+; 94 :
+; 95 : /* literal/length table */
+; 96 : sym = 0;
+; 97 : while (sym < 144) state->lens[sym++] = 8;
+; 98 : while (sym < 256) state->lens[sym++] = 9;
+; 99 : while (sym < 280) state->lens[sym++] = 7;
+; 100 : while (sym < 288) state->lens[sym++] = 8;
+; 101 : next = fixed;
+; 102 : lenfix = next;
+; 103 : bits = 9;
+; 104 : inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
+; 105 :
+; 106 : /* distance table */
+; 107 : sym = 0;
+; 108 : while (sym < 32) state->lens[sym++] = 5;
+; 109 : distfix = next;
+; 110 : bits = 5;
+; 111 : inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
+; 112 :
+; 113 : /* do this just once */
+; 114 : virgin = 0;
+; 115 : }
+; 116 : #else /* !BUILDFIXED */
+; 117 : # include "inffixed.h"
+; 118 : #endif /* BUILDFIXED */
+; 119 : state->lencode = lenfix;
+
+ 00000 c7 41 4c 00 00
+ 00 00 mov DWORD PTR [ecx+76], OFFSET ?lenfix@?1??fixedtables@@9@9
+
+; 120 : state->lenbits = 9;
+
+ 00007 c7 41 54 09 00
+ 00 00 mov DWORD PTR [ecx+84], 9
+
+; 121 : state->distcode = distfix;
+
+ 0000e c7 41 50 00 00
+ 00 00 mov DWORD PTR [ecx+80], OFFSET ?distfix@?1??fixedtables@@9@9
+
+; 122 : state->distbits = 5;
+
+ 00015 c7 41 58 05 00
+ 00 00 mov DWORD PTR [ecx+88], 5
+
+; 123 : }
+
+ 0001c c3 ret 0
+_fixedtables ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\infback.c
+; COMDAT _inflateBack@20
+_TEXT SEGMENT
+tv1719 = -48 ; size = 4
+tv1718 = -48 ; size = 4
+tv1717 = -48 ; size = 4
+$T1 = -44 ; size = 4
+tv1711 = -44 ; size = 4
+tv1709 = -44 ; size = 4
+tv1708 = -44 ; size = 4
+tv1722 = -40 ; size = 4
+_len$1$ = -36 ; size = 4
+_here$1$ = -36 ; size = 4
+_copy$4$ = -32 ; size = 4
+_last$ = -32 ; size = 4
+_here$ = -32 ; size = 4
+_put$1$ = -28 ; size = 4
+_left$1$ = -24 ; size = 4
+_bits$1$ = -20 ; size = 4
+_next$5$ = -16 ; size = 4
+_state$1$ = -12 ; size = 4
+_next$ = -8 ; size = 4
+_hold$1$ = -4 ; size = 4
+_strm$ = 8 ; size = 4
+_in$ = 12 ; size = 4
+_in_desc$ = 16 ; size = 4
+_out$ = 20 ; size = 4
+_out_desc$ = 24 ; size = 4
+_inflateBack@20 PROC ; COMDAT
+
+; 256 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 257 : struct inflate_state FAR *state;
+; 258 : z_const unsigned char FAR *next; /* next input */
+; 259 : unsigned char FAR *put; /* next output */
+; 260 : unsigned have, left; /* available input and output */
+; 261 : unsigned long hold; /* bit buffer */
+; 262 : unsigned bits; /* bits in bit buffer */
+; 263 : unsigned copy; /* number of stored or match bytes to copy */
+; 264 : unsigned char FAR *from; /* where to copy match bytes from */
+; 265 : code here; /* current decoding table entry */
+; 266 : code last; /* parent table entry */
+; 267 : unsigned len; /* length to copy for repeats, bits to drop */
+; 268 : int ret; /* return code */
+; 269 : static const unsigned short order[19] = /* permutation of code lengths */
+; 270 : {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
+; 271 :
+; 272 : /* Check that the strm exists and that the state was initialized */
+; 273 : if (strm == Z_NULL || strm->state == Z_NULL)
+
+ 00003 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 00006 83 ec 30 sub esp, 48 ; 00000030H
+ 00009 85 c0 test eax, eax
+ 0000b 0f 84 96 0d 00
+ 00 je $LN254@inflateBac
+ 00011 8b 50 1c mov edx, DWORD PTR [eax+28]
+ 00014 89 55 f4 mov DWORD PTR _state$1$[ebp], edx
+ 00017 85 d2 test edx, edx
+ 00019 0f 84 88 0d 00
+ 00 je $LN254@inflateBac
+
+; 275 : state = (struct inflate_state FAR *)strm->state;
+; 276 :
+; 277 : /* Reset the state */
+; 278 : strm->msg = Z_NULL;
+
+ 0001f 53 push ebx
+ 00020 c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], 0
+
+; 279 : state->mode = TYPE;
+
+ 00027 c7 02 0b 00 00
+ 00 mov DWORD PTR [edx], 11 ; 0000000bH
+
+; 280 : state->last = 0;
+
+ 0002d c7 42 04 00 00
+ 00 00 mov DWORD PTR [edx+4], 0
+
+; 281 : state->whave = 0;
+
+ 00034 c7 42 2c 00 00
+ 00 00 mov DWORD PTR [edx+44], 0
+
+; 282 : next = strm->next_in;
+
+ 0003b 8b 18 mov ebx, DWORD PTR [eax]
+ 0003d 89 5d f0 mov DWORD PTR _next$5$[ebp], ebx
+ 00040 89 5d f8 mov DWORD PTR _next$[ebp], ebx
+ 00043 56 push esi
+ 00044 57 push edi
+
+; 283 : have = next != Z_NULL ? strm->avail_in : 0;
+
+ 00045 85 db test ebx, ebx
+ 00047 74 05 je SHORT $LN343@inflateBac
+ 00049 8b 70 04 mov esi, DWORD PTR [eax+4]
+ 0004c eb 02 jmp SHORT $LN344@inflateBac
+$LN343@inflateBac:
+ 0004e 33 f6 xor esi, esi
+$LN344@inflateBac:
+
+; 284 : hold = 0;
+; 285 : bits = 0;
+; 286 : put = state->window;
+
+ 00050 8b 42 34 mov eax, DWORD PTR [edx+52]
+ 00053 33 c9 xor ecx, ecx
+ 00055 89 45 e4 mov DWORD PTR _put$1$[ebp], eax
+ 00058 33 ff xor edi, edi
+
+; 287 : left = state->wsize;
+
+ 0005a 8b 42 28 mov eax, DWORD PTR [edx+40]
+ 0005d 89 45 e8 mov DWORD PTR _left$1$[ebp], eax
+
+; 288 :
+; 289 : /* Inflate until end of block marked as last */
+; 290 : for (;;)
+; 291 : switch (state->mode) {
+
+ 00060 8b 02 mov eax, DWORD PTR [edx]
+ 00062 83 e8 0b sub eax, 11 ; 0000000bH
+ 00065 89 4d fc mov DWORD PTR _hold$1$[ebp], ecx
+ 00068 89 7d ec mov DWORD PTR _bits$1$[ebp], edi
+ 0006b 83 f8 12 cmp eax, 18 ; 00000012H
+ 0006e 0f 87 9c 0c 00
+ 00 ja $LN341@inflateBac
+ 00074 8b 5d f0 mov ebx, DWORD PTR _next$5$[ebp]
+ 00077 66 0f 1f 84 00
+ 00 00 00 00 npad 9
+$LL2@inflateBac:
+ 00080 0f b6 80 00 00
+ 00 00 movzx eax, BYTE PTR $LN473@inflateBac[eax]
+ 00087 ff 24 85 00 00
+ 00 00 jmp DWORD PTR $LN507@inflateBac[eax*4]
+$LN255@inflateBac:
+
+; 292 : case TYPE:
+; 293 : /* determine and dispatch block type */
+; 294 : if (state->last) {
+
+ 0008e 83 7a 04 00 cmp DWORD PTR [edx+4], 0
+ 00092 74 18 je SHORT $LN12@inflateBac
+
+; 295 : BYTEBITS();
+
+ 00094 8b cf mov ecx, edi
+
+; 296 : state->mode = DONE;
+
+ 00096 c7 02 1c 00 00
+ 00 mov DWORD PTR [edx], 28 ; 0000001cH
+ 0009c 83 e1 07 and ecx, 7
+ 0009f d3 6d fc shr DWORD PTR _hold$1$[ebp], cl
+ 000a2 2b f9 sub edi, ecx
+ 000a4 89 7d ec mov DWORD PTR _bits$1$[ebp], edi
+
+; 297 : break;
+
+ 000a7 e9 4d 0c 00 00 jmp $LN505@inflateBac
+$LN12@inflateBac:
+
+; 298 : }
+; 299 : NEEDBITS(3);
+
+ 000ac 83 ff 03 cmp edi, 3
+ 000af 73 3d jae SHORT $LN10@inflateBac
+$LL13@inflateBac:
+ 000b1 85 f6 test esi, esi
+ 000b3 75 1a jne SHORT $LN18@inflateBac
+ 000b5 8d 45 f8 lea eax, DWORD PTR _next$[ebp]
+ 000b8 50 push eax
+ 000b9 ff 75 10 push DWORD PTR _in_desc$[ebp]
+ 000bc ff 55 0c call DWORD PTR _in$[ebp]
+ 000bf 8b f0 mov esi, eax
+ 000c1 83 c4 08 add esp, 8
+ 000c4 85 f6 test esi, esi
+ 000c6 0f 84 5f 0c 00
+ 00 je $LN369@inflateBac
+ 000cc 8b 5d f8 mov ebx, DWORD PTR _next$[ebp]
+$LN18@inflateBac:
+ 000cf 0f b6 03 movzx eax, BYTE PTR [ebx]
+ 000d2 8b cf mov ecx, edi
+ 000d4 d3 e0 shl eax, cl
+ 000d6 43 inc ebx
+ 000d7 8b 4d fc mov ecx, DWORD PTR _hold$1$[ebp]
+ 000da 83 c7 08 add edi, 8
+ 000dd 03 c8 add ecx, eax
+ 000df 89 5d f8 mov DWORD PTR _next$[ebp], ebx
+ 000e2 4e dec esi
+ 000e3 89 4d fc mov DWORD PTR _hold$1$[ebp], ecx
+ 000e6 83 ff 03 cmp edi, 3
+ 000e9 72 c6 jb SHORT $LL13@inflateBac
+ 000eb 8b 55 f4 mov edx, DWORD PTR _state$1$[ebp]
+$LN10@inflateBac:
+
+; 300 : state->last = BITS(1);
+
+ 000ee 8b c1 mov eax, ecx
+
+; 301 : DROPBITS(1);
+
+ 000f0 d1 e9 shr ecx, 1
+ 000f2 83 e0 01 and eax, 1
+ 000f5 89 4d fc mov DWORD PTR _hold$1$[ebp], ecx
+ 000f8 89 42 04 mov DWORD PTR [edx+4], eax
+
+; 302 : switch (BITS(2)) {
+
+ 000fb 8b c1 mov eax, ecx
+ 000fd 83 e0 03 and eax, 3
+ 00100 83 f8 03 cmp eax, 3
+ 00103 77 39 ja SHORT $LN28@inflateBac
+ 00105 ff 24 85 00 00
+ 00 00 jmp DWORD PTR $LN508@inflateBac[eax*4]
+$LN259@inflateBac:
+
+; 303 : case 0: /* stored block */
+; 304 : Tracev((stderr, "inflate: stored block%s\n",
+; 305 : state->last ? " (last)" : ""));
+; 306 : state->mode = STORED;
+
+ 0010c c7 02 0d 00 00
+ 00 mov DWORD PTR [edx], 13 ; 0000000dH
+
+; 307 : break;
+
+ 00112 eb 2a jmp SHORT $LN28@inflateBac
+$LN260@inflateBac:
+
+; 308 : case 1: /* fixed block */
+; 309 : fixedtables(state);
+
+ 00114 8b ca mov ecx, edx
+ 00116 e8 00 00 00 00 call _fixedtables
+
+; 310 : Tracev((stderr, "inflate: fixed codes block%s\n",
+; 311 : state->last ? " (last)" : ""));
+; 312 : state->mode = LEN; /* decode codes */
+; 313 : break;
+
+ 0011b 8b 4d fc mov ecx, DWORD PTR _hold$1$[ebp]
+ 0011e c7 02 14 00 00
+ 00 mov DWORD PTR [edx], 20 ; 00000014H
+ 00124 eb 18 jmp SHORT $LN28@inflateBac
+$LN261@inflateBac:
+
+; 314 : case 2: /* dynamic block */
+; 315 : Tracev((stderr, "inflate: dynamic codes block%s\n",
+; 316 : state->last ? " (last)" : ""));
+; 317 : state->mode = TABLE;
+
+ 00126 c7 02 10 00 00
+ 00 mov DWORD PTR [edx], 16 ; 00000010H
+
+; 318 : break;
+
+ 0012c eb 10 jmp SHORT $LN28@inflateBac
+$LN262@inflateBac:
+
+; 319 : case 3:
+; 320 : strm->msg = (char *)"invalid block type";
+
+ 0012e 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 00131 c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BD@PJCBIDD@invalid?5block?5type?$AA@
+
+; 321 : state->mode = BAD;
+
+ 00138 c7 02 1d 00 00
+ 00 mov DWORD PTR [edx], 29 ; 0000001dH
+$LN28@inflateBac:
+
+; 322 : }
+; 323 : DROPBITS(2);
+; 324 : break;
+
+ 0013e 8b 5d f8 mov ebx, DWORD PTR _next$[ebp]
+ 00141 c1 e9 02 shr ecx, 2
+ 00144 83 ef 03 sub edi, 3
+ 00147 89 4d fc mov DWORD PTR _hold$1$[ebp], ecx
+ 0014a 89 7d ec mov DWORD PTR _bits$1$[ebp], edi
+ 0014d 89 5d f0 mov DWORD PTR _next$5$[ebp], ebx
+ 00150 e9 ad 0b 00 00 jmp $LN393@inflateBac
+$LN31@inflateBac:
+
+; 325 :
+; 326 : case STORED:
+; 327 : /* get and verify stored block length */
+; 328 : BYTEBITS(); /* go to byte boundary */
+
+ 00155 8b cf mov ecx, edi
+ 00157 83 e1 07 and ecx, 7
+ 0015a d3 6d fc shr DWORD PTR _hold$1$[ebp], cl
+ 0015d 2b f9 sub edi, ecx
+ 0015f 89 7d ec mov DWORD PTR _bits$1$[ebp], edi
+
+; 329 : NEEDBITS(32);
+
+ 00162 83 ff 20 cmp edi, 32 ; 00000020H
+ 00165 73 42 jae SHORT $LN493@inflateBac
+$LL35@inflateBac:
+ 00167 85 f6 test esi, esi
+ 00169 75 1a jne SHORT $LN40@inflateBac
+ 0016b 8d 45 f8 lea eax, DWORD PTR _next$[ebp]
+ 0016e 50 push eax
+ 0016f ff 75 10 push DWORD PTR _in_desc$[ebp]
+ 00172 ff 55 0c call DWORD PTR _in$[ebp]
+ 00175 8b f0 mov esi, eax
+ 00177 83 c4 08 add esp, 8
+ 0017a 85 f6 test esi, esi
+ 0017c 0f 84 a9 0b 00
+ 00 je $LN369@inflateBac
+ 00182 8b 5d f8 mov ebx, DWORD PTR _next$[ebp]
+$LN40@inflateBac:
+ 00185 0f b6 03 movzx eax, BYTE PTR [ebx]
+ 00188 8b cf mov ecx, edi
+ 0018a d3 e0 shl eax, cl
+ 0018c 83 c7 08 add edi, 8
+ 0018f 8b 4d fc mov ecx, DWORD PTR _hold$1$[ebp]
+ 00192 43 inc ebx
+ 00193 03 c8 add ecx, eax
+ 00195 89 5d f8 mov DWORD PTR _next$[ebp], ebx
+ 00198 4e dec esi
+ 00199 89 4d fc mov DWORD PTR _hold$1$[ebp], ecx
+ 0019c 89 7d ec mov DWORD PTR _bits$1$[ebp], edi
+ 0019f 83 ff 20 cmp edi, 32 ; 00000020H
+ 001a2 72 c3 jb SHORT $LL35@inflateBac
+ 001a4 8b 55 f4 mov edx, DWORD PTR _state$1$[ebp]
+ 001a7 eb 03 jmp SHORT $LN32@inflateBac
+$LN493@inflateBac:
+ 001a9 8b 4d fc mov ecx, DWORD PTR _hold$1$[ebp]
+$LN32@inflateBac:
+
+; 330 : if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
+
+ 001ac 8b c1 mov eax, ecx
+ 001ae 0f b7 d9 movzx ebx, cx
+ 001b1 f7 d0 not eax
+ 001b3 c1 e8 10 shr eax, 16 ; 00000010H
+ 001b6 3b d8 cmp ebx, eax
+ 001b8 74 1b je SHORT $LN266@inflateBac
+
+; 331 : strm->msg = (char *)"invalid stored block lengths";
+
+ 001ba 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 001bd c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BN@LGAADGOK@invalid?5stored?5block?5lengths?$AA@
+
+; 332 : state->mode = BAD;
+
+ 001c4 c7 02 1d 00 00
+ 00 mov DWORD PTR [edx], 29 ; 0000001dH
+
+; 333 : break;
+
+ 001ca 8b 5d f8 mov ebx, DWORD PTR _next$[ebp]
+ 001cd 89 5d f0 mov DWORD PTR _next$5$[ebp], ebx
+ 001d0 e9 2d 0b 00 00 jmp $LN393@inflateBac
+$LN266@inflateBac:
+
+; 334 : }
+; 335 : state->length = (unsigned)hold & 0xffff;
+; 336 : Tracev((stderr, "inflate: stored length %u\n",
+; 337 : state->length));
+; 338 : INITBITS();
+
+ 001d5 33 c9 xor ecx, ecx
+ 001d7 89 5a 40 mov DWORD PTR [edx+64], ebx
+ 001da 33 ff xor edi, edi
+ 001dc 89 4d fc mov DWORD PTR _hold$1$[ebp], ecx
+ 001df 89 7d ec mov DWORD PTR _bits$1$[ebp], edi
+
+; 339 :
+; 340 : /* copy stored block from input to output */
+; 341 : while (state->length != 0) {
+
+ 001e2 3b d9 cmp ebx, ecx
+ 001e4 0f 84 88 00 00
+ 00 je $LN47@inflateBac
+ 001ea 8b 45 e8 mov eax, DWORD PTR _left$1$[ebp]
+ 001ed 0f 1f 00 npad 3
+$LL46@inflateBac:
+
+; 342 : copy = state->length;
+
+ 001f0 8b 5a 40 mov ebx, DWORD PTR [edx+64]
+
+; 343 : PULL();
+
+ 001f3 85 f6 test esi, esi
+ 001f5 75 1d jne SHORT $LN48@inflateBac
+ 001f7 8d 45 f8 lea eax, DWORD PTR _next$[ebp]
+ 001fa 50 push eax
+ 001fb ff 75 10 push DWORD PTR _in_desc$[ebp]
+ 001fe ff 55 0c call DWORD PTR _in$[ebp]
+ 00201 8b f0 mov esi, eax
+ 00203 83 c4 08 add esp, 8
+ 00206 85 f6 test esi, esi
+ 00208 0f 84 1d 0b 00
+ 00 je $LN369@inflateBac
+ 0020e 8b 55 f4 mov edx, DWORD PTR _state$1$[ebp]
+ 00211 8b 45 e8 mov eax, DWORD PTR _left$1$[ebp]
+$LN48@inflateBac:
+
+; 344 : ROOM();
+
+ 00214 85 c0 test eax, eax
+ 00216 75 25 jne SHORT $LN51@inflateBac
+ 00218 8b 4a 28 mov ecx, DWORD PTR [edx+40]
+ 0021b 8b 42 34 mov eax, DWORD PTR [edx+52]
+ 0021e 51 push ecx
+ 0021f 50 push eax
+ 00220 ff 75 18 push DWORD PTR _out_desc$[ebp]
+ 00223 89 45 e4 mov DWORD PTR _put$1$[ebp], eax
+ 00226 89 4d e8 mov DWORD PTR _left$1$[ebp], ecx
+ 00229 89 4a 2c mov DWORD PTR [edx+44], ecx
+ 0022c ff 55 14 call DWORD PTR _out$[ebp]
+ 0022f 83 c4 0c add esp, 12 ; 0000000cH
+ 00232 85 c0 test eax, eax
+ 00234 0f 85 0b 0b 00
+ 00 jne $LN372@inflateBac
+ 0023a 8b 45 e8 mov eax, DWORD PTR _left$1$[ebp]
+$LN51@inflateBac:
+
+; 345 : if (copy > have) copy = have;
+
+ 0023d 3b de cmp ebx, esi
+ 0023f 0f 47 de cmova ebx, esi
+
+; 346 : if (copy > left) copy = left;
+
+ 00242 3b d8 cmp ebx, eax
+ 00244 0f 47 d8 cmova ebx, eax
+
+; 347 : zmemcpy(put, next, copy);
+
+ 00247 8b 45 e4 mov eax, DWORD PTR _put$1$[ebp]
+ 0024a 53 push ebx
+ 0024b ff 75 f8 push DWORD PTR _next$[ebp]
+ 0024e 50 push eax
+ 0024f e8 00 00 00 00 call _memcpy
+
+; 348 : have -= copy;
+; 349 : next += copy;
+; 350 : left -= copy;
+; 351 : put += copy;
+; 352 : state->length -= copy;
+
+ 00254 8b 55 f4 mov edx, DWORD PTR _state$1$[ebp]
+ 00257 83 c4 0c add esp, 12 ; 0000000cH
+ 0025a 8b 45 e8 mov eax, DWORD PTR _left$1$[ebp]
+ 0025d 2b f3 sub esi, ebx
+ 0025f 01 5d f8 add DWORD PTR _next$[ebp], ebx
+ 00262 2b c3 sub eax, ebx
+ 00264 01 5d e4 add DWORD PTR _put$1$[ebp], ebx
+ 00267 29 5a 40 sub DWORD PTR [edx+64], ebx
+ 0026a 89 45 e8 mov DWORD PTR _left$1$[ebp], eax
+ 0026d 75 81 jne SHORT $LL46@inflateBac
+ 0026f 8b 4d fc mov ecx, DWORD PTR _hold$1$[ebp]
+$LN47@inflateBac:
+
+; 353 : }
+; 354 : Tracev((stderr, "inflate: stored end\n"));
+; 355 : state->mode = TYPE;
+
+ 00272 c7 02 0b 00 00
+ 00 mov DWORD PTR [edx], 11 ; 0000000bH
+
+; 356 : break;
+
+ 00278 8b 5d f8 mov ebx, DWORD PTR _next$[ebp]
+ 0027b 89 5d f0 mov DWORD PTR _next$5$[ebp], ebx
+ 0027e e9 7f 0a 00 00 jmp $LN393@inflateBac
+$LN56@inflateBac:
+
+; 357 :
+; 358 : case TABLE:
+; 359 : /* get dynamic table entries descriptor */
+; 360 : NEEDBITS(14);
+
+ 00283 83 ff 0e cmp edi, 14 ; 0000000eH
+ 00286 73 38 jae SHORT $LN54@inflateBac
+$LL57@inflateBac:
+ 00288 85 f6 test esi, esi
+ 0028a 75 1a jne SHORT $LN62@inflateBac
+ 0028c 8d 45 f8 lea eax, DWORD PTR _next$[ebp]
+ 0028f 50 push eax
+ 00290 ff 75 10 push DWORD PTR _in_desc$[ebp]
+ 00293 ff 55 0c call DWORD PTR _in$[ebp]
+ 00296 8b f0 mov esi, eax
+ 00298 83 c4 08 add esp, 8
+ 0029b 85 f6 test esi, esi
+ 0029d 0f 84 88 0a 00
+ 00 je $LN369@inflateBac
+ 002a3 8b 5d f8 mov ebx, DWORD PTR _next$[ebp]
+$LN62@inflateBac:
+ 002a6 0f b6 03 movzx eax, BYTE PTR [ebx]
+ 002a9 8b cf mov ecx, edi
+ 002ab d3 e0 shl eax, cl
+ 002ad 43 inc ebx
+ 002ae 01 45 fc add DWORD PTR _hold$1$[ebp], eax
+ 002b1 83 c7 08 add edi, 8
+ 002b4 4e dec esi
+ 002b5 89 5d f8 mov DWORD PTR _next$[ebp], ebx
+ 002b8 83 ff 0e cmp edi, 14 ; 0000000eH
+ 002bb 72 cb jb SHORT $LL57@inflateBac
+ 002bd 8b 55 f4 mov edx, DWORD PTR _state$1$[ebp]
+$LN54@inflateBac:
+
+; 361 : state->nlen = BITS(5) + 257;
+
+ 002c0 8b 5d fc mov ebx, DWORD PTR _hold$1$[ebp]
+
+; 362 : DROPBITS(5);
+; 363 : state->ndist = BITS(5) + 1;
+; 364 : DROPBITS(5);
+; 365 : state->ncode = BITS(4) + 4;
+; 366 : DROPBITS(4);
+
+ 002c3 83 ef 0e sub edi, 14 ; 0000000eH
+ 002c6 8b c3 mov eax, ebx
+ 002c8 89 7d ec mov DWORD PTR _bits$1$[ebp], edi
+ 002cb 83 e0 1f and eax, 31 ; 0000001fH
+ 002ce c1 eb 05 shr ebx, 5
+ 002d1 05 01 01 00 00 add eax, 257 ; 00000101H
+ 002d6 89 42 60 mov DWORD PTR [edx+96], eax
+ 002d9 8b c3 mov eax, ebx
+ 002db 83 e0 1f and eax, 31 ; 0000001fH
+ 002de c1 eb 05 shr ebx, 5
+ 002e1 40 inc eax
+ 002e2 89 42 64 mov DWORD PTR [edx+100], eax
+ 002e5 8b c3 mov eax, ebx
+ 002e7 83 e0 0f and eax, 15 ; 0000000fH
+ 002ea c1 eb 04 shr ebx, 4
+ 002ed 83 c0 04 add eax, 4
+ 002f0 89 5d fc mov DWORD PTR _hold$1$[ebp], ebx
+
+; 367 : #ifndef PKZIP_BUG_WORKAROUND
+; 368 : if (state->nlen > 286 || state->ndist > 30) {
+
+ 002f3 81 7a 60 1e 01
+ 00 00 cmp DWORD PTR [edx+96], 286 ; 0000011eH
+ 002fa 89 42 5c mov DWORD PTR [edx+92], eax
+ 002fd 0f 87 02 05 00
+ 00 ja $LN277@inflateBac
+ 00303 83 7a 64 1e cmp DWORD PTR [edx+100], 30 ; 0000001eH
+ 00307 0f 87 f8 04 00
+ 00 ja $LN277@inflateBac
+
+; 372 : }
+; 373 : #endif
+; 374 : Tracev((stderr, "inflate: table sizes ok\n"));
+; 375 :
+; 376 : /* get code length code lengths (not a typo) */
+; 377 : state->have = 0;
+
+ 0030d c7 42 68 00 00
+ 00 00 mov DWORD PTR [edx+104], 0
+
+; 378 : while (state->have < state->ncode) {
+
+ 00314 85 c0 test eax, eax
+ 00316 76 6b jbe SHORT $LN352@inflateBac
+$LL74@inflateBac:
+
+; 379 : NEEDBITS(3);
+
+ 00318 83 ff 03 cmp edi, 3
+ 0031b 73 3a jae SHORT $LN76@inflateBac
+ 0031d 8b 55 f8 mov edx, DWORD PTR _next$[ebp]
+$LL79@inflateBac:
+ 00320 85 f6 test esi, esi
+ 00322 75 1a jne SHORT $LN84@inflateBac
+ 00324 8d 45 f8 lea eax, DWORD PTR _next$[ebp]
+ 00327 50 push eax
+ 00328 ff 75 10 push DWORD PTR _in_desc$[ebp]
+ 0032b ff 55 0c call DWORD PTR _in$[ebp]
+ 0032e 8b f0 mov esi, eax
+ 00330 83 c4 08 add esp, 8
+ 00333 85 f6 test esi, esi
+ 00335 0f 84 f0 09 00
+ 00 je $LN369@inflateBac
+ 0033b 8b 55 f8 mov edx, DWORD PTR _next$[ebp]
+$LN84@inflateBac:
+ 0033e 0f b6 02 movzx eax, BYTE PTR [edx]
+ 00341 8b cf mov ecx, edi
+ 00343 d3 e0 shl eax, cl
+ 00345 42 inc edx
+ 00346 83 c7 08 add edi, 8
+ 00349 89 55 f8 mov DWORD PTR _next$[ebp], edx
+ 0034c 4e dec esi
+ 0034d 03 d8 add ebx, eax
+ 0034f 83 ff 03 cmp edi, 3
+ 00352 72 cc jb SHORT $LL79@inflateBac
+ 00354 8b 55 f4 mov edx, DWORD PTR _state$1$[ebp]
+$LN76@inflateBac:
+
+; 380 : state->lens[order[state->have++]] = (unsigned short)BITS(3);
+
+ 00357 8b 42 68 mov eax, DWORD PTR [edx+104]
+ 0035a 8b cb mov ecx, ebx
+ 0035c 83 e1 07 and ecx, 7
+
+; 381 : DROPBITS(3);
+
+ 0035f c1 eb 03 shr ebx, 3
+ 00362 83 ef 03 sub edi, 3
+ 00365 89 5d fc mov DWORD PTR _hold$1$[ebp], ebx
+ 00368 89 7d ec mov DWORD PTR _bits$1$[ebp], edi
+ 0036b 0f b7 04 45 00
+ 00 00 00 movzx eax, WORD PTR ?order@?1??inflateBack@@9@9[eax*2]
+ 00373 66 89 4c 42 70 mov WORD PTR [edx+eax*2+112], cx
+ 00378 ff 42 68 inc DWORD PTR [edx+104]
+ 0037b 8b 42 68 mov eax, DWORD PTR [edx+104]
+ 0037e 3b 42 5c cmp eax, DWORD PTR [edx+92]
+ 00381 72 95 jb SHORT $LL74@inflateBac
+$LN352@inflateBac:
+
+; 382 : }
+; 383 : while (state->have < 19)
+
+ 00383 83 7a 68 13 cmp DWORD PTR [edx+104], 19 ; 00000013H
+ 00387 73 22 jae SHORT $LN91@inflateBac
+ 00389 0f 1f 80 00 00
+ 00 00 npad 7
+$LL90@inflateBac:
+
+; 384 : state->lens[order[state->have++]] = 0;
+
+ 00390 8b 42 68 mov eax, DWORD PTR [edx+104]
+ 00393 33 c9 xor ecx, ecx
+ 00395 0f b7 04 45 00
+ 00 00 00 movzx eax, WORD PTR ?order@?1??inflateBack@@9@9[eax*2]
+ 0039d 66 89 4c 42 70 mov WORD PTR [edx+eax*2+112], cx
+ 003a2 ff 42 68 inc DWORD PTR [edx+104]
+ 003a5 83 7a 68 13 cmp DWORD PTR [edx+104], 19 ; 00000013H
+ 003a9 72 e5 jb SHORT $LL90@inflateBac
+$LN91@inflateBac:
+
+; 385 : state->next = state->codes;
+
+ 003ab 8d 82 30 05 00
+ 00 lea eax, DWORD PTR [edx+1328]
+
+; 386 : state->lencode = (code const FAR *)(state->next);
+; 387 : state->lenbits = 7;
+
+ 003b1 c7 42 54 07 00
+ 00 00 mov DWORD PTR [edx+84], 7
+ 003b8 8d 4a 6c lea ecx, DWORD PTR [edx+108]
+ 003bb 89 42 4c mov DWORD PTR [edx+76], eax
+
+; 388 : ret = inflate_table(CODES, state->lens, 19, &(state->next),
+
+ 003be 8d 9a f0 02 00
+ 00 lea ebx, DWORD PTR [edx+752]
+ 003c4 89 01 mov DWORD PTR [ecx], eax
+ 003c6 8d 42 54 lea eax, DWORD PTR [edx+84]
+ 003c9 83 c2 70 add edx, 112 ; 00000070H
+ 003cc 53 push ebx
+ 003cd 50 push eax
+ 003ce 51 push ecx
+ 003cf 6a 13 push 19 ; 00000013H
+ 003d1 33 c9 xor ecx, ecx
+ 003d3 89 45 d8 mov DWORD PTR tv1722[ebp], eax
+ 003d6 89 55 d0 mov DWORD PTR tv1719[ebp], edx
+ 003d9 e8 00 00 00 00 call _inflate_table
+
+; 392 : state->mode = BAD;
+
+ 003de 8b 55 f4 mov edx, DWORD PTR _state$1$[ebp]
+ 003e1 83 c4 10 add esp, 16 ; 00000010H
+ 003e4 85 c0 test eax, eax
+ 003e6 74 15 je SHORT $LN280@inflateBac
+
+; 389 : &(state->lenbits), state->work);
+; 390 : if (ret) {
+; 391 : strm->msg = (char *)"invalid code lengths set";
+
+ 003e8 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 003eb c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BJ@HDEPPGOH@invalid?5code?5lengths?5set?$AA@
+
+; 392 : state->mode = BAD;
+
+ 003f2 c7 02 1d 00 00
+ 00 mov DWORD PTR [edx], 29 ; 0000001dH
+
+; 393 : break;
+
+ 003f8 e9 fc 08 00 00 jmp $LN505@inflateBac
+$LN280@inflateBac:
+
+; 394 : }
+; 395 : Tracev((stderr, "inflate: code lengths ok\n"));
+; 396 :
+; 397 : /* get length and distance code code lengths */
+; 398 : state->have = 0;
+; 399 : while (state->have < state->nlen + state->ndist) {
+
+ 003fd 8b 42 64 mov eax, DWORD PTR [edx+100]
+ 00400 c7 42 68 00 00
+ 00 00 mov DWORD PTR [edx+104], 0
+ 00407 8b 5d f8 mov ebx, DWORD PTR _next$[ebp]
+ 0040a 89 5d f0 mov DWORD PTR _next$5$[ebp], ebx
+ 0040d 03 42 60 add eax, DWORD PTR [edx+96]
+ 00410 0f 84 7f 02 00
+ 00 je $LN93@inflateBac
+$LL92@inflateBac:
+
+; 400 : for (;;) {
+; 401 : here = state->lencode[BITS(state->lenbits)];
+
+ 00416 8b 45 d8 mov eax, DWORD PTR tv1722[ebp]
+ 00419 ba 01 00 00 00 mov edx, 1
+ 0041e 8b 08 mov ecx, DWORD PTR [eax]
+ 00420 8b 45 f4 mov eax, DWORD PTR _state$1$[ebp]
+ 00423 d3 e2 shl edx, cl
+ 00425 4a dec edx
+ 00426 23 55 fc and edx, DWORD PTR _hold$1$[ebp]
+ 00429 8b 40 4c mov eax, DWORD PTR [eax+76]
+ 0042c 8b 04 90 mov eax, DWORD PTR [eax+edx*4]
+
+; 402 : if ((unsigned)(here.bits) <= bits) break;
+
+ 0042f 8b c8 mov ecx, eax
+ 00431 c1 e9 08 shr ecx, 8
+ 00434 0f b6 c9 movzx ecx, cl
+ 00437 89 45 dc mov DWORD PTR _here$1$[ebp], eax
+ 0043a 89 45 e0 mov DWORD PTR _here$[ebp], eax
+ 0043d 3b cf cmp ecx, edi
+ 0043f 76 5e jbe SHORT $LN375@inflateBac
+$LL94@inflateBac:
+
+; 403 : PULLBYTE();
+
+ 00441 85 f6 test esi, esi
+ 00443 75 1a jne SHORT $LN100@inflateBac
+ 00445 8d 45 f8 lea eax, DWORD PTR _next$[ebp]
+ 00448 50 push eax
+ 00449 ff 75 10 push DWORD PTR _in_desc$[ebp]
+ 0044c ff 55 0c call DWORD PTR _in$[ebp]
+ 0044f 8b f0 mov esi, eax
+ 00451 83 c4 08 add esp, 8
+ 00454 85 f6 test esi, esi
+ 00456 0f 84 cf 08 00
+ 00 je $LN369@inflateBac
+ 0045c 8b 5d f8 mov ebx, DWORD PTR _next$[ebp]
+$LN100@inflateBac:
+ 0045f 0f b6 03 movzx eax, BYTE PTR [ebx]
+ 00462 8b cf mov ecx, edi
+ 00464 d3 e0 shl eax, cl
+ 00466 43 inc ebx
+ 00467 01 45 fc add DWORD PTR _hold$1$[ebp], eax
+ 0046a ba 01 00 00 00 mov edx, 1
+ 0046f 8b 45 d8 mov eax, DWORD PTR tv1722[ebp]
+ 00472 83 c7 08 add edi, 8
+ 00475 89 5d f8 mov DWORD PTR _next$[ebp], ebx
+ 00478 4e dec esi
+ 00479 89 5d f0 mov DWORD PTR _next$5$[ebp], ebx
+ 0047c 8b 08 mov ecx, DWORD PTR [eax]
+ 0047e 8b 45 f4 mov eax, DWORD PTR _state$1$[ebp]
+ 00481 d3 e2 shl edx, cl
+ 00483 4a dec edx
+ 00484 23 55 fc and edx, DWORD PTR _hold$1$[ebp]
+ 00487 8b 40 4c mov eax, DWORD PTR [eax+76]
+ 0048a 8b 04 90 mov eax, DWORD PTR [eax+edx*4]
+ 0048d 8b c8 mov ecx, eax
+ 0048f c1 e9 08 shr ecx, 8
+ 00492 0f b6 c9 movzx ecx, cl
+ 00495 89 45 dc mov DWORD PTR _here$1$[ebp], eax
+ 00498 89 45 e0 mov DWORD PTR _here$[ebp], eax
+ 0049b 3b cf cmp ecx, edi
+ 0049d 77 a2 ja SHORT $LL94@inflateBac
+$LN375@inflateBac:
+
+; 404 : }
+; 405 : if (here.val < 16) {
+
+ 0049f 8b c8 mov ecx, eax
+ 004a1 c1 e9 10 shr ecx, 16 ; 00000010H
+ 004a4 89 4d d4 mov DWORD PTR tv1711[ebp], ecx
+ 004a7 66 83 f9 10 cmp cx, 16 ; 00000010H
+ 004ab 73 24 jae SHORT $LN501@inflateBac
+
+; 406 : DROPBITS(here.bits);
+; 407 : state->lens[state->have++] = here.val;
+
+ 004ad 8b 55 f4 mov edx, DWORD PTR _state$1$[ebp]
+ 004b0 c1 e8 08 shr eax, 8
+ 004b3 0f b6 c8 movzx ecx, al
+ 004b6 d3 6d fc shr DWORD PTR _hold$1$[ebp], cl
+ 004b9 2b f9 sub edi, ecx
+ 004bb 8b 42 68 mov eax, DWORD PTR [edx+104]
+ 004be 8b 4d d4 mov ecx, DWORD PTR tv1711[ebp]
+ 004c1 89 7d ec mov DWORD PTR _bits$1$[ebp], edi
+ 004c4 66 89 4c 42 70 mov WORD PTR [edx+eax*2+112], cx
+ 004c9 ff 42 68 inc DWORD PTR [edx+104]
+
+; 408 : }
+
+ 004cc e9 af 01 00 00 jmp $LN502@inflateBac
+$LN501@inflateBac:
+ 004d1 8b 55 fc mov edx, DWORD PTR _hold$1$[ebp]
+
+; 409 : else {
+; 410 : if (here.val == 16) {
+
+ 004d4 0f 85 95 00 00
+ 00 jne $LN286@inflateBac
+
+; 411 : NEEDBITS(here.bits + 2);
+
+ 004da 8b c8 mov ecx, eax
+ 004dc c1 e9 08 shr ecx, 8
+ 004df 0f b6 c9 movzx ecx, cl
+ 004e2 83 c1 02 add ecx, 2
+ 004e5 89 4d d4 mov DWORD PTR $T1[ebp], ecx
+ 004e8 3b f9 cmp edi, ecx
+ 004ea 73 44 jae SHORT $LN106@inflateBac
+ 004ec 0f 1f 40 00 npad 4
+$LL109@inflateBac:
+ 004f0 85 f6 test esi, esi
+ 004f2 75 1d jne SHORT $LN114@inflateBac
+ 004f4 8d 45 f8 lea eax, DWORD PTR _next$[ebp]
+ 004f7 50 push eax
+ 004f8 ff 75 10 push DWORD PTR _in_desc$[ebp]
+ 004fb ff 55 0c call DWORD PTR _in$[ebp]
+ 004fe 8b f0 mov esi, eax
+ 00500 83 c4 08 add esp, 8
+ 00503 85 f6 test esi, esi
+ 00505 0f 84 20 08 00
+ 00 je $LN369@inflateBac
+ 0050b 8b 5d f8 mov ebx, DWORD PTR _next$[ebp]
+ 0050e 8b 55 fc mov edx, DWORD PTR _hold$1$[ebp]
+$LN114@inflateBac:
+ 00511 0f b6 03 movzx eax, BYTE PTR [ebx]
+ 00514 8b cf mov ecx, edi
+ 00516 d3 e0 shl eax, cl
+ 00518 43 inc ebx
+ 00519 03 d0 add edx, eax
+ 0051b 89 5d f0 mov DWORD PTR _next$5$[ebp], ebx
+ 0051e 83 c7 08 add edi, 8
+ 00521 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 00524 4e dec esi
+ 00525 89 5d f8 mov DWORD PTR _next$[ebp], ebx
+ 00528 3b 7d d4 cmp edi, DWORD PTR $T1[ebp]
+ 0052b 72 c3 jb SHORT $LL109@inflateBac
+ 0052d 8b 45 dc mov eax, DWORD PTR _here$1$[ebp]
+$LN106@inflateBac:
+
+; 412 : DROPBITS(here.bits);
+
+ 00530 0f b6 cc movzx ecx, ah
+ 00533 d3 ea shr edx, cl
+ 00535 2b f9 sub edi, ecx
+ 00537 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+
+; 413 : if (state->have == 0) {
+
+ 0053a 8b 55 f4 mov edx, DWORD PTR _state$1$[ebp]
+ 0053d 89 7d ec mov DWORD PTR _bits$1$[ebp], edi
+ 00540 8b 42 68 mov eax, DWORD PTR [edx+104]
+ 00543 85 c0 test eax, eax
+ 00545 0f 84 72 01 00
+ 00 je $LN380@inflateBac
+
+; 417 : }
+; 418 : len = (unsigned)(state->lens[state->have - 1]);
+
+ 0054b 0f b7 44 42 6e movzx eax, WORD PTR [edx+eax*2+110]
+ 00550 89 45 dc mov DWORD PTR _len$1$[ebp], eax
+
+; 419 : copy = 3 + BITS(2);
+
+ 00553 8b 45 fc mov eax, DWORD PTR _hold$1$[ebp]
+ 00556 8b c8 mov ecx, eax
+ 00558 83 e1 03 and ecx, 3
+
+; 420 : DROPBITS(2);
+
+ 0055b c1 e8 02 shr eax, 2
+ 0055e 83 c1 03 add ecx, 3
+ 00561 89 45 fc mov DWORD PTR _hold$1$[ebp], eax
+ 00564 89 4d e0 mov DWORD PTR _copy$4$[ebp], ecx
+ 00567 83 ef 02 sub edi, 2
+
+; 421 : }
+
+ 0056a e9 df 00 00 00 jmp $LN503@inflateBac
+$LN286@inflateBac:
+
+; 422 : else if (here.val == 17) {
+
+ 0056f 66 83 7d e2 11 cmp WORD PTR _here$[ebp+2], 17 ; 00000011H
+
+; 423 : NEEDBITS(here.bits + 3);
+
+ 00574 0f b6 cc movzx ecx, ah
+ 00577 75 63 jne SHORT $LN142@inflateBac
+ 00579 8d 41 03 lea eax, DWORD PTR [ecx+3]
+ 0057c 89 4d d4 mov DWORD PTR tv1709[ebp], ecx
+ 0057f 3b f8 cmp edi, eax
+ 00581 73 42 jae SHORT $LN123@inflateBac
+$LL126@inflateBac:
+ 00583 85 f6 test esi, esi
+ 00585 75 1d jne SHORT $LN131@inflateBac
+ 00587 8d 45 f8 lea eax, DWORD PTR _next$[ebp]
+ 0058a 50 push eax
+ 0058b ff 75 10 push DWORD PTR _in_desc$[ebp]
+ 0058e ff 55 0c call DWORD PTR _in$[ebp]
+ 00591 8b f0 mov esi, eax
+ 00593 83 c4 08 add esp, 8
+ 00596 85 f6 test esi, esi
+ 00598 0f 84 8d 07 00
+ 00 je $LN369@inflateBac
+ 0059e 8b 5d f8 mov ebx, DWORD PTR _next$[ebp]
+ 005a1 8b 55 fc mov edx, DWORD PTR _hold$1$[ebp]
+$LN131@inflateBac:
+ 005a4 0f b6 03 movzx eax, BYTE PTR [ebx]
+ 005a7 8b cf mov ecx, edi
+ 005a9 d3 e0 shl eax, cl
+ 005ab 43 inc ebx
+ 005ac 8b 4d d4 mov ecx, DWORD PTR tv1709[ebp]
+ 005af 03 d0 add edx, eax
+ 005b1 83 c7 08 add edi, 8
+ 005b4 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 005b7 4e dec esi
+ 005b8 89 5d f0 mov DWORD PTR _next$5$[ebp], ebx
+ 005bb 89 5d f8 mov DWORD PTR _next$[ebp], ebx
+ 005be 8d 41 03 lea eax, DWORD PTR [ecx+3]
+ 005c1 3b f8 cmp edi, eax
+ 005c3 72 be jb SHORT $LL126@inflateBac
+$LN123@inflateBac:
+
+; 424 : DROPBITS(here.bits);
+
+ 005c5 d3 ea shr edx, cl
+
+; 425 : len = 0;
+; 426 : copy = 3 + BITS(3);
+
+ 005c7 8b c2 mov eax, edx
+ 005c9 83 e0 07 and eax, 7
+ 005cc 83 c0 03 add eax, 3
+
+; 427 : DROPBITS(3);
+
+ 005cf c1 ea 03 shr edx, 3
+ 005d2 89 45 e0 mov DWORD PTR _copy$4$[ebp], eax
+ 005d5 b8 fd ff ff ff mov eax, -3 ; fffffffdH
+
+; 428 : }
+
+ 005da eb 61 jmp SHORT $LN504@inflateBac
+$LN142@inflateBac:
+
+; 429 : else {
+; 430 : NEEDBITS(here.bits + 7);
+
+ 005dc 8d 41 07 lea eax, DWORD PTR [ecx+7]
+ 005df 89 4d d4 mov DWORD PTR tv1708[ebp], ecx
+ 005e2 3b f8 cmp edi, eax
+ 005e4 73 42 jae SHORT $LN140@inflateBac
+$LL143@inflateBac:
+ 005e6 85 f6 test esi, esi
+ 005e8 75 1d jne SHORT $LN148@inflateBac
+ 005ea 8d 45 f8 lea eax, DWORD PTR _next$[ebp]
+ 005ed 50 push eax
+ 005ee ff 75 10 push DWORD PTR _in_desc$[ebp]
+ 005f1 ff 55 0c call DWORD PTR _in$[ebp]
+ 005f4 8b f0 mov esi, eax
+ 005f6 83 c4 08 add esp, 8
+ 005f9 85 f6 test esi, esi
+ 005fb 0f 84 2a 07 00
+ 00 je $LN369@inflateBac
+ 00601 8b 5d f8 mov ebx, DWORD PTR _next$[ebp]
+ 00604 8b 55 fc mov edx, DWORD PTR _hold$1$[ebp]
+$LN148@inflateBac:
+ 00607 0f b6 03 movzx eax, BYTE PTR [ebx]
+ 0060a 8b cf mov ecx, edi
+ 0060c d3 e0 shl eax, cl
+ 0060e 43 inc ebx
+ 0060f 8b 4d d4 mov ecx, DWORD PTR tv1708[ebp]
+ 00612 03 d0 add edx, eax
+ 00614 83 c7 08 add edi, 8
+ 00617 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 0061a 4e dec esi
+ 0061b 89 5d f0 mov DWORD PTR _next$5$[ebp], ebx
+ 0061e 89 5d f8 mov DWORD PTR _next$[ebp], ebx
+ 00621 8d 41 07 lea eax, DWORD PTR [ecx+7]
+ 00624 3b f8 cmp edi, eax
+ 00626 72 be jb SHORT $LL143@inflateBac
+$LN140@inflateBac:
+
+; 431 : DROPBITS(here.bits);
+
+ 00628 d3 ea shr edx, cl
+
+; 432 : len = 0;
+; 433 : copy = 11 + BITS(7);
+
+ 0062a 8b c2 mov eax, edx
+ 0062c 83 e0 7f and eax, 127 ; 0000007fH
+ 0062f 83 c0 0b add eax, 11 ; 0000000bH
+
+; 434 : DROPBITS(7);
+
+ 00632 c1 ea 07 shr edx, 7
+ 00635 89 45 e0 mov DWORD PTR _copy$4$[ebp], eax
+ 00638 b8 f9 ff ff ff mov eax, -7 ; fffffff9H
+$LN504@inflateBac:
+ 0063d 2b c1 sub eax, ecx
+ 0063f 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 00642 8b 55 f4 mov edx, DWORD PTR _state$1$[ebp]
+ 00645 03 f8 add edi, eax
+ 00647 c7 45 dc 00 00
+ 00 00 mov DWORD PTR _len$1$[ebp], 0
+$LN503@inflateBac:
+
+; 435 : }
+; 436 : if (state->have + copy > state->nlen + state->ndist) {
+
+ 0064e 8b 4a 64 mov ecx, DWORD PTR [edx+100]
+ 00651 8b 42 68 mov eax, DWORD PTR [edx+104]
+ 00654 03 4a 60 add ecx, DWORD PTR [edx+96]
+ 00657 03 45 e0 add eax, DWORD PTR _copy$4$[ebp]
+ 0065a 89 7d ec mov DWORD PTR _bits$1$[ebp], edi
+ 0065d 3b c1 cmp eax, ecx
+ 0065f 77 5c ja SHORT $LN380@inflateBac
+
+; 437 : strm->msg = (char *)"invalid bit length repeat";
+; 438 : state->mode = BAD;
+; 439 : break;
+; 440 : }
+; 441 : while (copy--)
+
+ 00661 8b 4d e0 mov ecx, DWORD PTR _copy$4$[ebp]
+ 00664 85 c9 test ecx, ecx
+ 00666 74 1e je SHORT $LN406@inflateBac
+ 00668 8b 5d dc mov ebx, DWORD PTR _len$1$[ebp]
+ 0066b 0f 1f 44 00 00 npad 5
+$LL157@inflateBac:
+
+; 442 : state->lens[state->have++] = (unsigned short)len;
+
+ 00670 8b 42 68 mov eax, DWORD PTR [edx+104]
+ 00673 66 89 5c 42 70 mov WORD PTR [edx+eax*2+112], bx
+ 00678 ff 42 68 inc DWORD PTR [edx+104]
+ 0067b 83 e9 01 sub ecx, 1
+ 0067e 75 f0 jne SHORT $LL157@inflateBac
+$LN502@inflateBac:
+
+; 437 : strm->msg = (char *)"invalid bit length repeat";
+; 438 : state->mode = BAD;
+; 439 : break;
+; 440 : }
+; 441 : while (copy--)
+
+ 00680 8b 5d f8 mov ebx, DWORD PTR _next$[ebp]
+ 00683 89 5d f0 mov DWORD PTR _next$5$[ebp], ebx
+$LN406@inflateBac:
+
+; 394 : }
+; 395 : Tracev((stderr, "inflate: code lengths ok\n"));
+; 396 :
+; 397 : /* get length and distance code code lengths */
+; 398 : state->have = 0;
+; 399 : while (state->have < state->nlen + state->ndist) {
+
+ 00686 8b 42 64 mov eax, DWORD PTR [edx+100]
+ 00689 03 42 60 add eax, DWORD PTR [edx+96]
+ 0068c 39 42 68 cmp DWORD PTR [edx+104], eax
+ 0068f 0f 82 81 fd ff
+ ff jb $LL92@inflateBac
+$LN93@inflateBac:
+
+; 443 : }
+; 444 : }
+; 445 :
+; 446 : /* handle error breaks in while */
+; 447 : if (state->mode == BAD) break;
+
+ 00695 83 3a 1d cmp DWORD PTR [edx], 29 ; 0000001dH
+ 00698 0f 84 61 06 00
+ 00 je $LN492@inflateBac
+
+; 448 :
+; 449 : /* check for end-of-block code (better have one) */
+; 450 : if (state->lens[256] == 0) {
+
+ 0069e 66 83 ba 70 02
+ 00 00 00 cmp WORD PTR [edx+624], 0
+ 006a6 75 2a jne SHORT $LN299@inflateBac
+
+; 451 : strm->msg = (char *)"invalid code -- missing end-of-block";
+
+ 006a8 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 006ab c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0CF@DGDMADCD@invalid?5code?5?9?9?5missing?5end?9of?9b@
+
+; 452 : state->mode = BAD;
+
+ 006b2 c7 02 1d 00 00
+ 00 mov DWORD PTR [edx], 29 ; 0000001dH
+
+; 453 : break;
+
+ 006b8 e9 3c 06 00 00 jmp $LN505@inflateBac
+$LN380@inflateBac:
+
+; 414 : strm->msg = (char *)"invalid bit length repeat";
+
+ 006bd 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 006c0 c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BK@BMMPFBBH@invalid?5bit?5length?5repeat?$AA@
+
+; 415 : state->mode = BAD;
+
+ 006c7 c7 02 1d 00 00
+ 00 mov DWORD PTR [edx], 29 ; 0000001dH
+
+; 416 : break;
+
+ 006cd e9 27 06 00 00 jmp $LN505@inflateBac
+$LN299@inflateBac:
+
+; 454 : }
+; 455 :
+; 456 : /* build code tables -- note: do not change the lenbits or distbits
+; 457 : values here (9 and 6) without reading the comments in inftrees.h
+; 458 : concerning the ENOUGH constants, which depend on those values */
+; 459 : state->next = state->codes;
+
+ 006d2 8d 82 30 05 00
+ 00 lea eax, DWORD PTR [edx+1328]
+
+; 460 : state->lencode = (code const FAR *)(state->next);
+; 461 : state->lenbits = 9;
+
+ 006d8 c7 42 54 09 00
+ 00 00 mov DWORD PTR [edx+84], 9
+ 006df 8d 5a 6c lea ebx, DWORD PTR [edx+108]
+ 006e2 89 42 4c mov DWORD PTR [edx+76], eax
+
+; 462 : ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
+
+ 006e5 8d 8a f0 02 00
+ 00 lea ecx, DWORD PTR [edx+752]
+ 006eb 89 03 mov DWORD PTR [ebx], eax
+ 006ed 51 push ecx
+ 006ee 8d 42 54 lea eax, DWORD PTR [edx+84]
+ 006f1 b9 01 00 00 00 mov ecx, 1
+ 006f6 50 push eax
+ 006f7 53 push ebx
+ 006f8 ff 72 60 push DWORD PTR [edx+96]
+ 006fb 8b 55 d0 mov edx, DWORD PTR tv1719[ebp]
+ 006fe e8 00 00 00 00 call _inflate_table
+ 00703 83 c4 10 add esp, 16 ; 00000010H
+
+; 463 : &(state->lenbits), state->work);
+; 464 : if (ret) {
+
+ 00706 85 c0 test eax, eax
+ 00708 74 18 je SHORT $LN300@inflateBac
+
+; 465 : strm->msg = (char *)"invalid literal/lengths set";
+
+ 0070a 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+
+; 466 : state->mode = BAD;
+
+ 0070d 8b 55 f4 mov edx, DWORD PTR _state$1$[ebp]
+ 00710 c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BM@IIMGAINC@invalid?5literal?1lengths?5set?$AA@
+ 00717 c7 02 1d 00 00
+ 00 mov DWORD PTR [edx], 29 ; 0000001dH
+
+; 467 : break;
+
+ 0071d e9 d7 05 00 00 jmp $LN505@inflateBac
+$LN300@inflateBac:
+
+; 468 : }
+; 469 : state->distcode = (code const FAR *)(state->next);
+
+ 00722 8b 4d f4 mov ecx, DWORD PTR _state$1$[ebp]
+ 00725 8b 03 mov eax, DWORD PTR [ebx]
+
+; 470 : state->distbits = 6;
+
+ 00727 c7 41 58 06 00
+ 00 00 mov DWORD PTR [ecx+88], 6
+
+; 471 : ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
+
+ 0072e 8d 91 f0 02 00
+ 00 lea edx, DWORD PTR [ecx+752]
+ 00734 89 41 50 mov DWORD PTR [ecx+80], eax
+ 00737 8d 41 58 lea eax, DWORD PTR [ecx+88]
+ 0073a 52 push edx
+ 0073b 50 push eax
+ 0073c 8b 41 60 mov eax, DWORD PTR [ecx+96]
+ 0073f 53 push ebx
+ 00740 ff 71 64 push DWORD PTR [ecx+100]
+ 00743 83 c1 70 add ecx, 112 ; 00000070H
+ 00746 8d 14 41 lea edx, DWORD PTR [ecx+eax*2]
+ 00749 b9 02 00 00 00 mov ecx, 2
+ 0074e e8 00 00 00 00 call _inflate_table
+
+; 475 : state->mode = BAD;
+
+ 00753 8b 55 f4 mov edx, DWORD PTR _state$1$[ebp]
+ 00756 83 c4 10 add esp, 16 ; 00000010H
+
+; 476 : break;
+
+ 00759 8b 4d fc mov ecx, DWORD PTR _hold$1$[ebp]
+ 0075c 85 c0 test eax, eax
+ 0075e 74 1b je SHORT $LN301@inflateBac
+
+; 472 : &(state->next), &(state->distbits), state->work);
+; 473 : if (ret) {
+; 474 : strm->msg = (char *)"invalid distances set";
+
+ 00760 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 00763 c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BG@GMDFCBGP@invalid?5distances?5set?$AA@
+
+; 475 : state->mode = BAD;
+
+ 0076a c7 02 1d 00 00
+ 00 mov DWORD PTR [edx], 29 ; 0000001dH
+
+; 476 : break;
+
+ 00770 8b 5d f8 mov ebx, DWORD PTR _next$[ebp]
+ 00773 89 5d f0 mov DWORD PTR _next$5$[ebp], ebx
+ 00776 e9 87 05 00 00 jmp $LN393@inflateBac
+$LN301@inflateBac:
+
+; 477 : }
+; 478 : Tracev((stderr, "inflate: codes ok\n"));
+; 479 : state->mode = LEN;
+
+ 0077b c7 02 14 00 00
+ 00 mov DWORD PTR [edx], 20 ; 00000014H
+ 00781 8b 5d f8 mov ebx, DWORD PTR _next$[ebp]
+ 00784 89 5d f0 mov DWORD PTR _next$5$[ebp], ebx
+$LN302@inflateBac:
+
+; 480 :
+; 481 : case LEN:
+; 482 : /* use inflate_fast() if we have enough input and output */
+; 483 : if (have >= 6 && left >= 258) {
+
+ 00787 83 fe 06 cmp esi, 6
+ 0078a 0f 82 8a 00 00
+ 00 jb $LN303@inflateBac
+ 00790 81 7d e8 02 01
+ 00 00 cmp DWORD PTR _left$1$[ebp], 258 ; 00000102H
+ 00797 0f 82 7d 00 00
+ 00 jb $LN303@inflateBac
+
+; 484 : RESTORE();
+
+ 0079d 8b 55 08 mov edx, DWORD PTR _strm$[ebp]
+ 007a0 8b 45 e4 mov eax, DWORD PTR _put$1$[ebp]
+ 007a3 89 42 0c mov DWORD PTR [edx+12], eax
+ 007a6 8b 45 e8 mov eax, DWORD PTR _left$1$[ebp]
+ 007a9 89 42 10 mov DWORD PTR [edx+16], eax
+ 007ac 8b c2 mov eax, edx
+ 007ae 8b 55 f4 mov edx, DWORD PTR _state$1$[ebp]
+ 007b1 89 18 mov DWORD PTR [eax], ebx
+ 007b3 8b d8 mov ebx, eax
+ 007b5 89 73 04 mov DWORD PTR [ebx+4], esi
+ 007b8 89 4a 38 mov DWORD PTR [edx+56], ecx
+
+; 485 : if (state->whave < state->wsize)
+
+ 007bb 8b 4a 28 mov ecx, DWORD PTR [edx+40]
+ 007be 89 7a 3c mov DWORD PTR [edx+60], edi
+ 007c1 39 4a 2c cmp DWORD PTR [edx+44], ecx
+ 007c4 73 08 jae SHORT $LN304@inflateBac
+
+; 486 : state->whave = state->wsize - left;
+
+ 007c6 8b c1 mov eax, ecx
+ 007c8 2b 45 e8 sub eax, DWORD PTR _left$1$[ebp]
+ 007cb 89 42 2c mov DWORD PTR [edx+44], eax
+$LN304@inflateBac:
+
+; 487 : inflate_fast(strm, state->wsize);
+
+ 007ce 8b d1 mov edx, ecx
+ 007d0 8b cb mov ecx, ebx
+ 007d2 e8 00 00 00 00 call _inflate_fast
+
+; 488 : LOAD();
+
+ 007d7 8b 43 0c mov eax, DWORD PTR [ebx+12]
+ 007da 8b 55 f4 mov edx, DWORD PTR _state$1$[ebp]
+ 007dd 89 45 e4 mov DWORD PTR _put$1$[ebp], eax
+ 007e0 8b 43 10 mov eax, DWORD PTR [ebx+16]
+ 007e3 8b 1b mov ebx, DWORD PTR [ebx]
+ 007e5 89 45 e8 mov DWORD PTR _left$1$[ebp], eax
+ 007e8 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 007eb 89 5d f8 mov DWORD PTR _next$[ebp], ebx
+ 007ee 8b 4a 38 mov ecx, DWORD PTR [edx+56]
+ 007f1 8b 7a 3c mov edi, DWORD PTR [edx+60]
+ 007f4 8b 70 04 mov esi, DWORD PTR [eax+4]
+ 007f7 89 5d f0 mov DWORD PTR _next$5$[ebp], ebx
+ 007fa 89 4d fc mov DWORD PTR _hold$1$[ebp], ecx
+ 007fd 89 7d ec mov DWORD PTR _bits$1$[ebp], edi
+
+; 489 : break;
+
+ 00800 e9 fd 04 00 00 jmp $LN393@inflateBac
+$LN277@inflateBac:
+
+; 369 : strm->msg = (char *)"too many length or distance symbols";
+
+ 00805 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 00808 c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0CE@GMIGFPBB@too?5many?5length?5or?5distance?5symb@
+
+; 370 : state->mode = BAD;
+
+ 0080f c7 02 1d 00 00
+ 00 mov DWORD PTR [edx], 29 ; 0000001dH
+
+; 371 : break;
+
+ 00815 e9 df 04 00 00 jmp $LN505@inflateBac
+$LN303@inflateBac:
+
+; 490 : }
+; 491 :
+; 492 : /* get a literal, length, or end-of-block code */
+; 493 : for (;;) {
+; 494 : here = state->lencode[BITS(state->lenbits)];
+
+ 0081a 8b 45 f4 mov eax, DWORD PTR _state$1$[ebp]
+ 0081d ba 01 00 00 00 mov edx, 1
+ 00822 8b 48 54 mov ecx, DWORD PTR [eax+84]
+ 00825 8b 40 4c mov eax, DWORD PTR [eax+76]
+ 00828 d3 e2 shl edx, cl
+ 0082a 4a dec edx
+ 0082b 23 55 fc and edx, DWORD PTR _hold$1$[ebp]
+ 0082e 8b 04 90 mov eax, DWORD PTR [eax+edx*4]
+
+; 495 : if ((unsigned)(here.bits) <= bits) break;
+
+ 00831 8b c8 mov ecx, eax
+ 00833 c1 e9 08 shr ecx, 8
+ 00836 0f b6 c9 movzx ecx, cl
+ 00839 3b cf cmp ecx, edi
+ 0083b 76 5c jbe SHORT $LN382@inflateBac
+ 0083d 0f 1f 00 npad 3
+$LL165@inflateBac:
+
+; 496 : PULLBYTE();
+
+ 00840 85 f6 test esi, esi
+ 00842 75 1a jne SHORT $LN171@inflateBac
+ 00844 8d 45 f8 lea eax, DWORD PTR _next$[ebp]
+ 00847 50 push eax
+ 00848 ff 75 10 push DWORD PTR _in_desc$[ebp]
+ 0084b ff 55 0c call DWORD PTR _in$[ebp]
+ 0084e 8b f0 mov esi, eax
+ 00850 83 c4 08 add esp, 8
+ 00853 85 f6 test esi, esi
+ 00855 0f 84 d0 04 00
+ 00 je $LN369@inflateBac
+ 0085b 8b 5d f8 mov ebx, DWORD PTR _next$[ebp]
+$LN171@inflateBac:
+ 0085e 0f b6 03 movzx eax, BYTE PTR [ebx]
+ 00861 8b cf mov ecx, edi
+ 00863 d3 e0 shl eax, cl
+ 00865 43 inc ebx
+ 00866 01 45 fc add DWORD PTR _hold$1$[ebp], eax
+ 00869 ba 01 00 00 00 mov edx, 1
+ 0086e 8b 45 f4 mov eax, DWORD PTR _state$1$[ebp]
+ 00871 83 c7 08 add edi, 8
+ 00874 89 5d f8 mov DWORD PTR _next$[ebp], ebx
+ 00877 4e dec esi
+ 00878 89 5d f0 mov DWORD PTR _next$5$[ebp], ebx
+ 0087b 89 7d ec mov DWORD PTR _bits$1$[ebp], edi
+ 0087e 8b 48 54 mov ecx, DWORD PTR [eax+84]
+ 00881 8b 40 4c mov eax, DWORD PTR [eax+76]
+ 00884 d3 e2 shl edx, cl
+ 00886 4a dec edx
+ 00887 23 55 fc and edx, DWORD PTR _hold$1$[ebp]
+ 0088a 8b 04 90 mov eax, DWORD PTR [eax+edx*4]
+ 0088d 8b c8 mov ecx, eax
+ 0088f c1 e9 08 shr ecx, 8
+ 00892 0f b6 c9 movzx ecx, cl
+ 00895 3b cf cmp ecx, edi
+ 00897 77 a7 ja SHORT $LL165@inflateBac
+$LN382@inflateBac:
+
+; 497 : }
+; 498 : if (here.op && (here.op & 0xf0) == 0) {
+
+ 00899 84 c0 test al, al
+ 0089b 0f 84 d7 00 00
+ 00 je $LN490@inflateBac
+ 008a1 a8 f0 test al, 240 ; 000000f0H
+ 008a3 0f 85 cf 00 00
+ 00 jne $LN490@inflateBac
+
+; 499 : last = here;
+; 500 : for (;;) {
+; 501 : here = state->lencode[last.val +
+
+ 008a9 8b c8 mov ecx, eax
+ 008ab bb 01 00 00 00 mov ebx, 1
+ 008b0 c1 e9 08 shr ecx, 8
+ 008b3 8b d0 mov edx, eax
+ 008b5 0f b6 f9 movzx edi, cl
+ 008b8 89 4d d0 mov DWORD PTR tv1718[ebp], ecx
+ 008bb 0f b6 c8 movzx ecx, al
+ 008be 03 cf add ecx, edi
+ 008c0 c1 e8 10 shr eax, 16 ; 00000010H
+ 008c3 d3 e3 shl ebx, cl
+ 008c5 8b cf mov ecx, edi
+ 008c7 4b dec ebx
+ 008c8 89 55 e0 mov DWORD PTR _last$[ebp], edx
+ 008cb 23 5d fc and ebx, DWORD PTR _hold$1$[ebp]
+ 008ce d3 eb shr ebx, cl
+ 008d0 03 d8 add ebx, eax
+ 008d2 8b 45 f4 mov eax, DWORD PTR _state$1$[ebp]
+ 008d5 8b 40 4c mov eax, DWORD PTR [eax+76]
+ 008d8 8b 04 98 mov eax, DWORD PTR [eax+ebx*4]
+
+; 502 : (BITS(last.bits + last.op) >> last.bits)];
+; 503 : if ((unsigned)(last.bits + here.bits) <= bits) break;
+
+ 008db 8b c8 mov ecx, eax
+ 008dd c1 e9 08 shr ecx, 8
+ 008e0 0f b6 f9 movzx edi, cl
+ 008e3 8b 4d d0 mov ecx, DWORD PTR tv1718[ebp]
+ 008e6 0f b6 c9 movzx ecx, cl
+ 008e9 03 f9 add edi, ecx
+ 008eb 3b 7d ec cmp edi, DWORD PTR _bits$1$[ebp]
+ 008ee 8b 7d ec mov edi, DWORD PTR _bits$1$[ebp]
+ 008f1 0f 86 75 00 00
+ 00 jbe $LN185@inflateBac
+$LL174@inflateBac:
+
+; 504 : PULLBYTE();
+
+ 008f7 85 f6 test esi, esi
+ 008f9 75 1f jne SHORT $LN486@inflateBac
+ 008fb 8d 45 f8 lea eax, DWORD PTR _next$[ebp]
+ 008fe 50 push eax
+ 008ff ff 75 10 push DWORD PTR _in_desc$[ebp]
+ 00902 ff 55 0c call DWORD PTR _in$[ebp]
+ 00905 8b f0 mov esi, eax
+ 00907 83 c4 08 add esp, 8
+ 0090a 85 f6 test esi, esi
+ 0090c 0f 84 19 04 00
+ 00 je $LN369@inflateBac
+ 00912 8b 5d f8 mov ebx, DWORD PTR _next$[ebp]
+ 00915 8b 55 e0 mov edx, DWORD PTR _last$[ebp]
+ 00918 eb 03 jmp SHORT $LN180@inflateBac
+$LN486@inflateBac:
+ 0091a 8b 5d f0 mov ebx, DWORD PTR _next$5$[ebp]
+$LN180@inflateBac:
+ 0091d 0f b6 03 movzx eax, BYTE PTR [ebx]
+ 00920 8b cf mov ecx, edi
+ 00922 d3 e0 shl eax, cl
+ 00924 83 c7 08 add edi, 8
+ 00927 01 45 fc add DWORD PTR _hold$1$[ebp], eax
+ 0092a 43 inc ebx
+ 0092b 0f b7 45 e2 movzx eax, WORD PTR _last$[ebp+2]
+ 0092f 4e dec esi
+ 00930 89 7d ec mov DWORD PTR _bits$1$[ebp], edi
+ 00933 bf 01 00 00 00 mov edi, 1
+ 00938 89 5d f8 mov DWORD PTR _next$[ebp], ebx
+ 0093b 89 5d f0 mov DWORD PTR _next$5$[ebp], ebx
+ 0093e 0f b6 de movzx ebx, dh
+ 00941 0f b6 ca movzx ecx, dl
+ 00944 03 cb add ecx, ebx
+ 00946 d3 e7 shl edi, cl
+ 00948 8b cb mov ecx, ebx
+ 0094a 4f dec edi
+ 0094b 23 7d fc and edi, DWORD PTR _hold$1$[ebp]
+ 0094e d3 ef shr edi, cl
+ 00950 03 f8 add edi, eax
+ 00952 8b 45 f4 mov eax, DWORD PTR _state$1$[ebp]
+ 00955 8b 40 4c mov eax, DWORD PTR [eax+76]
+ 00958 8b 04 b8 mov eax, DWORD PTR [eax+edi*4]
+ 0095b 8b c8 mov ecx, eax
+ 0095d 8b 7d ec mov edi, DWORD PTR _bits$1$[ebp]
+ 00960 c1 e9 08 shr ecx, 8
+ 00963 0f b6 c9 movzx ecx, cl
+ 00966 03 cb add ecx, ebx
+ 00968 3b cf cmp ecx, edi
+ 0096a 77 8b ja SHORT $LL174@inflateBac
+$LN185@inflateBac:
+
+; 505 : }
+; 506 : DROPBITS(last.bits);
+
+ 0096c 8b 5d fc mov ebx, DWORD PTR _hold$1$[ebp]
+ 0096f 0f b6 ce movzx ecx, dh
+ 00972 d3 eb shr ebx, cl
+ 00974 2b f9 sub edi, ecx
+ 00976 eb 03 jmp SHORT $LN184@inflateBac
+$LN490@inflateBac:
+ 00978 8b 5d fc mov ebx, DWORD PTR _hold$1$[ebp]
+$LN184@inflateBac:
+
+; 507 : }
+; 508 : DROPBITS(here.bits);
+; 509 : state->length = (unsigned)here.val;
+
+ 0097b 8b 55 f4 mov edx, DWORD PTR _state$1$[ebp]
+ 0097e 8b c8 mov ecx, eax
+ 00980 c1 e9 08 shr ecx, 8
+ 00983 0f b6 c9 movzx ecx, cl
+ 00986 d3 eb shr ebx, cl
+ 00988 2b f9 sub edi, ecx
+ 0098a 8b c8 mov ecx, eax
+ 0098c 89 5d fc mov DWORD PTR _hold$1$[ebp], ebx
+ 0098f c1 e9 10 shr ecx, 16 ; 00000010H
+ 00992 89 7d ec mov DWORD PTR _bits$1$[ebp], edi
+ 00995 89 4a 40 mov DWORD PTR [edx+64], ecx
+
+; 510 :
+; 511 : /* process literal */
+; 512 : if (here.op == 0) {
+
+ 00998 84 c0 test al, al
+ 0099a 75 44 jne SHORT $LN312@inflateBac
+
+; 513 : Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
+; 514 : "inflate: literal '%c'\n" :
+; 515 : "inflate: literal 0x%02x\n", here.val));
+; 516 : ROOM();
+
+ 0099c 83 7d e8 00 cmp DWORD PTR _left$1$[ebp], 0
+ 009a0 75 24 jne SHORT $LN497@inflateBac
+ 009a2 8b 42 28 mov eax, DWORD PTR [edx+40]
+ 009a5 8b 5a 34 mov ebx, DWORD PTR [edx+52]
+ 009a8 50 push eax
+ 009a9 53 push ebx
+ 009aa ff 75 18 push DWORD PTR _out_desc$[ebp]
+ 009ad 89 45 e8 mov DWORD PTR _left$1$[ebp], eax
+ 009b0 89 42 2c mov DWORD PTR [edx+44], eax
+ 009b3 ff 55 14 call DWORD PTR _out$[ebp]
+ 009b6 83 c4 0c add esp, 12 ; 0000000cH
+ 009b9 85 c0 test eax, eax
+ 009bb 0f 85 84 03 00
+ 00 jne $LN372@inflateBac
+ 009c1 8b 55 f4 mov edx, DWORD PTR _state$1$[ebp]
+ 009c4 eb 03 jmp SHORT $LN189@inflateBac
+$LN497@inflateBac:
+ 009c6 8b 5d e4 mov ebx, DWORD PTR _put$1$[ebp]
+$LN189@inflateBac:
+
+; 517 : *put++ = (unsigned char)(state->length);
+
+ 009c9 8a 42 40 mov al, BYTE PTR [edx+64]
+ 009cc 88 03 mov BYTE PTR [ebx], al
+ 009ce 43 inc ebx
+
+; 518 : left--;
+
+ 009cf ff 4d e8 dec DWORD PTR _left$1$[ebp]
+ 009d2 89 5d e4 mov DWORD PTR _put$1$[ebp], ebx
+
+; 519 : state->mode = LEN;
+
+ 009d5 c7 02 14 00 00
+ 00 mov DWORD PTR [edx], 20 ; 00000014H
+
+; 520 : break;
+
+ 009db e9 19 03 00 00 jmp $LN505@inflateBac
+$LN312@inflateBac:
+
+; 521 : }
+; 522 :
+; 523 : /* process end of block */
+; 524 : if (here.op & 32) {
+
+ 009e0 a8 20 test al, 32 ; 00000020H
+ 009e2 74 0b je SHORT $LN315@inflateBac
+
+; 525 : Tracevv((stderr, "inflate: end of block\n"));
+; 526 : state->mode = TYPE;
+
+ 009e4 c7 02 0b 00 00
+ 00 mov DWORD PTR [edx], 11 ; 0000000bH
+
+; 527 : break;
+
+ 009ea e9 0a 03 00 00 jmp $LN505@inflateBac
+$LN315@inflateBac:
+
+; 528 : }
+; 529 :
+; 530 : /* invalid code */
+; 531 : if (here.op & 64) {
+
+ 009ef a8 40 test al, 64 ; 00000040H
+ 009f1 74 15 je SHORT $LN316@inflateBac
+
+; 532 : strm->msg = (char *)"invalid literal/length code";
+
+ 009f3 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 009f6 c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BM@FFFLPBBC@invalid?5literal?1length?5code?$AA@
+
+; 533 : state->mode = BAD;
+
+ 009fd c7 02 1d 00 00
+ 00 mov DWORD PTR [edx], 29 ; 0000001dH
+
+; 534 : break;
+
+ 00a03 e9 f1 02 00 00 jmp $LN505@inflateBac
+$LN316@inflateBac:
+
+; 535 : }
+; 536 :
+; 537 : /* length code -- get extra bits, if any */
+; 538 : state->extra = (unsigned)(here.op) & 15;
+
+ 00a08 0f b6 c0 movzx eax, al
+ 00a0b 83 e0 0f and eax, 15 ; 0000000fH
+ 00a0e 89 42 48 mov DWORD PTR [edx+72], eax
+
+; 539 : if (state->extra != 0) {
+
+ 00a11 74 61 je SHORT $LN204@inflateBac
+
+; 540 : NEEDBITS(state->extra);
+
+ 00a13 3b f8 cmp edi, eax
+ 00a15 73 43 jae SHORT $LN192@inflateBac
+ 00a17 8b 45 f8 mov eax, DWORD PTR _next$[ebp]
+ 00a1a 66 0f 1f 44 00
+ 00 npad 6
+$LL195@inflateBac:
+ 00a20 85 f6 test esi, esi
+ 00a22 75 1d jne SHORT $LN200@inflateBac
+ 00a24 8d 45 f8 lea eax, DWORD PTR _next$[ebp]
+ 00a27 50 push eax
+ 00a28 ff 75 10 push DWORD PTR _in_desc$[ebp]
+ 00a2b ff 55 0c call DWORD PTR _in$[ebp]
+ 00a2e 8b f0 mov esi, eax
+ 00a30 83 c4 08 add esp, 8
+ 00a33 85 f6 test esi, esi
+ 00a35 0f 84 f0 02 00
+ 00 je $LN369@inflateBac
+ 00a3b 8b 55 f4 mov edx, DWORD PTR _state$1$[ebp]
+ 00a3e 8b 45 f8 mov eax, DWORD PTR _next$[ebp]
+$LN200@inflateBac:
+ 00a41 0f b6 00 movzx eax, BYTE PTR [eax]
+ 00a44 8b cf mov ecx, edi
+ 00a46 d3 e0 shl eax, cl
+ 00a48 83 c7 08 add edi, 8
+ 00a4b 03 d8 add ebx, eax
+ 00a4d 4e dec esi
+ 00a4e 8b 45 f8 mov eax, DWORD PTR _next$[ebp]
+ 00a51 40 inc eax
+ 00a52 89 45 f8 mov DWORD PTR _next$[ebp], eax
+ 00a55 3b 7a 48 cmp edi, DWORD PTR [edx+72]
+ 00a58 72 c6 jb SHORT $LL195@inflateBac
+$LN192@inflateBac:
+
+; 541 : state->length += BITS(state->extra);
+
+ 00a5a 8b 4a 48 mov ecx, DWORD PTR [edx+72]
+ 00a5d b8 01 00 00 00 mov eax, 1
+ 00a62 d3 e0 shl eax, cl
+ 00a64 48 dec eax
+ 00a65 23 c3 and eax, ebx
+
+; 542 : DROPBITS(state->extra);
+
+ 00a67 d3 eb shr ebx, cl
+ 00a69 01 42 40 add DWORD PTR [edx+64], eax
+ 00a6c 2b f9 sub edi, ecx
+ 00a6e 89 5d fc mov DWORD PTR _hold$1$[ebp], ebx
+ 00a71 89 7d ec mov DWORD PTR _bits$1$[ebp], edi
+$LN204@inflateBac:
+
+; 543 : }
+; 544 : Tracevv((stderr, "inflate: length %u\n", state->length));
+; 545 :
+; 546 : /* get distance code */
+; 547 : for (;;) {
+; 548 : here = state->distcode[BITS(state->distbits)];
+
+ 00a74 8b 5d f4 mov ebx, DWORD PTR _state$1$[ebp]
+ 00a77 ba 01 00 00 00 mov edx, 1
+ 00a7c 8b 4b 58 mov ecx, DWORD PTR [ebx+88]
+ 00a7f 8b 43 50 mov eax, DWORD PTR [ebx+80]
+ 00a82 d3 e2 shl edx, cl
+ 00a84 4a dec edx
+ 00a85 23 55 fc and edx, DWORD PTR _hold$1$[ebp]
+ 00a88 8b 04 90 mov eax, DWORD PTR [eax+edx*4]
+
+; 549 : if ((unsigned)(here.bits) <= bits) break;
+
+ 00a8b 8b c8 mov ecx, eax
+ 00a8d c1 e9 08 shr ecx, 8
+ 00a90 0f b6 c9 movzx ecx, cl
+ 00a93 3b cf cmp ecx, edi
+ 00a95 76 53 jbe SHORT $LN479@inflateBac
+$LL206@inflateBac:
+
+; 550 : PULLBYTE();
+
+ 00a97 85 f6 test esi, esi
+ 00a99 75 17 jne SHORT $LN212@inflateBac
+ 00a9b 8d 45 f8 lea eax, DWORD PTR _next$[ebp]
+ 00a9e 50 push eax
+ 00a9f ff 75 10 push DWORD PTR _in_desc$[ebp]
+ 00aa2 ff 55 0c call DWORD PTR _in$[ebp]
+ 00aa5 8b f0 mov esi, eax
+ 00aa7 83 c4 08 add esp, 8
+ 00aaa 85 f6 test esi, esi
+ 00aac 0f 84 79 02 00
+ 00 je $LN369@inflateBac
+$LN212@inflateBac:
+ 00ab2 8b 55 f8 mov edx, DWORD PTR _next$[ebp]
+ 00ab5 8b cf mov ecx, edi
+ 00ab7 83 c7 08 add edi, 8
+ 00aba 4e dec esi
+ 00abb 89 7d ec mov DWORD PTR _bits$1$[ebp], edi
+ 00abe 0f b6 02 movzx eax, BYTE PTR [edx]
+ 00ac1 42 inc edx
+ 00ac2 d3 e0 shl eax, cl
+ 00ac4 01 45 fc add DWORD PTR _hold$1$[ebp], eax
+ 00ac7 89 55 f8 mov DWORD PTR _next$[ebp], edx
+ 00aca ba 01 00 00 00 mov edx, 1
+ 00acf 8b 4b 58 mov ecx, DWORD PTR [ebx+88]
+ 00ad2 8b 43 50 mov eax, DWORD PTR [ebx+80]
+ 00ad5 d3 e2 shl edx, cl
+ 00ad7 4a dec edx
+ 00ad8 23 55 fc and edx, DWORD PTR _hold$1$[ebp]
+ 00adb 8b 04 90 mov eax, DWORD PTR [eax+edx*4]
+ 00ade 8b c8 mov ecx, eax
+ 00ae0 c1 e9 08 shr ecx, 8
+ 00ae3 0f b6 c9 movzx ecx, cl
+ 00ae6 3b cf cmp ecx, edi
+ 00ae8 77 ad ja SHORT $LL206@inflateBac
+$LN479@inflateBac:
+
+; 551 : }
+; 552 : if ((here.op & 0xf0) == 0) {
+
+ 00aea a8 f0 test al, 240 ; 000000f0H
+ 00aec 0f 85 c7 00 00
+ 00 jne $LN491@inflateBac
+
+; 553 : last = here;
+; 554 : for (;;) {
+; 555 : here = state->distcode[last.val +
+
+ 00af2 8b c8 mov ecx, eax
+ 00af4 bb 01 00 00 00 mov ebx, 1
+ 00af9 c1 e9 08 shr ecx, 8
+ 00afc 8b d0 mov edx, eax
+ 00afe 0f b6 f9 movzx edi, cl
+ 00b01 89 4d d0 mov DWORD PTR tv1717[ebp], ecx
+ 00b04 0f b6 c8 movzx ecx, al
+ 00b07 03 cf add ecx, edi
+ 00b09 c1 e8 10 shr eax, 16 ; 00000010H
+ 00b0c d3 e3 shl ebx, cl
+ 00b0e 8b cf mov ecx, edi
+ 00b10 4b dec ebx
+ 00b11 89 55 e0 mov DWORD PTR _last$[ebp], edx
+ 00b14 23 5d fc and ebx, DWORD PTR _hold$1$[ebp]
+ 00b17 d3 eb shr ebx, cl
+ 00b19 03 d8 add ebx, eax
+ 00b1b 8b 45 f4 mov eax, DWORD PTR _state$1$[ebp]
+ 00b1e 8b 40 50 mov eax, DWORD PTR [eax+80]
+ 00b21 8b 04 98 mov eax, DWORD PTR [eax+ebx*4]
+
+; 556 : (BITS(last.bits + last.op) >> last.bits)];
+; 557 : if ((unsigned)(last.bits + here.bits) <= bits) break;
+
+ 00b24 8b c8 mov ecx, eax
+ 00b26 c1 e9 08 shr ecx, 8
+ 00b29 0f b6 f9 movzx edi, cl
+ 00b2c 8b 4d d0 mov ecx, DWORD PTR tv1717[ebp]
+ 00b2f 0f b6 c9 movzx ecx, cl
+ 00b32 03 f9 add edi, ecx
+ 00b34 3b 7d ec cmp edi, DWORD PTR _bits$1$[ebp]
+ 00b37 8b 7d ec mov edi, DWORD PTR _bits$1$[ebp]
+ 00b3a 76 71 jbe SHORT $LN226@inflateBac
+ 00b3c 0f 1f 40 00 npad 4
+$LL215@inflateBac:
+
+; 558 : PULLBYTE();
+
+ 00b40 85 f6 test esi, esi
+ 00b42 75 1a jne SHORT $LN221@inflateBac
+ 00b44 8d 45 f8 lea eax, DWORD PTR _next$[ebp]
+ 00b47 50 push eax
+ 00b48 ff 75 10 push DWORD PTR _in_desc$[ebp]
+ 00b4b ff 55 0c call DWORD PTR _in$[ebp]
+ 00b4e 8b f0 mov esi, eax
+ 00b50 83 c4 08 add esp, 8
+ 00b53 85 f6 test esi, esi
+ 00b55 0f 84 d0 01 00
+ 00 je $LN369@inflateBac
+ 00b5b 8b 55 e0 mov edx, DWORD PTR _last$[ebp]
+$LN221@inflateBac:
+ 00b5e 8b 5d f8 mov ebx, DWORD PTR _next$[ebp]
+ 00b61 8b cf mov ecx, edi
+ 00b63 83 c7 08 add edi, 8
+ 00b66 4e dec esi
+ 00b67 89 7d ec mov DWORD PTR _bits$1$[ebp], edi
+ 00b6a bf 01 00 00 00 mov edi, 1
+ 00b6f 0f b6 03 movzx eax, BYTE PTR [ebx]
+ 00b72 43 inc ebx
+ 00b73 d3 e0 shl eax, cl
+ 00b75 01 45 fc add DWORD PTR _hold$1$[ebp], eax
+ 00b78 0f b7 45 e2 movzx eax, WORD PTR _last$[ebp+2]
+ 00b7c 89 5d f8 mov DWORD PTR _next$[ebp], ebx
+ 00b7f 0f b6 de movzx ebx, dh
+ 00b82 0f b6 ca movzx ecx, dl
+ 00b85 03 cb add ecx, ebx
+ 00b87 d3 e7 shl edi, cl
+ 00b89 8b cb mov ecx, ebx
+ 00b8b 4f dec edi
+ 00b8c 23 7d fc and edi, DWORD PTR _hold$1$[ebp]
+ 00b8f d3 ef shr edi, cl
+ 00b91 03 f8 add edi, eax
+ 00b93 8b 45 f4 mov eax, DWORD PTR _state$1$[ebp]
+ 00b96 8b 40 50 mov eax, DWORD PTR [eax+80]
+ 00b99 8b 04 b8 mov eax, DWORD PTR [eax+edi*4]
+ 00b9c 8b c8 mov ecx, eax
+ 00b9e 8b 7d ec mov edi, DWORD PTR _bits$1$[ebp]
+ 00ba1 c1 e9 08 shr ecx, 8
+ 00ba4 0f b6 c9 movzx ecx, cl
+ 00ba7 03 cb add ecx, ebx
+ 00ba9 3b cf cmp ecx, edi
+ 00bab 77 93 ja SHORT $LL215@inflateBac
+$LN226@inflateBac:
+
+; 559 : }
+; 560 : DROPBITS(last.bits);
+
+ 00bad 8b 5d fc mov ebx, DWORD PTR _hold$1$[ebp]
+ 00bb0 0f b6 ce movzx ecx, dh
+ 00bb3 d3 eb shr ebx, cl
+ 00bb5 2b f9 sub edi, ecx
+ 00bb7 eb 03 jmp SHORT $LN225@inflateBac
+$LN491@inflateBac:
+ 00bb9 8b 5d fc mov ebx, DWORD PTR _hold$1$[ebp]
+$LN225@inflateBac:
+
+; 565 : state->mode = BAD;
+
+ 00bbc 8b 55 f4 mov edx, DWORD PTR _state$1$[ebp]
+ 00bbf 8b c8 mov ecx, eax
+ 00bc1 c1 e9 08 shr ecx, 8
+ 00bc4 0f b6 c9 movzx ecx, cl
+ 00bc7 d3 eb shr ebx, cl
+ 00bc9 2b f9 sub edi, ecx
+ 00bcb 89 5d fc mov DWORD PTR _hold$1$[ebp], ebx
+ 00bce 89 7d ec mov DWORD PTR _bits$1$[ebp], edi
+ 00bd1 a8 40 test al, 64 ; 00000040H
+ 00bd3 74 15 je SHORT $LN327@inflateBac
+
+; 561 : }
+; 562 : DROPBITS(here.bits);
+; 563 : if (here.op & 64) {
+; 564 : strm->msg = (char *)"invalid distance code";
+
+ 00bd5 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 00bd8 c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BG@LBKINIKP@invalid?5distance?5code?$AA@
+
+; 565 : state->mode = BAD;
+
+ 00bdf c7 02 1d 00 00
+ 00 mov DWORD PTR [edx], 29 ; 0000001dH
+
+; 566 : break;
+
+ 00be5 e9 0f 01 00 00 jmp $LN505@inflateBac
+$LN327@inflateBac:
+
+; 567 : }
+; 568 : state->offset = (unsigned)here.val;
+
+ 00bea 8b c8 mov ecx, eax
+
+; 569 :
+; 570 : /* get distance extra bits, if any */
+; 571 : state->extra = (unsigned)(here.op) & 15;
+
+ 00bec 0f b6 c0 movzx eax, al
+ 00bef c1 e9 10 shr ecx, 16 ; 00000010H
+ 00bf2 83 e0 0f and eax, 15 ; 0000000fH
+ 00bf5 89 4a 44 mov DWORD PTR [edx+68], ecx
+ 00bf8 89 42 48 mov DWORD PTR [edx+72], eax
+
+; 572 : if (state->extra != 0) {
+
+ 00bfb 74 5b je SHORT $LN242@inflateBac
+
+; 573 : NEEDBITS(state->extra);
+
+ 00bfd 3b f8 cmp edi, eax
+ 00bff 73 3d jae SHORT $LN230@inflateBac
+ 00c01 8b 45 f8 mov eax, DWORD PTR _next$[ebp]
+$LL233@inflateBac:
+ 00c04 85 f6 test esi, esi
+ 00c06 75 1d jne SHORT $LN238@inflateBac
+ 00c08 8d 45 f8 lea eax, DWORD PTR _next$[ebp]
+ 00c0b 50 push eax
+ 00c0c ff 75 10 push DWORD PTR _in_desc$[ebp]
+ 00c0f ff 55 0c call DWORD PTR _in$[ebp]
+ 00c12 8b f0 mov esi, eax
+ 00c14 83 c4 08 add esp, 8
+ 00c17 85 f6 test esi, esi
+ 00c19 0f 84 0c 01 00
+ 00 je $LN369@inflateBac
+ 00c1f 8b 55 f4 mov edx, DWORD PTR _state$1$[ebp]
+ 00c22 8b 45 f8 mov eax, DWORD PTR _next$[ebp]
+$LN238@inflateBac:
+ 00c25 0f b6 00 movzx eax, BYTE PTR [eax]
+ 00c28 8b cf mov ecx, edi
+ 00c2a d3 e0 shl eax, cl
+ 00c2c 83 c7 08 add edi, 8
+ 00c2f 03 d8 add ebx, eax
+ 00c31 4e dec esi
+ 00c32 8b 45 f8 mov eax, DWORD PTR _next$[ebp]
+ 00c35 40 inc eax
+ 00c36 89 45 f8 mov DWORD PTR _next$[ebp], eax
+ 00c39 3b 7a 48 cmp edi, DWORD PTR [edx+72]
+ 00c3c 72 c6 jb SHORT $LL233@inflateBac
+$LN230@inflateBac:
+
+; 574 : state->offset += BITS(state->extra);
+
+ 00c3e 8b 4a 48 mov ecx, DWORD PTR [edx+72]
+ 00c41 b8 01 00 00 00 mov eax, 1
+ 00c46 d3 e0 shl eax, cl
+ 00c48 48 dec eax
+ 00c49 23 c3 and eax, ebx
+
+; 575 : DROPBITS(state->extra);
+
+ 00c4b d3 eb shr ebx, cl
+ 00c4d 01 42 44 add DWORD PTR [edx+68], eax
+ 00c50 2b f9 sub edi, ecx
+ 00c52 89 5d fc mov DWORD PTR _hold$1$[ebp], ebx
+ 00c55 89 7d ec mov DWORD PTR _bits$1$[ebp], edi
+$LN242@inflateBac:
+
+; 576 : }
+; 577 : if (state->offset > state->wsize - (state->whave < state->wsize ?
+
+ 00c58 8b 4a 28 mov ecx, DWORD PTR [edx+40]
+ 00c5b 39 4a 2c cmp DWORD PTR [edx+44], ecx
+ 00c5e 8b 5d e8 mov ebx, DWORD PTR _left$1$[ebp]
+ 00c61 1b c0 sbb eax, eax
+ 00c63 23 c3 and eax, ebx
+ 00c65 2b c8 sub ecx, eax
+ 00c67 39 4a 44 cmp DWORD PTR [edx+68], ecx
+ 00c6a 76 15 jbe SHORT $LL246@inflateBac
+
+; 578 : left : 0)) {
+; 579 : strm->msg = (char *)"invalid distance too far back";
+
+ 00c6c 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 00c6f c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BO@ECPMAOGG@invalid?5distance?5too?5far?5back?$AA@
+
+; 580 : state->mode = BAD;
+
+ 00c76 c7 02 1d 00 00
+ 00 mov DWORD PTR [edx], 29 ; 0000001dH
+
+; 581 : break;
+
+ 00c7c e9 78 00 00 00 jmp $LN505@inflateBac
+$LL246@inflateBac:
+
+; 582 : }
+; 583 : Tracevv((stderr, "inflate: distance %u\n", state->offset));
+; 584 :
+; 585 : /* copy match from window to output */
+; 586 : do {
+; 587 : ROOM();
+
+ 00c81 85 db test ebx, ebx
+ 00c83 75 27 jne SHORT $LN498@inflateBac
+ 00c85 8b 42 28 mov eax, DWORD PTR [edx+40]
+ 00c88 8b 5a 34 mov ebx, DWORD PTR [edx+52]
+ 00c8b 50 push eax
+ 00c8c 53 push ebx
+ 00c8d ff 75 18 push DWORD PTR _out_desc$[ebp]
+ 00c90 89 5d e4 mov DWORD PTR _put$1$[ebp], ebx
+ 00c93 89 45 e8 mov DWORD PTR _left$1$[ebp], eax
+ 00c96 89 42 2c mov DWORD PTR [edx+44], eax
+ 00c99 ff 55 14 call DWORD PTR _out$[ebp]
+ 00c9c 83 c4 0c add esp, 12 ; 0000000cH
+ 00c9f 85 c0 test eax, eax
+ 00ca1 0f 85 9e 00 00
+ 00 jne $LN372@inflateBac
+ 00ca7 8b 55 f4 mov edx, DWORD PTR _state$1$[ebp]
+ 00caa eb 03 jmp SHORT $LN247@inflateBac
+$LN498@inflateBac:
+ 00cac 8b 5d e4 mov ebx, DWORD PTR _put$1$[ebp]
+$LN247@inflateBac:
+
+; 588 : copy = state->wsize - state->offset;
+
+ 00caf 8b 42 28 mov eax, DWORD PTR [edx+40]
+ 00cb2 8b 4a 44 mov ecx, DWORD PTR [edx+68]
+ 00cb5 2b c1 sub eax, ecx
+
+; 589 : if (copy < left) {
+
+ 00cb7 3b 45 e8 cmp eax, DWORD PTR _left$1$[ebp]
+ 00cba 73 09 jae SHORT $LN334@inflateBac
+
+; 590 : from = put + copy;
+; 591 : copy = left - copy;
+
+ 00cbc 8b 4d e8 mov ecx, DWORD PTR _left$1$[ebp]
+ 00cbf 03 d8 add ebx, eax
+ 00cc1 2b c8 sub ecx, eax
+
+; 592 : }
+
+ 00cc3 eb 05 jmp SHORT $LN335@inflateBac
+$LN334@inflateBac:
+
+; 593 : else {
+; 594 : from = put - state->offset;
+
+ 00cc5 2b d9 sub ebx, ecx
+
+; 595 : copy = left;
+
+ 00cc7 8b 4d e8 mov ecx, DWORD PTR _left$1$[ebp]
+$LN335@inflateBac:
+
+; 596 : }
+; 597 : if (copy > state->length) copy = state->length;
+
+ 00cca 3b 4a 40 cmp ecx, DWORD PTR [edx+64]
+ 00ccd 0f 47 4a 40 cmova ecx, DWORD PTR [edx+64]
+
+; 598 : state->length -= copy;
+
+ 00cd1 29 4a 40 sub DWORD PTR [edx+64], ecx
+
+; 599 : left -= copy;
+
+ 00cd4 29 4d e8 sub DWORD PTR _left$1$[ebp], ecx
+
+; 602 : } while (--copy);
+
+ 00cd7 8b 55 e4 mov edx, DWORD PTR _put$1$[ebp]
+ 00cda 2b da sub ebx, edx
+ 00cdc 0f 1f 40 00 npad 4
+$LL252@inflateBac:
+
+; 600 : do {
+; 601 : *put++ = *from++;
+
+ 00ce0 8a 04 13 mov al, BYTE PTR [ebx+edx]
+ 00ce3 88 02 mov BYTE PTR [edx], al
+ 00ce5 42 inc edx
+
+; 602 : } while (--copy);
+
+ 00ce6 83 e9 01 sub ecx, 1
+ 00ce9 75 f5 jne SHORT $LL252@inflateBac
+
+; 603 : } while (state->length != 0);
+
+ 00ceb 8b 5d e8 mov ebx, DWORD PTR _left$1$[ebp]
+ 00cee 89 55 e4 mov DWORD PTR _put$1$[ebp], edx
+ 00cf1 8b 55 f4 mov edx, DWORD PTR _state$1$[ebp]
+ 00cf4 39 4a 40 cmp DWORD PTR [edx+64], ecx
+ 00cf7 75 88 jne SHORT $LL246@inflateBac
+$LN505@inflateBac:
+ 00cf9 8b 5d f8 mov ebx, DWORD PTR _next$[ebp]
+ 00cfc 89 5d f0 mov DWORD PTR _next$5$[ebp], ebx
+$LN492@inflateBac:
+ 00cff 8b 4d fc mov ecx, DWORD PTR _hold$1$[ebp]
+$LN393@inflateBac:
+
+; 288 :
+; 289 : /* Inflate until end of block marked as last */
+; 290 : for (;;)
+; 291 : switch (state->mode) {
+
+ 00d02 8b 02 mov eax, DWORD PTR [edx]
+ 00d04 83 e8 0b sub eax, 11 ; 0000000bH
+ 00d07 83 f8 12 cmp eax, 18 ; 00000012H
+ 00d0a 0f 86 70 f3 ff
+ ff jbe $LL2@inflateBac
+$LN341@inflateBac:
+
+; 618 :
+; 619 : default: /* can't happen, but makes compilers happy */
+; 620 : ret = Z_STREAM_ERROR;
+
+ 00d10 bf fe ff ff ff mov edi, -2 ; fffffffeH
+$LN485@inflateBac:
+ 00d15 8b 45 f0 mov eax, DWORD PTR _next$5$[ebp]
+$inf_leave$509:
+
+; 621 : goto inf_leave;
+; 622 : }
+; 623 :
+; 624 : /* Return unused input */
+; 625 : inf_leave:
+; 626 : strm->next_in = next;
+
+ 00d18 8b 4d 08 mov ecx, DWORD PTR _strm$[ebp]
+ 00d1b 89 01 mov DWORD PTR [ecx], eax
+
+; 627 : strm->avail_in = have;
+; 628 : return ret;
+
+ 00d1d 8b c7 mov eax, edi
+ 00d1f 5f pop edi
+ 00d20 89 71 04 mov DWORD PTR [ecx+4], esi
+ 00d23 5e pop esi
+ 00d24 5b pop ebx
+
+; 629 : }
+
+ 00d25 8b e5 mov esp, ebp
+ 00d27 5d pop ebp
+ 00d28 c2 14 00 ret 20 ; 00000014H
+$LN369@inflateBac:
+
+; 621 : goto inf_leave;
+; 622 : }
+; 623 :
+; 624 : /* Return unused input */
+; 625 : inf_leave:
+; 626 : strm->next_in = next;
+
+ 00d2b 8b 4d 08 mov ecx, DWORD PTR _strm$[ebp]
+ 00d2e 33 c0 xor eax, eax
+ 00d30 bf fb ff ff ff mov edi, -5 ; fffffffbH
+ 00d35 89 01 mov DWORD PTR [ecx], eax
+
+; 627 : strm->avail_in = have;
+; 628 : return ret;
+
+ 00d37 8b c7 mov eax, edi
+ 00d39 5f pop edi
+ 00d3a 89 71 04 mov DWORD PTR [ecx+4], esi
+ 00d3d 5e pop esi
+ 00d3e 5b pop ebx
+
+; 629 : }
+
+ 00d3f 8b e5 mov esp, ebp
+ 00d41 5d pop ebp
+ 00d42 c2 14 00 ret 20 ; 00000014H
+$LN372@inflateBac:
+
+; 621 : goto inf_leave;
+; 622 : }
+; 623 :
+; 624 : /* Return unused input */
+; 625 : inf_leave:
+; 626 : strm->next_in = next;
+
+ 00d45 8b 4d 08 mov ecx, DWORD PTR _strm$[ebp]
+ 00d48 bf fb ff ff ff mov edi, -5 ; fffffffbH
+ 00d4d 8b 45 f8 mov eax, DWORD PTR _next$[ebp]
+ 00d50 89 01 mov DWORD PTR [ecx], eax
+
+; 627 : strm->avail_in = have;
+; 628 : return ret;
+
+ 00d52 8b c7 mov eax, edi
+ 00d54 5f pop edi
+ 00d55 89 71 04 mov DWORD PTR [ecx+4], esi
+ 00d58 5e pop esi
+ 00d59 5b pop ebx
+
+; 629 : }
+
+ 00d5a 8b e5 mov esp, ebp
+ 00d5c 5d pop ebp
+ 00d5d c2 14 00 ret 20 ; 00000014H
+$LN337@inflateBac:
+
+; 604 : break;
+; 605 :
+; 606 : case DONE:
+; 607 : /* inflate stream terminated properly -- write leftover output */
+; 608 : ret = Z_STREAM_END;
+; 609 : if (left < state->wsize) {
+
+ 00d60 8b 42 28 mov eax, DWORD PTR [edx+40]
+ 00d63 bf 01 00 00 00 mov edi, 1
+ 00d68 8b 4d e8 mov ecx, DWORD PTR _left$1$[ebp]
+ 00d6b 3b c8 cmp ecx, eax
+ 00d6d 73 a6 jae SHORT $LN485@inflateBac
+
+; 610 : if (out(out_desc, state->window, state->wsize - left))
+
+ 00d6f 2b c1 sub eax, ecx
+ 00d71 50 push eax
+ 00d72 ff 72 34 push DWORD PTR [edx+52]
+ 00d75 ff 75 18 push DWORD PTR _out_desc$[ebp]
+ 00d78 ff 55 14 call DWORD PTR _out$[ebp]
+ 00d7b 83 c4 0c add esp, 12 ; 0000000cH
+ 00d7e 85 c0 test eax, eax
+
+; 611 : ret = Z_BUF_ERROR;
+; 612 : }
+; 613 : goto inf_leave;
+
+ 00d80 8b 45 f8 mov eax, DWORD PTR _next$[ebp]
+ 00d83 74 93 je SHORT $inf_leave$509
+
+; 621 : goto inf_leave;
+; 622 : }
+; 623 :
+; 624 : /* Return unused input */
+; 625 : inf_leave:
+; 626 : strm->next_in = next;
+
+ 00d85 8b 4d 08 mov ecx, DWORD PTR _strm$[ebp]
+ 00d88 bf fb ff ff ff mov edi, -5 ; fffffffbH
+ 00d8d 89 01 mov DWORD PTR [ecx], eax
+
+; 627 : strm->avail_in = have;
+; 628 : return ret;
+
+ 00d8f 8b c7 mov eax, edi
+ 00d91 5f pop edi
+ 00d92 89 71 04 mov DWORD PTR [ecx+4], esi
+ 00d95 5e pop esi
+ 00d96 5b pop ebx
+
+; 629 : }
+
+ 00d97 8b e5 mov esp, ebp
+ 00d99 5d pop ebp
+ 00d9a c2 14 00 ret 20 ; 00000014H
+$LN340@inflateBac:
+
+; 614 :
+; 615 : case BAD:
+; 616 : ret = Z_DATA_ERROR;
+
+ 00d9d bf fd ff ff ff mov edi, -3 ; fffffffdH
+
+; 617 : goto inf_leave;
+
+ 00da2 e9 6e ff ff ff jmp $LN485@inflateBac
+$LN254@inflateBac:
+
+; 274 : return Z_STREAM_ERROR;
+
+ 00da7 b8 fe ff ff ff mov eax, -2 ; fffffffeH
+
+; 629 : }
+
+ 00dac 8b e5 mov esp, ebp
+ 00dae 5d pop ebp
+ 00daf c2 14 00 ret 20 ; 00000014H
+ 00db2 66 90 npad 2
+$LN507@inflateBac:
+ 00db4 00 00 00 00 DD $LN255@inflateBac
+ 00db8 00 00 00 00 DD $LN31@inflateBac
+ 00dbc 00 00 00 00 DD $LN56@inflateBac
+ 00dc0 00 00 00 00 DD $LN302@inflateBac
+ 00dc4 00 00 00 00 DD $LN337@inflateBac
+ 00dc8 00 00 00 00 DD $LN340@inflateBac
+ 00dcc 00 00 00 00 DD $LN341@inflateBac
+$LN473@inflateBac:
+ 00dd0 00 DB 0
+ 00dd1 06 DB 6
+ 00dd2 01 DB 1
+ 00dd3 06 DB 6
+ 00dd4 06 DB 6
+ 00dd5 02 DB 2
+ 00dd6 06 DB 6
+ 00dd7 06 DB 6
+ 00dd8 06 DB 6
+ 00dd9 03 DB 3
+ 00dda 06 DB 6
+ 00ddb 06 DB 6
+ 00ddc 06 DB 6
+ 00ddd 06 DB 6
+ 00dde 06 DB 6
+ 00ddf 06 DB 6
+ 00de0 06 DB 6
+ 00de1 04 DB 4
+ 00de2 05 DB 5
+ 00de3 90 npad 1
+$LN508@inflateBac:
+ 00de4 00 00 00 00 DD $LN259@inflateBac
+ 00de8 00 00 00 00 DD $LN260@inflateBac
+ 00dec 00 00 00 00 DD $LN261@inflateBac
+ 00df0 00 00 00 00 DD $LN262@inflateBac
+_inflateBack@20 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\infback.c
+; COMDAT _inflateBackEnd@4
+_TEXT SEGMENT
+_strm$ = 8 ; size = 4
+_inflateBackEnd@4 PROC ; COMDAT
+
+; 633 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 56 push esi
+
+; 634 : if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
+
+ 00004 8b 75 08 mov esi, DWORD PTR _strm$[ebp]
+ 00007 85 f6 test esi, esi
+ 00009 74 25 je SHORT $LN3@inflateBac
+ 0000b 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 0000e 85 c0 test eax, eax
+ 00010 74 1e je SHORT $LN3@inflateBac
+ 00012 8b 4e 24 mov ecx, DWORD PTR [esi+36]
+ 00015 85 c9 test ecx, ecx
+ 00017 74 17 je SHORT $LN3@inflateBac
+
+; 636 : ZFREE(strm, strm->state);
+
+ 00019 50 push eax
+ 0001a ff 76 28 push DWORD PTR [esi+40]
+ 0001d ff d1 call ecx
+ 0001f 83 c4 08 add esp, 8
+
+; 637 : strm->state = Z_NULL;
+
+ 00022 c7 46 1c 00 00
+ 00 00 mov DWORD PTR [esi+28], 0
+
+; 638 : Tracev((stderr, "inflate: end\n"));
+; 639 : return Z_OK;
+
+ 00029 33 c0 xor eax, eax
+ 0002b 5e pop esi
+
+; 640 : }
+
+ 0002c 5d pop ebp
+ 0002d c2 04 00 ret 4
+$LN3@inflateBac:
+
+; 635 : return Z_STREAM_ERROR;
+
+ 00030 b8 fe ff ff ff mov eax, -2 ; fffffffeH
+ 00035 5e pop esi
+
+; 640 : }
+
+ 00036 5d pop ebp
+ 00037 c2 04 00 ret 4
+_inflateBackEnd@4 ENDP
+_TEXT ENDS
+END
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/infback.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/infback.obj
new file mode 100644
index 0000000000..49e4f30d13
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/infback.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/inffast.cod b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/inffast.cod
new file mode 100644
index 0000000000..dbb0bf6f2a
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/inffast.cod
@@ -0,0 +1,990 @@
+; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.23506.0
+
+ TITLE d:\downloads\tgl-master\tgl-master\zlib\inffast.c
+ .686P
+ .XMM
+ include listing.inc
+ .model flat
+
+INCLUDELIB OLDNAMES
+
+PUBLIC _inflate_fast
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\inffast.c
+; COMDAT _inflate_fast
+_TEXT SEGMENT
+_whave$1$ = -68 ; size = 4
+_beg$1$ = -64 ; size = 4
+_end$1$ = -60 ; size = 4
+_last$1$ = -56 ; size = 4
+_window$1$ = -52 ; size = 4
+_wsize$1$ = -48 ; size = 4
+_dcode$1$ = -44 ; size = 4
+_lcode$1$ = -40 ; size = 4
+_bits$1$ = -36 ; size = 4
+_wnext$1$ = -32 ; size = 4
+_dmask$1$ = -28 ; size = 4
+_strm$1$ = -24 ; size = 4
+_lmask$1$ = -20 ; size = 4
+_state$1$ = -16 ; size = 4
+_dist$1$ = -12 ; size = 4
+_in$1$ = -8 ; size = 4
+_hold$1$ = -4 ; size = 4
+_inflate_fast PROC ; COMDAT
+; _strm$ = ecx
+; _start$ = edx
+
+; 70 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 44 sub esp, 68 ; 00000044H
+ 00006 53 push ebx
+ 00007 56 push esi
+ 00008 57 push edi
+ 00009 8b f9 mov edi, ecx
+ 0000b 89 7d e8 mov DWORD PTR _strm$1$[ebp], edi
+
+; 71 : struct inflate_state FAR *state;
+; 72 : z_const unsigned char FAR *in; /* local strm->next_in */
+; 73 : z_const unsigned char FAR *last; /* have enough input while in < last */
+; 74 : unsigned char FAR *out; /* local strm->next_out */
+; 75 : unsigned char FAR *beg; /* inflate()'s initial strm->next_out */
+; 76 : unsigned char FAR *end; /* while out < end, enough space available */
+; 77 : #ifdef INFLATE_STRICT
+; 78 : unsigned dmax; /* maximum distance from zlib header */
+; 79 : #endif
+; 80 : unsigned wsize; /* window size or zero if not using window */
+; 81 : unsigned whave; /* valid bytes in the window */
+; 82 : unsigned wnext; /* window write index */
+; 83 : unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */
+; 84 : unsigned long hold; /* local strm->hold */
+; 85 : unsigned bits; /* local strm->bits */
+; 86 : code const FAR *lcode; /* local strm->lencode */
+; 87 : code const FAR *dcode; /* local strm->distcode */
+; 88 : unsigned lmask; /* mask for first level of length codes */
+; 89 : unsigned dmask; /* mask for first level of distance codes */
+; 90 : code here; /* retrieved table entry */
+; 91 : unsigned op; /* code bits, operation, extra bits, or */
+; 92 : /* window position, window bytes to copy */
+; 93 : unsigned len; /* match length, unused bytes */
+; 94 : unsigned dist; /* match distance */
+; 95 : unsigned char FAR *from; /* where to copy match from */
+; 96 :
+; 97 : /* copy state to local variables */
+; 98 : state = (struct inflate_state FAR *)strm->state;
+
+ 0000e 8b 4f 1c mov ecx, DWORD PTR [edi+28]
+
+; 99 : in = strm->next_in - OFF;
+
+ 00011 8b 1f mov ebx, DWORD PTR [edi]
+
+; 100 : last = in + (strm->avail_in - 5);
+
+ 00013 8b 47 04 mov eax, DWORD PTR [edi+4]
+ 00016 4b dec ebx
+
+; 101 : out = strm->next_out - OFF;
+
+ 00017 8b 77 0c mov esi, DWORD PTR [edi+12]
+ 0001a 83 c0 fb add eax, -5 ; fffffffbH
+ 0001d 03 c3 add eax, ebx
+ 0001f 89 4d f0 mov DWORD PTR _state$1$[ebp], ecx
+ 00022 89 45 c8 mov DWORD PTR _last$1$[ebp], eax
+ 00025 4e dec esi
+
+; 102 : beg = out - (start - strm->avail_out);
+
+ 00026 8b 47 10 mov eax, DWORD PTR [edi+16]
+ 00029 8b f8 mov edi, eax
+
+; 103 : end = out + (strm->avail_out - 257);
+
+ 0002b 05 ff fe ff ff add eax, -257 ; fffffeffH
+ 00030 89 5d f8 mov DWORD PTR _in$1$[ebp], ebx
+ 00033 03 c6 add eax, esi
+ 00035 2b fa sub edi, edx
+
+; 104 : #ifdef INFLATE_STRICT
+; 105 : dmax = state->dmax;
+; 106 : #endif
+; 107 : wsize = state->wsize;
+; 108 : whave = state->whave;
+; 109 : wnext = state->wnext;
+; 110 : window = state->window;
+; 111 : hold = state->hold;
+
+ 00037 8b 51 38 mov edx, DWORD PTR [ecx+56]
+ 0003a 03 fe add edi, esi
+ 0003c 89 45 c4 mov DWORD PTR _end$1$[ebp], eax
+ 0003f 8b 41 28 mov eax, DWORD PTR [ecx+40]
+ 00042 89 45 d0 mov DWORD PTR _wsize$1$[ebp], eax
+ 00045 8b 41 2c mov eax, DWORD PTR [ecx+44]
+ 00048 89 45 bc mov DWORD PTR _whave$1$[ebp], eax
+ 0004b 8b 41 30 mov eax, DWORD PTR [ecx+48]
+ 0004e 89 45 e0 mov DWORD PTR _wnext$1$[ebp], eax
+ 00051 8b 41 34 mov eax, DWORD PTR [ecx+52]
+ 00054 89 45 cc mov DWORD PTR _window$1$[ebp], eax
+
+; 112 : bits = state->bits;
+; 113 : lcode = state->lencode;
+
+ 00057 8b 41 4c mov eax, DWORD PTR [ecx+76]
+ 0005a 89 45 d8 mov DWORD PTR _lcode$1$[ebp], eax
+
+; 114 : dcode = state->distcode;
+
+ 0005d 8b 41 50 mov eax, DWORD PTR [ecx+80]
+ 00060 89 45 d4 mov DWORD PTR _dcode$1$[ebp], eax
+
+; 115 : lmask = (1U << state->lenbits) - 1;
+
+ 00063 b8 01 00 00 00 mov eax, 1
+ 00068 89 45 ec mov DWORD PTR _lmask$1$[ebp], eax
+
+; 116 : dmask = (1U << state->distbits) - 1;
+
+ 0006b 89 45 e4 mov DWORD PTR _dmask$1$[ebp], eax
+ 0006e 8b 45 f0 mov eax, DWORD PTR _state$1$[ebp]
+ 00071 89 7d c0 mov DWORD PTR _beg$1$[ebp], edi
+ 00074 8b 79 3c mov edi, DWORD PTR [ecx+60]
+ 00077 8b 49 54 mov ecx, DWORD PTR [ecx+84]
+ 0007a d3 65 ec shl DWORD PTR _lmask$1$[ebp], cl
+ 0007d 8b 48 58 mov ecx, DWORD PTR [eax+88]
+ 00080 8b 45 e4 mov eax, DWORD PTR _dmask$1$[ebp]
+ 00083 ff 4d ec dec DWORD PTR _lmask$1$[ebp]
+ 00086 d3 e0 shl eax, cl
+ 00088 48 dec eax
+ 00089 89 45 e4 mov DWORD PTR _dmask$1$[ebp], eax
+ 0008c 0f 1f 40 00 npad 4
+$LL4@inflate_fa:
+
+; 117 :
+; 118 : /* decode literals and length/distances until end-of-block or not enough
+; 119 : input data or output space */
+; 120 : do {
+; 121 : if (bits < 15) {
+
+ 00090 83 ff 0f cmp edi, 15 ; 0000000fH
+ 00093 73 1d jae SHORT $LN22@inflate_fa
+
+; 122 : hold += (unsigned long)(PUP(in)) << bits;
+
+ 00095 0f b6 43 01 movzx eax, BYTE PTR [ebx+1]
+ 00099 8b cf mov ecx, edi
+ 0009b d3 e0 shl eax, cl
+
+; 123 : bits += 8;
+; 124 : hold += (unsigned long)(PUP(in)) << bits;
+
+ 0009d 83 c3 02 add ebx, 2
+ 000a0 03 d0 add edx, eax
+ 000a2 89 5d f8 mov DWORD PTR _in$1$[ebp], ebx
+ 000a5 8d 4f 08 lea ecx, DWORD PTR [edi+8]
+ 000a8 0f b6 03 movzx eax, BYTE PTR [ebx]
+ 000ab d3 e0 shl eax, cl
+ 000ad 03 d0 add edx, eax
+
+; 125 : bits += 8;
+
+ 000af 83 c7 10 add edi, 16 ; 00000010H
+$LN22@inflate_fa:
+
+; 126 : }
+; 127 : here = lcode[hold & lmask];
+
+ 000b2 8b 45 ec mov eax, DWORD PTR _lmask$1$[ebp]
+ 000b5 8b 4d d8 mov ecx, DWORD PTR _lcode$1$[ebp]
+ 000b8 23 c2 and eax, edx
+ 000ba 8b 1c 81 mov ebx, DWORD PTR [ecx+eax*4]
+
+; 128 : dolen:
+; 129 : op = (unsigned)(here.bits);
+
+ 000bd 8b c3 mov eax, ebx
+ 000bf c1 e8 08 shr eax, 8
+ 000c2 0f b6 c8 movzx ecx, al
+
+; 130 : hold >>= op;
+
+ 000c5 d3 ea shr edx, cl
+
+; 131 : bits -= op;
+
+ 000c7 2b f9 sub edi, ecx
+ 000c9 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+
+; 132 : op = (unsigned)(here.op);
+
+ 000cc 0f b6 d3 movzx edx, bl
+
+; 133 : if (op == 0) { /* literal */
+
+ 000cf 84 db test bl, bl
+ 000d1 74 3e je SHORT $LN72@inflate_fa
+$dolen$105:
+
+; 138 : }
+; 139 : else if (op & 16) { /* length base */
+
+ 000d3 f6 c2 10 test dl, 16 ; 00000010H
+ 000d6 75 44 jne SHORT $LN73@inflate_fa
+
+; 291 : }
+; 292 : }
+; 293 : else if ((op & 64) == 0) { /* 2nd level length code */
+
+ 000d8 f6 c2 40 test dl, 64 ; 00000040H
+ 000db 0f 85 b7 02 00
+ 00 jne $LN52@inflate_fa
+
+; 294 : here = lcode[here.val + (hold & ((1U << op) - 1))];
+
+ 000e1 8b ca mov ecx, edx
+ 000e3 c1 eb 10 shr ebx, 16 ; 00000010H
+ 000e6 8b 55 fc mov edx, DWORD PTR _hold$1$[ebp]
+ 000e9 b8 01 00 00 00 mov eax, 1
+ 000ee d3 e0 shl eax, cl
+ 000f0 8b 4d d8 mov ecx, DWORD PTR _lcode$1$[ebp]
+ 000f3 48 dec eax
+ 000f4 23 c2 and eax, edx
+ 000f6 03 c3 add eax, ebx
+ 000f8 8b 1c 81 mov ebx, DWORD PTR [ecx+eax*4]
+ 000fb 8b c3 mov eax, ebx
+ 000fd c1 e8 08 shr eax, 8
+ 00100 0f b6 c8 movzx ecx, al
+ 00103 d3 ea shr edx, cl
+ 00105 2b f9 sub edi, ecx
+ 00107 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 0010a 0f b6 d3 movzx edx, bl
+ 0010d 84 db test bl, bl
+ 0010f 75 c2 jne SHORT $dolen$105
+$LN72@inflate_fa:
+
+; 134 : Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
+; 135 : "inflate: literal '%c'\n" :
+; 136 : "inflate: literal 0x%02x\n", here.val));
+; 137 : PUP(out) = (unsigned char)(here.val);
+
+ 00111 46 inc esi
+ 00112 c1 eb 10 shr ebx, 16 ; 00000010H
+ 00115 88 1e mov BYTE PTR [esi], bl
+ 00117 e9 21 02 00 00 jmp $LN2@inflate_fa
+$LN73@inflate_fa:
+
+; 140 : len = (unsigned)(here.val);
+
+ 0011c c1 eb 10 shr ebx, 16 ; 00000010H
+
+; 141 : op &= 15; /* number of extra bits */
+
+ 0011f 83 e2 0f and edx, 15 ; 0000000fH
+
+; 142 : if (op) {
+
+ 00122 74 2c je SHORT $LN27@inflate_fa
+
+; 143 : if (bits < op) {
+
+ 00124 3b fa cmp edi, edx
+ 00126 73 14 jae SHORT $LN28@inflate_fa
+
+; 144 : hold += (unsigned long)(PUP(in)) << bits;
+
+ 00128 8b 45 f8 mov eax, DWORD PTR _in$1$[ebp]
+ 0012b 8b cf mov ecx, edi
+ 0012d 40 inc eax
+ 0012e 89 45 f8 mov DWORD PTR _in$1$[ebp], eax
+ 00131 0f b6 00 movzx eax, BYTE PTR [eax]
+ 00134 d3 e0 shl eax, cl
+ 00136 01 45 fc add DWORD PTR _hold$1$[ebp], eax
+
+; 145 : bits += 8;
+
+ 00139 83 c7 08 add edi, 8
+$LN28@inflate_fa:
+
+; 146 : }
+; 147 : len += (unsigned)hold & ((1U << op) - 1);
+
+ 0013c 8b ca mov ecx, edx
+ 0013e b8 01 00 00 00 mov eax, 1
+ 00143 d3 e0 shl eax, cl
+ 00145 48 dec eax
+ 00146 23 45 fc and eax, DWORD PTR _hold$1$[ebp]
+
+; 148 : hold >>= op;
+
+ 00149 d3 6d fc shr DWORD PTR _hold$1$[ebp], cl
+ 0014c 03 d8 add ebx, eax
+
+; 149 : bits -= op;
+
+ 0014e 2b fa sub edi, edx
+$LN27@inflate_fa:
+
+; 150 : }
+; 151 : Tracevv((stderr, "inflate: length %u\n", len));
+; 152 : if (bits < 15) {
+; 153 : hold += (unsigned long)(PUP(in)) << bits;
+
+ 00150 8b 55 fc mov edx, DWORD PTR _hold$1$[ebp]
+ 00153 83 ff 0f cmp edi, 15 ; 0000000fH
+ 00156 73 24 jae SHORT $LN29@inflate_fa
+ 00158 8b 45 f8 mov eax, DWORD PTR _in$1$[ebp]
+ 0015b 8b cf mov ecx, edi
+ 0015d 40 inc eax
+ 0015e 89 45 f8 mov DWORD PTR _in$1$[ebp], eax
+ 00161 0f b6 00 movzx eax, BYTE PTR [eax]
+ 00164 d3 e0 shl eax, cl
+
+; 154 : bits += 8;
+; 155 : hold += (unsigned long)(PUP(in)) << bits;
+
+ 00166 8d 4f 08 lea ecx, DWORD PTR [edi+8]
+ 00169 03 d0 add edx, eax
+ 0016b 8b 45 f8 mov eax, DWORD PTR _in$1$[ebp]
+ 0016e 40 inc eax
+ 0016f 89 45 f8 mov DWORD PTR _in$1$[ebp], eax
+ 00172 0f b6 00 movzx eax, BYTE PTR [eax]
+ 00175 d3 e0 shl eax, cl
+ 00177 03 d0 add edx, eax
+
+; 156 : bits += 8;
+
+ 00179 83 c7 10 add edi, 16 ; 00000010H
+$LN29@inflate_fa:
+
+; 157 : }
+; 158 : here = dcode[hold & dmask];
+
+ 0017c 8b 45 e4 mov eax, DWORD PTR _dmask$1$[ebp]
+ 0017f 8b 4d d4 mov ecx, DWORD PTR _dcode$1$[ebp]
+ 00182 23 c2 and eax, edx
+ 00184 8b 04 81 mov eax, DWORD PTR [ecx+eax*4]
+ 00187 89 45 f4 mov DWORD PTR _dist$1$[ebp], eax
+
+; 159 : dodist:
+; 160 : op = (unsigned)(here.bits);
+
+ 0018a c1 e8 08 shr eax, 8
+ 0018d 0f b6 c8 movzx ecx, al
+
+; 161 : hold >>= op;
+; 162 : bits -= op;
+; 163 : op = (unsigned)(here.op);
+
+ 00190 8b 45 f4 mov eax, DWORD PTR _dist$1$[ebp]
+ 00193 2b f9 sub edi, ecx
+ 00195 d3 ea shr edx, cl
+ 00197 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 0019a 0f b6 d0 movzx edx, al
+
+; 164 : if (op & 16) { /* distance base */
+
+ 0019d f6 c2 10 test dl, 16 ; 00000010H
+ 001a0 75 44 jne SHORT $LN74@inflate_fa
+$dodist$106:
+
+; 280 : }
+; 281 : }
+; 282 : }
+; 283 : else if ((op & 64) == 0) { /* 2nd level distance code */
+
+ 001a2 f6 c2 40 test dl, 64 ; 00000040H
+ 001a5 0f 85 0f 02 00
+ 00 jne $LN50@inflate_fa
+
+; 284 : here = dcode[here.val + (hold & ((1U << op) - 1))];
+
+ 001ab 8b ca mov ecx, edx
+ 001ad b8 01 00 00 00 mov eax, 1
+ 001b2 8b 55 d4 mov edx, DWORD PTR _dcode$1$[ebp]
+ 001b5 d3 e0 shl eax, cl
+ 001b7 8b 4d f4 mov ecx, DWORD PTR _dist$1$[ebp]
+ 001ba 48 dec eax
+ 001bb 23 45 fc and eax, DWORD PTR _hold$1$[ebp]
+ 001be c1 e9 10 shr ecx, 16 ; 00000010H
+ 001c1 03 c1 add eax, ecx
+ 001c3 8b 0c 82 mov ecx, DWORD PTR [edx+eax*4]
+ 001c6 8b c1 mov eax, ecx
+ 001c8 8b 55 fc mov edx, DWORD PTR _hold$1$[ebp]
+ 001cb c1 e8 08 shr eax, 8
+ 001ce 89 4d f4 mov DWORD PTR _dist$1$[ebp], ecx
+ 001d1 0f b6 c8 movzx ecx, al
+ 001d4 8b 45 f4 mov eax, DWORD PTR _dist$1$[ebp]
+ 001d7 2b f9 sub edi, ecx
+ 001d9 d3 ea shr edx, cl
+ 001db 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 001de 0f b6 d0 movzx edx, al
+ 001e1 f6 c2 10 test dl, 16 ; 00000010H
+ 001e4 74 bc je SHORT $dodist$106
+$LN74@inflate_fa:
+
+; 165 : dist = (unsigned)(here.val);
+
+ 001e6 c1 e8 10 shr eax, 16 ; 00000010H
+
+; 166 : op &= 15; /* number of extra bits */
+
+ 001e9 83 e2 0f and edx, 15 ; 0000000fH
+ 001ec 89 45 f4 mov DWORD PTR _dist$1$[ebp], eax
+
+; 167 : if (bits < op) {
+
+ 001ef 3b fa cmp edi, edx
+ 001f1 73 2c jae SHORT $LN33@inflate_fa
+
+; 168 : hold += (unsigned long)(PUP(in)) << bits;
+
+ 001f3 8b 45 f8 mov eax, DWORD PTR _in$1$[ebp]
+ 001f6 8b cf mov ecx, edi
+ 001f8 40 inc eax
+
+; 169 : bits += 8;
+
+ 001f9 83 c7 08 add edi, 8
+ 001fc 89 45 f8 mov DWORD PTR _in$1$[ebp], eax
+ 001ff 0f b6 00 movzx eax, BYTE PTR [eax]
+ 00202 d3 e0 shl eax, cl
+ 00204 01 45 fc add DWORD PTR _hold$1$[ebp], eax
+
+; 170 : if (bits < op) {
+
+ 00207 3b fa cmp edi, edx
+ 00209 73 14 jae SHORT $LN33@inflate_fa
+
+; 171 : hold += (unsigned long)(PUP(in)) << bits;
+
+ 0020b 8b 45 f8 mov eax, DWORD PTR _in$1$[ebp]
+ 0020e 8b cf mov ecx, edi
+ 00210 40 inc eax
+ 00211 89 45 f8 mov DWORD PTR _in$1$[ebp], eax
+ 00214 0f b6 00 movzx eax, BYTE PTR [eax]
+ 00217 d3 e0 shl eax, cl
+ 00219 01 45 fc add DWORD PTR _hold$1$[ebp], eax
+
+; 172 : bits += 8;
+
+ 0021c 83 c7 08 add edi, 8
+$LN33@inflate_fa:
+
+; 173 : }
+; 174 : }
+; 175 : dist += (unsigned)hold & ((1U << op) - 1);
+
+ 0021f 8b ca mov ecx, edx
+ 00221 b8 01 00 00 00 mov eax, 1
+ 00226 d3 e0 shl eax, cl
+
+; 176 : #ifdef INFLATE_STRICT
+; 177 : if (dist > dmax) {
+; 178 : strm->msg = (char *)"invalid distance too far back";
+; 179 : state->mode = BAD;
+; 180 : break;
+; 181 : }
+; 182 : #endif
+; 183 : hold >>= op;
+; 184 : bits -= op;
+
+ 00228 2b fa sub edi, edx
+ 0022a 48 dec eax
+ 0022b 89 7d dc mov DWORD PTR _bits$1$[ebp], edi
+ 0022e 23 45 fc and eax, DWORD PTR _hold$1$[ebp]
+ 00231 01 45 f4 add DWORD PTR _dist$1$[ebp], eax
+
+; 185 : Tracevv((stderr, "inflate: distance %u\n", dist));
+; 186 : op = (unsigned)(out - beg); /* max distance in output */
+
+ 00234 8b c6 mov eax, esi
+ 00236 2b 45 c0 sub eax, DWORD PTR _beg$1$[ebp]
+ 00239 d3 6d fc shr DWORD PTR _hold$1$[ebp], cl
+
+; 187 : if (dist > op) { /* see if copy from window */
+
+ 0023c 8b 55 f4 mov edx, DWORD PTR _dist$1$[ebp]
+ 0023f 3b d0 cmp edx, eax
+ 00241 0f 86 13 01 00
+ 00 jbe $LN34@inflate_fa
+
+; 188 : op = dist - op; /* distance back in window */
+
+ 00247 8b ca mov ecx, edx
+ 00249 2b c8 sub ecx, eax
+
+; 189 : if (op > whave) {
+
+ 0024b 3b 4d bc cmp ecx, DWORD PTR _whave$1$[ebp]
+ 0024e 76 10 jbe SHORT $LN37@inflate_fa
+
+; 190 : if (state->sane) {
+
+ 00250 8b 45 f0 mov eax, DWORD PTR _state$1$[ebp]
+ 00253 83 b8 c0 1b 00
+ 00 00 cmp DWORD PTR [eax+7104], 0
+ 0025a 0f 85 69 01 00
+ 00 jne $LN75@inflate_fa
+$LN37@inflate_fa:
+
+; 194 : break;
+; 195 : }
+; 196 : #ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
+; 197 : if (len <= op - whave) {
+; 198 : do {
+; 199 : PUP(out) = 0;
+; 200 : } while (--len);
+; 201 : continue;
+; 202 : }
+; 203 : len -= op - whave;
+; 204 : do {
+; 205 : PUP(out) = 0;
+; 206 : } while (--op > whave);
+; 207 : if (op == 0) {
+; 208 : from = out - dist;
+; 209 : do {
+; 210 : PUP(out) = PUP(from);
+; 211 : } while (--len);
+; 212 : continue;
+; 213 : }
+; 214 : #endif
+; 215 : }
+; 216 : from = window - OFF;
+
+ 00260 8b 7d cc mov edi, DWORD PTR _window$1$[ebp]
+
+; 217 : if (wnext == 0) { /* very common case */
+
+ 00263 8b 45 e0 mov eax, DWORD PTR _wnext$1$[ebp]
+ 00266 4f dec edi
+ 00267 85 c0 test eax, eax
+ 00269 75 1d jne SHORT $LN38@inflate_fa
+
+; 218 : from += wsize - op;
+
+ 0026b 8b 45 d0 mov eax, DWORD PTR _wsize$1$[ebp]
+ 0026e 2b c1 sub eax, ecx
+ 00270 03 f8 add edi, eax
+
+; 219 : if (op < len) { /* some from window */
+
+ 00272 3b cb cmp ecx, ebx
+ 00274 73 7c jae SHORT $LN69@inflate_fa
+
+; 220 : len -= op;
+
+ 00276 2b d9 sub ebx, ecx
+$LL7@inflate_fa:
+
+; 221 : do {
+; 222 : PUP(out) = PUP(from);
+
+ 00278 8a 47 01 mov al, BYTE PTR [edi+1]
+ 0027b 8d 7f 01 lea edi, DWORD PTR [edi+1]
+ 0027e 46 inc esi
+ 0027f 88 06 mov BYTE PTR [esi], al
+
+; 223 : } while (--op);
+
+ 00281 83 e9 01 sub ecx, 1
+ 00284 75 f2 jne SHORT $LL7@inflate_fa
+
+; 224 : from = out - dist; /* rest from output */
+; 225 : }
+; 226 : }
+
+ 00286 eb 66 jmp SHORT $LN101@inflate_fa
+$LN38@inflate_fa:
+
+; 227 : else if (wnext < op) { /* wrap around window */
+
+ 00288 3b c1 cmp eax, ecx
+ 0028a 73 44 jae SHORT $LN41@inflate_fa
+
+; 228 : from += wsize + wnext - op;
+
+ 0028c 2b c1 sub eax, ecx
+
+; 229 : op -= wnext;
+
+ 0028e 2b 4d e0 sub ecx, DWORD PTR _wnext$1$[ebp]
+ 00291 03 45 d0 add eax, DWORD PTR _wsize$1$[ebp]
+ 00294 03 f8 add edi, eax
+
+; 230 : if (op < len) { /* some from end of window */
+
+ 00296 3b cb cmp ecx, ebx
+ 00298 73 58 jae SHORT $LN69@inflate_fa
+
+; 231 : len -= op;
+
+ 0029a 2b d9 sub ebx, ecx
+
+; 234 : } while (--op);
+
+ 0029c 2b fe sub edi, esi
+ 0029e 66 90 npad 2
+$LL10@inflate_fa:
+
+; 232 : do {
+; 233 : PUP(out) = PUP(from);
+
+ 002a0 8a 44 37 01 mov al, BYTE PTR [edi+esi+1]
+ 002a4 46 inc esi
+ 002a5 88 06 mov BYTE PTR [esi], al
+
+; 234 : } while (--op);
+
+ 002a7 83 e9 01 sub ecx, 1
+ 002aa 75 f4 jne SHORT $LL10@inflate_fa
+
+; 235 : from = window - OFF;
+
+ 002ac 8b 7d cc mov edi, DWORD PTR _window$1$[ebp]
+
+; 236 : if (wnext < len) { /* some from start of window */
+
+ 002af 8b 45 e0 mov eax, DWORD PTR _wnext$1$[ebp]
+ 002b2 4f dec edi
+ 002b3 3b c3 cmp eax, ebx
+ 002b5 73 3b jae SHORT $LN69@inflate_fa
+
+; 237 : op = wnext;
+
+ 002b7 8b c8 mov ecx, eax
+
+; 238 : len -= op;
+
+ 002b9 2b d8 sub ebx, eax
+ 002bb 0f 1f 44 00 00 npad 5
+$LL13@inflate_fa:
+
+; 239 : do {
+; 240 : PUP(out) = PUP(from);
+
+ 002c0 8a 47 01 mov al, BYTE PTR [edi+1]
+ 002c3 8d 7f 01 lea edi, DWORD PTR [edi+1]
+ 002c6 46 inc esi
+ 002c7 88 06 mov BYTE PTR [esi], al
+
+; 241 : } while (--op);
+
+ 002c9 83 e9 01 sub ecx, 1
+ 002cc 75 f2 jne SHORT $LL13@inflate_fa
+
+; 242 : from = out - dist; /* rest from output */
+; 243 : }
+; 244 : }
+; 245 : }
+
+ 002ce eb 1e jmp SHORT $LN101@inflate_fa
+$LN41@inflate_fa:
+
+; 246 : else { /* contiguous in window */
+; 247 : from += wnext - op;
+
+ 002d0 2b c1 sub eax, ecx
+ 002d2 03 f8 add edi, eax
+
+; 248 : if (op < len) { /* some from window */
+
+ 002d4 3b cb cmp ecx, ebx
+ 002d6 73 1a jae SHORT $LN69@inflate_fa
+
+; 249 : len -= op;
+
+ 002d8 2b d9 sub ebx, ecx
+ 002da 66 0f 1f 44 00
+ 00 npad 6
+$LL16@inflate_fa:
+
+; 250 : do {
+; 251 : PUP(out) = PUP(from);
+
+ 002e0 8a 47 01 mov al, BYTE PTR [edi+1]
+ 002e3 8d 7f 01 lea edi, DWORD PTR [edi+1]
+ 002e6 46 inc esi
+ 002e7 88 06 mov BYTE PTR [esi], al
+
+; 252 : } while (--op);
+
+ 002e9 83 e9 01 sub ecx, 1
+ 002ec 75 f2 jne SHORT $LL16@inflate_fa
+$LN101@inflate_fa:
+
+; 253 : from = out - dist; /* rest from output */
+
+ 002ee 8b fe mov edi, esi
+ 002f0 2b fa sub edi, edx
+$LN69@inflate_fa:
+
+; 254 : }
+; 255 : }
+; 256 : while (len > 2) {
+
+ 002f2 83 fb 02 cmp ebx, 2
+ 002f5 76 2e jbe SHORT $LN18@inflate_fa
+ 002f7 8d 4b fd lea ecx, DWORD PTR [ebx-3]
+ 002fa b8 ab aa aa aa mov eax, -1431655765 ; aaaaaaabH
+ 002ff f7 e1 mul ecx
+ 00301 d1 ea shr edx, 1
+ 00303 42 inc edx
+$LL17@inflate_fa:
+
+; 257 : PUP(out) = PUP(from);
+
+ 00304 0f b6 47 01 movzx eax, BYTE PTR [edi+1]
+
+; 258 : PUP(out) = PUP(from);
+; 259 : PUP(out) = PUP(from);
+; 260 : len -= 3;
+
+ 00308 83 eb 03 sub ebx, 3
+ 0030b 88 46 01 mov BYTE PTR [esi+1], al
+ 0030e 0f b6 47 02 movzx eax, BYTE PTR [edi+2]
+ 00312 83 c7 03 add edi, 3
+ 00315 88 46 02 mov BYTE PTR [esi+2], al
+ 00318 83 c6 03 add esi, 3
+ 0031b 0f b6 07 movzx eax, BYTE PTR [edi]
+ 0031e 88 06 mov BYTE PTR [esi], al
+ 00320 83 ea 01 sub edx, 1
+ 00323 75 df jne SHORT $LL17@inflate_fa
+$LN18@inflate_fa:
+
+; 261 : }
+; 262 : if (len) {
+
+ 00325 85 db test ebx, ebx
+ 00327 74 11 je SHORT $LN99@inflate_fa
+
+; 263 : PUP(out) = PUP(from);
+
+ 00329 8a 47 01 mov al, BYTE PTR [edi+1]
+ 0032c 46 inc esi
+ 0032d 88 06 mov BYTE PTR [esi], al
+
+; 264 : if (len > 1)
+
+ 0032f 83 fb 01 cmp ebx, 1
+ 00332 76 06 jbe SHORT $LN99@inflate_fa
+
+; 265 : PUP(out) = PUP(from);
+
+ 00334 8a 47 02 mov al, BYTE PTR [edi+2]
+ 00337 46 inc esi
+ 00338 88 06 mov BYTE PTR [esi], al
+$LN99@inflate_fa:
+ 0033a 8b 7d dc mov edi, DWORD PTR _bits$1$[ebp]
+$LN2@inflate_fa:
+
+; 305 : break;
+; 306 : }
+; 307 : } while (in < last && out < end);
+
+ 0033d 8b 5d f8 mov ebx, DWORD PTR _in$1$[ebp]
+ 00340 3b 5d c8 cmp ebx, DWORD PTR _last$1$[ebp]
+ 00343 0f 83 93 00 00
+ 00 jae $LN3@inflate_fa
+ 00349 3b 75 c4 cmp esi, DWORD PTR _end$1$[ebp]
+ 0034c 0f 83 8a 00 00
+ 00 jae $LN3@inflate_fa
+ 00352 8b 55 fc mov edx, DWORD PTR _hold$1$[ebp]
+ 00355 e9 36 fd ff ff jmp $LL4@inflate_fa
+$LN34@inflate_fa:
+
+; 266 : }
+; 267 : }
+; 268 : else {
+; 269 : from = out - dist; /* copy direct from output */
+
+ 0035a 8b ce mov ecx, esi
+ 0035c 2b ca sub ecx, edx
+ 0035e 66 90 npad 2
+$LL21@inflate_fa:
+
+; 270 : do { /* minimum length is three */
+; 271 : PUP(out) = PUP(from);
+
+ 00360 0f b6 41 01 movzx eax, BYTE PTR [ecx+1]
+
+; 272 : PUP(out) = PUP(from);
+; 273 : PUP(out) = PUP(from);
+
+ 00364 8d 49 03 lea ecx, DWORD PTR [ecx+3]
+ 00367 88 46 01 mov BYTE PTR [esi+1], al
+
+; 274 : len -= 3;
+
+ 0036a 83 eb 03 sub ebx, 3
+ 0036d 0f b6 41 ff movzx eax, BYTE PTR [ecx-1]
+ 00371 88 46 02 mov BYTE PTR [esi+2], al
+ 00374 83 c6 03 add esi, 3
+ 00377 0f b6 01 movzx eax, BYTE PTR [ecx]
+ 0037a 88 06 mov BYTE PTR [esi], al
+
+; 275 : } while (len > 2);
+
+ 0037c 83 fb 02 cmp ebx, 2
+ 0037f 77 df ja SHORT $LL21@inflate_fa
+
+; 276 : if (len) {
+
+ 00381 85 db test ebx, ebx
+ 00383 74 b8 je SHORT $LN2@inflate_fa
+
+; 277 : PUP(out) = PUP(from);
+
+ 00385 8a 41 01 mov al, BYTE PTR [ecx+1]
+ 00388 46 inc esi
+ 00389 88 06 mov BYTE PTR [esi], al
+
+; 278 : if (len > 1)
+
+ 0038b 83 fb 01 cmp ebx, 1
+ 0038e 76 ad jbe SHORT $LN2@inflate_fa
+
+; 279 : PUP(out) = PUP(from);
+
+ 00390 8a 41 02 mov al, BYTE PTR [ecx+2]
+ 00393 46 inc esi
+ 00394 88 06 mov BYTE PTR [esi], al
+ 00396 eb a5 jmp SHORT $LN2@inflate_fa
+$LN52@inflate_fa:
+
+; 300 : break;
+
+ 00398 8b 5d f8 mov ebx, DWORD PTR _in$1$[ebp]
+ 0039b f6 c2 20 test dl, 32 ; 00000020H
+ 0039e 74 0b je SHORT $LN54@inflate_fa
+
+; 295 : goto dolen;
+; 296 : }
+; 297 : else if (op & 32) { /* end-of-block */
+; 298 : Tracevv((stderr, "inflate: end of block\n"));
+; 299 : state->mode = TYPE;
+
+ 003a0 8b 45 f0 mov eax, DWORD PTR _state$1$[ebp]
+ 003a3 c7 00 0b 00 00
+ 00 mov DWORD PTR [eax], 11 ; 0000000bH
+
+; 300 : break;
+
+ 003a9 eb 31 jmp SHORT $LN3@inflate_fa
+$LN54@inflate_fa:
+
+; 301 : }
+; 302 : else {
+; 303 : strm->msg = (char *)"invalid literal/length code";
+
+ 003ab 8b 45 e8 mov eax, DWORD PTR _strm$1$[ebp]
+ 003ae c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BM@FFFLPBBC@invalid?5literal?1length?5code?$AA@
+
+; 304 : state->mode = BAD;
+
+ 003b5 8b 45 f0 mov eax, DWORD PTR _state$1$[ebp]
+ 003b8 eb 1c jmp SHORT $LN102@inflate_fa
+$LN50@inflate_fa:
+
+; 285 : goto dodist;
+; 286 : }
+; 287 : else {
+; 288 : strm->msg = (char *)"invalid distance code";
+
+ 003ba 8b 45 e8 mov eax, DWORD PTR _strm$1$[ebp]
+ 003bd c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BG@LBKINIKP@invalid?5distance?5code?$AA@
+
+; 289 : state->mode = BAD;
+
+ 003c4 8b 45 f0 mov eax, DWORD PTR _state$1$[ebp]
+
+; 290 : break;
+
+ 003c7 eb 0a jmp SHORT $LN103@inflate_fa
+$LN75@inflate_fa:
+
+; 191 : strm->msg =
+
+ 003c9 8b 4d e8 mov ecx, DWORD PTR _strm$1$[ebp]
+ 003cc c7 41 18 00 00
+ 00 00 mov DWORD PTR [ecx+24], OFFSET ??_C@_0BO@ECPMAOGG@invalid?5distance?5too?5far?5back?$AA@
+$LN103@inflate_fa:
+ 003d3 8b 5d f8 mov ebx, DWORD PTR _in$1$[ebp]
+$LN102@inflate_fa:
+
+; 192 : (char *)"invalid distance too far back";
+; 193 : state->mode = BAD;
+
+ 003d6 c7 00 1d 00 00
+ 00 mov DWORD PTR [eax], 29 ; 0000001dH
+$LN3@inflate_fa:
+
+; 308 :
+; 309 : /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
+; 310 : len = bits >> 3;
+; 311 : in -= len;
+; 312 : bits -= len << 3;
+; 313 : hold &= (1U << bits) - 1;
+; 314 :
+; 315 : /* update state and return */
+; 316 : strm->next_in = in + OFF;
+
+ 003dc 8b 55 e8 mov edx, DWORD PTR _strm$1$[ebp]
+ 003df 8b c7 mov eax, edi
+ 003e1 c1 e8 03 shr eax, 3
+ 003e4 2b d8 sub ebx, eax
+ 003e6 c1 e0 03 shl eax, 3
+ 003e9 2b f8 sub edi, eax
+ 003eb b8 01 00 00 00 mov eax, 1
+ 003f0 8b cf mov ecx, edi
+ 003f2 d3 e0 shl eax, cl
+ 003f4 8b 4d fc mov ecx, DWORD PTR _hold$1$[ebp]
+ 003f7 48 dec eax
+ 003f8 23 c8 and ecx, eax
+ 003fa 8d 43 01 lea eax, DWORD PTR [ebx+1]
+ 003fd 89 02 mov DWORD PTR [edx], eax
+
+; 317 : strm->next_out = out + OFF;
+
+ 003ff 8d 46 01 lea eax, DWORD PTR [esi+1]
+ 00402 89 42 0c mov DWORD PTR [edx+12], eax
+
+; 318 : strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last));
+
+ 00405 8b 45 c8 mov eax, DWORD PTR _last$1$[ebp]
+ 00408 2b c3 sub eax, ebx
+ 0040a 8b da mov ebx, edx
+
+; 319 : strm->avail_out = (unsigned)(out < end ?
+
+ 0040c 8b 55 c4 mov edx, DWORD PTR _end$1$[ebp]
+ 0040f 83 c0 05 add eax, 5
+ 00412 2b d6 sub edx, esi
+ 00414 81 c2 01 01 00
+ 00 add edx, 257 ; 00000101H
+ 0041a 89 43 04 mov DWORD PTR [ebx+4], eax
+
+; 320 : 257 + (end - out) : 257 - (out - end));
+; 321 : state->hold = hold;
+
+ 0041d 8b 45 f0 mov eax, DWORD PTR _state$1$[ebp]
+ 00420 89 53 10 mov DWORD PTR [ebx+16], edx
+
+; 322 : state->bits = bits;
+
+ 00423 89 78 3c mov DWORD PTR [eax+60], edi
+ 00426 5f pop edi
+ 00427 5e pop esi
+ 00428 89 48 38 mov DWORD PTR [eax+56], ecx
+ 0042b 5b pop ebx
+
+; 323 : return;
+; 324 : }
+
+ 0042c 8b e5 mov esp, ebp
+ 0042e 5d pop ebp
+ 0042f c3 ret 0
+_inflate_fast ENDP
+_TEXT ENDS
+END
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/inffast.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/inffast.obj
new file mode 100644
index 0000000000..40af0fbacd
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/inffast.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/inflate.cod b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/inflate.cod
new file mode 100644
index 0000000000..b1a91bd225
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/inflate.cod
@@ -0,0 +1,7621 @@
+; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.23506.0
+
+ TITLE d:\downloads\tgl-master\tgl-master\zlib\inflate.c
+ .686P
+ .XMM
+ include listing.inc
+ .model flat
+
+INCLUDELIB OLDNAMES
+
+PUBLIC ??_C@_0BH@LIBMMIGA@incorrect?5header?5check?$AA@ ; `string'
+PUBLIC ??_C@_0BL@IHKGDAEE@unknown?5compression?5method?$AA@ ; `string'
+PUBLIC ??_C@_0BE@EMOGCLGO@invalid?5window?5size?$AA@ ; `string'
+PUBLIC ??_C@_0BJ@BLBBCOMO@unknown?5header?5flags?5set?$AA@ ; `string'
+PUBLIC ??_C@_0BE@GONKLEPM@header?5crc?5mismatch?$AA@ ; `string'
+PUBLIC ??_C@_0BF@MEIGEHBE@incorrect?5data?5check?$AA@ ; `string'
+PUBLIC ??_C@_0BH@FGKKJGOC@incorrect?5length?5check?$AA@ ; `string'
+; COMDAT ??_C@_0BH@FGKKJGOC@incorrect?5length?5check?$AA@
+CONST SEGMENT
+??_C@_0BH@FGKKJGOC@incorrect?5length?5check?$AA@ DB 'incorrect length che'
+ DB 'ck', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_0BF@MEIGEHBE@incorrect?5data?5check?$AA@
+CONST SEGMENT
+??_C@_0BF@MEIGEHBE@incorrect?5data?5check?$AA@ DB 'incorrect data check', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_0BE@GONKLEPM@header?5crc?5mismatch?$AA@
+CONST SEGMENT
+??_C@_0BE@GONKLEPM@header?5crc?5mismatch?$AA@ DB 'header crc mismatch', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_0BJ@BLBBCOMO@unknown?5header?5flags?5set?$AA@
+CONST SEGMENT
+??_C@_0BJ@BLBBCOMO@unknown?5header?5flags?5set?$AA@ DB 'unknown header fl'
+ DB 'ags set', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_0BE@EMOGCLGO@invalid?5window?5size?$AA@
+CONST SEGMENT
+??_C@_0BE@EMOGCLGO@invalid?5window?5size?$AA@ DB 'invalid window size', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_0BL@IHKGDAEE@unknown?5compression?5method?$AA@
+CONST SEGMENT
+??_C@_0BL@IHKGDAEE@unknown?5compression?5method?$AA@ DB 'unknown compress'
+ DB 'ion method', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_0BH@LIBMMIGA@incorrect?5header?5check?$AA@
+CONST SEGMENT
+??_C@_0BH@LIBMMIGA@incorrect?5header?5check?$AA@ DB 'incorrect header che'
+ DB 'ck', 00H ; `string'
+ ORG $+2
+?lenfix@?1??fixedtables@@9@9 DB 060H ; `fixedtables'::`2'::lenfix
+ DB 07H
+ DW 00H
+ DB 00H
+ DB 08H
+ DW 050H
+ DB 00H
+ DB 08H
+ DW 010H
+ DB 014H
+ DB 08H
+ DW 073H
+ DB 012H
+ DB 07H
+ DW 01fH
+ DB 00H
+ DB 08H
+ DW 070H
+ DB 00H
+ DB 08H
+ DW 030H
+ DB 00H
+ DB 09H
+ DW 0c0H
+ DB 010H
+ DB 07H
+ DW 0aH
+ DB 00H
+ DB 08H
+ DW 060H
+ DB 00H
+ DB 08H
+ DW 020H
+ DB 00H
+ DB 09H
+ DW 0a0H
+ DB 00H
+ DB 08H
+ DW 00H
+ DB 00H
+ DB 08H
+ DW 080H
+ DB 00H
+ DB 08H
+ DW 040H
+ DB 00H
+ DB 09H
+ DW 0e0H
+ DB 010H
+ DB 07H
+ DW 06H
+ DB 00H
+ DB 08H
+ DW 058H
+ DB 00H
+ DB 08H
+ DW 018H
+ DB 00H
+ DB 09H
+ DW 090H
+ DB 013H
+ DB 07H
+ DW 03bH
+ DB 00H
+ DB 08H
+ DW 078H
+ DB 00H
+ DB 08H
+ DW 038H
+ DB 00H
+ DB 09H
+ DW 0d0H
+ DB 011H
+ DB 07H
+ DW 011H
+ DB 00H
+ DB 08H
+ DW 068H
+ DB 00H
+ DB 08H
+ DW 028H
+ DB 00H
+ DB 09H
+ DW 0b0H
+ DB 00H
+ DB 08H
+ DW 08H
+ DB 00H
+ DB 08H
+ DW 088H
+ DB 00H
+ DB 08H
+ DW 048H
+ DB 00H
+ DB 09H
+ DW 0f0H
+ DB 010H
+ DB 07H
+ DW 04H
+ DB 00H
+ DB 08H
+ DW 054H
+ DB 00H
+ DB 08H
+ DW 014H
+ DB 015H
+ DB 08H
+ DW 0e3H
+ DB 013H
+ DB 07H
+ DW 02bH
+ DB 00H
+ DB 08H
+ DW 074H
+ DB 00H
+ DB 08H
+ DW 034H
+ DB 00H
+ DB 09H
+ DW 0c8H
+ DB 011H
+ DB 07H
+ DW 0dH
+ DB 00H
+ DB 08H
+ DW 064H
+ DB 00H
+ DB 08H
+ DW 024H
+ DB 00H
+ DB 09H
+ DW 0a8H
+ DB 00H
+ DB 08H
+ DW 04H
+ DB 00H
+ DB 08H
+ DW 084H
+ DB 00H
+ DB 08H
+ DW 044H
+ DB 00H
+ DB 09H
+ DW 0e8H
+ DB 010H
+ DB 07H
+ DW 08H
+ DB 00H
+ DB 08H
+ DW 05cH
+ DB 00H
+ DB 08H
+ DW 01cH
+ DB 00H
+ DB 09H
+ DW 098H
+ DB 014H
+ DB 07H
+ DW 053H
+ DB 00H
+ DB 08H
+ DW 07cH
+ DB 00H
+ DB 08H
+ DW 03cH
+ DB 00H
+ DB 09H
+ DW 0d8H
+ DB 012H
+ DB 07H
+ DW 017H
+ DB 00H
+ DB 08H
+ DW 06cH
+ DB 00H
+ DB 08H
+ DW 02cH
+ DB 00H
+ DB 09H
+ DW 0b8H
+ DB 00H
+ DB 08H
+ DW 0cH
+ DB 00H
+ DB 08H
+ DW 08cH
+ DB 00H
+ DB 08H
+ DW 04cH
+ DB 00H
+ DB 09H
+ DW 0f8H
+ DB 010H
+ DB 07H
+ DW 03H
+ DB 00H
+ DB 08H
+ DW 052H
+ DB 00H
+ DB 08H
+ DW 012H
+ DB 015H
+ DB 08H
+ DW 0a3H
+ DB 013H
+ DB 07H
+ DW 023H
+ DB 00H
+ DB 08H
+ DW 072H
+ DB 00H
+ DB 08H
+ DW 032H
+ DB 00H
+ DB 09H
+ DW 0c4H
+ DB 011H
+ DB 07H
+ DW 0bH
+ DB 00H
+ DB 08H
+ DW 062H
+ DB 00H
+ DB 08H
+ DW 022H
+ DB 00H
+ DB 09H
+ DW 0a4H
+ DB 00H
+ DB 08H
+ DW 02H
+ DB 00H
+ DB 08H
+ DW 082H
+ DB 00H
+ DB 08H
+ DW 042H
+ DB 00H
+ DB 09H
+ DW 0e4H
+ DB 010H
+ DB 07H
+ DW 07H
+ DB 00H
+ DB 08H
+ DW 05aH
+ DB 00H
+ DB 08H
+ DW 01aH
+ DB 00H
+ DB 09H
+ DW 094H
+ DB 014H
+ DB 07H
+ DW 043H
+ DB 00H
+ DB 08H
+ DW 07aH
+ DB 00H
+ DB 08H
+ DW 03aH
+ DB 00H
+ DB 09H
+ DW 0d4H
+ DB 012H
+ DB 07H
+ DW 013H
+ DB 00H
+ DB 08H
+ DW 06aH
+ DB 00H
+ DB 08H
+ DW 02aH
+ DB 00H
+ DB 09H
+ DW 0b4H
+ DB 00H
+ DB 08H
+ DW 0aH
+ DB 00H
+ DB 08H
+ DW 08aH
+ DB 00H
+ DB 08H
+ DW 04aH
+ DB 00H
+ DB 09H
+ DW 0f4H
+ DB 010H
+ DB 07H
+ DW 05H
+ DB 00H
+ DB 08H
+ DW 056H
+ DB 00H
+ DB 08H
+ DW 016H
+ DB 040H
+ DB 08H
+ DW 00H
+ DB 013H
+ DB 07H
+ DW 033H
+ DB 00H
+ DB 08H
+ DW 076H
+ DB 00H
+ DB 08H
+ DW 036H
+ DB 00H
+ DB 09H
+ DW 0ccH
+ DB 011H
+ DB 07H
+ DW 0fH
+ DB 00H
+ DB 08H
+ DW 066H
+ DB 00H
+ DB 08H
+ DW 026H
+ DB 00H
+ DB 09H
+ DW 0acH
+ DB 00H
+ DB 08H
+ DW 06H
+ DB 00H
+ DB 08H
+ DW 086H
+ DB 00H
+ DB 08H
+ DW 046H
+ DB 00H
+ DB 09H
+ DW 0ecH
+ DB 010H
+ DB 07H
+ DW 09H
+ DB 00H
+ DB 08H
+ DW 05eH
+ DB 00H
+ DB 08H
+ DW 01eH
+ DB 00H
+ DB 09H
+ DW 09cH
+ DB 014H
+ DB 07H
+ DW 063H
+ DB 00H
+ DB 08H
+ DW 07eH
+ DB 00H
+ DB 08H
+ DW 03eH
+ DB 00H
+ DB 09H
+ DW 0dcH
+ DB 012H
+ DB 07H
+ DW 01bH
+ DB 00H
+ DB 08H
+ DW 06eH
+ DB 00H
+ DB 08H
+ DW 02eH
+ DB 00H
+ DB 09H
+ DW 0bcH
+ DB 00H
+ DB 08H
+ DW 0eH
+ DB 00H
+ DB 08H
+ DW 08eH
+ DB 00H
+ DB 08H
+ DW 04eH
+ DB 00H
+ DB 09H
+ DW 0fcH
+ DB 060H
+ DB 07H
+ DW 00H
+ DB 00H
+ DB 08H
+ DW 051H
+ DB 00H
+ DB 08H
+ DW 011H
+ DB 015H
+ DB 08H
+ DW 083H
+ DB 012H
+ DB 07H
+ DW 01fH
+ DB 00H
+ DB 08H
+ DW 071H
+ DB 00H
+ DB 08H
+ DW 031H
+ DB 00H
+ DB 09H
+ DW 0c2H
+ DB 010H
+ DB 07H
+ DW 0aH
+ DB 00H
+ DB 08H
+ DW 061H
+ DB 00H
+ DB 08H
+ DW 021H
+ DB 00H
+ DB 09H
+ DW 0a2H
+ DB 00H
+ DB 08H
+ DW 01H
+ DB 00H
+ DB 08H
+ DW 081H
+ DB 00H
+ DB 08H
+ DW 041H
+ DB 00H
+ DB 09H
+ DW 0e2H
+ DB 010H
+ DB 07H
+ DW 06H
+ DB 00H
+ DB 08H
+ DW 059H
+ DB 00H
+ DB 08H
+ DW 019H
+ DB 00H
+ DB 09H
+ DW 092H
+ DB 013H
+ DB 07H
+ DW 03bH
+ DB 00H
+ DB 08H
+ DW 079H
+ DB 00H
+ DB 08H
+ DW 039H
+ DB 00H
+ DB 09H
+ DW 0d2H
+ DB 011H
+ DB 07H
+ DW 011H
+ DB 00H
+ DB 08H
+ DW 069H
+ DB 00H
+ DB 08H
+ DW 029H
+ DB 00H
+ DB 09H
+ DW 0b2H
+ DB 00H
+ DB 08H
+ DW 09H
+ DB 00H
+ DB 08H
+ DW 089H
+ DB 00H
+ DB 08H
+ DW 049H
+ DB 00H
+ DB 09H
+ DW 0f2H
+ DB 010H
+ DB 07H
+ DW 04H
+ DB 00H
+ DB 08H
+ DW 055H
+ DB 00H
+ DB 08H
+ DW 015H
+ DB 010H
+ DB 08H
+ DW 0102H
+ DB 013H
+ DB 07H
+ DW 02bH
+ DB 00H
+ DB 08H
+ DW 075H
+ DB 00H
+ DB 08H
+ DW 035H
+ DB 00H
+ DB 09H
+ DW 0caH
+ DB 011H
+ DB 07H
+ DW 0dH
+ DB 00H
+ DB 08H
+ DW 065H
+ DB 00H
+ DB 08H
+ DW 025H
+ DB 00H
+ DB 09H
+ DW 0aaH
+ DB 00H
+ DB 08H
+ DW 05H
+ DB 00H
+ DB 08H
+ DW 085H
+ DB 00H
+ DB 08H
+ DW 045H
+ DB 00H
+ DB 09H
+ DW 0eaH
+ DB 010H
+ DB 07H
+ DW 08H
+ DB 00H
+ DB 08H
+ DW 05dH
+ DB 00H
+ DB 08H
+ DW 01dH
+ DB 00H
+ DB 09H
+ DW 09aH
+ DB 014H
+ DB 07H
+ DW 053H
+ DB 00H
+ DB 08H
+ DW 07dH
+ DB 00H
+ DB 08H
+ DW 03dH
+ DB 00H
+ DB 09H
+ DW 0daH
+ DB 012H
+ DB 07H
+ DW 017H
+ DB 00H
+ DB 08H
+ DW 06dH
+ DB 00H
+ DB 08H
+ DW 02dH
+ DB 00H
+ DB 09H
+ DW 0baH
+ DB 00H
+ DB 08H
+ DW 0dH
+ DB 00H
+ DB 08H
+ DW 08dH
+ DB 00H
+ DB 08H
+ DW 04dH
+ DB 00H
+ DB 09H
+ DW 0faH
+ DB 010H
+ DB 07H
+ DW 03H
+ DB 00H
+ DB 08H
+ DW 053H
+ DB 00H
+ DB 08H
+ DW 013H
+ DB 015H
+ DB 08H
+ DW 0c3H
+ DB 013H
+ DB 07H
+ DW 023H
+ DB 00H
+ DB 08H
+ DW 073H
+ DB 00H
+ DB 08H
+ DW 033H
+ DB 00H
+ DB 09H
+ DW 0c6H
+ DB 011H
+ DB 07H
+ DW 0bH
+ DB 00H
+ DB 08H
+ DW 063H
+ DB 00H
+ DB 08H
+ DW 023H
+ DB 00H
+ DB 09H
+ DW 0a6H
+ DB 00H
+ DB 08H
+ DW 03H
+ DB 00H
+ DB 08H
+ DW 083H
+ DB 00H
+ DB 08H
+ DW 043H
+ DB 00H
+ DB 09H
+ DW 0e6H
+ DB 010H
+ DB 07H
+ DW 07H
+ DB 00H
+ DB 08H
+ DW 05bH
+ DB 00H
+ DB 08H
+ DW 01bH
+ DB 00H
+ DB 09H
+ DW 096H
+ DB 014H
+ DB 07H
+ DW 043H
+ DB 00H
+ DB 08H
+ DW 07bH
+ DB 00H
+ DB 08H
+ DW 03bH
+ DB 00H
+ DB 09H
+ DW 0d6H
+ DB 012H
+ DB 07H
+ DW 013H
+ DB 00H
+ DB 08H
+ DW 06bH
+ DB 00H
+ DB 08H
+ DW 02bH
+ DB 00H
+ DB 09H
+ DW 0b6H
+ DB 00H
+ DB 08H
+ DW 0bH
+ DB 00H
+ DB 08H
+ DW 08bH
+ DB 00H
+ DB 08H
+ DW 04bH
+ DB 00H
+ DB 09H
+ DW 0f6H
+ DB 010H
+ DB 07H
+ DW 05H
+ DB 00H
+ DB 08H
+ DW 057H
+ DB 00H
+ DB 08H
+ DW 017H
+ DB 040H
+ DB 08H
+ DW 00H
+ DB 013H
+ DB 07H
+ DW 033H
+ DB 00H
+ DB 08H
+ DW 077H
+ DB 00H
+ DB 08H
+ DW 037H
+ DB 00H
+ DB 09H
+ DW 0ceH
+ DB 011H
+ DB 07H
+ DW 0fH
+ DB 00H
+ DB 08H
+ DW 067H
+ DB 00H
+ DB 08H
+ DW 027H
+ DB 00H
+ DB 09H
+ DW 0aeH
+ DB 00H
+ DB 08H
+ DW 07H
+ DB 00H
+ DB 08H
+ DW 087H
+ DB 00H
+ DB 08H
+ DW 047H
+ DB 00H
+ DB 09H
+ DW 0eeH
+ DB 010H
+ DB 07H
+ DW 09H
+ DB 00H
+ DB 08H
+ DW 05fH
+ DB 00H
+ DB 08H
+ DW 01fH
+ DB 00H
+ DB 09H
+ DW 09eH
+ DB 014H
+ DB 07H
+ DW 063H
+ DB 00H
+ DB 08H
+ DW 07fH
+ DB 00H
+ DB 08H
+ DW 03fH
+ DB 00H
+ DB 09H
+ DW 0deH
+ DB 012H
+ DB 07H
+ DW 01bH
+ DB 00H
+ DB 08H
+ DW 06fH
+ DB 00H
+ DB 08H
+ DW 02fH
+ DB 00H
+ DB 09H
+ DW 0beH
+ DB 00H
+ DB 08H
+ DW 0fH
+ DB 00H
+ DB 08H
+ DW 08fH
+ DB 00H
+ DB 08H
+ DW 04fH
+ DB 00H
+ DB 09H
+ DW 0feH
+ DB 060H
+ DB 07H
+ DW 00H
+ DB 00H
+ DB 08H
+ DW 050H
+ DB 00H
+ DB 08H
+ DW 010H
+ DB 014H
+ DB 08H
+ DW 073H
+ DB 012H
+ DB 07H
+ DW 01fH
+ DB 00H
+ DB 08H
+ DW 070H
+ DB 00H
+ DB 08H
+ DW 030H
+ DB 00H
+ DB 09H
+ DW 0c1H
+ DB 010H
+ DB 07H
+ DW 0aH
+ DB 00H
+ DB 08H
+ DW 060H
+ DB 00H
+ DB 08H
+ DW 020H
+ DB 00H
+ DB 09H
+ DW 0a1H
+ DB 00H
+ DB 08H
+ DW 00H
+ DB 00H
+ DB 08H
+ DW 080H
+ DB 00H
+ DB 08H
+ DW 040H
+ DB 00H
+ DB 09H
+ DW 0e1H
+ DB 010H
+ DB 07H
+ DW 06H
+ DB 00H
+ DB 08H
+ DW 058H
+ DB 00H
+ DB 08H
+ DW 018H
+ DB 00H
+ DB 09H
+ DW 091H
+ DB 013H
+ DB 07H
+ DW 03bH
+ DB 00H
+ DB 08H
+ DW 078H
+ DB 00H
+ DB 08H
+ DW 038H
+ DB 00H
+ DB 09H
+ DW 0d1H
+ DB 011H
+ DB 07H
+ DW 011H
+ DB 00H
+ DB 08H
+ DW 068H
+ DB 00H
+ DB 08H
+ DW 028H
+ DB 00H
+ DB 09H
+ DW 0b1H
+ DB 00H
+ DB 08H
+ DW 08H
+ DB 00H
+ DB 08H
+ DW 088H
+ DB 00H
+ DB 08H
+ DW 048H
+ DB 00H
+ DB 09H
+ DW 0f1H
+ DB 010H
+ DB 07H
+ DW 04H
+ DB 00H
+ DB 08H
+ DW 054H
+ DB 00H
+ DB 08H
+ DW 014H
+ DB 015H
+ DB 08H
+ DW 0e3H
+ DB 013H
+ DB 07H
+ DW 02bH
+ DB 00H
+ DB 08H
+ DW 074H
+ DB 00H
+ DB 08H
+ DW 034H
+ DB 00H
+ DB 09H
+ DW 0c9H
+ DB 011H
+ DB 07H
+ DW 0dH
+ DB 00H
+ DB 08H
+ DW 064H
+ DB 00H
+ DB 08H
+ DW 024H
+ DB 00H
+ DB 09H
+ DW 0a9H
+ DB 00H
+ DB 08H
+ DW 04H
+ DB 00H
+ DB 08H
+ DW 084H
+ DB 00H
+ DB 08H
+ DW 044H
+ DB 00H
+ DB 09H
+ DW 0e9H
+ DB 010H
+ DB 07H
+ DW 08H
+ DB 00H
+ DB 08H
+ DW 05cH
+ DB 00H
+ DB 08H
+ DW 01cH
+ DB 00H
+ DB 09H
+ DW 099H
+ DB 014H
+ DB 07H
+ DW 053H
+ DB 00H
+ DB 08H
+ DW 07cH
+ DB 00H
+ DB 08H
+ DW 03cH
+ DB 00H
+ DB 09H
+ DW 0d9H
+ DB 012H
+ DB 07H
+ DW 017H
+ DB 00H
+ DB 08H
+ DW 06cH
+ DB 00H
+ DB 08H
+ DW 02cH
+ DB 00H
+ DB 09H
+ DW 0b9H
+ DB 00H
+ DB 08H
+ DW 0cH
+ DB 00H
+ DB 08H
+ DW 08cH
+ DB 00H
+ DB 08H
+ DW 04cH
+ DB 00H
+ DB 09H
+ DW 0f9H
+ DB 010H
+ DB 07H
+ DW 03H
+ DB 00H
+ DB 08H
+ DW 052H
+ DB 00H
+ DB 08H
+ DW 012H
+ DB 015H
+ DB 08H
+ DW 0a3H
+ DB 013H
+ DB 07H
+ DW 023H
+ DB 00H
+ DB 08H
+ DW 072H
+ DB 00H
+ DB 08H
+ DW 032H
+ DB 00H
+ DB 09H
+ DW 0c5H
+ DB 011H
+ DB 07H
+ DW 0bH
+ DB 00H
+ DB 08H
+ DW 062H
+ DB 00H
+ DB 08H
+ DW 022H
+ DB 00H
+ DB 09H
+ DW 0a5H
+ DB 00H
+ DB 08H
+ DW 02H
+ DB 00H
+ DB 08H
+ DW 082H
+ DB 00H
+ DB 08H
+ DW 042H
+ DB 00H
+ DB 09H
+ DW 0e5H
+ DB 010H
+ DB 07H
+ DW 07H
+ DB 00H
+ DB 08H
+ DW 05aH
+ DB 00H
+ DB 08H
+ DW 01aH
+ DB 00H
+ DB 09H
+ DW 095H
+ DB 014H
+ DB 07H
+ DW 043H
+ DB 00H
+ DB 08H
+ DW 07aH
+ DB 00H
+ DB 08H
+ DW 03aH
+ DB 00H
+ DB 09H
+ DW 0d5H
+ DB 012H
+ DB 07H
+ DW 013H
+ DB 00H
+ DB 08H
+ DW 06aH
+ DB 00H
+ DB 08H
+ DW 02aH
+ DB 00H
+ DB 09H
+ DW 0b5H
+ DB 00H
+ DB 08H
+ DW 0aH
+ DB 00H
+ DB 08H
+ DW 08aH
+ DB 00H
+ DB 08H
+ DW 04aH
+ DB 00H
+ DB 09H
+ DW 0f5H
+ DB 010H
+ DB 07H
+ DW 05H
+ DB 00H
+ DB 08H
+ DW 056H
+ DB 00H
+ DB 08H
+ DW 016H
+ DB 040H
+ DB 08H
+ DW 00H
+ DB 013H
+ DB 07H
+ DW 033H
+ DB 00H
+ DB 08H
+ DW 076H
+ DB 00H
+ DB 08H
+ DW 036H
+ DB 00H
+ DB 09H
+ DW 0cdH
+ DB 011H
+ DB 07H
+ DW 0fH
+ DB 00H
+ DB 08H
+ DW 066H
+ DB 00H
+ DB 08H
+ DW 026H
+ DB 00H
+ DB 09H
+ DW 0adH
+ DB 00H
+ DB 08H
+ DW 06H
+ DB 00H
+ DB 08H
+ DW 086H
+ DB 00H
+ DB 08H
+ DW 046H
+ DB 00H
+ DB 09H
+ DW 0edH
+ DB 010H
+ DB 07H
+ DW 09H
+ DB 00H
+ DB 08H
+ DW 05eH
+ DB 00H
+ DB 08H
+ DW 01eH
+ DB 00H
+ DB 09H
+ DW 09dH
+ DB 014H
+ DB 07H
+ DW 063H
+ DB 00H
+ DB 08H
+ DW 07eH
+ DB 00H
+ DB 08H
+ DW 03eH
+ DB 00H
+ DB 09H
+ DW 0ddH
+ DB 012H
+ DB 07H
+ DW 01bH
+ DB 00H
+ DB 08H
+ DW 06eH
+ DB 00H
+ DB 08H
+ DW 02eH
+ DB 00H
+ DB 09H
+ DW 0bdH
+ DB 00H
+ DB 08H
+ DW 0eH
+ DB 00H
+ DB 08H
+ DW 08eH
+ DB 00H
+ DB 08H
+ DW 04eH
+ DB 00H
+ DB 09H
+ DW 0fdH
+ DB 060H
+ DB 07H
+ DW 00H
+ DB 00H
+ DB 08H
+ DW 051H
+ DB 00H
+ DB 08H
+ DW 011H
+ DB 015H
+ DB 08H
+ DW 083H
+ DB 012H
+ DB 07H
+ DW 01fH
+ DB 00H
+ DB 08H
+ DW 071H
+ DB 00H
+ DB 08H
+ DW 031H
+ DB 00H
+ DB 09H
+ DW 0c3H
+ DB 010H
+ DB 07H
+ DW 0aH
+ DB 00H
+ DB 08H
+ DW 061H
+ DB 00H
+ DB 08H
+ DW 021H
+ DB 00H
+ DB 09H
+ DW 0a3H
+ DB 00H
+ DB 08H
+ DW 01H
+ DB 00H
+ DB 08H
+ DW 081H
+ DB 00H
+ DB 08H
+ DW 041H
+ DB 00H
+ DB 09H
+ DW 0e3H
+ DB 010H
+ DB 07H
+ DW 06H
+ DB 00H
+ DB 08H
+ DW 059H
+ DB 00H
+ DB 08H
+ DW 019H
+ DB 00H
+ DB 09H
+ DW 093H
+ DB 013H
+ DB 07H
+ DW 03bH
+ DB 00H
+ DB 08H
+ DW 079H
+ DB 00H
+ DB 08H
+ DW 039H
+ DB 00H
+ DB 09H
+ DW 0d3H
+ DB 011H
+ DB 07H
+ DW 011H
+ DB 00H
+ DB 08H
+ DW 069H
+ DB 00H
+ DB 08H
+ DW 029H
+ DB 00H
+ DB 09H
+ DW 0b3H
+ DB 00H
+ DB 08H
+ DW 09H
+ DB 00H
+ DB 08H
+ DW 089H
+ DB 00H
+ DB 08H
+ DW 049H
+ DB 00H
+ DB 09H
+ DW 0f3H
+ DB 010H
+ DB 07H
+ DW 04H
+ DB 00H
+ DB 08H
+ DW 055H
+ DB 00H
+ DB 08H
+ DW 015H
+ DB 010H
+ DB 08H
+ DW 0102H
+ DB 013H
+ DB 07H
+ DW 02bH
+ DB 00H
+ DB 08H
+ DW 075H
+ DB 00H
+ DB 08H
+ DW 035H
+ DB 00H
+ DB 09H
+ DW 0cbH
+ DB 011H
+ DB 07H
+ DW 0dH
+ DB 00H
+ DB 08H
+ DW 065H
+ DB 00H
+ DB 08H
+ DW 025H
+ DB 00H
+ DB 09H
+ DW 0abH
+ DB 00H
+ DB 08H
+ DW 05H
+ DB 00H
+ DB 08H
+ DW 085H
+ DB 00H
+ DB 08H
+ DW 045H
+ DB 00H
+ DB 09H
+ DW 0ebH
+ DB 010H
+ DB 07H
+ DW 08H
+ DB 00H
+ DB 08H
+ DW 05dH
+ DB 00H
+ DB 08H
+ DW 01dH
+ DB 00H
+ DB 09H
+ DW 09bH
+ DB 014H
+ DB 07H
+ DW 053H
+ DB 00H
+ DB 08H
+ DW 07dH
+ DB 00H
+ DB 08H
+ DW 03dH
+ DB 00H
+ DB 09H
+ DW 0dbH
+ DB 012H
+ DB 07H
+ DW 017H
+ DB 00H
+ DB 08H
+ DW 06dH
+ DB 00H
+ DB 08H
+ DW 02dH
+ DB 00H
+ DB 09H
+ DW 0bbH
+ DB 00H
+ DB 08H
+ DW 0dH
+ DB 00H
+ DB 08H
+ DW 08dH
+ DB 00H
+ DB 08H
+ DW 04dH
+ DB 00H
+ DB 09H
+ DW 0fbH
+ DB 010H
+ DB 07H
+ DW 03H
+ DB 00H
+ DB 08H
+ DW 053H
+ DB 00H
+ DB 08H
+ DW 013H
+ DB 015H
+ DB 08H
+ DW 0c3H
+ DB 013H
+ DB 07H
+ DW 023H
+ DB 00H
+ DB 08H
+ DW 073H
+ DB 00H
+ DB 08H
+ DW 033H
+ DB 00H
+ DB 09H
+ DW 0c7H
+ DB 011H
+ DB 07H
+ DW 0bH
+ DB 00H
+ DB 08H
+ DW 063H
+ DB 00H
+ DB 08H
+ DW 023H
+ DB 00H
+ DB 09H
+ DW 0a7H
+ DB 00H
+ DB 08H
+ DW 03H
+ DB 00H
+ DB 08H
+ DW 083H
+ DB 00H
+ DB 08H
+ DW 043H
+ DB 00H
+ DB 09H
+ DW 0e7H
+ DB 010H
+ DB 07H
+ DW 07H
+ DB 00H
+ DB 08H
+ DW 05bH
+ DB 00H
+ DB 08H
+ DW 01bH
+ DB 00H
+ DB 09H
+ DW 097H
+ DB 014H
+ DB 07H
+ DW 043H
+ DB 00H
+ DB 08H
+ DW 07bH
+ DB 00H
+ DB 08H
+ DW 03bH
+ DB 00H
+ DB 09H
+ DW 0d7H
+ DB 012H
+ DB 07H
+ DW 013H
+ DB 00H
+ DB 08H
+ DW 06bH
+ DB 00H
+ DB 08H
+ DW 02bH
+ DB 00H
+ DB 09H
+ DW 0b7H
+ DB 00H
+ DB 08H
+ DW 0bH
+ DB 00H
+ DB 08H
+ DW 08bH
+ DB 00H
+ DB 08H
+ DW 04bH
+ DB 00H
+ DB 09H
+ DW 0f7H
+ DB 010H
+ DB 07H
+ DW 05H
+ DB 00H
+ DB 08H
+ DW 057H
+ DB 00H
+ DB 08H
+ DW 017H
+ DB 040H
+ DB 08H
+ DW 00H
+ DB 013H
+ DB 07H
+ DW 033H
+ DB 00H
+ DB 08H
+ DW 077H
+ DB 00H
+ DB 08H
+ DW 037H
+ DB 00H
+ DB 09H
+ DW 0cfH
+ DB 011H
+ DB 07H
+ DW 0fH
+ DB 00H
+ DB 08H
+ DW 067H
+ DB 00H
+ DB 08H
+ DW 027H
+ DB 00H
+ DB 09H
+ DW 0afH
+ DB 00H
+ DB 08H
+ DW 07H
+ DB 00H
+ DB 08H
+ DW 087H
+ DB 00H
+ DB 08H
+ DW 047H
+ DB 00H
+ DB 09H
+ DW 0efH
+ DB 010H
+ DB 07H
+ DW 09H
+ DB 00H
+ DB 08H
+ DW 05fH
+ DB 00H
+ DB 08H
+ DW 01fH
+ DB 00H
+ DB 09H
+ DW 09fH
+ DB 014H
+ DB 07H
+ DW 063H
+ DB 00H
+ DB 08H
+ DW 07fH
+ DB 00H
+ DB 08H
+ DW 03fH
+ DB 00H
+ DB 09H
+ DW 0dfH
+ DB 012H
+ DB 07H
+ DW 01bH
+ DB 00H
+ DB 08H
+ DW 06fH
+ DB 00H
+ DB 08H
+ DW 02fH
+ DB 00H
+ DB 09H
+ DW 0bfH
+ DB 00H
+ DB 08H
+ DW 0fH
+ DB 00H
+ DB 08H
+ DW 08fH
+ DB 00H
+ DB 08H
+ DW 04fH
+ DB 00H
+ DB 09H
+ DW 0ffH
+?distfix@?1??fixedtables@@9@9 DB 010H ; `fixedtables'::`2'::distfix
+ DB 05H
+ DW 01H
+ DB 017H
+ DB 05H
+ DW 0101H
+ DB 013H
+ DB 05H
+ DW 011H
+ DB 01bH
+ DB 05H
+ DW 01001H
+ DB 011H
+ DB 05H
+ DW 05H
+ DB 019H
+ DB 05H
+ DW 0401H
+ DB 015H
+ DB 05H
+ DW 041H
+ DB 01dH
+ DB 05H
+ DW 04001H
+ DB 010H
+ DB 05H
+ DW 03H
+ DB 018H
+ DB 05H
+ DW 0201H
+ DB 014H
+ DB 05H
+ DW 021H
+ DB 01cH
+ DB 05H
+ DW 02001H
+ DB 012H
+ DB 05H
+ DW 09H
+ DB 01aH
+ DB 05H
+ DW 0801H
+ DB 016H
+ DB 05H
+ DW 081H
+ DB 040H
+ DB 05H
+ DW 00H
+ DB 010H
+ DB 05H
+ DW 02H
+ DB 017H
+ DB 05H
+ DW 0181H
+ DB 013H
+ DB 05H
+ DW 019H
+ DB 01bH
+ DB 05H
+ DW 01801H
+ DB 011H
+ DB 05H
+ DW 07H
+ DB 019H
+ DB 05H
+ DW 0601H
+ DB 015H
+ DB 05H
+ DW 061H
+ DB 01dH
+ DB 05H
+ DW 06001H
+ DB 010H
+ DB 05H
+ DW 04H
+ DB 018H
+ DB 05H
+ DW 0301H
+ DB 014H
+ DB 05H
+ DW 031H
+ DB 01cH
+ DB 05H
+ DW 03001H
+ DB 012H
+ DB 05H
+ DW 0dH
+ DB 01aH
+ DB 05H
+ DW 0c01H
+ DB 016H
+ DB 05H
+ DW 0c1H
+ DB 040H
+ DB 05H
+ DW 00H
+?order@?1??inflate@@9@9 DW 010H ; `inflate'::`2'::order
+ DW 011H
+ DW 012H
+ DW 00H
+ DW 08H
+ DW 07H
+ DW 09H
+ DW 06H
+ DW 0aH
+ DW 05H
+ DW 0bH
+ DW 04H
+ DW 0cH
+ DW 03H
+ DW 0dH
+ DW 02H
+ DW 0eH
+ DW 01H
+ DW 0fH
+PUBLIC _inflateMark@4
+PUBLIC _inflateUndermine@8
+PUBLIC _inflateCopy@8
+PUBLIC _inflateSyncPoint@4
+PUBLIC _inflateSync@4
+PUBLIC _inflateGetHeader@8
+PUBLIC _inflateSetDictionary@12
+PUBLIC _inflateGetDictionary@12
+PUBLIC _inflatePrime@12
+PUBLIC _inflateInit_@12
+PUBLIC _inflateReset2@8
+PUBLIC _inflateResetKeep@4
+PUBLIC _inflateEnd@4
+PUBLIC _inflate@8
+PUBLIC _inflateInit2_@16
+PUBLIC _inflateReset@4
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\inflate.c
+; COMDAT _inflateReset@4
+_TEXT SEGMENT
+_strm$ = 8 ; size = 4
+_inflateReset@4 PROC ; COMDAT
+
+; 131 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 132 : struct inflate_state FAR *state;
+; 133 :
+; 134 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 00003 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 00006 85 c0 test eax, eax
+ 00008 74 25 je SHORT $LN3@inflateRes
+ 0000a 8b 48 1c mov ecx, DWORD PTR [eax+28]
+ 0000d 85 c9 test ecx, ecx
+ 0000f 74 1e je SHORT $LN3@inflateRes
+
+; 135 : state = (struct inflate_state FAR *)strm->state;
+; 136 : state->wsize = 0;
+
+ 00011 c7 41 28 00 00
+ 00 00 mov DWORD PTR [ecx+40], 0
+
+; 137 : state->whave = 0;
+
+ 00018 c7 41 2c 00 00
+ 00 00 mov DWORD PTR [ecx+44], 0
+
+; 138 : state->wnext = 0;
+
+ 0001f c7 41 30 00 00
+ 00 00 mov DWORD PTR [ecx+48], 0
+
+; 139 : return inflateResetKeep(strm);
+
+ 00026 89 45 08 mov DWORD PTR _strm$[ebp], eax
+
+; 140 : }
+
+ 00029 5d pop ebp
+
+; 139 : return inflateResetKeep(strm);
+
+ 0002a e9 00 00 00 00 jmp _inflateResetKeep@4
+$LN3@inflateRes:
+
+; 132 : struct inflate_state FAR *state;
+; 133 :
+; 134 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 0002f b8 fe ff ff ff mov eax, -2 ; fffffffeH
+
+; 140 : }
+
+ 00034 5d pop ebp
+ 00035 c2 04 00 ret 4
+_inflateReset@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\inflate.c
+; COMDAT _inflateInit2_@16
+_TEXT SEGMENT
+_strm$ = 8 ; size = 4
+_windowBits$ = 12 ; size = 4
+_version$ = 16 ; size = 4
+_stream_size$ = 20 ; size = 4
+_inflateInit2_@16 PROC ; COMDAT
+
+; 185 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 186 : int ret;
+; 187 : struct inflate_state FAR *state;
+; 188 :
+; 189 : if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
+
+ 00003 8b 45 10 mov eax, DWORD PTR _version$[ebp]
+ 00006 85 c0 test eax, eax
+ 00008 0f 84 a3 00 00
+ 00 je $LN3@inflateIni
+ 0000e 80 38 31 cmp BYTE PTR [eax], 49 ; 00000031H
+ 00011 0f 85 9a 00 00
+ 00 jne $LN3@inflateIni
+ 00017 83 7d 14 38 cmp DWORD PTR _stream_size$[ebp], 56 ; 00000038H
+ 0001b 0f 85 90 00 00
+ 00 jne $LN3@inflateIni
+
+; 192 : if (strm == Z_NULL) return Z_STREAM_ERROR;
+
+ 00021 56 push esi
+ 00022 8b 75 08 mov esi, DWORD PTR _strm$[ebp]
+ 00025 85 f6 test esi, esi
+ 00027 75 08 jne SHORT $LN4@inflateIni
+ 00029 8d 46 fe lea eax, DWORD PTR [esi-2]
+ 0002c 5e pop esi
+
+; 220 : }
+
+ 0002d 5d pop ebp
+ 0002e c2 10 00 ret 16 ; 00000010H
+$LN4@inflateIni:
+
+; 193 : strm->msg = Z_NULL; /* in case we return an error */
+; 194 : if (strm->zalloc == (alloc_func)0) {
+
+ 00031 83 7e 20 00 cmp DWORD PTR [esi+32], 0
+ 00035 c7 46 18 00 00
+ 00 00 mov DWORD PTR [esi+24], 0
+ 0003c 75 0e jne SHORT $LN5@inflateIni
+
+; 195 : #ifdef Z_SOLO
+; 196 : return Z_STREAM_ERROR;
+; 197 : #else
+; 198 : strm->zalloc = zcalloc;
+
+ 0003e c7 46 20 00 00
+ 00 00 mov DWORD PTR [esi+32], OFFSET _zcalloc
+
+; 199 : strm->opaque = (voidpf)0;
+
+ 00045 c7 46 28 00 00
+ 00 00 mov DWORD PTR [esi+40], 0
+$LN5@inflateIni:
+
+; 200 : #endif
+; 201 : }
+; 202 : if (strm->zfree == (free_func)0)
+
+ 0004c 83 7e 24 00 cmp DWORD PTR [esi+36], 0
+ 00050 75 07 jne SHORT $LN6@inflateIni
+
+; 203 : #ifdef Z_SOLO
+; 204 : return Z_STREAM_ERROR;
+; 205 : #else
+; 206 : strm->zfree = zcfree;
+
+ 00052 c7 46 24 00 00
+ 00 00 mov DWORD PTR [esi+36], OFFSET _zcfree
+$LN6@inflateIni:
+
+; 207 : #endif
+; 208 : state = (struct inflate_state FAR *)
+
+ 00059 8b 46 20 mov eax, DWORD PTR [esi+32]
+ 0005c 57 push edi
+ 0005d 68 cc 1b 00 00 push 7116 ; 00001bccH
+ 00062 6a 01 push 1
+ 00064 ff 76 28 push DWORD PTR [esi+40]
+ 00067 ff d0 call eax
+ 00069 8b f8 mov edi, eax
+ 0006b 83 c4 0c add esp, 12 ; 0000000cH
+
+; 209 : ZALLOC(strm, 1, sizeof(struct inflate_state));
+; 210 : if (state == Z_NULL) return Z_MEM_ERROR;
+
+ 0006e 85 ff test edi, edi
+ 00070 75 09 jne SHORT $LN7@inflateIni
+ 00072 8d 47 fc lea eax, DWORD PTR [edi-4]
+ 00075 5f pop edi
+ 00076 5e pop esi
+
+; 220 : }
+
+ 00077 5d pop ebp
+ 00078 c2 10 00 ret 16 ; 00000010H
+$LN7@inflateIni:
+ 0007b 53 push ebx
+
+; 211 : Tracev((stderr, "inflate: allocated\n"));
+; 212 : strm->state = (struct internal_state FAR *)state;
+; 213 : state->window = Z_NULL;
+; 214 : ret = inflateReset2(strm, windowBits);
+
+ 0007c ff 75 0c push DWORD PTR _windowBits$[ebp]
+ 0007f 89 7e 1c mov DWORD PTR [esi+28], edi
+ 00082 56 push esi
+ 00083 c7 47 34 00 00
+ 00 00 mov DWORD PTR [edi+52], 0
+ 0008a e8 00 00 00 00 call _inflateReset2@8
+ 0008f 8b d8 mov ebx, eax
+
+; 215 : if (ret != Z_OK) {
+
+ 00091 85 db test ebx, ebx
+ 00093 74 13 je SHORT $LN8@inflateIni
+
+; 216 : ZFREE(strm, state);
+
+ 00095 8b 4e 24 mov ecx, DWORD PTR [esi+36]
+ 00098 57 push edi
+ 00099 ff 76 28 push DWORD PTR [esi+40]
+ 0009c ff d1 call ecx
+ 0009e 83 c4 08 add esp, 8
+
+; 217 : strm->state = Z_NULL;
+
+ 000a1 c7 46 1c 00 00
+ 00 00 mov DWORD PTR [esi+28], 0
+$LN8@inflateIni:
+
+; 218 : }
+; 219 : return ret;
+
+ 000a8 8b c3 mov eax, ebx
+ 000aa 5b pop ebx
+ 000ab 5f pop edi
+ 000ac 5e pop esi
+
+; 220 : }
+
+ 000ad 5d pop ebp
+ 000ae c2 10 00 ret 16 ; 00000010H
+$LN3@inflateIni:
+
+; 190 : stream_size != (int)(sizeof(z_stream)))
+; 191 : return Z_VERSION_ERROR;
+
+ 000b1 b8 fa ff ff ff mov eax, -6 ; fffffffaH
+
+; 220 : }
+
+ 000b6 5d pop ebp
+ 000b7 c2 10 00 ret 16 ; 00000010H
+_inflateInit2_@16 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\inflate.c
+; COMDAT _inflate@8
+_TEXT SEGMENT
+tv2776 = -64 ; size = 4
+_in$1$ = -60 ; size = 4
+$T1 = -56 ; size = 4
+_copy$9$ = -56 ; size = 4
+tv2758 = -56 ; size = 4
+tv2717 = -56 ; size = 4
+tv2715 = -56 ; size = 4
+tv2704 = -56 ; size = 4
+tv2690 = -56 ; size = 4
+tv2666 = -56 ; size = 4
+tv2665 = -56 ; size = 4
+tv2620 = -56 ; size = 4
+_copy$7$ = -56 ; size = 4
+_copy$4$ = -56 ; size = 4
+_copy$3$ = -56 ; size = 4
+_copy$2$ = -56 ; size = 4
+_len$5$ = -56 ; size = 4
+_len$1$ = -56 ; size = 4
+_last$ = -56 ; size = 4
+_here$ = -56 ; size = 4
+_copy$11$ = -52 ; size = 4
+_copy$8$ = -52 ; size = 4
+tv2711 = -52 ; size = 4
+tv2710 = -52 ; size = 4
+tv2688 = -52 ; size = 4
+tv2664 = -52 ; size = 4
+_copy$1$ = -52 ; size = 4
+tv2779 = -48 ; size = 4
+_ret$1$ = -44 ; size = 4
+_from$1$ = -40 ; size = 4
+tv2786 = -40 ; size = 4
+tv2696 = -40 ; size = 4
+tv2687 = -40 ; size = 4
+tv2686 = -40 ; size = 4
+_len$4$ = -40 ; size = 4
+_len$3$ = -40 ; size = 4
+_len$2$ = -40 ; size = 4
+_out$1$ = -36 ; size = 4
+_put$1$ = -32 ; size = 4
+_hbuf$ = -28 ; size = 4
+_left$1$ = -24 ; size = 4
+tv2678 = -20 ; size = 4
+tv2677 = -20 ; size = 4
+_bits$1$ = -20 ; size = 4
+_next$1$ = -16 ; size = 4
+tv2713 = -12 ; size = 4
+_have$1$ = -12 ; size = 4
+_state$1$ = -8 ; size = 4
+_hold$1$ = -4 ; size = 4
+tv2648 = 8 ; size = 4
+_strm$ = 8 ; size = 4
+_flush$ = 12 ; size = 4
+_inflate@8 PROC ; COMDAT
+
+; 608 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 609 : struct inflate_state FAR *state;
+; 610 : z_const unsigned char FAR *next; /* next input */
+; 611 : unsigned char FAR *put; /* next output */
+; 612 : unsigned have, left; /* available input and output */
+; 613 : unsigned long hold; /* bit buffer */
+; 614 : unsigned bits; /* bits in bit buffer */
+; 615 : unsigned in, out; /* save starting available input and output */
+; 616 : unsigned copy; /* number of stored or match bytes to copy */
+; 617 : unsigned char FAR *from; /* where to copy match bytes from */
+; 618 : code here; /* current decoding table entry */
+; 619 : code last; /* parent table entry */
+; 620 : unsigned len; /* length to copy for repeats, bits to drop */
+; 621 : int ret; /* return code */
+; 622 : #ifdef GUNZIP
+; 623 : unsigned char hbuf[4]; /* buffer for gzip header crc calculation */
+; 624 : #endif
+; 625 : static const unsigned short order[19] = /* permutation of code lengths */
+; 626 : {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
+; 627 :
+; 628 : if (strm == Z_NULL || strm->state == Z_NULL || strm->next_out == Z_NULL ||
+
+ 00003 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 00006 83 ec 40 sub esp, 64 ; 00000040H
+ 00009 85 c0 test eax, eax
+ 0000b 0f 84 1e 16 00
+ 00 je $LN333@inflate
+ 00011 8b 48 1c mov ecx, DWORD PTR [eax+28]
+ 00014 89 4d f8 mov DWORD PTR _state$1$[ebp], ecx
+ 00017 85 c9 test ecx, ecx
+ 00019 0f 84 10 16 00
+ 00 je $LN333@inflate
+ 0001f 83 78 0c 00 cmp DWORD PTR [eax+12], 0
+ 00023 0f 84 06 16 00
+ 00 je $LN333@inflate
+ 00029 83 38 00 cmp DWORD PTR [eax], 0
+ 0002c 75 0a jne SHORT $LN332@inflate
+ 0002e 83 78 04 00 cmp DWORD PTR [eax+4], 0
+ 00032 0f 85 f7 15 00
+ 00 jne $LN333@inflate
+$LN332@inflate:
+
+; 631 :
+; 632 : state = (struct inflate_state FAR *)strm->state;
+; 633 : if (state->mode == TYPE) state->mode = TYPEDO; /* skip check */
+
+ 00038 83 39 0b cmp DWORD PTR [ecx], 11 ; 0000000bH
+ 0003b 75 06 jne SHORT $LN4@inflate
+ 0003d c7 01 0c 00 00
+ 00 mov DWORD PTR [ecx], 12 ; 0000000cH
+$LN4@inflate:
+
+; 634 : LOAD();
+
+ 00043 8b 50 0c mov edx, DWORD PTR [eax+12]
+ 00046 53 push ebx
+ 00047 8b 58 04 mov ebx, DWORD PTR [eax+4]
+ 0004a 56 push esi
+ 0004b 8b 71 3c mov esi, DWORD PTR [ecx+60]
+ 0004e 89 55 e0 mov DWORD PTR _put$1$[ebp], edx
+ 00051 8b 50 10 mov edx, DWORD PTR [eax+16]
+ 00054 89 55 e8 mov DWORD PTR _left$1$[ebp], edx
+ 00057 8b 51 38 mov edx, DWORD PTR [ecx+56]
+ 0005a 57 push edi
+ 0005b 8b 38 mov edi, DWORD PTR [eax]
+
+; 635 : in = have;
+; 636 : out = left;
+
+ 0005d 8b 45 e8 mov eax, DWORD PTR _left$1$[ebp]
+ 00060 89 45 dc mov DWORD PTR _out$1$[ebp], eax
+
+; 637 : ret = Z_OK;
+
+ 00063 33 c0 xor eax, eax
+ 00065 89 45 d4 mov DWORD PTR _ret$1$[ebp], eax
+
+; 638 : for (;;)
+; 639 : switch (state->mode) {
+
+ 00068 8b 01 mov eax, DWORD PTR [ecx]
+ 0006a 89 7d f0 mov DWORD PTR _next$1$[ebp], edi
+ 0006d 89 5d f4 mov DWORD PTR _have$1$[ebp], ebx
+ 00070 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 00073 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+ 00076 89 5d c4 mov DWORD PTR _in$1$[ebp], ebx
+ 00079 83 f8 1e cmp eax, 30 ; 0000001eH
+ 0007c 0f 87 a5 0a 00
+ 00 ja $LN498@inflate
+
+; 938 : for (;;) {
+; 939 : here = state->lencode[BITS(state->lenbits)];
+
+ 00082 8d 79 54 lea edi, DWORD PTR [ecx+84]
+ 00085 89 7d d0 mov DWORD PTR tv2779[ebp], edi
+
+; 1080 : case DIST:
+; 1081 : for (;;) {
+; 1082 : here = state->distcode[BITS(state->distbits)];
+
+ 00088 8d 79 58 lea edi, DWORD PTR [ecx+88]
+ 0008b 89 7d c0 mov DWORD PTR tv2776[ebp], edi
+ 0008e 8b 7d f0 mov edi, DWORD PTR _next$1$[ebp]
+$LL5@inflate:
+
+; 638 : for (;;)
+; 639 : switch (state->mode) {
+
+ 00091 ff 24 85 00 00
+ 00 00 jmp DWORD PTR $LN935@inflate[eax*4]
+$LN335@inflate:
+
+; 640 : case HEAD:
+; 641 : if (state->wrap == 0) {
+
+ 00098 8b 41 08 mov eax, DWORD PTR [ecx+8]
+ 0009b 89 45 c8 mov DWORD PTR tv2758[ebp], eax
+ 0009e 85 c0 test eax, eax
+ 000a0 75 0b jne SHORT $LN12@inflate
+
+; 642 : state->mode = TYPEDO;
+
+ 000a2 c7 01 0c 00 00
+ 00 mov DWORD PTR [ecx], 12 ; 0000000cH
+
+; 643 : break;
+
+ 000a8 e9 6f 0a 00 00 jmp $LN8@inflate
+$LN12@inflate:
+
+; 644 : }
+; 645 : NEEDBITS(16);
+
+ 000ad 83 fe 10 cmp esi, 16 ; 00000010H
+ 000b0 73 2d jae SHORT $LN10@inflate
+$LL13@inflate:
+ 000b2 85 db test ebx, ebx
+ 000b4 0f 84 c0 04 00
+ 00 je $LN886@inflate
+ 000ba 0f b6 07 movzx eax, BYTE PTR [edi]
+ 000bd 8b ce mov ecx, esi
+ 000bf d3 e0 shl eax, cl
+ 000c1 83 c6 08 add esi, 8
+ 000c4 4b dec ebx
+ 000c5 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+ 000c8 03 d0 add edx, eax
+ 000ca 89 5d f4 mov DWORD PTR _have$1$[ebp], ebx
+ 000cd 47 inc edi
+ 000ce 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 000d1 89 7d f0 mov DWORD PTR _next$1$[ebp], edi
+ 000d4 83 fe 10 cmp esi, 16 ; 00000010H
+ 000d7 72 d9 jb SHORT $LL13@inflate
+ 000d9 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 000dc 8b 45 c8 mov eax, DWORD PTR tv2758[ebp]
+$LN10@inflate:
+
+; 646 : #ifdef GUNZIP
+; 647 : if ((state->wrap & 2) && hold == 0x8b1f) { /* gzip header */
+
+ 000df a8 02 test al, 2
+ 000e1 74 46 je SHORT $LN338@inflate
+ 000e3 81 fa 1f 8b 00
+ 00 cmp edx, 35615 ; 00008b1fH
+ 000e9 75 3e jne SHORT $LN338@inflate
+
+; 648 : state->check = crc32(0L, Z_NULL, 0);
+
+ 000eb 6a 00 push 0
+ 000ed 6a 00 push 0
+ 000ef 6a 00 push 0
+ 000f1 e8 00 00 00 00 call _crc32@12
+ 000f6 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+
+; 649 : CRC2(state->check, hold);
+
+ 000f9 6a 02 push 2
+ 000fb 66 c7 45 e4 1f
+ 8b mov WORD PTR _hbuf$[ebp], 35615 ; 00008b1fH
+ 00101 89 41 18 mov DWORD PTR [ecx+24], eax
+ 00104 8d 4d e4 lea ecx, DWORD PTR _hbuf$[ebp]
+ 00107 51 push ecx
+ 00108 50 push eax
+ 00109 e8 00 00 00 00 call _crc32@12
+ 0010e 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+
+; 650 : INITBITS();
+
+ 00111 33 d2 xor edx, edx
+ 00113 33 f6 xor esi, esi
+ 00115 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 00118 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+ 0011b 89 41 18 mov DWORD PTR [ecx+24], eax
+
+; 651 : state->mode = FLAGS;
+
+ 0011e c7 01 01 00 00
+ 00 mov DWORD PTR [ecx], 1
+
+; 652 : break;
+
+ 00124 e9 f3 09 00 00 jmp $LN8@inflate
+$LN338@inflate:
+
+; 653 : }
+; 654 : state->flags = 0; /* expect zlib header */
+; 655 : if (state->head != Z_NULL)
+
+ 00129 8b 41 20 mov eax, DWORD PTR [ecx+32]
+ 0012c c7 41 10 00 00
+ 00 00 mov DWORD PTR [ecx+16], 0
+ 00133 85 c0 test eax, eax
+ 00135 74 07 je SHORT $LN339@inflate
+
+; 656 : state->head->done = -1;
+
+ 00137 c7 40 30 ff ff
+ ff ff mov DWORD PTR [eax+48], -1
+$LN339@inflate:
+
+; 657 : if (!(state->wrap & 1) || /* check if zlib header allowed */
+
+ 0013e f6 41 08 01 test BYTE PTR [ecx+8], 1
+ 00142 0f 84 c1 00 00
+ 00 je $LN341@inflate
+ 00148 0f b6 ca movzx ecx, dl
+ 0014b 8b c2 mov eax, edx
+ 0014d c1 e1 08 shl ecx, 8
+ 00150 33 d2 xor edx, edx
+ 00152 c1 e8 08 shr eax, 8
+ 00155 03 c1 add eax, ecx
+ 00157 b9 1f 00 00 00 mov ecx, 31 ; 0000001fH
+ 0015c f7 f1 div ecx
+
+; 668 : state->mode = BAD;
+
+ 0015e 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 00161 85 d2 test edx, edx
+ 00163 8b 55 fc mov edx, DWORD PTR _hold$1$[ebp]
+ 00166 0f 85 9d 00 00
+ 00 jne $LN341@inflate
+
+; 665 : }
+; 666 : if (BITS(4) != Z_DEFLATED) {
+
+ 0016c 8b c2 mov eax, edx
+ 0016e 24 0f and al, 15 ; 0000000fH
+ 00170 3c 08 cmp al, 8
+ 00172 74 15 je SHORT $LN26@inflate
+$LN932@inflate:
+
+; 667 : strm->msg = (char *)"unknown compression method";
+
+ 00174 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 00177 c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BL@IHKGDAEE@unknown?5compression?5method?$AA@
+
+; 668 : state->mode = BAD;
+
+ 0017e c7 01 1d 00 00
+ 00 mov DWORD PTR [ecx], 29 ; 0000001dH
+
+; 669 : break;
+
+ 00184 e9 93 09 00 00 jmp $LN8@inflate
+$LN26@inflate:
+
+; 670 : }
+; 671 : DROPBITS(4);
+
+ 00189 c1 ea 04 shr edx, 4
+ 0018c 83 ee 04 sub esi, 4
+
+; 672 : len = BITS(4) + 8;
+
+ 0018f 8b c2 mov eax, edx
+ 00191 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 00194 83 e0 0f and eax, 15 ; 0000000fH
+ 00197 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+ 0019a 83 c0 08 add eax, 8
+
+; 673 : if (state->wbits == 0)
+
+ 0019d 83 79 24 00 cmp DWORD PTR [ecx+36], 0
+ 001a1 89 45 c8 mov DWORD PTR _len$1$[ebp], eax
+ 001a4 75 49 jne SHORT $LN343@inflate
+
+; 674 : state->wbits = len;
+
+ 001a6 89 41 24 mov DWORD PTR [ecx+36], eax
+$LN345@inflate:
+
+; 679 : }
+; 680 : state->dmax = 1U << len;
+
+ 001a9 8b 4d c8 mov ecx, DWORD PTR _len$1$[ebp]
+ 001ac b8 01 00 00 00 mov eax, 1
+ 001b1 d3 e0 shl eax, cl
+ 001b3 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+
+; 681 : Tracev((stderr, "inflate: zlib header ok\n"));
+; 682 : strm->adler = state->check = adler32(0L, Z_NULL, 0);
+
+ 001b6 6a 00 push 0
+ 001b8 6a 00 push 0
+ 001ba 6a 00 push 0
+ 001bc 89 41 14 mov DWORD PTR [ecx+20], eax
+ 001bf e8 00 00 00 00 call _adler32@12
+ 001c4 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 001c7 8b 55 08 mov edx, DWORD PTR _strm$[ebp]
+ 001ca 89 41 18 mov DWORD PTR [ecx+24], eax
+ 001cd 89 42 30 mov DWORD PTR [edx+48], eax
+
+; 683 : state->mode = hold & 0x200 ? DICTID : TYPE;
+
+ 001d0 8b 55 fc mov edx, DWORD PTR _hold$1$[ebp]
+ 001d3 c1 ea 08 shr edx, 8
+ 001d6 f7 d2 not edx
+ 001d8 83 e2 02 and edx, 2
+ 001db 83 ca 09 or edx, 9
+ 001de 89 11 mov DWORD PTR [ecx], edx
+
+; 684 : INITBITS();
+
+ 001e0 33 d2 xor edx, edx
+ 001e2 33 f6 xor esi, esi
+ 001e4 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 001e7 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+
+; 685 : break;
+
+ 001ea e9 2d 09 00 00 jmp $LN8@inflate
+$LN343@inflate:
+
+; 675 : else if (len > state->wbits) {
+
+ 001ef 3b 41 24 cmp eax, DWORD PTR [ecx+36]
+ 001f2 76 b5 jbe SHORT $LN345@inflate
+
+; 676 : strm->msg = (char *)"invalid window size";
+
+ 001f4 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 001f7 c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BE@EMOGCLGO@invalid?5window?5size?$AA@
+
+; 677 : state->mode = BAD;
+
+ 001fe c7 01 1d 00 00
+ 00 mov DWORD PTR [ecx], 29 ; 0000001dH
+
+; 678 : break;
+
+ 00204 e9 13 09 00 00 jmp $LN8@inflate
+$LN341@inflate:
+
+; 658 : #else
+; 659 : if (
+; 660 : #endif
+; 661 : ((BITS(8) << 8) + (hold >> 8)) % 31) {
+; 662 : strm->msg = (char *)"incorrect header check";
+
+ 00209 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 0020c c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BH@LIBMMIGA@incorrect?5header?5check?$AA@
+
+; 663 : state->mode = BAD;
+
+ 00213 c7 01 1d 00 00
+ 00 mov DWORD PTR [ecx], 29 ; 0000001dH
+
+; 664 : break;
+
+ 00219 e9 fe 08 00 00 jmp $LN8@inflate
+$LN32@inflate:
+
+; 686 : #ifdef GUNZIP
+; 687 : case FLAGS:
+; 688 : NEEDBITS(16);
+
+ 0021e 83 fe 10 cmp esi, 16 ; 00000010H
+ 00221 73 2a jae SHORT $LN30@inflate
+$LL33@inflate:
+ 00223 85 db test ebx, ebx
+ 00225 0f 84 4f 03 00
+ 00 je $LN886@inflate
+ 0022b 0f b6 07 movzx eax, BYTE PTR [edi]
+ 0022e 8b ce mov ecx, esi
+ 00230 d3 e0 shl eax, cl
+ 00232 83 c6 08 add esi, 8
+ 00235 4b dec ebx
+ 00236 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+ 00239 03 d0 add edx, eax
+ 0023b 89 5d f4 mov DWORD PTR _have$1$[ebp], ebx
+ 0023e 47 inc edi
+ 0023f 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 00242 89 7d f0 mov DWORD PTR _next$1$[ebp], edi
+ 00245 83 fe 10 cmp esi, 16 ; 00000010H
+ 00248 72 d9 jb SHORT $LL33@inflate
+ 0024a 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+$LN30@inflate:
+
+; 689 : state->flags = (int)(hold);
+
+ 0024d 89 51 10 mov DWORD PTR [ecx+16], edx
+
+; 690 : if ((state->flags & 0xff) != Z_DEFLATED) {
+
+ 00250 80 fa 08 cmp dl, 8
+ 00253 0f 85 1b ff ff
+ ff jne $LN932@inflate
+
+; 691 : strm->msg = (char *)"unknown compression method";
+; 692 : state->mode = BAD;
+; 693 : break;
+; 694 : }
+; 695 : if (state->flags & 0xe000) {
+
+ 00259 f7 c2 00 e0 00
+ 00 test edx, 57344 ; 0000e000H
+ 0025f 74 15 je SHORT $LN349@inflate
+
+; 696 : strm->msg = (char *)"unknown header flags set";
+
+ 00261 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 00264 c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BJ@BLBBCOMO@unknown?5header?5flags?5set?$AA@
+ 0026b c7 01 1d 00 00
+ 00 mov DWORD PTR [ecx], 29 ; 0000001dH
+ 00271 e9 a6 08 00 00 jmp $LN8@inflate
+$LN349@inflate:
+
+; 697 : state->mode = BAD;
+; 698 : break;
+; 699 : }
+; 700 : if (state->head != Z_NULL)
+
+ 00276 8b 71 20 mov esi, DWORD PTR [ecx+32]
+ 00279 85 f6 test esi, esi
+ 0027b 74 0a je SHORT $LN350@inflate
+
+; 701 : state->head->text = (int)((hold >> 8) & 1);
+
+ 0027d 8b c2 mov eax, edx
+ 0027f c1 e8 08 shr eax, 8
+ 00282 83 e0 01 and eax, 1
+ 00285 89 06 mov DWORD PTR [esi], eax
+$LN350@inflate:
+
+; 702 : if (state->flags & 0x0200) CRC2(state->check, hold);
+
+ 00287 f7 41 10 00 02
+ 00 00 test DWORD PTR [ecx+16], 512 ; 00000200H
+ 0028e 74 1d je SHORT $LN39@inflate
+ 00290 6a 02 push 2
+ 00292 8d 45 e4 lea eax, DWORD PTR _hbuf$[ebp]
+ 00295 88 55 e4 mov BYTE PTR _hbuf$[ebp], dl
+ 00298 50 push eax
+ 00299 ff 71 18 push DWORD PTR [ecx+24]
+ 0029c c1 ea 08 shr edx, 8
+ 0029f 88 55 e5 mov BYTE PTR _hbuf$[ebp+1], dl
+ 002a2 e8 00 00 00 00 call _crc32@12
+ 002a7 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 002aa 89 41 18 mov DWORD PTR [ecx+24], eax
+$LN39@inflate:
+
+; 703 : INITBITS();
+
+ 002ad 33 d2 xor edx, edx
+
+; 704 : state->mode = TIME;
+
+ 002af c7 01 02 00 00
+ 00 mov DWORD PTR [ecx], 2
+ 002b5 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 002b8 33 f6 xor esi, esi
+
+; 705 : case TIME:
+; 706 : NEEDBITS(32);
+
+ 002ba eb 05 jmp SHORT $LL47@inflate
+$LN46@inflate:
+ 002bc 83 fe 20 cmp esi, 32 ; 00000020H
+ 002bf 73 27 jae SHORT $LN44@inflate
+$LL47@inflate:
+ 002c1 85 db test ebx, ebx
+ 002c3 0f 84 b1 02 00
+ 00 je $LN886@inflate
+ 002c9 0f b6 07 movzx eax, BYTE PTR [edi]
+ 002cc 8b ce mov ecx, esi
+ 002ce d3 e0 shl eax, cl
+ 002d0 4b dec ebx
+ 002d1 03 d0 add edx, eax
+ 002d3 89 5d f4 mov DWORD PTR _have$1$[ebp], ebx
+ 002d6 47 inc edi
+ 002d7 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 002da 83 c6 08 add esi, 8
+ 002dd 89 7d f0 mov DWORD PTR _next$1$[ebp], edi
+ 002e0 83 fe 20 cmp esi, 32 ; 00000020H
+ 002e3 72 dc jb SHORT $LL47@inflate
+ 002e5 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+$LN44@inflate:
+
+; 707 : if (state->head != Z_NULL)
+
+ 002e8 8b 41 20 mov eax, DWORD PTR [ecx+32]
+ 002eb 85 c0 test eax, eax
+ 002ed 74 03 je SHORT $LN354@inflate
+
+; 708 : state->head->time = hold;
+
+ 002ef 89 50 04 mov DWORD PTR [eax+4], edx
+$LN354@inflate:
+
+; 709 : if (state->flags & 0x0200) CRC4(state->check, hold);
+
+ 002f2 f7 41 10 00 02
+ 00 00 test DWORD PTR [ecx+16], 512 ; 00000200H
+ 002f9 74 2d je SHORT $LN53@inflate
+ 002fb 8b c2 mov eax, edx
+ 002fd 88 55 e4 mov BYTE PTR _hbuf$[ebp], dl
+ 00300 c1 e8 08 shr eax, 8
+ 00303 88 45 e5 mov BYTE PTR _hbuf$[ebp+1], al
+ 00306 8b c2 mov eax, edx
+ 00308 c1 e8 10 shr eax, 16 ; 00000010H
+ 0030b 88 45 e6 mov BYTE PTR _hbuf$[ebp+2], al
+ 0030e 8d 45 e4 lea eax, DWORD PTR _hbuf$[ebp]
+ 00311 6a 04 push 4
+ 00313 50 push eax
+ 00314 ff 71 18 push DWORD PTR [ecx+24]
+ 00317 c1 ea 18 shr edx, 24 ; 00000018H
+ 0031a 88 55 e7 mov BYTE PTR _hbuf$[ebp+3], dl
+ 0031d e8 00 00 00 00 call _crc32@12
+ 00322 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 00325 89 41 18 mov DWORD PTR [ecx+24], eax
+$LN53@inflate:
+
+; 710 : INITBITS();
+
+ 00328 33 d2 xor edx, edx
+
+; 711 : state->mode = OS;
+
+ 0032a c7 01 03 00 00
+ 00 mov DWORD PTR [ecx], 3
+ 00330 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 00333 33 f6 xor esi, esi
+
+; 712 : case OS:
+; 713 : NEEDBITS(16);
+
+ 00335 eb 09 jmp SHORT $LL61@inflate
+$LN60@inflate:
+ 00337 83 fe 10 cmp esi, 16 ; 00000010H
+ 0033a 73 2b jae SHORT $LN58@inflate
+ 0033c 0f 1f 40 00 npad 4
+$LL61@inflate:
+ 00340 85 db test ebx, ebx
+ 00342 0f 84 32 02 00
+ 00 je $LN886@inflate
+ 00348 0f b6 07 movzx eax, BYTE PTR [edi]
+ 0034b 8b ce mov ecx, esi
+ 0034d d3 e0 shl eax, cl
+ 0034f 4b dec ebx
+ 00350 03 d0 add edx, eax
+ 00352 89 5d f4 mov DWORD PTR _have$1$[ebp], ebx
+ 00355 47 inc edi
+ 00356 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 00359 83 c6 08 add esi, 8
+ 0035c 89 7d f0 mov DWORD PTR _next$1$[ebp], edi
+ 0035f 83 fe 10 cmp esi, 16 ; 00000010H
+ 00362 72 dc jb SHORT $LL61@inflate
+ 00364 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+$LN58@inflate:
+
+; 714 : if (state->head != Z_NULL) {
+
+ 00367 8b 71 20 mov esi, DWORD PTR [ecx+32]
+ 0036a 85 f6 test esi, esi
+ 0036c 74 17 je SHORT $LN358@inflate
+
+; 715 : state->head->xflags = (int)(hold & 0xff);
+
+ 0036e 0f b6 c2 movzx eax, dl
+
+; 716 : state->head->os = (int)(hold >> 8);
+
+ 00371 8b ca mov ecx, edx
+ 00373 89 46 08 mov DWORD PTR [esi+8], eax
+ 00376 8b 45 f8 mov eax, DWORD PTR _state$1$[ebp]
+ 00379 c1 e9 08 shr ecx, 8
+ 0037c 8b 40 20 mov eax, DWORD PTR [eax+32]
+ 0037f 89 48 0c mov DWORD PTR [eax+12], ecx
+ 00382 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+$LN358@inflate:
+
+; 717 : }
+; 718 : if (state->flags & 0x0200) CRC2(state->check, hold);
+
+ 00385 f7 41 10 00 02
+ 00 00 test DWORD PTR [ecx+16], 512 ; 00000200H
+ 0038c 74 1d je SHORT $LN67@inflate
+ 0038e 6a 02 push 2
+ 00390 8d 45 e4 lea eax, DWORD PTR _hbuf$[ebp]
+ 00393 88 55 e4 mov BYTE PTR _hbuf$[ebp], dl
+ 00396 50 push eax
+ 00397 ff 71 18 push DWORD PTR [ecx+24]
+ 0039a c1 ea 08 shr edx, 8
+ 0039d 88 55 e5 mov BYTE PTR _hbuf$[ebp+1], dl
+ 003a0 e8 00 00 00 00 call _crc32@12
+ 003a5 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 003a8 89 41 18 mov DWORD PTR [ecx+24], eax
+$LN67@inflate:
+
+; 719 : INITBITS();
+
+ 003ab 33 d2 xor edx, edx
+
+; 720 : state->mode = EXLEN;
+
+ 003ad c7 01 04 00 00
+ 00 mov DWORD PTR [ecx], 4
+ 003b3 33 f6 xor esi, esi
+ 003b5 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 003b8 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+$LN360@inflate:
+
+; 721 : case EXLEN:
+; 722 : if (state->flags & 0x0400) {
+
+ 003bb f7 41 10 00 04
+ 00 00 test DWORD PTR [ecx+16], 1024 ; 00000400H
+ 003c2 74 74 je SHORT $LN361@inflate
+
+; 723 : NEEDBITS(16);
+
+ 003c4 83 fe 10 cmp esi, 16 ; 00000010H
+ 003c7 73 2e jae SHORT $LN72@inflate
+ 003c9 0f 1f 80 00 00
+ 00 00 npad 7
+$LL75@inflate:
+ 003d0 85 db test ebx, ebx
+ 003d2 0f 84 a2 01 00
+ 00 je $LN886@inflate
+ 003d8 0f b6 07 movzx eax, BYTE PTR [edi]
+ 003db 8b ce mov ecx, esi
+ 003dd d3 e0 shl eax, cl
+ 003df 4b dec ebx
+ 003e0 03 d0 add edx, eax
+ 003e2 89 5d f4 mov DWORD PTR _have$1$[ebp], ebx
+ 003e5 47 inc edi
+ 003e6 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 003e9 83 c6 08 add esi, 8
+ 003ec 89 7d f0 mov DWORD PTR _next$1$[ebp], edi
+ 003ef 83 fe 10 cmp esi, 16 ; 00000010H
+ 003f2 72 dc jb SHORT $LL75@inflate
+ 003f4 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+$LN72@inflate:
+
+; 724 : state->length = (unsigned)(hold);
+; 725 : if (state->head != Z_NULL)
+
+ 003f7 8b 41 20 mov eax, DWORD PTR [ecx+32]
+ 003fa 89 51 40 mov DWORD PTR [ecx+64], edx
+ 003fd 85 c0 test eax, eax
+ 003ff 74 03 je SHORT $LN364@inflate
+
+; 726 : state->head->extra_len = (unsigned)hold;
+
+ 00401 89 50 14 mov DWORD PTR [eax+20], edx
+$LN364@inflate:
+
+; 727 : if (state->flags & 0x0200) CRC2(state->check, hold);
+
+ 00404 f7 41 10 00 02
+ 00 00 test DWORD PTR [ecx+16], 512 ; 00000200H
+ 0040b 74 1d je SHORT $LN81@inflate
+ 0040d 6a 02 push 2
+ 0040f 8d 45 e4 lea eax, DWORD PTR _hbuf$[ebp]
+ 00412 88 55 e4 mov BYTE PTR _hbuf$[ebp], dl
+ 00415 50 push eax
+ 00416 ff 71 18 push DWORD PTR [ecx+24]
+ 00419 c1 ea 08 shr edx, 8
+ 0041c 88 55 e5 mov BYTE PTR _hbuf$[ebp+1], dl
+ 0041f e8 00 00 00 00 call _crc32@12
+ 00424 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 00427 89 41 18 mov DWORD PTR [ecx+24], eax
+$LN81@inflate:
+
+; 728 : INITBITS();
+
+ 0042a 33 f6 xor esi, esi
+ 0042c c7 45 fc 00 00
+ 00 00 mov DWORD PTR _hold$1$[ebp], 0
+ 00433 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+
+; 729 : }
+
+ 00436 eb 0e jmp SHORT $LN366@inflate
+$LN361@inflate:
+
+; 730 : else if (state->head != Z_NULL)
+
+ 00438 8b 41 20 mov eax, DWORD PTR [ecx+32]
+ 0043b 85 c0 test eax, eax
+ 0043d 74 07 je SHORT $LN366@inflate
+
+; 731 : state->head->extra = Z_NULL;
+
+ 0043f c7 40 10 00 00
+ 00 00 mov DWORD PTR [eax+16], 0
+$LN366@inflate:
+
+; 732 : state->mode = EXTRA;
+
+ 00446 c7 01 05 00 00
+ 00 mov DWORD PTR [ecx], 5
+$LN367@inflate:
+
+; 733 : case EXTRA:
+; 734 : if (state->flags & 0x0400) {
+
+ 0044c f7 41 10 00 04
+ 00 00 test DWORD PTR [ecx+16], 1024 ; 00000400H
+ 00453 0f 84 8d 00 00
+ 00 je $LN373@inflate
+
+; 735 : copy = state->length;
+
+ 00459 8b 41 40 mov eax, DWORD PTR [ecx+64]
+
+; 736 : if (copy > have) copy = have;
+
+ 0045c 3b c3 cmp eax, ebx
+ 0045e 8b d0 mov edx, eax
+ 00460 89 45 cc mov DWORD PTR _copy$1$[ebp], eax
+ 00463 0f 47 d3 cmova edx, ebx
+ 00466 89 55 c8 mov DWORD PTR _copy$2$[ebp], edx
+
+; 737 : if (copy) {
+
+ 00469 85 d2 test edx, edx
+ 0046b 74 6f je SHORT $LN370@inflate
+
+; 738 : if (state->head != Z_NULL &&
+
+ 0046d 8b 41 20 mov eax, DWORD PTR [ecx+32]
+ 00470 85 c0 test eax, eax
+ 00472 74 3f je SHORT $LN371@inflate
+ 00474 8b 78 10 mov edi, DWORD PTR [eax+16]
+ 00477 85 ff test edi, edi
+ 00479 89 7d f4 mov DWORD PTR tv2713[ebp], edi
+ 0047c 8b 7d f0 mov edi, DWORD PTR _next$1$[ebp]
+ 0047f 74 32 je SHORT $LN371@inflate
+
+; 739 : state->head->extra != Z_NULL) {
+; 740 : len = state->head->extra_len - state->length;
+
+ 00481 8b 48 14 mov ecx, DWORD PTR [eax+20]
+ 00484 2b 4d cc sub ecx, DWORD PTR _copy$1$[ebp]
+ 00487 89 4d d8 mov DWORD PTR _len$2$[ebp], ecx
+
+; 741 : zmemcpy(state->head->extra + len, next,
+
+ 0048a 8b 48 18 mov ecx, DWORD PTR [eax+24]
+ 0048d 8b 45 d8 mov eax, DWORD PTR _len$2$[ebp]
+ 00490 03 c2 add eax, edx
+ 00492 3b c1 cmp eax, ecx
+ 00494 8b 45 d8 mov eax, DWORD PTR _len$2$[ebp]
+ 00497 76 04 jbe SHORT $LN508@inflate
+ 00499 2b c8 sub ecx, eax
+ 0049b eb 02 jmp SHORT $LN509@inflate
+$LN508@inflate:
+ 0049d 8b ca mov ecx, edx
+$LN509@inflate:
+ 0049f 03 45 f4 add eax, DWORD PTR tv2713[ebp]
+ 004a2 51 push ecx
+ 004a3 57 push edi
+ 004a4 50 push eax
+ 004a5 e8 00 00 00 00 call _memcpy
+ 004aa 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 004ad 83 c4 0c add esp, 12 ; 0000000cH
+ 004b0 8b 55 c8 mov edx, DWORD PTR _copy$2$[ebp]
+$LN371@inflate:
+
+; 742 : len + copy > state->head->extra_max ?
+; 743 : state->head->extra_max - len : copy);
+; 744 : }
+; 745 : if (state->flags & 0x0200)
+
+ 004b3 f7 41 10 00 02
+ 00 00 test DWORD PTR [ecx+16], 512 ; 00000200H
+ 004ba 74 10 je SHORT $LN372@inflate
+
+; 746 : state->check = crc32(state->check, next, copy);
+
+ 004bc 52 push edx
+ 004bd 57 push edi
+ 004be ff 71 18 push DWORD PTR [ecx+24]
+ 004c1 e8 00 00 00 00 call _crc32@12
+ 004c6 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 004c9 89 41 18 mov DWORD PTR [ecx+24], eax
+$LN372@inflate:
+
+; 747 : have -= copy;
+
+ 004cc 8b 45 c8 mov eax, DWORD PTR _copy$2$[ebp]
+ 004cf 2b d8 sub ebx, eax
+
+; 748 : next += copy;
+
+ 004d1 03 f8 add edi, eax
+ 004d3 89 5d f4 mov DWORD PTR _have$1$[ebp], ebx
+
+; 749 : state->length -= copy;
+
+ 004d6 29 41 40 sub DWORD PTR [ecx+64], eax
+ 004d9 89 7d f0 mov DWORD PTR _next$1$[ebp], edi
+$LN370@inflate:
+
+; 750 : }
+; 751 : if (state->length) goto inf_leave;
+
+ 004dc 83 79 40 00 cmp DWORD PTR [ecx+64], 0
+ 004e0 0f 85 94 00 00
+ 00 jne $LN886@inflate
+$LN373@inflate:
+
+; 752 : }
+; 753 : state->length = 0;
+
+ 004e6 c7 41 40 00 00
+ 00 00 mov DWORD PTR [ecx+64], 0
+
+; 754 : state->mode = NAME;
+
+ 004ed c7 01 06 00 00
+ 00 mov DWORD PTR [ecx], 6
+$LN374@inflate:
+
+; 755 : case NAME:
+; 756 : if (state->flags & 0x0800) {
+
+ 004f3 f7 41 10 00 08
+ 00 00 test DWORD PTR [ecx+16], 2048 ; 00000800H
+ 004fa 0f 84 fd 00 00
+ 00 je $LN375@inflate
+
+; 757 : if (have == 0) goto inf_leave;
+
+ 00500 85 db test ebx, ebx
+ 00502 74 76 je SHORT $LN886@inflate
+
+; 758 : copy = 0;
+
+ 00504 33 d2 xor edx, edx
+$LL88@inflate:
+
+; 759 : do {
+; 760 : len = (unsigned)(next[copy++]);
+
+ 00506 0f b6 04 3a movzx eax, BYTE PTR [edx+edi]
+ 0050a 42 inc edx
+ 0050b 89 45 d8 mov DWORD PTR _len$3$[ebp], eax
+
+; 761 : if (state->head != Z_NULL &&
+; 762 : state->head->name != Z_NULL &&
+
+ 0050e 8b 41 20 mov eax, DWORD PTR [ecx+32]
+ 00511 85 c0 test eax, eax
+ 00513 74 23 je SHORT $LN86@inflate
+ 00515 8b 70 1c mov esi, DWORD PTR [eax+28]
+ 00518 89 75 cc mov DWORD PTR tv2711[ebp], esi
+ 0051b 85 f6 test esi, esi
+ 0051d 74 19 je SHORT $LN86@inflate
+ 0051f 8b 71 40 mov esi, DWORD PTR [ecx+64]
+ 00522 3b 70 20 cmp esi, DWORD PTR [eax+32]
+ 00525 73 11 jae SHORT $LN86@inflate
+
+; 763 : state->length < state->head->name_max)
+; 764 : state->head->name[state->length++] = len;
+
+ 00527 8b 5d d8 mov ebx, DWORD PTR _len$3$[ebp]
+ 0052a 8b c6 mov eax, esi
+ 0052c 8b 75 cc mov esi, DWORD PTR tv2711[ebp]
+ 0052f 88 1c 06 mov BYTE PTR [esi+eax], bl
+ 00532 ff 41 40 inc DWORD PTR [ecx+64]
+ 00535 8b 5d f4 mov ebx, DWORD PTR _have$1$[ebp]
+$LN86@inflate:
+
+; 765 : } while (len && copy < have);
+
+ 00538 8b 45 d8 mov eax, DWORD PTR _len$3$[ebp]
+ 0053b 85 c0 test eax, eax
+ 0053d 74 04 je SHORT $LN379@inflate
+ 0053f 3b d3 cmp edx, ebx
+ 00541 72 c3 jb SHORT $LL88@inflate
+$LN379@inflate:
+
+; 766 : if (state->flags & 0x0200)
+
+ 00543 f7 41 10 00 02
+ 00 00 test DWORD PTR [ecx+16], 512 ; 00000200H
+ 0054a 8b 75 ec mov esi, DWORD PTR _bits$1$[ebp]
+ 0054d 89 55 c8 mov DWORD PTR _copy$3$[ebp], edx
+ 00550 74 16 je SHORT $LN380@inflate
+
+; 767 : state->check = crc32(state->check, next, copy);
+
+ 00552 52 push edx
+ 00553 57 push edi
+ 00554 ff 71 18 push DWORD PTR [ecx+24]
+ 00557 e8 00 00 00 00 call _crc32@12
+ 0055c 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 0055f 8b 55 c8 mov edx, DWORD PTR _copy$3$[ebp]
+ 00562 89 41 18 mov DWORD PTR [ecx+24], eax
+ 00565 8b 45 d8 mov eax, DWORD PTR _len$3$[ebp]
+$LN380@inflate:
+
+; 768 : have -= copy;
+
+ 00568 2b da sub ebx, edx
+
+; 769 : next += copy;
+
+ 0056a 03 fa add edi, edx
+ 0056c 89 5d f4 mov DWORD PTR _have$1$[ebp], ebx
+ 0056f 89 7d f0 mov DWORD PTR _next$1$[ebp], edi
+
+; 770 : if (len) goto inf_leave;
+
+ 00572 85 c0 test eax, eax
+ 00574 0f 84 91 00 00
+ 00 je $LN382@inflate
+$LN886@inflate:
+ 0057a 8b 45 f4 mov eax, DWORD PTR _have$1$[ebp]
+$LN896@inflate:
+ 0057d 8b 55 0c mov edx, DWORD PTR _flush$[ebp]
+$inf_leave$937:
+
+; 1222 : }
+; 1223 :
+; 1224 : /*
+; 1225 : Return from inflate(), updating the total counts and the check value.
+; 1226 : If there was no progress during the inflate() call, return a buffer
+; 1227 : error. Call updatewindow() to create and/or update the window state.
+; 1228 : Note: a memory error from inflate() is non-recoverable.
+; 1229 : */
+; 1230 : inf_leave:
+; 1231 : RESTORE();
+
+ 00580 8b 7d 08 mov edi, DWORD PTR _strm$[ebp]
+ 00583 8b 4d e0 mov ecx, DWORD PTR _put$1$[ebp]
+ 00586 8b 5d f8 mov ebx, DWORD PTR _state$1$[ebp]
+ 00589 89 4f 0c mov DWORD PTR [edi+12], ecx
+ 0058c 8b 4d e8 mov ecx, DWORD PTR _left$1$[ebp]
+ 0058f 89 4f 10 mov DWORD PTR [edi+16], ecx
+ 00592 8b 4d f0 mov ecx, DWORD PTR _next$1$[ebp]
+ 00595 89 47 04 mov DWORD PTR [edi+4], eax
+ 00598 8b 45 fc mov eax, DWORD PTR _hold$1$[ebp]
+ 0059b 89 0f mov DWORD PTR [edi], ecx
+
+; 1232 : if (state->wsize || (out != strm->avail_out && state->mode < BAD &&
+
+ 0059d 83 7b 28 00 cmp DWORD PTR [ebx+40], 0
+ 005a1 89 73 3c mov DWORD PTR [ebx+60], esi
+ 005a4 8b 75 dc mov esi, DWORD PTR _out$1$[ebp]
+ 005a7 89 43 38 mov DWORD PTR [ebx+56], eax
+ 005aa 75 22 jne SHORT $LN501@inflate
+ 005ac 3b 77 10 cmp esi, DWORD PTR [edi+16]
+ 005af 0f 84 c9 0f 00
+ 00 je $LN502@inflate
+ 005b5 8b 03 mov eax, DWORD PTR [ebx]
+ 005b7 83 f8 1d cmp eax, 29 ; 0000001dH
+ 005ba 0f 8d be 0f 00
+ 00 jge $LN502@inflate
+ 005c0 83 f8 1a cmp eax, 26 ; 0000001aH
+ 005c3 7c 09 jl SHORT $LN501@inflate
+ 005c5 83 fa 04 cmp edx, 4
+ 005c8 0f 84 b0 0f 00
+ 00 je $LN502@inflate
+$LN501@inflate:
+
+; 1233 : (state->mode < CHECK || flush != Z_FINISH)))
+; 1234 : if (updatewindow(strm, strm->next_out, out - strm->avail_out)) {
+
+ 005ce 8b 57 0c mov edx, DWORD PTR [edi+12]
+ 005d1 8b c6 mov eax, esi
+ 005d3 2b 47 10 sub eax, DWORD PTR [edi+16]
+ 005d6 8b cf mov ecx, edi
+ 005d8 50 push eax
+ 005d9 e8 00 00 00 00 call _updatewindow
+ 005de 83 c4 04 add esp, 4
+ 005e1 85 c0 test eax, eax
+ 005e3 0f 84 95 0f 00
+ 00 je $LN502@inflate
+
+; 1235 : state->mode = MEM;
+
+ 005e9 c7 03 1e 00 00
+ 00 mov DWORD PTR [ebx], 30 ; 0000001eH
+$LN497@inflate:
+ 005ef 5f pop edi
+ 005f0 5e pop esi
+
+; 1236 : return Z_MEM_ERROR;
+
+ 005f1 b8 fc ff ff ff mov eax, -4 ; fffffffcH
+ 005f6 5b pop ebx
+
+; 1250 : ret = Z_BUF_ERROR;
+; 1251 : return ret;
+; 1252 : }
+
+ 005f7 8b e5 mov esp, ebp
+ 005f9 5d pop ebp
+ 005fa c2 08 00 ret 8
+$LN375@inflate:
+
+; 771 : }
+; 772 : else if (state->head != Z_NULL)
+
+ 005fd 8b 41 20 mov eax, DWORD PTR [ecx+32]
+ 00600 85 c0 test eax, eax
+ 00602 74 07 je SHORT $LN382@inflate
+
+; 773 : state->head->name = Z_NULL;
+
+ 00604 c7 40 1c 00 00
+ 00 00 mov DWORD PTR [eax+28], 0
+$LN382@inflate:
+
+; 774 : state->length = 0;
+
+ 0060b c7 41 40 00 00
+ 00 00 mov DWORD PTR [ecx+64], 0
+
+; 775 : state->mode = COMMENT;
+
+ 00612 c7 01 07 00 00
+ 00 mov DWORD PTR [ecx], 7
+$LN383@inflate:
+
+; 776 : case COMMENT:
+; 777 : if (state->flags & 0x1000) {
+
+ 00618 f7 41 10 00 10
+ 00 00 test DWORD PTR [ecx+16], 4096 ; 00001000H
+ 0061f 0f 84 81 00 00
+ 00 je $LN384@inflate
+
+; 778 : if (have == 0) goto inf_leave;
+
+ 00625 85 db test ebx, ebx
+ 00627 0f 84 4d ff ff
+ ff je $LN886@inflate
+
+; 779 : copy = 0;
+
+ 0062d 33 d2 xor edx, edx
+ 0062f 90 npad 1
+$LL91@inflate:
+
+; 780 : do {
+; 781 : len = (unsigned)(next[copy++]);
+
+ 00630 0f b6 04 3a movzx eax, BYTE PTR [edx+edi]
+ 00634 42 inc edx
+ 00635 89 45 d8 mov DWORD PTR _len$4$[ebp], eax
+
+; 782 : if (state->head != Z_NULL &&
+; 783 : state->head->comment != Z_NULL &&
+
+ 00638 8b 41 20 mov eax, DWORD PTR [ecx+32]
+ 0063b 85 c0 test eax, eax
+ 0063d 74 23 je SHORT $LN89@inflate
+ 0063f 8b 70 24 mov esi, DWORD PTR [eax+36]
+ 00642 89 75 cc mov DWORD PTR tv2710[ebp], esi
+ 00645 85 f6 test esi, esi
+ 00647 74 19 je SHORT $LN89@inflate
+ 00649 8b 71 40 mov esi, DWORD PTR [ecx+64]
+ 0064c 3b 70 28 cmp esi, DWORD PTR [eax+40]
+ 0064f 73 11 jae SHORT $LN89@inflate
+
+; 784 : state->length < state->head->comm_max)
+; 785 : state->head->comment[state->length++] = len;
+
+ 00651 8b 5d d8 mov ebx, DWORD PTR _len$4$[ebp]
+ 00654 8b c6 mov eax, esi
+ 00656 8b 75 cc mov esi, DWORD PTR tv2710[ebp]
+ 00659 88 1c 06 mov BYTE PTR [esi+eax], bl
+ 0065c ff 41 40 inc DWORD PTR [ecx+64]
+ 0065f 8b 5d f4 mov ebx, DWORD PTR _have$1$[ebp]
+$LN89@inflate:
+
+; 786 : } while (len && copy < have);
+
+ 00662 8b 45 d8 mov eax, DWORD PTR _len$4$[ebp]
+ 00665 85 c0 test eax, eax
+ 00667 74 04 je SHORT $LN388@inflate
+ 00669 3b d3 cmp edx, ebx
+ 0066b 72 c3 jb SHORT $LL91@inflate
+$LN388@inflate:
+
+; 787 : if (state->flags & 0x0200)
+
+ 0066d f7 41 10 00 02
+ 00 00 test DWORD PTR [ecx+16], 512 ; 00000200H
+ 00674 8b 75 ec mov esi, DWORD PTR _bits$1$[ebp]
+ 00677 89 55 c8 mov DWORD PTR _copy$4$[ebp], edx
+ 0067a 74 16 je SHORT $LN389@inflate
+
+; 788 : state->check = crc32(state->check, next, copy);
+
+ 0067c 52 push edx
+ 0067d 57 push edi
+ 0067e ff 71 18 push DWORD PTR [ecx+24]
+ 00681 e8 00 00 00 00 call _crc32@12
+ 00686 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 00689 8b 55 c8 mov edx, DWORD PTR _copy$4$[ebp]
+ 0068c 89 41 18 mov DWORD PTR [ecx+24], eax
+ 0068f 8b 45 d8 mov eax, DWORD PTR _len$4$[ebp]
+$LN389@inflate:
+
+; 789 : have -= copy;
+
+ 00692 2b da sub ebx, edx
+
+; 790 : next += copy;
+
+ 00694 03 fa add edi, edx
+ 00696 89 5d f4 mov DWORD PTR _have$1$[ebp], ebx
+ 00699 89 7d f0 mov DWORD PTR _next$1$[ebp], edi
+
+; 791 : if (len) goto inf_leave;
+
+ 0069c 85 c0 test eax, eax
+ 0069e 0f 85 d6 fe ff
+ ff jne $LN886@inflate
+
+; 792 : }
+
+ 006a4 eb 0e jmp SHORT $LN391@inflate
+$LN384@inflate:
+
+; 793 : else if (state->head != Z_NULL)
+
+ 006a6 8b 41 20 mov eax, DWORD PTR [ecx+32]
+ 006a9 85 c0 test eax, eax
+ 006ab 74 07 je SHORT $LN391@inflate
+
+; 794 : state->head->comment = Z_NULL;
+
+ 006ad c7 40 24 00 00
+ 00 00 mov DWORD PTR [eax+36], 0
+$LN391@inflate:
+ 006b4 8b 55 fc mov edx, DWORD PTR _hold$1$[ebp]
+
+; 795 : state->mode = HCRC;
+
+ 006b7 c7 01 08 00 00
+ 00 mov DWORD PTR [ecx], 8
+$LN392@inflate:
+
+; 796 : case HCRC:
+; 797 : if (state->flags & 0x0200) {
+
+ 006bd f7 41 10 00 02
+ 00 00 test DWORD PTR [ecx+16], 512 ; 00000200H
+ 006c4 74 5d je SHORT $LN101@inflate
+
+; 798 : NEEDBITS(16);
+
+ 006c6 83 fe 10 cmp esi, 16 ; 00000010H
+ 006c9 73 2f jae SHORT $LN92@inflate
+ 006cb 0f 1f 44 00 00 npad 5
+$LL95@inflate:
+ 006d0 85 db test ebx, ebx
+ 006d2 0f 84 a2 fe ff
+ ff je $LN886@inflate
+ 006d8 0f b6 07 movzx eax, BYTE PTR [edi]
+ 006db 8b ce mov ecx, esi
+ 006dd d3 e0 shl eax, cl
+ 006df 83 c6 08 add esi, 8
+ 006e2 4b dec ebx
+ 006e3 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+ 006e6 03 d0 add edx, eax
+ 006e8 89 5d f4 mov DWORD PTR _have$1$[ebp], ebx
+ 006eb 47 inc edi
+ 006ec 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 006ef 89 7d f0 mov DWORD PTR _next$1$[ebp], edi
+ 006f2 83 fe 10 cmp esi, 16 ; 00000010H
+ 006f5 72 d9 jb SHORT $LL95@inflate
+ 006f7 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+$LN92@inflate:
+
+; 799 : if (hold != (state->check & 0xffff)) {
+
+ 006fa 0f b7 41 18 movzx eax, WORD PTR [ecx+24]
+ 006fe 3b d0 cmp edx, eax
+ 00700 74 15 je SHORT $LN102@inflate
+
+; 800 : strm->msg = (char *)"header crc mismatch";
+
+ 00702 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 00705 c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BE@GONKLEPM@header?5crc?5mismatch?$AA@
+ 0070c c7 01 1d 00 00
+ 00 mov DWORD PTR [ecx], 29 ; 0000001dH
+ 00712 e9 05 04 00 00 jmp $LN8@inflate
+$LN102@inflate:
+
+; 801 : state->mode = BAD;
+; 802 : break;
+; 803 : }
+; 804 : INITBITS();
+
+ 00717 33 f6 xor esi, esi
+ 00719 c7 45 fc 00 00
+ 00 00 mov DWORD PTR _hold$1$[ebp], 0
+ 00720 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+$LN101@inflate:
+
+; 805 : }
+; 806 : if (state->head != Z_NULL) {
+
+ 00723 8b 51 20 mov edx, DWORD PTR [ecx+32]
+ 00726 85 d2 test edx, edx
+ 00728 74 16 je SHORT $LN396@inflate
+
+; 807 : state->head->hcrc = (int)((state->flags >> 9) & 1);
+
+ 0072a 8b 41 10 mov eax, DWORD PTR [ecx+16]
+ 0072d c1 f8 09 sar eax, 9
+ 00730 83 e0 01 and eax, 1
+ 00733 89 42 2c mov DWORD PTR [edx+44], eax
+
+; 808 : state->head->done = 1;
+
+ 00736 8b 41 20 mov eax, DWORD PTR [ecx+32]
+ 00739 c7 40 30 01 00
+ 00 00 mov DWORD PTR [eax+48], 1
+$LN396@inflate:
+
+; 809 : }
+; 810 : strm->adler = state->check = crc32(0L, Z_NULL, 0);
+
+ 00740 6a 00 push 0
+ 00742 6a 00 push 0
+ 00744 6a 00 push 0
+ 00746 e8 00 00 00 00 call _crc32@12
+ 0074b 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 0074e 8b 55 08 mov edx, DWORD PTR _strm$[ebp]
+ 00751 89 41 18 mov DWORD PTR [ecx+24], eax
+ 00754 89 42 30 mov DWORD PTR [edx+48], eax
+
+; 811 : state->mode = TYPE;
+
+ 00757 c7 01 0b 00 00
+ 00 mov DWORD PTR [ecx], 11 ; 0000000bH
+
+; 812 : break;
+
+ 0075d e9 b7 03 00 00 jmp $LN887@inflate
+$LN105@inflate:
+
+; 813 : #endif
+; 814 : case DICTID:
+; 815 : NEEDBITS(32);
+
+ 00762 83 fe 20 cmp esi, 32 ; 00000020H
+ 00765 73 24 jae SHORT $LN103@inflate
+$LL106@inflate:
+ 00767 85 db test ebx, ebx
+ 00769 0f 84 0b fe ff
+ ff je $LN886@inflate
+ 0076f 0f b6 07 movzx eax, BYTE PTR [edi]
+ 00772 8b ce mov ecx, esi
+ 00774 d3 e0 shl eax, cl
+ 00776 4b dec ebx
+ 00777 03 d0 add edx, eax
+ 00779 89 5d f4 mov DWORD PTR _have$1$[ebp], ebx
+ 0077c 47 inc edi
+ 0077d 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 00780 83 c6 08 add esi, 8
+ 00783 89 7d f0 mov DWORD PTR _next$1$[ebp], edi
+ 00786 83 fe 20 cmp esi, 32 ; 00000020H
+ 00789 72 dc jb SHORT $LL106@inflate
+$LN103@inflate:
+
+; 816 : strm->adler = state->check = ZSWAP32(hold);
+
+ 0078b 8b ca mov ecx, edx
+ 0078d 8b c2 mov eax, edx
+ 0078f c1 e0 10 shl eax, 16 ; 00000010H
+ 00792 81 e1 00 ff 00
+ 00 and ecx, 65280 ; 0000ff00H
+ 00798 03 c8 add ecx, eax
+ 0079a 8b c2 mov eax, edx
+ 0079c c1 e8 08 shr eax, 8
+ 0079f c1 e1 08 shl ecx, 8
+ 007a2 25 00 ff 00 00 and eax, 65280 ; 0000ff00H
+ 007a7 c1 ea 18 shr edx, 24 ; 00000018H
+ 007aa 03 c1 add eax, ecx
+ 007ac 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 007af 03 c2 add eax, edx
+ 007b1 8b 55 08 mov edx, DWORD PTR _strm$[ebp]
+ 007b4 89 41 18 mov DWORD PTR [ecx+24], eax
+ 007b7 89 42 30 mov DWORD PTR [edx+48], eax
+
+; 817 : INITBITS();
+
+ 007ba 33 d2 xor edx, edx
+ 007bc 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 007bf 33 f6 xor esi, esi
+
+; 818 : state->mode = DICT;
+
+ 007c1 c7 01 0a 00 00
+ 00 mov DWORD PTR [ecx], 10 ; 0000000aH
+$LN399@inflate:
+
+; 819 : case DICT:
+; 820 : if (state->havedict == 0) {
+
+ 007c7 83 79 0c 00 cmp DWORD PTR [ecx+12], 0
+ 007cb 0f 84 53 0d 00
+ 00 je $LN585@inflate
+
+; 823 : }
+; 824 : strm->adler = state->check = adler32(0L, Z_NULL, 0);
+
+ 007d1 6a 00 push 0
+ 007d3 6a 00 push 0
+ 007d5 6a 00 push 0
+ 007d7 e8 00 00 00 00 call _adler32@12
+ 007dc 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 007df 8b 55 08 mov edx, DWORD PTR _strm$[ebp]
+ 007e2 89 41 18 mov DWORD PTR [ecx+24], eax
+ 007e5 89 42 30 mov DWORD PTR [edx+48], eax
+ 007e8 8b 55 fc mov edx, DWORD PTR _hold$1$[ebp]
+
+; 825 : state->mode = TYPE;
+
+ 007eb c7 01 0b 00 00
+ 00 mov DWORD PTR [ecx], 11 ; 0000000bH
+$LN401@inflate:
+
+; 826 : case TYPE:
+; 827 : if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave;
+
+ 007f1 8b 45 0c mov eax, DWORD PTR _flush$[ebp]
+ 007f4 83 f8 05 cmp eax, 5
+ 007f7 0f 84 7d fd ff
+ ff je $LN886@inflate
+ 007fd 83 f8 06 cmp eax, 6
+ 00800 0f 84 74 fd ff
+ ff je $LN886@inflate
+$LN402@inflate:
+
+; 828 : case TYPEDO:
+; 829 : if (state->last) {
+
+ 00806 83 79 04 00 cmp DWORD PTR [ecx+4], 0
+ 0080a 74 1d je SHORT $LN122@inflate
+
+; 830 : BYTEBITS();
+
+ 0080c 8b ce mov ecx, esi
+ 0080e 83 e1 07 and ecx, 7
+ 00811 d3 ea shr edx, cl
+ 00813 2b f1 sub esi, ecx
+
+; 831 : state->mode = CHECK;
+
+ 00815 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 00818 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 0081b 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+ 0081e c7 01 1a 00 00
+ 00 mov DWORD PTR [ecx], 26 ; 0000001aH
+
+; 832 : break;
+
+ 00824 e9 f3 02 00 00 jmp $LN8@inflate
+$LN122@inflate:
+
+; 833 : }
+; 834 : NEEDBITS(3);
+
+ 00829 83 fe 03 cmp esi, 3
+ 0082c 73 29 jae SHORT $LN120@inflate
+ 0082e 66 90 npad 2
+$LL123@inflate:
+ 00830 85 db test ebx, ebx
+ 00832 0f 84 42 fd ff
+ ff je $LN886@inflate
+ 00838 0f b6 07 movzx eax, BYTE PTR [edi]
+ 0083b 8b ce mov ecx, esi
+ 0083d d3 e0 shl eax, cl
+ 0083f 4b dec ebx
+ 00840 03 d0 add edx, eax
+ 00842 89 5d f4 mov DWORD PTR _have$1$[ebp], ebx
+ 00845 47 inc edi
+ 00846 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 00849 83 c6 08 add esi, 8
+ 0084c 89 7d f0 mov DWORD PTR _next$1$[ebp], edi
+ 0084f 83 fe 03 cmp esi, 3
+ 00852 72 dc jb SHORT $LL123@inflate
+ 00854 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+$LN120@inflate:
+
+; 835 : state->last = BITS(1);
+
+ 00857 8b c2 mov eax, edx
+
+; 836 : DROPBITS(1);
+
+ 00859 d1 ea shr edx, 1
+ 0085b 83 e0 01 and eax, 1
+ 0085e 89 41 04 mov DWORD PTR [ecx+4], eax
+
+; 837 : switch (BITS(2)) {
+
+ 00861 8b c2 mov eax, edx
+ 00863 83 e0 03 and eax, 3
+ 00866 83 f8 03 cmp eax, 3
+ 00869 77 64 ja SHORT $LN138@inflate
+ 0086b ff 24 85 00 00
+ 00 00 jmp DWORD PTR $LN936@inflate[eax*4]
+$LN407@inflate:
+
+; 861 : }
+; 862 : DROPBITS(2);
+
+ 00872 c1 ea 02 shr edx, 2
+ 00875 83 ee 03 sub esi, 3
+ 00878 c7 01 0d 00 00
+ 00 mov DWORD PTR [ecx], 13 ; 0000000dH
+ 0087e 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 00881 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+
+; 863 : break;
+
+ 00884 e9 93 02 00 00 jmp $LN8@inflate
+$LN408@inflate:
+
+; 838 : case 0: /* stored block */
+; 839 : Tracev((stderr, "inflate: stored block%s\n",
+; 840 : state->last ? " (last)" : ""));
+; 841 : state->mode = STORED;
+; 842 : break;
+; 843 : case 1: /* fixed block */
+; 844 : fixedtables(state);
+
+ 00889 e8 00 00 00 00 call _fixedtables
+
+; 845 : Tracev((stderr, "inflate: fixed codes block%s\n",
+; 846 : state->last ? " (last)" : ""));
+; 847 : state->mode = LEN_; /* decode codes */
+; 848 : if (flush == Z_TREES) {
+
+ 0088e 83 7d 0c 06 cmp DWORD PTR _flush$[ebp], 6
+ 00892 c7 01 13 00 00
+ 00 mov DWORD PTR [ecx], 19 ; 00000013H
+ 00898 75 35 jne SHORT $LN138@inflate
+
+; 849 : DROPBITS(2);
+
+ 0089a c1 ea 02 shr edx, 2
+ 0089d 83 ee 03 sub esi, 3
+ 008a0 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+
+; 850 : goto inf_leave;
+
+ 008a3 e9 d2 fc ff ff jmp $LN886@inflate
+$LN410@inflate:
+
+; 861 : }
+; 862 : DROPBITS(2);
+
+ 008a8 c1 ea 02 shr edx, 2
+ 008ab 83 ee 03 sub esi, 3
+ 008ae c7 01 10 00 00
+ 00 mov DWORD PTR [ecx], 16 ; 00000010H
+ 008b4 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 008b7 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+
+; 863 : break;
+
+ 008ba e9 5d 02 00 00 jmp $LN8@inflate
+$LN411@inflate:
+
+; 851 : }
+; 852 : break;
+; 853 : case 2: /* dynamic block */
+; 854 : Tracev((stderr, "inflate: dynamic codes block%s\n",
+; 855 : state->last ? " (last)" : ""));
+; 856 : state->mode = TABLE;
+; 857 : break;
+; 858 : case 3:
+; 859 : strm->msg = (char *)"invalid block type";
+
+ 008bf 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 008c2 c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BD@PJCBIDD@invalid?5block?5type?$AA@
+
+; 860 : state->mode = BAD;
+
+ 008c9 c7 01 1d 00 00
+ 00 mov DWORD PTR [ecx], 29 ; 0000001dH
+$LN138@inflate:
+
+; 861 : }
+; 862 : DROPBITS(2);
+
+ 008cf c1 ea 02 shr edx, 2
+ 008d2 83 ee 03 sub esi, 3
+ 008d5 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 008d8 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+
+; 863 : break;
+
+ 008db e9 3c 02 00 00 jmp $LN8@inflate
+$LN141@inflate:
+
+; 864 : case STORED:
+; 865 : BYTEBITS(); /* go to byte boundary */
+
+ 008e0 8b ce mov ecx, esi
+ 008e2 83 e1 07 and ecx, 7
+ 008e5 2b f1 sub esi, ecx
+ 008e7 d3 ea shr edx, cl
+ 008e9 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 008ec 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+
+; 866 : NEEDBITS(32);
+
+ 008ef 83 fe 20 cmp esi, 32 ; 00000020H
+ 008f2 73 27 jae SHORT $LN142@inflate
+$LL145@inflate:
+ 008f4 85 db test ebx, ebx
+ 008f6 0f 84 7e fc ff
+ ff je $LN886@inflate
+ 008fc 0f b6 07 movzx eax, BYTE PTR [edi]
+ 008ff 8b ce mov ecx, esi
+ 00901 d3 e0 shl eax, cl
+ 00903 83 c6 08 add esi, 8
+ 00906 4b dec ebx
+ 00907 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+ 0090a 03 d0 add edx, eax
+ 0090c 89 5d f4 mov DWORD PTR _have$1$[ebp], ebx
+ 0090f 47 inc edi
+ 00910 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 00913 89 7d f0 mov DWORD PTR _next$1$[ebp], edi
+ 00916 83 fe 20 cmp esi, 32 ; 00000020H
+ 00919 72 d9 jb SHORT $LL145@inflate
+$LN142@inflate:
+
+; 867 : if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
+
+ 0091b 8b c2 mov eax, edx
+ 0091d 0f b7 ca movzx ecx, dx
+ 00920 f7 d0 not eax
+ 00922 89 4d c8 mov DWORD PTR tv2704[ebp], ecx
+ 00925 c1 e8 10 shr eax, 16 ; 00000010H
+ 00928 3b c8 cmp ecx, eax
+
+; 869 : state->mode = BAD;
+
+ 0092a 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 0092d 74 15 je SHORT $LN414@inflate
+
+; 868 : strm->msg = (char *)"invalid stored block lengths";
+
+ 0092f 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 00932 c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BN@LGAADGOK@invalid?5stored?5block?5lengths?$AA@
+ 00939 c7 01 1d 00 00
+ 00 mov DWORD PTR [ecx], 29 ; 0000001dH
+ 0093f e9 d8 01 00 00 jmp $LN8@inflate
+$LN414@inflate:
+
+; 870 : break;
+; 871 : }
+; 872 : state->length = (unsigned)hold & 0xffff;
+
+ 00944 8b 45 c8 mov eax, DWORD PTR tv2704[ebp]
+
+; 873 : Tracev((stderr, "inflate: stored length %u\n",
+; 874 : state->length));
+; 875 : INITBITS();
+
+ 00947 33 d2 xor edx, edx
+ 00949 33 f6 xor esi, esi
+ 0094b 89 41 40 mov DWORD PTR [ecx+64], eax
+
+; 876 : state->mode = COPY_;
+; 877 : if (flush == Z_TREES) goto inf_leave;
+
+ 0094e 83 7d 0c 06 cmp DWORD PTR _flush$[ebp], 6
+ 00952 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 00955 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+ 00958 c7 01 0e 00 00
+ 00 mov DWORD PTR [ecx], 14 ; 0000000eH
+ 0095e 0f 84 16 fc ff
+ ff je $LN886@inflate
+$LN415@inflate:
+
+; 878 : case COPY_:
+; 879 : state->mode = COPY;
+
+ 00964 c7 01 0f 00 00
+ 00 mov DWORD PTR [ecx], 15 ; 0000000fH
+$LN417@inflate:
+
+; 880 : case COPY:
+; 881 : copy = state->length;
+
+ 0096a 8b 41 40 mov eax, DWORD PTR [ecx+64]
+
+; 882 : if (copy) {
+
+ 0096d 85 c0 test eax, eax
+ 0096f 0f 84 ee 06 00
+ 00 je $LN418@inflate
+
+; 883 : if (copy > have) copy = have;
+
+ 00975 3b c3 cmp eax, ebx
+ 00977 0f 47 c3 cmova eax, ebx
+
+; 884 : if (copy > left) copy = left;
+
+ 0097a 3b 45 e8 cmp eax, DWORD PTR _left$1$[ebp]
+ 0097d 0f 47 45 e8 cmova eax, DWORD PTR _left$1$[ebp]
+ 00981 89 45 c8 mov DWORD PTR _copy$7$[ebp], eax
+
+; 885 : if (copy == 0) goto inf_leave;
+
+ 00984 85 c0 test eax, eax
+ 00986 0f 84 ee fb ff
+ ff je $LN886@inflate
+
+; 886 : zmemcpy(put, next, copy);
+
+ 0098c 50 push eax
+ 0098d 57 push edi
+ 0098e ff 75 e0 push DWORD PTR _put$1$[ebp]
+ 00991 e8 00 00 00 00 call _memcpy
+
+; 887 : have -= copy;
+
+ 00996 8b 45 c8 mov eax, DWORD PTR _copy$7$[ebp]
+ 00999 83 c4 0c add esp, 12 ; 0000000cH
+
+; 888 : next += copy;
+; 889 : left -= copy;
+; 890 : put += copy;
+; 891 : state->length -= copy;
+
+ 0099c 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 0099f 2b d8 sub ebx, eax
+ 009a1 29 45 e8 sub DWORD PTR _left$1$[ebp], eax
+ 009a4 03 f8 add edi, eax
+ 009a6 01 45 e0 add DWORD PTR _put$1$[ebp], eax
+ 009a9 89 5d f4 mov DWORD PTR _have$1$[ebp], ebx
+ 009ac 29 41 40 sub DWORD PTR [ecx+64], eax
+ 009af 89 7d f0 mov DWORD PTR _next$1$[ebp], edi
+
+; 892 : break;
+
+ 009b2 e9 62 01 00 00 jmp $LN887@inflate
+$LN155@inflate:
+
+; 893 : }
+; 894 : Tracev((stderr, "inflate: stored end\n"));
+; 895 : state->mode = TYPE;
+; 896 : break;
+; 897 : case TABLE:
+; 898 : NEEDBITS(14);
+
+ 009b7 83 fe 0e cmp esi, 14 ; 0000000eH
+ 009ba 73 2b jae SHORT $LN153@inflate
+ 009bc 0f 1f 40 00 npad 4
+$LL156@inflate:
+ 009c0 85 db test ebx, ebx
+ 009c2 0f 84 b2 fb ff
+ ff je $LN886@inflate
+ 009c8 0f b6 07 movzx eax, BYTE PTR [edi]
+ 009cb 8b ce mov ecx, esi
+ 009cd d3 e0 shl eax, cl
+ 009cf 4b dec ebx
+ 009d0 03 d0 add edx, eax
+ 009d2 89 5d f4 mov DWORD PTR _have$1$[ebp], ebx
+ 009d5 47 inc edi
+ 009d6 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 009d9 83 c6 08 add esi, 8
+ 009dc 89 7d f0 mov DWORD PTR _next$1$[ebp], edi
+ 009df 83 fe 0e cmp esi, 14 ; 0000000eH
+ 009e2 72 dc jb SHORT $LL156@inflate
+ 009e4 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+$LN153@inflate:
+
+; 899 : state->nlen = BITS(5) + 257;
+
+ 009e7 8b c2 mov eax, edx
+
+; 900 : DROPBITS(5);
+; 901 : state->ndist = BITS(5) + 1;
+; 902 : DROPBITS(5);
+; 903 : state->ncode = BITS(4) + 4;
+; 904 : DROPBITS(4);
+
+ 009e9 83 ee 0e sub esi, 14 ; 0000000eH
+ 009ec 83 e0 1f and eax, 31 ; 0000001fH
+ 009ef c1 ea 05 shr edx, 5
+ 009f2 05 01 01 00 00 add eax, 257 ; 00000101H
+ 009f7 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+ 009fa 89 41 60 mov DWORD PTR [ecx+96], eax
+ 009fd 8b c2 mov eax, edx
+ 009ff 83 e0 1f and eax, 31 ; 0000001fH
+ 00a02 c1 ea 05 shr edx, 5
+ 00a05 40 inc eax
+ 00a06 89 41 64 mov DWORD PTR [ecx+100], eax
+ 00a09 8b c2 mov eax, edx
+ 00a0b 83 e0 0f and eax, 15 ; 0000000fH
+ 00a0e c1 ea 04 shr edx, 4
+ 00a11 83 c0 04 add eax, 4
+ 00a14 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+
+; 905 : #ifndef PKZIP_BUG_WORKAROUND
+; 906 : if (state->nlen > 286 || state->ndist > 30) {
+
+ 00a17 81 79 60 1e 01
+ 00 00 cmp DWORD PTR [ecx+96], 286 ; 0000011eH
+ 00a1e 89 41 5c mov DWORD PTR [ecx+92], eax
+ 00a21 0f 87 0e 01 00
+ 00 ja $LN425@inflate
+ 00a27 83 79 64 1e cmp DWORD PTR [ecx+100], 30 ; 0000001eH
+ 00a2b 0f 87 04 01 00
+ 00 ja $LN425@inflate
+
+; 908 : state->mode = BAD;
+; 909 : break;
+; 910 : }
+; 911 : #endif
+; 912 : Tracev((stderr, "inflate: table sizes ok\n"));
+; 913 : state->have = 0;
+
+ 00a31 c7 41 68 00 00
+ 00 00 mov DWORD PTR [ecx+104], 0
+
+; 914 : state->mode = LENLENS;
+
+ 00a38 c7 01 11 00 00
+ 00 mov DWORD PTR [ecx], 17 ; 00000011H
+$LN531@inflate:
+
+; 915 : case LENLENS:
+; 916 : while (state->have < state->ncode) {
+
+ 00a3e 8b 41 68 mov eax, DWORD PTR [ecx+104]
+ 00a41 3b 41 5c cmp eax, DWORD PTR [ecx+92]
+ 00a44 73 65 jae SHORT $LN533@inflate
+$LL170@inflate:
+
+; 917 : NEEDBITS(3);
+
+ 00a46 83 fe 03 cmp esi, 3
+ 00a49 73 29 jae SHORT $LN172@inflate
+ 00a4b 0f 1f 44 00 00 npad 5
+$LL175@inflate:
+ 00a50 85 db test ebx, ebx
+ 00a52 0f 84 22 fb ff
+ ff je $LN886@inflate
+ 00a58 0f b6 07 movzx eax, BYTE PTR [edi]
+ 00a5b 8b ce mov ecx, esi
+ 00a5d d3 e0 shl eax, cl
+ 00a5f 4b dec ebx
+ 00a60 03 d0 add edx, eax
+ 00a62 89 5d f4 mov DWORD PTR _have$1$[ebp], ebx
+ 00a65 47 inc edi
+ 00a66 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 00a69 83 c6 08 add esi, 8
+ 00a6c 89 7d f0 mov DWORD PTR _next$1$[ebp], edi
+ 00a6f 83 fe 03 cmp esi, 3
+ 00a72 72 dc jb SHORT $LL175@inflate
+$LN172@inflate:
+
+; 918 : state->lens[order[state->have++]] = (unsigned short)BITS(3);
+
+ 00a74 8b 45 f8 mov eax, DWORD PTR _state$1$[ebp]
+ 00a77 8b ca mov ecx, edx
+ 00a79 8b 7d f8 mov edi, DWORD PTR _state$1$[ebp]
+ 00a7c 83 e1 07 and ecx, 7
+
+; 919 : DROPBITS(3);
+
+ 00a7f c1 ea 03 shr edx, 3
+ 00a82 83 ee 03 sub esi, 3
+ 00a85 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 00a88 8b 40 68 mov eax, DWORD PTR [eax+104]
+ 00a8b 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+ 00a8e 0f b7 04 45 00
+ 00 00 00 movzx eax, WORD PTR ?order@?1??inflate@@9@9[eax*2]
+ 00a96 66 89 4c 47 70 mov WORD PTR [edi+eax*2+112], cx
+ 00a9b 8b cf mov ecx, edi
+ 00a9d 8b 7d f0 mov edi, DWORD PTR _next$1$[ebp]
+ 00aa0 ff 41 68 inc DWORD PTR [ecx+104]
+ 00aa3 8b 41 68 mov eax, DWORD PTR [ecx+104]
+ 00aa6 3b 41 5c cmp eax, DWORD PTR [ecx+92]
+ 00aa9 72 9b jb SHORT $LL170@inflate
+$LN533@inflate:
+
+; 920 : }
+; 921 : while (state->have < 19)
+
+ 00aab 83 79 68 13 cmp DWORD PTR [ecx+104], 19 ; 00000013H
+ 00aaf 73 1b jae SHORT $LN184@inflate
+$LL183@inflate:
+
+; 922 : state->lens[order[state->have++]] = 0;
+
+ 00ab1 8b 41 68 mov eax, DWORD PTR [ecx+104]
+ 00ab4 33 d2 xor edx, edx
+ 00ab6 0f b7 04 45 00
+ 00 00 00 movzx eax, WORD PTR ?order@?1??inflate@@9@9[eax*2]
+ 00abe 66 89 54 41 70 mov WORD PTR [ecx+eax*2+112], dx
+ 00ac3 ff 41 68 inc DWORD PTR [ecx+104]
+ 00ac6 83 79 68 13 cmp DWORD PTR [ecx+104], 19 ; 00000013H
+ 00aca 72 e5 jb SHORT $LL183@inflate
+$LN184@inflate:
+
+; 923 : state->next = state->codes;
+; 924 : state->lencode = (const code FAR *)(state->next);
+
+ 00acc 8b 55 f8 mov edx, DWORD PTR _state$1$[ebp]
+ 00acf 8d 81 30 05 00
+ 00 lea eax, DWORD PTR [ecx+1328]
+ 00ad5 83 c1 6c add ecx, 108 ; 0000006cH
+ 00ad8 89 42 4c mov DWORD PTR [edx+76], eax
+ 00adb 89 01 mov DWORD PTR [ecx], eax
+
+; 925 : state->lenbits = 7;
+; 926 : ret = inflate_table(CODES, state->lens, 19, &(state->next),
+
+ 00add 8d 82 f0 02 00
+ 00 lea eax, DWORD PTR [edx+752]
+ 00ae3 50 push eax
+ 00ae4 8d 42 54 lea eax, DWORD PTR [edx+84]
+ 00ae7 c7 42 54 07 00
+ 00 00 mov DWORD PTR [edx+84], 7
+ 00aee 50 push eax
+ 00aef 51 push ecx
+ 00af0 6a 13 push 19 ; 00000013H
+ 00af2 83 c2 70 add edx, 112 ; 00000070H
+ 00af5 33 c9 xor ecx, ecx
+ 00af7 e8 00 00 00 00 call _inflate_table
+
+; 930 : state->mode = BAD;
+
+ 00afc 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 00aff 83 c4 10 add esp, 16 ; 00000010H
+ 00b02 89 45 d4 mov DWORD PTR _ret$1$[ebp], eax
+ 00b05 85 c0 test eax, eax
+ 00b07 74 3e je SHORT $LN428@inflate
+
+; 927 : &(state->lenbits), state->work);
+; 928 : if (ret) {
+; 929 : strm->msg = (char *)"invalid code lengths set";
+
+ 00b09 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 00b0c c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BJ@HDEPPGOH@invalid?5code?5lengths?5set?$AA@
+$LN931@inflate:
+
+; 990 : state->mode = BAD;
+
+ 00b13 c7 01 1d 00 00
+ 00 mov DWORD PTR [ecx], 29 ; 0000001dH
+$LN887@inflate:
+ 00b19 8b 55 fc mov edx, DWORD PTR _hold$1$[ebp]
+$LN8@inflate:
+
+; 638 : for (;;)
+; 639 : switch (state->mode) {
+
+ 00b1c 8b 01 mov eax, DWORD PTR [ecx]
+ 00b1e 83 f8 1e cmp eax, 30 ; 0000001eH
+ 00b21 0f 86 6a f5 ff
+ ff jbe $LL5@inflate
+$LN498@inflate:
+ 00b27 5f pop edi
+ 00b28 5e pop esi
+
+; 1216 : goto inf_leave;
+; 1217 : case MEM:
+; 1218 : return Z_MEM_ERROR;
+; 1219 : case SYNC:
+; 1220 : default:
+; 1221 : return Z_STREAM_ERROR;
+
+ 00b29 b8 fe ff ff ff mov eax, -2 ; fffffffeH
+ 00b2e 5b pop ebx
+
+; 1250 : ret = Z_BUF_ERROR;
+; 1251 : return ret;
+; 1252 : }
+
+ 00b2f 8b e5 mov esp, ebp
+ 00b31 5d pop ebp
+ 00b32 c2 08 00 ret 8
+$LN425@inflate:
+
+; 907 : strm->msg = (char *)"too many length or distance symbols";
+
+ 00b35 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 00b38 c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0CE@GMIGFPBB@too?5many?5length?5or?5distance?5symb@
+ 00b3f c7 01 1d 00 00
+ 00 mov DWORD PTR [ecx], 29 ; 0000001dH
+ 00b45 eb d5 jmp SHORT $LN8@inflate
+$LN428@inflate:
+
+; 931 : break;
+; 932 : }
+; 933 : Tracev((stderr, "inflate: code lengths ok\n"));
+; 934 : state->have = 0;
+
+ 00b47 c7 41 68 00 00
+ 00 00 mov DWORD PTR [ecx+104], 0
+
+; 935 : state->mode = CODELENS;
+
+ 00b4e c7 01 12 00 00
+ 00 mov DWORD PTR [ecx], 18 ; 00000012H
+$LN534@inflate:
+
+; 936 : case CODELENS:
+; 937 : while (state->have < state->nlen + state->ndist) {
+
+ 00b54 8b 41 64 mov eax, DWORD PTR [ecx+100]
+ 00b57 8b 51 68 mov edx, DWORD PTR [ecx+104]
+ 00b5a 03 41 60 add eax, DWORD PTR [ecx+96]
+ 00b5d 89 55 d8 mov DWORD PTR tv2696[ebp], edx
+ 00b60 3b d0 cmp edx, eax
+ 00b62 0f 83 12 02 00
+ 00 jae $LN186@inflate
+ 00b68 0f 1f 84 00 00
+ 00 00 00 npad 8
+$LL185@inflate:
+
+; 938 : for (;;) {
+; 939 : here = state->lencode[BITS(state->lenbits)];
+
+ 00b70 8b 45 d0 mov eax, DWORD PTR tv2779[ebp]
+ 00b73 ba 01 00 00 00 mov edx, 1
+ 00b78 8b 08 mov ecx, DWORD PTR [eax]
+ 00b7a 8b 45 f8 mov eax, DWORD PTR _state$1$[ebp]
+ 00b7d d3 e2 shl edx, cl
+ 00b7f 4a dec edx
+ 00b80 23 55 fc and edx, DWORD PTR _hold$1$[ebp]
+ 00b83 8b 40 4c mov eax, DWORD PTR [eax+76]
+ 00b86 8b 04 90 mov eax, DWORD PTR [eax+edx*4]
+
+; 940 : if ((unsigned)(here.bits) <= bits) break;
+
+ 00b89 8b c8 mov ecx, eax
+ 00b8b c1 e9 08 shr ecx, 8
+ 00b8e 0f b6 c9 movzx ecx, cl
+ 00b91 89 45 c8 mov DWORD PTR _here$[ebp], eax
+ 00b94 3b ce cmp ecx, esi
+ 00b96 76 45 jbe SHORT $LN561@inflate
+$LL187@inflate:
+
+; 941 : PULLBYTE();
+
+ 00b98 85 db test ebx, ebx
+ 00b9a 0f 84 da f9 ff
+ ff je $LN886@inflate
+ 00ba0 0f b6 07 movzx eax, BYTE PTR [edi]
+ 00ba3 8b ce mov ecx, esi
+ 00ba5 d3 e0 shl eax, cl
+ 00ba7 ba 01 00 00 00 mov edx, 1
+ 00bac 01 45 fc add DWORD PTR _hold$1$[ebp], eax
+ 00baf 4b dec ebx
+ 00bb0 8b 45 d0 mov eax, DWORD PTR tv2779[ebp]
+ 00bb3 47 inc edi
+ 00bb4 83 c6 08 add esi, 8
+ 00bb7 89 5d f4 mov DWORD PTR _have$1$[ebp], ebx
+ 00bba 89 7d f0 mov DWORD PTR _next$1$[ebp], edi
+ 00bbd 8b 08 mov ecx, DWORD PTR [eax]
+ 00bbf 8b 45 f8 mov eax, DWORD PTR _state$1$[ebp]
+ 00bc2 d3 e2 shl edx, cl
+ 00bc4 4a dec edx
+ 00bc5 23 55 fc and edx, DWORD PTR _hold$1$[ebp]
+ 00bc8 8b 40 4c mov eax, DWORD PTR [eax+76]
+ 00bcb 8b 04 90 mov eax, DWORD PTR [eax+edx*4]
+ 00bce 8b c8 mov ecx, eax
+ 00bd0 c1 e9 08 shr ecx, 8
+ 00bd3 0f b6 c9 movzx ecx, cl
+ 00bd6 89 45 c8 mov DWORD PTR _here$[ebp], eax
+ 00bd9 3b ce cmp ecx, esi
+ 00bdb 77 bb ja SHORT $LL187@inflate
+$LN561@inflate:
+
+; 942 : }
+; 943 : if (here.val < 16) {
+
+ 00bdd 8b d0 mov edx, eax
+ 00bdf c1 ea 10 shr edx, 16 ; 00000010H
+ 00be2 66 83 fa 10 cmp dx, 16 ; 00000010H
+ 00be6 73 21 jae SHORT $LN928@inflate
+
+; 944 : DROPBITS(here.bits);
+
+ 00be8 c1 e8 08 shr eax, 8
+ 00beb 0f b6 c8 movzx ecx, al
+ 00bee d3 6d fc shr DWORD PTR _hold$1$[ebp], cl
+ 00bf1 2b f1 sub esi, ecx
+
+; 945 : state->lens[state->have++] = here.val;
+
+ 00bf3 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 00bf6 8b 45 d8 mov eax, DWORD PTR tv2696[ebp]
+ 00bf9 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+ 00bfc 66 89 54 41 70 mov WORD PTR [ecx+eax*2+112], dx
+ 00c01 ff 41 68 inc DWORD PTR [ecx+104]
+
+; 946 : }
+
+ 00c04 e9 5d 01 00 00 jmp $LN609@inflate
+$LN928@inflate:
+
+; 947 : else {
+; 948 : if (here.val == 16) {
+
+ 00c09 75 70 jne SHORT $LN434@inflate
+
+; 949 : NEEDBITS(here.bits + 2);
+
+ 00c0b 8b c8 mov ecx, eax
+ 00c0d c1 e9 08 shr ecx, 8
+ 00c10 0f b6 c9 movzx ecx, cl
+ 00c13 83 c1 02 add ecx, 2
+ 00c16 89 4d c8 mov DWORD PTR $T1[ebp], ecx
+ 00c19 3b f1 cmp esi, ecx
+ 00c1b 73 25 jae SHORT $LN196@inflate
+ 00c1d 0f 1f 00 npad 3
+$LL199@inflate:
+ 00c20 85 db test ebx, ebx
+ 00c22 0f 84 52 f9 ff
+ ff je $LN886@inflate
+ 00c28 0f b6 17 movzx edx, BYTE PTR [edi]
+ 00c2b 8b ce mov ecx, esi
+ 00c2d d3 e2 shl edx, cl
+ 00c2f 4b dec ebx
+ 00c30 01 55 fc add DWORD PTR _hold$1$[ebp], edx
+ 00c33 47 inc edi
+ 00c34 83 c6 08 add esi, 8
+ 00c37 89 5d f4 mov DWORD PTR _have$1$[ebp], ebx
+ 00c3a 89 7d f0 mov DWORD PTR _next$1$[ebp], edi
+ 00c3d 3b 75 c8 cmp esi, DWORD PTR $T1[ebp]
+ 00c40 72 de jb SHORT $LL199@inflate
+$LN196@inflate:
+
+; 950 : DROPBITS(here.bits);
+
+ 00c42 8b 55 fc mov edx, DWORD PTR _hold$1$[ebp]
+ 00c45 0f b6 cc movzx ecx, ah
+
+; 951 : if (state->have == 0) {
+
+ 00c48 8b 45 d8 mov eax, DWORD PTR tv2696[ebp]
+ 00c4b 2b f1 sub esi, ecx
+ 00c4d d3 ea shr edx, cl
+
+; 953 : state->mode = BAD;
+; 954 : break;
+; 955 : }
+; 956 : len = state->lens[state->have - 1];
+
+ 00c4f 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 00c52 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 00c55 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+ 00c58 85 c0 test eax, eax
+ 00c5a 0f 84 3c 01 00
+ 00 je $LN566@inflate
+ 00c60 0f b7 44 41 6e movzx eax, WORD PTR [ecx+eax*2+110]
+
+; 957 : copy = 3 + BITS(2);
+
+ 00c65 8b ca mov ecx, edx
+ 00c67 83 e1 03 and ecx, 3
+
+; 958 : DROPBITS(2);
+
+ 00c6a c1 ea 02 shr edx, 2
+ 00c6d 83 c1 03 add ecx, 3
+ 00c70 89 45 c8 mov DWORD PTR _len$5$[ebp], eax
+ 00c73 83 ee 02 sub esi, 2
+
+; 959 : }
+
+ 00c76 e9 ac 00 00 00 jmp $LN929@inflate
+$LN434@inflate:
+
+; 960 : else if (here.val == 17) {
+
+ 00c7b 66 83 7d ca 11 cmp WORD PTR _here$[ebp+2], 17 ; 00000011H
+ 00c80 8b 55 fc mov edx, DWORD PTR _hold$1$[ebp]
+
+; 961 : NEEDBITS(here.bits + 3);
+
+ 00c83 0f b6 cc movzx ecx, ah
+ 00c86 75 4a jne SHORT $LN226@inflate
+ 00c88 8d 41 03 lea eax, DWORD PTR [ecx+3]
+ 00c8b 89 4d ec mov DWORD PTR tv2678[ebp], ecx
+ 00c8e 3b f0 cmp esi, eax
+ 00c90 73 29 jae SHORT $LN210@inflate
+$LL213@inflate:
+ 00c92 85 db test ebx, ebx
+ 00c94 0f 84 e0 f8 ff
+ ff je $LN886@inflate
+ 00c9a 0f b6 07 movzx eax, BYTE PTR [edi]
+ 00c9d 8b ce mov ecx, esi
+ 00c9f d3 e0 shl eax, cl
+ 00ca1 4b dec ebx
+ 00ca2 8b 4d ec mov ecx, DWORD PTR tv2678[ebp]
+ 00ca5 03 d0 add edx, eax
+ 00ca7 47 inc edi
+ 00ca8 89 5d f4 mov DWORD PTR _have$1$[ebp], ebx
+ 00cab 83 c6 08 add esi, 8
+ 00cae 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 00cb1 89 7d f0 mov DWORD PTR _next$1$[ebp], edi
+ 00cb4 8d 41 03 lea eax, DWORD PTR [ecx+3]
+ 00cb7 3b f0 cmp esi, eax
+ 00cb9 72 d7 jb SHORT $LL213@inflate
+$LN210@inflate:
+
+; 962 : DROPBITS(here.bits);
+
+ 00cbb d3 ea shr edx, cl
+
+; 963 : len = 0;
+; 964 : copy = 3 + BITS(3);
+; 965 : DROPBITS(3);
+
+ 00cbd b8 fd ff ff ff mov eax, -3 ; fffffffdH
+ 00cc2 8b ca mov ecx, edx
+ 00cc4 c1 ea 03 shr edx, 3
+ 00cc7 83 e1 07 and ecx, 7
+ 00cca 83 c1 03 add ecx, 3
+ 00ccd 2b 45 ec sub eax, DWORD PTR tv2678[ebp]
+
+; 966 : }
+
+ 00cd0 eb 4c jmp SHORT $LN930@inflate
+$LN226@inflate:
+
+; 967 : else {
+; 968 : NEEDBITS(here.bits + 7);
+
+ 00cd2 8d 41 07 lea eax, DWORD PTR [ecx+7]
+ 00cd5 89 4d ec mov DWORD PTR tv2677[ebp], ecx
+ 00cd8 3b f0 cmp esi, eax
+ 00cda 73 2d jae SHORT $LN224@inflate
+ 00cdc 0f 1f 40 00 npad 4
+$LL227@inflate:
+ 00ce0 85 db test ebx, ebx
+ 00ce2 0f 84 92 f8 ff
+ ff je $LN886@inflate
+ 00ce8 0f b6 07 movzx eax, BYTE PTR [edi]
+ 00ceb 8b ce mov ecx, esi
+ 00ced d3 e0 shl eax, cl
+ 00cef 4b dec ebx
+ 00cf0 8b 4d ec mov ecx, DWORD PTR tv2677[ebp]
+ 00cf3 03 d0 add edx, eax
+ 00cf5 47 inc edi
+ 00cf6 89 5d f4 mov DWORD PTR _have$1$[ebp], ebx
+ 00cf9 83 c6 08 add esi, 8
+ 00cfc 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 00cff 89 7d f0 mov DWORD PTR _next$1$[ebp], edi
+ 00d02 8d 41 07 lea eax, DWORD PTR [ecx+7]
+ 00d05 3b f0 cmp esi, eax
+ 00d07 72 d7 jb SHORT $LL227@inflate
+$LN224@inflate:
+
+; 969 : DROPBITS(here.bits);
+
+ 00d09 d3 ea shr edx, cl
+
+; 970 : len = 0;
+; 971 : copy = 11 + BITS(7);
+; 972 : DROPBITS(7);
+
+ 00d0b b8 f9 ff ff ff mov eax, -7 ; fffffff9H
+ 00d10 8b ca mov ecx, edx
+ 00d12 c1 ea 07 shr edx, 7
+ 00d15 83 e1 7f and ecx, 127 ; 0000007fH
+ 00d18 83 c1 0b add ecx, 11 ; 0000000bH
+ 00d1b 2b 45 ec sub eax, DWORD PTR tv2677[ebp]
+$LN930@inflate:
+ 00d1e 03 f0 add esi, eax
+ 00d20 c7 45 c8 00 00
+ 00 00 mov DWORD PTR _len$5$[ebp], 0
+$LN929@inflate:
+
+; 973 : }
+; 974 : if (state->have + copy > state->nlen + state->ndist) {
+
+ 00d27 8b 45 f8 mov eax, DWORD PTR _state$1$[ebp]
+ 00d2a 8b 7d f8 mov edi, DWORD PTR _state$1$[ebp]
+ 00d2d 89 4d cc mov DWORD PTR _copy$8$[ebp], ecx
+ 00d30 03 4d d8 add ecx, DWORD PTR tv2696[ebp]
+ 00d33 8b 40 64 mov eax, DWORD PTR [eax+100]
+ 00d36 03 47 60 add eax, DWORD PTR [edi+96]
+ 00d39 8b 7d f0 mov edi, DWORD PTR _next$1$[ebp]
+ 00d3c 3b c8 cmp ecx, eax
+ 00d3e 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 00d41 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 00d44 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+ 00d47 77 53 ja SHORT $LN566@inflate
+
+; 975 : strm->msg = (char *)"invalid bit length repeat";
+; 976 : state->mode = BAD;
+; 977 : break;
+; 978 : }
+; 979 : while (copy--)
+
+ 00d49 8b 55 cc mov edx, DWORD PTR _copy$8$[ebp]
+ 00d4c 85 d2 test edx, edx
+ 00d4e 74 16 je SHORT $LN609@inflate
+ 00d50 8b 5d c8 mov ebx, DWORD PTR _len$5$[ebp]
+$LL238@inflate:
+
+; 980 : state->lens[state->have++] = (unsigned short)len;
+
+ 00d53 8b 41 68 mov eax, DWORD PTR [ecx+104]
+ 00d56 66 89 5c 41 70 mov WORD PTR [ecx+eax*2+112], bx
+ 00d5b ff 41 68 inc DWORD PTR [ecx+104]
+ 00d5e 83 ea 01 sub edx, 1
+ 00d61 75 f0 jne SHORT $LL238@inflate
+ 00d63 8b 5d f4 mov ebx, DWORD PTR _have$1$[ebp]
+$LN609@inflate:
+
+; 936 : case CODELENS:
+; 937 : while (state->have < state->nlen + state->ndist) {
+
+ 00d66 8b 41 64 mov eax, DWORD PTR [ecx+100]
+ 00d69 8b 51 68 mov edx, DWORD PTR [ecx+104]
+ 00d6c 03 41 60 add eax, DWORD PTR [ecx+96]
+ 00d6f 89 55 d8 mov DWORD PTR tv2696[ebp], edx
+ 00d72 3b d0 cmp edx, eax
+ 00d74 0f 82 f6 fd ff
+ ff jb $LL185@inflate
+$LN186@inflate:
+
+; 981 : }
+; 982 : }
+; 983 :
+; 984 : /* handle error breaks in while */
+; 985 : if (state->mode == BAD) break;
+
+ 00d7a 83 39 1d cmp DWORD PTR [ecx], 29 ; 0000001dH
+ 00d7d 0f 84 96 fd ff
+ ff je $LN887@inflate
+
+; 986 :
+; 987 : /* check for end-of-block code (better have one) */
+; 988 : if (state->lens[256] == 0) {
+
+ 00d83 66 83 b9 70 02
+ 00 00 00 cmp WORD PTR [ecx+624], 0
+ 00d8b 75 24 jne SHORT $LN444@inflate
+
+; 989 : strm->msg = (char *)"invalid code -- missing end-of-block";
+
+ 00d8d 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 00d90 c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0CF@DGDMADCD@invalid?5code?5?9?9?5missing?5end?9of?9b@
+
+; 991 : break;
+
+ 00d97 e9 77 fd ff ff jmp $LN931@inflate
+$LN566@inflate:
+
+; 952 : strm->msg = (char *)"invalid bit length repeat";
+
+ 00d9c 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 00d9f c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BK@BMMPFBBH@invalid?5bit?5length?5repeat?$AA@
+ 00da6 c7 01 1d 00 00
+ 00 mov DWORD PTR [ecx], 29 ; 0000001dH
+ 00dac e9 6b fd ff ff jmp $LN8@inflate
+$LN444@inflate:
+
+; 992 : }
+; 993 :
+; 994 : /* build code tables -- note: do not change the lenbits or distbits
+; 995 : values here (9 and 6) without reading the comments in inftrees.h
+; 996 : concerning the ENOUGH constants, which depend on those values */
+; 997 : state->next = state->codes;
+
+ 00db1 8d 51 6c lea edx, DWORD PTR [ecx+108]
+
+; 998 : state->lencode = (const code FAR *)(state->next);
+; 999 : state->lenbits = 9;
+
+ 00db4 c7 41 54 09 00
+ 00 00 mov DWORD PTR [ecx+84], 9
+ 00dbb 8d 81 30 05 00
+ 00 lea eax, DWORD PTR [ecx+1328]
+ 00dc1 89 55 c8 mov DWORD PTR tv2690[ebp], edx
+ 00dc4 89 02 mov DWORD PTR [edx], eax
+ 00dc6 89 41 4c mov DWORD PTR [ecx+76], eax
+
+; 1000 : ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
+
+ 00dc9 8d 81 f0 02 00
+ 00 lea eax, DWORD PTR [ecx+752]
+ 00dcf 50 push eax
+ 00dd0 8d 41 54 lea eax, DWORD PTR [ecx+84]
+ 00dd3 50 push eax
+ 00dd4 52 push edx
+ 00dd5 ff 71 60 push DWORD PTR [ecx+96]
+ 00dd8 8d 51 70 lea edx, DWORD PTR [ecx+112]
+ 00ddb b9 01 00 00 00 mov ecx, 1
+ 00de0 e8 00 00 00 00 call _inflate_table
+
+; 1004 : state->mode = BAD;
+
+ 00de5 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 00de8 83 c4 10 add esp, 16 ; 00000010H
+ 00deb 89 45 d4 mov DWORD PTR _ret$1$[ebp], eax
+ 00dee 85 c0 test eax, eax
+ 00df0 74 0f je SHORT $LN445@inflate
+
+; 1001 : &(state->lenbits), state->work);
+; 1002 : if (ret) {
+; 1003 : strm->msg = (char *)"invalid literal/lengths set";
+
+ 00df2 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 00df5 c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BM@IIMGAINC@invalid?5literal?1lengths?5set?$AA@
+
+; 1005 : break;
+
+ 00dfc e9 12 fd ff ff jmp $LN931@inflate
+$LN445@inflate:
+
+; 1006 : }
+; 1007 : state->distcode = (const code FAR *)(state->next);
+
+ 00e01 8b 55 c8 mov edx, DWORD PTR tv2690[ebp]
+
+; 1008 : state->distbits = 6;
+
+ 00e04 c7 41 58 06 00
+ 00 00 mov DWORD PTR [ecx+88], 6
+ 00e0b 8b 02 mov eax, DWORD PTR [edx]
+ 00e0d 89 41 50 mov DWORD PTR [ecx+80], eax
+
+; 1009 : ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
+
+ 00e10 8d 81 f0 02 00
+ 00 lea eax, DWORD PTR [ecx+752]
+ 00e16 50 push eax
+ 00e17 8d 41 58 lea eax, DWORD PTR [ecx+88]
+ 00e1a 50 push eax
+ 00e1b 8b 41 60 mov eax, DWORD PTR [ecx+96]
+ 00e1e 52 push edx
+ 00e1f ff 71 64 push DWORD PTR [ecx+100]
+ 00e22 83 c1 70 add ecx, 112 ; 00000070H
+ 00e25 8d 14 41 lea edx, DWORD PTR [ecx+eax*2]
+ 00e28 b9 02 00 00 00 mov ecx, 2
+ 00e2d e8 00 00 00 00 call _inflate_table
+
+; 1013 : state->mode = BAD;
+
+ 00e32 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 00e35 83 c4 10 add esp, 16 ; 00000010H
+ 00e38 89 45 d4 mov DWORD PTR _ret$1$[ebp], eax
+ 00e3b 85 c0 test eax, eax
+ 00e3d 74 0f je SHORT $LN446@inflate
+
+; 1010 : &(state->next), &(state->distbits), state->work);
+; 1011 : if (ret) {
+; 1012 : strm->msg = (char *)"invalid distances set";
+
+ 00e3f 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 00e42 c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BG@GMDFCBGP@invalid?5distances?5set?$AA@
+
+; 1014 : break;
+
+ 00e49 e9 c5 fc ff ff jmp $LN931@inflate
+$LN446@inflate:
+
+; 1015 : }
+; 1016 : Tracev((stderr, "inflate: codes ok\n"));
+; 1017 : state->mode = LEN_;
+; 1018 : if (flush == Z_TREES) goto inf_leave;
+
+ 00e4e 8b 55 0c mov edx, DWORD PTR _flush$[ebp]
+ 00e51 c7 01 13 00 00
+ 00 mov DWORD PTR [ecx], 19 ; 00000013H
+ 00e57 83 fa 06 cmp edx, 6
+ 00e5a 0f 84 16 07 00
+ 00 je $LN862@inflate
+ 00e60 8b 55 fc mov edx, DWORD PTR _hold$1$[ebp]
+$LN447@inflate:
+
+; 1019 : case LEN_:
+; 1020 : state->mode = LEN;
+
+ 00e63 c7 01 14 00 00
+ 00 mov DWORD PTR [ecx], 20 ; 00000014H
+$LN449@inflate:
+
+; 1021 : case LEN:
+; 1022 : if (have >= 6 && left >= 258) {
+
+ 00e69 83 fb 06 cmp ebx, 6
+ 00e6c 72 71 jb SHORT $LN450@inflate
+ 00e6e 81 7d e8 02 01
+ 00 00 cmp DWORD PTR _left$1$[ebp], 258 ; 00000102H
+ 00e75 72 68 jb SHORT $LN450@inflate
+
+; 1023 : RESTORE();
+
+ 00e77 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 00e7a 8b 7d e0 mov edi, DWORD PTR _put$1$[ebp]
+ 00e7d 89 78 0c mov DWORD PTR [eax+12], edi
+ 00e80 8b 7d e8 mov edi, DWORD PTR _left$1$[ebp]
+ 00e83 89 78 10 mov DWORD PTR [eax+16], edi
+ 00e86 8b 7d f0 mov edi, DWORD PTR _next$1$[ebp]
+ 00e89 89 38 mov DWORD PTR [eax], edi
+ 00e8b 89 58 04 mov DWORD PTR [eax+4], ebx
+ 00e8e 89 51 38 mov DWORD PTR [ecx+56], edx
+
+; 1024 : inflate_fast(strm, out);
+
+ 00e91 8b 55 dc mov edx, DWORD PTR _out$1$[ebp]
+ 00e94 89 71 3c mov DWORD PTR [ecx+60], esi
+ 00e97 8b c8 mov ecx, eax
+ 00e99 e8 00 00 00 00 call _inflate_fast
+
+; 1025 : LOAD();
+
+ 00e9e 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 00ea1 8b 48 0c mov ecx, DWORD PTR [eax+12]
+ 00ea4 8b 38 mov edi, DWORD PTR [eax]
+ 00ea6 8b 58 04 mov ebx, DWORD PTR [eax+4]
+ 00ea9 89 4d e0 mov DWORD PTR _put$1$[ebp], ecx
+ 00eac 8b 48 10 mov ecx, DWORD PTR [eax+16]
+ 00eaf 89 4d e8 mov DWORD PTR _left$1$[ebp], ecx
+ 00eb2 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 00eb5 89 7d f0 mov DWORD PTR _next$1$[ebp], edi
+ 00eb8 89 5d f4 mov DWORD PTR _have$1$[ebp], ebx
+
+; 1026 : if (state->mode == TYPE)
+
+ 00ebb 83 39 0b cmp DWORD PTR [ecx], 11 ; 0000000bH
+ 00ebe 8b 51 38 mov edx, DWORD PTR [ecx+56]
+ 00ec1 8b 71 3c mov esi, DWORD PTR [ecx+60]
+ 00ec4 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 00ec7 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+ 00eca 0f 85 4c fc ff
+ ff jne $LN8@inflate
+
+; 1027 : state->back = -1;
+
+ 00ed0 c7 81 c4 1b 00
+ 00 ff ff ff ff mov DWORD PTR [ecx+7108], -1
+
+; 1028 : break;
+
+ 00eda e9 3d fc ff ff jmp $LN8@inflate
+$LN450@inflate:
+
+; 1029 : }
+; 1030 : state->back = 0;
+; 1031 : for (;;) {
+; 1032 : here = state->lencode[BITS(state->lenbits)];
+
+ 00edf 8b 41 4c mov eax, DWORD PTR [ecx+76]
+ 00ee2 c7 81 c4 1b 00
+ 00 00 00 00 00 mov DWORD PTR [ecx+7108], 0
+ 00eec 8b 4d d0 mov ecx, DWORD PTR tv2779[ebp]
+ 00eef 89 45 cc mov DWORD PTR tv2688[ebp], eax
+ 00ef2 b8 01 00 00 00 mov eax, 1
+ 00ef7 8b 09 mov ecx, DWORD PTR [ecx]
+ 00ef9 d3 e0 shl eax, cl
+ 00efb 8b 4d cc mov ecx, DWORD PTR tv2688[ebp]
+ 00efe 48 dec eax
+ 00eff 23 c2 and eax, edx
+ 00f01 8b 04 81 mov eax, DWORD PTR [ecx+eax*4]
+
+; 1033 : if ((unsigned)(here.bits) <= bits) break;
+
+ 00f04 8b c8 mov ecx, eax
+ 00f06 c1 e9 08 shr ecx, 8
+ 00f09 0f b6 c9 movzx ecx, cl
+ 00f0c 3b ce cmp ecx, esi
+ 00f0e 76 47 jbe SHORT $LN568@inflate
+$LL246@inflate:
+
+; 1034 : PULLBYTE();
+
+ 00f10 85 db test ebx, ebx
+ 00f12 0f 84 62 f6 ff
+ ff je $LN886@inflate
+ 00f18 0f b6 07 movzx eax, BYTE PTR [edi]
+ 00f1b 8b ce mov ecx, esi
+ 00f1d d3 e0 shl eax, cl
+ 00f1f 4b dec ebx
+ 00f20 03 d0 add edx, eax
+ 00f22 89 5d f4 mov DWORD PTR _have$1$[ebp], ebx
+ 00f25 8b 45 d0 mov eax, DWORD PTR tv2779[ebp]
+ 00f28 47 inc edi
+ 00f29 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 00f2c 83 c6 08 add esi, 8
+ 00f2f ba 01 00 00 00 mov edx, 1
+ 00f34 89 7d f0 mov DWORD PTR _next$1$[ebp], edi
+ 00f37 8b 08 mov ecx, DWORD PTR [eax]
+ 00f39 8b 45 f8 mov eax, DWORD PTR _state$1$[ebp]
+ 00f3c d3 e2 shl edx, cl
+ 00f3e 4a dec edx
+ 00f3f 23 55 fc and edx, DWORD PTR _hold$1$[ebp]
+ 00f42 8b 40 4c mov eax, DWORD PTR [eax+76]
+ 00f45 8b 04 90 mov eax, DWORD PTR [eax+edx*4]
+ 00f48 8b c8 mov ecx, eax
+ 00f4a 8b 55 fc mov edx, DWORD PTR _hold$1$[ebp]
+ 00f4d c1 e9 08 shr ecx, 8
+ 00f50 0f b6 c9 movzx ecx, cl
+ 00f53 3b ce cmp ecx, esi
+ 00f55 77 b9 ja SHORT $LL246@inflate
+$LN568@inflate:
+
+; 1035 : }
+; 1036 : if (here.op && (here.op & 0xf0) == 0) {
+
+ 00f57 84 c0 test al, al
+ 00f59 0f 84 be 00 00
+ 00 je $LN263@inflate
+ 00f5f a8 f0 test al, 240 ; 000000f0H
+ 00f61 0f 85 b6 00 00
+ 00 jne $LN263@inflate
+
+; 1037 : last = here;
+; 1038 : for (;;) {
+; 1039 : here = state->lencode[last.val +
+
+ 00f67 8b c8 mov ecx, eax
+ 00f69 bb 01 00 00 00 mov ebx, 1
+ 00f6e c1 e9 08 shr ecx, 8
+ 00f71 8b d0 mov edx, eax
+ 00f73 0f b6 f9 movzx edi, cl
+ 00f76 89 4d d8 mov DWORD PTR tv2687[ebp], ecx
+ 00f79 0f b6 c8 movzx ecx, al
+ 00f7c 03 cf add ecx, edi
+ 00f7e c1 e8 10 shr eax, 16 ; 00000010H
+ 00f81 d3 e3 shl ebx, cl
+ 00f83 8b cf mov ecx, edi
+ 00f85 4b dec ebx
+ 00f86 89 55 c8 mov DWORD PTR _last$[ebp], edx
+ 00f89 23 5d fc and ebx, DWORD PTR _hold$1$[ebp]
+ 00f8c d3 eb shr ebx, cl
+ 00f8e 8b 4d cc mov ecx, DWORD PTR tv2688[ebp]
+ 00f91 03 d8 add ebx, eax
+ 00f93 8b 04 99 mov eax, DWORD PTR [ecx+ebx*4]
+
+; 1040 : (BITS(last.bits + last.op) >> last.bits)];
+; 1041 : if ((unsigned)(last.bits + here.bits) <= bits) break;
+
+ 00f96 8b c8 mov ecx, eax
+ 00f98 c1 e9 08 shr ecx, 8
+ 00f9b 0f b6 f9 movzx edi, cl
+ 00f9e 8b 4d d8 mov ecx, DWORD PTR tv2687[ebp]
+ 00fa1 0f b6 c9 movzx ecx, cl
+ 00fa4 03 f9 add edi, ecx
+ 00fa6 3b fe cmp edi, esi
+ 00fa8 76 5d jbe SHORT $LN260@inflate
+ 00faa 66 0f 1f 44 00
+ 00 npad 6
+$LL252@inflate:
+
+; 1042 : PULLBYTE();
+
+ 00fb0 8b 45 f4 mov eax, DWORD PTR _have$1$[ebp]
+ 00fb3 85 c0 test eax, eax
+ 00fb5 0f 84 c2 f5 ff
+ ff je $LN896@inflate
+ 00fbb 8b 5d f0 mov ebx, DWORD PTR _next$1$[ebp]
+ 00fbe 48 dec eax
+ 00fbf 89 45 f4 mov DWORD PTR _have$1$[ebp], eax
+ 00fc2 8b ce mov ecx, esi
+ 00fc4 bf 01 00 00 00 mov edi, 1
+ 00fc9 83 c6 08 add esi, 8
+ 00fcc 0f b6 03 movzx eax, BYTE PTR [ebx]
+ 00fcf 43 inc ebx
+ 00fd0 d3 e0 shl eax, cl
+ 00fd2 01 45 fc add DWORD PTR _hold$1$[ebp], eax
+ 00fd5 0f b7 45 ca movzx eax, WORD PTR _last$[ebp+2]
+ 00fd9 89 5d f0 mov DWORD PTR _next$1$[ebp], ebx
+ 00fdc 0f b6 de movzx ebx, dh
+ 00fdf 0f b6 ca movzx ecx, dl
+ 00fe2 03 cb add ecx, ebx
+ 00fe4 d3 e7 shl edi, cl
+ 00fe6 8b cb mov ecx, ebx
+ 00fe8 4f dec edi
+ 00fe9 23 7d fc and edi, DWORD PTR _hold$1$[ebp]
+ 00fec d3 ef shr edi, cl
+ 00fee 03 f8 add edi, eax
+ 00ff0 8b 45 f8 mov eax, DWORD PTR _state$1$[ebp]
+ 00ff3 8b 40 4c mov eax, DWORD PTR [eax+76]
+ 00ff6 8b 04 b8 mov eax, DWORD PTR [eax+edi*4]
+ 00ff9 8b c8 mov ecx, eax
+ 00ffb c1 e9 08 shr ecx, 8
+ 00ffe 0f b6 c9 movzx ecx, cl
+ 01001 03 cb add ecx, ebx
+ 01003 3b ce cmp ecx, esi
+ 01005 77 a9 ja SHORT $LL252@inflate
+$LN260@inflate:
+
+; 1043 : }
+; 1044 : DROPBITS(last.bits);
+; 1045 : state->back += last.bits;
+
+ 01007 8b 5d f8 mov ebx, DWORD PTR _state$1$[ebp]
+ 0100a 0f b6 ce movzx ecx, dh
+ 0100d 8b 55 fc mov edx, DWORD PTR _hold$1$[ebp]
+ 01010 d3 ea shr edx, cl
+ 01012 2b f1 sub esi, ecx
+ 01014 89 8b c4 1b 00
+ 00 mov DWORD PTR [ebx+7108], ecx
+ 0101a 8b 5d f4 mov ebx, DWORD PTR _have$1$[ebp]
+$LN263@inflate:
+
+; 1046 : }
+; 1047 : DROPBITS(here.bits);
+; 1048 : state->back += here.bits;
+
+ 0101d 8b 7d f8 mov edi, DWORD PTR _state$1$[ebp]
+ 01020 8b c8 mov ecx, eax
+ 01022 c1 e9 08 shr ecx, 8
+ 01025 0f b6 c9 movzx ecx, cl
+ 01028 d3 ea shr edx, cl
+ 0102a 2b f1 sub esi, ecx
+ 0102c 01 8f c4 1b 00
+ 00 add DWORD PTR [edi+7108], ecx
+
+; 1049 : state->length = (unsigned)here.val;
+
+ 01032 8b c8 mov ecx, eax
+ 01034 c1 e9 10 shr ecx, 16 ; 00000010H
+ 01037 89 4f 40 mov DWORD PTR [edi+64], ecx
+
+; 1050 : if ((int)(here.op) == 0) {
+
+ 0103a 8b 7d f0 mov edi, DWORD PTR _next$1$[ebp]
+
+; 1051 : Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
+; 1052 : "inflate: literal '%c'\n" :
+; 1053 : "inflate: literal 0x%02x\n", here.val));
+; 1054 : state->mode = LIT;
+
+ 0103d 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 01040 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 01043 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+ 01046 84 c0 test al, al
+ 01048 75 0b jne SHORT $LN457@inflate
+ 0104a c7 01 19 00 00
+ 00 mov DWORD PTR [ecx], 25 ; 00000019H
+
+; 1055 : break;
+
+ 01050 e9 c7 fa ff ff jmp $LN8@inflate
+$LN457@inflate:
+
+; 1056 : }
+; 1057 : if (here.op & 32) {
+
+ 01055 a8 20 test al, 32 ; 00000020H
+ 01057 74 15 je SHORT $LN458@inflate
+
+; 1058 : Tracevv((stderr, "inflate: end of block\n"));
+; 1059 : state->back = -1;
+
+ 01059 c7 81 c4 1b 00
+ 00 ff ff ff ff mov DWORD PTR [ecx+7108], -1
+$LN418@inflate:
+
+; 1060 : state->mode = TYPE;
+
+ 01063 c7 01 0b 00 00
+ 00 mov DWORD PTR [ecx], 11 ; 0000000bH
+
+; 1061 : break;
+
+ 01069 e9 ae fa ff ff jmp $LN8@inflate
+$LN458@inflate:
+
+; 1062 : }
+; 1063 : if (here.op & 64) {
+
+ 0106e a8 40 test al, 64 ; 00000040H
+ 01070 74 15 je SHORT $LN459@inflate
+
+; 1064 : strm->msg = (char *)"invalid literal/length code";
+
+ 01072 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 01075 c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BM@FFFLPBBC@invalid?5literal?1length?5code?$AA@
+ 0107c c7 01 1d 00 00
+ 00 mov DWORD PTR [ecx], 29 ; 0000001dH
+ 01082 e9 95 fa ff ff jmp $LN8@inflate
+$LN459@inflate:
+
+; 1065 : state->mode = BAD;
+; 1066 : break;
+; 1067 : }
+; 1068 : state->extra = (unsigned)(here.op) & 15;
+
+ 01087 0f b6 c0 movzx eax, al
+ 0108a 83 e0 0f and eax, 15 ; 0000000fH
+
+; 1069 : state->mode = LENEXT;
+
+ 0108d c7 01 15 00 00
+ 00 mov DWORD PTR [ecx], 21 ; 00000015H
+ 01093 89 41 48 mov DWORD PTR [ecx+72], eax
+$LN460@inflate:
+
+; 1070 : case LENEXT:
+; 1071 : if (state->extra) {
+
+ 01096 8b 41 48 mov eax, DWORD PTR [ecx+72]
+ 01099 89 45 c8 mov DWORD PTR tv2666[ebp], eax
+ 0109c 85 c0 test eax, eax
+ 0109e 74 50 je SHORT $LN461@inflate
+
+; 1072 : NEEDBITS(state->extra);
+
+ 010a0 3b f0 cmp esi, eax
+ 010a2 73 24 jae SHORT $LN264@inflate
+$LL267@inflate:
+ 010a4 85 db test ebx, ebx
+ 010a6 0f 84 ce f4 ff
+ ff je $LN886@inflate
+ 010ac 0f b6 07 movzx eax, BYTE PTR [edi]
+ 010af 8b ce mov ecx, esi
+ 010b1 d3 e0 shl eax, cl
+ 010b3 4b dec ebx
+ 010b4 03 d0 add edx, eax
+ 010b6 89 5d f4 mov DWORD PTR _have$1$[ebp], ebx
+ 010b9 47 inc edi
+ 010ba 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 010bd 83 c6 08 add esi, 8
+ 010c0 89 7d f0 mov DWORD PTR _next$1$[ebp], edi
+ 010c3 3b 75 c8 cmp esi, DWORD PTR tv2666[ebp]
+ 010c6 72 dc jb SHORT $LL267@inflate
+$LN264@inflate:
+
+; 1073 : state->length += BITS(state->extra);
+
+ 010c8 8b 4d c8 mov ecx, DWORD PTR tv2666[ebp]
+ 010cb b8 01 00 00 00 mov eax, 1
+ 010d0 d3 e0 shl eax, cl
+ 010d2 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 010d5 48 dec eax
+ 010d6 23 c2 and eax, edx
+ 010d8 01 41 40 add DWORD PTR [ecx+64], eax
+
+; 1074 : DROPBITS(state->extra);
+
+ 010db 8b 45 c8 mov eax, DWORD PTR tv2666[ebp]
+ 010de 8b c8 mov ecx, eax
+ 010e0 d3 ea shr edx, cl
+ 010e2 2b f0 sub esi, eax
+
+; 1075 : state->back += state->extra;
+
+ 010e4 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 010e7 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 010ea 01 81 c4 1b 00
+ 00 add DWORD PTR [ecx+7108], eax
+$LN461@inflate:
+
+; 1076 : }
+; 1077 : Tracevv((stderr, "inflate: length %u\n", state->length));
+; 1078 : state->was = state->length;
+
+ 010f0 8b 41 40 mov eax, DWORD PTR [ecx+64]
+ 010f3 89 81 c8 1b 00
+ 00 mov DWORD PTR [ecx+7112], eax
+
+; 1079 : state->mode = DIST;
+
+ 010f9 c7 01 16 00 00
+ 00 mov DWORD PTR [ecx], 22 ; 00000016H
+$LN463@inflate:
+
+; 1080 : case DIST:
+; 1081 : for (;;) {
+; 1082 : here = state->distcode[BITS(state->distbits)];
+
+ 010ff 8b 41 50 mov eax, DWORD PTR [ecx+80]
+ 01102 8b 4d c0 mov ecx, DWORD PTR tv2776[ebp]
+ 01105 89 45 cc mov DWORD PTR tv2664[ebp], eax
+ 01108 b8 01 00 00 00 mov eax, 1
+ 0110d 8b 09 mov ecx, DWORD PTR [ecx]
+ 0110f d3 e0 shl eax, cl
+ 01111 8b 4d cc mov ecx, DWORD PTR tv2664[ebp]
+ 01114 48 dec eax
+ 01115 23 c2 and eax, edx
+ 01117 8b 04 81 mov eax, DWORD PTR [ecx+eax*4]
+
+; 1083 : if ((unsigned)(here.bits) <= bits) break;
+
+ 0111a 8b c8 mov ecx, eax
+ 0111c c1 e9 08 shr ecx, 8
+ 0111f 0f b6 c9 movzx ecx, cl
+ 01122 3b ce cmp ecx, esi
+ 01124 76 47 jbe SHORT $LN573@inflate
+$LL275@inflate:
+
+; 1084 : PULLBYTE();
+
+ 01126 85 db test ebx, ebx
+ 01128 0f 84 4c f4 ff
+ ff je $LN886@inflate
+ 0112e 0f b6 07 movzx eax, BYTE PTR [edi]
+ 01131 8b ce mov ecx, esi
+ 01133 d3 e0 shl eax, cl
+ 01135 4b dec ebx
+ 01136 03 d0 add edx, eax
+ 01138 89 5d f4 mov DWORD PTR _have$1$[ebp], ebx
+ 0113b 8b 45 c0 mov eax, DWORD PTR tv2776[ebp]
+ 0113e 47 inc edi
+ 0113f 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 01142 83 c6 08 add esi, 8
+ 01145 ba 01 00 00 00 mov edx, 1
+ 0114a 89 7d f0 mov DWORD PTR _next$1$[ebp], edi
+ 0114d 8b 08 mov ecx, DWORD PTR [eax]
+ 0114f 8b 45 f8 mov eax, DWORD PTR _state$1$[ebp]
+ 01152 d3 e2 shl edx, cl
+ 01154 4a dec edx
+ 01155 23 55 fc and edx, DWORD PTR _hold$1$[ebp]
+ 01158 8b 40 50 mov eax, DWORD PTR [eax+80]
+ 0115b 8b 04 90 mov eax, DWORD PTR [eax+edx*4]
+ 0115e 8b c8 mov ecx, eax
+ 01160 8b 55 fc mov edx, DWORD PTR _hold$1$[ebp]
+ 01163 c1 e9 08 shr ecx, 8
+ 01166 0f b6 c9 movzx ecx, cl
+ 01169 3b ce cmp ecx, esi
+ 0116b 77 b9 ja SHORT $LL275@inflate
+$LN573@inflate:
+
+; 1085 : }
+; 1086 : if ((here.op & 0xf0) == 0) {
+
+ 0116d a8 f0 test al, 240 ; 000000f0H
+ 0116f 0f 85 b7 00 00
+ 00 jne $LN891@inflate
+
+; 1087 : last = here;
+; 1088 : for (;;) {
+; 1089 : here = state->distcode[last.val +
+
+ 01175 8b c8 mov ecx, eax
+ 01177 bb 01 00 00 00 mov ebx, 1
+ 0117c c1 e9 08 shr ecx, 8
+ 0117f 8b d0 mov edx, eax
+ 01181 0f b6 f9 movzx edi, cl
+ 01184 89 4d d8 mov DWORD PTR tv2686[ebp], ecx
+ 01187 0f b6 c8 movzx ecx, al
+ 0118a 03 cf add ecx, edi
+ 0118c c1 e8 10 shr eax, 16 ; 00000010H
+ 0118f d3 e3 shl ebx, cl
+ 01191 8b cf mov ecx, edi
+ 01193 4b dec ebx
+ 01194 89 55 c8 mov DWORD PTR _last$[ebp], edx
+ 01197 23 5d fc and ebx, DWORD PTR _hold$1$[ebp]
+ 0119a d3 eb shr ebx, cl
+ 0119c 8b 4d cc mov ecx, DWORD PTR tv2664[ebp]
+ 0119f 03 d8 add ebx, eax
+ 011a1 8b 04 99 mov eax, DWORD PTR [ecx+ebx*4]
+
+; 1090 : (BITS(last.bits + last.op) >> last.bits)];
+; 1091 : if ((unsigned)(last.bits + here.bits) <= bits) break;
+
+ 011a4 8b c8 mov ecx, eax
+ 011a6 c1 e9 08 shr ecx, 8
+ 011a9 0f b6 f9 movzx edi, cl
+ 011ac 8b 4d d8 mov ecx, DWORD PTR tv2686[ebp]
+ 011af 0f b6 c9 movzx ecx, cl
+ 011b2 03 f9 add edi, ecx
+ 011b4 3b fe cmp edi, esi
+ 011b6 76 5f jbe SHORT $LN289@inflate
+ 011b8 0f 1f 84 00 00
+ 00 00 00 npad 8
+$LL281@inflate:
+
+; 1092 : PULLBYTE();
+
+ 011c0 8b 45 f4 mov eax, DWORD PTR _have$1$[ebp]
+ 011c3 85 c0 test eax, eax
+ 011c5 0f 84 b2 f3 ff
+ ff je $LN896@inflate
+ 011cb 8b 5d f0 mov ebx, DWORD PTR _next$1$[ebp]
+ 011ce 48 dec eax
+ 011cf 89 45 f4 mov DWORD PTR _have$1$[ebp], eax
+ 011d2 8b ce mov ecx, esi
+ 011d4 bf 01 00 00 00 mov edi, 1
+ 011d9 83 c6 08 add esi, 8
+ 011dc 0f b6 03 movzx eax, BYTE PTR [ebx]
+ 011df 43 inc ebx
+ 011e0 d3 e0 shl eax, cl
+ 011e2 01 45 fc add DWORD PTR _hold$1$[ebp], eax
+ 011e5 0f b7 45 ca movzx eax, WORD PTR _last$[ebp+2]
+ 011e9 89 5d f0 mov DWORD PTR _next$1$[ebp], ebx
+ 011ec 0f b6 de movzx ebx, dh
+ 011ef 0f b6 ca movzx ecx, dl
+ 011f2 03 cb add ecx, ebx
+ 011f4 d3 e7 shl edi, cl
+ 011f6 8b cb mov ecx, ebx
+ 011f8 4f dec edi
+ 011f9 23 7d fc and edi, DWORD PTR _hold$1$[ebp]
+ 011fc d3 ef shr edi, cl
+ 011fe 03 f8 add edi, eax
+ 01200 8b 45 f8 mov eax, DWORD PTR _state$1$[ebp]
+ 01203 8b 40 50 mov eax, DWORD PTR [eax+80]
+ 01206 8b 04 b8 mov eax, DWORD PTR [eax+edi*4]
+ 01209 8b c8 mov ecx, eax
+ 0120b c1 e9 08 shr ecx, 8
+ 0120e 0f b6 c9 movzx ecx, cl
+ 01211 03 cb add ecx, ebx
+ 01213 3b ce cmp ecx, esi
+ 01215 77 a9 ja SHORT $LL281@inflate
+$LN289@inflate:
+
+; 1093 : }
+; 1094 : DROPBITS(last.bits);
+; 1095 : state->back += last.bits;
+
+ 01217 8b 5d f8 mov ebx, DWORD PTR _state$1$[ebp]
+ 0121a 0f b6 ce movzx ecx, dh
+ 0121d 8b 55 fc mov edx, DWORD PTR _hold$1$[ebp]
+ 01220 2b f1 sub esi, ecx
+ 01222 d3 ea shr edx, cl
+ 01224 01 8b c4 1b 00
+ 00 add DWORD PTR [ebx+7108], ecx
+ 0122a eb 03 jmp SHORT $LN292@inflate
+$LN891@inflate:
+ 0122c 8b 5d f8 mov ebx, DWORD PTR _state$1$[ebp]
+$LN292@inflate:
+
+; 1102 : break;
+
+ 0122f 8b 7d f0 mov edi, DWORD PTR _next$1$[ebp]
+ 01232 8b c8 mov ecx, eax
+ 01234 c1 e9 08 shr ecx, 8
+ 01237 0f b6 c9 movzx ecx, cl
+ 0123a 01 8b c4 1b 00
+ 00 add DWORD PTR [ebx+7108], ecx
+ 01240 2b f1 sub esi, ecx
+ 01242 d3 ea shr edx, cl
+ 01244 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 01247 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+ 0124a a8 40 test al, 64 ; 00000040H
+ 0124c 74 1b je SHORT $LN469@inflate
+
+; 1096 : }
+; 1097 : DROPBITS(here.bits);
+; 1098 : state->back += here.bits;
+; 1099 : if (here.op & 64) {
+; 1100 : strm->msg = (char *)"invalid distance code";
+; 1101 : state->mode = BAD;
+
+ 0124e 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 01251 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+
+; 1102 : break;
+
+ 01254 8b 5d f4 mov ebx, DWORD PTR _have$1$[ebp]
+ 01257 c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BG@LBKINIKP@invalid?5distance?5code?$AA@
+ 0125e c7 01 1d 00 00
+ 00 mov DWORD PTR [ecx], 29 ; 0000001dH
+ 01264 e9 b3 f8 ff ff jmp $LN8@inflate
+$LN469@inflate:
+
+; 1103 : }
+; 1104 : state->offset = (unsigned)here.val;
+
+ 01269 8b c8 mov ecx, eax
+
+; 1105 : state->extra = (unsigned)(here.op) & 15;
+
+ 0126b 0f b6 c0 movzx eax, al
+ 0126e c1 e9 10 shr ecx, 16 ; 00000010H
+ 01271 83 e0 0f and eax, 15 ; 0000000fH
+ 01274 89 4b 44 mov DWORD PTR [ebx+68], ecx
+ 01277 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 0127a 8b 5d f4 mov ebx, DWORD PTR _have$1$[ebp]
+ 0127d 89 41 48 mov DWORD PTR [ecx+72], eax
+
+; 1106 : state->mode = DISTEXT;
+
+ 01280 c7 01 17 00 00
+ 00 mov DWORD PTR [ecx], 23 ; 00000017H
+$LN470@inflate:
+
+; 1107 : case DISTEXT:
+; 1108 : if (state->extra) {
+
+ 01286 8b 41 48 mov eax, DWORD PTR [ecx+72]
+ 01289 89 45 c8 mov DWORD PTR tv2665[ebp], eax
+ 0128c 85 c0 test eax, eax
+ 0128e 74 53 je SHORT $LN471@inflate
+
+; 1109 : NEEDBITS(state->extra);
+
+ 01290 3b f0 cmp esi, eax
+ 01292 73 24 jae SHORT $LN293@inflate
+$LL296@inflate:
+ 01294 85 db test ebx, ebx
+ 01296 0f 84 de f2 ff
+ ff je $LN886@inflate
+ 0129c 0f b6 07 movzx eax, BYTE PTR [edi]
+ 0129f 8b ce mov ecx, esi
+ 012a1 d3 e0 shl eax, cl
+ 012a3 4b dec ebx
+ 012a4 03 d0 add edx, eax
+ 012a6 89 5d f4 mov DWORD PTR _have$1$[ebp], ebx
+ 012a9 47 inc edi
+ 012aa 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 012ad 83 c6 08 add esi, 8
+ 012b0 89 7d f0 mov DWORD PTR _next$1$[ebp], edi
+ 012b3 3b 75 c8 cmp esi, DWORD PTR tv2665[ebp]
+ 012b6 72 dc jb SHORT $LL296@inflate
+$LN293@inflate:
+
+; 1110 : state->offset += BITS(state->extra);
+
+ 012b8 8b 4d c8 mov ecx, DWORD PTR tv2665[ebp]
+ 012bb b8 01 00 00 00 mov eax, 1
+ 012c0 d3 e0 shl eax, cl
+ 012c2 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 012c5 48 dec eax
+ 012c6 23 c2 and eax, edx
+ 012c8 01 41 44 add DWORD PTR [ecx+68], eax
+
+; 1111 : DROPBITS(state->extra);
+
+ 012cb 8b 45 c8 mov eax, DWORD PTR tv2665[ebp]
+ 012ce 8b c8 mov ecx, eax
+ 012d0 d3 ea shr edx, cl
+ 012d2 2b f0 sub esi, eax
+
+; 1112 : state->back += state->extra;
+
+ 012d4 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 012d7 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 012da 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+ 012dd 01 81 c4 1b 00
+ 00 add DWORD PTR [ecx+7108], eax
+$LN471@inflate:
+
+; 1113 : }
+; 1114 : #ifdef INFLATE_STRICT
+; 1115 : if (state->offset > state->dmax) {
+; 1116 : strm->msg = (char *)"invalid distance too far back";
+; 1117 : state->mode = BAD;
+; 1118 : break;
+; 1119 : }
+; 1120 : #endif
+; 1121 : Tracevv((stderr, "inflate: distance %u\n", state->offset));
+; 1122 : state->mode = MATCH;
+
+ 012e3 c7 01 18 00 00
+ 00 mov DWORD PTR [ecx], 24 ; 00000018H
+$LN473@inflate:
+
+; 1123 : case MATCH:
+; 1124 : if (left == 0) goto inf_leave;
+
+ 012e9 83 7d e8 00 cmp DWORD PTR _left$1$[ebp], 0
+ 012ed 0f 84 87 f2 ff
+ ff je $LN886@inflate
+
+; 1125 : copy = out - left;
+
+ 012f3 8b 45 dc mov eax, DWORD PTR _out$1$[ebp]
+ 012f6 2b 45 e8 sub eax, DWORD PTR _left$1$[ebp]
+ 012f9 89 45 c8 mov DWORD PTR _copy$9$[ebp], eax
+
+; 1126 : if (state->offset > copy) { /* copy from window */
+
+ 012fc 8b 41 44 mov eax, DWORD PTR [ecx+68]
+ 012ff 3b 45 c8 cmp eax, DWORD PTR _copy$9$[ebp]
+ 01302 76 54 jbe SHORT $LN475@inflate
+
+; 1127 : copy = state->offset - copy;
+
+ 01304 2b 45 c8 sub eax, DWORD PTR _copy$9$[ebp]
+
+; 1128 : if (copy > state->whave) {
+
+ 01307 3b 41 2c cmp eax, DWORD PTR [ecx+44]
+ 0130a 76 1e jbe SHORT $LN478@inflate
+
+; 1129 : if (state->sane) {
+
+ 0130c 83 b9 c0 1b 00
+ 00 00 cmp DWORD PTR [ecx+7104], 0
+ 01313 74 15 je SHORT $LN478@inflate
+
+; 1130 : strm->msg = (char *)"invalid distance too far back";
+
+ 01315 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 01318 c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BO@ECPMAOGG@invalid?5distance?5too?5far?5back?$AA@
+ 0131f c7 01 1d 00 00
+ 00 mov DWORD PTR [ecx], 29 ; 0000001dH
+ 01325 e9 f2 f7 ff ff jmp $LN8@inflate
+$LN478@inflate:
+
+; 1131 : state->mode = BAD;
+; 1132 : break;
+; 1133 : }
+; 1134 : #ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
+; 1135 : Trace((stderr, "inflate.c too far\n"));
+; 1136 : copy -= state->whave;
+; 1137 : if (copy > state->length) copy = state->length;
+; 1138 : if (copy > left) copy = left;
+; 1139 : left -= copy;
+; 1140 : state->length -= copy;
+; 1141 : do {
+; 1142 : *put++ = 0;
+; 1143 : } while (--copy);
+; 1144 : if (state->length == 0) state->mode = LEN;
+; 1145 : break;
+; 1146 : #endif
+; 1147 : }
+; 1148 : if (copy > state->wnext) {
+
+ 0132a 3b 41 30 cmp eax, DWORD PTR [ecx+48]
+ 0132d 76 10 jbe SHORT $LN479@inflate
+
+; 1149 : copy -= state->wnext;
+; 1150 : from = state->window + (state->wsize - copy);
+
+ 0132f 8b 79 34 mov edi, DWORD PTR [ecx+52]
+ 01332 2b 41 30 sub eax, DWORD PTR [ecx+48]
+ 01335 03 79 28 add edi, DWORD PTR [ecx+40]
+ 01338 2b f8 sub edi, eax
+ 0133a 89 7d d8 mov DWORD PTR _from$1$[ebp], edi
+
+; 1151 : }
+
+ 0133d eb 0b jmp SHORT $LN480@inflate
+$LN479@inflate:
+
+; 1152 : else
+; 1153 : from = state->window + (state->wnext - copy);
+
+ 0133f 8b 59 34 mov ebx, DWORD PTR [ecx+52]
+ 01342 2b d8 sub ebx, eax
+ 01344 03 59 30 add ebx, DWORD PTR [ecx+48]
+ 01347 89 5d d8 mov DWORD PTR _from$1$[ebp], ebx
+$LN480@inflate:
+
+; 1154 : if (copy > state->length) copy = state->length;
+
+ 0134a 8b 79 40 mov edi, DWORD PTR [ecx+64]
+ 0134d 89 7d c8 mov DWORD PTR tv2620[ebp], edi
+ 01350 3b c7 cmp eax, edi
+ 01352 76 13 jbe SHORT $LN476@inflate
+ 01354 8b c7 mov eax, edi
+
+; 1155 : }
+
+ 01356 eb 0f jmp SHORT $LN476@inflate
+$LN475@inflate:
+
+; 1156 : else { /* copy from output */
+; 1157 : from = put - state->offset;
+
+ 01358 8b 5d e0 mov ebx, DWORD PTR _put$1$[ebp]
+ 0135b 89 5d d8 mov DWORD PTR _from$1$[ebp], ebx
+ 0135e 29 45 d8 sub DWORD PTR _from$1$[ebp], eax
+
+; 1158 : copy = state->length;
+
+ 01361 8b 41 40 mov eax, DWORD PTR [ecx+64]
+ 01364 89 45 c8 mov DWORD PTR tv2620[ebp], eax
+$LN476@inflate:
+
+; 1159 : }
+; 1160 : if (copy > left) copy = left;
+
+ 01367 8b 5d e8 mov ebx, DWORD PTR _left$1$[ebp]
+ 0136a 3b c3 cmp eax, ebx
+ 0136c 0f 47 c3 cmova eax, ebx
+
+; 1161 : left -= copy;
+
+ 0136f 2b d8 sub ebx, eax
+ 01371 89 45 cc mov DWORD PTR _copy$11$[ebp], eax
+ 01374 89 5d e8 mov DWORD PTR _left$1$[ebp], ebx
+ 01377 8b f8 mov edi, eax
+
+; 1162 : state->length -= copy;
+
+ 01379 8b 5d c8 mov ebx, DWORD PTR tv2620[ebp]
+ 0137c 2b d8 sub ebx, eax
+ 0137e 89 59 40 mov DWORD PTR [ecx+64], ebx
+
+; 1165 : } while (--copy);
+
+ 01381 8b 5d d8 mov ebx, DWORD PTR _from$1$[ebp]
+ 01384 8b 4d e0 mov ecx, DWORD PTR _put$1$[ebp]
+ 01387 2b d9 sub ebx, ecx
+ 01389 0f 1f 80 00 00
+ 00 00 npad 7
+$LL306@inflate:
+
+; 1163 : do {
+; 1164 : *put++ = *from++;
+
+ 01390 8a 04 0b mov al, BYTE PTR [ebx+ecx]
+ 01393 88 01 mov BYTE PTR [ecx], al
+ 01395 41 inc ecx
+
+; 1165 : } while (--copy);
+
+ 01396 83 ef 01 sub edi, 1
+ 01399 75 f5 jne SHORT $LL306@inflate
+
+; 1166 : if (state->length == 0) state->mode = LEN;
+
+ 0139b 8b 5d f4 mov ebx, DWORD PTR _have$1$[ebp]
+ 0139e 8b 7d f0 mov edi, DWORD PTR _next$1$[ebp]
+ 013a1 89 4d e0 mov DWORD PTR _put$1$[ebp], ecx
+ 013a4 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 013a7 83 79 40 00 cmp DWORD PTR [ecx+64], 0
+ 013ab 0f 85 6b f7 ff
+ ff jne $LN8@inflate
+ 013b1 c7 01 14 00 00
+ 00 mov DWORD PTR [ecx], 20 ; 00000014H
+
+; 1167 : break;
+
+ 013b7 e9 60 f7 ff ff jmp $LN8@inflate
+$LN484@inflate:
+
+; 1168 : case LIT:
+; 1169 : if (left == 0) goto inf_leave;
+
+ 013bc 83 7d e8 00 cmp DWORD PTR _left$1$[ebp], 0
+ 013c0 0f 84 b4 f1 ff
+ ff je $LN886@inflate
+
+; 1170 : *put++ = (unsigned char)(state->length);
+
+ 013c6 8b 7d e0 mov edi, DWORD PTR _put$1$[ebp]
+ 013c9 8a 41 40 mov al, BYTE PTR [ecx+64]
+ 013cc ff 45 e0 inc DWORD PTR _put$1$[ebp]
+
+; 1171 : left--;
+
+ 013cf ff 4d e8 dec DWORD PTR _left$1$[ebp]
+ 013d2 88 07 mov BYTE PTR [edi], al
+
+; 1172 : state->mode = LEN;
+; 1173 : break;
+
+ 013d4 8b 7d f0 mov edi, DWORD PTR _next$1$[ebp]
+ 013d7 c7 01 14 00 00
+ 00 mov DWORD PTR [ecx], 20 ; 00000014H
+ 013dd e9 3a f7 ff ff jmp $LN8@inflate
+$LN486@inflate:
+
+; 1174 : case CHECK:
+; 1175 : if (state->wrap) {
+
+ 013e2 83 79 08 00 cmp DWORD PTR [ecx+8], 0
+ 013e6 0f 84 d4 00 00
+ 00 je $LN316@inflate
+
+; 1176 : NEEDBITS(32);
+
+ 013ec 83 fe 20 cmp esi, 32 ; 00000020H
+ 013ef 73 2a jae SHORT $LN307@inflate
+$LL310@inflate:
+ 013f1 85 db test ebx, ebx
+ 013f3 0f 84 81 f1 ff
+ ff je $LN886@inflate
+ 013f9 0f b6 07 movzx eax, BYTE PTR [edi]
+ 013fc 8b ce mov ecx, esi
+ 013fe d3 e0 shl eax, cl
+ 01400 83 c6 08 add esi, 8
+ 01403 4b dec ebx
+ 01404 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+ 01407 03 d0 add edx, eax
+ 01409 89 5d f4 mov DWORD PTR _have$1$[ebp], ebx
+ 0140c 47 inc edi
+ 0140d 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 01410 89 7d f0 mov DWORD PTR _next$1$[ebp], edi
+ 01413 83 fe 20 cmp esi, 32 ; 00000020H
+ 01416 72 d9 jb SHORT $LL310@inflate
+ 01418 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+$LN307@inflate:
+
+; 1177 : out -= left;
+
+ 0141b 8b 45 e8 mov eax, DWORD PTR _left$1$[ebp]
+ 0141e 29 45 dc sub DWORD PTR _out$1$[ebp], eax
+
+; 1178 : strm->total_out += out;
+
+ 01421 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 01424 8b 7d dc mov edi, DWORD PTR _out$1$[ebp]
+ 01427 01 78 14 add DWORD PTR [eax+20], edi
+
+; 1179 : state->total += out;
+
+ 0142a 8b c7 mov eax, edi
+ 0142c 01 41 1c add DWORD PTR [ecx+28], eax
+
+; 1180 : if (out)
+
+ 0142f 8b 7d f0 mov edi, DWORD PTR _next$1$[ebp]
+ 01432 85 c0 test eax, eax
+ 01434 74 2c je SHORT $LN489@inflate
+
+; 1181 : strm->adler = state->check =
+
+ 01436 50 push eax
+ 01437 8b 45 e0 mov eax, DWORD PTR _put$1$[ebp]
+ 0143a 2b 45 dc sub eax, DWORD PTR _out$1$[ebp]
+ 0143d 83 79 10 00 cmp DWORD PTR [ecx+16], 0
+ 01441 50 push eax
+ 01442 ff 71 18 push DWORD PTR [ecx+24]
+ 01445 74 07 je SHORT $LN510@inflate
+ 01447 e8 00 00 00 00 call _crc32@12
+ 0144c eb 05 jmp SHORT $LN511@inflate
+$LN510@inflate:
+ 0144e e8 00 00 00 00 call _adler32@12
+$LN511@inflate:
+ 01453 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 01456 8b 55 08 mov edx, DWORD PTR _strm$[ebp]
+ 01459 89 41 18 mov DWORD PTR [ecx+24], eax
+ 0145c 89 42 30 mov DWORD PTR [edx+48], eax
+ 0145f 8b 55 fc mov edx, DWORD PTR _hold$1$[ebp]
+$LN489@inflate:
+
+; 1182 : UPDATE(state->check, put - out, out);
+; 1183 : out = left;
+; 1184 : if ((
+; 1185 : #ifdef GUNZIP
+; 1186 : state->flags ? hold :
+; 1187 : #endif
+; 1188 : ZSWAP32(hold)) != state->check) {
+
+ 01462 83 79 10 00 cmp DWORD PTR [ecx+16], 0
+ 01466 8b 45 e8 mov eax, DWORD PTR _left$1$[ebp]
+ 01469 89 45 dc mov DWORD PTR _out$1$[ebp], eax
+ 0146c 8b c2 mov eax, edx
+ 0146e 75 2c jne SHORT $LN513@inflate
+ 01470 25 00 ff 00 00 and eax, 65280 ; 0000ff00H
+ 01475 89 45 d8 mov DWORD PTR tv2786[ebp], eax
+ 01478 8b c2 mov eax, edx
+ 0147a c1 e0 10 shl eax, 16 ; 00000010H
+ 0147d 01 45 d8 add DWORD PTR tv2786[ebp], eax
+ 01480 8b c2 mov eax, edx
+ 01482 c1 65 d8 08 shl DWORD PTR tv2786[ebp], 8
+ 01486 c1 e8 08 shr eax, 8
+ 01489 25 00 ff 00 00 and eax, 65280 ; 0000ff00H
+ 0148e 01 45 d8 add DWORD PTR tv2786[ebp], eax
+ 01491 8b c2 mov eax, edx
+ 01493 c1 e8 18 shr eax, 24 ; 00000018H
+ 01496 01 45 d8 add DWORD PTR tv2786[ebp], eax
+ 01499 8b 45 d8 mov eax, DWORD PTR tv2786[ebp]
+$LN513@inflate:
+ 0149c 3b 41 18 cmp eax, DWORD PTR [ecx+24]
+ 0149f 74 15 je SHORT $LN317@inflate
+
+; 1189 : strm->msg = (char *)"incorrect data check";
+
+ 014a1 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 014a4 c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BF@MEIGEHBE@incorrect?5data?5check?$AA@
+ 014ab c7 01 1d 00 00
+ 00 mov DWORD PTR [ecx], 29 ; 0000001dH
+ 014b1 e9 66 f6 ff ff jmp $LN8@inflate
+$LN317@inflate:
+
+; 1190 : state->mode = BAD;
+; 1191 : break;
+; 1192 : }
+; 1193 : INITBITS();
+
+ 014b6 33 d2 xor edx, edx
+ 014b8 33 f6 xor esi, esi
+ 014ba 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 014bd 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+$LN316@inflate:
+
+; 1194 : Tracev((stderr, "inflate: check matches trailer\n"));
+; 1195 : }
+; 1196 : #ifdef GUNZIP
+; 1197 : state->mode = LENGTH;
+
+ 014c0 c7 01 1b 00 00
+ 00 mov DWORD PTR [ecx], 27 ; 0000001bH
+$LN491@inflate:
+
+; 1198 : case LENGTH:
+; 1199 : if (state->wrap && state->flags) {
+
+ 014c6 83 79 08 00 cmp DWORD PTR [ecx+8], 0
+ 014ca 0f 84 88 00 00
+ 00 je $LN327@inflate
+ 014d0 83 79 10 00 cmp DWORD PTR [ecx+16], 0
+ 014d4 0f 84 7e 00 00
+ 00 je $LN327@inflate
+
+; 1200 : NEEDBITS(32);
+
+ 014da 83 fe 20 cmp esi, 32 ; 00000020H
+ 014dd 73 2b jae SHORT $LN318@inflate
+ 014df 90 npad 1
+$LL321@inflate:
+ 014e0 85 db test ebx, ebx
+ 014e2 0f 84 92 f0 ff
+ ff je $LN886@inflate
+ 014e8 0f b6 07 movzx eax, BYTE PTR [edi]
+ 014eb 8b ce mov ecx, esi
+ 014ed d3 e0 shl eax, cl
+ 014ef 83 c6 08 add esi, 8
+ 014f2 4b dec ebx
+ 014f3 89 75 ec mov DWORD PTR _bits$1$[ebp], esi
+ 014f6 03 d0 add edx, eax
+ 014f8 89 5d f4 mov DWORD PTR _have$1$[ebp], ebx
+ 014fb 47 inc edi
+ 014fc 89 55 fc mov DWORD PTR _hold$1$[ebp], edx
+ 014ff 89 7d f0 mov DWORD PTR _next$1$[ebp], edi
+ 01502 83 fe 20 cmp esi, 32 ; 00000020H
+ 01505 72 d9 jb SHORT $LL321@inflate
+ 01507 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+$LN318@inflate:
+
+; 1201 : if (hold != (state->total & 0xffffffffUL)) {
+
+ 0150a 3b 51 1c cmp edx, DWORD PTR [ecx+28]
+ 0150d 74 40 je SHORT $LN328@inflate
+
+; 1202 : strm->msg = (char *)"incorrect length check";
+
+ 0150f 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 01512 c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET ??_C@_0BH@FGKKJGOC@incorrect?5length?5check?$AA@
+ 01519 c7 01 1d 00 00
+ 00 mov DWORD PTR [ecx], 29 ; 0000001dH
+ 0151f e9 f8 f5 ff ff jmp $LN8@inflate
+$LN585@inflate:
+
+; 821 : RESTORE();
+
+ 01524 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 01527 8b 4d e0 mov ecx, DWORD PTR _put$1$[ebp]
+ 0152a 89 48 0c mov DWORD PTR [eax+12], ecx
+ 0152d 8b 4d e8 mov ecx, DWORD PTR _left$1$[ebp]
+ 01530 89 48 10 mov DWORD PTR [eax+16], ecx
+ 01533 8b 4d f8 mov ecx, DWORD PTR _state$1$[ebp]
+ 01536 89 38 mov DWORD PTR [eax], edi
+ 01538 89 58 04 mov DWORD PTR [eax+4], ebx
+
+; 822 : return Z_NEED_DICT;
+
+ 0153b b8 02 00 00 00 mov eax, 2
+ 01540 5f pop edi
+ 01541 89 71 3c mov DWORD PTR [ecx+60], esi
+ 01544 5e pop esi
+ 01545 89 51 38 mov DWORD PTR [ecx+56], edx
+ 01548 5b pop ebx
+
+; 1250 : ret = Z_BUF_ERROR;
+; 1251 : return ret;
+; 1252 : }
+
+ 01549 8b e5 mov esp, ebp
+ 0154b 5d pop ebp
+ 0154c c2 08 00 ret 8
+$LN328@inflate:
+
+; 1203 : state->mode = BAD;
+; 1204 : break;
+; 1205 : }
+; 1206 : INITBITS();
+
+ 0154f c7 45 fc 00 00
+ 00 00 mov DWORD PTR _hold$1$[ebp], 0
+ 01556 33 f6 xor esi, esi
+$LN327@inflate:
+
+; 1207 : Tracev((stderr, "inflate: length matches trailer\n"));
+; 1208 : }
+; 1209 : #endif
+; 1210 : state->mode = DONE;
+
+ 01558 c7 01 1c 00 00
+ 00 mov DWORD PTR [ecx], 28 ; 0000001cH
+$LN495@inflate:
+
+; 1211 : case DONE:
+; 1212 : ret = Z_STREAM_END;
+
+ 0155e c7 45 d4 01 00
+ 00 00 mov DWORD PTR _ret$1$[ebp], 1
+
+; 1213 : goto inf_leave;
+
+ 01565 e9 10 f0 ff ff jmp $LN886@inflate
+$LN496@inflate:
+
+; 1214 : case BAD:
+; 1215 : ret = Z_DATA_ERROR;
+
+ 0156a c7 45 d4 fd ff
+ ff ff mov DWORD PTR _ret$1$[ebp], -3 ; fffffffdH
+ 01571 e9 04 f0 ff ff jmp $LN886@inflate
+$LN862@inflate:
+ 01576 8b 45 f4 mov eax, DWORD PTR _have$1$[ebp]
+ 01579 e9 02 f0 ff ff jmp $inf_leave$937
+$LN502@inflate:
+
+; 1237 : }
+; 1238 : in -= strm->avail_in;
+
+ 0157e 8b 45 c4 mov eax, DWORD PTR _in$1$[ebp]
+ 01581 2b 47 04 sub eax, DWORD PTR [edi+4]
+
+; 1239 : out -= strm->avail_out;
+
+ 01584 2b 77 10 sub esi, DWORD PTR [edi+16]
+
+; 1240 : strm->total_in += in;
+
+ 01587 01 47 08 add DWORD PTR [edi+8], eax
+
+; 1241 : strm->total_out += out;
+
+ 0158a 01 77 14 add DWORD PTR [edi+20], esi
+
+; 1242 : state->total += out;
+
+ 0158d 01 73 1c add DWORD PTR [ebx+28], esi
+
+; 1243 : if (state->wrap && out)
+
+ 01590 83 7b 08 00 cmp DWORD PTR [ebx+8], 0
+ 01594 89 45 c4 mov DWORD PTR _in$1$[ebp], eax
+ 01597 89 75 dc mov DWORD PTR _out$1$[ebp], esi
+ 0159a 74 26 je SHORT $LN503@inflate
+ 0159c 85 f6 test esi, esi
+ 0159e 74 22 je SHORT $LN503@inflate
+
+; 1244 : strm->adler = state->check =
+
+ 015a0 8b 47 0c mov eax, DWORD PTR [edi+12]
+ 015a3 56 push esi
+ 015a4 2b c6 sub eax, esi
+ 015a6 83 7b 10 00 cmp DWORD PTR [ebx+16], 0
+ 015aa 50 push eax
+ 015ab ff 73 18 push DWORD PTR [ebx+24]
+ 015ae 74 07 je SHORT $LN514@inflate
+ 015b0 e8 00 00 00 00 call _crc32@12
+ 015b5 eb 05 jmp SHORT $LN515@inflate
+$LN514@inflate:
+ 015b7 e8 00 00 00 00 call _adler32@12
+$LN515@inflate:
+ 015bc 89 43 18 mov DWORD PTR [ebx+24], eax
+ 015bf 89 47 30 mov DWORD PTR [edi+48], eax
+$LN503@inflate:
+
+; 1245 : UPDATE(state->check, strm->next_out - out, out);
+; 1246 : strm->data_type = state->bits + (state->last ? 64 : 0) +
+
+ 015c2 8b 13 mov edx, DWORD PTR [ebx]
+ 015c4 83 fa 13 cmp edx, 19 ; 00000013H
+ 015c7 74 09 je SHORT $LN516@inflate
+ 015c9 83 fa 0e cmp edx, 14 ; 0000000eH
+ 015cc 74 04 je SHORT $LN516@inflate
+ 015ce 33 f6 xor esi, esi
+ 015d0 eb 05 jmp SHORT $LN517@inflate
+$LN516@inflate:
+ 015d2 be 00 01 00 00 mov esi, 256 ; 00000100H
+$LN517@inflate:
+ 015d7 8b 4b 04 mov ecx, DWORD PTR [ebx+4]
+ 015da f7 d9 neg ecx
+ 015dc c7 45 08 80 00
+ 00 00 mov DWORD PTR tv2648[ebp], 128 ; 00000080H
+ 015e3 1b c9 sbb ecx, ecx
+ 015e5 33 c0 xor eax, eax
+ 015e7 83 e1 40 and ecx, 64 ; 00000040H
+ 015ea 83 fa 0b cmp edx, 11 ; 0000000bH
+ 015ed 0f 44 45 08 cmove eax, DWORD PTR tv2648[ebp]
+ 015f1 03 ce add ecx, esi
+ 015f3 03 c1 add eax, ecx
+ 015f5 03 43 3c add eax, DWORD PTR [ebx+60]
+ 015f8 89 47 2c mov DWORD PTR [edi+44], eax
+
+; 1247 : (state->mode == TYPE ? 128 : 0) +
+; 1248 : (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0);
+; 1249 : if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
+
+ 015fb 8b 45 c4 mov eax, DWORD PTR _in$1$[ebp]
+ 015fe 85 c0 test eax, eax
+ 01600 75 05 jne SHORT $LN506@inflate
+ 01602 39 45 dc cmp DWORD PTR _out$1$[ebp], eax
+ 01605 74 06 je SHORT $LN505@inflate
+$LN506@inflate:
+ 01607 83 7d 0c 04 cmp DWORD PTR _flush$[ebp], 4
+ 0160b 75 16 jne SHORT $LN894@inflate
+$LN505@inflate:
+ 0160d 8b 45 d4 mov eax, DWORD PTR _ret$1$[ebp]
+ 01610 b9 fb ff ff ff mov ecx, -5 ; fffffffbH
+ 01615 5f pop edi
+ 01616 85 c0 test eax, eax
+ 01618 5e pop esi
+ 01619 0f 44 c1 cmove eax, ecx
+ 0161c 5b pop ebx
+
+; 1250 : ret = Z_BUF_ERROR;
+; 1251 : return ret;
+; 1252 : }
+
+ 0161d 8b e5 mov esp, ebp
+ 0161f 5d pop ebp
+ 01620 c2 08 00 ret 8
+$LN894@inflate:
+ 01623 8b 45 d4 mov eax, DWORD PTR _ret$1$[ebp]
+ 01626 5f pop edi
+ 01627 5e pop esi
+ 01628 5b pop ebx
+ 01629 8b e5 mov esp, ebp
+ 0162b 5d pop ebp
+ 0162c c2 08 00 ret 8
+$LN333@inflate:
+
+; 629 : (strm->next_in == Z_NULL && strm->avail_in != 0))
+; 630 : return Z_STREAM_ERROR;
+
+ 0162f b8 fe ff ff ff mov eax, -2 ; fffffffeH
+
+; 1250 : ret = Z_BUF_ERROR;
+; 1251 : return ret;
+; 1252 : }
+
+ 01634 8b e5 mov esp, ebp
+ 01636 5d pop ebp
+ 01637 c2 08 00 ret 8
+ 0163a 66 90 npad 2
+$LN935@inflate:
+ 0163c 00 00 00 00 DD $LN335@inflate
+ 01640 00 00 00 00 DD $LN32@inflate
+ 01644 00 00 00 00 DD $LN46@inflate
+ 01648 00 00 00 00 DD $LN60@inflate
+ 0164c 00 00 00 00 DD $LN360@inflate
+ 01650 00 00 00 00 DD $LN367@inflate
+ 01654 00 00 00 00 DD $LN374@inflate
+ 01658 00 00 00 00 DD $LN383@inflate
+ 0165c 00 00 00 00 DD $LN392@inflate
+ 01660 00 00 00 00 DD $LN105@inflate
+ 01664 00 00 00 00 DD $LN399@inflate
+ 01668 00 00 00 00 DD $LN401@inflate
+ 0166c 00 00 00 00 DD $LN402@inflate
+ 01670 00 00 00 00 DD $LN141@inflate
+ 01674 00 00 00 00 DD $LN415@inflate
+ 01678 00 00 00 00 DD $LN417@inflate
+ 0167c 00 00 00 00 DD $LN155@inflate
+ 01680 00 00 00 00 DD $LN531@inflate
+ 01684 00 00 00 00 DD $LN534@inflate
+ 01688 00 00 00 00 DD $LN447@inflate
+ 0168c 00 00 00 00 DD $LN449@inflate
+ 01690 00 00 00 00 DD $LN460@inflate
+ 01694 00 00 00 00 DD $LN463@inflate
+ 01698 00 00 00 00 DD $LN470@inflate
+ 0169c 00 00 00 00 DD $LN473@inflate
+ 016a0 00 00 00 00 DD $LN484@inflate
+ 016a4 00 00 00 00 DD $LN486@inflate
+ 016a8 00 00 00 00 DD $LN491@inflate
+ 016ac 00 00 00 00 DD $LN495@inflate
+ 016b0 00 00 00 00 DD $LN496@inflate
+ 016b4 00 00 00 00 DD $LN497@inflate
+$LN936@inflate:
+ 016b8 00 00 00 00 DD $LN407@inflate
+ 016bc 00 00 00 00 DD $LN408@inflate
+ 016c0 00 00 00 00 DD $LN410@inflate
+ 016c4 00 00 00 00 DD $LN411@inflate
+_inflate@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\inflate.c
+; COMDAT _inflateEnd@4
+_TEXT SEGMENT
+_strm$ = 8 ; size = 4
+_inflateEnd@4 PROC ; COMDAT
+
+; 1256 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 56 push esi
+
+; 1257 : struct inflate_state FAR *state;
+; 1258 : if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
+
+ 00004 8b 75 08 mov esi, DWORD PTR _strm$[ebp]
+ 00007 85 f6 test esi, esi
+ 00009 74 3a je SHORT $LN3@inflateEnd
+ 0000b 8b 46 1c mov eax, DWORD PTR [esi+28]
+ 0000e 85 c0 test eax, eax
+ 00010 74 33 je SHORT $LN3@inflateEnd
+ 00012 8b 4e 24 mov ecx, DWORD PTR [esi+36]
+ 00015 85 c9 test ecx, ecx
+ 00017 74 2c je SHORT $LN3@inflateEnd
+
+; 1260 : state = (struct inflate_state FAR *)strm->state;
+; 1261 : if (state->window != Z_NULL) ZFREE(strm, state->window);
+
+ 00019 8b 40 34 mov eax, DWORD PTR [eax+52]
+ 0001c 85 c0 test eax, eax
+ 0001e 74 09 je SHORT $LN4@inflateEnd
+ 00020 50 push eax
+ 00021 ff 76 28 push DWORD PTR [esi+40]
+ 00024 ff d1 call ecx
+ 00026 83 c4 08 add esp, 8
+$LN4@inflateEnd:
+
+; 1262 : ZFREE(strm, strm->state);
+
+ 00029 ff 76 1c push DWORD PTR [esi+28]
+ 0002c 8b 46 24 mov eax, DWORD PTR [esi+36]
+ 0002f ff 76 28 push DWORD PTR [esi+40]
+ 00032 ff d0 call eax
+ 00034 83 c4 08 add esp, 8
+
+; 1263 : strm->state = Z_NULL;
+
+ 00037 c7 46 1c 00 00
+ 00 00 mov DWORD PTR [esi+28], 0
+
+; 1264 : Tracev((stderr, "inflate: end\n"));
+; 1265 : return Z_OK;
+
+ 0003e 33 c0 xor eax, eax
+ 00040 5e pop esi
+
+; 1266 : }
+
+ 00041 5d pop ebp
+ 00042 c2 04 00 ret 4
+$LN3@inflateEnd:
+
+; 1259 : return Z_STREAM_ERROR;
+
+ 00045 b8 fe ff ff ff mov eax, -2 ; fffffffeH
+ 0004a 5e pop esi
+
+; 1266 : }
+
+ 0004b 5d pop ebp
+ 0004c c2 04 00 ret 4
+_inflateEnd@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\inflate.c
+; COMDAT _inflateResetKeep@4
+_TEXT SEGMENT
+_strm$ = 8 ; size = 4
+_inflateResetKeep@4 PROC ; COMDAT
+
+; 106 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 107 : struct inflate_state FAR *state;
+; 108 :
+; 109 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 00003 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 00006 85 c0 test eax, eax
+ 00008 0f 84 8d 00 00
+ 00 je $LN3@inflateRes
+ 0000e 8b 48 1c mov ecx, DWORD PTR [eax+28]
+ 00011 85 c9 test ecx, ecx
+ 00013 0f 84 82 00 00
+ 00 je $LN3@inflateRes
+
+; 110 : state = (struct inflate_state FAR *)strm->state;
+; 111 : strm->total_in = strm->total_out = state->total = 0;
+
+ 00019 c7 41 1c 00 00
+ 00 00 mov DWORD PTR [ecx+28], 0
+ 00020 c7 40 14 00 00
+ 00 00 mov DWORD PTR [eax+20], 0
+ 00027 c7 40 08 00 00
+ 00 00 mov DWORD PTR [eax+8], 0
+
+; 112 : strm->msg = Z_NULL;
+
+ 0002e c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], 0
+
+; 113 : if (state->wrap) /* to support ill-conceived Java test suite */
+
+ 00035 8b 51 08 mov edx, DWORD PTR [ecx+8]
+ 00038 85 d2 test edx, edx
+ 0003a 74 06 je SHORT $LN4@inflateRes
+
+; 114 : strm->adler = state->wrap & 1;
+
+ 0003c 83 e2 01 and edx, 1
+ 0003f 89 50 30 mov DWORD PTR [eax+48], edx
+$LN4@inflateRes:
+
+; 115 : state->mode = HEAD;
+; 116 : state->last = 0;
+; 117 : state->havedict = 0;
+; 118 : state->dmax = 32768U;
+; 119 : state->head = Z_NULL;
+; 120 : state->hold = 0;
+; 121 : state->bits = 0;
+; 122 : state->lencode = state->distcode = state->next = state->codes;
+
+ 00042 8d 81 30 05 00
+ 00 lea eax, DWORD PTR [ecx+1328]
+ 00048 c7 01 00 00 00
+ 00 mov DWORD PTR [ecx], 0
+ 0004e 89 41 6c mov DWORD PTR [ecx+108], eax
+ 00051 89 41 50 mov DWORD PTR [ecx+80], eax
+ 00054 89 41 4c mov DWORD PTR [ecx+76], eax
+
+; 123 : state->sane = 1;
+; 124 : state->back = -1;
+; 125 : Tracev((stderr, "inflate: reset\n"));
+; 126 : return Z_OK;
+
+ 00057 33 c0 xor eax, eax
+ 00059 c7 41 04 00 00
+ 00 00 mov DWORD PTR [ecx+4], 0
+ 00060 c7 41 0c 00 00
+ 00 00 mov DWORD PTR [ecx+12], 0
+ 00067 c7 41 14 00 80
+ 00 00 mov DWORD PTR [ecx+20], 32768 ; 00008000H
+ 0006e c7 41 20 00 00
+ 00 00 mov DWORD PTR [ecx+32], 0
+ 00075 c7 41 38 00 00
+ 00 00 mov DWORD PTR [ecx+56], 0
+ 0007c c7 41 3c 00 00
+ 00 00 mov DWORD PTR [ecx+60], 0
+ 00083 c7 81 c0 1b 00
+ 00 01 00 00 00 mov DWORD PTR [ecx+7104], 1
+ 0008d c7 81 c4 1b 00
+ 00 ff ff ff ff mov DWORD PTR [ecx+7108], -1
+
+; 127 : }
+
+ 00097 5d pop ebp
+ 00098 c2 04 00 ret 4
+$LN3@inflateRes:
+
+; 107 : struct inflate_state FAR *state;
+; 108 :
+; 109 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 0009b b8 fe ff ff ff mov eax, -2 ; fffffffeH
+
+; 127 : }
+
+ 000a0 5d pop ebp
+ 000a1 c2 04 00 ret 4
+_inflateResetKeep@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\inflate.c
+; COMDAT _inflateReset2@8
+_TEXT SEGMENT
+_strm$ = 8 ; size = 4
+_windowBits$ = 12 ; size = 4
+_inflateReset2@8 PROC ; COMDAT
+
+; 145 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 146 : int wrap;
+; 147 : struct inflate_state FAR *state;
+; 148 :
+; 149 : /* get the state */
+; 150 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 00003 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 00006 57 push edi
+ 00007 85 c0 test eax, eax
+ 00009 74 73 je SHORT $LN3@inflateRes
+ 0000b 8b 78 1c mov edi, DWORD PTR [eax+28]
+ 0000e 85 ff test edi, edi
+ 00010 74 6c je SHORT $LN3@inflateRes
+
+; 151 : state = (struct inflate_state FAR *)strm->state;
+; 152 :
+; 153 : /* extract wrap request from windowBits parameter */
+; 154 : if (windowBits < 0) {
+
+ 00012 53 push ebx
+ 00013 56 push esi
+ 00014 8b 75 0c mov esi, DWORD PTR _windowBits$[ebp]
+ 00017 85 f6 test esi, esi
+ 00019 79 06 jns SHORT $LN4@inflateRes
+
+; 155 : wrap = 0;
+
+ 0001b 33 db xor ebx, ebx
+
+; 156 : windowBits = -windowBits;
+
+ 0001d f7 de neg esi
+
+; 157 : }
+
+ 0001f eb 0e jmp SHORT $LN6@inflateRes
+$LN4@inflateRes:
+
+; 158 : else {
+; 159 : wrap = (windowBits >> 4) + 1;
+
+ 00021 8b de mov ebx, esi
+ 00023 c1 fb 04 sar ebx, 4
+ 00026 43 inc ebx
+
+; 160 : #ifdef GUNZIP
+; 161 : if (windowBits < 48)
+
+ 00027 83 fe 30 cmp esi, 48 ; 00000030H
+ 0002a 7d 03 jge SHORT $LN6@inflateRes
+
+; 162 : windowBits &= 15;
+
+ 0002c 83 e6 0f and esi, 15 ; 0000000fH
+$LN6@inflateRes:
+
+; 163 : #endif
+; 164 : }
+; 165 :
+; 166 : /* set number of window bits, free window if different */
+; 167 : if (windowBits && (windowBits < 8 || windowBits > 15))
+
+ 0002f 85 f6 test esi, esi
+ 00031 74 16 je SHORT $LN7@inflateRes
+ 00033 83 fe 08 cmp esi, 8
+ 00036 7c 05 jl SHORT $LN8@inflateRes
+ 00038 83 fe 0f cmp esi, 15 ; 0000000fH
+ 0003b 7e 0c jle SHORT $LN7@inflateRes
+$LN8@inflateRes:
+ 0003d 5e pop esi
+ 0003e 5b pop ebx
+
+; 168 : return Z_STREAM_ERROR;
+
+ 0003f b8 fe ff ff ff mov eax, -2 ; fffffffeH
+ 00044 5f pop edi
+
+; 178 : }
+
+ 00045 5d pop ebp
+ 00046 c2 08 00 ret 8
+$LN7@inflateRes:
+
+; 169 : if (state->window != Z_NULL && state->wbits != (unsigned)windowBits) {
+
+ 00049 8b 4f 34 mov ecx, DWORD PTR [edi+52]
+ 0004c 85 c9 test ecx, ecx
+ 0004e 74 1b je SHORT $LN9@inflateRes
+ 00050 39 77 24 cmp DWORD PTR [edi+36], esi
+ 00053 74 16 je SHORT $LN9@inflateRes
+
+; 170 : ZFREE(strm, state->window);
+
+ 00055 51 push ecx
+ 00056 ff 70 28 push DWORD PTR [eax+40]
+ 00059 8b 40 24 mov eax, DWORD PTR [eax+36]
+ 0005c ff d0 call eax
+ 0005e 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 00061 83 c4 08 add esp, 8
+
+; 171 : state->window = Z_NULL;
+
+ 00064 c7 47 34 00 00
+ 00 00 mov DWORD PTR [edi+52], 0
+$LN9@inflateRes:
+
+; 172 : }
+; 173 :
+; 174 : /* update state and reset the rest of it */
+; 175 : state->wrap = wrap;
+; 176 : state->wbits = (unsigned)windowBits;
+; 177 : return inflateReset(strm);
+
+ 0006b 50 push eax
+ 0006c 89 5f 08 mov DWORD PTR [edi+8], ebx
+ 0006f 89 77 24 mov DWORD PTR [edi+36], esi
+ 00072 e8 00 00 00 00 call _inflateReset@4
+ 00077 5e pop esi
+ 00078 5b pop ebx
+ 00079 5f pop edi
+
+; 178 : }
+
+ 0007a 5d pop ebp
+ 0007b c2 08 00 ret 8
+$LN3@inflateRes:
+
+; 146 : int wrap;
+; 147 : struct inflate_state FAR *state;
+; 148 :
+; 149 : /* get the state */
+; 150 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 0007e b8 fe ff ff ff mov eax, -2 ; fffffffeH
+ 00083 5f pop edi
+
+; 178 : }
+
+ 00084 5d pop ebp
+ 00085 c2 08 00 ret 8
+_inflateReset2@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\inflate.c
+; COMDAT _inflateInit_@12
+_TEXT SEGMENT
+_strm$ = 8 ; size = 4
+_version$ = 12 ; size = 4
+_stream_size$ = 16 ; size = 4
+_inflateInit_@12 PROC ; COMDAT
+
+; 226 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 227 : return inflateInit2_(strm, DEF_WBITS, version, stream_size);
+
+ 00003 ff 75 10 push DWORD PTR _stream_size$[ebp]
+ 00006 ff 75 0c push DWORD PTR _version$[ebp]
+ 00009 6a 0f push 15 ; 0000000fH
+ 0000b ff 75 08 push DWORD PTR _strm$[ebp]
+ 0000e e8 00 00 00 00 call _inflateInit2_@16
+
+; 228 : }
+
+ 00013 5d pop ebp
+ 00014 c2 0c 00 ret 12 ; 0000000cH
+_inflateInit_@12 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\inflate.c
+; COMDAT _inflatePrime@12
+_TEXT SEGMENT
+_strm$ = 8 ; size = 4
+_bits$ = 12 ; size = 4
+_value$ = 16 ; size = 4
+_inflatePrime@12 PROC ; COMDAT
+
+; 234 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 235 : struct inflate_state FAR *state;
+; 236 :
+; 237 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 00003 8b 55 08 mov edx, DWORD PTR _strm$[ebp]
+ 00006 85 d2 test edx, edx
+ 00008 74 5c je SHORT $LN3@inflatePri
+ 0000a 8b 52 1c mov edx, DWORD PTR [edx+28]
+ 0000d 85 d2 test edx, edx
+ 0000f 74 55 je SHORT $LN3@inflatePri
+
+; 238 : state = (struct inflate_state FAR *)strm->state;
+; 239 : if (bits < 0) {
+
+ 00011 8b 4d 0c mov ecx, DWORD PTR _bits$[ebp]
+ 00014 85 c9 test ecx, ecx
+ 00016 79 14 jns SHORT $LN4@inflatePri
+
+; 240 : state->hold = 0;
+
+ 00018 c7 42 38 00 00
+ 00 00 mov DWORD PTR [edx+56], 0
+
+; 241 : state->bits = 0;
+; 242 : return Z_OK;
+
+ 0001f 33 c0 xor eax, eax
+ 00021 c7 42 3c 00 00
+ 00 00 mov DWORD PTR [edx+60], 0
+
+; 249 : }
+
+ 00028 5d pop ebp
+ 00029 c2 0c 00 ret 12 ; 0000000cH
+$LN4@inflatePri:
+ 0002c 56 push esi
+ 0002d 57 push edi
+
+; 243 : }
+; 244 : if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR;
+
+ 0002e 83 f9 10 cmp ecx, 16 ; 00000010H
+ 00031 7f 28 jg SHORT $LN6@inflatePri
+ 00033 8b 72 3c mov esi, DWORD PTR [edx+60]
+ 00036 8d 3c 0e lea edi, DWORD PTR [esi+ecx]
+ 00039 83 ff 20 cmp edi, 32 ; 00000020H
+ 0003c 77 1d ja SHORT $LN6@inflatePri
+
+; 245 : value &= (1L << bits) - 1;
+
+ 0003e b8 01 00 00 00 mov eax, 1
+
+; 246 : state->hold += value << state->bits;
+; 247 : state->bits += bits;
+
+ 00043 89 7a 3c mov DWORD PTR [edx+60], edi
+ 00046 d3 e0 shl eax, cl
+ 00048 8b ce mov ecx, esi
+ 0004a 48 dec eax
+ 0004b 23 45 10 and eax, DWORD PTR _value$[ebp]
+ 0004e d3 e0 shl eax, cl
+ 00050 01 42 38 add DWORD PTR [edx+56], eax
+
+; 248 : return Z_OK;
+
+ 00053 33 c0 xor eax, eax
+ 00055 5f pop edi
+ 00056 5e pop esi
+
+; 249 : }
+
+ 00057 5d pop ebp
+ 00058 c2 0c 00 ret 12 ; 0000000cH
+$LN6@inflatePri:
+ 0005b 5f pop edi
+
+; 243 : }
+; 244 : if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR;
+
+ 0005c b8 fe ff ff ff mov eax, -2 ; fffffffeH
+ 00061 5e pop esi
+
+; 249 : }
+
+ 00062 5d pop ebp
+ 00063 c2 0c 00 ret 12 ; 0000000cH
+$LN3@inflatePri:
+
+; 235 : struct inflate_state FAR *state;
+; 236 :
+; 237 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 00066 b8 fe ff ff ff mov eax, -2 ; fffffffeH
+
+; 249 : }
+
+ 0006b 5d pop ebp
+ 0006c c2 0c 00 ret 12 ; 0000000cH
+_inflatePrime@12 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\inflate.c
+; COMDAT _fixedtables
+_TEXT SEGMENT
+_fixedtables PROC ; COMDAT
+; _state$ = ecx
+
+; 264 : #ifdef BUILDFIXED
+; 265 : static int virgin = 1;
+; 266 : static code *lenfix, *distfix;
+; 267 : static code fixed[544];
+; 268 :
+; 269 : /* build fixed huffman tables if first call (may not be thread safe) */
+; 270 : if (virgin) {
+; 271 : unsigned sym, bits;
+; 272 : static code *next;
+; 273 :
+; 274 : /* literal/length table */
+; 275 : sym = 0;
+; 276 : while (sym < 144) state->lens[sym++] = 8;
+; 277 : while (sym < 256) state->lens[sym++] = 9;
+; 278 : while (sym < 280) state->lens[sym++] = 7;
+; 279 : while (sym < 288) state->lens[sym++] = 8;
+; 280 : next = fixed;
+; 281 : lenfix = next;
+; 282 : bits = 9;
+; 283 : inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
+; 284 :
+; 285 : /* distance table */
+; 286 : sym = 0;
+; 287 : while (sym < 32) state->lens[sym++] = 5;
+; 288 : distfix = next;
+; 289 : bits = 5;
+; 290 : inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
+; 291 :
+; 292 : /* do this just once */
+; 293 : virgin = 0;
+; 294 : }
+; 295 : #else /* !BUILDFIXED */
+; 296 : # include "inffixed.h"
+; 297 : #endif /* BUILDFIXED */
+; 298 : state->lencode = lenfix;
+
+ 00000 c7 41 4c 00 00
+ 00 00 mov DWORD PTR [ecx+76], OFFSET ?lenfix@?1??fixedtables@@9@9
+
+; 299 : state->lenbits = 9;
+
+ 00007 c7 41 54 09 00
+ 00 00 mov DWORD PTR [ecx+84], 9
+
+; 300 : state->distcode = distfix;
+
+ 0000e c7 41 50 00 00
+ 00 00 mov DWORD PTR [ecx+80], OFFSET ?distfix@?1??fixedtables@@9@9
+
+; 301 : state->distbits = 5;
+
+ 00015 c7 41 58 05 00
+ 00 00 mov DWORD PTR [ecx+88], 5
+
+; 302 : }
+
+ 0001c c3 ret 0
+_fixedtables ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\inflate.c
+; COMDAT _updatewindow
+_TEXT SEGMENT
+_end$1$ = -4 ; size = 4
+_copy$ = 8 ; size = 4
+_updatewindow PROC ; COMDAT
+; _strm$ = ecx
+; _end$ = edx
+
+; 383 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 51 push ecx
+ 00004 8b c2 mov eax, edx
+ 00006 8b d1 mov edx, ecx
+ 00008 56 push esi
+ 00009 57 push edi
+ 0000a 89 45 fc mov DWORD PTR _end$1$[ebp], eax
+
+; 384 : struct inflate_state FAR *state;
+; 385 : unsigned dist;
+; 386 :
+; 387 : state = (struct inflate_state FAR *)strm->state;
+; 388 :
+; 389 : /* if it hasn't been done already, allocate space for the window */
+; 390 : if (state->window == Z_NULL) {
+
+ 0000d bf 01 00 00 00 mov edi, 1
+ 00012 8b 72 1c mov esi, DWORD PTR [edx+28]
+ 00015 83 7e 34 00 cmp DWORD PTR [esi+52], 0
+ 00019 75 26 jne SHORT $LN3@updatewind
+
+; 391 : state->window = (unsigned char FAR *)
+
+ 0001b 8b 4e 24 mov ecx, DWORD PTR [esi+36]
+ 0001e 8b c7 mov eax, edi
+ 00020 d3 e0 shl eax, cl
+ 00022 57 push edi
+ 00023 50 push eax
+ 00024 ff 72 28 push DWORD PTR [edx+40]
+ 00027 8b 42 20 mov eax, DWORD PTR [edx+32]
+ 0002a ff d0 call eax
+ 0002c 83 c4 0c add esp, 12 ; 0000000cH
+ 0002f 89 46 34 mov DWORD PTR [esi+52], eax
+
+; 392 : ZALLOC(strm, 1U << state->wbits,
+; 393 : sizeof(unsigned char));
+; 394 : if (state->window == Z_NULL) return 1;
+
+ 00032 85 c0 test eax, eax
+ 00034 75 08 jne SHORT $LN13@updatewind
+ 00036 8b c7 mov eax, edi
+ 00038 5f pop edi
+ 00039 5e pop esi
+
+; 427 : }
+
+ 0003a 8b e5 mov esp, ebp
+ 0003c 5d pop ebp
+ 0003d c3 ret 0
+$LN13@updatewind:
+ 0003e 8b 45 fc mov eax, DWORD PTR _end$1$[ebp]
+$LN3@updatewind:
+
+; 395 : }
+; 396 :
+; 397 : /* if window not in use yet, initialize */
+; 398 : if (state->wsize == 0) {
+
+ 00041 83 7e 28 00 cmp DWORD PTR [esi+40], 0
+ 00045 75 16 jne SHORT $LN4@updatewind
+
+; 399 : state->wsize = 1U << state->wbits;
+
+ 00047 8b 4e 24 mov ecx, DWORD PTR [esi+36]
+ 0004a d3 e7 shl edi, cl
+ 0004c 89 7e 28 mov DWORD PTR [esi+40], edi
+
+; 400 : state->wnext = 0;
+
+ 0004f c7 46 30 00 00
+ 00 00 mov DWORD PTR [esi+48], 0
+
+; 401 : state->whave = 0;
+
+ 00056 c7 46 2c 00 00
+ 00 00 mov DWORD PTR [esi+44], 0
+$LN4@updatewind:
+
+; 402 : }
+; 403 :
+; 404 : /* copy state->wsize or less output bytes into the circular window */
+; 405 : if (copy >= state->wsize) {
+
+ 0005d 8b 7e 28 mov edi, DWORD PTR [esi+40]
+ 00060 53 push ebx
+ 00061 8b 5d 08 mov ebx, DWORD PTR _copy$[ebp]
+ 00064 3b df cmp ebx, edi
+ 00066 72 25 jb SHORT $LN5@updatewind
+
+; 406 : zmemcpy(state->window, end - state->wsize, state->wsize);
+
+ 00068 57 push edi
+ 00069 2b c7 sub eax, edi
+ 0006b 50 push eax
+ 0006c ff 76 34 push DWORD PTR [esi+52]
+ 0006f e8 00 00 00 00 call _memcpy
+
+; 407 : state->wnext = 0;
+; 408 : state->whave = state->wsize;
+
+ 00074 8b 46 28 mov eax, DWORD PTR [esi+40]
+ 00077 83 c4 0c add esp, 12 ; 0000000cH
+
+; 423 : if (state->whave < state->wsize) state->whave += dist;
+
+ 0007a 89 46 2c mov DWORD PTR [esi+44], eax
+
+; 424 : }
+; 425 : }
+; 426 : return 0;
+
+ 0007d 33 c0 xor eax, eax
+ 0007f c7 46 30 00 00
+ 00 00 mov DWORD PTR [esi+48], 0
+ 00086 5b pop ebx
+ 00087 5f pop edi
+ 00088 5e pop esi
+
+; 427 : }
+
+ 00089 8b e5 mov esp, ebp
+ 0008b 5d pop ebp
+ 0008c c3 ret 0
+$LN5@updatewind:
+
+; 409 : }
+; 410 : else {
+; 411 : dist = state->wsize - state->wnext;
+
+ 0008d 2b 7e 30 sub edi, DWORD PTR [esi+48]
+
+; 412 : if (dist > copy) dist = copy;
+
+ 00090 3b fb cmp edi, ebx
+ 00092 0f 47 fb cmova edi, ebx
+
+; 413 : zmemcpy(state->window + state->wnext, end - copy, dist);
+
+ 00095 2b c3 sub eax, ebx
+ 00097 57 push edi
+ 00098 50 push eax
+ 00099 8b 46 34 mov eax, DWORD PTR [esi+52]
+ 0009c 03 46 30 add eax, DWORD PTR [esi+48]
+ 0009f 50 push eax
+ 000a0 e8 00 00 00 00 call _memcpy
+ 000a5 83 c4 0c add esp, 12 ; 0000000cH
+
+; 414 : copy -= dist;
+
+ 000a8 2b df sub ebx, edi
+
+; 415 : if (copy) {
+
+ 000aa 74 24 je SHORT $LN8@updatewind
+
+; 416 : zmemcpy(state->window, end - copy, copy);
+
+ 000ac 8b 45 fc mov eax, DWORD PTR _end$1$[ebp]
+ 000af 53 push ebx
+ 000b0 2b c3 sub eax, ebx
+ 000b2 50 push eax
+ 000b3 ff 76 34 push DWORD PTR [esi+52]
+ 000b6 e8 00 00 00 00 call _memcpy
+
+; 417 : state->wnext = copy;
+; 418 : state->whave = state->wsize;
+
+ 000bb 8b 46 28 mov eax, DWORD PTR [esi+40]
+ 000be 83 c4 0c add esp, 12 ; 0000000cH
+ 000c1 89 5e 30 mov DWORD PTR [esi+48], ebx
+
+; 423 : if (state->whave < state->wsize) state->whave += dist;
+
+ 000c4 89 46 2c mov DWORD PTR [esi+44], eax
+
+; 424 : }
+; 425 : }
+; 426 : return 0;
+
+ 000c7 33 c0 xor eax, eax
+ 000c9 5b pop ebx
+ 000ca 5f pop edi
+ 000cb 5e pop esi
+
+; 427 : }
+
+ 000cc 8b e5 mov esp, ebp
+ 000ce 5d pop ebp
+ 000cf c3 ret 0
+$LN8@updatewind:
+
+; 419 : }
+; 420 : else {
+; 421 : state->wnext += dist;
+
+ 000d0 01 7e 30 add DWORD PTR [esi+48], edi
+
+; 422 : if (state->wnext == state->wsize) state->wnext = 0;
+
+ 000d3 8b 4e 28 mov ecx, DWORD PTR [esi+40]
+ 000d6 39 4e 30 cmp DWORD PTR [esi+48], ecx
+ 000d9 75 07 jne SHORT $LN10@updatewind
+ 000db c7 46 30 00 00
+ 00 00 mov DWORD PTR [esi+48], 0
+$LN10@updatewind:
+
+; 423 : if (state->whave < state->wsize) state->whave += dist;
+
+ 000e2 8b 46 2c mov eax, DWORD PTR [esi+44]
+ 000e5 3b c1 cmp eax, ecx
+ 000e7 73 05 jae SHORT $LN11@updatewind
+ 000e9 03 c7 add eax, edi
+ 000eb 89 46 2c mov DWORD PTR [esi+44], eax
+$LN11@updatewind:
+
+; 424 : }
+; 425 : }
+; 426 : return 0;
+
+ 000ee 5b pop ebx
+ 000ef 5f pop edi
+ 000f0 33 c0 xor eax, eax
+ 000f2 5e pop esi
+
+; 427 : }
+
+ 000f3 8b e5 mov esp, ebp
+ 000f5 5d pop ebp
+ 000f6 c3 ret 0
+_updatewindow ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\inflate.c
+; COMDAT _inflateGetDictionary@12
+_TEXT SEGMENT
+_strm$ = 8 ; size = 4
+_dictionary$ = 12 ; size = 4
+_dictLength$ = 16 ; size = 4
+_inflateGetDictionary@12 PROC ; COMDAT
+
+; 1272 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 56 push esi
+
+; 1273 : struct inflate_state FAR *state;
+; 1274 :
+; 1275 : /* check state */
+; 1276 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 00004 8b 75 08 mov esi, DWORD PTR _strm$[ebp]
+ 00007 85 f6 test esi, esi
+ 00009 74 52 je SHORT $LN3@inflateGet
+ 0000b 8b 76 1c mov esi, DWORD PTR [esi+28]
+ 0000e 85 f6 test esi, esi
+ 00010 74 4b je SHORT $LN3@inflateGet
+
+; 1277 : state = (struct inflate_state FAR *)strm->state;
+; 1278 :
+; 1279 : /* copy dictionary */
+; 1280 : if (state->whave && dictionary != Z_NULL) {
+
+ 00012 8b 46 2c mov eax, DWORD PTR [esi+44]
+ 00015 85 c0 test eax, eax
+ 00017 74 31 je SHORT $LN4@inflateGet
+ 00019 57 push edi
+ 0001a 8b 7d 0c mov edi, DWORD PTR _dictionary$[ebp]
+ 0001d 85 ff test edi, edi
+ 0001f 74 28 je SHORT $LN7@inflateGet
+
+; 1281 : zmemcpy(dictionary, state->window + state->wnext,
+
+ 00021 2b 46 30 sub eax, DWORD PTR [esi+48]
+ 00024 50 push eax
+ 00025 8b 46 34 mov eax, DWORD PTR [esi+52]
+ 00028 03 46 30 add eax, DWORD PTR [esi+48]
+ 0002b 50 push eax
+ 0002c 57 push edi
+ 0002d e8 00 00 00 00 call _memcpy
+
+; 1282 : state->whave - state->wnext);
+; 1283 : zmemcpy(dictionary + state->whave - state->wnext,
+
+ 00032 8b 4e 30 mov ecx, DWORD PTR [esi+48]
+ 00035 8b 46 2c mov eax, DWORD PTR [esi+44]
+ 00038 51 push ecx
+ 00039 ff 76 34 push DWORD PTR [esi+52]
+ 0003c 2b c1 sub eax, ecx
+ 0003e 03 c7 add eax, edi
+ 00040 50 push eax
+ 00041 e8 00 00 00 00 call _memcpy
+ 00046 83 c4 18 add esp, 24 ; 00000018H
+$LN7@inflateGet:
+ 00049 5f pop edi
+$LN4@inflateGet:
+
+; 1284 : state->window, state->wnext);
+; 1285 : }
+; 1286 : if (dictLength != Z_NULL)
+
+ 0004a 8b 4d 10 mov ecx, DWORD PTR _dictLength$[ebp]
+ 0004d 85 c9 test ecx, ecx
+ 0004f 74 05 je SHORT $LN5@inflateGet
+
+; 1287 : *dictLength = state->whave;
+
+ 00051 8b 46 2c mov eax, DWORD PTR [esi+44]
+ 00054 89 01 mov DWORD PTR [ecx], eax
+$LN5@inflateGet:
+
+; 1288 : return Z_OK;
+
+ 00056 33 c0 xor eax, eax
+ 00058 5e pop esi
+
+; 1289 : }
+
+ 00059 5d pop ebp
+ 0005a c2 0c 00 ret 12 ; 0000000cH
+$LN3@inflateGet:
+
+; 1273 : struct inflate_state FAR *state;
+; 1274 :
+; 1275 : /* check state */
+; 1276 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 0005d b8 fe ff ff ff mov eax, -2 ; fffffffeH
+ 00062 5e pop esi
+
+; 1289 : }
+
+ 00063 5d pop ebp
+ 00064 c2 0c 00 ret 12 ; 0000000cH
+_inflateGetDictionary@12 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\inflate.c
+; COMDAT _inflateSetDictionary@12
+_TEXT SEGMENT
+_strm$ = 8 ; size = 4
+_dictionary$ = 12 ; size = 4
+_dictLength$ = 16 ; size = 4
+_inflateSetDictionary@12 PROC ; COMDAT
+
+; 1295 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 56 push esi
+ 00004 57 push edi
+
+; 1296 : struct inflate_state FAR *state;
+; 1297 : unsigned long dictid;
+; 1298 : int ret;
+; 1299 :
+; 1300 : /* check state */
+; 1301 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 00005 8b 7d 08 mov edi, DWORD PTR _strm$[ebp]
+ 00008 85 ff test edi, edi
+ 0000a 0f 84 84 00 00
+ 00 je $LN3@inflateSet
+ 00010 8b 77 1c mov esi, DWORD PTR [edi+28]
+ 00013 85 f6 test esi, esi
+ 00015 74 7d je SHORT $LN3@inflateSet
+
+; 1302 : state = (struct inflate_state FAR *)strm->state;
+; 1303 : if (state->wrap != 0 && state->mode != DICT)
+
+ 00017 83 7e 08 00 cmp DWORD PTR [esi+8], 0
+ 0001b 53 push ebx
+ 0001c 8b 5d 10 mov ebx, DWORD PTR _dictLength$[ebp]
+ 0001f 74 11 je SHORT $LN4@inflateSet
+ 00021 83 3e 0a cmp DWORD PTR [esi], 10 ; 0000000aH
+ 00024 74 11 je SHORT $LN9@inflateSet
+
+; 1304 : return Z_STREAM_ERROR;
+
+ 00026 5b pop ebx
+ 00027 5f pop edi
+ 00028 b8 fe ff ff ff mov eax, -2 ; fffffffeH
+ 0002d 5e pop esi
+
+; 1324 : }
+
+ 0002e 5d pop ebp
+ 0002f c2 0c 00 ret 12 ; 0000000cH
+$LN4@inflateSet:
+
+; 1305 :
+; 1306 : /* check for correct dictionary identifier */
+; 1307 : if (state->mode == DICT) {
+
+ 00032 83 3e 0a cmp DWORD PTR [esi], 10 ; 0000000aH
+ 00035 75 26 jne SHORT $LN6@inflateSet
+$LN9@inflateSet:
+
+; 1308 : dictid = adler32(0L, Z_NULL, 0);
+; 1309 : dictid = adler32(dictid, dictionary, dictLength);
+
+ 00037 53 push ebx
+ 00038 ff 75 0c push DWORD PTR _dictionary$[ebp]
+ 0003b 6a 00 push 0
+ 0003d 6a 00 push 0
+ 0003f 6a 00 push 0
+ 00041 e8 00 00 00 00 call _adler32@12
+ 00046 50 push eax
+ 00047 e8 00 00 00 00 call _adler32@12
+
+; 1310 : if (dictid != state->check)
+
+ 0004c 3b 46 18 cmp eax, DWORD PTR [esi+24]
+ 0004f 74 0c je SHORT $LN6@inflateSet
+
+; 1311 : return Z_DATA_ERROR;
+
+ 00051 5b pop ebx
+ 00052 5f pop edi
+ 00053 b8 fd ff ff ff mov eax, -3 ; fffffffdH
+ 00058 5e pop esi
+
+; 1324 : }
+
+ 00059 5d pop ebp
+ 0005a c2 0c 00 ret 12 ; 0000000cH
+$LN6@inflateSet:
+
+; 1312 : }
+; 1313 :
+; 1314 : /* copy dictionary to window using updatewindow(), which will amend the
+; 1315 : existing dictionary if appropriate */
+; 1316 : ret = updatewindow(strm, dictionary + dictLength, dictLength);
+
+ 0005d 8b 55 0c mov edx, DWORD PTR _dictionary$[ebp]
+ 00060 8b cf mov ecx, edi
+ 00062 53 push ebx
+ 00063 8d 14 1a lea edx, DWORD PTR [edx+ebx]
+ 00066 e8 00 00 00 00 call _updatewindow
+ 0006b 83 c4 04 add esp, 4
+
+; 1317 : if (ret) {
+
+ 0006e 85 c0 test eax, eax
+ 00070 74 12 je SHORT $LN7@inflateSet
+
+; 1318 : state->mode = MEM;
+
+ 00072 5b pop ebx
+ 00073 5f pop edi
+ 00074 c7 06 1e 00 00
+ 00 mov DWORD PTR [esi], 30 ; 0000001eH
+
+; 1319 : return Z_MEM_ERROR;
+
+ 0007a b8 fc ff ff ff mov eax, -4 ; fffffffcH
+ 0007f 5e pop esi
+
+; 1324 : }
+
+ 00080 5d pop ebp
+ 00081 c2 0c 00 ret 12 ; 0000000cH
+$LN7@inflateSet:
+ 00084 5b pop ebx
+ 00085 5f pop edi
+
+; 1320 : }
+; 1321 : state->havedict = 1;
+
+ 00086 c7 46 0c 01 00
+ 00 00 mov DWORD PTR [esi+12], 1
+
+; 1322 : Tracev((stderr, "inflate: dictionary set\n"));
+; 1323 : return Z_OK;
+
+ 0008d 33 c0 xor eax, eax
+ 0008f 5e pop esi
+
+; 1324 : }
+
+ 00090 5d pop ebp
+ 00091 c2 0c 00 ret 12 ; 0000000cH
+$LN3@inflateSet:
+ 00094 5f pop edi
+
+; 1296 : struct inflate_state FAR *state;
+; 1297 : unsigned long dictid;
+; 1298 : int ret;
+; 1299 :
+; 1300 : /* check state */
+; 1301 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 00095 b8 fe ff ff ff mov eax, -2 ; fffffffeH
+ 0009a 5e pop esi
+
+; 1324 : }
+
+ 0009b 5d pop ebp
+ 0009c c2 0c 00 ret 12 ; 0000000cH
+_inflateSetDictionary@12 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\inflate.c
+; COMDAT _inflateGetHeader@8
+_TEXT SEGMENT
+_strm$ = 8 ; size = 4
+_head$ = 12 ; size = 4
+_inflateGetHeader@8 PROC ; COMDAT
+
+; 1329 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 1330 : struct inflate_state FAR *state;
+; 1331 :
+; 1332 : /* check state */
+; 1333 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 00003 8b 4d 08 mov ecx, DWORD PTR _strm$[ebp]
+ 00006 85 c9 test ecx, ecx
+ 00008 74 20 je SHORT $LN3@inflateGet
+ 0000a 8b 49 1c mov ecx, DWORD PTR [ecx+28]
+ 0000d 85 c9 test ecx, ecx
+ 0000f 74 19 je SHORT $LN3@inflateGet
+
+; 1334 : state = (struct inflate_state FAR *)strm->state;
+; 1335 : if ((state->wrap & 2) == 0) return Z_STREAM_ERROR;
+
+ 00011 f6 41 08 02 test BYTE PTR [ecx+8], 2
+ 00015 74 13 je SHORT $LN3@inflateGet
+
+; 1336 :
+; 1337 : /* save header structure */
+; 1338 : state->head = head;
+
+ 00017 8b 45 0c mov eax, DWORD PTR _head$[ebp]
+ 0001a 89 41 20 mov DWORD PTR [ecx+32], eax
+
+; 1339 : head->done = 0;
+
+ 0001d c7 40 30 00 00
+ 00 00 mov DWORD PTR [eax+48], 0
+
+; 1340 : return Z_OK;
+
+ 00024 33 c0 xor eax, eax
+
+; 1341 : }
+
+ 00026 5d pop ebp
+ 00027 c2 08 00 ret 8
+$LN3@inflateGet:
+
+; 1330 : struct inflate_state FAR *state;
+; 1331 :
+; 1332 : /* check state */
+; 1333 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 0002a b8 fe ff ff ff mov eax, -2 ; fffffffeH
+
+; 1341 : }
+
+ 0002f 5d pop ebp
+ 00030 c2 08 00 ret 8
+_inflateGetHeader@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\inflate.c
+; COMDAT _syncsearch
+_TEXT SEGMENT
+_buf$1$ = -8 ; size = 4
+_have$1$ = -4 ; size = 4
+_len$ = 8 ; size = 4
+_syncsearch PROC ; COMDAT
+; _have$ = ecx
+; _buf$ = edx
+
+; 1358 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 08 sub esp, 8
+
+; 1359 : unsigned got;
+; 1360 : unsigned next;
+; 1361 :
+; 1362 : got = *have;
+
+ 00006 8b 01 mov eax, DWORD PTR [ecx]
+ 00008 56 push esi
+ 00009 57 push edi
+
+; 1363 : next = 0;
+; 1364 : while (next < len && got < 4) {
+
+ 0000a 8b 7d 08 mov edi, DWORD PTR _len$[ebp]
+ 0000d 33 f6 xor esi, esi
+ 0000f 89 55 f8 mov DWORD PTR _buf$1$[ebp], edx
+ 00012 89 4d fc mov DWORD PTR _have$1$[ebp], ecx
+ 00015 85 ff test edi, edi
+ 00017 74 50 je SHORT $LN13@syncsearch
+ 00019 53 push ebx
+ 0001a 66 0f 1f 44 00
+ 00 npad 6
+$LL2@syncsearch:
+ 00020 83 f8 04 cmp eax, 4
+ 00023 73 36 jae SHORT $LN14@syncsearch
+
+; 1365 : if ((int)(buf[next]) == (got < 2 ? 0 : 0xff))
+
+ 00025 8a 1c 16 mov bl, BYTE PTR [esi+edx]
+ 00028 83 f8 02 cmp eax, 2
+ 0002b 0f b6 cb movzx ecx, bl
+ 0002e 1b d2 sbb edx, edx
+ 00030 81 e2 01 ff ff
+ ff and edx, -255 ; ffffff01H
+ 00036 81 c2 ff 00 00
+ 00 add edx, 255 ; 000000ffH
+ 0003c 3b ca cmp ecx, edx
+ 0003e 75 03 jne SHORT $LN4@syncsearch
+
+; 1366 : got++;
+
+ 00040 40 inc eax
+ 00041 eb 10 jmp SHORT $LN7@syncsearch
+$LN4@syncsearch:
+
+; 1367 : else if (buf[next])
+; 1368 : got = 0;
+; 1369 : else
+; 1370 : got = 4 - got;
+
+ 00043 b9 04 00 00 00 mov ecx, 4
+ 00048 33 d2 xor edx, edx
+ 0004a 2b c8 sub ecx, eax
+ 0004c 84 db test bl, bl
+ 0004e 8b c1 mov eax, ecx
+ 00050 0f 45 c2 cmovne eax, edx
+$LN7@syncsearch:
+
+; 1371 : next++;
+
+ 00053 8b 55 f8 mov edx, DWORD PTR _buf$1$[ebp]
+ 00056 46 inc esi
+ 00057 3b f7 cmp esi, edi
+ 00059 72 c5 jb SHORT $LL2@syncsearch
+$LN14@syncsearch:
+
+; 1372 : }
+; 1373 : *have = got;
+
+ 0005b 8b 4d fc mov ecx, DWORD PTR _have$1$[ebp]
+ 0005e 5b pop ebx
+ 0005f 5f pop edi
+ 00060 89 01 mov DWORD PTR [ecx], eax
+
+; 1374 : return next;
+
+ 00062 8b c6 mov eax, esi
+ 00064 5e pop esi
+
+; 1375 : }
+
+ 00065 8b e5 mov esp, ebp
+ 00067 5d pop ebp
+ 00068 c3 ret 0
+$LN13@syncsearch:
+
+; 1372 : }
+; 1373 : *have = got;
+
+ 00069 89 01 mov DWORD PTR [ecx], eax
+
+; 1374 : return next;
+
+ 0006b 8b c6 mov eax, esi
+ 0006d 5f pop edi
+ 0006e 5e pop esi
+
+; 1375 : }
+
+ 0006f 8b e5 mov esp, ebp
+ 00071 5d pop ebp
+ 00072 c3 ret 0
+_syncsearch ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\inflate.c
+; COMDAT _inflateSync@4
+_TEXT SEGMENT
+_in$1$ = 8 ; size = 4
+_buf$ = 8 ; size = 4
+_strm$ = 8 ; size = 4
+_inflateSync@4 PROC ; COMDAT
+
+; 1379 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 53 push ebx
+
+; 1380 : unsigned len; /* number of bytes to look at or looked at */
+; 1381 : unsigned long in, out; /* temporary to save total_in and total_out */
+; 1382 : unsigned char buf[4]; /* to restore bit buffer to byte string */
+; 1383 : struct inflate_state FAR *state;
+; 1384 :
+; 1385 : /* check parameters */
+; 1386 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 00004 8b 5d 08 mov ebx, DWORD PTR _strm$[ebp]
+ 00007 57 push edi
+ 00008 85 db test ebx, ebx
+ 0000a 0f 84 cf 00 00
+ 00 je $LN5@inflateSyn
+ 00010 8b 7b 1c mov edi, DWORD PTR [ebx+28]
+ 00013 85 ff test edi, edi
+ 00015 0f 84 c4 00 00
+ 00 je $LN5@inflateSyn
+
+; 1387 : state = (struct inflate_state FAR *)strm->state;
+; 1388 : if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR;
+
+ 0001b 83 7b 04 00 cmp DWORD PTR [ebx+4], 0
+ 0001f 75 11 jne SHORT $LN6@inflateSyn
+ 00021 83 7f 3c 08 cmp DWORD PTR [edi+60], 8
+ 00025 73 0b jae SHORT $LN6@inflateSyn
+ 00027 5f pop edi
+ 00028 b8 fb ff ff ff mov eax, -5 ; fffffffbH
+ 0002d 5b pop ebx
+
+; 1418 : }
+
+ 0002e 5d pop ebp
+ 0002f c2 04 00 ret 4
+$LN6@inflateSyn:
+
+; 1389 :
+; 1390 : /* if first time, start search in bit buffer */
+; 1391 : if (state->mode != SYNC) {
+
+ 00032 83 3f 1f cmp DWORD PTR [edi], 31 ; 0000001fH
+ 00035 56 push esi
+ 00036 74 56 je SHORT $LN7@inflateSyn
+
+; 1392 : state->mode = SYNC;
+; 1393 : state->hold <<= state->bits & 7;
+
+ 00038 8b 57 3c mov edx, DWORD PTR [edi+60]
+
+; 1394 : state->bits -= state->bits & 7;
+; 1395 : len = 0;
+
+ 0003b 33 f6 xor esi, esi
+ 0003d 8b ca mov ecx, edx
+ 0003f c7 07 1f 00 00
+ 00 mov DWORD PTR [edi], 31 ; 0000001fH
+ 00045 83 e1 07 and ecx, 7
+ 00048 d3 67 38 shl DWORD PTR [edi+56], cl
+ 0004b 2b d1 sub edx, ecx
+ 0004d 89 57 3c mov DWORD PTR [edi+60], edx
+
+; 1396 : while (state->bits >= 8) {
+
+ 00050 83 fa 08 cmp edx, 8
+ 00053 72 24 jb SHORT $LN3@inflateSyn
+ 00055 8b 4f 38 mov ecx, DWORD PTR [edi+56]
+ 00058 0f 1f 84 00 00
+ 00 00 00 npad 8
+$LL2@inflateSyn:
+
+; 1397 : buf[len++] = (unsigned char)(state->hold);
+
+ 00060 8a 47 38 mov al, BYTE PTR [edi+56]
+
+; 1398 : state->hold >>= 8;
+; 1399 : state->bits -= 8;
+
+ 00063 83 ea 08 sub edx, 8
+ 00066 88 44 35 08 mov BYTE PTR _buf$[ebp+esi], al
+ 0006a 46 inc esi
+ 0006b c1 e9 08 shr ecx, 8
+ 0006e 89 4f 38 mov DWORD PTR [edi+56], ecx
+ 00071 83 fa 08 cmp edx, 8
+ 00074 73 ea jae SHORT $LL2@inflateSyn
+ 00076 89 57 3c mov DWORD PTR [edi+60], edx
+$LN3@inflateSyn:
+
+; 1400 : }
+; 1401 : state->have = 0;
+
+ 00079 8d 4f 68 lea ecx, DWORD PTR [edi+104]
+
+; 1402 : syncsearch(&(state->have), buf, len);
+
+ 0007c 8d 55 08 lea edx, DWORD PTR _buf$[ebp]
+ 0007f c7 01 00 00 00
+ 00 mov DWORD PTR [ecx], 0
+ 00085 56 push esi
+ 00086 e8 00 00 00 00 call _syncsearch
+ 0008b 83 c4 04 add esp, 4
+$LN7@inflateSyn:
+
+; 1403 : }
+; 1404 :
+; 1405 : /* search available input */
+; 1406 : len = syncsearch(&(state->have), strm->next_in, strm->avail_in);
+
+ 0008e ff 73 04 push DWORD PTR [ebx+4]
+ 00091 8b 13 mov edx, DWORD PTR [ebx]
+ 00093 8d 4f 68 lea ecx, DWORD PTR [edi+104]
+ 00096 e8 00 00 00 00 call _syncsearch
+
+; 1407 : strm->avail_in -= len;
+
+ 0009b 29 43 04 sub DWORD PTR [ebx+4], eax
+ 0009e 83 c4 04 add esp, 4
+
+; 1408 : strm->next_in += len;
+
+ 000a1 01 03 add DWORD PTR [ebx], eax
+
+; 1409 : strm->total_in += len;
+
+ 000a3 01 43 08 add DWORD PTR [ebx+8], eax
+
+; 1410 :
+; 1411 : /* return no joy or set up to restart inflate() on a new block */
+; 1412 : if (state->have != 4) return Z_DATA_ERROR;
+
+ 000a6 83 7f 68 04 cmp DWORD PTR [edi+104], 4
+ 000aa 8b 43 08 mov eax, DWORD PTR [ebx+8]
+ 000ad 89 45 08 mov DWORD PTR _in$1$[ebp], eax
+ 000b0 74 0c je SHORT $LN8@inflateSyn
+ 000b2 5e pop esi
+ 000b3 5f pop edi
+ 000b4 b8 fd ff ff ff mov eax, -3 ; fffffffdH
+ 000b9 5b pop ebx
+
+; 1418 : }
+
+ 000ba 5d pop ebp
+ 000bb c2 04 00 ret 4
+$LN8@inflateSyn:
+
+; 1413 : in = strm->total_in; out = strm->total_out;
+
+ 000be 8b 73 14 mov esi, DWORD PTR [ebx+20]
+
+; 1414 : inflateReset(strm);
+
+ 000c1 53 push ebx
+ 000c2 e8 00 00 00 00 call _inflateReset@4
+
+; 1415 : strm->total_in = in; strm->total_out = out;
+
+ 000c7 8b 45 08 mov eax, DWORD PTR _in$1$[ebp]
+ 000ca 89 73 14 mov DWORD PTR [ebx+20], esi
+ 000cd 89 43 08 mov DWORD PTR [ebx+8], eax
+
+; 1416 : state->mode = TYPE;
+; 1417 : return Z_OK;
+
+ 000d0 33 c0 xor eax, eax
+ 000d2 5e pop esi
+ 000d3 c7 07 0b 00 00
+ 00 mov DWORD PTR [edi], 11 ; 0000000bH
+ 000d9 5f pop edi
+ 000da 5b pop ebx
+
+; 1418 : }
+
+ 000db 5d pop ebp
+ 000dc c2 04 00 ret 4
+$LN5@inflateSyn:
+ 000df 5f pop edi
+
+; 1380 : unsigned len; /* number of bytes to look at or looked at */
+; 1381 : unsigned long in, out; /* temporary to save total_in and total_out */
+; 1382 : unsigned char buf[4]; /* to restore bit buffer to byte string */
+; 1383 : struct inflate_state FAR *state;
+; 1384 :
+; 1385 : /* check parameters */
+; 1386 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 000e0 b8 fe ff ff ff mov eax, -2 ; fffffffeH
+ 000e5 5b pop ebx
+
+; 1418 : }
+
+ 000e6 5d pop ebp
+ 000e7 c2 04 00 ret 4
+_inflateSync@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\inflate.c
+; COMDAT _inflateSyncPoint@4
+_TEXT SEGMENT
+_strm$ = 8 ; size = 4
+_inflateSyncPoint@4 PROC ; COMDAT
+
+; 1430 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 1431 : struct inflate_state FAR *state;
+; 1432 :
+; 1433 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 00003 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 00006 85 c0 test eax, eax
+ 00008 74 21 je SHORT $LN3@inflateSyn
+ 0000a 8b 40 1c mov eax, DWORD PTR [eax+28]
+ 0000d 85 c0 test eax, eax
+ 0000f 74 1a je SHORT $LN3@inflateSyn
+
+; 1434 : state = (struct inflate_state FAR *)strm->state;
+; 1435 : return state->mode == STORED && state->bits == 0;
+
+ 00011 83 38 0d cmp DWORD PTR [eax], 13 ; 0000000dH
+ 00014 75 0f jne SHORT $LN5@inflateSyn
+ 00016 83 78 3c 00 cmp DWORD PTR [eax+60], 0
+ 0001a 75 09 jne SHORT $LN5@inflateSyn
+ 0001c b8 01 00 00 00 mov eax, 1
+
+; 1436 : }
+
+ 00021 5d pop ebp
+ 00022 c2 04 00 ret 4
+$LN5@inflateSyn:
+
+; 1434 : state = (struct inflate_state FAR *)strm->state;
+; 1435 : return state->mode == STORED && state->bits == 0;
+
+ 00025 33 c0 xor eax, eax
+
+; 1436 : }
+
+ 00027 5d pop ebp
+ 00028 c2 04 00 ret 4
+$LN3@inflateSyn:
+
+; 1431 : struct inflate_state FAR *state;
+; 1432 :
+; 1433 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 0002b b8 fe ff ff ff mov eax, -2 ; fffffffeH
+
+; 1436 : }
+
+ 00030 5d pop ebp
+ 00031 c2 04 00 ret 4
+_inflateSyncPoint@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\inflate.c
+; COMDAT _inflateCopy@8
+_TEXT SEGMENT
+_dest$ = 8 ; size = 4
+_window$1$ = 12 ; size = 4
+_source$ = 12 ; size = 4
+_inflateCopy@8 PROC ; COMDAT
+
+; 1441 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 1442 : struct inflate_state FAR *state;
+; 1443 : struct inflate_state FAR *copy;
+; 1444 : unsigned char FAR *window;
+; 1445 : unsigned wsize;
+; 1446 :
+; 1447 : /* check input */
+; 1448 : if (dest == Z_NULL || source == Z_NULL || source->state == Z_NULL ||
+; 1449 : source->zalloc == (alloc_func)0 || source->zfree == (free_func)0)
+
+ 00003 8b 45 08 mov eax, DWORD PTR _dest$[ebp]
+ 00006 56 push esi
+ 00007 57 push edi
+ 00008 85 c0 test eax, eax
+ 0000a 0f 84 44 01 00
+ 00 je $LN3@inflateCop
+ 00010 8b 75 0c mov esi, DWORD PTR _source$[ebp]
+ 00013 85 f6 test esi, esi
+ 00015 0f 84 39 01 00
+ 00 je $LN3@inflateCop
+ 0001b 8b 7e 1c mov edi, DWORD PTR [esi+28]
+ 0001e 85 ff test edi, edi
+ 00020 0f 84 2e 01 00
+ 00 je $LN3@inflateCop
+ 00026 8b 46 20 mov eax, DWORD PTR [esi+32]
+ 00029 85 c0 test eax, eax
+ 0002b 0f 84 23 01 00
+ 00 je $LN3@inflateCop
+ 00031 83 7e 24 00 cmp DWORD PTR [esi+36], 0
+ 00035 0f 84 19 01 00
+ 00 je $LN3@inflateCop
+
+; 1451 : state = (struct inflate_state FAR *)source->state;
+; 1452 :
+; 1453 : /* allocate space */
+; 1454 : copy = (struct inflate_state FAR *)
+
+ 0003b 53 push ebx
+ 0003c 68 cc 1b 00 00 push 7116 ; 00001bccH
+ 00041 6a 01 push 1
+ 00043 ff 76 28 push DWORD PTR [esi+40]
+ 00046 ff d0 call eax
+ 00048 8b d8 mov ebx, eax
+ 0004a 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1455 : ZALLOC(source, 1, sizeof(struct inflate_state));
+; 1456 : if (copy == Z_NULL) return Z_MEM_ERROR;
+
+ 0004d 85 db test ebx, ebx
+ 0004f 74 38 je SHORT $LN11@inflateCop
+
+; 1457 : window = Z_NULL;
+; 1458 : if (state->window != Z_NULL) {
+
+ 00051 83 7f 34 00 cmp DWORD PTR [edi+52], 0
+ 00055 c7 45 0c 00 00
+ 00 00 mov DWORD PTR _window$1$[ebp], 0
+ 0005c 74 37 je SHORT $LN6@inflateCop
+
+; 1459 : window = (unsigned char FAR *)
+
+ 0005e 8b 4f 24 mov ecx, DWORD PTR [edi+36]
+ 00061 b8 01 00 00 00 mov eax, 1
+ 00066 d3 e0 shl eax, cl
+ 00068 6a 01 push 1
+ 0006a 50 push eax
+ 0006b ff 76 28 push DWORD PTR [esi+40]
+ 0006e 8b 46 20 mov eax, DWORD PTR [esi+32]
+ 00071 ff d0 call eax
+ 00073 83 c4 0c add esp, 12 ; 0000000cH
+ 00076 89 45 0c mov DWORD PTR _window$1$[ebp], eax
+
+; 1460 : ZALLOC(source, 1U << state->wbits, sizeof(unsigned char));
+; 1461 : if (window == Z_NULL) {
+
+ 00079 85 c0 test eax, eax
+ 0007b 75 18 jne SHORT $LN6@inflateCop
+
+; 1462 : ZFREE(source, copy);
+
+ 0007d 8b 46 24 mov eax, DWORD PTR [esi+36]
+ 00080 53 push ebx
+ 00081 ff 76 28 push DWORD PTR [esi+40]
+ 00084 ff d0 call eax
+ 00086 83 c4 08 add esp, 8
+$LN11@inflateCop:
+
+; 1463 : return Z_MEM_ERROR;
+
+ 00089 5b pop ebx
+ 0008a 5f pop edi
+ 0008b b8 fc ff ff ff mov eax, -4 ; fffffffcH
+ 00090 5e pop esi
+
+; 1483 : }
+
+ 00091 5d pop ebp
+ 00092 c2 08 00 ret 8
+$LN6@inflateCop:
+
+; 1464 : }
+; 1465 : }
+; 1466 :
+; 1467 : /* copy state */
+; 1468 : zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream));
+
+ 00095 0f 10 06 movups xmm0, XMMWORD PTR [esi]
+ 00098 8b 45 08 mov eax, DWORD PTR _dest$[ebp]
+
+; 1469 : zmemcpy((voidpf)copy, (voidpf)state, sizeof(struct inflate_state));
+
+ 0009b 68 cc 1b 00 00 push 7116 ; 00001bccH
+ 000a0 57 push edi
+ 000a1 53 push ebx
+ 000a2 0f 11 00 movups XMMWORD PTR [eax], xmm0
+ 000a5 0f 10 46 10 movups xmm0, XMMWORD PTR [esi+16]
+ 000a9 0f 11 40 10 movups XMMWORD PTR [eax+16], xmm0
+ 000ad 0f 10 46 20 movups xmm0, XMMWORD PTR [esi+32]
+ 000b1 0f 11 40 20 movups XMMWORD PTR [eax+32], xmm0
+ 000b5 f3 0f 7e 46 30 movq xmm0, QWORD PTR [esi+48]
+ 000ba 66 0f d6 40 30 movq QWORD PTR [eax+48], xmm0
+ 000bf e8 00 00 00 00 call _memcpy
+
+; 1470 : if (state->lencode >= state->codes &&
+
+ 000c4 8b 4f 4c mov ecx, DWORD PTR [edi+76]
+ 000c7 8d 87 30 05 00
+ 00 lea eax, DWORD PTR [edi+1328]
+ 000cd 83 c4 0c add esp, 12 ; 0000000cH
+ 000d0 3b c8 cmp ecx, eax
+ 000d2 72 38 jb SHORT $LN7@inflateCop
+ 000d4 8d 87 bc 1b 00
+ 00 lea eax, DWORD PTR [edi+7100]
+ 000da 3b c8 cmp ecx, eax
+ 000dc 77 2e ja SHORT $LN7@inflateCop
+
+; 1471 : state->lencode <= state->codes + ENOUGH - 1) {
+; 1472 : copy->lencode = copy->codes + (state->lencode - state->codes);
+
+ 000de 2b cf sub ecx, edi
+ 000e0 8d 81 d0 fa ff
+ ff lea eax, DWORD PTR [ecx-1328]
+ 000e6 c1 f8 02 sar eax, 2
+ 000e9 05 4c 01 00 00 add eax, 332 ; 0000014cH
+ 000ee 8d 04 83 lea eax, DWORD PTR [ebx+eax*4]
+ 000f1 89 43 4c mov DWORD PTR [ebx+76], eax
+
+; 1473 : copy->distcode = copy->codes + (state->distcode - state->codes);
+
+ 000f4 8b 47 50 mov eax, DWORD PTR [edi+80]
+ 000f7 2b c7 sub eax, edi
+ 000f9 2d 30 05 00 00 sub eax, 1328 ; 00000530H
+ 000fe c1 f8 02 sar eax, 2
+ 00101 05 4c 01 00 00 add eax, 332 ; 0000014cH
+ 00106 8d 04 83 lea eax, DWORD PTR [ebx+eax*4]
+ 00109 89 43 50 mov DWORD PTR [ebx+80], eax
+$LN7@inflateCop:
+
+; 1474 : }
+; 1475 : copy->next = copy->codes + (state->next - state->codes);
+
+ 0010c 8b 47 6c mov eax, DWORD PTR [edi+108]
+
+; 1476 : if (window != Z_NULL) {
+
+ 0010f 8b 75 0c mov esi, DWORD PTR _window$1$[ebp]
+ 00112 2b c7 sub eax, edi
+ 00114 2d 30 05 00 00 sub eax, 1328 ; 00000530H
+ 00119 c1 f8 02 sar eax, 2
+ 0011c 05 4c 01 00 00 add eax, 332 ; 0000014cH
+ 00121 8d 04 83 lea eax, DWORD PTR [ebx+eax*4]
+ 00124 89 43 6c mov DWORD PTR [ebx+108], eax
+ 00127 85 f6 test esi, esi
+ 00129 74 17 je SHORT $LN8@inflateCop
+
+; 1477 : wsize = 1U << state->wbits;
+
+ 0012b 8b 4f 24 mov ecx, DWORD PTR [edi+36]
+ 0012e b8 01 00 00 00 mov eax, 1
+ 00133 d3 e0 shl eax, cl
+
+; 1478 : zmemcpy(window, state->window, wsize);
+
+ 00135 50 push eax
+ 00136 ff 77 34 push DWORD PTR [edi+52]
+ 00139 56 push esi
+ 0013a e8 00 00 00 00 call _memcpy
+ 0013f 83 c4 0c add esp, 12 ; 0000000cH
+$LN8@inflateCop:
+
+; 1479 : }
+; 1480 : copy->window = window;
+; 1481 : dest->state = (struct internal_state FAR *)copy;
+
+ 00142 8b 45 08 mov eax, DWORD PTR _dest$[ebp]
+ 00145 89 73 34 mov DWORD PTR [ebx+52], esi
+ 00148 89 58 1c mov DWORD PTR [eax+28], ebx
+
+; 1482 : return Z_OK;
+
+ 0014b 33 c0 xor eax, eax
+ 0014d 5b pop ebx
+ 0014e 5f pop edi
+ 0014f 5e pop esi
+
+; 1483 : }
+
+ 00150 5d pop ebp
+ 00151 c2 08 00 ret 8
+$LN3@inflateCop:
+ 00154 5f pop edi
+
+; 1450 : return Z_STREAM_ERROR;
+
+ 00155 b8 fe ff ff ff mov eax, -2 ; fffffffeH
+ 0015a 5e pop esi
+
+; 1483 : }
+
+ 0015b 5d pop ebp
+ 0015c c2 08 00 ret 8
+_inflateCopy@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\inflate.c
+; COMDAT _inflateUndermine@8
+_TEXT SEGMENT
+_strm$ = 8 ; size = 4
+_subvert$ = 12 ; size = 4
+_inflateUndermine@8 PROC ; COMDAT
+
+; 1488 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 1489 : struct inflate_state FAR *state;
+; 1490 :
+; 1491 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 00003 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 00006 85 c0 test eax, eax
+ 00008 74 1a je SHORT $LN3@inflateUnd
+ 0000a 8b 40 1c mov eax, DWORD PTR [eax+28]
+ 0000d 85 c0 test eax, eax
+ 0000f 74 13 je SHORT $LN3@inflateUnd
+
+; 1492 : state = (struct inflate_state FAR *)strm->state;
+; 1493 : state->sane = !subvert;
+; 1494 : #ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
+; 1495 : return Z_OK;
+; 1496 : #else
+; 1497 : state->sane = 1;
+
+ 00011 c7 80 c0 1b 00
+ 00 01 00 00 00 mov DWORD PTR [eax+7104], 1
+
+; 1498 : return Z_DATA_ERROR;
+
+ 0001b b8 fd ff ff ff mov eax, -3 ; fffffffdH
+
+; 1499 : #endif
+; 1500 : }
+
+ 00020 5d pop ebp
+ 00021 c2 08 00 ret 8
+$LN3@inflateUnd:
+
+; 1489 : struct inflate_state FAR *state;
+; 1490 :
+; 1491 : if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ 00024 b8 fe ff ff ff mov eax, -2 ; fffffffeH
+
+; 1499 : #endif
+; 1500 : }
+
+ 00029 5d pop ebp
+ 0002a c2 08 00 ret 8
+_inflateUndermine@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\inflate.c
+; COMDAT _inflateMark@4
+_TEXT SEGMENT
+_strm$ = 8 ; size = 4
+_inflateMark@4 PROC ; COMDAT
+
+; 1504 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 1505 : struct inflate_state FAR *state;
+; 1506 :
+; 1507 : if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
+
+ 00003 8b 45 08 mov eax, DWORD PTR _strm$[ebp]
+ 00006 85 c0 test eax, eax
+ 00008 74 4e je SHORT $LN3@inflateMar
+ 0000a 8b 40 1c mov eax, DWORD PTR [eax+28]
+ 0000d 85 c0 test eax, eax
+ 0000f 74 47 je SHORT $LN3@inflateMar
+
+; 1508 : state = (struct inflate_state FAR *)strm->state;
+; 1509 : return ((long)(state->back) << 16) +
+
+ 00011 8b 08 mov ecx, DWORD PTR [eax]
+ 00013 83 f9 0f cmp ecx, 15 ; 0000000fH
+ 00016 75 12 jne SHORT $LN7@inflateMar
+ 00018 8b 48 40 mov ecx, DWORD PTR [eax+64]
+ 0001b 8b 80 c4 1b 00
+ 00 mov eax, DWORD PTR [eax+7108]
+ 00021 c1 e0 10 shl eax, 16 ; 00000010H
+ 00024 03 c1 add eax, ecx
+
+; 1510 : (state->mode == COPY ? state->length :
+; 1511 : (state->mode == MATCH ? state->was - state->length : 0));
+; 1512 : }
+
+ 00026 5d pop ebp
+ 00027 c2 04 00 ret 4
+$LN7@inflateMar:
+
+; 1508 : state = (struct inflate_state FAR *)strm->state;
+; 1509 : return ((long)(state->back) << 16) +
+
+ 0002a 83 f9 18 cmp ecx, 24 ; 00000018H
+ 0002d 75 18 jne SHORT $LN5@inflateMar
+ 0002f 8b 88 c8 1b 00
+ 00 mov ecx, DWORD PTR [eax+7112]
+ 00035 2b 48 40 sub ecx, DWORD PTR [eax+64]
+ 00038 8b 80 c4 1b 00
+ 00 mov eax, DWORD PTR [eax+7108]
+ 0003e c1 e0 10 shl eax, 16 ; 00000010H
+ 00041 03 c1 add eax, ecx
+
+; 1510 : (state->mode == COPY ? state->length :
+; 1511 : (state->mode == MATCH ? state->was - state->length : 0));
+; 1512 : }
+
+ 00043 5d pop ebp
+ 00044 c2 04 00 ret 4
+$LN5@inflateMar:
+
+; 1508 : state = (struct inflate_state FAR *)strm->state;
+; 1509 : return ((long)(state->back) << 16) +
+
+ 00047 8b 80 c4 1b 00
+ 00 mov eax, DWORD PTR [eax+7108]
+ 0004d 33 c9 xor ecx, ecx
+ 0004f c1 e0 10 shl eax, 16 ; 00000010H
+ 00052 03 c1 add eax, ecx
+
+; 1510 : (state->mode == COPY ? state->length :
+; 1511 : (state->mode == MATCH ? state->was - state->length : 0));
+; 1512 : }
+
+ 00054 5d pop ebp
+ 00055 c2 04 00 ret 4
+$LN3@inflateMar:
+
+; 1505 : struct inflate_state FAR *state;
+; 1506 :
+; 1507 : if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
+
+ 00058 b8 00 00 ff ff mov eax, -65536 ; ffff0000H
+
+; 1510 : (state->mode == COPY ? state->length :
+; 1511 : (state->mode == MATCH ? state->was - state->length : 0));
+; 1512 : }
+
+ 0005d 5d pop ebp
+ 0005e c2 04 00 ret 4
+_inflateMark@4 ENDP
+_TEXT ENDS
+END
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/inflate.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/inflate.obj
new file mode 100644
index 0000000000..bab335459e
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/inflate.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/inftrees.cod b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/inftrees.cod
new file mode 100644
index 0000000000..9523ecade6
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/inftrees.cod
@@ -0,0 +1,1069 @@
+; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.23506.0
+
+ TITLE d:\downloads\tgl-master\tgl-master\zlib\inftrees.c
+ .686P
+ .XMM
+ include listing.inc
+ .model flat
+
+INCLUDELIB OLDNAMES
+
+ ORG $+2
+?dext@?1??inflate_table@@9@9 DW 010H ; `inflate_table'::`2'::dext
+ DW 010H
+ DW 010H
+ DW 010H
+ DW 011H
+ DW 011H
+ DW 012H
+ DW 012H
+ DW 013H
+ DW 013H
+ DW 014H
+ DW 014H
+ DW 015H
+ DW 015H
+ DW 016H
+ DW 016H
+ DW 017H
+ DW 017H
+ DW 018H
+ DW 018H
+ DW 019H
+ DW 019H
+ DW 01aH
+ DW 01aH
+ DW 01bH
+ DW 01bH
+ DW 01cH
+ DW 01cH
+ DW 01dH
+ DW 01dH
+ DW 040H
+ DW 040H
+?lext@?1??inflate_table@@9@9 DW 010H ; `inflate_table'::`2'::lext
+ DW 010H
+ DW 010H
+ DW 010H
+ DW 010H
+ DW 010H
+ DW 010H
+ DW 010H
+ DW 011H
+ DW 011H
+ DW 011H
+ DW 011H
+ DW 012H
+ DW 012H
+ DW 012H
+ DW 012H
+ DW 013H
+ DW 013H
+ DW 013H
+ DW 013H
+ DW 014H
+ DW 014H
+ DW 014H
+ DW 014H
+ DW 015H
+ DW 015H
+ DW 015H
+ DW 015H
+ DW 010H
+ DW 048H
+ DW 04eH
+ ORG $+2
+?lbase@?1??inflate_table@@9@9 DW 03H ; `inflate_table'::`2'::lbase
+ DW 04H
+ DW 05H
+ DW 06H
+ DW 07H
+ DW 08H
+ DW 09H
+ DW 0aH
+ DW 0bH
+ DW 0dH
+ DW 0fH
+ DW 011H
+ DW 013H
+ DW 017H
+ DW 01bH
+ DW 01fH
+ DW 023H
+ DW 02bH
+ DW 033H
+ DW 03bH
+ DW 043H
+ DW 053H
+ DW 063H
+ DW 073H
+ DW 083H
+ DW 0a3H
+ DW 0c3H
+ DW 0e3H
+ DW 0102H
+ DW 00H
+ DW 00H
+ ORG $+2
+?dbase@?1??inflate_table@@9@9 DW 01H ; `inflate_table'::`2'::dbase
+ DW 02H
+ DW 03H
+ DW 04H
+ DW 05H
+ DW 07H
+ DW 09H
+ DW 0dH
+ DW 011H
+ DW 019H
+ DW 021H
+ DW 031H
+ DW 041H
+ DW 061H
+ DW 081H
+ DW 0c1H
+ DW 0101H
+ DW 0181H
+ DW 0201H
+ DW 0301H
+ DW 0401H
+ DW 0601H
+ DW 0801H
+ DW 0c01H
+ DW 01001H
+ DW 01801H
+ DW 02001H
+ DW 03001H
+ DW 04001H
+ DW 06001H
+ DW 00H
+ DW 00H
+PUBLIC _inflate_table
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\inftrees.c
+; COMDAT _inflate_table
+_TEXT SEGMENT
+_offs$ = -128 ; size = 32
+_count$ = -96 ; size = 32
+_min$2$ = -64 ; size = 4
+_mask$1$ = -60 ; size = 4
+tv1501 = -56 ; size = 4
+tv1495 = -56 ; size = 4
+_low$1$ = -52 ; size = 4
+_used$1$ = -48 ; size = 4
+tv1502 = -44 ; size = 4
+_lens$1$ = -40 ; size = 4
+_base$1$ = -36 ; size = 4
+_extra$1$ = -32 ; size = 4
+_end$1$ = -28 ; size = 4
+_root$3$ = -24 ; size = 4
+_len$2$ = -20 ; size = 4
+_type$1$ = -16 ; size = 4
+_huff$1$ = -12 ; size = 4
+_next$1$ = -8 ; size = 4
+_drop$1$ = -4 ; size = 4
+_here$ = 8 ; size = 4
+_codes$ = 8 ; size = 4
+_table$ = 12 ; size = 4
+_bits$ = 16 ; size = 4
+_work$ = 20 ; size = 4
+_inflate_table PROC ; COMDAT
+; _type$ = ecx
+; _lens$ = edx
+
+; 39 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 81 ec 80 00 00
+ 00 sub esp, 128 ; 00000080H
+ 00009 53 push ebx
+ 0000a 56 push esi
+ 0000b 89 4d f0 mov DWORD PTR _type$1$[ebp], ecx
+ 0000e 0f 57 c0 xorps xmm0, xmm0
+
+; 40 : unsigned len; /* a code's length in bits */
+; 41 : unsigned sym; /* index of code symbols */
+; 42 : unsigned min, max; /* minimum and maximum code lengths */
+; 43 : unsigned root; /* number of index bits for root table */
+; 44 : unsigned curr; /* number of index bits for current table */
+; 45 : unsigned drop; /* code bits to drop for sub-table */
+; 46 : int left; /* number of prefix codes available */
+; 47 : unsigned used; /* code entries in table used */
+; 48 : unsigned huff; /* Huffman code */
+; 49 : unsigned incr; /* for incrementing code, index */
+; 50 : unsigned fill; /* index for replicating entries */
+; 51 : unsigned low; /* low bits for current root entry */
+; 52 : unsigned mask; /* mask for low root bits */
+; 53 : code here; /* table entry for duplication */
+; 54 : code FAR *next; /* next available space in table */
+; 55 : const unsigned short FAR *base; /* base value table to use */
+; 56 : const unsigned short FAR *extra; /* extra bits table to use */
+; 57 : int end; /* use base and extra for symbol > end */
+; 58 : unsigned short count[MAXBITS+1]; /* number of codes of each length */
+; 59 : unsigned short offs[MAXBITS+1]; /* offsets in table for each length */
+; 60 : static const unsigned short lbase[31] = { /* Length codes 257..285 base */
+; 61 : 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
+; 62 : 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
+; 63 : static const unsigned short lext[31] = { /* Length codes 257..285 extra */
+; 64 : 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
+; 65 : 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78};
+; 66 : static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
+; 67 : 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
+; 68 : 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
+; 69 : 8193, 12289, 16385, 24577, 0, 0};
+; 70 : static const unsigned short dext[32] = { /* Distance codes 0..29 extra */
+; 71 : 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
+; 72 : 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
+; 73 : 28, 28, 29, 29, 64, 64};
+; 74 :
+; 75 : /*
+; 76 : Process a set of code lengths to create a canonical Huffman code. The
+; 77 : code lengths are lens[0..codes-1]. Each length corresponds to the
+; 78 : symbols 0..codes-1. The Huffman code is generated by first sorting the
+; 79 : symbols by length from short to long, and retaining the symbol order
+; 80 : for codes with equal lengths. Then the code starts with all zero bits
+; 81 : for the first code of the shortest length, and the codes are integer
+; 82 : increments for the same length, and zeros are appended as the length
+; 83 : increases. For the deflate format, these bits are stored backwards
+; 84 : from their more natural integer increment ordering, and so when the
+; 85 : decoding tables are built in the large loop below, the integer codes
+; 86 : are incremented backwards.
+; 87 :
+; 88 : This routine assumes, but does not check, that all of the entries in
+; 89 : lens[] are in the range 0..MAXBITS. The caller must assure this.
+; 90 : 1..MAXBITS is interpreted as that code length. zero means that that
+; 91 : symbol does not occur in this code.
+; 92 :
+; 93 : The codes are sorted by computing a count of codes for each length,
+; 94 : creating from that a table of starting indices for each length in the
+; 95 : sorted table, and then entering the symbols in order in the sorted
+; 96 : table. The sorted table is work[], with that space being provided by
+; 97 : the caller.
+; 98 :
+; 99 : The length counts are used for other purposes as well, i.e. finding
+; 100 : the minimum and maximum length codes, determining if there are any
+; 101 : codes at all, checking for a valid set of lengths, and looking ahead
+; 102 : at length counts to determine sub-table sizes when building the
+; 103 : decoding tables.
+; 104 : */
+; 105 :
+; 106 : /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
+; 107 : for (len = 0; len <= MAXBITS; len++)
+; 108 : count[len] = 0;
+; 109 : for (sym = 0; sym < codes; sym++)
+
+ 00011 8b 4d 08 mov ecx, DWORD PTR _codes$[ebp]
+ 00014 8b c2 mov eax, edx
+ 00016 33 f6 xor esi, esi
+ 00018 89 45 d8 mov DWORD PTR _lens$1$[ebp], eax
+ 0001b 57 push edi
+ 0001c 0f 11 45 a0 movups XMMWORD PTR _count$[ebp], xmm0
+ 00020 0f 11 45 b0 movups XMMWORD PTR _count$[ebp+16], xmm0
+ 00024 85 c9 test ecx, ecx
+ 00026 74 18 je SHORT $LN6@inflate_ta
+ 00028 0f 1f 84 00 00
+ 00 00 00 npad 8
+$LL7@inflate_ta:
+
+; 110 : count[lens[sym]]++;
+
+ 00030 0f b7 04 70 movzx eax, WORD PTR [eax+esi*2]
+ 00034 46 inc esi
+ 00035 66 ff 44 45 a0 inc WORD PTR _count$[ebp+eax*2]
+ 0003a 8b c2 mov eax, edx
+ 0003c 3b f1 cmp esi, ecx
+ 0003e 72 f0 jb SHORT $LL7@inflate_ta
+$LN6@inflate_ta:
+
+; 111 :
+; 112 : /* bound code lengths, force root to be within code lengths */
+; 113 : root = *bits;
+
+ 00040 8b 5d 10 mov ebx, DWORD PTR _bits$[ebp]
+ 00043 8d 45 ba lea eax, DWORD PTR _count$[ebp+26]
+
+; 114 : for (max = MAXBITS; max >= 1; max--)
+
+ 00046 bf 0f 00 00 00 mov edi, 15 ; 0000000fH
+ 0004b 8b 0b mov ecx, DWORD PTR [ebx]
+ 0004d 0f 1f 00 npad 3
+$LL10@inflate_ta:
+
+; 115 : if (count[max] != 0) break;
+
+ 00050 66 83 78 04 00 cmp WORD PTR [eax+4], 0
+ 00055 75 38 jne SHORT $LN78@inflate_ta
+ 00057 66 83 78 02 00 cmp WORD PTR [eax+2], 0
+ 0005c 75 30 jne SHORT $LN111@inflate_ta
+ 0005e 66 83 38 00 cmp WORD PTR [eax], 0
+ 00062 75 25 jne SHORT $LN112@inflate_ta
+ 00064 66 83 78 fe 00 cmp WORD PTR [eax-2], 0
+ 00069 75 19 jne SHORT $LN113@inflate_ta
+ 0006b 66 83 78 fc 00 cmp WORD PTR [eax-4], 0
+ 00070 75 0d jne SHORT $LN114@inflate_ta
+
+; 114 : for (max = MAXBITS; max >= 1; max--)
+
+ 00072 83 ef 05 sub edi, 5
+ 00075 83 e8 0a sub eax, 10 ; 0000000aH
+ 00078 83 ff 01 cmp edi, 1
+ 0007b 73 d3 jae SHORT $LL10@inflate_ta
+ 0007d eb 10 jmp SHORT $LN78@inflate_ta
+$LN114@inflate_ta:
+
+; 115 : if (count[max] != 0) break;
+
+ 0007f 83 ef 04 sub edi, 4
+ 00082 eb 0b jmp SHORT $LN78@inflate_ta
+$LN113@inflate_ta:
+ 00084 83 ef 03 sub edi, 3
+ 00087 eb 06 jmp SHORT $LN78@inflate_ta
+$LN112@inflate_ta:
+ 00089 83 ef 02 sub edi, 2
+ 0008c eb 01 jmp SHORT $LN78@inflate_ta
+$LN111@inflate_ta:
+ 0008e 4f dec edi
+$LN78@inflate_ta:
+
+; 116 : if (root > max) root = max;
+
+ 0008f 3b cf cmp ecx, edi
+ 00091 0f 47 cf cmova ecx, edi
+
+; 117 : if (max == 0) { /* no symbols to code at all */
+
+ 00094 85 ff test edi, edi
+ 00096 75 2a jne SHORT $LN37@inflate_ta
+
+; 118 : here.op = (unsigned char)64; /* invalid code marker */
+; 119 : here.bits = (unsigned char)1;
+; 120 : here.val = (unsigned short)0;
+; 121 : *(*table)++ = here; /* make a table to force an error */
+
+ 00098 8b 55 0c mov edx, DWORD PTR _table$[ebp]
+ 0009b c7 45 08 40 01
+ 00 00 mov DWORD PTR _here$[ebp], 320 ; 00000140H
+ 000a2 8b 45 08 mov eax, DWORD PTR _here$[ebp]
+ 000a5 5f pop edi
+ 000a6 8b 0a mov ecx, DWORD PTR [edx]
+ 000a8 5e pop esi
+ 000a9 89 01 mov DWORD PTR [ecx], eax
+ 000ab 83 02 04 add DWORD PTR [edx], 4
+ 000ae 8b 0a mov ecx, DWORD PTR [edx]
+
+; 122 : *(*table)++ = here;
+
+ 000b0 89 01 mov DWORD PTR [ecx], eax
+ 000b2 83 02 04 add DWORD PTR [edx], 4
+
+; 123 : *bits = 1;
+; 124 : return 0; /* no symbols, but wait for decoding to report error */
+
+ 000b5 33 c0 xor eax, eax
+ 000b7 c7 03 01 00 00
+ 00 mov DWORD PTR [ebx], 1
+ 000bd 5b pop ebx
+
+; 306 : }
+
+ 000be 8b e5 mov esp, ebp
+ 000c0 5d pop ebp
+ 000c1 c3 ret 0
+$LN37@inflate_ta:
+
+; 125 : }
+; 126 : for (min = 1; min < max; min++)
+
+ 000c2 bb 01 00 00 00 mov ebx, 1
+ 000c7 89 5d ec mov DWORD PTR _len$2$[ebp], ebx
+ 000ca 3b fb cmp edi, ebx
+ 000cc 76 12 jbe SHORT $LN79@inflate_ta
+ 000ce 66 90 npad 2
+$LL13@inflate_ta:
+
+; 127 : if (count[min] != 0) break;
+
+ 000d0 66 83 7c 5d a0
+ 00 cmp WORD PTR _count$[ebp+ebx*2], 0
+ 000d6 75 05 jne SHORT $LN134@inflate_ta
+
+; 125 : }
+; 126 : for (min = 1; min < max; min++)
+
+ 000d8 43 inc ebx
+ 000d9 3b df cmp ebx, edi
+ 000db 72 f3 jb SHORT $LL13@inflate_ta
+$LN134@inflate_ta:
+ 000dd 89 5d ec mov DWORD PTR _len$2$[ebp], ebx
+$LN79@inflate_ta:
+
+; 128 : if (root < min) root = min;
+
+ 000e0 3b cb cmp ecx, ebx
+
+; 129 :
+; 130 : /* check for an over-subscribed or incomplete set of lengths */
+; 131 : left = 1;
+
+ 000e2 ba 01 00 00 00 mov edx, 1
+ 000e7 0f 42 cb cmovb ecx, ebx
+ 000ea 89 4d e8 mov DWORD PTR _root$3$[ebp], ecx
+
+; 132 : for (len = 1; len <= MAXBITS; len++) {
+
+ 000ed 8b ca mov ecx, edx
+ 000ef 90 npad 1
+$LL16@inflate_ta:
+
+; 133 : left <<= 1;
+; 134 : left -= count[len];
+
+ 000f0 0f b7 44 4d a0 movzx eax, WORD PTR _count$[ebp+ecx*2]
+ 000f5 03 d2 add edx, edx
+ 000f7 2b d0 sub edx, eax
+
+; 135 : if (left < 0) return -1; /* over-subscribed */
+
+ 000f9 0f 88 04 03 00
+ 00 js $LN80@inflate_ta
+
+; 132 : for (len = 1; len <= MAXBITS; len++) {
+
+ 000ff 41 inc ecx
+ 00100 83 f9 0f cmp ecx, 15 ; 0000000fH
+ 00103 76 eb jbe SHORT $LL16@inflate_ta
+
+; 136 : }
+; 137 : if (left > 0 && (type == CODES || max != 1))
+
+ 00105 85 d2 test edx, edx
+ 00107 7e 13 jle SHORT $LN41@inflate_ta
+ 00109 83 7d f0 00 cmp DWORD PTR _type$1$[ebp], 0
+ 0010d 0f 84 f0 02 00
+ 00 je $LN80@inflate_ta
+ 00113 83 ff 01 cmp edi, 1
+ 00116 0f 85 e7 02 00
+ 00 jne $LN80@inflate_ta
+$LN41@inflate_ta:
+
+; 138 : return -1; /* incomplete set */
+; 139 :
+; 140 : /* generate offsets into symbol table for each length for sorting */
+; 141 : offs[1] = 0;
+
+ 0011c 33 c0 xor eax, eax
+
+; 142 : for (len = 1; len < MAXBITS; len++)
+
+ 0011e b9 02 00 00 00 mov ecx, 2
+ 00123 66 89 45 82 mov WORD PTR _offs$[ebp+2], ax
+ 00127 66 0f 1f 84 00
+ 00 00 00 00 npad 9
+$LL19@inflate_ta:
+
+; 143 : offs[len + 1] = offs[len] + count[len];
+
+ 00130 66 8b 44 0d 80 mov ax, WORD PTR _offs$[ebp+ecx]
+ 00135 66 03 44 0d a0 add ax, WORD PTR _count$[ebp+ecx]
+ 0013a 66 89 44 0d 82 mov WORD PTR _offs$[ebp+ecx+2], ax
+ 0013f 83 c1 02 add ecx, 2
+ 00142 83 f9 1e cmp ecx, 30 ; 0000001eH
+ 00145 72 e9 jb SHORT $LL19@inflate_ta
+
+; 144 :
+; 145 : /* sort symbols by length, by symbol order within each length */
+; 146 : for (sym = 0; sym < codes; sym++)
+
+ 00147 8b 55 08 mov edx, DWORD PTR _codes$[ebp]
+ 0014a 33 c9 xor ecx, ecx
+ 0014c 8b 75 14 mov esi, DWORD PTR _work$[ebp]
+ 0014f 85 d2 test edx, edx
+ 00151 74 26 je SHORT $LN21@inflate_ta
+ 00153 8b 5d d8 mov ebx, DWORD PTR _lens$1$[ebp]
+$LL22@inflate_ta:
+
+; 147 : if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym;
+
+ 00156 0f b7 04 4b movzx eax, WORD PTR [ebx+ecx*2]
+ 0015a 66 85 c0 test ax, ax
+ 0015d 74 12 je SHORT $LN20@inflate_ta
+ 0015f 0f b7 44 45 80 movzx eax, WORD PTR _offs$[ebp+eax*2]
+ 00164 66 89 0c 46 mov WORD PTR [esi+eax*2], cx
+ 00168 0f b7 04 4b movzx eax, WORD PTR [ebx+ecx*2]
+ 0016c 66 ff 44 45 80 inc WORD PTR _offs$[ebp+eax*2]
+$LN20@inflate_ta:
+
+; 144 :
+; 145 : /* sort symbols by length, by symbol order within each length */
+; 146 : for (sym = 0; sym < codes; sym++)
+
+ 00171 41 inc ecx
+ 00172 3b ca cmp ecx, edx
+ 00174 72 e0 jb SHORT $LL22@inflate_ta
+ 00176 8b 5d ec mov ebx, DWORD PTR _len$2$[ebp]
+$LN21@inflate_ta:
+
+; 148 :
+; 149 : /*
+; 150 : Create and fill in decoding tables. In this loop, the table being
+; 151 : filled is at next and has curr index bits. The code being used is huff
+; 152 : with length len. That code is converted to an index by dropping drop
+; 153 : bits off of the bottom. For codes where len is less than drop + curr,
+; 154 : those top drop + curr - len bits are incremented through all values to
+; 155 : fill the table with replicated entries.
+; 156 :
+; 157 : root is the number of index bits for the root table. When len exceeds
+; 158 : root, sub-tables are created pointed to by the root entry with an index
+; 159 : of the low root bits of huff. This is saved in low to check for when a
+; 160 : new sub-table should be started. drop is zero when the root table is
+; 161 : being filled, and drop is root when sub-tables are being filled.
+; 162 :
+; 163 : When a new sub-table is needed, it is necessary to look ahead in the
+; 164 : code lengths to determine what size sub-table is needed. The length
+; 165 : counts are used for this, and so count[] is decremented as codes are
+; 166 : entered in the tables.
+; 167 :
+; 168 : used keeps track of how many table entries have been allocated from the
+; 169 : provided *table space. It is checked for LENS and DIST tables against
+; 170 : the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
+; 171 : the initial root table size constants. See the comments in inftrees.h
+; 172 : for more information.
+; 173 :
+; 174 : sym increments through all symbols, and the loop terminates when
+; 175 : all codes of length max, i.e. all codes, have been processed. This
+; 176 : routine permits incomplete codes, so another loop after this one fills
+; 177 : in the rest of the decoding tables with invalid code markers.
+; 178 : */
+; 179 :
+; 180 : /* set up for code type */
+; 181 : switch (type) {
+
+ 00179 8b 45 f0 mov eax, DWORD PTR _type$1$[ebp]
+ 0017c 83 e8 00 sub eax, 0
+ 0017f 74 3f je SHORT $LN44@inflate_ta
+ 00181 83 e8 01 sub eax, 1
+ 00184 74 16 je SHORT $LN45@inflate_ta
+
+; 193 : default: /* DISTS */
+; 194 : base = dbase;
+; 195 : extra = dext;
+; 196 : end = -1;
+
+ 00186 83 c8 ff or eax, -1
+ 00189 c7 45 dc 00 00
+ 00 00 mov DWORD PTR _base$1$[ebp], OFFSET ?dbase@?1??inflate_table@@9@9
+ 00190 c7 45 e0 00 00
+ 00 00 mov DWORD PTR _extra$1$[ebp], OFFSET ?dext@?1??inflate_table@@9@9
+ 00197 89 45 e4 mov DWORD PTR _end$1$[ebp], eax
+ 0019a eb 31 jmp SHORT $LN23@inflate_ta
+$LN45@inflate_ta:
+
+; 185 : break;
+; 186 : case LENS:
+; 187 : base = lbase;
+; 188 : base -= 257;
+
+ 0019c b8 00 00 00 00 mov eax, OFFSET ?lbase@?1??inflate_table@@9@9
+ 001a1 2d 02 02 00 00 sub eax, 514 ; 00000202H
+ 001a6 89 45 dc mov DWORD PTR _base$1$[ebp], eax
+
+; 189 : extra = lext;
+; 190 : extra -= 257;
+
+ 001a9 b8 00 00 00 00 mov eax, OFFSET ?lext@?1??inflate_table@@9@9
+ 001ae 2d 02 02 00 00 sub eax, 514 ; 00000202H
+ 001b3 89 45 e0 mov DWORD PTR _extra$1$[ebp], eax
+
+; 191 : end = 256;
+
+ 001b6 b8 00 01 00 00 mov eax, 256 ; 00000100H
+ 001bb 89 45 e4 mov DWORD PTR _end$1$[ebp], eax
+
+; 192 : break;
+
+ 001be eb 0d jmp SHORT $LN23@inflate_ta
+$LN44@inflate_ta:
+
+; 182 : case CODES:
+; 183 : base = extra = work; /* dummy value--not used */
+
+ 001c0 89 75 e0 mov DWORD PTR _extra$1$[ebp], esi
+ 001c3 89 75 dc mov DWORD PTR _base$1$[ebp], esi
+
+; 184 : end = 19;
+
+ 001c6 c7 45 e4 13 00
+ 00 00 mov DWORD PTR _end$1$[ebp], 19 ; 00000013H
+$LN23@inflate_ta:
+
+; 197 : }
+; 198 :
+; 199 : /* initialize state for loop */
+; 200 : huff = 0; /* starting code */
+; 201 : sym = 0; /* starting code symbol */
+; 202 : len = min; /* starting code length */
+; 203 : next = *table; /* current table to fill in */
+
+ 001cd 8b 4d 0c mov ecx, DWORD PTR _table$[ebp]
+
+; 204 : curr = root; /* current table index bits */
+; 205 : drop = 0; /* current bits to drop from code for index */
+; 206 : low = (unsigned)(-1); /* trigger new sub-table when len > root */
+; 207 : used = 1U << root; /* use root table entries */
+
+ 001d0 ba 01 00 00 00 mov edx, 1
+ 001d5 c7 45 f4 00 00
+ 00 00 mov DWORD PTR _huff$1$[ebp], 0
+ 001dc c7 45 fc 00 00
+ 00 00 mov DWORD PTR _drop$1$[ebp], 0
+ 001e3 c7 45 cc ff ff
+ ff ff mov DWORD PTR _low$1$[ebp], -1
+ 001ea 8b 01 mov eax, DWORD PTR [ecx]
+ 001ec 8b 4d e8 mov ecx, DWORD PTR _root$3$[ebp]
+ 001ef d3 e2 shl edx, cl
+ 001f1 89 45 f8 mov DWORD PTR _next$1$[ebp], eax
+ 001f4 8b c2 mov eax, edx
+ 001f6 89 55 d4 mov DWORD PTR tv1502[ebp], edx
+ 001f9 89 45 d0 mov DWORD PTR _used$1$[ebp], eax
+
+; 208 : mask = used - 1; /* mask for comparing low */
+
+ 001fc 8d 48 ff lea ecx, DWORD PTR [eax-1]
+ 001ff 89 4d c4 mov DWORD PTR _mask$1$[ebp], ecx
+
+; 209 :
+; 210 : /* check available table space */
+; 211 : if ((type == LENS && used > ENOUGH_LENS) ||
+
+ 00202 8b 4d f0 mov ecx, DWORD PTR _type$1$[ebp]
+ 00205 83 f9 01 cmp ecx, 1
+ 00208 75 09 jne SHORT $LN49@inflate_ta
+ 0020a 3d 54 03 00 00 cmp eax, 852 ; 00000354H
+ 0020f 77 0e ja SHORT $LN48@inflate_ta
+ 00211 eb 25 jmp SHORT $LL25@inflate_ta
+$LN49@inflate_ta:
+ 00213 83 f9 02 cmp ecx, 2
+ 00216 75 20 jne SHORT $LL25@inflate_ta
+ 00218 3d 50 02 00 00 cmp eax, 592 ; 00000250H
+ 0021d 76 19 jbe SHORT $LL25@inflate_ta
+$LN48@inflate_ta:
+ 0021f 5f pop edi
+ 00220 5e pop esi
+
+; 212 : (type == DISTS && used > ENOUGH_DISTS))
+; 213 : return 1;
+
+ 00221 b8 01 00 00 00 mov eax, 1
+ 00226 5b pop ebx
+
+; 306 : }
+
+ 00227 8b e5 mov esp, ebp
+ 00229 5d pop ebp
+ 0022a c3 ret 0
+ 0022b 0f 1f 44 00 00 npad 5
+$LL136@inflate_ta:
+ 00230 8b 55 d4 mov edx, DWORD PTR tv1502[ebp]
+ 00233 eb 03 jmp SHORT $LL25@inflate_ta
+$LN137@inflate_ta:
+ 00235 8b 75 14 mov esi, DWORD PTR _work$[ebp]
+$LL25@inflate_ta:
+
+; 214 :
+; 215 : /* process all codes and make table entries */
+; 216 : for (;;) {
+; 217 : /* create table entry */
+; 218 : here.bits = (unsigned char)(len - drop);
+
+ 00238 8a c3 mov al, bl
+ 0023a 2a 45 fc sub al, BYTE PTR _drop$1$[ebp]
+ 0023d 88 45 09 mov BYTE PTR _here$[ebp+1], al
+
+; 219 : if ((int)(work[sym]) < end) {
+
+ 00240 0f b7 06 movzx eax, WORD PTR [esi]
+ 00243 8b 75 e4 mov esi, DWORD PTR _end$1$[ebp]
+ 00246 8b c8 mov ecx, eax
+ 00248 3b ce cmp ecx, esi
+ 0024a 7d 06 jge SHORT $LN143@inflate_ta
+
+; 220 : here.op = (unsigned char)0;
+
+ 0024c c6 45 08 00 mov BYTE PTR _here$[ebp], 0
+
+; 221 : here.val = work[sym];
+; 222 : }
+
+ 00250 eb 1a jmp SHORT $LN144@inflate_ta
+$LN143@inflate_ta:
+
+; 223 : else if ((int)(work[sym]) > end) {
+
+ 00252 7e 12 jle SHORT $LN52@inflate_ta
+
+; 224 : here.op = (unsigned char)(extra[work[sym]]);
+
+ 00254 8b 45 e0 mov eax, DWORD PTR _extra$1$[ebp]
+ 00257 8a 04 48 mov al, BYTE PTR [eax+ecx*2]
+ 0025a 88 45 08 mov BYTE PTR _here$[ebp], al
+
+; 225 : here.val = base[work[sym]];
+
+ 0025d 8b 45 dc mov eax, DWORD PTR _base$1$[ebp]
+ 00260 66 8b 04 48 mov ax, WORD PTR [eax+ecx*2]
+
+; 226 : }
+
+ 00264 eb 06 jmp SHORT $LN144@inflate_ta
+$LN52@inflate_ta:
+
+; 227 : else {
+; 228 : here.op = (unsigned char)(32 + 64); /* end of block */
+
+ 00266 c6 45 08 60 mov BYTE PTR _here$[ebp], 96 ; 00000060H
+
+; 229 : here.val = 0;
+
+ 0026a 33 c0 xor eax, eax
+$LN144@inflate_ta:
+
+; 230 : }
+; 231 :
+; 232 : /* replicate for those indices with low len bits equal to huff */
+; 233 : incr = 1U << (len - drop);
+
+ 0026c 8b cb mov ecx, ebx
+ 0026e 66 89 45 0a mov WORD PTR _here$[ebp+2], ax
+ 00272 2b 4d fc sub ecx, DWORD PTR _drop$1$[ebp]
+ 00275 be 01 00 00 00 mov esi, 1
+ 0027a d3 e6 shl esi, cl
+ 0027c 8b 4d fc mov ecx, DWORD PTR _drop$1$[ebp]
+
+; 234 : fill = 1U << curr;
+; 235 : min = fill; /* save offset to next table */
+
+ 0027f 89 55 c0 mov DWORD PTR _min$2$[ebp], edx
+ 00282 8d 04 b5 00 00
+ 00 00 lea eax, DWORD PTR [esi*4]
+ 00289 89 45 c8 mov DWORD PTR tv1495[ebp], eax
+ 0028c 8b 45 f4 mov eax, DWORD PTR _huff$1$[ebp]
+ 0028f d3 e8 shr eax, cl
+ 00291 8b 4d f8 mov ecx, DWORD PTR _next$1$[ebp]
+ 00294 03 c2 add eax, edx
+ 00296 8d 0c 81 lea ecx, DWORD PTR [ecx+eax*4]
+ 00299 8b 45 08 mov eax, DWORD PTR _here$[ebp]
+ 0029c 0f 1f 40 00 npad 4
+$LL30@inflate_ta:
+
+; 236 : do {
+; 237 : fill -= incr;
+
+ 002a0 2b 4d c8 sub ecx, DWORD PTR tv1495[ebp]
+
+; 238 : next[(huff >> drop) + fill] = here;
+
+ 002a3 89 01 mov DWORD PTR [ecx], eax
+ 002a5 2b d6 sub edx, esi
+
+; 239 : } while (fill != 0);
+
+ 002a7 75 f7 jne SHORT $LL30@inflate_ta
+
+; 240 :
+; 241 : /* backwards increment the len-bit code huff */
+; 242 : incr = 1U << (len - 1);
+
+ 002a9 8d 4b ff lea ecx, DWORD PTR [ebx-1]
+ 002ac ba 01 00 00 00 mov edx, 1
+ 002b1 d3 e2 shl edx, cl
+
+; 243 : while (huff & incr)
+
+ 002b3 8b 4d f4 mov ecx, DWORD PTR _huff$1$[ebp]
+ 002b6 85 d1 test edx, ecx
+ 002b8 74 0c je SHORT $LN32@inflate_ta
+ 002ba 66 0f 1f 44 00
+ 00 npad 6
+$LL31@inflate_ta:
+
+; 244 : incr >>= 1;
+
+ 002c0 d1 ea shr edx, 1
+ 002c2 85 d1 test edx, ecx
+ 002c4 75 fa jne SHORT $LL31@inflate_ta
+$LN32@inflate_ta:
+
+; 245 : if (incr != 0) {
+
+ 002c6 85 d2 test edx, edx
+ 002c8 74 09 je SHORT $LN54@inflate_ta
+
+; 246 : huff &= incr - 1;
+
+ 002ca 8d 42 ff lea eax, DWORD PTR [edx-1]
+ 002cd 23 c1 and eax, ecx
+
+; 247 : huff += incr;
+
+ 002cf 03 d0 add edx, eax
+
+; 248 : }
+
+ 002d1 eb 02 jmp SHORT $LN145@inflate_ta
+$LN54@inflate_ta:
+
+; 249 : else
+; 250 : huff = 0;
+
+ 002d3 33 d2 xor edx, edx
+$LN145@inflate_ta:
+
+; 251 :
+; 252 : /* go to next symbol, update count, len */
+; 253 : sym++;
+
+ 002d5 8b 45 14 mov eax, DWORD PTR _work$[ebp]
+
+; 254 : if (--(count[len]) == 0) {
+
+ 002d8 b9 ff ff 00 00 mov ecx, 65535 ; 0000ffffH
+ 002dd 83 c0 02 add eax, 2
+ 002e0 89 55 f4 mov DWORD PTR _huff$1$[ebp], edx
+ 002e3 66 01 4c 5d a0 add WORD PTR _count$[ebp+ebx*2], cx
+ 002e8 89 45 14 mov DWORD PTR _work$[ebp], eax
+ 002eb 75 15 jne SHORT $LN56@inflate_ta
+
+; 255 : if (len == max) break;
+
+ 002ed 3b df cmp ebx, edi
+ 002ef 0f 84 d5 00 00
+ 00 je $LN82@inflate_ta
+
+; 256 : len = lens[work[sym]];
+
+ 002f5 0f b7 00 movzx eax, WORD PTR [eax]
+ 002f8 8b 4d d8 mov ecx, DWORD PTR _lens$1$[ebp]
+ 002fb 0f b7 1c 41 movzx ebx, WORD PTR [ecx+eax*2]
+ 002ff 89 5d ec mov DWORD PTR _len$2$[ebp], ebx
+$LN56@inflate_ta:
+
+; 257 : }
+; 258 :
+; 259 : /* create new sub-table if needed */
+; 260 : if (len > root && (huff & mask) != low) {
+
+ 00302 8b 45 e8 mov eax, DWORD PTR _root$3$[ebp]
+ 00305 8b 75 14 mov esi, DWORD PTR _work$[ebp]
+ 00308 3b d8 cmp ebx, eax
+ 0030a 0f 86 20 ff ff
+ ff jbe $LL136@inflate_ta
+ 00310 8b 75 c4 mov esi, DWORD PTR _mask$1$[ebp]
+ 00313 23 f2 and esi, edx
+ 00315 8b 55 d4 mov edx, DWORD PTR tv1502[ebp]
+ 00318 89 75 c8 mov DWORD PTR tv1501[ebp], esi
+ 0031b 3b 75 cc cmp esi, DWORD PTR _low$1$[ebp]
+ 0031e 0f 84 11 ff ff
+ ff je $LN137@inflate_ta
+
+; 261 : /* if first time, transition to sub-tables */
+; 262 : if (drop == 0)
+
+ 00324 8b 55 fc mov edx, DWORD PTR _drop$1$[ebp]
+ 00327 85 d2 test edx, edx
+
+; 263 : drop = root;
+; 264 :
+; 265 : /* increment past last table */
+; 266 : next += min; /* here min is 1 << curr */
+
+ 00329 8b 4d f8 mov ecx, DWORD PTR _next$1$[ebp]
+ 0032c 0f 44 d0 cmove edx, eax
+ 0032f 8b 45 c0 mov eax, DWORD PTR _min$2$[ebp]
+
+; 267 :
+; 268 : /* determine length of next table */
+; 269 : curr = len - drop;
+
+ 00332 2b da sub ebx, edx
+ 00334 89 55 fc mov DWORD PTR _drop$1$[ebp], edx
+
+; 270 : left = (int)(1 << curr);
+; 271 : while (curr + drop < max) {
+
+ 00337 03 d3 add edx, ebx
+ 00339 8d 0c 81 lea ecx, DWORD PTR [ecx+eax*4]
+ 0033c b8 01 00 00 00 mov eax, 1
+ 00341 89 4d f8 mov DWORD PTR _next$1$[ebp], ecx
+ 00344 8b cb mov ecx, ebx
+ 00346 d3 e0 shl eax, cl
+ 00348 3b d7 cmp edx, edi
+ 0034a 73 1d jae SHORT $LN81@inflate_ta
+
+; 263 : drop = root;
+; 264 :
+; 265 : /* increment past last table */
+; 266 : next += min; /* here min is 1 << curr */
+
+ 0034c 8d 75 a0 lea esi, DWORD PTR _count$[ebp]
+ 0034f 8d 34 56 lea esi, DWORD PTR [esi+edx*2]
+$LL33@inflate_ta:
+
+; 272 : left -= count[curr + drop];
+
+ 00352 0f b7 0e movzx ecx, WORD PTR [esi]
+ 00355 2b c1 sub eax, ecx
+
+; 273 : if (left <= 0) break;
+
+ 00357 85 c0 test eax, eax
+ 00359 7e 0b jle SHORT $LN135@inflate_ta
+
+; 274 : curr++;
+
+ 0035b 42 inc edx
+ 0035c 43 inc ebx
+ 0035d 83 c6 02 add esi, 2
+
+; 275 : left <<= 1;
+
+ 00360 03 c0 add eax, eax
+ 00362 3b d7 cmp edx, edi
+ 00364 72 ec jb SHORT $LL33@inflate_ta
+$LN135@inflate_ta:
+ 00366 8b 75 c8 mov esi, DWORD PTR tv1501[ebp]
+$LN81@inflate_ta:
+
+; 276 : }
+; 277 :
+; 278 : /* check for enough space */
+; 279 : used += 1U << curr;
+
+ 00369 8b 45 d0 mov eax, DWORD PTR _used$1$[ebp]
+ 0036c 8b cb mov ecx, ebx
+ 0036e ba 01 00 00 00 mov edx, 1
+ 00373 d3 e2 shl edx, cl
+
+; 280 : if ((type == LENS && used > ENOUGH_LENS) ||
+
+ 00375 8b 4d f0 mov ecx, DWORD PTR _type$1$[ebp]
+ 00378 03 c2 add eax, edx
+ 0037a 89 55 d4 mov DWORD PTR tv1502[ebp], edx
+ 0037d 89 45 d0 mov DWORD PTR _used$1$[ebp], eax
+ 00380 83 f9 01 cmp ecx, 1
+ 00383 75 07 jne SHORT $LN63@inflate_ta
+ 00385 3d 54 03 00 00 cmp eax, 852 ; 00000354H
+ 0038a eb 0a jmp SHORT $LN146@inflate_ta
+$LN63@inflate_ta:
+ 0038c 83 f9 02 cmp ecx, 2
+ 0038f 75 0b jne SHORT $LN61@inflate_ta
+ 00391 3d 50 02 00 00 cmp eax, 592 ; 00000250H
+$LN146@inflate_ta:
+ 00396 0f 87 83 fe ff
+ ff ja $LN48@inflate_ta
+$LN61@inflate_ta:
+
+; 281 : (type == DISTS && used > ENOUGH_DISTS))
+; 282 : return 1;
+; 283 :
+; 284 : /* point entry in root table to sub-table */
+; 285 : low = huff & mask;
+; 286 : (*table)[low].op = (unsigned char)curr;
+
+ 0039c 8b 4d 0c mov ecx, DWORD PTR _table$[ebp]
+ 0039f 89 75 cc mov DWORD PTR _low$1$[ebp], esi
+ 003a2 8b 01 mov eax, DWORD PTR [ecx]
+ 003a4 88 1c b0 mov BYTE PTR [eax+esi*4], bl
+
+; 287 : (*table)[low].bits = (unsigned char)root;
+
+ 003a7 8b 01 mov eax, DWORD PTR [ecx]
+ 003a9 8b 4d e8 mov ecx, DWORD PTR _root$3$[ebp]
+
+; 288 : (*table)[low].val = (unsigned short)(next - *table);
+; 289 : }
+; 290 : }
+
+ 003ac 8b 5d ec mov ebx, DWORD PTR _len$2$[ebp]
+ 003af 88 4c b0 01 mov BYTE PTR [eax+esi*4+1], cl
+ 003b3 8b 4d 0c mov ecx, DWORD PTR _table$[ebp]
+ 003b6 8b 45 f8 mov eax, DWORD PTR _next$1$[ebp]
+ 003b9 8b 09 mov ecx, DWORD PTR [ecx]
+ 003bb 2b c1 sub eax, ecx
+ 003bd c1 f8 02 sar eax, 2
+ 003c0 66 89 44 b1 02 mov WORD PTR [ecx+esi*4+2], ax
+ 003c5 e9 6b fe ff ff jmp $LN137@inflate_ta
+$LN82@inflate_ta:
+
+; 291 :
+; 292 : /* fill in remaining table entry if code is incomplete (guaranteed to have
+; 293 : at most one remaining entry, since if the code is incomplete, the
+; 294 : maximum code length that was allowed to get this far is one bit) */
+; 295 : if (huff != 0) {
+
+ 003ca 85 d2 test edx, edx
+ 003cc 74 19 je SHORT $LN64@inflate_ta
+
+; 296 : here.op = (unsigned char)64; /* invalid code marker */
+; 297 : here.bits = (unsigned char)(len - drop);
+
+ 003ce 2a 5d fc sub bl, BYTE PTR _drop$1$[ebp]
+
+; 298 : here.val = (unsigned short)0;
+
+ 003d1 33 c0 xor eax, eax
+
+; 299 : next[huff] = here;
+
+ 003d3 8b 4d f8 mov ecx, DWORD PTR _next$1$[ebp]
+ 003d6 c6 45 08 40 mov BYTE PTR _here$[ebp], 64 ; 00000040H
+ 003da 88 5d 09 mov BYTE PTR _here$[ebp+1], bl
+ 003dd 66 89 45 0a mov WORD PTR _here$[ebp+2], ax
+ 003e1 8b 45 08 mov eax, DWORD PTR _here$[ebp]
+ 003e4 89 04 91 mov DWORD PTR [ecx+edx*4], eax
+$LN64@inflate_ta:
+
+; 300 : }
+; 301 :
+; 302 : /* set return parameters */
+; 303 : *table += used;
+
+ 003e7 8b 4d 0c mov ecx, DWORD PTR _table$[ebp]
+ 003ea 8b 45 d0 mov eax, DWORD PTR _used$1$[ebp]
+ 003ed c1 e0 02 shl eax, 2
+ 003f0 5f pop edi
+ 003f1 01 01 add DWORD PTR [ecx], eax
+
+; 304 : *bits = root;
+
+ 003f3 8b 4d 10 mov ecx, DWORD PTR _bits$[ebp]
+ 003f6 8b 45 e8 mov eax, DWORD PTR _root$3$[ebp]
+ 003f9 5e pop esi
+ 003fa 5b pop ebx
+ 003fb 89 01 mov DWORD PTR [ecx], eax
+
+; 305 : return 0;
+
+ 003fd 33 c0 xor eax, eax
+
+; 306 : }
+
+ 003ff 8b e5 mov esp, ebp
+ 00401 5d pop ebp
+ 00402 c3 ret 0
+$LN80@inflate_ta:
+ 00403 5f pop edi
+ 00404 5e pop esi
+
+; 135 : if (left < 0) return -1; /* over-subscribed */
+
+ 00405 83 c8 ff or eax, -1
+ 00408 5b pop ebx
+
+; 306 : }
+
+ 00409 8b e5 mov esp, ebp
+ 0040b 5d pop ebp
+ 0040c c3 ret 0
+_inflate_table ENDP
+_TEXT ENDS
+END
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/inftrees.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/inftrees.obj
new file mode 100644
index 0000000000..2fca5acb27
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/inftrees.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/ioapi.cod b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/ioapi.cod
new file mode 100644
index 0000000000..949629adf2
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/ioapi.cod
@@ -0,0 +1,882 @@
+; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.23506.0
+
+ TITLE d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\ioapi.c
+ .686P
+ .XMM
+ include listing.inc
+ .model flat
+
+INCLUDELIB OLDNAMES
+
+PUBLIC ??_C@_02JDPG@rb?$AA@ ; `string'
+PUBLIC ??_C@_03HMFOOINA@r?$CLb?$AA@ ; `string'
+PUBLIC ??_C@_02GMLFBBN@wb?$AA@ ; `string'
+EXTRN __imp___fseeki64:PROC
+EXTRN __imp__fread:PROC
+EXTRN __imp___ftelli64:PROC
+EXTRN __imp__fwrite:PROC
+EXTRN __imp__fseek:PROC
+EXTRN __imp__fclose:PROC
+EXTRN __imp__fopen:PROC
+EXTRN __imp__ferror:PROC
+EXTRN __imp__ftell:PROC
+_DATA ENDS
+; COMDAT ??_C@_02GMLFBBN@wb?$AA@
+CONST SEGMENT
+??_C@_02GMLFBBN@wb?$AA@ DB 'wb', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_03HMFOOINA@r?$CLb?$AA@
+CONST SEGMENT
+??_C@_03HMFOOINA@r?$CLb?$AA@ DB 'r+b', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_02JDPG@rb?$AA@
+CONST SEGMENT
+??_C@_02JDPG@rb?$AA@ DB 'rb', 00H ; `string'
+PUBLIC _fill_fopen64_filefunc
+PUBLIC _fill_zlib_filefunc64_32_def_from_filefunc32
+PUBLIC _call_ztell64
+PUBLIC _call_zseek64
+PUBLIC _call_zopen64
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\ioapi.c
+; COMDAT _call_zopen64
+_TEXT SEGMENT
+_mode$ = 8 ; size = 4
+_call_zopen64 PROC ; COMDAT
+; _pfilefunc$ = ecx
+; _filename$ = edx
+
+; 32 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 33 : if (pfilefunc->zfile_func64.zopen64_file != NULL)
+; 34 : return (*(pfilefunc->zfile_func64.zopen64_file)) (pfilefunc->zfile_func64.opaque,filename,mode);
+
+ 00003 ff 75 08 push DWORD PTR _mode$[ebp]
+ 00006 8b 01 mov eax, DWORD PTR [ecx]
+ 00008 52 push edx
+ 00009 ff 71 1c push DWORD PTR [ecx+28]
+ 0000c 85 c0 test eax, eax
+ 0000e 75 03 jne SHORT $LN5@call_zopen
+
+; 35 : else
+; 36 : {
+; 37 : return (*(pfilefunc->zopen32_file))(pfilefunc->zfile_func64.opaque,(const char*)filename,mode);
+
+ 00010 8b 41 20 mov eax, DWORD PTR [ecx+32]
+$LN5@call_zopen:
+ 00013 ff d0 call eax
+ 00015 83 c4 0c add esp, 12 ; 0000000cH
+
+; 38 : }
+; 39 : }
+
+ 00018 5d pop ebp
+ 00019 c3 ret 0
+_call_zopen64 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\ioapi.c
+; COMDAT _call_zseek64
+_TEXT SEGMENT
+_offset$ = 8 ; size = 8
+_origin$ = 16 ; size = 4
+_call_zseek64 PROC ; COMDAT
+; _pfilefunc$ = ecx
+; _filestream$ = edx
+
+; 42 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 e4 f8 and esp, -8 ; fffffff8H
+ 00006 51 push ecx
+
+; 43 : if (pfilefunc->zfile_func64.zseek64_file != NULL)
+
+ 00007 8b 41 10 mov eax, DWORD PTR [ecx+16]
+ 0000a 56 push esi
+ 0000b 85 c0 test eax, eax
+ 0000d 74 17 je SHORT $LN2@call_zseek
+
+; 44 : return (*(pfilefunc->zfile_func64.zseek64_file)) (pfilefunc->zfile_func64.opaque,filestream,offset,origin);
+
+ 0000f ff 75 10 push DWORD PTR _origin$[ebp]
+ 00012 ff 75 0c push DWORD PTR _offset$[ebp+4]
+ 00015 ff 75 08 push DWORD PTR _offset$[ebp]
+ 00018 52 push edx
+ 00019 ff 71 1c push DWORD PTR [ecx+28]
+ 0001c ff d0 call eax
+ 0001e 83 c4 14 add esp, 20 ; 00000014H
+
+; 52 : }
+; 53 : }
+
+ 00021 5e pop esi
+ 00022 8b e5 mov esp, ebp
+ 00024 5d pop ebp
+ 00025 c3 ret 0
+$LN2@call_zseek:
+
+; 45 : else
+; 46 : {
+; 47 : uLong offsetTruncated = (uLong)offset;
+; 48 : if (offsetTruncated != offset)
+
+ 00026 8b 45 08 mov eax, DWORD PTR _offset$[ebp]
+ 00029 33 f6 xor esi, esi
+ 0002b 3b c0 cmp eax, eax
+ 0002d 75 1a jne SHORT $LN7@call_zseek
+ 0002f 3b 75 0c cmp esi, DWORD PTR _offset$[ebp+4]
+ 00032 75 15 jne SHORT $LN7@call_zseek
+
+; 50 : else
+; 51 : return (*(pfilefunc->zseek32_file))(pfilefunc->zfile_func64.opaque,filestream,offsetTruncated,origin);
+
+ 00034 ff 75 10 push DWORD PTR _origin$[ebp]
+ 00037 50 push eax
+ 00038 8b 41 28 mov eax, DWORD PTR [ecx+40]
+ 0003b 52 push edx
+ 0003c ff 71 1c push DWORD PTR [ecx+28]
+ 0003f ff d0 call eax
+ 00041 83 c4 10 add esp, 16 ; 00000010H
+
+; 52 : }
+; 53 : }
+
+ 00044 5e pop esi
+ 00045 8b e5 mov esp, ebp
+ 00047 5d pop ebp
+ 00048 c3 ret 0
+$LN7@call_zseek:
+
+; 49 : return -1;
+
+ 00049 83 c8 ff or eax, -1
+
+; 52 : }
+; 53 : }
+
+ 0004c 5e pop esi
+ 0004d 8b e5 mov esp, ebp
+ 0004f 5d pop ebp
+ 00050 c3 ret 0
+_call_zseek64 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\ioapi.c
+; COMDAT _call_ztell64
+_TEXT SEGMENT
+_call_ztell64 PROC ; COMDAT
+; _pfilefunc$ = ecx
+; _filestream$ = edx
+
+; 57 : if (pfilefunc->zfile_func64.zseek64_file != NULL)
+
+ 00000 83 79 10 00 cmp DWORD PTR [ecx+16], 0
+
+; 58 : return (*(pfilefunc->zfile_func64.ztell64_file)) (pfilefunc->zfile_func64.opaque,filestream);
+
+ 00004 52 push edx
+ 00005 ff 71 1c push DWORD PTR [ecx+28]
+ 00008 74 09 je SHORT $LN2@call_ztell
+ 0000a 8b 41 0c mov eax, DWORD PTR [ecx+12]
+ 0000d ff d0 call eax
+ 0000f 83 c4 08 add esp, 8
+
+; 66 : }
+; 67 : }
+
+ 00012 c3 ret 0
+$LN2@call_ztell:
+
+; 59 : else
+; 60 : {
+; 61 : uLong tell_uLong = (*(pfilefunc->ztell32_file))(pfilefunc->zfile_func64.opaque,filestream);
+
+ 00013 8b 41 24 mov eax, DWORD PTR [ecx+36]
+ 00016 ff d0 call eax
+ 00018 83 c4 08 add esp, 8
+
+; 62 : if ((tell_uLong) == MAXU32)
+
+ 0001b 83 f8 ff cmp eax, -1
+ 0001e 75 06 jne SHORT $LN4@call_ztell
+
+; 63 : return (ZPOS64_T)-1;
+
+ 00020 0b c0 or eax, eax
+ 00022 83 ca ff or edx, -1
+
+; 66 : }
+; 67 : }
+
+ 00025 c3 ret 0
+$LN4@call_ztell:
+
+; 64 : else
+; 65 : return tell_uLong;
+
+ 00026 33 d2 xor edx, edx
+
+; 66 : }
+; 67 : }
+
+ 00028 c3 ret 0
+_call_ztell64 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\ioapi.c
+; COMDAT _fill_zlib_filefunc64_32_def_from_filefunc32
+_TEXT SEGMENT
+_fill_zlib_filefunc64_32_def_from_filefunc32 PROC ; COMDAT
+; _p_filefunc64_32$ = ecx
+; _p_filefunc32$ = edx
+
+; 71 : p_filefunc64_32->zfile_func64.zopen64_file = NULL;
+; 72 : p_filefunc64_32->zopen32_file = p_filefunc32->zopen_file;
+
+ 00000 8b 02 mov eax, DWORD PTR [edx]
+ 00002 89 41 20 mov DWORD PTR [ecx+32], eax
+
+; 73 : p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file;
+; 74 : p_filefunc64_32->zfile_func64.zread_file = p_filefunc32->zread_file;
+
+ 00005 8b 42 04 mov eax, DWORD PTR [edx+4]
+ 00008 89 41 04 mov DWORD PTR [ecx+4], eax
+
+; 75 : p_filefunc64_32->zfile_func64.zwrite_file = p_filefunc32->zwrite_file;
+
+ 0000b 8b 42 08 mov eax, DWORD PTR [edx+8]
+ 0000e 89 41 08 mov DWORD PTR [ecx+8], eax
+
+; 76 : p_filefunc64_32->zfile_func64.ztell64_file = NULL;
+; 77 : p_filefunc64_32->zfile_func64.zseek64_file = NULL;
+; 78 : p_filefunc64_32->zfile_func64.zclose_file = p_filefunc32->zclose_file;
+
+ 00011 8b 42 14 mov eax, DWORD PTR [edx+20]
+ 00014 89 41 14 mov DWORD PTR [ecx+20], eax
+
+; 79 : p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file;
+
+ 00017 8b 42 18 mov eax, DWORD PTR [edx+24]
+ 0001a 89 41 18 mov DWORD PTR [ecx+24], eax
+
+; 80 : p_filefunc64_32->zfile_func64.opaque = p_filefunc32->opaque;
+
+ 0001d 8b 42 1c mov eax, DWORD PTR [edx+28]
+ 00020 89 41 1c mov DWORD PTR [ecx+28], eax
+
+; 81 : p_filefunc64_32->zseek32_file = p_filefunc32->zseek_file;
+
+ 00023 8b 42 10 mov eax, DWORD PTR [edx+16]
+ 00026 89 41 28 mov DWORD PTR [ecx+40], eax
+
+; 82 : p_filefunc64_32->ztell32_file = p_filefunc32->ztell_file;
+
+ 00029 8b 42 0c mov eax, DWORD PTR [edx+12]
+ 0002c c7 01 00 00 00
+ 00 mov DWORD PTR [ecx], 0
+ 00032 c7 41 0c 00 00
+ 00 00 mov DWORD PTR [ecx+12], 0
+ 00039 c7 41 10 00 00
+ 00 00 mov DWORD PTR [ecx+16], 0
+ 00040 89 41 24 mov DWORD PTR [ecx+36], eax
+
+; 83 : }
+
+ 00043 c3 ret 0
+_fill_zlib_filefunc64_32_def_from_filefunc32 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\ioapi.c
+; COMDAT _fopen_file_func
+_TEXT SEGMENT
+_opaque$ = 8 ; size = 4
+_filename$ = 12 ; size = 4
+_mode$ = 16 ; size = 4
+_fopen_file_func PROC ; COMDAT
+
+; 96 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 97 : FILE* file = NULL;
+; 98 : const char* mode_fopen = NULL;
+; 99 : if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
+
+ 00003 8b 4d 10 mov ecx, DWORD PTR _mode$[ebp]
+ 00006 33 d2 xor edx, edx
+ 00008 8b c1 mov eax, ecx
+ 0000a 24 03 and al, 3
+ 0000c 3c 01 cmp al, 1
+ 0000e 75 07 jne SHORT $LN2@fopen_file
+
+; 100 : mode_fopen = "rb";
+
+ 00010 b8 00 00 00 00 mov eax, OFFSET ??_C@_02JDPG@rb?$AA@
+ 00015 eb 17 jmp SHORT $LN6@fopen_file
+$LN2@fopen_file:
+
+; 101 : else
+; 102 : if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
+
+ 00017 f6 c1 04 test cl, 4
+ 0001a 74 07 je SHORT $LN4@fopen_file
+
+; 103 : mode_fopen = "r+b";
+
+ 0001c b8 00 00 00 00 mov eax, OFFSET ??_C@_03HMFOOINA@r?$CLb?$AA@
+ 00021 eb 0b jmp SHORT $LN6@fopen_file
+$LN4@fopen_file:
+
+; 104 : else
+; 105 : if (mode & ZLIB_FILEFUNC_MODE_CREATE)
+
+ 00023 f6 c1 08 test cl, 8
+ 00026 b8 00 00 00 00 mov eax, OFFSET ??_C@_02GMLFBBN@wb?$AA@
+ 0002b 0f 44 c2 cmove eax, edx
+$LN6@fopen_file:
+
+; 106 : mode_fopen = "wb";
+; 107 :
+; 108 : if ((filename!=NULL) && (mode_fopen != NULL))
+
+ 0002e 8b 4d 0c mov ecx, DWORD PTR _filename$[ebp]
+ 00031 85 c9 test ecx, ecx
+ 00033 74 11 je SHORT $LN9@fopen_file
+ 00035 85 c0 test eax, eax
+ 00037 74 0d je SHORT $LN9@fopen_file
+
+; 109 : file = fopen(filename, mode_fopen);
+
+ 00039 50 push eax
+ 0003a 51 push ecx
+ 0003b ff 15 00 00 00
+ 00 call DWORD PTR __imp__fopen
+ 00041 83 c4 08 add esp, 8
+
+; 111 : }
+
+ 00044 5d pop ebp
+ 00045 c3 ret 0
+$LN9@fopen_file:
+
+; 110 : return file;
+
+ 00046 33 c0 xor eax, eax
+
+; 111 : }
+
+ 00048 5d pop ebp
+ 00049 c3 ret 0
+_fopen_file_func ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\ioapi.c
+; COMDAT _fopen64_file_func
+_TEXT SEGMENT
+_opaque$ = 8 ; size = 4
+_filename$ = 12 ; size = 4
+_mode$ = 16 ; size = 4
+_fopen64_file_func PROC ; COMDAT
+
+; 114 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 115 : FILE* file = NULL;
+; 116 : const char* mode_fopen = NULL;
+; 117 : if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
+
+ 00003 8b 4d 10 mov ecx, DWORD PTR _mode$[ebp]
+ 00006 33 d2 xor edx, edx
+ 00008 8b c1 mov eax, ecx
+ 0000a 24 03 and al, 3
+ 0000c 3c 01 cmp al, 1
+ 0000e 75 07 jne SHORT $LN2@fopen64_fi
+
+; 118 : mode_fopen = "rb";
+
+ 00010 b8 00 00 00 00 mov eax, OFFSET ??_C@_02JDPG@rb?$AA@
+ 00015 eb 17 jmp SHORT $LN6@fopen64_fi
+$LN2@fopen64_fi:
+
+; 119 : else
+; 120 : if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
+
+ 00017 f6 c1 04 test cl, 4
+ 0001a 74 07 je SHORT $LN4@fopen64_fi
+
+; 121 : mode_fopen = "r+b";
+
+ 0001c b8 00 00 00 00 mov eax, OFFSET ??_C@_03HMFOOINA@r?$CLb?$AA@
+ 00021 eb 0b jmp SHORT $LN6@fopen64_fi
+$LN4@fopen64_fi:
+
+; 122 : else
+; 123 : if (mode & ZLIB_FILEFUNC_MODE_CREATE)
+
+ 00023 f6 c1 08 test cl, 8
+ 00026 b8 00 00 00 00 mov eax, OFFSET ??_C@_02GMLFBBN@wb?$AA@
+ 0002b 0f 44 c2 cmove eax, edx
+$LN6@fopen64_fi:
+
+; 124 : mode_fopen = "wb";
+; 125 :
+; 126 : if ((filename!=NULL) && (mode_fopen != NULL))
+
+ 0002e 8b 4d 0c mov ecx, DWORD PTR _filename$[ebp]
+ 00031 85 c9 test ecx, ecx
+ 00033 74 11 je SHORT $LN9@fopen64_fi
+ 00035 85 c0 test eax, eax
+ 00037 74 0d je SHORT $LN9@fopen64_fi
+
+; 127 : file = FOPEN_FUNC((const char*)filename, mode_fopen);
+
+ 00039 50 push eax
+ 0003a 51 push ecx
+ 0003b ff 15 00 00 00
+ 00 call DWORD PTR __imp__fopen
+ 00041 83 c4 08 add esp, 8
+
+; 129 : }
+
+ 00044 5d pop ebp
+ 00045 c3 ret 0
+$LN9@fopen64_fi:
+
+; 128 : return file;
+
+ 00046 33 c0 xor eax, eax
+
+; 129 : }
+
+ 00048 5d pop ebp
+ 00049 c3 ret 0
+_fopen64_file_func ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\ioapi.c
+; COMDAT _fread_file_func
+_TEXT SEGMENT
+_opaque$ = 8 ; size = 4
+_stream$ = 12 ; size = 4
+_buf$ = 16 ; size = 4
+_size$ = 20 ; size = 4
+_fread_file_func PROC ; COMDAT
+
+; 133 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 134 : uLong ret;
+; 135 : ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream);
+
+ 00003 ff 75 0c push DWORD PTR _stream$[ebp]
+ 00006 ff 75 14 push DWORD PTR _size$[ebp]
+ 00009 6a 01 push 1
+ 0000b ff 75 10 push DWORD PTR _buf$[ebp]
+ 0000e ff 15 00 00 00
+ 00 call DWORD PTR __imp__fread
+ 00014 83 c4 10 add esp, 16 ; 00000010H
+
+; 136 : return ret;
+; 137 : }
+
+ 00017 5d pop ebp
+ 00018 c3 ret 0
+_fread_file_func ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\ioapi.c
+; COMDAT _fwrite_file_func
+_TEXT SEGMENT
+_opaque$ = 8 ; size = 4
+_stream$ = 12 ; size = 4
+_buf$ = 16 ; size = 4
+_size$ = 20 ; size = 4
+_fwrite_file_func PROC ; COMDAT
+
+; 140 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 141 : uLong ret;
+; 142 : ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream);
+
+ 00003 ff 75 0c push DWORD PTR _stream$[ebp]
+ 00006 ff 75 14 push DWORD PTR _size$[ebp]
+ 00009 6a 01 push 1
+ 0000b ff 75 10 push DWORD PTR _buf$[ebp]
+ 0000e ff 15 00 00 00
+ 00 call DWORD PTR __imp__fwrite
+ 00014 83 c4 10 add esp, 16 ; 00000010H
+
+; 143 : return ret;
+; 144 : }
+
+ 00017 5d pop ebp
+ 00018 c3 ret 0
+_fwrite_file_func ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\ioapi.c
+; COMDAT _ftell_file_func
+_TEXT SEGMENT
+_opaque$ = 8 ; size = 4
+_stream$ = 12 ; size = 4
+_ftell_file_func PROC ; COMDAT
+
+; 147 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 148 : long ret;
+; 149 : ret = ftell((FILE *)stream);
+
+ 00003 ff 75 0c push DWORD PTR _stream$[ebp]
+ 00006 ff 15 00 00 00
+ 00 call DWORD PTR __imp__ftell
+ 0000c 83 c4 04 add esp, 4
+
+; 150 : return ret;
+; 151 : }
+
+ 0000f 5d pop ebp
+ 00010 c3 ret 0
+_ftell_file_func ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\ioapi.c
+; COMDAT _ftell64_file_func
+_TEXT SEGMENT
+_opaque$ = 8 ; size = 4
+_stream$ = 12 ; size = 4
+_ftell64_file_func PROC ; COMDAT
+
+; 155 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 156 : ZPOS64_T ret;
+; 157 : ret = FTELLO_FUNC((FILE *)stream);
+
+ 00003 ff 75 0c push DWORD PTR _stream$[ebp]
+ 00006 ff 15 00 00 00
+ 00 call DWORD PTR __imp___ftelli64
+ 0000c 83 c4 04 add esp, 4
+
+; 158 : return ret;
+; 159 : }
+
+ 0000f 5d pop ebp
+ 00010 c3 ret 0
+_ftell64_file_func ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\ioapi.c
+; COMDAT _fseek_file_func
+_TEXT SEGMENT
+_opaque$ = 8 ; size = 4
+_stream$ = 12 ; size = 4
+_offset$ = 16 ; size = 4
+_origin$ = 20 ; size = 4
+_fseek_file_func PROC ; COMDAT
+
+; 162 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 163 : int fseek_origin=0;
+; 164 : long ret;
+; 165 : switch (origin)
+
+ 00003 8b 45 14 mov eax, DWORD PTR _origin$[ebp]
+ 00006 83 e8 00 sub eax, 0
+ 00009 74 1d je SHORT $LN6@fseek_file
+ 0000b 83 e8 01 sub eax, 1
+ 0000e 74 11 je SHORT $LN4@fseek_file
+ 00010 83 e8 01 sub eax, 1
+ 00013 74 05 je SHORT $LN5@fseek_file
+
+; 175 : break;
+; 176 : default: return -1;
+
+ 00015 83 c8 ff or eax, -1
+
+; 182 : }
+
+ 00018 5d pop ebp
+ 00019 c3 ret 0
+$LN5@fseek_file:
+
+; 170 : case ZLIB_FILEFUNC_SEEK_END :
+; 171 : fseek_origin = SEEK_END;
+
+ 0001a b8 02 00 00 00 mov eax, 2
+
+; 172 : break;
+
+ 0001f eb 09 jmp SHORT $LN2@fseek_file
+$LN4@fseek_file:
+
+; 166 : {
+; 167 : case ZLIB_FILEFUNC_SEEK_CUR :
+; 168 : fseek_origin = SEEK_CUR;
+
+ 00021 b8 01 00 00 00 mov eax, 1
+
+; 169 : break;
+
+ 00026 eb 02 jmp SHORT $LN2@fseek_file
+$LN6@fseek_file:
+
+; 173 : case ZLIB_FILEFUNC_SEEK_SET :
+; 174 : fseek_origin = SEEK_SET;
+
+ 00028 33 c0 xor eax, eax
+$LN2@fseek_file:
+ 0002a 56 push esi
+
+; 177 : }
+; 178 : ret = 0;
+; 179 : if (fseek((FILE *)stream, offset, fseek_origin) != 0)
+
+ 0002b 50 push eax
+ 0002c ff 75 10 push DWORD PTR _offset$[ebp]
+ 0002f 33 f6 xor esi, esi
+ 00031 ff 75 0c push DWORD PTR _stream$[ebp]
+ 00034 ff 15 00 00 00
+ 00 call DWORD PTR __imp__fseek
+ 0003a 83 c4 0c add esp, 12 ; 0000000cH
+ 0003d 83 c9 ff or ecx, -1
+ 00040 85 c0 test eax, eax
+ 00042 0f 45 f1 cmovne esi, ecx
+
+; 180 : ret = -1;
+; 181 : return ret;
+
+ 00045 8b c6 mov eax, esi
+ 00047 5e pop esi
+
+; 182 : }
+
+ 00048 5d pop ebp
+ 00049 c3 ret 0
+_fseek_file_func ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\ioapi.c
+; COMDAT _fseek64_file_func
+_TEXT SEGMENT
+_opaque$ = 8 ; size = 4
+_stream$ = 12 ; size = 4
+_offset$ = 16 ; size = 8
+_origin$ = 24 ; size = 4
+_fseek64_file_func PROC ; COMDAT
+
+; 185 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 186 : int fseek_origin=0;
+; 187 : long ret;
+; 188 : switch (origin)
+
+ 00003 8b 45 18 mov eax, DWORD PTR _origin$[ebp]
+ 00006 83 e8 00 sub eax, 0
+ 00009 74 1d je SHORT $LN6@fseek64_fi
+ 0000b 83 e8 01 sub eax, 1
+ 0000e 74 11 je SHORT $LN4@fseek64_fi
+ 00010 83 e8 01 sub eax, 1
+ 00013 74 05 je SHORT $LN5@fseek64_fi
+
+; 198 : break;
+; 199 : default: return -1;
+
+ 00015 83 c8 ff or eax, -1
+
+; 207 : }
+
+ 00018 5d pop ebp
+ 00019 c3 ret 0
+$LN5@fseek64_fi:
+
+; 193 : case ZLIB_FILEFUNC_SEEK_END :
+; 194 : fseek_origin = SEEK_END;
+
+ 0001a b8 02 00 00 00 mov eax, 2
+
+; 195 : break;
+
+ 0001f eb 09 jmp SHORT $LN2@fseek64_fi
+$LN4@fseek64_fi:
+
+; 189 : {
+; 190 : case ZLIB_FILEFUNC_SEEK_CUR :
+; 191 : fseek_origin = SEEK_CUR;
+
+ 00021 b8 01 00 00 00 mov eax, 1
+
+; 192 : break;
+
+ 00026 eb 02 jmp SHORT $LN2@fseek64_fi
+$LN6@fseek64_fi:
+
+; 196 : case ZLIB_FILEFUNC_SEEK_SET :
+; 197 : fseek_origin = SEEK_SET;
+
+ 00028 33 c0 xor eax, eax
+$LN2@fseek64_fi:
+ 0002a 56 push esi
+
+; 200 : }
+; 201 : ret = 0;
+; 202 :
+; 203 : if(FSEEKO_FUNC((FILE *)stream, offset, fseek_origin) != 0)
+
+ 0002b 50 push eax
+ 0002c ff 75 14 push DWORD PTR _offset$[ebp+4]
+ 0002f 33 f6 xor esi, esi
+ 00031 ff 75 10 push DWORD PTR _offset$[ebp]
+ 00034 ff 75 0c push DWORD PTR _stream$[ebp]
+ 00037 ff 15 00 00 00
+ 00 call DWORD PTR __imp___fseeki64
+ 0003d 83 c4 10 add esp, 16 ; 00000010H
+ 00040 83 c9 ff or ecx, -1
+ 00043 85 c0 test eax, eax
+ 00045 0f 45 f1 cmovne esi, ecx
+
+; 204 : ret = -1;
+; 205 :
+; 206 : return ret;
+
+ 00048 8b c6 mov eax, esi
+ 0004a 5e pop esi
+
+; 207 : }
+
+ 0004b 5d pop ebp
+ 0004c c3 ret 0
+_fseek64_file_func ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\ioapi.c
+; COMDAT _fclose_file_func
+_TEXT SEGMENT
+_opaque$ = 8 ; size = 4
+_stream$ = 12 ; size = 4
+_fclose_file_func PROC ; COMDAT
+
+; 211 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 212 : int ret;
+; 213 : ret = fclose((FILE *)stream);
+
+ 00003 ff 75 0c push DWORD PTR _stream$[ebp]
+ 00006 ff 15 00 00 00
+ 00 call DWORD PTR __imp__fclose
+ 0000c 83 c4 04 add esp, 4
+
+; 214 : return ret;
+; 215 : }
+
+ 0000f 5d pop ebp
+ 00010 c3 ret 0
+_fclose_file_func ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\ioapi.c
+; COMDAT _ferror_file_func
+_TEXT SEGMENT
+_opaque$ = 8 ; size = 4
+_stream$ = 12 ; size = 4
+_ferror_file_func PROC ; COMDAT
+
+; 218 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 219 : int ret;
+; 220 : ret = ferror((FILE *)stream);
+
+ 00003 ff 75 0c push DWORD PTR _stream$[ebp]
+ 00006 ff 15 00 00 00
+ 00 call DWORD PTR __imp__ferror
+ 0000c 83 c4 04 add esp, 4
+
+; 221 : return ret;
+; 222 : }
+
+ 0000f 5d pop ebp
+ 00010 c3 ret 0
+_ferror_file_func ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\ioapi.c
+; COMDAT _fill_fopen64_filefunc
+_TEXT SEGMENT
+_fill_fopen64_filefunc PROC ; COMDAT
+; _pzlib_filefunc_def$ = ecx
+
+; 239 : pzlib_filefunc_def->zopen64_file = fopen64_file_func;
+
+ 00000 c7 01 00 00 00
+ 00 mov DWORD PTR [ecx], OFFSET _fopen64_file_func
+
+; 240 : pzlib_filefunc_def->zread_file = fread_file_func;
+
+ 00006 c7 41 04 00 00
+ 00 00 mov DWORD PTR [ecx+4], OFFSET _fread_file_func
+
+; 241 : pzlib_filefunc_def->zwrite_file = fwrite_file_func;
+
+ 0000d c7 41 08 00 00
+ 00 00 mov DWORD PTR [ecx+8], OFFSET _fwrite_file_func
+
+; 242 : pzlib_filefunc_def->ztell64_file = ftell64_file_func;
+
+ 00014 c7 41 0c 00 00
+ 00 00 mov DWORD PTR [ecx+12], OFFSET _ftell64_file_func
+
+; 243 : pzlib_filefunc_def->zseek64_file = fseek64_file_func;
+
+ 0001b c7 41 10 00 00
+ 00 00 mov DWORD PTR [ecx+16], OFFSET _fseek64_file_func
+
+; 244 : pzlib_filefunc_def->zclose_file = fclose_file_func;
+
+ 00022 c7 41 14 00 00
+ 00 00 mov DWORD PTR [ecx+20], OFFSET _fclose_file_func
+
+; 245 : pzlib_filefunc_def->zerror_file = ferror_file_func;
+
+ 00029 c7 41 18 00 00
+ 00 00 mov DWORD PTR [ecx+24], OFFSET _ferror_file_func
+
+; 246 : pzlib_filefunc_def->opaque = NULL;
+
+ 00030 c7 41 1c 00 00
+ 00 00 mov DWORD PTR [ecx+28], 0
+
+; 247 : }
+
+ 00037 c3 ret 0
+_fill_fopen64_filefunc ENDP
+_TEXT ENDS
+END
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/ioapi.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/ioapi.obj
new file mode 100644
index 0000000000..3249cd139e
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/ioapi.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/iowin32.cod b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/iowin32.cod
new file mode 100644
index 0000000000..9f349a34ff
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/iowin32.cod
@@ -0,0 +1,1691 @@
+; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.23506.0
+
+ TITLE d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\iowin32.c
+ .686P
+ .XMM
+ include listing.inc
+ .model flat
+
+INCLUDELIB OLDNAMES
+
+EXTRN __imp__SetFilePointerEx@20:PROC
+EXTRN __imp__CloseHandle@4:PROC
+EXTRN __imp__GetLastError@0:PROC
+EXTRN __imp__MultiByteToWideChar@24:PROC
+EXTRN __imp__CreateFile2@20:PROC
+EXTRN __imp__WriteFile@20:PROC
+EXTRN __imp__ReadFile@20:PROC
+PUBLIC _fill_win32_filefunc64W
+PUBLIC _fill_win32_filefunc64A
+PUBLIC _fill_win32_filefunc64
+PUBLIC _fill_win32_filefunc
+PUBLIC _win32_error_file_func
+PUBLIC _win32_close_file_func
+PUBLIC _win32_seek64_file_func
+PUBLIC _win32_seek_file_func
+PUBLIC _win32_tell64_file_func
+PUBLIC _win32_tell_file_func
+PUBLIC _win32_write_file_func
+PUBLIC _win32_read_file_func
+PUBLIC _win32_open_file_func
+PUBLIC _win32_open64_file_funcW
+PUBLIC _win32_open64_file_funcA
+PUBLIC _win32_open64_file_func
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\iowin32.c
+; COMDAT _win32_translate_open_mode
+_TEXT SEGMENT
+_lpdwCreationDisposition$ = 8 ; size = 4
+_lpdwShareMode$ = 12 ; size = 4
+_lpdwFlagsAndAttributes$ = 16 ; size = 4
+_win32_translate_open_mode PROC ; COMDAT
+; _mode$ = ecx
+; _lpdwDesiredAccess$ = edx
+
+; 55 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 56 : *lpdwDesiredAccess = *lpdwShareMode = *lpdwFlagsAndAttributes = *lpdwCreationDisposition = 0;
+
+ 00003 8b 45 10 mov eax, DWORD PTR _lpdwFlagsAndAttributes$[ebp]
+ 00006 56 push esi
+ 00007 8b 75 08 mov esi, DWORD PTR _lpdwCreationDisposition$[ebp]
+ 0000a 57 push edi
+ 0000b 8b 7d 0c mov edi, DWORD PTR _lpdwShareMode$[ebp]
+ 0000e c7 00 00 00 00
+ 00 mov DWORD PTR [eax], 0
+
+; 57 :
+; 58 : if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
+
+ 00014 8b c1 mov eax, ecx
+ 00016 24 03 and al, 3
+ 00018 c7 06 00 00 00
+ 00 mov DWORD PTR [esi], 0
+ 0001e c7 02 00 00 00
+ 00 mov DWORD PTR [edx], 0
+ 00024 c7 07 00 00 00
+ 00 mov DWORD PTR [edi], 0
+ 0002a 3c 01 cmp al, 1
+ 0002c 75 16 jne SHORT $LN2@win32_tran
+
+; 59 : {
+; 60 : *lpdwDesiredAccess = GENERIC_READ;
+; 61 : *lpdwCreationDisposition = OPEN_EXISTING;
+; 62 : *lpdwShareMode = FILE_SHARE_READ;
+
+ 0002e c7 07 01 00 00
+ 00 mov DWORD PTR [edi], 1
+ 00034 5f pop edi
+ 00035 c7 06 03 00 00
+ 00 mov DWORD PTR [esi], 3
+ 0003b c7 02 00 00 00
+ 80 mov DWORD PTR [edx], -2147483648 ; 80000000H
+ 00041 5e pop esi
+
+; 73 : }
+; 74 : }
+
+ 00042 5d pop ebp
+ 00043 c3 ret 0
+$LN2@win32_tran:
+
+; 63 : }
+; 64 : else if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
+
+ 00044 f6 c1 04 test cl, 4
+ 00047 74 10 je SHORT $LN4@win32_tran
+
+; 65 : {
+; 66 : *lpdwDesiredAccess = GENERIC_WRITE | GENERIC_READ;
+; 67 : *lpdwCreationDisposition = OPEN_EXISTING;
+
+ 00049 5f pop edi
+ 0004a c7 06 03 00 00
+ 00 mov DWORD PTR [esi], 3
+
+; 70 : {
+; 71 : *lpdwDesiredAccess = GENERIC_WRITE | GENERIC_READ;
+
+ 00050 c7 02 00 00 00
+ c0 mov DWORD PTR [edx], -1073741824 ; c0000000H
+ 00056 5e pop esi
+
+; 73 : }
+; 74 : }
+
+ 00057 5d pop ebp
+ 00058 c3 ret 0
+$LN4@win32_tran:
+
+; 68 : }
+; 69 : else if (mode & ZLIB_FILEFUNC_MODE_CREATE)
+
+ 00059 f6 c1 08 test cl, 8
+ 0005c 74 0c je SHORT $LN6@win32_tran
+
+; 72 : *lpdwCreationDisposition = CREATE_ALWAYS;
+
+ 0005e c7 06 02 00 00
+ 00 mov DWORD PTR [esi], 2
+ 00064 c7 02 00 00 00
+ c0 mov DWORD PTR [edx], -1073741824 ; c0000000H
+$LN6@win32_tran:
+ 0006a 5f pop edi
+ 0006b 5e pop esi
+
+; 73 : }
+; 74 : }
+
+ 0006c 5d pop ebp
+ 0006d c3 ret 0
+_win32_translate_open_mode ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\iowin32.c
+; COMDAT _win32_build_iowin
+_TEXT SEGMENT
+_win32_build_iowin PROC ; COMDAT
+; _hFile$ = ecx
+
+; 77 : {
+
+ 00000 56 push esi
+ 00001 8b f1 mov esi, ecx
+
+; 78 : voidpf ret=NULL;
+; 79 :
+; 80 : if ((hFile != NULL) && (hFile != INVALID_HANDLE_VALUE))
+
+ 00003 85 f6 test esi, esi
+ 00005 74 2f je SHORT $LN7@win32_buil
+ 00007 83 fe ff cmp esi, -1
+ 0000a 74 2a je SHORT $LN7@win32_buil
+
+; 81 : {
+; 82 : WIN32FILE_IOWIN w32fiow;
+; 83 : w32fiow.hf = hFile;
+; 84 : w32fiow.error = 0;
+; 85 : ret = malloc(sizeof(WIN32FILE_IOWIN));
+
+ 0000c 57 push edi
+ 0000d 6a 08 push 8
+ 0000f ff 15 00 00 00
+ 00 call DWORD PTR __imp__malloc
+ 00015 8b f8 mov edi, eax
+ 00017 83 c4 04 add esp, 4
+
+; 86 :
+; 87 : if (ret==NULL)
+
+ 0001a 85 ff test edi, edi
+ 0001c 75 0c jne SHORT $LN3@win32_buil
+
+; 88 : CloseHandle(hFile);
+
+ 0001e 56 push esi
+ 0001f ff 15 00 00 00
+ 00 call DWORD PTR __imp__CloseHandle@4
+
+; 91 : }
+; 92 : return ret;
+
+ 00025 8b c7 mov eax, edi
+ 00027 5f pop edi
+ 00028 5e pop esi
+
+; 93 : }
+
+ 00029 c3 ret 0
+$LN3@win32_buil:
+
+; 89 : else
+; 90 : *((WIN32FILE_IOWIN*)ret) = w32fiow;
+
+ 0002a 89 37 mov DWORD PTR [edi], esi
+ 0002c c7 47 04 00 00
+ 00 00 mov DWORD PTR [edi+4], 0
+ 00033 5f pop edi
+ 00034 5e pop esi
+
+; 93 : }
+
+ 00035 c3 ret 0
+$LN7@win32_buil:
+
+; 91 : }
+; 92 : return ret;
+
+ 00036 33 c0 xor eax, eax
+ 00038 5e pop esi
+
+; 93 : }
+
+ 00039 c3 ret 0
+_win32_build_iowin ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\iowin32.c
+; COMDAT _win32_open64_file_func
+_TEXT SEGMENT
+_filenameW$1 = -1564 ; size = 1546
+_dwFlagsAndAttributes$ = -16 ; size = 4
+_dwShareMode$ = -12 ; size = 4
+_dwCreationDisposition$ = -8 ; size = 4
+_dwDesiredAccess$ = -4 ; size = 4
+_opaque$ = 8 ; size = 4
+_filename$ = 12 ; size = 4
+_mode$ = 16 ; size = 4
+_win32_open64_file_func PROC ; COMDAT
+
+; 96 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 97 : const char* mode_fopen = NULL;
+; 98 : DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ;
+; 99 : HANDLE hFile = NULL;
+; 100 :
+; 101 : win32_translate_open_mode(mode,&dwDesiredAccess,&dwCreationDisposition,&dwShareMode,&dwFlagsAndAttributes);
+
+ 00003 8b 4d 10 mov ecx, DWORD PTR _mode$[ebp]
+ 00006 8d 45 f0 lea eax, DWORD PTR _dwFlagsAndAttributes$[ebp]
+ 00009 81 ec 1c 06 00
+ 00 sub esp, 1564 ; 0000061cH
+ 0000f 8d 55 fc lea edx, DWORD PTR _dwDesiredAccess$[ebp]
+ 00012 57 push edi
+ 00013 50 push eax
+ 00014 8d 45 f4 lea eax, DWORD PTR _dwShareMode$[ebp]
+ 00017 33 ff xor edi, edi
+ 00019 50 push eax
+ 0001a 8d 45 f8 lea eax, DWORD PTR _dwCreationDisposition$[ebp]
+ 0001d 50 push eax
+ 0001e e8 00 00 00 00 call _win32_translate_open_mode
+
+; 102 :
+; 103 : #ifdef IOWIN32_USING_WINRT_API
+; 104 : #ifdef UNICODE
+; 105 : if ((filename!=NULL) && (dwDesiredAccess != 0))
+; 106 : hFile = CreateFile2((LPCTSTR)filename, dwDesiredAccess, dwShareMode, dwCreationDisposition, NULL);
+; 107 : #else
+; 108 : if ((filename!=NULL) && (dwDesiredAccess != 0))
+
+ 00023 8b 45 0c mov eax, DWORD PTR _filename$[ebp]
+ 00026 83 c4 0c add esp, 12 ; 0000000cH
+ 00029 85 c0 test eax, eax
+ 0002b 74 35 je SHORT $LN2@win32_open
+ 0002d 39 7d fc cmp DWORD PTR _dwDesiredAccess$[ebp], edi
+ 00030 74 30 je SHORT $LN2@win32_open
+
+; 109 : {
+; 110 : WCHAR filenameW[FILENAME_MAX + 0x200 + 1];
+; 111 : MultiByteToWideChar(CP_ACP,0,(const char*)filename,-1,filenameW,FILENAME_MAX + 0x200);
+
+ 00032 68 04 03 00 00 push 772 ; 00000304H
+ 00037 8d 8d e4 f9 ff
+ ff lea ecx, DWORD PTR _filenameW$1[ebp]
+ 0003d 51 push ecx
+ 0003e 6a ff push -1
+ 00040 50 push eax
+ 00041 57 push edi
+ 00042 57 push edi
+ 00043 ff 15 00 00 00
+ 00 call DWORD PTR __imp__MultiByteToWideChar@24
+
+; 112 : hFile = CreateFile2(filenameW, dwDesiredAccess, dwShareMode, dwCreationDisposition, NULL);
+
+ 00049 57 push edi
+ 0004a ff 75 f8 push DWORD PTR _dwCreationDisposition$[ebp]
+ 0004d 8d 85 e4 f9 ff
+ ff lea eax, DWORD PTR _filenameW$1[ebp]
+ 00053 ff 75 f4 push DWORD PTR _dwShareMode$[ebp]
+ 00056 ff 75 fc push DWORD PTR _dwDesiredAccess$[ebp]
+ 00059 50 push eax
+ 0005a ff 15 00 00 00
+ 00 call DWORD PTR __imp__CreateFile2@20
+ 00060 8b f8 mov edi, eax
+$LN2@win32_open:
+
+; 113 : }
+; 114 : #endif
+; 115 : #else
+; 116 : if ((filename!=NULL) && (dwDesiredAccess != 0))
+; 117 : hFile = CreateFile((LPCTSTR)filename, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL);
+; 118 : #endif
+; 119 :
+; 120 : return win32_build_iowin(hFile);
+
+ 00062 8b cf mov ecx, edi
+ 00064 e8 00 00 00 00 call _win32_build_iowin
+ 00069 5f pop edi
+
+; 121 : }
+
+ 0006a 8b e5 mov esp, ebp
+ 0006c 5d pop ebp
+ 0006d c3 ret 0
+_win32_open64_file_func ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\iowin32.c
+; COMDAT _win32_open64_file_funcA
+_TEXT SEGMENT
+_filenameW$1 = -1564 ; size = 1546
+_dwFlagsAndAttributes$ = -16 ; size = 4
+_dwShareMode$ = -12 ; size = 4
+_dwCreationDisposition$ = -8 ; size = 4
+_dwDesiredAccess$ = -4 ; size = 4
+_opaque$ = 8 ; size = 4
+_filename$ = 12 ; size = 4
+_mode$ = 16 ; size = 4
+_win32_open64_file_funcA PROC ; COMDAT
+
+; 125 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 126 : const char* mode_fopen = NULL;
+; 127 : DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ;
+; 128 : HANDLE hFile = NULL;
+; 129 :
+; 130 : win32_translate_open_mode(mode,&dwDesiredAccess,&dwCreationDisposition,&dwShareMode,&dwFlagsAndAttributes);
+
+ 00003 8b 4d 10 mov ecx, DWORD PTR _mode$[ebp]
+ 00006 8d 45 f0 lea eax, DWORD PTR _dwFlagsAndAttributes$[ebp]
+ 00009 81 ec 1c 06 00
+ 00 sub esp, 1564 ; 0000061cH
+ 0000f 8d 55 fc lea edx, DWORD PTR _dwDesiredAccess$[ebp]
+ 00012 57 push edi
+ 00013 50 push eax
+ 00014 8d 45 f4 lea eax, DWORD PTR _dwShareMode$[ebp]
+ 00017 33 ff xor edi, edi
+ 00019 50 push eax
+ 0001a 8d 45 f8 lea eax, DWORD PTR _dwCreationDisposition$[ebp]
+ 0001d 50 push eax
+ 0001e e8 00 00 00 00 call _win32_translate_open_mode
+
+; 131 :
+; 132 : #ifdef IOWIN32_USING_WINRT_API
+; 133 : if ((filename!=NULL) && (dwDesiredAccess != 0))
+
+ 00023 8b 45 0c mov eax, DWORD PTR _filename$[ebp]
+ 00026 83 c4 0c add esp, 12 ; 0000000cH
+ 00029 85 c0 test eax, eax
+ 0002b 74 35 je SHORT $LN2@win32_open
+ 0002d 39 7d fc cmp DWORD PTR _dwDesiredAccess$[ebp], edi
+ 00030 74 30 je SHORT $LN2@win32_open
+
+; 134 : {
+; 135 : WCHAR filenameW[FILENAME_MAX + 0x200 + 1];
+; 136 : MultiByteToWideChar(CP_ACP,0,(const char*)filename,-1,filenameW,FILENAME_MAX + 0x200);
+
+ 00032 68 04 03 00 00 push 772 ; 00000304H
+ 00037 8d 8d e4 f9 ff
+ ff lea ecx, DWORD PTR _filenameW$1[ebp]
+ 0003d 51 push ecx
+ 0003e 6a ff push -1
+ 00040 50 push eax
+ 00041 57 push edi
+ 00042 57 push edi
+ 00043 ff 15 00 00 00
+ 00 call DWORD PTR __imp__MultiByteToWideChar@24
+
+; 137 : hFile = CreateFile2(filenameW, dwDesiredAccess, dwShareMode, dwCreationDisposition, NULL);
+
+ 00049 57 push edi
+ 0004a ff 75 f8 push DWORD PTR _dwCreationDisposition$[ebp]
+ 0004d 8d 85 e4 f9 ff
+ ff lea eax, DWORD PTR _filenameW$1[ebp]
+ 00053 ff 75 f4 push DWORD PTR _dwShareMode$[ebp]
+ 00056 ff 75 fc push DWORD PTR _dwDesiredAccess$[ebp]
+ 00059 50 push eax
+ 0005a ff 15 00 00 00
+ 00 call DWORD PTR __imp__CreateFile2@20
+ 00060 8b f8 mov edi, eax
+$LN2@win32_open:
+
+; 138 : }
+; 139 : #else
+; 140 : if ((filename!=NULL) && (dwDesiredAccess != 0))
+; 141 : hFile = CreateFileA((LPCSTR)filename, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL);
+; 142 : #endif
+; 143 :
+; 144 : return win32_build_iowin(hFile);
+
+ 00062 8b cf mov ecx, edi
+ 00064 e8 00 00 00 00 call _win32_build_iowin
+ 00069 5f pop edi
+
+; 145 : }
+
+ 0006a 8b e5 mov esp, ebp
+ 0006c 5d pop ebp
+ 0006d c3 ret 0
+_win32_open64_file_funcA ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\iowin32.c
+; COMDAT _win32_open64_file_funcW
+_TEXT SEGMENT
+_dwFlagsAndAttributes$ = -16 ; size = 4
+_dwShareMode$ = -12 ; size = 4
+_dwCreationDisposition$ = -8 ; size = 4
+_dwDesiredAccess$ = -4 ; size = 4
+_opaque$ = 8 ; size = 4
+_filename$ = 12 ; size = 4
+_mode$ = 16 ; size = 4
+_win32_open64_file_funcW PROC ; COMDAT
+
+; 149 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 150 : const char* mode_fopen = NULL;
+; 151 : DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ;
+; 152 : HANDLE hFile = NULL;
+; 153 :
+; 154 : win32_translate_open_mode(mode,&dwDesiredAccess,&dwCreationDisposition,&dwShareMode,&dwFlagsAndAttributes);
+
+ 00003 8b 4d 10 mov ecx, DWORD PTR _mode$[ebp]
+ 00006 8d 45 f0 lea eax, DWORD PTR _dwFlagsAndAttributes$[ebp]
+ 00009 83 ec 10 sub esp, 16 ; 00000010H
+ 0000c 8d 55 fc lea edx, DWORD PTR _dwDesiredAccess$[ebp]
+ 0000f 56 push esi
+ 00010 50 push eax
+ 00011 8d 45 f4 lea eax, DWORD PTR _dwShareMode$[ebp]
+ 00014 33 f6 xor esi, esi
+ 00016 50 push eax
+ 00017 8d 45 f8 lea eax, DWORD PTR _dwCreationDisposition$[ebp]
+ 0001a 50 push eax
+ 0001b e8 00 00 00 00 call _win32_translate_open_mode
+
+; 155 :
+; 156 : #ifdef IOWIN32_USING_WINRT_API
+; 157 : if ((filename!=NULL) && (dwDesiredAccess != 0))
+
+ 00020 8b 4d 0c mov ecx, DWORD PTR _filename$[ebp]
+ 00023 83 c4 0c add esp, 12 ; 0000000cH
+ 00026 85 c9 test ecx, ecx
+ 00028 74 18 je SHORT $LN2@win32_open
+ 0002a 8b 45 fc mov eax, DWORD PTR _dwDesiredAccess$[ebp]
+ 0002d 85 c0 test eax, eax
+ 0002f 74 11 je SHORT $LN2@win32_open
+
+; 158 : hFile = CreateFile2((LPCWSTR)filename, dwDesiredAccess, dwShareMode, dwCreationDisposition,NULL);
+
+ 00031 56 push esi
+ 00032 ff 75 f8 push DWORD PTR _dwCreationDisposition$[ebp]
+ 00035 ff 75 f4 push DWORD PTR _dwShareMode$[ebp]
+ 00038 50 push eax
+ 00039 51 push ecx
+ 0003a ff 15 00 00 00
+ 00 call DWORD PTR __imp__CreateFile2@20
+ 00040 8b f0 mov esi, eax
+$LN2@win32_open:
+
+; 159 : #else
+; 160 : if ((filename!=NULL) && (dwDesiredAccess != 0))
+; 161 : hFile = CreateFileW((LPCWSTR)filename, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL);
+; 162 : #endif
+; 163 :
+; 164 : return win32_build_iowin(hFile);
+
+ 00042 8b ce mov ecx, esi
+ 00044 e8 00 00 00 00 call _win32_build_iowin
+ 00049 5e pop esi
+
+; 165 : }
+
+ 0004a 8b e5 mov esp, ebp
+ 0004c 5d pop ebp
+ 0004d c3 ret 0
+_win32_open64_file_funcW ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\iowin32.c
+; COMDAT _win32_open_file_func
+_TEXT SEGMENT
+_filenameW$1 = -1564 ; size = 1546
+_dwFlagsAndAttributes$ = -16 ; size = 4
+_dwShareMode$ = -12 ; size = 4
+_dwCreationDisposition$ = -8 ; size = 4
+_dwDesiredAccess$ = -4 ; size = 4
+_opaque$ = 8 ; size = 4
+_filename$ = 12 ; size = 4
+_mode$ = 16 ; size = 4
+_win32_open_file_func PROC ; COMDAT
+
+; 169 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 170 : const char* mode_fopen = NULL;
+; 171 : DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ;
+; 172 : HANDLE hFile = NULL;
+; 173 :
+; 174 : win32_translate_open_mode(mode,&dwDesiredAccess,&dwCreationDisposition,&dwShareMode,&dwFlagsAndAttributes);
+
+ 00003 8b 4d 10 mov ecx, DWORD PTR _mode$[ebp]
+ 00006 8d 45 f0 lea eax, DWORD PTR _dwFlagsAndAttributes$[ebp]
+ 00009 81 ec 1c 06 00
+ 00 sub esp, 1564 ; 0000061cH
+ 0000f 8d 55 fc lea edx, DWORD PTR _dwDesiredAccess$[ebp]
+ 00012 57 push edi
+ 00013 50 push eax
+ 00014 8d 45 f4 lea eax, DWORD PTR _dwShareMode$[ebp]
+ 00017 33 ff xor edi, edi
+ 00019 50 push eax
+ 0001a 8d 45 f8 lea eax, DWORD PTR _dwCreationDisposition$[ebp]
+ 0001d 50 push eax
+ 0001e e8 00 00 00 00 call _win32_translate_open_mode
+
+; 175 :
+; 176 : #ifdef IOWIN32_USING_WINRT_API
+; 177 : #ifdef UNICODE
+; 178 : if ((filename!=NULL) && (dwDesiredAccess != 0))
+; 179 : hFile = CreateFile2((LPCTSTR)filename, dwDesiredAccess, dwShareMode, dwCreationDisposition, NULL);
+; 180 : #else
+; 181 : if ((filename!=NULL) && (dwDesiredAccess != 0))
+
+ 00023 8b 45 0c mov eax, DWORD PTR _filename$[ebp]
+ 00026 83 c4 0c add esp, 12 ; 0000000cH
+ 00029 85 c0 test eax, eax
+ 0002b 74 35 je SHORT $LN2@win32_open
+ 0002d 39 7d fc cmp DWORD PTR _dwDesiredAccess$[ebp], edi
+ 00030 74 30 je SHORT $LN2@win32_open
+
+; 182 : {
+; 183 : WCHAR filenameW[FILENAME_MAX + 0x200 + 1];
+; 184 : MultiByteToWideChar(CP_ACP,0,(const char*)filename,-1,filenameW,FILENAME_MAX + 0x200);
+
+ 00032 68 04 03 00 00 push 772 ; 00000304H
+ 00037 8d 8d e4 f9 ff
+ ff lea ecx, DWORD PTR _filenameW$1[ebp]
+ 0003d 51 push ecx
+ 0003e 6a ff push -1
+ 00040 50 push eax
+ 00041 57 push edi
+ 00042 57 push edi
+ 00043 ff 15 00 00 00
+ 00 call DWORD PTR __imp__MultiByteToWideChar@24
+
+; 185 : hFile = CreateFile2(filenameW, dwDesiredAccess, dwShareMode, dwCreationDisposition, NULL);
+
+ 00049 57 push edi
+ 0004a ff 75 f8 push DWORD PTR _dwCreationDisposition$[ebp]
+ 0004d 8d 85 e4 f9 ff
+ ff lea eax, DWORD PTR _filenameW$1[ebp]
+ 00053 ff 75 f4 push DWORD PTR _dwShareMode$[ebp]
+ 00056 ff 75 fc push DWORD PTR _dwDesiredAccess$[ebp]
+ 00059 50 push eax
+ 0005a ff 15 00 00 00
+ 00 call DWORD PTR __imp__CreateFile2@20
+ 00060 8b f8 mov edi, eax
+$LN2@win32_open:
+
+; 186 : }
+; 187 : #endif
+; 188 : #else
+; 189 : if ((filename!=NULL) && (dwDesiredAccess != 0))
+; 190 : hFile = CreateFile((LPCTSTR)filename, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL);
+; 191 : #endif
+; 192 :
+; 193 : return win32_build_iowin(hFile);
+
+ 00062 8b cf mov ecx, edi
+ 00064 e8 00 00 00 00 call _win32_build_iowin
+ 00069 5f pop edi
+
+; 194 : }
+
+ 0006a 8b e5 mov esp, ebp
+ 0006c 5d pop ebp
+ 0006d c3 ret 0
+_win32_open_file_func ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\iowin32.c
+; COMDAT _win32_read_file_func
+_TEXT SEGMENT
+_ret$ = -4 ; size = 4
+_opaque$ = 8 ; size = 4
+_stream$ = 12 ; size = 4
+_buf$ = 16 ; size = 4
+_size$ = 20 ; size = 4
+_win32_read_file_func PROC ; COMDAT
+
+; 198 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 51 push ecx
+ 00004 56 push esi
+
+; 199 : uLong ret=0;
+; 200 : HANDLE hFile = NULL;
+; 201 : if (stream!=NULL)
+
+ 00005 8b 75 0c mov esi, DWORD PTR _stream$[ebp]
+ 00008 c7 45 fc 00 00
+ 00 00 mov DWORD PTR _ret$[ebp], 0
+ 0000f 85 f6 test esi, esi
+ 00011 74 36 je SHORT $LN9@win32_read
+
+; 202 : hFile = ((WIN32FILE_IOWIN*)stream) -> hf;
+
+ 00013 8b 06 mov eax, DWORD PTR [esi]
+
+; 203 :
+; 204 : if (hFile != NULL)
+
+ 00015 85 c0 test eax, eax
+ 00017 74 30 je SHORT $LN9@win32_read
+
+; 205 : {
+; 206 : if (!ReadFile(hFile, buf, size, &ret, NULL))
+
+ 00019 6a 00 push 0
+ 0001b 8d 4d fc lea ecx, DWORD PTR _ret$[ebp]
+ 0001e 51 push ecx
+ 0001f ff 75 14 push DWORD PTR _size$[ebp]
+ 00022 ff 75 10 push DWORD PTR _buf$[ebp]
+ 00025 50 push eax
+ 00026 ff 15 00 00 00
+ 00 call DWORD PTR __imp__ReadFile@20
+ 0002c 85 c0 test eax, eax
+ 0002e 75 11 jne SHORT $LN7@win32_read
+
+; 207 : {
+; 208 : DWORD dwErr = GetLastError();
+
+ 00030 ff 15 00 00 00
+ 00 call DWORD PTR __imp__GetLastError@0
+
+; 209 : if (dwErr == ERROR_HANDLE_EOF)
+
+ 00036 33 c9 xor ecx, ecx
+ 00038 83 f8 26 cmp eax, 38 ; 00000026H
+ 0003b 0f 44 c1 cmove eax, ecx
+
+; 210 : dwErr = 0;
+; 211 : ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr;
+
+ 0003e 89 46 04 mov DWORD PTR [esi+4], eax
+$LN7@win32_read:
+
+; 212 : }
+; 213 : }
+; 214 :
+; 215 : return ret;
+
+ 00041 8b 45 fc mov eax, DWORD PTR _ret$[ebp]
+ 00044 5e pop esi
+
+; 216 : }
+
+ 00045 8b e5 mov esp, ebp
+ 00047 5d pop ebp
+ 00048 c3 ret 0
+$LN9@win32_read:
+
+; 212 : }
+; 213 : }
+; 214 :
+; 215 : return ret;
+
+ 00049 33 c0 xor eax, eax
+ 0004b 5e pop esi
+
+; 216 : }
+
+ 0004c 8b e5 mov esp, ebp
+ 0004e 5d pop ebp
+ 0004f c3 ret 0
+_win32_read_file_func ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\iowin32.c
+; COMDAT _win32_write_file_func
+_TEXT SEGMENT
+_ret$ = -4 ; size = 4
+_opaque$ = 8 ; size = 4
+_stream$ = 12 ; size = 4
+_buf$ = 16 ; size = 4
+_size$ = 20 ; size = 4
+_win32_write_file_func PROC ; COMDAT
+
+; 220 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 51 push ecx
+ 00004 56 push esi
+
+; 221 : uLong ret=0;
+; 222 : HANDLE hFile = NULL;
+; 223 : if (stream!=NULL)
+
+ 00005 8b 75 0c mov esi, DWORD PTR _stream$[ebp]
+ 00008 c7 45 fc 00 00
+ 00 00 mov DWORD PTR _ret$[ebp], 0
+ 0000f 85 f6 test esi, esi
+ 00011 74 36 je SHORT $LN9@win32_writ
+
+; 224 : hFile = ((WIN32FILE_IOWIN*)stream) -> hf;
+
+ 00013 8b 06 mov eax, DWORD PTR [esi]
+
+; 225 :
+; 226 : if (hFile != NULL)
+
+ 00015 85 c0 test eax, eax
+ 00017 74 30 je SHORT $LN9@win32_writ
+
+; 227 : {
+; 228 : if (!WriteFile(hFile, buf, size, &ret, NULL))
+
+ 00019 6a 00 push 0
+ 0001b 8d 4d fc lea ecx, DWORD PTR _ret$[ebp]
+ 0001e 51 push ecx
+ 0001f ff 75 14 push DWORD PTR _size$[ebp]
+ 00022 ff 75 10 push DWORD PTR _buf$[ebp]
+ 00025 50 push eax
+ 00026 ff 15 00 00 00
+ 00 call DWORD PTR __imp__WriteFile@20
+ 0002c 85 c0 test eax, eax
+ 0002e 75 11 jne SHORT $LN7@win32_writ
+
+; 229 : {
+; 230 : DWORD dwErr = GetLastError();
+
+ 00030 ff 15 00 00 00
+ 00 call DWORD PTR __imp__GetLastError@0
+
+; 231 : if (dwErr == ERROR_HANDLE_EOF)
+
+ 00036 33 c9 xor ecx, ecx
+ 00038 83 f8 26 cmp eax, 38 ; 00000026H
+ 0003b 0f 44 c1 cmove eax, ecx
+
+; 232 : dwErr = 0;
+; 233 : ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr;
+
+ 0003e 89 46 04 mov DWORD PTR [esi+4], eax
+$LN7@win32_writ:
+
+; 234 : }
+; 235 : }
+; 236 :
+; 237 : return ret;
+
+ 00041 8b 45 fc mov eax, DWORD PTR _ret$[ebp]
+ 00044 5e pop esi
+
+; 238 : }
+
+ 00045 8b e5 mov esp, ebp
+ 00047 5d pop ebp
+ 00048 c3 ret 0
+$LN9@win32_writ:
+
+; 234 : }
+; 235 : }
+; 236 :
+; 237 : return ret;
+
+ 00049 33 c0 xor eax, eax
+ 0004b 5e pop esi
+
+; 238 : }
+
+ 0004c 8b e5 mov esp, ebp
+ 0004e 5d pop ebp
+ 0004f c3 ret 0
+_win32_write_file_func ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\iowin32.c
+; COMDAT _MySetFilePointerEx
+_TEXT SEGMENT
+_dwMoveMethod$ = 8 ; size = 4
+_pos$ = 12 ; size = 8
+_MySetFilePointerEx PROC ; COMDAT
+; _hFile$ = ecx
+; _newPos$ = edx
+
+; 241 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 242 : #ifdef IOWIN32_USING_WINRT_API
+; 243 : return SetFilePointerEx(hFile, pos, newPos, dwMoveMethod);
+
+ 00003 ff 75 08 push DWORD PTR _dwMoveMethod$[ebp]
+ 00006 52 push edx
+ 00007 ff 75 10 push DWORD PTR _pos$[ebp+4]
+ 0000a ff 75 0c push DWORD PTR _pos$[ebp]
+ 0000d 51 push ecx
+ 0000e ff 15 00 00 00
+ 00 call DWORD PTR __imp__SetFilePointerEx@20
+
+; 244 : #else
+; 245 : LONG lHigh = pos.HighPart;
+; 246 : DWORD dwNewPos = SetFilePointer(hFile, pos.LowPart, &lHigh, FILE_CURRENT);
+; 247 : BOOL fOk = TRUE;
+; 248 : if (dwNewPos == 0xFFFFFFFF)
+; 249 : if (GetLastError() != NO_ERROR)
+; 250 : fOk = FALSE;
+; 251 : if ((newPos != NULL) && (fOk))
+; 252 : {
+; 253 : newPos->LowPart = dwNewPos;
+; 254 : newPos->HighPart = lHigh;
+; 255 : }
+; 256 : return fOk;
+; 257 : #endif
+; 258 : }
+
+ 00014 5d pop ebp
+ 00015 c3 ret 0
+_MySetFilePointerEx ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\iowin32.c
+; COMDAT _win32_tell_file_func
+_TEXT SEGMENT
+_pos$1 = -8 ; size = 8
+_opaque$ = 8 ; size = 4
+_stream$ = 12 ; size = 4
+_win32_tell_file_func PROC ; COMDAT
+
+; 261 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 e4 f8 and esp, -8 ; fffffff8H
+ 00006 83 ec 0c sub esp, 12 ; 0000000cH
+ 00009 56 push esi
+
+; 262 : long ret=-1;
+; 263 : HANDLE hFile = NULL;
+; 264 : if (stream!=NULL)
+
+ 0000a 8b 75 0c mov esi, DWORD PTR _stream$[ebp]
+ 0000d 85 f6 test esi, esi
+ 0000f 74 32 je SHORT $LN8@win32_tell
+
+; 265 : hFile = ((WIN32FILE_IOWIN*)stream) -> hf;
+
+ 00011 8b 0e mov ecx, DWORD PTR [esi]
+
+; 266 : if (hFile != NULL)
+
+ 00013 85 c9 test ecx, ecx
+ 00015 74 2c je SHORT $LN8@win32_tell
+
+; 267 : {
+; 268 : LARGE_INTEGER pos;
+; 269 : pos.QuadPart = 0;
+; 270 :
+; 271 : if (!MySetFilePointerEx(hFile, pos, &pos, FILE_CURRENT))
+
+ 00017 0f 57 c0 xorps xmm0, xmm0
+ 0001a 8d 54 24 08 lea edx, DWORD PTR _pos$1[esp+16]
+ 0001e 66 0f 13 44 24
+ 08 movlpd QWORD PTR _pos$1[esp+16], xmm0
+ 00024 ff 74 24 0c push DWORD PTR _pos$1[esp+20]
+ 00028 ff 74 24 0c push DWORD PTR _pos$1[esp+20]
+ 0002c 6a 01 push 1
+ 0002e e8 00 00 00 00 call _MySetFilePointerEx
+ 00033 83 c4 0c add esp, 12 ; 0000000cH
+ 00036 85 c0 test eax, eax
+ 00038 75 11 jne SHORT $LN4@win32_tell
+
+; 272 : {
+; 273 : DWORD dwErr = GetLastError();
+
+ 0003a ff 15 00 00 00
+ 00 call DWORD PTR __imp__GetLastError@0
+
+; 274 : ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr;
+
+ 00040 89 46 04 mov DWORD PTR [esi+4], eax
+$LN8@win32_tell:
+
+; 275 : ret = -1;
+; 276 : }
+; 277 : else
+; 278 : ret=(long)pos.LowPart;
+; 279 : }
+; 280 : return ret;
+
+ 00043 83 c8 ff or eax, -1
+
+; 281 : }
+
+ 00046 5e pop esi
+ 00047 8b e5 mov esp, ebp
+ 00049 5d pop ebp
+ 0004a c3 ret 0
+$LN4@win32_tell:
+
+; 275 : ret = -1;
+; 276 : }
+; 277 : else
+; 278 : ret=(long)pos.LowPart;
+; 279 : }
+; 280 : return ret;
+
+ 0004b 8b 44 24 08 mov eax, DWORD PTR _pos$1[esp+16]
+
+; 281 : }
+
+ 0004f 5e pop esi
+ 00050 8b e5 mov esp, ebp
+ 00052 5d pop ebp
+ 00053 c3 ret 0
+_win32_tell_file_func ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\iowin32.c
+; COMDAT _win32_tell64_file_func
+_TEXT SEGMENT
+_pos$1 = -8 ; size = 8
+_opaque$ = 8 ; size = 4
+_stream$ = 12 ; size = 4
+_win32_tell64_file_func PROC ; COMDAT
+
+; 284 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 e4 f8 and esp, -8 ; fffffff8H
+ 00006 83 ec 0c sub esp, 12 ; 0000000cH
+ 00009 56 push esi
+
+; 285 : ZPOS64_T ret= (ZPOS64_T)-1;
+; 286 : HANDLE hFile = NULL;
+; 287 : if (stream!=NULL)
+
+ 0000a 8b 75 0c mov esi, DWORD PTR _stream$[ebp]
+ 0000d 85 f6 test esi, esi
+ 0000f 74 32 je SHORT $LN8@win32_tell
+
+; 288 : hFile = ((WIN32FILE_IOWIN*)stream)->hf;
+
+ 00011 8b 0e mov ecx, DWORD PTR [esi]
+
+; 289 :
+; 290 : if (hFile)
+
+ 00013 85 c9 test ecx, ecx
+ 00015 74 2c je SHORT $LN8@win32_tell
+
+; 291 : {
+; 292 : LARGE_INTEGER pos;
+; 293 : pos.QuadPart = 0;
+; 294 :
+; 295 : if (!MySetFilePointerEx(hFile, pos, &pos, FILE_CURRENT))
+
+ 00017 0f 57 c0 xorps xmm0, xmm0
+ 0001a 8d 54 24 08 lea edx, DWORD PTR _pos$1[esp+16]
+ 0001e 66 0f 13 44 24
+ 08 movlpd QWORD PTR _pos$1[esp+16], xmm0
+ 00024 ff 74 24 0c push DWORD PTR _pos$1[esp+20]
+ 00028 ff 74 24 0c push DWORD PTR _pos$1[esp+20]
+ 0002c 6a 01 push 1
+ 0002e e8 00 00 00 00 call _MySetFilePointerEx
+ 00033 83 c4 0c add esp, 12 ; 0000000cH
+ 00036 85 c0 test eax, eax
+ 00038 75 14 jne SHORT $LN4@win32_tell
+
+; 296 : {
+; 297 : DWORD dwErr = GetLastError();
+
+ 0003a ff 15 00 00 00
+ 00 call DWORD PTR __imp__GetLastError@0
+
+; 298 : ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr;
+
+ 00040 89 46 04 mov DWORD PTR [esi+4], eax
+$LN8@win32_tell:
+
+; 299 : ret = (ZPOS64_T)-1;
+; 300 : }
+; 301 : else
+; 302 : ret=pos.QuadPart;
+; 303 : }
+; 304 : return ret;
+
+ 00043 83 c8 ff or eax, -1
+ 00046 83 ca ff or edx, -1
+
+; 305 : }
+
+ 00049 5e pop esi
+ 0004a 8b e5 mov esp, ebp
+ 0004c 5d pop ebp
+ 0004d c3 ret 0
+$LN4@win32_tell:
+
+; 299 : ret = (ZPOS64_T)-1;
+; 300 : }
+; 301 : else
+; 302 : ret=pos.QuadPart;
+; 303 : }
+; 304 : return ret;
+
+ 0004e 8b 44 24 08 mov eax, DWORD PTR _pos$1[esp+16]
+ 00052 8b 54 24 0c mov edx, DWORD PTR _pos$1[esp+20]
+
+; 305 : }
+
+ 00056 5e pop esi
+ 00057 8b e5 mov esp, ebp
+ 00059 5d pop ebp
+ 0005a c3 ret 0
+_win32_tell64_file_func ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\iowin32.c
+; COMDAT _win32_seek_file_func
+_TEXT SEGMENT
+_opaque$ = 8 ; size = 4
+_stream$ = 12 ; size = 4
+_offset$ = 16 ; size = 4
+_origin$ = 20 ; size = 4
+_win32_seek_file_func PROC ; COMDAT
+
+; 309 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 e4 f8 and esp, -8 ; fffffff8H
+ 00006 56 push esi
+
+; 310 : DWORD dwMoveMethod=0xFFFFFFFF;
+; 311 : HANDLE hFile = NULL;
+; 312 :
+; 313 : long ret=-1;
+; 314 : if (stream!=NULL)
+
+ 00007 8b 75 0c mov esi, DWORD PTR _stream$[ebp]
+ 0000a 83 c9 ff or ecx, -1
+ 0000d 57 push edi
+ 0000e 33 ff xor edi, edi
+ 00010 85 f6 test esi, esi
+ 00012 74 02 je SHORT $LN4@win32_seek
+
+; 315 : hFile = ((WIN32FILE_IOWIN*)stream) -> hf;
+
+ 00014 8b 3e mov edi, DWORD PTR [esi]
+$LN4@win32_seek:
+
+; 316 : switch (origin)
+
+ 00016 8b 45 14 mov eax, DWORD PTR _origin$[ebp]
+ 00019 83 e8 00 sub eax, 0
+ 0001c 74 21 je SHORT $LN7@win32_seek
+ 0001e 83 e8 01 sub eax, 1
+ 00021 74 15 je SHORT $LN5@win32_seek
+ 00023 83 e8 01 sub eax, 1
+ 00026 74 09 je SHORT $LN6@win32_seek
+
+; 326 : break;
+; 327 : default: return -1;
+
+ 00028 83 c8 ff or eax, -1
+
+; 344 : }
+
+ 0002b 5f pop edi
+ 0002c 5e pop esi
+ 0002d 8b e5 mov esp, ebp
+ 0002f 5d pop ebp
+ 00030 c3 ret 0
+$LN6@win32_seek:
+
+; 321 : case ZLIB_FILEFUNC_SEEK_END :
+; 322 : dwMoveMethod = FILE_END;
+
+ 00031 b8 02 00 00 00 mov eax, 2
+
+; 323 : break;
+
+ 00036 eb 09 jmp SHORT $LN2@win32_seek
+$LN5@win32_seek:
+
+; 317 : {
+; 318 : case ZLIB_FILEFUNC_SEEK_CUR :
+; 319 : dwMoveMethod = FILE_CURRENT;
+
+ 00038 b8 01 00 00 00 mov eax, 1
+
+; 320 : break;
+
+ 0003d eb 02 jmp SHORT $LN2@win32_seek
+$LN7@win32_seek:
+
+; 324 : case ZLIB_FILEFUNC_SEEK_SET :
+; 325 : dwMoveMethod = FILE_BEGIN;
+
+ 0003f 33 c0 xor eax, eax
+$LN2@win32_seek:
+
+; 328 : }
+; 329 :
+; 330 : if (hFile != NULL)
+
+ 00041 85 ff test edi, edi
+ 00043 74 2c je SHORT $LN11@win32_seek
+
+; 331 : {
+; 332 : LARGE_INTEGER pos;
+; 333 : pos.QuadPart = offset;
+; 334 : if (!MySetFilePointerEx(hFile, pos, NULL, dwMoveMethod))
+
+ 00045 6a 00 push 0
+ 00047 ff 75 10 push DWORD PTR _offset$[ebp]
+ 0004a 33 d2 xor edx, edx
+ 0004c 8b cf mov ecx, edi
+ 0004e 50 push eax
+ 0004f e8 00 00 00 00 call _MySetFilePointerEx
+ 00054 83 c4 0c add esp, 12 ; 0000000cH
+ 00057 85 c0 test eax, eax
+ 00059 75 14 jne SHORT $LN10@win32_seek
+
+; 335 : {
+; 336 : DWORD dwErr = GetLastError();
+
+ 0005b ff 15 00 00 00
+ 00 call DWORD PTR __imp__GetLastError@0
+
+; 337 : ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr;
+; 338 : ret = -1;
+
+ 00061 83 c9 ff or ecx, -1
+ 00064 89 46 04 mov DWORD PTR [esi+4], eax
+
+; 342 : }
+; 343 : return ret;
+
+ 00067 8b c1 mov eax, ecx
+
+; 344 : }
+
+ 00069 5f pop edi
+ 0006a 5e pop esi
+ 0006b 8b e5 mov esp, ebp
+ 0006d 5d pop ebp
+ 0006e c3 ret 0
+$LN10@win32_seek:
+
+; 339 : }
+; 340 : else
+; 341 : ret=0;
+
+ 0006f 33 c9 xor ecx, ecx
+$LN11@win32_seek:
+
+; 344 : }
+
+ 00071 5f pop edi
+ 00072 8b c1 mov eax, ecx
+ 00074 5e pop esi
+ 00075 8b e5 mov esp, ebp
+ 00077 5d pop ebp
+ 00078 c3 ret 0
+_win32_seek_file_func ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\iowin32.c
+; COMDAT _win32_seek64_file_func
+_TEXT SEGMENT
+_opaque$ = 8 ; size = 4
+_stream$ = 12 ; size = 4
+_offset$ = 16 ; size = 8
+_origin$ = 24 ; size = 4
+_win32_seek64_file_func PROC ; COMDAT
+
+; 347 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 e4 f8 and esp, -8 ; fffffff8H
+ 00006 56 push esi
+
+; 348 : DWORD dwMoveMethod=0xFFFFFFFF;
+; 349 : HANDLE hFile = NULL;
+; 350 : long ret=-1;
+; 351 :
+; 352 : if (stream!=NULL)
+
+ 00007 8b 75 0c mov esi, DWORD PTR _stream$[ebp]
+ 0000a 83 c9 ff or ecx, -1
+ 0000d 57 push edi
+ 0000e 33 ff xor edi, edi
+ 00010 85 f6 test esi, esi
+ 00012 74 02 je SHORT $LN4@win32_seek
+
+; 353 : hFile = ((WIN32FILE_IOWIN*)stream)->hf;
+
+ 00014 8b 3e mov edi, DWORD PTR [esi]
+$LN4@win32_seek:
+
+; 354 :
+; 355 : switch (origin)
+
+ 00016 8b 45 18 mov eax, DWORD PTR _origin$[ebp]
+ 00019 83 e8 00 sub eax, 0
+ 0001c 74 13 je SHORT $LN6@win32_seek
+ 0001e 83 e8 01 sub eax, 1
+ 00021 74 0e je SHORT $LN6@win32_seek
+ 00023 83 e8 01 sub eax, 1
+ 00026 74 09 je SHORT $LN6@win32_seek
+
+; 356 : {
+; 357 : case ZLIB_FILEFUNC_SEEK_CUR :
+; 358 : dwMoveMethod = FILE_CURRENT;
+; 359 : break;
+; 360 : case ZLIB_FILEFUNC_SEEK_END :
+; 361 : dwMoveMethod = FILE_END;
+; 362 : break;
+; 363 : case ZLIB_FILEFUNC_SEEK_SET :
+; 364 : dwMoveMethod = FILE_BEGIN;
+; 365 : break;
+; 366 : default: return -1;
+
+ 00028 83 c8 ff or eax, -1
+
+; 383 : }
+
+ 0002b 5f pop edi
+ 0002c 5e pop esi
+ 0002d 8b e5 mov esp, ebp
+ 0002f 5d pop ebp
+ 00030 c3 ret 0
+$LN6@win32_seek:
+
+; 367 : }
+; 368 :
+; 369 : if (hFile)
+
+ 00031 85 ff test edi, edi
+ 00033 74 2e je SHORT $LN11@win32_seek
+
+; 370 : {
+; 371 : LARGE_INTEGER pos;
+; 372 : pos.QuadPart = offset;
+; 373 : if (!MySetFilePointerEx(hFile, pos, NULL, FILE_CURRENT))
+
+ 00035 ff 75 14 push DWORD PTR _offset$[ebp+4]
+ 00038 33 d2 xor edx, edx
+ 0003a 8b cf mov ecx, edi
+ 0003c ff 75 10 push DWORD PTR _offset$[ebp]
+ 0003f 6a 01 push 1
+ 00041 e8 00 00 00 00 call _MySetFilePointerEx
+ 00046 83 c4 0c add esp, 12 ; 0000000cH
+ 00049 85 c0 test eax, eax
+ 0004b 75 14 jne SHORT $LN10@win32_seek
+
+; 374 : {
+; 375 : DWORD dwErr = GetLastError();
+
+ 0004d ff 15 00 00 00
+ 00 call DWORD PTR __imp__GetLastError@0
+
+; 376 : ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr;
+; 377 : ret = -1;
+
+ 00053 83 c9 ff or ecx, -1
+ 00056 89 46 04 mov DWORD PTR [esi+4], eax
+
+; 381 : }
+; 382 : return ret;
+
+ 00059 8b c1 mov eax, ecx
+
+; 383 : }
+
+ 0005b 5f pop edi
+ 0005c 5e pop esi
+ 0005d 8b e5 mov esp, ebp
+ 0005f 5d pop ebp
+ 00060 c3 ret 0
+$LN10@win32_seek:
+
+; 378 : }
+; 379 : else
+; 380 : ret=0;
+
+ 00061 33 c9 xor ecx, ecx
+$LN11@win32_seek:
+
+; 383 : }
+
+ 00063 5f pop edi
+ 00064 8b c1 mov eax, ecx
+ 00066 5e pop esi
+ 00067 8b e5 mov esp, ebp
+ 00069 5d pop ebp
+ 0006a c3 ret 0
+_win32_seek64_file_func ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\iowin32.c
+; COMDAT _win32_close_file_func
+_TEXT SEGMENT
+_opaque$ = 8 ; size = 4
+_stream$ = 12 ; size = 4
+_win32_close_file_func PROC ; COMDAT
+
+; 386 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 56 push esi
+ 00004 57 push edi
+
+; 387 : int ret=-1;
+; 388 :
+; 389 : if (stream!=NULL)
+
+ 00005 8b 7d 0c mov edi, DWORD PTR _stream$[ebp]
+ 00008 83 ce ff or esi, -1
+ 0000b 85 ff test edi, edi
+ 0000d 74 19 je SHORT $LN5@win32_clos
+
+; 390 : {
+; 391 : HANDLE hFile;
+; 392 : hFile = ((WIN32FILE_IOWIN*)stream) -> hf;
+
+ 0000f 8b 07 mov eax, DWORD PTR [edi]
+
+; 393 : if (hFile != NULL)
+
+ 00011 85 c0 test eax, eax
+ 00013 74 09 je SHORT $LN3@win32_clos
+
+; 394 : {
+; 395 : CloseHandle(hFile);
+
+ 00015 50 push eax
+ 00016 ff 15 00 00 00
+ 00 call DWORD PTR __imp__CloseHandle@4
+
+; 396 : ret=0;
+
+ 0001c 33 f6 xor esi, esi
+$LN3@win32_clos:
+
+; 397 : }
+; 398 : free(stream);
+
+ 0001e 57 push edi
+ 0001f ff 15 00 00 00
+ 00 call DWORD PTR __imp__free
+ 00025 83 c4 04 add esp, 4
+$LN5@win32_clos:
+
+; 399 : }
+; 400 : return ret;
+
+ 00028 5f pop edi
+ 00029 8b c6 mov eax, esi
+ 0002b 5e pop esi
+
+; 401 : }
+
+ 0002c 5d pop ebp
+ 0002d c3 ret 0
+_win32_close_file_func ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\iowin32.c
+; COMDAT _win32_error_file_func
+_TEXT SEGMENT
+_opaque$ = 8 ; size = 4
+_stream$ = 12 ; size = 4
+_win32_error_file_func PROC ; COMDAT
+
+; 404 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 405 : int ret=-1;
+; 406 : if (stream!=NULL)
+
+ 00003 8b 45 0c mov eax, DWORD PTR _stream$[ebp]
+ 00006 85 c0 test eax, eax
+ 00008 74 05 je SHORT $LN4@win32_erro
+
+; 407 : {
+; 408 : ret = ((WIN32FILE_IOWIN*)stream) -> error;
+; 409 : }
+; 410 : return ret;
+
+ 0000a 8b 40 04 mov eax, DWORD PTR [eax+4]
+
+; 411 : }
+
+ 0000d 5d pop ebp
+ 0000e c3 ret 0
+$LN4@win32_erro:
+
+; 407 : {
+; 408 : ret = ((WIN32FILE_IOWIN*)stream) -> error;
+; 409 : }
+; 410 : return ret;
+
+ 0000f 83 c8 ff or eax, -1
+
+; 411 : }
+
+ 00012 5d pop ebp
+ 00013 c3 ret 0
+_win32_error_file_func ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\iowin32.c
+; COMDAT _fill_win32_filefunc
+_TEXT SEGMENT
+_pzlib_filefunc_def$ = 8 ; size = 4
+_fill_win32_filefunc PROC ; COMDAT
+
+; 414 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 415 : pzlib_filefunc_def->zopen_file = win32_open_file_func;
+
+ 00003 8b 45 08 mov eax, DWORD PTR _pzlib_filefunc_def$[ebp]
+ 00006 c7 00 00 00 00
+ 00 mov DWORD PTR [eax], OFFSET _win32_open_file_func
+
+; 416 : pzlib_filefunc_def->zread_file = win32_read_file_func;
+
+ 0000c c7 40 04 00 00
+ 00 00 mov DWORD PTR [eax+4], OFFSET _win32_read_file_func
+
+; 417 : pzlib_filefunc_def->zwrite_file = win32_write_file_func;
+
+ 00013 c7 40 08 00 00
+ 00 00 mov DWORD PTR [eax+8], OFFSET _win32_write_file_func
+
+; 418 : pzlib_filefunc_def->ztell_file = win32_tell_file_func;
+
+ 0001a c7 40 0c 00 00
+ 00 00 mov DWORD PTR [eax+12], OFFSET _win32_tell_file_func
+
+; 419 : pzlib_filefunc_def->zseek_file = win32_seek_file_func;
+
+ 00021 c7 40 10 00 00
+ 00 00 mov DWORD PTR [eax+16], OFFSET _win32_seek_file_func
+
+; 420 : pzlib_filefunc_def->zclose_file = win32_close_file_func;
+
+ 00028 c7 40 14 00 00
+ 00 00 mov DWORD PTR [eax+20], OFFSET _win32_close_file_func
+
+; 421 : pzlib_filefunc_def->zerror_file = win32_error_file_func;
+
+ 0002f c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET _win32_error_file_func
+
+; 422 : pzlib_filefunc_def->opaque = NULL;
+
+ 00036 c7 40 1c 00 00
+ 00 00 mov DWORD PTR [eax+28], 0
+
+; 423 : }
+
+ 0003d 5d pop ebp
+ 0003e c3 ret 0
+_fill_win32_filefunc ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\iowin32.c
+; COMDAT _fill_win32_filefunc64
+_TEXT SEGMENT
+_pzlib_filefunc_def$ = 8 ; size = 4
+_fill_win32_filefunc64 PROC ; COMDAT
+
+; 426 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 427 : pzlib_filefunc_def->zopen64_file = win32_open64_file_func;
+
+ 00003 8b 45 08 mov eax, DWORD PTR _pzlib_filefunc_def$[ebp]
+ 00006 c7 00 00 00 00
+ 00 mov DWORD PTR [eax], OFFSET _win32_open64_file_func
+
+; 428 : pzlib_filefunc_def->zread_file = win32_read_file_func;
+
+ 0000c c7 40 04 00 00
+ 00 00 mov DWORD PTR [eax+4], OFFSET _win32_read_file_func
+
+; 429 : pzlib_filefunc_def->zwrite_file = win32_write_file_func;
+
+ 00013 c7 40 08 00 00
+ 00 00 mov DWORD PTR [eax+8], OFFSET _win32_write_file_func
+
+; 430 : pzlib_filefunc_def->ztell64_file = win32_tell64_file_func;
+
+ 0001a c7 40 0c 00 00
+ 00 00 mov DWORD PTR [eax+12], OFFSET _win32_tell64_file_func
+
+; 431 : pzlib_filefunc_def->zseek64_file = win32_seek64_file_func;
+
+ 00021 c7 40 10 00 00
+ 00 00 mov DWORD PTR [eax+16], OFFSET _win32_seek64_file_func
+
+; 432 : pzlib_filefunc_def->zclose_file = win32_close_file_func;
+
+ 00028 c7 40 14 00 00
+ 00 00 mov DWORD PTR [eax+20], OFFSET _win32_close_file_func
+
+; 433 : pzlib_filefunc_def->zerror_file = win32_error_file_func;
+
+ 0002f c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET _win32_error_file_func
+
+; 434 : pzlib_filefunc_def->opaque = NULL;
+
+ 00036 c7 40 1c 00 00
+ 00 00 mov DWORD PTR [eax+28], 0
+
+; 435 : }
+
+ 0003d 5d pop ebp
+ 0003e c3 ret 0
+_fill_win32_filefunc64 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\iowin32.c
+; COMDAT _fill_win32_filefunc64A
+_TEXT SEGMENT
+_pzlib_filefunc_def$ = 8 ; size = 4
+_fill_win32_filefunc64A PROC ; COMDAT
+
+; 439 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 440 : pzlib_filefunc_def->zopen64_file = win32_open64_file_funcA;
+
+ 00003 8b 45 08 mov eax, DWORD PTR _pzlib_filefunc_def$[ebp]
+ 00006 c7 00 00 00 00
+ 00 mov DWORD PTR [eax], OFFSET _win32_open64_file_funcA
+
+; 441 : pzlib_filefunc_def->zread_file = win32_read_file_func;
+
+ 0000c c7 40 04 00 00
+ 00 00 mov DWORD PTR [eax+4], OFFSET _win32_read_file_func
+
+; 442 : pzlib_filefunc_def->zwrite_file = win32_write_file_func;
+
+ 00013 c7 40 08 00 00
+ 00 00 mov DWORD PTR [eax+8], OFFSET _win32_write_file_func
+
+; 443 : pzlib_filefunc_def->ztell64_file = win32_tell64_file_func;
+
+ 0001a c7 40 0c 00 00
+ 00 00 mov DWORD PTR [eax+12], OFFSET _win32_tell64_file_func
+
+; 444 : pzlib_filefunc_def->zseek64_file = win32_seek64_file_func;
+
+ 00021 c7 40 10 00 00
+ 00 00 mov DWORD PTR [eax+16], OFFSET _win32_seek64_file_func
+
+; 445 : pzlib_filefunc_def->zclose_file = win32_close_file_func;
+
+ 00028 c7 40 14 00 00
+ 00 00 mov DWORD PTR [eax+20], OFFSET _win32_close_file_func
+
+; 446 : pzlib_filefunc_def->zerror_file = win32_error_file_func;
+
+ 0002f c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET _win32_error_file_func
+
+; 447 : pzlib_filefunc_def->opaque = NULL;
+
+ 00036 c7 40 1c 00 00
+ 00 00 mov DWORD PTR [eax+28], 0
+
+; 448 : }
+
+ 0003d 5d pop ebp
+ 0003e c3 ret 0
+_fill_win32_filefunc64A ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\iowin32.c
+; COMDAT _fill_win32_filefunc64W
+_TEXT SEGMENT
+_pzlib_filefunc_def$ = 8 ; size = 4
+_fill_win32_filefunc64W PROC ; COMDAT
+
+; 452 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 453 : pzlib_filefunc_def->zopen64_file = win32_open64_file_funcW;
+
+ 00003 8b 45 08 mov eax, DWORD PTR _pzlib_filefunc_def$[ebp]
+ 00006 c7 00 00 00 00
+ 00 mov DWORD PTR [eax], OFFSET _win32_open64_file_funcW
+
+; 454 : pzlib_filefunc_def->zread_file = win32_read_file_func;
+
+ 0000c c7 40 04 00 00
+ 00 00 mov DWORD PTR [eax+4], OFFSET _win32_read_file_func
+
+; 455 : pzlib_filefunc_def->zwrite_file = win32_write_file_func;
+
+ 00013 c7 40 08 00 00
+ 00 00 mov DWORD PTR [eax+8], OFFSET _win32_write_file_func
+
+; 456 : pzlib_filefunc_def->ztell64_file = win32_tell64_file_func;
+
+ 0001a c7 40 0c 00 00
+ 00 00 mov DWORD PTR [eax+12], OFFSET _win32_tell64_file_func
+
+; 457 : pzlib_filefunc_def->zseek64_file = win32_seek64_file_func;
+
+ 00021 c7 40 10 00 00
+ 00 00 mov DWORD PTR [eax+16], OFFSET _win32_seek64_file_func
+
+; 458 : pzlib_filefunc_def->zclose_file = win32_close_file_func;
+
+ 00028 c7 40 14 00 00
+ 00 00 mov DWORD PTR [eax+20], OFFSET _win32_close_file_func
+
+; 459 : pzlib_filefunc_def->zerror_file = win32_error_file_func;
+
+ 0002f c7 40 18 00 00
+ 00 00 mov DWORD PTR [eax+24], OFFSET _win32_error_file_func
+
+; 460 : pzlib_filefunc_def->opaque = NULL;
+
+ 00036 c7 40 1c 00 00
+ 00 00 mov DWORD PTR [eax+28], 0
+
+; 461 : }
+
+ 0003d 5d pop ebp
+ 0003e c3 ret 0
+_fill_win32_filefunc64W ENDP
+_TEXT ENDS
+END
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/iowin32.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/iowin32.obj
new file mode 100644
index 0000000000..34f529518b
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/iowin32.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/trees.cod b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/trees.cod
new file mode 100644
index 0000000000..ab1a163973
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/trees.cod
@@ -0,0 +1,5535 @@
+; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.23506.0
+
+ TITLE d:\downloads\tgl-master\tgl-master\zlib\trees.c
+ .686P
+ .XMM
+ include listing.inc
+ .model flat
+
+INCLUDELIB OLDNAMES
+
+PUBLIC __length_code
+PUBLIC __dist_code
+_static_l_desc DD FLAT:_static_ltree
+ DD FLAT:_extra_lbits
+ DD 0101H
+ DD 011eH
+ DD 0fH
+_static_bl_desc DD 00H
+ DD FLAT:_extra_blbits
+ DD 00H
+ DD 013H
+ DD 07H
+_static_d_desc DD FLAT:_static_dtree
+ DD FLAT:_extra_dbits
+ DD 00H
+ DD 01eH
+ DD 0fH
+__length_code DB 00H
+ DB 01H
+ DB 02H
+ DB 03H
+ DB 04H
+ DB 05H
+ DB 06H
+ DB 07H
+ DB 08H
+ DB 08H
+ DB 09H
+ DB 09H
+ DB 0aH
+ DB 0aH
+ DB 0bH
+ DB 0bH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 010H
+ DB 010H
+ DB 010H
+ DB 010H
+ DB 010H
+ DB 010H
+ DB 010H
+ DB 010H
+ DB 011H
+ DB 011H
+ DB 011H
+ DB 011H
+ DB 011H
+ DB 011H
+ DB 011H
+ DB 011H
+ DB 012H
+ DB 012H
+ DB 012H
+ DB 012H
+ DB 012H
+ DB 012H
+ DB 012H
+ DB 012H
+ DB 013H
+ DB 013H
+ DB 013H
+ DB 013H
+ DB 013H
+ DB 013H
+ DB 013H
+ DB 013H
+ DB 014H
+ DB 014H
+ DB 014H
+ DB 014H
+ DB 014H
+ DB 014H
+ DB 014H
+ DB 014H
+ DB 014H
+ DB 014H
+ DB 014H
+ DB 014H
+ DB 014H
+ DB 014H
+ DB 014H
+ DB 014H
+ DB 015H
+ DB 015H
+ DB 015H
+ DB 015H
+ DB 015H
+ DB 015H
+ DB 015H
+ DB 015H
+ DB 015H
+ DB 015H
+ DB 015H
+ DB 015H
+ DB 015H
+ DB 015H
+ DB 015H
+ DB 015H
+ DB 016H
+ DB 016H
+ DB 016H
+ DB 016H
+ DB 016H
+ DB 016H
+ DB 016H
+ DB 016H
+ DB 016H
+ DB 016H
+ DB 016H
+ DB 016H
+ DB 016H
+ DB 016H
+ DB 016H
+ DB 016H
+ DB 017H
+ DB 017H
+ DB 017H
+ DB 017H
+ DB 017H
+ DB 017H
+ DB 017H
+ DB 017H
+ DB 017H
+ DB 017H
+ DB 017H
+ DB 017H
+ DB 017H
+ DB 017H
+ DB 017H
+ DB 017H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01cH
+__dist_code DB 00H
+ DB 01H
+ DB 02H
+ DB 03H
+ DB 04H
+ DB 04H
+ DB 05H
+ DB 05H
+ DB 06H
+ DB 06H
+ DB 06H
+ DB 06H
+ DB 07H
+ DB 07H
+ DB 07H
+ DB 07H
+ DB 08H
+ DB 08H
+ DB 08H
+ DB 08H
+ DB 08H
+ DB 08H
+ DB 08H
+ DB 08H
+ DB 09H
+ DB 09H
+ DB 09H
+ DB 09H
+ DB 09H
+ DB 09H
+ DB 09H
+ DB 09H
+ DB 0aH
+ DB 0aH
+ DB 0aH
+ DB 0aH
+ DB 0aH
+ DB 0aH
+ DB 0aH
+ DB 0aH
+ DB 0aH
+ DB 0aH
+ DB 0aH
+ DB 0aH
+ DB 0aH
+ DB 0aH
+ DB 0aH
+ DB 0aH
+ DB 0bH
+ DB 0bH
+ DB 0bH
+ DB 0bH
+ DB 0bH
+ DB 0bH
+ DB 0bH
+ DB 0bH
+ DB 0bH
+ DB 0bH
+ DB 0bH
+ DB 0bH
+ DB 0bH
+ DB 0bH
+ DB 0bH
+ DB 0bH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0cH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0dH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0eH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 0fH
+ DB 00H
+ DB 00H
+ DB 010H
+ DB 011H
+ DB 012H
+ DB 012H
+ DB 013H
+ DB 013H
+ DB 014H
+ DB 014H
+ DB 014H
+ DB 014H
+ DB 015H
+ DB 015H
+ DB 015H
+ DB 015H
+ DB 016H
+ DB 016H
+ DB 016H
+ DB 016H
+ DB 016H
+ DB 016H
+ DB 016H
+ DB 016H
+ DB 017H
+ DB 017H
+ DB 017H
+ DB 017H
+ DB 017H
+ DB 017H
+ DB 017H
+ DB 017H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 018H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 019H
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01aH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01bH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01cH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+ DB 01dH
+_static_dtree DW 00H
+ DW 05H
+ DW 010H
+ DW 05H
+ DW 08H
+ DW 05H
+ DW 018H
+ DW 05H
+ DW 04H
+ DW 05H
+ DW 014H
+ DW 05H
+ DW 0cH
+ DW 05H
+ DW 01cH
+ DW 05H
+ DW 02H
+ DW 05H
+ DW 012H
+ DW 05H
+ DW 0aH
+ DW 05H
+ DW 01aH
+ DW 05H
+ DW 06H
+ DW 05H
+ DW 016H
+ DW 05H
+ DW 0eH
+ DW 05H
+ DW 01eH
+ DW 05H
+ DW 01H
+ DW 05H
+ DW 011H
+ DW 05H
+ DW 09H
+ DW 05H
+ DW 019H
+ DW 05H
+ DW 05H
+ DW 05H
+ DW 015H
+ DW 05H
+ DW 0dH
+ DW 05H
+ DW 01dH
+ DW 05H
+ DW 03H
+ DW 05H
+ DW 013H
+ DW 05H
+ DW 0bH
+ DW 05H
+ DW 01bH
+ DW 05H
+ DW 07H
+ DW 05H
+ DW 017H
+ DW 05H
+_extra_blbits DD 00H
+ DD 00H
+ DD 00H
+ DD 00H
+ DD 00H
+ DD 00H
+ DD 00H
+ DD 00H
+ DD 00H
+ DD 00H
+ DD 00H
+ DD 00H
+ DD 00H
+ DD 00H
+ DD 00H
+ DD 00H
+ DD 02H
+ DD 03H
+ DD 07H
+ ORG $+4
+_extra_lbits DD 00H
+ DD 00H
+ DD 00H
+ DD 00H
+ DD 00H
+ DD 00H
+ DD 00H
+ DD 00H
+ DD 01H
+ DD 01H
+ DD 01H
+ DD 01H
+ DD 02H
+ DD 02H
+ DD 02H
+ DD 02H
+ DD 03H
+ DD 03H
+ DD 03H
+ DD 03H
+ DD 04H
+ DD 04H
+ DD 04H
+ DD 04H
+ DD 05H
+ DD 05H
+ DD 05H
+ DD 05H
+ DD 00H
+ ORG $+4
+_base_dist DD 00H
+ DD 01H
+ DD 02H
+ DD 03H
+ DD 04H
+ DD 06H
+ DD 08H
+ DD 0cH
+ DD 010H
+ DD 018H
+ DD 020H
+ DD 030H
+ DD 040H
+ DD 060H
+ DD 080H
+ DD 0c0H
+ DD 0100H
+ DD 0180H
+ DD 0200H
+ DD 0300H
+ DD 0400H
+ DD 0600H
+ DD 0800H
+ DD 0c00H
+ DD 01000H
+ DD 01800H
+ DD 02000H
+ DD 03000H
+ DD 04000H
+ DD 06000H
+_base_length DD 00H
+ DD 01H
+ DD 02H
+ DD 03H
+ DD 04H
+ DD 05H
+ DD 06H
+ DD 07H
+ DD 08H
+ DD 0aH
+ DD 0cH
+ DD 0eH
+ DD 010H
+ DD 014H
+ DD 018H
+ DD 01cH
+ DD 020H
+ DD 028H
+ DD 030H
+ DD 038H
+ DD 040H
+ DD 050H
+ DD 060H
+ DD 070H
+ DD 080H
+ DD 0a0H
+ DD 0c0H
+ DD 0e0H
+ DD 00H
+ ORG $+4
+_extra_dbits DD 00H
+ DD 00H
+ DD 00H
+ DD 00H
+ DD 01H
+ DD 01H
+ DD 02H
+ DD 02H
+ DD 03H
+ DD 03H
+ DD 04H
+ DD 04H
+ DD 05H
+ DD 05H
+ DD 06H
+ DD 06H
+ DD 07H
+ DD 07H
+ DD 08H
+ DD 08H
+ DD 09H
+ DD 09H
+ DD 0aH
+ DD 0aH
+ DD 0bH
+ DD 0bH
+ DD 0cH
+ DD 0cH
+ DD 0dH
+ DD 0dH
+_static_ltree DW 0cH
+ DW 08H
+ DW 08cH
+ DW 08H
+ DW 04cH
+ DW 08H
+ DW 0ccH
+ DW 08H
+ DW 02cH
+ DW 08H
+ DW 0acH
+ DW 08H
+ DW 06cH
+ DW 08H
+ DW 0ecH
+ DW 08H
+ DW 01cH
+ DW 08H
+ DW 09cH
+ DW 08H
+ DW 05cH
+ DW 08H
+ DW 0dcH
+ DW 08H
+ DW 03cH
+ DW 08H
+ DW 0bcH
+ DW 08H
+ DW 07cH
+ DW 08H
+ DW 0fcH
+ DW 08H
+ DW 02H
+ DW 08H
+ DW 082H
+ DW 08H
+ DW 042H
+ DW 08H
+ DW 0c2H
+ DW 08H
+ DW 022H
+ DW 08H
+ DW 0a2H
+ DW 08H
+ DW 062H
+ DW 08H
+ DW 0e2H
+ DW 08H
+ DW 012H
+ DW 08H
+ DW 092H
+ DW 08H
+ DW 052H
+ DW 08H
+ DW 0d2H
+ DW 08H
+ DW 032H
+ DW 08H
+ DW 0b2H
+ DW 08H
+ DW 072H
+ DW 08H
+ DW 0f2H
+ DW 08H
+ DW 0aH
+ DW 08H
+ DW 08aH
+ DW 08H
+ DW 04aH
+ DW 08H
+ DW 0caH
+ DW 08H
+ DW 02aH
+ DW 08H
+ DW 0aaH
+ DW 08H
+ DW 06aH
+ DW 08H
+ DW 0eaH
+ DW 08H
+ DW 01aH
+ DW 08H
+ DW 09aH
+ DW 08H
+ DW 05aH
+ DW 08H
+ DW 0daH
+ DW 08H
+ DW 03aH
+ DW 08H
+ DW 0baH
+ DW 08H
+ DW 07aH
+ DW 08H
+ DW 0faH
+ DW 08H
+ DW 06H
+ DW 08H
+ DW 086H
+ DW 08H
+ DW 046H
+ DW 08H
+ DW 0c6H
+ DW 08H
+ DW 026H
+ DW 08H
+ DW 0a6H
+ DW 08H
+ DW 066H
+ DW 08H
+ DW 0e6H
+ DW 08H
+ DW 016H
+ DW 08H
+ DW 096H
+ DW 08H
+ DW 056H
+ DW 08H
+ DW 0d6H
+ DW 08H
+ DW 036H
+ DW 08H
+ DW 0b6H
+ DW 08H
+ DW 076H
+ DW 08H
+ DW 0f6H
+ DW 08H
+ DW 0eH
+ DW 08H
+ DW 08eH
+ DW 08H
+ DW 04eH
+ DW 08H
+ DW 0ceH
+ DW 08H
+ DW 02eH
+ DW 08H
+ DW 0aeH
+ DW 08H
+ DW 06eH
+ DW 08H
+ DW 0eeH
+ DW 08H
+ DW 01eH
+ DW 08H
+ DW 09eH
+ DW 08H
+ DW 05eH
+ DW 08H
+ DW 0deH
+ DW 08H
+ DW 03eH
+ DW 08H
+ DW 0beH
+ DW 08H
+ DW 07eH
+ DW 08H
+ DW 0feH
+ DW 08H
+ DW 01H
+ DW 08H
+ DW 081H
+ DW 08H
+ DW 041H
+ DW 08H
+ DW 0c1H
+ DW 08H
+ DW 021H
+ DW 08H
+ DW 0a1H
+ DW 08H
+ DW 061H
+ DW 08H
+ DW 0e1H
+ DW 08H
+ DW 011H
+ DW 08H
+ DW 091H
+ DW 08H
+ DW 051H
+ DW 08H
+ DW 0d1H
+ DW 08H
+ DW 031H
+ DW 08H
+ DW 0b1H
+ DW 08H
+ DW 071H
+ DW 08H
+ DW 0f1H
+ DW 08H
+ DW 09H
+ DW 08H
+ DW 089H
+ DW 08H
+ DW 049H
+ DW 08H
+ DW 0c9H
+ DW 08H
+ DW 029H
+ DW 08H
+ DW 0a9H
+ DW 08H
+ DW 069H
+ DW 08H
+ DW 0e9H
+ DW 08H
+ DW 019H
+ DW 08H
+ DW 099H
+ DW 08H
+ DW 059H
+ DW 08H
+ DW 0d9H
+ DW 08H
+ DW 039H
+ DW 08H
+ DW 0b9H
+ DW 08H
+ DW 079H
+ DW 08H
+ DW 0f9H
+ DW 08H
+ DW 05H
+ DW 08H
+ DW 085H
+ DW 08H
+ DW 045H
+ DW 08H
+ DW 0c5H
+ DW 08H
+ DW 025H
+ DW 08H
+ DW 0a5H
+ DW 08H
+ DW 065H
+ DW 08H
+ DW 0e5H
+ DW 08H
+ DW 015H
+ DW 08H
+ DW 095H
+ DW 08H
+ DW 055H
+ DW 08H
+ DW 0d5H
+ DW 08H
+ DW 035H
+ DW 08H
+ DW 0b5H
+ DW 08H
+ DW 075H
+ DW 08H
+ DW 0f5H
+ DW 08H
+ DW 0dH
+ DW 08H
+ DW 08dH
+ DW 08H
+ DW 04dH
+ DW 08H
+ DW 0cdH
+ DW 08H
+ DW 02dH
+ DW 08H
+ DW 0adH
+ DW 08H
+ DW 06dH
+ DW 08H
+ DW 0edH
+ DW 08H
+ DW 01dH
+ DW 08H
+ DW 09dH
+ DW 08H
+ DW 05dH
+ DW 08H
+ DW 0ddH
+ DW 08H
+ DW 03dH
+ DW 08H
+ DW 0bdH
+ DW 08H
+ DW 07dH
+ DW 08H
+ DW 0fdH
+ DW 08H
+ DW 013H
+ DW 09H
+ DW 0113H
+ DW 09H
+ DW 093H
+ DW 09H
+ DW 0193H
+ DW 09H
+ DW 053H
+ DW 09H
+ DW 0153H
+ DW 09H
+ DW 0d3H
+ DW 09H
+ DW 01d3H
+ DW 09H
+ DW 033H
+ DW 09H
+ DW 0133H
+ DW 09H
+ DW 0b3H
+ DW 09H
+ DW 01b3H
+ DW 09H
+ DW 073H
+ DW 09H
+ DW 0173H
+ DW 09H
+ DW 0f3H
+ DW 09H
+ DW 01f3H
+ DW 09H
+ DW 0bH
+ DW 09H
+ DW 010bH
+ DW 09H
+ DW 08bH
+ DW 09H
+ DW 018bH
+ DW 09H
+ DW 04bH
+ DW 09H
+ DW 014bH
+ DW 09H
+ DW 0cbH
+ DW 09H
+ DW 01cbH
+ DW 09H
+ DW 02bH
+ DW 09H
+ DW 012bH
+ DW 09H
+ DW 0abH
+ DW 09H
+ DW 01abH
+ DW 09H
+ DW 06bH
+ DW 09H
+ DW 016bH
+ DW 09H
+ DW 0ebH
+ DW 09H
+ DW 01ebH
+ DW 09H
+ DW 01bH
+ DW 09H
+ DW 011bH
+ DW 09H
+ DW 09bH
+ DW 09H
+ DW 019bH
+ DW 09H
+ DW 05bH
+ DW 09H
+ DW 015bH
+ DW 09H
+ DW 0dbH
+ DW 09H
+ DW 01dbH
+ DW 09H
+ DW 03bH
+ DW 09H
+ DW 013bH
+ DW 09H
+ DW 0bbH
+ DW 09H
+ DW 01bbH
+ DW 09H
+ DW 07bH
+ DW 09H
+ DW 017bH
+ DW 09H
+ DW 0fbH
+ DW 09H
+ DW 01fbH
+ DW 09H
+ DW 07H
+ DW 09H
+ DW 0107H
+ DW 09H
+ DW 087H
+ DW 09H
+ DW 0187H
+ DW 09H
+ DW 047H
+ DW 09H
+ DW 0147H
+ DW 09H
+ DW 0c7H
+ DW 09H
+ DW 01c7H
+ DW 09H
+ DW 027H
+ DW 09H
+ DW 0127H
+ DW 09H
+ DW 0a7H
+ DW 09H
+ DW 01a7H
+ DW 09H
+ DW 067H
+ DW 09H
+ DW 0167H
+ DW 09H
+ DW 0e7H
+ DW 09H
+ DW 01e7H
+ DW 09H
+ DW 017H
+ DW 09H
+ DW 0117H
+ DW 09H
+ DW 097H
+ DW 09H
+ DW 0197H
+ DW 09H
+ DW 057H
+ DW 09H
+ DW 0157H
+ DW 09H
+ DW 0d7H
+ DW 09H
+ DW 01d7H
+ DW 09H
+ DW 037H
+ DW 09H
+ DW 0137H
+ DW 09H
+ DW 0b7H
+ DW 09H
+ DW 01b7H
+ DW 09H
+ DW 077H
+ DW 09H
+ DW 0177H
+ DW 09H
+ DW 0f7H
+ DW 09H
+ DW 01f7H
+ DW 09H
+ DW 0fH
+ DW 09H
+ DW 010fH
+ DW 09H
+ DW 08fH
+ DW 09H
+ DW 018fH
+ DW 09H
+ DW 04fH
+ DW 09H
+ DW 014fH
+ DW 09H
+ DW 0cfH
+ DW 09H
+ DW 01cfH
+ DW 09H
+ DW 02fH
+ DW 09H
+ DW 012fH
+ DW 09H
+ DW 0afH
+ DW 09H
+ DW 01afH
+ DW 09H
+ DW 06fH
+ DW 09H
+ DW 016fH
+ DW 09H
+ DW 0efH
+ DW 09H
+ DW 01efH
+ DW 09H
+ DW 01fH
+ DW 09H
+ DW 011fH
+ DW 09H
+ DW 09fH
+ DW 09H
+ DW 019fH
+ DW 09H
+ DW 05fH
+ DW 09H
+ DW 015fH
+ DW 09H
+ DW 0dfH
+ DW 09H
+ DW 01dfH
+ DW 09H
+ DW 03fH
+ DW 09H
+ DW 013fH
+ DW 09H
+ DW 0bfH
+ DW 09H
+ DW 01bfH
+ DW 09H
+ DW 07fH
+ DW 09H
+ DW 017fH
+ DW 09H
+ DW 0ffH
+ DW 09H
+ DW 01ffH
+ DW 09H
+ DW 00H
+ DW 07H
+ DW 040H
+ DW 07H
+ DW 020H
+ DW 07H
+ DW 060H
+ DW 07H
+ DW 010H
+ DW 07H
+ DW 050H
+ DW 07H
+ DW 030H
+ DW 07H
+ DW 070H
+ DW 07H
+ DW 08H
+ DW 07H
+ DW 048H
+ DW 07H
+ DW 028H
+ DW 07H
+ DW 068H
+ DW 07H
+ DW 018H
+ DW 07H
+ DW 058H
+ DW 07H
+ DW 038H
+ DW 07H
+ DW 078H
+ DW 07H
+ DW 04H
+ DW 07H
+ DW 044H
+ DW 07H
+ DW 024H
+ DW 07H
+ DW 064H
+ DW 07H
+ DW 014H
+ DW 07H
+ DW 054H
+ DW 07H
+ DW 034H
+ DW 07H
+ DW 074H
+ DW 07H
+ DW 03H
+ DW 08H
+ DW 083H
+ DW 08H
+ DW 043H
+ DW 08H
+ DW 0c3H
+ DW 08H
+ DW 023H
+ DW 08H
+ DW 0a3H
+ DW 08H
+ DW 063H
+ DW 08H
+ DW 0e3H
+ DW 08H
+_bl_order DB 010H
+ DB 011H
+ DB 012H
+ DB 00H
+ DB 08H
+ DB 07H
+ DB 09H
+ DB 06H
+ DB 0aH
+ DB 05H
+ DB 0bH
+ DB 04H
+ DB 0cH
+ DB 03H
+ DB 0dH
+ DB 02H
+ DB 0eH
+ DB 01H
+ DB 0fH
+PUBLIC __tr_align
+PUBLIC __tr_init
+PUBLIC __tr_flush_block
+PUBLIC __tr_flush_bits
+PUBLIC __tr_stored_block
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\trees.c
+; COMDAT __tr_stored_block
+_TEXT SEGMENT
+_stored_len$ = 8 ; size = 4
+_last$ = 12 ; size = 4
+__tr_stored_block PROC ; COMDAT
+; _s$ = ecx
+; _buf$ = edx
+
+; 870 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 53 push ebx
+ 00004 57 push edi
+ 00005 8b f9 mov edi, ecx
+ 00007 8b da mov ebx, edx
+
+; 871 : send_bits(s, (STORED_BLOCK<<1)+last, 3); /* send block type */
+
+ 00009 8b 8f bc 16 00
+ 00 mov ecx, DWORD PTR [edi+5820]
+ 0000f 83 f9 0d cmp ecx, 13 ; 0000000dH
+ 00012 7e 65 jle SHORT $LN2@tr_stored_
+ 00014 8b 57 08 mov edx, DWORD PTR [edi+8]
+ 00017 56 push esi
+ 00018 8b 75 0c mov esi, DWORD PTR _last$[ebp]
+ 0001b 66 8b c6 mov ax, si
+ 0001e 66 d3 e0 shl ax, cl
+ 00021 8b 4f 14 mov ecx, DWORD PTR [edi+20]
+ 00024 66 09 87 b8 16
+ 00 00 or WORD PTR [edi+5816], ax
+ 0002b 0f b6 87 b8 16
+ 00 00 movzx eax, BYTE PTR [edi+5816]
+ 00032 88 04 0a mov BYTE PTR [edx+ecx], al
+ 00035 ff 47 14 inc DWORD PTR [edi+20]
+ 00038 8b 4f 08 mov ecx, DWORD PTR [edi+8]
+ 0003b 8b 57 14 mov edx, DWORD PTR [edi+20]
+ 0003e 0f b6 87 b9 16
+ 00 00 movzx eax, BYTE PTR [edi+5817]
+ 00045 88 04 0a mov BYTE PTR [edx+ecx], al
+ 00048 b1 10 mov cl, 16 ; 00000010H
+ 0004a 2a 8f bc 16 00
+ 00 sub cl, BYTE PTR [edi+5820]
+
+; 872 : #ifdef DEBUG
+; 873 : s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
+; 874 : s->compressed_len += (stored_len + 4) << 3;
+; 875 : #endif
+; 876 : copy_block(s, buf, (unsigned)stored_len, 1); /* with header */
+
+ 00050 8b d3 mov edx, ebx
+ 00052 ff 47 14 inc DWORD PTR [edi+20]
+ 00055 83 87 bc 16 00
+ 00 f3 add DWORD PTR [edi+5820], -13 ; fffffff3H
+ 0005c 66 d3 ee shr si, cl
+ 0005f 66 89 b7 b8 16
+ 00 00 mov WORD PTR [edi+5816], si
+ 00066 5e pop esi
+ 00067 51 push ecx
+ 00068 ff 75 08 push DWORD PTR _stored_len$[ebp]
+ 0006b 8b cf mov ecx, edi
+ 0006d e8 00 00 00 00 call _copy_block
+ 00072 83 c4 08 add esp, 8
+ 00075 5f pop edi
+ 00076 5b pop ebx
+
+; 877 : }
+
+ 00077 5d pop ebp
+ 00078 c3 ret 0
+$LN2@tr_stored_:
+
+; 871 : send_bits(s, (STORED_BLOCK<<1)+last, 3); /* send block type */
+
+ 00079 66 8b 45 0c mov ax, WORD PTR _last$[ebp]
+
+; 872 : #ifdef DEBUG
+; 873 : s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
+; 874 : s->compressed_len += (stored_len + 4) << 3;
+; 875 : #endif
+; 876 : copy_block(s, buf, (unsigned)stored_len, 1); /* with header */
+
+ 0007d 8b d3 mov edx, ebx
+ 0007f 66 d3 e0 shl ax, cl
+ 00082 66 09 87 b8 16
+ 00 00 or WORD PTR [edi+5816], ax
+ 00089 8d 41 03 lea eax, DWORD PTR [ecx+3]
+ 0008c 51 push ecx
+ 0008d ff 75 08 push DWORD PTR _stored_len$[ebp]
+ 00090 8b cf mov ecx, edi
+ 00092 89 87 bc 16 00
+ 00 mov DWORD PTR [edi+5820], eax
+ 00098 e8 00 00 00 00 call _copy_block
+ 0009d 83 c4 08 add esp, 8
+ 000a0 5f pop edi
+ 000a1 5b pop ebx
+
+; 877 : }
+
+ 000a2 5d pop ebp
+ 000a3 c3 ret 0
+__tr_stored_block ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\trees.c
+; COMDAT __tr_flush_bits
+_TEXT SEGMENT
+__tr_flush_bits PROC ; COMDAT
+; _s$ = ecx
+
+; 885 : bi_flush(s);
+
+ 00000 e9 00 00 00 00 jmp _bi_flush
+__tr_flush_bits ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\trees.c
+; COMDAT __tr_flush_block
+_TEXT SEGMENT
+_max_blindex$1$ = -8 ; size = 4
+_buf$1$ = -4 ; size = 4
+_stored_len$ = 8 ; size = 4
+_last$ = 12 ; size = 4
+__tr_flush_block PROC ; COMDAT
+; _s$ = ecx
+; _buf$ = edx
+
+; 912 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 08 sub esp, 8
+ 00006 53 push ebx
+ 00007 56 push esi
+
+; 913 : ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
+; 914 : int max_blindex = 0; /* index of last bit length code of non zero freq */
+; 915 :
+; 916 : /* Build the Huffman trees unless a stored block is forced */
+; 917 : if (s->level > 0) {
+
+ 00008 8b 75 08 mov esi, DWORD PTR _stored_len$[ebp]
+ 0000b 8b da mov ebx, edx
+ 0000d 57 push edi
+ 0000e 8b f9 mov edi, ecx
+ 00010 89 5d fc mov DWORD PTR _buf$1$[ebp], ebx
+ 00013 c7 45 f8 00 00
+ 00 00 mov DWORD PTR _max_blindex$1$[ebp], 0
+ 0001a 83 bf 84 00 00
+ 00 00 cmp DWORD PTR [edi+132], 0
+ 00021 7e 55 jle SHORT $LN2@tr_flush_b
+
+; 918 :
+; 919 : /* Check if the file is binary or text */
+; 920 : if (s->strm->data_type == Z_UNKNOWN)
+
+ 00023 8b 1f mov ebx, DWORD PTR [edi]
+ 00025 83 7b 2c 02 cmp DWORD PTR [ebx+44], 2
+ 00029 75 08 jne SHORT $LN4@tr_flush_b
+
+; 921 : s->strm->data_type = detect_data_type(s);
+
+ 0002b e8 00 00 00 00 call _detect_data_type
+ 00030 89 43 2c mov DWORD PTR [ebx+44], eax
+$LN4@tr_flush_b:
+
+; 922 :
+; 923 : /* Construct the literal and distance trees */
+; 924 : build_tree(s, (tree_desc *)(&(s->l_desc)));
+
+ 00033 8d 97 18 0b 00
+ 00 lea edx, DWORD PTR [edi+2840]
+ 00039 8b cf mov ecx, edi
+ 0003b e8 00 00 00 00 call _build_tree
+
+; 925 : Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
+; 926 : s->static_len));
+; 927 :
+; 928 : build_tree(s, (tree_desc *)(&(s->d_desc)));
+
+ 00040 8d 97 24 0b 00
+ 00 lea edx, DWORD PTR [edi+2852]
+ 00046 8b cf mov ecx, edi
+ 00048 e8 00 00 00 00 call _build_tree
+
+; 929 : Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
+; 930 : s->static_len));
+; 931 : /* At this point, opt_len and static_len are the total bit lengths of
+; 932 : * the compressed block data, excluding the tree representations.
+; 933 : */
+; 934 :
+; 935 : /* Build the bit length tree for the above two trees, and get the index
+; 936 : * in bl_order of the last bit length code to send.
+; 937 : */
+; 938 : max_blindex = build_bl_tree(s);
+
+ 0004d 8b cf mov ecx, edi
+ 0004f e8 00 00 00 00 call _build_bl_tree
+
+; 939 :
+; 940 : /* Determine the best encoding. Compute the block lengths in bytes. */
+; 941 : opt_lenb = (s->opt_len+3+7)>>3;
+
+ 00054 8b 8f a8 16 00
+ 00 mov ecx, DWORD PTR [edi+5800]
+
+; 942 : static_lenb = (s->static_len+3+7)>>3;
+
+ 0005a 8b 97 ac 16 00
+ 00 mov edx, DWORD PTR [edi+5804]
+ 00060 83 c1 0a add ecx, 10 ; 0000000aH
+
+; 943 :
+; 944 : Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
+; 945 : opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
+; 946 : s->last_lit));
+; 947 :
+; 948 : if (static_lenb <= opt_lenb) opt_lenb = static_lenb;
+; 949 :
+; 950 : } else {
+
+ 00063 8b 5d fc mov ebx, DWORD PTR _buf$1$[ebp]
+ 00066 83 c2 0a add edx, 10 ; 0000000aH
+ 00069 c1 e9 03 shr ecx, 3
+ 0006c c1 ea 03 shr edx, 3
+ 0006f 89 45 f8 mov DWORD PTR _max_blindex$1$[ebp], eax
+ 00072 3b d1 cmp edx, ecx
+ 00074 77 07 ja SHORT $LN3@tr_flush_b
+ 00076 eb 03 jmp SHORT $LN18@tr_flush_b
+$LN2@tr_flush_b:
+
+; 951 : Assert(buf != (char*)0, "lost buf");
+; 952 : opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
+
+ 00078 8d 56 05 lea edx, DWORD PTR [esi+5]
+$LN18@tr_flush_b:
+ 0007b 8b ca mov ecx, edx
+$LN3@tr_flush_b:
+
+; 953 : }
+; 954 :
+; 955 : #ifdef FORCE_STORED
+; 956 : if (buf != (char*)0) { /* force stored block */
+; 957 : #else
+; 958 : if (stored_len+4 <= opt_lenb && buf != (char*)0) {
+
+ 0007d 8d 46 04 lea eax, DWORD PTR [esi+4]
+ 00080 3b c1 cmp eax, ecx
+ 00082 77 1b ja SHORT $LN6@tr_flush_b
+ 00084 85 db test ebx, ebx
+ 00086 74 17 je SHORT $LN6@tr_flush_b
+
+; 959 : /* 4: two words for the lengths */
+; 960 : #endif
+; 961 : /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
+; 962 : * Otherwise we can't have processed more than WSIZE input bytes since
+; 963 : * the last block flush, because compression would have been
+; 964 : * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
+; 965 : * transform a block into a stored block.
+; 966 : */
+; 967 : _tr_stored_block(s, buf, stored_len, last);
+
+ 00088 8b 5d 0c mov ebx, DWORD PTR _last$[ebp]
+ 0008b 8b cf mov ecx, edi
+ 0008d 8b 55 fc mov edx, DWORD PTR _buf$1$[ebp]
+ 00090 53 push ebx
+ 00091 56 push esi
+ 00092 e8 00 00 00 00 call __tr_stored_block
+ 00097 83 c4 08 add esp, 8
+ 0009a e9 4a 01 00 00 jmp $LN9@tr_flush_b
+$LN6@tr_flush_b:
+
+; 968 :
+; 969 : #ifdef FORCE_STATIC
+; 970 : } else if (static_lenb >= 0) { /* force static trees */
+; 971 : #else
+; 972 : } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) {
+
+ 0009f 83 bf 88 00 00
+ 00 04 cmp DWORD PTR [edi+136], 4
+ 000a6 0f 84 b4 00 00
+ 00 je $LN10@tr_flush_b
+ 000ac 3b d1 cmp edx, ecx
+ 000ae 0f 84 ac 00 00
+ 00 je $LN10@tr_flush_b
+
+; 976 : (const ct_data *)static_dtree);
+; 977 : #ifdef DEBUG
+; 978 : s->compressed_len += 3 + s->static_len;
+; 979 : #endif
+; 980 : } else {
+; 981 : send_bits(s, (DYN_TREES<<1)+last, 3);
+
+ 000b4 8b 8f bc 16 00
+ 00 mov ecx, DWORD PTR [edi+5820]
+ 000ba 8b 5d 0c mov ebx, DWORD PTR _last$[ebp]
+ 000bd 83 f9 0d cmp ecx, 13 ; 0000000dH
+ 000c0 7e 51 jle SHORT $LN13@tr_flush_b
+ 000c2 8b 57 14 mov edx, DWORD PTR [edi+20]
+ 000c5 8d 73 04 lea esi, DWORD PTR [ebx+4]
+ 000c8 66 8b c6 mov ax, si
+ 000cb 66 d3 e0 shl ax, cl
+ 000ce 66 09 87 b8 16
+ 00 00 or WORD PTR [edi+5816], ax
+ 000d5 8b 4f 08 mov ecx, DWORD PTR [edi+8]
+ 000d8 0f b6 87 b8 16
+ 00 00 movzx eax, BYTE PTR [edi+5816]
+ 000df 88 04 0a mov BYTE PTR [edx+ecx], al
+ 000e2 ff 47 14 inc DWORD PTR [edi+20]
+ 000e5 8b 57 14 mov edx, DWORD PTR [edi+20]
+ 000e8 8b 4f 08 mov ecx, DWORD PTR [edi+8]
+ 000eb 0f b6 87 b9 16
+ 00 00 movzx eax, BYTE PTR [edi+5817]
+ 000f2 88 04 0a mov BYTE PTR [edx+ecx], al
+ 000f5 b1 10 mov cl, 16 ; 00000010H
+ 000f7 2a 8f bc 16 00
+ 00 sub cl, BYTE PTR [edi+5820]
+ 000fd ff 47 14 inc DWORD PTR [edi+20]
+ 00100 66 d3 ee shr si, cl
+ 00103 83 87 bc 16 00
+ 00 f3 add DWORD PTR [edi+5820], -13 ; fffffff3H
+ 0010a 66 89 b7 b8 16
+ 00 00 mov WORD PTR [edi+5816], si
+ 00111 eb 16 jmp SHORT $LN14@tr_flush_b
+$LN13@tr_flush_b:
+ 00113 8d 43 04 lea eax, DWORD PTR [ebx+4]
+ 00116 66 d3 e0 shl ax, cl
+ 00119 66 09 87 b8 16
+ 00 00 or WORD PTR [edi+5816], ax
+ 00120 8d 41 03 lea eax, DWORD PTR [ecx+3]
+ 00123 89 87 bc 16 00
+ 00 mov DWORD PTR [edi+5820], eax
+$LN14@tr_flush_b:
+
+; 982 : send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1,
+
+ 00129 8b 45 f8 mov eax, DWORD PTR _max_blindex$1$[ebp]
+ 0012c 8b cf mov ecx, edi
+ 0012e 8b 97 1c 0b 00
+ 00 mov edx, DWORD PTR [edi+2844]
+ 00134 40 inc eax
+ 00135 50 push eax
+ 00136 8b 87 28 0b 00
+ 00 mov eax, DWORD PTR [edi+2856]
+ 0013c 42 inc edx
+ 0013d 40 inc eax
+ 0013e 50 push eax
+ 0013f e8 00 00 00 00 call _send_all_trees
+
+; 983 : max_blindex+1);
+; 984 : compress_block(s, (const ct_data *)s->dyn_ltree,
+
+ 00144 8d 87 88 09 00
+ 00 lea eax, DWORD PTR [edi+2440]
+ 0014a 8b cf mov ecx, edi
+ 0014c 50 push eax
+ 0014d 8d 97 94 00 00
+ 00 lea edx, DWORD PTR [edi+148]
+ 00153 e8 00 00 00 00 call _compress_block
+ 00158 83 c4 0c add esp, 12 ; 0000000cH
+ 0015b e9 89 00 00 00 jmp $LN9@tr_flush_b
+$LN10@tr_flush_b:
+
+; 973 : #endif
+; 974 : send_bits(s, (STATIC_TREES<<1)+last, 3);
+
+ 00160 8b 8f bc 16 00
+ 00 mov ecx, DWORD PTR [edi+5820]
+ 00166 8b 5d 0c mov ebx, DWORD PTR _last$[ebp]
+ 00169 83 f9 0d cmp ecx, 13 ; 0000000dH
+ 0016c 7e 51 jle SHORT $LN11@tr_flush_b
+ 0016e 8b 57 14 mov edx, DWORD PTR [edi+20]
+ 00171 8d 73 02 lea esi, DWORD PTR [ebx+2]
+ 00174 66 8b c6 mov ax, si
+ 00177 66 d3 e0 shl ax, cl
+ 0017a 66 09 87 b8 16
+ 00 00 or WORD PTR [edi+5816], ax
+ 00181 8b 4f 08 mov ecx, DWORD PTR [edi+8]
+ 00184 0f b6 87 b8 16
+ 00 00 movzx eax, BYTE PTR [edi+5816]
+ 0018b 88 04 0a mov BYTE PTR [edx+ecx], al
+ 0018e ff 47 14 inc DWORD PTR [edi+20]
+ 00191 8b 57 14 mov edx, DWORD PTR [edi+20]
+ 00194 8b 4f 08 mov ecx, DWORD PTR [edi+8]
+ 00197 0f b6 87 b9 16
+ 00 00 movzx eax, BYTE PTR [edi+5817]
+ 0019e 88 04 0a mov BYTE PTR [edx+ecx], al
+ 001a1 b1 10 mov cl, 16 ; 00000010H
+ 001a3 2a 8f bc 16 00
+ 00 sub cl, BYTE PTR [edi+5820]
+ 001a9 ff 47 14 inc DWORD PTR [edi+20]
+ 001ac 66 d3 ee shr si, cl
+ 001af 83 87 bc 16 00
+ 00 f3 add DWORD PTR [edi+5820], -13 ; fffffff3H
+ 001b6 66 89 b7 b8 16
+ 00 00 mov WORD PTR [edi+5816], si
+ 001bd eb 16 jmp SHORT $LN12@tr_flush_b
+$LN11@tr_flush_b:
+ 001bf 8d 43 02 lea eax, DWORD PTR [ebx+2]
+ 001c2 66 d3 e0 shl ax, cl
+ 001c5 66 09 87 b8 16
+ 00 00 or WORD PTR [edi+5816], ax
+ 001cc 8d 41 03 lea eax, DWORD PTR [ecx+3]
+ 001cf 89 87 bc 16 00
+ 00 mov DWORD PTR [edi+5820], eax
+$LN12@tr_flush_b:
+
+; 975 : compress_block(s, (const ct_data *)static_ltree,
+
+ 001d5 68 00 00 00 00 push OFFSET _static_dtree
+ 001da ba 00 00 00 00 mov edx, OFFSET _static_ltree
+ 001df 8b cf mov ecx, edi
+ 001e1 e8 00 00 00 00 call _compress_block
+ 001e6 83 c4 04 add esp, 4
+$LN9@tr_flush_b:
+
+; 985 : (const ct_data *)s->dyn_dtree);
+; 986 : #ifdef DEBUG
+; 987 : s->compressed_len += 3 + s->opt_len;
+; 988 : #endif
+; 989 : }
+; 990 : Assert (s->compressed_len == s->bits_sent, "bad compressed size");
+; 991 : /* The above check is made mod 2^32, for files larger than 512 MB
+; 992 : * and uLong implemented on 32 bits.
+; 993 : */
+; 994 : init_block(s);
+
+ 001e9 8b cf mov ecx, edi
+ 001eb e8 00 00 00 00 call _init_block
+
+; 995 :
+; 996 : if (last) {
+
+ 001f0 85 db test ebx, ebx
+ 001f2 74 05 je SHORT $LN15@tr_flush_b
+
+; 997 : bi_windup(s);
+
+ 001f4 e8 00 00 00 00 call _bi_windup
+$LN15@tr_flush_b:
+ 001f9 5f pop edi
+ 001fa 5e pop esi
+ 001fb 5b pop ebx
+
+; 998 : #ifdef DEBUG
+; 999 : s->compressed_len += 7; /* align on byte boundary */
+; 1000 : #endif
+; 1001 : }
+; 1002 : Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
+; 1003 : s->compressed_len-7*last));
+; 1004 : }
+
+ 001fc 8b e5 mov esp, ebp
+ 001fe 5d pop ebp
+ 001ff c3 ret 0
+__tr_flush_block ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\trees.c
+; COMDAT __tr_init
+_TEXT SEGMENT
+__tr_init PROC ; COMDAT
+; _s$ = ecx
+
+; 384 : tr_static_init();
+; 385 :
+; 386 : s->l_desc.dyn_tree = s->dyn_ltree;
+
+ 00000 8d 81 94 00 00
+ 00 lea eax, DWORD PTR [ecx+148]
+
+; 387 : s->l_desc.stat_desc = &static_l_desc;
+
+ 00006 c7 81 20 0b 00
+ 00 00 00 00 00 mov DWORD PTR [ecx+2848], OFFSET _static_l_desc
+ 00010 89 81 18 0b 00
+ 00 mov DWORD PTR [ecx+2840], eax
+
+; 388 :
+; 389 : s->d_desc.dyn_tree = s->dyn_dtree;
+
+ 00016 8d 81 88 09 00
+ 00 lea eax, DWORD PTR [ecx+2440]
+ 0001c 89 81 24 0b 00
+ 00 mov DWORD PTR [ecx+2852], eax
+
+; 390 : s->d_desc.stat_desc = &static_d_desc;
+; 391 :
+; 392 : s->bl_desc.dyn_tree = s->bl_tree;
+
+ 00022 8d 81 7c 0a 00
+ 00 lea eax, DWORD PTR [ecx+2684]
+ 00028 89 81 30 0b 00
+ 00 mov DWORD PTR [ecx+2864], eax
+
+; 393 : s->bl_desc.stat_desc = &static_bl_desc;
+; 394 :
+; 395 : s->bi_buf = 0;
+
+ 0002e 33 c0 xor eax, eax
+ 00030 c7 81 2c 0b 00
+ 00 00 00 00 00 mov DWORD PTR [ecx+2860], OFFSET _static_d_desc
+ 0003a c7 81 38 0b 00
+ 00 00 00 00 00 mov DWORD PTR [ecx+2872], OFFSET _static_bl_desc
+ 00044 66 89 81 b8 16
+ 00 00 mov WORD PTR [ecx+5816], ax
+
+; 396 : s->bi_valid = 0;
+
+ 0004b 89 81 bc 16 00
+ 00 mov DWORD PTR [ecx+5820], eax
+
+; 397 : #ifdef DEBUG
+; 398 : s->compressed_len = 0L;
+; 399 : s->bits_sent = 0L;
+; 400 : #endif
+; 401 :
+; 402 : /* Initialize the first block of the first file: */
+; 403 : init_block(s);
+
+ 00051 e9 00 00 00 00 jmp _init_block
+__tr_init ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\trees.c
+; COMDAT __tr_align
+_TEXT SEGMENT
+__tr_align PROC ; COMDAT
+; _s$ = ecx
+
+; 894 : {
+
+ 00000 57 push edi
+ 00001 8b f9 mov edi, ecx
+
+; 895 : send_bits(s, STATIC_TREES<<1, 3);
+
+ 00003 8b 8f bc 16 00
+ 00 mov ecx, DWORD PTR [edi+5820]
+ 00009 83 f9 0d cmp ecx, 13 ; 0000000dH
+ 0000c 7e 54 jle SHORT $LN2@tr_align
+ 0000e 8b 57 08 mov edx, DWORD PTR [edi+8]
+ 00011 56 push esi
+ 00012 be 02 00 00 00 mov esi, 2
+ 00017 8b c6 mov eax, esi
+ 00019 66 d3 e0 shl ax, cl
+ 0001c 8b 4f 14 mov ecx, DWORD PTR [edi+20]
+ 0001f 66 09 87 b8 16
+ 00 00 or WORD PTR [edi+5816], ax
+ 00026 0f b6 87 b8 16
+ 00 00 movzx eax, BYTE PTR [edi+5816]
+ 0002d 88 04 0a mov BYTE PTR [edx+ecx], al
+ 00030 ff 47 14 inc DWORD PTR [edi+20]
+ 00033 8b 57 14 mov edx, DWORD PTR [edi+20]
+ 00036 8b 4f 08 mov ecx, DWORD PTR [edi+8]
+ 00039 0f b6 87 b9 16
+ 00 00 movzx eax, BYTE PTR [edi+5817]
+ 00040 88 04 0a mov BYTE PTR [edx+ecx], al
+ 00043 b1 10 mov cl, 16 ; 00000010H
+ 00045 2a 8f bc 16 00
+ 00 sub cl, BYTE PTR [edi+5820]
+ 0004b ff 47 14 inc DWORD PTR [edi+20]
+ 0004e 66 d3 ee shr si, cl
+ 00051 83 87 bc 16 00
+ 00 f3 add DWORD PTR [edi+5820], -13 ; fffffff3H
+ 00058 66 89 b7 b8 16
+ 00 00 mov WORD PTR [edi+5816], si
+ 0005f 5e pop esi
+ 00060 eb 18 jmp SHORT $LN3@tr_align
+$LN2@tr_align:
+ 00062 b8 02 00 00 00 mov eax, 2
+ 00067 66 d3 e0 shl ax, cl
+ 0006a 66 09 87 b8 16
+ 00 00 or WORD PTR [edi+5816], ax
+ 00071 8d 41 03 lea eax, DWORD PTR [ecx+3]
+ 00074 89 87 bc 16 00
+ 00 mov DWORD PTR [edi+5820], eax
+$LN3@tr_align:
+
+; 896 : send_code(s, END_BLOCK, static_ltree);
+
+ 0007a 8b 8f bc 16 00
+ 00 mov ecx, DWORD PTR [edi+5820]
+ 00080 33 c0 xor eax, eax
+ 00082 66 d3 e0 shl ax, cl
+ 00085 66 09 87 b8 16
+ 00 00 or WORD PTR [edi+5816], ax
+ 0008c 83 f9 09 cmp ecx, 9
+ 0008f 7e 49 jle SHORT $LN4@tr_align
+ 00091 8b 4f 14 mov ecx, DWORD PTR [edi+20]
+ 00094 8b 57 08 mov edx, DWORD PTR [edi+8]
+ 00097 0f b6 87 b8 16
+ 00 00 movzx eax, BYTE PTR [edi+5816]
+ 0009e 88 04 0a mov BYTE PTR [edx+ecx], al
+ 000a1 ff 47 14 inc DWORD PTR [edi+20]
+ 000a4 8b 4f 08 mov ecx, DWORD PTR [edi+8]
+ 000a7 8b 57 14 mov edx, DWORD PTR [edi+20]
+ 000aa 0f b6 87 b9 16
+ 00 00 movzx eax, BYTE PTR [edi+5817]
+ 000b1 88 04 0a mov BYTE PTR [edx+ecx], al
+ 000b4 b1 10 mov cl, 16 ; 00000010H
+ 000b6 2a 8f bc 16 00
+ 00 sub cl, BYTE PTR [edi+5820]
+ 000bc 33 c0 xor eax, eax
+ 000be ff 47 14 inc DWORD PTR [edi+20]
+ 000c1 66 d3 e8 shr ax, cl
+
+; 897 : #ifdef DEBUG
+; 898 : s->compressed_len += 10L; /* 3 for block type, 7 for EOB */
+; 899 : #endif
+; 900 : bi_flush(s);
+
+ 000c4 8b cf mov ecx, edi
+ 000c6 83 87 bc 16 00
+ 00 f7 add DWORD PTR [edi+5820], -9 ; fffffff7H
+ 000cd 66 89 87 b8 16
+ 00 00 mov WORD PTR [edi+5816], ax
+ 000d4 5f pop edi
+ 000d5 e9 00 00 00 00 jmp _bi_flush
+$LN4@tr_align:
+
+; 896 : send_code(s, END_BLOCK, static_ltree);
+
+ 000da 8d 41 07 lea eax, DWORD PTR [ecx+7]
+
+; 897 : #ifdef DEBUG
+; 898 : s->compressed_len += 10L; /* 3 for block type, 7 for EOB */
+; 899 : #endif
+; 900 : bi_flush(s);
+
+ 000dd 8b cf mov ecx, edi
+ 000df 89 87 bc 16 00
+ 00 mov DWORD PTR [edi+5820], eax
+ 000e5 5f pop edi
+ 000e6 e9 00 00 00 00 jmp _bi_flush
+__tr_align ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\trees.c
+; COMDAT _tr_static_init
+_TEXT SEGMENT
+_tr_static_init PROC ; COMDAT
+
+; 236 : #if defined(GEN_TREES_H) || !defined(STDC)
+; 237 : static int static_init_done = 0;
+; 238 : int n; /* iterates over tree elements */
+; 239 : int bits; /* bit counter */
+; 240 : int length; /* length value */
+; 241 : int code; /* code value */
+; 242 : int dist; /* distance index */
+; 243 : ush bl_count[MAX_BITS+1];
+; 244 : /* number of codes at each bit length for an optimal tree */
+; 245 :
+; 246 : if (static_init_done) return;
+; 247 :
+; 248 : /* For some embedded targets, global variables are not initialized: */
+; 249 : #ifdef NO_INIT_GLOBAL_POINTERS
+; 250 : static_l_desc.static_tree = static_ltree;
+; 251 : static_l_desc.extra_bits = extra_lbits;
+; 252 : static_d_desc.static_tree = static_dtree;
+; 253 : static_d_desc.extra_bits = extra_dbits;
+; 254 : static_bl_desc.extra_bits = extra_blbits;
+; 255 : #endif
+; 256 :
+; 257 : /* Initialize the mapping length (0..255) -> length code (0..28) */
+; 258 : length = 0;
+; 259 : for (code = 0; code < LENGTH_CODES-1; code++) {
+; 260 : base_length[code] = length;
+; 261 : for (n = 0; n < (1<<extra_lbits[code]); n++) {
+; 262 : _length_code[length++] = (uch)code;
+; 263 : }
+; 264 : }
+; 265 : Assert (length == 256, "tr_static_init: length != 256");
+; 266 : /* Note that the length 255 (match length 258) can be represented
+; 267 : * in two different ways: code 284 + 5 bits or code 285, so we
+; 268 : * overwrite length_code[255] to use the best encoding:
+; 269 : */
+; 270 : _length_code[length-1] = (uch)code;
+; 271 :
+; 272 : /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
+; 273 : dist = 0;
+; 274 : for (code = 0 ; code < 16; code++) {
+; 275 : base_dist[code] = dist;
+; 276 : for (n = 0; n < (1<<extra_dbits[code]); n++) {
+; 277 : _dist_code[dist++] = (uch)code;
+; 278 : }
+; 279 : }
+; 280 : Assert (dist == 256, "tr_static_init: dist != 256");
+; 281 : dist >>= 7; /* from now on, all distances are divided by 128 */
+; 282 : for ( ; code < D_CODES; code++) {
+; 283 : base_dist[code] = dist << 7;
+; 284 : for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {
+; 285 : _dist_code[256 + dist++] = (uch)code;
+; 286 : }
+; 287 : }
+; 288 : Assert (dist == 256, "tr_static_init: 256+dist != 512");
+; 289 :
+; 290 : /* Construct the codes of the static literal tree */
+; 291 : for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0;
+; 292 : n = 0;
+; 293 : while (n <= 143) static_ltree[n++].Len = 8, bl_count[8]++;
+; 294 : while (n <= 255) static_ltree[n++].Len = 9, bl_count[9]++;
+; 295 : while (n <= 279) static_ltree[n++].Len = 7, bl_count[7]++;
+; 296 : while (n <= 287) static_ltree[n++].Len = 8, bl_count[8]++;
+; 297 : /* Codes 286 and 287 do not exist, but we must include them in the
+; 298 : * tree construction to get a canonical Huffman tree (longest code
+; 299 : * all ones)
+; 300 : */
+; 301 : gen_codes((ct_data *)static_ltree, L_CODES+1, bl_count);
+; 302 :
+; 303 : /* The static distance tree is trivial: */
+; 304 : for (n = 0; n < D_CODES; n++) {
+; 305 : static_dtree[n].Len = 5;
+; 306 : static_dtree[n].Code = bi_reverse((unsigned)n, 5);
+; 307 : }
+; 308 : static_init_done = 1;
+; 309 :
+; 310 : # ifdef GEN_TREES_H
+; 311 : gen_trees_header();
+; 312 : # endif
+; 313 : #endif /* defined(GEN_TREES_H) || !defined(STDC) */
+; 314 : }
+
+ 00000 c3 ret 0
+_tr_static_init ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\trees.c
+; COMDAT _init_block
+_TEXT SEGMENT
+_init_block PROC ; COMDAT
+; _s$ = ecx
+
+; 412 : int n; /* iterates over tree elements */
+; 413 :
+; 414 : /* Initialize the trees. */
+; 415 : for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0;
+
+ 00000 8d 81 94 00 00
+ 00 lea eax, DWORD PTR [ecx+148]
+ 00006 ba 1e 01 00 00 mov edx, 286 ; 0000011eH
+ 0000b 56 push esi
+ 0000c 0f 1f 40 00 npad 4
+$LL4@init_block:
+ 00010 33 f6 xor esi, esi
+ 00012 8d 40 04 lea eax, DWORD PTR [eax+4]
+ 00015 66 89 70 fc mov WORD PTR [eax-4], si
+ 00019 83 ea 01 sub edx, 1
+ 0001c 75 f2 jne SHORT $LL4@init_block
+
+; 416 : for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0;
+
+ 0001e 8d 81 88 09 00
+ 00 lea eax, DWORD PTR [ecx+2440]
+ 00024 ba 1e 00 00 00 mov edx, 30 ; 0000001eH
+ 00029 0f 1f 80 00 00
+ 00 00 npad 7
+$LL7@init_block:
+ 00030 33 f6 xor esi, esi
+ 00032 8d 40 04 lea eax, DWORD PTR [eax+4]
+ 00035 66 89 70 fc mov WORD PTR [eax-4], si
+ 00039 83 ea 01 sub edx, 1
+ 0003c 75 f2 jne SHORT $LL7@init_block
+
+; 417 : for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
+
+ 0003e 8d 81 7c 0a 00
+ 00 lea eax, DWORD PTR [ecx+2684]
+ 00044 ba 13 00 00 00 mov edx, 19 ; 00000013H
+ 00049 0f 1f 80 00 00
+ 00 00 npad 7
+$LL10@init_block:
+ 00050 33 f6 xor esi, esi
+ 00052 8d 40 04 lea eax, DWORD PTR [eax+4]
+ 00055 66 89 70 fc mov WORD PTR [eax-4], si
+ 00059 83 ea 01 sub edx, 1
+ 0005c 75 f2 jne SHORT $LL10@init_block
+
+; 418 :
+; 419 : s->dyn_ltree[END_BLOCK].Freq = 1;
+
+ 0005e b8 01 00 00 00 mov eax, 1
+
+; 420 : s->opt_len = s->static_len = 0L;
+
+ 00063 89 b1 ac 16 00
+ 00 mov DWORD PTR [ecx+5804], esi
+ 00069 89 b1 a8 16 00
+ 00 mov DWORD PTR [ecx+5800], esi
+
+; 421 : s->last_lit = s->matches = 0;
+
+ 0006f 89 b1 b0 16 00
+ 00 mov DWORD PTR [ecx+5808], esi
+ 00075 89 b1 a0 16 00
+ 00 mov DWORD PTR [ecx+5792], esi
+ 0007b 66 89 81 94 04
+ 00 00 mov WORD PTR [ecx+1172], ax
+ 00082 5e pop esi
+
+; 422 : }
+
+ 00083 c3 ret 0
+_init_block ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\trees.c
+; COMDAT _pqdownheap
+_TEXT SEGMENT
+tv287 = -8 ; size = 4
+_tree$1$ = -4 ; size = 4
+_v$1$ = 8 ; size = 4
+_k$ = 8 ; size = 4
+_pqdownheap PROC ; COMDAT
+; _s$ = ecx
+; _tree$ = edx
+
+; 457 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 08 sub esp, 8
+
+; 458 : int v = s->heap[k];
+; 459 : int j = k << 1; /* left son of k */
+; 460 : while (j <= s->heap_len) {
+
+ 00006 8b 81 50 14 00
+ 00 mov eax, DWORD PTR [ecx+5200]
+ 0000c 53 push ebx
+ 0000d 8b 5d 08 mov ebx, DWORD PTR _k$[ebp]
+ 00010 56 push esi
+ 00011 57 push edi
+ 00012 89 55 fc mov DWORD PTR _tree$1$[ebp], edx
+ 00015 8b bc 99 5c 0b
+ 00 00 mov edi, DWORD PTR [ecx+ebx*4+2908]
+ 0001c 8d 34 1b lea esi, DWORD PTR [ebx+ebx]
+ 0001f 89 7d 08 mov DWORD PTR _v$1$[ebp], edi
+ 00022 3b f0 cmp esi, eax
+ 00024 0f 8f 91 00 00
+ 00 jg $LN16@pqdownheap
+ 0002a 8d 14 ba lea edx, DWORD PTR [edx+edi*4]
+ 0002d 89 55 f8 mov DWORD PTR tv287[ebp], edx
+$LN19@pqdownheap:
+
+; 461 : /* Set j to the smallest of the two sons: */
+; 462 : if (j < s->heap_len &&
+
+ 00030 7d 42 jge SHORT $LN4@pqdownheap
+ 00032 8b bc b1 60 0b
+ 00 00 mov edi, DWORD PTR [ecx+esi*4+2912]
+ 00039 8b 45 fc mov eax, DWORD PTR _tree$1$[ebp]
+ 0003c 8b 94 b1 5c 0b
+ 00 00 mov edx, DWORD PTR [ecx+esi*4+2908]
+ 00043 0f b7 04 b8 movzx eax, WORD PTR [eax+edi*4]
+ 00047 8b 7d fc mov edi, DWORD PTR _tree$1$[ebp]
+ 0004a 0f b7 14 97 movzx edx, WORD PTR [edi+edx*4]
+ 0004e 8b bc b1 60 0b
+ 00 00 mov edi, DWORD PTR [ecx+esi*4+2912]
+ 00055 66 3b c2 cmp ax, dx
+ 00058 72 19 jb SHORT $LN5@pqdownheap
+ 0005a 75 18 jne SHORT $LN4@pqdownheap
+ 0005c 8b 94 b1 5c 0b
+ 00 00 mov edx, DWORD PTR [ecx+esi*4+2908]
+ 00063 8a 84 0f 58 14
+ 00 00 mov al, BYTE PTR [edi+ecx+5208]
+ 0006a 3a 84 0a 58 14
+ 00 00 cmp al, BYTE PTR [edx+ecx+5208]
+ 00071 77 01 ja SHORT $LN4@pqdownheap
+$LN5@pqdownheap:
+
+; 463 : smaller(tree, s->heap[j+1], s->heap[j], s->depth)) {
+; 464 : j++;
+
+ 00073 46 inc esi
+$LN4@pqdownheap:
+
+; 465 : }
+; 466 : /* Exit if v is smaller than both sons */
+; 467 : if (smaller(tree, v, s->heap[j], s->depth)) break;
+
+ 00074 8b 94 b1 5c 0b
+ 00 00 mov edx, DWORD PTR [ecx+esi*4+2908]
+ 0007b 8b 45 f8 mov eax, DWORD PTR tv287[ebp]
+ 0007e 8b 7d fc mov edi, DWORD PTR _tree$1$[ebp]
+ 00081 0f b7 00 movzx eax, WORD PTR [eax]
+ 00084 0f b7 3c 97 movzx edi, WORD PTR [edi+edx*4]
+ 00088 66 3b c7 cmp ax, di
+ 0008b 72 3c jb SHORT $LN15@pqdownheap
+ 0008d 8b 7d 08 mov edi, DWORD PTR _v$1$[ebp]
+ 00090 75 10 jne SHORT $LN6@pqdownheap
+ 00092 8a 84 0f 58 14
+ 00 00 mov al, BYTE PTR [edi+ecx+5208]
+ 00099 3a 84 0a 58 14
+ 00 00 cmp al, BYTE PTR [edx+ecx+5208]
+ 000a0 76 19 jbe SHORT $LN16@pqdownheap
+$LN6@pqdownheap:
+
+; 468 :
+; 469 : /* Exchange v with the smallest son */
+; 470 : s->heap[k] = s->heap[j]; k = j;
+
+ 000a2 89 94 99 5c 0b
+ 00 00 mov DWORD PTR [ecx+ebx*4+2908], edx
+ 000a9 8b de mov ebx, esi
+ 000ab 8b 81 50 14 00
+ 00 mov eax, DWORD PTR [ecx+5200]
+
+; 471 :
+; 472 : /* And continue down the tree, setting j to the left son of k */
+; 473 : j <<= 1;
+
+ 000b1 03 f6 add esi, esi
+ 000b3 3b f0 cmp esi, eax
+ 000b5 0f 8e 75 ff ff
+ ff jle $LN19@pqdownheap
+$LN16@pqdownheap:
+
+; 474 : }
+; 475 : s->heap[k] = v;
+
+ 000bb 89 bc 99 5c 0b
+ 00 00 mov DWORD PTR [ecx+ebx*4+2908], edi
+ 000c2 5f pop edi
+ 000c3 5e pop esi
+ 000c4 5b pop ebx
+
+; 476 : }
+
+ 000c5 8b e5 mov esp, ebp
+ 000c7 5d pop ebp
+ 000c8 c3 ret 0
+$LN15@pqdownheap:
+
+; 474 : }
+; 475 : s->heap[k] = v;
+
+ 000c9 8b 45 08 mov eax, DWORD PTR _v$1$[ebp]
+ 000cc 5f pop edi
+ 000cd 5e pop esi
+ 000ce 89 84 99 5c 0b
+ 00 00 mov DWORD PTR [ecx+ebx*4+2908], eax
+ 000d5 5b pop ebx
+
+; 476 : }
+
+ 000d6 8b e5 mov esp, ebp
+ 000d8 5d pop ebp
+ 000d9 c3 ret 0
+_pqdownheap ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\trees.c
+; COMDAT _gen_bitlen
+_TEXT SEGMENT
+tv644 = -52 ; size = 4
+_extra$1$ = -48 ; size = 4
+_s$1$ = -44 ; size = 4
+tv653 = -40 ; size = 4
+tv628 = -40 ; size = 4
+tv632 = -36 ; size = 4
+_stree$1$ = -32 ; size = 4
+_base$1$ = -28 ; size = 4
+_max_code$1$ = -24 ; size = 4
+_overflow$1$ = -20 ; size = 4
+tv647 = -16 ; size = 4
+_h$1$ = -12 ; size = 4
+_bits$3$ = -8 ; size = 4
+_tree$1$ = -4 ; size = 4
+_gen_bitlen PROC ; COMDAT
+; _s$ = ecx
+; _desc$ = edx
+
+; 491 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 34 sub esp, 52 ; 00000034H
+
+; 492 : ct_data *tree = desc->dyn_tree;
+; 493 : int max_code = desc->max_code;
+
+ 00006 8b 42 04 mov eax, DWORD PTR [edx+4]
+ 00009 0f 57 c0 xorps xmm0, xmm0
+ 0000c 89 45 e8 mov DWORD PTR _max_code$1$[ebp], eax
+
+; 494 : const ct_data *stree = desc->stat_desc->static_tree;
+
+ 0000f 8b 42 08 mov eax, DWORD PTR [edx+8]
+ 00012 53 push ebx
+ 00013 8b d9 mov ebx, ecx
+
+; 495 : const intf *extra = desc->stat_desc->extra_bits;
+; 496 : int base = desc->stat_desc->extra_base;
+; 497 : int max_length = desc->stat_desc->max_length;
+; 498 : int h; /* heap index */
+; 499 : int n, m; /* iterate over the tree elements */
+; 500 : int bits; /* bit length */
+; 501 : int xbits; /* extra bits */
+; 502 : ush f; /* frequency */
+; 503 : int overflow = 0; /* number of elements with bit length too large */
+
+ 00015 c7 45 ec 00 00
+ 00 00 mov DWORD PTR _overflow$1$[ebp], 0
+ 0001c 8b 0a mov ecx, DWORD PTR [edx]
+ 0001e 8b 10 mov edx, DWORD PTR [eax]
+ 00020 89 55 e0 mov DWORD PTR _stree$1$[ebp], edx
+ 00023 8b 50 04 mov edx, DWORD PTR [eax+4]
+ 00026 89 55 d0 mov DWORD PTR _extra$1$[ebp], edx
+ 00029 8b 50 08 mov edx, DWORD PTR [eax+8]
+ 0002c 56 push esi
+ 0002d 8b 70 10 mov esi, DWORD PTR [eax+16]
+
+; 504 :
+; 505 : for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;
+
+ 00030 0f 11 83 3c 0b
+ 00 00 movups XMMWORD PTR [ebx+2876], xmm0
+ 00037 89 55 e4 mov DWORD PTR _base$1$[ebp], edx
+
+; 506 :
+; 507 : /* In a first pass, compute the optimal bit lengths (which may
+; 508 : * overflow in the case of the bit length tree).
+; 509 : */
+; 510 : tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */
+
+ 0003a 33 d2 xor edx, edx
+ 0003c 0f 11 83 4c 0b
+ 00 00 movups XMMWORD PTR [ebx+2892], xmm0
+ 00043 8b 83 54 14 00
+ 00 mov eax, DWORD PTR [ebx+5204]
+ 00049 89 5d d4 mov DWORD PTR _s$1$[ebp], ebx
+ 0004c 89 4d fc mov DWORD PTR _tree$1$[ebp], ecx
+ 0004f 89 75 f8 mov DWORD PTR _bits$3$[ebp], esi
+ 00052 8b 84 83 5c 0b
+ 00 00 mov eax, DWORD PTR [ebx+eax*4+2908]
+ 00059 66 89 54 81 02 mov WORD PTR [ecx+eax*4+2], dx
+
+; 511 :
+; 512 : for (h = s->heap_max+1; h < HEAP_SIZE; h++) {
+
+ 0005e 8b 93 54 14 00
+ 00 mov edx, DWORD PTR [ebx+5204]
+ 00064 42 inc edx
+ 00065 81 fa 3d 02 00
+ 00 cmp edx, 573 ; 0000023dH
+ 0006b 0f 8d 95 01 00
+ 00 jge $LN14@gen_bitlen
+
+; 506 :
+; 507 : /* In a first pass, compute the optimal bit lengths (which may
+; 508 : * overflow in the case of the bit length tree).
+; 509 : */
+; 510 : tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */
+
+ 00071 b8 3d 02 00 00 mov eax, 573 ; 0000023dH
+ 00076 8d 8b 5c 0b 00
+ 00 lea ecx, DWORD PTR [ebx+2908]
+ 0007c 2b c2 sub eax, edx
+ 0007e 8d 0c 91 lea ecx, DWORD PTR [ecx+edx*4]
+
+; 511 :
+; 512 : for (h = s->heap_max+1; h < HEAP_SIZE; h++) {
+
+ 00081 03 d0 add edx, eax
+ 00083 89 45 d8 mov DWORD PTR tv653[ebp], eax
+ 00086 8b 45 fc mov eax, DWORD PTR _tree$1$[ebp]
+ 00089 89 55 f4 mov DWORD PTR _h$1$[ebp], edx
+ 0008c 33 d2 xor edx, edx
+ 0008e 89 4d dc mov DWORD PTR tv632[ebp], ecx
+ 00091 57 push edi
+$LL7@gen_bitlen:
+
+; 513 : n = s->heap[h];
+
+ 00092 8b 39 mov edi, DWORD PTR [ecx]
+
+; 514 : bits = tree[tree[n].Dad].Len + 1;
+
+ 00094 8d 0c bd 00 00
+ 00 00 lea ecx, DWORD PTR [edi*4]
+ 0009b 0f b7 44 01 02 movzx eax, WORD PTR [ecx+eax+2]
+ 000a0 89 4d f0 mov DWORD PTR tv647[ebp], ecx
+ 000a3 8b 4d fc mov ecx, DWORD PTR _tree$1$[ebp]
+ 000a6 0f b7 4c 81 02 movzx ecx, WORD PTR [ecx+eax*4+2]
+ 000ab 41 inc ecx
+
+; 515 : if (bits > max_length) bits = max_length, overflow++;
+
+ 000ac 3b ce cmp ecx, esi
+ 000ae 7e 06 jle SHORT $LN18@gen_bitlen
+ 000b0 42 inc edx
+ 000b1 8b ce mov ecx, esi
+ 000b3 89 55 ec mov DWORD PTR _overflow$1$[ebp], edx
+$LN18@gen_bitlen:
+
+; 516 : tree[n].Len = (ush)bits;
+
+ 000b6 8b 75 f0 mov esi, DWORD PTR tv647[ebp]
+ 000b9 8b 45 fc mov eax, DWORD PTR _tree$1$[ebp]
+ 000bc 66 89 4c 06 02 mov WORD PTR [esi+eax+2], cx
+
+; 517 : /* We overwrite tree[n].Dad which is no longer needed */
+; 518 :
+; 519 : if (n > max_code) continue; /* not a leaf node */
+
+ 000c1 8b 75 f8 mov esi, DWORD PTR _bits$3$[ebp]
+ 000c4 3b 7d e8 cmp edi, DWORD PTR _max_code$1$[ebp]
+ 000c7 7f 5b jg SHORT $LN5@gen_bitlen
+
+; 520 :
+; 521 : s->bl_count[bits]++;
+
+ 000c9 66 ff 84 4b 3c
+ 0b 00 00 inc WORD PTR [ebx+ecx*2+2876]
+
+; 522 : xbits = 0;
+; 523 : if (n >= base) xbits = extra[n-base];
+
+ 000d1 3b 7d e4 cmp edi, DWORD PTR _base$1$[ebp]
+ 000d4 7c 0e jl SHORT $LN50@gen_bitlen
+ 000d6 8b 75 d0 mov esi, DWORD PTR _extra$1$[ebp]
+ 000d9 2b 7d e4 sub edi, DWORD PTR _base$1$[ebp]
+ 000dc 8b 3c be mov edi, DWORD PTR [esi+edi*4]
+ 000df 8b 75 f8 mov esi, DWORD PTR _bits$3$[ebp]
+ 000e2 eb 02 jmp SHORT $LN20@gen_bitlen
+$LN50@gen_bitlen:
+ 000e4 33 ff xor edi, edi
+$LN20@gen_bitlen:
+
+; 524 : f = tree[n].Freq;
+
+ 000e6 8b 55 f0 mov edx, DWORD PTR tv647[ebp]
+ 000e9 0f b7 04 02 movzx eax, WORD PTR [edx+eax]
+
+; 525 : s->opt_len += (ulg)f * (bits + xbits);
+; 526 : if (stree) s->static_len += (ulg)f * (stree[n].Len + xbits);
+
+ 000ed 8b 55 ec mov edx, DWORD PTR _overflow$1$[ebp]
+ 000f0 89 45 cc mov DWORD PTR tv644[ebp], eax
+ 000f3 8d 04 0f lea eax, DWORD PTR [edi+ecx]
+ 000f6 8b 4d cc mov ecx, DWORD PTR tv644[ebp]
+ 000f9 0f af c1 imul eax, ecx
+ 000fc 01 83 a8 16 00
+ 00 add DWORD PTR [ebx+5800], eax
+ 00102 83 7d e0 00 cmp DWORD PTR _stree$1$[ebp], 0
+ 00106 74 19 je SHORT $LN51@gen_bitlen
+ 00108 8b 75 e0 mov esi, DWORD PTR _stree$1$[ebp]
+ 0010b 8b 45 f0 mov eax, DWORD PTR tv647[ebp]
+ 0010e 0f b7 44 30 02 movzx eax, WORD PTR [eax+esi+2]
+ 00113 8b 75 f8 mov esi, DWORD PTR _bits$3$[ebp]
+ 00116 03 c7 add eax, edi
+ 00118 0f af c1 imul eax, ecx
+ 0011b 01 83 ac 16 00
+ 00 add DWORD PTR [ebx+5804], eax
+$LN51@gen_bitlen:
+ 00121 8b 45 fc mov eax, DWORD PTR _tree$1$[ebp]
+$LN5@gen_bitlen:
+
+; 511 :
+; 512 : for (h = s->heap_max+1; h < HEAP_SIZE; h++) {
+
+ 00124 8b 4d dc mov ecx, DWORD PTR tv632[ebp]
+ 00127 83 c1 04 add ecx, 4
+ 0012a 83 6d d8 01 sub DWORD PTR tv653[ebp], 1
+ 0012e 89 4d dc mov DWORD PTR tv632[ebp], ecx
+ 00131 0f 85 5b ff ff
+ ff jne $LL7@gen_bitlen
+
+; 527 : }
+; 528 : if (overflow == 0) return;
+
+ 00137 85 d2 test edx, edx
+ 00139 0f 84 c6 00 00
+ 00 je $LN52@gen_bitlen
+ 0013f 8d 56 ff lea edx, DWORD PTR [esi-1]
+ 00142 81 c6 9e 05 00
+ 00 add esi, 1438 ; 0000059eH
+ 00148 8d 3c 73 lea edi, DWORD PTR [ebx+esi*2]
+ 0014b 8b 75 ec mov esi, DWORD PTR _overflow$1$[ebp]
+ 0014e 89 7d d8 mov DWORD PTR tv628[ebp], edi
+$LL10@gen_bitlen:
+
+; 529 :
+; 530 : Trace((stderr,"\nbit length overflow\n"));
+; 531 : /* This happens for example on obj2 and pic of the Calgary corpus */
+; 532 :
+; 533 : /* Find the first bit length which could increase: */
+; 534 : do {
+; 535 : bits = max_length-1;
+
+ 00151 8b ca mov ecx, edx
+
+; 536 : while (s->bl_count[bits] == 0) bits--;
+
+ 00153 8d 83 3c 0b 00
+ 00 lea eax, DWORD PTR [ebx+2876]
+ 00159 66 83 3c 48 00 cmp WORD PTR [eax+ecx*2], 0
+ 0015e 8d 04 48 lea eax, DWORD PTR [eax+ecx*2]
+ 00161 75 0a jne SHORT $LN12@gen_bitlen
+$LL11@gen_bitlen:
+ 00163 8d 40 fe lea eax, DWORD PTR [eax-2]
+ 00166 49 dec ecx
+ 00167 66 83 38 00 cmp WORD PTR [eax], 0
+ 0016b 74 f6 je SHORT $LL11@gen_bitlen
+$LN12@gen_bitlen:
+
+; 537 : s->bl_count[bits]--; /* move one leaf down the tree */
+; 538 : s->bl_count[bits+1] += 2; /* move one overflow item as its brother */
+
+ 0016d 66 83 84 4b 3e
+ 0b 00 00 02 add WORD PTR [ebx+ecx*2+2878], 2
+ 00176 b8 ff ff 00 00 mov eax, 65535 ; 0000ffffH
+ 0017b 66 01 84 4b 3c
+ 0b 00 00 add WORD PTR [ebx+ecx*2+2876], ax
+
+; 539 : s->bl_count[max_length]--;
+; 540 : /* The brother of the overflow item also moves one step up,
+; 541 : * but this does not affect bl_count[max_length]
+; 542 : */
+; 543 : overflow -= 2;
+
+ 00183 83 ee 02 sub esi, 2
+ 00186 66 01 07 add WORD PTR [edi], ax
+
+; 544 : } while (overflow > 0);
+
+ 00189 85 f6 test esi, esi
+ 0018b 7f c4 jg SHORT $LL10@gen_bitlen
+
+; 545 :
+; 546 : /* Now recompute all bit lengths, scanning in increasing frequency.
+; 547 : * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
+; 548 : * lengths instead of fixing only the wrong ones. This idea is taken
+; 549 : * from 'ar' written by Haruhiko Okumura.)
+; 550 : */
+; 551 : for (bits = max_length; bits != 0; bits--) {
+
+ 0018d 8b 75 f8 mov esi, DWORD PTR _bits$3$[ebp]
+ 00190 8b 55 f4 mov edx, DWORD PTR _h$1$[ebp]
+ 00193 85 f6 test esi, esi
+ 00195 74 6e je SHORT $LN52@gen_bitlen
+$LL15@gen_bitlen:
+
+; 552 : n = s->bl_count[bits];
+
+ 00197 0f b7 07 movzx eax, WORD PTR [edi]
+
+; 553 : while (n != 0) {
+
+ 0019a 85 c0 test eax, eax
+ 0019c 74 5c je SHORT $LN13@gen_bitlen
+
+; 552 : n = s->bl_count[bits];
+
+ 0019e 8b 4d e8 mov ecx, DWORD PTR _max_code$1$[ebp]
+ 001a1 8d ba d7 02 00
+ 00 lea edi, DWORD PTR [edx+727]
+ 001a7 8d 3c bb lea edi, DWORD PTR [ebx+edi*4]
+ 001aa 66 0f 1f 44 00
+ 00 npad 6
+$LL16@gen_bitlen:
+
+; 554 : m = s->heap[--h];
+
+ 001b0 8b 5f fc mov ebx, DWORD PTR [edi-4]
+ 001b3 8d 7f fc lea edi, DWORD PTR [edi-4]
+ 001b6 4a dec edx
+ 001b7 89 55 f4 mov DWORD PTR _h$1$[ebp], edx
+
+; 555 : if (m > max_code) continue;
+
+ 001ba 3b d9 cmp ebx, ecx
+ 001bc 7f 32 jg SHORT $LN36@gen_bitlen
+
+; 556 : if ((unsigned) tree[m].Len != (unsigned) bits) {
+
+ 001be 8b 4d fc mov ecx, DWORD PTR _tree$1$[ebp]
+ 001c1 0f b7 4c 99 02 movzx ecx, WORD PTR [ecx+ebx*4+2]
+ 001c6 3b ce cmp ecx, esi
+ 001c8 74 22 je SHORT $LN24@gen_bitlen
+
+; 557 : Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
+; 558 : s->opt_len += ((long)bits - (long)tree[m].Len)
+
+ 001ca 8b d6 mov edx, esi
+ 001cc 2b d1 sub edx, ecx
+ 001ce 8b 4d fc mov ecx, DWORD PTR _tree$1$[ebp]
+ 001d1 0f b7 0c 99 movzx ecx, WORD PTR [ecx+ebx*4]
+ 001d5 0f af d1 imul edx, ecx
+ 001d8 8b 4d d4 mov ecx, DWORD PTR _s$1$[ebp]
+ 001db 01 91 a8 16 00
+ 00 add DWORD PTR [ecx+5800], edx
+
+; 559 : *(long)tree[m].Freq;
+; 560 : tree[m].Len = (ush)bits;
+
+ 001e1 8b 4d fc mov ecx, DWORD PTR _tree$1$[ebp]
+ 001e4 8b 55 f4 mov edx, DWORD PTR _h$1$[ebp]
+ 001e7 66 89 74 99 02 mov WORD PTR [ecx+ebx*4+2], si
+$LN24@gen_bitlen:
+
+; 561 : }
+; 562 : n--;
+
+ 001ec 8b 4d e8 mov ecx, DWORD PTR _max_code$1$[ebp]
+ 001ef 48 dec eax
+$LN36@gen_bitlen:
+
+; 553 : while (n != 0) {
+
+ 001f0 85 c0 test eax, eax
+ 001f2 75 bc jne SHORT $LL16@gen_bitlen
+ 001f4 8b 5d d4 mov ebx, DWORD PTR _s$1$[ebp]
+ 001f7 8b 7d d8 mov edi, DWORD PTR tv628[ebp]
+$LN13@gen_bitlen:
+
+; 545 :
+; 546 : /* Now recompute all bit lengths, scanning in increasing frequency.
+; 547 : * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
+; 548 : * lengths instead of fixing only the wrong ones. This idea is taken
+; 549 : * from 'ar' written by Haruhiko Okumura.)
+; 550 : */
+; 551 : for (bits = max_length; bits != 0; bits--) {
+
+ 001fa 83 ef 02 sub edi, 2
+ 001fd 89 7d d8 mov DWORD PTR tv628[ebp], edi
+ 00200 83 ee 01 sub esi, 1
+ 00203 75 92 jne SHORT $LL15@gen_bitlen
+$LN52@gen_bitlen:
+ 00205 5f pop edi
+$LN14@gen_bitlen:
+ 00206 5e pop esi
+ 00207 5b pop ebx
+
+; 563 : }
+; 564 : }
+; 565 : }
+
+ 00208 8b e5 mov esp, ebp
+ 0020a 5d pop ebp
+ 0020b c3 ret 0
+_gen_bitlen ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\trees.c
+; COMDAT _gen_codes
+_TEXT SEGMENT
+_next_code$ = -36 ; size = 32
+_tree$1$ = -4 ; size = 4
+_bl_count$ = 8 ; size = 4
+_gen_codes PROC ; COMDAT
+; _tree$ = ecx
+; _max_code$ = edx
+
+; 579 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 24 sub esp, 36 ; 00000024H
+ 00006 53 push ebx
+ 00007 56 push esi
+ 00008 8b da mov ebx, edx
+ 0000a 89 4d fc mov DWORD PTR _tree$1$[ebp], ecx
+
+; 580 : ush next_code[MAX_BITS+1]; /* next code value for each bit length */
+; 581 : ush code = 0; /* running code value */
+; 582 : int bits; /* bit index */
+; 583 : int n; /* code index */
+; 584 :
+; 585 : /* The distribution counts are first used to generate the code values
+; 586 : * without bit reversal.
+; 587 : */
+; 588 : for (bits = 1; bits <= MAX_BITS; bits++) {
+
+ 0000d 8b 55 08 mov edx, DWORD PTR _bl_count$[ebp]
+ 00010 8d 45 de lea eax, DWORD PTR _next_code$[ebp+2]
+ 00013 57 push edi
+ 00014 33 ff xor edi, edi
+ 00016 be 01 00 00 00 mov esi, 1
+ 0001b 2b d0 sub edx, eax
+ 0001d 0f 1f 00 npad 3
+$LL14@gen_codes:
+ 00020 8d 04 72 lea eax, DWORD PTR [edx+esi*2]
+
+; 589 : next_code[bits] = code = (code + bl_count[bits-1]) << 1;
+
+ 00023 66 8b 44 05 dc mov ax, WORD PTR _next_code$[ebp+eax]
+ 00028 66 03 c7 add ax, di
+ 0002b 66 03 c0 add ax, ax
+ 0002e 0f b7 f8 movzx edi, ax
+ 00031 66 89 7c 75 dc mov WORD PTR _next_code$[ebp+esi*2], di
+ 00036 46 inc esi
+ 00037 83 fe 0f cmp esi, 15 ; 0000000fH
+ 0003a 7e e4 jle SHORT $LL14@gen_codes
+
+; 590 : }
+; 591 : /* Check that the bit counts in bl_count are consistent. The last code
+; 592 : * must be all ones.
+; 593 : */
+; 594 : Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
+; 595 : "inconsistent bit counts");
+; 596 : Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
+; 597 :
+; 598 : for (n = 0; n <= max_code; n++) {
+
+ 0003c 33 f6 xor esi, esi
+ 0003e 85 db test ebx, ebx
+ 00040 78 27 js SHORT $LN6@gen_codes
+$LL7@gen_codes:
+
+; 599 : int len = tree[n].Len;
+
+ 00042 0f b7 54 b1 02 movzx edx, WORD PTR [ecx+esi*4+2]
+
+; 600 : if (len == 0) continue;
+
+ 00047 85 d2 test edx, edx
+ 00049 74 19 je SHORT $LN5@gen_codes
+
+; 601 : /* Now reverse the bits */
+; 602 : tree[n].Code = bi_reverse(next_code[len]++, len);
+
+ 0004b 0f b7 44 55 dc movzx eax, WORD PTR _next_code$[ebp+edx*2]
+ 00050 8b c8 mov ecx, eax
+ 00052 40 inc eax
+ 00053 66 89 44 55 dc mov WORD PTR _next_code$[ebp+edx*2], ax
+ 00058 e8 00 00 00 00 call _bi_reverse
+ 0005d 8b 4d fc mov ecx, DWORD PTR _tree$1$[ebp]
+ 00060 66 89 04 b1 mov WORD PTR [ecx+esi*4], ax
+$LN5@gen_codes:
+
+; 590 : }
+; 591 : /* Check that the bit counts in bl_count are consistent. The last code
+; 592 : * must be all ones.
+; 593 : */
+; 594 : Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
+; 595 : "inconsistent bit counts");
+; 596 : Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
+; 597 :
+; 598 : for (n = 0; n <= max_code; n++) {
+
+ 00064 46 inc esi
+ 00065 3b f3 cmp esi, ebx
+ 00067 7e d9 jle SHORT $LL7@gen_codes
+$LN6@gen_codes:
+ 00069 5f pop edi
+ 0006a 5e pop esi
+ 0006b 5b pop ebx
+
+; 603 :
+; 604 : Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
+; 605 : n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
+; 606 : }
+; 607 : }
+
+ 0006c 8b e5 mov esp, ebp
+ 0006e 5d pop ebp
+ 0006f c3 ret 0
+_gen_codes ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\trees.c
+; COMDAT _build_tree
+_TEXT SEGMENT
+tv503 = -16 ; size = 4
+_stree$1$ = -16 ; size = 4
+_desc$1$ = -12 ; size = 4
+_node$2$ = -8 ; size = 4
+_max_code$1$ = -4 ; size = 4
+_build_tree PROC ; COMDAT
+; _s$ = ecx
+; _desc$ = edx
+
+; 620 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 10 sub esp, 16 ; 00000010H
+ 00006 8b c2 mov eax, edx
+
+; 621 : ct_data *tree = desc->dyn_tree;
+; 622 : const ct_data *stree = desc->stat_desc->static_tree;
+; 623 : int elems = desc->stat_desc->elems;
+; 624 : int n, m; /* iterate over heap elements */
+; 625 : int max_code = -1; /* largest code with non zero frequency */
+
+ 00008 83 ca ff or edx, -1
+ 0000b 53 push ebx
+ 0000c 89 45 f4 mov DWORD PTR _desc$1$[ebp], eax
+ 0000f 56 push esi
+ 00010 8b 18 mov ebx, DWORD PTR [eax]
+ 00012 8b f1 mov esi, ecx
+ 00014 8b 40 08 mov eax, DWORD PTR [eax+8]
+ 00017 57 push edi
+ 00018 89 55 fc mov DWORD PTR _max_code$1$[ebp], edx
+ 0001b 8b 08 mov ecx, DWORD PTR [eax]
+ 0001d 8b 78 0c mov edi, DWORD PTR [eax+12]
+ 00020 89 4d f0 mov DWORD PTR _stree$1$[ebp], ecx
+
+; 626 : int node; /* new node being created */
+; 627 :
+; 628 : /* Construct the initial heap, with least frequent element in
+; 629 : * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
+; 630 : * heap[0] is not used.
+; 631 : */
+; 632 : s->heap_len = 0, s->heap_max = HEAP_SIZE;
+; 633 :
+; 634 : for (n = 0; n < elems; n++) {
+
+ 00023 33 c9 xor ecx, ecx
+ 00025 89 7d f8 mov DWORD PTR _node$2$[ebp], edi
+ 00028 c7 86 50 14 00
+ 00 00 00 00 00 mov DWORD PTR [esi+5200], 0
+ 00032 c7 86 54 14 00
+ 00 3d 02 00 00 mov DWORD PTR [esi+5204], 573 ; 0000023dH
+ 0003c 85 ff test edi, edi
+ 0003e 7e 35 jle SHORT $LN22@build_tree
+$LL4@build_tree:
+
+; 635 : if (tree[n].Freq != 0) {
+
+ 00040 66 83 3c 8b 00 cmp WORD PTR [ebx+ecx*4], 0
+ 00045 74 1f je SHORT $LN13@build_tree
+
+; 636 : s->heap[++(s->heap_len)] = max_code = n;
+
+ 00047 ff 86 50 14 00
+ 00 inc DWORD PTR [esi+5200]
+ 0004d 8b d1 mov edx, ecx
+ 0004f 8b 86 50 14 00
+ 00 mov eax, DWORD PTR [esi+5200]
+ 00055 89 8c 86 5c 0b
+ 00 00 mov DWORD PTR [esi+eax*4+2908], ecx
+
+; 637 : s->depth[n] = 0;
+
+ 0005c c6 84 31 58 14
+ 00 00 00 mov BYTE PTR [ecx+esi+5208], 0
+
+; 638 : } else {
+
+ 00064 eb 07 jmp SHORT $LN2@build_tree
+$LN13@build_tree:
+
+; 639 : tree[n].Len = 0;
+
+ 00066 33 c0 xor eax, eax
+ 00068 66 89 44 8b 02 mov WORD PTR [ebx+ecx*4+2], ax
+$LN2@build_tree:
+
+; 626 : int node; /* new node being created */
+; 627 :
+; 628 : /* Construct the initial heap, with least frequent element in
+; 629 : * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
+; 630 : * heap[0] is not used.
+; 631 : */
+; 632 : s->heap_len = 0, s->heap_max = HEAP_SIZE;
+; 633 :
+; 634 : for (n = 0; n < elems; n++) {
+
+ 0006d 41 inc ecx
+ 0006e 3b cf cmp ecx, edi
+ 00070 7c ce jl SHORT $LL4@build_tree
+ 00072 89 55 fc mov DWORD PTR _max_code$1$[ebp], edx
+$LN22@build_tree:
+
+; 640 : }
+; 641 : }
+; 642 :
+; 643 : /* The pkzip format requires that at least one distance code exists,
+; 644 : * and that at least one bit should be sent even if there is only one
+; 645 : * possible code. So to avoid special checks later on we force at least
+; 646 : * two codes of non zero frequency.
+; 647 : */
+; 648 : while (s->heap_len < 2) {
+
+ 00075 83 be 50 14 00
+ 00 02 cmp DWORD PTR [esi+5200], 2
+ 0007c 7d 54 jge SHORT $LN6@build_tree
+ 0007e bf 01 00 00 00 mov edi, 1
+$LL5@build_tree:
+
+; 649 : node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);
+
+ 00083 83 fa 02 cmp edx, 2
+ 00086 7d 05 jge SHORT $LN17@build_tree
+ 00088 42 inc edx
+ 00089 8b ca mov ecx, edx
+ 0008b eb 02 jmp SHORT $LN18@build_tree
+$LN17@build_tree:
+ 0008d 33 c9 xor ecx, ecx
+$LN18@build_tree:
+ 0008f ff 86 50 14 00
+ 00 inc DWORD PTR [esi+5200]
+ 00095 8b 86 50 14 00
+ 00 mov eax, DWORD PTR [esi+5200]
+ 0009b 89 8c 86 5c 0b
+ 00 00 mov DWORD PTR [esi+eax*4+2908], ecx
+
+; 650 : tree[node].Freq = 1;
+; 651 : s->depth[node] = 0;
+; 652 : s->opt_len--; if (stree) s->static_len -= stree[node].Len;
+
+ 000a2 8b 45 f0 mov eax, DWORD PTR _stree$1$[ebp]
+ 000a5 66 89 3c 8b mov WORD PTR [ebx+ecx*4], di
+ 000a9 c6 84 0e 58 14
+ 00 00 00 mov BYTE PTR [esi+ecx+5208], 0
+ 000b1 ff 8e a8 16 00
+ 00 dec DWORD PTR [esi+5800]
+ 000b7 85 c0 test eax, eax
+ 000b9 74 0b je SHORT $LN15@build_tree
+ 000bb 0f b7 44 88 02 movzx eax, WORD PTR [eax+ecx*4+2]
+ 000c0 29 86 ac 16 00
+ 00 sub DWORD PTR [esi+5804], eax
+$LN15@build_tree:
+
+; 640 : }
+; 641 : }
+; 642 :
+; 643 : /* The pkzip format requires that at least one distance code exists,
+; 644 : * and that at least one bit should be sent even if there is only one
+; 645 : * possible code. So to avoid special checks later on we force at least
+; 646 : * two codes of non zero frequency.
+; 647 : */
+; 648 : while (s->heap_len < 2) {
+
+ 000c6 83 be 50 14 00
+ 00 02 cmp DWORD PTR [esi+5200], 2
+ 000cd 7c b4 jl SHORT $LL5@build_tree
+ 000cf 89 55 fc mov DWORD PTR _max_code$1$[ebp], edx
+$LN6@build_tree:
+
+; 653 : /* node is 0 or 1 so it does not have extra bits */
+; 654 : }
+; 655 : desc->max_code = max_code;
+
+ 000d2 8b 45 f4 mov eax, DWORD PTR _desc$1$[ebp]
+ 000d5 89 50 04 mov DWORD PTR [eax+4], edx
+
+; 656 :
+; 657 : /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
+; 658 : * establish sub-heaps of increasing lengths:
+; 659 : */
+; 660 : for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);
+
+ 000d8 8b 86 50 14 00
+ 00 mov eax, DWORD PTR [esi+5200]
+ 000de 99 cdq
+ 000df 2b c2 sub eax, edx
+ 000e1 8b f8 mov edi, eax
+ 000e3 d1 ff sar edi, 1
+ 000e5 83 ff 01 cmp edi, 1
+ 000e8 7c 26 jl SHORT $LL12@build_tree
+ 000ea 66 0f 1f 44 00
+ 00 npad 6
+$LL9@build_tree:
+ 000f0 57 push edi
+ 000f1 8b d3 mov edx, ebx
+ 000f3 8b ce mov ecx, esi
+ 000f5 e8 00 00 00 00 call _pqdownheap
+ 000fa 4f dec edi
+ 000fb 83 c4 04 add esp, 4
+ 000fe 83 ff 01 cmp edi, 1
+ 00101 7d ed jge SHORT $LL9@build_tree
+ 00103 0f 1f 40 00 66
+ 0f 1f 84 00 00
+ 00 00 00 npad 13
+$LL12@build_tree:
+
+; 661 :
+; 662 : /* Construct the Huffman tree by repeatedly combining the least two
+; 663 : * frequent nodes.
+; 664 : */
+; 665 : node = elems; /* next internal node of the tree */
+; 666 : do {
+; 667 : pqremove(s, tree, n); /* n = node of least frequency */
+
+ 00110 8b 86 50 14 00
+ 00 mov eax, DWORD PTR [esi+5200]
+ 00116 8b d3 mov edx, ebx
+ 00118 8b be 60 0b 00
+ 00 mov edi, DWORD PTR [esi+2912]
+ 0011e 8b ce mov ecx, esi
+ 00120 6a 01 push 1
+ 00122 8b 84 86 5c 0b
+ 00 00 mov eax, DWORD PTR [esi+eax*4+2908]
+ 00129 89 86 60 0b 00
+ 00 mov DWORD PTR [esi+2912], eax
+ 0012f ff 8e 50 14 00
+ 00 dec DWORD PTR [esi+5200]
+ 00135 e8 00 00 00 00 call _pqdownheap
+
+; 668 : m = s->heap[SMALLEST]; /* m = node of next least frequency */
+
+ 0013a 8b 8e 60 0b 00
+ 00 mov ecx, DWORD PTR [esi+2912]
+ 00140 83 c4 04 add esp, 4
+
+; 669 :
+; 670 : s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */
+
+ 00143 ff 8e 54 14 00
+ 00 dec DWORD PTR [esi+5204]
+ 00149 8b 86 54 14 00
+ 00 mov eax, DWORD PTR [esi+5204]
+
+; 671 : s->heap[--(s->heap_max)] = m;
+; 672 :
+; 673 : /* Create a new node father of n and m */
+; 674 : tree[node].Freq = tree[n].Freq + tree[m].Freq;
+
+ 0014f 8b 55 f8 mov edx, DWORD PTR _node$2$[ebp]
+ 00152 89 bc 86 5c 0b
+ 00 00 mov DWORD PTR [esi+eax*4+2908], edi
+ 00159 ff 8e 54 14 00
+ 00 dec DWORD PTR [esi+5204]
+ 0015f 8b 86 54 14 00
+ 00 mov eax, DWORD PTR [esi+5204]
+ 00165 89 8c 86 5c 0b
+ 00 00 mov DWORD PTR [esi+eax*4+2908], ecx
+ 0016c 8d 04 8b lea eax, DWORD PTR [ebx+ecx*4]
+ 0016f 89 45 f0 mov DWORD PTR tv503[ebp], eax
+ 00172 66 8b 00 mov ax, WORD PTR [eax]
+ 00175 66 03 04 bb add ax, WORD PTR [ebx+edi*4]
+ 00179 66 89 04 93 mov WORD PTR [ebx+edx*4], ax
+
+; 675 : s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ?
+
+ 0017d 8a 84 3e 58 14
+ 00 00 mov al, BYTE PTR [esi+edi+5208]
+ 00184 8a 8c 0e 58 14
+ 00 00 mov cl, BYTE PTR [esi+ecx+5208]
+ 0018b 3a c1 cmp al, cl
+ 0018d 0f b6 c0 movzx eax, al
+ 00190 73 03 jae SHORT $LN20@build_tree
+ 00192 0f b6 c1 movzx eax, cl
+$LN20@build_tree:
+
+; 676 : s->depth[n] : s->depth[m]) + 1);
+; 677 : tree[n].Dad = tree[m].Dad = (ush)node;
+
+ 00195 8b 4d f0 mov ecx, DWORD PTR tv503[ebp]
+ 00198 fe c0 inc al
+ 0019a 88 84 16 58 14
+ 00 00 mov BYTE PTR [esi+edx+5208], al
+ 001a1 0f b7 c2 movzx eax, dx
+
+; 678 : #ifdef DUMP_BL_TREE
+; 679 : if (tree == s->bl_tree) {
+; 680 : fprintf(stderr,"\nnode %d(%d), sons %d(%d) %d(%d)",
+; 681 : node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq);
+; 682 : }
+; 683 : #endif
+; 684 : /* and insert the new node in the heap */
+; 685 : s->heap[SMALLEST] = node++;
+; 686 : pqdownheap(s, tree, SMALLEST);
+
+ 001a4 6a 01 push 1
+ 001a6 66 89 41 02 mov WORD PTR [ecx+2], ax
+ 001aa 8b ce mov ecx, esi
+ 001ac 66 89 44 bb 02 mov WORD PTR [ebx+edi*4+2], ax
+ 001b1 89 96 60 0b 00
+ 00 mov DWORD PTR [esi+2912], edx
+ 001b7 42 inc edx
+ 001b8 89 55 f8 mov DWORD PTR _node$2$[ebp], edx
+ 001bb 8b d3 mov edx, ebx
+ 001bd e8 00 00 00 00 call _pqdownheap
+ 001c2 83 c4 04 add esp, 4
+
+; 687 :
+; 688 : } while (s->heap_len >= 2);
+
+ 001c5 83 be 50 14 00
+ 00 02 cmp DWORD PTR [esi+5200], 2
+ 001cc 0f 8d 3e ff ff
+ ff jge $LL12@build_tree
+
+; 689 :
+; 690 : s->heap[--(s->heap_max)] = s->heap[SMALLEST];
+
+ 001d2 ff 8e 54 14 00
+ 00 dec DWORD PTR [esi+5204]
+ 001d8 8b be 54 14 00
+ 00 mov edi, DWORD PTR [esi+5204]
+ 001de 8b 86 60 0b 00
+ 00 mov eax, DWORD PTR [esi+2912]
+
+; 691 :
+; 692 : /* At this point, the fields freq and dad are set. We can now
+; 693 : * generate the bit lengths.
+; 694 : */
+; 695 : gen_bitlen(s, (tree_desc *)desc);
+
+ 001e4 8b 55 f4 mov edx, DWORD PTR _desc$1$[ebp]
+ 001e7 89 84 be 5c 0b
+ 00 00 mov DWORD PTR [esi+edi*4+2908], eax
+ 001ee e8 00 00 00 00 call _gen_bitlen
+
+; 696 :
+; 697 : /* The field len is now set, we can generate the bit codes */
+; 698 : gen_codes ((ct_data *)tree, max_code, s->bl_count);
+
+ 001f3 8b 55 fc mov edx, DWORD PTR _max_code$1$[ebp]
+ 001f6 81 c6 3c 0b 00
+ 00 add esi, 2876 ; 00000b3cH
+ 001fc 56 push esi
+ 001fd 8b cb mov ecx, ebx
+ 001ff e8 00 00 00 00 call _gen_codes
+ 00204 83 c4 04 add esp, 4
+ 00207 5f pop edi
+ 00208 5e pop esi
+ 00209 5b pop ebx
+
+; 699 : }
+
+ 0020a 8b e5 mov esp, ebp
+ 0020c 5d pop ebp
+ 0020d c3 ret 0
+_build_tree ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\trees.c
+; COMDAT _scan_tree
+_TEXT SEGMENT
+_s$1$ = -12 ; size = 4
+_prevlen$1$ = -8 ; size = 4
+tv326 = -4 ; size = 4
+_tree$1$ = -4 ; size = 4
+tv333 = 8 ; size = 4
+_max_code$ = 8 ; size = 4
+_scan_tree PROC ; COMDAT
+; _s$ = ecx
+; _tree$ = edx
+
+; 709 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 0c sub esp, 12 ; 0000000cH
+ 00006 53 push ebx
+ 00007 8b c2 mov eax, edx
+ 00009 89 4d f4 mov DWORD PTR _s$1$[ebp], ecx
+ 0000c 56 push esi
+
+; 710 : int n; /* iterates over all tree elements */
+; 711 : int prevlen = -1; /* last emitted length */
+; 712 : int curlen; /* length of current code */
+; 713 : int nextlen = tree[0].Len; /* length of next code */
+; 714 : int count = 0; /* repeat count of the current code */
+
+ 0000d 33 f6 xor esi, esi
+ 0000f 89 45 fc mov DWORD PTR _tree$1$[ebp], eax
+ 00012 57 push edi
+ 00013 0f b7 58 02 movzx ebx, WORD PTR [eax+2]
+ 00017 c7 45 f8 ff ff
+ ff ff mov DWORD PTR _prevlen$1$[ebp], -1
+
+; 715 : int max_count = 7; /* max repeat count */
+
+ 0001e 8d 56 07 lea edx, DWORD PTR [esi+7]
+
+; 716 : int min_count = 4; /* min repeat count */
+
+ 00021 8d 7e 04 lea edi, DWORD PTR [esi+4]
+
+; 717 :
+; 718 : if (nextlen == 0) max_count = 138, min_count = 3;
+
+ 00024 85 db test ebx, ebx
+ 00026 75 08 jne SHORT $LN5@scan_tree
+ 00028 ba 8a 00 00 00 mov edx, 138 ; 0000008aH
+ 0002d 8d 7e 03 lea edi, DWORD PTR [esi+3]
+$LN5@scan_tree:
+
+; 719 : tree[max_code+1].Len = (ush)0xffff; /* guard */
+
+ 00030 8b 45 08 mov eax, DWORD PTR _max_code$[ebp]
+ 00033 be ff ff 00 00 mov esi, 65535 ; 0000ffffH
+ 00038 8b 4d fc mov ecx, DWORD PTR _tree$1$[ebp]
+ 0003b 66 89 74 81 06 mov WORD PTR [ecx+eax*4+6], si
+
+; 720 :
+; 721 : for (n = 0; n <= max_code; n++) {
+
+ 00040 be 00 00 00 00 mov esi, 0
+ 00045 8b 4d f4 mov ecx, DWORD PTR _s$1$[ebp]
+ 00048 85 c0 test eax, eax
+ 0004a 0f 88 95 00 00
+ 00 js $LN3@scan_tree
+
+; 719 : tree[max_code+1].Len = (ush)0xffff; /* guard */
+
+ 00050 8b 45 fc mov eax, DWORD PTR _tree$1$[ebp]
+ 00053 83 c0 06 add eax, 6
+ 00056 89 45 fc mov DWORD PTR tv326[ebp], eax
+ 00059 8b 45 08 mov eax, DWORD PTR _max_code$[ebp]
+ 0005c 40 inc eax
+ 0005d 89 45 08 mov DWORD PTR tv333[ebp], eax
+$LL4@scan_tree:
+
+; 722 : curlen = nextlen; nextlen = tree[n+1].Len;
+
+ 00060 8b c3 mov eax, ebx
+
+; 723 : if (++count < max_count && curlen == nextlen) {
+
+ 00062 46 inc esi
+ 00063 8b 5d fc mov ebx, DWORD PTR tv326[ebp]
+ 00066 0f b7 1b movzx ebx, WORD PTR [ebx]
+ 00069 3b f2 cmp esi, edx
+ 0006b 7d 04 jge SHORT $LN6@scan_tree
+ 0006d 3b c3 cmp eax, ebx
+ 0006f 74 66 je SHORT $LN2@scan_tree
+$LN6@scan_tree:
+
+; 724 : continue;
+; 725 : } else if (count < min_count) {
+
+ 00071 3b f7 cmp esi, edi
+ 00073 7d 0a jge SHORT $LN8@scan_tree
+
+; 726 : s->bl_tree[curlen].Freq += count;
+
+ 00075 66 01 b4 81 7c
+ 0a 00 00 add WORD PTR [ecx+eax*4+2684], si
+ 0007d eb 2f jmp SHORT $LN14@scan_tree
+$LN8@scan_tree:
+
+; 727 : } else if (curlen != 0) {
+
+ 0007f 85 c0 test eax, eax
+ 00081 74 16 je SHORT $LN10@scan_tree
+
+; 728 : if (curlen != prevlen) s->bl_tree[curlen].Freq++;
+
+ 00083 3b 45 f8 cmp eax, DWORD PTR _prevlen$1$[ebp]
+ 00086 74 08 je SHORT $LN12@scan_tree
+ 00088 66 ff 84 81 7c
+ 0a 00 00 inc WORD PTR [ecx+eax*4+2684]
+$LN12@scan_tree:
+
+; 729 : s->bl_tree[REP_3_6].Freq++;
+
+ 00090 66 ff 81 bc 0a
+ 00 00 inc WORD PTR [ecx+2748]
+ 00097 eb 15 jmp SHORT $LN14@scan_tree
+$LN10@scan_tree:
+
+; 730 : } else if (count <= 10) {
+
+ 00099 83 fe 0a cmp esi, 10 ; 0000000aH
+ 0009c 7f 09 jg SHORT $LN13@scan_tree
+
+; 731 : s->bl_tree[REPZ_3_10].Freq++;
+
+ 0009e 66 ff 81 c0 0a
+ 00 00 inc WORD PTR [ecx+2752]
+
+; 732 : } else {
+
+ 000a5 eb 07 jmp SHORT $LN14@scan_tree
+$LN13@scan_tree:
+
+; 733 : s->bl_tree[REPZ_11_138].Freq++;
+
+ 000a7 66 ff 81 c4 0a
+ 00 00 inc WORD PTR [ecx+2756]
+$LN14@scan_tree:
+
+; 734 : }
+; 735 : count = 0; prevlen = curlen;
+
+ 000ae 33 f6 xor esi, esi
+ 000b0 89 45 f8 mov DWORD PTR _prevlen$1$[ebp], eax
+
+; 736 : if (nextlen == 0) {
+
+ 000b3 85 db test ebx, ebx
+ 000b5 75 0a jne SHORT $LN15@scan_tree
+
+; 737 : max_count = 138, min_count = 3;
+
+ 000b7 ba 8a 00 00 00 mov edx, 138 ; 0000008aH
+ 000bc 8d 7e 03 lea edi, DWORD PTR [esi+3]
+ 000bf eb 16 jmp SHORT $LN2@scan_tree
+$LN15@scan_tree:
+
+; 738 : } else if (curlen == nextlen) {
+
+ 000c1 3b c3 cmp eax, ebx
+ 000c3 75 0a jne SHORT $LN17@scan_tree
+
+; 739 : max_count = 6, min_count = 3;
+
+ 000c5 ba 06 00 00 00 mov edx, 6
+ 000ca 8d 7a fd lea edi, DWORD PTR [edx-3]
+
+; 740 : } else {
+
+ 000cd eb 08 jmp SHORT $LN2@scan_tree
+$LN17@scan_tree:
+
+; 741 : max_count = 7, min_count = 4;
+
+ 000cf ba 07 00 00 00 mov edx, 7
+ 000d4 8d 7a fd lea edi, DWORD PTR [edx-3]
+$LN2@scan_tree:
+
+; 720 :
+; 721 : for (n = 0; n <= max_code; n++) {
+
+ 000d7 83 45 fc 04 add DWORD PTR tv326[ebp], 4
+ 000db 83 6d 08 01 sub DWORD PTR tv333[ebp], 1
+ 000df 0f 85 7b ff ff
+ ff jne $LL4@scan_tree
+$LN3@scan_tree:
+ 000e5 5f pop edi
+ 000e6 5e pop esi
+ 000e7 5b pop ebx
+
+; 742 : }
+; 743 : }
+; 744 : }
+
+ 000e8 8b e5 mov esp, ebp
+ 000ea 5d pop ebp
+ 000eb c3 ret 0
+_scan_tree ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\trees.c
+; COMDAT _send_tree
+_TEXT SEGMENT
+tv1077 = -28 ; size = 4
+_len$1$ = -28 ; size = 4
+_len$1$ = -28 ; size = 4
+_len$1$ = -28 ; size = 4
+_len$1$ = -28 ; size = 4
+tv1063 = -24 ; size = 4
+_len$1$ = -20 ; size = 4
+tv1078 = -16 ; size = 4
+_tree$1$ = -16 ; size = 4
+_curlen$1$ = -12 ; size = 4
+_s$1$ = -8 ; size = 4
+tv1032 = -4 ; size = 4
+_nextlen$1$ = 8 ; size = 4
+_max_code$ = 8 ; size = 4
+_send_tree PROC ; COMDAT
+; _s$ = ecx
+; _tree$ = edx
+
+; 754 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 1c sub esp, 28 ; 0000001cH
+ 00006 53 push ebx
+ 00007 8b da mov ebx, edx
+ 00009 89 4d f8 mov DWORD PTR _s$1$[ebp], ecx
+
+; 755 : int n; /* iterates over all tree elements */
+; 756 : int prevlen = -1; /* last emitted length */
+
+ 0000c 83 ca ff or edx, -1
+ 0000f 89 5d f0 mov DWORD PTR _tree$1$[ebp], ebx
+ 00012 56 push esi
+ 00013 57 push edi
+
+; 757 : int curlen; /* length of current code */
+; 758 : int nextlen = tree[0].Len; /* length of next code */
+
+ 00014 0f b7 4b 02 movzx ecx, WORD PTR [ebx+2]
+
+; 759 : int count = 0; /* repeat count of the current code */
+
+ 00018 33 db xor ebx, ebx
+
+; 760 : int max_count = 7; /* max repeat count */
+
+ 0001a 8d 7a 08 lea edi, DWORD PTR [edx+8]
+
+; 761 : int min_count = 4; /* min repeat count */
+
+ 0001d 8d 72 05 lea esi, DWORD PTR [edx+5]
+
+; 762 :
+; 763 : /* tree[max_code+1].Len = -1; */ /* guard already set */
+; 764 : if (nextlen == 0) max_count = 138, min_count = 3;
+
+ 00020 85 c9 test ecx, ecx
+ 00022 75 08 jne SHORT $LN8@send_tree
+ 00024 bf 8a 00 00 00 mov edi, 138 ; 0000008aH
+ 00029 8d 72 04 lea esi, DWORD PTR [edx+4]
+$LN8@send_tree:
+
+; 765 :
+; 766 : for (n = 0; n <= max_code; n++) {
+
+ 0002c 39 5d 08 cmp DWORD PTR _max_code$[ebp], ebx
+ 0002f 0f 8c d9 04 00
+ 00 jl $LN3@send_tree
+ 00035 8b 45 f0 mov eax, DWORD PTR _tree$1$[ebp]
+ 00038 83 c0 06 add eax, 6
+ 0003b 89 45 fc mov DWORD PTR tv1032[ebp], eax
+ 0003e 8b 45 08 mov eax, DWORD PTR _max_code$[ebp]
+ 00041 40 inc eax
+ 00042 89 45 f0 mov DWORD PTR tv1078[ebp], eax
+$LL4@send_tree:
+
+; 767 : curlen = nextlen; nextlen = tree[n+1].Len;
+
+ 00045 8b 45 fc mov eax, DWORD PTR tv1032[ebp]
+
+; 768 : if (++count < max_count && curlen == nextlen) {
+
+ 00048 43 inc ebx
+ 00049 89 4d f4 mov DWORD PTR _curlen$1$[ebp], ecx
+ 0004c 0f b7 08 movzx ecx, WORD PTR [eax]
+ 0004f 8b 45 f8 mov eax, DWORD PTR _s$1$[ebp]
+ 00052 89 4d 08 mov DWORD PTR _nextlen$1$[ebp], ecx
+ 00055 8b 4d f4 mov ecx, DWORD PTR _curlen$1$[ebp]
+ 00058 3b df cmp ebx, edi
+ 0005a 7d 09 jge SHORT $LN9@send_tree
+ 0005c 3b 4d 08 cmp ecx, DWORD PTR _nextlen$1$[ebp]
+ 0005f 0f 84 98 04 00
+ 00 je $LN2@send_tree
+$LN9@send_tree:
+
+; 769 : continue;
+; 770 : } else if (count < min_count) {
+
+ 00065 3b de cmp ebx, esi
+ 00067 0f 8d b9 00 00
+ 00 jge $LN11@send_tree
+ 0006d 8d 14 8d 7e 0a
+ 00 00 lea edx, DWORD PTR [ecx*4+2686]
+ 00074 8d b9 9f 02 00
+ 00 lea edi, DWORD PTR [ecx+671]
+ 0007a 03 d0 add edx, eax
+ 0007c 8d 3c b8 lea edi, DWORD PTR [eax+edi*4]
+ 0007f 89 55 e4 mov DWORD PTR tv1077[ebp], edx
+ 00082 89 7d e8 mov DWORD PTR tv1063[ebp], edi
+ 00085 66 66 66 0f 1f
+ 84 00 00 00 00
+ 00 npad 11
+$LL7@send_tree:
+
+; 771 : do { send_code(s, curlen, s->bl_tree); } while (--count != 0);
+
+ 00090 0f b7 32 movzx esi, WORD PTR [edx]
+ 00093 ba 10 00 00 00 mov edx, 16 ; 00000010H
+ 00098 8b 88 bc 16 00
+ 00 mov ecx, DWORD PTR [eax+5820]
+ 0009e 2b d6 sub edx, esi
+ 000a0 89 75 ec mov DWORD PTR _len$1$[ebp], esi
+ 000a3 3b ca cmp ecx, edx
+ 000a5 7e 59 jle SHORT $LN13@send_tree
+ 000a7 0f b7 3f movzx edi, WORD PTR [edi]
+ 000aa 8b 70 08 mov esi, DWORD PTR [eax+8]
+ 000ad 66 8b d7 mov dx, di
+ 000b0 66 d3 e2 shl dx, cl
+ 000b3 66 09 90 b8 16
+ 00 00 or WORD PTR [eax+5816], dx
+ 000ba 8b 50 14 mov edx, DWORD PTR [eax+20]
+ 000bd 0f b6 88 b8 16
+ 00 00 movzx ecx, BYTE PTR [eax+5816]
+ 000c4 88 0c 16 mov BYTE PTR [esi+edx], cl
+ 000c7 ff 40 14 inc DWORD PTR [eax+20]
+ 000ca 8b 70 14 mov esi, DWORD PTR [eax+20]
+ 000cd 8b 50 08 mov edx, DWORD PTR [eax+8]
+ 000d0 0f b6 88 b9 16
+ 00 00 movzx ecx, BYTE PTR [eax+5817]
+ 000d7 88 0c 16 mov BYTE PTR [esi+edx], cl
+ 000da b1 10 mov cl, 16 ; 00000010H
+ 000dc 2a 88 bc 16 00
+ 00 sub cl, BYTE PTR [eax+5820]
+ 000e2 ff 40 14 inc DWORD PTR [eax+20]
+ 000e5 66 d3 ef shr di, cl
+ 000e8 8b 4d ec mov ecx, DWORD PTR _len$1$[ebp]
+ 000eb 83 c1 f0 add ecx, -16 ; fffffff0H
+ 000ee 66 89 b8 b8 16
+ 00 00 mov WORD PTR [eax+5816], di
+ 000f5 01 88 bc 16 00
+ 00 add DWORD PTR [eax+5820], ecx
+ 000fb 8b 7d e8 mov edi, DWORD PTR tv1063[ebp]
+ 000fe eb 15 jmp SHORT $LN5@send_tree
+$LN13@send_tree:
+ 00100 66 8b 17 mov dx, WORD PTR [edi]
+ 00103 66 d3 e2 shl dx, cl
+ 00106 66 09 90 b8 16
+ 00 00 or WORD PTR [eax+5816], dx
+ 0010d 03 ce add ecx, esi
+ 0010f 89 88 bc 16 00
+ 00 mov DWORD PTR [eax+5820], ecx
+$LN5@send_tree:
+ 00115 8b 55 e4 mov edx, DWORD PTR tv1077[ebp]
+ 00118 83 eb 01 sub ebx, 1
+ 0011b 0f 85 6f ff ff
+ ff jne $LL7@send_tree
+
+; 772 :
+; 773 : } else if (curlen != 0) {
+
+ 00121 e9 a9 03 00 00 jmp $LN33@send_tree
+$LN11@send_tree:
+ 00126 85 c9 test ecx, ecx
+ 00128 0f 84 a1 01 00
+ 00 je $LN15@send_tree
+
+; 774 : if (curlen != prevlen) {
+
+ 0012e 3b ca cmp ecx, edx
+ 00130 0f 84 97 00 00
+ 00 je $LN17@send_tree
+
+; 775 : send_code(s, curlen, s->bl_tree); count--;
+
+ 00136 0f b7 bc 88 7e
+ 0a 00 00 movzx edi, WORD PTR [eax+ecx*4+2686]
+ 0013e ba 10 00 00 00 mov edx, 16 ; 00000010H
+ 00143 8b b0 bc 16 00
+ 00 mov esi, DWORD PTR [eax+5820]
+ 00149 2b d7 sub edx, edi
+ 0014b 89 7d e4 mov DWORD PTR _len$1$[ebp], edi
+ 0014e 3b f2 cmp esi, edx
+ 00150 7e 5d jle SHORT $LN18@send_tree
+ 00152 0f b7 bc 88 7c
+ 0a 00 00 movzx edi, WORD PTR [eax+ecx*4+2684]
+ 0015a 8b ce mov ecx, esi
+ 0015c 8b 70 08 mov esi, DWORD PTR [eax+8]
+ 0015f 66 8b d7 mov dx, di
+ 00162 66 d3 e2 shl dx, cl
+ 00165 66 09 90 b8 16
+ 00 00 or WORD PTR [eax+5816], dx
+ 0016c 8b 50 14 mov edx, DWORD PTR [eax+20]
+ 0016f 0f b6 88 b8 16
+ 00 00 movzx ecx, BYTE PTR [eax+5816]
+ 00176 88 0c 16 mov BYTE PTR [esi+edx], cl
+ 00179 ff 40 14 inc DWORD PTR [eax+20]
+ 0017c 8b 70 14 mov esi, DWORD PTR [eax+20]
+ 0017f 8b 50 08 mov edx, DWORD PTR [eax+8]
+ 00182 0f b6 88 b9 16
+ 00 00 movzx ecx, BYTE PTR [eax+5817]
+ 00189 88 0c 16 mov BYTE PTR [esi+edx], cl
+ 0018c b1 10 mov cl, 16 ; 00000010H
+ 0018e 2a 88 bc 16 00
+ 00 sub cl, BYTE PTR [eax+5820]
+ 00194 ff 40 14 inc DWORD PTR [eax+20]
+ 00197 66 d3 ef shr di, cl
+ 0019a 8b 4d e4 mov ecx, DWORD PTR _len$1$[ebp]
+ 0019d 83 c1 f0 add ecx, -16 ; fffffff0H
+ 001a0 66 89 b8 b8 16
+ 00 00 mov WORD PTR [eax+5816], di
+ 001a7 01 88 bc 16 00
+ 00 add DWORD PTR [eax+5820], ecx
+ 001ad eb 1d jmp SHORT $LN19@send_tree
+$LN18@send_tree:
+ 001af 66 8b 94 88 7c
+ 0a 00 00 mov dx, WORD PTR [eax+ecx*4+2684]
+ 001b7 8b ce mov ecx, esi
+ 001b9 66 d3 e2 shl dx, cl
+ 001bc 8d 0c 3e lea ecx, DWORD PTR [esi+edi]
+ 001bf 66 09 90 b8 16
+ 00 00 or WORD PTR [eax+5816], dx
+ 001c6 89 88 bc 16 00
+ 00 mov DWORD PTR [eax+5820], ecx
+$LN19@send_tree:
+ 001cc 4b dec ebx
+$LN17@send_tree:
+
+; 776 : }
+; 777 : Assert(count >= 3 && count <= 6, " 3_6?");
+; 778 : send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2);
+
+ 001cd 0f b7 b0 be 0a
+ 00 00 movzx esi, WORD PTR [eax+2750]
+ 001d4 ba 10 00 00 00 mov edx, 16 ; 00000010H
+ 001d9 8b 88 bc 16 00
+ 00 mov ecx, DWORD PTR [eax+5820]
+ 001df 2b d6 sub edx, esi
+ 001e1 89 75 e4 mov DWORD PTR _len$1$[ebp], esi
+ 001e4 3b ca cmp ecx, edx
+ 001e6 7e 5a jle SHORT $LN20@send_tree
+ 001e8 0f b7 b8 bc 0a
+ 00 00 movzx edi, WORD PTR [eax+2748]
+ 001ef 8b 70 08 mov esi, DWORD PTR [eax+8]
+ 001f2 66 8b d7 mov dx, di
+ 001f5 66 d3 e2 shl dx, cl
+ 001f8 66 09 90 b8 16
+ 00 00 or WORD PTR [eax+5816], dx
+ 001ff 8b 50 14 mov edx, DWORD PTR [eax+20]
+ 00202 0f b6 88 b8 16
+ 00 00 movzx ecx, BYTE PTR [eax+5816]
+ 00209 88 0c 16 mov BYTE PTR [esi+edx], cl
+ 0020c ff 40 14 inc DWORD PTR [eax+20]
+ 0020f 8b 70 14 mov esi, DWORD PTR [eax+20]
+ 00212 8b 50 08 mov edx, DWORD PTR [eax+8]
+ 00215 0f b6 88 b9 16
+ 00 00 movzx ecx, BYTE PTR [eax+5817]
+ 0021c 88 0c 16 mov BYTE PTR [esi+edx], cl
+ 0021f b1 10 mov cl, 16 ; 00000010H
+ 00221 2a 88 bc 16 00
+ 00 sub cl, BYTE PTR [eax+5820]
+ 00227 ff 40 14 inc DWORD PTR [eax+20]
+ 0022a 66 d3 ef shr di, cl
+ 0022d 8b 4d e4 mov ecx, DWORD PTR _len$1$[ebp]
+ 00230 83 c1 f0 add ecx, -16 ; fffffff0H
+ 00233 66 89 b8 b8 16
+ 00 00 mov WORD PTR [eax+5816], di
+ 0023a 01 88 bc 16 00
+ 00 add DWORD PTR [eax+5820], ecx
+ 00240 eb 19 jmp SHORT $LN21@send_tree
+$LN20@send_tree:
+ 00242 66 8b 90 bc 0a
+ 00 00 mov dx, WORD PTR [eax+2748]
+ 00249 66 d3 e2 shl dx, cl
+ 0024c 66 09 90 b8 16
+ 00 00 or WORD PTR [eax+5816], dx
+ 00253 03 ce add ecx, esi
+ 00255 89 88 bc 16 00
+ 00 mov DWORD PTR [eax+5820], ecx
+$LN21@send_tree:
+ 0025b 8b 88 bc 16 00
+ 00 mov ecx, DWORD PTR [eax+5820]
+ 00261 83 f9 0e cmp ecx, 14 ; 0000000eH
+ 00264 7e 54 jle SHORT $LN22@send_tree
+ 00266 8b 70 08 mov esi, DWORD PTR [eax+8]
+ 00269 8d 7b fd lea edi, DWORD PTR [ebx-3]
+ 0026c 66 8b d7 mov dx, di
+ 0026f 66 d3 e2 shl dx, cl
+ 00272 66 09 90 b8 16
+ 00 00 or WORD PTR [eax+5816], dx
+ 00279 8b 50 14 mov edx, DWORD PTR [eax+20]
+ 0027c 0f b6 88 b8 16
+ 00 00 movzx ecx, BYTE PTR [eax+5816]
+ 00283 88 0c 16 mov BYTE PTR [esi+edx], cl
+ 00286 ff 40 14 inc DWORD PTR [eax+20]
+ 00289 8b 70 14 mov esi, DWORD PTR [eax+20]
+ 0028c 8b 50 08 mov edx, DWORD PTR [eax+8]
+ 0028f 0f b6 88 b9 16
+ 00 00 movzx ecx, BYTE PTR [eax+5817]
+ 00296 88 0c 16 mov BYTE PTR [esi+edx], cl
+ 00299 b1 10 mov cl, 16 ; 00000010H
+ 0029b 2a 88 bc 16 00
+ 00 sub cl, BYTE PTR [eax+5820]
+ 002a1 ff 40 14 inc DWORD PTR [eax+20]
+ 002a4 66 d3 ef shr di, cl
+ 002a7 83 80 bc 16 00
+ 00 f2 add DWORD PTR [eax+5820], -14 ; fffffff2H
+ 002ae 66 89 b8 b8 16
+ 00 00 mov WORD PTR [eax+5816], di
+ 002b5 e9 15 02 00 00 jmp $LN33@send_tree
+$LN22@send_tree:
+ 002ba 8d 53 fd lea edx, DWORD PTR [ebx-3]
+ 002bd 66 d3 e2 shl dx, cl
+ 002c0 66 09 90 b8 16
+ 00 00 or WORD PTR [eax+5816], dx
+ 002c7 83 c1 02 add ecx, 2
+ 002ca e9 fa 01 00 00 jmp $LN46@send_tree
+$LN15@send_tree:
+
+; 779 :
+; 780 : } else if (count <= 10) {
+; 781 : send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3);
+
+ 002cf 8b 88 bc 16 00
+ 00 mov ecx, DWORD PTR [eax+5820]
+ 002d5 ba 10 00 00 00 mov edx, 16 ; 00000010H
+ 002da 83 fb 0a cmp ebx, 10 ; 0000000aH
+ 002dd 0f 8f f7 00 00
+ 00 jg $LN24@send_tree
+ 002e3 0f b7 b0 c2 0a
+ 00 00 movzx esi, WORD PTR [eax+2754]
+ 002ea 2b d6 sub edx, esi
+ 002ec 89 75 e4 mov DWORD PTR _len$1$[ebp], esi
+ 002ef 3b ca cmp ecx, edx
+ 002f1 7e 5a jle SHORT $LN26@send_tree
+ 002f3 0f b7 b8 c0 0a
+ 00 00 movzx edi, WORD PTR [eax+2752]
+ 002fa 8b 70 08 mov esi, DWORD PTR [eax+8]
+ 002fd 66 8b d7 mov dx, di
+ 00300 66 d3 e2 shl dx, cl
+ 00303 66 09 90 b8 16
+ 00 00 or WORD PTR [eax+5816], dx
+ 0030a 8b 50 14 mov edx, DWORD PTR [eax+20]
+ 0030d 0f b6 88 b8 16
+ 00 00 movzx ecx, BYTE PTR [eax+5816]
+ 00314 88 0c 16 mov BYTE PTR [esi+edx], cl
+ 00317 ff 40 14 inc DWORD PTR [eax+20]
+ 0031a 8b 70 14 mov esi, DWORD PTR [eax+20]
+ 0031d 8b 50 08 mov edx, DWORD PTR [eax+8]
+ 00320 0f b6 88 b9 16
+ 00 00 movzx ecx, BYTE PTR [eax+5817]
+ 00327 88 0c 16 mov BYTE PTR [esi+edx], cl
+ 0032a b1 10 mov cl, 16 ; 00000010H
+ 0032c 2a 88 bc 16 00
+ 00 sub cl, BYTE PTR [eax+5820]
+ 00332 ff 40 14 inc DWORD PTR [eax+20]
+ 00335 66 d3 ef shr di, cl
+ 00338 8b 4d e4 mov ecx, DWORD PTR _len$1$[ebp]
+ 0033b 83 c1 f0 add ecx, -16 ; fffffff0H
+ 0033e 66 89 b8 b8 16
+ 00 00 mov WORD PTR [eax+5816], di
+ 00345 01 88 bc 16 00
+ 00 add DWORD PTR [eax+5820], ecx
+ 0034b eb 19 jmp SHORT $LN27@send_tree
+$LN26@send_tree:
+ 0034d 66 8b 90 c0 0a
+ 00 00 mov dx, WORD PTR [eax+2752]
+ 00354 66 d3 e2 shl dx, cl
+ 00357 66 09 90 b8 16
+ 00 00 or WORD PTR [eax+5816], dx
+ 0035e 03 ce add ecx, esi
+ 00360 89 88 bc 16 00
+ 00 mov DWORD PTR [eax+5820], ecx
+$LN27@send_tree:
+ 00366 8b 88 bc 16 00
+ 00 mov ecx, DWORD PTR [eax+5820]
+ 0036c 83 f9 0d cmp ecx, 13 ; 0000000dH
+ 0036f 7e 54 jle SHORT $LN28@send_tree
+ 00371 8b 70 08 mov esi, DWORD PTR [eax+8]
+ 00374 8d 7b fd lea edi, DWORD PTR [ebx-3]
+ 00377 66 8b d7 mov dx, di
+ 0037a 66 d3 e2 shl dx, cl
+ 0037d 66 09 90 b8 16
+ 00 00 or WORD PTR [eax+5816], dx
+ 00384 8b 50 14 mov edx, DWORD PTR [eax+20]
+ 00387 0f b6 88 b8 16
+ 00 00 movzx ecx, BYTE PTR [eax+5816]
+ 0038e 88 0c 16 mov BYTE PTR [esi+edx], cl
+ 00391 ff 40 14 inc DWORD PTR [eax+20]
+ 00394 8b 70 14 mov esi, DWORD PTR [eax+20]
+ 00397 8b 50 08 mov edx, DWORD PTR [eax+8]
+ 0039a 0f b6 88 b9 16
+ 00 00 movzx ecx, BYTE PTR [eax+5817]
+ 003a1 88 0c 16 mov BYTE PTR [esi+edx], cl
+ 003a4 b1 10 mov cl, 16 ; 00000010H
+ 003a6 2a 88 bc 16 00
+ 00 sub cl, BYTE PTR [eax+5820]
+ 003ac ff 40 14 inc DWORD PTR [eax+20]
+ 003af 66 d3 ef shr di, cl
+ 003b2 83 80 bc 16 00
+ 00 f3 add DWORD PTR [eax+5820], -13 ; fffffff3H
+ 003b9 66 89 b8 b8 16
+ 00 00 mov WORD PTR [eax+5816], di
+ 003c0 e9 0a 01 00 00 jmp $LN33@send_tree
+$LN28@send_tree:
+ 003c5 8d 53 fd lea edx, DWORD PTR [ebx-3]
+ 003c8 66 d3 e2 shl dx, cl
+ 003cb 66 09 90 b8 16
+ 00 00 or WORD PTR [eax+5816], dx
+ 003d2 83 c1 03 add ecx, 3
+
+; 782 :
+; 783 : } else {
+
+ 003d5 e9 ef 00 00 00 jmp $LN46@send_tree
+$LN24@send_tree:
+
+; 784 : send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7);
+
+ 003da 0f b7 b0 c6 0a
+ 00 00 movzx esi, WORD PTR [eax+2758]
+ 003e1 2b d6 sub edx, esi
+ 003e3 89 75 e4 mov DWORD PTR _len$1$[ebp], esi
+ 003e6 3b ca cmp ecx, edx
+ 003e8 7e 5a jle SHORT $LN30@send_tree
+ 003ea 0f b7 b8 c4 0a
+ 00 00 movzx edi, WORD PTR [eax+2756]
+ 003f1 8b 70 08 mov esi, DWORD PTR [eax+8]
+ 003f4 66 8b d7 mov dx, di
+ 003f7 66 d3 e2 shl dx, cl
+ 003fa 66 09 90 b8 16
+ 00 00 or WORD PTR [eax+5816], dx
+ 00401 8b 50 14 mov edx, DWORD PTR [eax+20]
+ 00404 0f b6 88 b8 16
+ 00 00 movzx ecx, BYTE PTR [eax+5816]
+ 0040b 88 0c 16 mov BYTE PTR [esi+edx], cl
+ 0040e ff 40 14 inc DWORD PTR [eax+20]
+ 00411 8b 70 14 mov esi, DWORD PTR [eax+20]
+ 00414 8b 50 08 mov edx, DWORD PTR [eax+8]
+ 00417 0f b6 88 b9 16
+ 00 00 movzx ecx, BYTE PTR [eax+5817]
+ 0041e 88 0c 16 mov BYTE PTR [esi+edx], cl
+ 00421 b1 10 mov cl, 16 ; 00000010H
+ 00423 2a 88 bc 16 00
+ 00 sub cl, BYTE PTR [eax+5820]
+ 00429 ff 40 14 inc DWORD PTR [eax+20]
+ 0042c 66 d3 ef shr di, cl
+ 0042f 8b 4d e4 mov ecx, DWORD PTR _len$1$[ebp]
+ 00432 83 c1 f0 add ecx, -16 ; fffffff0H
+ 00435 66 89 b8 b8 16
+ 00 00 mov WORD PTR [eax+5816], di
+ 0043c 01 88 bc 16 00
+ 00 add DWORD PTR [eax+5820], ecx
+ 00442 eb 19 jmp SHORT $LN31@send_tree
+$LN30@send_tree:
+ 00444 66 8b 90 c4 0a
+ 00 00 mov dx, WORD PTR [eax+2756]
+ 0044b 66 d3 e2 shl dx, cl
+ 0044e 66 09 90 b8 16
+ 00 00 or WORD PTR [eax+5816], dx
+ 00455 03 ce add ecx, esi
+ 00457 89 88 bc 16 00
+ 00 mov DWORD PTR [eax+5820], ecx
+$LN31@send_tree:
+ 0045d 8b 88 bc 16 00
+ 00 mov ecx, DWORD PTR [eax+5820]
+ 00463 83 f9 09 cmp ecx, 9
+ 00466 7e 51 jle SHORT $LN32@send_tree
+ 00468 8b 70 08 mov esi, DWORD PTR [eax+8]
+ 0046b 8d 7b f5 lea edi, DWORD PTR [ebx-11]
+ 0046e 66 8b d7 mov dx, di
+ 00471 66 d3 e2 shl dx, cl
+ 00474 66 09 90 b8 16
+ 00 00 or WORD PTR [eax+5816], dx
+ 0047b 8b 50 14 mov edx, DWORD PTR [eax+20]
+ 0047e 0f b6 88 b8 16
+ 00 00 movzx ecx, BYTE PTR [eax+5816]
+ 00485 88 0c 16 mov BYTE PTR [esi+edx], cl
+ 00488 ff 40 14 inc DWORD PTR [eax+20]
+ 0048b 8b 70 14 mov esi, DWORD PTR [eax+20]
+ 0048e 8b 50 08 mov edx, DWORD PTR [eax+8]
+ 00491 0f b6 88 b9 16
+ 00 00 movzx ecx, BYTE PTR [eax+5817]
+ 00498 88 0c 16 mov BYTE PTR [esi+edx], cl
+ 0049b b1 10 mov cl, 16 ; 00000010H
+ 0049d 2a 88 bc 16 00
+ 00 sub cl, BYTE PTR [eax+5820]
+ 004a3 ff 40 14 inc DWORD PTR [eax+20]
+ 004a6 66 d3 ef shr di, cl
+ 004a9 83 80 bc 16 00
+ 00 f7 add DWORD PTR [eax+5820], -9 ; fffffff7H
+ 004b0 66 89 b8 b8 16
+ 00 00 mov WORD PTR [eax+5816], di
+ 004b7 eb 16 jmp SHORT $LN33@send_tree
+$LN32@send_tree:
+ 004b9 8d 53 f5 lea edx, DWORD PTR [ebx-11]
+ 004bc 66 d3 e2 shl dx, cl
+ 004bf 66 09 90 b8 16
+ 00 00 or WORD PTR [eax+5816], dx
+ 004c6 83 c1 07 add ecx, 7
+$LN46@send_tree:
+ 004c9 89 88 bc 16 00
+ 00 mov DWORD PTR [eax+5820], ecx
+$LN33@send_tree:
+
+; 785 : }
+; 786 : count = 0; prevlen = curlen;
+; 787 : if (nextlen == 0) {
+
+ 004cf 8b 75 08 mov esi, DWORD PTR _nextlen$1$[ebp]
+ 004d2 33 db xor ebx, ebx
+ 004d4 8b 4d f4 mov ecx, DWORD PTR _curlen$1$[ebp]
+ 004d7 8b d1 mov edx, ecx
+ 004d9 85 f6 test esi, esi
+ 004db 75 0a jne SHORT $LN34@send_tree
+
+; 788 : max_count = 138, min_count = 3;
+
+ 004dd bf 8a 00 00 00 mov edi, 138 ; 0000008aH
+ 004e2 8d 73 03 lea esi, DWORD PTR [ebx+3]
+ 004e5 eb 16 jmp SHORT $LN2@send_tree
+$LN34@send_tree:
+
+; 789 : } else if (curlen == nextlen) {
+
+ 004e7 3b ce cmp ecx, esi
+ 004e9 75 0a jne SHORT $LN36@send_tree
+
+; 790 : max_count = 6, min_count = 3;
+
+ 004eb bf 06 00 00 00 mov edi, 6
+ 004f0 8d 77 fd lea esi, DWORD PTR [edi-3]
+
+; 791 : } else {
+
+ 004f3 eb 08 jmp SHORT $LN2@send_tree
+$LN36@send_tree:
+
+; 792 : max_count = 7, min_count = 4;
+
+ 004f5 bf 07 00 00 00 mov edi, 7
+ 004fa 8d 77 fd lea esi, DWORD PTR [edi-3]
+$LN2@send_tree:
+
+; 765 :
+; 766 : for (n = 0; n <= max_code; n++) {
+
+ 004fd 83 45 fc 04 add DWORD PTR tv1032[ebp], 4
+ 00501 83 6d f0 01 sub DWORD PTR tv1078[ebp], 1
+ 00505 8b 4d 08 mov ecx, DWORD PTR _nextlen$1$[ebp]
+ 00508 0f 85 37 fb ff
+ ff jne $LL4@send_tree
+$LN3@send_tree:
+ 0050e 5f pop edi
+ 0050f 5e pop esi
+ 00510 5b pop ebx
+
+; 793 : }
+; 794 : }
+; 795 : }
+
+ 00511 8b e5 mov esp, ebp
+ 00513 5d pop ebp
+ 00514 c3 ret 0
+_send_tree ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\trees.c
+; COMDAT _build_bl_tree
+_TEXT SEGMENT
+_build_bl_tree PROC ; COMDAT
+; _s$ = ecx
+
+; 803 : {
+
+ 00000 56 push esi
+ 00001 8b f1 mov esi, ecx
+
+; 804 : int max_blindex; /* index of last bit length code of non zero freq */
+; 805 :
+; 806 : /* Determine the bit length frequencies for literal and distance trees */
+; 807 : scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code);
+
+ 00003 ff b6 1c 0b 00
+ 00 push DWORD PTR [esi+2844]
+ 00009 8d 96 94 00 00
+ 00 lea edx, DWORD PTR [esi+148]
+ 0000f e8 00 00 00 00 call _scan_tree
+
+; 808 : scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code);
+
+ 00014 ff b6 28 0b 00
+ 00 push DWORD PTR [esi+2856]
+ 0001a 8d 96 88 09 00
+ 00 lea edx, DWORD PTR [esi+2440]
+ 00020 8b ce mov ecx, esi
+ 00022 e8 00 00 00 00 call _scan_tree
+ 00027 83 c4 08 add esp, 8
+
+; 809 :
+; 810 : /* Build the bit length tree: */
+; 811 : build_tree(s, (tree_desc *)(&(s->bl_desc)));
+
+ 0002a 8d 96 30 0b 00
+ 00 lea edx, DWORD PTR [esi+2864]
+ 00030 8b ce mov ecx, esi
+ 00032 e8 00 00 00 00 call _build_tree
+
+; 812 : /* opt_len now includes the length of the tree representations, except
+; 813 : * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
+; 814 : */
+; 815 :
+; 816 : /* Determine the number of bit length codes to send. The pkzip format
+; 817 : * requires that at least 4 bit length codes be sent. (appnote.txt says
+; 818 : * 3 but the actual value used is 4.)
+; 819 : */
+; 820 : for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
+
+ 00037 b8 12 00 00 00 mov eax, 18 ; 00000012H
+ 0003c 0f 1f 40 00 npad 4
+$LL4@build_bl_t:
+
+; 821 : if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
+
+ 00040 0f b6 88 00 00
+ 00 00 movzx ecx, BYTE PTR _bl_order[eax]
+ 00047 66 83 bc 8e 7e
+ 0a 00 00 00 cmp WORD PTR [esi+ecx*4+2686], 0
+ 00050 75 78 jne SHORT $LN8@build_bl_t
+ 00052 0f b6 88 ff ff
+ ff ff movzx ecx, BYTE PTR _bl_order[eax-1]
+ 00059 66 83 bc 8e 7e
+ 0a 00 00 00 cmp WORD PTR [esi+ecx*4+2686], 0
+ 00062 75 65 jne SHORT $LN11@build_bl_t
+ 00064 0f b6 88 fe ff
+ ff ff movzx ecx, BYTE PTR _bl_order[eax-2]
+ 0006b 66 83 bc 8e 7e
+ 0a 00 00 00 cmp WORD PTR [esi+ecx*4+2686], 0
+ 00074 75 3f jne SHORT $LN12@build_bl_t
+ 00076 0f b6 88 fd ff
+ ff ff movzx ecx, BYTE PTR _bl_order[eax-3]
+ 0007d 66 83 bc 8e 7e
+ 0a 00 00 00 cmp WORD PTR [esi+ecx*4+2686], 0
+ 00086 75 19 jne SHORT $LN13@build_bl_t
+
+; 812 : /* opt_len now includes the length of the tree representations, except
+; 813 : * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
+; 814 : */
+; 815 :
+; 816 : /* Determine the number of bit length codes to send. The pkzip format
+; 817 : * requires that at least 4 bit length codes be sent. (appnote.txt says
+; 818 : * 3 but the actual value used is 4.)
+; 819 : */
+; 820 : for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
+
+ 00088 83 e8 04 sub eax, 4
+ 0008b 83 f8 03 cmp eax, 3
+ 0008e 7d b0 jge SHORT $LL4@build_bl_t
+
+; 822 : }
+; 823 : /* Update opt_len to include the bit length tree and counts */
+; 824 : s->opt_len += 3*(max_blindex+1) + 5+5+4;
+
+ 00090 8d 0c 45 11 00
+ 00 00 lea ecx, DWORD PTR [eax*2+17]
+ 00097 03 c8 add ecx, eax
+ 00099 01 8e a8 16 00
+ 00 add DWORD PTR [esi+5800], ecx
+ 0009f 5e pop esi
+
+; 825 : Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
+; 826 : s->opt_len, s->static_len));
+; 827 :
+; 828 : return max_blindex;
+; 829 : }
+
+ 000a0 c3 ret 0
+$LN13@build_bl_t:
+
+; 821 : if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
+
+ 000a1 83 e8 03 sub eax, 3
+
+; 822 : }
+; 823 : /* Update opt_len to include the bit length tree and counts */
+; 824 : s->opt_len += 3*(max_blindex+1) + 5+5+4;
+
+ 000a4 8d 0c 45 11 00
+ 00 00 lea ecx, DWORD PTR [eax*2+17]
+ 000ab 03 c8 add ecx, eax
+ 000ad 01 8e a8 16 00
+ 00 add DWORD PTR [esi+5800], ecx
+ 000b3 5e pop esi
+
+; 825 : Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
+; 826 : s->opt_len, s->static_len));
+; 827 :
+; 828 : return max_blindex;
+; 829 : }
+
+ 000b4 c3 ret 0
+$LN12@build_bl_t:
+
+; 821 : if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
+
+ 000b5 83 e8 02 sub eax, 2
+
+; 822 : }
+; 823 : /* Update opt_len to include the bit length tree and counts */
+; 824 : s->opt_len += 3*(max_blindex+1) + 5+5+4;
+
+ 000b8 8d 0c 45 11 00
+ 00 00 lea ecx, DWORD PTR [eax*2+17]
+ 000bf 03 c8 add ecx, eax
+ 000c1 01 8e a8 16 00
+ 00 add DWORD PTR [esi+5800], ecx
+ 000c7 5e pop esi
+
+; 825 : Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
+; 826 : s->opt_len, s->static_len));
+; 827 :
+; 828 : return max_blindex;
+; 829 : }
+
+ 000c8 c3 ret 0
+$LN11@build_bl_t:
+
+; 821 : if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
+
+ 000c9 48 dec eax
+$LN8@build_bl_t:
+
+; 822 : }
+; 823 : /* Update opt_len to include the bit length tree and counts */
+; 824 : s->opt_len += 3*(max_blindex+1) + 5+5+4;
+
+ 000ca 8d 0c 45 11 00
+ 00 00 lea ecx, DWORD PTR [eax*2+17]
+ 000d1 03 c8 add ecx, eax
+ 000d3 01 8e a8 16 00
+ 00 add DWORD PTR [esi+5800], ecx
+ 000d9 5e pop esi
+
+; 825 : Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
+; 826 : s->opt_len, s->static_len));
+; 827 :
+; 828 : return max_blindex;
+; 829 : }
+
+ 000da c3 ret 0
+_build_bl_tree ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\trees.c
+; COMDAT _send_all_trees
+_TEXT SEGMENT
+_lcodes$1$ = -4 ; size = 4
+_dcodes$ = 8 ; size = 4
+_blcodes$ = 12 ; size = 4
+_send_all_trees PROC ; COMDAT
+; _s$ = ecx
+; _lcodes$ = edx
+
+; 839 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 51 push ecx
+ 00004 53 push ebx
+ 00005 56 push esi
+ 00006 8b f1 mov esi, ecx
+ 00008 8b c2 mov eax, edx
+ 0000a 57 push edi
+ 0000b 89 45 fc mov DWORD PTR _lcodes$1$[ebp], eax
+
+; 840 : int rank; /* index in bl_order */
+; 841 :
+; 842 : Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
+; 843 : Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
+; 844 : "too many codes");
+; 845 : Tracev((stderr, "\nbl counts: "));
+; 846 : send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */
+
+ 0000e 8b 8e bc 16 00
+ 00 mov ecx, DWORD PTR [esi+5820]
+ 00014 83 f9 0b cmp ecx, 11 ; 0000000bH
+ 00017 7e 54 jle SHORT $LN5@send_all_t
+ 00019 8b 56 14 mov edx, DWORD PTR [esi+20]
+ 0001c 8d b8 ff fe ff
+ ff lea edi, DWORD PTR [eax-257]
+ 00022 66 8b c7 mov ax, di
+ 00025 66 d3 e0 shl ax, cl
+ 00028 66 09 86 b8 16
+ 00 00 or WORD PTR [esi+5816], ax
+ 0002f 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 00032 0f b6 86 b8 16
+ 00 00 movzx eax, BYTE PTR [esi+5816]
+ 00039 88 04 0a mov BYTE PTR [edx+ecx], al
+ 0003c ff 46 14 inc DWORD PTR [esi+20]
+ 0003f 8b 56 14 mov edx, DWORD PTR [esi+20]
+ 00042 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 00045 0f b6 86 b9 16
+ 00 00 movzx eax, BYTE PTR [esi+5817]
+ 0004c 88 04 0a mov BYTE PTR [edx+ecx], al
+ 0004f b1 10 mov cl, 16 ; 00000010H
+ 00051 2a 8e bc 16 00
+ 00 sub cl, BYTE PTR [esi+5820]
+ 00057 ff 46 14 inc DWORD PTR [esi+20]
+ 0005a 66 d3 ef shr di, cl
+ 0005d 83 86 bc 16 00
+ 00 f5 add DWORD PTR [esi+5820], -11 ; fffffff5H
+ 00064 66 89 be b8 16
+ 00 00 mov WORD PTR [esi+5816], di
+ 0006b eb 18 jmp SHORT $LN6@send_all_t
+$LN5@send_all_t:
+ 0006d 05 ff fe ff ff add eax, -257 ; fffffeffH
+ 00072 66 d3 e0 shl ax, cl
+ 00075 66 09 86 b8 16
+ 00 00 or WORD PTR [esi+5816], ax
+ 0007c 8d 41 05 lea eax, DWORD PTR [ecx+5]
+ 0007f 89 86 bc 16 00
+ 00 mov DWORD PTR [esi+5820], eax
+$LN6@send_all_t:
+
+; 847 : send_bits(s, dcodes-1, 5);
+
+ 00085 8b 8e bc 16 00
+ 00 mov ecx, DWORD PTR [esi+5820]
+ 0008b 83 f9 0b cmp ecx, 11 ; 0000000bH
+ 0008e 7e 52 jle SHORT $LN7@send_all_t
+ 00090 8b 7d 08 mov edi, DWORD PTR _dcodes$[ebp]
+ 00093 8b 56 14 mov edx, DWORD PTR [esi+20]
+ 00096 4f dec edi
+ 00097 66 8b c7 mov ax, di
+ 0009a 66 d3 e0 shl ax, cl
+ 0009d 66 09 86 b8 16
+ 00 00 or WORD PTR [esi+5816], ax
+ 000a4 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 000a7 0f b6 86 b8 16
+ 00 00 movzx eax, BYTE PTR [esi+5816]
+ 000ae 88 04 0a mov BYTE PTR [edx+ecx], al
+ 000b1 ff 46 14 inc DWORD PTR [esi+20]
+ 000b4 8b 56 14 mov edx, DWORD PTR [esi+20]
+ 000b7 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 000ba 0f b6 86 b9 16
+ 00 00 movzx eax, BYTE PTR [esi+5817]
+ 000c1 88 04 0a mov BYTE PTR [edx+ecx], al
+ 000c4 b1 10 mov cl, 16 ; 00000010H
+ 000c6 2a 8e bc 16 00
+ 00 sub cl, BYTE PTR [esi+5820]
+ 000cc ff 46 14 inc DWORD PTR [esi+20]
+ 000cf 66 d3 ef shr di, cl
+ 000d2 83 86 bc 16 00
+ 00 f5 add DWORD PTR [esi+5820], -11 ; fffffff5H
+ 000d9 66 89 be b8 16
+ 00 00 mov WORD PTR [esi+5816], di
+ 000e0 eb 17 jmp SHORT $LN8@send_all_t
+$LN7@send_all_t:
+ 000e2 8b 45 08 mov eax, DWORD PTR _dcodes$[ebp]
+ 000e5 48 dec eax
+ 000e6 66 d3 e0 shl ax, cl
+ 000e9 66 09 86 b8 16
+ 00 00 or WORD PTR [esi+5816], ax
+ 000f0 8d 41 05 lea eax, DWORD PTR [ecx+5]
+ 000f3 89 86 bc 16 00
+ 00 mov DWORD PTR [esi+5820], eax
+$LN8@send_all_t:
+
+; 848 : send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */
+
+ 000f9 8b 8e bc 16 00
+ 00 mov ecx, DWORD PTR [esi+5820]
+ 000ff 83 f9 0c cmp ecx, 12 ; 0000000cH
+ 00102 7e 54 jle SHORT $LN9@send_all_t
+ 00104 8b 7d 0c mov edi, DWORD PTR _blcodes$[ebp]
+ 00107 8b 56 14 mov edx, DWORD PTR [esi+20]
+ 0010a 83 c7 fc add edi, -4 ; fffffffcH
+ 0010d 66 8b c7 mov ax, di
+ 00110 66 d3 e0 shl ax, cl
+ 00113 66 09 86 b8 16
+ 00 00 or WORD PTR [esi+5816], ax
+ 0011a 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 0011d 0f b6 86 b8 16
+ 00 00 movzx eax, BYTE PTR [esi+5816]
+ 00124 88 04 0a mov BYTE PTR [edx+ecx], al
+ 00127 ff 46 14 inc DWORD PTR [esi+20]
+ 0012a 8b 56 14 mov edx, DWORD PTR [esi+20]
+ 0012d 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 00130 0f b6 86 b9 16
+ 00 00 movzx eax, BYTE PTR [esi+5817]
+ 00137 88 04 0a mov BYTE PTR [edx+ecx], al
+ 0013a b1 10 mov cl, 16 ; 00000010H
+ 0013c 2a 8e bc 16 00
+ 00 sub cl, BYTE PTR [esi+5820]
+ 00142 ff 46 14 inc DWORD PTR [esi+20]
+ 00145 66 d3 ef shr di, cl
+ 00148 83 86 bc 16 00
+ 00 f4 add DWORD PTR [esi+5820], -12 ; fffffff4H
+ 0014f 66 89 be b8 16
+ 00 00 mov WORD PTR [esi+5816], di
+ 00156 eb 19 jmp SHORT $LN10@send_all_t
+$LN9@send_all_t:
+ 00158 8b 45 0c mov eax, DWORD PTR _blcodes$[ebp]
+ 0015b 83 c0 fc add eax, -4 ; fffffffcH
+ 0015e 66 d3 e0 shl ax, cl
+ 00161 66 09 86 b8 16
+ 00 00 or WORD PTR [esi+5816], ax
+ 00168 8d 41 04 lea eax, DWORD PTR [ecx+4]
+ 0016b 89 86 bc 16 00
+ 00 mov DWORD PTR [esi+5820], eax
+$LN10@send_all_t:
+
+; 849 : for (rank = 0; rank < blcodes; rank++) {
+
+ 00171 33 db xor ebx, ebx
+ 00173 39 5d 0c cmp DWORD PTR _blcodes$[ebp], ebx
+ 00176 0f 8e 91 00 00
+ 00 jle $LN3@send_all_t
+ 0017c 0f 1f 40 00 npad 4
+$LL4@send_all_t:
+
+; 850 : Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
+; 851 : send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
+
+ 00180 8b 8e bc 16 00
+ 00 mov ecx, DWORD PTR [esi+5820]
+ 00186 0f b6 83 00 00
+ 00 00 movzx eax, BYTE PTR _bl_order[ebx]
+ 0018d 83 f9 0d cmp ecx, 13 ; 0000000dH
+ 00190 7e 56 jle SHORT $LN11@send_all_t
+ 00192 0f b7 bc 86 7e
+ 0a 00 00 movzx edi, WORD PTR [esi+eax*4+2686]
+ 0019a 8b 56 14 mov edx, DWORD PTR [esi+20]
+ 0019d 66 8b c7 mov ax, di
+ 001a0 66 d3 e0 shl ax, cl
+ 001a3 66 09 86 b8 16
+ 00 00 or WORD PTR [esi+5816], ax
+ 001aa 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 001ad 0f b6 86 b8 16
+ 00 00 movzx eax, BYTE PTR [esi+5816]
+ 001b4 88 04 0a mov BYTE PTR [edx+ecx], al
+ 001b7 ff 46 14 inc DWORD PTR [esi+20]
+ 001ba 8b 56 14 mov edx, DWORD PTR [esi+20]
+ 001bd 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 001c0 0f b6 86 b9 16
+ 00 00 movzx eax, BYTE PTR [esi+5817]
+ 001c7 88 04 0a mov BYTE PTR [edx+ecx], al
+ 001ca b1 10 mov cl, 16 ; 00000010H
+ 001cc 2a 8e bc 16 00
+ 00 sub cl, BYTE PTR [esi+5820]
+ 001d2 ff 46 14 inc DWORD PTR [esi+20]
+ 001d5 66 d3 ef shr di, cl
+ 001d8 83 86 bc 16 00
+ 00 f3 add DWORD PTR [esi+5820], -13 ; fffffff3H
+ 001df 66 89 be b8 16
+ 00 00 mov WORD PTR [esi+5816], di
+ 001e6 eb 1b jmp SHORT $LN2@send_all_t
+$LN11@send_all_t:
+ 001e8 66 8b 84 86 7e
+ 0a 00 00 mov ax, WORD PTR [esi+eax*4+2686]
+ 001f0 66 d3 e0 shl ax, cl
+ 001f3 66 09 86 b8 16
+ 00 00 or WORD PTR [esi+5816], ax
+ 001fa 8d 41 03 lea eax, DWORD PTR [ecx+3]
+ 001fd 89 86 bc 16 00
+ 00 mov DWORD PTR [esi+5820], eax
+$LN2@send_all_t:
+
+; 849 : for (rank = 0; rank < blcodes; rank++) {
+
+ 00203 43 inc ebx
+ 00204 3b 5d 0c cmp ebx, DWORD PTR _blcodes$[ebp]
+ 00207 0f 8c 73 ff ff
+ ff jl $LL4@send_all_t
+$LN3@send_all_t:
+
+; 852 : }
+; 853 : Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
+; 854 :
+; 855 : send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */
+
+ 0020d 8b 45 fc mov eax, DWORD PTR _lcodes$1$[ebp]
+ 00210 8d 96 94 00 00
+ 00 lea edx, DWORD PTR [esi+148]
+ 00216 48 dec eax
+ 00217 8b ce mov ecx, esi
+ 00219 50 push eax
+ 0021a e8 00 00 00 00 call _send_tree
+
+; 856 : Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
+; 857 :
+; 858 : send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */
+
+ 0021f 8b 45 08 mov eax, DWORD PTR _dcodes$[ebp]
+ 00222 8d 96 88 09 00
+ 00 lea edx, DWORD PTR [esi+2440]
+ 00228 48 dec eax
+ 00229 8b ce mov ecx, esi
+ 0022b 50 push eax
+ 0022c e8 00 00 00 00 call _send_tree
+ 00231 83 c4 08 add esp, 8
+ 00234 5f pop edi
+ 00235 5e pop esi
+ 00236 5b pop ebx
+
+; 859 : Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
+; 860 : }
+
+ 00237 8b e5 mov esp, ebp
+ 00239 5d pop ebp
+ 0023a c3 ret 0
+_send_all_trees ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\trees.c
+; COMDAT _compress_block
+_TEXT SEGMENT
+_len$1$ = -20 ; size = 4
+_lx$1$ = -20 ; size = 4
+_extra$1$ = -16 ; size = 4
+_lc$1$ = -16 ; size = 4
+_len$1$ = -12 ; size = 4
+_code$1$ = -12 ; size = 4
+_len$1$ = -8 ; size = 4
+_code$2$ = -8 ; size = 4
+_ltree$1$ = -4 ; size = 4
+_dtree$ = 8 ; size = 4
+_compress_block PROC ; COMDAT
+; _s$ = ecx
+; _ltree$ = edx
+
+; 1064 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 14 sub esp, 20 ; 00000014H
+ 00006 53 push ebx
+ 00007 8b da mov ebx, edx
+ 00009 8b c1 mov eax, ecx
+
+; 1065 : unsigned dist; /* distance of matched string */
+; 1066 : int lc; /* match length or unmatched char (if dist == 0) */
+; 1067 : unsigned lx = 0; /* running index in l_buf */
+
+ 0000b 33 d2 xor edx, edx
+ 0000d 89 5d fc mov DWORD PTR _ltree$1$[ebp], ebx
+ 00010 56 push esi
+ 00011 57 push edi
+
+; 1068 : unsigned code; /* the code to send */
+; 1069 : int extra; /* number of extra bits to send */
+; 1070 :
+; 1071 : if (s->last_lit != 0) do {
+
+ 00012 8d 72 10 lea esi, DWORD PTR [edx+16]
+ 00015 39 90 a0 16 00
+ 00 cmp DWORD PTR [eax+5792], edx
+ 0001b 0f 84 3d 03 00
+ 00 je $LN3@compress_b
+ 00021 0f 1f 40 00 66
+ 66 66 0f 1f 84
+ 00 00 00 00 00 npad 15
+$LL4@compress_b:
+
+; 1072 : dist = s->d_buf[lx];
+
+ 00030 8b 88 a4 16 00
+ 00 mov ecx, DWORD PTR [eax+5796]
+ 00036 0f b7 1c 51 movzx ebx, WORD PTR [ecx+edx*2]
+
+; 1073 : lc = s->l_buf[lx++];
+
+ 0003a 8b 88 98 16 00
+ 00 mov ecx, DWORD PTR [eax+5784]
+ 00040 0f b6 3c 0a movzx edi, BYTE PTR [edx+ecx]
+ 00044 42 inc edx
+ 00045 89 7d f0 mov DWORD PTR _lc$1$[ebp], edi
+ 00048 89 55 ec mov DWORD PTR _lx$1$[ebp], edx
+
+; 1074 : if (dist == 0) {
+
+ 0004b 85 db test ebx, ebx
+ 0004d 0f 85 88 00 00
+ 00 jne $LN6@compress_b
+
+; 1075 : send_code(s, lc, ltree); /* send a literal byte */
+
+ 00053 8b 4d fc mov ecx, DWORD PTR _ltree$1$[ebp]
+ 00056 8b d6 mov edx, esi
+ 00058 0f b7 5c b9 02 movzx ebx, WORD PTR [ecx+edi*4+2]
+ 0005d 8d 3c b9 lea edi, DWORD PTR [ecx+edi*4]
+ 00060 8b 88 bc 16 00
+ 00 mov ecx, DWORD PTR [eax+5820]
+ 00066 2b d3 sub edx, ebx
+ 00068 3b ca cmp ecx, edx
+ 0006a 7e 5b jle SHORT $LN8@compress_b
+ 0006c 0f b7 3f movzx edi, WORD PTR [edi]
+ 0006f 8b 70 08 mov esi, DWORD PTR [eax+8]
+ 00072 66 8b d7 mov dx, di
+ 00075 66 d3 e2 shl dx, cl
+ 00078 66 09 90 b8 16
+ 00 00 or WORD PTR [eax+5816], dx
+ 0007f 8b 50 14 mov edx, DWORD PTR [eax+20]
+ 00082 0f b6 88 b8 16
+ 00 00 movzx ecx, BYTE PTR [eax+5816]
+ 00089 88 0c 16 mov BYTE PTR [esi+edx], cl
+ 0008c ff 40 14 inc DWORD PTR [eax+20]
+ 0008f 8b 70 14 mov esi, DWORD PTR [eax+20]
+ 00092 8b 50 08 mov edx, DWORD PTR [eax+8]
+ 00095 0f b6 88 b9 16
+ 00 00 movzx ecx, BYTE PTR [eax+5817]
+ 0009c 88 0c 16 mov BYTE PTR [esi+edx], cl
+ 0009f b1 10 mov cl, 16 ; 00000010H
+ 000a1 2a 88 bc 16 00
+ 00 sub cl, BYTE PTR [eax+5820]
+ 000a7 be 10 00 00 00 mov esi, 16 ; 00000010H
+ 000ac ff 40 14 inc DWORD PTR [eax+20]
+ 000af 66 d3 ef shr di, cl
+ 000b2 8d 4b f0 lea ecx, DWORD PTR [ebx-16]
+ 000b5 01 88 bc 16 00
+ 00 add DWORD PTR [eax+5820], ecx
+ 000bb 66 89 b8 b8 16
+ 00 00 mov WORD PTR [eax+5816], di
+ 000c2 e9 85 02 00 00 jmp $LN2@compress_b
+$LN8@compress_b:
+ 000c7 66 8b 17 mov dx, WORD PTR [edi]
+ 000ca 66 d3 e2 shl dx, cl
+ 000cd 66 09 90 b8 16
+ 00 00 or WORD PTR [eax+5816], dx
+ 000d4 03 cb add ecx, ebx
+
+; 1076 : Tracecv(isgraph(lc), (stderr," '%c' ", lc));
+; 1077 : } else {
+
+ 000d6 e9 6b 02 00 00 jmp $LN28@compress_b
+$LN6@compress_b:
+
+; 1078 : /* Here, lc is the match length - MIN_MATCH */
+; 1079 : code = _length_code[lc];
+
+ 000db 0f b6 8f 00 00
+ 00 00 movzx ecx, BYTE PTR __length_code[edi]
+
+; 1080 : send_code(s, code+LITERALS+1, ltree); /* send the length code */
+
+ 000e2 8b 55 fc mov edx, DWORD PTR _ltree$1$[ebp]
+ 000e5 89 4d f4 mov DWORD PTR _code$1$[ebp], ecx
+ 000e8 0f b7 8c 8a 06
+ 04 00 00 movzx ecx, WORD PTR [edx+ecx*4+1030]
+ 000f0 8b d6 mov edx, esi
+ 000f2 8b 75 fc mov esi, DWORD PTR _ltree$1$[ebp]
+ 000f5 89 4d f8 mov DWORD PTR _len$1$[ebp], ecx
+ 000f8 2b 55 f8 sub edx, DWORD PTR _len$1$[ebp]
+ 000fb 8b 88 bc 16 00
+ 00 mov ecx, DWORD PTR [eax+5820]
+ 00101 3b ca cmp ecx, edx
+ 00103 8b 55 f4 mov edx, DWORD PTR _code$1$[ebp]
+ 00106 7e 5e jle SHORT $LN10@compress_b
+ 00108 0f b7 bc 96 04
+ 04 00 00 movzx edi, WORD PTR [esi+edx*4+1028]
+ 00110 8b 70 08 mov esi, DWORD PTR [eax+8]
+ 00113 66 8b d7 mov dx, di
+ 00116 66 d3 e2 shl dx, cl
+ 00119 66 09 90 b8 16
+ 00 00 or WORD PTR [eax+5816], dx
+ 00120 8b 50 14 mov edx, DWORD PTR [eax+20]
+ 00123 0f b6 88 b8 16
+ 00 00 movzx ecx, BYTE PTR [eax+5816]
+ 0012a 88 0c 16 mov BYTE PTR [esi+edx], cl
+ 0012d ff 40 14 inc DWORD PTR [eax+20]
+ 00130 8b 70 14 mov esi, DWORD PTR [eax+20]
+ 00133 8b 50 08 mov edx, DWORD PTR [eax+8]
+ 00136 0f b6 88 b9 16
+ 00 00 movzx ecx, BYTE PTR [eax+5817]
+ 0013d 88 0c 16 mov BYTE PTR [esi+edx], cl
+ 00140 b1 10 mov cl, 16 ; 00000010H
+ 00142 2a 88 bc 16 00
+ 00 sub cl, BYTE PTR [eax+5820]
+ 00148 ff 40 14 inc DWORD PTR [eax+20]
+ 0014b 66 d3 ef shr di, cl
+ 0014e 8b 4d f8 mov ecx, DWORD PTR _len$1$[ebp]
+ 00151 83 c1 f0 add ecx, -16 ; fffffff0H
+ 00154 66 89 b8 b8 16
+ 00 00 mov WORD PTR [eax+5816], di
+ 0015b 01 88 bc 16 00
+ 00 add DWORD PTR [eax+5820], ecx
+ 00161 8b 7d f0 mov edi, DWORD PTR _lc$1$[ebp]
+ 00164 eb 1b jmp SHORT $LN11@compress_b
+$LN10@compress_b:
+ 00166 66 8b 94 96 04
+ 04 00 00 mov dx, WORD PTR [esi+edx*4+1028]
+ 0016e 66 d3 e2 shl dx, cl
+ 00171 66 09 90 b8 16
+ 00 00 or WORD PTR [eax+5816], dx
+ 00178 03 4d f8 add ecx, DWORD PTR _len$1$[ebp]
+ 0017b 89 88 bc 16 00
+ 00 mov DWORD PTR [eax+5820], ecx
+$LN11@compress_b:
+
+; 1081 : extra = extra_lbits[code];
+
+ 00181 8b 4d f4 mov ecx, DWORD PTR _code$1$[ebp]
+ 00184 8b 34 8d 00 00
+ 00 00 mov esi, DWORD PTR _extra_lbits[ecx*4]
+ 0018b 89 75 f0 mov DWORD PTR _extra$1$[ebp], esi
+
+; 1082 : if (extra != 0) {
+
+ 0018e 85 f6 test esi, esi
+ 00190 74 7d je SHORT $LN14@compress_b
+
+; 1083 : lc -= base_length[code];
+
+ 00192 2b 3c 8d 00 00
+ 00 00 sub edi, DWORD PTR _base_length[ecx*4]
+
+; 1084 : send_bits(s, lc, extra); /* send the extra length bits */
+
+ 00199 ba 10 00 00 00 mov edx, 16 ; 00000010H
+ 0019e 8b 88 bc 16 00
+ 00 mov ecx, DWORD PTR [eax+5820]
+ 001a4 2b d6 sub edx, esi
+ 001a6 3b ca cmp ecx, edx
+ 001a8 7e 53 jle SHORT $LN13@compress_b
+ 001aa 8b 70 08 mov esi, DWORD PTR [eax+8]
+ 001ad 66 8b d7 mov dx, di
+ 001b0 66 d3 e2 shl dx, cl
+ 001b3 66 09 90 b8 16
+ 00 00 or WORD PTR [eax+5816], dx
+ 001ba 8b 50 14 mov edx, DWORD PTR [eax+20]
+ 001bd 0f b6 88 b8 16
+ 00 00 movzx ecx, BYTE PTR [eax+5816]
+ 001c4 88 0c 16 mov BYTE PTR [esi+edx], cl
+ 001c7 ff 40 14 inc DWORD PTR [eax+20]
+ 001ca 8b 70 14 mov esi, DWORD PTR [eax+20]
+ 001cd 8b 50 08 mov edx, DWORD PTR [eax+8]
+ 001d0 0f b6 88 b9 16
+ 00 00 movzx ecx, BYTE PTR [eax+5817]
+ 001d7 88 0c 16 mov BYTE PTR [esi+edx], cl
+ 001da b1 10 mov cl, 16 ; 00000010H
+ 001dc 2a 88 bc 16 00
+ 00 sub cl, BYTE PTR [eax+5820]
+ 001e2 ff 40 14 inc DWORD PTR [eax+20]
+ 001e5 66 d3 ef shr di, cl
+ 001e8 8b 4d f0 mov ecx, DWORD PTR _extra$1$[ebp]
+ 001eb 83 c1 f0 add ecx, -16 ; fffffff0H
+ 001ee 66 89 b8 b8 16
+ 00 00 mov WORD PTR [eax+5816], di
+ 001f5 01 88 bc 16 00
+ 00 add DWORD PTR [eax+5820], ecx
+ 001fb eb 12 jmp SHORT $LN14@compress_b
+$LN13@compress_b:
+ 001fd 66 d3 e7 shl di, cl
+ 00200 66 09 b8 b8 16
+ 00 00 or WORD PTR [eax+5816], di
+ 00207 03 ce add ecx, esi
+ 00209 89 88 bc 16 00
+ 00 mov DWORD PTR [eax+5820], ecx
+$LN14@compress_b:
+
+; 1085 : }
+; 1086 : dist--; /* dist is now the match distance - 1 */
+
+ 0020f 4b dec ebx
+
+; 1087 : code = d_code(dist);
+
+ 00210 81 fb 00 01 00
+ 00 cmp ebx, 256 ; 00000100H
+ 00216 73 09 jae SHORT $LN23@compress_b
+ 00218 0f b6 8b 00 00
+ 00 00 movzx ecx, BYTE PTR __dist_code[ebx]
+ 0021f eb 0c jmp SHORT $LN29@compress_b
+$LN23@compress_b:
+ 00221 8b cb mov ecx, ebx
+ 00223 c1 e9 07 shr ecx, 7
+ 00226 0f b6 89 00 01
+ 00 00 movzx ecx, BYTE PTR __dist_code[ecx+256]
+$LN29@compress_b:
+
+; 1088 : Assert (code < D_CODES, "bad d_code");
+; 1089 :
+; 1090 : send_code(s, code, dtree); /* send the distance code */
+
+ 0022d 8b 55 08 mov edx, DWORD PTR _dtree$[ebp]
+ 00230 be 10 00 00 00 mov esi, 16 ; 00000010H
+ 00235 89 4d f8 mov DWORD PTR _code$2$[ebp], ecx
+ 00238 8d 3c 8a lea edi, DWORD PTR [edx+ecx*4]
+ 0023b 8b d6 mov edx, esi
+ 0023d 0f b7 4f 02 movzx ecx, WORD PTR [edi+2]
+ 00241 89 4d f4 mov DWORD PTR _len$1$[ebp], ecx
+ 00244 2b 55 f4 sub edx, DWORD PTR _len$1$[ebp]
+ 00247 8b 88 bc 16 00
+ 00 mov ecx, DWORD PTR [eax+5820]
+ 0024d 3b ca cmp ecx, edx
+ 0024f 7e 5b jle SHORT $LN15@compress_b
+ 00251 0f b7 3f movzx edi, WORD PTR [edi]
+ 00254 8b 70 08 mov esi, DWORD PTR [eax+8]
+ 00257 66 8b d7 mov dx, di
+ 0025a 66 d3 e2 shl dx, cl
+ 0025d 66 09 90 b8 16
+ 00 00 or WORD PTR [eax+5816], dx
+ 00264 8b 50 14 mov edx, DWORD PTR [eax+20]
+ 00267 0f b6 88 b8 16
+ 00 00 movzx ecx, BYTE PTR [eax+5816]
+ 0026e 88 0c 16 mov BYTE PTR [esi+edx], cl
+ 00271 ff 40 14 inc DWORD PTR [eax+20]
+ 00274 8b 70 14 mov esi, DWORD PTR [eax+20]
+ 00277 8b 50 08 mov edx, DWORD PTR [eax+8]
+ 0027a 0f b6 88 b9 16
+ 00 00 movzx ecx, BYTE PTR [eax+5817]
+ 00281 88 0c 16 mov BYTE PTR [esi+edx], cl
+ 00284 b1 10 mov cl, 16 ; 00000010H
+ 00286 2a 88 bc 16 00
+ 00 sub cl, BYTE PTR [eax+5820]
+ 0028c be 10 00 00 00 mov esi, 16 ; 00000010H
+ 00291 ff 40 14 inc DWORD PTR [eax+20]
+ 00294 66 d3 ef shr di, cl
+ 00297 8b 4d f4 mov ecx, DWORD PTR _len$1$[ebp]
+ 0029a 83 c1 f0 add ecx, -16 ; fffffff0H
+ 0029d 66 89 b8 b8 16
+ 00 00 mov WORD PTR [eax+5816], di
+ 002a4 01 88 bc 16 00
+ 00 add DWORD PTR [eax+5820], ecx
+ 002aa eb 16 jmp SHORT $LN16@compress_b
+$LN15@compress_b:
+ 002ac 66 8b 17 mov dx, WORD PTR [edi]
+ 002af 66 d3 e2 shl dx, cl
+ 002b2 66 09 90 b8 16
+ 00 00 or WORD PTR [eax+5816], dx
+ 002b9 03 4d f4 add ecx, DWORD PTR _len$1$[ebp]
+ 002bc 89 88 bc 16 00
+ 00 mov DWORD PTR [eax+5820], ecx
+$LN16@compress_b:
+
+; 1091 : extra = extra_dbits[code];
+
+ 002c2 8b 4d f8 mov ecx, DWORD PTR _code$2$[ebp]
+ 002c5 8b 3c 8d 00 00
+ 00 00 mov edi, DWORD PTR _extra_dbits[ecx*4]
+
+; 1092 : if (extra != 0) {
+
+ 002cc 85 ff test edi, edi
+ 002ce 74 7c je SHORT $LN2@compress_b
+
+; 1093 : dist -= base_dist[code];
+
+ 002d0 2b 1c 8d 00 00
+ 00 00 sub ebx, DWORD PTR _base_dist[ecx*4]
+
+; 1094 : send_bits(s, dist, extra); /* send the extra distance bits */
+
+ 002d7 8b d6 mov edx, esi
+ 002d9 8b 88 bc 16 00
+ 00 mov ecx, DWORD PTR [eax+5820]
+ 002df 2b d7 sub edx, edi
+ 002e1 3b ca cmp ecx, edx
+ 002e3 7e 55 jle SHORT $LN18@compress_b
+ 002e5 8b 70 08 mov esi, DWORD PTR [eax+8]
+ 002e8 66 8b d3 mov dx, bx
+ 002eb 66 d3 e2 shl dx, cl
+ 002ee 66 09 90 b8 16
+ 00 00 or WORD PTR [eax+5816], dx
+ 002f5 8b 50 14 mov edx, DWORD PTR [eax+20]
+ 002f8 0f b6 88 b8 16
+ 00 00 movzx ecx, BYTE PTR [eax+5816]
+ 002ff 88 0c 16 mov BYTE PTR [esi+edx], cl
+ 00302 ff 40 14 inc DWORD PTR [eax+20]
+ 00305 8b 70 14 mov esi, DWORD PTR [eax+20]
+ 00308 8b 50 08 mov edx, DWORD PTR [eax+8]
+ 0030b 0f b6 88 b9 16
+ 00 00 movzx ecx, BYTE PTR [eax+5817]
+ 00312 88 0c 16 mov BYTE PTR [esi+edx], cl
+ 00315 b1 10 mov cl, 16 ; 00000010H
+ 00317 2a 88 bc 16 00
+ 00 sub cl, BYTE PTR [eax+5820]
+ 0031d be 10 00 00 00 mov esi, 16 ; 00000010H
+ 00322 ff 40 14 inc DWORD PTR [eax+20]
+ 00325 66 d3 eb shr bx, cl
+ 00328 8d 4f f0 lea ecx, DWORD PTR [edi-16]
+ 0032b 01 88 bc 16 00
+ 00 add DWORD PTR [eax+5820], ecx
+ 00331 66 89 98 b8 16
+ 00 00 mov WORD PTR [eax+5816], bx
+ 00338 eb 12 jmp SHORT $LN2@compress_b
+$LN18@compress_b:
+ 0033a 66 d3 e3 shl bx, cl
+ 0033d 66 09 98 b8 16
+ 00 00 or WORD PTR [eax+5816], bx
+ 00344 03 cf add ecx, edi
+$LN28@compress_b:
+ 00346 89 88 bc 16 00
+ 00 mov DWORD PTR [eax+5820], ecx
+$LN2@compress_b:
+
+; 1095 : }
+; 1096 : } /* literal or match pair ? */
+; 1097 :
+; 1098 : /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
+; 1099 : Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
+; 1100 : "pendingBuf overflow");
+; 1101 :
+; 1102 : } while (lx < s->last_lit);
+
+ 0034c 8b 55 ec mov edx, DWORD PTR _lx$1$[ebp]
+ 0034f 3b 90 a0 16 00
+ 00 cmp edx, DWORD PTR [eax+5792]
+ 00355 0f 82 d5 fc ff
+ ff jb $LL4@compress_b
+ 0035b 8b 5d fc mov ebx, DWORD PTR _ltree$1$[ebp]
+$LN3@compress_b:
+
+; 1103 :
+; 1104 : send_code(s, END_BLOCK, ltree);
+
+ 0035e 0f b7 bb 02 04
+ 00 00 movzx edi, WORD PTR [ebx+1026]
+ 00365 8b 88 bc 16 00
+ 00 mov ecx, DWORD PTR [eax+5820]
+ 0036b 2b f7 sub esi, edi
+ 0036d 89 7d ec mov DWORD PTR _len$1$[ebp], edi
+ 00370 3b ce cmp ecx, esi
+ 00372 7e 5f jle SHORT $LN20@compress_b
+ 00374 0f b7 bb 00 04
+ 00 00 movzx edi, WORD PTR [ebx+1024]
+ 0037b 8b 70 08 mov esi, DWORD PTR [eax+8]
+ 0037e 66 8b d7 mov dx, di
+ 00381 66 d3 e2 shl dx, cl
+ 00384 66 09 90 b8 16
+ 00 00 or WORD PTR [eax+5816], dx
+ 0038b 8b 50 14 mov edx, DWORD PTR [eax+20]
+ 0038e 0f b6 88 b8 16
+ 00 00 movzx ecx, BYTE PTR [eax+5816]
+ 00395 88 0c 16 mov BYTE PTR [esi+edx], cl
+ 00398 ff 40 14 inc DWORD PTR [eax+20]
+ 0039b 8b 70 14 mov esi, DWORD PTR [eax+20]
+ 0039e 8b 50 08 mov edx, DWORD PTR [eax+8]
+ 003a1 0f b6 88 b9 16
+ 00 00 movzx ecx, BYTE PTR [eax+5817]
+ 003a8 88 0c 16 mov BYTE PTR [esi+edx], cl
+ 003ab b1 10 mov cl, 16 ; 00000010H
+ 003ad 2a 88 bc 16 00
+ 00 sub cl, BYTE PTR [eax+5820]
+ 003b3 ff 40 14 inc DWORD PTR [eax+20]
+ 003b6 66 d3 ef shr di, cl
+ 003b9 8b 4d ec mov ecx, DWORD PTR _len$1$[ebp]
+ 003bc 66 89 b8 b8 16
+ 00 00 mov WORD PTR [eax+5816], di
+ 003c3 83 c1 f0 add ecx, -16 ; fffffff0H
+ 003c6 01 88 bc 16 00
+ 00 add DWORD PTR [eax+5820], ecx
+ 003cc 5f pop edi
+ 003cd 5e pop esi
+ 003ce 5b pop ebx
+
+; 1105 : }
+
+ 003cf 8b e5 mov esp, ebp
+ 003d1 5d pop ebp
+ 003d2 c3 ret 0
+$LN20@compress_b:
+
+; 1103 :
+; 1104 : send_code(s, END_BLOCK, ltree);
+
+ 003d3 66 8b 93 00 04
+ 00 00 mov dx, WORD PTR [ebx+1024]
+ 003da 66 d3 e2 shl dx, cl
+ 003dd 66 09 90 b8 16
+ 00 00 or WORD PTR [eax+5816], dx
+ 003e4 03 cf add ecx, edi
+ 003e6 5f pop edi
+ 003e7 5e pop esi
+ 003e8 89 88 bc 16 00
+ 00 mov DWORD PTR [eax+5820], ecx
+ 003ee 5b pop ebx
+
+; 1105 : }
+
+ 003ef 8b e5 mov esp, ebp
+ 003f1 5d pop ebp
+ 003f2 c3 ret 0
+_compress_block ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\trees.c
+; COMDAT _detect_data_type
+_TEXT SEGMENT
+_detect_data_type PROC ; COMDAT
+; _s$ = ecx
+
+; 1122 : {
+
+ 00000 56 push esi
+ 00001 57 push edi
+ 00002 8b f9 mov edi, ecx
+
+; 1123 : /* black_mask is the bit mask of black-listed bytes
+; 1124 : * set bits 0..6, 14..25, and 28..31
+; 1125 : * 0xf3ffc07f = binary 11110011111111111100000001111111
+; 1126 : */
+; 1127 : unsigned long black_mask = 0xf3ffc07fUL;
+
+ 00004 b8 7f c0 ff f3 mov eax, -201342849 ; f3ffc07fH
+
+; 1128 : int n;
+; 1129 :
+; 1130 : /* Check for non-textual ("black-listed") bytes. */
+; 1131 : for (n = 0; n <= 31; n++, black_mask >>= 1)
+
+ 00009 33 f6 xor esi, esi
+ 0000b 8d 97 94 00 00
+ 00 lea edx, DWORD PTR [edi+148]
+$LL4@detect_dat:
+
+; 1132 : if ((black_mask & 1) && (s->dyn_ltree[n].Freq != 0))
+
+ 00011 a8 01 test al, 1
+ 00013 74 06 je SHORT $LN2@detect_dat
+ 00015 66 83 3a 00 cmp WORD PTR [edx], 0
+ 00019 75 47 jne SHORT $LN15@detect_dat
+$LN2@detect_dat:
+
+; 1128 : int n;
+; 1129 :
+; 1130 : /* Check for non-textual ("black-listed") bytes. */
+; 1131 : for (n = 0; n <= 31; n++, black_mask >>= 1)
+
+ 0001b 46 inc esi
+ 0001c d1 e8 shr eax, 1
+ 0001e 83 c2 04 add edx, 4
+ 00021 83 fe 1f cmp esi, 31 ; 0000001fH
+ 00024 7e eb jle SHORT $LL4@detect_dat
+
+; 1133 : return Z_BINARY;
+; 1134 :
+; 1135 : /* Check for textual ("white-listed") bytes. */
+; 1136 : if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
+; 1137 : || s->dyn_ltree[13].Freq != 0)
+
+ 00026 66 83 bf b8 00
+ 00 00 00 cmp WORD PTR [edi+184], 0
+ 0002e 75 37 jne SHORT $LN10@detect_dat
+ 00030 66 83 bf bc 00
+ 00 00 00 cmp WORD PTR [edi+188], 0
+ 00038 75 2d jne SHORT $LN10@detect_dat
+ 0003a 66 83 bf c8 00
+ 00 00 00 cmp WORD PTR [edi+200], 0
+ 00042 75 23 jne SHORT $LN10@detect_dat
+
+; 1139 : for (n = 32; n < LITERALS; n++)
+
+ 00044 b9 20 00 00 00 mov ecx, 32 ; 00000020H
+ 00049 8d 87 14 01 00
+ 00 lea eax, DWORD PTR [edi+276]
+ 0004f 90 npad 1
+$LL7@detect_dat:
+
+; 1140 : if (s->dyn_ltree[n].Freq != 0)
+
+ 00050 66 83 38 00 cmp WORD PTR [eax], 0
+ 00054 75 11 jne SHORT $LN10@detect_dat
+
+; 1139 : for (n = 32; n < LITERALS; n++)
+
+ 00056 41 inc ecx
+ 00057 83 c0 04 add eax, 4
+ 0005a 81 f9 00 01 00
+ 00 cmp ecx, 256 ; 00000100H
+ 00060 7c ee jl SHORT $LL7@detect_dat
+$LN15@detect_dat:
+ 00062 5f pop edi
+
+; 1141 : return Z_TEXT;
+; 1142 :
+; 1143 : /* There are no "black-listed" or "white-listed" bytes:
+; 1144 : * this stream either is empty or has tolerated ("gray-listed") bytes only.
+; 1145 : */
+; 1146 : return Z_BINARY;
+
+ 00063 33 c0 xor eax, eax
+ 00065 5e pop esi
+
+; 1147 : }
+
+ 00066 c3 ret 0
+$LN10@detect_dat:
+ 00067 5f pop edi
+
+; 1138 : return Z_TEXT;
+
+ 00068 b8 01 00 00 00 mov eax, 1
+ 0006d 5e pop esi
+
+; 1147 : }
+
+ 0006e c3 ret 0
+_detect_data_type ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\trees.c
+; COMDAT _bi_reverse
+_TEXT SEGMENT
+_bi_reverse PROC ; COMDAT
+; _code$ = ecx
+; _len$ = edx
+
+; 1158 : register unsigned res = 0;
+
+ 00000 33 c0 xor eax, eax
+ 00002 56 push esi
+$LL4@bi_reverse:
+
+; 1159 : do {
+; 1160 : res |= code & 1;
+
+ 00003 8b f1 mov esi, ecx
+
+; 1161 : code >>= 1, res <<= 1;
+; 1162 : } while (--len > 0);
+
+ 00005 4a dec edx
+ 00006 83 e6 01 and esi, 1
+ 00009 d1 e9 shr ecx, 1
+ 0000b 0b c6 or eax, esi
+ 0000d 03 c0 add eax, eax
+ 0000f 85 d2 test edx, edx
+ 00011 7f f0 jg SHORT $LL4@bi_reverse
+
+; 1163 : return res >> 1;
+
+ 00013 d1 e8 shr eax, 1
+ 00015 5e pop esi
+
+; 1164 : }
+
+ 00016 c3 ret 0
+_bi_reverse ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\trees.c
+; COMDAT _bi_flush
+_TEXT SEGMENT
+_bi_flush PROC ; COMDAT
+; _s$ = ecx
+
+; 1171 : {
+
+ 00000 56 push esi
+ 00001 8b f1 mov esi, ecx
+
+; 1172 : if (s->bi_valid == 16) {
+
+ 00003 8b 86 bc 16 00
+ 00 mov eax, DWORD PTR [esi+5820]
+ 00009 83 f8 10 cmp eax, 16 ; 00000010H
+ 0000c 75 37 jne SHORT $LN2@bi_flush
+
+; 1173 : put_short(s, s->bi_buf);
+
+ 0000e 8b 4e 14 mov ecx, DWORD PTR [esi+20]
+ 00011 8b 56 08 mov edx, DWORD PTR [esi+8]
+ 00014 0f b6 86 b8 16
+ 00 00 movzx eax, BYTE PTR [esi+5816]
+ 0001b 88 04 0a mov BYTE PTR [edx+ecx], al
+ 0001e ff 46 14 inc DWORD PTR [esi+20]
+ 00021 8b 56 14 mov edx, DWORD PTR [esi+20]
+ 00024 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 00027 0f b6 86 b9 16
+ 00 00 movzx eax, BYTE PTR [esi+5817]
+ 0002e 88 04 0a mov BYTE PTR [edx+ecx], al
+ 00031 ff 46 14 inc DWORD PTR [esi+20]
+
+; 1174 : s->bi_buf = 0;
+
+ 00034 33 c0 xor eax, eax
+
+; 1175 : s->bi_valid = 0;
+
+ 00036 89 86 bc 16 00
+ 00 mov DWORD PTR [esi+5820], eax
+
+; 1178 : s->bi_buf >>= 8;
+
+ 0003c 66 89 86 b8 16
+ 00 00 mov WORD PTR [esi+5816], ax
+ 00043 5e pop esi
+
+; 1180 : }
+; 1181 : }
+
+ 00044 c3 ret 0
+$LN2@bi_flush:
+
+; 1176 : } else if (s->bi_valid >= 8) {
+
+ 00045 83 f8 08 cmp eax, 8
+ 00048 7c 27 jl SHORT $LN4@bi_flush
+
+; 1177 : put_byte(s, (Byte)s->bi_buf);
+
+ 0004a 8b 4e 14 mov ecx, DWORD PTR [esi+20]
+ 0004d 8b 56 08 mov edx, DWORD PTR [esi+8]
+ 00050 8a 86 b8 16 00
+ 00 mov al, BYTE PTR [esi+5816]
+ 00056 88 04 0a mov BYTE PTR [edx+ecx], al
+
+; 1178 : s->bi_buf >>= 8;
+
+ 00059 0f b6 86 b9 16
+ 00 00 movzx eax, BYTE PTR [esi+5817]
+ 00060 ff 46 14 inc DWORD PTR [esi+20]
+
+; 1179 : s->bi_valid -= 8;
+
+ 00063 83 86 bc 16 00
+ 00 f8 add DWORD PTR [esi+5820], -8 ; fffffff8H
+ 0006a 66 89 86 b8 16
+ 00 00 mov WORD PTR [esi+5816], ax
+$LN4@bi_flush:
+ 00071 5e pop esi
+
+; 1180 : }
+; 1181 : }
+
+ 00072 c3 ret 0
+_bi_flush ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\trees.c
+; COMDAT _bi_windup
+_TEXT SEGMENT
+_bi_windup PROC ; COMDAT
+; _s$ = ecx
+
+; 1188 : {
+
+ 00000 56 push esi
+ 00001 8b f1 mov esi, ecx
+
+; 1189 : if (s->bi_valid > 8) {
+
+ 00003 8b 86 bc 16 00
+ 00 mov eax, DWORD PTR [esi+5820]
+ 00009 83 f8 08 cmp eax, 8
+ 0000c 7e 22 jle SHORT $LN2@bi_windup
+
+; 1190 : put_short(s, s->bi_buf);
+
+ 0000e 8b 4e 14 mov ecx, DWORD PTR [esi+20]
+ 00011 8b 56 08 mov edx, DWORD PTR [esi+8]
+ 00014 0f b6 86 b8 16
+ 00 00 movzx eax, BYTE PTR [esi+5816]
+ 0001b 88 04 0a mov BYTE PTR [edx+ecx], al
+ 0001e ff 46 14 inc DWORD PTR [esi+20]
+ 00021 8b 56 14 mov edx, DWORD PTR [esi+20]
+ 00024 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 00027 0f b6 86 b9 16
+ 00 00 movzx eax, BYTE PTR [esi+5817]
+ 0002e eb 10 jmp SHORT $LN6@bi_windup
+$LN2@bi_windup:
+
+; 1191 : } else if (s->bi_valid > 0) {
+
+ 00030 85 c0 test eax, eax
+ 00032 7e 12 jle SHORT $LN4@bi_windup
+
+; 1192 : put_byte(s, (Byte)s->bi_buf);
+
+ 00034 8b 56 08 mov edx, DWORD PTR [esi+8]
+ 00037 8b 4e 14 mov ecx, DWORD PTR [esi+20]
+ 0003a 8a 86 b8 16 00
+ 00 mov al, BYTE PTR [esi+5816]
+$LN6@bi_windup:
+ 00040 88 04 0a mov BYTE PTR [edx+ecx], al
+ 00043 ff 46 14 inc DWORD PTR [esi+20]
+$LN4@bi_windup:
+
+; 1193 : }
+; 1194 : s->bi_buf = 0;
+
+ 00046 33 c0 xor eax, eax
+ 00048 66 89 86 b8 16
+ 00 00 mov WORD PTR [esi+5816], ax
+
+; 1195 : s->bi_valid = 0;
+
+ 0004f 89 86 bc 16 00
+ 00 mov DWORD PTR [esi+5820], eax
+ 00055 5e pop esi
+
+; 1196 : #ifdef DEBUG
+; 1197 : s->bits_sent = (s->bits_sent+7) & ~7;
+; 1198 : #endif
+; 1199 : }
+
+ 00056 c3 ret 0
+_bi_windup ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\trees.c
+; COMDAT _copy_block
+_TEXT SEGMENT
+_len$ = 8 ; size = 4
+_header$dead$ = 12 ; size = 4
+_copy_block PROC ; COMDAT
+; _s$ = ecx
+; _buf$ = edx
+
+; 1210 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 53 push ebx
+ 00004 56 push esi
+ 00005 57 push edi
+ 00006 8b fa mov edi, edx
+ 00008 8b f1 mov esi, ecx
+
+; 1211 : bi_windup(s); /* align on byte boundary */
+
+ 0000a e8 00 00 00 00 call _bi_windup
+
+; 1212 :
+; 1213 : if (header) {
+; 1214 : put_short(s, (ush)len);
+
+ 0000f 8b 4e 14 mov ecx, DWORD PTR [esi+20]
+ 00012 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 00015 8b 5d 08 mov ebx, DWORD PTR _len$[ebp]
+ 00018 88 1c 01 mov BYTE PTR [ecx+eax], bl
+ 0001b 8b cb mov ecx, ebx
+ 0001d ff 46 14 inc DWORD PTR [esi+20]
+ 00020 8b 56 14 mov edx, DWORD PTR [esi+20]
+ 00023 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 00026 c1 e9 08 shr ecx, 8
+ 00029 88 0c 02 mov BYTE PTR [edx+eax], cl
+
+; 1215 : put_short(s, (ush)~len);
+
+ 0002c 8a cb mov cl, bl
+ 0002e ff 46 14 inc DWORD PTR [esi+20]
+ 00031 f6 d1 not cl
+ 00033 8b 56 14 mov edx, DWORD PTR [esi+20]
+ 00036 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 00039 88 0c 02 mov BYTE PTR [edx+eax], cl
+ 0003c 8b cb mov ecx, ebx
+ 0003e ff 46 14 inc DWORD PTR [esi+20]
+ 00041 f7 d1 not ecx
+ 00043 8b 56 14 mov edx, DWORD PTR [esi+20]
+ 00046 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 00049 c1 e9 08 shr ecx, 8
+ 0004c 88 0c 02 mov BYTE PTR [edx+eax], cl
+ 0004f ff 46 14 inc DWORD PTR [esi+20]
+ 00052 8b 56 14 mov edx, DWORD PTR [esi+20]
+
+; 1216 : #ifdef DEBUG
+; 1217 : s->bits_sent += 2*16;
+; 1218 : #endif
+; 1219 : }
+; 1220 : #ifdef DEBUG
+; 1221 : s->bits_sent += (ulg)len<<3;
+; 1222 : #endif
+; 1223 : while (len--) {
+
+ 00055 85 db test ebx, ebx
+ 00057 74 1e je SHORT $LN7@copy_block
+ 00059 0f 1f 80 00 00
+ 00 00 npad 7
+$LL2@copy_block:
+
+; 1224 : put_byte(s, *buf++);
+
+ 00060 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 00063 8d 7f 01 lea edi, DWORD PTR [edi+1]
+ 00066 8a 47 ff mov al, BYTE PTR [edi-1]
+ 00069 88 04 0a mov BYTE PTR [edx+ecx], al
+ 0006c ff 46 14 inc DWORD PTR [esi+20]
+ 0006f 8b 56 14 mov edx, DWORD PTR [esi+20]
+ 00072 83 eb 01 sub ebx, 1
+ 00075 75 e9 jne SHORT $LL2@copy_block
+$LN7@copy_block:
+ 00077 5f pop edi
+ 00078 5e pop esi
+ 00079 5b pop ebx
+
+; 1225 : }
+; 1226 : }
+
+ 0007a 5d pop ebp
+ 0007b c3 ret 0
+_copy_block ENDP
+_TEXT ENDS
+END
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/trees.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/trees.obj
new file mode 100644
index 0000000000..b23c52a020
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/trees.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/uncompr.cod b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/uncompr.cod
new file mode 100644
index 0000000000..8f92e65124
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/uncompr.cod
@@ -0,0 +1,159 @@
+; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.23506.0
+
+ TITLE d:\downloads\tgl-master\tgl-master\zlib\uncompr.c
+ .686P
+ .XMM
+ include listing.inc
+ .model flat
+
+INCLUDELIB OLDNAMES
+
+PUBLIC _uncompress@16
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\uncompr.c
+; COMDAT _uncompress@16
+_TEXT SEGMENT
+_stream$ = -56 ; size = 56
+_dest$ = 8 ; size = 4
+_destLen$ = 12 ; size = 4
+_source$ = 16 ; size = 4
+_sourceLen$ = 20 ; size = 4
+_uncompress@16 PROC ; COMDAT
+
+; 29 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 e4 f8 and esp, -8 ; fffffff8H
+ 00006 83 ec 38 sub esp, 56 ; 00000038H
+
+; 30 : z_stream stream;
+; 31 : int err;
+; 32 :
+; 33 : stream.next_in = (z_const Bytef *)source;
+
+ 00009 8b 45 10 mov eax, DWORD PTR _source$[ebp]
+ 0000c 56 push esi
+ 0000d 57 push edi
+
+; 34 : stream.avail_in = (uInt)sourceLen;
+; 35 : /* Check for source > 64K on 16-bit machine: */
+; 36 : if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
+; 37 :
+; 38 : stream.next_out = dest;
+; 39 : stream.avail_out = (uInt)*destLen;
+
+ 0000e 8b 7d 0c mov edi, DWORD PTR _destLen$[ebp]
+ 00011 89 44 24 08 mov DWORD PTR _stream$[esp+64], eax
+ 00015 8b 45 14 mov eax, DWORD PTR _sourceLen$[ebp]
+ 00018 89 44 24 0c mov DWORD PTR _stream$[esp+68], eax
+ 0001c 8b 45 08 mov eax, DWORD PTR _dest$[ebp]
+ 0001f 89 44 24 14 mov DWORD PTR _stream$[esp+76], eax
+ 00023 8b 07 mov eax, DWORD PTR [edi]
+
+; 40 : if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
+; 41 :
+; 42 : stream.zalloc = (alloc_func)0;
+; 43 : stream.zfree = (free_func)0;
+; 44 :
+; 45 : err = inflateInit(&stream);
+
+ 00025 6a 38 push 56 ; 00000038H
+ 00027 89 44 24 1c mov DWORD PTR _stream$[esp+84], eax
+ 0002b 8d 44 24 0c lea eax, DWORD PTR _stream$[esp+68]
+ 0002f 68 00 00 00 00 push OFFSET ??_C@_05IAIEPMAK@1?42?48?$AA@
+ 00034 50 push eax
+ 00035 c7 44 24 34 00
+ 00 00 00 mov DWORD PTR _stream$[esp+108], 0
+ 0003d c7 44 24 38 00
+ 00 00 00 mov DWORD PTR _stream$[esp+112], 0
+ 00045 e8 00 00 00 00 call _inflateInit_@12
+
+; 46 : if (err != Z_OK) return err;
+
+ 0004a 85 c0 test eax, eax
+ 0004c 75 55 jne SHORT $LN1@uncompress
+
+; 47 :
+; 48 : err = inflate(&stream, Z_FINISH);
+
+ 0004e 6a 04 push 4
+ 00050 8d 44 24 0c lea eax, DWORD PTR _stream$[esp+68]
+ 00054 50 push eax
+ 00055 e8 00 00 00 00 call _inflate@8
+ 0005a 8b f0 mov esi, eax
+
+; 49 : if (err != Z_STREAM_END) {
+
+ 0005c 83 fe 01 cmp esi, 1
+ 0005f 74 32 je SHORT $LN5@uncompress
+
+; 50 : inflateEnd(&stream);
+
+ 00061 8d 44 24 08 lea eax, DWORD PTR _stream$[esp+64]
+ 00065 50 push eax
+ 00066 e8 00 00 00 00 call _inflateEnd@4
+
+; 51 : if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0))
+
+ 0006b 83 fe 02 cmp esi, 2
+ 0006e 74 16 je SHORT $LN7@uncompress
+ 00070 83 fe fb cmp esi, -5 ; fffffffbH
+ 00073 75 07 jne SHORT $LN6@uncompress
+ 00075 83 7c 24 0c 00 cmp DWORD PTR _stream$[esp+68], 0
+ 0007a 74 0a je SHORT $LN7@uncompress
+$LN6@uncompress:
+
+; 53 : return err;
+
+ 0007c 8b c6 mov eax, esi
+
+; 58 : return err;
+; 59 : }
+
+ 0007e 5f pop edi
+ 0007f 5e pop esi
+ 00080 8b e5 mov esp, ebp
+ 00082 5d pop ebp
+ 00083 c2 10 00 ret 16 ; 00000010H
+$LN7@uncompress:
+
+; 52 : return Z_DATA_ERROR;
+
+ 00086 b8 fd ff ff ff mov eax, -3 ; fffffffdH
+
+; 58 : return err;
+; 59 : }
+
+ 0008b 5f pop edi
+ 0008c 5e pop esi
+ 0008d 8b e5 mov esp, ebp
+ 0008f 5d pop ebp
+ 00090 c2 10 00 ret 16 ; 00000010H
+$LN5@uncompress:
+
+; 54 : }
+; 55 : *destLen = stream.total_out;
+
+ 00093 8b 44 24 1c mov eax, DWORD PTR _stream$[esp+84]
+ 00097 89 07 mov DWORD PTR [edi], eax
+
+; 56 :
+; 57 : err = inflateEnd(&stream);
+
+ 00099 8d 44 24 08 lea eax, DWORD PTR _stream$[esp+64]
+ 0009d 50 push eax
+ 0009e e8 00 00 00 00 call _inflateEnd@4
+$LN1@uncompress:
+
+; 58 : return err;
+; 59 : }
+
+ 000a3 5f pop edi
+ 000a4 5e pop esi
+ 000a5 8b e5 mov esp, ebp
+ 000a7 5d pop ebp
+ 000a8 c2 10 00 ret 16 ; 00000010H
+_uncompress@16 ENDP
+_TEXT ENDS
+END
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/uncompr.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/uncompr.obj
new file mode 100644
index 0000000000..bf538d3fa9
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/uncompr.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/unzip.cod b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/unzip.cod
new file mode 100644
index 0000000000..246916c093
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/unzip.cod
@@ -0,0 +1,7065 @@
+; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.23506.0
+
+ TITLE d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+ .686P
+ .XMM
+ include listing.inc
+ .model flat
+
+INCLUDELIB OLDNAMES
+
+PUBLIC _unz_copyright
+ ORG $+5
+_unz_copyright DB ' unzip 1.01 Copyright 1998-2004 Gilles Vollant - http:'
+ DB '//www.winimage.com/zLibDll', 00H
+PUBLIC _unzGetGlobalComment@12
+PUBLIC _unzCloseCurrentFile@4
+PUBLIC _unzGetLocalExtrafield@12
+PUBLIC _unzeof@4
+PUBLIC _unztell64@4
+PUBLIC _unztell@4
+PUBLIC _unzReadCurrentFile@12
+PUBLIC _unzGetCurrentFileZStreamPos64@4
+PUBLIC _unzOpenCurrentFile2@16
+PUBLIC _unzOpenCurrentFilePassword@8
+PUBLIC _unzOpenCurrentFile@4
+PUBLIC _unzOpenCurrentFile3@20
+PUBLIC _unzGoToFilePos@8
+PUBLIC _unzGoToFilePos64@8
+PUBLIC _unzGetFilePos@8
+PUBLIC _unzGetFilePos64@8
+PUBLIC _unzLocateFile@12
+PUBLIC _unzGoToNextFile@4
+PUBLIC _unzGoToFirstFile@4
+PUBLIC _unzGetCurrentFileInfo@32
+PUBLIC _unzGetCurrentFileInfo64@32
+PUBLIC _unzGetGlobalInfo@8
+PUBLIC _unzGetGlobalInfo64@8
+PUBLIC _unzClose@4
+PUBLIC _unzOpen64@4
+PUBLIC _unzOpen@4
+PUBLIC _unzOpen2_64@8
+PUBLIC _unzOpen2@8
+PUBLIC _unzStringFileNameCompare@12
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unz64local_getByte
+_TEXT SEGMENT
+_c$ = -1 ; size = 1
+_pi$ = 8 ; size = 4
+_unz64local_getByte PROC ; COMDAT
+; _pzlib_filefunc_def$ = ecx
+; _filestream$ = edx
+
+; 213 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 51 push ecx
+ 00004 56 push esi
+ 00005 57 push edi
+
+; 214 : unsigned char c;
+; 215 : int err = (int)ZREAD64(*pzlib_filefunc_def,filestream,&c,1);
+
+ 00006 6a 01 push 1
+ 00008 8b f1 mov esi, ecx
+ 0000a 8d 45 ff lea eax, DWORD PTR _c$[ebp]
+ 0000d 50 push eax
+ 0000e 8b fa mov edi, edx
+ 00010 57 push edi
+ 00011 ff 76 1c push DWORD PTR [esi+28]
+ 00014 8b 46 04 mov eax, DWORD PTR [esi+4]
+ 00017 ff d0 call eax
+ 00019 83 c4 10 add esp, 16 ; 00000010H
+
+; 216 : if (err==1)
+
+ 0001c 83 f8 01 cmp eax, 1
+ 0001f 75 11 jne SHORT $LN2@unz64local
+
+; 217 : {
+; 218 : *pi = (int)c;
+
+ 00021 8b 45 08 mov eax, DWORD PTR _pi$[ebp]
+ 00024 0f b6 4d ff movzx ecx, BYTE PTR _c$[ebp]
+ 00028 5f pop edi
+ 00029 5e pop esi
+ 0002a 89 08 mov DWORD PTR [eax], ecx
+
+; 219 : return UNZ_OK;
+
+ 0002c 33 c0 xor eax, eax
+
+; 224 : return UNZ_ERRNO;
+; 225 : else
+; 226 : return UNZ_EOF;
+; 227 : }
+; 228 : }
+
+ 0002e 8b e5 mov esp, ebp
+ 00030 5d pop ebp
+ 00031 c3 ret 0
+$LN2@unz64local:
+
+; 220 : }
+; 221 : else
+; 222 : {
+; 223 : if (ZERROR64(*pzlib_filefunc_def,filestream))
+
+ 00032 8b 46 18 mov eax, DWORD PTR [esi+24]
+ 00035 57 push edi
+ 00036 ff 76 1c push DWORD PTR [esi+28]
+ 00039 ff d0 call eax
+ 0003b 83 c4 08 add esp, 8
+ 0003e f7 d8 neg eax
+ 00040 1b c0 sbb eax, eax
+ 00042 5f pop edi
+ 00043 5e pop esi
+
+; 224 : return UNZ_ERRNO;
+; 225 : else
+; 226 : return UNZ_EOF;
+; 227 : }
+; 228 : }
+
+ 00044 8b e5 mov esp, ebp
+ 00046 5d pop ebp
+ 00047 c3 ret 0
+_unz64local_getByte ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unz64local_getShort
+_TEXT SEGMENT
+_i$ = -4 ; size = 4
+_pX$ = 8 ; size = 4
+_unz64local_getShort PROC ; COMDAT
+; _pzlib_filefunc_def$ = ecx
+; _filestream$ = edx
+
+; 242 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 51 push ecx
+ 00004 53 push ebx
+ 00005 56 push esi
+ 00006 57 push edi
+
+; 243 : uLong x ;
+; 244 : int i = 0;
+; 245 : int err;
+; 246 :
+; 247 : err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);
+
+ 00007 8d 45 fc lea eax, DWORD PTR _i$[ebp]
+ 0000a c7 45 fc 00 00
+ 00 00 mov DWORD PTR _i$[ebp], 0
+ 00011 50 push eax
+ 00012 8b f2 mov esi, edx
+ 00014 8b f9 mov edi, ecx
+ 00016 e8 00 00 00 00 call _unz64local_getByte
+
+; 248 : x = (uLong)i;
+
+ 0001b 8b 5d fc mov ebx, DWORD PTR _i$[ebp]
+ 0001e 8b d0 mov edx, eax
+ 00020 83 c4 04 add esp, 4
+
+; 249 :
+; 250 : if (err==UNZ_OK)
+
+ 00023 85 d2 test edx, edx
+ 00025 75 2c jne SHORT $LN3@unz64local
+
+; 251 : err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);
+
+ 00027 8d 45 fc lea eax, DWORD PTR _i$[ebp]
+ 0002a 8b d6 mov edx, esi
+ 0002c 50 push eax
+ 0002d 8b cf mov ecx, edi
+ 0002f e8 00 00 00 00 call _unz64local_getByte
+ 00034 8b d0 mov edx, eax
+ 00036 83 c4 04 add esp, 4
+
+; 252 : x |= ((uLong)i)<<8;
+; 253 :
+; 254 : if (err==UNZ_OK)
+
+ 00039 85 d2 test edx, edx
+ 0003b 75 16 jne SHORT $LN3@unz64local
+
+; 255 : *pX = x;
+
+ 0003d 8b 4d fc mov ecx, DWORD PTR _i$[ebp]
+ 00040 8b 45 08 mov eax, DWORD PTR _pX$[ebp]
+ 00043 c1 e1 08 shl ecx, 8
+ 00046 5f pop edi
+ 00047 0b cb or ecx, ebx
+ 00049 5e pop esi
+ 0004a 89 08 mov DWORD PTR [eax], ecx
+
+; 258 : return err;
+
+ 0004c 8b c2 mov eax, edx
+ 0004e 5b pop ebx
+
+; 259 : }
+
+ 0004f 8b e5 mov esp, ebp
+ 00051 5d pop ebp
+ 00052 c3 ret 0
+$LN3@unz64local:
+
+; 256 : else
+; 257 : *pX = 0;
+
+ 00053 8b 45 08 mov eax, DWORD PTR _pX$[ebp]
+ 00056 5f pop edi
+ 00057 5e pop esi
+ 00058 5b pop ebx
+ 00059 c7 00 00 00 00
+ 00 mov DWORD PTR [eax], 0
+
+; 258 : return err;
+
+ 0005f 8b c2 mov eax, edx
+
+; 259 : }
+
+ 00061 8b e5 mov esp, ebp
+ 00063 5d pop ebp
+ 00064 c3 ret 0
+_unz64local_getShort ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unz64local_getLong
+_TEXT SEGMENT
+_i$ = -4 ; size = 4
+_pX$ = 8 ; size = 4
+_unz64local_getLong PROC ; COMDAT
+; _pzlib_filefunc_def$ = ecx
+; _filestream$ = edx
+
+; 269 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 51 push ecx
+ 00004 53 push ebx
+ 00005 56 push esi
+ 00006 57 push edi
+
+; 270 : uLong x ;
+; 271 : int i = 0;
+; 272 : int err;
+; 273 :
+; 274 : err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);
+
+ 00007 8d 45 fc lea eax, DWORD PTR _i$[ebp]
+ 0000a c7 45 fc 00 00
+ 00 00 mov DWORD PTR _i$[ebp], 0
+ 00011 50 push eax
+ 00012 8b fa mov edi, edx
+ 00014 8b d9 mov ebx, ecx
+ 00016 e8 00 00 00 00 call _unz64local_getByte
+
+; 275 : x = (uLong)i;
+
+ 0001b 8b 4d fc mov ecx, DWORD PTR _i$[ebp]
+ 0001e 8b d0 mov edx, eax
+ 00020 83 c4 04 add esp, 4
+ 00023 8b f1 mov esi, ecx
+
+; 276 :
+; 277 : if (err==UNZ_OK)
+
+ 00025 85 d2 test edx, edx
+ 00027 75 15 jne SHORT $LN2@unz64local
+
+; 278 : err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);
+
+ 00029 8d 45 fc lea eax, DWORD PTR _i$[ebp]
+ 0002c 8b d7 mov edx, edi
+ 0002e 50 push eax
+ 0002f 8b cb mov ecx, ebx
+ 00031 e8 00 00 00 00 call _unz64local_getByte
+ 00036 8b 4d fc mov ecx, DWORD PTR _i$[ebp]
+ 00039 83 c4 04 add esp, 4
+ 0003c 8b d0 mov edx, eax
+$LN2@unz64local:
+
+; 279 : x |= ((uLong)i)<<8;
+
+ 0003e 8b c1 mov eax, ecx
+ 00040 c1 e0 08 shl eax, 8
+ 00043 0b f0 or esi, eax
+
+; 280 :
+; 281 : if (err==UNZ_OK)
+
+ 00045 85 d2 test edx, edx
+ 00047 75 15 jne SHORT $LN3@unz64local
+
+; 282 : err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);
+
+ 00049 8d 45 fc lea eax, DWORD PTR _i$[ebp]
+ 0004c 8b d7 mov edx, edi
+ 0004e 50 push eax
+ 0004f 8b cb mov ecx, ebx
+ 00051 e8 00 00 00 00 call _unz64local_getByte
+ 00056 8b 4d fc mov ecx, DWORD PTR _i$[ebp]
+ 00059 83 c4 04 add esp, 4
+ 0005c 8b d0 mov edx, eax
+$LN3@unz64local:
+
+; 283 : x |= ((uLong)i)<<16;
+
+ 0005e c1 e1 10 shl ecx, 16 ; 00000010H
+ 00061 0b f1 or esi, ecx
+
+; 284 :
+; 285 : if (err==UNZ_OK)
+
+ 00063 85 d2 test edx, edx
+ 00065 75 2c jne SHORT $LN5@unz64local
+
+; 286 : err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);
+
+ 00067 8d 45 fc lea eax, DWORD PTR _i$[ebp]
+ 0006a 8b d7 mov edx, edi
+ 0006c 50 push eax
+ 0006d 8b cb mov ecx, ebx
+ 0006f e8 00 00 00 00 call _unz64local_getByte
+ 00074 8b d0 mov edx, eax
+ 00076 83 c4 04 add esp, 4
+
+; 287 : x += ((uLong)i)<<24;
+; 288 :
+; 289 : if (err==UNZ_OK)
+
+ 00079 85 d2 test edx, edx
+ 0007b 75 16 jne SHORT $LN5@unz64local
+
+; 290 : *pX = x;
+
+ 0007d 8b 4d fc mov ecx, DWORD PTR _i$[ebp]
+ 00080 8b 45 08 mov eax, DWORD PTR _pX$[ebp]
+ 00083 c1 e1 18 shl ecx, 24 ; 00000018H
+ 00086 5f pop edi
+ 00087 03 ce add ecx, esi
+ 00089 5e pop esi
+ 0008a 89 08 mov DWORD PTR [eax], ecx
+
+; 293 : return err;
+
+ 0008c 8b c2 mov eax, edx
+ 0008e 5b pop ebx
+
+; 294 : }
+
+ 0008f 8b e5 mov esp, ebp
+ 00091 5d pop ebp
+ 00092 c3 ret 0
+$LN5@unz64local:
+
+; 291 : else
+; 292 : *pX = 0;
+
+ 00093 8b 45 08 mov eax, DWORD PTR _pX$[ebp]
+ 00096 5f pop edi
+ 00097 5e pop esi
+ 00098 5b pop ebx
+ 00099 c7 00 00 00 00
+ 00 mov DWORD PTR [eax], 0
+
+; 293 : return err;
+
+ 0009f 8b c2 mov eax, edx
+
+; 294 : }
+
+ 000a1 8b e5 mov esp, ebp
+ 000a3 5d pop ebp
+ 000a4 c3 ret 0
+_unz64local_getLong ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unz64local_getLong64
+_TEXT SEGMENT
+_pzlib_filefunc_def$1$ = -12 ; size = 4
+_filestream$1$ = -8 ; size = 4
+_i$ = -4 ; size = 4
+_pX$ = 8 ; size = 4
+_unz64local_getLong64 PROC ; COMDAT
+; _pzlib_filefunc_def$ = ecx
+; _filestream$ = edx
+
+; 305 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 0c sub esp, 12 ; 0000000cH
+ 00006 53 push ebx
+ 00007 8b c2 mov eax, edx
+ 00009 89 4d f4 mov DWORD PTR _pzlib_filefunc_def$1$[ebp], ecx
+ 0000c 56 push esi
+
+; 306 : ZPOS64_T x ;
+; 307 : int i = 0;
+; 308 : int err;
+; 309 :
+; 310 : err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);
+
+ 0000d 8d 55 fc lea edx, DWORD PTR _i$[ebp]
+ 00010 89 45 f8 mov DWORD PTR _filestream$1$[ebp], eax
+ 00013 57 push edi
+ 00014 52 push edx
+ 00015 8b d0 mov edx, eax
+ 00017 c7 45 fc 00 00
+ 00 00 mov DWORD PTR _i$[ebp], 0
+ 0001e e8 00 00 00 00 call _unz64local_getByte
+
+; 311 : x = (ZPOS64_T)i;
+
+ 00023 8b 4d fc mov ecx, DWORD PTR _i$[ebp]
+ 00026 8b f0 mov esi, eax
+ 00028 8b c1 mov eax, ecx
+ 0002a 83 c4 04 add esp, 4
+ 0002d 99 cdq
+ 0002e 8b f8 mov edi, eax
+ 00030 8b da mov ebx, edx
+
+; 312 :
+; 313 : if (err==UNZ_OK)
+
+ 00032 85 f6 test esi, esi
+ 00034 75 17 jne SHORT $LN2@unz64local
+
+; 314 : err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);
+
+ 00036 8b 55 f8 mov edx, DWORD PTR _filestream$1$[ebp]
+ 00039 8d 45 fc lea eax, DWORD PTR _i$[ebp]
+ 0003c 8b 4d f4 mov ecx, DWORD PTR _pzlib_filefunc_def$1$[ebp]
+ 0003f 50 push eax
+ 00040 e8 00 00 00 00 call _unz64local_getByte
+ 00045 8b 4d fc mov ecx, DWORD PTR _i$[ebp]
+ 00048 83 c4 04 add esp, 4
+ 0004b 8b f0 mov esi, eax
+$LN2@unz64local:
+
+; 315 : x |= ((ZPOS64_T)i)<<8;
+
+ 0004d 8b c1 mov eax, ecx
+ 0004f 99 cdq
+ 00050 0f a4 c2 08 shld edx, eax, 8
+ 00054 c1 e0 08 shl eax, 8
+ 00057 0b da or ebx, edx
+ 00059 0b f8 or edi, eax
+
+; 316 :
+; 317 : if (err==UNZ_OK)
+
+ 0005b 85 f6 test esi, esi
+ 0005d 75 17 jne SHORT $LN3@unz64local
+
+; 318 : err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);
+
+ 0005f 8b 55 f8 mov edx, DWORD PTR _filestream$1$[ebp]
+ 00062 8d 45 fc lea eax, DWORD PTR _i$[ebp]
+ 00065 8b 4d f4 mov ecx, DWORD PTR _pzlib_filefunc_def$1$[ebp]
+ 00068 50 push eax
+ 00069 e8 00 00 00 00 call _unz64local_getByte
+ 0006e 8b 4d fc mov ecx, DWORD PTR _i$[ebp]
+ 00071 83 c4 04 add esp, 4
+ 00074 8b f0 mov esi, eax
+$LN3@unz64local:
+
+; 319 : x |= ((ZPOS64_T)i)<<16;
+
+ 00076 8b c1 mov eax, ecx
+ 00078 99 cdq
+ 00079 0f a4 c2 10 shld edx, eax, 16
+ 0007d c1 e0 10 shl eax, 16 ; 00000010H
+ 00080 0b da or ebx, edx
+ 00082 0b f8 or edi, eax
+
+; 320 :
+; 321 : if (err==UNZ_OK)
+
+ 00084 85 f6 test esi, esi
+ 00086 75 17 jne SHORT $LN4@unz64local
+
+; 322 : err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);
+
+ 00088 8b 55 f8 mov edx, DWORD PTR _filestream$1$[ebp]
+ 0008b 8d 45 fc lea eax, DWORD PTR _i$[ebp]
+ 0008e 8b 4d f4 mov ecx, DWORD PTR _pzlib_filefunc_def$1$[ebp]
+ 00091 50 push eax
+ 00092 e8 00 00 00 00 call _unz64local_getByte
+ 00097 8b 4d fc mov ecx, DWORD PTR _i$[ebp]
+ 0009a 83 c4 04 add esp, 4
+ 0009d 8b f0 mov esi, eax
+$LN4@unz64local:
+
+; 323 : x |= ((ZPOS64_T)i)<<24;
+
+ 0009f 8b c1 mov eax, ecx
+ 000a1 99 cdq
+ 000a2 0f a4 c2 18 shld edx, eax, 24
+ 000a6 c1 e0 18 shl eax, 24 ; 00000018H
+ 000a9 0b da or ebx, edx
+ 000ab 0b f8 or edi, eax
+
+; 324 :
+; 325 : if (err==UNZ_OK)
+
+ 000ad 85 f6 test esi, esi
+ 000af 75 17 jne SHORT $LN5@unz64local
+
+; 326 : err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);
+
+ 000b1 8b 55 f8 mov edx, DWORD PTR _filestream$1$[ebp]
+ 000b4 8d 45 fc lea eax, DWORD PTR _i$[ebp]
+ 000b7 8b 4d f4 mov ecx, DWORD PTR _pzlib_filefunc_def$1$[ebp]
+ 000ba 50 push eax
+ 000bb e8 00 00 00 00 call _unz64local_getByte
+ 000c0 8b 4d fc mov ecx, DWORD PTR _i$[ebp]
+ 000c3 83 c4 04 add esp, 4
+ 000c6 8b f0 mov esi, eax
+$LN5@unz64local:
+
+; 327 : x |= ((ZPOS64_T)i)<<32;
+
+ 000c8 8b c1 mov eax, ecx
+ 000ca 99 cdq
+ 000cb 0b d8 or ebx, eax
+
+; 328 :
+; 329 : if (err==UNZ_OK)
+
+ 000cd 85 f6 test esi, esi
+ 000cf 75 17 jne SHORT $LN6@unz64local
+
+; 330 : err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);
+
+ 000d1 8b 55 f8 mov edx, DWORD PTR _filestream$1$[ebp]
+ 000d4 8d 45 fc lea eax, DWORD PTR _i$[ebp]
+ 000d7 8b 4d f4 mov ecx, DWORD PTR _pzlib_filefunc_def$1$[ebp]
+ 000da 50 push eax
+ 000db e8 00 00 00 00 call _unz64local_getByte
+ 000e0 8b 4d fc mov ecx, DWORD PTR _i$[ebp]
+ 000e3 83 c4 04 add esp, 4
+ 000e6 8b f0 mov esi, eax
+$LN6@unz64local:
+
+; 331 : x |= ((ZPOS64_T)i)<<40;
+
+ 000e8 8b c1 mov eax, ecx
+ 000ea 99 cdq
+ 000eb c1 e0 08 shl eax, 8
+ 000ee 0b d8 or ebx, eax
+
+; 332 :
+; 333 : if (err==UNZ_OK)
+
+ 000f0 85 f6 test esi, esi
+ 000f2 75 17 jne SHORT $LN7@unz64local
+
+; 334 : err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);
+
+ 000f4 8b 55 f8 mov edx, DWORD PTR _filestream$1$[ebp]
+ 000f7 8d 45 fc lea eax, DWORD PTR _i$[ebp]
+ 000fa 8b 4d f4 mov ecx, DWORD PTR _pzlib_filefunc_def$1$[ebp]
+ 000fd 50 push eax
+ 000fe e8 00 00 00 00 call _unz64local_getByte
+ 00103 8b 4d fc mov ecx, DWORD PTR _i$[ebp]
+ 00106 83 c4 04 add esp, 4
+ 00109 8b f0 mov esi, eax
+$LN7@unz64local:
+
+; 335 : x |= ((ZPOS64_T)i)<<48;
+
+ 0010b 8b c1 mov eax, ecx
+ 0010d 99 cdq
+ 0010e c1 e0 10 shl eax, 16 ; 00000010H
+ 00111 0b d8 or ebx, eax
+
+; 336 :
+; 337 : if (err==UNZ_OK)
+
+ 00113 85 f6 test esi, esi
+ 00115 75 36 jne SHORT $LN9@unz64local
+
+; 338 : err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);
+
+ 00117 8b 55 f8 mov edx, DWORD PTR _filestream$1$[ebp]
+ 0011a 8d 45 fc lea eax, DWORD PTR _i$[ebp]
+ 0011d 8b 4d f4 mov ecx, DWORD PTR _pzlib_filefunc_def$1$[ebp]
+ 00120 50 push eax
+ 00121 e8 00 00 00 00 call _unz64local_getByte
+ 00126 8b f0 mov esi, eax
+ 00128 83 c4 04 add esp, 4
+
+; 339 : x |= ((ZPOS64_T)i)<<56;
+; 340 :
+; 341 : if (err==UNZ_OK)
+
+ 0012b 85 f6 test esi, esi
+ 0012d 75 1e jne SHORT $LN9@unz64local
+
+; 342 : *pX = x;
+
+ 0012f 8b 45 fc mov eax, DWORD PTR _i$[ebp]
+ 00132 8b 4d 08 mov ecx, DWORD PTR _pX$[ebp]
+ 00135 99 cdq
+ 00136 33 d2 xor edx, edx
+ 00138 c1 e0 18 shl eax, 24 ; 00000018H
+ 0013b 0b d7 or edx, edi
+ 0013d 0b c3 or eax, ebx
+ 0013f 89 41 04 mov DWORD PTR [ecx+4], eax
+
+; 345 : return err;
+
+ 00142 8b c6 mov eax, esi
+ 00144 89 11 mov DWORD PTR [ecx], edx
+
+; 346 : }
+
+ 00146 5f pop edi
+ 00147 5e pop esi
+ 00148 5b pop ebx
+ 00149 8b e5 mov esp, ebp
+ 0014b 5d pop ebp
+ 0014c c3 ret 0
+$LN9@unz64local:
+
+; 343 : else
+; 344 : *pX = 0;
+
+ 0014d 8b 45 08 mov eax, DWORD PTR _pX$[ebp]
+
+; 346 : }
+
+ 00150 5f pop edi
+ 00151 c7 00 00 00 00
+ 00 mov DWORD PTR [eax], 0
+ 00157 c7 40 04 00 00
+ 00 00 mov DWORD PTR [eax+4], 0
+ 0015e 8b c6 mov eax, esi
+ 00160 5e pop esi
+ 00161 5b pop ebx
+ 00162 8b e5 mov esp, ebp
+ 00164 5d pop ebp
+ 00165 c3 ret 0
+_unz64local_getLong64 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _strcmpcasenosensitive_internal
+_TEXT SEGMENT
+_strcmpcasenosensitive_internal PROC ; COMDAT
+; _fileName1$ = ecx
+; _fileName2$ = edx
+
+; 367 : }
+
+ 00000 2b ca sub ecx, edx
+ 00002 53 push ebx
+$LL2@strcmpcase:
+
+; 351 : for (;;)
+; 352 : {
+; 353 : char c1=*(fileName1++);
+; 354 : char c2=*(fileName2++);
+
+ 00003 8a 24 11 mov ah, BYTE PTR [ecx+edx]
+ 00006 8d 52 01 lea edx, DWORD PTR [edx+1]
+ 00009 8a 5a ff mov bl, BYTE PTR [edx-1]
+
+; 355 : if ((c1>='a') && (c1<='z'))
+
+ 0000c 8a c4 mov al, ah
+ 0000e 2c 61 sub al, 97 ; 00000061H
+ 00010 3c 19 cmp al, 25 ; 00000019H
+ 00012 77 03 ja SHORT $LN5@strcmpcase
+
+; 356 : c1 -= 0x20;
+
+ 00014 80 c4 e0 add ah, -32 ; ffffffe0H
+$LN5@strcmpcase:
+
+; 357 : if ((c2>='a') && (c2<='z'))
+
+ 00017 8a c3 mov al, bl
+ 00019 2c 61 sub al, 97 ; 00000061H
+ 0001b 3c 19 cmp al, 25 ; 00000019H
+ 0001d 77 03 ja SHORT $LN6@strcmpcase
+
+; 358 : c2 -= 0x20;
+
+ 0001f 80 c3 e0 add bl, -32 ; ffffffe0H
+$LN6@strcmpcase:
+
+; 359 : if (c1=='\0')
+
+ 00022 84 e4 test ah, ah
+ 00024 74 16 je SHORT $LN14@strcmpcase
+
+; 361 : if (c2=='\0')
+
+ 00026 84 db test bl, bl
+ 00028 74 06 je SHORT $LN15@strcmpcase
+
+; 362 : return 1;
+; 363 : if (c1<c2)
+
+ 0002a 3a e3 cmp ah, bl
+ 0002c 7c 09 jl SHORT $LN16@strcmpcase
+
+; 365 : if (c1>c2)
+
+ 0002e 7e d3 jle SHORT $LL2@strcmpcase
+$LN15@strcmpcase:
+
+; 366 : return 1;
+
+ 00030 b8 01 00 00 00 mov eax, 1
+ 00035 5b pop ebx
+
+; 368 : }
+
+ 00036 c3 ret 0
+$LN16@strcmpcase:
+
+; 364 : return -1;
+
+ 00037 83 c8 ff or eax, -1
+ 0003a 5b pop ebx
+
+; 368 : }
+
+ 0003b c3 ret 0
+$LN14@strcmpcase:
+
+; 360 : return ((c2=='\0') ? 0 : -1);
+
+ 0003c 0f be c3 movsx eax, bl
+ 0003f f7 d8 neg eax
+ 00041 5b pop ebx
+ 00042 1b c0 sbb eax, eax
+
+; 368 : }
+
+ 00044 c3 ret 0
+_strcmpcasenosensitive_internal ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unzStringFileNameCompare@12
+_TEXT SEGMENT
+_fileName1$ = 8 ; size = 4
+_fileName2$ = 12 ; size = 4
+_iCaseSensitivity$ = 16 ; size = 4
+_unzStringFileNameCompare@12 PROC ; COMDAT
+
+; 394 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 395 : if (iCaseSensitivity==0)
+
+ 00003 8b 45 10 mov eax, DWORD PTR _iCaseSensitivity$[ebp]
+ 00006 85 c0 test eax, eax
+ 00008 74 36 je SHORT $LN3@unzStringF
+
+; 396 : iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE;
+; 397 :
+; 398 : if (iCaseSensitivity==1)
+
+ 0000a 83 f8 01 cmp eax, 1
+ 0000d 75 31 jne SHORT $LN3@unzStringF
+
+; 399 : return strcmp(fileName1,fileName2);
+
+ 0000f 8b 45 0c mov eax, DWORD PTR _fileName2$[ebp]
+ 00012 8b 4d 08 mov ecx, DWORD PTR _fileName1$[ebp]
+$LL5@unzStringF:
+ 00015 8a 11 mov dl, BYTE PTR [ecx]
+ 00017 3a 10 cmp dl, BYTE PTR [eax]
+ 00019 75 1c jne SHORT $LN6@unzStringF
+ 0001b 84 d2 test dl, dl
+ 0001d 74 12 je SHORT $LN7@unzStringF
+ 0001f 8a 51 01 mov dl, BYTE PTR [ecx+1]
+ 00022 3a 50 01 cmp dl, BYTE PTR [eax+1]
+ 00025 75 10 jne SHORT $LN6@unzStringF
+ 00027 83 c1 02 add ecx, 2
+ 0002a 83 c0 02 add eax, 2
+ 0002d 84 d2 test dl, dl
+ 0002f 75 e4 jne SHORT $LL5@unzStringF
+$LN7@unzStringF:
+ 00031 33 c0 xor eax, eax
+
+; 402 : }
+
+ 00033 5d pop ebp
+ 00034 c2 0c 00 ret 12 ; 0000000cH
+$LN6@unzStringF:
+
+; 399 : return strcmp(fileName1,fileName2);
+
+ 00037 1b c0 sbb eax, eax
+ 00039 83 c8 01 or eax, 1
+
+; 402 : }
+
+ 0003c 5d pop ebp
+ 0003d c2 0c 00 ret 12 ; 0000000cH
+$LN3@unzStringF:
+
+; 400 :
+; 401 : return STRCMPCASENOSENTIVEFUNCTION(fileName1,fileName2);
+
+ 00040 8b 55 0c mov edx, DWORD PTR _fileName2$[ebp]
+ 00043 8b 4d 08 mov ecx, DWORD PTR _fileName1$[ebp]
+ 00046 e8 00 00 00 00 call _strcmpcasenosensitive_internal
+
+; 402 : }
+
+ 0004b 5d pop ebp
+ 0004c c2 0c 00 ret 12 ; 0000000cH
+_unzStringFileNameCompare@12 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unz64local_SearchCentralDir
+_TEXT SEGMENT
+_uPosFound$ = -48 ; size = 8
+_uReadPos$1$ = -44 ; size = 4
+_uBackRead$2$ = -40 ; size = 4
+_uReadPos$2$ = -36 ; size = 4
+_pzlib_filefunc_def$1$ = -32 ; size = 4
+_filestream$1$ = -28 ; size = 4
+_uSizeFile$1$ = -24 ; size = 4
+_uSizeFile$2$ = -20 ; size = 4
+_uPosFound$1$ = -16 ; size = 4
+_uPosFound$2$ = -12 ; size = 4
+_uMaxBack$1$ = -8 ; size = 4
+_uMaxBack$2$ = -4 ; size = 4
+_unz64local_SearchCentralDir PROC ; COMDAT
+; _pzlib_filefunc_def$ = ecx
+; _filestream$ = edx
+
+; 414 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 34 sub esp, 52 ; 00000034H
+ 00006 53 push ebx
+ 00007 56 push esi
+ 00008 57 push edi
+
+; 415 : unsigned char* buf;
+; 416 : ZPOS64_T uSizeFile;
+; 417 : ZPOS64_T uBackRead;
+; 418 : ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */
+
+ 00009 33 c0 xor eax, eax
+ 0000b 8b f2 mov esi, edx
+
+; 419 : ZPOS64_T uPosFound=0;
+; 420 :
+; 421 : if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0)
+
+ 0000d 6a 02 push 2
+ 0000f 50 push eax
+ 00010 8b d9 mov ebx, ecx
+ 00012 89 75 e4 mov DWORD PTR _filestream$1$[ebp], esi
+ 00015 0f 57 c0 xorps xmm0, xmm0
+ 00018 89 5d e0 mov DWORD PTR _pzlib_filefunc_def$1$[ebp], ebx
+ 0001b bf ff ff 00 00 mov edi, 65535 ; 0000ffffH
+ 00020 89 45 fc mov DWORD PTR _uMaxBack$2$[ebp], eax
+ 00023 50 push eax
+ 00024 89 7d f8 mov DWORD PTR _uMaxBack$1$[ebp], edi
+ 00027 66 0f 13 45 d0 movlpd QWORD PTR _uPosFound$[ebp], xmm0
+ 0002c e8 00 00 00 00 call _call_zseek64
+ 00031 83 c4 0c add esp, 12 ; 0000000cH
+ 00034 85 c0 test eax, eax
+ 00036 74 0b je SHORT $LN7@unz64local
+
+; 422 : return 0;
+
+ 00038 33 c0 xor eax, eax
+$LN43@unz64local:
+ 0003a 33 d2 xor edx, edx
+
+; 467 : }
+
+ 0003c 5f pop edi
+ 0003d 5e pop esi
+ 0003e 5b pop ebx
+ 0003f 8b e5 mov esp, ebp
+ 00041 5d pop ebp
+ 00042 c3 ret 0
+$LN7@unz64local:
+
+; 423 :
+; 424 :
+; 425 : uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream);
+
+ 00043 8b d6 mov edx, esi
+ 00045 8b cb mov ecx, ebx
+ 00047 e8 00 00 00 00 call _call_ztell64
+ 0004c 8b ca mov ecx, edx
+ 0004e 89 45 e8 mov DWORD PTR _uSizeFile$1$[ebp], eax
+ 00051 89 4d ec mov DWORD PTR _uSizeFile$2$[ebp], ecx
+
+; 426 :
+; 427 : if (uMaxBack>uSizeFile)
+
+ 00054 85 c9 test ecx, ecx
+ 00056 77 11 ja SHORT $LN8@unz64local
+ 00058 72 07 jb SHORT $LN33@unz64local
+ 0005a 3d ff ff 00 00 cmp eax, 65535 ; 0000ffffH
+ 0005f 73 08 jae SHORT $LN8@unz64local
+$LN33@unz64local:
+
+; 428 : uMaxBack = uSizeFile;
+
+ 00061 8b f8 mov edi, eax
+ 00063 89 4d fc mov DWORD PTR _uMaxBack$2$[ebp], ecx
+ 00066 89 7d f8 mov DWORD PTR _uMaxBack$1$[ebp], edi
+$LN8@unz64local:
+
+; 429 :
+; 430 : buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4);
+
+ 00069 68 04 04 00 00 push 1028 ; 00000404H
+ 0006e ff 15 00 00 00
+ 00 call DWORD PTR __imp__malloc
+ 00074 8b f0 mov esi, eax
+ 00076 83 c4 04 add esp, 4
+
+; 431 : if (buf==NULL)
+; 432 : return 0;
+
+ 00079 33 c0 xor eax, eax
+ 0007b 85 f6 test esi, esi
+ 0007d 74 bb je SHORT $LN43@unz64local
+
+; 433 :
+; 434 : uBackRead = 4;
+; 435 : while (uBackRead<uMaxBack)
+
+ 0007f 8b 4d fc mov ecx, DWORD PTR _uMaxBack$2$[ebp]
+ 00082 8d 58 04 lea ebx, DWORD PTR [eax+4]
+ 00085 3b c1 cmp eax, ecx
+ 00087 0f 87 f3 00 00
+ 00 ja $LN42@unz64local
+ 0008d 72 08 jb SHORT $LN40@unz64local
+ 0008f 3b df cmp ebx, edi
+ 00091 0f 83 e9 00 00
+ 00 jae $LN42@unz64local
+$LN40@unz64local:
+ 00097 8b 55 d4 mov edx, DWORD PTR _uPosFound$[ebp+4]
+ 0009a 89 55 f0 mov DWORD PTR _uPosFound$1$[ebp], edx
+ 0009d 8b 55 d0 mov edx, DWORD PTR _uPosFound$[ebp]
+ 000a0 89 55 f4 mov DWORD PTR _uPosFound$2$[ebp], edx
+$LL2@unz64local:
+
+; 436 : {
+; 437 : uLong uReadSize;
+; 438 : ZPOS64_T uReadPos ;
+; 439 : int i;
+; 440 : if (uBackRead+BUFREADCOMMENT>uMaxBack)
+
+ 000a3 81 c3 00 04 00
+ 00 add ebx, 1024 ; 00000400H
+ 000a9 83 d0 00 adc eax, 0
+ 000ac 89 45 d8 mov DWORD PTR _uBackRead$2$[ebp], eax
+ 000af 3b c1 cmp eax, ecx
+ 000b1 72 0d jb SHORT $LN11@unz64local
+ 000b3 77 04 ja SHORT $LN35@unz64local
+ 000b5 3b df cmp ebx, edi
+ 000b7 76 07 jbe SHORT $LN11@unz64local
+$LN35@unz64local:
+
+; 441 : uBackRead = uMaxBack;
+
+ 000b9 8b df mov ebx, edi
+ 000bb 89 4d d8 mov DWORD PTR _uBackRead$2$[ebp], ecx
+ 000be 8b c1 mov eax, ecx
+$LN11@unz64local:
+
+; 442 : else
+; 443 : uBackRead+=BUFREADCOMMENT;
+; 444 : uReadPos = uSizeFile-uBackRead ;
+
+ 000c0 8b 4d e8 mov ecx, DWORD PTR _uSizeFile$1$[ebp]
+ 000c3 8b d1 mov edx, ecx
+ 000c5 8b 7d ec mov edi, DWORD PTR _uSizeFile$2$[ebp]
+ 000c8 2b d3 sub edx, ebx
+ 000ca 89 55 d4 mov DWORD PTR _uReadPos$1$[ebp], edx
+ 000cd 1b f8 sbb edi, eax
+
+; 445 :
+; 446 : uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ?
+
+ 000cf 8b 45 ec mov eax, DWORD PTR _uSizeFile$2$[ebp]
+ 000d2 2b ca sub ecx, edx
+ 000d4 89 7d dc mov DWORD PTR _uReadPos$2$[ebp], edi
+ 000d7 1b c7 sbb eax, edi
+ 000d9 85 c0 test eax, eax
+ 000db 72 11 jb SHORT $LN18@unz64local
+ 000dd 77 08 ja SHORT $LN36@unz64local
+ 000df 81 f9 04 04 00
+ 00 cmp ecx, 1028 ; 00000404H
+ 000e5 76 07 jbe SHORT $LN18@unz64local
+$LN36@unz64local:
+ 000e7 bf 04 04 00 00 mov edi, 1028 ; 00000404H
+ 000ec eb 05 jmp SHORT $LN19@unz64local
+$LN18@unz64local:
+ 000ee 8b 7d e8 mov edi, DWORD PTR _uSizeFile$1$[ebp]
+ 000f1 2b fa sub edi, edx
+$LN19@unz64local:
+
+; 447 : (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos);
+; 448 : if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0)
+
+ 000f3 8b 4d e0 mov ecx, DWORD PTR _pzlib_filefunc_def$1$[ebp]
+ 000f6 6a 00 push 0
+ 000f8 ff 75 dc push DWORD PTR _uReadPos$2$[ebp]
+ 000fb 52 push edx
+ 000fc 8b 55 e4 mov edx, DWORD PTR _filestream$1$[ebp]
+ 000ff e8 00 00 00 00 call _call_zseek64
+ 00104 83 c4 0c add esp, 12 ; 0000000cH
+ 00107 85 c0 test eax, eax
+ 00109 0f 85 7d 00 00
+ 00 jne $LN37@unz64local
+
+; 449 : break;
+; 450 :
+; 451 : if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize)
+
+ 0010f 8b 45 e0 mov eax, DWORD PTR _pzlib_filefunc_def$1$[ebp]
+ 00112 57 push edi
+ 00113 56 push esi
+ 00114 ff 75 e4 push DWORD PTR _filestream$1$[ebp]
+ 00117 ff 70 1c push DWORD PTR [eax+28]
+ 0011a 8b 40 04 mov eax, DWORD PTR [eax+4]
+ 0011d ff d0 call eax
+ 0011f 83 c4 10 add esp, 16 ; 00000010H
+ 00122 3b c7 cmp eax, edi
+ 00124 75 66 jne SHORT $LN37@unz64local
+
+; 452 : break;
+; 453 :
+; 454 : for (i=(int)uReadSize-3; (i--)>0;)
+
+ 00126 8d 47 fd lea eax, DWORD PTR [edi-3]
+ 00129 85 c0 test eax, eax
+ 0012b 7e 36 jle SHORT $LN32@unz64local
+ 0012d 0f 1f 00 npad 3
+$LL4@unz64local:
+ 00130 48 dec eax
+
+; 455 : if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
+; 456 : ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06))
+
+ 00131 80 3c 30 50 cmp BYTE PTR [eax+esi], 80 ; 00000050H
+ 00135 75 15 jne SHORT $LN14@unz64local
+ 00137 80 7c 30 01 4b cmp BYTE PTR [eax+esi+1], 75 ; 0000004bH
+ 0013c 75 0e jne SHORT $LN14@unz64local
+ 0013e 80 7c 30 02 05 cmp BYTE PTR [eax+esi+2], 5
+ 00143 75 07 jne SHORT $LN14@unz64local
+ 00145 80 7c 30 03 06 cmp BYTE PTR [eax+esi+3], 6
+ 0014a 74 06 je SHORT $LN22@unz64local
+$LN14@unz64local:
+
+; 452 : break;
+; 453 :
+; 454 : for (i=(int)uReadSize-3; (i--)>0;)
+
+ 0014c 85 c0 test eax, eax
+ 0014e 7f e0 jg SHORT $LL4@unz64local
+ 00150 eb 11 jmp SHORT $LN32@unz64local
+$LN22@unz64local:
+
+; 457 : {
+; 458 : uPosFound = uReadPos+i;
+
+ 00152 99 cdq
+ 00153 03 45 d4 add eax, DWORD PTR _uReadPos$1$[ebp]
+ 00156 89 45 f4 mov DWORD PTR _uPosFound$2$[ebp], eax
+ 00159 13 55 dc adc edx, DWORD PTR _uReadPos$2$[ebp]
+
+; 459 : break;
+; 460 : }
+; 461 :
+; 462 : if (uPosFound!=0)
+
+ 0015c 0b c2 or eax, edx
+ 0015e 89 55 f0 mov DWORD PTR _uPosFound$1$[ebp], edx
+ 00161 75 29 jne SHORT $LN37@unz64local
+$LN32@unz64local:
+
+; 433 :
+; 434 : uBackRead = 4;
+; 435 : while (uBackRead<uMaxBack)
+
+ 00163 8b 45 d8 mov eax, DWORD PTR _uBackRead$2$[ebp]
+ 00166 8b 4d fc mov ecx, DWORD PTR _uMaxBack$2$[ebp]
+ 00169 8b 7d f8 mov edi, DWORD PTR _uMaxBack$1$[ebp]
+ 0016c 3b c1 cmp eax, ecx
+ 0016e 0f 82 2f ff ff
+ ff jb $LL2@unz64local
+ 00174 77 16 ja SHORT $LN37@unz64local
+ 00176 3b df cmp ebx, edi
+ 00178 0f 82 25 ff ff
+ ff jb $LL2@unz64local
+ 0017e eb 0c jmp SHORT $LN37@unz64local
+$LN42@unz64local:
+ 00180 8b 45 d4 mov eax, DWORD PTR _uPosFound$[ebp+4]
+ 00183 89 45 f0 mov DWORD PTR _uPosFound$1$[ebp], eax
+ 00186 8b 45 d0 mov eax, DWORD PTR _uPosFound$[ebp]
+ 00189 89 45 f4 mov DWORD PTR _uPosFound$2$[ebp], eax
+$LN37@unz64local:
+
+; 463 : break;
+; 464 : }
+; 465 : TRYFREE(buf);
+
+ 0018c 56 push esi
+ 0018d ff 15 00 00 00
+ 00 call DWORD PTR __imp__free
+
+; 466 : return uPosFound;
+
+ 00193 8b 45 f4 mov eax, DWORD PTR _uPosFound$2$[ebp]
+ 00196 83 c4 04 add esp, 4
+ 00199 8b 55 f0 mov edx, DWORD PTR _uPosFound$1$[ebp]
+
+; 467 : }
+
+ 0019c 5f pop edi
+ 0019d 5e pop esi
+ 0019e 5b pop ebx
+ 0019f 8b e5 mov esp, ebp
+ 001a1 5d pop ebp
+ 001a2 c3 ret 0
+_unz64local_SearchCentralDir ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unz64local_SearchCentralDir64
+_TEXT SEGMENT
+_relativeOffset$ = -48 ; size = 8
+_uPosFound$ = -48 ; size = 8
+_uReadPos$1$ = -44 ; size = 4
+_uBackRead$2$ = -40 ; size = 4
+_uReadPos$2$ = -36 ; size = 4
+_uSizeFile$1$ = -32 ; size = 4
+_uSizeFile$2$ = -28 ; size = 4
+_uPosFound$1$ = -24 ; size = 4
+_uPosFound$2$ = -20 ; size = 4
+_uMaxBack$2$ = -16 ; size = 4
+_filestream$1$ = -12 ; size = 4
+_uMaxBack$1$ = -8 ; size = 4
+_uL$ = -8 ; size = 4
+_pzlib_filefunc_def$1$ = -4 ; size = 4
+_unz64local_SearchCentralDir64 PROC ; COMDAT
+; _pzlib_filefunc_def$ = ecx
+; _filestream$ = edx
+
+; 480 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 34 sub esp, 52 ; 00000034H
+ 00006 53 push ebx
+ 00007 56 push esi
+ 00008 57 push edi
+
+; 481 : unsigned char* buf;
+; 482 : ZPOS64_T uSizeFile;
+; 483 : ZPOS64_T uBackRead;
+; 484 : ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */
+
+ 00009 b8 ff ff 00 00 mov eax, 65535 ; 0000ffffH
+ 0000e 8b da mov ebx, edx
+ 00010 89 45 f8 mov DWORD PTR _uMaxBack$1$[ebp], eax
+ 00013 8b f9 mov edi, ecx
+ 00015 33 c0 xor eax, eax
+ 00017 89 5d f4 mov DWORD PTR _filestream$1$[ebp], ebx
+
+; 485 : ZPOS64_T uPosFound=0;
+; 486 : uLong uL;
+; 487 : ZPOS64_T relativeOffset;
+; 488 :
+; 489 : if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0)
+
+ 0001a 6a 02 push 2
+ 0001c 50 push eax
+ 0001d 0f 57 c0 xorps xmm0, xmm0
+ 00020 89 7d fc mov DWORD PTR _pzlib_filefunc_def$1$[ebp], edi
+ 00023 50 push eax
+ 00024 89 45 f0 mov DWORD PTR _uMaxBack$2$[ebp], eax
+ 00027 66 0f 13 45 d0 movlpd QWORD PTR _uPosFound$[ebp], xmm0
+ 0002c e8 00 00 00 00 call _call_zseek64
+ 00031 83 c4 0c add esp, 12 ; 0000000cH
+ 00034 85 c0 test eax, eax
+ 00036 74 0b je SHORT $LN7@unz64local
+$LN61@unz64local:
+
+; 490 : return 0;
+
+ 00038 33 c0 xor eax, eax
+$LN60@unz64local:
+ 0003a 33 d2 xor edx, edx
+
+; 573 : }
+
+ 0003c 5f pop edi
+ 0003d 5e pop esi
+ 0003e 5b pop ebx
+ 0003f 8b e5 mov esp, ebp
+ 00041 5d pop ebp
+ 00042 c3 ret 0
+$LN7@unz64local:
+
+; 491 :
+; 492 :
+; 493 : uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream);
+
+ 00043 8b d3 mov edx, ebx
+ 00045 8b cf mov ecx, edi
+ 00047 e8 00 00 00 00 call _call_ztell64
+ 0004c 8b ca mov ecx, edx
+ 0004e 89 45 e0 mov DWORD PTR _uSizeFile$1$[ebp], eax
+ 00051 89 4d e4 mov DWORD PTR _uSizeFile$2$[ebp], ecx
+
+; 494 :
+; 495 : if (uMaxBack>uSizeFile)
+
+ 00054 85 c9 test ecx, ecx
+ 00056 77 0f ja SHORT $LN8@unz64local
+ 00058 72 07 jb SHORT $LN44@unz64local
+ 0005a 3d ff ff 00 00 cmp eax, 65535 ; 0000ffffH
+ 0005f 73 06 jae SHORT $LN8@unz64local
+$LN44@unz64local:
+
+; 496 : uMaxBack = uSizeFile;
+
+ 00061 89 45 f8 mov DWORD PTR _uMaxBack$1$[ebp], eax
+ 00064 89 4d f0 mov DWORD PTR _uMaxBack$2$[ebp], ecx
+$LN8@unz64local:
+
+; 497 :
+; 498 : buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4);
+
+ 00067 68 04 04 00 00 push 1028 ; 00000404H
+ 0006c ff 15 00 00 00
+ 00 call DWORD PTR __imp__malloc
+ 00072 8b f0 mov esi, eax
+ 00074 83 c4 04 add esp, 4
+
+; 499 : if (buf==NULL)
+; 500 : return 0;
+
+ 00077 33 c0 xor eax, eax
+ 00079 85 f6 test esi, esi
+ 0007b 74 bd je SHORT $LN60@unz64local
+
+; 501 :
+; 502 : uBackRead = 4;
+; 503 : while (uBackRead<uMaxBack)
+
+ 0007d 8b 55 f0 mov edx, DWORD PTR _uMaxBack$2$[ebp]
+ 00080 8d 58 04 lea ebx, DWORD PTR [eax+4]
+ 00083 3b c2 cmp eax, edx
+ 00085 0f 87 f3 01 00
+ 00 ja $LN53@unz64local
+ 0008b 8b 4d f8 mov ecx, DWORD PTR _uMaxBack$1$[ebp]
+ 0008e 72 08 jb SHORT $LN51@unz64local
+ 00090 3b d9 cmp ebx, ecx
+ 00092 0f 83 e6 01 00
+ 00 jae $LN53@unz64local
+$LN51@unz64local:
+ 00098 8b 7d d4 mov edi, DWORD PTR _uPosFound$[ebp+4]
+ 0009b 89 7d e8 mov DWORD PTR _uPosFound$1$[ebp], edi
+ 0009e 8b 7d d0 mov edi, DWORD PTR _uPosFound$[ebp]
+ 000a1 89 7d ec mov DWORD PTR _uPosFound$2$[ebp], edi
+$LL2@unz64local:
+
+; 504 : {
+; 505 : uLong uReadSize;
+; 506 : ZPOS64_T uReadPos;
+; 507 : int i;
+; 508 : if (uBackRead+BUFREADCOMMENT>uMaxBack)
+
+ 000a4 81 c3 00 04 00
+ 00 add ebx, 1024 ; 00000400H
+ 000aa 83 d0 00 adc eax, 0
+ 000ad 89 45 d8 mov DWORD PTR _uBackRead$2$[ebp], eax
+ 000b0 3b c2 cmp eax, edx
+ 000b2 72 0d jb SHORT $LN11@unz64local
+ 000b4 77 04 ja SHORT $LN46@unz64local
+ 000b6 3b d9 cmp ebx, ecx
+ 000b8 76 07 jbe SHORT $LN11@unz64local
+$LN46@unz64local:
+
+; 509 : uBackRead = uMaxBack;
+
+ 000ba 8b d9 mov ebx, ecx
+ 000bc 89 55 d8 mov DWORD PTR _uBackRead$2$[ebp], edx
+ 000bf 8b c2 mov eax, edx
+$LN11@unz64local:
+
+; 510 : else
+; 511 : uBackRead+=BUFREADCOMMENT;
+; 512 : uReadPos = uSizeFile-uBackRead ;
+
+ 000c1 8b 4d e0 mov ecx, DWORD PTR _uSizeFile$1$[ebp]
+ 000c4 8b d1 mov edx, ecx
+ 000c6 8b 7d e4 mov edi, DWORD PTR _uSizeFile$2$[ebp]
+ 000c9 2b d3 sub edx, ebx
+ 000cb 89 55 d4 mov DWORD PTR _uReadPos$1$[ebp], edx
+ 000ce 1b f8 sbb edi, eax
+
+; 513 :
+; 514 : uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ?
+
+ 000d0 8b 45 e4 mov eax, DWORD PTR _uSizeFile$2$[ebp]
+ 000d3 2b ca sub ecx, edx
+ 000d5 89 7d dc mov DWORD PTR _uReadPos$2$[ebp], edi
+ 000d8 1b c7 sbb eax, edi
+ 000da 85 c0 test eax, eax
+ 000dc 72 11 jb SHORT $LN29@unz64local
+ 000de 77 08 ja SHORT $LN47@unz64local
+ 000e0 81 f9 04 04 00
+ 00 cmp ecx, 1028 ; 00000404H
+ 000e6 76 07 jbe SHORT $LN29@unz64local
+$LN47@unz64local:
+ 000e8 bf 04 04 00 00 mov edi, 1028 ; 00000404H
+ 000ed eb 05 jmp SHORT $LN30@unz64local
+$LN29@unz64local:
+ 000ef 8b 7d e0 mov edi, DWORD PTR _uSizeFile$1$[ebp]
+ 000f2 2b fa sub edi, edx
+$LN30@unz64local:
+
+; 515 : (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos);
+; 516 : if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0)
+
+ 000f4 8b 4d fc mov ecx, DWORD PTR _pzlib_filefunc_def$1$[ebp]
+ 000f7 6a 00 push 0
+ 000f9 ff 75 dc push DWORD PTR _uReadPos$2$[ebp]
+ 000fc 52 push edx
+ 000fd 8b 55 f4 mov edx, DWORD PTR _filestream$1$[ebp]
+ 00100 e8 00 00 00 00 call _call_zseek64
+ 00105 83 c4 0c add esp, 12 ; 0000000cH
+ 00108 85 c0 test eax, eax
+ 0010a 75 76 jne SHORT $LN57@unz64local
+
+; 517 : break;
+; 518 :
+; 519 : if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize)
+
+ 0010c 8b 45 fc mov eax, DWORD PTR _pzlib_filefunc_def$1$[ebp]
+ 0010f 57 push edi
+ 00110 56 push esi
+ 00111 ff 75 f4 push DWORD PTR _filestream$1$[ebp]
+ 00114 ff 70 1c push DWORD PTR [eax+28]
+ 00117 8b 40 04 mov eax, DWORD PTR [eax+4]
+ 0011a ff d0 call eax
+ 0011c 83 c4 10 add esp, 16 ; 00000010H
+ 0011f 3b c7 cmp eax, edi
+ 00121 75 5f jne SHORT $LN57@unz64local
+
+; 520 : break;
+; 521 :
+; 522 : for (i=(int)uReadSize-3; (i--)>0;)
+
+ 00123 8d 47 fd lea eax, DWORD PTR [edi-3]
+ 00126 85 c0 test eax, eax
+ 00128 7e 3d jle SHORT $LN43@unz64local
+ 0012a 66 0f 1f 44 00
+ 00 npad 6
+$LL4@unz64local:
+ 00130 48 dec eax
+
+; 523 : if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
+; 524 : ((*(buf+i+2))==0x06) && ((*(buf+i+3))==0x07))
+
+ 00131 80 3c 30 50 cmp BYTE PTR [eax+esi], 80 ; 00000050H
+ 00135 75 15 jne SHORT $LN14@unz64local
+ 00137 80 7c 30 01 4b cmp BYTE PTR [eax+esi+1], 75 ; 0000004bH
+ 0013c 75 0e jne SHORT $LN14@unz64local
+ 0013e 80 7c 30 02 06 cmp BYTE PTR [eax+esi+2], 6
+ 00143 75 07 jne SHORT $LN14@unz64local
+ 00145 80 7c 30 03 07 cmp BYTE PTR [eax+esi+3], 7
+ 0014a 74 06 je SHORT $LN33@unz64local
+$LN14@unz64local:
+
+; 520 : break;
+; 521 :
+; 522 : for (i=(int)uReadSize-3; (i--)>0;)
+
+ 0014c 85 c0 test eax, eax
+ 0014e 7f e0 jg SHORT $LL4@unz64local
+ 00150 eb 15 jmp SHORT $LN43@unz64local
+$LN33@unz64local:
+
+; 525 : {
+; 526 : uPosFound = uReadPos+i;
+
+ 00152 99 cdq
+ 00153 03 45 d4 add eax, DWORD PTR _uReadPos$1$[ebp]
+ 00156 8b fa mov edi, edx
+
+; 527 : break;
+; 528 : }
+; 529 :
+; 530 : if (uPosFound!=0)
+
+ 00158 8b c8 mov ecx, eax
+ 0015a 89 45 ec mov DWORD PTR _uPosFound$2$[ebp], eax
+ 0015d 13 7d dc adc edi, DWORD PTR _uReadPos$2$[ebp]
+ 00160 0b cf or ecx, edi
+ 00162 89 7d e8 mov DWORD PTR _uPosFound$1$[ebp], edi
+ 00165 75 1b jne SHORT $LN57@unz64local
+$LN43@unz64local:
+
+; 501 :
+; 502 : uBackRead = 4;
+; 503 : while (uBackRead<uMaxBack)
+
+ 00167 8b 45 d8 mov eax, DWORD PTR _uBackRead$2$[ebp]
+ 0016a 8b 55 f0 mov edx, DWORD PTR _uMaxBack$2$[ebp]
+ 0016d 8b 4d f8 mov ecx, DWORD PTR _uMaxBack$1$[ebp]
+ 00170 3b c2 cmp eax, edx
+ 00172 0f 82 2c ff ff
+ ff jb $LL2@unz64local
+ 00178 77 08 ja SHORT $LN57@unz64local
+ 0017a 3b d9 cmp ebx, ecx
+ 0017c 0f 82 22 ff ff
+ ff jb $LL2@unz64local
+$LN57@unz64local:
+ 00182 8b 7d fc mov edi, DWORD PTR _pzlib_filefunc_def$1$[ebp]
+$LN48@unz64local:
+
+; 531 : break;
+; 532 : }
+; 533 : TRYFREE(buf);
+
+ 00185 56 push esi
+ 00186 ff 15 00 00 00
+ 00 call DWORD PTR __imp__free
+
+; 534 : if (uPosFound == 0)
+
+ 0018c 8b 55 ec mov edx, DWORD PTR _uPosFound$2$[ebp]
+ 0018f 83 c4 04 add esp, 4
+ 00192 8b 4d e8 mov ecx, DWORD PTR _uPosFound$1$[ebp]
+ 00195 8b c2 mov eax, edx
+ 00197 0b c1 or eax, ecx
+ 00199 0f 84 99 fe ff
+ ff je $LN61@unz64local
+
+; 535 : return 0;
+; 536 :
+; 537 : /* Zip64 end of central directory locator */
+; 538 : if (ZSEEK64(*pzlib_filefunc_def,filestream, uPosFound,ZLIB_FILEFUNC_SEEK_SET)!=0)
+
+ 0019f 8b 5d f4 mov ebx, DWORD PTR _filestream$1$[ebp]
+ 001a2 6a 00 push 0
+ 001a4 51 push ecx
+ 001a5 52 push edx
+ 001a6 8b d3 mov edx, ebx
+ 001a8 8b cf mov ecx, edi
+ 001aa e8 00 00 00 00 call _call_zseek64
+ 001af 83 c4 0c add esp, 12 ; 0000000cH
+ 001b2 85 c0 test eax, eax
+ 001b4 0f 85 7e fe ff
+ ff jne $LN61@unz64local
+
+; 539 : return 0;
+; 540 :
+; 541 : /* the signature, already checked */
+; 542 : if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK)
+
+ 001ba 8d 45 f8 lea eax, DWORD PTR _uL$[ebp]
+ 001bd 8b d3 mov edx, ebx
+ 001bf 50 push eax
+ 001c0 8b cf mov ecx, edi
+ 001c2 e8 00 00 00 00 call _unz64local_getLong
+ 001c7 83 c4 04 add esp, 4
+ 001ca 85 c0 test eax, eax
+ 001cc 0f 85 66 fe ff
+ ff jne $LN61@unz64local
+
+; 543 : return 0;
+; 544 :
+; 545 : /* number of the disk with the start of the zip64 end of central directory */
+; 546 : if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK)
+
+ 001d2 8d 45 f8 lea eax, DWORD PTR _uL$[ebp]
+ 001d5 8b d3 mov edx, ebx
+ 001d7 50 push eax
+ 001d8 8b cf mov ecx, edi
+ 001da e8 00 00 00 00 call _unz64local_getLong
+ 001df 83 c4 04 add esp, 4
+ 001e2 85 c0 test eax, eax
+ 001e4 0f 85 4e fe ff
+ ff jne $LN61@unz64local
+
+; 547 : return 0;
+; 548 : if (uL != 0)
+
+ 001ea 39 45 f8 cmp DWORD PTR _uL$[ebp], eax
+ 001ed 0f 85 45 fe ff
+ ff jne $LN61@unz64local
+
+; 549 : return 0;
+; 550 :
+; 551 : /* relative offset of the zip64 end of central directory record */
+; 552 : if (unz64local_getLong64(pzlib_filefunc_def,filestream,&relativeOffset)!=UNZ_OK)
+
+ 001f3 8d 45 d0 lea eax, DWORD PTR _relativeOffset$[ebp]
+ 001f6 8b d3 mov edx, ebx
+ 001f8 50 push eax
+ 001f9 8b cf mov ecx, edi
+ 001fb e8 00 00 00 00 call _unz64local_getLong64
+ 00200 83 c4 04 add esp, 4
+ 00203 85 c0 test eax, eax
+ 00205 0f 85 2d fe ff
+ ff jne $LN61@unz64local
+
+; 553 : return 0;
+; 554 :
+; 555 : /* total number of disks */
+; 556 : if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK)
+
+ 0020b 8d 45 f8 lea eax, DWORD PTR _uL$[ebp]
+ 0020e 8b d3 mov edx, ebx
+ 00210 50 push eax
+ 00211 8b cf mov ecx, edi
+ 00213 e8 00 00 00 00 call _unz64local_getLong
+ 00218 83 c4 04 add esp, 4
+ 0021b 85 c0 test eax, eax
+ 0021d 0f 85 15 fe ff
+ ff jne $LN61@unz64local
+
+; 557 : return 0;
+; 558 : if (uL != 1)
+
+ 00223 83 7d f8 01 cmp DWORD PTR _uL$[ebp], 1
+ 00227 0f 85 0b fe ff
+ ff jne $LN61@unz64local
+
+; 559 : return 0;
+; 560 :
+; 561 : /* Goto end of central directory record */
+; 562 : if (ZSEEK64(*pzlib_filefunc_def,filestream, relativeOffset,ZLIB_FILEFUNC_SEEK_SET)!=0)
+
+ 0022d 8b 75 d4 mov esi, DWORD PTR _relativeOffset$[ebp+4]
+ 00230 8b d3 mov edx, ebx
+ 00232 8b 7d d0 mov edi, DWORD PTR _relativeOffset$[ebp]
+ 00235 8b 5d fc mov ebx, DWORD PTR _pzlib_filefunc_def$1$[ebp]
+ 00238 8b cb mov ecx, ebx
+ 0023a 50 push eax
+ 0023b 56 push esi
+ 0023c 57 push edi
+ 0023d e8 00 00 00 00 call _call_zseek64
+ 00242 83 c4 0c add esp, 12 ; 0000000cH
+ 00245 85 c0 test eax, eax
+ 00247 0f 85 eb fd ff
+ ff jne $LN61@unz64local
+
+; 563 : return 0;
+; 564 :
+; 565 : /* the signature */
+; 566 : if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK)
+
+ 0024d 8b 55 f4 mov edx, DWORD PTR _filestream$1$[ebp]
+ 00250 8d 45 f8 lea eax, DWORD PTR _uL$[ebp]
+ 00253 50 push eax
+ 00254 8b cb mov ecx, ebx
+ 00256 e8 00 00 00 00 call _unz64local_getLong
+ 0025b 83 c4 04 add esp, 4
+ 0025e 85 c0 test eax, eax
+ 00260 0f 85 d2 fd ff
+ ff jne $LN61@unz64local
+
+; 567 : return 0;
+; 568 :
+; 569 : if (uL != 0x06064b50)
+
+ 00266 81 7d f8 50 4b
+ 06 06 cmp DWORD PTR _uL$[ebp], 101075792 ; 06064b50H
+ 0026d 0f 85 c5 fd ff
+ ff jne $LN61@unz64local
+
+; 570 : return 0;
+; 571 :
+; 572 : return relativeOffset;
+
+ 00273 8b c7 mov eax, edi
+ 00275 8b d6 mov edx, esi
+
+; 573 : }
+
+ 00277 5f pop edi
+ 00278 5e pop esi
+ 00279 5b pop ebx
+ 0027a 8b e5 mov esp, ebp
+ 0027c 5d pop ebp
+ 0027d c3 ret 0
+$LN53@unz64local:
+
+; 501 :
+; 502 : uBackRead = 4;
+; 503 : while (uBackRead<uMaxBack)
+
+ 0027e 8b 45 d4 mov eax, DWORD PTR _uPosFound$[ebp+4]
+ 00281 89 45 e8 mov DWORD PTR _uPosFound$1$[ebp], eax
+ 00284 8b 45 d0 mov eax, DWORD PTR _uPosFound$[ebp]
+ 00287 89 45 ec mov DWORD PTR _uPosFound$2$[ebp], eax
+ 0028a e9 f6 fe ff ff jmp $LN48@unz64local
+_unz64local_SearchCentralDir64 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unzOpenInternal
+_TEXT SEGMENT
+_uL$ = -264 ; size = 4
+_number_disk$ = -260 ; size = 4
+_uS$1 = -260 ; size = 4
+_number_disk_with_CD$ = -256 ; size = 4
+_central_pos$1$ = -252 ; size = 4
+_central_pos$2$ = -248 ; size = 4
+_number_entry_CD$ = -248 ; size = 8
+_uL64$2 = -248 ; size = 8
+_us$ = -240 ; size = 240
+_is64bitOpenFunction$ = 8 ; size = 4
+_unzOpenInternal PROC ; COMDAT
+; _path$ = ecx
+; _pzlib_filefunc64_32_def$ = edx
+
+; 587 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 e4 f8 and esp, -8 ; fffffff8H
+ 00006 81 ec 0c 01 00
+ 00 sub esp, 268 ; 0000010cH
+ 0000c 53 push ebx
+ 0000d 56 push esi
+ 0000e 57 push edi
+
+; 588 : unz64_s us;
+; 589 : unz64_s *s;
+; 590 : ZPOS64_T central_pos;
+; 591 : uLong uL;
+; 592 :
+; 593 : uLong number_disk; /* number of the current dist, used for
+; 594 : spaning ZIP, unsupported, always 0*/
+; 595 : uLong number_disk_with_CD; /* number the the disk with central dir, used
+; 596 : for spaning ZIP, unsupported, always 0*/
+; 597 : ZPOS64_T number_entry_CD; /* total number of entries in
+; 598 : the central dir
+; 599 : (same than number_entry on nospan) */
+; 600 :
+; 601 : int err=UNZ_OK;
+
+ 0000f 33 ff xor edi, edi
+ 00011 8b f1 mov esi, ecx
+
+; 602 :
+; 603 : if (unz_copyright[0]!=' ')
+; 604 : return NULL;
+; 605 :
+; 606 : us.z_filefunc.zseek32_file = NULL;
+
+ 00013 89 7c 24 50 mov DWORD PTR _us$[esp+320], edi
+
+; 607 : us.z_filefunc.ztell32_file = NULL;
+
+ 00017 89 7c 24 4c mov DWORD PTR _us$[esp+316], edi
+
+; 608 : if (pzlib_filefunc64_32_def==NULL)
+
+ 0001b 85 d2 test edx, edx
+ 0001d 75 0b jne SHORT $LN3@unzOpenInt
+
+; 609 : fill_fopen64_filefunc(&us.z_filefunc.zfile_func64);
+
+ 0001f 8d 4c 24 28 lea ecx, DWORD PTR _us$[esp+280]
+ 00023 e8 00 00 00 00 call _fill_fopen64_filefunc
+ 00028 eb 23 jmp SHORT $LN4@unzOpenInt
+$LN3@unzOpenInt:
+
+; 610 : else
+; 611 : us.z_filefunc = *pzlib_filefunc64_32_def;
+
+ 0002a 0f 10 02 movups xmm0, XMMWORD PTR [edx]
+ 0002d 8b 42 28 mov eax, DWORD PTR [edx+40]
+ 00030 89 44 24 50 mov DWORD PTR _us$[esp+320], eax
+ 00034 0f 11 44 24 28 movups XMMWORD PTR _us$[esp+280], xmm0
+ 00039 0f 10 42 10 movups xmm0, XMMWORD PTR [edx+16]
+ 0003d 0f 11 44 24 38 movups XMMWORD PTR _us$[esp+296], xmm0
+ 00042 f3 0f 7e 42 20 movq xmm0, QWORD PTR [edx+32]
+ 00047 66 0f d6 44 24
+ 48 movq QWORD PTR _us$[esp+312], xmm0
+$LN4@unzOpenInt:
+
+; 612 : us.is64bitOpenFunction = is64bitOpenFunction;
+
+ 0004d 8b 45 08 mov eax, DWORD PTR _is64bitOpenFunction$[ebp]
+
+; 613 :
+; 614 :
+; 615 :
+; 616 : us.filestream = ZOPEN64(us.z_filefunc,
+
+ 00050 8d 4c 24 28 lea ecx, DWORD PTR _us$[esp+280]
+ 00054 6a 05 push 5
+ 00056 8b d6 mov edx, esi
+ 00058 89 44 24 58 mov DWORD PTR _us$[esp+328], eax
+ 0005c e8 00 00 00 00 call _call_zopen64
+ 00061 8b d8 mov ebx, eax
+ 00063 83 c4 04 add esp, 4
+ 00066 89 5c 24 58 mov DWORD PTR _us$[esp+328], ebx
+
+; 617 : path,
+; 618 : ZLIB_FILEFUNC_MODE_READ |
+; 619 : ZLIB_FILEFUNC_MODE_EXISTING);
+; 620 : if (us.filestream==NULL)
+
+ 0006a 85 db test ebx, ebx
+ 0006c 0f 84 a5 03 00
+ 00 je $LN39@unzOpenInt
+
+; 621 : return NULL;
+; 622 :
+; 623 : central_pos = unz64local_SearchCentralDir64(&us.z_filefunc,us.filestream);
+
+ 00072 8b d3 mov edx, ebx
+ 00074 8d 4c 24 28 lea ecx, DWORD PTR _us$[esp+280]
+ 00078 e8 00 00 00 00 call _unz64local_SearchCentralDir64
+ 0007d 8b f0 mov esi, eax
+ 0007f 8b c2 mov eax, edx
+
+; 624 : if (central_pos)
+
+ 00081 8b ce mov ecx, esi
+ 00083 89 44 24 1c mov DWORD PTR _central_pos$1$[esp+280], eax
+ 00087 0b c8 or ecx, eax
+
+; 625 : {
+; 626 : uLong uS;
+; 627 : ZPOS64_T uL64;
+; 628 :
+; 629 : us.isZip64 = 1;
+; 630 :
+; 631 : if (ZSEEK64(us.z_filefunc, us.filestream,
+; 632 : central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0)
+
+ 00089 8b d3 mov edx, ebx
+ 0008b 8d 4c 24 28 lea ecx, DWORD PTR _us$[esp+280]
+ 0008f 0f 84 72 01 00
+ 00 je $LN6@unzOpenInt
+ 00095 6a 00 push 0
+ 00097 50 push eax
+ 00098 56 push esi
+ 00099 c7 84 24 1c 01
+ 00 00 01 00 00
+ 00 mov DWORD PTR _us$[esp+524], 1
+ 000a4 e8 00 00 00 00 call _call_zseek64
+ 000a9 83 c9 ff or ecx, -1
+ 000ac 83 c4 0c add esp, 12 ; 0000000cH
+ 000af 85 c0 test eax, eax
+
+; 633 : err=UNZ_ERRNO;
+; 634 :
+; 635 : /* the signature, already checked */
+; 636 : if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK)
+
+ 000b1 8b d3 mov edx, ebx
+ 000b3 8d 44 24 10 lea eax, DWORD PTR _uL$[esp+280]
+ 000b7 0f 45 f9 cmovne edi, ecx
+ 000ba 8d 4c 24 28 lea ecx, DWORD PTR _us$[esp+280]
+ 000be 50 push eax
+ 000bf e8 00 00 00 00 call _unz64local_getLong
+ 000c4 83 c4 04 add esp, 4
+
+; 637 : err=UNZ_ERRNO;
+; 638 :
+; 639 : /* size of zip64 end of central directory record */
+; 640 : if (unz64local_getLong64(&us.z_filefunc, us.filestream,&uL64)!=UNZ_OK)
+
+ 000c7 8d 4c 24 28 lea ecx, DWORD PTR _us$[esp+280]
+ 000cb 85 c0 test eax, eax
+ 000cd 8b d3 mov edx, ebx
+ 000cf b8 ff ff ff ff mov eax, -1
+ 000d4 0f 45 f8 cmovne edi, eax
+ 000d7 8d 44 24 20 lea eax, DWORD PTR _uL64$2[esp+280]
+ 000db 50 push eax
+ 000dc e8 00 00 00 00 call _unz64local_getLong64
+ 000e1 83 c4 04 add esp, 4
+
+; 641 : err=UNZ_ERRNO;
+; 642 :
+; 643 : /* version made by */
+; 644 : if (unz64local_getShort(&us.z_filefunc, us.filestream,&uS)!=UNZ_OK)
+
+ 000e4 8d 4c 24 28 lea ecx, DWORD PTR _us$[esp+280]
+ 000e8 85 c0 test eax, eax
+ 000ea 8b d3 mov edx, ebx
+ 000ec b8 ff ff ff ff mov eax, -1
+ 000f1 0f 45 f8 cmovne edi, eax
+ 000f4 8d 44 24 14 lea eax, DWORD PTR _uS$1[esp+280]
+ 000f8 50 push eax
+ 000f9 e8 00 00 00 00 call _unz64local_getShort
+ 000fe 83 c4 04 add esp, 4
+
+; 645 : err=UNZ_ERRNO;
+; 646 :
+; 647 : /* version needed to extract */
+; 648 : if (unz64local_getShort(&us.z_filefunc, us.filestream,&uS)!=UNZ_OK)
+
+ 00101 8d 4c 24 28 lea ecx, DWORD PTR _us$[esp+280]
+ 00105 85 c0 test eax, eax
+ 00107 8b d3 mov edx, ebx
+ 00109 b8 ff ff ff ff mov eax, -1
+ 0010e 0f 45 f8 cmovne edi, eax
+ 00111 8d 44 24 14 lea eax, DWORD PTR _uS$1[esp+280]
+ 00115 50 push eax
+ 00116 e8 00 00 00 00 call _unz64local_getShort
+ 0011b 83 c4 04 add esp, 4
+
+; 649 : err=UNZ_ERRNO;
+; 650 :
+; 651 : /* number of this disk */
+; 652 : if (unz64local_getLong(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK)
+
+ 0011e 8d 4c 24 28 lea ecx, DWORD PTR _us$[esp+280]
+ 00122 85 c0 test eax, eax
+ 00124 8b d3 mov edx, ebx
+ 00126 b8 ff ff ff ff mov eax, -1
+ 0012b 0f 45 f8 cmovne edi, eax
+ 0012e 8d 44 24 14 lea eax, DWORD PTR _number_disk$[esp+280]
+ 00132 50 push eax
+ 00133 e8 00 00 00 00 call _unz64local_getLong
+ 00138 83 c4 04 add esp, 4
+
+; 653 : err=UNZ_ERRNO;
+; 654 :
+; 655 : /* number of the disk with the start of the central directory */
+; 656 : if (unz64local_getLong(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK)
+
+ 0013b 8d 4c 24 28 lea ecx, DWORD PTR _us$[esp+280]
+ 0013f 85 c0 test eax, eax
+ 00141 8b d3 mov edx, ebx
+ 00143 b8 ff ff ff ff mov eax, -1
+ 00148 0f 45 f8 cmovne edi, eax
+ 0014b 8d 44 24 18 lea eax, DWORD PTR _number_disk_with_CD$[esp+280]
+ 0014f 50 push eax
+ 00150 e8 00 00 00 00 call _unz64local_getLong
+ 00155 83 c4 04 add esp, 4
+
+; 657 : err=UNZ_ERRNO;
+; 658 :
+; 659 : /* total number of entries in the central directory on this disk */
+; 660 : if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.gi.number_entry)!=UNZ_OK)
+
+ 00158 8d 4c 24 28 lea ecx, DWORD PTR _us$[esp+280]
+ 0015c 85 c0 test eax, eax
+ 0015e 8b d3 mov edx, ebx
+ 00160 b8 ff ff ff ff mov eax, -1
+ 00165 0f 45 f8 cmovne edi, eax
+ 00168 8d 44 24 60 lea eax, DWORD PTR _us$[esp+336]
+ 0016c 50 push eax
+ 0016d e8 00 00 00 00 call _unz64local_getLong64
+
+; 661 : err=UNZ_ERRNO;
+; 662 :
+; 663 : /* total number of entries in the central directory */
+; 664 : if (unz64local_getLong64(&us.z_filefunc, us.filestream,&number_entry_CD)!=UNZ_OK)
+
+ 00172 8b 54 24 5c mov edx, DWORD PTR _us$[esp+332]
+ 00176 8d 4c 24 2c lea ecx, DWORD PTR _us$[esp+284]
+ 0017a 83 c4 04 add esp, 4
+ 0017d bb ff ff ff ff mov ebx, -1
+ 00182 85 c0 test eax, eax
+ 00184 8d 44 24 20 lea eax, DWORD PTR _number_entry_CD$[esp+280]
+ 00188 0f 45 fb cmovne edi, ebx
+ 0018b 50 push eax
+ 0018c e8 00 00 00 00 call _unz64local_getLong64
+ 00191 83 c4 04 add esp, 4
+ 00194 85 c0 test eax, eax
+
+; 665 : err=UNZ_ERRNO;
+; 666 :
+; 667 : if ((number_entry_CD!=us.gi.number_entry) ||
+; 668 : (number_disk_with_CD!=0) ||
+
+ 00196 8b 44 24 20 mov eax, DWORD PTR _number_entry_CD$[esp+280]
+ 0019a 0f 45 fb cmovne edi, ebx
+ 0019d 3b 44 24 60 cmp eax, DWORD PTR _us$[esp+336]
+ 001a1 75 18 jne SHORT $LN18@unzOpenInt
+ 001a3 8b 44 24 24 mov eax, DWORD PTR _number_entry_CD$[esp+284]
+ 001a7 3b 44 24 64 cmp eax, DWORD PTR _us$[esp+340]
+ 001ab 75 0e jne SHORT $LN18@unzOpenInt
+ 001ad 83 7c 24 18 00 cmp DWORD PTR _number_disk_with_CD$[esp+280], 0
+ 001b2 75 07 jne SHORT $LN18@unzOpenInt
+ 001b4 83 7c 24 14 00 cmp DWORD PTR _number_disk$[esp+280], 0
+ 001b9 74 05 je SHORT $LN17@unzOpenInt
+$LN18@unzOpenInt:
+
+; 669 : (number_disk!=0))
+; 670 : err=UNZ_BADZIPFILE;
+
+ 001bb bf 99 ff ff ff mov edi, -103 ; ffffff99H
+$LN17@unzOpenInt:
+
+; 671 :
+; 672 : /* size of the central directory */
+; 673 : if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.size_central_dir)!=UNZ_OK)
+
+ 001c0 8b 54 24 58 mov edx, DWORD PTR _us$[esp+328]
+ 001c4 8d 84 24 98 00
+ 00 00 lea eax, DWORD PTR _us$[esp+392]
+ 001cb 50 push eax
+ 001cc 8d 4c 24 2c lea ecx, DWORD PTR _us$[esp+284]
+ 001d0 e8 00 00 00 00 call _unz64local_getLong64
+
+; 674 : err=UNZ_ERRNO;
+; 675 :
+; 676 : /* offset of start of central directory with respect to the
+; 677 : starting disk number */
+; 678 : if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.offset_central_dir)!=UNZ_OK)
+
+ 001d5 8b 54 24 5c mov edx, DWORD PTR _us$[esp+332]
+ 001d9 8d 4c 24 2c lea ecx, DWORD PTR _us$[esp+284]
+ 001dd 83 c4 04 add esp, 4
+ 001e0 85 c0 test eax, eax
+ 001e2 8d 84 24 a0 00
+ 00 00 lea eax, DWORD PTR _us$[esp+400]
+ 001e9 0f 45 fb cmovne edi, ebx
+ 001ec 50 push eax
+ 001ed e8 00 00 00 00 call _unz64local_getLong64
+ 001f2 83 c4 04 add esp, 4
+
+; 679 : err=UNZ_ERRNO;
+; 680 :
+; 681 : us.gi.size_comment = 0;
+
+ 001f5 c7 44 24 68 00
+ 00 00 00 mov DWORD PTR _us$[esp+344], 0
+ 001fd 85 c0 test eax, eax
+ 001ff 0f 45 fb cmovne edi, ebx
+
+; 682 : }
+
+ 00202 e9 62 01 00 00 jmp $LN32@unzOpenInt
+$LN6@unzOpenInt:
+
+; 683 : else
+; 684 : {
+; 685 : central_pos = unz64local_SearchCentralDir(&us.z_filefunc,us.filestream);
+
+ 00207 e8 00 00 00 00 call _unz64local_SearchCentralDir
+ 0020c 8b c8 mov ecx, eax
+ 0020e 89 54 24 1c mov DWORD PTR _central_pos$1$[esp+280], edx
+
+; 686 : if (central_pos==0)
+
+ 00212 0b c2 or eax, edx
+ 00214 89 4c 24 20 mov DWORD PTR _central_pos$2$[esp+280], ecx
+ 00218 75 03 jne SHORT $LN21@unzOpenInt
+
+; 687 : err=UNZ_ERRNO;
+
+ 0021a 83 cf ff or edi, -1
+$LN21@unzOpenInt:
+
+; 688 :
+; 689 : us.isZip64 = 0;
+; 690 :
+; 691 : if (ZSEEK64(us.z_filefunc, us.filestream,
+; 692 : central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0)
+
+ 0021d 6a 00 push 0
+ 0021f 52 push edx
+ 00220 51 push ecx
+ 00221 8b d3 mov edx, ebx
+ 00223 c7 84 24 1c 01
+ 00 00 00 00 00
+ 00 mov DWORD PTR _us$[esp+524], 0
+ 0022e 8d 4c 24 34 lea ecx, DWORD PTR _us$[esp+292]
+ 00232 e8 00 00 00 00 call _call_zseek64
+ 00237 83 c4 0c add esp, 12 ; 0000000cH
+
+; 693 : err=UNZ_ERRNO;
+; 694 :
+; 695 : /* the signature, already checked */
+; 696 : if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK)
+
+ 0023a 8d 4c 24 28 lea ecx, DWORD PTR _us$[esp+280]
+ 0023e 83 ce ff or esi, -1
+ 00241 8b d3 mov edx, ebx
+ 00243 85 c0 test eax, eax
+ 00245 8d 44 24 10 lea eax, DWORD PTR _uL$[esp+280]
+ 00249 50 push eax
+ 0024a 0f 45 fe cmovne edi, esi
+ 0024d e8 00 00 00 00 call _unz64local_getLong
+ 00252 83 c4 04 add esp, 4
+
+; 697 : err=UNZ_ERRNO;
+; 698 :
+; 699 : /* number of this disk */
+; 700 : if (unz64local_getShort(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK)
+
+ 00255 8d 4c 24 28 lea ecx, DWORD PTR _us$[esp+280]
+ 00259 85 c0 test eax, eax
+ 0025b 8b d3 mov edx, ebx
+ 0025d 8d 44 24 14 lea eax, DWORD PTR _number_disk$[esp+280]
+ 00261 0f 45 fe cmovne edi, esi
+ 00264 50 push eax
+ 00265 e8 00 00 00 00 call _unz64local_getShort
+ 0026a 83 c4 04 add esp, 4
+
+; 701 : err=UNZ_ERRNO;
+; 702 :
+; 703 : /* number of the disk with the start of the central directory */
+; 704 : if (unz64local_getShort(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK)
+
+ 0026d 8d 4c 24 28 lea ecx, DWORD PTR _us$[esp+280]
+ 00271 85 c0 test eax, eax
+ 00273 8b d3 mov edx, ebx
+ 00275 8d 44 24 18 lea eax, DWORD PTR _number_disk_with_CD$[esp+280]
+ 00279 0f 45 fe cmovne edi, esi
+ 0027c 50 push eax
+ 0027d e8 00 00 00 00 call _unz64local_getShort
+ 00282 83 c4 04 add esp, 4
+
+; 705 : err=UNZ_ERRNO;
+; 706 :
+; 707 : /* total number of entries in the central dir on this disk */
+; 708 : if (unz64local_getShort(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK)
+
+ 00285 8d 4c 24 28 lea ecx, DWORD PTR _us$[esp+280]
+ 00289 85 c0 test eax, eax
+ 0028b 8b d3 mov edx, ebx
+ 0028d 8d 44 24 10 lea eax, DWORD PTR _uL$[esp+280]
+ 00291 0f 45 fe cmovne edi, esi
+ 00294 50 push eax
+ 00295 e8 00 00 00 00 call _unz64local_getShort
+ 0029a 83 c4 04 add esp, 4
+
+; 709 : err=UNZ_ERRNO;
+; 710 : us.gi.number_entry = uL;
+
+ 0029d c7 44 24 64 00
+ 00 00 00 mov DWORD PTR _us$[esp+340], 0
+ 002a5 85 c0 test eax, eax
+
+; 711 :
+; 712 : /* total number of entries in the central dir */
+; 713 : if (unz64local_getShort(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK)
+
+ 002a7 8d 4c 24 28 lea ecx, DWORD PTR _us$[esp+280]
+ 002ab 8d 44 24 10 lea eax, DWORD PTR _uL$[esp+280]
+ 002af 8b d3 mov edx, ebx
+ 002b1 0f 45 fe cmovne edi, esi
+ 002b4 8b 74 24 10 mov esi, DWORD PTR _uL$[esp+280]
+ 002b8 50 push eax
+ 002b9 89 74 24 64 mov DWORD PTR _us$[esp+340], esi
+ 002bd e8 00 00 00 00 call _unz64local_getShort
+ 002c2 83 c4 04 add esp, 4
+ 002c5 85 c0 test eax, eax
+ 002c7 b8 ff ff ff ff mov eax, -1
+ 002cc 0f 45 f8 cmovne edi, eax
+
+; 714 : err=UNZ_ERRNO;
+; 715 : number_entry_CD = uL;
+
+ 002cf 33 c0 xor eax, eax
+
+; 716 :
+; 717 : if ((number_entry_CD!=us.gi.number_entry) ||
+; 718 : (number_disk_with_CD!=0) ||
+
+ 002d1 39 74 24 10 cmp DWORD PTR _uL$[esp+280], esi
+ 002d5 75 10 jne SHORT $LN29@unzOpenInt
+ 002d7 85 c0 test eax, eax
+ 002d9 75 0c jne SHORT $LN29@unzOpenInt
+ 002db 39 44 24 18 cmp DWORD PTR _number_disk_with_CD$[esp+280], eax
+ 002df 75 06 jne SHORT $LN29@unzOpenInt
+ 002e1 39 44 24 14 cmp DWORD PTR _number_disk$[esp+280], eax
+ 002e5 74 05 je SHORT $LN28@unzOpenInt
+$LN29@unzOpenInt:
+
+; 719 : (number_disk!=0))
+; 720 : err=UNZ_BADZIPFILE;
+
+ 002e7 bf 99 ff ff ff mov edi, -103 ; ffffff99H
+$LN28@unzOpenInt:
+
+; 721 :
+; 722 : /* size of the central directory */
+; 723 : if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK)
+
+ 002ec 8d 44 24 10 lea eax, DWORD PTR _uL$[esp+280]
+ 002f0 8b d3 mov edx, ebx
+ 002f2 50 push eax
+ 002f3 8d 4c 24 2c lea ecx, DWORD PTR _us$[esp+284]
+ 002f7 e8 00 00 00 00 call _unz64local_getLong
+ 002fc 83 c4 04 add esp, 4
+
+; 724 : err=UNZ_ERRNO;
+; 725 : us.size_central_dir = uL;
+
+ 002ff c7 84 24 9c 00
+ 00 00 00 00 00
+ 00 mov DWORD PTR _us$[esp+396], 0
+ 0030a 85 c0 test eax, eax
+
+; 726 :
+; 727 : /* offset of start of central directory with respect to the
+; 728 : starting disk number */
+; 729 : if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK)
+
+ 0030c 8d 4c 24 28 lea ecx, DWORD PTR _us$[esp+280]
+ 00310 8b 44 24 10 mov eax, DWORD PTR _uL$[esp+280]
+ 00314 be ff ff ff ff mov esi, -1
+ 00319 89 84 24 98 00
+ 00 00 mov DWORD PTR _us$[esp+392], eax
+ 00320 8b d3 mov edx, ebx
+ 00322 8d 44 24 10 lea eax, DWORD PTR _uL$[esp+280]
+ 00326 0f 45 fe cmovne edi, esi
+ 00329 50 push eax
+ 0032a e8 00 00 00 00 call _unz64local_getLong
+ 0032f 83 c4 04 add esp, 4
+
+; 730 : err=UNZ_ERRNO;
+; 731 : us.offset_central_dir = uL;
+
+ 00332 c7 84 24 a4 00
+ 00 00 00 00 00
+ 00 mov DWORD PTR _us$[esp+404], 0
+ 0033d 85 c0 test eax, eax
+
+; 732 :
+; 733 : /* zipfile comment length */
+; 734 : if (unz64local_getShort(&us.z_filefunc, us.filestream,&us.gi.size_comment)!=UNZ_OK)
+
+ 0033f 8d 4c 24 28 lea ecx, DWORD PTR _us$[esp+280]
+ 00343 8b 44 24 10 mov eax, DWORD PTR _uL$[esp+280]
+ 00347 8b d3 mov edx, ebx
+ 00349 89 84 24 a0 00
+ 00 00 mov DWORD PTR _us$[esp+400], eax
+ 00350 0f 45 fe cmovne edi, esi
+ 00353 8d 44 24 68 lea eax, DWORD PTR _us$[esp+344]
+ 00357 50 push eax
+ 00358 e8 00 00 00 00 call _unz64local_getShort
+ 0035d 83 c4 04 add esp, 4
+ 00360 85 c0 test eax, eax
+ 00362 0f 45 fe cmovne edi, esi
+ 00365 8b 74 24 20 mov esi, DWORD PTR _central_pos$2$[esp+280]
+$LN32@unzOpenInt:
+
+; 735 : err=UNZ_ERRNO;
+; 736 : }
+; 737 :
+; 738 : if ((central_pos<us.offset_central_dir+us.size_central_dir) &&
+
+ 00369 8b 9c 24 a0 00
+ 00 00 mov ebx, DWORD PTR _us$[esp+400]
+ 00370 8b cb mov ecx, ebx
+ 00372 03 8c 24 98 00
+ 00 00 add ecx, DWORD PTR _us$[esp+392]
+ 00379 8b 84 24 a4 00
+ 00 00 mov eax, DWORD PTR _us$[esp+404]
+ 00380 13 84 24 9c 00
+ 00 00 adc eax, DWORD PTR _us$[esp+396]
+ 00387 8b 54 24 1c mov edx, DWORD PTR _central_pos$1$[esp+280]
+ 0038b 3b d0 cmp edx, eax
+ 0038d 72 79 jb SHORT $LN37@unzOpenInt
+ 0038f 77 04 ja SHORT $LN38@unzOpenInt
+ 00391 3b f1 cmp esi, ecx
+ 00393 72 73 jb SHORT $LN37@unzOpenInt
+$LN38@unzOpenInt:
+
+; 739 : (err==UNZ_OK))
+; 740 : err=UNZ_BADZIPFILE;
+; 741 :
+; 742 : if (err!=UNZ_OK)
+
+ 00395 85 ff test edi, edi
+ 00397 75 6f jne SHORT $LN37@unzOpenInt
+
+; 745 : return NULL;
+; 746 : }
+; 747 :
+; 748 : us.byte_before_the_zipfile = central_pos -
+
+ 00399 8b ce mov ecx, esi
+
+; 749 : (us.offset_central_dir+us.size_central_dir);
+; 750 : us.central_pos = central_pos;
+
+ 0039b 89 b4 24 90 00
+ 00 00 mov DWORD PTR _us$[esp+384], esi
+ 003a2 2b cb sub ecx, ebx
+ 003a4 89 94 24 94 00
+ 00 00 mov DWORD PTR _us$[esp+388], edx
+ 003ab 8b c2 mov eax, edx
+
+; 751 : us.pfile_in_zip_read = NULL;
+
+ 003ad 89 bc 24 08 01
+ 00 00 mov DWORD PTR _us$[esp+504], edi
+ 003b4 1b 84 24 a4 00
+ 00 00 sbb eax, DWORD PTR _us$[esp+404]
+ 003bb 2b 8c 24 98 00
+ 00 00 sub ecx, DWORD PTR _us$[esp+392]
+
+; 752 : us.encrypted = 0;
+; 753 :
+; 754 :
+; 755 : s=(unz64_s*)ALLOC(sizeof(unz64_s));
+
+ 003c2 68 f0 00 00 00 push 240 ; 000000f0H
+ 003c7 1b 84 24 a0 00
+ 00 00 sbb eax, DWORD PTR _us$[esp+400]
+ 003ce 89 4c 24 74 mov DWORD PTR _us$[esp+356], ecx
+ 003d2 89 44 24 78 mov DWORD PTR _us$[esp+360], eax
+ 003d6 89 bc 24 10 01
+ 00 00 mov DWORD PTR _us$[esp+512], edi
+ 003dd ff 15 00 00 00
+ 00 call DWORD PTR __imp__malloc
+ 003e3 8b d8 mov ebx, eax
+ 003e5 83 c4 04 add esp, 4
+
+; 756 : if( s != NULL)
+
+ 003e8 85 db test ebx, ebx
+ 003ea 74 13 je SHORT $LN35@unzOpenInt
+
+; 757 : {
+; 758 : *s=us;
+
+ 003ec b9 3c 00 00 00 mov ecx, 60 ; 0000003cH
+ 003f1 8d 74 24 28 lea esi, DWORD PTR _us$[esp+280]
+ 003f5 8b fb mov edi, ebx
+ 003f7 f3 a5 rep movsd
+
+; 759 : unzGoToFirstFile((unzFile)s);
+
+ 003f9 53 push ebx
+ 003fa e8 00 00 00 00 call _unzGoToFirstFile@4
+$LN35@unzOpenInt:
+
+; 760 : }
+; 761 : return (unzFile)s;
+
+ 003ff 8b c3 mov eax, ebx
+
+; 762 : }
+
+ 00401 5f pop edi
+ 00402 5e pop esi
+ 00403 5b pop ebx
+ 00404 8b e5 mov esp, ebp
+ 00406 5d pop ebp
+ 00407 c3 ret 0
+$LN37@unzOpenInt:
+
+; 743 : {
+; 744 : ZCLOSE64(us.z_filefunc, us.filestream);
+
+ 00408 ff 74 24 58 push DWORD PTR _us$[esp+328]
+ 0040c ff 74 24 48 push DWORD PTR _us$[esp+312]
+ 00410 ff 54 24 44 call DWORD PTR _us$[esp+308]
+ 00414 83 c4 08 add esp, 8
+$LN39@unzOpenInt:
+
+; 762 : }
+
+ 00417 5f pop edi
+ 00418 5e pop esi
+ 00419 33 c0 xor eax, eax
+ 0041b 5b pop ebx
+ 0041c 8b e5 mov esp, ebp
+ 0041e 5d pop ebp
+ 0041f c3 ret 0
+_unzOpenInternal ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unzOpen2@8
+_TEXT SEGMENT
+_zlib_filefunc64_32_def_fill$1 = -44 ; size = 44
+_path$ = 8 ; size = 4
+_pzlib_filefunc32_def$ = 12 ; size = 4
+_unzOpen2@8 PROC ; COMDAT
+
+; 767 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 e4 f8 and esp, -8 ; fffffff8H
+
+; 768 : if (pzlib_filefunc32_def != NULL)
+
+ 00006 8b 55 0c mov edx, DWORD PTR _pzlib_filefunc32_def$[ebp]
+ 00009 83 ec 30 sub esp, 48 ; 00000030H
+ 0000c 85 d2 test edx, edx
+ 0000e 74 1e je SHORT $LN2@unzOpen2
+
+; 769 : {
+; 770 : zlib_filefunc64_32_def zlib_filefunc64_32_def_fill;
+; 771 : fill_zlib_filefunc64_32_def_from_filefunc32(&zlib_filefunc64_32_def_fill,pzlib_filefunc32_def);
+
+ 00010 8d 4c 24 04 lea ecx, DWORD PTR _zlib_filefunc64_32_def_fill$1[esp+48]
+ 00014 e8 00 00 00 00 call _fill_zlib_filefunc64_32_def_from_filefunc32
+
+; 772 : return unzOpenInternal(path, &zlib_filefunc64_32_def_fill, 0);
+
+ 00019 8b d1 mov edx, ecx
+
+; 773 : }
+; 774 : else
+; 775 : return unzOpenInternal(path, NULL, 0);
+
+ 0001b 8b 4d 08 mov ecx, DWORD PTR _path$[ebp]
+ 0001e 6a 00 push 0
+ 00020 e8 00 00 00 00 call _unzOpenInternal
+ 00025 83 c4 04 add esp, 4
+
+; 776 : }
+
+ 00028 8b e5 mov esp, ebp
+ 0002a 5d pop ebp
+ 0002b c2 08 00 ret 8
+$LN2@unzOpen2:
+
+; 773 : }
+; 774 : else
+; 775 : return unzOpenInternal(path, NULL, 0);
+
+ 0002e 8b 4d 08 mov ecx, DWORD PTR _path$[ebp]
+ 00031 33 d2 xor edx, edx
+ 00033 52 push edx
+ 00034 e8 00 00 00 00 call _unzOpenInternal
+ 00039 83 c4 04 add esp, 4
+
+; 776 : }
+
+ 0003c 8b e5 mov esp, ebp
+ 0003e 5d pop ebp
+ 0003f c2 08 00 ret 8
+_unzOpen2@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unzOpen2_64@8
+_TEXT SEGMENT
+_zlib_filefunc64_32_def_fill$1 = -44 ; size = 44
+_path$ = 8 ; size = 4
+_pzlib_filefunc_def$ = 12 ; size = 4
+_unzOpen2_64@8 PROC ; COMDAT
+
+; 780 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 e4 f8 and esp, -8 ; fffffff8H
+
+; 781 : if (pzlib_filefunc_def != NULL)
+
+ 00006 8b 45 0c mov eax, DWORD PTR _pzlib_filefunc_def$[ebp]
+ 00009 83 ec 30 sub esp, 48 ; 00000030H
+
+; 782 : {
+; 783 : zlib_filefunc64_32_def zlib_filefunc64_32_def_fill;
+; 784 : zlib_filefunc64_32_def_fill.zfile_func64 = *pzlib_filefunc_def;
+; 785 : zlib_filefunc64_32_def_fill.ztell32_file = NULL;
+; 786 : zlib_filefunc64_32_def_fill.zseek32_file = NULL;
+; 787 : return unzOpenInternal(path, &zlib_filefunc64_32_def_fill, 1);
+
+ 0000c 8b 4d 08 mov ecx, DWORD PTR _path$[ebp]
+ 0000f 6a 01 push 1
+ 00011 85 c0 test eax, eax
+ 00013 74 33 je SHORT $LN2@unzOpen2_6
+ 00015 0f 10 00 movups xmm0, XMMWORD PTR [eax]
+ 00018 8d 54 24 08 lea edx, DWORD PTR _zlib_filefunc64_32_def_fill$1[esp+52]
+ 0001c c7 44 24 2c 00
+ 00 00 00 mov DWORD PTR _zlib_filefunc64_32_def_fill$1[esp+88], 0
+ 00024 c7 44 24 30 00
+ 00 00 00 mov DWORD PTR _zlib_filefunc64_32_def_fill$1[esp+92], 0
+ 0002c 0f 11 44 24 08 movups XMMWORD PTR _zlib_filefunc64_32_def_fill$1[esp+52], xmm0
+ 00031 0f 10 40 10 movups xmm0, XMMWORD PTR [eax+16]
+ 00035 0f 11 44 24 18 movups XMMWORD PTR _zlib_filefunc64_32_def_fill$1[esp+68], xmm0
+
+; 788 : }
+; 789 : else
+; 790 : return unzOpenInternal(path, NULL, 1);
+
+ 0003a e8 00 00 00 00 call _unzOpenInternal
+ 0003f 83 c4 04 add esp, 4
+
+; 791 : }
+
+ 00042 8b e5 mov esp, ebp
+ 00044 5d pop ebp
+ 00045 c2 08 00 ret 8
+$LN2@unzOpen2_6:
+
+; 788 : }
+; 789 : else
+; 790 : return unzOpenInternal(path, NULL, 1);
+
+ 00048 33 d2 xor edx, edx
+ 0004a e8 00 00 00 00 call _unzOpenInternal
+ 0004f 83 c4 04 add esp, 4
+
+; 791 : }
+
+ 00052 8b e5 mov esp, ebp
+ 00054 5d pop ebp
+ 00055 c2 08 00 ret 8
+_unzOpen2_64@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unzOpen@4
+_TEXT SEGMENT
+_path$ = 8 ; size = 4
+_unzOpen@4 PROC ; COMDAT
+
+; 794 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 795 : return unzOpenInternal(path, NULL, 0);
+
+ 00003 8b 4d 08 mov ecx, DWORD PTR _path$[ebp]
+ 00006 33 d2 xor edx, edx
+ 00008 6a 00 push 0
+ 0000a e8 00 00 00 00 call _unzOpenInternal
+ 0000f 83 c4 04 add esp, 4
+
+; 796 : }
+
+ 00012 5d pop ebp
+ 00013 c2 04 00 ret 4
+_unzOpen@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unzOpen64@4
+_TEXT SEGMENT
+_path$ = 8 ; size = 4
+_unzOpen64@4 PROC ; COMDAT
+
+; 799 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 800 : return unzOpenInternal(path, NULL, 1);
+
+ 00003 8b 4d 08 mov ecx, DWORD PTR _path$[ebp]
+ 00006 33 d2 xor edx, edx
+ 00008 6a 01 push 1
+ 0000a e8 00 00 00 00 call _unzOpenInternal
+ 0000f 83 c4 04 add esp, 4
+
+; 801 : }
+
+ 00012 5d pop ebp
+ 00013 c2 04 00 ret 4
+_unzOpen64@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unzClose@4
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_unzClose@4 PROC ; COMDAT
+
+; 809 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 56 push esi
+
+; 810 : unz64_s* s;
+; 811 : if (file==NULL)
+
+ 00004 8b 75 08 mov esi, DWORD PTR _file$[ebp]
+ 00007 85 f6 test esi, esi
+ 00009 75 08 jne SHORT $LN2@unzClose
+
+; 812 : return UNZ_PARAMERROR;
+
+ 0000b 8d 46 9a lea eax, DWORD PTR [esi-102]
+ 0000e 5e pop esi
+
+; 821 : }
+
+ 0000f 5d pop ebp
+ 00010 c2 04 00 ret 4
+$LN2@unzClose:
+
+; 813 : s=(unz64_s*)file;
+; 814 :
+; 815 : if (s->pfile_in_zip_read!=NULL)
+
+ 00013 83 be e0 00 00
+ 00 00 cmp DWORD PTR [esi+224], 0
+ 0001a 74 06 je SHORT $LN3@unzClose
+
+; 816 : unzCloseCurrentFile(file);
+
+ 0001c 56 push esi
+ 0001d e8 00 00 00 00 call _unzCloseCurrentFile@4
+$LN3@unzClose:
+
+; 817 :
+; 818 : ZCLOSE64(s->z_filefunc, s->filestream);
+
+ 00022 ff 76 30 push DWORD PTR [esi+48]
+ 00025 8b 46 14 mov eax, DWORD PTR [esi+20]
+ 00028 ff 76 1c push DWORD PTR [esi+28]
+ 0002b ff d0 call eax
+
+; 819 : TRYFREE(s);
+
+ 0002d 56 push esi
+ 0002e ff 15 00 00 00
+ 00 call DWORD PTR __imp__free
+ 00034 83 c4 0c add esp, 12 ; 0000000cH
+
+; 820 : return UNZ_OK;
+
+ 00037 33 c0 xor eax, eax
+ 00039 5e pop esi
+
+; 821 : }
+
+ 0003a 5d pop ebp
+ 0003b c2 04 00 ret 4
+_unzClose@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unzGetGlobalInfo64@8
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_pglobal_info$ = 12 ; size = 4
+_unzGetGlobalInfo64@8 PROC ; COMDAT
+
+; 829 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 830 : unz64_s* s;
+; 831 : if (file==NULL)
+
+ 00003 8b 45 08 mov eax, DWORD PTR _file$[ebp]
+ 00006 85 c0 test eax, eax
+ 00008 75 09 jne SHORT $LN2@unzGetGlob
+
+; 832 : return UNZ_PARAMERROR;
+
+ 0000a b8 9a ff ff ff mov eax, -102 ; ffffff9aH
+
+; 836 : }
+
+ 0000f 5d pop ebp
+ 00010 c2 08 00 ret 8
+$LN2@unzGetGlob:
+
+; 833 : s=(unz64_s*)file;
+; 834 : *pglobal_info=s->gi;
+
+ 00013 0f 10 40 38 movups xmm0, XMMWORD PTR [eax+56]
+ 00017 8b 45 0c mov eax, DWORD PTR _pglobal_info$[ebp]
+ 0001a 0f 11 00 movups XMMWORD PTR [eax], xmm0
+
+; 835 : return UNZ_OK;
+
+ 0001d 33 c0 xor eax, eax
+
+; 836 : }
+
+ 0001f 5d pop ebp
+ 00020 c2 08 00 ret 8
+_unzGetGlobalInfo64@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unzGetGlobalInfo@8
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_pglobal_info32$ = 12 ; size = 4
+_unzGetGlobalInfo@8 PROC ; COMDAT
+
+; 839 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 840 : unz64_s* s;
+; 841 : if (file==NULL)
+
+ 00003 8b 55 08 mov edx, DWORD PTR _file$[ebp]
+ 00006 85 d2 test edx, edx
+ 00008 75 07 jne SHORT $LN2@unzGetGlob
+
+; 842 : return UNZ_PARAMERROR;
+
+ 0000a 8d 42 9a lea eax, DWORD PTR [edx-102]
+
+; 848 : }
+
+ 0000d 5d pop ebp
+ 0000e c2 08 00 ret 8
+$LN2@unzGetGlob:
+
+; 843 : s=(unz64_s*)file;
+; 844 : /* to do : check if number_entry is not truncated */
+; 845 : pglobal_info32->number_entry = (uLong)s->gi.number_entry;
+
+ 00011 8b 4d 0c mov ecx, DWORD PTR _pglobal_info32$[ebp]
+ 00014 8b 42 38 mov eax, DWORD PTR [edx+56]
+ 00017 89 01 mov DWORD PTR [ecx], eax
+
+; 846 : pglobal_info32->size_comment = s->gi.size_comment;
+
+ 00019 8b 42 40 mov eax, DWORD PTR [edx+64]
+ 0001c 89 41 04 mov DWORD PTR [ecx+4], eax
+
+; 847 : return UNZ_OK;
+
+ 0001f 33 c0 xor eax, eax
+
+; 848 : }
+
+ 00021 5d pop ebp
+ 00022 c2 08 00 ret 8
+_unzGetGlobalInfo@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unz64local_DosDateToTmuDate
+_TEXT SEGMENT
+_ptm$1$ = -4 ; size = 4
+_ulDosDate$ = 8 ; size = 8
+_unz64local_DosDateToTmuDate PROC ; COMDAT
+; _ptm$ = ecx
+
+; 853 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 51 push ecx
+ 00004 53 push ebx
+
+; 854 : ZPOS64_T uDate;
+; 855 : uDate = (ZPOS64_T)(ulDosDate>>16);
+
+ 00005 8b 5d 08 mov ebx, DWORD PTR _ulDosDate$[ebp]
+ 00008 56 push esi
+ 00009 57 push edi
+ 0000a 8b 7d 0c mov edi, DWORD PTR _ulDosDate$[ebp+4]
+ 0000d 8b f3 mov esi, ebx
+ 0000f 8b d7 mov edx, edi
+ 00011 89 4d fc mov DWORD PTR _ptm$1$[ebp], ecx
+ 00014 0f ac d6 10 shrd esi, edx, 16
+
+; 856 : ptm->tm_mday = (uInt)(uDate&0x1f) ;
+
+ 00018 8b c6 mov eax, esi
+ 0001a c1 ea 10 shr edx, 16 ; 00000010H
+ 0001d 83 e0 1f and eax, 31 ; 0000001fH
+ 00020 89 41 0c mov DWORD PTR [ecx+12], eax
+
+; 857 : ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ;
+
+ 00023 8b ce mov ecx, esi
+ 00025 8b c2 mov eax, edx
+ 00027 0f ac c1 05 shrd ecx, eax, 5
+
+; 858 : ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ;
+
+ 0002b 0f ac d6 09 shrd esi, edx, 9
+ 0002f c1 e8 05 shr eax, 5
+ 00032 83 e1 0f and ecx, 15 ; 0000000fH
+ 00035 8b 45 fc mov eax, DWORD PTR _ptm$1$[ebp]
+ 00038 49 dec ecx
+ 00039 c1 ea 09 shr edx, 9
+ 0003c 83 e6 7f and esi, 127 ; 0000007fH
+ 0003f 8b d0 mov edx, eax
+ 00041 81 c6 bc 07 00
+ 00 add esi, 1980 ; 000007bcH
+ 00047 89 48 10 mov DWORD PTR [eax+16], ecx
+
+; 859 :
+; 860 : ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800);
+
+ 0004a 8b cb mov ecx, ebx
+ 0004c 8b c7 mov eax, edi
+ 0004e 0f ac c1 0b shrd ecx, eax, 11
+ 00052 89 72 14 mov DWORD PTR [edx+20], esi
+ 00055 c1 e8 0b shr eax, 11 ; 0000000bH
+ 00058 83 e1 1f and ecx, 31 ; 0000001fH
+
+; 861 : ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20) ;
+
+ 0005b 8b c3 mov eax, ebx
+ 0005d 89 4a 08 mov DWORD PTR [edx+8], ecx
+ 00060 0f ac f8 05 shrd eax, edi, 5
+
+; 862 : ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)) ;
+
+ 00064 83 e3 1f and ebx, 31 ; 0000001fH
+ 00067 c1 ef 05 shr edi, 5
+ 0006a 83 e0 3f and eax, 63 ; 0000003fH
+
+; 863 : }
+
+ 0006d 5f pop edi
+ 0006e 03 db add ebx, ebx
+ 00070 89 42 04 mov DWORD PTR [edx+4], eax
+ 00073 5e pop esi
+ 00074 89 1a mov DWORD PTR [edx], ebx
+ 00076 5b pop ebx
+ 00077 8b e5 mov esp, ebp
+ 00079 5d pop ebp
+ 0007a c3 ret 0
+_unz64local_DosDateToTmuDate ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unz64local_GetCurrentFileInfoInternal
+_TEXT SEGMENT
+_lSeek$1$ = -132 ; size = 4
+_uL$ = -132 ; size = 4
+_uSizeRead$1$ = -128 ; size = 4
+_uSizeRead$1$ = -128 ; size = 4
+_uSizeRead$1$ = -128 ; size = 4
+_dataSize$1 = -128 ; size = 4
+_file_info_internal$2$ = -124 ; size = 4
+_acc$1$ = -120 ; size = 4
+_uMagic$ = -120 ; size = 4
+_headerId$2 = -116 ; size = 4
+_pfile_info$1$ = -112 ; size = 4
+_uL$3 = -108 ; size = 4
+_file_info_internal$ = -104 ; size = 8
+_file_info$ = -96 ; size = 88
+_pfile_info_internal$ = 8 ; size = 4
+_szFileName$ = 12 ; size = 4
+_fileNameBufferSize$ = 16 ; size = 4
+_extraField$ = 20 ; size = 4
+_extraFieldBufferSize$ = 24 ; size = 4
+_szComment$ = 28 ; size = 4
+_commentBufferSize$ = 32 ; size = 4
+_unz64local_GetCurrentFileInfoInternal PROC ; COMDAT
+; _file$ = ecx
+; _pfile_info$ = edx
+
+; 889 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 e4 f0 and esp, -16 ; fffffff0H
+ 00006 81 ec 88 00 00
+ 00 sub esp, 136 ; 00000088H
+ 0000c 56 push esi
+ 0000d 57 push edi
+ 0000e 8b f9 mov edi, ecx
+ 00010 89 54 24 20 mov DWORD PTR _pfile_info$1$[esp+144], edx
+
+; 890 : unz64_s* s;
+; 891 : unz_file_info64 file_info;
+; 892 : unz_file_info64_internal file_info_internal;
+; 893 : int err=UNZ_OK;
+
+ 00014 33 f6 xor esi, esi
+
+; 894 : uLong uMagic;
+; 895 : long lSeek=0;
+; 896 : uLong uL;
+; 897 :
+; 898 : if (file==NULL)
+
+ 00016 85 ff test edi, edi
+ 00018 75 09 jne SHORT $LN4@unz64local
+
+; 899 : return UNZ_PARAMERROR;
+
+ 0001a 8d 41 9a lea eax, DWORD PTR [ecx-102]
+
+; 1115 : }
+
+ 0001d 5f pop edi
+ 0001e 5e pop esi
+ 0001f 8b e5 mov esp, ebp
+ 00021 5d pop ebp
+ 00022 c3 ret 0
+$LN4@unz64local:
+
+; 900 : s=(unz64_s*)file;
+; 901 : if (ZSEEK64(s->z_filefunc, s->filestream,
+; 902 : s->pos_in_central_dir+s->byte_before_the_zipfile,
+; 903 : ZLIB_FILEFUNC_SEEK_SET)!=0)
+
+ 00023 8b 4f 58 mov ecx, DWORD PTR [edi+88]
+ 00026 03 4f 48 add ecx, DWORD PTR [edi+72]
+ 00029 8b 47 5c mov eax, DWORD PTR [edi+92]
+ 0002c 13 47 4c adc eax, DWORD PTR [edi+76]
+ 0002f 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 00032 6a 00 push 0
+ 00034 50 push eax
+ 00035 51 push ecx
+ 00036 8b cf mov ecx, edi
+ 00038 e8 00 00 00 00 call _call_zseek64
+ 0003d 83 c4 0c add esp, 12 ; 0000000cH
+ 00040 85 c0 test eax, eax
+ 00042 74 05 je SHORT $LN72@unz64local
+
+; 904 : err=UNZ_ERRNO;
+
+ 00044 83 ce ff or esi, -1
+
+; 905 :
+; 906 :
+; 907 : /* we check the magic */
+; 908 : if (err==UNZ_OK)
+
+ 00047 eb 2b jmp SHORT $LN9@unz64local
+$LN72@unz64local:
+
+; 909 : {
+; 910 : if (unz64local_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK)
+
+ 00049 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 0004c 8d 44 24 18 lea eax, DWORD PTR _uMagic$[esp+144]
+ 00050 50 push eax
+ 00051 8b cf mov ecx, edi
+ 00053 e8 00 00 00 00 call _unz64local_getLong
+ 00058 83 c4 04 add esp, 4
+ 0005b 85 c0 test eax, eax
+ 0005d 74 05 je SHORT $LN7@unz64local
+
+; 911 : err=UNZ_ERRNO;
+
+ 0005f 83 ce ff or esi, -1
+ 00062 eb 10 jmp SHORT $LN9@unz64local
+$LN7@unz64local:
+
+; 912 : else if (uMagic!=0x02014b50)
+
+ 00064 81 7c 24 18 50
+ 4b 01 02 cmp DWORD PTR _uMagic$[esp+144], 33639248 ; 02014b50H
+ 0006c b8 99 ff ff ff mov eax, -103 ; ffffff99H
+ 00071 0f 45 f0 cmovne esi, eax
+$LN9@unz64local:
+
+; 913 : err=UNZ_BADZIPFILE;
+; 914 : }
+; 915 :
+; 916 : if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.version) != UNZ_OK)
+
+ 00074 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 00077 8d 44 24 30 lea eax, DWORD PTR _file_info$[esp+144]
+ 0007b 50 push eax
+ 0007c 8b cf mov ecx, edi
+ 0007e e8 00 00 00 00 call _unz64local_getShort
+
+; 917 : err=UNZ_ERRNO;
+; 918 :
+; 919 : if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.version_needed) != UNZ_OK)
+
+ 00083 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 00086 83 c9 ff or ecx, -1
+ 00089 83 c4 04 add esp, 4
+ 0008c 85 c0 test eax, eax
+ 0008e 8d 44 24 34 lea eax, DWORD PTR _file_info$[esp+148]
+ 00092 0f 45 f1 cmovne esi, ecx
+ 00095 8b cf mov ecx, edi
+ 00097 50 push eax
+ 00098 e8 00 00 00 00 call _unz64local_getShort
+
+; 920 : err=UNZ_ERRNO;
+; 921 :
+; 922 : if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.flag) != UNZ_OK)
+
+ 0009d 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 000a0 83 c4 04 add esp, 4
+ 000a3 85 c0 test eax, eax
+ 000a5 8b cf mov ecx, edi
+ 000a7 b8 ff ff ff ff mov eax, -1
+ 000ac 0f 45 f0 cmovne esi, eax
+ 000af 8d 44 24 38 lea eax, DWORD PTR _file_info$[esp+152]
+ 000b3 50 push eax
+ 000b4 e8 00 00 00 00 call _unz64local_getShort
+
+; 923 : err=UNZ_ERRNO;
+; 924 :
+; 925 : if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.compression_method) != UNZ_OK)
+
+ 000b9 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 000bc 83 c4 04 add esp, 4
+ 000bf 85 c0 test eax, eax
+ 000c1 8b cf mov ecx, edi
+ 000c3 b8 ff ff ff ff mov eax, -1
+ 000c8 0f 45 f0 cmovne esi, eax
+ 000cb 8d 44 24 3c lea eax, DWORD PTR _file_info$[esp+156]
+ 000cf 50 push eax
+ 000d0 e8 00 00 00 00 call _unz64local_getShort
+
+; 926 : err=UNZ_ERRNO;
+; 927 :
+; 928 : if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.dosDate) != UNZ_OK)
+
+ 000d5 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 000d8 83 c4 04 add esp, 4
+ 000db 85 c0 test eax, eax
+ 000dd 8b cf mov ecx, edi
+ 000df b8 ff ff ff ff mov eax, -1
+ 000e4 0f 45 f0 cmovne esi, eax
+ 000e7 8d 44 24 40 lea eax, DWORD PTR _file_info$[esp+160]
+ 000eb 50 push eax
+ 000ec e8 00 00 00 00 call _unz64local_getLong
+ 000f1 83 c4 04 add esp, 4
+
+; 929 : err=UNZ_ERRNO;
+; 930 :
+; 931 : unz64local_DosDateToTmuDate(file_info.dosDate,&file_info.tmu_date);
+
+ 000f4 8d 4c 24 70 lea ecx, DWORD PTR _file_info$[esp+208]
+ 000f8 85 c0 test eax, eax
+ 000fa b8 ff ff ff ff mov eax, -1
+ 000ff 0f 45 f0 cmovne esi, eax
+ 00102 6a 00 push 0
+ 00104 ff 74 24 44 push DWORD PTR _file_info$[esp+164]
+ 00108 e8 00 00 00 00 call _unz64local_DosDateToTmuDate
+
+; 932 :
+; 933 : if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.crc) != UNZ_OK)
+
+ 0010d 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 00110 8d 44 24 4c lea eax, DWORD PTR _file_info$[esp+172]
+ 00114 50 push eax
+ 00115 8b cf mov ecx, edi
+ 00117 e8 00 00 00 00 call _unz64local_getLong
+
+; 934 : err=UNZ_ERRNO;
+; 935 :
+; 936 : if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK)
+
+ 0011c 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 0011f 83 c4 0c add esp, 12 ; 0000000cH
+ 00122 85 c0 test eax, eax
+ 00124 8b cf mov ecx, edi
+ 00126 b8 ff ff ff ff mov eax, -1
+ 0012b 0f 45 f0 cmovne esi, eax
+ 0012e 8d 44 24 0c lea eax, DWORD PTR _uL$[esp+144]
+ 00132 50 push eax
+ 00133 e8 00 00 00 00 call _unz64local_getLong
+
+; 937 : err=UNZ_ERRNO;
+; 938 : file_info.compressed_size = uL;
+; 939 :
+; 940 : if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK)
+
+ 00138 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 0013b 83 c4 04 add esp, 4
+ 0013e 85 c0 test eax, eax
+ 00140 c7 44 24 4c 00
+ 00 00 00 mov DWORD PTR _file_info$[esp+172], 0
+ 00148 b8 ff ff ff ff mov eax, -1
+ 0014d 8b cf mov ecx, edi
+ 0014f 0f 45 f0 cmovne esi, eax
+ 00152 8b 44 24 0c mov eax, DWORD PTR _uL$[esp+144]
+ 00156 89 44 24 48 mov DWORD PTR _file_info$[esp+168], eax
+ 0015a 8d 44 24 0c lea eax, DWORD PTR _uL$[esp+144]
+ 0015e 50 push eax
+ 0015f e8 00 00 00 00 call _unz64local_getLong
+ 00164 83 c4 04 add esp, 4
+ 00167 85 c0 test eax, eax
+ 00169 b8 ff ff ff ff mov eax, -1
+ 0016e 0f 45 f0 cmovne esi, eax
+
+; 941 : err=UNZ_ERRNO;
+; 942 : file_info.uncompressed_size = uL;
+
+ 00171 8b 44 24 0c mov eax, DWORD PTR _uL$[esp+144]
+ 00175 89 44 24 50 mov DWORD PTR _file_info$[esp+176], eax
+
+; 943 :
+; 944 : if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_filename) != UNZ_OK)
+
+ 00179 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 0017c 8d 44 24 58 lea eax, DWORD PTR _file_info$[esp+184]
+ 00180 50 push eax
+ 00181 8b cf mov ecx, edi
+ 00183 c7 44 24 58 00
+ 00 00 00 mov DWORD PTR _file_info$[esp+184], 0
+ 0018b e8 00 00 00 00 call _unz64local_getShort
+
+; 945 : err=UNZ_ERRNO;
+; 946 :
+; 947 : if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_extra) != UNZ_OK)
+
+ 00190 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 00193 83 c4 04 add esp, 4
+ 00196 85 c0 test eax, eax
+ 00198 8b cf mov ecx, edi
+ 0019a b8 ff ff ff ff mov eax, -1
+ 0019f 0f 45 f0 cmovne esi, eax
+ 001a2 8d 44 24 5c lea eax, DWORD PTR _file_info$[esp+188]
+ 001a6 50 push eax
+ 001a7 e8 00 00 00 00 call _unz64local_getShort
+
+; 948 : err=UNZ_ERRNO;
+; 949 :
+; 950 : if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_comment) != UNZ_OK)
+
+ 001ac 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 001af 83 c4 04 add esp, 4
+ 001b2 85 c0 test eax, eax
+ 001b4 8b cf mov ecx, edi
+ 001b6 b8 ff ff ff ff mov eax, -1
+ 001bb 0f 45 f0 cmovne esi, eax
+ 001be 8d 44 24 60 lea eax, DWORD PTR _file_info$[esp+192]
+ 001c2 50 push eax
+ 001c3 e8 00 00 00 00 call _unz64local_getShort
+
+; 951 : err=UNZ_ERRNO;
+; 952 :
+; 953 : if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.disk_num_start) != UNZ_OK)
+
+ 001c8 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 001cb 83 c4 04 add esp, 4
+ 001ce 85 c0 test eax, eax
+ 001d0 8b cf mov ecx, edi
+ 001d2 b8 ff ff ff ff mov eax, -1
+ 001d7 0f 45 f0 cmovne esi, eax
+ 001da 8d 44 24 64 lea eax, DWORD PTR _file_info$[esp+196]
+ 001de 50 push eax
+ 001df e8 00 00 00 00 call _unz64local_getShort
+
+; 954 : err=UNZ_ERRNO;
+; 955 :
+; 956 : if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.internal_fa) != UNZ_OK)
+
+ 001e4 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 001e7 83 c4 04 add esp, 4
+ 001ea 85 c0 test eax, eax
+ 001ec 8b cf mov ecx, edi
+ 001ee b8 ff ff ff ff mov eax, -1
+ 001f3 0f 45 f0 cmovne esi, eax
+ 001f6 8d 44 24 68 lea eax, DWORD PTR _file_info$[esp+200]
+ 001fa 50 push eax
+ 001fb e8 00 00 00 00 call _unz64local_getShort
+
+; 957 : err=UNZ_ERRNO;
+; 958 :
+; 959 : if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.external_fa) != UNZ_OK)
+
+ 00200 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 00203 83 c4 04 add esp, 4
+ 00206 85 c0 test eax, eax
+ 00208 8b cf mov ecx, edi
+ 0020a b8 ff ff ff ff mov eax, -1
+ 0020f 0f 45 f0 cmovne esi, eax
+ 00212 8d 44 24 6c lea eax, DWORD PTR _file_info$[esp+204]
+ 00216 50 push eax
+ 00217 e8 00 00 00 00 call _unz64local_getLong
+
+; 960 : err=UNZ_ERRNO;
+; 961 :
+; 962 : // relative offset of local header
+; 963 : if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK)
+
+ 0021c 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 0021f 83 c4 04 add esp, 4
+ 00222 85 c0 test eax, eax
+ 00224 8b cf mov ecx, edi
+ 00226 b8 ff ff ff ff mov eax, -1
+ 0022b 0f 45 f0 cmovne esi, eax
+ 0022e 8d 44 24 0c lea eax, DWORD PTR _uL$[esp+144]
+ 00232 50 push eax
+ 00233 e8 00 00 00 00 call _unz64local_getLong
+
+; 964 : err=UNZ_ERRNO;
+; 965 : file_info_internal.offset_curfile = uL;
+; 966 :
+; 967 : lSeek+=file_info.size_filename;
+
+ 00238 8b 4c 24 5c mov ecx, DWORD PTR _file_info$[esp+188]
+ 0023c 83 c4 04 add esp, 4
+ 0023f 85 c0 test eax, eax
+ 00241 c7 44 24 2c 00
+ 00 00 00 mov DWORD PTR _file_info_internal$[esp+148], 0
+ 00249 b8 ff ff ff ff mov eax, -1
+ 0024e 0f 45 f0 cmovne esi, eax
+ 00251 8b 44 24 0c mov eax, DWORD PTR _uL$[esp+144]
+ 00255 89 44 24 14 mov DWORD PTR _file_info_internal$2$[esp+144], eax
+ 00259 89 44 24 28 mov DWORD PTR _file_info_internal$[esp+144], eax
+ 0025d 89 4c 24 0c mov DWORD PTR _lSeek$1$[esp+144], ecx
+
+; 968 : if ((err==UNZ_OK) && (szFileName!=NULL))
+
+ 00261 85 f6 test esi, esi
+ 00263 0f 85 f7 00 00
+ 00 jne $LN30@unz64local
+ 00269 8b 55 0c mov edx, DWORD PTR _szFileName$[ebp]
+ 0026c 85 d2 test edx, edx
+ 0026e 74 53 je SHORT $LN73@unz64local
+
+; 969 : {
+; 970 : uLong uSizeRead ;
+; 971 : if (file_info.size_filename<fileNameBufferSize)
+
+ 00270 8b 45 10 mov eax, DWORD PTR _fileNameBufferSize$[ebp]
+ 00273 3b c8 cmp ecx, eax
+ 00275 73 0c jae SHORT $LN26@unz64local
+
+; 972 : {
+; 973 : *(szFileName+file_info.size_filename)='\0';
+
+ 00277 c6 04 11 00 mov BYTE PTR [ecx+edx], 0
+
+; 974 : uSizeRead = file_info.size_filename;
+
+ 0027b 8b d1 mov edx, ecx
+ 0027d 89 54 24 10 mov DWORD PTR _uSizeRead$1$[esp+144], edx
+
+; 975 : }
+
+ 00281 eb 06 jmp SHORT $LN27@unz64local
+$LN26@unz64local:
+
+; 976 : else
+; 977 : uSizeRead = fileNameBufferSize;
+
+ 00283 8b d0 mov edx, eax
+ 00285 89 44 24 10 mov DWORD PTR _uSizeRead$1$[esp+144], eax
+$LN27@unz64local:
+
+; 978 :
+; 979 : if ((file_info.size_filename>0) && (fileNameBufferSize>0))
+
+ 00289 85 c9 test ecx, ecx
+ 0028b 74 28 je SHORT $LN29@unz64local
+ 0028d 85 c0 test eax, eax
+ 0028f 74 24 je SHORT $LN29@unz64local
+
+; 980 : if (ZREAD64(s->z_filefunc, s->filestream,szFileName,uSizeRead)!=uSizeRead)
+
+ 00291 8b 47 04 mov eax, DWORD PTR [edi+4]
+ 00294 52 push edx
+ 00295 ff 75 0c push DWORD PTR _szFileName$[ebp]
+ 00298 ff 77 30 push DWORD PTR [edi+48]
+ 0029b ff 77 1c push DWORD PTR [edi+28]
+ 0029e ff d0 call eax
+ 002a0 8b 54 24 20 mov edx, DWORD PTR _uSizeRead$1$[esp+160]
+ 002a4 83 c4 10 add esp, 16 ; 00000010H
+ 002a7 8b 4c 24 0c mov ecx, DWORD PTR _lSeek$1$[esp+144]
+ 002ab 3b c2 cmp eax, edx
+ 002ad b8 ff ff ff ff mov eax, -1
+ 002b2 0f 45 f0 cmovne esi, eax
+$LN29@unz64local:
+
+; 981 : err=UNZ_ERRNO;
+; 982 : lSeek -= uSizeRead;
+
+ 002b5 2b ca sub ecx, edx
+ 002b7 89 4c 24 0c mov DWORD PTR _lSeek$1$[esp+144], ecx
+
+; 983 : }
+; 984 :
+; 985 : // Read extrafield
+; 986 : if ((err==UNZ_OK) && (extraField!=NULL))
+
+ 002bb 85 f6 test esi, esi
+ 002bd 0f 85 9d 00 00
+ 00 jne $LN30@unz64local
+$LN73@unz64local:
+ 002c3 83 7d 14 00 cmp DWORD PTR _extraField$[ebp], 0
+ 002c7 0f 84 93 00 00
+ 00 je $LN30@unz64local
+
+; 987 : {
+; 988 : ZPOS64_T uSizeRead ;
+; 989 : if (file_info.size_file_extra<extraFieldBufferSize)
+
+ 002cd 8b 44 24 5c mov eax, DWORD PTR _file_info$[esp+188]
+ 002d1 8b 55 18 mov edx, DWORD PTR _extraFieldBufferSize$[ebp]
+
+; 990 : uSizeRead = file_info.size_file_extra;
+
+ 002d4 89 44 24 10 mov DWORD PTR _uSizeRead$1$[esp+144], eax
+ 002d8 3b c2 cmp eax, edx
+ 002da 72 04 jb SHORT $LN33@unz64local
+
+; 991 : else
+; 992 : uSizeRead = extraFieldBufferSize;
+
+ 002dc 89 54 24 10 mov DWORD PTR _uSizeRead$1$[esp+144], edx
+$LN33@unz64local:
+
+; 993 :
+; 994 : if (lSeek!=0)
+
+ 002e0 85 c9 test ecx, ecx
+ 002e2 74 2e je SHORT $LN36@unz64local
+
+; 995 : {
+; 996 : if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
+
+ 002e4 8b c1 mov eax, ecx
+ 002e6 8b cf mov ecx, edi
+ 002e8 99 cdq
+ 002e9 6a 01 push 1
+ 002eb 52 push edx
+ 002ec 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 002ef 50 push eax
+ 002f0 e8 00 00 00 00 call _call_zseek64
+
+; 997 : lSeek=0;
+
+ 002f5 8b 55 18 mov edx, DWORD PTR _extraFieldBufferSize$[ebp]
+ 002f8 83 c4 0c add esp, 12 ; 0000000cH
+ 002fb 85 c0 test eax, eax
+ 002fd 8b 44 24 5c mov eax, DWORD PTR _file_info$[esp+188]
+ 00301 75 08 jne SHORT $LN35@unz64local
+ 00303 33 c9 xor ecx, ecx
+ 00305 89 4c 24 0c mov DWORD PTR _lSeek$1$[esp+144], ecx
+ 00309 eb 07 jmp SHORT $LN36@unz64local
+$LN35@unz64local:
+ 0030b 8b 4c 24 0c mov ecx, DWORD PTR _lSeek$1$[esp+144]
+
+; 998 : else
+; 999 : err=UNZ_ERRNO;
+
+ 0030f 83 ce ff or esi, -1
+$LN36@unz64local:
+
+; 1000 : }
+; 1001 :
+; 1002 : if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0))
+
+ 00312 85 c0 test eax, eax
+ 00314 74 3c je SHORT $LN80@unz64local
+ 00316 85 d2 test edx, edx
+ 00318 74 38 je SHORT $LN80@unz64local
+
+; 1003 : if (ZREAD64(s->z_filefunc, s->filestream,extraField,(uLong)uSizeRead)!=uSizeRead)
+
+ 0031a ff 74 24 10 push DWORD PTR _uSizeRead$1$[esp+144]
+ 0031e 8b 47 04 mov eax, DWORD PTR [edi+4]
+ 00321 ff 75 14 push DWORD PTR _extraField$[ebp]
+ 00324 ff 77 30 push DWORD PTR [edi+48]
+ 00327 ff 77 1c push DWORD PTR [edi+28]
+ 0032a ff d0 call eax
+ 0032c 8b 54 24 20 mov edx, DWORD PTR _uSizeRead$1$[esp+160]
+ 00330 83 c4 10 add esp, 16 ; 00000010H
+ 00333 33 c9 xor ecx, ecx
+ 00335 3b c2 cmp eax, edx
+ 00337 75 04 jne SHORT $LN77@unz64local
+ 00339 85 c9 test ecx, ecx
+ 0033b 74 03 je SHORT $LN78@unz64local
+$LN77@unz64local:
+
+; 1004 : err=UNZ_ERRNO;
+
+ 0033d 83 ce ff or esi, -1
+$LN78@unz64local:
+ 00340 8b 44 24 5c mov eax, DWORD PTR _file_info$[esp+188]
+ 00344 8b 4c 24 0c mov ecx, DWORD PTR _lSeek$1$[esp+144]
+
+; 1005 :
+; 1006 : lSeek += file_info.size_file_extra - (uLong)uSizeRead;
+
+ 00348 2b c2 sub eax, edx
+ 0034a 03 c8 add ecx, eax
+
+; 1007 : }
+
+ 0034c 8b 44 24 5c mov eax, DWORD PTR _file_info$[esp+188]
+ 00350 eb 14 jmp SHORT $LN81@unz64local
+$LN80@unz64local:
+ 00352 8b 54 24 10 mov edx, DWORD PTR _uSizeRead$1$[esp+144]
+
+; 1005 :
+; 1006 : lSeek += file_info.size_file_extra - (uLong)uSizeRead;
+
+ 00356 2b c2 sub eax, edx
+ 00358 03 c8 add ecx, eax
+
+; 1007 : }
+
+ 0035a 8b 44 24 5c mov eax, DWORD PTR _file_info$[esp+188]
+ 0035e eb 06 jmp SHORT $LN81@unz64local
+$LN30@unz64local:
+
+; 1008 : else
+; 1009 : lSeek += file_info.size_file_extra;
+
+ 00360 8b 44 24 5c mov eax, DWORD PTR _file_info$[esp+188]
+ 00364 03 c8 add ecx, eax
+$LN81@unz64local:
+ 00366 89 4c 24 0c mov DWORD PTR _lSeek$1$[esp+144], ecx
+
+; 1010 :
+; 1011 :
+; 1012 : if ((err==UNZ_OK) && (file_info.size_file_extra != 0))
+
+ 0036a 85 f6 test esi, esi
+ 0036c 0f 85 3e 02 00
+ 00 jne $LN66@unz64local
+ 00372 85 c0 test eax, eax
+ 00374 0f 84 63 01 00
+ 00 je $LN74@unz64local
+
+; 1013 : {
+; 1014 : uLong acc = 0;
+; 1015 :
+; 1016 : // since lSeek now points to after the extra field we need to move back
+; 1017 : lSeek -= file_info.size_file_extra;
+
+ 0037a 2b c8 sub ecx, eax
+ 0037c 89 74 24 18 mov DWORD PTR _acc$1$[esp+144], esi
+ 00380 89 4c 24 0c mov DWORD PTR _lSeek$1$[esp+144], ecx
+
+; 1018 :
+; 1019 : if (lSeek!=0)
+
+ 00384 74 25 je SHORT $LN68@unz64local
+
+; 1020 : {
+; 1021 : if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
+
+ 00386 8b c1 mov eax, ecx
+ 00388 8b cf mov ecx, edi
+ 0038a 99 cdq
+ 0038b 6a 01 push 1
+ 0038d 52 push edx
+ 0038e 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 00391 50 push eax
+ 00392 e8 00 00 00 00 call _call_zseek64
+ 00397 83 c4 0c add esp, 12 ; 0000000cH
+ 0039a 85 c0 test eax, eax
+
+; 1022 : lSeek=0;
+
+ 0039c 8b 44 24 5c mov eax, DWORD PTR _file_info$[esp+188]
+ 003a0 75 06 jne SHORT $LN41@unz64local
+ 003a2 89 74 24 0c mov DWORD PTR _lSeek$1$[esp+144], esi
+ 003a6 eb 03 jmp SHORT $LN68@unz64local
+$LN41@unz64local:
+
+; 1023 : else
+; 1024 : err=UNZ_ERRNO;
+
+ 003a8 83 ce ff or esi, -1
+$LN68@unz64local:
+
+; 1025 : }
+; 1026 :
+; 1027 : while(acc < file_info.size_file_extra)
+
+ 003ab 85 c0 test eax, eax
+ 003ad 0f 84 22 01 00
+ 00 je $LN3@unz64local
+$LL2@unz64local:
+
+; 1028 : {
+; 1029 : uLong headerId;
+; 1030 : uLong dataSize;
+; 1031 :
+; 1032 : if (unz64local_getShort(&s->z_filefunc, s->filestream,&headerId) != UNZ_OK)
+
+ 003b3 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 003b6 8d 44 24 1c lea eax, DWORD PTR _headerId$2[esp+144]
+ 003ba 50 push eax
+ 003bb 8b cf mov ecx, edi
+ 003bd e8 00 00 00 00 call _unz64local_getShort
+
+; 1033 : err=UNZ_ERRNO;
+; 1034 :
+; 1035 : if (unz64local_getShort(&s->z_filefunc, s->filestream,&dataSize) != UNZ_OK)
+
+ 003c2 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 003c5 83 c4 04 add esp, 4
+ 003c8 85 c0 test eax, eax
+ 003ca 8b cf mov ecx, edi
+ 003cc b8 ff ff ff ff mov eax, -1
+ 003d1 0f 45 f0 cmovne esi, eax
+ 003d4 8d 44 24 10 lea eax, DWORD PTR _dataSize$1[esp+144]
+ 003d8 50 push eax
+ 003d9 e8 00 00 00 00 call _unz64local_getShort
+ 003de 83 c4 04 add esp, 4
+ 003e1 85 c0 test eax, eax
+ 003e3 b8 ff ff ff ff mov eax, -1
+ 003e8 0f 45 f0 cmovne esi, eax
+
+; 1036 : err=UNZ_ERRNO;
+; 1037 :
+; 1038 : /* ZIP64 extra fields */
+; 1039 : if (headerId == 0x0001)
+
+ 003eb 83 7c 24 1c 01 cmp DWORD PTR _headerId$2[esp+144], 1
+ 003f0 0f 85 a7 00 00
+ 00 jne $LN45@unz64local
+
+; 1040 : {
+; 1041 : uLong uL;
+; 1042 :
+; 1043 : if(file_info.uncompressed_size == MAXU32)
+
+ 003f6 39 44 24 50 cmp DWORD PTR _file_info$[esp+176], eax
+ 003fa 75 23 jne SHORT $LN48@unz64local
+ 003fc 83 7c 24 54 00 cmp DWORD PTR _file_info$[esp+180], 0
+ 00401 75 1c jne SHORT $LN48@unz64local
+
+; 1044 : {
+; 1045 : if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info.uncompressed_size) != UNZ_OK)
+
+ 00403 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 00406 8d 44 24 50 lea eax, DWORD PTR _file_info$[esp+176]
+ 0040a 50 push eax
+ 0040b 8b cf mov ecx, edi
+ 0040d e8 00 00 00 00 call _unz64local_getLong64
+ 00412 83 c4 04 add esp, 4
+ 00415 85 c0 test eax, eax
+ 00417 b8 ff ff ff ff mov eax, -1
+ 0041c 0f 45 f0 cmovne esi, eax
+$LN48@unz64local:
+
+; 1046 : err=UNZ_ERRNO;
+; 1047 : }
+; 1048 :
+; 1049 : if(file_info.compressed_size == MAXU32)
+
+ 0041f 83 7c 24 48 ff cmp DWORD PTR _file_info$[esp+168], -1
+ 00424 75 23 jne SHORT $LN50@unz64local
+ 00426 83 7c 24 4c 00 cmp DWORD PTR _file_info$[esp+172], 0
+ 0042b 75 1c jne SHORT $LN50@unz64local
+
+; 1050 : {
+; 1051 : if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info.compressed_size) != UNZ_OK)
+
+ 0042d 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 00430 8d 44 24 48 lea eax, DWORD PTR _file_info$[esp+168]
+ 00434 50 push eax
+ 00435 8b cf mov ecx, edi
+ 00437 e8 00 00 00 00 call _unz64local_getLong64
+ 0043c 83 c4 04 add esp, 4
+ 0043f 85 c0 test eax, eax
+ 00441 b8 ff ff ff ff mov eax, -1
+ 00446 0f 45 f0 cmovne esi, eax
+$LN50@unz64local:
+
+; 1052 : err=UNZ_ERRNO;
+; 1053 : }
+; 1054 :
+; 1055 : if(file_info_internal.offset_curfile == MAXU32)
+
+ 00449 83 7c 24 14 ff cmp DWORD PTR _file_info_internal$2$[esp+144], -1
+ 0044e 75 2b jne SHORT $LN52@unz64local
+ 00450 83 7c 24 2c 00 cmp DWORD PTR _file_info_internal$[esp+148], 0
+ 00455 75 24 jne SHORT $LN52@unz64local
+
+; 1056 : {
+; 1057 : /* Relative Header offset */
+; 1058 : if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info_internal.offset_curfile) != UNZ_OK)
+
+ 00457 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 0045a 8d 44 24 28 lea eax, DWORD PTR _file_info_internal$[esp+144]
+ 0045e 50 push eax
+ 0045f 8b cf mov ecx, edi
+ 00461 e8 00 00 00 00 call _unz64local_getLong64
+ 00466 83 c4 04 add esp, 4
+ 00469 85 c0 test eax, eax
+ 0046b b8 ff ff ff ff mov eax, -1
+ 00470 0f 45 f0 cmovne esi, eax
+ 00473 8b 44 24 28 mov eax, DWORD PTR _file_info_internal$[esp+144]
+ 00477 89 44 24 14 mov DWORD PTR _file_info_internal$2$[esp+144], eax
+$LN52@unz64local:
+
+; 1059 : err=UNZ_ERRNO;
+; 1060 : }
+; 1061 :
+; 1062 : if(file_info.disk_num_start == MAXU32)
+
+ 0047b 83 7c 24 64 ff cmp DWORD PTR _file_info$[esp+196], -1
+ 00480 75 3a jne SHORT $LN55@unz64local
+
+; 1063 : {
+; 1064 : /* Disk Start Number */
+; 1065 : if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK)
+
+ 00482 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 00485 8d 44 24 24 lea eax, DWORD PTR _uL$3[esp+144]
+ 00489 50 push eax
+ 0048a 8b cf mov ecx, edi
+ 0048c e8 00 00 00 00 call _unz64local_getLong
+ 00491 83 c4 04 add esp, 4
+ 00494 85 c0 test eax, eax
+ 00496 74 24 je SHORT $LN55@unz64local
+
+; 1066 : err=UNZ_ERRNO;
+
+ 00498 83 ce ff or esi, -1
+
+; 1067 : }
+; 1068 :
+; 1069 : }
+
+ 0049b eb 1f jmp SHORT $LN55@unz64local
+$LN45@unz64local:
+
+; 1070 : else
+; 1071 : {
+; 1072 : if (ZSEEK64(s->z_filefunc, s->filestream,dataSize,ZLIB_FILEFUNC_SEEK_CUR)!=0)
+
+ 0049d 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 004a0 8b cf mov ecx, edi
+ 004a2 6a 01 push 1
+ 004a4 6a 00 push 0
+ 004a6 ff 74 24 18 push DWORD PTR _dataSize$1[esp+152]
+ 004aa e8 00 00 00 00 call _call_zseek64
+ 004af 83 c4 0c add esp, 12 ; 0000000cH
+ 004b2 85 c0 test eax, eax
+ 004b4 b8 ff ff ff ff mov eax, -1
+ 004b9 0f 45 f0 cmovne esi, eax
+$LN55@unz64local:
+
+; 1073 : err=UNZ_ERRNO;
+; 1074 : }
+; 1075 :
+; 1076 : acc += 2 + 2 + dataSize;
+
+ 004bc 8b 44 24 18 mov eax, DWORD PTR _acc$1$[esp+144]
+ 004c0 83 c0 04 add eax, 4
+ 004c3 03 44 24 10 add eax, DWORD PTR _dataSize$1[esp+144]
+ 004c7 89 44 24 18 mov DWORD PTR _acc$1$[esp+144], eax
+ 004cb 3b 44 24 5c cmp eax, DWORD PTR _file_info$[esp+188]
+ 004cf 0f 82 de fe ff
+ ff jb $LL2@unz64local
+$LN3@unz64local:
+
+; 1077 : }
+; 1078 : }
+; 1079 :
+; 1080 : if ((err==UNZ_OK) && (szComment!=NULL))
+
+ 004d5 85 f6 test esi, esi
+ 004d7 0f 85 d3 00 00
+ 00 jne $LN66@unz64local
+$LN74@unz64local:
+ 004dd 8b 55 1c mov edx, DWORD PTR _szComment$[ebp]
+ 004e0 85 d2 test edx, edx
+ 004e2 74 76 je SHORT $LN75@unz64local
+
+; 1081 : {
+; 1082 : uLong uSizeRead ;
+; 1083 : if (file_info.size_file_comment<commentBufferSize)
+
+ 004e4 8b 4d 20 mov ecx, DWORD PTR _commentBufferSize$[ebp]
+ 004e7 8b 44 24 60 mov eax, DWORD PTR _file_info$[esp+192]
+ 004eb 3b c1 cmp eax, ecx
+ 004ed 73 0a jae SHORT $LN58@unz64local
+
+; 1084 : {
+; 1085 : *(szComment+file_info.size_file_comment)='\0';
+
+ 004ef c6 04 10 00 mov BYTE PTR [eax+edx], 0
+
+; 1086 : uSizeRead = file_info.size_file_comment;
+
+ 004f3 89 44 24 10 mov DWORD PTR _uSizeRead$1$[esp+144], eax
+
+; 1087 : }
+
+ 004f7 eb 04 jmp SHORT $LN59@unz64local
+$LN58@unz64local:
+
+; 1088 : else
+; 1089 : uSizeRead = commentBufferSize;
+
+ 004f9 89 4c 24 10 mov DWORD PTR _uSizeRead$1$[esp+144], ecx
+$LN59@unz64local:
+
+; 1090 :
+; 1091 : if (lSeek!=0)
+
+ 004fd 8b 44 24 0c mov eax, DWORD PTR _lSeek$1$[esp+144]
+ 00501 85 c0 test eax, eax
+ 00503 74 22 je SHORT $LN62@unz64local
+
+; 1092 : {
+; 1093 : if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
+
+ 00505 99 cdq
+ 00506 8b cf mov ecx, edi
+ 00508 6a 01 push 1
+ 0050a 52 push edx
+ 0050b 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 0050e 50 push eax
+ 0050f e8 00 00 00 00 call _call_zseek64
+ 00514 8b 4d 20 mov ecx, DWORD PTR _commentBufferSize$[ebp]
+ 00517 83 c4 0c add esp, 12 ; 0000000cH
+ 0051a 8b 55 1c mov edx, DWORD PTR _szComment$[ebp]
+ 0051d 85 c0 test eax, eax
+ 0051f b8 ff ff ff ff mov eax, -1
+ 00524 0f 45 f0 cmovne esi, eax
+$LN62@unz64local:
+
+; 1094 : lSeek=0;
+; 1095 : else
+; 1096 : err=UNZ_ERRNO;
+; 1097 : }
+; 1098 :
+; 1099 : if ((file_info.size_file_comment>0) && (commentBufferSize>0))
+
+ 00527 83 7c 24 60 00 cmp DWORD PTR _file_info$[esp+192], 0
+ 0052c 76 28 jbe SHORT $LN64@unz64local
+ 0052e 85 c9 test ecx, ecx
+ 00530 74 24 je SHORT $LN64@unz64local
+
+; 1100 : if (ZREAD64(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead)
+
+ 00532 ff 74 24 10 push DWORD PTR _uSizeRead$1$[esp+144]
+ 00536 8b 47 04 mov eax, DWORD PTR [edi+4]
+ 00539 52 push edx
+ 0053a ff 77 30 push DWORD PTR [edi+48]
+ 0053d ff 77 1c push DWORD PTR [edi+28]
+ 00540 ff d0 call eax
+ 00542 83 c4 10 add esp, 16 ; 00000010H
+ 00545 3b 44 24 10 cmp eax, DWORD PTR _uSizeRead$1$[esp+144]
+ 00549 74 0b je SHORT $LN64@unz64local
+
+; 1101 : err=UNZ_ERRNO;
+
+ 0054b 83 ce ff or esi, -1
+
+; 1113 :
+; 1114 : return err;
+
+ 0054e 8b c6 mov eax, esi
+
+; 1115 : }
+
+ 00550 5f pop edi
+ 00551 5e pop esi
+ 00552 8b e5 mov esp, ebp
+ 00554 5d pop ebp
+ 00555 c3 ret 0
+$LN64@unz64local:
+
+; 1102 : lSeek+=file_info.size_file_comment - uSizeRead;
+; 1103 : }
+; 1104 : else
+; 1105 : lSeek+=file_info.size_file_comment;
+; 1106 :
+; 1107 :
+; 1108 : if ((err==UNZ_OK) && (pfile_info!=NULL))
+
+ 00556 85 f6 test esi, esi
+ 00558 75 56 jne SHORT $LN66@unz64local
+$LN75@unz64local:
+ 0055a 8b 44 24 20 mov eax, DWORD PTR _pfile_info$1$[esp+144]
+ 0055e 85 c0 test eax, eax
+ 00560 74 3a je SHORT $LN76@unz64local
+
+; 1109 : *pfile_info=file_info;
+
+ 00562 0f 10 44 24 30 movups xmm0, XMMWORD PTR _file_info$[esp+144]
+ 00567 0f 11 00 movups XMMWORD PTR [eax], xmm0
+ 0056a 0f 10 44 24 40 movups xmm0, XMMWORD PTR _file_info$[esp+160]
+ 0056f 0f 11 40 10 movups XMMWORD PTR [eax+16], xmm0
+ 00573 0f 10 44 24 50 movups xmm0, XMMWORD PTR _file_info$[esp+176]
+ 00578 0f 11 40 20 movups XMMWORD PTR [eax+32], xmm0
+ 0057c 0f 10 44 24 60 movups xmm0, XMMWORD PTR _file_info$[esp+192]
+ 00581 0f 11 40 30 movups XMMWORD PTR [eax+48], xmm0
+ 00585 0f 10 44 24 70 movups xmm0, XMMWORD PTR _file_info$[esp+208]
+ 0058a 0f 11 40 40 movups XMMWORD PTR [eax+64], xmm0
+ 0058e f3 0f 7e 84 24
+ 80 00 00 00 movq xmm0, QWORD PTR _file_info$[esp+224]
+ 00597 66 0f d6 40 50 movq QWORD PTR [eax+80], xmm0
+$LN76@unz64local:
+
+; 1110 :
+; 1111 : if ((err==UNZ_OK) && (pfile_info_internal!=NULL))
+
+ 0059c 8b 4d 08 mov ecx, DWORD PTR _pfile_info_internal$[ebp]
+ 0059f 85 c9 test ecx, ecx
+ 005a1 74 0d je SHORT $LN66@unz64local
+
+; 1112 : *pfile_info_internal=file_info_internal;
+
+ 005a3 8b 44 24 14 mov eax, DWORD PTR _file_info_internal$2$[esp+144]
+ 005a7 89 01 mov DWORD PTR [ecx], eax
+ 005a9 8b 44 24 2c mov eax, DWORD PTR _file_info_internal$[esp+148]
+ 005ad 89 41 04 mov DWORD PTR [ecx+4], eax
+$LN66@unz64local:
+
+; 1115 : }
+
+ 005b0 5f pop edi
+ 005b1 8b c6 mov eax, esi
+ 005b3 5e pop esi
+ 005b4 8b e5 mov esp, ebp
+ 005b6 5d pop ebp
+ 005b7 c3 ret 0
+_unz64local_GetCurrentFileInfoInternal ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unzGetCurrentFileInfo64@32
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_pfile_info$ = 12 ; size = 4
+_szFileName$ = 16 ; size = 4
+_fileNameBufferSize$ = 20 ; size = 4
+_extraField$ = 24 ; size = 4
+_extraFieldBufferSize$ = 28 ; size = 4
+_szComment$ = 32 ; size = 4
+_commentBufferSize$ = 36 ; size = 4
+_unzGetCurrentFileInfo64@32 PROC ; COMDAT
+
+; 1129 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 1130 : return unz64local_GetCurrentFileInfoInternal(file,pfile_info,NULL,
+
+ 00003 ff 75 24 push DWORD PTR _commentBufferSize$[ebp]
+ 00006 8b 55 0c mov edx, DWORD PTR _pfile_info$[ebp]
+ 00009 ff 75 20 push DWORD PTR _szComment$[ebp]
+ 0000c 8b 4d 08 mov ecx, DWORD PTR _file$[ebp]
+ 0000f ff 75 1c push DWORD PTR _extraFieldBufferSize$[ebp]
+ 00012 ff 75 18 push DWORD PTR _extraField$[ebp]
+ 00015 ff 75 14 push DWORD PTR _fileNameBufferSize$[ebp]
+ 00018 ff 75 10 push DWORD PTR _szFileName$[ebp]
+ 0001b 6a 00 push 0
+ 0001d e8 00 00 00 00 call _unz64local_GetCurrentFileInfoInternal
+ 00022 83 c4 1c add esp, 28 ; 0000001cH
+
+; 1131 : szFileName,fileNameBufferSize,
+; 1132 : extraField,extraFieldBufferSize,
+; 1133 : szComment,commentBufferSize);
+; 1134 : }
+
+ 00025 5d pop ebp
+ 00026 c2 20 00 ret 32 ; 00000020H
+_unzGetCurrentFileInfo64@32 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unzGetCurrentFileInfo@32
+_TEXT SEGMENT
+_file_info64$ = -88 ; size = 88
+_file$ = 8 ; size = 4
+_pfile_info$ = 12 ; size = 4
+_szFileName$ = 16 ; size = 4
+_fileNameBufferSize$ = 20 ; size = 4
+_extraField$ = 24 ; size = 4
+_extraFieldBufferSize$ = 28 ; size = 4
+_szComment$ = 32 ; size = 4
+_commentBufferSize$ = 36 ; size = 4
+_unzGetCurrentFileInfo@32 PROC ; COMDAT
+
+; 1141 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 e4 f8 and esp, -8 ; fffffff8H
+ 00006 83 ec 5c sub esp, 92 ; 0000005cH
+
+; 1142 : int err;
+; 1143 : unz_file_info64 file_info64;
+; 1144 : err = unz64local_GetCurrentFileInfoInternal(file,&file_info64,NULL,
+
+ 00009 8b 4d 08 mov ecx, DWORD PTR _file$[ebp]
+ 0000c 8d 54 24 04 lea edx, DWORD PTR _file_info64$[esp+92]
+ 00010 56 push esi
+ 00011 ff 75 24 push DWORD PTR _commentBufferSize$[ebp]
+ 00014 ff 75 20 push DWORD PTR _szComment$[ebp]
+ 00017 ff 75 1c push DWORD PTR _extraFieldBufferSize$[ebp]
+ 0001a ff 75 18 push DWORD PTR _extraField$[ebp]
+ 0001d ff 75 14 push DWORD PTR _fileNameBufferSize$[ebp]
+ 00020 ff 75 10 push DWORD PTR _szFileName$[ebp]
+ 00023 6a 00 push 0
+ 00025 e8 00 00 00 00 call _unz64local_GetCurrentFileInfoInternal
+ 0002a 8b f0 mov esi, eax
+ 0002c 83 c4 1c add esp, 28 ; 0000001cH
+
+; 1145 : szFileName,fileNameBufferSize,
+; 1146 : extraField,extraFieldBufferSize,
+; 1147 : szComment,commentBufferSize);
+; 1148 : if ((err==UNZ_OK) && (pfile_info != NULL))
+
+ 0002f 85 f6 test esi, esi
+ 00031 75 7e jne SHORT $LN2@unzGetCurr
+ 00033 8b 55 0c mov edx, DWORD PTR _pfile_info$[ebp]
+ 00036 85 d2 test edx, edx
+ 00038 74 77 je SHORT $LN2@unzGetCurr
+
+; 1149 : {
+; 1150 : pfile_info->version = file_info64.version;
+; 1151 : pfile_info->version_needed = file_info64.version_needed;
+
+ 0003a 8b 44 24 0c mov eax, DWORD PTR _file_info64$[esp+100]
+
+; 1152 : pfile_info->flag = file_info64.flag;
+; 1153 : pfile_info->compression_method = file_info64.compression_method;
+; 1154 : pfile_info->dosDate = file_info64.dosDate;
+; 1155 : pfile_info->crc = file_info64.crc;
+; 1156 :
+; 1157 : pfile_info->size_filename = file_info64.size_filename;
+; 1158 : pfile_info->size_file_extra = file_info64.size_file_extra;
+; 1159 : pfile_info->size_file_comment = file_info64.size_file_comment;
+; 1160 :
+; 1161 : pfile_info->disk_num_start = file_info64.disk_num_start;
+; 1162 : pfile_info->internal_fa = file_info64.internal_fa;
+; 1163 : pfile_info->external_fa = file_info64.external_fa;
+; 1164 :
+; 1165 : pfile_info->tmu_date = file_info64.tmu_date,
+
+ 0003e 0f 10 44 24 48 movups xmm0, XMMWORD PTR _file_info64$[esp+160]
+ 00043 89 42 04 mov DWORD PTR [edx+4], eax
+ 00046 8b 44 24 10 mov eax, DWORD PTR _file_info64$[esp+104]
+ 0004a 89 42 08 mov DWORD PTR [edx+8], eax
+ 0004d 8b 44 24 14 mov eax, DWORD PTR _file_info64$[esp+108]
+ 00051 8b 4c 24 08 mov ecx, DWORD PTR _file_info64$[esp+96]
+ 00055 89 42 0c mov DWORD PTR [edx+12], eax
+ 00058 8b 44 24 18 mov eax, DWORD PTR _file_info64$[esp+112]
+ 0005c 89 42 10 mov DWORD PTR [edx+16], eax
+ 0005f 8b 44 24 1c mov eax, DWORD PTR _file_info64$[esp+116]
+ 00063 89 42 14 mov DWORD PTR [edx+20], eax
+ 00066 8b 44 24 30 mov eax, DWORD PTR _file_info64$[esp+136]
+ 0006a 89 42 20 mov DWORD PTR [edx+32], eax
+ 0006d 8b 44 24 34 mov eax, DWORD PTR _file_info64$[esp+140]
+ 00071 89 42 24 mov DWORD PTR [edx+36], eax
+ 00074 8b 44 24 38 mov eax, DWORD PTR _file_info64$[esp+144]
+ 00078 89 42 28 mov DWORD PTR [edx+40], eax
+ 0007b 8b 44 24 3c mov eax, DWORD PTR _file_info64$[esp+148]
+ 0007f 89 42 2c mov DWORD PTR [edx+44], eax
+ 00082 8b 44 24 40 mov eax, DWORD PTR _file_info64$[esp+152]
+ 00086 89 42 30 mov DWORD PTR [edx+48], eax
+ 00089 8b 44 24 44 mov eax, DWORD PTR _file_info64$[esp+156]
+ 0008d 89 42 34 mov DWORD PTR [edx+52], eax
+ 00090 8b 44 24 20 mov eax, DWORD PTR _file_info64$[esp+120]
+ 00094 0f 11 42 38 movups XMMWORD PTR [edx+56], xmm0
+ 00098 89 42 18 mov DWORD PTR [edx+24], eax
+
+; 1166 :
+; 1167 :
+; 1168 : pfile_info->compressed_size = (uLong)file_info64.compressed_size;
+; 1169 : pfile_info->uncompressed_size = (uLong)file_info64.uncompressed_size;
+
+ 0009b 8b 44 24 28 mov eax, DWORD PTR _file_info64$[esp+128]
+ 0009f f3 0f 7e 44 24
+ 58 movq xmm0, QWORD PTR _file_info64$[esp+176]
+ 000a5 89 42 1c mov DWORD PTR [edx+28], eax
+
+; 1170 :
+; 1171 : }
+; 1172 : return err;
+
+ 000a8 8b c6 mov eax, esi
+ 000aa 89 0a mov DWORD PTR [edx], ecx
+ 000ac 66 0f d6 42 48 movq QWORD PTR [edx+72], xmm0
+$LN2@unzGetCurr:
+
+; 1173 : }
+
+ 000b1 5e pop esi
+ 000b2 8b e5 mov esp, ebp
+ 000b4 5d pop ebp
+ 000b5 c2 20 00 ret 32 ; 00000020H
+_unzGetCurrentFileInfo@32 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unzGoToFirstFile@4
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_unzGoToFirstFile@4 PROC ; COMDAT
+
+; 1179 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 56 push esi
+
+; 1180 : int err=UNZ_OK;
+; 1181 : unz64_s* s;
+; 1182 : if (file==NULL)
+
+ 00004 8b 75 08 mov esi, DWORD PTR _file$[ebp]
+ 00007 85 f6 test esi, esi
+ 00009 75 08 jne SHORT $LN2@unzGoToFir
+
+; 1183 : return UNZ_PARAMERROR;
+
+ 0000b 8d 46 9a lea eax, DWORD PTR [esi-102]
+
+; 1192 : }
+
+ 0000e 5e pop esi
+ 0000f 5d pop ebp
+ 00010 c2 04 00 ret 4
+$LN2@unzGoToFir:
+
+; 1184 : s=(unz64_s*)file;
+; 1185 : s->pos_in_central_dir=s->offset_central_dir;
+
+ 00013 8b 46 78 mov eax, DWORD PTR [esi+120]
+
+; 1186 : s->num_file=0;
+; 1187 : err=unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info,
+
+ 00016 8d 96 80 00 00
+ 00 lea edx, DWORD PTR [esi+128]
+ 0001c 6a 00 push 0
+ 0001e 6a 00 push 0
+ 00020 6a 00 push 0
+ 00022 6a 00 push 0
+ 00024 89 46 58 mov DWORD PTR [esi+88], eax
+ 00027 8b ce mov ecx, esi
+ 00029 8b 46 7c mov eax, DWORD PTR [esi+124]
+ 0002c 6a 00 push 0
+ 0002e 89 46 5c mov DWORD PTR [esi+92], eax
+ 00031 8d 86 d8 00 00
+ 00 lea eax, DWORD PTR [esi+216]
+ 00037 6a 00 push 0
+ 00039 50 push eax
+ 0003a c7 46 50 00 00
+ 00 00 mov DWORD PTR [esi+80], 0
+ 00041 c7 46 54 00 00
+ 00 00 mov DWORD PTR [esi+84], 0
+ 00048 e8 00 00 00 00 call _unz64local_GetCurrentFileInfoInternal
+ 0004d 8b c8 mov ecx, eax
+ 0004f 83 c4 1c add esp, 28 ; 0000001cH
+
+; 1188 : &s->cur_file_info_internal,
+; 1189 : NULL,0,NULL,0,NULL,0);
+; 1190 : s->current_file_ok = (err == UNZ_OK);
+
+ 00052 33 c0 xor eax, eax
+ 00054 85 c9 test ecx, ecx
+ 00056 0f 94 c0 sete al
+ 00059 99 cdq
+ 0005a 89 46 60 mov DWORD PTR [esi+96], eax
+
+; 1191 : return err;
+
+ 0005d 8b c1 mov eax, ecx
+ 0005f 89 56 64 mov DWORD PTR [esi+100], edx
+
+; 1192 : }
+
+ 00062 5e pop esi
+ 00063 5d pop ebp
+ 00064 c2 04 00 ret 4
+_unzGoToFirstFile@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unzGoToNextFile@4
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_unzGoToNextFile@4 PROC ; COMDAT
+
+; 1200 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 56 push esi
+
+; 1201 : unz64_s* s;
+; 1202 : int err;
+; 1203 :
+; 1204 : if (file==NULL)
+
+ 00004 8b 75 08 mov esi, DWORD PTR _file$[ebp]
+ 00007 85 f6 test esi, esi
+ 00009 75 08 jne SHORT $LN2@unzGoToNex
+
+; 1205 : return UNZ_PARAMERROR;
+
+ 0000b 8d 46 9a lea eax, DWORD PTR [esi-102]
+
+; 1221 : }
+
+ 0000e 5e pop esi
+ 0000f 5d pop ebp
+ 00010 c2 04 00 ret 4
+$LN2@unzGoToNex:
+
+; 1206 : s=(unz64_s*)file;
+; 1207 : if (!s->current_file_ok)
+
+ 00013 8b 46 60 mov eax, DWORD PTR [esi+96]
+ 00016 0b 46 64 or eax, DWORD PTR [esi+100]
+ 00019 75 0a jne SHORT $LN3@unzGoToNex
+$LN8@unzGoToNex:
+
+; 1208 : return UNZ_END_OF_LIST_OF_FILE;
+
+ 0001b b8 9c ff ff ff mov eax, -100 ; ffffff9cH
+
+; 1221 : }
+
+ 00020 5e pop esi
+ 00021 5d pop ebp
+ 00022 c2 04 00 ret 4
+$LN3@unzGoToNex:
+
+; 1209 : if (s->gi.number_entry != 0xffff) /* 2^16 files overflow hack */
+
+ 00025 81 7e 38 ff ff
+ 00 00 cmp DWORD PTR [esi+56], 65535 ; 0000ffffH
+ 0002c 8b 56 3c mov edx, DWORD PTR [esi+60]
+ 0002f 75 04 jne SHORT $LN7@unzGoToNex
+ 00031 85 d2 test edx, edx
+ 00033 74 15 je SHORT $LN5@unzGoToNex
+$LN7@unzGoToNex:
+
+; 1210 : if (s->num_file+1==s->gi.number_entry)
+
+ 00035 8b 46 50 mov eax, DWORD PTR [esi+80]
+ 00038 8b 4e 54 mov ecx, DWORD PTR [esi+84]
+ 0003b 83 c0 01 add eax, 1
+ 0003e 83 d1 00 adc ecx, 0
+ 00041 3b 46 38 cmp eax, DWORD PTR [esi+56]
+ 00044 75 04 jne SHORT $LN5@unzGoToNex
+ 00046 3b ca cmp ecx, edx
+ 00048 74 d1 je SHORT $LN8@unzGoToNex
+$LN5@unzGoToNex:
+
+; 1211 : return UNZ_END_OF_LIST_OF_FILE;
+; 1212 :
+; 1213 : s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename +
+
+ 0004a 8b 8e b0 00 00
+ 00 mov ecx, DWORD PTR [esi+176]
+
+; 1214 : s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ;
+; 1215 : s->num_file++;
+; 1216 : err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info,
+
+ 00050 8d 96 80 00 00
+ 00 lea edx, DWORD PTR [esi+128]
+ 00056 03 8e ac 00 00
+ 00 add ecx, DWORD PTR [esi+172]
+ 0005c 8b 86 a8 00 00
+ 00 mov eax, DWORD PTR [esi+168]
+ 00062 6a 00 push 0
+ 00064 83 c0 2e add eax, 46 ; 0000002eH
+ 00067 6a 00 push 0
+ 00069 03 c1 add eax, ecx
+ 0006b 8b ce mov ecx, esi
+ 0006d 01 46 58 add DWORD PTR [esi+88], eax
+ 00070 8d 86 d8 00 00
+ 00 lea eax, DWORD PTR [esi+216]
+ 00076 6a 00 push 0
+ 00078 83 56 5c 00 adc DWORD PTR [esi+92], 0
+ 0007c 83 46 50 01 add DWORD PTR [esi+80], 1
+ 00080 6a 00 push 0
+ 00082 83 56 54 00 adc DWORD PTR [esi+84], 0
+ 00086 6a 00 push 0
+ 00088 6a 00 push 0
+ 0008a 50 push eax
+ 0008b e8 00 00 00 00 call _unz64local_GetCurrentFileInfoInternal
+ 00090 8b c8 mov ecx, eax
+ 00092 83 c4 1c add esp, 28 ; 0000001cH
+
+; 1217 : &s->cur_file_info_internal,
+; 1218 : NULL,0,NULL,0,NULL,0);
+; 1219 : s->current_file_ok = (err == UNZ_OK);
+
+ 00095 33 c0 xor eax, eax
+ 00097 85 c9 test ecx, ecx
+ 00099 0f 94 c0 sete al
+ 0009c 99 cdq
+ 0009d 89 46 60 mov DWORD PTR [esi+96], eax
+
+; 1220 : return err;
+
+ 000a0 8b c1 mov eax, ecx
+ 000a2 89 56 64 mov DWORD PTR [esi+100], edx
+
+; 1221 : }
+
+ 000a5 5e pop esi
+ 000a6 5d pop ebp
+ 000a7 c2 04 00 ret 4
+_unzGoToNextFile@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unzLocateFile@12
+_TEXT SEGMENT
+_num_fileSaved$1$ = -392 ; size = 4
+_num_fileSaved$2$ = -388 ; size = 4
+_pos_in_central_dirSaved$1$ = -384 ; size = 4
+_pos_in_central_dirSaved$2$ = -380 ; size = 4
+_cur_file_info_internalSaved$1$ = -376 ; size = 4
+_cur_file_info_internalSaved$2$ = -372 ; size = 4
+_cur_file_infoSaved$6$ = -368 ; size = 8
+_cur_file_infoSaved$1$ = -352 ; size = 16
+_cur_file_infoSaved$2$ = -336 ; size = 16
+_cur_file_infoSaved$3$ = -320 ; size = 16
+_cur_file_infoSaved$4$ = -304 ; size = 16
+_cur_file_infoSaved$5$ = -288 ; size = 16
+_szCurrentFileName$1 = -264 ; size = 257
+_file$ = 8 ; size = 4
+_szFileName$ = 12 ; size = 4
+_iCaseSensitivity$ = 16 ; size = 4
+_unzLocateFile@12 PROC ; COMDAT
+
+; 1233 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 e4 f0 and esp, -16 ; fffffff0H
+ 00006 81 ec 88 01 00
+ 00 sub esp, 392 ; 00000188H
+ 0000c 56 push esi
+
+; 1234 : unz64_s* s;
+; 1235 : int err;
+; 1236 :
+; 1237 : /* We remember the 'current' position in the file so that we can jump
+; 1238 : * back there if we fail.
+; 1239 : */
+; 1240 : unz_file_info64 cur_file_infoSaved;
+; 1241 : unz_file_info64_internal cur_file_info_internalSaved;
+; 1242 : ZPOS64_T num_fileSaved;
+; 1243 : ZPOS64_T pos_in_central_dirSaved;
+; 1244 :
+; 1245 :
+; 1246 : if (file==NULL)
+
+ 0000d 8b 75 08 mov esi, DWORD PTR _file$[ebp]
+ 00010 57 push edi
+ 00011 85 f6 test esi, esi
+ 00013 75 0d jne SHORT $LN4@unzLocateF
+$LN18@unzLocateF:
+
+; 1247 : return UNZ_PARAMERROR;
+
+ 00015 b8 9a ff ff ff mov eax, -102 ; ffffff9aH
+
+; 1286 : return err;
+; 1287 : }
+
+ 0001a 5f pop edi
+ 0001b 5e pop esi
+ 0001c 8b e5 mov esp, ebp
+ 0001e 5d pop ebp
+ 0001f c2 0c 00 ret 12 ; 0000000cH
+$LN4@unzLocateF:
+
+; 1248 :
+; 1249 : if (strlen(szFileName)>=UNZ_MAXFILENAMEINZIP)
+
+ 00022 8b 7d 0c mov edi, DWORD PTR _szFileName$[ebp]
+ 00025 8b c7 mov eax, edi
+ 00027 8d 50 01 lea edx, DWORD PTR [eax+1]
+ 0002a 66 0f 1f 44 00
+ 00 npad 6
+$LL15@unzLocateF:
+ 00030 8a 08 mov cl, BYTE PTR [eax]
+ 00032 40 inc eax
+ 00033 84 c9 test cl, cl
+ 00035 75 f9 jne SHORT $LL15@unzLocateF
+ 00037 2b c2 sub eax, edx
+ 00039 3d 00 01 00 00 cmp eax, 256 ; 00000100H
+ 0003e 73 d5 jae SHORT $LN18@unzLocateF
+
+; 1250 : return UNZ_PARAMERROR;
+; 1251 :
+; 1252 : s=(unz64_s*)file;
+; 1253 : if (!s->current_file_ok)
+
+ 00040 8b 46 60 mov eax, DWORD PTR [esi+96]
+ 00043 0b 46 64 or eax, DWORD PTR [esi+100]
+ 00046 75 0d jne SHORT $LN6@unzLocateF
+
+; 1254 : return UNZ_END_OF_LIST_OF_FILE;
+
+ 00048 b8 9c ff ff ff mov eax, -100 ; ffffff9cH
+
+; 1286 : return err;
+; 1287 : }
+
+ 0004d 5f pop edi
+ 0004e 5e pop esi
+ 0004f 8b e5 mov esp, ebp
+ 00051 5d pop ebp
+ 00052 c2 0c 00 ret 12 ; 0000000cH
+$LN6@unzLocateF:
+
+; 1255 :
+; 1256 : /* Save the current state */
+; 1257 : num_fileSaved = s->num_file;
+; 1258 : pos_in_central_dirSaved = s->pos_in_central_dir;
+; 1259 : cur_file_infoSaved = s->cur_file_info;
+
+ 00055 0f 10 86 80 00
+ 00 00 movups xmm0, XMMWORD PTR [esi+128]
+ 0005c 8b 46 50 mov eax, DWORD PTR [esi+80]
+ 0005f 89 44 24 08 mov DWORD PTR _num_fileSaved$1$[esp+400], eax
+ 00063 8b 46 54 mov eax, DWORD PTR [esi+84]
+ 00066 0f 29 44 24 30 movaps XMMWORD PTR _cur_file_infoSaved$1$[esp+400], xmm0
+ 0006b 0f 10 86 90 00
+ 00 00 movups xmm0, XMMWORD PTR [esi+144]
+ 00072 89 44 24 0c mov DWORD PTR _num_fileSaved$2$[esp+400], eax
+ 00076 8b 46 58 mov eax, DWORD PTR [esi+88]
+ 00079 0f 29 44 24 40 movaps XMMWORD PTR _cur_file_infoSaved$2$[esp+400], xmm0
+ 0007e 0f 10 86 a0 00
+ 00 00 movups xmm0, XMMWORD PTR [esi+160]
+ 00085 89 44 24 10 mov DWORD PTR _pos_in_central_dirSaved$1$[esp+400], eax
+ 00089 8b 46 5c mov eax, DWORD PTR [esi+92]
+ 0008c 0f 29 44 24 50 movaps XMMWORD PTR _cur_file_infoSaved$3$[esp+400], xmm0
+ 00091 0f 10 86 b0 00
+ 00 00 movups xmm0, XMMWORD PTR [esi+176]
+ 00098 89 44 24 14 mov DWORD PTR _pos_in_central_dirSaved$2$[esp+400], eax
+
+; 1260 : cur_file_info_internalSaved = s->cur_file_info_internal;
+
+ 0009c 8b 86 d8 00 00
+ 00 mov eax, DWORD PTR [esi+216]
+ 000a2 0f 29 44 24 60 movaps XMMWORD PTR _cur_file_infoSaved$4$[esp+400], xmm0
+ 000a7 0f 10 86 c0 00
+ 00 00 movups xmm0, XMMWORD PTR [esi+192]
+ 000ae 89 44 24 18 mov DWORD PTR _cur_file_info_internalSaved$1$[esp+400], eax
+ 000b2 8b 86 dc 00 00
+ 00 mov eax, DWORD PTR [esi+220]
+ 000b8 0f 29 44 24 70 movaps XMMWORD PTR _cur_file_infoSaved$5$[esp+400], xmm0
+ 000bd f3 0f 7e 86 d0
+ 00 00 00 movq xmm0, QWORD PTR [esi+208]
+
+; 1261 :
+; 1262 : err = unzGoToFirstFile(file);
+
+ 000c5 56 push esi
+ 000c6 66 0f d6 44 24
+ 24 movq QWORD PTR _cur_file_infoSaved$6$[esp+404], xmm0
+ 000cc 89 44 24 20 mov DWORD PTR _cur_file_info_internalSaved$2$[esp+404], eax
+ 000d0 e8 00 00 00 00 call _unzGoToFirstFile@4
+
+; 1263 :
+; 1264 : while (err == UNZ_OK)
+
+ 000d5 85 c0 test eax, eax
+ 000d7 75 4b jne SHORT $LN14@unzLocateF
+ 000d9 0f 1f 80 00 00
+ 00 00 npad 7
+$LL2@unzLocateF:
+
+; 1265 : {
+; 1266 : char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1];
+; 1267 : err = unzGetCurrentFileInfo64(file,NULL,
+
+ 000e0 6a 00 push 0
+ 000e2 6a 00 push 0
+ 000e4 6a 00 push 0
+ 000e6 6a 00 push 0
+ 000e8 68 00 01 00 00 push 256 ; 00000100H
+ 000ed 8d 84 24 9c 00
+ 00 00 lea eax, DWORD PTR _szCurrentFileName$1[esp+420]
+ 000f4 50 push eax
+ 000f5 6a 00 push 0
+ 000f7 56 push esi
+ 000f8 e8 00 00 00 00 call _unzGetCurrentFileInfo64@32
+
+; 1268 : szCurrentFileName,sizeof(szCurrentFileName)-1,
+; 1269 : NULL,0,NULL,0);
+; 1270 : if (err == UNZ_OK)
+
+ 000fd 85 c0 test eax, eax
+ 000ff 75 23 jne SHORT $LN14@unzLocateF
+
+; 1271 : {
+; 1272 : if (unzStringFileNameCompare(szCurrentFileName,
+; 1273 : szFileName,iCaseSensitivity)==0)
+
+ 00101 ff 75 10 push DWORD PTR _iCaseSensitivity$[ebp]
+ 00104 8d 84 24 8c 00
+ 00 00 lea eax, DWORD PTR _szCurrentFileName$1[esp+404]
+ 0010b 57 push edi
+ 0010c 50 push eax
+ 0010d e8 00 00 00 00 call _unzStringFileNameCompare@12
+ 00112 85 c0 test eax, eax
+ 00114 0f 84 8c 00 00
+ 00 je $LN11@unzLocateF
+
+; 1274 : return UNZ_OK;
+; 1275 : err = unzGoToNextFile(file);
+
+ 0011a 56 push esi
+ 0011b e8 00 00 00 00 call _unzGoToNextFile@4
+ 00120 85 c0 test eax, eax
+ 00122 74 bc je SHORT $LL2@unzLocateF
+$LN14@unzLocateF:
+
+; 1276 : }
+; 1277 : }
+; 1278 :
+; 1279 : /* We failed, so restore the state of the 'current file' to where we
+; 1280 : * were.
+; 1281 : */
+; 1282 : s->num_file = num_fileSaved ;
+; 1283 : s->pos_in_central_dir = pos_in_central_dirSaved ;
+; 1284 : s->cur_file_info = cur_file_infoSaved;
+
+ 00124 0f 28 44 24 30 movaps xmm0, XMMWORD PTR _cur_file_infoSaved$1$[esp+400]
+ 00129 8b 4c 24 08 mov ecx, DWORD PTR _num_fileSaved$1$[esp+400]
+ 0012d 0f 11 86 80 00
+ 00 00 movups XMMWORD PTR [esi+128], xmm0
+ 00134 89 4e 50 mov DWORD PTR [esi+80], ecx
+ 00137 0f 28 44 24 40 movaps xmm0, XMMWORD PTR _cur_file_infoSaved$2$[esp+400]
+ 0013c 8b 4c 24 0c mov ecx, DWORD PTR _num_fileSaved$2$[esp+400]
+ 00140 0f 11 86 90 00
+ 00 00 movups XMMWORD PTR [esi+144], xmm0
+ 00147 89 4e 54 mov DWORD PTR [esi+84], ecx
+ 0014a 0f 28 44 24 50 movaps xmm0, XMMWORD PTR _cur_file_infoSaved$3$[esp+400]
+ 0014f 8b 4c 24 10 mov ecx, DWORD PTR _pos_in_central_dirSaved$1$[esp+400]
+ 00153 0f 11 86 a0 00
+ 00 00 movups XMMWORD PTR [esi+160], xmm0
+ 0015a 89 4e 58 mov DWORD PTR [esi+88], ecx
+ 0015d 0f 28 44 24 60 movaps xmm0, XMMWORD PTR _cur_file_infoSaved$4$[esp+400]
+ 00162 8b 4c 24 14 mov ecx, DWORD PTR _pos_in_central_dirSaved$2$[esp+400]
+ 00166 0f 11 86 b0 00
+ 00 00 movups XMMWORD PTR [esi+176], xmm0
+ 0016d 89 4e 5c mov DWORD PTR [esi+92], ecx
+ 00170 0f 28 44 24 70 movaps xmm0, XMMWORD PTR _cur_file_infoSaved$5$[esp+400]
+
+; 1285 : s->cur_file_info_internal = cur_file_info_internalSaved;
+
+ 00175 8b 4c 24 18 mov ecx, DWORD PTR _cur_file_info_internalSaved$1$[esp+400]
+ 00179 0f 11 86 c0 00
+ 00 00 movups XMMWORD PTR [esi+192], xmm0
+ 00180 89 8e d8 00 00
+ 00 mov DWORD PTR [esi+216], ecx
+ 00186 f3 0f 7e 44 24
+ 20 movq xmm0, QWORD PTR _cur_file_infoSaved$6$[esp+400]
+ 0018c 8b 4c 24 1c mov ecx, DWORD PTR _cur_file_info_internalSaved$2$[esp+400]
+ 00190 66 0f d6 86 d0
+ 00 00 00 movq QWORD PTR [esi+208], xmm0
+ 00198 89 8e dc 00 00
+ 00 mov DWORD PTR [esi+220], ecx
+
+; 1286 : return err;
+; 1287 : }
+
+ 0019e 5f pop edi
+ 0019f 5e pop esi
+ 001a0 8b e5 mov esp, ebp
+ 001a2 5d pop ebp
+ 001a3 c2 0c 00 ret 12 ; 0000000cH
+$LN11@unzLocateF:
+ 001a6 5f pop edi
+ 001a7 33 c0 xor eax, eax
+ 001a9 5e pop esi
+ 001aa 8b e5 mov esp, ebp
+ 001ac 5d pop ebp
+ 001ad c2 0c 00 ret 12 ; 0000000cH
+_unzLocateFile@12 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unzGetFilePos64@8
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_file_pos$ = 12 ; size = 4
+_unzGetFilePos64@8 PROC ; COMDAT
+
+; 1309 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 1310 : unz64_s* s;
+; 1311 :
+; 1312 : if (file==NULL || file_pos==NULL)
+
+ 00003 8b 4d 08 mov ecx, DWORD PTR _file$[ebp]
+ 00006 85 c9 test ecx, ecx
+ 00008 74 35 je SHORT $LN3@unzGetFile
+ 0000a 8b 55 0c mov edx, DWORD PTR _file_pos$[ebp]
+ 0000d 85 d2 test edx, edx
+ 0000f 74 2e je SHORT $LN3@unzGetFile
+
+; 1314 : s=(unz64_s*)file;
+; 1315 : if (!s->current_file_ok)
+
+ 00011 8b 41 60 mov eax, DWORD PTR [ecx+96]
+ 00014 0b 41 64 or eax, DWORD PTR [ecx+100]
+ 00017 75 09 jne SHORT $LN4@unzGetFile
+
+; 1316 : return UNZ_END_OF_LIST_OF_FILE;
+
+ 00019 b8 9c ff ff ff mov eax, -100 ; ffffff9cH
+
+; 1322 : }
+
+ 0001e 5d pop ebp
+ 0001f c2 08 00 ret 8
+$LN4@unzGetFile:
+
+; 1317 :
+; 1318 : file_pos->pos_in_zip_directory = s->pos_in_central_dir;
+
+ 00022 8b 41 58 mov eax, DWORD PTR [ecx+88]
+ 00025 89 02 mov DWORD PTR [edx], eax
+ 00027 8b 41 5c mov eax, DWORD PTR [ecx+92]
+ 0002a 89 42 04 mov DWORD PTR [edx+4], eax
+
+; 1319 : file_pos->num_of_file = s->num_file;
+
+ 0002d 8b 41 50 mov eax, DWORD PTR [ecx+80]
+ 00030 89 42 08 mov DWORD PTR [edx+8], eax
+ 00033 8b 41 54 mov eax, DWORD PTR [ecx+84]
+ 00036 89 42 0c mov DWORD PTR [edx+12], eax
+
+; 1320 :
+; 1321 : return UNZ_OK;
+
+ 00039 33 c0 xor eax, eax
+
+; 1322 : }
+
+ 0003b 5d pop ebp
+ 0003c c2 08 00 ret 8
+$LN3@unzGetFile:
+
+; 1313 : return UNZ_PARAMERROR;
+
+ 0003f b8 9a ff ff ff mov eax, -102 ; ffffff9aH
+
+; 1322 : }
+
+ 00044 5d pop ebp
+ 00045 c2 08 00 ret 8
+_unzGetFilePos64@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unzGetFilePos@8
+_TEXT SEGMENT
+_file_pos64$ = -16 ; size = 16
+_file$ = 8 ; size = 4
+_file_pos$ = 12 ; size = 4
+_unzGetFilePos@8 PROC ; COMDAT
+
+; 1327 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 10 sub esp, 16 ; 00000010H
+
+; 1328 : unz64_file_pos file_pos64;
+; 1329 : int err = unzGetFilePos64(file,&file_pos64);
+
+ 00006 8d 45 f0 lea eax, DWORD PTR _file_pos64$[ebp]
+ 00009 50 push eax
+ 0000a ff 75 08 push DWORD PTR _file$[ebp]
+ 0000d e8 00 00 00 00 call _unzGetFilePos64@8
+
+; 1330 : if (err==UNZ_OK)
+
+ 00012 85 c0 test eax, eax
+ 00014 75 0e jne SHORT $LN2@unzGetFile
+
+; 1331 : {
+; 1332 : file_pos->pos_in_zip_directory = (uLong)file_pos64.pos_in_zip_directory;
+
+ 00016 8b 55 0c mov edx, DWORD PTR _file_pos$[ebp]
+ 00019 8b 4d f0 mov ecx, DWORD PTR _file_pos64$[ebp]
+ 0001c 89 0a mov DWORD PTR [edx], ecx
+
+; 1333 : file_pos->num_of_file = (uLong)file_pos64.num_of_file;
+
+ 0001e 8b 4d f8 mov ecx, DWORD PTR _file_pos64$[ebp+8]
+ 00021 89 4a 04 mov DWORD PTR [edx+4], ecx
+$LN2@unzGetFile:
+
+; 1334 : }
+; 1335 : return err;
+; 1336 : }
+
+ 00024 8b e5 mov esp, ebp
+ 00026 5d pop ebp
+ 00027 c2 08 00 ret 8
+_unzGetFilePos@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unzGoToFilePos64@8
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_file_pos$ = 12 ; size = 4
+_unzGoToFilePos64@8 PROC ; COMDAT
+
+; 1339 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 56 push esi
+
+; 1340 : unz64_s* s;
+; 1341 : int err;
+; 1342 :
+; 1343 : if (file==NULL || file_pos==NULL)
+
+ 00004 8b 75 08 mov esi, DWORD PTR _file$[ebp]
+ 00007 85 f6 test esi, esi
+ 00009 74 58 je SHORT $LN3@unzGoToFil
+ 0000b 8b 4d 0c mov ecx, DWORD PTR _file_pos$[ebp]
+ 0000e 85 c9 test ecx, ecx
+ 00010 74 51 je SHORT $LN3@unzGoToFil
+
+; 1345 : s=(unz64_s*)file;
+; 1346 :
+; 1347 : /* jump to the right spot */
+; 1348 : s->pos_in_central_dir = file_pos->pos_in_zip_directory;
+
+ 00012 8b 01 mov eax, DWORD PTR [ecx]
+
+; 1349 : s->num_file = file_pos->num_of_file;
+; 1350 :
+; 1351 : /* set the current file */
+; 1352 : err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info,
+
+ 00014 8d 96 80 00 00
+ 00 lea edx, DWORD PTR [esi+128]
+ 0001a 6a 00 push 0
+ 0001c 6a 00 push 0
+ 0001e 89 46 58 mov DWORD PTR [esi+88], eax
+ 00021 8b 41 04 mov eax, DWORD PTR [ecx+4]
+ 00024 6a 00 push 0
+ 00026 89 46 5c mov DWORD PTR [esi+92], eax
+ 00029 8b 41 08 mov eax, DWORD PTR [ecx+8]
+ 0002c 6a 00 push 0
+ 0002e 89 46 50 mov DWORD PTR [esi+80], eax
+ 00031 8b 41 0c mov eax, DWORD PTR [ecx+12]
+ 00034 8b ce mov ecx, esi
+ 00036 6a 00 push 0
+ 00038 89 46 54 mov DWORD PTR [esi+84], eax
+ 0003b 8d 86 d8 00 00
+ 00 lea eax, DWORD PTR [esi+216]
+ 00041 6a 00 push 0
+ 00043 50 push eax
+ 00044 e8 00 00 00 00 call _unz64local_GetCurrentFileInfoInternal
+ 00049 8b c8 mov ecx, eax
+ 0004b 83 c4 1c add esp, 28 ; 0000001cH
+
+; 1353 : &s->cur_file_info_internal,
+; 1354 : NULL,0,NULL,0,NULL,0);
+; 1355 : /* return results */
+; 1356 : s->current_file_ok = (err == UNZ_OK);
+
+ 0004e 33 c0 xor eax, eax
+ 00050 85 c9 test ecx, ecx
+ 00052 0f 94 c0 sete al
+ 00055 99 cdq
+ 00056 89 46 60 mov DWORD PTR [esi+96], eax
+
+; 1357 : return err;
+
+ 00059 8b c1 mov eax, ecx
+ 0005b 89 56 64 mov DWORD PTR [esi+100], edx
+
+; 1358 : }
+
+ 0005e 5e pop esi
+ 0005f 5d pop ebp
+ 00060 c2 08 00 ret 8
+$LN3@unzGoToFil:
+
+; 1344 : return UNZ_PARAMERROR;
+
+ 00063 b8 9a ff ff ff mov eax, -102 ; ffffff9aH
+
+; 1358 : }
+
+ 00068 5e pop esi
+ 00069 5d pop ebp
+ 0006a c2 08 00 ret 8
+_unzGoToFilePos64@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unzGoToFilePos@8
+_TEXT SEGMENT
+_file_pos64$ = -16 ; size = 16
+_file$ = 8 ; size = 4
+_file_pos$ = 12 ; size = 4
+_unzGoToFilePos@8 PROC ; COMDAT
+
+; 1363 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 e4 f8 and esp, -8 ; fffffff8H
+
+; 1364 : unz64_file_pos file_pos64;
+; 1365 : if (file_pos == NULL)
+
+ 00006 8b 4d 0c mov ecx, DWORD PTR _file_pos$[ebp]
+ 00009 83 ec 10 sub esp, 16 ; 00000010H
+ 0000c 85 c9 test ecx, ecx
+ 0000e 75 09 jne SHORT $LN2@unzGoToFil
+
+; 1366 : return UNZ_PARAMERROR;
+
+ 00010 8d 41 9a lea eax, DWORD PTR [ecx-102]
+
+; 1371 : }
+
+ 00013 8b e5 mov esp, ebp
+ 00015 5d pop ebp
+ 00016 c2 08 00 ret 8
+$LN2@unzGoToFil:
+
+; 1367 :
+; 1368 : file_pos64.pos_in_zip_directory = file_pos->pos_in_zip_directory;
+
+ 00019 8b 01 mov eax, DWORD PTR [ecx]
+ 0001b 89 04 24 mov DWORD PTR _file_pos64$[esp+16], eax
+
+; 1369 : file_pos64.num_of_file = file_pos->num_of_file;
+
+ 0001e 8b 41 04 mov eax, DWORD PTR [ecx+4]
+ 00021 89 44 24 08 mov DWORD PTR _file_pos64$[esp+24], eax
+
+; 1370 : return unzGoToFilePos64(file,&file_pos64);
+
+ 00025 8d 04 24 lea eax, DWORD PTR _file_pos64$[esp+16]
+ 00028 50 push eax
+ 00029 ff 75 08 push DWORD PTR _file$[ebp]
+ 0002c c7 44 24 0c 00
+ 00 00 00 mov DWORD PTR _file_pos64$[esp+28], 0
+ 00034 c7 44 24 14 00
+ 00 00 00 mov DWORD PTR _file_pos64$[esp+36], 0
+ 0003c e8 00 00 00 00 call _unzGoToFilePos64@8
+
+; 1371 : }
+
+ 00041 8b e5 mov esp, ebp
+ 00043 5d pop ebp
+ 00044 c2 08 00 ret 8
+_unzGoToFilePos@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unz64local_CheckCurrentFileCoherencyHeader
+_TEXT SEGMENT
+_size_extra_field$ = -12 ; size = 4
+_size_filename$ = -12 ; size = 4
+_uFlags$ = -12 ; size = 4
+_piSizeVar$1$ = -8 ; size = 4
+_uData$ = -4 ; size = 4
+_uMagic$ = -4 ; size = 4
+_poffset_local_extrafield$ = 8 ; size = 4
+_psize_local_extrafield$ = 12 ; size = 4
+_unz64local_CheckCurrentFileCoherencyHeader PROC ; COMDAT
+; _s$ = ecx
+; _piSizeVar$ = edx
+
+; 1388 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 0c sub esp, 12 ; 0000000cH
+ 00006 53 push ebx
+ 00007 8b c2 mov eax, edx
+ 00009 56 push esi
+
+; 1389 : uLong uMagic,uData,uFlags;
+; 1390 : uLong size_filename;
+; 1391 : uLong size_extra_field;
+; 1392 : int err=UNZ_OK;
+
+ 0000a 33 f6 xor esi, esi
+ 0000c 89 45 f8 mov DWORD PTR _piSizeVar$1$[ebp], eax
+ 0000f 57 push edi
+
+; 1393 :
+; 1394 : *piSizeVar = 0;
+
+ 00010 89 30 mov DWORD PTR [eax], esi
+ 00012 8b f9 mov edi, ecx
+
+; 1395 : *poffset_local_extrafield = 0;
+
+ 00014 8b 45 08 mov eax, DWORD PTR _poffset_local_extrafield$[ebp]
+
+; 1396 : *psize_local_extrafield = 0;
+; 1397 :
+; 1398 : if (ZSEEK64(s->z_filefunc, s->filestream,s->cur_file_info_internal.offset_curfile +
+; 1399 : s->byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0)
+
+ 00017 56 push esi
+ 00018 8b 4f 48 mov ecx, DWORD PTR [edi+72]
+ 0001b 03 8f d8 00 00
+ 00 add ecx, DWORD PTR [edi+216]
+ 00021 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 00024 89 30 mov DWORD PTR [eax], esi
+ 00026 89 70 04 mov DWORD PTR [eax+4], esi
+ 00029 8b 45 0c mov eax, DWORD PTR _psize_local_extrafield$[ebp]
+ 0002c 89 30 mov DWORD PTR [eax], esi
+ 0002e 8b 47 4c mov eax, DWORD PTR [edi+76]
+ 00031 13 87 dc 00 00
+ 00 adc eax, DWORD PTR [edi+220]
+ 00037 50 push eax
+ 00038 51 push ecx
+ 00039 8b cf mov ecx, edi
+ 0003b e8 00 00 00 00 call _call_zseek64
+ 00040 83 c4 0c add esp, 12 ; 0000000cH
+ 00043 85 c0 test eax, eax
+ 00045 74 0a je SHORT $LN28@unz64local
+
+; 1400 : return UNZ_ERRNO;
+
+ 00047 83 c8 ff or eax, -1
+
+; 1462 :
+; 1463 : *piSizeVar += (uInt)size_extra_field;
+; 1464 :
+; 1465 : return err;
+; 1466 : }
+
+ 0004a 5f pop edi
+ 0004b 5e pop esi
+ 0004c 5b pop ebx
+ 0004d 8b e5 mov esp, ebp
+ 0004f 5d pop ebp
+ 00050 c3 ret 0
+$LN28@unz64local:
+
+; 1401 :
+; 1402 :
+; 1403 : if (err==UNZ_OK)
+; 1404 : {
+; 1405 : if (unz64local_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK)
+
+ 00051 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 00054 8d 45 fc lea eax, DWORD PTR _uMagic$[ebp]
+ 00057 50 push eax
+ 00058 8b cf mov ecx, edi
+ 0005a e8 00 00 00 00 call _unz64local_getLong
+ 0005f 83 c4 04 add esp, 4
+ 00062 bb 99 ff ff ff mov ebx, -103 ; ffffff99H
+ 00067 85 c0 test eax, eax
+ 00069 74 05 je SHORT $LN4@unz64local
+
+; 1406 : err=UNZ_ERRNO;
+
+ 0006b 83 ce ff or esi, -1
+ 0006e eb 0a jmp SHORT $LN6@unz64local
+$LN4@unz64local:
+
+; 1407 : else if (uMagic!=0x04034b50)
+
+ 00070 81 7d fc 50 4b
+ 03 04 cmp DWORD PTR _uMagic$[ebp], 67324752 ; 04034b50H
+ 00077 0f 45 f3 cmovne esi, ebx
+$LN6@unz64local:
+
+; 1408 : err=UNZ_BADZIPFILE;
+; 1409 : }
+; 1410 :
+; 1411 : if (unz64local_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK)
+
+ 0007a 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 0007d 8d 45 fc lea eax, DWORD PTR _uData$[ebp]
+ 00080 50 push eax
+ 00081 8b cf mov ecx, edi
+ 00083 e8 00 00 00 00 call _unz64local_getShort
+
+; 1412 : err=UNZ_ERRNO;
+; 1413 : /*
+; 1414 : else if ((err==UNZ_OK) && (uData!=s->cur_file_info.wVersion))
+; 1415 : err=UNZ_BADZIPFILE;
+; 1416 : */
+; 1417 : if (unz64local_getShort(&s->z_filefunc, s->filestream,&uFlags) != UNZ_OK)
+
+ 00088 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 0008b 83 c9 ff or ecx, -1
+ 0008e 83 c4 04 add esp, 4
+ 00091 85 c0 test eax, eax
+ 00093 8d 45 f4 lea eax, DWORD PTR _uFlags$[ebp]
+ 00096 0f 45 f1 cmovne esi, ecx
+ 00099 8b cf mov ecx, edi
+ 0009b 50 push eax
+ 0009c e8 00 00 00 00 call _unz64local_getShort
+
+; 1418 : err=UNZ_ERRNO;
+; 1419 :
+; 1420 : if (unz64local_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK)
+
+ 000a1 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 000a4 83 c4 04 add esp, 4
+ 000a7 85 c0 test eax, eax
+ 000a9 8b cf mov ecx, edi
+ 000ab b8 ff ff ff ff mov eax, -1
+ 000b0 0f 45 f0 cmovne esi, eax
+ 000b3 8d 45 fc lea eax, DWORD PTR _uData$[ebp]
+ 000b6 50 push eax
+ 000b7 e8 00 00 00 00 call _unz64local_getShort
+ 000bc 83 c4 04 add esp, 4
+ 000bf 85 c0 test eax, eax
+ 000c1 74 05 je SHORT $LN9@unz64local
+
+; 1421 : err=UNZ_ERRNO;
+
+ 000c3 83 ce ff or esi, -1
+ 000c6 eb 22 jmp SHORT $LN12@unz64local
+$LN9@unz64local:
+
+; 1422 : else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compression_method))
+
+ 000c8 85 f6 test esi, esi
+ 000ca 75 1e jne SHORT $LN12@unz64local
+ 000cc 8b 87 8c 00 00
+ 00 mov eax, DWORD PTR [edi+140]
+ 000d2 39 45 fc cmp DWORD PTR _uData$[ebp], eax
+ 000d5 74 04 je SHORT $LN29@unz64local
+
+; 1423 : err=UNZ_BADZIPFILE;
+
+ 000d7 8b f3 mov esi, ebx
+
+; 1424 :
+; 1425 : if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) &&
+; 1426 : /* #ifdef HAVE_BZIP2 */
+; 1427 : (s->cur_file_info.compression_method!=Z_BZIP2ED) &&
+
+ 000d9 eb 0f jmp SHORT $LN12@unz64local
+$LN29@unz64local:
+ 000db 85 c0 test eax, eax
+ 000dd 74 0b je SHORT $LN12@unz64local
+ 000df 83 f8 0c cmp eax, 12 ; 0000000cH
+ 000e2 74 06 je SHORT $LN12@unz64local
+ 000e4 83 f8 08 cmp eax, 8
+ 000e7 0f 45 f3 cmovne esi, ebx
+$LN12@unz64local:
+
+; 1428 : /* #endif */
+; 1429 : (s->cur_file_info.compression_method!=Z_DEFLATED))
+; 1430 : err=UNZ_BADZIPFILE;
+; 1431 :
+; 1432 : if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* date/time */
+
+ 000ea 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 000ed 8d 45 fc lea eax, DWORD PTR _uData$[ebp]
+ 000f0 50 push eax
+ 000f1 8b cf mov ecx, edi
+ 000f3 e8 00 00 00 00 call _unz64local_getLong
+
+; 1433 : err=UNZ_ERRNO;
+; 1434 :
+; 1435 : if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* crc */
+
+ 000f8 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 000fb 83 c4 04 add esp, 4
+ 000fe 85 c0 test eax, eax
+ 00100 8b cf mov ecx, edi
+ 00102 b8 ff ff ff ff mov eax, -1
+ 00107 0f 45 f0 cmovne esi, eax
+ 0010a 8d 45 fc lea eax, DWORD PTR _uData$[ebp]
+ 0010d 50 push eax
+ 0010e e8 00 00 00 00 call _unz64local_getLong
+ 00113 8b 5d f4 mov ebx, DWORD PTR _uFlags$[ebp]
+ 00116 83 c4 04 add esp, 4
+ 00119 85 c0 test eax, eax
+ 0011b 74 05 je SHORT $LN14@unz64local
+
+; 1436 : err=UNZ_ERRNO;
+
+ 0011d 83 ce ff or esi, -1
+ 00120 eb 1a jmp SHORT $LN16@unz64local
+$LN14@unz64local:
+
+; 1437 : else if ((err==UNZ_OK) && (uData!=s->cur_file_info.crc) && ((uFlags & 8)==0))
+
+ 00122 85 f6 test esi, esi
+ 00124 75 16 jne SHORT $LN16@unz64local
+ 00126 8b 45 fc mov eax, DWORD PTR _uData$[ebp]
+ 00129 3b 87 94 00 00
+ 00 cmp eax, DWORD PTR [edi+148]
+ 0012f 74 0b je SHORT $LN16@unz64local
+ 00131 f6 c3 08 test bl, 8
+ 00134 b8 99 ff ff ff mov eax, -103 ; ffffff99H
+ 00139 0f 44 f0 cmove esi, eax
+$LN16@unz64local:
+
+; 1438 : err=UNZ_BADZIPFILE;
+; 1439 :
+; 1440 : if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size compr */
+
+ 0013c 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 0013f 8d 45 fc lea eax, DWORD PTR _uData$[ebp]
+ 00142 50 push eax
+ 00143 8b cf mov ecx, edi
+ 00145 e8 00 00 00 00 call _unz64local_getLong
+ 0014a 83 c4 04 add esp, 4
+ 0014d 85 c0 test eax, eax
+ 0014f 74 05 je SHORT $LN17@unz64local
+
+; 1441 : err=UNZ_ERRNO;
+
+ 00151 83 ce ff or esi, -1
+ 00154 eb 29 jmp SHORT $LN19@unz64local
+$LN17@unz64local:
+
+; 1442 : else if (uData != 0xFFFFFFFF && (err==UNZ_OK) && (uData!=s->cur_file_info.compressed_size) && ((uFlags & 8)==0))
+
+ 00156 8b 45 fc mov eax, DWORD PTR _uData$[ebp]
+ 00159 83 f8 ff cmp eax, -1
+ 0015c 74 21 je SHORT $LN19@unz64local
+ 0015e 85 f6 test esi, esi
+ 00160 75 1d jne SHORT $LN19@unz64local
+ 00162 33 c9 xor ecx, ecx
+ 00164 3b 87 98 00 00
+ 00 cmp eax, DWORD PTR [edi+152]
+ 0016a 75 08 jne SHORT $LN30@unz64local
+ 0016c 3b 8f 9c 00 00
+ 00 cmp ecx, DWORD PTR [edi+156]
+ 00172 74 0b je SHORT $LN19@unz64local
+$LN30@unz64local:
+ 00174 f6 c3 08 test bl, 8
+ 00177 b8 99 ff ff ff mov eax, -103 ; ffffff99H
+ 0017c 0f 44 f0 cmove esi, eax
+$LN19@unz64local:
+
+; 1443 : err=UNZ_BADZIPFILE;
+; 1444 :
+; 1445 : if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size uncompr */
+
+ 0017f 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 00182 8d 45 fc lea eax, DWORD PTR _uData$[ebp]
+ 00185 50 push eax
+ 00186 8b cf mov ecx, edi
+ 00188 e8 00 00 00 00 call _unz64local_getLong
+ 0018d 83 c4 04 add esp, 4
+ 00190 85 c0 test eax, eax
+ 00192 74 05 je SHORT $LN20@unz64local
+
+; 1446 : err=UNZ_ERRNO;
+
+ 00194 83 ce ff or esi, -1
+ 00197 eb 29 jmp SHORT $LN22@unz64local
+$LN20@unz64local:
+
+; 1447 : else if (uData != 0xFFFFFFFF && (err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) && ((uFlags & 8)==0))
+
+ 00199 8b 45 fc mov eax, DWORD PTR _uData$[ebp]
+ 0019c 83 f8 ff cmp eax, -1
+ 0019f 74 21 je SHORT $LN22@unz64local
+ 001a1 85 f6 test esi, esi
+ 001a3 75 1d jne SHORT $LN22@unz64local
+ 001a5 33 c9 xor ecx, ecx
+ 001a7 3b 87 a0 00 00
+ 00 cmp eax, DWORD PTR [edi+160]
+ 001ad 75 08 jne SHORT $LN31@unz64local
+ 001af 3b 8f a4 00 00
+ 00 cmp ecx, DWORD PTR [edi+164]
+ 001b5 74 0b je SHORT $LN22@unz64local
+$LN31@unz64local:
+ 001b7 f6 c3 08 test bl, 8
+ 001ba b8 99 ff ff ff mov eax, -103 ; ffffff99H
+ 001bf 0f 44 f0 cmove esi, eax
+$LN22@unz64local:
+
+; 1448 : err=UNZ_BADZIPFILE;
+; 1449 :
+; 1450 : if (unz64local_getShort(&s->z_filefunc, s->filestream,&size_filename) != UNZ_OK)
+
+ 001c2 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 001c5 8d 45 f4 lea eax, DWORD PTR _size_filename$[ebp]
+ 001c8 50 push eax
+ 001c9 8b cf mov ecx, edi
+ 001cb e8 00 00 00 00 call _unz64local_getShort
+ 001d0 8b 5d f4 mov ebx, DWORD PTR _size_filename$[ebp]
+ 001d3 83 c4 04 add esp, 4
+ 001d6 85 c0 test eax, eax
+ 001d8 74 05 je SHORT $LN23@unz64local
+
+; 1451 : err=UNZ_ERRNO;
+
+ 001da 83 ce ff or esi, -1
+ 001dd eb 12 jmp SHORT $LN25@unz64local
+$LN23@unz64local:
+
+; 1452 : else if ((err==UNZ_OK) && (size_filename!=s->cur_file_info.size_filename))
+
+ 001df 85 f6 test esi, esi
+ 001e1 75 0e jne SHORT $LN25@unz64local
+ 001e3 3b 9f a8 00 00
+ 00 cmp ebx, DWORD PTR [edi+168]
+ 001e9 b8 99 ff ff ff mov eax, -103 ; ffffff99H
+ 001ee 0f 45 f0 cmovne esi, eax
+$LN25@unz64local:
+
+; 1453 : err=UNZ_BADZIPFILE;
+; 1454 :
+; 1455 : *piSizeVar += (uInt)size_filename;
+
+ 001f1 8b 45 f8 mov eax, DWORD PTR _piSizeVar$1$[ebp]
+
+; 1456 :
+; 1457 : if (unz64local_getShort(&s->z_filefunc, s->filestream,&size_extra_field) != UNZ_OK)
+
+ 001f4 8b cf mov ecx, edi
+ 001f6 8b 57 30 mov edx, DWORD PTR [edi+48]
+ 001f9 01 18 add DWORD PTR [eax], ebx
+ 001fb 8d 45 f4 lea eax, DWORD PTR _size_extra_field$[ebp]
+ 001fe 50 push eax
+ 001ff e8 00 00 00 00 call _unz64local_getShort
+ 00204 83 c4 04 add esp, 4
+ 00207 85 c0 test eax, eax
+ 00209 b8 ff ff ff ff mov eax, -1
+ 0020e 0f 45 f0 cmovne esi, eax
+
+; 1458 : err=UNZ_ERRNO;
+; 1459 : *poffset_local_extrafield= s->cur_file_info_internal.offset_curfile +
+
+ 00211 8b 45 08 mov eax, DWORD PTR _poffset_local_extrafield$[ebp]
+ 00214 33 c9 xor ecx, ecx
+ 00216 03 9f d8 00 00
+ 00 add ebx, DWORD PTR [edi+216]
+ 0021c 13 8f dc 00 00
+ 00 adc ecx, DWORD PTR [edi+220]
+ 00222 83 c3 1e add ebx, 30 ; 0000001eH
+ 00225 89 18 mov DWORD PTR [eax], ebx
+ 00227 83 d1 00 adc ecx, 0
+ 0022a 89 48 04 mov DWORD PTR [eax+4], ecx
+
+; 1460 : SIZEZIPLOCALHEADER + size_filename;
+; 1461 : *psize_local_extrafield = (uInt)size_extra_field;
+
+ 0022d 8b 45 0c mov eax, DWORD PTR _psize_local_extrafield$[ebp]
+ 00230 8b 4d f4 mov ecx, DWORD PTR _size_extra_field$[ebp]
+
+; 1462 :
+; 1463 : *piSizeVar += (uInt)size_extra_field;
+; 1464 :
+; 1465 : return err;
+; 1466 : }
+
+ 00233 5f pop edi
+ 00234 89 08 mov DWORD PTR [eax], ecx
+ 00236 8b 45 f8 mov eax, DWORD PTR _piSizeVar$1$[ebp]
+ 00239 01 08 add DWORD PTR [eax], ecx
+ 0023b 8b c6 mov eax, esi
+ 0023d 5e pop esi
+ 0023e 5b pop ebx
+ 0023f 8b e5 mov esp, ebp
+ 00241 5d pop ebp
+ 00242 c3 ret 0
+_unz64local_CheckCurrentFileCoherencyHeader ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unzOpenCurrentFile3@20
+_TEXT SEGMENT
+_size_local_extrafield$ = -16 ; size = 4
+_iSizeVar$ = -12 ; size = 4
+_offset_local_extrafield$ = -8 ; size = 8
+_file$ = 8 ; size = 4
+_method$ = 12 ; size = 4
+_level$ = 16 ; size = 4
+_raw$ = 20 ; size = 4
+_password$ = 24 ; size = 4
+_unzOpenCurrentFile3@20 PROC ; COMDAT
+
+; 1474 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 e4 f8 and esp, -8 ; fffffff8H
+ 00006 83 ec 14 sub esp, 20 ; 00000014H
+
+; 1475 : int err=UNZ_OK;
+; 1476 : uInt iSizeVar;
+; 1477 : unz64_s* s;
+; 1478 : file_in_zip64_read_info_s* pfile_in_zip_read_info;
+; 1479 : ZPOS64_T offset_local_extrafield; /* offset of the local extra field */
+; 1480 : uInt size_local_extrafield; /* size of the local extra field */
+; 1481 : # ifndef NOUNCRYPT
+; 1482 : char source[12];
+; 1483 : # else
+; 1484 : if (password != NULL)
+
+ 00009 83 7d 18 00 cmp DWORD PTR _password$[ebp], 0
+ 0000d 53 push ebx
+ 0000e 56 push esi
+ 0000f 57 push edi
+ 00010 74 0e je SHORT $LN4@unzOpenCur
+$LN25@unzOpenCur:
+
+; 1485 : return UNZ_PARAMERROR;
+
+ 00012 b8 9a ff ff ff mov eax, -102 ; ffffff9aH
+
+; 1639 : }
+
+ 00017 5f pop edi
+ 00018 5e pop esi
+ 00019 5b pop ebx
+ 0001a 8b e5 mov esp, ebp
+ 0001c 5d pop ebp
+ 0001d c2 14 00 ret 20 ; 00000014H
+$LN4@unzOpenCur:
+
+; 1486 : # endif
+; 1487 :
+; 1488 : if (file==NULL)
+
+ 00020 8b 7d 08 mov edi, DWORD PTR _file$[ebp]
+ 00023 85 ff test edi, edi
+ 00025 74 eb je SHORT $LN25@unzOpenCur
+
+; 1489 : return UNZ_PARAMERROR;
+; 1490 : s=(unz64_s*)file;
+; 1491 : if (!s->current_file_ok)
+
+ 00027 8b 47 60 mov eax, DWORD PTR [edi+96]
+ 0002a 0b 47 64 or eax, DWORD PTR [edi+100]
+ 0002d 74 e3 je SHORT $LN25@unzOpenCur
+
+; 1492 : return UNZ_PARAMERROR;
+; 1493 :
+; 1494 : if (s->pfile_in_zip_read != NULL)
+
+ 0002f 83 bf e0 00 00
+ 00 00 cmp DWORD PTR [edi+224], 0
+ 00036 74 06 je SHORT $LN7@unzOpenCur
+
+; 1495 : unzCloseCurrentFile(file);
+
+ 00038 57 push edi
+ 00039 e8 00 00 00 00 call _unzCloseCurrentFile@4
+$LN7@unzOpenCur:
+
+; 1496 :
+; 1497 : if (unz64local_CheckCurrentFileCoherencyHeader(s,&iSizeVar, &offset_local_extrafield,&size_local_extrafield)!=UNZ_OK)
+
+ 0003e 8d 44 24 10 lea eax, DWORD PTR _size_local_extrafield$[esp+32]
+ 00042 8b cf mov ecx, edi
+ 00044 50 push eax
+ 00045 8d 44 24 1c lea eax, DWORD PTR _offset_local_extrafield$[esp+36]
+ 00049 50 push eax
+ 0004a 8d 54 24 1c lea edx, DWORD PTR _iSizeVar$[esp+40]
+ 0004e e8 00 00 00 00 call _unz64local_CheckCurrentFileCoherencyHeader
+ 00053 83 c4 08 add esp, 8
+ 00056 85 c0 test eax, eax
+ 00058 74 0e je SHORT $LN8@unzOpenCur
+
+; 1498 : return UNZ_BADZIPFILE;
+
+ 0005a b8 99 ff ff ff mov eax, -103 ; ffffff99H
+
+; 1639 : }
+
+ 0005f 5f pop edi
+ 00060 5e pop esi
+ 00061 5b pop ebx
+ 00062 8b e5 mov esp, ebp
+ 00064 5d pop ebp
+ 00065 c2 14 00 ret 20 ; 00000014H
+$LN8@unzOpenCur:
+
+; 1499 :
+; 1500 : pfile_in_zip_read_info = (file_in_zip64_read_info_s*)ALLOC(sizeof(file_in_zip64_read_info_s));
+
+ 00068 8b 1d 00 00 00
+ 00 mov ebx, DWORD PTR __imp__malloc
+ 0006e 68 d0 00 00 00 push 208 ; 000000d0H
+ 00073 ff d3 call ebx
+ 00075 8b f0 mov esi, eax
+ 00077 83 c4 04 add esp, 4
+
+; 1501 : if (pfile_in_zip_read_info==NULL)
+
+ 0007a 85 f6 test esi, esi
+ 0007c 74 46 je SHORT $LN26@unzOpenCur
+
+; 1502 : return UNZ_INTERNALERROR;
+; 1503 :
+; 1504 : pfile_in_zip_read_info->read_buffer=(char*)ALLOC(UNZ_BUFSIZE);
+
+ 0007e 68 00 40 00 00 push 16384 ; 00004000H
+ 00083 ff d3 call ebx
+
+; 1505 : pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield;
+
+ 00085 8b 4c 24 1c mov ecx, DWORD PTR _offset_local_extrafield$[esp+36]
+ 00089 83 c4 04 add esp, 4
+
+; 1506 : pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield;
+; 1507 : pfile_in_zip_read_info->pos_local_extrafield=0;
+; 1508 : pfile_in_zip_read_info->raw=raw;
+
+ 0008c 8b 55 14 mov edx, DWORD PTR _raw$[ebp]
+ 0008f 89 4e 50 mov DWORD PTR [esi+80], ecx
+ 00092 8b 4c 24 1c mov ecx, DWORD PTR _offset_local_extrafield$[esp+36]
+ 00096 89 4e 54 mov DWORD PTR [esi+84], ecx
+ 00099 8b 4c 24 10 mov ecx, DWORD PTR _size_local_extrafield$[esp+32]
+ 0009d 89 06 mov DWORD PTR [esi], eax
+ 0009f 89 4e 58 mov DWORD PTR [esi+88], ecx
+ 000a2 c7 46 60 00 00
+ 00 00 mov DWORD PTR [esi+96], 0
+ 000a9 c7 46 64 00 00
+ 00 00 mov DWORD PTR [esi+100], 0
+ 000b0 89 96 c8 00 00
+ 00 mov DWORD PTR [esi+200], edx
+
+; 1509 :
+; 1510 : if (pfile_in_zip_read_info->read_buffer==NULL)
+
+ 000b6 85 c0 test eax, eax
+ 000b8 75 18 jne SHORT $LN10@unzOpenCur
+
+; 1511 : {
+; 1512 : TRYFREE(pfile_in_zip_read_info);
+
+ 000ba 56 push esi
+ 000bb ff 15 00 00 00
+ 00 call DWORD PTR __imp__free
+ 000c1 83 c4 04 add esp, 4
+$LN26@unzOpenCur:
+
+; 1513 : return UNZ_INTERNALERROR;
+
+ 000c4 b8 98 ff ff ff mov eax, -104 ; ffffff98H
+
+; 1639 : }
+
+ 000c9 5f pop edi
+ 000ca 5e pop esi
+ 000cb 5b pop ebx
+ 000cc 8b e5 mov esp, ebp
+ 000ce 5d pop ebp
+ 000cf c2 14 00 ret 20 ; 00000014H
+$LN10@unzOpenCur:
+
+; 1514 : }
+; 1515 :
+; 1516 : pfile_in_zip_read_info->stream_initialised=0;
+; 1517 :
+; 1518 : if (method!=NULL)
+
+ 000d2 8b 4d 0c mov ecx, DWORD PTR _method$[ebp]
+ 000d5 c7 46 48 00 00
+ 00 00 mov DWORD PTR [esi+72], 0
+ 000dc 85 c9 test ecx, ecx
+ 000de 74 08 je SHORT $LN12@unzOpenCur
+
+; 1519 : *method = (int)s->cur_file_info.compression_method;
+
+ 000e0 8b 87 8c 00 00
+ 00 mov eax, DWORD PTR [edi+140]
+ 000e6 89 01 mov DWORD PTR [ecx], eax
+$LN12@unzOpenCur:
+
+; 1520 :
+; 1521 : if (level!=NULL)
+
+ 000e8 8b 4d 10 mov ecx, DWORD PTR _level$[ebp]
+ 000eb 85 c9 test ecx, ecx
+ 000ed 74 34 je SHORT $LN2@unzOpenCur
+
+; 1522 : {
+; 1523 : *level = 6;
+
+ 000ef c7 01 06 00 00
+ 00 mov DWORD PTR [ecx], 6
+
+; 1524 : switch (s->cur_file_info.flag & 0x06)
+
+ 000f5 8b 87 88 00 00
+ 00 mov eax, DWORD PTR [edi+136]
+ 000fb 83 e0 06 and eax, 6
+ 000fe 83 e8 02 sub eax, 2
+ 00101 74 1a je SHORT $LN16@unzOpenCur
+ 00103 83 e8 02 sub eax, 2
+ 00106 74 0d je SHORT $LN15@unzOpenCur
+ 00108 83 e8 02 sub eax, 2
+ 0010b 75 16 jne SHORT $LN2@unzOpenCur
+
+; 1525 : {
+; 1526 : case 6 : *level = 1; break;
+
+ 0010d c7 01 01 00 00
+ 00 mov DWORD PTR [ecx], 1
+ 00113 eb 0e jmp SHORT $LN2@unzOpenCur
+$LN15@unzOpenCur:
+
+; 1527 : case 4 : *level = 2; break;
+
+ 00115 c7 01 02 00 00
+ 00 mov DWORD PTR [ecx], 2
+ 0011b eb 06 jmp SHORT $LN2@unzOpenCur
+$LN16@unzOpenCur:
+
+; 1528 : case 2 : *level = 9; break;
+
+ 0011d c7 01 09 00 00
+ 00 mov DWORD PTR [ecx], 9
+$LN2@unzOpenCur:
+
+; 1529 : }
+; 1530 : }
+; 1531 :
+; 1532 : if ((s->cur_file_info.compression_method!=0) &&
+; 1533 : /* #ifdef HAVE_BZIP2 */
+; 1534 : (s->cur_file_info.compression_method!=Z_BZIP2ED) &&
+; 1535 : /* #endif */
+; 1536 : (s->cur_file_info.compression_method!=Z_DEFLATED))
+; 1537 :
+; 1538 : err=UNZ_BADZIPFILE;
+; 1539 :
+; 1540 : pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc;
+
+ 00123 8b 87 94 00 00
+ 00 mov eax, DWORD PTR [edi+148]
+ 00129 89 46 74 mov DWORD PTR [esi+116], eax
+
+; 1541 : pfile_in_zip_read_info->crc32=0;
+
+ 0012c c7 46 70 00 00
+ 00 00 mov DWORD PTR [esi+112], 0
+
+; 1542 : pfile_in_zip_read_info->total_out_64=0;
+
+ 00133 c7 46 68 00 00
+ 00 00 mov DWORD PTR [esi+104], 0
+ 0013a c7 46 6c 00 00
+ 00 00 mov DWORD PTR [esi+108], 0
+
+; 1543 : pfile_in_zip_read_info->compression_method = s->cur_file_info.compression_method;
+
+ 00141 8b 87 8c 00 00
+ 00 mov eax, DWORD PTR [edi+140]
+ 00147 89 86 b8 00 00
+ 00 mov DWORD PTR [esi+184], eax
+
+; 1544 : pfile_in_zip_read_info->filestream=s->filestream;
+
+ 0014d 8b 47 30 mov eax, DWORD PTR [edi+48]
+ 00150 89 86 b4 00 00
+ 00 mov DWORD PTR [esi+180], eax
+
+; 1545 : pfile_in_zip_read_info->z_filefunc=s->z_filefunc;
+
+ 00156 0f 10 07 movups xmm0, XMMWORD PTR [edi]
+ 00159 0f 11 86 88 00
+ 00 00 movups XMMWORD PTR [esi+136], xmm0
+ 00160 0f 10 47 10 movups xmm0, XMMWORD PTR [edi+16]
+ 00164 0f 11 86 98 00
+ 00 00 movups XMMWORD PTR [esi+152], xmm0
+ 0016b f3 0f 7e 47 20 movq xmm0, QWORD PTR [edi+32]
+ 00170 66 0f d6 86 a8
+ 00 00 00 movq QWORD PTR [esi+168], xmm0
+ 00178 8b 47 28 mov eax, DWORD PTR [edi+40]
+ 0017b 89 86 b0 00 00
+ 00 mov DWORD PTR [esi+176], eax
+
+; 1546 : pfile_in_zip_read_info->byte_before_the_zipfile=s->byte_before_the_zipfile;
+
+ 00181 8b 47 48 mov eax, DWORD PTR [edi+72]
+ 00184 89 86 c0 00 00
+ 00 mov DWORD PTR [esi+192], eax
+ 0018a 8b 47 4c mov eax, DWORD PTR [edi+76]
+ 0018d 89 86 c4 00 00
+ 00 mov DWORD PTR [esi+196], eax
+
+; 1547 :
+; 1548 : pfile_in_zip_read_info->stream.total_out = 0;
+
+ 00193 c7 46 18 00 00
+ 00 00 mov DWORD PTR [esi+24], 0
+
+; 1549 :
+; 1550 : if ((s->cur_file_info.compression_method==Z_BZIP2ED) && (!raw))
+
+ 0019a 8b 87 8c 00 00
+ 00 mov eax, DWORD PTR [edi+140]
+ 001a0 83 f8 0c cmp eax, 12 ; 0000000cH
+ 001a3 75 78 jne SHORT $LN18@unzOpenCur
+ 001a5 85 d2 test edx, edx
+ 001a7 75 74 jne SHORT $LN18@unzOpenCur
+
+; 1551 : {
+; 1552 : #ifdef HAVE_BZIP2
+; 1553 : pfile_in_zip_read_info->bstream.bzalloc = (void *(*) (void *, int, int))0;
+; 1554 : pfile_in_zip_read_info->bstream.bzfree = (free_func)0;
+; 1555 : pfile_in_zip_read_info->bstream.opaque = (voidpf)0;
+; 1556 : pfile_in_zip_read_info->bstream.state = (voidpf)0;
+; 1557 :
+; 1558 : pfile_in_zip_read_info->stream.zalloc = (alloc_func)0;
+; 1559 : pfile_in_zip_read_info->stream.zfree = (free_func)0;
+; 1560 : pfile_in_zip_read_info->stream.opaque = (voidpf)0;
+; 1561 : pfile_in_zip_read_info->stream.next_in = (voidpf)0;
+; 1562 : pfile_in_zip_read_info->stream.avail_in = 0;
+; 1563 :
+; 1564 : err=BZ2_bzDecompressInit(&pfile_in_zip_read_info->bstream, 0, 0);
+; 1565 : if (err == Z_OK)
+; 1566 : pfile_in_zip_read_info->stream_initialised=Z_BZIP2ED;
+; 1567 : else
+; 1568 : {
+; 1569 : TRYFREE(pfile_in_zip_read_info);
+; 1570 : return err;
+; 1571 : }
+; 1572 : #else
+; 1573 : pfile_in_zip_read_info->raw=1;
+
+ 001a9 c7 86 c8 00 00
+ 00 01 00 00 00 mov DWORD PTR [esi+200], 1
+$LN22@unzOpenCur:
+
+; 1591 : }
+; 1592 : /* windowBits is passed < 0 to tell that there is no zlib header.
+; 1593 : * Note that in this case inflate *requires* an extra "dummy" byte
+; 1594 : * after the compressed stream in order to complete decompression and
+; 1595 : * return Z_STREAM_END.
+; 1596 : * In unzip, i don't wait absolutely Z_STREAM_END because I known the
+; 1597 : * size of both compressed and uncompressed data
+; 1598 : */
+; 1599 : }
+; 1600 : pfile_in_zip_read_info->rest_read_compressed =
+
+ 001b3 8b 87 98 00 00
+ 00 mov eax, DWORD PTR [edi+152]
+
+; 1601 : s->cur_file_info.compressed_size ;
+; 1602 : pfile_in_zip_read_info->rest_read_uncompressed =
+; 1603 : s->cur_file_info.uncompressed_size ;
+; 1604 :
+; 1605 :
+; 1606 : pfile_in_zip_read_info->pos_in_zipfile =
+
+ 001b9 33 c9 xor ecx, ecx
+ 001bb 89 46 78 mov DWORD PTR [esi+120], eax
+ 001be 8b 87 9c 00 00
+ 00 mov eax, DWORD PTR [edi+156]
+ 001c4 89 46 7c mov DWORD PTR [esi+124], eax
+ 001c7 8b 87 a0 00 00
+ 00 mov eax, DWORD PTR [edi+160]
+ 001cd 89 86 80 00 00
+ 00 mov DWORD PTR [esi+128], eax
+ 001d3 8b 87 a4 00 00
+ 00 mov eax, DWORD PTR [edi+164]
+ 001d9 89 86 84 00 00
+ 00 mov DWORD PTR [esi+132], eax
+ 001df 8b 44 24 14 mov eax, DWORD PTR _iSizeVar$[esp+32]
+ 001e3 03 87 d8 00 00
+ 00 add eax, DWORD PTR [edi+216]
+ 001e9 13 8f dc 00 00
+ 00 adc ecx, DWORD PTR [edi+220]
+ 001ef 83 c0 1e add eax, 30 ; 0000001eH
+ 001f2 89 46 40 mov DWORD PTR [esi+64], eax
+ 001f5 83 d1 00 adc ecx, 0
+
+; 1607 : s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER +
+; 1608 : iSizeVar;
+; 1609 :
+; 1610 : pfile_in_zip_read_info->stream.avail_in = (uInt)0;
+
+ 001f8 c7 46 08 00 00
+ 00 00 mov DWORD PTR [esi+8], 0
+ 001ff 89 4e 44 mov DWORD PTR [esi+68], ecx
+
+; 1611 :
+; 1612 : s->pfile_in_zip_read = pfile_in_zip_read_info;
+; 1613 : s->encrypted = 0;
+; 1614 :
+; 1615 : # ifndef NOUNCRYPT
+; 1616 : if (password != NULL)
+; 1617 : {
+; 1618 : int i;
+; 1619 : s->pcrc_32_tab = get_crc_table();
+; 1620 : init_keys(password,s->keys,s->pcrc_32_tab);
+; 1621 : if (ZSEEK64(s->z_filefunc, s->filestream,
+; 1622 : s->pfile_in_zip_read->pos_in_zipfile +
+; 1623 : s->pfile_in_zip_read->byte_before_the_zipfile,
+; 1624 : SEEK_SET)!=0)
+; 1625 : return UNZ_INTERNALERROR;
+; 1626 : if(ZREAD64(s->z_filefunc, s->filestream,source, 12)<12)
+; 1627 : return UNZ_INTERNALERROR;
+; 1628 :
+; 1629 : for (i = 0; i<12; i++)
+; 1630 : zdecode(s->keys,s->pcrc_32_tab,source[i]);
+; 1631 :
+; 1632 : s->pfile_in_zip_read->pos_in_zipfile+=12;
+; 1633 : s->encrypted=1;
+; 1634 : }
+; 1635 : # endif
+; 1636 :
+; 1637 :
+; 1638 : return UNZ_OK;
+
+ 00202 33 c0 xor eax, eax
+ 00204 89 b7 e0 00 00
+ 00 mov DWORD PTR [edi+224], esi
+ 0020a c7 87 e4 00 00
+ 00 00 00 00 00 mov DWORD PTR [edi+228], 0
+
+; 1639 : }
+
+ 00214 5f pop edi
+ 00215 5e pop esi
+ 00216 5b pop ebx
+ 00217 8b e5 mov esp, ebp
+ 00219 5d pop ebp
+ 0021a c2 14 00 ret 20 ; 00000014H
+$LN18@unzOpenCur:
+
+; 1574 : #endif
+; 1575 : }
+; 1576 : else if ((s->cur_file_info.compression_method==Z_DEFLATED) && (!raw))
+
+ 0021d 83 f8 08 cmp eax, 8
+ 00220 75 91 jne SHORT $LN22@unzOpenCur
+ 00222 85 d2 test edx, edx
+ 00224 75 8d jne SHORT $LN22@unzOpenCur
+
+; 1577 : {
+; 1578 : pfile_in_zip_read_info->stream.zalloc = (alloc_func)0;
+; 1579 : pfile_in_zip_read_info->stream.zfree = (free_func)0;
+; 1580 : pfile_in_zip_read_info->stream.opaque = (voidpf)0;
+; 1581 : pfile_in_zip_read_info->stream.next_in = 0;
+; 1582 : pfile_in_zip_read_info->stream.avail_in = 0;
+; 1583 :
+; 1584 : err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS);
+
+ 00226 6a 38 push 56 ; 00000038H
+ 00228 68 00 00 00 00 push OFFSET ??_C@_05IAIEPMAK@1?42?48?$AA@
+ 0022d 8d 46 04 lea eax, DWORD PTR [esi+4]
+ 00230 89 56 24 mov DWORD PTR [esi+36], edx
+ 00233 6a f1 push -15 ; fffffff1H
+ 00235 50 push eax
+ 00236 89 56 28 mov DWORD PTR [esi+40], edx
+ 00239 89 56 2c mov DWORD PTR [esi+44], edx
+ 0023c 89 10 mov DWORD PTR [eax], edx
+ 0023e 89 56 08 mov DWORD PTR [esi+8], edx
+ 00241 e8 00 00 00 00 call _inflateInit2_@16
+ 00246 8b d8 mov ebx, eax
+
+; 1585 : if (err == Z_OK)
+
+ 00248 85 db test ebx, ebx
+ 0024a 75 0c jne SHORT $LN21@unzOpenCur
+
+; 1586 : pfile_in_zip_read_info->stream_initialised=Z_DEFLATED;
+
+ 0024c c7 46 48 08 00
+ 00 00 mov DWORD PTR [esi+72], 8
+ 00253 e9 5b ff ff ff jmp $LN22@unzOpenCur
+$LN21@unzOpenCur:
+
+; 1587 : else
+; 1588 : {
+; 1589 : TRYFREE(pfile_in_zip_read_info);
+
+ 00258 56 push esi
+ 00259 ff 15 00 00 00
+ 00 call DWORD PTR __imp__free
+ 0025f 83 c4 04 add esp, 4
+
+; 1590 : return err;
+
+ 00262 8b c3 mov eax, ebx
+
+; 1639 : }
+
+ 00264 5f pop edi
+ 00265 5e pop esi
+ 00266 5b pop ebx
+ 00267 8b e5 mov esp, ebp
+ 00269 5d pop ebp
+ 0026a c2 14 00 ret 20 ; 00000014H
+_unzOpenCurrentFile3@20 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unzOpenCurrentFile@4
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_unzOpenCurrentFile@4 PROC ; COMDAT
+
+; 1642 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 1643 : return unzOpenCurrentFile3(file, NULL, NULL, 0, NULL);
+
+ 00003 6a 00 push 0
+ 00005 6a 00 push 0
+ 00007 6a 00 push 0
+ 00009 6a 00 push 0
+ 0000b ff 75 08 push DWORD PTR _file$[ebp]
+ 0000e e8 00 00 00 00 call _unzOpenCurrentFile3@20
+
+; 1644 : }
+
+ 00013 5d pop ebp
+ 00014 c2 04 00 ret 4
+_unzOpenCurrentFile@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unzOpenCurrentFilePassword@8
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_password$ = 12 ; size = 4
+_unzOpenCurrentFilePassword@8 PROC ; COMDAT
+
+; 1647 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 1648 : return unzOpenCurrentFile3(file, NULL, NULL, 0, password);
+
+ 00003 ff 75 0c push DWORD PTR _password$[ebp]
+ 00006 6a 00 push 0
+ 00008 6a 00 push 0
+ 0000a 6a 00 push 0
+ 0000c ff 75 08 push DWORD PTR _file$[ebp]
+ 0000f e8 00 00 00 00 call _unzOpenCurrentFile3@20
+
+; 1649 : }
+
+ 00014 5d pop ebp
+ 00015 c2 08 00 ret 8
+_unzOpenCurrentFilePassword@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unzOpenCurrentFile2@16
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_method$ = 12 ; size = 4
+_level$ = 16 ; size = 4
+_raw$ = 20 ; size = 4
+_unzOpenCurrentFile2@16 PROC ; COMDAT
+
+; 1652 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 1653 : return unzOpenCurrentFile3(file, method, level, raw, NULL);
+
+ 00003 6a 00 push 0
+ 00005 ff 75 14 push DWORD PTR _raw$[ebp]
+ 00008 ff 75 10 push DWORD PTR _level$[ebp]
+ 0000b ff 75 0c push DWORD PTR _method$[ebp]
+ 0000e ff 75 08 push DWORD PTR _file$[ebp]
+ 00011 e8 00 00 00 00 call _unzOpenCurrentFile3@20
+
+; 1654 : }
+
+ 00016 5d pop ebp
+ 00017 c2 10 00 ret 16 ; 00000010H
+_unzOpenCurrentFile2@16 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unzGetCurrentFileZStreamPos64@4
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_unzGetCurrentFileZStreamPos64@4 PROC ; COMDAT
+
+; 1659 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 1660 : unz64_s* s;
+; 1661 : file_in_zip64_read_info_s* pfile_in_zip_read_info;
+; 1662 : s=(unz64_s*)file;
+; 1663 : if (file==NULL)
+
+ 00003 8b 4d 08 mov ecx, DWORD PTR _file$[ebp]
+ 00006 85 c9 test ecx, ecx
+ 00008 75 08 jne SHORT $LN2@unzGetCurr
+$LN5@unzGetCurr:
+
+; 1664 : return 0; //UNZ_PARAMERROR;
+
+ 0000a 33 c0 xor eax, eax
+ 0000c 33 d2 xor edx, edx
+
+; 1669 : pfile_in_zip_read_info->byte_before_the_zipfile;
+; 1670 : }
+
+ 0000e 5d pop ebp
+ 0000f c2 04 00 ret 4
+$LN2@unzGetCurr:
+
+; 1665 : pfile_in_zip_read_info=s->pfile_in_zip_read;
+
+ 00012 8b 89 e0 00 00
+ 00 mov ecx, DWORD PTR [ecx+224]
+
+; 1666 : if (pfile_in_zip_read_info==NULL)
+
+ 00018 85 c9 test ecx, ecx
+ 0001a 74 ee je SHORT $LN5@unzGetCurr
+
+; 1667 : return 0; //UNZ_PARAMERROR;
+; 1668 : return pfile_in_zip_read_info->pos_in_zipfile +
+
+ 0001c 8b 81 c0 00 00
+ 00 mov eax, DWORD PTR [ecx+192]
+ 00022 03 41 40 add eax, DWORD PTR [ecx+64]
+ 00025 8b 91 c4 00 00
+ 00 mov edx, DWORD PTR [ecx+196]
+ 0002b 13 51 44 adc edx, DWORD PTR [ecx+68]
+
+; 1669 : pfile_in_zip_read_info->byte_before_the_zipfile;
+; 1670 : }
+
+ 0002e 5d pop ebp
+ 0002f c2 04 00 ret 4
+_unzGetCurrentFileZStreamPos64@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unzReadCurrentFile@12
+_TEXT SEGMENT
+_iRead$1$ = -16 ; size = 4
+_uTotalOutBefore$1$ = -12 ; size = 4
+tv353 = -8 ; size = 4
+_err$1$ = -8 ; size = 4
+_bufBefore$1$ = -4 ; size = 4
+_file$ = 8 ; size = 4
+_buf$ = 12 ; size = 4
+_len$ = 16 ; size = 4
+_unzReadCurrentFile@12 PROC ; COMDAT
+
+; 1685 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 e4 f8 and esp, -8 ; fffffff8H
+ 00006 83 ec 14 sub esp, 20 ; 00000014H
+ 00009 53 push ebx
+ 0000a 56 push esi
+
+; 1686 : int err=UNZ_OK;
+; 1687 : uInt iRead = 0;
+; 1688 : unz64_s* s;
+; 1689 : file_in_zip64_read_info_s* pfile_in_zip_read_info;
+; 1690 : if (file==NULL)
+
+ 0000b 8b 75 08 mov esi, DWORD PTR _file$[ebp]
+ 0000e 33 db xor ebx, ebx
+ 00010 89 5c 24 0c mov DWORD PTR _iRead$1$[esp+28], ebx
+ 00014 57 push edi
+ 00015 85 f6 test esi, esi
+ 00017 75 0e jne SHORT $LN7@unzReadCur
+$LN55@unzReadCur:
+
+; 1691 : return UNZ_PARAMERROR;
+
+ 00019 b8 9a ff ff ff mov eax, -102 ; ffffff9aH
+
+; 1882 : return err;
+; 1883 : }
+
+ 0001e 5f pop edi
+ 0001f 5e pop esi
+ 00020 5b pop ebx
+ 00021 8b e5 mov esp, ebp
+ 00023 5d pop ebp
+ 00024 c2 0c 00 ret 12 ; 0000000cH
+$LN7@unzReadCur:
+
+; 1692 : s=(unz64_s*)file;
+; 1693 : pfile_in_zip_read_info=s->pfile_in_zip_read;
+
+ 00027 8b b6 e0 00 00
+ 00 mov esi, DWORD PTR [esi+224]
+
+; 1694 :
+; 1695 : if (pfile_in_zip_read_info==NULL)
+
+ 0002d 85 f6 test esi, esi
+ 0002f 74 e8 je SHORT $LN55@unzReadCur
+
+; 1696 : return UNZ_PARAMERROR;
+; 1697 :
+; 1698 :
+; 1699 : if (pfile_in_zip_read_info->read_buffer == NULL)
+
+ 00031 39 1e cmp DWORD PTR [esi], ebx
+ 00033 75 0e jne SHORT $LN9@unzReadCur
+
+; 1700 : return UNZ_END_OF_LIST_OF_FILE;
+
+ 00035 b8 9c ff ff ff mov eax, -100 ; ffffff9cH
+
+; 1882 : return err;
+; 1883 : }
+
+ 0003a 5f pop edi
+ 0003b 5e pop esi
+ 0003c 5b pop ebx
+ 0003d 8b e5 mov esp, ebp
+ 0003f 5d pop ebp
+ 00040 c2 0c 00 ret 12 ; 0000000cH
+$LN9@unzReadCur:
+
+; 1701 : if (len==0)
+
+ 00043 8b 4d 10 mov ecx, DWORD PTR _len$[ebp]
+ 00046 85 c9 test ecx, ecx
+ 00048 75 0b jne SHORT $LN10@unzReadCur
+$LN33@unzReadCur:
+
+; 1702 : return 0;
+
+ 0004a 33 c0 xor eax, eax
+
+; 1882 : return err;
+; 1883 : }
+
+ 0004c 5f pop edi
+ 0004d 5e pop esi
+ 0004e 5b pop ebx
+ 0004f 8b e5 mov esp, ebp
+ 00051 5d pop ebp
+ 00052 c2 0c 00 ret 12 ; 0000000cH
+$LN10@unzReadCur:
+
+; 1703 :
+; 1704 : pfile_in_zip_read_info->stream.next_out = (Bytef*)buf;
+
+ 00055 8b 45 0c mov eax, DWORD PTR _buf$[ebp]
+ 00058 89 46 10 mov DWORD PTR [esi+16], eax
+
+; 1705 :
+; 1706 : pfile_in_zip_read_info->stream.avail_out = (uInt)len;
+; 1707 :
+; 1708 : if ((len>pfile_in_zip_read_info->rest_read_uncompressed) &&
+
+ 0005b 33 c0 xor eax, eax
+ 0005d 89 4e 14 mov DWORD PTR [esi+20], ecx
+ 00060 3b 86 84 00 00
+ 00 cmp eax, DWORD PTR [esi+132]
+ 00066 72 1b jb SHORT $LN11@unzReadCur
+ 00068 77 08 ja SHORT $LN49@unzReadCur
+ 0006a 3b 8e 80 00 00
+ 00 cmp ecx, DWORD PTR [esi+128]
+ 00070 76 11 jbe SHORT $LN11@unzReadCur
+$LN49@unzReadCur:
+ 00072 39 86 c8 00 00
+ 00 cmp DWORD PTR [esi+200], eax
+ 00078 75 09 jne SHORT $LN11@unzReadCur
+
+; 1709 : (!(pfile_in_zip_read_info->raw)))
+; 1710 : pfile_in_zip_read_info->stream.avail_out =
+
+ 0007a 8b 86 80 00 00
+ 00 mov eax, DWORD PTR [esi+128]
+ 00080 89 46 14 mov DWORD PTR [esi+20], eax
+$LN11@unzReadCur:
+
+; 1711 : (uInt)pfile_in_zip_read_info->rest_read_uncompressed;
+; 1712 :
+; 1713 : if ((len>pfile_in_zip_read_info->rest_read_compressed+
+; 1714 : pfile_in_zip_read_info->stream.avail_in) &&
+
+ 00083 8b 7e 08 mov edi, DWORD PTR [esi+8]
+ 00086 33 c0 xor eax, eax
+ 00088 8b d7 mov edx, edi
+ 0008a 03 56 78 add edx, DWORD PTR [esi+120]
+ 0008d 13 46 7c adc eax, DWORD PTR [esi+124]
+ 00090 3b d8 cmp ebx, eax
+ 00092 72 16 jb SHORT $LN31@unzReadCur
+ 00094 77 04 ja SHORT $LN50@unzReadCur
+ 00096 3b ca cmp ecx, edx
+ 00098 76 10 jbe SHORT $LN31@unzReadCur
+$LN50@unzReadCur:
+ 0009a 39 9e c8 00 00
+ 00 cmp DWORD PTR [esi+200], ebx
+ 000a0 74 08 je SHORT $LN31@unzReadCur
+
+; 1715 : (pfile_in_zip_read_info->raw))
+; 1716 : pfile_in_zip_read_info->stream.avail_out =
+
+ 000a2 8b 46 78 mov eax, DWORD PTR [esi+120]
+ 000a5 03 c7 add eax, edi
+ 000a7 89 46 14 mov DWORD PTR [esi+20], eax
+$LN31@unzReadCur:
+
+; 1717 : (uInt)pfile_in_zip_read_info->rest_read_compressed+
+; 1718 : pfile_in_zip_read_info->stream.avail_in;
+; 1719 :
+; 1720 : while (pfile_in_zip_read_info->stream.avail_out>0)
+
+ 000aa 39 5e 14 cmp DWORD PTR [esi+20], ebx
+ 000ad 0f 86 d0 01 00
+ 00 jbe $LN48@unzReadCur
+ 000b3 bb fd ff ff ff mov ebx, -3 ; fffffffdH
+ 000b8 0f 1f 84 00 00
+ 00 00 00 npad 8
+$LL2@unzReadCur:
+
+; 1721 : {
+; 1722 : if ((pfile_in_zip_read_info->stream.avail_in==0) &&
+
+ 000c0 83 7e 08 00 cmp DWORD PTR [esi+8], 0
+ 000c4 0f 85 96 00 00
+ 00 jne $LN13@unzReadCur
+ 000ca 8b 4e 7c mov ecx, DWORD PTR [esi+124]
+ 000cd 8b 46 78 mov eax, DWORD PTR [esi+120]
+ 000d0 85 c9 test ecx, ecx
+ 000d2 75 08 jne SHORT $LN51@unzReadCur
+ 000d4 85 c0 test eax, eax
+ 000d6 0f 84 84 00 00
+ 00 je $LN13@unzReadCur
+$LN51@unzReadCur:
+
+; 1723 : (pfile_in_zip_read_info->rest_read_compressed>0))
+; 1724 : {
+; 1725 : uInt uReadThis = UNZ_BUFSIZE;
+
+ 000dc bf 00 40 00 00 mov edi, 16384 ; 00004000H
+
+; 1726 : if (pfile_in_zip_read_info->rest_read_compressed<uReadThis)
+
+ 000e1 85 c9 test ecx, ecx
+ 000e3 77 11 ja SHORT $LN47@unzReadCur
+ 000e5 72 04 jb SHORT $LN52@unzReadCur
+ 000e7 3b c7 cmp eax, edi
+ 000e9 73 0b jae SHORT $LN47@unzReadCur
+$LN52@unzReadCur:
+
+; 1727 : uReadThis = (uInt)pfile_in_zip_read_info->rest_read_compressed;
+
+ 000eb 8b 7e 78 mov edi, DWORD PTR [esi+120]
+
+; 1728 : if (uReadThis == 0)
+
+ 000ee 85 ff test edi, edi
+ 000f0 0f 84 54 ff ff
+ ff je $LN33@unzReadCur
+$LN47@unzReadCur:
+
+; 1729 : return UNZ_EOF;
+; 1730 : if (ZSEEK64(pfile_in_zip_read_info->z_filefunc,
+; 1731 : pfile_in_zip_read_info->filestream,
+; 1732 : pfile_in_zip_read_info->pos_in_zipfile +
+; 1733 : pfile_in_zip_read_info->byte_before_the_zipfile,
+; 1734 : ZLIB_FILEFUNC_SEEK_SET)!=0)
+
+ 000f6 8b 8e c0 00 00
+ 00 mov ecx, DWORD PTR [esi+192]
+ 000fc 03 4e 40 add ecx, DWORD PTR [esi+64]
+ 000ff 8b 86 c4 00 00
+ 00 mov eax, DWORD PTR [esi+196]
+ 00105 13 46 44 adc eax, DWORD PTR [esi+68]
+ 00108 8b 96 b4 00 00
+ 00 mov edx, DWORD PTR [esi+180]
+ 0010e 6a 00 push 0
+ 00110 50 push eax
+ 00111 51 push ecx
+ 00112 8d 8e 88 00 00
+ 00 lea ecx, DWORD PTR [esi+136]
+ 00118 e8 00 00 00 00 call _call_zseek64
+ 0011d 83 c4 0c add esp, 12 ; 0000000cH
+ 00120 85 c0 test eax, eax
+ 00122 0f 85 66 01 00
+ 00 jne $LN34@unzReadCur
+
+; 1736 : if (ZREAD64(pfile_in_zip_read_info->z_filefunc,
+; 1737 : pfile_in_zip_read_info->filestream,
+; 1738 : pfile_in_zip_read_info->read_buffer,
+; 1739 : uReadThis)!=uReadThis)
+
+ 00128 8b 86 8c 00 00
+ 00 mov eax, DWORD PTR [esi+140]
+ 0012e 57 push edi
+ 0012f ff 36 push DWORD PTR [esi]
+ 00131 ff b6 b4 00 00
+ 00 push DWORD PTR [esi+180]
+ 00137 ff b6 a4 00 00
+ 00 push DWORD PTR [esi+164]
+ 0013d ff d0 call eax
+ 0013f 83 c4 10 add esp, 16 ; 00000010H
+ 00142 3b c7 cmp eax, edi
+ 00144 0f 85 44 01 00
+ 00 jne $LN34@unzReadCur
+
+; 1740 : return UNZ_ERRNO;
+; 1741 :
+; 1742 :
+; 1743 : # ifndef NOUNCRYPT
+; 1744 : if(s->encrypted)
+; 1745 : {
+; 1746 : uInt i;
+; 1747 : for(i=0;i<uReadThis;i++)
+; 1748 : pfile_in_zip_read_info->read_buffer[i] =
+; 1749 : zdecode(s->keys,s->pcrc_32_tab,
+; 1750 : pfile_in_zip_read_info->read_buffer[i]);
+; 1751 : }
+; 1752 : # endif
+; 1753 :
+; 1754 :
+; 1755 : pfile_in_zip_read_info->pos_in_zipfile += uReadThis;
+
+ 0014a 01 7e 40 add DWORD PTR [esi+64], edi
+
+; 1756 :
+; 1757 : pfile_in_zip_read_info->rest_read_compressed-=uReadThis;
+; 1758 :
+; 1759 : pfile_in_zip_read_info->stream.next_in =
+
+ 0014d 8b 06 mov eax, DWORD PTR [esi]
+ 0014f 83 56 44 00 adc DWORD PTR [esi+68], 0
+ 00153 29 7e 78 sub DWORD PTR [esi+120], edi
+ 00156 89 46 04 mov DWORD PTR [esi+4], eax
+ 00159 83 5e 7c 00 sbb DWORD PTR [esi+124], 0
+
+; 1760 : (Bytef*)pfile_in_zip_read_info->read_buffer;
+; 1761 : pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis;
+
+ 0015d 89 7e 08 mov DWORD PTR [esi+8], edi
+$LN13@unzReadCur:
+
+; 1762 : }
+; 1763 :
+; 1764 : if ((pfile_in_zip_read_info->compression_method==0) || (pfile_in_zip_read_info->raw))
+
+ 00160 8b 86 b8 00 00
+ 00 mov eax, DWORD PTR [esi+184]
+ 00166 85 c0 test eax, eax
+ 00168 0f 84 97 00 00
+ 00 je $LN20@unzReadCur
+ 0016e 83 be c8 00 00
+ 00 00 cmp DWORD PTR [esi+200], 0
+ 00175 0f 85 8a 00 00
+ 00 jne $LN20@unzReadCur
+
+; 1794 : }
+; 1795 : else if (pfile_in_zip_read_info->compression_method==Z_BZIP2ED)
+
+ 0017b 83 f8 0c cmp eax, 12 ; 0000000cH
+ 0017e 0f 84 f1 00 00
+ 00 je $LN28@unzReadCur
+
+; 1796 : {
+; 1797 : #ifdef HAVE_BZIP2
+; 1798 : uLong uTotalOutBefore,uTotalOutAfter;
+; 1799 : const Bytef *bufBefore;
+; 1800 : uLong uOutThis;
+; 1801 :
+; 1802 : pfile_in_zip_read_info->bstream.next_in = (char*)pfile_in_zip_read_info->stream.next_in;
+; 1803 : pfile_in_zip_read_info->bstream.avail_in = pfile_in_zip_read_info->stream.avail_in;
+; 1804 : pfile_in_zip_read_info->bstream.total_in_lo32 = pfile_in_zip_read_info->stream.total_in;
+; 1805 : pfile_in_zip_read_info->bstream.total_in_hi32 = 0;
+; 1806 : pfile_in_zip_read_info->bstream.next_out = (char*)pfile_in_zip_read_info->stream.next_out;
+; 1807 : pfile_in_zip_read_info->bstream.avail_out = pfile_in_zip_read_info->stream.avail_out;
+; 1808 : pfile_in_zip_read_info->bstream.total_out_lo32 = pfile_in_zip_read_info->stream.total_out;
+; 1809 : pfile_in_zip_read_info->bstream.total_out_hi32 = 0;
+; 1810 :
+; 1811 : uTotalOutBefore = pfile_in_zip_read_info->bstream.total_out_lo32;
+; 1812 : bufBefore = (const Bytef *)pfile_in_zip_read_info->bstream.next_out;
+; 1813 :
+; 1814 : err=BZ2_bzDecompress(&pfile_in_zip_read_info->bstream);
+; 1815 :
+; 1816 : uTotalOutAfter = pfile_in_zip_read_info->bstream.total_out_lo32;
+; 1817 : uOutThis = uTotalOutAfter-uTotalOutBefore;
+; 1818 :
+; 1819 : pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis;
+; 1820 :
+; 1821 : pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32,bufBefore, (uInt)(uOutThis));
+; 1822 : pfile_in_zip_read_info->rest_read_uncompressed -= uOutThis;
+; 1823 : iRead += (uInt)(uTotalOutAfter - uTotalOutBefore);
+; 1824 :
+; 1825 : pfile_in_zip_read_info->stream.next_in = (Bytef*)pfile_in_zip_read_info->bstream.next_in;
+; 1826 : pfile_in_zip_read_info->stream.avail_in = pfile_in_zip_read_info->bstream.avail_in;
+; 1827 : pfile_in_zip_read_info->stream.total_in = pfile_in_zip_read_info->bstream.total_in_lo32;
+; 1828 : pfile_in_zip_read_info->stream.next_out = (Bytef*)pfile_in_zip_read_info->bstream.next_out;
+; 1829 : pfile_in_zip_read_info->stream.avail_out = pfile_in_zip_read_info->bstream.avail_out;
+; 1830 : pfile_in_zip_read_info->stream.total_out = pfile_in_zip_read_info->bstream.total_out_lo32;
+; 1831 :
+; 1832 : if (err==BZ_STREAM_END)
+; 1833 : return (iRead==0) ? UNZ_EOF : iRead;
+; 1834 : if (err!=BZ_OK)
+; 1835 : break;
+; 1836 : #endif
+; 1837 : } // end Z_BZIP2ED
+; 1838 : else
+; 1839 : {
+; 1840 : ZPOS64_T uTotalOutBefore,uTotalOutAfter;
+; 1841 : const Bytef *bufBefore;
+; 1842 : ZPOS64_T uOutThis;
+; 1843 : int flush=Z_SYNC_FLUSH;
+; 1844 :
+; 1845 : uTotalOutBefore = pfile_in_zip_read_info->stream.total_out;
+
+ 00184 8b 46 18 mov eax, DWORD PTR [esi+24]
+ 00187 89 44 24 14 mov DWORD PTR _uTotalOutBefore$1$[esp+32], eax
+
+; 1846 : bufBefore = pfile_in_zip_read_info->stream.next_out;
+
+ 0018b 8b 46 10 mov eax, DWORD PTR [esi+16]
+ 0018e 89 44 24 1c mov DWORD PTR _bufBefore$1$[esp+32], eax
+
+; 1847 :
+; 1848 : /*
+; 1849 : if ((pfile_in_zip_read_info->rest_read_uncompressed ==
+; 1850 : pfile_in_zip_read_info->stream.avail_out) &&
+; 1851 : (pfile_in_zip_read_info->rest_read_compressed == 0))
+; 1852 : flush = Z_FINISH;
+; 1853 : */
+; 1854 : err=inflate(&pfile_in_zip_read_info->stream,flush);
+
+ 00192 8d 46 04 lea eax, DWORD PTR [esi+4]
+ 00195 6a 02 push 2
+ 00197 50 push eax
+ 00198 e8 00 00 00 00 call _inflate@8
+ 0019d 89 44 24 18 mov DWORD PTR _err$1$[esp+32], eax
+
+; 1855 :
+; 1856 : if ((err>=0) && (pfile_in_zip_read_info->stream.msg!=NULL))
+
+ 001a1 85 c0 test eax, eax
+ 001a3 78 0b js SHORT $LN26@unzReadCur
+ 001a5 83 7e 1c 00 cmp DWORD PTR [esi+28], 0
+ 001a9 0f 45 c3 cmovne eax, ebx
+ 001ac 89 44 24 18 mov DWORD PTR _err$1$[esp+32], eax
+$LN26@unzReadCur:
+
+; 1857 : err = Z_DATA_ERROR;
+; 1858 :
+; 1859 : uTotalOutAfter = pfile_in_zip_read_info->stream.total_out;
+; 1860 : uOutThis = uTotalOutAfter-uTotalOutBefore;
+
+ 001b0 8b 7e 18 mov edi, DWORD PTR [esi+24]
+ 001b3 33 db xor ebx, ebx
+ 001b5 2b 7c 24 14 sub edi, DWORD PTR _uTotalOutBefore$1$[esp+32]
+
+; 1861 :
+; 1862 : pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis;
+; 1863 :
+; 1864 : pfile_in_zip_read_info->crc32 =
+
+ 001b9 57 push edi
+ 001ba ff 74 24 20 push DWORD PTR _bufBefore$1$[esp+36]
+ 001be 1b db sbb ebx, ebx
+ 001c0 01 7e 68 add DWORD PTR [esi+104], edi
+ 001c3 ff 76 70 push DWORD PTR [esi+112]
+ 001c6 11 5e 6c adc DWORD PTR [esi+108], ebx
+ 001c9 e8 00 00 00 00 call _crc32@12
+
+; 1865 : crc32(pfile_in_zip_read_info->crc32,bufBefore,
+; 1866 : (uInt)(uOutThis));
+; 1867 :
+; 1868 : pfile_in_zip_read_info->rest_read_uncompressed -=
+
+ 001ce 29 be 80 00 00
+ 00 sub DWORD PTR [esi+128], edi
+
+; 1869 : uOutThis;
+; 1870 :
+; 1871 : iRead += (uInt)(uTotalOutAfter - uTotalOutBefore);
+
+ 001d4 8b 4c 24 10 mov ecx, DWORD PTR _iRead$1$[esp+32]
+ 001d8 19 9e 84 00 00
+ 00 sbb DWORD PTR [esi+132], ebx
+ 001de 89 46 70 mov DWORD PTR [esi+112], eax
+ 001e1 8b 46 18 mov eax, DWORD PTR [esi+24]
+ 001e4 2b 44 24 14 sub eax, DWORD PTR _uTotalOutBefore$1$[esp+32]
+ 001e8 03 c8 add ecx, eax
+
+; 1872 :
+; 1873 : if (err==Z_STREAM_END)
+
+ 001ea 8b 44 24 18 mov eax, DWORD PTR _err$1$[esp+32]
+ 001ee 89 4c 24 10 mov DWORD PTR _iRead$1$[esp+32], ecx
+ 001f2 83 f8 01 cmp eax, 1
+ 001f5 0f 84 9f 00 00
+ 00 je $LN36@unzReadCur
+
+; 1875 : if (err!=Z_OK)
+
+ 001fb 85 c0 test eax, eax
+ 001fd 0f 85 82 00 00
+ 00 jne $LN1@unzReadCur
+ 00203 eb 6b jmp SHORT $LN54@unzReadCur
+$LN20@unzReadCur:
+
+; 1765 : {
+; 1766 : uInt uDoCopy,i ;
+; 1767 :
+; 1768 : if ((pfile_in_zip_read_info->stream.avail_in == 0) &&
+
+ 00205 8b 5e 08 mov ebx, DWORD PTR [esi+8]
+ 00208 85 db test ebx, ebx
+ 0020a 75 0c jne SHORT $LN21@unzReadCur
+ 0020c 8b 46 78 mov eax, DWORD PTR [esi+120]
+ 0020f 0b 46 7c or eax, DWORD PTR [esi+124]
+ 00212 0f 84 8d 00 00
+ 00 je $LN38@unzReadCur
+$LN21@unzReadCur:
+
+; 1771 :
+; 1772 : if (pfile_in_zip_read_info->stream.avail_out <
+
+ 00218 39 5e 14 cmp DWORD PTR [esi+20], ebx
+ 0021b 0f 42 5e 14 cmovb ebx, DWORD PTR [esi+20]
+
+; 1773 : pfile_in_zip_read_info->stream.avail_in)
+; 1774 : uDoCopy = pfile_in_zip_read_info->stream.avail_out ;
+; 1775 : else
+; 1776 : uDoCopy = pfile_in_zip_read_info->stream.avail_in ;
+; 1777 :
+; 1778 : for (i=0;i<uDoCopy;i++)
+
+ 0021f 33 d2 xor edx, edx
+ 00221 85 db test ebx, ebx
+ 00223 74 11 je SHORT $LN5@unzReadCur
+$LL40@unzReadCur:
+
+; 1779 : *(pfile_in_zip_read_info->stream.next_out+i) =
+
+ 00225 8b 46 04 mov eax, DWORD PTR [esi+4]
+ 00228 8b 4e 10 mov ecx, DWORD PTR [esi+16]
+ 0022b 8a 04 02 mov al, BYTE PTR [edx+eax]
+ 0022e 88 04 0a mov BYTE PTR [edx+ecx], al
+ 00231 42 inc edx
+ 00232 3b d3 cmp edx, ebx
+ 00234 72 ef jb SHORT $LL40@unzReadCur
+$LN5@unzReadCur:
+
+; 1780 : *(pfile_in_zip_read_info->stream.next_in+i);
+; 1781 :
+; 1782 : pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uDoCopy;
+; 1783 :
+; 1784 : pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32,
+
+ 00236 8b 7e 10 mov edi, DWORD PTR [esi+16]
+ 00239 01 5e 68 add DWORD PTR [esi+104], ebx
+ 0023c 53 push ebx
+ 0023d 83 56 6c 00 adc DWORD PTR [esi+108], 0
+ 00241 57 push edi
+ 00242 ff 76 70 push DWORD PTR [esi+112]
+ 00245 e8 00 00 00 00 call _crc32@12
+
+; 1785 : pfile_in_zip_read_info->stream.next_out,
+; 1786 : uDoCopy);
+; 1787 : pfile_in_zip_read_info->rest_read_uncompressed-=uDoCopy;
+
+ 0024a 29 9e 80 00 00
+ 00 sub DWORD PTR [esi+128], ebx
+ 00250 89 46 70 mov DWORD PTR [esi+112], eax
+
+; 1788 : pfile_in_zip_read_info->stream.avail_in -= uDoCopy;
+; 1789 : pfile_in_zip_read_info->stream.avail_out -= uDoCopy;
+; 1790 : pfile_in_zip_read_info->stream.next_out += uDoCopy;
+
+ 00253 8d 04 1f lea eax, DWORD PTR [edi+ebx]
+ 00256 83 9e 84 00 00
+ 00 00 sbb DWORD PTR [esi+132], 0
+ 0025d 29 5e 08 sub DWORD PTR [esi+8], ebx
+ 00260 29 5e 14 sub DWORD PTR [esi+20], ebx
+
+; 1791 : pfile_in_zip_read_info->stream.next_in += uDoCopy;
+
+ 00263 01 5e 04 add DWORD PTR [esi+4], ebx
+
+; 1792 : pfile_in_zip_read_info->stream.total_out += uDoCopy;
+
+ 00266 01 5e 18 add DWORD PTR [esi+24], ebx
+
+; 1793 : iRead += uDoCopy;
+
+ 00269 01 5c 24 10 add DWORD PTR _iRead$1$[esp+32], ebx
+ 0026d 89 46 10 mov DWORD PTR [esi+16], eax
+$LN54@unzReadCur:
+ 00270 bb fd ff ff ff mov ebx, -3 ; fffffffdH
+$LN28@unzReadCur:
+
+; 1717 : (uInt)pfile_in_zip_read_info->rest_read_compressed+
+; 1718 : pfile_in_zip_read_info->stream.avail_in;
+; 1719 :
+; 1720 : while (pfile_in_zip_read_info->stream.avail_out>0)
+
+ 00275 83 7e 14 00 cmp DWORD PTR [esi+20], 0
+ 00279 0f 87 41 fe ff
+ ff ja $LL2@unzReadCur
+ 0027f 8b 5c 24 10 mov ebx, DWORD PTR _iRead$1$[esp+32]
+$LN48@unzReadCur:
+
+; 1876 : break;
+; 1877 : }
+; 1878 : }
+; 1879 :
+; 1880 : if (err==Z_OK)
+; 1881 : return iRead;
+
+ 00283 8b c3 mov eax, ebx
+$LN1@unzReadCur:
+
+; 1882 : return err;
+; 1883 : }
+
+ 00285 5f pop edi
+ 00286 5e pop esi
+ 00287 5b pop ebx
+ 00288 8b e5 mov esp, ebp
+ 0028a 5d pop ebp
+ 0028b c2 0c 00 ret 12 ; 0000000cH
+$LN34@unzReadCur:
+
+; 1735 : return UNZ_ERRNO;
+
+ 0028e 83 c8 ff or eax, -1
+
+; 1882 : return err;
+; 1883 : }
+
+ 00291 5f pop edi
+ 00292 5e pop esi
+ 00293 5b pop ebx
+ 00294 8b e5 mov esp, ebp
+ 00296 5d pop ebp
+ 00297 c2 0c 00 ret 12 ; 0000000cH
+$LN36@unzReadCur:
+
+; 1874 : return (iRead==0) ? UNZ_EOF : iRead;
+
+ 0029a 8b c1 mov eax, ecx
+
+; 1882 : return err;
+; 1883 : }
+
+ 0029c 5f pop edi
+ 0029d 5e pop esi
+ 0029e 5b pop ebx
+ 0029f 8b e5 mov esp, ebp
+ 002a1 5d pop ebp
+ 002a2 c2 0c 00 ret 12 ; 0000000cH
+$LN38@unzReadCur:
+
+; 1769 : (pfile_in_zip_read_info->rest_read_compressed == 0))
+; 1770 : return (iRead==0) ? UNZ_EOF : iRead;
+
+ 002a5 8b 44 24 10 mov eax, DWORD PTR _iRead$1$[esp+32]
+
+; 1882 : return err;
+; 1883 : }
+
+ 002a9 5f pop edi
+ 002aa 5e pop esi
+ 002ab 5b pop ebx
+ 002ac 8b e5 mov esp, ebp
+ 002ae 5d pop ebp
+ 002af c2 0c 00 ret 12 ; 0000000cH
+_unzReadCurrentFile@12 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unztell@4
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_unztell@4 PROC ; COMDAT
+
+; 1890 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 1891 : unz64_s* s;
+; 1892 : file_in_zip64_read_info_s* pfile_in_zip_read_info;
+; 1893 : if (file==NULL)
+
+ 00003 8b 45 08 mov eax, DWORD PTR _file$[ebp]
+ 00006 85 c0 test eax, eax
+ 00008 75 09 jne SHORT $LN2@unztell
+$LN5@unztell:
+
+; 1894 : return UNZ_PARAMERROR;
+
+ 0000a b8 9a ff ff ff mov eax, -102 ; ffffff9aH
+
+; 1902 : }
+
+ 0000f 5d pop ebp
+ 00010 c2 04 00 ret 4
+$LN2@unztell:
+
+; 1895 : s=(unz64_s*)file;
+; 1896 : pfile_in_zip_read_info=s->pfile_in_zip_read;
+
+ 00013 8b 80 e0 00 00
+ 00 mov eax, DWORD PTR [eax+224]
+
+; 1897 :
+; 1898 : if (pfile_in_zip_read_info==NULL)
+
+ 00019 85 c0 test eax, eax
+ 0001b 74 ed je SHORT $LN5@unztell
+
+; 1899 : return UNZ_PARAMERROR;
+; 1900 :
+; 1901 : return (z_off_t)pfile_in_zip_read_info->stream.total_out;
+
+ 0001d 8b 40 18 mov eax, DWORD PTR [eax+24]
+
+; 1902 : }
+
+ 00020 5d pop ebp
+ 00021 c2 04 00 ret 4
+_unztell@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unztell64@4
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_unztell64@4 PROC ; COMDAT
+
+; 1905 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 1906 :
+; 1907 : unz64_s* s;
+; 1908 : file_in_zip64_read_info_s* pfile_in_zip_read_info;
+; 1909 : if (file==NULL)
+
+ 00003 8b 55 08 mov edx, DWORD PTR _file$[ebp]
+ 00006 85 d2 test edx, edx
+ 00008 75 0a jne SHORT $LN2@unztell64
+$LN5@unztell64:
+
+; 1910 : return (ZPOS64_T)-1;
+
+ 0000a 83 c8 ff or eax, -1
+ 0000d 83 ca ff or edx, -1
+
+; 1918 : }
+
+ 00010 5d pop ebp
+ 00011 c2 04 00 ret 4
+$LN2@unztell64:
+
+; 1911 : s=(unz64_s*)file;
+; 1912 : pfile_in_zip_read_info=s->pfile_in_zip_read;
+
+ 00014 8b 92 e0 00 00
+ 00 mov edx, DWORD PTR [edx+224]
+
+; 1913 :
+; 1914 : if (pfile_in_zip_read_info==NULL)
+
+ 0001a 85 d2 test edx, edx
+ 0001c 74 ec je SHORT $LN5@unztell64
+
+; 1915 : return (ZPOS64_T)-1;
+; 1916 :
+; 1917 : return pfile_in_zip_read_info->total_out_64;
+
+ 0001e 8b 42 68 mov eax, DWORD PTR [edx+104]
+ 00021 8b 52 6c mov edx, DWORD PTR [edx+108]
+
+; 1918 : }
+
+ 00024 5d pop ebp
+ 00025 c2 04 00 ret 4
+_unztell64@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unzeof@4
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_unzeof@4 PROC ; COMDAT
+
+; 1925 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 1926 : unz64_s* s;
+; 1927 : file_in_zip64_read_info_s* pfile_in_zip_read_info;
+; 1928 : if (file==NULL)
+
+ 00003 8b 4d 08 mov ecx, DWORD PTR _file$[ebp]
+ 00006 85 c9 test ecx, ecx
+ 00008 75 09 jne SHORT $LN2@unzeof
+$LN7@unzeof:
+
+; 1929 : return UNZ_PARAMERROR;
+
+ 0000a b8 9a ff ff ff mov eax, -102 ; ffffff9aH
+
+; 1940 : }
+
+ 0000f 5d pop ebp
+ 00010 c2 04 00 ret 4
+$LN2@unzeof:
+
+; 1930 : s=(unz64_s*)file;
+; 1931 : pfile_in_zip_read_info=s->pfile_in_zip_read;
+
+ 00013 8b 89 e0 00 00
+ 00 mov ecx, DWORD PTR [ecx+224]
+
+; 1932 :
+; 1933 : if (pfile_in_zip_read_info==NULL)
+
+ 00019 85 c9 test ecx, ecx
+ 0001b 74 ed je SHORT $LN7@unzeof
+
+; 1934 : return UNZ_PARAMERROR;
+; 1935 :
+; 1936 : if (pfile_in_zip_read_info->rest_read_uncompressed == 0)
+
+ 0001d 8b 81 80 00 00
+ 00 mov eax, DWORD PTR [ecx+128]
+ 00023 0b 81 84 00 00
+ 00 or eax, DWORD PTR [ecx+132]
+ 00029 75 09 jne SHORT $LN4@unzeof
+
+; 1937 : return 1;
+
+ 0002b b8 01 00 00 00 mov eax, 1
+
+; 1940 : }
+
+ 00030 5d pop ebp
+ 00031 c2 04 00 ret 4
+$LN4@unzeof:
+
+; 1938 : else
+; 1939 : return 0;
+
+ 00034 33 c0 xor eax, eax
+
+; 1940 : }
+
+ 00036 5d pop ebp
+ 00037 c2 04 00 ret 4
+_unzeof@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unzGetLocalExtrafield@12
+_TEXT SEGMENT
+tv81 = -4 ; size = 4
+_file$ = 8 ; size = 4
+_buf$ = 12 ; size = 4
+_len$ = 16 ; size = 4
+_unzGetLocalExtrafield@12 PROC ; COMDAT
+
+; 1957 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 e4 f8 and esp, -8 ; fffffff8H
+ 00006 83 ec 08 sub esp, 8
+ 00009 56 push esi
+ 0000a 57 push edi
+
+; 1958 : unz64_s* s;
+; 1959 : file_in_zip64_read_info_s* pfile_in_zip_read_info;
+; 1960 : uInt read_now;
+; 1961 : ZPOS64_T size_to_read;
+; 1962 :
+; 1963 : if (file==NULL)
+
+ 0000b 8b 7d 08 mov edi, DWORD PTR _file$[ebp]
+ 0000e 85 ff test edi, edi
+ 00010 75 0d jne SHORT $LN2@unzGetLoca
+$LN13@unzGetLoca:
+
+; 1964 : return UNZ_PARAMERROR;
+
+ 00012 b8 9a ff ff ff mov eax, -102 ; ffffff9aH
+
+; 1995 : return UNZ_ERRNO;
+; 1996 :
+; 1997 : return (int)read_now;
+; 1998 : }
+
+ 00017 5f pop edi
+ 00018 5e pop esi
+ 00019 8b e5 mov esp, ebp
+ 0001b 5d pop ebp
+ 0001c c2 0c 00 ret 12 ; 0000000cH
+$LN2@unzGetLoca:
+
+; 1965 : s=(unz64_s*)file;
+; 1966 : pfile_in_zip_read_info=s->pfile_in_zip_read;
+
+ 0001f 8b bf e0 00 00
+ 00 mov edi, DWORD PTR [edi+224]
+
+; 1967 :
+; 1968 : if (pfile_in_zip_read_info==NULL)
+
+ 00025 85 ff test edi, edi
+ 00027 74 e9 je SHORT $LN13@unzGetLoca
+
+; 1969 : return UNZ_PARAMERROR;
+; 1970 :
+; 1971 : size_to_read = (pfile_in_zip_read_info->size_local_extrafield -
+
+ 00029 8b 77 58 mov esi, DWORD PTR [edi+88]
+ 0002c 33 c0 xor eax, eax
+ 0002e 8b 57 60 mov edx, DWORD PTR [edi+96]
+ 00031 2b f2 sub esi, edx
+ 00033 1b 47 64 sbb eax, DWORD PTR [edi+100]
+
+; 1972 : pfile_in_zip_read_info->pos_local_extrafield);
+; 1973 :
+; 1974 : if (buf==NULL)
+
+ 00036 83 7d 0c 00 cmp DWORD PTR _buf$[ebp], 0
+ 0003a 74 7c je SHORT $LN12@unzGetLoca
+
+; 1975 : return (int)size_to_read;
+; 1976 :
+; 1977 : if (len>size_to_read)
+
+ 0003c 8b 4d 10 mov ecx, DWORD PTR _len$[ebp]
+ 0003f c7 44 24 0c 00
+ 00 00 00 mov DWORD PTR tv81[esp+16], 0
+ 00047 39 44 24 0c cmp DWORD PTR tv81[esp+16], eax
+ 0004b 72 06 jb SHORT $LN5@unzGetLoca
+ 0004d 77 06 ja SHORT $LN6@unzGetLoca
+ 0004f 3b ce cmp ecx, esi
+ 00051 77 02 ja SHORT $LN6@unzGetLoca
+$LN5@unzGetLoca:
+
+; 1978 : read_now = (uInt)size_to_read;
+; 1979 : else
+; 1980 : read_now = (uInt)len ;
+
+ 00053 8b f1 mov esi, ecx
+$LN6@unzGetLoca:
+
+; 1981 :
+; 1982 : if (read_now==0)
+
+ 00055 85 f6 test esi, esi
+ 00057 75 0a jne SHORT $LN7@unzGetLoca
+
+; 1983 : return 0;
+
+ 00059 33 c0 xor eax, eax
+
+; 1995 : return UNZ_ERRNO;
+; 1996 :
+; 1997 : return (int)read_now;
+; 1998 : }
+
+ 0005b 5f pop edi
+ 0005c 5e pop esi
+ 0005d 8b e5 mov esp, ebp
+ 0005f 5d pop ebp
+ 00060 c2 0c 00 ret 12 ; 0000000cH
+$LN7@unzGetLoca:
+
+; 1984 :
+; 1985 : if (ZSEEK64(pfile_in_zip_read_info->z_filefunc,
+; 1986 : pfile_in_zip_read_info->filestream,
+; 1987 : pfile_in_zip_read_info->offset_local_extrafield +
+; 1988 : pfile_in_zip_read_info->pos_local_extrafield,
+; 1989 : ZLIB_FILEFUNC_SEEK_SET)!=0)
+
+ 00063 8b 4f 50 mov ecx, DWORD PTR [edi+80]
+ 00066 8b 47 54 mov eax, DWORD PTR [edi+84]
+ 00069 03 ca add ecx, edx
+ 0006b 8b 97 b4 00 00
+ 00 mov edx, DWORD PTR [edi+180]
+ 00071 13 47 64 adc eax, DWORD PTR [edi+100]
+ 00074 6a 00 push 0
+ 00076 50 push eax
+ 00077 51 push ecx
+ 00078 8d 8f 88 00 00
+ 00 lea ecx, DWORD PTR [edi+136]
+ 0007e e8 00 00 00 00 call _call_zseek64
+ 00083 83 c4 0c add esp, 12 ; 0000000cH
+ 00086 85 c0 test eax, eax
+ 00088 74 0b je SHORT $LN8@unzGetLoca
+
+; 1990 : return UNZ_ERRNO;
+
+ 0008a 83 c8 ff or eax, -1
+
+; 1995 : return UNZ_ERRNO;
+; 1996 :
+; 1997 : return (int)read_now;
+; 1998 : }
+
+ 0008d 5f pop edi
+ 0008e 5e pop esi
+ 0008f 8b e5 mov esp, ebp
+ 00091 5d pop ebp
+ 00092 c2 0c 00 ret 12 ; 0000000cH
+$LN8@unzGetLoca:
+
+; 1991 :
+; 1992 : if (ZREAD64(pfile_in_zip_read_info->z_filefunc,
+; 1993 : pfile_in_zip_read_info->filestream,
+; 1994 : buf,read_now)!=read_now)
+
+ 00095 8b 87 8c 00 00
+ 00 mov eax, DWORD PTR [edi+140]
+ 0009b 56 push esi
+ 0009c ff 75 0c push DWORD PTR _buf$[ebp]
+ 0009f ff b7 b4 00 00
+ 00 push DWORD PTR [edi+180]
+ 000a5 ff b7 a4 00 00
+ 00 push DWORD PTR [edi+164]
+ 000ab ff d0 call eax
+ 000ad 83 c9 ff or ecx, -1
+ 000b0 83 c4 10 add esp, 16 ; 00000010H
+ 000b3 3b c6 cmp eax, esi
+ 000b5 0f 45 f1 cmovne esi, ecx
+$LN12@unzGetLoca:
+
+; 1995 : return UNZ_ERRNO;
+; 1996 :
+; 1997 : return (int)read_now;
+; 1998 : }
+
+ 000b8 5f pop edi
+ 000b9 8b c6 mov eax, esi
+ 000bb 5e pop esi
+ 000bc 8b e5 mov esp, ebp
+ 000be 5d pop ebp
+ 000bf c2 0c 00 ret 12 ; 0000000cH
+_unzGetLocalExtrafield@12 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unzCloseCurrentFile@4
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_unzCloseCurrentFile@4 PROC ; COMDAT
+
+; 2005 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 53 push ebx
+
+; 2006 : int err=UNZ_OK;
+; 2007 :
+; 2008 : unz64_s* s;
+; 2009 : file_in_zip64_read_info_s* pfile_in_zip_read_info;
+; 2010 : if (file==NULL)
+
+ 00004 8b 5d 08 mov ebx, DWORD PTR _file$[ebp]
+ 00007 57 push edi
+ 00008 33 ff xor edi, edi
+ 0000a 85 db test ebx, ebx
+ 0000c 75 09 jne SHORT $LN2@unzCloseCu
+
+; 2011 : return UNZ_PARAMERROR;
+
+ 0000e 8d 47 9a lea eax, DWORD PTR [edi-102]
+ 00011 5f pop edi
+ 00012 5b pop ebx
+
+; 2043 : }
+
+ 00013 5d pop ebp
+ 00014 c2 04 00 ret 4
+$LN2@unzCloseCu:
+ 00017 56 push esi
+
+; 2012 : s=(unz64_s*)file;
+; 2013 : pfile_in_zip_read_info=s->pfile_in_zip_read;
+
+ 00018 8b b3 e0 00 00
+ 00 mov esi, DWORD PTR [ebx+224]
+
+; 2014 :
+; 2015 : if (pfile_in_zip_read_info==NULL)
+
+ 0001e 85 f6 test esi, esi
+ 00020 75 0a jne SHORT $LN3@unzCloseCu
+
+; 2016 : return UNZ_PARAMERROR;
+
+ 00022 8d 46 9a lea eax, DWORD PTR [esi-102]
+ 00025 5e pop esi
+ 00026 5f pop edi
+ 00027 5b pop ebx
+
+; 2043 : }
+
+ 00028 5d pop ebp
+ 00029 c2 04 00 ret 4
+$LN3@unzCloseCu:
+
+; 2017 :
+; 2018 :
+; 2019 : if ((pfile_in_zip_read_info->rest_read_uncompressed == 0) &&
+
+ 0002c 8b 86 80 00 00
+ 00 mov eax, DWORD PTR [esi+128]
+ 00032 0b 86 84 00 00
+ 00 or eax, DWORD PTR [esi+132]
+ 00038 75 16 jne SHORT $LN5@unzCloseCu
+ 0003a 39 be c8 00 00
+ 00 cmp DWORD PTR [esi+200], edi
+ 00040 75 0e jne SHORT $LN5@unzCloseCu
+
+; 2020 : (!pfile_in_zip_read_info->raw))
+; 2021 : {
+; 2022 : if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait)
+
+ 00042 8b 46 70 mov eax, DWORD PTR [esi+112]
+ 00045 b9 97 ff ff ff mov ecx, -105 ; ffffff97H
+ 0004a 3b 46 74 cmp eax, DWORD PTR [esi+116]
+ 0004d 0f 45 f9 cmovne edi, ecx
+$LN5@unzCloseCu:
+
+; 2023 : err=UNZ_CRCERROR;
+; 2024 : }
+; 2025 :
+; 2026 :
+; 2027 : TRYFREE(pfile_in_zip_read_info->read_buffer);
+
+ 00050 8b 06 mov eax, DWORD PTR [esi]
+ 00052 85 c0 test eax, eax
+ 00054 74 0a je SHORT $LN6@unzCloseCu
+ 00056 50 push eax
+ 00057 ff 15 00 00 00
+ 00 call DWORD PTR __imp__free
+ 0005d 83 c4 04 add esp, 4
+$LN6@unzCloseCu:
+
+; 2028 : pfile_in_zip_read_info->read_buffer = NULL;
+; 2029 : if (pfile_in_zip_read_info->stream_initialised == Z_DEFLATED)
+
+ 00060 83 7e 48 08 cmp DWORD PTR [esi+72], 8
+ 00064 c7 06 00 00 00
+ 00 mov DWORD PTR [esi], 0
+ 0006a 75 09 jne SHORT $LN7@unzCloseCu
+
+; 2030 : inflateEnd(&pfile_in_zip_read_info->stream);
+
+ 0006c 8d 4e 04 lea ecx, DWORD PTR [esi+4]
+ 0006f 51 push ecx
+ 00070 e8 00 00 00 00 call _inflateEnd@4
+$LN7@unzCloseCu:
+
+; 2031 : #ifdef HAVE_BZIP2
+; 2032 : else if (pfile_in_zip_read_info->stream_initialised == Z_BZIP2ED)
+; 2033 : BZ2_bzDecompressEnd(&pfile_in_zip_read_info->bstream);
+; 2034 : #endif
+; 2035 :
+; 2036 :
+; 2037 : pfile_in_zip_read_info->stream_initialised = 0;
+; 2038 : TRYFREE(pfile_in_zip_read_info);
+
+ 00075 56 push esi
+ 00076 c7 46 48 00 00
+ 00 00 mov DWORD PTR [esi+72], 0
+ 0007d ff 15 00 00 00
+ 00 call DWORD PTR __imp__free
+ 00083 83 c4 04 add esp, 4
+
+; 2039 :
+; 2040 : s->pfile_in_zip_read=NULL;
+
+ 00086 c7 83 e0 00 00
+ 00 00 00 00 00 mov DWORD PTR [ebx+224], 0
+
+; 2041 :
+; 2042 : return err;
+
+ 00090 8b c7 mov eax, edi
+ 00092 5e pop esi
+ 00093 5f pop edi
+ 00094 5b pop ebx
+
+; 2043 : }
+
+ 00095 5d pop ebp
+ 00096 c2 04 00 ret 4
+_unzCloseCurrentFile@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\unzip.c
+; COMDAT _unzGetGlobalComment@12
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_szComment$ = 12 ; size = 4
+_uSizeBuf$ = 16 ; size = 4
+_unzGetGlobalComment@12 PROC ; COMDAT
+
+; 2052 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 56 push esi
+
+; 2053 : unz64_s* s;
+; 2054 : uLong uReadThis ;
+; 2055 : if (file==NULL)
+
+ 00004 8b 75 08 mov esi, DWORD PTR _file$[ebp]
+ 00007 85 f6 test esi, esi
+ 00009 75 08 jne SHORT $LN2@unzGetGlob
+
+; 2056 : return (int)UNZ_PARAMERROR;
+
+ 0000b 8d 46 9a lea eax, DWORD PTR [esi-102]
+ 0000e 5e pop esi
+
+; 2076 : }
+
+ 0000f 5d pop ebp
+ 00010 c2 0c 00 ret 12 ; 0000000cH
+$LN2@unzGetGlob:
+
+; 2057 : s=(unz64_s*)file;
+; 2058 :
+; 2059 : uReadThis = uSizeBuf;
+
+ 00013 8b 4d 10 mov ecx, DWORD PTR _uSizeBuf$[ebp]
+
+; 2060 : if (uReadThis>s->gi.size_comment)
+
+ 00016 3b 4e 40 cmp ecx, DWORD PTR [esi+64]
+
+; 2061 : uReadThis = s->gi.size_comment;
+; 2062 :
+; 2063 : if (ZSEEK64(s->z_filefunc,s->filestream,s->central_pos+22,ZLIB_FILEFUNC_SEEK_SET)!=0)
+
+ 00019 8b 46 6c mov eax, DWORD PTR [esi+108]
+ 0001c 8b 56 30 mov edx, DWORD PTR [esi+48]
+ 0001f 53 push ebx
+ 00020 8b d9 mov ebx, ecx
+ 00022 8b 4e 68 mov ecx, DWORD PTR [esi+104]
+ 00025 0f 47 5e 40 cmova ebx, DWORD PTR [esi+64]
+ 00029 83 c1 16 add ecx, 22 ; 00000016H
+ 0002c 6a 00 push 0
+ 0002e 83 d0 00 adc eax, 0
+ 00031 50 push eax
+ 00032 51 push ecx
+ 00033 8b ce mov ecx, esi
+ 00035 e8 00 00 00 00 call _call_zseek64
+ 0003a 83 c4 0c add esp, 12 ; 0000000cH
+ 0003d 85 c0 test eax, eax
+ 0003f 74 09 je SHORT $LN4@unzGetGlob
+
+; 2064 : return UNZ_ERRNO;
+
+ 00041 5b pop ebx
+ 00042 83 c8 ff or eax, -1
+ 00045 5e pop esi
+
+; 2076 : }
+
+ 00046 5d pop ebp
+ 00047 c2 0c 00 ret 12 ; 0000000cH
+$LN4@unzGetGlob:
+ 0004a 57 push edi
+
+; 2065 :
+; 2066 : if (uReadThis>0)
+
+ 0004b 8b 7d 0c mov edi, DWORD PTR _szComment$[ebp]
+ 0004e 85 db test ebx, ebx
+ 00050 74 21 je SHORT $LN6@unzGetGlob
+
+; 2067 : {
+; 2068 : *szComment='\0';
+; 2069 : if (ZREAD64(s->z_filefunc,s->filestream,szComment,uReadThis)!=uReadThis)
+
+ 00052 53 push ebx
+ 00053 c6 07 00 mov BYTE PTR [edi], 0
+ 00056 8b 46 04 mov eax, DWORD PTR [esi+4]
+ 00059 57 push edi
+ 0005a ff 76 30 push DWORD PTR [esi+48]
+ 0005d ff 76 1c push DWORD PTR [esi+28]
+ 00060 ff d0 call eax
+ 00062 83 c4 10 add esp, 16 ; 00000010H
+ 00065 3b c3 cmp eax, ebx
+ 00067 74 0a je SHORT $LN6@unzGetGlob
+
+; 2070 : return UNZ_ERRNO;
+
+ 00069 5f pop edi
+ 0006a 5b pop ebx
+ 0006b 83 c8 ff or eax, -1
+ 0006e 5e pop esi
+
+; 2076 : }
+
+ 0006f 5d pop ebp
+ 00070 c2 0c 00 ret 12 ; 0000000cH
+$LN6@unzGetGlob:
+
+; 2071 : }
+; 2072 :
+; 2073 : if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment))
+
+ 00073 85 ff test edi, edi
+ 00075 74 0c je SHORT $LN7@unzGetGlob
+ 00077 8b 46 40 mov eax, DWORD PTR [esi+64]
+ 0007a 39 45 10 cmp DWORD PTR _uSizeBuf$[ebp], eax
+ 0007d 76 04 jbe SHORT $LN7@unzGetGlob
+
+; 2074 : *(szComment+s->gi.size_comment)='\0';
+
+ 0007f c6 04 38 00 mov BYTE PTR [eax+edi], 0
+$LN7@unzGetGlob:
+ 00083 5f pop edi
+
+; 2075 : return (int)uReadThis;
+
+ 00084 8b c3 mov eax, ebx
+ 00086 5b pop ebx
+ 00087 5e pop esi
+
+; 2076 : }
+
+ 00088 5d pop ebp
+ 00089 c2 0c 00 ret 12 ; 0000000cH
+_unzGetGlobalComment@12 ENDP
+_TEXT ENDS
+END
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/unzip.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/unzip.obj
new file mode 100644
index 0000000000..43f344f7af
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/unzip.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zip.cod b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zip.cod
new file mode 100644
index 0000000000..6e5780d7b4
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zip.cod
@@ -0,0 +1,7727 @@
+; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.23506.0
+
+ TITLE d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+ .686P
+ .XMM
+ include listing.inc
+ .model flat
+
+INCLUDELIB OLDNAMES
+
+PUBLIC ??_C@_01JOAMLHOP@?9?$AA@ ; `string'
+EXTRN __imp___time64:PROC
+EXTRN __imp__rand:PROC
+EXTRN __imp__srand:PROC
+?calls@?1??crypthead@@9@9 DD 01H DUP (?) ; `crypthead'::`2'::calls
+_BSS ENDS
+; COMDAT ??_C@_01JOAMLHOP@?9?$AA@
+CONST SEGMENT
+??_C@_01JOAMLHOP@?9?$AA@ DB '-', 00H ; `string'
+PUBLIC _zipClose@8
+PUBLIC _Write_GlobalComment
+PUBLIC _Write_EndOfCentralDirectoryRecord
+PUBLIC _Write_Zip64EndOfCentralDirectoryRecord
+PUBLIC _Write_Zip64EndOfCentralDirectoryLocator
+PUBLIC _zipCloseFileInZip@4
+PUBLIC _zipCloseFileInZipRaw64@16
+PUBLIC _zipCloseFileInZipRaw@12
+PUBLIC _zipWriteInFileInZip@12
+PUBLIC _zipOpenNewFileInZip@40
+PUBLIC _zipOpenNewFileInZip64@44
+PUBLIC _zipOpenNewFileInZip2_64@48
+PUBLIC _zipOpenNewFileInZip2@44
+PUBLIC _zipOpenNewFileInZip3_64@68
+PUBLIC _zipOpenNewFileInZip3@64
+PUBLIC _zipOpenNewFileInZip4_64@76
+PUBLIC _Write_LocalFileHeader
+PUBLIC _zipOpen64@8
+PUBLIC _zipOpen@8
+PUBLIC _zipOpen2_64@16
+PUBLIC _zipOpen2@16
+PUBLIC _zipOpen3@16
+PUBLIC _LoadCentralDirectoryRecord
+; Function compile flags: /Ogtp
+; File c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\time.h
+; COMDAT _time
+_TEXT SEGMENT
+_time PROC ; COMDAT
+; __Time$dead$ = ecx
+
+; 535 : return _time64(_Time);
+
+ 00000 6a 00 push 0
+ 00002 ff 15 00 00 00
+ 00 call DWORD PTR __imp___time64
+ 00008 83 c4 04 add esp, 4
+
+; 536 : }
+
+ 0000b c3 ret 0
+_time ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\crypt.h
+; COMDAT _decrypt_byte
+_TEXT SEGMENT
+_decrypt_byte PROC ; COMDAT
+; _pkeys$ = ecx
+; _pcrc_32_tab$dead$ = edx
+
+; 37 : unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
+; 38 : * unpredictable manner on 16-bit systems; not a problem
+; 39 : * with any known compiler so far, though */
+; 40 :
+; 41 : temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2;
+
+ 00000 8b 49 08 mov ecx, DWORD PTR [ecx+8]
+ 00003 81 e1 fd ff 00
+ 00 and ecx, 65533 ; 0000fffdH
+ 00009 83 c9 02 or ecx, 2
+
+; 42 : return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
+
+ 0000c 8b c1 mov eax, ecx
+ 0000e 83 f0 01 xor eax, 1
+ 00011 0f af c1 imul eax, ecx
+ 00014 c1 e8 08 shr eax, 8
+ 00017 0f b6 c0 movzx eax, al
+
+; 43 : }
+
+ 0001a c3 ret 0
+_decrypt_byte ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\crypt.h
+; COMDAT _update_keys
+_TEXT SEGMENT
+_pkeys$1$ = -4 ; size = 4
+_c$ = 8 ; size = 4
+_update_keys PROC ; COMDAT
+; _pkeys$ = ecx
+; _pcrc_32_tab$ = edx
+
+; 49 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 51 push ecx
+ 00004 53 push ebx
+ 00005 56 push esi
+
+; 50 : (*(pkeys+0)) = CRC32((*(pkeys+0)), c);
+
+ 00006 8b 31 mov esi, DWORD PTR [ecx]
+ 00008 8b da mov ebx, edx
+
+; 51 : (*(pkeys+1)) += (*(pkeys+0)) & 0xff;
+; 52 : (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1;
+; 53 : {
+; 54 : register int keyshift = (int)((*(pkeys+1)) >> 24);
+; 55 : (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift);
+
+ 0000a 8b 51 08 mov edx, DWORD PTR [ecx+8]
+ 0000d 8b c6 mov eax, esi
+ 0000f 33 45 08 xor eax, DWORD PTR _c$[ebp]
+ 00012 0f b6 c0 movzx eax, al
+ 00015 c1 ee 08 shr esi, 8
+ 00018 89 4d fc mov DWORD PTR _pkeys$1$[ebp], ecx
+ 0001b 8b 04 83 mov eax, DWORD PTR [ebx+eax*4]
+ 0001e 33 c6 xor eax, esi
+ 00020 89 01 mov DWORD PTR [ecx], eax
+ 00022 0f b6 c0 movzx eax, al
+ 00025 03 41 04 add eax, DWORD PTR [ecx+4]
+ 00028 69 c0 05 84 08
+ 08 imul eax, eax, 134775813
+ 0002e 5e pop esi
+ 0002f 40 inc eax
+ 00030 89 41 04 mov DWORD PTR [ecx+4], eax
+ 00033 c1 e8 18 shr eax, 24 ; 00000018H
+ 00036 33 c2 xor eax, edx
+ 00038 c1 ea 08 shr edx, 8
+ 0003b 0f b6 c8 movzx ecx, al
+ 0003e 8b 45 fc mov eax, DWORD PTR _pkeys$1$[ebp]
+ 00041 33 14 8b xor edx, DWORD PTR [ebx+ecx*4]
+ 00044 89 50 08 mov DWORD PTR [eax+8], edx
+
+; 56 : }
+; 57 : return c;
+
+ 00047 8b 45 08 mov eax, DWORD PTR _c$[ebp]
+ 0004a 5b pop ebx
+
+; 58 : }
+
+ 0004b 8b e5 mov esp, ebp
+ 0004d 5d pop ebp
+ 0004e c3 ret 0
+_update_keys ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\crypt.h
+; COMDAT _init_keys
+_TEXT SEGMENT
+_pcrc_32_tab$ = 8 ; size = 4
+_init_keys PROC ; COMDAT
+; _passwd$ = ecx
+; _pkeys$ = edx
+
+; 66 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 56 push esi
+ 00004 57 push edi
+ 00005 8b fa mov edi, edx
+ 00007 8b f1 mov esi, ecx
+
+; 67 : *(pkeys+0) = 305419896L;
+
+ 00009 c7 07 78 56 34
+ 12 mov DWORD PTR [edi], 305419896 ; 12345678H
+
+; 68 : *(pkeys+1) = 591751049L;
+
+ 0000f c7 47 04 89 67
+ 45 23 mov DWORD PTR [edi+4], 591751049 ; 23456789H
+
+; 69 : *(pkeys+2) = 878082192L;
+
+ 00016 c7 47 08 90 78
+ 56 34 mov DWORD PTR [edi+8], 878082192 ; 34567890H
+
+; 70 : while (*passwd != '\0') {
+
+ 0001d 8a 06 mov al, BYTE PTR [esi]
+ 0001f 84 c0 test al, al
+ 00021 74 1f je SHORT $LN3@init_keys
+ 00023 53 push ebx
+ 00024 8b 5d 08 mov ebx, DWORD PTR _pcrc_32_tab$[ebp]
+$LL2@init_keys:
+
+; 71 : update_keys(pkeys,pcrc_32_tab,(int)*passwd);
+
+ 00027 0f be c0 movsx eax, al
+ 0002a 8b d3 mov edx, ebx
+ 0002c 50 push eax
+ 0002d 8b cf mov ecx, edi
+ 0002f e8 00 00 00 00 call _update_keys
+ 00034 8a 46 01 mov al, BYTE PTR [esi+1]
+
+; 72 : passwd++;
+
+ 00037 8d 76 01 lea esi, DWORD PTR [esi+1]
+ 0003a 83 c4 04 add esp, 4
+ 0003d 84 c0 test al, al
+ 0003f 75 e6 jne SHORT $LL2@init_keys
+ 00041 5b pop ebx
+$LN3@init_keys:
+ 00042 5f pop edi
+ 00043 5e pop esi
+
+; 73 : }
+; 74 : }
+
+ 00044 5d pop ebp
+ 00045 c3 ret 0
+_init_keys ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\crypt.h
+; File c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\time.h
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\crypt.h
+; COMDAT _crypthead
+_TEXT SEGMENT
+_header$ = -28 ; size = 10
+tv254 = -16 ; size = 4
+_t$3$ = -16 ; size = 4
+_passwd$1$ = -16 ; size = 4
+_c$1$ = -12 ; size = 4
+_buf$1$ = -8 ; size = 4
+tv247 = -1 ; size = 1
+_bufSize$dead$ = 8 ; size = 4
+_pkeys$ = 12 ; size = 4
+_pcrc_32_tab$ = 16 ; size = 4
+_crcForCrypting$ = 20 ; size = 4
+_crypthead PROC ; COMDAT
+; _passwd$ = ecx
+; _buf$ = edx
+
+; 96 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 1c sub esp, 28 ; 0000001cH
+
+; 97 : int n; /* index in random header */
+; 98 : int t; /* temporary */
+; 99 : int c; /* random byte */
+; 100 : unsigned char header[RAND_HEAD_LEN-2]; /* random header */
+; 101 : static unsigned calls = 0; /* ensure different random header each time */
+; 102 :
+; 103 : if (bufSize<RAND_HEAD_LEN)
+; 104 : return 0;
+; 105 :
+; 106 : /* First generate RAND_HEAD_LEN-2 random bytes. We encrypt the
+; 107 : * output of rand() to get less predictability, since rand() is
+; 108 : * often poorly implemented.
+; 109 : */
+; 110 : if (++calls == 1)
+
+ 00006 a1 00 00 00 00 mov eax, DWORD PTR ?calls@?1??crypthead@@9@9
+ 0000b 53 push ebx
+ 0000c 40 inc eax
+ 0000d 89 55 f8 mov DWORD PTR _buf$1$[ebp], edx
+ 00010 a3 00 00 00 00 mov DWORD PTR ?calls@?1??crypthead@@9@9, eax
+ 00015 8b d9 mov ebx, ecx
+ 00017 89 5d f0 mov DWORD PTR _passwd$1$[ebp], ebx
+ 0001a 56 push esi
+ 0001b 57 push edi
+ 0001c 83 f8 01 cmp eax, 1
+ 0001f 75 17 jne SHORT $LN9@crypthead
+; File c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\time.h
+
+; 535 : return _time64(_Time);
+
+ 00021 6a 00 push 0
+ 00023 ff 15 00 00 00
+ 00 call DWORD PTR __imp___time64
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\crypt.h
+
+; 112 : srand((unsigned)(time(NULL) ^ ZCR_SEED2));
+
+ 00029 35 4e e6 40 bb xor eax, -1153374642 ; bb40e64eH
+ 0002e 50 push eax
+ 0002f ff 15 00 00 00
+ 00 call DWORD PTR __imp__srand
+ 00035 83 c4 08 add esp, 8
+$LN9@crypthead:
+
+; 113 : }
+; 114 : init_keys(passwd, pkeys, pcrc_32_tab);
+
+ 00038 ff 75 10 push DWORD PTR _pcrc_32_tab$[ebp]
+ 0003b 8b 7d 0c mov edi, DWORD PTR _pkeys$[ebp]
+ 0003e 8b cb mov ecx, ebx
+ 00040 8b d7 mov edx, edi
+ 00042 e8 00 00 00 00 call _init_keys
+ 00047 83 c4 04 add esp, 4
+
+; 115 : for (n = 0; n < RAND_HEAD_LEN-2; n++)
+
+ 0004a 33 f6 xor esi, esi
+ 0004c 0f 1f 40 00 npad 4
+$LL4@crypthead:
+
+; 116 : {
+; 117 : c = (rand() >> 7) & 0xff;
+
+ 00050 ff 15 00 00 00
+ 00 call DWORD PTR __imp__rand
+ 00056 c1 f8 07 sar eax, 7
+
+; 118 : header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t);
+
+ 00059 8b cf mov ecx, edi
+ 0005b 0f b6 d0 movzx edx, al
+ 0005e 89 55 f4 mov DWORD PTR _c$1$[ebp], edx
+ 00061 e8 00 00 00 00 call _decrypt_byte
+ 00066 52 push edx
+ 00067 8b 55 10 mov edx, DWORD PTR _pcrc_32_tab$[ebp]
+ 0006a 8b cf mov ecx, edi
+ 0006c 8b d8 mov ebx, eax
+ 0006e e8 00 00 00 00 call _update_keys
+ 00073 8b 45 f4 mov eax, DWORD PTR _c$1$[ebp]
+ 00076 83 c4 04 add esp, 4
+ 00079 32 c3 xor al, bl
+ 0007b 88 44 35 e4 mov BYTE PTR _header$[ebp+esi], al
+ 0007f 46 inc esi
+ 00080 83 fe 0a cmp esi, 10 ; 0000000aH
+ 00083 7c cb jl SHORT $LL4@crypthead
+
+; 119 : }
+; 120 : /* Encrypt random header (last two bytes is high word of crc) */
+; 121 : init_keys(passwd, pkeys, pcrc_32_tab);
+
+ 00085 ff 75 10 push DWORD PTR _pcrc_32_tab$[ebp]
+ 00088 8b 4d f0 mov ecx, DWORD PTR _passwd$1$[ebp]
+ 0008b 8b d7 mov edx, edi
+ 0008d e8 00 00 00 00 call _init_keys
+
+; 122 : for (n = 0; n < RAND_HEAD_LEN-2; n++)
+
+ 00092 8b 45 f8 mov eax, DWORD PTR _buf$1$[ebp]
+ 00095 8d 4d e4 lea ecx, DWORD PTR _header$[ebp]
+ 00098 83 c4 04 add esp, 4
+ 0009b 33 f6 xor esi, esi
+ 0009d 2b c1 sub eax, ecx
+ 0009f 89 45 f0 mov DWORD PTR tv254[ebp], eax
+$LL7@crypthead:
+
+; 123 : {
+; 124 : buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t);
+
+ 000a2 8b cf mov ecx, edi
+ 000a4 e8 00 00 00 00 call _decrypt_byte
+ 000a9 0f b6 4c 35 e4 movzx ecx, BYTE PTR _header$[ebp+esi]
+ 000ae 8b d8 mov ebx, eax
+ 000b0 8b 55 10 mov edx, DWORD PTR _pcrc_32_tab$[ebp]
+ 000b3 51 push ecx
+ 000b4 8b cf mov ecx, edi
+ 000b6 e8 00 00 00 00 call _update_keys
+ 000bb 8b 45 f0 mov eax, DWORD PTR tv254[ebp]
+ 000be 83 c4 04 add esp, 4
+ 000c1 8a 4c 35 e4 mov cl, BYTE PTR _header$[ebp+esi]
+ 000c5 03 c6 add eax, esi
+ 000c7 32 cb xor cl, bl
+ 000c9 46 inc esi
+ 000ca 88 4c 05 e4 mov BYTE PTR _header$[ebp+eax], cl
+ 000ce 83 fe 0a cmp esi, 10 ; 0000000aH
+ 000d1 7c cf jl SHORT $LL7@crypthead
+
+; 125 : }
+; 126 : buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t);
+
+ 000d3 8b cf mov ecx, edi
+ 000d5 e8 00 00 00 00 call _decrypt_byte
+ 000da 8b 7d 14 mov edi, DWORD PTR _crcForCrypting$[ebp]
+ 000dd 8b df mov ebx, edi
+ 000df 8b 55 10 mov edx, DWORD PTR _pcrc_32_tab$[ebp]
+ 000e2 c1 eb 10 shr ebx, 16 ; 00000010H
+ 000e5 0f b6 cb movzx ecx, bl
+ 000e8 51 push ecx
+ 000e9 8b 4d 0c mov ecx, DWORD PTR _pkeys$[ebp]
+ 000ec 89 45 f0 mov DWORD PTR _t$3$[ebp], eax
+ 000ef e8 00 00 00 00 call _update_keys
+ 000f4 8b 45 f8 mov eax, DWORD PTR _buf$1$[ebp]
+ 000f7 32 5d f0 xor bl, BYTE PTR _t$3$[ebp]
+
+; 127 : buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t);
+
+ 000fa 8b 4d 0c mov ecx, DWORD PTR _pkeys$[ebp]
+ 000fd 88 1c 06 mov BYTE PTR [esi+eax], bl
+ 00100 e8 00 00 00 00 call _decrypt_byte
+ 00105 8b 55 10 mov edx, DWORD PTR _pcrc_32_tab$[ebp]
+ 00108 8b d8 mov ebx, eax
+ 0010a 8b 4d 0c mov ecx, DWORD PTR _pkeys$[ebp]
+ 0010d c1 ef 18 shr edi, 24 ; 00000018H
+ 00110 57 push edi
+ 00111 e8 00 00 00 00 call _update_keys
+ 00116 8b 4d f8 mov ecx, DWORD PTR _buf$1$[ebp]
+ 00119 83 c4 08 add esp, 8
+ 0011c 8b c7 mov eax, edi
+ 0011e 32 c3 xor al, bl
+ 00120 88 44 0e 01 mov BYTE PTR [esi+ecx+1], al
+ 00124 8d 46 02 lea eax, DWORD PTR [esi+2]
+ 00127 5f pop edi
+ 00128 5e pop esi
+ 00129 5b pop ebx
+
+; 128 : return n;
+; 129 : }
+
+ 0012a 8b e5 mov esp, ebp
+ 0012c 5d pop ebp
+ 0012d c3 ret 0
+_crypthead ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _allocate_new_datablock
+_TEXT SEGMENT
+_allocate_new_datablock PROC ; COMDAT
+
+; 191 : linkedlist_datablock_internal* ldi;
+; 192 : ldi = (linkedlist_datablock_internal*)
+
+ 00000 68 00 10 00 00 push 4096 ; 00001000H
+ 00005 ff 15 00 00 00
+ 00 call DWORD PTR __imp__malloc
+ 0000b 83 c4 04 add esp, 4
+
+; 193 : ALLOC(sizeof(linkedlist_datablock_internal));
+; 194 : if (ldi!=NULL)
+
+ 0000e 85 c0 test eax, eax
+ 00010 74 14 je SHORT $LN2@allocate_n
+
+; 195 : {
+; 196 : ldi->next_datablock = NULL ;
+
+ 00012 c7 00 00 00 00
+ 00 mov DWORD PTR [eax], 0
+
+; 197 : ldi->filled_in_this_block = 0 ;
+
+ 00018 c7 40 08 00 00
+ 00 00 mov DWORD PTR [eax+8], 0
+
+; 198 : ldi->avail_in_this_block = SIZEDATA_INDATABLOCK ;
+
+ 0001f c7 40 04 f0 0f
+ 00 00 mov DWORD PTR [eax+4], 4080 ; 00000ff0H
+$LN2@allocate_n:
+
+; 199 : }
+; 200 : return ldi;
+; 201 : }
+
+ 00026 c3 ret 0
+_allocate_new_datablock ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _free_datablock
+_TEXT SEGMENT
+_free_datablock PROC ; COMDAT
+; _ldi$ = ecx
+
+; 205 : while (ldi!=NULL)
+
+ 00000 85 c9 test ecx, ecx
+ 00002 74 1c je SHORT $LN3@free_datab
+ 00004 56 push esi
+ 00005 57 push edi
+ 00006 8b 3d 00 00 00
+ 00 mov edi, DWORD PTR __imp__free
+ 0000c 0f 1f 40 00 npad 4
+$LL2@free_datab:
+
+; 206 : {
+; 207 : linkedlist_datablock_internal* ldinext = ldi->next_datablock;
+
+ 00010 8b 31 mov esi, DWORD PTR [ecx]
+
+; 208 : TRYFREE(ldi);
+
+ 00012 51 push ecx
+ 00013 ff d7 call edi
+ 00015 83 c4 04 add esp, 4
+
+; 209 : ldi = ldinext;
+
+ 00018 8b ce mov ecx, esi
+ 0001a 85 f6 test esi, esi
+ 0001c 75 f2 jne SHORT $LL2@free_datab
+ 0001e 5f pop edi
+ 0001f 5e pop esi
+$LN3@free_datab:
+
+; 210 : }
+; 211 : }
+
+ 00020 c3 ret 0
+_free_datablock ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _init_linkedlist
+_TEXT SEGMENT
+_init_linkedlist PROC ; COMDAT
+; _ll$ = ecx
+
+; 215 : ll->first_block = ll->last_block = NULL;
+
+ 00000 c7 41 04 00 00
+ 00 00 mov DWORD PTR [ecx+4], 0
+ 00007 c7 01 00 00 00
+ 00 mov DWORD PTR [ecx], 0
+
+; 216 : }
+
+ 0000d c3 ret 0
+_init_linkedlist ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _free_linkedlist
+_TEXT SEGMENT
+_free_linkedlist PROC ; COMDAT
+; _ll$ = ecx
+
+; 219 : {
+
+ 00000 56 push esi
+ 00001 8b f1 mov esi, ecx
+
+; 220 : free_datablock(ll->first_block);
+
+ 00003 8b 0e mov ecx, DWORD PTR [esi]
+ 00005 e8 00 00 00 00 call _free_datablock
+
+; 221 : ll->first_block = ll->last_block = NULL;
+
+ 0000a c7 46 04 00 00
+ 00 00 mov DWORD PTR [esi+4], 0
+ 00011 c7 06 00 00 00
+ 00 mov DWORD PTR [esi], 0
+ 00017 5e pop esi
+
+; 222 : }
+
+ 00018 c3 ret 0
+_free_linkedlist ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _add_data_in_datablock
+_TEXT SEGMENT
+_ll$1$ = -8 ; size = 4
+_from_copy$1$ = -4 ; size = 4
+_len$ = 8 ; size = 4
+_add_data_in_datablock PROC ; COMDAT
+; _ll$ = ecx
+; _buf$ = edx
+
+; 226 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 08 sub esp, 8
+ 00006 57 push edi
+ 00007 8b f9 mov edi, ecx
+ 00009 89 55 fc mov DWORD PTR _from_copy$1$[ebp], edx
+ 0000c 89 7d f8 mov DWORD PTR _ll$1$[ebp], edi
+
+; 227 : linkedlist_datablock_internal* ldi;
+; 228 : const unsigned char* from_copy;
+; 229 :
+; 230 : if (ll==NULL)
+
+ 0000f 85 ff test edi, edi
+ 00011 75 0a jne SHORT $LN7@add_data_i
+$LN29@add_data_i:
+
+; 231 : return ZIP_INTERNALERROR;
+
+ 00013 b8 98 ff ff ff mov eax, -104 ; ffffff98H
+ 00018 5f pop edi
+
+; 274 : }
+
+ 00019 8b e5 mov esp, ebp
+ 0001b 5d pop ebp
+ 0001c c3 ret 0
+$LN7@add_data_i:
+
+; 232 :
+; 233 : if (ll->last_block == NULL)
+
+ 0001d 83 7f 04 00 cmp DWORD PTR [edi+4], 0
+ 00021 75 0e jne SHORT $LN9@add_data_i
+
+; 234 : {
+; 235 : ll->first_block = ll->last_block = allocate_new_datablock();
+
+ 00023 e8 00 00 00 00 call _allocate_new_datablock
+ 00028 89 47 04 mov DWORD PTR [edi+4], eax
+ 0002b 89 07 mov DWORD PTR [edi], eax
+
+; 236 : if (ll->first_block == NULL)
+
+ 0002d 85 c0 test eax, eax
+ 0002f 74 e2 je SHORT $LN29@add_data_i
+$LN9@add_data_i:
+ 00031 53 push ebx
+
+; 237 : return ZIP_INTERNALERROR;
+; 238 : }
+; 239 :
+; 240 : ldi = ll->last_block;
+; 241 : from_copy = (unsigned char*)buf;
+; 242 :
+; 243 : while (len>0)
+
+ 00032 8b 5d 08 mov ebx, DWORD PTR _len$[ebp]
+ 00035 56 push esi
+ 00036 8b 77 04 mov esi, DWORD PTR [edi+4]
+ 00039 85 db test ebx, ebx
+ 0003b 74 59 je SHORT $LN26@add_data_i
+ 0003d 0f 1f 00 npad 3
+$LL2@add_data_i:
+
+; 244 : {
+; 245 : uInt copy_this;
+; 246 : uInt i;
+; 247 : unsigned char* to_copy;
+; 248 :
+; 249 : if (ldi->avail_in_this_block==0)
+
+ 00040 83 7e 04 00 cmp DWORD PTR [esi+4], 0
+ 00044 75 10 jne SHORT $LN10@add_data_i
+
+; 250 : {
+; 251 : ldi->next_datablock = allocate_new_datablock();
+
+ 00046 e8 00 00 00 00 call _allocate_new_datablock
+ 0004b 89 06 mov DWORD PTR [esi], eax
+
+; 252 : if (ldi->next_datablock == NULL)
+
+ 0004d 85 c0 test eax, eax
+ 0004f 74 4e je SHORT $LN17@add_data_i
+
+; 254 : ldi = ldi->next_datablock ;
+
+ 00051 8b f0 mov esi, eax
+
+; 255 : ll->last_block = ldi;
+
+ 00053 89 77 04 mov DWORD PTR [edi+4], esi
+$LN10@add_data_i:
+
+; 256 : }
+; 257 :
+; 258 : if (ldi->avail_in_this_block < len)
+
+ 00056 39 5e 04 cmp DWORD PTR [esi+4], ebx
+ 00059 8b d3 mov edx, ebx
+
+; 259 : copy_this = (uInt)ldi->avail_in_this_block;
+; 260 : else
+; 261 : copy_this = (uInt)len;
+; 262 :
+; 263 : to_copy = &(ldi->data[ldi->filled_in_this_block]);
+
+ 0005b 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 0005e 0f 42 56 04 cmovb edx, DWORD PTR [esi+4]
+ 00062 83 c0 10 add eax, 16 ; 00000010H
+ 00065 03 c6 add eax, esi
+
+; 264 :
+; 265 : for (i=0;i<copy_this;i++)
+
+ 00067 85 d2 test edx, edx
+ 00069 74 1b je SHORT $LN5@add_data_i
+ 0006b 8b 5d fc mov ebx, DWORD PTR _from_copy$1$[ebp]
+ 0006e 8b fa mov edi, edx
+ 00070 2b d8 sub ebx, eax
+$LL20@add_data_i:
+
+; 266 : *(to_copy+i)=*(from_copy+i);
+
+ 00072 8a 0c 03 mov cl, BYTE PTR [ebx+eax]
+ 00075 8d 40 01 lea eax, DWORD PTR [eax+1]
+ 00078 88 48 ff mov BYTE PTR [eax-1], cl
+ 0007b 83 ef 01 sub edi, 1
+ 0007e 75 f2 jne SHORT $LL20@add_data_i
+ 00080 8b 5d 08 mov ebx, DWORD PTR _len$[ebp]
+ 00083 8b 7d f8 mov edi, DWORD PTR _ll$1$[ebp]
+$LN5@add_data_i:
+
+; 267 :
+; 268 : ldi->filled_in_this_block += copy_this;
+
+ 00086 01 56 08 add DWORD PTR [esi+8], edx
+
+; 269 : ldi->avail_in_this_block -= copy_this;
+
+ 00089 29 56 04 sub DWORD PTR [esi+4], edx
+
+; 270 : from_copy += copy_this ;
+
+ 0008c 01 55 fc add DWORD PTR _from_copy$1$[ebp], edx
+
+; 271 : len -= copy_this;
+
+ 0008f 2b da sub ebx, edx
+ 00091 89 5d 08 mov DWORD PTR _len$[ebp], ebx
+ 00094 75 aa jne SHORT $LL2@add_data_i
+$LN26@add_data_i:
+ 00096 5e pop esi
+ 00097 5b pop ebx
+
+; 272 : }
+; 273 : return ZIP_OK;
+
+ 00098 33 c0 xor eax, eax
+ 0009a 5f pop edi
+
+; 274 : }
+
+ 0009b 8b e5 mov esp, ebp
+ 0009d 5d pop ebp
+ 0009e c3 ret 0
+$LN17@add_data_i:
+ 0009f 5e pop esi
+ 000a0 5b pop ebx
+
+; 253 : return ZIP_INTERNALERROR;
+
+ 000a1 b8 98 ff ff ff mov eax, -104 ; ffffff98H
+ 000a6 5f pop edi
+
+; 274 : }
+
+ 000a7 8b e5 mov esp, ebp
+ 000a9 5d pop ebp
+ 000aa c3 ret 0
+_add_data_in_datablock ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _zip64local_putValue
+_TEXT SEGMENT
+_filestream$1$ = -8 ; size = 4
+_pzlib_filefunc_def$1$ = -4 ; size = 4
+_buf$ = 8 ; size = 8
+_x$ = 8 ; size = 8
+_nbByte$ = 16 ; size = 4
+_zip64local_putValue PROC ; COMDAT
+; _pzlib_filefunc_def$ = ecx
+; _filestream$ = edx
+
+; 288 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 08 sub esp, 8
+
+; 289 : unsigned char buf[8];
+; 290 : int n;
+; 291 : for (n = 0; n < nbByte; n++)
+
+ 00006 8b 45 0c mov eax, DWORD PTR _x$[ebp+4]
+ 00009 53 push ebx
+ 0000a 8b 5d 10 mov ebx, DWORD PTR _nbByte$[ebp]
+ 0000d 56 push esi
+ 0000e 89 55 f8 mov DWORD PTR _filestream$1$[ebp], edx
+ 00011 33 f6 xor esi, esi
+ 00013 8b d1 mov edx, ecx
+ 00015 8b 4d 08 mov ecx, DWORD PTR _x$[ebp]
+ 00018 89 55 fc mov DWORD PTR _pzlib_filefunc_def$1$[ebp], edx
+ 0001b 85 db test ebx, ebx
+ 0001d 7e 11 jle SHORT $LN3@zip64local
+ 0001f 90 npad 1
+$LL16@zip64local:
+
+; 292 : {
+; 293 : buf[n] = (unsigned char)(x & 0xff);
+
+ 00020 88 4c 35 08 mov BYTE PTR _buf$[ebp+esi], cl
+ 00024 46 inc esi
+
+; 294 : x >>= 8;
+
+ 00025 0f ac c1 08 shrd ecx, eax, 8
+ 00029 c1 e8 08 shr eax, 8
+ 0002c 3b f3 cmp esi, ebx
+ 0002e 7c f0 jl SHORT $LL16@zip64local
+$LN3@zip64local:
+
+; 295 : }
+; 296 : if (x != 0)
+
+ 00030 0b c8 or ecx, eax
+ 00032 74 1f je SHORT $LN6@zip64local
+
+; 297 : { /* data overflow - hack for ZIP64 (X Roche) */
+; 298 : for (n = 0; n < nbByte; n++)
+
+ 00034 85 db test ebx, ebx
+ 00036 7e 1b jle SHORT $LN6@zip64local
+
+; 299 : {
+; 300 : buf[n] = 0xff;
+
+ 00038 57 push edi
+ 00039 8b cb mov ecx, ebx
+ 0003b 8d 7d 08 lea edi, DWORD PTR _buf$[ebp]
+ 0003e 8b d1 mov edx, ecx
+ 00040 83 c8 ff or eax, -1
+ 00043 c1 e9 02 shr ecx, 2
+ 00046 f3 ab rep stosd
+ 00048 8b ca mov ecx, edx
+ 0004a 8b 55 fc mov edx, DWORD PTR _pzlib_filefunc_def$1$[ebp]
+ 0004d 83 e1 03 and ecx, 3
+ 00050 f3 aa rep stosb
+ 00052 5f pop edi
+$LN6@zip64local:
+
+; 301 : }
+; 302 : }
+; 303 :
+; 304 : if (ZWRITE64(*pzlib_filefunc_def,filestream,buf,nbByte)!=(uLong)nbByte)
+
+ 00053 53 push ebx
+ 00054 8d 45 08 lea eax, DWORD PTR _buf$[ebp]
+ 00057 50 push eax
+ 00058 ff 75 f8 push DWORD PTR _filestream$1$[ebp]
+ 0005b 8b 42 08 mov eax, DWORD PTR [edx+8]
+ 0005e ff 72 1c push DWORD PTR [edx+28]
+ 00061 ff d0 call eax
+ 00063 83 c4 10 add esp, 16 ; 00000010H
+ 00066 2b c3 sub eax, ebx
+ 00068 f7 d8 neg eax
+ 0006a 1b c0 sbb eax, eax
+ 0006c 5e pop esi
+ 0006d 5b pop ebx
+
+; 305 : return ZIP_ERRNO;
+; 306 : else
+; 307 : return ZIP_OK;
+; 308 : }
+
+ 0006e 8b e5 mov esp, ebp
+ 00070 5d pop ebp
+ 00071 c3 ret 0
+_zip64local_putValue ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _zip64local_putValue_inmemory
+_TEXT SEGMENT
+_x$ = 8 ; size = 8
+_zip64local_putValue_inmemory PROC ; COMDAT
+; _dest$ = ecx
+; _nbByte$ = edx
+
+; 312 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 313 : unsigned char* buf=(unsigned char*)dest;
+; 314 : int n;
+; 315 : for (n = 0; n < nbByte; n++) {
+
+ 00003 8b 45 0c mov eax, DWORD PTR _x$[ebp+4]
+ 00006 56 push esi
+ 00007 57 push edi
+ 00008 33 f6 xor esi, esi
+ 0000a 8b f9 mov edi, ecx
+ 0000c 8b 4d 08 mov ecx, DWORD PTR _x$[ebp]
+ 0000f 85 d2 test edx, edx
+ 00011 7e 0f jle SHORT $LN3@zip64local
+$LL14@zip64local:
+
+; 316 : buf[n] = (unsigned char)(x & 0xff);
+
+ 00013 88 0c 3e mov BYTE PTR [esi+edi], cl
+ 00016 46 inc esi
+
+; 317 : x >>= 8;
+
+ 00017 0f ac c1 08 shrd ecx, eax, 8
+ 0001b c1 e8 08 shr eax, 8
+ 0001e 3b f2 cmp esi, edx
+ 00020 7c f1 jl SHORT $LL14@zip64local
+$LN3@zip64local:
+
+; 318 : }
+; 319 :
+; 320 : if (x != 0)
+
+ 00022 0b c8 or ecx, eax
+ 00024 74 15 je SHORT $LN6@zip64local
+
+; 321 : { /* data overflow - hack for ZIP64 */
+; 322 : for (n = 0; n < nbByte; n++)
+
+ 00026 85 d2 test edx, edx
+ 00028 7e 11 jle SHORT $LN6@zip64local
+
+; 323 : {
+; 324 : buf[n] = 0xff;
+
+ 0002a 8b ca mov ecx, edx
+ 0002c 83 c8 ff or eax, -1
+ 0002f c1 e9 02 shr ecx, 2
+ 00032 f3 ab rep stosd
+ 00034 8b ca mov ecx, edx
+ 00036 83 e1 03 and ecx, 3
+ 00039 f3 aa rep stosb
+$LN6@zip64local:
+ 0003b 5f pop edi
+ 0003c 5e pop esi
+
+; 325 : }
+; 326 : }
+; 327 : }
+
+ 0003d 5d pop ebp
+ 0003e c3 ret 0
+_zip64local_putValue_inmemory ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _zip64local_TmzDateToDosDate
+_TEXT SEGMENT
+_zip64local_TmzDateToDosDate PROC ; COMDAT
+; _ptm$ = ecx
+
+; 333 : {
+
+ 00000 56 push esi
+ 00001 8b f1 mov esi, ecx
+
+; 334 : uLong year = (uLong)ptm->tm_year;
+
+ 00003 8b 56 14 mov edx, DWORD PTR [esi+20]
+
+; 335 : if (year>=1980)
+
+ 00006 81 fa bc 07 00
+ 00 cmp edx, 1980 ; 000007bcH
+ 0000c 72 08 jb SHORT $LN2@zip64local
+
+; 336 : year-=1980;
+
+ 0000e 81 ea bc 07 00
+ 00 sub edx, 1980 ; 000007bcH
+ 00014 eb 08 jmp SHORT $LN4@zip64local
+$LN2@zip64local:
+
+; 337 : else if (year>=80)
+
+ 00016 83 fa 50 cmp edx, 80 ; 00000050H
+ 00019 72 03 jb SHORT $LN4@zip64local
+
+; 338 : year-=80;
+
+ 0001b 83 ea 50 sub edx, 80 ; 00000050H
+$LN4@zip64local:
+
+; 339 : return
+
+ 0001e 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 00021 8b 0e mov ecx, DWORD PTR [esi]
+ 00023 c1 e0 06 shl eax, 6
+ 00026 03 46 04 add eax, DWORD PTR [esi+4]
+ 00029 d1 e9 shr ecx, 1
+ 0002b c1 e0 05 shl eax, 5
+ 0002e 03 c1 add eax, ecx
+ 00030 c1 e2 04 shl edx, 4
+ 00033 8b 4e 10 mov ecx, DWORD PTR [esi+16]
+ 00036 41 inc ecx
+ 00037 03 ca add ecx, edx
+ 00039 c1 e1 05 shl ecx, 5
+ 0003c 03 4e 0c add ecx, DWORD PTR [esi+12]
+ 0003f c1 e1 10 shl ecx, 16 ; 00000010H
+ 00042 0b c1 or eax, ecx
+ 00044 5e pop esi
+
+; 340 : (uLong) (((ptm->tm_mday) + (32 * (ptm->tm_mon+1)) + (512 * year)) << 16) |
+; 341 : ((ptm->tm_sec/2) + (32* ptm->tm_min) + (2048 * (uLong)ptm->tm_hour));
+; 342 : }
+
+ 00045 c3 ret 0
+_zip64local_TmzDateToDosDate ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _zip64local_getByte
+_TEXT SEGMENT
+_c$ = -1 ; size = 1
+_pi$ = 8 ; size = 4
+_zip64local_getByte PROC ; COMDAT
+; _pzlib_filefunc_def$ = ecx
+; _filestream$ = edx
+
+; 350 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 51 push ecx
+ 00004 56 push esi
+ 00005 57 push edi
+
+; 351 : unsigned char c;
+; 352 : int err = (int)ZREAD64(*pzlib_filefunc_def,filestream,&c,1);
+
+ 00006 6a 01 push 1
+ 00008 8b f1 mov esi, ecx
+ 0000a 8d 45 ff lea eax, DWORD PTR _c$[ebp]
+ 0000d 50 push eax
+ 0000e 8b fa mov edi, edx
+ 00010 57 push edi
+ 00011 ff 76 1c push DWORD PTR [esi+28]
+ 00014 8b 46 04 mov eax, DWORD PTR [esi+4]
+ 00017 ff d0 call eax
+ 00019 83 c4 10 add esp, 16 ; 00000010H
+
+; 353 : if (err==1)
+
+ 0001c 83 f8 01 cmp eax, 1
+ 0001f 75 11 jne SHORT $LN2@zip64local
+
+; 354 : {
+; 355 : *pi = (int)c;
+
+ 00021 8b 45 08 mov eax, DWORD PTR _pi$[ebp]
+ 00024 0f b6 4d ff movzx ecx, BYTE PTR _c$[ebp]
+ 00028 5f pop edi
+ 00029 5e pop esi
+ 0002a 89 08 mov DWORD PTR [eax], ecx
+
+; 356 : return ZIP_OK;
+
+ 0002c 33 c0 xor eax, eax
+
+; 361 : return ZIP_ERRNO;
+; 362 : else
+; 363 : return ZIP_EOF;
+; 364 : }
+; 365 : }
+
+ 0002e 8b e5 mov esp, ebp
+ 00030 5d pop ebp
+ 00031 c3 ret 0
+$LN2@zip64local:
+
+; 357 : }
+; 358 : else
+; 359 : {
+; 360 : if (ZERROR64(*pzlib_filefunc_def,filestream))
+
+ 00032 8b 46 18 mov eax, DWORD PTR [esi+24]
+ 00035 57 push edi
+ 00036 ff 76 1c push DWORD PTR [esi+28]
+ 00039 ff d0 call eax
+ 0003b 83 c4 08 add esp, 8
+ 0003e f7 d8 neg eax
+ 00040 1b c0 sbb eax, eax
+ 00042 5f pop edi
+ 00043 5e pop esi
+
+; 361 : return ZIP_ERRNO;
+; 362 : else
+; 363 : return ZIP_EOF;
+; 364 : }
+; 365 : }
+
+ 00044 8b e5 mov esp, ebp
+ 00046 5d pop ebp
+ 00047 c3 ret 0
+_zip64local_getByte ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _zip64local_getShort
+_TEXT SEGMENT
+_i$ = -4 ; size = 4
+_pX$ = 8 ; size = 4
+_zip64local_getShort PROC ; COMDAT
+; _pzlib_filefunc_def$ = ecx
+; _filestream$ = edx
+
+; 374 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 51 push ecx
+ 00004 53 push ebx
+ 00005 56 push esi
+ 00006 57 push edi
+
+; 375 : uLong x ;
+; 376 : int i = 0;
+; 377 : int err;
+; 378 :
+; 379 : err = zip64local_getByte(pzlib_filefunc_def,filestream,&i);
+
+ 00007 8d 45 fc lea eax, DWORD PTR _i$[ebp]
+ 0000a c7 45 fc 00 00
+ 00 00 mov DWORD PTR _i$[ebp], 0
+ 00011 50 push eax
+ 00012 8b f2 mov esi, edx
+ 00014 8b f9 mov edi, ecx
+ 00016 e8 00 00 00 00 call _zip64local_getByte
+
+; 380 : x = (uLong)i;
+
+ 0001b 8b 5d fc mov ebx, DWORD PTR _i$[ebp]
+ 0001e 8b d0 mov edx, eax
+ 00020 83 c4 04 add esp, 4
+
+; 381 :
+; 382 : if (err==ZIP_OK)
+
+ 00023 85 d2 test edx, edx
+ 00025 75 2c jne SHORT $LN3@zip64local
+
+; 383 : err = zip64local_getByte(pzlib_filefunc_def,filestream,&i);
+
+ 00027 8d 45 fc lea eax, DWORD PTR _i$[ebp]
+ 0002a 8b d6 mov edx, esi
+ 0002c 50 push eax
+ 0002d 8b cf mov ecx, edi
+ 0002f e8 00 00 00 00 call _zip64local_getByte
+ 00034 8b d0 mov edx, eax
+ 00036 83 c4 04 add esp, 4
+
+; 384 : x += ((uLong)i)<<8;
+; 385 :
+; 386 : if (err==ZIP_OK)
+
+ 00039 85 d2 test edx, edx
+ 0003b 75 16 jne SHORT $LN3@zip64local
+
+; 387 : *pX = x;
+
+ 0003d 8b 4d fc mov ecx, DWORD PTR _i$[ebp]
+ 00040 8b 45 08 mov eax, DWORD PTR _pX$[ebp]
+ 00043 c1 e1 08 shl ecx, 8
+ 00046 5f pop edi
+ 00047 03 cb add ecx, ebx
+ 00049 5e pop esi
+ 0004a 89 08 mov DWORD PTR [eax], ecx
+
+; 390 : return err;
+
+ 0004c 8b c2 mov eax, edx
+ 0004e 5b pop ebx
+
+; 391 : }
+
+ 0004f 8b e5 mov esp, ebp
+ 00051 5d pop ebp
+ 00052 c3 ret 0
+$LN3@zip64local:
+
+; 388 : else
+; 389 : *pX = 0;
+
+ 00053 8b 45 08 mov eax, DWORD PTR _pX$[ebp]
+ 00056 5f pop edi
+ 00057 5e pop esi
+ 00058 5b pop ebx
+ 00059 c7 00 00 00 00
+ 00 mov DWORD PTR [eax], 0
+
+; 390 : return err;
+
+ 0005f 8b c2 mov eax, edx
+
+; 391 : }
+
+ 00061 8b e5 mov esp, ebp
+ 00063 5d pop ebp
+ 00064 c3 ret 0
+_zip64local_getShort ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _zip64local_getLong
+_TEXT SEGMENT
+_i$ = -4 ; size = 4
+_pX$ = 8 ; size = 4
+_zip64local_getLong PROC ; COMDAT
+; _pzlib_filefunc_def$ = ecx
+; _filestream$ = edx
+
+; 396 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 51 push ecx
+ 00004 53 push ebx
+ 00005 56 push esi
+ 00006 57 push edi
+
+; 397 : uLong x ;
+; 398 : int i = 0;
+; 399 : int err;
+; 400 :
+; 401 : err = zip64local_getByte(pzlib_filefunc_def,filestream,&i);
+
+ 00007 8d 45 fc lea eax, DWORD PTR _i$[ebp]
+ 0000a c7 45 fc 00 00
+ 00 00 mov DWORD PTR _i$[ebp], 0
+ 00011 50 push eax
+ 00012 8b fa mov edi, edx
+ 00014 8b d9 mov ebx, ecx
+ 00016 e8 00 00 00 00 call _zip64local_getByte
+
+; 402 : x = (uLong)i;
+
+ 0001b 8b 4d fc mov ecx, DWORD PTR _i$[ebp]
+ 0001e 8b d0 mov edx, eax
+ 00020 83 c4 04 add esp, 4
+ 00023 8b f1 mov esi, ecx
+
+; 403 :
+; 404 : if (err==ZIP_OK)
+
+ 00025 85 d2 test edx, edx
+ 00027 75 15 jne SHORT $LN2@zip64local
+
+; 405 : err = zip64local_getByte(pzlib_filefunc_def,filestream,&i);
+
+ 00029 8d 45 fc lea eax, DWORD PTR _i$[ebp]
+ 0002c 8b d7 mov edx, edi
+ 0002e 50 push eax
+ 0002f 8b cb mov ecx, ebx
+ 00031 e8 00 00 00 00 call _zip64local_getByte
+ 00036 8b 4d fc mov ecx, DWORD PTR _i$[ebp]
+ 00039 83 c4 04 add esp, 4
+ 0003c 8b d0 mov edx, eax
+$LN2@zip64local:
+
+; 406 : x += ((uLong)i)<<8;
+
+ 0003e 8b c1 mov eax, ecx
+ 00040 c1 e0 08 shl eax, 8
+ 00043 03 f0 add esi, eax
+
+; 407 :
+; 408 : if (err==ZIP_OK)
+
+ 00045 85 d2 test edx, edx
+ 00047 75 15 jne SHORT $LN3@zip64local
+
+; 409 : err = zip64local_getByte(pzlib_filefunc_def,filestream,&i);
+
+ 00049 8d 45 fc lea eax, DWORD PTR _i$[ebp]
+ 0004c 8b d7 mov edx, edi
+ 0004e 50 push eax
+ 0004f 8b cb mov ecx, ebx
+ 00051 e8 00 00 00 00 call _zip64local_getByte
+ 00056 8b 4d fc mov ecx, DWORD PTR _i$[ebp]
+ 00059 83 c4 04 add esp, 4
+ 0005c 8b d0 mov edx, eax
+$LN3@zip64local:
+
+; 410 : x += ((uLong)i)<<16;
+
+ 0005e c1 e1 10 shl ecx, 16 ; 00000010H
+ 00061 03 f1 add esi, ecx
+
+; 411 :
+; 412 : if (err==ZIP_OK)
+
+ 00063 85 d2 test edx, edx
+ 00065 75 2c jne SHORT $LN5@zip64local
+
+; 413 : err = zip64local_getByte(pzlib_filefunc_def,filestream,&i);
+
+ 00067 8d 45 fc lea eax, DWORD PTR _i$[ebp]
+ 0006a 8b d7 mov edx, edi
+ 0006c 50 push eax
+ 0006d 8b cb mov ecx, ebx
+ 0006f e8 00 00 00 00 call _zip64local_getByte
+ 00074 8b d0 mov edx, eax
+ 00076 83 c4 04 add esp, 4
+
+; 414 : x += ((uLong)i)<<24;
+; 415 :
+; 416 : if (err==ZIP_OK)
+
+ 00079 85 d2 test edx, edx
+ 0007b 75 16 jne SHORT $LN5@zip64local
+
+; 417 : *pX = x;
+
+ 0007d 8b 4d fc mov ecx, DWORD PTR _i$[ebp]
+ 00080 8b 45 08 mov eax, DWORD PTR _pX$[ebp]
+ 00083 c1 e1 18 shl ecx, 24 ; 00000018H
+ 00086 5f pop edi
+ 00087 03 ce add ecx, esi
+ 00089 5e pop esi
+ 0008a 89 08 mov DWORD PTR [eax], ecx
+
+; 420 : return err;
+
+ 0008c 8b c2 mov eax, edx
+ 0008e 5b pop ebx
+
+; 421 : }
+
+ 0008f 8b e5 mov esp, ebp
+ 00091 5d pop ebp
+ 00092 c3 ret 0
+$LN5@zip64local:
+
+; 418 : else
+; 419 : *pX = 0;
+
+ 00093 8b 45 08 mov eax, DWORD PTR _pX$[ebp]
+ 00096 5f pop edi
+ 00097 5e pop esi
+ 00098 5b pop ebx
+ 00099 c7 00 00 00 00
+ 00 mov DWORD PTR [eax], 0
+
+; 420 : return err;
+
+ 0009f 8b c2 mov eax, edx
+
+; 421 : }
+
+ 000a1 8b e5 mov esp, ebp
+ 000a3 5d pop ebp
+ 000a4 c3 ret 0
+_zip64local_getLong ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _zip64local_getLong64
+_TEXT SEGMENT
+_pzlib_filefunc_def$1$ = -12 ; size = 4
+_filestream$1$ = -8 ; size = 4
+_i$ = -4 ; size = 4
+_pX$ = 8 ; size = 4
+_zip64local_getLong64 PROC ; COMDAT
+; _pzlib_filefunc_def$ = ecx
+; _filestream$ = edx
+
+; 427 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 0c sub esp, 12 ; 0000000cH
+ 00006 53 push ebx
+ 00007 8b c2 mov eax, edx
+ 00009 89 4d f4 mov DWORD PTR _pzlib_filefunc_def$1$[ebp], ecx
+ 0000c 56 push esi
+
+; 428 : ZPOS64_T x;
+; 429 : int i = 0;
+; 430 : int err;
+; 431 :
+; 432 : err = zip64local_getByte(pzlib_filefunc_def,filestream,&i);
+
+ 0000d 8d 55 fc lea edx, DWORD PTR _i$[ebp]
+ 00010 89 45 f8 mov DWORD PTR _filestream$1$[ebp], eax
+ 00013 57 push edi
+ 00014 52 push edx
+ 00015 8b d0 mov edx, eax
+ 00017 c7 45 fc 00 00
+ 00 00 mov DWORD PTR _i$[ebp], 0
+ 0001e e8 00 00 00 00 call _zip64local_getByte
+
+; 433 : x = (ZPOS64_T)i;
+
+ 00023 8b 4d fc mov ecx, DWORD PTR _i$[ebp]
+ 00026 8b f0 mov esi, eax
+ 00028 8b c1 mov eax, ecx
+ 0002a 83 c4 04 add esp, 4
+ 0002d 99 cdq
+ 0002e 8b f8 mov edi, eax
+ 00030 8b da mov ebx, edx
+
+; 434 :
+; 435 : if (err==ZIP_OK)
+
+ 00032 85 f6 test esi, esi
+ 00034 75 17 jne SHORT $LN2@zip64local
+
+; 436 : err = zip64local_getByte(pzlib_filefunc_def,filestream,&i);
+
+ 00036 8b 55 f8 mov edx, DWORD PTR _filestream$1$[ebp]
+ 00039 8d 45 fc lea eax, DWORD PTR _i$[ebp]
+ 0003c 8b 4d f4 mov ecx, DWORD PTR _pzlib_filefunc_def$1$[ebp]
+ 0003f 50 push eax
+ 00040 e8 00 00 00 00 call _zip64local_getByte
+ 00045 8b 4d fc mov ecx, DWORD PTR _i$[ebp]
+ 00048 83 c4 04 add esp, 4
+ 0004b 8b f0 mov esi, eax
+$LN2@zip64local:
+
+; 437 : x += ((ZPOS64_T)i)<<8;
+
+ 0004d 8b c1 mov eax, ecx
+ 0004f 99 cdq
+ 00050 0f a4 c2 08 shld edx, eax, 8
+ 00054 c1 e0 08 shl eax, 8
+ 00057 03 f8 add edi, eax
+ 00059 13 da adc ebx, edx
+
+; 438 :
+; 439 : if (err==ZIP_OK)
+
+ 0005b 85 f6 test esi, esi
+ 0005d 75 17 jne SHORT $LN3@zip64local
+
+; 440 : err = zip64local_getByte(pzlib_filefunc_def,filestream,&i);
+
+ 0005f 8b 55 f8 mov edx, DWORD PTR _filestream$1$[ebp]
+ 00062 8d 45 fc lea eax, DWORD PTR _i$[ebp]
+ 00065 8b 4d f4 mov ecx, DWORD PTR _pzlib_filefunc_def$1$[ebp]
+ 00068 50 push eax
+ 00069 e8 00 00 00 00 call _zip64local_getByte
+ 0006e 8b 4d fc mov ecx, DWORD PTR _i$[ebp]
+ 00071 83 c4 04 add esp, 4
+ 00074 8b f0 mov esi, eax
+$LN3@zip64local:
+
+; 441 : x += ((ZPOS64_T)i)<<16;
+
+ 00076 8b c1 mov eax, ecx
+ 00078 99 cdq
+ 00079 0f a4 c2 10 shld edx, eax, 16
+ 0007d c1 e0 10 shl eax, 16 ; 00000010H
+ 00080 03 f8 add edi, eax
+ 00082 13 da adc ebx, edx
+
+; 442 :
+; 443 : if (err==ZIP_OK)
+
+ 00084 85 f6 test esi, esi
+ 00086 75 17 jne SHORT $LN4@zip64local
+
+; 444 : err = zip64local_getByte(pzlib_filefunc_def,filestream,&i);
+
+ 00088 8b 55 f8 mov edx, DWORD PTR _filestream$1$[ebp]
+ 0008b 8d 45 fc lea eax, DWORD PTR _i$[ebp]
+ 0008e 8b 4d f4 mov ecx, DWORD PTR _pzlib_filefunc_def$1$[ebp]
+ 00091 50 push eax
+ 00092 e8 00 00 00 00 call _zip64local_getByte
+ 00097 8b 4d fc mov ecx, DWORD PTR _i$[ebp]
+ 0009a 83 c4 04 add esp, 4
+ 0009d 8b f0 mov esi, eax
+$LN4@zip64local:
+
+; 445 : x += ((ZPOS64_T)i)<<24;
+
+ 0009f 8b c1 mov eax, ecx
+ 000a1 99 cdq
+ 000a2 0f a4 c2 18 shld edx, eax, 24
+ 000a6 c1 e0 18 shl eax, 24 ; 00000018H
+ 000a9 03 f8 add edi, eax
+ 000ab 13 da adc ebx, edx
+
+; 446 :
+; 447 : if (err==ZIP_OK)
+
+ 000ad 85 f6 test esi, esi
+ 000af 75 17 jne SHORT $LN5@zip64local
+
+; 448 : err = zip64local_getByte(pzlib_filefunc_def,filestream,&i);
+
+ 000b1 8b 55 f8 mov edx, DWORD PTR _filestream$1$[ebp]
+ 000b4 8d 45 fc lea eax, DWORD PTR _i$[ebp]
+ 000b7 8b 4d f4 mov ecx, DWORD PTR _pzlib_filefunc_def$1$[ebp]
+ 000ba 50 push eax
+ 000bb e8 00 00 00 00 call _zip64local_getByte
+ 000c0 8b 4d fc mov ecx, DWORD PTR _i$[ebp]
+ 000c3 83 c4 04 add esp, 4
+ 000c6 8b f0 mov esi, eax
+$LN5@zip64local:
+
+; 449 : x += ((ZPOS64_T)i)<<32;
+
+ 000c8 8b c1 mov eax, ecx
+ 000ca 83 c7 00 add edi, 0
+ 000cd 99 cdq
+ 000ce 13 d8 adc ebx, eax
+
+; 450 :
+; 451 : if (err==ZIP_OK)
+
+ 000d0 85 f6 test esi, esi
+ 000d2 75 17 jne SHORT $LN6@zip64local
+
+; 452 : err = zip64local_getByte(pzlib_filefunc_def,filestream,&i);
+
+ 000d4 8b 55 f8 mov edx, DWORD PTR _filestream$1$[ebp]
+ 000d7 8d 45 fc lea eax, DWORD PTR _i$[ebp]
+ 000da 8b 4d f4 mov ecx, DWORD PTR _pzlib_filefunc_def$1$[ebp]
+ 000dd 50 push eax
+ 000de e8 00 00 00 00 call _zip64local_getByte
+ 000e3 8b 4d fc mov ecx, DWORD PTR _i$[ebp]
+ 000e6 83 c4 04 add esp, 4
+ 000e9 8b f0 mov esi, eax
+$LN6@zip64local:
+
+; 453 : x += ((ZPOS64_T)i)<<40;
+
+ 000eb 8b c1 mov eax, ecx
+ 000ed 99 cdq
+ 000ee c1 e0 08 shl eax, 8
+ 000f1 83 c7 00 add edi, 0
+ 000f4 13 d8 adc ebx, eax
+
+; 454 :
+; 455 : if (err==ZIP_OK)
+
+ 000f6 85 f6 test esi, esi
+ 000f8 75 17 jne SHORT $LN7@zip64local
+
+; 456 : err = zip64local_getByte(pzlib_filefunc_def,filestream,&i);
+
+ 000fa 8b 55 f8 mov edx, DWORD PTR _filestream$1$[ebp]
+ 000fd 8d 45 fc lea eax, DWORD PTR _i$[ebp]
+ 00100 8b 4d f4 mov ecx, DWORD PTR _pzlib_filefunc_def$1$[ebp]
+ 00103 50 push eax
+ 00104 e8 00 00 00 00 call _zip64local_getByte
+ 00109 8b 4d fc mov ecx, DWORD PTR _i$[ebp]
+ 0010c 83 c4 04 add esp, 4
+ 0010f 8b f0 mov esi, eax
+$LN7@zip64local:
+
+; 457 : x += ((ZPOS64_T)i)<<48;
+
+ 00111 8b c1 mov eax, ecx
+ 00113 99 cdq
+ 00114 c1 e0 10 shl eax, 16 ; 00000010H
+ 00117 83 c7 00 add edi, 0
+ 0011a 13 d8 adc ebx, eax
+
+; 458 :
+; 459 : if (err==ZIP_OK)
+
+ 0011c 85 f6 test esi, esi
+ 0011e 75 36 jne SHORT $LN9@zip64local
+
+; 460 : err = zip64local_getByte(pzlib_filefunc_def,filestream,&i);
+
+ 00120 8b 55 f8 mov edx, DWORD PTR _filestream$1$[ebp]
+ 00123 8d 45 fc lea eax, DWORD PTR _i$[ebp]
+ 00126 8b 4d f4 mov ecx, DWORD PTR _pzlib_filefunc_def$1$[ebp]
+ 00129 50 push eax
+ 0012a e8 00 00 00 00 call _zip64local_getByte
+ 0012f 8b f0 mov esi, eax
+ 00131 83 c4 04 add esp, 4
+
+; 461 : x += ((ZPOS64_T)i)<<56;
+; 462 :
+; 463 : if (err==ZIP_OK)
+
+ 00134 85 f6 test esi, esi
+ 00136 75 1e jne SHORT $LN9@zip64local
+
+; 464 : *pX = x;
+
+ 00138 8b 45 fc mov eax, DWORD PTR _i$[ebp]
+ 0013b 8b 4d 08 mov ecx, DWORD PTR _pX$[ebp]
+ 0013e 99 cdq
+ 0013f 33 d2 xor edx, edx
+ 00141 c1 e0 18 shl eax, 24 ; 00000018H
+ 00144 03 d7 add edx, edi
+ 00146 89 11 mov DWORD PTR [ecx], edx
+ 00148 13 c3 adc eax, ebx
+ 0014a 89 41 04 mov DWORD PTR [ecx+4], eax
+
+; 467 :
+; 468 : return err;
+
+ 0014d 8b c6 mov eax, esi
+
+; 469 : }
+
+ 0014f 5f pop edi
+ 00150 5e pop esi
+ 00151 5b pop ebx
+ 00152 8b e5 mov esp, ebp
+ 00154 5d pop ebp
+ 00155 c3 ret 0
+$LN9@zip64local:
+
+; 465 : else
+; 466 : *pX = 0;
+
+ 00156 8b 45 08 mov eax, DWORD PTR _pX$[ebp]
+
+; 469 : }
+
+ 00159 5f pop edi
+ 0015a c7 00 00 00 00
+ 00 mov DWORD PTR [eax], 0
+ 00160 c7 40 04 00 00
+ 00 00 mov DWORD PTR [eax+4], 0
+ 00167 8b c6 mov eax, esi
+ 00169 5e pop esi
+ 0016a 5b pop ebx
+ 0016b 8b e5 mov esp, ebp
+ 0016d 5d pop ebp
+ 0016e c3 ret 0
+_zip64local_getLong64 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _zip64local_SearchCentralDir
+_TEXT SEGMENT
+_uPosFound$ = -48 ; size = 8
+_uReadPos$1$ = -44 ; size = 4
+_uBackRead$2$ = -40 ; size = 4
+_uReadPos$2$ = -36 ; size = 4
+_pzlib_filefunc_def$1$ = -32 ; size = 4
+_filestream$1$ = -28 ; size = 4
+_uSizeFile$1$ = -24 ; size = 4
+_uSizeFile$2$ = -20 ; size = 4
+_uPosFound$1$ = -16 ; size = 4
+_uPosFound$2$ = -12 ; size = 4
+_uMaxBack$1$ = -8 ; size = 4
+_uMaxBack$2$ = -4 ; size = 4
+_zip64local_SearchCentralDir PROC ; COMDAT
+; _pzlib_filefunc_def$ = ecx
+; _filestream$ = edx
+
+; 481 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 34 sub esp, 52 ; 00000034H
+ 00006 53 push ebx
+ 00007 56 push esi
+ 00008 57 push edi
+
+; 482 : unsigned char* buf;
+; 483 : ZPOS64_T uSizeFile;
+; 484 : ZPOS64_T uBackRead;
+; 485 : ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */
+
+ 00009 33 c0 xor eax, eax
+ 0000b 8b f2 mov esi, edx
+
+; 486 : ZPOS64_T uPosFound=0;
+; 487 :
+; 488 : if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0)
+
+ 0000d 6a 02 push 2
+ 0000f 50 push eax
+ 00010 8b d9 mov ebx, ecx
+ 00012 89 75 e4 mov DWORD PTR _filestream$1$[ebp], esi
+ 00015 0f 57 c0 xorps xmm0, xmm0
+ 00018 89 5d e0 mov DWORD PTR _pzlib_filefunc_def$1$[ebp], ebx
+ 0001b bf ff ff 00 00 mov edi, 65535 ; 0000ffffH
+ 00020 89 45 fc mov DWORD PTR _uMaxBack$2$[ebp], eax
+ 00023 50 push eax
+ 00024 89 7d f8 mov DWORD PTR _uMaxBack$1$[ebp], edi
+ 00027 66 0f 13 45 d0 movlpd QWORD PTR _uPosFound$[ebp], xmm0
+ 0002c e8 00 00 00 00 call _call_zseek64
+ 00031 83 c4 0c add esp, 12 ; 0000000cH
+ 00034 85 c0 test eax, eax
+ 00036 74 0b je SHORT $LN7@zip64local
+
+; 489 : return 0;
+
+ 00038 33 c0 xor eax, eax
+$LN43@zip64local:
+ 0003a 33 d2 xor edx, edx
+
+; 534 : }
+
+ 0003c 5f pop edi
+ 0003d 5e pop esi
+ 0003e 5b pop ebx
+ 0003f 8b e5 mov esp, ebp
+ 00041 5d pop ebp
+ 00042 c3 ret 0
+$LN7@zip64local:
+
+; 490 :
+; 491 :
+; 492 : uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream);
+
+ 00043 8b d6 mov edx, esi
+ 00045 8b cb mov ecx, ebx
+ 00047 e8 00 00 00 00 call _call_ztell64
+ 0004c 8b ca mov ecx, edx
+ 0004e 89 45 e8 mov DWORD PTR _uSizeFile$1$[ebp], eax
+ 00051 89 4d ec mov DWORD PTR _uSizeFile$2$[ebp], ecx
+
+; 493 :
+; 494 : if (uMaxBack>uSizeFile)
+
+ 00054 85 c9 test ecx, ecx
+ 00056 77 11 ja SHORT $LN8@zip64local
+ 00058 72 07 jb SHORT $LN33@zip64local
+ 0005a 3d ff ff 00 00 cmp eax, 65535 ; 0000ffffH
+ 0005f 73 08 jae SHORT $LN8@zip64local
+$LN33@zip64local:
+
+; 495 : uMaxBack = uSizeFile;
+
+ 00061 8b f8 mov edi, eax
+ 00063 89 4d fc mov DWORD PTR _uMaxBack$2$[ebp], ecx
+ 00066 89 7d f8 mov DWORD PTR _uMaxBack$1$[ebp], edi
+$LN8@zip64local:
+
+; 496 :
+; 497 : buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4);
+
+ 00069 68 04 04 00 00 push 1028 ; 00000404H
+ 0006e ff 15 00 00 00
+ 00 call DWORD PTR __imp__malloc
+ 00074 8b f0 mov esi, eax
+ 00076 83 c4 04 add esp, 4
+
+; 498 : if (buf==NULL)
+; 499 : return 0;
+
+ 00079 33 c0 xor eax, eax
+ 0007b 85 f6 test esi, esi
+ 0007d 74 bb je SHORT $LN43@zip64local
+
+; 500 :
+; 501 : uBackRead = 4;
+; 502 : while (uBackRead<uMaxBack)
+
+ 0007f 8b 4d fc mov ecx, DWORD PTR _uMaxBack$2$[ebp]
+ 00082 8d 58 04 lea ebx, DWORD PTR [eax+4]
+ 00085 3b c1 cmp eax, ecx
+ 00087 0f 87 f3 00 00
+ 00 ja $LN42@zip64local
+ 0008d 72 08 jb SHORT $LN40@zip64local
+ 0008f 3b df cmp ebx, edi
+ 00091 0f 83 e9 00 00
+ 00 jae $LN42@zip64local
+$LN40@zip64local:
+ 00097 8b 55 d4 mov edx, DWORD PTR _uPosFound$[ebp+4]
+ 0009a 89 55 f0 mov DWORD PTR _uPosFound$1$[ebp], edx
+ 0009d 8b 55 d0 mov edx, DWORD PTR _uPosFound$[ebp]
+ 000a0 89 55 f4 mov DWORD PTR _uPosFound$2$[ebp], edx
+$LL2@zip64local:
+
+; 503 : {
+; 504 : uLong uReadSize;
+; 505 : ZPOS64_T uReadPos ;
+; 506 : int i;
+; 507 : if (uBackRead+BUFREADCOMMENT>uMaxBack)
+
+ 000a3 81 c3 00 04 00
+ 00 add ebx, 1024 ; 00000400H
+ 000a9 83 d0 00 adc eax, 0
+ 000ac 89 45 d8 mov DWORD PTR _uBackRead$2$[ebp], eax
+ 000af 3b c1 cmp eax, ecx
+ 000b1 72 0d jb SHORT $LN11@zip64local
+ 000b3 77 04 ja SHORT $LN35@zip64local
+ 000b5 3b df cmp ebx, edi
+ 000b7 76 07 jbe SHORT $LN11@zip64local
+$LN35@zip64local:
+
+; 508 : uBackRead = uMaxBack;
+
+ 000b9 8b df mov ebx, edi
+ 000bb 89 4d d8 mov DWORD PTR _uBackRead$2$[ebp], ecx
+ 000be 8b c1 mov eax, ecx
+$LN11@zip64local:
+
+; 509 : else
+; 510 : uBackRead+=BUFREADCOMMENT;
+; 511 : uReadPos = uSizeFile-uBackRead ;
+
+ 000c0 8b 4d e8 mov ecx, DWORD PTR _uSizeFile$1$[ebp]
+ 000c3 8b d1 mov edx, ecx
+ 000c5 8b 7d ec mov edi, DWORD PTR _uSizeFile$2$[ebp]
+ 000c8 2b d3 sub edx, ebx
+ 000ca 89 55 d4 mov DWORD PTR _uReadPos$1$[ebp], edx
+ 000cd 1b f8 sbb edi, eax
+
+; 512 :
+; 513 : uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ?
+
+ 000cf 8b 45 ec mov eax, DWORD PTR _uSizeFile$2$[ebp]
+ 000d2 2b ca sub ecx, edx
+ 000d4 89 7d dc mov DWORD PTR _uReadPos$2$[ebp], edi
+ 000d7 1b c7 sbb eax, edi
+ 000d9 85 c0 test eax, eax
+ 000db 72 11 jb SHORT $LN18@zip64local
+ 000dd 77 08 ja SHORT $LN36@zip64local
+ 000df 81 f9 04 04 00
+ 00 cmp ecx, 1028 ; 00000404H
+ 000e5 76 07 jbe SHORT $LN18@zip64local
+$LN36@zip64local:
+ 000e7 bf 04 04 00 00 mov edi, 1028 ; 00000404H
+ 000ec eb 05 jmp SHORT $LN19@zip64local
+$LN18@zip64local:
+ 000ee 8b 7d e8 mov edi, DWORD PTR _uSizeFile$1$[ebp]
+ 000f1 2b fa sub edi, edx
+$LN19@zip64local:
+
+; 514 : (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos);
+; 515 : if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0)
+
+ 000f3 8b 4d e0 mov ecx, DWORD PTR _pzlib_filefunc_def$1$[ebp]
+ 000f6 6a 00 push 0
+ 000f8 ff 75 dc push DWORD PTR _uReadPos$2$[ebp]
+ 000fb 52 push edx
+ 000fc 8b 55 e4 mov edx, DWORD PTR _filestream$1$[ebp]
+ 000ff e8 00 00 00 00 call _call_zseek64
+ 00104 83 c4 0c add esp, 12 ; 0000000cH
+ 00107 85 c0 test eax, eax
+ 00109 0f 85 7d 00 00
+ 00 jne $LN37@zip64local
+
+; 516 : break;
+; 517 :
+; 518 : if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize)
+
+ 0010f 8b 45 e0 mov eax, DWORD PTR _pzlib_filefunc_def$1$[ebp]
+ 00112 57 push edi
+ 00113 56 push esi
+ 00114 ff 75 e4 push DWORD PTR _filestream$1$[ebp]
+ 00117 ff 70 1c push DWORD PTR [eax+28]
+ 0011a 8b 40 04 mov eax, DWORD PTR [eax+4]
+ 0011d ff d0 call eax
+ 0011f 83 c4 10 add esp, 16 ; 00000010H
+ 00122 3b c7 cmp eax, edi
+ 00124 75 66 jne SHORT $LN37@zip64local
+
+; 519 : break;
+; 520 :
+; 521 : for (i=(int)uReadSize-3; (i--)>0;)
+
+ 00126 8d 47 fd lea eax, DWORD PTR [edi-3]
+ 00129 85 c0 test eax, eax
+ 0012b 7e 36 jle SHORT $LN32@zip64local
+ 0012d 0f 1f 00 npad 3
+$LL4@zip64local:
+ 00130 48 dec eax
+
+; 522 : if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
+; 523 : ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06))
+
+ 00131 80 3c 30 50 cmp BYTE PTR [eax+esi], 80 ; 00000050H
+ 00135 75 15 jne SHORT $LN14@zip64local
+ 00137 80 7c 30 01 4b cmp BYTE PTR [eax+esi+1], 75 ; 0000004bH
+ 0013c 75 0e jne SHORT $LN14@zip64local
+ 0013e 80 7c 30 02 05 cmp BYTE PTR [eax+esi+2], 5
+ 00143 75 07 jne SHORT $LN14@zip64local
+ 00145 80 7c 30 03 06 cmp BYTE PTR [eax+esi+3], 6
+ 0014a 74 06 je SHORT $LN22@zip64local
+$LN14@zip64local:
+
+; 519 : break;
+; 520 :
+; 521 : for (i=(int)uReadSize-3; (i--)>0;)
+
+ 0014c 85 c0 test eax, eax
+ 0014e 7f e0 jg SHORT $LL4@zip64local
+ 00150 eb 11 jmp SHORT $LN32@zip64local
+$LN22@zip64local:
+
+; 524 : {
+; 525 : uPosFound = uReadPos+i;
+
+ 00152 99 cdq
+ 00153 03 45 d4 add eax, DWORD PTR _uReadPos$1$[ebp]
+ 00156 89 45 f4 mov DWORD PTR _uPosFound$2$[ebp], eax
+ 00159 13 55 dc adc edx, DWORD PTR _uReadPos$2$[ebp]
+
+; 526 : break;
+; 527 : }
+; 528 :
+; 529 : if (uPosFound!=0)
+
+ 0015c 0b c2 or eax, edx
+ 0015e 89 55 f0 mov DWORD PTR _uPosFound$1$[ebp], edx
+ 00161 75 29 jne SHORT $LN37@zip64local
+$LN32@zip64local:
+
+; 500 :
+; 501 : uBackRead = 4;
+; 502 : while (uBackRead<uMaxBack)
+
+ 00163 8b 45 d8 mov eax, DWORD PTR _uBackRead$2$[ebp]
+ 00166 8b 4d fc mov ecx, DWORD PTR _uMaxBack$2$[ebp]
+ 00169 8b 7d f8 mov edi, DWORD PTR _uMaxBack$1$[ebp]
+ 0016c 3b c1 cmp eax, ecx
+ 0016e 0f 82 2f ff ff
+ ff jb $LL2@zip64local
+ 00174 77 16 ja SHORT $LN37@zip64local
+ 00176 3b df cmp ebx, edi
+ 00178 0f 82 25 ff ff
+ ff jb $LL2@zip64local
+ 0017e eb 0c jmp SHORT $LN37@zip64local
+$LN42@zip64local:
+ 00180 8b 45 d4 mov eax, DWORD PTR _uPosFound$[ebp+4]
+ 00183 89 45 f0 mov DWORD PTR _uPosFound$1$[ebp], eax
+ 00186 8b 45 d0 mov eax, DWORD PTR _uPosFound$[ebp]
+ 00189 89 45 f4 mov DWORD PTR _uPosFound$2$[ebp], eax
+$LN37@zip64local:
+
+; 530 : break;
+; 531 : }
+; 532 : TRYFREE(buf);
+
+ 0018c 56 push esi
+ 0018d ff 15 00 00 00
+ 00 call DWORD PTR __imp__free
+
+; 533 : return uPosFound;
+
+ 00193 8b 45 f4 mov eax, DWORD PTR _uPosFound$2$[ebp]
+ 00196 83 c4 04 add esp, 4
+ 00199 8b 55 f0 mov edx, DWORD PTR _uPosFound$1$[ebp]
+
+; 534 : }
+
+ 0019c 5f pop edi
+ 0019d 5e pop esi
+ 0019e 5b pop ebx
+ 0019f 8b e5 mov esp, ebp
+ 001a1 5d pop ebp
+ 001a2 c3 ret 0
+_zip64local_SearchCentralDir ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _zip64local_SearchCentralDir64
+_TEXT SEGMENT
+_relativeOffset$ = -48 ; size = 8
+_uPosFound$ = -48 ; size = 8
+_uReadPos$1$ = -44 ; size = 4
+_uBackRead$2$ = -40 ; size = 4
+_uReadPos$2$ = -36 ; size = 4
+_uSizeFile$1$ = -32 ; size = 4
+_uSizeFile$2$ = -28 ; size = 4
+_uPosFound$1$ = -24 ; size = 4
+_uPosFound$2$ = -20 ; size = 4
+_uMaxBack$2$ = -16 ; size = 4
+_filestream$1$ = -12 ; size = 4
+_uMaxBack$1$ = -8 ; size = 4
+_uL$ = -8 ; size = 4
+_pzlib_filefunc_def$1$ = -4 ; size = 4
+_zip64local_SearchCentralDir64 PROC ; COMDAT
+; _pzlib_filefunc_def$ = ecx
+; _filestream$ = edx
+
+; 543 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 34 sub esp, 52 ; 00000034H
+ 00006 53 push ebx
+ 00007 56 push esi
+ 00008 57 push edi
+
+; 544 : unsigned char* buf;
+; 545 : ZPOS64_T uSizeFile;
+; 546 : ZPOS64_T uBackRead;
+; 547 : ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */
+
+ 00009 b8 ff ff 00 00 mov eax, 65535 ; 0000ffffH
+ 0000e 8b da mov ebx, edx
+ 00010 89 45 f8 mov DWORD PTR _uMaxBack$1$[ebp], eax
+ 00013 8b f9 mov edi, ecx
+ 00015 33 c0 xor eax, eax
+ 00017 89 5d f4 mov DWORD PTR _filestream$1$[ebp], ebx
+
+; 548 : ZPOS64_T uPosFound=0;
+; 549 : uLong uL;
+; 550 : ZPOS64_T relativeOffset;
+; 551 :
+; 552 : if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0)
+
+ 0001a 6a 02 push 2
+ 0001c 50 push eax
+ 0001d 0f 57 c0 xorps xmm0, xmm0
+ 00020 89 7d fc mov DWORD PTR _pzlib_filefunc_def$1$[ebp], edi
+ 00023 50 push eax
+ 00024 89 45 f0 mov DWORD PTR _uMaxBack$2$[ebp], eax
+ 00027 66 0f 13 45 d0 movlpd QWORD PTR _uPosFound$[ebp], xmm0
+ 0002c e8 00 00 00 00 call _call_zseek64
+ 00031 83 c4 0c add esp, 12 ; 0000000cH
+ 00034 85 c0 test eax, eax
+ 00036 74 0b je SHORT $LN7@zip64local
+$LN61@zip64local:
+
+; 553 : return 0;
+
+ 00038 33 c0 xor eax, eax
+$LN60@zip64local:
+ 0003a 33 d2 xor edx, edx
+
+; 638 : }
+
+ 0003c 5f pop edi
+ 0003d 5e pop esi
+ 0003e 5b pop ebx
+ 0003f 8b e5 mov esp, ebp
+ 00041 5d pop ebp
+ 00042 c3 ret 0
+$LN7@zip64local:
+
+; 554 :
+; 555 : uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream);
+
+ 00043 8b d3 mov edx, ebx
+ 00045 8b cf mov ecx, edi
+ 00047 e8 00 00 00 00 call _call_ztell64
+ 0004c 8b ca mov ecx, edx
+ 0004e 89 45 e0 mov DWORD PTR _uSizeFile$1$[ebp], eax
+ 00051 89 4d e4 mov DWORD PTR _uSizeFile$2$[ebp], ecx
+
+; 556 :
+; 557 : if (uMaxBack>uSizeFile)
+
+ 00054 85 c9 test ecx, ecx
+ 00056 77 0f ja SHORT $LN8@zip64local
+ 00058 72 07 jb SHORT $LN44@zip64local
+ 0005a 3d ff ff 00 00 cmp eax, 65535 ; 0000ffffH
+ 0005f 73 06 jae SHORT $LN8@zip64local
+$LN44@zip64local:
+
+; 558 : uMaxBack = uSizeFile;
+
+ 00061 89 45 f8 mov DWORD PTR _uMaxBack$1$[ebp], eax
+ 00064 89 4d f0 mov DWORD PTR _uMaxBack$2$[ebp], ecx
+$LN8@zip64local:
+
+; 559 :
+; 560 : buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4);
+
+ 00067 68 04 04 00 00 push 1028 ; 00000404H
+ 0006c ff 15 00 00 00
+ 00 call DWORD PTR __imp__malloc
+ 00072 8b f0 mov esi, eax
+ 00074 83 c4 04 add esp, 4
+
+; 561 : if (buf==NULL)
+; 562 : return 0;
+
+ 00077 33 c0 xor eax, eax
+ 00079 85 f6 test esi, esi
+ 0007b 74 bd je SHORT $LN60@zip64local
+
+; 563 :
+; 564 : uBackRead = 4;
+; 565 : while (uBackRead<uMaxBack)
+
+ 0007d 8b 55 f0 mov edx, DWORD PTR _uMaxBack$2$[ebp]
+ 00080 8d 58 04 lea ebx, DWORD PTR [eax+4]
+ 00083 3b c2 cmp eax, edx
+ 00085 0f 87 f3 01 00
+ 00 ja $LN53@zip64local
+ 0008b 8b 4d f8 mov ecx, DWORD PTR _uMaxBack$1$[ebp]
+ 0008e 72 08 jb SHORT $LN51@zip64local
+ 00090 3b d9 cmp ebx, ecx
+ 00092 0f 83 e6 01 00
+ 00 jae $LN53@zip64local
+$LN51@zip64local:
+ 00098 8b 7d d4 mov edi, DWORD PTR _uPosFound$[ebp+4]
+ 0009b 89 7d e8 mov DWORD PTR _uPosFound$1$[ebp], edi
+ 0009e 8b 7d d0 mov edi, DWORD PTR _uPosFound$[ebp]
+ 000a1 89 7d ec mov DWORD PTR _uPosFound$2$[ebp], edi
+$LL2@zip64local:
+
+; 566 : {
+; 567 : uLong uReadSize;
+; 568 : ZPOS64_T uReadPos;
+; 569 : int i;
+; 570 : if (uBackRead+BUFREADCOMMENT>uMaxBack)
+
+ 000a4 81 c3 00 04 00
+ 00 add ebx, 1024 ; 00000400H
+ 000aa 83 d0 00 adc eax, 0
+ 000ad 89 45 d8 mov DWORD PTR _uBackRead$2$[ebp], eax
+ 000b0 3b c2 cmp eax, edx
+ 000b2 72 0d jb SHORT $LN11@zip64local
+ 000b4 77 04 ja SHORT $LN46@zip64local
+ 000b6 3b d9 cmp ebx, ecx
+ 000b8 76 07 jbe SHORT $LN11@zip64local
+$LN46@zip64local:
+
+; 571 : uBackRead = uMaxBack;
+
+ 000ba 8b d9 mov ebx, ecx
+ 000bc 89 55 d8 mov DWORD PTR _uBackRead$2$[ebp], edx
+ 000bf 8b c2 mov eax, edx
+$LN11@zip64local:
+
+; 572 : else
+; 573 : uBackRead+=BUFREADCOMMENT;
+; 574 : uReadPos = uSizeFile-uBackRead ;
+
+ 000c1 8b 4d e0 mov ecx, DWORD PTR _uSizeFile$1$[ebp]
+ 000c4 8b d1 mov edx, ecx
+ 000c6 8b 7d e4 mov edi, DWORD PTR _uSizeFile$2$[ebp]
+ 000c9 2b d3 sub edx, ebx
+ 000cb 89 55 d4 mov DWORD PTR _uReadPos$1$[ebp], edx
+ 000ce 1b f8 sbb edi, eax
+
+; 575 :
+; 576 : uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ?
+
+ 000d0 8b 45 e4 mov eax, DWORD PTR _uSizeFile$2$[ebp]
+ 000d3 2b ca sub ecx, edx
+ 000d5 89 7d dc mov DWORD PTR _uReadPos$2$[ebp], edi
+ 000d8 1b c7 sbb eax, edi
+ 000da 85 c0 test eax, eax
+ 000dc 72 11 jb SHORT $LN29@zip64local
+ 000de 77 08 ja SHORT $LN47@zip64local
+ 000e0 81 f9 04 04 00
+ 00 cmp ecx, 1028 ; 00000404H
+ 000e6 76 07 jbe SHORT $LN29@zip64local
+$LN47@zip64local:
+ 000e8 bf 04 04 00 00 mov edi, 1028 ; 00000404H
+ 000ed eb 05 jmp SHORT $LN30@zip64local
+$LN29@zip64local:
+ 000ef 8b 7d e0 mov edi, DWORD PTR _uSizeFile$1$[ebp]
+ 000f2 2b fa sub edi, edx
+$LN30@zip64local:
+
+; 577 : (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos);
+; 578 : if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0)
+
+ 000f4 8b 4d fc mov ecx, DWORD PTR _pzlib_filefunc_def$1$[ebp]
+ 000f7 6a 00 push 0
+ 000f9 ff 75 dc push DWORD PTR _uReadPos$2$[ebp]
+ 000fc 52 push edx
+ 000fd 8b 55 f4 mov edx, DWORD PTR _filestream$1$[ebp]
+ 00100 e8 00 00 00 00 call _call_zseek64
+ 00105 83 c4 0c add esp, 12 ; 0000000cH
+ 00108 85 c0 test eax, eax
+ 0010a 75 76 jne SHORT $LN57@zip64local
+
+; 579 : break;
+; 580 :
+; 581 : if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize)
+
+ 0010c 8b 45 fc mov eax, DWORD PTR _pzlib_filefunc_def$1$[ebp]
+ 0010f 57 push edi
+ 00110 56 push esi
+ 00111 ff 75 f4 push DWORD PTR _filestream$1$[ebp]
+ 00114 ff 70 1c push DWORD PTR [eax+28]
+ 00117 8b 40 04 mov eax, DWORD PTR [eax+4]
+ 0011a ff d0 call eax
+ 0011c 83 c4 10 add esp, 16 ; 00000010H
+ 0011f 3b c7 cmp eax, edi
+ 00121 75 5f jne SHORT $LN57@zip64local
+
+; 582 : break;
+; 583 :
+; 584 : for (i=(int)uReadSize-3; (i--)>0;)
+
+ 00123 8d 47 fd lea eax, DWORD PTR [edi-3]
+ 00126 85 c0 test eax, eax
+ 00128 7e 3d jle SHORT $LN43@zip64local
+ 0012a 66 0f 1f 44 00
+ 00 npad 6
+$LL4@zip64local:
+ 00130 48 dec eax
+
+; 585 : {
+; 586 : // Signature "0x07064b50" Zip64 end of central directory locater
+; 587 : if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && ((*(buf+i+2))==0x06) && ((*(buf+i+3))==0x07))
+
+ 00131 80 3c 30 50 cmp BYTE PTR [eax+esi], 80 ; 00000050H
+ 00135 75 15 jne SHORT $LN14@zip64local
+ 00137 80 7c 30 01 4b cmp BYTE PTR [eax+esi+1], 75 ; 0000004bH
+ 0013c 75 0e jne SHORT $LN14@zip64local
+ 0013e 80 7c 30 02 06 cmp BYTE PTR [eax+esi+2], 6
+ 00143 75 07 jne SHORT $LN14@zip64local
+ 00145 80 7c 30 03 07 cmp BYTE PTR [eax+esi+3], 7
+ 0014a 74 06 je SHORT $LN33@zip64local
+$LN14@zip64local:
+
+; 582 : break;
+; 583 :
+; 584 : for (i=(int)uReadSize-3; (i--)>0;)
+
+ 0014c 85 c0 test eax, eax
+ 0014e 7f e0 jg SHORT $LL4@zip64local
+ 00150 eb 15 jmp SHORT $LN43@zip64local
+$LN33@zip64local:
+
+; 588 : {
+; 589 : uPosFound = uReadPos+i;
+
+ 00152 99 cdq
+ 00153 03 45 d4 add eax, DWORD PTR _uReadPos$1$[ebp]
+ 00156 8b fa mov edi, edx
+
+; 590 : break;
+; 591 : }
+; 592 : }
+; 593 :
+; 594 : if (uPosFound!=0)
+
+ 00158 8b c8 mov ecx, eax
+ 0015a 89 45 ec mov DWORD PTR _uPosFound$2$[ebp], eax
+ 0015d 13 7d dc adc edi, DWORD PTR _uReadPos$2$[ebp]
+ 00160 0b cf or ecx, edi
+ 00162 89 7d e8 mov DWORD PTR _uPosFound$1$[ebp], edi
+ 00165 75 1b jne SHORT $LN57@zip64local
+$LN43@zip64local:
+
+; 563 :
+; 564 : uBackRead = 4;
+; 565 : while (uBackRead<uMaxBack)
+
+ 00167 8b 45 d8 mov eax, DWORD PTR _uBackRead$2$[ebp]
+ 0016a 8b 55 f0 mov edx, DWORD PTR _uMaxBack$2$[ebp]
+ 0016d 8b 4d f8 mov ecx, DWORD PTR _uMaxBack$1$[ebp]
+ 00170 3b c2 cmp eax, edx
+ 00172 0f 82 2c ff ff
+ ff jb $LL2@zip64local
+ 00178 77 08 ja SHORT $LN57@zip64local
+ 0017a 3b d9 cmp ebx, ecx
+ 0017c 0f 82 22 ff ff
+ ff jb $LL2@zip64local
+$LN57@zip64local:
+ 00182 8b 7d fc mov edi, DWORD PTR _pzlib_filefunc_def$1$[ebp]
+$LN48@zip64local:
+
+; 595 : break;
+; 596 : }
+; 597 :
+; 598 : TRYFREE(buf);
+
+ 00185 56 push esi
+ 00186 ff 15 00 00 00
+ 00 call DWORD PTR __imp__free
+
+; 599 : if (uPosFound == 0)
+
+ 0018c 8b 55 ec mov edx, DWORD PTR _uPosFound$2$[ebp]
+ 0018f 83 c4 04 add esp, 4
+ 00192 8b 4d e8 mov ecx, DWORD PTR _uPosFound$1$[ebp]
+ 00195 8b c2 mov eax, edx
+ 00197 0b c1 or eax, ecx
+ 00199 0f 84 99 fe ff
+ ff je $LN61@zip64local
+
+; 600 : return 0;
+; 601 :
+; 602 : /* Zip64 end of central directory locator */
+; 603 : if (ZSEEK64(*pzlib_filefunc_def,filestream, uPosFound,ZLIB_FILEFUNC_SEEK_SET)!=0)
+
+ 0019f 8b 5d f4 mov ebx, DWORD PTR _filestream$1$[ebp]
+ 001a2 6a 00 push 0
+ 001a4 51 push ecx
+ 001a5 52 push edx
+ 001a6 8b d3 mov edx, ebx
+ 001a8 8b cf mov ecx, edi
+ 001aa e8 00 00 00 00 call _call_zseek64
+ 001af 83 c4 0c add esp, 12 ; 0000000cH
+ 001b2 85 c0 test eax, eax
+ 001b4 0f 85 7e fe ff
+ ff jne $LN61@zip64local
+
+; 604 : return 0;
+; 605 :
+; 606 : /* the signature, already checked */
+; 607 : if (zip64local_getLong(pzlib_filefunc_def,filestream,&uL)!=ZIP_OK)
+
+ 001ba 8d 45 f8 lea eax, DWORD PTR _uL$[ebp]
+ 001bd 8b d3 mov edx, ebx
+ 001bf 50 push eax
+ 001c0 8b cf mov ecx, edi
+ 001c2 e8 00 00 00 00 call _zip64local_getLong
+ 001c7 83 c4 04 add esp, 4
+ 001ca 85 c0 test eax, eax
+ 001cc 0f 85 66 fe ff
+ ff jne $LN61@zip64local
+
+; 608 : return 0;
+; 609 :
+; 610 : /* number of the disk with the start of the zip64 end of central directory */
+; 611 : if (zip64local_getLong(pzlib_filefunc_def,filestream,&uL)!=ZIP_OK)
+
+ 001d2 8d 45 f8 lea eax, DWORD PTR _uL$[ebp]
+ 001d5 8b d3 mov edx, ebx
+ 001d7 50 push eax
+ 001d8 8b cf mov ecx, edi
+ 001da e8 00 00 00 00 call _zip64local_getLong
+ 001df 83 c4 04 add esp, 4
+ 001e2 85 c0 test eax, eax
+ 001e4 0f 85 4e fe ff
+ ff jne $LN61@zip64local
+
+; 612 : return 0;
+; 613 : if (uL != 0)
+
+ 001ea 39 45 f8 cmp DWORD PTR _uL$[ebp], eax
+ 001ed 0f 85 45 fe ff
+ ff jne $LN61@zip64local
+
+; 614 : return 0;
+; 615 :
+; 616 : /* relative offset of the zip64 end of central directory record */
+; 617 : if (zip64local_getLong64(pzlib_filefunc_def,filestream,&relativeOffset)!=ZIP_OK)
+
+ 001f3 8d 45 d0 lea eax, DWORD PTR _relativeOffset$[ebp]
+ 001f6 8b d3 mov edx, ebx
+ 001f8 50 push eax
+ 001f9 8b cf mov ecx, edi
+ 001fb e8 00 00 00 00 call _zip64local_getLong64
+ 00200 83 c4 04 add esp, 4
+ 00203 85 c0 test eax, eax
+ 00205 0f 85 2d fe ff
+ ff jne $LN61@zip64local
+
+; 618 : return 0;
+; 619 :
+; 620 : /* total number of disks */
+; 621 : if (zip64local_getLong(pzlib_filefunc_def,filestream,&uL)!=ZIP_OK)
+
+ 0020b 8d 45 f8 lea eax, DWORD PTR _uL$[ebp]
+ 0020e 8b d3 mov edx, ebx
+ 00210 50 push eax
+ 00211 8b cf mov ecx, edi
+ 00213 e8 00 00 00 00 call _zip64local_getLong
+ 00218 83 c4 04 add esp, 4
+ 0021b 85 c0 test eax, eax
+ 0021d 0f 85 15 fe ff
+ ff jne $LN61@zip64local
+
+; 622 : return 0;
+; 623 : if (uL != 1)
+
+ 00223 83 7d f8 01 cmp DWORD PTR _uL$[ebp], 1
+ 00227 0f 85 0b fe ff
+ ff jne $LN61@zip64local
+
+; 624 : return 0;
+; 625 :
+; 626 : /* Goto Zip64 end of central directory record */
+; 627 : if (ZSEEK64(*pzlib_filefunc_def,filestream, relativeOffset,ZLIB_FILEFUNC_SEEK_SET)!=0)
+
+ 0022d 8b 75 d4 mov esi, DWORD PTR _relativeOffset$[ebp+4]
+ 00230 8b d3 mov edx, ebx
+ 00232 8b 7d d0 mov edi, DWORD PTR _relativeOffset$[ebp]
+ 00235 8b 5d fc mov ebx, DWORD PTR _pzlib_filefunc_def$1$[ebp]
+ 00238 8b cb mov ecx, ebx
+ 0023a 50 push eax
+ 0023b 56 push esi
+ 0023c 57 push edi
+ 0023d e8 00 00 00 00 call _call_zseek64
+ 00242 83 c4 0c add esp, 12 ; 0000000cH
+ 00245 85 c0 test eax, eax
+ 00247 0f 85 eb fd ff
+ ff jne $LN61@zip64local
+
+; 628 : return 0;
+; 629 :
+; 630 : /* the signature */
+; 631 : if (zip64local_getLong(pzlib_filefunc_def,filestream,&uL)!=ZIP_OK)
+
+ 0024d 8b 55 f4 mov edx, DWORD PTR _filestream$1$[ebp]
+ 00250 8d 45 f8 lea eax, DWORD PTR _uL$[ebp]
+ 00253 50 push eax
+ 00254 8b cb mov ecx, ebx
+ 00256 e8 00 00 00 00 call _zip64local_getLong
+ 0025b 83 c4 04 add esp, 4
+ 0025e 85 c0 test eax, eax
+ 00260 0f 85 d2 fd ff
+ ff jne $LN61@zip64local
+
+; 632 : return 0;
+; 633 :
+; 634 : if (uL != 0x06064b50) // signature of 'Zip64 end of central directory'
+
+ 00266 81 7d f8 50 4b
+ 06 06 cmp DWORD PTR _uL$[ebp], 101075792 ; 06064b50H
+ 0026d 0f 85 c5 fd ff
+ ff jne $LN61@zip64local
+
+; 635 : return 0;
+; 636 :
+; 637 : return relativeOffset;
+
+ 00273 8b c7 mov eax, edi
+ 00275 8b d6 mov edx, esi
+
+; 638 : }
+
+ 00277 5f pop edi
+ 00278 5e pop esi
+ 00279 5b pop ebx
+ 0027a 8b e5 mov esp, ebp
+ 0027c 5d pop ebp
+ 0027d c3 ret 0
+$LN53@zip64local:
+
+; 563 :
+; 564 : uBackRead = 4;
+; 565 : while (uBackRead<uMaxBack)
+
+ 0027e 8b 45 d4 mov eax, DWORD PTR _uPosFound$[ebp+4]
+ 00281 89 45 e8 mov DWORD PTR _uPosFound$1$[ebp], eax
+ 00284 8b 45 d0 mov eax, DWORD PTR _uPosFound$[ebp]
+ 00287 89 45 ec mov DWORD PTR _uPosFound$2$[ebp], eax
+ 0028a e9 f6 fe ff ff jmp $LN48@zip64local
+_zip64local_SearchCentralDir64 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _LoadCentralDirectoryRecord
+_TEXT SEGMENT
+_size_central_dir$ = -48 ; size = 8
+_number_entry_CD$ = -48 ; size = 8
+_sizeEndOfCentralDirectory$1 = -48 ; size = 8
+tv537 = -44 ; size = 4
+_VersionNeeded$ = -44 ; size = 4
+_VersionMadeBy$ = -44 ; size = 4
+_offset_central_dir$ = -40 ; size = 8
+_number_entry$ = -40 ; size = 8
+tv538 = -36 ; size = 4
+tv529 = -36 ; size = 4
+_number_entry_CD$1$ = -32 ; size = 4
+_number_entry_CD$2$ = -28 ; size = 4
+_number_entry$1$ = -24 ; size = 4
+_buf_read$1$ = -24 ; size = 4
+_size_comment$1$ = -24 ; size = 4
+_size_comment$ = -24 ; size = 4
+_read_this$2$ = -20 ; size = 4
+_offset_central_dir$1$ = -20 ; size = 4
+_number_disk_with_CD$ = -20 ; size = 4
+_byte_before_the_zipfile$2$ = -16 ; size = 4
+_byte_before_the_zipfile$1$ = -12 ; size = 4
+_size_central_dir_to_read$2$ = -8 ; size = 4
+_number_disk$ = -8 ; size = 4
+_offset_central_dir$2$ = -4 ; size = 4
+_read_this$1$ = -4 ; size = 4
+_uL$ = -4 ; size = 4
+_LoadCentralDirectoryRecord PROC ; COMDAT
+; _pziinit$ = ecx
+
+; 641 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 34 sub esp, 52 ; 00000034H
+ 00006 53 push ebx
+ 00007 56 push esi
+ 00008 8b f1 mov esi, ecx
+ 0000a 57 push edi
+
+; 642 : int err=ZIP_OK;
+
+ 0000b 33 ff xor edi, edi
+
+; 643 : ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/
+; 644 :
+; 645 : ZPOS64_T size_central_dir; /* size of the central directory */
+; 646 : ZPOS64_T offset_central_dir; /* offset of start of central directory */
+; 647 : ZPOS64_T central_pos;
+; 648 : uLong uL;
+; 649 :
+; 650 : uLong number_disk; /* number of the current dist, used for
+; 651 : spaning ZIP, unsupported, always 0*/
+; 652 : uLong number_disk_with_CD; /* number the the disk with central dir, used
+; 653 : for spaning ZIP, unsupported, always 0*/
+; 654 : ZPOS64_T number_entry;
+; 655 : ZPOS64_T number_entry_CD; /* total number of entries in
+; 656 : the central dir
+; 657 : (same than number_entry on nospan) */
+; 658 : uLong VersionMadeBy;
+; 659 : uLong VersionNeeded;
+; 660 : uLong size_comment;
+; 661 :
+; 662 : int hasZIP64Record = 0;
+; 663 :
+; 664 : // check first if we find a ZIP64 record
+; 665 : central_pos = zip64local_SearchCentralDir64(&pziinit->z_filefunc,pziinit->filestream);
+
+ 0000d 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00010 e8 00 00 00 00 call _zip64local_SearchCentralDir64
+ 00015 89 55 f4 mov DWORD PTR _byte_before_the_zipfile$1$[ebp], edx
+ 00018 8b c8 mov ecx, eax
+ 0001a 89 4d f0 mov DWORD PTR _byte_before_the_zipfile$2$[ebp], ecx
+
+; 666 : if(central_pos > 0)
+
+ 0001d 85 d2 test edx, edx
+ 0001f 0f 87 92 01 00
+ 00 ja $LN53@LoadCentra
+ 00025 72 08 jb SHORT $LN55@LoadCentra
+ 00027 85 c9 test ecx, ecx
+ 00029 0f 85 88 01 00
+ 00 jne $LN53@LoadCentra
+$LN55@LoadCentra:
+
+; 667 : {
+; 668 : hasZIP64Record = 1;
+; 669 : }
+; 670 : else if(central_pos == 0)
+
+ 0002f 0b c2 or eax, edx
+ 00031 75 12 jne SHORT $LN7@LoadCentra
+
+; 671 : {
+; 672 : central_pos = zip64local_SearchCentralDir(&pziinit->z_filefunc,pziinit->filestream);
+
+ 00033 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00036 8b ce mov ecx, esi
+ 00038 e8 00 00 00 00 call _zip64local_SearchCentralDir
+ 0003d 8b c8 mov ecx, eax
+ 0003f 89 45 f0 mov DWORD PTR _byte_before_the_zipfile$2$[ebp], eax
+ 00042 89 55 f4 mov DWORD PTR _byte_before_the_zipfile$1$[ebp], edx
+$LN7@LoadCentra:
+
+; 733 : }
+; 734 : else
+; 735 : {
+; 736 : // Read End of central Directory info
+; 737 : if (ZSEEK64(pziinit->z_filefunc, pziinit->filestream, central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0)
+
+ 00045 6a 00 push 0
+ 00047 52 push edx
+ 00048 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 0004b 51 push ecx
+ 0004c 8b ce mov ecx, esi
+ 0004e e8 00 00 00 00 call _call_zseek64
+
+; 738 : err=ZIP_ERRNO;
+; 739 :
+; 740 : /* the signature, already checked */
+; 741 : if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream,&uL)!=ZIP_OK)
+
+ 00053 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00056 83 c4 0c add esp, 12 ; 0000000cH
+ 00059 83 cb ff or ebx, -1
+ 0005c 8b ce mov ecx, esi
+ 0005e 85 c0 test eax, eax
+ 00060 8d 45 fc lea eax, DWORD PTR _uL$[ebp]
+ 00063 50 push eax
+ 00064 0f 45 fb cmovne edi, ebx
+ 00067 e8 00 00 00 00 call _zip64local_getLong
+
+; 742 : err=ZIP_ERRNO;
+; 743 :
+; 744 : /* number of this disk */
+; 745 : if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream,&number_disk)!=ZIP_OK)
+
+ 0006c 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 0006f 83 c4 04 add esp, 4
+ 00072 85 c0 test eax, eax
+ 00074 8b ce mov ecx, esi
+ 00076 8d 45 f8 lea eax, DWORD PTR _number_disk$[ebp]
+ 00079 0f 45 fb cmovne edi, ebx
+ 0007c 50 push eax
+ 0007d e8 00 00 00 00 call _zip64local_getShort
+
+; 746 : err=ZIP_ERRNO;
+; 747 :
+; 748 : /* number of the disk with the start of the central directory */
+; 749 : if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream,&number_disk_with_CD)!=ZIP_OK)
+
+ 00082 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00085 83 c4 04 add esp, 4
+ 00088 85 c0 test eax, eax
+ 0008a 8b ce mov ecx, esi
+ 0008c 8d 45 ec lea eax, DWORD PTR _number_disk_with_CD$[ebp]
+ 0008f 0f 45 fb cmovne edi, ebx
+ 00092 50 push eax
+ 00093 e8 00 00 00 00 call _zip64local_getShort
+
+; 750 : err=ZIP_ERRNO;
+; 751 :
+; 752 : /* total number of entries in the central dir on this disk */
+; 753 : number_entry = 0;
+; 754 : if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream, &uL)!=ZIP_OK)
+
+ 00098 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 0009b 83 c4 04 add esp, 4
+ 0009e 85 c0 test eax, eax
+ 000a0 0f 57 c0 xorps xmm0, xmm0
+ 000a3 8d 45 fc lea eax, DWORD PTR _uL$[ebp]
+ 000a6 66 0f 13 45 d8 movlpd QWORD PTR _number_entry$[ebp], xmm0
+ 000ab 8b ce mov ecx, esi
+ 000ad 0f 45 fb cmovne edi, ebx
+ 000b0 50 push eax
+ 000b1 e8 00 00 00 00 call _zip64local_getShort
+ 000b6 83 c4 04 add esp, 4
+ 000b9 85 c0 test eax, eax
+ 000bb 74 0d je SHORT $LN26@LoadCentra
+
+; 755 : err=ZIP_ERRNO;
+
+ 000bd 8b 45 dc mov eax, DWORD PTR _number_entry$[ebp+4]
+ 000c0 0b fb or edi, ebx
+ 000c2 8b 5d d8 mov ebx, DWORD PTR _number_entry$[ebp]
+ 000c5 89 45 e8 mov DWORD PTR _number_entry$1$[ebp], eax
+ 000c8 eb 0a jmp SHORT $LN27@LoadCentra
+$LN26@LoadCentra:
+
+; 756 : else
+; 757 : number_entry = uL;
+
+ 000ca 8b 5d fc mov ebx, DWORD PTR _uL$[ebp]
+ 000cd c7 45 e8 00 00
+ 00 00 mov DWORD PTR _number_entry$1$[ebp], 0
+$LN27@LoadCentra:
+
+; 758 :
+; 759 : /* total number of entries in the central dir */
+; 760 : number_entry_CD = 0;
+; 761 : if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream, &uL)!=ZIP_OK)
+
+ 000d4 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 000d7 8d 45 fc lea eax, DWORD PTR _uL$[ebp]
+ 000da 0f 57 c0 xorps xmm0, xmm0
+ 000dd 8b ce mov ecx, esi
+ 000df 50 push eax
+ 000e0 66 0f 13 45 d0 movlpd QWORD PTR _number_entry_CD$[ebp], xmm0
+ 000e5 e8 00 00 00 00 call _zip64local_getShort
+ 000ea 83 c4 04 add esp, 4
+ 000ed 85 c0 test eax, eax
+ 000ef 74 0b je SHORT $LN28@LoadCentra
+
+; 762 : err=ZIP_ERRNO;
+
+ 000f1 8b 45 d4 mov eax, DWORD PTR _number_entry_CD$[ebp+4]
+ 000f4 83 cf ff or edi, -1
+ 000f7 8b 4d d0 mov ecx, DWORD PTR _number_entry_CD$[ebp]
+ 000fa eb 05 jmp SHORT $LN66@LoadCentra
+$LN28@LoadCentra:
+
+; 763 : else
+; 764 : number_entry_CD = uL;
+
+ 000fc 8b 4d fc mov ecx, DWORD PTR _uL$[ebp]
+ 000ff 33 c0 xor eax, eax
+$LN66@LoadCentra:
+ 00101 89 45 e0 mov DWORD PTR _number_entry_CD$1$[ebp], eax
+ 00104 89 4d e4 mov DWORD PTR _number_entry_CD$2$[ebp], ecx
+
+; 765 :
+; 766 : if ((number_entry_CD!=number_entry) || (number_disk_with_CD!=0) || (number_disk!=0))
+
+ 00107 3b cb cmp ecx, ebx
+ 00109 75 11 jne SHORT $LN31@LoadCentra
+ 0010b 3b 45 e8 cmp eax, DWORD PTR _number_entry$1$[ebp]
+ 0010e 75 0c jne SHORT $LN31@LoadCentra
+ 00110 83 7d ec 00 cmp DWORD PTR _number_disk_with_CD$[ebp], 0
+ 00114 75 06 jne SHORT $LN31@LoadCentra
+ 00116 83 7d f8 00 cmp DWORD PTR _number_disk$[ebp], 0
+ 0011a 74 05 je SHORT $LN30@LoadCentra
+$LN31@LoadCentra:
+
+; 767 : err=ZIP_BADZIPFILE;
+
+ 0011c bf 99 ff ff ff mov edi, -103 ; ffffff99H
+$LN30@LoadCentra:
+
+; 768 :
+; 769 : /* size of the central directory */
+; 770 : size_central_dir = 0;
+; 771 : if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream, &uL)!=ZIP_OK)
+
+ 00121 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00124 8d 45 fc lea eax, DWORD PTR _uL$[ebp]
+ 00127 0f 57 c0 xorps xmm0, xmm0
+ 0012a 8b ce mov ecx, esi
+ 0012c 50 push eax
+ 0012d 66 0f 13 45 d0 movlpd QWORD PTR _size_central_dir$[ebp], xmm0
+ 00132 e8 00 00 00 00 call _zip64local_getLong
+ 00137 83 c4 04 add esp, 4
+ 0013a 85 c0 test eax, eax
+ 0013c 74 0e je SHORT $LN32@LoadCentra
+
+; 772 : err=ZIP_ERRNO;
+
+ 0013e 8b 45 d4 mov eax, DWORD PTR _size_central_dir$[ebp+4]
+ 00141 83 cf ff or edi, -1
+ 00144 8b 5d d0 mov ebx, DWORD PTR _size_central_dir$[ebp]
+ 00147 89 45 f8 mov DWORD PTR _size_central_dir_to_read$2$[ebp], eax
+ 0014a eb 0a jmp SHORT $LN33@LoadCentra
+$LN32@LoadCentra:
+
+; 773 : else
+; 774 : size_central_dir = uL;
+
+ 0014c 8b 5d fc mov ebx, DWORD PTR _uL$[ebp]
+ 0014f c7 45 f8 00 00
+ 00 00 mov DWORD PTR _size_central_dir_to_read$2$[ebp], 0
+$LN33@LoadCentra:
+
+; 775 :
+; 776 : /* offset of start of central directory with respect to the starting disk number */
+; 777 : offset_central_dir = 0;
+; 778 : if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream, &uL)!=ZIP_OK)
+
+ 00156 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00159 8d 45 fc lea eax, DWORD PTR _uL$[ebp]
+ 0015c 0f 57 c0 xorps xmm0, xmm0
+ 0015f 8b ce mov ecx, esi
+ 00161 50 push eax
+ 00162 66 0f 13 45 d8 movlpd QWORD PTR _offset_central_dir$[ebp], xmm0
+ 00167 e8 00 00 00 00 call _zip64local_getLong
+ 0016c 83 c4 04 add esp, 4
+ 0016f 85 c0 test eax, eax
+ 00171 74 0e je SHORT $LN34@LoadCentra
+
+; 779 : err=ZIP_ERRNO;
+
+ 00173 8b 45 dc mov eax, DWORD PTR _offset_central_dir$[ebp+4]
+ 00176 83 cf ff or edi, -1
+ 00179 89 45 ec mov DWORD PTR _offset_central_dir$1$[ebp], eax
+ 0017c 8b 45 d8 mov eax, DWORD PTR _offset_central_dir$[ebp]
+ 0017f eb 0a jmp SHORT $LN67@LoadCentra
+$LN34@LoadCentra:
+
+; 780 : else
+; 781 : offset_central_dir = uL;
+
+ 00181 8b 45 fc mov eax, DWORD PTR _uL$[ebp]
+ 00184 c7 45 ec 00 00
+ 00 00 mov DWORD PTR _offset_central_dir$1$[ebp], 0
+$LN67@LoadCentra:
+
+; 782 :
+; 783 :
+; 784 : /* zipfile global comment length */
+; 785 : if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream, &size_comment)!=ZIP_OK)
+
+ 0018b 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 0018e 8b ce mov ecx, esi
+ 00190 89 45 fc mov DWORD PTR _offset_central_dir$2$[ebp], eax
+ 00193 8d 45 e8 lea eax, DWORD PTR _size_comment$[ebp]
+ 00196 50 push eax
+ 00197 e8 00 00 00 00 call _zip64local_getShort
+ 0019c 8b 55 e8 mov edx, DWORD PTR _size_comment$[ebp]
+ 0019f 83 c4 04 add esp, 4
+ 001a2 8b 4d fc mov ecx, DWORD PTR _offset_central_dir$2$[ebp]
+ 001a5 85 c0 test eax, eax
+ 001a7 b8 ff ff ff ff mov eax, -1
+ 001ac 0f 45 f8 cmovne edi, eax
+ 001af 8b 45 ec mov eax, DWORD PTR _offset_central_dir$1$[ebp]
+ 001b2 e9 33 01 00 00 jmp $LN68@LoadCentra
+$LN53@LoadCentra:
+
+; 673 : }
+; 674 :
+; 675 : /* disable to allow appending to empty ZIP archive
+; 676 : if (central_pos==0)
+; 677 : err=ZIP_ERRNO;
+; 678 : */
+; 679 :
+; 680 : if(hasZIP64Record)
+; 681 : {
+; 682 : ZPOS64_T sizeEndOfCentralDirectory;
+; 683 : if (ZSEEK64(pziinit->z_filefunc, pziinit->filestream, central_pos, ZLIB_FILEFUNC_SEEK_SET) != 0)
+
+ 001b7 6a 00 push 0
+ 001b9 52 push edx
+ 001ba 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 001bd 51 push ecx
+ 001be 8b ce mov ecx, esi
+ 001c0 e8 00 00 00 00 call _call_zseek64
+
+; 684 : err=ZIP_ERRNO;
+; 685 :
+; 686 : /* the signature, already checked */
+; 687 : if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream,&uL)!=ZIP_OK)
+
+ 001c5 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 001c8 83 c4 0c add esp, 12 ; 0000000cH
+ 001cb 83 cb ff or ebx, -1
+ 001ce 8b ce mov ecx, esi
+ 001d0 85 c0 test eax, eax
+ 001d2 8d 45 fc lea eax, DWORD PTR _uL$[ebp]
+ 001d5 50 push eax
+ 001d6 0f 45 fb cmovne edi, ebx
+ 001d9 e8 00 00 00 00 call _zip64local_getLong
+
+; 688 : err=ZIP_ERRNO;
+; 689 :
+; 690 : /* size of zip64 end of central directory record */
+; 691 : if (zip64local_getLong64(&pziinit->z_filefunc, pziinit->filestream, &sizeEndOfCentralDirectory)!=ZIP_OK)
+
+ 001de 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 001e1 83 c4 04 add esp, 4
+ 001e4 85 c0 test eax, eax
+ 001e6 8b ce mov ecx, esi
+ 001e8 8d 45 d0 lea eax, DWORD PTR _sizeEndOfCentralDirectory$1[ebp]
+ 001eb 0f 45 fb cmovne edi, ebx
+ 001ee 50 push eax
+ 001ef e8 00 00 00 00 call _zip64local_getLong64
+
+; 692 : err=ZIP_ERRNO;
+; 693 :
+; 694 : /* version made by */
+; 695 : if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream, &VersionMadeBy)!=ZIP_OK)
+
+ 001f4 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 001f7 83 c4 04 add esp, 4
+ 001fa 85 c0 test eax, eax
+ 001fc 8b ce mov ecx, esi
+ 001fe 8d 45 d4 lea eax, DWORD PTR _VersionMadeBy$[ebp]
+ 00201 0f 45 fb cmovne edi, ebx
+ 00204 50 push eax
+ 00205 e8 00 00 00 00 call _zip64local_getShort
+
+; 696 : err=ZIP_ERRNO;
+; 697 :
+; 698 : /* version needed to extract */
+; 699 : if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream, &VersionNeeded)!=ZIP_OK)
+
+ 0020a 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 0020d 83 c4 04 add esp, 4
+ 00210 85 c0 test eax, eax
+ 00212 8b ce mov ecx, esi
+ 00214 8d 45 d4 lea eax, DWORD PTR _VersionNeeded$[ebp]
+ 00217 0f 45 fb cmovne edi, ebx
+ 0021a 50 push eax
+ 0021b e8 00 00 00 00 call _zip64local_getShort
+
+; 700 : err=ZIP_ERRNO;
+; 701 :
+; 702 : /* number of this disk */
+; 703 : if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream,&number_disk)!=ZIP_OK)
+
+ 00220 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00223 83 c4 04 add esp, 4
+ 00226 85 c0 test eax, eax
+ 00228 8b ce mov ecx, esi
+ 0022a 8d 45 f8 lea eax, DWORD PTR _number_disk$[ebp]
+ 0022d 0f 45 fb cmovne edi, ebx
+ 00230 50 push eax
+ 00231 e8 00 00 00 00 call _zip64local_getLong
+
+; 704 : err=ZIP_ERRNO;
+; 705 :
+; 706 : /* number of the disk with the start of the central directory */
+; 707 : if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream,&number_disk_with_CD)!=ZIP_OK)
+
+ 00236 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00239 83 c4 04 add esp, 4
+ 0023c 85 c0 test eax, eax
+ 0023e 8b ce mov ecx, esi
+ 00240 8d 45 ec lea eax, DWORD PTR _number_disk_with_CD$[ebp]
+ 00243 0f 45 fb cmovne edi, ebx
+ 00246 50 push eax
+ 00247 e8 00 00 00 00 call _zip64local_getLong
+
+; 708 : err=ZIP_ERRNO;
+; 709 :
+; 710 : /* total number of entries in the central directory on this disk */
+; 711 : if (zip64local_getLong64(&pziinit->z_filefunc, pziinit->filestream, &number_entry)!=ZIP_OK)
+
+ 0024c 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 0024f 83 c4 04 add esp, 4
+ 00252 85 c0 test eax, eax
+ 00254 8b ce mov ecx, esi
+ 00256 8d 45 d8 lea eax, DWORD PTR _number_entry$[ebp]
+ 00259 0f 45 fb cmovne edi, ebx
+ 0025c 50 push eax
+ 0025d e8 00 00 00 00 call _zip64local_getLong64
+
+; 712 : err=ZIP_ERRNO;
+; 713 :
+; 714 : /* total number of entries in the central directory */
+; 715 : if (zip64local_getLong64(&pziinit->z_filefunc, pziinit->filestream,&number_entry_CD)!=ZIP_OK)
+
+ 00262 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00265 83 c4 04 add esp, 4
+ 00268 85 c0 test eax, eax
+ 0026a 8b ce mov ecx, esi
+ 0026c 8d 45 d0 lea eax, DWORD PTR _number_entry_CD$[ebp]
+ 0026f 0f 45 fb cmovne edi, ebx
+ 00272 50 push eax
+ 00273 e8 00 00 00 00 call _zip64local_getLong64
+ 00278 83 c4 04 add esp, 4
+ 0027b 85 c0 test eax, eax
+
+; 716 : err=ZIP_ERRNO;
+; 717 :
+; 718 : if ((number_entry_CD!=number_entry) || (number_disk_with_CD!=0) || (number_disk!=0))
+
+ 0027d 8b 45 d0 mov eax, DWORD PTR _number_entry_CD$[ebp]
+ 00280 0f 45 fb cmovne edi, ebx
+ 00283 89 45 e4 mov DWORD PTR _number_entry_CD$2$[ebp], eax
+ 00286 3b 45 d8 cmp eax, DWORD PTR _number_entry$[ebp]
+ 00289 8b 45 d4 mov eax, DWORD PTR _number_entry_CD$[ebp+4]
+ 0028c 89 45 e0 mov DWORD PTR _number_entry_CD$1$[ebp], eax
+ 0028f 75 11 jne SHORT $LN19@LoadCentra
+ 00291 3b 45 dc cmp eax, DWORD PTR _number_entry$[ebp+4]
+ 00294 75 0c jne SHORT $LN19@LoadCentra
+ 00296 83 7d ec 00 cmp DWORD PTR _number_disk_with_CD$[ebp], 0
+ 0029a 75 06 jne SHORT $LN19@LoadCentra
+ 0029c 83 7d f8 00 cmp DWORD PTR _number_disk$[ebp], 0
+ 002a0 74 05 je SHORT $LN18@LoadCentra
+$LN19@LoadCentra:
+
+; 719 : err=ZIP_BADZIPFILE;
+
+ 002a2 bf 99 ff ff ff mov edi, -103 ; ffffff99H
+$LN18@LoadCentra:
+
+; 720 :
+; 721 : /* size of the central directory */
+; 722 : if (zip64local_getLong64(&pziinit->z_filefunc, pziinit->filestream,&size_central_dir)!=ZIP_OK)
+
+ 002a7 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 002aa 8d 45 d0 lea eax, DWORD PTR _size_central_dir$[ebp]
+ 002ad 50 push eax
+ 002ae 8b ce mov ecx, esi
+ 002b0 e8 00 00 00 00 call _zip64local_getLong64
+
+; 723 : err=ZIP_ERRNO;
+; 724 :
+; 725 : /* offset of start of central directory with respect to the
+; 726 : starting disk number */
+; 727 : if (zip64local_getLong64(&pziinit->z_filefunc, pziinit->filestream,&offset_central_dir)!=ZIP_OK)
+
+ 002b5 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 002b8 83 c4 04 add esp, 4
+ 002bb 85 c0 test eax, eax
+ 002bd 8b ce mov ecx, esi
+ 002bf 8d 45 d8 lea eax, DWORD PTR _offset_central_dir$[ebp]
+ 002c2 0f 45 fb cmovne edi, ebx
+ 002c5 50 push eax
+ 002c6 e8 00 00 00 00 call _zip64local_getLong64
+
+; 728 : err=ZIP_ERRNO;
+; 729 :
+; 730 : // TODO..
+; 731 : // read the comment from the standard central header.
+; 732 : size_comment = 0;
+
+ 002cb 8b 4d d8 mov ecx, DWORD PTR _offset_central_dir$[ebp]
+ 002ce 83 c4 04 add esp, 4
+ 002d1 85 c0 test eax, eax
+ 002d3 89 4d fc mov DWORD PTR _offset_central_dir$2$[ebp], ecx
+ 002d6 8b 45 d4 mov eax, DWORD PTR _size_central_dir$[ebp+4]
+ 002d9 0f 45 fb cmovne edi, ebx
+ 002dc 89 45 f8 mov DWORD PTR _size_central_dir_to_read$2$[ebp], eax
+ 002df 8b 45 dc mov eax, DWORD PTR _offset_central_dir$[ebp+4]
+ 002e2 33 d2 xor edx, edx
+ 002e4 8b 5d d0 mov ebx, DWORD PTR _size_central_dir$[ebp]
+ 002e7 89 45 ec mov DWORD PTR _offset_central_dir$1$[ebp], eax
+$LN68@LoadCentra:
+
+; 786 : err=ZIP_ERRNO;
+; 787 : }
+; 788 :
+; 789 : if ((central_pos<offset_central_dir+size_central_dir) &&
+
+ 002ea 03 cb add ecx, ebx
+ 002ec 89 55 e8 mov DWORD PTR _size_comment$1$[ebp], edx
+ 002ef 89 4d dc mov DWORD PTR tv529[ebp], ecx
+ 002f2 13 45 f8 adc eax, DWORD PTR _size_central_dir_to_read$2$[ebp]
+ 002f5 8b 4d f4 mov ecx, DWORD PTR _byte_before_the_zipfile$1$[ebp]
+ 002f8 3b c8 cmp ecx, eax
+ 002fa 0f 82 8b 01 00
+ 00 jb $LN52@LoadCentra
+ 00300 77 0c ja SHORT $LN56@LoadCentra
+ 00302 8b 45 dc mov eax, DWORD PTR tv529[ebp]
+ 00305 39 45 f0 cmp DWORD PTR _byte_before_the_zipfile$2$[ebp], eax
+ 00308 0f 82 7d 01 00
+ 00 jb $LN52@LoadCentra
+$LN56@LoadCentra:
+
+; 790 : (err==ZIP_OK))
+; 791 : err=ZIP_BADZIPFILE;
+; 792 :
+; 793 : if (err!=ZIP_OK)
+
+ 0030e 85 ff test edi, edi
+ 00310 0f 85 75 01 00
+ 00 jne $LN52@LoadCentra
+
+; 797 : }
+; 798 :
+; 799 : if (size_comment>0)
+
+ 00316 85 d2 test edx, edx
+ 00318 74 36 je SHORT $LN40@LoadCentra
+
+; 800 : {
+; 801 : pziinit->globalcomment = (char*)ALLOC(size_comment+1);
+
+ 0031a 8d 42 01 lea eax, DWORD PTR [edx+1]
+ 0031d 50 push eax
+ 0031e ff 15 00 00 00
+ 00 call DWORD PTR __imp__malloc
+ 00324 83 c4 04 add esp, 4
+ 00327 89 86 00 01 01
+ 00 mov DWORD PTR [esi+65792], eax
+
+; 802 : if (pziinit->globalcomment)
+
+ 0032d 85 c0 test eax, eax
+ 0032f 74 1c je SHORT $LN65@LoadCentra
+
+; 803 : {
+; 804 : size_comment = ZREAD64(pziinit->z_filefunc, pziinit->filestream, pziinit->globalcomment,size_comment);
+
+ 00331 ff 75 e8 push DWORD PTR _size_comment$1$[ebp]
+ 00334 50 push eax
+ 00335 ff 76 2c push DWORD PTR [esi+44]
+ 00338 8b 46 04 mov eax, DWORD PTR [esi+4]
+ 0033b ff 76 1c push DWORD PTR [esi+28]
+ 0033e ff d0 call eax
+
+; 805 : pziinit->globalcomment[size_comment]=0;
+
+ 00340 8b 8e 00 01 01
+ 00 mov ecx, DWORD PTR [esi+65792]
+ 00346 83 c4 10 add esp, 16 ; 00000010H
+ 00349 c6 04 08 00 mov BYTE PTR [eax+ecx], 0
+$LN65@LoadCentra:
+ 0034d 8b 4d f4 mov ecx, DWORD PTR _byte_before_the_zipfile$1$[ebp]
+$LN40@LoadCentra:
+
+; 806 : }
+; 807 : }
+; 808 :
+; 809 : byte_before_the_zipfile = central_pos - (offset_central_dir+size_central_dir);
+
+ 00350 8b 45 f0 mov eax, DWORD PTR _byte_before_the_zipfile$2$[ebp]
+ 00353 2b 45 fc sub eax, DWORD PTR _offset_central_dir$2$[ebp]
+
+; 810 : pziinit->add_position_when_writting_offset = byte_before_the_zipfile;
+; 811 :
+; 812 : {
+; 813 : ZPOS64_T size_central_dir_to_read = size_central_dir;
+; 814 : size_t buf_size = SIZEDATA_INDATABLOCK;
+; 815 : void* buf_read = (void*)ALLOC(buf_size);
+
+ 00356 68 f0 0f 00 00 push 4080 ; 00000ff0H
+ 0035b 1b 4d ec sbb ecx, DWORD PTR _offset_central_dir$1$[ebp]
+ 0035e 2b c3 sub eax, ebx
+ 00360 89 45 f0 mov DWORD PTR _byte_before_the_zipfile$2$[ebp], eax
+ 00363 1b 4d f8 sbb ecx, DWORD PTR _size_central_dir_to_read$2$[ebp]
+ 00366 89 4d f4 mov DWORD PTR _byte_before_the_zipfile$1$[ebp], ecx
+ 00369 89 86 f0 00 01
+ 00 mov DWORD PTR [esi+65776], eax
+ 0036f 89 8e f4 00 01
+ 00 mov DWORD PTR [esi+65780], ecx
+ 00375 ff 15 00 00 00
+ 00 call DWORD PTR __imp__malloc
+
+; 816 : if (ZSEEK64(pziinit->z_filefunc, pziinit->filestream, offset_central_dir + byte_before_the_zipfile, ZLIB_FILEFUNC_SEEK_SET) != 0)
+
+ 0037b 8b 4d f0 mov ecx, DWORD PTR _byte_before_the_zipfile$2$[ebp]
+ 0037e 83 c4 04 add esp, 4
+ 00381 03 4d fc add ecx, DWORD PTR _offset_central_dir$2$[ebp]
+ 00384 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00387 89 45 e8 mov DWORD PTR _buf_read$1$[ebp], eax
+ 0038a 8b 45 f4 mov eax, DWORD PTR _byte_before_the_zipfile$1$[ebp]
+ 0038d 13 45 ec adc eax, DWORD PTR _offset_central_dir$1$[ebp]
+ 00390 6a 00 push 0
+ 00392 50 push eax
+ 00393 89 4d d4 mov DWORD PTR tv537[ebp], ecx
+ 00396 51 push ecx
+ 00397 8b ce mov ecx, esi
+ 00399 89 45 dc mov DWORD PTR tv538[ebp], eax
+ 0039c e8 00 00 00 00 call _call_zseek64
+ 003a1 83 c4 0c add esp, 12 ; 0000000cH
+ 003a4 85 c0 test eax, eax
+ 003a6 b8 ff ff ff ff mov eax, -1
+ 003ab 0f 45 f8 cmovne edi, eax
+
+; 817 : err=ZIP_ERRNO;
+; 818 :
+; 819 : while ((size_central_dir_to_read>0) && (err==ZIP_OK))
+
+ 003ae 8b 45 f8 mov eax, DWORD PTR _size_central_dir_to_read$2$[ebp]
+ 003b1 85 c0 test eax, eax
+ 003b3 75 0b jne SHORT $LL2@LoadCentra
+ 003b5 85 db test ebx, ebx
+ 003b7 74 75 je SHORT $LN60@LoadCentra
+ 003b9 0f 1f 80 00 00
+ 00 00 npad 7
+$LL2@LoadCentra:
+ 003c0 85 ff test edi, edi
+ 003c2 75 6a jne SHORT $LN60@LoadCentra
+
+; 820 : {
+; 821 : ZPOS64_T read_this = SIZEDATA_INDATABLOCK;
+
+ 003c4 c7 45 ec 00 00
+ 00 00 mov DWORD PTR _read_this$2$[ebp], 0
+ 003cb bf f0 0f 00 00 mov edi, 4080 ; 00000ff0H
+ 003d0 89 7d fc mov DWORD PTR _read_this$1$[ebp], edi
+
+; 822 : if (read_this > size_central_dir_to_read)
+
+ 003d3 85 c0 test eax, eax
+ 003d5 77 0e ja SHORT $LN42@LoadCentra
+ 003d7 72 04 jb SHORT $LN58@LoadCentra
+ 003d9 3b df cmp ebx, edi
+ 003db 73 08 jae SHORT $LN42@LoadCentra
+$LN58@LoadCentra:
+
+; 823 : read_this = size_central_dir_to_read;
+
+ 003dd 8b fb mov edi, ebx
+ 003df 89 5d fc mov DWORD PTR _read_this$1$[ebp], ebx
+ 003e2 89 45 ec mov DWORD PTR _read_this$2$[ebp], eax
+$LN42@LoadCentra:
+
+; 824 :
+; 825 : if (ZREAD64(pziinit->z_filefunc, pziinit->filestream,buf_read,(uLong)read_this) != read_this)
+
+ 003e5 8b 46 04 mov eax, DWORD PTR [esi+4]
+ 003e8 57 push edi
+ 003e9 ff 75 e8 push DWORD PTR _buf_read$1$[ebp]
+ 003ec ff 76 2c push DWORD PTR [esi+44]
+ 003ef ff 76 1c push DWORD PTR [esi+28]
+ 003f2 ff d0 call eax
+ 003f4 83 c4 10 add esp, 16 ; 00000010H
+ 003f7 33 c9 xor ecx, ecx
+ 003f9 3b c7 cmp eax, edi
+ 003fb 75 18 jne SHORT $LN59@LoadCentra
+ 003fd 3b 4d ec cmp ecx, DWORD PTR _read_this$2$[ebp]
+ 00400 75 13 jne SHORT $LN59@LoadCentra
+
+; 827 :
+; 828 : if (err==ZIP_OK)
+; 829 : err = add_data_in_datablock(&pziinit->central_dir,buf_read, (uLong)read_this);
+
+ 00402 8b 55 e8 mov edx, DWORD PTR _buf_read$1$[ebp]
+ 00405 8d 4e 30 lea ecx, DWORD PTR [esi+48]
+ 00408 57 push edi
+ 00409 e8 00 00 00 00 call _add_data_in_datablock
+ 0040e 83 c4 04 add esp, 4
+ 00411 8b f8 mov edi, eax
+ 00413 eb 03 jmp SHORT $LN44@LoadCentra
+$LN59@LoadCentra:
+
+; 826 : err=ZIP_ERRNO;
+
+ 00415 83 cf ff or edi, -1
+$LN44@LoadCentra:
+
+; 830 :
+; 831 : size_central_dir_to_read-=read_this;
+
+ 00418 2b 5d fc sub ebx, DWORD PTR _read_this$1$[ebp]
+ 0041b 8b 45 f8 mov eax, DWORD PTR _size_central_dir_to_read$2$[ebp]
+ 0041e 1b 45 ec sbb eax, DWORD PTR _read_this$2$[ebp]
+ 00421 89 45 f8 mov DWORD PTR _size_central_dir_to_read$2$[ebp], eax
+ 00424 85 c0 test eax, eax
+ 00426 77 98 ja SHORT $LL2@LoadCentra
+
+; 817 : err=ZIP_ERRNO;
+; 818 :
+; 819 : while ((size_central_dir_to_read>0) && (err==ZIP_OK))
+
+ 00428 72 04 jb SHORT $LN60@LoadCentra
+ 0042a 85 db test ebx, ebx
+ 0042c 75 92 jne SHORT $LL2@LoadCentra
+$LN60@LoadCentra:
+
+; 832 : }
+; 833 : TRYFREE(buf_read);
+
+ 0042e 8b 45 e8 mov eax, DWORD PTR _buf_read$1$[ebp]
+ 00431 85 c0 test eax, eax
+ 00433 74 0a je SHORT $LN45@LoadCentra
+ 00435 50 push eax
+ 00436 ff 15 00 00 00
+ 00 call DWORD PTR __imp__free
+ 0043c 83 c4 04 add esp, 4
+$LN45@LoadCentra:
+
+; 834 : }
+; 835 : pziinit->begin_pos = byte_before_the_zipfile;
+
+ 0043f 8b 45 f0 mov eax, DWORD PTR _byte_before_the_zipfile$2$[ebp]
+
+; 836 : pziinit->number_entry = number_entry_CD;
+; 837 :
+; 838 : if (ZSEEK64(pziinit->z_filefunc, pziinit->filestream, offset_central_dir+byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET) != 0)
+
+ 00442 8b ce mov ecx, esi
+ 00444 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00447 89 86 e8 00 01
+ 00 mov DWORD PTR [esi+65768], eax
+ 0044d 8b 45 f4 mov eax, DWORD PTR _byte_before_the_zipfile$1$[ebp]
+ 00450 6a 00 push 0
+ 00452 ff 75 dc push DWORD PTR tv538[ebp]
+ 00455 89 86 ec 00 01
+ 00 mov DWORD PTR [esi+65772], eax
+ 0045b 8b 45 e4 mov eax, DWORD PTR _number_entry_CD$2$[ebp]
+ 0045e ff 75 d4 push DWORD PTR tv537[ebp]
+ 00461 89 86 f8 00 01
+ 00 mov DWORD PTR [esi+65784], eax
+ 00467 8b 45 e0 mov eax, DWORD PTR _number_entry_CD$1$[ebp]
+ 0046a 89 86 fc 00 01
+ 00 mov DWORD PTR [esi+65788], eax
+ 00470 e8 00 00 00 00 call _call_zseek64
+ 00475 83 c4 0c add esp, 12 ; 0000000cH
+ 00478 85 c0 test eax, eax
+ 0047a b8 ff ff ff ff mov eax, -1
+ 0047f 0f 45 f8 cmovne edi, eax
+
+; 839 : err=ZIP_ERRNO;
+; 840 :
+; 841 : return err;
+
+ 00482 8b c7 mov eax, edi
+
+; 842 : }
+
+ 00484 5f pop edi
+ 00485 5e pop esi
+ 00486 5b pop ebx
+ 00487 8b e5 mov esp, ebp
+ 00489 5d pop ebp
+ 0048a c3 ret 0
+$LN52@LoadCentra:
+
+; 794 : {
+; 795 : ZCLOSE64(pziinit->z_filefunc, pziinit->filestream);
+
+ 0048b ff 76 2c push DWORD PTR [esi+44]
+ 0048e 8b 4e 14 mov ecx, DWORD PTR [esi+20]
+ 00491 ff 76 1c push DWORD PTR [esi+28]
+ 00494 ff d1 call ecx
+ 00496 83 c4 08 add esp, 8
+
+; 796 : return ZIP_ERRNO;
+
+ 00499 83 c8 ff or eax, -1
+
+; 842 : }
+
+ 0049c 5f pop edi
+ 0049d 5e pop esi
+ 0049e 5b pop ebx
+ 0049f 8b e5 mov esp, ebp
+ 004a1 5d pop ebp
+ 004a2 c3 ret 0
+_LoadCentralDirectoryRecord ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _zipOpen3@16
+_TEXT SEGMENT
+_ziinit$ = -65800 ; size = 65800
+_globalcomment$ = 8 ; size = 4
+_pzlib_filefunc64_32_def$ = 12 ; size = 4
+_zipOpen3@16 PROC ; COMDAT
+; _pathname$ = ecx
+; _append$ = edx
+
+; 850 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 e4 f8 and esp, -8 ; fffffff8H
+ 00006 b8 0c 01 01 00 mov eax, 65804 ; 0001010cH
+ 0000b e8 00 00 00 00 call __chkstk
+
+; 851 : zip64_internal ziinit;
+; 852 : zip64_internal* zi;
+; 853 : int err=ZIP_OK;
+; 854 :
+; 855 : ziinit.z_filefunc.zseek32_file = NULL;
+; 856 : ziinit.z_filefunc.ztell32_file = NULL;
+; 857 : if (pzlib_filefunc64_32_def==NULL)
+
+ 00010 8b 45 0c mov eax, DWORD PTR _pzlib_filefunc64_32_def$[ebp]
+ 00013 53 push ebx
+ 00014 56 push esi
+ 00015 33 db xor ebx, ebx
+ 00017 89 5c 24 34 mov DWORD PTR _ziinit$[esp+65852], ebx
+ 0001b 89 5c 24 30 mov DWORD PTR _ziinit$[esp+65848], ebx
+ 0001f 57 push edi
+ 00020 8b fa mov edi, edx
+ 00022 8b d1 mov edx, ecx
+ 00024 85 c0 test eax, eax
+ 00026 75 0b jne SHORT $LN2@zipOpen3
+
+; 858 : fill_fopen64_filefunc(&ziinit.z_filefunc.zfile_func64);
+
+ 00028 8d 4c 24 10 lea ecx, DWORD PTR _ziinit$[esp+65816]
+ 0002c e8 00 00 00 00 call _fill_fopen64_filefunc
+ 00031 eb 23 jmp SHORT $LN3@zipOpen3
+$LN2@zipOpen3:
+
+; 859 : else
+; 860 : ziinit.z_filefunc = *pzlib_filefunc64_32_def;
+
+ 00033 0f 10 00 movups xmm0, XMMWORD PTR [eax]
+ 00036 0f 11 44 24 10 movups XMMWORD PTR _ziinit$[esp+65816], xmm0
+ 0003b 0f 10 40 10 movups xmm0, XMMWORD PTR [eax+16]
+ 0003f 0f 11 44 24 20 movups XMMWORD PTR _ziinit$[esp+65832], xmm0
+ 00044 f3 0f 7e 40 20 movq xmm0, QWORD PTR [eax+32]
+ 00049 8b 40 28 mov eax, DWORD PTR [eax+40]
+ 0004c 66 0f d6 44 24
+ 30 movq QWORD PTR _ziinit$[esp+65848], xmm0
+ 00052 89 44 24 38 mov DWORD PTR _ziinit$[esp+65856], eax
+$LN3@zipOpen3:
+
+; 861 :
+; 862 : ziinit.filestream = ZOPEN64(ziinit.z_filefunc,
+
+ 00056 33 c0 xor eax, eax
+ 00058 8d 4c 24 10 lea ecx, DWORD PTR _ziinit$[esp+65816]
+ 0005c 85 ff test edi, edi
+ 0005e 0f 94 c0 sete al
+ 00061 8d 04 85 07 00
+ 00 00 lea eax, DWORD PTR [eax*4+7]
+ 00068 50 push eax
+ 00069 e8 00 00 00 00 call _call_zopen64
+ 0006e 8b f0 mov esi, eax
+ 00070 83 c4 04 add esp, 4
+ 00073 89 74 24 3c mov DWORD PTR _ziinit$[esp+65860], esi
+
+; 863 : pathname,
+; 864 : (append == APPEND_STATUS_CREATE) ?
+; 865 : (ZLIB_FILEFUNC_MODE_READ | ZLIB_FILEFUNC_MODE_WRITE | ZLIB_FILEFUNC_MODE_CREATE) :
+; 866 : (ZLIB_FILEFUNC_MODE_READ | ZLIB_FILEFUNC_MODE_WRITE | ZLIB_FILEFUNC_MODE_EXISTING));
+; 867 :
+; 868 : if (ziinit.filestream == NULL)
+
+ 00077 85 f6 test esi, esi
+ 00079 74 7e je SHORT $LN14@zipOpen3
+
+; 869 : return NULL;
+; 870 :
+; 871 : if (append == APPEND_STATUS_CREATEAFTER)
+
+ 0007b 83 ff 01 cmp edi, 1
+ 0007e 75 14 jne SHORT $LN5@zipOpen3
+
+; 872 : ZSEEK64(ziinit.z_filefunc,ziinit.filestream,0,SEEK_END);
+
+ 00080 6a 02 push 2
+ 00082 6a 00 push 0
+ 00084 6a 00 push 0
+ 00086 8b d6 mov edx, esi
+ 00088 8d 4c 24 1c lea ecx, DWORD PTR _ziinit$[esp+65828]
+ 0008c e8 00 00 00 00 call _call_zseek64
+ 00091 83 c4 0c add esp, 12 ; 0000000cH
+$LN5@zipOpen3:
+
+; 873 :
+; 874 : ziinit.begin_pos = ZTELL64(ziinit.z_filefunc,ziinit.filestream);
+
+ 00094 8b d6 mov edx, esi
+ 00096 8d 4c 24 10 lea ecx, DWORD PTR _ziinit$[esp+65816]
+ 0009a e8 00 00 00 00 call _call_ztell64
+ 0009f 0f 57 c0 xorps xmm0, xmm0
+ 000a2 89 84 24 f8 00
+ 01 00 mov DWORD PTR _ziinit$[esp+131584], eax
+
+; 875 : ziinit.in_opened_file_inzip = 0;
+; 876 : ziinit.ci.stream_initialised = 0;
+; 877 : ziinit.number_entry = 0;
+; 878 : ziinit.add_position_when_writting_offset = 0;
+; 879 : init_linkedlist(&(ziinit.central_dir));
+
+ 000a9 8d 4c 24 40 lea ecx, DWORD PTR _ziinit$[esp+65864]
+ 000ad 89 94 24 fc 00
+ 01 00 mov DWORD PTR _ziinit$[esp+131588], edx
+ 000b4 89 5c 24 48 mov DWORD PTR _ziinit$[esp+65872], ebx
+ 000b8 89 9c 24 88 00
+ 00 00 mov DWORD PTR _ziinit$[esp+65936], ebx
+ 000bf 66 0f 13 84 24
+ 08 01 01 00 movlpd QWORD PTR _ziinit$[esp+131600], xmm0
+ 000c8 66 0f 13 84 24
+ 00 01 01 00 movlpd QWORD PTR _ziinit$[esp+131592], xmm0
+ 000d1 e8 00 00 00 00 call _init_linkedlist
+
+; 880 :
+; 881 :
+; 882 :
+; 883 : zi = (zip64_internal*)ALLOC(sizeof(zip64_internal));
+
+ 000d6 68 08 01 01 00 push 65800 ; 00010108H
+ 000db ff 15 00 00 00
+ 00 call DWORD PTR __imp__malloc
+ 000e1 8b f0 mov esi, eax
+ 000e3 83 c4 04 add esp, 4
+
+; 884 : if (zi==NULL)
+
+ 000e6 85 f6 test esi, esi
+ 000e8 75 1a jne SHORT $LN6@zipOpen3
+
+; 885 : {
+; 886 : ZCLOSE64(ziinit.z_filefunc,ziinit.filestream);
+
+ 000ea ff 74 24 3c push DWORD PTR _ziinit$[esp+65860]
+ 000ee ff 74 24 30 push DWORD PTR _ziinit$[esp+65848]
+ 000f2 ff 54 24 2c call DWORD PTR _ziinit$[esp+65844]
+ 000f6 83 c4 08 add esp, 8
+$LN14@zipOpen3:
+
+; 887 : return NULL;
+
+ 000f9 33 c0 xor eax, eax
+
+; 917 : }
+; 918 : }
+
+ 000fb 5f pop edi
+ 000fc 5e pop esi
+ 000fd 5b pop ebx
+ 000fe 8b e5 mov esp, ebp
+ 00100 5d pop ebp
+ 00101 c2 08 00 ret 8
+$LN6@zipOpen3:
+
+; 888 : }
+; 889 :
+; 890 : /* now we add file in a zipfile */
+; 891 : # ifndef NO_ADDFILEINEXISTINGZIP
+; 892 : ziinit.globalcomment = NULL;
+
+ 00104 33 c0 xor eax, eax
+ 00106 89 84 24 10 01
+ 01 00 mov DWORD PTR _ziinit$[esp+131608], eax
+
+; 893 : if (append == APPEND_STATUS_ADDINZIP)
+
+ 0010d 83 ff 02 cmp edi, 2
+ 00110 75 12 jne SHORT $LN7@zipOpen3
+
+; 894 : {
+; 895 : // Read and Cache Central Directory Records
+; 896 : err = LoadCentralDirectoryRecord(&ziinit);
+
+ 00112 8d 4c 24 10 lea ecx, DWORD PTR _ziinit$[esp+65816]
+ 00116 e8 00 00 00 00 call _LoadCentralDirectoryRecord
+ 0011b 8b d8 mov ebx, eax
+ 0011d 8b 84 24 10 01
+ 01 00 mov eax, DWORD PTR _ziinit$[esp+131608]
+$LN7@zipOpen3:
+
+; 897 : }
+; 898 :
+; 899 : if (globalcomment)
+
+ 00124 8b 4d 08 mov ecx, DWORD PTR _globalcomment$[ebp]
+ 00127 85 c9 test ecx, ecx
+ 00129 74 02 je SHORT $LN8@zipOpen3
+
+; 900 : {
+; 901 : *globalcomment = ziinit.globalcomment;
+
+ 0012b 89 01 mov DWORD PTR [ecx], eax
+$LN8@zipOpen3:
+
+; 902 : }
+; 903 : # endif /* !NO_ADDFILEINEXISTINGZIP*/
+; 904 :
+; 905 : if (err != ZIP_OK)
+
+ 0012d 85 db test ebx, ebx
+ 0012f 74 21 je SHORT $LN9@zipOpen3
+
+; 906 : {
+; 907 : # ifndef NO_ADDFILEINEXISTINGZIP
+; 908 : TRYFREE(ziinit.globalcomment);
+
+ 00131 8b 3d 00 00 00
+ 00 mov edi, DWORD PTR __imp__free
+ 00137 85 c0 test eax, eax
+ 00139 74 06 je SHORT $LN11@zipOpen3
+ 0013b 50 push eax
+ 0013c ff d7 call edi
+ 0013e 83 c4 04 add esp, 4
+$LN11@zipOpen3:
+
+; 909 : # endif /* !NO_ADDFILEINEXISTINGZIP*/
+; 910 : TRYFREE(zi);
+
+ 00141 56 push esi
+ 00142 ff d7 call edi
+ 00144 83 c4 04 add esp, 4
+
+; 911 : return NULL;
+
+ 00147 33 c0 xor eax, eax
+
+; 917 : }
+; 918 : }
+
+ 00149 5f pop edi
+ 0014a 5e pop esi
+ 0014b 5b pop ebx
+ 0014c 8b e5 mov esp, ebp
+ 0014e 5d pop ebp
+ 0014f c2 08 00 ret 8
+$LN9@zipOpen3:
+
+; 912 : }
+; 913 : else
+; 914 : {
+; 915 : *zi = ziinit;
+
+ 00152 68 08 01 01 00 push 65800 ; 00010108H
+ 00157 8d 44 24 14 lea eax, DWORD PTR _ziinit$[esp+65820]
+ 0015b 50 push eax
+ 0015c 56 push esi
+ 0015d e8 00 00 00 00 call _memcpy
+ 00162 83 c4 0c add esp, 12 ; 0000000cH
+
+; 916 : return (zipFile)zi;
+
+ 00165 8b c6 mov eax, esi
+
+; 917 : }
+; 918 : }
+
+ 00167 5f pop edi
+ 00168 5e pop esi
+ 00169 5b pop ebx
+ 0016a 8b e5 mov esp, ebp
+ 0016c 5d pop ebp
+ 0016d c2 08 00 ret 8
+_zipOpen3@16 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _zipOpen2@16
+_TEXT SEGMENT
+_zlib_filefunc64_32_def_fill$1 = -44 ; size = 44
+_pathname$ = 8 ; size = 4
+_append$ = 12 ; size = 4
+_globalcomment$ = 16 ; size = 4
+_pzlib_filefunc32_def$ = 20 ; size = 4
+_zipOpen2@16 PROC ; COMDAT
+
+; 921 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 e4 f8 and esp, -8 ; fffffff8H
+
+; 922 : if (pzlib_filefunc32_def != NULL)
+
+ 00006 8b 55 14 mov edx, DWORD PTR _pzlib_filefunc32_def$[ebp]
+ 00009 83 ec 30 sub esp, 48 ; 00000030H
+ 0000c 85 d2 test edx, edx
+ 0000e 74 20 je SHORT $LN2@zipOpen2
+
+; 923 : {
+; 924 : zlib_filefunc64_32_def zlib_filefunc64_32_def_fill;
+; 925 : fill_zlib_filefunc64_32_def_from_filefunc32(&zlib_filefunc64_32_def_fill,pzlib_filefunc32_def);
+
+ 00010 8d 4c 24 04 lea ecx, DWORD PTR _zlib_filefunc64_32_def_fill$1[esp+48]
+ 00014 e8 00 00 00 00 call _fill_zlib_filefunc64_32_def_from_filefunc32
+
+; 926 : return zipOpen3(pathname, append, globalcomment, &zlib_filefunc64_32_def_fill);
+; 927 : }
+; 928 : else
+; 929 : return zipOpen3(pathname, append, globalcomment, NULL);
+
+ 00019 8b 55 0c mov edx, DWORD PTR _append$[ebp]
+ 0001c 8b c1 mov eax, ecx
+ 0001e 8b 4d 08 mov ecx, DWORD PTR _pathname$[ebp]
+ 00021 50 push eax
+ 00022 ff 75 10 push DWORD PTR _globalcomment$[ebp]
+ 00025 e8 00 00 00 00 call _zipOpen3@16
+
+; 930 : }
+
+ 0002a 8b e5 mov esp, ebp
+ 0002c 5d pop ebp
+ 0002d c2 10 00 ret 16 ; 00000010H
+$LN2@zipOpen2:
+
+; 926 : return zipOpen3(pathname, append, globalcomment, &zlib_filefunc64_32_def_fill);
+; 927 : }
+; 928 : else
+; 929 : return zipOpen3(pathname, append, globalcomment, NULL);
+
+ 00030 8b 55 0c mov edx, DWORD PTR _append$[ebp]
+ 00033 8b 4d 08 mov ecx, DWORD PTR _pathname$[ebp]
+ 00036 6a 00 push 0
+ 00038 ff 75 10 push DWORD PTR _globalcomment$[ebp]
+ 0003b e8 00 00 00 00 call _zipOpen3@16
+
+; 930 : }
+
+ 00040 8b e5 mov esp, ebp
+ 00042 5d pop ebp
+ 00043 c2 10 00 ret 16 ; 00000010H
+_zipOpen2@16 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _zipOpen2_64@16
+_TEXT SEGMENT
+_zlib_filefunc64_32_def_fill$1 = -44 ; size = 44
+_pathname$ = 8 ; size = 4
+_append$ = 12 ; size = 4
+_globalcomment$ = 16 ; size = 4
+_pzlib_filefunc_def$ = 20 ; size = 4
+_zipOpen2_64@16 PROC ; COMDAT
+
+; 933 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 e4 f8 and esp, -8 ; fffffff8H
+
+; 934 : if (pzlib_filefunc_def != NULL)
+
+ 00006 8b 45 14 mov eax, DWORD PTR _pzlib_filefunc_def$[ebp]
+ 00009 83 ec 30 sub esp, 48 ; 00000030H
+
+; 940 : return zipOpen3(pathname, append, globalcomment, &zlib_filefunc64_32_def_fill);
+
+ 0000c 8b 55 0c mov edx, DWORD PTR _append$[ebp]
+ 0000f 8b 4d 08 mov ecx, DWORD PTR _pathname$[ebp]
+ 00012 85 c0 test eax, eax
+ 00014 74 34 je SHORT $LN2@zipOpen2_6
+
+; 935 : {
+; 936 : zlib_filefunc64_32_def zlib_filefunc64_32_def_fill;
+; 937 : zlib_filefunc64_32_def_fill.zfile_func64 = *pzlib_filefunc_def;
+; 938 : zlib_filefunc64_32_def_fill.ztell32_file = NULL;
+
+ 00016 0f 10 00 movups xmm0, XMMWORD PTR [eax]
+ 00019 c7 44 24 28 00
+ 00 00 00 mov DWORD PTR _zlib_filefunc64_32_def_fill$1[esp+84], 0
+
+; 939 : zlib_filefunc64_32_def_fill.zseek32_file = NULL;
+
+ 00021 c7 44 24 2c 00
+ 00 00 00 mov DWORD PTR _zlib_filefunc64_32_def_fill$1[esp+88], 0
+ 00029 0f 11 44 24 04 movups XMMWORD PTR _zlib_filefunc64_32_def_fill$1[esp+48], xmm0
+ 0002e 0f 10 40 10 movups xmm0, XMMWORD PTR [eax+16]
+
+; 940 : return zipOpen3(pathname, append, globalcomment, &zlib_filefunc64_32_def_fill);
+
+ 00032 8d 44 24 04 lea eax, DWORD PTR _zlib_filefunc64_32_def_fill$1[esp+48]
+ 00036 50 push eax
+
+; 941 : }
+; 942 : else
+; 943 : return zipOpen3(pathname, append, globalcomment, NULL);
+
+ 00037 ff 75 10 push DWORD PTR _globalcomment$[ebp]
+ 0003a 0f 11 44 24 1c movups XMMWORD PTR _zlib_filefunc64_32_def_fill$1[esp+72], xmm0
+ 0003f e8 00 00 00 00 call _zipOpen3@16
+
+; 944 : }
+
+ 00044 8b e5 mov esp, ebp
+ 00046 5d pop ebp
+ 00047 c2 10 00 ret 16 ; 00000010H
+$LN2@zipOpen2_6:
+
+; 941 : }
+; 942 : else
+; 943 : return zipOpen3(pathname, append, globalcomment, NULL);
+
+ 0004a 6a 00 push 0
+ 0004c ff 75 10 push DWORD PTR _globalcomment$[ebp]
+ 0004f e8 00 00 00 00 call _zipOpen3@16
+
+; 944 : }
+
+ 00054 8b e5 mov esp, ebp
+ 00056 5d pop ebp
+ 00057 c2 10 00 ret 16 ; 00000010H
+_zipOpen2_64@16 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _zipOpen@8
+_TEXT SEGMENT
+_pathname$ = 8 ; size = 4
+_append$ = 12 ; size = 4
+_zipOpen@8 PROC ; COMDAT
+
+; 949 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 950 : return zipOpen3((const void*)pathname,append,NULL,NULL);
+
+ 00003 8b 55 0c mov edx, DWORD PTR _append$[ebp]
+ 00006 8b 4d 08 mov ecx, DWORD PTR _pathname$[ebp]
+ 00009 6a 00 push 0
+ 0000b 6a 00 push 0
+ 0000d e8 00 00 00 00 call _zipOpen3@16
+
+; 951 : }
+
+ 00012 5d pop ebp
+ 00013 c2 08 00 ret 8
+_zipOpen@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _zipOpen64@8
+_TEXT SEGMENT
+_pathname$ = 8 ; size = 4
+_append$ = 12 ; size = 4
+_zipOpen64@8 PROC ; COMDAT
+
+; 954 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 955 : return zipOpen3(pathname,append,NULL,NULL);
+
+ 00003 8b 55 0c mov edx, DWORD PTR _append$[ebp]
+ 00006 8b 4d 08 mov ecx, DWORD PTR _pathname$[ebp]
+ 00009 6a 00 push 0
+ 0000b 6a 00 push 0
+ 0000d e8 00 00 00 00 call _zipOpen3@16
+
+; 956 : }
+
+ 00012 5d pop ebp
+ 00013 c2 08 00 ret 8
+_zipOpen64@8 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _Write_LocalFileHeader
+_TEXT SEGMENT
+_filename$1$ = -8 ; size = 4
+_size_extrafield_local$ = 8 ; size = 4
+_extrafield_local$ = 12 ; size = 4
+_Write_LocalFileHeader PROC ; COMDAT
+; _zi$ = ecx
+; _filename$ = edx
+
+; 959 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 08 sub esp, 8
+ 00006 53 push ebx
+ 00007 56 push esi
+ 00008 8b c2 mov eax, edx
+ 0000a 8b f1 mov esi, ecx
+ 0000c 57 push edi
+
+; 960 : /* write the local header */
+; 961 : int err;
+; 962 : uInt size_filename = (uInt)strlen(filename);
+
+ 0000d 8b f8 mov edi, eax
+ 0000f 89 45 f8 mov DWORD PTR _filename$1$[ebp], eax
+ 00012 8d 4f 01 lea ecx, DWORD PTR [edi+1]
+$LL26@Write_Loca:
+ 00015 8a 07 mov al, BYTE PTR [edi]
+ 00017 47 inc edi
+ 00018 84 c0 test al, al
+ 0001a 75 f9 jne SHORT $LL26@Write_Loca
+
+; 963 : uInt size_extrafield = size_extrafield_local;
+; 964 :
+; 965 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)LOCALHEADERMAGIC, 4);
+
+ 0001c 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 0001f 2b f9 sub edi, ecx
+ 00021 8b 5d 08 mov ebx, DWORD PTR _size_extrafield_local$[ebp]
+ 00024 8b ce mov ecx, esi
+ 00026 6a 04 push 4
+ 00028 6a 00 push 0
+ 0002a 68 50 4b 03 04 push 67324752 ; 04034b50H
+ 0002f e8 00 00 00 00 call _zip64local_putValue
+ 00034 83 c4 0c add esp, 12 ; 0000000cH
+
+; 966 :
+; 967 : if (err==ZIP_OK)
+
+ 00037 85 c0 test eax, eax
+ 00039 0f 85 e6 00 00
+ 00 jne $LN15@Write_Loca
+
+; 968 : {
+; 969 : if(zi->ci.zip64)
+; 970 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)45,2);/* version needed to extract */
+
+ 0003f 8b ce mov ecx, esi
+ 00041 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00044 6a 02 push 2
+ 00046 50 push eax
+ 00047 39 86 b0 00 01
+ 00 cmp DWORD PTR [esi+65712], eax
+ 0004d 74 04 je SHORT $LN3@Write_Loca
+ 0004f 6a 2d push 45 ; 0000002dH
+ 00051 eb 02 jmp SHORT $LN31@Write_Loca
+$LN3@Write_Loca:
+
+; 971 : else
+; 972 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)20,2);/* version needed to extract */
+
+ 00053 6a 14 push 20 ; 00000014H
+$LN31@Write_Loca:
+ 00055 e8 00 00 00 00 call _zip64local_putValue
+ 0005a 83 c4 0c add esp, 12 ; 0000000cH
+
+; 973 : }
+; 974 :
+; 975 : if (err==ZIP_OK)
+
+ 0005d 85 c0 test eax, eax
+ 0005f 0f 85 c0 00 00
+ 00 jne $LN15@Write_Loca
+
+; 976 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.flag,2);
+
+ 00065 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00068 8b ce mov ecx, esi
+ 0006a 6a 02 push 2
+ 0006c 50 push eax
+ 0006d ff b6 98 00 00
+ 00 push DWORD PTR [esi+152]
+ 00073 e8 00 00 00 00 call _zip64local_putValue
+ 00078 83 c4 0c add esp, 12 ; 0000000cH
+
+; 977 :
+; 978 : if (err==ZIP_OK)
+
+ 0007b 85 c0 test eax, eax
+ 0007d 0f 85 a2 00 00
+ 00 jne $LN15@Write_Loca
+
+; 979 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.method,2);
+
+ 00083 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00086 8b ce mov ecx, esi
+ 00088 6a 02 push 2
+ 0008a 50 push eax
+ 0008b ff b6 9c 00 00
+ 00 push DWORD PTR [esi+156]
+ 00091 e8 00 00 00 00 call _zip64local_putValue
+ 00096 83 c4 0c add esp, 12 ; 0000000cH
+
+; 980 :
+; 981 : if (err==ZIP_OK)
+
+ 00099 85 c0 test eax, eax
+ 0009b 0f 85 84 00 00
+ 00 jne $LN15@Write_Loca
+
+; 982 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.dosDate,4);
+
+ 000a1 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 000a4 8b ce mov ecx, esi
+ 000a6 6a 04 push 4
+ 000a8 50 push eax
+ 000a9 ff b6 a4 00 01
+ 00 push DWORD PTR [esi+65700]
+ 000af e8 00 00 00 00 call _zip64local_putValue
+ 000b4 83 c4 0c add esp, 12 ; 0000000cH
+
+; 983 :
+; 984 : // CRC / Compressed size / Uncompressed size will be filled in later and rewritten later
+; 985 : if (err==ZIP_OK)
+
+ 000b7 85 c0 test eax, eax
+ 000b9 75 6a jne SHORT $LN15@Write_Loca
+
+; 986 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* crc 32, unknown */
+
+ 000bb 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 000be 8b ce mov ecx, esi
+ 000c0 6a 04 push 4
+ 000c2 50 push eax
+ 000c3 50 push eax
+ 000c4 e8 00 00 00 00 call _zip64local_putValue
+ 000c9 83 c4 0c add esp, 12 ; 0000000cH
+
+; 987 : if (err==ZIP_OK)
+
+ 000cc 85 c0 test eax, eax
+ 000ce 75 55 jne SHORT $LN15@Write_Loca
+
+; 988 : {
+; 989 : if(zi->ci.zip64)
+; 990 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0xFFFFFFFF,4); /* compressed size, unknown */
+
+ 000d0 8b ce mov ecx, esi
+ 000d2 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 000d5 6a 04 push 4
+ 000d7 50 push eax
+ 000d8 39 86 b0 00 01
+ 00 cmp DWORD PTR [esi+65712], eax
+ 000de 74 04 je SHORT $LN10@Write_Loca
+ 000e0 6a ff push -1
+ 000e2 eb 02 jmp SHORT $LN32@Write_Loca
+$LN10@Write_Loca:
+
+; 991 : else
+; 992 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* compressed size, unknown */
+
+ 000e4 6a 00 push 0
+$LN32@Write_Loca:
+ 000e6 e8 00 00 00 00 call _zip64local_putValue
+ 000eb 83 c4 0c add esp, 12 ; 0000000cH
+
+; 993 : }
+; 994 : if (err==ZIP_OK)
+
+ 000ee 85 c0 test eax, eax
+ 000f0 75 33 jne SHORT $LN15@Write_Loca
+
+; 995 : {
+; 996 : if(zi->ci.zip64)
+; 997 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0xFFFFFFFF,4); /* uncompressed size, unknown */
+
+ 000f2 8b ce mov ecx, esi
+ 000f4 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 000f7 6a 04 push 4
+ 000f9 50 push eax
+ 000fa 39 86 b0 00 01
+ 00 cmp DWORD PTR [esi+65712], eax
+ 00100 74 04 je SHORT $LN13@Write_Loca
+ 00102 6a ff push -1
+ 00104 eb 02 jmp SHORT $LN33@Write_Loca
+$LN13@Write_Loca:
+
+; 998 : else
+; 999 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* uncompressed size, unknown */
+
+ 00106 6a 00 push 0
+$LN33@Write_Loca:
+ 00108 e8 00 00 00 00 call _zip64local_putValue
+ 0010d 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1000 : }
+; 1001 :
+; 1002 : if (err==ZIP_OK)
+
+ 00110 85 c0 test eax, eax
+ 00112 75 11 jne SHORT $LN15@Write_Loca
+
+; 1003 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_filename,2);
+
+ 00114 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00117 8b ce mov ecx, esi
+ 00119 6a 02 push 2
+ 0011b 50 push eax
+ 0011c 57 push edi
+ 0011d e8 00 00 00 00 call _zip64local_putValue
+ 00122 83 c4 0c add esp, 12 ; 0000000cH
+$LN15@Write_Loca:
+
+; 1004 :
+; 1005 : if(zi->ci.zip64)
+
+ 00125 83 be b0 00 01
+ 00 00 cmp DWORD PTR [esi+65712], 0
+
+; 1006 : {
+; 1007 : size_extrafield += 20;
+
+ 0012c 8d 4b 14 lea ecx, DWORD PTR [ebx+20]
+ 0012f 75 02 jne SHORT $LN16@Write_Loca
+ 00131 8b cb mov ecx, ebx
+$LN16@Write_Loca:
+
+; 1008 : }
+; 1009 :
+; 1010 : if (err==ZIP_OK)
+
+ 00133 85 c0 test eax, eax
+ 00135 0f 85 c7 00 00
+ 00 jne $LN22@Write_Loca
+
+; 1011 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_extrafield,2);
+
+ 0013b 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 0013e 6a 02 push 2
+ 00140 50 push eax
+ 00141 51 push ecx
+ 00142 8b ce mov ecx, esi
+ 00144 e8 00 00 00 00 call _zip64local_putValue
+ 00149 8b d8 mov ebx, eax
+ 0014b 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1012 :
+; 1013 : if ((err==ZIP_OK) && (size_filename > 0))
+
+ 0014e 85 db test ebx, ebx
+ 00150 0f 85 aa 00 00
+ 00 jne $LN28@Write_Loca
+ 00156 85 ff test edi, edi
+ 00158 74 20 je SHORT $LN24@Write_Loca
+
+; 1014 : {
+; 1015 : if (ZWRITE64(zi->z_filefunc,zi->filestream,filename,size_filename)!=size_filename)
+
+ 0015a 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 0015d 57 push edi
+ 0015e ff 75 f8 push DWORD PTR _filename$1$[ebp]
+ 00161 ff 76 2c push DWORD PTR [esi+44]
+ 00164 ff 76 1c push DWORD PTR [esi+28]
+ 00167 ff d0 call eax
+ 00169 83 c4 10 add esp, 16 ; 00000010H
+ 0016c 3b c7 cmp eax, edi
+ 0016e 74 0a je SHORT $LN24@Write_Loca
+$LN34@Write_Loca:
+
+; 1042 : }
+; 1043 :
+; 1044 : return err;
+
+ 00170 83 c8 ff or eax, -1
+
+; 1045 : }
+
+ 00173 5f pop edi
+ 00174 5e pop esi
+ 00175 5b pop ebx
+ 00176 8b e5 mov esp, ebp
+ 00178 5d pop ebp
+ 00179 c3 ret 0
+$LN24@Write_Loca:
+
+; 1016 : err = ZIP_ERRNO;
+; 1017 : }
+; 1018 :
+; 1019 : if ((err==ZIP_OK) && (size_extrafield_local > 0))
+
+ 0017a 8b 7d 08 mov edi, DWORD PTR _size_extrafield_local$[ebp]
+ 0017d 85 ff test edi, edi
+ 0017f 74 16 je SHORT $LN25@Write_Loca
+
+; 1020 : {
+; 1021 : if (ZWRITE64(zi->z_filefunc, zi->filestream, extrafield_local, size_extrafield_local) != size_extrafield_local)
+
+ 00181 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 00184 57 push edi
+ 00185 ff 75 0c push DWORD PTR _extrafield_local$[ebp]
+ 00188 ff 76 2c push DWORD PTR [esi+44]
+ 0018b ff 76 1c push DWORD PTR [esi+28]
+ 0018e ff d0 call eax
+ 00190 83 c4 10 add esp, 16 ; 00000010H
+ 00193 3b c7 cmp eax, edi
+ 00195 75 d9 jne SHORT $LN34@Write_Loca
+$LN25@Write_Loca:
+
+; 1022 : err = ZIP_ERRNO;
+; 1023 : }
+; 1024 :
+; 1025 :
+; 1026 : if ((err==ZIP_OK) && (zi->ci.zip64))
+
+ 00197 83 be b0 00 01
+ 00 00 cmp DWORD PTR [esi+65712], 0
+ 0019e 74 60 je SHORT $LN28@Write_Loca
+
+; 1027 : {
+; 1028 : // write the Zip64 extended info
+; 1029 : short HeaderID = 1;
+; 1030 : short DataSize = 16;
+; 1031 : ZPOS64_T CompressedSize = 0;
+; 1032 : ZPOS64_T UncompressedSize = 0;
+; 1033 :
+; 1034 : // Remember position of Zip64 extended info for the local file header. (needed when we update size after done with file)
+; 1035 : zi->ci.pos_zip64extrainfo = ZTELL64(zi->z_filefunc,zi->filestream);
+
+ 001a0 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 001a3 8b ce mov ecx, esi
+ 001a5 e8 00 00 00 00 call _call_ztell64
+
+; 1036 :
+; 1037 : err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (short)HeaderID,2);
+
+ 001aa 6a 02 push 2
+ 001ac 89 96 bc 00 01
+ 00 mov DWORD PTR [esi+65724], edx
+ 001b2 8b ce mov ecx, esi
+ 001b4 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 001b7 6a 00 push 0
+ 001b9 6a 01 push 1
+ 001bb 89 86 b8 00 01
+ 00 mov DWORD PTR [esi+65720], eax
+ 001c1 e8 00 00 00 00 call _zip64local_putValue
+
+; 1038 : err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (short)DataSize,2);
+
+ 001c6 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 001c9 8b ce mov ecx, esi
+ 001cb 6a 02 push 2
+ 001cd 6a 00 push 0
+ 001cf 6a 10 push 16 ; 00000010H
+ 001d1 e8 00 00 00 00 call _zip64local_putValue
+
+; 1039 :
+; 1040 : err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)UncompressedSize,8);
+
+ 001d6 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 001d9 8b ce mov ecx, esi
+ 001db 6a 08 push 8
+ 001dd 6a 00 push 0
+ 001df 6a 00 push 0
+ 001e1 e8 00 00 00 00 call _zip64local_putValue
+
+; 1041 : err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)CompressedSize,8);
+
+ 001e6 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 001e9 8b ce mov ecx, esi
+ 001eb 6a 08 push 8
+ 001ed 6a 00 push 0
+ 001ef 6a 00 push 0
+ 001f1 e8 00 00 00 00 call _zip64local_putValue
+ 001f6 83 c4 30 add esp, 48 ; 00000030H
+
+; 1045 : }
+
+ 001f9 5f pop edi
+ 001fa 5e pop esi
+ 001fb 5b pop ebx
+ 001fc 8b e5 mov esp, ebp
+ 001fe 5d pop ebp
+ 001ff c3 ret 0
+$LN28@Write_Loca:
+
+; 1042 : }
+; 1043 :
+; 1044 : return err;
+
+ 00200 8b c3 mov eax, ebx
+$LN22@Write_Loca:
+
+; 1045 : }
+
+ 00202 5f pop edi
+ 00203 5e pop esi
+ 00204 5b pop ebx
+ 00205 8b e5 mov esp, ebp
+ 00207 5d pop ebp
+ 00208 c3 ret 0
+_Write_LocalFileHeader ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _zipOpenNewFileInZip4_64@76
+_TEXT SEGMENT
+_size_comment$1$ = -20 ; size = 4
+_filename$2$ = -16 ; size = 4
+_bufHead$1 = -12 ; size = 12
+_file$ = 8 ; size = 4
+_filename$ = 12 ; size = 4
+_zipfi$ = 16 ; size = 4
+_extrafield_local$ = 20 ; size = 4
+_size_extrafield_local$ = 24 ; size = 4
+_extrafield_global$ = 28 ; size = 4
+_size_extrafield_global$ = 32 ; size = 4
+_comment$ = 36 ; size = 4
+_method$ = 40 ; size = 4
+_level$ = 44 ; size = 4
+_raw$ = 48 ; size = 4
+_windowBits$ = 52 ; size = 4
+_memLevel$ = 56 ; size = 4
+_strategy$ = 60 ; size = 4
+_password$ = 64 ; size = 4
+_crcForCrypting$ = 68 ; size = 4
+_versionMadeBy$ = 72 ; size = 4
+_flagBase$ = 76 ; size = 4
+_zip64$ = 80 ; size = 4
+_zipOpenNewFileInZip4_64@76 PROC ; COMDAT
+
+; 1062 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 e4 f8 and esp, -8 ; fffffff8H
+ 00006 83 ec 14 sub esp, 20 ; 00000014H
+ 00009 53 push ebx
+ 0000a 56 push esi
+
+; 1063 : zip64_internal* zi;
+; 1064 : uInt size_filename;
+; 1065 : uInt size_comment;
+; 1066 : uInt i;
+; 1067 : int err = ZIP_OK;
+; 1068 :
+; 1069 : # ifdef NOCRYPT
+; 1070 : (crcForCrypting);
+; 1071 : if (password != NULL)
+; 1072 : return ZIP_PARAMERROR;
+; 1073 : # endif
+; 1074 :
+; 1075 : if (file == NULL)
+
+ 0000b 8b 75 08 mov esi, DWORD PTR _file$[ebp]
+ 0000e 57 push edi
+ 0000f 85 f6 test esi, esi
+ 00011 75 0e jne SHORT $LN11@zipOpenNew
+$LN64@zipOpenNew:
+
+; 1076 : return ZIP_PARAMERROR;
+
+ 00013 b8 9a ff ff ff mov eax, -102 ; ffffff9aH
+
+; 1263 : }
+
+ 00018 5f pop edi
+ 00019 5e pop esi
+ 0001a 5b pop ebx
+ 0001b 8b e5 mov esp, ebp
+ 0001d 5d pop ebp
+ 0001e c2 4c 00 ret 76 ; 0000004cH
+$LN11@zipOpenNew:
+
+; 1077 :
+; 1078 : #ifdef HAVE_BZIP2
+; 1079 : if ((method!=0) && (method!=Z_DEFLATED) && (method!=Z_BZIP2ED))
+; 1080 : return ZIP_PARAMERROR;
+; 1081 : #else
+; 1082 : if ((method!=0) && (method!=Z_DEFLATED))
+
+ 00021 8b 45 28 mov eax, DWORD PTR _method$[ebp]
+ 00024 85 c0 test eax, eax
+ 00026 74 05 je SHORT $LN12@zipOpenNew
+ 00028 83 f8 08 cmp eax, 8
+ 0002b 75 e6 jne SHORT $LN64@zipOpenNew
+$LN12@zipOpenNew:
+
+; 1083 : return ZIP_PARAMERROR;
+; 1084 : #endif
+; 1085 :
+; 1086 : zi = (zip64_internal*)file;
+; 1087 :
+; 1088 : if (zi->in_opened_file_inzip == 1)
+
+ 0002d 83 7e 38 01 cmp DWORD PTR [esi+56], 1
+ 00031 75 0e jne SHORT $LN14@zipOpenNew
+
+; 1089 : {
+; 1090 : err = zipCloseFileInZip (file);
+
+ 00033 56 push esi
+ 00034 e8 00 00 00 00 call _zipCloseFileInZip@4
+
+; 1091 : if (err != ZIP_OK)
+
+ 00039 85 c0 test eax, eax
+ 0003b 0f 85 95 04 00
+ 00 jne $LN1@zipOpenNew
+$LN14@zipOpenNew:
+
+; 1092 : return err;
+; 1093 : }
+; 1094 :
+; 1095 : if (filename==NULL)
+
+ 00041 8b 45 0c mov eax, DWORD PTR _filename$[ebp]
+ 00044 b9 00 00 00 00 mov ecx, OFFSET ??_C@_01JOAMLHOP@?9?$AA@
+ 00049 85 c0 test eax, eax
+ 0004b 0f 45 c8 cmovne ecx, eax
+
+; 1096 : filename="-";
+; 1097 :
+; 1098 : if (comment==NULL)
+
+ 0004e 8b 45 24 mov eax, DWORD PTR _comment$[ebp]
+ 00051 89 4c 24 10 mov DWORD PTR _filename$2$[esp+32], ecx
+ 00055 85 c0 test eax, eax
+ 00057 75 04 jne SHORT $LN16@zipOpenNew
+
+; 1099 : size_comment = 0;
+
+ 00059 33 db xor ebx, ebx
+ 0005b eb 0e jmp SHORT $LN61@zipOpenNew
+$LN16@zipOpenNew:
+
+; 1100 : else
+; 1101 : size_comment = (uInt)strlen(comment);
+
+ 0005d 8b d8 mov ebx, eax
+ 0005f 8d 53 01 lea edx, DWORD PTR [ebx+1]
+$LL58@zipOpenNew:
+ 00062 8a 03 mov al, BYTE PTR [ebx]
+ 00064 43 inc ebx
+ 00065 84 c0 test al, al
+ 00067 75 f9 jne SHORT $LL58@zipOpenNew
+ 00069 2b da sub ebx, edx
+$LN61@zipOpenNew:
+
+; 1102 :
+; 1103 : size_filename = (uInt)strlen(filename);
+
+ 0006b 8b f9 mov edi, ecx
+ 0006d 89 5c 24 0c mov DWORD PTR _size_comment$1$[esp+32], ebx
+ 00071 8d 4f 01 lea ecx, DWORD PTR [edi+1]
+$LL59@zipOpenNew:
+ 00074 8a 07 mov al, BYTE PTR [edi]
+ 00076 47 inc edi
+ 00077 84 c0 test al, al
+ 00079 75 f9 jne SHORT $LL59@zipOpenNew
+
+; 1104 :
+; 1105 : if (zipfi == NULL)
+
+ 0007b 8b 45 10 mov eax, DWORD PTR _zipfi$[ebp]
+ 0007e 2b f9 sub edi, ecx
+ 00080 85 c0 test eax, eax
+ 00082 75 08 jne SHORT $LN18@zipOpenNew
+
+; 1106 : zi->ci.dosDate = 0;
+
+ 00084 89 86 a4 00 01
+ 00 mov DWORD PTR [esi+65700], eax
+ 0008a eb 1c jmp SHORT $LN21@zipOpenNew
+$LN18@zipOpenNew:
+
+; 1107 : else
+; 1108 : {
+; 1109 : if (zipfi->dosDate != 0)
+
+ 0008c 8b 48 18 mov ecx, DWORD PTR [eax+24]
+ 0008f 85 c9 test ecx, ecx
+ 00091 74 08 je SHORT $LN20@zipOpenNew
+
+; 1110 : zi->ci.dosDate = zipfi->dosDate;
+
+ 00093 89 8e a4 00 01
+ 00 mov DWORD PTR [esi+65700], ecx
+ 00099 eb 0d jmp SHORT $LN21@zipOpenNew
+$LN20@zipOpenNew:
+
+; 1111 : else
+; 1112 : zi->ci.dosDate = zip64local_TmzDateToDosDate(&zipfi->tmz_date);
+
+ 0009b 8b c8 mov ecx, eax
+ 0009d e8 00 00 00 00 call _zip64local_TmzDateToDosDate
+ 000a2 89 86 a4 00 01
+ 00 mov DWORD PTR [esi+65700], eax
+$LN21@zipOpenNew:
+
+; 1113 : }
+; 1114 :
+; 1115 : zi->ci.flag = flagBase;
+; 1116 : if ((level==8) || (level==9))
+
+ 000a8 8b 4d 2c mov ecx, DWORD PTR _level$[ebp]
+ 000ab 8b 45 4c mov eax, DWORD PTR _flagBase$[ebp]
+ 000ae 89 86 98 00 00
+ 00 mov DWORD PTR [esi+152], eax
+ 000b4 83 f9 08 cmp ecx, 8
+ 000b7 74 05 je SHORT $LN23@zipOpenNew
+ 000b9 83 f9 09 cmp ecx, 9
+ 000bc 75 09 jne SHORT $LN22@zipOpenNew
+$LN23@zipOpenNew:
+
+; 1117 : zi->ci.flag |= 2;
+
+ 000be 83 c8 02 or eax, 2
+ 000c1 89 86 98 00 00
+ 00 mov DWORD PTR [esi+152], eax
+$LN22@zipOpenNew:
+
+; 1118 : if (level==2)
+
+ 000c7 83 f9 02 cmp ecx, 2
+ 000ca 75 09 jne SHORT $LN24@zipOpenNew
+
+; 1119 : zi->ci.flag |= 4;
+
+ 000cc 83 8e 98 00 00
+ 00 04 or DWORD PTR [esi+152], 4
+
+; 1120 : if (level==1)
+
+ 000d3 eb 0c jmp SHORT $LN25@zipOpenNew
+$LN24@zipOpenNew:
+ 000d5 83 f9 01 cmp ecx, 1
+ 000d8 75 07 jne SHORT $LN25@zipOpenNew
+
+; 1121 : zi->ci.flag |= 6;
+
+ 000da 83 8e 98 00 00
+ 00 06 or DWORD PTR [esi+152], 6
+$LN25@zipOpenNew:
+
+; 1122 : if (password != NULL)
+
+ 000e1 83 7d 40 00 cmp DWORD PTR _password$[ebp], 0
+ 000e5 74 07 je SHORT $LN26@zipOpenNew
+
+; 1123 : zi->ci.flag |= 1;
+
+ 000e7 83 8e 98 00 00
+ 00 01 or DWORD PTR [esi+152], 1
+$LN26@zipOpenNew:
+
+; 1124 :
+; 1125 : zi->ci.crc32 = 0;
+; 1126 : zi->ci.method = method;
+
+ 000ee 8b 45 28 mov eax, DWORD PTR _method$[ebp]
+
+; 1127 : zi->ci.encrypt = 0;
+; 1128 : zi->ci.stream_initialised = 0;
+; 1129 : zi->ci.pos_in_buffered_data = 0;
+; 1130 : zi->ci.raw = raw;
+; 1131 : zi->ci.pos_local_header = ZTELL64(zi->z_filefunc,zi->filestream);
+
+ 000f1 8b ce mov ecx, esi
+ 000f3 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 000f6 89 86 9c 00 00
+ 00 mov DWORD PTR [esi+156], eax
+ 000fc 8b 45 30 mov eax, DWORD PTR _raw$[ebp]
+ 000ff c7 86 a8 00 01
+ 00 00 00 00 00 mov DWORD PTR [esi+65704], 0
+ 00109 c7 86 ac 00 01
+ 00 00 00 00 00 mov DWORD PTR [esi+65708], 0
+ 00113 c7 46 78 00 00
+ 00 00 mov DWORD PTR [esi+120], 0
+ 0011a c7 46 7c 00 00
+ 00 00 mov DWORD PTR [esi+124], 0
+ 00121 89 86 a0 00 00
+ 00 mov DWORD PTR [esi+160], eax
+ 00127 e8 00 00 00 00 call _call_ztell64
+
+; 1132 :
+; 1133 : zi->ci.size_centralheader = SIZECENTRALHEADER + size_filename + size_extrafield_global + size_comment;
+
+ 0012c 8b 4d 20 mov ecx, DWORD PTR _size_extrafield_global$[ebp]
+ 0012f 89 86 80 00 00
+ 00 mov DWORD PTR [esi+128], eax
+ 00135 83 c1 2e add ecx, 46 ; 0000002eH
+ 00138 8d 04 1f lea eax, DWORD PTR [edi+ebx]
+ 0013b 89 96 84 00 00
+ 00 mov DWORD PTR [esi+132], edx
+ 00141 03 c1 add eax, ecx
+
+; 1134 : zi->ci.size_centralExtraFree = 32; // Extra space we have reserved in case we need to add ZIP64 extra info data
+
+ 00143 c7 86 94 00 00
+ 00 20 00 00 00 mov DWORD PTR [esi+148], 32 ; 00000020H
+ 0014d 89 86 90 00 00
+ 00 mov DWORD PTR [esi+144], eax
+
+; 1135 :
+; 1136 : zi->ci.central_header = (char*)ALLOC((uInt)zi->ci.size_centralheader + zi->ci.size_centralExtraFree);
+
+ 00153 83 c0 20 add eax, 32 ; 00000020H
+ 00156 50 push eax
+ 00157 ff 15 00 00 00
+ 00 call DWORD PTR __imp__malloc
+
+; 1137 :
+; 1138 : zi->ci.size_centralExtra = size_extrafield_global;
+
+ 0015d 8b 4d 20 mov ecx, DWORD PTR _size_extrafield_global$[ebp]
+ 00160 83 c4 04 add esp, 4
+ 00163 89 8e 8c 00 00
+ 00 mov DWORD PTR [esi+140], ecx
+
+; 1139 : zip64local_putValue_inmemory(zi->ci.central_header,(uLong)CENTRALHEADERMAGIC,4);
+
+ 00169 ba 04 00 00 00 mov edx, 4
+ 0016e 8b c8 mov ecx, eax
+ 00170 89 86 88 00 00
+ 00 mov DWORD PTR [esi+136], eax
+ 00176 6a 00 push 0
+ 00178 68 50 4b 01 02 push 33639248 ; 02014b50H
+ 0017d e8 00 00 00 00 call _zip64local_putValue_inmemory
+
+; 1140 : /* version info */
+; 1141 : zip64local_putValue_inmemory(zi->ci.central_header+4,(uLong)versionMadeBy,2);
+
+ 00182 8b 8e 88 00 00
+ 00 mov ecx, DWORD PTR [esi+136]
+ 00188 6a 00 push 0
+ 0018a ff 75 48 push DWORD PTR _versionMadeBy$[ebp]
+ 0018d 03 ca add ecx, edx
+ 0018f ba 02 00 00 00 mov edx, 2
+ 00194 e8 00 00 00 00 call _zip64local_putValue_inmemory
+
+; 1142 : zip64local_putValue_inmemory(zi->ci.central_header+6,(uLong)20,2);
+
+ 00199 8b 8e 88 00 00
+ 00 mov ecx, DWORD PTR [esi+136]
+ 0019f 6a 00 push 0
+ 001a1 6a 14 push 20 ; 00000014H
+ 001a3 83 c1 06 add ecx, 6
+ 001a6 e8 00 00 00 00 call _zip64local_putValue_inmemory
+
+; 1143 : zip64local_putValue_inmemory(zi->ci.central_header+8,(uLong)zi->ci.flag,2);
+
+ 001ab 8b 8e 88 00 00
+ 00 mov ecx, DWORD PTR [esi+136]
+ 001b1 6a 00 push 0
+ 001b3 ff b6 98 00 00
+ 00 push DWORD PTR [esi+152]
+ 001b9 83 c1 08 add ecx, 8
+ 001bc e8 00 00 00 00 call _zip64local_putValue_inmemory
+
+; 1144 : zip64local_putValue_inmemory(zi->ci.central_header+10,(uLong)zi->ci.method,2);
+
+ 001c1 8b 8e 88 00 00
+ 00 mov ecx, DWORD PTR [esi+136]
+ 001c7 6a 00 push 0
+ 001c9 ff b6 9c 00 00
+ 00 push DWORD PTR [esi+156]
+ 001cf 83 c1 0a add ecx, 10 ; 0000000aH
+ 001d2 e8 00 00 00 00 call _zip64local_putValue_inmemory
+
+; 1145 : zip64local_putValue_inmemory(zi->ci.central_header+12,(uLong)zi->ci.dosDate,4);
+
+ 001d7 8b 8e 88 00 00
+ 00 mov ecx, DWORD PTR [esi+136]
+ 001dd ba 04 00 00 00 mov edx, 4
+ 001e2 6a 00 push 0
+ 001e4 ff b6 a4 00 01
+ 00 push DWORD PTR [esi+65700]
+ 001ea 83 c1 0c add ecx, 12 ; 0000000cH
+ 001ed e8 00 00 00 00 call _zip64local_putValue_inmemory
+
+; 1146 : zip64local_putValue_inmemory(zi->ci.central_header+16,(uLong)0,4); /*crc*/
+
+ 001f2 8b 8e 88 00 00
+ 00 mov ecx, DWORD PTR [esi+136]
+ 001f8 6a 00 push 0
+ 001fa 6a 00 push 0
+ 001fc 83 c1 10 add ecx, 16 ; 00000010H
+ 001ff e8 00 00 00 00 call _zip64local_putValue_inmemory
+
+; 1147 : zip64local_putValue_inmemory(zi->ci.central_header+20,(uLong)0,4); /*compr size*/
+
+ 00204 8b 8e 88 00 00
+ 00 mov ecx, DWORD PTR [esi+136]
+ 0020a 6a 00 push 0
+ 0020c 6a 00 push 0
+ 0020e 83 c1 14 add ecx, 20 ; 00000014H
+ 00211 e8 00 00 00 00 call _zip64local_putValue_inmemory
+
+; 1148 : zip64local_putValue_inmemory(zi->ci.central_header+24,(uLong)0,4); /*uncompr size*/
+
+ 00216 8b 8e 88 00 00
+ 00 mov ecx, DWORD PTR [esi+136]
+ 0021c 83 c4 40 add esp, 64 ; 00000040H
+ 0021f 83 c1 18 add ecx, 24 ; 00000018H
+ 00222 6a 00 push 0
+ 00224 6a 00 push 0
+ 00226 e8 00 00 00 00 call _zip64local_putValue_inmemory
+
+; 1149 : zip64local_putValue_inmemory(zi->ci.central_header+28,(uLong)size_filename,2);
+
+ 0022b 8b 8e 88 00 00
+ 00 mov ecx, DWORD PTR [esi+136]
+ 00231 ba 02 00 00 00 mov edx, 2
+ 00236 6a 00 push 0
+ 00238 57 push edi
+ 00239 83 c1 1c add ecx, 28 ; 0000001cH
+ 0023c e8 00 00 00 00 call _zip64local_putValue_inmemory
+
+; 1150 : zip64local_putValue_inmemory(zi->ci.central_header+30,(uLong)size_extrafield_global,2);
+
+ 00241 6a 00 push 0
+ 00243 8b 8e 88 00 00
+ 00 mov ecx, DWORD PTR [esi+136]
+ 00249 ff 75 20 push DWORD PTR _size_extrafield_global$[ebp]
+ 0024c 83 c1 1e add ecx, 30 ; 0000001eH
+ 0024f e8 00 00 00 00 call _zip64local_putValue_inmemory
+
+; 1151 : zip64local_putValue_inmemory(zi->ci.central_header+32,(uLong)size_comment,2);
+
+ 00254 8b 8e 88 00 00
+ 00 mov ecx, DWORD PTR [esi+136]
+ 0025a 6a 00 push 0
+ 0025c 53 push ebx
+ 0025d 83 c1 20 add ecx, 32 ; 00000020H
+ 00260 e8 00 00 00 00 call _zip64local_putValue_inmemory
+
+; 1152 : zip64local_putValue_inmemory(zi->ci.central_header+34,(uLong)0,2); /*disk nm start*/
+
+ 00265 8b 8e 88 00 00
+ 00 mov ecx, DWORD PTR [esi+136]
+ 0026b 6a 00 push 0
+ 0026d 6a 00 push 0
+ 0026f 83 c1 22 add ecx, 34 ; 00000022H
+ 00272 e8 00 00 00 00 call _zip64local_putValue_inmemory
+
+; 1153 :
+; 1154 : if (zipfi==NULL)
+; 1155 : zip64local_putValue_inmemory(zi->ci.central_header+36,(uLong)0,2);
+
+ 00277 8b 8e 88 00 00
+ 00 mov ecx, DWORD PTR [esi+136]
+ 0027d 83 c4 28 add esp, 40 ; 00000028H
+ 00280 8b 45 10 mov eax, DWORD PTR _zipfi$[ebp]
+ 00283 83 c1 24 add ecx, 36 ; 00000024H
+ 00286 6a 00 push 0
+ 00288 85 c0 test eax, eax
+ 0028a 75 0c jne SHORT $LN27@zipOpenNew
+ 0028c 50 push eax
+ 0028d e8 00 00 00 00 call _zip64local_putValue_inmemory
+
+; 1158 :
+; 1159 : if (zipfi==NULL)
+; 1160 : zip64local_putValue_inmemory(zi->ci.central_header+38,(uLong)0,4);
+
+ 00292 6a 00 push 0
+ 00294 6a 00 push 0
+ 00296 eb 10 jmp SHORT $LN62@zipOpenNew
+$LN27@zipOpenNew:
+
+; 1156 : else
+; 1157 : zip64local_putValue_inmemory(zi->ci.central_header+36,(uLong)zipfi->internal_fa,2);
+
+ 00298 ff 70 1c push DWORD PTR [eax+28]
+ 0029b e8 00 00 00 00 call _zip64local_putValue_inmemory
+
+; 1161 : else
+; 1162 : zip64local_putValue_inmemory(zi->ci.central_header+38,(uLong)zipfi->external_fa,4);
+
+ 002a0 8b 45 10 mov eax, DWORD PTR _zipfi$[ebp]
+ 002a3 6a 00 push 0
+ 002a5 ff 70 20 push DWORD PTR [eax+32]
+$LN62@zipOpenNew:
+ 002a8 8b 8e 88 00 00
+ 00 mov ecx, DWORD PTR [esi+136]
+ 002ae ba 04 00 00 00 mov edx, 4
+ 002b3 83 c1 26 add ecx, 38 ; 00000026H
+ 002b6 e8 00 00 00 00 call _zip64local_putValue_inmemory
+ 002bb 83 c4 10 add esp, 16 ; 00000010H
+
+; 1163 :
+; 1164 : if(zi->ci.pos_local_header >= 0xffffffff)
+
+ 002be 83 be 84 00 00
+ 00 00 cmp DWORD PTR [esi+132], 0
+ 002c5 77 21 ja SHORT $LN60@zipOpenNew
+ 002c7 83 be 80 00 00
+ 00 ff cmp DWORD PTR [esi+128], -1
+ 002ce 73 18 jae SHORT $LN60@zipOpenNew
+
+; 1166 : else
+; 1167 : zip64local_putValue_inmemory(zi->ci.central_header+42,(uLong)zi->ci.pos_local_header - zi->add_position_when_writting_offset,4);
+
+ 002d0 8b 8e 80 00 00
+ 00 mov ecx, DWORD PTR [esi+128]
+ 002d6 33 c0 xor eax, eax
+ 002d8 2b 8e f0 00 01
+ 00 sub ecx, DWORD PTR [esi+65776]
+ 002de 1b 86 f4 00 01
+ 00 sbb eax, DWORD PTR [esi+65780]
+ 002e4 50 push eax
+ 002e5 51 push ecx
+ 002e6 eb 04 jmp SHORT $LN63@zipOpenNew
+$LN60@zipOpenNew:
+
+; 1165 : zip64local_putValue_inmemory(zi->ci.central_header+42,(uLong)0xffffffff,4);
+
+ 002e8 6a 00 push 0
+ 002ea 6a ff push -1
+$LN63@zipOpenNew:
+ 002ec 8b 8e 88 00 00
+ 00 mov ecx, DWORD PTR [esi+136]
+ 002f2 ba 04 00 00 00 mov edx, 4
+ 002f7 83 c1 2a add ecx, 42 ; 0000002aH
+ 002fa e8 00 00 00 00 call _zip64local_putValue_inmemory
+ 002ff 83 c4 08 add esp, 8
+
+; 1168 :
+; 1169 : for (i=0;i<size_filename;i++)
+
+ 00302 33 d2 xor edx, edx
+ 00304 85 ff test edi, edi
+ 00306 74 1e je SHORT $LN3@zipOpenNew
+ 00308 8b 5c 24 10 mov ebx, DWORD PTR _filename$2$[esp+32]
+ 0030c 0f 1f 40 00 npad 4
+$LL4@zipOpenNew:
+
+; 1170 : *(zi->ci.central_header+SIZECENTRALHEADER+i) = *(filename+i);
+
+ 00310 8b 8e 88 00 00
+ 00 mov ecx, DWORD PTR [esi+136]
+ 00316 8a 04 1a mov al, BYTE PTR [edx+ebx]
+ 00319 88 44 11 2e mov BYTE PTR [ecx+edx+46], al
+ 0031d 42 inc edx
+ 0031e 3b d7 cmp edx, edi
+ 00320 72 ee jb SHORT $LL4@zipOpenNew
+ 00322 8b 5c 24 0c mov ebx, DWORD PTR _size_comment$1$[esp+32]
+$LN3@zipOpenNew:
+
+; 1171 :
+; 1172 : for (i=0;i<size_extrafield_global;i++)
+
+ 00326 33 d2 xor edx, edx
+ 00328 39 55 20 cmp DWORD PTR _size_extrafield_global$[ebp], edx
+ 0032b 76 1e jbe SHORT $LN6@zipOpenNew
+ 0032d 8b 5d 20 mov ebx, DWORD PTR _size_extrafield_global$[ebp]
+$LL7@zipOpenNew:
+
+; 1173 : *(zi->ci.central_header+SIZECENTRALHEADER+size_filename+i) =
+
+ 00330 8b 45 1c mov eax, DWORD PTR _extrafield_global$[ebp]
+ 00333 8b 8e 88 00 00
+ 00 mov ecx, DWORD PTR [esi+136]
+ 00339 03 ca add ecx, edx
+ 0033b 8a 04 02 mov al, BYTE PTR [edx+eax]
+ 0033e 42 inc edx
+ 0033f 88 44 39 2e mov BYTE PTR [ecx+edi+46], al
+ 00343 3b d3 cmp edx, ebx
+ 00345 72 e9 jb SHORT $LL7@zipOpenNew
+ 00347 8b 5c 24 0c mov ebx, DWORD PTR _size_comment$1$[esp+32]
+$LN6@zipOpenNew:
+
+; 1174 : *(((const char*)extrafield_global)+i);
+; 1175 :
+; 1176 : for (i=0;i<size_comment;i++)
+
+ 0034b 33 d2 xor edx, edx
+ 0034d 85 db test ebx, ebx
+ 0034f 74 1f je SHORT $LN9@zipOpenNew
+$LL10@zipOpenNew:
+
+; 1177 : *(zi->ci.central_header+SIZECENTRALHEADER+size_filename+
+; 1178 : size_extrafield_global+i) = *(comment+i);
+
+ 00351 8b 8e 88 00 00
+ 00 mov ecx, DWORD PTR [esi+136]
+ 00357 8b 45 24 mov eax, DWORD PTR _comment$[ebp]
+ 0035a 03 ca add ecx, edx
+ 0035c 8b 75 20 mov esi, DWORD PTR _size_extrafield_global$[ebp]
+ 0035f 03 cf add ecx, edi
+ 00361 8a 04 02 mov al, BYTE PTR [edx+eax]
+ 00364 42 inc edx
+ 00365 88 44 31 2e mov BYTE PTR [ecx+esi+46], al
+ 00369 8b 75 08 mov esi, DWORD PTR _file$[ebp]
+ 0036c 3b d3 cmp edx, ebx
+ 0036e 72 e1 jb SHORT $LL10@zipOpenNew
+$LN9@zipOpenNew:
+
+; 1179 : if (zi->ci.central_header == NULL)
+
+ 00370 83 be 88 00 00
+ 00 00 cmp DWORD PTR [esi+136], 0
+ 00377 75 0e jne SHORT $LN33@zipOpenNew
+
+; 1180 : return ZIP_INTERNALERROR;
+
+ 00379 b8 98 ff ff ff mov eax, -104 ; ffffff98H
+
+; 1263 : }
+
+ 0037e 5f pop edi
+ 0037f 5e pop esi
+ 00380 5b pop ebx
+ 00381 8b e5 mov esp, ebp
+ 00383 5d pop ebp
+ 00384 c2 4c 00 ret 76 ; 0000004cH
+$LN33@zipOpenNew:
+
+; 1181 :
+; 1182 : zi->ci.zip64 = zip64;
+; 1183 : zi->ci.totalCompressedData = 0;
+; 1184 : zi->ci.totalUncompressedData = 0;
+; 1185 : zi->ci.pos_zip64extrainfo = 0;
+; 1186 :
+; 1187 : err = Write_LocalFileHeader(zi, filename, size_extrafield_local, extrafield_local);
+
+ 00387 ff 75 14 push DWORD PTR _extrafield_local$[ebp]
+ 0038a 8b 45 50 mov eax, DWORD PTR _zip64$[ebp]
+ 0038d 8b ce mov ecx, esi
+ 0038f ff 75 18 push DWORD PTR _size_extrafield_local$[ebp]
+ 00392 8b 54 24 18 mov edx, DWORD PTR _filename$2$[esp+40]
+ 00396 89 86 b0 00 01
+ 00 mov DWORD PTR [esi+65712], eax
+ 0039c c7 86 c0 00 01
+ 00 00 00 00 00 mov DWORD PTR [esi+65728], 0
+ 003a6 c7 86 c4 00 01
+ 00 00 00 00 00 mov DWORD PTR [esi+65732], 0
+ 003b0 c7 86 c8 00 01
+ 00 00 00 00 00 mov DWORD PTR [esi+65736], 0
+ 003ba c7 86 cc 00 01
+ 00 00 00 00 00 mov DWORD PTR [esi+65740], 0
+ 003c4 c7 86 b8 00 01
+ 00 00 00 00 00 mov DWORD PTR [esi+65720], 0
+ 003ce c7 86 bc 00 01
+ 00 00 00 00 00 mov DWORD PTR [esi+65724], 0
+ 003d8 e8 00 00 00 00 call _Write_LocalFileHeader
+ 003dd 8b d8 mov ebx, eax
+
+; 1188 :
+; 1189 : #ifdef HAVE_BZIP2
+; 1190 : zi->ci.bstream.avail_in = (uInt)0;
+; 1191 : zi->ci.bstream.avail_out = (uInt)Z_BUFSIZE;
+; 1192 : zi->ci.bstream.next_out = (char*)zi->ci.buffered_data;
+; 1193 : zi->ci.bstream.total_in_hi32 = 0;
+; 1194 : zi->ci.bstream.total_in_lo32 = 0;
+; 1195 : zi->ci.bstream.total_out_hi32 = 0;
+; 1196 : zi->ci.bstream.total_out_lo32 = 0;
+; 1197 : #endif
+; 1198 :
+; 1199 : zi->ci.stream.avail_in = (uInt)0;
+
+ 003df c7 46 44 00 00
+ 00 00 mov DWORD PTR [esi+68], 0
+ 003e6 83 c4 08 add esp, 8
+
+; 1200 : zi->ci.stream.avail_out = (uInt)Z_BUFSIZE;
+
+ 003e9 c7 46 50 00 00
+ 01 00 mov DWORD PTR [esi+80], 65536 ; 00010000H
+
+; 1201 : zi->ci.stream.next_out = zi->ci.buffered_data;
+; 1202 : zi->ci.stream.total_in = 0;
+
+ 003f0 c7 46 48 00 00
+ 00 00 mov DWORD PTR [esi+72], 0
+ 003f7 8d 8e a4 00 00
+ 00 lea ecx, DWORD PTR [esi+164]
+ 003fd 89 4e 4c mov DWORD PTR [esi+76], ecx
+
+; 1203 : zi->ci.stream.total_out = 0;
+
+ 00400 c7 46 54 00 00
+ 00 00 mov DWORD PTR [esi+84], 0
+
+; 1204 : zi->ci.stream.data_type = Z_BINARY;
+
+ 00407 c7 46 6c 00 00
+ 00 00 mov DWORD PTR [esi+108], 0
+
+; 1205 :
+; 1206 : #ifdef HAVE_BZIP2
+; 1207 : if ((err==ZIP_OK) && (zi->ci.method == Z_DEFLATED || zi->ci.method == Z_BZIP2ED) && (!zi->ci.raw))
+; 1208 : #else
+; 1209 : if ((err==ZIP_OK) && (zi->ci.method == Z_DEFLATED) && (!zi->ci.raw))
+
+ 0040e 85 db test ebx, ebx
+ 00410 75 4c jne SHORT $LN38@zipOpenNew
+ 00412 83 be 9c 00 00
+ 00 08 cmp DWORD PTR [esi+156], 8
+ 00419 75 43 jne SHORT $LN38@zipOpenNew
+ 0041b 39 86 a0 00 00
+ 00 cmp DWORD PTR [esi+160], eax
+ 00421 75 3b jne SHORT $LN38@zipOpenNew
+
+; 1210 : #endif
+; 1211 : {
+; 1212 : if(zi->ci.method == Z_DEFLATED)
+; 1213 : {
+; 1214 : zi->ci.stream.zalloc = (alloc_func)0;
+
+ 00423 89 46 60 mov DWORD PTR [esi+96], eax
+
+; 1215 : zi->ci.stream.zfree = (free_func)0;
+
+ 00426 89 46 64 mov DWORD PTR [esi+100], eax
+
+; 1216 : zi->ci.stream.opaque = (voidpf)0;
+
+ 00429 89 46 68 mov DWORD PTR [esi+104], eax
+
+; 1217 :
+; 1218 : if (windowBits>0)
+
+ 0042c 8b 45 34 mov eax, DWORD PTR _windowBits$[ebp]
+ 0042f 85 c0 test eax, eax
+ 00431 7e 02 jle SHORT $LN37@zipOpenNew
+
+; 1219 : windowBits = -windowBits;
+
+ 00433 f7 d8 neg eax
+$LN37@zipOpenNew:
+
+; 1220 :
+; 1221 : err = deflateInit2(&zi->ci.stream, level, Z_DEFLATED, windowBits, memLevel, strategy);
+
+ 00435 6a 38 push 56 ; 00000038H
+ 00437 68 00 00 00 00 push OFFSET ??_C@_05IAIEPMAK@1?42?48?$AA@
+ 0043c ff 75 3c push DWORD PTR _strategy$[ebp]
+ 0043f ff 75 38 push DWORD PTR _memLevel$[ebp]
+ 00442 50 push eax
+ 00443 6a 08 push 8
+ 00445 ff 75 2c push DWORD PTR _level$[ebp]
+ 00448 8d 46 40 lea eax, DWORD PTR [esi+64]
+ 0044b 50 push eax
+ 0044c e8 00 00 00 00 call _deflateInit2_@32
+ 00451 8b d8 mov ebx, eax
+
+; 1222 :
+; 1223 : if (err==Z_OK)
+
+ 00453 85 db test ebx, ebx
+ 00455 75 07 jne SHORT $LN38@zipOpenNew
+
+; 1224 : zi->ci.stream_initialised = Z_DEFLATED;
+
+ 00457 c7 46 78 08 00
+ 00 00 mov DWORD PTR [esi+120], 8
+$LN38@zipOpenNew:
+
+; 1225 : }
+; 1226 : else if(zi->ci.method == Z_BZIP2ED)
+; 1227 : {
+; 1228 : #ifdef HAVE_BZIP2
+; 1229 : // Init BZip stuff here
+; 1230 : zi->ci.bstream.bzalloc = 0;
+; 1231 : zi->ci.bstream.bzfree = 0;
+; 1232 : zi->ci.bstream.opaque = (voidpf)0;
+; 1233 :
+; 1234 : err = BZ2_bzCompressInit(&zi->ci.bstream, level, 0,35);
+; 1235 : if(err == BZ_OK)
+; 1236 : zi->ci.stream_initialised = Z_BZIP2ED;
+; 1237 : #endif
+; 1238 : }
+; 1239 :
+; 1240 : }
+; 1241 :
+; 1242 : # ifndef NOCRYPT
+; 1243 : zi->ci.crypt_header_size = 0;
+
+ 0045e c7 86 e0 00 01
+ 00 00 00 00 00 mov DWORD PTR [esi+65760], 0
+
+; 1244 : if ((err==Z_OK) && (password != NULL))
+
+ 00468 85 db test ebx, ebx
+ 0046a 75 68 jne SHORT $LN42@zipOpenNew
+ 0046c 8b 7d 40 mov edi, DWORD PTR _password$[ebp]
+ 0046f 85 ff test edi, edi
+ 00471 74 5a je SHORT $LN57@zipOpenNew
+
+; 1245 : {
+; 1246 : unsigned char bufHead[RAND_HEAD_LEN];
+; 1247 : unsigned int sizeHead;
+; 1248 : zi->ci.encrypt = 1;
+
+ 00473 c7 86 ac 00 01
+ 00 01 00 00 00 mov DWORD PTR [esi+65708], 1
+
+; 1249 : zi->ci.pcrc_32_tab = get_crc_table();
+
+ 0047d e8 00 00 00 00 call _get_crc_table@0
+
+; 1250 : /*init_keys(password,zi->ci.keys,zi->ci.pcrc_32_tab);*/
+; 1251 :
+; 1252 : sizeHead=crypthead(password,bufHead,RAND_HEAD_LEN,zi->ci.keys,zi->ci.pcrc_32_tab,crcForCrypting);
+
+ 00482 ff 75 44 push DWORD PTR _crcForCrypting$[ebp]
+ 00485 89 86 dc 00 01
+ 00 mov DWORD PTR [esi+65756], eax
+ 0048b 8d 54 24 18 lea edx, DWORD PTR _bufHead$1[esp+36]
+ 0048f 50 push eax
+ 00490 8d 86 d0 00 01
+ 00 lea eax, DWORD PTR [esi+65744]
+ 00496 50 push eax
+ 00497 51 push ecx
+ 00498 8b cf mov ecx, edi
+ 0049a e8 00 00 00 00 call _crypthead
+
+; 1253 : zi->ci.crypt_header_size = sizeHead;
+; 1254 :
+; 1255 : if (ZWRITE64(zi->z_filefunc,zi->filestream,bufHead,sizeHead) != sizeHead)
+
+ 0049f 8b 4e 08 mov ecx, DWORD PTR [esi+8]
+ 004a2 8b f8 mov edi, eax
+ 004a4 57 push edi
+ 004a5 8d 44 24 28 lea eax, DWORD PTR _bufHead$1[esp+52]
+ 004a9 89 be e0 00 01
+ 00 mov DWORD PTR [esi+65760], edi
+ 004af 50 push eax
+ 004b0 ff 76 2c push DWORD PTR [esi+44]
+ 004b3 ff 76 1c push DWORD PTR [esi+28]
+ 004b6 ff d1 call ecx
+ 004b8 83 c4 20 add esp, 32 ; 00000020H
+ 004bb 3b c7 cmp eax, edi
+ 004bd 74 0e je SHORT $LN57@zipOpenNew
+
+; 1256 : err = ZIP_ERRNO;
+
+ 004bf 83 cb ff or ebx, -1
+
+; 1262 : return err;
+
+ 004c2 8b c3 mov eax, ebx
+
+; 1263 : }
+
+ 004c4 5f pop edi
+ 004c5 5e pop esi
+ 004c6 5b pop ebx
+ 004c7 8b e5 mov esp, ebp
+ 004c9 5d pop ebp
+ 004ca c2 4c 00 ret 76 ; 0000004cH
+$LN57@zipOpenNew:
+
+; 1257 : }
+; 1258 : # endif
+; 1259 :
+; 1260 : if (err==Z_OK)
+; 1261 : zi->in_opened_file_inzip = 1;
+
+ 004cd c7 46 38 01 00
+ 00 00 mov DWORD PTR [esi+56], 1
+$LN42@zipOpenNew:
+
+; 1262 : return err;
+
+ 004d4 8b c3 mov eax, ebx
+$LN1@zipOpenNew:
+
+; 1263 : }
+
+ 004d6 5f pop edi
+ 004d7 5e pop esi
+ 004d8 5b pop ebx
+ 004d9 8b e5 mov esp, ebp
+ 004db 5d pop ebp
+ 004dc c2 4c 00 ret 76 ; 0000004cH
+_zipOpenNewFileInZip4_64@76 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _zipOpenNewFileInZip3@64
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_filename$ = 12 ; size = 4
+_zipfi$ = 16 ; size = 4
+_extrafield_local$ = 20 ; size = 4
+_size_extrafield_local$ = 24 ; size = 4
+_extrafield_global$ = 28 ; size = 4
+_size_extrafield_global$ = 32 ; size = 4
+_comment$ = 36 ; size = 4
+_method$ = 40 ; size = 4
+_level$ = 44 ; size = 4
+_raw$ = 48 ; size = 4
+_windowBits$ = 52 ; size = 4
+_memLevel$ = 56 ; size = 4
+_strategy$ = 60 ; size = 4
+_password$ = 64 ; size = 4
+_crcForCrypting$ = 68 ; size = 4
+_zipOpenNewFileInZip3@64 PROC ; COMDAT
+
+; 1287 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 1288 : return zipOpenNewFileInZip4_64 (file, filename, zipfi,
+
+ 00003 6a 00 push 0
+ 00005 6a 00 push 0
+ 00007 6a 00 push 0
+ 00009 ff 75 44 push DWORD PTR _crcForCrypting$[ebp]
+ 0000c ff 75 40 push DWORD PTR _password$[ebp]
+ 0000f ff 75 3c push DWORD PTR _strategy$[ebp]
+ 00012 ff 75 38 push DWORD PTR _memLevel$[ebp]
+ 00015 ff 75 34 push DWORD PTR _windowBits$[ebp]
+ 00018 ff 75 30 push DWORD PTR _raw$[ebp]
+ 0001b ff 75 2c push DWORD PTR _level$[ebp]
+ 0001e ff 75 28 push DWORD PTR _method$[ebp]
+ 00021 ff 75 24 push DWORD PTR _comment$[ebp]
+ 00024 ff 75 20 push DWORD PTR _size_extrafield_global$[ebp]
+ 00027 ff 75 1c push DWORD PTR _extrafield_global$[ebp]
+ 0002a ff 75 18 push DWORD PTR _size_extrafield_local$[ebp]
+ 0002d ff 75 14 push DWORD PTR _extrafield_local$[ebp]
+ 00030 ff 75 10 push DWORD PTR _zipfi$[ebp]
+ 00033 ff 75 0c push DWORD PTR _filename$[ebp]
+ 00036 ff 75 08 push DWORD PTR _file$[ebp]
+ 00039 e8 00 00 00 00 call _zipOpenNewFileInZip4_64@76
+
+; 1289 : extrafield_local, size_extrafield_local,
+; 1290 : extrafield_global, size_extrafield_global,
+; 1291 : comment, method, level, raw,
+; 1292 : windowBits, memLevel, strategy,
+; 1293 : password, crcForCrypting, VERSIONMADEBY, 0, 0);
+; 1294 : }
+
+ 0003e 5d pop ebp
+ 0003f c2 40 00 ret 64 ; 00000040H
+_zipOpenNewFileInZip3@64 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _zipOpenNewFileInZip3_64@68
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_filename$ = 12 ; size = 4
+_zipfi$ = 16 ; size = 4
+_extrafield_local$ = 20 ; size = 4
+_size_extrafield_local$ = 24 ; size = 4
+_extrafield_global$ = 28 ; size = 4
+_size_extrafield_global$ = 32 ; size = 4
+_comment$ = 36 ; size = 4
+_method$ = 40 ; size = 4
+_level$ = 44 ; size = 4
+_raw$ = 48 ; size = 4
+_windowBits$ = 52 ; size = 4
+_memLevel$ = 56 ; size = 4
+_strategy$ = 60 ; size = 4
+_password$ = 64 ; size = 4
+_crcForCrypting$ = 68 ; size = 4
+_zip64$ = 72 ; size = 4
+_zipOpenNewFileInZip3_64@68 PROC ; COMDAT
+
+; 1302 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 1303 : return zipOpenNewFileInZip4_64 (file, filename, zipfi,
+
+ 00003 ff 75 48 push DWORD PTR _zip64$[ebp]
+ 00006 6a 00 push 0
+ 00008 6a 00 push 0
+ 0000a ff 75 44 push DWORD PTR _crcForCrypting$[ebp]
+ 0000d ff 75 40 push DWORD PTR _password$[ebp]
+ 00010 ff 75 3c push DWORD PTR _strategy$[ebp]
+ 00013 ff 75 38 push DWORD PTR _memLevel$[ebp]
+ 00016 ff 75 34 push DWORD PTR _windowBits$[ebp]
+ 00019 ff 75 30 push DWORD PTR _raw$[ebp]
+ 0001c ff 75 2c push DWORD PTR _level$[ebp]
+ 0001f ff 75 28 push DWORD PTR _method$[ebp]
+ 00022 ff 75 24 push DWORD PTR _comment$[ebp]
+ 00025 ff 75 20 push DWORD PTR _size_extrafield_global$[ebp]
+ 00028 ff 75 1c push DWORD PTR _extrafield_global$[ebp]
+ 0002b ff 75 18 push DWORD PTR _size_extrafield_local$[ebp]
+ 0002e ff 75 14 push DWORD PTR _extrafield_local$[ebp]
+ 00031 ff 75 10 push DWORD PTR _zipfi$[ebp]
+ 00034 ff 75 0c push DWORD PTR _filename$[ebp]
+ 00037 ff 75 08 push DWORD PTR _file$[ebp]
+ 0003a e8 00 00 00 00 call _zipOpenNewFileInZip4_64@76
+
+; 1304 : extrafield_local, size_extrafield_local,
+; 1305 : extrafield_global, size_extrafield_global,
+; 1306 : comment, method, level, raw,
+; 1307 : windowBits, memLevel, strategy,
+; 1308 : password, crcForCrypting, VERSIONMADEBY, 0, zip64);
+; 1309 : }
+
+ 0003f 5d pop ebp
+ 00040 c2 44 00 ret 68 ; 00000044H
+_zipOpenNewFileInZip3_64@68 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _zipOpenNewFileInZip2@44
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_filename$ = 12 ; size = 4
+_zipfi$ = 16 ; size = 4
+_extrafield_local$ = 20 ; size = 4
+_size_extrafield_local$ = 24 ; size = 4
+_extrafield_global$ = 28 ; size = 4
+_size_extrafield_global$ = 32 ; size = 4
+_comment$ = 36 ; size = 4
+_method$ = 40 ; size = 4
+_level$ = 44 ; size = 4
+_raw$ = 48 ; size = 4
+_zipOpenNewFileInZip2@44 PROC ; COMDAT
+
+; 1315 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 1316 : return zipOpenNewFileInZip4_64 (file, filename, zipfi,
+
+ 00003 6a 00 push 0
+ 00005 6a 00 push 0
+ 00007 6a 00 push 0
+ 00009 6a 00 push 0
+ 0000b 6a 00 push 0
+ 0000d 6a 00 push 0
+ 0000f 6a 08 push 8
+ 00011 6a f1 push -15 ; fffffff1H
+ 00013 ff 75 30 push DWORD PTR _raw$[ebp]
+ 00016 ff 75 2c push DWORD PTR _level$[ebp]
+ 00019 ff 75 28 push DWORD PTR _method$[ebp]
+ 0001c ff 75 24 push DWORD PTR _comment$[ebp]
+ 0001f ff 75 20 push DWORD PTR _size_extrafield_global$[ebp]
+ 00022 ff 75 1c push DWORD PTR _extrafield_global$[ebp]
+ 00025 ff 75 18 push DWORD PTR _size_extrafield_local$[ebp]
+ 00028 ff 75 14 push DWORD PTR _extrafield_local$[ebp]
+ 0002b ff 75 10 push DWORD PTR _zipfi$[ebp]
+ 0002e ff 75 0c push DWORD PTR _filename$[ebp]
+ 00031 ff 75 08 push DWORD PTR _file$[ebp]
+ 00034 e8 00 00 00 00 call _zipOpenNewFileInZip4_64@76
+
+; 1317 : extrafield_local, size_extrafield_local,
+; 1318 : extrafield_global, size_extrafield_global,
+; 1319 : comment, method, level, raw,
+; 1320 : -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY,
+; 1321 : NULL, 0, VERSIONMADEBY, 0, 0);
+; 1322 : }
+
+ 00039 5d pop ebp
+ 0003a c2 2c 00 ret 44 ; 0000002cH
+_zipOpenNewFileInZip2@44 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _zipOpenNewFileInZip2_64@48
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_filename$ = 12 ; size = 4
+_zipfi$ = 16 ; size = 4
+_extrafield_local$ = 20 ; size = 4
+_size_extrafield_local$ = 24 ; size = 4
+_extrafield_global$ = 28 ; size = 4
+_size_extrafield_global$ = 32 ; size = 4
+_comment$ = 36 ; size = 4
+_method$ = 40 ; size = 4
+_level$ = 44 ; size = 4
+_raw$ = 48 ; size = 4
+_zip64$ = 52 ; size = 4
+_zipOpenNewFileInZip2_64@48 PROC ; COMDAT
+
+; 1328 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 1329 : return zipOpenNewFileInZip4_64 (file, filename, zipfi,
+
+ 00003 ff 75 34 push DWORD PTR _zip64$[ebp]
+ 00006 6a 00 push 0
+ 00008 6a 00 push 0
+ 0000a 6a 00 push 0
+ 0000c 6a 00 push 0
+ 0000e 6a 00 push 0
+ 00010 6a 08 push 8
+ 00012 6a f1 push -15 ; fffffff1H
+ 00014 ff 75 30 push DWORD PTR _raw$[ebp]
+ 00017 ff 75 2c push DWORD PTR _level$[ebp]
+ 0001a ff 75 28 push DWORD PTR _method$[ebp]
+ 0001d ff 75 24 push DWORD PTR _comment$[ebp]
+ 00020 ff 75 20 push DWORD PTR _size_extrafield_global$[ebp]
+ 00023 ff 75 1c push DWORD PTR _extrafield_global$[ebp]
+ 00026 ff 75 18 push DWORD PTR _size_extrafield_local$[ebp]
+ 00029 ff 75 14 push DWORD PTR _extrafield_local$[ebp]
+ 0002c ff 75 10 push DWORD PTR _zipfi$[ebp]
+ 0002f ff 75 0c push DWORD PTR _filename$[ebp]
+ 00032 ff 75 08 push DWORD PTR _file$[ebp]
+ 00035 e8 00 00 00 00 call _zipOpenNewFileInZip4_64@76
+
+; 1330 : extrafield_local, size_extrafield_local,
+; 1331 : extrafield_global, size_extrafield_global,
+; 1332 : comment, method, level, raw,
+; 1333 : -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY,
+; 1334 : NULL, 0, VERSIONMADEBY, 0, zip64);
+; 1335 : }
+
+ 0003a 5d pop ebp
+ 0003b c2 30 00 ret 48 ; 00000030H
+_zipOpenNewFileInZip2_64@48 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _zipOpenNewFileInZip64@44
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_filename$ = 12 ; size = 4
+_zipfi$ = 16 ; size = 4
+_extrafield_local$ = 20 ; size = 4
+_size_extrafield_local$ = 24 ; size = 4
+_extrafield_global$ = 28 ; size = 4
+_size_extrafield_global$ = 32 ; size = 4
+_comment$ = 36 ; size = 4
+_method$ = 40 ; size = 4
+_level$ = 44 ; size = 4
+_zip64$ = 48 ; size = 4
+_zipOpenNewFileInZip64@44 PROC ; COMDAT
+
+; 1341 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 1342 : return zipOpenNewFileInZip4_64 (file, filename, zipfi,
+
+ 00003 ff 75 30 push DWORD PTR _zip64$[ebp]
+ 00006 6a 00 push 0
+ 00008 6a 00 push 0
+ 0000a 6a 00 push 0
+ 0000c 6a 00 push 0
+ 0000e 6a 00 push 0
+ 00010 6a 08 push 8
+ 00012 6a f1 push -15 ; fffffff1H
+ 00014 6a 00 push 0
+ 00016 ff 75 2c push DWORD PTR _level$[ebp]
+ 00019 ff 75 28 push DWORD PTR _method$[ebp]
+ 0001c ff 75 24 push DWORD PTR _comment$[ebp]
+ 0001f ff 75 20 push DWORD PTR _size_extrafield_global$[ebp]
+ 00022 ff 75 1c push DWORD PTR _extrafield_global$[ebp]
+ 00025 ff 75 18 push DWORD PTR _size_extrafield_local$[ebp]
+ 00028 ff 75 14 push DWORD PTR _extrafield_local$[ebp]
+ 0002b ff 75 10 push DWORD PTR _zipfi$[ebp]
+ 0002e ff 75 0c push DWORD PTR _filename$[ebp]
+ 00031 ff 75 08 push DWORD PTR _file$[ebp]
+ 00034 e8 00 00 00 00 call _zipOpenNewFileInZip4_64@76
+
+; 1343 : extrafield_local, size_extrafield_local,
+; 1344 : extrafield_global, size_extrafield_global,
+; 1345 : comment, method, level, 0,
+; 1346 : -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY,
+; 1347 : NULL, 0, VERSIONMADEBY, 0, zip64);
+; 1348 : }
+
+ 00039 5d pop ebp
+ 0003a c2 2c 00 ret 44 ; 0000002cH
+_zipOpenNewFileInZip64@44 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _zipOpenNewFileInZip@40
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_filename$ = 12 ; size = 4
+_zipfi$ = 16 ; size = 4
+_extrafield_local$ = 20 ; size = 4
+_size_extrafield_local$ = 24 ; size = 4
+_extrafield_global$ = 28 ; size = 4
+_size_extrafield_global$ = 32 ; size = 4
+_comment$ = 36 ; size = 4
+_method$ = 40 ; size = 4
+_level$ = 44 ; size = 4
+_zipOpenNewFileInZip@40 PROC ; COMDAT
+
+; 1354 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 1355 : return zipOpenNewFileInZip4_64 (file, filename, zipfi,
+
+ 00003 6a 00 push 0
+ 00005 6a 00 push 0
+ 00007 6a 00 push 0
+ 00009 6a 00 push 0
+ 0000b 6a 00 push 0
+ 0000d 6a 00 push 0
+ 0000f 6a 08 push 8
+ 00011 6a f1 push -15 ; fffffff1H
+ 00013 6a 00 push 0
+ 00015 ff 75 2c push DWORD PTR _level$[ebp]
+ 00018 ff 75 28 push DWORD PTR _method$[ebp]
+ 0001b ff 75 24 push DWORD PTR _comment$[ebp]
+ 0001e ff 75 20 push DWORD PTR _size_extrafield_global$[ebp]
+ 00021 ff 75 1c push DWORD PTR _extrafield_global$[ebp]
+ 00024 ff 75 18 push DWORD PTR _size_extrafield_local$[ebp]
+ 00027 ff 75 14 push DWORD PTR _extrafield_local$[ebp]
+ 0002a ff 75 10 push DWORD PTR _zipfi$[ebp]
+ 0002d ff 75 0c push DWORD PTR _filename$[ebp]
+ 00030 ff 75 08 push DWORD PTR _file$[ebp]
+ 00033 e8 00 00 00 00 call _zipOpenNewFileInZip4_64@76
+
+; 1356 : extrafield_local, size_extrafield_local,
+; 1357 : extrafield_global, size_extrafield_global,
+; 1358 : comment, method, level, 0,
+; 1359 : -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY,
+; 1360 : NULL, 0, VERSIONMADEBY, 0, 0);
+; 1361 : }
+
+ 00038 5d pop ebp
+ 00039 c2 28 00 ret 40 ; 00000028H
+_zipOpenNewFileInZip@40 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _zip64FlushWriteBuffer
+_TEXT SEGMENT
+tv237 = -4 ; size = 4
+_zip64FlushWriteBuffer PROC ; COMDAT
+; _zi$ = ecx
+
+; 1364 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 51 push ecx
+ 00004 53 push ebx
+ 00005 56 push esi
+ 00006 8b f1 mov esi, ecx
+
+; 1365 : int err=ZIP_OK;
+
+ 00008 33 db xor ebx, ebx
+ 0000a 57 push edi
+
+; 1366 :
+; 1367 : if (zi->ci.encrypt != 0)
+
+ 0000b 39 9e ac 00 01
+ 00 cmp DWORD PTR [esi+65708], ebx
+ 00011 74 53 je SHORT $LN3@zip64Flush
+
+; 1368 : {
+; 1369 : #ifndef NOCRYPT
+; 1370 : uInt i;
+; 1371 : int t;
+; 1372 : for (i=0;i<zi->ci.pos_in_buffered_data;i++)
+
+ 00013 39 5e 7c cmp DWORD PTR [esi+124], ebx
+ 00016 76 4e jbe SHORT $LN3@zip64Flush
+ 00018 b9 5c ff ff ff mov ecx, -164 ; ffffff5cH
+ 0001d 8d 86 d0 00 01
+ 00 lea eax, DWORD PTR [esi+65744]
+ 00023 2b ce sub ecx, esi
+ 00025 8d be a4 00 00
+ 00 lea edi, DWORD PTR [esi+164]
+ 0002b 89 4d fc mov DWORD PTR tv237[ebp], ecx
+ 0002e 66 90 npad 2
+$LL4@zip64Flush:
+
+; 1373 : zi->ci.buffered_data[i] = zencode(zi->ci.keys, zi->ci.pcrc_32_tab, zi->ci.buffered_data[i],t);
+
+ 00030 8b c8 mov ecx, eax
+ 00032 e8 00 00 00 00 call _decrypt_byte
+ 00037 0f b6 0f movzx ecx, BYTE PTR [edi]
+ 0003a 8b d8 mov ebx, eax
+ 0003c 8b 96 dc 00 01
+ 00 mov edx, DWORD PTR [esi+65756]
+ 00042 51 push ecx
+ 00043 8d 8e d0 00 01
+ 00 lea ecx, DWORD PTR [esi+65744]
+ 00049 e8 00 00 00 00 call _update_keys
+ 0004e 30 1f xor BYTE PTR [edi], bl
+ 00050 83 c4 04 add esp, 4
+ 00053 8b 45 fc mov eax, DWORD PTR tv237[ebp]
+ 00056 47 inc edi
+ 00057 03 c7 add eax, edi
+ 00059 3b 46 7c cmp eax, DWORD PTR [esi+124]
+ 0005c 8d 86 d0 00 01
+ 00 lea eax, DWORD PTR [esi+65744]
+ 00062 72 cc jb SHORT $LL4@zip64Flush
+ 00064 33 db xor ebx, ebx
+$LN3@zip64Flush:
+
+; 1374 : #endif
+; 1375 : }
+; 1376 :
+; 1377 : if (ZWRITE64(zi->z_filefunc,zi->filestream,zi->ci.buffered_data,zi->ci.pos_in_buffered_data) != zi->ci.pos_in_buffered_data)
+
+ 00066 8b 7e 7c mov edi, DWORD PTR [esi+124]
+ 00069 8d 86 a4 00 00
+ 00 lea eax, DWORD PTR [esi+164]
+ 0006f 57 push edi
+ 00070 50 push eax
+ 00071 ff 76 2c push DWORD PTR [esi+44]
+ 00074 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 00077 ff 76 1c push DWORD PTR [esi+28]
+ 0007a ff d0 call eax
+ 0007c 83 c4 10 add esp, 16 ; 00000010H
+
+; 1378 : err = ZIP_ERRNO;
+; 1379 :
+; 1380 : zi->ci.totalCompressedData += zi->ci.pos_in_buffered_data;
+; 1381 :
+; 1382 : #ifdef HAVE_BZIP2
+; 1383 : if(zi->ci.method == Z_BZIP2ED)
+; 1384 : {
+; 1385 : zi->ci.totalUncompressedData += zi->ci.bstream.total_in_lo32;
+; 1386 : zi->ci.bstream.total_in_lo32 = 0;
+; 1387 : zi->ci.bstream.total_in_hi32 = 0;
+; 1388 : }
+; 1389 : else
+; 1390 : #endif
+; 1391 : {
+; 1392 : zi->ci.totalUncompressedData += zi->ci.stream.total_in;
+; 1393 : zi->ci.stream.total_in = 0;
+; 1394 : }
+; 1395 :
+; 1396 :
+; 1397 : zi->ci.pos_in_buffered_data = 0;
+
+ 0007f c7 46 7c 00 00
+ 00 00 mov DWORD PTR [esi+124], 0
+ 00086 83 c9 ff or ecx, -1
+ 00089 3b c7 cmp eax, edi
+ 0008b 0f 45 d9 cmovne ebx, ecx
+ 0008e 01 be c0 00 01
+ 00 add DWORD PTR [esi+65728], edi
+ 00094 8b 4e 48 mov ecx, DWORD PTR [esi+72]
+
+; 1398 :
+; 1399 : return err;
+
+ 00097 8b c3 mov eax, ebx
+ 00099 83 96 c4 00 01
+ 00 00 adc DWORD PTR [esi+65732], 0
+ 000a0 01 8e c8 00 01
+ 00 add DWORD PTR [esi+65736], ecx
+ 000a6 5f pop edi
+ 000a7 83 96 cc 00 01
+ 00 00 adc DWORD PTR [esi+65740], 0
+ 000ae c7 46 48 00 00
+ 00 00 mov DWORD PTR [esi+72], 0
+ 000b5 5e pop esi
+ 000b6 5b pop ebx
+
+; 1400 : }
+
+ 000b7 8b e5 mov esp, ebp
+ 000b9 5d pop ebp
+ 000ba c3 ret 0
+_zip64FlushWriteBuffer ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _zipWriteInFileInZip@12
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_buf$ = 12 ; size = 4
+_len$ = 16 ; size = 4
+_zipWriteInFileInZip@12 PROC ; COMDAT
+
+; 1403 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 56 push esi
+
+; 1404 : zip64_internal* zi;
+; 1405 : int err=ZIP_OK;
+; 1406 :
+; 1407 : if (file == NULL)
+
+ 00004 8b 75 08 mov esi, DWORD PTR _file$[ebp]
+ 00007 85 f6 test esi, esi
+ 00009 75 0a jne SHORT $LN7@zipWriteIn
+$LN29@zipWriteIn:
+
+; 1408 : return ZIP_PARAMERROR;
+
+ 0000b b8 9a ff ff ff mov eax, -102 ; ffffff9aH
+ 00010 5e pop esi
+
+; 1507 : }
+
+ 00011 5d pop ebp
+ 00012 c2 0c 00 ret 12 ; 0000000cH
+$LN7@zipWriteIn:
+
+; 1409 : zi = (zip64_internal*)file;
+; 1410 :
+; 1411 : if (zi->in_opened_file_inzip == 0)
+
+ 00015 83 7e 38 00 cmp DWORD PTR [esi+56], 0
+ 00019 74 f0 je SHORT $LN29@zipWriteIn
+
+; 1412 : return ZIP_PARAMERROR;
+; 1413 :
+; 1414 : zi->ci.crc32 = crc32(zi->ci.crc32,buf,(uInt)len);
+
+ 0001b 53 push ebx
+ 0001c 8b 5d 10 mov ebx, DWORD PTR _len$[ebp]
+ 0001f 57 push edi
+ 00020 8b 7d 0c mov edi, DWORD PTR _buf$[ebp]
+ 00023 53 push ebx
+ 00024 57 push edi
+ 00025 ff b6 a8 00 01
+ 00 push DWORD PTR [esi+65704]
+ 0002b e8 00 00 00 00 call _crc32@12
+
+; 1415 :
+; 1416 : #ifdef HAVE_BZIP2
+; 1417 : if(zi->ci.method == Z_BZIP2ED && (!zi->ci.raw))
+; 1418 : {
+; 1419 : zi->ci.bstream.next_in = (void*)buf;
+; 1420 : zi->ci.bstream.avail_in = len;
+; 1421 : err = BZ_RUN_OK;
+; 1422 :
+; 1423 : while ((err==BZ_RUN_OK) && (zi->ci.bstream.avail_in>0))
+; 1424 : {
+; 1425 : if (zi->ci.bstream.avail_out == 0)
+; 1426 : {
+; 1427 : if (zip64FlushWriteBuffer(zi) == ZIP_ERRNO)
+; 1428 : err = ZIP_ERRNO;
+; 1429 : zi->ci.bstream.avail_out = (uInt)Z_BUFSIZE;
+; 1430 : zi->ci.bstream.next_out = (char*)zi->ci.buffered_data;
+; 1431 : }
+; 1432 :
+; 1433 :
+; 1434 : if(err != BZ_RUN_OK)
+; 1435 : break;
+; 1436 :
+; 1437 : if ((zi->ci.method == Z_BZIP2ED) && (!zi->ci.raw))
+; 1438 : {
+; 1439 : uLong uTotalOutBefore_lo = zi->ci.bstream.total_out_lo32;
+; 1440 : // uLong uTotalOutBefore_hi = zi->ci.bstream.total_out_hi32;
+; 1441 : err=BZ2_bzCompress(&zi->ci.bstream, BZ_RUN);
+; 1442 :
+; 1443 : zi->ci.pos_in_buffered_data += (uInt)(zi->ci.bstream.total_out_lo32 - uTotalOutBefore_lo) ;
+; 1444 : }
+; 1445 : }
+; 1446 :
+; 1447 : if(err == BZ_RUN_OK)
+; 1448 : err = ZIP_OK;
+; 1449 : }
+; 1450 : else
+; 1451 : #endif
+; 1452 : {
+; 1453 : zi->ci.stream.next_in = (Bytef*)buf;
+
+ 00030 8d 4e 40 lea ecx, DWORD PTR [esi+64]
+
+; 1454 : zi->ci.stream.avail_in = len;
+
+ 00033 89 5e 44 mov DWORD PTR [esi+68], ebx
+ 00036 89 39 mov DWORD PTR [ecx], edi
+ 00038 83 cf ff or edi, -1
+ 0003b 89 86 a8 00 01
+ 00 mov DWORD PTR [esi+65704], eax
+ 00041 33 db xor ebx, ebx
+$LL2@zipWriteIn:
+
+; 1455 :
+; 1456 : while ((err==ZIP_OK) && (zi->ci.stream.avail_in>0))
+
+ 00043 83 7e 44 00 cmp DWORD PTR [esi+68], 0
+ 00047 0f 86 9d 00 00
+ 00 jbe $LN28@zipWriteIn
+
+; 1457 : {
+; 1458 : if (zi->ci.stream.avail_out == 0)
+
+ 0004d 83 7e 50 00 cmp DWORD PTR [esi+80], 0
+ 00051 75 20 jne SHORT $LN9@zipWriteIn
+
+; 1459 : {
+; 1460 : if (zip64FlushWriteBuffer(zi) == ZIP_ERRNO)
+
+ 00053 8b ce mov ecx, esi
+ 00055 e8 00 00 00 00 call _zip64FlushWriteBuffer
+ 0005a 83 f8 ff cmp eax, -1
+
+; 1461 : err = ZIP_ERRNO;
+; 1462 : zi->ci.stream.avail_out = (uInt)Z_BUFSIZE;
+
+ 0005d c7 46 50 00 00
+ 01 00 mov DWORD PTR [esi+80], 65536 ; 00010000H
+
+; 1463 : zi->ci.stream.next_out = zi->ci.buffered_data;
+
+ 00064 8d 86 a4 00 00
+ 00 lea eax, DWORD PTR [esi+164]
+ 0006a 0f 44 df cmove ebx, edi
+ 0006d 89 46 4c mov DWORD PTR [esi+76], eax
+ 00070 8d 4e 40 lea ecx, DWORD PTR [esi+64]
+$LN9@zipWriteIn:
+
+; 1464 : }
+; 1465 :
+; 1466 :
+; 1467 : if(err != ZIP_OK)
+
+ 00073 85 db test ebx, ebx
+ 00075 75 73 jne SHORT $LN28@zipWriteIn
+
+; 1468 : break;
+; 1469 :
+; 1470 : if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw))
+
+ 00077 83 be 9c 00 00
+ 00 08 cmp DWORD PTR [esi+156], 8
+ 0007e 75 28 jne SHORT $LN12@zipWriteIn
+ 00080 39 9e a0 00 00
+ 00 cmp DWORD PTR [esi+160], ebx
+ 00086 75 20 jne SHORT $LN12@zipWriteIn
+
+; 1471 : {
+; 1472 : uLong uTotalOutBefore = zi->ci.stream.total_out;
+
+ 00088 8b 7e 54 mov edi, DWORD PTR [esi+84]
+
+; 1473 : err=deflate(&zi->ci.stream, Z_NO_FLUSH);
+
+ 0008b 53 push ebx
+ 0008c 51 push ecx
+ 0008d e8 00 00 00 00 call _deflate@8
+
+; 1474 : if(uTotalOutBefore > zi->ci.stream.total_out)
+; 1475 : {
+; 1476 : int bBreak = 0;
+; 1477 : bBreak++;
+; 1478 : }
+; 1479 :
+; 1480 : zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ;
+
+ 00092 8b 4e 54 mov ecx, DWORD PTR [esi+84]
+ 00095 8b d8 mov ebx, eax
+ 00097 2b cf sub ecx, edi
+ 00099 01 4e 7c add DWORD PTR [esi+124], ecx
+ 0009c 85 db test ebx, ebx
+ 0009e 75 4a jne SHORT $LN28@zipWriteIn
+
+; 1455 :
+; 1456 : while ((err==ZIP_OK) && (zi->ci.stream.avail_in>0))
+
+ 000a0 8d 4e 40 lea ecx, DWORD PTR [esi+64]
+ 000a3 83 cf ff or edi, -1
+ 000a6 eb 9b jmp SHORT $LL2@zipWriteIn
+$LN12@zipWriteIn:
+
+; 1481 : }
+; 1482 : else
+; 1483 : {
+; 1484 : uInt copy_this,i;
+; 1485 : if (zi->ci.stream.avail_in < zi->ci.stream.avail_out)
+
+ 000a8 8b 7e 50 mov edi, DWORD PTR [esi+80]
+ 000ab 39 7e 44 cmp DWORD PTR [esi+68], edi
+ 000ae 0f 42 7e 44 cmovb edi, DWORD PTR [esi+68]
+
+; 1486 : copy_this = zi->ci.stream.avail_in;
+; 1487 : else
+; 1488 : copy_this = zi->ci.stream.avail_out;
+; 1489 :
+; 1490 : for (i = 0; i < copy_this; i++)
+
+ 000b2 33 d2 xor edx, edx
+ 000b4 85 ff test edi, edi
+ 000b6 74 16 je SHORT $LN5@zipWriteIn
+$LL22@zipWriteIn:
+
+; 1491 : *(((char*)zi->ci.stream.next_out)+i) =
+
+ 000b8 8b 01 mov eax, DWORD PTR [ecx]
+ 000ba 8b 4e 4c mov ecx, DWORD PTR [esi+76]
+ 000bd 8a 04 02 mov al, BYTE PTR [edx+eax]
+ 000c0 88 04 0a mov BYTE PTR [edx+ecx], al
+ 000c3 42 inc edx
+ 000c4 8d 4e 40 lea ecx, DWORD PTR [esi+64]
+ 000c7 3b d7 cmp edx, edi
+ 000c9 72 ed jb SHORT $LL22@zipWriteIn
+ 000cb 8d 4e 40 lea ecx, DWORD PTR [esi+64]
+$LN5@zipWriteIn:
+
+; 1492 : *(((const char*)zi->ci.stream.next_in)+i);
+; 1493 : {
+; 1494 : zi->ci.stream.avail_in -= copy_this;
+
+ 000ce 29 7e 44 sub DWORD PTR [esi+68], edi
+
+; 1495 : zi->ci.stream.avail_out-= copy_this;
+
+ 000d1 29 7e 50 sub DWORD PTR [esi+80], edi
+
+; 1496 : zi->ci.stream.next_in+= copy_this;
+
+ 000d4 01 39 add DWORD PTR [ecx], edi
+
+; 1497 : zi->ci.stream.next_out+= copy_this;
+
+ 000d6 01 7e 4c add DWORD PTR [esi+76], edi
+
+; 1498 : zi->ci.stream.total_in+= copy_this;
+
+ 000d9 01 7e 48 add DWORD PTR [esi+72], edi
+
+; 1499 : zi->ci.stream.total_out+= copy_this;
+
+ 000dc 01 7e 54 add DWORD PTR [esi+84], edi
+
+; 1500 : zi->ci.pos_in_buffered_data += copy_this;
+
+ 000df 01 7e 7c add DWORD PTR [esi+124], edi
+ 000e2 83 cf ff or edi, -1
+ 000e5 e9 59 ff ff ff jmp $LL2@zipWriteIn
+$LN28@zipWriteIn:
+ 000ea 5f pop edi
+
+; 1501 : }
+; 1502 : }
+; 1503 : }// while(...)
+; 1504 : }
+; 1505 :
+; 1506 : return err;
+
+ 000eb 8b c3 mov eax, ebx
+ 000ed 5b pop ebx
+ 000ee 5e pop esi
+
+; 1507 : }
+
+ 000ef 5d pop ebp
+ 000f0 c2 0c 00 ret 12 ; 0000000cH
+_zipWriteInFileInZip@12 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _zipCloseFileInZipRaw@12
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_uncompressed_size$ = 12 ; size = 4
+_crc32$ = 16 ; size = 4
+_zipCloseFileInZipRaw@12 PROC ; COMDAT
+
+; 1510 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 e4 f8 and esp, -8 ; fffffff8H
+
+; 1511 : return zipCloseFileInZipRaw64 (file, uncompressed_size, crc32);
+
+ 00006 ff 75 10 push DWORD PTR _crc32$[ebp]
+ 00009 6a 00 push 0
+ 0000b ff 75 0c push DWORD PTR _uncompressed_size$[ebp]
+ 0000e ff 75 08 push DWORD PTR _file$[ebp]
+ 00011 e8 00 00 00 00 call _zipCloseFileInZipRaw64@16
+
+; 1512 : }
+
+ 00016 8b e5 mov esp, ebp
+ 00018 5d pop ebp
+ 00019 c2 0c 00 ret 12 ; 0000000cH
+_zipCloseFileInZipRaw@12 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _zipCloseFileInZipRaw64@16
+_TEXT SEGMENT
+_uncompressed_size$2$ = -28 ; size = 4
+_uncompressed_size$1$ = -24 ; size = 4
+_cur_pos_inzip$2$ = -20 ; size = 4
+_p$1$ = -20 ; size = 4
+_compressed_size$2$ = -16 ; size = 4
+_compressed_size$1$ = -12 ; size = 4
+_crc32$1$ = -8 ; size = 4
+_cur_pos_inzip$1$ = -4 ; size = 4
+tv640 = -4 ; size = 4
+_file$ = 8 ; size = 4
+_uncompressed_size$ = 12 ; size = 8
+_crc32$ = 20 ; size = 4
+_zipCloseFileInZipRaw64@16 PROC ; COMDAT
+
+; 1515 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 e4 f8 and esp, -8 ; fffffff8H
+ 00006 83 ec 1c sub esp, 28 ; 0000001cH
+ 00009 53 push ebx
+ 0000a 56 push esi
+
+; 1516 : zip64_internal* zi;
+; 1517 : ZPOS64_T compressed_size;
+; 1518 : uLong invalidValue = 0xffffffff;
+; 1519 : short datasize = 0;
+; 1520 : int err=ZIP_OK;
+; 1521 :
+; 1522 : if (file == NULL)
+
+ 0000b 8b 75 08 mov esi, DWORD PTR _file$[ebp]
+ 0000e 33 db xor ebx, ebx
+ 00010 57 push edi
+ 00011 85 f6 test esi, esi
+ 00013 75 0e jne SHORT $LN4@zipCloseFi
+$LN82@zipCloseFi:
+
+; 1523 : return ZIP_PARAMERROR;
+
+ 00015 b8 9a ff ff ff mov eax, -102 ; ffffff9aH
+
+; 1748 : }
+
+ 0001a 5f pop edi
+ 0001b 5e pop esi
+ 0001c 5b pop ebx
+ 0001d 8b e5 mov esp, ebp
+ 0001f 5d pop ebp
+ 00020 c2 10 00 ret 16 ; 00000010H
+$LN4@zipCloseFi:
+
+; 1524 : zi = (zip64_internal*)file;
+; 1525 :
+; 1526 : if (zi->in_opened_file_inzip == 0)
+
+ 00023 39 5e 38 cmp DWORD PTR [esi+56], ebx
+ 00026 74 ed je SHORT $LN82@zipCloseFi
+
+; 1527 : return ZIP_PARAMERROR;
+; 1528 : zi->ci.stream.avail_in = 0;
+; 1529 :
+; 1530 : if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw))
+
+ 00028 83 be 9c 00 00
+ 00 08 cmp DWORD PTR [esi+156], 8
+ 0002f 89 5e 44 mov DWORD PTR [esi+68], ebx
+ 00032 75 4d jne SHORT $LN11@zipCloseFi
+ 00034 39 9e a0 00 00
+ 00 cmp DWORD PTR [esi+160], ebx
+ 0003a 75 45 jne SHORT $LN11@zipCloseFi
+ 0003c 0f 1f 40 00 npad 4
+$LL70@zipCloseFi:
+
+; 1531 : {
+; 1532 : while (err==ZIP_OK)
+; 1533 : {
+; 1534 : uLong uTotalOutBefore;
+; 1535 : if (zi->ci.stream.avail_out == 0)
+
+ 00040 83 7e 50 00 cmp DWORD PTR [esi+80], 0
+ 00044 8d 5e 40 lea ebx, DWORD PTR [esi+64]
+ 00047 75 17 jne SHORT $LN8@zipCloseFi
+
+; 1536 : {
+; 1537 : if (zip64FlushWriteBuffer(zi) == ZIP_ERRNO)
+
+ 00049 8b ce mov ecx, esi
+ 0004b e8 00 00 00 00 call _zip64FlushWriteBuffer
+
+; 1538 : err = ZIP_ERRNO;
+; 1539 : zi->ci.stream.avail_out = (uInt)Z_BUFSIZE;
+; 1540 : zi->ci.stream.next_out = zi->ci.buffered_data;
+
+ 00050 8d 86 a4 00 00
+ 00 lea eax, DWORD PTR [esi+164]
+ 00056 c7 46 50 00 00
+ 01 00 mov DWORD PTR [esi+80], 65536 ; 00010000H
+ 0005d 89 46 4c mov DWORD PTR [esi+76], eax
+$LN8@zipCloseFi:
+
+; 1541 : }
+; 1542 : uTotalOutBefore = zi->ci.stream.total_out;
+
+ 00060 8b 7e 54 mov edi, DWORD PTR [esi+84]
+
+; 1543 : err=deflate(&zi->ci.stream, Z_FINISH);
+
+ 00063 6a 04 push 4
+ 00065 53 push ebx
+ 00066 e8 00 00 00 00 call _deflate@8
+ 0006b 8b d8 mov ebx, eax
+
+; 1544 : zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ;
+
+ 0006d 8b 46 54 mov eax, DWORD PTR [esi+84]
+ 00070 2b c7 sub eax, edi
+ 00072 01 46 7c add DWORD PTR [esi+124], eax
+ 00075 85 db test ebx, ebx
+ 00077 74 c7 je SHORT $LL70@zipCloseFi
+
+; 1545 : }
+; 1546 : }
+; 1547 : else if ((zi->ci.method == Z_BZIP2ED) && (!zi->ci.raw))
+; 1548 : {
+; 1549 : #ifdef HAVE_BZIP2
+; 1550 : err = BZ_FINISH_OK;
+; 1551 : while (err==BZ_FINISH_OK)
+; 1552 : {
+; 1553 : uLong uTotalOutBefore;
+; 1554 : if (zi->ci.bstream.avail_out == 0)
+; 1555 : {
+; 1556 : if (zip64FlushWriteBuffer(zi) == ZIP_ERRNO)
+; 1557 : err = ZIP_ERRNO;
+; 1558 : zi->ci.bstream.avail_out = (uInt)Z_BUFSIZE;
+; 1559 : zi->ci.bstream.next_out = (char*)zi->ci.buffered_data;
+; 1560 : }
+; 1561 : uTotalOutBefore = zi->ci.bstream.total_out_lo32;
+; 1562 : err=BZ2_bzCompress(&zi->ci.bstream, BZ_FINISH);
+; 1563 : if(err == BZ_STREAM_END)
+; 1564 : err = Z_STREAM_END;
+; 1565 :
+; 1566 : zi->ci.pos_in_buffered_data += (uInt)(zi->ci.bstream.total_out_lo32 - uTotalOutBefore);
+; 1567 : }
+; 1568 :
+; 1569 : if(err == BZ_FINISH_OK)
+; 1570 : err = ZIP_OK;
+; 1571 : #endif
+; 1572 : }
+; 1573 :
+; 1574 : if (err==Z_STREAM_END)
+
+ 00079 33 c0 xor eax, eax
+ 0007b 83 fb 01 cmp ebx, 1
+ 0007e 0f 44 d8 cmove ebx, eax
+$LN11@zipCloseFi:
+
+; 1575 : err=ZIP_OK; /* this is normal */
+; 1576 :
+; 1577 : if ((zi->ci.pos_in_buffered_data>0) && (err==ZIP_OK))
+
+ 00081 83 cf ff or edi, -1
+ 00084 83 7e 7c 00 cmp DWORD PTR [esi+124], 0
+ 00088 76 10 jbe SHORT $LN13@zipCloseFi
+ 0008a 85 db test ebx, ebx
+ 0008c 75 0c jne SHORT $LN13@zipCloseFi
+
+; 1578 : {
+; 1579 : if (zip64FlushWriteBuffer(zi)==ZIP_ERRNO)
+
+ 0008e 8b ce mov ecx, esi
+ 00090 e8 00 00 00 00 call _zip64FlushWriteBuffer
+ 00095 3b c7 cmp eax, edi
+ 00097 0f 44 df cmove ebx, edi
+$LN13@zipCloseFi:
+
+; 1580 : err = ZIP_ERRNO;
+; 1581 : }
+; 1582 :
+; 1583 : if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw))
+
+ 0009a 83 be 9c 00 00
+ 00 08 cmp DWORD PTR [esi+156], 8
+ 000a1 75 1e jne SHORT $LN14@zipCloseFi
+ 000a3 83 be a0 00 00
+ 00 00 cmp DWORD PTR [esi+160], 0
+ 000aa 75 36 jne SHORT $LN69@zipCloseFi
+
+; 1584 : {
+; 1585 : int tmp_err = deflateEnd(&zi->ci.stream);
+
+ 000ac 8d 46 40 lea eax, DWORD PTR [esi+64]
+ 000af 50 push eax
+ 000b0 e8 00 00 00 00 call _deflateEnd@4
+
+; 1586 : if (err == ZIP_OK)
+
+ 000b5 85 db test ebx, ebx
+
+; 1587 : err = tmp_err;
+; 1588 : zi->ci.stream_initialised = 0;
+
+ 000b7 c7 46 78 00 00
+ 00 00 mov DWORD PTR [esi+120], 0
+ 000be 0f 44 d8 cmove ebx, eax
+$LN14@zipCloseFi:
+
+; 1589 : }
+; 1590 : #ifdef HAVE_BZIP2
+; 1591 : else if((zi->ci.method == Z_BZIP2ED) && (!zi->ci.raw))
+; 1592 : {
+; 1593 : int tmperr = BZ2_bzCompressEnd(&zi->ci.bstream);
+; 1594 : if (err==ZIP_OK)
+; 1595 : err = tmperr;
+; 1596 : zi->ci.stream_initialised = 0;
+; 1597 : }
+; 1598 : #endif
+; 1599 :
+; 1600 : if (!zi->ci.raw)
+
+ 000c1 83 be a0 00 00
+ 00 00 cmp DWORD PTR [esi+160], 0
+ 000c8 75 18 jne SHORT $LN69@zipCloseFi
+
+; 1601 : {
+; 1602 : crc32 = (uLong)zi->ci.crc32;
+
+ 000ca 8b 86 a8 00 01
+ 00 mov eax, DWORD PTR [esi+65704]
+
+; 1603 : uncompressed_size = zi->ci.totalUncompressedData;
+
+ 000d0 8b 8e c8 00 01
+ 00 mov ecx, DWORD PTR [esi+65736]
+ 000d6 89 44 24 20 mov DWORD PTR _crc32$1$[esp+40], eax
+ 000da 8b 86 cc 00 01
+ 00 mov eax, DWORD PTR [esi+65740]
+ 000e0 eb 0d jmp SHORT $LN78@zipCloseFi
+$LN69@zipCloseFi:
+ 000e2 8b 45 14 mov eax, DWORD PTR _crc32$[ebp]
+ 000e5 8b 4d 0c mov ecx, DWORD PTR _uncompressed_size$[ebp]
+ 000e8 89 44 24 20 mov DWORD PTR _crc32$1$[esp+40], eax
+ 000ec 8b 45 10 mov eax, DWORD PTR _uncompressed_size$[ebp+4]
+$LN78@zipCloseFi:
+ 000ef 89 44 24 0c mov DWORD PTR _uncompressed_size$2$[esp+40], eax
+
+; 1604 : }
+; 1605 : compressed_size = zi->ci.totalCompressedData;
+; 1606 :
+; 1607 : # ifndef NOCRYPT
+; 1608 : compressed_size += zi->ci.crypt_header_size;
+
+ 000f3 8b 86 e0 00 01
+ 00 mov eax, DWORD PTR [esi+65760]
+ 000f9 99 cdq
+ 000fa 8b f8 mov edi, eax
+ 000fc 89 4c 24 10 mov DWORD PTR _uncompressed_size$1$[esp+40], ecx
+ 00100 03 be c0 00 01
+ 00 add edi, DWORD PTR [esi+65728]
+ 00106 8b c2 mov eax, edx
+ 00108 89 7c 24 18 mov DWORD PTR _compressed_size$2$[esp+40], edi
+ 0010c 13 86 c4 00 01
+ 00 adc eax, DWORD PTR [esi+65732]
+ 00112 89 44 24 1c mov DWORD PTR _compressed_size$1$[esp+40], eax
+
+; 1609 : # endif
+; 1610 :
+; 1611 : // update Current Item crc and sizes,
+; 1612 : if(compressed_size >= 0xffffffff || uncompressed_size >= 0xffffffff || zi->ci.pos_local_header >= 0xffffffff)
+
+ 00116 85 c0 test eax, eax
+ 00118 77 27 ja SHORT $LN57@zipCloseFi
+ 0011a 72 05 jb SHORT $LN55@zipCloseFi
+ 0011c 83 ff ff cmp edi, -1
+ 0011f 73 20 jae SHORT $LN57@zipCloseFi
+$LN55@zipCloseFi:
+ 00121 83 7c 24 0c 00 cmp DWORD PTR _uncompressed_size$2$[esp+40], 0
+ 00126 77 19 ja SHORT $LN57@zipCloseFi
+ 00128 72 05 jb SHORT $LN56@zipCloseFi
+ 0012a 83 f9 ff cmp ecx, -1
+ 0012d 73 12 jae SHORT $LN57@zipCloseFi
+$LN56@zipCloseFi:
+ 0012f 83 be 84 00 00
+ 00 00 cmp DWORD PTR [esi+132], 0
+ 00136 77 09 ja SHORT $LN57@zipCloseFi
+ 00138 83 be 80 00 00
+ 00 ff cmp DWORD PTR [esi+128], -1
+ 0013f 72 2c jb SHORT $LN17@zipCloseFi
+$LN57@zipCloseFi:
+
+; 1613 : {
+; 1614 : /*version Made by*/
+; 1615 : zip64local_putValue_inmemory(zi->ci.central_header+4,(uLong)45,2);
+
+ 00141 8b 8e 88 00 00
+ 00 mov ecx, DWORD PTR [esi+136]
+ 00147 ba 02 00 00 00 mov edx, 2
+ 0014c 6a 00 push 0
+ 0014e 6a 2d push 45 ; 0000002dH
+ 00150 83 c1 04 add ecx, 4
+ 00153 e8 00 00 00 00 call _zip64local_putValue_inmemory
+
+; 1616 : /*version needed*/
+; 1617 : zip64local_putValue_inmemory(zi->ci.central_header+6,(uLong)45,2);
+
+ 00158 8b 8e 88 00 00
+ 00 mov ecx, DWORD PTR [esi+136]
+ 0015e 6a 00 push 0
+ 00160 6a 2d push 45 ; 0000002dH
+ 00162 83 c1 06 add ecx, 6
+ 00165 e8 00 00 00 00 call _zip64local_putValue_inmemory
+ 0016a 83 c4 10 add esp, 16 ; 00000010H
+$LN17@zipCloseFi:
+
+; 1618 :
+; 1619 : }
+; 1620 :
+; 1621 : zip64local_putValue_inmemory(zi->ci.central_header+16,crc32,4); /*crc*/
+
+ 0016d 8b 8e 88 00 00
+ 00 mov ecx, DWORD PTR [esi+136]
+ 00173 ba 04 00 00 00 mov edx, 4
+ 00178 6a 00 push 0
+ 0017a ff 74 24 24 push DWORD PTR _crc32$1$[esp+44]
+ 0017e 83 c1 10 add ecx, 16 ; 00000010H
+ 00181 e8 00 00 00 00 call _zip64local_putValue_inmemory
+
+; 1622 :
+; 1623 :
+; 1624 : if(compressed_size >= 0xffffffff)
+
+ 00186 8b 44 24 24 mov eax, DWORD PTR _compressed_size$1$[esp+48]
+ 0018a 83 c4 08 add esp, 8
+ 0018d 85 c0 test eax, eax
+ 0018f 75 09 jne SHORT $LN58@zipCloseFi
+ 00191 83 ff ff cmp edi, -1
+ 00194 73 04 jae SHORT $LN58@zipCloseFi
+
+; 1626 : else
+; 1627 : zip64local_putValue_inmemory(zi->ci.central_header+20, compressed_size,4); /*compr size*/
+
+ 00196 50 push eax
+ 00197 57 push edi
+ 00198 eb 04 jmp SHORT $LN79@zipCloseFi
+$LN58@zipCloseFi:
+
+; 1625 : zip64local_putValue_inmemory(zi->ci.central_header+20, invalidValue,4); /*compr size*/
+
+ 0019a 6a 00 push 0
+ 0019c 6a ff push -1
+$LN79@zipCloseFi:
+ 0019e 8b 8e 88 00 00
+ 00 mov ecx, DWORD PTR [esi+136]
+ 001a4 83 c1 14 add ecx, 20 ; 00000014H
+ 001a7 e8 00 00 00 00 call _zip64local_putValue_inmemory
+ 001ac 83 c4 08 add esp, 8
+
+; 1628 :
+; 1629 : /// set internal file attributes field
+; 1630 : if (zi->ci.stream.data_type == Z_ASCII)
+
+ 001af 83 7e 6c 01 cmp DWORD PTR [esi+108], 1
+ 001b3 75 1a jne SHORT $LN21@zipCloseFi
+
+; 1631 : zip64local_putValue_inmemory(zi->ci.central_header+36,(uLong)Z_ASCII,2);
+
+ 001b5 8b 8e 88 00 00
+ 00 mov ecx, DWORD PTR [esi+136]
+ 001bb ba 02 00 00 00 mov edx, 2
+ 001c0 6a 00 push 0
+ 001c2 6a 01 push 1
+ 001c4 83 c1 24 add ecx, 36 ; 00000024H
+ 001c7 e8 00 00 00 00 call _zip64local_putValue_inmemory
+ 001cc 83 c4 08 add esp, 8
+$LN21@zipCloseFi:
+
+; 1632 :
+; 1633 : if(uncompressed_size >= 0xffffffff)
+
+ 001cf 8b 4c 24 0c mov ecx, DWORD PTR _uncompressed_size$2$[esp+40]
+ 001d3 85 c9 test ecx, ecx
+ 001d5 75 0d jne SHORT $LN59@zipCloseFi
+ 001d7 8b 44 24 10 mov eax, DWORD PTR _uncompressed_size$1$[esp+40]
+ 001db 83 f8 ff cmp eax, -1
+ 001de 73 04 jae SHORT $LN59@zipCloseFi
+
+; 1635 : else
+; 1636 : zip64local_putValue_inmemory(zi->ci.central_header+24, uncompressed_size,4); /*uncompr size*/
+
+ 001e0 51 push ecx
+ 001e1 50 push eax
+ 001e2 eb 04 jmp SHORT $LN80@zipCloseFi
+$LN59@zipCloseFi:
+
+; 1634 : zip64local_putValue_inmemory(zi->ci.central_header+24, invalidValue,4); /*uncompr size*/
+
+ 001e4 6a 00 push 0
+ 001e6 6a ff push -1
+$LN80@zipCloseFi:
+ 001e8 8b 8e 88 00 00
+ 00 mov ecx, DWORD PTR [esi+136]
+ 001ee ba 04 00 00 00 mov edx, 4
+ 001f3 83 c1 18 add ecx, 24 ; 00000018H
+ 001f6 e8 00 00 00 00 call _zip64local_putValue_inmemory
+ 001fb 83 c4 08 add esp, 8
+
+; 1637 :
+; 1638 : // Add ZIP64 extra info field for uncompressed size
+; 1639 : if(uncompressed_size >= 0xffffffff)
+
+ 001fe 83 7c 24 0c 00 cmp DWORD PTR _uncompressed_size$2$[esp+40], 0
+ 00203 77 07 ja SHORT $LN60@zipCloseFi
+ 00205 83 7c 24 10 ff cmp DWORD PTR _uncompressed_size$1$[esp+40], -1
+ 0020a 72 07 jb SHORT $LN76@zipCloseFi
+$LN60@zipCloseFi:
+
+; 1640 : datasize += 8;
+
+ 0020c b8 08 00 00 00 mov eax, 8
+ 00211 eb 02 jmp SHORT $LN24@zipCloseFi
+$LN76@zipCloseFi:
+ 00213 33 c0 xor eax, eax
+$LN24@zipCloseFi:
+
+; 1641 :
+; 1642 : // Add ZIP64 extra info field for compressed size
+; 1643 : if(compressed_size >= 0xffffffff)
+
+ 00215 83 7c 24 1c 00 cmp DWORD PTR _compressed_size$1$[esp+40], 0
+ 0021a 77 05 ja SHORT $LN61@zipCloseFi
+ 0021c 83 ff ff cmp edi, -1
+ 0021f 72 03 jb SHORT $LN25@zipCloseFi
+$LN61@zipCloseFi:
+
+; 1644 : datasize += 8;
+
+ 00221 83 c0 08 add eax, 8
+$LN25@zipCloseFi:
+
+; 1645 :
+; 1646 : // Add ZIP64 extra info field for relative offset to local file header of current file
+; 1647 : if(zi->ci.pos_local_header >= 0xffffffff)
+
+ 00224 83 be 84 00 00
+ 00 00 cmp DWORD PTR [esi+132], 0
+ 0022b 77 09 ja SHORT $LN62@zipCloseFi
+ 0022d 83 be 80 00 00
+ 00 ff cmp DWORD PTR [esi+128], -1
+ 00234 72 03 jb SHORT $LN26@zipCloseFi
+$LN62@zipCloseFi:
+
+; 1648 : datasize += 8;
+
+ 00236 83 c0 08 add eax, 8
+$LN26@zipCloseFi:
+
+; 1649 :
+; 1650 : if(datasize > 0)
+
+ 00239 66 85 c0 test ax, ax
+ 0023c 0f 8e 1d 01 00
+ 00 jle $LN27@zipCloseFi
+
+; 1651 : {
+; 1652 : char* p = NULL;
+; 1653 :
+; 1654 : if((uLong)(datasize + 4) > zi->ci.size_centralExtraFree)
+
+ 00242 98 cwde
+ 00243 89 44 24 24 mov DWORD PTR tv640[esp+40], eax
+ 00247 83 c0 04 add eax, 4
+ 0024a 3b 86 94 00 00
+ 00 cmp eax, DWORD PTR [esi+148]
+ 00250 76 0e jbe SHORT $LN28@zipCloseFi
+
+; 1655 : {
+; 1656 : // we can not write more data to the buffer that we have room for.
+; 1657 : return ZIP_BADZIPFILE;
+
+ 00252 b8 99 ff ff ff mov eax, -103 ; ffffff99H
+
+; 1748 : }
+
+ 00257 5f pop edi
+ 00258 5e pop esi
+ 00259 5b pop ebx
+ 0025a 8b e5 mov esp, ebp
+ 0025c 5d pop ebp
+ 0025d c2 10 00 ret 16 ; 00000010H
+$LN28@zipCloseFi:
+
+; 1658 : }
+; 1659 :
+; 1660 : p = zi->ci.central_header + zi->ci.size_centralheader;
+
+ 00260 8b 86 88 00 00
+ 00 mov eax, DWORD PTR [esi+136]
+
+; 1661 :
+; 1662 : // Add Extra Information Header for 'ZIP64 information'
+; 1663 : zip64local_putValue_inmemory(p, 0x0001, 2); // HeaderID
+
+ 00266 ba 02 00 00 00 mov edx, 2
+ 0026b 03 86 90 00 00
+ 00 add eax, DWORD PTR [esi+144]
+ 00271 6a 00 push 0
+ 00273 6a 01 push 1
+ 00275 8b c8 mov ecx, eax
+ 00277 89 44 24 1c mov DWORD PTR _p$1$[esp+48], eax
+ 0027b e8 00 00 00 00 call _zip64local_putValue_inmemory
+
+; 1664 : p += 2;
+
+ 00280 8b 4c 24 1c mov ecx, DWORD PTR _p$1$[esp+48]
+
+; 1665 : zip64local_putValue_inmemory(p, datasize, 2); // DataSize
+
+ 00284 8b 44 24 2c mov eax, DWORD PTR tv640[esp+48]
+ 00288 03 ca add ecx, edx
+ 0028a 99 cdq
+ 0028b 52 push edx
+ 0028c 50 push eax
+ 0028d ba 02 00 00 00 mov edx, 2
+ 00292 89 4c 24 24 mov DWORD PTR _p$1$[esp+56], ecx
+ 00296 e8 00 00 00 00 call _zip64local_putValue_inmemory
+
+; 1666 : p += 2;
+
+ 0029b 8b 44 24 24 mov eax, DWORD PTR _p$1$[esp+56]
+ 0029f 83 c4 10 add esp, 16 ; 00000010H
+
+; 1667 :
+; 1668 : if(uncompressed_size >= 0xffffffff)
+
+ 002a2 8b 4c 24 10 mov ecx, DWORD PTR _uncompressed_size$1$[esp+40]
+ 002a6 03 c2 add eax, edx
+ 002a8 8b 54 24 0c mov edx, DWORD PTR _uncompressed_size$2$[esp+40]
+ 002ac 89 44 24 14 mov DWORD PTR _p$1$[esp+40], eax
+ 002b0 85 d2 test edx, edx
+ 002b2 75 05 jne SHORT $LN63@zipCloseFi
+ 002b4 83 f9 ff cmp ecx, -1
+ 002b7 72 1b jb SHORT $LN29@zipCloseFi
+$LN63@zipCloseFi:
+
+; 1669 : {
+; 1670 : zip64local_putValue_inmemory(p, uncompressed_size, 8);
+
+ 002b9 52 push edx
+ 002ba 51 push ecx
+ 002bb ba 08 00 00 00 mov edx, 8
+ 002c0 8b c8 mov ecx, eax
+ 002c2 e8 00 00 00 00 call _zip64local_putValue_inmemory
+
+; 1671 : p += 8;
+
+ 002c7 8b 44 24 1c mov eax, DWORD PTR _p$1$[esp+48]
+ 002cb 83 c4 08 add esp, 8
+ 002ce 03 c2 add eax, edx
+ 002d0 89 44 24 14 mov DWORD PTR _p$1$[esp+40], eax
+$LN29@zipCloseFi:
+
+; 1672 : }
+; 1673 :
+; 1674 : if(compressed_size >= 0xffffffff)
+
+ 002d4 8b 4c 24 1c mov ecx, DWORD PTR _compressed_size$1$[esp+40]
+ 002d8 85 c9 test ecx, ecx
+ 002da 75 05 jne SHORT $LN64@zipCloseFi
+ 002dc 83 ff ff cmp edi, -1
+ 002df 72 17 jb SHORT $LN30@zipCloseFi
+$LN64@zipCloseFi:
+
+; 1675 : {
+; 1676 : zip64local_putValue_inmemory(p, compressed_size, 8);
+
+ 002e1 51 push ecx
+ 002e2 57 push edi
+ 002e3 ba 08 00 00 00 mov edx, 8
+ 002e8 8b c8 mov ecx, eax
+ 002ea e8 00 00 00 00 call _zip64local_putValue_inmemory
+
+; 1677 : p += 8;
+
+ 002ef 8b 44 24 1c mov eax, DWORD PTR _p$1$[esp+48]
+ 002f3 83 c4 08 add esp, 8
+ 002f6 03 c2 add eax, edx
+$LN30@zipCloseFi:
+
+; 1678 : }
+; 1679 :
+; 1680 : if(zi->ci.pos_local_header >= 0xffffffff)
+
+ 002f8 8b be 84 00 00
+ 00 mov edi, DWORD PTR [esi+132]
+ 002fe 8b 8e 80 00 00
+ 00 mov ecx, DWORD PTR [esi+128]
+ 00304 85 ff test edi, edi
+ 00306 75 05 jne SHORT $LN65@zipCloseFi
+ 00308 83 f9 ff cmp ecx, -1
+ 0030b 72 11 jb SHORT $LN31@zipCloseFi
+$LN65@zipCloseFi:
+
+; 1681 : {
+; 1682 : zip64local_putValue_inmemory(p, zi->ci.pos_local_header, 8);
+
+ 0030d 57 push edi
+ 0030e 51 push ecx
+ 0030f ba 08 00 00 00 mov edx, 8
+ 00314 8b c8 mov ecx, eax
+ 00316 e8 00 00 00 00 call _zip64local_putValue_inmemory
+ 0031b 83 c4 08 add esp, 8
+$LN31@zipCloseFi:
+
+; 1683 : p += 8;
+; 1684 : }
+; 1685 :
+; 1686 : // Update how much extra free space we got in the memory buffer
+; 1687 : // and increase the centralheader size so the new ZIP64 fields are included
+; 1688 : // ( 4 below is the size of HeaderID and DataSize field )
+; 1689 : zi->ci.size_centralExtraFree -= datasize + 4;
+
+ 0031e 8b 4c 24 24 mov ecx, DWORD PTR tv640[esp+40]
+ 00322 b8 fc ff ff ff mov eax, -4 ; fffffffcH
+ 00327 2b c1 sub eax, ecx
+
+; 1690 : zi->ci.size_centralheader += datasize + 4;
+; 1691 :
+; 1692 : // Update the extra info size field
+; 1693 : zi->ci.size_centralExtra += datasize + 4;
+; 1694 : zip64local_putValue_inmemory(zi->ci.central_header+30,(uLong)zi->ci.size_centralExtra,2);
+
+ 00329 ba 02 00 00 00 mov edx, 2
+ 0032e 01 86 94 00 00
+ 00 add DWORD PTR [esi+148], eax
+ 00334 6a 00 push 0
+ 00336 8d 41 04 lea eax, DWORD PTR [ecx+4]
+ 00339 01 86 90 00 00
+ 00 add DWORD PTR [esi+144], eax
+ 0033f 8d 41 04 lea eax, DWORD PTR [ecx+4]
+ 00342 01 86 8c 00 00
+ 00 add DWORD PTR [esi+140], eax
+ 00348 8b 8e 88 00 00
+ 00 mov ecx, DWORD PTR [esi+136]
+ 0034e ff b6 8c 00 00
+ 00 push DWORD PTR [esi+140]
+ 00354 83 c1 1e add ecx, 30 ; 0000001eH
+ 00357 e8 00 00 00 00 call _zip64local_putValue_inmemory
+ 0035c 83 c4 08 add esp, 8
+$LN27@zipCloseFi:
+
+; 1695 : }
+; 1696 :
+; 1697 : if (err==ZIP_OK)
+
+ 0035f 85 db test ebx, ebx
+ 00361 75 19 jne SHORT $LN32@zipCloseFi
+
+; 1698 : err = add_data_in_datablock(&zi->central_dir, zi->ci.central_header, (uLong)zi->ci.size_centralheader);
+
+ 00363 ff b6 90 00 00
+ 00 push DWORD PTR [esi+144]
+ 00369 8b 96 88 00 00
+ 00 mov edx, DWORD PTR [esi+136]
+ 0036f 8d 4e 30 lea ecx, DWORD PTR [esi+48]
+ 00372 e8 00 00 00 00 call _add_data_in_datablock
+ 00377 83 c4 04 add esp, 4
+ 0037a 8b d8 mov ebx, eax
+$LN32@zipCloseFi:
+
+; 1699 :
+; 1700 : free(zi->ci.central_header);
+
+ 0037c ff b6 88 00 00
+ 00 push DWORD PTR [esi+136]
+ 00382 ff 15 00 00 00
+ 00 call DWORD PTR __imp__free
+ 00388 83 c4 04 add esp, 4
+
+; 1701 :
+; 1702 : if (err==ZIP_OK)
+
+ 0038b 85 db test ebx, ebx
+ 0038d 0f 85 3a 01 00
+ 00 jne $LN46@zipCloseFi
+
+; 1703 : {
+; 1704 : // Update the LocalFileHeader with the new values.
+; 1705 :
+; 1706 : ZPOS64_T cur_pos_inzip = ZTELL64(zi->z_filefunc,zi->filestream);
+
+ 00393 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00396 8b ce mov ecx, esi
+ 00398 e8 00 00 00 00 call _call_ztell64
+
+; 1707 :
+; 1708 : if (ZSEEK64(zi->z_filefunc,zi->filestream, zi->ci.pos_local_header + 14,ZLIB_FILEFUNC_SEEK_SET)!=0)
+
+ 0039d 8b be 80 00 00
+ 00 mov edi, DWORD PTR [esi+128]
+ 003a3 8b 8e 84 00 00
+ 00 mov ecx, DWORD PTR [esi+132]
+ 003a9 83 c7 0e add edi, 14 ; 0000000eH
+ 003ac 53 push ebx
+ 003ad 13 cb adc ecx, ebx
+ 003af 89 54 24 28 mov DWORD PTR _cur_pos_inzip$1$[esp+44], edx
+ 003b3 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 003b6 51 push ecx
+ 003b7 57 push edi
+ 003b8 8b ce mov ecx, esi
+ 003ba 89 44 24 20 mov DWORD PTR _cur_pos_inzip$2$[esp+52], eax
+ 003be e8 00 00 00 00 call _call_zseek64
+ 003c3 83 c4 0c add esp, 12 ; 0000000cH
+ 003c6 85 c0 test eax, eax
+ 003c8 74 05 je SHORT $LN53@zipCloseFi
+
+; 1709 : err = ZIP_ERRNO;
+
+ 003ca 83 cb ff or ebx, -1
+
+; 1710 :
+; 1711 : if (err==ZIP_OK)
+
+ 003cd eb 17 jmp SHORT $LN35@zipCloseFi
+$LN53@zipCloseFi:
+
+; 1712 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,crc32,4); /* crc 32, unknown */
+
+ 003cf 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 003d2 8b ce mov ecx, esi
+ 003d4 6a 04 push 4
+ 003d6 6a 00 push 0
+ 003d8 ff 74 24 28 push DWORD PTR _crc32$1$[esp+48]
+ 003dc e8 00 00 00 00 call _zip64local_putValue
+ 003e1 83 c4 0c add esp, 12 ; 0000000cH
+ 003e4 8b d8 mov ebx, eax
+$LN35@zipCloseFi:
+
+; 1713 :
+; 1714 : if(uncompressed_size >= 0xffffffff || compressed_size >= 0xffffffff )
+
+ 003e6 83 7c 24 0c 00 cmp DWORD PTR _uncompressed_size$2$[esp+40], 0
+ 003eb 77 4b ja SHORT $LN73@zipCloseFi
+ 003ed 72 07 jb SHORT $LN66@zipCloseFi
+ 003ef 83 7c 24 10 ff cmp DWORD PTR _uncompressed_size$1$[esp+40], -1
+ 003f4 73 42 jae SHORT $LN73@zipCloseFi
+$LN66@zipCloseFi:
+ 003f6 8b 44 24 1c mov eax, DWORD PTR _compressed_size$1$[esp+40]
+ 003fa 8b 7c 24 18 mov edi, DWORD PTR _compressed_size$2$[esp+40]
+ 003fe 85 c0 test eax, eax
+ 00400 77 3a ja SHORT $LN38@zipCloseFi
+ 00402 72 05 jb SHORT $LN67@zipCloseFi
+ 00404 83 ff ff cmp edi, -1
+ 00407 73 33 jae SHORT $LN38@zipCloseFi
+$LN67@zipCloseFi:
+
+; 1730 : }
+; 1731 : else
+; 1732 : {
+; 1733 : if (err==ZIP_OK) /* compressed size, unknown */
+
+ 00409 85 db test ebx, ebx
+ 0040b 0f 85 9b 00 00
+ 00 jne $LN40@zipCloseFi
+
+; 1734 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,compressed_size,4);
+
+ 00411 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00414 8b ce mov ecx, esi
+ 00416 6a 04 push 4
+ 00418 50 push eax
+ 00419 57 push edi
+ 0041a e8 00 00 00 00 call _zip64local_putValue
+ 0041f 8b d8 mov ebx, eax
+ 00421 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1735 :
+; 1736 : if (err==ZIP_OK) /* uncompressed size, unknown */
+
+ 00424 85 db test ebx, ebx
+ 00426 0f 85 80 00 00
+ 00 jne $LN40@zipCloseFi
+
+; 1737 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,uncompressed_size,4);
+
+ 0042c 6a 04 push 4
+ 0042e ff 74 24 10 push DWORD PTR _uncompressed_size$2$[esp+44]
+ 00432 ff 74 24 18 push DWORD PTR _uncompressed_size$1$[esp+48]
+ 00436 eb 65 jmp SHORT $LN81@zipCloseFi
+$LN73@zipCloseFi:
+ 00438 8b 7c 24 18 mov edi, DWORD PTR _compressed_size$2$[esp+40]
+$LN38@zipCloseFi:
+
+; 1715 : {
+; 1716 : if(zi->ci.pos_zip64extrainfo > 0)
+
+ 0043c 8b 8e bc 00 01
+ 00 mov ecx, DWORD PTR [esi+65724]
+ 00442 8b 86 b8 00 01
+ 00 mov eax, DWORD PTR [esi+65720]
+ 00448 85 c9 test ecx, ecx
+ 0044a 75 09 jne SHORT $LN68@zipCloseFi
+ 0044c 85 c0 test eax, eax
+ 0044e 75 05 jne SHORT $LN68@zipCloseFi
+
+; 1727 : }
+; 1728 : else
+; 1729 : err = ZIP_BADZIPFILE; // Caller passed zip64 = 0, so no room for zip64 info -> fatal
+
+ 00450 8d 58 99 lea ebx, DWORD PTR [eax-103]
+ 00453 eb 57 jmp SHORT $LN40@zipCloseFi
+$LN68@zipCloseFi:
+
+; 1717 : {
+; 1718 : // Update the size in the ZIP64 extended field.
+; 1719 : if (ZSEEK64(zi->z_filefunc,zi->filestream, zi->ci.pos_zip64extrainfo + 4,ZLIB_FILEFUNC_SEEK_SET)!=0)
+
+ 00455 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00458 83 c0 04 add eax, 4
+ 0045b 6a 00 push 0
+ 0045d 83 d1 00 adc ecx, 0
+ 00460 51 push ecx
+ 00461 50 push eax
+ 00462 8b ce mov ecx, esi
+ 00464 e8 00 00 00 00 call _call_zseek64
+ 00469 83 c4 0c add esp, 12 ; 0000000cH
+ 0046c 85 c0 test eax, eax
+ 0046e 74 05 je SHORT $LN41@zipCloseFi
+
+; 1720 : err = ZIP_ERRNO;
+
+ 00470 83 cb ff or ebx, -1
+
+; 1721 :
+; 1722 : if (err==ZIP_OK) /* compressed size, unknown */
+
+ 00473 eb 37 jmp SHORT $LN40@zipCloseFi
+$LN41@zipCloseFi:
+ 00475 85 db test ebx, ebx
+ 00477 75 33 jne SHORT $LN40@zipCloseFi
+
+; 1723 : err = zip64local_putValue(&zi->z_filefunc, zi->filestream, uncompressed_size, 8);
+
+ 00479 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 0047c 8b ce mov ecx, esi
+ 0047e 6a 08 push 8
+ 00480 ff 74 24 10 push DWORD PTR _uncompressed_size$2$[esp+44]
+ 00484 ff 74 24 18 push DWORD PTR _uncompressed_size$1$[esp+48]
+ 00488 e8 00 00 00 00 call _zip64local_putValue
+ 0048d 8b d8 mov ebx, eax
+ 0048f 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1724 :
+; 1725 : if (err==ZIP_OK) /* uncompressed size, unknown */
+
+ 00492 85 db test ebx, ebx
+ 00494 75 16 jne SHORT $LN40@zipCloseFi
+
+; 1726 : err = zip64local_putValue(&zi->z_filefunc, zi->filestream, compressed_size, 8);
+
+ 00496 6a 08 push 8
+ 00498 ff 74 24 20 push DWORD PTR _compressed_size$1$[esp+44]
+ 0049c 57 push edi
+$LN81@zipCloseFi:
+ 0049d 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 004a0 8b ce mov ecx, esi
+ 004a2 e8 00 00 00 00 call _zip64local_putValue
+ 004a7 8b d8 mov ebx, eax
+ 004a9 83 c4 0c add esp, 12 ; 0000000cH
+$LN40@zipCloseFi:
+
+; 1738 : }
+; 1739 :
+; 1740 : if (ZSEEK64(zi->z_filefunc,zi->filestream, cur_pos_inzip,ZLIB_FILEFUNC_SEEK_SET)!=0)
+
+ 004ac 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 004af 8b ce mov ecx, esi
+ 004b1 6a 00 push 0
+ 004b3 ff 74 24 28 push DWORD PTR _cur_pos_inzip$1$[esp+44]
+ 004b7 ff 74 24 1c push DWORD PTR _cur_pos_inzip$2$[esp+48]
+ 004bb e8 00 00 00 00 call _call_zseek64
+ 004c0 83 c4 0c add esp, 12 ; 0000000cH
+ 004c3 85 c0 test eax, eax
+ 004c5 b8 ff ff ff ff mov eax, -1
+ 004ca 0f 45 d8 cmovne ebx, eax
+$LN46@zipCloseFi:
+
+; 1741 : err = ZIP_ERRNO;
+; 1742 : }
+; 1743 :
+; 1744 : zi->number_entry ++;
+
+ 004cd 83 86 f8 00 01
+ 00 01 add DWORD PTR [esi+65784], 1
+
+; 1745 : zi->in_opened_file_inzip = 0;
+; 1746 :
+; 1747 : return err;
+
+ 004d4 8b c3 mov eax, ebx
+
+; 1748 : }
+
+ 004d6 5f pop edi
+ 004d7 83 96 fc 00 01
+ 00 00 adc DWORD PTR [esi+65788], 0
+ 004de c7 46 38 00 00
+ 00 00 mov DWORD PTR [esi+56], 0
+ 004e5 5e pop esi
+ 004e6 5b pop ebx
+ 004e7 8b e5 mov esp, ebp
+ 004e9 5d pop ebp
+ 004ea c2 10 00 ret 16 ; 00000010H
+_zipCloseFileInZipRaw64@16 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _zipCloseFileInZip@4
+_TEXT SEGMENT
+_file$ = 8 ; size = 4
+_zipCloseFileInZip@4 PROC ; COMDAT
+
+; 1751 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 1752 : return zipCloseFileInZipRaw (file,0,0);
+
+ 00003 6a 00 push 0
+ 00005 6a 00 push 0
+ 00007 ff 75 08 push DWORD PTR _file$[ebp]
+ 0000a e8 00 00 00 00 call _zipCloseFileInZipRaw@12
+
+; 1753 : }
+
+ 0000f 5d pop ebp
+ 00010 c2 04 00 ret 4
+_zipCloseFileInZip@4 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _Write_Zip64EndOfCentralDirectoryLocator
+_TEXT SEGMENT
+_zip64eocd_pos_inzip$ = 8 ; size = 8
+_Write_Zip64EndOfCentralDirectoryLocator PROC ; COMDAT
+; _zi$ = ecx
+
+; 1756 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 53 push ebx
+
+; 1757 : int err = ZIP_OK;
+; 1758 : ZPOS64_T pos = zip64eocd_pos_inzip - zi->add_position_when_writting_offset;
+
+ 00004 8b 5d 0c mov ebx, DWORD PTR _zip64eocd_pos_inzip$[ebp+4]
+ 00007 56 push esi
+ 00008 57 push edi
+ 00009 8b 7d 08 mov edi, DWORD PTR _zip64eocd_pos_inzip$[ebp]
+ 0000c 8b f1 mov esi, ecx
+
+; 1759 :
+; 1760 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)ZIP64ENDLOCHEADERMAGIC,4);
+
+ 0000e 6a 04 push 4
+ 00010 6a 00 push 0
+ 00012 68 50 4b 06 07 push 117853008 ; 07064b50H
+ 00017 2b be f0 00 01
+ 00 sub edi, DWORD PTR [esi+65776]
+ 0001d 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00020 1b 9e f4 00 01
+ 00 sbb ebx, DWORD PTR [esi+65780]
+ 00026 e8 00 00 00 00 call _zip64local_putValue
+ 0002b 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1761 :
+; 1762 : /*num disks*/
+; 1763 : if (err==ZIP_OK) /* number of the disk with the start of the central directory */
+
+ 0002e 85 c0 test eax, eax
+ 00030 75 3c jne SHORT $LN4@Write_Zip6
+
+; 1764 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4);
+
+ 00032 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00035 8b ce mov ecx, esi
+ 00037 6a 04 push 4
+ 00039 50 push eax
+ 0003a 50 push eax
+ 0003b e8 00 00 00 00 call _zip64local_putValue
+ 00040 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1765 :
+; 1766 : /*relative offset*/
+; 1767 : if (err==ZIP_OK) /* Relative offset to the Zip64EndOfCentralDirectory */
+
+ 00043 85 c0 test eax, eax
+ 00045 75 27 jne SHORT $LN4@Write_Zip6
+
+; 1768 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream, pos,8);
+
+ 00047 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 0004a 8b ce mov ecx, esi
+ 0004c 6a 08 push 8
+ 0004e 53 push ebx
+ 0004f 57 push edi
+ 00050 e8 00 00 00 00 call _zip64local_putValue
+ 00055 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1769 :
+; 1770 : /*total disks*/ /* Do not support spawning of disk so always say 1 here*/
+; 1771 : if (err==ZIP_OK) /* number of the disk with the start of the central directory */
+
+ 00058 85 c0 test eax, eax
+ 0005a 75 12 jne SHORT $LN4@Write_Zip6
+
+; 1772 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)1,4);
+
+ 0005c 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 0005f 8b ce mov ecx, esi
+ 00061 6a 04 push 4
+ 00063 50 push eax
+ 00064 6a 01 push 1
+ 00066 e8 00 00 00 00 call _zip64local_putValue
+ 0006b 83 c4 0c add esp, 12 ; 0000000cH
+$LN4@Write_Zip6:
+
+; 1773 :
+; 1774 : return err;
+; 1775 : }
+
+ 0006e 5f pop edi
+ 0006f 5e pop esi
+ 00070 5b pop ebx
+ 00071 5d pop ebp
+ 00072 c3 ret 0
+_Write_Zip64EndOfCentralDirectoryLocator ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _Write_Zip64EndOfCentralDirectoryRecord
+_TEXT SEGMENT
+_centraldir_pos_inzip$ = 8 ; size = 8
+_Write_Zip64EndOfCentralDirectoryRecord PROC ; COMDAT
+; _zi$ = ecx
+; _size_centraldir$ = edx
+
+; 1778 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 56 push esi
+ 00004 57 push edi
+ 00005 8b f1 mov esi, ecx
+ 00007 8b fa mov edi, edx
+
+; 1779 : int err = ZIP_OK;
+; 1780 :
+; 1781 : uLong Zip64DataSize = 44;
+; 1782 :
+; 1783 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)ZIP64ENDHEADERMAGIC,4);
+
+ 00009 6a 04 push 4
+ 0000b 6a 00 push 0
+ 0000d 68 50 4b 06 06 push 101075792 ; 06064b50H
+ 00012 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00015 e8 00 00 00 00 call _zip64local_putValue
+ 0001a 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1784 :
+; 1785 : if (err==ZIP_OK) /* size of this 'zip64 end of central directory' */
+
+ 0001d 85 c0 test eax, eax
+ 0001f 0f 85 f2 00 00
+ 00 jne $LN10@Write_Zip6
+
+; 1786 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(ZPOS64_T)Zip64DataSize,8); // why ZPOS64_T of this ?
+
+ 00025 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00028 8b ce mov ecx, esi
+ 0002a 6a 08 push 8
+ 0002c 50 push eax
+ 0002d 6a 2c push 44 ; 0000002cH
+ 0002f e8 00 00 00 00 call _zip64local_putValue
+ 00034 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1787 :
+; 1788 : if (err==ZIP_OK) /* version made by */
+
+ 00037 85 c0 test eax, eax
+ 00039 0f 85 d8 00 00
+ 00 jne $LN10@Write_Zip6
+
+; 1789 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)45,2);
+
+ 0003f 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00042 8b ce mov ecx, esi
+ 00044 6a 02 push 2
+ 00046 50 push eax
+ 00047 6a 2d push 45 ; 0000002dH
+ 00049 e8 00 00 00 00 call _zip64local_putValue
+ 0004e 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1790 :
+; 1791 : if (err==ZIP_OK) /* version needed */
+
+ 00051 85 c0 test eax, eax
+ 00053 0f 85 be 00 00
+ 00 jne $LN10@Write_Zip6
+
+; 1792 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)45,2);
+
+ 00059 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 0005c 8b ce mov ecx, esi
+ 0005e 6a 02 push 2
+ 00060 50 push eax
+ 00061 6a 2d push 45 ; 0000002dH
+ 00063 e8 00 00 00 00 call _zip64local_putValue
+ 00068 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1793 :
+; 1794 : if (err==ZIP_OK) /* number of this disk */
+
+ 0006b 85 c0 test eax, eax
+ 0006d 0f 85 a4 00 00
+ 00 jne $LN10@Write_Zip6
+
+; 1795 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4);
+
+ 00073 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00076 8b ce mov ecx, esi
+ 00078 6a 04 push 4
+ 0007a 50 push eax
+ 0007b 50 push eax
+ 0007c e8 00 00 00 00 call _zip64local_putValue
+ 00081 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1796 :
+; 1797 : if (err==ZIP_OK) /* number of the disk with the start of the central directory */
+
+ 00084 85 c0 test eax, eax
+ 00086 0f 85 8b 00 00
+ 00 jne $LN10@Write_Zip6
+
+; 1798 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4);
+
+ 0008c 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 0008f 8b ce mov ecx, esi
+ 00091 6a 04 push 4
+ 00093 50 push eax
+ 00094 50 push eax
+ 00095 e8 00 00 00 00 call _zip64local_putValue
+ 0009a 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1799 :
+; 1800 : if (err==ZIP_OK) /* total number of entries in the central dir on this disk */
+
+ 0009d 85 c0 test eax, eax
+ 0009f 75 76 jne SHORT $LN10@Write_Zip6
+
+; 1801 : err = zip64local_putValue(&zi->z_filefunc, zi->filestream, zi->number_entry, 8);
+
+ 000a1 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 000a4 8b ce mov ecx, esi
+ 000a6 6a 08 push 8
+ 000a8 ff b6 fc 00 01
+ 00 push DWORD PTR [esi+65788]
+ 000ae ff b6 f8 00 01
+ 00 push DWORD PTR [esi+65784]
+ 000b4 e8 00 00 00 00 call _zip64local_putValue
+ 000b9 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1802 :
+; 1803 : if (err==ZIP_OK) /* total number of entries in the central dir */
+
+ 000bc 85 c0 test eax, eax
+ 000be 75 57 jne SHORT $LN10@Write_Zip6
+
+; 1804 : err = zip64local_putValue(&zi->z_filefunc, zi->filestream, zi->number_entry, 8);
+
+ 000c0 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 000c3 8b ce mov ecx, esi
+ 000c5 6a 08 push 8
+ 000c7 ff b6 fc 00 01
+ 00 push DWORD PTR [esi+65788]
+ 000cd ff b6 f8 00 01
+ 00 push DWORD PTR [esi+65784]
+ 000d3 e8 00 00 00 00 call _zip64local_putValue
+ 000d8 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1805 :
+; 1806 : if (err==ZIP_OK) /* size of the central directory */
+
+ 000db 85 c0 test eax, eax
+ 000dd 75 38 jne SHORT $LN10@Write_Zip6
+
+; 1807 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(ZPOS64_T)size_centraldir,8);
+
+ 000df 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 000e2 8b ce mov ecx, esi
+ 000e4 6a 08 push 8
+ 000e6 50 push eax
+ 000e7 57 push edi
+ 000e8 e8 00 00 00 00 call _zip64local_putValue
+ 000ed 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1808 :
+; 1809 : if (err==ZIP_OK) /* offset of start of central directory with respect to the starting disk number */
+
+ 000f0 85 c0 test eax, eax
+ 000f2 75 23 jne SHORT $LN10@Write_Zip6
+
+; 1810 : {
+; 1811 : ZPOS64_T pos = centraldir_pos_inzip - zi->add_position_when_writting_offset;
+
+ 000f4 8b 4d 08 mov ecx, DWORD PTR _centraldir_pos_inzip$[ebp]
+ 000f7 2b 8e f0 00 01
+ 00 sub ecx, DWORD PTR [esi+65776]
+ 000fd 8b 45 0c mov eax, DWORD PTR _centraldir_pos_inzip$[ebp+4]
+ 00100 1b 86 f4 00 01
+ 00 sbb eax, DWORD PTR [esi+65780]
+
+; 1812 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (ZPOS64_T)pos,8);
+
+ 00106 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00109 6a 08 push 8
+ 0010b 50 push eax
+ 0010c 51 push ecx
+ 0010d 8b ce mov ecx, esi
+ 0010f e8 00 00 00 00 call _zip64local_putValue
+ 00114 83 c4 0c add esp, 12 ; 0000000cH
+$LN10@Write_Zip6:
+
+; 1813 : }
+; 1814 : return err;
+; 1815 : }
+
+ 00117 5f pop edi
+ 00118 5e pop esi
+ 00119 5d pop ebp
+ 0011a c3 ret 0
+_Write_Zip64EndOfCentralDirectoryRecord ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _Write_EndOfCentralDirectoryRecord
+_TEXT SEGMENT
+tv191 = -8 ; size = 8
+_centraldir_pos_inzip$ = 8 ; size = 8
+_Write_EndOfCentralDirectoryRecord PROC ; COMDAT
+; _zi$ = ecx
+; _size_centraldir$ = edx
+
+; 1817 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 ec 08 sub esp, 8
+ 00006 56 push esi
+ 00007 57 push edi
+ 00008 8b f1 mov esi, ecx
+ 0000a 8b fa mov edi, edx
+
+; 1818 : int err = ZIP_OK;
+; 1819 :
+; 1820 : /*signature*/
+; 1821 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)ENDHEADERMAGIC,4);
+
+ 0000c 6a 04 push 4
+ 0000e 6a 00 push 0
+ 00010 68 50 4b 05 06 push 101010256 ; 06054b50H
+ 00015 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00018 e8 00 00 00 00 call _zip64local_putValue
+ 0001d 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1822 :
+; 1823 : if (err==ZIP_OK) /* number of this disk */
+
+ 00020 85 c0 test eax, eax
+ 00022 0f 85 0c 01 00
+ 00 jne $LN13@Write_EndO
+
+; 1824 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,2);
+
+ 00028 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 0002b 8b ce mov ecx, esi
+ 0002d 6a 02 push 2
+ 0002f 50 push eax
+ 00030 50 push eax
+ 00031 e8 00 00 00 00 call _zip64local_putValue
+ 00036 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1825 :
+; 1826 : if (err==ZIP_OK) /* number of the disk with the start of the central directory */
+
+ 00039 85 c0 test eax, eax
+ 0003b 0f 85 f3 00 00
+ 00 jne $LN13@Write_EndO
+
+; 1827 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,2);
+
+ 00041 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00044 8b ce mov ecx, esi
+ 00046 6a 02 push 2
+ 00048 50 push eax
+ 00049 50 push eax
+ 0004a e8 00 00 00 00 call _zip64local_putValue
+ 0004f 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1828 :
+; 1829 : if (err==ZIP_OK) /* total number of entries in the central dir on this disk */
+
+ 00052 85 c0 test eax, eax
+ 00054 0f 85 da 00 00
+ 00 jne $LN13@Write_EndO
+
+; 1830 : {
+; 1831 : {
+; 1832 : if(zi->number_entry >= 0xFFFF)
+
+ 0005a 39 86 fc 00 01
+ 00 cmp DWORD PTR [esi+65788], eax
+ 00060 77 17 ja SHORT $LN15@Write_EndO
+ 00062 81 be f8 00 01
+ 00 ff ff 00 00 cmp DWORD PTR [esi+65784], 65535 ; 0000ffffH
+ 0006c 73 0b jae SHORT $LN15@Write_EndO
+
+; 1834 : else
+; 1835 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->number_entry,2);
+
+ 0006e 6a 02 push 2
+ 00070 50 push eax
+ 00071 ff b6 f8 00 01
+ 00 push DWORD PTR [esi+65784]
+ 00077 eb 09 jmp SHORT $LN24@Write_EndO
+$LN15@Write_EndO:
+
+; 1833 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0xffff,2); // use value in ZIP64 record
+
+ 00079 6a 02 push 2
+ 0007b 6a 00 push 0
+ 0007d 68 ff ff 00 00 push 65535 ; 0000ffffH
+$LN24@Write_EndO:
+ 00082 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00085 8b ce mov ecx, esi
+ 00087 e8 00 00 00 00 call _zip64local_putValue
+ 0008c 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1836 : }
+; 1837 : }
+; 1838 :
+; 1839 : if (err==ZIP_OK) /* total number of entries in the central dir */
+
+ 0008f 85 c0 test eax, eax
+ 00091 0f 85 9d 00 00
+ 00 jne $LN13@Write_EndO
+
+; 1840 : {
+; 1841 : if(zi->number_entry >= 0xFFFF)
+
+ 00097 39 86 fc 00 01
+ 00 cmp DWORD PTR [esi+65788], eax
+ 0009d 77 17 ja SHORT $LN16@Write_EndO
+ 0009f 81 be f8 00 01
+ 00 ff ff 00 00 cmp DWORD PTR [esi+65784], 65535 ; 0000ffffH
+ 000a9 73 0b jae SHORT $LN16@Write_EndO
+
+; 1843 : else
+; 1844 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->number_entry,2);
+
+ 000ab 6a 02 push 2
+ 000ad 50 push eax
+ 000ae ff b6 f8 00 01
+ 00 push DWORD PTR [esi+65784]
+ 000b4 eb 09 jmp SHORT $LN25@Write_EndO
+$LN16@Write_EndO:
+
+; 1842 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0xffff,2); // use value in ZIP64 record
+
+ 000b6 6a 02 push 2
+ 000b8 6a 00 push 0
+ 000ba 68 ff ff 00 00 push 65535 ; 0000ffffH
+$LN25@Write_EndO:
+ 000bf 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 000c2 8b ce mov ecx, esi
+ 000c4 e8 00 00 00 00 call _zip64local_putValue
+ 000c9 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1845 : }
+; 1846 :
+; 1847 : if (err==ZIP_OK) /* size of the central directory */
+
+ 000cc 85 c0 test eax, eax
+ 000ce 75 64 jne SHORT $LN13@Write_EndO
+
+; 1848 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_centraldir,4);
+
+ 000d0 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 000d3 8b ce mov ecx, esi
+ 000d5 6a 04 push 4
+ 000d7 50 push eax
+ 000d8 57 push edi
+ 000d9 e8 00 00 00 00 call _zip64local_putValue
+ 000de 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1849 :
+; 1850 : if (err==ZIP_OK) /* offset of start of central directory with respect to the starting disk number */
+
+ 000e1 85 c0 test eax, eax
+ 000e3 75 4f jne SHORT $LN13@Write_EndO
+
+; 1851 : {
+; 1852 : ZPOS64_T pos = centraldir_pos_inzip - zi->add_position_when_writting_offset;
+
+ 000e5 8b 55 08 mov edx, DWORD PTR _centraldir_pos_inzip$[ebp]
+ 000e8 8b ca mov ecx, edx
+ 000ea 2b 8e f0 00 01
+ 00 sub ecx, DWORD PTR [esi+65776]
+ 000f0 8b 45 0c mov eax, DWORD PTR _centraldir_pos_inzip$[ebp+4]
+ 000f3 1b 86 f4 00 01
+ 00 sbb eax, DWORD PTR [esi+65780]
+
+; 1853 : if(pos >= 0xffffffff)
+
+ 000f9 89 45 fc mov DWORD PTR tv191[ebp+4], eax
+ 000fc 75 23 jne SHORT $LN17@Write_EndO
+ 000fe 83 f9 ff cmp ecx, -1
+ 00101 73 1e jae SHORT $LN17@Write_EndO
+
+; 1856 : }
+; 1857 : else
+; 1858 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (uLong)(centraldir_pos_inzip - zi->add_position_when_writting_offset),4);
+
+ 00103 2b 96 f0 00 01
+ 00 sub edx, DWORD PTR [esi+65776]
+ 00109 8b ce mov ecx, esi
+ 0010b 6a 04 push 4
+ 0010d 6a 00 push 0
+ 0010f 52 push edx
+ 00110 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00113 e8 00 00 00 00 call _zip64local_putValue
+ 00118 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1859 : }
+; 1860 :
+; 1861 : return err;
+; 1862 : }
+
+ 0011b 5f pop edi
+ 0011c 5e pop esi
+ 0011d 8b e5 mov esp, ebp
+ 0011f 5d pop ebp
+ 00120 c3 ret 0
+$LN17@Write_EndO:
+
+; 1854 : {
+; 1855 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (uLong)0xffffffff,4);
+
+ 00121 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 00124 8b ce mov ecx, esi
+ 00126 6a 04 push 4
+ 00128 6a 00 push 0
+ 0012a 6a ff push -1
+ 0012c e8 00 00 00 00 call _zip64local_putValue
+ 00131 83 c4 0c add esp, 12 ; 0000000cH
+$LN13@Write_EndO:
+
+; 1859 : }
+; 1860 :
+; 1861 : return err;
+; 1862 : }
+
+ 00134 5f pop edi
+ 00135 5e pop esi
+ 00136 8b e5 mov esp, ebp
+ 00138 5d pop ebp
+ 00139 c3 ret 0
+_Write_EndOfCentralDirectoryRecord ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _Write_GlobalComment
+_TEXT SEGMENT
+_global_comment$1$ = -4 ; size = 4
+_Write_GlobalComment PROC ; COMDAT
+; _zi$ = ecx
+; _global_comment$ = edx
+
+; 1865 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 51 push ecx
+ 00004 53 push ebx
+ 00005 56 push esi
+ 00006 8b c2 mov eax, edx
+
+; 1866 : int err = ZIP_OK;
+; 1867 : uInt size_global_comment = 0;
+
+ 00008 33 f6 xor esi, esi
+ 0000a 89 45 fc mov DWORD PTR _global_comment$1$[ebp], eax
+ 0000d 8b d9 mov ebx, ecx
+ 0000f 57 push edi
+
+; 1868 :
+; 1869 : if(global_comment != NULL)
+
+ 00010 85 c0 test eax, eax
+ 00012 74 15 je SHORT $LN2@Write_Glob
+
+; 1870 : size_global_comment = (uInt)strlen(global_comment);
+
+ 00014 8b f0 mov esi, eax
+ 00016 8d 4e 01 lea ecx, DWORD PTR [esi+1]
+ 00019 0f 1f 80 00 00
+ 00 00 npad 7
+$LL6@Write_Glob:
+ 00020 8a 06 mov al, BYTE PTR [esi]
+ 00022 46 inc esi
+ 00023 84 c0 test al, al
+ 00025 75 f9 jne SHORT $LL6@Write_Glob
+ 00027 2b f1 sub esi, ecx
+$LN2@Write_Glob:
+
+; 1871 :
+; 1872 : err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_global_comment,2);
+
+ 00029 8b 53 2c mov edx, DWORD PTR [ebx+44]
+ 0002c 8b cb mov ecx, ebx
+ 0002e 6a 02 push 2
+ 00030 6a 00 push 0
+ 00032 56 push esi
+ 00033 e8 00 00 00 00 call _zip64local_putValue
+ 00038 8b f8 mov edi, eax
+ 0003a 83 c4 0c add esp, 12 ; 0000000cH
+
+; 1873 :
+; 1874 : if (err == ZIP_OK && size_global_comment > 0)
+
+ 0003d 85 ff test edi, edi
+ 0003f 75 1e jne SHORT $LN7@Write_Glob
+ 00041 85 f6 test esi, esi
+ 00043 74 1a je SHORT $LN7@Write_Glob
+
+; 1875 : {
+; 1876 : if (ZWRITE64(zi->z_filefunc,zi->filestream, global_comment, size_global_comment) != size_global_comment)
+
+ 00045 8b 4b 08 mov ecx, DWORD PTR [ebx+8]
+ 00048 56 push esi
+ 00049 ff 75 fc push DWORD PTR _global_comment$1$[ebp]
+ 0004c ff 73 2c push DWORD PTR [ebx+44]
+ 0004f ff 73 1c push DWORD PTR [ebx+28]
+ 00052 ff d1 call ecx
+ 00054 83 c9 ff or ecx, -1
+ 00057 83 c4 10 add esp, 16 ; 00000010H
+ 0005a 3b c6 cmp eax, esi
+ 0005c 0f 45 f9 cmovne edi, ecx
+$LN7@Write_Glob:
+
+; 1877 : err = ZIP_ERRNO;
+; 1878 : }
+; 1879 : return err;
+
+ 0005f 8b c7 mov eax, edi
+
+; 1880 : }
+
+ 00061 5f pop edi
+ 00062 5e pop esi
+ 00063 5b pop ebx
+ 00064 8b e5 mov esp, ebp
+ 00066 5d pop ebp
+ 00067 c3 ret 0
+_Write_GlobalComment ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\contrib\minizip\zip.c
+; COMDAT _zipClose@8
+_TEXT SEGMENT
+_size_centraldir$1$ = -16 ; size = 4
+_err$1$ = -12 ; size = 4
+_centraldir_pos_inzip$2$ = -8 ; size = 4
+_centraldir_pos_inzip$1$ = -4 ; size = 4
+_file$ = 8 ; size = 4
+_global_comment$ = 12 ; size = 4
+_zipClose@8 PROC ; COMDAT
+
+; 1883 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+ 00003 83 e4 f8 and esp, -8 ; fffffff8H
+ 00006 83 ec 14 sub esp, 20 ; 00000014H
+ 00009 53 push ebx
+ 0000a 56 push esi
+
+; 1884 : zip64_internal* zi;
+; 1885 : int err = 0;
+; 1886 : uLong size_centraldir = 0;
+; 1887 : ZPOS64_T centraldir_pos_inzip;
+; 1888 : ZPOS64_T pos;
+; 1889 :
+; 1890 : if (file == NULL)
+
+ 0000b 8b 75 08 mov esi, DWORD PTR _file$[ebp]
+ 0000e 33 db xor ebx, ebx
+ 00010 89 5c 24 10 mov DWORD PTR _err$1$[esp+28], ebx
+ 00014 89 5c 24 0c mov DWORD PTR _size_centraldir$1$[esp+28], ebx
+ 00018 57 push edi
+ 00019 85 f6 test esi, esi
+ 0001b 75 0c jne SHORT $LN4@zipClose
+
+; 1891 : return ZIP_PARAMERROR;
+
+ 0001d 8d 43 9a lea eax, DWORD PTR [ebx-102]
+
+; 1949 : }
+
+ 00020 5f pop edi
+ 00021 5e pop esi
+ 00022 5b pop ebx
+ 00023 8b e5 mov esp, ebp
+ 00025 5d pop ebp
+ 00026 c2 08 00 ret 8
+$LN4@zipClose:
+
+; 1892 :
+; 1893 : zi = (zip64_internal*)file;
+; 1894 :
+; 1895 : if (zi->in_opened_file_inzip == 1)
+
+ 00029 83 7e 38 01 cmp DWORD PTR [esi+56], 1
+ 0002d 75 0c jne SHORT $LN5@zipClose
+
+; 1896 : {
+; 1897 : err = zipCloseFileInZip (file);
+
+ 0002f 56 push esi
+ 00030 e8 00 00 00 00 call _zipCloseFileInZip@4
+ 00035 8b d8 mov ebx, eax
+ 00037 89 44 24 14 mov DWORD PTR _err$1$[esp+32], eax
+$LN5@zipClose:
+
+; 1898 : }
+; 1899 :
+; 1900 : #ifndef NO_ADDFILEINEXISTINGZIP
+; 1901 : if (global_comment==NULL)
+
+ 0003b 83 7d 0c 00 cmp DWORD PTR _global_comment$[ebp], 0
+ 0003f 75 09 jne SHORT $LN6@zipClose
+
+; 1902 : global_comment = zi->globalcomment;
+
+ 00041 8b 86 00 01 01
+ 00 mov eax, DWORD PTR [esi+65792]
+ 00047 89 45 0c mov DWORD PTR _global_comment$[ebp], eax
+$LN6@zipClose:
+
+; 1903 : #endif
+; 1904 :
+; 1905 : centraldir_pos_inzip = ZTELL64(zi->z_filefunc,zi->filestream);
+
+ 0004a 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 0004d 8b ce mov ecx, esi
+ 0004f e8 00 00 00 00 call _call_ztell64
+ 00054 89 44 24 18 mov DWORD PTR _centraldir_pos_inzip$2$[esp+32], eax
+ 00058 89 54 24 1c mov DWORD PTR _centraldir_pos_inzip$1$[esp+32], edx
+
+; 1906 :
+; 1907 : if (err==ZIP_OK)
+
+ 0005c 85 db test ebx, ebx
+ 0005e 75 4e jne SHORT $LN3@zipClose
+
+; 1908 : {
+; 1909 : linkedlist_datablock_internal* ldi = zi->central_dir.first_block;
+
+ 00060 8b 7e 30 mov edi, DWORD PTR [esi+48]
+
+; 1910 : while (ldi!=NULL)
+
+ 00063 85 ff test edi, edi
+ 00065 74 47 je SHORT $LN3@zipClose
+ 00067 33 c0 xor eax, eax
+ 00069 0f 1f 80 00 00
+ 00 00 npad 7
+$LL2@zipClose:
+
+; 1911 : {
+; 1912 : if ((err==ZIP_OK) && (ldi->filled_in_this_block>0))
+
+ 00070 85 db test ebx, ebx
+ 00072 75 29 jne SHORT $LN9@zipClose
+ 00074 8b 47 08 mov eax, DWORD PTR [edi+8]
+ 00077 85 c0 test eax, eax
+ 00079 74 1e je SHORT $LN25@zipClose
+
+; 1913 : {
+; 1914 : if (ZWRITE64(zi->z_filefunc,zi->filestream, ldi->data, ldi->filled_in_this_block) != ldi->filled_in_this_block)
+
+ 0007b 50 push eax
+ 0007c 8d 47 10 lea eax, DWORD PTR [edi+16]
+ 0007f 50 push eax
+ 00080 ff 76 2c push DWORD PTR [esi+44]
+ 00083 8b 46 08 mov eax, DWORD PTR [esi+8]
+ 00086 ff 76 1c push DWORD PTR [esi+28]
+ 00089 ff d0 call eax
+ 0008b 83 c4 10 add esp, 16 ; 00000010H
+ 0008e 3b 47 08 cmp eax, DWORD PTR [edi+8]
+ 00091 b8 ff ff ff ff mov eax, -1
+ 00096 0f 45 d8 cmovne ebx, eax
+$LN25@zipClose:
+ 00099 8b 44 24 10 mov eax, DWORD PTR _size_centraldir$1$[esp+32]
+$LN9@zipClose:
+
+; 1915 : err = ZIP_ERRNO;
+; 1916 : }
+; 1917 :
+; 1918 : size_centraldir += ldi->filled_in_this_block;
+
+ 0009d 03 47 08 add eax, DWORD PTR [edi+8]
+
+; 1919 : ldi = ldi->next_datablock;
+
+ 000a0 8b 3f mov edi, DWORD PTR [edi]
+ 000a2 89 44 24 10 mov DWORD PTR _size_centraldir$1$[esp+32], eax
+ 000a6 85 ff test edi, edi
+ 000a8 75 c6 jne SHORT $LL2@zipClose
+ 000aa 89 5c 24 14 mov DWORD PTR _err$1$[esp+32], ebx
+$LN3@zipClose:
+
+; 1920 : }
+; 1921 : }
+; 1922 : free_linkedlist(&(zi->central_dir));
+
+ 000ae 8d 4e 30 lea ecx, DWORD PTR [esi+48]
+ 000b1 e8 00 00 00 00 call _free_linkedlist
+
+; 1923 :
+; 1924 : pos = centraldir_pos_inzip - zi->add_position_when_writting_offset;
+
+ 000b6 8b 54 24 18 mov edx, DWORD PTR _centraldir_pos_inzip$2$[esp+32]
+ 000ba 8b ca mov ecx, edx
+ 000bc 2b 8e f0 00 01
+ 00 sub ecx, DWORD PTR [esi+65776]
+ 000c2 8b 7c 24 1c mov edi, DWORD PTR _centraldir_pos_inzip$1$[esp+32]
+ 000c6 8b c7 mov eax, edi
+ 000c8 1b 86 f4 00 01
+ 00 sbb eax, DWORD PTR [esi+65780]
+
+; 1925 : if(pos >= 0xffffffff || zi->number_entry > 0xFFFF)
+
+ 000ce 85 c0 test eax, eax
+ 000d0 77 1c ja SHORT $LN24@zipClose
+ 000d2 72 05 jb SHORT $LN23@zipClose
+ 000d4 83 f9 ff cmp ecx, -1
+ 000d7 73 15 jae SHORT $LN24@zipClose
+$LN23@zipClose:
+ 000d9 83 be fc 00 01
+ 00 00 cmp DWORD PTR [esi+65788], 0
+ 000e0 77 0c ja SHORT $LN24@zipClose
+ 000e2 81 be f8 00 01
+ 00 ff ff 00 00 cmp DWORD PTR [esi+65784], 65535 ; 0000ffffH
+ 000ec 76 39 jbe SHORT $LN10@zipClose
+$LN24@zipClose:
+
+; 1926 : {
+; 1927 : ZPOS64_T Zip64EOCDpos = ZTELL64(zi->z_filefunc,zi->filestream);
+
+ 000ee 8b 56 2c mov edx, DWORD PTR [esi+44]
+ 000f1 8b ce mov ecx, esi
+ 000f3 e8 00 00 00 00 call _call_ztell64
+
+; 1928 : Write_Zip64EndOfCentralDirectoryRecord(zi, size_centraldir, centraldir_pos_inzip);
+
+ 000f8 ff 74 24 1c push DWORD PTR _centraldir_pos_inzip$1$[esp+32]
+ 000fc 8b fa mov edi, edx
+ 000fe 8b ce mov ecx, esi
+ 00100 ff 74 24 1c push DWORD PTR _centraldir_pos_inzip$2$[esp+36]
+ 00104 8b 54 24 18 mov edx, DWORD PTR _size_centraldir$1$[esp+40]
+ 00108 8b d8 mov ebx, eax
+ 0010a e8 00 00 00 00 call _Write_Zip64EndOfCentralDirectoryRecord
+
+; 1929 :
+; 1930 : Write_Zip64EndOfCentralDirectoryLocator(zi, Zip64EOCDpos);
+
+ 0010f 57 push edi
+ 00110 53 push ebx
+ 00111 8b ce mov ecx, esi
+ 00113 e8 00 00 00 00 call _Write_Zip64EndOfCentralDirectoryLocator
+ 00118 8b 5c 24 24 mov ebx, DWORD PTR _err$1$[esp+48]
+ 0011c 83 c4 10 add esp, 16 ; 00000010H
+ 0011f 8b 54 24 18 mov edx, DWORD PTR _centraldir_pos_inzip$2$[esp+32]
+ 00123 8b 7c 24 1c mov edi, DWORD PTR _centraldir_pos_inzip$1$[esp+32]
+$LN10@zipClose:
+
+; 1931 : }
+; 1932 :
+; 1933 : if (err==ZIP_OK)
+
+ 00127 85 db test ebx, ebx
+ 00129 75 22 jne SHORT $LN13@zipClose
+
+; 1934 : err = Write_EndOfCentralDirectoryRecord(zi, size_centraldir, centraldir_pos_inzip);
+
+ 0012b 57 push edi
+ 0012c 52 push edx
+ 0012d 8b 54 24 18 mov edx, DWORD PTR _size_centraldir$1$[esp+40]
+ 00131 8b ce mov ecx, esi
+ 00133 e8 00 00 00 00 call _Write_EndOfCentralDirectoryRecord
+ 00138 8b d8 mov ebx, eax
+ 0013a 83 c4 08 add esp, 8
+
+; 1935 :
+; 1936 : if(err == ZIP_OK)
+
+ 0013d 85 db test ebx, ebx
+ 0013f 75 0c jne SHORT $LN13@zipClose
+
+; 1937 : err = Write_GlobalComment(zi, global_comment);
+
+ 00141 8b 55 0c mov edx, DWORD PTR _global_comment$[ebp]
+ 00144 8b ce mov ecx, esi
+ 00146 e8 00 00 00 00 call _Write_GlobalComment
+ 0014b 8b d8 mov ebx, eax
+$LN13@zipClose:
+
+; 1938 :
+; 1939 : if (ZCLOSE64(zi->z_filefunc,zi->filestream) != 0)
+
+ 0014d ff 76 2c push DWORD PTR [esi+44]
+ 00150 8b 46 14 mov eax, DWORD PTR [esi+20]
+ 00153 ff 76 1c push DWORD PTR [esi+28]
+ 00156 ff d0 call eax
+ 00158 83 c4 08 add esp, 8
+ 0015b 85 c0 test eax, eax
+ 0015d 74 0a je SHORT $LN15@zipClose
+
+; 1940 : if (err == ZIP_OK)
+
+ 0015f 85 db test ebx, ebx
+ 00161 b8 ff ff ff ff mov eax, -1
+ 00166 0f 44 d8 cmove ebx, eax
+$LN15@zipClose:
+
+; 1941 : err = ZIP_ERRNO;
+; 1942 :
+; 1943 : #ifndef NO_ADDFILEINEXISTINGZIP
+; 1944 : TRYFREE(zi->globalcomment);
+
+ 00169 8b 86 00 01 01
+ 00 mov eax, DWORD PTR [esi+65792]
+ 0016f 8b 3d 00 00 00
+ 00 mov edi, DWORD PTR __imp__free
+ 00175 85 c0 test eax, eax
+ 00177 74 06 je SHORT $LN16@zipClose
+ 00179 50 push eax
+ 0017a ff d7 call edi
+ 0017c 83 c4 04 add esp, 4
+$LN16@zipClose:
+
+; 1945 : #endif
+; 1946 : TRYFREE(zi);
+
+ 0017f 56 push esi
+ 00180 ff d7 call edi
+ 00182 83 c4 04 add esp, 4
+
+; 1947 :
+; 1948 : return err;
+
+ 00185 8b c3 mov eax, ebx
+
+; 1949 : }
+
+ 00187 5f pop edi
+ 00188 5e pop esi
+ 00189 5b pop ebx
+ 0018a 8b e5 mov esp, ebp
+ 0018c 5d pop ebp
+ 0018d c2 08 00 ret 8
+_zipClose@8 ENDP
+_TEXT ENDS
+END
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zip.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zip.obj
new file mode 100644
index 0000000000..f7b88cac91
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zip.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlib.res b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlib.res
new file mode 100644
index 0000000000..9316316bcc
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlib.res
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.log b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.log
new file mode 100644
index 0000000000..1b01ff01d7
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.log
@@ -0,0 +1,25 @@
+ adler32.c
+ compress.c
+ crc32.c
+ deflate.c
+ gzclose.c
+ gzlib.c
+ gzread.c
+ gzwrite.c
+ infback.c
+ inffast.c
+ inflate.c
+ inftrees.c
+ ioapi.c
+ iowin32.c
+ trees.c
+ uncompr.c
+ unzip.c
+ zip.c
+ zutil.c
+ Creating library x86\ZlibDllReleaseWithoutAsm\zlibwapi.lib and object x86\ZlibDllReleaseWithoutAsm\zlibwapi.exp
+ Generating code
+ All 255 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
+ Finished generating code
+ zlibvc.vcxproj -> d:\Downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\ZlibDllReleaseWithoutAsm\zlibwapi.dll
+ zlibvc.vcxproj -> x86\ZlibDllReleaseWithoutAsm\zlibwapi.pdb (Full PDB)
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/CL.command.1.tlog b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/CL.command.1.tlog
new file mode 100644
index 0000000000..7b1c7f359f
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/CL.command.1.tlog
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/CL.read.1.tlog b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/CL.read.1.tlog
new file mode 100644
index 0000000000..3eab217343
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/CL.read.1.tlog
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/CL.write.1.tlog b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/CL.write.1.tlog
new file mode 100644
index 0000000000..612c48e1a4
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/CL.write.1.tlog
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/link.command.1.tlog b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/link.command.1.tlog
new file mode 100644
index 0000000000..5f847490e7
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/link.command.1.tlog
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/link.read.1.tlog b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/link.read.1.tlog
new file mode 100644
index 0000000000..4dfd27e5a9
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/link.read.1.tlog
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/link.write.1.tlog b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/link.write.1.tlog
new file mode 100644
index 0000000000..d4cad299ae
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/link.write.1.tlog
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/rc.command.1.tlog b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/rc.command.1.tlog
new file mode 100644
index 0000000000..6ff6699b4a
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/rc.command.1.tlog
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/rc.read.1.tlog b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/rc.read.1.tlog
new file mode 100644
index 0000000000..1d1629b28b
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/rc.read.1.tlog
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/rc.write.1.tlog b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/rc.write.1.tlog
new file mode 100644
index 0000000000..37a72c41da
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/rc.write.1.tlog
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/zlibvc.lastbuildstate b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/zlibvc.lastbuildstate
new file mode 100644
index 0000000000..2b818f9515
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/zlibvc.lastbuildstate
@@ -0,0 +1,2 @@
+#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1
+ReleaseWithoutAsm|Win32|D:\Downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\|
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/zlibvc.write.1u.tlog b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/zlibvc.write.1u.tlog
new file mode 100644
index 0000000000..54f7582e08
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibvc.tlog/zlibvc.write.1u.tlog
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibwapi.Build.CppClean.log b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibwapi.Build.CppClean.log
new file mode 100644
index 0000000000..91635388f2
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zlibwapi.Build.CppClean.log
@@ -0,0 +1,31 @@
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\vc140.pdb
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\zutil.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\zip.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\unzip.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\uncompr.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\trees.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\iowin32.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\ioapi.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\inftrees.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\inflate.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\inffast.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\infback.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\gzwrite.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\gzread.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\gzlib.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\gzclose.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\deflate.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\crc32.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\compress.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\adler32.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\zlib.res
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\zlibwapi.dll
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\zlibvc.tlog\cl.command.1.tlog
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\zlibvc.tlog\cl.read.1.tlog
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\zlibvc.tlog\cl.write.1.tlog
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\zlibvc.tlog\link.command.1.tlog
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\zlibvc.tlog\link.read.1.tlog
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\zlibvc.tlog\link.write.1.tlog
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\zlibvc.tlog\rc.command.1.tlog
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\zlibvc.tlog\rc.read.1.tlog
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibdllreleasewithoutasm\tmp\zlibvc.tlog\rc.write.1.tlog
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zutil.cod b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zutil.cod
new file mode 100644
index 0000000000..f090b9859a
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zutil.cod
@@ -0,0 +1,259 @@
+; Listing generated by Microsoft (R) Optimizing Compiler Version 19.00.23506.0
+
+ TITLE d:\downloads\tgl-master\tgl-master\zlib\zutil.c
+ .686P
+ .XMM
+ include listing.inc
+ .model flat
+
+INCLUDELIB OLDNAMES
+
+PUBLIC _z_errmsg
+PUBLIC ??_C@_0BA@MOKMMFOD@need?5dictionary?$AA@ ; `string'
+PUBLIC ??_C@_0L@FNAOCBOG@stream?5end?$AA@ ; `string'
+PUBLIC ??_C@_0L@KIJFAKBJ@file?5error?$AA@ ; `string'
+PUBLIC ??_C@_0N@MKKNPMJD@stream?5error?$AA@ ; `string'
+PUBLIC ??_C@_0L@HAHMBNLP@data?5error?$AA@ ; `string'
+PUBLIC ??_C@_0BE@OGGJBMCE@insufficient?5memory?$AA@ ; `string'
+PUBLIC ??_C@_0N@DFPGLBGC@buffer?5error?$AA@ ; `string'
+PUBLIC ??_C@_0BF@CJFPCCEG@incompatible?5version?$AA@ ; `string'
+; COMDAT ??_C@_0BF@CJFPCCEG@incompatible?5version?$AA@
+CONST SEGMENT
+??_C@_0BF@CJFPCCEG@incompatible?5version?$AA@ DB 'incompatible version', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_0N@DFPGLBGC@buffer?5error?$AA@
+CONST SEGMENT
+??_C@_0N@DFPGLBGC@buffer?5error?$AA@ DB 'buffer error', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_0BE@OGGJBMCE@insufficient?5memory?$AA@
+CONST SEGMENT
+??_C@_0BE@OGGJBMCE@insufficient?5memory?$AA@ DB 'insufficient memory', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_0L@HAHMBNLP@data?5error?$AA@
+CONST SEGMENT
+??_C@_0L@HAHMBNLP@data?5error?$AA@ DB 'data error', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_0N@MKKNPMJD@stream?5error?$AA@
+CONST SEGMENT
+??_C@_0N@MKKNPMJD@stream?5error?$AA@ DB 'stream error', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_0L@KIJFAKBJ@file?5error?$AA@
+CONST SEGMENT
+??_C@_0L@KIJFAKBJ@file?5error?$AA@ DB 'file error', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_0L@FNAOCBOG@stream?5end?$AA@
+CONST SEGMENT
+??_C@_0L@FNAOCBOG@stream?5end?$AA@ DB 'stream end', 00H ; `string'
+CONST ENDS
+; COMDAT ??_C@_0BA@MOKMMFOD@need?5dictionary?$AA@
+CONST SEGMENT
+??_C@_0BA@MOKMMFOD@need?5dictionary?$AA@ DB 'need dictionary', 00H ; `string'
+ ORG $+3
+_z_errmsg DD FLAT:??_C@_0BA@MOKMMFOD@need?5dictionary?$AA@
+ DD FLAT:??_C@_0L@FNAOCBOG@stream?5end?$AA@
+ DD FLAT:??_C@_00CNPNBAHC@?$AA@
+ DD FLAT:??_C@_0L@KIJFAKBJ@file?5error?$AA@
+ DD FLAT:??_C@_0N@MKKNPMJD@stream?5error?$AA@
+ DD FLAT:??_C@_0L@HAHMBNLP@data?5error?$AA@
+ DD FLAT:??_C@_0BE@OGGJBMCE@insufficient?5memory?$AA@
+ DD FLAT:??_C@_0N@DFPGLBGC@buffer?5error?$AA@
+ DD FLAT:??_C@_0BF@CJFPCCEG@incompatible?5version?$AA@
+ DD FLAT:??_C@_00CNPNBAHC@?$AA@
+PUBLIC _zError@4
+PUBLIC _zlibCompileFlags@0
+PUBLIC _zlibVersion@0
+PUBLIC _zcfree
+PUBLIC _zcalloc
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\zutil.c
+; COMDAT _zcalloc
+_TEXT SEGMENT
+_opaque$ = 8 ; size = 4
+_items$ = 12 ; size = 4
+_size$ = 16 ; size = 4
+_zcalloc PROC ; COMDAT
+
+; 308 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 309 : if (opaque) items += size - size; /* make compiler happy */
+; 310 : return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
+
+ 00003 8b 45 0c mov eax, DWORD PTR _items$[ebp]
+ 00006 0f af 45 10 imul eax, DWORD PTR _size$[ebp]
+ 0000a 50 push eax
+ 0000b ff 15 00 00 00
+ 00 call DWORD PTR __imp__malloc
+ 00011 83 c4 04 add esp, 4
+
+; 311 : (voidpf)calloc(items, size);
+; 312 : }
+
+ 00014 5d pop ebp
+ 00015 c3 ret 0
+_zcalloc ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\zutil.c
+; COMDAT _zcfree
+_TEXT SEGMENT
+_opaque$ = 8 ; size = 4
+_ptr$ = 12 ; size = 4
+_zcfree PROC ; COMDAT
+
+; 317 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 318 : free(ptr);
+
+ 00003 ff 75 0c push DWORD PTR _ptr$[ebp]
+ 00006 ff 15 00 00 00
+ 00 call DWORD PTR __imp__free
+ 0000c 83 c4 04 add esp, 4
+
+; 319 : if (opaque) return; /* make compiler happy */
+; 320 : }
+
+ 0000f 5d pop ebp
+ 00010 c3 ret 0
+_zcfree ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\zutil.c
+; COMDAT _zlibVersion@0
+_TEXT SEGMENT
+_zlibVersion@0 PROC ; COMDAT
+
+; 32 : return ZLIB_VERSION;
+
+ 00000 b8 00 00 00 00 mov eax, OFFSET ??_C@_05IAIEPMAK@1?42?48?$AA@
+
+; 33 : }
+
+ 00005 c3 ret 0
+_zlibVersion@0 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\zutil.c
+; COMDAT _zlibCompileFlags@0
+_TEXT SEGMENT
+_zlibCompileFlags@0 PROC ; COMDAT
+
+; 37 : uLong flags;
+; 38 :
+; 39 : flags = 0;
+; 40 : switch ((int)(sizeof(uInt))) {
+; 41 : case 2: break;
+; 42 : case 4: flags += 1; break;
+; 43 : case 8: flags += 2; break;
+; 44 : default: flags += 3;
+; 45 : }
+; 46 : switch ((int)(sizeof(uLong))) {
+; 47 : case 2: break;
+; 48 : case 4: flags += 1 << 2; break;
+; 49 : case 8: flags += 2 << 2; break;
+; 50 : default: flags += 3 << 2;
+; 51 : }
+; 52 : switch ((int)(sizeof(voidpf))) {
+; 53 : case 2: break;
+; 54 : case 4: flags += 1 << 4; break;
+; 55 : case 8: flags += 2 << 4; break;
+; 56 : default: flags += 3 << 4;
+; 57 : }
+; 58 : switch ((int)(sizeof(z_off_t))) {
+; 59 : case 2: break;
+; 60 : case 4: flags += 1 << 6; break;
+; 61 : case 8: flags += 2 << 6; break;
+; 62 : default: flags += 3 << 6;
+; 63 : }
+; 64 : #ifdef DEBUG
+; 65 : flags += 1 << 8;
+; 66 : #endif
+; 67 : #if defined(ASMV) || defined(ASMINF)
+; 68 : flags += 1 << 9;
+; 69 : #endif
+; 70 : #ifdef ZLIB_WINAPI
+; 71 : flags += 1 << 10;
+; 72 : #endif
+; 73 : #ifdef BUILDFIXED
+; 74 : flags += 1 << 12;
+; 75 : #endif
+; 76 : #ifdef DYNAMIC_CRC_TABLE
+; 77 : flags += 1 << 13;
+; 78 : #endif
+; 79 : #ifdef NO_GZCOMPRESS
+; 80 : flags += 1L << 16;
+; 81 : #endif
+; 82 : #ifdef NO_GZIP
+; 83 : flags += 1L << 17;
+; 84 : #endif
+; 85 : #ifdef PKZIP_BUG_WORKAROUND
+; 86 : flags += 1L << 20;
+; 87 : #endif
+; 88 : #ifdef FASTEST
+; 89 : flags += 1L << 21;
+; 90 : #endif
+; 91 : #if defined(STDC) || defined(Z_HAVE_STDARG_H)
+; 92 : # ifdef NO_vsnprintf
+; 93 : flags += 1L << 25;
+; 94 : # ifdef HAS_vsprintf_void
+; 95 : flags += 1L << 26;
+; 96 : # endif
+; 97 : # else
+; 98 : # ifdef HAS_vsnprintf_void
+; 99 : flags += 1L << 26;
+; 100 : # endif
+; 101 : # endif
+; 102 : #else
+; 103 : flags += 1L << 24;
+; 104 : # ifdef NO_snprintf
+; 105 : flags += 1L << 25;
+; 106 : # ifdef HAS_sprintf_void
+; 107 : flags += 1L << 26;
+; 108 : # endif
+; 109 : # else
+; 110 : # ifdef HAS_snprintf_void
+; 111 : flags += 1L << 26;
+; 112 : # endif
+; 113 : # endif
+; 114 : #endif
+; 115 : return flags;
+
+ 00000 b8 55 04 00 00 mov eax, 1109 ; 00000455H
+
+; 116 : }
+
+ 00005 c3 ret 0
+_zlibCompileFlags@0 ENDP
+_TEXT ENDS
+; Function compile flags: /Ogtp
+; File d:\downloads\tgl-master\tgl-master\zlib\zutil.c
+; COMDAT _zError@4
+_TEXT SEGMENT
+_err$ = 8 ; size = 4
+_zError@4 PROC ; COMDAT
+
+; 138 : {
+
+ 00000 55 push ebp
+ 00001 8b ec mov ebp, esp
+
+; 139 : return ERR_MSG(err);
+
+ 00003 8b 45 08 mov eax, DWORD PTR _err$[ebp]
+ 00006 b9 08 00 00 00 mov ecx, OFFSET _z_errmsg+8
+ 0000b c1 e0 02 shl eax, 2
+ 0000e 2b c8 sub ecx, eax
+ 00010 8b 01 mov eax, DWORD PTR [ecx]
+
+; 140 : }
+
+ 00012 5d pop ebp
+ 00013 c2 04 00 ret 4
+_zError@4 ENDP
+_TEXT ENDS
+END
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zutil.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zutil.obj
new file mode 100644
index 0000000000..508155a890
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/Tmp/zutil.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/vc140.pdb b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/vc140.pdb
new file mode 100644
index 0000000000..616296a510
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/vc140.pdb
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.dll b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.dll
new file mode 100644
index 0000000000..6b12faecb8
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.dll
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.exp b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.exp
new file mode 100644
index 0000000000..97d7a3df8e
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.exp
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.iobj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.iobj
new file mode 100644
index 0000000000..47e1656954
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.iobj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.ipdb b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.ipdb
new file mode 100644
index 0000000000..5e1382c377
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.ipdb
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.lib b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.lib
new file mode 100644
index 0000000000..ab26344338
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.lib
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.map b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.map
new file mode 100644
index 0000000000..5714b565d7
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.map
@@ -0,0 +1,861 @@
+ zlibwapi
+
+ Timestamp is 56dd9cc4 (Mon Mar 7 18:22:44 2016)
+
+ Preferred load address is 10000000
+
+ Start Length Name Class
+ 0001:00000000 000102c4H .text$mn CODE
+ 0002:00000000 0000011cH .idata$5 DATA
+ 0002:0000011c 00000004H .00cfg DATA
+ 0002:00000120 00000004H .CRT$XCA DATA
+ 0002:00000124 00000004H .CRT$XCZ DATA
+ 0002:00000128 00000004H .CRT$XIA DATA
+ 0002:0000012c 00000004H .CRT$XIZ DATA
+ 0002:00000130 00000004H .CRT$XPA DATA
+ 0002:00000134 00000004H .CRT$XPZ DATA
+ 0002:00000138 00000004H .CRT$XTA DATA
+ 0002:0000013c 00000004H .CRT$XTZ DATA
+ 0002:00000140 000041dcH .rdata DATA
+ 0002:00004320 00000004H .rdata$sxdata DATA
+ 0002:00004324 000002d0H .rdata$zzzdbg DATA
+ 0002:000045f4 00000004H .rtc$IAA DATA
+ 0002:000045f8 00000004H .rtc$IZZ DATA
+ 0002:000045fc 00000004H .rtc$TAA DATA
+ 0002:00004600 00000004H .rtc$TZZ DATA
+ 0002:00004608 0000007cH .xdata$x DATA
+ 0002:00004690 00000c44H .edata DATA
+ 0002:000052d4 000000a0H .idata$2 DATA
+ 0002:00005374 00000014H .idata$3 DATA
+ 0002:00005388 0000011cH .idata$4 DATA
+ 0002:000054a4 0000050aH .idata$6 DATA
+ 0003:00000000 00000060H .data DATA
+ 0003:00000060 00000388H .bss DATA
+ 0004:00000000 0000001cH .gfids$y DATA
+ 0005:00000000 00000058H .rsrc$01 DATA
+ 0005:00000060 00000338H .rsrc$02 DATA
+
+ Address Publics by Value Rva+Base Lib:Object
+
+ 0000:00000000 ___guard_iat_count 00000000 <absolute>
+ 0000:00000000 ___guard_fids_table 00000000 <absolute>
+ 0000:00000000 ___guard_longjmp_count 00000000 <absolute>
+ 0000:00000000 ___guard_iat_table 00000000 <absolute>
+ 0000:00000000 ___guard_longjmp_table 00000000 <absolute>
+ 0000:00000000 ___guard_fids_count 00000000 <absolute>
+ 0000:00000001 ___safe_se_handler_count 00000001 <absolute>
+ 0000:00000100 ___guard_flags 00000100 <absolute>
+ 0000:00000000 ___ImageBase 10000000 <linker-defined>
+ 0001:00000000 _adler32@12 10001000 f adler32.obj
+ 0001:00000340 _adler32_combine@12 10001340 f adler32.obj
+ 0001:00000360 _compress2@20 10001360 f compress.obj
+ 0001:00000410 _compress@16 10001410 f compress.obj
+ 0001:00000430 _compressBound@4 10001430 f compress.obj
+ 0001:00000450 _get_crc_table@0 10001450 f crc32.obj
+ 0001:00000460 _crc32@12 10001460 f crc32.obj
+ 0001:00000b50 _crc32_combine@12 10001b50 f crc32.obj
+ 0001:00000b70 _deflateInit_@16 10001b70 f deflate.obj
+ 0001:00000b90 _deflateInit2_@32 10001b90 f deflate.obj
+ 0001:00000dc0 _deflateSetDictionary@12 10001dc0 f deflate.obj
+ 0001:00000f60 _deflateResetKeep@4 10001f60 f deflate.obj
+ 0001:00001010 _deflateReset@4 10002010 f deflate.obj
+ 0001:00001040 _deflateSetHeader@8 10002040 f deflate.obj
+ 0001:00001070 _deflatePending@12 10002070 f deflate.obj
+ 0001:000010b0 _deflatePrime@12 100020b0 f deflate.obj
+ 0001:00001140 _deflateParams@12 10002140 f deflate.obj
+ 0001:00001240 _deflateTune@20 10002240 f deflate.obj
+ 0001:00001290 _deflateBound@8 10002290 f deflate.obj
+ 0001:00001400 _deflate@8 10002400 f deflate.obj
+ 0001:00001c70 _deflateEnd@4 10002c70 f deflate.obj
+ 0001:00001d50 _deflateCopy@8 10002d50 f deflate.obj
+ 0001:00003010 _gzclose@4 10004010 f gzclose.obj
+ 0001:00003040 ___local_stdio_printf_options 10004040 f i gzlib.obj
+ 0001:00003050 __vsnprintf_l 10004050 f i gzlib.obj
+ 0001:00003080 __vsnprintf 10004080 f i gzlib.obj
+ 0001:000030b0 __snprintf 100040b0 f i gzlib.obj
+ 0001:00003450 _gzopen@8 10004450 f gzlib.obj
+ 0001:00003470 _gzdopen@8 10004470 f gzlib.obj
+ 0001:000034d0 _gzopen_w@8 100044d0 f gzlib.obj
+ 0001:000034f0 _gzbuffer@8 100044f0 f gzlib.obj
+ 0001:00003530 _gzrewind@4 10004530 f gzlib.obj
+ 0001:00003590 _gzseek64@16 10004590 f gzlib.obj
+ 0001:00003720 _gzseek@12 10004720 f gzlib.obj
+ 0001:00003760 _gztell64@4 10004760 f gzlib.obj
+ 0001:000037c0 _gztell@4 100047c0 f gzlib.obj
+ 0001:000037f0 _gzoffset64@4 100047f0 f gzlib.obj
+ 0001:00003840 _gzoffset@4 10004840 f gzlib.obj
+ 0001:00003870 _gzeof@4 10004870 f gzlib.obj
+ 0001:000038b0 _gzerror@8 100048b0 f gzlib.obj
+ 0001:00003900 _gzclearerr@4 10004900 f gzlib.obj
+ 0001:00003940 _gz_error 10004940 f gzlib.obj
+ 0001:00003e90 _gzread@12 10004e90 f gzread.obj
+ 0001:00003fe0 _gzgetc@4 10004fe0 f gzread.obj
+ 0001:00004040 _gzgetc_@4 10005040 f gzread.obj
+ 0001:00004050 _gzungetc@8 10005050 f gzread.obj
+ 0001:00004130 _gzgets@12 10005130 f gzread.obj
+ 0001:00004240 _gzdirect@4 10005240 f gzread.obj
+ 0001:00004280 _gzclose_r@4 10005280 f gzread.obj
+ 0001:00004310 _vsnprintf 10005310 f i gzwrite.obj
+ 0001:00004620 _gzwrite@12 10005620 f gzwrite.obj
+ 0001:00004740 _gzputc@8 10005740 f gzwrite.obj
+ 0001:000047f0 _gzputs@8 100057f0 f gzwrite.obj
+ 0001:00004830 _gzvprintf 10005830 f gzwrite.obj
+ 0001:00004910 _gzprintf 10005910 f gzwrite.obj
+ 0001:00004930 _gzflush@8 10005930 f gzwrite.obj
+ 0001:000049a0 _gzsetparams@12 100059a0 f gzwrite.obj
+ 0001:00004a50 _gzclose_w@4 10005a50 f gzwrite.obj
+ 0001:00004b10 _inflateBackInit_@20 10005b10 f infback.obj
+ 0001:00004c10 _inflateBack@20 10005c10 f infback.obj
+ 0001:00005a10 _inflateBackEnd@4 10006a10 f infback.obj
+ 0001:00005a50 _inflate_fast 10006a50 f inffast.obj
+ 0001:00005e80 _inflateResetKeep@4 10006e80 f inflate.obj
+ 0001:00005f30 _inflateReset@4 10006f30 f inflate.obj
+ 0001:00005f70 _inflateReset2@8 10006f70 f inflate.obj
+ 0001:00006000 _inflateInit2_@16 10007000 f inflate.obj
+ 0001:000060c0 _inflateInit_@12 100070c0 f inflate.obj
+ 0001:000060e0 _inflatePrime@12 100070e0 f inflate.obj
+ 0001:00006270 _inflate@8 10007270 f inflate.obj
+ 0001:00007940 _inflateEnd@4 10008940 f inflate.obj
+ 0001:00007990 _inflateGetDictionary@12 10008990 f inflate.obj
+ 0001:00007a00 _inflateSetDictionary@12 10008a00 f inflate.obj
+ 0001:00007aa0 _inflateGetHeader@8 10008aa0 f inflate.obj
+ 0001:00007b60 _inflateSync@4 10008b60 f inflate.obj
+ 0001:00007c50 _inflateSyncPoint@4 10008c50 f inflate.obj
+ 0001:00007c90 _inflateCopy@8 10008c90 f inflate.obj
+ 0001:00007df0 _inflateUndermine@8 10008df0 f inflate.obj
+ 0001:00007e20 _inflateMark@4 10008e20 f inflate.obj
+ 0001:00007e90 _inflate_table 10008e90 f inftrees.obj
+ 0001:000082a0 _call_zopen64 100092a0 f ioapi.obj
+ 0001:000082c0 _call_zseek64 100092c0 f ioapi.obj
+ 0001:00008320 _call_ztell64 10009320 f ioapi.obj
+ 0001:00008350 _fill_zlib_filefunc64_32_def_from_filefunc32 10009350 f ioapi.obj
+ 0001:000085a0 _fill_fopen64_filefunc 100095a0 f ioapi.obj
+ 0001:00008690 _win32_open64_file_func 10009690 f iowin32.obj
+ 0001:00008700 _win32_open64_file_funcA 10009700 f iowin32.obj
+ 0001:00008770 _win32_open64_file_funcW 10009770 f iowin32.obj
+ 0001:000087c0 _win32_open_file_func 100097c0 f iowin32.obj
+ 0001:00008830 _win32_read_file_func 10009830 f iowin32.obj
+ 0001:00008880 _win32_write_file_func 10009880 f iowin32.obj
+ 0001:000088f0 _win32_tell_file_func 100098f0 f iowin32.obj
+ 0001:00008950 _win32_tell64_file_func 10009950 f iowin32.obj
+ 0001:000089b0 _win32_seek_file_func 100099b0 f iowin32.obj
+ 0001:00008a30 _win32_seek64_file_func 10009a30 f iowin32.obj
+ 0001:00008aa0 _win32_close_file_func 10009aa0 f iowin32.obj
+ 0001:00008ad0 _win32_error_file_func 10009ad0 f iowin32.obj
+ 0001:00008af0 _fill_win32_filefunc 10009af0 f iowin32.obj
+ 0001:00008b30 _fill_win32_filefunc64 10009b30 f iowin32.obj
+ 0001:00008b70 _fill_win32_filefunc64A 10009b70 f iowin32.obj
+ 0001:00008bb0 _fill_win32_filefunc64W 10009bb0 f iowin32.obj
+ 0001:00008c00 __tr_init 10009c00 f trees.obj
+ 0001:00009b90 __tr_stored_block 1000ab90 f trees.obj
+ 0001:00009c40 __tr_flush_bits 1000ac40 f trees.obj
+ 0001:00009c50 __tr_align 1000ac50 f trees.obj
+ 0001:00009d40 __tr_flush_block 1000ad40 f trees.obj
+ 0001:0000a530 _uncompress@16 1000b530 f uncompr.obj
+ 0001:0000a910 _unzStringFileNameCompare@12 1000b910 f unzip.obj
+ 0001:0000b1c0 _unzOpen2@8 1000c1c0 f unzip.obj
+ 0001:0000b210 _unzOpen2_64@8 1000c210 f unzip.obj
+ 0001:0000b270 _unzOpen@4 1000c270 f unzip.obj
+ 0001:0000b290 _unzOpen64@4 1000c290 f unzip.obj
+ 0001:0000b2b0 _unzClose@4 1000c2b0 f unzip.obj
+ 0001:0000b2f0 _unzGetGlobalInfo64@8 1000c2f0 f unzip.obj
+ 0001:0000b320 _unzGetGlobalInfo@8 1000c320 f unzip.obj
+ 0001:0000b990 _unzGetCurrentFileInfo64@32 1000c990 f unzip.obj
+ 0001:0000b9c0 _unzGetCurrentFileInfo@32 1000c9c0 f unzip.obj
+ 0001:0000ba80 _unzGoToFirstFile@4 1000ca80 f unzip.obj
+ 0001:0000baf0 _unzGoToNextFile@4 1000caf0 f unzip.obj
+ 0001:0000bba0 _unzLocateFile@12 1000cba0 f unzip.obj
+ 0001:0000bd50 _unzGetFilePos64@8 1000cd50 f unzip.obj
+ 0001:0000bda0 _unzGetFilePos@8 1000cda0 f unzip.obj
+ 0001:0000bdd0 _unzGoToFilePos64@8 1000cdd0 f unzip.obj
+ 0001:0000be40 _unzGoToFilePos@8 1000ce40 f unzip.obj
+ 0001:0000c0e0 _unzOpenCurrentFile3@20 1000d0e0 f unzip.obj
+ 0001:0000c350 _unzOpenCurrentFile@4 1000d350 f unzip.obj
+ 0001:0000c370 _unzOpenCurrentFilePassword@8 1000d370 f unzip.obj
+ 0001:0000c390 _unzOpenCurrentFile2@16 1000d390 f unzip.obj
+ 0001:0000c3b0 _unzGetCurrentFileZStreamPos64@4 1000d3b0 f unzip.obj
+ 0001:0000c3f0 _unzReadCurrentFile@12 1000d3f0 f unzip.obj
+ 0001:0000c6b0 _unztell@4 1000d6b0 f unzip.obj
+ 0001:0000c6e0 _unztell64@4 1000d6e0 f unzip.obj
+ 0001:0000c710 _unzeof@4 1000d710 f unzip.obj
+ 0001:0000c750 _unzGetLocalExtrafield@12 1000d750 f unzip.obj
+ 0001:0000c820 _unzCloseCurrentFile@4 1000d820 f unzip.obj
+ 0001:0000c8c0 _unzGetGlobalComment@12 1000d8c0 f unzip.obj
+ 0001:0000d4c0 _LoadCentralDirectoryRecord 1000e4c0 f zip.obj
+ 0001:0000d970 _zipOpen3@16 1000e970 f zip.obj
+ 0001:0000dae0 _zipOpen2@16 1000eae0 f zip.obj
+ 0001:0000db30 _zipOpen2_64@16 1000eb30 f zip.obj
+ 0001:0000db90 _zipOpen@8 1000eb90 f zip.obj
+ 0001:0000dbb0 _zipOpen64@8 1000ebb0 f zip.obj
+ 0001:0000dbd0 _Write_LocalFileHeader 1000ebd0 f zip.obj
+ 0001:0000dde0 _zipOpenNewFileInZip4_64@76 1000ede0 f zip.obj
+ 0001:0000e2c0 _zipOpenNewFileInZip3@64 1000f2c0 f zip.obj
+ 0001:0000e310 _zipOpenNewFileInZip3_64@68 1000f310 f zip.obj
+ 0001:0000e360 _zipOpenNewFileInZip2@44 1000f360 f zip.obj
+ 0001:0000e3a0 _zipOpenNewFileInZip2_64@48 1000f3a0 f zip.obj
+ 0001:0000e3e0 _zipOpenNewFileInZip64@44 1000f3e0 f zip.obj
+ 0001:0000e420 _zipOpenNewFileInZip@40 1000f420 f zip.obj
+ 0001:0000e520 _zipWriteInFileInZip@12 1000f520 f zip.obj
+ 0001:0000e620 _zipCloseFileInZipRaw@12 1000f620 f zip.obj
+ 0001:0000e640 _zipCloseFileInZipRaw64@16 1000f640 f zip.obj
+ 0001:0000eb30 _zipCloseFileInZip@4 1000fb30 f zip.obj
+ 0001:0000eb50 _Write_Zip64EndOfCentralDirectoryLocator 1000fb50 f zip.obj
+ 0001:0000ebd0 _Write_Zip64EndOfCentralDirectoryRecord 1000fbd0 f zip.obj
+ 0001:0000ecf0 _Write_EndOfCentralDirectoryRecord 1000fcf0 f zip.obj
+ 0001:0000ee30 _Write_GlobalComment 1000fe30 f zip.obj
+ 0001:0000eea0 _zipClose@8 1000fea0 f zip.obj
+ 0001:0000f030 _zlibVersion@0 10010030 f zutil.obj
+ 0001:0000f040 _zlibCompileFlags@0 10010040 f zutil.obj
+ 0001:0000f050 _zError@4 10010050 f zutil.obj
+ 0001:0000f070 _zcalloc 10010070 f zutil.obj
+ 0001:0000f090 _zcfree 10010090 f zutil.obj
+ 0001:0000f0a2 _ReadFile@20 100100a2 f kernel32:KERNEL32.dll
+ 0001:0000f0a8 _WriteFile@20 100100a8 f kernel32:KERNEL32.dll
+ 0001:0000f0ae _CreateFile2@20 100100ae f kernel32:KERNEL32.dll
+ 0001:0000f0b4 _MultiByteToWideChar@24 100100b4 f kernel32:KERNEL32.dll
+ 0001:0000f0ba _GetLastError@0 100100ba f kernel32:KERNEL32.dll
+ 0001:0000f0c0 _CloseHandle@4 100100c0 f kernel32:KERNEL32.dll
+ 0001:0000f0c6 _SetFilePointerEx@20 100100c6 f kernel32:KERNEL32.dll
+ 0001:0000f3e1 __CRT_INIT@12 100103e1 f MSVCRT:dll_dllmain.obj
+ 0001:0000f3ea __DllMainCRTStartup@12 100103ea f MSVCRT:dll_dllmain.obj
+ 0001:0000f40d ??$__crt_fast_decode_pointer@PAP6AXXZ@@YAPAP6AXXZQAP6AXXZ@Z 1001040d f i MSVCRT:utility.obj
+ 0001:0000f421 ??$__crt_fast_encode_pointer@PAP6AXXZ@@YAPAP6AXXZQAP6AXXZ@Z 10010421 f i MSVCRT:utility.obj
+ 0001:0000f43e ?__crt_rotate_pointer_value@@YAIIH@Z 1001043e f i MSVCRT:utility.obj
+ 0001:0000f4c2 _NtCurrentTeb 100104c2 f i MSVCRT:utility.obj
+ 0001:0000f4c9 ___scrt_acquire_startup_lock 100104c9 f MSVCRT:utility.obj
+ 0001:0000f4fe ___scrt_dllmain_after_initialize_c 100104fe f MSVCRT:utility.obj
+ 0001:0000f516 ___scrt_dllmain_before_initialize_c 10010516 f MSVCRT:utility.obj
+ 0001:0000f524 ___scrt_dllmain_crt_thread_attach 10010524 f MSVCRT:utility.obj
+ 0001:0000f543 ___scrt_dllmain_crt_thread_detach 10010543 f MSVCRT:utility.obj
+ 0001:0000f550 ___scrt_dllmain_exception_filter 10010550 f MSVCRT:utility.obj
+ 0001:0000f583 ___scrt_dllmain_uninitialize_c 10010583 f MSVCRT:utility.obj
+ 0001:0000f5a6 ___scrt_dllmain_uninitialize_critical 100105a6 f MSVCRT:utility.obj
+ 0001:0000f5b3 ___scrt_initialize_crt 100105b3 f MSVCRT:utility.obj
+ 0001:0000f5ec ___scrt_initialize_onexit_tables 100105ec f MSVCRT:utility.obj
+ 0001:0000f683 ___scrt_is_nonwritable_in_current_image 10010683 f MSVCRT:utility.obj
+ 0001:0000f710 ___scrt_release_startup_lock 10010710 f MSVCRT:utility.obj
+ 0001:0000f72d ___scrt_uninitialize_crt 1001072d f MSVCRT:utility.obj
+ 0001:0000f755 __onexit 10010755 f MSVCRT:utility.obj
+ 0001:0000f790 _at_quick_exit 10010790 f MSVCRT:utility.obj
+ 0001:0000f7c1 _atexit 100107c1 f MSVCRT:utility.obj
+ 0001:0000f7d6 ___security_init_cookie 100107d6 f MSVCRT:gs_support.obj
+ 0001:0000f872 _DllMain@12 10010872 f MSVCRT:dll_dllmain_stub.obj
+ 0001:0000f894 ?__scrt_initialize_type_info@@YAXXZ 10010894 f MSVCRT:tncleanup.obj
+ 0001:0000f8a0 ?__scrt_uninitialize_type_info@@YAXXZ 100108a0 f MSVCRT:tncleanup.obj
+ 0001:0000f8ac ___local_stdio_scanf_options 100108ac f i MSVCRT:default_local_stdio_options.obj
+ 0001:0000f8b2 ___scrt_initialize_default_local_stdio_options 100108b2 f MSVCRT:default_local_stdio_options.obj
+ 0001:0000f8cf ___scrt_get_dyn_tls_init_callback 100108cf f MSVCRT:dyn_tls_init.obj
+ 0001:0000f8d5 ___scrt_fastfail 100108d5 f MSVCRT:utility_desktop.obj
+ 0001:0000f9f0 ___scrt_get_show_window_mode 100109f0 f MSVCRT:utility_desktop.obj
+ 0001:0000fa23 ___scrt_initialize_winrt 10010a23 f MSVCRT:utility_desktop.obj
+ 0001:0000fa26 ___scrt_is_managed_app 10010a26 f MSVCRT:utility_desktop.obj
+ 0001:0000fa6a ___scrt_set_unhandled_exception_filter 10010a6a f MSVCRT:utility_desktop.obj
+ 0001:0000fa76 ___scrt_unhandled_exception_filter@4 10010a76 f MSVCRT:utility_desktop.obj
+ 0001:0000fab7 __crt_debugger_hook 10010ab7 f MSVCRT:utility_desktop.obj
+ 0001:0000fabf __RTC_Initialize 10010abf f MSVCRT:_initsect_.obj
+ 0001:0000faea __RTC_Terminate 10010aea f MSVCRT:_initsect_.obj
+ 0001:0000fb15 @_guard_check_icall@4 10010b15 f i MSVCRT:checkcfg.obj
+ 0001:0000fb20 __SEH_prolog4 10010b20 f MSVCRT:_sehprolg4_.obj
+ 0001:0000fb66 __SEH_epilog4 10010b66 f MSVCRT:_sehprolg4_.obj
+ 0001:0000fb7b __except_handler4 10010b7b f MSVCRT:_chandler4gs_.obj
+ 0001:0000fb9e ___isa_available_init 10010b9e f MSVCRT:_cpu_disp_.obj
+ 0001:0000fd3f ___scrt_is_ucrt_dll_in_use 10010d3f f MSVCRT:ucrt_detection.obj
+ 0001:0000fd4b @_guard_check_icall_nop@4 10010d4b f i MSVCRT:guard_support.obj
+ 0001:0000fd4c __guard_icall_checks_enforced 10010d4c f i MSVCRT:guard_support.obj
+ 0001:0000fd5e @__security_check_cookie@4 10010d5e f MSVCRT:_secchk_.obj
+ 0001:0000fd6f ___raise_securityfailure 10010d6f f MSVCRT:gs_report.obj
+ 0001:0000fd97 ___report_gsfailure 10010d97 f MSVCRT:gs_report.obj
+ 0001:0000fe92 ___report_rangecheckfailure 10010e92 f MSVCRT:gs_report.obj
+ 0001:0000fe9e ___report_securityfailure 10010e9e f MSVCRT:gs_report.obj
+ 0001:0000ff6e ___report_securityfailureEx 10010f6e f MSVCRT:gs_report.obj
+ 0001:00010084 _memchr 10011084 f vcruntime:VCRUNTIME140.dll
+ 0001:0001008a ___telemetry_main_invoke_trigger 1001108a f vcruntime:VCRUNTIME140.dll
+ 0001:00010090 ___telemetry_main_return_trigger 10011090 f vcruntime:VCRUNTIME140.dll
+ 0001:00010096 ___std_type_info_destroy_list 10011096 f vcruntime:VCRUNTIME140.dll
+ 0001:0001009c _memset 1001109c f vcruntime:VCRUNTIME140.dll
+ 0001:000100a2 __except_handler4_common 100110a2 f vcruntime:VCRUNTIME140.dll
+ 0001:000100a8 __lseeki64 100110a8 f ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0001:000100ae __wopen 100110ae f ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0001:000100b4 __open 100110b4 f ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0001:000100ba _wcstombs 100110ba f ucrt:api-ms-win-crt-convert-l1-1-0.dll
+ 0001:000100c0 ___stdio_common_vsprintf 100110c0 f ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0001:000100c6 _free 100110c6 f ucrt:api-ms-win-crt-heap-l1-1-0.dll
+ 0001:000100cc _malloc 100110cc f ucrt:api-ms-win-crt-heap-l1-1-0.dll
+ 0001:000100d2 __read 100110d2 f ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0001:000100d8 __close 100110d8 f ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0001:000100de __errno 100110de f ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0001:000100e4 _strerror 100110e4 f ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0001:000100ea __write 100110ea f ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0001:000100f0 _ftell 100110f0 f ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0001:000100f6 _ferror 100110f6 f ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0001:000100fc _fopen 100110fc f ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0001:00010102 _fclose 10011102 f ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0001:00010108 _fseek 10011108 f ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0001:0001010e _fwrite 1001110e f ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0001:00010114 __ftelli64 10011114 f ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0001:0001011a _fread 1001111a f ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0001:00010120 __fseeki64 10011120 f ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0001:00010126 _srand 10011126 f ucrt:api-ms-win-crt-utility-l1-1-0.dll
+ 0001:0001012c _rand 1001112c f ucrt:api-ms-win-crt-utility-l1-1-0.dll
+ 0001:00010132 __time64 10011132 f ucrt:api-ms-win-crt-time-l1-1-0.dll
+ 0001:00010138 __initterm 10011138 f ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0001:0001013e __initterm_e 1001113e f ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0001:00010144 __seh_filter_dll 10011144 f ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0001:0001014a __initialize_narrow_environment 1001114a f ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0001:00010150 __initialize_onexit_table 10011150 f ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0001:00010156 __register_onexit_function 10011156 f ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0001:0001015c __execute_onexit_table 1001115c f ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0001:00010162 __crt_atexit 10011162 f ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0001:00010168 __crt_at_quick_exit 10011168 f ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0001:0001016e __cexit 1001116e f ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0001:00010174 _terminate 10011174 f ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0001:0001017a _QueryPerformanceCounter@4 1001117a f kernel32:KERNEL32.dll
+ 0001:00010180 _GetCurrentProcessId@0 10011180 f kernel32:KERNEL32.dll
+ 0001:00010186 _GetCurrentThreadId@0 10011186 f kernel32:KERNEL32.dll
+ 0001:0001018c _GetSystemTimeAsFileTime@4 1001118c f kernel32:KERNEL32.dll
+ 0001:00010192 _DisableThreadLibraryCalls@4 10011192 f kernel32:KERNEL32.dll
+ 0001:00010198 _InitializeSListHead@4 10011198 f kernel32:KERNEL32.dll
+ 0001:0001019e _IsDebuggerPresent@0 1001119e f kernel32:KERNEL32.dll
+ 0001:000101a4 _UnhandledExceptionFilter@4 100111a4 f kernel32:KERNEL32.dll
+ 0001:000101aa _SetUnhandledExceptionFilter@4 100111aa f kernel32:KERNEL32.dll
+ 0001:000101b0 _GetStartupInfoW@4 100111b0 f kernel32:KERNEL32.dll
+ 0001:000101b6 _IsProcessorFeaturePresent@4 100111b6 f kernel32:KERNEL32.dll
+ 0001:000101bc _GetModuleHandleW@4 100111bc f kernel32:KERNEL32.dll
+ 0001:000101c2 _GetCurrentProcess@0 100111c2 f kernel32:KERNEL32.dll
+ 0001:000101c8 _TerminateProcess@8 100111c8 f kernel32:KERNEL32.dll
+ 0001:000101ce ___acrt_initialize 100111ce f MSVCRT:ucrt_stubs.obj
+ 0001:000101ce ___scrt_stub_for_acrt_initialize 100111ce f MSVCRT:ucrt_stubs.obj
+ 0001:000101ce ___vcrt_initialize 100111ce f MSVCRT:ucrt_stubs.obj
+ 0001:000101d1 ___vcrt_thread_attach 100111d1 f MSVCRT:ucrt_stubs.obj
+ 0001:000101d1 ___acrt_thread_attach 100111d1 f MSVCRT:ucrt_stubs.obj
+ 0001:000101d1 ___scrt_stub_for_acrt_thread_attach 100111d1 f MSVCRT:ucrt_stubs.obj
+ 0001:000101d4 ___scrt_stub_for_acrt_thread_detach 100111d4 f MSVCRT:ucrt_stubs.obj
+ 0001:000101d4 ___vcrt_thread_detach 100111d4 f MSVCRT:ucrt_stubs.obj
+ 0001:000101d4 ___acrt_thread_detach 100111d4 f MSVCRT:ucrt_stubs.obj
+ 0001:000101d7 ___vcrt_uninitialize 100111d7 f MSVCRT:ucrt_stubs.obj
+ 0001:000101d7 ___acrt_uninitialize 100111d7 f MSVCRT:ucrt_stubs.obj
+ 0001:000101d7 ___scrt_stub_for_acrt_uninitialize 100111d7 f MSVCRT:ucrt_stubs.obj
+ 0001:000101da ___acrt_uninitialize_critical 100111da f MSVCRT:ucrt_stubs.obj
+ 0001:000101da ___vcrt_uninitialize_critical 100111da f MSVCRT:ucrt_stubs.obj
+ 0001:000101da ___scrt_stub_for_acrt_uninitialize_critical 100111da f MSVCRT:ucrt_stubs.obj
+ 0001:000101dd __is_c_termination_complete 100111dd f MSVCRT:ucrt_stubs.obj
+ 0001:000101dd ___scrt_stub_for_is_c_termination_complete 100111dd f MSVCRT:ucrt_stubs.obj
+ 0001:000101e0 __alldiv 100111e0 f MSVCRT:lldiv.obj
+ 0001:00010290 __chkstk 10011290 f MSVCRT:chkstk.obj
+ 0001:00010290 __alloca_probe 10011290 f MSVCRT:chkstk.obj
+ 0001:000102be _memcpy 100112be f vcruntime:VCRUNTIME140.dll
+ 0002:00000000 __imp__ReadFile@20 10012000 kernel32:KERNEL32.dll
+ 0002:00000004 __imp__WriteFile@20 10012004 kernel32:KERNEL32.dll
+ 0002:00000008 __imp__CreateFile2@20 10012008 kernel32:KERNEL32.dll
+ 0002:0000000c __imp__MultiByteToWideChar@24 1001200c kernel32:KERNEL32.dll
+ 0002:00000010 __imp__GetLastError@0 10012010 kernel32:KERNEL32.dll
+ 0002:00000014 __imp__CloseHandle@4 10012014 kernel32:KERNEL32.dll
+ 0002:00000018 __imp__SetFilePointerEx@20 10012018 kernel32:KERNEL32.dll
+ 0002:0000001c __imp__GetCurrentProcessId@0 1001201c kernel32:KERNEL32.dll
+ 0002:00000020 __imp__GetCurrentThreadId@0 10012020 kernel32:KERNEL32.dll
+ 0002:00000024 __imp__GetSystemTimeAsFileTime@4 10012024 kernel32:KERNEL32.dll
+ 0002:00000028 __imp__DisableThreadLibraryCalls@4 10012028 kernel32:KERNEL32.dll
+ 0002:0000002c __imp__InitializeSListHead@4 1001202c kernel32:KERNEL32.dll
+ 0002:00000030 __imp__IsDebuggerPresent@0 10012030 kernel32:KERNEL32.dll
+ 0002:00000034 __imp__QueryPerformanceCounter@4 10012034 kernel32:KERNEL32.dll
+ 0002:00000038 __imp__TerminateProcess@8 10012038 kernel32:KERNEL32.dll
+ 0002:0000003c __imp__GetCurrentProcess@0 1001203c kernel32:KERNEL32.dll
+ 0002:00000040 __imp__GetModuleHandleW@4 10012040 kernel32:KERNEL32.dll
+ 0002:00000044 __imp__IsProcessorFeaturePresent@4 10012044 kernel32:KERNEL32.dll
+ 0002:00000048 __imp__GetStartupInfoW@4 10012048 kernel32:KERNEL32.dll
+ 0002:0000004c __imp__SetUnhandledExceptionFilter@4 1001204c kernel32:KERNEL32.dll
+ 0002:00000050 __imp__UnhandledExceptionFilter@4 10012050 kernel32:KERNEL32.dll
+ 0002:00000054 \177KERNEL32_NULL_THUNK_DATA 10012054 kernel32:KERNEL32.dll
+ 0002:00000058 __imp__memset 10012058 vcruntime:VCRUNTIME140.dll
+ 0002:0000005c __imp____std_type_info_destroy_list 1001205c vcruntime:VCRUNTIME140.dll
+ 0002:00000060 __imp____telemetry_main_return_trigger 10012060 vcruntime:VCRUNTIME140.dll
+ 0002:00000064 __imp____telemetry_main_invoke_trigger 10012064 vcruntime:VCRUNTIME140.dll
+ 0002:00000068 __imp__memchr 10012068 vcruntime:VCRUNTIME140.dll
+ 0002:0000006c __imp___except_handler4_common 1001206c vcruntime:VCRUNTIME140.dll
+ 0002:00000070 __imp__memcpy 10012070 vcruntime:VCRUNTIME140.dll
+ 0002:00000074 \177VCRUNTIME140_NULL_THUNK_DATA 10012074 vcruntime:VCRUNTIME140.dll
+ 0002:00000078 __imp__wcstombs 10012078 ucrt:api-ms-win-crt-convert-l1-1-0.dll
+ 0002:0000007c \177api-ms-win-crt-convert-l1-1-0_NULL_THUNK_DATA 1001207c ucrt:api-ms-win-crt-convert-l1-1-0.dll
+ 0002:00000080 __imp__malloc 10012080 ucrt:api-ms-win-crt-heap-l1-1-0.dll
+ 0002:00000084 __imp__free 10012084 ucrt:api-ms-win-crt-heap-l1-1-0.dll
+ 0002:00000088 \177api-ms-win-crt-heap-l1-1-0_NULL_THUNK_DATA 10012088 ucrt:api-ms-win-crt-heap-l1-1-0.dll
+ 0002:0000008c __imp__strerror 1001208c ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0002:00000090 __imp___errno 10012090 ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0002:00000094 __imp__terminate 10012094 ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0002:00000098 __imp___initterm 10012098 ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0002:0000009c __imp___initterm_e 1001209c ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0002:000000a0 __imp___seh_filter_dll 100120a0 ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0002:000000a4 __imp___initialize_narrow_environment 100120a4 ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0002:000000a8 __imp___initialize_onexit_table 100120a8 ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0002:000000ac __imp___register_onexit_function 100120ac ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0002:000000b0 __imp___execute_onexit_table 100120b0 ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0002:000000b4 __imp___crt_atexit 100120b4 ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0002:000000b8 __imp___crt_at_quick_exit 100120b8 ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0002:000000bc __imp___cexit 100120bc ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0002:000000c0 \177api-ms-win-crt-runtime-l1-1-0_NULL_THUNK_DATA 100120c0 ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0002:000000c4 __imp___open 100120c4 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0002:000000c8 __imp___wopen 100120c8 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0002:000000cc __imp___lseeki64 100120cc ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0002:000000d0 __imp__fopen 100120d0 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0002:000000d4 __imp__fread 100120d4 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0002:000000d8 __imp____stdio_common_vsprintf 100120d8 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0002:000000dc __imp__ferror 100120dc ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0002:000000e0 __imp__ftell 100120e0 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0002:000000e4 __imp___write 100120e4 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0002:000000e8 __imp___ftelli64 100120e8 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0002:000000ec __imp__fwrite 100120ec ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0002:000000f0 __imp___close 100120f0 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0002:000000f4 __imp___read 100120f4 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0002:000000f8 __imp__fseek 100120f8 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0002:000000fc __imp__fclose 100120fc ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0002:00000100 __imp___fseeki64 10012100 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0002:00000104 \177api-ms-win-crt-stdio-l1-1-0_NULL_THUNK_DATA 10012104 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0002:00000108 __imp___time64 10012108 ucrt:api-ms-win-crt-time-l1-1-0.dll
+ 0002:0000010c \177api-ms-win-crt-time-l1-1-0_NULL_THUNK_DATA 1001210c ucrt:api-ms-win-crt-time-l1-1-0.dll
+ 0002:00000110 __imp__srand 10012110 ucrt:api-ms-win-crt-utility-l1-1-0.dll
+ 0002:00000114 __imp__rand 10012114 ucrt:api-ms-win-crt-utility-l1-1-0.dll
+ 0002:00000118 \177api-ms-win-crt-utility-l1-1-0_NULL_THUNK_DATA 10012118 ucrt:api-ms-win-crt-utility-l1-1-0.dll
+ 0002:0000011c ___guard_check_icall_fptr 1001211c MSVCRT:guard_support.obj
+ 0002:00000120 ___xc_a 10012120 MSVCRT:initializers.obj
+ 0002:00000124 ___xc_z 10012124 MSVCRT:initializers.obj
+ 0002:00000128 ___xi_a 10012128 MSVCRT:initializers.obj
+ 0002:0000012c ___xi_z 1001212c MSVCRT:initializers.obj
+ 0002:00000130 ___xp_a 10012130 MSVCRT:initializers.obj
+ 0002:00000134 ___xp_z 10012134 MSVCRT:initializers.obj
+ 0002:00000138 ___xt_a 10012138 MSVCRT:initializers.obj
+ 0002:0000013c ___xt_z 1001213c MSVCRT:initializers.obj
+ 0002:00000140 __pRawDllMain 10012140 MSVCRT:dll_dllmain.obj
+ 0002:00000140 __pDefaultRawDllMain 10012140 MSVCRT:dll_dllmain.obj
+ 0002:0000014c ??_C@_05IAIEPMAK@1?42?48?$AA@ 1001214c compress.obj
+ 0002:00003428 __length_code 10015428 trees.obj
+ 0002:00003528 __dist_code 10015528 trees.obj
+ 0002:00003e68 _unz_copyright 10015e68 unzip.obj
+ 0002:00003ebc _z_errmsg 10015ebc zutil.obj
+ 0002:00003ee4 ??_C@_02DKCKIIND@?$CFs?$AA@ 10015ee4 gzlib.obj
+ 0002:00003ee8 ??_C@_07EBNKNFJN@?$DMfd?3?$CFd?$DO?$AA@ 10015ee8 gzlib.obj
+ 0002:00003ef0 ??_C@_0O@BNNCBLEN@out?5of?5memory?$AA@ 10015ef0 gzlib.obj
+ 0002:00003efe ??_C@_00CNPNBAHC@?$AA@ 10015efe gzlib.obj
+ 0002:00003f00 ??_C@_02LMMGGCAJ@?3?5?$AA@ 10015f00 gzlib.obj
+ 0002:00003f04 ??_C@_06DIJPEION@?$CFs?$CFs?$CFs?$AA@ 10015f04 gzlib.obj
+ 0002:00003f0c ??_C@_0BH@CFIIDOJD@unexpected?5end?5of?5file?$AA@ 10015f0c gzread.obj
+ 0002:00003f24 ??_C@_0CH@CPOLIEKA@internal?5error?3?5inflate?5stream?5c@ 10015f24 gzread.obj
+ 0002:00003f4c ??_C@_0BG@HCKBMIHF@compressed?5data?5error?$AA@ 10015f4c gzread.obj
+ 0002:00003f64 ??_C@_0CF@MLPJFDMM@requested?5length?5does?5not?5fit?5in@ 10015f64 gzread.obj
+ 0002:00003f8c ??_C@_0BP@IIKIGMCC@out?5of?5room?5to?5push?5characters?$AA@ 10015f8c gzread.obj
+ 0002:00003fac ??_C@_0CH@DEEGAHIB@internal?5error?3?5deflate?5stream?5c@ 10015fac gzwrite.obj
+ 0002:00003fd4 ??_C@_0BD@PJCBIDD@invalid?5block?5type?$AA@ 10015fd4 infback.obj
+ 0002:00003fe8 ??_C@_0BN@LGAADGOK@invalid?5stored?5block?5lengths?$AA@ 10015fe8 infback.obj
+ 0002:00004008 ??_C@_0CE@GMIGFPBB@too?5many?5length?5or?5distance?5symb@ 10016008 infback.obj
+ 0002:0000402c ??_C@_0BJ@HDEPPGOH@invalid?5code?5lengths?5set?$AA@ 1001602c infback.obj
+ 0002:00004048 ??_C@_0BK@BMMPFBBH@invalid?5bit?5length?5repeat?$AA@ 10016048 infback.obj
+ 0002:00004064 ??_C@_0CF@DGDMADCD@invalid?5code?5?9?9?5missing?5end?9of?9b@ 10016064 infback.obj
+ 0002:0000408c ??_C@_0BM@IIMGAINC@invalid?5literal?1lengths?5set?$AA@ 1001608c infback.obj
+ 0002:000040a8 ??_C@_0BG@GMDFCBGP@invalid?5distances?5set?$AA@ 100160a8 infback.obj
+ 0002:000040c0 ??_C@_0BM@FFFLPBBC@invalid?5literal?1length?5code?$AA@ 100160c0 infback.obj
+ 0002:000040dc ??_C@_0BG@LBKINIKP@invalid?5distance?5code?$AA@ 100160dc infback.obj
+ 0002:000040f4 ??_C@_0BO@ECPMAOGG@invalid?5distance?5too?5far?5back?$AA@ 100160f4 infback.obj
+ 0002:00004114 ??_C@_0BH@LIBMMIGA@incorrect?5header?5check?$AA@ 10016114 inflate.obj
+ 0002:0000412c ??_C@_0BL@IHKGDAEE@unknown?5compression?5method?$AA@ 1001612c inflate.obj
+ 0002:00004148 ??_C@_0BE@EMOGCLGO@invalid?5window?5size?$AA@ 10016148 inflate.obj
+ 0002:0000415c ??_C@_0BJ@BLBBCOMO@unknown?5header?5flags?5set?$AA@ 1001615c inflate.obj
+ 0002:00004178 ??_C@_0BE@GONKLEPM@header?5crc?5mismatch?$AA@ 10016178 inflate.obj
+ 0002:0000418c ??_C@_0BF@MEIGEHBE@incorrect?5data?5check?$AA@ 1001618c inflate.obj
+ 0002:000041a4 ??_C@_0BH@FGKKJGOC@incorrect?5length?5check?$AA@ 100161a4 inflate.obj
+ 0002:000041bc ??_C@_02JDPG@rb?$AA@ 100161bc ioapi.obj
+ 0002:000041c0 ??_C@_03HMFOOINA@r?$CLb?$AA@ 100161c0 ioapi.obj
+ 0002:000041c4 ??_C@_02GMLFBBN@wb?$AA@ 100161c4 ioapi.obj
+ 0002:000041c8 ??_C@_01JOAMLHOP@?9?$AA@ 100161c8 zip.obj
+ 0002:000041cc ??_C@_0BA@MOKMMFOD@need?5dictionary?$AA@ 100161cc zutil.obj
+ 0002:000041dc ??_C@_0L@FNAOCBOG@stream?5end?$AA@ 100161dc zutil.obj
+ 0002:000041e8 ??_C@_0L@KIJFAKBJ@file?5error?$AA@ 100161e8 zutil.obj
+ 0002:000041f4 ??_C@_0N@MKKNPMJD@stream?5error?$AA@ 100161f4 zutil.obj
+ 0002:00004204 ??_C@_0L@HAHMBNLP@data?5error?$AA@ 10016204 zutil.obj
+ 0002:00004210 ??_C@_0BE@OGGJBMCE@insufficient?5memory?$AA@ 10016210 zutil.obj
+ 0002:00004224 ??_C@_0N@DFPGLBGC@buffer?5error?$AA@ 10016224 zutil.obj
+ 0002:00004234 ??_C@_0BF@CJFPCCEG@incompatible?5version?$AA@ 10016234 zutil.obj
+ 0002:000042c0 __load_config_used 100162c0 MSVCRT:loadcfg.obj
+ 0002:00004320 ___safe_se_handler_table 10016320 <linker-defined>
+ 0002:000045f4 ___rtc_iaa 100165f4 MSVCRT:_initsect_.obj
+ 0002:000045f8 ___rtc_izz 100165f8 MSVCRT:_initsect_.obj
+ 0002:000045fc ___rtc_taa 100165fc MSVCRT:_initsect_.obj
+ 0002:00004600 ___rtc_tzz 10016600 MSVCRT:_initsect_.obj
+ 0002:000052d4 __IMPORT_DESCRIPTOR_KERNEL32 100172d4 kernel32:KERNEL32.dll
+ 0002:000052e8 __IMPORT_DESCRIPTOR_VCRUNTIME140 100172e8 vcruntime:VCRUNTIME140.dll
+ 0002:000052fc __IMPORT_DESCRIPTOR_api-ms-win-crt-stdio-l1-1-0 100172fc ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0002:00005310 __IMPORT_DESCRIPTOR_api-ms-win-crt-convert-l1-1-0 10017310 ucrt:api-ms-win-crt-convert-l1-1-0.dll
+ 0002:00005324 __IMPORT_DESCRIPTOR_api-ms-win-crt-heap-l1-1-0 10017324 ucrt:api-ms-win-crt-heap-l1-1-0.dll
+ 0002:00005338 __IMPORT_DESCRIPTOR_api-ms-win-crt-runtime-l1-1-0 10017338 ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0002:0000534c __IMPORT_DESCRIPTOR_api-ms-win-crt-utility-l1-1-0 1001734c ucrt:api-ms-win-crt-utility-l1-1-0.dll
+ 0002:00005360 __IMPORT_DESCRIPTOR_api-ms-win-crt-time-l1-1-0 10017360 ucrt:api-ms-win-crt-time-l1-1-0.dll
+ 0002:00005374 __NULL_IMPORT_DESCRIPTOR 10017374 kernel32:KERNEL32.dll
+ 0003:00000000 ___scrt_native_dllmain_reason 10018000 MSVCRT:utility.obj
+ 0003:00000010 ___isa_enabled 10018010 MSVCRT:_cpu_disp_.obj
+ 0003:00000014 ___security_cookie_complement 10018014 MSVCRT:gs_cookie.obj
+ 0003:00000018 ___security_cookie 10018018 MSVCRT:gs_cookie.obj
+ 0003:0000001c ___scrt_ucrt_dll_is_in_use 1001801c MSVCRT:ucrt_stubs.obj
+ 0003:00000064 ___scrt_current_native_startup_state 10018064 MSVCRT:utility.obj
+ 0003:00000068 ___scrt_native_startup_lock 10018068 MSVCRT:utility.obj
+ 0003:00000088 ?__type_info_root_node@@3U__type_info_node@@A 10018088 MSVCRT:tncleanup.obj
+ 0003:00000090 ?_OptionsStorage@?1??__local_stdio_printf_options@@9@4_KA 10018090 MSVCRT:default_local_stdio_options.obj
+ 0003:00000098 ?_OptionsStorage@?1??__local_stdio_scanf_options@@9@4_KA 10018098 MSVCRT:default_local_stdio_options.obj
+ 0003:000000a0 ___scrt_debugger_hook_flag 100180a0 MSVCRT:utility_desktop.obj
+ 0003:000000a4 ___isa_available 100180a4 MSVCRT:_cpu_disp_.obj
+ 0003:000000a8 ___favor 100180a8 MSVCRT:_cpu_disp_.obj
+ 0003:000003d0 ___dyn_tls_init_callback 100183d0 <common>
+ 0003:000003d8 ?_OptionsStorage@?1??__local_stdio_printf_options@@9@9 100183d8 <common>
+ 0003:000003e0 ?_OptionsStorage@?1??__local_stdio_scanf_options@@9@9 100183e0 <common>
+
+ entry point at 0001:0000f3ea
+
+ Static symbols
+
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 kernel32:KERNEL32.dll
+ 0000:fffe4000 .debug$S 10000000 kernel32:KERNEL32.dll
+ 0000:fffe4000 .debug$S 10000000 kernel32:KERNEL32.dll
+ 0000:fffe4000 .debug$S 10000000 kernel32:KERNEL32.dll
+ 0000:fffe4000 .debug$S 10000000 kernel32:KERNEL32.dll
+ 0000:fffe4000 .debug$S 10000000 kernel32:KERNEL32.dll
+ 0000:fffe4000 .debug$S 10000000 kernel32:KERNEL32.dll
+ 0000:fffe4000 .debug$S 10000000 kernel32:KERNEL32.dll
+ 0000:fffe4000 .debug$S 10000000 kernel32:KERNEL32.dll
+ 0000:fffe4000 .debug$S 10000000 kernel32:KERNEL32.dll
+ 0000:fffe4000 .debug$S 10000000 kernel32:KERNEL32.dll
+ 0000:fffe4000 .debug$S 10000000 kernel32:KERNEL32.dll
+ 0000:fffe4000 .debug$S 10000000 kernel32:KERNEL32.dll
+ 0000:fffe4000 .debug$S 10000000 kernel32:KERNEL32.dll
+ 0000:fffe4000 .debug$S 10000000 kernel32:KERNEL32.dll
+ 0000:fffe4000 .debug$S 10000000 kernel32:KERNEL32.dll
+ 0000:fffe4000 .debug$S 10000000 kernel32:KERNEL32.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-convert-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-heap-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 kernel32:KERNEL32.dll
+ 0000:fffe4000 .debug$S 10000000 kernel32:KERNEL32.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-heap-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 kernel32:KERNEL32.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 vcruntime:VCRUNTIME140.dll
+ 0000:fffe4000 .debug$S 10000000 vcruntime:VCRUNTIME140.dll
+ 0000:fffe4000 .debug$S 10000000 vcruntime:VCRUNTIME140.dll
+ 0000:fffe4000 .debug$S 10000000 vcruntime:VCRUNTIME140.dll
+ 0000:fffe4000 .debug$S 10000000 vcruntime:VCRUNTIME140.dll
+ 0000:fffe4000 .debug$S 10000000 vcruntime:VCRUNTIME140.dll
+ 0000:fffe4000 .debug$S 10000000 vcruntime:VCRUNTIME140.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-utility-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-utility-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-time-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0000:fffe4000 .debug$S 10000000 zlibwapi.exp
+ 0000:fffe4000 .debug$S 10000000 kernel32:KERNEL32.dll
+ 0001:00000280 _adler32_combine_ 10001280 f adler32.obj
+ 0001:00000490 _crc32_little 10001490 f crc32.obj
+ 0001:00000720 _crc32_big 10001720 f crc32.obj
+ 0001:00000a00 _gf2_matrix_times 10001a00 f crc32.obj
+ 0001:00000a20 _gf2_matrix_square 10001a20 f crc32.obj
+ 0001:00000a60 _crc32_combine_ 10001a60 f crc32.obj
+ 0001:00001380 _putShortMSB 10002380 f deflate.obj
+ 0001:000013b0 _flush_pending 100023b0 f deflate.obj
+ 0001:00001ef0 _read_buf 10002ef0 f deflate.obj
+ 0001:00001f70 _lm_init 10002f70 f deflate.obj
+ 0001:00002020 _longest_match 10003020 f deflate.obj
+ 0001:000021a0 _fill_window 100031a0 f deflate.obj
+ 0001:00002380 _deflate_stored 10003380 f deflate.obj
+ 0001:00002500 _deflate_fast 10003500 f deflate.obj
+ 0001:00002810 _deflate_slow 10003810 f deflate.obj
+ 0001:00002c10 _deflate_rle 10003c10 f deflate.obj
+ 0001:00002eb0 _deflate_huff 10003eb0 f deflate.obj
+ 0001:000030f0 _gz_reset 100040f0 f gzlib.obj
+ 0001:00003150 _gz_open 10004150 f gzlib.obj
+ 0001:000033cc $LN57 100043cc gzlib.obj
+ 0001:000033f8 $LN49 100043f8 gzlib.obj
+ 0001:00003a20 _gz_load 10004a20 f gzread.obj
+ 0001:00003aa0 _gz_avail 10004aa0 f gzread.obj
+ 0001:00003b20 _gz_look 10004b20 f gzread.obj
+ 0001:00003ca0 _gz_decomp 10004ca0 f gzread.obj
+ 0001:00003da0 _gz_fetch 10004da0 f gzread.obj
+ 0001:00003e20 _gz_skip 10004e20 f gzread.obj
+ 0001:00004340 _gz_init 10005340 f gzwrite.obj
+ 0001:00004430 _gz_comp 10005430 f gzwrite.obj
+ 0001:00004570 _gz_zero 10005570 f gzwrite.obj
+ 0001:00004bf0 _fixedtables 10005bf0 f infback.obj
+ 0001:000059c4 $LN507 100069c4 infback.obj
+ 0001:000059e0 $LN473 100069e0 infback.obj
+ 0001:000059f4 $LN508 100069f4 infback.obj
+ 0001:00006150 _fixedtables 10007150 f inflate.obj
+ 0001:00006170 _updatewindow 10007170 f inflate.obj
+ 0001:000078ac $LN935 100088ac inflate.obj
+ 0001:00007928 $LN936 10008928 inflate.obj
+ 0001:00007ae0 _syncsearch 10008ae0 f inflate.obj
+ 0001:000083a0 _fopen_file_func 100093a0 f ioapi.obj
+ 0001:000083f0 _fopen64_file_func 100093f0 f ioapi.obj
+ 0001:00008440 _fread_file_func 10009440 f ioapi.obj
+ 0001:00008460 _fwrite_file_func 10009460 f ioapi.obj
+ 0001:00008480 _ftell_file_func 10009480 f ioapi.obj
+ 0001:000084a0 _ftell64_file_func 100094a0 f ioapi.obj
+ 0001:000084c0 _fseek_file_func 100094c0 f ioapi.obj
+ 0001:00008510 _fseek64_file_func 10009510 f ioapi.obj
+ 0001:00008560 _fclose_file_func 10009560 f ioapi.obj
+ 0001:00008580 _ferror_file_func 10009580 f ioapi.obj
+ 0001:000085e0 _win32_translate_open_mode 100095e0 f iowin32.obj
+ 0001:00008650 _win32_build_iowin 10009650 f iowin32.obj
+ 0001:000088d0 _MySetFilePointerEx 100098d0 f iowin32.obj
+ 0001:00008bf0 _tr_static_init 10009bf0 f trees.obj
+ 0001:00008c60 _init_block 10009c60 f trees.obj
+ 0001:00008cf0 _pqdownheap 10009cf0 f trees.obj
+ 0001:00008dd0 _gen_bitlen 10009dd0 f trees.obj
+ 0001:00008fe0 _gen_codes 10009fe0 f trees.obj
+ 0001:00009050 _build_tree 1000a050 f trees.obj
+ 0001:00009260 _scan_tree 1000a260 f trees.obj
+ 0001:00009350 _send_tree 1000a350 f trees.obj
+ 0001:00009870 _build_bl_tree 1000a870 f trees.obj
+ 0001:00009950 _send_all_trees 1000a950 f trees.obj
+ 0001:00009f40 _compress_block 1000af40 f trees.obj
+ 0001:0000a340 _detect_data_type 1000b340 f trees.obj
+ 0001:0000a3b0 _bi_reverse 1000b3b0 f trees.obj
+ 0001:0000a3d0 _bi_flush 1000b3d0 f trees.obj
+ 0001:0000a450 _bi_windup 1000b450 f trees.obj
+ 0001:0000a4b0 _copy_block 1000b4b0 f trees.obj
+ 0001:0000a5e0 _unz64local_getByte 1000b5e0 f unzip.obj
+ 0001:0000a630 _unz64local_getShort 1000b630 f unzip.obj
+ 0001:0000a6a0 _unz64local_getLong 1000b6a0 f unzip.obj
+ 0001:0000a750 _unz64local_getLong64 1000b750 f unzip.obj
+ 0001:0000a8c0 _strcmpcasenosensitive_internal 1000b8c0 f unzip.obj
+ 0001:0000a960 _unz64local_SearchCentralDir 1000b960 f unzip.obj
+ 0001:0000ab10 _unz64local_SearchCentralDir64 1000bb10 f unzip.obj
+ 0001:0000ada0 _unzOpenInternal 1000bda0 f unzip.obj
+ 0001:0000b350 _unz64local_DosDateToTmuDate 1000c350 f unzip.obj
+ 0001:0000b3d0 _unz64local_GetCurrentFileInfoInternal 1000c3d0 f unzip.obj
+ 0001:0000be90 _unz64local_CheckCurrentFileCoherencyHeader 1000ce90 f unzip.obj
+ 0001:0000c950 _time 1000d950 f zip.obj
+ 0001:0000c960 _decrypt_byte 1000d960 f zip.obj
+ 0001:0000c980 _update_keys 1000d980 f zip.obj
+ 0001:0000c9d0 _init_keys 1000d9d0 f zip.obj
+ 0001:0000ca20 _crypthead 1000da20 f zip.obj
+ 0001:0000cb50 _allocate_new_datablock 1000db50 f zip.obj
+ 0001:0000cb80 _free_datablock 1000db80 f zip.obj
+ 0001:0000cbb0 _init_linkedlist 1000dbb0 f zip.obj
+ 0001:0000cbc0 _free_linkedlist 1000dbc0 f zip.obj
+ 0001:0000cbe0 _add_data_in_datablock 1000dbe0 f zip.obj
+ 0001:0000cc90 _zip64local_putValue 1000dc90 f zip.obj
+ 0001:0000cd10 _zip64local_putValue_inmemory 1000dd10 f zip.obj
+ 0001:0000cd50 _zip64local_TmzDateToDosDate 1000dd50 f zip.obj
+ 0001:0000cda0 _zip64local_getByte 1000dda0 f zip.obj
+ 0001:0000cdf0 _zip64local_getShort 1000ddf0 f zip.obj
+ 0001:0000ce60 _zip64local_getLong 1000de60 f zip.obj
+ 0001:0000cf10 _zip64local_getLong64 1000df10 f zip.obj
+ 0001:0000d080 _zip64local_SearchCentralDir 1000e080 f zip.obj
+ 0001:0000d230 _zip64local_SearchCentralDir64 1000e230 f zip.obj
+ 0001:0000e460 _zip64FlushWriteBuffer 1000f460 f zip.obj
+ 0001:0000f0cc ?dllmain_crt_dispatch@@YGHQAUHINSTANCE__@@KQAX@Z 100100cc f MSVCRT:dll_dllmain.obj
+ 0001:0000f11f ?dllmain_crt_process_attach@@YAHQAUHINSTANCE__@@QAX@Z 1001011f f MSVCRT:dll_dllmain.obj
+ 0001:0000f231 ?dllmain_crt_process_detach@@YAH_N@Z 10010231 f MSVCRT:dll_dllmain.obj
+ 0001:0000f2ae ?dllmain_dispatch@@YAHQAUHINSTANCE__@@KQAX@Z 100102ae f MSVCRT:dll_dllmain.obj
+ 0001:0000f3b7 ?dllmain_raw@@YGHQAUHINSTANCE__@@KQAX@Z 100103b7 f MSVCRT:dll_dllmain.obj
+ 0001:0000f44b ?find_pe_section@@YAPAU_IMAGE_SECTION_HEADER@@QAEI@Z 1001044b f MSVCRT:utility.obj
+ 0001:0000f48f ?is_potentially_valid_image_base@@YA_NQAX@Z 1001048f f MSVCRT:utility.obj
+ 0001:0000fb20 $$000000 10010b20 MSVCRT:_sehprolg4_.obj
+ 0001:000101e0 $$000000 100111e0 MSVCRT:lldiv.obj
+ 0001:00010290 $$000000 10011290 MSVCRT:chkstk.obj
+ 0002:00000144 _GS_ExceptionPointers 10012144 MSVCRT:gs_report.obj
+ 0002:00000158 _crc_table 10012158 crc32.obj
+ 0002:00002158 ?my_version@?1??deflateInit2_@@9@9 10014158 deflate.obj
+ 0002:00002160 _configuration_table 10014160 deflate.obj
+ 0002:000021d8 ?lenfix@?1??fixedtables@@9@9 100141d8 infback.obj
+ 0002:000029d8 ?distfix@?1??fixedtables@@9@9 100149d8 infback.obj
+ 0002:00002a58 ?order@?1??inflateBack@@9@9 10014a58 infback.obj
+ 0002:00002a80 ?lenfix@?1??fixedtables@@9@9 10014a80 inflate.obj
+ 0002:00003280 ?distfix@?1??fixedtables@@9@9 10015280 inflate.obj
+ 0002:00003300 ?order@?1??inflate@@9@9 10015300 inflate.obj
+ 0002:00003328 ?dext@?1??inflate_table@@9@9 10015328 inftrees.obj
+ 0002:00003368 ?lext@?1??inflate_table@@9@9 10015368 inftrees.obj
+ 0002:000033a8 ?lbase@?1??inflate_table@@9@9 100153a8 inftrees.obj
+ 0002:000033e8 ?dbase@?1??inflate_table@@9@9 100153e8 inftrees.obj
+ 0002:00003728 _static_dtree 10015728 trees.obj
+ 0002:000037a0 _extra_blbits 100157a0 trees.obj
+ 0002:000037f0 _extra_lbits 100157f0 trees.obj
+ 0002:00003868 _base_dist 10015868 trees.obj
+ 0002:000038e0 _base_length 100158e0 trees.obj
+ 0002:00003958 _extra_dbits 10015958 trees.obj
+ 0002:000039d0 _static_ltree 100159d0 trees.obj
+ 0002:00003e50 _bl_order 10015e50 trees.obj
+ 0002:00004608 __sehtable$?dllmain_crt_process_attach@@YAHQAUHINSTANCE__@@QAX@Z 10016608 MSVCRT:dll_dllmain.obj
+ 0002:00004628 __sehtable$?dllmain_crt_process_detach@@YAH_N@Z 10016628 MSVCRT:dll_dllmain.obj
+ 0002:00004648 __sehtable$?dllmain_dispatch@@YAHQAUHINSTANCE__@@KQAX@Z 10016648 MSVCRT:dll_dllmain.obj
+ 0002:00004668 __sehtable$___scrt_is_nonwritable_in_current_image 10016668 MSVCRT:utility.obj
+ 0002:00004690 .edata 10016690 zlibwapi.exp
+ 0002:000046b8 rgpv 100166b8 zlibwapi.exp
+ 0002:00004954 rgszName 10016954 zlibwapi.exp
+ 0002:00004b38 rgwOrd 10016b38 zlibwapi.exp
+ 0002:00004c2a szName 10016c2a zlibwapi.exp
+ 0002:00004c37 $N00001 10016c37 zlibwapi.exp
+ 0002:00004c3f $N00140 10016c3f zlibwapi.exp
+ 0002:00004c4f $N00039 10016c4f zlibwapi.exp
+ 0002:00004c59 $N00002 10016c59 zlibwapi.exp
+ 0002:00004c62 $N00046 10016c62 zlibwapi.exp
+ 0002:00004c70 $N00003 10016c70 zlibwapi.exp
+ 0002:00004c76 $N00142 10016c76 zlibwapi.exp
+ 0002:00004c84 $N00004 10016c84 zlibwapi.exp
+ 0002:00004c8c $N00047 10016c8c zlibwapi.exp
+ 0002:00004c99 $N00005 10016c99 zlibwapi.exp
+ 0002:00004ca5 $N00006 10016ca5 zlibwapi.exp
+ 0002:00004cb0 $N00007 10016cb0 zlibwapi.exp
+ 0002:00004cbe $N00008 10016cbe zlibwapi.exp
+ 0002:00004ccb $N00009 10016ccb zlibwapi.exp
+ 0002:00004cd9 $N00052 10016cd9 zlibwapi.exp
+ 0002:00004ce8 $N00051 10016ce8 zlibwapi.exp
+ 0002:00004cf5 $N00010 10016cf5 zlibwapi.exp
+ 0002:00004d02 $N00164 10016d02 zlibwapi.exp
+ 0002:00004d13 $N00011 10016d13 zlibwapi.exp
+ 0002:00004d28 $N00144 10016d28 zlibwapi.exp
+ 0002:00004d39 $N00145 10016d39 zlibwapi.exp
+ 0002:00004d45 $N00110 10016d45 zlibwapi.exp
+ 0002:00004d59 $N00111 10016d59 zlibwapi.exp
+ 0002:00004d6f $N00112 10016d6f zlibwapi.exp
+ 0002:00004d86 $N00113 10016d86 zlibwapi.exp
+ 0002:00004d9d $N00038 10016d9d zlibwapi.exp
+ 0002:00004dab $N00146 10016dab zlibwapi.exp
+ 0002:00004db4 $N00048 10016db4 zlibwapi.exp
+ 0002:00004dbf $N00012 10016dbf zlibwapi.exp
+ 0002:00004dc7 $N00147 10016dc7 zlibwapi.exp
+ 0002:00004dd1 $N00148 10016dd1 zlibwapi.exp
+ 0002:00004ddb $N00149 10016ddb zlibwapi.exp
+ 0002:00004de4 $N00013 10016de4 zlibwapi.exp
+ 0002:00004dec $N00034 10016dec zlibwapi.exp
+ 0002:00004df2 $N00014 10016df2 zlibwapi.exp
+ 0002:00004dfa $N00015 10016dfa zlibwapi.exp
+ 0002:00004e02 $N00030 10016e02 zlibwapi.exp
+ 0002:00004e09 $N00161 10016e09 zlibwapi.exp
+ 0002:00004e11 $N00041 10016e11 zlibwapi.exp
+ 0002:00004e18 $N00150 10016e18 zlibwapi.exp
+ 0002:00004e21 $N00016 10016e21 zlibwapi.exp
+ 0002:00004e28 $N00165 10016e28 zlibwapi.exp
+ 0002:00004e31 $N00028 10016e31 zlibwapi.exp
+ 0002:00004e3a $N00029 10016e3a zlibwapi.exp
+ 0002:00004e41 $N00040 10016e41 zlibwapi.exp
+ 0002:00004e48 $N00017 10016e48 zlibwapi.exp
+ 0002:00004e4f $N00032 10016e4f zlibwapi.exp
+ 0002:00004e58 $N00031 10016e58 zlibwapi.exp
+ 0002:00004e5f $N00035 10016e5f zlibwapi.exp
+ 0002:00004e6b $N00033 10016e6b zlibwapi.exp
+ 0002:00004e72 $N00049 10016e72 zlibwapi.exp
+ 0002:00004e7b $N00167 10016e7b zlibwapi.exp
+ 0002:00004e85 $N00018 10016e85 zlibwapi.exp
+ 0002:00004e8d $N00019 10016e8d zlibwapi.exp
+ 0002:00004e95 $N00044 10016e95 zlibwapi.exp
+ 0002:00004ea1 $N00045 10016ea1 zlibwapi.exp
+ 0002:00004eb0 $N00043 10016eb0 zlibwapi.exp
+ 0002:00004ec1 $N00042 10016ec1 zlibwapi.exp
+ 0002:00004ecd $N00020 10016ecd zlibwapi.exp
+ 0002:00004ed8 $N00166 10016ed8 zlibwapi.exp
+ 0002:00004eed $N00156 10016eed zlibwapi.exp
+ 0002:00004efe $N00021 10016efe zlibwapi.exp
+ 0002:00004f0c $N00022 10016f0c zlibwapi.exp
+ 0002:00004f19 $N00157 10016f19 zlibwapi.exp
+ 0002:00004f25 $N00158 10016f25 zlibwapi.exp
+ 0002:00004f32 $N00159 10016f32 zlibwapi.exp
+ 0002:00004f40 $N00023 10016f40 zlibwapi.exp
+ 0002:00004f4d $N00163 10016f4d zlibwapi.exp
+ 0002:00004f5e $N00024 10016f5e zlibwapi.exp
+ 0002:00004f73 $N00025 10016f73 zlibwapi.exp
+ 0002:00004f7f $N00037 10016f7f zlibwapi.exp
+ 0002:00004f90 $N00160 10016f90 zlibwapi.exp
+ 0002:00004fa1 $N00026 10016fa1 zlibwapi.exp
+ 0002:00004fac $N00062 10016fac zlibwapi.exp
+ 0002:00004fb5 $N00072 10016fb5 zlibwapi.exp
+ 0002:00004fc9 $N00124 10016fc9 zlibwapi.exp
+ 0002:00004fe1 $N00064 10016fe1 zlibwapi.exp
+ 0002:00004ff7 $N00125 10016ff7 zlibwapi.exp
+ 0002:00005015 $N00127 10017015 zlibwapi.exp
+ 0002:00005025 $N00100 10017025 zlibwapi.exp
+ 0002:00005033 $N00073 10017033 zlibwapi.exp
+ 0002:00005047 $N00122 10017047 zlibwapi.exp
+ 0002:0000505a $N00063 1001705a zlibwapi.exp
+ 0002:0000506b $N00076 1001706b zlibwapi.exp
+ 0002:00005081 $N00128 10017081 zlibwapi.exp
+ 0002:00005092 $N00101 10017092 zlibwapi.exp
+ 0002:000050a1 $N00065 100170a1 zlibwapi.exp
+ 0002:000050b2 $N00066 100170b2 zlibwapi.exp
+ 0002:000050c2 $N00075 100170c2 zlibwapi.exp
+ 0002:000050d0 $N00077 100170d0 zlibwapi.exp
+ 0002:000050d9 $N00121 100170d9 zlibwapi.exp
+ 0002:000050e5 $N00120 100170e5 zlibwapi.exp
+ 0002:000050ef $N00061 100170ef zlibwapi.exp
+ 0002:000050f7 $N00078 100170f7 zlibwapi.exp
+ 0002:0000510b $N00069 1001710b zlibwapi.exp
+ 0002:0000511f $N00067 1001711f zlibwapi.exp
+ 0002:00005132 $N00079 10017132 zlibwapi.exp
+ 0002:0000514d $N00068 1001714d zlibwapi.exp
+ 0002:00005160 $N00074 10017160 zlibwapi.exp
+ 0002:00005179 $N00071 10017179 zlibwapi.exp
+ 0002:00005180 $N00126 10017180 zlibwapi.exp
+ 0002:0000518a $N00070 1001718a zlibwapi.exp
+ 0002:00005192 $N00036 10017192 zlibwapi.exp
+ 0002:00005199 $N00084 10017199 zlibwapi.exp
+ 0002:000051a2 $N00083 100171a2 zlibwapi.exp
+ 0002:000051b4 $N00136 100171b4 zlibwapi.exp
+ 0002:000051cb $N00087 100171cb zlibwapi.exp
+ 0002:000051e0 $N00088 100171e0 zlibwapi.exp
+ 0002:000051e9 $N00131 100171e9 zlibwapi.exp
+ 0002:000051f5 $N00130 100171f5 zlibwapi.exp
+ 0002:000051ff $N00080 100171ff zlibwapi.exp
+ 0002:00005207 $N00086 10017207 zlibwapi.exp
+ 0002:0000521c $N00133 1001721c zlibwapi.exp
+ 0002:00005234 $N00089 10017234 zlibwapi.exp
+ 0002:00005249 $N00134 10017249 zlibwapi.exp
+ 0002:00005261 $N00135 10017261 zlibwapi.exp
+ 0002:00005279 $N00132 10017279 zlibwapi.exp
+ 0002:0000528f $N00081 1001728f zlibwapi.exp
+ 0002:000052a3 $N00082 100172a3 zlibwapi.exp
+ 0002:000052b7 $N00050 100172b7 zlibwapi.exp
+ 0002:000052c8 $N00027 100172c8 zlibwapi.exp
+ 0002:00005512 .idata$6 10017512 kernel32:KERNEL32.dll
+ 0002:000055b2 .idata$6 100175b2 vcruntime:VCRUNTIME140.dll
+ 0002:00005794 .idata$6 10017794 ucrt:api-ms-win-crt-stdio-l1-1-0.dll
+ 0002:000057b4 .idata$6 100177b4 ucrt:api-ms-win-crt-convert-l1-1-0.dll
+ 0002:000057d6 .idata$6 100177d6 ucrt:api-ms-win-crt-heap-l1-1-0.dll
+ 0002:000057f6 .idata$6 100177f6 ucrt:api-ms-win-crt-runtime-l1-1-0.dll
+ 0002:00005818 .idata$6 10017818 ucrt:api-ms-win-crt-utility-l1-1-0.dll
+ 0002:0000583a .idata$6 1001783a ucrt:api-ms-win-crt-time-l1-1-0.dll
+ 0003:00000020 _static_l_desc 10018020 trees.obj
+ 0003:00000034 _static_bl_desc 10018034 trees.obj
+ 0003:00000048 _static_d_desc 10018048 trees.obj
+ 0003:00000060 ?__proc_attached@@3HA 10018060 MSVCRT:dll_dllmain.obj
+ 0003:0000006c ?module_local_atexit_table@@3U_onexit_table_t@@A 1001806c MSVCRT:utility.obj
+ 0003:00000078 ?module_local_at_quick_exit_table@@3U_onexit_table_t@@A 10018078 MSVCRT:utility.obj
+ 0003:00000084 ?is_initialized_as_dll@@3_NA 10018084 MSVCRT:utility.obj
+ 0003:000000b0 _GS_ExceptionRecord 100180b0 MSVCRT:gs_report.obj
+ 0003:00000100 _GS_ContextRecord 10018100 MSVCRT:gs_report.obj
+ 0003:000003cc ?calls@?1??crypthead@@9@9 100183cc zip.obj
+ 0004:00000000 __guard_fids_?dllmain_crt_process_attach@@YAHQAUHINSTANCE__@@QAX@Z 10019000 MSVCRT:dll_dllmain.obj
+ 0004:00000008 __guard_fids_?dllmain_dispatch@@YAHQAUHINSTANCE__@@KQAX@Z 10019008 MSVCRT:dll_dllmain.obj
+ 0004:0000000c __guard_fids____scrt_set_unhandled_exception_filter 1001900c MSVCRT:utility_desktop.obj
+ 0004:00000010 __guard_fids___except_handler4 10019010 MSVCRT:_chandler4gs_.obj
+ 0004:00000014 __guard_fids__ 10019014 MSVCRT:guard_support.obj
+ 0004:00000018 __guard_fids___guard_icall_checks_enforced 10019018 MSVCRT:guard_support.obj
+ 0005:00000060 $R000000 1001a060 zlib.res
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.pdb b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.pdb
new file mode 100644
index 0000000000..1b761c6def
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibDllReleaseWithoutAsm/zlibwapi.pdb
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/adler32.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/adler32.obj
new file mode 100644
index 0000000000..28048bddb8
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/adler32.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/compress.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/compress.obj
new file mode 100644
index 0000000000..09ee24ce1b
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/compress.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/crc32.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/crc32.obj
new file mode 100644
index 0000000000..e29cab3751
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/crc32.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/deflate.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/deflate.obj
new file mode 100644
index 0000000000..753e7a3b17
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/deflate.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/gzclose.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/gzclose.obj
new file mode 100644
index 0000000000..16f1e5671e
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/gzclose.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/gzlib.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/gzlib.obj
new file mode 100644
index 0000000000..fe61c42d3a
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/gzlib.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/gzread.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/gzread.obj
new file mode 100644
index 0000000000..3de52c1f07
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/gzread.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/gzwrite.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/gzwrite.obj
new file mode 100644
index 0000000000..e101adcd41
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/gzwrite.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/infback.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/infback.obj
new file mode 100644
index 0000000000..aeac887736
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/infback.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/inffast.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/inffast.obj
new file mode 100644
index 0000000000..a40ec6ef5f
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/inffast.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/inflate.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/inflate.obj
new file mode 100644
index 0000000000..75fa823409
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/inflate.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/inftrees.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/inftrees.obj
new file mode 100644
index 0000000000..6bb4e5657f
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/inftrees.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/ioapi.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/ioapi.obj
new file mode 100644
index 0000000000..b2f7d0f915
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/ioapi.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/trees.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/trees.obj
new file mode 100644
index 0000000000..ac4a582bcf
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/trees.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/uncompr.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/uncompr.obj
new file mode 100644
index 0000000000..f8785d912d
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/uncompr.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/unzip.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/unzip.obj
new file mode 100644
index 0000000000..321b3c6ff9
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/unzip.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zip.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zip.obj
new file mode 100644
index 0000000000..fa24aa117e
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zip.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlib.res b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlib.res
new file mode 100644
index 0000000000..9316316bcc
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlib.res
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.Build.CppClean.log b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.Build.CppClean.log
new file mode 100644
index 0000000000..b05585d142
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.Build.CppClean.log
@@ -0,0 +1,30 @@
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\zlibstat.pdb
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\tmp\zutil.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\tmp\zip.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\tmp\unzip.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\tmp\uncompr.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\tmp\trees.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\tmp\ioapi.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\tmp\inftrees.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\tmp\inflate.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\tmp\inffast.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\tmp\infback.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\tmp\gzwrite.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\tmp\gzread.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\tmp\gzlib.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\tmp\gzclose.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\tmp\deflate.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\tmp\crc32.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\tmp\compress.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\tmp\adler32.obj
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\zlibstat.lib
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\tmp\zlib.res
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\tmp\zlibstat.tlog\cl.command.1.tlog
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\tmp\zlibstat.tlog\cl.read.1.tlog
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\tmp\zlibstat.tlog\cl.write.1.tlog
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\tmp\zlibstat.tlog\lib-link-cvtres.read.1.tlog
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\tmp\zlibstat.tlog\lib-link-cvtres.write.1.tlog
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\tmp\zlibstat.tlog\lib.command.1.tlog
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\tmp\zlibstat.tlog\rc.command.1.tlog
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\tmp\zlibstat.tlog\rc.read.1.tlog
+d:\downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\zlibstatreleasewithoutasm\tmp\zlibstat.tlog\rc.write.1.tlog
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.log b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.log
new file mode 100644
index 0000000000..86a2e30a4b
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.log
@@ -0,0 +1,20 @@
+ adler32.c
+ compress.c
+ crc32.c
+ deflate.c
+ gzclose.c
+ gzlib.c
+ gzread.c
+ gzwrite.c
+ infback.c
+ inffast.c
+ inflate.c
+ inftrees.c
+ ioapi.c
+ trees.c
+ uncompr.c
+ unzip.c
+ zip.c
+ zutil.c
+ Generating Code...
+ zlibstat.vcxproj -> d:\Downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\x86\ZlibStatReleaseWithoutAsm\zlibstat.lib
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/CL.command.1.tlog b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/CL.command.1.tlog
new file mode 100644
index 0000000000..b0ebd1c83e
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/CL.command.1.tlog
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/CL.read.1.tlog b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/CL.read.1.tlog
new file mode 100644
index 0000000000..f687971e81
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/CL.read.1.tlog
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/CL.write.1.tlog b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/CL.write.1.tlog
new file mode 100644
index 0000000000..1aebb19db8
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/CL.write.1.tlog
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/Lib-link-cvtres.read.1.tlog b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/Lib-link-cvtres.read.1.tlog
new file mode 100644
index 0000000000..534e06f08f
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/Lib-link-cvtres.read.1.tlog
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/Lib-link-cvtres.write.1.tlog b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/Lib-link-cvtres.write.1.tlog
new file mode 100644
index 0000000000..8f40ed4d2a
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/Lib-link-cvtres.write.1.tlog
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/lib.command.1.tlog b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/lib.command.1.tlog
new file mode 100644
index 0000000000..4e43961448
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/lib.command.1.tlog
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/rc.command.1.tlog b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/rc.command.1.tlog
new file mode 100644
index 0000000000..21e6f0f15e
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/rc.command.1.tlog
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/rc.read.1.tlog b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/rc.read.1.tlog
new file mode 100644
index 0000000000..1d1629b28b
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/rc.read.1.tlog
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/rc.write.1.tlog b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/rc.write.1.tlog
new file mode 100644
index 0000000000..5e477b9e82
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/rc.write.1.tlog
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/zlibstat.lastbuildstate b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/zlibstat.lastbuildstate
new file mode 100644
index 0000000000..2b818f9515
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zlibstat.tlog/zlibstat.lastbuildstate
@@ -0,0 +1,2 @@
+#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1
+ReleaseWithoutAsm|Win32|D:\Downloads\tgl-master\tgl-master\zlib\contrib\vstudio\vc11\|
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zutil.obj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zutil.obj
new file mode 100644
index 0000000000..482129e1fa
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/Tmp/zutil.obj
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/zlibstat.lib b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/zlibstat.lib
new file mode 100644
index 0000000000..0cc7de9a07
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/zlibstat.lib
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/zlibstat.pdb b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/zlibstat.pdb
new file mode 100644
index 0000000000..ed0c0fb3c9
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/x86/ZlibStatReleaseWithoutAsm/zlibstat.pdb
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/zlib.rc b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/zlib.rc
new file mode 100644
index 0000000000..73f6476d60
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/zlib.rc
@@ -0,0 +1,32 @@
+#include <windows.h>
+
+#define IDR_VERSION1 1
+IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
+ FILEVERSION 1,2,8,0
+ PRODUCTVERSION 1,2,8,0
+ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+ FILEFLAGS 0
+ FILEOS VOS_DOS_WINDOWS32
+ FILETYPE VFT_DLL
+ FILESUBTYPE 0 // not used
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904E4"
+ //language ID = U.S. English, char set = Windows, Multilingual
+
+ BEGIN
+ VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
+ VALUE "FileVersion", "1.2.8\0"
+ VALUE "InternalName", "zlib\0"
+ VALUE "OriginalFilename", "zlibwapi.dll\0"
+ VALUE "ProductName", "ZLib.DLL\0"
+ VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
+ VALUE "LegalCopyright", "(C) 1995-2013 Jean-loup Gailly & Mark Adler\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x0409, 1252
+ END
+END
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/zlibstat.vcxproj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/zlibstat.vcxproj
new file mode 100644
index 0000000000..9864a4c289
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/zlibstat.vcxproj
@@ -0,0 +1,465 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Itanium">
+ <Configuration>Debug</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|Itanium">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|Win32">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|x64">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Itanium">
+ <Configuration>Release</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}</ProjectGuid>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <PlatformToolset>v140</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <PlatformToolset>v140</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <PlatformToolset>v140</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <PlatformToolset>v140</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <PlatformToolset>v140</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30128.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\ZlibStat$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\ZlibStat$(Configuration)\Tmp\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\ZlibStat$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\ZlibStat$(Configuration)\Tmp\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">x86\ZlibStat$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">x86\ZlibStat$(Configuration)\Tmp\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\ZlibStat$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\ZlibStat$(Configuration)\Tmp\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">ia64\ZlibStat$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">ia64\ZlibStat$(Configuration)\Tmp\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\ZlibStat$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\ZlibStat$(Configuration)\Tmp\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ia64\ZlibStat$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ia64\ZlibStat$(Configuration)\Tmp\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">x64\ZlibStat$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">x64\ZlibStat$(Configuration)\Tmp\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">ia64\ZlibStat$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">ia64\ZlibStat$(Configuration)\Tmp\</IntDir>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>OldStyle</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:X86 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <CompileAs>CompileAsC</CompileAs>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:X86 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:X86 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>OldStyle</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:AMD64 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">
+ <Midl>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>OldStyle</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:IA64 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:AMD64 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">
+ <Midl>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:IA64 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:AMD64 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">
+ <Midl>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibstat.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Lib>
+ <AdditionalOptions>/MACHINE:IA64 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
+ <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\adler32.c" />
+ <ClCompile Include="..\..\..\compress.c" />
+ <ClCompile Include="..\..\..\crc32.c" />
+ <ClCompile Include="..\..\..\deflate.c" />
+ <ClCompile Include="..\..\..\gzclose.c" />
+ <ClCompile Include="..\..\..\gzlib.c" />
+ <ClCompile Include="..\..\..\gzread.c" />
+ <ClCompile Include="..\..\..\gzwrite.c" />
+ <ClCompile Include="..\..\..\infback.c" />
+ <ClCompile Include="..\..\masmx64\inffas8664.c">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </ClCompile>
+ <ClCompile Include="..\..\..\inffast.c" />
+ <ClCompile Include="..\..\..\inflate.c" />
+ <ClCompile Include="..\..\..\inftrees.c" />
+ <ClCompile Include="..\..\minizip\ioapi.c" />
+ <ClCompile Include="..\..\..\trees.c" />
+ <ClCompile Include="..\..\..\uncompr.c" />
+ <ClCompile Include="..\..\minizip\unzip.c" />
+ <ClCompile Include="..\..\minizip\zip.c" />
+ <ClCompile Include="..\..\..\zutil.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="zlib.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="zlibvc.def" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/zlibvc.def b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/zlibvc.def
new file mode 100644
index 0000000000..88f37bf6e7
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/zlibvc.def
@@ -0,0 +1,143 @@
+LIBRARY
+; zlib data compression and ZIP file I/O library
+
+;VERSION 1.2.8
+
+EXPORTS
+ adler32 @1
+ compress @2
+ crc32 @3
+ deflate @4
+ deflateCopy @5
+ deflateEnd @6
+ deflateInit2_ @7
+ deflateInit_ @8
+ deflateParams @9
+ deflateReset @10
+ deflateSetDictionary @11
+ gzclose @12
+ gzdopen @13
+ gzerror @14
+ gzflush @15
+ gzopen @16
+ gzread @17
+ gzwrite @18
+ inflate @19
+ inflateEnd @20
+ inflateInit2_ @21
+ inflateInit_ @22
+ inflateReset @23
+ inflateSetDictionary @24
+ inflateSync @25
+ uncompress @26
+ zlibVersion @27
+ gzprintf @28
+ gzputc @29
+ gzgetc @30
+ gzseek @31
+ gzrewind @32
+ gztell @33
+ gzeof @34
+ gzsetparams @35
+ zError @36
+ inflateSyncPoint @37
+ get_crc_table @38
+ compress2 @39
+ gzputs @40
+ gzgets @41
+ inflateCopy @42
+ inflateBackInit_ @43
+ inflateBack @44
+ inflateBackEnd @45
+ compressBound @46
+ deflateBound @47
+ gzclearerr @48
+ gzungetc @49
+ zlibCompileFlags @50
+ deflatePrime @51
+ deflatePending @52
+
+ unzOpen @61
+ unzClose @62
+ unzGetGlobalInfo @63
+ unzGetCurrentFileInfo @64
+ unzGoToFirstFile @65
+ unzGoToNextFile @66
+ unzOpenCurrentFile @67
+ unzReadCurrentFile @68
+ unzOpenCurrentFile3 @69
+ unztell @70
+ unzeof @71
+ unzCloseCurrentFile @72
+ unzGetGlobalComment @73
+ unzStringFileNameCompare @74
+ unzLocateFile @75
+ unzGetLocalExtrafield @76
+ unzOpen2 @77
+ unzOpenCurrentFile2 @78
+ unzOpenCurrentFilePassword @79
+
+ zipOpen @80
+ zipOpenNewFileInZip @81
+ zipWriteInFileInZip @82
+ zipCloseFileInZip @83
+ zipClose @84
+ zipOpenNewFileInZip2 @86
+ zipCloseFileInZipRaw @87
+ zipOpen2 @88
+ zipOpenNewFileInZip3 @89
+
+ unzGetFilePos @100
+ unzGoToFilePos @101
+
+ fill_win32_filefunc @110
+
+; zlibwapi v1.2.4 added:
+ fill_win32_filefunc64 @111
+ fill_win32_filefunc64A @112
+ fill_win32_filefunc64W @113
+
+ unzOpen64 @120
+ unzOpen2_64 @121
+ unzGetGlobalInfo64 @122
+ unzGetCurrentFileInfo64 @124
+ unzGetCurrentFileZStreamPos64 @125
+ unztell64 @126
+ unzGetFilePos64 @127
+ unzGoToFilePos64 @128
+
+ zipOpen64 @130
+ zipOpen2_64 @131
+ zipOpenNewFileInZip64 @132
+ zipOpenNewFileInZip2_64 @133
+ zipOpenNewFileInZip3_64 @134
+ zipOpenNewFileInZip4_64 @135
+ zipCloseFileInZipRaw64 @136
+
+; zlib1 v1.2.4 added:
+ adler32_combine @140
+ crc32_combine @142
+ deflateSetHeader @144
+ deflateTune @145
+ gzbuffer @146
+ gzclose_r @147
+ gzclose_w @148
+ gzdirect @149
+ gzoffset @150
+ inflateGetHeader @156
+ inflateMark @157
+ inflatePrime @158
+ inflateReset2 @159
+ inflateUndermine @160
+
+; zlib1 v1.2.6 added:
+ gzgetc_ @161
+ inflateResetKeep @163
+ deflateResetKeep @164
+
+; zlib1 v1.2.7 added:
+ gzopen_w @165
+
+; zlib1 v1.2.8 added:
+ inflateGetDictionary @166
+ gzvprintf @167
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/zlibvc.sln b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/zlibvc.sln
new file mode 100644
index 0000000000..9fcbafdd02
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/zlibvc.sln
@@ -0,0 +1,117 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibvc", "zlibvc.vcxproj", "{8FD826F8-3739-44E6-8CC8-997122E53B8D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibstat", "zlibstat.vcxproj", "{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testzlib", "testzlib.vcxproj", "{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testzlibdll", "testzlibdll.vcxproj", "{C52F9E7B-498A-42BE-8DB4-85A15694366A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "minizip", "minizip.vcxproj", "{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "miniunz", "miniunz.vcxproj", "{C52F9E7B-498A-42BE-8DB4-85A15694382A}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Itanium = Debug|Itanium
+ Debug|Win32 = Debug|Win32
+ Debug|x64 = Debug|x64
+ Release|Itanium = Release|Itanium
+ Release|Win32 = Release|Win32
+ Release|x64 = Release|x64
+ ReleaseWithoutAsm|Itanium = ReleaseWithoutAsm|Itanium
+ ReleaseWithoutAsm|Win32 = ReleaseWithoutAsm|Win32
+ ReleaseWithoutAsm|x64 = ReleaseWithoutAsm|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Itanium.ActiveCfg = Debug|Win32
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Win32.ActiveCfg = Debug|Win32
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Win32.Build.0 = Debug|Win32
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|x64.ActiveCfg = Debug|x64
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|x64.Build.0 = Debug|x64
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Itanium.ActiveCfg = Release|Win32
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.ActiveCfg = Release|Win32
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.Build.0 = Release|Win32
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.ActiveCfg = Release|x64
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.Build.0 = Release|x64
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Win32
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Itanium.ActiveCfg = Debug|Win32
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.ActiveCfg = Debug|Win32
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.Build.0 = Debug|Win32
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.ActiveCfg = Debug|x64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.Build.0 = Debug|x64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Itanium.ActiveCfg = Release|Win32
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.ActiveCfg = Release|Win32
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.Build.0 = Release|Win32
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.ActiveCfg = Release|x64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.Build.0 = Release|x64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Win32
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.ActiveCfg = Debug|Win32
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.Build.0 = Debug|Win32
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.ActiveCfg = Debug|x64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.Build.0 = Debug|x64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.ActiveCfg = Release|Win32
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.ActiveCfg = Release|Win32
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.Build.0 = Release|Win32
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.ActiveCfg = Release|x64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.Build.0 = Release|x64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Win32
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Itanium.ActiveCfg = Debug|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Win32.ActiveCfg = Debug|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Win32.Build.0 = Debug|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|x64.ActiveCfg = Debug|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|x64.Build.0 = Debug|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Itanium.ActiveCfg = Release|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Win32.ActiveCfg = Release|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Win32.Build.0 = Release|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|x64.ActiveCfg = Release|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|x64.Build.0 = Release|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.ActiveCfg = Debug|Win32
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.Build.0 = Debug|Win32
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.ActiveCfg = Debug|x64
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.Build.0 = Debug|x64
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.ActiveCfg = Release|Win32
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.ActiveCfg = Release|Win32
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.Build.0 = Release|Win32
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.ActiveCfg = Release|x64
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.Build.0 = Release|x64
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Win32
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Itanium.ActiveCfg = Debug|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Win32.ActiveCfg = Debug|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Win32.Build.0 = Debug|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|x64.ActiveCfg = Debug|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|x64.Build.0 = Debug|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Itanium.ActiveCfg = Release|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Win32.ActiveCfg = Release|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Win32.Build.0 = Release|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|x64.ActiveCfg = Release|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|x64.Build.0 = Release|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/zlibvc.vcxproj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/zlibvc.vcxproj
new file mode 100644
index 0000000000..47e61d2a53
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc11/zlibvc.vcxproj
@@ -0,0 +1,689 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Itanium">
+ <Configuration>Debug</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|Itanium">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|Win32">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseWithoutAsm|x64">
+ <Configuration>ReleaseWithoutAsm</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Itanium">
+ <Configuration>Release</Configuration>
+ <Platform>Itanium</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{8FD826F8-3739-44E6-8CC8-997122E53B8D}</ProjectGuid>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v140</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v140</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v140</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v140</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <PlatformToolset>v140</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30128.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\ZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">x86\ZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">x86\ZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">x86\ZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\ZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">x86\ZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\ZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">x64\ZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">ia64\ZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">ia64\ZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">x64\ZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">x64\ZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">ia64\ZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">ia64\ZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\ZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">x64\ZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ia64\ZlibDll$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ia64\ZlibDll$(Configuration)\Tmp\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">false</GenerateManifest>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">zlibwapi</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">zlibwapi</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">zlibwapi</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">zlibwapi</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">zlibwapi</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">zlibwapi</TargetName>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)zlibwapi.pdb</ProgramDatabaseFile>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapFileName>$(OutDir)zlibwapi.map</MapFileName>
+ <SubSystem>Windows</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
+ </Link>
+ <PreBuildEvent>
+ <Command>cd ..\..\masmx86
+bld_ml32.bat</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
+ <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <ProgramDatabaseFile>$(OutDir)zlibwapi.pdb</ProgramDatabaseFile>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapFileName>$(OutDir)zlibwapi.map</MapFileName>
+ <SubSystem>Windows</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <ProgramDatabaseFile>$(OutDir)zlibwapi.pdb</ProgramDatabaseFile>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapFileName>$(OutDir)zlibwapi.map</MapFileName>
+ <SubSystem>Windows</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
+ </Link>
+ <PreBuildEvent>
+ <Command>cd ..\..\masmx86
+bld_ml32.bat</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>X64</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)zlibwapi.pdb</ProgramDatabaseFile>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapFileName>$(OutDir)zlibwapi.map</MapFileName>
+ <SubSystem>Windows</SubSystem>
+ <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ <PreBuildEvent>
+ <Command>cd ..\..\contrib\masmx64
+bld_ml64.bat</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)zlibwapi.pdb</ProgramDatabaseFile>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapFileName>$(OutDir)zlibwapi.map</MapFileName>
+ <SubSystem>Windows</SubSystem>
+ <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
+ <TargetMachine>MachineIA64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>X64</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <ProgramDatabaseFile>$(OutDir)zlibwapi.pdb</ProgramDatabaseFile>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapFileName>$(OutDir)zlibwapi.map</MapFileName>
+ <SubSystem>Windows</SubSystem>
+ <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <ProgramDatabaseFile>$(OutDir)zlibwapi.pdb</ProgramDatabaseFile>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapFileName>$(OutDir)zlibwapi.map</MapFileName>
+ <SubSystem>Windows</SubSystem>
+ <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
+ <TargetMachine>MachineIA64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>X64</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <ProgramDatabaseFile>$(OutDir)zlibwapi.pdb</ProgramDatabaseFile>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapFileName>$(OutDir)zlibwapi.map</MapFileName>
+ <SubSystem>Windows</SubSystem>
+ <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ <PreBuildEvent>
+ <Command>cd ..\..\masmx64
+bld_ml64.bat</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Itanium</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)zlibvc.tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)</ProgramDataBaseFileName>
+ <BrowseInformation>
+ </BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <Link>
+ <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
+ <ProgramDatabaseFile>$(OutDir)zlibwapi.pdb</ProgramDatabaseFile>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapFileName>$(OutDir)zlibwapi.map</MapFileName>
+ <SubSystem>Windows</SubSystem>
+ <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
+ <TargetMachine>MachineIA64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\adler32.c" />
+ <ClCompile Include="..\..\..\compress.c" />
+ <ClCompile Include="..\..\..\crc32.c" />
+ <ClCompile Include="..\..\..\deflate.c" />
+ <ClCompile Include="..\..\..\gzclose.c" />
+ <ClCompile Include="..\..\..\gzlib.c" />
+ <ClCompile Include="..\..\..\gzread.c" />
+ <ClCompile Include="..\..\..\gzwrite.c" />
+ <ClCompile Include="..\..\..\infback.c" />
+ <ClCompile Include="..\..\masmx64\inffas8664.c">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </ClCompile>
+ <ClCompile Include="..\..\..\inffast.c" />
+ <ClCompile Include="..\..\..\inflate.c" />
+ <ClCompile Include="..\..\..\inftrees.c" />
+ <ClCompile Include="..\..\minizip\ioapi.c" />
+ <ClCompile Include="..\..\minizip\iowin32.c" />
+ <ClCompile Include="..\..\..\trees.c" />
+ <ClCompile Include="..\..\..\uncompr.c" />
+ <ClCompile Include="..\..\minizip\unzip.c">
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ZLIB_INTERNAL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">ZLIB_INTERNAL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">ZLIB_INTERNAL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <ClCompile Include="..\..\minizip\zip.c">
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">ZLIB_INTERNAL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">ZLIB_INTERNAL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">ZLIB_INTERNAL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <ClCompile Include="..\..\..\zutil.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="zlib.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="zlibvc.def" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\deflate.h" />
+ <ClInclude Include="..\..\..\infblock.h" />
+ <ClInclude Include="..\..\..\infcodes.h" />
+ <ClInclude Include="..\..\..\inffast.h" />
+ <ClInclude Include="..\..\..\inftrees.h" />
+ <ClInclude Include="..\..\..\infutil.h" />
+ <ClInclude Include="..\..\..\zconf.h" />
+ <ClInclude Include="..\..\..\zlib.h" />
+ <ClInclude Include="..\..\..\zutil.h" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/miniunz.vcproj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/miniunz.vcproj
new file mode 100644
index 0000000000..7da32b91ea
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/miniunz.vcproj
@@ -0,0 +1,565 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="miniunz"
+ ProjectGUID="{C52F9E7B-498A-42BE-8DB4-85A15694382A}"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ <Platform
+ Name="Itanium"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="x86\MiniUnzip$(ConfigurationName)"
+ IntermediateDirectory="x86\MiniUnzip$(ConfigurationName)\Tmp"
+ ConfigurationType="1"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..;..\..\minizip"
+ PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="1"
+ BufferSecurityCheck="false"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="x86\ZlibDllDebug\zlibwapi.lib"
+ OutputFile="$(OutDir)/miniunz.exe"
+ LinkIncremental="2"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/miniunz.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="x86\MiniUnzip$(ConfigurationName)"
+ IntermediateDirectory="x86\MiniUnzip$(ConfigurationName)\Tmp"
+ ConfigurationType="1"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="true"
+ AdditionalIncludeDirectories="..\..\..;..\..\minizip"
+ PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE"
+ StringPooling="true"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="0"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="x86\ZlibDllRelease\zlibwapi.lib"
+ OutputFile="$(OutDir)/miniunz.exe"
+ LinkIncremental="1"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ OptimizeForWindows98="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="x64\MiniUnzip$(ConfigurationName)"
+ IntermediateDirectory="x64\MiniUnzip$(ConfigurationName)\Tmp"
+ ConfigurationType="1"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..;..\..\minizip"
+ PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="false"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="x64\ZlibDllDebug\zlibwapi.lib"
+ OutputFile="$(OutDir)/miniunz.exe"
+ LinkIncremental="2"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/miniunz.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Itanium"
+ OutputDirectory="ia64\MiniUnzip$(ConfigurationName)"
+ IntermediateDirectory="ia64\MiniUnzip$(ConfigurationName)\Tmp"
+ ConfigurationType="1"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="2"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..;..\..\minizip"
+ PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="false"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ia64\ZlibDllDebug\zlibwapi.lib"
+ OutputFile="$(OutDir)/miniunz.exe"
+ LinkIncremental="2"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/miniunz.pdb"
+ SubSystem="1"
+ TargetMachine="5"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="x64\MiniUnzip$(ConfigurationName)"
+ IntermediateDirectory="x64\MiniUnzip$(ConfigurationName)\Tmp"
+ ConfigurationType="1"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="true"
+ AdditionalIncludeDirectories="..\..\..;..\..\minizip"
+ PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64"
+ StringPooling="true"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="x64\ZlibDllRelease\zlibwapi.lib"
+ OutputFile="$(OutDir)/miniunz.exe"
+ LinkIncremental="1"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ OptimizeForWindows98="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Itanium"
+ OutputDirectory="ia64\MiniUnzip$(ConfigurationName)"
+ IntermediateDirectory="ia64\MiniUnzip$(ConfigurationName)\Tmp"
+ ConfigurationType="1"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="2"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="true"
+ AdditionalIncludeDirectories="..\..\..;..\..\minizip"
+ PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64"
+ StringPooling="true"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ia64\ZlibDllRelease\zlibwapi.lib"
+ OutputFile="$(OutDir)/miniunz.exe"
+ LinkIncremental="1"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ OptimizeForWindows98="1"
+ TargetMachine="5"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+ >
+ <File
+ RelativePath="..\..\minizip\miniunz.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/minizip.vcproj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/minizip.vcproj
new file mode 100644
index 0000000000..e57e07d90c
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/minizip.vcproj
@@ -0,0 +1,562 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="minizip"
+ ProjectGUID="{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ <Platform
+ Name="Itanium"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="x86\MiniZip$(ConfigurationName)"
+ IntermediateDirectory="x86\MiniZip$(ConfigurationName)\Tmp"
+ ConfigurationType="1"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..;..\..\minizip"
+ PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="1"
+ BufferSecurityCheck="false"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="x86\ZlibDllDebug\zlibwapi.lib"
+ OutputFile="$(OutDir)/minizip.exe"
+ LinkIncremental="2"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/minizip.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="x86\MiniZip$(ConfigurationName)"
+ IntermediateDirectory="x86\MiniZip$(ConfigurationName)\Tmp"
+ ConfigurationType="1"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="true"
+ AdditionalIncludeDirectories="..\..\..;..\..\minizip"
+ PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE"
+ StringPooling="true"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="0"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="x86\ZlibDllRelease\zlibwapi.lib"
+ OutputFile="$(OutDir)/minizip.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ OptimizeForWindows98="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="x64\$(ConfigurationName)"
+ IntermediateDirectory="x64\$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..;..\..\minizip"
+ PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="false"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="x64\ZlibDllDebug\zlibwapi.lib"
+ OutputFile="$(OutDir)/minizip.exe"
+ LinkIncremental="2"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/minizip.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Itanium"
+ OutputDirectory="ia64\$(ConfigurationName)"
+ IntermediateDirectory="ia64\$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="2"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..;..\..\minizip"
+ PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="false"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ia64\ZlibDllDebug\zlibwapi.lib"
+ OutputFile="$(OutDir)/minizip.exe"
+ LinkIncremental="2"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/minizip.pdb"
+ SubSystem="1"
+ TargetMachine="5"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="x64\$(ConfigurationName)"
+ IntermediateDirectory="x64\$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="true"
+ AdditionalIncludeDirectories="..\..\..;..\..\minizip"
+ PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64"
+ StringPooling="true"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="x64\ZlibDllRelease\zlibwapi.lib"
+ OutputFile="$(OutDir)/minizip.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ OptimizeForWindows98="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Itanium"
+ OutputDirectory="ia64\$(ConfigurationName)"
+ IntermediateDirectory="ia64\$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="2"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="true"
+ AdditionalIncludeDirectories="..\..\..;..\..\minizip"
+ PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64"
+ StringPooling="true"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ia64\ZlibDllRelease\zlibwapi.lib"
+ OutputFile="$(OutDir)/minizip.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ OptimizeForWindows98="1"
+ TargetMachine="5"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+ >
+ <File
+ RelativePath="..\..\minizip\minizip.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/testzlib.vcproj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/testzlib.vcproj
new file mode 100644
index 0000000000..9cb0bf877f
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/testzlib.vcproj
@@ -0,0 +1,852 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="testzlib"
+ ProjectGUID="{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}"
+ RootNamespace="testzlib"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ <Platform
+ Name="Itanium"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="x86\TestZlib$(ConfigurationName)"
+ IntermediateDirectory="x86\TestZlib$(ConfigurationName)\Tmp"
+ ConfigurationType="1"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\.."
+ PreprocessorDefinitions="ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="1"
+ BufferSecurityCheck="false"
+ UsePrecompiledHeader="0"
+ AssemblerOutput="4"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="..\..\masmx86\match686.obj ..\..\masmx86\inffas32.obj"
+ OutputFile="$(OutDir)/testzlib.exe"
+ LinkIncremental="2"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/testzlib.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="x64\TestZlib$(ConfigurationName)"
+ IntermediateDirectory="x64\TestZlib$(ConfigurationName)\Tmp"
+ ConfigurationType="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\.."
+ PreprocessorDefinitions="ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="false"
+ AssemblerListingLocation="$(IntDir)\"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="..\..\masmx64\gvmat64.obj ..\..\masmx64\inffasx64.obj"
+ GenerateManifest="false"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Itanium"
+ OutputDirectory="ia64\TestZlib$(ConfigurationName)"
+ IntermediateDirectory="ia64\TestZlib$(ConfigurationName)\Tmp"
+ ConfigurationType="1"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="2"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\.."
+ PreprocessorDefinitions="ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="false"
+ UsePrecompiledHeader="0"
+ AssemblerOutput="4"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/testzlib.exe"
+ LinkIncremental="2"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/testzlib.pdb"
+ SubSystem="1"
+ TargetMachine="5"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="ReleaseWithoutAsm|Win32"
+ OutputDirectory="x86\TestZlib$(ConfigurationName)"
+ IntermediateDirectory="x86\TestZlib$(ConfigurationName)\Tmp"
+ ConfigurationType="1"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="true"
+ AdditionalIncludeDirectories="..\..\.."
+ PreprocessorDefinitions="WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS"
+ StringPooling="true"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="0"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/testzlib.exe"
+ LinkIncremental="1"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ OptimizeForWindows98="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="ReleaseWithoutAsm|x64"
+ OutputDirectory="x64\TestZlib$(ConfigurationName)"
+ IntermediateDirectory="x64\TestZlib$(ConfigurationName)\Tmp"
+ ConfigurationType="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\.."
+ PreprocessorDefinitions="WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ AssemblerListingLocation="$(IntDir)\"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies=""
+ GenerateManifest="false"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="ReleaseWithoutAsm|Itanium"
+ OutputDirectory="ia64\TestZlib$(ConfigurationName)"
+ IntermediateDirectory="ia64\TestZlib$(ConfigurationName)\Tmp"
+ ConfigurationType="1"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="2"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="true"
+ AdditionalIncludeDirectories="..\..\.."
+ PreprocessorDefinitions="ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64"
+ StringPooling="true"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/testzlib.exe"
+ LinkIncremental="1"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ OptimizeForWindows98="1"
+ TargetMachine="5"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="x86\TestZlib$(ConfigurationName)"
+ IntermediateDirectory="x86\TestZlib$(ConfigurationName)\Tmp"
+ ConfigurationType="1"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="true"
+ AdditionalIncludeDirectories="..\..\.."
+ PreprocessorDefinitions="ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS"
+ StringPooling="true"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="0"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="..\..\masmx86\match686.obj ..\..\masmx86\inffas32.obj"
+ OutputFile="$(OutDir)/testzlib.exe"
+ LinkIncremental="1"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ OptimizeForWindows98="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="x64\TestZlib$(ConfigurationName)"
+ IntermediateDirectory="x64\TestZlib$(ConfigurationName)\Tmp"
+ ConfigurationType="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\.."
+ PreprocessorDefinitions="ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="0"
+ BufferSecurityCheck="false"
+ AssemblerListingLocation="$(IntDir)\"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="..\..\masmx64\gvmat64.obj ..\..\masmx64\inffasx64.obj"
+ GenerateManifest="false"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Itanium"
+ OutputDirectory="ia64\TestZlib$(ConfigurationName)"
+ IntermediateDirectory="ia64\TestZlib$(ConfigurationName)\Tmp"
+ ConfigurationType="1"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="2"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="true"
+ AdditionalIncludeDirectories="..\..\.."
+ PreprocessorDefinitions="ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64"
+ StringPooling="true"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/testzlib.exe"
+ LinkIncremental="1"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ OptimizeForWindows98="1"
+ TargetMachine="5"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+ >
+ <File
+ RelativePath="..\..\..\adler32.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\compress.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\crc32.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\deflate.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\infback.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\masmx64\inffas8664.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Itanium"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="ReleaseWithoutAsm|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="ReleaseWithoutAsm|Itanium"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Itanium"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\inffast.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\inflate.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\inftrees.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\testzlib\testzlib.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\trees.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\uncompr.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\zutil.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/testzlibdll.vcproj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/testzlibdll.vcproj
new file mode 100644
index 0000000000..b1ddde05f9
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/testzlibdll.vcproj
@@ -0,0 +1,565 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="TestZlibDll"
+ ProjectGUID="{C52F9E7B-498A-42BE-8DB4-85A15694366A}"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ <Platform
+ Name="Itanium"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="x86\TestZlibDll$(ConfigurationName)"
+ IntermediateDirectory="x86\TestZlibDll$(ConfigurationName)\Tmp"
+ ConfigurationType="1"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..;..\..\minizip"
+ PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="1"
+ BufferSecurityCheck="false"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="x86\ZlibDllDebug\zlibwapi.lib"
+ OutputFile="$(OutDir)/testzlib.exe"
+ LinkIncremental="2"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/testzlib.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="x86\TestZlibDll$(ConfigurationName)"
+ IntermediateDirectory="x86\TestZlibDll$(ConfigurationName)\Tmp"
+ ConfigurationType="1"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="true"
+ AdditionalIncludeDirectories="..\..\..;..\..\minizip"
+ PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE"
+ StringPooling="true"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="0"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="x86\ZlibDllRelease\zlibwapi.lib"
+ OutputFile="$(OutDir)/testzlib.exe"
+ LinkIncremental="1"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ OptimizeForWindows98="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="x64\TestZlibDll$(ConfigurationName)"
+ IntermediateDirectory="x64\TestZlibDll$(ConfigurationName)\Tmp"
+ ConfigurationType="1"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..;..\..\minizip"
+ PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="false"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="x64\ZlibDllDebug\zlibwapi.lib"
+ OutputFile="$(OutDir)/testzlib.exe"
+ LinkIncremental="2"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/testzlib.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Itanium"
+ OutputDirectory="ia64\TestZlibDll$(ConfigurationName)"
+ IntermediateDirectory="ia64\TestZlibDll$(ConfigurationName)\Tmp"
+ ConfigurationType="1"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="2"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..;..\..\minizip"
+ PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="false"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ia64\ZlibDllDebug\zlibwapi.lib"
+ OutputFile="$(OutDir)/testzlib.exe"
+ LinkIncremental="2"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/testzlib.pdb"
+ SubSystem="1"
+ TargetMachine="5"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="x64\TestZlibDll$(ConfigurationName)"
+ IntermediateDirectory="x64\TestZlibDll$(ConfigurationName)\Tmp"
+ ConfigurationType="1"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="true"
+ AdditionalIncludeDirectories="..\..\..;..\..\minizip"
+ PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64"
+ StringPooling="true"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="x64\ZlibDllRelease\zlibwapi.lib"
+ OutputFile="$(OutDir)/testzlib.exe"
+ LinkIncremental="1"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ OptimizeForWindows98="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Itanium"
+ OutputDirectory="ia64\TestZlibDll$(ConfigurationName)"
+ IntermediateDirectory="ia64\TestZlibDll$(ConfigurationName)\Tmp"
+ ConfigurationType="1"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="2"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="true"
+ AdditionalIncludeDirectories="..\..\..;..\..\minizip"
+ PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64"
+ StringPooling="true"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ia64\ZlibDllRelease\zlibwapi.lib"
+ OutputFile="$(OutDir)/testzlib.exe"
+ LinkIncremental="1"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ OptimizeForWindows98="1"
+ TargetMachine="5"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+ >
+ <File
+ RelativePath="..\..\testzlib\testzlib.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/zlib.rc b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/zlib.rc
new file mode 100644
index 0000000000..73f6476d60
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/zlib.rc
@@ -0,0 +1,32 @@
+#include <windows.h>
+
+#define IDR_VERSION1 1
+IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
+ FILEVERSION 1,2,8,0
+ PRODUCTVERSION 1,2,8,0
+ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+ FILEFLAGS 0
+ FILEOS VOS_DOS_WINDOWS32
+ FILETYPE VFT_DLL
+ FILESUBTYPE 0 // not used
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904E4"
+ //language ID = U.S. English, char set = Windows, Multilingual
+
+ BEGIN
+ VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
+ VALUE "FileVersion", "1.2.8\0"
+ VALUE "InternalName", "zlib\0"
+ VALUE "OriginalFilename", "zlibwapi.dll\0"
+ VALUE "ProductName", "ZLib.DLL\0"
+ VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
+ VALUE "LegalCopyright", "(C) 1995-2013 Jean-loup Gailly & Mark Adler\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x0409, 1252
+ END
+END
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/zlibstat.vcproj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/zlibstat.vcproj
new file mode 100644
index 0000000000..61c76c7c5b
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/zlibstat.vcproj
@@ -0,0 +1,835 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="zlibstat"
+ ProjectGUID="{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ <Platform
+ Name="Itanium"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="x86\ZlibStat$(ConfigurationName)"
+ IntermediateDirectory="x86\ZlibStat$(ConfigurationName)\Tmp"
+ ConfigurationType="4"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+ PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS"
+ ExceptionHandling="0"
+ RuntimeLibrary="1"
+ BufferSecurityCheck="false"
+ PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
+ AssemblerListingLocation="$(IntDir)\"
+ ObjectFile="$(IntDir)\"
+ ProgramDataBaseFileName="$(OutDir)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ Culture="1036"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ AdditionalOptions="/MACHINE:X86 /NODEFAULTLIB"
+ OutputFile="$(OutDir)\zlibstat.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="x64\ZlibStat$(ConfigurationName)"
+ IntermediateDirectory="x64\ZlibStat$(ConfigurationName)\Tmp"
+ ConfigurationType="4"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+ PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64"
+ ExceptionHandling="0"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="false"
+ PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
+ AssemblerListingLocation="$(IntDir)\"
+ ObjectFile="$(IntDir)\"
+ ProgramDataBaseFileName="$(OutDir)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ Culture="1036"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ AdditionalOptions="/MACHINE:AMD64 /NODEFAULTLIB"
+ OutputFile="$(OutDir)\zlibstat.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Itanium"
+ OutputDirectory="ia64\ZlibStat$(ConfigurationName)"
+ IntermediateDirectory="ia64\ZlibStat$(ConfigurationName)\Tmp"
+ ConfigurationType="4"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="2"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+ PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64"
+ ExceptionHandling="0"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="false"
+ PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
+ AssemblerListingLocation="$(IntDir)\"
+ ObjectFile="$(IntDir)\"
+ ProgramDataBaseFileName="$(OutDir)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ Culture="1036"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ AdditionalOptions="/MACHINE:IA64 /NODEFAULTLIB"
+ OutputFile="$(OutDir)\zlibstat.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="x86\ZlibStat$(ConfigurationName)"
+ IntermediateDirectory="x86\ZlibStat$(ConfigurationName)\Tmp"
+ ConfigurationType="4"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+ PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="0"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
+ AssemblerListingLocation="$(IntDir)\"
+ ObjectFile="$(IntDir)\"
+ ProgramDataBaseFileName="$(OutDir)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ Culture="1036"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ AdditionalOptions="/MACHINE:X86 /NODEFAULTLIB"
+ AdditionalDependencies="..\..\masmx86\match686.obj ..\..\masmx86\inffas32.obj "
+ OutputFile="$(OutDir)\zlibstat.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="x64\ZlibStat$(ConfigurationName)"
+ IntermediateDirectory="x64\ZlibStat$(ConfigurationName)\Tmp"
+ ConfigurationType="4"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+ PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF;WIN64"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
+ AssemblerListingLocation="$(IntDir)\"
+ ObjectFile="$(IntDir)\"
+ ProgramDataBaseFileName="$(OutDir)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ Culture="1036"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ AdditionalOptions="/MACHINE:AMD64 /NODEFAULTLIB"
+ AdditionalDependencies="..\..\masmx64\gvmat64.obj ..\..\masmx64\inffasx64.obj "
+ OutputFile="$(OutDir)\zlibstat.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Itanium"
+ OutputDirectory="ia64\ZlibStat$(ConfigurationName)"
+ IntermediateDirectory="ia64\ZlibStat$(ConfigurationName)\Tmp"
+ ConfigurationType="4"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="2"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+ PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
+ AssemblerListingLocation="$(IntDir)\"
+ ObjectFile="$(IntDir)\"
+ ProgramDataBaseFileName="$(OutDir)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ Culture="1036"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ AdditionalOptions="/MACHINE:IA64 /NODEFAULTLIB"
+ OutputFile="$(OutDir)\zlibstat.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="ReleaseWithoutAsm|Win32"
+ OutputDirectory="x86\ZlibStat$(ConfigurationName)"
+ IntermediateDirectory="x86\ZlibStat$(ConfigurationName)\Tmp"
+ ConfigurationType="4"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+ PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="0"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
+ AssemblerListingLocation="$(IntDir)\"
+ ObjectFile="$(IntDir)\"
+ ProgramDataBaseFileName="$(OutDir)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ Culture="1036"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ AdditionalOptions="/MACHINE:X86 /NODEFAULTLIB"
+ OutputFile="$(OutDir)\zlibstat.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="ReleaseWithoutAsm|x64"
+ OutputDirectory="x64\ZlibStat$(ConfigurationName)"
+ IntermediateDirectory="x64\ZlibStat$(ConfigurationName)\Tmp"
+ ConfigurationType="4"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+ PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
+ AssemblerListingLocation="$(IntDir)\"
+ ObjectFile="$(IntDir)\"
+ ProgramDataBaseFileName="$(OutDir)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ Culture="1036"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ AdditionalOptions="/MACHINE:AMD64 /NODEFAULTLIB"
+ OutputFile="$(OutDir)\zlibstat.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="ReleaseWithoutAsm|Itanium"
+ OutputDirectory="ia64\ZlibStat$(ConfigurationName)"
+ IntermediateDirectory="ia64\ZlibStat$(ConfigurationName)\Tmp"
+ ConfigurationType="4"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="2"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+ PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
+ AssemblerListingLocation="$(IntDir)\"
+ ObjectFile="$(IntDir)\"
+ ProgramDataBaseFileName="$(OutDir)\"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ Culture="1036"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ AdditionalOptions="/MACHINE:IA64 /NODEFAULTLIB"
+ OutputFile="$(OutDir)\zlibstat.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ >
+ <File
+ RelativePath="..\..\..\adler32.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\compress.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\crc32.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\deflate.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\gzclose.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\gzguts.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\gzlib.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\gzread.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\gzwrite.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\infback.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\masmx64\inffas8664.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Itanium"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Itanium"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="ReleaseWithoutAsm|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="ReleaseWithoutAsm|Itanium"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\inffast.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\inflate.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\inftrees.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\minizip\ioapi.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\trees.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\uncompr.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\minizip\unzip.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\minizip\zip.c"
+ >
+ </File>
+ <File
+ RelativePath=".\zlib.rc"
+ >
+ </File>
+ <File
+ RelativePath=".\zlibvc.def"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\zutil.c"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/zlibvc.def b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/zlibvc.def
new file mode 100644
index 0000000000..6367046722
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/zlibvc.def
@@ -0,0 +1,143 @@
+LIBRARY
+; zlib data compression and ZIP file I/O library
+
+VERSION 1.2.8
+
+EXPORTS
+ adler32 @1
+ compress @2
+ crc32 @3
+ deflate @4
+ deflateCopy @5
+ deflateEnd @6
+ deflateInit2_ @7
+ deflateInit_ @8
+ deflateParams @9
+ deflateReset @10
+ deflateSetDictionary @11
+ gzclose @12
+ gzdopen @13
+ gzerror @14
+ gzflush @15
+ gzopen @16
+ gzread @17
+ gzwrite @18
+ inflate @19
+ inflateEnd @20
+ inflateInit2_ @21
+ inflateInit_ @22
+ inflateReset @23
+ inflateSetDictionary @24
+ inflateSync @25
+ uncompress @26
+ zlibVersion @27
+ gzprintf @28
+ gzputc @29
+ gzgetc @30
+ gzseek @31
+ gzrewind @32
+ gztell @33
+ gzeof @34
+ gzsetparams @35
+ zError @36
+ inflateSyncPoint @37
+ get_crc_table @38
+ compress2 @39
+ gzputs @40
+ gzgets @41
+ inflateCopy @42
+ inflateBackInit_ @43
+ inflateBack @44
+ inflateBackEnd @45
+ compressBound @46
+ deflateBound @47
+ gzclearerr @48
+ gzungetc @49
+ zlibCompileFlags @50
+ deflatePrime @51
+ deflatePending @52
+
+ unzOpen @61
+ unzClose @62
+ unzGetGlobalInfo @63
+ unzGetCurrentFileInfo @64
+ unzGoToFirstFile @65
+ unzGoToNextFile @66
+ unzOpenCurrentFile @67
+ unzReadCurrentFile @68
+ unzOpenCurrentFile3 @69
+ unztell @70
+ unzeof @71
+ unzCloseCurrentFile @72
+ unzGetGlobalComment @73
+ unzStringFileNameCompare @74
+ unzLocateFile @75
+ unzGetLocalExtrafield @76
+ unzOpen2 @77
+ unzOpenCurrentFile2 @78
+ unzOpenCurrentFilePassword @79
+
+ zipOpen @80
+ zipOpenNewFileInZip @81
+ zipWriteInFileInZip @82
+ zipCloseFileInZip @83
+ zipClose @84
+ zipOpenNewFileInZip2 @86
+ zipCloseFileInZipRaw @87
+ zipOpen2 @88
+ zipOpenNewFileInZip3 @89
+
+ unzGetFilePos @100
+ unzGoToFilePos @101
+
+ fill_win32_filefunc @110
+
+; zlibwapi v1.2.4 added:
+ fill_win32_filefunc64 @111
+ fill_win32_filefunc64A @112
+ fill_win32_filefunc64W @113
+
+ unzOpen64 @120
+ unzOpen2_64 @121
+ unzGetGlobalInfo64 @122
+ unzGetCurrentFileInfo64 @124
+ unzGetCurrentFileZStreamPos64 @125
+ unztell64 @126
+ unzGetFilePos64 @127
+ unzGoToFilePos64 @128
+
+ zipOpen64 @130
+ zipOpen2_64 @131
+ zipOpenNewFileInZip64 @132
+ zipOpenNewFileInZip2_64 @133
+ zipOpenNewFileInZip3_64 @134
+ zipOpenNewFileInZip4_64 @135
+ zipCloseFileInZipRaw64 @136
+
+; zlib1 v1.2.4 added:
+ adler32_combine @140
+ crc32_combine @142
+ deflateSetHeader @144
+ deflateTune @145
+ gzbuffer @146
+ gzclose_r @147
+ gzclose_w @148
+ gzdirect @149
+ gzoffset @150
+ inflateGetHeader @156
+ inflateMark @157
+ inflatePrime @158
+ inflateReset2 @159
+ inflateUndermine @160
+
+; zlib1 v1.2.6 added:
+ gzgetc_ @161
+ inflateResetKeep @163
+ deflateResetKeep @164
+
+; zlib1 v1.2.7 added:
+ gzopen_w @165
+
+; zlib1 v1.2.8 added:
+ inflateGetDictionary @166
+ gzvprintf @167
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/zlibvc.sln b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/zlibvc.sln
new file mode 100644
index 0000000000..b4829671f6
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/zlibvc.sln
@@ -0,0 +1,144 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibvc", "zlibvc.vcproj", "{8FD826F8-3739-44E6-8CC8-997122E53B8D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibstat", "zlibstat.vcproj", "{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testzlib", "testzlib.vcproj", "{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestZlibDll", "testzlibdll.vcproj", "{C52F9E7B-498A-42BE-8DB4-85A15694366A}"
+ ProjectSection(ProjectDependencies) = postProject
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D} = {8FD826F8-3739-44E6-8CC8-997122E53B8D}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "minizip", "minizip.vcproj", "{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}"
+ ProjectSection(ProjectDependencies) = postProject
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D} = {8FD826F8-3739-44E6-8CC8-997122E53B8D}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "miniunz", "miniunz.vcproj", "{C52F9E7B-498A-42BE-8DB4-85A15694382A}"
+ ProjectSection(ProjectDependencies) = postProject
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D} = {8FD826F8-3739-44E6-8CC8-997122E53B8D}
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Itanium = Debug|Itanium
+ Debug|Win32 = Debug|Win32
+ Debug|x64 = Debug|x64
+ Release|Itanium = Release|Itanium
+ Release|Win32 = Release|Win32
+ Release|x64 = Release|x64
+ ReleaseWithoutAsm|Itanium = ReleaseWithoutAsm|Itanium
+ ReleaseWithoutAsm|Win32 = ReleaseWithoutAsm|Win32
+ ReleaseWithoutAsm|x64 = ReleaseWithoutAsm|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Itanium.ActiveCfg = Debug|Itanium
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Itanium.Build.0 = Debug|Itanium
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Win32.ActiveCfg = Debug|Win32
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Win32.Build.0 = Debug|Win32
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|x64.ActiveCfg = Debug|x64
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|x64.Build.0 = Debug|x64
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Itanium.ActiveCfg = Release|Itanium
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Itanium.Build.0 = Release|Itanium
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.ActiveCfg = Release|Win32
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.Build.0 = Release|Win32
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.ActiveCfg = Release|x64
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.Build.0 = Release|x64
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Itanium
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Itanium.Build.0 = ReleaseWithoutAsm|Itanium
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64
+ {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Itanium.ActiveCfg = Debug|Itanium
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Itanium.Build.0 = Debug|Itanium
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.ActiveCfg = Debug|Win32
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.Build.0 = Debug|Win32
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.ActiveCfg = Debug|x64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.Build.0 = Debug|x64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Itanium.ActiveCfg = Release|Itanium
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Itanium.Build.0 = Release|Itanium
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.ActiveCfg = Release|Win32
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.Build.0 = Release|Win32
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.ActiveCfg = Release|x64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.Build.0 = Release|x64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Itanium
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Itanium.Build.0 = ReleaseWithoutAsm|Itanium
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64
+ {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.ActiveCfg = Debug|Itanium
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.Build.0 = Debug|Itanium
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.Build.0 = Debug|Win32
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.ActiveCfg = Debug|x64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.Build.0 = Debug|x64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.ActiveCfg = Release|Itanium
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.Build.0 = Release|Itanium
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.ActiveCfg = Release|Win32
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.Build.0 = Release|Win32
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.ActiveCfg = Release|x64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.Build.0 = Release|x64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Itanium
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.Build.0 = ReleaseWithoutAsm|Itanium
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64
+ {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Itanium.ActiveCfg = Debug|Itanium
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Itanium.Build.0 = Debug|Itanium
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Win32.ActiveCfg = Debug|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Win32.Build.0 = Debug|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|x64.ActiveCfg = Debug|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|x64.Build.0 = Debug|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Itanium.ActiveCfg = Release|Itanium
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Itanium.Build.0 = Release|Itanium
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Win32.ActiveCfg = Release|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Win32.Build.0 = Release|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|x64.ActiveCfg = Release|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|x64.Build.0 = Release|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Itanium
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Itanium.Build.0 = Release|Itanium
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.ActiveCfg = Debug|Itanium
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.Build.0 = Debug|Itanium
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.Build.0 = Debug|Win32
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.ActiveCfg = Debug|x64
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.Build.0 = Debug|x64
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.ActiveCfg = Release|Itanium
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.Build.0 = Release|Itanium
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.ActiveCfg = Release|Win32
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.Build.0 = Release|Win32
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.ActiveCfg = Release|x64
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.Build.0 = Release|x64
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Itanium
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.Build.0 = Release|Itanium
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
+ {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Itanium.ActiveCfg = Debug|Itanium
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Itanium.Build.0 = Debug|Itanium
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Win32.ActiveCfg = Debug|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Win32.Build.0 = Debug|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|x64.ActiveCfg = Debug|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|x64.Build.0 = Debug|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Itanium.ActiveCfg = Release|Itanium
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Itanium.Build.0 = Release|Itanium
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Win32.ActiveCfg = Release|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Win32.Build.0 = Release|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|x64.ActiveCfg = Release|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|x64.Build.0 = Release|x64
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Itanium
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Itanium.Build.0 = Release|Itanium
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
+ {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/zlibvc.vcproj b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/zlibvc.vcproj
new file mode 100644
index 0000000000..c9a89471e7
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/contrib/vstudio/vc9/zlibvc.vcproj
@@ -0,0 +1,1156 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="zlibvc"
+ ProjectGUID="{8FD826F8-3739-44E6-8CC8-997122E53B8D}"
+ RootNamespace="zlibvc"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ <Platform
+ Name="Itanium"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="x86\ZlibDll$(ConfigurationName)"
+ IntermediateDirectory="x86\ZlibDll$(ConfigurationName)\Tmp"
+ ConfigurationType="2"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName="$(OutDir)/zlibvc.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+ PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF"
+ ExceptionHandling="0"
+ RuntimeLibrary="1"
+ BufferSecurityCheck="false"
+ PrecompiledHeaderFile="$(IntDir)/zlibvc.pch"
+ AssemblerListingLocation="$(IntDir)\"
+ ObjectFile="$(IntDir)\"
+ ProgramDataBaseFileName="$(OutDir)\"
+ BrowseInformation="0"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1036"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="..\..\masmx86\match686.obj ..\..\masmx86\inffas32.obj"
+ OutputFile="$(OutDir)\zlibwapi.dll"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ ModuleDefinitionFile=".\zlibvc.def"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/zlibwapi.pdb"
+ GenerateMapFile="true"
+ MapFileName="$(OutDir)/zlibwapi.map"
+ SubSystem="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/zlibwapi.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="x64\ZlibDll$(ConfigurationName)"
+ IntermediateDirectory="x64\ZlibDll$(ConfigurationName)\Tmp"
+ ConfigurationType="2"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="3"
+ TypeLibraryName="$(OutDir)/zlibvc.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+ PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;WIN64"
+ ExceptionHandling="0"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="false"
+ PrecompiledHeaderFile="$(IntDir)/zlibvc.pch"
+ AssemblerListingLocation="$(IntDir)\"
+ ObjectFile="$(IntDir)\"
+ ProgramDataBaseFileName="$(OutDir)\"
+ BrowseInformation="0"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1036"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="..\..\masmx64\gvmat64.obj ..\..\masmx64\inffasx64.obj "
+ OutputFile="$(OutDir)\zlibwapi.dll"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ ModuleDefinitionFile=".\zlibvc.def"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/zlibwapi.pdb"
+ GenerateMapFile="true"
+ MapFileName="$(OutDir)/zlibwapi.map"
+ SubSystem="2"
+ ImportLibrary="$(OutDir)/zlibwapi.lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Itanium"
+ OutputDirectory="ia64\ZlibDll$(ConfigurationName)"
+ IntermediateDirectory="ia64\ZlibDll$(ConfigurationName)\Tmp"
+ ConfigurationType="2"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="2"
+ TypeLibraryName="$(OutDir)/zlibvc.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+ PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64"
+ ExceptionHandling="0"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="false"
+ PrecompiledHeaderFile="$(IntDir)/zlibvc.pch"
+ AssemblerListingLocation="$(IntDir)\"
+ ObjectFile="$(IntDir)\"
+ ProgramDataBaseFileName="$(OutDir)\"
+ BrowseInformation="0"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1036"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)\zlibwapi.dll"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ ModuleDefinitionFile=".\zlibvc.def"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/zlibwapi.pdb"
+ GenerateMapFile="true"
+ MapFileName="$(OutDir)/zlibwapi.map"
+ SubSystem="2"
+ ImportLibrary="$(OutDir)/zlibwapi.lib"
+ TargetMachine="5"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="ReleaseWithoutAsm|Win32"
+ OutputDirectory="x86\ZlibDll$(ConfigurationName)"
+ IntermediateDirectory="x86\ZlibDll$(ConfigurationName)\Tmp"
+ ConfigurationType="2"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName="$(OutDir)/zlibvc.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+ PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile="$(IntDir)/zlibvc.pch"
+ AssemblerOutput="2"
+ AssemblerListingLocation="$(IntDir)\"
+ ObjectFile="$(IntDir)\"
+ ProgramDataBaseFileName="$(OutDir)\"
+ BrowseInformation="0"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1036"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ OutputFile="$(OutDir)\zlibwapi.dll"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ IgnoreAllDefaultLibraries="false"
+ ModuleDefinitionFile=".\zlibvc.def"
+ ProgramDatabaseFile="$(OutDir)/zlibwapi.pdb"
+ GenerateMapFile="true"
+ MapFileName="$(OutDir)/zlibwapi.map"
+ SubSystem="2"
+ OptimizeForWindows98="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/zlibwapi.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="ReleaseWithoutAsm|x64"
+ OutputDirectory="x64\ZlibDll$(ConfigurationName)"
+ IntermediateDirectory="x64\ZlibDll$(ConfigurationName)\Tmp"
+ ConfigurationType="2"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="3"
+ TypeLibraryName="$(OutDir)/zlibvc.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+ PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile="$(IntDir)/zlibvc.pch"
+ AssemblerOutput="2"
+ AssemblerListingLocation="$(IntDir)\"
+ ObjectFile="$(IntDir)\"
+ ProgramDataBaseFileName="$(OutDir)\"
+ BrowseInformation="0"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1036"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)\zlibwapi.dll"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ IgnoreAllDefaultLibraries="false"
+ ModuleDefinitionFile=".\zlibvc.def"
+ ProgramDatabaseFile="$(OutDir)/zlibwapi.pdb"
+ GenerateMapFile="true"
+ MapFileName="$(OutDir)/zlibwapi.map"
+ SubSystem="2"
+ OptimizeForWindows98="1"
+ ImportLibrary="$(OutDir)/zlibwapi.lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="ReleaseWithoutAsm|Itanium"
+ OutputDirectory="ia64\ZlibDll$(ConfigurationName)"
+ IntermediateDirectory="ia64\ZlibDll$(ConfigurationName)\Tmp"
+ ConfigurationType="2"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="2"
+ TypeLibraryName="$(OutDir)/zlibvc.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+ PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile="$(IntDir)/zlibvc.pch"
+ AssemblerOutput="2"
+ AssemblerListingLocation="$(IntDir)\"
+ ObjectFile="$(IntDir)\"
+ ProgramDataBaseFileName="$(OutDir)\"
+ BrowseInformation="0"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1036"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)\zlibwapi.dll"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ IgnoreAllDefaultLibraries="false"
+ ModuleDefinitionFile=".\zlibvc.def"
+ ProgramDatabaseFile="$(OutDir)/zlibwapi.pdb"
+ GenerateMapFile="true"
+ MapFileName="$(OutDir)/zlibwapi.map"
+ SubSystem="2"
+ OptimizeForWindows98="1"
+ ImportLibrary="$(OutDir)/zlibwapi.lib"
+ TargetMachine="5"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="x86\ZlibDll$(ConfigurationName)"
+ IntermediateDirectory="x86\ZlibDll$(ConfigurationName)\Tmp"
+ ConfigurationType="2"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName="$(OutDir)/zlibvc.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+ PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="0"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile="$(IntDir)/zlibvc.pch"
+ AssemblerOutput="2"
+ AssemblerListingLocation="$(IntDir)\"
+ ObjectFile="$(IntDir)\"
+ ProgramDataBaseFileName="$(OutDir)\"
+ BrowseInformation="0"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1036"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="..\..\masmx86\match686.obj ..\..\masmx86\inffas32.obj "
+ OutputFile="$(OutDir)\zlibwapi.dll"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ IgnoreAllDefaultLibraries="false"
+ ModuleDefinitionFile=".\zlibvc.def"
+ ProgramDatabaseFile="$(OutDir)/zlibwapi.pdb"
+ GenerateMapFile="true"
+ MapFileName="$(OutDir)/zlibwapi.map"
+ SubSystem="2"
+ OptimizeForWindows98="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/zlibwapi.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="x64\ZlibDll$(ConfigurationName)"
+ IntermediateDirectory="x64\ZlibDll$(ConfigurationName)\Tmp"
+ ConfigurationType="2"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="3"
+ TypeLibraryName="$(OutDir)/zlibvc.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+ PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;WIN64"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile="$(IntDir)/zlibvc.pch"
+ AssemblerOutput="2"
+ AssemblerListingLocation="$(IntDir)\"
+ ObjectFile="$(IntDir)\"
+ ProgramDataBaseFileName="$(OutDir)\"
+ BrowseInformation="0"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1036"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="..\..\masmx64\gvmat64.obj ..\..\masmx64\inffasx64.obj "
+ OutputFile="$(OutDir)\zlibwapi.dll"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ IgnoreAllDefaultLibraries="false"
+ ModuleDefinitionFile=".\zlibvc.def"
+ ProgramDatabaseFile="$(OutDir)/zlibwapi.pdb"
+ GenerateMapFile="true"
+ MapFileName="$(OutDir)/zlibwapi.map"
+ SubSystem="2"
+ OptimizeForWindows98="1"
+ ImportLibrary="$(OutDir)/zlibwapi.lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Itanium"
+ OutputDirectory="ia64\ZlibDll$(ConfigurationName)"
+ IntermediateDirectory="ia64\ZlibDll$(ConfigurationName)\Tmp"
+ ConfigurationType="2"
+ InheritedPropertySheets="UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="2"
+ TypeLibraryName="$(OutDir)/zlibvc.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+ PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile="$(IntDir)/zlibvc.pch"
+ AssemblerOutput="2"
+ AssemblerListingLocation="$(IntDir)\"
+ ObjectFile="$(IntDir)\"
+ ProgramDataBaseFileName="$(OutDir)\"
+ BrowseInformation="0"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1036"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)\zlibwapi.dll"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ IgnoreAllDefaultLibraries="false"
+ ModuleDefinitionFile=".\zlibvc.def"
+ ProgramDatabaseFile="$(OutDir)/zlibwapi.pdb"
+ GenerateMapFile="true"
+ MapFileName="$(OutDir)/zlibwapi.map"
+ SubSystem="2"
+ OptimizeForWindows98="1"
+ ImportLibrary="$(OutDir)/zlibwapi.lib"
+ TargetMachine="5"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
+ >
+ <File
+ RelativePath="..\..\..\adler32.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\compress.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\crc32.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\deflate.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\gzclose.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\gzguts.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\gzlib.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\gzread.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\gzwrite.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\infback.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\masmx64\inffas8664.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Itanium"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="ReleaseWithoutAsm|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="ReleaseWithoutAsm|Itanium"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Itanium"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\inffast.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\inflate.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\inftrees.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\minizip\ioapi.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\minizip\iowin32.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\trees.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\uncompr.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\minizip\unzip.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="ZLIB_INTERNAL"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="ZLIB_INTERNAL"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Itanium"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="ZLIB_INTERNAL"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\minizip\zip.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="ZLIB_INTERNAL"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="ZLIB_INTERNAL"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Itanium"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="ZLIB_INTERNAL"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\zlib.rc"
+ >
+ </File>
+ <File
+ RelativePath=".\zlibvc.def"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\zutil.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;fi;fd"
+ >
+ <File
+ RelativePath="..\..\..\deflate.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\infblock.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\infcodes.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\inffast.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\inftrees.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\infutil.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\zconf.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\zlib.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\zutil.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/protocols/Telegram/tgl/zlib/crc32.c b/protocols/Telegram/tgl/zlib/crc32.c
new file mode 100644
index 0000000000..979a7190a3
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/crc32.c
@@ -0,0 +1,425 @@
+/* crc32.c -- compute the CRC-32 of a data stream
+ * Copyright (C) 1995-2006, 2010, 2011, 2012 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ *
+ * Thanks to Rodney Brown <rbrown64@csc.com.au> for his contribution of faster
+ * CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing
+ * tables for updating the shift register in one step with three exclusive-ors
+ * instead of four steps with four exclusive-ors. This results in about a
+ * factor of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3.
+ */
+
+/* @(#) $Id$ */
+
+/*
+ Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore
+ protection on the static variables used to control the first-use generation
+ of the crc tables. Therefore, if you #define DYNAMIC_CRC_TABLE, you should
+ first call get_crc_table() to initialize the tables before allowing more than
+ one thread to use crc32().
+
+ DYNAMIC_CRC_TABLE and MAKECRCH can be #defined to write out crc32.h.
+ */
+
+#ifdef MAKECRCH
+# include <stdio.h>
+# ifndef DYNAMIC_CRC_TABLE
+# define DYNAMIC_CRC_TABLE
+# endif /* !DYNAMIC_CRC_TABLE */
+#endif /* MAKECRCH */
+
+#include "zutil.h" /* for STDC and FAR definitions */
+
+#define local static
+
+/* Definitions for doing the crc four data bytes at a time. */
+#if !defined(NOBYFOUR) && defined(Z_U4)
+# define BYFOUR
+#endif
+#ifdef BYFOUR
+ local unsigned long crc32_little OF((unsigned long,
+ const unsigned char FAR *, unsigned));
+ local unsigned long crc32_big OF((unsigned long,
+ const unsigned char FAR *, unsigned));
+# define TBLS 8
+#else
+# define TBLS 1
+#endif /* BYFOUR */
+
+/* Local functions for crc concatenation */
+local unsigned long gf2_matrix_times OF((unsigned long *mat,
+ unsigned long vec));
+local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat));
+local uLong crc32_combine_ OF((uLong crc1, uLong crc2, z_off64_t len2));
+
+
+#ifdef DYNAMIC_CRC_TABLE
+
+local volatile int crc_table_empty = 1;
+local z_crc_t FAR crc_table[TBLS][256];
+local void make_crc_table OF((void));
+#ifdef MAKECRCH
+ local void write_table OF((FILE *, const z_crc_t FAR *));
+#endif /* MAKECRCH */
+/*
+ Generate tables for a byte-wise 32-bit CRC calculation on the polynomial:
+ x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.
+
+ Polynomials over GF(2) are represented in binary, one bit per coefficient,
+ with the lowest powers in the most significant bit. Then adding polynomials
+ is just exclusive-or, and multiplying a polynomial by x is a right shift by
+ one. If we call the above polynomial p, and represent a byte as the
+ polynomial q, also with the lowest power in the most significant bit (so the
+ byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p,
+ where a mod b means the remainder after dividing a by b.
+
+ This calculation is done using the shift-register method of multiplying and
+ taking the remainder. The register is initialized to zero, and for each
+ incoming bit, x^32 is added mod p to the register if the bit is a one (where
+ x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by
+ x (which is shifting right by one and adding x^32 mod p if the bit shifted
+ out is a one). We start with the highest power (least significant bit) of
+ q and repeat for all eight bits of q.
+
+ The first table is simply the CRC of all possible eight bit values. This is
+ all the information needed to generate CRCs on data a byte at a time for all
+ combinations of CRC register values and incoming bytes. The remaining tables
+ allow for word-at-a-time CRC calculation for both big-endian and little-
+ endian machines, where a word is four bytes.
+*/
+local void make_crc_table()
+{
+ z_crc_t c;
+ int n, k;
+ z_crc_t poly; /* polynomial exclusive-or pattern */
+ /* terms of polynomial defining this crc (except x^32): */
+ static volatile int first = 1; /* flag to limit concurrent making */
+ static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
+
+ /* See if another task is already doing this (not thread-safe, but better
+ than nothing -- significantly reduces duration of vulnerability in
+ case the advice about DYNAMIC_CRC_TABLE is ignored) */
+ if (first) {
+ first = 0;
+
+ /* make exclusive-or pattern from polynomial (0xedb88320UL) */
+ poly = 0;
+ for (n = 0; n < (int)(sizeof(p)/sizeof(unsigned char)); n++)
+ poly |= (z_crc_t)1 << (31 - p[n]);
+
+ /* generate a crc for every 8-bit value */
+ for (n = 0; n < 256; n++) {
+ c = (z_crc_t)n;
+ for (k = 0; k < 8; k++)
+ c = c & 1 ? poly ^ (c >> 1) : c >> 1;
+ crc_table[0][n] = c;
+ }
+
+#ifdef BYFOUR
+ /* generate crc for each value followed by one, two, and three zeros,
+ and then the byte reversal of those as well as the first table */
+ for (n = 0; n < 256; n++) {
+ c = crc_table[0][n];
+ crc_table[4][n] = ZSWAP32(c);
+ for (k = 1; k < 4; k++) {
+ c = crc_table[0][c & 0xff] ^ (c >> 8);
+ crc_table[k][n] = c;
+ crc_table[k + 4][n] = ZSWAP32(c);
+ }
+ }
+#endif /* BYFOUR */
+
+ crc_table_empty = 0;
+ }
+ else { /* not first */
+ /* wait for the other guy to finish (not efficient, but rare) */
+ while (crc_table_empty)
+ ;
+ }
+
+#ifdef MAKECRCH
+ /* write out CRC tables to crc32.h */
+ {
+ FILE *out;
+
+ out = fopen("crc32.h", "w");
+ if (out == NULL) return;
+ fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n");
+ fprintf(out, " * Generated automatically by crc32.c\n */\n\n");
+ fprintf(out, "local const z_crc_t FAR ");
+ fprintf(out, "crc_table[TBLS][256] =\n{\n {\n");
+ write_table(out, crc_table[0]);
+# ifdef BYFOUR
+ fprintf(out, "#ifdef BYFOUR\n");
+ for (k = 1; k < 8; k++) {
+ fprintf(out, " },\n {\n");
+ write_table(out, crc_table[k]);
+ }
+ fprintf(out, "#endif\n");
+# endif /* BYFOUR */
+ fprintf(out, " }\n};\n");
+ fclose(out);
+ }
+#endif /* MAKECRCH */
+}
+
+#ifdef MAKECRCH
+local void write_table(out, table)
+ FILE *out;
+ const z_crc_t FAR *table;
+{
+ int n;
+
+ for (n = 0; n < 256; n++)
+ fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : " ",
+ (unsigned long)(table[n]),
+ n == 255 ? "\n" : (n % 5 == 4 ? ",\n" : ", "));
+}
+#endif /* MAKECRCH */
+
+#else /* !DYNAMIC_CRC_TABLE */
+/* ========================================================================
+ * Tables of CRC-32s of all single-byte values, made by make_crc_table().
+ */
+#include "crc32.h"
+#endif /* DYNAMIC_CRC_TABLE */
+
+/* =========================================================================
+ * This function can be used by asm versions of crc32()
+ */
+const z_crc_t FAR * ZEXPORT get_crc_table()
+{
+#ifdef DYNAMIC_CRC_TABLE
+ if (crc_table_empty)
+ make_crc_table();
+#endif /* DYNAMIC_CRC_TABLE */
+ return (const z_crc_t FAR *)crc_table;
+}
+
+/* ========================================================================= */
+#define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8)
+#define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1
+
+/* ========================================================================= */
+unsigned long ZEXPORT crc32(crc, buf, len)
+ unsigned long crc;
+ const unsigned char FAR *buf;
+ uInt len;
+{
+ if (buf == Z_NULL) return 0UL;
+
+#ifdef DYNAMIC_CRC_TABLE
+ if (crc_table_empty)
+ make_crc_table();
+#endif /* DYNAMIC_CRC_TABLE */
+
+#ifdef BYFOUR
+ if (sizeof(void *) == sizeof(ptrdiff_t)) {
+ z_crc_t endian;
+
+ endian = 1;
+ if (*((unsigned char *)(&endian)))
+ return crc32_little(crc, buf, len);
+ else
+ return crc32_big(crc, buf, len);
+ }
+#endif /* BYFOUR */
+ crc = crc ^ 0xffffffffUL;
+ while (len >= 8) {
+ DO8;
+ len -= 8;
+ }
+ if (len) do {
+ DO1;
+ } while (--len);
+ return crc ^ 0xffffffffUL;
+}
+
+#ifdef BYFOUR
+
+/* ========================================================================= */
+#define DOLIT4 c ^= *buf4++; \
+ c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \
+ crc_table[1][(c >> 16) & 0xff] ^ crc_table[0][c >> 24]
+#define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4
+
+/* ========================================================================= */
+local unsigned long crc32_little(crc, buf, len)
+ unsigned long crc;
+ const unsigned char FAR *buf;
+ unsigned len;
+{
+ register z_crc_t c;
+ register const z_crc_t FAR *buf4;
+
+ c = (z_crc_t)crc;
+ c = ~c;
+ while (len && ((ptrdiff_t)buf & 3)) {
+ c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
+ len--;
+ }
+
+ buf4 = (const z_crc_t FAR *)(const void FAR *)buf;
+ while (len >= 32) {
+ DOLIT32;
+ len -= 32;
+ }
+ while (len >= 4) {
+ DOLIT4;
+ len -= 4;
+ }
+ buf = (const unsigned char FAR *)buf4;
+
+ if (len) do {
+ c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
+ } while (--len);
+ c = ~c;
+ return (unsigned long)c;
+}
+
+/* ========================================================================= */
+#define DOBIG4 c ^= *++buf4; \
+ c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \
+ crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24]
+#define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4
+
+/* ========================================================================= */
+local unsigned long crc32_big(crc, buf, len)
+ unsigned long crc;
+ const unsigned char FAR *buf;
+ unsigned len;
+{
+ register z_crc_t c;
+ register const z_crc_t FAR *buf4;
+
+ c = ZSWAP32((z_crc_t)crc);
+ c = ~c;
+ while (len && ((ptrdiff_t)buf & 3)) {
+ c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
+ len--;
+ }
+
+ buf4 = (const z_crc_t FAR *)(const void FAR *)buf;
+ buf4--;
+ while (len >= 32) {
+ DOBIG32;
+ len -= 32;
+ }
+ while (len >= 4) {
+ DOBIG4;
+ len -= 4;
+ }
+ buf4++;
+ buf = (const unsigned char FAR *)buf4;
+
+ if (len) do {
+ c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
+ } while (--len);
+ c = ~c;
+ return (unsigned long)(ZSWAP32(c));
+}
+
+#endif /* BYFOUR */
+
+#define GF2_DIM 32 /* dimension of GF(2) vectors (length of CRC) */
+
+/* ========================================================================= */
+local unsigned long gf2_matrix_times(mat, vec)
+ unsigned long *mat;
+ unsigned long vec;
+{
+ unsigned long sum;
+
+ sum = 0;
+ while (vec) {
+ if (vec & 1)
+ sum ^= *mat;
+ vec >>= 1;
+ mat++;
+ }
+ return sum;
+}
+
+/* ========================================================================= */
+local void gf2_matrix_square(square, mat)
+ unsigned long *square;
+ unsigned long *mat;
+{
+ int n;
+
+ for (n = 0; n < GF2_DIM; n++)
+ square[n] = gf2_matrix_times(mat, mat[n]);
+}
+
+/* ========================================================================= */
+local uLong crc32_combine_(crc1, crc2, len2)
+ uLong crc1;
+ uLong crc2;
+ z_off64_t len2;
+{
+ int n;
+ unsigned long row;
+ unsigned long even[GF2_DIM]; /* even-power-of-two zeros operator */
+ unsigned long odd[GF2_DIM]; /* odd-power-of-two zeros operator */
+
+ /* degenerate case (also disallow negative lengths) */
+ if (len2 <= 0)
+ return crc1;
+
+ /* put operator for one zero bit in odd */
+ odd[0] = 0xedb88320UL; /* CRC-32 polynomial */
+ row = 1;
+ for (n = 1; n < GF2_DIM; n++) {
+ odd[n] = row;
+ row <<= 1;
+ }
+
+ /* put operator for two zero bits in even */
+ gf2_matrix_square(even, odd);
+
+ /* put operator for four zero bits in odd */
+ gf2_matrix_square(odd, even);
+
+ /* apply len2 zeros to crc1 (first square will put the operator for one
+ zero byte, eight zero bits, in even) */
+ do {
+ /* apply zeros operator for this bit of len2 */
+ gf2_matrix_square(even, odd);
+ if (len2 & 1)
+ crc1 = gf2_matrix_times(even, crc1);
+ len2 >>= 1;
+
+ /* if no more bits set, then done */
+ if (len2 == 0)
+ break;
+
+ /* another iteration of the loop with odd and even swapped */
+ gf2_matrix_square(odd, even);
+ if (len2 & 1)
+ crc1 = gf2_matrix_times(odd, crc1);
+ len2 >>= 1;
+
+ /* if no more bits set, then done */
+ } while (len2 != 0);
+
+ /* return combined crc */
+ crc1 ^= crc2;
+ return crc1;
+}
+
+/* ========================================================================= */
+uLong ZEXPORT crc32_combine(crc1, crc2, len2)
+ uLong crc1;
+ uLong crc2;
+ z_off_t len2;
+{
+ return crc32_combine_(crc1, crc2, len2);
+}
+
+uLong ZEXPORT crc32_combine64(crc1, crc2, len2)
+ uLong crc1;
+ uLong crc2;
+ z_off64_t len2;
+{
+ return crc32_combine_(crc1, crc2, len2);
+}
diff --git a/protocols/Telegram/tgl/zlib/crc32.h b/protocols/Telegram/tgl/zlib/crc32.h
new file mode 100644
index 0000000000..9e0c778102
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/crc32.h
@@ -0,0 +1,441 @@
+/* crc32.h -- tables for rapid CRC calculation
+ * Generated automatically by crc32.c
+ */
+
+local const z_crc_t FAR crc_table[TBLS][256] =
+{
+ {
+ 0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL,
+ 0x706af48fUL, 0xe963a535UL, 0x9e6495a3UL, 0x0edb8832UL, 0x79dcb8a4UL,
+ 0xe0d5e91eUL, 0x97d2d988UL, 0x09b64c2bUL, 0x7eb17cbdUL, 0xe7b82d07UL,
+ 0x90bf1d91UL, 0x1db71064UL, 0x6ab020f2UL, 0xf3b97148UL, 0x84be41deUL,
+ 0x1adad47dUL, 0x6ddde4ebUL, 0xf4d4b551UL, 0x83d385c7UL, 0x136c9856UL,
+ 0x646ba8c0UL, 0xfd62f97aUL, 0x8a65c9ecUL, 0x14015c4fUL, 0x63066cd9UL,
+ 0xfa0f3d63UL, 0x8d080df5UL, 0x3b6e20c8UL, 0x4c69105eUL, 0xd56041e4UL,
+ 0xa2677172UL, 0x3c03e4d1UL, 0x4b04d447UL, 0xd20d85fdUL, 0xa50ab56bUL,
+ 0x35b5a8faUL, 0x42b2986cUL, 0xdbbbc9d6UL, 0xacbcf940UL, 0x32d86ce3UL,
+ 0x45df5c75UL, 0xdcd60dcfUL, 0xabd13d59UL, 0x26d930acUL, 0x51de003aUL,
+ 0xc8d75180UL, 0xbfd06116UL, 0x21b4f4b5UL, 0x56b3c423UL, 0xcfba9599UL,
+ 0xb8bda50fUL, 0x2802b89eUL, 0x5f058808UL, 0xc60cd9b2UL, 0xb10be924UL,
+ 0x2f6f7c87UL, 0x58684c11UL, 0xc1611dabUL, 0xb6662d3dUL, 0x76dc4190UL,
+ 0x01db7106UL, 0x98d220bcUL, 0xefd5102aUL, 0x71b18589UL, 0x06b6b51fUL,
+ 0x9fbfe4a5UL, 0xe8b8d433UL, 0x7807c9a2UL, 0x0f00f934UL, 0x9609a88eUL,
+ 0xe10e9818UL, 0x7f6a0dbbUL, 0x086d3d2dUL, 0x91646c97UL, 0xe6635c01UL,
+ 0x6b6b51f4UL, 0x1c6c6162UL, 0x856530d8UL, 0xf262004eUL, 0x6c0695edUL,
+ 0x1b01a57bUL, 0x8208f4c1UL, 0xf50fc457UL, 0x65b0d9c6UL, 0x12b7e950UL,
+ 0x8bbeb8eaUL, 0xfcb9887cUL, 0x62dd1ddfUL, 0x15da2d49UL, 0x8cd37cf3UL,
+ 0xfbd44c65UL, 0x4db26158UL, 0x3ab551ceUL, 0xa3bc0074UL, 0xd4bb30e2UL,
+ 0x4adfa541UL, 0x3dd895d7UL, 0xa4d1c46dUL, 0xd3d6f4fbUL, 0x4369e96aUL,
+ 0x346ed9fcUL, 0xad678846UL, 0xda60b8d0UL, 0x44042d73UL, 0x33031de5UL,
+ 0xaa0a4c5fUL, 0xdd0d7cc9UL, 0x5005713cUL, 0x270241aaUL, 0xbe0b1010UL,
+ 0xc90c2086UL, 0x5768b525UL, 0x206f85b3UL, 0xb966d409UL, 0xce61e49fUL,
+ 0x5edef90eUL, 0x29d9c998UL, 0xb0d09822UL, 0xc7d7a8b4UL, 0x59b33d17UL,
+ 0x2eb40d81UL, 0xb7bd5c3bUL, 0xc0ba6cadUL, 0xedb88320UL, 0x9abfb3b6UL,
+ 0x03b6e20cUL, 0x74b1d29aUL, 0xead54739UL, 0x9dd277afUL, 0x04db2615UL,
+ 0x73dc1683UL, 0xe3630b12UL, 0x94643b84UL, 0x0d6d6a3eUL, 0x7a6a5aa8UL,
+ 0xe40ecf0bUL, 0x9309ff9dUL, 0x0a00ae27UL, 0x7d079eb1UL, 0xf00f9344UL,
+ 0x8708a3d2UL, 0x1e01f268UL, 0x6906c2feUL, 0xf762575dUL, 0x806567cbUL,
+ 0x196c3671UL, 0x6e6b06e7UL, 0xfed41b76UL, 0x89d32be0UL, 0x10da7a5aUL,
+ 0x67dd4accUL, 0xf9b9df6fUL, 0x8ebeeff9UL, 0x17b7be43UL, 0x60b08ed5UL,
+ 0xd6d6a3e8UL, 0xa1d1937eUL, 0x38d8c2c4UL, 0x4fdff252UL, 0xd1bb67f1UL,
+ 0xa6bc5767UL, 0x3fb506ddUL, 0x48b2364bUL, 0xd80d2bdaUL, 0xaf0a1b4cUL,
+ 0x36034af6UL, 0x41047a60UL, 0xdf60efc3UL, 0xa867df55UL, 0x316e8eefUL,
+ 0x4669be79UL, 0xcb61b38cUL, 0xbc66831aUL, 0x256fd2a0UL, 0x5268e236UL,
+ 0xcc0c7795UL, 0xbb0b4703UL, 0x220216b9UL, 0x5505262fUL, 0xc5ba3bbeUL,
+ 0xb2bd0b28UL, 0x2bb45a92UL, 0x5cb36a04UL, 0xc2d7ffa7UL, 0xb5d0cf31UL,
+ 0x2cd99e8bUL, 0x5bdeae1dUL, 0x9b64c2b0UL, 0xec63f226UL, 0x756aa39cUL,
+ 0x026d930aUL, 0x9c0906a9UL, 0xeb0e363fUL, 0x72076785UL, 0x05005713UL,
+ 0x95bf4a82UL, 0xe2b87a14UL, 0x7bb12baeUL, 0x0cb61b38UL, 0x92d28e9bUL,
+ 0xe5d5be0dUL, 0x7cdcefb7UL, 0x0bdbdf21UL, 0x86d3d2d4UL, 0xf1d4e242UL,
+ 0x68ddb3f8UL, 0x1fda836eUL, 0x81be16cdUL, 0xf6b9265bUL, 0x6fb077e1UL,
+ 0x18b74777UL, 0x88085ae6UL, 0xff0f6a70UL, 0x66063bcaUL, 0x11010b5cUL,
+ 0x8f659effUL, 0xf862ae69UL, 0x616bffd3UL, 0x166ccf45UL, 0xa00ae278UL,
+ 0xd70dd2eeUL, 0x4e048354UL, 0x3903b3c2UL, 0xa7672661UL, 0xd06016f7UL,
+ 0x4969474dUL, 0x3e6e77dbUL, 0xaed16a4aUL, 0xd9d65adcUL, 0x40df0b66UL,
+ 0x37d83bf0UL, 0xa9bcae53UL, 0xdebb9ec5UL, 0x47b2cf7fUL, 0x30b5ffe9UL,
+ 0xbdbdf21cUL, 0xcabac28aUL, 0x53b39330UL, 0x24b4a3a6UL, 0xbad03605UL,
+ 0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL,
+ 0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL,
+ 0x2d02ef8dUL
+#ifdef BYFOUR
+ },
+ {
+ 0x00000000UL, 0x191b3141UL, 0x32366282UL, 0x2b2d53c3UL, 0x646cc504UL,
+ 0x7d77f445UL, 0x565aa786UL, 0x4f4196c7UL, 0xc8d98a08UL, 0xd1c2bb49UL,
+ 0xfaefe88aUL, 0xe3f4d9cbUL, 0xacb54f0cUL, 0xb5ae7e4dUL, 0x9e832d8eUL,
+ 0x87981ccfUL, 0x4ac21251UL, 0x53d92310UL, 0x78f470d3UL, 0x61ef4192UL,
+ 0x2eaed755UL, 0x37b5e614UL, 0x1c98b5d7UL, 0x05838496UL, 0x821b9859UL,
+ 0x9b00a918UL, 0xb02dfadbUL, 0xa936cb9aUL, 0xe6775d5dUL, 0xff6c6c1cUL,
+ 0xd4413fdfUL, 0xcd5a0e9eUL, 0x958424a2UL, 0x8c9f15e3UL, 0xa7b24620UL,
+ 0xbea97761UL, 0xf1e8e1a6UL, 0xe8f3d0e7UL, 0xc3de8324UL, 0xdac5b265UL,
+ 0x5d5daeaaUL, 0x44469febUL, 0x6f6bcc28UL, 0x7670fd69UL, 0x39316baeUL,
+ 0x202a5aefUL, 0x0b07092cUL, 0x121c386dUL, 0xdf4636f3UL, 0xc65d07b2UL,
+ 0xed705471UL, 0xf46b6530UL, 0xbb2af3f7UL, 0xa231c2b6UL, 0x891c9175UL,
+ 0x9007a034UL, 0x179fbcfbUL, 0x0e848dbaUL, 0x25a9de79UL, 0x3cb2ef38UL,
+ 0x73f379ffUL, 0x6ae848beUL, 0x41c51b7dUL, 0x58de2a3cUL, 0xf0794f05UL,
+ 0xe9627e44UL, 0xc24f2d87UL, 0xdb541cc6UL, 0x94158a01UL, 0x8d0ebb40UL,
+ 0xa623e883UL, 0xbf38d9c2UL, 0x38a0c50dUL, 0x21bbf44cUL, 0x0a96a78fUL,
+ 0x138d96ceUL, 0x5ccc0009UL, 0x45d73148UL, 0x6efa628bUL, 0x77e153caUL,
+ 0xbabb5d54UL, 0xa3a06c15UL, 0x888d3fd6UL, 0x91960e97UL, 0xded79850UL,
+ 0xc7cca911UL, 0xece1fad2UL, 0xf5facb93UL, 0x7262d75cUL, 0x6b79e61dUL,
+ 0x4054b5deUL, 0x594f849fUL, 0x160e1258UL, 0x0f152319UL, 0x243870daUL,
+ 0x3d23419bUL, 0x65fd6ba7UL, 0x7ce65ae6UL, 0x57cb0925UL, 0x4ed03864UL,
+ 0x0191aea3UL, 0x188a9fe2UL, 0x33a7cc21UL, 0x2abcfd60UL, 0xad24e1afUL,
+ 0xb43fd0eeUL, 0x9f12832dUL, 0x8609b26cUL, 0xc94824abUL, 0xd05315eaUL,
+ 0xfb7e4629UL, 0xe2657768UL, 0x2f3f79f6UL, 0x362448b7UL, 0x1d091b74UL,
+ 0x04122a35UL, 0x4b53bcf2UL, 0x52488db3UL, 0x7965de70UL, 0x607eef31UL,
+ 0xe7e6f3feUL, 0xfefdc2bfUL, 0xd5d0917cUL, 0xcccba03dUL, 0x838a36faUL,
+ 0x9a9107bbUL, 0xb1bc5478UL, 0xa8a76539UL, 0x3b83984bUL, 0x2298a90aUL,
+ 0x09b5fac9UL, 0x10aecb88UL, 0x5fef5d4fUL, 0x46f46c0eUL, 0x6dd93fcdUL,
+ 0x74c20e8cUL, 0xf35a1243UL, 0xea412302UL, 0xc16c70c1UL, 0xd8774180UL,
+ 0x9736d747UL, 0x8e2de606UL, 0xa500b5c5UL, 0xbc1b8484UL, 0x71418a1aUL,
+ 0x685abb5bUL, 0x4377e898UL, 0x5a6cd9d9UL, 0x152d4f1eUL, 0x0c367e5fUL,
+ 0x271b2d9cUL, 0x3e001cddUL, 0xb9980012UL, 0xa0833153UL, 0x8bae6290UL,
+ 0x92b553d1UL, 0xddf4c516UL, 0xc4eff457UL, 0xefc2a794UL, 0xf6d996d5UL,
+ 0xae07bce9UL, 0xb71c8da8UL, 0x9c31de6bUL, 0x852aef2aUL, 0xca6b79edUL,
+ 0xd37048acUL, 0xf85d1b6fUL, 0xe1462a2eUL, 0x66de36e1UL, 0x7fc507a0UL,
+ 0x54e85463UL, 0x4df36522UL, 0x02b2f3e5UL, 0x1ba9c2a4UL, 0x30849167UL,
+ 0x299fa026UL, 0xe4c5aeb8UL, 0xfdde9ff9UL, 0xd6f3cc3aUL, 0xcfe8fd7bUL,
+ 0x80a96bbcUL, 0x99b25afdUL, 0xb29f093eUL, 0xab84387fUL, 0x2c1c24b0UL,
+ 0x350715f1UL, 0x1e2a4632UL, 0x07317773UL, 0x4870e1b4UL, 0x516bd0f5UL,
+ 0x7a468336UL, 0x635db277UL, 0xcbfad74eUL, 0xd2e1e60fUL, 0xf9ccb5ccUL,
+ 0xe0d7848dUL, 0xaf96124aUL, 0xb68d230bUL, 0x9da070c8UL, 0x84bb4189UL,
+ 0x03235d46UL, 0x1a386c07UL, 0x31153fc4UL, 0x280e0e85UL, 0x674f9842UL,
+ 0x7e54a903UL, 0x5579fac0UL, 0x4c62cb81UL, 0x8138c51fUL, 0x9823f45eUL,
+ 0xb30ea79dUL, 0xaa1596dcUL, 0xe554001bUL, 0xfc4f315aUL, 0xd7626299UL,
+ 0xce7953d8UL, 0x49e14f17UL, 0x50fa7e56UL, 0x7bd72d95UL, 0x62cc1cd4UL,
+ 0x2d8d8a13UL, 0x3496bb52UL, 0x1fbbe891UL, 0x06a0d9d0UL, 0x5e7ef3ecUL,
+ 0x4765c2adUL, 0x6c48916eUL, 0x7553a02fUL, 0x3a1236e8UL, 0x230907a9UL,
+ 0x0824546aUL, 0x113f652bUL, 0x96a779e4UL, 0x8fbc48a5UL, 0xa4911b66UL,
+ 0xbd8a2a27UL, 0xf2cbbce0UL, 0xebd08da1UL, 0xc0fdde62UL, 0xd9e6ef23UL,
+ 0x14bce1bdUL, 0x0da7d0fcUL, 0x268a833fUL, 0x3f91b27eUL, 0x70d024b9UL,
+ 0x69cb15f8UL, 0x42e6463bUL, 0x5bfd777aUL, 0xdc656bb5UL, 0xc57e5af4UL,
+ 0xee530937UL, 0xf7483876UL, 0xb809aeb1UL, 0xa1129ff0UL, 0x8a3fcc33UL,
+ 0x9324fd72UL
+ },
+ {
+ 0x00000000UL, 0x01c26a37UL, 0x0384d46eUL, 0x0246be59UL, 0x0709a8dcUL,
+ 0x06cbc2ebUL, 0x048d7cb2UL, 0x054f1685UL, 0x0e1351b8UL, 0x0fd13b8fUL,
+ 0x0d9785d6UL, 0x0c55efe1UL, 0x091af964UL, 0x08d89353UL, 0x0a9e2d0aUL,
+ 0x0b5c473dUL, 0x1c26a370UL, 0x1de4c947UL, 0x1fa2771eUL, 0x1e601d29UL,
+ 0x1b2f0bacUL, 0x1aed619bUL, 0x18abdfc2UL, 0x1969b5f5UL, 0x1235f2c8UL,
+ 0x13f798ffUL, 0x11b126a6UL, 0x10734c91UL, 0x153c5a14UL, 0x14fe3023UL,
+ 0x16b88e7aUL, 0x177ae44dUL, 0x384d46e0UL, 0x398f2cd7UL, 0x3bc9928eUL,
+ 0x3a0bf8b9UL, 0x3f44ee3cUL, 0x3e86840bUL, 0x3cc03a52UL, 0x3d025065UL,
+ 0x365e1758UL, 0x379c7d6fUL, 0x35dac336UL, 0x3418a901UL, 0x3157bf84UL,
+ 0x3095d5b3UL, 0x32d36beaUL, 0x331101ddUL, 0x246be590UL, 0x25a98fa7UL,
+ 0x27ef31feUL, 0x262d5bc9UL, 0x23624d4cUL, 0x22a0277bUL, 0x20e69922UL,
+ 0x2124f315UL, 0x2a78b428UL, 0x2bbade1fUL, 0x29fc6046UL, 0x283e0a71UL,
+ 0x2d711cf4UL, 0x2cb376c3UL, 0x2ef5c89aUL, 0x2f37a2adUL, 0x709a8dc0UL,
+ 0x7158e7f7UL, 0x731e59aeUL, 0x72dc3399UL, 0x7793251cUL, 0x76514f2bUL,
+ 0x7417f172UL, 0x75d59b45UL, 0x7e89dc78UL, 0x7f4bb64fUL, 0x7d0d0816UL,
+ 0x7ccf6221UL, 0x798074a4UL, 0x78421e93UL, 0x7a04a0caUL, 0x7bc6cafdUL,
+ 0x6cbc2eb0UL, 0x6d7e4487UL, 0x6f38fadeUL, 0x6efa90e9UL, 0x6bb5866cUL,
+ 0x6a77ec5bUL, 0x68315202UL, 0x69f33835UL, 0x62af7f08UL, 0x636d153fUL,
+ 0x612bab66UL, 0x60e9c151UL, 0x65a6d7d4UL, 0x6464bde3UL, 0x662203baUL,
+ 0x67e0698dUL, 0x48d7cb20UL, 0x4915a117UL, 0x4b531f4eUL, 0x4a917579UL,
+ 0x4fde63fcUL, 0x4e1c09cbUL, 0x4c5ab792UL, 0x4d98dda5UL, 0x46c49a98UL,
+ 0x4706f0afUL, 0x45404ef6UL, 0x448224c1UL, 0x41cd3244UL, 0x400f5873UL,
+ 0x4249e62aUL, 0x438b8c1dUL, 0x54f16850UL, 0x55330267UL, 0x5775bc3eUL,
+ 0x56b7d609UL, 0x53f8c08cUL, 0x523aaabbUL, 0x507c14e2UL, 0x51be7ed5UL,
+ 0x5ae239e8UL, 0x5b2053dfUL, 0x5966ed86UL, 0x58a487b1UL, 0x5deb9134UL,
+ 0x5c29fb03UL, 0x5e6f455aUL, 0x5fad2f6dUL, 0xe1351b80UL, 0xe0f771b7UL,
+ 0xe2b1cfeeUL, 0xe373a5d9UL, 0xe63cb35cUL, 0xe7fed96bUL, 0xe5b86732UL,
+ 0xe47a0d05UL, 0xef264a38UL, 0xeee4200fUL, 0xeca29e56UL, 0xed60f461UL,
+ 0xe82fe2e4UL, 0xe9ed88d3UL, 0xebab368aUL, 0xea695cbdUL, 0xfd13b8f0UL,
+ 0xfcd1d2c7UL, 0xfe976c9eUL, 0xff5506a9UL, 0xfa1a102cUL, 0xfbd87a1bUL,
+ 0xf99ec442UL, 0xf85cae75UL, 0xf300e948UL, 0xf2c2837fUL, 0xf0843d26UL,
+ 0xf1465711UL, 0xf4094194UL, 0xf5cb2ba3UL, 0xf78d95faUL, 0xf64fffcdUL,
+ 0xd9785d60UL, 0xd8ba3757UL, 0xdafc890eUL, 0xdb3ee339UL, 0xde71f5bcUL,
+ 0xdfb39f8bUL, 0xddf521d2UL, 0xdc374be5UL, 0xd76b0cd8UL, 0xd6a966efUL,
+ 0xd4efd8b6UL, 0xd52db281UL, 0xd062a404UL, 0xd1a0ce33UL, 0xd3e6706aUL,
+ 0xd2241a5dUL, 0xc55efe10UL, 0xc49c9427UL, 0xc6da2a7eUL, 0xc7184049UL,
+ 0xc25756ccUL, 0xc3953cfbUL, 0xc1d382a2UL, 0xc011e895UL, 0xcb4dafa8UL,
+ 0xca8fc59fUL, 0xc8c97bc6UL, 0xc90b11f1UL, 0xcc440774UL, 0xcd866d43UL,
+ 0xcfc0d31aUL, 0xce02b92dUL, 0x91af9640UL, 0x906dfc77UL, 0x922b422eUL,
+ 0x93e92819UL, 0x96a63e9cUL, 0x976454abUL, 0x9522eaf2UL, 0x94e080c5UL,
+ 0x9fbcc7f8UL, 0x9e7eadcfUL, 0x9c381396UL, 0x9dfa79a1UL, 0x98b56f24UL,
+ 0x99770513UL, 0x9b31bb4aUL, 0x9af3d17dUL, 0x8d893530UL, 0x8c4b5f07UL,
+ 0x8e0de15eUL, 0x8fcf8b69UL, 0x8a809decUL, 0x8b42f7dbUL, 0x89044982UL,
+ 0x88c623b5UL, 0x839a6488UL, 0x82580ebfUL, 0x801eb0e6UL, 0x81dcdad1UL,
+ 0x8493cc54UL, 0x8551a663UL, 0x8717183aUL, 0x86d5720dUL, 0xa9e2d0a0UL,
+ 0xa820ba97UL, 0xaa6604ceUL, 0xaba46ef9UL, 0xaeeb787cUL, 0xaf29124bUL,
+ 0xad6fac12UL, 0xacadc625UL, 0xa7f18118UL, 0xa633eb2fUL, 0xa4755576UL,
+ 0xa5b73f41UL, 0xa0f829c4UL, 0xa13a43f3UL, 0xa37cfdaaUL, 0xa2be979dUL,
+ 0xb5c473d0UL, 0xb40619e7UL, 0xb640a7beUL, 0xb782cd89UL, 0xb2cddb0cUL,
+ 0xb30fb13bUL, 0xb1490f62UL, 0xb08b6555UL, 0xbbd72268UL, 0xba15485fUL,
+ 0xb853f606UL, 0xb9919c31UL, 0xbcde8ab4UL, 0xbd1ce083UL, 0xbf5a5edaUL,
+ 0xbe9834edUL
+ },
+ {
+ 0x00000000UL, 0xb8bc6765UL, 0xaa09c88bUL, 0x12b5afeeUL, 0x8f629757UL,
+ 0x37def032UL, 0x256b5fdcUL, 0x9dd738b9UL, 0xc5b428efUL, 0x7d084f8aUL,
+ 0x6fbde064UL, 0xd7018701UL, 0x4ad6bfb8UL, 0xf26ad8ddUL, 0xe0df7733UL,
+ 0x58631056UL, 0x5019579fUL, 0xe8a530faUL, 0xfa109f14UL, 0x42acf871UL,
+ 0xdf7bc0c8UL, 0x67c7a7adUL, 0x75720843UL, 0xcdce6f26UL, 0x95ad7f70UL,
+ 0x2d111815UL, 0x3fa4b7fbUL, 0x8718d09eUL, 0x1acfe827UL, 0xa2738f42UL,
+ 0xb0c620acUL, 0x087a47c9UL, 0xa032af3eUL, 0x188ec85bUL, 0x0a3b67b5UL,
+ 0xb28700d0UL, 0x2f503869UL, 0x97ec5f0cUL, 0x8559f0e2UL, 0x3de59787UL,
+ 0x658687d1UL, 0xdd3ae0b4UL, 0xcf8f4f5aUL, 0x7733283fUL, 0xeae41086UL,
+ 0x525877e3UL, 0x40edd80dUL, 0xf851bf68UL, 0xf02bf8a1UL, 0x48979fc4UL,
+ 0x5a22302aUL, 0xe29e574fUL, 0x7f496ff6UL, 0xc7f50893UL, 0xd540a77dUL,
+ 0x6dfcc018UL, 0x359fd04eUL, 0x8d23b72bUL, 0x9f9618c5UL, 0x272a7fa0UL,
+ 0xbafd4719UL, 0x0241207cUL, 0x10f48f92UL, 0xa848e8f7UL, 0x9b14583dUL,
+ 0x23a83f58UL, 0x311d90b6UL, 0x89a1f7d3UL, 0x1476cf6aUL, 0xaccaa80fUL,
+ 0xbe7f07e1UL, 0x06c36084UL, 0x5ea070d2UL, 0xe61c17b7UL, 0xf4a9b859UL,
+ 0x4c15df3cUL, 0xd1c2e785UL, 0x697e80e0UL, 0x7bcb2f0eUL, 0xc377486bUL,
+ 0xcb0d0fa2UL, 0x73b168c7UL, 0x6104c729UL, 0xd9b8a04cUL, 0x446f98f5UL,
+ 0xfcd3ff90UL, 0xee66507eUL, 0x56da371bUL, 0x0eb9274dUL, 0xb6054028UL,
+ 0xa4b0efc6UL, 0x1c0c88a3UL, 0x81dbb01aUL, 0x3967d77fUL, 0x2bd27891UL,
+ 0x936e1ff4UL, 0x3b26f703UL, 0x839a9066UL, 0x912f3f88UL, 0x299358edUL,
+ 0xb4446054UL, 0x0cf80731UL, 0x1e4da8dfUL, 0xa6f1cfbaUL, 0xfe92dfecUL,
+ 0x462eb889UL, 0x549b1767UL, 0xec277002UL, 0x71f048bbUL, 0xc94c2fdeUL,
+ 0xdbf98030UL, 0x6345e755UL, 0x6b3fa09cUL, 0xd383c7f9UL, 0xc1366817UL,
+ 0x798a0f72UL, 0xe45d37cbUL, 0x5ce150aeUL, 0x4e54ff40UL, 0xf6e89825UL,
+ 0xae8b8873UL, 0x1637ef16UL, 0x048240f8UL, 0xbc3e279dUL, 0x21e91f24UL,
+ 0x99557841UL, 0x8be0d7afUL, 0x335cb0caUL, 0xed59b63bUL, 0x55e5d15eUL,
+ 0x47507eb0UL, 0xffec19d5UL, 0x623b216cUL, 0xda874609UL, 0xc832e9e7UL,
+ 0x708e8e82UL, 0x28ed9ed4UL, 0x9051f9b1UL, 0x82e4565fUL, 0x3a58313aUL,
+ 0xa78f0983UL, 0x1f336ee6UL, 0x0d86c108UL, 0xb53aa66dUL, 0xbd40e1a4UL,
+ 0x05fc86c1UL, 0x1749292fUL, 0xaff54e4aUL, 0x322276f3UL, 0x8a9e1196UL,
+ 0x982bbe78UL, 0x2097d91dUL, 0x78f4c94bUL, 0xc048ae2eUL, 0xd2fd01c0UL,
+ 0x6a4166a5UL, 0xf7965e1cUL, 0x4f2a3979UL, 0x5d9f9697UL, 0xe523f1f2UL,
+ 0x4d6b1905UL, 0xf5d77e60UL, 0xe762d18eUL, 0x5fdeb6ebUL, 0xc2098e52UL,
+ 0x7ab5e937UL, 0x680046d9UL, 0xd0bc21bcUL, 0x88df31eaUL, 0x3063568fUL,
+ 0x22d6f961UL, 0x9a6a9e04UL, 0x07bda6bdUL, 0xbf01c1d8UL, 0xadb46e36UL,
+ 0x15080953UL, 0x1d724e9aUL, 0xa5ce29ffUL, 0xb77b8611UL, 0x0fc7e174UL,
+ 0x9210d9cdUL, 0x2aacbea8UL, 0x38191146UL, 0x80a57623UL, 0xd8c66675UL,
+ 0x607a0110UL, 0x72cfaefeUL, 0xca73c99bUL, 0x57a4f122UL, 0xef189647UL,
+ 0xfdad39a9UL, 0x45115eccUL, 0x764dee06UL, 0xcef18963UL, 0xdc44268dUL,
+ 0x64f841e8UL, 0xf92f7951UL, 0x41931e34UL, 0x5326b1daUL, 0xeb9ad6bfUL,
+ 0xb3f9c6e9UL, 0x0b45a18cUL, 0x19f00e62UL, 0xa14c6907UL, 0x3c9b51beUL,
+ 0x842736dbUL, 0x96929935UL, 0x2e2efe50UL, 0x2654b999UL, 0x9ee8defcUL,
+ 0x8c5d7112UL, 0x34e11677UL, 0xa9362eceUL, 0x118a49abUL, 0x033fe645UL,
+ 0xbb838120UL, 0xe3e09176UL, 0x5b5cf613UL, 0x49e959fdUL, 0xf1553e98UL,
+ 0x6c820621UL, 0xd43e6144UL, 0xc68bceaaUL, 0x7e37a9cfUL, 0xd67f4138UL,
+ 0x6ec3265dUL, 0x7c7689b3UL, 0xc4caeed6UL, 0x591dd66fUL, 0xe1a1b10aUL,
+ 0xf3141ee4UL, 0x4ba87981UL, 0x13cb69d7UL, 0xab770eb2UL, 0xb9c2a15cUL,
+ 0x017ec639UL, 0x9ca9fe80UL, 0x241599e5UL, 0x36a0360bUL, 0x8e1c516eUL,
+ 0x866616a7UL, 0x3eda71c2UL, 0x2c6fde2cUL, 0x94d3b949UL, 0x090481f0UL,
+ 0xb1b8e695UL, 0xa30d497bUL, 0x1bb12e1eUL, 0x43d23e48UL, 0xfb6e592dUL,
+ 0xe9dbf6c3UL, 0x516791a6UL, 0xccb0a91fUL, 0x740cce7aUL, 0x66b96194UL,
+ 0xde0506f1UL
+ },
+ {
+ 0x00000000UL, 0x96300777UL, 0x2c610eeeUL, 0xba510999UL, 0x19c46d07UL,
+ 0x8ff46a70UL, 0x35a563e9UL, 0xa395649eUL, 0x3288db0eUL, 0xa4b8dc79UL,
+ 0x1ee9d5e0UL, 0x88d9d297UL, 0x2b4cb609UL, 0xbd7cb17eUL, 0x072db8e7UL,
+ 0x911dbf90UL, 0x6410b71dUL, 0xf220b06aUL, 0x4871b9f3UL, 0xde41be84UL,
+ 0x7dd4da1aUL, 0xebe4dd6dUL, 0x51b5d4f4UL, 0xc785d383UL, 0x56986c13UL,
+ 0xc0a86b64UL, 0x7af962fdUL, 0xecc9658aUL, 0x4f5c0114UL, 0xd96c0663UL,
+ 0x633d0ffaUL, 0xf50d088dUL, 0xc8206e3bUL, 0x5e10694cUL, 0xe44160d5UL,
+ 0x727167a2UL, 0xd1e4033cUL, 0x47d4044bUL, 0xfd850dd2UL, 0x6bb50aa5UL,
+ 0xfaa8b535UL, 0x6c98b242UL, 0xd6c9bbdbUL, 0x40f9bcacUL, 0xe36cd832UL,
+ 0x755cdf45UL, 0xcf0dd6dcUL, 0x593dd1abUL, 0xac30d926UL, 0x3a00de51UL,
+ 0x8051d7c8UL, 0x1661d0bfUL, 0xb5f4b421UL, 0x23c4b356UL, 0x9995bacfUL,
+ 0x0fa5bdb8UL, 0x9eb80228UL, 0x0888055fUL, 0xb2d90cc6UL, 0x24e90bb1UL,
+ 0x877c6f2fUL, 0x114c6858UL, 0xab1d61c1UL, 0x3d2d66b6UL, 0x9041dc76UL,
+ 0x0671db01UL, 0xbc20d298UL, 0x2a10d5efUL, 0x8985b171UL, 0x1fb5b606UL,
+ 0xa5e4bf9fUL, 0x33d4b8e8UL, 0xa2c90778UL, 0x34f9000fUL, 0x8ea80996UL,
+ 0x18980ee1UL, 0xbb0d6a7fUL, 0x2d3d6d08UL, 0x976c6491UL, 0x015c63e6UL,
+ 0xf4516b6bUL, 0x62616c1cUL, 0xd8306585UL, 0x4e0062f2UL, 0xed95066cUL,
+ 0x7ba5011bUL, 0xc1f40882UL, 0x57c40ff5UL, 0xc6d9b065UL, 0x50e9b712UL,
+ 0xeab8be8bUL, 0x7c88b9fcUL, 0xdf1ddd62UL, 0x492dda15UL, 0xf37cd38cUL,
+ 0x654cd4fbUL, 0x5861b24dUL, 0xce51b53aUL, 0x7400bca3UL, 0xe230bbd4UL,
+ 0x41a5df4aUL, 0xd795d83dUL, 0x6dc4d1a4UL, 0xfbf4d6d3UL, 0x6ae96943UL,
+ 0xfcd96e34UL, 0x468867adUL, 0xd0b860daUL, 0x732d0444UL, 0xe51d0333UL,
+ 0x5f4c0aaaUL, 0xc97c0dddUL, 0x3c710550UL, 0xaa410227UL, 0x10100bbeUL,
+ 0x86200cc9UL, 0x25b56857UL, 0xb3856f20UL, 0x09d466b9UL, 0x9fe461ceUL,
+ 0x0ef9de5eUL, 0x98c9d929UL, 0x2298d0b0UL, 0xb4a8d7c7UL, 0x173db359UL,
+ 0x810db42eUL, 0x3b5cbdb7UL, 0xad6cbac0UL, 0x2083b8edUL, 0xb6b3bf9aUL,
+ 0x0ce2b603UL, 0x9ad2b174UL, 0x3947d5eaUL, 0xaf77d29dUL, 0x1526db04UL,
+ 0x8316dc73UL, 0x120b63e3UL, 0x843b6494UL, 0x3e6a6d0dUL, 0xa85a6a7aUL,
+ 0x0bcf0ee4UL, 0x9dff0993UL, 0x27ae000aUL, 0xb19e077dUL, 0x44930ff0UL,
+ 0xd2a30887UL, 0x68f2011eUL, 0xfec20669UL, 0x5d5762f7UL, 0xcb676580UL,
+ 0x71366c19UL, 0xe7066b6eUL, 0x761bd4feUL, 0xe02bd389UL, 0x5a7ada10UL,
+ 0xcc4add67UL, 0x6fdfb9f9UL, 0xf9efbe8eUL, 0x43beb717UL, 0xd58eb060UL,
+ 0xe8a3d6d6UL, 0x7e93d1a1UL, 0xc4c2d838UL, 0x52f2df4fUL, 0xf167bbd1UL,
+ 0x6757bca6UL, 0xdd06b53fUL, 0x4b36b248UL, 0xda2b0dd8UL, 0x4c1b0aafUL,
+ 0xf64a0336UL, 0x607a0441UL, 0xc3ef60dfUL, 0x55df67a8UL, 0xef8e6e31UL,
+ 0x79be6946UL, 0x8cb361cbUL, 0x1a8366bcUL, 0xa0d26f25UL, 0x36e26852UL,
+ 0x95770cccUL, 0x03470bbbUL, 0xb9160222UL, 0x2f260555UL, 0xbe3bbac5UL,
+ 0x280bbdb2UL, 0x925ab42bUL, 0x046ab35cUL, 0xa7ffd7c2UL, 0x31cfd0b5UL,
+ 0x8b9ed92cUL, 0x1daede5bUL, 0xb0c2649bUL, 0x26f263ecUL, 0x9ca36a75UL,
+ 0x0a936d02UL, 0xa906099cUL, 0x3f360eebUL, 0x85670772UL, 0x13570005UL,
+ 0x824abf95UL, 0x147ab8e2UL, 0xae2bb17bUL, 0x381bb60cUL, 0x9b8ed292UL,
+ 0x0dbed5e5UL, 0xb7efdc7cUL, 0x21dfdb0bUL, 0xd4d2d386UL, 0x42e2d4f1UL,
+ 0xf8b3dd68UL, 0x6e83da1fUL, 0xcd16be81UL, 0x5b26b9f6UL, 0xe177b06fUL,
+ 0x7747b718UL, 0xe65a0888UL, 0x706a0fffUL, 0xca3b0666UL, 0x5c0b0111UL,
+ 0xff9e658fUL, 0x69ae62f8UL, 0xd3ff6b61UL, 0x45cf6c16UL, 0x78e20aa0UL,
+ 0xeed20dd7UL, 0x5483044eUL, 0xc2b30339UL, 0x612667a7UL, 0xf71660d0UL,
+ 0x4d476949UL, 0xdb776e3eUL, 0x4a6ad1aeUL, 0xdc5ad6d9UL, 0x660bdf40UL,
+ 0xf03bd837UL, 0x53aebca9UL, 0xc59ebbdeUL, 0x7fcfb247UL, 0xe9ffb530UL,
+ 0x1cf2bdbdUL, 0x8ac2bacaUL, 0x3093b353UL, 0xa6a3b424UL, 0x0536d0baUL,
+ 0x9306d7cdUL, 0x2957de54UL, 0xbf67d923UL, 0x2e7a66b3UL, 0xb84a61c4UL,
+ 0x021b685dUL, 0x942b6f2aUL, 0x37be0bb4UL, 0xa18e0cc3UL, 0x1bdf055aUL,
+ 0x8def022dUL
+ },
+ {
+ 0x00000000UL, 0x41311b19UL, 0x82623632UL, 0xc3532d2bUL, 0x04c56c64UL,
+ 0x45f4777dUL, 0x86a75a56UL, 0xc796414fUL, 0x088ad9c8UL, 0x49bbc2d1UL,
+ 0x8ae8effaUL, 0xcbd9f4e3UL, 0x0c4fb5acUL, 0x4d7eaeb5UL, 0x8e2d839eUL,
+ 0xcf1c9887UL, 0x5112c24aUL, 0x1023d953UL, 0xd370f478UL, 0x9241ef61UL,
+ 0x55d7ae2eUL, 0x14e6b537UL, 0xd7b5981cUL, 0x96848305UL, 0x59981b82UL,
+ 0x18a9009bUL, 0xdbfa2db0UL, 0x9acb36a9UL, 0x5d5d77e6UL, 0x1c6c6cffUL,
+ 0xdf3f41d4UL, 0x9e0e5acdUL, 0xa2248495UL, 0xe3159f8cUL, 0x2046b2a7UL,
+ 0x6177a9beUL, 0xa6e1e8f1UL, 0xe7d0f3e8UL, 0x2483dec3UL, 0x65b2c5daUL,
+ 0xaaae5d5dUL, 0xeb9f4644UL, 0x28cc6b6fUL, 0x69fd7076UL, 0xae6b3139UL,
+ 0xef5a2a20UL, 0x2c09070bUL, 0x6d381c12UL, 0xf33646dfUL, 0xb2075dc6UL,
+ 0x715470edUL, 0x30656bf4UL, 0xf7f32abbUL, 0xb6c231a2UL, 0x75911c89UL,
+ 0x34a00790UL, 0xfbbc9f17UL, 0xba8d840eUL, 0x79dea925UL, 0x38efb23cUL,
+ 0xff79f373UL, 0xbe48e86aUL, 0x7d1bc541UL, 0x3c2ade58UL, 0x054f79f0UL,
+ 0x447e62e9UL, 0x872d4fc2UL, 0xc61c54dbUL, 0x018a1594UL, 0x40bb0e8dUL,
+ 0x83e823a6UL, 0xc2d938bfUL, 0x0dc5a038UL, 0x4cf4bb21UL, 0x8fa7960aUL,
+ 0xce968d13UL, 0x0900cc5cUL, 0x4831d745UL, 0x8b62fa6eUL, 0xca53e177UL,
+ 0x545dbbbaUL, 0x156ca0a3UL, 0xd63f8d88UL, 0x970e9691UL, 0x5098d7deUL,
+ 0x11a9ccc7UL, 0xd2fae1ecUL, 0x93cbfaf5UL, 0x5cd76272UL, 0x1de6796bUL,
+ 0xdeb55440UL, 0x9f844f59UL, 0x58120e16UL, 0x1923150fUL, 0xda703824UL,
+ 0x9b41233dUL, 0xa76bfd65UL, 0xe65ae67cUL, 0x2509cb57UL, 0x6438d04eUL,
+ 0xa3ae9101UL, 0xe29f8a18UL, 0x21cca733UL, 0x60fdbc2aUL, 0xafe124adUL,
+ 0xeed03fb4UL, 0x2d83129fUL, 0x6cb20986UL, 0xab2448c9UL, 0xea1553d0UL,
+ 0x29467efbUL, 0x687765e2UL, 0xf6793f2fUL, 0xb7482436UL, 0x741b091dUL,
+ 0x352a1204UL, 0xf2bc534bUL, 0xb38d4852UL, 0x70de6579UL, 0x31ef7e60UL,
+ 0xfef3e6e7UL, 0xbfc2fdfeUL, 0x7c91d0d5UL, 0x3da0cbccUL, 0xfa368a83UL,
+ 0xbb07919aUL, 0x7854bcb1UL, 0x3965a7a8UL, 0x4b98833bUL, 0x0aa99822UL,
+ 0xc9fab509UL, 0x88cbae10UL, 0x4f5def5fUL, 0x0e6cf446UL, 0xcd3fd96dUL,
+ 0x8c0ec274UL, 0x43125af3UL, 0x022341eaUL, 0xc1706cc1UL, 0x804177d8UL,
+ 0x47d73697UL, 0x06e62d8eUL, 0xc5b500a5UL, 0x84841bbcUL, 0x1a8a4171UL,
+ 0x5bbb5a68UL, 0x98e87743UL, 0xd9d96c5aUL, 0x1e4f2d15UL, 0x5f7e360cUL,
+ 0x9c2d1b27UL, 0xdd1c003eUL, 0x120098b9UL, 0x533183a0UL, 0x9062ae8bUL,
+ 0xd153b592UL, 0x16c5f4ddUL, 0x57f4efc4UL, 0x94a7c2efUL, 0xd596d9f6UL,
+ 0xe9bc07aeUL, 0xa88d1cb7UL, 0x6bde319cUL, 0x2aef2a85UL, 0xed796bcaUL,
+ 0xac4870d3UL, 0x6f1b5df8UL, 0x2e2a46e1UL, 0xe136de66UL, 0xa007c57fUL,
+ 0x6354e854UL, 0x2265f34dUL, 0xe5f3b202UL, 0xa4c2a91bUL, 0x67918430UL,
+ 0x26a09f29UL, 0xb8aec5e4UL, 0xf99fdefdUL, 0x3accf3d6UL, 0x7bfde8cfUL,
+ 0xbc6ba980UL, 0xfd5ab299UL, 0x3e099fb2UL, 0x7f3884abUL, 0xb0241c2cUL,
+ 0xf1150735UL, 0x32462a1eUL, 0x73773107UL, 0xb4e17048UL, 0xf5d06b51UL,
+ 0x3683467aUL, 0x77b25d63UL, 0x4ed7facbUL, 0x0fe6e1d2UL, 0xccb5ccf9UL,
+ 0x8d84d7e0UL, 0x4a1296afUL, 0x0b238db6UL, 0xc870a09dUL, 0x8941bb84UL,
+ 0x465d2303UL, 0x076c381aUL, 0xc43f1531UL, 0x850e0e28UL, 0x42984f67UL,
+ 0x03a9547eUL, 0xc0fa7955UL, 0x81cb624cUL, 0x1fc53881UL, 0x5ef42398UL,
+ 0x9da70eb3UL, 0xdc9615aaUL, 0x1b0054e5UL, 0x5a314ffcUL, 0x996262d7UL,
+ 0xd85379ceUL, 0x174fe149UL, 0x567efa50UL, 0x952dd77bUL, 0xd41ccc62UL,
+ 0x138a8d2dUL, 0x52bb9634UL, 0x91e8bb1fUL, 0xd0d9a006UL, 0xecf37e5eUL,
+ 0xadc26547UL, 0x6e91486cUL, 0x2fa05375UL, 0xe836123aUL, 0xa9070923UL,
+ 0x6a542408UL, 0x2b653f11UL, 0xe479a796UL, 0xa548bc8fUL, 0x661b91a4UL,
+ 0x272a8abdUL, 0xe0bccbf2UL, 0xa18dd0ebUL, 0x62defdc0UL, 0x23efe6d9UL,
+ 0xbde1bc14UL, 0xfcd0a70dUL, 0x3f838a26UL, 0x7eb2913fUL, 0xb924d070UL,
+ 0xf815cb69UL, 0x3b46e642UL, 0x7a77fd5bUL, 0xb56b65dcUL, 0xf45a7ec5UL,
+ 0x370953eeUL, 0x763848f7UL, 0xb1ae09b8UL, 0xf09f12a1UL, 0x33cc3f8aUL,
+ 0x72fd2493UL
+ },
+ {
+ 0x00000000UL, 0x376ac201UL, 0x6ed48403UL, 0x59be4602UL, 0xdca80907UL,
+ 0xebc2cb06UL, 0xb27c8d04UL, 0x85164f05UL, 0xb851130eUL, 0x8f3bd10fUL,
+ 0xd685970dUL, 0xe1ef550cUL, 0x64f91a09UL, 0x5393d808UL, 0x0a2d9e0aUL,
+ 0x3d475c0bUL, 0x70a3261cUL, 0x47c9e41dUL, 0x1e77a21fUL, 0x291d601eUL,
+ 0xac0b2f1bUL, 0x9b61ed1aUL, 0xc2dfab18UL, 0xf5b56919UL, 0xc8f23512UL,
+ 0xff98f713UL, 0xa626b111UL, 0x914c7310UL, 0x145a3c15UL, 0x2330fe14UL,
+ 0x7a8eb816UL, 0x4de47a17UL, 0xe0464d38UL, 0xd72c8f39UL, 0x8e92c93bUL,
+ 0xb9f80b3aUL, 0x3cee443fUL, 0x0b84863eUL, 0x523ac03cUL, 0x6550023dUL,
+ 0x58175e36UL, 0x6f7d9c37UL, 0x36c3da35UL, 0x01a91834UL, 0x84bf5731UL,
+ 0xb3d59530UL, 0xea6bd332UL, 0xdd011133UL, 0x90e56b24UL, 0xa78fa925UL,
+ 0xfe31ef27UL, 0xc95b2d26UL, 0x4c4d6223UL, 0x7b27a022UL, 0x2299e620UL,
+ 0x15f32421UL, 0x28b4782aUL, 0x1fdeba2bUL, 0x4660fc29UL, 0x710a3e28UL,
+ 0xf41c712dUL, 0xc376b32cUL, 0x9ac8f52eUL, 0xada2372fUL, 0xc08d9a70UL,
+ 0xf7e75871UL, 0xae591e73UL, 0x9933dc72UL, 0x1c259377UL, 0x2b4f5176UL,
+ 0x72f11774UL, 0x459bd575UL, 0x78dc897eUL, 0x4fb64b7fUL, 0x16080d7dUL,
+ 0x2162cf7cUL, 0xa4748079UL, 0x931e4278UL, 0xcaa0047aUL, 0xfdcac67bUL,
+ 0xb02ebc6cUL, 0x87447e6dUL, 0xdefa386fUL, 0xe990fa6eUL, 0x6c86b56bUL,
+ 0x5bec776aUL, 0x02523168UL, 0x3538f369UL, 0x087faf62UL, 0x3f156d63UL,
+ 0x66ab2b61UL, 0x51c1e960UL, 0xd4d7a665UL, 0xe3bd6464UL, 0xba032266UL,
+ 0x8d69e067UL, 0x20cbd748UL, 0x17a11549UL, 0x4e1f534bUL, 0x7975914aUL,
+ 0xfc63de4fUL, 0xcb091c4eUL, 0x92b75a4cUL, 0xa5dd984dUL, 0x989ac446UL,
+ 0xaff00647UL, 0xf64e4045UL, 0xc1248244UL, 0x4432cd41UL, 0x73580f40UL,
+ 0x2ae64942UL, 0x1d8c8b43UL, 0x5068f154UL, 0x67023355UL, 0x3ebc7557UL,
+ 0x09d6b756UL, 0x8cc0f853UL, 0xbbaa3a52UL, 0xe2147c50UL, 0xd57ebe51UL,
+ 0xe839e25aUL, 0xdf53205bUL, 0x86ed6659UL, 0xb187a458UL, 0x3491eb5dUL,
+ 0x03fb295cUL, 0x5a456f5eUL, 0x6d2fad5fUL, 0x801b35e1UL, 0xb771f7e0UL,
+ 0xeecfb1e2UL, 0xd9a573e3UL, 0x5cb33ce6UL, 0x6bd9fee7UL, 0x3267b8e5UL,
+ 0x050d7ae4UL, 0x384a26efUL, 0x0f20e4eeUL, 0x569ea2ecUL, 0x61f460edUL,
+ 0xe4e22fe8UL, 0xd388ede9UL, 0x8a36abebUL, 0xbd5c69eaUL, 0xf0b813fdUL,
+ 0xc7d2d1fcUL, 0x9e6c97feUL, 0xa90655ffUL, 0x2c101afaUL, 0x1b7ad8fbUL,
+ 0x42c49ef9UL, 0x75ae5cf8UL, 0x48e900f3UL, 0x7f83c2f2UL, 0x263d84f0UL,
+ 0x115746f1UL, 0x944109f4UL, 0xa32bcbf5UL, 0xfa958df7UL, 0xcdff4ff6UL,
+ 0x605d78d9UL, 0x5737bad8UL, 0x0e89fcdaUL, 0x39e33edbUL, 0xbcf571deUL,
+ 0x8b9fb3dfUL, 0xd221f5ddUL, 0xe54b37dcUL, 0xd80c6bd7UL, 0xef66a9d6UL,
+ 0xb6d8efd4UL, 0x81b22dd5UL, 0x04a462d0UL, 0x33cea0d1UL, 0x6a70e6d3UL,
+ 0x5d1a24d2UL, 0x10fe5ec5UL, 0x27949cc4UL, 0x7e2adac6UL, 0x494018c7UL,
+ 0xcc5657c2UL, 0xfb3c95c3UL, 0xa282d3c1UL, 0x95e811c0UL, 0xa8af4dcbUL,
+ 0x9fc58fcaUL, 0xc67bc9c8UL, 0xf1110bc9UL, 0x740744ccUL, 0x436d86cdUL,
+ 0x1ad3c0cfUL, 0x2db902ceUL, 0x4096af91UL, 0x77fc6d90UL, 0x2e422b92UL,
+ 0x1928e993UL, 0x9c3ea696UL, 0xab546497UL, 0xf2ea2295UL, 0xc580e094UL,
+ 0xf8c7bc9fUL, 0xcfad7e9eUL, 0x9613389cUL, 0xa179fa9dUL, 0x246fb598UL,
+ 0x13057799UL, 0x4abb319bUL, 0x7dd1f39aUL, 0x3035898dUL, 0x075f4b8cUL,
+ 0x5ee10d8eUL, 0x698bcf8fUL, 0xec9d808aUL, 0xdbf7428bUL, 0x82490489UL,
+ 0xb523c688UL, 0x88649a83UL, 0xbf0e5882UL, 0xe6b01e80UL, 0xd1dadc81UL,
+ 0x54cc9384UL, 0x63a65185UL, 0x3a181787UL, 0x0d72d586UL, 0xa0d0e2a9UL,
+ 0x97ba20a8UL, 0xce0466aaUL, 0xf96ea4abUL, 0x7c78ebaeUL, 0x4b1229afUL,
+ 0x12ac6fadUL, 0x25c6adacUL, 0x1881f1a7UL, 0x2feb33a6UL, 0x765575a4UL,
+ 0x413fb7a5UL, 0xc429f8a0UL, 0xf3433aa1UL, 0xaafd7ca3UL, 0x9d97bea2UL,
+ 0xd073c4b5UL, 0xe71906b4UL, 0xbea740b6UL, 0x89cd82b7UL, 0x0cdbcdb2UL,
+ 0x3bb10fb3UL, 0x620f49b1UL, 0x55658bb0UL, 0x6822d7bbUL, 0x5f4815baUL,
+ 0x06f653b8UL, 0x319c91b9UL, 0xb48adebcUL, 0x83e01cbdUL, 0xda5e5abfUL,
+ 0xed3498beUL
+ },
+ {
+ 0x00000000UL, 0x6567bcb8UL, 0x8bc809aaUL, 0xeeafb512UL, 0x5797628fUL,
+ 0x32f0de37UL, 0xdc5f6b25UL, 0xb938d79dUL, 0xef28b4c5UL, 0x8a4f087dUL,
+ 0x64e0bd6fUL, 0x018701d7UL, 0xb8bfd64aUL, 0xddd86af2UL, 0x3377dfe0UL,
+ 0x56106358UL, 0x9f571950UL, 0xfa30a5e8UL, 0x149f10faUL, 0x71f8ac42UL,
+ 0xc8c07bdfUL, 0xada7c767UL, 0x43087275UL, 0x266fcecdUL, 0x707fad95UL,
+ 0x1518112dUL, 0xfbb7a43fUL, 0x9ed01887UL, 0x27e8cf1aUL, 0x428f73a2UL,
+ 0xac20c6b0UL, 0xc9477a08UL, 0x3eaf32a0UL, 0x5bc88e18UL, 0xb5673b0aUL,
+ 0xd00087b2UL, 0x6938502fUL, 0x0c5fec97UL, 0xe2f05985UL, 0x8797e53dUL,
+ 0xd1878665UL, 0xb4e03addUL, 0x5a4f8fcfUL, 0x3f283377UL, 0x8610e4eaUL,
+ 0xe3775852UL, 0x0dd8ed40UL, 0x68bf51f8UL, 0xa1f82bf0UL, 0xc49f9748UL,
+ 0x2a30225aUL, 0x4f579ee2UL, 0xf66f497fUL, 0x9308f5c7UL, 0x7da740d5UL,
+ 0x18c0fc6dUL, 0x4ed09f35UL, 0x2bb7238dUL, 0xc518969fUL, 0xa07f2a27UL,
+ 0x1947fdbaUL, 0x7c204102UL, 0x928ff410UL, 0xf7e848a8UL, 0x3d58149bUL,
+ 0x583fa823UL, 0xb6901d31UL, 0xd3f7a189UL, 0x6acf7614UL, 0x0fa8caacUL,
+ 0xe1077fbeUL, 0x8460c306UL, 0xd270a05eUL, 0xb7171ce6UL, 0x59b8a9f4UL,
+ 0x3cdf154cUL, 0x85e7c2d1UL, 0xe0807e69UL, 0x0e2fcb7bUL, 0x6b4877c3UL,
+ 0xa20f0dcbUL, 0xc768b173UL, 0x29c70461UL, 0x4ca0b8d9UL, 0xf5986f44UL,
+ 0x90ffd3fcUL, 0x7e5066eeUL, 0x1b37da56UL, 0x4d27b90eUL, 0x284005b6UL,
+ 0xc6efb0a4UL, 0xa3880c1cUL, 0x1ab0db81UL, 0x7fd76739UL, 0x9178d22bUL,
+ 0xf41f6e93UL, 0x03f7263bUL, 0x66909a83UL, 0x883f2f91UL, 0xed589329UL,
+ 0x546044b4UL, 0x3107f80cUL, 0xdfa84d1eUL, 0xbacff1a6UL, 0xecdf92feUL,
+ 0x89b82e46UL, 0x67179b54UL, 0x027027ecUL, 0xbb48f071UL, 0xde2f4cc9UL,
+ 0x3080f9dbUL, 0x55e74563UL, 0x9ca03f6bUL, 0xf9c783d3UL, 0x176836c1UL,
+ 0x720f8a79UL, 0xcb375de4UL, 0xae50e15cUL, 0x40ff544eUL, 0x2598e8f6UL,
+ 0x73888baeUL, 0x16ef3716UL, 0xf8408204UL, 0x9d273ebcUL, 0x241fe921UL,
+ 0x41785599UL, 0xafd7e08bUL, 0xcab05c33UL, 0x3bb659edUL, 0x5ed1e555UL,
+ 0xb07e5047UL, 0xd519ecffUL, 0x6c213b62UL, 0x094687daUL, 0xe7e932c8UL,
+ 0x828e8e70UL, 0xd49eed28UL, 0xb1f95190UL, 0x5f56e482UL, 0x3a31583aUL,
+ 0x83098fa7UL, 0xe66e331fUL, 0x08c1860dUL, 0x6da63ab5UL, 0xa4e140bdUL,
+ 0xc186fc05UL, 0x2f294917UL, 0x4a4ef5afUL, 0xf3762232UL, 0x96119e8aUL,
+ 0x78be2b98UL, 0x1dd99720UL, 0x4bc9f478UL, 0x2eae48c0UL, 0xc001fdd2UL,
+ 0xa566416aUL, 0x1c5e96f7UL, 0x79392a4fUL, 0x97969f5dUL, 0xf2f123e5UL,
+ 0x05196b4dUL, 0x607ed7f5UL, 0x8ed162e7UL, 0xebb6de5fUL, 0x528e09c2UL,
+ 0x37e9b57aUL, 0xd9460068UL, 0xbc21bcd0UL, 0xea31df88UL, 0x8f566330UL,
+ 0x61f9d622UL, 0x049e6a9aUL, 0xbda6bd07UL, 0xd8c101bfUL, 0x366eb4adUL,
+ 0x53090815UL, 0x9a4e721dUL, 0xff29cea5UL, 0x11867bb7UL, 0x74e1c70fUL,
+ 0xcdd91092UL, 0xa8beac2aUL, 0x46111938UL, 0x2376a580UL, 0x7566c6d8UL,
+ 0x10017a60UL, 0xfeaecf72UL, 0x9bc973caUL, 0x22f1a457UL, 0x479618efUL,
+ 0xa939adfdUL, 0xcc5e1145UL, 0x06ee4d76UL, 0x6389f1ceUL, 0x8d2644dcUL,
+ 0xe841f864UL, 0x51792ff9UL, 0x341e9341UL, 0xdab12653UL, 0xbfd69aebUL,
+ 0xe9c6f9b3UL, 0x8ca1450bUL, 0x620ef019UL, 0x07694ca1UL, 0xbe519b3cUL,
+ 0xdb362784UL, 0x35999296UL, 0x50fe2e2eUL, 0x99b95426UL, 0xfcdee89eUL,
+ 0x12715d8cUL, 0x7716e134UL, 0xce2e36a9UL, 0xab498a11UL, 0x45e63f03UL,
+ 0x208183bbUL, 0x7691e0e3UL, 0x13f65c5bUL, 0xfd59e949UL, 0x983e55f1UL,
+ 0x2106826cUL, 0x44613ed4UL, 0xaace8bc6UL, 0xcfa9377eUL, 0x38417fd6UL,
+ 0x5d26c36eUL, 0xb389767cUL, 0xd6eecac4UL, 0x6fd61d59UL, 0x0ab1a1e1UL,
+ 0xe41e14f3UL, 0x8179a84bUL, 0xd769cb13UL, 0xb20e77abUL, 0x5ca1c2b9UL,
+ 0x39c67e01UL, 0x80fea99cUL, 0xe5991524UL, 0x0b36a036UL, 0x6e511c8eUL,
+ 0xa7166686UL, 0xc271da3eUL, 0x2cde6f2cUL, 0x49b9d394UL, 0xf0810409UL,
+ 0x95e6b8b1UL, 0x7b490da3UL, 0x1e2eb11bUL, 0x483ed243UL, 0x2d596efbUL,
+ 0xc3f6dbe9UL, 0xa6916751UL, 0x1fa9b0ccUL, 0x7ace0c74UL, 0x9461b966UL,
+ 0xf10605deUL
+#endif
+ }
+};
diff --git a/protocols/Telegram/tgl/zlib/deflate.c b/protocols/Telegram/tgl/zlib/deflate.c
new file mode 100644
index 0000000000..696957705b
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/deflate.c
@@ -0,0 +1,1967 @@
+/* deflate.c -- compress data using the deflation algorithm
+ * Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/*
+ * ALGORITHM
+ *
+ * The "deflation" process depends on being able to identify portions
+ * of the input text which are identical to earlier input (within a
+ * sliding window trailing behind the input currently being processed).
+ *
+ * The most straightforward technique turns out to be the fastest for
+ * most input files: try all possible matches and select the longest.
+ * The key feature of this algorithm is that insertions into the string
+ * dictionary are very simple and thus fast, and deletions are avoided
+ * completely. Insertions are performed at each input character, whereas
+ * string matches are performed only when the previous match ends. So it
+ * is preferable to spend more time in matches to allow very fast string
+ * insertions and avoid deletions. The matching algorithm for small
+ * strings is inspired from that of Rabin & Karp. A brute force approach
+ * is used to find longer strings when a small match has been found.
+ * A similar algorithm is used in comic (by Jan-Mark Wams) and freeze
+ * (by Leonid Broukhis).
+ * A previous version of this file used a more sophisticated algorithm
+ * (by Fiala and Greene) which is guaranteed to run in linear amortized
+ * time, but has a larger average cost, uses more memory and is patented.
+ * However the F&G algorithm may be faster for some highly redundant
+ * files if the parameter max_chain_length (described below) is too large.
+ *
+ * ACKNOWLEDGEMENTS
+ *
+ * The idea of lazy evaluation of matches is due to Jan-Mark Wams, and
+ * I found it in 'freeze' written by Leonid Broukhis.
+ * Thanks to many people for bug reports and testing.
+ *
+ * REFERENCES
+ *
+ * Deutsch, L.P.,"DEFLATE Compressed Data Format Specification".
+ * Available in http://tools.ietf.org/html/rfc1951
+ *
+ * A description of the Rabin and Karp algorithm is given in the book
+ * "Algorithms" by R. Sedgewick, Addison-Wesley, p252.
+ *
+ * Fiala,E.R., and Greene,D.H.
+ * Data Compression with Finite Windows, Comm.ACM, 32,4 (1989) 490-595
+ *
+ */
+
+/* @(#) $Id$ */
+
+#include "deflate.h"
+
+const char deflate_copyright[] =
+ " deflate 1.2.8 Copyright 1995-2013 Jean-loup Gailly and Mark Adler ";
+/*
+ If you use the zlib library in a product, an acknowledgment is welcome
+ in the documentation of your product. If for some reason you cannot
+ include such an acknowledgment, I would appreciate that you keep this
+ copyright string in the executable of your product.
+ */
+
+/* ===========================================================================
+ * Function prototypes.
+ */
+typedef enum {
+ need_more, /* block not completed, need more input or more output */
+ block_done, /* block flush performed */
+ finish_started, /* finish started, need only more output at next deflate */
+ finish_done /* finish done, accept no more input or output */
+} block_state;
+
+typedef block_state (*compress_func) OF((deflate_state *s, int flush));
+/* Compression function. Returns the block state after the call. */
+
+local void fill_window OF((deflate_state *s));
+local block_state deflate_stored OF((deflate_state *s, int flush));
+local block_state deflate_fast OF((deflate_state *s, int flush));
+#ifndef FASTEST
+local block_state deflate_slow OF((deflate_state *s, int flush));
+#endif
+local block_state deflate_rle OF((deflate_state *s, int flush));
+local block_state deflate_huff OF((deflate_state *s, int flush));
+local void lm_init OF((deflate_state *s));
+local void putShortMSB OF((deflate_state *s, uInt b));
+local void flush_pending OF((z_streamp strm));
+local int read_buf OF((z_streamp strm, Bytef *buf, unsigned size));
+#ifdef ASMV
+ void match_init OF((void)); /* asm code initialization */
+ uInt longest_match OF((deflate_state *s, IPos cur_match));
+#else
+local uInt longest_match OF((deflate_state *s, IPos cur_match));
+#endif
+
+#ifdef DEBUG
+local void check_match OF((deflate_state *s, IPos start, IPos match,
+ int length));
+#endif
+
+/* ===========================================================================
+ * Local data
+ */
+
+#define NIL 0
+/* Tail of hash chains */
+
+#ifndef TOO_FAR
+# define TOO_FAR 4096
+#endif
+/* Matches of length 3 are discarded if their distance exceeds TOO_FAR */
+
+/* Values for max_lazy_match, good_match and max_chain_length, depending on
+ * the desired pack level (0..9). The values given below have been tuned to
+ * exclude worst case performance for pathological files. Better values may be
+ * found for specific files.
+ */
+typedef struct config_s {
+ ush good_length; /* reduce lazy search above this match length */
+ ush max_lazy; /* do not perform lazy search above this match length */
+ ush nice_length; /* quit search above this match length */
+ ush max_chain;
+ compress_func func;
+} config;
+
+#ifdef FASTEST
+local const config configuration_table[2] = {
+/* good lazy nice chain */
+/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */
+/* 1 */ {4, 4, 8, 4, deflate_fast}}; /* max speed, no lazy matches */
+#else
+local const config configuration_table[10] = {
+/* good lazy nice chain */
+/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */
+/* 1 */ {4, 4, 8, 4, deflate_fast}, /* max speed, no lazy matches */
+/* 2 */ {4, 5, 16, 8, deflate_fast},
+/* 3 */ {4, 6, 32, 32, deflate_fast},
+
+/* 4 */ {4, 4, 16, 16, deflate_slow}, /* lazy matches */
+/* 5 */ {8, 16, 32, 32, deflate_slow},
+/* 6 */ {8, 16, 128, 128, deflate_slow},
+/* 7 */ {8, 32, 128, 256, deflate_slow},
+/* 8 */ {32, 128, 258, 1024, deflate_slow},
+/* 9 */ {32, 258, 258, 4096, deflate_slow}}; /* max compression */
+#endif
+
+/* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4
+ * For deflate_fast() (levels <= 3) good is ignored and lazy has a different
+ * meaning.
+ */
+
+#define EQUAL 0
+/* result of memcmp for equal strings */
+
+#ifndef NO_DUMMY_DECL
+struct static_tree_desc_s {int dummy;}; /* for buggy compilers */
+#endif
+
+/* rank Z_BLOCK between Z_NO_FLUSH and Z_PARTIAL_FLUSH */
+#define RANK(f) (((f) << 1) - ((f) > 4 ? 9 : 0))
+
+/* ===========================================================================
+ * Update a hash value with the given input byte
+ * IN assertion: all calls to to UPDATE_HASH are made with consecutive
+ * input characters, so that a running hash key can be computed from the
+ * previous key instead of complete recalculation each time.
+ */
+#define UPDATE_HASH(s,h,c) (h = (((h)<<s->hash_shift) ^ (c)) & s->hash_mask)
+
+
+/* ===========================================================================
+ * Insert string str in the dictionary and set match_head to the previous head
+ * of the hash chain (the most recent string with same hash key). Return
+ * the previous length of the hash chain.
+ * If this file is compiled with -DFASTEST, the compression level is forced
+ * to 1, and no hash chains are maintained.
+ * IN assertion: all calls to to INSERT_STRING are made with consecutive
+ * input characters and the first MIN_MATCH bytes of str are valid
+ * (except for the last MIN_MATCH-1 bytes of the input file).
+ */
+#ifdef FASTEST
+#define INSERT_STRING(s, str, match_head) \
+ (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
+ match_head = s->head[s->ins_h], \
+ s->head[s->ins_h] = (Pos)(str))
+#else
+#define INSERT_STRING(s, str, match_head) \
+ (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
+ match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \
+ s->head[s->ins_h] = (Pos)(str))
+#endif
+
+/* ===========================================================================
+ * Initialize the hash table (avoiding 64K overflow for 16 bit systems).
+ * prev[] will be initialized on the fly.
+ */
+#define CLEAR_HASH(s) \
+ s->head[s->hash_size-1] = NIL; \
+ zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head));
+
+/* ========================================================================= */
+int ZEXPORT deflateInit_(strm, level, version, stream_size)
+ z_streamp strm;
+ int level;
+ const char *version;
+ int stream_size;
+{
+ return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL,
+ Z_DEFAULT_STRATEGY, version, stream_size);
+ /* To do: ignore strm->next_in if we use it as window */
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
+ version, stream_size)
+ z_streamp strm;
+ int level;
+ int method;
+ int windowBits;
+ int memLevel;
+ int strategy;
+ const char *version;
+ int stream_size;
+{
+ deflate_state *s;
+ int wrap = 1;
+ static const char my_version[] = ZLIB_VERSION;
+
+ ushf *overlay;
+ /* We overlay pending_buf and d_buf+l_buf. This works since the average
+ * output size for (length,distance) codes is <= 24 bits.
+ */
+
+ if (version == Z_NULL || version[0] != my_version[0] ||
+ stream_size != sizeof(z_stream)) {
+ return Z_VERSION_ERROR;
+ }
+ if (strm == Z_NULL) return Z_STREAM_ERROR;
+
+ strm->msg = Z_NULL;
+ if (strm->zalloc == (alloc_func)0) {
+#ifdef Z_SOLO
+ return Z_STREAM_ERROR;
+#else
+ strm->zalloc = zcalloc;
+ strm->opaque = (voidpf)0;
+#endif
+ }
+ if (strm->zfree == (free_func)0)
+#ifdef Z_SOLO
+ return Z_STREAM_ERROR;
+#else
+ strm->zfree = zcfree;
+#endif
+
+#ifdef FASTEST
+ if (level != 0) level = 1;
+#else
+ if (level == Z_DEFAULT_COMPRESSION) level = 6;
+#endif
+
+ if (windowBits < 0) { /* suppress zlib wrapper */
+ wrap = 0;
+ windowBits = -windowBits;
+ }
+#ifdef GZIP
+ else if (windowBits > 15) {
+ wrap = 2; /* write gzip wrapper instead */
+ windowBits -= 16;
+ }
+#endif
+ if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
+ windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
+ strategy < 0 || strategy > Z_FIXED) {
+ return Z_STREAM_ERROR;
+ }
+ if (windowBits == 8) windowBits = 9; /* until 256-byte window bug fixed */
+ s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state));
+ if (s == Z_NULL) return Z_MEM_ERROR;
+ strm->state = (struct internal_state FAR *)s;
+ s->strm = strm;
+
+ s->wrap = wrap;
+ s->gzhead = Z_NULL;
+ s->w_bits = windowBits;
+ s->w_size = 1 << s->w_bits;
+ s->w_mask = s->w_size - 1;
+
+ s->hash_bits = memLevel + 7;
+ s->hash_size = 1 << s->hash_bits;
+ s->hash_mask = s->hash_size - 1;
+ s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH);
+
+ s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));
+ s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos));
+ s->head = (Posf *) ZALLOC(strm, s->hash_size, sizeof(Pos));
+
+ s->high_water = 0; /* nothing written to s->window yet */
+
+ s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
+
+ overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
+ s->pending_buf = (uchf *) overlay;
+ s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L);
+
+ if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
+ s->pending_buf == Z_NULL) {
+ s->status = FINISH_STATE;
+ strm->msg = ERR_MSG(Z_MEM_ERROR);
+ deflateEnd (strm);
+ return Z_MEM_ERROR;
+ }
+ s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
+ s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
+
+ s->level = level;
+ s->strategy = strategy;
+ s->method = (Byte)method;
+
+ return deflateReset(strm);
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
+ z_streamp strm;
+ const Bytef *dictionary;
+ uInt dictLength;
+{
+ deflate_state *s;
+ uInt str, n;
+ int wrap;
+ unsigned avail;
+ z_const unsigned char *next;
+
+ if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL)
+ return Z_STREAM_ERROR;
+ s = strm->state;
+ wrap = s->wrap;
+ if (wrap == 2 || (wrap == 1 && s->status != INIT_STATE) || s->lookahead)
+ return Z_STREAM_ERROR;
+
+ /* when using zlib wrappers, compute Adler-32 for provided dictionary */
+ if (wrap == 1)
+ strm->adler = adler32(strm->adler, dictionary, dictLength);
+ s->wrap = 0; /* avoid computing Adler-32 in read_buf */
+
+ /* if dictionary would fill window, just replace the history */
+ if (dictLength >= s->w_size) {
+ if (wrap == 0) { /* already empty otherwise */
+ CLEAR_HASH(s);
+ s->strstart = 0;
+ s->block_start = 0L;
+ s->insert = 0;
+ }
+ dictionary += dictLength - s->w_size; /* use the tail */
+ dictLength = s->w_size;
+ }
+
+ /* insert dictionary into window and hash */
+ avail = strm->avail_in;
+ next = strm->next_in;
+ strm->avail_in = dictLength;
+ strm->next_in = (z_const Bytef *)dictionary;
+ fill_window(s);
+ while (s->lookahead >= MIN_MATCH) {
+ str = s->strstart;
+ n = s->lookahead - (MIN_MATCH-1);
+ do {
+ UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]);
+#ifndef FASTEST
+ s->prev[str & s->w_mask] = s->head[s->ins_h];
+#endif
+ s->head[s->ins_h] = (Pos)str;
+ str++;
+ } while (--n);
+ s->strstart = str;
+ s->lookahead = MIN_MATCH-1;
+ fill_window(s);
+ }
+ s->strstart += s->lookahead;
+ s->block_start = (long)s->strstart;
+ s->insert = s->lookahead;
+ s->lookahead = 0;
+ s->match_length = s->prev_length = MIN_MATCH-1;
+ s->match_available = 0;
+ strm->next_in = next;
+ strm->avail_in = avail;
+ s->wrap = wrap;
+ return Z_OK;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateResetKeep (strm)
+ z_streamp strm;
+{
+ deflate_state *s;
+
+ if (strm == Z_NULL || strm->state == Z_NULL ||
+ strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) {
+ return Z_STREAM_ERROR;
+ }
+
+ strm->total_in = strm->total_out = 0;
+ strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */
+ strm->data_type = Z_UNKNOWN;
+
+ s = (deflate_state *)strm->state;
+ s->pending = 0;
+ s->pending_out = s->pending_buf;
+
+ if (s->wrap < 0) {
+ s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */
+ }
+ s->status = s->wrap ? INIT_STATE : BUSY_STATE;
+ strm->adler =
+#ifdef GZIP
+ s->wrap == 2 ? crc32(0L, Z_NULL, 0) :
+#endif
+ adler32(0L, Z_NULL, 0);
+ s->last_flush = Z_NO_FLUSH;
+
+ _tr_init(s);
+
+ return Z_OK;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateReset (strm)
+ z_streamp strm;
+{
+ int ret;
+
+ ret = deflateResetKeep(strm);
+ if (ret == Z_OK)
+ lm_init(strm->state);
+ return ret;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateSetHeader (strm, head)
+ z_streamp strm;
+ gz_headerp head;
+{
+ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+ if (strm->state->wrap != 2) return Z_STREAM_ERROR;
+ strm->state->gzhead = head;
+ return Z_OK;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflatePending (strm, pending, bits)
+ unsigned *pending;
+ int *bits;
+ z_streamp strm;
+{
+ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+ if (pending != Z_NULL)
+ *pending = strm->state->pending;
+ if (bits != Z_NULL)
+ *bits = strm->state->bi_valid;
+ return Z_OK;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflatePrime (strm, bits, value)
+ z_streamp strm;
+ int bits;
+ int value;
+{
+ deflate_state *s;
+ int put;
+
+ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+ s = strm->state;
+ if ((Bytef *)(s->d_buf) < s->pending_out + ((Buf_size + 7) >> 3))
+ return Z_BUF_ERROR;
+ do {
+ put = Buf_size - s->bi_valid;
+ if (put > bits)
+ put = bits;
+ s->bi_buf |= (ush)((value & ((1 << put) - 1)) << s->bi_valid);
+ s->bi_valid += put;
+ _tr_flush_bits(s);
+ value >>= put;
+ bits -= put;
+ } while (bits);
+ return Z_OK;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateParams(strm, level, strategy)
+ z_streamp strm;
+ int level;
+ int strategy;
+{
+ deflate_state *s;
+ compress_func func;
+ int err = Z_OK;
+
+ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+ s = strm->state;
+
+#ifdef FASTEST
+ if (level != 0) level = 1;
+#else
+ if (level == Z_DEFAULT_COMPRESSION) level = 6;
+#endif
+ if (level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) {
+ return Z_STREAM_ERROR;
+ }
+ func = configuration_table[s->level].func;
+
+ if ((strategy != s->strategy || func != configuration_table[level].func) &&
+ strm->total_in != 0) {
+ /* Flush the last buffer: */
+ err = deflate(strm, Z_BLOCK);
+ if (err == Z_BUF_ERROR && s->pending == 0)
+ err = Z_OK;
+ }
+ if (s->level != level) {
+ s->level = level;
+ s->max_lazy_match = configuration_table[level].max_lazy;
+ s->good_match = configuration_table[level].good_length;
+ s->nice_match = configuration_table[level].nice_length;
+ s->max_chain_length = configuration_table[level].max_chain;
+ }
+ s->strategy = strategy;
+ return err;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain)
+ z_streamp strm;
+ int good_length;
+ int max_lazy;
+ int nice_length;
+ int max_chain;
+{
+ deflate_state *s;
+
+ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+ s = strm->state;
+ s->good_match = good_length;
+ s->max_lazy_match = max_lazy;
+ s->nice_match = nice_length;
+ s->max_chain_length = max_chain;
+ return Z_OK;
+}
+
+/* =========================================================================
+ * For the default windowBits of 15 and memLevel of 8, this function returns
+ * a close to exact, as well as small, upper bound on the compressed size.
+ * They are coded as constants here for a reason--if the #define's are
+ * changed, then this function needs to be changed as well. The return
+ * value for 15 and 8 only works for those exact settings.
+ *
+ * For any setting other than those defaults for windowBits and memLevel,
+ * the value returned is a conservative worst case for the maximum expansion
+ * resulting from using fixed blocks instead of stored blocks, which deflate
+ * can emit on compressed data for some combinations of the parameters.
+ *
+ * This function could be more sophisticated to provide closer upper bounds for
+ * every combination of windowBits and memLevel. But even the conservative
+ * upper bound of about 14% expansion does not seem onerous for output buffer
+ * allocation.
+ */
+uLong ZEXPORT deflateBound(strm, sourceLen)
+ z_streamp strm;
+ uLong sourceLen;
+{
+ deflate_state *s;
+ uLong complen, wraplen;
+ Bytef *str;
+
+ /* conservative upper bound for compressed data */
+ complen = sourceLen +
+ ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 5;
+
+ /* if can't get parameters, return conservative bound plus zlib wrapper */
+ if (strm == Z_NULL || strm->state == Z_NULL)
+ return complen + 6;
+
+ /* compute wrapper length */
+ s = strm->state;
+ switch (s->wrap) {
+ case 0: /* raw deflate */
+ wraplen = 0;
+ break;
+ case 1: /* zlib wrapper */
+ wraplen = 6 + (s->strstart ? 4 : 0);
+ break;
+ case 2: /* gzip wrapper */
+ wraplen = 18;
+ if (s->gzhead != Z_NULL) { /* user-supplied gzip header */
+ if (s->gzhead->extra != Z_NULL)
+ wraplen += 2 + s->gzhead->extra_len;
+ str = s->gzhead->name;
+ if (str != Z_NULL)
+ do {
+ wraplen++;
+ } while (*str++);
+ str = s->gzhead->comment;
+ if (str != Z_NULL)
+ do {
+ wraplen++;
+ } while (*str++);
+ if (s->gzhead->hcrc)
+ wraplen += 2;
+ }
+ break;
+ default: /* for compiler happiness */
+ wraplen = 6;
+ }
+
+ /* if not default parameters, return conservative bound */
+ if (s->w_bits != 15 || s->hash_bits != 8 + 7)
+ return complen + wraplen;
+
+ /* default settings: return tight bound for that case */
+ return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
+ (sourceLen >> 25) + 13 - 6 + wraplen;
+}
+
+/* =========================================================================
+ * Put a short in the pending buffer. The 16-bit value is put in MSB order.
+ * IN assertion: the stream state is correct and there is enough room in
+ * pending_buf.
+ */
+local void putShortMSB (s, b)
+ deflate_state *s;
+ uInt b;
+{
+ put_byte(s, (Byte)(b >> 8));
+ put_byte(s, (Byte)(b & 0xff));
+}
+
+/* =========================================================================
+ * Flush as much pending output as possible. All deflate() output goes
+ * through this function so some applications may wish to modify it
+ * to avoid allocating a large strm->next_out buffer and copying into it.
+ * (See also read_buf()).
+ */
+local void flush_pending(strm)
+ z_streamp strm;
+{
+ unsigned len;
+ deflate_state *s = strm->state;
+
+ _tr_flush_bits(s);
+ len = s->pending;
+ if (len > strm->avail_out) len = strm->avail_out;
+ if (len == 0) return;
+
+ zmemcpy(strm->next_out, s->pending_out, len);
+ strm->next_out += len;
+ s->pending_out += len;
+ strm->total_out += len;
+ strm->avail_out -= len;
+ s->pending -= len;
+ if (s->pending == 0) {
+ s->pending_out = s->pending_buf;
+ }
+}
+
+/* ========================================================================= */
+int ZEXPORT deflate (strm, flush)
+ z_streamp strm;
+ int flush;
+{
+ int old_flush; /* value of flush param for previous deflate call */
+ deflate_state *s;
+
+ if (strm == Z_NULL || strm->state == Z_NULL ||
+ flush > Z_BLOCK || flush < 0) {
+ return Z_STREAM_ERROR;
+ }
+ s = strm->state;
+
+ if (strm->next_out == Z_NULL ||
+ (strm->next_in == Z_NULL && strm->avail_in != 0) ||
+ (s->status == FINISH_STATE && flush != Z_FINISH)) {
+ ERR_RETURN(strm, Z_STREAM_ERROR);
+ }
+ if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR);
+
+ s->strm = strm; /* just in case */
+ old_flush = s->last_flush;
+ s->last_flush = flush;
+
+ /* Write the header */
+ if (s->status == INIT_STATE) {
+#ifdef GZIP
+ if (s->wrap == 2) {
+ strm->adler = crc32(0L, Z_NULL, 0);
+ put_byte(s, 31);
+ put_byte(s, 139);
+ put_byte(s, 8);
+ if (s->gzhead == Z_NULL) {
+ put_byte(s, 0);
+ put_byte(s, 0);
+ put_byte(s, 0);
+ put_byte(s, 0);
+ put_byte(s, 0);
+ put_byte(s, s->level == 9 ? 2 :
+ (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
+ 4 : 0));
+ put_byte(s, OS_CODE);
+ s->status = BUSY_STATE;
+ }
+ else {
+ put_byte(s, (s->gzhead->text ? 1 : 0) +
+ (s->gzhead->hcrc ? 2 : 0) +
+ (s->gzhead->extra == Z_NULL ? 0 : 4) +
+ (s->gzhead->name == Z_NULL ? 0 : 8) +
+ (s->gzhead->comment == Z_NULL ? 0 : 16)
+ );
+ put_byte(s, (Byte)(s->gzhead->time & 0xff));
+ put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff));
+ put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff));
+ put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff));
+ put_byte(s, s->level == 9 ? 2 :
+ (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
+ 4 : 0));
+ put_byte(s, s->gzhead->os & 0xff);
+ if (s->gzhead->extra != Z_NULL) {
+ put_byte(s, s->gzhead->extra_len & 0xff);
+ put_byte(s, (s->gzhead->extra_len >> 8) & 0xff);
+ }
+ if (s->gzhead->hcrc)
+ strm->adler = crc32(strm->adler, s->pending_buf,
+ s->pending);
+ s->gzindex = 0;
+ s->status = EXTRA_STATE;
+ }
+ }
+ else
+#endif
+ {
+ uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8;
+ uInt level_flags;
+
+ if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2)
+ level_flags = 0;
+ else if (s->level < 6)
+ level_flags = 1;
+ else if (s->level == 6)
+ level_flags = 2;
+ else
+ level_flags = 3;
+ header |= (level_flags << 6);
+ if (s->strstart != 0) header |= PRESET_DICT;
+ header += 31 - (header % 31);
+
+ s->status = BUSY_STATE;
+ putShortMSB(s, header);
+
+ /* Save the adler32 of the preset dictionary: */
+ if (s->strstart != 0) {
+ putShortMSB(s, (uInt)(strm->adler >> 16));
+ putShortMSB(s, (uInt)(strm->adler & 0xffff));
+ }
+ strm->adler = adler32(0L, Z_NULL, 0);
+ }
+ }
+#ifdef GZIP
+ if (s->status == EXTRA_STATE) {
+ if (s->gzhead->extra != Z_NULL) {
+ uInt beg = s->pending; /* start of bytes to update crc */
+
+ while (s->gzindex < (s->gzhead->extra_len & 0xffff)) {
+ if (s->pending == s->pending_buf_size) {
+ if (s->gzhead->hcrc && s->pending > beg)
+ strm->adler = crc32(strm->adler, s->pending_buf + beg,
+ s->pending - beg);
+ flush_pending(strm);
+ beg = s->pending;
+ if (s->pending == s->pending_buf_size)
+ break;
+ }
+ put_byte(s, s->gzhead->extra[s->gzindex]);
+ s->gzindex++;
+ }
+ if (s->gzhead->hcrc && s->pending > beg)
+ strm->adler = crc32(strm->adler, s->pending_buf + beg,
+ s->pending - beg);
+ if (s->gzindex == s->gzhead->extra_len) {
+ s->gzindex = 0;
+ s->status = NAME_STATE;
+ }
+ }
+ else
+ s->status = NAME_STATE;
+ }
+ if (s->status == NAME_STATE) {
+ if (s->gzhead->name != Z_NULL) {
+ uInt beg = s->pending; /* start of bytes to update crc */
+ int val;
+
+ do {
+ if (s->pending == s->pending_buf_size) {
+ if (s->gzhead->hcrc && s->pending > beg)
+ strm->adler = crc32(strm->adler, s->pending_buf + beg,
+ s->pending - beg);
+ flush_pending(strm);
+ beg = s->pending;
+ if (s->pending == s->pending_buf_size) {
+ val = 1;
+ break;
+ }
+ }
+ val = s->gzhead->name[s->gzindex++];
+ put_byte(s, val);
+ } while (val != 0);
+ if (s->gzhead->hcrc && s->pending > beg)
+ strm->adler = crc32(strm->adler, s->pending_buf + beg,
+ s->pending - beg);
+ if (val == 0) {
+ s->gzindex = 0;
+ s->status = COMMENT_STATE;
+ }
+ }
+ else
+ s->status = COMMENT_STATE;
+ }
+ if (s->status == COMMENT_STATE) {
+ if (s->gzhead->comment != Z_NULL) {
+ uInt beg = s->pending; /* start of bytes to update crc */
+ int val;
+
+ do {
+ if (s->pending == s->pending_buf_size) {
+ if (s->gzhead->hcrc && s->pending > beg)
+ strm->adler = crc32(strm->adler, s->pending_buf + beg,
+ s->pending - beg);
+ flush_pending(strm);
+ beg = s->pending;
+ if (s->pending == s->pending_buf_size) {
+ val = 1;
+ break;
+ }
+ }
+ val = s->gzhead->comment[s->gzindex++];
+ put_byte(s, val);
+ } while (val != 0);
+ if (s->gzhead->hcrc && s->pending > beg)
+ strm->adler = crc32(strm->adler, s->pending_buf + beg,
+ s->pending - beg);
+ if (val == 0)
+ s->status = HCRC_STATE;
+ }
+ else
+ s->status = HCRC_STATE;
+ }
+ if (s->status == HCRC_STATE) {
+ if (s->gzhead->hcrc) {
+ if (s->pending + 2 > s->pending_buf_size)
+ flush_pending(strm);
+ if (s->pending + 2 <= s->pending_buf_size) {
+ put_byte(s, (Byte)(strm->adler & 0xff));
+ put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
+ strm->adler = crc32(0L, Z_NULL, 0);
+ s->status = BUSY_STATE;
+ }
+ }
+ else
+ s->status = BUSY_STATE;
+ }
+#endif
+
+ /* Flush as much pending output as possible */
+ if (s->pending != 0) {
+ flush_pending(strm);
+ if (strm->avail_out == 0) {
+ /* Since avail_out is 0, deflate will be called again with
+ * more output space, but possibly with both pending and
+ * avail_in equal to zero. There won't be anything to do,
+ * but this is not an error situation so make sure we
+ * return OK instead of BUF_ERROR at next call of deflate:
+ */
+ s->last_flush = -1;
+ return Z_OK;
+ }
+
+ /* Make sure there is something to do and avoid duplicate consecutive
+ * flushes. For repeated and useless calls with Z_FINISH, we keep
+ * returning Z_STREAM_END instead of Z_BUF_ERROR.
+ */
+ } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) &&
+ flush != Z_FINISH) {
+ ERR_RETURN(strm, Z_BUF_ERROR);
+ }
+
+ /* User must not provide more input after the first FINISH: */
+ if (s->status == FINISH_STATE && strm->avail_in != 0) {
+ ERR_RETURN(strm, Z_BUF_ERROR);
+ }
+
+ /* Start a new block or continue the current one.
+ */
+ if (strm->avail_in != 0 || s->lookahead != 0 ||
+ (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
+ block_state bstate;
+
+ bstate = s->strategy == Z_HUFFMAN_ONLY ? deflate_huff(s, flush) :
+ (s->strategy == Z_RLE ? deflate_rle(s, flush) :
+ (*(configuration_table[s->level].func))(s, flush));
+
+ if (bstate == finish_started || bstate == finish_done) {
+ s->status = FINISH_STATE;
+ }
+ if (bstate == need_more || bstate == finish_started) {
+ if (strm->avail_out == 0) {
+ s->last_flush = -1; /* avoid BUF_ERROR next call, see above */
+ }
+ return Z_OK;
+ /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
+ * of deflate should use the same flush parameter to make sure
+ * that the flush is complete. So we don't have to output an
+ * empty block here, this will be done at next call. This also
+ * ensures that for a very small output buffer, we emit at most
+ * one empty block.
+ */
+ }
+ if (bstate == block_done) {
+ if (flush == Z_PARTIAL_FLUSH) {
+ _tr_align(s);
+ } else if (flush != Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */
+ _tr_stored_block(s, (char*)0, 0L, 0);
+ /* For a full flush, this empty block will be recognized
+ * as a special marker by inflate_sync().
+ */
+ if (flush == Z_FULL_FLUSH) {
+ CLEAR_HASH(s); /* forget history */
+ if (s->lookahead == 0) {
+ s->strstart = 0;
+ s->block_start = 0L;
+ s->insert = 0;
+ }
+ }
+ }
+ flush_pending(strm);
+ if (strm->avail_out == 0) {
+ s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */
+ return Z_OK;
+ }
+ }
+ }
+ Assert(strm->avail_out > 0, "bug2");
+
+ if (flush != Z_FINISH) return Z_OK;
+ if (s->wrap <= 0) return Z_STREAM_END;
+
+ /* Write the trailer */
+#ifdef GZIP
+ if (s->wrap == 2) {
+ put_byte(s, (Byte)(strm->adler & 0xff));
+ put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
+ put_byte(s, (Byte)((strm->adler >> 16) & 0xff));
+ put_byte(s, (Byte)((strm->adler >> 24) & 0xff));
+ put_byte(s, (Byte)(strm->total_in & 0xff));
+ put_byte(s, (Byte)((strm->total_in >> 8) & 0xff));
+ put_byte(s, (Byte)((strm->total_in >> 16) & 0xff));
+ put_byte(s, (Byte)((strm->total_in >> 24) & 0xff));
+ }
+ else
+#endif
+ {
+ putShortMSB(s, (uInt)(strm->adler >> 16));
+ putShortMSB(s, (uInt)(strm->adler & 0xffff));
+ }
+ flush_pending(strm);
+ /* If avail_out is zero, the application will call deflate again
+ * to flush the rest.
+ */
+ if (s->wrap > 0) s->wrap = -s->wrap; /* write the trailer only once! */
+ return s->pending != 0 ? Z_OK : Z_STREAM_END;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateEnd (strm)
+ z_streamp strm;
+{
+ int status;
+
+ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ status = strm->state->status;
+ if (status != INIT_STATE &&
+ status != EXTRA_STATE &&
+ status != NAME_STATE &&
+ status != COMMENT_STATE &&
+ status != HCRC_STATE &&
+ status != BUSY_STATE &&
+ status != FINISH_STATE) {
+ return Z_STREAM_ERROR;
+ }
+
+ /* Deallocate in reverse order of allocations: */
+ TRY_FREE(strm, strm->state->pending_buf);
+ TRY_FREE(strm, strm->state->head);
+ TRY_FREE(strm, strm->state->prev);
+ TRY_FREE(strm, strm->state->window);
+
+ ZFREE(strm, strm->state);
+ strm->state = Z_NULL;
+
+ return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;
+}
+
+/* =========================================================================
+ * Copy the source state to the destination state.
+ * To simplify the source, this is not supported for 16-bit MSDOS (which
+ * doesn't have enough memory anyway to duplicate compression states).
+ */
+int ZEXPORT deflateCopy (dest, source)
+ z_streamp dest;
+ z_streamp source;
+{
+#ifdef MAXSEG_64K
+ return Z_STREAM_ERROR;
+#else
+ deflate_state *ds;
+ deflate_state *ss;
+ ushf *overlay;
+
+
+ if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) {
+ return Z_STREAM_ERROR;
+ }
+
+ ss = source->state;
+
+ zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream));
+
+ ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state));
+ if (ds == Z_NULL) return Z_MEM_ERROR;
+ dest->state = (struct internal_state FAR *) ds;
+ zmemcpy((voidpf)ds, (voidpf)ss, sizeof(deflate_state));
+ ds->strm = dest;
+
+ ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte));
+ ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos));
+ ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos));
+ overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2);
+ ds->pending_buf = (uchf *) overlay;
+
+ if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL ||
+ ds->pending_buf == Z_NULL) {
+ deflateEnd (dest);
+ return Z_MEM_ERROR;
+ }
+ /* following zmemcpy do not work for 16-bit MSDOS */
+ zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte));
+ zmemcpy((voidpf)ds->prev, (voidpf)ss->prev, ds->w_size * sizeof(Pos));
+ zmemcpy((voidpf)ds->head, (voidpf)ss->head, ds->hash_size * sizeof(Pos));
+ zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);
+
+ ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);
+ ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush);
+ ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize;
+
+ ds->l_desc.dyn_tree = ds->dyn_ltree;
+ ds->d_desc.dyn_tree = ds->dyn_dtree;
+ ds->bl_desc.dyn_tree = ds->bl_tree;
+
+ return Z_OK;
+#endif /* MAXSEG_64K */
+}
+
+/* ===========================================================================
+ * Read a new buffer from the current input stream, update the adler32
+ * and total number of bytes read. All deflate() input goes through
+ * this function so some applications may wish to modify it to avoid
+ * allocating a large strm->next_in buffer and copying from it.
+ * (See also flush_pending()).
+ */
+local int read_buf(strm, buf, size)
+ z_streamp strm;
+ Bytef *buf;
+ unsigned size;
+{
+ unsigned len = strm->avail_in;
+
+ if (len > size) len = size;
+ if (len == 0) return 0;
+
+ strm->avail_in -= len;
+
+ zmemcpy(buf, strm->next_in, len);
+ if (strm->state->wrap == 1) {
+ strm->adler = adler32(strm->adler, buf, len);
+ }
+#ifdef GZIP
+ else if (strm->state->wrap == 2) {
+ strm->adler = crc32(strm->adler, buf, len);
+ }
+#endif
+ strm->next_in += len;
+ strm->total_in += len;
+
+ return (int)len;
+}
+
+/* ===========================================================================
+ * Initialize the "longest match" routines for a new zlib stream
+ */
+local void lm_init (s)
+ deflate_state *s;
+{
+ s->window_size = (ulg)2L*s->w_size;
+
+ CLEAR_HASH(s);
+
+ /* Set the default configuration parameters:
+ */
+ s->max_lazy_match = configuration_table[s->level].max_lazy;
+ s->good_match = configuration_table[s->level].good_length;
+ s->nice_match = configuration_table[s->level].nice_length;
+ s->max_chain_length = configuration_table[s->level].max_chain;
+
+ s->strstart = 0;
+ s->block_start = 0L;
+ s->lookahead = 0;
+ s->insert = 0;
+ s->match_length = s->prev_length = MIN_MATCH-1;
+ s->match_available = 0;
+ s->ins_h = 0;
+#ifndef FASTEST
+#ifdef ASMV
+ match_init(); /* initialize the asm code */
+#endif
+#endif
+}
+
+#ifndef FASTEST
+/* ===========================================================================
+ * Set match_start to the longest match starting at the given string and
+ * return its length. Matches shorter or equal to prev_length are discarded,
+ * in which case the result is equal to prev_length and match_start is
+ * garbage.
+ * IN assertions: cur_match is the head of the hash chain for the current
+ * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
+ * OUT assertion: the match length is not greater than s->lookahead.
+ */
+#ifndef ASMV
+/* For 80x86 and 680x0, an optimized version will be provided in match.asm or
+ * match.S. The code will be functionally equivalent.
+ */
+local uInt longest_match(s, cur_match)
+ deflate_state *s;
+ IPos cur_match; /* current match */
+{
+ unsigned chain_length = s->max_chain_length;/* max hash chain length */
+ register Bytef *scan = s->window + s->strstart; /* current string */
+ register Bytef *match; /* matched string */
+ register int len; /* length of current match */
+ int best_len = s->prev_length; /* best match length so far */
+ int nice_match = s->nice_match; /* stop if match long enough */
+ IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
+ s->strstart - (IPos)MAX_DIST(s) : NIL;
+ /* Stop when cur_match becomes <= limit. To simplify the code,
+ * we prevent matches with the string of window index 0.
+ */
+ Posf *prev = s->prev;
+ uInt wmask = s->w_mask;
+
+#ifdef UNALIGNED_OK
+ /* Compare two bytes at a time. Note: this is not always beneficial.
+ * Try with and without -DUNALIGNED_OK to check.
+ */
+ register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
+ register ush scan_start = *(ushf*)scan;
+ register ush scan_end = *(ushf*)(scan+best_len-1);
+#else
+ register Bytef *strend = s->window + s->strstart + MAX_MATCH;
+ register Byte scan_end1 = scan[best_len-1];
+ register Byte scan_end = scan[best_len];
+#endif
+
+ /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
+ * It is easy to get rid of this optimization if necessary.
+ */
+ Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
+
+ /* Do not waste too much time if we already have a good match: */
+ if (s->prev_length >= s->good_match) {
+ chain_length >>= 2;
+ }
+ /* Do not look for matches beyond the end of the input. This is necessary
+ * to make deflate deterministic.
+ */
+ if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
+
+ Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
+
+ do {
+ Assert(cur_match < s->strstart, "no future");
+ match = s->window + cur_match;
+
+ /* Skip to next match if the match length cannot increase
+ * or if the match length is less than 2. Note that the checks below
+ * for insufficient lookahead only occur occasionally for performance
+ * reasons. Therefore uninitialized memory will be accessed, and
+ * conditional jumps will be made that depend on those values.
+ * However the length of the match is limited to the lookahead, so
+ * the output of deflate is not affected by the uninitialized values.
+ */
+#if (defined(UNALIGNED_OK) && MAX_MATCH == 258)
+ /* This code assumes sizeof(unsigned short) == 2. Do not use
+ * UNALIGNED_OK if your compiler uses a different size.
+ */
+ if (*(ushf*)(match+best_len-1) != scan_end ||
+ *(ushf*)match != scan_start) continue;
+
+ /* It is not necessary to compare scan[2] and match[2] since they are
+ * always equal when the other bytes match, given that the hash keys
+ * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at
+ * strstart+3, +5, ... up to strstart+257. We check for insufficient
+ * lookahead only every 4th comparison; the 128th check will be made
+ * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is
+ * necessary to put more guard bytes at the end of the window, or
+ * to check more often for insufficient lookahead.
+ */
+ Assert(scan[2] == match[2], "scan[2]?");
+ scan++, match++;
+ do {
+ } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+ *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+ *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+ *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+ scan < strend);
+ /* The funny "do {}" generates better code on most compilers */
+
+ /* Here, scan <= window+strstart+257 */
+ Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+ if (*scan == *match) scan++;
+
+ len = (MAX_MATCH - 1) - (int)(strend-scan);
+ scan = strend - (MAX_MATCH-1);
+
+#else /* UNALIGNED_OK */
+
+ if (match[best_len] != scan_end ||
+ match[best_len-1] != scan_end1 ||
+ *match != *scan ||
+ *++match != scan[1]) continue;
+
+ /* The check at best_len-1 can be removed because it will be made
+ * again later. (This heuristic is not always a win.)
+ * It is not necessary to compare scan[2] and match[2] since they
+ * are always equal when the other bytes match, given that
+ * the hash keys are equal and that HASH_BITS >= 8.
+ */
+ scan += 2, match++;
+ Assert(*scan == *match, "match[2]?");
+
+ /* We check for insufficient lookahead only every 8th comparison;
+ * the 256th check will be made at strstart+258.
+ */
+ do {
+ } while (*++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ scan < strend);
+
+ Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+
+ len = MAX_MATCH - (int)(strend - scan);
+ scan = strend - MAX_MATCH;
+
+#endif /* UNALIGNED_OK */
+
+ if (len > best_len) {
+ s->match_start = cur_match;
+ best_len = len;
+ if (len >= nice_match) break;
+#ifdef UNALIGNED_OK
+ scan_end = *(ushf*)(scan+best_len-1);
+#else
+ scan_end1 = scan[best_len-1];
+ scan_end = scan[best_len];
+#endif
+ }
+ } while ((cur_match = prev[cur_match & wmask]) > limit
+ && --chain_length != 0);
+
+ if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
+ return s->lookahead;
+}
+#endif /* ASMV */
+
+#else /* FASTEST */
+
+/* ---------------------------------------------------------------------------
+ * Optimized version for FASTEST only
+ */
+local uInt longest_match(s, cur_match)
+ deflate_state *s;
+ IPos cur_match; /* current match */
+{
+ register Bytef *scan = s->window + s->strstart; /* current string */
+ register Bytef *match; /* matched string */
+ register int len; /* length of current match */
+ register Bytef *strend = s->window + s->strstart + MAX_MATCH;
+
+ /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
+ * It is easy to get rid of this optimization if necessary.
+ */
+ Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
+
+ Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
+
+ Assert(cur_match < s->strstart, "no future");
+
+ match = s->window + cur_match;
+
+ /* Return failure if the match length is less than 2:
+ */
+ if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1;
+
+ /* The check at best_len-1 can be removed because it will be made
+ * again later. (This heuristic is not always a win.)
+ * It is not necessary to compare scan[2] and match[2] since they
+ * are always equal when the other bytes match, given that
+ * the hash keys are equal and that HASH_BITS >= 8.
+ */
+ scan += 2, match += 2;
+ Assert(*scan == *match, "match[2]?");
+
+ /* We check for insufficient lookahead only every 8th comparison;
+ * the 256th check will be made at strstart+258.
+ */
+ do {
+ } while (*++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ scan < strend);
+
+ Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+
+ len = MAX_MATCH - (int)(strend - scan);
+
+ if (len < MIN_MATCH) return MIN_MATCH - 1;
+
+ s->match_start = cur_match;
+ return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead;
+}
+
+#endif /* FASTEST */
+
+#ifdef DEBUG
+/* ===========================================================================
+ * Check that the match at match_start is indeed a match.
+ */
+local void check_match(s, start, match, length)
+ deflate_state *s;
+ IPos start, match;
+ int length;
+{
+ /* check that the match is indeed a match */
+ if (zmemcmp(s->window + match,
+ s->window + start, length) != EQUAL) {
+ fprintf(stderr, " start %u, match %u, length %d\n",
+ start, match, length);
+ do {
+ fprintf(stderr, "%c%c", s->window[match++], s->window[start++]);
+ } while (--length != 0);
+ z_error("invalid match");
+ }
+ if (z_verbose > 1) {
+ fprintf(stderr,"\\[%d,%d]", start-match, length);
+ do { putc(s->window[start++], stderr); } while (--length != 0);
+ }
+}
+#else
+# define check_match(s, start, match, length)
+#endif /* DEBUG */
+
+/* ===========================================================================
+ * Fill the window when the lookahead becomes insufficient.
+ * Updates strstart and lookahead.
+ *
+ * IN assertion: lookahead < MIN_LOOKAHEAD
+ * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD
+ * At least one byte has been read, or avail_in == 0; reads are
+ * performed for at least two bytes (required for the zip translate_eol
+ * option -- not supported here).
+ */
+local void fill_window(s)
+ deflate_state *s;
+{
+ register unsigned n, m;
+ register Posf *p;
+ unsigned more; /* Amount of free space at the end of the window. */
+ uInt wsize = s->w_size;
+
+ Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
+
+ do {
+ more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);
+
+ /* Deal with !@#$% 64K limit: */
+ if (sizeof(int) <= 2) {
+ if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
+ more = wsize;
+
+ } else if (more == (unsigned)(-1)) {
+ /* Very unlikely, but possible on 16 bit machine if
+ * strstart == 0 && lookahead == 1 (input done a byte at time)
+ */
+ more--;
+ }
+ }
+
+ /* If the window is almost full and there is insufficient lookahead,
+ * move the upper half to the lower one to make room in the upper half.
+ */
+ if (s->strstart >= wsize+MAX_DIST(s)) {
+
+ zmemcpy(s->window, s->window+wsize, (unsigned)wsize);
+ s->match_start -= wsize;
+ s->strstart -= wsize; /* we now have strstart >= MAX_DIST */
+ s->block_start -= (long) wsize;
+
+ /* Slide the hash table (could be avoided with 32 bit values
+ at the expense of memory usage). We slide even when level == 0
+ to keep the hash table consistent if we switch back to level > 0
+ later. (Using level 0 permanently is not an optimal usage of
+ zlib, so we don't care about this pathological case.)
+ */
+ n = s->hash_size;
+ p = &s->head[n];
+ do {
+ m = *--p;
+ *p = (Pos)(m >= wsize ? m-wsize : NIL);
+ } while (--n);
+
+ n = wsize;
+#ifndef FASTEST
+ p = &s->prev[n];
+ do {
+ m = *--p;
+ *p = (Pos)(m >= wsize ? m-wsize : NIL);
+ /* If n is not on any hash chain, prev[n] is garbage but
+ * its value will never be used.
+ */
+ } while (--n);
+#endif
+ more += wsize;
+ }
+ if (s->strm->avail_in == 0) break;
+
+ /* If there was no sliding:
+ * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
+ * more == window_size - lookahead - strstart
+ * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
+ * => more >= window_size - 2*WSIZE + 2
+ * In the BIG_MEM or MMAP case (not yet supported),
+ * window_size == input_size + MIN_LOOKAHEAD &&
+ * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
+ * Otherwise, window_size == 2*WSIZE so more >= 2.
+ * If there was sliding, more >= WSIZE. So in all cases, more >= 2.
+ */
+ Assert(more >= 2, "more < 2");
+
+ n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more);
+ s->lookahead += n;
+
+ /* Initialize the hash value now that we have some input: */
+ if (s->lookahead + s->insert >= MIN_MATCH) {
+ uInt str = s->strstart - s->insert;
+ s->ins_h = s->window[str];
+ UPDATE_HASH(s, s->ins_h, s->window[str + 1]);
+#if MIN_MATCH != 3
+ Call UPDATE_HASH() MIN_MATCH-3 more times
+#endif
+ while (s->insert) {
+ UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]);
+#ifndef FASTEST
+ s->prev[str & s->w_mask] = s->head[s->ins_h];
+#endif
+ s->head[s->ins_h] = (Pos)str;
+ str++;
+ s->insert--;
+ if (s->lookahead + s->insert < MIN_MATCH)
+ break;
+ }
+ }
+ /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
+ * but this is not important since only literal bytes will be emitted.
+ */
+
+ } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
+
+ /* If the WIN_INIT bytes after the end of the current data have never been
+ * written, then zero those bytes in order to avoid memory check reports of
+ * the use of uninitialized (or uninitialised as Julian writes) bytes by
+ * the longest match routines. Update the high water mark for the next
+ * time through here. WIN_INIT is set to MAX_MATCH since the longest match
+ * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
+ */
+ if (s->high_water < s->window_size) {
+ ulg curr = s->strstart + (ulg)(s->lookahead);
+ ulg init;
+
+ if (s->high_water < curr) {
+ /* Previous high water mark below current data -- zero WIN_INIT
+ * bytes or up to end of window, whichever is less.
+ */
+ init = s->window_size - curr;
+ if (init > WIN_INIT)
+ init = WIN_INIT;
+ zmemzero(s->window + curr, (unsigned)init);
+ s->high_water = curr + init;
+ }
+ else if (s->high_water < (ulg)curr + WIN_INIT) {
+ /* High water mark at or above current data, but below current data
+ * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up
+ * to end of window, whichever is less.
+ */
+ init = (ulg)curr + WIN_INIT - s->high_water;
+ if (init > s->window_size - s->high_water)
+ init = s->window_size - s->high_water;
+ zmemzero(s->window + s->high_water, (unsigned)init);
+ s->high_water += init;
+ }
+ }
+
+ Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
+ "not enough room for search");
+}
+
+/* ===========================================================================
+ * Flush the current block, with given end-of-file flag.
+ * IN assertion: strstart is set to the end of the current match.
+ */
+#define FLUSH_BLOCK_ONLY(s, last) { \
+ _tr_flush_block(s, (s->block_start >= 0L ? \
+ (charf *)&s->window[(unsigned)s->block_start] : \
+ (charf *)Z_NULL), \
+ (ulg)((long)s->strstart - s->block_start), \
+ (last)); \
+ s->block_start = s->strstart; \
+ flush_pending(s->strm); \
+ Tracev((stderr,"[FLUSH]")); \
+}
+
+/* Same but force premature exit if necessary. */
+#define FLUSH_BLOCK(s, last) { \
+ FLUSH_BLOCK_ONLY(s, last); \
+ if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
+}
+
+/* ===========================================================================
+ * Copy without compression as much as possible from the input stream, return
+ * the current block state.
+ * This function does not insert new strings in the dictionary since
+ * uncompressible data is probably not useful. This function is used
+ * only for the level=0 compression option.
+ * NOTE: this function should be optimized to avoid extra copying from
+ * window to pending_buf.
+ */
+local block_state deflate_stored(s, flush)
+ deflate_state *s;
+ int flush;
+{
+ /* Stored blocks are limited to 0xffff bytes, pending_buf is limited
+ * to pending_buf_size, and each stored block has a 5 byte header:
+ */
+ ulg max_block_size = 0xffff;
+ ulg max_start;
+
+ if (max_block_size > s->pending_buf_size - 5) {
+ max_block_size = s->pending_buf_size - 5;
+ }
+
+ /* Copy as much as possible from input to output: */
+ for (;;) {
+ /* Fill the window as much as possible: */
+ if (s->lookahead <= 1) {
+
+ Assert(s->strstart < s->w_size+MAX_DIST(s) ||
+ s->block_start >= (long)s->w_size, "slide too late");
+
+ fill_window(s);
+ if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more;
+
+ if (s->lookahead == 0) break; /* flush the current block */
+ }
+ Assert(s->block_start >= 0L, "block gone");
+
+ s->strstart += s->lookahead;
+ s->lookahead = 0;
+
+ /* Emit a stored block if pending_buf will be full: */
+ max_start = s->block_start + max_block_size;
+ if (s->strstart == 0 || (ulg)s->strstart >= max_start) {
+ /* strstart == 0 is possible when wraparound on 16-bit machine */
+ s->lookahead = (uInt)(s->strstart - max_start);
+ s->strstart = (uInt)max_start;
+ FLUSH_BLOCK(s, 0);
+ }
+ /* Flush if we may have to slide, otherwise block_start may become
+ * negative and the data will be gone:
+ */
+ if (s->strstart - (uInt)s->block_start >= MAX_DIST(s)) {
+ FLUSH_BLOCK(s, 0);
+ }
+ }
+ s->insert = 0;
+ if (flush == Z_FINISH) {
+ FLUSH_BLOCK(s, 1);
+ return finish_done;
+ }
+ if ((long)s->strstart > s->block_start)
+ FLUSH_BLOCK(s, 0);
+ return block_done;
+}
+
+/* ===========================================================================
+ * Compress as much as possible from the input stream, return the current
+ * block state.
+ * This function does not perform lazy evaluation of matches and inserts
+ * new strings in the dictionary only for unmatched strings or for short
+ * matches. It is used only for the fast compression options.
+ */
+local block_state deflate_fast(s, flush)
+ deflate_state *s;
+ int flush;
+{
+ IPos hash_head; /* head of the hash chain */
+ int bflush; /* set if current block must be flushed */
+
+ for (;;) {
+ /* Make sure that we always have enough lookahead, except
+ * at the end of the input file. We need MAX_MATCH bytes
+ * for the next match, plus MIN_MATCH bytes to insert the
+ * string following the next match.
+ */
+ if (s->lookahead < MIN_LOOKAHEAD) {
+ fill_window(s);
+ if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
+ return need_more;
+ }
+ if (s->lookahead == 0) break; /* flush the current block */
+ }
+
+ /* Insert the string window[strstart .. strstart+2] in the
+ * dictionary, and set hash_head to the head of the hash chain:
+ */
+ hash_head = NIL;
+ if (s->lookahead >= MIN_MATCH) {
+ INSERT_STRING(s, s->strstart, hash_head);
+ }
+
+ /* Find the longest match, discarding those <= prev_length.
+ * At this point we have always match_length < MIN_MATCH
+ */
+ if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) {
+ /* To simplify the code, we prevent matches with the string
+ * of window index 0 (in particular we have to avoid a match
+ * of the string with itself at the start of the input file).
+ */
+ s->match_length = longest_match (s, hash_head);
+ /* longest_match() sets match_start */
+ }
+ if (s->match_length >= MIN_MATCH) {
+ check_match(s, s->strstart, s->match_start, s->match_length);
+
+ _tr_tally_dist(s, s->strstart - s->match_start,
+ s->match_length - MIN_MATCH, bflush);
+
+ s->lookahead -= s->match_length;
+
+ /* Insert new strings in the hash table only if the match length
+ * is not too large. This saves time but degrades compression.
+ */
+#ifndef FASTEST
+ if (s->match_length <= s->max_insert_length &&
+ s->lookahead >= MIN_MATCH) {
+ s->match_length--; /* string at strstart already in table */
+ do {
+ s->strstart++;
+ INSERT_STRING(s, s->strstart, hash_head);
+ /* strstart never exceeds WSIZE-MAX_MATCH, so there are
+ * always MIN_MATCH bytes ahead.
+ */
+ } while (--s->match_length != 0);
+ s->strstart++;
+ } else
+#endif
+ {
+ s->strstart += s->match_length;
+ s->match_length = 0;
+ s->ins_h = s->window[s->strstart];
+ UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
+#if MIN_MATCH != 3
+ Call UPDATE_HASH() MIN_MATCH-3 more times
+#endif
+ /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
+ * matter since it will be recomputed at next deflate call.
+ */
+ }
+ } else {
+ /* No match, output a literal byte */
+ Tracevv((stderr,"%c", s->window[s->strstart]));
+ _tr_tally_lit (s, s->window[s->strstart], bflush);
+ s->lookahead--;
+ s->strstart++;
+ }
+ if (bflush) FLUSH_BLOCK(s, 0);
+ }
+ s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
+ if (flush == Z_FINISH) {
+ FLUSH_BLOCK(s, 1);
+ return finish_done;
+ }
+ if (s->last_lit)
+ FLUSH_BLOCK(s, 0);
+ return block_done;
+}
+
+#ifndef FASTEST
+/* ===========================================================================
+ * Same as above, but achieves better compression. We use a lazy
+ * evaluation for matches: a match is finally adopted only if there is
+ * no better match at the next window position.
+ */
+local block_state deflate_slow(s, flush)
+ deflate_state *s;
+ int flush;
+{
+ IPos hash_head; /* head of hash chain */
+ int bflush; /* set if current block must be flushed */
+
+ /* Process the input block. */
+ for (;;) {
+ /* Make sure that we always have enough lookahead, except
+ * at the end of the input file. We need MAX_MATCH bytes
+ * for the next match, plus MIN_MATCH bytes to insert the
+ * string following the next match.
+ */
+ if (s->lookahead < MIN_LOOKAHEAD) {
+ fill_window(s);
+ if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
+ return need_more;
+ }
+ if (s->lookahead == 0) break; /* flush the current block */
+ }
+
+ /* Insert the string window[strstart .. strstart+2] in the
+ * dictionary, and set hash_head to the head of the hash chain:
+ */
+ hash_head = NIL;
+ if (s->lookahead >= MIN_MATCH) {
+ INSERT_STRING(s, s->strstart, hash_head);
+ }
+
+ /* Find the longest match, discarding those <= prev_length.
+ */
+ s->prev_length = s->match_length, s->prev_match = s->match_start;
+ s->match_length = MIN_MATCH-1;
+
+ if (hash_head != NIL && s->prev_length < s->max_lazy_match &&
+ s->strstart - hash_head <= MAX_DIST(s)) {
+ /* To simplify the code, we prevent matches with the string
+ * of window index 0 (in particular we have to avoid a match
+ * of the string with itself at the start of the input file).
+ */
+ s->match_length = longest_match (s, hash_head);
+ /* longest_match() sets match_start */
+
+ if (s->match_length <= 5 && (s->strategy == Z_FILTERED
+#if TOO_FAR <= 32767
+ || (s->match_length == MIN_MATCH &&
+ s->strstart - s->match_start > TOO_FAR)
+#endif
+ )) {
+
+ /* If prev_match is also MIN_MATCH, match_start is garbage
+ * but we will ignore the current match anyway.
+ */
+ s->match_length = MIN_MATCH-1;
+ }
+ }
+ /* If there was a match at the previous step and the current
+ * match is not better, output the previous match:
+ */
+ if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) {
+ uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
+ /* Do not insert strings in hash table beyond this. */
+
+ check_match(s, s->strstart-1, s->prev_match, s->prev_length);
+
+ _tr_tally_dist(s, s->strstart -1 - s->prev_match,
+ s->prev_length - MIN_MATCH, bflush);
+
+ /* Insert in hash table all strings up to the end of the match.
+ * strstart-1 and strstart are already inserted. If there is not
+ * enough lookahead, the last two strings are not inserted in
+ * the hash table.
+ */
+ s->lookahead -= s->prev_length-1;
+ s->prev_length -= 2;
+ do {
+ if (++s->strstart <= max_insert) {
+ INSERT_STRING(s, s->strstart, hash_head);
+ }
+ } while (--s->prev_length != 0);
+ s->match_available = 0;
+ s->match_length = MIN_MATCH-1;
+ s->strstart++;
+
+ if (bflush) FLUSH_BLOCK(s, 0);
+
+ } else if (s->match_available) {
+ /* If there was no match at the previous position, output a
+ * single literal. If there was a match but the current match
+ * is longer, truncate the previous match to a single literal.
+ */
+ Tracevv((stderr,"%c", s->window[s->strstart-1]));
+ _tr_tally_lit(s, s->window[s->strstart-1], bflush);
+ if (bflush) {
+ FLUSH_BLOCK_ONLY(s, 0);
+ }
+ s->strstart++;
+ s->lookahead--;
+ if (s->strm->avail_out == 0) return need_more;
+ } else {
+ /* There is no previous match to compare with, wait for
+ * the next step to decide.
+ */
+ s->match_available = 1;
+ s->strstart++;
+ s->lookahead--;
+ }
+ }
+ Assert (flush != Z_NO_FLUSH, "no flush?");
+ if (s->match_available) {
+ Tracevv((stderr,"%c", s->window[s->strstart-1]));
+ _tr_tally_lit(s, s->window[s->strstart-1], bflush);
+ s->match_available = 0;
+ }
+ s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
+ if (flush == Z_FINISH) {
+ FLUSH_BLOCK(s, 1);
+ return finish_done;
+ }
+ if (s->last_lit)
+ FLUSH_BLOCK(s, 0);
+ return block_done;
+}
+#endif /* FASTEST */
+
+/* ===========================================================================
+ * For Z_RLE, simply look for runs of bytes, generate matches only of distance
+ * one. Do not maintain a hash table. (It will be regenerated if this run of
+ * deflate switches away from Z_RLE.)
+ */
+local block_state deflate_rle(s, flush)
+ deflate_state *s;
+ int flush;
+{
+ int bflush; /* set if current block must be flushed */
+ uInt prev; /* byte at distance one to match */
+ Bytef *scan, *strend; /* scan goes up to strend for length of run */
+
+ for (;;) {
+ /* Make sure that we always have enough lookahead, except
+ * at the end of the input file. We need MAX_MATCH bytes
+ * for the longest run, plus one for the unrolled loop.
+ */
+ if (s->lookahead <= MAX_MATCH) {
+ fill_window(s);
+ if (s->lookahead <= MAX_MATCH && flush == Z_NO_FLUSH) {
+ return need_more;
+ }
+ if (s->lookahead == 0) break; /* flush the current block */
+ }
+
+ /* See how many times the previous byte repeats */
+ s->match_length = 0;
+ if (s->lookahead >= MIN_MATCH && s->strstart > 0) {
+ scan = s->window + s->strstart - 1;
+ prev = *scan;
+ if (prev == *++scan && prev == *++scan && prev == *++scan) {
+ strend = s->window + s->strstart + MAX_MATCH;
+ do {
+ } while (prev == *++scan && prev == *++scan &&
+ prev == *++scan && prev == *++scan &&
+ prev == *++scan && prev == *++scan &&
+ prev == *++scan && prev == *++scan &&
+ scan < strend);
+ s->match_length = MAX_MATCH - (int)(strend - scan);
+ if (s->match_length > s->lookahead)
+ s->match_length = s->lookahead;
+ }
+ Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan");
+ }
+
+ /* Emit match if have run of MIN_MATCH or longer, else emit literal */
+ if (s->match_length >= MIN_MATCH) {
+ check_match(s, s->strstart, s->strstart - 1, s->match_length);
+
+ _tr_tally_dist(s, 1, s->match_length - MIN_MATCH, bflush);
+
+ s->lookahead -= s->match_length;
+ s->strstart += s->match_length;
+ s->match_length = 0;
+ } else {
+ /* No match, output a literal byte */
+ Tracevv((stderr,"%c", s->window[s->strstart]));
+ _tr_tally_lit (s, s->window[s->strstart], bflush);
+ s->lookahead--;
+ s->strstart++;
+ }
+ if (bflush) FLUSH_BLOCK(s, 0);
+ }
+ s->insert = 0;
+ if (flush == Z_FINISH) {
+ FLUSH_BLOCK(s, 1);
+ return finish_done;
+ }
+ if (s->last_lit)
+ FLUSH_BLOCK(s, 0);
+ return block_done;
+}
+
+/* ===========================================================================
+ * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.
+ * (It will be regenerated if this run of deflate switches away from Huffman.)
+ */
+local block_state deflate_huff(s, flush)
+ deflate_state *s;
+ int flush;
+{
+ int bflush; /* set if current block must be flushed */
+
+ for (;;) {
+ /* Make sure that we have a literal to write. */
+ if (s->lookahead == 0) {
+ fill_window(s);
+ if (s->lookahead == 0) {
+ if (flush == Z_NO_FLUSH)
+ return need_more;
+ break; /* flush the current block */
+ }
+ }
+
+ /* Output a literal byte */
+ s->match_length = 0;
+ Tracevv((stderr,"%c", s->window[s->strstart]));
+ _tr_tally_lit (s, s->window[s->strstart], bflush);
+ s->lookahead--;
+ s->strstart++;
+ if (bflush) FLUSH_BLOCK(s, 0);
+ }
+ s->insert = 0;
+ if (flush == Z_FINISH) {
+ FLUSH_BLOCK(s, 1);
+ return finish_done;
+ }
+ if (s->last_lit)
+ FLUSH_BLOCK(s, 0);
+ return block_done;
+}
diff --git a/protocols/Telegram/tgl/zlib/deflate.h b/protocols/Telegram/tgl/zlib/deflate.h
new file mode 100644
index 0000000000..ce0299edd1
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/deflate.h
@@ -0,0 +1,346 @@
+/* deflate.h -- internal compression state
+ * Copyright (C) 1995-2012 Jean-loup Gailly
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+/* @(#) $Id$ */
+
+#ifndef DEFLATE_H
+#define DEFLATE_H
+
+#include "zutil.h"
+
+/* define NO_GZIP when compiling if you want to disable gzip header and
+ trailer creation by deflate(). NO_GZIP would be used to avoid linking in
+ the crc code when it is not needed. For shared libraries, gzip encoding
+ should be left enabled. */
+#ifndef NO_GZIP
+# define GZIP
+#endif
+
+/* ===========================================================================
+ * Internal compression state.
+ */
+
+#define LENGTH_CODES 29
+/* number of length codes, not counting the special END_BLOCK code */
+
+#define LITERALS 256
+/* number of literal bytes 0..255 */
+
+#define L_CODES (LITERALS+1+LENGTH_CODES)
+/* number of Literal or Length codes, including the END_BLOCK code */
+
+#define D_CODES 30
+/* number of distance codes */
+
+#define BL_CODES 19
+/* number of codes used to transfer the bit lengths */
+
+#define HEAP_SIZE (2*L_CODES+1)
+/* maximum heap size */
+
+#define MAX_BITS 15
+/* All codes must not exceed MAX_BITS bits */
+
+#define Buf_size 16
+/* size of bit buffer in bi_buf */
+
+#define INIT_STATE 42
+#define EXTRA_STATE 69
+#define NAME_STATE 73
+#define COMMENT_STATE 91
+#define HCRC_STATE 103
+#define BUSY_STATE 113
+#define FINISH_STATE 666
+/* Stream status */
+
+
+/* Data structure describing a single value and its code string. */
+typedef struct ct_data_s {
+ union {
+ ush freq; /* frequency count */
+ ush code; /* bit string */
+ } fc;
+ union {
+ ush dad; /* father node in Huffman tree */
+ ush len; /* length of bit string */
+ } dl;
+} FAR ct_data;
+
+#define Freq fc.freq
+#define Code fc.code
+#define Dad dl.dad
+#define Len dl.len
+
+typedef struct static_tree_desc_s static_tree_desc;
+
+typedef struct tree_desc_s {
+ ct_data *dyn_tree; /* the dynamic tree */
+ int max_code; /* largest code with non zero frequency */
+ static_tree_desc *stat_desc; /* the corresponding static tree */
+} FAR tree_desc;
+
+typedef ush Pos;
+typedef Pos FAR Posf;
+typedef unsigned IPos;
+
+/* A Pos is an index in the character window. We use short instead of int to
+ * save space in the various tables. IPos is used only for parameter passing.
+ */
+
+typedef struct internal_state {
+ z_streamp strm; /* pointer back to this zlib stream */
+ int status; /* as the name implies */
+ Bytef *pending_buf; /* output still pending */
+ ulg pending_buf_size; /* size of pending_buf */
+ Bytef *pending_out; /* next pending byte to output to the stream */
+ uInt pending; /* nb of bytes in the pending buffer */
+ int wrap; /* bit 0 true for zlib, bit 1 true for gzip */
+ gz_headerp gzhead; /* gzip header information to write */
+ uInt gzindex; /* where in extra, name, or comment */
+ Byte method; /* can only be DEFLATED */
+ int last_flush; /* value of flush param for previous deflate call */
+
+ /* used by deflate.c: */
+
+ uInt w_size; /* LZ77 window size (32K by default) */
+ uInt w_bits; /* log2(w_size) (8..16) */
+ uInt w_mask; /* w_size - 1 */
+
+ Bytef *window;
+ /* Sliding window. Input bytes are read into the second half of the window,
+ * and move to the first half later to keep a dictionary of at least wSize
+ * bytes. With this organization, matches are limited to a distance of
+ * wSize-MAX_MATCH bytes, but this ensures that IO is always
+ * performed with a length multiple of the block size. Also, it limits
+ * the window size to 64K, which is quite useful on MSDOS.
+ * To do: use the user input buffer as sliding window.
+ */
+
+ ulg window_size;
+ /* Actual size of window: 2*wSize, except when the user input buffer
+ * is directly used as sliding window.
+ */
+
+ Posf *prev;
+ /* Link to older string with same hash index. To limit the size of this
+ * array to 64K, this link is maintained only for the last 32K strings.
+ * An index in this array is thus a window index modulo 32K.
+ */
+
+ Posf *head; /* Heads of the hash chains or NIL. */
+
+ uInt ins_h; /* hash index of string to be inserted */
+ uInt hash_size; /* number of elements in hash table */
+ uInt hash_bits; /* log2(hash_size) */
+ uInt hash_mask; /* hash_size-1 */
+
+ uInt hash_shift;
+ /* Number of bits by which ins_h must be shifted at each input
+ * step. It must be such that after MIN_MATCH steps, the oldest
+ * byte no longer takes part in the hash key, that is:
+ * hash_shift * MIN_MATCH >= hash_bits
+ */
+
+ long block_start;
+ /* Window position at the beginning of the current output block. Gets
+ * negative when the window is moved backwards.
+ */
+
+ uInt match_length; /* length of best match */
+ IPos prev_match; /* previous match */
+ int match_available; /* set if previous match exists */
+ uInt strstart; /* start of string to insert */
+ uInt match_start; /* start of matching string */
+ uInt lookahead; /* number of valid bytes ahead in window */
+
+ uInt prev_length;
+ /* Length of the best match at previous step. Matches not greater than this
+ * are discarded. This is used in the lazy match evaluation.
+ */
+
+ uInt max_chain_length;
+ /* To speed up deflation, hash chains are never searched beyond this
+ * length. A higher limit improves compression ratio but degrades the
+ * speed.
+ */
+
+ uInt max_lazy_match;
+ /* Attempt to find a better match only when the current match is strictly
+ * smaller than this value. This mechanism is used only for compression
+ * levels >= 4.
+ */
+# define max_insert_length max_lazy_match
+ /* Insert new strings in the hash table only if the match length is not
+ * greater than this length. This saves time but degrades compression.
+ * max_insert_length is used only for compression levels <= 3.
+ */
+
+ int level; /* compression level (1..9) */
+ int strategy; /* favor or force Huffman coding*/
+
+ uInt good_match;
+ /* Use a faster search when the previous match is longer than this */
+
+ int nice_match; /* Stop searching when current match exceeds this */
+
+ /* used by trees.c: */
+ /* Didn't use ct_data typedef below to suppress compiler warning */
+ struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */
+ struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
+ struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */
+
+ struct tree_desc_s l_desc; /* desc. for literal tree */
+ struct tree_desc_s d_desc; /* desc. for distance tree */
+ struct tree_desc_s bl_desc; /* desc. for bit length tree */
+
+ ush bl_count[MAX_BITS+1];
+ /* number of codes at each bit length for an optimal tree */
+
+ int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */
+ int heap_len; /* number of elements in the heap */
+ int heap_max; /* element of largest frequency */
+ /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
+ * The same heap array is used to build all trees.
+ */
+
+ uch depth[2*L_CODES+1];
+ /* Depth of each subtree used as tie breaker for trees of equal frequency
+ */
+
+ uchf *l_buf; /* buffer for literals or lengths */
+
+ uInt lit_bufsize;
+ /* Size of match buffer for literals/lengths. There are 4 reasons for
+ * limiting lit_bufsize to 64K:
+ * - frequencies can be kept in 16 bit counters
+ * - if compression is not successful for the first block, all input
+ * data is still in the window so we can still emit a stored block even
+ * when input comes from standard input. (This can also be done for
+ * all blocks if lit_bufsize is not greater than 32K.)
+ * - if compression is not successful for a file smaller than 64K, we can
+ * even emit a stored file instead of a stored block (saving 5 bytes).
+ * This is applicable only for zip (not gzip or zlib).
+ * - creating new Huffman trees less frequently may not provide fast
+ * adaptation to changes in the input data statistics. (Take for
+ * example a binary file with poorly compressible code followed by
+ * a highly compressible string table.) Smaller buffer sizes give
+ * fast adaptation but have of course the overhead of transmitting
+ * trees more frequently.
+ * - I can't count above 4
+ */
+
+ uInt last_lit; /* running index in l_buf */
+
+ ushf *d_buf;
+ /* Buffer for distances. To simplify the code, d_buf and l_buf have
+ * the same number of elements. To use different lengths, an extra flag
+ * array would be necessary.
+ */
+
+ ulg opt_len; /* bit length of current block with optimal trees */
+ ulg static_len; /* bit length of current block with static trees */
+ uInt matches; /* number of string matches in current block */
+ uInt insert; /* bytes at end of window left to insert */
+
+#ifdef DEBUG
+ ulg compressed_len; /* total bit length of compressed file mod 2^32 */
+ ulg bits_sent; /* bit length of compressed data sent mod 2^32 */
+#endif
+
+ ush bi_buf;
+ /* Output buffer. bits are inserted starting at the bottom (least
+ * significant bits).
+ */
+ int bi_valid;
+ /* Number of valid bits in bi_buf. All bits above the last valid bit
+ * are always zero.
+ */
+
+ ulg high_water;
+ /* High water mark offset in window for initialized bytes -- bytes above
+ * this are set to zero in order to avoid memory check warnings when
+ * longest match routines access bytes past the input. This is then
+ * updated to the new high water mark.
+ */
+
+} FAR deflate_state;
+
+/* Output a byte on the stream.
+ * IN assertion: there is enough room in pending_buf.
+ */
+#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);}
+
+
+#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
+/* Minimum amount of lookahead, except at the end of the input file.
+ * See deflate.c for comments about the MIN_MATCH+1.
+ */
+
+#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD)
+/* In order to simplify the code, particularly on 16 bit machines, match
+ * distances are limited to MAX_DIST instead of WSIZE.
+ */
+
+#define WIN_INIT MAX_MATCH
+/* Number of bytes after end of data in window to initialize in order to avoid
+ memory checker errors from longest match routines */
+
+ /* in trees.c */
+void ZLIB_INTERNAL _tr_init OF((deflate_state *s));
+int ZLIB_INTERNAL _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
+void ZLIB_INTERNAL _tr_flush_block OF((deflate_state *s, charf *buf,
+ ulg stored_len, int last));
+void ZLIB_INTERNAL _tr_flush_bits OF((deflate_state *s));
+void ZLIB_INTERNAL _tr_align OF((deflate_state *s));
+void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
+ ulg stored_len, int last));
+
+#define d_code(dist) \
+ ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
+/* Mapping from a distance to a distance code. dist is the distance - 1 and
+ * must not have side effects. _dist_code[256] and _dist_code[257] are never
+ * used.
+ */
+
+#ifndef DEBUG
+/* Inline versions of _tr_tally for speed: */
+
+#if defined(GEN_TREES_H) || !defined(STDC)
+ extern uch ZLIB_INTERNAL _length_code[];
+ extern uch ZLIB_INTERNAL _dist_code[];
+#else
+ extern const uch ZLIB_INTERNAL _length_code[];
+ extern const uch ZLIB_INTERNAL _dist_code[];
+#endif
+
+# define _tr_tally_lit(s, c, flush) \
+ { uch cc = (c); \
+ s->d_buf[s->last_lit] = 0; \
+ s->l_buf[s->last_lit++] = cc; \
+ s->dyn_ltree[cc].Freq++; \
+ flush = (s->last_lit == s->lit_bufsize-1); \
+ }
+# define _tr_tally_dist(s, distance, length, flush) \
+ { uch len = (length); \
+ ush dist = (distance); \
+ s->d_buf[s->last_lit] = dist; \
+ s->l_buf[s->last_lit++] = len; \
+ dist--; \
+ s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
+ s->dyn_dtree[d_code(dist)].Freq++; \
+ flush = (s->last_lit == s->lit_bufsize-1); \
+ }
+#else
+# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
+# define _tr_tally_dist(s, distance, length, flush) \
+ flush = _tr_tally(s, distance, length)
+#endif
+
+#endif /* DEFLATE_H */
diff --git a/protocols/Telegram/tgl/zlib/doc/algorithm.txt b/protocols/Telegram/tgl/zlib/doc/algorithm.txt
new file mode 100644
index 0000000000..c97f495020
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/doc/algorithm.txt
@@ -0,0 +1,209 @@
+1. Compression algorithm (deflate)
+
+The deflation algorithm used by gzip (also zip and zlib) is a variation of
+LZ77 (Lempel-Ziv 1977, see reference below). It finds duplicated strings in
+the input data. The second occurrence of a string is replaced by a
+pointer to the previous string, in the form of a pair (distance,
+length). Distances are limited to 32K bytes, and lengths are limited
+to 258 bytes. When a string does not occur anywhere in the previous
+32K bytes, it is emitted as a sequence of literal bytes. (In this
+description, `string' must be taken as an arbitrary sequence of bytes,
+and is not restricted to printable characters.)
+
+Literals or match lengths are compressed with one Huffman tree, and
+match distances are compressed with another tree. The trees are stored
+in a compact form at the start of each block. The blocks can have any
+size (except that the compressed data for one block must fit in
+available memory). A block is terminated when deflate() determines that
+it would be useful to start another block with fresh trees. (This is
+somewhat similar to the behavior of LZW-based _compress_.)
+
+Duplicated strings are found using a hash table. All input strings of
+length 3 are inserted in the hash table. A hash index is computed for
+the next 3 bytes. If the hash chain for this index is not empty, all
+strings in the chain are compared with the current input string, and
+the longest match is selected.
+
+The hash chains are searched starting with the most recent strings, to
+favor small distances and thus take advantage of the Huffman encoding.
+The hash chains are singly linked. There are no deletions from the
+hash chains, the algorithm simply discards matches that are too old.
+
+To avoid a worst-case situation, very long hash chains are arbitrarily
+truncated at a certain length, determined by a runtime option (level
+parameter of deflateInit). So deflate() does not always find the longest
+possible match but generally finds a match which is long enough.
+
+deflate() also defers the selection of matches with a lazy evaluation
+mechanism. After a match of length N has been found, deflate() searches for
+a longer match at the next input byte. If a longer match is found, the
+previous match is truncated to a length of one (thus producing a single
+literal byte) and the process of lazy evaluation begins again. Otherwise,
+the original match is kept, and the next match search is attempted only N
+steps later.
+
+The lazy match evaluation is also subject to a runtime parameter. If
+the current match is long enough, deflate() reduces the search for a longer
+match, thus speeding up the whole process. If compression ratio is more
+important than speed, deflate() attempts a complete second search even if
+the first match is already long enough.
+
+The lazy match evaluation is not performed for the fastest compression
+modes (level parameter 1 to 3). For these fast modes, new strings
+are inserted in the hash table only when no match was found, or
+when the match is not too long. This degrades the compression ratio
+but saves time since there are both fewer insertions and fewer searches.
+
+
+2. Decompression algorithm (inflate)
+
+2.1 Introduction
+
+The key question is how to represent a Huffman code (or any prefix code) so
+that you can decode fast. The most important characteristic is that shorter
+codes are much more common than longer codes, so pay attention to decoding the
+short codes fast, and let the long codes take longer to decode.
+
+inflate() sets up a first level table that covers some number of bits of
+input less than the length of longest code. It gets that many bits from the
+stream, and looks it up in the table. The table will tell if the next
+code is that many bits or less and how many, and if it is, it will tell
+the value, else it will point to the next level table for which inflate()
+grabs more bits and tries to decode a longer code.
+
+How many bits to make the first lookup is a tradeoff between the time it
+takes to decode and the time it takes to build the table. If building the
+table took no time (and if you had infinite memory), then there would only
+be a first level table to cover all the way to the longest code. However,
+building the table ends up taking a lot longer for more bits since short
+codes are replicated many times in such a table. What inflate() does is
+simply to make the number of bits in the first table a variable, and then
+to set that variable for the maximum speed.
+
+For inflate, which has 286 possible codes for the literal/length tree, the size
+of the first table is nine bits. Also the distance trees have 30 possible
+values, and the size of the first table is six bits. Note that for each of
+those cases, the table ended up one bit longer than the ``average'' code
+length, i.e. the code length of an approximately flat code which would be a
+little more than eight bits for 286 symbols and a little less than five bits
+for 30 symbols.
+
+
+2.2 More details on the inflate table lookup
+
+Ok, you want to know what this cleverly obfuscated inflate tree actually
+looks like. You are correct that it's not a Huffman tree. It is simply a
+lookup table for the first, let's say, nine bits of a Huffman symbol. The
+symbol could be as short as one bit or as long as 15 bits. If a particular
+symbol is shorter than nine bits, then that symbol's translation is duplicated
+in all those entries that start with that symbol's bits. For example, if the
+symbol is four bits, then it's duplicated 32 times in a nine-bit table. If a
+symbol is nine bits long, it appears in the table once.
+
+If the symbol is longer than nine bits, then that entry in the table points
+to another similar table for the remaining bits. Again, there are duplicated
+entries as needed. The idea is that most of the time the symbol will be short
+and there will only be one table look up. (That's whole idea behind data
+compression in the first place.) For the less frequent long symbols, there
+will be two lookups. If you had a compression method with really long
+symbols, you could have as many levels of lookups as is efficient. For
+inflate, two is enough.
+
+So a table entry either points to another table (in which case nine bits in
+the above example are gobbled), or it contains the translation for the symbol
+and the number of bits to gobble. Then you start again with the next
+ungobbled bit.
+
+You may wonder: why not just have one lookup table for how ever many bits the
+longest symbol is? The reason is that if you do that, you end up spending
+more time filling in duplicate symbol entries than you do actually decoding.
+At least for deflate's output that generates new trees every several 10's of
+kbytes. You can imagine that filling in a 2^15 entry table for a 15-bit code
+would take too long if you're only decoding several thousand symbols. At the
+other extreme, you could make a new table for every bit in the code. In fact,
+that's essentially a Huffman tree. But then you spend too much time
+traversing the tree while decoding, even for short symbols.
+
+So the number of bits for the first lookup table is a trade of the time to
+fill out the table vs. the time spent looking at the second level and above of
+the table.
+
+Here is an example, scaled down:
+
+The code being decoded, with 10 symbols, from 1 to 6 bits long:
+
+A: 0
+B: 10
+C: 1100
+D: 11010
+E: 11011
+F: 11100
+G: 11101
+H: 11110
+I: 111110
+J: 111111
+
+Let's make the first table three bits long (eight entries):
+
+000: A,1
+001: A,1
+010: A,1
+011: A,1
+100: B,2
+101: B,2
+110: -> table X (gobble 3 bits)
+111: -> table Y (gobble 3 bits)
+
+Each entry is what the bits decode as and how many bits that is, i.e. how
+many bits to gobble. Or the entry points to another table, with the number of
+bits to gobble implicit in the size of the table.
+
+Table X is two bits long since the longest code starting with 110 is five bits
+long:
+
+00: C,1
+01: C,1
+10: D,2
+11: E,2
+
+Table Y is three bits long since the longest code starting with 111 is six
+bits long:
+
+000: F,2
+001: F,2
+010: G,2
+011: G,2
+100: H,2
+101: H,2
+110: I,3
+111: J,3
+
+So what we have here are three tables with a total of 20 entries that had to
+be constructed. That's compared to 64 entries for a single table. Or
+compared to 16 entries for a Huffman tree (six two entry tables and one four
+entry table). Assuming that the code ideally represents the probability of
+the symbols, it takes on the average 1.25 lookups per symbol. That's compared
+to one lookup for the single table, or 1.66 lookups per symbol for the
+Huffman tree.
+
+There, I think that gives you a picture of what's going on. For inflate, the
+meaning of a particular symbol is often more than just a letter. It can be a
+byte (a "literal"), or it can be either a length or a distance which
+indicates a base value and a number of bits to fetch after the code that is
+added to the base value. Or it might be the special end-of-block code. The
+data structures created in inftrees.c try to encode all that information
+compactly in the tables.
+
+
+Jean-loup Gailly Mark Adler
+jloup@gzip.org madler@alumni.caltech.edu
+
+
+References:
+
+[LZ77] Ziv J., Lempel A., ``A Universal Algorithm for Sequential Data
+Compression,'' IEEE Transactions on Information Theory, Vol. 23, No. 3,
+pp. 337-343.
+
+``DEFLATE Compressed Data Format Specification'' available in
+http://tools.ietf.org/html/rfc1951
diff --git a/protocols/Telegram/tgl/zlib/doc/rfc1950.txt b/protocols/Telegram/tgl/zlib/doc/rfc1950.txt
new file mode 100644
index 0000000000..ce6428a0f2
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/doc/rfc1950.txt
@@ -0,0 +1,619 @@
+
+
+
+
+
+
+Network Working Group P. Deutsch
+Request for Comments: 1950 Aladdin Enterprises
+Category: Informational J-L. Gailly
+ Info-ZIP
+ May 1996
+
+
+ ZLIB Compressed Data Format Specification version 3.3
+
+Status of This Memo
+
+ This memo provides information for the Internet community. This memo
+ does not specify an Internet standard of any kind. Distribution of
+ this memo is unlimited.
+
+IESG Note:
+
+ The IESG takes no position on the validity of any Intellectual
+ Property Rights statements contained in this document.
+
+Notices
+
+ Copyright (c) 1996 L. Peter Deutsch and Jean-Loup Gailly
+
+ Permission is granted to copy and distribute this document for any
+ purpose and without charge, including translations into other
+ languages and incorporation into compilations, provided that the
+ copyright notice and this notice are preserved, and that any
+ substantive changes or deletions from the original are clearly
+ marked.
+
+ A pointer to the latest version of this and related documentation in
+ HTML format can be found at the URL
+ <ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html>.
+
+Abstract
+
+ This specification defines a lossless compressed data format. The
+ data can be produced or consumed, even for an arbitrarily long
+ sequentially presented input data stream, using only an a priori
+ bounded amount of intermediate storage. The format presently uses
+ the DEFLATE compression method but can be easily extended to use
+ other compression methods. It can be implemented readily in a manner
+ not covered by patents. This specification also defines the ADLER-32
+ checksum (an extension and improvement of the Fletcher checksum),
+ used for detection of data corruption, and provides an algorithm for
+ computing it.
+
+
+
+
+Deutsch & Gailly Informational [Page 1]
+
+RFC 1950 ZLIB Compressed Data Format Specification May 1996
+
+
+Table of Contents
+
+ 1. Introduction ................................................... 2
+ 1.1. Purpose ................................................... 2
+ 1.2. Intended audience ......................................... 3
+ 1.3. Scope ..................................................... 3
+ 1.4. Compliance ................................................ 3
+ 1.5. Definitions of terms and conventions used ................ 3
+ 1.6. Changes from previous versions ............................ 3
+ 2. Detailed specification ......................................... 3
+ 2.1. Overall conventions ....................................... 3
+ 2.2. Data format ............................................... 4
+ 2.3. Compliance ................................................ 7
+ 3. References ..................................................... 7
+ 4. Source code .................................................... 8
+ 5. Security Considerations ........................................ 8
+ 6. Acknowledgements ............................................... 8
+ 7. Authors' Addresses ............................................. 8
+ 8. Appendix: Rationale ............................................ 9
+ 9. Appendix: Sample code ..........................................10
+
+1. Introduction
+
+ 1.1. Purpose
+
+ The purpose of this specification is to define a lossless
+ compressed data format that:
+
+ * Is independent of CPU type, operating system, file system,
+ and character set, and hence can be used for interchange;
+
+ * Can be produced or consumed, even for an arbitrarily long
+ sequentially presented input data stream, using only an a
+ priori bounded amount of intermediate storage, and hence can
+ be used in data communications or similar structures such as
+ Unix filters;
+
+ * Can use a number of different compression methods;
+
+ * Can be implemented readily in a manner not covered by
+ patents, and hence can be practiced freely.
+
+ The data format defined by this specification does not attempt to
+ allow random access to compressed data.
+
+
+
+
+
+
+
+Deutsch & Gailly Informational [Page 2]
+
+RFC 1950 ZLIB Compressed Data Format Specification May 1996
+
+
+ 1.2. Intended audience
+
+ This specification is intended for use by implementors of software
+ to compress data into zlib format and/or decompress data from zlib
+ format.
+
+ The text of the specification assumes a basic background in
+ programming at the level of bits and other primitive data
+ representations.
+
+ 1.3. Scope
+
+ The specification specifies a compressed data format that can be
+ used for in-memory compression of a sequence of arbitrary bytes.
+
+ 1.4. Compliance
+
+ Unless otherwise indicated below, a compliant decompressor must be
+ able to accept and decompress any data set that conforms to all
+ the specifications presented here; a compliant compressor must
+ produce data sets that conform to all the specifications presented
+ here.
+
+ 1.5. Definitions of terms and conventions used
+
+ byte: 8 bits stored or transmitted as a unit (same as an octet).
+ (For this specification, a byte is exactly 8 bits, even on
+ machines which store a character on a number of bits different
+ from 8.) See below, for the numbering of bits within a byte.
+
+ 1.6. Changes from previous versions
+
+ Version 3.1 was the first public release of this specification.
+ In version 3.2, some terminology was changed and the Adler-32
+ sample code was rewritten for clarity. In version 3.3, the
+ support for a preset dictionary was introduced, and the
+ specification was converted to RFC style.
+
+2. Detailed specification
+
+ 2.1. Overall conventions
+
+ In the diagrams below, a box like this:
+
+ +---+
+ | | <-- the vertical bars might be missing
+ +---+
+
+
+
+
+Deutsch & Gailly Informational [Page 3]
+
+RFC 1950 ZLIB Compressed Data Format Specification May 1996
+
+
+ represents one byte; a box like this:
+
+ +==============+
+ | |
+ +==============+
+
+ represents a variable number of bytes.
+
+ Bytes stored within a computer do not have a "bit order", since
+ they are always treated as a unit. However, a byte considered as
+ an integer between 0 and 255 does have a most- and least-
+ significant bit, and since we write numbers with the most-
+ significant digit on the left, we also write bytes with the most-
+ significant bit on the left. In the diagrams below, we number the
+ bits of a byte so that bit 0 is the least-significant bit, i.e.,
+ the bits are numbered:
+
+ +--------+
+ |76543210|
+ +--------+
+
+ Within a computer, a number may occupy multiple bytes. All
+ multi-byte numbers in the format described here are stored with
+ the MOST-significant byte first (at the lower memory address).
+ For example, the decimal number 520 is stored as:
+
+ 0 1
+ +--------+--------+
+ |00000010|00001000|
+ +--------+--------+
+ ^ ^
+ | |
+ | + less significant byte = 8
+ + more significant byte = 2 x 256
+
+ 2.2. Data format
+
+ A zlib stream has the following structure:
+
+ 0 1
+ +---+---+
+ |CMF|FLG| (more-->)
+ +---+---+
+
+
+
+
+
+
+
+
+Deutsch & Gailly Informational [Page 4]
+
+RFC 1950 ZLIB Compressed Data Format Specification May 1996
+
+
+ (if FLG.FDICT set)
+
+ 0 1 2 3
+ +---+---+---+---+
+ | DICTID | (more-->)
+ +---+---+---+---+
+
+ +=====================+---+---+---+---+
+ |...compressed data...| ADLER32 |
+ +=====================+---+---+---+---+
+
+ Any data which may appear after ADLER32 are not part of the zlib
+ stream.
+
+ CMF (Compression Method and flags)
+ This byte is divided into a 4-bit compression method and a 4-
+ bit information field depending on the compression method.
+
+ bits 0 to 3 CM Compression method
+ bits 4 to 7 CINFO Compression info
+
+ CM (Compression method)
+ This identifies the compression method used in the file. CM = 8
+ denotes the "deflate" compression method with a window size up
+ to 32K. This is the method used by gzip and PNG (see
+ references [1] and [2] in Chapter 3, below, for the reference
+ documents). CM = 15 is reserved. It might be used in a future
+ version of this specification to indicate the presence of an
+ extra field before the compressed data.
+
+ CINFO (Compression info)
+ For CM = 8, CINFO is the base-2 logarithm of the LZ77 window
+ size, minus eight (CINFO=7 indicates a 32K window size). Values
+ of CINFO above 7 are not allowed in this version of the
+ specification. CINFO is not defined in this specification for
+ CM not equal to 8.
+
+ FLG (FLaGs)
+ This flag byte is divided as follows:
+
+ bits 0 to 4 FCHECK (check bits for CMF and FLG)
+ bit 5 FDICT (preset dictionary)
+ bits 6 to 7 FLEVEL (compression level)
+
+ The FCHECK value must be such that CMF and FLG, when viewed as
+ a 16-bit unsigned integer stored in MSB order (CMF*256 + FLG),
+ is a multiple of 31.
+
+
+
+
+Deutsch & Gailly Informational [Page 5]
+
+RFC 1950 ZLIB Compressed Data Format Specification May 1996
+
+
+ FDICT (Preset dictionary)
+ If FDICT is set, a DICT dictionary identifier is present
+ immediately after the FLG byte. The dictionary is a sequence of
+ bytes which are initially fed to the compressor without
+ producing any compressed output. DICT is the Adler-32 checksum
+ of this sequence of bytes (see the definition of ADLER32
+ below). The decompressor can use this identifier to determine
+ which dictionary has been used by the compressor.
+
+ FLEVEL (Compression level)
+ These flags are available for use by specific compression
+ methods. The "deflate" method (CM = 8) sets these flags as
+ follows:
+
+ 0 - compressor used fastest algorithm
+ 1 - compressor used fast algorithm
+ 2 - compressor used default algorithm
+ 3 - compressor used maximum compression, slowest algorithm
+
+ The information in FLEVEL is not needed for decompression; it
+ is there to indicate if recompression might be worthwhile.
+
+ compressed data
+ For compression method 8, the compressed data is stored in the
+ deflate compressed data format as described in the document
+ "DEFLATE Compressed Data Format Specification" by L. Peter
+ Deutsch. (See reference [3] in Chapter 3, below)
+
+ Other compressed data formats are not specified in this version
+ of the zlib specification.
+
+ ADLER32 (Adler-32 checksum)
+ This contains a checksum value of the uncompressed data
+ (excluding any dictionary data) computed according to Adler-32
+ algorithm. This algorithm is a 32-bit extension and improvement
+ of the Fletcher algorithm, used in the ITU-T X.224 / ISO 8073
+ standard. See references [4] and [5] in Chapter 3, below)
+
+ Adler-32 is composed of two sums accumulated per byte: s1 is
+ the sum of all bytes, s2 is the sum of all s1 values. Both sums
+ are done modulo 65521. s1 is initialized to 1, s2 to zero. The
+ Adler-32 checksum is stored as s2*65536 + s1 in most-
+ significant-byte first (network) order.
+
+
+
+
+
+
+
+
+Deutsch & Gailly Informational [Page 6]
+
+RFC 1950 ZLIB Compressed Data Format Specification May 1996
+
+
+ 2.3. Compliance
+
+ A compliant compressor must produce streams with correct CMF, FLG
+ and ADLER32, but need not support preset dictionaries. When the
+ zlib data format is used as part of another standard data format,
+ the compressor may use only preset dictionaries that are specified
+ by this other data format. If this other format does not use the
+ preset dictionary feature, the compressor must not set the FDICT
+ flag.
+
+ A compliant decompressor must check CMF, FLG, and ADLER32, and
+ provide an error indication if any of these have incorrect values.
+ A compliant decompressor must give an error indication if CM is
+ not one of the values defined in this specification (only the
+ value 8 is permitted in this version), since another value could
+ indicate the presence of new features that would cause subsequent
+ data to be interpreted incorrectly. A compliant decompressor must
+ give an error indication if FDICT is set and DICTID is not the
+ identifier of a known preset dictionary. A decompressor may
+ ignore FLEVEL and still be compliant. When the zlib data format
+ is being used as a part of another standard format, a compliant
+ decompressor must support all the preset dictionaries specified by
+ the other format. When the other format does not use the preset
+ dictionary feature, a compliant decompressor must reject any
+ stream in which the FDICT flag is set.
+
+3. References
+
+ [1] Deutsch, L.P.,"GZIP Compressed Data Format Specification",
+ available in ftp://ftp.uu.net/pub/archiving/zip/doc/
+
+ [2] Thomas Boutell, "PNG (Portable Network Graphics) specification",
+ available in ftp://ftp.uu.net/graphics/png/documents/
+
+ [3] Deutsch, L.P.,"DEFLATE Compressed Data Format Specification",
+ available in ftp://ftp.uu.net/pub/archiving/zip/doc/
+
+ [4] Fletcher, J. G., "An Arithmetic Checksum for Serial
+ Transmissions," IEEE Transactions on Communications, Vol. COM-30,
+ No. 1, January 1982, pp. 247-252.
+
+ [5] ITU-T Recommendation X.224, Annex D, "Checksum Algorithms,"
+ November, 1993, pp. 144, 145. (Available from
+ gopher://info.itu.ch). ITU-T X.244 is also the same as ISO 8073.
+
+
+
+
+
+
+
+Deutsch & Gailly Informational [Page 7]
+
+RFC 1950 ZLIB Compressed Data Format Specification May 1996
+
+
+4. Source code
+
+ Source code for a C language implementation of a "zlib" compliant
+ library is available at ftp://ftp.uu.net/pub/archiving/zip/zlib/.
+
+5. Security Considerations
+
+ A decoder that fails to check the ADLER32 checksum value may be
+ subject to undetected data corruption.
+
+6. Acknowledgements
+
+ Trademarks cited in this document are the property of their
+ respective owners.
+
+ Jean-Loup Gailly and Mark Adler designed the zlib format and wrote
+ the related software described in this specification. Glenn
+ Randers-Pehrson converted this document to RFC and HTML format.
+
+7. Authors' Addresses
+
+ L. Peter Deutsch
+ Aladdin Enterprises
+ 203 Santa Margarita Ave.
+ Menlo Park, CA 94025
+
+ Phone: (415) 322-0103 (AM only)
+ FAX: (415) 322-1734
+ EMail: <ghost@aladdin.com>
+
+
+ Jean-Loup Gailly
+
+ EMail: <gzip@prep.ai.mit.edu>
+
+ Questions about the technical content of this specification can be
+ sent by email to
+
+ Jean-Loup Gailly <gzip@prep.ai.mit.edu> and
+ Mark Adler <madler@alumni.caltech.edu>
+
+ Editorial comments on this specification can be sent by email to
+
+ L. Peter Deutsch <ghost@aladdin.com> and
+ Glenn Randers-Pehrson <randeg@alumni.rpi.edu>
+
+
+
+
+
+
+Deutsch & Gailly Informational [Page 8]
+
+RFC 1950 ZLIB Compressed Data Format Specification May 1996
+
+
+8. Appendix: Rationale
+
+ 8.1. Preset dictionaries
+
+ A preset dictionary is specially useful to compress short input
+ sequences. The compressor can take advantage of the dictionary
+ context to encode the input in a more compact manner. The
+ decompressor can be initialized with the appropriate context by
+ virtually decompressing a compressed version of the dictionary
+ without producing any output. However for certain compression
+ algorithms such as the deflate algorithm this operation can be
+ achieved without actually performing any decompression.
+
+ The compressor and the decompressor must use exactly the same
+ dictionary. The dictionary may be fixed or may be chosen among a
+ certain number of predefined dictionaries, according to the kind
+ of input data. The decompressor can determine which dictionary has
+ been chosen by the compressor by checking the dictionary
+ identifier. This document does not specify the contents of
+ predefined dictionaries, since the optimal dictionaries are
+ application specific. Standard data formats using this feature of
+ the zlib specification must precisely define the allowed
+ dictionaries.
+
+ 8.2. The Adler-32 algorithm
+
+ The Adler-32 algorithm is much faster than the CRC32 algorithm yet
+ still provides an extremely low probability of undetected errors.
+
+ The modulo on unsigned long accumulators can be delayed for 5552
+ bytes, so the modulo operation time is negligible. If the bytes
+ are a, b, c, the second sum is 3a + 2b + c + 3, and so is position
+ and order sensitive, unlike the first sum, which is just a
+ checksum. That 65521 is prime is important to avoid a possible
+ large class of two-byte errors that leave the check unchanged.
+ (The Fletcher checksum uses 255, which is not prime and which also
+ makes the Fletcher check insensitive to single byte changes 0 <->
+ 255.)
+
+ The sum s1 is initialized to 1 instead of zero to make the length
+ of the sequence part of s2, so that the length does not have to be
+ checked separately. (Any sequence of zeroes has a Fletcher
+ checksum of zero.)
+
+
+
+
+
+
+
+
+Deutsch & Gailly Informational [Page 9]
+
+RFC 1950 ZLIB Compressed Data Format Specification May 1996
+
+
+9. Appendix: Sample code
+
+ The following C code computes the Adler-32 checksum of a data buffer.
+ It is written for clarity, not for speed. The sample code is in the
+ ANSI C programming language. Non C users may find it easier to read
+ with these hints:
+
+ & Bitwise AND operator.
+ >> Bitwise right shift operator. When applied to an
+ unsigned quantity, as here, right shift inserts zero bit(s)
+ at the left.
+ << Bitwise left shift operator. Left shift inserts zero
+ bit(s) at the right.
+ ++ "n++" increments the variable n.
+ % modulo operator: a % b is the remainder of a divided by b.
+
+ #define BASE 65521 /* largest prime smaller than 65536 */
+
+ /*
+ Update a running Adler-32 checksum with the bytes buf[0..len-1]
+ and return the updated checksum. The Adler-32 checksum should be
+ initialized to 1.
+
+ Usage example:
+
+ unsigned long adler = 1L;
+
+ while (read_buffer(buffer, length) != EOF) {
+ adler = update_adler32(adler, buffer, length);
+ }
+ if (adler != original_adler) error();
+ */
+ unsigned long update_adler32(unsigned long adler,
+ unsigned char *buf, int len)
+ {
+ unsigned long s1 = adler & 0xffff;
+ unsigned long s2 = (adler >> 16) & 0xffff;
+ int n;
+
+ for (n = 0; n < len; n++) {
+ s1 = (s1 + buf[n]) % BASE;
+ s2 = (s2 + s1) % BASE;
+ }
+ return (s2 << 16) + s1;
+ }
+
+ /* Return the adler32 of the bytes buf[0..len-1] */
+
+
+
+
+Deutsch & Gailly Informational [Page 10]
+
+RFC 1950 ZLIB Compressed Data Format Specification May 1996
+
+
+ unsigned long adler32(unsigned char *buf, int len)
+ {
+ return update_adler32(1L, buf, len);
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Deutsch & Gailly Informational [Page 11]
+
diff --git a/protocols/Telegram/tgl/zlib/doc/rfc1951.txt b/protocols/Telegram/tgl/zlib/doc/rfc1951.txt
new file mode 100644
index 0000000000..403c8c722f
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/doc/rfc1951.txt
@@ -0,0 +1,955 @@
+
+
+
+
+
+
+Network Working Group P. Deutsch
+Request for Comments: 1951 Aladdin Enterprises
+Category: Informational May 1996
+
+
+ DEFLATE Compressed Data Format Specification version 1.3
+
+Status of This Memo
+
+ This memo provides information for the Internet community. This memo
+ does not specify an Internet standard of any kind. Distribution of
+ this memo is unlimited.
+
+IESG Note:
+
+ The IESG takes no position on the validity of any Intellectual
+ Property Rights statements contained in this document.
+
+Notices
+
+ Copyright (c) 1996 L. Peter Deutsch
+
+ Permission is granted to copy and distribute this document for any
+ purpose and without charge, including translations into other
+ languages and incorporation into compilations, provided that the
+ copyright notice and this notice are preserved, and that any
+ substantive changes or deletions from the original are clearly
+ marked.
+
+ A pointer to the latest version of this and related documentation in
+ HTML format can be found at the URL
+ <ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html>.
+
+Abstract
+
+ This specification defines a lossless compressed data format that
+ compresses data using a combination of the LZ77 algorithm and Huffman
+ coding, with efficiency comparable to the best currently available
+ general-purpose compression methods. The data can be produced or
+ consumed, even for an arbitrarily long sequentially presented input
+ data stream, using only an a priori bounded amount of intermediate
+ storage. The format can be implemented readily in a manner not
+ covered by patents.
+
+
+
+
+
+
+
+
+Deutsch Informational [Page 1]
+
+RFC 1951 DEFLATE Compressed Data Format Specification May 1996
+
+
+Table of Contents
+
+ 1. Introduction ................................................... 2
+ 1.1. Purpose ................................................... 2
+ 1.2. Intended audience ......................................... 3
+ 1.3. Scope ..................................................... 3
+ 1.4. Compliance ................................................ 3
+ 1.5. Definitions of terms and conventions used ................ 3
+ 1.6. Changes from previous versions ............................ 4
+ 2. Compressed representation overview ............................. 4
+ 3. Detailed specification ......................................... 5
+ 3.1. Overall conventions ....................................... 5
+ 3.1.1. Packing into bytes .................................. 5
+ 3.2. Compressed block format ................................... 6
+ 3.2.1. Synopsis of prefix and Huffman coding ............... 6
+ 3.2.2. Use of Huffman coding in the "deflate" format ....... 7
+ 3.2.3. Details of block format ............................. 9
+ 3.2.4. Non-compressed blocks (BTYPE=00) ................... 11
+ 3.2.5. Compressed blocks (length and distance codes) ...... 11
+ 3.2.6. Compression with fixed Huffman codes (BTYPE=01) .... 12
+ 3.2.7. Compression with dynamic Huffman codes (BTYPE=10) .. 13
+ 3.3. Compliance ............................................... 14
+ 4. Compression algorithm details ................................. 14
+ 5. References .................................................... 16
+ 6. Security Considerations ....................................... 16
+ 7. Source code ................................................... 16
+ 8. Acknowledgements .............................................. 16
+ 9. Author's Address .............................................. 17
+
+1. Introduction
+
+ 1.1. Purpose
+
+ The purpose of this specification is to define a lossless
+ compressed data format that:
+ * Is independent of CPU type, operating system, file system,
+ and character set, and hence can be used for interchange;
+ * Can be produced or consumed, even for an arbitrarily long
+ sequentially presented input data stream, using only an a
+ priori bounded amount of intermediate storage, and hence
+ can be used in data communications or similar structures
+ such as Unix filters;
+ * Compresses data with efficiency comparable to the best
+ currently available general-purpose compression methods,
+ and in particular considerably better than the "compress"
+ program;
+ * Can be implemented readily in a manner not covered by
+ patents, and hence can be practiced freely;
+
+
+
+Deutsch Informational [Page 2]
+
+RFC 1951 DEFLATE Compressed Data Format Specification May 1996
+
+
+ * Is compatible with the file format produced by the current
+ widely used gzip utility, in that conforming decompressors
+ will be able to read data produced by the existing gzip
+ compressor.
+
+ The data format defined by this specification does not attempt to:
+
+ * Allow random access to compressed data;
+ * Compress specialized data (e.g., raster graphics) as well
+ as the best currently available specialized algorithms.
+
+ A simple counting argument shows that no lossless compression
+ algorithm can compress every possible input data set. For the
+ format defined here, the worst case expansion is 5 bytes per 32K-
+ byte block, i.e., a size increase of 0.015% for large data sets.
+ English text usually compresses by a factor of 2.5 to 3;
+ executable files usually compress somewhat less; graphical data
+ such as raster images may compress much more.
+
+ 1.2. Intended audience
+
+ This specification is intended for use by implementors of software
+ to compress data into "deflate" format and/or decompress data from
+ "deflate" format.
+
+ The text of the specification assumes a basic background in
+ programming at the level of bits and other primitive data
+ representations. Familiarity with the technique of Huffman coding
+ is helpful but not required.
+
+ 1.3. Scope
+
+ The specification specifies a method for representing a sequence
+ of bytes as a (usually shorter) sequence of bits, and a method for
+ packing the latter bit sequence into bytes.
+
+ 1.4. Compliance
+
+ Unless otherwise indicated below, a compliant decompressor must be
+ able to accept and decompress any data set that conforms to all
+ the specifications presented here; a compliant compressor must
+ produce data sets that conform to all the specifications presented
+ here.
+
+ 1.5. Definitions of terms and conventions used
+
+ Byte: 8 bits stored or transmitted as a unit (same as an octet).
+ For this specification, a byte is exactly 8 bits, even on machines
+
+
+
+Deutsch Informational [Page 3]
+
+RFC 1951 DEFLATE Compressed Data Format Specification May 1996
+
+
+ which store a character on a number of bits different from eight.
+ See below, for the numbering of bits within a byte.
+
+ String: a sequence of arbitrary bytes.
+
+ 1.6. Changes from previous versions
+
+ There have been no technical changes to the deflate format since
+ version 1.1 of this specification. In version 1.2, some
+ terminology was changed. Version 1.3 is a conversion of the
+ specification to RFC style.
+
+2. Compressed representation overview
+
+ A compressed data set consists of a series of blocks, corresponding
+ to successive blocks of input data. The block sizes are arbitrary,
+ except that non-compressible blocks are limited to 65,535 bytes.
+
+ Each block is compressed using a combination of the LZ77 algorithm
+ and Huffman coding. The Huffman trees for each block are independent
+ of those for previous or subsequent blocks; the LZ77 algorithm may
+ use a reference to a duplicated string occurring in a previous block,
+ up to 32K input bytes before.
+
+ Each block consists of two parts: a pair of Huffman code trees that
+ describe the representation of the compressed data part, and a
+ compressed data part. (The Huffman trees themselves are compressed
+ using Huffman encoding.) The compressed data consists of a series of
+ elements of two types: literal bytes (of strings that have not been
+ detected as duplicated within the previous 32K input bytes), and
+ pointers to duplicated strings, where a pointer is represented as a
+ pair <length, backward distance>. The representation used in the
+ "deflate" format limits distances to 32K bytes and lengths to 258
+ bytes, but does not limit the size of a block, except for
+ uncompressible blocks, which are limited as noted above.
+
+ Each type of value (literals, distances, and lengths) in the
+ compressed data is represented using a Huffman code, using one code
+ tree for literals and lengths and a separate code tree for distances.
+ The code trees for each block appear in a compact form just before
+ the compressed data for that block.
+
+
+
+
+
+
+
+
+
+
+Deutsch Informational [Page 4]
+
+RFC 1951 DEFLATE Compressed Data Format Specification May 1996
+
+
+3. Detailed specification
+
+ 3.1. Overall conventions In the diagrams below, a box like this:
+
+ +---+
+ | | <-- the vertical bars might be missing
+ +---+
+
+ represents one byte; a box like this:
+
+ +==============+
+ | |
+ +==============+
+
+ represents a variable number of bytes.
+
+ Bytes stored within a computer do not have a "bit order", since
+ they are always treated as a unit. However, a byte considered as
+ an integer between 0 and 255 does have a most- and least-
+ significant bit, and since we write numbers with the most-
+ significant digit on the left, we also write bytes with the most-
+ significant bit on the left. In the diagrams below, we number the
+ bits of a byte so that bit 0 is the least-significant bit, i.e.,
+ the bits are numbered:
+
+ +--------+
+ |76543210|
+ +--------+
+
+ Within a computer, a number may occupy multiple bytes. All
+ multi-byte numbers in the format described here are stored with
+ the least-significant byte first (at the lower memory address).
+ For example, the decimal number 520 is stored as:
+
+ 0 1
+ +--------+--------+
+ |00001000|00000010|
+ +--------+--------+
+ ^ ^
+ | |
+ | + more significant byte = 2 x 256
+ + less significant byte = 8
+
+ 3.1.1. Packing into bytes
+
+ This document does not address the issue of the order in which
+ bits of a byte are transmitted on a bit-sequential medium,
+ since the final data format described here is byte- rather than
+
+
+
+Deutsch Informational [Page 5]
+
+RFC 1951 DEFLATE Compressed Data Format Specification May 1996
+
+
+ bit-oriented. However, we describe the compressed block format
+ in below, as a sequence of data elements of various bit
+ lengths, not a sequence of bytes. We must therefore specify
+ how to pack these data elements into bytes to form the final
+ compressed byte sequence:
+
+ * Data elements are packed into bytes in order of
+ increasing bit number within the byte, i.e., starting
+ with the least-significant bit of the byte.
+ * Data elements other than Huffman codes are packed
+ starting with the least-significant bit of the data
+ element.
+ * Huffman codes are packed starting with the most-
+ significant bit of the code.
+
+ In other words, if one were to print out the compressed data as
+ a sequence of bytes, starting with the first byte at the
+ *right* margin and proceeding to the *left*, with the most-
+ significant bit of each byte on the left as usual, one would be
+ able to parse the result from right to left, with fixed-width
+ elements in the correct MSB-to-LSB order and Huffman codes in
+ bit-reversed order (i.e., with the first bit of the code in the
+ relative LSB position).
+
+ 3.2. Compressed block format
+
+ 3.2.1. Synopsis of prefix and Huffman coding
+
+ Prefix coding represents symbols from an a priori known
+ alphabet by bit sequences (codes), one code for each symbol, in
+ a manner such that different symbols may be represented by bit
+ sequences of different lengths, but a parser can always parse
+ an encoded string unambiguously symbol-by-symbol.
+
+ We define a prefix code in terms of a binary tree in which the
+ two edges descending from each non-leaf node are labeled 0 and
+ 1 and in which the leaf nodes correspond one-for-one with (are
+ labeled with) the symbols of the alphabet; then the code for a
+ symbol is the sequence of 0's and 1's on the edges leading from
+ the root to the leaf labeled with that symbol. For example:
+
+
+
+
+
+
+
+
+
+
+
+Deutsch Informational [Page 6]
+
+RFC 1951 DEFLATE Compressed Data Format Specification May 1996
+
+
+ /\ Symbol Code
+ 0 1 ------ ----
+ / \ A 00
+ /\ B B 1
+ 0 1 C 011
+ / \ D 010
+ A /\
+ 0 1
+ / \
+ D C
+
+ A parser can decode the next symbol from an encoded input
+ stream by walking down the tree from the root, at each step
+ choosing the edge corresponding to the next input bit.
+
+ Given an alphabet with known symbol frequencies, the Huffman
+ algorithm allows the construction of an optimal prefix code
+ (one which represents strings with those symbol frequencies
+ using the fewest bits of any possible prefix codes for that
+ alphabet). Such a code is called a Huffman code. (See
+ reference [1] in Chapter 5, references for additional
+ information on Huffman codes.)
+
+ Note that in the "deflate" format, the Huffman codes for the
+ various alphabets must not exceed certain maximum code lengths.
+ This constraint complicates the algorithm for computing code
+ lengths from symbol frequencies. Again, see Chapter 5,
+ references for details.
+
+ 3.2.2. Use of Huffman coding in the "deflate" format
+
+ The Huffman codes used for each alphabet in the "deflate"
+ format have two additional rules:
+
+ * All codes of a given bit length have lexicographically
+ consecutive values, in the same order as the symbols
+ they represent;
+
+ * Shorter codes lexicographically precede longer codes.
+
+
+
+
+
+
+
+
+
+
+
+
+Deutsch Informational [Page 7]
+
+RFC 1951 DEFLATE Compressed Data Format Specification May 1996
+
+
+ We could recode the example above to follow this rule as
+ follows, assuming that the order of the alphabet is ABCD:
+
+ Symbol Code
+ ------ ----
+ A 10
+ B 0
+ C 110
+ D 111
+
+ I.e., 0 precedes 10 which precedes 11x, and 110 and 111 are
+ lexicographically consecutive.
+
+ Given this rule, we can define the Huffman code for an alphabet
+ just by giving the bit lengths of the codes for each symbol of
+ the alphabet in order; this is sufficient to determine the
+ actual codes. In our example, the code is completely defined
+ by the sequence of bit lengths (2, 1, 3, 3). The following
+ algorithm generates the codes as integers, intended to be read
+ from most- to least-significant bit. The code lengths are
+ initially in tree[I].Len; the codes are produced in
+ tree[I].Code.
+
+ 1) Count the number of codes for each code length. Let
+ bl_count[N] be the number of codes of length N, N >= 1.
+
+ 2) Find the numerical value of the smallest code for each
+ code length:
+
+ code = 0;
+ bl_count[0] = 0;
+ for (bits = 1; bits <= MAX_BITS; bits++) {
+ code = (code + bl_count[bits-1]) << 1;
+ next_code[bits] = code;
+ }
+
+ 3) Assign numerical values to all codes, using consecutive
+ values for all codes of the same length with the base
+ values determined at step 2. Codes that are never used
+ (which have a bit length of zero) must not be assigned a
+ value.
+
+ for (n = 0; n <= max_code; n++) {
+ len = tree[n].Len;
+ if (len != 0) {
+ tree[n].Code = next_code[len];
+ next_code[len]++;
+ }
+
+
+
+Deutsch Informational [Page 8]
+
+RFC 1951 DEFLATE Compressed Data Format Specification May 1996
+
+
+ }
+
+ Example:
+
+ Consider the alphabet ABCDEFGH, with bit lengths (3, 3, 3, 3,
+ 3, 2, 4, 4). After step 1, we have:
+
+ N bl_count[N]
+ - -----------
+ 2 1
+ 3 5
+ 4 2
+
+ Step 2 computes the following next_code values:
+
+ N next_code[N]
+ - ------------
+ 1 0
+ 2 0
+ 3 2
+ 4 14
+
+ Step 3 produces the following code values:
+
+ Symbol Length Code
+ ------ ------ ----
+ A 3 010
+ B 3 011
+ C 3 100
+ D 3 101
+ E 3 110
+ F 2 00
+ G 4 1110
+ H 4 1111
+
+ 3.2.3. Details of block format
+
+ Each block of compressed data begins with 3 header bits
+ containing the following data:
+
+ first bit BFINAL
+ next 2 bits BTYPE
+
+ Note that the header bits do not necessarily begin on a byte
+ boundary, since a block does not necessarily occupy an integral
+ number of bytes.
+
+
+
+
+
+Deutsch Informational [Page 9]
+
+RFC 1951 DEFLATE Compressed Data Format Specification May 1996
+
+
+ BFINAL is set if and only if this is the last block of the data
+ set.
+
+ BTYPE specifies how the data are compressed, as follows:
+
+ 00 - no compression
+ 01 - compressed with fixed Huffman codes
+ 10 - compressed with dynamic Huffman codes
+ 11 - reserved (error)
+
+ The only difference between the two compressed cases is how the
+ Huffman codes for the literal/length and distance alphabets are
+ defined.
+
+ In all cases, the decoding algorithm for the actual data is as
+ follows:
+
+ do
+ read block header from input stream.
+ if stored with no compression
+ skip any remaining bits in current partially
+ processed byte
+ read LEN and NLEN (see next section)
+ copy LEN bytes of data to output
+ otherwise
+ if compressed with dynamic Huffman codes
+ read representation of code trees (see
+ subsection below)
+ loop (until end of block code recognized)
+ decode literal/length value from input stream
+ if value < 256
+ copy value (literal byte) to output stream
+ otherwise
+ if value = end of block (256)
+ break from loop
+ otherwise (value = 257..285)
+ decode distance from input stream
+
+ move backwards distance bytes in the output
+ stream, and copy length bytes from this
+ position to the output stream.
+ end loop
+ while not last block
+
+ Note that a duplicated string reference may refer to a string
+ in a previous block; i.e., the backward distance may cross one
+ or more block boundaries. However a distance cannot refer past
+ the beginning of the output stream. (An application using a
+
+
+
+Deutsch Informational [Page 10]
+
+RFC 1951 DEFLATE Compressed Data Format Specification May 1996
+
+
+ preset dictionary might discard part of the output stream; a
+ distance can refer to that part of the output stream anyway)
+ Note also that the referenced string may overlap the current
+ position; for example, if the last 2 bytes decoded have values
+ X and Y, a string reference with <length = 5, distance = 2>
+ adds X,Y,X,Y,X to the output stream.
+
+ We now specify each compression method in turn.
+
+ 3.2.4. Non-compressed blocks (BTYPE=00)
+
+ Any bits of input up to the next byte boundary are ignored.
+ The rest of the block consists of the following information:
+
+ 0 1 2 3 4...
+ +---+---+---+---+================================+
+ | LEN | NLEN |... LEN bytes of literal data...|
+ +---+---+---+---+================================+
+
+ LEN is the number of data bytes in the block. NLEN is the
+ one's complement of LEN.
+
+ 3.2.5. Compressed blocks (length and distance codes)
+
+ As noted above, encoded data blocks in the "deflate" format
+ consist of sequences of symbols drawn from three conceptually
+ distinct alphabets: either literal bytes, from the alphabet of
+ byte values (0..255), or <length, backward distance> pairs,
+ where the length is drawn from (3..258) and the distance is
+ drawn from (1..32,768). In fact, the literal and length
+ alphabets are merged into a single alphabet (0..285), where
+ values 0..255 represent literal bytes, the value 256 indicates
+ end-of-block, and values 257..285 represent length codes
+ (possibly in conjunction with extra bits following the symbol
+ code) as follows:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Deutsch Informational [Page 11]
+
+RFC 1951 DEFLATE Compressed Data Format Specification May 1996
+
+
+ Extra Extra Extra
+ Code Bits Length(s) Code Bits Lengths Code Bits Length(s)
+ ---- ---- ------ ---- ---- ------- ---- ---- -------
+ 257 0 3 267 1 15,16 277 4 67-82
+ 258 0 4 268 1 17,18 278 4 83-98
+ 259 0 5 269 2 19-22 279 4 99-114
+ 260 0 6 270 2 23-26 280 4 115-130
+ 261 0 7 271 2 27-30 281 5 131-162
+ 262 0 8 272 2 31-34 282 5 163-194
+ 263 0 9 273 3 35-42 283 5 195-226
+ 264 0 10 274 3 43-50 284 5 227-257
+ 265 1 11,12 275 3 51-58 285 0 258
+ 266 1 13,14 276 3 59-66
+
+ The extra bits should be interpreted as a machine integer
+ stored with the most-significant bit first, e.g., bits 1110
+ represent the value 14.
+
+ Extra Extra Extra
+ Code Bits Dist Code Bits Dist Code Bits Distance
+ ---- ---- ---- ---- ---- ------ ---- ---- --------
+ 0 0 1 10 4 33-48 20 9 1025-1536
+ 1 0 2 11 4 49-64 21 9 1537-2048
+ 2 0 3 12 5 65-96 22 10 2049-3072
+ 3 0 4 13 5 97-128 23 10 3073-4096
+ 4 1 5,6 14 6 129-192 24 11 4097-6144
+ 5 1 7,8 15 6 193-256 25 11 6145-8192
+ 6 2 9-12 16 7 257-384 26 12 8193-12288
+ 7 2 13-16 17 7 385-512 27 12 12289-16384
+ 8 3 17-24 18 8 513-768 28 13 16385-24576
+ 9 3 25-32 19 8 769-1024 29 13 24577-32768
+
+ 3.2.6. Compression with fixed Huffman codes (BTYPE=01)
+
+ The Huffman codes for the two alphabets are fixed, and are not
+ represented explicitly in the data. The Huffman code lengths
+ for the literal/length alphabet are:
+
+ Lit Value Bits Codes
+ --------- ---- -----
+ 0 - 143 8 00110000 through
+ 10111111
+ 144 - 255 9 110010000 through
+ 111111111
+ 256 - 279 7 0000000 through
+ 0010111
+ 280 - 287 8 11000000 through
+ 11000111
+
+
+
+Deutsch Informational [Page 12]
+
+RFC 1951 DEFLATE Compressed Data Format Specification May 1996
+
+
+ The code lengths are sufficient to generate the actual codes,
+ as described above; we show the codes in the table for added
+ clarity. Literal/length values 286-287 will never actually
+ occur in the compressed data, but participate in the code
+ construction.
+
+ Distance codes 0-31 are represented by (fixed-length) 5-bit
+ codes, with possible additional bits as shown in the table
+ shown in Paragraph 3.2.5, above. Note that distance codes 30-
+ 31 will never actually occur in the compressed data.
+
+ 3.2.7. Compression with dynamic Huffman codes (BTYPE=10)
+
+ The Huffman codes for the two alphabets appear in the block
+ immediately after the header bits and before the actual
+ compressed data, first the literal/length code and then the
+ distance code. Each code is defined by a sequence of code
+ lengths, as discussed in Paragraph 3.2.2, above. For even
+ greater compactness, the code length sequences themselves are
+ compressed using a Huffman code. The alphabet for code lengths
+ is as follows:
+
+ 0 - 15: Represent code lengths of 0 - 15
+ 16: Copy the previous code length 3 - 6 times.
+ The next 2 bits indicate repeat length
+ (0 = 3, ... , 3 = 6)
+ Example: Codes 8, 16 (+2 bits 11),
+ 16 (+2 bits 10) will expand to
+ 12 code lengths of 8 (1 + 6 + 5)
+ 17: Repeat a code length of 0 for 3 - 10 times.
+ (3 bits of length)
+ 18: Repeat a code length of 0 for 11 - 138 times
+ (7 bits of length)
+
+ A code length of 0 indicates that the corresponding symbol in
+ the literal/length or distance alphabet will not occur in the
+ block, and should not participate in the Huffman code
+ construction algorithm given earlier. If only one distance
+ code is used, it is encoded using one bit, not zero bits; in
+ this case there is a single code length of one, with one unused
+ code. One distance code of zero bits means that there are no
+ distance codes used at all (the data is all literals).
+
+ We can now define the format of the block:
+
+ 5 Bits: HLIT, # of Literal/Length codes - 257 (257 - 286)
+ 5 Bits: HDIST, # of Distance codes - 1 (1 - 32)
+ 4 Bits: HCLEN, # of Code Length codes - 4 (4 - 19)
+
+
+
+Deutsch Informational [Page 13]
+
+RFC 1951 DEFLATE Compressed Data Format Specification May 1996
+
+
+ (HCLEN + 4) x 3 bits: code lengths for the code length
+ alphabet given just above, in the order: 16, 17, 18,
+ 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15
+
+ These code lengths are interpreted as 3-bit integers
+ (0-7); as above, a code length of 0 means the
+ corresponding symbol (literal/length or distance code
+ length) is not used.
+
+ HLIT + 257 code lengths for the literal/length alphabet,
+ encoded using the code length Huffman code
+
+ HDIST + 1 code lengths for the distance alphabet,
+ encoded using the code length Huffman code
+
+ The actual compressed data of the block,
+ encoded using the literal/length and distance Huffman
+ codes
+
+ The literal/length symbol 256 (end of data),
+ encoded using the literal/length Huffman code
+
+ The code length repeat codes can cross from HLIT + 257 to the
+ HDIST + 1 code lengths. In other words, all code lengths form
+ a single sequence of HLIT + HDIST + 258 values.
+
+ 3.3. Compliance
+
+ A compressor may limit further the ranges of values specified in
+ the previous section and still be compliant; for example, it may
+ limit the range of backward pointers to some value smaller than
+ 32K. Similarly, a compressor may limit the size of blocks so that
+ a compressible block fits in memory.
+
+ A compliant decompressor must accept the full range of possible
+ values defined in the previous section, and must accept blocks of
+ arbitrary size.
+
+4. Compression algorithm details
+
+ While it is the intent of this document to define the "deflate"
+ compressed data format without reference to any particular
+ compression algorithm, the format is related to the compressed
+ formats produced by LZ77 (Lempel-Ziv 1977, see reference [2] below);
+ since many variations of LZ77 are patented, it is strongly
+ recommended that the implementor of a compressor follow the general
+ algorithm presented here, which is known not to be patented per se.
+ The material in this section is not part of the definition of the
+
+
+
+Deutsch Informational [Page 14]
+
+RFC 1951 DEFLATE Compressed Data Format Specification May 1996
+
+
+ specification per se, and a compressor need not follow it in order to
+ be compliant.
+
+ The compressor terminates a block when it determines that starting a
+ new block with fresh trees would be useful, or when the block size
+ fills up the compressor's block buffer.
+
+ The compressor uses a chained hash table to find duplicated strings,
+ using a hash function that operates on 3-byte sequences. At any
+ given point during compression, let XYZ be the next 3 input bytes to
+ be examined (not necessarily all different, of course). First, the
+ compressor examines the hash chain for XYZ. If the chain is empty,
+ the compressor simply writes out X as a literal byte and advances one
+ byte in the input. If the hash chain is not empty, indicating that
+ the sequence XYZ (or, if we are unlucky, some other 3 bytes with the
+ same hash function value) has occurred recently, the compressor
+ compares all strings on the XYZ hash chain with the actual input data
+ sequence starting at the current point, and selects the longest
+ match.
+
+ The compressor searches the hash chains starting with the most recent
+ strings, to favor small distances and thus take advantage of the
+ Huffman encoding. The hash chains are singly linked. There are no
+ deletions from the hash chains; the algorithm simply discards matches
+ that are too old. To avoid a worst-case situation, very long hash
+ chains are arbitrarily truncated at a certain length, determined by a
+ run-time parameter.
+
+ To improve overall compression, the compressor optionally defers the
+ selection of matches ("lazy matching"): after a match of length N has
+ been found, the compressor searches for a longer match starting at
+ the next input byte. If it finds a longer match, it truncates the
+ previous match to a length of one (thus producing a single literal
+ byte) and then emits the longer match. Otherwise, it emits the
+ original match, and, as described above, advances N bytes before
+ continuing.
+
+ Run-time parameters also control this "lazy match" procedure. If
+ compression ratio is most important, the compressor attempts a
+ complete second search regardless of the length of the first match.
+ In the normal case, if the current match is "long enough", the
+ compressor reduces the search for a longer match, thus speeding up
+ the process. If speed is most important, the compressor inserts new
+ strings in the hash table only when no match was found, or when the
+ match is not "too long". This degrades the compression ratio but
+ saves time since there are both fewer insertions and fewer searches.
+
+
+
+
+
+Deutsch Informational [Page 15]
+
+RFC 1951 DEFLATE Compressed Data Format Specification May 1996
+
+
+5. References
+
+ [1] Huffman, D. A., "A Method for the Construction of Minimum
+ Redundancy Codes", Proceedings of the Institute of Radio
+ Engineers, September 1952, Volume 40, Number 9, pp. 1098-1101.
+
+ [2] Ziv J., Lempel A., "A Universal Algorithm for Sequential Data
+ Compression", IEEE Transactions on Information Theory, Vol. 23,
+ No. 3, pp. 337-343.
+
+ [3] Gailly, J.-L., and Adler, M., ZLIB documentation and sources,
+ available in ftp://ftp.uu.net/pub/archiving/zip/doc/
+
+ [4] Gailly, J.-L., and Adler, M., GZIP documentation and sources,
+ available as gzip-*.tar in ftp://prep.ai.mit.edu/pub/gnu/
+
+ [5] Schwartz, E. S., and Kallick, B. "Generating a canonical prefix
+ encoding." Comm. ACM, 7,3 (Mar. 1964), pp. 166-169.
+
+ [6] Hirschberg and Lelewer, "Efficient decoding of prefix codes,"
+ Comm. ACM, 33,4, April 1990, pp. 449-459.
+
+6. Security Considerations
+
+ Any data compression method involves the reduction of redundancy in
+ the data. Consequently, any corruption of the data is likely to have
+ severe effects and be difficult to correct. Uncompressed text, on
+ the other hand, will probably still be readable despite the presence
+ of some corrupted bytes.
+
+ It is recommended that systems using this data format provide some
+ means of validating the integrity of the compressed data. See
+ reference [3], for example.
+
+7. Source code
+
+ Source code for a C language implementation of a "deflate" compliant
+ compressor and decompressor is available within the zlib package at
+ ftp://ftp.uu.net/pub/archiving/zip/zlib/.
+
+8. Acknowledgements
+
+ Trademarks cited in this document are the property of their
+ respective owners.
+
+ Phil Katz designed the deflate format. Jean-Loup Gailly and Mark
+ Adler wrote the related software described in this specification.
+ Glenn Randers-Pehrson converted this document to RFC and HTML format.
+
+
+
+Deutsch Informational [Page 16]
+
+RFC 1951 DEFLATE Compressed Data Format Specification May 1996
+
+
+9. Author's Address
+
+ L. Peter Deutsch
+ Aladdin Enterprises
+ 203 Santa Margarita Ave.
+ Menlo Park, CA 94025
+
+ Phone: (415) 322-0103 (AM only)
+ FAX: (415) 322-1734
+ EMail: <ghost@aladdin.com>
+
+ Questions about the technical content of this specification can be
+ sent by email to:
+
+ Jean-Loup Gailly <gzip@prep.ai.mit.edu> and
+ Mark Adler <madler@alumni.caltech.edu>
+
+ Editorial comments on this specification can be sent by email to:
+
+ L. Peter Deutsch <ghost@aladdin.com> and
+ Glenn Randers-Pehrson <randeg@alumni.rpi.edu>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Deutsch Informational [Page 17]
+
diff --git a/protocols/Telegram/tgl/zlib/doc/rfc1952.txt b/protocols/Telegram/tgl/zlib/doc/rfc1952.txt
new file mode 100644
index 0000000000..a8e51b4567
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/doc/rfc1952.txt
@@ -0,0 +1,675 @@
+
+
+
+
+
+
+Network Working Group P. Deutsch
+Request for Comments: 1952 Aladdin Enterprises
+Category: Informational May 1996
+
+
+ GZIP file format specification version 4.3
+
+Status of This Memo
+
+ This memo provides information for the Internet community. This memo
+ does not specify an Internet standard of any kind. Distribution of
+ this memo is unlimited.
+
+IESG Note:
+
+ The IESG takes no position on the validity of any Intellectual
+ Property Rights statements contained in this document.
+
+Notices
+
+ Copyright (c) 1996 L. Peter Deutsch
+
+ Permission is granted to copy and distribute this document for any
+ purpose and without charge, including translations into other
+ languages and incorporation into compilations, provided that the
+ copyright notice and this notice are preserved, and that any
+ substantive changes or deletions from the original are clearly
+ marked.
+
+ A pointer to the latest version of this and related documentation in
+ HTML format can be found at the URL
+ <ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html>.
+
+Abstract
+
+ This specification defines a lossless compressed data format that is
+ compatible with the widely used GZIP utility. The format includes a
+ cyclic redundancy check value for detecting data corruption. The
+ format presently uses the DEFLATE method of compression but can be
+ easily extended to use other compression methods. The format can be
+ implemented readily in a manner not covered by patents.
+
+
+
+
+
+
+
+
+
+
+Deutsch Informational [Page 1]
+
+RFC 1952 GZIP File Format Specification May 1996
+
+
+Table of Contents
+
+ 1. Introduction ................................................... 2
+ 1.1. Purpose ................................................... 2
+ 1.2. Intended audience ......................................... 3
+ 1.3. Scope ..................................................... 3
+ 1.4. Compliance ................................................ 3
+ 1.5. Definitions of terms and conventions used ................. 3
+ 1.6. Changes from previous versions ............................ 3
+ 2. Detailed specification ......................................... 4
+ 2.1. Overall conventions ....................................... 4
+ 2.2. File format ............................................... 5
+ 2.3. Member format ............................................. 5
+ 2.3.1. Member header and trailer ........................... 6
+ 2.3.1.1. Extra field ................................... 8
+ 2.3.1.2. Compliance .................................... 9
+ 3. References .................................................. 9
+ 4. Security Considerations .................................... 10
+ 5. Acknowledgements ........................................... 10
+ 6. Author's Address ........................................... 10
+ 7. Appendix: Jean-Loup Gailly's gzip utility .................. 11
+ 8. Appendix: Sample CRC Code .................................. 11
+
+1. Introduction
+
+ 1.1. Purpose
+
+ The purpose of this specification is to define a lossless
+ compressed data format that:
+
+ * Is independent of CPU type, operating system, file system,
+ and character set, and hence can be used for interchange;
+ * Can compress or decompress a data stream (as opposed to a
+ randomly accessible file) to produce another data stream,
+ using only an a priori bounded amount of intermediate
+ storage, and hence can be used in data communications or
+ similar structures such as Unix filters;
+ * Compresses data with efficiency comparable to the best
+ currently available general-purpose compression methods,
+ and in particular considerably better than the "compress"
+ program;
+ * Can be implemented readily in a manner not covered by
+ patents, and hence can be practiced freely;
+ * Is compatible with the file format produced by the current
+ widely used gzip utility, in that conforming decompressors
+ will be able to read data produced by the existing gzip
+ compressor.
+
+
+
+
+Deutsch Informational [Page 2]
+
+RFC 1952 GZIP File Format Specification May 1996
+
+
+ The data format defined by this specification does not attempt to:
+
+ * Provide random access to compressed data;
+ * Compress specialized data (e.g., raster graphics) as well as
+ the best currently available specialized algorithms.
+
+ 1.2. Intended audience
+
+ This specification is intended for use by implementors of software
+ to compress data into gzip format and/or decompress data from gzip
+ format.
+
+ The text of the specification assumes a basic background in
+ programming at the level of bits and other primitive data
+ representations.
+
+ 1.3. Scope
+
+ The specification specifies a compression method and a file format
+ (the latter assuming only that a file can store a sequence of
+ arbitrary bytes). It does not specify any particular interface to
+ a file system or anything about character sets or encodings
+ (except for file names and comments, which are optional).
+
+ 1.4. Compliance
+
+ Unless otherwise indicated below, a compliant decompressor must be
+ able to accept and decompress any file that conforms to all the
+ specifications presented here; a compliant compressor must produce
+ files that conform to all the specifications presented here. The
+ material in the appendices is not part of the specification per se
+ and is not relevant to compliance.
+
+ 1.5. Definitions of terms and conventions used
+
+ byte: 8 bits stored or transmitted as a unit (same as an octet).
+ (For this specification, a byte is exactly 8 bits, even on
+ machines which store a character on a number of bits different
+ from 8.) See below for the numbering of bits within a byte.
+
+ 1.6. Changes from previous versions
+
+ There have been no technical changes to the gzip format since
+ version 4.1 of this specification. In version 4.2, some
+ terminology was changed, and the sample CRC code was rewritten for
+ clarity and to eliminate the requirement for the caller to do pre-
+ and post-conditioning. Version 4.3 is a conversion of the
+ specification to RFC style.
+
+
+
+Deutsch Informational [Page 3]
+
+RFC 1952 GZIP File Format Specification May 1996
+
+
+2. Detailed specification
+
+ 2.1. Overall conventions
+
+ In the diagrams below, a box like this:
+
+ +---+
+ | | <-- the vertical bars might be missing
+ +---+
+
+ represents one byte; a box like this:
+
+ +==============+
+ | |
+ +==============+
+
+ represents a variable number of bytes.
+
+ Bytes stored within a computer do not have a "bit order", since
+ they are always treated as a unit. However, a byte considered as
+ an integer between 0 and 255 does have a most- and least-
+ significant bit, and since we write numbers with the most-
+ significant digit on the left, we also write bytes with the most-
+ significant bit on the left. In the diagrams below, we number the
+ bits of a byte so that bit 0 is the least-significant bit, i.e.,
+ the bits are numbered:
+
+ +--------+
+ |76543210|
+ +--------+
+
+ This document does not address the issue of the order in which
+ bits of a byte are transmitted on a bit-sequential medium, since
+ the data format described here is byte- rather than bit-oriented.
+
+ Within a computer, a number may occupy multiple bytes. All
+ multi-byte numbers in the format described here are stored with
+ the least-significant byte first (at the lower memory address).
+ For example, the decimal number 520 is stored as:
+
+ 0 1
+ +--------+--------+
+ |00001000|00000010|
+ +--------+--------+
+ ^ ^
+ | |
+ | + more significant byte = 2 x 256
+ + less significant byte = 8
+
+
+
+Deutsch Informational [Page 4]
+
+RFC 1952 GZIP File Format Specification May 1996
+
+
+ 2.2. File format
+
+ A gzip file consists of a series of "members" (compressed data
+ sets). The format of each member is specified in the following
+ section. The members simply appear one after another in the file,
+ with no additional information before, between, or after them.
+
+ 2.3. Member format
+
+ Each member has the following structure:
+
+ +---+---+---+---+---+---+---+---+---+---+
+ |ID1|ID2|CM |FLG| MTIME |XFL|OS | (more-->)
+ +---+---+---+---+---+---+---+---+---+---+
+
+ (if FLG.FEXTRA set)
+
+ +---+---+=================================+
+ | XLEN |...XLEN bytes of "extra field"...| (more-->)
+ +---+---+=================================+
+
+ (if FLG.FNAME set)
+
+ +=========================================+
+ |...original file name, zero-terminated...| (more-->)
+ +=========================================+
+
+ (if FLG.FCOMMENT set)
+
+ +===================================+
+ |...file comment, zero-terminated...| (more-->)
+ +===================================+
+
+ (if FLG.FHCRC set)
+
+ +---+---+
+ | CRC16 |
+ +---+---+
+
+ +=======================+
+ |...compressed blocks...| (more-->)
+ +=======================+
+
+ 0 1 2 3 4 5 6 7
+ +---+---+---+---+---+---+---+---+
+ | CRC32 | ISIZE |
+ +---+---+---+---+---+---+---+---+
+
+
+
+
+Deutsch Informational [Page 5]
+
+RFC 1952 GZIP File Format Specification May 1996
+
+
+ 2.3.1. Member header and trailer
+
+ ID1 (IDentification 1)
+ ID2 (IDentification 2)
+ These have the fixed values ID1 = 31 (0x1f, \037), ID2 = 139
+ (0x8b, \213), to identify the file as being in gzip format.
+
+ CM (Compression Method)
+ This identifies the compression method used in the file. CM
+ = 0-7 are reserved. CM = 8 denotes the "deflate"
+ compression method, which is the one customarily used by
+ gzip and which is documented elsewhere.
+
+ FLG (FLaGs)
+ This flag byte is divided into individual bits as follows:
+
+ bit 0 FTEXT
+ bit 1 FHCRC
+ bit 2 FEXTRA
+ bit 3 FNAME
+ bit 4 FCOMMENT
+ bit 5 reserved
+ bit 6 reserved
+ bit 7 reserved
+
+ If FTEXT is set, the file is probably ASCII text. This is
+ an optional indication, which the compressor may set by
+ checking a small amount of the input data to see whether any
+ non-ASCII characters are present. In case of doubt, FTEXT
+ is cleared, indicating binary data. For systems which have
+ different file formats for ascii text and binary data, the
+ decompressor can use FTEXT to choose the appropriate format.
+ We deliberately do not specify the algorithm used to set
+ this bit, since a compressor always has the option of
+ leaving it cleared and a decompressor always has the option
+ of ignoring it and letting some other program handle issues
+ of data conversion.
+
+ If FHCRC is set, a CRC16 for the gzip header is present,
+ immediately before the compressed data. The CRC16 consists
+ of the two least significant bytes of the CRC32 for all
+ bytes of the gzip header up to and not including the CRC16.
+ [The FHCRC bit was never set by versions of gzip up to
+ 1.2.4, even though it was documented with a different
+ meaning in gzip 1.2.4.]
+
+ If FEXTRA is set, optional extra fields are present, as
+ described in a following section.
+
+
+
+Deutsch Informational [Page 6]
+
+RFC 1952 GZIP File Format Specification May 1996
+
+
+ If FNAME is set, an original file name is present,
+ terminated by a zero byte. The name must consist of ISO
+ 8859-1 (LATIN-1) characters; on operating systems using
+ EBCDIC or any other character set for file names, the name
+ must be translated to the ISO LATIN-1 character set. This
+ is the original name of the file being compressed, with any
+ directory components removed, and, if the file being
+ compressed is on a file system with case insensitive names,
+ forced to lower case. There is no original file name if the
+ data was compressed from a source other than a named file;
+ for example, if the source was stdin on a Unix system, there
+ is no file name.
+
+ If FCOMMENT is set, a zero-terminated file comment is
+ present. This comment is not interpreted; it is only
+ intended for human consumption. The comment must consist of
+ ISO 8859-1 (LATIN-1) characters. Line breaks should be
+ denoted by a single line feed character (10 decimal).
+
+ Reserved FLG bits must be zero.
+
+ MTIME (Modification TIME)
+ This gives the most recent modification time of the original
+ file being compressed. The time is in Unix format, i.e.,
+ seconds since 00:00:00 GMT, Jan. 1, 1970. (Note that this
+ may cause problems for MS-DOS and other systems that use
+ local rather than Universal time.) If the compressed data
+ did not come from a file, MTIME is set to the time at which
+ compression started. MTIME = 0 means no time stamp is
+ available.
+
+ XFL (eXtra FLags)
+ These flags are available for use by specific compression
+ methods. The "deflate" method (CM = 8) sets these flags as
+ follows:
+
+ XFL = 2 - compressor used maximum compression,
+ slowest algorithm
+ XFL = 4 - compressor used fastest algorithm
+
+ OS (Operating System)
+ This identifies the type of file system on which compression
+ took place. This may be useful in determining end-of-line
+ convention for text files. The currently defined values are
+ as follows:
+
+
+
+
+
+
+Deutsch Informational [Page 7]
+
+RFC 1952 GZIP File Format Specification May 1996
+
+
+ 0 - FAT filesystem (MS-DOS, OS/2, NT/Win32)
+ 1 - Amiga
+ 2 - VMS (or OpenVMS)
+ 3 - Unix
+ 4 - VM/CMS
+ 5 - Atari TOS
+ 6 - HPFS filesystem (OS/2, NT)
+ 7 - Macintosh
+ 8 - Z-System
+ 9 - CP/M
+ 10 - TOPS-20
+ 11 - NTFS filesystem (NT)
+ 12 - QDOS
+ 13 - Acorn RISCOS
+ 255 - unknown
+
+ XLEN (eXtra LENgth)
+ If FLG.FEXTRA is set, this gives the length of the optional
+ extra field. See below for details.
+
+ CRC32 (CRC-32)
+ This contains a Cyclic Redundancy Check value of the
+ uncompressed data computed according to CRC-32 algorithm
+ used in the ISO 3309 standard and in section 8.1.1.6.2 of
+ ITU-T recommendation V.42. (See http://www.iso.ch for
+ ordering ISO documents. See gopher://info.itu.ch for an
+ online version of ITU-T V.42.)
+
+ ISIZE (Input SIZE)
+ This contains the size of the original (uncompressed) input
+ data modulo 2^32.
+
+ 2.3.1.1. Extra field
+
+ If the FLG.FEXTRA bit is set, an "extra field" is present in
+ the header, with total length XLEN bytes. It consists of a
+ series of subfields, each of the form:
+
+ +---+---+---+---+==================================+
+ |SI1|SI2| LEN |... LEN bytes of subfield data ...|
+ +---+---+---+---+==================================+
+
+ SI1 and SI2 provide a subfield ID, typically two ASCII letters
+ with some mnemonic value. Jean-Loup Gailly
+ <gzip@prep.ai.mit.edu> is maintaining a registry of subfield
+ IDs; please send him any subfield ID you wish to use. Subfield
+ IDs with SI2 = 0 are reserved for future use. The following
+ IDs are currently defined:
+
+
+
+Deutsch Informational [Page 8]
+
+RFC 1952 GZIP File Format Specification May 1996
+
+
+ SI1 SI2 Data
+ ---------- ---------- ----
+ 0x41 ('A') 0x70 ('P') Apollo file type information
+
+ LEN gives the length of the subfield data, excluding the 4
+ initial bytes.
+
+ 2.3.1.2. Compliance
+
+ A compliant compressor must produce files with correct ID1,
+ ID2, CM, CRC32, and ISIZE, but may set all the other fields in
+ the fixed-length part of the header to default values (255 for
+ OS, 0 for all others). The compressor must set all reserved
+ bits to zero.
+
+ A compliant decompressor must check ID1, ID2, and CM, and
+ provide an error indication if any of these have incorrect
+ values. It must examine FEXTRA/XLEN, FNAME, FCOMMENT and FHCRC
+ at least so it can skip over the optional fields if they are
+ present. It need not examine any other part of the header or
+ trailer; in particular, a decompressor may ignore FTEXT and OS
+ and always produce binary output, and still be compliant. A
+ compliant decompressor must give an error indication if any
+ reserved bit is non-zero, since such a bit could indicate the
+ presence of a new field that would cause subsequent data to be
+ interpreted incorrectly.
+
+3. References
+
+ [1] "Information Processing - 8-bit single-byte coded graphic
+ character sets - Part 1: Latin alphabet No.1" (ISO 8859-1:1987).
+ The ISO 8859-1 (Latin-1) character set is a superset of 7-bit
+ ASCII. Files defining this character set are available as
+ iso_8859-1.* in ftp://ftp.uu.net/graphics/png/documents/
+
+ [2] ISO 3309
+
+ [3] ITU-T recommendation V.42
+
+ [4] Deutsch, L.P.,"DEFLATE Compressed Data Format Specification",
+ available in ftp://ftp.uu.net/pub/archiving/zip/doc/
+
+ [5] Gailly, J.-L., GZIP documentation, available as gzip-*.tar in
+ ftp://prep.ai.mit.edu/pub/gnu/
+
+ [6] Sarwate, D.V., "Computation of Cyclic Redundancy Checks via Table
+ Look-Up", Communications of the ACM, 31(8), pp.1008-1013.
+
+
+
+
+Deutsch Informational [Page 9]
+
+RFC 1952 GZIP File Format Specification May 1996
+
+
+ [7] Schwaderer, W.D., "CRC Calculation", April 85 PC Tech Journal,
+ pp.118-133.
+
+ [8] ftp://ftp.adelaide.edu.au/pub/rocksoft/papers/crc_v3.txt,
+ describing the CRC concept.
+
+4. Security Considerations
+
+ Any data compression method involves the reduction of redundancy in
+ the data. Consequently, any corruption of the data is likely to have
+ severe effects and be difficult to correct. Uncompressed text, on
+ the other hand, will probably still be readable despite the presence
+ of some corrupted bytes.
+
+ It is recommended that systems using this data format provide some
+ means of validating the integrity of the compressed data, such as by
+ setting and checking the CRC-32 check value.
+
+5. Acknowledgements
+
+ Trademarks cited in this document are the property of their
+ respective owners.
+
+ Jean-Loup Gailly designed the gzip format and wrote, with Mark Adler,
+ the related software described in this specification. Glenn
+ Randers-Pehrson converted this document to RFC and HTML format.
+
+6. Author's Address
+
+ L. Peter Deutsch
+ Aladdin Enterprises
+ 203 Santa Margarita Ave.
+ Menlo Park, CA 94025
+
+ Phone: (415) 322-0103 (AM only)
+ FAX: (415) 322-1734
+ EMail: <ghost@aladdin.com>
+
+ Questions about the technical content of this specification can be
+ sent by email to:
+
+ Jean-Loup Gailly <gzip@prep.ai.mit.edu> and
+ Mark Adler <madler@alumni.caltech.edu>
+
+ Editorial comments on this specification can be sent by email to:
+
+ L. Peter Deutsch <ghost@aladdin.com> and
+ Glenn Randers-Pehrson <randeg@alumni.rpi.edu>
+
+
+
+Deutsch Informational [Page 10]
+
+RFC 1952 GZIP File Format Specification May 1996
+
+
+7. Appendix: Jean-Loup Gailly's gzip utility
+
+ The most widely used implementation of gzip compression, and the
+ original documentation on which this specification is based, were
+ created by Jean-Loup Gailly <gzip@prep.ai.mit.edu>. Since this
+ implementation is a de facto standard, we mention some more of its
+ features here. Again, the material in this section is not part of
+ the specification per se, and implementations need not follow it to
+ be compliant.
+
+ When compressing or decompressing a file, gzip preserves the
+ protection, ownership, and modification time attributes on the local
+ file system, since there is no provision for representing protection
+ attributes in the gzip file format itself. Since the file format
+ includes a modification time, the gzip decompressor provides a
+ command line switch that assigns the modification time from the file,
+ rather than the local modification time of the compressed input, to
+ the decompressed output.
+
+8. Appendix: Sample CRC Code
+
+ The following sample code represents a practical implementation of
+ the CRC (Cyclic Redundancy Check). (See also ISO 3309 and ITU-T V.42
+ for a formal specification.)
+
+ The sample code is in the ANSI C programming language. Non C users
+ may find it easier to read with these hints:
+
+ & Bitwise AND operator.
+ ^ Bitwise exclusive-OR operator.
+ >> Bitwise right shift operator. When applied to an
+ unsigned quantity, as here, right shift inserts zero
+ bit(s) at the left.
+ ! Logical NOT operator.
+ ++ "n++" increments the variable n.
+ 0xNNN 0x introduces a hexadecimal (base 16) constant.
+ Suffix L indicates a long value (at least 32 bits).
+
+ /* Table of CRCs of all 8-bit messages. */
+ unsigned long crc_table[256];
+
+ /* Flag: has the table been computed? Initially false. */
+ int crc_table_computed = 0;
+
+ /* Make the table for a fast CRC. */
+ void make_crc_table(void)
+ {
+ unsigned long c;
+
+
+
+Deutsch Informational [Page 11]
+
+RFC 1952 GZIP File Format Specification May 1996
+
+
+ int n, k;
+ for (n = 0; n < 256; n++) {
+ c = (unsigned long) n;
+ for (k = 0; k < 8; k++) {
+ if (c & 1) {
+ c = 0xedb88320L ^ (c >> 1);
+ } else {
+ c = c >> 1;
+ }
+ }
+ crc_table[n] = c;
+ }
+ crc_table_computed = 1;
+ }
+
+ /*
+ Update a running crc with the bytes buf[0..len-1] and return
+ the updated crc. The crc should be initialized to zero. Pre- and
+ post-conditioning (one's complement) is performed within this
+ function so it shouldn't be done by the caller. Usage example:
+
+ unsigned long crc = 0L;
+
+ while (read_buffer(buffer, length) != EOF) {
+ crc = update_crc(crc, buffer, length);
+ }
+ if (crc != original_crc) error();
+ */
+ unsigned long update_crc(unsigned long crc,
+ unsigned char *buf, int len)
+ {
+ unsigned long c = crc ^ 0xffffffffL;
+ int n;
+
+ if (!crc_table_computed)
+ make_crc_table();
+ for (n = 0; n < len; n++) {
+ c = crc_table[(c ^ buf[n]) & 0xff] ^ (c >> 8);
+ }
+ return c ^ 0xffffffffL;
+ }
+
+ /* Return the CRC of the bytes buf[0..len-1]. */
+ unsigned long crc(unsigned char *buf, int len)
+ {
+ return update_crc(0L, buf, len);
+ }
+
+
+
+
+Deutsch Informational [Page 12]
+
diff --git a/protocols/Telegram/tgl/zlib/doc/txtvsbin.txt b/protocols/Telegram/tgl/zlib/doc/txtvsbin.txt
new file mode 100644
index 0000000000..3d0f0634f7
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/doc/txtvsbin.txt
@@ -0,0 +1,107 @@
+A Fast Method for Identifying Plain Text Files
+==============================================
+
+
+Introduction
+------------
+
+Given a file coming from an unknown source, it is sometimes desirable
+to find out whether the format of that file is plain text. Although
+this may appear like a simple task, a fully accurate detection of the
+file type requires heavy-duty semantic analysis on the file contents.
+It is, however, possible to obtain satisfactory results by employing
+various heuristics.
+
+Previous versions of PKZip and other zip-compatible compression tools
+were using a crude detection scheme: if more than 80% (4/5) of the bytes
+found in a certain buffer are within the range [7..127], the file is
+labeled as plain text, otherwise it is labeled as binary. A prominent
+limitation of this scheme is the restriction to Latin-based alphabets.
+Other alphabets, like Greek, Cyrillic or Asian, make extensive use of
+the bytes within the range [128..255], and texts using these alphabets
+are most often misidentified by this scheme; in other words, the rate
+of false negatives is sometimes too high, which means that the recall
+is low. Another weakness of this scheme is a reduced precision, due to
+the false positives that may occur when binary files containing large
+amounts of textual characters are misidentified as plain text.
+
+In this article we propose a new, simple detection scheme that features
+a much increased precision and a near-100% recall. This scheme is
+designed to work on ASCII, Unicode and other ASCII-derived alphabets,
+and it handles single-byte encodings (ISO-8859, MacRoman, KOI8, etc.)
+and variable-sized encodings (ISO-2022, UTF-8, etc.). Wider encodings
+(UCS-2/UTF-16 and UCS-4/UTF-32) are not handled, however.
+
+
+The Algorithm
+-------------
+
+The algorithm works by dividing the set of bytecodes [0..255] into three
+categories:
+- The white list of textual bytecodes:
+ 9 (TAB), 10 (LF), 13 (CR), 32 (SPACE) to 255.
+- The gray list of tolerated bytecodes:
+ 7 (BEL), 8 (BS), 11 (VT), 12 (FF), 26 (SUB), 27 (ESC).
+- The black list of undesired, non-textual bytecodes:
+ 0 (NUL) to 6, 14 to 31.
+
+If a file contains at least one byte that belongs to the white list and
+no byte that belongs to the black list, then the file is categorized as
+plain text; otherwise, it is categorized as binary. (The boundary case,
+when the file is empty, automatically falls into the latter category.)
+
+
+Rationale
+---------
+
+The idea behind this algorithm relies on two observations.
+
+The first observation is that, although the full range of 7-bit codes
+[0..127] is properly specified by the ASCII standard, most control
+characters in the range [0..31] are not used in practice. The only
+widely-used, almost universally-portable control codes are 9 (TAB),
+10 (LF) and 13 (CR). There are a few more control codes that are
+recognized on a reduced range of platforms and text viewers/editors:
+7 (BEL), 8 (BS), 11 (VT), 12 (FF), 26 (SUB) and 27 (ESC); but these
+codes are rarely (if ever) used alone, without being accompanied by
+some printable text. Even the newer, portable text formats such as
+XML avoid using control characters outside the list mentioned here.
+
+The second observation is that most of the binary files tend to contain
+control characters, especially 0 (NUL). Even though the older text
+detection schemes observe the presence of non-ASCII codes from the range
+[128..255], the precision rarely has to suffer if this upper range is
+labeled as textual, because the files that are genuinely binary tend to
+contain both control characters and codes from the upper range. On the
+other hand, the upper range needs to be labeled as textual, because it
+is used by virtually all ASCII extensions. In particular, this range is
+used for encoding non-Latin scripts.
+
+Since there is no counting involved, other than simply observing the
+presence or the absence of some byte values, the algorithm produces
+consistent results, regardless what alphabet encoding is being used.
+(If counting were involved, it could be possible to obtain different
+results on a text encoded, say, using ISO-8859-16 versus UTF-8.)
+
+There is an extra category of plain text files that are "polluted" with
+one or more black-listed codes, either by mistake or by peculiar design
+considerations. In such cases, a scheme that tolerates a small fraction
+of black-listed codes would provide an increased recall (i.e. more true
+positives). This, however, incurs a reduced precision overall, since
+false positives are more likely to appear in binary files that contain
+large chunks of textual data. Furthermore, "polluted" plain text should
+be regarded as binary by general-purpose text detection schemes, because
+general-purpose text processing algorithms might not be applicable.
+Under this premise, it is safe to say that our detection method provides
+a near-100% recall.
+
+Experiments have been run on many files coming from various platforms
+and applications. We tried plain text files, system logs, source code,
+formatted office documents, compiled object code, etc. The results
+confirm the optimistic assumptions about the capabilities of this
+algorithm.
+
+
+--
+Cosmin Truta
+Last updated: 2006-May-28
diff --git a/protocols/Telegram/tgl/zlib/examples/README.examples b/protocols/Telegram/tgl/zlib/examples/README.examples
new file mode 100644
index 0000000000..56a31714e5
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/examples/README.examples
@@ -0,0 +1,49 @@
+This directory contains examples of the use of zlib and other relevant
+programs and documentation.
+
+enough.c
+ calculation and justification of ENOUGH parameter in inftrees.h
+ - calculates the maximum table space used in inflate tree
+ construction over all possible Huffman codes
+
+fitblk.c
+ compress just enough input to nearly fill a requested output size
+ - zlib isn't designed to do this, but fitblk does it anyway
+
+gun.c
+ uncompress a gzip file
+ - illustrates the use of inflateBack() for high speed file-to-file
+ decompression using call-back functions
+ - is approximately twice as fast as gzip -d
+ - also provides Unix uncompress functionality, again twice as fast
+
+gzappend.c
+ append to a gzip file
+ - illustrates the use of the Z_BLOCK flush parameter for inflate()
+ - illustrates the use of deflatePrime() to start at any bit
+
+gzjoin.c
+ join gzip files without recalculating the crc or recompressing
+ - illustrates the use of the Z_BLOCK flush parameter for inflate()
+ - illustrates the use of crc32_combine()
+
+gzlog.c
+gzlog.h
+ efficiently and robustly maintain a message log file in gzip format
+ - illustrates use of raw deflate, Z_PARTIAL_FLUSH, deflatePrime(),
+ and deflateSetDictionary()
+ - illustrates use of a gzip header extra field
+
+zlib_how.html
+ painfully comprehensive description of zpipe.c (see below)
+ - describes in excruciating detail the use of deflate() and inflate()
+
+zpipe.c
+ reads and writes zlib streams from stdin to stdout
+ - illustrates the proper use of deflate() and inflate()
+ - deeply commented in zlib_how.html (see above)
+
+zran.c
+ index a zlib or gzip stream and randomly access it
+ - illustrates the use of Z_BLOCK, inflatePrime(), and
+ inflateSetDictionary() to provide random access
diff --git a/protocols/Telegram/tgl/zlib/examples/enough.c b/protocols/Telegram/tgl/zlib/examples/enough.c
new file mode 100644
index 0000000000..b991144305
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/examples/enough.c
@@ -0,0 +1,572 @@
+/* enough.c -- determine the maximum size of inflate's Huffman code tables over
+ * all possible valid and complete Huffman codes, subject to a length limit.
+ * Copyright (C) 2007, 2008, 2012 Mark Adler
+ * Version 1.4 18 August 2012 Mark Adler
+ */
+
+/* Version history:
+ 1.0 3 Jan 2007 First version (derived from codecount.c version 1.4)
+ 1.1 4 Jan 2007 Use faster incremental table usage computation
+ Prune examine() search on previously visited states
+ 1.2 5 Jan 2007 Comments clean up
+ As inflate does, decrease root for short codes
+ Refuse cases where inflate would increase root
+ 1.3 17 Feb 2008 Add argument for initial root table size
+ Fix bug for initial root table size == max - 1
+ Use a macro to compute the history index
+ 1.4 18 Aug 2012 Avoid shifts more than bits in type (caused endless loop!)
+ Clean up comparisons of different types
+ Clean up code indentation
+ */
+
+/*
+ Examine all possible Huffman codes for a given number of symbols and a
+ maximum code length in bits to determine the maximum table size for zilb's
+ inflate. Only complete Huffman codes are counted.
+
+ Two codes are considered distinct if the vectors of the number of codes per
+ length are not identical. So permutations of the symbol assignments result
+ in the same code for the counting, as do permutations of the assignments of
+ the bit values to the codes (i.e. only canonical codes are counted).
+
+ We build a code from shorter to longer lengths, determining how many symbols
+ are coded at each length. At each step, we have how many symbols remain to
+ be coded, what the last code length used was, and how many bit patterns of
+ that length remain unused. Then we add one to the code length and double the
+ number of unused patterns to graduate to the next code length. We then
+ assign all portions of the remaining symbols to that code length that
+ preserve the properties of a correct and eventually complete code. Those
+ properties are: we cannot use more bit patterns than are available; and when
+ all the symbols are used, there are exactly zero possible bit patterns
+ remaining.
+
+ The inflate Huffman decoding algorithm uses two-level lookup tables for
+ speed. There is a single first-level table to decode codes up to root bits
+ in length (root == 9 in the current inflate implementation). The table
+ has 1 << root entries and is indexed by the next root bits of input. Codes
+ shorter than root bits have replicated table entries, so that the correct
+ entry is pointed to regardless of the bits that follow the short code. If
+ the code is longer than root bits, then the table entry points to a second-
+ level table. The size of that table is determined by the longest code with
+ that root-bit prefix. If that longest code has length len, then the table
+ has size 1 << (len - root), to index the remaining bits in that set of
+ codes. Each subsequent root-bit prefix then has its own sub-table. The
+ total number of table entries required by the code is calculated
+ incrementally as the number of codes at each bit length is populated. When
+ all of the codes are shorter than root bits, then root is reduced to the
+ longest code length, resulting in a single, smaller, one-level table.
+
+ The inflate algorithm also provides for small values of root (relative to
+ the log2 of the number of symbols), where the shortest code has more bits
+ than root. In that case, root is increased to the length of the shortest
+ code. This program, by design, does not handle that case, so it is verified
+ that the number of symbols is less than 2^(root + 1).
+
+ In order to speed up the examination (by about ten orders of magnitude for
+ the default arguments), the intermediate states in the build-up of a code
+ are remembered and previously visited branches are pruned. The memory
+ required for this will increase rapidly with the total number of symbols and
+ the maximum code length in bits. However this is a very small price to pay
+ for the vast speedup.
+
+ First, all of the possible Huffman codes are counted, and reachable
+ intermediate states are noted by a non-zero count in a saved-results array.
+ Second, the intermediate states that lead to (root + 1) bit or longer codes
+ are used to look at all sub-codes from those junctures for their inflate
+ memory usage. (The amount of memory used is not affected by the number of
+ codes of root bits or less in length.) Third, the visited states in the
+ construction of those sub-codes and the associated calculation of the table
+ size is recalled in order to avoid recalculating from the same juncture.
+ Beginning the code examination at (root + 1) bit codes, which is enabled by
+ identifying the reachable nodes, accounts for about six of the orders of
+ magnitude of improvement for the default arguments. About another four
+ orders of magnitude come from not revisiting previous states. Out of
+ approximately 2x10^16 possible Huffman codes, only about 2x10^6 sub-codes
+ need to be examined to cover all of the possible table memory usage cases
+ for the default arguments of 286 symbols limited to 15-bit codes.
+
+ Note that an unsigned long long type is used for counting. It is quite easy
+ to exceed the capacity of an eight-byte integer with a large number of
+ symbols and a large maximum code length, so multiple-precision arithmetic
+ would need to replace the unsigned long long arithmetic in that case. This
+ program will abort if an overflow occurs. The big_t type identifies where
+ the counting takes place.
+
+ An unsigned long long type is also used for calculating the number of
+ possible codes remaining at the maximum length. This limits the maximum
+ code length to the number of bits in a long long minus the number of bits
+ needed to represent the symbols in a flat code. The code_t type identifies
+ where the bit pattern counting takes place.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+#define local static
+
+/* special data types */
+typedef unsigned long long big_t; /* type for code counting */
+typedef unsigned long long code_t; /* type for bit pattern counting */
+struct tab { /* type for been here check */
+ size_t len; /* length of bit vector in char's */
+ char *vec; /* allocated bit vector */
+};
+
+/* The array for saving results, num[], is indexed with this triplet:
+
+ syms: number of symbols remaining to code
+ left: number of available bit patterns at length len
+ len: number of bits in the codes currently being assigned
+
+ Those indices are constrained thusly when saving results:
+
+ syms: 3..totsym (totsym == total symbols to code)
+ left: 2..syms - 1, but only the evens (so syms == 8 -> 2, 4, 6)
+ len: 1..max - 1 (max == maximum code length in bits)
+
+ syms == 2 is not saved since that immediately leads to a single code. left
+ must be even, since it represents the number of available bit patterns at
+ the current length, which is double the number at the previous length.
+ left ends at syms-1 since left == syms immediately results in a single code.
+ (left > sym is not allowed since that would result in an incomplete code.)
+ len is less than max, since the code completes immediately when len == max.
+
+ The offset into the array is calculated for the three indices with the
+ first one (syms) being outermost, and the last one (len) being innermost.
+ We build the array with length max-1 lists for the len index, with syms-3
+ of those for each symbol. There are totsym-2 of those, with each one
+ varying in length as a function of sym. See the calculation of index in
+ count() for the index, and the calculation of size in main() for the size
+ of the array.
+
+ For the deflate example of 286 symbols limited to 15-bit codes, the array
+ has 284,284 entries, taking up 2.17 MB for an 8-byte big_t. More than
+ half of the space allocated for saved results is actually used -- not all
+ possible triplets are reached in the generation of valid Huffman codes.
+ */
+
+/* The array for tracking visited states, done[], is itself indexed identically
+ to the num[] array as described above for the (syms, left, len) triplet.
+ Each element in the array is further indexed by the (mem, rem) doublet,
+ where mem is the amount of inflate table space used so far, and rem is the
+ remaining unused entries in the current inflate sub-table. Each indexed
+ element is simply one bit indicating whether the state has been visited or
+ not. Since the ranges for mem and rem are not known a priori, each bit
+ vector is of a variable size, and grows as needed to accommodate the visited
+ states. mem and rem are used to calculate a single index in a triangular
+ array. Since the range of mem is expected in the default case to be about
+ ten times larger than the range of rem, the array is skewed to reduce the
+ memory usage, with eight times the range for mem than for rem. See the
+ calculations for offset and bit in beenhere() for the details.
+
+ For the deflate example of 286 symbols limited to 15-bit codes, the bit
+ vectors grow to total approximately 21 MB, in addition to the 4.3 MB done[]
+ array itself.
+ */
+
+/* Globals to avoid propagating constants or constant pointers recursively */
+local int max; /* maximum allowed bit length for the codes */
+local int root; /* size of base code table in bits */
+local int large; /* largest code table so far */
+local size_t size; /* number of elements in num and done */
+local int *code; /* number of symbols assigned to each bit length */
+local big_t *num; /* saved results array for code counting */
+local struct tab *done; /* states already evaluated array */
+
+/* Index function for num[] and done[] */
+#define INDEX(i,j,k) (((size_t)((i-1)>>1)*((i-2)>>1)+(j>>1)-1)*(max-1)+k-1)
+
+/* Free allocated space. Uses globals code, num, and done. */
+local void cleanup(void)
+{
+ size_t n;
+
+ if (done != NULL) {
+ for (n = 0; n < size; n++)
+ if (done[n].len)
+ free(done[n].vec);
+ free(done);
+ }
+ if (num != NULL)
+ free(num);
+ if (code != NULL)
+ free(code);
+}
+
+/* Return the number of possible Huffman codes using bit patterns of lengths
+ len through max inclusive, coding syms symbols, with left bit patterns of
+ length len unused -- return -1 if there is an overflow in the counting.
+ Keep a record of previous results in num to prevent repeating the same
+ calculation. Uses the globals max and num. */
+local big_t count(int syms, int len, int left)
+{
+ big_t sum; /* number of possible codes from this juncture */
+ big_t got; /* value returned from count() */
+ int least; /* least number of syms to use at this juncture */
+ int most; /* most number of syms to use at this juncture */
+ int use; /* number of bit patterns to use in next call */
+ size_t index; /* index of this case in *num */
+
+ /* see if only one possible code */
+ if (syms == left)
+ return 1;
+
+ /* note and verify the expected state */
+ assert(syms > left && left > 0 && len < max);
+
+ /* see if we've done this one already */
+ index = INDEX(syms, left, len);
+ got = num[index];
+ if (got)
+ return got; /* we have -- return the saved result */
+
+ /* we need to use at least this many bit patterns so that the code won't be
+ incomplete at the next length (more bit patterns than symbols) */
+ least = (left << 1) - syms;
+ if (least < 0)
+ least = 0;
+
+ /* we can use at most this many bit patterns, lest there not be enough
+ available for the remaining symbols at the maximum length (if there were
+ no limit to the code length, this would become: most = left - 1) */
+ most = (((code_t)left << (max - len)) - syms) /
+ (((code_t)1 << (max - len)) - 1);
+
+ /* count all possible codes from this juncture and add them up */
+ sum = 0;
+ for (use = least; use <= most; use++) {
+ got = count(syms - use, len + 1, (left - use) << 1);
+ sum += got;
+ if (got == (big_t)0 - 1 || sum < got) /* overflow */
+ return (big_t)0 - 1;
+ }
+
+ /* verify that all recursive calls are productive */
+ assert(sum != 0);
+
+ /* save the result and return it */
+ num[index] = sum;
+ return sum;
+}
+
+/* Return true if we've been here before, set to true if not. Set a bit in a
+ bit vector to indicate visiting this state. Each (syms,len,left) state
+ has a variable size bit vector indexed by (mem,rem). The bit vector is
+ lengthened if needed to allow setting the (mem,rem) bit. */
+local int beenhere(int syms, int len, int left, int mem, int rem)
+{
+ size_t index; /* index for this state's bit vector */
+ size_t offset; /* offset in this state's bit vector */
+ int bit; /* mask for this state's bit */
+ size_t length; /* length of the bit vector in bytes */
+ char *vector; /* new or enlarged bit vector */
+
+ /* point to vector for (syms,left,len), bit in vector for (mem,rem) */
+ index = INDEX(syms, left, len);
+ mem -= 1 << root;
+ offset = (mem >> 3) + rem;
+ offset = ((offset * (offset + 1)) >> 1) + rem;
+ bit = 1 << (mem & 7);
+
+ /* see if we've been here */
+ length = done[index].len;
+ if (offset < length && (done[index].vec[offset] & bit) != 0)
+ return 1; /* done this! */
+
+ /* we haven't been here before -- set the bit to show we have now */
+
+ /* see if we need to lengthen the vector in order to set the bit */
+ if (length <= offset) {
+ /* if we have one already, enlarge it, zero out the appended space */
+ if (length) {
+ do {
+ length <<= 1;
+ } while (length <= offset);
+ vector = realloc(done[index].vec, length);
+ if (vector != NULL)
+ memset(vector + done[index].len, 0, length - done[index].len);
+ }
+
+ /* otherwise we need to make a new vector and zero it out */
+ else {
+ length = 1 << (len - root);
+ while (length <= offset)
+ length <<= 1;
+ vector = calloc(length, sizeof(char));
+ }
+
+ /* in either case, bail if we can't get the memory */
+ if (vector == NULL) {
+ fputs("abort: unable to allocate enough memory\n", stderr);
+ cleanup();
+ exit(1);
+ }
+
+ /* install the new vector */
+ done[index].len = length;
+ done[index].vec = vector;
+ }
+
+ /* set the bit */
+ done[index].vec[offset] |= bit;
+ return 0;
+}
+
+/* Examine all possible codes from the given node (syms, len, left). Compute
+ the amount of memory required to build inflate's decoding tables, where the
+ number of code structures used so far is mem, and the number remaining in
+ the current sub-table is rem. Uses the globals max, code, root, large, and
+ done. */
+local void examine(int syms, int len, int left, int mem, int rem)
+{
+ int least; /* least number of syms to use at this juncture */
+ int most; /* most number of syms to use at this juncture */
+ int use; /* number of bit patterns to use in next call */
+
+ /* see if we have a complete code */
+ if (syms == left) {
+ /* set the last code entry */
+ code[len] = left;
+
+ /* complete computation of memory used by this code */
+ while (rem < left) {
+ left -= rem;
+ rem = 1 << (len - root);
+ mem += rem;
+ }
+ assert(rem == left);
+
+ /* if this is a new maximum, show the entries used and the sub-code */
+ if (mem > large) {
+ large = mem;
+ printf("max %d: ", mem);
+ for (use = root + 1; use <= max; use++)
+ if (code[use])
+ printf("%d[%d] ", code[use], use);
+ putchar('\n');
+ fflush(stdout);
+ }
+
+ /* remove entries as we drop back down in the recursion */
+ code[len] = 0;
+ return;
+ }
+
+ /* prune the tree if we can */
+ if (beenhere(syms, len, left, mem, rem))
+ return;
+
+ /* we need to use at least this many bit patterns so that the code won't be
+ incomplete at the next length (more bit patterns than symbols) */
+ least = (left << 1) - syms;
+ if (least < 0)
+ least = 0;
+
+ /* we can use at most this many bit patterns, lest there not be enough
+ available for the remaining symbols at the maximum length (if there were
+ no limit to the code length, this would become: most = left - 1) */
+ most = (((code_t)left << (max - len)) - syms) /
+ (((code_t)1 << (max - len)) - 1);
+
+ /* occupy least table spaces, creating new sub-tables as needed */
+ use = least;
+ while (rem < use) {
+ use -= rem;
+ rem = 1 << (len - root);
+ mem += rem;
+ }
+ rem -= use;
+
+ /* examine codes from here, updating table space as we go */
+ for (use = least; use <= most; use++) {
+ code[len] = use;
+ examine(syms - use, len + 1, (left - use) << 1,
+ mem + (rem ? 1 << (len - root) : 0), rem << 1);
+ if (rem == 0) {
+ rem = 1 << (len - root);
+ mem += rem;
+ }
+ rem--;
+ }
+
+ /* remove entries as we drop back down in the recursion */
+ code[len] = 0;
+}
+
+/* Look at all sub-codes starting with root + 1 bits. Look at only the valid
+ intermediate code states (syms, left, len). For each completed code,
+ calculate the amount of memory required by inflate to build the decoding
+ tables. Find the maximum amount of memory required and show the code that
+ requires that maximum. Uses the globals max, root, and num. */
+local void enough(int syms)
+{
+ int n; /* number of remaing symbols for this node */
+ int left; /* number of unused bit patterns at this length */
+ size_t index; /* index of this case in *num */
+
+ /* clear code */
+ for (n = 0; n <= max; n++)
+ code[n] = 0;
+
+ /* look at all (root + 1) bit and longer codes */
+ large = 1 << root; /* base table */
+ if (root < max) /* otherwise, there's only a base table */
+ for (n = 3; n <= syms; n++)
+ for (left = 2; left < n; left += 2)
+ {
+ /* look at all reachable (root + 1) bit nodes, and the
+ resulting codes (complete at root + 2 or more) */
+ index = INDEX(n, left, root + 1);
+ if (root + 1 < max && num[index]) /* reachable node */
+ examine(n, root + 1, left, 1 << root, 0);
+
+ /* also look at root bit codes with completions at root + 1
+ bits (not saved in num, since complete), just in case */
+ if (num[index - 1] && n <= left << 1)
+ examine((n - left) << 1, root + 1, (n - left) << 1,
+ 1 << root, 0);
+ }
+
+ /* done */
+ printf("done: maximum of %d table entries\n", large);
+}
+
+/*
+ Examine and show the total number of possible Huffman codes for a given
+ maximum number of symbols, initial root table size, and maximum code length
+ in bits -- those are the command arguments in that order. The default
+ values are 286, 9, and 15 respectively, for the deflate literal/length code.
+ The possible codes are counted for each number of coded symbols from two to
+ the maximum. The counts for each of those and the total number of codes are
+ shown. The maximum number of inflate table entires is then calculated
+ across all possible codes. Each new maximum number of table entries and the
+ associated sub-code (starting at root + 1 == 10 bits) is shown.
+
+ To count and examine Huffman codes that are not length-limited, provide a
+ maximum length equal to the number of symbols minus one.
+
+ For the deflate literal/length code, use "enough". For the deflate distance
+ code, use "enough 30 6".
+
+ This uses the %llu printf format to print big_t numbers, which assumes that
+ big_t is an unsigned long long. If the big_t type is changed (for example
+ to a multiple precision type), the method of printing will also need to be
+ updated.
+ */
+int main(int argc, char **argv)
+{
+ int syms; /* total number of symbols to code */
+ int n; /* number of symbols to code for this run */
+ big_t got; /* return value of count() */
+ big_t sum; /* accumulated number of codes over n */
+ code_t word; /* for counting bits in code_t */
+
+ /* set up globals for cleanup() */
+ code = NULL;
+ num = NULL;
+ done = NULL;
+
+ /* get arguments -- default to the deflate literal/length code */
+ syms = 286;
+ root = 9;
+ max = 15;
+ if (argc > 1) {
+ syms = atoi(argv[1]);
+ if (argc > 2) {
+ root = atoi(argv[2]);
+ if (argc > 3)
+ max = atoi(argv[3]);
+ }
+ }
+ if (argc > 4 || syms < 2 || root < 1 || max < 1) {
+ fputs("invalid arguments, need: [sym >= 2 [root >= 1 [max >= 1]]]\n",
+ stderr);
+ return 1;
+ }
+
+ /* if not restricting the code length, the longest is syms - 1 */
+ if (max > syms - 1)
+ max = syms - 1;
+
+ /* determine the number of bits in a code_t */
+ for (n = 0, word = 1; word; n++, word <<= 1)
+ ;
+
+ /* make sure that the calculation of most will not overflow */
+ if (max > n || (code_t)(syms - 2) >= (((code_t)0 - 1) >> (max - 1))) {
+ fputs("abort: code length too long for internal types\n", stderr);
+ return 1;
+ }
+
+ /* reject impossible code requests */
+ if ((code_t)(syms - 1) > ((code_t)1 << max) - 1) {
+ fprintf(stderr, "%d symbols cannot be coded in %d bits\n",
+ syms, max);
+ return 1;
+ }
+
+ /* allocate code vector */
+ code = calloc(max + 1, sizeof(int));
+ if (code == NULL) {
+ fputs("abort: unable to allocate enough memory\n", stderr);
+ return 1;
+ }
+
+ /* determine size of saved results array, checking for overflows,
+ allocate and clear the array (set all to zero with calloc()) */
+ if (syms == 2) /* iff max == 1 */
+ num = NULL; /* won't be saving any results */
+ else {
+ size = syms >> 1;
+ if (size > ((size_t)0 - 1) / (n = (syms - 1) >> 1) ||
+ (size *= n, size > ((size_t)0 - 1) / (n = max - 1)) ||
+ (size *= n, size > ((size_t)0 - 1) / sizeof(big_t)) ||
+ (num = calloc(size, sizeof(big_t))) == NULL) {
+ fputs("abort: unable to allocate enough memory\n", stderr);
+ cleanup();
+ return 1;
+ }
+ }
+
+ /* count possible codes for all numbers of symbols, add up counts */
+ sum = 0;
+ for (n = 2; n <= syms; n++) {
+ got = count(n, 1, 2);
+ sum += got;
+ if (got == (big_t)0 - 1 || sum < got) { /* overflow */
+ fputs("abort: can't count that high!\n", stderr);
+ cleanup();
+ return 1;
+ }
+ printf("%llu %d-codes\n", got, n);
+ }
+ printf("%llu total codes for 2 to %d symbols", sum, syms);
+ if (max < syms - 1)
+ printf(" (%d-bit length limit)\n", max);
+ else
+ puts(" (no length limit)");
+
+ /* allocate and clear done array for beenhere() */
+ if (syms == 2)
+ done = NULL;
+ else if (size > ((size_t)0 - 1) / sizeof(struct tab) ||
+ (done = calloc(size, sizeof(struct tab))) == NULL) {
+ fputs("abort: unable to allocate enough memory\n", stderr);
+ cleanup();
+ return 1;
+ }
+
+ /* find and show maximum inflate table usage */
+ if (root > max) /* reduce root to max length */
+ root = max;
+ if ((code_t)syms < ((code_t)1 << (root + 1)))
+ enough(syms);
+ else
+ puts("cannot handle minimum code lengths > root");
+
+ /* done */
+ cleanup();
+ return 0;
+}
diff --git a/protocols/Telegram/tgl/zlib/examples/fitblk.c b/protocols/Telegram/tgl/zlib/examples/fitblk.c
new file mode 100644
index 0000000000..c61de5c996
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/examples/fitblk.c
@@ -0,0 +1,233 @@
+/* fitblk.c: example of fitting compressed output to a specified size
+ Not copyrighted -- provided to the public domain
+ Version 1.1 25 November 2004 Mark Adler */
+
+/* Version history:
+ 1.0 24 Nov 2004 First version
+ 1.1 25 Nov 2004 Change deflateInit2() to deflateInit()
+ Use fixed-size, stack-allocated raw buffers
+ Simplify code moving compression to subroutines
+ Use assert() for internal errors
+ Add detailed description of approach
+ */
+
+/* Approach to just fitting a requested compressed size:
+
+ fitblk performs three compression passes on a portion of the input
+ data in order to determine how much of that input will compress to
+ nearly the requested output block size. The first pass generates
+ enough deflate blocks to produce output to fill the requested
+ output size plus a specfied excess amount (see the EXCESS define
+ below). The last deflate block may go quite a bit past that, but
+ is discarded. The second pass decompresses and recompresses just
+ the compressed data that fit in the requested plus excess sized
+ buffer. The deflate process is terminated after that amount of
+ input, which is less than the amount consumed on the first pass.
+ The last deflate block of the result will be of a comparable size
+ to the final product, so that the header for that deflate block and
+ the compression ratio for that block will be about the same as in
+ the final product. The third compression pass decompresses the
+ result of the second step, but only the compressed data up to the
+ requested size minus an amount to allow the compressed stream to
+ complete (see the MARGIN define below). That will result in a
+ final compressed stream whose length is less than or equal to the
+ requested size. Assuming sufficient input and a requested size
+ greater than a few hundred bytes, the shortfall will typically be
+ less than ten bytes.
+
+ If the input is short enough that the first compression completes
+ before filling the requested output size, then that compressed
+ stream is return with no recompression.
+
+ EXCESS is chosen to be just greater than the shortfall seen in a
+ two pass approach similar to the above. That shortfall is due to
+ the last deflate block compressing more efficiently with a smaller
+ header on the second pass. EXCESS is set to be large enough so
+ that there is enough uncompressed data for the second pass to fill
+ out the requested size, and small enough so that the final deflate
+ block of the second pass will be close in size to the final deflate
+ block of the third and final pass. MARGIN is chosen to be just
+ large enough to assure that the final compression has enough room
+ to complete in all cases.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include "zlib.h"
+
+#define local static
+
+/* print nastygram and leave */
+local void quit(char *why)
+{
+ fprintf(stderr, "fitblk abort: %s\n", why);
+ exit(1);
+}
+
+#define RAWLEN 4096 /* intermediate uncompressed buffer size */
+
+/* compress from file to def until provided buffer is full or end of
+ input reached; return last deflate() return value, or Z_ERRNO if
+ there was read error on the file */
+local int partcompress(FILE *in, z_streamp def)
+{
+ int ret, flush;
+ unsigned char raw[RAWLEN];
+
+ flush = Z_NO_FLUSH;
+ do {
+ def->avail_in = fread(raw, 1, RAWLEN, in);
+ if (ferror(in))
+ return Z_ERRNO;
+ def->next_in = raw;
+ if (feof(in))
+ flush = Z_FINISH;
+ ret = deflate(def, flush);
+ assert(ret != Z_STREAM_ERROR);
+ } while (def->avail_out != 0 && flush == Z_NO_FLUSH);
+ return ret;
+}
+
+/* recompress from inf's input to def's output; the input for inf and
+ the output for def are set in those structures before calling;
+ return last deflate() return value, or Z_MEM_ERROR if inflate()
+ was not able to allocate enough memory when it needed to */
+local int recompress(z_streamp inf, z_streamp def)
+{
+ int ret, flush;
+ unsigned char raw[RAWLEN];
+
+ flush = Z_NO_FLUSH;
+ do {
+ /* decompress */
+ inf->avail_out = RAWLEN;
+ inf->next_out = raw;
+ ret = inflate(inf, Z_NO_FLUSH);
+ assert(ret != Z_STREAM_ERROR && ret != Z_DATA_ERROR &&
+ ret != Z_NEED_DICT);
+ if (ret == Z_MEM_ERROR)
+ return ret;
+
+ /* compress what was decompresed until done or no room */
+ def->avail_in = RAWLEN - inf->avail_out;
+ def->next_in = raw;
+ if (inf->avail_out != 0)
+ flush = Z_FINISH;
+ ret = deflate(def, flush);
+ assert(ret != Z_STREAM_ERROR);
+ } while (ret != Z_STREAM_END && def->avail_out != 0);
+ return ret;
+}
+
+#define EXCESS 256 /* empirically determined stream overage */
+#define MARGIN 8 /* amount to back off for completion */
+
+/* compress from stdin to fixed-size block on stdout */
+int main(int argc, char **argv)
+{
+ int ret; /* return code */
+ unsigned size; /* requested fixed output block size */
+ unsigned have; /* bytes written by deflate() call */
+ unsigned char *blk; /* intermediate and final stream */
+ unsigned char *tmp; /* close to desired size stream */
+ z_stream def, inf; /* zlib deflate and inflate states */
+
+ /* get requested output size */
+ if (argc != 2)
+ quit("need one argument: size of output block");
+ ret = strtol(argv[1], argv + 1, 10);
+ if (argv[1][0] != 0)
+ quit("argument must be a number");
+ if (ret < 8) /* 8 is minimum zlib stream size */
+ quit("need positive size of 8 or greater");
+ size = (unsigned)ret;
+
+ /* allocate memory for buffers and compression engine */
+ blk = malloc(size + EXCESS);
+ def.zalloc = Z_NULL;
+ def.zfree = Z_NULL;
+ def.opaque = Z_NULL;
+ ret = deflateInit(&def, Z_DEFAULT_COMPRESSION);
+ if (ret != Z_OK || blk == NULL)
+ quit("out of memory");
+
+ /* compress from stdin until output full, or no more input */
+ def.avail_out = size + EXCESS;
+ def.next_out = blk;
+ ret = partcompress(stdin, &def);
+ if (ret == Z_ERRNO)
+ quit("error reading input");
+
+ /* if it all fit, then size was undersubscribed -- done! */
+ if (ret == Z_STREAM_END && def.avail_out >= EXCESS) {
+ /* write block to stdout */
+ have = size + EXCESS - def.avail_out;
+ if (fwrite(blk, 1, have, stdout) != have || ferror(stdout))
+ quit("error writing output");
+
+ /* clean up and print results to stderr */
+ ret = deflateEnd(&def);
+ assert(ret != Z_STREAM_ERROR);
+ free(blk);
+ fprintf(stderr,
+ "%u bytes unused out of %u requested (all input)\n",
+ size - have, size);
+ return 0;
+ }
+
+ /* it didn't all fit -- set up for recompression */
+ inf.zalloc = Z_NULL;
+ inf.zfree = Z_NULL;
+ inf.opaque = Z_NULL;
+ inf.avail_in = 0;
+ inf.next_in = Z_NULL;
+ ret = inflateInit(&inf);
+ tmp = malloc(size + EXCESS);
+ if (ret != Z_OK || tmp == NULL)
+ quit("out of memory");
+ ret = deflateReset(&def);
+ assert(ret != Z_STREAM_ERROR);
+
+ /* do first recompression close to the right amount */
+ inf.avail_in = size + EXCESS;
+ inf.next_in = blk;
+ def.avail_out = size + EXCESS;
+ def.next_out = tmp;
+ ret = recompress(&inf, &def);
+ if (ret == Z_MEM_ERROR)
+ quit("out of memory");
+
+ /* set up for next reocmpression */
+ ret = inflateReset(&inf);
+ assert(ret != Z_STREAM_ERROR);
+ ret = deflateReset(&def);
+ assert(ret != Z_STREAM_ERROR);
+
+ /* do second and final recompression (third compression) */
+ inf.avail_in = size - MARGIN; /* assure stream will complete */
+ inf.next_in = tmp;
+ def.avail_out = size;
+ def.next_out = blk;
+ ret = recompress(&inf, &def);
+ if (ret == Z_MEM_ERROR)
+ quit("out of memory");
+ assert(ret == Z_STREAM_END); /* otherwise MARGIN too small */
+
+ /* done -- write block to stdout */
+ have = size - def.avail_out;
+ if (fwrite(blk, 1, have, stdout) != have || ferror(stdout))
+ quit("error writing output");
+
+ /* clean up and print results to stderr */
+ free(tmp);
+ ret = inflateEnd(&inf);
+ assert(ret != Z_STREAM_ERROR);
+ ret = deflateEnd(&def);
+ assert(ret != Z_STREAM_ERROR);
+ free(blk);
+ fprintf(stderr,
+ "%u bytes unused out of %u requested (%lu input)\n",
+ size - have, size, def.total_in);
+ return 0;
+}
diff --git a/protocols/Telegram/tgl/zlib/examples/gun.c b/protocols/Telegram/tgl/zlib/examples/gun.c
new file mode 100644
index 0000000000..89e484fee6
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/examples/gun.c
@@ -0,0 +1,702 @@
+/* gun.c -- simple gunzip to give an example of the use of inflateBack()
+ * Copyright (C) 2003, 2005, 2008, 2010, 2012 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ Version 1.7 12 August 2012 Mark Adler */
+
+/* Version history:
+ 1.0 16 Feb 2003 First version for testing of inflateBack()
+ 1.1 21 Feb 2005 Decompress concatenated gzip streams
+ Remove use of "this" variable (C++ keyword)
+ Fix return value for in()
+ Improve allocation failure checking
+ Add typecasting for void * structures
+ Add -h option for command version and usage
+ Add a bunch of comments
+ 1.2 20 Mar 2005 Add Unix compress (LZW) decompression
+ Copy file attributes from input file to output file
+ 1.3 12 Jun 2005 Add casts for error messages [Oberhumer]
+ 1.4 8 Dec 2006 LZW decompression speed improvements
+ 1.5 9 Feb 2008 Avoid warning in latest version of gcc
+ 1.6 17 Jan 2010 Avoid signed/unsigned comparison warnings
+ 1.7 12 Aug 2012 Update for z_const usage in zlib 1.2.8
+ */
+
+/*
+ gun [ -t ] [ name ... ]
+
+ decompresses the data in the named gzip files. If no arguments are given,
+ gun will decompress from stdin to stdout. The names must end in .gz, -gz,
+ .z, -z, _z, or .Z. The uncompressed data will be written to a file name
+ with the suffix stripped. On success, the original file is deleted. On
+ failure, the output file is deleted. For most failures, the command will
+ continue to process the remaining names on the command line. A memory
+ allocation failure will abort the command. If -t is specified, then the
+ listed files or stdin will be tested as gzip files for integrity (without
+ checking for a proper suffix), no output will be written, and no files
+ will be deleted.
+
+ Like gzip, gun allows concatenated gzip streams and will decompress them,
+ writing all of the uncompressed data to the output. Unlike gzip, gun allows
+ an empty file on input, and will produce no error writing an empty output
+ file.
+
+ gun will also decompress files made by Unix compress, which uses LZW
+ compression. These files are automatically detected by virtue of their
+ magic header bytes. Since the end of Unix compress stream is marked by the
+ end-of-file, they cannot be concantenated. If a Unix compress stream is
+ encountered in an input file, it is the last stream in that file.
+
+ Like gunzip and uncompress, the file attributes of the orignal compressed
+ file are maintained in the final uncompressed file, to the extent that the
+ user permissions allow it.
+
+ On my Mac OS X PowerPC G4, gun is almost twice as fast as gunzip (version
+ 1.2.4) is on the same file, when gun is linked with zlib 1.2.2. Also the
+ LZW decompression provided by gun is about twice as fast as the standard
+ Unix uncompress command.
+ */
+
+/* external functions and related types and constants */
+#include <stdio.h> /* fprintf() */
+#include <stdlib.h> /* malloc(), free() */
+#include <string.h> /* strerror(), strcmp(), strlen(), memcpy() */
+#include <errno.h> /* errno */
+#include <fcntl.h> /* open() */
+#include <unistd.h> /* read(), write(), close(), chown(), unlink() */
+#include <sys/types.h>
+#include <sys/stat.h> /* stat(), chmod() */
+#include <utime.h> /* utime() */
+#include "zlib.h" /* inflateBackInit(), inflateBack(), */
+ /* inflateBackEnd(), crc32() */
+
+/* function declaration */
+#define local static
+
+/* buffer constants */
+#define SIZE 32768U /* input and output buffer sizes */
+#define PIECE 16384 /* limits i/o chunks for 16-bit int case */
+
+/* structure for infback() to pass to input function in() -- it maintains the
+ input file and a buffer of size SIZE */
+struct ind {
+ int infile;
+ unsigned char *inbuf;
+};
+
+/* Load input buffer, assumed to be empty, and return bytes loaded and a
+ pointer to them. read() is called until the buffer is full, or until it
+ returns end-of-file or error. Return 0 on error. */
+local unsigned in(void *in_desc, z_const unsigned char **buf)
+{
+ int ret;
+ unsigned len;
+ unsigned char *next;
+ struct ind *me = (struct ind *)in_desc;
+
+ next = me->inbuf;
+ *buf = next;
+ len = 0;
+ do {
+ ret = PIECE;
+ if ((unsigned)ret > SIZE - len)
+ ret = (int)(SIZE - len);
+ ret = (int)read(me->infile, next, ret);
+ if (ret == -1) {
+ len = 0;
+ break;
+ }
+ next += ret;
+ len += ret;
+ } while (ret != 0 && len < SIZE);
+ return len;
+}
+
+/* structure for infback() to pass to output function out() -- it maintains the
+ output file, a running CRC-32 check on the output and the total number of
+ bytes output, both for checking against the gzip trailer. (The length in
+ the gzip trailer is stored modulo 2^32, so it's ok if a long is 32 bits and
+ the output is greater than 4 GB.) */
+struct outd {
+ int outfile;
+ int check; /* true if checking crc and total */
+ unsigned long crc;
+ unsigned long total;
+};
+
+/* Write output buffer and update the CRC-32 and total bytes written. write()
+ is called until all of the output is written or an error is encountered.
+ On success out() returns 0. For a write failure, out() returns 1. If the
+ output file descriptor is -1, then nothing is written.
+ */
+local int out(void *out_desc, unsigned char *buf, unsigned len)
+{
+ int ret;
+ struct outd *me = (struct outd *)out_desc;
+
+ if (me->check) {
+ me->crc = crc32(me->crc, buf, len);
+ me->total += len;
+ }
+ if (me->outfile != -1)
+ do {
+ ret = PIECE;
+ if ((unsigned)ret > len)
+ ret = (int)len;
+ ret = (int)write(me->outfile, buf, ret);
+ if (ret == -1)
+ return 1;
+ buf += ret;
+ len -= ret;
+ } while (len != 0);
+ return 0;
+}
+
+/* next input byte macro for use inside lunpipe() and gunpipe() */
+#define NEXT() (have ? 0 : (have = in(indp, &next)), \
+ last = have ? (have--, (int)(*next++)) : -1)
+
+/* memory for gunpipe() and lunpipe() --
+ the first 256 entries of prefix[] and suffix[] are never used, could
+ have offset the index, but it's faster to waste the memory */
+unsigned char inbuf[SIZE]; /* input buffer */
+unsigned char outbuf[SIZE]; /* output buffer */
+unsigned short prefix[65536]; /* index to LZW prefix string */
+unsigned char suffix[65536]; /* one-character LZW suffix */
+unsigned char match[65280 + 2]; /* buffer for reversed match or gzip
+ 32K sliding window */
+
+/* throw out what's left in the current bits byte buffer (this is a vestigial
+ aspect of the compressed data format derived from an implementation that
+ made use of a special VAX machine instruction!) */
+#define FLUSHCODE() \
+ do { \
+ left = 0; \
+ rem = 0; \
+ if (chunk > have) { \
+ chunk -= have; \
+ have = 0; \
+ if (NEXT() == -1) \
+ break; \
+ chunk--; \
+ if (chunk > have) { \
+ chunk = have = 0; \
+ break; \
+ } \
+ } \
+ have -= chunk; \
+ next += chunk; \
+ chunk = 0; \
+ } while (0)
+
+/* Decompress a compress (LZW) file from indp to outfile. The compress magic
+ header (two bytes) has already been read and verified. There are have bytes
+ of buffered input at next. strm is used for passing error information back
+ to gunpipe().
+
+ lunpipe() will return Z_OK on success, Z_BUF_ERROR for an unexpected end of
+ file, read error, or write error (a write error indicated by strm->next_in
+ not equal to Z_NULL), or Z_DATA_ERROR for invalid input.
+ */
+local int lunpipe(unsigned have, z_const unsigned char *next, struct ind *indp,
+ int outfile, z_stream *strm)
+{
+ int last; /* last byte read by NEXT(), or -1 if EOF */
+ unsigned chunk; /* bytes left in current chunk */
+ int left; /* bits left in rem */
+ unsigned rem; /* unused bits from input */
+ int bits; /* current bits per code */
+ unsigned code; /* code, table traversal index */
+ unsigned mask; /* mask for current bits codes */
+ int max; /* maximum bits per code for this stream */
+ unsigned flags; /* compress flags, then block compress flag */
+ unsigned end; /* last valid entry in prefix/suffix tables */
+ unsigned temp; /* current code */
+ unsigned prev; /* previous code */
+ unsigned final; /* last character written for previous code */
+ unsigned stack; /* next position for reversed string */
+ unsigned outcnt; /* bytes in output buffer */
+ struct outd outd; /* output structure */
+ unsigned char *p;
+
+ /* set up output */
+ outd.outfile = outfile;
+ outd.check = 0;
+
+ /* process remainder of compress header -- a flags byte */
+ flags = NEXT();
+ if (last == -1)
+ return Z_BUF_ERROR;
+ if (flags & 0x60) {
+ strm->msg = (char *)"unknown lzw flags set";
+ return Z_DATA_ERROR;
+ }
+ max = flags & 0x1f;
+ if (max < 9 || max > 16) {
+ strm->msg = (char *)"lzw bits out of range";
+ return Z_DATA_ERROR;
+ }
+ if (max == 9) /* 9 doesn't really mean 9 */
+ max = 10;
+ flags &= 0x80; /* true if block compress */
+
+ /* clear table */
+ bits = 9;
+ mask = 0x1ff;
+ end = flags ? 256 : 255;
+
+ /* set up: get first 9-bit code, which is the first decompressed byte, but
+ don't create a table entry until the next code */
+ if (NEXT() == -1) /* no compressed data is ok */
+ return Z_OK;
+ final = prev = (unsigned)last; /* low 8 bits of code */
+ if (NEXT() == -1) /* missing a bit */
+ return Z_BUF_ERROR;
+ if (last & 1) { /* code must be < 256 */
+ strm->msg = (char *)"invalid lzw code";
+ return Z_DATA_ERROR;
+ }
+ rem = (unsigned)last >> 1; /* remaining 7 bits */
+ left = 7;
+ chunk = bits - 2; /* 7 bytes left in this chunk */
+ outbuf[0] = (unsigned char)final; /* write first decompressed byte */
+ outcnt = 1;
+
+ /* decode codes */
+ stack = 0;
+ for (;;) {
+ /* if the table will be full after this, increment the code size */
+ if (end >= mask && bits < max) {
+ FLUSHCODE();
+ bits++;
+ mask <<= 1;
+ mask++;
+ }
+
+ /* get a code of length bits */
+ if (chunk == 0) /* decrement chunk modulo bits */
+ chunk = bits;
+ code = rem; /* low bits of code */
+ if (NEXT() == -1) { /* EOF is end of compressed data */
+ /* write remaining buffered output */
+ if (outcnt && out(&outd, outbuf, outcnt)) {
+ strm->next_in = outbuf; /* signal write error */
+ return Z_BUF_ERROR;
+ }
+ return Z_OK;
+ }
+ code += (unsigned)last << left; /* middle (or high) bits of code */
+ left += 8;
+ chunk--;
+ if (bits > left) { /* need more bits */
+ if (NEXT() == -1) /* can't end in middle of code */
+ return Z_BUF_ERROR;
+ code += (unsigned)last << left; /* high bits of code */
+ left += 8;
+ chunk--;
+ }
+ code &= mask; /* mask to current code length */
+ left -= bits; /* number of unused bits */
+ rem = (unsigned)last >> (8 - left); /* unused bits from last byte */
+
+ /* process clear code (256) */
+ if (code == 256 && flags) {
+ FLUSHCODE();
+ bits = 9; /* initialize bits and mask */
+ mask = 0x1ff;
+ end = 255; /* empty table */
+ continue; /* get next code */
+ }
+
+ /* special code to reuse last match */
+ temp = code; /* save the current code */
+ if (code > end) {
+ /* Be picky on the allowed code here, and make sure that the code
+ we drop through (prev) will be a valid index so that random
+ input does not cause an exception. The code != end + 1 check is
+ empirically derived, and not checked in the original uncompress
+ code. If this ever causes a problem, that check could be safely
+ removed. Leaving this check in greatly improves gun's ability
+ to detect random or corrupted input after a compress header.
+ In any case, the prev > end check must be retained. */
+ if (code != end + 1 || prev > end) {
+ strm->msg = (char *)"invalid lzw code";
+ return Z_DATA_ERROR;
+ }
+ match[stack++] = (unsigned char)final;
+ code = prev;
+ }
+
+ /* walk through linked list to generate output in reverse order */
+ p = match + stack;
+ while (code >= 256) {
+ *p++ = suffix[code];
+ code = prefix[code];
+ }
+ stack = p - match;
+ match[stack++] = (unsigned char)code;
+ final = code;
+
+ /* link new table entry */
+ if (end < mask) {
+ end++;
+ prefix[end] = (unsigned short)prev;
+ suffix[end] = (unsigned char)final;
+ }
+
+ /* set previous code for next iteration */
+ prev = temp;
+
+ /* write output in forward order */
+ while (stack > SIZE - outcnt) {
+ while (outcnt < SIZE)
+ outbuf[outcnt++] = match[--stack];
+ if (out(&outd, outbuf, outcnt)) {
+ strm->next_in = outbuf; /* signal write error */
+ return Z_BUF_ERROR;
+ }
+ outcnt = 0;
+ }
+ p = match + stack;
+ do {
+ outbuf[outcnt++] = *--p;
+ } while (p > match);
+ stack = 0;
+
+ /* loop for next code with final and prev as the last match, rem and
+ left provide the first 0..7 bits of the next code, end is the last
+ valid table entry */
+ }
+}
+
+/* Decompress a gzip file from infile to outfile. strm is assumed to have been
+ successfully initialized with inflateBackInit(). The input file may consist
+ of a series of gzip streams, in which case all of them will be decompressed
+ to the output file. If outfile is -1, then the gzip stream(s) integrity is
+ checked and nothing is written.
+
+ The return value is a zlib error code: Z_MEM_ERROR if out of memory,
+ Z_DATA_ERROR if the header or the compressed data is invalid, or if the
+ trailer CRC-32 check or length doesn't match, Z_BUF_ERROR if the input ends
+ prematurely or a write error occurs, or Z_ERRNO if junk (not a another gzip
+ stream) follows a valid gzip stream.
+ */
+local int gunpipe(z_stream *strm, int infile, int outfile)
+{
+ int ret, first, last;
+ unsigned have, flags, len;
+ z_const unsigned char *next = NULL;
+ struct ind ind, *indp;
+ struct outd outd;
+
+ /* setup input buffer */
+ ind.infile = infile;
+ ind.inbuf = inbuf;
+ indp = &ind;
+
+ /* decompress concatenated gzip streams */
+ have = 0; /* no input data read in yet */
+ first = 1; /* looking for first gzip header */
+ strm->next_in = Z_NULL; /* so Z_BUF_ERROR means EOF */
+ for (;;) {
+ /* look for the two magic header bytes for a gzip stream */
+ if (NEXT() == -1) {
+ ret = Z_OK;
+ break; /* empty gzip stream is ok */
+ }
+ if (last != 31 || (NEXT() != 139 && last != 157)) {
+ strm->msg = (char *)"incorrect header check";
+ ret = first ? Z_DATA_ERROR : Z_ERRNO;
+ break; /* not a gzip or compress header */
+ }
+ first = 0; /* next non-header is junk */
+
+ /* process a compress (LZW) file -- can't be concatenated after this */
+ if (last == 157) {
+ ret = lunpipe(have, next, indp, outfile, strm);
+ break;
+ }
+
+ /* process remainder of gzip header */
+ ret = Z_BUF_ERROR;
+ if (NEXT() != 8) { /* only deflate method allowed */
+ if (last == -1) break;
+ strm->msg = (char *)"unknown compression method";
+ ret = Z_DATA_ERROR;
+ break;
+ }
+ flags = NEXT(); /* header flags */
+ NEXT(); /* discard mod time, xflgs, os */
+ NEXT();
+ NEXT();
+ NEXT();
+ NEXT();
+ NEXT();
+ if (last == -1) break;
+ if (flags & 0xe0) {
+ strm->msg = (char *)"unknown header flags set";
+ ret = Z_DATA_ERROR;
+ break;
+ }
+ if (flags & 4) { /* extra field */
+ len = NEXT();
+ len += (unsigned)(NEXT()) << 8;
+ if (last == -1) break;
+ while (len > have) {
+ len -= have;
+ have = 0;
+ if (NEXT() == -1) break;
+ len--;
+ }
+ if (last == -1) break;
+ have -= len;
+ next += len;
+ }
+ if (flags & 8) /* file name */
+ while (NEXT() != 0 && last != -1)
+ ;
+ if (flags & 16) /* comment */
+ while (NEXT() != 0 && last != -1)
+ ;
+ if (flags & 2) { /* header crc */
+ NEXT();
+ NEXT();
+ }
+ if (last == -1) break;
+
+ /* set up output */
+ outd.outfile = outfile;
+ outd.check = 1;
+ outd.crc = crc32(0L, Z_NULL, 0);
+ outd.total = 0;
+
+ /* decompress data to output */
+ strm->next_in = next;
+ strm->avail_in = have;
+ ret = inflateBack(strm, in, indp, out, &outd);
+ if (ret != Z_STREAM_END) break;
+ next = strm->next_in;
+ have = strm->avail_in;
+ strm->next_in = Z_NULL; /* so Z_BUF_ERROR means EOF */
+
+ /* check trailer */
+ ret = Z_BUF_ERROR;
+ if (NEXT() != (int)(outd.crc & 0xff) ||
+ NEXT() != (int)((outd.crc >> 8) & 0xff) ||
+ NEXT() != (int)((outd.crc >> 16) & 0xff) ||
+ NEXT() != (int)((outd.crc >> 24) & 0xff)) {
+ /* crc error */
+ if (last != -1) {
+ strm->msg = (char *)"incorrect data check";
+ ret = Z_DATA_ERROR;
+ }
+ break;
+ }
+ if (NEXT() != (int)(outd.total & 0xff) ||
+ NEXT() != (int)((outd.total >> 8) & 0xff) ||
+ NEXT() != (int)((outd.total >> 16) & 0xff) ||
+ NEXT() != (int)((outd.total >> 24) & 0xff)) {
+ /* length error */
+ if (last != -1) {
+ strm->msg = (char *)"incorrect length check";
+ ret = Z_DATA_ERROR;
+ }
+ break;
+ }
+
+ /* go back and look for another gzip stream */
+ }
+
+ /* clean up and return */
+ return ret;
+}
+
+/* Copy file attributes, from -> to, as best we can. This is best effort, so
+ no errors are reported. The mode bits, including suid, sgid, and the sticky
+ bit are copied (if allowed), the owner's user id and group id are copied
+ (again if allowed), and the access and modify times are copied. */
+local void copymeta(char *from, char *to)
+{
+ struct stat was;
+ struct utimbuf when;
+
+ /* get all of from's Unix meta data, return if not a regular file */
+ if (stat(from, &was) != 0 || (was.st_mode & S_IFMT) != S_IFREG)
+ return;
+
+ /* set to's mode bits, ignore errors */
+ (void)chmod(to, was.st_mode & 07777);
+
+ /* copy owner's user and group, ignore errors */
+ (void)chown(to, was.st_uid, was.st_gid);
+
+ /* copy access and modify times, ignore errors */
+ when.actime = was.st_atime;
+ when.modtime = was.st_mtime;
+ (void)utime(to, &when);
+}
+
+/* Decompress the file inname to the file outnname, of if test is true, just
+ decompress without writing and check the gzip trailer for integrity. If
+ inname is NULL or an empty string, read from stdin. If outname is NULL or
+ an empty string, write to stdout. strm is a pre-initialized inflateBack
+ structure. When appropriate, copy the file attributes from inname to
+ outname.
+
+ gunzip() returns 1 if there is an out-of-memory error or an unexpected
+ return code from gunpipe(). Otherwise it returns 0.
+ */
+local int gunzip(z_stream *strm, char *inname, char *outname, int test)
+{
+ int ret;
+ int infile, outfile;
+
+ /* open files */
+ if (inname == NULL || *inname == 0) {
+ inname = "-";
+ infile = 0; /* stdin */
+ }
+ else {
+ infile = open(inname, O_RDONLY, 0);
+ if (infile == -1) {
+ fprintf(stderr, "gun cannot open %s\n", inname);
+ return 0;
+ }
+ }
+ if (test)
+ outfile = -1;
+ else if (outname == NULL || *outname == 0) {
+ outname = "-";
+ outfile = 1; /* stdout */
+ }
+ else {
+ outfile = open(outname, O_CREAT | O_TRUNC | O_WRONLY, 0666);
+ if (outfile == -1) {
+ close(infile);
+ fprintf(stderr, "gun cannot create %s\n", outname);
+ return 0;
+ }
+ }
+ errno = 0;
+
+ /* decompress */
+ ret = gunpipe(strm, infile, outfile);
+ if (outfile > 2) close(outfile);
+ if (infile > 2) close(infile);
+
+ /* interpret result */
+ switch (ret) {
+ case Z_OK:
+ case Z_ERRNO:
+ if (infile > 2 && outfile > 2) {
+ copymeta(inname, outname); /* copy attributes */
+ unlink(inname);
+ }
+ if (ret == Z_ERRNO)
+ fprintf(stderr, "gun warning: trailing garbage ignored in %s\n",
+ inname);
+ break;
+ case Z_DATA_ERROR:
+ if (outfile > 2) unlink(outname);
+ fprintf(stderr, "gun data error on %s: %s\n", inname, strm->msg);
+ break;
+ case Z_MEM_ERROR:
+ if (outfile > 2) unlink(outname);
+ fprintf(stderr, "gun out of memory error--aborting\n");
+ return 1;
+ case Z_BUF_ERROR:
+ if (outfile > 2) unlink(outname);
+ if (strm->next_in != Z_NULL) {
+ fprintf(stderr, "gun write error on %s: %s\n",
+ outname, strerror(errno));
+ }
+ else if (errno) {
+ fprintf(stderr, "gun read error on %s: %s\n",
+ inname, strerror(errno));
+ }
+ else {
+ fprintf(stderr, "gun unexpected end of file on %s\n",
+ inname);
+ }
+ break;
+ default:
+ if (outfile > 2) unlink(outname);
+ fprintf(stderr, "gun internal error--aborting\n");
+ return 1;
+ }
+ return 0;
+}
+
+/* Process the gun command line arguments. See the command syntax near the
+ beginning of this source file. */
+int main(int argc, char **argv)
+{
+ int ret, len, test;
+ char *outname;
+ unsigned char *window;
+ z_stream strm;
+
+ /* initialize inflateBack state for repeated use */
+ window = match; /* reuse LZW match buffer */
+ strm.zalloc = Z_NULL;
+ strm.zfree = Z_NULL;
+ strm.opaque = Z_NULL;
+ ret = inflateBackInit(&strm, 15, window);
+ if (ret != Z_OK) {
+ fprintf(stderr, "gun out of memory error--aborting\n");
+ return 1;
+ }
+
+ /* decompress each file to the same name with the suffix removed */
+ argc--;
+ argv++;
+ test = 0;
+ if (argc && strcmp(*argv, "-h") == 0) {
+ fprintf(stderr, "gun 1.6 (17 Jan 2010)\n");
+ fprintf(stderr, "Copyright (C) 2003-2010 Mark Adler\n");
+ fprintf(stderr, "usage: gun [-t] [file1.gz [file2.Z ...]]\n");
+ return 0;
+ }
+ if (argc && strcmp(*argv, "-t") == 0) {
+ test = 1;
+ argc--;
+ argv++;
+ }
+ if (argc)
+ do {
+ if (test)
+ outname = NULL;
+ else {
+ len = (int)strlen(*argv);
+ if (strcmp(*argv + len - 3, ".gz") == 0 ||
+ strcmp(*argv + len - 3, "-gz") == 0)
+ len -= 3;
+ else if (strcmp(*argv + len - 2, ".z") == 0 ||
+ strcmp(*argv + len - 2, "-z") == 0 ||
+ strcmp(*argv + len - 2, "_z") == 0 ||
+ strcmp(*argv + len - 2, ".Z") == 0)
+ len -= 2;
+ else {
+ fprintf(stderr, "gun error: no gz type on %s--skipping\n",
+ *argv);
+ continue;
+ }
+ outname = malloc(len + 1);
+ if (outname == NULL) {
+ fprintf(stderr, "gun out of memory error--aborting\n");
+ ret = 1;
+ break;
+ }
+ memcpy(outname, *argv, len);
+ outname[len] = 0;
+ }
+ ret = gunzip(&strm, *argv, outname, test);
+ if (outname != NULL) free(outname);
+ if (ret) break;
+ } while (argv++, --argc);
+ else
+ ret = gunzip(&strm, NULL, NULL, test);
+
+ /* clean up */
+ inflateBackEnd(&strm);
+ return ret;
+}
diff --git a/protocols/Telegram/tgl/zlib/examples/gzappend.c b/protocols/Telegram/tgl/zlib/examples/gzappend.c
new file mode 100644
index 0000000000..662dec3794
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/examples/gzappend.c
@@ -0,0 +1,504 @@
+/* gzappend -- command to append to a gzip file
+
+ Copyright (C) 2003, 2012 Mark Adler, all rights reserved
+ version 1.2, 11 Oct 2012
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the author be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Mark Adler madler@alumni.caltech.edu
+ */
+
+/*
+ * Change history:
+ *
+ * 1.0 19 Oct 2003 - First version
+ * 1.1 4 Nov 2003 - Expand and clarify some comments and notes
+ * - Add version and copyright to help
+ * - Send help to stdout instead of stderr
+ * - Add some preemptive typecasts
+ * - Add L to constants in lseek() calls
+ * - Remove some debugging information in error messages
+ * - Use new data_type definition for zlib 1.2.1
+ * - Simplfy and unify file operations
+ * - Finish off gzip file in gztack()
+ * - Use deflatePrime() instead of adding empty blocks
+ * - Keep gzip file clean on appended file read errors
+ * - Use in-place rotate instead of auxiliary buffer
+ * (Why you ask? Because it was fun to write!)
+ * 1.2 11 Oct 2012 - Fix for proper z_const usage
+ * - Check for input buffer malloc failure
+ */
+
+/*
+ gzappend takes a gzip file and appends to it, compressing files from the
+ command line or data from stdin. The gzip file is written to directly, to
+ avoid copying that file, in case it's large. Note that this results in the
+ unfriendly behavior that if gzappend fails, the gzip file is corrupted.
+
+ This program was written to illustrate the use of the new Z_BLOCK option of
+ zlib 1.2.x's inflate() function. This option returns from inflate() at each
+ block boundary to facilitate locating and modifying the last block bit at
+ the start of the final deflate block. Also whether using Z_BLOCK or not,
+ another required feature of zlib 1.2.x is that inflate() now provides the
+ number of unusued bits in the last input byte used. gzappend will not work
+ with versions of zlib earlier than 1.2.1.
+
+ gzappend first decompresses the gzip file internally, discarding all but
+ the last 32K of uncompressed data, and noting the location of the last block
+ bit and the number of unused bits in the last byte of the compressed data.
+ The gzip trailer containing the CRC-32 and length of the uncompressed data
+ is verified. This trailer will be later overwritten.
+
+ Then the last block bit is cleared by seeking back in the file and rewriting
+ the byte that contains it. Seeking forward, the last byte of the compressed
+ data is saved along with the number of unused bits to initialize deflate.
+
+ A deflate process is initialized, using the last 32K of the uncompressed
+ data from the gzip file to initialize the dictionary. If the total
+ uncompressed data was less than 32K, then all of it is used to initialize
+ the dictionary. The deflate output bit buffer is also initialized with the
+ last bits from the original deflate stream. From here on, the data to
+ append is simply compressed using deflate, and written to the gzip file.
+ When that is complete, the new CRC-32 and uncompressed length are written
+ as the trailer of the gzip file.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include "zlib.h"
+
+#define local static
+#define LGCHUNK 14
+#define CHUNK (1U << LGCHUNK)
+#define DSIZE 32768U
+
+/* print an error message and terminate with extreme prejudice */
+local void bye(char *msg1, char *msg2)
+{
+ fprintf(stderr, "gzappend error: %s%s\n", msg1, msg2);
+ exit(1);
+}
+
+/* return the greatest common divisor of a and b using Euclid's algorithm,
+ modified to be fast when one argument much greater than the other, and
+ coded to avoid unnecessary swapping */
+local unsigned gcd(unsigned a, unsigned b)
+{
+ unsigned c;
+
+ while (a && b)
+ if (a > b) {
+ c = b;
+ while (a - c >= c)
+ c <<= 1;
+ a -= c;
+ }
+ else {
+ c = a;
+ while (b - c >= c)
+ c <<= 1;
+ b -= c;
+ }
+ return a + b;
+}
+
+/* rotate list[0..len-1] left by rot positions, in place */
+local void rotate(unsigned char *list, unsigned len, unsigned rot)
+{
+ unsigned char tmp;
+ unsigned cycles;
+ unsigned char *start, *last, *to, *from;
+
+ /* normalize rot and handle degenerate cases */
+ if (len < 2) return;
+ if (rot >= len) rot %= len;
+ if (rot == 0) return;
+
+ /* pointer to last entry in list */
+ last = list + (len - 1);
+
+ /* do simple left shift by one */
+ if (rot == 1) {
+ tmp = *list;
+ memcpy(list, list + 1, len - 1);
+ *last = tmp;
+ return;
+ }
+
+ /* do simple right shift by one */
+ if (rot == len - 1) {
+ tmp = *last;
+ memmove(list + 1, list, len - 1);
+ *list = tmp;
+ return;
+ }
+
+ /* otherwise do rotate as a set of cycles in place */
+ cycles = gcd(len, rot); /* number of cycles */
+ do {
+ start = from = list + cycles; /* start index is arbitrary */
+ tmp = *from; /* save entry to be overwritten */
+ for (;;) {
+ to = from; /* next step in cycle */
+ from += rot; /* go right rot positions */
+ if (from > last) from -= len; /* (pointer better not wrap) */
+ if (from == start) break; /* all but one shifted */
+ *to = *from; /* shift left */
+ }
+ *to = tmp; /* complete the circle */
+ } while (--cycles);
+}
+
+/* structure for gzip file read operations */
+typedef struct {
+ int fd; /* file descriptor */
+ int size; /* 1 << size is bytes in buf */
+ unsigned left; /* bytes available at next */
+ unsigned char *buf; /* buffer */
+ z_const unsigned char *next; /* next byte in buffer */
+ char *name; /* file name for error messages */
+} file;
+
+/* reload buffer */
+local int readin(file *in)
+{
+ int len;
+
+ len = read(in->fd, in->buf, 1 << in->size);
+ if (len == -1) bye("error reading ", in->name);
+ in->left = (unsigned)len;
+ in->next = in->buf;
+ return len;
+}
+
+/* read from file in, exit if end-of-file */
+local int readmore(file *in)
+{
+ if (readin(in) == 0) bye("unexpected end of ", in->name);
+ return 0;
+}
+
+#define read1(in) (in->left == 0 ? readmore(in) : 0, \
+ in->left--, *(in->next)++)
+
+/* skip over n bytes of in */
+local void skip(file *in, unsigned n)
+{
+ unsigned bypass;
+
+ if (n > in->left) {
+ n -= in->left;
+ bypass = n & ~((1U << in->size) - 1);
+ if (bypass) {
+ if (lseek(in->fd, (off_t)bypass, SEEK_CUR) == -1)
+ bye("seeking ", in->name);
+ n -= bypass;
+ }
+ readmore(in);
+ if (n > in->left)
+ bye("unexpected end of ", in->name);
+ }
+ in->left -= n;
+ in->next += n;
+}
+
+/* read a four-byte unsigned integer, little-endian, from in */
+unsigned long read4(file *in)
+{
+ unsigned long val;
+
+ val = read1(in);
+ val += (unsigned)read1(in) << 8;
+ val += (unsigned long)read1(in) << 16;
+ val += (unsigned long)read1(in) << 24;
+ return val;
+}
+
+/* skip over gzip header */
+local void gzheader(file *in)
+{
+ int flags;
+ unsigned n;
+
+ if (read1(in) != 31 || read1(in) != 139) bye(in->name, " not a gzip file");
+ if (read1(in) != 8) bye("unknown compression method in", in->name);
+ flags = read1(in);
+ if (flags & 0xe0) bye("unknown header flags set in", in->name);
+ skip(in, 6);
+ if (flags & 4) {
+ n = read1(in);
+ n += (unsigned)(read1(in)) << 8;
+ skip(in, n);
+ }
+ if (flags & 8) while (read1(in) != 0) ;
+ if (flags & 16) while (read1(in) != 0) ;
+ if (flags & 2) skip(in, 2);
+}
+
+/* decompress gzip file "name", return strm with a deflate stream ready to
+ continue compression of the data in the gzip file, and return a file
+ descriptor pointing to where to write the compressed data -- the deflate
+ stream is initialized to compress using level "level" */
+local int gzscan(char *name, z_stream *strm, int level)
+{
+ int ret, lastbit, left, full;
+ unsigned have;
+ unsigned long crc, tot;
+ unsigned char *window;
+ off_t lastoff, end;
+ file gz;
+
+ /* open gzip file */
+ gz.name = name;
+ gz.fd = open(name, O_RDWR, 0);
+ if (gz.fd == -1) bye("cannot open ", name);
+ gz.buf = malloc(CHUNK);
+ if (gz.buf == NULL) bye("out of memory", "");
+ gz.size = LGCHUNK;
+ gz.left = 0;
+
+ /* skip gzip header */
+ gzheader(&gz);
+
+ /* prepare to decompress */
+ window = malloc(DSIZE);
+ if (window == NULL) bye("out of memory", "");
+ strm->zalloc = Z_NULL;
+ strm->zfree = Z_NULL;
+ strm->opaque = Z_NULL;
+ ret = inflateInit2(strm, -15);
+ if (ret != Z_OK) bye("out of memory", " or library mismatch");
+
+ /* decompress the deflate stream, saving append information */
+ lastbit = 0;
+ lastoff = lseek(gz.fd, 0L, SEEK_CUR) - gz.left;
+ left = 0;
+ strm->avail_in = gz.left;
+ strm->next_in = gz.next;
+ crc = crc32(0L, Z_NULL, 0);
+ have = full = 0;
+ do {
+ /* if needed, get more input */
+ if (strm->avail_in == 0) {
+ readmore(&gz);
+ strm->avail_in = gz.left;
+ strm->next_in = gz.next;
+ }
+
+ /* set up output to next available section of sliding window */
+ strm->avail_out = DSIZE - have;
+ strm->next_out = window + have;
+
+ /* inflate and check for errors */
+ ret = inflate(strm, Z_BLOCK);
+ if (ret == Z_STREAM_ERROR) bye("internal stream error!", "");
+ if (ret == Z_MEM_ERROR) bye("out of memory", "");
+ if (ret == Z_DATA_ERROR)
+ bye("invalid compressed data--format violated in", name);
+
+ /* update crc and sliding window pointer */
+ crc = crc32(crc, window + have, DSIZE - have - strm->avail_out);
+ if (strm->avail_out)
+ have = DSIZE - strm->avail_out;
+ else {
+ have = 0;
+ full = 1;
+ }
+
+ /* process end of block */
+ if (strm->data_type & 128) {
+ if (strm->data_type & 64)
+ left = strm->data_type & 0x1f;
+ else {
+ lastbit = strm->data_type & 0x1f;
+ lastoff = lseek(gz.fd, 0L, SEEK_CUR) - strm->avail_in;
+ }
+ }
+ } while (ret != Z_STREAM_END);
+ inflateEnd(strm);
+ gz.left = strm->avail_in;
+ gz.next = strm->next_in;
+
+ /* save the location of the end of the compressed data */
+ end = lseek(gz.fd, 0L, SEEK_CUR) - gz.left;
+
+ /* check gzip trailer and save total for deflate */
+ if (crc != read4(&gz))
+ bye("invalid compressed data--crc mismatch in ", name);
+ tot = strm->total_out;
+ if ((tot & 0xffffffffUL) != read4(&gz))
+ bye("invalid compressed data--length mismatch in", name);
+
+ /* if not at end of file, warn */
+ if (gz.left || readin(&gz))
+ fprintf(stderr,
+ "gzappend warning: junk at end of gzip file overwritten\n");
+
+ /* clear last block bit */
+ lseek(gz.fd, lastoff - (lastbit != 0), SEEK_SET);
+ if (read(gz.fd, gz.buf, 1) != 1) bye("reading after seek on ", name);
+ *gz.buf = (unsigned char)(*gz.buf ^ (1 << ((8 - lastbit) & 7)));
+ lseek(gz.fd, -1L, SEEK_CUR);
+ if (write(gz.fd, gz.buf, 1) != 1) bye("writing after seek to ", name);
+
+ /* if window wrapped, build dictionary from window by rotating */
+ if (full) {
+ rotate(window, DSIZE, have);
+ have = DSIZE;
+ }
+
+ /* set up deflate stream with window, crc, total_in, and leftover bits */
+ ret = deflateInit2(strm, level, Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY);
+ if (ret != Z_OK) bye("out of memory", "");
+ deflateSetDictionary(strm, window, have);
+ strm->adler = crc;
+ strm->total_in = tot;
+ if (left) {
+ lseek(gz.fd, --end, SEEK_SET);
+ if (read(gz.fd, gz.buf, 1) != 1) bye("reading after seek on ", name);
+ deflatePrime(strm, 8 - left, *gz.buf);
+ }
+ lseek(gz.fd, end, SEEK_SET);
+
+ /* clean up and return */
+ free(window);
+ free(gz.buf);
+ return gz.fd;
+}
+
+/* append file "name" to gzip file gd using deflate stream strm -- if last
+ is true, then finish off the deflate stream at the end */
+local void gztack(char *name, int gd, z_stream *strm, int last)
+{
+ int fd, len, ret;
+ unsigned left;
+ unsigned char *in, *out;
+
+ /* open file to compress and append */
+ fd = 0;
+ if (name != NULL) {
+ fd = open(name, O_RDONLY, 0);
+ if (fd == -1)
+ fprintf(stderr, "gzappend warning: %s not found, skipping ...\n",
+ name);
+ }
+
+ /* allocate buffers */
+ in = malloc(CHUNK);
+ out = malloc(CHUNK);
+ if (in == NULL || out == NULL) bye("out of memory", "");
+
+ /* compress input file and append to gzip file */
+ do {
+ /* get more input */
+ len = read(fd, in, CHUNK);
+ if (len == -1) {
+ fprintf(stderr,
+ "gzappend warning: error reading %s, skipping rest ...\n",
+ name);
+ len = 0;
+ }
+ strm->avail_in = (unsigned)len;
+ strm->next_in = in;
+ if (len) strm->adler = crc32(strm->adler, in, (unsigned)len);
+
+ /* compress and write all available output */
+ do {
+ strm->avail_out = CHUNK;
+ strm->next_out = out;
+ ret = deflate(strm, last && len == 0 ? Z_FINISH : Z_NO_FLUSH);
+ left = CHUNK - strm->avail_out;
+ while (left) {
+ len = write(gd, out + CHUNK - strm->avail_out - left, left);
+ if (len == -1) bye("writing gzip file", "");
+ left -= (unsigned)len;
+ }
+ } while (strm->avail_out == 0 && ret != Z_STREAM_END);
+ } while (len != 0);
+
+ /* write trailer after last entry */
+ if (last) {
+ deflateEnd(strm);
+ out[0] = (unsigned char)(strm->adler);
+ out[1] = (unsigned char)(strm->adler >> 8);
+ out[2] = (unsigned char)(strm->adler >> 16);
+ out[3] = (unsigned char)(strm->adler >> 24);
+ out[4] = (unsigned char)(strm->total_in);
+ out[5] = (unsigned char)(strm->total_in >> 8);
+ out[6] = (unsigned char)(strm->total_in >> 16);
+ out[7] = (unsigned char)(strm->total_in >> 24);
+ len = 8;
+ do {
+ ret = write(gd, out + 8 - len, len);
+ if (ret == -1) bye("writing gzip file", "");
+ len -= ret;
+ } while (len);
+ close(gd);
+ }
+
+ /* clean up and return */
+ free(out);
+ free(in);
+ if (fd > 0) close(fd);
+}
+
+/* process the compression level option if present, scan the gzip file, and
+ append the specified files, or append the data from stdin if no other file
+ names are provided on the command line -- the gzip file must be writable
+ and seekable */
+int main(int argc, char **argv)
+{
+ int gd, level;
+ z_stream strm;
+
+ /* ignore command name */
+ argc--; argv++;
+
+ /* provide usage if no arguments */
+ if (*argv == NULL) {
+ printf(
+ "gzappend 1.2 (11 Oct 2012) Copyright (C) 2003, 2012 Mark Adler\n"
+ );
+ printf(
+ "usage: gzappend [-level] file.gz [ addthis [ andthis ... ]]\n");
+ return 0;
+ }
+
+ /* set compression level */
+ level = Z_DEFAULT_COMPRESSION;
+ if (argv[0][0] == '-') {
+ if (argv[0][1] < '0' || argv[0][1] > '9' || argv[0][2] != 0)
+ bye("invalid compression level", "");
+ level = argv[0][1] - '0';
+ if (*++argv == NULL) bye("no gzip file name after options", "");
+ }
+
+ /* prepare to append to gzip file */
+ gd = gzscan(*argv++, &strm, level);
+
+ /* append files on command line, or from stdin if none */
+ if (*argv == NULL)
+ gztack(NULL, gd, &strm, 1);
+ else
+ do {
+ gztack(*argv, gd, &strm, argv[1] == NULL);
+ } while (*++argv != NULL);
+ return 0;
+}
diff --git a/protocols/Telegram/tgl/zlib/examples/gzjoin.c b/protocols/Telegram/tgl/zlib/examples/gzjoin.c
new file mode 100644
index 0000000000..89e8098441
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/examples/gzjoin.c
@@ -0,0 +1,449 @@
+/* gzjoin -- command to join gzip files into one gzip file
+
+ Copyright (C) 2004, 2005, 2012 Mark Adler, all rights reserved
+ version 1.2, 14 Aug 2012
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the author be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Mark Adler madler@alumni.caltech.edu
+ */
+
+/*
+ * Change history:
+ *
+ * 1.0 11 Dec 2004 - First version
+ * 1.1 12 Jun 2005 - Changed ssize_t to long for portability
+ * 1.2 14 Aug 2012 - Clean up for z_const usage
+ */
+
+/*
+ gzjoin takes one or more gzip files on the command line and writes out a
+ single gzip file that will uncompress to the concatenation of the
+ uncompressed data from the individual gzip files. gzjoin does this without
+ having to recompress any of the data and without having to calculate a new
+ crc32 for the concatenated uncompressed data. gzjoin does however have to
+ decompress all of the input data in order to find the bits in the compressed
+ data that need to be modified to concatenate the streams.
+
+ gzjoin does not do an integrity check on the input gzip files other than
+ checking the gzip header and decompressing the compressed data. They are
+ otherwise assumed to be complete and correct.
+
+ Each joint between gzip files removes at least 18 bytes of previous trailer
+ and subsequent header, and inserts an average of about three bytes to the
+ compressed data in order to connect the streams. The output gzip file
+ has a minimal ten-byte gzip header with no file name or modification time.
+
+ This program was written to illustrate the use of the Z_BLOCK option of
+ inflate() and the crc32_combine() function. gzjoin will not compile with
+ versions of zlib earlier than 1.2.3.
+ */
+
+#include <stdio.h> /* fputs(), fprintf(), fwrite(), putc() */
+#include <stdlib.h> /* exit(), malloc(), free() */
+#include <fcntl.h> /* open() */
+#include <unistd.h> /* close(), read(), lseek() */
+#include "zlib.h"
+ /* crc32(), crc32_combine(), inflateInit2(), inflate(), inflateEnd() */
+
+#define local static
+
+/* exit with an error (return a value to allow use in an expression) */
+local int bail(char *why1, char *why2)
+{
+ fprintf(stderr, "gzjoin error: %s%s, output incomplete\n", why1, why2);
+ exit(1);
+ return 0;
+}
+
+/* -- simple buffered file input with access to the buffer -- */
+
+#define CHUNK 32768 /* must be a power of two and fit in unsigned */
+
+/* bin buffered input file type */
+typedef struct {
+ char *name; /* name of file for error messages */
+ int fd; /* file descriptor */
+ unsigned left; /* bytes remaining at next */
+ unsigned char *next; /* next byte to read */
+ unsigned char *buf; /* allocated buffer of length CHUNK */
+} bin;
+
+/* close a buffered file and free allocated memory */
+local void bclose(bin *in)
+{
+ if (in != NULL) {
+ if (in->fd != -1)
+ close(in->fd);
+ if (in->buf != NULL)
+ free(in->buf);
+ free(in);
+ }
+}
+
+/* open a buffered file for input, return a pointer to type bin, or NULL on
+ failure */
+local bin *bopen(char *name)
+{
+ bin *in;
+
+ in = malloc(sizeof(bin));
+ if (in == NULL)
+ return NULL;
+ in->buf = malloc(CHUNK);
+ in->fd = open(name, O_RDONLY, 0);
+ if (in->buf == NULL || in->fd == -1) {
+ bclose(in);
+ return NULL;
+ }
+ in->left = 0;
+ in->next = in->buf;
+ in->name = name;
+ return in;
+}
+
+/* load buffer from file, return -1 on read error, 0 or 1 on success, with
+ 1 indicating that end-of-file was reached */
+local int bload(bin *in)
+{
+ long len;
+
+ if (in == NULL)
+ return -1;
+ if (in->left != 0)
+ return 0;
+ in->next = in->buf;
+ do {
+ len = (long)read(in->fd, in->buf + in->left, CHUNK - in->left);
+ if (len < 0)
+ return -1;
+ in->left += (unsigned)len;
+ } while (len != 0 && in->left < CHUNK);
+ return len == 0 ? 1 : 0;
+}
+
+/* get a byte from the file, bail if end of file */
+#define bget(in) (in->left ? 0 : bload(in), \
+ in->left ? (in->left--, *(in->next)++) : \
+ bail("unexpected end of file on ", in->name))
+
+/* get a four-byte little-endian unsigned integer from file */
+local unsigned long bget4(bin *in)
+{
+ unsigned long val;
+
+ val = bget(in);
+ val += (unsigned long)(bget(in)) << 8;
+ val += (unsigned long)(bget(in)) << 16;
+ val += (unsigned long)(bget(in)) << 24;
+ return val;
+}
+
+/* skip bytes in file */
+local void bskip(bin *in, unsigned skip)
+{
+ /* check pointer */
+ if (in == NULL)
+ return;
+
+ /* easy case -- skip bytes in buffer */
+ if (skip <= in->left) {
+ in->left -= skip;
+ in->next += skip;
+ return;
+ }
+
+ /* skip what's in buffer, discard buffer contents */
+ skip -= in->left;
+ in->left = 0;
+
+ /* seek past multiples of CHUNK bytes */
+ if (skip > CHUNK) {
+ unsigned left;
+
+ left = skip & (CHUNK - 1);
+ if (left == 0) {
+ /* exact number of chunks: seek all the way minus one byte to check
+ for end-of-file with a read */
+ lseek(in->fd, skip - 1, SEEK_CUR);
+ if (read(in->fd, in->buf, 1) != 1)
+ bail("unexpected end of file on ", in->name);
+ return;
+ }
+
+ /* skip the integral chunks, update skip with remainder */
+ lseek(in->fd, skip - left, SEEK_CUR);
+ skip = left;
+ }
+
+ /* read more input and skip remainder */
+ bload(in);
+ if (skip > in->left)
+ bail("unexpected end of file on ", in->name);
+ in->left -= skip;
+ in->next += skip;
+}
+
+/* -- end of buffered input functions -- */
+
+/* skip the gzip header from file in */
+local void gzhead(bin *in)
+{
+ int flags;
+
+ /* verify gzip magic header and compression method */
+ if (bget(in) != 0x1f || bget(in) != 0x8b || bget(in) != 8)
+ bail(in->name, " is not a valid gzip file");
+
+ /* get and verify flags */
+ flags = bget(in);
+ if ((flags & 0xe0) != 0)
+ bail("unknown reserved bits set in ", in->name);
+
+ /* skip modification time, extra flags, and os */
+ bskip(in, 6);
+
+ /* skip extra field if present */
+ if (flags & 4) {
+ unsigned len;
+
+ len = bget(in);
+ len += (unsigned)(bget(in)) << 8;
+ bskip(in, len);
+ }
+
+ /* skip file name if present */
+ if (flags & 8)
+ while (bget(in) != 0)
+ ;
+
+ /* skip comment if present */
+ if (flags & 16)
+ while (bget(in) != 0)
+ ;
+
+ /* skip header crc if present */
+ if (flags & 2)
+ bskip(in, 2);
+}
+
+/* write a four-byte little-endian unsigned integer to out */
+local void put4(unsigned long val, FILE *out)
+{
+ putc(val & 0xff, out);
+ putc((val >> 8) & 0xff, out);
+ putc((val >> 16) & 0xff, out);
+ putc((val >> 24) & 0xff, out);
+}
+
+/* Load up zlib stream from buffered input, bail if end of file */
+local void zpull(z_streamp strm, bin *in)
+{
+ if (in->left == 0)
+ bload(in);
+ if (in->left == 0)
+ bail("unexpected end of file on ", in->name);
+ strm->avail_in = in->left;
+ strm->next_in = in->next;
+}
+
+/* Write header for gzip file to out and initialize trailer. */
+local void gzinit(unsigned long *crc, unsigned long *tot, FILE *out)
+{
+ fwrite("\x1f\x8b\x08\0\0\0\0\0\0\xff", 1, 10, out);
+ *crc = crc32(0L, Z_NULL, 0);
+ *tot = 0;
+}
+
+/* Copy the compressed data from name, zeroing the last block bit of the last
+ block if clr is true, and adding empty blocks as needed to get to a byte
+ boundary. If clr is false, then the last block becomes the last block of
+ the output, and the gzip trailer is written. crc and tot maintains the
+ crc and length (modulo 2^32) of the output for the trailer. The resulting
+ gzip file is written to out. gzinit() must be called before the first call
+ of gzcopy() to write the gzip header and to initialize crc and tot. */
+local void gzcopy(char *name, int clr, unsigned long *crc, unsigned long *tot,
+ FILE *out)
+{
+ int ret; /* return value from zlib functions */
+ int pos; /* where the "last block" bit is in byte */
+ int last; /* true if processing the last block */
+ bin *in; /* buffered input file */
+ unsigned char *start; /* start of compressed data in buffer */
+ unsigned char *junk; /* buffer for uncompressed data -- discarded */
+ z_off_t len; /* length of uncompressed data (support > 4 GB) */
+ z_stream strm; /* zlib inflate stream */
+
+ /* open gzip file and skip header */
+ in = bopen(name);
+ if (in == NULL)
+ bail("could not open ", name);
+ gzhead(in);
+
+ /* allocate buffer for uncompressed data and initialize raw inflate
+ stream */
+ junk = malloc(CHUNK);
+ strm.zalloc = Z_NULL;
+ strm.zfree = Z_NULL;
+ strm.opaque = Z_NULL;
+ strm.avail_in = 0;
+ strm.next_in = Z_NULL;
+ ret = inflateInit2(&strm, -15);
+ if (junk == NULL || ret != Z_OK)
+ bail("out of memory", "");
+
+ /* inflate and copy compressed data, clear last-block bit if requested */
+ len = 0;
+ zpull(&strm, in);
+ start = in->next;
+ last = start[0] & 1;
+ if (last && clr)
+ start[0] &= ~1;
+ strm.avail_out = 0;
+ for (;;) {
+ /* if input used and output done, write used input and get more */
+ if (strm.avail_in == 0 && strm.avail_out != 0) {
+ fwrite(start, 1, strm.next_in - start, out);
+ start = in->buf;
+ in->left = 0;
+ zpull(&strm, in);
+ }
+
+ /* decompress -- return early when end-of-block reached */
+ strm.avail_out = CHUNK;
+ strm.next_out = junk;
+ ret = inflate(&strm, Z_BLOCK);
+ switch (ret) {
+ case Z_MEM_ERROR:
+ bail("out of memory", "");
+ case Z_DATA_ERROR:
+ bail("invalid compressed data in ", in->name);
+ }
+
+ /* update length of uncompressed data */
+ len += CHUNK - strm.avail_out;
+
+ /* check for block boundary (only get this when block copied out) */
+ if (strm.data_type & 128) {
+ /* if that was the last block, then done */
+ if (last)
+ break;
+
+ /* number of unused bits in last byte */
+ pos = strm.data_type & 7;
+
+ /* find the next last-block bit */
+ if (pos != 0) {
+ /* next last-block bit is in last used byte */
+ pos = 0x100 >> pos;
+ last = strm.next_in[-1] & pos;
+ if (last && clr)
+ in->buf[strm.next_in - in->buf - 1] &= ~pos;
+ }
+ else {
+ /* next last-block bit is in next unused byte */
+ if (strm.avail_in == 0) {
+ /* don't have that byte yet -- get it */
+ fwrite(start, 1, strm.next_in - start, out);
+ start = in->buf;
+ in->left = 0;
+ zpull(&strm, in);
+ }
+ last = strm.next_in[0] & 1;
+ if (last && clr)
+ in->buf[strm.next_in - in->buf] &= ~1;
+ }
+ }
+ }
+
+ /* update buffer with unused input */
+ in->left = strm.avail_in;
+ in->next = in->buf + (strm.next_in - in->buf);
+
+ /* copy used input, write empty blocks to get to byte boundary */
+ pos = strm.data_type & 7;
+ fwrite(start, 1, in->next - start - 1, out);
+ last = in->next[-1];
+ if (pos == 0 || !clr)
+ /* already at byte boundary, or last file: write last byte */
+ putc(last, out);
+ else {
+ /* append empty blocks to last byte */
+ last &= ((0x100 >> pos) - 1); /* assure unused bits are zero */
+ if (pos & 1) {
+ /* odd -- append an empty stored block */
+ putc(last, out);
+ if (pos == 1)
+ putc(0, out); /* two more bits in block header */
+ fwrite("\0\0\xff\xff", 1, 4, out);
+ }
+ else {
+ /* even -- append 1, 2, or 3 empty fixed blocks */
+ switch (pos) {
+ case 6:
+ putc(last | 8, out);
+ last = 0;
+ case 4:
+ putc(last | 0x20, out);
+ last = 0;
+ case 2:
+ putc(last | 0x80, out);
+ putc(0, out);
+ }
+ }
+ }
+
+ /* update crc and tot */
+ *crc = crc32_combine(*crc, bget4(in), len);
+ *tot += (unsigned long)len;
+
+ /* clean up */
+ inflateEnd(&strm);
+ free(junk);
+ bclose(in);
+
+ /* write trailer if this is the last gzip file */
+ if (!clr) {
+ put4(*crc, out);
+ put4(*tot, out);
+ }
+}
+
+/* join the gzip files on the command line, write result to stdout */
+int main(int argc, char **argv)
+{
+ unsigned long crc, tot; /* running crc and total uncompressed length */
+
+ /* skip command name */
+ argc--;
+ argv++;
+
+ /* show usage if no arguments */
+ if (argc == 0) {
+ fputs("gzjoin usage: gzjoin f1.gz [f2.gz [f3.gz ...]] > fjoin.gz\n",
+ stderr);
+ return 0;
+ }
+
+ /* join gzip files on command line and write to stdout */
+ gzinit(&crc, &tot, stdout);
+ while (argc--)
+ gzcopy(*argv++, argc, &crc, &tot, stdout);
+
+ /* done */
+ return 0;
+}
diff --git a/protocols/Telegram/tgl/zlib/examples/gzlog.c b/protocols/Telegram/tgl/zlib/examples/gzlog.c
new file mode 100644
index 0000000000..922f878dde
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/examples/gzlog.c
@@ -0,0 +1,1059 @@
+/*
+ * gzlog.c
+ * Copyright (C) 2004, 2008, 2012 Mark Adler, all rights reserved
+ * For conditions of distribution and use, see copyright notice in gzlog.h
+ * version 2.2, 14 Aug 2012
+ */
+
+/*
+ gzlog provides a mechanism for frequently appending short strings to a gzip
+ file that is efficient both in execution time and compression ratio. The
+ strategy is to write the short strings in an uncompressed form to the end of
+ the gzip file, only compressing when the amount of uncompressed data has
+ reached a given threshold.
+
+ gzlog also provides protection against interruptions in the process due to
+ system crashes. The status of the operation is recorded in an extra field
+ in the gzip file, and is only updated once the gzip file is brought to a
+ valid state. The last data to be appended or compressed is saved in an
+ auxiliary file, so that if the operation is interrupted, it can be completed
+ the next time an append operation is attempted.
+
+ gzlog maintains another auxiliary file with the last 32K of data from the
+ compressed portion, which is preloaded for the compression of the subsequent
+ data. This minimizes the impact to the compression ratio of appending.
+ */
+
+/*
+ Operations Concept:
+
+ Files (log name "foo"):
+ foo.gz -- gzip file with the complete log
+ foo.add -- last message to append or last data to compress
+ foo.dict -- dictionary of the last 32K of data for next compression
+ foo.temp -- temporary dictionary file for compression after this one
+ foo.lock -- lock file for reading and writing the other files
+ foo.repairs -- log file for log file recovery operations (not compressed)
+
+ gzip file structure:
+ - fixed-length (no file name) header with extra field (see below)
+ - compressed data ending initially with empty stored block
+ - uncompressed data filling out originally empty stored block and
+ subsequent stored blocks as needed (16K max each)
+ - gzip trailer
+ - no junk at end (no other gzip streams)
+
+ When appending data, the information in the first three items above plus the
+ foo.add file are sufficient to recover an interrupted append operation. The
+ extra field has the necessary information to restore the start of the last
+ stored block and determine where to append the data in the foo.add file, as
+ well as the crc and length of the gzip data before the append operation.
+
+ The foo.add file is created before the gzip file is marked for append, and
+ deleted after the gzip file is marked as complete. So if the append
+ operation is interrupted, the data to add will still be there. If due to
+ some external force, the foo.add file gets deleted between when the append
+ operation was interrupted and when recovery is attempted, the gzip file will
+ still be restored, but without the appended data.
+
+ When compressing data, the information in the first two items above plus the
+ foo.add file are sufficient to recover an interrupted compress operation.
+ The extra field has the necessary information to find the end of the
+ compressed data, and contains both the crc and length of just the compressed
+ data and of the complete set of data including the contents of the foo.add
+ file.
+
+ Again, the foo.add file is maintained during the compress operation in case
+ of an interruption. If in the unlikely event the foo.add file with the data
+ to be compressed is missing due to some external force, a gzip file with
+ just the previous compressed data will be reconstructed. In this case, all
+ of the data that was to be compressed is lost (approximately one megabyte).
+ This will not occur if all that happened was an interruption of the compress
+ operation.
+
+ The third state that is marked is the replacement of the old dictionary with
+ the new dictionary after a compress operation. Once compression is
+ complete, the gzip file is marked as being in the replace state. This
+ completes the gzip file, so an interrupt after being so marked does not
+ result in recompression. Then the dictionary file is replaced, and the gzip
+ file is marked as completed. This state prevents the possibility of
+ restarting compression with the wrong dictionary file.
+
+ All three operations are wrapped by a lock/unlock procedure. In order to
+ gain exclusive access to the log files, first a foo.lock file must be
+ exclusively created. When all operations are complete, the lock is
+ released by deleting the foo.lock file. If when attempting to create the
+ lock file, it already exists and the modify time of the lock file is more
+ than five minutes old (set by the PATIENCE define below), then the old
+ lock file is considered stale and deleted, and the exclusive creation of
+ the lock file is retried. To assure that there are no false assessments
+ of the staleness of the lock file, the operations periodically touch the
+ lock file to update the modified date.
+
+ Following is the definition of the extra field with all of the information
+ required to enable the above append and compress operations and their
+ recovery if interrupted. Multi-byte values are stored little endian
+ (consistent with the gzip format). File pointers are eight bytes long.
+ The crc's and lengths for the gzip trailer are four bytes long. (Note that
+ the length at the end of a gzip file is used for error checking only, and
+ for large files is actually the length modulo 2^32.) The stored block
+ length is two bytes long. The gzip extra field two-byte identification is
+ "ap" for append. It is assumed that writing the extra field to the file is
+ an "atomic" operation. That is, either all of the extra field is written
+ to the file, or none of it is, if the operation is interrupted right at the
+ point of updating the extra field. This is a reasonable assumption, since
+ the extra field is within the first 52 bytes of the file, which is smaller
+ than any expected block size for a mass storage device (usually 512 bytes or
+ larger).
+
+ Extra field (35 bytes):
+ - Pointer to first stored block length -- this points to the two-byte length
+ of the first stored block, which is followed by the two-byte, one's
+ complement of that length. The stored block length is preceded by the
+ three-bit header of the stored block, which is the actual start of the
+ stored block in the deflate format. See the bit offset field below.
+ - Pointer to the last stored block length. This is the same as above, but
+ for the last stored block of the uncompressed data in the gzip file.
+ Initially this is the same as the first stored block length pointer.
+ When the stored block gets to 16K (see the MAX_STORE define), then a new
+ stored block as added, at which point the last stored block length pointer
+ is different from the first stored block length pointer. When they are
+ different, the first bit of the last stored block header is eight bits, or
+ one byte back from the block length.
+ - Compressed data crc and length. This is the crc and length of the data
+ that is in the compressed portion of the deflate stream. These are used
+ only in the event that the foo.add file containing the data to compress is
+ lost after a compress operation is interrupted.
+ - Total data crc and length. This is the crc and length of all of the data
+ stored in the gzip file, compressed and uncompressed. It is used to
+ reconstruct the gzip trailer when compressing, as well as when recovering
+ interrupted operations.
+ - Final stored block length. This is used to quickly find where to append,
+ and allows the restoration of the original final stored block state when
+ an append operation is interrupted.
+ - First stored block start as the number of bits back from the final stored
+ block first length byte. This value is in the range of 3..10, and is
+ stored as the low three bits of the final byte of the extra field after
+ subtracting three (0..7). This allows the last-block bit of the stored
+ block header to be updated when a new stored block is added, for the case
+ when the first stored block and the last stored block are the same. (When
+ they are different, the numbers of bits back is known to be eight.) This
+ also allows for new compressed data to be appended to the old compressed
+ data in the compress operation, overwriting the previous first stored
+ block, or for the compressed data to be terminated and a valid gzip file
+ reconstructed on the off chance that a compression operation was
+ interrupted and the data to compress in the foo.add file was deleted.
+ - The operation in process. This is the next two bits in the last byte (the
+ bits under the mask 0x18). The are interpreted as 0: nothing in process,
+ 1: append in process, 2: compress in process, 3: replace in process.
+ - The top three bits of the last byte in the extra field are reserved and
+ are currently set to zero.
+
+ Main procedure:
+ - Exclusively create the foo.lock file using the O_CREAT and O_EXCL modes of
+ the system open() call. If the modify time of an existing lock file is
+ more than PATIENCE seconds old, then the lock file is deleted and the
+ exclusive create is retried.
+ - Load the extra field from the foo.gz file, and see if an operation was in
+ progress but not completed. If so, apply the recovery procedure below.
+ - Perform the append procedure with the provided data.
+ - If the uncompressed data in the foo.gz file is 1MB or more, apply the
+ compress procedure.
+ - Delete the foo.lock file.
+
+ Append procedure:
+ - Put what to append in the foo.add file so that the operation can be
+ restarted if this procedure is interrupted.
+ - Mark the foo.gz extra field with the append operation in progress.
+ + Restore the original last-block bit and stored block length of the last
+ stored block from the information in the extra field, in case a previous
+ append operation was interrupted.
+ - Append the provided data to the last stored block, creating new stored
+ blocks as needed and updating the stored blocks last-block bits and
+ lengths.
+ - Update the crc and length with the new data, and write the gzip trailer.
+ - Write over the extra field (with a single write operation) with the new
+ pointers, lengths, and crc's, and mark the gzip file as not in process.
+ Though there is still a foo.add file, it will be ignored since nothing
+ is in process. If a foo.add file is leftover from a previously
+ completed operation, it is truncated when writing new data to it.
+ - Delete the foo.add file.
+
+ Compress and replace procedures:
+ - Read all of the uncompressed data in the stored blocks in foo.gz and write
+ it to foo.add. Also write foo.temp with the last 32K of that data to
+ provide a dictionary for the next invocation of this procedure.
+ - Rewrite the extra field marking foo.gz with a compression in process.
+ * If there is no data provided to compress (due to a missing foo.add file
+ when recovering), reconstruct and truncate the foo.gz file to contain
+ only the previous compressed data and proceed to the step after the next
+ one. Otherwise ...
+ - Compress the data with the dictionary in foo.dict, and write to the
+ foo.gz file starting at the bit immediately following the last previously
+ compressed block. If there is no foo.dict, proceed anyway with the
+ compression at slightly reduced efficiency. (For the foo.dict file to be
+ missing requires some external failure beyond simply the interruption of
+ a compress operation.) During this process, the foo.lock file is
+ periodically touched to assure that that file is not considered stale by
+ another process before we're done. The deflation is terminated with a
+ non-last empty static block (10 bits long), that is then located and
+ written over by a last-bit-set empty stored block.
+ - Append the crc and length of the data in the gzip file (previously
+ calculated during the append operations).
+ - Write over the extra field with the updated stored block offsets, bits
+ back, crc's, and lengths, and mark foo.gz as in process for a replacement
+ of the dictionary.
+ @ Delete the foo.add file.
+ - Replace foo.dict with foo.temp.
+ - Write over the extra field, marking foo.gz as complete.
+
+ Recovery procedure:
+ - If not a replace recovery, read in the foo.add file, and provide that data
+ to the appropriate recovery below. If there is no foo.add file, provide
+ a zero data length to the recovery. In that case, the append recovery
+ restores the foo.gz to the previous compressed + uncompressed data state.
+ For the the compress recovery, a missing foo.add file results in foo.gz
+ being restored to the previous compressed-only data state.
+ - Append recovery:
+ - Pick up append at + step above
+ - Compress recovery:
+ - Pick up compress at * step above
+ - Replace recovery:
+ - Pick up compress at @ step above
+ - Log the repair with a date stamp in foo.repairs
+ */
+
+#include <sys/types.h>
+#include <stdio.h> /* rename, fopen, fprintf, fclose */
+#include <stdlib.h> /* malloc, free */
+#include <string.h> /* strlen, strrchr, strcpy, strncpy, strcmp */
+#include <fcntl.h> /* open */
+#include <unistd.h> /* lseek, read, write, close, unlink, sleep, */
+ /* ftruncate, fsync */
+#include <errno.h> /* errno */
+#include <time.h> /* time, ctime */
+#include <sys/stat.h> /* stat */
+#include <sys/time.h> /* utimes */
+#include "zlib.h" /* crc32 */
+
+#include "gzlog.h" /* header for external access */
+
+#define local static
+typedef unsigned int uint;
+typedef unsigned long ulong;
+
+/* Macro for debugging to deterministically force recovery operations */
+#ifdef DEBUG
+ #include <setjmp.h> /* longjmp */
+ jmp_buf gzlog_jump; /* where to go back to */
+ int gzlog_bail = 0; /* which point to bail at (1..8) */
+ int gzlog_count = -1; /* number of times through to wait */
+# define BAIL(n) do { if (n == gzlog_bail && gzlog_count-- == 0) \
+ longjmp(gzlog_jump, gzlog_bail); } while (0)
+#else
+# define BAIL(n)
+#endif
+
+/* how old the lock file can be in seconds before considering it stale */
+#define PATIENCE 300
+
+/* maximum stored block size in Kbytes -- must be in 1..63 */
+#define MAX_STORE 16
+
+/* number of stored Kbytes to trigger compression (must be >= 32 to allow
+ dictionary construction, and <= 204 * MAX_STORE, in order for >> 10 to
+ discard the stored block headers contribution of five bytes each) */
+#define TRIGGER 1024
+
+/* size of a deflate dictionary (this cannot be changed) */
+#define DICT 32768U
+
+/* values for the operation (2 bits) */
+#define NO_OP 0
+#define APPEND_OP 1
+#define COMPRESS_OP 2
+#define REPLACE_OP 3
+
+/* macros to extract little-endian integers from an unsigned byte buffer */
+#define PULL2(p) ((p)[0]+((uint)((p)[1])<<8))
+#define PULL4(p) (PULL2(p)+((ulong)PULL2(p+2)<<16))
+#define PULL8(p) (PULL4(p)+((off_t)PULL4(p+4)<<32))
+
+/* macros to store integers into a byte buffer in little-endian order */
+#define PUT2(p,a) do {(p)[0]=a;(p)[1]=(a)>>8;} while(0)
+#define PUT4(p,a) do {PUT2(p,a);PUT2(p+2,a>>16);} while(0)
+#define PUT8(p,a) do {PUT4(p,a);PUT4(p+4,a>>32);} while(0)
+
+/* internal structure for log information */
+#define LOGID "\106\035\172" /* should be three non-zero characters */
+struct log {
+ char id[4]; /* contains LOGID to detect inadvertent overwrites */
+ int fd; /* file descriptor for .gz file, opened read/write */
+ char *path; /* allocated path, e.g. "/var/log/foo" or "foo" */
+ char *end; /* end of path, for appending suffices such as ".gz" */
+ off_t first; /* offset of first stored block first length byte */
+ int back; /* location of first block id in bits back from first */
+ uint stored; /* bytes currently in last stored block */
+ off_t last; /* offset of last stored block first length byte */
+ ulong ccrc; /* crc of compressed data */
+ ulong clen; /* length (modulo 2^32) of compressed data */
+ ulong tcrc; /* crc of total data */
+ ulong tlen; /* length (modulo 2^32) of total data */
+ time_t lock; /* last modify time of our lock file */
+};
+
+/* gzip header for gzlog */
+local unsigned char log_gzhead[] = {
+ 0x1f, 0x8b, /* magic gzip id */
+ 8, /* compression method is deflate */
+ 4, /* there is an extra field (no file name) */
+ 0, 0, 0, 0, /* no modification time provided */
+ 0, 0xff, /* no extra flags, no OS specified */
+ 39, 0, 'a', 'p', 35, 0 /* extra field with "ap" subfield */
+ /* 35 is EXTRA, 39 is EXTRA + 4 */
+};
+
+#define HEAD sizeof(log_gzhead) /* should be 16 */
+
+/* initial gzip extra field content (52 == HEAD + EXTRA + 1) */
+local unsigned char log_gzext[] = {
+ 52, 0, 0, 0, 0, 0, 0, 0, /* offset of first stored block length */
+ 52, 0, 0, 0, 0, 0, 0, 0, /* offset of last stored block length */
+ 0, 0, 0, 0, 0, 0, 0, 0, /* compressed data crc and length */
+ 0, 0, 0, 0, 0, 0, 0, 0, /* total data crc and length */
+ 0, 0, /* final stored block data length */
+ 5 /* op is NO_OP, last bit 8 bits back */
+};
+
+#define EXTRA sizeof(log_gzext) /* should be 35 */
+
+/* initial gzip data and trailer */
+local unsigned char log_gzbody[] = {
+ 1, 0, 0, 0xff, 0xff, /* empty stored block (last) */
+ 0, 0, 0, 0, /* crc */
+ 0, 0, 0, 0 /* uncompressed length */
+};
+
+#define BODY sizeof(log_gzbody)
+
+/* Exclusively create foo.lock in order to negotiate exclusive access to the
+ foo.* files. If the modify time of an existing lock file is greater than
+ PATIENCE seconds in the past, then consider the lock file to have been
+ abandoned, delete it, and try the exclusive create again. Save the lock
+ file modify time for verification of ownership. Return 0 on success, or -1
+ on failure, usually due to an access restriction or invalid path. Note that
+ if stat() or unlink() fails, it may be due to another process noticing the
+ abandoned lock file a smidge sooner and deleting it, so those are not
+ flagged as an error. */
+local int log_lock(struct log *log)
+{
+ int fd;
+ struct stat st;
+
+ strcpy(log->end, ".lock");
+ while ((fd = open(log->path, O_CREAT | O_EXCL, 0644)) < 0) {
+ if (errno != EEXIST)
+ return -1;
+ if (stat(log->path, &st) == 0 && time(NULL) - st.st_mtime > PATIENCE) {
+ unlink(log->path);
+ continue;
+ }
+ sleep(2); /* relinquish the CPU for two seconds while waiting */
+ }
+ close(fd);
+ if (stat(log->path, &st) == 0)
+ log->lock = st.st_mtime;
+ return 0;
+}
+
+/* Update the modify time of the lock file to now, in order to prevent another
+ task from thinking that the lock is stale. Save the lock file modify time
+ for verification of ownership. */
+local void log_touch(struct log *log)
+{
+ struct stat st;
+
+ strcpy(log->end, ".lock");
+ utimes(log->path, NULL);
+ if (stat(log->path, &st) == 0)
+ log->lock = st.st_mtime;
+}
+
+/* Check the log file modify time against what is expected. Return true if
+ this is not our lock. If it is our lock, touch it to keep it. */
+local int log_check(struct log *log)
+{
+ struct stat st;
+
+ strcpy(log->end, ".lock");
+ if (stat(log->path, &st) || st.st_mtime != log->lock)
+ return 1;
+ log_touch(log);
+ return 0;
+}
+
+/* Unlock a previously acquired lock, but only if it's ours. */
+local void log_unlock(struct log *log)
+{
+ if (log_check(log))
+ return;
+ strcpy(log->end, ".lock");
+ unlink(log->path);
+ log->lock = 0;
+}
+
+/* Check the gzip header and read in the extra field, filling in the values in
+ the log structure. Return op on success or -1 if the gzip header was not as
+ expected. op is the current operation in progress last written to the extra
+ field. This assumes that the gzip file has already been opened, with the
+ file descriptor log->fd. */
+local int log_head(struct log *log)
+{
+ int op;
+ unsigned char buf[HEAD + EXTRA];
+
+ if (lseek(log->fd, 0, SEEK_SET) < 0 ||
+ read(log->fd, buf, HEAD + EXTRA) != HEAD + EXTRA ||
+ memcmp(buf, log_gzhead, HEAD)) {
+ return -1;
+ }
+ log->first = PULL8(buf + HEAD);
+ log->last = PULL8(buf + HEAD + 8);
+ log->ccrc = PULL4(buf + HEAD + 16);
+ log->clen = PULL4(buf + HEAD + 20);
+ log->tcrc = PULL4(buf + HEAD + 24);
+ log->tlen = PULL4(buf + HEAD + 28);
+ log->stored = PULL2(buf + HEAD + 32);
+ log->back = 3 + (buf[HEAD + 34] & 7);
+ op = (buf[HEAD + 34] >> 3) & 3;
+ return op;
+}
+
+/* Write over the extra field contents, marking the operation as op. Use fsync
+ to assure that the device is written to, and in the requested order. This
+ operation, and only this operation, is assumed to be atomic in order to
+ assure that the log is recoverable in the event of an interruption at any
+ point in the process. Return -1 if the write to foo.gz failed. */
+local int log_mark(struct log *log, int op)
+{
+ int ret;
+ unsigned char ext[EXTRA];
+
+ PUT8(ext, log->first);
+ PUT8(ext + 8, log->last);
+ PUT4(ext + 16, log->ccrc);
+ PUT4(ext + 20, log->clen);
+ PUT4(ext + 24, log->tcrc);
+ PUT4(ext + 28, log->tlen);
+ PUT2(ext + 32, log->stored);
+ ext[34] = log->back - 3 + (op << 3);
+ fsync(log->fd);
+ ret = lseek(log->fd, HEAD, SEEK_SET) < 0 ||
+ write(log->fd, ext, EXTRA) != EXTRA ? -1 : 0;
+ fsync(log->fd);
+ return ret;
+}
+
+/* Rewrite the last block header bits and subsequent zero bits to get to a byte
+ boundary, setting the last block bit if last is true, and then write the
+ remainder of the stored block header (length and one's complement). Leave
+ the file pointer after the end of the last stored block data. Return -1 if
+ there is a read or write failure on the foo.gz file */
+local int log_last(struct log *log, int last)
+{
+ int back, len, mask;
+ unsigned char buf[6];
+
+ /* determine the locations of the bytes and bits to modify */
+ back = log->last == log->first ? log->back : 8;
+ len = back > 8 ? 2 : 1; /* bytes back from log->last */
+ mask = 0x80 >> ((back - 1) & 7); /* mask for block last-bit */
+
+ /* get the byte to modify (one or two back) into buf[0] -- don't need to
+ read the byte if the last-bit is eight bits back, since in that case
+ the entire byte will be modified */
+ buf[0] = 0;
+ if (back != 8 && (lseek(log->fd, log->last - len, SEEK_SET) < 0 ||
+ read(log->fd, buf, 1) != 1))
+ return -1;
+
+ /* change the last-bit of the last stored block as requested -- note
+ that all bits above the last-bit are set to zero, per the type bits
+ of a stored block being 00 and per the convention that the bits to
+ bring the stream to a byte boundary are also zeros */
+ buf[1] = 0;
+ buf[2 - len] = (*buf & (mask - 1)) + (last ? mask : 0);
+
+ /* write the modified stored block header and lengths, move the file
+ pointer to after the last stored block data */
+ PUT2(buf + 2, log->stored);
+ PUT2(buf + 4, log->stored ^ 0xffff);
+ return lseek(log->fd, log->last - len, SEEK_SET) < 0 ||
+ write(log->fd, buf + 2 - len, len + 4) != len + 4 ||
+ lseek(log->fd, log->stored, SEEK_CUR) < 0 ? -1 : 0;
+}
+
+/* Append len bytes from data to the locked and open log file. len may be zero
+ if recovering and no .add file was found. In that case, the previous state
+ of the foo.gz file is restored. The data is appended uncompressed in
+ deflate stored blocks. Return -1 if there was an error reading or writing
+ the foo.gz file. */
+local int log_append(struct log *log, unsigned char *data, size_t len)
+{
+ uint put;
+ off_t end;
+ unsigned char buf[8];
+
+ /* set the last block last-bit and length, in case recovering an
+ interrupted append, then position the file pointer to append to the
+ block */
+ if (log_last(log, 1))
+ return -1;
+
+ /* append, adding stored blocks and updating the offset of the last stored
+ block as needed, and update the total crc and length */
+ while (len) {
+ /* append as much as we can to the last block */
+ put = (MAX_STORE << 10) - log->stored;
+ if (put > len)
+ put = (uint)len;
+ if (put) {
+ if (write(log->fd, data, put) != put)
+ return -1;
+ BAIL(1);
+ log->tcrc = crc32(log->tcrc, data, put);
+ log->tlen += put;
+ log->stored += put;
+ data += put;
+ len -= put;
+ }
+
+ /* if we need to, add a new empty stored block */
+ if (len) {
+ /* mark current block as not last */
+ if (log_last(log, 0))
+ return -1;
+
+ /* point to new, empty stored block */
+ log->last += 4 + log->stored + 1;
+ log->stored = 0;
+ }
+
+ /* mark last block as last, update its length */
+ if (log_last(log, 1))
+ return -1;
+ BAIL(2);
+ }
+
+ /* write the new crc and length trailer, and truncate just in case (could
+ be recovering from partial append with a missing foo.add file) */
+ PUT4(buf, log->tcrc);
+ PUT4(buf + 4, log->tlen);
+ if (write(log->fd, buf, 8) != 8 ||
+ (end = lseek(log->fd, 0, SEEK_CUR)) < 0 || ftruncate(log->fd, end))
+ return -1;
+
+ /* write the extra field, marking the log file as done, delete .add file */
+ if (log_mark(log, NO_OP))
+ return -1;
+ strcpy(log->end, ".add");
+ unlink(log->path); /* ignore error, since may not exist */
+ return 0;
+}
+
+/* Replace the foo.dict file with the foo.temp file. Also delete the foo.add
+ file, since the compress operation may have been interrupted before that was
+ done. Returns 1 if memory could not be allocated, or -1 if reading or
+ writing foo.gz fails, or if the rename fails for some reason other than
+ foo.temp not existing. foo.temp not existing is a permitted error, since
+ the replace operation may have been interrupted after the rename is done,
+ but before foo.gz is marked as complete. */
+local int log_replace(struct log *log)
+{
+ int ret;
+ char *dest;
+
+ /* delete foo.add file */
+ strcpy(log->end, ".add");
+ unlink(log->path); /* ignore error, since may not exist */
+ BAIL(3);
+
+ /* rename foo.name to foo.dict, replacing foo.dict if it exists */
+ strcpy(log->end, ".dict");
+ dest = malloc(strlen(log->path) + 1);
+ if (dest == NULL)
+ return -2;
+ strcpy(dest, log->path);
+ strcpy(log->end, ".temp");
+ ret = rename(log->path, dest);
+ free(dest);
+ if (ret && errno != ENOENT)
+ return -1;
+ BAIL(4);
+
+ /* mark the foo.gz file as done */
+ return log_mark(log, NO_OP);
+}
+
+/* Compress the len bytes at data and append the compressed data to the
+ foo.gz deflate data immediately after the previous compressed data. This
+ overwrites the previous uncompressed data, which was stored in foo.add
+ and is the data provided in data[0..len-1]. If this operation is
+ interrupted, it picks up at the start of this routine, with the foo.add
+ file read in again. If there is no data to compress (len == 0), then we
+ simply terminate the foo.gz file after the previously compressed data,
+ appending a final empty stored block and the gzip trailer. Return -1 if
+ reading or writing the log.gz file failed, or -2 if there was a memory
+ allocation failure. */
+local int log_compress(struct log *log, unsigned char *data, size_t len)
+{
+ int fd;
+ uint got, max;
+ ssize_t dict;
+ off_t end;
+ z_stream strm;
+ unsigned char buf[DICT];
+
+ /* compress and append compressed data */
+ if (len) {
+ /* set up for deflate, allocating memory */
+ strm.zalloc = Z_NULL;
+ strm.zfree = Z_NULL;
+ strm.opaque = Z_NULL;
+ if (deflateInit2(&strm, Z_DEFAULT_COMPRESSION, Z_DEFLATED, -15, 8,
+ Z_DEFAULT_STRATEGY) != Z_OK)
+ return -2;
+
+ /* read in dictionary (last 32K of data that was compressed) */
+ strcpy(log->end, ".dict");
+ fd = open(log->path, O_RDONLY, 0);
+ if (fd >= 0) {
+ dict = read(fd, buf, DICT);
+ close(fd);
+ if (dict < 0) {
+ deflateEnd(&strm);
+ return -1;
+ }
+ if (dict)
+ deflateSetDictionary(&strm, buf, (uint)dict);
+ }
+ log_touch(log);
+
+ /* prime deflate with last bits of previous block, position write
+ pointer to write those bits and overwrite what follows */
+ if (lseek(log->fd, log->first - (log->back > 8 ? 2 : 1),
+ SEEK_SET) < 0 ||
+ read(log->fd, buf, 1) != 1 || lseek(log->fd, -1, SEEK_CUR) < 0) {
+ deflateEnd(&strm);
+ return -1;
+ }
+ deflatePrime(&strm, (8 - log->back) & 7, *buf);
+
+ /* compress, finishing with a partial non-last empty static block */
+ strm.next_in = data;
+ max = (((uint)0 - 1) >> 1) + 1; /* in case int smaller than size_t */
+ do {
+ strm.avail_in = len > max ? max : (uint)len;
+ len -= strm.avail_in;
+ do {
+ strm.avail_out = DICT;
+ strm.next_out = buf;
+ deflate(&strm, len ? Z_NO_FLUSH : Z_PARTIAL_FLUSH);
+ got = DICT - strm.avail_out;
+ if (got && write(log->fd, buf, got) != got) {
+ deflateEnd(&strm);
+ return -1;
+ }
+ log_touch(log);
+ } while (strm.avail_out == 0);
+ } while (len);
+ deflateEnd(&strm);
+ BAIL(5);
+
+ /* find start of empty static block -- scanning backwards the first one
+ bit is the second bit of the block, if the last byte is zero, then
+ we know the byte before that has a one in the top bit, since an
+ empty static block is ten bits long */
+ if ((log->first = lseek(log->fd, -1, SEEK_CUR)) < 0 ||
+ read(log->fd, buf, 1) != 1)
+ return -1;
+ log->first++;
+ if (*buf) {
+ log->back = 1;
+ while ((*buf & ((uint)1 << (8 - log->back++))) == 0)
+ ; /* guaranteed to terminate, since *buf != 0 */
+ }
+ else
+ log->back = 10;
+
+ /* update compressed crc and length */
+ log->ccrc = log->tcrc;
+ log->clen = log->tlen;
+ }
+ else {
+ /* no data to compress -- fix up existing gzip stream */
+ log->tcrc = log->ccrc;
+ log->tlen = log->clen;
+ }
+
+ /* complete and truncate gzip stream */
+ log->last = log->first;
+ log->stored = 0;
+ PUT4(buf, log->tcrc);
+ PUT4(buf + 4, log->tlen);
+ if (log_last(log, 1) || write(log->fd, buf, 8) != 8 ||
+ (end = lseek(log->fd, 0, SEEK_CUR)) < 0 || ftruncate(log->fd, end))
+ return -1;
+ BAIL(6);
+
+ /* mark as being in the replace operation */
+ if (log_mark(log, REPLACE_OP))
+ return -1;
+
+ /* execute the replace operation and mark the file as done */
+ return log_replace(log);
+}
+
+/* log a repair record to the .repairs file */
+local void log_log(struct log *log, int op, char *record)
+{
+ time_t now;
+ FILE *rec;
+
+ now = time(NULL);
+ strcpy(log->end, ".repairs");
+ rec = fopen(log->path, "a");
+ if (rec == NULL)
+ return;
+ fprintf(rec, "%.24s %s recovery: %s\n", ctime(&now), op == APPEND_OP ?
+ "append" : (op == COMPRESS_OP ? "compress" : "replace"), record);
+ fclose(rec);
+ return;
+}
+
+/* Recover the interrupted operation op. First read foo.add for recovering an
+ append or compress operation. Return -1 if there was an error reading or
+ writing foo.gz or reading an existing foo.add, or -2 if there was a memory
+ allocation failure. */
+local int log_recover(struct log *log, int op)
+{
+ int fd, ret = 0;
+ unsigned char *data = NULL;
+ size_t len = 0;
+ struct stat st;
+
+ /* log recovery */
+ log_log(log, op, "start");
+
+ /* load foo.add file if expected and present */
+ if (op == APPEND_OP || op == COMPRESS_OP) {
+ strcpy(log->end, ".add");
+ if (stat(log->path, &st) == 0 && st.st_size) {
+ len = (size_t)(st.st_size);
+ if ((off_t)len != st.st_size ||
+ (data = malloc(st.st_size)) == NULL) {
+ log_log(log, op, "allocation failure");
+ return -2;
+ }
+ if ((fd = open(log->path, O_RDONLY, 0)) < 0) {
+ log_log(log, op, ".add file read failure");
+ return -1;
+ }
+ ret = (size_t)read(fd, data, len) != len;
+ close(fd);
+ if (ret) {
+ log_log(log, op, ".add file read failure");
+ return -1;
+ }
+ log_log(log, op, "loaded .add file");
+ }
+ else
+ log_log(log, op, "missing .add file!");
+ }
+
+ /* recover the interrupted operation */
+ switch (op) {
+ case APPEND_OP:
+ ret = log_append(log, data, len);
+ break;
+ case COMPRESS_OP:
+ ret = log_compress(log, data, len);
+ break;
+ case REPLACE_OP:
+ ret = log_replace(log);
+ }
+
+ /* log status */
+ log_log(log, op, ret ? "failure" : "complete");
+
+ /* clean up */
+ if (data != NULL)
+ free(data);
+ return ret;
+}
+
+/* Close the foo.gz file (if open) and release the lock. */
+local void log_close(struct log *log)
+{
+ if (log->fd >= 0)
+ close(log->fd);
+ log->fd = -1;
+ log_unlock(log);
+}
+
+/* Open foo.gz, verify the header, and load the extra field contents, after
+ first creating the foo.lock file to gain exclusive access to the foo.*
+ files. If foo.gz does not exist or is empty, then write the initial header,
+ extra, and body content of an empty foo.gz log file. If there is an error
+ creating the lock file due to access restrictions, or an error reading or
+ writing the foo.gz file, or if the foo.gz file is not a proper log file for
+ this object (e.g. not a gzip file or does not contain the expected extra
+ field), then return true. If there is an error, the lock is released.
+ Otherwise, the lock is left in place. */
+local int log_open(struct log *log)
+{
+ int op;
+
+ /* release open file resource if left over -- can occur if lock lost
+ between gzlog_open() and gzlog_write() */
+ if (log->fd >= 0)
+ close(log->fd);
+ log->fd = -1;
+
+ /* negotiate exclusive access */
+ if (log_lock(log) < 0)
+ return -1;
+
+ /* open the log file, foo.gz */
+ strcpy(log->end, ".gz");
+ log->fd = open(log->path, O_RDWR | O_CREAT, 0644);
+ if (log->fd < 0) {
+ log_close(log);
+ return -1;
+ }
+
+ /* if new, initialize foo.gz with an empty log, delete old dictionary */
+ if (lseek(log->fd, 0, SEEK_END) == 0) {
+ if (write(log->fd, log_gzhead, HEAD) != HEAD ||
+ write(log->fd, log_gzext, EXTRA) != EXTRA ||
+ write(log->fd, log_gzbody, BODY) != BODY) {
+ log_close(log);
+ return -1;
+ }
+ strcpy(log->end, ".dict");
+ unlink(log->path);
+ }
+
+ /* verify log file and load extra field information */
+ if ((op = log_head(log)) < 0) {
+ log_close(log);
+ return -1;
+ }
+
+ /* check for interrupted process and if so, recover */
+ if (op != NO_OP && log_recover(log, op)) {
+ log_close(log);
+ return -1;
+ }
+
+ /* touch the lock file to prevent another process from grabbing it */
+ log_touch(log);
+ return 0;
+}
+
+/* See gzlog.h for the description of the external methods below */
+gzlog *gzlog_open(char *path)
+{
+ size_t n;
+ struct log *log;
+
+ /* check arguments */
+ if (path == NULL || *path == 0)
+ return NULL;
+
+ /* allocate and initialize log structure */
+ log = malloc(sizeof(struct log));
+ if (log == NULL)
+ return NULL;
+ strcpy(log->id, LOGID);
+ log->fd = -1;
+
+ /* save path and end of path for name construction */
+ n = strlen(path);
+ log->path = malloc(n + 9); /* allow for ".repairs" */
+ if (log->path == NULL) {
+ free(log);
+ return NULL;
+ }
+ strcpy(log->path, path);
+ log->end = log->path + n;
+
+ /* gain exclusive access and verify log file -- may perform a
+ recovery operation if needed */
+ if (log_open(log)) {
+ free(log->path);
+ free(log);
+ return NULL;
+ }
+
+ /* return pointer to log structure */
+ return log;
+}
+
+/* gzlog_compress() return values:
+ 0: all good
+ -1: file i/o error (usually access issue)
+ -2: memory allocation failure
+ -3: invalid log pointer argument */
+int gzlog_compress(gzlog *logd)
+{
+ int fd, ret;
+ uint block;
+ size_t len, next;
+ unsigned char *data, buf[5];
+ struct log *log = logd;
+
+ /* check arguments */
+ if (log == NULL || strcmp(log->id, LOGID))
+ return -3;
+
+ /* see if we lost the lock -- if so get it again and reload the extra
+ field information (it probably changed), recover last operation if
+ necessary */
+ if (log_check(log) && log_open(log))
+ return -1;
+
+ /* create space for uncompressed data */
+ len = ((size_t)(log->last - log->first) & ~(((size_t)1 << 10) - 1)) +
+ log->stored;
+ if ((data = malloc(len)) == NULL)
+ return -2;
+
+ /* do statement here is just a cheap trick for error handling */
+ do {
+ /* read in the uncompressed data */
+ if (lseek(log->fd, log->first - 1, SEEK_SET) < 0)
+ break;
+ next = 0;
+ while (next < len) {
+ if (read(log->fd, buf, 5) != 5)
+ break;
+ block = PULL2(buf + 1);
+ if (next + block > len ||
+ read(log->fd, (char *)data + next, block) != block)
+ break;
+ next += block;
+ }
+ if (lseek(log->fd, 0, SEEK_CUR) != log->last + 4 + log->stored)
+ break;
+ log_touch(log);
+
+ /* write the uncompressed data to the .add file */
+ strcpy(log->end, ".add");
+ fd = open(log->path, O_WRONLY | O_CREAT | O_TRUNC, 0644);
+ if (fd < 0)
+ break;
+ ret = (size_t)write(fd, data, len) != len;
+ if (ret | close(fd))
+ break;
+ log_touch(log);
+
+ /* write the dictionary for the next compress to the .temp file */
+ strcpy(log->end, ".temp");
+ fd = open(log->path, O_WRONLY | O_CREAT | O_TRUNC, 0644);
+ if (fd < 0)
+ break;
+ next = DICT > len ? len : DICT;
+ ret = (size_t)write(fd, (char *)data + len - next, next) != next;
+ if (ret | close(fd))
+ break;
+ log_touch(log);
+
+ /* roll back to compressed data, mark the compress in progress */
+ log->last = log->first;
+ log->stored = 0;
+ if (log_mark(log, COMPRESS_OP))
+ break;
+ BAIL(7);
+
+ /* compress and append the data (clears mark) */
+ ret = log_compress(log, data, len);
+ free(data);
+ return ret;
+ } while (0);
+
+ /* broke out of do above on i/o error */
+ free(data);
+ return -1;
+}
+
+/* gzlog_write() return values:
+ 0: all good
+ -1: file i/o error (usually access issue)
+ -2: memory allocation failure
+ -3: invalid log pointer argument */
+int gzlog_write(gzlog *logd, void *data, size_t len)
+{
+ int fd, ret;
+ struct log *log = logd;
+
+ /* check arguments */
+ if (log == NULL || strcmp(log->id, LOGID))
+ return -3;
+ if (data == NULL || len <= 0)
+ return 0;
+
+ /* see if we lost the lock -- if so get it again and reload the extra
+ field information (it probably changed), recover last operation if
+ necessary */
+ if (log_check(log) && log_open(log))
+ return -1;
+
+ /* create and write .add file */
+ strcpy(log->end, ".add");
+ fd = open(log->path, O_WRONLY | O_CREAT | O_TRUNC, 0644);
+ if (fd < 0)
+ return -1;
+ ret = (size_t)write(fd, data, len) != len;
+ if (ret | close(fd))
+ return -1;
+ log_touch(log);
+
+ /* mark log file with append in progress */
+ if (log_mark(log, APPEND_OP))
+ return -1;
+ BAIL(8);
+
+ /* append data (clears mark) */
+ if (log_append(log, data, len))
+ return -1;
+
+ /* check to see if it's time to compress -- if not, then done */
+ if (((log->last - log->first) >> 10) + (log->stored >> 10) < TRIGGER)
+ return 0;
+
+ /* time to compress */
+ return gzlog_compress(log);
+}
+
+/* gzlog_close() return values:
+ 0: ok
+ -3: invalid log pointer argument */
+int gzlog_close(gzlog *logd)
+{
+ struct log *log = logd;
+
+ /* check arguments */
+ if (log == NULL || strcmp(log->id, LOGID))
+ return -3;
+
+ /* close the log file and release the lock */
+ log_close(log);
+
+ /* free structure and return */
+ if (log->path != NULL)
+ free(log->path);
+ strcpy(log->id, "bad");
+ free(log);
+ return 0;
+}
diff --git a/protocols/Telegram/tgl/zlib/examples/gzlog.h b/protocols/Telegram/tgl/zlib/examples/gzlog.h
new file mode 100644
index 0000000000..86f0cecba5
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/examples/gzlog.h
@@ -0,0 +1,91 @@
+/* gzlog.h
+ Copyright (C) 2004, 2008, 2012 Mark Adler, all rights reserved
+ version 2.2, 14 Aug 2012
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the author be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Mark Adler madler@alumni.caltech.edu
+ */
+
+/* Version History:
+ 1.0 26 Nov 2004 First version
+ 2.0 25 Apr 2008 Complete redesign for recovery of interrupted operations
+ Interface changed slightly in that now path is a prefix
+ Compression now occurs as needed during gzlog_write()
+ gzlog_write() now always leaves the log file as valid gzip
+ 2.1 8 Jul 2012 Fix argument checks in gzlog_compress() and gzlog_write()
+ 2.2 14 Aug 2012 Clean up signed comparisons
+ */
+
+/*
+ The gzlog object allows writing short messages to a gzipped log file,
+ opening the log file locked for small bursts, and then closing it. The log
+ object works by appending stored (uncompressed) data to the gzip file until
+ 1 MB has been accumulated. At that time, the stored data is compressed, and
+ replaces the uncompressed data in the file. The log file is truncated to
+ its new size at that time. After each write operation, the log file is a
+ valid gzip file that can decompressed to recover what was written.
+
+ The gzlog operations can be interupted at any point due to an application or
+ system crash, and the log file will be recovered the next time the log is
+ opened with gzlog_open().
+ */
+
+#ifndef GZLOG_H
+#define GZLOG_H
+
+/* gzlog object type */
+typedef void gzlog;
+
+/* Open a gzlog object, creating the log file if it does not exist. Return
+ NULL on error. Note that gzlog_open() could take a while to complete if it
+ has to wait to verify that a lock is stale (possibly for five minutes), or
+ if there is significant contention with other instantiations of this object
+ when locking the resource. path is the prefix of the file names created by
+ this object. If path is "foo", then the log file will be "foo.gz", and
+ other auxiliary files will be created and destroyed during the process:
+ "foo.dict" for a compression dictionary, "foo.temp" for a temporary (next)
+ dictionary, "foo.add" for data being added or compressed, "foo.lock" for the
+ lock file, and "foo.repairs" to log recovery operations performed due to
+ interrupted gzlog operations. A gzlog_open() followed by a gzlog_close()
+ will recover a previously interrupted operation, if any. */
+gzlog *gzlog_open(char *path);
+
+/* Write to a gzlog object. Return zero on success, -1 if there is a file i/o
+ error on any of the gzlog files (this should not happen if gzlog_open()
+ succeeded, unless the device has run out of space or leftover auxiliary
+ files have permissions or ownership that prevent their use), -2 if there is
+ a memory allocation failure, or -3 if the log argument is invalid (e.g. if
+ it was not created by gzlog_open()). This function will write data to the
+ file uncompressed, until 1 MB has been accumulated, at which time that data
+ will be compressed. The log file will be a valid gzip file upon successful
+ return. */
+int gzlog_write(gzlog *log, void *data, size_t len);
+
+/* Force compression of any uncompressed data in the log. This should be used
+ sparingly, if at all. The main application would be when a log file will
+ not be appended to again. If this is used to compress frequently while
+ appending, it will both significantly increase the execution time and
+ reduce the compression ratio. The return codes are the same as for
+ gzlog_write(). */
+int gzlog_compress(gzlog *log);
+
+/* Close a gzlog object. Return zero on success, -3 if the log argument is
+ invalid. The log object is freed, and so cannot be referenced again. */
+int gzlog_close(gzlog *log);
+
+#endif
diff --git a/protocols/Telegram/tgl/zlib/examples/zlib_how.html b/protocols/Telegram/tgl/zlib/examples/zlib_how.html
new file mode 100644
index 0000000000..444ff1c9a3
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/examples/zlib_how.html
@@ -0,0 +1,545 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
+ "http://www.w3.org/TR/REC-html40/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>zlib Usage Example</title>
+<!-- Copyright (c) 2004, 2005 Mark Adler. -->
+</head>
+<body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#00A000">
+<h2 align="center"> zlib Usage Example </h2>
+We often get questions about how the <tt>deflate()</tt> and <tt>inflate()</tt> functions should be used.
+Users wonder when they should provide more input, when they should use more output,
+what to do with a <tt>Z_BUF_ERROR</tt>, how to make sure the process terminates properly, and
+so on. So for those who have read <tt>zlib.h</tt> (a few times), and
+would like further edification, below is an annotated example in C of simple routines to compress and decompress
+from an input file to an output file using <tt>deflate()</tt> and <tt>inflate()</tt> respectively. The
+annotations are interspersed between lines of the code. So please read between the lines.
+We hope this helps explain some of the intricacies of <em>zlib</em>.
+<p>
+Without further adieu, here is the program <a href="zpipe.c"><tt>zpipe.c</tt></a>:
+<pre><b>
+/* zpipe.c: example of proper use of zlib's inflate() and deflate()
+ Not copyrighted -- provided to the public domain
+ Version 1.4 11 December 2005 Mark Adler */
+
+/* Version history:
+ 1.0 30 Oct 2004 First version
+ 1.1 8 Nov 2004 Add void casting for unused return values
+ Use switch statement for inflate() return values
+ 1.2 9 Nov 2004 Add assertions to document zlib guarantees
+ 1.3 6 Apr 2005 Remove incorrect assertion in inf()
+ 1.4 11 Dec 2005 Add hack to avoid MSDOS end-of-line conversions
+ Avoid some compiler warnings for input and output buffers
+ */
+</b></pre><!-- -->
+We now include the header files for the required definitions. From
+<tt>stdio.h</tt> we use <tt>fopen()</tt>, <tt>fread()</tt>, <tt>fwrite()</tt>,
+<tt>feof()</tt>, <tt>ferror()</tt>, and <tt>fclose()</tt> for file i/o, and
+<tt>fputs()</tt> for error messages. From <tt>string.h</tt> we use
+<tt>strcmp()</tt> for command line argument processing.
+From <tt>assert.h</tt> we use the <tt>assert()</tt> macro.
+From <tt>zlib.h</tt>
+we use the basic compression functions <tt>deflateInit()</tt>,
+<tt>deflate()</tt>, and <tt>deflateEnd()</tt>, and the basic decompression
+functions <tt>inflateInit()</tt>, <tt>inflate()</tt>, and
+<tt>inflateEnd()</tt>.
+<pre><b>
+#include &lt;stdio.h&gt;
+#include &lt;string.h&gt;
+#include &lt;assert.h&gt;
+#include "zlib.h"
+</b></pre><!-- -->
+This is an ugly hack required to avoid corruption of the input and output data on
+Windows/MS-DOS systems. Without this, those systems would assume that the input and output
+files are text, and try to convert the end-of-line characters from one standard to
+another. That would corrupt binary data, and in particular would render the compressed data unusable.
+This sets the input and output to binary which suppresses the end-of-line conversions.
+<tt>SET_BINARY_MODE()</tt> will be used later on <tt>stdin</tt> and <tt>stdout</tt>, at the beginning of <tt>main()</tt>.
+<pre><b>
+#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__)
+# include &lt;fcntl.h&gt;
+# include &lt;io.h&gt;
+# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
+#else
+# define SET_BINARY_MODE(file)
+#endif
+</b></pre><!-- -->
+<tt>CHUNK</tt> is simply the buffer size for feeding data to and pulling data
+from the <em>zlib</em> routines. Larger buffer sizes would be more efficient,
+especially for <tt>inflate()</tt>. If the memory is available, buffers sizes
+on the order of 128K or 256K bytes should be used.
+<pre><b>
+#define CHUNK 16384
+</b></pre><!-- -->
+The <tt>def()</tt> routine compresses data from an input file to an output file. The output data
+will be in the <em>zlib</em> format, which is different from the <em>gzip</em> or <em>zip</em>
+formats. The <em>zlib</em> format has a very small header of only two bytes to identify it as
+a <em>zlib</em> stream and to provide decoding information, and a four-byte trailer with a fast
+check value to verify the integrity of the uncompressed data after decoding.
+<pre><b>
+/* Compress from file source to file dest until EOF on source.
+ def() returns Z_OK on success, Z_MEM_ERROR if memory could not be
+ allocated for processing, Z_STREAM_ERROR if an invalid compression
+ level is supplied, Z_VERSION_ERROR if the version of zlib.h and the
+ version of the library linked do not match, or Z_ERRNO if there is
+ an error reading or writing the files. */
+int def(FILE *source, FILE *dest, int level)
+{
+</b></pre>
+Here are the local variables for <tt>def()</tt>. <tt>ret</tt> will be used for <em>zlib</em>
+return codes. <tt>flush</tt> will keep track of the current flushing state for <tt>deflate()</tt>,
+which is either no flushing, or flush to completion after the end of the input file is reached.
+<tt>have</tt> is the amount of data returned from <tt>deflate()</tt>. The <tt>strm</tt> structure
+is used to pass information to and from the <em>zlib</em> routines, and to maintain the
+<tt>deflate()</tt> state. <tt>in</tt> and <tt>out</tt> are the input and output buffers for
+<tt>deflate()</tt>.
+<pre><b>
+ int ret, flush;
+ unsigned have;
+ z_stream strm;
+ unsigned char in[CHUNK];
+ unsigned char out[CHUNK];
+</b></pre><!-- -->
+The first thing we do is to initialize the <em>zlib</em> state for compression using
+<tt>deflateInit()</tt>. This must be done before the first use of <tt>deflate()</tt>.
+The <tt>zalloc</tt>, <tt>zfree</tt>, and <tt>opaque</tt> fields in the <tt>strm</tt>
+structure must be initialized before calling <tt>deflateInit()</tt>. Here they are
+set to the <em>zlib</em> constant <tt>Z_NULL</tt> to request that <em>zlib</em> use
+the default memory allocation routines. An application may also choose to provide
+custom memory allocation routines here. <tt>deflateInit()</tt> will allocate on the
+order of 256K bytes for the internal state.
+(See <a href="zlib_tech.html"><em>zlib Technical Details</em></a>.)
+<p>
+<tt>deflateInit()</tt> is called with a pointer to the structure to be initialized and
+the compression level, which is an integer in the range of -1 to 9. Lower compression
+levels result in faster execution, but less compression. Higher levels result in
+greater compression, but slower execution. The <em>zlib</em> constant Z_DEFAULT_COMPRESSION,
+equal to -1,
+provides a good compromise between compression and speed and is equivalent to level 6.
+Level 0 actually does no compression at all, and in fact expands the data slightly to produce
+the <em>zlib</em> format (it is not a byte-for-byte copy of the input).
+More advanced applications of <em>zlib</em>
+may use <tt>deflateInit2()</tt> here instead. Such an application may want to reduce how
+much memory will be used, at some price in compression. Or it may need to request a
+<em>gzip</em> header and trailer instead of a <em>zlib</em> header and trailer, or raw
+encoding with no header or trailer at all.
+<p>
+We must check the return value of <tt>deflateInit()</tt> against the <em>zlib</em> constant
+<tt>Z_OK</tt> to make sure that it was able to
+allocate memory for the internal state, and that the provided arguments were valid.
+<tt>deflateInit()</tt> will also check that the version of <em>zlib</em> that the <tt>zlib.h</tt>
+file came from matches the version of <em>zlib</em> actually linked with the program. This
+is especially important for environments in which <em>zlib</em> is a shared library.
+<p>
+Note that an application can initialize multiple, independent <em>zlib</em> streams, which can
+operate in parallel. The state information maintained in the structure allows the <em>zlib</em>
+routines to be reentrant.
+<pre><b>
+ /* allocate deflate state */
+ strm.zalloc = Z_NULL;
+ strm.zfree = Z_NULL;
+ strm.opaque = Z_NULL;
+ ret = deflateInit(&amp;strm, level);
+ if (ret != Z_OK)
+ return ret;
+</b></pre><!-- -->
+With the pleasantries out of the way, now we can get down to business. The outer <tt>do</tt>-loop
+reads all of the input file and exits at the bottom of the loop once end-of-file is reached.
+This loop contains the only call of <tt>deflate()</tt>. So we must make sure that all of the
+input data has been processed and that all of the output data has been generated and consumed
+before we fall out of the loop at the bottom.
+<pre><b>
+ /* compress until end of file */
+ do {
+</b></pre>
+We start off by reading data from the input file. The number of bytes read is put directly
+into <tt>avail_in</tt>, and a pointer to those bytes is put into <tt>next_in</tt>. We also
+check to see if end-of-file on the input has been reached. If we are at the end of file, then <tt>flush</tt> is set to the
+<em>zlib</em> constant <tt>Z_FINISH</tt>, which is later passed to <tt>deflate()</tt> to
+indicate that this is the last chunk of input data to compress. We need to use <tt>feof()</tt>
+to check for end-of-file as opposed to seeing if fewer than <tt>CHUNK</tt> bytes have been read. The
+reason is that if the input file length is an exact multiple of <tt>CHUNK</tt>, we will miss
+the fact that we got to the end-of-file, and not know to tell <tt>deflate()</tt> to finish
+up the compressed stream. If we are not yet at the end of the input, then the <em>zlib</em>
+constant <tt>Z_NO_FLUSH</tt> will be passed to <tt>deflate</tt> to indicate that we are still
+in the middle of the uncompressed data.
+<p>
+If there is an error in reading from the input file, the process is aborted with
+<tt>deflateEnd()</tt> being called to free the allocated <em>zlib</em> state before returning
+the error. We wouldn't want a memory leak, now would we? <tt>deflateEnd()</tt> can be called
+at any time after the state has been initialized. Once that's done, <tt>deflateInit()</tt> (or
+<tt>deflateInit2()</tt>) would have to be called to start a new compression process. There is
+no point here in checking the <tt>deflateEnd()</tt> return code. The deallocation can't fail.
+<pre><b>
+ strm.avail_in = fread(in, 1, CHUNK, source);
+ if (ferror(source)) {
+ (void)deflateEnd(&amp;strm);
+ return Z_ERRNO;
+ }
+ flush = feof(source) ? Z_FINISH : Z_NO_FLUSH;
+ strm.next_in = in;
+</b></pre><!-- -->
+The inner <tt>do</tt>-loop passes our chunk of input data to <tt>deflate()</tt>, and then
+keeps calling <tt>deflate()</tt> until it is done producing output. Once there is no more
+new output, <tt>deflate()</tt> is guaranteed to have consumed all of the input, i.e.,
+<tt>avail_in</tt> will be zero.
+<pre><b>
+ /* run deflate() on input until output buffer not full, finish
+ compression if all of source has been read in */
+ do {
+</b></pre>
+Output space is provided to <tt>deflate()</tt> by setting <tt>avail_out</tt> to the number
+of available output bytes and <tt>next_out</tt> to a pointer to that space.
+<pre><b>
+ strm.avail_out = CHUNK;
+ strm.next_out = out;
+</b></pre>
+Now we call the compression engine itself, <tt>deflate()</tt>. It takes as many of the
+<tt>avail_in</tt> bytes at <tt>next_in</tt> as it can process, and writes as many as
+<tt>avail_out</tt> bytes to <tt>next_out</tt>. Those counters and pointers are then
+updated past the input data consumed and the output data written. It is the amount of
+output space available that may limit how much input is consumed.
+Hence the inner loop to make sure that
+all of the input is consumed by providing more output space each time. Since <tt>avail_in</tt>
+and <tt>next_in</tt> are updated by <tt>deflate()</tt>, we don't have to mess with those
+between <tt>deflate()</tt> calls until it's all used up.
+<p>
+The parameters to <tt>deflate()</tt> are a pointer to the <tt>strm</tt> structure containing
+the input and output information and the internal compression engine state, and a parameter
+indicating whether and how to flush data to the output. Normally <tt>deflate</tt> will consume
+several K bytes of input data before producing any output (except for the header), in order
+to accumulate statistics on the data for optimum compression. It will then put out a burst of
+compressed data, and proceed to consume more input before the next burst. Eventually,
+<tt>deflate()</tt>
+must be told to terminate the stream, complete the compression with provided input data, and
+write out the trailer check value. <tt>deflate()</tt> will continue to compress normally as long
+as the flush parameter is <tt>Z_NO_FLUSH</tt>. Once the <tt>Z_FINISH</tt> parameter is provided,
+<tt>deflate()</tt> will begin to complete the compressed output stream. However depending on how
+much output space is provided, <tt>deflate()</tt> may have to be called several times until it
+has provided the complete compressed stream, even after it has consumed all of the input. The flush
+parameter must continue to be <tt>Z_FINISH</tt> for those subsequent calls.
+<p>
+There are other values of the flush parameter that are used in more advanced applications. You can
+force <tt>deflate()</tt> to produce a burst of output that encodes all of the input data provided
+so far, even if it wouldn't have otherwise, for example to control data latency on a link with
+compressed data. You can also ask that <tt>deflate()</tt> do that as well as erase any history up to
+that point so that what follows can be decompressed independently, for example for random access
+applications. Both requests will degrade compression by an amount depending on how often such
+requests are made.
+<p>
+<tt>deflate()</tt> has a return value that can indicate errors, yet we do not check it here. Why
+not? Well, it turns out that <tt>deflate()</tt> can do no wrong here. Let's go through
+<tt>deflate()</tt>'s return values and dispense with them one by one. The possible values are
+<tt>Z_OK</tt>, <tt>Z_STREAM_END</tt>, <tt>Z_STREAM_ERROR</tt>, or <tt>Z_BUF_ERROR</tt>. <tt>Z_OK</tt>
+is, well, ok. <tt>Z_STREAM_END</tt> is also ok and will be returned for the last call of
+<tt>deflate()</tt>. This is already guaranteed by calling <tt>deflate()</tt> with <tt>Z_FINISH</tt>
+until it has no more output. <tt>Z_STREAM_ERROR</tt> is only possible if the stream is not
+initialized properly, but we did initialize it properly. There is no harm in checking for
+<tt>Z_STREAM_ERROR</tt> here, for example to check for the possibility that some
+other part of the application inadvertently clobbered the memory containing the <em>zlib</em> state.
+<tt>Z_BUF_ERROR</tt> will be explained further below, but
+suffice it to say that this is simply an indication that <tt>deflate()</tt> could not consume
+more input or produce more output. <tt>deflate()</tt> can be called again with more output space
+or more available input, which it will be in this code.
+<pre><b>
+ ret = deflate(&amp;strm, flush); /* no bad return value */
+ assert(ret != Z_STREAM_ERROR); /* state not clobbered */
+</b></pre>
+Now we compute how much output <tt>deflate()</tt> provided on the last call, which is the
+difference between how much space was provided before the call, and how much output space
+is still available after the call. Then that data, if any, is written to the output file.
+We can then reuse the output buffer for the next call of <tt>deflate()</tt>. Again if there
+is a file i/o error, we call <tt>deflateEnd()</tt> before returning to avoid a memory leak.
+<pre><b>
+ have = CHUNK - strm.avail_out;
+ if (fwrite(out, 1, have, dest) != have || ferror(dest)) {
+ (void)deflateEnd(&amp;strm);
+ return Z_ERRNO;
+ }
+</b></pre>
+The inner <tt>do</tt>-loop is repeated until the last <tt>deflate()</tt> call fails to fill the
+provided output buffer. Then we know that <tt>deflate()</tt> has done as much as it can with
+the provided input, and that all of that input has been consumed. We can then fall out of this
+loop and reuse the input buffer.
+<p>
+The way we tell that <tt>deflate()</tt> has no more output is by seeing that it did not fill
+the output buffer, leaving <tt>avail_out</tt> greater than zero. However suppose that
+<tt>deflate()</tt> has no more output, but just so happened to exactly fill the output buffer!
+<tt>avail_out</tt> is zero, and we can't tell that <tt>deflate()</tt> has done all it can.
+As far as we know, <tt>deflate()</tt>
+has more output for us. So we call it again. But now <tt>deflate()</tt> produces no output
+at all, and <tt>avail_out</tt> remains unchanged as <tt>CHUNK</tt>. That <tt>deflate()</tt> call
+wasn't able to do anything, either consume input or produce output, and so it returns
+<tt>Z_BUF_ERROR</tt>. (See, I told you I'd cover this later.) However this is not a problem at
+all. Now we finally have the desired indication that <tt>deflate()</tt> is really done,
+and so we drop out of the inner loop to provide more input to <tt>deflate()</tt>.
+<p>
+With <tt>flush</tt> set to <tt>Z_FINISH</tt>, this final set of <tt>deflate()</tt> calls will
+complete the output stream. Once that is done, subsequent calls of <tt>deflate()</tt> would return
+<tt>Z_STREAM_ERROR</tt> if the flush parameter is not <tt>Z_FINISH</tt>, and do no more processing
+until the state is reinitialized.
+<p>
+Some applications of <em>zlib</em> have two loops that call <tt>deflate()</tt>
+instead of the single inner loop we have here. The first loop would call
+without flushing and feed all of the data to <tt>deflate()</tt>. The second loop would call
+<tt>deflate()</tt> with no more
+data and the <tt>Z_FINISH</tt> parameter to complete the process. As you can see from this
+example, that can be avoided by simply keeping track of the current flush state.
+<pre><b>
+ } while (strm.avail_out == 0);
+ assert(strm.avail_in == 0); /* all input will be used */
+</b></pre><!-- -->
+Now we check to see if we have already processed all of the input file. That information was
+saved in the <tt>flush</tt> variable, so we see if that was set to <tt>Z_FINISH</tt>. If so,
+then we're done and we fall out of the outer loop. We're guaranteed to get <tt>Z_STREAM_END</tt>
+from the last <tt>deflate()</tt> call, since we ran it until the last chunk of input was
+consumed and all of the output was generated.
+<pre><b>
+ /* done when last data in file processed */
+ } while (flush != Z_FINISH);
+ assert(ret == Z_STREAM_END); /* stream will be complete */
+</b></pre><!-- -->
+The process is complete, but we still need to deallocate the state to avoid a memory leak
+(or rather more like a memory hemorrhage if you didn't do this). Then
+finally we can return with a happy return value.
+<pre><b>
+ /* clean up and return */
+ (void)deflateEnd(&amp;strm);
+ return Z_OK;
+}
+</b></pre><!-- -->
+Now we do the same thing for decompression in the <tt>inf()</tt> routine. <tt>inf()</tt>
+decompresses what is hopefully a valid <em>zlib</em> stream from the input file and writes the
+uncompressed data to the output file. Much of the discussion above for <tt>def()</tt>
+applies to <tt>inf()</tt> as well, so the discussion here will focus on the differences between
+the two.
+<pre><b>
+/* Decompress from file source to file dest until stream ends or EOF.
+ inf() returns Z_OK on success, Z_MEM_ERROR if memory could not be
+ allocated for processing, Z_DATA_ERROR if the deflate data is
+ invalid or incomplete, Z_VERSION_ERROR if the version of zlib.h and
+ the version of the library linked do not match, or Z_ERRNO if there
+ is an error reading or writing the files. */
+int inf(FILE *source, FILE *dest)
+{
+</b></pre>
+The local variables have the same functionality as they do for <tt>def()</tt>. The
+only difference is that there is no <tt>flush</tt> variable, since <tt>inflate()</tt>
+can tell from the <em>zlib</em> stream itself when the stream is complete.
+<pre><b>
+ int ret;
+ unsigned have;
+ z_stream strm;
+ unsigned char in[CHUNK];
+ unsigned char out[CHUNK];
+</b></pre><!-- -->
+The initialization of the state is the same, except that there is no compression level,
+of course, and two more elements of the structure are initialized. <tt>avail_in</tt>
+and <tt>next_in</tt> must be initialized before calling <tt>inflateInit()</tt>. This
+is because the application has the option to provide the start of the zlib stream in
+order for <tt>inflateInit()</tt> to have access to information about the compression
+method to aid in memory allocation. In the current implementation of <em>zlib</em>
+(up through versions 1.2.x), the method-dependent memory allocations are deferred to the first call of
+<tt>inflate()</tt> anyway. However those fields must be initialized since later versions
+of <em>zlib</em> that provide more compression methods may take advantage of this interface.
+In any case, no decompression is performed by <tt>inflateInit()</tt>, so the
+<tt>avail_out</tt> and <tt>next_out</tt> fields do not need to be initialized before calling.
+<p>
+Here <tt>avail_in</tt> is set to zero and <tt>next_in</tt> is set to <tt>Z_NULL</tt> to
+indicate that no input data is being provided.
+<pre><b>
+ /* allocate inflate state */
+ strm.zalloc = Z_NULL;
+ strm.zfree = Z_NULL;
+ strm.opaque = Z_NULL;
+ strm.avail_in = 0;
+ strm.next_in = Z_NULL;
+ ret = inflateInit(&amp;strm);
+ if (ret != Z_OK)
+ return ret;
+</b></pre><!-- -->
+The outer <tt>do</tt>-loop decompresses input until <tt>inflate()</tt> indicates
+that it has reached the end of the compressed data and has produced all of the uncompressed
+output. This is in contrast to <tt>def()</tt> which processes all of the input file.
+If end-of-file is reached before the compressed data self-terminates, then the compressed
+data is incomplete and an error is returned.
+<pre><b>
+ /* decompress until deflate stream ends or end of file */
+ do {
+</b></pre>
+We read input data and set the <tt>strm</tt> structure accordingly. If we've reached the
+end of the input file, then we leave the outer loop and report an error, since the
+compressed data is incomplete. Note that we may read more data than is eventually consumed
+by <tt>inflate()</tt>, if the input file continues past the <em>zlib</em> stream.
+For applications where <em>zlib</em> streams are embedded in other data, this routine would
+need to be modified to return the unused data, or at least indicate how much of the input
+data was not used, so the application would know where to pick up after the <em>zlib</em> stream.
+<pre><b>
+ strm.avail_in = fread(in, 1, CHUNK, source);
+ if (ferror(source)) {
+ (void)inflateEnd(&amp;strm);
+ return Z_ERRNO;
+ }
+ if (strm.avail_in == 0)
+ break;
+ strm.next_in = in;
+</b></pre><!-- -->
+The inner <tt>do</tt>-loop has the same function it did in <tt>def()</tt>, which is to
+keep calling <tt>inflate()</tt> until has generated all of the output it can with the
+provided input.
+<pre><b>
+ /* run inflate() on input until output buffer not full */
+ do {
+</b></pre>
+Just like in <tt>def()</tt>, the same output space is provided for each call of <tt>inflate()</tt>.
+<pre><b>
+ strm.avail_out = CHUNK;
+ strm.next_out = out;
+</b></pre>
+Now we run the decompression engine itself. There is no need to adjust the flush parameter, since
+the <em>zlib</em> format is self-terminating. The main difference here is that there are
+return values that we need to pay attention to. <tt>Z_DATA_ERROR</tt>
+indicates that <tt>inflate()</tt> detected an error in the <em>zlib</em> compressed data format,
+which means that either the data is not a <em>zlib</em> stream to begin with, or that the data was
+corrupted somewhere along the way since it was compressed. The other error to be processed is
+<tt>Z_MEM_ERROR</tt>, which can occur since memory allocation is deferred until <tt>inflate()</tt>
+needs it, unlike <tt>deflate()</tt>, whose memory is allocated at the start by <tt>deflateInit()</tt>.
+<p>
+Advanced applications may use
+<tt>deflateSetDictionary()</tt> to prime <tt>deflate()</tt> with a set of likely data to improve the
+first 32K or so of compression. This is noted in the <em>zlib</em> header, so <tt>inflate()</tt>
+requests that that dictionary be provided before it can start to decompress. Without the dictionary,
+correct decompression is not possible. For this routine, we have no idea what the dictionary is,
+so the <tt>Z_NEED_DICT</tt> indication is converted to a <tt>Z_DATA_ERROR</tt>.
+<p>
+<tt>inflate()</tt> can also return <tt>Z_STREAM_ERROR</tt>, which should not be possible here,
+but could be checked for as noted above for <tt>def()</tt>. <tt>Z_BUF_ERROR</tt> does not need to be
+checked for here, for the same reasons noted for <tt>def()</tt>. <tt>Z_STREAM_END</tt> will be
+checked for later.
+<pre><b>
+ ret = inflate(&amp;strm, Z_NO_FLUSH);
+ assert(ret != Z_STREAM_ERROR); /* state not clobbered */
+ switch (ret) {
+ case Z_NEED_DICT:
+ ret = Z_DATA_ERROR; /* and fall through */
+ case Z_DATA_ERROR:
+ case Z_MEM_ERROR:
+ (void)inflateEnd(&amp;strm);
+ return ret;
+ }
+</b></pre>
+The output of <tt>inflate()</tt> is handled identically to that of <tt>deflate()</tt>.
+<pre><b>
+ have = CHUNK - strm.avail_out;
+ if (fwrite(out, 1, have, dest) != have || ferror(dest)) {
+ (void)inflateEnd(&amp;strm);
+ return Z_ERRNO;
+ }
+</b></pre>
+The inner <tt>do</tt>-loop ends when <tt>inflate()</tt> has no more output as indicated
+by not filling the output buffer, just as for <tt>deflate()</tt>. In this case, we cannot
+assert that <tt>strm.avail_in</tt> will be zero, since the deflate stream may end before the file
+does.
+<pre><b>
+ } while (strm.avail_out == 0);
+</b></pre><!-- -->
+The outer <tt>do</tt>-loop ends when <tt>inflate()</tt> reports that it has reached the
+end of the input <em>zlib</em> stream, has completed the decompression and integrity
+check, and has provided all of the output. This is indicated by the <tt>inflate()</tt>
+return value <tt>Z_STREAM_END</tt>. The inner loop is guaranteed to leave <tt>ret</tt>
+equal to <tt>Z_STREAM_END</tt> if the last chunk of the input file read contained the end
+of the <em>zlib</em> stream. So if the return value is not <tt>Z_STREAM_END</tt>, the
+loop continues to read more input.
+<pre><b>
+ /* done when inflate() says it's done */
+ } while (ret != Z_STREAM_END);
+</b></pre><!-- -->
+At this point, decompression successfully completed, or we broke out of the loop due to no
+more data being available from the input file. If the last <tt>inflate()</tt> return value
+is not <tt>Z_STREAM_END</tt>, then the <em>zlib</em> stream was incomplete and a data error
+is returned. Otherwise, we return with a happy return value. Of course, <tt>inflateEnd()</tt>
+is called first to avoid a memory leak.
+<pre><b>
+ /* clean up and return */
+ (void)inflateEnd(&amp;strm);
+ return ret == Z_STREAM_END ? Z_OK : Z_DATA_ERROR;
+}
+</b></pre><!-- -->
+That ends the routines that directly use <em>zlib</em>. The following routines make this
+a command-line program by running data through the above routines from <tt>stdin</tt> to
+<tt>stdout</tt>, and handling any errors reported by <tt>def()</tt> or <tt>inf()</tt>.
+<p>
+<tt>zerr()</tt> is used to interpret the possible error codes from <tt>def()</tt>
+and <tt>inf()</tt>, as detailed in their comments above, and print out an error message.
+Note that these are only a subset of the possible return values from <tt>deflate()</tt>
+and <tt>inflate()</tt>.
+<pre><b>
+/* report a zlib or i/o error */
+void zerr(int ret)
+{
+ fputs("zpipe: ", stderr);
+ switch (ret) {
+ case Z_ERRNO:
+ if (ferror(stdin))
+ fputs("error reading stdin\n", stderr);
+ if (ferror(stdout))
+ fputs("error writing stdout\n", stderr);
+ break;
+ case Z_STREAM_ERROR:
+ fputs("invalid compression level\n", stderr);
+ break;
+ case Z_DATA_ERROR:
+ fputs("invalid or incomplete deflate data\n", stderr);
+ break;
+ case Z_MEM_ERROR:
+ fputs("out of memory\n", stderr);
+ break;
+ case Z_VERSION_ERROR:
+ fputs("zlib version mismatch!\n", stderr);
+ }
+}
+</b></pre><!-- -->
+Here is the <tt>main()</tt> routine used to test <tt>def()</tt> and <tt>inf()</tt>. The
+<tt>zpipe</tt> command is simply a compression pipe from <tt>stdin</tt> to <tt>stdout</tt>, if
+no arguments are given, or it is a decompression pipe if <tt>zpipe -d</tt> is used. If any other
+arguments are provided, no compression or decompression is performed. Instead a usage
+message is displayed. Examples are <tt>zpipe < foo.txt > foo.txt.z</tt> to compress, and
+<tt>zpipe -d < foo.txt.z > foo.txt</tt> to decompress.
+<pre><b>
+/* compress or decompress from stdin to stdout */
+int main(int argc, char **argv)
+{
+ int ret;
+
+ /* avoid end-of-line conversions */
+ SET_BINARY_MODE(stdin);
+ SET_BINARY_MODE(stdout);
+
+ /* do compression if no arguments */
+ if (argc == 1) {
+ ret = def(stdin, stdout, Z_DEFAULT_COMPRESSION);
+ if (ret != Z_OK)
+ zerr(ret);
+ return ret;
+ }
+
+ /* do decompression if -d specified */
+ else if (argc == 2 &amp;&amp; strcmp(argv[1], "-d") == 0) {
+ ret = inf(stdin, stdout);
+ if (ret != Z_OK)
+ zerr(ret);
+ return ret;
+ }
+
+ /* otherwise, report usage */
+ else {
+ fputs("zpipe usage: zpipe [-d] &lt; source &gt; dest\n", stderr);
+ return 1;
+ }
+}
+</b></pre>
+<hr>
+<i>Copyright (c) 2004, 2005 by Mark Adler<br>Last modified 11 December 2005</i>
+</body>
+</html>
diff --git a/protocols/Telegram/tgl/zlib/examples/zpipe.c b/protocols/Telegram/tgl/zlib/examples/zpipe.c
new file mode 100644
index 0000000000..83535d1693
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/examples/zpipe.c
@@ -0,0 +1,205 @@
+/* zpipe.c: example of proper use of zlib's inflate() and deflate()
+ Not copyrighted -- provided to the public domain
+ Version 1.4 11 December 2005 Mark Adler */
+
+/* Version history:
+ 1.0 30 Oct 2004 First version
+ 1.1 8 Nov 2004 Add void casting for unused return values
+ Use switch statement for inflate() return values
+ 1.2 9 Nov 2004 Add assertions to document zlib guarantees
+ 1.3 6 Apr 2005 Remove incorrect assertion in inf()
+ 1.4 11 Dec 2005 Add hack to avoid MSDOS end-of-line conversions
+ Avoid some compiler warnings for input and output buffers
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include "zlib.h"
+
+#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__)
+# include <fcntl.h>
+# include <io.h>
+# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
+#else
+# define SET_BINARY_MODE(file)
+#endif
+
+#define CHUNK 16384
+
+/* Compress from file source to file dest until EOF on source.
+ def() returns Z_OK on success, Z_MEM_ERROR if memory could not be
+ allocated for processing, Z_STREAM_ERROR if an invalid compression
+ level is supplied, Z_VERSION_ERROR if the version of zlib.h and the
+ version of the library linked do not match, or Z_ERRNO if there is
+ an error reading or writing the files. */
+int def(FILE *source, FILE *dest, int level)
+{
+ int ret, flush;
+ unsigned have;
+ z_stream strm;
+ unsigned char in[CHUNK];
+ unsigned char out[CHUNK];
+
+ /* allocate deflate state */
+ strm.zalloc = Z_NULL;
+ strm.zfree = Z_NULL;
+ strm.opaque = Z_NULL;
+ ret = deflateInit(&strm, level);
+ if (ret != Z_OK)
+ return ret;
+
+ /* compress until end of file */
+ do {
+ strm.avail_in = fread(in, 1, CHUNK, source);
+ if (ferror(source)) {
+ (void)deflateEnd(&strm);
+ return Z_ERRNO;
+ }
+ flush = feof(source) ? Z_FINISH : Z_NO_FLUSH;
+ strm.next_in = in;
+
+ /* run deflate() on input until output buffer not full, finish
+ compression if all of source has been read in */
+ do {
+ strm.avail_out = CHUNK;
+ strm.next_out = out;
+ ret = deflate(&strm, flush); /* no bad return value */
+ assert(ret != Z_STREAM_ERROR); /* state not clobbered */
+ have = CHUNK - strm.avail_out;
+ if (fwrite(out, 1, have, dest) != have || ferror(dest)) {
+ (void)deflateEnd(&strm);
+ return Z_ERRNO;
+ }
+ } while (strm.avail_out == 0);
+ assert(strm.avail_in == 0); /* all input will be used */
+
+ /* done when last data in file processed */
+ } while (flush != Z_FINISH);
+ assert(ret == Z_STREAM_END); /* stream will be complete */
+
+ /* clean up and return */
+ (void)deflateEnd(&strm);
+ return Z_OK;
+}
+
+/* Decompress from file source to file dest until stream ends or EOF.
+ inf() returns Z_OK on success, Z_MEM_ERROR if memory could not be
+ allocated for processing, Z_DATA_ERROR if the deflate data is
+ invalid or incomplete, Z_VERSION_ERROR if the version of zlib.h and
+ the version of the library linked do not match, or Z_ERRNO if there
+ is an error reading or writing the files. */
+int inf(FILE *source, FILE *dest)
+{
+ int ret;
+ unsigned have;
+ z_stream strm;
+ unsigned char in[CHUNK];
+ unsigned char out[CHUNK];
+
+ /* allocate inflate state */
+ strm.zalloc = Z_NULL;
+ strm.zfree = Z_NULL;
+ strm.opaque = Z_NULL;
+ strm.avail_in = 0;
+ strm.next_in = Z_NULL;
+ ret = inflateInit(&strm);
+ if (ret != Z_OK)
+ return ret;
+
+ /* decompress until deflate stream ends or end of file */
+ do {
+ strm.avail_in = fread(in, 1, CHUNK, source);
+ if (ferror(source)) {
+ (void)inflateEnd(&strm);
+ return Z_ERRNO;
+ }
+ if (strm.avail_in == 0)
+ break;
+ strm.next_in = in;
+
+ /* run inflate() on input until output buffer not full */
+ do {
+ strm.avail_out = CHUNK;
+ strm.next_out = out;
+ ret = inflate(&strm, Z_NO_FLUSH);
+ assert(ret != Z_STREAM_ERROR); /* state not clobbered */
+ switch (ret) {
+ case Z_NEED_DICT:
+ ret = Z_DATA_ERROR; /* and fall through */
+ case Z_DATA_ERROR:
+ case Z_MEM_ERROR:
+ (void)inflateEnd(&strm);
+ return ret;
+ }
+ have = CHUNK - strm.avail_out;
+ if (fwrite(out, 1, have, dest) != have || ferror(dest)) {
+ (void)inflateEnd(&strm);
+ return Z_ERRNO;
+ }
+ } while (strm.avail_out == 0);
+
+ /* done when inflate() says it's done */
+ } while (ret != Z_STREAM_END);
+
+ /* clean up and return */
+ (void)inflateEnd(&strm);
+ return ret == Z_STREAM_END ? Z_OK : Z_DATA_ERROR;
+}
+
+/* report a zlib or i/o error */
+void zerr(int ret)
+{
+ fputs("zpipe: ", stderr);
+ switch (ret) {
+ case Z_ERRNO:
+ if (ferror(stdin))
+ fputs("error reading stdin\n", stderr);
+ if (ferror(stdout))
+ fputs("error writing stdout\n", stderr);
+ break;
+ case Z_STREAM_ERROR:
+ fputs("invalid compression level\n", stderr);
+ break;
+ case Z_DATA_ERROR:
+ fputs("invalid or incomplete deflate data\n", stderr);
+ break;
+ case Z_MEM_ERROR:
+ fputs("out of memory\n", stderr);
+ break;
+ case Z_VERSION_ERROR:
+ fputs("zlib version mismatch!\n", stderr);
+ }
+}
+
+/* compress or decompress from stdin to stdout */
+int main(int argc, char **argv)
+{
+ int ret;
+
+ /* avoid end-of-line conversions */
+ SET_BINARY_MODE(stdin);
+ SET_BINARY_MODE(stdout);
+
+ /* do compression if no arguments */
+ if (argc == 1) {
+ ret = def(stdin, stdout, Z_DEFAULT_COMPRESSION);
+ if (ret != Z_OK)
+ zerr(ret);
+ return ret;
+ }
+
+ /* do decompression if -d specified */
+ else if (argc == 2 && strcmp(argv[1], "-d") == 0) {
+ ret = inf(stdin, stdout);
+ if (ret != Z_OK)
+ zerr(ret);
+ return ret;
+ }
+
+ /* otherwise, report usage */
+ else {
+ fputs("zpipe usage: zpipe [-d] < source > dest\n", stderr);
+ return 1;
+ }
+}
diff --git a/protocols/Telegram/tgl/zlib/examples/zran.c b/protocols/Telegram/tgl/zlib/examples/zran.c
new file mode 100644
index 0000000000..278f9ad07d
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/examples/zran.c
@@ -0,0 +1,409 @@
+/* zran.c -- example of zlib/gzip stream indexing and random access
+ * Copyright (C) 2005, 2012 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ Version 1.1 29 Sep 2012 Mark Adler */
+
+/* Version History:
+ 1.0 29 May 2005 First version
+ 1.1 29 Sep 2012 Fix memory reallocation error
+ */
+
+/* Illustrate the use of Z_BLOCK, inflatePrime(), and inflateSetDictionary()
+ for random access of a compressed file. A file containing a zlib or gzip
+ stream is provided on the command line. The compressed stream is decoded in
+ its entirety, and an index built with access points about every SPAN bytes
+ in the uncompressed output. The compressed file is left open, and can then
+ be read randomly, having to decompress on the average SPAN/2 uncompressed
+ bytes before getting to the desired block of data.
+
+ An access point can be created at the start of any deflate block, by saving
+ the starting file offset and bit of that block, and the 32K bytes of
+ uncompressed data that precede that block. Also the uncompressed offset of
+ that block is saved to provide a referece for locating a desired starting
+ point in the uncompressed stream. build_index() works by decompressing the
+ input zlib or gzip stream a block at a time, and at the end of each block
+ deciding if enough uncompressed data has gone by to justify the creation of
+ a new access point. If so, that point is saved in a data structure that
+ grows as needed to accommodate the points.
+
+ To use the index, an offset in the uncompressed data is provided, for which
+ the latest accees point at or preceding that offset is located in the index.
+ The input file is positioned to the specified location in the index, and if
+ necessary the first few bits of the compressed data is read from the file.
+ inflate is initialized with those bits and the 32K of uncompressed data, and
+ the decompression then proceeds until the desired offset in the file is
+ reached. Then the decompression continues to read the desired uncompressed
+ data from the file.
+
+ Another approach would be to generate the index on demand. In that case,
+ requests for random access reads from the compressed data would try to use
+ the index, but if a read far enough past the end of the index is required,
+ then further index entries would be generated and added.
+
+ There is some fair bit of overhead to starting inflation for the random
+ access, mainly copying the 32K byte dictionary. So if small pieces of the
+ file are being accessed, it would make sense to implement a cache to hold
+ some lookahead and avoid many calls to extract() for small lengths.
+
+ Another way to build an index would be to use inflateCopy(). That would
+ not be constrained to have access points at block boundaries, but requires
+ more memory per access point, and also cannot be saved to file due to the
+ use of pointers in the state. The approach here allows for storage of the
+ index in a file.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "zlib.h"
+
+#define local static
+
+#define SPAN 1048576L /* desired distance between access points */
+#define WINSIZE 32768U /* sliding window size */
+#define CHUNK 16384 /* file input buffer size */
+
+/* access point entry */
+struct point {
+ off_t out; /* corresponding offset in uncompressed data */
+ off_t in; /* offset in input file of first full byte */
+ int bits; /* number of bits (1-7) from byte at in - 1, or 0 */
+ unsigned char window[WINSIZE]; /* preceding 32K of uncompressed data */
+};
+
+/* access point list */
+struct access {
+ int have; /* number of list entries filled in */
+ int size; /* number of list entries allocated */
+ struct point *list; /* allocated list */
+};
+
+/* Deallocate an index built by build_index() */
+local void free_index(struct access *index)
+{
+ if (index != NULL) {
+ free(index->list);
+ free(index);
+ }
+}
+
+/* Add an entry to the access point list. If out of memory, deallocate the
+ existing list and return NULL. */
+local struct access *addpoint(struct access *index, int bits,
+ off_t in, off_t out, unsigned left, unsigned char *window)
+{
+ struct point *next;
+
+ /* if list is empty, create it (start with eight points) */
+ if (index == NULL) {
+ index = malloc(sizeof(struct access));
+ if (index == NULL) return NULL;
+ index->list = malloc(sizeof(struct point) << 3);
+ if (index->list == NULL) {
+ free(index);
+ return NULL;
+ }
+ index->size = 8;
+ index->have = 0;
+ }
+
+ /* if list is full, make it bigger */
+ else if (index->have == index->size) {
+ index->size <<= 1;
+ next = realloc(index->list, sizeof(struct point) * index->size);
+ if (next == NULL) {
+ free_index(index);
+ return NULL;
+ }
+ index->list = next;
+ }
+
+ /* fill in entry and increment how many we have */
+ next = index->list + index->have;
+ next->bits = bits;
+ next->in = in;
+ next->out = out;
+ if (left)
+ memcpy(next->window, window + WINSIZE - left, left);
+ if (left < WINSIZE)
+ memcpy(next->window + left, window, WINSIZE - left);
+ index->have++;
+
+ /* return list, possibly reallocated */
+ return index;
+}
+
+/* Make one entire pass through the compressed stream and build an index, with
+ access points about every span bytes of uncompressed output -- span is
+ chosen to balance the speed of random access against the memory requirements
+ of the list, about 32K bytes per access point. Note that data after the end
+ of the first zlib or gzip stream in the file is ignored. build_index()
+ returns the number of access points on success (>= 1), Z_MEM_ERROR for out
+ of memory, Z_DATA_ERROR for an error in the input file, or Z_ERRNO for a
+ file read error. On success, *built points to the resulting index. */
+local int build_index(FILE *in, off_t span, struct access **built)
+{
+ int ret;
+ off_t totin, totout; /* our own total counters to avoid 4GB limit */
+ off_t last; /* totout value of last access point */
+ struct access *index; /* access points being generated */
+ z_stream strm;
+ unsigned char input[CHUNK];
+ unsigned char window[WINSIZE];
+
+ /* initialize inflate */
+ strm.zalloc = Z_NULL;
+ strm.zfree = Z_NULL;
+ strm.opaque = Z_NULL;
+ strm.avail_in = 0;
+ strm.next_in = Z_NULL;
+ ret = inflateInit2(&strm, 47); /* automatic zlib or gzip decoding */
+ if (ret != Z_OK)
+ return ret;
+
+ /* inflate the input, maintain a sliding window, and build an index -- this
+ also validates the integrity of the compressed data using the check
+ information at the end of the gzip or zlib stream */
+ totin = totout = last = 0;
+ index = NULL; /* will be allocated by first addpoint() */
+ strm.avail_out = 0;
+ do {
+ /* get some compressed data from input file */
+ strm.avail_in = fread(input, 1, CHUNK, in);
+ if (ferror(in)) {
+ ret = Z_ERRNO;
+ goto build_index_error;
+ }
+ if (strm.avail_in == 0) {
+ ret = Z_DATA_ERROR;
+ goto build_index_error;
+ }
+ strm.next_in = input;
+
+ /* process all of that, or until end of stream */
+ do {
+ /* reset sliding window if necessary */
+ if (strm.avail_out == 0) {
+ strm.avail_out = WINSIZE;
+ strm.next_out = window;
+ }
+
+ /* inflate until out of input, output, or at end of block --
+ update the total input and output counters */
+ totin += strm.avail_in;
+ totout += strm.avail_out;
+ ret = inflate(&strm, Z_BLOCK); /* return at end of block */
+ totin -= strm.avail_in;
+ totout -= strm.avail_out;
+ if (ret == Z_NEED_DICT)
+ ret = Z_DATA_ERROR;
+ if (ret == Z_MEM_ERROR || ret == Z_DATA_ERROR)
+ goto build_index_error;
+ if (ret == Z_STREAM_END)
+ break;
+
+ /* if at end of block, consider adding an index entry (note that if
+ data_type indicates an end-of-block, then all of the
+ uncompressed data from that block has been delivered, and none
+ of the compressed data after that block has been consumed,
+ except for up to seven bits) -- the totout == 0 provides an
+ entry point after the zlib or gzip header, and assures that the
+ index always has at least one access point; we avoid creating an
+ access point after the last block by checking bit 6 of data_type
+ */
+ if ((strm.data_type & 128) && !(strm.data_type & 64) &&
+ (totout == 0 || totout - last > span)) {
+ index = addpoint(index, strm.data_type & 7, totin,
+ totout, strm.avail_out, window);
+ if (index == NULL) {
+ ret = Z_MEM_ERROR;
+ goto build_index_error;
+ }
+ last = totout;
+ }
+ } while (strm.avail_in != 0);
+ } while (ret != Z_STREAM_END);
+
+ /* clean up and return index (release unused entries in list) */
+ (void)inflateEnd(&strm);
+ index->list = realloc(index->list, sizeof(struct point) * index->have);
+ index->size = index->have;
+ *built = index;
+ return index->size;
+
+ /* return error */
+ build_index_error:
+ (void)inflateEnd(&strm);
+ if (index != NULL)
+ free_index(index);
+ return ret;
+}
+
+/* Use the index to read len bytes from offset into buf, return bytes read or
+ negative for error (Z_DATA_ERROR or Z_MEM_ERROR). If data is requested past
+ the end of the uncompressed data, then extract() will return a value less
+ than len, indicating how much as actually read into buf. This function
+ should not return a data error unless the file was modified since the index
+ was generated. extract() may also return Z_ERRNO if there is an error on
+ reading or seeking the input file. */
+local int extract(FILE *in, struct access *index, off_t offset,
+ unsigned char *buf, int len)
+{
+ int ret, skip;
+ z_stream strm;
+ struct point *here;
+ unsigned char input[CHUNK];
+ unsigned char discard[WINSIZE];
+
+ /* proceed only if something reasonable to do */
+ if (len < 0)
+ return 0;
+
+ /* find where in stream to start */
+ here = index->list;
+ ret = index->have;
+ while (--ret && here[1].out <= offset)
+ here++;
+
+ /* initialize file and inflate state to start there */
+ strm.zalloc = Z_NULL;
+ strm.zfree = Z_NULL;
+ strm.opaque = Z_NULL;
+ strm.avail_in = 0;
+ strm.next_in = Z_NULL;
+ ret = inflateInit2(&strm, -15); /* raw inflate */
+ if (ret != Z_OK)
+ return ret;
+ ret = fseeko(in, here->in - (here->bits ? 1 : 0), SEEK_SET);
+ if (ret == -1)
+ goto extract_ret;
+ if (here->bits) {
+ ret = getc(in);
+ if (ret == -1) {
+ ret = ferror(in) ? Z_ERRNO : Z_DATA_ERROR;
+ goto extract_ret;
+ }
+ (void)inflatePrime(&strm, here->bits, ret >> (8 - here->bits));
+ }
+ (void)inflateSetDictionary(&strm, here->window, WINSIZE);
+
+ /* skip uncompressed bytes until offset reached, then satisfy request */
+ offset -= here->out;
+ strm.avail_in = 0;
+ skip = 1; /* while skipping to offset */
+ do {
+ /* define where to put uncompressed data, and how much */
+ if (offset == 0 && skip) { /* at offset now */
+ strm.avail_out = len;
+ strm.next_out = buf;
+ skip = 0; /* only do this once */
+ }
+ if (offset > WINSIZE) { /* skip WINSIZE bytes */
+ strm.avail_out = WINSIZE;
+ strm.next_out = discard;
+ offset -= WINSIZE;
+ }
+ else if (offset != 0) { /* last skip */
+ strm.avail_out = (unsigned)offset;
+ strm.next_out = discard;
+ offset = 0;
+ }
+
+ /* uncompress until avail_out filled, or end of stream */
+ do {
+ if (strm.avail_in == 0) {
+ strm.avail_in = fread(input, 1, CHUNK, in);
+ if (ferror(in)) {
+ ret = Z_ERRNO;
+ goto extract_ret;
+ }
+ if (strm.avail_in == 0) {
+ ret = Z_DATA_ERROR;
+ goto extract_ret;
+ }
+ strm.next_in = input;
+ }
+ ret = inflate(&strm, Z_NO_FLUSH); /* normal inflate */
+ if (ret == Z_NEED_DICT)
+ ret = Z_DATA_ERROR;
+ if (ret == Z_MEM_ERROR || ret == Z_DATA_ERROR)
+ goto extract_ret;
+ if (ret == Z_STREAM_END)
+ break;
+ } while (strm.avail_out != 0);
+
+ /* if reach end of stream, then don't keep trying to get more */
+ if (ret == Z_STREAM_END)
+ break;
+
+ /* do until offset reached and requested data read, or stream ends */
+ } while (skip);
+
+ /* compute number of uncompressed bytes read after offset */
+ ret = skip ? 0 : len - strm.avail_out;
+
+ /* clean up and return bytes read or error */
+ extract_ret:
+ (void)inflateEnd(&strm);
+ return ret;
+}
+
+/* Demonstrate the use of build_index() and extract() by processing the file
+ provided on the command line, and the extracting 16K from about 2/3rds of
+ the way through the uncompressed output, and writing that to stdout. */
+int main(int argc, char **argv)
+{
+ int len;
+ off_t offset;
+ FILE *in;
+ struct access *index = NULL;
+ unsigned char buf[CHUNK];
+
+ /* open input file */
+ if (argc != 2) {
+ fprintf(stderr, "usage: zran file.gz\n");
+ return 1;
+ }
+ in = fopen(argv[1], "rb");
+ if (in == NULL) {
+ fprintf(stderr, "zran: could not open %s for reading\n", argv[1]);
+ return 1;
+ }
+
+ /* build index */
+ len = build_index(in, SPAN, &index);
+ if (len < 0) {
+ fclose(in);
+ switch (len) {
+ case Z_MEM_ERROR:
+ fprintf(stderr, "zran: out of memory\n");
+ break;
+ case Z_DATA_ERROR:
+ fprintf(stderr, "zran: compressed data error in %s\n", argv[1]);
+ break;
+ case Z_ERRNO:
+ fprintf(stderr, "zran: read error on %s\n", argv[1]);
+ break;
+ default:
+ fprintf(stderr, "zran: error %d while building index\n", len);
+ }
+ return 1;
+ }
+ fprintf(stderr, "zran: built index with %d access points\n", len);
+
+ /* use index by reading some bytes from an arbitrary offset */
+ offset = (index->list[index->have - 1].out << 1) / 3;
+ len = extract(in, index, offset, buf, CHUNK);
+ if (len < 0)
+ fprintf(stderr, "zran: extraction failed: %s error\n",
+ len == Z_MEM_ERROR ? "out of memory" : "input corrupted");
+ else {
+ fwrite(buf, 1, len, stdout);
+ fprintf(stderr, "zran: extracted %d bytes at %llu\n", len, offset);
+ }
+
+ /* clean up and exit */
+ free_index(index);
+ fclose(in);
+ return 0;
+}
diff --git a/protocols/Telegram/tgl/zlib/gzclose.c b/protocols/Telegram/tgl/zlib/gzclose.c
new file mode 100644
index 0000000000..caeb99a317
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/gzclose.c
@@ -0,0 +1,25 @@
+/* gzclose.c -- zlib gzclose() function
+ * Copyright (C) 2004, 2010 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "gzguts.h"
+
+/* gzclose() is in a separate file so that it is linked in only if it is used.
+ That way the other gzclose functions can be used instead to avoid linking in
+ unneeded compression or decompression routines. */
+int ZEXPORT gzclose(file)
+ gzFile file;
+{
+#ifndef NO_GZCOMPRESS
+ gz_statep state;
+
+ if (file == NULL)
+ return Z_STREAM_ERROR;
+ state = (gz_statep)file;
+
+ return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file);
+#else
+ return gzclose_r(file);
+#endif
+}
diff --git a/protocols/Telegram/tgl/zlib/gzguts.h b/protocols/Telegram/tgl/zlib/gzguts.h
new file mode 100644
index 0000000000..d87659d031
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/gzguts.h
@@ -0,0 +1,209 @@
+/* gzguts.h -- zlib internal header definitions for gz* operations
+ * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#ifdef _LARGEFILE64_SOURCE
+# ifndef _LARGEFILE_SOURCE
+# define _LARGEFILE_SOURCE 1
+# endif
+# ifdef _FILE_OFFSET_BITS
+# undef _FILE_OFFSET_BITS
+# endif
+#endif
+
+#ifdef HAVE_HIDDEN
+# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
+#else
+# define ZLIB_INTERNAL
+#endif
+
+#include <stdio.h>
+#include "zlib.h"
+#ifdef STDC
+# include <string.h>
+# include <stdlib.h>
+# include <limits.h>
+#endif
+#include <fcntl.h>
+
+#ifdef _WIN32
+# include <stddef.h>
+#endif
+
+#if defined(__TURBOC__) || defined(_MSC_VER) || defined(_WIN32)
+# include <io.h>
+#endif
+
+#ifdef WINAPI_FAMILY
+# define open _open
+# define read _read
+# define write _write
+# define close _close
+#endif
+
+#ifdef NO_DEFLATE /* for compatibility with old definition */
+# define NO_GZCOMPRESS
+#endif
+
+#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550)
+# ifndef HAVE_VSNPRINTF
+# define HAVE_VSNPRINTF
+# endif
+#endif
+
+#if defined(__CYGWIN__)
+# ifndef HAVE_VSNPRINTF
+# define HAVE_VSNPRINTF
+# endif
+#endif
+
+#if defined(MSDOS) && defined(__BORLANDC__) && (BORLANDC > 0x410)
+# ifndef HAVE_VSNPRINTF
+# define HAVE_VSNPRINTF
+# endif
+#endif
+
+#ifndef HAVE_VSNPRINTF
+# ifdef MSDOS
+/* vsnprintf may exist on some MS-DOS compilers (DJGPP?),
+ but for now we just assume it doesn't. */
+# define NO_vsnprintf
+# endif
+# ifdef __TURBOC__
+# define NO_vsnprintf
+# endif
+# ifdef WIN32
+/* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
+# if !defined(vsnprintf) && !defined(NO_vsnprintf)
+# if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 )
+# define vsnprintf _vsnprintf
+# endif
+# endif
+# endif
+# ifdef __SASC
+# define NO_vsnprintf
+# endif
+# ifdef VMS
+# define NO_vsnprintf
+# endif
+# ifdef __OS400__
+# define NO_vsnprintf
+# endif
+# ifdef __MVS__
+# define NO_vsnprintf
+# endif
+#endif
+
+/* unlike snprintf (which is required in C99, yet still not supported by
+ Microsoft more than a decade later!), _snprintf does not guarantee null
+ termination of the result -- however this is only used in gzlib.c where
+ the result is assured to fit in the space provided */
+#ifdef _MSC_VER
+# define snprintf _snprintf
+#endif
+
+#ifndef local
+# define local static
+#endif
+/* compile with -Dlocal if your debugger can't find static symbols */
+
+/* gz* functions always use library allocation functions */
+#ifndef STDC
+ extern voidp malloc OF((uInt size));
+ extern void free OF((voidpf ptr));
+#endif
+
+/* get errno and strerror definition */
+#if defined UNDER_CE
+# include <windows.h>
+# define zstrerror() gz_strwinerror((DWORD)GetLastError())
+#else
+# ifndef NO_STRERROR
+# include <errno.h>
+# define zstrerror() strerror(errno)
+# else
+# define zstrerror() "stdio error (consult errno)"
+# endif
+#endif
+
+/* provide prototypes for these when building zlib without LFS */
+#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0
+ ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+ ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
+ ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
+ ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
+#endif
+
+/* default memLevel */
+#if MAX_MEM_LEVEL >= 8
+# define DEF_MEM_LEVEL 8
+#else
+# define DEF_MEM_LEVEL MAX_MEM_LEVEL
+#endif
+
+/* default i/o buffer size -- double this for output when reading (this and
+ twice this must be able to fit in an unsigned type) */
+#define GZBUFSIZE 8192
+
+/* gzip modes, also provide a little integrity check on the passed structure */
+#define GZ_NONE 0
+#define GZ_READ 7247
+#define GZ_WRITE 31153
+#define GZ_APPEND 1 /* mode set to GZ_WRITE after the file is opened */
+
+/* values for gz_state how */
+#define LOOK 0 /* look for a gzip header */
+#define COPY 1 /* copy input directly */
+#define GZIP 2 /* decompress a gzip stream */
+
+/* internal gzip file state data structure */
+typedef struct {
+ /* exposed contents for gzgetc() macro */
+ struct gzFile_s x; /* "x" for exposed */
+ /* x.have: number of bytes available at x.next */
+ /* x.next: next output data to deliver or write */
+ /* x.pos: current position in uncompressed data */
+ /* used for both reading and writing */
+ int mode; /* see gzip modes above */
+ int fd; /* file descriptor */
+ char *path; /* path or fd for error messages */
+ unsigned size; /* buffer size, zero if not allocated yet */
+ unsigned want; /* requested buffer size, default is GZBUFSIZE */
+ unsigned char *in; /* input buffer */
+ unsigned char *out; /* output buffer (double-sized when reading) */
+ int direct; /* 0 if processing gzip, 1 if transparent */
+ /* just for reading */
+ int how; /* 0: get header, 1: copy, 2: decompress */
+ z_off64_t start; /* where the gzip data started, for rewinding */
+ int eof; /* true if end of input file reached */
+ int past; /* true if read requested past end */
+ /* just for writing */
+ int level; /* compression level */
+ int strategy; /* compression strategy */
+ /* seek request */
+ z_off64_t skip; /* amount to skip (already rewound if backwards) */
+ int seek; /* true if seek request pending */
+ /* error information */
+ int err; /* error code */
+ char *msg; /* error message */
+ /* zlib inflate or deflate stream */
+ z_stream strm; /* stream structure in-place (not a pointer) */
+} gz_state;
+typedef gz_state FAR *gz_statep;
+
+/* shared functions */
+void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *));
+#if defined UNDER_CE
+char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error));
+#endif
+
+/* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t
+ value -- needed when comparing unsigned to z_off64_t, which is signed
+ (possible z_off64_t types off_t, off64_t, and long are all signed) */
+#ifdef INT_MAX
+# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX)
+#else
+unsigned ZLIB_INTERNAL gz_intmax OF((void));
+# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax())
+#endif
diff --git a/protocols/Telegram/tgl/zlib/gzlib.c b/protocols/Telegram/tgl/zlib/gzlib.c
new file mode 100644
index 0000000000..fae202ef89
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/gzlib.c
@@ -0,0 +1,634 @@
+/* gzlib.c -- zlib functions common to reading and writing gzip files
+ * Copyright (C) 2004, 2010, 2011, 2012, 2013 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "gzguts.h"
+
+#if defined(_WIN32) && !defined(__BORLANDC__)
+# define LSEEK _lseeki64
+#else
+#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
+# define LSEEK lseek64
+#else
+# define LSEEK lseek
+#endif
+#endif
+
+/* Local functions */
+local void gz_reset OF((gz_statep));
+local gzFile gz_open OF((const void *, int, const char *));
+
+#if defined UNDER_CE
+
+/* Map the Windows error number in ERROR to a locale-dependent error message
+ string and return a pointer to it. Typically, the values for ERROR come
+ from GetLastError.
+
+ The string pointed to shall not be modified by the application, but may be
+ overwritten by a subsequent call to gz_strwinerror
+
+ The gz_strwinerror function does not change the current setting of
+ GetLastError. */
+char ZLIB_INTERNAL *gz_strwinerror (error)
+ DWORD error;
+{
+ static char buf[1024];
+
+ wchar_t *msgbuf;
+ DWORD lasterr = GetLastError();
+ DWORD chars = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM
+ | FORMAT_MESSAGE_ALLOCATE_BUFFER,
+ NULL,
+ error,
+ 0, /* Default language */
+ (LPVOID)&msgbuf,
+ 0,
+ NULL);
+ if (chars != 0) {
+ /* If there is an \r\n appended, zap it. */
+ if (chars >= 2
+ && msgbuf[chars - 2] == '\r' && msgbuf[chars - 1] == '\n') {
+ chars -= 2;
+ msgbuf[chars] = 0;
+ }
+
+ if (chars > sizeof (buf) - 1) {
+ chars = sizeof (buf) - 1;
+ msgbuf[chars] = 0;
+ }
+
+ wcstombs(buf, msgbuf, chars + 1);
+ LocalFree(msgbuf);
+ }
+ else {
+ sprintf(buf, "unknown win32 error (%ld)", error);
+ }
+
+ SetLastError(lasterr);
+ return buf;
+}
+
+#endif /* UNDER_CE */
+
+/* Reset gzip file state */
+local void gz_reset(state)
+ gz_statep state;
+{
+ state->x.have = 0; /* no output data available */
+ if (state->mode == GZ_READ) { /* for reading ... */
+ state->eof = 0; /* not at end of file */
+ state->past = 0; /* have not read past end yet */
+ state->how = LOOK; /* look for gzip header */
+ }
+ state->seek = 0; /* no seek request pending */
+ gz_error(state, Z_OK, NULL); /* clear error */
+ state->x.pos = 0; /* no uncompressed data yet */
+ state->strm.avail_in = 0; /* no input data yet */
+}
+
+/* Open a gzip file either by name or file descriptor. */
+local gzFile gz_open(path, fd, mode)
+ const void *path;
+ int fd;
+ const char *mode;
+{
+ gz_statep state;
+ size_t len;
+ int oflag;
+#ifdef O_CLOEXEC
+ int cloexec = 0;
+#endif
+#ifdef O_EXCL
+ int exclusive = 0;
+#endif
+
+ /* check input */
+ if (path == NULL)
+ return NULL;
+
+ /* allocate gzFile structure to return */
+ state = (gz_statep)malloc(sizeof(gz_state));
+ if (state == NULL)
+ return NULL;
+ state->size = 0; /* no buffers allocated yet */
+ state->want = GZBUFSIZE; /* requested buffer size */
+ state->msg = NULL; /* no error message yet */
+
+ /* interpret mode */
+ state->mode = GZ_NONE;
+ state->level = Z_DEFAULT_COMPRESSION;
+ state->strategy = Z_DEFAULT_STRATEGY;
+ state->direct = 0;
+ while (*mode) {
+ if (*mode >= '0' && *mode <= '9')
+ state->level = *mode - '0';
+ else
+ switch (*mode) {
+ case 'r':
+ state->mode = GZ_READ;
+ break;
+#ifndef NO_GZCOMPRESS
+ case 'w':
+ state->mode = GZ_WRITE;
+ break;
+ case 'a':
+ state->mode = GZ_APPEND;
+ break;
+#endif
+ case '+': /* can't read and write at the same time */
+ free(state);
+ return NULL;
+ case 'b': /* ignore -- will request binary anyway */
+ break;
+#ifdef O_CLOEXEC
+ case 'e':
+ cloexec = 1;
+ break;
+#endif
+#ifdef O_EXCL
+ case 'x':
+ exclusive = 1;
+ break;
+#endif
+ case 'f':
+ state->strategy = Z_FILTERED;
+ break;
+ case 'h':
+ state->strategy = Z_HUFFMAN_ONLY;
+ break;
+ case 'R':
+ state->strategy = Z_RLE;
+ break;
+ case 'F':
+ state->strategy = Z_FIXED;
+ break;
+ case 'T':
+ state->direct = 1;
+ break;
+ default: /* could consider as an error, but just ignore */
+ ;
+ }
+ mode++;
+ }
+
+ /* must provide an "r", "w", or "a" */
+ if (state->mode == GZ_NONE) {
+ free(state);
+ return NULL;
+ }
+
+ /* can't force transparent read */
+ if (state->mode == GZ_READ) {
+ if (state->direct) {
+ free(state);
+ return NULL;
+ }
+ state->direct = 1; /* for empty file */
+ }
+
+ /* save the path name for error messages */
+#ifdef _WIN32
+ if (fd == -2) {
+ len = wcstombs(NULL, path, 0);
+ if (len == (size_t)-1)
+ len = 0;
+ }
+ else
+#endif
+ len = strlen((const char *)path);
+ state->path = (char *)malloc(len + 1);
+ if (state->path == NULL) {
+ free(state);
+ return NULL;
+ }
+#ifdef _WIN32
+ if (fd == -2)
+ if (len)
+ wcstombs(state->path, path, len + 1);
+ else
+ *(state->path) = 0;
+ else
+#endif
+#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
+ snprintf(state->path, len + 1, "%s", (const char *)path);
+#else
+ strcpy(state->path, path);
+#endif
+
+ /* compute the flags for open() */
+ oflag =
+#ifdef O_LARGEFILE
+ O_LARGEFILE |
+#endif
+#ifdef O_BINARY
+ O_BINARY |
+#endif
+#ifdef O_CLOEXEC
+ (cloexec ? O_CLOEXEC : 0) |
+#endif
+ (state->mode == GZ_READ ?
+ O_RDONLY :
+ (O_WRONLY | O_CREAT |
+#ifdef O_EXCL
+ (exclusive ? O_EXCL : 0) |
+#endif
+ (state->mode == GZ_WRITE ?
+ O_TRUNC :
+ O_APPEND)));
+
+ /* open the file with the appropriate flags (or just use fd) */
+ state->fd = fd > -1 ? fd : (
+#ifdef _WIN32
+ fd == -2 ? _wopen(path, oflag, 0666) :
+#endif
+ open((const char *)path, oflag, 0666));
+ if (state->fd == -1) {
+ free(state->path);
+ free(state);
+ return NULL;
+ }
+ if (state->mode == GZ_APPEND)
+ state->mode = GZ_WRITE; /* simplify later checks */
+
+ /* save the current position for rewinding (only if reading) */
+ if (state->mode == GZ_READ) {
+ state->start = LSEEK(state->fd, 0, SEEK_CUR);
+ if (state->start == -1) state->start = 0;
+ }
+
+ /* initialize stream */
+ gz_reset(state);
+
+ /* return stream */
+ return (gzFile)state;
+}
+
+/* -- see zlib.h -- */
+gzFile ZEXPORT gzopen(path, mode)
+ const char *path;
+ const char *mode;
+{
+ return gz_open(path, -1, mode);
+}
+
+/* -- see zlib.h -- */
+gzFile ZEXPORT gzopen64(path, mode)
+ const char *path;
+ const char *mode;
+{
+ return gz_open(path, -1, mode);
+}
+
+/* -- see zlib.h -- */
+gzFile ZEXPORT gzdopen(fd, mode)
+ int fd;
+ const char *mode;
+{
+ char *path; /* identifier for error messages */
+ gzFile gz;
+
+ if (fd == -1 || (path = (char *)malloc(7 + 3 * sizeof(int))) == NULL)
+ return NULL;
+#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
+ snprintf(path, 7 + 3 * sizeof(int), "<fd:%d>", fd); /* for debugging */
+#else
+ sprintf(path, "<fd:%d>", fd); /* for debugging */
+#endif
+ gz = gz_open(path, fd, mode);
+ free(path);
+ return gz;
+}
+
+/* -- see zlib.h -- */
+#ifdef _WIN32
+gzFile ZEXPORT gzopen_w(path, mode)
+ const wchar_t *path;
+ const char *mode;
+{
+ return gz_open(path, -2, mode);
+}
+#endif
+
+/* -- see zlib.h -- */
+int ZEXPORT gzbuffer(file, size)
+ gzFile file;
+ unsigned size;
+{
+ gz_statep state;
+
+ /* get internal structure and check integrity */
+ if (file == NULL)
+ return -1;
+ state = (gz_statep)file;
+ if (state->mode != GZ_READ && state->mode != GZ_WRITE)
+ return -1;
+
+ /* make sure we haven't already allocated memory */
+ if (state->size != 0)
+ return -1;
+
+ /* check and set requested size */
+ if (size < 2)
+ size = 2; /* need two bytes to check magic header */
+ state->want = size;
+ return 0;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzrewind(file)
+ gzFile file;
+{
+ gz_statep state;
+
+ /* get internal structure */
+ if (file == NULL)
+ return -1;
+ state = (gz_statep)file;
+
+ /* check that we're reading and that there's no error */
+ if (state->mode != GZ_READ ||
+ (state->err != Z_OK && state->err != Z_BUF_ERROR))
+ return -1;
+
+ /* back up and start over */
+ if (LSEEK(state->fd, state->start, SEEK_SET) == -1)
+ return -1;
+ gz_reset(state);
+ return 0;
+}
+
+/* -- see zlib.h -- */
+z_off64_t ZEXPORT gzseek64(file, offset, whence)
+ gzFile file;
+ z_off64_t offset;
+ int whence;
+{
+ unsigned n;
+ z_off64_t ret;
+ gz_statep state;
+
+ /* get internal structure and check integrity */
+ if (file == NULL)
+ return -1;
+ state = (gz_statep)file;
+ if (state->mode != GZ_READ && state->mode != GZ_WRITE)
+ return -1;
+
+ /* check that there's no error */
+ if (state->err != Z_OK && state->err != Z_BUF_ERROR)
+ return -1;
+
+ /* can only seek from start or relative to current position */
+ if (whence != SEEK_SET && whence != SEEK_CUR)
+ return -1;
+
+ /* normalize offset to a SEEK_CUR specification */
+ if (whence == SEEK_SET)
+ offset -= state->x.pos;
+ else if (state->seek)
+ offset += state->skip;
+ state->seek = 0;
+
+ /* if within raw area while reading, just go there */
+ if (state->mode == GZ_READ && state->how == COPY &&
+ state->x.pos + offset >= 0) {
+ ret = LSEEK(state->fd, offset - state->x.have, SEEK_CUR);
+ if (ret == -1)
+ return -1;
+ state->x.have = 0;
+ state->eof = 0;
+ state->past = 0;
+ state->seek = 0;
+ gz_error(state, Z_OK, NULL);
+ state->strm.avail_in = 0;
+ state->x.pos += offset;
+ return state->x.pos;
+ }
+
+ /* calculate skip amount, rewinding if needed for back seek when reading */
+ if (offset < 0) {
+ if (state->mode != GZ_READ) /* writing -- can't go backwards */
+ return -1;
+ offset += state->x.pos;
+ if (offset < 0) /* before start of file! */
+ return -1;
+ if (gzrewind(file) == -1) /* rewind, then skip to offset */
+ return -1;
+ }
+
+ /* if reading, skip what's in output buffer (one less gzgetc() check) */
+ if (state->mode == GZ_READ) {
+ n = GT_OFF(state->x.have) || (z_off64_t)state->x.have > offset ?
+ (unsigned)offset : state->x.have;
+ state->x.have -= n;
+ state->x.next += n;
+ state->x.pos += n;
+ offset -= n;
+ }
+
+ /* request skip (if not zero) */
+ if (offset) {
+ state->seek = 1;
+ state->skip = offset;
+ }
+ return state->x.pos + offset;
+}
+
+/* -- see zlib.h -- */
+z_off_t ZEXPORT gzseek(file, offset, whence)
+ gzFile file;
+ z_off_t offset;
+ int whence;
+{
+ z_off64_t ret;
+
+ ret = gzseek64(file, (z_off64_t)offset, whence);
+ return ret == (z_off_t)ret ? (z_off_t)ret : -1;
+}
+
+/* -- see zlib.h -- */
+z_off64_t ZEXPORT gztell64(file)
+ gzFile file;
+{
+ gz_statep state;
+
+ /* get internal structure and check integrity */
+ if (file == NULL)
+ return -1;
+ state = (gz_statep)file;
+ if (state->mode != GZ_READ && state->mode != GZ_WRITE)
+ return -1;
+
+ /* return position */
+ return state->x.pos + (state->seek ? state->skip : 0);
+}
+
+/* -- see zlib.h -- */
+z_off_t ZEXPORT gztell(file)
+ gzFile file;
+{
+ z_off64_t ret;
+
+ ret = gztell64(file);
+ return ret == (z_off_t)ret ? (z_off_t)ret : -1;
+}
+
+/* -- see zlib.h -- */
+z_off64_t ZEXPORT gzoffset64(file)
+ gzFile file;
+{
+ z_off64_t offset;
+ gz_statep state;
+
+ /* get internal structure and check integrity */
+ if (file == NULL)
+ return -1;
+ state = (gz_statep)file;
+ if (state->mode != GZ_READ && state->mode != GZ_WRITE)
+ return -1;
+
+ /* compute and return effective offset in file */
+ offset = LSEEK(state->fd, 0, SEEK_CUR);
+ if (offset == -1)
+ return -1;
+ if (state->mode == GZ_READ) /* reading */
+ offset -= state->strm.avail_in; /* don't count buffered input */
+ return offset;
+}
+
+/* -- see zlib.h -- */
+z_off_t ZEXPORT gzoffset(file)
+ gzFile file;
+{
+ z_off64_t ret;
+
+ ret = gzoffset64(file);
+ return ret == (z_off_t)ret ? (z_off_t)ret : -1;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzeof(file)
+ gzFile file;
+{
+ gz_statep state;
+
+ /* get internal structure and check integrity */
+ if (file == NULL)
+ return 0;
+ state = (gz_statep)file;
+ if (state->mode != GZ_READ && state->mode != GZ_WRITE)
+ return 0;
+
+ /* return end-of-file state */
+ return state->mode == GZ_READ ? state->past : 0;
+}
+
+/* -- see zlib.h -- */
+const char * ZEXPORT gzerror(file, errnum)
+ gzFile file;
+ int *errnum;
+{
+ gz_statep state;
+
+ /* get internal structure and check integrity */
+ if (file == NULL)
+ return NULL;
+ state = (gz_statep)file;
+ if (state->mode != GZ_READ && state->mode != GZ_WRITE)
+ return NULL;
+
+ /* return error information */
+ if (errnum != NULL)
+ *errnum = state->err;
+ return state->err == Z_MEM_ERROR ? "out of memory" :
+ (state->msg == NULL ? "" : state->msg);
+}
+
+/* -- see zlib.h -- */
+void ZEXPORT gzclearerr(file)
+ gzFile file;
+{
+ gz_statep state;
+
+ /* get internal structure and check integrity */
+ if (file == NULL)
+ return;
+ state = (gz_statep)file;
+ if (state->mode != GZ_READ && state->mode != GZ_WRITE)
+ return;
+
+ /* clear error and end-of-file */
+ if (state->mode == GZ_READ) {
+ state->eof = 0;
+ state->past = 0;
+ }
+ gz_error(state, Z_OK, NULL);
+}
+
+/* Create an error message in allocated memory and set state->err and
+ state->msg accordingly. Free any previous error message already there. Do
+ not try to free or allocate space if the error is Z_MEM_ERROR (out of
+ memory). Simply save the error message as a static string. If there is an
+ allocation failure constructing the error message, then convert the error to
+ out of memory. */
+void ZLIB_INTERNAL gz_error(state, err, msg)
+ gz_statep state;
+ int err;
+ const char *msg;
+{
+ /* free previously allocated message and clear */
+ if (state->msg != NULL) {
+ if (state->err != Z_MEM_ERROR)
+ free(state->msg);
+ state->msg = NULL;
+ }
+
+ /* if fatal, set state->x.have to 0 so that the gzgetc() macro fails */
+ if (err != Z_OK && err != Z_BUF_ERROR)
+ state->x.have = 0;
+
+ /* set error code, and if no message, then done */
+ state->err = err;
+ if (msg == NULL)
+ return;
+
+ /* for an out of memory error, return literal string when requested */
+ if (err == Z_MEM_ERROR)
+ return;
+
+ /* construct error message with path */
+ if ((state->msg = (char *)malloc(strlen(state->path) + strlen(msg) + 3)) ==
+ NULL) {
+ state->err = Z_MEM_ERROR;
+ return;
+ }
+#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
+ snprintf(state->msg, strlen(state->path) + strlen(msg) + 3,
+ "%s%s%s", state->path, ": ", msg);
+#else
+ strcpy(state->msg, state->path);
+ strcat(state->msg, ": ");
+ strcat(state->msg, msg);
+#endif
+ return;
+}
+
+#ifndef INT_MAX
+/* portably return maximum value for an int (when limits.h presumed not
+ available) -- we need to do this to cover cases where 2's complement not
+ used, since C standard permits 1's complement and sign-bit representations,
+ otherwise we could just use ((unsigned)-1) >> 1 */
+unsigned ZLIB_INTERNAL gz_intmax()
+{
+ unsigned p, q;
+
+ p = 1;
+ do {
+ q = p;
+ p <<= 1;
+ p++;
+ } while (p > q);
+ return q >> 1;
+}
+#endif
diff --git a/protocols/Telegram/tgl/zlib/gzread.c b/protocols/Telegram/tgl/zlib/gzread.c
new file mode 100644
index 0000000000..bf4538eb27
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/gzread.c
@@ -0,0 +1,594 @@
+/* gzread.c -- zlib functions for reading gzip files
+ * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "gzguts.h"
+
+/* Local functions */
+local int gz_load OF((gz_statep, unsigned char *, unsigned, unsigned *));
+local int gz_avail OF((gz_statep));
+local int gz_look OF((gz_statep));
+local int gz_decomp OF((gz_statep));
+local int gz_fetch OF((gz_statep));
+local int gz_skip OF((gz_statep, z_off64_t));
+
+/* Use read() to load a buffer -- return -1 on error, otherwise 0. Read from
+ state->fd, and update state->eof, state->err, and state->msg as appropriate.
+ This function needs to loop on read(), since read() is not guaranteed to
+ read the number of bytes requested, depending on the type of descriptor. */
+local int gz_load(state, buf, len, have)
+ gz_statep state;
+ unsigned char *buf;
+ unsigned len;
+ unsigned *have;
+{
+ int ret;
+
+ *have = 0;
+ do {
+ ret = read(state->fd, buf + *have, len - *have);
+ if (ret <= 0)
+ break;
+ *have += ret;
+ } while (*have < len);
+ if (ret < 0) {
+ gz_error(state, Z_ERRNO, zstrerror());
+ return -1;
+ }
+ if (ret == 0)
+ state->eof = 1;
+ return 0;
+}
+
+/* Load up input buffer and set eof flag if last data loaded -- return -1 on
+ error, 0 otherwise. Note that the eof flag is set when the end of the input
+ file is reached, even though there may be unused data in the buffer. Once
+ that data has been used, no more attempts will be made to read the file.
+ If strm->avail_in != 0, then the current data is moved to the beginning of
+ the input buffer, and then the remainder of the buffer is loaded with the
+ available data from the input file. */
+local int gz_avail(state)
+ gz_statep state;
+{
+ unsigned got;
+ z_streamp strm = &(state->strm);
+
+ if (state->err != Z_OK && state->err != Z_BUF_ERROR)
+ return -1;
+ if (state->eof == 0) {
+ if (strm->avail_in) { /* copy what's there to the start */
+ unsigned char *p = state->in;
+ unsigned const char *q = strm->next_in;
+ unsigned n = strm->avail_in;
+ do {
+ *p++ = *q++;
+ } while (--n);
+ }
+ if (gz_load(state, state->in + strm->avail_in,
+ state->size - strm->avail_in, &got) == -1)
+ return -1;
+ strm->avail_in += got;
+ strm->next_in = state->in;
+ }
+ return 0;
+}
+
+/* Look for gzip header, set up for inflate or copy. state->x.have must be 0.
+ If this is the first time in, allocate required memory. state->how will be
+ left unchanged if there is no more input data available, will be set to COPY
+ if there is no gzip header and direct copying will be performed, or it will
+ be set to GZIP for decompression. If direct copying, then leftover input
+ data from the input buffer will be copied to the output buffer. In that
+ case, all further file reads will be directly to either the output buffer or
+ a user buffer. If decompressing, the inflate state will be initialized.
+ gz_look() will return 0 on success or -1 on failure. */
+local int gz_look(state)
+ gz_statep state;
+{
+ z_streamp strm = &(state->strm);
+
+ /* allocate read buffers and inflate memory */
+ if (state->size == 0) {
+ /* allocate buffers */
+ state->in = (unsigned char *)malloc(state->want);
+ state->out = (unsigned char *)malloc(state->want << 1);
+ if (state->in == NULL || state->out == NULL) {
+ if (state->out != NULL)
+ free(state->out);
+ if (state->in != NULL)
+ free(state->in);
+ gz_error(state, Z_MEM_ERROR, "out of memory");
+ return -1;
+ }
+ state->size = state->want;
+
+ /* allocate inflate memory */
+ state->strm.zalloc = Z_NULL;
+ state->strm.zfree = Z_NULL;
+ state->strm.opaque = Z_NULL;
+ state->strm.avail_in = 0;
+ state->strm.next_in = Z_NULL;
+ if (inflateInit2(&(state->strm), 15 + 16) != Z_OK) { /* gunzip */
+ free(state->out);
+ free(state->in);
+ state->size = 0;
+ gz_error(state, Z_MEM_ERROR, "out of memory");
+ return -1;
+ }
+ }
+
+ /* get at least the magic bytes in the input buffer */
+ if (strm->avail_in < 2) {
+ if (gz_avail(state) == -1)
+ return -1;
+ if (strm->avail_in == 0)
+ return 0;
+ }
+
+ /* look for gzip magic bytes -- if there, do gzip decoding (note: there is
+ a logical dilemma here when considering the case of a partially written
+ gzip file, to wit, if a single 31 byte is written, then we cannot tell
+ whether this is a single-byte file, or just a partially written gzip
+ file -- for here we assume that if a gzip file is being written, then
+ the header will be written in a single operation, so that reading a
+ single byte is sufficient indication that it is not a gzip file) */
+ if (strm->avail_in > 1 &&
+ strm->next_in[0] == 31 && strm->next_in[1] == 139) {
+ inflateReset(strm);
+ state->how = GZIP;
+ state->direct = 0;
+ return 0;
+ }
+
+ /* no gzip header -- if we were decoding gzip before, then this is trailing
+ garbage. Ignore the trailing garbage and finish. */
+ if (state->direct == 0) {
+ strm->avail_in = 0;
+ state->eof = 1;
+ state->x.have = 0;
+ return 0;
+ }
+
+ /* doing raw i/o, copy any leftover input to output -- this assumes that
+ the output buffer is larger than the input buffer, which also assures
+ space for gzungetc() */
+ state->x.next = state->out;
+ if (strm->avail_in) {
+ memcpy(state->x.next, strm->next_in, strm->avail_in);
+ state->x.have = strm->avail_in;
+ strm->avail_in = 0;
+ }
+ state->how = COPY;
+ state->direct = 1;
+ return 0;
+}
+
+/* Decompress from input to the provided next_out and avail_out in the state.
+ On return, state->x.have and state->x.next point to the just decompressed
+ data. If the gzip stream completes, state->how is reset to LOOK to look for
+ the next gzip stream or raw data, once state->x.have is depleted. Returns 0
+ on success, -1 on failure. */
+local int gz_decomp(state)
+ gz_statep state;
+{
+ int ret = Z_OK;
+ unsigned had;
+ z_streamp strm = &(state->strm);
+
+ /* fill output buffer up to end of deflate stream */
+ had = strm->avail_out;
+ do {
+ /* get more input for inflate() */
+ if (strm->avail_in == 0 && gz_avail(state) == -1)
+ return -1;
+ if (strm->avail_in == 0) {
+ gz_error(state, Z_BUF_ERROR, "unexpected end of file");
+ break;
+ }
+
+ /* decompress and handle errors */
+ ret = inflate(strm, Z_NO_FLUSH);
+ if (ret == Z_STREAM_ERROR || ret == Z_NEED_DICT) {
+ gz_error(state, Z_STREAM_ERROR,
+ "internal error: inflate stream corrupt");
+ return -1;
+ }
+ if (ret == Z_MEM_ERROR) {
+ gz_error(state, Z_MEM_ERROR, "out of memory");
+ return -1;
+ }
+ if (ret == Z_DATA_ERROR) { /* deflate stream invalid */
+ gz_error(state, Z_DATA_ERROR,
+ strm->msg == NULL ? "compressed data error" : strm->msg);
+ return -1;
+ }
+ } while (strm->avail_out && ret != Z_STREAM_END);
+
+ /* update available output */
+ state->x.have = had - strm->avail_out;
+ state->x.next = strm->next_out - state->x.have;
+
+ /* if the gzip stream completed successfully, look for another */
+ if (ret == Z_STREAM_END)
+ state->how = LOOK;
+
+ /* good decompression */
+ return 0;
+}
+
+/* Fetch data and put it in the output buffer. Assumes state->x.have is 0.
+ Data is either copied from the input file or decompressed from the input
+ file depending on state->how. If state->how is LOOK, then a gzip header is
+ looked for to determine whether to copy or decompress. Returns -1 on error,
+ otherwise 0. gz_fetch() will leave state->how as COPY or GZIP unless the
+ end of the input file has been reached and all data has been processed. */
+local int gz_fetch(state)
+ gz_statep state;
+{
+ z_streamp strm = &(state->strm);
+
+ do {
+ switch(state->how) {
+ case LOOK: /* -> LOOK, COPY (only if never GZIP), or GZIP */
+ if (gz_look(state) == -1)
+ return -1;
+ if (state->how == LOOK)
+ return 0;
+ break;
+ case COPY: /* -> COPY */
+ if (gz_load(state, state->out, state->size << 1, &(state->x.have))
+ == -1)
+ return -1;
+ state->x.next = state->out;
+ return 0;
+ case GZIP: /* -> GZIP or LOOK (if end of gzip stream) */
+ strm->avail_out = state->size << 1;
+ strm->next_out = state->out;
+ if (gz_decomp(state) == -1)
+ return -1;
+ }
+ } while (state->x.have == 0 && (!state->eof || strm->avail_in));
+ return 0;
+}
+
+/* Skip len uncompressed bytes of output. Return -1 on error, 0 on success. */
+local int gz_skip(state, len)
+ gz_statep state;
+ z_off64_t len;
+{
+ unsigned n;
+
+ /* skip over len bytes or reach end-of-file, whichever comes first */
+ while (len)
+ /* skip over whatever is in output buffer */
+ if (state->x.have) {
+ n = GT_OFF(state->x.have) || (z_off64_t)state->x.have > len ?
+ (unsigned)len : state->x.have;
+ state->x.have -= n;
+ state->x.next += n;
+ state->x.pos += n;
+ len -= n;
+ }
+
+ /* output buffer empty -- return if we're at the end of the input */
+ else if (state->eof && state->strm.avail_in == 0)
+ break;
+
+ /* need more data to skip -- load up output buffer */
+ else {
+ /* get more output, looking for header if required */
+ if (gz_fetch(state) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzread(file, buf, len)
+ gzFile file;
+ voidp buf;
+ unsigned len;
+{
+ unsigned got, n;
+ gz_statep state;
+ z_streamp strm;
+
+ /* get internal structure */
+ if (file == NULL)
+ return -1;
+ state = (gz_statep)file;
+ strm = &(state->strm);
+
+ /* check that we're reading and that there's no (serious) error */
+ if (state->mode != GZ_READ ||
+ (state->err != Z_OK && state->err != Z_BUF_ERROR))
+ return -1;
+
+ /* since an int is returned, make sure len fits in one, otherwise return
+ with an error (this avoids the flaw in the interface) */
+ if ((int)len < 0) {
+ gz_error(state, Z_DATA_ERROR, "requested length does not fit in int");
+ return -1;
+ }
+
+ /* if len is zero, avoid unnecessary operations */
+ if (len == 0)
+ return 0;
+
+ /* process a skip request */
+ if (state->seek) {
+ state->seek = 0;
+ if (gz_skip(state, state->skip) == -1)
+ return -1;
+ }
+
+ /* get len bytes to buf, or less than len if at the end */
+ got = 0;
+ do {
+ /* first just try copying data from the output buffer */
+ if (state->x.have) {
+ n = state->x.have > len ? len : state->x.have;
+ memcpy(buf, state->x.next, n);
+ state->x.next += n;
+ state->x.have -= n;
+ }
+
+ /* output buffer empty -- return if we're at the end of the input */
+ else if (state->eof && strm->avail_in == 0) {
+ state->past = 1; /* tried to read past end */
+ break;
+ }
+
+ /* need output data -- for small len or new stream load up our output
+ buffer */
+ else if (state->how == LOOK || len < (state->size << 1)) {
+ /* get more output, looking for header if required */
+ if (gz_fetch(state) == -1)
+ return -1;
+ continue; /* no progress yet -- go back to copy above */
+ /* the copy above assures that we will leave with space in the
+ output buffer, allowing at least one gzungetc() to succeed */
+ }
+
+ /* large len -- read directly into user buffer */
+ else if (state->how == COPY) { /* read directly */
+ if (gz_load(state, (unsigned char *)buf, len, &n) == -1)
+ return -1;
+ }
+
+ /* large len -- decompress directly into user buffer */
+ else { /* state->how == GZIP */
+ strm->avail_out = len;
+ strm->next_out = (unsigned char *)buf;
+ if (gz_decomp(state) == -1)
+ return -1;
+ n = state->x.have;
+ state->x.have = 0;
+ }
+
+ /* update progress */
+ len -= n;
+ buf = (char *)buf + n;
+ got += n;
+ state->x.pos += n;
+ } while (len);
+
+ /* return number of bytes read into user buffer (will fit in int) */
+ return (int)got;
+}
+
+/* -- see zlib.h -- */
+#ifdef Z_PREFIX_SET
+# undef z_gzgetc
+#else
+# undef gzgetc
+#endif
+int ZEXPORT gzgetc(file)
+ gzFile file;
+{
+ int ret;
+ unsigned char buf[1];
+ gz_statep state;
+
+ /* get internal structure */
+ if (file == NULL)
+ return -1;
+ state = (gz_statep)file;
+
+ /* check that we're reading and that there's no (serious) error */
+ if (state->mode != GZ_READ ||
+ (state->err != Z_OK && state->err != Z_BUF_ERROR))
+ return -1;
+
+ /* try output buffer (no need to check for skip request) */
+ if (state->x.have) {
+ state->x.have--;
+ state->x.pos++;
+ return *(state->x.next)++;
+ }
+
+ /* nothing there -- try gzread() */
+ ret = gzread(file, buf, 1);
+ return ret < 1 ? -1 : buf[0];
+}
+
+int ZEXPORT gzgetc_(file)
+gzFile file;
+{
+ return gzgetc(file);
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzungetc(c, file)
+ int c;
+ gzFile file;
+{
+ gz_statep state;
+
+ /* get internal structure */
+ if (file == NULL)
+ return -1;
+ state = (gz_statep)file;
+
+ /* check that we're reading and that there's no (serious) error */
+ if (state->mode != GZ_READ ||
+ (state->err != Z_OK && state->err != Z_BUF_ERROR))
+ return -1;
+
+ /* process a skip request */
+ if (state->seek) {
+ state->seek = 0;
+ if (gz_skip(state, state->skip) == -1)
+ return -1;
+ }
+
+ /* can't push EOF */
+ if (c < 0)
+ return -1;
+
+ /* if output buffer empty, put byte at end (allows more pushing) */
+ if (state->x.have == 0) {
+ state->x.have = 1;
+ state->x.next = state->out + (state->size << 1) - 1;
+ state->x.next[0] = c;
+ state->x.pos--;
+ state->past = 0;
+ return c;
+ }
+
+ /* if no room, give up (must have already done a gzungetc()) */
+ if (state->x.have == (state->size << 1)) {
+ gz_error(state, Z_DATA_ERROR, "out of room to push characters");
+ return -1;
+ }
+
+ /* slide output data if needed and insert byte before existing data */
+ if (state->x.next == state->out) {
+ unsigned char *src = state->out + state->x.have;
+ unsigned char *dest = state->out + (state->size << 1);
+ while (src > state->out)
+ *--dest = *--src;
+ state->x.next = dest;
+ }
+ state->x.have++;
+ state->x.next--;
+ state->x.next[0] = c;
+ state->x.pos--;
+ state->past = 0;
+ return c;
+}
+
+/* -- see zlib.h -- */
+char * ZEXPORT gzgets(file, buf, len)
+ gzFile file;
+ char *buf;
+ int len;
+{
+ unsigned left, n;
+ char *str;
+ unsigned char *eol;
+ gz_statep state;
+
+ /* check parameters and get internal structure */
+ if (file == NULL || buf == NULL || len < 1)
+ return NULL;
+ state = (gz_statep)file;
+
+ /* check that we're reading and that there's no (serious) error */
+ if (state->mode != GZ_READ ||
+ (state->err != Z_OK && state->err != Z_BUF_ERROR))
+ return NULL;
+
+ /* process a skip request */
+ if (state->seek) {
+ state->seek = 0;
+ if (gz_skip(state, state->skip) == -1)
+ return NULL;
+ }
+
+ /* copy output bytes up to new line or len - 1, whichever comes first --
+ append a terminating zero to the string (we don't check for a zero in
+ the contents, let the user worry about that) */
+ str = buf;
+ left = (unsigned)len - 1;
+ if (left) do {
+ /* assure that something is in the output buffer */
+ if (state->x.have == 0 && gz_fetch(state) == -1)
+ return NULL; /* error */
+ if (state->x.have == 0) { /* end of file */
+ state->past = 1; /* read past end */
+ break; /* return what we have */
+ }
+
+ /* look for end-of-line in current output buffer */
+ n = state->x.have > left ? left : state->x.have;
+ eol = (unsigned char *)memchr(state->x.next, '\n', n);
+ if (eol != NULL)
+ n = (unsigned)(eol - state->x.next) + 1;
+
+ /* copy through end-of-line, or remainder if not found */
+ memcpy(buf, state->x.next, n);
+ state->x.have -= n;
+ state->x.next += n;
+ state->x.pos += n;
+ left -= n;
+ buf += n;
+ } while (left && eol == NULL);
+
+ /* return terminated string, or if nothing, end of file */
+ if (buf == str)
+ return NULL;
+ buf[0] = 0;
+ return str;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzdirect(file)
+ gzFile file;
+{
+ gz_statep state;
+
+ /* get internal structure */
+ if (file == NULL)
+ return 0;
+ state = (gz_statep)file;
+
+ /* if the state is not known, but we can find out, then do so (this is
+ mainly for right after a gzopen() or gzdopen()) */
+ if (state->mode == GZ_READ && state->how == LOOK && state->x.have == 0)
+ (void)gz_look(state);
+
+ /* return 1 if transparent, 0 if processing a gzip stream */
+ return state->direct;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzclose_r(file)
+ gzFile file;
+{
+ int ret, err;
+ gz_statep state;
+
+ /* get internal structure */
+ if (file == NULL)
+ return Z_STREAM_ERROR;
+ state = (gz_statep)file;
+
+ /* check that we're reading */
+ if (state->mode != GZ_READ)
+ return Z_STREAM_ERROR;
+
+ /* free memory and close file */
+ if (state->size) {
+ inflateEnd(&(state->strm));
+ free(state->out);
+ free(state->in);
+ }
+ err = state->err == Z_BUF_ERROR ? Z_BUF_ERROR : Z_OK;
+ gz_error(state, Z_OK, NULL);
+ free(state->path);
+ ret = close(state->fd);
+ free(state);
+ return ret ? Z_ERRNO : err;
+}
diff --git a/protocols/Telegram/tgl/zlib/gzwrite.c b/protocols/Telegram/tgl/zlib/gzwrite.c
new file mode 100644
index 0000000000..aa767fbf63
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/gzwrite.c
@@ -0,0 +1,577 @@
+/* gzwrite.c -- zlib functions for writing gzip files
+ * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "gzguts.h"
+
+/* Local functions */
+local int gz_init OF((gz_statep));
+local int gz_comp OF((gz_statep, int));
+local int gz_zero OF((gz_statep, z_off64_t));
+
+/* Initialize state for writing a gzip file. Mark initialization by setting
+ state->size to non-zero. Return -1 on failure or 0 on success. */
+local int gz_init(state)
+ gz_statep state;
+{
+ int ret;
+ z_streamp strm = &(state->strm);
+
+ /* allocate input buffer */
+ state->in = (unsigned char *)malloc(state->want);
+ if (state->in == NULL) {
+ gz_error(state, Z_MEM_ERROR, "out of memory");
+ return -1;
+ }
+
+ /* only need output buffer and deflate state if compressing */
+ if (!state->direct) {
+ /* allocate output buffer */
+ state->out = (unsigned char *)malloc(state->want);
+ if (state->out == NULL) {
+ free(state->in);
+ gz_error(state, Z_MEM_ERROR, "out of memory");
+ return -1;
+ }
+
+ /* allocate deflate memory, set up for gzip compression */
+ strm->zalloc = Z_NULL;
+ strm->zfree = Z_NULL;
+ strm->opaque = Z_NULL;
+ ret = deflateInit2(strm, state->level, Z_DEFLATED,
+ MAX_WBITS + 16, DEF_MEM_LEVEL, state->strategy);
+ if (ret != Z_OK) {
+ free(state->out);
+ free(state->in);
+ gz_error(state, Z_MEM_ERROR, "out of memory");
+ return -1;
+ }
+ }
+
+ /* mark state as initialized */
+ state->size = state->want;
+
+ /* initialize write buffer if compressing */
+ if (!state->direct) {
+ strm->avail_out = state->size;
+ strm->next_out = state->out;
+ state->x.next = strm->next_out;
+ }
+ return 0;
+}
+
+/* Compress whatever is at avail_in and next_in and write to the output file.
+ Return -1 if there is an error writing to the output file, otherwise 0.
+ flush is assumed to be a valid deflate() flush value. If flush is Z_FINISH,
+ then the deflate() state is reset to start a new gzip stream. If gz->direct
+ is true, then simply write to the output file without compressing, and
+ ignore flush. */
+local int gz_comp(state, flush)
+ gz_statep state;
+ int flush;
+{
+ int ret, got;
+ unsigned have;
+ z_streamp strm = &(state->strm);
+
+ /* allocate memory if this is the first time through */
+ if (state->size == 0 && gz_init(state) == -1)
+ return -1;
+
+ /* write directly if requested */
+ if (state->direct) {
+ got = write(state->fd, strm->next_in, strm->avail_in);
+ if (got < 0 || (unsigned)got != strm->avail_in) {
+ gz_error(state, Z_ERRNO, zstrerror());
+ return -1;
+ }
+ strm->avail_in = 0;
+ return 0;
+ }
+
+ /* run deflate() on provided input until it produces no more output */
+ ret = Z_OK;
+ do {
+ /* write out current buffer contents if full, or if flushing, but if
+ doing Z_FINISH then don't write until we get to Z_STREAM_END */
+ if (strm->avail_out == 0 || (flush != Z_NO_FLUSH &&
+ (flush != Z_FINISH || ret == Z_STREAM_END))) {
+ have = (unsigned)(strm->next_out - state->x.next);
+ if (have && ((got = write(state->fd, state->x.next, have)) < 0 ||
+ (unsigned)got != have)) {
+ gz_error(state, Z_ERRNO, zstrerror());
+ return -1;
+ }
+ if (strm->avail_out == 0) {
+ strm->avail_out = state->size;
+ strm->next_out = state->out;
+ }
+ state->x.next = strm->next_out;
+ }
+
+ /* compress */
+ have = strm->avail_out;
+ ret = deflate(strm, flush);
+ if (ret == Z_STREAM_ERROR) {
+ gz_error(state, Z_STREAM_ERROR,
+ "internal error: deflate stream corrupt");
+ return -1;
+ }
+ have -= strm->avail_out;
+ } while (have);
+
+ /* if that completed a deflate stream, allow another to start */
+ if (flush == Z_FINISH)
+ deflateReset(strm);
+
+ /* all done, no errors */
+ return 0;
+}
+
+/* Compress len zeros to output. Return -1 on error, 0 on success. */
+local int gz_zero(state, len)
+ gz_statep state;
+ z_off64_t len;
+{
+ int first;
+ unsigned n;
+ z_streamp strm = &(state->strm);
+
+ /* consume whatever's left in the input buffer */
+ if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
+ return -1;
+
+ /* compress len zeros (len guaranteed > 0) */
+ first = 1;
+ while (len) {
+ n = GT_OFF(state->size) || (z_off64_t)state->size > len ?
+ (unsigned)len : state->size;
+ if (first) {
+ memset(state->in, 0, n);
+ first = 0;
+ }
+ strm->avail_in = n;
+ strm->next_in = state->in;
+ state->x.pos += n;
+ if (gz_comp(state, Z_NO_FLUSH) == -1)
+ return -1;
+ len -= n;
+ }
+ return 0;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzwrite(file, buf, len)
+ gzFile file;
+ voidpc buf;
+ unsigned len;
+{
+ unsigned put = len;
+ gz_statep state;
+ z_streamp strm;
+
+ /* get internal structure */
+ if (file == NULL)
+ return 0;
+ state = (gz_statep)file;
+ strm = &(state->strm);
+
+ /* check that we're writing and that there's no error */
+ if (state->mode != GZ_WRITE || state->err != Z_OK)
+ return 0;
+
+ /* since an int is returned, make sure len fits in one, otherwise return
+ with an error (this avoids the flaw in the interface) */
+ if ((int)len < 0) {
+ gz_error(state, Z_DATA_ERROR, "requested length does not fit in int");
+ return 0;
+ }
+
+ /* if len is zero, avoid unnecessary operations */
+ if (len == 0)
+ return 0;
+
+ /* allocate memory if this is the first time through */
+ if (state->size == 0 && gz_init(state) == -1)
+ return 0;
+
+ /* check for seek request */
+ if (state->seek) {
+ state->seek = 0;
+ if (gz_zero(state, state->skip) == -1)
+ return 0;
+ }
+
+ /* for small len, copy to input buffer, otherwise compress directly */
+ if (len < state->size) {
+ /* copy to input buffer, compress when full */
+ do {
+ unsigned have, copy;
+
+ if (strm->avail_in == 0)
+ strm->next_in = state->in;
+ have = (unsigned)((strm->next_in + strm->avail_in) - state->in);
+ copy = state->size - have;
+ if (copy > len)
+ copy = len;
+ memcpy(state->in + have, buf, copy);
+ strm->avail_in += copy;
+ state->x.pos += copy;
+ buf = (const char *)buf + copy;
+ len -= copy;
+ if (len && gz_comp(state, Z_NO_FLUSH) == -1)
+ return 0;
+ } while (len);
+ }
+ else {
+ /* consume whatever's left in the input buffer */
+ if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
+ return 0;
+
+ /* directly compress user buffer to file */
+ strm->avail_in = len;
+ strm->next_in = (z_const Bytef *)buf;
+ state->x.pos += len;
+ if (gz_comp(state, Z_NO_FLUSH) == -1)
+ return 0;
+ }
+
+ /* input was all buffered or compressed (put will fit in int) */
+ return (int)put;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzputc(file, c)
+ gzFile file;
+ int c;
+{
+ unsigned have;
+ unsigned char buf[1];
+ gz_statep state;
+ z_streamp strm;
+
+ /* get internal structure */
+ if (file == NULL)
+ return -1;
+ state = (gz_statep)file;
+ strm = &(state->strm);
+
+ /* check that we're writing and that there's no error */
+ if (state->mode != GZ_WRITE || state->err != Z_OK)
+ return -1;
+
+ /* check for seek request */
+ if (state->seek) {
+ state->seek = 0;
+ if (gz_zero(state, state->skip) == -1)
+ return -1;
+ }
+
+ /* try writing to input buffer for speed (state->size == 0 if buffer not
+ initialized) */
+ if (state->size) {
+ if (strm->avail_in == 0)
+ strm->next_in = state->in;
+ have = (unsigned)((strm->next_in + strm->avail_in) - state->in);
+ if (have < state->size) {
+ state->in[have] = c;
+ strm->avail_in++;
+ state->x.pos++;
+ return c & 0xff;
+ }
+ }
+
+ /* no room in buffer or not initialized, use gz_write() */
+ buf[0] = c;
+ if (gzwrite(file, buf, 1) != 1)
+ return -1;
+ return c & 0xff;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzputs(file, str)
+ gzFile file;
+ const char *str;
+{
+ int ret;
+ unsigned len;
+
+ /* write string */
+ len = (unsigned)strlen(str);
+ ret = gzwrite(file, str, len);
+ return ret == 0 && len != 0 ? -1 : ret;
+}
+
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
+#include <stdarg.h>
+
+/* -- see zlib.h -- */
+int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va)
+{
+ int size, len;
+ gz_statep state;
+ z_streamp strm;
+
+ /* get internal structure */
+ if (file == NULL)
+ return -1;
+ state = (gz_statep)file;
+ strm = &(state->strm);
+
+ /* check that we're writing and that there's no error */
+ if (state->mode != GZ_WRITE || state->err != Z_OK)
+ return 0;
+
+ /* make sure we have some buffer space */
+ if (state->size == 0 && gz_init(state) == -1)
+ return 0;
+
+ /* check for seek request */
+ if (state->seek) {
+ state->seek = 0;
+ if (gz_zero(state, state->skip) == -1)
+ return 0;
+ }
+
+ /* consume whatever's left in the input buffer */
+ if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
+ return 0;
+
+ /* do the printf() into the input buffer, put length in len */
+ size = (int)(state->size);
+ state->in[size - 1] = 0;
+#ifdef NO_vsnprintf
+# ifdef HAS_vsprintf_void
+ (void)vsprintf((char *)(state->in), format, va);
+ for (len = 0; len < size; len++)
+ if (state->in[len] == 0) break;
+# else
+ len = vsprintf((char *)(state->in), format, va);
+# endif
+#else
+# ifdef HAS_vsnprintf_void
+ (void)vsnprintf((char *)(state->in), size, format, va);
+ len = strlen((char *)(state->in));
+# else
+ len = vsnprintf((char *)(state->in), size, format, va);
+# endif
+#endif
+
+ /* check that printf() results fit in buffer */
+ if (len <= 0 || len >= (int)size || state->in[size - 1] != 0)
+ return 0;
+
+ /* update buffer and position, defer compression until needed */
+ strm->avail_in = (unsigned)len;
+ strm->next_in = state->in;
+ state->x.pos += len;
+ return len;
+}
+
+int ZEXPORTVA gzprintf(gzFile file, const char *format, ...)
+{
+ va_list va;
+ int ret;
+
+ va_start(va, format);
+ ret = gzvprintf(file, format, va);
+ va_end(va);
+ return ret;
+}
+
+#else /* !STDC && !Z_HAVE_STDARG_H */
+
+/* -- see zlib.h -- */
+int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
+ a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)
+ gzFile file;
+ const char *format;
+ int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
+ a11, a12, a13, a14, a15, a16, a17, a18, a19, a20;
+{
+ int size, len;
+ gz_statep state;
+ z_streamp strm;
+
+ /* get internal structure */
+ if (file == NULL)
+ return -1;
+ state = (gz_statep)file;
+ strm = &(state->strm);
+
+ /* check that can really pass pointer in ints */
+ if (sizeof(int) != sizeof(void *))
+ return 0;
+
+ /* check that we're writing and that there's no error */
+ if (state->mode != GZ_WRITE || state->err != Z_OK)
+ return 0;
+
+ /* make sure we have some buffer space */
+ if (state->size == 0 && gz_init(state) == -1)
+ return 0;
+
+ /* check for seek request */
+ if (state->seek) {
+ state->seek = 0;
+ if (gz_zero(state, state->skip) == -1)
+ return 0;
+ }
+
+ /* consume whatever's left in the input buffer */
+ if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
+ return 0;
+
+ /* do the printf() into the input buffer, put length in len */
+ size = (int)(state->size);
+ state->in[size - 1] = 0;
+#ifdef NO_snprintf
+# ifdef HAS_sprintf_void
+ sprintf((char *)(state->in), format, a1, a2, a3, a4, a5, a6, a7, a8,
+ a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
+ for (len = 0; len < size; len++)
+ if (state->in[len] == 0) break;
+# else
+ len = sprintf((char *)(state->in), format, a1, a2, a3, a4, a5, a6, a7, a8,
+ a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
+# endif
+#else
+# ifdef HAS_snprintf_void
+ snprintf((char *)(state->in), size, format, a1, a2, a3, a4, a5, a6, a7, a8,
+ a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
+ len = strlen((char *)(state->in));
+# else
+ len = snprintf((char *)(state->in), size, format, a1, a2, a3, a4, a5, a6,
+ a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18,
+ a19, a20);
+# endif
+#endif
+
+ /* check that printf() results fit in buffer */
+ if (len <= 0 || len >= (int)size || state->in[size - 1] != 0)
+ return 0;
+
+ /* update buffer and position, defer compression until needed */
+ strm->avail_in = (unsigned)len;
+ strm->next_in = state->in;
+ state->x.pos += len;
+ return len;
+}
+
+#endif
+
+/* -- see zlib.h -- */
+int ZEXPORT gzflush(file, flush)
+ gzFile file;
+ int flush;
+{
+ gz_statep state;
+
+ /* get internal structure */
+ if (file == NULL)
+ return -1;
+ state = (gz_statep)file;
+
+ /* check that we're writing and that there's no error */
+ if (state->mode != GZ_WRITE || state->err != Z_OK)
+ return Z_STREAM_ERROR;
+
+ /* check flush parameter */
+ if (flush < 0 || flush > Z_FINISH)
+ return Z_STREAM_ERROR;
+
+ /* check for seek request */
+ if (state->seek) {
+ state->seek = 0;
+ if (gz_zero(state, state->skip) == -1)
+ return -1;
+ }
+
+ /* compress remaining data with requested flush */
+ gz_comp(state, flush);
+ return state->err;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzsetparams(file, level, strategy)
+ gzFile file;
+ int level;
+ int strategy;
+{
+ gz_statep state;
+ z_streamp strm;
+
+ /* get internal structure */
+ if (file == NULL)
+ return Z_STREAM_ERROR;
+ state = (gz_statep)file;
+ strm = &(state->strm);
+
+ /* check that we're writing and that there's no error */
+ if (state->mode != GZ_WRITE || state->err != Z_OK)
+ return Z_STREAM_ERROR;
+
+ /* if no change is requested, then do nothing */
+ if (level == state->level && strategy == state->strategy)
+ return Z_OK;
+
+ /* check for seek request */
+ if (state->seek) {
+ state->seek = 0;
+ if (gz_zero(state, state->skip) == -1)
+ return -1;
+ }
+
+ /* change compression parameters for subsequent input */
+ if (state->size) {
+ /* flush previous input with previous parameters before changing */
+ if (strm->avail_in && gz_comp(state, Z_PARTIAL_FLUSH) == -1)
+ return state->err;
+ deflateParams(strm, level, strategy);
+ }
+ state->level = level;
+ state->strategy = strategy;
+ return Z_OK;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzclose_w(file)
+ gzFile file;
+{
+ int ret = Z_OK;
+ gz_statep state;
+
+ /* get internal structure */
+ if (file == NULL)
+ return Z_STREAM_ERROR;
+ state = (gz_statep)file;
+
+ /* check that we're writing */
+ if (state->mode != GZ_WRITE)
+ return Z_STREAM_ERROR;
+
+ /* check for seek request */
+ if (state->seek) {
+ state->seek = 0;
+ if (gz_zero(state, state->skip) == -1)
+ ret = state->err;
+ }
+
+ /* flush, free memory, and close file */
+ if (gz_comp(state, Z_FINISH) == -1)
+ ret = state->err;
+ if (state->size) {
+ if (!state->direct) {
+ (void)deflateEnd(&(state->strm));
+ free(state->out);
+ }
+ free(state->in);
+ }
+ gz_error(state, Z_OK, NULL);
+ free(state->path);
+ if (close(state->fd) == -1)
+ ret = Z_ERRNO;
+ free(state);
+ return ret;
+}
diff --git a/protocols/Telegram/tgl/zlib/infback.c b/protocols/Telegram/tgl/zlib/infback.c
new file mode 100644
index 0000000000..f3833c2e43
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/infback.c
@@ -0,0 +1,640 @@
+/* infback.c -- inflate using a call-back interface
+ * Copyright (C) 1995-2011 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/*
+ This code is largely copied from inflate.c. Normally either infback.o or
+ inflate.o would be linked into an application--not both. The interface
+ with inffast.c is retained so that optimized assembler-coded versions of
+ inflate_fast() can be used with either inflate.c or infback.c.
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+#include "inflate.h"
+#include "inffast.h"
+
+/* function prototypes */
+local void fixedtables OF((struct inflate_state FAR *state));
+
+/*
+ strm provides memory allocation functions in zalloc and zfree, or
+ Z_NULL to use the library memory allocation functions.
+
+ windowBits is in the range 8..15, and window is a user-supplied
+ window and output buffer that is 2**windowBits bytes.
+ */
+int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size)
+z_streamp strm;
+int windowBits;
+unsigned char FAR *window;
+const char *version;
+int stream_size;
+{
+ struct inflate_state FAR *state;
+
+ if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
+ stream_size != (int)(sizeof(z_stream)))
+ return Z_VERSION_ERROR;
+ if (strm == Z_NULL || window == Z_NULL ||
+ windowBits < 8 || windowBits > 15)
+ return Z_STREAM_ERROR;
+ strm->msg = Z_NULL; /* in case we return an error */
+ if (strm->zalloc == (alloc_func)0) {
+#ifdef Z_SOLO
+ return Z_STREAM_ERROR;
+#else
+ strm->zalloc = zcalloc;
+ strm->opaque = (voidpf)0;
+#endif
+ }
+ if (strm->zfree == (free_func)0)
+#ifdef Z_SOLO
+ return Z_STREAM_ERROR;
+#else
+ strm->zfree = zcfree;
+#endif
+ state = (struct inflate_state FAR *)ZALLOC(strm, 1,
+ sizeof(struct inflate_state));
+ if (state == Z_NULL) return Z_MEM_ERROR;
+ Tracev((stderr, "inflate: allocated\n"));
+ strm->state = (struct internal_state FAR *)state;
+ state->dmax = 32768U;
+ state->wbits = windowBits;
+ state->wsize = 1U << windowBits;
+ state->window = window;
+ state->wnext = 0;
+ state->whave = 0;
+ return Z_OK;
+}
+
+/*
+ Return state with length and distance decoding tables and index sizes set to
+ fixed code decoding. Normally this returns fixed tables from inffixed.h.
+ If BUILDFIXED is defined, then instead this routine builds the tables the
+ first time it's called, and returns those tables the first time and
+ thereafter. This reduces the size of the code by about 2K bytes, in
+ exchange for a little execution time. However, BUILDFIXED should not be
+ used for threaded applications, since the rewriting of the tables and virgin
+ may not be thread-safe.
+ */
+local void fixedtables(state)
+struct inflate_state FAR *state;
+{
+#ifdef BUILDFIXED
+ static int virgin = 1;
+ static code *lenfix, *distfix;
+ static code fixed[544];
+
+ /* build fixed huffman tables if first call (may not be thread safe) */
+ if (virgin) {
+ unsigned sym, bits;
+ static code *next;
+
+ /* literal/length table */
+ sym = 0;
+ while (sym < 144) state->lens[sym++] = 8;
+ while (sym < 256) state->lens[sym++] = 9;
+ while (sym < 280) state->lens[sym++] = 7;
+ while (sym < 288) state->lens[sym++] = 8;
+ next = fixed;
+ lenfix = next;
+ bits = 9;
+ inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
+
+ /* distance table */
+ sym = 0;
+ while (sym < 32) state->lens[sym++] = 5;
+ distfix = next;
+ bits = 5;
+ inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
+
+ /* do this just once */
+ virgin = 0;
+ }
+#else /* !BUILDFIXED */
+# include "inffixed.h"
+#endif /* BUILDFIXED */
+ state->lencode = lenfix;
+ state->lenbits = 9;
+ state->distcode = distfix;
+ state->distbits = 5;
+}
+
+/* Macros for inflateBack(): */
+
+/* Load returned state from inflate_fast() */
+#define LOAD() \
+ do { \
+ put = strm->next_out; \
+ left = strm->avail_out; \
+ next = strm->next_in; \
+ have = strm->avail_in; \
+ hold = state->hold; \
+ bits = state->bits; \
+ } while (0)
+
+/* Set state from registers for inflate_fast() */
+#define RESTORE() \
+ do { \
+ strm->next_out = put; \
+ strm->avail_out = left; \
+ strm->next_in = next; \
+ strm->avail_in = have; \
+ state->hold = hold; \
+ state->bits = bits; \
+ } while (0)
+
+/* Clear the input bit accumulator */
+#define INITBITS() \
+ do { \
+ hold = 0; \
+ bits = 0; \
+ } while (0)
+
+/* Assure that some input is available. If input is requested, but denied,
+ then return a Z_BUF_ERROR from inflateBack(). */
+#define PULL() \
+ do { \
+ if (have == 0) { \
+ have = in(in_desc, &next); \
+ if (have == 0) { \
+ next = Z_NULL; \
+ ret = Z_BUF_ERROR; \
+ goto inf_leave; \
+ } \
+ } \
+ } while (0)
+
+/* Get a byte of input into the bit accumulator, or return from inflateBack()
+ with an error if there is no input available. */
+#define PULLBYTE() \
+ do { \
+ PULL(); \
+ have--; \
+ hold += (unsigned long)(*next++) << bits; \
+ bits += 8; \
+ } while (0)
+
+/* Assure that there are at least n bits in the bit accumulator. If there is
+ not enough available input to do that, then return from inflateBack() with
+ an error. */
+#define NEEDBITS(n) \
+ do { \
+ while (bits < (unsigned)(n)) \
+ PULLBYTE(); \
+ } while (0)
+
+/* Return the low n bits of the bit accumulator (n < 16) */
+#define BITS(n) \
+ ((unsigned)hold & ((1U << (n)) - 1))
+
+/* Remove n bits from the bit accumulator */
+#define DROPBITS(n) \
+ do { \
+ hold >>= (n); \
+ bits -= (unsigned)(n); \
+ } while (0)
+
+/* Remove zero to seven bits as needed to go to a byte boundary */
+#define BYTEBITS() \
+ do { \
+ hold >>= bits & 7; \
+ bits -= bits & 7; \
+ } while (0)
+
+/* Assure that some output space is available, by writing out the window
+ if it's full. If the write fails, return from inflateBack() with a
+ Z_BUF_ERROR. */
+#define ROOM() \
+ do { \
+ if (left == 0) { \
+ put = state->window; \
+ left = state->wsize; \
+ state->whave = left; \
+ if (out(out_desc, put, left)) { \
+ ret = Z_BUF_ERROR; \
+ goto inf_leave; \
+ } \
+ } \
+ } while (0)
+
+/*
+ strm provides the memory allocation functions and window buffer on input,
+ and provides information on the unused input on return. For Z_DATA_ERROR
+ returns, strm will also provide an error message.
+
+ in() and out() are the call-back input and output functions. When
+ inflateBack() needs more input, it calls in(). When inflateBack() has
+ filled the window with output, or when it completes with data in the
+ window, it calls out() to write out the data. The application must not
+ change the provided input until in() is called again or inflateBack()
+ returns. The application must not change the window/output buffer until
+ inflateBack() returns.
+
+ in() and out() are called with a descriptor parameter provided in the
+ inflateBack() call. This parameter can be a structure that provides the
+ information required to do the read or write, as well as accumulated
+ information on the input and output such as totals and check values.
+
+ in() should return zero on failure. out() should return non-zero on
+ failure. If either in() or out() fails, than inflateBack() returns a
+ Z_BUF_ERROR. strm->next_in can be checked for Z_NULL to see whether it
+ was in() or out() that caused in the error. Otherwise, inflateBack()
+ returns Z_STREAM_END on success, Z_DATA_ERROR for an deflate format
+ error, or Z_MEM_ERROR if it could not allocate memory for the state.
+ inflateBack() can also return Z_STREAM_ERROR if the input parameters
+ are not correct, i.e. strm is Z_NULL or the state was not initialized.
+ */
+int ZEXPORT inflateBack(strm, in, in_desc, out, out_desc)
+z_streamp strm;
+in_func in;
+void FAR *in_desc;
+out_func out;
+void FAR *out_desc;
+{
+ struct inflate_state FAR *state;
+ z_const unsigned char FAR *next; /* next input */
+ unsigned char FAR *put; /* next output */
+ unsigned have, left; /* available input and output */
+ unsigned long hold; /* bit buffer */
+ unsigned bits; /* bits in bit buffer */
+ unsigned copy; /* number of stored or match bytes to copy */
+ unsigned char FAR *from; /* where to copy match bytes from */
+ code here; /* current decoding table entry */
+ code last; /* parent table entry */
+ unsigned len; /* length to copy for repeats, bits to drop */
+ int ret; /* return code */
+ static const unsigned short order[19] = /* permutation of code lengths */
+ {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
+
+ /* Check that the strm exists and that the state was initialized */
+ if (strm == Z_NULL || strm->state == Z_NULL)
+ return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+
+ /* Reset the state */
+ strm->msg = Z_NULL;
+ state->mode = TYPE;
+ state->last = 0;
+ state->whave = 0;
+ next = strm->next_in;
+ have = next != Z_NULL ? strm->avail_in : 0;
+ hold = 0;
+ bits = 0;
+ put = state->window;
+ left = state->wsize;
+
+ /* Inflate until end of block marked as last */
+ for (;;)
+ switch (state->mode) {
+ case TYPE:
+ /* determine and dispatch block type */
+ if (state->last) {
+ BYTEBITS();
+ state->mode = DONE;
+ break;
+ }
+ NEEDBITS(3);
+ state->last = BITS(1);
+ DROPBITS(1);
+ switch (BITS(2)) {
+ case 0: /* stored block */
+ Tracev((stderr, "inflate: stored block%s\n",
+ state->last ? " (last)" : ""));
+ state->mode = STORED;
+ break;
+ case 1: /* fixed block */
+ fixedtables(state);
+ Tracev((stderr, "inflate: fixed codes block%s\n",
+ state->last ? " (last)" : ""));
+ state->mode = LEN; /* decode codes */
+ break;
+ case 2: /* dynamic block */
+ Tracev((stderr, "inflate: dynamic codes block%s\n",
+ state->last ? " (last)" : ""));
+ state->mode = TABLE;
+ break;
+ case 3:
+ strm->msg = (char *)"invalid block type";
+ state->mode = BAD;
+ }
+ DROPBITS(2);
+ break;
+
+ case STORED:
+ /* get and verify stored block length */
+ BYTEBITS(); /* go to byte boundary */
+ NEEDBITS(32);
+ if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
+ strm->msg = (char *)"invalid stored block lengths";
+ state->mode = BAD;
+ break;
+ }
+ state->length = (unsigned)hold & 0xffff;
+ Tracev((stderr, "inflate: stored length %u\n",
+ state->length));
+ INITBITS();
+
+ /* copy stored block from input to output */
+ while (state->length != 0) {
+ copy = state->length;
+ PULL();
+ ROOM();
+ if (copy > have) copy = have;
+ if (copy > left) copy = left;
+ zmemcpy(put, next, copy);
+ have -= copy;
+ next += copy;
+ left -= copy;
+ put += copy;
+ state->length -= copy;
+ }
+ Tracev((stderr, "inflate: stored end\n"));
+ state->mode = TYPE;
+ break;
+
+ case TABLE:
+ /* get dynamic table entries descriptor */
+ NEEDBITS(14);
+ state->nlen = BITS(5) + 257;
+ DROPBITS(5);
+ state->ndist = BITS(5) + 1;
+ DROPBITS(5);
+ state->ncode = BITS(4) + 4;
+ DROPBITS(4);
+#ifndef PKZIP_BUG_WORKAROUND
+ if (state->nlen > 286 || state->ndist > 30) {
+ strm->msg = (char *)"too many length or distance symbols";
+ state->mode = BAD;
+ break;
+ }
+#endif
+ Tracev((stderr, "inflate: table sizes ok\n"));
+
+ /* get code length code lengths (not a typo) */
+ state->have = 0;
+ while (state->have < state->ncode) {
+ NEEDBITS(3);
+ state->lens[order[state->have++]] = (unsigned short)BITS(3);
+ DROPBITS(3);
+ }
+ while (state->have < 19)
+ state->lens[order[state->have++]] = 0;
+ state->next = state->codes;
+ state->lencode = (code const FAR *)(state->next);
+ state->lenbits = 7;
+ ret = inflate_table(CODES, state->lens, 19, &(state->next),
+ &(state->lenbits), state->work);
+ if (ret) {
+ strm->msg = (char *)"invalid code lengths set";
+ state->mode = BAD;
+ break;
+ }
+ Tracev((stderr, "inflate: code lengths ok\n"));
+
+ /* get length and distance code code lengths */
+ state->have = 0;
+ while (state->have < state->nlen + state->ndist) {
+ for (;;) {
+ here = state->lencode[BITS(state->lenbits)];
+ if ((unsigned)(here.bits) <= bits) break;
+ PULLBYTE();
+ }
+ if (here.val < 16) {
+ DROPBITS(here.bits);
+ state->lens[state->have++] = here.val;
+ }
+ else {
+ if (here.val == 16) {
+ NEEDBITS(here.bits + 2);
+ DROPBITS(here.bits);
+ if (state->have == 0) {
+ strm->msg = (char *)"invalid bit length repeat";
+ state->mode = BAD;
+ break;
+ }
+ len = (unsigned)(state->lens[state->have - 1]);
+ copy = 3 + BITS(2);
+ DROPBITS(2);
+ }
+ else if (here.val == 17) {
+ NEEDBITS(here.bits + 3);
+ DROPBITS(here.bits);
+ len = 0;
+ copy = 3 + BITS(3);
+ DROPBITS(3);
+ }
+ else {
+ NEEDBITS(here.bits + 7);
+ DROPBITS(here.bits);
+ len = 0;
+ copy = 11 + BITS(7);
+ DROPBITS(7);
+ }
+ if (state->have + copy > state->nlen + state->ndist) {
+ strm->msg = (char *)"invalid bit length repeat";
+ state->mode = BAD;
+ break;
+ }
+ while (copy--)
+ state->lens[state->have++] = (unsigned short)len;
+ }
+ }
+
+ /* handle error breaks in while */
+ if (state->mode == BAD) break;
+
+ /* check for end-of-block code (better have one) */
+ if (state->lens[256] == 0) {
+ strm->msg = (char *)"invalid code -- missing end-of-block";
+ state->mode = BAD;
+ break;
+ }
+
+ /* build code tables -- note: do not change the lenbits or distbits
+ values here (9 and 6) without reading the comments in inftrees.h
+ concerning the ENOUGH constants, which depend on those values */
+ state->next = state->codes;
+ state->lencode = (code const FAR *)(state->next);
+ state->lenbits = 9;
+ ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
+ &(state->lenbits), state->work);
+ if (ret) {
+ strm->msg = (char *)"invalid literal/lengths set";
+ state->mode = BAD;
+ break;
+ }
+ state->distcode = (code const FAR *)(state->next);
+ state->distbits = 6;
+ ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
+ &(state->next), &(state->distbits), state->work);
+ if (ret) {
+ strm->msg = (char *)"invalid distances set";
+ state->mode = BAD;
+ break;
+ }
+ Tracev((stderr, "inflate: codes ok\n"));
+ state->mode = LEN;
+
+ case LEN:
+ /* use inflate_fast() if we have enough input and output */
+ if (have >= 6 && left >= 258) {
+ RESTORE();
+ if (state->whave < state->wsize)
+ state->whave = state->wsize - left;
+ inflate_fast(strm, state->wsize);
+ LOAD();
+ break;
+ }
+
+ /* get a literal, length, or end-of-block code */
+ for (;;) {
+ here = state->lencode[BITS(state->lenbits)];
+ if ((unsigned)(here.bits) <= bits) break;
+ PULLBYTE();
+ }
+ if (here.op && (here.op & 0xf0) == 0) {
+ last = here;
+ for (;;) {
+ here = state->lencode[last.val +
+ (BITS(last.bits + last.op) >> last.bits)];
+ if ((unsigned)(last.bits + here.bits) <= bits) break;
+ PULLBYTE();
+ }
+ DROPBITS(last.bits);
+ }
+ DROPBITS(here.bits);
+ state->length = (unsigned)here.val;
+
+ /* process literal */
+ if (here.op == 0) {
+ Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
+ "inflate: literal '%c'\n" :
+ "inflate: literal 0x%02x\n", here.val));
+ ROOM();
+ *put++ = (unsigned char)(state->length);
+ left--;
+ state->mode = LEN;
+ break;
+ }
+
+ /* process end of block */
+ if (here.op & 32) {
+ Tracevv((stderr, "inflate: end of block\n"));
+ state->mode = TYPE;
+ break;
+ }
+
+ /* invalid code */
+ if (here.op & 64) {
+ strm->msg = (char *)"invalid literal/length code";
+ state->mode = BAD;
+ break;
+ }
+
+ /* length code -- get extra bits, if any */
+ state->extra = (unsigned)(here.op) & 15;
+ if (state->extra != 0) {
+ NEEDBITS(state->extra);
+ state->length += BITS(state->extra);
+ DROPBITS(state->extra);
+ }
+ Tracevv((stderr, "inflate: length %u\n", state->length));
+
+ /* get distance code */
+ for (;;) {
+ here = state->distcode[BITS(state->distbits)];
+ if ((unsigned)(here.bits) <= bits) break;
+ PULLBYTE();
+ }
+ if ((here.op & 0xf0) == 0) {
+ last = here;
+ for (;;) {
+ here = state->distcode[last.val +
+ (BITS(last.bits + last.op) >> last.bits)];
+ if ((unsigned)(last.bits + here.bits) <= bits) break;
+ PULLBYTE();
+ }
+ DROPBITS(last.bits);
+ }
+ DROPBITS(here.bits);
+ if (here.op & 64) {
+ strm->msg = (char *)"invalid distance code";
+ state->mode = BAD;
+ break;
+ }
+ state->offset = (unsigned)here.val;
+
+ /* get distance extra bits, if any */
+ state->extra = (unsigned)(here.op) & 15;
+ if (state->extra != 0) {
+ NEEDBITS(state->extra);
+ state->offset += BITS(state->extra);
+ DROPBITS(state->extra);
+ }
+ if (state->offset > state->wsize - (state->whave < state->wsize ?
+ left : 0)) {
+ strm->msg = (char *)"invalid distance too far back";
+ state->mode = BAD;
+ break;
+ }
+ Tracevv((stderr, "inflate: distance %u\n", state->offset));
+
+ /* copy match from window to output */
+ do {
+ ROOM();
+ copy = state->wsize - state->offset;
+ if (copy < left) {
+ from = put + copy;
+ copy = left - copy;
+ }
+ else {
+ from = put - state->offset;
+ copy = left;
+ }
+ if (copy > state->length) copy = state->length;
+ state->length -= copy;
+ left -= copy;
+ do {
+ *put++ = *from++;
+ } while (--copy);
+ } while (state->length != 0);
+ break;
+
+ case DONE:
+ /* inflate stream terminated properly -- write leftover output */
+ ret = Z_STREAM_END;
+ if (left < state->wsize) {
+ if (out(out_desc, state->window, state->wsize - left))
+ ret = Z_BUF_ERROR;
+ }
+ goto inf_leave;
+
+ case BAD:
+ ret = Z_DATA_ERROR;
+ goto inf_leave;
+
+ default: /* can't happen, but makes compilers happy */
+ ret = Z_STREAM_ERROR;
+ goto inf_leave;
+ }
+
+ /* Return unused input */
+ inf_leave:
+ strm->next_in = next;
+ strm->avail_in = have;
+ return ret;
+}
+
+int ZEXPORT inflateBackEnd(strm)
+z_streamp strm;
+{
+ if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
+ return Z_STREAM_ERROR;
+ ZFREE(strm, strm->state);
+ strm->state = Z_NULL;
+ Tracev((stderr, "inflate: end\n"));
+ return Z_OK;
+}
diff --git a/protocols/Telegram/tgl/zlib/inffast.c b/protocols/Telegram/tgl/zlib/inffast.c
new file mode 100644
index 0000000000..bda59ceb6a
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/inffast.c
@@ -0,0 +1,340 @@
+/* inffast.c -- fast decoding
+ * Copyright (C) 1995-2008, 2010, 2013 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+#include "inflate.h"
+#include "inffast.h"
+
+#ifndef ASMINF
+
+/* Allow machine dependent optimization for post-increment or pre-increment.
+ Based on testing to date,
+ Pre-increment preferred for:
+ - PowerPC G3 (Adler)
+ - MIPS R5000 (Randers-Pehrson)
+ Post-increment preferred for:
+ - none
+ No measurable difference:
+ - Pentium III (Anderson)
+ - M68060 (Nikl)
+ */
+#ifdef POSTINC
+# define OFF 0
+# define PUP(a) *(a)++
+#else
+# define OFF 1
+# define PUP(a) *++(a)
+#endif
+
+/*
+ Decode literal, length, and distance codes and write out the resulting
+ literal and match bytes until either not enough input or output is
+ available, an end-of-block is encountered, or a data error is encountered.
+ When large enough input and output buffers are supplied to inflate(), for
+ example, a 16K input buffer and a 64K output buffer, more than 95% of the
+ inflate execution time is spent in this routine.
+
+ Entry assumptions:
+
+ state->mode == LEN
+ strm->avail_in >= 6
+ strm->avail_out >= 258
+ start >= strm->avail_out
+ state->bits < 8
+
+ On return, state->mode is one of:
+
+ LEN -- ran out of enough output space or enough available input
+ TYPE -- reached end of block code, inflate() to interpret next block
+ BAD -- error in block data
+
+ Notes:
+
+ - The maximum input bits used by a length/distance pair is 15 bits for the
+ length code, 5 bits for the length extra, 15 bits for the distance code,
+ and 13 bits for the distance extra. This totals 48 bits, or six bytes.
+ Therefore if strm->avail_in >= 6, then there is enough input to avoid
+ checking for available input while decoding.
+
+ - The maximum bytes that a single length/distance pair can output is 258
+ bytes, which is the maximum length that can be coded. inflate_fast()
+ requires strm->avail_out >= 258 for each loop to avoid checking for
+ output space.
+ */
+void ZLIB_INTERNAL inflate_fast(strm, start)
+z_streamp strm;
+unsigned start; /* inflate()'s starting value for strm->avail_out */
+{
+ struct inflate_state FAR *state;
+ z_const unsigned char FAR *in; /* local strm->next_in */
+ z_const unsigned char FAR *last; /* have enough input while in < last */
+ unsigned char FAR *out; /* local strm->next_out */
+ unsigned char FAR *beg; /* inflate()'s initial strm->next_out */
+ unsigned char FAR *end; /* while out < end, enough space available */
+#ifdef INFLATE_STRICT
+ unsigned dmax; /* maximum distance from zlib header */
+#endif
+ unsigned wsize; /* window size or zero if not using window */
+ unsigned whave; /* valid bytes in the window */
+ unsigned wnext; /* window write index */
+ unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */
+ unsigned long hold; /* local strm->hold */
+ unsigned bits; /* local strm->bits */
+ code const FAR *lcode; /* local strm->lencode */
+ code const FAR *dcode; /* local strm->distcode */
+ unsigned lmask; /* mask for first level of length codes */
+ unsigned dmask; /* mask for first level of distance codes */
+ code here; /* retrieved table entry */
+ unsigned op; /* code bits, operation, extra bits, or */
+ /* window position, window bytes to copy */
+ unsigned len; /* match length, unused bytes */
+ unsigned dist; /* match distance */
+ unsigned char FAR *from; /* where to copy match from */
+
+ /* copy state to local variables */
+ state = (struct inflate_state FAR *)strm->state;
+ in = strm->next_in - OFF;
+ last = in + (strm->avail_in - 5);
+ out = strm->next_out - OFF;
+ beg = out - (start - strm->avail_out);
+ end = out + (strm->avail_out - 257);
+#ifdef INFLATE_STRICT
+ dmax = state->dmax;
+#endif
+ wsize = state->wsize;
+ whave = state->whave;
+ wnext = state->wnext;
+ window = state->window;
+ hold = state->hold;
+ bits = state->bits;
+ lcode = state->lencode;
+ dcode = state->distcode;
+ lmask = (1U << state->lenbits) - 1;
+ dmask = (1U << state->distbits) - 1;
+
+ /* decode literals and length/distances until end-of-block or not enough
+ input data or output space */
+ do {
+ if (bits < 15) {
+ hold += (unsigned long)(PUP(in)) << bits;
+ bits += 8;
+ hold += (unsigned long)(PUP(in)) << bits;
+ bits += 8;
+ }
+ here = lcode[hold & lmask];
+ dolen:
+ op = (unsigned)(here.bits);
+ hold >>= op;
+ bits -= op;
+ op = (unsigned)(here.op);
+ if (op == 0) { /* literal */
+ Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
+ "inflate: literal '%c'\n" :
+ "inflate: literal 0x%02x\n", here.val));
+ PUP(out) = (unsigned char)(here.val);
+ }
+ else if (op & 16) { /* length base */
+ len = (unsigned)(here.val);
+ op &= 15; /* number of extra bits */
+ if (op) {
+ if (bits < op) {
+ hold += (unsigned long)(PUP(in)) << bits;
+ bits += 8;
+ }
+ len += (unsigned)hold & ((1U << op) - 1);
+ hold >>= op;
+ bits -= op;
+ }
+ Tracevv((stderr, "inflate: length %u\n", len));
+ if (bits < 15) {
+ hold += (unsigned long)(PUP(in)) << bits;
+ bits += 8;
+ hold += (unsigned long)(PUP(in)) << bits;
+ bits += 8;
+ }
+ here = dcode[hold & dmask];
+ dodist:
+ op = (unsigned)(here.bits);
+ hold >>= op;
+ bits -= op;
+ op = (unsigned)(here.op);
+ if (op & 16) { /* distance base */
+ dist = (unsigned)(here.val);
+ op &= 15; /* number of extra bits */
+ if (bits < op) {
+ hold += (unsigned long)(PUP(in)) << bits;
+ bits += 8;
+ if (bits < op) {
+ hold += (unsigned long)(PUP(in)) << bits;
+ bits += 8;
+ }
+ }
+ dist += (unsigned)hold & ((1U << op) - 1);
+#ifdef INFLATE_STRICT
+ if (dist > dmax) {
+ strm->msg = (char *)"invalid distance too far back";
+ state->mode = BAD;
+ break;
+ }
+#endif
+ hold >>= op;
+ bits -= op;
+ Tracevv((stderr, "inflate: distance %u\n", dist));
+ op = (unsigned)(out - beg); /* max distance in output */
+ if (dist > op) { /* see if copy from window */
+ op = dist - op; /* distance back in window */
+ if (op > whave) {
+ if (state->sane) {
+ strm->msg =
+ (char *)"invalid distance too far back";
+ state->mode = BAD;
+ break;
+ }
+#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
+ if (len <= op - whave) {
+ do {
+ PUP(out) = 0;
+ } while (--len);
+ continue;
+ }
+ len -= op - whave;
+ do {
+ PUP(out) = 0;
+ } while (--op > whave);
+ if (op == 0) {
+ from = out - dist;
+ do {
+ PUP(out) = PUP(from);
+ } while (--len);
+ continue;
+ }
+#endif
+ }
+ from = window - OFF;
+ if (wnext == 0) { /* very common case */
+ from += wsize - op;
+ if (op < len) { /* some from window */
+ len -= op;
+ do {
+ PUP(out) = PUP(from);
+ } while (--op);
+ from = out - dist; /* rest from output */
+ }
+ }
+ else if (wnext < op) { /* wrap around window */
+ from += wsize + wnext - op;
+ op -= wnext;
+ if (op < len) { /* some from end of window */
+ len -= op;
+ do {
+ PUP(out) = PUP(from);
+ } while (--op);
+ from = window - OFF;
+ if (wnext < len) { /* some from start of window */
+ op = wnext;
+ len -= op;
+ do {
+ PUP(out) = PUP(from);
+ } while (--op);
+ from = out - dist; /* rest from output */
+ }
+ }
+ }
+ else { /* contiguous in window */
+ from += wnext - op;
+ if (op < len) { /* some from window */
+ len -= op;
+ do {
+ PUP(out) = PUP(from);
+ } while (--op);
+ from = out - dist; /* rest from output */
+ }
+ }
+ while (len > 2) {
+ PUP(out) = PUP(from);
+ PUP(out) = PUP(from);
+ PUP(out) = PUP(from);
+ len -= 3;
+ }
+ if (len) {
+ PUP(out) = PUP(from);
+ if (len > 1)
+ PUP(out) = PUP(from);
+ }
+ }
+ else {
+ from = out - dist; /* copy direct from output */
+ do { /* minimum length is three */
+ PUP(out) = PUP(from);
+ PUP(out) = PUP(from);
+ PUP(out) = PUP(from);
+ len -= 3;
+ } while (len > 2);
+ if (len) {
+ PUP(out) = PUP(from);
+ if (len > 1)
+ PUP(out) = PUP(from);
+ }
+ }
+ }
+ else if ((op & 64) == 0) { /* 2nd level distance code */
+ here = dcode[here.val + (hold & ((1U << op) - 1))];
+ goto dodist;
+ }
+ else {
+ strm->msg = (char *)"invalid distance code";
+ state->mode = BAD;
+ break;
+ }
+ }
+ else if ((op & 64) == 0) { /* 2nd level length code */
+ here = lcode[here.val + (hold & ((1U << op) - 1))];
+ goto dolen;
+ }
+ else if (op & 32) { /* end-of-block */
+ Tracevv((stderr, "inflate: end of block\n"));
+ state->mode = TYPE;
+ break;
+ }
+ else {
+ strm->msg = (char *)"invalid literal/length code";
+ state->mode = BAD;
+ break;
+ }
+ } while (in < last && out < end);
+
+ /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
+ len = bits >> 3;
+ in -= len;
+ bits -= len << 3;
+ hold &= (1U << bits) - 1;
+
+ /* update state and return */
+ strm->next_in = in + OFF;
+ strm->next_out = out + OFF;
+ strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last));
+ strm->avail_out = (unsigned)(out < end ?
+ 257 + (end - out) : 257 - (out - end));
+ state->hold = hold;
+ state->bits = bits;
+ return;
+}
+
+/*
+ inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe):
+ - Using bit fields for code structure
+ - Different op definition to avoid & for extra bits (do & for table bits)
+ - Three separate decoding do-loops for direct, window, and wnext == 0
+ - Special case for distance > 1 copies to do overlapped load and store copy
+ - Explicit branch predictions (based on measured branch probabilities)
+ - Deferring match copy and interspersed it with decoding subsequent codes
+ - Swapping literal/length else
+ - Swapping window/direct else
+ - Larger unrolled copy loops (three is about right)
+ - Moving len -= 3 statement into middle of loop
+ */
+
+#endif /* !ASMINF */
diff --git a/protocols/Telegram/tgl/zlib/inffast.h b/protocols/Telegram/tgl/zlib/inffast.h
new file mode 100644
index 0000000000..e5c1aa4ca8
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/inffast.h
@@ -0,0 +1,11 @@
+/* inffast.h -- header to use inffast.c
+ * Copyright (C) 1995-2003, 2010 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start));
diff --git a/protocols/Telegram/tgl/zlib/inffixed.h b/protocols/Telegram/tgl/zlib/inffixed.h
new file mode 100644
index 0000000000..d628327769
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/inffixed.h
@@ -0,0 +1,94 @@
+ /* inffixed.h -- table for decoding fixed codes
+ * Generated automatically by makefixed().
+ */
+
+ /* WARNING: this file should *not* be used by applications.
+ It is part of the implementation of this library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+ static const code lenfix[512] = {
+ {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48},
+ {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128},
+ {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59},
+ {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176},
+ {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20},
+ {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100},
+ {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8},
+ {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216},
+ {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76},
+ {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114},
+ {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2},
+ {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148},
+ {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42},
+ {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86},
+ {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15},
+ {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236},
+ {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62},
+ {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142},
+ {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31},
+ {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162},
+ {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25},
+ {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105},
+ {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4},
+ {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202},
+ {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69},
+ {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125},
+ {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13},
+ {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195},
+ {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35},
+ {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91},
+ {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19},
+ {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246},
+ {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55},
+ {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135},
+ {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99},
+ {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190},
+ {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16},
+ {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96},
+ {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6},
+ {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209},
+ {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72},
+ {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116},
+ {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4},
+ {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153},
+ {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44},
+ {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82},
+ {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11},
+ {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229},
+ {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58},
+ {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138},
+ {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51},
+ {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173},
+ {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30},
+ {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110},
+ {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0},
+ {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195},
+ {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65},
+ {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121},
+ {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9},
+ {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258},
+ {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37},
+ {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93},
+ {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23},
+ {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251},
+ {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51},
+ {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131},
+ {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67},
+ {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183},
+ {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23},
+ {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103},
+ {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9},
+ {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223},
+ {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79},
+ {0,9,255}
+ };
+
+ static const code distfix[32] = {
+ {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025},
+ {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193},
+ {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385},
+ {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577},
+ {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073},
+ {22,5,193},{64,5,0}
+ };
diff --git a/protocols/Telegram/tgl/zlib/inflate.c b/protocols/Telegram/tgl/zlib/inflate.c
new file mode 100644
index 0000000000..870f89bb4d
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/inflate.c
@@ -0,0 +1,1512 @@
+/* inflate.c -- zlib decompression
+ * Copyright (C) 1995-2012 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/*
+ * Change history:
+ *
+ * 1.2.beta0 24 Nov 2002
+ * - First version -- complete rewrite of inflate to simplify code, avoid
+ * creation of window when not needed, minimize use of window when it is
+ * needed, make inffast.c even faster, implement gzip decoding, and to
+ * improve code readability and style over the previous zlib inflate code
+ *
+ * 1.2.beta1 25 Nov 2002
+ * - Use pointers for available input and output checking in inffast.c
+ * - Remove input and output counters in inffast.c
+ * - Change inffast.c entry and loop from avail_in >= 7 to >= 6
+ * - Remove unnecessary second byte pull from length extra in inffast.c
+ * - Unroll direct copy to three copies per loop in inffast.c
+ *
+ * 1.2.beta2 4 Dec 2002
+ * - Change external routine names to reduce potential conflicts
+ * - Correct filename to inffixed.h for fixed tables in inflate.c
+ * - Make hbuf[] unsigned char to match parameter type in inflate.c
+ * - Change strm->next_out[-state->offset] to *(strm->next_out - state->offset)
+ * to avoid negation problem on Alphas (64 bit) in inflate.c
+ *
+ * 1.2.beta3 22 Dec 2002
+ * - Add comments on state->bits assertion in inffast.c
+ * - Add comments on op field in inftrees.h
+ * - Fix bug in reuse of allocated window after inflateReset()
+ * - Remove bit fields--back to byte structure for speed
+ * - Remove distance extra == 0 check in inflate_fast()--only helps for lengths
+ * - Change post-increments to pre-increments in inflate_fast(), PPC biased?
+ * - Add compile time option, POSTINC, to use post-increments instead (Intel?)
+ * - Make MATCH copy in inflate() much faster for when inflate_fast() not used
+ * - Use local copies of stream next and avail values, as well as local bit
+ * buffer and bit count in inflate()--for speed when inflate_fast() not used
+ *
+ * 1.2.beta4 1 Jan 2003
+ * - Split ptr - 257 statements in inflate_table() to avoid compiler warnings
+ * - Move a comment on output buffer sizes from inffast.c to inflate.c
+ * - Add comments in inffast.c to introduce the inflate_fast() routine
+ * - Rearrange window copies in inflate_fast() for speed and simplification
+ * - Unroll last copy for window match in inflate_fast()
+ * - Use local copies of window variables in inflate_fast() for speed
+ * - Pull out common wnext == 0 case for speed in inflate_fast()
+ * - Make op and len in inflate_fast() unsigned for consistency
+ * - Add FAR to lcode and dcode declarations in inflate_fast()
+ * - Simplified bad distance check in inflate_fast()
+ * - Added inflateBackInit(), inflateBack(), and inflateBackEnd() in new
+ * source file infback.c to provide a call-back interface to inflate for
+ * programs like gzip and unzip -- uses window as output buffer to avoid
+ * window copying
+ *
+ * 1.2.beta5 1 Jan 2003
+ * - Improved inflateBack() interface to allow the caller to provide initial
+ * input in strm.
+ * - Fixed stored blocks bug in inflateBack()
+ *
+ * 1.2.beta6 4 Jan 2003
+ * - Added comments in inffast.c on effectiveness of POSTINC
+ * - Typecasting all around to reduce compiler warnings
+ * - Changed loops from while (1) or do {} while (1) to for (;;), again to
+ * make compilers happy
+ * - Changed type of window in inflateBackInit() to unsigned char *
+ *
+ * 1.2.beta7 27 Jan 2003
+ * - Changed many types to unsigned or unsigned short to avoid warnings
+ * - Added inflateCopy() function
+ *
+ * 1.2.0 9 Mar 2003
+ * - Changed inflateBack() interface to provide separate opaque descriptors
+ * for the in() and out() functions
+ * - Changed inflateBack() argument and in_func typedef to swap the length
+ * and buffer address return values for the input function
+ * - Check next_in and next_out for Z_NULL on entry to inflate()
+ *
+ * The history for versions after 1.2.0 are in ChangeLog in zlib distribution.
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+#include "inflate.h"
+#include "inffast.h"
+
+#ifdef MAKEFIXED
+# ifndef BUILDFIXED
+# define BUILDFIXED
+# endif
+#endif
+
+/* function prototypes */
+local void fixedtables OF((struct inflate_state FAR *state));
+local int updatewindow OF((z_streamp strm, const unsigned char FAR *end,
+ unsigned copy));
+#ifdef BUILDFIXED
+ void makefixed OF((void));
+#endif
+local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf,
+ unsigned len));
+
+int ZEXPORT inflateResetKeep(strm)
+z_streamp strm;
+{
+ struct inflate_state FAR *state;
+
+ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+ strm->total_in = strm->total_out = state->total = 0;
+ strm->msg = Z_NULL;
+ if (state->wrap) /* to support ill-conceived Java test suite */
+ strm->adler = state->wrap & 1;
+ state->mode = HEAD;
+ state->last = 0;
+ state->havedict = 0;
+ state->dmax = 32768U;
+ state->head = Z_NULL;
+ state->hold = 0;
+ state->bits = 0;
+ state->lencode = state->distcode = state->next = state->codes;
+ state->sane = 1;
+ state->back = -1;
+ Tracev((stderr, "inflate: reset\n"));
+ return Z_OK;
+}
+
+int ZEXPORT inflateReset(strm)
+z_streamp strm;
+{
+ struct inflate_state FAR *state;
+
+ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+ state->wsize = 0;
+ state->whave = 0;
+ state->wnext = 0;
+ return inflateResetKeep(strm);
+}
+
+int ZEXPORT inflateReset2(strm, windowBits)
+z_streamp strm;
+int windowBits;
+{
+ int wrap;
+ struct inflate_state FAR *state;
+
+ /* get the state */
+ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+
+ /* extract wrap request from windowBits parameter */
+ if (windowBits < 0) {
+ wrap = 0;
+ windowBits = -windowBits;
+ }
+ else {
+ wrap = (windowBits >> 4) + 1;
+#ifdef GUNZIP
+ if (windowBits < 48)
+ windowBits &= 15;
+#endif
+ }
+
+ /* set number of window bits, free window if different */
+ if (windowBits && (windowBits < 8 || windowBits > 15))
+ return Z_STREAM_ERROR;
+ if (state->window != Z_NULL && state->wbits != (unsigned)windowBits) {
+ ZFREE(strm, state->window);
+ state->window = Z_NULL;
+ }
+
+ /* update state and reset the rest of it */
+ state->wrap = wrap;
+ state->wbits = (unsigned)windowBits;
+ return inflateReset(strm);
+}
+
+int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size)
+z_streamp strm;
+int windowBits;
+const char *version;
+int stream_size;
+{
+ int ret;
+ struct inflate_state FAR *state;
+
+ if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
+ stream_size != (int)(sizeof(z_stream)))
+ return Z_VERSION_ERROR;
+ if (strm == Z_NULL) return Z_STREAM_ERROR;
+ strm->msg = Z_NULL; /* in case we return an error */
+ if (strm->zalloc == (alloc_func)0) {
+#ifdef Z_SOLO
+ return Z_STREAM_ERROR;
+#else
+ strm->zalloc = zcalloc;
+ strm->opaque = (voidpf)0;
+#endif
+ }
+ if (strm->zfree == (free_func)0)
+#ifdef Z_SOLO
+ return Z_STREAM_ERROR;
+#else
+ strm->zfree = zcfree;
+#endif
+ state = (struct inflate_state FAR *)
+ ZALLOC(strm, 1, sizeof(struct inflate_state));
+ if (state == Z_NULL) return Z_MEM_ERROR;
+ Tracev((stderr, "inflate: allocated\n"));
+ strm->state = (struct internal_state FAR *)state;
+ state->window = Z_NULL;
+ ret = inflateReset2(strm, windowBits);
+ if (ret != Z_OK) {
+ ZFREE(strm, state);
+ strm->state = Z_NULL;
+ }
+ return ret;
+}
+
+int ZEXPORT inflateInit_(strm, version, stream_size)
+z_streamp strm;
+const char *version;
+int stream_size;
+{
+ return inflateInit2_(strm, DEF_WBITS, version, stream_size);
+}
+
+int ZEXPORT inflatePrime(strm, bits, value)
+z_streamp strm;
+int bits;
+int value;
+{
+ struct inflate_state FAR *state;
+
+ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+ if (bits < 0) {
+ state->hold = 0;
+ state->bits = 0;
+ return Z_OK;
+ }
+ if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR;
+ value &= (1L << bits) - 1;
+ state->hold += value << state->bits;
+ state->bits += bits;
+ return Z_OK;
+}
+
+/*
+ Return state with length and distance decoding tables and index sizes set to
+ fixed code decoding. Normally this returns fixed tables from inffixed.h.
+ If BUILDFIXED is defined, then instead this routine builds the tables the
+ first time it's called, and returns those tables the first time and
+ thereafter. This reduces the size of the code by about 2K bytes, in
+ exchange for a little execution time. However, BUILDFIXED should not be
+ used for threaded applications, since the rewriting of the tables and virgin
+ may not be thread-safe.
+ */
+local void fixedtables(state)
+struct inflate_state FAR *state;
+{
+#ifdef BUILDFIXED
+ static int virgin = 1;
+ static code *lenfix, *distfix;
+ static code fixed[544];
+
+ /* build fixed huffman tables if first call (may not be thread safe) */
+ if (virgin) {
+ unsigned sym, bits;
+ static code *next;
+
+ /* literal/length table */
+ sym = 0;
+ while (sym < 144) state->lens[sym++] = 8;
+ while (sym < 256) state->lens[sym++] = 9;
+ while (sym < 280) state->lens[sym++] = 7;
+ while (sym < 288) state->lens[sym++] = 8;
+ next = fixed;
+ lenfix = next;
+ bits = 9;
+ inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
+
+ /* distance table */
+ sym = 0;
+ while (sym < 32) state->lens[sym++] = 5;
+ distfix = next;
+ bits = 5;
+ inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
+
+ /* do this just once */
+ virgin = 0;
+ }
+#else /* !BUILDFIXED */
+# include "inffixed.h"
+#endif /* BUILDFIXED */
+ state->lencode = lenfix;
+ state->lenbits = 9;
+ state->distcode = distfix;
+ state->distbits = 5;
+}
+
+#ifdef MAKEFIXED
+#include <stdio.h>
+
+/*
+ Write out the inffixed.h that is #include'd above. Defining MAKEFIXED also
+ defines BUILDFIXED, so the tables are built on the fly. makefixed() writes
+ those tables to stdout, which would be piped to inffixed.h. A small program
+ can simply call makefixed to do this:
+
+ void makefixed(void);
+
+ int main(void)
+ {
+ makefixed();
+ return 0;
+ }
+
+ Then that can be linked with zlib built with MAKEFIXED defined and run:
+
+ a.out > inffixed.h
+ */
+void makefixed()
+{
+ unsigned low, size;
+ struct inflate_state state;
+
+ fixedtables(&state);
+ puts(" /* inffixed.h -- table for decoding fixed codes");
+ puts(" * Generated automatically by makefixed().");
+ puts(" */");
+ puts("");
+ puts(" /* WARNING: this file should *not* be used by applications.");
+ puts(" It is part of the implementation of this library and is");
+ puts(" subject to change. Applications should only use zlib.h.");
+ puts(" */");
+ puts("");
+ size = 1U << 9;
+ printf(" static const code lenfix[%u] = {", size);
+ low = 0;
+ for (;;) {
+ if ((low % 7) == 0) printf("\n ");
+ printf("{%u,%u,%d}", (low & 127) == 99 ? 64 : state.lencode[low].op,
+ state.lencode[low].bits, state.lencode[low].val);
+ if (++low == size) break;
+ putchar(',');
+ }
+ puts("\n };");
+ size = 1U << 5;
+ printf("\n static const code distfix[%u] = {", size);
+ low = 0;
+ for (;;) {
+ if ((low % 6) == 0) printf("\n ");
+ printf("{%u,%u,%d}", state.distcode[low].op, state.distcode[low].bits,
+ state.distcode[low].val);
+ if (++low == size) break;
+ putchar(',');
+ }
+ puts("\n };");
+}
+#endif /* MAKEFIXED */
+
+/*
+ Update the window with the last wsize (normally 32K) bytes written before
+ returning. If window does not exist yet, create it. This is only called
+ when a window is already in use, or when output has been written during this
+ inflate call, but the end of the deflate stream has not been reached yet.
+ It is also called to create a window for dictionary data when a dictionary
+ is loaded.
+
+ Providing output buffers larger than 32K to inflate() should provide a speed
+ advantage, since only the last 32K of output is copied to the sliding window
+ upon return from inflate(), and since all distances after the first 32K of
+ output will fall in the output data, making match copies simpler and faster.
+ The advantage may be dependent on the size of the processor's data caches.
+ */
+local int updatewindow(strm, end, copy)
+z_streamp strm;
+const Bytef *end;
+unsigned copy;
+{
+ struct inflate_state FAR *state;
+ unsigned dist;
+
+ state = (struct inflate_state FAR *)strm->state;
+
+ /* if it hasn't been done already, allocate space for the window */
+ if (state->window == Z_NULL) {
+ state->window = (unsigned char FAR *)
+ ZALLOC(strm, 1U << state->wbits,
+ sizeof(unsigned char));
+ if (state->window == Z_NULL) return 1;
+ }
+
+ /* if window not in use yet, initialize */
+ if (state->wsize == 0) {
+ state->wsize = 1U << state->wbits;
+ state->wnext = 0;
+ state->whave = 0;
+ }
+
+ /* copy state->wsize or less output bytes into the circular window */
+ if (copy >= state->wsize) {
+ zmemcpy(state->window, end - state->wsize, state->wsize);
+ state->wnext = 0;
+ state->whave = state->wsize;
+ }
+ else {
+ dist = state->wsize - state->wnext;
+ if (dist > copy) dist = copy;
+ zmemcpy(state->window + state->wnext, end - copy, dist);
+ copy -= dist;
+ if (copy) {
+ zmemcpy(state->window, end - copy, copy);
+ state->wnext = copy;
+ state->whave = state->wsize;
+ }
+ else {
+ state->wnext += dist;
+ if (state->wnext == state->wsize) state->wnext = 0;
+ if (state->whave < state->wsize) state->whave += dist;
+ }
+ }
+ return 0;
+}
+
+/* Macros for inflate(): */
+
+/* check function to use adler32() for zlib or crc32() for gzip */
+#ifdef GUNZIP
+# define UPDATE(check, buf, len) \
+ (state->flags ? crc32(check, buf, len) : adler32(check, buf, len))
+#else
+# define UPDATE(check, buf, len) adler32(check, buf, len)
+#endif
+
+/* check macros for header crc */
+#ifdef GUNZIP
+# define CRC2(check, word) \
+ do { \
+ hbuf[0] = (unsigned char)(word); \
+ hbuf[1] = (unsigned char)((word) >> 8); \
+ check = crc32(check, hbuf, 2); \
+ } while (0)
+
+# define CRC4(check, word) \
+ do { \
+ hbuf[0] = (unsigned char)(word); \
+ hbuf[1] = (unsigned char)((word) >> 8); \
+ hbuf[2] = (unsigned char)((word) >> 16); \
+ hbuf[3] = (unsigned char)((word) >> 24); \
+ check = crc32(check, hbuf, 4); \
+ } while (0)
+#endif
+
+/* Load registers with state in inflate() for speed */
+#define LOAD() \
+ do { \
+ put = strm->next_out; \
+ left = strm->avail_out; \
+ next = strm->next_in; \
+ have = strm->avail_in; \
+ hold = state->hold; \
+ bits = state->bits; \
+ } while (0)
+
+/* Restore state from registers in inflate() */
+#define RESTORE() \
+ do { \
+ strm->next_out = put; \
+ strm->avail_out = left; \
+ strm->next_in = next; \
+ strm->avail_in = have; \
+ state->hold = hold; \
+ state->bits = bits; \
+ } while (0)
+
+/* Clear the input bit accumulator */
+#define INITBITS() \
+ do { \
+ hold = 0; \
+ bits = 0; \
+ } while (0)
+
+/* Get a byte of input into the bit accumulator, or return from inflate()
+ if there is no input available. */
+#define PULLBYTE() \
+ do { \
+ if (have == 0) goto inf_leave; \
+ have--; \
+ hold += (unsigned long)(*next++) << bits; \
+ bits += 8; \
+ } while (0)
+
+/* Assure that there are at least n bits in the bit accumulator. If there is
+ not enough available input to do that, then return from inflate(). */
+#define NEEDBITS(n) \
+ do { \
+ while (bits < (unsigned)(n)) \
+ PULLBYTE(); \
+ } while (0)
+
+/* Return the low n bits of the bit accumulator (n < 16) */
+#define BITS(n) \
+ ((unsigned)hold & ((1U << (n)) - 1))
+
+/* Remove n bits from the bit accumulator */
+#define DROPBITS(n) \
+ do { \
+ hold >>= (n); \
+ bits -= (unsigned)(n); \
+ } while (0)
+
+/* Remove zero to seven bits as needed to go to a byte boundary */
+#define BYTEBITS() \
+ do { \
+ hold >>= bits & 7; \
+ bits -= bits & 7; \
+ } while (0)
+
+/*
+ inflate() uses a state machine to process as much input data and generate as
+ much output data as possible before returning. The state machine is
+ structured roughly as follows:
+
+ for (;;) switch (state) {
+ ...
+ case STATEn:
+ if (not enough input data or output space to make progress)
+ return;
+ ... make progress ...
+ state = STATEm;
+ break;
+ ...
+ }
+
+ so when inflate() is called again, the same case is attempted again, and
+ if the appropriate resources are provided, the machine proceeds to the
+ next state. The NEEDBITS() macro is usually the way the state evaluates
+ whether it can proceed or should return. NEEDBITS() does the return if
+ the requested bits are not available. The typical use of the BITS macros
+ is:
+
+ NEEDBITS(n);
+ ... do something with BITS(n) ...
+ DROPBITS(n);
+
+ where NEEDBITS(n) either returns from inflate() if there isn't enough
+ input left to load n bits into the accumulator, or it continues. BITS(n)
+ gives the low n bits in the accumulator. When done, DROPBITS(n) drops
+ the low n bits off the accumulator. INITBITS() clears the accumulator
+ and sets the number of available bits to zero. BYTEBITS() discards just
+ enough bits to put the accumulator on a byte boundary. After BYTEBITS()
+ and a NEEDBITS(8), then BITS(8) would return the next byte in the stream.
+
+ NEEDBITS(n) uses PULLBYTE() to get an available byte of input, or to return
+ if there is no input available. The decoding of variable length codes uses
+ PULLBYTE() directly in order to pull just enough bytes to decode the next
+ code, and no more.
+
+ Some states loop until they get enough input, making sure that enough
+ state information is maintained to continue the loop where it left off
+ if NEEDBITS() returns in the loop. For example, want, need, and keep
+ would all have to actually be part of the saved state in case NEEDBITS()
+ returns:
+
+ case STATEw:
+ while (want < need) {
+ NEEDBITS(n);
+ keep[want++] = BITS(n);
+ DROPBITS(n);
+ }
+ state = STATEx;
+ case STATEx:
+
+ As shown above, if the next state is also the next case, then the break
+ is omitted.
+
+ A state may also return if there is not enough output space available to
+ complete that state. Those states are copying stored data, writing a
+ literal byte, and copying a matching string.
+
+ When returning, a "goto inf_leave" is used to update the total counters,
+ update the check value, and determine whether any progress has been made
+ during that inflate() call in order to return the proper return code.
+ Progress is defined as a change in either strm->avail_in or strm->avail_out.
+ When there is a window, goto inf_leave will update the window with the last
+ output written. If a goto inf_leave occurs in the middle of decompression
+ and there is no window currently, goto inf_leave will create one and copy
+ output to the window for the next call of inflate().
+
+ In this implementation, the flush parameter of inflate() only affects the
+ return code (per zlib.h). inflate() always writes as much as possible to
+ strm->next_out, given the space available and the provided input--the effect
+ documented in zlib.h of Z_SYNC_FLUSH. Furthermore, inflate() always defers
+ the allocation of and copying into a sliding window until necessary, which
+ provides the effect documented in zlib.h for Z_FINISH when the entire input
+ stream available. So the only thing the flush parameter actually does is:
+ when flush is set to Z_FINISH, inflate() cannot return Z_OK. Instead it
+ will return Z_BUF_ERROR if it has not reached the end of the stream.
+ */
+
+int ZEXPORT inflate(strm, flush)
+z_streamp strm;
+int flush;
+{
+ struct inflate_state FAR *state;
+ z_const unsigned char FAR *next; /* next input */
+ unsigned char FAR *put; /* next output */
+ unsigned have, left; /* available input and output */
+ unsigned long hold; /* bit buffer */
+ unsigned bits; /* bits in bit buffer */
+ unsigned in, out; /* save starting available input and output */
+ unsigned copy; /* number of stored or match bytes to copy */
+ unsigned char FAR *from; /* where to copy match bytes from */
+ code here; /* current decoding table entry */
+ code last; /* parent table entry */
+ unsigned len; /* length to copy for repeats, bits to drop */
+ int ret; /* return code */
+#ifdef GUNZIP
+ unsigned char hbuf[4]; /* buffer for gzip header crc calculation */
+#endif
+ static const unsigned short order[19] = /* permutation of code lengths */
+ {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
+
+ if (strm == Z_NULL || strm->state == Z_NULL || strm->next_out == Z_NULL ||
+ (strm->next_in == Z_NULL && strm->avail_in != 0))
+ return Z_STREAM_ERROR;
+
+ state = (struct inflate_state FAR *)strm->state;
+ if (state->mode == TYPE) state->mode = TYPEDO; /* skip check */
+ LOAD();
+ in = have;
+ out = left;
+ ret = Z_OK;
+ for (;;)
+ switch (state->mode) {
+ case HEAD:
+ if (state->wrap == 0) {
+ state->mode = TYPEDO;
+ break;
+ }
+ NEEDBITS(16);
+#ifdef GUNZIP
+ if ((state->wrap & 2) && hold == 0x8b1f) { /* gzip header */
+ state->check = crc32(0L, Z_NULL, 0);
+ CRC2(state->check, hold);
+ INITBITS();
+ state->mode = FLAGS;
+ break;
+ }
+ state->flags = 0; /* expect zlib header */
+ if (state->head != Z_NULL)
+ state->head->done = -1;
+ if (!(state->wrap & 1) || /* check if zlib header allowed */
+#else
+ if (
+#endif
+ ((BITS(8) << 8) + (hold >> 8)) % 31) {
+ strm->msg = (char *)"incorrect header check";
+ state->mode = BAD;
+ break;
+ }
+ if (BITS(4) != Z_DEFLATED) {
+ strm->msg = (char *)"unknown compression method";
+ state->mode = BAD;
+ break;
+ }
+ DROPBITS(4);
+ len = BITS(4) + 8;
+ if (state->wbits == 0)
+ state->wbits = len;
+ else if (len > state->wbits) {
+ strm->msg = (char *)"invalid window size";
+ state->mode = BAD;
+ break;
+ }
+ state->dmax = 1U << len;
+ Tracev((stderr, "inflate: zlib header ok\n"));
+ strm->adler = state->check = adler32(0L, Z_NULL, 0);
+ state->mode = hold & 0x200 ? DICTID : TYPE;
+ INITBITS();
+ break;
+#ifdef GUNZIP
+ case FLAGS:
+ NEEDBITS(16);
+ state->flags = (int)(hold);
+ if ((state->flags & 0xff) != Z_DEFLATED) {
+ strm->msg = (char *)"unknown compression method";
+ state->mode = BAD;
+ break;
+ }
+ if (state->flags & 0xe000) {
+ strm->msg = (char *)"unknown header flags set";
+ state->mode = BAD;
+ break;
+ }
+ if (state->head != Z_NULL)
+ state->head->text = (int)((hold >> 8) & 1);
+ if (state->flags & 0x0200) CRC2(state->check, hold);
+ INITBITS();
+ state->mode = TIME;
+ case TIME:
+ NEEDBITS(32);
+ if (state->head != Z_NULL)
+ state->head->time = hold;
+ if (state->flags & 0x0200) CRC4(state->check, hold);
+ INITBITS();
+ state->mode = OS;
+ case OS:
+ NEEDBITS(16);
+ if (state->head != Z_NULL) {
+ state->head->xflags = (int)(hold & 0xff);
+ state->head->os = (int)(hold >> 8);
+ }
+ if (state->flags & 0x0200) CRC2(state->check, hold);
+ INITBITS();
+ state->mode = EXLEN;
+ case EXLEN:
+ if (state->flags & 0x0400) {
+ NEEDBITS(16);
+ state->length = (unsigned)(hold);
+ if (state->head != Z_NULL)
+ state->head->extra_len = (unsigned)hold;
+ if (state->flags & 0x0200) CRC2(state->check, hold);
+ INITBITS();
+ }
+ else if (state->head != Z_NULL)
+ state->head->extra = Z_NULL;
+ state->mode = EXTRA;
+ case EXTRA:
+ if (state->flags & 0x0400) {
+ copy = state->length;
+ if (copy > have) copy = have;
+ if (copy) {
+ if (state->head != Z_NULL &&
+ state->head->extra != Z_NULL) {
+ len = state->head->extra_len - state->length;
+ zmemcpy(state->head->extra + len, next,
+ len + copy > state->head->extra_max ?
+ state->head->extra_max - len : copy);
+ }
+ if (state->flags & 0x0200)
+ state->check = crc32(state->check, next, copy);
+ have -= copy;
+ next += copy;
+ state->length -= copy;
+ }
+ if (state->length) goto inf_leave;
+ }
+ state->length = 0;
+ state->mode = NAME;
+ case NAME:
+ if (state->flags & 0x0800) {
+ if (have == 0) goto inf_leave;
+ copy = 0;
+ do {
+ len = (unsigned)(next[copy++]);
+ if (state->head != Z_NULL &&
+ state->head->name != Z_NULL &&
+ state->length < state->head->name_max)
+ state->head->name[state->length++] = len;
+ } while (len && copy < have);
+ if (state->flags & 0x0200)
+ state->check = crc32(state->check, next, copy);
+ have -= copy;
+ next += copy;
+ if (len) goto inf_leave;
+ }
+ else if (state->head != Z_NULL)
+ state->head->name = Z_NULL;
+ state->length = 0;
+ state->mode = COMMENT;
+ case COMMENT:
+ if (state->flags & 0x1000) {
+ if (have == 0) goto inf_leave;
+ copy = 0;
+ do {
+ len = (unsigned)(next[copy++]);
+ if (state->head != Z_NULL &&
+ state->head->comment != Z_NULL &&
+ state->length < state->head->comm_max)
+ state->head->comment[state->length++] = len;
+ } while (len && copy < have);
+ if (state->flags & 0x0200)
+ state->check = crc32(state->check, next, copy);
+ have -= copy;
+ next += copy;
+ if (len) goto inf_leave;
+ }
+ else if (state->head != Z_NULL)
+ state->head->comment = Z_NULL;
+ state->mode = HCRC;
+ case HCRC:
+ if (state->flags & 0x0200) {
+ NEEDBITS(16);
+ if (hold != (state->check & 0xffff)) {
+ strm->msg = (char *)"header crc mismatch";
+ state->mode = BAD;
+ break;
+ }
+ INITBITS();
+ }
+ if (state->head != Z_NULL) {
+ state->head->hcrc = (int)((state->flags >> 9) & 1);
+ state->head->done = 1;
+ }
+ strm->adler = state->check = crc32(0L, Z_NULL, 0);
+ state->mode = TYPE;
+ break;
+#endif
+ case DICTID:
+ NEEDBITS(32);
+ strm->adler = state->check = ZSWAP32(hold);
+ INITBITS();
+ state->mode = DICT;
+ case DICT:
+ if (state->havedict == 0) {
+ RESTORE();
+ return Z_NEED_DICT;
+ }
+ strm->adler = state->check = adler32(0L, Z_NULL, 0);
+ state->mode = TYPE;
+ case TYPE:
+ if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave;
+ case TYPEDO:
+ if (state->last) {
+ BYTEBITS();
+ state->mode = CHECK;
+ break;
+ }
+ NEEDBITS(3);
+ state->last = BITS(1);
+ DROPBITS(1);
+ switch (BITS(2)) {
+ case 0: /* stored block */
+ Tracev((stderr, "inflate: stored block%s\n",
+ state->last ? " (last)" : ""));
+ state->mode = STORED;
+ break;
+ case 1: /* fixed block */
+ fixedtables(state);
+ Tracev((stderr, "inflate: fixed codes block%s\n",
+ state->last ? " (last)" : ""));
+ state->mode = LEN_; /* decode codes */
+ if (flush == Z_TREES) {
+ DROPBITS(2);
+ goto inf_leave;
+ }
+ break;
+ case 2: /* dynamic block */
+ Tracev((stderr, "inflate: dynamic codes block%s\n",
+ state->last ? " (last)" : ""));
+ state->mode = TABLE;
+ break;
+ case 3:
+ strm->msg = (char *)"invalid block type";
+ state->mode = BAD;
+ }
+ DROPBITS(2);
+ break;
+ case STORED:
+ BYTEBITS(); /* go to byte boundary */
+ NEEDBITS(32);
+ if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
+ strm->msg = (char *)"invalid stored block lengths";
+ state->mode = BAD;
+ break;
+ }
+ state->length = (unsigned)hold & 0xffff;
+ Tracev((stderr, "inflate: stored length %u\n",
+ state->length));
+ INITBITS();
+ state->mode = COPY_;
+ if (flush == Z_TREES) goto inf_leave;
+ case COPY_:
+ state->mode = COPY;
+ case COPY:
+ copy = state->length;
+ if (copy) {
+ if (copy > have) copy = have;
+ if (copy > left) copy = left;
+ if (copy == 0) goto inf_leave;
+ zmemcpy(put, next, copy);
+ have -= copy;
+ next += copy;
+ left -= copy;
+ put += copy;
+ state->length -= copy;
+ break;
+ }
+ Tracev((stderr, "inflate: stored end\n"));
+ state->mode = TYPE;
+ break;
+ case TABLE:
+ NEEDBITS(14);
+ state->nlen = BITS(5) + 257;
+ DROPBITS(5);
+ state->ndist = BITS(5) + 1;
+ DROPBITS(5);
+ state->ncode = BITS(4) + 4;
+ DROPBITS(4);
+#ifndef PKZIP_BUG_WORKAROUND
+ if (state->nlen > 286 || state->ndist > 30) {
+ strm->msg = (char *)"too many length or distance symbols";
+ state->mode = BAD;
+ break;
+ }
+#endif
+ Tracev((stderr, "inflate: table sizes ok\n"));
+ state->have = 0;
+ state->mode = LENLENS;
+ case LENLENS:
+ while (state->have < state->ncode) {
+ NEEDBITS(3);
+ state->lens[order[state->have++]] = (unsigned short)BITS(3);
+ DROPBITS(3);
+ }
+ while (state->have < 19)
+ state->lens[order[state->have++]] = 0;
+ state->next = state->codes;
+ state->lencode = (const code FAR *)(state->next);
+ state->lenbits = 7;
+ ret = inflate_table(CODES, state->lens, 19, &(state->next),
+ &(state->lenbits), state->work);
+ if (ret) {
+ strm->msg = (char *)"invalid code lengths set";
+ state->mode = BAD;
+ break;
+ }
+ Tracev((stderr, "inflate: code lengths ok\n"));
+ state->have = 0;
+ state->mode = CODELENS;
+ case CODELENS:
+ while (state->have < state->nlen + state->ndist) {
+ for (;;) {
+ here = state->lencode[BITS(state->lenbits)];
+ if ((unsigned)(here.bits) <= bits) break;
+ PULLBYTE();
+ }
+ if (here.val < 16) {
+ DROPBITS(here.bits);
+ state->lens[state->have++] = here.val;
+ }
+ else {
+ if (here.val == 16) {
+ NEEDBITS(here.bits + 2);
+ DROPBITS(here.bits);
+ if (state->have == 0) {
+ strm->msg = (char *)"invalid bit length repeat";
+ state->mode = BAD;
+ break;
+ }
+ len = state->lens[state->have - 1];
+ copy = 3 + BITS(2);
+ DROPBITS(2);
+ }
+ else if (here.val == 17) {
+ NEEDBITS(here.bits + 3);
+ DROPBITS(here.bits);
+ len = 0;
+ copy = 3 + BITS(3);
+ DROPBITS(3);
+ }
+ else {
+ NEEDBITS(here.bits + 7);
+ DROPBITS(here.bits);
+ len = 0;
+ copy = 11 + BITS(7);
+ DROPBITS(7);
+ }
+ if (state->have + copy > state->nlen + state->ndist) {
+ strm->msg = (char *)"invalid bit length repeat";
+ state->mode = BAD;
+ break;
+ }
+ while (copy--)
+ state->lens[state->have++] = (unsigned short)len;
+ }
+ }
+
+ /* handle error breaks in while */
+ if (state->mode == BAD) break;
+
+ /* check for end-of-block code (better have one) */
+ if (state->lens[256] == 0) {
+ strm->msg = (char *)"invalid code -- missing end-of-block";
+ state->mode = BAD;
+ break;
+ }
+
+ /* build code tables -- note: do not change the lenbits or distbits
+ values here (9 and 6) without reading the comments in inftrees.h
+ concerning the ENOUGH constants, which depend on those values */
+ state->next = state->codes;
+ state->lencode = (const code FAR *)(state->next);
+ state->lenbits = 9;
+ ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
+ &(state->lenbits), state->work);
+ if (ret) {
+ strm->msg = (char *)"invalid literal/lengths set";
+ state->mode = BAD;
+ break;
+ }
+ state->distcode = (const code FAR *)(state->next);
+ state->distbits = 6;
+ ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
+ &(state->next), &(state->distbits), state->work);
+ if (ret) {
+ strm->msg = (char *)"invalid distances set";
+ state->mode = BAD;
+ break;
+ }
+ Tracev((stderr, "inflate: codes ok\n"));
+ state->mode = LEN_;
+ if (flush == Z_TREES) goto inf_leave;
+ case LEN_:
+ state->mode = LEN;
+ case LEN:
+ if (have >= 6 && left >= 258) {
+ RESTORE();
+ inflate_fast(strm, out);
+ LOAD();
+ if (state->mode == TYPE)
+ state->back = -1;
+ break;
+ }
+ state->back = 0;
+ for (;;) {
+ here = state->lencode[BITS(state->lenbits)];
+ if ((unsigned)(here.bits) <= bits) break;
+ PULLBYTE();
+ }
+ if (here.op && (here.op & 0xf0) == 0) {
+ last = here;
+ for (;;) {
+ here = state->lencode[last.val +
+ (BITS(last.bits + last.op) >> last.bits)];
+ if ((unsigned)(last.bits + here.bits) <= bits) break;
+ PULLBYTE();
+ }
+ DROPBITS(last.bits);
+ state->back += last.bits;
+ }
+ DROPBITS(here.bits);
+ state->back += here.bits;
+ state->length = (unsigned)here.val;
+ if ((int)(here.op) == 0) {
+ Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
+ "inflate: literal '%c'\n" :
+ "inflate: literal 0x%02x\n", here.val));
+ state->mode = LIT;
+ break;
+ }
+ if (here.op & 32) {
+ Tracevv((stderr, "inflate: end of block\n"));
+ state->back = -1;
+ state->mode = TYPE;
+ break;
+ }
+ if (here.op & 64) {
+ strm->msg = (char *)"invalid literal/length code";
+ state->mode = BAD;
+ break;
+ }
+ state->extra = (unsigned)(here.op) & 15;
+ state->mode = LENEXT;
+ case LENEXT:
+ if (state->extra) {
+ NEEDBITS(state->extra);
+ state->length += BITS(state->extra);
+ DROPBITS(state->extra);
+ state->back += state->extra;
+ }
+ Tracevv((stderr, "inflate: length %u\n", state->length));
+ state->was = state->length;
+ state->mode = DIST;
+ case DIST:
+ for (;;) {
+ here = state->distcode[BITS(state->distbits)];
+ if ((unsigned)(here.bits) <= bits) break;
+ PULLBYTE();
+ }
+ if ((here.op & 0xf0) == 0) {
+ last = here;
+ for (;;) {
+ here = state->distcode[last.val +
+ (BITS(last.bits + last.op) >> last.bits)];
+ if ((unsigned)(last.bits + here.bits) <= bits) break;
+ PULLBYTE();
+ }
+ DROPBITS(last.bits);
+ state->back += last.bits;
+ }
+ DROPBITS(here.bits);
+ state->back += here.bits;
+ if (here.op & 64) {
+ strm->msg = (char *)"invalid distance code";
+ state->mode = BAD;
+ break;
+ }
+ state->offset = (unsigned)here.val;
+ state->extra = (unsigned)(here.op) & 15;
+ state->mode = DISTEXT;
+ case DISTEXT:
+ if (state->extra) {
+ NEEDBITS(state->extra);
+ state->offset += BITS(state->extra);
+ DROPBITS(state->extra);
+ state->back += state->extra;
+ }
+#ifdef INFLATE_STRICT
+ if (state->offset > state->dmax) {
+ strm->msg = (char *)"invalid distance too far back";
+ state->mode = BAD;
+ break;
+ }
+#endif
+ Tracevv((stderr, "inflate: distance %u\n", state->offset));
+ state->mode = MATCH;
+ case MATCH:
+ if (left == 0) goto inf_leave;
+ copy = out - left;
+ if (state->offset > copy) { /* copy from window */
+ copy = state->offset - copy;
+ if (copy > state->whave) {
+ if (state->sane) {
+ strm->msg = (char *)"invalid distance too far back";
+ state->mode = BAD;
+ break;
+ }
+#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
+ Trace((stderr, "inflate.c too far\n"));
+ copy -= state->whave;
+ if (copy > state->length) copy = state->length;
+ if (copy > left) copy = left;
+ left -= copy;
+ state->length -= copy;
+ do {
+ *put++ = 0;
+ } while (--copy);
+ if (state->length == 0) state->mode = LEN;
+ break;
+#endif
+ }
+ if (copy > state->wnext) {
+ copy -= state->wnext;
+ from = state->window + (state->wsize - copy);
+ }
+ else
+ from = state->window + (state->wnext - copy);
+ if (copy > state->length) copy = state->length;
+ }
+ else { /* copy from output */
+ from = put - state->offset;
+ copy = state->length;
+ }
+ if (copy > left) copy = left;
+ left -= copy;
+ state->length -= copy;
+ do {
+ *put++ = *from++;
+ } while (--copy);
+ if (state->length == 0) state->mode = LEN;
+ break;
+ case LIT:
+ if (left == 0) goto inf_leave;
+ *put++ = (unsigned char)(state->length);
+ left--;
+ state->mode = LEN;
+ break;
+ case CHECK:
+ if (state->wrap) {
+ NEEDBITS(32);
+ out -= left;
+ strm->total_out += out;
+ state->total += out;
+ if (out)
+ strm->adler = state->check =
+ UPDATE(state->check, put - out, out);
+ out = left;
+ if ((
+#ifdef GUNZIP
+ state->flags ? hold :
+#endif
+ ZSWAP32(hold)) != state->check) {
+ strm->msg = (char *)"incorrect data check";
+ state->mode = BAD;
+ break;
+ }
+ INITBITS();
+ Tracev((stderr, "inflate: check matches trailer\n"));
+ }
+#ifdef GUNZIP
+ state->mode = LENGTH;
+ case LENGTH:
+ if (state->wrap && state->flags) {
+ NEEDBITS(32);
+ if (hold != (state->total & 0xffffffffUL)) {
+ strm->msg = (char *)"incorrect length check";
+ state->mode = BAD;
+ break;
+ }
+ INITBITS();
+ Tracev((stderr, "inflate: length matches trailer\n"));
+ }
+#endif
+ state->mode = DONE;
+ case DONE:
+ ret = Z_STREAM_END;
+ goto inf_leave;
+ case BAD:
+ ret = Z_DATA_ERROR;
+ goto inf_leave;
+ case MEM:
+ return Z_MEM_ERROR;
+ case SYNC:
+ default:
+ return Z_STREAM_ERROR;
+ }
+
+ /*
+ Return from inflate(), updating the total counts and the check value.
+ If there was no progress during the inflate() call, return a buffer
+ error. Call updatewindow() to create and/or update the window state.
+ Note: a memory error from inflate() is non-recoverable.
+ */
+ inf_leave:
+ RESTORE();
+ if (state->wsize || (out != strm->avail_out && state->mode < BAD &&
+ (state->mode < CHECK || flush != Z_FINISH)))
+ if (updatewindow(strm, strm->next_out, out - strm->avail_out)) {
+ state->mode = MEM;
+ return Z_MEM_ERROR;
+ }
+ in -= strm->avail_in;
+ out -= strm->avail_out;
+ strm->total_in += in;
+ strm->total_out += out;
+ state->total += out;
+ if (state->wrap && out)
+ strm->adler = state->check =
+ UPDATE(state->check, strm->next_out - out, out);
+ strm->data_type = state->bits + (state->last ? 64 : 0) +
+ (state->mode == TYPE ? 128 : 0) +
+ (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0);
+ if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
+ ret = Z_BUF_ERROR;
+ return ret;
+}
+
+int ZEXPORT inflateEnd(strm)
+z_streamp strm;
+{
+ struct inflate_state FAR *state;
+ if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
+ return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+ if (state->window != Z_NULL) ZFREE(strm, state->window);
+ ZFREE(strm, strm->state);
+ strm->state = Z_NULL;
+ Tracev((stderr, "inflate: end\n"));
+ return Z_OK;
+}
+
+int ZEXPORT inflateGetDictionary(strm, dictionary, dictLength)
+z_streamp strm;
+Bytef *dictionary;
+uInt *dictLength;
+{
+ struct inflate_state FAR *state;
+
+ /* check state */
+ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+
+ /* copy dictionary */
+ if (state->whave && dictionary != Z_NULL) {
+ zmemcpy(dictionary, state->window + state->wnext,
+ state->whave - state->wnext);
+ zmemcpy(dictionary + state->whave - state->wnext,
+ state->window, state->wnext);
+ }
+ if (dictLength != Z_NULL)
+ *dictLength = state->whave;
+ return Z_OK;
+}
+
+int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength)
+z_streamp strm;
+const Bytef *dictionary;
+uInt dictLength;
+{
+ struct inflate_state FAR *state;
+ unsigned long dictid;
+ int ret;
+
+ /* check state */
+ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+ if (state->wrap != 0 && state->mode != DICT)
+ return Z_STREAM_ERROR;
+
+ /* check for correct dictionary identifier */
+ if (state->mode == DICT) {
+ dictid = adler32(0L, Z_NULL, 0);
+ dictid = adler32(dictid, dictionary, dictLength);
+ if (dictid != state->check)
+ return Z_DATA_ERROR;
+ }
+
+ /* copy dictionary to window using updatewindow(), which will amend the
+ existing dictionary if appropriate */
+ ret = updatewindow(strm, dictionary + dictLength, dictLength);
+ if (ret) {
+ state->mode = MEM;
+ return Z_MEM_ERROR;
+ }
+ state->havedict = 1;
+ Tracev((stderr, "inflate: dictionary set\n"));
+ return Z_OK;
+}
+
+int ZEXPORT inflateGetHeader(strm, head)
+z_streamp strm;
+gz_headerp head;
+{
+ struct inflate_state FAR *state;
+
+ /* check state */
+ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+ if ((state->wrap & 2) == 0) return Z_STREAM_ERROR;
+
+ /* save header structure */
+ state->head = head;
+ head->done = 0;
+ return Z_OK;
+}
+
+/*
+ Search buf[0..len-1] for the pattern: 0, 0, 0xff, 0xff. Return when found
+ or when out of input. When called, *have is the number of pattern bytes
+ found in order so far, in 0..3. On return *have is updated to the new
+ state. If on return *have equals four, then the pattern was found and the
+ return value is how many bytes were read including the last byte of the
+ pattern. If *have is less than four, then the pattern has not been found
+ yet and the return value is len. In the latter case, syncsearch() can be
+ called again with more data and the *have state. *have is initialized to
+ zero for the first call.
+ */
+local unsigned syncsearch(have, buf, len)
+unsigned FAR *have;
+const unsigned char FAR *buf;
+unsigned len;
+{
+ unsigned got;
+ unsigned next;
+
+ got = *have;
+ next = 0;
+ while (next < len && got < 4) {
+ if ((int)(buf[next]) == (got < 2 ? 0 : 0xff))
+ got++;
+ else if (buf[next])
+ got = 0;
+ else
+ got = 4 - got;
+ next++;
+ }
+ *have = got;
+ return next;
+}
+
+int ZEXPORT inflateSync(strm)
+z_streamp strm;
+{
+ unsigned len; /* number of bytes to look at or looked at */
+ unsigned long in, out; /* temporary to save total_in and total_out */
+ unsigned char buf[4]; /* to restore bit buffer to byte string */
+ struct inflate_state FAR *state;
+
+ /* check parameters */
+ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+ if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR;
+
+ /* if first time, start search in bit buffer */
+ if (state->mode != SYNC) {
+ state->mode = SYNC;
+ state->hold <<= state->bits & 7;
+ state->bits -= state->bits & 7;
+ len = 0;
+ while (state->bits >= 8) {
+ buf[len++] = (unsigned char)(state->hold);
+ state->hold >>= 8;
+ state->bits -= 8;
+ }
+ state->have = 0;
+ syncsearch(&(state->have), buf, len);
+ }
+
+ /* search available input */
+ len = syncsearch(&(state->have), strm->next_in, strm->avail_in);
+ strm->avail_in -= len;
+ strm->next_in += len;
+ strm->total_in += len;
+
+ /* return no joy or set up to restart inflate() on a new block */
+ if (state->have != 4) return Z_DATA_ERROR;
+ in = strm->total_in; out = strm->total_out;
+ inflateReset(strm);
+ strm->total_in = in; strm->total_out = out;
+ state->mode = TYPE;
+ return Z_OK;
+}
+
+/*
+ Returns true if inflate is currently at the end of a block generated by
+ Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP
+ implementation to provide an additional safety check. PPP uses
+ Z_SYNC_FLUSH but removes the length bytes of the resulting empty stored
+ block. When decompressing, PPP checks that at the end of input packet,
+ inflate is waiting for these length bytes.
+ */
+int ZEXPORT inflateSyncPoint(strm)
+z_streamp strm;
+{
+ struct inflate_state FAR *state;
+
+ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+ return state->mode == STORED && state->bits == 0;
+}
+
+int ZEXPORT inflateCopy(dest, source)
+z_streamp dest;
+z_streamp source;
+{
+ struct inflate_state FAR *state;
+ struct inflate_state FAR *copy;
+ unsigned char FAR *window;
+ unsigned wsize;
+
+ /* check input */
+ if (dest == Z_NULL || source == Z_NULL || source->state == Z_NULL ||
+ source->zalloc == (alloc_func)0 || source->zfree == (free_func)0)
+ return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)source->state;
+
+ /* allocate space */
+ copy = (struct inflate_state FAR *)
+ ZALLOC(source, 1, sizeof(struct inflate_state));
+ if (copy == Z_NULL) return Z_MEM_ERROR;
+ window = Z_NULL;
+ if (state->window != Z_NULL) {
+ window = (unsigned char FAR *)
+ ZALLOC(source, 1U << state->wbits, sizeof(unsigned char));
+ if (window == Z_NULL) {
+ ZFREE(source, copy);
+ return Z_MEM_ERROR;
+ }
+ }
+
+ /* copy state */
+ zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream));
+ zmemcpy((voidpf)copy, (voidpf)state, sizeof(struct inflate_state));
+ if (state->lencode >= state->codes &&
+ state->lencode <= state->codes + ENOUGH - 1) {
+ copy->lencode = copy->codes + (state->lencode - state->codes);
+ copy->distcode = copy->codes + (state->distcode - state->codes);
+ }
+ copy->next = copy->codes + (state->next - state->codes);
+ if (window != Z_NULL) {
+ wsize = 1U << state->wbits;
+ zmemcpy(window, state->window, wsize);
+ }
+ copy->window = window;
+ dest->state = (struct internal_state FAR *)copy;
+ return Z_OK;
+}
+
+int ZEXPORT inflateUndermine(strm, subvert)
+z_streamp strm;
+int subvert;
+{
+ struct inflate_state FAR *state;
+
+ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+ state->sane = !subvert;
+#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
+ return Z_OK;
+#else
+ state->sane = 1;
+ return Z_DATA_ERROR;
+#endif
+}
+
+long ZEXPORT inflateMark(strm)
+z_streamp strm;
+{
+ struct inflate_state FAR *state;
+
+ if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
+ state = (struct inflate_state FAR *)strm->state;
+ return ((long)(state->back) << 16) +
+ (state->mode == COPY ? state->length :
+ (state->mode == MATCH ? state->was - state->length : 0));
+}
diff --git a/protocols/Telegram/tgl/zlib/inflate.h b/protocols/Telegram/tgl/zlib/inflate.h
new file mode 100644
index 0000000000..95f4986d40
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/inflate.h
@@ -0,0 +1,122 @@
+/* inflate.h -- internal inflate state definition
+ * Copyright (C) 1995-2009 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+/* define NO_GZIP when compiling if you want to disable gzip header and
+ trailer decoding by inflate(). NO_GZIP would be used to avoid linking in
+ the crc code when it is not needed. For shared libraries, gzip decoding
+ should be left enabled. */
+#ifndef NO_GZIP
+# define GUNZIP
+#endif
+
+/* Possible inflate modes between inflate() calls */
+typedef enum {
+ HEAD, /* i: waiting for magic header */
+ FLAGS, /* i: waiting for method and flags (gzip) */
+ TIME, /* i: waiting for modification time (gzip) */
+ OS, /* i: waiting for extra flags and operating system (gzip) */
+ EXLEN, /* i: waiting for extra length (gzip) */
+ EXTRA, /* i: waiting for extra bytes (gzip) */
+ NAME, /* i: waiting for end of file name (gzip) */
+ COMMENT, /* i: waiting for end of comment (gzip) */
+ HCRC, /* i: waiting for header crc (gzip) */
+ DICTID, /* i: waiting for dictionary check value */
+ DICT, /* waiting for inflateSetDictionary() call */
+ TYPE, /* i: waiting for type bits, including last-flag bit */
+ TYPEDO, /* i: same, but skip check to exit inflate on new block */
+ STORED, /* i: waiting for stored size (length and complement) */
+ COPY_, /* i/o: same as COPY below, but only first time in */
+ COPY, /* i/o: waiting for input or output to copy stored block */
+ TABLE, /* i: waiting for dynamic block table lengths */
+ LENLENS, /* i: waiting for code length code lengths */
+ CODELENS, /* i: waiting for length/lit and distance code lengths */
+ LEN_, /* i: same as LEN below, but only first time in */
+ LEN, /* i: waiting for length/lit/eob code */
+ LENEXT, /* i: waiting for length extra bits */
+ DIST, /* i: waiting for distance code */
+ DISTEXT, /* i: waiting for distance extra bits */
+ MATCH, /* o: waiting for output space to copy string */
+ LIT, /* o: waiting for output space to write literal */
+ CHECK, /* i: waiting for 32-bit check value */
+ LENGTH, /* i: waiting for 32-bit length (gzip) */
+ DONE, /* finished check, done -- remain here until reset */
+ BAD, /* got a data error -- remain here until reset */
+ MEM, /* got an inflate() memory error -- remain here until reset */
+ SYNC /* looking for synchronization bytes to restart inflate() */
+} inflate_mode;
+
+/*
+ State transitions between above modes -
+
+ (most modes can go to BAD or MEM on error -- not shown for clarity)
+
+ Process header:
+ HEAD -> (gzip) or (zlib) or (raw)
+ (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME -> COMMENT ->
+ HCRC -> TYPE
+ (zlib) -> DICTID or TYPE
+ DICTID -> DICT -> TYPE
+ (raw) -> TYPEDO
+ Read deflate blocks:
+ TYPE -> TYPEDO -> STORED or TABLE or LEN_ or CHECK
+ STORED -> COPY_ -> COPY -> TYPE
+ TABLE -> LENLENS -> CODELENS -> LEN_
+ LEN_ -> LEN
+ Read deflate codes in fixed or dynamic block:
+ LEN -> LENEXT or LIT or TYPE
+ LENEXT -> DIST -> DISTEXT -> MATCH -> LEN
+ LIT -> LEN
+ Process trailer:
+ CHECK -> LENGTH -> DONE
+ */
+
+/* state maintained between inflate() calls. Approximately 10K bytes. */
+struct inflate_state {
+ inflate_mode mode; /* current inflate mode */
+ int last; /* true if processing last block */
+ int wrap; /* bit 0 true for zlib, bit 1 true for gzip */
+ int havedict; /* true if dictionary provided */
+ int flags; /* gzip header method and flags (0 if zlib) */
+ unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */
+ unsigned long check; /* protected copy of check value */
+ unsigned long total; /* protected copy of output count */
+ gz_headerp head; /* where to save gzip header information */
+ /* sliding window */
+ unsigned wbits; /* log base 2 of requested window size */
+ unsigned wsize; /* window size or zero if not using window */
+ unsigned whave; /* valid bytes in the window */
+ unsigned wnext; /* window write index */
+ unsigned char FAR *window; /* allocated sliding window, if needed */
+ /* bit accumulator */
+ unsigned long hold; /* input bit accumulator */
+ unsigned bits; /* number of bits in "in" */
+ /* for string and stored block copying */
+ unsigned length; /* literal or length of data to copy */
+ unsigned offset; /* distance back to copy string from */
+ /* for table and code decoding */
+ unsigned extra; /* extra bits needed */
+ /* fixed and dynamic code tables */
+ code const FAR *lencode; /* starting table for length/literal codes */
+ code const FAR *distcode; /* starting table for distance codes */
+ unsigned lenbits; /* index bits for lencode */
+ unsigned distbits; /* index bits for distcode */
+ /* dynamic table building */
+ unsigned ncode; /* number of code length code lengths */
+ unsigned nlen; /* number of length code lengths */
+ unsigned ndist; /* number of distance code lengths */
+ unsigned have; /* number of code lengths in lens[] */
+ code FAR *next; /* next available space in codes[] */
+ unsigned short lens[320]; /* temporary storage for code lengths */
+ unsigned short work[288]; /* work area for code table building */
+ code codes[ENOUGH]; /* space for code tables */
+ int sane; /* if false, allow invalid distance too far */
+ int back; /* bits back of last unprocessed length/lit */
+ unsigned was; /* initial length of match */
+};
diff --git a/protocols/Telegram/tgl/zlib/inftrees.c b/protocols/Telegram/tgl/zlib/inftrees.c
new file mode 100644
index 0000000000..44d89cf24e
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/inftrees.c
@@ -0,0 +1,306 @@
+/* inftrees.c -- generate Huffman trees for efficient decoding
+ * Copyright (C) 1995-2013 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+
+#define MAXBITS 15
+
+const char inflate_copyright[] =
+ " inflate 1.2.8 Copyright 1995-2013 Mark Adler ";
+/*
+ If you use the zlib library in a product, an acknowledgment is welcome
+ in the documentation of your product. If for some reason you cannot
+ include such an acknowledgment, I would appreciate that you keep this
+ copyright string in the executable of your product.
+ */
+
+/*
+ Build a set of tables to decode the provided canonical Huffman code.
+ The code lengths are lens[0..codes-1]. The result starts at *table,
+ whose indices are 0..2^bits-1. work is a writable array of at least
+ lens shorts, which is used as a work area. type is the type of code
+ to be generated, CODES, LENS, or DISTS. On return, zero is success,
+ -1 is an invalid code, and +1 means that ENOUGH isn't enough. table
+ on return points to the next available entry's address. bits is the
+ requested root table index bits, and on return it is the actual root
+ table index bits. It will differ if the request is greater than the
+ longest code or if it is less than the shortest code.
+ */
+int ZLIB_INTERNAL inflate_table(type, lens, codes, table, bits, work)
+codetype type;
+unsigned short FAR *lens;
+unsigned codes;
+code FAR * FAR *table;
+unsigned FAR *bits;
+unsigned short FAR *work;
+{
+ unsigned len; /* a code's length in bits */
+ unsigned sym; /* index of code symbols */
+ unsigned min, max; /* minimum and maximum code lengths */
+ unsigned root; /* number of index bits for root table */
+ unsigned curr; /* number of index bits for current table */
+ unsigned drop; /* code bits to drop for sub-table */
+ int left; /* number of prefix codes available */
+ unsigned used; /* code entries in table used */
+ unsigned huff; /* Huffman code */
+ unsigned incr; /* for incrementing code, index */
+ unsigned fill; /* index for replicating entries */
+ unsigned low; /* low bits for current root entry */
+ unsigned mask; /* mask for low root bits */
+ code here; /* table entry for duplication */
+ code FAR *next; /* next available space in table */
+ const unsigned short FAR *base; /* base value table to use */
+ const unsigned short FAR *extra; /* extra bits table to use */
+ int end; /* use base and extra for symbol > end */
+ unsigned short count[MAXBITS+1]; /* number of codes of each length */
+ unsigned short offs[MAXBITS+1]; /* offsets in table for each length */
+ static const unsigned short lbase[31] = { /* Length codes 257..285 base */
+ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
+ 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
+ static const unsigned short lext[31] = { /* Length codes 257..285 extra */
+ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
+ 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78};
+ static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
+ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
+ 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
+ 8193, 12289, 16385, 24577, 0, 0};
+ static const unsigned short dext[32] = { /* Distance codes 0..29 extra */
+ 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
+ 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
+ 28, 28, 29, 29, 64, 64};
+
+ /*
+ Process a set of code lengths to create a canonical Huffman code. The
+ code lengths are lens[0..codes-1]. Each length corresponds to the
+ symbols 0..codes-1. The Huffman code is generated by first sorting the
+ symbols by length from short to long, and retaining the symbol order
+ for codes with equal lengths. Then the code starts with all zero bits
+ for the first code of the shortest length, and the codes are integer
+ increments for the same length, and zeros are appended as the length
+ increases. For the deflate format, these bits are stored backwards
+ from their more natural integer increment ordering, and so when the
+ decoding tables are built in the large loop below, the integer codes
+ are incremented backwards.
+
+ This routine assumes, but does not check, that all of the entries in
+ lens[] are in the range 0..MAXBITS. The caller must assure this.
+ 1..MAXBITS is interpreted as that code length. zero means that that
+ symbol does not occur in this code.
+
+ The codes are sorted by computing a count of codes for each length,
+ creating from that a table of starting indices for each length in the
+ sorted table, and then entering the symbols in order in the sorted
+ table. The sorted table is work[], with that space being provided by
+ the caller.
+
+ The length counts are used for other purposes as well, i.e. finding
+ the minimum and maximum length codes, determining if there are any
+ codes at all, checking for a valid set of lengths, and looking ahead
+ at length counts to determine sub-table sizes when building the
+ decoding tables.
+ */
+
+ /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
+ for (len = 0; len <= MAXBITS; len++)
+ count[len] = 0;
+ for (sym = 0; sym < codes; sym++)
+ count[lens[sym]]++;
+
+ /* bound code lengths, force root to be within code lengths */
+ root = *bits;
+ for (max = MAXBITS; max >= 1; max--)
+ if (count[max] != 0) break;
+ if (root > max) root = max;
+ if (max == 0) { /* no symbols to code at all */
+ here.op = (unsigned char)64; /* invalid code marker */
+ here.bits = (unsigned char)1;
+ here.val = (unsigned short)0;
+ *(*table)++ = here; /* make a table to force an error */
+ *(*table)++ = here;
+ *bits = 1;
+ return 0; /* no symbols, but wait for decoding to report error */
+ }
+ for (min = 1; min < max; min++)
+ if (count[min] != 0) break;
+ if (root < min) root = min;
+
+ /* check for an over-subscribed or incomplete set of lengths */
+ left = 1;
+ for (len = 1; len <= MAXBITS; len++) {
+ left <<= 1;
+ left -= count[len];
+ if (left < 0) return -1; /* over-subscribed */
+ }
+ if (left > 0 && (type == CODES || max != 1))
+ return -1; /* incomplete set */
+
+ /* generate offsets into symbol table for each length for sorting */
+ offs[1] = 0;
+ for (len = 1; len < MAXBITS; len++)
+ offs[len + 1] = offs[len] + count[len];
+
+ /* sort symbols by length, by symbol order within each length */
+ for (sym = 0; sym < codes; sym++)
+ if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym;
+
+ /*
+ Create and fill in decoding tables. In this loop, the table being
+ filled is at next and has curr index bits. The code being used is huff
+ with length len. That code is converted to an index by dropping drop
+ bits off of the bottom. For codes where len is less than drop + curr,
+ those top drop + curr - len bits are incremented through all values to
+ fill the table with replicated entries.
+
+ root is the number of index bits for the root table. When len exceeds
+ root, sub-tables are created pointed to by the root entry with an index
+ of the low root bits of huff. This is saved in low to check for when a
+ new sub-table should be started. drop is zero when the root table is
+ being filled, and drop is root when sub-tables are being filled.
+
+ When a new sub-table is needed, it is necessary to look ahead in the
+ code lengths to determine what size sub-table is needed. The length
+ counts are used for this, and so count[] is decremented as codes are
+ entered in the tables.
+
+ used keeps track of how many table entries have been allocated from the
+ provided *table space. It is checked for LENS and DIST tables against
+ the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
+ the initial root table size constants. See the comments in inftrees.h
+ for more information.
+
+ sym increments through all symbols, and the loop terminates when
+ all codes of length max, i.e. all codes, have been processed. This
+ routine permits incomplete codes, so another loop after this one fills
+ in the rest of the decoding tables with invalid code markers.
+ */
+
+ /* set up for code type */
+ switch (type) {
+ case CODES:
+ base = extra = work; /* dummy value--not used */
+ end = 19;
+ break;
+ case LENS:
+ base = lbase;
+ base -= 257;
+ extra = lext;
+ extra -= 257;
+ end = 256;
+ break;
+ default: /* DISTS */
+ base = dbase;
+ extra = dext;
+ end = -1;
+ }
+
+ /* initialize state for loop */
+ huff = 0; /* starting code */
+ sym = 0; /* starting code symbol */
+ len = min; /* starting code length */
+ next = *table; /* current table to fill in */
+ curr = root; /* current table index bits */
+ drop = 0; /* current bits to drop from code for index */
+ low = (unsigned)(-1); /* trigger new sub-table when len > root */
+ used = 1U << root; /* use root table entries */
+ mask = used - 1; /* mask for comparing low */
+
+ /* check available table space */
+ if ((type == LENS && used > ENOUGH_LENS) ||
+ (type == DISTS && used > ENOUGH_DISTS))
+ return 1;
+
+ /* process all codes and make table entries */
+ for (;;) {
+ /* create table entry */
+ here.bits = (unsigned char)(len - drop);
+ if ((int)(work[sym]) < end) {
+ here.op = (unsigned char)0;
+ here.val = work[sym];
+ }
+ else if ((int)(work[sym]) > end) {
+ here.op = (unsigned char)(extra[work[sym]]);
+ here.val = base[work[sym]];
+ }
+ else {
+ here.op = (unsigned char)(32 + 64); /* end of block */
+ here.val = 0;
+ }
+
+ /* replicate for those indices with low len bits equal to huff */
+ incr = 1U << (len - drop);
+ fill = 1U << curr;
+ min = fill; /* save offset to next table */
+ do {
+ fill -= incr;
+ next[(huff >> drop) + fill] = here;
+ } while (fill != 0);
+
+ /* backwards increment the len-bit code huff */
+ incr = 1U << (len - 1);
+ while (huff & incr)
+ incr >>= 1;
+ if (incr != 0) {
+ huff &= incr - 1;
+ huff += incr;
+ }
+ else
+ huff = 0;
+
+ /* go to next symbol, update count, len */
+ sym++;
+ if (--(count[len]) == 0) {
+ if (len == max) break;
+ len = lens[work[sym]];
+ }
+
+ /* create new sub-table if needed */
+ if (len > root && (huff & mask) != low) {
+ /* if first time, transition to sub-tables */
+ if (drop == 0)
+ drop = root;
+
+ /* increment past last table */
+ next += min; /* here min is 1 << curr */
+
+ /* determine length of next table */
+ curr = len - drop;
+ left = (int)(1 << curr);
+ while (curr + drop < max) {
+ left -= count[curr + drop];
+ if (left <= 0) break;
+ curr++;
+ left <<= 1;
+ }
+
+ /* check for enough space */
+ used += 1U << curr;
+ if ((type == LENS && used > ENOUGH_LENS) ||
+ (type == DISTS && used > ENOUGH_DISTS))
+ return 1;
+
+ /* point entry in root table to sub-table */
+ low = huff & mask;
+ (*table)[low].op = (unsigned char)curr;
+ (*table)[low].bits = (unsigned char)root;
+ (*table)[low].val = (unsigned short)(next - *table);
+ }
+ }
+
+ /* fill in remaining table entry if code is incomplete (guaranteed to have
+ at most one remaining entry, since if the code is incomplete, the
+ maximum code length that was allowed to get this far is one bit) */
+ if (huff != 0) {
+ here.op = (unsigned char)64; /* invalid code marker */
+ here.bits = (unsigned char)(len - drop);
+ here.val = (unsigned short)0;
+ next[huff] = here;
+ }
+
+ /* set return parameters */
+ *table += used;
+ *bits = root;
+ return 0;
+}
diff --git a/protocols/Telegram/tgl/zlib/inftrees.h b/protocols/Telegram/tgl/zlib/inftrees.h
new file mode 100644
index 0000000000..baa53a0b1a
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/inftrees.h
@@ -0,0 +1,62 @@
+/* inftrees.h -- header to use inftrees.c
+ * Copyright (C) 1995-2005, 2010 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+/* Structure for decoding tables. Each entry provides either the
+ information needed to do the operation requested by the code that
+ indexed that table entry, or it provides a pointer to another
+ table that indexes more bits of the code. op indicates whether
+ the entry is a pointer to another table, a literal, a length or
+ distance, an end-of-block, or an invalid code. For a table
+ pointer, the low four bits of op is the number of index bits of
+ that table. For a length or distance, the low four bits of op
+ is the number of extra bits to get after the code. bits is
+ the number of bits in this code or part of the code to drop off
+ of the bit buffer. val is the actual byte to output in the case
+ of a literal, the base length or distance, or the offset from
+ the current table to the next table. Each entry is four bytes. */
+typedef struct {
+ unsigned char op; /* operation, extra bits, table bits */
+ unsigned char bits; /* bits in this part of the code */
+ unsigned short val; /* offset in table or code value */
+} code;
+
+/* op values as set by inflate_table():
+ 00000000 - literal
+ 0000tttt - table link, tttt != 0 is the number of table index bits
+ 0001eeee - length or distance, eeee is the number of extra bits
+ 01100000 - end of block
+ 01000000 - invalid code
+ */
+
+/* Maximum size of the dynamic table. The maximum number of code structures is
+ 1444, which is the sum of 852 for literal/length codes and 592 for distance
+ codes. These values were found by exhaustive searches using the program
+ examples/enough.c found in the zlib distribtution. The arguments to that
+ program are the number of symbols, the initial root table size, and the
+ maximum bit length of a code. "enough 286 9 15" for literal/length codes
+ returns returns 852, and "enough 30 6 15" for distance codes returns 592.
+ The initial root table size (9 or 6) is found in the fifth argument of the
+ inflate_table() calls in inflate.c and infback.c. If the root table size is
+ changed, then these maximum sizes would be need to be recalculated and
+ updated. */
+#define ENOUGH_LENS 852
+#define ENOUGH_DISTS 592
+#define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS)
+
+/* Type of code to build for inflate_table() */
+typedef enum {
+ CODES,
+ LENS,
+ DISTS
+} codetype;
+
+int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,
+ unsigned codes, code FAR * FAR *table,
+ unsigned FAR *bits, unsigned short FAR *work));
diff --git a/protocols/Telegram/tgl/zlib/make_vms.com b/protocols/Telegram/tgl/zlib/make_vms.com
new file mode 100644
index 0000000000..65e9d0cbc8
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/make_vms.com
@@ -0,0 +1,867 @@
+$! make libz under VMS written by
+$! Martin P.J. Zinser
+$!
+$! In case of problems with the install you might contact me at
+$! zinser@zinser.no-ip.info(preferred) or
+$! martin.zinser@eurexchange.com (work)
+$!
+$! Make procedure history for Zlib
+$!
+$!------------------------------------------------------------------------------
+$! Version history
+$! 0.01 20060120 First version to receive a number
+$! 0.02 20061008 Adapt to new Makefile.in
+$! 0.03 20091224 Add support for large file check
+$! 0.04 20100110 Add new gzclose, gzlib, gzread, gzwrite
+$! 0.05 20100221 Exchange zlibdefs.h by zconf.h.in
+$! 0.06 20120111 Fix missing amiss_err, update zconf_h.in, fix new exmples
+$! subdir path, update module search in makefile.in
+$! 0.07 20120115 Triggered by work done by Alexey Chupahin completly redesigned
+$! shared image creation
+$! 0.08 20120219 Make it work on VAX again, pre-load missing symbols to shared
+$! image
+$! 0.09 20120305 SMS. P1 sets builder ("MMK", "MMS", " " (built-in)).
+$! "" -> automatic, preference: MMK, MMS, built-in.
+$!
+$ on error then goto err_exit
+$!
+$ true = 1
+$ false = 0
+$ tmpnam = "temp_" + f$getjpi("","pid")
+$ tt = tmpnam + ".txt"
+$ tc = tmpnam + ".c"
+$ th = tmpnam + ".h"
+$ define/nolog tconfig 'th'
+$ its_decc = false
+$ its_vaxc = false
+$ its_gnuc = false
+$ s_case = False
+$!
+$! Setup variables holding "config" information
+$!
+$ Make = "''p1'"
+$ name = "Zlib"
+$ version = "?.?.?"
+$ v_string = "ZLIB_VERSION"
+$ v_file = "zlib.h"
+$ ccopt = "/include = []"
+$ lopts = ""
+$ dnsrl = ""
+$ aconf_in_file = "zconf.h.in#zconf.h_in#zconf_h.in"
+$ conf_check_string = ""
+$ linkonly = false
+$ optfile = name + ".opt"
+$ mapfile = name + ".map"
+$ libdefs = ""
+$ vax = f$getsyi("HW_MODEL").lt.1024
+$ axp = f$getsyi("HW_MODEL").ge.1024 .and. f$getsyi("HW_MODEL").lt.4096
+$ ia64 = f$getsyi("HW_MODEL").ge.4096
+$!
+$! 2012-03-05 SMS.
+$! Why is this needed? And if it is needed, why not simply ".not. vax"?
+$!
+$!!! if axp .or. ia64 then set proc/parse=extended
+$!
+$ whoami = f$parse(f$environment("Procedure"),,,,"NO_CONCEAL")
+$ mydef = F$parse(whoami,,,"DEVICE")
+$ mydir = f$parse(whoami,,,"DIRECTORY") - "]["
+$ myproc = f$parse(whoami,,,"Name") + f$parse(whoami,,,"type")
+$!
+$! Check for MMK/MMS
+$!
+$ if (Make .eqs. "")
+$ then
+$ If F$Search ("Sys$System:MMS.EXE") .nes. "" Then Make = "MMS"
+$ If F$Type (MMK) .eqs. "STRING" Then Make = "MMK"
+$ else
+$ Make = f$edit( Make, "trim")
+$ endif
+$!
+$ gosub find_version
+$!
+$ open/write topt tmp.opt
+$ open/write optf 'optfile'
+$!
+$ gosub check_opts
+$!
+$! Look for the compiler used
+$!
+$ gosub check_compiler
+$ close topt
+$ close optf
+$!
+$ if its_decc
+$ then
+$ ccopt = "/prefix=all" + ccopt
+$ if f$trnlnm("SYS") .eqs. ""
+$ then
+$ if axp
+$ then
+$ define sys sys$library:
+$ else
+$ ccopt = "/decc" + ccopt
+$ define sys decc$library_include:
+$ endif
+$ endif
+$!
+$! 2012-03-05 SMS.
+$! Why /NAMES = AS_IS? Why not simply ".not. vax"? And why not on VAX?
+$!
+$ if axp .or. ia64
+$ then
+$ ccopt = ccopt + "/name=as_is/opt=(inline=speed)"
+$ s_case = true
+$ endif
+$ endif
+$ if its_vaxc .or. its_gnuc
+$ then
+$ if f$trnlnm("SYS").eqs."" then define sys sys$library:
+$ endif
+$!
+$! Build a fake configure input header
+$!
+$ open/write conf_hin config.hin
+$ write conf_hin "#undef _LARGEFILE64_SOURCE"
+$ close conf_hin
+$!
+$!
+$ i = 0
+$FIND_ACONF:
+$ fname = f$element(i,"#",aconf_in_file)
+$ if fname .eqs. "#" then goto AMISS_ERR
+$ if f$search(fname) .eqs. ""
+$ then
+$ i = i + 1
+$ goto find_aconf
+$ endif
+$ open/read/err=aconf_err aconf_in 'fname'
+$ open/write aconf zconf.h
+$ACONF_LOOP:
+$ read/end_of_file=aconf_exit aconf_in line
+$ work = f$edit(line, "compress,trim")
+$ if f$extract(0,6,work) .nes. "#undef"
+$ then
+$ if f$extract(0,12,work) .nes. "#cmakedefine"
+$ then
+$ write aconf line
+$ endif
+$ else
+$ cdef = f$element(1," ",work)
+$ gosub check_config
+$ endif
+$ goto aconf_loop
+$ACONF_EXIT:
+$ write aconf ""
+$ write aconf "/* VMS specifics added by make_vms.com: */"
+$ write aconf "#define VMS 1"
+$ write aconf "#include <unistd.h>"
+$ write aconf "#include <unixio.h>"
+$ write aconf "#ifdef _LARGEFILE"
+$ write aconf "# define off64_t __off64_t"
+$ write aconf "# define fopen64 fopen"
+$ write aconf "# define fseeko64 fseeko"
+$ write aconf "# define lseek64 lseek"
+$ write aconf "# define ftello64 ftell"
+$ write aconf "#endif"
+$ write aconf "#if !defined( __VAX) && (__CRTL_VER >= 70312000)"
+$ write aconf "# define HAVE_VSNPRINTF"
+$ write aconf "#endif"
+$ close aconf_in
+$ close aconf
+$ if f$search("''th'") .nes. "" then delete 'th';*
+$! Build the thing plain or with mms
+$!
+$ write sys$output "Compiling Zlib sources ..."
+$ if make.eqs.""
+$ then
+$ if (f$search( "example.obj;*") .nes. "") then delete example.obj;*
+$ if (f$search( "minigzip.obj;*") .nes. "") then delete minigzip.obj;*
+$ CALL MAKE adler32.OBJ "CC ''CCOPT' adler32" -
+ adler32.c zlib.h zconf.h
+$ CALL MAKE compress.OBJ "CC ''CCOPT' compress" -
+ compress.c zlib.h zconf.h
+$ CALL MAKE crc32.OBJ "CC ''CCOPT' crc32" -
+ crc32.c zlib.h zconf.h
+$ CALL MAKE deflate.OBJ "CC ''CCOPT' deflate" -
+ deflate.c deflate.h zutil.h zlib.h zconf.h
+$ CALL MAKE gzclose.OBJ "CC ''CCOPT' gzclose" -
+ gzclose.c zutil.h zlib.h zconf.h
+$ CALL MAKE gzlib.OBJ "CC ''CCOPT' gzlib" -
+ gzlib.c zutil.h zlib.h zconf.h
+$ CALL MAKE gzread.OBJ "CC ''CCOPT' gzread" -
+ gzread.c zutil.h zlib.h zconf.h
+$ CALL MAKE gzwrite.OBJ "CC ''CCOPT' gzwrite" -
+ gzwrite.c zutil.h zlib.h zconf.h
+$ CALL MAKE infback.OBJ "CC ''CCOPT' infback" -
+ infback.c zutil.h inftrees.h inflate.h inffast.h inffixed.h
+$ CALL MAKE inffast.OBJ "CC ''CCOPT' inffast" -
+ inffast.c zutil.h zlib.h zconf.h inffast.h
+$ CALL MAKE inflate.OBJ "CC ''CCOPT' inflate" -
+ inflate.c zutil.h zlib.h zconf.h infblock.h
+$ CALL MAKE inftrees.OBJ "CC ''CCOPT' inftrees" -
+ inftrees.c zutil.h zlib.h zconf.h inftrees.h
+$ CALL MAKE trees.OBJ "CC ''CCOPT' trees" -
+ trees.c deflate.h zutil.h zlib.h zconf.h
+$ CALL MAKE uncompr.OBJ "CC ''CCOPT' uncompr" -
+ uncompr.c zlib.h zconf.h
+$ CALL MAKE zutil.OBJ "CC ''CCOPT' zutil" -
+ zutil.c zutil.h zlib.h zconf.h
+$ write sys$output "Building Zlib ..."
+$ CALL MAKE libz.OLB "lib/crea libz.olb *.obj" *.OBJ
+$ write sys$output "Building example..."
+$ CALL MAKE example.OBJ "CC ''CCOPT' [.test]example" -
+ [.test]example.c zlib.h zconf.h
+$ call make example.exe "LINK example,libz.olb/lib" example.obj libz.olb
+$ write sys$output "Building minigzip..."
+$ CALL MAKE minigzip.OBJ "CC ''CCOPT' [.test]minigzip" -
+ [.test]minigzip.c zlib.h zconf.h
+$ call make minigzip.exe -
+ "LINK minigzip,libz.olb/lib" -
+ minigzip.obj libz.olb
+$ else
+$ gosub crea_mms
+$ write sys$output "Make ''name' ''version' with ''Make' "
+$ 'make'
+$ endif
+$!
+$! Create shareable image
+$!
+$ gosub crea_olist
+$ write sys$output "Creating libzshr.exe"
+$ call map_2_shopt 'mapfile' 'optfile'
+$ LINK_'lopts'/SHARE=libzshr.exe modules.opt/opt,'optfile'/opt
+$ write sys$output "Zlib build completed"
+$ delete/nolog tmp.opt;*
+$ exit
+$AMISS_ERR:
+$ write sys$output "No source for config.hin found."
+$ write sys$output "Tried any of ''aconf_in_file'"
+$ goto err_exit
+$CC_ERR:
+$ write sys$output "C compiler required to build ''name'"
+$ goto err_exit
+$ERR_EXIT:
+$ set message/facil/ident/sever/text
+$ close/nolog optf
+$ close/nolog topt
+$ close/nolog aconf_in
+$ close/nolog aconf
+$ close/nolog out
+$ close/nolog min
+$ close/nolog mod
+$ close/nolog h_in
+$ write sys$output "Exiting..."
+$ exit 2
+$!
+$!
+$MAKE: SUBROUTINE !SUBROUTINE TO CHECK DEPENDENCIES
+$ V = 'F$Verify(0)
+$! P1 = What we are trying to make
+$! P2 = Command to make it
+$! P3 - P8 What it depends on
+$
+$ If F$Search(P1) .Eqs. "" Then Goto Makeit
+$ Time = F$CvTime(F$File(P1,"RDT"))
+$arg=3
+$Loop:
+$ Argument = P'arg
+$ If Argument .Eqs. "" Then Goto Exit
+$ El=0
+$Loop2:
+$ File = F$Element(El," ",Argument)
+$ If File .Eqs. " " Then Goto Endl
+$ AFile = ""
+$Loop3:
+$ OFile = AFile
+$ AFile = F$Search(File)
+$ If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl
+$ If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit
+$ Goto Loop3
+$NextEL:
+$ El = El + 1
+$ Goto Loop2
+$EndL:
+$ arg=arg+1
+$ If arg .Le. 8 Then Goto Loop
+$ Goto Exit
+$
+$Makeit:
+$ VV=F$VERIFY(0)
+$ write sys$output P2
+$ 'P2
+$ VV='F$Verify(VV)
+$Exit:
+$ If V Then Set Verify
+$ENDSUBROUTINE
+$!------------------------------------------------------------------------------
+$!
+$! Check command line options and set symbols accordingly
+$!
+$!------------------------------------------------------------------------------
+$! Version history
+$! 0.01 20041206 First version to receive a number
+$! 0.02 20060126 Add new "HELP" target
+$ CHECK_OPTS:
+$ i = 1
+$ OPT_LOOP:
+$ if i .lt. 9
+$ then
+$ cparm = f$edit(p'i',"upcase")
+$!
+$! Check if parameter actually contains something
+$!
+$ if f$edit(cparm,"trim") .nes. ""
+$ then
+$ if cparm .eqs. "DEBUG"
+$ then
+$ ccopt = ccopt + "/noopt/deb"
+$ lopts = lopts + "/deb"
+$ endif
+$ if f$locate("CCOPT=",cparm) .lt. f$length(cparm)
+$ then
+$ start = f$locate("=",cparm) + 1
+$ len = f$length(cparm) - start
+$ ccopt = ccopt + f$extract(start,len,cparm)
+$ if f$locate("AS_IS",f$edit(ccopt,"UPCASE")) .lt. f$length(ccopt) -
+ then s_case = true
+$ endif
+$ if cparm .eqs. "LINK" then linkonly = true
+$ if f$locate("LOPTS=",cparm) .lt. f$length(cparm)
+$ then
+$ start = f$locate("=",cparm) + 1
+$ len = f$length(cparm) - start
+$ lopts = lopts + f$extract(start,len,cparm)
+$ endif
+$ if f$locate("CC=",cparm) .lt. f$length(cparm)
+$ then
+$ start = f$locate("=",cparm) + 1
+$ len = f$length(cparm) - start
+$ cc_com = f$extract(start,len,cparm)
+ if (cc_com .nes. "DECC") .and. -
+ (cc_com .nes. "VAXC") .and. -
+ (cc_com .nes. "GNUC")
+$ then
+$ write sys$output "Unsupported compiler choice ''cc_com' ignored"
+$ write sys$output "Use DECC, VAXC, or GNUC instead"
+$ else
+$ if cc_com .eqs. "DECC" then its_decc = true
+$ if cc_com .eqs. "VAXC" then its_vaxc = true
+$ if cc_com .eqs. "GNUC" then its_gnuc = true
+$ endif
+$ endif
+$ if f$locate("MAKE=",cparm) .lt. f$length(cparm)
+$ then
+$ start = f$locate("=",cparm) + 1
+$ len = f$length(cparm) - start
+$ mmks = f$extract(start,len,cparm)
+$ if (mmks .eqs. "MMK") .or. (mmks .eqs. "MMS")
+$ then
+$ make = mmks
+$ else
+$ write sys$output "Unsupported make choice ''mmks' ignored"
+$ write sys$output "Use MMK or MMS instead"
+$ endif
+$ endif
+$ if cparm .eqs. "HELP" then gosub bhelp
+$ endif
+$ i = i + 1
+$ goto opt_loop
+$ endif
+$ return
+$!------------------------------------------------------------------------------
+$!
+$! Look for the compiler used
+$!
+$! Version history
+$! 0.01 20040223 First version to receive a number
+$! 0.02 20040229 Save/set value of decc$no_rooted_search_lists
+$! 0.03 20060202 Extend handling of GNU C
+$! 0.04 20090402 Compaq -> hp
+$CHECK_COMPILER:
+$ if (.not. (its_decc .or. its_vaxc .or. its_gnuc))
+$ then
+$ its_decc = (f$search("SYS$SYSTEM:DECC$COMPILER.EXE") .nes. "")
+$ its_vaxc = .not. its_decc .and. (F$Search("SYS$System:VAXC.Exe") .nes. "")
+$ its_gnuc = .not. (its_decc .or. its_vaxc) .and. (f$trnlnm("gnu_cc") .nes. "")
+$ endif
+$!
+$! Exit if no compiler available
+$!
+$ if (.not. (its_decc .or. its_vaxc .or. its_gnuc))
+$ then goto CC_ERR
+$ else
+$ if its_decc
+$ then
+$ write sys$output "CC compiler check ... hp C"
+$ if f$trnlnm("decc$no_rooted_search_lists") .nes. ""
+$ then
+$ dnrsl = f$trnlnm("decc$no_rooted_search_lists")
+$ endif
+$ define/nolog decc$no_rooted_search_lists 1
+$ else
+$ if its_vaxc then write sys$output "CC compiler check ... VAX C"
+$ if its_gnuc
+$ then
+$ write sys$output "CC compiler check ... GNU C"
+$ if f$trnlnm(topt) then write topt "gnu_cc:[000000]gcclib.olb/lib"
+$ if f$trnlnm(optf) then write optf "gnu_cc:[000000]gcclib.olb/lib"
+$ cc = "gcc"
+$ endif
+$ if f$trnlnm(topt) then write topt "sys$share:vaxcrtl.exe/share"
+$ if f$trnlnm(optf) then write optf "sys$share:vaxcrtl.exe/share"
+$ endif
+$ endif
+$ return
+$!------------------------------------------------------------------------------
+$!
+$! If MMS/MMK are available dump out the descrip.mms if required
+$!
+$CREA_MMS:
+$ write sys$output "Creating descrip.mms..."
+$ create descrip.mms
+$ open/append out descrip.mms
+$ copy sys$input: out
+$ deck
+# descrip.mms: MMS description file for building zlib on VMS
+# written by Martin P.J. Zinser
+# <zinser@zinser.no-ip.info or martin.zinser@eurexchange.com>
+
+OBJS = adler32.obj, compress.obj, crc32.obj, gzclose.obj, gzlib.obj\
+ gzread.obj, gzwrite.obj, uncompr.obj, infback.obj\
+ deflate.obj, trees.obj, zutil.obj, inflate.obj, \
+ inftrees.obj, inffast.obj
+
+$ eod
+$ write out "CFLAGS=", ccopt
+$ write out "LOPTS=", lopts
+$ write out "all : example.exe minigzip.exe libz.olb"
+$ copy sys$input: out
+$ deck
+ @ write sys$output " Example applications available"
+
+libz.olb : libz.olb($(OBJS))
+ @ write sys$output " libz available"
+
+example.exe : example.obj libz.olb
+ link $(LOPTS) example,libz.olb/lib
+
+minigzip.exe : minigzip.obj libz.olb
+ link $(LOPTS) minigzip,libz.olb/lib
+
+clean :
+ delete *.obj;*,libz.olb;*,*.opt;*,*.exe;*
+
+
+# Other dependencies.
+adler32.obj : adler32.c zutil.h zlib.h zconf.h
+compress.obj : compress.c zlib.h zconf.h
+crc32.obj : crc32.c zutil.h zlib.h zconf.h
+deflate.obj : deflate.c deflate.h zutil.h zlib.h zconf.h
+example.obj : [.test]example.c zlib.h zconf.h
+gzclose.obj : gzclose.c zutil.h zlib.h zconf.h
+gzlib.obj : gzlib.c zutil.h zlib.h zconf.h
+gzread.obj : gzread.c zutil.h zlib.h zconf.h
+gzwrite.obj : gzwrite.c zutil.h zlib.h zconf.h
+inffast.obj : inffast.c zutil.h zlib.h zconf.h inftrees.h inffast.h
+inflate.obj : inflate.c zutil.h zlib.h zconf.h
+inftrees.obj : inftrees.c zutil.h zlib.h zconf.h inftrees.h
+minigzip.obj : [.test]minigzip.c zlib.h zconf.h
+trees.obj : trees.c deflate.h zutil.h zlib.h zconf.h
+uncompr.obj : uncompr.c zlib.h zconf.h
+zutil.obj : zutil.c zutil.h zlib.h zconf.h
+infback.obj : infback.c zutil.h inftrees.h inflate.h inffast.h inffixed.h
+$ eod
+$ close out
+$ return
+$!------------------------------------------------------------------------------
+$!
+$! Read list of core library sources from makefile.in and create options
+$! needed to build shareable image
+$!
+$CREA_OLIST:
+$ open/read min makefile.in
+$ open/write mod modules.opt
+$ src_check_list = "OBJZ =#OBJG ="
+$MRLOOP:
+$ read/end=mrdone min rec
+$ i = 0
+$SRC_CHECK_LOOP:
+$ src_check = f$element(i, "#", src_check_list)
+$ i = i+1
+$ if src_check .eqs. "#" then goto mrloop
+$ if (f$extract(0,6,rec) .nes. src_check) then goto src_check_loop
+$ rec = rec - src_check
+$ gosub extra_filnam
+$ if (f$element(1,"\",rec) .eqs. "\") then goto mrloop
+$MRSLOOP:
+$ read/end=mrdone min rec
+$ gosub extra_filnam
+$ if (f$element(1,"\",rec) .nes. "\") then goto mrsloop
+$MRDONE:
+$ close min
+$ close mod
+$ return
+$!------------------------------------------------------------------------------
+$!
+$! Take record extracted in crea_olist and split it into single filenames
+$!
+$EXTRA_FILNAM:
+$ myrec = f$edit(rec - "\", "trim,compress")
+$ i = 0
+$FELOOP:
+$ srcfil = f$element(i," ", myrec)
+$ if (srcfil .nes. " ")
+$ then
+$ write mod f$parse(srcfil,,,"NAME"), ".obj"
+$ i = i + 1
+$ goto feloop
+$ endif
+$ return
+$!------------------------------------------------------------------------------
+$!
+$! Find current Zlib version number
+$!
+$FIND_VERSION:
+$ open/read h_in 'v_file'
+$hloop:
+$ read/end=hdone h_in rec
+$ rec = f$edit(rec,"TRIM")
+$ if (f$extract(0,1,rec) .nes. "#") then goto hloop
+$ rec = f$edit(rec - "#", "TRIM")
+$ if f$element(0," ",rec) .nes. "define" then goto hloop
+$ if f$element(1," ",rec) .eqs. v_string
+$ then
+$ version = 'f$element(2," ",rec)'
+$ goto hdone
+$ endif
+$ goto hloop
+$hdone:
+$ close h_in
+$ return
+$!------------------------------------------------------------------------------
+$!
+$CHECK_CONFIG:
+$!
+$ in_ldef = f$locate(cdef,libdefs)
+$ if (in_ldef .lt. f$length(libdefs))
+$ then
+$ write aconf "#define ''cdef' 1"
+$ libdefs = f$extract(0,in_ldef,libdefs) + -
+ f$extract(in_ldef + f$length(cdef) + 1, -
+ f$length(libdefs) - in_ldef - f$length(cdef) - 1, -
+ libdefs)
+$ else
+$ if (f$type('cdef') .eqs. "INTEGER")
+$ then
+$ write aconf "#define ''cdef' ", 'cdef'
+$ else
+$ if (f$type('cdef') .eqs. "STRING")
+$ then
+$ write aconf "#define ''cdef' ", """", '''cdef'', """"
+$ else
+$ gosub check_cc_def
+$ endif
+$ endif
+$ endif
+$ return
+$!------------------------------------------------------------------------------
+$!
+$! Check if this is a define relating to the properties of the C/C++
+$! compiler
+$!
+$ CHECK_CC_DEF:
+$ if (cdef .eqs. "_LARGEFILE64_SOURCE")
+$ then
+$ copy sys$input: 'tc'
+$ deck
+#include "tconfig"
+#define _LARGEFILE
+#include <stdio.h>
+
+int main(){
+FILE *fp;
+ fp = fopen("temp.txt","r");
+ fseeko(fp,1,SEEK_SET);
+ fclose(fp);
+}
+
+$ eod
+$ test_inv = false
+$ comm_h = false
+$ gosub cc_prop_check
+$ return
+$ endif
+$ write aconf "/* ", line, " */"
+$ return
+$!------------------------------------------------------------------------------
+$!
+$! Check for properties of C/C++ compiler
+$!
+$! Version history
+$! 0.01 20031020 First version to receive a number
+$! 0.02 20031022 Added logic for defines with value
+$! 0.03 20040309 Make sure local config file gets not deleted
+$! 0.04 20041230 Also write include for configure run
+$! 0.05 20050103 Add processing of "comment defines"
+$CC_PROP_CHECK:
+$ cc_prop = true
+$ is_need = false
+$ is_need = (f$extract(0,4,cdef) .eqs. "NEED") .or. (test_inv .eq. true)
+$ if f$search(th) .eqs. "" then create 'th'
+$ set message/nofac/noident/nosever/notext
+$ on error then continue
+$ cc 'tmpnam'
+$ if .not. ($status) then cc_prop = false
+$ on error then continue
+$! The headers might lie about the capabilities of the RTL
+$ link 'tmpnam',tmp.opt/opt
+$ if .not. ($status) then cc_prop = false
+$ set message/fac/ident/sever/text
+$ on error then goto err_exit
+$ delete/nolog 'tmpnam'.*;*/exclude='th'
+$ if (cc_prop .and. .not. is_need) .or. -
+ (.not. cc_prop .and. is_need)
+$ then
+$ write sys$output "Checking for ''cdef'... yes"
+$ if f$type('cdef_val'_yes) .nes. ""
+$ then
+$ if f$type('cdef_val'_yes) .eqs. "INTEGER" -
+ then call write_config f$fao("#define !AS !UL",cdef,'cdef_val'_yes)
+$ if f$type('cdef_val'_yes) .eqs. "STRING" -
+ then call write_config f$fao("#define !AS !AS",cdef,'cdef_val'_yes)
+$ else
+$ call write_config f$fao("#define !AS 1",cdef)
+$ endif
+$ if (cdef .eqs. "HAVE_FSEEKO") .or. (cdef .eqs. "_LARGE_FILES") .or. -
+ (cdef .eqs. "_LARGEFILE64_SOURCE") then -
+ call write_config f$string("#define _LARGEFILE 1")
+$ else
+$ write sys$output "Checking for ''cdef'... no"
+$ if (comm_h)
+$ then
+ call write_config f$fao("/* !AS */",line)
+$ else
+$ if f$type('cdef_val'_no) .nes. ""
+$ then
+$ if f$type('cdef_val'_no) .eqs. "INTEGER" -
+ then call write_config f$fao("#define !AS !UL",cdef,'cdef_val'_no)
+$ if f$type('cdef_val'_no) .eqs. "STRING" -
+ then call write_config f$fao("#define !AS !AS",cdef,'cdef_val'_no)
+$ else
+$ call write_config f$fao("#undef !AS",cdef)
+$ endif
+$ endif
+$ endif
+$ return
+$!------------------------------------------------------------------------------
+$!
+$! Check for properties of C/C++ compiler with multiple result values
+$!
+$! Version history
+$! 0.01 20040127 First version
+$! 0.02 20050103 Reconcile changes from cc_prop up to version 0.05
+$CC_MPROP_CHECK:
+$ cc_prop = true
+$ i = 1
+$ idel = 1
+$ MT_LOOP:
+$ if f$type(result_'i') .eqs. "STRING"
+$ then
+$ set message/nofac/noident/nosever/notext
+$ on error then continue
+$ cc 'tmpnam'_'i'
+$ if .not. ($status) then cc_prop = false
+$ on error then continue
+$! The headers might lie about the capabilities of the RTL
+$ link 'tmpnam'_'i',tmp.opt/opt
+$ if .not. ($status) then cc_prop = false
+$ set message/fac/ident/sever/text
+$ on error then goto err_exit
+$ delete/nolog 'tmpnam'_'i'.*;*
+$ if (cc_prop)
+$ then
+$ write sys$output "Checking for ''cdef'... ", mdef_'i'
+$ if f$type(mdef_'i') .eqs. "INTEGER" -
+ then call write_config f$fao("#define !AS !UL",cdef,mdef_'i')
+$ if f$type('cdef_val'_yes) .eqs. "STRING" -
+ then call write_config f$fao("#define !AS !AS",cdef,mdef_'i')
+$ goto msym_clean
+$ else
+$ i = i + 1
+$ goto mt_loop
+$ endif
+$ endif
+$ write sys$output "Checking for ''cdef'... no"
+$ call write_config f$fao("#undef !AS",cdef)
+$ MSYM_CLEAN:
+$ if (idel .le. msym_max)
+$ then
+$ delete/sym mdef_'idel'
+$ idel = idel + 1
+$ goto msym_clean
+$ endif
+$ return
+$!------------------------------------------------------------------------------
+$!
+$! Write configuration to both permanent and temporary config file
+$!
+$! Version history
+$! 0.01 20031029 First version to receive a number
+$!
+$WRITE_CONFIG: SUBROUTINE
+$ write aconf 'p1'
+$ open/append confh 'th'
+$ write confh 'p1'
+$ close confh
+$ENDSUBROUTINE
+$!------------------------------------------------------------------------------
+$!
+$! Analyze the project map file and create the symbol vector for a shareable
+$! image from it
+$!
+$! Version history
+$! 0.01 20120128 First version
+$! 0.02 20120226 Add pre-load logic
+$!
+$ MAP_2_SHOPT: Subroutine
+$!
+$ SAY := "WRITE_ SYS$OUTPUT"
+$!
+$ IF F$SEARCH("''P1'") .EQS. ""
+$ THEN
+$ SAY "MAP_2_SHOPT-E-NOSUCHFILE: Error, inputfile ''p1' not available"
+$ goto exit_m2s
+$ ENDIF
+$ IF "''P2'" .EQS. ""
+$ THEN
+$ SAY "MAP_2_SHOPT: Error, no output file provided"
+$ goto exit_m2s
+$ ENDIF
+$!
+$ module1 = "deflate#deflateEnd#deflateInit_#deflateParams#deflateSetDictionary"
+$ module2 = "gzclose#gzerror#gzgetc#gzgets#gzopen#gzprintf#gzputc#gzputs#gzread"
+$ module3 = "gzseek#gztell#inflate#inflateEnd#inflateInit_#inflateSetDictionary"
+$ module4 = "inflateSync#uncompress#zlibVersion#compress"
+$ open/read map 'p1
+$ if axp .or. ia64
+$ then
+$ open/write aopt a.opt
+$ open/write bopt b.opt
+$ write aopt " CASE_SENSITIVE=YES"
+$ write bopt "SYMBOL_VECTOR= (-"
+$ mod_sym_num = 1
+$ MOD_SYM_LOOP:
+$ if f$type(module'mod_sym_num') .nes. ""
+$ then
+$ mod_in = 0
+$ MOD_SYM_IN:
+$ shared_proc = f$element(mod_in, "#", module'mod_sym_num')
+$ if shared_proc .nes. "#"
+$ then
+$ write aopt f$fao(" symbol_vector=(!AS/!AS=PROCEDURE)",-
+ f$edit(shared_proc,"upcase"),shared_proc)
+$ write bopt f$fao("!AS=PROCEDURE,-",shared_proc)
+$ mod_in = mod_in + 1
+$ goto mod_sym_in
+$ endif
+$ mod_sym_num = mod_sym_num + 1
+$ goto mod_sym_loop
+$ endif
+$MAP_LOOP:
+$ read/end=map_end map line
+$ if (f$locate("{",line).lt. f$length(line)) .or. -
+ (f$locate("global:", line) .lt. f$length(line))
+$ then
+$ proc = true
+$ goto map_loop
+$ endif
+$ if f$locate("}",line).lt. f$length(line) then proc = false
+$ if f$locate("local:", line) .lt. f$length(line) then proc = false
+$ if proc
+$ then
+$ shared_proc = f$edit(line,"collapse")
+$ chop_semi = f$locate(";", shared_proc)
+$ if chop_semi .lt. f$length(shared_proc) then -
+ shared_proc = f$extract(0, chop_semi, shared_proc)
+$ write aopt f$fao(" symbol_vector=(!AS/!AS=PROCEDURE)",-
+ f$edit(shared_proc,"upcase"),shared_proc)
+$ write bopt f$fao("!AS=PROCEDURE,-",shared_proc)
+$ endif
+$ goto map_loop
+$MAP_END:
+$ close/nolog aopt
+$ close/nolog bopt
+$ open/append libopt 'p2'
+$ open/read aopt a.opt
+$ open/read bopt b.opt
+$ALOOP:
+$ read/end=aloop_end aopt line
+$ write libopt line
+$ goto aloop
+$ALOOP_END:
+$ close/nolog aopt
+$ sv = ""
+$BLOOP:
+$ read/end=bloop_end bopt svn
+$ if (svn.nes."")
+$ then
+$ if (sv.nes."") then write libopt sv
+$ sv = svn
+$ endif
+$ goto bloop
+$BLOOP_END:
+$ write libopt f$extract(0,f$length(sv)-2,sv), "-"
+$ write libopt ")"
+$ close/nolog bopt
+$ delete/nolog/noconf a.opt;*,b.opt;*
+$ else
+$ if vax
+$ then
+$ open/append libopt 'p2'
+$ mod_sym_num = 1
+$ VMOD_SYM_LOOP:
+$ if f$type(module'mod_sym_num') .nes. ""
+$ then
+$ mod_in = 0
+$ VMOD_SYM_IN:
+$ shared_proc = f$element(mod_in, "#", module'mod_sym_num')
+$ if shared_proc .nes. "#"
+$ then
+$ write libopt f$fao("UNIVERSAL=!AS",-
+ f$edit(shared_proc,"upcase"))
+$ mod_in = mod_in + 1
+$ goto vmod_sym_in
+$ endif
+$ mod_sym_num = mod_sym_num + 1
+$ goto vmod_sym_loop
+$ endif
+$VMAP_LOOP:
+$ read/end=vmap_end map line
+$ if (f$locate("{",line).lt. f$length(line)) .or. -
+ (f$locate("global:", line) .lt. f$length(line))
+$ then
+$ proc = true
+$ goto vmap_loop
+$ endif
+$ if f$locate("}",line).lt. f$length(line) then proc = false
+$ if f$locate("local:", line) .lt. f$length(line) then proc = false
+$ if proc
+$ then
+$ shared_proc = f$edit(line,"collapse")
+$ chop_semi = f$locate(";", shared_proc)
+$ if chop_semi .lt. f$length(shared_proc) then -
+ shared_proc = f$extract(0, chop_semi, shared_proc)
+$ write libopt f$fao("UNIVERSAL=!AS",-
+ f$edit(shared_proc,"upcase"))
+$ endif
+$ goto vmap_loop
+$VMAP_END:
+$ else
+$ write sys$output "Unknown Architecture (Not VAX, AXP, or IA64)"
+$ write sys$output "No options file created"
+$ endif
+$ endif
+$ EXIT_M2S:
+$ close/nolog map
+$ close/nolog libopt
+$ endsubroutine
diff --git a/protocols/Telegram/tgl/zlib/msdos/Makefile.bor b/protocols/Telegram/tgl/zlib/msdos/Makefile.bor
new file mode 100644
index 0000000000..3d12a2c252
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/msdos/Makefile.bor
@@ -0,0 +1,115 @@
+# Makefile for zlib
+# Borland C++
+# Last updated: 15-Mar-2003
+
+# To use, do "make -fmakefile.bor"
+# To compile in small model, set below: MODEL=s
+
+# WARNING: the small model is supported but only for small values of
+# MAX_WBITS and MAX_MEM_LEVEL. For example:
+# -DMAX_WBITS=11 -DDEF_WBITS=11 -DMAX_MEM_LEVEL=3
+# If you wish to reduce the memory requirements (default 256K for big
+# objects plus a few K), you can add to the LOC macro below:
+# -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14
+# See zconf.h for details about the memory requirements.
+
+# ------------ Turbo C++, Borland C++ ------------
+
+# Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7)
+# should be added to the environment via "set LOCAL_ZLIB=-DFOO" or added
+# to the declaration of LOC here:
+LOC = $(LOCAL_ZLIB)
+
+# type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc.
+CPU_TYP = 0
+
+# memory model: one of s, m, c, l (small, medium, compact, large)
+MODEL=l
+
+# replace bcc with tcc for Turbo C++ 1.0, with bcc32 for the 32 bit version
+CC=bcc
+LD=bcc
+AR=tlib
+
+# compiler flags
+# replace "-O2" by "-O -G -a -d" for Turbo C++ 1.0
+CFLAGS=-O2 -Z -m$(MODEL) $(LOC)
+
+LDFLAGS=-m$(MODEL) -f-
+
+
+# variables
+ZLIB_LIB = zlib_$(MODEL).lib
+
+OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj
+OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj
+OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj
+OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj
+
+
+# targets
+all: $(ZLIB_LIB) example.exe minigzip.exe
+
+.c.obj:
+ $(CC) -c $(CFLAGS) $*.c
+
+adler32.obj: adler32.c zlib.h zconf.h
+
+compress.obj: compress.c zlib.h zconf.h
+
+crc32.obj: crc32.c zlib.h zconf.h crc32.h
+
+deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
+
+gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h
+
+gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h
+
+gzread.obj: gzread.c zlib.h zconf.h gzguts.h
+
+gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h
+
+infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
+ inffast.h inffixed.h
+
+inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
+ inffast.h
+
+inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
+ inffast.h inffixed.h
+
+inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
+
+trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h
+
+uncompr.obj: uncompr.c zlib.h zconf.h
+
+zutil.obj: zutil.c zutil.h zlib.h zconf.h
+
+example.obj: test/example.c zlib.h zconf.h
+
+minigzip.obj: test/minigzip.c zlib.h zconf.h
+
+
+# the command line is cut to fit in the MS-DOS 128 byte limit:
+$(ZLIB_LIB): $(OBJ1) $(OBJ2)
+ -del $(ZLIB_LIB)
+ $(AR) $(ZLIB_LIB) $(OBJP1)
+ $(AR) $(ZLIB_LIB) $(OBJP2)
+
+example.exe: example.obj $(ZLIB_LIB)
+ $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB)
+
+minigzip.exe: minigzip.obj $(ZLIB_LIB)
+ $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB)
+
+test: example.exe minigzip.exe
+ example
+ echo hello world | minigzip | minigzip -d
+
+clean:
+ -del *.obj
+ -del *.lib
+ -del *.exe
+ -del zlib_*.bak
+ -del foo.gz
diff --git a/protocols/Telegram/tgl/zlib/msdos/Makefile.dj2 b/protocols/Telegram/tgl/zlib/msdos/Makefile.dj2
new file mode 100644
index 0000000000..29b03954d7
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/msdos/Makefile.dj2
@@ -0,0 +1,104 @@
+# Makefile for zlib. Modified for djgpp v2.0 by F. J. Donahoe, 3/15/96.
+# Copyright (C) 1995-1998 Jean-loup Gailly.
+# For conditions of distribution and use, see copyright notice in zlib.h
+
+# To compile, or to compile and test, type:
+#
+# make -fmakefile.dj2; make test -fmakefile.dj2
+#
+# To install libz.a, zconf.h and zlib.h in the djgpp directories, type:
+#
+# make install -fmakefile.dj2
+#
+# after first defining LIBRARY_PATH and INCLUDE_PATH in djgpp.env as
+# in the sample below if the pattern of the DJGPP distribution is to
+# be followed. Remember that, while <sp>'es around <=> are ignored in
+# makefiles, they are *not* in batch files or in djgpp.env.
+# - - - - -
+# [make]
+# INCLUDE_PATH=%\>;INCLUDE_PATH%%\DJDIR%\include
+# LIBRARY_PATH=%\>;LIBRARY_PATH%%\DJDIR%\lib
+# BUTT=-m486
+# - - - - -
+# Alternately, these variables may be defined below, overriding the values
+# in djgpp.env, as
+# INCLUDE_PATH=c:\usr\include
+# LIBRARY_PATH=c:\usr\lib
+
+CC=gcc
+
+#CFLAGS=-MMD -O
+#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
+#CFLAGS=-MMD -g -DDEBUG
+CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
+ -Wstrict-prototypes -Wmissing-prototypes
+
+# If cp.exe is available, replace "copy /Y" with "cp -fp" .
+CP=copy /Y
+# If gnu install.exe is available, replace $(CP) with ginstall.
+INSTALL=$(CP)
+# The default value of RM is "rm -f." If "rm.exe" is found, comment out:
+RM=del
+LDLIBS=-L. -lz
+LD=$(CC) -s -o
+LDSHARED=$(CC)
+
+INCL=zlib.h zconf.h
+LIBS=libz.a
+
+AR=ar rcs
+
+prefix=/usr/local
+exec_prefix = $(prefix)
+
+OBJS = adler32.o compress.o crc32.o gzclose.o gzlib.o gzread.o gzwrite.o \
+ uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o
+
+OBJA =
+# to use the asm code: make OBJA=match.o
+
+TEST_OBJS = example.o minigzip.o
+
+all: example.exe minigzip.exe
+
+check: test
+test: all
+ ./example
+ echo hello world | .\minigzip | .\minigzip -d
+
+%.o : %.c
+ $(CC) $(CFLAGS) -c $< -o $@
+
+libz.a: $(OBJS) $(OBJA)
+ $(AR) $@ $(OBJS) $(OBJA)
+
+%.exe : %.o $(LIBS)
+ $(LD) $@ $< $(LDLIBS)
+
+# INCLUDE_PATH and LIBRARY_PATH were set for [make] in djgpp.env .
+
+.PHONY : uninstall clean
+
+install: $(INCL) $(LIBS)
+ -@if not exist $(INCLUDE_PATH)\nul mkdir $(INCLUDE_PATH)
+ -@if not exist $(LIBRARY_PATH)\nul mkdir $(LIBRARY_PATH)
+ $(INSTALL) zlib.h $(INCLUDE_PATH)
+ $(INSTALL) zconf.h $(INCLUDE_PATH)
+ $(INSTALL) libz.a $(LIBRARY_PATH)
+
+uninstall:
+ $(RM) $(INCLUDE_PATH)\zlib.h
+ $(RM) $(INCLUDE_PATH)\zconf.h
+ $(RM) $(LIBRARY_PATH)\libz.a
+
+clean:
+ $(RM) *.d
+ $(RM) *.o
+ $(RM) *.exe
+ $(RM) libz.a
+ $(RM) foo.gz
+
+DEPS := $(wildcard *.d)
+ifneq ($(DEPS),)
+include $(DEPS)
+endif
diff --git a/protocols/Telegram/tgl/zlib/msdos/Makefile.emx b/protocols/Telegram/tgl/zlib/msdos/Makefile.emx
new file mode 100644
index 0000000000..9c1b57a585
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/msdos/Makefile.emx
@@ -0,0 +1,69 @@
+# Makefile for zlib. Modified for emx 0.9c by Chr. Spieler, 6/17/98.
+# Copyright (C) 1995-1998 Jean-loup Gailly.
+# For conditions of distribution and use, see copyright notice in zlib.h
+
+# To compile, or to compile and test, type:
+#
+# make -fmakefile.emx; make test -fmakefile.emx
+#
+
+CC=gcc
+
+#CFLAGS=-MMD -O
+#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
+#CFLAGS=-MMD -g -DDEBUG
+CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
+ -Wstrict-prototypes -Wmissing-prototypes
+
+# If cp.exe is available, replace "copy /Y" with "cp -fp" .
+CP=copy /Y
+# If gnu install.exe is available, replace $(CP) with ginstall.
+INSTALL=$(CP)
+# The default value of RM is "rm -f." If "rm.exe" is found, comment out:
+RM=del
+LDLIBS=-L. -lzlib
+LD=$(CC) -s -o
+LDSHARED=$(CC)
+
+INCL=zlib.h zconf.h
+LIBS=zlib.a
+
+AR=ar rcs
+
+prefix=/usr/local
+exec_prefix = $(prefix)
+
+OBJS = adler32.o compress.o crc32.o gzclose.o gzlib.o gzread.o gzwrite.o \
+ uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o
+
+TEST_OBJS = example.o minigzip.o
+
+all: example.exe minigzip.exe
+
+test: all
+ ./example
+ echo hello world | .\minigzip | .\minigzip -d
+
+%.o : %.c
+ $(CC) $(CFLAGS) -c $< -o $@
+
+zlib.a: $(OBJS)
+ $(AR) $@ $(OBJS)
+
+%.exe : %.o $(LIBS)
+ $(LD) $@ $< $(LDLIBS)
+
+
+.PHONY : clean
+
+clean:
+ $(RM) *.d
+ $(RM) *.o
+ $(RM) *.exe
+ $(RM) zlib.a
+ $(RM) foo.gz
+
+DEPS := $(wildcard *.d)
+ifneq ($(DEPS),)
+include $(DEPS)
+endif
diff --git a/protocols/Telegram/tgl/zlib/msdos/Makefile.msc b/protocols/Telegram/tgl/zlib/msdos/Makefile.msc
new file mode 100644
index 0000000000..ae8378615e
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/msdos/Makefile.msc
@@ -0,0 +1,112 @@
+# Makefile for zlib
+# Microsoft C 5.1 or later
+# Last updated: 19-Mar-2003
+
+# To use, do "make makefile.msc"
+# To compile in small model, set below: MODEL=S
+
+# If you wish to reduce the memory requirements (default 256K for big
+# objects plus a few K), you can add to the LOC macro below:
+# -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14
+# See zconf.h for details about the memory requirements.
+
+# ------------- Microsoft C 5.1 and later -------------
+
+# Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7)
+# should be added to the environment via "set LOCAL_ZLIB=-DFOO" or added
+# to the declaration of LOC here:
+LOC = $(LOCAL_ZLIB)
+
+# Type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc.
+CPU_TYP = 0
+
+# Memory model: one of S, M, C, L (small, medium, compact, large)
+MODEL=L
+
+CC=cl
+CFLAGS=-nologo -A$(MODEL) -G$(CPU_TYP) -W3 -Oait -Gs $(LOC)
+#-Ox generates bad code with MSC 5.1
+LIB_CFLAGS=-Zl $(CFLAGS)
+
+LD=link
+LDFLAGS=/noi/e/st:0x1500/noe/farcall/packcode
+# "/farcall/packcode" are only useful for `large code' memory models
+# but should be a "no-op" for small code models.
+
+
+# variables
+ZLIB_LIB = zlib_$(MODEL).lib
+
+OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj
+OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj
+
+
+# targets
+all: $(ZLIB_LIB) example.exe minigzip.exe
+
+.c.obj:
+ $(CC) -c $(LIB_CFLAGS) $*.c
+
+adler32.obj: adler32.c zlib.h zconf.h
+
+compress.obj: compress.c zlib.h zconf.h
+
+crc32.obj: crc32.c zlib.h zconf.h crc32.h
+
+deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
+
+gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h
+
+gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h
+
+gzread.obj: gzread.c zlib.h zconf.h gzguts.h
+
+gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h
+
+infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
+ inffast.h inffixed.h
+
+inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
+ inffast.h
+
+inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
+ inffast.h inffixed.h
+
+inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
+
+trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h
+
+uncompr.obj: uncompr.c zlib.h zconf.h
+
+zutil.obj: zutil.c zutil.h zlib.h zconf.h
+
+example.obj: test/example.c zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+minigzip.obj: test/minigzip.c zlib.h zconf.h
+ $(CC) -c $(CFLAGS) $*.c
+
+
+# the command line is cut to fit in the MS-DOS 128 byte limit:
+$(ZLIB_LIB): $(OBJ1) $(OBJ2)
+ if exist $(ZLIB_LIB) del $(ZLIB_LIB)
+ lib $(ZLIB_LIB) $(OBJ1);
+ lib $(ZLIB_LIB) $(OBJ2);
+
+example.exe: example.obj $(ZLIB_LIB)
+ $(LD) $(LDFLAGS) example.obj,,,$(ZLIB_LIB);
+
+minigzip.exe: minigzip.obj $(ZLIB_LIB)
+ $(LD) $(LDFLAGS) minigzip.obj,,,$(ZLIB_LIB);
+
+test: example.exe minigzip.exe
+ example
+ echo hello world | minigzip | minigzip -d
+
+clean:
+ -del *.obj
+ -del *.lib
+ -del *.exe
+ -del *.map
+ -del zlib_*.bak
+ -del foo.gz
diff --git a/protocols/Telegram/tgl/zlib/msdos/Makefile.tc b/protocols/Telegram/tgl/zlib/msdos/Makefile.tc
new file mode 100644
index 0000000000..5aec82a9d5
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/msdos/Makefile.tc
@@ -0,0 +1,100 @@
+# Makefile for zlib
+# Turbo C 2.01, Turbo C++ 1.01
+# Last updated: 15-Mar-2003
+
+# To use, do "make -fmakefile.tc"
+# To compile in small model, set below: MODEL=s
+
+# WARNING: the small model is supported but only for small values of
+# MAX_WBITS and MAX_MEM_LEVEL. For example:
+# -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3
+# If you wish to reduce the memory requirements (default 256K for big
+# objects plus a few K), you can add to CFLAGS below:
+# -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14
+# See zconf.h for details about the memory requirements.
+
+# ------------ Turbo C 2.01, Turbo C++ 1.01 ------------
+MODEL=l
+CC=tcc
+LD=tcc
+AR=tlib
+# CFLAGS=-O2 -G -Z -m$(MODEL) -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3
+CFLAGS=-O2 -G -Z -m$(MODEL)
+LDFLAGS=-m$(MODEL) -f-
+
+
+# variables
+ZLIB_LIB = zlib_$(MODEL).lib
+
+OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj
+OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj
+OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj
+OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj
+
+
+# targets
+all: $(ZLIB_LIB) example.exe minigzip.exe
+
+.c.obj:
+ $(CC) -c $(CFLAGS) $*.c
+
+adler32.obj: adler32.c zlib.h zconf.h
+
+compress.obj: compress.c zlib.h zconf.h
+
+crc32.obj: crc32.c zlib.h zconf.h crc32.h
+
+deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
+
+gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h
+
+gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h
+
+gzread.obj: gzread.c zlib.h zconf.h gzguts.h
+
+gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h
+
+infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
+ inffast.h inffixed.h
+
+inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
+ inffast.h
+
+inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
+ inffast.h inffixed.h
+
+inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
+
+trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h
+
+uncompr.obj: uncompr.c zlib.h zconf.h
+
+zutil.obj: zutil.c zutil.h zlib.h zconf.h
+
+example.obj: test/example.c zlib.h zconf.h
+
+minigzip.obj: test/minigzip.c zlib.h zconf.h
+
+
+# the command line is cut to fit in the MS-DOS 128 byte limit:
+$(ZLIB_LIB): $(OBJ1) $(OBJ2)
+ -del $(ZLIB_LIB)
+ $(AR) $(ZLIB_LIB) $(OBJP1)
+ $(AR) $(ZLIB_LIB) $(OBJP2)
+
+example.exe: example.obj $(ZLIB_LIB)
+ $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB)
+
+minigzip.exe: minigzip.obj $(ZLIB_LIB)
+ $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB)
+
+test: example.exe minigzip.exe
+ example
+ echo hello world | minigzip | minigzip -d
+
+clean:
+ -del *.obj
+ -del *.lib
+ -del *.exe
+ -del zlib_*.bak
+ -del foo.gz
diff --git a/protocols/Telegram/tgl/zlib/nintendods/Makefile b/protocols/Telegram/tgl/zlib/nintendods/Makefile
new file mode 100644
index 0000000000..21337d01ab
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/nintendods/Makefile
@@ -0,0 +1,126 @@
+#---------------------------------------------------------------------------------
+.SUFFIXES:
+#---------------------------------------------------------------------------------
+
+ifeq ($(strip $(DEVKITARM)),)
+$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
+endif
+
+include $(DEVKITARM)/ds_rules
+
+#---------------------------------------------------------------------------------
+# TARGET is the name of the output
+# BUILD is the directory where object files & intermediate files will be placed
+# SOURCES is a list of directories containing source code
+# DATA is a list of directories containing data files
+# INCLUDES is a list of directories containing header files
+#---------------------------------------------------------------------------------
+TARGET := $(shell basename $(CURDIR))
+BUILD := build
+SOURCES := ../../
+DATA := data
+INCLUDES := include
+
+#---------------------------------------------------------------------------------
+# options for code generation
+#---------------------------------------------------------------------------------
+ARCH := -mthumb -mthumb-interwork
+
+CFLAGS := -Wall -O2\
+ -march=armv5te -mtune=arm946e-s \
+ -fomit-frame-pointer -ffast-math \
+ $(ARCH)
+
+CFLAGS += $(INCLUDE) -DARM9
+CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
+
+ASFLAGS := $(ARCH) -march=armv5te -mtune=arm946e-s
+LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
+
+#---------------------------------------------------------------------------------
+# list of directories containing libraries, this must be the top level containing
+# include and lib
+#---------------------------------------------------------------------------------
+LIBDIRS := $(LIBNDS)
+
+#---------------------------------------------------------------------------------
+# no real need to edit anything past this point unless you need to add additional
+# rules for different file extensions
+#---------------------------------------------------------------------------------
+ifneq ($(BUILD),$(notdir $(CURDIR)))
+#---------------------------------------------------------------------------------
+
+export OUTPUT := $(CURDIR)/lib/libz.a
+
+export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
+ $(foreach dir,$(DATA),$(CURDIR)/$(dir))
+
+export DEPSDIR := $(CURDIR)/$(BUILD)
+
+CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
+CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
+SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
+BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
+
+#---------------------------------------------------------------------------------
+# use CXX for linking C++ projects, CC for standard C
+#---------------------------------------------------------------------------------
+ifeq ($(strip $(CPPFILES)),)
+#---------------------------------------------------------------------------------
+ export LD := $(CC)
+#---------------------------------------------------------------------------------
+else
+#---------------------------------------------------------------------------------
+ export LD := $(CXX)
+#---------------------------------------------------------------------------------
+endif
+#---------------------------------------------------------------------------------
+
+export OFILES := $(addsuffix .o,$(BINFILES)) \
+ $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
+
+export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
+ $(foreach dir,$(LIBDIRS),-I$(dir)/include) \
+ -I$(CURDIR)/$(BUILD)
+
+.PHONY: $(BUILD) clean all
+
+#---------------------------------------------------------------------------------
+all: $(BUILD)
+ @[ -d $@ ] || mkdir -p include
+ @cp ../../*.h include
+
+lib:
+ @[ -d $@ ] || mkdir -p $@
+
+$(BUILD): lib
+ @[ -d $@ ] || mkdir -p $@
+ @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
+
+#---------------------------------------------------------------------------------
+clean:
+ @echo clean ...
+ @rm -fr $(BUILD) lib
+
+#---------------------------------------------------------------------------------
+else
+
+DEPENDS := $(OFILES:.o=.d)
+
+#---------------------------------------------------------------------------------
+# main targets
+#---------------------------------------------------------------------------------
+$(OUTPUT) : $(OFILES)
+
+#---------------------------------------------------------------------------------
+%.bin.o : %.bin
+#---------------------------------------------------------------------------------
+ @echo $(notdir $<)
+ @$(bin2o)
+
+
+-include $(DEPENDS)
+
+#---------------------------------------------------------------------------------------
+endif
+#---------------------------------------------------------------------------------------
diff --git a/protocols/Telegram/tgl/zlib/nintendods/README b/protocols/Telegram/tgl/zlib/nintendods/README
new file mode 100644
index 0000000000..ba7a37dbe8
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/nintendods/README
@@ -0,0 +1,5 @@
+This Makefile requires devkitARM (http://www.devkitpro.org/category/devkitarm/) and works inside "contrib/nds". It is based on a devkitARM template.
+
+Eduardo Costa <eduardo.m.costa@gmail.com>
+January 3, 2009
+
diff --git a/protocols/Telegram/tgl/zlib/old/Makefile.emx b/protocols/Telegram/tgl/zlib/old/Makefile.emx
new file mode 100644
index 0000000000..4d6ab0efa6
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/old/Makefile.emx
@@ -0,0 +1,69 @@
+# Makefile for zlib. Modified for emx/rsxnt by Chr. Spieler, 6/16/98.
+# Copyright (C) 1995-1998 Jean-loup Gailly.
+# For conditions of distribution and use, see copyright notice in zlib.h
+
+# To compile, or to compile and test, type:
+#
+# make -fmakefile.emx; make test -fmakefile.emx
+#
+
+CC=gcc -Zwin32
+
+#CFLAGS=-MMD -O
+#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
+#CFLAGS=-MMD -g -DDEBUG
+CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
+ -Wstrict-prototypes -Wmissing-prototypes
+
+# If cp.exe is available, replace "copy /Y" with "cp -fp" .
+CP=copy /Y
+# If gnu install.exe is available, replace $(CP) with ginstall.
+INSTALL=$(CP)
+# The default value of RM is "rm -f." If "rm.exe" is found, comment out:
+RM=del
+LDLIBS=-L. -lzlib
+LD=$(CC) -s -o
+LDSHARED=$(CC)
+
+INCL=zlib.h zconf.h
+LIBS=zlib.a
+
+AR=ar rcs
+
+prefix=/usr/local
+exec_prefix = $(prefix)
+
+OBJS = adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o \
+ gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o
+
+TEST_OBJS = example.o minigzip.o
+
+all: example.exe minigzip.exe
+
+test: all
+ ./example
+ echo hello world | .\minigzip | .\minigzip -d
+
+%.o : %.c
+ $(CC) $(CFLAGS) -c $< -o $@
+
+zlib.a: $(OBJS)
+ $(AR) $@ $(OBJS)
+
+%.exe : %.o $(LIBS)
+ $(LD) $@ $< $(LDLIBS)
+
+
+.PHONY : clean
+
+clean:
+ $(RM) *.d
+ $(RM) *.o
+ $(RM) *.exe
+ $(RM) zlib.a
+ $(RM) foo.gz
+
+DEPS := $(wildcard *.d)
+ifneq ($(DEPS),)
+include $(DEPS)
+endif
diff --git a/protocols/Telegram/tgl/zlib/old/Makefile.riscos b/protocols/Telegram/tgl/zlib/old/Makefile.riscos
new file mode 100644
index 0000000000..57e29d3fba
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/old/Makefile.riscos
@@ -0,0 +1,151 @@
+# Project: zlib_1_03
+# Patched for zlib 1.1.2 rw@shadow.org.uk 19980430
+# test works out-of-the-box, installs `somewhere' on demand
+
+# Toolflags:
+CCflags = -c -depend !Depend -IC: -g -throwback -DRISCOS -fah
+C++flags = -c -depend !Depend -IC: -throwback
+Linkflags = -aif -c++ -o $@
+ObjAsmflags = -throwback -NoCache -depend !Depend
+CMHGflags =
+LibFileflags = -c -l -o $@
+Squeezeflags = -o $@
+
+# change the line below to where _you_ want the library installed.
+libdest = lib:zlib
+
+# Final targets:
+@.lib: @.o.adler32 @.o.compress @.o.crc32 @.o.deflate @.o.gzio \
+ @.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil @.o.trees \
+ @.o.uncompr @.o.zutil
+ LibFile $(LibFileflags) @.o.adler32 @.o.compress @.o.crc32 @.o.deflate \
+ @.o.gzio @.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil \
+ @.o.trees @.o.uncompr @.o.zutil
+test: @.minigzip @.example @.lib
+ @copy @.lib @.libc A~C~DF~L~N~P~Q~RS~TV
+ @echo running tests: hang on.
+ @/@.minigzip -f -9 libc
+ @/@.minigzip -d libc-gz
+ @/@.minigzip -f -1 libc
+ @/@.minigzip -d libc-gz
+ @/@.minigzip -h -9 libc
+ @/@.minigzip -d libc-gz
+ @/@.minigzip -h -1 libc
+ @/@.minigzip -d libc-gz
+ @/@.minigzip -9 libc
+ @/@.minigzip -d libc-gz
+ @/@.minigzip -1 libc
+ @/@.minigzip -d libc-gz
+ @diff @.lib @.libc
+ @echo that should have reported '@.lib and @.libc identical' if you have diff.
+ @/@.example @.fred @.fred
+ @echo that will have given lots of hello!'s.
+
+@.minigzip: @.o.minigzip @.lib C:o.Stubs
+ Link $(Linkflags) @.o.minigzip @.lib C:o.Stubs
+@.example: @.o.example @.lib C:o.Stubs
+ Link $(Linkflags) @.o.example @.lib C:o.Stubs
+
+install: @.lib
+ cdir $(libdest)
+ cdir $(libdest).h
+ @copy @.h.zlib $(libdest).h.zlib A~C~DF~L~N~P~Q~RS~TV
+ @copy @.h.zconf $(libdest).h.zconf A~C~DF~L~N~P~Q~RS~TV
+ @copy @.lib $(libdest).lib A~C~DF~L~N~P~Q~RS~TV
+ @echo okay, installed zlib in $(libdest)
+
+clean:; remove @.minigzip
+ remove @.example
+ remove @.libc
+ -wipe @.o.* F~r~cV
+ remove @.fred
+
+# User-editable dependencies:
+.c.o:
+ cc $(ccflags) -o $@ $<
+
+# Static dependencies:
+
+# Dynamic dependencies:
+o.example: c.example
+o.example: h.zlib
+o.example: h.zconf
+o.minigzip: c.minigzip
+o.minigzip: h.zlib
+o.minigzip: h.zconf
+o.adler32: c.adler32
+o.adler32: h.zlib
+o.adler32: h.zconf
+o.compress: c.compress
+o.compress: h.zlib
+o.compress: h.zconf
+o.crc32: c.crc32
+o.crc32: h.zlib
+o.crc32: h.zconf
+o.deflate: c.deflate
+o.deflate: h.deflate
+o.deflate: h.zutil
+o.deflate: h.zlib
+o.deflate: h.zconf
+o.gzio: c.gzio
+o.gzio: h.zutil
+o.gzio: h.zlib
+o.gzio: h.zconf
+o.infblock: c.infblock
+o.infblock: h.zutil
+o.infblock: h.zlib
+o.infblock: h.zconf
+o.infblock: h.infblock
+o.infblock: h.inftrees
+o.infblock: h.infcodes
+o.infblock: h.infutil
+o.infcodes: c.infcodes
+o.infcodes: h.zutil
+o.infcodes: h.zlib
+o.infcodes: h.zconf
+o.infcodes: h.inftrees
+o.infcodes: h.infblock
+o.infcodes: h.infcodes
+o.infcodes: h.infutil
+o.infcodes: h.inffast
+o.inffast: c.inffast
+o.inffast: h.zutil
+o.inffast: h.zlib
+o.inffast: h.zconf
+o.inffast: h.inftrees
+o.inffast: h.infblock
+o.inffast: h.infcodes
+o.inffast: h.infutil
+o.inffast: h.inffast
+o.inflate: c.inflate
+o.inflate: h.zutil
+o.inflate: h.zlib
+o.inflate: h.zconf
+o.inflate: h.infblock
+o.inftrees: c.inftrees
+o.inftrees: h.zutil
+o.inftrees: h.zlib
+o.inftrees: h.zconf
+o.inftrees: h.inftrees
+o.inftrees: h.inffixed
+o.infutil: c.infutil
+o.infutil: h.zutil
+o.infutil: h.zlib
+o.infutil: h.zconf
+o.infutil: h.infblock
+o.infutil: h.inftrees
+o.infutil: h.infcodes
+o.infutil: h.infutil
+o.trees: c.trees
+o.trees: h.deflate
+o.trees: h.zutil
+o.trees: h.zlib
+o.trees: h.zconf
+o.trees: h.trees
+o.uncompr: c.uncompr
+o.uncompr: h.zlib
+o.uncompr: h.zconf
+o.zutil: c.zutil
+o.zutil: h.zutil
+o.zutil: h.zlib
+o.zutil: h.zconf
diff --git a/protocols/Telegram/tgl/zlib/old/README b/protocols/Telegram/tgl/zlib/old/README
new file mode 100644
index 0000000000..800bf07982
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/old/README
@@ -0,0 +1,3 @@
+This directory contains files that have not been updated for zlib 1.2.x
+
+(Volunteers are encouraged to help clean this up. Thanks.)
diff --git a/protocols/Telegram/tgl/zlib/old/descrip.mms b/protocols/Telegram/tgl/zlib/old/descrip.mms
new file mode 100644
index 0000000000..7066da5b55
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/old/descrip.mms
@@ -0,0 +1,48 @@
+# descrip.mms: MMS description file for building zlib on VMS
+# written by Martin P.J. Zinser <m.zinser@gsi.de>
+
+cc_defs =
+c_deb =
+
+.ifdef __DECC__
+pref = /prefix=all
+.endif
+
+OBJS = adler32.obj, compress.obj, crc32.obj, gzio.obj, uncompr.obj,\
+ deflate.obj, trees.obj, zutil.obj, inflate.obj, infblock.obj,\
+ inftrees.obj, infcodes.obj, infutil.obj, inffast.obj
+
+CFLAGS= $(C_DEB) $(CC_DEFS) $(PREF)
+
+all : example.exe minigzip.exe
+ @ write sys$output " Example applications available"
+libz.olb : libz.olb($(OBJS))
+ @ write sys$output " libz available"
+
+example.exe : example.obj libz.olb
+ link example,libz.olb/lib
+
+minigzip.exe : minigzip.obj libz.olb
+ link minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib
+
+clean :
+ delete *.obj;*,libz.olb;*
+
+
+# Other dependencies.
+adler32.obj : zutil.h zlib.h zconf.h
+compress.obj : zlib.h zconf.h
+crc32.obj : zutil.h zlib.h zconf.h
+deflate.obj : deflate.h zutil.h zlib.h zconf.h
+example.obj : zlib.h zconf.h
+gzio.obj : zutil.h zlib.h zconf.h
+infblock.obj : zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
+infcodes.obj : zutil.h zlib.h zconf.h inftrees.h infutil.h infcodes.h inffast.h
+inffast.obj : zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
+inflate.obj : zutil.h zlib.h zconf.h infblock.h
+inftrees.obj : zutil.h zlib.h zconf.h inftrees.h
+infutil.obj : zutil.h zlib.h zconf.h inftrees.h infutil.h
+minigzip.obj : zlib.h zconf.h
+trees.obj : deflate.h zutil.h zlib.h zconf.h
+uncompr.obj : zlib.h zconf.h
+zutil.obj : zutil.h zlib.h zconf.h
diff --git a/protocols/Telegram/tgl/zlib/old/os2/Makefile.os2 b/protocols/Telegram/tgl/zlib/old/os2/Makefile.os2
new file mode 100644
index 0000000000..a105aaa5bb
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/old/os2/Makefile.os2
@@ -0,0 +1,136 @@
+# Makefile for zlib under OS/2 using GCC (PGCC)
+# For conditions of distribution and use, see copyright notice in zlib.h
+
+# To compile and test, type:
+# cp Makefile.os2 ..
+# cd ..
+# make -f Makefile.os2 test
+
+# This makefile will build a static library z.lib, a shared library
+# z.dll and a import library zdll.lib. You can use either z.lib or
+# zdll.lib by specifying either -lz or -lzdll on gcc's command line
+
+CC=gcc -Zomf -s
+
+CFLAGS=-O6 -Wall
+#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
+#CFLAGS=-g -DDEBUG
+#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
+# -Wstrict-prototypes -Wmissing-prototypes
+
+#################### BUG WARNING: #####################
+## infcodes.c hits a bug in pgcc-1.0, so you have to use either
+## -O# where # <= 4 or one of (-fno-ommit-frame-pointer or -fno-force-mem)
+## This bug is reportedly fixed in pgcc >1.0, but this was not tested
+CFLAGS+=-fno-force-mem
+
+LDFLAGS=-s -L. -lzdll -Zcrtdll
+LDSHARED=$(CC) -s -Zomf -Zdll -Zcrtdll
+
+VER=1.1.0
+ZLIB=z.lib
+SHAREDLIB=z.dll
+SHAREDLIBIMP=zdll.lib
+LIBS=$(ZLIB) $(SHAREDLIB) $(SHAREDLIBIMP)
+
+AR=emxomfar cr
+IMPLIB=emximp
+RANLIB=echo
+TAR=tar
+SHELL=bash
+
+prefix=/usr/local
+exec_prefix = $(prefix)
+
+OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
+ zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
+
+TEST_OBJS = example.o minigzip.o
+
+DISTFILES = README INDEX ChangeLog configure Make*[a-z0-9] *.[ch] descrip.mms \
+ algorithm.txt zlib.3 msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \
+ nt/Makefile.nt nt/zlib.dnt contrib/README.contrib contrib/*.txt \
+ contrib/asm386/*.asm contrib/asm386/*.c \
+ contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/iostream/*.cpp \
+ contrib/iostream/*.h contrib/iostream2/*.h contrib/iostream2/*.cpp \
+ contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32
+
+all: example.exe minigzip.exe
+
+test: all
+ @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
+ echo hello world | ./minigzip | ./minigzip -d || \
+ echo ' *** minigzip test FAILED ***' ; \
+ if ./example; then \
+ echo ' *** zlib test OK ***'; \
+ else \
+ echo ' *** zlib test FAILED ***'; \
+ fi
+
+$(ZLIB): $(OBJS)
+ $(AR) $@ $(OBJS)
+ -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
+
+$(SHAREDLIB): $(OBJS) os2/z.def
+ $(LDSHARED) -o $@ $^
+
+$(SHAREDLIBIMP): os2/z.def
+ $(IMPLIB) -o $@ $^
+
+example.exe: example.o $(LIBS)
+ $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
+
+minigzip.exe: minigzip.o $(LIBS)
+ $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
+
+clean:
+ rm -f *.o *~ example minigzip libz.a libz.so* foo.gz
+
+distclean: clean
+
+zip:
+ mv Makefile Makefile~; cp -p Makefile.in Makefile
+ rm -f test.c ztest*.c
+ v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
+ zip -ul9 zlib$$v $(DISTFILES)
+ mv Makefile~ Makefile
+
+dist:
+ mv Makefile Makefile~; cp -p Makefile.in Makefile
+ rm -f test.c ztest*.c
+ d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
+ rm -f $$d.tar.gz; \
+ if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
+ files=""; \
+ for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
+ cd ..; \
+ GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
+ if test ! -d $$d; then rm -f $$d; fi
+ mv Makefile~ Makefile
+
+tags:
+ etags *.[ch]
+
+depend:
+ makedepend -- $(CFLAGS) -- *.[ch]
+
+# DO NOT DELETE THIS LINE -- make depend depends on it.
+
+adler32.o: zlib.h zconf.h
+compress.o: zlib.h zconf.h
+crc32.o: zlib.h zconf.h
+deflate.o: deflate.h zutil.h zlib.h zconf.h
+example.o: zlib.h zconf.h
+gzio.o: zutil.h zlib.h zconf.h
+infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h
+infcodes.o: zutil.h zlib.h zconf.h
+infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h
+inffast.o: zutil.h zlib.h zconf.h inftrees.h
+inffast.o: infblock.h infcodes.h infutil.h inffast.h
+inflate.o: zutil.h zlib.h zconf.h infblock.h
+inftrees.o: zutil.h zlib.h zconf.h inftrees.h
+infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
+minigzip.o: zlib.h zconf.h
+trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
+uncompr.o: zlib.h zconf.h
+zutil.o: zutil.h zlib.h zconf.h
diff --git a/protocols/Telegram/tgl/zlib/old/os2/zlib.def b/protocols/Telegram/tgl/zlib/old/os2/zlib.def
new file mode 100644
index 0000000000..4c753f1a3b
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/old/os2/zlib.def
@@ -0,0 +1,51 @@
+;
+; Slightly modified version of ../nt/zlib.dnt :-)
+;
+
+LIBRARY Z
+DESCRIPTION "Zlib compression library for OS/2"
+CODE PRELOAD MOVEABLE DISCARDABLE
+DATA PRELOAD MOVEABLE MULTIPLE
+
+EXPORTS
+ adler32
+ compress
+ crc32
+ deflate
+ deflateCopy
+ deflateEnd
+ deflateInit2_
+ deflateInit_
+ deflateParams
+ deflateReset
+ deflateSetDictionary
+ gzclose
+ gzdopen
+ gzerror
+ gzflush
+ gzopen
+ gzread
+ gzwrite
+ inflate
+ inflateEnd
+ inflateInit2_
+ inflateInit_
+ inflateReset
+ inflateSetDictionary
+ inflateSync
+ uncompress
+ zlibVersion
+ gzprintf
+ gzputc
+ gzgetc
+ gzseek
+ gzrewind
+ gztell
+ gzeof
+ gzsetparams
+ zError
+ inflateSyncPoint
+ get_crc_table
+ compress2
+ gzputs
+ gzgets
diff --git a/protocols/Telegram/tgl/zlib/old/visual-basic.txt b/protocols/Telegram/tgl/zlib/old/visual-basic.txt
new file mode 100644
index 0000000000..57efe58124
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/old/visual-basic.txt
@@ -0,0 +1,160 @@
+See below some functions declarations for Visual Basic.
+
+Frequently Asked Question:
+
+Q: Each time I use the compress function I get the -5 error (not enough
+ room in the output buffer).
+
+A: Make sure that the length of the compressed buffer is passed by
+ reference ("as any"), not by value ("as long"). Also check that
+ before the call of compress this length is equal to the total size of
+ the compressed buffer and not zero.
+
+
+From: "Jon Caruana" <jon-net@usa.net>
+Subject: Re: How to port zlib declares to vb?
+Date: Mon, 28 Oct 1996 18:33:03 -0600
+
+Got the answer! (I haven't had time to check this but it's what I got, and
+looks correct):
+
+He has the following routines working:
+ compress
+ uncompress
+ gzopen
+ gzwrite
+ gzread
+ gzclose
+
+Declares follow: (Quoted from Carlos Rios <c_rios@sonda.cl>, in Vb4 form)
+
+#If Win16 Then 'Use Win16 calls.
+Declare Function compress Lib "ZLIB.DLL" (ByVal compr As
+ String, comprLen As Any, ByVal buf As String, ByVal buflen
+ As Long) As Integer
+Declare Function uncompress Lib "ZLIB.DLL" (ByVal uncompr
+ As String, uncomprLen As Any, ByVal compr As String, ByVal
+ lcompr As Long) As Integer
+Declare Function gzopen Lib "ZLIB.DLL" (ByVal filePath As
+ String, ByVal mode As String) As Long
+Declare Function gzread Lib "ZLIB.DLL" (ByVal file As
+ Long, ByVal uncompr As String, ByVal uncomprLen As Integer)
+ As Integer
+Declare Function gzwrite Lib "ZLIB.DLL" (ByVal file As
+ Long, ByVal uncompr As String, ByVal uncomprLen As Integer)
+ As Integer
+Declare Function gzclose Lib "ZLIB.DLL" (ByVal file As
+ Long) As Integer
+#Else
+Declare Function compress Lib "ZLIB32.DLL"
+ (ByVal compr As String, comprLen As Any, ByVal buf As
+ String, ByVal buflen As Long) As Integer
+Declare Function uncompress Lib "ZLIB32.DLL"
+ (ByVal uncompr As String, uncomprLen As Any, ByVal compr As
+ String, ByVal lcompr As Long) As Long
+Declare Function gzopen Lib "ZLIB32.DLL"
+ (ByVal file As String, ByVal mode As String) As Long
+Declare Function gzread Lib "ZLIB32.DLL"
+ (ByVal file As Long, ByVal uncompr As String, ByVal
+ uncomprLen As Long) As Long
+Declare Function gzwrite Lib "ZLIB32.DLL"
+ (ByVal file As Long, ByVal uncompr As String, ByVal
+ uncomprLen As Long) As Long
+Declare Function gzclose Lib "ZLIB32.DLL"
+ (ByVal file As Long) As Long
+#End If
+
+-Jon Caruana
+jon-net@usa.net
+Microsoft Sitebuilder Network Level 1 Member - HTML Writer's Guild Member
+
+
+Here is another example from Michael <michael_borgsys@hotmail.com> that he
+says conforms to the VB guidelines, and that solves the problem of not
+knowing the uncompressed size by storing it at the end of the file:
+
+'Calling the functions:
+'bracket meaning: <parameter> [optional] {Range of possible values}
+'Call subCompressFile(<path with filename to compress> [, <path with
+filename to write to>, [level of compression {1..9}]])
+'Call subUncompressFile(<path with filename to compress>)
+
+Option Explicit
+Private lngpvtPcnSml As Long 'Stores value for 'lngPercentSmaller'
+Private Const SUCCESS As Long = 0
+Private Const strFilExt As String = ".cpr"
+Private Declare Function lngfncCpr Lib "zlib.dll" Alias "compress2" (ByRef
+dest As Any, ByRef destLen As Any, ByRef src As Any, ByVal srcLen As Long,
+ByVal level As Integer) As Long
+Private Declare Function lngfncUcp Lib "zlib.dll" Alias "uncompress" (ByRef
+dest As Any, ByRef destLen As Any, ByRef src As Any, ByVal srcLen As Long)
+As Long
+
+Public Sub subCompressFile(ByVal strargOriFilPth As String, Optional ByVal
+strargCprFilPth As String, Optional ByVal intLvl As Integer = 9)
+ Dim strCprPth As String
+ Dim lngOriSiz As Long
+ Dim lngCprSiz As Long
+ Dim bytaryOri() As Byte
+ Dim bytaryCpr() As Byte
+ lngOriSiz = FileLen(strargOriFilPth)
+ ReDim bytaryOri(lngOriSiz - 1)
+ Open strargOriFilPth For Binary Access Read As #1
+ Get #1, , bytaryOri()
+ Close #1
+ strCprPth = IIf(strargCprFilPth = "", strargOriFilPth, strargCprFilPth)
+'Select file path and name
+ strCprPth = strCprPth & IIf(Right(strCprPth, Len(strFilExt)) =
+strFilExt, "", strFilExt) 'Add file extension if not exists
+ lngCprSiz = (lngOriSiz * 1.01) + 12 'Compression needs temporary a bit
+more space then original file size
+ ReDim bytaryCpr(lngCprSiz - 1)
+ If lngfncCpr(bytaryCpr(0), lngCprSiz, bytaryOri(0), lngOriSiz, intLvl) =
+SUCCESS Then
+ lngpvtPcnSml = (1# - (lngCprSiz / lngOriSiz)) * 100
+ ReDim Preserve bytaryCpr(lngCprSiz - 1)
+ Open strCprPth For Binary Access Write As #1
+ Put #1, , bytaryCpr()
+ Put #1, , lngOriSiz 'Add the the original size value to the end
+(last 4 bytes)
+ Close #1
+ Else
+ MsgBox "Compression error"
+ End If
+ Erase bytaryCpr
+ Erase bytaryOri
+End Sub
+
+Public Sub subUncompressFile(ByVal strargFilPth As String)
+ Dim bytaryCpr() As Byte
+ Dim bytaryOri() As Byte
+ Dim lngOriSiz As Long
+ Dim lngCprSiz As Long
+ Dim strOriPth As String
+ lngCprSiz = FileLen(strargFilPth)
+ ReDim bytaryCpr(lngCprSiz - 1)
+ Open strargFilPth For Binary Access Read As #1
+ Get #1, , bytaryCpr()
+ Close #1
+ 'Read the original file size value:
+ lngOriSiz = bytaryCpr(lngCprSiz - 1) * (2 ^ 24) _
+ + bytaryCpr(lngCprSiz - 2) * (2 ^ 16) _
+ + bytaryCpr(lngCprSiz - 3) * (2 ^ 8) _
+ + bytaryCpr(lngCprSiz - 4)
+ ReDim Preserve bytaryCpr(lngCprSiz - 5) 'Cut of the original size value
+ ReDim bytaryOri(lngOriSiz - 1)
+ If lngfncUcp(bytaryOri(0), lngOriSiz, bytaryCpr(0), lngCprSiz) = SUCCESS
+Then
+ strOriPth = Left(strargFilPth, Len(strargFilPth) - Len(strFilExt))
+ Open strOriPth For Binary Access Write As #1
+ Put #1, , bytaryOri()
+ Close #1
+ Else
+ MsgBox "Uncompression error"
+ End If
+ Erase bytaryCpr
+ Erase bytaryOri
+End Sub
+Public Property Get lngPercentSmaller() As Long
+ lngPercentSmaller = lngpvtPcnSml
+End Property
diff --git a/protocols/Telegram/tgl/zlib/qnx/package.qpg b/protocols/Telegram/tgl/zlib/qnx/package.qpg
new file mode 100644
index 0000000000..aebf6e3ac1
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/qnx/package.qpg
@@ -0,0 +1,141 @@
+<QPG:Generation>
+ <QPG:Options>
+ <QPG:User unattended="no" verbosity="2" listfiles="yes"/>
+ <QPG:Defaults type="qnx_package"/>
+ <QPG:Source></QPG:Source>
+ <QPG:Release number="+"/>
+ <QPG:Build></QPG:Build>
+ <QPG:FileSorting strip="yes"/>
+ <QPG:Package targets="combine"/>
+ <QPG:Repository generate="yes"/>
+ <QPG:FinalDir></QPG:FinalDir>
+ <QPG:Cleanup></QPG:Cleanup>
+ </QPG:Options>
+
+ <QPG:Responsible>
+ <QPG:Company></QPG:Company>
+ <QPG:Department></QPG:Department>
+ <QPG:Group></QPG:Group>
+ <QPG:Team></QPG:Team>
+ <QPG:Employee></QPG:Employee>
+ <QPG:EmailAddress></QPG:EmailAddress>
+ </QPG:Responsible>
+
+ <QPG:Values>
+ <QPG:Files>
+ <QPG:Add file="../zconf.h" install="/opt/include/" user="root:sys" permission="644"/>
+ <QPG:Add file="../zlib.h" install="/opt/include/" user="root:sys" permission="644"/>
+ <QPG:Add file="../libz.so.1.2.8" install="/opt/lib/" user="root:bin" permission="644"/>
+ <QPG:Add file="libz.so" install="/opt/lib/" component="dev" filetype="symlink" linkto="libz.so.1.2.8"/>
+ <QPG:Add file="libz.so.1" install="/opt/lib/" filetype="symlink" linkto="libz.so.1.2.8"/>
+ <QPG:Add file="../libz.so.1.2.8" install="/opt/lib/" component="slib"/>
+ </QPG:Files>
+
+ <QPG:PackageFilter>
+ <QPM:PackageManifest>
+ <QPM:PackageDescription>
+ <QPM:PackageType>Library</QPM:PackageType>
+ <QPM:PackageReleaseNotes></QPM:PackageReleaseNotes>
+ <QPM:PackageReleaseUrgency>Medium</QPM:PackageReleaseUrgency>
+ <QPM:PackageRepository></QPM:PackageRepository>
+ <QPM:FileVersion>2.0</QPM:FileVersion>
+ </QPM:PackageDescription>
+
+ <QPM:ProductDescription>
+ <QPM:ProductName>zlib</QPM:ProductName>
+ <QPM:ProductIdentifier>zlib</QPM:ProductIdentifier>
+ <QPM:ProductEmail>alain.bonnefoy@icbt.com</QPM:ProductEmail>
+ <QPM:VendorName>Public</QPM:VendorName>
+ <QPM:VendorInstallName>public</QPM:VendorInstallName>
+ <QPM:VendorURL>www.gzip.org/zlib</QPM:VendorURL>
+ <QPM:VendorEmbedURL></QPM:VendorEmbedURL>
+ <QPM:VendorEmail></QPM:VendorEmail>
+ <QPM:AuthorName>Jean-Loup Gailly,Mark Adler</QPM:AuthorName>
+ <QPM:AuthorURL>www.gzip.org/zlib</QPM:AuthorURL>
+ <QPM:AuthorEmbedURL></QPM:AuthorEmbedURL>
+ <QPM:AuthorEmail>zlib@gzip.org</QPM:AuthorEmail>
+ <QPM:ProductIconSmall></QPM:ProductIconSmall>
+ <QPM:ProductIconLarge></QPM:ProductIconLarge>
+ <QPM:ProductDescriptionShort>A massively spiffy yet delicately unobtrusive compression library.</QPM:ProductDescriptionShort>
+ <QPM:ProductDescriptionLong>zlib is designed to be a free, general-purpose, legally unencumbered, lossless data compression library for use on virtually any computer hardware and operating system.</QPM:ProductDescriptionLong>
+ <QPM:ProductDescriptionURL>http://www.gzip.org/zlib</QPM:ProductDescriptionURL>
+ <QPM:ProductDescriptionEmbedURL></QPM:ProductDescriptionEmbedURL>
+ </QPM:ProductDescription>
+
+ <QPM:ReleaseDescription>
+ <QPM:ReleaseVersion>1.2.8</QPM:ReleaseVersion>
+ <QPM:ReleaseUrgency>Medium</QPM:ReleaseUrgency>
+ <QPM:ReleaseStability>Stable</QPM:ReleaseStability>
+ <QPM:ReleaseNoteMinor></QPM:ReleaseNoteMinor>
+ <QPM:ReleaseNoteMajor></QPM:ReleaseNoteMajor>
+ <QPM:ExcludeCountries>
+ <QPM:Country></QPM:Country>
+ </QPM:ExcludeCountries>
+
+ <QPM:ReleaseCopyright>No License</QPM:ReleaseCopyright>
+ </QPM:ReleaseDescription>
+
+ <QPM:ContentDescription>
+ <QPM:ContentTopic xmlmultiple="true">Software Development/Libraries and Extensions/C Libraries</QPM:ContentTopic>
+ <QPM:ContentKeyword>zlib,compression</QPM:ContentKeyword>
+ <QPM:TargetOS>qnx6</QPM:TargetOS>
+ <QPM:HostOS>qnx6</QPM:HostOS>
+ <QPM:DisplayEnvironment xmlmultiple="true">None</QPM:DisplayEnvironment>
+ <QPM:TargetAudience xmlmultiple="true">Developer</QPM:TargetAudience>
+ </QPM:ContentDescription>
+ </QPM:PackageManifest>
+ </QPG:PackageFilter>
+
+ <QPG:PackageFilter proc="none" target="none">
+ <QPM:PackageManifest>
+ <QPM:ProductInstallationDependencies>
+ <QPM:ProductRequirements></QPM:ProductRequirements>
+ </QPM:ProductInstallationDependencies>
+
+ <QPM:ProductInstallationProcedure>
+ <QPM:Script xmlmultiple="true">
+ <QPM:ScriptName></QPM:ScriptName>
+ <QPM:ScriptType>Install</QPM:ScriptType>
+ <QPM:ScriptTiming>Post</QPM:ScriptTiming>
+ <QPM:ScriptBlocking>No</QPM:ScriptBlocking>
+ <QPM:ScriptResult>Ignore</QPM:ScriptResult>
+ <QPM:ShortDescription></QPM:ShortDescription>
+ <QPM:UseBinaries>No</QPM:UseBinaries>
+ <QPM:Priority>Optional</QPM:Priority>
+ </QPM:Script>
+ </QPM:ProductInstallationProcedure>
+ </QPM:PackageManifest>
+
+ <QPM:Launch>
+ </QPM:Launch>
+ </QPG:PackageFilter>
+
+ <QPG:PackageFilter type="core" component="none">
+ <QPM:PackageManifest>
+ <QPM:ProductInstallationProcedure>
+ <QPM:OrderDependency xmlmultiple="true">
+ <QPM:Order>InstallOver</QPM:Order>
+ <QPM:Product>zlib</QPM:Product>
+ </QPM:OrderDependency>
+ </QPM:ProductInstallationProcedure>
+ </QPM:PackageManifest>
+
+ <QPM:Launch>
+ </QPM:Launch>
+ </QPG:PackageFilter>
+
+ <QPG:PackageFilter type="core" component="dev">
+ <QPM:PackageManifest>
+ <QPM:ProductInstallationProcedure>
+ <QPM:OrderDependency xmlmultiple="true">
+ <QPM:Order>InstallOver</QPM:Order>
+ <QPM:Product>zlib-dev</QPM:Product>
+ </QPM:OrderDependency>
+ </QPM:ProductInstallationProcedure>
+ </QPM:PackageManifest>
+
+ <QPM:Launch>
+ </QPM:Launch>
+ </QPG:PackageFilter>
+ </QPG:Values>
+</QPG:Generation>
diff --git a/protocols/Telegram/tgl/zlib/test/example.c b/protocols/Telegram/tgl/zlib/test/example.c
new file mode 100644
index 0000000000..138a699bd5
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/test/example.c
@@ -0,0 +1,601 @@
+/* example.c -- usage example of the zlib compression library
+ * Copyright (C) 1995-2006, 2011 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#include "zlib.h"
+#include <stdio.h>
+
+#ifdef STDC
+# include <string.h>
+# include <stdlib.h>
+#endif
+
+#if defined(VMS) || defined(RISCOS)
+# define TESTFILE "foo-gz"
+#else
+# define TESTFILE "foo.gz"
+#endif
+
+#define CHECK_ERR(err, msg) { \
+ if (err != Z_OK) { \
+ fprintf(stderr, "%s error: %d\n", msg, err); \
+ exit(1); \
+ } \
+}
+
+z_const char hello[] = "hello, hello!";
+/* "hello world" would be more standard, but the repeated "hello"
+ * stresses the compression code better, sorry...
+ */
+
+const char dictionary[] = "hello";
+uLong dictId; /* Adler32 value of the dictionary */
+
+void test_deflate OF((Byte *compr, uLong comprLen));
+void test_inflate OF((Byte *compr, uLong comprLen,
+ Byte *uncompr, uLong uncomprLen));
+void test_large_deflate OF((Byte *compr, uLong comprLen,
+ Byte *uncompr, uLong uncomprLen));
+void test_large_inflate OF((Byte *compr, uLong comprLen,
+ Byte *uncompr, uLong uncomprLen));
+void test_flush OF((Byte *compr, uLong *comprLen));
+void test_sync OF((Byte *compr, uLong comprLen,
+ Byte *uncompr, uLong uncomprLen));
+void test_dict_deflate OF((Byte *compr, uLong comprLen));
+void test_dict_inflate OF((Byte *compr, uLong comprLen,
+ Byte *uncompr, uLong uncomprLen));
+int main OF((int argc, char *argv[]));
+
+
+#ifdef Z_SOLO
+
+void *myalloc OF((void *, unsigned, unsigned));
+void myfree OF((void *, void *));
+
+void *myalloc(q, n, m)
+ void *q;
+ unsigned n, m;
+{
+ q = Z_NULL;
+ return calloc(n, m);
+}
+
+void myfree(void *q, void *p)
+{
+ q = Z_NULL;
+ free(p);
+}
+
+static alloc_func zalloc = myalloc;
+static free_func zfree = myfree;
+
+#else /* !Z_SOLO */
+
+static alloc_func zalloc = (alloc_func)0;
+static free_func zfree = (free_func)0;
+
+void test_compress OF((Byte *compr, uLong comprLen,
+ Byte *uncompr, uLong uncomprLen));
+void test_gzio OF((const char *fname,
+ Byte *uncompr, uLong uncomprLen));
+
+/* ===========================================================================
+ * Test compress() and uncompress()
+ */
+void test_compress(compr, comprLen, uncompr, uncomprLen)
+ Byte *compr, *uncompr;
+ uLong comprLen, uncomprLen;
+{
+ int err;
+ uLong len = (uLong)strlen(hello)+1;
+
+ err = compress(compr, &comprLen, (const Bytef*)hello, len);
+ CHECK_ERR(err, "compress");
+
+ strcpy((char*)uncompr, "garbage");
+
+ err = uncompress(uncompr, &uncomprLen, compr, comprLen);
+ CHECK_ERR(err, "uncompress");
+
+ if (strcmp((char*)uncompr, hello)) {
+ fprintf(stderr, "bad uncompress\n");
+ exit(1);
+ } else {
+ printf("uncompress(): %s\n", (char *)uncompr);
+ }
+}
+
+/* ===========================================================================
+ * Test read/write of .gz files
+ */
+void test_gzio(fname, uncompr, uncomprLen)
+ const char *fname; /* compressed file name */
+ Byte *uncompr;
+ uLong uncomprLen;
+{
+#ifdef NO_GZCOMPRESS
+ fprintf(stderr, "NO_GZCOMPRESS -- gz* functions cannot compress\n");
+#else
+ int err;
+ int len = (int)strlen(hello)+1;
+ gzFile file;
+ z_off_t pos;
+
+ file = gzopen(fname, "wb");
+ if (file == NULL) {
+ fprintf(stderr, "gzopen error\n");
+ exit(1);
+ }
+ gzputc(file, 'h');
+ if (gzputs(file, "ello") != 4) {
+ fprintf(stderr, "gzputs err: %s\n", gzerror(file, &err));
+ exit(1);
+ }
+ if (gzprintf(file, ", %s!", "hello") != 8) {
+ fprintf(stderr, "gzprintf err: %s\n", gzerror(file, &err));
+ exit(1);
+ }
+ gzseek(file, 1L, SEEK_CUR); /* add one zero byte */
+ gzclose(file);
+
+ file = gzopen(fname, "rb");
+ if (file == NULL) {
+ fprintf(stderr, "gzopen error\n");
+ exit(1);
+ }
+ strcpy((char*)uncompr, "garbage");
+
+ if (gzread(file, uncompr, (unsigned)uncomprLen) != len) {
+ fprintf(stderr, "gzread err: %s\n", gzerror(file, &err));
+ exit(1);
+ }
+ if (strcmp((char*)uncompr, hello)) {
+ fprintf(stderr, "bad gzread: %s\n", (char*)uncompr);
+ exit(1);
+ } else {
+ printf("gzread(): %s\n", (char*)uncompr);
+ }
+
+ pos = gzseek(file, -8L, SEEK_CUR);
+ if (pos != 6 || gztell(file) != pos) {
+ fprintf(stderr, "gzseek error, pos=%ld, gztell=%ld\n",
+ (long)pos, (long)gztell(file));
+ exit(1);
+ }
+
+ if (gzgetc(file) != ' ') {
+ fprintf(stderr, "gzgetc error\n");
+ exit(1);
+ }
+
+ if (gzungetc(' ', file) != ' ') {
+ fprintf(stderr, "gzungetc error\n");
+ exit(1);
+ }
+
+ gzgets(file, (char*)uncompr, (int)uncomprLen);
+ if (strlen((char*)uncompr) != 7) { /* " hello!" */
+ fprintf(stderr, "gzgets err after gzseek: %s\n", gzerror(file, &err));
+ exit(1);
+ }
+ if (strcmp((char*)uncompr, hello + 6)) {
+ fprintf(stderr, "bad gzgets after gzseek\n");
+ exit(1);
+ } else {
+ printf("gzgets() after gzseek: %s\n", (char*)uncompr);
+ }
+
+ gzclose(file);
+#endif
+}
+
+#endif /* Z_SOLO */
+
+/* ===========================================================================
+ * Test deflate() with small buffers
+ */
+void test_deflate(compr, comprLen)
+ Byte *compr;
+ uLong comprLen;
+{
+ z_stream c_stream; /* compression stream */
+ int err;
+ uLong len = (uLong)strlen(hello)+1;
+
+ c_stream.zalloc = zalloc;
+ c_stream.zfree = zfree;
+ c_stream.opaque = (voidpf)0;
+
+ err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION);
+ CHECK_ERR(err, "deflateInit");
+
+ c_stream.next_in = (z_const unsigned char *)hello;
+ c_stream.next_out = compr;
+
+ while (c_stream.total_in != len && c_stream.total_out < comprLen) {
+ c_stream.avail_in = c_stream.avail_out = 1; /* force small buffers */
+ err = deflate(&c_stream, Z_NO_FLUSH);
+ CHECK_ERR(err, "deflate");
+ }
+ /* Finish the stream, still forcing small buffers: */
+ for (;;) {
+ c_stream.avail_out = 1;
+ err = deflate(&c_stream, Z_FINISH);
+ if (err == Z_STREAM_END) break;
+ CHECK_ERR(err, "deflate");
+ }
+
+ err = deflateEnd(&c_stream);
+ CHECK_ERR(err, "deflateEnd");
+}
+
+/* ===========================================================================
+ * Test inflate() with small buffers
+ */
+void test_inflate(compr, comprLen, uncompr, uncomprLen)
+ Byte *compr, *uncompr;
+ uLong comprLen, uncomprLen;
+{
+ int err;
+ z_stream d_stream; /* decompression stream */
+
+ strcpy((char*)uncompr, "garbage");
+
+ d_stream.zalloc = zalloc;
+ d_stream.zfree = zfree;
+ d_stream.opaque = (voidpf)0;
+
+ d_stream.next_in = compr;
+ d_stream.avail_in = 0;
+ d_stream.next_out = uncompr;
+
+ err = inflateInit(&d_stream);
+ CHECK_ERR(err, "inflateInit");
+
+ while (d_stream.total_out < uncomprLen && d_stream.total_in < comprLen) {
+ d_stream.avail_in = d_stream.avail_out = 1; /* force small buffers */
+ err = inflate(&d_stream, Z_NO_FLUSH);
+ if (err == Z_STREAM_END) break;
+ CHECK_ERR(err, "inflate");
+ }
+
+ err = inflateEnd(&d_stream);
+ CHECK_ERR(err, "inflateEnd");
+
+ if (strcmp((char*)uncompr, hello)) {
+ fprintf(stderr, "bad inflate\n");
+ exit(1);
+ } else {
+ printf("inflate(): %s\n", (char *)uncompr);
+ }
+}
+
+/* ===========================================================================
+ * Test deflate() with large buffers and dynamic change of compression level
+ */
+void test_large_deflate(compr, comprLen, uncompr, uncomprLen)
+ Byte *compr, *uncompr;
+ uLong comprLen, uncomprLen;
+{
+ z_stream c_stream; /* compression stream */
+ int err;
+
+ c_stream.zalloc = zalloc;
+ c_stream.zfree = zfree;
+ c_stream.opaque = (voidpf)0;
+
+ err = deflateInit(&c_stream, Z_BEST_SPEED);
+ CHECK_ERR(err, "deflateInit");
+
+ c_stream.next_out = compr;
+ c_stream.avail_out = (uInt)comprLen;
+
+ /* At this point, uncompr is still mostly zeroes, so it should compress
+ * very well:
+ */
+ c_stream.next_in = uncompr;
+ c_stream.avail_in = (uInt)uncomprLen;
+ err = deflate(&c_stream, Z_NO_FLUSH);
+ CHECK_ERR(err, "deflate");
+ if (c_stream.avail_in != 0) {
+ fprintf(stderr, "deflate not greedy\n");
+ exit(1);
+ }
+
+ /* Feed in already compressed data and switch to no compression: */
+ deflateParams(&c_stream, Z_NO_COMPRESSION, Z_DEFAULT_STRATEGY);
+ c_stream.next_in = compr;
+ c_stream.avail_in = (uInt)comprLen/2;
+ err = deflate(&c_stream, Z_NO_FLUSH);
+ CHECK_ERR(err, "deflate");
+
+ /* Switch back to compressing mode: */
+ deflateParams(&c_stream, Z_BEST_COMPRESSION, Z_FILTERED);
+ c_stream.next_in = uncompr;
+ c_stream.avail_in = (uInt)uncomprLen;
+ err = deflate(&c_stream, Z_NO_FLUSH);
+ CHECK_ERR(err, "deflate");
+
+ err = deflate(&c_stream, Z_FINISH);
+ if (err != Z_STREAM_END) {
+ fprintf(stderr, "deflate should report Z_STREAM_END\n");
+ exit(1);
+ }
+ err = deflateEnd(&c_stream);
+ CHECK_ERR(err, "deflateEnd");
+}
+
+/* ===========================================================================
+ * Test inflate() with large buffers
+ */
+void test_large_inflate(compr, comprLen, uncompr, uncomprLen)
+ Byte *compr, *uncompr;
+ uLong comprLen, uncomprLen;
+{
+ int err;
+ z_stream d_stream; /* decompression stream */
+
+ strcpy((char*)uncompr, "garbage");
+
+ d_stream.zalloc = zalloc;
+ d_stream.zfree = zfree;
+ d_stream.opaque = (voidpf)0;
+
+ d_stream.next_in = compr;
+ d_stream.avail_in = (uInt)comprLen;
+
+ err = inflateInit(&d_stream);
+ CHECK_ERR(err, "inflateInit");
+
+ for (;;) {
+ d_stream.next_out = uncompr; /* discard the output */
+ d_stream.avail_out = (uInt)uncomprLen;
+ err = inflate(&d_stream, Z_NO_FLUSH);
+ if (err == Z_STREAM_END) break;
+ CHECK_ERR(err, "large inflate");
+ }
+
+ err = inflateEnd(&d_stream);
+ CHECK_ERR(err, "inflateEnd");
+
+ if (d_stream.total_out != 2*uncomprLen + comprLen/2) {
+ fprintf(stderr, "bad large inflate: %ld\n", d_stream.total_out);
+ exit(1);
+ } else {
+ printf("large_inflate(): OK\n");
+ }
+}
+
+/* ===========================================================================
+ * Test deflate() with full flush
+ */
+void test_flush(compr, comprLen)
+ Byte *compr;
+ uLong *comprLen;
+{
+ z_stream c_stream; /* compression stream */
+ int err;
+ uInt len = (uInt)strlen(hello)+1;
+
+ c_stream.zalloc = zalloc;
+ c_stream.zfree = zfree;
+ c_stream.opaque = (voidpf)0;
+
+ err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION);
+ CHECK_ERR(err, "deflateInit");
+
+ c_stream.next_in = (z_const unsigned char *)hello;
+ c_stream.next_out = compr;
+ c_stream.avail_in = 3;
+ c_stream.avail_out = (uInt)*comprLen;
+ err = deflate(&c_stream, Z_FULL_FLUSH);
+ CHECK_ERR(err, "deflate");
+
+ compr[3]++; /* force an error in first compressed block */
+ c_stream.avail_in = len - 3;
+
+ err = deflate(&c_stream, Z_FINISH);
+ if (err != Z_STREAM_END) {
+ CHECK_ERR(err, "deflate");
+ }
+ err = deflateEnd(&c_stream);
+ CHECK_ERR(err, "deflateEnd");
+
+ *comprLen = c_stream.total_out;
+}
+
+/* ===========================================================================
+ * Test inflateSync()
+ */
+void test_sync(compr, comprLen, uncompr, uncomprLen)
+ Byte *compr, *uncompr;
+ uLong comprLen, uncomprLen;
+{
+ int err;
+ z_stream d_stream; /* decompression stream */
+
+ strcpy((char*)uncompr, "garbage");
+
+ d_stream.zalloc = zalloc;
+ d_stream.zfree = zfree;
+ d_stream.opaque = (voidpf)0;
+
+ d_stream.next_in = compr;
+ d_stream.avail_in = 2; /* just read the zlib header */
+
+ err = inflateInit(&d_stream);
+ CHECK_ERR(err, "inflateInit");
+
+ d_stream.next_out = uncompr;
+ d_stream.avail_out = (uInt)uncomprLen;
+
+ inflate(&d_stream, Z_NO_FLUSH);
+ CHECK_ERR(err, "inflate");
+
+ d_stream.avail_in = (uInt)comprLen-2; /* read all compressed data */
+ err = inflateSync(&d_stream); /* but skip the damaged part */
+ CHECK_ERR(err, "inflateSync");
+
+ err = inflate(&d_stream, Z_FINISH);
+ if (err != Z_DATA_ERROR) {
+ fprintf(stderr, "inflate should report DATA_ERROR\n");
+ /* Because of incorrect adler32 */
+ exit(1);
+ }
+ err = inflateEnd(&d_stream);
+ CHECK_ERR(err, "inflateEnd");
+
+ printf("after inflateSync(): hel%s\n", (char *)uncompr);
+}
+
+/* ===========================================================================
+ * Test deflate() with preset dictionary
+ */
+void test_dict_deflate(compr, comprLen)
+ Byte *compr;
+ uLong comprLen;
+{
+ z_stream c_stream; /* compression stream */
+ int err;
+
+ c_stream.zalloc = zalloc;
+ c_stream.zfree = zfree;
+ c_stream.opaque = (voidpf)0;
+
+ err = deflateInit(&c_stream, Z_BEST_COMPRESSION);
+ CHECK_ERR(err, "deflateInit");
+
+ err = deflateSetDictionary(&c_stream,
+ (const Bytef*)dictionary, (int)sizeof(dictionary));
+ CHECK_ERR(err, "deflateSetDictionary");
+
+ dictId = c_stream.adler;
+ c_stream.next_out = compr;
+ c_stream.avail_out = (uInt)comprLen;
+
+ c_stream.next_in = (z_const unsigned char *)hello;
+ c_stream.avail_in = (uInt)strlen(hello)+1;
+
+ err = deflate(&c_stream, Z_FINISH);
+ if (err != Z_STREAM_END) {
+ fprintf(stderr, "deflate should report Z_STREAM_END\n");
+ exit(1);
+ }
+ err = deflateEnd(&c_stream);
+ CHECK_ERR(err, "deflateEnd");
+}
+
+/* ===========================================================================
+ * Test inflate() with a preset dictionary
+ */
+void test_dict_inflate(compr, comprLen, uncompr, uncomprLen)
+ Byte *compr, *uncompr;
+ uLong comprLen, uncomprLen;
+{
+ int err;
+ z_stream d_stream; /* decompression stream */
+
+ strcpy((char*)uncompr, "garbage");
+
+ d_stream.zalloc = zalloc;
+ d_stream.zfree = zfree;
+ d_stream.opaque = (voidpf)0;
+
+ d_stream.next_in = compr;
+ d_stream.avail_in = (uInt)comprLen;
+
+ err = inflateInit(&d_stream);
+ CHECK_ERR(err, "inflateInit");
+
+ d_stream.next_out = uncompr;
+ d_stream.avail_out = (uInt)uncomprLen;
+
+ for (;;) {
+ err = inflate(&d_stream, Z_NO_FLUSH);
+ if (err == Z_STREAM_END) break;
+ if (err == Z_NEED_DICT) {
+ if (d_stream.adler != dictId) {
+ fprintf(stderr, "unexpected dictionary");
+ exit(1);
+ }
+ err = inflateSetDictionary(&d_stream, (const Bytef*)dictionary,
+ (int)sizeof(dictionary));
+ }
+ CHECK_ERR(err, "inflate with dict");
+ }
+
+ err = inflateEnd(&d_stream);
+ CHECK_ERR(err, "inflateEnd");
+
+ if (strcmp((char*)uncompr, hello)) {
+ fprintf(stderr, "bad inflate with dict\n");
+ exit(1);
+ } else {
+ printf("inflate with dictionary: %s\n", (char *)uncompr);
+ }
+}
+
+/* ===========================================================================
+ * Usage: example [output.gz [input.gz]]
+ */
+
+int main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ Byte *compr, *uncompr;
+ uLong comprLen = 10000*sizeof(int); /* don't overflow on MSDOS */
+ uLong uncomprLen = comprLen;
+ static const char* myVersion = ZLIB_VERSION;
+
+ if (zlibVersion()[0] != myVersion[0]) {
+ fprintf(stderr, "incompatible zlib version\n");
+ exit(1);
+
+ } else if (strcmp(zlibVersion(), ZLIB_VERSION) != 0) {
+ fprintf(stderr, "warning: different zlib version\n");
+ }
+
+ printf("zlib version %s = 0x%04x, compile flags = 0x%lx\n",
+ ZLIB_VERSION, ZLIB_VERNUM, zlibCompileFlags());
+
+ compr = (Byte*)calloc((uInt)comprLen, 1);
+ uncompr = (Byte*)calloc((uInt)uncomprLen, 1);
+ /* compr and uncompr are cleared to avoid reading uninitialized
+ * data and to ensure that uncompr compresses well.
+ */
+ if (compr == Z_NULL || uncompr == Z_NULL) {
+ printf("out of memory\n");
+ exit(1);
+ }
+
+#ifdef Z_SOLO
+ argc = strlen(argv[0]);
+#else
+ test_compress(compr, comprLen, uncompr, uncomprLen);
+
+ test_gzio((argc > 1 ? argv[1] : TESTFILE),
+ uncompr, uncomprLen);
+#endif
+
+ test_deflate(compr, comprLen);
+ test_inflate(compr, comprLen, uncompr, uncomprLen);
+
+ test_large_deflate(compr, comprLen, uncompr, uncomprLen);
+ test_large_inflate(compr, comprLen, uncompr, uncomprLen);
+
+ test_flush(compr, &comprLen);
+ test_sync(compr, comprLen, uncompr, uncomprLen);
+ comprLen = uncomprLen;
+
+ test_dict_deflate(compr, comprLen);
+ test_dict_inflate(compr, comprLen, uncompr, uncomprLen);
+
+ free(compr);
+ free(uncompr);
+
+ return 0;
+}
diff --git a/protocols/Telegram/tgl/zlib/test/infcover.c b/protocols/Telegram/tgl/zlib/test/infcover.c
new file mode 100644
index 0000000000..fe3d9203a0
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/test/infcover.c
@@ -0,0 +1,671 @@
+/* infcover.c -- test zlib's inflate routines with full code coverage
+ * Copyright (C) 2011 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* to use, do: ./configure --cover && make cover */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include "zlib.h"
+
+/* get definition of internal structure so we can mess with it (see pull()),
+ and so we can call inflate_trees() (see cover5()) */
+#define ZLIB_INTERNAL
+#include "inftrees.h"
+#include "inflate.h"
+
+#define local static
+
+/* -- memory tracking routines -- */
+
+/*
+ These memory tracking routines are provided to zlib and track all of zlib's
+ allocations and deallocations, check for LIFO operations, keep a current
+ and high water mark of total bytes requested, optionally set a limit on the
+ total memory that can be allocated, and when done check for memory leaks.
+
+ They are used as follows:
+
+ z_stream strm;
+ mem_setup(&strm) initializes the memory tracking and sets the
+ zalloc, zfree, and opaque members of strm to use
+ memory tracking for all zlib operations on strm
+ mem_limit(&strm, limit) sets a limit on the total bytes requested -- a
+ request that exceeds this limit will result in an
+ allocation failure (returns NULL) -- setting the
+ limit to zero means no limit, which is the default
+ after mem_setup()
+ mem_used(&strm, "msg") prints to stderr "msg" and the total bytes used
+ mem_high(&strm, "msg") prints to stderr "msg" and the high water mark
+ mem_done(&strm, "msg") ends memory tracking, releases all allocations
+ for the tracking as well as leaked zlib blocks, if
+ any. If there was anything unusual, such as leaked
+ blocks, non-FIFO frees, or frees of addresses not
+ allocated, then "msg" and information about the
+ problem is printed to stderr. If everything is
+ normal, nothing is printed. mem_done resets the
+ strm members to Z_NULL to use the default memory
+ allocation routines on the next zlib initialization
+ using strm.
+ */
+
+/* these items are strung together in a linked list, one for each allocation */
+struct mem_item {
+ void *ptr; /* pointer to allocated memory */
+ size_t size; /* requested size of allocation */
+ struct mem_item *next; /* pointer to next item in list, or NULL */
+};
+
+/* this structure is at the root of the linked list, and tracks statistics */
+struct mem_zone {
+ struct mem_item *first; /* pointer to first item in list, or NULL */
+ size_t total, highwater; /* total allocations, and largest total */
+ size_t limit; /* memory allocation limit, or 0 if no limit */
+ int notlifo, rogue; /* counts of non-LIFO frees and rogue frees */
+};
+
+/* memory allocation routine to pass to zlib */
+local void *mem_alloc(void *mem, unsigned count, unsigned size)
+{
+ void *ptr;
+ struct mem_item *item;
+ struct mem_zone *zone = mem;
+ size_t len = count * (size_t)size;
+
+ /* induced allocation failure */
+ if (zone == NULL || (zone->limit && zone->total + len > zone->limit))
+ return NULL;
+
+ /* perform allocation using the standard library, fill memory with a
+ non-zero value to make sure that the code isn't depending on zeros */
+ ptr = malloc(len);
+ if (ptr == NULL)
+ return NULL;
+ memset(ptr, 0xa5, len);
+
+ /* create a new item for the list */
+ item = malloc(sizeof(struct mem_item));
+ if (item == NULL) {
+ free(ptr);
+ return NULL;
+ }
+ item->ptr = ptr;
+ item->size = len;
+
+ /* insert item at the beginning of the list */
+ item->next = zone->first;
+ zone->first = item;
+
+ /* update the statistics */
+ zone->total += item->size;
+ if (zone->total > zone->highwater)
+ zone->highwater = zone->total;
+
+ /* return the allocated memory */
+ return ptr;
+}
+
+/* memory free routine to pass to zlib */
+local void mem_free(void *mem, void *ptr)
+{
+ struct mem_item *item, *next;
+ struct mem_zone *zone = mem;
+
+ /* if no zone, just do a free */
+ if (zone == NULL) {
+ free(ptr);
+ return;
+ }
+
+ /* point next to the item that matches ptr, or NULL if not found -- remove
+ the item from the linked list if found */
+ next = zone->first;
+ if (next) {
+ if (next->ptr == ptr)
+ zone->first = next->next; /* first one is it, remove from list */
+ else {
+ do { /* search the linked list */
+ item = next;
+ next = item->next;
+ } while (next != NULL && next->ptr != ptr);
+ if (next) { /* if found, remove from linked list */
+ item->next = next->next;
+ zone->notlifo++; /* not a LIFO free */
+ }
+
+ }
+ }
+
+ /* if found, update the statistics and free the item */
+ if (next) {
+ zone->total -= next->size;
+ free(next);
+ }
+
+ /* if not found, update the rogue count */
+ else
+ zone->rogue++;
+
+ /* in any case, do the requested free with the standard library function */
+ free(ptr);
+}
+
+/* set up a controlled memory allocation space for monitoring, set the stream
+ parameters to the controlled routines, with opaque pointing to the space */
+local void mem_setup(z_stream *strm)
+{
+ struct mem_zone *zone;
+
+ zone = malloc(sizeof(struct mem_zone));
+ assert(zone != NULL);
+ zone->first = NULL;
+ zone->total = 0;
+ zone->highwater = 0;
+ zone->limit = 0;
+ zone->notlifo = 0;
+ zone->rogue = 0;
+ strm->opaque = zone;
+ strm->zalloc = mem_alloc;
+ strm->zfree = mem_free;
+}
+
+/* set a limit on the total memory allocation, or 0 to remove the limit */
+local void mem_limit(z_stream *strm, size_t limit)
+{
+ struct mem_zone *zone = strm->opaque;
+
+ zone->limit = limit;
+}
+
+/* show the current total requested allocations in bytes */
+local void mem_used(z_stream *strm, char *prefix)
+{
+ struct mem_zone *zone = strm->opaque;
+
+ fprintf(stderr, "%s: %lu allocated\n", prefix, zone->total);
+}
+
+/* show the high water allocation in bytes */
+local void mem_high(z_stream *strm, char *prefix)
+{
+ struct mem_zone *zone = strm->opaque;
+
+ fprintf(stderr, "%s: %lu high water mark\n", prefix, zone->highwater);
+}
+
+/* release the memory allocation zone -- if there are any surprises, notify */
+local void mem_done(z_stream *strm, char *prefix)
+{
+ int count = 0;
+ struct mem_item *item, *next;
+ struct mem_zone *zone = strm->opaque;
+
+ /* show high water mark */
+ mem_high(strm, prefix);
+
+ /* free leftover allocations and item structures, if any */
+ item = zone->first;
+ while (item != NULL) {
+ free(item->ptr);
+ next = item->next;
+ free(item);
+ item = next;
+ count++;
+ }
+
+ /* issue alerts about anything unexpected */
+ if (count || zone->total)
+ fprintf(stderr, "** %s: %lu bytes in %d blocks not freed\n",
+ prefix, zone->total, count);
+ if (zone->notlifo)
+ fprintf(stderr, "** %s: %d frees not LIFO\n", prefix, zone->notlifo);
+ if (zone->rogue)
+ fprintf(stderr, "** %s: %d frees not recognized\n",
+ prefix, zone->rogue);
+
+ /* free the zone and delete from the stream */
+ free(zone);
+ strm->opaque = Z_NULL;
+ strm->zalloc = Z_NULL;
+ strm->zfree = Z_NULL;
+}
+
+/* -- inflate test routines -- */
+
+/* Decode a hexadecimal string, set *len to length, in[] to the bytes. This
+ decodes liberally, in that hex digits can be adjacent, in which case two in
+ a row writes a byte. Or they can delimited by any non-hex character, where
+ the delimiters are ignored except when a single hex digit is followed by a
+ delimiter in which case that single digit writes a byte. The returned
+ data is allocated and must eventually be freed. NULL is returned if out of
+ memory. If the length is not needed, then len can be NULL. */
+local unsigned char *h2b(const char *hex, unsigned *len)
+{
+ unsigned char *in;
+ unsigned next, val;
+
+ in = malloc((strlen(hex) + 1) >> 1);
+ if (in == NULL)
+ return NULL;
+ next = 0;
+ val = 1;
+ do {
+ if (*hex >= '0' && *hex <= '9')
+ val = (val << 4) + *hex - '0';
+ else if (*hex >= 'A' && *hex <= 'F')
+ val = (val << 4) + *hex - 'A' + 10;
+ else if (*hex >= 'a' && *hex <= 'f')
+ val = (val << 4) + *hex - 'a' + 10;
+ else if (val != 1 && val < 32) /* one digit followed by delimiter */
+ val += 240; /* make it look like two digits */
+ if (val > 255) { /* have two digits */
+ in[next++] = val & 0xff; /* save the decoded byte */
+ val = 1; /* start over */
+ }
+ } while (*hex++); /* go through the loop with the terminating null */
+ if (len != NULL)
+ *len = next;
+ in = reallocf(in, next);
+ return in;
+}
+
+/* generic inflate() run, where hex is the hexadecimal input data, what is the
+ text to include in an error message, step is how much input data to feed
+ inflate() on each call, or zero to feed it all, win is the window bits
+ parameter to inflateInit2(), len is the size of the output buffer, and err
+ is the error code expected from the first inflate() call (the second
+ inflate() call is expected to return Z_STREAM_END). If win is 47, then
+ header information is collected with inflateGetHeader(). If a zlib stream
+ is looking for a dictionary, then an empty dictionary is provided.
+ inflate() is run until all of the input data is consumed. */
+local void inf(char *hex, char *what, unsigned step, int win, unsigned len,
+ int err)
+{
+ int ret;
+ unsigned have;
+ unsigned char *in, *out;
+ z_stream strm, copy;
+ gz_header head;
+
+ mem_setup(&strm);
+ strm.avail_in = 0;
+ strm.next_in = Z_NULL;
+ ret = inflateInit2(&strm, win);
+ if (ret != Z_OK) {
+ mem_done(&strm, what);
+ return;
+ }
+ out = malloc(len); assert(out != NULL);
+ if (win == 47) {
+ head.extra = out;
+ head.extra_max = len;
+ head.name = out;
+ head.name_max = len;
+ head.comment = out;
+ head.comm_max = len;
+ ret = inflateGetHeader(&strm, &head); assert(ret == Z_OK);
+ }
+ in = h2b(hex, &have); assert(in != NULL);
+ if (step == 0 || step > have)
+ step = have;
+ strm.avail_in = step;
+ have -= step;
+ strm.next_in = in;
+ do {
+ strm.avail_out = len;
+ strm.next_out = out;
+ ret = inflate(&strm, Z_NO_FLUSH); assert(err == 9 || ret == err);
+ if (ret != Z_OK && ret != Z_BUF_ERROR && ret != Z_NEED_DICT)
+ break;
+ if (ret == Z_NEED_DICT) {
+ ret = inflateSetDictionary(&strm, in, 1);
+ assert(ret == Z_DATA_ERROR);
+ mem_limit(&strm, 1);
+ ret = inflateSetDictionary(&strm, out, 0);
+ assert(ret == Z_MEM_ERROR);
+ mem_limit(&strm, 0);
+ ((struct inflate_state *)strm.state)->mode = DICT;
+ ret = inflateSetDictionary(&strm, out, 0);
+ assert(ret == Z_OK);
+ ret = inflate(&strm, Z_NO_FLUSH); assert(ret == Z_BUF_ERROR);
+ }
+ ret = inflateCopy(&copy, &strm); assert(ret == Z_OK);
+ ret = inflateEnd(&copy); assert(ret == Z_OK);
+ err = 9; /* don't care next time around */
+ have += strm.avail_in;
+ strm.avail_in = step > have ? have : step;
+ have -= strm.avail_in;
+ } while (strm.avail_in);
+ free(in);
+ free(out);
+ ret = inflateReset2(&strm, -8); assert(ret == Z_OK);
+ ret = inflateEnd(&strm); assert(ret == Z_OK);
+ mem_done(&strm, what);
+}
+
+/* cover all of the lines in inflate.c up to inflate() */
+local void cover_support(void)
+{
+ int ret;
+ z_stream strm;
+
+ mem_setup(&strm);
+ strm.avail_in = 0;
+ strm.next_in = Z_NULL;
+ ret = inflateInit(&strm); assert(ret == Z_OK);
+ mem_used(&strm, "inflate init");
+ ret = inflatePrime(&strm, 5, 31); assert(ret == Z_OK);
+ ret = inflatePrime(&strm, -1, 0); assert(ret == Z_OK);
+ ret = inflateSetDictionary(&strm, Z_NULL, 0);
+ assert(ret == Z_STREAM_ERROR);
+ ret = inflateEnd(&strm); assert(ret == Z_OK);
+ mem_done(&strm, "prime");
+
+ inf("63 0", "force window allocation", 0, -15, 1, Z_OK);
+ inf("63 18 5", "force window replacement", 0, -8, 259, Z_OK);
+ inf("63 18 68 30 d0 0 0", "force split window update", 4, -8, 259, Z_OK);
+ inf("3 0", "use fixed blocks", 0, -15, 1, Z_STREAM_END);
+ inf("", "bad window size", 0, 1, 0, Z_STREAM_ERROR);
+
+ mem_setup(&strm);
+ strm.avail_in = 0;
+ strm.next_in = Z_NULL;
+ ret = inflateInit_(&strm, ZLIB_VERSION - 1, (int)sizeof(z_stream));
+ assert(ret == Z_VERSION_ERROR);
+ mem_done(&strm, "wrong version");
+
+ strm.avail_in = 0;
+ strm.next_in = Z_NULL;
+ ret = inflateInit(&strm); assert(ret == Z_OK);
+ ret = inflateEnd(&strm); assert(ret == Z_OK);
+ fputs("inflate built-in memory routines\n", stderr);
+}
+
+/* cover all inflate() header and trailer cases and code after inflate() */
+local void cover_wrap(void)
+{
+ int ret;
+ z_stream strm, copy;
+ unsigned char dict[257];
+
+ ret = inflate(Z_NULL, 0); assert(ret == Z_STREAM_ERROR);
+ ret = inflateEnd(Z_NULL); assert(ret == Z_STREAM_ERROR);
+ ret = inflateCopy(Z_NULL, Z_NULL); assert(ret == Z_STREAM_ERROR);
+ fputs("inflate bad parameters\n", stderr);
+
+ inf("1f 8b 0 0", "bad gzip method", 0, 31, 0, Z_DATA_ERROR);
+ inf("1f 8b 8 80", "bad gzip flags", 0, 31, 0, Z_DATA_ERROR);
+ inf("77 85", "bad zlib method", 0, 15, 0, Z_DATA_ERROR);
+ inf("8 99", "set window size from header", 0, 0, 0, Z_OK);
+ inf("78 9c", "bad zlib window size", 0, 8, 0, Z_DATA_ERROR);
+ inf("78 9c 63 0 0 0 1 0 1", "check adler32", 0, 15, 1, Z_STREAM_END);
+ inf("1f 8b 8 1e 0 0 0 0 0 0 1 0 0 0 0 0 0", "bad header crc", 0, 47, 1,
+ Z_DATA_ERROR);
+ inf("1f 8b 8 2 0 0 0 0 0 0 1d 26 3 0 0 0 0 0 0 0 0 0", "check gzip length",
+ 0, 47, 0, Z_STREAM_END);
+ inf("78 90", "bad zlib header check", 0, 47, 0, Z_DATA_ERROR);
+ inf("8 b8 0 0 0 1", "need dictionary", 0, 8, 0, Z_NEED_DICT);
+ inf("78 9c 63 0", "compute adler32", 0, 15, 1, Z_OK);
+
+ mem_setup(&strm);
+ strm.avail_in = 0;
+ strm.next_in = Z_NULL;
+ ret = inflateInit2(&strm, -8);
+ strm.avail_in = 2;
+ strm.next_in = (void *)"\x63";
+ strm.avail_out = 1;
+ strm.next_out = (void *)&ret;
+ mem_limit(&strm, 1);
+ ret = inflate(&strm, Z_NO_FLUSH); assert(ret == Z_MEM_ERROR);
+ ret = inflate(&strm, Z_NO_FLUSH); assert(ret == Z_MEM_ERROR);
+ mem_limit(&strm, 0);
+ memset(dict, 0, 257);
+ ret = inflateSetDictionary(&strm, dict, 257);
+ assert(ret == Z_OK);
+ mem_limit(&strm, (sizeof(struct inflate_state) << 1) + 256);
+ ret = inflatePrime(&strm, 16, 0); assert(ret == Z_OK);
+ strm.avail_in = 2;
+ strm.next_in = (void *)"\x80";
+ ret = inflateSync(&strm); assert(ret == Z_DATA_ERROR);
+ ret = inflate(&strm, Z_NO_FLUSH); assert(ret == Z_STREAM_ERROR);
+ strm.avail_in = 4;
+ strm.next_in = (void *)"\0\0\xff\xff";
+ ret = inflateSync(&strm); assert(ret == Z_OK);
+ (void)inflateSyncPoint(&strm);
+ ret = inflateCopy(&copy, &strm); assert(ret == Z_MEM_ERROR);
+ mem_limit(&strm, 0);
+ ret = inflateUndermine(&strm, 1); assert(ret == Z_DATA_ERROR);
+ (void)inflateMark(&strm);
+ ret = inflateEnd(&strm); assert(ret == Z_OK);
+ mem_done(&strm, "miscellaneous, force memory errors");
+}
+
+/* input and output functions for inflateBack() */
+local unsigned pull(void *desc, unsigned char **buf)
+{
+ static unsigned int next = 0;
+ static unsigned char dat[] = {0x63, 0, 2, 0};
+ struct inflate_state *state;
+
+ if (desc == Z_NULL) {
+ next = 0;
+ return 0; /* no input (already provided at next_in) */
+ }
+ state = (void *)((z_stream *)desc)->state;
+ if (state != Z_NULL)
+ state->mode = SYNC; /* force an otherwise impossible situation */
+ return next < sizeof(dat) ? (*buf = dat + next++, 1) : 0;
+}
+
+local int push(void *desc, unsigned char *buf, unsigned len)
+{
+ buf += len;
+ return desc != Z_NULL; /* force error if desc not null */
+}
+
+/* cover inflateBack() up to common deflate data cases and after those */
+local void cover_back(void)
+{
+ int ret;
+ z_stream strm;
+ unsigned char win[32768];
+
+ ret = inflateBackInit_(Z_NULL, 0, win, 0, 0);
+ assert(ret == Z_VERSION_ERROR);
+ ret = inflateBackInit(Z_NULL, 0, win); assert(ret == Z_STREAM_ERROR);
+ ret = inflateBack(Z_NULL, Z_NULL, Z_NULL, Z_NULL, Z_NULL);
+ assert(ret == Z_STREAM_ERROR);
+ ret = inflateBackEnd(Z_NULL); assert(ret == Z_STREAM_ERROR);
+ fputs("inflateBack bad parameters\n", stderr);
+
+ mem_setup(&strm);
+ ret = inflateBackInit(&strm, 15, win); assert(ret == Z_OK);
+ strm.avail_in = 2;
+ strm.next_in = (void *)"\x03";
+ ret = inflateBack(&strm, pull, Z_NULL, push, Z_NULL);
+ assert(ret == Z_STREAM_END);
+ /* force output error */
+ strm.avail_in = 3;
+ strm.next_in = (void *)"\x63\x00";
+ ret = inflateBack(&strm, pull, Z_NULL, push, &strm);
+ assert(ret == Z_BUF_ERROR);
+ /* force mode error by mucking with state */
+ ret = inflateBack(&strm, pull, &strm, push, Z_NULL);
+ assert(ret == Z_STREAM_ERROR);
+ ret = inflateBackEnd(&strm); assert(ret == Z_OK);
+ mem_done(&strm, "inflateBack bad state");
+
+ ret = inflateBackInit(&strm, 15, win); assert(ret == Z_OK);
+ ret = inflateBackEnd(&strm); assert(ret == Z_OK);
+ fputs("inflateBack built-in memory routines\n", stderr);
+}
+
+/* do a raw inflate of data in hexadecimal with both inflate and inflateBack */
+local int try(char *hex, char *id, int err)
+{
+ int ret;
+ unsigned len, size;
+ unsigned char *in, *out, *win;
+ char *prefix;
+ z_stream strm;
+
+ /* convert to hex */
+ in = h2b(hex, &len);
+ assert(in != NULL);
+
+ /* allocate work areas */
+ size = len << 3;
+ out = malloc(size);
+ assert(out != NULL);
+ win = malloc(32768);
+ assert(win != NULL);
+ prefix = malloc(strlen(id) + 6);
+ assert(prefix != NULL);
+
+ /* first with inflate */
+ strcpy(prefix, id);
+ strcat(prefix, "-late");
+ mem_setup(&strm);
+ strm.avail_in = 0;
+ strm.next_in = Z_NULL;
+ ret = inflateInit2(&strm, err < 0 ? 47 : -15);
+ assert(ret == Z_OK);
+ strm.avail_in = len;
+ strm.next_in = in;
+ do {
+ strm.avail_out = size;
+ strm.next_out = out;
+ ret = inflate(&strm, Z_TREES);
+ assert(ret != Z_STREAM_ERROR && ret != Z_MEM_ERROR);
+ if (ret == Z_DATA_ERROR || ret == Z_NEED_DICT)
+ break;
+ } while (strm.avail_in || strm.avail_out == 0);
+ if (err) {
+ assert(ret == Z_DATA_ERROR);
+ assert(strcmp(id, strm.msg) == 0);
+ }
+ inflateEnd(&strm);
+ mem_done(&strm, prefix);
+
+ /* then with inflateBack */
+ if (err >= 0) {
+ strcpy(prefix, id);
+ strcat(prefix, "-back");
+ mem_setup(&strm);
+ ret = inflateBackInit(&strm, 15, win);
+ assert(ret == Z_OK);
+ strm.avail_in = len;
+ strm.next_in = in;
+ ret = inflateBack(&strm, pull, Z_NULL, push, Z_NULL);
+ assert(ret != Z_STREAM_ERROR);
+ if (err) {
+ assert(ret == Z_DATA_ERROR);
+ assert(strcmp(id, strm.msg) == 0);
+ }
+ inflateBackEnd(&strm);
+ mem_done(&strm, prefix);
+ }
+
+ /* clean up */
+ free(prefix);
+ free(win);
+ free(out);
+ free(in);
+ return ret;
+}
+
+/* cover deflate data cases in both inflate() and inflateBack() */
+local void cover_inflate(void)
+{
+ try("0 0 0 0 0", "invalid stored block lengths", 1);
+ try("3 0", "fixed", 0);
+ try("6", "invalid block type", 1);
+ try("1 1 0 fe ff 0", "stored", 0);
+ try("fc 0 0", "too many length or distance symbols", 1);
+ try("4 0 fe ff", "invalid code lengths set", 1);
+ try("4 0 24 49 0", "invalid bit length repeat", 1);
+ try("4 0 24 e9 ff ff", "invalid bit length repeat", 1);
+ try("4 0 24 e9 ff 6d", "invalid code -- missing end-of-block", 1);
+ try("4 80 49 92 24 49 92 24 71 ff ff 93 11 0",
+ "invalid literal/lengths set", 1);
+ try("4 80 49 92 24 49 92 24 f b4 ff ff c3 84", "invalid distances set", 1);
+ try("4 c0 81 8 0 0 0 0 20 7f eb b 0 0", "invalid literal/length code", 1);
+ try("2 7e ff ff", "invalid distance code", 1);
+ try("c c0 81 0 0 0 0 0 90 ff 6b 4 0", "invalid distance too far back", 1);
+
+ /* also trailer mismatch just in inflate() */
+ try("1f 8b 8 0 0 0 0 0 0 0 3 0 0 0 0 1", "incorrect data check", -1);
+ try("1f 8b 8 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 1",
+ "incorrect length check", -1);
+ try("5 c0 21 d 0 0 0 80 b0 fe 6d 2f 91 6c", "pull 17", 0);
+ try("5 e0 81 91 24 cb b2 2c 49 e2 f 2e 8b 9a 47 56 9f fb fe ec d2 ff 1f",
+ "long code", 0);
+ try("ed c0 1 1 0 0 0 40 20 ff 57 1b 42 2c 4f", "length extra", 0);
+ try("ed cf c1 b1 2c 47 10 c4 30 fa 6f 35 1d 1 82 59 3d fb be 2e 2a fc f c",
+ "long distance and extra", 0);
+ try("ed c0 81 0 0 0 0 80 a0 fd a9 17 a9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "
+ "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6", "window end", 0);
+ inf("2 8 20 80 0 3 0", "inflate_fast TYPE return", 0, -15, 258,
+ Z_STREAM_END);
+ inf("63 18 5 40 c 0", "window wrap", 3, -8, 300, Z_OK);
+}
+
+/* cover remaining lines in inftrees.c */
+local void cover_trees(void)
+{
+ int ret;
+ unsigned bits;
+ unsigned short lens[16], work[16];
+ code *next, table[ENOUGH_DISTS];
+
+ /* we need to call inflate_table() directly in order to manifest not-
+ enough errors, since zlib insures that enough is always enough */
+ for (bits = 0; bits < 15; bits++)
+ lens[bits] = (unsigned short)(bits + 1);
+ lens[15] = 15;
+ next = table;
+ bits = 15;
+ ret = inflate_table(DISTS, lens, 16, &next, &bits, work);
+ assert(ret == 1);
+ next = table;
+ bits = 1;
+ ret = inflate_table(DISTS, lens, 16, &next, &bits, work);
+ assert(ret == 1);
+ fputs("inflate_table not enough errors\n", stderr);
+}
+
+/* cover remaining inffast.c decoding and window copying */
+local void cover_fast(void)
+{
+ inf("e5 e0 81 ad 6d cb b2 2c c9 01 1e 59 63 ae 7d ee fb 4d fd b5 35 41 68"
+ " ff 7f 0f 0 0 0", "fast length extra bits", 0, -8, 258, Z_DATA_ERROR);
+ inf("25 fd 81 b5 6d 59 b6 6a 49 ea af 35 6 34 eb 8c b9 f6 b9 1e ef 67 49"
+ " 50 fe ff ff 3f 0 0", "fast distance extra bits", 0, -8, 258,
+ Z_DATA_ERROR);
+ inf("3 7e 0 0 0 0 0", "fast invalid distance code", 0, -8, 258,
+ Z_DATA_ERROR);
+ inf("1b 7 0 0 0 0 0", "fast invalid literal/length code", 0, -8, 258,
+ Z_DATA_ERROR);
+ inf("d c7 1 ae eb 38 c 4 41 a0 87 72 de df fb 1f b8 36 b1 38 5d ff ff 0",
+ "fast 2nd level codes and too far back", 0, -8, 258, Z_DATA_ERROR);
+ inf("63 18 5 8c 10 8 0 0 0 0", "very common case", 0, -8, 259, Z_OK);
+ inf("63 60 60 18 c9 0 8 18 18 18 26 c0 28 0 29 0 0 0",
+ "contiguous and wrap around window", 6, -8, 259, Z_OK);
+ inf("63 0 3 0 0 0 0 0", "copy direct from output", 0, -8, 259,
+ Z_STREAM_END);
+}
+
+int main(void)
+{
+ fprintf(stderr, "%s\n", zlibVersion());
+ cover_support();
+ cover_wrap();
+ cover_back();
+ cover_inflate();
+ cover_trees();
+ cover_fast();
+ return 0;
+}
diff --git a/protocols/Telegram/tgl/zlib/test/minigzip.c b/protocols/Telegram/tgl/zlib/test/minigzip.c
new file mode 100644
index 0000000000..b3025a489a
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/test/minigzip.c
@@ -0,0 +1,651 @@
+/* minigzip.c -- simulate gzip using the zlib compression library
+ * Copyright (C) 1995-2006, 2010, 2011 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/*
+ * minigzip is a minimal implementation of the gzip utility. This is
+ * only an example of using zlib and isn't meant to replace the
+ * full-featured gzip. No attempt is made to deal with file systems
+ * limiting names to 14 or 8+3 characters, etc... Error checking is
+ * very limited. So use minigzip only for testing; use gzip for the
+ * real thing. On MSDOS, use only on file names without extension
+ * or in pipe mode.
+ */
+
+/* @(#) $Id$ */
+
+#include "zlib.h"
+#include <stdio.h>
+
+#ifdef STDC
+# include <string.h>
+# include <stdlib.h>
+#endif
+
+#ifdef USE_MMAP
+# include <sys/types.h>
+# include <sys/mman.h>
+# include <sys/stat.h>
+#endif
+
+#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__)
+# include <fcntl.h>
+# include <io.h>
+# ifdef UNDER_CE
+# include <stdlib.h>
+# endif
+# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
+#else
+# define SET_BINARY_MODE(file)
+#endif
+
+#ifdef _MSC_VER
+# define snprintf _snprintf
+#endif
+
+#ifdef VMS
+# define unlink delete
+# define GZ_SUFFIX "-gz"
+#endif
+#ifdef RISCOS
+# define unlink remove
+# define GZ_SUFFIX "-gz"
+# define fileno(file) file->__file
+#endif
+#if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
+# include <unix.h> /* for fileno */
+#endif
+
+#if !defined(Z_HAVE_UNISTD_H) && !defined(_LARGEFILE64_SOURCE)
+#ifndef WIN32 /* unlink already in stdio.h for WIN32 */
+ extern int unlink OF((const char *));
+#endif
+#endif
+
+#if defined(UNDER_CE)
+# include <windows.h>
+# define perror(s) pwinerror(s)
+
+/* Map the Windows error number in ERROR to a locale-dependent error
+ message string and return a pointer to it. Typically, the values
+ for ERROR come from GetLastError.
+
+ The string pointed to shall not be modified by the application,
+ but may be overwritten by a subsequent call to strwinerror
+
+ The strwinerror function does not change the current setting
+ of GetLastError. */
+
+static char *strwinerror (error)
+ DWORD error;
+{
+ static char buf[1024];
+
+ wchar_t *msgbuf;
+ DWORD lasterr = GetLastError();
+ DWORD chars = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM
+ | FORMAT_MESSAGE_ALLOCATE_BUFFER,
+ NULL,
+ error,
+ 0, /* Default language */
+ (LPVOID)&msgbuf,
+ 0,
+ NULL);
+ if (chars != 0) {
+ /* If there is an \r\n appended, zap it. */
+ if (chars >= 2
+ && msgbuf[chars - 2] == '\r' && msgbuf[chars - 1] == '\n') {
+ chars -= 2;
+ msgbuf[chars] = 0;
+ }
+
+ if (chars > sizeof (buf) - 1) {
+ chars = sizeof (buf) - 1;
+ msgbuf[chars] = 0;
+ }
+
+ wcstombs(buf, msgbuf, chars + 1);
+ LocalFree(msgbuf);
+ }
+ else {
+ sprintf(buf, "unknown win32 error (%ld)", error);
+ }
+
+ SetLastError(lasterr);
+ return buf;
+}
+
+static void pwinerror (s)
+ const char *s;
+{
+ if (s && *s)
+ fprintf(stderr, "%s: %s\n", s, strwinerror(GetLastError ()));
+ else
+ fprintf(stderr, "%s\n", strwinerror(GetLastError ()));
+}
+
+#endif /* UNDER_CE */
+
+#ifndef GZ_SUFFIX
+# define GZ_SUFFIX ".gz"
+#endif
+#define SUFFIX_LEN (sizeof(GZ_SUFFIX)-1)
+
+#define BUFLEN 16384
+#define MAX_NAME_LEN 1024
+
+#ifdef MAXSEG_64K
+# define local static
+ /* Needed for systems with limitation on stack size. */
+#else
+# define local
+#endif
+
+#ifdef Z_SOLO
+/* for Z_SOLO, create simplified gz* functions using deflate and inflate */
+
+#if defined(Z_HAVE_UNISTD_H) || defined(Z_LARGE)
+# include <unistd.h> /* for unlink() */
+#endif
+
+void *myalloc OF((void *, unsigned, unsigned));
+void myfree OF((void *, void *));
+
+void *myalloc(q, n, m)
+ void *q;
+ unsigned n, m;
+{
+ q = Z_NULL;
+ return calloc(n, m);
+}
+
+void myfree(q, p)
+ void *q, *p;
+{
+ q = Z_NULL;
+ free(p);
+}
+
+typedef struct gzFile_s {
+ FILE *file;
+ int write;
+ int err;
+ char *msg;
+ z_stream strm;
+} *gzFile;
+
+gzFile gzopen OF((const char *, const char *));
+gzFile gzdopen OF((int, const char *));
+gzFile gz_open OF((const char *, int, const char *));
+
+gzFile gzopen(path, mode)
+const char *path;
+const char *mode;
+{
+ return gz_open(path, -1, mode);
+}
+
+gzFile gzdopen(fd, mode)
+int fd;
+const char *mode;
+{
+ return gz_open(NULL, fd, mode);
+}
+
+gzFile gz_open(path, fd, mode)
+ const char *path;
+ int fd;
+ const char *mode;
+{
+ gzFile gz;
+ int ret;
+
+ gz = malloc(sizeof(struct gzFile_s));
+ if (gz == NULL)
+ return NULL;
+ gz->write = strchr(mode, 'w') != NULL;
+ gz->strm.zalloc = myalloc;
+ gz->strm.zfree = myfree;
+ gz->strm.opaque = Z_NULL;
+ if (gz->write)
+ ret = deflateInit2(&(gz->strm), -1, 8, 15 + 16, 8, 0);
+ else {
+ gz->strm.next_in = 0;
+ gz->strm.avail_in = Z_NULL;
+ ret = inflateInit2(&(gz->strm), 15 + 16);
+ }
+ if (ret != Z_OK) {
+ free(gz);
+ return NULL;
+ }
+ gz->file = path == NULL ? fdopen(fd, gz->write ? "wb" : "rb") :
+ fopen(path, gz->write ? "wb" : "rb");
+ if (gz->file == NULL) {
+ gz->write ? deflateEnd(&(gz->strm)) : inflateEnd(&(gz->strm));
+ free(gz);
+ return NULL;
+ }
+ gz->err = 0;
+ gz->msg = "";
+ return gz;
+}
+
+int gzwrite OF((gzFile, const void *, unsigned));
+
+int gzwrite(gz, buf, len)
+ gzFile gz;
+ const void *buf;
+ unsigned len;
+{
+ z_stream *strm;
+ unsigned char out[BUFLEN];
+
+ if (gz == NULL || !gz->write)
+ return 0;
+ strm = &(gz->strm);
+ strm->next_in = (void *)buf;
+ strm->avail_in = len;
+ do {
+ strm->next_out = out;
+ strm->avail_out = BUFLEN;
+ (void)deflate(strm, Z_NO_FLUSH);
+ fwrite(out, 1, BUFLEN - strm->avail_out, gz->file);
+ } while (strm->avail_out == 0);
+ return len;
+}
+
+int gzread OF((gzFile, void *, unsigned));
+
+int gzread(gz, buf, len)
+ gzFile gz;
+ void *buf;
+ unsigned len;
+{
+ int ret;
+ unsigned got;
+ unsigned char in[1];
+ z_stream *strm;
+
+ if (gz == NULL || gz->write)
+ return 0;
+ if (gz->err)
+ return 0;
+ strm = &(gz->strm);
+ strm->next_out = (void *)buf;
+ strm->avail_out = len;
+ do {
+ got = fread(in, 1, 1, gz->file);
+ if (got == 0)
+ break;
+ strm->next_in = in;
+ strm->avail_in = 1;
+ ret = inflate(strm, Z_NO_FLUSH);
+ if (ret == Z_DATA_ERROR) {
+ gz->err = Z_DATA_ERROR;
+ gz->msg = strm->msg;
+ return 0;
+ }
+ if (ret == Z_STREAM_END)
+ inflateReset(strm);
+ } while (strm->avail_out);
+ return len - strm->avail_out;
+}
+
+int gzclose OF((gzFile));
+
+int gzclose(gz)
+ gzFile gz;
+{
+ z_stream *strm;
+ unsigned char out[BUFLEN];
+
+ if (gz == NULL)
+ return Z_STREAM_ERROR;
+ strm = &(gz->strm);
+ if (gz->write) {
+ strm->next_in = Z_NULL;
+ strm->avail_in = 0;
+ do {
+ strm->next_out = out;
+ strm->avail_out = BUFLEN;
+ (void)deflate(strm, Z_FINISH);
+ fwrite(out, 1, BUFLEN - strm->avail_out, gz->file);
+ } while (strm->avail_out == 0);
+ deflateEnd(strm);
+ }
+ else
+ inflateEnd(strm);
+ fclose(gz->file);
+ free(gz);
+ return Z_OK;
+}
+
+const char *gzerror OF((gzFile, int *));
+
+const char *gzerror(gz, err)
+ gzFile gz;
+ int *err;
+{
+ *err = gz->err;
+ return gz->msg;
+}
+
+#endif
+
+char *prog;
+
+void error OF((const char *msg));
+void gz_compress OF((FILE *in, gzFile out));
+#ifdef USE_MMAP
+int gz_compress_mmap OF((FILE *in, gzFile out));
+#endif
+void gz_uncompress OF((gzFile in, FILE *out));
+void file_compress OF((char *file, char *mode));
+void file_uncompress OF((char *file));
+int main OF((int argc, char *argv[]));
+
+/* ===========================================================================
+ * Display error message and exit
+ */
+void error(msg)
+ const char *msg;
+{
+ fprintf(stderr, "%s: %s\n", prog, msg);
+ exit(1);
+}
+
+/* ===========================================================================
+ * Compress input to output then close both files.
+ */
+
+void gz_compress(in, out)
+ FILE *in;
+ gzFile out;
+{
+ local char buf[BUFLEN];
+ int len;
+ int err;
+
+#ifdef USE_MMAP
+ /* Try first compressing with mmap. If mmap fails (minigzip used in a
+ * pipe), use the normal fread loop.
+ */
+ if (gz_compress_mmap(in, out) == Z_OK) return;
+#endif
+ for (;;) {
+ len = (int)fread(buf, 1, sizeof(buf), in);
+ if (ferror(in)) {
+ perror("fread");
+ exit(1);
+ }
+ if (len == 0) break;
+
+ if (gzwrite(out, buf, (unsigned)len) != len) error(gzerror(out, &err));
+ }
+ fclose(in);
+ if (gzclose(out) != Z_OK) error("failed gzclose");
+}
+
+#ifdef USE_MMAP /* MMAP version, Miguel Albrecht <malbrech@eso.org> */
+
+/* Try compressing the input file at once using mmap. Return Z_OK if
+ * if success, Z_ERRNO otherwise.
+ */
+int gz_compress_mmap(in, out)
+ FILE *in;
+ gzFile out;
+{
+ int len;
+ int err;
+ int ifd = fileno(in);
+ caddr_t buf; /* mmap'ed buffer for the entire input file */
+ off_t buf_len; /* length of the input file */
+ struct stat sb;
+
+ /* Determine the size of the file, needed for mmap: */
+ if (fstat(ifd, &sb) < 0) return Z_ERRNO;
+ buf_len = sb.st_size;
+ if (buf_len <= 0) return Z_ERRNO;
+
+ /* Now do the actual mmap: */
+ buf = mmap((caddr_t) 0, buf_len, PROT_READ, MAP_SHARED, ifd, (off_t)0);
+ if (buf == (caddr_t)(-1)) return Z_ERRNO;
+
+ /* Compress the whole file at once: */
+ len = gzwrite(out, (char *)buf, (unsigned)buf_len);
+
+ if (len != (int)buf_len) error(gzerror(out, &err));
+
+ munmap(buf, buf_len);
+ fclose(in);
+ if (gzclose(out) != Z_OK) error("failed gzclose");
+ return Z_OK;
+}
+#endif /* USE_MMAP */
+
+/* ===========================================================================
+ * Uncompress input to output then close both files.
+ */
+void gz_uncompress(in, out)
+ gzFile in;
+ FILE *out;
+{
+ local char buf[BUFLEN];
+ int len;
+ int err;
+
+ for (;;) {
+ len = gzread(in, buf, sizeof(buf));
+ if (len < 0) error (gzerror(in, &err));
+ if (len == 0) break;
+
+ if ((int)fwrite(buf, 1, (unsigned)len, out) != len) {
+ error("failed fwrite");
+ }
+ }
+ if (fclose(out)) error("failed fclose");
+
+ if (gzclose(in) != Z_OK) error("failed gzclose");
+}
+
+
+/* ===========================================================================
+ * Compress the given file: create a corresponding .gz file and remove the
+ * original.
+ */
+void file_compress(file, mode)
+ char *file;
+ char *mode;
+{
+ local char outfile[MAX_NAME_LEN];
+ FILE *in;
+ gzFile out;
+
+ if (strlen(file) + strlen(GZ_SUFFIX) >= sizeof(outfile)) {
+ fprintf(stderr, "%s: filename too long\n", prog);
+ exit(1);
+ }
+
+#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
+ snprintf(outfile, sizeof(outfile), "%s%s", file, GZ_SUFFIX);
+#else
+ strcpy(outfile, file);
+ strcat(outfile, GZ_SUFFIX);
+#endif
+
+ in = fopen(file, "rb");
+ if (in == NULL) {
+ perror(file);
+ exit(1);
+ }
+ out = gzopen(outfile, mode);
+ if (out == NULL) {
+ fprintf(stderr, "%s: can't gzopen %s\n", prog, outfile);
+ exit(1);
+ }
+ gz_compress(in, out);
+
+ unlink(file);
+}
+
+
+/* ===========================================================================
+ * Uncompress the given file and remove the original.
+ */
+void file_uncompress(file)
+ char *file;
+{
+ local char buf[MAX_NAME_LEN];
+ char *infile, *outfile;
+ FILE *out;
+ gzFile in;
+ size_t len = strlen(file);
+
+ if (len + strlen(GZ_SUFFIX) >= sizeof(buf)) {
+ fprintf(stderr, "%s: filename too long\n", prog);
+ exit(1);
+ }
+
+#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
+ snprintf(buf, sizeof(buf), "%s", file);
+#else
+ strcpy(buf, file);
+#endif
+
+ if (len > SUFFIX_LEN && strcmp(file+len-SUFFIX_LEN, GZ_SUFFIX) == 0) {
+ infile = file;
+ outfile = buf;
+ outfile[len-3] = '\0';
+ } else {
+ outfile = file;
+ infile = buf;
+#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
+ snprintf(buf + len, sizeof(buf) - len, "%s", GZ_SUFFIX);
+#else
+ strcat(infile, GZ_SUFFIX);
+#endif
+ }
+ in = gzopen(infile, "rb");
+ if (in == NULL) {
+ fprintf(stderr, "%s: can't gzopen %s\n", prog, infile);
+ exit(1);
+ }
+ out = fopen(outfile, "wb");
+ if (out == NULL) {
+ perror(file);
+ exit(1);
+ }
+
+ gz_uncompress(in, out);
+
+ unlink(infile);
+}
+
+
+/* ===========================================================================
+ * Usage: minigzip [-c] [-d] [-f] [-h] [-r] [-1 to -9] [files...]
+ * -c : write to standard output
+ * -d : decompress
+ * -f : compress with Z_FILTERED
+ * -h : compress with Z_HUFFMAN_ONLY
+ * -r : compress with Z_RLE
+ * -1 to -9 : compression level
+ */
+
+int main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ int copyout = 0;
+ int uncompr = 0;
+ gzFile file;
+ char *bname, outmode[20];
+
+#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
+ snprintf(outmode, sizeof(outmode), "%s", "wb6 ");
+#else
+ strcpy(outmode, "wb6 ");
+#endif
+
+ prog = argv[0];
+ bname = strrchr(argv[0], '/');
+ if (bname)
+ bname++;
+ else
+ bname = argv[0];
+ argc--, argv++;
+
+ if (!strcmp(bname, "gunzip"))
+ uncompr = 1;
+ else if (!strcmp(bname, "zcat"))
+ copyout = uncompr = 1;
+
+ while (argc > 0) {
+ if (strcmp(*argv, "-c") == 0)
+ copyout = 1;
+ else if (strcmp(*argv, "-d") == 0)
+ uncompr = 1;
+ else if (strcmp(*argv, "-f") == 0)
+ outmode[3] = 'f';
+ else if (strcmp(*argv, "-h") == 0)
+ outmode[3] = 'h';
+ else if (strcmp(*argv, "-r") == 0)
+ outmode[3] = 'R';
+ else if ((*argv)[0] == '-' && (*argv)[1] >= '1' && (*argv)[1] <= '9' &&
+ (*argv)[2] == 0)
+ outmode[2] = (*argv)[1];
+ else
+ break;
+ argc--, argv++;
+ }
+ if (outmode[3] == ' ')
+ outmode[3] = 0;
+ if (argc == 0) {
+ SET_BINARY_MODE(stdin);
+ SET_BINARY_MODE(stdout);
+ if (uncompr) {
+ file = gzdopen(fileno(stdin), "rb");
+ if (file == NULL) error("can't gzdopen stdin");
+ gz_uncompress(file, stdout);
+ } else {
+ file = gzdopen(fileno(stdout), outmode);
+ if (file == NULL) error("can't gzdopen stdout");
+ gz_compress(stdin, file);
+ }
+ } else {
+ if (copyout) {
+ SET_BINARY_MODE(stdout);
+ }
+ do {
+ if (uncompr) {
+ if (copyout) {
+ file = gzopen(*argv, "rb");
+ if (file == NULL)
+ fprintf(stderr, "%s: can't gzopen %s\n", prog, *argv);
+ else
+ gz_uncompress(file, stdout);
+ } else {
+ file_uncompress(*argv);
+ }
+ } else {
+ if (copyout) {
+ FILE * in = fopen(*argv, "rb");
+
+ if (in == NULL) {
+ perror(*argv);
+ } else {
+ file = gzdopen(fileno(stdout), outmode);
+ if (file == NULL) error("can't gzdopen stdout");
+
+ gz_compress(in, file);
+ }
+
+ } else {
+ file_compress(*argv, outmode);
+ }
+ }
+ } while (argv++, --argc);
+ }
+ return 0;
+}
diff --git a/protocols/Telegram/tgl/zlib/treebuild.xml b/protocols/Telegram/tgl/zlib/treebuild.xml
new file mode 100644
index 0000000000..38d29d75ef
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/treebuild.xml
@@ -0,0 +1,116 @@
+<?xml version="1.0" ?>
+<package name="zlib" version="1.2.8">
+ <library name="zlib" dlversion="1.2.8" dlname="z">
+ <property name="description"> zip compression library </property>
+ <property name="include-target-dir" value="$(@PACKAGE/install-includedir)" />
+
+ <!-- fixme: not implemented yet -->
+ <property name="compiler/c/inline" value="yes" />
+
+ <include-file name="zlib.h" scope="public" mode="644" />
+ <include-file name="zconf.h" scope="public" mode="644" />
+
+ <source name="adler32.c">
+ <depend name="zlib.h" />
+ <depend name="zconf.h" />
+ </source>
+ <source name="compress.c">
+ <depend name="zlib.h" />
+ <depend name="zconf.h" />
+ </source>
+ <source name="crc32.c">
+ <depend name="zlib.h" />
+ <depend name="zconf.h" />
+ <depend name="crc32.h" />
+ </source>
+ <source name="gzclose.c">
+ <depend name="zlib.h" />
+ <depend name="zconf.h" />
+ <depend name="gzguts.h" />
+ </source>
+ <source name="gzlib.c">
+ <depend name="zlib.h" />
+ <depend name="zconf.h" />
+ <depend name="gzguts.h" />
+ </source>
+ <source name="gzread.c">
+ <depend name="zlib.h" />
+ <depend name="zconf.h" />
+ <depend name="gzguts.h" />
+ </source>
+ <source name="gzwrite.c">
+ <depend name="zlib.h" />
+ <depend name="zconf.h" />
+ <depend name="gzguts.h" />
+ </source>
+ <source name="uncompr.c">
+ <depend name="zlib.h" />
+ <depend name="zconf.h" />
+ </source>
+ <source name="deflate.c">
+ <depend name="zlib.h" />
+ <depend name="zconf.h" />
+ <depend name="zutil.h" />
+ <depend name="deflate.h" />
+ </source>
+ <source name="trees.c">
+ <depend name="zlib.h" />
+ <depend name="zconf.h" />
+ <depend name="zutil.h" />
+ <depend name="deflate.h" />
+ <depend name="trees.h" />
+ </source>
+ <source name="zutil.c">
+ <depend name="zlib.h" />
+ <depend name="zconf.h" />
+ <depend name="zutil.h" />
+ </source>
+ <source name="inflate.c">
+ <depend name="zlib.h" />
+ <depend name="zconf.h" />
+ <depend name="zutil.h" />
+ <depend name="inftrees.h" />
+ <depend name="inflate.h" />
+ <depend name="inffast.h" />
+ </source>
+ <source name="infback.c">
+ <depend name="zlib.h" />
+ <depend name="zconf.h" />
+ <depend name="zutil.h" />
+ <depend name="inftrees.h" />
+ <depend name="inflate.h" />
+ <depend name="inffast.h" />
+ </source>
+ <source name="inftrees.c">
+ <depend name="zlib.h" />
+ <depend name="zconf.h" />
+ <depend name="zutil.h" />
+ <depend name="inftrees.h" />
+ </source>
+ <source name="inffast.c">
+ <depend name="zlib.h" />
+ <depend name="zconf.h" />
+ <depend name="zutil.h" />
+ <depend name="inftrees.h" />
+ <depend name="inflate.h" />
+ <depend name="inffast.h" />
+ </source>
+ </library>
+</package>
+
+<!--
+CFLAGS=-O
+#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
+#CFLAGS=-g -DDEBUG
+#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
+# -Wstrict-prototypes -Wmissing-prototypes
+
+# OBJA =
+# to use the asm code: make OBJA=match.o
+#
+match.o: match.S
+ $(CPP) match.S > _match.s
+ $(CC) -c _match.s
+ mv _match.o match.o
+ rm -f _match.s
+-->
diff --git a/protocols/Telegram/tgl/zlib/trees.c b/protocols/Telegram/tgl/zlib/trees.c
new file mode 100644
index 0000000000..1fd7759ef0
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/trees.c
@@ -0,0 +1,1226 @@
+/* trees.c -- output deflated data using Huffman coding
+ * Copyright (C) 1995-2012 Jean-loup Gailly
+ * detect_data_type() function provided freely by Cosmin Truta, 2006
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/*
+ * ALGORITHM
+ *
+ * The "deflation" process uses several Huffman trees. The more
+ * common source values are represented by shorter bit sequences.
+ *
+ * Each code tree is stored in a compressed form which is itself
+ * a Huffman encoding of the lengths of all the code strings (in
+ * ascending order by source values). The actual code strings are
+ * reconstructed from the lengths in the inflate process, as described
+ * in the deflate specification.
+ *
+ * REFERENCES
+ *
+ * Deutsch, L.P.,"'Deflate' Compressed Data Format Specification".
+ * Available in ftp.uu.net:/pub/archiving/zip/doc/deflate-1.1.doc
+ *
+ * Storer, James A.
+ * Data Compression: Methods and Theory, pp. 49-50.
+ * Computer Science Press, 1988. ISBN 0-7167-8156-5.
+ *
+ * Sedgewick, R.
+ * Algorithms, p290.
+ * Addison-Wesley, 1983. ISBN 0-201-06672-6.
+ */
+
+/* @(#) $Id$ */
+
+/* #define GEN_TREES_H */
+
+#include "deflate.h"
+
+#ifdef DEBUG
+# include <ctype.h>
+#endif
+
+/* ===========================================================================
+ * Constants
+ */
+
+#define MAX_BL_BITS 7
+/* Bit length codes must not exceed MAX_BL_BITS bits */
+
+#define END_BLOCK 256
+/* end of block literal code */
+
+#define REP_3_6 16
+/* repeat previous bit length 3-6 times (2 bits of repeat count) */
+
+#define REPZ_3_10 17
+/* repeat a zero length 3-10 times (3 bits of repeat count) */
+
+#define REPZ_11_138 18
+/* repeat a zero length 11-138 times (7 bits of repeat count) */
+
+local const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */
+ = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0};
+
+local const int extra_dbits[D_CODES] /* extra bits for each distance code */
+ = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};
+
+local const int extra_blbits[BL_CODES]/* extra bits for each bit length code */
+ = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7};
+
+local const uch bl_order[BL_CODES]
+ = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15};
+/* The lengths of the bit length codes are sent in order of decreasing
+ * probability, to avoid transmitting the lengths for unused bit length codes.
+ */
+
+/* ===========================================================================
+ * Local data. These are initialized only once.
+ */
+
+#define DIST_CODE_LEN 512 /* see definition of array dist_code below */
+
+#if defined(GEN_TREES_H) || !defined(STDC)
+/* non ANSI compilers may not accept trees.h */
+
+local ct_data static_ltree[L_CODES+2];
+/* The static literal tree. Since the bit lengths are imposed, there is no
+ * need for the L_CODES extra codes used during heap construction. However
+ * The codes 286 and 287 are needed to build a canonical tree (see _tr_init
+ * below).
+ */
+
+local ct_data static_dtree[D_CODES];
+/* The static distance tree. (Actually a trivial tree since all codes use
+ * 5 bits.)
+ */
+
+uch _dist_code[DIST_CODE_LEN];
+/* Distance codes. The first 256 values correspond to the distances
+ * 3 .. 258, the last 256 values correspond to the top 8 bits of
+ * the 15 bit distances.
+ */
+
+uch _length_code[MAX_MATCH-MIN_MATCH+1];
+/* length code for each normalized match length (0 == MIN_MATCH) */
+
+local int base_length[LENGTH_CODES];
+/* First normalized length for each code (0 = MIN_MATCH) */
+
+local int base_dist[D_CODES];
+/* First normalized distance for each code (0 = distance of 1) */
+
+#else
+# include "trees.h"
+#endif /* GEN_TREES_H */
+
+struct static_tree_desc_s {
+ const ct_data *static_tree; /* static tree or NULL */
+ const intf *extra_bits; /* extra bits for each code or NULL */
+ int extra_base; /* base index for extra_bits */
+ int elems; /* max number of elements in the tree */
+ int max_length; /* max bit length for the codes */
+};
+
+local static_tree_desc static_l_desc =
+{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS};
+
+local static_tree_desc static_d_desc =
+{static_dtree, extra_dbits, 0, D_CODES, MAX_BITS};
+
+local static_tree_desc static_bl_desc =
+{(const ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS};
+
+/* ===========================================================================
+ * Local (static) routines in this file.
+ */
+
+local void tr_static_init OF((void));
+local void init_block OF((deflate_state *s));
+local void pqdownheap OF((deflate_state *s, ct_data *tree, int k));
+local void gen_bitlen OF((deflate_state *s, tree_desc *desc));
+local void gen_codes OF((ct_data *tree, int max_code, ushf *bl_count));
+local void build_tree OF((deflate_state *s, tree_desc *desc));
+local void scan_tree OF((deflate_state *s, ct_data *tree, int max_code));
+local void send_tree OF((deflate_state *s, ct_data *tree, int max_code));
+local int build_bl_tree OF((deflate_state *s));
+local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes,
+ int blcodes));
+local void compress_block OF((deflate_state *s, const ct_data *ltree,
+ const ct_data *dtree));
+local int detect_data_type OF((deflate_state *s));
+local unsigned bi_reverse OF((unsigned value, int length));
+local void bi_windup OF((deflate_state *s));
+local void bi_flush OF((deflate_state *s));
+local void copy_block OF((deflate_state *s, charf *buf, unsigned len,
+ int header));
+
+#ifdef GEN_TREES_H
+local void gen_trees_header OF((void));
+#endif
+
+#ifndef DEBUG
+# define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
+ /* Send a code of the given tree. c and tree must not have side effects */
+
+#else /* DEBUG */
+# define send_code(s, c, tree) \
+ { if (z_verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \
+ send_bits(s, tree[c].Code, tree[c].Len); }
+#endif
+
+/* ===========================================================================
+ * Output a short LSB first on the stream.
+ * IN assertion: there is enough room in pendingBuf.
+ */
+#define put_short(s, w) { \
+ put_byte(s, (uch)((w) & 0xff)); \
+ put_byte(s, (uch)((ush)(w) >> 8)); \
+}
+
+/* ===========================================================================
+ * Send a value on a given number of bits.
+ * IN assertion: length <= 16 and value fits in length bits.
+ */
+#ifdef DEBUG
+local void send_bits OF((deflate_state *s, int value, int length));
+
+local void send_bits(s, value, length)
+ deflate_state *s;
+ int value; /* value to send */
+ int length; /* number of bits */
+{
+ Tracevv((stderr," l %2d v %4x ", length, value));
+ Assert(length > 0 && length <= 15, "invalid length");
+ s->bits_sent += (ulg)length;
+
+ /* If not enough room in bi_buf, use (valid) bits from bi_buf and
+ * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid))
+ * unused bits in value.
+ */
+ if (s->bi_valid > (int)Buf_size - length) {
+ s->bi_buf |= (ush)value << s->bi_valid;
+ put_short(s, s->bi_buf);
+ s->bi_buf = (ush)value >> (Buf_size - s->bi_valid);
+ s->bi_valid += length - Buf_size;
+ } else {
+ s->bi_buf |= (ush)value << s->bi_valid;
+ s->bi_valid += length;
+ }
+}
+#else /* !DEBUG */
+
+#define send_bits(s, value, length) \
+{ int len = length;\
+ if (s->bi_valid > (int)Buf_size - len) {\
+ int val = value;\
+ s->bi_buf |= (ush)val << s->bi_valid;\
+ put_short(s, s->bi_buf);\
+ s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
+ s->bi_valid += len - Buf_size;\
+ } else {\
+ s->bi_buf |= (ush)(value) << s->bi_valid;\
+ s->bi_valid += len;\
+ }\
+}
+#endif /* DEBUG */
+
+
+/* the arguments must not have side effects */
+
+/* ===========================================================================
+ * Initialize the various 'constant' tables.
+ */
+local void tr_static_init()
+{
+#if defined(GEN_TREES_H) || !defined(STDC)
+ static int static_init_done = 0;
+ int n; /* iterates over tree elements */
+ int bits; /* bit counter */
+ int length; /* length value */
+ int code; /* code value */
+ int dist; /* distance index */
+ ush bl_count[MAX_BITS+1];
+ /* number of codes at each bit length for an optimal tree */
+
+ if (static_init_done) return;
+
+ /* For some embedded targets, global variables are not initialized: */
+#ifdef NO_INIT_GLOBAL_POINTERS
+ static_l_desc.static_tree = static_ltree;
+ static_l_desc.extra_bits = extra_lbits;
+ static_d_desc.static_tree = static_dtree;
+ static_d_desc.extra_bits = extra_dbits;
+ static_bl_desc.extra_bits = extra_blbits;
+#endif
+
+ /* Initialize the mapping length (0..255) -> length code (0..28) */
+ length = 0;
+ for (code = 0; code < LENGTH_CODES-1; code++) {
+ base_length[code] = length;
+ for (n = 0; n < (1<<extra_lbits[code]); n++) {
+ _length_code[length++] = (uch)code;
+ }
+ }
+ Assert (length == 256, "tr_static_init: length != 256");
+ /* Note that the length 255 (match length 258) can be represented
+ * in two different ways: code 284 + 5 bits or code 285, so we
+ * overwrite length_code[255] to use the best encoding:
+ */
+ _length_code[length-1] = (uch)code;
+
+ /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
+ dist = 0;
+ for (code = 0 ; code < 16; code++) {
+ base_dist[code] = dist;
+ for (n = 0; n < (1<<extra_dbits[code]); n++) {
+ _dist_code[dist++] = (uch)code;
+ }
+ }
+ Assert (dist == 256, "tr_static_init: dist != 256");
+ dist >>= 7; /* from now on, all distances are divided by 128 */
+ for ( ; code < D_CODES; code++) {
+ base_dist[code] = dist << 7;
+ for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {
+ _dist_code[256 + dist++] = (uch)code;
+ }
+ }
+ Assert (dist == 256, "tr_static_init: 256+dist != 512");
+
+ /* Construct the codes of the static literal tree */
+ for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0;
+ n = 0;
+ while (n <= 143) static_ltree[n++].Len = 8, bl_count[8]++;
+ while (n <= 255) static_ltree[n++].Len = 9, bl_count[9]++;
+ while (n <= 279) static_ltree[n++].Len = 7, bl_count[7]++;
+ while (n <= 287) static_ltree[n++].Len = 8, bl_count[8]++;
+ /* Codes 286 and 287 do not exist, but we must include them in the
+ * tree construction to get a canonical Huffman tree (longest code
+ * all ones)
+ */
+ gen_codes((ct_data *)static_ltree, L_CODES+1, bl_count);
+
+ /* The static distance tree is trivial: */
+ for (n = 0; n < D_CODES; n++) {
+ static_dtree[n].Len = 5;
+ static_dtree[n].Code = bi_reverse((unsigned)n, 5);
+ }
+ static_init_done = 1;
+
+# ifdef GEN_TREES_H
+ gen_trees_header();
+# endif
+#endif /* defined(GEN_TREES_H) || !defined(STDC) */
+}
+
+/* ===========================================================================
+ * Genererate the file trees.h describing the static trees.
+ */
+#ifdef GEN_TREES_H
+# ifndef DEBUG
+# include <stdio.h>
+# endif
+
+# define SEPARATOR(i, last, width) \
+ ((i) == (last)? "\n};\n\n" : \
+ ((i) % (width) == (width)-1 ? ",\n" : ", "))
+
+void gen_trees_header()
+{
+ FILE *header = fopen("trees.h", "w");
+ int i;
+
+ Assert (header != NULL, "Can't open trees.h");
+ fprintf(header,
+ "/* header created automatically with -DGEN_TREES_H */\n\n");
+
+ fprintf(header, "local const ct_data static_ltree[L_CODES+2] = {\n");
+ for (i = 0; i < L_CODES+2; i++) {
+ fprintf(header, "{{%3u},{%3u}}%s", static_ltree[i].Code,
+ static_ltree[i].Len, SEPARATOR(i, L_CODES+1, 5));
+ }
+
+ fprintf(header, "local const ct_data static_dtree[D_CODES] = {\n");
+ for (i = 0; i < D_CODES; i++) {
+ fprintf(header, "{{%2u},{%2u}}%s", static_dtree[i].Code,
+ static_dtree[i].Len, SEPARATOR(i, D_CODES-1, 5));
+ }
+
+ fprintf(header, "const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = {\n");
+ for (i = 0; i < DIST_CODE_LEN; i++) {
+ fprintf(header, "%2u%s", _dist_code[i],
+ SEPARATOR(i, DIST_CODE_LEN-1, 20));
+ }
+
+ fprintf(header,
+ "const uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= {\n");
+ for (i = 0; i < MAX_MATCH-MIN_MATCH+1; i++) {
+ fprintf(header, "%2u%s", _length_code[i],
+ SEPARATOR(i, MAX_MATCH-MIN_MATCH, 20));
+ }
+
+ fprintf(header, "local const int base_length[LENGTH_CODES] = {\n");
+ for (i = 0; i < LENGTH_CODES; i++) {
+ fprintf(header, "%1u%s", base_length[i],
+ SEPARATOR(i, LENGTH_CODES-1, 20));
+ }
+
+ fprintf(header, "local const int base_dist[D_CODES] = {\n");
+ for (i = 0; i < D_CODES; i++) {
+ fprintf(header, "%5u%s", base_dist[i],
+ SEPARATOR(i, D_CODES-1, 10));
+ }
+
+ fclose(header);
+}
+#endif /* GEN_TREES_H */
+
+/* ===========================================================================
+ * Initialize the tree data structures for a new zlib stream.
+ */
+void ZLIB_INTERNAL _tr_init(s)
+ deflate_state *s;
+{
+ tr_static_init();
+
+ s->l_desc.dyn_tree = s->dyn_ltree;
+ s->l_desc.stat_desc = &static_l_desc;
+
+ s->d_desc.dyn_tree = s->dyn_dtree;
+ s->d_desc.stat_desc = &static_d_desc;
+
+ s->bl_desc.dyn_tree = s->bl_tree;
+ s->bl_desc.stat_desc = &static_bl_desc;
+
+ s->bi_buf = 0;
+ s->bi_valid = 0;
+#ifdef DEBUG
+ s->compressed_len = 0L;
+ s->bits_sent = 0L;
+#endif
+
+ /* Initialize the first block of the first file: */
+ init_block(s);
+}
+
+/* ===========================================================================
+ * Initialize a new block.
+ */
+local void init_block(s)
+ deflate_state *s;
+{
+ int n; /* iterates over tree elements */
+
+ /* Initialize the trees. */
+ for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0;
+ for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0;
+ for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
+
+ s->dyn_ltree[END_BLOCK].Freq = 1;
+ s->opt_len = s->static_len = 0L;
+ s->last_lit = s->matches = 0;
+}
+
+#define SMALLEST 1
+/* Index within the heap array of least frequent node in the Huffman tree */
+
+
+/* ===========================================================================
+ * Remove the smallest element from the heap and recreate the heap with
+ * one less element. Updates heap and heap_len.
+ */
+#define pqremove(s, tree, top) \
+{\
+ top = s->heap[SMALLEST]; \
+ s->heap[SMALLEST] = s->heap[s->heap_len--]; \
+ pqdownheap(s, tree, SMALLEST); \
+}
+
+/* ===========================================================================
+ * Compares to subtrees, using the tree depth as tie breaker when
+ * the subtrees have equal frequency. This minimizes the worst case length.
+ */
+#define smaller(tree, n, m, depth) \
+ (tree[n].Freq < tree[m].Freq || \
+ (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
+
+/* ===========================================================================
+ * Restore the heap property by moving down the tree starting at node k,
+ * exchanging a node with the smallest of its two sons if necessary, stopping
+ * when the heap property is re-established (each father smaller than its
+ * two sons).
+ */
+local void pqdownheap(s, tree, k)
+ deflate_state *s;
+ ct_data *tree; /* the tree to restore */
+ int k; /* node to move down */
+{
+ int v = s->heap[k];
+ int j = k << 1; /* left son of k */
+ while (j <= s->heap_len) {
+ /* Set j to the smallest of the two sons: */
+ if (j < s->heap_len &&
+ smaller(tree, s->heap[j+1], s->heap[j], s->depth)) {
+ j++;
+ }
+ /* Exit if v is smaller than both sons */
+ if (smaller(tree, v, s->heap[j], s->depth)) break;
+
+ /* Exchange v with the smallest son */
+ s->heap[k] = s->heap[j]; k = j;
+
+ /* And continue down the tree, setting j to the left son of k */
+ j <<= 1;
+ }
+ s->heap[k] = v;
+}
+
+/* ===========================================================================
+ * Compute the optimal bit lengths for a tree and update the total bit length
+ * for the current block.
+ * IN assertion: the fields freq and dad are set, heap[heap_max] and
+ * above are the tree nodes sorted by increasing frequency.
+ * OUT assertions: the field len is set to the optimal bit length, the
+ * array bl_count contains the frequencies for each bit length.
+ * The length opt_len is updated; static_len is also updated if stree is
+ * not null.
+ */
+local void gen_bitlen(s, desc)
+ deflate_state *s;
+ tree_desc *desc; /* the tree descriptor */
+{
+ ct_data *tree = desc->dyn_tree;
+ int max_code = desc->max_code;
+ const ct_data *stree = desc->stat_desc->static_tree;
+ const intf *extra = desc->stat_desc->extra_bits;
+ int base = desc->stat_desc->extra_base;
+ int max_length = desc->stat_desc->max_length;
+ int h; /* heap index */
+ int n, m; /* iterate over the tree elements */
+ int bits; /* bit length */
+ int xbits; /* extra bits */
+ ush f; /* frequency */
+ int overflow = 0; /* number of elements with bit length too large */
+
+ for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;
+
+ /* In a first pass, compute the optimal bit lengths (which may
+ * overflow in the case of the bit length tree).
+ */
+ tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */
+
+ for (h = s->heap_max+1; h < HEAP_SIZE; h++) {
+ n = s->heap[h];
+ bits = tree[tree[n].Dad].Len + 1;
+ if (bits > max_length) bits = max_length, overflow++;
+ tree[n].Len = (ush)bits;
+ /* We overwrite tree[n].Dad which is no longer needed */
+
+ if (n > max_code) continue; /* not a leaf node */
+
+ s->bl_count[bits]++;
+ xbits = 0;
+ if (n >= base) xbits = extra[n-base];
+ f = tree[n].Freq;
+ s->opt_len += (ulg)f * (bits + xbits);
+ if (stree) s->static_len += (ulg)f * (stree[n].Len + xbits);
+ }
+ if (overflow == 0) return;
+
+ Trace((stderr,"\nbit length overflow\n"));
+ /* This happens for example on obj2 and pic of the Calgary corpus */
+
+ /* Find the first bit length which could increase: */
+ do {
+ bits = max_length-1;
+ while (s->bl_count[bits] == 0) bits--;
+ s->bl_count[bits]--; /* move one leaf down the tree */
+ s->bl_count[bits+1] += 2; /* move one overflow item as its brother */
+ s->bl_count[max_length]--;
+ /* The brother of the overflow item also moves one step up,
+ * but this does not affect bl_count[max_length]
+ */
+ overflow -= 2;
+ } while (overflow > 0);
+
+ /* Now recompute all bit lengths, scanning in increasing frequency.
+ * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
+ * lengths instead of fixing only the wrong ones. This idea is taken
+ * from 'ar' written by Haruhiko Okumura.)
+ */
+ for (bits = max_length; bits != 0; bits--) {
+ n = s->bl_count[bits];
+ while (n != 0) {
+ m = s->heap[--h];
+ if (m > max_code) continue;
+ if ((unsigned) tree[m].Len != (unsigned) bits) {
+ Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
+ s->opt_len += ((long)bits - (long)tree[m].Len)
+ *(long)tree[m].Freq;
+ tree[m].Len = (ush)bits;
+ }
+ n--;
+ }
+ }
+}
+
+/* ===========================================================================
+ * Generate the codes for a given tree and bit counts (which need not be
+ * optimal).
+ * IN assertion: the array bl_count contains the bit length statistics for
+ * the given tree and the field len is set for all tree elements.
+ * OUT assertion: the field code is set for all tree elements of non
+ * zero code length.
+ */
+local void gen_codes (tree, max_code, bl_count)
+ ct_data *tree; /* the tree to decorate */
+ int max_code; /* largest code with non zero frequency */
+ ushf *bl_count; /* number of codes at each bit length */
+{
+ ush next_code[MAX_BITS+1]; /* next code value for each bit length */
+ ush code = 0; /* running code value */
+ int bits; /* bit index */
+ int n; /* code index */
+
+ /* The distribution counts are first used to generate the code values
+ * without bit reversal.
+ */
+ for (bits = 1; bits <= MAX_BITS; bits++) {
+ next_code[bits] = code = (code + bl_count[bits-1]) << 1;
+ }
+ /* Check that the bit counts in bl_count are consistent. The last code
+ * must be all ones.
+ */
+ Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
+ "inconsistent bit counts");
+ Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
+
+ for (n = 0; n <= max_code; n++) {
+ int len = tree[n].Len;
+ if (len == 0) continue;
+ /* Now reverse the bits */
+ tree[n].Code = bi_reverse(next_code[len]++, len);
+
+ Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
+ n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
+ }
+}
+
+/* ===========================================================================
+ * Construct one Huffman tree and assigns the code bit strings and lengths.
+ * Update the total bit length for the current block.
+ * IN assertion: the field freq is set for all tree elements.
+ * OUT assertions: the fields len and code are set to the optimal bit length
+ * and corresponding code. The length opt_len is updated; static_len is
+ * also updated if stree is not null. The field max_code is set.
+ */
+local void build_tree(s, desc)
+ deflate_state *s;
+ tree_desc *desc; /* the tree descriptor */
+{
+ ct_data *tree = desc->dyn_tree;
+ const ct_data *stree = desc->stat_desc->static_tree;
+ int elems = desc->stat_desc->elems;
+ int n, m; /* iterate over heap elements */
+ int max_code = -1; /* largest code with non zero frequency */
+ int node; /* new node being created */
+
+ /* Construct the initial heap, with least frequent element in
+ * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
+ * heap[0] is not used.
+ */
+ s->heap_len = 0, s->heap_max = HEAP_SIZE;
+
+ for (n = 0; n < elems; n++) {
+ if (tree[n].Freq != 0) {
+ s->heap[++(s->heap_len)] = max_code = n;
+ s->depth[n] = 0;
+ } else {
+ tree[n].Len = 0;
+ }
+ }
+
+ /* The pkzip format requires that at least one distance code exists,
+ * and that at least one bit should be sent even if there is only one
+ * possible code. So to avoid special checks later on we force at least
+ * two codes of non zero frequency.
+ */
+ while (s->heap_len < 2) {
+ node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);
+ tree[node].Freq = 1;
+ s->depth[node] = 0;
+ s->opt_len--; if (stree) s->static_len -= stree[node].Len;
+ /* node is 0 or 1 so it does not have extra bits */
+ }
+ desc->max_code = max_code;
+
+ /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
+ * establish sub-heaps of increasing lengths:
+ */
+ for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);
+
+ /* Construct the Huffman tree by repeatedly combining the least two
+ * frequent nodes.
+ */
+ node = elems; /* next internal node of the tree */
+ do {
+ pqremove(s, tree, n); /* n = node of least frequency */
+ m = s->heap[SMALLEST]; /* m = node of next least frequency */
+
+ s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */
+ s->heap[--(s->heap_max)] = m;
+
+ /* Create a new node father of n and m */
+ tree[node].Freq = tree[n].Freq + tree[m].Freq;
+ s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ?
+ s->depth[n] : s->depth[m]) + 1);
+ tree[n].Dad = tree[m].Dad = (ush)node;
+#ifdef DUMP_BL_TREE
+ if (tree == s->bl_tree) {
+ fprintf(stderr,"\nnode %d(%d), sons %d(%d) %d(%d)",
+ node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq);
+ }
+#endif
+ /* and insert the new node in the heap */
+ s->heap[SMALLEST] = node++;
+ pqdownheap(s, tree, SMALLEST);
+
+ } while (s->heap_len >= 2);
+
+ s->heap[--(s->heap_max)] = s->heap[SMALLEST];
+
+ /* At this point, the fields freq and dad are set. We can now
+ * generate the bit lengths.
+ */
+ gen_bitlen(s, (tree_desc *)desc);
+
+ /* The field len is now set, we can generate the bit codes */
+ gen_codes ((ct_data *)tree, max_code, s->bl_count);
+}
+
+/* ===========================================================================
+ * Scan a literal or distance tree to determine the frequencies of the codes
+ * in the bit length tree.
+ */
+local void scan_tree (s, tree, max_code)
+ deflate_state *s;
+ ct_data *tree; /* the tree to be scanned */
+ int max_code; /* and its largest code of non zero frequency */
+{
+ int n; /* iterates over all tree elements */
+ int prevlen = -1; /* last emitted length */
+ int curlen; /* length of current code */
+ int nextlen = tree[0].Len; /* length of next code */
+ int count = 0; /* repeat count of the current code */
+ int max_count = 7; /* max repeat count */
+ int min_count = 4; /* min repeat count */
+
+ if (nextlen == 0) max_count = 138, min_count = 3;
+ tree[max_code+1].Len = (ush)0xffff; /* guard */
+
+ for (n = 0; n <= max_code; n++) {
+ curlen = nextlen; nextlen = tree[n+1].Len;
+ if (++count < max_count && curlen == nextlen) {
+ continue;
+ } else if (count < min_count) {
+ s->bl_tree[curlen].Freq += count;
+ } else if (curlen != 0) {
+ if (curlen != prevlen) s->bl_tree[curlen].Freq++;
+ s->bl_tree[REP_3_6].Freq++;
+ } else if (count <= 10) {
+ s->bl_tree[REPZ_3_10].Freq++;
+ } else {
+ s->bl_tree[REPZ_11_138].Freq++;
+ }
+ count = 0; prevlen = curlen;
+ if (nextlen == 0) {
+ max_count = 138, min_count = 3;
+ } else if (curlen == nextlen) {
+ max_count = 6, min_count = 3;
+ } else {
+ max_count = 7, min_count = 4;
+ }
+ }
+}
+
+/* ===========================================================================
+ * Send a literal or distance tree in compressed form, using the codes in
+ * bl_tree.
+ */
+local void send_tree (s, tree, max_code)
+ deflate_state *s;
+ ct_data *tree; /* the tree to be scanned */
+ int max_code; /* and its largest code of non zero frequency */
+{
+ int n; /* iterates over all tree elements */
+ int prevlen = -1; /* last emitted length */
+ int curlen; /* length of current code */
+ int nextlen = tree[0].Len; /* length of next code */
+ int count = 0; /* repeat count of the current code */
+ int max_count = 7; /* max repeat count */
+ int min_count = 4; /* min repeat count */
+
+ /* tree[max_code+1].Len = -1; */ /* guard already set */
+ if (nextlen == 0) max_count = 138, min_count = 3;
+
+ for (n = 0; n <= max_code; n++) {
+ curlen = nextlen; nextlen = tree[n+1].Len;
+ if (++count < max_count && curlen == nextlen) {
+ continue;
+ } else if (count < min_count) {
+ do { send_code(s, curlen, s->bl_tree); } while (--count != 0);
+
+ } else if (curlen != 0) {
+ if (curlen != prevlen) {
+ send_code(s, curlen, s->bl_tree); count--;
+ }
+ Assert(count >= 3 && count <= 6, " 3_6?");
+ send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2);
+
+ } else if (count <= 10) {
+ send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3);
+
+ } else {
+ send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7);
+ }
+ count = 0; prevlen = curlen;
+ if (nextlen == 0) {
+ max_count = 138, min_count = 3;
+ } else if (curlen == nextlen) {
+ max_count = 6, min_count = 3;
+ } else {
+ max_count = 7, min_count = 4;
+ }
+ }
+}
+
+/* ===========================================================================
+ * Construct the Huffman tree for the bit lengths and return the index in
+ * bl_order of the last bit length code to send.
+ */
+local int build_bl_tree(s)
+ deflate_state *s;
+{
+ int max_blindex; /* index of last bit length code of non zero freq */
+
+ /* Determine the bit length frequencies for literal and distance trees */
+ scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code);
+ scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code);
+
+ /* Build the bit length tree: */
+ build_tree(s, (tree_desc *)(&(s->bl_desc)));
+ /* opt_len now includes the length of the tree representations, except
+ * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
+ */
+
+ /* Determine the number of bit length codes to send. The pkzip format
+ * requires that at least 4 bit length codes be sent. (appnote.txt says
+ * 3 but the actual value used is 4.)
+ */
+ for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
+ if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
+ }
+ /* Update opt_len to include the bit length tree and counts */
+ s->opt_len += 3*(max_blindex+1) + 5+5+4;
+ Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
+ s->opt_len, s->static_len));
+
+ return max_blindex;
+}
+
+/* ===========================================================================
+ * Send the header for a block using dynamic Huffman trees: the counts, the
+ * lengths of the bit length codes, the literal tree and the distance tree.
+ * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
+ */
+local void send_all_trees(s, lcodes, dcodes, blcodes)
+ deflate_state *s;
+ int lcodes, dcodes, blcodes; /* number of codes for each tree */
+{
+ int rank; /* index in bl_order */
+
+ Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
+ Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
+ "too many codes");
+ Tracev((stderr, "\nbl counts: "));
+ send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */
+ send_bits(s, dcodes-1, 5);
+ send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */
+ for (rank = 0; rank < blcodes; rank++) {
+ Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
+ send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
+ }
+ Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
+
+ send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */
+ Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
+
+ send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */
+ Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
+}
+
+/* ===========================================================================
+ * Send a stored block
+ */
+void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last)
+ deflate_state *s;
+ charf *buf; /* input block */
+ ulg stored_len; /* length of input block */
+ int last; /* one if this is the last block for a file */
+{
+ send_bits(s, (STORED_BLOCK<<1)+last, 3); /* send block type */
+#ifdef DEBUG
+ s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
+ s->compressed_len += (stored_len + 4) << 3;
+#endif
+ copy_block(s, buf, (unsigned)stored_len, 1); /* with header */
+}
+
+/* ===========================================================================
+ * Flush the bits in the bit buffer to pending output (leaves at most 7 bits)
+ */
+void ZLIB_INTERNAL _tr_flush_bits(s)
+ deflate_state *s;
+{
+ bi_flush(s);
+}
+
+/* ===========================================================================
+ * Send one empty static block to give enough lookahead for inflate.
+ * This takes 10 bits, of which 7 may remain in the bit buffer.
+ */
+void ZLIB_INTERNAL _tr_align(s)
+ deflate_state *s;
+{
+ send_bits(s, STATIC_TREES<<1, 3);
+ send_code(s, END_BLOCK, static_ltree);
+#ifdef DEBUG
+ s->compressed_len += 10L; /* 3 for block type, 7 for EOB */
+#endif
+ bi_flush(s);
+}
+
+/* ===========================================================================
+ * Determine the best encoding for the current block: dynamic trees, static
+ * trees or store, and output the encoded block to the zip file.
+ */
+void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
+ deflate_state *s;
+ charf *buf; /* input block, or NULL if too old */
+ ulg stored_len; /* length of input block */
+ int last; /* one if this is the last block for a file */
+{
+ ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
+ int max_blindex = 0; /* index of last bit length code of non zero freq */
+
+ /* Build the Huffman trees unless a stored block is forced */
+ if (s->level > 0) {
+
+ /* Check if the file is binary or text */
+ if (s->strm->data_type == Z_UNKNOWN)
+ s->strm->data_type = detect_data_type(s);
+
+ /* Construct the literal and distance trees */
+ build_tree(s, (tree_desc *)(&(s->l_desc)));
+ Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
+ s->static_len));
+
+ build_tree(s, (tree_desc *)(&(s->d_desc)));
+ Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
+ s->static_len));
+ /* At this point, opt_len and static_len are the total bit lengths of
+ * the compressed block data, excluding the tree representations.
+ */
+
+ /* Build the bit length tree for the above two trees, and get the index
+ * in bl_order of the last bit length code to send.
+ */
+ max_blindex = build_bl_tree(s);
+
+ /* Determine the best encoding. Compute the block lengths in bytes. */
+ opt_lenb = (s->opt_len+3+7)>>3;
+ static_lenb = (s->static_len+3+7)>>3;
+
+ Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
+ opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
+ s->last_lit));
+
+ if (static_lenb <= opt_lenb) opt_lenb = static_lenb;
+
+ } else {
+ Assert(buf != (char*)0, "lost buf");
+ opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
+ }
+
+#ifdef FORCE_STORED
+ if (buf != (char*)0) { /* force stored block */
+#else
+ if (stored_len+4 <= opt_lenb && buf != (char*)0) {
+ /* 4: two words for the lengths */
+#endif
+ /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
+ * Otherwise we can't have processed more than WSIZE input bytes since
+ * the last block flush, because compression would have been
+ * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
+ * transform a block into a stored block.
+ */
+ _tr_stored_block(s, buf, stored_len, last);
+
+#ifdef FORCE_STATIC
+ } else if (static_lenb >= 0) { /* force static trees */
+#else
+ } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) {
+#endif
+ send_bits(s, (STATIC_TREES<<1)+last, 3);
+ compress_block(s, (const ct_data *)static_ltree,
+ (const ct_data *)static_dtree);
+#ifdef DEBUG
+ s->compressed_len += 3 + s->static_len;
+#endif
+ } else {
+ send_bits(s, (DYN_TREES<<1)+last, 3);
+ send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1,
+ max_blindex+1);
+ compress_block(s, (const ct_data *)s->dyn_ltree,
+ (const ct_data *)s->dyn_dtree);
+#ifdef DEBUG
+ s->compressed_len += 3 + s->opt_len;
+#endif
+ }
+ Assert (s->compressed_len == s->bits_sent, "bad compressed size");
+ /* The above check is made mod 2^32, for files larger than 512 MB
+ * and uLong implemented on 32 bits.
+ */
+ init_block(s);
+
+ if (last) {
+ bi_windup(s);
+#ifdef DEBUG
+ s->compressed_len += 7; /* align on byte boundary */
+#endif
+ }
+ Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
+ s->compressed_len-7*last));
+}
+
+/* ===========================================================================
+ * Save the match info and tally the frequency counts. Return true if
+ * the current block must be flushed.
+ */
+int ZLIB_INTERNAL _tr_tally (s, dist, lc)
+ deflate_state *s;
+ unsigned dist; /* distance of matched string */
+ unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
+{
+ s->d_buf[s->last_lit] = (ush)dist;
+ s->l_buf[s->last_lit++] = (uch)lc;
+ if (dist == 0) {
+ /* lc is the unmatched char */
+ s->dyn_ltree[lc].Freq++;
+ } else {
+ s->matches++;
+ /* Here, lc is the match length - MIN_MATCH */
+ dist--; /* dist = match distance - 1 */
+ Assert((ush)dist < (ush)MAX_DIST(s) &&
+ (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
+ (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match");
+
+ s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++;
+ s->dyn_dtree[d_code(dist)].Freq++;
+ }
+
+#ifdef TRUNCATE_BLOCK
+ /* Try to guess if it is profitable to stop the current block here */
+ if ((s->last_lit & 0x1fff) == 0 && s->level > 2) {
+ /* Compute an upper bound for the compressed length */
+ ulg out_length = (ulg)s->last_lit*8L;
+ ulg in_length = (ulg)((long)s->strstart - s->block_start);
+ int dcode;
+ for (dcode = 0; dcode < D_CODES; dcode++) {
+ out_length += (ulg)s->dyn_dtree[dcode].Freq *
+ (5L+extra_dbits[dcode]);
+ }
+ out_length >>= 3;
+ Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
+ s->last_lit, in_length, out_length,
+ 100L - out_length*100L/in_length));
+ if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1;
+ }
+#endif
+ return (s->last_lit == s->lit_bufsize-1);
+ /* We avoid equality with lit_bufsize because of wraparound at 64K
+ * on 16 bit machines and because stored blocks are restricted to
+ * 64K-1 bytes.
+ */
+}
+
+/* ===========================================================================
+ * Send the block data compressed using the given Huffman trees
+ */
+local void compress_block(s, ltree, dtree)
+ deflate_state *s;
+ const ct_data *ltree; /* literal tree */
+ const ct_data *dtree; /* distance tree */
+{
+ unsigned dist; /* distance of matched string */
+ int lc; /* match length or unmatched char (if dist == 0) */
+ unsigned lx = 0; /* running index in l_buf */
+ unsigned code; /* the code to send */
+ int extra; /* number of extra bits to send */
+
+ if (s->last_lit != 0) do {
+ dist = s->d_buf[lx];
+ lc = s->l_buf[lx++];
+ if (dist == 0) {
+ send_code(s, lc, ltree); /* send a literal byte */
+ Tracecv(isgraph(lc), (stderr," '%c' ", lc));
+ } else {
+ /* Here, lc is the match length - MIN_MATCH */
+ code = _length_code[lc];
+ send_code(s, code+LITERALS+1, ltree); /* send the length code */
+ extra = extra_lbits[code];
+ if (extra != 0) {
+ lc -= base_length[code];
+ send_bits(s, lc, extra); /* send the extra length bits */
+ }
+ dist--; /* dist is now the match distance - 1 */
+ code = d_code(dist);
+ Assert (code < D_CODES, "bad d_code");
+
+ send_code(s, code, dtree); /* send the distance code */
+ extra = extra_dbits[code];
+ if (extra != 0) {
+ dist -= base_dist[code];
+ send_bits(s, dist, extra); /* send the extra distance bits */
+ }
+ } /* literal or match pair ? */
+
+ /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
+ Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
+ "pendingBuf overflow");
+
+ } while (lx < s->last_lit);
+
+ send_code(s, END_BLOCK, ltree);
+}
+
+/* ===========================================================================
+ * Check if the data type is TEXT or BINARY, using the following algorithm:
+ * - TEXT if the two conditions below are satisfied:
+ * a) There are no non-portable control characters belonging to the
+ * "black list" (0..6, 14..25, 28..31).
+ * b) There is at least one printable character belonging to the
+ * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).
+ * - BINARY otherwise.
+ * - The following partially-portable control characters form a
+ * "gray list" that is ignored in this detection algorithm:
+ * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).
+ * IN assertion: the fields Freq of dyn_ltree are set.
+ */
+local int detect_data_type(s)
+ deflate_state *s;
+{
+ /* black_mask is the bit mask of black-listed bytes
+ * set bits 0..6, 14..25, and 28..31
+ * 0xf3ffc07f = binary 11110011111111111100000001111111
+ */
+ unsigned long black_mask = 0xf3ffc07fUL;
+ int n;
+
+ /* Check for non-textual ("black-listed") bytes. */
+ for (n = 0; n <= 31; n++, black_mask >>= 1)
+ if ((black_mask & 1) && (s->dyn_ltree[n].Freq != 0))
+ return Z_BINARY;
+
+ /* Check for textual ("white-listed") bytes. */
+ if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
+ || s->dyn_ltree[13].Freq != 0)
+ return Z_TEXT;
+ for (n = 32; n < LITERALS; n++)
+ if (s->dyn_ltree[n].Freq != 0)
+ return Z_TEXT;
+
+ /* There are no "black-listed" or "white-listed" bytes:
+ * this stream either is empty or has tolerated ("gray-listed") bytes only.
+ */
+ return Z_BINARY;
+}
+
+/* ===========================================================================
+ * Reverse the first len bits of a code, using straightforward code (a faster
+ * method would use a table)
+ * IN assertion: 1 <= len <= 15
+ */
+local unsigned bi_reverse(code, len)
+ unsigned code; /* the value to invert */
+ int len; /* its bit length */
+{
+ register unsigned res = 0;
+ do {
+ res |= code & 1;
+ code >>= 1, res <<= 1;
+ } while (--len > 0);
+ return res >> 1;
+}
+
+/* ===========================================================================
+ * Flush the bit buffer, keeping at most 7 bits in it.
+ */
+local void bi_flush(s)
+ deflate_state *s;
+{
+ if (s->bi_valid == 16) {
+ put_short(s, s->bi_buf);
+ s->bi_buf = 0;
+ s->bi_valid = 0;
+ } else if (s->bi_valid >= 8) {
+ put_byte(s, (Byte)s->bi_buf);
+ s->bi_buf >>= 8;
+ s->bi_valid -= 8;
+ }
+}
+
+/* ===========================================================================
+ * Flush the bit buffer and align the output on a byte boundary
+ */
+local void bi_windup(s)
+ deflate_state *s;
+{
+ if (s->bi_valid > 8) {
+ put_short(s, s->bi_buf);
+ } else if (s->bi_valid > 0) {
+ put_byte(s, (Byte)s->bi_buf);
+ }
+ s->bi_buf = 0;
+ s->bi_valid = 0;
+#ifdef DEBUG
+ s->bits_sent = (s->bits_sent+7) & ~7;
+#endif
+}
+
+/* ===========================================================================
+ * Copy a stored block, storing first the length and its
+ * one's complement if requested.
+ */
+local void copy_block(s, buf, len, header)
+ deflate_state *s;
+ charf *buf; /* the input data */
+ unsigned len; /* its length */
+ int header; /* true if block header must be written */
+{
+ bi_windup(s); /* align on byte boundary */
+
+ if (header) {
+ put_short(s, (ush)len);
+ put_short(s, (ush)~len);
+#ifdef DEBUG
+ s->bits_sent += 2*16;
+#endif
+ }
+#ifdef DEBUG
+ s->bits_sent += (ulg)len<<3;
+#endif
+ while (len--) {
+ put_byte(s, *buf++);
+ }
+}
diff --git a/protocols/Telegram/tgl/zlib/trees.h b/protocols/Telegram/tgl/zlib/trees.h
new file mode 100644
index 0000000000..d35639d82a
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/trees.h
@@ -0,0 +1,128 @@
+/* header created automatically with -DGEN_TREES_H */
+
+local const ct_data static_ltree[L_CODES+2] = {
+{{ 12},{ 8}}, {{140},{ 8}}, {{ 76},{ 8}}, {{204},{ 8}}, {{ 44},{ 8}},
+{{172},{ 8}}, {{108},{ 8}}, {{236},{ 8}}, {{ 28},{ 8}}, {{156},{ 8}},
+{{ 92},{ 8}}, {{220},{ 8}}, {{ 60},{ 8}}, {{188},{ 8}}, {{124},{ 8}},
+{{252},{ 8}}, {{ 2},{ 8}}, {{130},{ 8}}, {{ 66},{ 8}}, {{194},{ 8}},
+{{ 34},{ 8}}, {{162},{ 8}}, {{ 98},{ 8}}, {{226},{ 8}}, {{ 18},{ 8}},
+{{146},{ 8}}, {{ 82},{ 8}}, {{210},{ 8}}, {{ 50},{ 8}}, {{178},{ 8}},
+{{114},{ 8}}, {{242},{ 8}}, {{ 10},{ 8}}, {{138},{ 8}}, {{ 74},{ 8}},
+{{202},{ 8}}, {{ 42},{ 8}}, {{170},{ 8}}, {{106},{ 8}}, {{234},{ 8}},
+{{ 26},{ 8}}, {{154},{ 8}}, {{ 90},{ 8}}, {{218},{ 8}}, {{ 58},{ 8}},
+{{186},{ 8}}, {{122},{ 8}}, {{250},{ 8}}, {{ 6},{ 8}}, {{134},{ 8}},
+{{ 70},{ 8}}, {{198},{ 8}}, {{ 38},{ 8}}, {{166},{ 8}}, {{102},{ 8}},
+{{230},{ 8}}, {{ 22},{ 8}}, {{150},{ 8}}, {{ 86},{ 8}}, {{214},{ 8}},
+{{ 54},{ 8}}, {{182},{ 8}}, {{118},{ 8}}, {{246},{ 8}}, {{ 14},{ 8}},
+{{142},{ 8}}, {{ 78},{ 8}}, {{206},{ 8}}, {{ 46},{ 8}}, {{174},{ 8}},
+{{110},{ 8}}, {{238},{ 8}}, {{ 30},{ 8}}, {{158},{ 8}}, {{ 94},{ 8}},
+{{222},{ 8}}, {{ 62},{ 8}}, {{190},{ 8}}, {{126},{ 8}}, {{254},{ 8}},
+{{ 1},{ 8}}, {{129},{ 8}}, {{ 65},{ 8}}, {{193},{ 8}}, {{ 33},{ 8}},
+{{161},{ 8}}, {{ 97},{ 8}}, {{225},{ 8}}, {{ 17},{ 8}}, {{145},{ 8}},
+{{ 81},{ 8}}, {{209},{ 8}}, {{ 49},{ 8}}, {{177},{ 8}}, {{113},{ 8}},
+{{241},{ 8}}, {{ 9},{ 8}}, {{137},{ 8}}, {{ 73},{ 8}}, {{201},{ 8}},
+{{ 41},{ 8}}, {{169},{ 8}}, {{105},{ 8}}, {{233},{ 8}}, {{ 25},{ 8}},
+{{153},{ 8}}, {{ 89},{ 8}}, {{217},{ 8}}, {{ 57},{ 8}}, {{185},{ 8}},
+{{121},{ 8}}, {{249},{ 8}}, {{ 5},{ 8}}, {{133},{ 8}}, {{ 69},{ 8}},
+{{197},{ 8}}, {{ 37},{ 8}}, {{165},{ 8}}, {{101},{ 8}}, {{229},{ 8}},
+{{ 21},{ 8}}, {{149},{ 8}}, {{ 85},{ 8}}, {{213},{ 8}}, {{ 53},{ 8}},
+{{181},{ 8}}, {{117},{ 8}}, {{245},{ 8}}, {{ 13},{ 8}}, {{141},{ 8}},
+{{ 77},{ 8}}, {{205},{ 8}}, {{ 45},{ 8}}, {{173},{ 8}}, {{109},{ 8}},
+{{237},{ 8}}, {{ 29},{ 8}}, {{157},{ 8}}, {{ 93},{ 8}}, {{221},{ 8}},
+{{ 61},{ 8}}, {{189},{ 8}}, {{125},{ 8}}, {{253},{ 8}}, {{ 19},{ 9}},
+{{275},{ 9}}, {{147},{ 9}}, {{403},{ 9}}, {{ 83},{ 9}}, {{339},{ 9}},
+{{211},{ 9}}, {{467},{ 9}}, {{ 51},{ 9}}, {{307},{ 9}}, {{179},{ 9}},
+{{435},{ 9}}, {{115},{ 9}}, {{371},{ 9}}, {{243},{ 9}}, {{499},{ 9}},
+{{ 11},{ 9}}, {{267},{ 9}}, {{139},{ 9}}, {{395},{ 9}}, {{ 75},{ 9}},
+{{331},{ 9}}, {{203},{ 9}}, {{459},{ 9}}, {{ 43},{ 9}}, {{299},{ 9}},
+{{171},{ 9}}, {{427},{ 9}}, {{107},{ 9}}, {{363},{ 9}}, {{235},{ 9}},
+{{491},{ 9}}, {{ 27},{ 9}}, {{283},{ 9}}, {{155},{ 9}}, {{411},{ 9}},
+{{ 91},{ 9}}, {{347},{ 9}}, {{219},{ 9}}, {{475},{ 9}}, {{ 59},{ 9}},
+{{315},{ 9}}, {{187},{ 9}}, {{443},{ 9}}, {{123},{ 9}}, {{379},{ 9}},
+{{251},{ 9}}, {{507},{ 9}}, {{ 7},{ 9}}, {{263},{ 9}}, {{135},{ 9}},
+{{391},{ 9}}, {{ 71},{ 9}}, {{327},{ 9}}, {{199},{ 9}}, {{455},{ 9}},
+{{ 39},{ 9}}, {{295},{ 9}}, {{167},{ 9}}, {{423},{ 9}}, {{103},{ 9}},
+{{359},{ 9}}, {{231},{ 9}}, {{487},{ 9}}, {{ 23},{ 9}}, {{279},{ 9}},
+{{151},{ 9}}, {{407},{ 9}}, {{ 87},{ 9}}, {{343},{ 9}}, {{215},{ 9}},
+{{471},{ 9}}, {{ 55},{ 9}}, {{311},{ 9}}, {{183},{ 9}}, {{439},{ 9}},
+{{119},{ 9}}, {{375},{ 9}}, {{247},{ 9}}, {{503},{ 9}}, {{ 15},{ 9}},
+{{271},{ 9}}, {{143},{ 9}}, {{399},{ 9}}, {{ 79},{ 9}}, {{335},{ 9}},
+{{207},{ 9}}, {{463},{ 9}}, {{ 47},{ 9}}, {{303},{ 9}}, {{175},{ 9}},
+{{431},{ 9}}, {{111},{ 9}}, {{367},{ 9}}, {{239},{ 9}}, {{495},{ 9}},
+{{ 31},{ 9}}, {{287},{ 9}}, {{159},{ 9}}, {{415},{ 9}}, {{ 95},{ 9}},
+{{351},{ 9}}, {{223},{ 9}}, {{479},{ 9}}, {{ 63},{ 9}}, {{319},{ 9}},
+{{191},{ 9}}, {{447},{ 9}}, {{127},{ 9}}, {{383},{ 9}}, {{255},{ 9}},
+{{511},{ 9}}, {{ 0},{ 7}}, {{ 64},{ 7}}, {{ 32},{ 7}}, {{ 96},{ 7}},
+{{ 16},{ 7}}, {{ 80},{ 7}}, {{ 48},{ 7}}, {{112},{ 7}}, {{ 8},{ 7}},
+{{ 72},{ 7}}, {{ 40},{ 7}}, {{104},{ 7}}, {{ 24},{ 7}}, {{ 88},{ 7}},
+{{ 56},{ 7}}, {{120},{ 7}}, {{ 4},{ 7}}, {{ 68},{ 7}}, {{ 36},{ 7}},
+{{100},{ 7}}, {{ 20},{ 7}}, {{ 84},{ 7}}, {{ 52},{ 7}}, {{116},{ 7}},
+{{ 3},{ 8}}, {{131},{ 8}}, {{ 67},{ 8}}, {{195},{ 8}}, {{ 35},{ 8}},
+{{163},{ 8}}, {{ 99},{ 8}}, {{227},{ 8}}
+};
+
+local const ct_data static_dtree[D_CODES] = {
+{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}},
+{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}},
+{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}},
+{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}},
+{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}},
+{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}}
+};
+
+const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = {
+ 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8,
+ 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10,
+10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13,
+13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,
+15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17,
+18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22,
+23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27,
+27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29
+};
+
+const uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12,
+13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
+17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,
+19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22,
+22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23,
+23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26,
+26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28
+};
+
+local const int base_length[LENGTH_CODES] = {
+0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56,
+64, 80, 96, 112, 128, 160, 192, 224, 0
+};
+
+local const int base_dist[D_CODES] = {
+ 0, 1, 2, 3, 4, 6, 8, 12, 16, 24,
+ 32, 48, 64, 96, 128, 192, 256, 384, 512, 768,
+ 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576
+};
+
diff --git a/protocols/Telegram/tgl/zlib/uncompr.c b/protocols/Telegram/tgl/zlib/uncompr.c
new file mode 100644
index 0000000000..242e9493df
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/uncompr.c
@@ -0,0 +1,59 @@
+/* uncompr.c -- decompress a memory buffer
+ * Copyright (C) 1995-2003, 2010 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#define ZLIB_INTERNAL
+#include "zlib.h"
+
+/* ===========================================================================
+ Decompresses the source buffer into the destination buffer. sourceLen is
+ the byte length of the source buffer. Upon entry, destLen is the total
+ size of the destination buffer, which must be large enough to hold the
+ entire uncompressed data. (The size of the uncompressed data must have
+ been saved previously by the compressor and transmitted to the decompressor
+ by some mechanism outside the scope of this compression library.)
+ Upon exit, destLen is the actual size of the compressed buffer.
+
+ uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if there was not enough room in the output
+ buffer, or Z_DATA_ERROR if the input data was corrupted.
+*/
+int ZEXPORT uncompress (dest, destLen, source, sourceLen)
+ Bytef *dest;
+ uLongf *destLen;
+ const Bytef *source;
+ uLong sourceLen;
+{
+ z_stream stream;
+ int err;
+
+ stream.next_in = (z_const Bytef *)source;
+ stream.avail_in = (uInt)sourceLen;
+ /* Check for source > 64K on 16-bit machine: */
+ if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
+
+ stream.next_out = dest;
+ stream.avail_out = (uInt)*destLen;
+ if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
+
+ stream.zalloc = (alloc_func)0;
+ stream.zfree = (free_func)0;
+
+ err = inflateInit(&stream);
+ if (err != Z_OK) return err;
+
+ err = inflate(&stream, Z_FINISH);
+ if (err != Z_STREAM_END) {
+ inflateEnd(&stream);
+ if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0))
+ return Z_DATA_ERROR;
+ return err;
+ }
+ *destLen = stream.total_out;
+
+ err = inflateEnd(&stream);
+ return err;
+}
diff --git a/protocols/Telegram/tgl/zlib/watcom/watcom_f.mak b/protocols/Telegram/tgl/zlib/watcom/watcom_f.mak
new file mode 100644
index 0000000000..37f4d74c19
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/watcom/watcom_f.mak
@@ -0,0 +1,43 @@
+# Makefile for zlib
+# OpenWatcom flat model
+# Last updated: 28-Dec-2005
+
+# To use, do "wmake -f watcom_f.mak"
+
+C_SOURCE = adler32.c compress.c crc32.c deflate.c &
+ gzclose.c gzlib.c gzread.c gzwrite.c &
+ infback.c inffast.c inflate.c inftrees.c &
+ trees.c uncompr.c zutil.c
+
+OBJS = adler32.obj compress.obj crc32.obj deflate.obj &
+ gzclose.obj gzlib.obj gzread.obj gzwrite.obj &
+ infback.obj inffast.obj inflate.obj inftrees.obj &
+ trees.obj uncompr.obj zutil.obj
+
+CC = wcc386
+LINKER = wcl386
+CFLAGS = -zq -mf -3r -fp3 -s -bt=dos -oilrtfm -fr=nul -wx
+ZLIB_LIB = zlib_f.lib
+
+.C.OBJ:
+ $(CC) $(CFLAGS) $[@
+
+all: $(ZLIB_LIB) example.exe minigzip.exe
+
+$(ZLIB_LIB): $(OBJS)
+ wlib -b -c $(ZLIB_LIB) -+adler32.obj -+compress.obj -+crc32.obj
+ wlib -b -c $(ZLIB_LIB) -+gzclose.obj -+gzlib.obj -+gzread.obj -+gzwrite.obj
+ wlib -b -c $(ZLIB_LIB) -+deflate.obj -+infback.obj
+ wlib -b -c $(ZLIB_LIB) -+inffast.obj -+inflate.obj -+inftrees.obj
+ wlib -b -c $(ZLIB_LIB) -+trees.obj -+uncompr.obj -+zutil.obj
+
+example.exe: $(ZLIB_LIB) example.obj
+ $(LINKER) -ldos32a -fe=example.exe example.obj $(ZLIB_LIB)
+
+minigzip.exe: $(ZLIB_LIB) minigzip.obj
+ $(LINKER) -ldos32a -fe=minigzip.exe minigzip.obj $(ZLIB_LIB)
+
+clean: .SYMBOLIC
+ del *.obj
+ del $(ZLIB_LIB)
+ @echo Cleaning done
diff --git a/protocols/Telegram/tgl/zlib/watcom/watcom_l.mak b/protocols/Telegram/tgl/zlib/watcom/watcom_l.mak
new file mode 100644
index 0000000000..193eed7b31
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/watcom/watcom_l.mak
@@ -0,0 +1,43 @@
+# Makefile for zlib
+# OpenWatcom large model
+# Last updated: 28-Dec-2005
+
+# To use, do "wmake -f watcom_l.mak"
+
+C_SOURCE = adler32.c compress.c crc32.c deflate.c &
+ gzclose.c gzlib.c gzread.c gzwrite.c &
+ infback.c inffast.c inflate.c inftrees.c &
+ trees.c uncompr.c zutil.c
+
+OBJS = adler32.obj compress.obj crc32.obj deflate.obj &
+ gzclose.obj gzlib.obj gzread.obj gzwrite.obj &
+ infback.obj inffast.obj inflate.obj inftrees.obj &
+ trees.obj uncompr.obj zutil.obj
+
+CC = wcc
+LINKER = wcl
+CFLAGS = -zq -ml -s -bt=dos -oilrtfm -fr=nul -wx
+ZLIB_LIB = zlib_l.lib
+
+.C.OBJ:
+ $(CC) $(CFLAGS) $[@
+
+all: $(ZLIB_LIB) example.exe minigzip.exe
+
+$(ZLIB_LIB): $(OBJS)
+ wlib -b -c $(ZLIB_LIB) -+adler32.obj -+compress.obj -+crc32.obj
+ wlib -b -c $(ZLIB_LIB) -+gzclose.obj -+gzlib.obj -+gzread.obj -+gzwrite.obj
+ wlib -b -c $(ZLIB_LIB) -+deflate.obj -+infback.obj
+ wlib -b -c $(ZLIB_LIB) -+inffast.obj -+inflate.obj -+inftrees.obj
+ wlib -b -c $(ZLIB_LIB) -+trees.obj -+uncompr.obj -+zutil.obj
+
+example.exe: $(ZLIB_LIB) example.obj
+ $(LINKER) -fe=example.exe example.obj $(ZLIB_LIB)
+
+minigzip.exe: $(ZLIB_LIB) minigzip.obj
+ $(LINKER) -fe=minigzip.exe minigzip.obj $(ZLIB_LIB)
+
+clean: .SYMBOLIC
+ del *.obj
+ del $(ZLIB_LIB)
+ @echo Cleaning done
diff --git a/protocols/Telegram/tgl/zlib/win32/DLL_FAQ.txt b/protocols/Telegram/tgl/zlib/win32/DLL_FAQ.txt
new file mode 100644
index 0000000000..12c009018c
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/win32/DLL_FAQ.txt
@@ -0,0 +1,397 @@
+
+ Frequently Asked Questions about ZLIB1.DLL
+
+
+This document describes the design, the rationale, and the usage
+of the official DLL build of zlib, named ZLIB1.DLL. If you have
+general questions about zlib, you should see the file "FAQ" found
+in the zlib distribution, or at the following location:
+ http://www.gzip.org/zlib/zlib_faq.html
+
+
+ 1. What is ZLIB1.DLL, and how can I get it?
+
+ - ZLIB1.DLL is the official build of zlib as a DLL.
+ (Please remark the character '1' in the name.)
+
+ Pointers to a precompiled ZLIB1.DLL can be found in the zlib
+ web site at:
+ http://www.zlib.net/
+
+ Applications that link to ZLIB1.DLL can rely on the following
+ specification:
+
+ * The exported symbols are exclusively defined in the source
+ files "zlib.h" and "zlib.def", found in an official zlib
+ source distribution.
+ * The symbols are exported by name, not by ordinal.
+ * The exported names are undecorated.
+ * The calling convention of functions is "C" (CDECL).
+ * The ZLIB1.DLL binary is linked to MSVCRT.DLL.
+
+ The archive in which ZLIB1.DLL is bundled contains compiled
+ test programs that must run with a valid build of ZLIB1.DLL.
+ It is recommended to download the prebuilt DLL from the zlib
+ web site, instead of building it yourself, to avoid potential
+ incompatibilities that could be introduced by your compiler
+ and build settings. If you do build the DLL yourself, please
+ make sure that it complies with all the above requirements,
+ and it runs with the precompiled test programs, bundled with
+ the original ZLIB1.DLL distribution.
+
+ If, for any reason, you need to build an incompatible DLL,
+ please use a different file name.
+
+
+ 2. Why did you change the name of the DLL to ZLIB1.DLL?
+ What happened to the old ZLIB.DLL?
+
+ - The old ZLIB.DLL, built from zlib-1.1.4 or earlier, required
+ compilation settings that were incompatible to those used by
+ a static build. The DLL settings were supposed to be enabled
+ by defining the macro ZLIB_DLL, before including "zlib.h".
+ Incorrect handling of this macro was silently accepted at
+ build time, resulting in two major problems:
+
+ * ZLIB_DLL was missing from the old makefile. When building
+ the DLL, not all people added it to the build options. In
+ consequence, incompatible incarnations of ZLIB.DLL started
+ to circulate around the net.
+
+ * When switching from using the static library to using the
+ DLL, applications had to define the ZLIB_DLL macro and
+ to recompile all the sources that contained calls to zlib
+ functions. Failure to do so resulted in creating binaries
+ that were unable to run with the official ZLIB.DLL build.
+
+ The only possible solution that we could foresee was to make
+ a binary-incompatible change in the DLL interface, in order to
+ remove the dependency on the ZLIB_DLL macro, and to release
+ the new DLL under a different name.
+
+ We chose the name ZLIB1.DLL, where '1' indicates the major
+ zlib version number. We hope that we will not have to break
+ the binary compatibility again, at least not as long as the
+ zlib-1.x series will last.
+
+ There is still a ZLIB_DLL macro, that can trigger a more
+ efficient build and use of the DLL, but compatibility no
+ longer dependents on it.
+
+
+ 3. Can I build ZLIB.DLL from the new zlib sources, and replace
+ an old ZLIB.DLL, that was built from zlib-1.1.4 or earlier?
+
+ - In principle, you can do it by assigning calling convention
+ keywords to the macros ZEXPORT and ZEXPORTVA. In practice,
+ it depends on what you mean by "an old ZLIB.DLL", because the
+ old DLL exists in several mutually-incompatible versions.
+ You have to find out first what kind of calling convention is
+ being used in your particular ZLIB.DLL build, and to use the
+ same one in the new build. If you don't know what this is all
+ about, you might be better off if you would just leave the old
+ DLL intact.
+
+
+ 4. Can I compile my application using the new zlib interface, and
+ link it to an old ZLIB.DLL, that was built from zlib-1.1.4 or
+ earlier?
+
+ - The official answer is "no"; the real answer depends again on
+ what kind of ZLIB.DLL you have. Even if you are lucky, this
+ course of action is unreliable.
+
+ If you rebuild your application and you intend to use a newer
+ version of zlib (post- 1.1.4), it is strongly recommended to
+ link it to the new ZLIB1.DLL.
+
+
+ 5. Why are the zlib symbols exported by name, and not by ordinal?
+
+ - Although exporting symbols by ordinal is a little faster, it
+ is risky. Any single glitch in the maintenance or use of the
+ DEF file that contains the ordinals can result in incompatible
+ builds and frustrating crashes. Simply put, the benefits of
+ exporting symbols by ordinal do not justify the risks.
+
+ Technically, it should be possible to maintain ordinals in
+ the DEF file, and still export the symbols by name. Ordinals
+ exist in every DLL, and even if the dynamic linking performed
+ at the DLL startup is searching for names, ordinals serve as
+ hints, for a faster name lookup. However, if the DEF file
+ contains ordinals, the Microsoft linker automatically builds
+ an implib that will cause the executables linked to it to use
+ those ordinals, and not the names. It is interesting to
+ notice that the GNU linker for Win32 does not suffer from this
+ problem.
+
+ It is possible to avoid the DEF file if the exported symbols
+ are accompanied by a "__declspec(dllexport)" attribute in the
+ source files. You can do this in zlib by predefining the
+ ZLIB_DLL macro.
+
+
+ 6. I see that the ZLIB1.DLL functions use the "C" (CDECL) calling
+ convention. Why not use the STDCALL convention?
+ STDCALL is the standard convention in Win32, and I need it in
+ my Visual Basic project!
+
+ (For readability, we use CDECL to refer to the convention
+ triggered by the "__cdecl" keyword, STDCALL to refer to
+ the convention triggered by "__stdcall", and FASTCALL to
+ refer to the convention triggered by "__fastcall".)
+
+ - Most of the native Windows API functions (without varargs) use
+ indeed the WINAPI convention (which translates to STDCALL in
+ Win32), but the standard C functions use CDECL. If a user
+ application is intrinsically tied to the Windows API (e.g.
+ it calls native Windows API functions such as CreateFile()),
+ sometimes it makes sense to decorate its own functions with
+ WINAPI. But if ANSI C or POSIX portability is a goal (e.g.
+ it calls standard C functions such as fopen()), it is not a
+ sound decision to request the inclusion of <windows.h>, or to
+ use non-ANSI constructs, for the sole purpose to make the user
+ functions STDCALL-able.
+
+ The functionality offered by zlib is not in the category of
+ "Windows functionality", but is more like "C functionality".
+
+ Technically, STDCALL is not bad; in fact, it is slightly
+ faster than CDECL, and it works with variable-argument
+ functions, just like CDECL. It is unfortunate that, in spite
+ of using STDCALL in the Windows API, it is not the default
+ convention used by the C compilers that run under Windows.
+ The roots of the problem reside deep inside the unsafety of
+ the K&R-style function prototypes, where the argument types
+ are not specified; but that is another story for another day.
+
+ The remaining fact is that CDECL is the default convention.
+ Even if an explicit convention is hard-coded into the function
+ prototypes inside C headers, problems may appear. The
+ necessity to expose the convention in users' callbacks is one
+ of these problems.
+
+ The calling convention issues are also important when using
+ zlib in other programming languages. Some of them, like Ada
+ (GNAT) and Fortran (GNU G77), have C bindings implemented
+ initially on Unix, and relying on the C calling convention.
+ On the other hand, the pre- .NET versions of Microsoft Visual
+ Basic require STDCALL, while Borland Delphi prefers, although
+ it does not require, FASTCALL.
+
+ In fairness to all possible uses of zlib outside the C
+ programming language, we choose the default "C" convention.
+ Anyone interested in different bindings or conventions is
+ encouraged to maintain specialized projects. The "contrib/"
+ directory from the zlib distribution already holds a couple
+ of foreign bindings, such as Ada, C++, and Delphi.
+
+
+ 7. I need a DLL for my Visual Basic project. What can I do?
+
+ - Define the ZLIB_WINAPI macro before including "zlib.h", when
+ building both the DLL and the user application (except that
+ you don't need to define anything when using the DLL in Visual
+ Basic). The ZLIB_WINAPI macro will switch on the WINAPI
+ (STDCALL) convention. The name of this DLL must be different
+ than the official ZLIB1.DLL.
+
+ Gilles Vollant has contributed a build named ZLIBWAPI.DLL,
+ with the ZLIB_WINAPI macro turned on, and with the minizip
+ functionality built in. For more information, please read
+ the notes inside "contrib/vstudio/readme.txt", found in the
+ zlib distribution.
+
+
+ 8. I need to use zlib in my Microsoft .NET project. What can I
+ do?
+
+ - Henrik Ravn has contributed a .NET wrapper around zlib. Look
+ into contrib/dotzlib/, inside the zlib distribution.
+
+
+ 9. If my application uses ZLIB1.DLL, should I link it to
+ MSVCRT.DLL? Why?
+
+ - It is not required, but it is recommended to link your
+ application to MSVCRT.DLL, if it uses ZLIB1.DLL.
+
+ The executables (.EXE, .DLL, etc.) that are involved in the
+ same process and are using the C run-time library (i.e. they
+ are calling standard C functions), must link to the same
+ library. There are several libraries in the Win32 system:
+ CRTDLL.DLL, MSVCRT.DLL, the static C libraries, etc.
+ Since ZLIB1.DLL is linked to MSVCRT.DLL, the executables that
+ depend on it should also be linked to MSVCRT.DLL.
+
+
+10. Why are you saying that ZLIB1.DLL and my application should
+ be linked to the same C run-time (CRT) library? I linked my
+ application and my DLLs to different C libraries (e.g. my
+ application to a static library, and my DLLs to MSVCRT.DLL),
+ and everything works fine.
+
+ - If a user library invokes only pure Win32 API (accessible via
+ <windows.h> and the related headers), its DLL build will work
+ in any context. But if this library invokes standard C API,
+ things get more complicated.
+
+ There is a single Win32 library in a Win32 system. Every
+ function in this library resides in a single DLL module, that
+ is safe to call from anywhere. On the other hand, there are
+ multiple versions of the C library, and each of them has its
+ own separate internal state. Standalone executables and user
+ DLLs that call standard C functions must link to a C run-time
+ (CRT) library, be it static or shared (DLL). Intermixing
+ occurs when an executable (not necessarily standalone) and a
+ DLL are linked to different CRTs, and both are running in the
+ same process.
+
+ Intermixing multiple CRTs is possible, as long as their
+ internal states are kept intact. The Microsoft Knowledge Base
+ articles KB94248 "HOWTO: Use the C Run-Time" and KB140584
+ "HOWTO: Link with the Correct C Run-Time (CRT) Library"
+ mention the potential problems raised by intermixing.
+
+ If intermixing works for you, it's because your application
+ and DLLs are avoiding the corruption of each of the CRTs'
+ internal states, maybe by careful design, or maybe by fortune.
+
+ Also note that linking ZLIB1.DLL to non-Microsoft CRTs, such
+ as those provided by Borland, raises similar problems.
+
+
+11. Why are you linking ZLIB1.DLL to MSVCRT.DLL?
+
+ - MSVCRT.DLL exists on every Windows 95 with a new service pack
+ installed, or with Microsoft Internet Explorer 4 or later, and
+ on all other Windows 4.x or later (Windows 98, Windows NT 4,
+ or later). It is freely distributable; if not present in the
+ system, it can be downloaded from Microsoft or from other
+ software provider for free.
+
+ The fact that MSVCRT.DLL does not exist on a virgin Windows 95
+ is not so problematic. Windows 95 is scarcely found nowadays,
+ Microsoft ended its support a long time ago, and many recent
+ applications from various vendors, including Microsoft, do not
+ even run on it. Furthermore, no serious user should run
+ Windows 95 without a proper update installed.
+
+
+12. Why are you not linking ZLIB1.DLL to
+ <<my favorite C run-time library>> ?
+
+ - We considered and abandoned the following alternatives:
+
+ * Linking ZLIB1.DLL to a static C library (LIBC.LIB, or
+ LIBCMT.LIB) is not a good option. People are using the DLL
+ mainly to save disk space. If you are linking your program
+ to a static C library, you may as well consider linking zlib
+ in statically, too.
+
+ * Linking ZLIB1.DLL to CRTDLL.DLL looks appealing, because
+ CRTDLL.DLL is present on every Win32 installation.
+ Unfortunately, it has a series of problems: it does not
+ work properly with Microsoft's C++ libraries, it does not
+ provide support for 64-bit file offsets, (and so on...),
+ and Microsoft discontinued its support a long time ago.
+
+ * Linking ZLIB1.DLL to MSVCR70.DLL or MSVCR71.DLL, supplied
+ with the Microsoft .NET platform, and Visual C++ 7.0/7.1,
+ raises problems related to the status of ZLIB1.DLL as a
+ system component. According to the Microsoft Knowledge Base
+ article KB326922 "INFO: Redistribution of the Shared C
+ Runtime Component in Visual C++ .NET", MSVCR70.DLL and
+ MSVCR71.DLL are not supposed to function as system DLLs,
+ because they may clash with MSVCRT.DLL. Instead, the
+ application's installer is supposed to put these DLLs
+ (if needed) in the application's private directory.
+ If ZLIB1.DLL depends on a non-system runtime, it cannot
+ function as a redistributable system component.
+
+ * Linking ZLIB1.DLL to non-Microsoft runtimes, such as
+ Borland's, or Cygwin's, raises problems related to the
+ reliable presence of these runtimes on Win32 systems.
+ It's easier to let the DLL build of zlib up to the people
+ who distribute these runtimes, and who may proceed as
+ explained in the answer to Question 14.
+
+
+13. If ZLIB1.DLL cannot be linked to MSVCR70.DLL or MSVCR71.DLL,
+ how can I build/use ZLIB1.DLL in Microsoft Visual C++ 7.0
+ (Visual Studio .NET) or newer?
+
+ - Due to the problems explained in the Microsoft Knowledge Base
+ article KB326922 (see the previous answer), the C runtime that
+ comes with the VC7 environment is no longer considered a
+ system component. That is, it should not be assumed that this
+ runtime exists, or may be installed in a system directory.
+ Since ZLIB1.DLL is supposed to be a system component, it may
+ not depend on a non-system component.
+
+ In order to link ZLIB1.DLL and your application to MSVCRT.DLL
+ in VC7, you need the library of Visual C++ 6.0 or older. If
+ you don't have this library at hand, it's probably best not to
+ use ZLIB1.DLL.
+
+ We are hoping that, in the future, Microsoft will provide a
+ way to build applications linked to a proper system runtime,
+ from the Visual C++ environment. Until then, you have a
+ couple of alternatives, such as linking zlib in statically.
+ If your application requires dynamic linking, you may proceed
+ as explained in the answer to Question 14.
+
+
+14. I need to link my own DLL build to a CRT different than
+ MSVCRT.DLL. What can I do?
+
+ - Feel free to rebuild the DLL from the zlib sources, and link
+ it the way you want. You should, however, clearly state that
+ your build is unofficial. You should give it a different file
+ name, and/or install it in a private directory that can be
+ accessed by your application only, and is not visible to the
+ others (i.e. it's neither in the PATH, nor in the SYSTEM or
+ SYSTEM32 directories). Otherwise, your build may clash with
+ applications that link to the official build.
+
+ For example, in Cygwin, zlib is linked to the Cygwin runtime
+ CYGWIN1.DLL, and it is distributed under the name CYGZ.DLL.
+
+
+15. May I include additional pieces of code that I find useful,
+ link them in ZLIB1.DLL, and export them?
+
+ - No. A legitimate build of ZLIB1.DLL must not include code
+ that does not originate from the official zlib source code.
+ But you can make your own private DLL build, under a different
+ file name, as suggested in the previous answer.
+
+ For example, zlib is a part of the VCL library, distributed
+ with Borland Delphi and C++ Builder. The DLL build of VCL
+ is a redistributable file, named VCLxx.DLL.
+
+
+16. May I remove some functionality out of ZLIB1.DLL, by enabling
+ macros like NO_GZCOMPRESS or NO_GZIP at compile time?
+
+ - No. A legitimate build of ZLIB1.DLL must provide the complete
+ zlib functionality, as implemented in the official zlib source
+ code. But you can make your own private DLL build, under a
+ different file name, as suggested in the previous answer.
+
+
+17. I made my own ZLIB1.DLL build. Can I test it for compliance?
+
+ - We prefer that you download the official DLL from the zlib
+ web site. If you need something peculiar from this DLL, you
+ can send your suggestion to the zlib mailing list.
+
+ However, in case you do rebuild the DLL yourself, you can run
+ it with the test programs found in the DLL distribution.
+ Running these test programs is not a guarantee of compliance,
+ but a failure can imply a detected problem.
+
+**
+
+This document is written and maintained by
+Cosmin Truta <cosmint@cs.ubbcluj.ro>
diff --git a/protocols/Telegram/tgl/zlib/win32/Makefile.bor b/protocols/Telegram/tgl/zlib/win32/Makefile.bor
new file mode 100644
index 0000000000..d152bbb7ff
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/win32/Makefile.bor
@@ -0,0 +1,110 @@
+# Makefile for zlib
+# Borland C++ for Win32
+#
+# Usage:
+# make -f win32/Makefile.bor
+# make -f win32/Makefile.bor LOCAL_ZLIB=-DASMV OBJA=match.obj OBJPA=+match.obj
+
+# ------------ Borland C++ ------------
+
+# Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7)
+# should be added to the environment via "set LOCAL_ZLIB=-DFOO" or
+# added to the declaration of LOC here:
+LOC = $(LOCAL_ZLIB)
+
+CC = bcc32
+AS = bcc32
+LD = bcc32
+AR = tlib
+CFLAGS = -a -d -k- -O2 $(LOC)
+ASFLAGS = $(LOC)
+LDFLAGS = $(LOC)
+
+
+# variables
+ZLIB_LIB = zlib.lib
+
+OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj
+OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj
+#OBJA =
+OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj
+OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj
+#OBJPA=
+
+
+# targets
+all: $(ZLIB_LIB) example.exe minigzip.exe
+
+.c.obj:
+ $(CC) -c $(CFLAGS) $<
+
+.asm.obj:
+ $(AS) -c $(ASFLAGS) $<
+
+adler32.obj: adler32.c zlib.h zconf.h
+
+compress.obj: compress.c zlib.h zconf.h
+
+crc32.obj: crc32.c zlib.h zconf.h crc32.h
+
+deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
+
+gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h
+
+gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h
+
+gzread.obj: gzread.c zlib.h zconf.h gzguts.h
+
+gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h
+
+infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
+ inffast.h inffixed.h
+
+inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
+ inffast.h
+
+inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
+ inffast.h inffixed.h
+
+inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
+
+trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h
+
+uncompr.obj: uncompr.c zlib.h zconf.h
+
+zutil.obj: zutil.c zutil.h zlib.h zconf.h
+
+example.obj: test/example.c zlib.h zconf.h
+
+minigzip.obj: test/minigzip.c zlib.h zconf.h
+
+
+# For the sake of the old Borland make,
+# the command line is cut to fit in the MS-DOS 128 byte limit:
+$(ZLIB_LIB): $(OBJ1) $(OBJ2) $(OBJA)
+ -del $(ZLIB_LIB)
+ $(AR) $(ZLIB_LIB) $(OBJP1)
+ $(AR) $(ZLIB_LIB) $(OBJP2)
+ $(AR) $(ZLIB_LIB) $(OBJPA)
+
+
+# testing
+test: example.exe minigzip.exe
+ example
+ echo hello world | minigzip | minigzip -d
+
+example.exe: example.obj $(ZLIB_LIB)
+ $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB)
+
+minigzip.exe: minigzip.obj $(ZLIB_LIB)
+ $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB)
+
+
+# cleanup
+clean:
+ -del $(ZLIB_LIB)
+ -del *.obj
+ -del *.exe
+ -del *.tds
+ -del zlib.bak
+ -del foo.gz
diff --git a/protocols/Telegram/tgl/zlib/win32/Makefile.gcc b/protocols/Telegram/tgl/zlib/win32/Makefile.gcc
new file mode 100644
index 0000000000..6d1ded622b
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/win32/Makefile.gcc
@@ -0,0 +1,182 @@
+# Makefile for zlib, derived from Makefile.dj2.
+# Modified for mingw32 by C. Spieler, 6/16/98.
+# Updated for zlib 1.2.x by Christian Spieler and Cosmin Truta, Mar-2003.
+# Last updated: Mar 2012.
+# Tested under Cygwin and MinGW.
+
+# Copyright (C) 1995-2003 Jean-loup Gailly.
+# For conditions of distribution and use, see copyright notice in zlib.h
+
+# To compile, or to compile and test, type from the top level zlib directory:
+#
+# make -fwin32/Makefile.gcc; make test testdll -fwin32/Makefile.gcc
+#
+# To use the asm code, type:
+# cp contrib/asm?86/match.S ./match.S
+# make LOC=-DASMV OBJA=match.o -fwin32/Makefile.gcc
+#
+# To install libz.a, zconf.h and zlib.h in the system directories, type:
+#
+# make install -fwin32/Makefile.gcc
+#
+# BINARY_PATH, INCLUDE_PATH and LIBRARY_PATH must be set.
+#
+# To install the shared lib, append SHARED_MODE=1 to the make command :
+#
+# make install -fwin32/Makefile.gcc SHARED_MODE=1
+
+# Note:
+# If the platform is *not* MinGW (e.g. it is Cygwin or UWIN),
+# the DLL name should be changed from "zlib1.dll".
+
+STATICLIB = libz.a
+SHAREDLIB = zlib1.dll
+IMPLIB = libz.dll.a
+
+#
+# Set to 1 if shared object needs to be installed
+#
+SHARED_MODE=0
+
+#LOC = -DASMV
+#LOC = -DDEBUG -g
+
+PREFIX =
+CC = $(PREFIX)gcc
+CFLAGS = $(LOC) -O3 -Wall
+
+AS = $(CC)
+ASFLAGS = $(LOC) -Wall
+
+LD = $(CC)
+LDFLAGS = $(LOC)
+
+AR = $(PREFIX)ar
+ARFLAGS = rcs
+
+RC = $(PREFIX)windres
+RCFLAGS = --define GCC_WINDRES
+
+STRIP = $(PREFIX)strip
+
+CP = cp -fp
+# If GNU install is available, replace $(CP) with install.
+INSTALL = $(CP)
+RM = rm -f
+
+prefix ?= /usr/local
+exec_prefix = $(prefix)
+
+OBJS = adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o \
+ gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o
+OBJA =
+
+all: $(STATICLIB) $(SHAREDLIB) $(IMPLIB) example.exe minigzip.exe example_d.exe minigzip_d.exe
+
+test: example.exe minigzip.exe
+ ./example
+ echo hello world | ./minigzip | ./minigzip -d
+
+testdll: example_d.exe minigzip_d.exe
+ ./example_d
+ echo hello world | ./minigzip_d | ./minigzip_d -d
+
+.c.o:
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+.S.o:
+ $(AS) $(ASFLAGS) -c -o $@ $<
+
+$(STATICLIB): $(OBJS) $(OBJA)
+ $(AR) $(ARFLAGS) $@ $(OBJS) $(OBJA)
+
+$(IMPLIB): $(SHAREDLIB)
+
+$(SHAREDLIB): win32/zlib.def $(OBJS) $(OBJA) zlibrc.o
+ $(CC) -shared -Wl,--out-implib,$(IMPLIB) $(LDFLAGS) \
+ -o $@ win32/zlib.def $(OBJS) $(OBJA) zlibrc.o
+ $(STRIP) $@
+
+example.exe: example.o $(STATICLIB)
+ $(LD) $(LDFLAGS) -o $@ example.o $(STATICLIB)
+ $(STRIP) $@
+
+minigzip.exe: minigzip.o $(STATICLIB)
+ $(LD) $(LDFLAGS) -o $@ minigzip.o $(STATICLIB)
+ $(STRIP) $@
+
+example_d.exe: example.o $(IMPLIB)
+ $(LD) $(LDFLAGS) -o $@ example.o $(IMPLIB)
+ $(STRIP) $@
+
+minigzip_d.exe: minigzip.o $(IMPLIB)
+ $(LD) $(LDFLAGS) -o $@ minigzip.o $(IMPLIB)
+ $(STRIP) $@
+
+example.o: test/example.c zlib.h zconf.h
+ $(CC) $(CFLAGS) -I. -c -o $@ test/example.c
+
+minigzip.o: test/minigzip.c zlib.h zconf.h
+ $(CC) $(CFLAGS) -I. -c -o $@ test/minigzip.c
+
+zlibrc.o: win32/zlib1.rc
+ $(RC) $(RCFLAGS) -o $@ win32/zlib1.rc
+
+.PHONY: install uninstall clean
+
+install: zlib.h zconf.h $(STATICLIB) $(IMPLIB)
+ @if test -z "$(DESTDIR)$(INCLUDE_PATH)" -o -z "$(DESTDIR)$(LIBRARY_PATH)" -o -z "$(DESTDIR)$(BINARY_PATH)"; then \
+ echo INCLUDE_PATH, LIBRARY_PATH, and BINARY_PATH must be specified; \
+ exit 1; \
+ fi
+ -@mkdir -p '$(DESTDIR)$(INCLUDE_PATH)'
+ -@mkdir -p '$(DESTDIR)$(LIBRARY_PATH)' '$(DESTDIR)$(LIBRARY_PATH)'/pkgconfig
+ -if [ "$(SHARED_MODE)" = "1" ]; then \
+ mkdir -p '$(DESTDIR)$(BINARY_PATH)'; \
+ $(INSTALL) $(SHAREDLIB) '$(DESTDIR)$(BINARY_PATH)'; \
+ $(INSTALL) $(IMPLIB) '$(DESTDIR)$(LIBRARY_PATH)'; \
+ fi
+ -$(INSTALL) zlib.h '$(DESTDIR)$(INCLUDE_PATH)'
+ -$(INSTALL) zconf.h '$(DESTDIR)$(INCLUDE_PATH)'
+ -$(INSTALL) $(STATICLIB) '$(DESTDIR)$(LIBRARY_PATH)'
+ sed \
+ -e 's|@prefix@|${prefix}|g' \
+ -e 's|@exec_prefix@|${exec_prefix}|g' \
+ -e 's|@libdir@|$(LIBRARY_PATH)|g' \
+ -e 's|@sharedlibdir@|$(LIBRARY_PATH)|g' \
+ -e 's|@includedir@|$(INCLUDE_PATH)|g' \
+ -e 's|@VERSION@|'`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' zlib.h`'|g' \
+ zlib.pc.in > '$(DESTDIR)$(LIBRARY_PATH)'/pkgconfig/zlib.pc
+
+uninstall:
+ -if [ "$(SHARED_MODE)" = "1" ]; then \
+ $(RM) '$(DESTDIR)$(BINARY_PATH)'/$(SHAREDLIB); \
+ $(RM) '$(DESTDIR)$(LIBRARY_PATH)'/$(IMPLIB); \
+ fi
+ -$(RM) '$(DESTDIR)$(INCLUDE_PATH)'/zlib.h
+ -$(RM) '$(DESTDIR)$(INCLUDE_PATH)'/zconf.h
+ -$(RM) '$(DESTDIR)$(LIBRARY_PATH)'/$(STATICLIB)
+
+clean:
+ -$(RM) $(STATICLIB)
+ -$(RM) $(SHAREDLIB)
+ -$(RM) $(IMPLIB)
+ -$(RM) *.o
+ -$(RM) *.exe
+ -$(RM) foo.gz
+
+adler32.o: zlib.h zconf.h
+compress.o: zlib.h zconf.h
+crc32.o: crc32.h zlib.h zconf.h
+deflate.o: deflate.h zutil.h zlib.h zconf.h
+gzclose.o: zlib.h zconf.h gzguts.h
+gzlib.o: zlib.h zconf.h gzguts.h
+gzread.o: zlib.h zconf.h gzguts.h
+gzwrite.o: zlib.h zconf.h gzguts.h
+inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
+inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
+infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
+inftrees.o: zutil.h zlib.h zconf.h inftrees.h
+trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
+uncompr.o: zlib.h zconf.h
+zutil.o: zutil.h zlib.h zconf.h
diff --git a/protocols/Telegram/tgl/zlib/win32/Makefile.msc b/protocols/Telegram/tgl/zlib/win32/Makefile.msc
new file mode 100644
index 0000000000..67b773171d
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/win32/Makefile.msc
@@ -0,0 +1,163 @@
+# Makefile for zlib using Microsoft (Visual) C
+# zlib is copyright (C) 1995-2006 Jean-loup Gailly and Mark Adler
+#
+# Usage:
+# nmake -f win32/Makefile.msc (standard build)
+# nmake -f win32/Makefile.msc LOC=-DFOO (nonstandard build)
+# nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF" \
+# OBJA="inffas32.obj match686.obj" (use ASM code, x86)
+# nmake -f win32/Makefile.msc AS=ml64 LOC="-DASMV -DASMINF -I." \
+# OBJA="inffasx64.obj gvmat64.obj inffas8664.obj" (use ASM code, x64)
+
+# The toplevel directory of the source tree.
+#
+TOP = .
+
+# optional build flags
+LOC =
+
+# variables
+STATICLIB = zlib.lib
+SHAREDLIB = zlib1.dll
+IMPLIB = zdll.lib
+
+CC = cl
+AS = ml
+LD = link
+AR = lib
+RC = rc
+CFLAGS = -nologo -MD -W3 -O2 -Oy- -Zi -Fd"zlib" $(LOC)
+WFLAGS = -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
+ASFLAGS = -coff -Zi $(LOC)
+LDFLAGS = -nologo -debug -incremental:no -opt:ref
+ARFLAGS = -nologo
+RCFLAGS = /dWIN32 /r
+
+OBJS = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj \
+ gzwrite.obj infback.obj inflate.obj inftrees.obj inffast.obj trees.obj uncompr.obj zutil.obj
+OBJA =
+
+
+# targets
+all: $(STATICLIB) $(SHAREDLIB) $(IMPLIB) \
+ example.exe minigzip.exe example_d.exe minigzip_d.exe
+
+$(STATICLIB): $(OBJS) $(OBJA)
+ $(AR) $(ARFLAGS) -out:$@ $(OBJS) $(OBJA)
+
+$(IMPLIB): $(SHAREDLIB)
+
+$(SHAREDLIB): $(TOP)/win32/zlib.def $(OBJS) $(OBJA) zlib1.res
+ $(LD) $(LDFLAGS) -def:$(TOP)/win32/zlib.def -dll -implib:$(IMPLIB) \
+ -out:$@ -base:0x5A4C0000 $(OBJS) $(OBJA) zlib1.res
+ if exist $@.manifest \
+ mt -nologo -manifest $@.manifest -outputresource:$@;2
+
+example.exe: example.obj $(STATICLIB)
+ $(LD) $(LDFLAGS) example.obj $(STATICLIB)
+ if exist $@.manifest \
+ mt -nologo -manifest $@.manifest -outputresource:$@;1
+
+minigzip.exe: minigzip.obj $(STATICLIB)
+ $(LD) $(LDFLAGS) minigzip.obj $(STATICLIB)
+ if exist $@.manifest \
+ mt -nologo -manifest $@.manifest -outputresource:$@;1
+
+example_d.exe: example.obj $(IMPLIB)
+ $(LD) $(LDFLAGS) -out:$@ example.obj $(IMPLIB)
+ if exist $@.manifest \
+ mt -nologo -manifest $@.manifest -outputresource:$@;1
+
+minigzip_d.exe: minigzip.obj $(IMPLIB)
+ $(LD) $(LDFLAGS) -out:$@ minigzip.obj $(IMPLIB)
+ if exist $@.manifest \
+ mt -nologo -manifest $@.manifest -outputresource:$@;1
+
+{$(TOP)}.c.obj:
+ $(CC) -c $(WFLAGS) $(CFLAGS) $<
+
+{$(TOP)/test}.c.obj:
+ $(CC) -c -I$(TOP) $(WFLAGS) $(CFLAGS) $<
+
+{$(TOP)/contrib/masmx64}.c.obj:
+ $(CC) -c $(WFLAGS) $(CFLAGS) $<
+
+{$(TOP)/contrib/masmx64}.asm.obj:
+ $(AS) -c $(ASFLAGS) $<
+
+{$(TOP)/contrib/masmx86}.asm.obj:
+ $(AS) -c $(ASFLAGS) $<
+
+adler32.obj: $(TOP)/adler32.c $(TOP)/zlib.h $(TOP)/zconf.h
+
+compress.obj: $(TOP)/compress.c $(TOP)/zlib.h $(TOP)/zconf.h
+
+crc32.obj: $(TOP)/crc32.c $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/crc32.h
+
+deflate.obj: $(TOP)/deflate.c $(TOP)/deflate.h $(TOP)/zutil.h $(TOP)/zlib.h $(TOP)/zconf.h
+
+gzclose.obj: $(TOP)/gzclose.c $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/gzguts.h
+
+gzlib.obj: $(TOP)/gzlib.c $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/gzguts.h
+
+gzread.obj: $(TOP)/gzread.c $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/gzguts.h
+
+gzwrite.obj: $(TOP)/gzwrite.c $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/gzguts.h
+
+infback.obj: $(TOP)/infback.c $(TOP)/zutil.h $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/inftrees.h $(TOP)/inflate.h \
+ $(TOP)/inffast.h $(TOP)/inffixed.h
+
+inffast.obj: $(TOP)/inffast.c $(TOP)/zutil.h $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/inftrees.h $(TOP)/inflate.h \
+ $(TOP)/inffast.h
+
+inflate.obj: $(TOP)/inflate.c $(TOP)/zutil.h $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/inftrees.h $(TOP)/inflate.h \
+ $(TOP)/inffast.h $(TOP)/inffixed.h
+
+inftrees.obj: $(TOP)/inftrees.c $(TOP)/zutil.h $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/inftrees.h
+
+trees.obj: $(TOP)/trees.c $(TOP)/zutil.h $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/deflate.h $(TOP)/trees.h
+
+uncompr.obj: $(TOP)/uncompr.c $(TOP)/zlib.h $(TOP)/zconf.h
+
+zutil.obj: $(TOP)/zutil.c $(TOP)/zutil.h $(TOP)/zlib.h $(TOP)/zconf.h
+
+gvmat64.obj: $(TOP)/contrib\masmx64\gvmat64.asm
+
+inffasx64.obj: $(TOP)/contrib\masmx64\inffasx64.asm
+
+inffas8664.obj: $(TOP)/contrib\masmx64\inffas8664.c $(TOP)/zutil.h $(TOP)/zlib.h $(TOP)/zconf.h \
+ $(TOP)/inftrees.h $(TOP)/inflate.h $(TOP)/inffast.h
+
+inffas32.obj: $(TOP)/contrib\masmx86\inffas32.asm
+
+match686.obj: $(TOP)/contrib\masmx86\match686.asm
+
+example.obj: $(TOP)/test/example.c $(TOP)/zlib.h $(TOP)/zconf.h
+
+minigzip.obj: $(TOP)/test/minigzip.c $(TOP)/zlib.h $(TOP)/zconf.h
+
+zlib1.res: $(TOP)/win32/zlib1.rc
+ $(RC) $(RCFLAGS) /fo$@ $(TOP)/win32/zlib1.rc
+
+# testing
+test: example.exe minigzip.exe
+ example
+ echo hello world | minigzip | minigzip -d
+
+testdll: example_d.exe minigzip_d.exe
+ example_d
+ echo hello world | minigzip_d | minigzip_d -d
+
+
+# cleanup
+clean:
+ -del $(STATICLIB)
+ -del $(SHAREDLIB)
+ -del $(IMPLIB)
+ -del *.obj
+ -del *.res
+ -del *.exp
+ -del *.exe
+ -del *.pdb
+ -del *.manifest
+ -del foo.gz
diff --git a/protocols/Telegram/tgl/zlib/win32/README-WIN32.txt b/protocols/Telegram/tgl/zlib/win32/README-WIN32.txt
new file mode 100644
index 0000000000..3d77d521e8
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/win32/README-WIN32.txt
@@ -0,0 +1,103 @@
+ZLIB DATA COMPRESSION LIBRARY
+
+zlib 1.2.8 is a general purpose data compression library. All the code is
+thread safe. The data format used by the zlib library is described by RFCs
+(Request for Comments) 1950 to 1952 in the files
+http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format)
+and rfc1952.txt (gzip format).
+
+All functions of the compression library are documented in the file zlib.h
+(volunteer to write man pages welcome, contact zlib@gzip.org). Two compiled
+examples are distributed in this package, example and minigzip. The example_d
+and minigzip_d flavors validate that the zlib1.dll file is working correctly.
+
+Questions about zlib should be sent to <zlib@gzip.org>. The zlib home page
+is http://zlib.net/ . Before reporting a problem, please check this site to
+verify that you have the latest version of zlib; otherwise get the latest
+version and check whether the problem still exists or not.
+
+PLEASE read DLL_FAQ.txt, and the the zlib FAQ http://zlib.net/zlib_faq.html
+before asking for help.
+
+
+Manifest:
+
+The package zlib-1.2.8-win32-x86.zip will contain the following files:
+
+ README-WIN32.txt This document
+ ChangeLog Changes since previous zlib packages
+ DLL_FAQ.txt Frequently asked questions about zlib1.dll
+ zlib.3.pdf Documentation of this library in Adobe Acrobat format
+
+ example.exe A statically-bound example (using zlib.lib, not the dll)
+ example.pdb Symbolic information for debugging example.exe
+
+ example_d.exe A zlib1.dll bound example (using zdll.lib)
+ example_d.pdb Symbolic information for debugging example_d.exe
+
+ minigzip.exe A statically-bound test program (using zlib.lib, not the dll)
+ minigzip.pdb Symbolic information for debugging minigzip.exe
+
+ minigzip_d.exe A zlib1.dll bound test program (using zdll.lib)
+ minigzip_d.pdb Symbolic information for debugging minigzip_d.exe
+
+ zlib.h Install these files into the compilers' INCLUDE path to
+ zconf.h compile programs which use zlib.lib or zdll.lib
+
+ zdll.lib Install these files into the compilers' LIB path if linking
+ zdll.exp a compiled program to the zlib1.dll binary
+
+ zlib.lib Install these files into the compilers' LIB path to link zlib
+ zlib.pdb into compiled programs, without zlib1.dll runtime dependency
+ (zlib.pdb provides debugging info to the compile time linker)
+
+ zlib1.dll Install this binary shared library into the system PATH, or
+ the program's runtime directory (where the .exe resides)
+ zlib1.pdb Install in the same directory as zlib1.dll, in order to debug
+ an application crash using WinDbg or similar tools.
+
+All .pdb files above are entirely optional, but are very useful to a developer
+attempting to diagnose program misbehavior or a crash. Many additional
+important files for developers can be found in the zlib127.zip source package
+available from http://zlib.net/ - review that package's README file for details.
+
+
+Acknowledgments:
+
+The deflate format used by zlib was defined by Phil Katz. The deflate and
+zlib specifications were written by L. Peter Deutsch. Thanks to all the
+people who reported problems and suggested various improvements in zlib; they
+are too numerous to cite here.
+
+
+Copyright notice:
+
+ (C) 1995-2012 Jean-loup Gailly and Mark Adler
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Jean-loup Gailly Mark Adler
+ jloup@gzip.org madler@alumni.caltech.edu
+
+If you use the zlib library in a product, we would appreciate *not* receiving
+lengthy legal documents to sign. The sources are provided for free but without
+warranty of any kind. The library has been entirely written by Jean-loup
+Gailly and Mark Adler; it does not include third-party code.
+
+If you redistribute modified sources, we would appreciate that you include in
+the file ChangeLog history information documenting your changes. Please read
+the FAQ for more information on the distribution of modified source versions.
diff --git a/protocols/Telegram/tgl/zlib/win32/VisualC.txt b/protocols/Telegram/tgl/zlib/win32/VisualC.txt
new file mode 100644
index 0000000000..579a5fc9e0
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/win32/VisualC.txt
@@ -0,0 +1,3 @@
+
+To build zlib using the Microsoft Visual C++ environment,
+use the appropriate project from the projects/ directory.
diff --git a/protocols/Telegram/tgl/zlib/win32/zlib.def b/protocols/Telegram/tgl/zlib/win32/zlib.def
new file mode 100644
index 0000000000..face655183
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/win32/zlib.def
@@ -0,0 +1,86 @@
+; zlib data compression library
+EXPORTS
+; basic functions
+ zlibVersion
+ deflate
+ deflateEnd
+ inflate
+ inflateEnd
+; advanced functions
+ deflateSetDictionary
+ deflateCopy
+ deflateReset
+ deflateParams
+ deflateTune
+ deflateBound
+ deflatePending
+ deflatePrime
+ deflateSetHeader
+ inflateSetDictionary
+ inflateGetDictionary
+ inflateSync
+ inflateCopy
+ inflateReset
+ inflateReset2
+ inflatePrime
+ inflateMark
+ inflateGetHeader
+ inflateBack
+ inflateBackEnd
+ zlibCompileFlags
+; utility functions
+ compress
+ compress2
+ compressBound
+ uncompress
+ gzopen
+ gzdopen
+ gzbuffer
+ gzsetparams
+ gzread
+ gzwrite
+ gzprintf
+ gzvprintf
+ gzputs
+ gzgets
+ gzputc
+ gzgetc
+ gzungetc
+ gzflush
+ gzseek
+ gzrewind
+ gztell
+ gzoffset
+ gzeof
+ gzdirect
+ gzclose
+ gzclose_r
+ gzclose_w
+ gzerror
+ gzclearerr
+; large file functions
+ gzopen64
+ gzseek64
+ gztell64
+ gzoffset64
+ adler32_combine64
+ crc32_combine64
+; checksum functions
+ adler32
+ crc32
+ adler32_combine
+ crc32_combine
+; various hacks, don't look :)
+ deflateInit_
+ deflateInit2_
+ inflateInit_
+ inflateInit2_
+ inflateBackInit_
+ gzgetc_
+ zError
+ inflateSyncPoint
+ get_crc_table
+ inflateUndermine
+ inflateResetKeep
+ deflateResetKeep
+ gzopen_w
diff --git a/protocols/Telegram/tgl/zlib/win32/zlib1.rc b/protocols/Telegram/tgl/zlib/win32/zlib1.rc
new file mode 100644
index 0000000000..5c0feed1b4
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/win32/zlib1.rc
@@ -0,0 +1,40 @@
+#include <winver.h>
+#include "../zlib.h"
+
+#ifdef GCC_WINDRES
+VS_VERSION_INFO VERSIONINFO
+#else
+VS_VERSION_INFO VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
+#endif
+ FILEVERSION ZLIB_VER_MAJOR,ZLIB_VER_MINOR,ZLIB_VER_REVISION,0
+ PRODUCTVERSION ZLIB_VER_MAJOR,ZLIB_VER_MINOR,ZLIB_VER_REVISION,0
+ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+#ifdef _DEBUG
+ FILEFLAGS 1
+#else
+ FILEFLAGS 0
+#endif
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_DLL
+ FILESUBTYPE 0 // not used
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904E4"
+ //language ID = U.S. English, char set = Windows, Multilingual
+ BEGIN
+ VALUE "FileDescription", "zlib data compression library\0"
+ VALUE "FileVersion", ZLIB_VERSION "\0"
+ VALUE "InternalName", "zlib1.dll\0"
+ VALUE "LegalCopyright", "(C) 1995-2013 Jean-loup Gailly & Mark Adler\0"
+ VALUE "OriginalFilename", "zlib1.dll\0"
+ VALUE "ProductName", "zlib\0"
+ VALUE "ProductVersion", ZLIB_VERSION "\0"
+ VALUE "Comments", "For more information visit http://www.zlib.net/\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x0409, 1252
+ END
+END
diff --git a/protocols/Telegram/tgl/zlib/zconf.h b/protocols/Telegram/tgl/zlib/zconf.h
new file mode 100644
index 0000000000..9987a77553
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/zconf.h
@@ -0,0 +1,511 @@
+/* zconf.h -- configuration of the zlib compression library
+ * Copyright (C) 1995-2013 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#ifndef ZCONF_H
+#define ZCONF_H
+
+/*
+ * If you *really* need a unique prefix for all types and library functions,
+ * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
+ * Even better than compiling with -DZ_PREFIX would be to use configure to set
+ * this permanently in zconf.h using "./configure --zprefix".
+ */
+#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
+# define Z_PREFIX_SET
+
+/* all linked symbols */
+# define _dist_code z__dist_code
+# define _length_code z__length_code
+# define _tr_align z__tr_align
+# define _tr_flush_bits z__tr_flush_bits
+# define _tr_flush_block z__tr_flush_block
+# define _tr_init z__tr_init
+# define _tr_stored_block z__tr_stored_block
+# define _tr_tally z__tr_tally
+# define adler32 z_adler32
+# define adler32_combine z_adler32_combine
+# define adler32_combine64 z_adler32_combine64
+# ifndef Z_SOLO
+# define compress z_compress
+# define compress2 z_compress2
+# define compressBound z_compressBound
+# endif
+# define crc32 z_crc32
+# define crc32_combine z_crc32_combine
+# define crc32_combine64 z_crc32_combine64
+# define deflate z_deflate
+# define deflateBound z_deflateBound
+# define deflateCopy z_deflateCopy
+# define deflateEnd z_deflateEnd
+# define deflateInit2_ z_deflateInit2_
+# define deflateInit_ z_deflateInit_
+# define deflateParams z_deflateParams
+# define deflatePending z_deflatePending
+# define deflatePrime z_deflatePrime
+# define deflateReset z_deflateReset
+# define deflateResetKeep z_deflateResetKeep
+# define deflateSetDictionary z_deflateSetDictionary
+# define deflateSetHeader z_deflateSetHeader
+# define deflateTune z_deflateTune
+# define deflate_copyright z_deflate_copyright
+# define get_crc_table z_get_crc_table
+# ifndef Z_SOLO
+# define gz_error z_gz_error
+# define gz_intmax z_gz_intmax
+# define gz_strwinerror z_gz_strwinerror
+# define gzbuffer z_gzbuffer
+# define gzclearerr z_gzclearerr
+# define gzclose z_gzclose
+# define gzclose_r z_gzclose_r
+# define gzclose_w z_gzclose_w
+# define gzdirect z_gzdirect
+# define gzdopen z_gzdopen
+# define gzeof z_gzeof
+# define gzerror z_gzerror
+# define gzflush z_gzflush
+# define gzgetc z_gzgetc
+# define gzgetc_ z_gzgetc_
+# define gzgets z_gzgets
+# define gzoffset z_gzoffset
+# define gzoffset64 z_gzoffset64
+# define gzopen z_gzopen
+# define gzopen64 z_gzopen64
+# ifdef _WIN32
+# define gzopen_w z_gzopen_w
+# endif
+# define gzprintf z_gzprintf
+# define gzvprintf z_gzvprintf
+# define gzputc z_gzputc
+# define gzputs z_gzputs
+# define gzread z_gzread
+# define gzrewind z_gzrewind
+# define gzseek z_gzseek
+# define gzseek64 z_gzseek64
+# define gzsetparams z_gzsetparams
+# define gztell z_gztell
+# define gztell64 z_gztell64
+# define gzungetc z_gzungetc
+# define gzwrite z_gzwrite
+# endif
+# define inflate z_inflate
+# define inflateBack z_inflateBack
+# define inflateBackEnd z_inflateBackEnd
+# define inflateBackInit_ z_inflateBackInit_
+# define inflateCopy z_inflateCopy
+# define inflateEnd z_inflateEnd
+# define inflateGetHeader z_inflateGetHeader
+# define inflateInit2_ z_inflateInit2_
+# define inflateInit_ z_inflateInit_
+# define inflateMark z_inflateMark
+# define inflatePrime z_inflatePrime
+# define inflateReset z_inflateReset
+# define inflateReset2 z_inflateReset2
+# define inflateSetDictionary z_inflateSetDictionary
+# define inflateGetDictionary z_inflateGetDictionary
+# define inflateSync z_inflateSync
+# define inflateSyncPoint z_inflateSyncPoint
+# define inflateUndermine z_inflateUndermine
+# define inflateResetKeep z_inflateResetKeep
+# define inflate_copyright z_inflate_copyright
+# define inflate_fast z_inflate_fast
+# define inflate_table z_inflate_table
+# ifndef Z_SOLO
+# define uncompress z_uncompress
+# endif
+# define zError z_zError
+# ifndef Z_SOLO
+# define zcalloc z_zcalloc
+# define zcfree z_zcfree
+# endif
+# define zlibCompileFlags z_zlibCompileFlags
+# define zlibVersion z_zlibVersion
+
+/* all zlib typedefs in zlib.h and zconf.h */
+# define Byte z_Byte
+# define Bytef z_Bytef
+# define alloc_func z_alloc_func
+# define charf z_charf
+# define free_func z_free_func
+# ifndef Z_SOLO
+# define gzFile z_gzFile
+# endif
+# define gz_header z_gz_header
+# define gz_headerp z_gz_headerp
+# define in_func z_in_func
+# define intf z_intf
+# define out_func z_out_func
+# define uInt z_uInt
+# define uIntf z_uIntf
+# define uLong z_uLong
+# define uLongf z_uLongf
+# define voidp z_voidp
+# define voidpc z_voidpc
+# define voidpf z_voidpf
+
+/* all zlib structs in zlib.h and zconf.h */
+# define gz_header_s z_gz_header_s
+# define internal_state z_internal_state
+
+#endif
+
+#if defined(__MSDOS__) && !defined(MSDOS)
+# define MSDOS
+#endif
+#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
+# define OS2
+#endif
+#if defined(_WINDOWS) && !defined(WINDOWS)
+# define WINDOWS
+#endif
+#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
+# ifndef WIN32
+# define WIN32
+# endif
+#endif
+#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
+# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
+# ifndef SYS16BIT
+# define SYS16BIT
+# endif
+# endif
+#endif
+
+/*
+ * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
+ * than 64k bytes at a time (needed on systems with 16-bit int).
+ */
+#ifdef SYS16BIT
+# define MAXSEG_64K
+#endif
+#ifdef MSDOS
+# define UNALIGNED_OK
+#endif
+
+#ifdef __STDC_VERSION__
+# ifndef STDC
+# define STDC
+# endif
+# if __STDC_VERSION__ >= 199901L
+# ifndef STDC99
+# define STDC99
+# endif
+# endif
+#endif
+#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
+# define STDC
+#endif
+#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
+# define STDC
+#endif
+#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
+# define STDC
+#endif
+#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
+# define STDC
+#endif
+
+#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
+# define STDC
+#endif
+
+#ifndef STDC
+# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
+# define const /* note: need a more gentle solution here */
+# endif
+#endif
+
+#if defined(ZLIB_CONST) && !defined(z_const)
+# define z_const const
+#else
+# define z_const
+#endif
+
+/* Some Mac compilers merge all .h files incorrectly: */
+#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
+# define NO_DUMMY_DECL
+#endif
+
+/* Maximum value for memLevel in deflateInit2 */
+#ifndef MAX_MEM_LEVEL
+# ifdef MAXSEG_64K
+# define MAX_MEM_LEVEL 8
+# else
+# define MAX_MEM_LEVEL 9
+# endif
+#endif
+
+/* Maximum value for windowBits in deflateInit2 and inflateInit2.
+ * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
+ * created by gzip. (Files created by minigzip can still be extracted by
+ * gzip.)
+ */
+#ifndef MAX_WBITS
+# define MAX_WBITS 15 /* 32K LZ77 window */
+#endif
+
+/* The memory requirements for deflate are (in bytes):
+ (1 << (windowBits+2)) + (1 << (memLevel+9))
+ that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
+ plus a few kilobytes for small objects. For example, if you want to reduce
+ the default memory requirements from 256K to 128K, compile with
+ make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
+ Of course this will generally degrade compression (there's no free lunch).
+
+ The memory requirements for inflate are (in bytes) 1 << windowBits
+ that is, 32K for windowBits=15 (default value) plus a few kilobytes
+ for small objects.
+*/
+
+ /* Type declarations */
+
+#ifndef OF /* function prototypes */
+# ifdef STDC
+# define OF(args) args
+# else
+# define OF(args) ()
+# endif
+#endif
+
+#ifndef Z_ARG /* function prototypes for stdarg */
+# if defined(STDC) || defined(Z_HAVE_STDARG_H)
+# define Z_ARG(args) args
+# else
+# define Z_ARG(args) ()
+# endif
+#endif
+
+/* The following definitions for FAR are needed only for MSDOS mixed
+ * model programming (small or medium model with some far allocations).
+ * This was tested only with MSC; for other MSDOS compilers you may have
+ * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
+ * just define FAR to be empty.
+ */
+#ifdef SYS16BIT
+# if defined(M_I86SM) || defined(M_I86MM)
+ /* MSC small or medium model */
+# define SMALL_MEDIUM
+# ifdef _MSC_VER
+# define FAR _far
+# else
+# define FAR far
+# endif
+# endif
+# if (defined(__SMALL__) || defined(__MEDIUM__))
+ /* Turbo C small or medium model */
+# define SMALL_MEDIUM
+# ifdef __BORLANDC__
+# define FAR _far
+# else
+# define FAR far
+# endif
+# endif
+#endif
+
+#if defined(WINDOWS) || defined(WIN32)
+ /* If building or using zlib as a DLL, define ZLIB_DLL.
+ * This is not mandatory, but it offers a little performance increase.
+ */
+# ifdef ZLIB_DLL
+# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
+# ifdef ZLIB_INTERNAL
+# define ZEXTERN extern __declspec(dllexport)
+# else
+# define ZEXTERN extern __declspec(dllimport)
+# endif
+# endif
+# endif /* ZLIB_DLL */
+ /* If building or using zlib with the WINAPI/WINAPIV calling convention,
+ * define ZLIB_WINAPI.
+ * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
+ */
+# ifdef ZLIB_WINAPI
+# ifdef FAR
+# undef FAR
+# endif
+# include <windows.h>
+ /* No need for _export, use ZLIB.DEF instead. */
+ /* For complete Windows compatibility, use WINAPI, not __stdcall. */
+# define ZEXPORT WINAPI
+# ifdef WIN32
+# define ZEXPORTVA WINAPIV
+# else
+# define ZEXPORTVA FAR CDECL
+# endif
+# endif
+#endif
+
+#if defined (__BEOS__)
+# ifdef ZLIB_DLL
+# ifdef ZLIB_INTERNAL
+# define ZEXPORT __declspec(dllexport)
+# define ZEXPORTVA __declspec(dllexport)
+# else
+# define ZEXPORT __declspec(dllimport)
+# define ZEXPORTVA __declspec(dllimport)
+# endif
+# endif
+#endif
+
+#ifndef ZEXTERN
+# define ZEXTERN extern
+#endif
+#ifndef ZEXPORT
+# define ZEXPORT
+#endif
+#ifndef ZEXPORTVA
+# define ZEXPORTVA
+#endif
+
+#ifndef FAR
+# define FAR
+#endif
+
+#if !defined(__MACTYPES__)
+typedef unsigned char Byte; /* 8 bits */
+#endif
+typedef unsigned int uInt; /* 16 bits or more */
+typedef unsigned long uLong; /* 32 bits or more */
+
+#ifdef SMALL_MEDIUM
+ /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
+# define Bytef Byte FAR
+#else
+ typedef Byte FAR Bytef;
+#endif
+typedef char FAR charf;
+typedef int FAR intf;
+typedef uInt FAR uIntf;
+typedef uLong FAR uLongf;
+
+#ifdef STDC
+ typedef void const *voidpc;
+ typedef void FAR *voidpf;
+ typedef void *voidp;
+#else
+ typedef Byte const *voidpc;
+ typedef Byte FAR *voidpf;
+ typedef Byte *voidp;
+#endif
+
+#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
+# include <limits.h>
+# if (UINT_MAX == 0xffffffffUL)
+# define Z_U4 unsigned
+# elif (ULONG_MAX == 0xffffffffUL)
+# define Z_U4 unsigned long
+# elif (USHRT_MAX == 0xffffffffUL)
+# define Z_U4 unsigned short
+# endif
+#endif
+
+#ifdef Z_U4
+ typedef Z_U4 z_crc_t;
+#else
+ typedef unsigned long z_crc_t;
+#endif
+
+#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
+# define Z_HAVE_UNISTD_H
+#endif
+
+#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
+# define Z_HAVE_STDARG_H
+#endif
+
+#ifdef STDC
+# ifndef Z_SOLO
+# include <sys/types.h> /* for off_t */
+# endif
+#endif
+
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
+# ifndef Z_SOLO
+# include <stdarg.h> /* for va_list */
+# endif
+#endif
+
+#ifdef _WIN32
+# ifndef Z_SOLO
+# include <stddef.h> /* for wchar_t */
+# endif
+#endif
+
+/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
+ * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
+ * though the former does not conform to the LFS document), but considering
+ * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
+ * equivalently requesting no 64-bit operations
+ */
+#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
+# undef _LARGEFILE64_SOURCE
+#endif
+
+#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
+# define Z_HAVE_UNISTD_H
+#endif
+#ifndef Z_SOLO
+# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
+# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
+# ifdef VMS
+# include <unixio.h> /* for off_t */
+# endif
+# ifndef z_off_t
+# define z_off_t off_t
+# endif
+# endif
+#endif
+
+#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
+# define Z_LFS64
+#endif
+
+#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
+# define Z_LARGE64
+#endif
+
+#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
+# define Z_WANT64
+#endif
+
+#if !defined(SEEK_SET) && !defined(Z_SOLO)
+# define SEEK_SET 0 /* Seek from beginning of file. */
+# define SEEK_CUR 1 /* Seek from current position. */
+# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
+#endif
+
+#ifndef z_off_t
+# define z_off_t long
+#endif
+
+#if !defined(_WIN32) && defined(Z_LARGE64)
+# define z_off64_t off64_t
+#else
+# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
+# define z_off64_t __int64
+# else
+# define z_off64_t z_off_t
+# endif
+#endif
+
+/* MVS linker does not support external names larger than 8 bytes */
+#if defined(__MVS__)
+ #pragma map(deflateInit_,"DEIN")
+ #pragma map(deflateInit2_,"DEIN2")
+ #pragma map(deflateEnd,"DEEND")
+ #pragma map(deflateBound,"DEBND")
+ #pragma map(inflateInit_,"ININ")
+ #pragma map(inflateInit2_,"ININ2")
+ #pragma map(inflateEnd,"INEND")
+ #pragma map(inflateSync,"INSY")
+ #pragma map(inflateSetDictionary,"INSEDI")
+ #pragma map(compressBound,"CMBND")
+ #pragma map(inflate_table,"INTABL")
+ #pragma map(inflate_fast,"INFA")
+ #pragma map(inflate_copyright,"INCOPY")
+#endif
+
+#endif /* ZCONF_H */
diff --git a/protocols/Telegram/tgl/zlib/zconf.h.cmakein b/protocols/Telegram/tgl/zlib/zconf.h.cmakein
new file mode 100644
index 0000000000..043019cda1
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/zconf.h.cmakein
@@ -0,0 +1,513 @@
+/* zconf.h -- configuration of the zlib compression library
+ * Copyright (C) 1995-2013 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#ifndef ZCONF_H
+#define ZCONF_H
+#cmakedefine Z_PREFIX
+#cmakedefine Z_HAVE_UNISTD_H
+
+/*
+ * If you *really* need a unique prefix for all types and library functions,
+ * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
+ * Even better than compiling with -DZ_PREFIX would be to use configure to set
+ * this permanently in zconf.h using "./configure --zprefix".
+ */
+#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
+# define Z_PREFIX_SET
+
+/* all linked symbols */
+# define _dist_code z__dist_code
+# define _length_code z__length_code
+# define _tr_align z__tr_align
+# define _tr_flush_bits z__tr_flush_bits
+# define _tr_flush_block z__tr_flush_block
+# define _tr_init z__tr_init
+# define _tr_stored_block z__tr_stored_block
+# define _tr_tally z__tr_tally
+# define adler32 z_adler32
+# define adler32_combine z_adler32_combine
+# define adler32_combine64 z_adler32_combine64
+# ifndef Z_SOLO
+# define compress z_compress
+# define compress2 z_compress2
+# define compressBound z_compressBound
+# endif
+# define crc32 z_crc32
+# define crc32_combine z_crc32_combine
+# define crc32_combine64 z_crc32_combine64
+# define deflate z_deflate
+# define deflateBound z_deflateBound
+# define deflateCopy z_deflateCopy
+# define deflateEnd z_deflateEnd
+# define deflateInit2_ z_deflateInit2_
+# define deflateInit_ z_deflateInit_
+# define deflateParams z_deflateParams
+# define deflatePending z_deflatePending
+# define deflatePrime z_deflatePrime
+# define deflateReset z_deflateReset
+# define deflateResetKeep z_deflateResetKeep
+# define deflateSetDictionary z_deflateSetDictionary
+# define deflateSetHeader z_deflateSetHeader
+# define deflateTune z_deflateTune
+# define deflate_copyright z_deflate_copyright
+# define get_crc_table z_get_crc_table
+# ifndef Z_SOLO
+# define gz_error z_gz_error
+# define gz_intmax z_gz_intmax
+# define gz_strwinerror z_gz_strwinerror
+# define gzbuffer z_gzbuffer
+# define gzclearerr z_gzclearerr
+# define gzclose z_gzclose
+# define gzclose_r z_gzclose_r
+# define gzclose_w z_gzclose_w
+# define gzdirect z_gzdirect
+# define gzdopen z_gzdopen
+# define gzeof z_gzeof
+# define gzerror z_gzerror
+# define gzflush z_gzflush
+# define gzgetc z_gzgetc
+# define gzgetc_ z_gzgetc_
+# define gzgets z_gzgets
+# define gzoffset z_gzoffset
+# define gzoffset64 z_gzoffset64
+# define gzopen z_gzopen
+# define gzopen64 z_gzopen64
+# ifdef _WIN32
+# define gzopen_w z_gzopen_w
+# endif
+# define gzprintf z_gzprintf
+# define gzvprintf z_gzvprintf
+# define gzputc z_gzputc
+# define gzputs z_gzputs
+# define gzread z_gzread
+# define gzrewind z_gzrewind
+# define gzseek z_gzseek
+# define gzseek64 z_gzseek64
+# define gzsetparams z_gzsetparams
+# define gztell z_gztell
+# define gztell64 z_gztell64
+# define gzungetc z_gzungetc
+# define gzwrite z_gzwrite
+# endif
+# define inflate z_inflate
+# define inflateBack z_inflateBack
+# define inflateBackEnd z_inflateBackEnd
+# define inflateBackInit_ z_inflateBackInit_
+# define inflateCopy z_inflateCopy
+# define inflateEnd z_inflateEnd
+# define inflateGetHeader z_inflateGetHeader
+# define inflateInit2_ z_inflateInit2_
+# define inflateInit_ z_inflateInit_
+# define inflateMark z_inflateMark
+# define inflatePrime z_inflatePrime
+# define inflateReset z_inflateReset
+# define inflateReset2 z_inflateReset2
+# define inflateSetDictionary z_inflateSetDictionary
+# define inflateGetDictionary z_inflateGetDictionary
+# define inflateSync z_inflateSync
+# define inflateSyncPoint z_inflateSyncPoint
+# define inflateUndermine z_inflateUndermine
+# define inflateResetKeep z_inflateResetKeep
+# define inflate_copyright z_inflate_copyright
+# define inflate_fast z_inflate_fast
+# define inflate_table z_inflate_table
+# ifndef Z_SOLO
+# define uncompress z_uncompress
+# endif
+# define zError z_zError
+# ifndef Z_SOLO
+# define zcalloc z_zcalloc
+# define zcfree z_zcfree
+# endif
+# define zlibCompileFlags z_zlibCompileFlags
+# define zlibVersion z_zlibVersion
+
+/* all zlib typedefs in zlib.h and zconf.h */
+# define Byte z_Byte
+# define Bytef z_Bytef
+# define alloc_func z_alloc_func
+# define charf z_charf
+# define free_func z_free_func
+# ifndef Z_SOLO
+# define gzFile z_gzFile
+# endif
+# define gz_header z_gz_header
+# define gz_headerp z_gz_headerp
+# define in_func z_in_func
+# define intf z_intf
+# define out_func z_out_func
+# define uInt z_uInt
+# define uIntf z_uIntf
+# define uLong z_uLong
+# define uLongf z_uLongf
+# define voidp z_voidp
+# define voidpc z_voidpc
+# define voidpf z_voidpf
+
+/* all zlib structs in zlib.h and zconf.h */
+# define gz_header_s z_gz_header_s
+# define internal_state z_internal_state
+
+#endif
+
+#if defined(__MSDOS__) && !defined(MSDOS)
+# define MSDOS
+#endif
+#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
+# define OS2
+#endif
+#if defined(_WINDOWS) && !defined(WINDOWS)
+# define WINDOWS
+#endif
+#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
+# ifndef WIN32
+# define WIN32
+# endif
+#endif
+#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
+# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
+# ifndef SYS16BIT
+# define SYS16BIT
+# endif
+# endif
+#endif
+
+/*
+ * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
+ * than 64k bytes at a time (needed on systems with 16-bit int).
+ */
+#ifdef SYS16BIT
+# define MAXSEG_64K
+#endif
+#ifdef MSDOS
+# define UNALIGNED_OK
+#endif
+
+#ifdef __STDC_VERSION__
+# ifndef STDC
+# define STDC
+# endif
+# if __STDC_VERSION__ >= 199901L
+# ifndef STDC99
+# define STDC99
+# endif
+# endif
+#endif
+#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
+# define STDC
+#endif
+#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
+# define STDC
+#endif
+#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
+# define STDC
+#endif
+#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
+# define STDC
+#endif
+
+#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
+# define STDC
+#endif
+
+#ifndef STDC
+# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
+# define const /* note: need a more gentle solution here */
+# endif
+#endif
+
+#if defined(ZLIB_CONST) && !defined(z_const)
+# define z_const const
+#else
+# define z_const
+#endif
+
+/* Some Mac compilers merge all .h files incorrectly: */
+#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
+# define NO_DUMMY_DECL
+#endif
+
+/* Maximum value for memLevel in deflateInit2 */
+#ifndef MAX_MEM_LEVEL
+# ifdef MAXSEG_64K
+# define MAX_MEM_LEVEL 8
+# else
+# define MAX_MEM_LEVEL 9
+# endif
+#endif
+
+/* Maximum value for windowBits in deflateInit2 and inflateInit2.
+ * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
+ * created by gzip. (Files created by minigzip can still be extracted by
+ * gzip.)
+ */
+#ifndef MAX_WBITS
+# define MAX_WBITS 15 /* 32K LZ77 window */
+#endif
+
+/* The memory requirements for deflate are (in bytes):
+ (1 << (windowBits+2)) + (1 << (memLevel+9))
+ that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
+ plus a few kilobytes for small objects. For example, if you want to reduce
+ the default memory requirements from 256K to 128K, compile with
+ make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
+ Of course this will generally degrade compression (there's no free lunch).
+
+ The memory requirements for inflate are (in bytes) 1 << windowBits
+ that is, 32K for windowBits=15 (default value) plus a few kilobytes
+ for small objects.
+*/
+
+ /* Type declarations */
+
+#ifndef OF /* function prototypes */
+# ifdef STDC
+# define OF(args) args
+# else
+# define OF(args) ()
+# endif
+#endif
+
+#ifndef Z_ARG /* function prototypes for stdarg */
+# if defined(STDC) || defined(Z_HAVE_STDARG_H)
+# define Z_ARG(args) args
+# else
+# define Z_ARG(args) ()
+# endif
+#endif
+
+/* The following definitions for FAR are needed only for MSDOS mixed
+ * model programming (small or medium model with some far allocations).
+ * This was tested only with MSC; for other MSDOS compilers you may have
+ * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
+ * just define FAR to be empty.
+ */
+#ifdef SYS16BIT
+# if defined(M_I86SM) || defined(M_I86MM)
+ /* MSC small or medium model */
+# define SMALL_MEDIUM
+# ifdef _MSC_VER
+# define FAR _far
+# else
+# define FAR far
+# endif
+# endif
+# if (defined(__SMALL__) || defined(__MEDIUM__))
+ /* Turbo C small or medium model */
+# define SMALL_MEDIUM
+# ifdef __BORLANDC__
+# define FAR _far
+# else
+# define FAR far
+# endif
+# endif
+#endif
+
+#if defined(WINDOWS) || defined(WIN32)
+ /* If building or using zlib as a DLL, define ZLIB_DLL.
+ * This is not mandatory, but it offers a little performance increase.
+ */
+# ifdef ZLIB_DLL
+# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
+# ifdef ZLIB_INTERNAL
+# define ZEXTERN extern __declspec(dllexport)
+# else
+# define ZEXTERN extern __declspec(dllimport)
+# endif
+# endif
+# endif /* ZLIB_DLL */
+ /* If building or using zlib with the WINAPI/WINAPIV calling convention,
+ * define ZLIB_WINAPI.
+ * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
+ */
+# ifdef ZLIB_WINAPI
+# ifdef FAR
+# undef FAR
+# endif
+# include <windows.h>
+ /* No need for _export, use ZLIB.DEF instead. */
+ /* For complete Windows compatibility, use WINAPI, not __stdcall. */
+# define ZEXPORT WINAPI
+# ifdef WIN32
+# define ZEXPORTVA WINAPIV
+# else
+# define ZEXPORTVA FAR CDECL
+# endif
+# endif
+#endif
+
+#if defined (__BEOS__)
+# ifdef ZLIB_DLL
+# ifdef ZLIB_INTERNAL
+# define ZEXPORT __declspec(dllexport)
+# define ZEXPORTVA __declspec(dllexport)
+# else
+# define ZEXPORT __declspec(dllimport)
+# define ZEXPORTVA __declspec(dllimport)
+# endif
+# endif
+#endif
+
+#ifndef ZEXTERN
+# define ZEXTERN extern
+#endif
+#ifndef ZEXPORT
+# define ZEXPORT
+#endif
+#ifndef ZEXPORTVA
+# define ZEXPORTVA
+#endif
+
+#ifndef FAR
+# define FAR
+#endif
+
+#if !defined(__MACTYPES__)
+typedef unsigned char Byte; /* 8 bits */
+#endif
+typedef unsigned int uInt; /* 16 bits or more */
+typedef unsigned long uLong; /* 32 bits or more */
+
+#ifdef SMALL_MEDIUM
+ /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
+# define Bytef Byte FAR
+#else
+ typedef Byte FAR Bytef;
+#endif
+typedef char FAR charf;
+typedef int FAR intf;
+typedef uInt FAR uIntf;
+typedef uLong FAR uLongf;
+
+#ifdef STDC
+ typedef void const *voidpc;
+ typedef void FAR *voidpf;
+ typedef void *voidp;
+#else
+ typedef Byte const *voidpc;
+ typedef Byte FAR *voidpf;
+ typedef Byte *voidp;
+#endif
+
+#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
+# include <limits.h>
+# if (UINT_MAX == 0xffffffffUL)
+# define Z_U4 unsigned
+# elif (ULONG_MAX == 0xffffffffUL)
+# define Z_U4 unsigned long
+# elif (USHRT_MAX == 0xffffffffUL)
+# define Z_U4 unsigned short
+# endif
+#endif
+
+#ifdef Z_U4
+ typedef Z_U4 z_crc_t;
+#else
+ typedef unsigned long z_crc_t;
+#endif
+
+#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
+# define Z_HAVE_UNISTD_H
+#endif
+
+#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
+# define Z_HAVE_STDARG_H
+#endif
+
+#ifdef STDC
+# ifndef Z_SOLO
+# include <sys/types.h> /* for off_t */
+# endif
+#endif
+
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
+# ifndef Z_SOLO
+# include <stdarg.h> /* for va_list */
+# endif
+#endif
+
+#ifdef _WIN32
+# ifndef Z_SOLO
+# include <stddef.h> /* for wchar_t */
+# endif
+#endif
+
+/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
+ * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
+ * though the former does not conform to the LFS document), but considering
+ * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
+ * equivalently requesting no 64-bit operations
+ */
+#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
+# undef _LARGEFILE64_SOURCE
+#endif
+
+#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
+# define Z_HAVE_UNISTD_H
+#endif
+#ifndef Z_SOLO
+# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
+# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
+# ifdef VMS
+# include <unixio.h> /* for off_t */
+# endif
+# ifndef z_off_t
+# define z_off_t off_t
+# endif
+# endif
+#endif
+
+#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
+# define Z_LFS64
+#endif
+
+#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
+# define Z_LARGE64
+#endif
+
+#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
+# define Z_WANT64
+#endif
+
+#if !defined(SEEK_SET) && !defined(Z_SOLO)
+# define SEEK_SET 0 /* Seek from beginning of file. */
+# define SEEK_CUR 1 /* Seek from current position. */
+# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
+#endif
+
+#ifndef z_off_t
+# define z_off_t long
+#endif
+
+#if !defined(_WIN32) && defined(Z_LARGE64)
+# define z_off64_t off64_t
+#else
+# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
+# define z_off64_t __int64
+# else
+# define z_off64_t z_off_t
+# endif
+#endif
+
+/* MVS linker does not support external names larger than 8 bytes */
+#if defined(__MVS__)
+ #pragma map(deflateInit_,"DEIN")
+ #pragma map(deflateInit2_,"DEIN2")
+ #pragma map(deflateEnd,"DEEND")
+ #pragma map(deflateBound,"DEBND")
+ #pragma map(inflateInit_,"ININ")
+ #pragma map(inflateInit2_,"ININ2")
+ #pragma map(inflateEnd,"INEND")
+ #pragma map(inflateSync,"INSY")
+ #pragma map(inflateSetDictionary,"INSEDI")
+ #pragma map(compressBound,"CMBND")
+ #pragma map(inflate_table,"INTABL")
+ #pragma map(inflate_fast,"INFA")
+ #pragma map(inflate_copyright,"INCOPY")
+#endif
+
+#endif /* ZCONF_H */
diff --git a/protocols/Telegram/tgl/zlib/zconf.h.in b/protocols/Telegram/tgl/zlib/zconf.h.in
new file mode 100644
index 0000000000..9987a77553
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/zconf.h.in
@@ -0,0 +1,511 @@
+/* zconf.h -- configuration of the zlib compression library
+ * Copyright (C) 1995-2013 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#ifndef ZCONF_H
+#define ZCONF_H
+
+/*
+ * If you *really* need a unique prefix for all types and library functions,
+ * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
+ * Even better than compiling with -DZ_PREFIX would be to use configure to set
+ * this permanently in zconf.h using "./configure --zprefix".
+ */
+#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
+# define Z_PREFIX_SET
+
+/* all linked symbols */
+# define _dist_code z__dist_code
+# define _length_code z__length_code
+# define _tr_align z__tr_align
+# define _tr_flush_bits z__tr_flush_bits
+# define _tr_flush_block z__tr_flush_block
+# define _tr_init z__tr_init
+# define _tr_stored_block z__tr_stored_block
+# define _tr_tally z__tr_tally
+# define adler32 z_adler32
+# define adler32_combine z_adler32_combine
+# define adler32_combine64 z_adler32_combine64
+# ifndef Z_SOLO
+# define compress z_compress
+# define compress2 z_compress2
+# define compressBound z_compressBound
+# endif
+# define crc32 z_crc32
+# define crc32_combine z_crc32_combine
+# define crc32_combine64 z_crc32_combine64
+# define deflate z_deflate
+# define deflateBound z_deflateBound
+# define deflateCopy z_deflateCopy
+# define deflateEnd z_deflateEnd
+# define deflateInit2_ z_deflateInit2_
+# define deflateInit_ z_deflateInit_
+# define deflateParams z_deflateParams
+# define deflatePending z_deflatePending
+# define deflatePrime z_deflatePrime
+# define deflateReset z_deflateReset
+# define deflateResetKeep z_deflateResetKeep
+# define deflateSetDictionary z_deflateSetDictionary
+# define deflateSetHeader z_deflateSetHeader
+# define deflateTune z_deflateTune
+# define deflate_copyright z_deflate_copyright
+# define get_crc_table z_get_crc_table
+# ifndef Z_SOLO
+# define gz_error z_gz_error
+# define gz_intmax z_gz_intmax
+# define gz_strwinerror z_gz_strwinerror
+# define gzbuffer z_gzbuffer
+# define gzclearerr z_gzclearerr
+# define gzclose z_gzclose
+# define gzclose_r z_gzclose_r
+# define gzclose_w z_gzclose_w
+# define gzdirect z_gzdirect
+# define gzdopen z_gzdopen
+# define gzeof z_gzeof
+# define gzerror z_gzerror
+# define gzflush z_gzflush
+# define gzgetc z_gzgetc
+# define gzgetc_ z_gzgetc_
+# define gzgets z_gzgets
+# define gzoffset z_gzoffset
+# define gzoffset64 z_gzoffset64
+# define gzopen z_gzopen
+# define gzopen64 z_gzopen64
+# ifdef _WIN32
+# define gzopen_w z_gzopen_w
+# endif
+# define gzprintf z_gzprintf
+# define gzvprintf z_gzvprintf
+# define gzputc z_gzputc
+# define gzputs z_gzputs
+# define gzread z_gzread
+# define gzrewind z_gzrewind
+# define gzseek z_gzseek
+# define gzseek64 z_gzseek64
+# define gzsetparams z_gzsetparams
+# define gztell z_gztell
+# define gztell64 z_gztell64
+# define gzungetc z_gzungetc
+# define gzwrite z_gzwrite
+# endif
+# define inflate z_inflate
+# define inflateBack z_inflateBack
+# define inflateBackEnd z_inflateBackEnd
+# define inflateBackInit_ z_inflateBackInit_
+# define inflateCopy z_inflateCopy
+# define inflateEnd z_inflateEnd
+# define inflateGetHeader z_inflateGetHeader
+# define inflateInit2_ z_inflateInit2_
+# define inflateInit_ z_inflateInit_
+# define inflateMark z_inflateMark
+# define inflatePrime z_inflatePrime
+# define inflateReset z_inflateReset
+# define inflateReset2 z_inflateReset2
+# define inflateSetDictionary z_inflateSetDictionary
+# define inflateGetDictionary z_inflateGetDictionary
+# define inflateSync z_inflateSync
+# define inflateSyncPoint z_inflateSyncPoint
+# define inflateUndermine z_inflateUndermine
+# define inflateResetKeep z_inflateResetKeep
+# define inflate_copyright z_inflate_copyright
+# define inflate_fast z_inflate_fast
+# define inflate_table z_inflate_table
+# ifndef Z_SOLO
+# define uncompress z_uncompress
+# endif
+# define zError z_zError
+# ifndef Z_SOLO
+# define zcalloc z_zcalloc
+# define zcfree z_zcfree
+# endif
+# define zlibCompileFlags z_zlibCompileFlags
+# define zlibVersion z_zlibVersion
+
+/* all zlib typedefs in zlib.h and zconf.h */
+# define Byte z_Byte
+# define Bytef z_Bytef
+# define alloc_func z_alloc_func
+# define charf z_charf
+# define free_func z_free_func
+# ifndef Z_SOLO
+# define gzFile z_gzFile
+# endif
+# define gz_header z_gz_header
+# define gz_headerp z_gz_headerp
+# define in_func z_in_func
+# define intf z_intf
+# define out_func z_out_func
+# define uInt z_uInt
+# define uIntf z_uIntf
+# define uLong z_uLong
+# define uLongf z_uLongf
+# define voidp z_voidp
+# define voidpc z_voidpc
+# define voidpf z_voidpf
+
+/* all zlib structs in zlib.h and zconf.h */
+# define gz_header_s z_gz_header_s
+# define internal_state z_internal_state
+
+#endif
+
+#if defined(__MSDOS__) && !defined(MSDOS)
+# define MSDOS
+#endif
+#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
+# define OS2
+#endif
+#if defined(_WINDOWS) && !defined(WINDOWS)
+# define WINDOWS
+#endif
+#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
+# ifndef WIN32
+# define WIN32
+# endif
+#endif
+#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
+# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
+# ifndef SYS16BIT
+# define SYS16BIT
+# endif
+# endif
+#endif
+
+/*
+ * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
+ * than 64k bytes at a time (needed on systems with 16-bit int).
+ */
+#ifdef SYS16BIT
+# define MAXSEG_64K
+#endif
+#ifdef MSDOS
+# define UNALIGNED_OK
+#endif
+
+#ifdef __STDC_VERSION__
+# ifndef STDC
+# define STDC
+# endif
+# if __STDC_VERSION__ >= 199901L
+# ifndef STDC99
+# define STDC99
+# endif
+# endif
+#endif
+#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
+# define STDC
+#endif
+#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
+# define STDC
+#endif
+#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
+# define STDC
+#endif
+#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
+# define STDC
+#endif
+
+#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
+# define STDC
+#endif
+
+#ifndef STDC
+# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
+# define const /* note: need a more gentle solution here */
+# endif
+#endif
+
+#if defined(ZLIB_CONST) && !defined(z_const)
+# define z_const const
+#else
+# define z_const
+#endif
+
+/* Some Mac compilers merge all .h files incorrectly: */
+#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
+# define NO_DUMMY_DECL
+#endif
+
+/* Maximum value for memLevel in deflateInit2 */
+#ifndef MAX_MEM_LEVEL
+# ifdef MAXSEG_64K
+# define MAX_MEM_LEVEL 8
+# else
+# define MAX_MEM_LEVEL 9
+# endif
+#endif
+
+/* Maximum value for windowBits in deflateInit2 and inflateInit2.
+ * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
+ * created by gzip. (Files created by minigzip can still be extracted by
+ * gzip.)
+ */
+#ifndef MAX_WBITS
+# define MAX_WBITS 15 /* 32K LZ77 window */
+#endif
+
+/* The memory requirements for deflate are (in bytes):
+ (1 << (windowBits+2)) + (1 << (memLevel+9))
+ that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
+ plus a few kilobytes for small objects. For example, if you want to reduce
+ the default memory requirements from 256K to 128K, compile with
+ make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
+ Of course this will generally degrade compression (there's no free lunch).
+
+ The memory requirements for inflate are (in bytes) 1 << windowBits
+ that is, 32K for windowBits=15 (default value) plus a few kilobytes
+ for small objects.
+*/
+
+ /* Type declarations */
+
+#ifndef OF /* function prototypes */
+# ifdef STDC
+# define OF(args) args
+# else
+# define OF(args) ()
+# endif
+#endif
+
+#ifndef Z_ARG /* function prototypes for stdarg */
+# if defined(STDC) || defined(Z_HAVE_STDARG_H)
+# define Z_ARG(args) args
+# else
+# define Z_ARG(args) ()
+# endif
+#endif
+
+/* The following definitions for FAR are needed only for MSDOS mixed
+ * model programming (small or medium model with some far allocations).
+ * This was tested only with MSC; for other MSDOS compilers you may have
+ * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
+ * just define FAR to be empty.
+ */
+#ifdef SYS16BIT
+# if defined(M_I86SM) || defined(M_I86MM)
+ /* MSC small or medium model */
+# define SMALL_MEDIUM
+# ifdef _MSC_VER
+# define FAR _far
+# else
+# define FAR far
+# endif
+# endif
+# if (defined(__SMALL__) || defined(__MEDIUM__))
+ /* Turbo C small or medium model */
+# define SMALL_MEDIUM
+# ifdef __BORLANDC__
+# define FAR _far
+# else
+# define FAR far
+# endif
+# endif
+#endif
+
+#if defined(WINDOWS) || defined(WIN32)
+ /* If building or using zlib as a DLL, define ZLIB_DLL.
+ * This is not mandatory, but it offers a little performance increase.
+ */
+# ifdef ZLIB_DLL
+# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
+# ifdef ZLIB_INTERNAL
+# define ZEXTERN extern __declspec(dllexport)
+# else
+# define ZEXTERN extern __declspec(dllimport)
+# endif
+# endif
+# endif /* ZLIB_DLL */
+ /* If building or using zlib with the WINAPI/WINAPIV calling convention,
+ * define ZLIB_WINAPI.
+ * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
+ */
+# ifdef ZLIB_WINAPI
+# ifdef FAR
+# undef FAR
+# endif
+# include <windows.h>
+ /* No need for _export, use ZLIB.DEF instead. */
+ /* For complete Windows compatibility, use WINAPI, not __stdcall. */
+# define ZEXPORT WINAPI
+# ifdef WIN32
+# define ZEXPORTVA WINAPIV
+# else
+# define ZEXPORTVA FAR CDECL
+# endif
+# endif
+#endif
+
+#if defined (__BEOS__)
+# ifdef ZLIB_DLL
+# ifdef ZLIB_INTERNAL
+# define ZEXPORT __declspec(dllexport)
+# define ZEXPORTVA __declspec(dllexport)
+# else
+# define ZEXPORT __declspec(dllimport)
+# define ZEXPORTVA __declspec(dllimport)
+# endif
+# endif
+#endif
+
+#ifndef ZEXTERN
+# define ZEXTERN extern
+#endif
+#ifndef ZEXPORT
+# define ZEXPORT
+#endif
+#ifndef ZEXPORTVA
+# define ZEXPORTVA
+#endif
+
+#ifndef FAR
+# define FAR
+#endif
+
+#if !defined(__MACTYPES__)
+typedef unsigned char Byte; /* 8 bits */
+#endif
+typedef unsigned int uInt; /* 16 bits or more */
+typedef unsigned long uLong; /* 32 bits or more */
+
+#ifdef SMALL_MEDIUM
+ /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
+# define Bytef Byte FAR
+#else
+ typedef Byte FAR Bytef;
+#endif
+typedef char FAR charf;
+typedef int FAR intf;
+typedef uInt FAR uIntf;
+typedef uLong FAR uLongf;
+
+#ifdef STDC
+ typedef void const *voidpc;
+ typedef void FAR *voidpf;
+ typedef void *voidp;
+#else
+ typedef Byte const *voidpc;
+ typedef Byte FAR *voidpf;
+ typedef Byte *voidp;
+#endif
+
+#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
+# include <limits.h>
+# if (UINT_MAX == 0xffffffffUL)
+# define Z_U4 unsigned
+# elif (ULONG_MAX == 0xffffffffUL)
+# define Z_U4 unsigned long
+# elif (USHRT_MAX == 0xffffffffUL)
+# define Z_U4 unsigned short
+# endif
+#endif
+
+#ifdef Z_U4
+ typedef Z_U4 z_crc_t;
+#else
+ typedef unsigned long z_crc_t;
+#endif
+
+#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
+# define Z_HAVE_UNISTD_H
+#endif
+
+#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
+# define Z_HAVE_STDARG_H
+#endif
+
+#ifdef STDC
+# ifndef Z_SOLO
+# include <sys/types.h> /* for off_t */
+# endif
+#endif
+
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
+# ifndef Z_SOLO
+# include <stdarg.h> /* for va_list */
+# endif
+#endif
+
+#ifdef _WIN32
+# ifndef Z_SOLO
+# include <stddef.h> /* for wchar_t */
+# endif
+#endif
+
+/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
+ * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
+ * though the former does not conform to the LFS document), but considering
+ * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
+ * equivalently requesting no 64-bit operations
+ */
+#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
+# undef _LARGEFILE64_SOURCE
+#endif
+
+#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
+# define Z_HAVE_UNISTD_H
+#endif
+#ifndef Z_SOLO
+# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
+# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
+# ifdef VMS
+# include <unixio.h> /* for off_t */
+# endif
+# ifndef z_off_t
+# define z_off_t off_t
+# endif
+# endif
+#endif
+
+#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
+# define Z_LFS64
+#endif
+
+#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
+# define Z_LARGE64
+#endif
+
+#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
+# define Z_WANT64
+#endif
+
+#if !defined(SEEK_SET) && !defined(Z_SOLO)
+# define SEEK_SET 0 /* Seek from beginning of file. */
+# define SEEK_CUR 1 /* Seek from current position. */
+# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
+#endif
+
+#ifndef z_off_t
+# define z_off_t long
+#endif
+
+#if !defined(_WIN32) && defined(Z_LARGE64)
+# define z_off64_t off64_t
+#else
+# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
+# define z_off64_t __int64
+# else
+# define z_off64_t z_off_t
+# endif
+#endif
+
+/* MVS linker does not support external names larger than 8 bytes */
+#if defined(__MVS__)
+ #pragma map(deflateInit_,"DEIN")
+ #pragma map(deflateInit2_,"DEIN2")
+ #pragma map(deflateEnd,"DEEND")
+ #pragma map(deflateBound,"DEBND")
+ #pragma map(inflateInit_,"ININ")
+ #pragma map(inflateInit2_,"ININ2")
+ #pragma map(inflateEnd,"INEND")
+ #pragma map(inflateSync,"INSY")
+ #pragma map(inflateSetDictionary,"INSEDI")
+ #pragma map(compressBound,"CMBND")
+ #pragma map(inflate_table,"INTABL")
+ #pragma map(inflate_fast,"INFA")
+ #pragma map(inflate_copyright,"INCOPY")
+#endif
+
+#endif /* ZCONF_H */
diff --git a/protocols/Telegram/tgl/zlib/zlib.3 b/protocols/Telegram/tgl/zlib/zlib.3
new file mode 100644
index 0000000000..0160e62b69
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/zlib.3
@@ -0,0 +1,151 @@
+.TH ZLIB 3 "28 Apr 2013"
+.SH NAME
+zlib \- compression/decompression library
+.SH SYNOPSIS
+[see
+.I zlib.h
+for full description]
+.SH DESCRIPTION
+The
+.I zlib
+library is a general purpose data compression library.
+The code is thread safe, assuming that the standard library functions
+used are thread safe, such as memory allocation routines.
+It provides in-memory compression and decompression functions,
+including integrity checks of the uncompressed data.
+This version of the library supports only one compression method (deflation)
+but other algorithms may be added later
+with the same stream interface.
+.LP
+Compression can be done in a single step if the buffers are large enough
+or can be done by repeated calls of the compression function.
+In the latter case,
+the application must provide more input and/or consume the output
+(providing more output space) before each call.
+.LP
+The library also supports reading and writing files in
+.IR gzip (1)
+(.gz) format
+with an interface similar to that of stdio.
+.LP
+The library does not install any signal handler.
+The decoder checks the consistency of the compressed data,
+so the library should never crash even in the case of corrupted input.
+.LP
+All functions of the compression library are documented in the file
+.IR zlib.h .
+The distribution source includes examples of use of the library
+in the files
+.I test/example.c
+and
+.IR test/minigzip.c,
+as well as other examples in the
+.IR examples/
+directory.
+.LP
+Changes to this version are documented in the file
+.I ChangeLog
+that accompanies the source.
+.LP
+.I zlib
+is available in Java using the java.util.zip package:
+.IP
+http://java.sun.com/developer/technicalArticles/Programming/compression/
+.LP
+A Perl interface to
+.IR zlib ,
+written by Paul Marquess (pmqs@cpan.org),
+is available at CPAN (Comprehensive Perl Archive Network) sites,
+including:
+.IP
+http://search.cpan.org/~pmqs/IO-Compress-Zlib/
+.LP
+A Python interface to
+.IR zlib ,
+written by A.M. Kuchling (amk@magnet.com),
+is available in Python 1.5 and later versions:
+.IP
+http://docs.python.org/library/zlib.html
+.LP
+.I zlib
+is built into
+.IR tcl:
+.IP
+http://wiki.tcl.tk/4610
+.LP
+An experimental package to read and write files in .zip format,
+written on top of
+.I zlib
+by Gilles Vollant (info@winimage.com),
+is available at:
+.IP
+http://www.winimage.com/zLibDll/minizip.html
+and also in the
+.I contrib/minizip
+directory of the main
+.I zlib
+source distribution.
+.SH "SEE ALSO"
+The
+.I zlib
+web site can be found at:
+.IP
+http://zlib.net/
+.LP
+The data format used by the zlib library is described by RFC
+(Request for Comments) 1950 to 1952 in the files:
+.IP
+http://tools.ietf.org/html/rfc1950 (for the zlib header and trailer format)
+.br
+http://tools.ietf.org/html/rfc1951 (for the deflate compressed data format)
+.br
+http://tools.ietf.org/html/rfc1952 (for the gzip header and trailer format)
+.LP
+Mark Nelson wrote an article about
+.I zlib
+for the Jan. 1997 issue of Dr. Dobb's Journal;
+a copy of the article is available at:
+.IP
+http://marknelson.us/1997/01/01/zlib-engine/
+.SH "REPORTING PROBLEMS"
+Before reporting a problem,
+please check the
+.I zlib
+web site to verify that you have the latest version of
+.IR zlib ;
+otherwise,
+obtain the latest version and see if the problem still exists.
+Please read the
+.I zlib
+FAQ at:
+.IP
+http://zlib.net/zlib_faq.html
+.LP
+before asking for help.
+Send questions and/or comments to zlib@gzip.org,
+or (for the Windows DLL version) to Gilles Vollant (info@winimage.com).
+.SH AUTHORS
+Version 1.2.8
+Copyright (C) 1995-2013 Jean-loup Gailly (jloup@gzip.org)
+and Mark Adler (madler@alumni.caltech.edu).
+.LP
+This software is provided "as-is,"
+without any express or implied warranty.
+In no event will the authors be held liable for any damages
+arising from the use of this software.
+See the distribution directory with respect to requirements
+governing redistribution.
+The deflate format used by
+.I zlib
+was defined by Phil Katz.
+The deflate and
+.I zlib
+specifications were written by L. Peter Deutsch.
+Thanks to all the people who reported problems and suggested various
+improvements in
+.IR zlib ;
+who are too numerous to cite here.
+.LP
+UNIX manual page by R. P. C. Rodgers,
+U.S. National Library of Medicine (rodgers@nlm.nih.gov).
+.\" end of man page
diff --git a/protocols/Telegram/tgl/zlib/zlib.3.pdf b/protocols/Telegram/tgl/zlib/zlib.3.pdf
new file mode 100644
index 0000000000..a346b5d7e2
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/zlib.3.pdf
Binary files differ
diff --git a/protocols/Telegram/tgl/zlib/zlib.h b/protocols/Telegram/tgl/zlib/zlib.h
new file mode 100644
index 0000000000..3e0c7672ac
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/zlib.h
@@ -0,0 +1,1768 @@
+/* zlib.h -- interface of the 'zlib' general purpose compression library
+ version 1.2.8, April 28th, 2013
+
+ Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Jean-loup Gailly Mark Adler
+ jloup@gzip.org madler@alumni.caltech.edu
+
+
+ The data format used by the zlib library is described by RFCs (Request for
+ Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950
+ (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format).
+*/
+
+#ifndef ZLIB_H
+#define ZLIB_H
+
+#include "zconf.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ZLIB_VERSION "1.2.8"
+#define ZLIB_VERNUM 0x1280
+#define ZLIB_VER_MAJOR 1
+#define ZLIB_VER_MINOR 2
+#define ZLIB_VER_REVISION 8
+#define ZLIB_VER_SUBREVISION 0
+
+/*
+ The 'zlib' compression library provides in-memory compression and
+ decompression functions, including integrity checks of the uncompressed data.
+ This version of the library supports only one compression method (deflation)
+ but other algorithms will be added later and will have the same stream
+ interface.
+
+ Compression can be done in a single step if the buffers are large enough,
+ or can be done by repeated calls of the compression function. In the latter
+ case, the application must provide more input and/or consume the output
+ (providing more output space) before each call.
+
+ The compressed data format used by default by the in-memory functions is
+ the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
+ around a deflate stream, which is itself documented in RFC 1951.
+
+ The library also supports reading and writing files in gzip (.gz) format
+ with an interface similar to that of stdio using the functions that start
+ with "gz". The gzip format is different from the zlib format. gzip is a
+ gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
+
+ This library can optionally read and write gzip streams in memory as well.
+
+ The zlib format was designed to be compact and fast for use in memory
+ and on communications channels. The gzip format was designed for single-
+ file compression on file systems, has a larger header than zlib to maintain
+ directory information, and uses a different, slower check method than zlib.
+
+ The library does not install any signal handler. The decoder checks
+ the consistency of the compressed data, so the library should never crash
+ even in case of corrupted input.
+*/
+
+typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
+typedef void (*free_func) OF((voidpf opaque, voidpf address));
+
+struct internal_state;
+
+typedef struct z_stream_s {
+ z_const Bytef *next_in; /* next input byte */
+ uInt avail_in; /* number of bytes available at next_in */
+ uLong total_in; /* total number of input bytes read so far */
+
+ Bytef *next_out; /* next output byte should be put there */
+ uInt avail_out; /* remaining free space at next_out */
+ uLong total_out; /* total number of bytes output so far */
+
+ z_const char *msg; /* last error message, NULL if no error */
+ struct internal_state FAR *state; /* not visible by applications */
+
+ alloc_func zalloc; /* used to allocate the internal state */
+ free_func zfree; /* used to free the internal state */
+ voidpf opaque; /* private data object passed to zalloc and zfree */
+
+ int data_type; /* best guess about the data type: binary or text */
+ uLong adler; /* adler32 value of the uncompressed data */
+ uLong reserved; /* reserved for future use */
+} z_stream;
+
+typedef z_stream FAR *z_streamp;
+
+/*
+ gzip header information passed to and from zlib routines. See RFC 1952
+ for more details on the meanings of these fields.
+*/
+typedef struct gz_header_s {
+ int text; /* true if compressed data believed to be text */
+ uLong time; /* modification time */
+ int xflags; /* extra flags (not used when writing a gzip file) */
+ int os; /* operating system */
+ Bytef *extra; /* pointer to extra field or Z_NULL if none */
+ uInt extra_len; /* extra field length (valid if extra != Z_NULL) */
+ uInt extra_max; /* space at extra (only when reading header) */
+ Bytef *name; /* pointer to zero-terminated file name or Z_NULL */
+ uInt name_max; /* space at name (only when reading header) */
+ Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */
+ uInt comm_max; /* space at comment (only when reading header) */
+ int hcrc; /* true if there was or will be a header crc */
+ int done; /* true when done reading gzip header (not used
+ when writing a gzip file) */
+} gz_header;
+
+typedef gz_header FAR *gz_headerp;
+
+/*
+ The application must update next_in and avail_in when avail_in has dropped
+ to zero. It must update next_out and avail_out when avail_out has dropped
+ to zero. The application must initialize zalloc, zfree and opaque before
+ calling the init function. All other fields are set by the compression
+ library and must not be updated by the application.
+
+ The opaque value provided by the application will be passed as the first
+ parameter for calls of zalloc and zfree. This can be useful for custom
+ memory management. The compression library attaches no meaning to the
+ opaque value.
+
+ zalloc must return Z_NULL if there is not enough memory for the object.
+ If zlib is used in a multi-threaded application, zalloc and zfree must be
+ thread safe.
+
+ On 16-bit systems, the functions zalloc and zfree must be able to allocate
+ exactly 65536 bytes, but will not be required to allocate more than this if
+ the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers
+ returned by zalloc for objects of exactly 65536 bytes *must* have their
+ offset normalized to zero. The default allocation function provided by this
+ library ensures this (see zutil.c). To reduce memory requirements and avoid
+ any allocation of 64K objects, at the expense of compression ratio, compile
+ the library with -DMAX_WBITS=14 (see zconf.h).
+
+ The fields total_in and total_out can be used for statistics or progress
+ reports. After compression, total_in holds the total size of the
+ uncompressed data and may be saved for use in the decompressor (particularly
+ if the decompressor wants to decompress everything in a single step).
+*/
+
+ /* constants */
+
+#define Z_NO_FLUSH 0
+#define Z_PARTIAL_FLUSH 1
+#define Z_SYNC_FLUSH 2
+#define Z_FULL_FLUSH 3
+#define Z_FINISH 4
+#define Z_BLOCK 5
+#define Z_TREES 6
+/* Allowed flush values; see deflate() and inflate() below for details */
+
+#define Z_OK 0
+#define Z_STREAM_END 1
+#define Z_NEED_DICT 2
+#define Z_ERRNO (-1)
+#define Z_STREAM_ERROR (-2)
+#define Z_DATA_ERROR (-3)
+#define Z_MEM_ERROR (-4)
+#define Z_BUF_ERROR (-5)
+#define Z_VERSION_ERROR (-6)
+/* Return codes for the compression/decompression functions. Negative values
+ * are errors, positive values are used for special but normal events.
+ */
+
+#define Z_NO_COMPRESSION 0
+#define Z_BEST_SPEED 1
+#define Z_BEST_COMPRESSION 9
+#define Z_DEFAULT_COMPRESSION (-1)
+/* compression levels */
+
+#define Z_FILTERED 1
+#define Z_HUFFMAN_ONLY 2
+#define Z_RLE 3
+#define Z_FIXED 4
+#define Z_DEFAULT_STRATEGY 0
+/* compression strategy; see deflateInit2() below for details */
+
+#define Z_BINARY 0
+#define Z_TEXT 1
+#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */
+#define Z_UNKNOWN 2
+/* Possible values of the data_type field (though see inflate()) */
+
+#define Z_DEFLATED 8
+/* The deflate compression method (the only one supported in this version) */
+
+#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
+
+#define zlib_version zlibVersion()
+/* for compatibility with versions < 1.0.2 */
+
+
+ /* basic functions */
+
+ZEXTERN const char * ZEXPORT zlibVersion OF((void));
+/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
+ If the first character differs, the library code actually used is not
+ compatible with the zlib.h header file used by the application. This check
+ is automatically made by deflateInit and inflateInit.
+ */
+
+/*
+ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
+
+ Initializes the internal stream state for compression. The fields
+ zalloc, zfree and opaque must be initialized before by the caller. If
+ zalloc and zfree are set to Z_NULL, deflateInit updates them to use default
+ allocation functions.
+
+ The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
+ 1 gives best speed, 9 gives best compression, 0 gives no compression at all
+ (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION
+ requests a default compromise between speed and compression (currently
+ equivalent to level 6).
+
+ deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_STREAM_ERROR if level is not a valid compression level, or
+ Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
+ with the version assumed by the caller (ZLIB_VERSION). msg is set to null
+ if there is no error message. deflateInit does not perform any compression:
+ this will be done by deflate().
+*/
+
+
+ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
+/*
+ deflate compresses as much data as possible, and stops when the input
+ buffer becomes empty or the output buffer becomes full. It may introduce
+ some output latency (reading input without producing any output) except when
+ forced to flush.
+
+ The detailed semantics are as follows. deflate performs one or both of the
+ following actions:
+
+ - Compress more input starting at next_in and update next_in and avail_in
+ accordingly. If not all input can be processed (because there is not
+ enough room in the output buffer), next_in and avail_in are updated and
+ processing will resume at this point for the next call of deflate().
+
+ - Provide more output starting at next_out and update next_out and avail_out
+ accordingly. This action is forced if the parameter flush is non zero.
+ Forcing flush frequently degrades the compression ratio, so this parameter
+ should be set only when necessary (in interactive applications). Some
+ output may be provided even if flush is not set.
+
+ Before the call of deflate(), the application should ensure that at least
+ one of the actions is possible, by providing more input and/or consuming more
+ output, and updating avail_in or avail_out accordingly; avail_out should
+ never be zero before the call. The application can consume the compressed
+ output when it wants, for example when the output buffer is full (avail_out
+ == 0), or after each call of deflate(). If deflate returns Z_OK and with
+ zero avail_out, it must be called again after making room in the output
+ buffer because there might be more output pending.
+
+ Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
+ decide how much data to accumulate before producing output, in order to
+ maximize compression.
+
+ If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
+ flushed to the output buffer and the output is aligned on a byte boundary, so
+ that the decompressor can get all input data available so far. (In
+ particular avail_in is zero after the call if enough output space has been
+ provided before the call.) Flushing may degrade compression for some
+ compression algorithms and so it should be used only when necessary. This
+ completes the current deflate block and follows it with an empty stored block
+ that is three bits plus filler bits to the next byte, followed by four bytes
+ (00 00 ff ff).
+
+ If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the
+ output buffer, but the output is not aligned to a byte boundary. All of the
+ input data so far will be available to the decompressor, as for Z_SYNC_FLUSH.
+ This completes the current deflate block and follows it with an empty fixed
+ codes block that is 10 bits long. This assures that enough bytes are output
+ in order for the decompressor to finish the block before the empty fixed code
+ block.
+
+ If flush is set to Z_BLOCK, a deflate block is completed and emitted, as
+ for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to
+ seven bits of the current block are held to be written as the next byte after
+ the next deflate block is completed. In this case, the decompressor may not
+ be provided enough bits at this point in order to complete decompression of
+ the data provided so far to the compressor. It may need to wait for the next
+ block to be emitted. This is for advanced applications that need to control
+ the emission of deflate blocks.
+
+ If flush is set to Z_FULL_FLUSH, all output is flushed as with
+ Z_SYNC_FLUSH, and the compression state is reset so that decompression can
+ restart from this point if previous compressed data has been damaged or if
+ random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
+ compression.
+
+ If deflate returns with avail_out == 0, this function must be called again
+ with the same value of the flush parameter and more output space (updated
+ avail_out), until the flush is complete (deflate returns with non-zero
+ avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
+ avail_out is greater than six to avoid repeated flush markers due to
+ avail_out == 0 on return.
+
+ If the parameter flush is set to Z_FINISH, pending input is processed,
+ pending output is flushed and deflate returns with Z_STREAM_END if there was
+ enough output space; if deflate returns with Z_OK, this function must be
+ called again with Z_FINISH and more output space (updated avail_out) but no
+ more input data, until it returns with Z_STREAM_END or an error. After
+ deflate has returned Z_STREAM_END, the only possible operations on the stream
+ are deflateReset or deflateEnd.
+
+ Z_FINISH can be used immediately after deflateInit if all the compression
+ is to be done in a single step. In this case, avail_out must be at least the
+ value returned by deflateBound (see below). Then deflate is guaranteed to
+ return Z_STREAM_END. If not enough output space is provided, deflate will
+ not return Z_STREAM_END, and it must be called again as described above.
+
+ deflate() sets strm->adler to the adler32 checksum of all input read
+ so far (that is, total_in bytes).
+
+ deflate() may update strm->data_type if it can make a good guess about
+ the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered
+ binary. This field is only for information purposes and does not affect the
+ compression algorithm in any manner.
+
+ deflate() returns Z_OK if some progress has been made (more input
+ processed or more output produced), Z_STREAM_END if all input has been
+ consumed and all output has been produced (only when flush is set to
+ Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
+ if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible
+ (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not
+ fatal, and deflate() can be called again with more input and more output
+ space to continue compressing.
+*/
+
+
+ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
+/*
+ All dynamically allocated data structures for this stream are freed.
+ This function discards any unprocessed input and does not flush any pending
+ output.
+
+ deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
+ stream state was inconsistent, Z_DATA_ERROR if the stream was freed
+ prematurely (some input or output was discarded). In the error case, msg
+ may be set but then points to a static string (which must not be
+ deallocated).
+*/
+
+
+/*
+ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
+
+ Initializes the internal stream state for decompression. The fields
+ next_in, avail_in, zalloc, zfree and opaque must be initialized before by
+ the caller. If next_in is not Z_NULL and avail_in is large enough (the
+ exact value depends on the compression method), inflateInit determines the
+ compression method from the zlib header and allocates all data structures
+ accordingly; otherwise the allocation will be deferred to the first call of
+ inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to
+ use default allocation functions.
+
+ inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+ version assumed by the caller, or Z_STREAM_ERROR if the parameters are
+ invalid, such as a null pointer to the structure. msg is set to null if
+ there is no error message. inflateInit does not perform any decompression
+ apart from possibly reading the zlib header if present: actual decompression
+ will be done by inflate(). (So next_in and avail_in may be modified, but
+ next_out and avail_out are unused and unchanged.) The current implementation
+ of inflateInit() does not process any header information -- that is deferred
+ until inflate() is called.
+*/
+
+
+ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
+/*
+ inflate decompresses as much data as possible, and stops when the input
+ buffer becomes empty or the output buffer becomes full. It may introduce
+ some output latency (reading input without producing any output) except when
+ forced to flush.
+
+ The detailed semantics are as follows. inflate performs one or both of the
+ following actions:
+
+ - Decompress more input starting at next_in and update next_in and avail_in
+ accordingly. If not all input can be processed (because there is not
+ enough room in the output buffer), next_in is updated and processing will
+ resume at this point for the next call of inflate().
+
+ - Provide more output starting at next_out and update next_out and avail_out
+ accordingly. inflate() provides as much output as possible, until there is
+ no more input data or no more space in the output buffer (see below about
+ the flush parameter).
+
+ Before the call of inflate(), the application should ensure that at least
+ one of the actions is possible, by providing more input and/or consuming more
+ output, and updating the next_* and avail_* values accordingly. The
+ application can consume the uncompressed output when it wants, for example
+ when the output buffer is full (avail_out == 0), or after each call of
+ inflate(). If inflate returns Z_OK and with zero avail_out, it must be
+ called again after making room in the output buffer because there might be
+ more output pending.
+
+ The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH,
+ Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much
+ output as possible to the output buffer. Z_BLOCK requests that inflate()
+ stop if and when it gets to the next deflate block boundary. When decoding
+ the zlib or gzip format, this will cause inflate() to return immediately
+ after the header and before the first block. When doing a raw inflate,
+ inflate() will go ahead and process the first block, and will return when it
+ gets to the end of that block, or when it runs out of data.
+
+ The Z_BLOCK option assists in appending to or combining deflate streams.
+ Also to assist in this, on return inflate() will set strm->data_type to the
+ number of unused bits in the last byte taken from strm->next_in, plus 64 if
+ inflate() is currently decoding the last block in the deflate stream, plus
+ 128 if inflate() returned immediately after decoding an end-of-block code or
+ decoding the complete header up to just before the first byte of the deflate
+ stream. The end-of-block will not be indicated until all of the uncompressed
+ data from that block has been written to strm->next_out. The number of
+ unused bits may in general be greater than seven, except when bit 7 of
+ data_type is set, in which case the number of unused bits will be less than
+ eight. data_type is set as noted here every time inflate() returns for all
+ flush options, and so can be used to determine the amount of currently
+ consumed input in bits.
+
+ The Z_TREES option behaves as Z_BLOCK does, but it also returns when the
+ end of each deflate block header is reached, before any actual data in that
+ block is decoded. This allows the caller to determine the length of the
+ deflate block header for later use in random access within a deflate block.
+ 256 is added to the value of strm->data_type when inflate() returns
+ immediately after reaching the end of the deflate block header.
+
+ inflate() should normally be called until it returns Z_STREAM_END or an
+ error. However if all decompression is to be performed in a single step (a
+ single call of inflate), the parameter flush should be set to Z_FINISH. In
+ this case all pending input is processed and all pending output is flushed;
+ avail_out must be large enough to hold all of the uncompressed data for the
+ operation to complete. (The size of the uncompressed data may have been
+ saved by the compressor for this purpose.) The use of Z_FINISH is not
+ required to perform an inflation in one step. However it may be used to
+ inform inflate that a faster approach can be used for the single inflate()
+ call. Z_FINISH also informs inflate to not maintain a sliding window if the
+ stream completes, which reduces inflate's memory footprint. If the stream
+ does not complete, either because not all of the stream is provided or not
+ enough output space is provided, then a sliding window will be allocated and
+ inflate() can be called again to continue the operation as if Z_NO_FLUSH had
+ been used.
+
+ In this implementation, inflate() always flushes as much output as
+ possible to the output buffer, and always uses the faster approach on the
+ first call. So the effects of the flush parameter in this implementation are
+ on the return value of inflate() as noted below, when inflate() returns early
+ when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of
+ memory for a sliding window when Z_FINISH is used.
+
+ If a preset dictionary is needed after this call (see inflateSetDictionary
+ below), inflate sets strm->adler to the Adler-32 checksum of the dictionary
+ chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
+ strm->adler to the Adler-32 checksum of all output produced so far (that is,
+ total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
+ below. At the end of the stream, inflate() checks that its computed adler32
+ checksum is equal to that saved by the compressor and returns Z_STREAM_END
+ only if the checksum is correct.
+
+ inflate() can decompress and check either zlib-wrapped or gzip-wrapped
+ deflate data. The header type is detected automatically, if requested when
+ initializing with inflateInit2(). Any information contained in the gzip
+ header is not retained, so applications that need that information should
+ instead use raw inflate, see inflateInit2() below, or inflateBack() and
+ perform their own processing of the gzip header and trailer. When processing
+ gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output
+ producted so far. The CRC-32 is checked against the gzip trailer.
+
+ inflate() returns Z_OK if some progress has been made (more input processed
+ or more output produced), Z_STREAM_END if the end of the compressed data has
+ been reached and all uncompressed output has been produced, Z_NEED_DICT if a
+ preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
+ corrupted (input stream not conforming to the zlib format or incorrect check
+ value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
+ next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memory,
+ Z_BUF_ERROR if no progress is possible or if there was not enough room in the
+ output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
+ inflate() can be called again with more input and more output space to
+ continue decompressing. If Z_DATA_ERROR is returned, the application may
+ then call inflateSync() to look for a good compression block if a partial
+ recovery of the data is desired.
+*/
+
+
+ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
+/*
+ All dynamically allocated data structures for this stream are freed.
+ This function discards any unprocessed input and does not flush any pending
+ output.
+
+ inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
+ was inconsistent. In the error case, msg may be set but then points to a
+ static string (which must not be deallocated).
+*/
+
+
+ /* Advanced functions */
+
+/*
+ The following functions are needed only in some special applications.
+*/
+
+/*
+ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
+ int level,
+ int method,
+ int windowBits,
+ int memLevel,
+ int strategy));
+
+ This is another version of deflateInit with more compression options. The
+ fields next_in, zalloc, zfree and opaque must be initialized before by the
+ caller.
+
+ The method parameter is the compression method. It must be Z_DEFLATED in
+ this version of the library.
+
+ The windowBits parameter is the base two logarithm of the window size
+ (the size of the history buffer). It should be in the range 8..15 for this
+ version of the library. Larger values of this parameter result in better
+ compression at the expense of memory usage. The default value is 15 if
+ deflateInit is used instead.
+
+ windowBits can also be -8..-15 for raw deflate. In this case, -windowBits
+ determines the window size. deflate() will then generate raw deflate data
+ with no zlib header or trailer, and will not compute an adler32 check value.
+
+ windowBits can also be greater than 15 for optional gzip encoding. Add
+ 16 to windowBits to write a simple gzip header and trailer around the
+ compressed data instead of a zlib wrapper. The gzip header will have no
+ file name, no extra data, no comment, no modification time (set to zero), no
+ header crc, and the operating system will be set to 255 (unknown). If a
+ gzip stream is being written, strm->adler is a crc32 instead of an adler32.
+
+ The memLevel parameter specifies how much memory should be allocated
+ for the internal compression state. memLevel=1 uses minimum memory but is
+ slow and reduces compression ratio; memLevel=9 uses maximum memory for
+ optimal speed. The default value is 8. See zconf.h for total memory usage
+ as a function of windowBits and memLevel.
+
+ The strategy parameter is used to tune the compression algorithm. Use the
+ value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
+ filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
+ string match), or Z_RLE to limit match distances to one (run-length
+ encoding). Filtered data consists mostly of small values with a somewhat
+ random distribution. In this case, the compression algorithm is tuned to
+ compress them better. The effect of Z_FILTERED is to force more Huffman
+ coding and less string matching; it is somewhat intermediate between
+ Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as
+ fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The
+ strategy parameter only affects the compression ratio but not the
+ correctness of the compressed output even if it is not set appropriately.
+ Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler
+ decoder for special applications.
+
+ deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid
+ method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is
+ incompatible with the version assumed by the caller (ZLIB_VERSION). msg is
+ set to null if there is no error message. deflateInit2 does not perform any
+ compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
+ const Bytef *dictionary,
+ uInt dictLength));
+/*
+ Initializes the compression dictionary from the given byte sequence
+ without producing any compressed output. When using the zlib format, this
+ function must be called immediately after deflateInit, deflateInit2 or
+ deflateReset, and before any call of deflate. When doing raw deflate, this
+ function must be called either before any call of deflate, or immediately
+ after the completion of a deflate block, i.e. after all input has been
+ consumed and all output has been delivered when using any of the flush
+ options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH. The
+ compressor and decompressor must use exactly the same dictionary (see
+ inflateSetDictionary).
+
+ The dictionary should consist of strings (byte sequences) that are likely
+ to be encountered later in the data to be compressed, with the most commonly
+ used strings preferably put towards the end of the dictionary. Using a
+ dictionary is most useful when the data to be compressed is short and can be
+ predicted with good accuracy; the data can then be compressed better than
+ with the default empty dictionary.
+
+ Depending on the size of the compression data structures selected by
+ deflateInit or deflateInit2, a part of the dictionary may in effect be
+ discarded, for example if the dictionary is larger than the window size
+ provided in deflateInit or deflateInit2. Thus the strings most likely to be
+ useful should be put at the end of the dictionary, not at the front. In
+ addition, the current implementation of deflate will use at most the window
+ size minus 262 bytes of the provided dictionary.
+
+ Upon return of this function, strm->adler is set to the adler32 value
+ of the dictionary; the decompressor may later use this value to determine
+ which dictionary has been used by the compressor. (The adler32 value
+ applies to the whole dictionary even if only a subset of the dictionary is
+ actually used by the compressor.) If a raw deflate was requested, then the
+ adler32 value is not computed and strm->adler is not set.
+
+ deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
+ parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is
+ inconsistent (for example if deflate has already been called for this stream
+ or if not at a block boundary for raw deflate). deflateSetDictionary does
+ not perform any compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
+ z_streamp source));
+/*
+ Sets the destination stream as a complete copy of the source stream.
+
+ This function can be useful when several compression strategies will be
+ tried, for example when there are several ways of pre-processing the input
+ data with a filter. The streams that will be discarded should then be freed
+ by calling deflateEnd. Note that deflateCopy duplicates the internal
+ compression state which can be quite large, so this strategy is slow and can
+ consume lots of memory.
+
+ deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+ (such as zalloc being Z_NULL). msg is left unchanged in both source and
+ destination.
+*/
+
+ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
+/*
+ This function is equivalent to deflateEnd followed by deflateInit,
+ but does not free and reallocate all the internal compression state. The
+ stream will keep the same compression level and any other attributes that
+ may have been set by deflateInit2.
+
+ deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent (such as zalloc or state being Z_NULL).
+*/
+
+ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
+ int level,
+ int strategy));
+/*
+ Dynamically update the compression level and compression strategy. The
+ interpretation of level and strategy is as in deflateInit2. This can be
+ used to switch between compression and straight copy of the input data, or
+ to switch to a different kind of input data requiring a different strategy.
+ If the compression level is changed, the input available so far is
+ compressed with the old level (and may be flushed); the new level will take
+ effect only at the next call of deflate().
+
+ Before the call of deflateParams, the stream state must be set as for
+ a call of deflate(), since the currently available input may have to be
+ compressed and flushed. In particular, strm->avail_out must be non-zero.
+
+ deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
+ stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if
+ strm->avail_out was zero.
+*/
+
+ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
+ int good_length,
+ int max_lazy,
+ int nice_length,
+ int max_chain));
+/*
+ Fine tune deflate's internal compression parameters. This should only be
+ used by someone who understands the algorithm used by zlib's deflate for
+ searching for the best matching string, and even then only by the most
+ fanatic optimizer trying to squeeze out the last compressed bit for their
+ specific input data. Read the deflate.c source code for the meaning of the
+ max_lazy, good_length, nice_length, and max_chain parameters.
+
+ deflateTune() can be called after deflateInit() or deflateInit2(), and
+ returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
+ */
+
+ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
+ uLong sourceLen));
+/*
+ deflateBound() returns an upper bound on the compressed size after
+ deflation of sourceLen bytes. It must be called after deflateInit() or
+ deflateInit2(), and after deflateSetHeader(), if used. This would be used
+ to allocate an output buffer for deflation in a single pass, and so would be
+ called before deflate(). If that first deflate() call is provided the
+ sourceLen input bytes, an output buffer allocated to the size returned by
+ deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed
+ to return Z_STREAM_END. Note that it is possible for the compressed size to
+ be larger than the value returned by deflateBound() if flush options other
+ than Z_FINISH or Z_NO_FLUSH are used.
+*/
+
+ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm,
+ unsigned *pending,
+ int *bits));
+/*
+ deflatePending() returns the number of bytes and bits of output that have
+ been generated, but not yet provided in the available output. The bytes not
+ provided would be due to the available output space having being consumed.
+ The number of bits of output not provided are between 0 and 7, where they
+ await more bits to join them in order to fill out a full byte. If pending
+ or bits are Z_NULL, then those values are not set.
+
+ deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent.
+ */
+
+ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
+ int bits,
+ int value));
+/*
+ deflatePrime() inserts bits in the deflate output stream. The intent
+ is that this function is used to start off the deflate output with the bits
+ leftover from a previous deflate stream when appending to it. As such, this
+ function can only be used for raw deflate, and must be used before the first
+ deflate() call after a deflateInit2() or deflateReset(). bits must be less
+ than or equal to 16, and that many of the least significant bits of value
+ will be inserted in the output.
+
+ deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough
+ room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the
+ source stream state was inconsistent.
+*/
+
+ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
+ gz_headerp head));
+/*
+ deflateSetHeader() provides gzip header information for when a gzip
+ stream is requested by deflateInit2(). deflateSetHeader() may be called
+ after deflateInit2() or deflateReset() and before the first call of
+ deflate(). The text, time, os, extra field, name, and comment information
+ in the provided gz_header structure are written to the gzip header (xflag is
+ ignored -- the extra flags are set according to the compression level). The
+ caller must assure that, if not Z_NULL, name and comment are terminated with
+ a zero byte, and that if extra is not Z_NULL, that extra_len bytes are
+ available there. If hcrc is true, a gzip header crc is included. Note that
+ the current versions of the command-line version of gzip (up through version
+ 1.3.x) do not support header crc's, and will report that it is a "multi-part
+ gzip file" and give up.
+
+ If deflateSetHeader is not used, the default gzip header has text false,
+ the time set to zero, and os set to 255, with no extra, name, or comment
+ fields. The gzip header is returned to the default state by deflateReset().
+
+ deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
+ int windowBits));
+
+ This is another version of inflateInit with an extra parameter. The
+ fields next_in, avail_in, zalloc, zfree and opaque must be initialized
+ before by the caller.
+
+ The windowBits parameter is the base two logarithm of the maximum window
+ size (the size of the history buffer). It should be in the range 8..15 for
+ this version of the library. The default value is 15 if inflateInit is used
+ instead. windowBits must be greater than or equal to the windowBits value
+ provided to deflateInit2() while compressing, or it must be equal to 15 if
+ deflateInit2() was not used. If a compressed stream with a larger window
+ size is given as input, inflate() will return with the error code
+ Z_DATA_ERROR instead of trying to allocate a larger window.
+
+ windowBits can also be zero to request that inflate use the window size in
+ the zlib header of the compressed stream.
+
+ windowBits can also be -8..-15 for raw inflate. In this case, -windowBits
+ determines the window size. inflate() will then process raw deflate data,
+ not looking for a zlib or gzip header, not generating a check value, and not
+ looking for any check values for comparison at the end of the stream. This
+ is for use with other formats that use the deflate compressed data format
+ such as zip. Those formats provide their own check values. If a custom
+ format is developed using the raw deflate format for compressed data, it is
+ recommended that a check value such as an adler32 or a crc32 be applied to
+ the uncompressed data as is done in the zlib, gzip, and zip formats. For
+ most applications, the zlib format should be used as is. Note that comments
+ above on the use in deflateInit2() applies to the magnitude of windowBits.
+
+ windowBits can also be greater than 15 for optional gzip decoding. Add
+ 32 to windowBits to enable zlib and gzip decoding with automatic header
+ detection, or add 16 to decode only the gzip format (the zlib format will
+ return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a
+ crc32 instead of an adler32.
+
+ inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+ version assumed by the caller, or Z_STREAM_ERROR if the parameters are
+ invalid, such as a null pointer to the structure. msg is set to null if
+ there is no error message. inflateInit2 does not perform any decompression
+ apart from possibly reading the zlib header if present: actual decompression
+ will be done by inflate(). (So next_in and avail_in may be modified, but
+ next_out and avail_out are unused and unchanged.) The current implementation
+ of inflateInit2() does not process any header information -- that is
+ deferred until inflate() is called.
+*/
+
+ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
+ const Bytef *dictionary,
+ uInt dictLength));
+/*
+ Initializes the decompression dictionary from the given uncompressed byte
+ sequence. This function must be called immediately after a call of inflate,
+ if that call returned Z_NEED_DICT. The dictionary chosen by the compressor
+ can be determined from the adler32 value returned by that call of inflate.
+ The compressor and decompressor must use exactly the same dictionary (see
+ deflateSetDictionary). For raw inflate, this function can be called at any
+ time to set the dictionary. If the provided dictionary is smaller than the
+ window and there is already data in the window, then the provided dictionary
+ will amend what's there. The application must insure that the dictionary
+ that was used for compression is provided.
+
+ inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
+ parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is
+ inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
+ expected one (incorrect adler32 value). inflateSetDictionary does not
+ perform any decompression: this will be done by subsequent calls of
+ inflate().
+*/
+
+ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm,
+ Bytef *dictionary,
+ uInt *dictLength));
+/*
+ Returns the sliding dictionary being maintained by inflate. dictLength is
+ set to the number of bytes in the dictionary, and that many bytes are copied
+ to dictionary. dictionary must have enough space, where 32768 bytes is
+ always enough. If inflateGetDictionary() is called with dictionary equal to
+ Z_NULL, then only the dictionary length is returned, and nothing is copied.
+ Similary, if dictLength is Z_NULL, then it is not set.
+
+ inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the
+ stream state is inconsistent.
+*/
+
+ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
+/*
+ Skips invalid compressed data until a possible full flush point (see above
+ for the description of deflate with Z_FULL_FLUSH) can be found, or until all
+ available input is skipped. No output is provided.
+
+ inflateSync searches for a 00 00 FF FF pattern in the compressed data.
+ All full flush points have this pattern, but not all occurrences of this
+ pattern are full flush points.
+
+ inflateSync returns Z_OK if a possible full flush point has been found,
+ Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point
+ has been found, or Z_STREAM_ERROR if the stream structure was inconsistent.
+ In the success case, the application may save the current current value of
+ total_in which indicates where valid compressed data was found. In the
+ error case, the application may repeatedly call inflateSync, providing more
+ input each time, until success or end of the input data.
+*/
+
+ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
+ z_streamp source));
+/*
+ Sets the destination stream as a complete copy of the source stream.
+
+ This function can be useful when randomly accessing a large stream. The
+ first pass through the stream can periodically record the inflate state,
+ allowing restarting inflate at those points when randomly accessing the
+ stream.
+
+ inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+ (such as zalloc being Z_NULL). msg is left unchanged in both source and
+ destination.
+*/
+
+ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
+/*
+ This function is equivalent to inflateEnd followed by inflateInit,
+ but does not free and reallocate all the internal decompression state. The
+ stream will keep attributes that may have been set by inflateInit2.
+
+ inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent (such as zalloc or state being Z_NULL).
+*/
+
+ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
+ int windowBits));
+/*
+ This function is the same as inflateReset, but it also permits changing
+ the wrap and window size requests. The windowBits parameter is interpreted
+ the same as it is for inflateInit2.
+
+ inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent (such as zalloc or state being Z_NULL), or if
+ the windowBits parameter is invalid.
+*/
+
+ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
+ int bits,
+ int value));
+/*
+ This function inserts bits in the inflate input stream. The intent is
+ that this function is used to start inflating at a bit position in the
+ middle of a byte. The provided bits will be used before any bytes are used
+ from next_in. This function should only be used with raw inflate, and
+ should be used before the first inflate() call after inflateInit2() or
+ inflateReset(). bits must be less than or equal to 16, and that many of the
+ least significant bits of value will be inserted in the input.
+
+ If bits is negative, then the input stream bit buffer is emptied. Then
+ inflatePrime() can be called again to put bits in the buffer. This is used
+ to clear out bits leftover after feeding inflate a block description prior
+ to feeding inflate codes.
+
+ inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent.
+*/
+
+ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm));
+/*
+ This function returns two values, one in the lower 16 bits of the return
+ value, and the other in the remaining upper bits, obtained by shifting the
+ return value down 16 bits. If the upper value is -1 and the lower value is
+ zero, then inflate() is currently decoding information outside of a block.
+ If the upper value is -1 and the lower value is non-zero, then inflate is in
+ the middle of a stored block, with the lower value equaling the number of
+ bytes from the input remaining to copy. If the upper value is not -1, then
+ it is the number of bits back from the current bit position in the input of
+ the code (literal or length/distance pair) currently being processed. In
+ that case the lower value is the number of bytes already emitted for that
+ code.
+
+ A code is being processed if inflate is waiting for more input to complete
+ decoding of the code, or if it has completed decoding but is waiting for
+ more output space to write the literal or match data.
+
+ inflateMark() is used to mark locations in the input data for random
+ access, which may be at bit positions, and to note those cases where the
+ output of a code may span boundaries of random access blocks. The current
+ location in the input stream can be determined from avail_in and data_type
+ as noted in the description for the Z_BLOCK flush parameter for inflate.
+
+ inflateMark returns the value noted above or -1 << 16 if the provided
+ source stream state was inconsistent.
+*/
+
+ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
+ gz_headerp head));
+/*
+ inflateGetHeader() requests that gzip header information be stored in the
+ provided gz_header structure. inflateGetHeader() may be called after
+ inflateInit2() or inflateReset(), and before the first call of inflate().
+ As inflate() processes the gzip stream, head->done is zero until the header
+ is completed, at which time head->done is set to one. If a zlib stream is
+ being decoded, then head->done is set to -1 to indicate that there will be
+ no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be
+ used to force inflate() to return immediately after header processing is
+ complete and before any actual data is decompressed.
+
+ The text, time, xflags, and os fields are filled in with the gzip header
+ contents. hcrc is set to true if there is a header CRC. (The header CRC
+ was valid if done is set to one.) If extra is not Z_NULL, then extra_max
+ contains the maximum number of bytes to write to extra. Once done is true,
+ extra_len contains the actual extra field length, and extra contains the
+ extra field, or that field truncated if extra_max is less than extra_len.
+ If name is not Z_NULL, then up to name_max characters are written there,
+ terminated with a zero unless the length is greater than name_max. If
+ comment is not Z_NULL, then up to comm_max characters are written there,
+ terminated with a zero unless the length is greater than comm_max. When any
+ of extra, name, or comment are not Z_NULL and the respective field is not
+ present in the header, then that field is set to Z_NULL to signal its
+ absence. This allows the use of deflateSetHeader() with the returned
+ structure to duplicate the header. However if those fields are set to
+ allocated memory, then the application will need to save those pointers
+ elsewhere so that they can be eventually freed.
+
+ If inflateGetHeader is not used, then the header information is simply
+ discarded. The header is always checked for validity, including the header
+ CRC if present. inflateReset() will reset the process to discard the header
+ information. The application would need to call inflateGetHeader() again to
+ retrieve the header from the next gzip stream.
+
+ inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
+ unsigned char FAR *window));
+
+ Initialize the internal stream state for decompression using inflateBack()
+ calls. The fields zalloc, zfree and opaque in strm must be initialized
+ before the call. If zalloc and zfree are Z_NULL, then the default library-
+ derived memory allocation routines are used. windowBits is the base two
+ logarithm of the window size, in the range 8..15. window is a caller
+ supplied buffer of that size. Except for special applications where it is
+ assured that deflate was used with small window sizes, windowBits must be 15
+ and a 32K byte window must be supplied to be able to decompress general
+ deflate streams.
+
+ See inflateBack() for the usage of these routines.
+
+ inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
+ the parameters are invalid, Z_MEM_ERROR if the internal state could not be
+ allocated, or Z_VERSION_ERROR if the version of the library does not match
+ the version of the header file.
+*/
+
+typedef unsigned (*in_func) OF((void FAR *,
+ z_const unsigned char FAR * FAR *));
+typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
+
+ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
+ in_func in, void FAR *in_desc,
+ out_func out, void FAR *out_desc));
+/*
+ inflateBack() does a raw inflate with a single call using a call-back
+ interface for input and output. This is potentially more efficient than
+ inflate() for file i/o applications, in that it avoids copying between the
+ output and the sliding window by simply making the window itself the output
+ buffer. inflate() can be faster on modern CPUs when used with large
+ buffers. inflateBack() trusts the application to not change the output
+ buffer passed by the output function, at least until inflateBack() returns.
+
+ inflateBackInit() must be called first to allocate the internal state
+ and to initialize the state with the user-provided window buffer.
+ inflateBack() may then be used multiple times to inflate a complete, raw
+ deflate stream with each call. inflateBackEnd() is then called to free the
+ allocated state.
+
+ A raw deflate stream is one with no zlib or gzip header or trailer.
+ This routine would normally be used in a utility that reads zip or gzip
+ files and writes out uncompressed files. The utility would decode the
+ header and process the trailer on its own, hence this routine expects only
+ the raw deflate stream to decompress. This is different from the normal
+ behavior of inflate(), which expects either a zlib or gzip header and
+ trailer around the deflate stream.
+
+ inflateBack() uses two subroutines supplied by the caller that are then
+ called by inflateBack() for input and output. inflateBack() calls those
+ routines until it reads a complete deflate stream and writes out all of the
+ uncompressed data, or until it encounters an error. The function's
+ parameters and return types are defined above in the in_func and out_func
+ typedefs. inflateBack() will call in(in_desc, &buf) which should return the
+ number of bytes of provided input, and a pointer to that input in buf. If
+ there is no input available, in() must return zero--buf is ignored in that
+ case--and inflateBack() will return a buffer error. inflateBack() will call
+ out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out()
+ should return zero on success, or non-zero on failure. If out() returns
+ non-zero, inflateBack() will return with an error. Neither in() nor out()
+ are permitted to change the contents of the window provided to
+ inflateBackInit(), which is also the buffer that out() uses to write from.
+ The length written by out() will be at most the window size. Any non-zero
+ amount of input may be provided by in().
+
+ For convenience, inflateBack() can be provided input on the first call by
+ setting strm->next_in and strm->avail_in. If that input is exhausted, then
+ in() will be called. Therefore strm->next_in must be initialized before
+ calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called
+ immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in
+ must also be initialized, and then if strm->avail_in is not zero, input will
+ initially be taken from strm->next_in[0 .. strm->avail_in - 1].
+
+ The in_desc and out_desc parameters of inflateBack() is passed as the
+ first parameter of in() and out() respectively when they are called. These
+ descriptors can be optionally used to pass any information that the caller-
+ supplied in() and out() functions need to do their job.
+
+ On return, inflateBack() will set strm->next_in and strm->avail_in to
+ pass back any unused input that was provided by the last in() call. The
+ return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
+ if in() or out() returned an error, Z_DATA_ERROR if there was a format error
+ in the deflate stream (in which case strm->msg is set to indicate the nature
+ of the error), or Z_STREAM_ERROR if the stream was not properly initialized.
+ In the case of Z_BUF_ERROR, an input or output error can be distinguished
+ using strm->next_in which will be Z_NULL only if in() returned an error. If
+ strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning
+ non-zero. (in() will always be called before out(), so strm->next_in is
+ assured to be defined if out() returns non-zero.) Note that inflateBack()
+ cannot return Z_OK.
+*/
+
+ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
+/*
+ All memory allocated by inflateBackInit() is freed.
+
+ inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream
+ state was inconsistent.
+*/
+
+ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
+/* Return flags indicating compile-time options.
+
+ Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
+ 1.0: size of uInt
+ 3.2: size of uLong
+ 5.4: size of voidpf (pointer)
+ 7.6: size of z_off_t
+
+ Compiler, assembler, and debug options:
+ 8: DEBUG
+ 9: ASMV or ASMINF -- use ASM code
+ 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
+ 11: 0 (reserved)
+
+ One-time table building (smaller code, but not thread-safe if true):
+ 12: BUILDFIXED -- build static block decoding tables when needed
+ 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed
+ 14,15: 0 (reserved)
+
+ Library content (indicates missing functionality):
+ 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking
+ deflate code when not needed)
+ 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect
+ and decode gzip streams (to avoid linking crc code)
+ 18-19: 0 (reserved)
+
+ Operation variations (changes in library functionality):
+ 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate
+ 21: FASTEST -- deflate algorithm with only one, lowest compression level
+ 22,23: 0 (reserved)
+
+ The sprintf variant used by gzprintf (zero is best):
+ 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format
+ 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!
+ 26: 0 = returns value, 1 = void -- 1 means inferred string length returned
+
+ Remainder:
+ 27-31: 0 (reserved)
+ */
+
+#ifndef Z_SOLO
+
+ /* utility functions */
+
+/*
+ The following utility functions are implemented on top of the basic
+ stream-oriented functions. To simplify the interface, some default options
+ are assumed (compression level and memory usage, standard memory allocation
+ functions). The source code of these utility functions can be modified if
+ you need special options.
+*/
+
+ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen));
+/*
+ Compresses the source buffer into the destination buffer. sourceLen is
+ the byte length of the source buffer. Upon entry, destLen is the total size
+ of the destination buffer, which must be at least the value returned by
+ compressBound(sourceLen). Upon exit, destLen is the actual size of the
+ compressed buffer.
+
+ compress returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if there was not enough room in the output
+ buffer.
+*/
+
+ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen,
+ int level));
+/*
+ Compresses the source buffer into the destination buffer. The level
+ parameter has the same meaning as in deflateInit. sourceLen is the byte
+ length of the source buffer. Upon entry, destLen is the total size of the
+ destination buffer, which must be at least the value returned by
+ compressBound(sourceLen). Upon exit, destLen is the actual size of the
+ compressed buffer.
+
+ compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_BUF_ERROR if there was not enough room in the output buffer,
+ Z_STREAM_ERROR if the level parameter is invalid.
+*/
+
+ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
+/*
+ compressBound() returns an upper bound on the compressed size after
+ compress() or compress2() on sourceLen bytes. It would be used before a
+ compress() or compress2() call to allocate the destination buffer.
+*/
+
+ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen));
+/*
+ Decompresses the source buffer into the destination buffer. sourceLen is
+ the byte length of the source buffer. Upon entry, destLen is the total size
+ of the destination buffer, which must be large enough to hold the entire
+ uncompressed data. (The size of the uncompressed data must have been saved
+ previously by the compressor and transmitted to the decompressor by some
+ mechanism outside the scope of this compression library.) Upon exit, destLen
+ is the actual size of the uncompressed buffer.
+
+ uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if there was not enough room in the output
+ buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. In
+ the case where there is not enough room, uncompress() will fill the output
+ buffer with the uncompressed data up to that point.
+*/
+
+ /* gzip file access functions */
+
+/*
+ This library supports reading and writing files in gzip (.gz) format with
+ an interface similar to that of stdio, using the functions that start with
+ "gz". The gzip format is different from the zlib format. gzip is a gzip
+ wrapper, documented in RFC 1952, wrapped around a deflate stream.
+*/
+
+typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */
+
+/*
+ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
+
+ Opens a gzip (.gz) file for reading or writing. The mode parameter is as
+ in fopen ("rb" or "wb") but can also include a compression level ("wb9") or
+ a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only
+ compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F'
+ for fixed code compression as in "wb9F". (See the description of
+ deflateInit2 for more information about the strategy parameter.) 'T' will
+ request transparent writing or appending with no compression and not using
+ the gzip format.
+
+ "a" can be used instead of "w" to request that the gzip stream that will
+ be written be appended to the file. "+" will result in an error, since
+ reading and writing to the same gzip file is not supported. The addition of
+ "x" when writing will create the file exclusively, which fails if the file
+ already exists. On systems that support it, the addition of "e" when
+ reading or writing will set the flag to close the file on an execve() call.
+
+ These functions, as well as gzip, will read and decode a sequence of gzip
+ streams in a file. The append function of gzopen() can be used to create
+ such a file. (Also see gzflush() for another way to do this.) When
+ appending, gzopen does not test whether the file begins with a gzip stream,
+ nor does it look for the end of the gzip streams to begin appending. gzopen
+ will simply append a gzip stream to the existing file.
+
+ gzopen can be used to read a file which is not in gzip format; in this
+ case gzread will directly read from the file without decompression. When
+ reading, this will be detected automatically by looking for the magic two-
+ byte gzip header.
+
+ gzopen returns NULL if the file could not be opened, if there was
+ insufficient memory to allocate the gzFile state, or if an invalid mode was
+ specified (an 'r', 'w', or 'a' was not provided, or '+' was provided).
+ errno can be checked to determine if the reason gzopen failed was that the
+ file could not be opened.
+*/
+
+ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
+/*
+ gzdopen associates a gzFile with the file descriptor fd. File descriptors
+ are obtained from calls like open, dup, creat, pipe or fileno (if the file
+ has been previously opened with fopen). The mode parameter is as in gzopen.
+
+ The next call of gzclose on the returned gzFile will also close the file
+ descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
+ fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd,
+ mode);. The duplicated descriptor should be saved to avoid a leak, since
+ gzdopen does not close fd if it fails. If you are using fileno() to get the
+ file descriptor from a FILE *, then you will have to use dup() to avoid
+ double-close()ing the file descriptor. Both gzclose() and fclose() will
+ close the associated file descriptor, so they need to have different file
+ descriptors.
+
+ gzdopen returns NULL if there was insufficient memory to allocate the
+ gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not
+ provided, or '+' was provided), or if fd is -1. The file descriptor is not
+ used until the next gz* read, write, seek, or close operation, so gzdopen
+ will not detect if fd is invalid (unless fd is -1).
+*/
+
+ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
+/*
+ Set the internal buffer size used by this library's functions. The
+ default buffer size is 8192 bytes. This function must be called after
+ gzopen() or gzdopen(), and before any other calls that read or write the
+ file. The buffer memory allocation is always deferred to the first read or
+ write. Two buffers are allocated, either both of the specified size when
+ writing, or one of the specified size and the other twice that size when
+ reading. A larger buffer size of, for example, 64K or 128K bytes will
+ noticeably increase the speed of decompression (reading).
+
+ The new buffer size also affects the maximum length for gzprintf().
+
+ gzbuffer() returns 0 on success, or -1 on failure, such as being called
+ too late.
+*/
+
+ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
+/*
+ Dynamically update the compression level or strategy. See the description
+ of deflateInit2 for the meaning of these parameters.
+
+ gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
+ opened for writing.
+*/
+
+ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
+/*
+ Reads the given number of uncompressed bytes from the compressed file. If
+ the input file is not in gzip format, gzread copies the given number of
+ bytes into the buffer directly from the file.
+
+ After reaching the end of a gzip stream in the input, gzread will continue
+ to read, looking for another gzip stream. Any number of gzip streams may be
+ concatenated in the input file, and will all be decompressed by gzread().
+ If something other than a gzip stream is encountered after a gzip stream,
+ that remaining trailing garbage is ignored (and no error is returned).
+
+ gzread can be used to read a gzip file that is being concurrently written.
+ Upon reaching the end of the input, gzread will return with the available
+ data. If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then
+ gzclearerr can be used to clear the end of file indicator in order to permit
+ gzread to be tried again. Z_OK indicates that a gzip stream was completed
+ on the last gzread. Z_BUF_ERROR indicates that the input file ended in the
+ middle of a gzip stream. Note that gzread does not return -1 in the event
+ of an incomplete gzip stream. This error is deferred until gzclose(), which
+ will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip
+ stream. Alternatively, gzerror can be used before gzclose to detect this
+ case.
+
+ gzread returns the number of uncompressed bytes actually read, less than
+ len for end of file, or -1 for error.
+*/
+
+ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
+ voidpc buf, unsigned len));
+/*
+ Writes the given number of uncompressed bytes into the compressed file.
+ gzwrite returns the number of uncompressed bytes written or 0 in case of
+ error.
+*/
+
+ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
+/*
+ Converts, formats, and writes the arguments to the compressed file under
+ control of the format string, as in fprintf. gzprintf returns the number of
+ uncompressed bytes actually written, or 0 in case of error. The number of
+ uncompressed bytes written is limited to 8191, or one less than the buffer
+ size given to gzbuffer(). The caller should assure that this limit is not
+ exceeded. If it is exceeded, then gzprintf() will return an error (0) with
+ nothing written. In this case, there may also be a buffer overflow with
+ unpredictable consequences, which is possible only if zlib was compiled with
+ the insecure functions sprintf() or vsprintf() because the secure snprintf()
+ or vsnprintf() functions were not available. This can be determined using
+ zlibCompileFlags().
+*/
+
+ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
+/*
+ Writes the given null-terminated string to the compressed file, excluding
+ the terminating null character.
+
+ gzputs returns the number of characters written, or -1 in case of error.
+*/
+
+ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
+/*
+ Reads bytes from the compressed file until len-1 characters are read, or a
+ newline character is read and transferred to buf, or an end-of-file
+ condition is encountered. If any characters are read or if len == 1, the
+ string is terminated with a null character. If no characters are read due
+ to an end-of-file or len < 1, then the buffer is left untouched.
+
+ gzgets returns buf which is a null-terminated string, or it returns NULL
+ for end-of-file or in case of error. If there was an error, the contents at
+ buf are indeterminate.
+*/
+
+ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
+/*
+ Writes c, converted to an unsigned char, into the compressed file. gzputc
+ returns the value that was written, or -1 in case of error.
+*/
+
+ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
+/*
+ Reads one byte from the compressed file. gzgetc returns this byte or -1
+ in case of end of file or error. This is implemented as a macro for speed.
+ As such, it does not do all of the checking the other functions do. I.e.
+ it does not check to see if file is NULL, nor whether the structure file
+ points to has been clobbered or not.
+*/
+
+ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
+/*
+ Push one character back onto the stream to be read as the first character
+ on the next read. At least one character of push-back is allowed.
+ gzungetc() returns the character pushed, or -1 on failure. gzungetc() will
+ fail if c is -1, and may fail if a character has been pushed but not read
+ yet. If gzungetc is used immediately after gzopen or gzdopen, at least the
+ output buffer size of pushed characters is allowed. (See gzbuffer above.)
+ The pushed character will be discarded if the stream is repositioned with
+ gzseek() or gzrewind().
+*/
+
+ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
+/*
+ Flushes all pending output into the compressed file. The parameter flush
+ is as in the deflate() function. The return value is the zlib error number
+ (see function gzerror below). gzflush is only permitted when writing.
+
+ If the flush parameter is Z_FINISH, the remaining data is written and the
+ gzip stream is completed in the output. If gzwrite() is called again, a new
+ gzip stream will be started in the output. gzread() is able to read such
+ concatented gzip streams.
+
+ gzflush should be called only when strictly necessary because it will
+ degrade compression if called too often.
+*/
+
+/*
+ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
+ z_off_t offset, int whence));
+
+ Sets the starting position for the next gzread or gzwrite on the given
+ compressed file. The offset represents a number of bytes in the
+ uncompressed data stream. The whence parameter is defined as in lseek(2);
+ the value SEEK_END is not supported.
+
+ If the file is opened for reading, this function is emulated but can be
+ extremely slow. If the file is opened for writing, only forward seeks are
+ supported; gzseek then compresses a sequence of zeroes up to the new
+ starting position.
+
+ gzseek returns the resulting offset location as measured in bytes from
+ the beginning of the uncompressed stream, or -1 in case of error, in
+ particular if the file is opened for writing and the new starting position
+ would be before the current position.
+*/
+
+ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
+/*
+ Rewinds the given file. This function is supported only for reading.
+
+ gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
+*/
+
+/*
+ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
+
+ Returns the starting position for the next gzread or gzwrite on the given
+ compressed file. This position represents a number of bytes in the
+ uncompressed data stream, and is zero when starting, even if appending or
+ reading a gzip stream from the middle of a file using gzdopen().
+
+ gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
+*/
+
+/*
+ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
+
+ Returns the current offset in the file being read or written. This offset
+ includes the count of bytes that precede the gzip stream, for example when
+ appending or when using gzdopen() for reading. When reading, the offset
+ does not include as yet unused buffered input. This information can be used
+ for a progress indicator. On error, gzoffset() returns -1.
+*/
+
+ZEXTERN int ZEXPORT gzeof OF((gzFile file));
+/*
+ Returns true (1) if the end-of-file indicator has been set while reading,
+ false (0) otherwise. Note that the end-of-file indicator is set only if the
+ read tried to go past the end of the input, but came up short. Therefore,
+ just like feof(), gzeof() may return false even if there is no more data to
+ read, in the event that the last read request was for the exact number of
+ bytes remaining in the input file. This will happen if the input file size
+ is an exact multiple of the buffer size.
+
+ If gzeof() returns true, then the read functions will return no more data,
+ unless the end-of-file indicator is reset by gzclearerr() and the input file
+ has grown since the previous end of file was detected.
+*/
+
+ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
+/*
+ Returns true (1) if file is being copied directly while reading, or false
+ (0) if file is a gzip stream being decompressed.
+
+ If the input file is empty, gzdirect() will return true, since the input
+ does not contain a gzip stream.
+
+ If gzdirect() is used immediately after gzopen() or gzdopen() it will
+ cause buffers to be allocated to allow reading the file to determine if it
+ is a gzip file. Therefore if gzbuffer() is used, it should be called before
+ gzdirect().
+
+ When writing, gzdirect() returns true (1) if transparent writing was
+ requested ("wT" for the gzopen() mode), or false (0) otherwise. (Note:
+ gzdirect() is not needed when writing. Transparent writing must be
+ explicitly requested, so the application already knows the answer. When
+ linking statically, using gzdirect() will include all of the zlib code for
+ gzip file reading and decompression, which may not be desired.)
+*/
+
+ZEXTERN int ZEXPORT gzclose OF((gzFile file));
+/*
+ Flushes all pending output if necessary, closes the compressed file and
+ deallocates the (de)compression state. Note that once file is closed, you
+ cannot call gzerror with file, since its structures have been deallocated.
+ gzclose must not be called more than once on the same file, just as free
+ must not be called more than once on the same allocation.
+
+ gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a
+ file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the
+ last read ended in the middle of a gzip stream, or Z_OK on success.
+*/
+
+ZEXTERN int ZEXPORT gzclose_r OF((gzFile file));
+ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
+/*
+ Same as gzclose(), but gzclose_r() is only for use when reading, and
+ gzclose_w() is only for use when writing or appending. The advantage to
+ using these instead of gzclose() is that they avoid linking in zlib
+ compression or decompression code that is not used when only reading or only
+ writing respectively. If gzclose() is used, then both compression and
+ decompression code will be included the application when linking to a static
+ zlib library.
+*/
+
+ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
+/*
+ Returns the error message for the last error which occurred on the given
+ compressed file. errnum is set to zlib error number. If an error occurred
+ in the file system and not in the compression library, errnum is set to
+ Z_ERRNO and the application may consult errno to get the exact error code.
+
+ The application must not modify the returned string. Future calls to
+ this function may invalidate the previously returned string. If file is
+ closed, then the string previously returned by gzerror will no longer be
+ available.
+
+ gzerror() should be used to distinguish errors from end-of-file for those
+ functions above that do not distinguish those cases in their return values.
+*/
+
+ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
+/*
+ Clears the error and end-of-file flags for file. This is analogous to the
+ clearerr() function in stdio. This is useful for continuing to read a gzip
+ file that is being written concurrently.
+*/
+
+#endif /* !Z_SOLO */
+
+ /* checksum functions */
+
+/*
+ These functions are not related to compression but are exported
+ anyway because they might be useful in applications using the compression
+ library.
+*/
+
+ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
+/*
+ Update a running Adler-32 checksum with the bytes buf[0..len-1] and
+ return the updated checksum. If buf is Z_NULL, this function returns the
+ required initial value for the checksum.
+
+ An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
+ much faster.
+
+ Usage example:
+
+ uLong adler = adler32(0L, Z_NULL, 0);
+
+ while (read_buffer(buffer, length) != EOF) {
+ adler = adler32(adler, buffer, length);
+ }
+ if (adler != original_adler) error();
+*/
+
+/*
+ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
+ z_off_t len2));
+
+ Combine two Adler-32 checksums into one. For two sequences of bytes, seq1
+ and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
+ each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of
+ seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. Note
+ that the z_off_t type (like off_t) is a signed integer. If len2 is
+ negative, the result has no meaning or utility.
+*/
+
+ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
+/*
+ Update a running CRC-32 with the bytes buf[0..len-1] and return the
+ updated CRC-32. If buf is Z_NULL, this function returns the required
+ initial value for the crc. Pre- and post-conditioning (one's complement) is
+ performed within this function so it shouldn't be done by the application.
+
+ Usage example:
+
+ uLong crc = crc32(0L, Z_NULL, 0);
+
+ while (read_buffer(buffer, length) != EOF) {
+ crc = crc32(crc, buffer, length);
+ }
+ if (crc != original_crc) error();
+*/
+
+/*
+ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
+
+ Combine two CRC-32 check values into one. For two sequences of bytes,
+ seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
+ calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32
+ check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
+ len2.
+*/
+
+
+ /* various hacks, don't look :) */
+
+/* deflateInit and inflateInit are macros to allow checking the zlib version
+ * and the compiler's view of z_stream:
+ */
+ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
+ const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
+ const char *version, int stream_size));
+ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
+ int windowBits, int memLevel,
+ int strategy, const char *version,
+ int stream_size));
+ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
+ const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
+ unsigned char FAR *window,
+ const char *version,
+ int stream_size));
+#define deflateInit(strm, level) \
+ deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
+#define inflateInit(strm) \
+ inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
+#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
+ deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
+ (strategy), ZLIB_VERSION, (int)sizeof(z_stream))
+#define inflateInit2(strm, windowBits) \
+ inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
+ (int)sizeof(z_stream))
+#define inflateBackInit(strm, windowBits, window) \
+ inflateBackInit_((strm), (windowBits), (window), \
+ ZLIB_VERSION, (int)sizeof(z_stream))
+
+#ifndef Z_SOLO
+
+/* gzgetc() macro and its supporting function and exposed data structure. Note
+ * that the real internal state is much larger than the exposed structure.
+ * This abbreviated structure exposes just enough for the gzgetc() macro. The
+ * user should not mess with these exposed elements, since their names or
+ * behavior could change in the future, perhaps even capriciously. They can
+ * only be used by the gzgetc() macro. You have been warned.
+ */
+struct gzFile_s {
+ unsigned have;
+ unsigned char *next;
+ z_off64_t pos;
+};
+ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
+#ifdef Z_PREFIX_SET
+# undef z_gzgetc
+# define z_gzgetc(g) \
+ ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g))
+#else
+# define gzgetc(g) \
+ ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g))
+#endif
+
+/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or
+ * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if
+ * both are true, the application gets the *64 functions, and the regular
+ * functions are changed to 64 bits) -- in case these are set on systems
+ * without large file support, _LFS64_LARGEFILE must also be true
+ */
+#ifdef Z_LARGE64
+ ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+ ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
+ ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
+ ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
+ ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
+ ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
+#endif
+
+#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
+# ifdef Z_PREFIX_SET
+# define z_gzopen z_gzopen64
+# define z_gzseek z_gzseek64
+# define z_gztell z_gztell64
+# define z_gzoffset z_gzoffset64
+# define z_adler32_combine z_adler32_combine64
+# define z_crc32_combine z_crc32_combine64
+# else
+# define gzopen gzopen64
+# define gzseek gzseek64
+# define gztell gztell64
+# define gzoffset gzoffset64
+# define adler32_combine adler32_combine64
+# define crc32_combine crc32_combine64
+# endif
+# ifndef Z_LARGE64
+ ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+ ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int));
+ ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile));
+ ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
+ ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
+ ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
+# endif
+#else
+ ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
+ ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int));
+ ZEXTERN z_off_t ZEXPORT gztell OF((gzFile));
+ ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
+ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
+ ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
+#endif
+
+#else /* Z_SOLO */
+
+ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
+ ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
+
+#endif /* !Z_SOLO */
+
+/* hack for buggy compilers */
+#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
+ struct internal_state {int dummy;};
+#endif
+
+/* undocumented functions */
+ZEXTERN const char * ZEXPORT zError OF((int));
+ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp));
+ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void));
+ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int));
+ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
+ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
+#if defined(_WIN32) && !defined(Z_SOLO)
+ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
+ const char *mode));
+#endif
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
+# ifndef Z_SOLO
+ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file,
+ const char *format,
+ va_list va));
+# endif
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ZLIB_H */
diff --git a/protocols/Telegram/tgl/zlib/zlib.map b/protocols/Telegram/tgl/zlib/zlib.map
new file mode 100644
index 0000000000..55c6647eb4
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/zlib.map
@@ -0,0 +1,83 @@
+ZLIB_1.2.0 {
+ global:
+ compressBound;
+ deflateBound;
+ inflateBack;
+ inflateBackEnd;
+ inflateBackInit_;
+ inflateCopy;
+ local:
+ deflate_copyright;
+ inflate_copyright;
+ inflate_fast;
+ inflate_table;
+ zcalloc;
+ zcfree;
+ z_errmsg;
+ gz_error;
+ gz_intmax;
+ _*;
+};
+
+ZLIB_1.2.0.2 {
+ gzclearerr;
+ gzungetc;
+ zlibCompileFlags;
+} ZLIB_1.2.0;
+
+ZLIB_1.2.0.8 {
+ deflatePrime;
+} ZLIB_1.2.0.2;
+
+ZLIB_1.2.2 {
+ adler32_combine;
+ crc32_combine;
+ deflateSetHeader;
+ inflateGetHeader;
+} ZLIB_1.2.0.8;
+
+ZLIB_1.2.2.3 {
+ deflateTune;
+ gzdirect;
+} ZLIB_1.2.2;
+
+ZLIB_1.2.2.4 {
+ inflatePrime;
+} ZLIB_1.2.2.3;
+
+ZLIB_1.2.3.3 {
+ adler32_combine64;
+ crc32_combine64;
+ gzopen64;
+ gzseek64;
+ gztell64;
+ inflateUndermine;
+} ZLIB_1.2.2.4;
+
+ZLIB_1.2.3.4 {
+ inflateReset2;
+ inflateMark;
+} ZLIB_1.2.3.3;
+
+ZLIB_1.2.3.5 {
+ gzbuffer;
+ gzoffset;
+ gzoffset64;
+ gzclose_r;
+ gzclose_w;
+} ZLIB_1.2.3.4;
+
+ZLIB_1.2.5.1 {
+ deflatePending;
+} ZLIB_1.2.3.5;
+
+ZLIB_1.2.5.2 {
+ deflateResetKeep;
+ gzgetc_;
+ inflateResetKeep;
+} ZLIB_1.2.5.1;
+
+ZLIB_1.2.7.1 {
+ inflateGetDictionary;
+ gzvprintf;
+} ZLIB_1.2.5.2;
diff --git a/protocols/Telegram/tgl/zlib/zlib.pc.cmakein b/protocols/Telegram/tgl/zlib/zlib.pc.cmakein
new file mode 100644
index 0000000000..a5e642938c
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/zlib.pc.cmakein
@@ -0,0 +1,13 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=@CMAKE_INSTALL_PREFIX@
+libdir=@INSTALL_LIB_DIR@
+sharedlibdir=@INSTALL_LIB_DIR@
+includedir=@INSTALL_INC_DIR@
+
+Name: zlib
+Description: zlib compression library
+Version: @VERSION@
+
+Requires:
+Libs: -L${libdir} -L${sharedlibdir} -lz
+Cflags: -I${includedir}
diff --git a/protocols/Telegram/tgl/zlib/zlib.pc.in b/protocols/Telegram/tgl/zlib/zlib.pc.in
new file mode 100644
index 0000000000..7e5acf9c77
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/zlib.pc.in
@@ -0,0 +1,13 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+sharedlibdir=@sharedlibdir@
+includedir=@includedir@
+
+Name: zlib
+Description: zlib compression library
+Version: @VERSION@
+
+Requires:
+Libs: -L${libdir} -L${sharedlibdir} -lz
+Cflags: -I${includedir}
diff --git a/protocols/Telegram/tgl/zlib/zlib2ansi b/protocols/Telegram/tgl/zlib/zlib2ansi
new file mode 100644
index 0000000000..15e3e165f3
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/zlib2ansi
@@ -0,0 +1,152 @@
+#!/usr/bin/perl
+
+# Transform K&R C function definitions into ANSI equivalent.
+#
+# Author: Paul Marquess
+# Version: 1.0
+# Date: 3 October 2006
+
+# TODO
+#
+# Asumes no function pointer parameters. unless they are typedefed.
+# Assumes no literal strings that look like function definitions
+# Assumes functions start at the beginning of a line
+
+use strict;
+use warnings;
+
+local $/;
+$_ = <>;
+
+my $sp = qr{ \s* (?: /\* .*? \*/ )? \s* }x; # assume no nested comments
+
+my $d1 = qr{ $sp (?: [\w\*\s]+ $sp)* $sp \w+ $sp [\[\]\s]* $sp }x ;
+my $decl = qr{ $sp (?: \w+ $sp )+ $d1 }xo ;
+my $dList = qr{ $sp $decl (?: $sp , $d1 )* $sp ; $sp }xo ;
+
+
+while (s/^
+ ( # Start $1
+ ( # Start $2
+ .*? # Minimal eat content
+ ( ^ \w [\w\s\*]+ ) # $3 -- function name
+ \s* # optional whitespace
+ ) # $2 - Matched up to before parameter list
+
+ \( \s* # Literal "(" + optional whitespace
+ ( [^\)]+ ) # $4 - one or more anythings except ")"
+ \s* \) # optional whitespace surrounding a Literal ")"
+
+ ( (?: $dList )+ ) # $5
+
+ $sp ^ { # literal "{" at start of line
+ ) # Remember to $1
+ //xsom
+ )
+{
+ my $all = $1 ;
+ my $prefix = $2;
+ my $param_list = $4 ;
+ my $params = $5;
+
+ StripComments($params);
+ StripComments($param_list);
+ $param_list =~ s/^\s+//;
+ $param_list =~ s/\s+$//;
+
+ my $i = 0 ;
+ my %pList = map { $_ => $i++ }
+ split /\s*,\s*/, $param_list;
+ my $pMatch = '(\b' . join('|', keys %pList) . '\b)\W*$' ;
+
+ my @params = split /\s*;\s*/, $params;
+ my @outParams = ();
+ foreach my $p (@params)
+ {
+ if ($p =~ /,/)
+ {
+ my @bits = split /\s*,\s*/, $p;
+ my $first = shift @bits;
+ $first =~ s/^\s*//;
+ push @outParams, $first;
+ $first =~ /^(\w+\s*)/;
+ my $type = $1 ;
+ push @outParams, map { $type . $_ } @bits;
+ }
+ else
+ {
+ $p =~ s/^\s+//;
+ push @outParams, $p;
+ }
+ }
+
+
+ my %tmp = map { /$pMatch/; $_ => $pList{$1} }
+ @outParams ;
+
+ @outParams = map { " $_" }
+ sort { $tmp{$a} <=> $tmp{$b} }
+ @outParams ;
+
+ print $prefix ;
+ print "(\n" . join(",\n", @outParams) . ")\n";
+ print "{" ;
+
+}
+
+# Output any trailing code.
+print ;
+exit 0;
+
+
+sub StripComments
+{
+
+ no warnings;
+
+ # Strip C & C++ coments
+ # From the perlfaq
+ $_[0] =~
+
+ s{
+ /\* ## Start of /* ... */ comment
+ [^*]*\*+ ## Non-* followed by 1-or-more *'s
+ (
+ [^/*][^*]*\*+
+ )* ## 0-or-more things which don't start with /
+ ## but do end with '*'
+ / ## End of /* ... */ comment
+
+ | ## OR C++ Comment
+ // ## Start of C++ comment //
+ [^\n]* ## followed by 0-or-more non end of line characters
+
+ | ## OR various things which aren't comments:
+
+ (
+ " ## Start of " ... " string
+ (
+ \\. ## Escaped char
+ | ## OR
+ [^"\\] ## Non "\
+ )*
+ " ## End of " ... " string
+
+ | ## OR
+
+ ' ## Start of ' ... ' string
+ (
+ \\. ## Escaped char
+ | ## OR
+ [^'\\] ## Non '\
+ )*
+ ' ## End of ' ... ' string
+
+ | ## OR
+
+ . ## Anything other char
+ [^/"'\\]* ## Chars which doesn't start a comment, string or escape
+ )
+ }{$2}gxs;
+
+}
diff --git a/protocols/Telegram/tgl/zlib/zutil.c b/protocols/Telegram/tgl/zlib/zutil.c
new file mode 100644
index 0000000000..23d2ebef00
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/zutil.c
@@ -0,0 +1,324 @@
+/* zutil.c -- target dependent utility functions for the compression library
+ * Copyright (C) 1995-2005, 2010, 2011, 2012 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#include "zutil.h"
+#ifndef Z_SOLO
+# include "gzguts.h"
+#endif
+
+#ifndef NO_DUMMY_DECL
+struct internal_state {int dummy;}; /* for buggy compilers */
+#endif
+
+z_const char * const z_errmsg[10] = {
+"need dictionary", /* Z_NEED_DICT 2 */
+"stream end", /* Z_STREAM_END 1 */
+"", /* Z_OK 0 */
+"file error", /* Z_ERRNO (-1) */
+"stream error", /* Z_STREAM_ERROR (-2) */
+"data error", /* Z_DATA_ERROR (-3) */
+"insufficient memory", /* Z_MEM_ERROR (-4) */
+"buffer error", /* Z_BUF_ERROR (-5) */
+"incompatible version",/* Z_VERSION_ERROR (-6) */
+""};
+
+
+const char * ZEXPORT zlibVersion()
+{
+ return ZLIB_VERSION;
+}
+
+uLong ZEXPORT zlibCompileFlags()
+{
+ uLong flags;
+
+ flags = 0;
+ switch ((int)(sizeof(uInt))) {
+ case 2: break;
+ case 4: flags += 1; break;
+ case 8: flags += 2; break;
+ default: flags += 3;
+ }
+ switch ((int)(sizeof(uLong))) {
+ case 2: break;
+ case 4: flags += 1 << 2; break;
+ case 8: flags += 2 << 2; break;
+ default: flags += 3 << 2;
+ }
+ switch ((int)(sizeof(voidpf))) {
+ case 2: break;
+ case 4: flags += 1 << 4; break;
+ case 8: flags += 2 << 4; break;
+ default: flags += 3 << 4;
+ }
+ switch ((int)(sizeof(z_off_t))) {
+ case 2: break;
+ case 4: flags += 1 << 6; break;
+ case 8: flags += 2 << 6; break;
+ default: flags += 3 << 6;
+ }
+#ifdef DEBUG
+ flags += 1 << 8;
+#endif
+#if defined(ASMV) || defined(ASMINF)
+ flags += 1 << 9;
+#endif
+#ifdef ZLIB_WINAPI
+ flags += 1 << 10;
+#endif
+#ifdef BUILDFIXED
+ flags += 1 << 12;
+#endif
+#ifdef DYNAMIC_CRC_TABLE
+ flags += 1 << 13;
+#endif
+#ifdef NO_GZCOMPRESS
+ flags += 1L << 16;
+#endif
+#ifdef NO_GZIP
+ flags += 1L << 17;
+#endif
+#ifdef PKZIP_BUG_WORKAROUND
+ flags += 1L << 20;
+#endif
+#ifdef FASTEST
+ flags += 1L << 21;
+#endif
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
+# ifdef NO_vsnprintf
+ flags += 1L << 25;
+# ifdef HAS_vsprintf_void
+ flags += 1L << 26;
+# endif
+# else
+# ifdef HAS_vsnprintf_void
+ flags += 1L << 26;
+# endif
+# endif
+#else
+ flags += 1L << 24;
+# ifdef NO_snprintf
+ flags += 1L << 25;
+# ifdef HAS_sprintf_void
+ flags += 1L << 26;
+# endif
+# else
+# ifdef HAS_snprintf_void
+ flags += 1L << 26;
+# endif
+# endif
+#endif
+ return flags;
+}
+
+#ifdef DEBUG
+
+# ifndef verbose
+# define verbose 0
+# endif
+int ZLIB_INTERNAL z_verbose = verbose;
+
+void ZLIB_INTERNAL z_error (m)
+ char *m;
+{
+ fprintf(stderr, "%s\n", m);
+ exit(1);
+}
+#endif
+
+/* exported to allow conversion of error code to string for compress() and
+ * uncompress()
+ */
+const char * ZEXPORT zError(err)
+ int err;
+{
+ return ERR_MSG(err);
+}
+
+#if defined(_WIN32_WCE)
+ /* The Microsoft C Run-Time Library for Windows CE doesn't have
+ * errno. We define it as a global variable to simplify porting.
+ * Its value is always 0 and should not be used.
+ */
+ int errno = 0;
+#endif
+
+#ifndef HAVE_MEMCPY
+
+void ZLIB_INTERNAL zmemcpy(dest, source, len)
+ Bytef* dest;
+ const Bytef* source;
+ uInt len;
+{
+ if (len == 0) return;
+ do {
+ *dest++ = *source++; /* ??? to be unrolled */
+ } while (--len != 0);
+}
+
+int ZLIB_INTERNAL zmemcmp(s1, s2, len)
+ const Bytef* s1;
+ const Bytef* s2;
+ uInt len;
+{
+ uInt j;
+
+ for (j = 0; j < len; j++) {
+ if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1;
+ }
+ return 0;
+}
+
+void ZLIB_INTERNAL zmemzero(dest, len)
+ Bytef* dest;
+ uInt len;
+{
+ if (len == 0) return;
+ do {
+ *dest++ = 0; /* ??? to be unrolled */
+ } while (--len != 0);
+}
+#endif
+
+#ifndef Z_SOLO
+
+#ifdef SYS16BIT
+
+#ifdef __TURBOC__
+/* Turbo C in 16-bit mode */
+
+# define MY_ZCALLOC
+
+/* Turbo C malloc() does not allow dynamic allocation of 64K bytes
+ * and farmalloc(64K) returns a pointer with an offset of 8, so we
+ * must fix the pointer. Warning: the pointer must be put back to its
+ * original form in order to free it, use zcfree().
+ */
+
+#define MAX_PTR 10
+/* 10*64K = 640K */
+
+local int next_ptr = 0;
+
+typedef struct ptr_table_s {
+ voidpf org_ptr;
+ voidpf new_ptr;
+} ptr_table;
+
+local ptr_table table[MAX_PTR];
+/* This table is used to remember the original form of pointers
+ * to large buffers (64K). Such pointers are normalized with a zero offset.
+ * Since MSDOS is not a preemptive multitasking OS, this table is not
+ * protected from concurrent access. This hack doesn't work anyway on
+ * a protected system like OS/2. Use Microsoft C instead.
+ */
+
+voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size)
+{
+ voidpf buf = opaque; /* just to make some compilers happy */
+ ulg bsize = (ulg)items*size;
+
+ /* If we allocate less than 65520 bytes, we assume that farmalloc
+ * will return a usable pointer which doesn't have to be normalized.
+ */
+ if (bsize < 65520L) {
+ buf = farmalloc(bsize);
+ if (*(ush*)&buf != 0) return buf;
+ } else {
+ buf = farmalloc(bsize + 16L);
+ }
+ if (buf == NULL || next_ptr >= MAX_PTR) return NULL;
+ table[next_ptr].org_ptr = buf;
+
+ /* Normalize the pointer to seg:0 */
+ *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4;
+ *(ush*)&buf = 0;
+ table[next_ptr++].new_ptr = buf;
+ return buf;
+}
+
+void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
+{
+ int n;
+ if (*(ush*)&ptr != 0) { /* object < 64K */
+ farfree(ptr);
+ return;
+ }
+ /* Find the original pointer */
+ for (n = 0; n < next_ptr; n++) {
+ if (ptr != table[n].new_ptr) continue;
+
+ farfree(table[n].org_ptr);
+ while (++n < next_ptr) {
+ table[n-1] = table[n];
+ }
+ next_ptr--;
+ return;
+ }
+ ptr = opaque; /* just to make some compilers happy */
+ Assert(0, "zcfree: ptr not found");
+}
+
+#endif /* __TURBOC__ */
+
+
+#ifdef M_I86
+/* Microsoft C in 16-bit mode */
+
+# define MY_ZCALLOC
+
+#if (!defined(_MSC_VER) || (_MSC_VER <= 600))
+# define _halloc halloc
+# define _hfree hfree
+#endif
+
+voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size)
+{
+ if (opaque) opaque = 0; /* to make compiler happy */
+ return _halloc((long)items, size);
+}
+
+void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
+{
+ if (opaque) opaque = 0; /* to make compiler happy */
+ _hfree(ptr);
+}
+
+#endif /* M_I86 */
+
+#endif /* SYS16BIT */
+
+
+#ifndef MY_ZCALLOC /* Any system without a special alloc function */
+
+#ifndef STDC
+extern voidp malloc OF((uInt size));
+extern voidp calloc OF((uInt items, uInt size));
+extern void free OF((voidpf ptr));
+#endif
+
+voidpf ZLIB_INTERNAL zcalloc (opaque, items, size)
+ voidpf opaque;
+ unsigned items;
+ unsigned size;
+{
+ if (opaque) items += size - size; /* make compiler happy */
+ return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
+ (voidpf)calloc(items, size);
+}
+
+void ZLIB_INTERNAL zcfree (opaque, ptr)
+ voidpf opaque;
+ voidpf ptr;
+{
+ free(ptr);
+ if (opaque) return; /* make compiler happy */
+}
+
+#endif /* MY_ZCALLOC */
+
+#endif /* !Z_SOLO */
diff --git a/protocols/Telegram/tgl/zlib/zutil.h b/protocols/Telegram/tgl/zlib/zutil.h
new file mode 100644
index 0000000000..24ab06b1cf
--- /dev/null
+++ b/protocols/Telegram/tgl/zlib/zutil.h
@@ -0,0 +1,253 @@
+/* zutil.h -- internal interface and configuration of the compression library
+ * Copyright (C) 1995-2013 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+/* @(#) $Id$ */
+
+#ifndef ZUTIL_H
+#define ZUTIL_H
+
+#ifdef HAVE_HIDDEN
+# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
+#else
+# define ZLIB_INTERNAL
+#endif
+
+#include "zlib.h"
+
+#if defined(STDC) && !defined(Z_SOLO)
+# if !(defined(_WIN32_WCE) && defined(_MSC_VER))
+# include <stddef.h>
+# endif
+# include <string.h>
+# include <stdlib.h>
+#endif
+
+#ifdef Z_SOLO
+ typedef long ptrdiff_t; /* guess -- will be caught if guess is wrong */
+#endif
+
+#ifndef local
+# define local static
+#endif
+/* compile with -Dlocal if your debugger can't find static symbols */
+
+typedef unsigned char uch;
+typedef uch FAR uchf;
+typedef unsigned short ush;
+typedef ush FAR ushf;
+typedef unsigned long ulg;
+
+extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
+/* (size given to avoid silly warnings with Visual C++) */
+
+#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
+
+#define ERR_RETURN(strm,err) \
+ return (strm->msg = ERR_MSG(err), (err))
+/* To be used only when the state is known to be valid */
+
+ /* common constants */
+
+#ifndef DEF_WBITS
+# define DEF_WBITS MAX_WBITS
+#endif
+/* default windowBits for decompression. MAX_WBITS is for compression only */
+
+#if MAX_MEM_LEVEL >= 8
+# define DEF_MEM_LEVEL 8
+#else
+# define DEF_MEM_LEVEL MAX_MEM_LEVEL
+#endif
+/* default memLevel */
+
+#define STORED_BLOCK 0
+#define STATIC_TREES 1
+#define DYN_TREES 2
+/* The three kinds of block type */
+
+#define MIN_MATCH 3
+#define MAX_MATCH 258
+/* The minimum and maximum match lengths */
+
+#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
+
+ /* target dependencies */
+
+#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
+# define OS_CODE 0x00
+# ifndef Z_SOLO
+# if defined(__TURBOC__) || defined(__BORLANDC__)
+# if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
+ /* Allow compilation with ANSI keywords only enabled */
+ void _Cdecl farfree( void *block );
+ void *_Cdecl farmalloc( unsigned long nbytes );
+# else
+# include <alloc.h>
+# endif
+# else /* MSC or DJGPP */
+# include <malloc.h>
+# endif
+# endif
+#endif
+
+#ifdef AMIGA
+# define OS_CODE 0x01
+#endif
+
+#if defined(VAXC) || defined(VMS)
+# define OS_CODE 0x02
+# define F_OPEN(name, mode) \
+ fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
+#endif
+
+#if defined(ATARI) || defined(atarist)
+# define OS_CODE 0x05
+#endif
+
+#ifdef OS2
+# define OS_CODE 0x06
+# if defined(M_I86) && !defined(Z_SOLO)
+# include <malloc.h>
+# endif
+#endif
+
+#if defined(MACOS) || defined(TARGET_OS_MAC)
+# define OS_CODE 0x07
+# ifndef Z_SOLO
+# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
+# include <unix.h> /* for fdopen */
+# else
+# ifndef fdopen
+# define fdopen(fd,mode) NULL /* No fdopen() */
+# endif
+# endif
+# endif
+#endif
+
+#ifdef TOPS20
+# define OS_CODE 0x0a
+#endif
+
+#ifdef WIN32
+# ifndef __CYGWIN__ /* Cygwin is Unix, not Win32 */
+# define OS_CODE 0x0b
+# endif
+#endif
+
+#ifdef __50SERIES /* Prime/PRIMOS */
+# define OS_CODE 0x0f
+#endif
+
+#if defined(_BEOS_) || defined(RISCOS)
+# define fdopen(fd,mode) NULL /* No fdopen() */
+#endif
+
+#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
+# if defined(_WIN32_WCE)
+# define fdopen(fd,mode) NULL /* No fdopen() */
+# ifndef _PTRDIFF_T_DEFINED
+ typedef int ptrdiff_t;
+# define _PTRDIFF_T_DEFINED
+# endif
+# else
+# define fdopen(fd,type) _fdopen(fd,type)
+# endif
+#endif
+
+#if defined(__BORLANDC__) && !defined(MSDOS)
+ #pragma warn -8004
+ #pragma warn -8008
+ #pragma warn -8066
+#endif
+
+/* provide prototypes for these when building zlib without LFS */
+#if !defined(_WIN32) && \
+ (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
+ ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
+ ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
+#endif
+
+ /* common defaults */
+
+#ifndef OS_CODE
+# define OS_CODE 0x03 /* assume Unix */
+#endif
+
+#ifndef F_OPEN
+# define F_OPEN(name, mode) fopen((name), (mode))
+#endif
+
+ /* functions */
+
+#if defined(pyr) || defined(Z_SOLO)
+# define NO_MEMCPY
+#endif
+#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
+ /* Use our own functions for small and medium model with MSC <= 5.0.
+ * You may have to use the same strategy for Borland C (untested).
+ * The __SC__ check is for Symantec.
+ */
+# define NO_MEMCPY
+#endif
+#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
+# define HAVE_MEMCPY
+#endif
+#ifdef HAVE_MEMCPY
+# ifdef SMALL_MEDIUM /* MSDOS small or medium model */
+# define zmemcpy _fmemcpy
+# define zmemcmp _fmemcmp
+# define zmemzero(dest, len) _fmemset(dest, 0, len)
+# else
+# define zmemcpy memcpy
+# define zmemcmp memcmp
+# define zmemzero(dest, len) memset(dest, 0, len)
+# endif
+#else
+ void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
+ int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
+ void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len));
+#endif
+
+/* Diagnostic functions */
+#ifdef DEBUG
+# include <stdio.h>
+ extern int ZLIB_INTERNAL z_verbose;
+ extern void ZLIB_INTERNAL z_error OF((char *m));
+# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
+# define Trace(x) {if (z_verbose>=0) fprintf x ;}
+# define Tracev(x) {if (z_verbose>0) fprintf x ;}
+# define Tracevv(x) {if (z_verbose>1) fprintf x ;}
+# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
+# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
+#else
+# define Assert(cond,msg)
+# define Trace(x)
+# define Tracev(x)
+# define Tracevv(x)
+# define Tracec(c,x)
+# define Tracecv(c,x)
+#endif
+
+#ifndef Z_SOLO
+ voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,
+ unsigned size));
+ void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr));
+#endif
+
+#define ZALLOC(strm, items, size) \
+ (*((strm)->zalloc))((strm)->opaque, (items), (size))
+#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
+#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
+
+/* Reverse the bytes in a 32-bit value */
+#define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
+ (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
+
+#endif /* ZUTIL_H */